@dub/ui 0.2.69 → 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.
- package/dist/charts/index.mjs +1 -1
- package/dist/chunk-27KBIUXQ.mjs +2 -0
- package/dist/chunk-2APFEFAQ.mjs +6 -0
- package/dist/chunk-2W6D4KFZ.mjs +6 -0
- package/dist/chunk-3FNFJD3D.mjs +6 -0
- package/dist/chunk-4GUW235P.mjs +6 -0
- package/dist/chunk-4MZXX7Q4.mjs +6 -0
- package/dist/chunk-4XV3XPU6.mjs +2 -0
- package/dist/chunk-5BO6ORUB.mjs +6 -0
- package/dist/chunk-5BPHS3IP.mjs +2 -0
- package/dist/chunk-6B2LOFMR.mjs +2 -0
- package/dist/chunk-7K6LFUTC.mjs +6 -0
- package/dist/chunk-AYW3HJXX.mjs +2 -0
- package/dist/chunk-DBT3MUHQ.mjs +6 -0
- package/dist/chunk-DERIUHV5.mjs +6 -0
- package/dist/chunk-DZ4HSBSZ.mjs +6 -0
- package/dist/chunk-F3PZF25V.mjs +2 -0
- package/dist/chunk-F7TP4G6Z.mjs +2 -0
- package/dist/chunk-FB2K5AFM.mjs +2 -0
- package/dist/chunk-HRJQGYAW.mjs +2 -0
- package/dist/chunk-J54HXJEM.mjs +2 -0
- package/dist/chunk-JN5YXRC7.mjs +2 -0
- package/dist/chunk-JPJFKIER.mjs +6 -0
- package/dist/chunk-K5RWTWZX.mjs +6 -0
- package/dist/chunk-LW3IGZLZ.mjs +2 -0
- package/dist/chunk-RHFLXCDH.mjs +2 -0
- package/dist/chunk-RRUIYW2P.mjs +6 -0
- package/dist/chunk-T4JODWAP.mjs +6 -0
- package/dist/chunk-T5I7NTHS.mjs +6 -0
- package/dist/chunk-T7Y6MARI.mjs +2 -0
- package/dist/chunk-TF7D7ANO.mjs +2 -0
- package/dist/chunk-TKM2MHOO.mjs +6 -0
- package/dist/chunk-UAQ2HLPX.mjs +2 -0
- package/dist/chunk-VNO6TU52.mjs +2 -0
- package/dist/chunk-W5OLICQC.mjs +2 -0
- package/dist/chunk-WHTIHVJH.mjs +6 -0
- package/dist/chunk-WKH67IZC.mjs +2 -0
- package/dist/chunk-WNY3VD7Q.mjs +2 -0
- package/dist/chunk-XPQ5USEX.mjs +2 -0
- package/dist/chunk-XYGQKVYJ.mjs +6 -0
- package/dist/chunk-YKK6HWJP.mjs +2 -0
- package/dist/chunk-ZJ4SRHCP.mjs +6 -0
- package/dist/chunk-ZJKQCWHI.mjs +2 -0
- package/dist/icons/index.d.ts +7 -1
- package/dist/icons/index.mjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +36 -21
- package/dist/index.mjs +25 -25
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
"use client"
|
|
2
|
-
import{$ as m0,$a as og,$b as Kg,$c as Eb,$d as Ch,$e as hv,A as Yf,Aa as z0,Ab as kg,Ac as da,Ad as th,Ae as Ca,B as Zf,Ba as F0,Bb as Cg,Bc as fb,Bd as rh,Be as Pa,C as pr,Ca as H0,Cb as Pg,Cc as gb,Cd as oh,Ce as Sa,D as qf,Da as _0,Db as Sg,Dc as ua,Dd as nh,De as Ta,E as Xf,Ea as hr,Eb as Tg,Ec as bb,Ed as ah,Ee as qh,F as fr,Fa as $0,Fb as Rg,Fc as ma,Fd as ya,Fe as Xh,G as Jf,Ga as B0,Gb as Lg,Gc as hb,Gd as ih,Ge as Jh,H as Qf,Ha as W0,Hb as Mg,Hc as vb,Hd as sh,He as Qh,I as e0,Ia as U0,Ib as Eg,Ic as xb,Id as lh,Ie as ev,J as t0,Ja as Kn,Jb as ra,Jc as yb,Jd as ch,Je as tv,K as r0,Ka as G0,Kb as Ig,Kc as wb,Kd as dh,Ke as rv,L as gr,La as K0,Lb as Dg,Lc as pa,Ld as uh,Le as ov,M as o0,Ma as jn,Mb as Ag,Mc as fa,Md as mh,Me as nv,N as br,Na as j0,Nb as xr,Nc as Nb,Nd as ph,Ne as av,O as n0,Oa as Y0,Ob as Og,Oc as kb,Od as yt,Oe as iv,P as a0,Pa as Z0,Pb as Vg,Pc as Cb,Pd as fh,Pe as sv,Q as i0,Qa as q0,Qb as zg,Qc as Pb,Qd as gh,Qe as lv,R as s0,Ra as X0,Rb as Fg,Rc as Sb,Rd as bh,Re as cv,S as l0,Sa as J0,Sb as Hg,Sc as ga,Sd as hh,Se as dv,T as c0,Ta as Q0,Tb as oa,Tc as Tb,Td as vh,Te as uv,U as d0,Ua as eg,Ub as _g,Uc as ba,Ud as wa,Ue as mv,V as Hn,Va as tg,Vb as $g,Vc as ha,Vd as xh,Ve as zt,W as _n,Wa as rg,Wb as Bg,Wc as Rb,Wd as yh,We as pv,X as $n,Xa as xt,Xb as Wg,Xc as Lb,Xd as Na,Xe as fv,Y as Bn,Ya as vr,Yb as Ug,Yc as Mb,Yd as wh,Ye as gv,Z as Wn,Za as Yn,Zb as Gg,Zc as va,Zd as Nh,Ze as bv,_ as u0,_a as Zn,_b as na,_c as xa,_d as kh,_e as Ra,a as Vf,aa as p0,ab as ng,ac as aa,ad as Ib,ae as Ph,af as vv,b as In,ba as f0,bb as ag,bc as ia,bd as Db,be as Sh,bf as xv,c as zf,ca as g0,cb as ig,cc as jg,cd as Ab,ce as Th,cf as yv,d as bt,da as b0,db as qn,dc as sa,dd as Ob,de as Rh,df as wv,e as mr,ea as h0,eb as Xn,ec as Yg,ed as yr,ee as Lh,ef as Nv,f as Ff,fa as v0,fb as sg,fc as Zg,fd as Vb,fe as Mh,ff as kv,g as ht,ga as x0,gb as lg,gc as qg,gd as zb,ge as Eh,gf as Cv,h as vt,ha as y0,hb as cg,hc as Xg,hd as Fb,he as Ih,i as fo,ia as w0,ib as Jn,ic as Jg,id as Hb,ie as Dh,j as Dn,ja as N0,jb as Qn,jc as Qg,jd as _b,je as Ah,k as Hf,ka as k0,kb as ea,kc as eb,kd as $b,ke as Oh,l as _f,la as C0,lb as dg,lc as la,ld as Bb,le as Vh,m as $f,ma as P0,mb as ug,mc as tb,md as Wb,me as zh,n as Bf,na as S0,nb as mg,nc as rb,nd as Ub,ne as Fh,o as An,oa as T0,ob as pg,oc as ob,od as Gb,oe as Hh,p as Wf,pa as R0,pb as fg,pc as nb,pd as Kb,pe as _h,q as Uf,qa as L0,qb as go,qc as ab,qd as jb,qe as $h,r as On,ra as M0,rb as gg,rc as ib,rd as Yb,re as Bh,s as Vn,sa as Un,sb as bg,sc as sb,sd as Zb,se as Wh,t as zn,ta as E0,tb as hg,tc as lb,td as wr,te as Uh,u as Fn,ua as I0,ub as vg,uc as cb,ud as Nr,ue as Gh,v as Gf,va as Gn,vb as ta,vc as db,vd as qb,ve as Kh,w as Vt,wa as D0,wb as xg,wc as ca,wd as Xb,we as jh,x as Kf,xa as A0,xb as yg,xc as ub,xd as Jb,xe as Yh,y as be,ya as O0,yb as wg,yc as mb,yd as Qb,ye as Zh,z as jf,za as V0,zb as Ng,zc as pb,zd as eh,ze as ka}from"./chunk-6VPQEKGX.mjs";import{a as ee}from"./chunk-NWME2ANF.mjs";import{a as yn,b as W,c as wn,d as Nn,e as Le,f as kn,g as Cn,h as Pn,i as Sn,j as Tn,k as mo,l as Ot,m as Rn,n as Ln,o as Mn,p as En,q as gt,r as ye,s as we,t as i,v as po,w as ur}from"./chunk-W3YBFHMA.mjs";import*as se from"@radix-ui/react-accordion";import{ChevronDown as Bs}from"lucide-react";import*as Cr from"react";import{jsx as kr,jsxs as Ks}from"react/jsx-runtime";var Mv=se.Root,Ws=Cr.forwardRef(({className:e,...t},r)=>kr(se.Item,{ref:r,className:i("border-b border-b-slate-200 py-3 last:border-none",e),...t}));Ws.displayName="AccordionItem";var Us=Cr.forwardRef(({className:e,children:t,variant:r="chevron",...o},n)=>{let a=r==="chevron"?Bs:yt;return kr(se.Header,{className:"flex",children:Ks(se.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,kr(a,{className:"h-5 w-5 flex-none transition-transform duration-300"})]})})});Us.displayName=se.Trigger.displayName;var Gs=Cr.forwardRef(({className:e,children:t,...r},o)=>kr(se.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}));Gs.displayName=se.Content.displayName;import{useMemo as Pr}from"react";import{jsx as Ne,jsxs as Ea}from"react/jsx-runtime";var Me={positive:"#00C951",negative:"#FB2C36",neutral:"#e5e5e5",positiveIcon:"#166534",negativeIcon:"#991b1b",neutralIcon:"#262626"},he=15,wt=30;function Nt(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 La(e,t,r,o,n){let a=Nt(e,t,r,o),d=Nt(e,t,r,n),m=n-o>180?1:0;return`M ${a.x} ${a.y} A ${r} ${r} 0 ${m} 1 ${d.x} ${d.y}`}function Ma(e,t,r,o,n,a){let d=Nt(e,t,r,n),l=Nt(e,t,r,a),m=Nt(e,t,o,n),c=Nt(e,t,o,a),u=a-n>180?1:0;return[`M ${d.x} ${d.y}`,`A ${r} ${r} 0 ${u} 1 ${l.x} ${l.y}`,`L ${c.x} ${c.y}`,`A ${o} ${o} 0 ${u} 0 ${m.x} ${m.y}`,"Z"].join(" ")}function Vv({positiveValue:e,negativeValue:t,size:r=40,positiveIcon:o,negativeIcon:n,neutralIcon:a,className:d}){let l=Pr(()=>e>t?"positive":t>e?"negative":"neutral",[e,t]),{positiveArc:m,negativeArc:c,showOnlyPositive:s,showOnlyNegative:u}=Pr(()=>{let I=e+t,y=360-he*2;if(I===0){let L=y/2;return{positiveArc:{start:he/2,end:he/2+L},negativeArc:{start:180+he/2,end:180+he/2+L},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 O=e/I,R=O*y,T=(1-O)*y;return e>0&&R<wt&&(R=wt,T=y-wt),t>0&&T<wt&&(T=wt,R=y-wt),{positiveArc:{start:he/2,end:he/2+R},negativeArc:{start:he/2+R+he,end:he/2+R+he+T},showOnlyPositive:!1,showOnlyNegative:!1}},[e,t]),p=r/2,f=3,g=(r-f)/2,b=g-f/2,w=r*.28,P=Pr(()=>{switch(l){case"positive":return o;case"negative":return n;default:return a}},[l,o,n,a]),k=Pr(()=>{switch(l){case"positive":return Me.positiveIcon;case"negative":return Me.negativeIcon;default:return Me.neutralIcon}},[l]),x=Me.positive,S=Me.negative;return Ea("div",{className:i("relative shrink-0",d),style:{width:r,height:r},children:[Ea("svg",{width:r,height:r,viewBox:`0 0 ${r} ${r}`,children:[s&&Ne("circle",{cx:p,cy:p,r:(b+w)/2,fill:"none",stroke:Me.positive,strokeWidth:b-w,opacity:.1}),u&&Ne("circle",{cx:p,cy:p,r:(b+w)/2,fill:"none",stroke:Me.negative,strokeWidth:b-w,opacity:.1}),e>0&&!s&&Ne("path",{d:Ma(p,p,b,w,m.start,m.end),fill:Me.positive,opacity:.1}),t>0&&!u&&Ne("path",{d:Ma(p,p,b,w,c.start,c.end),fill:Me.negative,opacity:.1}),s&&Ne("circle",{cx:p,cy:p,r:g,fill:"none",stroke:x,strokeWidth:f}),u&&Ne("circle",{cx:p,cy:p,r:g,fill:"none",stroke:S,strokeWidth:f}),!s&&!u&&Ne("path",{d:La(p,p,g,m.start,m.end),stroke:x,strokeWidth:f,fill:"none",strokeLinecap:"round"}),!s&&!u&&Ne("path",{d:La(p,p,g,c.start,c.end),stroke:S,strokeWidth:f,fill:"none",strokeLinecap:"round"})]}),P&&Ne("div",{className:"absolute inset-0 flex items-center justify-center",style:{color:k},children:Ne(P,{className:"size-3.5"})})]})}import{cva as js}from"class-variance-authority";import*as Sr from"react";import{jsx as bo}from"react/jsx-runtime";var Ys=js("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"}}),Zs=Sr.forwardRef(({className:e,variant:t,...r},o)=>bo("div",{ref:o,role:"alert",className:i(Ys({variant:t}),e),...r}));Zs.displayName="Alert";var qs=Sr.forwardRef(({className:e,...t},r)=>bo("h5",{ref:r,className:i("text-md mb-2 font-medium leading-none tracking-tight",e),...t}));qs.displayName="AlertTitle";var Xs=Sr.forwardRef(({className:e,...t},r)=>bo("div",{ref:r,className:i("text-sm [&_p]:leading-relaxed",e),...t}));Xs.displayName="AlertDescription";import{sha256 as Js}from"js-sha256";import{useState as Qs}from"react";import{jsx as ho}from"react/jsx-runtime";function el(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/${Js(e.email)}?d=${t}`:t}function Uv({user:e={},className:t}){if(!e)return ho("div",{className:i("h-10 w-10 animate-pulse rounded-full border border-neutral-300 bg-neutral-100",t)});let[r,o]=Qs(el(e));return ho("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 Gv({id:e,className:t}){return ho("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 tl}from"class-variance-authority";import{jsx as ol}from"react/jsx-runtime";var rl=tl("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 Ia({className:e,variant:t,...r}){return ol("span",{className:i(rl({variant:t}),e),...r})}import{cva as Gl}from"class-variance-authority";import{forwardRef as Kl}from"react";import*as ke from"@radix-ui/react-tooltip";import{HelpCircle as _l}from"lucide-react";import $l from"next/link";import{useEffect as Bl,useRef as Wl,useState as wo}from"react";import Ul from"react-markdown";import{useCallback as il,useEffect as sl,useState as ll}from"react";import{useEffect as nl,useState as al}from"react";function Tr(e){let[t,r]=al(),o=([n])=>{r(n)};return nl(()=>{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 Fe(e,{direction:t="vertical"}={}){let[r,o]=ll(1),n=il(()=>{if(!e.current)return;let d=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(d/(l-m),1))},[t]),a=Tr(e);return sl(n,[a]),{scrollProgress:r,updateScrollProgress:n}}import{EditorContent as Fl}from"@tiptap/react";import xl from"@tiptap/extension-file-handler";import yl from"@tiptap/extension-image";import wl from"@tiptap/extension-link";import Nl from"@tiptap/extension-mention";import{Placeholder as kl}from"@tiptap/extensions";import{Markdown as Cl}from"@tiptap/markdown";import{useEditor as Pl}from"@tiptap/react";import Sl from"@tiptap/starter-kit";import{createContext as Tl,forwardRef as Rl,useContext as Ll,useImperativeHandle as Ml,useMemo as El,useState as Il}from"react";import{computePosition as cl,flip as dl,shift as ul}from"@floating-ui/dom";import{posToDOMRect as ml,ReactRenderer as pl}from"@tiptap/react";import{forwardRef as fl,useEffect as gl,useImperativeHandle as bl,useState as hl}from"react";import{jsx as vo}from"react/jsx-runtime";var Da=(e,t)=>{cl({getBoundingClientRect:()=>ml(e.view,e.state.selection.from,e.state.selection.to)},t,{placement:"bottom-start",strategy:"absolute",middleware:[ul(),dl()]}).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`})},Oa=e=>({items:({query:t})=>e.filter(r=>r.toLowerCase().startsWith(t.toLowerCase())).slice(0,5),render:()=>{let t;return{onStart:r=>{t=new pl(vl,{props:r,editor:r.editor}),r.clientRect&&(t.element.style.position="absolute",document.body.appendChild(t.element),Da(r.editor,t.element))},onUpdate(r){t.updateProps(r),r.clientRect&&Da(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()}}}}),Aa=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"),vl=fl(({items:e,command:t},r)=>{let[o,n]=hl(0),a=()=>{n((o+e.length-1)%e.length)},d=()=>{n((o+1)%e.length)},l=()=>{t({id:e[o]})};return gl(()=>n(0),[e]),bl(r,()=>({onKeyDown:({event:m})=>m.key==="ArrowUp"?(a(),!0):m.key==="ArrowDown"?(d(),!0):m.key==="Enter"?(l(),!0):!1})),vo("div",{className:"border-border-subtle flex flex-col rounded-lg border bg-white p-1 shadow-sm",children:e.length?e.map((m,c)=>vo("button",{type:"button",onClick:()=>t({id:m}),"data-selected":o===c,onPointerEnter:()=>n(c),className:Aa,children:m},c)):vo("div",{className:i(Aa,"text-content-subtle font-sans"),children:"No results"})})});import{jsx as Al}from"react/jsx-runtime";var xo={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:""},Dl=["images","variables","links","headings","bold","italic","strike"],Va=Tl(null),N1=Rl(({children:e,features:t=Dl,markdown:r=!1,style:o="default",placeholder:n="Start typing...",uploadImage:a,editable:d,autoFocus:l,variables:m,initialValue:c,onChange:s,editorProps:u,editorClassName:p},f)=>{let[g,b]=Il(!1),w=El(()=>a?async(k,x,S)=>{b(!0);let I=await(a==null?void 0:a(k));if(!I){b(!1);return}x.chain().insertContentAt(S,{type:"image",attrs:{src:I}}).focus().run(),b(!1)}:null,[a]),P=Pl({editable:d??!0,autofocus:l?"end":!1,extensions:[...r?[Cl]:[],Sl.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")?[wl.extend({inclusive:!1})]:[],kl.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")&&w?[yl.configure({inline:!1,HTMLAttributes:{class:"rounded-lg max-w-full h-auto"}}),xl.configure({allowedMimeTypes:["image/png","image/jpeg","image/gif","image/webp"],onDrop:(k,x,S)=>{x.forEach(I=>w(I,k,S))},onPaste:(k,x,S)=>{if(S)return!1;x.forEach(I=>w(I,k,k.state.selection.anchor))}})]:[],...t.includes("variables")&&m?[Nl.extend({renderHTML({node:k}){return["span",{class:"px-1 py-0.5 bg-blue-100 text-blue-700 rounded font-semibold","data-type":"mention","data-id":k.attrs.id},`{{${k.attrs.id}}}`]},renderText({node:k}){return`{{${k.attrs.id}}}`}}).configure({suggestion:Oa(m)})]:[]],editorProps:{attributes:{...u==null?void 0:u.attributes,class:i("max-w-none focus:outline-none","prose prose-sm prose-neutral",xo[o],"[&_.ProseMirror-selectednode]:outline [&_.ProseMirror-selectednode]:outline-2 [&_.ProseMirror-selectednode]:outline-blue-500 [&_.ProseMirror-selectednode]:outline-offset-2",p)},...u},content:c,contentType:r?"markdown":void 0,onUpdate:({editor:k})=>s==null?void 0:s(k),immediatelyRender:!1});return Ml(f,()=>({setContent:k=>{P==null||P.commands.setContent(k)}})),Al(Va.Provider,{value:{features:t,markdown:r,editable:d,variables:m,editor:P,isUploading:g,handleImageUpload:w},children:e})});function Ft(){let e=Ll(Va);if(!e)throw new Error("useRichTextContext must be used within a RichTextProvider");return e}import{useEditorState as Fa}from"@tiptap/react";import{forwardRef as Ol,useRef as Vl}from"react";import{Fragment as za,jsx as le,jsxs as Rr}from"react/jsx-runtime";function E1({toolsStart:e,toolsEnd:t,className:r}){let{editor:o,features:n,handleImageUpload:a,isUploading:d}=Ft(),l=Fa({editor:o,selector:({editor:c})=>({isBold:Boolean(c==null?void 0:c.isActive("bold")),isItalic:Boolean(c==null?void 0:c.isActive("italic")),isStrike:Boolean(c==null?void 0:c.isActive("strike")),isHeading1:Boolean(c==null?void 0:c.isActive("heading",{level:1})),isHeading2:Boolean(c==null?void 0:c.isActive("heading",{level:2})),isSelection:(c==null?void 0:c.state.selection.from)!==(c==null?void 0:c.state.selection.to)})}),m=Vl(null);return Rr("div",{className:i("flex gap-1",d&&"pointer-events-none opacity-50",r),children:[e,(n==null?void 0:n.includes("bold"))&&le(He,{icon:ka,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"))&&le(He,{icon:Ca,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"))&&le(He,{icon:Pa,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"))&&Rr(za,{children:[le(He,{icon:pa,label:"Heading 1",isActive:l==null?void 0:l.isHeading1,onClick:()=>o==null?void 0:o.chain().focus().toggleHeading({level:1}).run()}),le(He,{icon:fa,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"))&&le(zl,{}),(n==null?void 0:n.includes("variables"))&&le(He,{icon:Gn,label:"Variable",isActive:!1,onClick:()=>{var c,s;if((s=(c=o==null?void 0:o.state.selection.$from.nodeBefore)==null?void 0:c.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&&Rr(za,{children:[le("input",{ref:m,type:"file",className:"hidden",onChange:c=>{var u;let s=(u=c.target.files)==null?void 0:u[0];!s||(a(s,o,o.state.selection.anchor),c.target.value="")}}),le(He,{icon:ba,label:"Image",isActive:!1,onClick:()=>{var c;return(c=m.current)==null?void 0:c.click()}})]}),t]})}function zl(){let{editor:e}=Ft(),t=Fa({editor:e,selector:({editor:r})=>({isSelection:(r==null?void 0:r.state.selection.from)!==(r==null?void 0:r.state.selection.to)})});return le(He,{icon:ga,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 He=Ol(({icon:e,label:t,isActive:r,onClick:o,disabled:n},a)=>Rr("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:[le(e,{className:"size-4 shrink-0 text-neutral-700"}),t&&le("span",{className:"sr-only",children:t})]}));import{jsx as yo,jsxs as Hl}from"react/jsx-runtime";function F1({className:e,...t}){let{editor:r,isUploading:o}=Ft();return Hl("div",{className:i("relative",o&&"pointer-events-none opacity-50",e),children:[yo(Fl,{editor:r,...t}),o&&yo("div",{className:"absolute inset-0 flex items-center justify-center",children:yo(be,{className:"size-4"})})]})}import{jsx as G,jsxs as No}from"react/jsx-runtime";function Q1({children:e}){return G(ke.Provider,{delayDuration:150,children:e})}var Ha=({className:e,children:t})=>G(Ul,{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",xo.condensed,e),components:{a:({node:r,...o})=>G("a",{...o,target:"_blank",rel:"noopener noreferrer",onClick:n=>n.stopPropagation()}),code:({node:r,...o})=>G("code",{...o,className:"rounded-md bg-neutral-100 px-1 py-0.5"})},children:t});function q({children:e,content:t,contentClassName:r,disabled:o,side:n="top",disableHoverableContent:a,delayDuration:d=0,...l}){let[m,c]=wo(!1);return No(ke.Root,{open:o?!1:m,onOpenChange:c,delayDuration:d,disableHoverableContent:a,children:[G(ke.Trigger,{asChild:!0,onClick:()=>{c(!0)},onBlur:()=>{c(!1)},children:e}),G(ke.Portal,{children:G(ke.Content,{sideOffset:8,side:n,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,...l,children:typeof t=="string"?G(Ha,{className:r,children:t}):typeof t=="function"?t({setOpen:c}):t})})]})}function ex({title:e,cta:t,href:r,target:o,onClick:n}){return No("div",{className:"flex max-w-xs flex-col items-center space-y-3 p-4 text-center",children:[G(Ha,{className:"p-0",children:e}),t&&(r?G($l,{href:r,...o?{target:o}:{},className:i(ce({variant:"primary"}),"flex h-8 w-full items-center justify-center whitespace-nowrap rounded-lg border px-4 text-sm"),children:t}):n?G(te,{onClick:n,text:t,variant:"primary",className:"h-8"}):null)]})}function tx(e){return G(q,{...e,children:G(_l,{className:"h-4 w-4 text-neutral-500"})})}function rx({children:e,content:t,...r}){return G(q,{content:t,...r,children:G("div",{className:"flex cursor-pointer items-center",children:G(Ia,{variant:"gray",className:"border-neutral-300 transition-all hover:bg-neutral-200",children:e})})})}function ox({children:e,tooltipProps:t,...r}){return G(q,{...t,children:G("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 kt({children:e,tooltipProps:t}){return t?G(q,{...t,children:G("div",{children:e})}):e}function nx({children:e,maxHeight:t="240px",className:r}){let o=Wl(null),{scrollProgress:n,updateScrollProgress:a}=Fe(o,{direction:"vertical"}),[d,l]=wo(!1),[m,c]=wo(!1);return Bl(()=>{let s=o.current;if(!s)return;let{scrollHeight:u,clientHeight:p}=s,f=u>p;l(f&&n>0),c(f&&n<1)},[n]),No("div",{className:"relative",children:[d&&G("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"}),G("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&&G("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 Ct,jsxs as _a}from"react/jsx-runtime";var ce=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-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"}}),te=Kl(({text:e,variant:t="primary",className:r,textWrapperClassName:o,shortcutClassName:n,loading:a,icon:d,shortcut:l,disabledTooltip:m,right:c,...s},u)=>m?Ct(q,{content:m,children:_a("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:[d,e&&Ct("div",{className:i("min-w-0 truncate",l&&"flex-1 text-left",o),children:e}),l&&Ct("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})]})}):_a("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?"cursor-not-allowed border-neutral-200 bg-neutral-100 text-neutral-400 outline-none":ce({variant:t}),r),disabled:s.disabled||a,...s,children:[a?Ct(be,{}):d||null,e&&Ct("div",{className:i("min-w-0 truncate",l&&"flex-1 text-left",o),children:e}),l&&Ct("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}),c]}));te.displayName="Button";import{cva as jl}from"class-variance-authority";import{createContext as Yl}from"react";import{jsx as $a}from"react/jsx-runtime";var Zl=jl("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"}}}),Ht=Yl({variant:"loose",loading:!1});function Ba({variant:e="loose",loading:t=!1,className:r,children:o}){return $a("ul",{className:i(Zl({variant:e,loading:t}),r),"data-variant":e,children:$a(Ht.Provider,{value:{variant:e,loading:t},children:o})})}import{cva as ql}from"class-variance-authority";import{createContext as Xl,useContext as Jl,useEffect as Ql,useRef as ec,useState as tc}from"react";import{jsx as Wa,jsxs as nc}from"react/jsx-runtime";var rc=ql("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"}}}),oc="w-full py-2.5 px-4",ko=Xl({hovered:!1});function Ua({outerClassName:e,innerClassName:t,children:r,onClick:o,onAuxClick:n,hoverStateEnabled:a=!0,banner:d}){let{variant:l}=Jl(Ht),m=ec(null),[c,s]=tc(!1);Ql(()=>{if(!c||!m.current)return;let p=setInterval(()=>{var f;((f=m.current)==null?void 0:f.matches(":hover"))===!1&&s(!1)},1e3);return()=>clearInterval(p)},[c]);let u=p=>!(document.getElementById("modal-backdrop")||we(p));return nc("li",{ref:m,className:i(rc({variant:l}),e),onPointerEnter:()=>s(!0),onPointerLeave:()=>s(!1),"data-hover-state-enabled":a,children:[d,Wa("div",{className:i(oc,t),onClick:o?p=>{u(p)&&o(p)}:void 0,onAuxClick:n?p=>{u(p)&&n(p)}:void 0,children:Wa(ko.Provider,{value:{hovered:c},children:r})})]})}var Rx=Object.assign(Ba,{Card:Object.assign(Ua,{Context:ko}),Context:Ht});import{motion as Uc}from"motion/react";import{forwardRef as Gc,useRef as Kc}from"react";var Ex=(e,t)=>e?{onClick:r=>{we(r)||(r.metaKey||r.ctrlKey?window.open(e,"_blank"):t.push(e))},onAuxClick:r=>{we(r)||window.open(e,"_blank")},role:"link",tabIndex:0,onKeyDown:r=>r.target===r.currentTarget&&r.key==="Enter"&&t.push(e)}:{};import{useEffect as ac,useState as ic}from"react";function Ga(e){if(typeof window>"u")return null;let t=window.localStorage.getItem(e);return t?JSON.parse(t):null}function Co(e,t){let[r,o]=ic(Ga(e)??t);return ac(()=>{let a=Ga(e);a&&o(a)},[e]),[r,a=>{o(a),window.localStorage.setItem(e,JSON.stringify(a))}]}function sc(e){return e&&typeof e=="object"&&Array.isArray(e.all)&&Array.isArray(e.defaultVisible)}function Vx(e,t){if(!sc(t)){let o=t,n=m=>{let c=o[m];return Object.fromEntries(c.all.map(s=>[s,c.defaultVisible.includes(s)]))},a=Object.fromEntries(Object.keys(o).map(m=>[m,n(m)])),[d,l]=Co(e,a);return{columnVisibility:d,setColumnVisibility:(m,c)=>{let s=o[m].all,u=d[m]||{},p=Object.fromEntries(s.map(f=>[f,f in c?c[f]:u[f]??!1]));l({...d,[m]:p})}}}else{let o=t,n=Object.fromEntries(o.all.map(l=>[l,o.defaultVisible.includes(l)])),[a,d]=Co(e,n);return{columnVisibility:a,setColumnVisibility:l=>{let m=o.all,c=a||{},s=Object.fromEntries(m.map(u=>[u,u in l?l[u]:c[u]??!1]));d(s)}}}}import Po from"js-cookie";import{useEffect as lc,useState as cc}from"react";function _x(e,t,r){let[o,n]=cc(()=>{let d=Po.get(e);return d?JSON.parse(d):t});return lc(()=>{let d=()=>{let l=Po.get(e);l&&n(JSON.parse(l))};return window.addEventListener("storage",d),()=>{window.removeEventListener("storage",d)}},[e]),[o,d=>{n(d),Po.set(e,JSON.stringify(d),r)}]}import{useCallback as dc,useEffect as uc,useRef as mc,useState as pc}from"react";var Pt=(e=3e3)=>{let t=mc(null),[r,o]=pc(!1),n=()=>{t.current&&(clearTimeout(t.current),t.current=null)},a=dc(async(d,{onSuccess:l,throwOnError:m}={})=>{n();try{typeof d=="string"?await navigator.clipboard.writeText(d):d instanceof ClipboardItem&&await navigator.clipboard.write([d]),o(!0),l==null||l(),Number.isFinite(e)&&e>=0&&(t.current=setTimeout(()=>o(!1),e))}catch(c){if(console.error("Failed to copy: ",c),m)throw c}},[e]);return uc(()=>()=>n(),[]),[r,a]};import{useEffect as fc,useState as gc}from"react";function Gx(){let[e,t]=gc(null);return fc(()=>{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 c=(((u=m.rootBounds)==null?void 0:u.height)||0)*.3+o;for(let g=1;g<l.length;g++){let b=l[g];if(!b)break;(b.boundingClientRect.top<m.boundingClientRect.top||m.boundingClientRect.bottom<o)&&(m=b)}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>c;)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 bc,useState as hc}from"react";function Zx(){let[e,t]=hc(null);return bc(()=>{let r=window.location.hostname;Nn.has(r)?t("app"):Cn.has(r)?t("partners"):kn.has(r)&&t("admin")},[]),{subdomain:e}}import{useCallback as vc}from"react";function Qx(e){return{handleKeyDown:vc(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 xc,useState as yc}from"react";function o2(e,t={}){let{root:r,defaultValue:o}=t,[n,a]=yc(o??!1);return xc(()=>{let d=()=>{let m=e.current;if(!m)return;let c=r==null?void 0:r.current,s=m.getBoundingClientRect(),u=c?c.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",d),window.addEventListener("resize",d);let l=null;return e.current&&(l=new IntersectionObserver(d),l.observe(e.current)),d(),()=>{((r==null?void 0:r.current)||window).removeEventListener("scroll",d),window.removeEventListener("resize",d),l==null||l.disconnect()}},[e,r]),n}import{useEffect as wc,useState as Nc}from"react";function i2(){let[e,t]=Nc(!1);return wc(()=>{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 kc,useState as Cc}from"react";function d2(e,{threshold:t=0,root:r=null,rootMargin:o="0%",freezeOnceVisible:n=!1}={}){let[a,d]=Cc(),l=(a==null?void 0:a.isIntersecting)&&n,m=([c])=>{d(c)};return kc(()=>{let c=e==null?void 0:e.current;if(!!!window.IntersectionObserver||l||!c)return;let u={threshold:t,root:r,rootMargin:o},p=new IntersectionObserver(m,u);return p.observe(c),()=>p.disconnect()},[e,JSON.stringify(t),r,o,l]),a}import{createContext as Pc,useCallback as Sc,useContext as Tc,useEffect as Ka,useId as Rc,useState as Lc}from"react";import{jsx as Mc}from"react/jsx-runtime";var ja=Pc({listeners:[],setListeners:()=>{}});function b2({children:e}){let[t,r]=Lc([]);return Mc(ja.Provider,{value:{listeners:t,setListeners:r},children:e})}function _e(e,t,r={}){let o=Rc(),{listeners:n,setListeners:a}=Tc(ja),d=Sc(l=>{if(r.enabled===!1)return;let m=l.target,c=document.getElementById("modal-backdrop"),s=document.querySelector("[data-sheet-overlay]");if(m.tagName==="INPUT"||m.tagName==="TEXTAREA"||m.isContentEditable||!!c!=!!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(g=>g.enabled!==!1&&!!c==!!g.modal&&!!s==!!g.sheet&&(Array.isArray(g.key)?g.key.includes(u):g.key===u));!p.length||Ln(p,(g,b)=>(b.priority??0)-(g.priority??0))[0].id!==o||(l.preventDefault(),t(l))},[e,n,o,t,r.enabled,r.modal,r.sheet]);Ka(()=>(document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)),[d]),Ka(()=>(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 Ec}from"sonner";import Ic from"swr";function w2(e,t){let{data:r,isLoading:o,mutate:n}=Ic(e,ye);return{data:r,isLoading:o,update:async(a,d)=>Ec.promise(n(a(r),{optimisticData:d,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 Xa,useMemo as Fc}from"react";import{useEffect as Ya,useState as Dc}from"react";function Za({pageSize:e,page:t,onPageChange:r}){let[o,n]=Dc({pageIndex:t,pageSize:e});return Ya(()=>{n(a=>({...a,pageIndex:t}))},[t]),Ya(()=>{r==null||r(o.pageIndex)},[o]),{pagination:o,setPagination:n}}import{usePathname as Ac,useRouter as Oc,useSearchParams as Vc}from"next/navigation";import{useCallback as zc}from"react";function qa(){let e=Ac(),t=Oc(),r=Vc(),o=Object.fromEntries(r),n=(d,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)),d&&Object.entries(d).forEach(([s,u])=>m.set(s,u));let c=m.toString();return c.length>0?`?${c}`:""},a=zc(({set:d,del:l,replace:m,scroll:c=!0,getNewPath:s,arrayDelimiter:u=","})=>{let p=new URLSearchParams(r);d&&Object.entries(d).forEach(([b,w])=>p.set(b,Array.isArray(w)?w.join(u):w)),l&&(Array.isArray(l)?l.forEach(b=>p.delete(b)):p.delete(l));let f=p.toString(),g=`${e}${f.length>0?`?${f}`:""}`;if(s)return g;m?t.replace(g,{scroll:!1}):t.push(g,{scroll:c})},[r,e,t]);return{pathname:e,router:t,searchParams:r,searchParamsObj:o,queryParams:a,getQueryString:n}}function D2(e=Sn){let{searchParams:t,queryParams:r}=qa(),o=Fc(()=>parseInt(t.get("page")||"1")||1,[t.get("page")]),{pagination:n,setPagination:a}=Za({pageSize:e,page:o,onPageChange:d=>{r(d===1?{del:"page",scroll:!1}:{set:{page:d.toString()},scroll:!1})}});return Xa(()=>{let d=parseInt(t.get("page")||"1")||1;a(l=>({...l,pageIndex:d}))},[t.get("page")]),Xa(()=>{r(n.pageIndex===1?{del:"page",scroll:!1}:{set:{page:n.pageIndex.toString()},scroll:!1})},[n]),{pagination:n,setPagination:a}}import{useEffect as Hc}from"react";function V2(){Hc(()=>{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 _c,useEffect as Ja,useState as $c}from"react";function Qa(e,{container:t}={}){let[r,o]=$c(!1),n=_c(()=>{o((t!=null&&t.current?t.current.scrollTop:window.scrollY)>e)},[e]);return Ja(()=>{let a=(t==null?void 0:t.current)??window;return a.addEventListener("scroll",n),()=>a.removeEventListener("scroll",n)},[n]),Ja(()=>{n()},[n]),r}import{useEffect as Bc}from"react";import{toast as ti}from"sonner";import{jsx as Lr,jsxs as ei}from"react/jsx-runtime";function Wc({id:e,message:t,undo:r}){let o=()=>{r(),ti.dismiss(e)},n=a=>{a.key==="z"&&(a.ctrlKey||a.metaKey)&&o()};return Bc(()=>(document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)),[]),ei("div",{className:"flex w-full items-center justify-between space-x-2",children:[ei("div",{className:"flex items-center space-x-2",children:[Lr(zn,{}),Lr("p",{className:"font-medium",children:t})]}),Lr("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 U2(){return({id:t,message:r,undo:o,duration:n})=>ti(Lr(Wc,{id:t,message:r,undo:o}),{id:t,...n&&{duration:n}})}import{jsx as ri}from"react/jsx-runtime";var de=Gc(({width:e=!1,height:t=!1,className:r,transition:o,children:n,...a},d)=>{var c,s;let l=Kc(null),m=Tr(l);return ri(Uc.div,{ref:d,className:i("overflow-hidden",r),animate:{width:e?((c=m==null?void 0:m.contentRect)==null?void 0:c.width)??"auto":"auto",height:t?((s=m==null?void 0:m.contentRect)==null?void 0:s.height)??"auto":"auto"},transition:o??{type:"spring",duration:.3},...a,children:ri("div",{ref:l,className:i(t&&"h-max",e&&"w-max"),children:n})})});de.displayName="AnimatedSizeContainer";import{jsx as Ee,jsxs as oi}from"react/jsx-runtime";function ny({options:e,value:t,onChange:r,className:o,gridCols:n="2",name:a,disabled:d=!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],c=Ee("div",{className:i("grid gap-3",m),children:e.map(({key:s,label:u,description:p,icon:f})=>{let g=t===s;return oi("label",{className:i("relative flex w-full cursor-pointer items-start rounded-md border border-neutral-200 bg-white text-neutral-600 hover:bg-neutral-50","transition-all duration-150",g&&"border-black bg-neutral-50 text-neutral-900 ring-1 ring-black",d&&"cursor-not-allowed opacity-50",o),children:[Ee("input",{type:"radio",name:a,value:s,className:"hidden",checked:g,disabled:d,onChange:b=>{b.target.checked&&r&&r(s)}}),f&&Ee("div",{className:"flex-shrink-0 pt-0.5",children:f}),oi("div",{className:"flex grow flex-col p-3 pr-0",children:[Ee("span",{className:"pr-1 text-sm font-semibold text-neutral-900",children:u}),Ee("span",{className:"text-xs text-neutral-600",children:p})]}),Ee(Xn,{className:i("mr-1.5 mt-1.5 flex size-4 scale-75 items-center justify-center rounded-full opacity-0 transition-[transform,opacity] duration-150",g&&"scale-100 opacity-100")})]},s)})});return l?Ee("div",{className:"-m-1",children:Ee(de,{height:!0,transition:{ease:"easeInOut",duration:.2},children:Ee("div",{className:"p-1",children:c})})}):c}import jc from"embla-carousel-autoplay";import Yc from"embla-carousel-react";import{ArrowLeft as Zc,ArrowRight as qc}from"lucide-react";import{createContext as Xc,forwardRef as $t,useCallback as _t,useContext as Jc,useEffect as So,useState as To}from"react";import{jsx as Ie,jsxs as ii}from"react/jsx-runtime";var Ro=2e3,ni=Xc(null);function Ce(){let e=Jc(ni);if(!e)throw new Error("useCarousel must be used within a <Carousel />");return e}function ai(){let{api:e}=Ce(),[t,r]=To(0),o=_t(n=>r((n==null?void 0:n.selectedScrollSnap())??0),[]);return So(()=>{!e||(o(e),e.on("reInit",o),e.on("select",o))},[e,o]),t}var Qc=$t(({orientation:e="horizontal",opts:t,setApi:r,autoplay:o,plugins:n,className:a,children:d,...l},m)=>{let[c,s]=Yc({...t,axis:e==="horizontal"?"x":"y"},[...o?[jc(typeof o=="object"?o:{delay:Ro})]:[],...n||[]]),[u,p]=To(!1),[f,g]=To(!1),b=_t(x=>{!x||(p(x.canScrollPrev()),g(x.canScrollNext()))},[]),w=_t(()=>{s==null||s.scrollPrev()},[s]),P=_t(()=>{s==null||s.scrollNext()},[s]),k=_t(x=>{x.key==="ArrowLeft"?(x.preventDefault(),w()):x.key==="ArrowRight"&&(x.preventDefault(),P())},[w,P]);return So(()=>{!s||!r||r(s)},[s,r]),So(()=>{if(!!s)return b(s),s.on("reInit",b),s.on("select",b),()=>{s==null||s.off("select",b)}},[s,b]),Ie(ni.Provider,{value:{carouselRef:c,api:s,opts:t,orientation:e||((t==null?void 0:t.axis)==="y"?"vertical":"horizontal"),scrollPrev:w,scrollNext:P,canScrollPrev:u,canScrollNext:f},children:Ie("div",{ref:m,onKeyDownCapture:k,className:i("relative",a),role:"region","aria-roledescription":"carousel",...l,children:d})})});Qc.displayName="Carousel";var ed=$t(({className:e,...t},r)=>{let{carouselRef:o,orientation:n}=Ce();return Ie("div",{ref:o,className:"overflow-hidden",children:Ie("div",{ref:r,className:i("flex",n==="horizontal"?"-ml-4":"-mt-4 flex-col",e),...t})})});ed.displayName="CarouselContent";var td=$t(({className:e,...t},r)=>{let{orientation:o}=Ce();return Ie("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})});td.displayName="CarouselItem";var rd=$t(({className:e,...t},r)=>{let{orientation:o,scrollPrev:n,canScrollPrev:a}=Ce();return ii("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",ce({variant:"secondary",className:"p-2"}),e),disabled:!a,onClick:n,...t,children:[Ie(Zc,{className:"h-4 w-4"}),Ie("span",{className:"sr-only",children:"Previous slide"})]})});rd.displayName="CarouselPrevious";var od=$t(({className:e,...t},r)=>{let{orientation:o,scrollNext:n,canScrollNext:a}=Ce();return ii("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",ce({variant:"secondary",className:"p-2"}),e),disabled:!a,onClick:n,...t,children:[Ie(qc,{className:"h-4 w-4"}),Ie("span",{className:"sr-only",children:"Next slide"})]})});od.displayName="CarouselNext";import{cva as nd}from"class-variance-authority";import{ChevronLeft as ad,ChevronRight as id}from"lucide-react";import{motion as sd}from"motion/react";import*as $e from"react";import{jsx as Qe,jsxs as Bt}from"react/jsx-runtime";var ld=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 "}}}),Ny=({variant:e="simple",className:t})=>{var g;let{scrollNext:r,scrollPrev:o,canScrollNext:n,canScrollPrev:a,api:d}=Ce(),l=(g=d==null?void 0:d.plugins())==null?void 0:g.autoplay,[m,c]=$e.useState(0),[s,u]=$e.useState(!1),p=$e.useCallback(b=>{c((b==null?void 0:b.selectedScrollSnap())??0)},[]),f=$e.useCallback(b=>()=>{l&&l.isPlaying()&&l.stop(),b()},[l]);return $e.useEffect(()=>{!d||(p(d),u((l==null?void 0:l.isPlaying())??!1),d.on("reInit",p),d.on("select",p),d.on("autoplay:play",()=>u(!0)),d.on("autoplay:stop",()=>u(!1)))},[d,l,p]),Bt("div",{className:i(ld({variant:e}),t),children:[e!=="simple"&&Bt("button",{className:"cursor-pointer rounded-full p-2 hover:bg-neutral-50 active:bg-neutral-100",disabled:!a,onClick:f(o),children:[Qe(ad,{className:"h-4 w-4"}),Qe("span",{className:"sr-only",children:"Previous slide"})]}),d!=null&&Qe("div",{className:"flex items-center gap-1",children:d.slideNodes().map((b,w)=>Bt("button",{onClick:f(()=>d.scrollTo(w)),className:"rounded-full p-0.5 hover:bg-neutral-100 active:bg-neutral-200 sm:p-1.5",children:[Qe("div",{className:i("relative isolate h-1.5 w-1.5 overflow-hidden rounded-full transition-all",w===m?"bg-black":"bg-black/20",s&&w===m&&"w-6 bg-black/20"),children:s&&w===m&&Qe(sd.div,{initial:{x:"-100%"},animate:{x:0},transition:{type:"tween",duration:((l==null?void 0:l.options.delay)??Ro)/1e3},className:"animate-fill-width h-full w-full rounded-full bg-black"})}),Bt("span",{className:"sr-only",children:["Slide ",w+1]})]},w))}),e!=="simple"&&Bt("button",{className:"cursor-pointer rounded-full p-2 hover:bg-neutral-50 active:bg-neutral-100",disabled:!n,onClick:f(r),children:[Qe(id,{className:"h-4 w-4"}),Qe("span",{className:"sr-only",children:"Next slide"})]})]})};import cd from"embla-carousel-react";import{forwardRef as dd,useCallback as ud,useEffect as md}from"react";import{jsx as Mr}from"react/jsx-runtime";var Ey=({className:e,...t})=>{let{api:r}=Ce(),[o,n]=cd({dragFree:!0}),a=ud(d=>{!d||!n||n==null||n.scrollTo(d.selectedScrollSnap())},[n]);return md(()=>{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]),Mr("div",{className:"overflow-hidden",ref:o,children:Mr("div",{className:i("mx-4 flex gap-4",e),...t})})},Iy=dd(({index:e,className:t,...r},o)=>{let{api:n}=Ce(),a=ai();return Mr("div",{ref:o,children:Mr("button",{type:"button",onClick:()=>{var l;if(!n)return;let d=(l=n.plugins())==null?void 0:l.autoplay;d&&d.isPlaying()&&d.stop(),n.scrollTo(e)},className:typeof t=="function"?t({active:e===a}):t,...r})})});import*as Wt from"@radix-ui/react-checkbox";import{forwardRef as pd}from"react";import{jsx as Lo,jsxs as fd}from"react/jsx-runtime";var St=pd(({className:e,...t},r)=>Lo(Wt.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:fd(Wt.Indicator,{className:"group/indicator flex items-center justify-center text-white",children:[Lo(vr,{className:"size-3 group-data-[state=indeterminate]/indicator:hidden"}),Lo(Nr,{className:"size-3 group-data-[state=checked]/indicator:hidden"})]})}));St.displayName=Wt.Root.displayName;import{Command as et,useCommandState as hd}from"cmdk";import{ChevronDown as vd}from"lucide-react";import{forwardRef as xd,isValidElement as yd,useCallback as wd,useEffect as Dr,useState as Ut}from"react";import*as Be from"@radix-ui/react-popover";import{Drawer as Tt}from"vaul";import{jsx as De,jsxs as Er}from"react/jsx-runtime";function oe({children:e,content:t,align:r="center",side:o="bottom",openPopover:n,setOpenPopover:a,mobileOnly:d,popoverContentClassName:l,onOpenAutoFocus:m,collisionBoundary:c,sticky:s,onEscapeKeyDown:u,onWheel:p,sideOffset:f=8}){let{isMobile:g}=ee();return d||g?Er(Tt.Root,{open:n,onOpenChange:a,children:[De(Tt.Trigger,{className:"sm:hidden",asChild:!0,children:e}),Er(Tt.Portal,{children:[De(Tt.Overlay,{className:"bg-bg-subtle fixed inset-0 z-50 bg-opacity-10 backdrop-blur"}),Er(Tt.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:b=>{b.target instanceof Element&&b.target.closest("[data-sonner-toast]")&&b.preventDefault()},children:[De("div",{className:"sticky top-0 z-20 flex w-full items-center justify-center rounded-t-[10px] bg-inherit",children:De("div",{className:"bg-border-default my-3 h-1 w-12 rounded-full"})}),De("div",{className:"bg-bg-default flex w-full items-center justify-center overflow-hidden pb-4 align-middle shadow-xl",children:t})]}),De(Tt.Overlay,{})]})]}):Er(Be.Root,{open:n,onOpenChange:a,children:[De(Be.Trigger,{className:"sm:inline-flex",asChild:!0,children:e}),De(Be.Portal,{children:De(Be.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",l),sticky:s,collisionBoundary:c,onOpenAutoFocus:m,onEscapeKeyDown:u,onWheel:p,children:t})})]})}import{useRef as gd}from"react";import{jsx as si,jsxs as bd}from"react/jsx-runtime";function Ir({children:e,className:t}){let r=gd(null),{scrollProgress:o,updateScrollProgress:n}=Fe(r);return bd("div",{className:"relative",children:[si("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}),si("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 Mo,jsx as F,jsxs as We}from"react/jsx-runtime";function Nd(e,t){return e===!0}function d4({multiple:e,selected:t,setSelected:r,onSelect:o,maxSelected:n,options:a,trigger:d,icon:l,placeholder:m="Select...",searchPlaceholder:c="Search...",emptyState:s,createLabel:u,createIcon:p=yt,onCreate:f,buttonProps:g,labelProps:b,iconProps:w,popoverProps:P,shortcutHint:k,caret:x,side:S,open:I,onOpenChange:y,onSearchChange:O,shouldFilter:R=!0,inputRight:T,inputClassName:L,optionRight:h,optionClassName:v,matchTriggerWidth:C,hideSearch:M=!1,children:A}){let E=Nd(e,r),U=Array.isArray(t)?t:t?[t]:[],{isMobile:cr}=ee(),[zs,Fs]=Ut(!1),io=I??zs,dr=y??Fs,[ge,so]=Ut(""),[bn,lo]=Ut(!1),[co,Hs]=Ut(void 0),[_s,hn]=Ut(!1),$s=_=>{var xe,ft;let Je=E?U.some(({value:uo})=>uo===_.value):U.length&&((xe=U[0])==null?void 0:xe.value)===_.value;if(!(!Je&&n&&U.length>=n))if(o==null||o(_),E){if(!r)return;r(Je?U.filter(({value:uo})=>uo!==_.value):[...U,_])}else r==null||r(U.length&&((ft=U[0])==null?void 0:ft.value)===_.value?null:_),dr(!1)},vn=wd((_,Je)=>Je===""?[..._.filter(xe=>xe.first&&!U.some(ft=>ft.value===xe.value)),...U,..._.filter(xe=>!xe.first&&!U.some(ft=>ft.value===xe.value))]:_,[U]);Dr(()=>{bn&&(Hs(a&&vn(a,ge)),lo(!1))},[bn,a,vn,ge]),Dr(()=>{lo(!0)},[JSON.stringify(a==null?void 0:a.map(_=>_.value))]),Dr(()=>{io||(so(""),lo(!0))},[io]),Dr(()=>O==null?void 0:O(ge),[ge]);let xn=We(et.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",v),onSelect:async()=>{hn(!0),await(f==null?void 0:f(ge))&&(so(""),dr(!1)),hn(!1)},children:[_s?F(be,{className:"size-4 shrink-0"}):F(p,{className:"size-4 shrink-0"}),F("div",{className:"grow truncate",children:(u==null?void 0:u(ge))??`Create ${ge?`"${ge}"`:"new option..."}`})]});return F(oe,{openPopover:io,setOpenPopover:dr,align:"start",side:S,onWheel:_=>{_.stopPropagation()},popoverContentClassName:i(C&&"sm:w-[var(--radix-popover-trigger-width)]",P==null?void 0:P.contentClassName),content:F(de,{width:!cr&&!C,height:!0,style:{transform:"translateZ(0)"},transition:{ease:"easeInOut",duration:.1},className:"pointer-events-auto",children:We(et,{loop:!0,shouldFilter:R,children:[!M&&We("div",{className:"flex items-center overflow-hidden rounded-t-lg border-b border-neutral-200",children:[F(et.Input,{placeholder:c,value:ge,onValueChange:so,className:i("grow border-0 py-3 pl-4 pr-2 outline-none placeholder:text-neutral-400 focus:ring-0 sm:text-sm",L),onKeyDown:_=>{(_.key==="Escape"||_.key==="Backspace"&&!ge)&&(_.preventDefault(),_.stopPropagation(),dr(!1))}}),T&&F("div",{className:"mr-2",children:T}),k&&F("kbd",{className:"mr-2 hidden shrink-0 rounded border border-neutral-200 bg-neutral-100 px-2 py-0.5 text-xs font-light text-neutral-500 md:block",children:k})]}),F(Ir,{className:i("max-h-[min(50vh,250px)]",f&&!e&&"max-h-[calc(min(50vh,250px)-3.5rem)]"),children:F(et.List,{className:i("flex w-full min-w-[100px] flex-col gap-1 p-1"),children:co!==void 0?We(Mo,{children:[co.map(_=>{let Je=U.some(({value:xe})=>xe===_.value);return F(kd,{option:_,multiple:E,selected:Je,onSelect:()=>$s(_),disabled:Boolean(!Je&&n&&U.length>=n),right:h==null?void 0:h(_),className:v},`${_.label}, ${_.value}`)}),f&&e&&ge.length>0&&xn,R?F(Pd,{className:"flex min-h-12 items-center justify-center text-sm text-neutral-500",children:s||"No matches"}):co.length===0?F("div",{className:"flex min-h-12 items-center justify-center text-sm text-neutral-500",children:s||"No matches"}):null]}):F(et.Loading,{children:F("div",{className:"flex h-12 items-center justify-center",children:F(be,{})})})})}),f&&!e&&F("div",{className:"rounded-b-lg border-t border-neutral-200 bg-white p-1",children:xn})]})}),children:d??F(te,{variant:"secondary",...g,className:i(g==null?void 0:g.className,"flex gap-2"),textWrapperClassName:i(g==null?void 0:g.textWrapperClassName,"w-full flex items-center justify-start"),text:We(Mo,{children:[F("div",{className:i("min-w-0 grow truncate text-left",b==null?void 0:b.className),children:A||U.map(_=>_.label).join(", ")||m}),x&&(x===!0?F(vd,{className:"ml-1 size-4 shrink-0 text-neutral-400 transition-transform duration-75 group-data-[state=open]:rotate-180"}):x)]}),icon:l?li(l)?l:F(l,{className:i("size-4 shrink-0",w==null?void 0:w.className)}):void 0})})}function kd({option:e,onSelect:t,multiple:r,selected:o,disabled:n,right:a,className:d}){return We(Mo,{children:[F(Cd,{disabledTooltip:e.disabledTooltip,children:We(et.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(n||e.disabledTooltip)&&"cursor-not-allowed opacity-50",d),disabled:n||!!e.disabledTooltip,onSelect:t,value:e.label+(e==null?void 0:e.value),children:[r&&F("div",{className:"shrink-0 text-neutral-600",children:o?F(Yn,{className:"size-4 text-neutral-600"}):F(Zn,{className:"size-4 text-neutral-400"})}),We("div",{className:"flex min-w-0 grow items-center gap-2",children:[e.icon&&F("span",{className:"shrink-0 text-neutral-600",children:li(e.icon)?e.icon:F(e.icon,{className:"h-4 w-4"})}),F("span",{className:"grow truncate",children:e.label})]}),a,!r&&o&&F(vr,{className:"size-4 shrink-0 text-neutral-600"})]})}),e.separatorAfter&&F(et.Separator,{className:"-mx-1 my-1 h-px bg-neutral-200"})]})}var Cd=({children:e,disabledTooltip:t})=>t?F(q,{content:t,children:F("div",{children:e})}):e,li=e=>yd(e),Pd=xd((e,t)=>hd(o=>o.filtered.count===0)?F("div",{ref:t,"cmdk-empty":"",role:"presentation",...e}):null);import{addYears as Ar,format as Sd,isSameMonth as Td}from"date-fns";import{ChevronLeft as ci,ChevronRight as di,ChevronsLeft as Rd,ChevronsRight as Ld}from"lucide-react";import{forwardRef as Md,useRef as Ed}from"react";import{DayPicker as Id,useDayPicker as Dd,useDayRender as Ad,useNavigation as Od}from"react-day-picker";import{Fragment as Vd,jsx as ne,jsxs as Or}from"react/jsx-runtime";var Gt=Md(({onClick:e,icon:t,disabled:r,...o},n)=>ne("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:ne(t,{className:"h-full w-full shrink-0"})}));Gt.displayName="NavigationButton";function ui({mode:e="single",weekStartsOn:t=0,numberOfMonths:r=1,showYearNavigation:o=!1,disableNavigation:n,locale:a,className:d,classNames:l,...m}){return ne(Id,{mode:e,weekStartsOn:t,numberOfMonths:r,locale:a,showOutsideDays:r===1,className:d,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:()=>ne(ci,{className:"h-4 w-4"}),IconRight:()=>ne(di,{className:"h-4 w-4"}),Caption:({...c})=>{let{goToMonth:s,nextMonth:u,previousMonth:p,currentMonth:f,displayMonths:g}=Od(),{numberOfMonths:b,fromDate:w,toDate:P}=Dd(),k=g.findIndex(T=>Td(c.displayMonth,T)),x=k===0,S=k===g.length-1,I=b>1&&(x||!S),y=b>1&&(S||!x),O=()=>{let T=Ar(f,-1);p&&(!w||T.getTime()>=w.getTime())&&s(T)},R=()=>{let T=Ar(f,1);u&&(!P||T.getTime()<=P.getTime())&&s(T)};return Or("div",{className:"flex items-center justify-between",children:[Or("div",{className:"flex items-center gap-1",children:[o&&!y&&ne(Gt,{disabled:n||!p||w&&Ar(f,-1).getTime()<w.getTime(),"aria-label":"Go to previous year",onClick:O,icon:Rd}),!y&&ne(Gt,{disabled:n||!p,"aria-label":"Go to previous month",onClick:()=>p&&s(p),icon:ci})]}),ne("div",{role:"presentation","aria-live":"polite",className:"text-sm font-medium capitalize tabular-nums text-neutral-900",children:Sd(c.displayMonth,"LLLL yyy",{locale:a})}),Or("div",{className:"flex items-center gap-1",children:[!I&&ne(Gt,{disabled:n||!u,"aria-label":"Go to next month",onClick:()=>u&&s(u),icon:di}),o&&!I&&ne(Gt,{disabled:n||!u||P&&Ar(f,1).getTime()>P.getTime(),"aria-label":"Go to next year",onClick:R,icon:Ld})]})]})},Day:({date:c,displayMonth:s})=>{let u=Ed(null),{activeModifiers:p,buttonProps:f,divProps:g,isButton:b,isHidden:w}=Ad(c,s,u),{selected:P,today:k,disabled:x,range_middle:S}=p;if(w)return ne(Vd,{});if(!b)return ne("div",{...g,className:i("flex items-center justify-center",g.className)});let{children:I,...y}=f;return Or("button",{ref:u,...y,type:"button",children:[I,k&&ne("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":!P,"!bg-white":P,"!bg-blue-400":P&&S,"text-neutral-400":x})})]})}},...m})}import{endOfDay as pi,isSameDay as fi,startOfDay as gi}from"date-fns";import{enUS as jd}from"date-fns/locale";import{useEffect as Vo,useMemo as bi,useRef as Yd,useState as zr}from"react";import{Command as Eo}from"cmdk";import{Lock as zd}from"lucide-react";import{jsx as tt,jsxs as Fd}from"react/jsx-runtime";var Io=({presets:e,onSelect:t,currentValue:r,currentPresetId:o})=>{let n=c=>"dateRange"in c,a=c=>"date"in c,d=(c,s)=>c.getDate()===s.getDate()&&c.getMonth()===s.getMonth()&&c.getFullYear()===s.getFullYear(),l=(c,s)=>{let u=c.from,p=s.from,f=!1;u&&p&&d(u,p)&&(f=!0);let g=c.to,b=s.to,w=!1;return g&&b&&d(g,b)&&(w=!0),f&&w},m=c=>{if(o)return o===c.id;if(n(c)){let s=r;return s&&l(s,c.dateRange)}else if(a(c)){let s=r;return s&&d(s,c.date)}return!1};return tt(Eo,{className:"w-full rounded ring-neutral-200 ring-offset-2 focus:outline-none",tabIndex:0,autoFocus:!0,loop:!0,children:tt(Eo.List,{className:"[&>*]:flex [&>*]:w-full [&>*]:items-start [&>*]:gap-x-2 [&>*]:gap-y-0.5 [&>*]:sm:flex-col",children:e.map((c,s)=>Fd(Eo.Item,{disabled:c.requiresUpgrade,onSelect:()=>t(c),title:c.label,value:c.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(c)&&"font-semibold text-neutral-800"),children:[tt("span",{children:c.label}),c.requiresUpgrade?tt(zd,{className:"h-3.5 w-3.5","aria-hidden":"true"}):c.shortcut?tt("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:c.shortcut.toUpperCase()}):null,c.requiresUpgrade&&c.tooltipContent&&tt(q,{side:"bottom",content:c.tooltipContent,children:tt("div",{className:"absolute inset-0 cursor-not-allowed"})})]},s))})})};Io.displayName="DatePicker.Presets";import{format as Ue}from"date-fns";import{createContext as Hd}from"react";var Do=Hd({isOpen:!1,setIsOpen:()=>{}}),_d=()=>{let e=typeof window<"u"?window.navigator.language:"en-US",t=new Intl.DateTimeFormat(e,{hour:"numeric"}).format();return Number.isInteger(Number(t))},Ao=(e,t,r=!1)=>{let o=!_d(),n;return r?n=o?Ue(e,"d MMM, yyyy h:mm a",{locale:t}):Ue(e,"d MMM, yyyy HH:mm",{locale:t}):n=Ue(e,"d MMM, yyyy",{locale:t}),n},mi=(e,t)=>{let{toYear:r,fromYear:o,fromMonth:n,toMonth:a,fromDay:d,toDay:l}=t;if(e&&e.length>0){let m=o,c=r;e.forEach(s=>{var u,p,f,g,b,w;if("date"in s){let P=s.date.getFullYear();if(o&&P<o)throw new Error(`Preset ${s.label} is before fromYear ${m}.`);if(r&&P>r)throw new Error(`Preset ${s.label} is after toYear ${c}.`);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(d&&s.date.getDate()<d.getDate())throw new Error(`Preset ${s.label} is before fromDay ${d}.`);if(l&&s.date.getDate()>l.getDate())throw new Error(`Preset ${s.label} is after toDay ${Ue(l,"MMM dd, yyyy")}.`)}if("dateRange"in s){let P=(u=s.dateRange.from)==null?void 0:u.getFullYear(),k=(p=s.dateRange.to)==null?void 0:p.getFullYear();if(P&&o&&P<o)throw new Error(`Preset ${s.label}'s 'from' is before fromYear ${m}.`);if(k&&r&&k>r)throw new Error(`Preset ${s.label}'s 'to' is after toYear ${c}.`);if(n){let x=(f=s.dateRange.from)==null?void 0:f.getMonth();if(x&&x<n.getMonth())throw new Error(`Preset ${s.label}'s 'from' is before fromMonth ${Ue(n,"MMM, yyyy")}.`)}if(a){let x=(g=s.dateRange.to)==null?void 0:g.getMonth();if(x&&x>a.getMonth())throw new Error(`Preset ${s.label}'s 'to' is after toMonth ${Ue(a,"MMM, yyyy")}.`)}if(d){let x=(b=s.dateRange.from)==null?void 0:b.getDate();if(x&&x<d.getDate())throw new Error(`Preset ${s.dateRange.from}'s 'from' is before fromDay ${Ue(d,"MMM dd, yyyy")}.`)}if(l){let x=(w=s.dateRange.to)==null?void 0:w.getDate();if(x&&x>l.getDate())throw new Error(`Preset ${s.label}'s 'to' is after toDay ${Ue(l,"MMM dd, yyyy")}.`)}}})}};import{cva as $d}from"class-variance-authority";import{Calendar as Bd,ChevronDown as Wd}from"lucide-react";import{forwardRef as Ud}from"react";import{jsx as Vr,jsxs as Kd}from"react/jsx-runtime";var Gd=$d(["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"}}}),Oo=Ud(({className:e,children:t,placeholder:r,hasError:o,disabled:n,...a},d)=>Kd("button",{ref:d,className:i(Gd({hasError:o}),e),disabled:n,...a,children:[Vr(Bd,{className:"h-4 w-4 shrink-0"}),Vr("span",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-left",children:t||(r?Vr("span",{className:"text-neutral-400",children:r}):null)}),Vr(Wd,{className:"h-4 w-4 flex-shrink-0 text-neutral-400 transition-transform duration-75 group-data-[state=open]:rotate-180"})]}));Oo.displayName="DatePicker.Trigger";import{jsx as ae,jsxs as hi}from"react/jsx-runtime";var Zd=({value:e,defaultValue:t,presetId:r,onChange:o,presets:n,disabled:a,disableNavigation:d,disabledDays:l,showYearNavigation:m=!1,locale:c=jd,placeholder:s="Select date range",hasError:u,align:p="center",className:f,...g})=>{let{isDesktop:b}=ee(),[w,P]=zr(!1),[k,x]=zr(n&&r?n==null?void 0:n.find(({id:M})=>M===r):void 0),[S,I]=zr((k==null?void 0:k.dateRange)??e??t??void 0),[y,O]=zr(S==null?void 0:S.to),R=bi(()=>S,[w]);Vo(()=>{I(e)},[e]),Vo(()=>{let M=n==null?void 0:n.find(({id:A})=>A===r);x(M),I((M==null?void 0:M.dateRange)??e??t)},[n,r]),Vo(()=>{w?S&&O(S.to):O(S==null?void 0:S.to)},[w]);let T=(M,A)=>{let E=(S==null?void 0:S.from)&&(S==null?void 0:S.to)?{from:A}:M;(E==null?void 0:E.from)&&(E==null?void 0:E.to)&&fi(E.from,E.to)&&(E.from=gi(E.from),E.to=pi(E.to)),I(E),x(void 0),(E==null?void 0:E.from)&&(E==null?void 0:E.to)&&(o==null||o(E),P(!1))},L=M=>{let A=M.dateRange;(A==null?void 0:A.from)&&(A==null?void 0:A.to)&&fi(A.from,A.to)&&(A={from:gi(A.from),to:pi(A.to)}),I(A),x(M),o==null||o(A,M),P(!1)},h=()=>{I(R),P(!1)},v=M=>{M||h(),P(M)},C=bi(()=>S?`${S.from?Ao(S.from,c):""} - ${S.to?Ao(S.to,c):""}`:null,[S,c]);return _e((n==null?void 0:n.filter(M=>M.shortcut).map(M=>M.shortcut))??[],M=>{let A=n==null?void 0:n.find(E=>E.shortcut===M.key);A&&L(A)}),ae(Do.Provider,{value:{isOpen:w,setIsOpen:P},children:ae(oe,{align:p,openPopover:w,setOpenPopover:v,popoverContentClassName:"rounded-xl",content:ae("div",{className:"flex w-full",children:hi("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&&ae(qd,{children:ae("div",{className:"absolute px-3 sm:inset-0 sm:left-0",children:ae("div",{className:"sm:py-3",children:ae(Io,{currentPresetId:r,currentValue:S,presets:n,onSelect:L})})})}),ae("div",{className:"scrollbar-hide overflow-x-scroll",children:ae(ui,{mode:"range",selected:S,onSelect:T,month:y,onMonthChange:O,numberOfMonths:b?2:1,disabled:l,disableNavigation:d,showYearNavigation:m,locale:c,className:"scrollbar-hide overflow-x-scroll",classNames:{months:"flex flex-row divide-x divide-neutral-200 overflow-x-scroll scrollbar-hide"},...g})})]})}),children:ae(Oo,{placeholder:s,disabled:a,className:f,hasError:u,"aria-required":g.required||g["aria-required"],"aria-invalid":g["aria-invalid"],"aria-label":g["aria-label"],"aria-labelledby":g["aria-labelledby"],children:(k==null?void 0:k.label)??C})})})};function Z4({presets:e,...t}){return e&&mi(e,t),ae(Zd,{presets:e,...t})}function qd({children:e}){let t=Yd(null),{scrollProgress:r,updateScrollProgress:o}=Fe(t);return hi("div",{className:"relative sm:h-full",children:[ae("div",{ref:t,onScroll:o,className:i("relative flex h-16 w-full items-center sm:h-full sm:w-48","border-b border-neutral-200 sm:border-b-0 sm:border-l","scrollbar-hide overflow-auto"),children:e}),ae("div",{className:"pointer-events-none absolute bottom-0 left-0 hidden h-16 w-full rounded-b-lg bg-gradient-to-t from-white sm:block",style:{opacity:1-Math.pow(r,2)}})]})}import{useId as Xd}from"react";import{jsx as Fr,jsxs as Jd}from"react/jsx-runtime";function ow({dotSize:e=2,gapSize:t=10,patternOffset:r=[0,0],className:o}){let n=Xd();return Jd("svg",{className:i("pointer-events-none absolute inset-0 text-black/10",o),width:"100%",height:"100%",children:[Fr("defs",{children:Fr("pattern",{id:`dots-${n}`,x:r[0]-1,y:r[1]-1,width:e+t,height:e+t,patternUnits:"userSpaceOnUse",children:Fr("rect",{x:1,y:1,width:e,height:e,fill:"currentColor"})})}),Fr("rect",{fill:`url(#dots-${n})`,width:"100%",height:"100%"})]})}import Qd from"next/link";import{useEffect as eu,useState as vi}from"react";import tu from"swr";import{jsx as zo,jsxs as xi}from"react/jsx-runtime";function yi({className:e}){let{data:t}=tu("https://status.dub.co/api/v1/summary",ye),[r,o]=vi("bg-neutral-200"),[n,a]=vi("Loading status...");return eu(()=>{if(!t)return;let{ongoing_incidents:d}=t;if(d.length>0){let{current_worst_impact:l,name:m}=d[0],c=l==="degraded_performance"?"bg-yellow-500":"bg-red-500";a(m),o(c)}else a("All systems operational"),o("bg-green-500")},[t]),xi(Qd,{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:[xi("div",{className:"relative size-2",children:[zo("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")}),zo("div",{className:i("absolute inset-0 z-10 m-auto size-2 rounded-full",r)})]}),zo("p",{className:"text-xs font-medium leading-none text-neutral-600",children:n})]})}import{jsx as Hr,jsxs as wi}from"react/jsx-runtime";function uw({icon:e,title:t,description:r,learnMore:o,children:n}){return wi("div",{className:"flex flex-col items-center justify-center gap-y-4",children:[Hr("div",{className:"flex size-16 items-center justify-center rounded-2xl border border-neutral-200 bg-neutral-50",children:Hr(e,{className:"size-6 text-neutral-800"})}),Hr("p",{className:"text-center text-base font-medium text-neutral-950",children:t}),r&&wi("p",{className:"max-w-sm text-balance text-center text-sm text-neutral-500",children:[r," ",o&&Hr("a",{href:o,target:"_blank",className:"underline underline-offset-2 hover:text-neutral-800",children:"Learn more \u2197"})]}),n]})}import{cva as ru}from"class-variance-authority";import{useState as Ni}from"react";import{toast as ki}from"sonner";import{Fragment as nu,jsx as Pe,jsxs as Ho}from"react/jsx-runtime";var Ci=["application/pdf","text/plain","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","text/csv"],Fo={any:{types:[]},images:{types:["image/png","image/jpeg"],errorMessage:"File type not supported (.png or .jpg only)"},csv:{types:["text/csv"],errorMessage:"File type not supported (.csv only)"},documents:{types:Ci,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:[...Ci,"application/zip"],errorMessage:"File type not supported (document or zip files only)"}},ou=ru("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 Nw({id:e,readFile:t,onChange:r,variant:o,className:n,iconClassName:a,previewClassName:d,icon:l=ta,customPreview:m,accept:c="any",imageSrc:s,loading:u=!1,clickToUpload:p=!0,showHoverOverlay:f=!0,content:g,maxFileSizeMB:b=5,targetResolution:w,accessibilityLabel:P="File upload",disabled:k=!1}){let[x,S]=Ni(!1),[I,y]=Ni(null),O=async R=>{let T="dataTransfer"in R?R.dataTransfer.files&&R.dataTransfer.files[0]:R.target.files&&R.target.files[0];if(!T)return;if(y(T.name),b>0&&T.size/1024/1024>b){ki.error(`File size too big (max ${b} MB)`);return}let L=Fo[c].types;if(L.length&&!L.includes(T.type)){ki.error(Fo[c].errorMessage??"File type not supported");return}let h=T;if(w&&T.type.startsWith("image/"))try{let v=await En(T,w),C=await fetch(v).then(M=>M.blob());h=new File([C],T.name,{type:T.type})}catch(v){console.error("Error resizing image:",v)}if(t){let v=new FileReader;v.onload=C=>{var M;return r==null?void 0:r({src:(M=C.target)==null?void 0:M.result,file:h})},v.readAsDataURL(h);return}r==null||r({file:h})};return Ho("label",{className:i(ou({variant:o}),k?"cursor-not-allowed":i(p&&"cursor-pointer"),n),children:[u&&Pe("div",{className:"absolute inset-0 z-[5] flex items-center justify-center rounded-[inherit] bg-white",children:Pe(Vt,{})}),Pe("div",{className:"absolute inset-0 z-[5]",onDragOver:R=>{R.preventDefault(),R.stopPropagation(),S(!0)},onDragEnter:R=>{R.preventDefault(),R.stopPropagation(),S(!0)},onDragLeave:R=>{R.preventDefault(),R.stopPropagation(),S(!1)},onDrop:async R=>{R.preventDefault(),R.stopPropagation(),O(R),S(!1)}}),Ho("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",k&&"bg-neutral-50",x&&!k&&"cursor-copy border-black bg-neutral-50 opacity-100",s?i("opacity-0",f&&!k&&"group-hover:opacity-100"):i(!k&&"group-hover:bg-neutral-50")),children:[Pe(l,{className:i("size-7 transition-all duration-75",k?"text-neutral-400":i("text-neutral-500 group-hover:scale-110 group-active:scale-95",x?"scale-110":"scale-100"),a)}),g!==null&&Pe("div",{className:i("mt-2 text-center text-sm text-neutral-500",k&&"text-neutral-400"),children:g??Pe(nu,{children:Ho("p",{children:["Drag and drop ",p&&"or click"," to upload."]})})}),Pe("span",{className:"sr-only",children:P})]}),s&&(m??Pe("img",{src:s,alt:"Preview",className:i("h-full w-full rounded-[inherit] object-cover",d)})),p&&Pe("div",{className:"sr-only mt-1 flex shadow-sm",children:Pe("input",{id:e,type:"file",accept:Fo[c].types.join(","),onChange:O,disabled:k},I)})]})}import{Command as Kt}from"cmdk";import{X as au}from"lucide-react";import{AnimatePresence as iu,motion as Si}from"motion/react";import su from"next/link";import{isValidElement as lu,useCallback as Pi,useState as $r}from"react";function _r(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 uu,jsx as D,jsxs as Ae}from"react/jsx-runtime";function cu(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 Ti({filters:e,activeFilters:t,onRemove:r,onRemoveFilter:o,onRemoveAll:n,onSelect:a,onToggleOperator:d,isAdvancedFilter:l=!1,className:m}){_e("Escape",n,{priority:1});let c=(t==null?void 0:t.map(_r))??[];return D(de,{height:!0,className:"w-full",transition:{type:"tween",duration:.3},children:Ae("div",{className:i("flex w-full flex-wrap items-start gap-4 sm:flex-nowrap",m),children:[D("div",{className:"flex grow flex-wrap gap-x-4 gap-y-2",children:D(iu,{children:c.map(({key:s,values:u,operator:p})=>{if(s==="loader")return D(Si.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(k=>k.key===s);if(!f)return console.error("Filter.List received an activeFilter without a corresponding filter"),null;let g=u.length===1,b=u.slice(0,3),w=g?(()=>{var S,I;let k=u[0],x=(S=f.options)==null?void 0:S.find(y=>typeof y.value=="string"&&typeof k=="string"?y.value.toLowerCase()===k.toLowerCase():y.value===k);return(x==null?void 0:x.label)??((I=f.getOptionLabel)==null?void 0:I.call(f,k,{key:f.key,option:x}))??String(k)})():`${u.length} ${f.labelPlural??Mn(f.label,u.length)}`;return D(du,{filterKey:s,filter:f,values:u,operator:p,OptionDisplay:({className:k})=>{var I,y,O;let x,S;if(g){let R=u[0],T=(I=f.options)==null?void 0:I.find(h=>typeof h.value=="string"&&typeof R=="string"?h.value.toLowerCase()===R.toLowerCase():h.value===R);S=(T==null?void 0:T.permalink)??((y=f.getOptionPermalink)==null?void 0:y.call(f,R))??null;let L=(T==null?void 0:T.icon)??((O=f.getOptionIcon)==null?void 0:O.call(f,R,{key:f.key,option:T}))??f.icon;x=D("span",{className:"shrink-0 text-neutral-600",children:jt(L)?L:D(L,{className:"h-4 w-4"})})}else f.hideMultipleIcons?x=D("span",{className:"shrink-0 text-neutral-600",children:jt(f.icon)?f.icon:D(f.icon,{className:"h-4 w-4"})}):x=D("div",{className:"flex shrink-0 -space-x-1",children:b.map((R,T)=>{var v,C;let L=(v=f.options)==null?void 0:v.find(M=>typeof M.value=="string"&&typeof R=="string"?M.value.toLowerCase()===R.toLowerCase():M.value===R),h=(L==null?void 0:L.icon)??((C=f.getOptionIcon)==null?void 0:C.call(f,R,{key:f.key,option:L}))??f.icon;return D("span",{className:"inline-flex text-neutral-600",style:{zIndex:b.length-T},children:jt(h)?h:D(h,{className:"h-4 w-4"})},T)})});return Ae("div",{className:i("flex items-center gap-2.5 px-3 py-2",k),children:[x,S?D(su,{href:S,target:"_blank",className:"cursor-alias decoration-dotted underline-offset-2 hover:underline",children:gt(w,30)}):gt(w,30)]})},onRemove:r,onRemoveFilter:o,onSelect:a,onToggleOperator:d,isAdvancedFilter:l},s)})})}),c.length!==0&&Ae("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",D("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 du({filterKey:e,filter:t,values:r,operator:o,OptionDisplay:n,onRemove:a,onRemoveFilter:d,onSelect:l,onToggleOperator:m,isAdvancedFilter:c=!1}){var S,I;let[s,u]=$r(!1),[p,f]=$r(!1),[g,b]=$r(""),[w,P]=$r(new Set),k=Pi(()=>{P(new Set(r)),f(!0)},[r]),x=Pi(y=>{r.includes(y)?a(e,y):l==null||l(e,y),!c&&!t.multiple&&f(!1)},[e,r,l,a,c,t.multiple]);return Ae(Si.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:[Ae("div",{className:"flex items-center gap-2.5 px-3 py-2",children:[D("span",{className:"shrink-0 text-neutral-600",children:jt(t.icon)?t.icon:D(t.icon,{className:"h-4 w-4"})}),t.label]}),(c||t.multiple)&&!t.singleSelect&&!t.hideOperator?D(oe,{openPopover:s,setOpenPopover:u,content:Ae("div",{className:"w-32 p-1",children:[D("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"}),D("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:D("button",{type:"button",className:"px-3 py-2 text-neutral-500 transition-colors hover:bg-neutral-50 hover:text-neutral-700",children:cu(o)})}):D("div",{className:"px-3 py-2 text-neutral-500",children:"is"}),D(oe,{openPopover:p,setOpenPopover:y=>{f(y),y||(b(""),P(new Set))},content:D("div",{children:D(de,{width:!0,height:!0,className:"rounded-[inherit]",children:Ae(Kt,{loop:!0,shouldFilter:!1,children:[D("div",{className:"flex items-center overflow-hidden rounded-t-lg border-b border-neutral-200",children:D(Kt.Input,{placeholder:`${t.label}...`,value:g,onValueChange:b,className:"grow border-0 py-3 pl-4 pr-2 outline-none placeholder:text-neutral-400 focus:ring-0 sm:text-sm",autoCapitalize:"none"})}),D("div",{className:"scrollbar-hide max-h-[50vh] w-screen overflow-y-scroll sm:w-auto",children:D(Kt.List,{className:"flex w-full min-w-[180px] flex-col gap-1 p-1",children:(()=>{var L;let y=((L=t.options)==null?void 0:L.filter(h=>{var C;return g?(h.label??((C=t.getOptionLabel)==null?void 0:C.call(t,h.value,{key:t.key,option:h}))??String(h.value)).toLowerCase().includes(g.toLowerCase()):!0}))??[],O=y.filter(h=>w.has(h.value)),R=y.filter(h=>!w.has(h.value)),T=h=>{var A,E;let v=r.includes(h.value),C=h.icon??((A=t.getOptionIcon)==null?void 0:A.call(t,h.value,{key:t.key,option:h}))??t.icon,M=h.label??((E=t.getOptionLabel)==null?void 0:E.call(t,h.value,{key:t.key,option:h}))??String(h.value);return Ae(Kt.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:()=>{x(h.value)},onPointerDown:U=>{U.preventDefault()},value:M+h.value,children:[(c||t.multiple)&&!t.singleSelect&&D("div",{className:i("flex h-4 w-4 items-center justify-center rounded border",v?"border-neutral-900 bg-neutral-900":"border-neutral-300"),children:v&&D(xt,{className:"h-3 w-3 text-white"})}),D("span",{className:"shrink-0 text-neutral-600",children:jt(C)?C:D(C,{className:"h-4 w-4"})}),D("span",{className:"flex-1",children:gt(M,48)}),D("div",{className:"ml-1 flex shrink-0 justify-end text-neutral-500",children:(c||t.multiple)&&!t.singleSelect?h.right:v?D(xt,{className:"h-4 w-4"}):h.right})]},h.value)};return Ae(uu,{children:[O.map(T),(c||t.multiple)&&!t.singleSelect&&O.length>0&&R.length>0&&D(Kt.Separator,{className:"-mx-1 my-1 border-b border-neutral-200"}),R.map(T)]})})()})})]})})}),align:"start",children:D("button",{type:"button",onClick:k,disabled:((S=t.options)==null?void 0:S.length)===0,className:i("flex items-center",((I=t.options)==null?void 0:I.length)&&"transition-colors hover:bg-neutral-50"),children:t.options?n({className:"cursor-pointer"}):D("div",{className:"flex items-center gap-2.5 px-3 py-2",children:D("div",{className:"h-5 w-12 animate-pulse rounded-md bg-neutral-200"})})})}),D("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:()=>{d?d(e):r.forEach(y=>{a(e,y)})},children:D(au,{className:"h-3.5 w-3.5"})})]})}var jt=e=>lu(e);import{Command as Oe,useCommandState as mu}from"cmdk";import{ChevronDown as pu,ListFilter as fu}from"lucide-react";import{Fragment as gu,forwardRef as bu,isValidElement as Ri,useCallback as Br,useEffect as Wr,useImperativeHandle as hu,useRef as $o,useState as _o}from"react";import{Fragment as ku,jsx as $,jsxs as Se}from"react/jsx-runtime";function Li({filters:e,onSelect:t,onRemove:r,onOpenFilter:o,onSearchChange:n,onSelectedFilterChange:a,activeFilters:d,askAI:l,isAdvancedFilter:m=!1,children:c,emptyState:s,className:u}){var L,h;let{isMobile:p}=ee(),f=$o(null),g=$o(void 0),[b,w]=_o(!1);_e("f",()=>w(!0),{enabled:!b});let[P,k]=_o(""),[x,S]=_o(null),I=Br(()=>{k(""),S(null)},[]);Wr(()=>{b||I()},[b]);let y=x?e.find(({key:v})=>v===x):null,O=Br(v=>{f.current&&(g.current={width:f.current.clientWidth,height:f.current.clientHeight}),k(""),S(v),o==null||o(v)},[o]),R=Br(v=>{if(!y||!d)return!1;let C=d.find(A=>A.key===x);return C?_r(C).values.includes(v):!1},[y,d,x]),T=Br(v=>{y&&((y==null?void 0:y.singleSelect)||!m&&!(y!=null&&y.multiple)?(R(v)?r(y.key,v):t(y.key,v),w(!1)):R(v)?r(y.key,v):t(y.key,v))},[y,R,t,r,m]);return Wr(()=>{n==null||n(P)},[P]),Wr(()=>{a==null||a(x)},[x]),Wr(()=>{(y==null?void 0:y.options)&&f.current&&(g.current={width:f.current.clientWidth,height:f.current.clientHeight})},[y==null?void 0:y.options]),$(oe,{openPopover:b,setOpenPopover:w,onEscapeKeyDown:v=>{x&&(v.preventDefault(),I())},content:$(de,{width:!p,height:!0,className:"rounded-[inherit]",style:{transform:"translateZ(0)"},children:Se(Oe,{loop:!0,shouldFilter:!y||y.shouldFilter!==!1,children:[Se("div",{className:"flex items-center overflow-hidden rounded-t-lg border-b border-neutral-200",children:[$(xu,{placeholder:`${(y==null?void 0:y.label)||"Filter"}...`,value:P,onValueChange:k,onKeyDown:v=>{(v.key==="Escape"||v.key==="Backspace"&&!P)&&(v.preventDefault(),v.stopPropagation(),x?I():w(!1))},onEmptySubmit:v=>{v.preventDefault(),v.stopPropagation(),l?(t("ai",y?`${y.label} ${P}`:P),w(!1)):T(P)}}),!y&&$("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"})]}),$(yu,{ref:f,children:Se(Oe.List,{className:i("flex w-full flex-col gap-1 p-1",y?"min-w-[100px]":"min-w-[180px]"),children:[y?((h=(L=y.options)==null?void 0:L.filter(v=>!P||!v.hideDuringSearch))==null?void 0:h.map(v=>{let C=(y==null?void 0:y.singleSelect)||!m&&!(y!=null&&y.multiple),M=R(v.value);return $(Bo,{filter:y,option:v,showCheckbox:!C&&(m||(y==null?void 0:y.multiple)),isChecked:M,right:C&&M?$(xt,{className:"h-4 w-4"}):v.right,onSelect:()=>T(v.value)},v.value)}))??$(Oe.Loading,{children:$("div",{className:"-m-1 flex items-center justify-center",style:g.current,children:$(be,{})})}):e.filter(v=>!v.hideInFilterDropdown).map(v=>Se(gu,{children:[$(Bo,{filter:v,onSelect:()=>O(v.key)}),v.separatorAfter&&$(Oe.Separator,{className:"-mx-1 my-1 border-b border-neutral-200"})]},v.key)),(!y||y.options)&&$(wu,{search:P,selectedFilter:y,onSelect:()=>T(P),askAI:l,children:s?vu(s)?(s==null?void 0:s[x??"default"])??"No matching options":s:"No matching options"})]})},x)]})}),children:Se("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:[$(fu,{className:"size-4 shrink-0"}),$("span",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-left text-neutral-900",children:c??"Filter"}),d!=null&&d.length?$("div",{className:"flex size-4 shrink-0 items-center justify-center rounded-full bg-black text-[0.625rem] text-white",children:d.length}):$(pu,{className:"size-4 shrink-0 text-neutral-400 transition-transform duration-75 group-data-[state=open]:rotate-180"})]})})}function vu(e){return typeof e=="object"&&e!==null&&!Ri(e)}var xu=e=>{let{onEmptySubmit:t,...r}=e,o=mu(n=>n.filtered.count===0);return $(Oe.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"})},yu=bu(({children:e},t)=>{let r=$o(null);hu(t,()=>r.current);let{scrollProgress:o,updateScrollProgress:n}=Fe(r);return Se(ku,{children:[$("div",{className:"scrollbar-hide max-h-[50vh] w-screen overflow-y-scroll sm:w-auto",ref:r,onScroll:n,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 Bo({filter:e,option:t,right:r,showCheckbox:o,isChecked:n,onSelect:a}){var m,c;let d=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??((c=e.getOptionLabel)==null?void 0:c.call(e,t.value,{key:e.key,option:t})):e.label;return Se(Oe.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&&$("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&&$(xt,{className:"h-3 w-3 text-white"})}),$("span",{className:"shrink-0 text-neutral-600",children:Nu(d)?d:$(d,{className:"h-4 w-4"})}),$("span",{className:"flex-1",children:gt(l,48)}),$("div",{className:"ml-1 flex shrink-0 justify-end text-neutral-500",children:r})]})}var wu=({search:e,selectedFilter:t,onSelect:r,askAI:o,children:n})=>t&&t.options&&t.options.length===0&&t.shouldFilter!==!1?e?$(Bo,{filter:t,option:{value:e,label:e},onSelect:r}):$(Oe.Empty,{className:"p-2 text-center text-sm text-neutral-400",children:"Start typing to search..."}):!t&&o&&e?Se(Oe.Empty,{className:"flex min-w-[180px] items-center space-x-2 rounded-md bg-neutral-100 px-3 py-2",children:[$(An,{className:"h-4 w-4"}),Se("p",{className:"text-center text-sm text-neutral-600",children:["Ask AI ",Se("span",{className:"text-black",children:['"',e,'"']})]})]}):$(Oe.Empty,{className:"p-2 text-center text-sm text-neutral-400",children:n}),Nu=e=>Ri(e);var iN={Select:Li,List:Ti};import{useMemo as Cu,useState as Mi}from"react";import{jsx as rt,jsxs as Ur}from"react/jsx-runtime";function pN({title:e,description:t,inputAttrs:r,helpText:o,buttonText:n="Save Changes",disabledTooltip:a,handleSubmit:d}){let[l,m]=Mi(r.defaultValue),[c,s]=Mi(!1),u=Cu(()=>c||!l||l===r.defaultValue,[c,l,r.defaultValue]);return Ur("form",{onSubmit:async p=>{p.preventDefault(),s(!0),await d({[r.name]:l}),s(!1)},className:"rounded-xl border border-neutral-200 bg-white",children:[Ur("div",{className:"relative flex flex-col space-y-6 p-6",children:[Ur("div",{className:"flex flex-col space-y-1",children:[rt("h2",{className:"text-base font-semibold",children:e}),rt("p",{className:"text-sm text-neutral-500",children:t})]}),typeof r.defaultValue=="string"?rt("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})}):rt("div",{className:"h-[2.35rem] w-full max-w-md animate-pulse rounded-md bg-neutral-200"})]}),Ur("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"?rt("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,rt("div",{className:"w-fit shrink-0",children:rt(te,{text:n,loading:c,disabled:u,disabledTooltip:a})})]})]})}import{useId as Pu}from"react";import{jsx as Gr,jsxs as Su}from"react/jsx-runtime";function ot({cellSize:e=12,strokeWidth:t=1,patternOffset:r=[0,0],className:o}){let n=Pu();return Su("svg",{className:i("pointer-events-none absolute inset-0 text-black/10",o),width:"100%",height:"100%",children:[Gr("defs",{children:Gr("pattern",{id:`grid-${n}`,x:r[0]-1,y:r[1]-1,width:e,height:e,patternUnits:"userSpaceOnUse",children:Gr("path",{d:`M ${e} 0 L 0 0 0 ${e}`,fill:"transparent",stroke:"currentColor",strokeWidth:t})})}),Gr("rect",{fill:`url(#grid-${n})`,width:"100%",height:"100%"})]})}import{AlertCircle as Tu}from"lucide-react";import Ru,{useCallback as Lu,useState as Mu}from"react";import{jsx as nt,jsxs as Wo}from"react/jsx-runtime";var Eu=Ru.forwardRef(({className:e,type:t,...r},o)=>{let[n,a]=Mu(!1),d=Lu(()=>a(!n),[n,a]);return Wo("div",{children:[Wo("div",{className:"relative flex",children:[nt("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}),Wo("div",{className:"group",children:[r.error&&nt("div",{className:"pointer-events-none absolute inset-y-0 right-0 flex flex-none items-center px-2.5",children:nt(Tu,{className:i("size-5 text-white",t==="password"&&"transition-opacity group-hover:opacity-0"),fill:"#ef4444"})}),t==="password"&&nt("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:()=>d(),"aria-label":n?"Hide password":"Show Password",children:n?nt(aa,{className:"size-4 flex-none text-neutral-500 transition hover:text-neutral-700","aria-hidden":!0}):nt(ia,{className:"size-4 flex-none text-neutral-500 transition hover:text-neutral-700","aria-hidden":!0})})]})]}),r.error&&nt("span",{className:"mt-2 block text-sm text-red-500",role:"alert","aria-live":"assertive",children:r.error})]})});Eu.displayName="Input";import*as Uo from"@radix-ui/react-label";import{cva as Iu}from"class-variance-authority";import*as Ei from"react";import{jsx as Ou}from"react/jsx-runtime";var Du=Iu("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Au=Ei.forwardRef(({className:e,...t},r)=>Ou(Uo.Root,{ref:r,className:i(Du(),e),...t}));Au.displayName=Uo.Root.displayName;import{cva as Vu}from"class-variance-authority";import{isValidElement as zu}from"react";import{jsx as Go,jsxs as Ii}from"react/jsx-runtime";var Ko=Vu(["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 AN({as:e,variant:t="default",children:r,icon:o,shortcut:n,className:a,disabledTooltip:d,...l}){return Go(kt,{tooltipProps:{content:d},children:Ii(e||"button",{...e==="button"?{type:"button"}:{},className:i(Ko({variant:t,disabled:!!d}),a),disabled:d?!0:l.disabled,...l,children:[Ii("div",{className:"flex grow items-center gap-2",children:[o&&(Fu(o)?o:Go(o,{className:"size-4"})),r]}),n&&Go("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 Fu=e=>zu(e);import{curveNatural as Di}from"@visx/curve";import{LinearGradient as Ai}from"@visx/gradient";import{Group as Hu}from"@visx/group";import{ParentSize as _u}from"@visx/responsive";import{scaleLinear as $u,scaleUtc as Bu}from"@visx/scale";import{Area as Wu,AreaClosed as Uu}from"@visx/shape";import{motion as Oi}from"motion/react";import{useId as Gu,useMemo as Vi}from"react";import{jsx as Te,jsxs as jo}from"react/jsx-runtime";var Ku={top:8,right:2,bottom:2,left:2};function UN(e){return Te(_u,{className:"relative",children:({width:t,height:r})=>t>0&&r>0&&Te(ju,{...{width:t,height:r,...e}})})}function ju({width:e,height:t,data:r,curve:o=!0,color:n,padding:a}){let d={...Ku,...a},l=Gu(),m=Vi(()=>r.map(({date:u})=>({date:u,value:0})),[r]),{yScale:c,xScale:s}=Vi(()=>{let u=r.map(({value:w})=>w),p=Math.max(...u),f=r.map(({date:w})=>w.getTime()),g=new Date(Math.min(...f)),b=new Date(Math.max(...f));return{yScale:$u({domain:[-2,Math.max(p,2)],range:[t-d.top-d.bottom,0],nice:!0,clamp:!0}),xScale:Bu({domain:[g,b],range:[0,e-d.left-d.right],nice:!0})}},[r,t,e]);return jo("svg",{width:e,height:t,children:[jo("defs",{children:[Te(Ai,{id:`${l}-color-gradient`,from:n||"#7D3AEC",to:n||"#DA2778",x1:0,x2:e-d.left-d.right,gradientUnits:"userSpaceOnUse"}),Te(Ai,{id:`${l}-mask-gradient`,from:"white",to:"white",fromOpacity:.3,toOpacity:0,x1:0,x2:0,y1:0,y2:1}),Te("mask",{id:`${l}-mask`,maskContentUnits:"objectBoundingBox",children:Te("rect",{width:"1",height:"1",fill:`url(#${l}-mask-gradient)`})})]}),jo(Hu,{left:d.left,top:d.top,children:[Te(Wu,{data:r,x:({date:u})=>s(u),y:({value:u})=>c(u)??0,curve:o?Di:void 0,children:({path:u})=>Te(Oi.path,{initial:{d:u(m)||"",opacity:0},animate:{d:u(r)||"",opacity:1},strokeWidth:1.5,stroke:`url(#${l}-color-gradient)`})}),Te(Uu,{data:r,x:({date:u})=>s(u),y:({value:u})=>c(u)??0,yScale:c,curve:o?Di:void 0,children:({path:u})=>Te(Oi.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 ue from"@radix-ui/react-dialog";import*as Yo from"@radix-ui/react-visually-hidden";import{useRouter as Yu}from"next/navigation";import{Drawer as at}from"vaul";import{jsx as ie,jsxs as Rt}from"react/jsx-runtime";function qN({children:e,className:t,showModal:r,setShowModal:o,onClose:n,desktopOnly:a,preventDefaultClose:d,drawerRootProps:l}){let m=Yu(),c=({dragged:u}={})=>{d&&!u||(n&&n(),o?o(!1):m.back())},{isMobile:s}=ee();return s&&!a?ie(at.Root,{open:o?r:!0,onOpenChange:u=>{u||c({dragged:!0})},...l,children:Rt(at.Portal,{children:[ie(at.Overlay,{className:"fixed inset-0 z-50 bg-neutral-100 bg-opacity-10 backdrop-blur"}),ie(at.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:Rt("div",{className:"scrollbar-hide flex-1 overflow-y-auto rounded-t-[10px] bg-inherit",children:[Rt(Yo.Root,{children:[ie(at.Title,{children:"Modal"}),ie(at.Description,{children:"This is a modal"})]}),ie(Zu,{}),e]})}),ie(at.Overlay,{})]})}):ie(ue.Root,{open:o?r:!0,onOpenChange:u=>{u||c()},children:Rt(ue.Portal,{children:[ie(ue.Overlay,{id:"modal-backdrop",className:"animate-fade-in fixed inset-0 z-40 bg-neutral-100 bg-opacity-50 backdrop-blur-md"}),Rt(ue.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:[Rt(Yo.Root,{children:[ie(ue.Title,{children:"Modal"}),ie(ue.Description,{children:"This is a modal"})]}),e]})]})})}function Zu(){return ie("div",{className:"sticky top-0 z-20 flex items-center justify-center rounded-t-[10px] bg-inherit",children:ie("div",{className:"my-3 h-1 w-12 rounded-full bg-neutral-300"})})}import{X as qu}from"lucide-react";import Xu,{useCallback as Zo,useEffect as zi,useImperativeHandle as Ju,useRef as Fi,useState as qo}from"react";import{jsx as Yt,jsxs as _i}from"react/jsx-runtime";function Hi(e){let t=[],r="",o=!1;for(let a=0;a<e.length;a++){let d=e[a];if(d==='"'){o=!o;continue}if(!o&&(d===","||d===`
|
|
3
|
-
`||
|
|
4
|
-
`&&a++;let l=r.trim();l&&t.push(l),r="";continue}r+=
|
|
5
|
-
to ${
|
|
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&<("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&<(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
6
|
rgb(from transparent r g b / alpha) 0%,
|
|
7
7
|
rgb(from transparent r g b / 0%) 100%
|
|
8
|
-
)`},children:[
|
|
9
|
-
to ${
|
|
10
|
-
${
|
|
11
|
-
${
|
|
12
|
-
)`,backdropFilter:
|
|
13
|
-
to ${
|
|
14
|
-
${
|
|
15
|
-
${
|
|
16
|
-
${
|
|
17
|
-
)`,backdropFilter:
|
|
18
|
-
to ${
|
|
19
|
-
${
|
|
20
|
-
${
|
|
21
|
-
${
|
|
22
|
-
${
|
|
23
|
-
)`,backdropFilter:
|
|
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=`
|
|
24
24
|
attribute vec2 position;
|
|
25
25
|
|
|
26
26
|
void main()
|
|
27
27
|
{
|
|
28
28
|
gl_Position = vec4(position, 0.0, 1.0);
|
|
29
29
|
}
|
|
30
|
-
`,
|
|
30
|
+
`,Em=`
|
|
31
31
|
precision mediump float;
|
|
32
32
|
|
|
33
33
|
uniform vec2 resolution;
|
|
@@ -61,14 +61,14 @@ void main(void) {
|
|
|
61
61
|
|
|
62
62
|
gl_FragColor = fragColor;
|
|
63
63
|
}
|
|
64
|
-
`,vm=60,xm=1e3/vm;function R3({dotSize:e=1,cellSize:t=3,speed:r=5,color:o=[0,0,0],className:n}){let a=fm(null),[d,l]=gm(!1);return pm(()=>{let m=a.current;if(!m||!m.parentElement)return;let c=m.parentElement,s=window.devicePixelRatio||1;m.width=c.clientWidth*s,m.height=c.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 T=0;T<2;++T){let L=T===0?bm:hm,h=u.createShader(T===0?u.VERTEX_SHADER:u.FRAGMENT_SHADER);if(!h){console.error("Failed to create shader");return}u.shaderSource(h,L),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"),g=u.getUniformLocation(p,"time"),b=u.getUniformLocation(p,"resolution"),w=u.getUniformLocation(p,"dotSize"),P=u.getUniformLocation(p,"cellSize"),k=u.getUniformLocation(p,"speed"),x=u.getUniformLocation(p,"color");u.useProgram(p);let S=[1,1,-1,1,1,-1,-1,-1],I=u.createBuffer();u.bindBuffer(u.ARRAY_BUFFER,I),u.bufferData(u.ARRAY_BUFFER,new Float32Array(S),u.STATIC_DRAW),u.enableVertexAttribArray(f),u.vertexAttribPointer(f,2,u.FLOAT,!1,0,0),u.uniform1f(w,e*window.devicePixelRatio),u.uniform1f(P,t*window.devicePixelRatio),u.uniform1f(k,r),u.uniform3f(x,o[0],o[1],o[2]);let y,O=0;function R(T){if(T-O<xm){y=requestAnimationFrame(R);return}O=T,u&&m&&p&&(u.clear(u.COLOR_BUFFER_BIT|u.DEPTH_BUFFER_BIT),u.uniform1f(g,T/1e3),u.uniform2f(b,m.width,m.height),u.drawArrays(u.TRIANGLE_STRIP,0,4)),y=requestAnimationFrame(R)}return y=requestAnimationFrame(R),m.addEventListener("webglcontextlost",T=>{T.preventDefault(),l(!0),cancelAnimationFrame(y)}),()=>{cancelAnimationFrame(y),m.removeEventListener("webglcontextlost",()=>{})}},[e,t,r]),Ki("div",{className:i("absolute inset-0",n,d&&"opacity-0"),children:Ki("canvas",{ref:a,width:"100%",height:"100%",className:"size-full"})})}import*as je from"@radix-ui/react-slider";import{jsx as lt,jsxs as qr}from"react/jsx-runtime";function E3({value:e,onChange:t,min:r,max:o,step:n=1,marks:a,className:d,hint:l,disabled:m}){let c=a||[r,r+(o-r)/3,r+2*(o-r)/3,o];return lt("div",{className:i("relative z-0 [--thumb-radius:13px] [--track-height:16px]",d),children:qr("div",{className:"w-full",children:[qr(je.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:[qr(je.Track,{className:"relative h-[var(--track-height)] w-full overflow-visible rounded-full bg-neutral-200",children:[lt("div",{className:"absolute left-0 top-0 h-full w-[var(--thumb-radius)] rounded-l-full bg-black"}),qr("div",{className:"pointer-events-none absolute inset-x-[var(--thumb-radius)] inset-y-0",children:[lt(je.Range,{className:"absolute h-[var(--track-height)] bg-black"}),c.map(s=>{let u=(s-r)/(o-r)*100;return lt("span",{className:"absolute top-1/2 size-2 -translate-x-1/2 -translate-y-1/2 rounded-full bg-white",style:{left:`${u}%`}},s)})]})]}),lt(je.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:lt("span",{className:"block size-[calc(var(--thumb-radius)*1.23)] rounded-full bg-[#171717]"})})]}),l&<("div",{className:"mt-2 min-h-[1rem] text-xs text-neutral-500",children:l})]})})}import{useEffect as ym,useId as wm,useRef as Nm}from"react";import{jsx as Xr,jsxs as ji}from"react/jsx-runtime";function O3({value:e,onChange:t,label:r,placeholder:o='E.g. "tomorrow at 5pm" or "in 2 hours"',className:n,required:a,autoFocus:d=!1}){let l=wm(),m=Nm(null);return ym(()=>{m.current&&d&&setTimeout(()=>{var c;(c=m.current)==null||c.focus()},10)},[d]),ji("div",{className:n,children:[r&&Xr("div",{className:"flex items-center gap-2",children:Xr("label",{htmlFor:`${l}-datetime`,className:"block text-sm font-medium text-neutral-700",children:r})}),ji("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:[Xr("input",{ref:m,id:`${l}-datetime`,type:"text",placeholder:o,defaultValue:e?Ot(e):"",onBlur:c=>{if(c.target.value.length>0){let s=mo(c.target.value);s&&(t(s),c.target.value=Ot(s))}},onKeyDown:c=>{if(c.key==="Enter"&&m.current){c.preventDefault();let s=mo(m.current.value);s&&(t(s),m.current.value=Ot(s))}},className:"flex-1 border-none bg-transparent text-neutral-900 placeholder-neutral-400 focus:outline-none focus:ring-0 sm:text-sm"}),Xr("input",{type:"datetime-local",id:`${l}-datetime-local`,required:a,value:e?Rn(e):"",onChange:c=>{let s=new Date(c.target.value);t(s),m.current&&(m.current.value=Ot(s))},className:"w-[40px] border-none bg-transparent text-neutral-500 focus:outline-none focus:ring-0 sm:text-sm"})]})]})}import{cva as km}from"class-variance-authority";import{jsx as Yi,jsxs as Sm}from"react/jsx-runtime";var Cm=km("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"}}),Pm={neutral:ea,new:Jn,success:qn,pending:Qn,warning:go,error:go};function B3({className:e,variant:t,size:r,icon:o,tooltip:n,onClick:a,children:d,...l}){let m=o!==null?o??Pm[t??"neutral"]:null;return Yi(kt,{tooltipProps:{content:n},children:Sm("span",{className:i(Cm({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&&Yi(m,{className:"h-3 w-3 shrink-0"}),d]})})}import*as Qr from"@radix-ui/react-switch";import{useMemo as Tm}from"react";import{jsx as Jr}from"react/jsx-runtime";function q3({fn:e,id:t,trackDimensions:r,thumbDimensions:o,thumbTranslate:n,thumbIcon:a,checked:d=!0,loading:l=!1,disabled:m=!1,disabledTooltip:c}){let s=Tm(()=>c?!0:m||l,[c,m,l]),u=Jr(Qr.Root,{checked:l?!1:d,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:Jr(Qr.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 c?Jr(q,{content:c,children:Jr("div",{className:"inline-block leading-none",children:u})}):u}import{Command as Jo}from"cmdk";import{useState as Rm}from"react";import{jsx as ct,jsxs as Lm}from"react/jsx-runtime";function a5({table:e}){let[t,r]=Rm(!1);return ct(oe,{openPopover:t,setOpenPopover:r,content:ct(Ir,{className:"max-h-[50vh]",children:ct(Jo,{tabIndex:0,loop:!0,children:ct(Jo.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 Lm(Jo.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:[ct("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:ct(te,{type:"button",className:"h-8 whitespace-nowrap px-2",variant:"outline",icon:ct(ca,{className:"h-4 w-4 shrink-0"})})})}import{flexRender as Qo,getCoreRowModel as Im,useReactTable as Dm}from"@tanstack/react-table";import{AnimatePresence as Am,motion as Om}from"motion/react";import{memo as Vm,useEffect as qt,useMemo as Ji,useRef as zm,useState as Xi}from"react";import{useEffect as Mm,useState as Em}from"react";import{jsx as eo,jsxs as Zi}from"react/jsx-runtime";function qi({table:e,controls:t,className:r}){let o=e.getSelectedRowModel().rows.length,[n,a]=Em(0);return Mm(()=>{o!==0&&a(o)},[o]),_e("Escape",()=>e.resetRowSelection(),{enabled:o>0,priority:2,modal:!1}),eo("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:Zi("div",{className:"flex h-11 items-center gap-2.5 px-2 py-2.5",children:[eo("div",{className:"flex w-6 items-center justify-center",children:eo(St,{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"})}),Zi("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"]}),eo("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 Qi,jsx as H,jsxs as me}from"react/jsx-runtime";var en=(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"]),Fm=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 L5(e){let{data:t,rowCount:r,columns:o,defaultColumn:n,columnPinning:a,pagination:d,onPaginationChange:l,getRowId:m,enableColumnResizing:c=!1,columnResizeMode:s="onChange"}=e,u=!!e.onRowSelectionChange||!!e.selectionControls,[p,f]=Xi(e.columnVisibility??{}),[g,b]=Xi(e.selectedRows??{}),w=zm(null);qt(()=>{if(!m||!t)return;let x=Object.entries(g);if(x.length>0){let S=x.filter(([I])=>t.find(y=>(m==null?void 0:m(y))===I));S.length!==x.length&&b(Object.fromEntries(S))}},[t,g,m]),qt(()=>{e.selectedRows&&!po(e.selectedRows,g)&&b(e.selectedRows??{})},[e.selectedRows]),qt(()=>{var x;(x=e.onRowSelectionChange)==null||x.call(e,k.getSelectedRowModel().rows)},[g]),qt(()=>{e.columnVisibility&&!po(e.columnVisibility,p)&&f(e.columnVisibility??{})},[e.columnVisibility]),qt(()=>{var x;(x=e.onColumnVisibilityChange)==null||x.call(e,p)},[p]);let P=Ji(()=>[...u?[{id:"select",enableHiding:!1,minSize:30,size:30,maxSize:30,header:({table:x})=>H("div",{className:"flex size-full items-center justify-center",children:H(St,{className:"border-border-default size-4 rounded data-[state=checked]:bg-black data-[state=indeterminate]:bg-black",checked:x.getIsAllRowsSelected()?!0:x.getIsSomeRowsSelected()?"indeterminate":!1,onCheckedChange:()=>x.toggleAllRowsSelected(),title:"Select all"})}),cell:({row:x,table:S})=>H("div",{className:"flex size-full items-center justify-center",children:H(St,{className:"border-border-default size-4 rounded data-[state=checked]:bg-black data-[state=indeterminate]:bg-black",checked:x.getIsSelected(),onClick:I=>{let y=m==null?void 0:m(x.original),O=S.getRowModel().rows,R=w.current!==null?O.findIndex(T=>(m==null?void 0:m(T.original))===w.current):-1;if(I.shiftKey&&w.current!==null&&R!==-1){let T=x.index,L=Math.min(R,T),h=Math.max(R,T),v=O.slice(L,h+1).map(C=>m==null?void 0:m(C.original));S.setRowSelection(C=>{let M=y!==void 0&&((C==null?void 0:C[y])??!1);return{...C,...Object.fromEntries(v.map(A=>[A,!M]))}}),w.current=y??null}else x.toggleSelected(),w.current=y??null},title:"Select"})})}]:[],...o],[u,o]),k=Dm({data:t,rowCount:r,columns:P,defaultColumn:{minSize:120,size:0,maxSize:300,enableResizing:c,...n},getCoreRowModel:Im(),onPaginationChange:l,onColumnVisibilityChange:x=>f(x),onRowSelectionChange:b,state:{pagination:d,columnVisibility:p,columnPinning:{left:[],right:[],...a},rowSelection:g},manualPagination:!0,autoResetPageIndex:!1,manualSorting:!0,getRowId:m,enableColumnResizing:c,columnResizeMode:s});return{...e,columnVisibility:p,table:k,enableColumnResizing:c}}var Hm=Vm(function({row:t,onRowClick:r,onRowAuxClick:o,rowProps:n,cellRight:a,tdClassName:d,table:l}){let{className:m,...c}=n||{};return H("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=>{we(s)||r(t,s)}:void 0,onAuxClick:o?s=>{we(s)||o(t,s)}:void 0,"data-selected":t.getIsSelected(),...c,children:t.getVisibleCells().map(s=>H("td",{className:i(en(s.column.id,!!r),"text-content-default group",tn(s.column,t.index===l.getRowModel().rows.length-1),typeof d=="function"?d(s.column.id,t):d),style:{width:s.column.getSize(),...rn(s.column)},children:me("div",{className:"flex w-full items-center justify-between overflow-hidden truncate",children:[H("div",{className:"min-w-0 shrink grow truncate",children:Qo(s.column.columnDef.cell,s.getContext())}),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 M5({data:e,loading:t,error:r,emptyState:o,cellRight:n,sortBy:a,sortOrder:d,onSortChange:l,sortableColumns:m=[],className:c,containerClassName:s,scrollWrapperClassName:u,emptyWrapperClassName:p,thClassName:f,tdClassName:g,table:b,pagination:w,resourceName:P,onRowClick:k,onRowAuxClick:x,onRowSelectionChange:S,selectionControls:I,rowProps:y,rowCount:O,children:R,enableColumnResizing:T=!1}){let L=!!S||!!I,h=Ji(()=>T?b.getVisibleLeafColumns().reduce((v,C)=>v+C.getSize(),0):"100%",[T,b.getVisibleLeafColumns()]);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(Qi,{children:[L&&H(qi,{table:b,controls:I,className:"absolute left-0 top-0 z-10 rounded-t-[inherit]"}),me("div",{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",T&&"[&_th]:group/resize"],c),style:{width:"100%",tableLayout:T?"fixed":"auto",minWidth:h},children:[H("thead",{className:"relative",children:b.getHeaderGroups().map(v=>H("tr",{children:v.headers.map(C=>{let M=m.includes(C.column.id),A=M?"button":"div";return me("th",{colSpan:C.colSpan,className:i(en(C.id),"text-content-emphasis select-none font-medium",tn(C.column,!b.getRowModel().rows.length),typeof f=="function"?f(C.column.id):f,T&&"relative"),style:{width:C.getSize(),...rn(C.column)},children:[H("div",{className:"flex items-center justify-between gap-6 !pr-0",children:me(A,{className:i("flex items-center gap-2",C.column.id==="select"&&"size-full"),...M&&{type:"button",disabled:!M,"aria-label":"Sort by column",onClick:()=>l==null?void 0:l({sortBy:C.column.id,sortOrder:a!==C.column.id||d==="asc"?"desc":"asc"})},children:[C.isPlaceholder?null:(()=>{var cr;let E=Qo(C.column.columnDef.header,C.getContext()),U=(cr=C.column.columnDef.meta)==null?void 0:cr.headerTooltip;return H(_m,{tooltip:U,children:E})})(),M&&a===C.column.id&&H(Vn,{className:"h-3 w-3 shrink-0",order:d||"desc"})]})}),T&&C.column.getCanResize()&&!["select","menu"].includes(C.column.id)&&H("div",{onMouseDown:C.getResizeHandler(),onTouchStart:C.getResizeHandler(),onClick:E=>E.stopPropagation(),className:Fm})]},C.id)})},v.id))}),H("tbody",{children:b.getRowModel().rows.map(v=>{let C=typeof y=="function"?y(v):y,{className:M,...A}=C||{};return T?H(Hm,{row:v,onRowClick:k,onRowAuxClick:x,rowProps:C,cellRight:n,tdClassName:g,table:b},`${v.id}-${b.getVisibleLeafColumns().map(E=>E.id).join(",")}`):H("tr",{className:i("group/row",k&&"cursor-pointer select-none",b.getRowModel().rows.length>8&&v.index===b.getRowModel().rows.length-1&&"[&_td]:border-b-0",M),onClick:k?E=>{we(E)||k(v,E)}:void 0,onAuxClick:x?E=>{we(E)||x(v,E)}:void 0,"data-selected":v.getIsSelected(),...A,children:v.getVisibleCells().map(E=>H("td",{className:i(en(E.column.id,!!k),"text-content-default group",tn(E.column,v.index===b.getRowModel().rows.length-1),typeof g=="function"?g(E.column.id,v):g),style:{minWidth:E.column.columnDef.minSize,maxWidth:E.column.columnDef.maxSize,width:E.column.columnDef.size||"auto",...rn(E.column)},children:me("div",{className:"flex w-full items-center justify-between overflow-hidden truncate",children:[H("div",{className:"min-w-0 shrink grow truncate",children:Qo(E.column.columnDef.cell,E.getContext())}),n==null?void 0:n(E)]})},E.id))},v.id)})})]}),R]})]}):H("div",{className:i("text-content-subtle flex h-96 w-full items-center justify-center text-sm",p),children:r||o||`No ${(P==null?void 0:P(!0))||"items"} found.`}),w&&!r&&!!(e!=null&&e.length)&&!!O&&me("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:[me("div",{children:[H("span",{className:"hidden sm:inline-block",children:"Viewing"})," ",me("span",{className:"font-medium",children:[((w.pageIndex-1)*w.pageSize+1).toLocaleString(),"-",Math.min((w.pageIndex-1)*w.pageSize+w.pageSize,b.getRowCount()).toLocaleString()]})," ","of"," ",H("span",{className:"font-medium",children:b.getRowCount().toLocaleString()})," ",(P==null?void 0:P(b.getRowCount()!==1))||"items"]}),me("div",{className:"flex items-center gap-2",children:[H(te,{variant:"secondary",text:"Previous",className:"h-7 px-2",onClick:()=>b.previousPage(),disabled:w.pageIndex===1}),H(te,{variant:"secondary",text:"Next",className:"h-7 px-2",onClick:()=>b.nextPage(),disabled:w.pageIndex===b.getPageCount()})]})]}),H(Am,{children:t&&H(Om.div,{initial:{opacity:0},animate:{opacity:1},className:"bg-bg-default/50 absolute inset-0 h-full",children:H("div",{className:"flex h-[75vh] w-full items-center justify-center",children:H(be,{})})})})]})}var tn=(e,t)=>{let r=e.getIsPinned();return i(r&&"bg-bg-default py-0",r&&!t&&"animate-table-pinned-shadow [animation-timeline:scroll(inline)]")},rn=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 _m({children:e,tooltip:t}){return t?H(q,{content:t,children:H("span",{className:"cursor-help underline decoration-dotted underline-offset-2",children:e})}):H(Qi,{children:e})}import{formatDuration as $m,intervalToDuration as Bm}from"date-fns";import{useEffect as Wm,useMemo as Um,useState as Gm}from"react";import{toast as es}from"sonner";import{jsx as Ye,jsxs as ts}from"react/jsx-runtime";var rs=24*60*60*1e3,Km=30*rs;function jm(){if(typeof Intl<"u")try{return Intl.DateTimeFormat().resolvedOptions().timeZone||"Local"}catch{}return"Local"}function F5({timestamp:e,rows:t,interactive:r=!0,...o}){return!e||new Date(e).toString()==="Invalid Date"?o.children:Ye(q,{content:Ye(Ym,{timestamp:e,rows:t,interactive:r}),disableHoverableContent:!r,...o})}function Ym({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(),d=Bm({start:o,end:new Date}),l=$m(d,{delimiter:", ",format:["years","months","days",...a<Km?["hours",...a<rs?["minutes","seconds"]:[]]:[]]})+" ago",m=Um(()=>t.map(p=>({local:{label:jm(),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]),c=m.every(({shortLabel:p})=>p),[s,u]=Gm(0);return Wm(()=>{let p=setInterval(()=>u(f=>f+1),1e3);return()=>clearInterval(p)},[]),ts("div",{className:"flex max-w-[360px] flex-col gap-2 px-2.5 py-2 text-left text-xs",children:[a>0&&Ye("span",{className:"text-content-subtle cursor-default",children:l}),Ye("table",{children:Ye("tbody",{children:m.map((p,f)=>ts("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),es.success(`Copied ${p.successMessageLabel} to clipboard`)}catch(g){es.error(`Failed to copy ${p.successMessageLabel} to clipboard`),console.error(`Failed to copy ${p.successMessageLabel} to clipboard`,g)}}:void 0,children:[Ye("td",{className:"relative py-0.5",children:Ye("span",{className:i("text-content-subtle truncate",c&&"bg-bg-inverted/10 rounded px-1 font-mono"),title:c?p.label:void 0,children:c?p.shortLabel:p.label})}),Ye("td",{className:i("text-content-default relative whitespace-nowrap py-0.5 pl-3",c&&"pl-2",p.valueMono&&"font-mono"),children:p.value})]},f))})})]})}import{LayoutGroup as Zm,motion as os}from"motion/react";import qm from"next/link";import{useId as Xm}from"react";import{jsx as to,jsxs as Jm}from"react/jsx-runtime";function U5({options:e,selected:t,selectAction:r,layout:o=!0,className:n,optionClassName:a,indicatorClassName:d,style:l}){let m=Xm();return to(Zm,{id:m,children:to(os.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(c=>{let s=c.value===t,u=c.href?qm:"button";return Jm(u,{...c.href?{href:c.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(c.value),children:[typeof c.label=="string"?to("p",{children:c.label}):c.label,c.badge,s&&to(os.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",d),transition:{duration:.25}})]},c.value)})})})}import{useEffect as Qm,useId as ep,useRef as tp,useState as rp}from"react";import{jsx as ve,jsxs as on}from"react/jsx-runtime";var op=[{key:"utm_source",icon:ua,label:"Source",placeholder:"google",description:"Where the traffic is coming from"},{key:"utm_medium",icon:Na,label:"Medium",placeholder:"cpc",description:"How the traffic is coming"},{key:"utm_campaign",icon:la,label:"Campaign",placeholder:"summer sale",description:"The name of the campaign"},{key:"utm_term",icon:xa,label:"Term",placeholder:"running shoes",description:"The term of the campaign"},{key:"utm_content",icon:ya,label:"Content",placeholder:"logo link",description:"The content of the campaign"},{key:"ref",icon:da,label:"Referral",placeholder:"yoursite.com",description:"The referral of the campaign"}];function J5({values:e,onChange:t,disabled:r,autoFocus:o,disabledTooltip:n,className:a}){let{isMobile:d}=ee(),l=ep(),[m,c]=rp(!1),s=tp(null);return Qm(()=>{s.current&&!d&&o&&setTimeout(()=>{var u;return(u=s.current)==null?void 0:u.focus()},10)},[]),ve("div",{className:i("grid gap-y-3",a),children:op.map(({key:u,icon:p,label:f,placeholder:g,description:b},w)=>ve("div",{className:"group relative",children:on("div",{className:"relative z-10 flex",children:[ve(q,{content:on("div",{className:"p-3 text-center text-xs",children:[ve("p",{className:"text-neutral-600",children:b}),ve("span",{className:"font-mono text-neutral-400",children:u})]}),sideOffset:4,disableHoverableContent:!0,children:on("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:()=>c(P=>!P),children:[ve(p,{className:"size-4 shrink-0"}),ve("label",{htmlFor:`${l}-${u}`,className:"select-none text-sm",children:m?ve("span",{className:"font-mono text-xs",children:u}):f})]})}),ve("div",{className:"min-w-0 grow",children:ve(kt,{tooltipProps:n?{content:n,disableHoverableContent:!0}:void 0,children:ve("input",{type:"text",id:`${l}-${u}`,ref:w===0?s:void 0,placeholder:g,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:P=>t(u,P.target.value)})})})]})},u))})}import{jsx as nn,jsxs as np}from"react/jsx-runtime";function ek(){return np("div",{style:ro.backgroundMain,children:[nn("div",{style:ro.backgroundMainBefore}),nn("div",{style:ro.backgroundMainAfter}),nn("div",{style:ro.backgroundContent})]})}var ro={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%),
|
|
65
65
|
radial-gradient(at 97% 21%, hsla(125, 98%, 72%, 1) 0px, transparent 50%),
|
|
66
66
|
radial-gradient(at 52% 99%, hsla(354, 98%, 61%, 1) 0px, transparent 50%),
|
|
67
67
|
radial-gradient(at 10% 29%, hsla(256, 96%, 67%, 1) 0px, transparent 50%),
|
|
68
68
|
radial-gradient(at 97% 96%, hsla(38, 60%, 74%, 1) 0px, transparent 50%),
|
|
69
69
|
radial-gradient(at 33% 50%, hsla(222, 67%, 73%, 1) 0px, transparent 50%),
|
|
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 Yp}from"lucide-react";import Zp from"next/image";import qe from"next/link";import{useParams as qp}from"next/navigation";import{useState as Xp}from"react";import{jsx as ns}from"react/jsx-runtime";function Xt({className:e}){return ns("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:ns("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 oo=[{id:"links",title:"Dub Links",description:"Short links with superpowers",icon:ht,href:"/links"},{id:"partners",title:"Dub Partners",description:"Grow your revenue with partnerships",icon:vt,href:"/partners"},{id:"analytics",title:"Dub Analytics",description:"Powerful real-time analytics",icon:bt,href:"/analytics"},{id:"api",title:"Dub API",description:"Programmatic link creation at scale",icon:mr,href:"/docs/api-reference/introduction"},{title:"Dub Integrations",description:"Connect Dub with your favorite tools",icon:Ta,href:"/integrations"}],an=[{icon:Wn,iconClassName:"py-0.5 group-hover:text-[#3178C6]",title:"Typescript",href:"/sdks/typescript"},{icon:$n,iconClassName:"py-0.5 [&_.snake]:transition-colors group-hover:[&_.snake1]:text-[#3776ab] group-hover:[&_.snake2]:text-[#ffd343]",title:"Python",href:"/sdks/python"},{icon:Hn,iconClassName:"group-hover:text-[#00ACD7]",title:"Go",href:"/sdks/go"},{icon:Bn,iconClassName:"py-[3px] grayscale brightness-150 transition-[filter] group-hover:grayscale-0 group-hover:brightness-100",title:"Ruby",href:"/sdks/ruby"},{icon:_n,iconClassName:"py-[3px] grayscale brightness-150 transition-[filter] group-hover:grayscale-0 group-hover:brightness-100",title:"PHP",href:"/sdks/php"}],as=[{icon:xr,title:"Marketing Attribution",description:"Easily track and measure marketing impact",href:"/analytics"},{icon:wr,title:"Content Creators",description:"Intelligent audience insights and link tracking",href:"/solutions/creators"},{icon:zt,title:"Affiliate Management",description:"Manage affiliates and automate payouts",href:"/partners"},{label:"SDKs",items:an}],Jt=[{icon:yr,title:"Help Center",description:"Answers to your questions",href:"/help"},{icon:hr,title:"Docs",description:"Platform documentation",href:"/docs"},{icon:zt,title:"About",description:"Company, values, and team",href:"/about"},{icon:Kn,title:"Careers",description:"Join our global, remote team",href:"/careers"},{icon:sa,title:"Blog",description:"Insights and stories",href:"/blog"},{icon:jn,title:"Changelog",description:"Releases and updates",href:"/changelog"},{icon:Xt,title:"Brand Guidelines",description:"Logos, wordmark, etc.",href:"/brand"},{icon:na,title:"Contact",description:"Reach out to support or sales",href:"/contact"}],is=[{name:"Bitly",slug:"bitly"},{name:"Rebrandly",slug:"rebrandly"},{name:"Short.io",slug:"short"},{name:"Bl.ink",slug:"blink"}],ss=[{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"}],sk=[{name:"X (Twitter)",icon:gr,href:"https://x.com/dubdotco"},{name:"LinkedIn",icon:fr,href:"https://www.linkedin.com/company/dubinc"},{name:"GitHub",icon:pr,href:"https://github.com/dubinc/dub"},{name:"YouTube",icon:br,href:"https://www.youtube.com/@dubdotco"}];import{jsx as ap}from"react/jsx-runtime";function no({className:e,children:t}){return ap("div",{className:i("mx-auto w-full max-w-screen-xl px-3 lg:px-10",e),children:t})}import*as Ze from"@radix-ui/react-popover";import{BoxSelect as zp,Home as Fp,LayoutGrid as Hp,Type as _p}from"lucide-react";import{useParams as $p}from"next/navigation";import{useCallback as Bp,useContext as Wp,useState as Up}from"react";import{toast as Gp}from"sonner";import*as fe from"@radix-ui/react-navigation-menu";import{LayoutGroup as wp}from"motion/react";import or from"next/link";import{useParams as Np,usePathname as kp}from"next/navigation";import{createContext as Cp,useId as Pp}from"react";import Sp from"swr";import{Link as ps}from"@radix-ui/react-navigation-menu";import fs from"next/image";import gs from"next/link";import{Link2 as ip}from"lucide-react";import{jsx as X,jsxs as Q}from"react/jsx-runtime";var ls={clicks:{color:"#3B82F6",value:"12.5K"},leads:{color:"#A855F7",value:"8.2K"},sales:{color:"#14B8A6",value:"$12K"}},dt={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 Q("div",{className:i("pointer-events-none relative size-full",e),children:[Q("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:[X("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"}),X("circle",{cx:"259.333",cy:"72",r:"3",fill:"#00BBA7"}),X("circle",{cx:"259.333",cy:"72",r:"4",stroke:"#3EC5B8",strokeOpacity:"0.3",strokeWidth:"2"})]}),Q("div",{className:"absolute bottom-0 left-5 flex items-start gap-2",children:[Q("div",{className:"border-border-default bg-bg-default w-[172px] rounded-lg border p-0",children:[Q("div",{className:"p-1.5",children:[Q("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:[X(ip,{className:"size-3 rotate-90"}),"d.to/try"]}),X("div",{className:"text-content-default mt-1 px-1.5 pb-0.5 text-[0.8125rem] font-medium sm:mt-2",children:"Apr 2025"})]}),X("div",{className:"border-border-default flex flex-col gap-2 border-t p-3",children:["clicks","leads","sales"].map(t=>Q("div",{className:"flex items-center justify-between gap-2",children:[Q("div",{className:"flex items-center gap-2",children:[X("div",{className:"size-2 rounded-sm border border-black/20 bg-current opacity-70",style:{color:ls[t].color}}),X("div",{className:"text-content-subtle text-xs font-medium leading-none",children:ur(t)})]}),Q("span",{className:"text-content-emphasis text-xs leading-none",children:[t==="sales"?"$":"",ls[t].value]})]},t))})]}),X("div",{className:"relative",children:Q("div",{className:"border-border-default bg-bg-default absolute left-0 top-0 rounded-lg border py-0.5",children:[Q("div",{className:"px-3 py-2.5",children:[Q("div",{className:"flex justify-between gap-2",children:[X("div",{className:"bg-bg-emphasis size-11 rounded-full",style:{backgroundImage:"url(https://assets.dub.co/home/people.png)",backgroundSize:"3600%",backgroundPositionX:dt.avatarIndex*100+"%"}}),Q("div",{className:"flex flex-col items-end gap-1",children:[Q("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:[X(ra,{className:"text-content-default size-3.5"}),dt.origin]}),Q("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:[X("img",{src:`https://flag.vercel.app/m/${dt.country}.svg`,className:"relative h-2.5 w-3 rounded-sm"}),dt.country]})]})]}),X("div",{className:"text-content-emphasis mt-4 text-[0.8125rem] font-medium",children:dt.name}),X("div",{className:"text-content-subtle mt-px text-xs",children:dt.email})]}),X("div",{className:"border-border-default flex flex-col gap-2.5 border-t px-3 pb-2.5 pt-3",children:Object.entries(dt.details).map(([t,r])=>Q("div",{className:"relative flex items-center justify-between gap-2 text-xs leading-none",children:[X("span",{className:"text-content-muted truncate font-medium",children:t}),X("span",{className:"text-content-default",children:r})]},t))})]})})]})]})}import{useId as sp}from"react";import{jsx as N,jsxs as pe}from"react/jsx-runtime";function ds(e){let t=sp();return pe("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:[pe("defs",{children:[N("path",{id:`${t}-m`,className:"fill-[var(--bg)]",d:"M0 0h10.24v10.24H0z"}),N("path",{id:`${t}-n`,className:"fill-[var(--bg)]",d:"M0 0h8.05v8.05H0z"}),N("path",{id:`${t}-o`,className:"fill-[var(--bg)]",d:"M0 0h11.71v11.71H0z"})]}),N("rect",{width:"292",height:"52",x:"4",y:"4",rx:"8.78",className:"fill-[var(--bg)]"}),N("rect",{width:"292",height:"52",x:"4",y:"4",className:"stroke-[var(--border)]",strokeWidth:"0.73",rx:"8.78"}),N("rect",{width:"24.88",height:"24.88",x:"17.17",y:"17.56",fill:`url(#${t}-a)`,rx:"12.44"}),N("rect",{width:"25.61",height:"25.61",x:"16.8",y:"17.2",className:"stroke-[var(--border)]",strokeWidth:"0.73",rx:"12.8"}),N("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"}),N("text",{xmlSpace:"preserve",className:"fill-[var(--fg)]",fontSize:"10.24",fontWeight:"600",style:{whiteSpace:"pre"},children:N("tspan",{x:"50.83",y:"25.49",children:"d.to"})}),pe("g",{className:"stroke-[var(--fg)]",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.1",clipPath:`url(#${t}-b)`,children:[N("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"}),N("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"})]}),N("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"}),pe("g",{stroke:"#A1A1A1",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.1",clipPath:`url(#${t}-c)`,children:[N("path",{d:"M59.11 38.38h-4.7a.9.9 0 0 1-.89-.89V35.7"}),N("path",{d:"m57.21 36.48 1.9 1.9-1.9 1.9"})]}),N("text",{xmlSpace:"preserve",fill:"#737373",fontSize:"10.24",fontWeight:"500",style:{whiteSpace:"pre"},children:N("tspan",{x:"63.27",y:"41.59",children:"dub.co"})}),N("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"}),N("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"}),N("g",{className:"stroke-[var(--muted)]",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.1",clipPath:`url(#${t}-d)`,children:N("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"})}),N("text",{xmlSpace:"preserve",className:"fill-[var(--muted)]",fontSize:"8.78",fontWeight:"500",style:{whiteSpace:"pre"},children:N("tspan",{x:"220.78",y:"33.19",children:"151.8K clicks"})}),N("rect",{width:"292",height:"52",x:"4",y:"64",rx:"8.78",className:"fill-[var(--bg)]"}),N("rect",{width:"292",height:"52",x:"4",y:"64",className:"stroke-[var(--border)]",strokeWidth:"0.73",rx:"8.78"}),N("rect",{width:"24.88",height:"24.88",x:"17.17",y:"77.56",fill:`url(#${t}-e)`,rx:"12.44"}),N("rect",{width:"25.61",height:"25.61",x:"16.8",y:"77.19",className:"stroke-[var(--border)]",strokeWidth:"0.73",rx:"12.8"}),N("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"}),N("text",{xmlSpace:"preserve",className:"fill-[var(--fg)]",fontSize:"10.24",fontWeight:"600",style:{whiteSpace:"pre"},children:N("tspan",{x:"50.83",y:"85.49",children:"d.to/register"})}),pe("g",{className:"stroke-[var(--fg)]",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.1",clipPath:`url(#${t}-f)`,children:[N("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"}),N("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"})]}),N("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"}),pe("g",{stroke:"#A1A1A1",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.1",clipPath:`url(#${t}-g)`,children:[N("path",{d:"M59.11 98.38h-4.7a.9.9 0 0 1-.89-.89V95.7"}),N("path",{d:"m57.21 96.48 1.9 1.9-1.9 1.9"})]}),N("text",{xmlSpace:"preserve",fill:"#737373",fontSize:"10.24",fontWeight:"500",style:{whiteSpace:"pre"},children:N("tspan",{x:"63.27",y:"101.59",children:"app.dub.co/register"})}),N("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"}),N("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"}),N("g",{className:"stroke-[var(--muted)]",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.1",clipPath:`url(#${t}-h)`,children:N("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"})}),N("text",{xmlSpace:"preserve",className:"fill-[var(--muted)]",fontSize:"8.78",fontWeight:"500",style:{whiteSpace:"pre"},children:N("tspan",{x:"226.78",y:"93.19",children:"100K clicks"})}),N("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"}),N("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"}),N("rect",{width:"24.88",height:"24.88",x:"17.17",y:"137.56",fill:`url(#${t}-i)`,rx:"12.44"}),N("rect",{width:"25.61",height:"25.61",x:"16.8",y:"137.19",className:"stroke-[var(--border)]",strokeWidth:"0.73",rx:"12.8"}),N("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"}),N("text",{xmlSpace:"preserve",className:"fill-[var(--fg)]",fontSize:"10.24",fontWeight:"600",style:{whiteSpace:"pre"},children:N("tspan",{x:"50.83",y:"145.49",children:"d.to/try"})}),pe("g",{className:"stroke-[var(--fg)]",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.1",clipPath:`url(#${t}-j)`,children:[N("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"}),N("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"})]}),N("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"}),pe("g",{stroke:"#A1A1A1",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.1",clipPath:`url(#${t}-k)`,children:[N("path",{d:"M59.11 158.38h-4.7a.9.9 0 0 1-.89-.89v-1.79"}),N("path",{d:"m57.21 156.48 1.9 1.9-1.9 1.9"})]}),N("text",{xmlSpace:"preserve",fill:"#737373",fontSize:"10.24",fontWeight:"500",style:{whiteSpace:"pre"},children:N("tspan",{x:"63.27",y:"161.59",children:"app.dub.co/register"})}),N("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"}),N("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"}),N("g",{className:"stroke-[var(--muted)]",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.1",clipPath:`url(#${t}-l)`,children:N("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"})}),N("text",{xmlSpace:"preserve",className:"fill-[var(--muted)]",fontSize:"8.78",fontWeight:"500",style:{whiteSpace:"pre"},children:N("tspan",{x:"223.78",y:"153.19",children:"65.8K clicks"})}),pe("defs",{children:[N("clipPath",{id:`${t}-b`,children:N("use",{xlinkHref:`#${t}-m`,transform:"translate(80.34 16.83)"})}),N("clipPath",{id:`${t}-c`,children:N("use",{xlinkHref:`#${t}-n`,transform:"translate(52.3 34.02)"})}),N("clipPath",{id:`${t}-d`,children:N("use",{xlinkHref:`#${t}-o`,transform:"translate(204.68 24.15)"})}),N("clipPath",{id:`${t}-f`,children:N("use",{xlinkHref:`#${t}-m`,transform:"translate(122.34 76.83)"})}),N("clipPath",{id:`${t}-g`,children:N("use",{xlinkHref:`#${t}-n`,transform:"translate(52.3 94.02)"})}),N("clipPath",{id:`${t}-h`,children:N("use",{xlinkHref:`#${t}-o`,transform:"translate(210.68 84.15)"})}),N("clipPath",{id:`${t}-j`,children:N("use",{xlinkHref:`#${t}-m`,transform:"translate(98.34 136.83)"})}),N("clipPath",{id:`${t}-k`,children:N("use",{xlinkHref:`#${t}-n`,transform:"translate(52.3 154.02)"})}),N("clipPath",{id:`${t}-l`,children:N("use",{xlinkHref:`#${t}-o`,transform:"translate(207.68 144.15)"})}),pe("linearGradient",{id:`${t}-a`,x1:"29.61",x2:"29.61",y1:"17.56",y2:"42.44",gradientUnits:"userSpaceOnUse",children:[N("stop",{stopColor:"#030712",stopOpacity:"0"}),N("stop",{offset:"1",stopColor:"#030712",stopOpacity:"0.05"})]}),pe("linearGradient",{id:`${t}-e`,x1:"29.61",x2:"29.61",y1:"77.56",y2:"102.44",gradientUnits:"userSpaceOnUse",children:[N("stop",{stopColor:"#030712",stopOpacity:"0"}),N("stop",{offset:"1",stopColor:"#030712",stopOpacity:"0.05"})]}),pe("linearGradient",{id:`${t}-i`,x1:"29.61",x2:"29.61",y1:"137.56",y2:"162.44",gradientUnits:"userSpaceOnUse",children:[N("stop",{stopColor:"#030712",stopOpacity:"0"}),N("stop",{offset:"1",stopColor:"#030712",stopOpacity:"0.05"})]})]})]})}import{Fragment as cp,jsx as Ve,jsxs as Qt}from"react/jsx-runtime";var lp=[{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 us({className:e}){return Ve("div",{className:i("pointer-events-none relative size-full dark:opacity-80",e),"aria-hidden":!0,children:Ve("div",{className:"absolute left-0 top-0 grid grid-cols-[repeat(2,180px)]",children:lp.map((t,r)=>Ve("div",{className:"h-[60px] w-[180px] p-[3px]",children:Ve("div",{className:"border-border-subtle bg-bg-default flex size-full select-none overflow-hidden rounded border",children:t&&Qt(cp,{children:[Ve("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),Qt("div",{className:"border-border-subtle flex h-full flex-col justify-between border-l px-2 py-1.5",children:[Qt("div",{className:"flex items-center gap-1.5",children:[Ve("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"}),Ve("span",{className:"text-content-default text-[9px] font-medium",children:t.name})]}),Ve("div",{className:"divide-border-subtle flex divide-x",children:["revenue","payouts"].map((o,n)=>Qt("div",{className:i("flex flex-col",n===0?"pr-4":"pl-4"),children:[Ve("span",{className:"text-content-muted text-[6px] font-medium",children:ur(o)}),Qt("span",{className:"text-content-default text-[9px] font-medium",children:["$",wn(t[o])]})]},o))})]})]})})},r))})})}import{Link as dp}from"@radix-ui/react-navigation-menu";import up from"next/link";import{jsx as er,jsxs as ms}from"react/jsx-runtime";var ut="text-xs uppercase text-neutral-500 dark:text-white/60",mp="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",Re=({domain:e,...t})=>({utm_source:"Custom Domain",utm_medium:"Navbar",utm_campaign:e,...t});function tr({icon:e,title:t,description:r,descriptionLines:o=1,className:n,showArrow:a,...d}){return er(dp,{asChild:!0,children:er(up,{className:i(mp,n),...d,children:ms("div",{className:"flex items-center justify-between gap-3",children:[e,ms("div",{className:"flex-1",children:[er("p",{className:"text-sm font-medium text-neutral-700 dark:text-white",children:t}),r&&er("p",{className:i("text-xs text-neutral-500 dark:text-white/60",["line-clamp-1","line-clamp-2"][o-1]),children:r})]}),a&&er(Dn,{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 B,jsxs as rr}from"react/jsx-runtime";var pp=[{icon:B("div",{className:"flex size-4 items-center justify-center rounded bg-orange-400",children:B(ht,{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:B(ds,{className:"absolute left-0 top-0 h-auto w-full"})},{icon:B("div",{className:"flex size-4 items-center justify-center rounded bg-green-400",children:B(bt,{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:B(cs,{className:"absolute bottom-0 left-0 size-full"})},{icon:B("div",{className:"flex size-4 items-center justify-center rounded bg-violet-400",children:B(vt,{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:B(us,{})}],fp=[{title:"Dub Integrations",description:"Enhance your short links",href:"/integrations",graphic:B("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:B(fs,{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:B("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:B(fs,{src:"https://assets.dub.co/misc/api-thumbnail.png",alt:"",fill:!0})})}];function bs({domain:e}){return rr("div",{className:"grid w-[1020px] grid-cols-1 gap-4 p-4",children:[B("div",{className:"grid grid-cols-3 gap-4",children:pp.map(({title:t,description:r,icon:o,href:n,color:a,graphicsContainerClassName:d,graphic:l})=>B(ps,{asChild:!0,children:rr(gs,{href:W(n,e,Re({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:[B(ot,{className:"[mask-image:linear-gradient(transparent,black,transparent)] dark:text-white/5",cellSize:60,patternOffset:[-51,-23]}),rr("div",{className:"relative p-5 pb-0",children:[o,B("span",{className:"mt-3 block text-sm font-medium text-neutral-900 dark:text-white",children:t}),B("p",{className:"mt-2 max-w-56 text-sm text-neutral-500 dark:text-white/60",children:r})]}),B("div",{className:"relative mt-10 h-40 grow",children:B("div",{className:i("absolute left-0 top-0 size-full grow overflow-hidden [mask-image:linear-gradient(black_50%,transparent)]",d),children:B("div",{className:"relative size-full",children:l})})}),B("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))}),B("div",{className:"grid grow grid-cols-2 gap-4",children:fp.map(({title:t,description:r,href:o,graphic:n})=>B(ps,{asChild:!0,children:rr(gs,{href:W(o,e,Re({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:[B(ot,{className:"[mask-image:linear-gradient(90deg,transparent,black)] dark:text-white/5",cellSize:60,patternOffset:[-39,-49]}),B("div",{className:"pointer-events-none absolute inset-0 overflow-hidden","aria-hidden":!0,children:n}),B("div",{className:"relative flex items-center justify-between px-5 py-4",children:rr("div",{children:[B("span",{className:"text-sm font-medium leading-none text-neutral-900 dark:text-white",children:t}),B("p",{className:"mt-1 text-sm text-neutral-500 dark:text-white/60",children:r})]})})]})},t))})]})}import{Link as gp}from"@radix-ui/react-navigation-menu";import bp from"next/link";import{jsx as Y,jsxs as mt}from"react/jsx-runtime";var hp=[{icon:yr,title:"Help Center",description:"Answers to your questions",thumbnail:"https://assets.dub.co/misc/help-thumbnail.jpg",href:"/help"},{icon:hr,title:"Docs",description:"Platform documentation",thumbnail:"https://assets.dub.co/misc/docs-thumbnail.jpg",href:"/docs"}];function hs({domain:e}){return mt("div",{className:"grid w-[1020px] grid-cols-[0.9fr,0.55fr,0.55fr] divide-x divide-neutral-200 dark:divide-white/20",children:[mt("div",{className:"flex h-full flex-col p-4",children:[Y("p",{className:i(ut,"mb-4 ml-2"),children:"Explore"}),Y("div",{className:"grid grow grid-cols-2 gap-4",children:hp.map(({icon:t,title:r,description:o,href:n})=>Y(gp,{asChild:!0,children:mt(bp,{href:W(n,e,Re({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:[mt("div",{className:"absolute inset-0 opacity-0 transition-opacity duration-150 group-hover:opacity-100",children:[Y("div",{className:"absolute -inset-[25%] -skew-y-12 [mask-image:linear-gradient(225deg,black,transparent_50%)]",children:Y(ot,{cellSize:46,patternOffset:[0,-14],className:"translate-y-2 text-[#ad1f3288] transition-transform duration-150 ease-out group-hover:translate-y-0"})}),Y("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)]")})]}),Y(t,{className:"relative size-5 text-neutral-700 dark:text-white/60"}),mt("div",{className:"relative",children:[Y("span",{className:"text-sm font-medium text-neutral-900 dark:text-white",children:r}),Y("p",{className:"mt-2 text-xs text-neutral-500 dark:text-white/60",children:o})]})]},r)},r))})]}),mt("div",{className:"px-6 py-4",children:[Y("p",{className:i(ut,"mb-2"),children:"Company"}),Y("div",{className:"flex flex-col gap-0.5",children:Jt.filter(({title:t})=>["About","Careers","Brand Guidelines","Contact"].includes(t)).map(({icon:t,title:r,description:o,href:n})=>Y(tr,{className:"-mx-2",href:W(n,e,Re({domain:e,utm_content:r})),icon:Y("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:Y(t,{className:"size-4 text-neutral-600 transition-colors dark:text-white/60"})}),title:r,description:o},n))})]}),mt("div",{className:"px-6 py-4",children:[Y("p",{className:i(ut,"mb-2"),children:"Updates"}),Y("div",{className:"flex flex-col gap-0.5",children:Jt.filter(({title:t})=>["Blog","Changelog"].includes(t)).map(({icon:t,title:r,description:o,href:n})=>Y(tr,{className:"-mx-2",href:W(n,e,Re({domain:e,utm_content:r})),icon:Y("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:Y(t,{className:"size-4 text-neutral-600 transition-colors dark:text-white/60"})}),title:r,description:o},n))})]})]})}import{Link as vp}from"@radix-ui/react-navigation-menu";import xp from"next/link";import{jsx as re,jsxs as It}from"react/jsx-runtime";var yp=[{icon:xr,title:"Marketing Attribution",description:"Easily track and measure marketing impact",href:"/analytics"},{icon:wr,title:"Content Creators",description:"Intelligent audience insights and link tracking",href:"/solutions/creators"},{icon:zt,title:"Affiliate Management",description:"Manage affiliates and automate payouts",href:"/partners"}];function vs({domain:e}){return It("div",{className:"grid w-[1020px] grid-cols-[minmax(0,1fr),0.4fr] divide-x divide-neutral-200 dark:divide-white/20",children:[It("div",{className:"flex h-full flex-col p-4",children:[re("p",{className:i(ut,"mb-4 ml-2"),children:"Use case"}),re("div",{className:"grid grow grid-cols-3 gap-4",children:yp.map(({icon:t,title:r,description:o,href:n})=>re(vp,{asChild:!0,children:It(xp,{href:W(n,e,Re({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:[re("div",{className:"absolute -inset-[25%] -skew-y-12 [mask-image:linear-gradient(225deg,black,transparent_50%)]",children:re(ot,{cellSize:46,patternOffset:[0,-14],className:"translate-y-2 text-[#ad1f3288] transition-transform duration-150 ease-out group-hover:translate-y-0"})}),re("div",{className:i("absolute -inset-[10%] opacity-10 blur-[50px] dark:brightness-150","bg-[conic-gradient(#F35066_0deg,#F35066_117deg,#9071F9_180deg,#5182FC_240deg,#F35066_360deg)]")})]}),re(t,{className:"relative size-5 text-neutral-700 dark:text-white/60"}),It("div",{className:"relative",children:[re("span",{className:"text-sm font-medium text-neutral-900 dark:text-white",children:r}),re("p",{className:"mt-2 text-xs text-neutral-500 dark:text-white/60",children:o})]})]},r)},r))})]}),It("div",{className:"px-6 py-4",children:[re("p",{className:i(ut,"mb-2"),children:"SDKs"}),re("div",{className:"flex flex-col gap-0.5",children:an.map(({icon:t,iconClassName:r,title:o,href:n})=>re(tr,{className:"-mx-2",href:W(n,e,Re({domain:e,utm_content:o})),icon:re("div",{className:"shrink-0 rounded-[10px] border border-neutral-200 bg-white/50 p-1 dark:border-white/20 dark:bg-white/10",children:re(t,{className:i("size-5 text-neutral-600 transition-colors dark:text-white/60",r)})}),title:o,showArrow:!0},n))})]})]})}import{Fragment as Lp,jsx as K,jsxs as Dt}from"react/jsx-runtime";var sn=Cp({theme:"light"}),ln=[{name:"Product",content:bs,childItems:oo,segments:["/links","/analytics","/partners","/integrations","/compare","/features"]},{name:"Solutions",content:vs,childItems:as,segments:["/solutions","/sdks"]},{name:"Resources",content:hs,childItems:Jt,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"]}],xs=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 b6({theme:e="light",staticDomain:t,maxWidthWrapperClassName:r}){let{domain:o="dub.co"}=Np();t&&(o=t);let n=Pp(),a=Qa(40),d=kp(),{data:l,isLoading:m}=Sp(o.endsWith("dub.co")&&"/api/auth/session",ye,{dedupingInterval:6e4});return K(sn.Provider,{value:{theme:e},children:K(wp,{id:n,children:Dt("div",{className:i("sticky inset-x-0 top-0 z-30 w-full transition-all",e==="dark"&&"dark"),children:[K("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")}),K(no,{className:i("relative",r),children:Dt("div",{className:"flex h-14 items-center justify-between",children:[K("div",{className:"grow basis-0",children:K(or,{className:"block w-fit py-2 pr-2",href:W("/home",o,{utm_source:"Custom Domain",utm_medium:"Navbar",utm_campaign:o,utm_content:"Logo"}),children:K(ao,{})})}),Dt(fe.Root,{delayDuration:0,className:"relative hidden lg:block",children:[K(fe.List,{className:"group relative z-0 flex",children:ln.map(({name:c,href:s,segments:u,content:p})=>{let f=u.some(g=>d==null?void 0:d.startsWith(g));return Dt(fe.Item,{children:[K(Rp,{trigger:!!p,children:s!==void 0?K(or,{id:`nav-${s}`,href:W(s,o,{utm_source:"Custom Domain",utm_medium:"Navbar",utm_campaign:o,utm_content:c}),className:xs,"data-active":f,children:c}):Dt("button",{className:xs,"data-active":f,children:[c,K(Tp,{className:"ml-1.5 size-2.5 text-neutral-700"})]})}),p&&K(fe.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:K(p,{domain:o})})]},c)})}),K("div",{className:"absolute left-1/2 top-full mt-3 -translate-x-1/2",children:K(fe.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]")})})]}),K("div",{className:"hidden grow basis-0 justify-end gap-2 lg:flex",children:l&&Object.keys(l).length>0?K(or,{href:Le,className:i(ce({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:Dt(Lp,{children:[K(or,{href:"https://app.dub.co/login",className:i(ce({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"}),K(or,{href:"https://app.dub.co/register",className:i(ce({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 Tp(e){return K("svg",{xmlns:"http://www.w3.org/2000/svg",width:"9",height:"9",fill:"none",viewBox:"0 0 9 9",...e,children:K("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 Rp({trigger:e,children:t}){return e?K(fe.Trigger,{asChild:!0,children:t}):t}import{ChevronDown as Mp,Menu as Ep,X as Ip}from"lucide-react";import At from"next/link";import{useParams as un}from"next/navigation";import{useEffect as Dp,useState as ws}from"react";import Ap from"swr";import{Fragment as Vp,jsx as V,jsxs as ze}from"react/jsx-runtime";var cn={"Dub Links":V("div",{className:"flex size-5 items-center justify-center rounded bg-orange-400",children:V(ht,{className:"size-3 text-orange-900"})}),"Dub Partners":V("div",{className:"flex size-5 items-center justify-center rounded bg-violet-400",children:V(vt,{className:"size-3 text-violet-900"})}),"Dub Analytics":V("div",{className:"flex size-5 items-center justify-center rounded bg-green-400",children:V(bt,{className:"size-3 text-green-900"})}),"Dub API":V("div",{className:"flex size-5 items-center justify-center rounded bg-neutral-400",children:V(mr,{className:"size-3 text-neutral-900"})})};function E6({theme:e="light",staticDomain:t}){let{domain:r="dub.co"}=un();t&&(r=t);let[o,n]=ws(!1);Dp(()=>{o?document.body.style.overflow="hidden":document.body.style.overflow="auto"},[o]);let{data:a,isLoading:d}=Ap(r.endsWith("dub.co")&&"/api/auth/session",ye,{dedupingInterval:6e4});return ze("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(dn,{href:Le,className:"max-[280px]:hidden",children:"Dashboard"}):d?null:ze("div",{className:"flex gap-2 max-[280px]:hidden",children:[V(dn,{variant:"secondary",href:`${Le}/login`,children:"Log in"}),V(dn,{href:`${Le}/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(Ip,{className:"h-5 w-5 text-neutral-600 dark:text-white/70"}):V(Ep,{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:ze("ul",{className:"grid divide-y divide-neutral-200 dark:divide-white/[0.15]",children:[ln.map(({name:l,href:m,childItems:c},s)=>V(Op,{name:l,href:m,childItems:c,setOpen:n},s)),a&&Object.keys(a).length>0?V("li",{className:"py-3 min-[281px]:hidden",children:V(At,{href:Le,className:"flex w-full font-semibold capitalize",children:"Dashboard"})}):ze(Vp,{children:[V("li",{className:"py-3 min-[281px]:hidden",children:V(At,{href:`${Le}/login`,className:"flex w-full font-semibold capitalize",children:"Log in"})}),V("li",{className:"py-3 min-[281px]:hidden",children:V(At,{href:`${Le}/register`,className:"flex w-full font-semibold capitalize",children:"Sign Up"})})]})]})})]})}var Op=({name:e,href:t,childItems:r,setOpen:o})=>{let{domain:n="dub.co"}=un(),[a,d]=ws(!1);return r?V("li",{className:"py-3",children:ze(de,{height:!0,children:[ze("button",{className:"flex w-full justify-between",onClick:()=>d(!a),children:[V("p",{className:"font-semibold",children:e}),V(Mp,{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?ze("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((c,s)=>V(ys,{item:c,setOpen:o,size:"small"},s))]},m):V(ys,{item:l,setOpen:o},m))})]})}):t?V("li",{className:"py-3",children:V(At,{href:W(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},ys=({item:{title:e,description:t,href:r,icon:o},setOpen:n,size:a="normal"})=>{let{domain:d="dub.co"}=un(),l=cn==null?void 0:cn[e];return ze(At,{href:W(r,d,{utm_source:"Custom Domain",utm_medium:"Navbar",utm_campaign:d,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")})}),ze("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 dn({variant:e,className:t,...r}){return V(At,{...r,className:i("flex h-8 w-fit items-center whitespace-nowrap rounded-lg border px-3 text-[0.8125rem]",ce({variant:e}),t)})}import{jsx as Ns}from"react/jsx-runtime";function ks({className:e}){return Ns("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:Ns("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 J,jsxs as Cs}from"react/jsx-runtime";var Kp=`<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">
|
|
71
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"/>
|
|
72
|
-
</svg>`,
|
|
72
|
+
</svg>`,lf=`<svg width="46" height="24" viewBox="0 0 46 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
73
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"/>
|
|
74
|
-
</svg>`;function ao({variant:e="full",isInApp:t,className:r}){let{domain:o="dub.co"}=$p(),{theme:n}=Wp(sn),[a,d]=Up(!1),l=Bp(s=>{s.preventDefault(),d(!0)},[]),[,m]=Pt();function c(s){Gp.promise(m(s),{success:"Copied to clipboard!",error:"Failed to copy to clipboard"})}return Cs(Ze.Root,{open:a,onOpenChange:d,children:[J(Ze.Anchor,{asChild:!0,children:J("div",{onContextMenu:l,className:"max-w-fit",children:e==="full"?J(ks,{className:r}):J(Xt,{className:i("h-8 w-8 transition-all duration-75 active:scale-95",r)})})}),J(Ze.Portal,{children:J(Ze.Content,{sideOffset:14,align:"start",className:i("z-50 -mt-1.5",!t&&"-translate-x-8",n==="dark"&&"dark"),onClick:s=>{s.stopPropagation(),d(!1)},children:Cs("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:[J(nr,{text:"Copy Logo as SVG",variant:"outline",onClick:()=>c(Kp),icon:J(Xt,{className:"h-4 w-4"})}),J(nr,{text:"Copy Wordmark as SVG",variant:"outline",onClick:()=>c(jp),icon:J(_p,{strokeWidth:2,className:"h-4 w-4"})}),J(nr,{text:"Brand Guidelines",variant:"outline",onClick:()=>window.open("https://dub.co/brand","_blank"),icon:J(zp,{strokeWidth:2,className:"h-4 w-4"})}),t||o!="dub.co"?J(nr,{text:"Home Page",variant:"outline",onClick:()=>window.open(`https://dub.co${t?"/home":""}`,"_blank"),icon:J(Fp,{strokeWidth:2,className:"h-4 w-4"})}):J(nr,{text:"Dashboard",variant:"outline",onClick:()=>window.open("https://app.dub.co","_blank"),icon:J(Hp,{strokeWidth:2,className:"h-4 w-4"})})]})})})]})}function nr({className:e,...t}){return J(te,{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 z,jsxs as j}from"react/jsx-runtime";var Jp=[{name:"Twitter",icon:gr,href:"https://twitter.com/dubdotco"},{name:"LinkedIn",icon:fr,href:"https://www.linkedin.com/company/dubinc"},{name:"GitHub",icon:pr,href:"https://github.com/dubinc/dub"},{name:"YouTube",icon:br,href:"https://www.youtube.com/@dubdotco"}],ar={product:[...oo.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:is.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"})))},ir="text-sm font-medium text-neutral-900",sr="flex flex-col mt-2.5 gap-3.5",pt="flex items-center gap-2 text-sm text-neutral-500 hover:text-neutral-700 transition-colors duration-75";function l9({staticDomain:e,className:t}){let{domain:r="dub.co"}=qp();e&&(r=e);let[o,n]=Xp(!1);return z(no,{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:j("footer",{children:[j("div",{className:"xl:grid xl:grid-cols-3 xl:gap-8",children:[j("div",{className:"flex flex-col gap-6",children:[z("div",{className:"grow",children:j(qe,{href:W("/",r,{utm_source:"Custom Domain",utm_medium:"Footer",utm_campaign:r,utm_content:"Logo"}),className:"block max-w-fit",children:[j("span",{className:"sr-only",children:[process.env.NEXT_PUBLIC_APP_NAME," Logo"]}),z(ao,{className:"h-8 text-neutral-800"})]})}),z("div",{className:"flex items-center gap-3",children:Jp.map(({name:a,icon:d,href:l})=>j("a",{href:l,target:"_blank",rel:"noreferrer",className:"group rounded-full p-1",children:[z("span",{className:"sr-only",children:a}),z(d,{className:"size-4 text-neutral-900 transition-colors duration-75 group-hover:text-neutral-600"})]},a))})]}),j("div",{className:"mt-16 grid grid-cols-2 gap-4 xl:col-span-2 xl:mt-0",children:[j("div",{className:"md:grid md:grid-cols-2",children:[j("div",{className:"grid gap-8",children:[j("div",{children:[z("h3",{className:ir,children:"Product"}),z("ul",{role:"list",className:sr,children:ar.product.map(a=>z("li",{children:j(qe,{href:W(a.href,r,{utm_source:"Custom Domain",utm_medium:"Footer",utm_campaign:r,utm_content:a.name}),className:pt,children:[a.id&&z(fo,{product:a.id}),a.name]})},a.name))})]}),j("div",{children:[z("h3",{className:ir,children:"Solutions"}),z("ul",{role:"list",className:sr,children:ar.solutions.map(a=>z("li",{children:z(qe,{href:W(a.href,r,{utm_source:"Custom Domain",utm_medium:"Footer",utm_campaign:r,utm_content:a.name}),className:pt,children:a.name})},a.name))})]})]}),j("div",{className:"mt-10 md:mt-0",children:[z("h3",{className:ir,children:"Resources"}),z("ul",{role:"list",className:sr,children:ar.resources.map(a=>z("li",{children:j(qe,{href:W(a.href,r,{utm_source:"Custom Domain",utm_medium:"Footer",utm_campaign:r,utm_content:a.name}),target:a.target,className:i(pt,"gap-1"),children:[a.name,a.target&&z(wa,{className:"size-3.5"})]})},a.name))})]})]}),j("div",{className:"md:grid md:grid-cols-2",children:[z("div",{className:"grid gap-8",children:j("div",{children:[z("h3",{className:ir,children:"Company"}),j("ul",{role:"list",className:sr,children:[ar.company.map(a=>z("li",{children:z(qe,{href:W(a.href,r,{utm_source:"Custom Domain",utm_medium:"Footer",utm_campaign:r,utm_content:a.name}),className:i(pt,"gap-1"),children:a.name})},a.name)),z("li",{className:"-mt-1",children:z(oe,{content:z("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:ss.map(a=>z(qe,{href:W(`/legal/${a.slug}`,r,{utm_source:"Custom Domain",utm_medium:"Footer",utm_campaign:r,utm_content:a.name}),className:i(Ko({variant:"default"}),pt,"justify-start font-normal"),children:a.name},a.name))}),openPopover:o,setOpenPopover:n,children:j("button",{className:pt,children:["Legal",z(Yp,{className:"size-3.5"})]})})})]})]})}),j("div",{className:"mt-10 md:mt-0",children:[z("h3",{className:ir,children:"Compare"}),z("ul",{role:"list",className:sr,children:ar.compare.map(a=>z("li",{children:j(qe,{href:W(a.href,r,{utm_source:"Custom Domain",utm_medium:"Footer",utm_campaign:r,utm_content:a.name}),className:pt,children:[z(fo,{product:a.product}),a.name]})},a.name))})]})]})]})]}),j("div",{className:"mt-12 grid grid-cols-1 items-center gap-8 sm:grid-cols-3",children:[z(yi,{}),z(qe,{href:W("/blog/soc2",r,{utm_source:"Custom Domain",utm_medium:"Footer",utm_campaign:r,utm_content:"SOC2"}),className:"flex sm:justify-center",children:z(Zp,{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"})}),j("p",{className:"text-xs text-neutral-500 sm:text-right",children:["\xA9 ",new Date().getFullYear()," Dub Technologies, Inc."]})]})]})})}import Qp from"next/image";import{memo as ef,useEffect as tf,useState as Ps}from"react";import{jsx as rf}from"react/jsx-runtime";var Ss=ef(e=>{let[t,r]=Ps(!0),[o,n]=Ps(e.src);tf(()=>n(e.src),[e.src]);let a=d=>{r(!1);let l=d.target;l.naturalWidth<=16&&l.naturalHeight<=16&&n(`https://avatar.vercel.sh/${encodeURIComponent(e.alt)}`)};return rf(Qp,{...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 of,motion as nf}from"motion/react";import{useEffect as af,useState as sf}from"react";import{jsx as Ts}from"react/jsx-runtime";var Rs=({children:e,fallback:t,fadeInDuration:r=.5,className:o})=>{let[n,a]=sf(!1);af(()=>{a(!0)},[]);let d=r?nf.div:"div";return Ts(of,{children:n?Ts(d,{...r?{initial:{opacity:0},animate:{opacity:1},transition:{duration:r}}:{},className:o,children:e}):t||null})};import{cva as lf}from"class-variance-authority";import{toast as cf}from"sonner";import{jsx as mn,jsxs as uf}from"react/jsx-runtime";var df=lf("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 P9({variant:e="default",value:t,className:r,icon:o,successMessage:n}){let[a,d]=Pt(),l=o||In;return uf("button",{onClick:m=>{m.stopPropagation(),cf.promise(d(t),{success:n||"Copied to clipboard!"})},className:i(df({variant:e}),r),type:"button",children:[mn("span",{className:"sr-only",children:"Copy"}),a?mn(Fn,{className:"h-3.5 w-3.5"}):mn(l,{className:"h-3.5 w-3.5"})]})}import{toast as mf}from"sonner";import{jsx as pf}from"react/jsx-runtime";function M9({value:e,children:t,className:r,successMessage:o}){let[n,a]=Pt();return pf("button",{onClick:d=>{d.stopPropagation(),mf.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 ff,jsxs as gf}from"react/jsx-runtime";function I9({icon:e,text:t}){return gf("div",{className:"flex items-center justify-start space-x-2 truncate",children:[e,ff("p",{className:"truncate text-sm",children:t})]})}import{jsx as bf}from"react/jsx-runtime";var A9=({children:e})=>bf("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 H9({apexDomain:e,className:t,imageProps:r}){return e?pn(Ss,{src:`${Pn}${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(ma,{className:"h-4 w-4 text-neutral-600 sm:h-5 sm:w-5"})})}import{Link2 as Ls}from"lucide-react";import{useSearchParams as hf}from"next/navigation";import{useEffect as vf,useMemo as xf,useRef as yf}from"react";import wf from"swr";import{useDebounce as Nf}from"use-debounce";import{Fragment as Ms,jsx as Z,jsxs as Xe}from"react/jsx-runtime";function Z9({defaultUrl:e}){let t=hf(),r=e||(t==null?void 0:t.get("url"))||"https://github.com/dubinc/dub",[o]=Nf(yn(r),500),n=xf(()=>Tn(o||""),[o]),{data:a,isValidating:d}=wf(o&&`/api/links/metatags?url=${encodeURIComponent(o)}`,ye,{revalidateOnFocus:!1}),{title:l,description:m,image:c}=a||{},s=yf(null);vf(()=>{!e&&s.current&&s.current.select()},[e]);let{isMobile:u}=ee();return Xe(Ms,{children:[!e&&Xe("div",{className:"relative flex items-center",children:[Z(Ls,{className:"absolute inset-y-0 left-0 my-2 ml-3 w-5 text-neutral-400"}),Z("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"})]}),Xe("div",{className:"relative overflow-hidden rounded-md border border-neutral-300 bg-neutral-50",children:[d&&Z("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:Z(Vt,{})}),c?Z("img",{src:c,alt:"Preview",className:"h-[250px] w-full border-b border-neutral-300 object-cover"}):Xe("div",{className:"flex h-[250px] w-full flex-col items-center justify-center space-y-4 border-b border-neutral-300",children:[Z(On,{className:"h-8 w-8 text-neutral-400"}),Z("p",{className:"text-sm text-neutral-400",children:"Enter a link to generate a preview."})]}),Xe("div",{className:"grid gap-1 bg-white p-3 text-left",children:[n?Z("p",{className:"text-sm text-[#536471]",children:n}):Z("div",{className:"mb-1 h-4 w-24 rounded-md bg-neutral-100"}),l?Z("h3",{className:"truncate text-sm font-medium text-[#0f1419]",children:l}):Z("div",{className:"mb-1 h-4 w-full rounded-md bg-neutral-100"}),m?Z("p",{className:"line-clamp-2 text-sm text-[#536471]",children:m}):Xe("div",{className:"grid gap-2",children:[Z("div",{className:"h-4 w-full rounded-md bg-neutral-100"}),Z("div",{className:"h-4 w-48 rounded-md bg-neutral-100"})]})]})]})]})}function q9({defaultUrl:e}){return Xe(Ms,{children:[Xe("div",{className:"relative flex items-center",children:[Z(Ls,{className:"absolute inset-y-0 left-0 my-2 ml-3 w-5 text-neutral-400"}),Z("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"})]}),Z("div",{className:"relative overflow-hidden rounded-md border border-neutral-300 bg-neutral-50",children:Z("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:Z(Vt,{})})})]})}var J9={hidden:{scale:.8,opacity:0},show:{scale:1,opacity:1,transition:{type:"spring"}}},Q9={hidden:{opacity:0,y:20},show:{opacity:1,y:0,transition:{duration:.4,type:"spring"}}},eC={initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2,type:"easeInOut"}};import Es from"js-cookie";import{AnimatePresence as kf}from"motion/react";import{createContext as Cf,useState as Pf}from"react";import{jsx as fn}from"react/jsx-runtime";var Sf=Cf({hidePopup:()=>{}});function sC({children:e,hiddenCookieId:t}){let[r,o]=Pf(Es.get(t)==="1"),n=()=>{o(!0),Es.set(t,"1")};return fn(Rs,{children:fn(Sf.Provider,{value:{hidePopup:n},children:fn(kf,{children:!r&&e})})})}import{motion as Tf}from"motion/react";import{jsx as Is}from"react/jsx-runtime";function uC({value:e=0,max:t=100,className:r}){return Is("div",{className:i("h-3 w-full overflow-hidden rounded-full bg-neutral-200",r),children:Is(Tf.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 As}from"class-variance-authority";import{LayoutGroup as Rf,motion as Lf}from"motion/react";import Mf from"next/link";import{useId as Ef}from"react";import{jsx as lr,jsxs as Ds}from"react/jsx-runtime";var If=As("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"}}),Df=As("absolute bottom-0 w-full px-1.5",{variants:{variant:{default:"text-bg-inverted",accent:"text-blue-600"}},defaultVariants:{variant:"default"}});function NC({variant:e,options:t,selected:r,onSelect:o,className:n}){let a=Ef();return lr("div",{className:i("flex text-sm",n),children:lr(Rf,{id:a,children:t.map(({id:d,label:l,href:m,target:c})=>{let s=d===r;return Ds(m?Mf:"div",{className:"relative",href:m??"#",target:c??void 0,children:[Ds("button",{type:"button",...o&&!m&&{onClick:()=>o(d)},className:i(If({variant:e}),c==="_blank"&&"group flex items-center gap-1.5"),"data-selected":s,"aria-selected":s,children:[l,c==="_blank"&&lr(Un,{className:"size-2.5"})]}),s&&lr(Lf.div,{layoutId:"indicator",transition:{duration:.1},className:Df({variant:e}),children:lr("div",{className:"h-0.5 rounded-t-full bg-current"})})]},d)})})})}import{jsx as gn,jsxs as Os}from"react/jsx-runtime";var Af=[{icon:Ra,text:"Custom link previews",href:"https://dub.co/help/article/custom-link-previews"},{icon:oa,text:"Geo/device targeting",href:"https://dub.co/help/article/geo-targeting"},{icon:va,text:"Password protection",href:"https://dub.co/help/article/password-protected-links"},{icon:Sa,text:"Link expiration",href:"https://dub.co/help/article/link-expiration"},{icon:ha,text:"Link cloaking",href:"https://dub.co/help/article/link-cloaking"}];function PC(){return Os("div",{className:"p-3",children:[gn("span",{className:"block text-sm font-semibold text-neutral-600",children:"Advanced link features"}),gn("div",{className:"mt-2 flex flex-col gap-2.5 text-xs text-neutral-600",children:Af.map(({text:e,icon:t,href:r})=>Os("a",{href:r,target:"_blank",className:"flex items-center gap-2.5 underline decoration-dotted underline-offset-2",children:[gn(t,{className:"size-3.5 shrink-0"}),e]},e))})]})}import{jsx as Vs,jsxs as Of}from"react/jsx-runtime";function RC({className:e}){return Of("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:[Vs("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"}),Vs("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{Ro as AUTOPLAY_DEFAULT_DELAY,Mv as Accordion,Gs as AccordionContent,Ws as AccordionItem,Us as AccordionTrigger,Vv as ActivityRing,PC as AdvancedLinkFeaturesTooltip,u0 as Africa,Zs as Alert,Xs as AlertDescription,qs as AlertTitle,h0 as Amazon,k0 as AndroidLogo,de as AnimatedSizeContainer,jf as Anthropic,C0 as Apple,P0 as AppleLogo,S0 as ArrowBoldUp,T0 as ArrowRight,R0 as ArrowTrendUp,L0 as ArrowTurnLeft,M0 as ArrowTurnRight2,Un as ArrowUpRight,Vf as ArrowUpRight2,E0 as ArrowsOppositeDirectionX,I0 as ArrowsOppositeDirectionY,m0 as Asia,Gn as AtSign,dn as AuthButton,Uv as Avatar,ek as Background,Ia as Badge,D0 as BadgeCheck,A0 as BadgeCheck2Fill,rx as BadgeTooltip,O0 as Bell,Yf as Bing,V0 as Blog,Ss as BlurImage,z0 as Bolt,F0 as BoltFill,_0 as Book2,hr as Book2Fill,$0 as Book2Small,H0 as BookOpen,B0 as Books2,W0 as BoxArchive,U0 as BracketsCurly,Kn as BriefcaseFill,G0 as Brush,K0 as BulletList,jn as BulletListFill,te as Button,ox as ButtonTooltip,is as COMPARE_PAGES,j0 as Calculator,ui as Calendar,X0 as Calendar6,Z0 as CalendarDays,Y0 as CalendarIcon,q0 as CalendarRefresh,n0 as CardAmex,a0 as CardDiscover,Rx as CardList,i0 as CardMastercard,ny as CardSelector,s0 as CardVisa,J0 as Cards,Q0 as CaretUpFill,Qc as Carousel,ed as CarouselContent,td as CarouselItem,Ny as CarouselNavBar,od as CarouselNext,rd as CarouselPrevious,Iy as CarouselThumbnail,Ey as CarouselThumbnails,eg as ChartActivity2,tg as ChartArea2,rg as ChartLine,v0 as ChatGPT,xt as Check,vr as Check2,St as Checkbox,Yn as CheckboxCheckedFill,Zn as CheckboxUnchecked,og as ChevronLeft,ng as ChevronRight,ag as ChevronUp,ig as CircleArrowRight,qn as CircleCheck,Xn as CircleCheckFill,sg as CircleDollar,lg as CircleDollarOut,cg as CircleDotted,Jn as CircleHalfDottedCheck,Qn as CircleHalfDottedClock,ea as CircleInfo,dg as CirclePercentage,ug as CirclePlay,mg as CirclePlayFill,pg as CircleQuestion,fg as CircleUser,go as CircleWarning,gg as CircleXmark,bg as Circles,hg as Circles3,Rs as ClientOnly,vg as Cloud,ta as CloudUpload,xg as Code,yg as ColorPalette2,d4 as Combobox,RC as CompositeLogo,wg as ConnectedDots,kg as ConnectedDots4,Ng as ConnectedDotsFill,Cg as Connections3,In as Copy,P9 as CopyButton,M9 as CopyText,Pg as CreditCard,Sg as Crosshairs3,Tg as Crown,zf as CrownSmall,Rg as Cube,Lg as CubeSettings,Mg as CubeSettingsFill,Eg as CurrencyDollar,ra as CursorRays,Ig as DatabaseKey,Do as DatePickerContext,Z4 as DateRangePicker,Dg as Desktop,Ag as DiamondTurnRight,xr as DiamondTurnRightFill,Og as Directions,Vg as Discount,zg as Dots,ow as DotsPattern,Fg as Download,bt as DubAnalyticsIcon,mr as DubApiIcon,Ff as DubCraftedShield,ht as DubLinksIcon,vt as DubPartnersIcon,fo as DubProductIcon,yi as DubStatusBadge,Hg as Duplicate,kt as DynamicTooltipWrapper,oa as Earth,_g as EarthPosition,a5 as EditColumnsButton,uw as EmptyState,$g as Envelope,Bg as EnvelopeAlert,Wg as EnvelopeArrowRight,Ug as EnvelopeBan,Gg as EnvelopeCheck,na as EnvelopeFill,Kg as EnvelopeOpen,p0 as Europe,Dn as ExpandingArrow,aa as Eye,ia as EyeSlash,oo as FEATURES_LIST,J9 as FRAMER_MOTION_LIST_ITEM_VARIANTS,jg as FaceSmile,Zf as Facebook,sa as FeatherFill,x0 as Figma,Yg as FileContent,Hf as FilePen,_f as FileSend,Nw as FileUpload,Zg as FileZip2,iN as Filter,Xg as Filter2,qg as FilterBars,Jg as Flag,eb as Flag2,la as Flag6,Qg as FlagWavy,tb as Flask,rb as FlaskSmall,ob as Folder,lb as Folder5,nb as FolderBookmark,ab as FolderLock,ib as FolderPlus,sb as FolderShield,l9 as Footer,pN as Form,cb as GamingConsole,db as Gauge6,ca as Gear,ub as Gear2,mb as Gear3,pb as Gem,da as Gift,fb as GiftFill,y0 as GitHubEnhanced,pr as Github,gb as Globe,ma as Globe2,ua as GlobePointer,bb as GlobeSearch,Hn as Go,qf as Google,w0 as GoogleEnhanced,hb as GreekTemple,ot as Grid,vb as GridIcon,xb as GridLayoutRows,yb as GridPlus,wb as GripDotsVertical,pa as Heading1,fa as Heading2,Nb as Headset,kb as Heart,Cb as HeartFill,Pb as HexadecagonStar,Sb as History,ga as Hyperlink,$f as IOSAppStore,I9 as IconMenu,Tb as Icosahedron,ba as ImageIcon,ha as Incognito,Rb as InfinityIcon,tx as InfoTooltip,A9 as InlineSnippet,Eu as Input,Lb as InputField,Mb as InputPassword,va as InputPasswordPointer,xa as InputSearch,Xf as Instagram,Eb as InvoiceDollar,Ib as Key,ja as KeyboardShortcutContext,b2 as KeyboardShortcutProvider,ss as LEGAL_PAGES,Au as Label,Db as LayoutSidebar,Ab as License,Ob as LifeRing,yr as LifeRingFill,Vb as LinesY,Fb as Link4,zb as LinkBroken,H9 as LinkLogo,Z9 as LinkPreview,q9 as LinkPreviewPlaceholder,fr as LinkedIn,Vt as LoadingCircle,Kf as LoadingDots,be as LoadingSpinner,Hb as LocationPin,_b as Lock,$b as LockFill,Bf as LockSmall,Xt as Logo,An as Magic,Bb as Magnifier,Wb as MapPosition,Wf as MarkdownIcon,Ub as MarketingTarget,Uf as MatrixLines,no as MaxWidthWrapper,Gb as MediaPause,Kb as MediaPlay,jb as Megaphone,Yb as Menu3,AN as MenuItem,Zb as MessageSmile,wr as MicrophoneFill,UN as MiniAreaChart,Nr as Minus,qb as MobilePhone,qN as Modal,Xb as MoneyBill,Jb as MoneyBill2,Qb as MoneyBills2,eh as Msg,th as Msgs,rh as MsgsDotted,oh as MsgsFill,Qu as MultiValueInput,b6 as Nav,sn as NavContext,E6 as NavMobile,ao as NavWordmark,f0 as NorthAmerica,nh as Note,mh as NucleoPhoto,s3 as NumberStepper,g0 as Oceania,ah as OfficeBuilding,Jf as OpenAI,Cv as PLAN_FEATURE_ICONS,xo as PROSE_STYLES,ya as Page2,d3 as PaginationControls,ih as Paintbrush,sh as Palette2,lh as PaperPlane,l0 as Paypal,dh as Pen2,ch as PenWriting,uh as PercentageArrowDown,On as Photo,_n as Php,ph as Plug2,yt as Plus,fh as Plus2,oe as Popover,sC as Popup,Sf as PopupContext,gh as Post,Qf as ProductHunt,uC as ProgressBar,p3 as ProgressCircle,b3 as ProgressiveBlur,bh as Pyramid,$n as Python,hh as QRCode,Jt as RESOURCES,im as RadioGroup,sm as RadioGroupItem,vh as Receipt2,e0 as Reddit,wa as ReferredVia,xh as Refresh2,F1 as RichTextArea,Va as RichTextContext,N1 as RichTextProvider,E1 as RichTextToolbar,He as RichTextToolbarButton,yh as Robot,Bn as Ruby,an as SDKS,sk as SOCIAL_LINKS,as as SOLUTIONS,Q9 as STAGGER_CHILD_VARIANTS,Na as SatelliteDish,wh as ScanText,Nh as Scribble,Ir as ScrollContainer,nx as ScrollableTooltipContent,C3 as Sheet,kh as ShieldAlert,Ch as ShieldCheck,Ph as ShieldKeyhole,Sh as ShieldSlash,Th as ShieldUser,R3 as ShimmerDots,Rh as Shop,Lh as Shuffle,Mh as Sitemap,t0 as Slack,E3 as Slider,Eh as Sliders,O3 as SmartDateTimePicker,Ih as SortAlphaAscending,Dh as SortAlphaDescending,Vn as SortOrder,b0 as SouthAmerica,Ah as Sparkle3,N0 as Spotify,Oh as SquareChart,Vh as SquareCheck,zh as SquareLayoutGrid5,Fh as SquareLayoutGrid6,Hh as SquareUserSparkle2,_h as SquareXmark,$h as Star,Bh as StarFill,Wh as Stars2,B3 as StatusBadge,c0 as StripeIcon,d0 as StripeLink,zn as Success,Uh as Suitcase,q3 as Switch,eC as TAB_ITEM_ANIMATION_SETTINGS,ev as TV,NC as TabSelect,M5 as Table,Gh as TableIcon,Kh as TableRows2,jh as Tablet,Yh as Tag,Zh as Tags,ka as TextBold,Ca as TextItalic,Pa as TextStrike,Fn as Tick,r0 as TikTok,Sa as Timer2,F5 as TimestampTooltip,Ta as Toggle2Fill,U5 as ToggleGroup,qh as Toggles,Gv as TokenAvatar,q as Tooltip,ex as TooltipContent,Q1 as TooltipProvider,Xh as Trash,Jh as TriangleWarning,Qh as Trophy,gr as Twitter,Wn as Typescript,J5 as UTMBuilder,op as UTM_PARAMETERS,tv as UiCard,o0 as Unsplash,rv as User,ov as UserArrowRight,nv as UserCheck,Gf as UserClock,av as UserCrown,iv as UserDelete,sv as UserFocus,lv as UserMinus,cv as UserPlus,dv as UserSearch,uv as UserXmark,mv as Users,fv as Users2,gv as Users6,zt as UsersFill,pv as UsersSettings,bv as Versions2,Ra as Views,hv as Watch,vv as Webhook,xv as Window,yv as WindowSearch,wv as WindowSettings,ks as Wordmark,Nv as Workflow,kv as Xmark,br as YouTube,rl as badgeVariants,ce as buttonVariants,el as getUserAvatarUrl,Ko as menuItemVariants,ln as navItems,Cm as statusBadgeVariants,Ce as useCarousel,ai as useCarouselActiveIndex,Ex as useClickHandlers,Vx as useColumnVisibility,_x as useCookies,Pt as useCopyToClipboard,Gx as useCurrentAnchor,Zx as useCurrentSubdomain,Qx as useEnterSubmit,o2 as useInViewport,i2 as useInputFocused,d2 as useIntersectionObserver,_e as useKeyboardShortcut,Co as useLocalStorage,ee as useMediaQuery,w2 as useOptimisticUpdate,D2 as usePagination,V2 as useRemoveGAParams,Tr as useResizeObserver,Ft as useRichTextContext,qa as useRouterStuff,Qa as useScroll,Fe as useScrollProgress,L5 as useTable,Za as useTablePagination,U2 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};
|