@collective-intelligence/ui-react 0.3.5 → 0.3.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/README.md +207 -3
  2. package/dist/chat.d.ts +578 -0
  3. package/dist/chat.js +2 -0
  4. package/dist/components/ai-elements/index.d.ts +95 -0
  5. package/dist/components/ai-elements/index.js +2 -0
  6. package/dist/components/icons/index.js +1 -1
  7. package/dist/components/illustrations/index.js +1 -1
  8. package/dist/components/ui/index.d.ts +183 -26
  9. package/dist/components/ui/index.js +4 -2
  10. package/dist/components/ui-extensions/atoms/ThemeToggle/index.js +1 -1
  11. package/dist/components/ui-extensions/hooks/use-mobile.js +1 -1
  12. package/dist/components/ui-extensions/index.d.ts +6 -6
  13. package/dist/components/ui-extensions/index.js +6 -6
  14. package/dist/components/ui-extensions/molecules/VideoPlayer/index.js +2 -2
  15. package/dist/hooks/index.js +1 -1
  16. package/dist/hooks/operations.js +1 -1
  17. package/dist/hooks/use-debounced-callback.js +1 -1
  18. package/dist/hooks/use-mount-action.js +1 -1
  19. package/dist/index-064d20xp.js +2 -0
  20. package/dist/index-0gzm7bb9.js +2 -0
  21. package/dist/index-1hxjsnw5.js +2 -0
  22. package/dist/index-2twj52t7.js +2 -0
  23. package/dist/index-2yf6mq9g.js +2 -0
  24. package/dist/{index-cx7rgb00.js → index-4cds99c5.js} +2 -2
  25. package/dist/index-64r6cav3.js +1 -0
  26. package/dist/{index-38vsn5nv.js → index-6r0znbzv.js} +2 -2
  27. package/dist/index-7j277075.js +2 -0
  28. package/dist/{index-r4k327de.js → index-9289ppfk.js} +2 -2
  29. package/dist/{index-a27yrhds.js → index-9gtg7nt7.js} +2 -2
  30. package/dist/index-ab3fc47y.js +2 -0
  31. package/dist/index-b1wfq5b8.js +2 -0
  32. package/dist/index-dg126t3v.js +2 -0
  33. package/dist/index-dvvkk1vk.js +2 -0
  34. package/dist/index-ecvn2gnv.js +2 -0
  35. package/dist/index-fnk7gsdd.js +2 -0
  36. package/dist/index-ggr2edm8.js +2 -0
  37. package/dist/index-m0v264jr.js +2 -0
  38. package/dist/index-ngpxevag.js +2 -0
  39. package/dist/index-nxbvv8m4.js +2 -0
  40. package/dist/index-pearjjhb.js +2 -0
  41. package/dist/{index-fwsd4nes.js → index-qbwndfn2.js} +2 -2
  42. package/dist/index-r2snvwyb.js +42 -0
  43. package/dist/index-r5ds1mtq.js +2 -0
  44. package/dist/index-r7hjj3ek.js +2 -0
  45. package/dist/index-rgbg5bsy.js +2 -0
  46. package/dist/{index-dhysnhdt.js → index-rjemhrz1.js} +2 -2
  47. package/dist/index-sd38wa4w.js +2 -0
  48. package/dist/index-t9yq7kfg.js +2 -0
  49. package/dist/index-tcwzyy71.js +2 -0
  50. package/dist/{index-y2h3pwvb.js → index-vx2b9cz3.js} +2 -2
  51. package/dist/index-vyhk8kgm.js +6 -0
  52. package/dist/index-ykjbsyeq.js +2 -0
  53. package/dist/index-zmwpsfzp.js +2 -0
  54. package/dist/index-zrw7ne3f.js +2 -0
  55. package/dist/index.js +1 -1
  56. package/dist/resources.js +1 -1
  57. package/dist/shadcn.css +667 -0
  58. package/dist/styles.css +2 -0
  59. package/dist/tokens/theme.js +1 -1
  60. package/dist/utils/cn.js +1 -1
  61. package/package.json +43 -7
  62. package/dist/index-0warxk1d.js +0 -2
  63. package/dist/index-1qb5701q.js +0 -2
  64. package/dist/index-38vag578.js +0 -2
  65. package/dist/index-3y40hfmd.js +0 -2
  66. package/dist/index-4d90e50j.js +0 -2
  67. package/dist/index-50g897x2.js +0 -42
  68. package/dist/index-58jcemv5.js +0 -2
  69. package/dist/index-956qe6w8.js +0 -2
  70. package/dist/index-dcmmdjnn.js +0 -2
  71. package/dist/index-k8bsc1hv.js +0 -2
  72. package/dist/index-kgq1r8sg.js +0 -2
  73. package/dist/index-rvcf3zsv.js +0 -2
  74. package/dist/index-s18na57g.js +0 -6
  75. package/dist/index-t5c4bv5n.js +0 -2
@@ -1,12 +1,12 @@
1
1
  "use client";
2
- import{mr,yt,hr,ne,gr,zt,He,pe,vr,xr,br,yr,Sr,lt,St,ct,Ge,Cr,wr,$e}from"../../index-956qe6w8.js";import{f,n}from"../../index-50g897x2.js";import{p,m}from"../../index-0warxk1d.js";import{k,E,G,or,M,Q,h,y,z,J,ee,te}from"../../index-3y40hfmd.js";import{Ke,je,Ye,wt,ie,Xe,D,se,Ze,me,Qe,Z,N,R,L,I,pt,Je,It,Pt,Tt,kt,Et,Mt,At,Dt,Nt,_t,Ot,Ve,et,tt,rt,Bt,Ut,mt,ht,Ht,Gt}from"../../index-s18na57g.js";import{ot,at,nt}from"../../index-dcmmdjnn.js";import{nr}from"../../index-rvcf3zsv.js";import{gt}from"../../index-r4k327de.js";import{ut,T,dt,Oe,Fe,ft,Be}from"../../index-1qb5701q.js";import{v,x}from"../../index-4d90e50j.js";import"../../index-a27yrhds.js";import{e}from"../../index-fwsd4nes.js";import{jsx as pc,jsxs as mc}from"react/jsx-runtime";var uc=({children:t,loading:r=!1,fullWidth:o=!1,className:a,disabled:s,variant:i,size:l,...c})=>mc(n,{variant:i,size:l,className:e(o&&"w-full",a),disabled:s===!0||r,...c,children:[r&&pc($e,{size:20,className:"mr-2"}),t]}),fc=uc;import*as Wa from"react";import{jsx as Ga,jsxs as bc}from"react/jsx-runtime";var gc=({children:t,className:r,type:o="button",...a},s)=>bc(n,{ref:s,type:o,variant:"ghost",size:"sm",className:e("h-9 rounded-full border border-dashed border-border/80 bg-background px-3 text-xs font-medium text-muted-foreground shadow-xs transition-[transform,color,background-color,border-color] hover:border-primary/35 hover:bg-muted/45 hover:text-foreground active:scale-[0.98]",r),...a,children:[Ga("span",{className:"mr-2 inline-flex size-5 items-center justify-center rounded-full border border-border/70 bg-muted/45 text-foreground",children:Ga(Ge,{className:"size-3.5"})}),t]}),Kn=Wa.forwardRef(gc);Kn.displayName="AddItemButton";var vc=Kn;import{forwardRef as hc}from"react";import{jsx as yc}from"react/jsx-runtime";var Xa=(t,r,o)=>{if(r<1||r>12||o<1||o>31)return!1;let a=new Date(t,r-1,o);return a.getFullYear()===t&&a.getMonth()===r-1&&a.getDate()===o},xc=(t)=>{let r=t.trim();if(!r)return null;let o=/^(?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2})$/u.exec(r);if(o){let{year:s,month:i,day:l}=o.groups??{};return Xa(Number(s),Number(i),Number(l))?`${s}-${i}-${l}`:null}let a=/^(?<day>\d{1,2})[/\-.](?<month>\d{1,2})[/\-.](?<year>\d{4})$/u.exec(r);if(a){let{day:s,month:i,year:l}=a.groups??{},c=Number(s),d=Number(i),u=Number(l);if(!Xa(u,d,c))return null;return`${u}-${String(d).padStart(2,"0")}-${String(c).padStart(2,"0")}`}return null},Ua=hc(function({onPaste:r,...o},a){return yc(h,{ref:a,type:"date",onPaste:(i)=>{let l=i.clipboardData.getData("text"),c=xc(l);if(c!==null&&c!==""){i.preventDefault();let d=i.currentTarget,u=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value")?.set?.bind(d);if(u!==void 0)u(c),d.dispatchEvent(new Event("input",{bubbles:!0}))}r?.(i)},...o})});Ua.displayName="DateInput";var wc=Ua;import*as Ka from"react";import{jsx as Rc}from"react/jsx-runtime";var Ya=f("font-display font-bold leading-[1.06] tracking-tight text-foreground",{defaultVariants:{size:"lg"},variants:{size:{lg:"text-[1.5rem] sm:text-[1.85rem]",md:"text-[1.15rem] sm:text-[1.25rem]",sm:"text-[1rem]",xl:"text-[2.1rem] sm:text-[2.5rem]"}}}),Nc=({as:t="h2",size:r,className:o,...a},s)=>Rc(t,{ref:s,className:e(Ya({size:r}),o),...a}),qa=Ka.forwardRef(Nc);qa.displayName="DisplayHeading";var Cc=qa;import*as Er from"react";import{jsx as on,jsxs as Qa,Fragment as Za}from"react/jsx-runtime";var Yn=Er.forwardRef(function({value:r,label:o,variant:a="icon",copyLabel:s="Copy",copiedLabel:i="Copied",errorMessage:l="Failed to copy to clipboard",resetDelay:c=1500,className:d,onClick:u,...g},b){let[w,P]=Er.useState(!1),C=Er.useRef(null);Er.useEffect(()=>()=>{if(C.current!==null)clearTimeout(C.current)},[]);let A=async(j)=>{u?.(j);try{if(await navigator.clipboard.writeText(r),P(!0),C.current!==null)clearTimeout(C.current);C.current=setTimeout(()=>{P(!1)},c)}catch{D.error(l)}};if(a==="button")return on(n,{ref:b,type:"button",variant:"outline",onClick:(j)=>{A(j)},"aria-label":`Copy ${o}`,className:e("shrink-0",d),...g,children:w?Qa(Za,{children:[on(p,{className:"mr-1 size-4"}),i]}):Qa(Za,{children:[on(ne,{className:"mr-1 size-4"}),s]})});return on("button",{ref:b,type:"button",onClick:(j)=>{A(j)},"aria-label":`Copy ${o}`,className:e("flex size-8 shrink-0 items-center justify-center rounded-md border border-border bg-card text-muted-foreground transition hover:border-primary/40 hover:text-primary",d),...g,children:w?on(p,{className:"size-3.5 text-primary"}):on(ne,{className:"size-3.5"})})});Yn.displayName="CopyButton";var Sc=Yn;import{jsx as Xo,jsxs as Pc}from"react/jsx-runtime";var es="#a3d54a",ts=({className:t,...r})=>Pc("svg",{...r,"aria-hidden":"true",className:e("size-6 shrink-0",t),"data-slot":"collective-intelligence-loader",fill:"none",viewBox:"0 0 24 24",children:[Xo("polyline",{className:"origin-center motion-safe:animate-[ci-breathe-left_1.8s_ease-in-out_infinite]",points:"10,5.5 4.5,12 10,18.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2.2}),Xo("polyline",{className:"origin-center motion-safe:animate-[ci-breathe-right_1.8s_ease-in-out_infinite]",points:"14,5.5 19.5,12 14,18.5",stroke:es,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2.2}),Xo("circle",{className:"origin-center [transform-box:fill-box] motion-safe:animate-[ci-pulse-dot_1.8s_ease-in-out_infinite]",cx:12,cy:12,fill:es,r:2.3})]});ts.displayName="CollectiveIntelligenceLoader";var Tc=ts;import{jsx as Lc}from"react/jsx-runtime";var kc=({children:t,className:r})=>Lc("div",{className:e("text-destructive text-sm text-center",r),children:t}),Dc=kc;import*as rs from"react";import{jsx as Mc}from"react/jsx-runtime";var Ec=({value:t,fallback:r="—",locale:o,className:a,...s},i)=>Mc("span",{ref:i,className:e("tabular-nums",a),...s,children:t===null||t===void 0?r:new Intl.NumberFormat(o).format(t)}),ns=rs.forwardRef(Ec);ns.displayName="FormattedNumber";var Ic=ns;import*as os from"react";import{jsx as Hc}from"react/jsx-runtime";var Ac={accent:"bg-[color-mix(in_oklab,var(--chart-1)_12%,var(--card))] text-[color-mix(in_oklab,var(--chart-1)_85%,var(--foreground))] border-[color-mix(in_oklab,var(--chart-1)_22%,var(--border))]",gold:"bg-[color-mix(in_oklab,var(--chart-3)_15%,var(--card))] text-[color-mix(in_oklab,var(--chart-3)_65%,var(--foreground))] border-[color-mix(in_oklab,var(--chart-3)_28%,var(--border))]",neutral:"bg-(--bg-surface-alt)/70 text-(--text-secondary) border-(--border-subtle)",sage:"bg-[color-mix(in_oklab,var(--chart-2)_14%,var(--card))] text-[color-mix(in_oklab,var(--chart-2)_70%,var(--foreground))] border-[color-mix(in_oklab,var(--chart-2)_26%,var(--border))]",sky:"bg-[color-mix(in_oklab,var(--chart-4)_14%,var(--card))] text-[color-mix(in_oklab,var(--chart-4)_70%,var(--foreground))] border-[color-mix(in_oklab,var(--chart-4)_26%,var(--border))]",violet:"bg-[color-mix(in_oklab,var(--chart-5)_14%,var(--card))] text-[color-mix(in_oklab,var(--chart-5)_70%,var(--foreground))] border-[color-mix(in_oklab,var(--chart-5)_26%,var(--border))]"},Oc={lg:"size-12 rounded-lg text-[17px] [&_svg]:size-6",md:"size-10 rounded-lg text-[15px] [&_svg]:size-5",sm:"size-8 rounded-md text-[13px] [&_svg]:size-4"},as=os.forwardRef(function({tone:r="neutral",size:o="md",initial:a,className:s,children:i,...l},c){return Hc("span",{ref:c,"aria-hidden":!0,className:e("inline-flex shrink-0 select-none items-center justify-center border font-display font-bold",Oc[o],Ac[r],s),...l,children:i??(a!==void 0&&a!==""?a.slice(0,2).toUpperCase():null)})});as.displayName="IconTile";var Vc=as;import*as ss from"react";import{jsx as _c}from"react/jsx-runtime";var Bc={accent:"text-(--accent)",copper:"text-(--text-muted)",default:"text-(--text-muted)",muted:"text-(--text-muted)"},Fc=({as:t="span",tone:r="default",className:o,...a},s)=>_c(t,{ref:s,className:e("inline-block text-[11px] font-semibold uppercase tracking-[0.06em]",Bc[r],o),...a}),an=ss.forwardRef(Fc);an.displayName="Kicker";var zc=an;import*as is from"react";import{jsx as jc}from"react/jsx-runtime";var $c=(t)=>`+${t}`,Jc=({expanded:t,hiddenCount:r,collapsedLabel:o=$c,expandedLabel:a="Show less",onToggle:s,className:i,...l},c)=>jc("button",{ref:c,type:"button",onClick:s,className:e("inline-flex items-center gap-1 rounded-full border border-dashed border-muted-foreground/40 bg-muted/20 px-2.5 py-1 text-[11px] font-medium text-muted-foreground hover:bg-muted/40 hover:text-foreground transition-colors",i),...l,children:t?a:o(r)}),ls=is.forwardRef(Jc);ls.displayName="ShowMoreTag";var Gc=ls;import*as cs from"react";import{jsx as Uc}from"react/jsx-runtime";var Wc=f("font-sans leading-none tabular-nums text-primary",{defaultVariants:{size:"md"},variants:{size:{lg:"text-[1.4rem]",md:"text-[1.1rem]",sm:"text-[0.95rem]",xl:"text-[2rem]"}}}),Xc=({size:t,className:r,...o},a)=>Uc("span",{ref:a,className:e(Wc({size:t}),r),...o}),sn=cs.forwardRef(Xc);sn.displayName="SerifNumeral";var Kc=sn;import{jsx as Uo,jsxs as qc}from"react/jsx-runtime";var Ko=9,ds=2*Math.PI*Ko,Yc=(t,r,o)=>{if(!Number.isFinite(t)||!Number.isFinite(r)||!Number.isFinite(o))return 0;if(o<=r)return 0;return Math.min(1,Math.max(0,(t-r)/(o-r)))},us=({className:t,classes:r,label:o,max:a=100,min:s=0,title:i,value:l,"aria-label":c,...d})=>{let u=Yc(l,s,a),g=Math.round(u*100),b=s+u*(a-s),w=ds*(1-u);return Uo("span",{"aria-label":c??`${o}: ${g}%`,"aria-valuemax":a,"aria-valuemin":s,"aria-valuenow":b,className:e("grid size-8 shrink-0 place-items-center text-muted-foreground",r?.root,t),title:i??`${o} ${g}%`,...d,children:qc("svg",{"aria-hidden":"true",className:e("size-6 -rotate-90",r?.svg),viewBox:"0 0 24 24",children:[Uo("circle",{className:e("stroke-muted",r?.track),cx:"12",cy:"12",fill:"none",r:Ko,strokeWidth:"3"}),Uo("circle",{className:e("stroke-foreground transition-[stroke-dashoffset]",r?.indicator),cx:"12",cy:"12",fill:"none",r:Ko,strokeDasharray:ds,strokeDashoffset:w,strokeLinecap:"round",strokeWidth:"3"})]})})};us.displayName="Ring";var Zc=us;import*as fs from"react";import{jsx as ms,jsxs as td}from"react/jsx-runtime";var ps={danger:"bg-destructive",neutral:"bg-muted-foreground/40",primary:"bg-primary",success:"bg-emerald-500",warning:"bg-amber-500"},Qc={md:"size-2",sm:"size-1.5"},ed=({tone:t="neutral",pulse:r=!1,size:o="sm",className:a,...s},i)=>td("span",{ref:i,className:e("relative inline-flex shrink-0",Qc[o],a),...s,children:[r&&ms("span",{"aria-hidden":!0,className:e("absolute inline-flex h-full w-full animate-ping rounded-full opacity-60",ps[t])}),ms("span",{"aria-hidden":!0,className:e("relative inline-flex h-full w-full rounded-full",ps[t])})]}),qn=fs.forwardRef(ed);qn.displayName="StatusDot";var rd=qn;import*as vs from"react";import{jsx as bs,jsxs as gs}from"react/jsx-runtime";var nd={neutral:"border-(--border-subtle) bg-card text-muted-foreground",warning:"border-[color-mix(in_oklab,var(--warning)_40%,var(--border))] bg-[color-mix(in_oklab,var(--warning)_12%,var(--card))] text-[color-mix(in_oklab,var(--warning)_75%,var(--foreground))]"},od=({tooltip:t,tone:r="neutral",icon:o,className:a,children:s,...i},l)=>gs(et,{children:[bs(tt,{asChild:!0,children:gs(z,{ref:l,variant:"outline",className:e(nd[r],a),...i,children:[o,s]})}),bs(rt,{children:t})]}),hs=vs.forwardRef(od);hs.displayName="TooltipBadge";var ad=hs;import*as xs from"react";import{jsx as id}from"react/jsx-runtime";var sd={body1:{className:"text-base",tag:"p"},body2:{className:"text-sm",tag:"p"},h1:{className:"text-2xl font-semibold",tag:"h1"},h2:{className:"text-xl font-bold",tag:"h2"},h3:{className:"text-lg font-semibold",tag:"h3"},h4:{className:"text-base font-medium",tag:"h4"},subtitle1:{className:"text-base font-normal text-muted-foreground",tag:"h6"},subtitle2:{className:"text-sm font-medium text-muted-foreground",tag:"h6"}},Zn=xs.forwardRef(function({variant:r="body1",as:o,className:a,...s},i){let{tag:l,className:c}=sd[r];return id(o??l,{ref:i,className:e(c,a),...s})});Zn.displayName="Typography";import{jsx as cd}from"react/jsx-runtime";var ld=({children:t,as:r="form",className:o,onSubmit:a,...s})=>{let i=(l)=>{l.preventDefault(),a?.(l)};return cd(r,{className:e("flex flex-col gap-4 min-w-[300px]",o),onSubmit:i,...s,children:t})},dd=ld;import{jsx as fd}from"react/jsx-runtime";var ys={},ln=(...t)=>{for(let r of t)if(r!==void 0)return r;return 1},ud=(t=ys)=>({"--list-cols":ln(t.cols),"--list-cols-2xl":ln(t.cols2xl,t.colsXl,t.colsLg,t.colsMd,t.colsSm,t.cols),"--list-cols-lg":ln(t.colsLg,t.colsMd,t.colsSm,t.cols),"--list-cols-md":ln(t.colsMd,t.colsSm,t.cols),"--list-cols-sm":ln(t.colsSm,t.cols),"--list-cols-xl":ln(t.colsXl,t.colsLg,t.colsMd,t.colsSm,t.cols)}),pd=["grid","gap-4","[grid-template-columns:repeat(var(--list-cols),minmax(0,1fr))]","sm:[grid-template-columns:repeat(var(--list-cols-sm),minmax(0,1fr))]","md:[grid-template-columns:repeat(var(--list-cols-md),minmax(0,1fr))]","lg:[grid-template-columns:repeat(var(--list-cols-lg),minmax(0,1fr))]","xl:[grid-template-columns:repeat(var(--list-cols-xl),minmax(0,1fr))]","2xl:[grid-template-columns:repeat(var(--list-cols-2xl),minmax(0,1fr))]"].join(" "),md=({cols:t=ys,children:r,...o})=>fd("div",{className:pd,style:ud(t),...o,children:r});import{jsx as bd}from"react/jsx-runtime";var gd=({className:t,spaced:r=!1,...o})=>bd("div",{className:e("animate-[rise-in_500ms_cubic-bezier(0.16,1,0.3,1)_both]",r&&"space-y-6",t),...o});var vd=gd;import{jsx as Dn,jsxs as cn}from"react/jsx-runtime";var hd=(t)=>t!==null&&t!==void 0&&t.constructor===String,Ln=(t)=>t!==null&&t!==void 0&&t!==!1&&t!==""&&t!==0,xd=({title:t,description:r,icon:o,kicker:a,status:s,actions:i,className:l})=>cn("header",{className:e("space-y-2",l),children:[Ln(a)?cn("div",{className:"flex items-center gap-2 text-(--text-muted) [&_svg]:h-3.5 [&_svg]:w-3.5",children:[Ln(o)?Dn("span",{className:"inline-flex h-5 w-5 items-center justify-center rounded-sm bg-(--bg-accent-soft) text-(--accent)",children:o}):null,Dn("span",{className:"text-[12px] font-medium tracking-tight [&_span.sep]:mx-1.5 [&_span.sep]:text-(--accent)",children:hd(a)?a.split("·").map((c,d,u)=>cn("span",{children:[c.trim(),d<u.length-1?Dn("span",{className:"sep","aria-hidden":!0,children:"·"}):null]},d)):a})]}):null,cn("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[cn("div",{className:"min-w-0 flex-1 basis-64 space-y-1.5",children:[Dn("h1",{className:"font-display text-[27px] font-bold leading-tight tracking-[-0.02em] text-(--text-primary)",children:t}),Ln(r)?Dn("p",{className:"max-w-2xl text-[14px] leading-relaxed text-(--text-secondary)",children:r}):null]}),Ln(i)||Ln(s)?cn("div",{className:"flex shrink-0 items-center gap-2 pt-1",children:[s,i]}):null]})]}),yd=xd;import*as Ns from"react";import{jsx as Qn,jsxs as ws}from"react/jsx-runtime";var Yo=(t)=>t!==void 0&&t!==null&&t!==!1&&t!==0&&t!==""&&!Number.isNaN(t),Rs=Ns.forwardRef(function({icon:r,title:o,description:a,action:s,className:i,...l},c){return ws("div",{ref:c,className:e("flex items-start gap-3",i),...l,children:[Yo(r)?Qn("span",{"aria-hidden":!0,className:"mt-0.5 inline-flex shrink-0 items-center justify-center rounded-md bg-muted p-2 text-muted-foreground [&_svg]:h-4 [&_svg]:w-4",children:r}):null,ws("div",{className:"min-w-0 flex-1",children:[Qn("h3",{className:"text-[15px] font-semibold leading-snug text-foreground",children:o}),Yo(a)?Qn("p",{className:"mt-0.5 text-sm leading-relaxed text-muted-foreground",children:a}):null]}),Yo(s)?Qn("div",{className:"shrink-0",children:s}):null]})});Rs.displayName="SectionHeader";var wd=Rs;import{jsx as Cs,jsxs as Rd}from"react/jsx-runtime";var Nd=({title:t,toolbar:r})=>Rd("div",{className:"flex items-center justify-between mb-12",children:[Cs(Zn,{variant:"h2",children:t}),Boolean(r)&&Cs("div",{className:"flex items-center gap-2",children:r})]}),Cd=Nd;import*as to from"react";import{jsx as Vt,jsxs as eo}from"react/jsx-runtime";var Ss=(t,r,o)=>{if(t.length>=r)return t;return[...t,...Array.from({length:r-t.length},o)]},Sd=[],qo=({values:t,defaultValues:r=Sd,onValuesChange:o,addLabel:a,getRemoveLabel:s,actions:i,minItems:l=0,disabled:c=!1,renderItem:d,createItem:u,validateItem:g,classes:b,className:w,id:P,...C})=>{let A=to.useId(),[j,B]=to.useState(()=>Ss(r,l,u)),O=Ss(t??j,l,u),H=Boolean(i),F=(X)=>{if(t===void 0)B(X);o?.(X)};return eo("div",{"data-slot":"array-input",className:e("space-y-2",b?.root,w),...C,children:[Vt("div",{className:"space-y-2",children:O.map((X,V)=>{let _=V===0&&P!==void 0&&P!==""?P:`${A}-${V}`,W=g?.(X,V);return eo("div",{className:e("flex items-center gap-3",b?.row),children:[d({disabled:c,id:_,index:V,onValueChange:(oe)=>{let K=[...O];K[V]=oe,F(K)},validationMessage:W,value:X}),O.length>l?Vt(n,{type:"button",variant:"ghost",size:"icon",disabled:c,"aria-label":s(V),className:e("size-10 shrink-0 text-muted-foreground hover:text-destructive",b?.removeButton),onClick:()=>{F(O.filter((oe,K)=>K!==V))},children:Vt(Cr,{"aria-hidden":"true",className:"size-4"})}):null]},V)})}),eo("div",{className:e("flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",b?.actionRow),children:[Vt(Kn,{disabled:c,className:b?.addButton,onClick:()=>{F([...O,u()])},children:a}),H?Vt("div",{className:e("sm:ml-auto",b?.actions),children:i}):null]})]})},Pd=(t)=>{let{createItem:r,getItemLabel:o,inputProps:a,placeholder:s,required:i=!1,renderItem:l,...c}=t,{className:d,...u}=a??{};if(l!==void 0)return Vt(qo,{...c,createItem:r??(()=>""),renderItem:l});return Vt(qo,{...c,createItem:r??(()=>""),renderItem:(g)=>{let{disabled:b,id:w,index:P,onValueChange:C,validationMessage:A,value:j}=g;return eo("div",{className:"min-w-0 flex-1",children:[Vt(h,{...u,id:w,"aria-label":o(P),"aria-invalid":Boolean(A),value:j,placeholder:s,required:i,disabled:b,className:e("w-full",d,c.classes?.input),onChange:(B)=>{C(B.target.value)}}),A!==void 0&&A!==""?Vt("p",{className:"mt-1 text-xs text-destructive",role:"alert",children:A}):null]})}})},Td=(t)=>Vt(qo,{...t}),kd=(t)=>t.createItem!==void 0&&t.renderItem!==void 0,Ps=(t)=>{if(kd(t))return Vt(Td,{...t});return Vt(Pd,{...t})};Ps.displayName="ArrayInput";var Ld=Ps;import*as dn from"react";var Mr=(t,r)=>{let o=[];for(let a of t){let s=o.findIndex((i)=>r(a,i)<0);if(s===-1)o.push(a);else o.splice(s,0,a)}return o};var Ft={hour:9,interval:1,minute:0,mode:"day",monthday:1,weekdays:[1,2,3,4,5]},Zo=/^\*\/(?<step>\d+)$/u,Dd=(t)=>{let r=[];for(let o of t.split(",")){let a=/^(?<start>\d+)-(?<end>\d+)$/u.exec(o);if(a){let s=Number(a.groups?.start),i=Number(a.groups?.end);if(s>i)return null;for(let l=s;l<=i;l+=1)r.push(l)}else if(/^\d+$/u.test(o))r.push(Number(o));else return null}return r},Ed=(t,r,o,a)=>{if(r==="*"&&o==="*"&&a==="*"){let s=Zo.exec(t),i=Number(s?.groups?.step);return s&&i>=1&&i<=59?{...Ft,interval:i,mode:"minutes"}:null}return},Md=(t,r,o,a)=>{if(r!=="*"||o!=="*")return;let s=Zo.exec(t);if(s){let i=Number(s.groups?.step);return i>=1&&i<=23?{...Ft,interval:i,minute:a,mode:"hours"}:null}return},Id=(t,r,o)=>{let a=Zo.exec(t);if(a){let i=Number(a.groups?.step);if(i%7===0&&i>=7&&i<=28)return{...Ft,hour:r,interval:i/7,minute:o,mode:"weeks"};return i>=1&&i<=31?{...Ft,hour:r,interval:i,minute:o,mode:"days"}:null}let s=Number(t);return/^\d+$/u.test(t)&&s>=1&&s<=31?{...Ft,hour:r,minute:o,mode:"month",monthday:s}:null},Ad=(t,r,o)=>{let a=Dd(t);if(!a||a.some((i)=>i<0||i>7))return null;let s=Mr(new Set(a.map((i)=>i===7?0:i)),(i,l)=>i-l);return{...Ft,hour:r,minute:o,mode:"week",weekdays:s}},En=(t)=>{let r=t.trim().split(/\s+/u);if(r.length!==5)return null;let[o,a,s,i,l]=r;if(i!=="*")return null;let c=Ed(o,a,s,l);if(c!==void 0)return c;if(!/^\d+$/u.test(o))return null;let d=Number(o);if(d<0||d>59)return null;let u=Md(a,s,l,d);if(u!==void 0)return u;if(!/^\d+$/u.test(a))return null;let g=Number(a);if(g<0||g>23)return null;if(s==="*"&&l==="*")return{...Ft,hour:g,minute:d,mode:"day"};if(l==="*")return Id(s,g,d);if(s==="*")return Ad(l,g,d);return null},Ir=(t)=>{let r=Math.max(1,Math.floor(t.interval));switch(t.mode){case"minutes":return`*/${Math.min(r,59)} * * * *`;case"hours":return`${t.minute} */${Math.min(r,23)} * * *`;case"day":return`${t.minute} ${t.hour} * * *`;case"days":return`${t.minute} ${t.hour} */${Math.min(r,31)} * *`;case"week":{let o=t.weekdays.length>0?Mr(new Set(t.weekdays),(a,s)=>a-s).join(","):"*";return`${t.minute} ${t.hour} * * ${o}`}case"weeks":return`${t.minute} ${t.hour} */${Math.min(r*7,28)} * *`;case"month":return`${t.minute} ${t.hour} ${Math.min(Math.max(t.monthday,1),31)} * *`;default:throw Error("Unsupported cron mode")}},Ts=(t,r,o)=>{if(t==="*")return!0;for(let a of t.split(",")){let s=/^(?<base>\*|\d+|\d+-\d+)\/(?<increment>\d+)$/u.exec(a);if(s){let l=s.groups?.base??"";if(l!=="*"&&!Ts(l,r,o))return!1;let c=Number(s.groups?.increment);if(!Number.isFinite(c)||c<1)return!1;continue}let i=/^(?<start>\d+)-(?<end>\d+)$/u.exec(a);if(i){let l=Number(i.groups?.start),c=Number(i.groups?.end);if(l<r||c>o||l>c)return!1;continue}if(/^\d+$/u.test(a)){let l=Number(a);if(l<r||l>o)return!1;continue}return!1}return!0},Od=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Hd=(t,r)=>{let o=String(t).padStart(2,"0"),a=String(r).padStart(2,"0");return`${o}:${a}`},ro=(t)=>{let r=En(t);if(!r)return t;let o=Hd(r.hour,r.minute);switch(r.mode){case"minutes":return r.interval===1?"Every minute":`Every ${r.interval} minutes`;case"hours":return r.interval===1?`Every hour at :${String(r.minute).padStart(2,"0")}`:`Every ${r.interval} hours at :${String(r.minute).padStart(2,"0")}`;case"day":return`Every day at ${o}`;case"days":return r.interval===1?`Every day at ${o}`:`Every ${r.interval} days at ${o}`;case"week":{if(r.weekdays.length===0)return`Weekly at ${o}`;let a=Mr(r.weekdays,(c,d)=>c-d),s=a.length===5&&a.every((c,d)=>c===d+1),i=a.length===2&&a[0]===0&&a[1]===6;if(s)return`Weekdays at ${o}`;if(i)return`Weekends at ${o}`;return`${a.map((c)=>Od[c].slice(0,3)).join(", ")} at ${o}`}case"weeks":return r.interval===1?`Every week at ${o}`:`Every ${r.interval} weeks at ${o}`;case"month":return`Day ${r.monthday} of every month at ${o}`;default:throw Error("Unsupported cron mode")}},Qo=(t)=>{let r=t.trim().split(/\s+/u);if(r.length!==5)return!1;let o=[[0,59],[0,23],[1,31],[1,12],[0,7]];return r.every((a,s)=>Ts(a,o[s][0],o[s][1]))};import*as Ls from"react";var ks=(t)=>{let a=new Intl.DateTimeFormat("en-US",{timeZone:t,timeZoneName:"shortOffset"}).formatToParts(new Date).find((d)=>d.type==="timeZoneName")?.value??"GMT",s=/(?<sign>[+-])(?<hours>\d{1,2})(?::(?<minutes>\d{2}))?/u.exec(a);if(!s)return 0;let i=s.groups?.sign==="-"?-1:1,l=Number(s.groups?.hours??0),c=Number(s.groups?.minutes??0);return i*(l*60+c)},Vd=(t)=>{let r=ks(t),o=r>=0?"+":"-",a=Math.abs(r),s=String(Math.floor(a/60)).padStart(2,"0"),i=String(a%60).padStart(2,"0");return`${o}${s}:${i}`},no=null,ea=()=>{if(no)return no;let t="supportedValuesOf"in Intl?Intl.supportedValuesOf("timeZone"):["UTC"];return no=Mr(["UTC",...t].map((r)=>({label:`${r} (UTC${Vd(r)})`,offset:ks(r),value:r})),(r,o)=>r.offset-o.offset||r.value.localeCompare(o.value)).map(({value:r,label:o})=>({label:o,value:r})),no};import{jsx as Bd}from"react/jsx-runtime";var oo=({value:t,onChange:r,className:o,width:a="100%",disabled:s,placeholder:i="Select timezone"})=>{let l=Ls.useMemo(()=>ea(),[]);return Bd(pt,{options:l,value:t,onChange:(c)=>{r(c||"UTC")},placeholder:i,searchPlaceholder:"Search timezone...",emptyMessage:"No timezone found.",className:e("bg-transparent font-normal",o),width:a,disabled:s})};import{jsx as le,jsxs as De,Fragment as Gd}from"react/jsx-runtime";var Ms=[{label:"X minutes",value:"minutes"},{label:"X hours",value:"hours"},{label:"Day",value:"day"},{label:"X days",value:"days"},{label:"Week",value:"week"},{label:"X weeks",value:"weeks"},{label:"Month",value:"month"}],Fd=[{label:"Monday",short:"Mon",value:1},{label:"Tuesday",short:"Tue",value:2},{label:"Wednesday",short:"Wed",value:3},{label:"Thursday",short:"Thu",value:4},{label:"Friday",short:"Fri",value:5},{label:"Saturday",short:"Sat",value:6},{label:"Sunday",short:"Sun",value:0}],_d=(t)=>Ms.some((r)=>r.value===t),Ds=(t)=>{let r=t.trim();if(!r)return{custom:Ir(Ft),simple:Ft,view:"simple"};let o=En(r);if(o)return{custom:r,simple:o,view:"simple"};return{custom:r,simple:Ft,view:"advanced"}},zd=(t,r)=>{let o=r===1;switch(t.value){case"minutes":return o?"minute":"minutes";case"hours":return o?"hour":"hours";case"day":return"day";case"days":return o?"day":"days";case"week":return"week";case"weeks":return o?"week":"weeks";case"month":return"month";default:throw Error("Unsupported cron mode")}},ao=(t,r,o)=>Math.max(r,Math.min(o,t)),Es=(t)=>String(t).padStart(2,"0"),$d=({hour:t,minute:r,onChange:o})=>De("div",{className:"flex items-center gap-1",children:[le(h,{type:"number",min:0,max:23,value:Es(t),onChange:(a)=>{o(ao(Number(a.target.value)||0,0,23),r)},className:"w-16 text-center font-mono"}),le("span",{className:"text-muted-foreground",children:":"}),le(h,{type:"number",min:0,max:59,value:Es(r),onChange:(a)=>{o(t,ao(Number(a.target.value)||0,0,59))},className:"w-16 text-center font-mono"})]}),Jd=({state:t,onChange:r,timezone:o,onTimezoneChange:a})=>{let s=t.mode==="minutes"||t.mode==="hours"||t.mode==="days"||t.mode==="weeks",i=t.mode!=="minutes"&&t.mode!=="hours",l=t.mode==="hours",c=t.mode==="week",d=t.mode==="month";return De("div",{className:"space-y-3",children:[le("div",{className:"grid gap-2 sm:grid-cols-[minmax(0,1fr)_auto] sm:items-end",children:De("div",{className:"space-y-2",children:[le("span",{className:"text-xs font-medium text-muted-foreground",children:"Every"}),De("div",{className:e("grid gap-2",s?"grid-cols-[88px_minmax(0,1fr)]":"grid-cols-1"),children:[s&&le(h,{type:"number",min:1,value:t.interval,onChange:(u)=>{r({interval:Math.max(1,Number(u.target.value)||1)})},className:"font-mono"}),De(At,{value:t.mode,onValueChange:(u)=>{if(_d(u))r({mode:u})},children:[le(Nt,{className:"flex-1",children:le(Dt,{})}),le(Ot,{children:Ms.map((u)=>le(_t,{value:u.value,children:zd(u,t.interval)},u.value))})]})]})]})}),c&&De("div",{className:"space-y-2",children:[le("span",{className:"text-xs font-medium text-muted-foreground",children:"On"}),le(Ht,{type:"multiple",variant:"outline",size:"sm",value:t.weekdays.map(String),onValueChange:(u)=>{r({weekdays:u.length?Mr(u.map(Number),(g,b)=>g-b):[1]})},className:"w-full",children:Fd.map((u)=>le(Gt,{value:String(u.value),"aria-label":u.label,className:"text-xs",children:u.short},u.value))})]}),d&&De("div",{className:"space-y-2",children:[le("span",{className:"text-xs font-medium text-muted-foreground",children:"On day"}),le(h,{type:"number",min:1,max:31,value:t.monthday,onChange:(u)=>{r({monthday:ao(Number(u.target.value)||1,1,31)})},className:"w-24"})]}),(i||o!==void 0&&a)&&De("div",{className:e("grid gap-3",i&&o!==void 0&&a?"lg:grid-cols-[auto_minmax(0,1fr)] lg:items-end":"grid-cols-1"),children:[i&&De("div",{className:"space-y-2",children:[le("span",{className:"text-xs font-medium text-muted-foreground",children:"At"}),le($d,{hour:t.hour,minute:t.minute,onChange:(u,g)=>{r({hour:u,minute:g})}})]}),o!==void 0&&a&&De("div",{className:"space-y-2",children:[le("span",{className:"text-xs font-medium text-muted-foreground",children:"Timezone"}),le(oo,{value:o,onChange:a})]})]}),l&&De("div",{className:"space-y-2",children:[le("span",{className:"text-xs font-medium text-muted-foreground",children:"At minute"}),le(h,{type:"number",min:0,max:59,value:t.minute,onChange:(u)=>{r({minute:ao(Number(u.target.value)||0,0,59)})},className:"w-24"})]})]})},jd=({value:t,onChange:r,className:o,showPreview:a=!0,timezone:s,onTimezoneChange:i})=>{let[l,c]=dn.useState(()=>Ds(t)),[d,u]=dn.useState(t),[g,b]=dn.useState(t);if(t!==d){if(u(t),t!==g)b(t),c(Ds(t))}let w=dn.useCallback((O)=>{let H=O.view==="simple"?Ir(O.simple):O.custom;b(H),r(H)},[r]),P=(O)=>{c((H)=>{let F={...H.simple,...O},X={...H,custom:Ir(F),simple:F};return w(X),X})},C=(O)=>{c((H)=>{let F={...H,custom:O};return w(F),F})},A=(O)=>{c((H)=>{if(O===H.view)return H;if(O==="advanced"){let V=Ir(H.simple),_={...H,custom:V,view:O};return w(_),_}let F=En(H.custom),X=F?{...H,simple:F,view:O}:{...H,view:O};return w(X),X})},j=Qo(l.custom),B=null;if(l.view==="simple")B=ro(Ir(l.simple));else if(j)B=ro(l.custom);return De("div",{className:e("space-y-4",o),children:[De(Bt,{value:l.view,onValueChange:(O)=>{if(O==="simple"||O==="advanced")A(O)},children:[De(Ut,{className:"grid w-full grid-cols-2 rounded-md bg-muted/70 p-1 sm:w-[320px]",children:[le(mt,{value:"simple",className:"text-xs",children:"Simple"}),le(mt,{value:"advanced",className:"text-xs",children:"Advanced"})]}),le(ht,{value:"simple",className:"space-y-3 pt-3",children:le(Jd,{state:l.simple,onChange:P,timezone:s,onTimezoneChange:i})}),De(ht,{value:"advanced",className:"space-y-2 pt-3",children:[le("span",{className:"text-xs font-medium text-muted-foreground",children:"Cron Expression"}),le(h,{value:l.custom,onChange:(O)=>{C(O.target.value)},placeholder:"0 9 * * 1-5",className:e("font-mono text-sm",!j&&l.custom.trim()&&"border-destructive focus-visible:ring-destructive/40"),spellCheck:!1}),le("p",{className:"text-[11px] text-muted-foreground",children:"Format: minute hour day-of-month month day-of-week"})]})]}),l.view==="advanced"&&s!==void 0&&i&&De("div",{className:"space-y-2",children:[le("span",{className:"text-xs font-medium text-muted-foreground",children:"Timezone"}),le(oo,{value:s,onChange:i})]}),a&&le("div",{className:"flex min-h-8 flex-wrap items-center gap-2 rounded-md bg-muted/35 px-3 py-2 text-xs",children:B===null?le("span",{className:"text-destructive",children:"Invalid cron expression"}):De(Gd,{children:[le("span",{className:"text-muted-foreground",children:B}),le(z,{variant:"secondary",className:"ml-auto font-mono text-[11px]",children:l.view==="simple"?Ir(l.simple):l.custom})]})})]})};import{jsx as ta}from"react/jsx-runtime";var Wd={both:"w-full h-full",horizontal:"w-full h-auto",none:"",vertical:"h-full w-auto"},Xd=({src:t,alt:r="",className:o="",width:a,height:s,fill:i="horizontal",style:l})=>{if(i==="both")return ta("div",{className:e("relative overflow-hidden rounded-lg shadow-md",o),style:{height:s,width:a,...l},children:ta("img",{src:t,alt:r,className:"object-cover w-full h-full absolute inset-0"})});return ta("img",{src:t,alt:r,width:a,height:s,className:e("object-cover rounded-lg shadow-md",Wd[i],o),style:{height:i==="vertical"?"100%":s,width:i==="horizontal"?"100%":a,...l}})},Ud=Xd;import{jsx as so,jsxs as Is}from"react/jsx-runtime";var Kd=({title:t,className:r,children:o,...a})=>Is("section",{"data-slot":"summary-list",className:e("space-y-2",r),...a,children:[t?so("h3",{className:"text-sm font-semibold tracking-tight",children:t}):null,so("dl",{className:"divide-y divide-border overflow-hidden rounded-lg border border-border bg-card",children:o})]}),Yd=({label:t,value:r,muted:o=!1,className:a,...s})=>Is("div",{"data-slot":"summary-item",className:e("grid gap-1 px-4 py-3 sm:grid-cols-[minmax(8rem,14rem)_1fr] sm:gap-4",a),...s,children:[so("dt",{className:"text-sm text-muted-foreground",children:t}),so("dd",{className:e("min-w-0 break-words text-sm",o?"text-muted-foreground":"font-medium text-foreground"),children:r})]});import*as ra from"react";import{jsx as zr,jsxs as As}from"react/jsx-runtime";var qd=({className:t,...r})=>zr(Pt,{"data-slot":"choice-card-group",className:e("grid gap-3",t),...r}),Zd=({title:t,description:r,media:o,footer:a,className:s,...i})=>{let l=ra.useId(),c=ra.useId(),d=Boolean(r);return As(Tt,{"data-slot":"choice-card","aria-labelledby":l,"aria-describedby":d?c:void 0,className:e("group/choice relative flex h-full min-w-0 flex-col items-start gap-4 rounded-lg border border-border bg-card p-5 text-left shadow-(--shadow-sm) outline-none transition-[border-color,background-color,box-shadow] dark:shadow-none","hover:border-foreground/25 focus-visible:ring-[3px] focus-visible:ring-ring/50","data-[state=checked]:border-primary data-[state=checked]:bg-primary/[0.04] data-[state=checked]:ring-1 data-[state=checked]:ring-primary/25","disabled:cursor-not-allowed disabled:bg-muted/30 disabled:opacity-65 disabled:hover:border-border",s),...i,children:[zr("span",{"aria-hidden":!0,className:"absolute top-4 right-4 flex size-5 items-center justify-center rounded-full border border-input bg-background text-primary-foreground transition-colors group-data-[state=checked]/choice:border-primary group-data-[state=checked]/choice:bg-primary",children:zr(kt,{children:zr(p,{className:"size-3",strokeWidth:3})})}),o,As("span",{className:"block min-w-0 space-y-1 pr-7",children:[zr("span",{id:l,className:"block font-semibold tracking-tight",children:t}),d?zr("span",{id:c,className:"block text-sm leading-relaxed text-muted-foreground",children:r}):null]}),a?zr("span",{className:"mt-auto block w-full",children:a}):null]})};import*as Ar from"react";import{jsx as Or,jsxs as Os}from"react/jsx-runtime";var Hs=Ar.forwardRef(function({className:r,...o},a){return Or("div",{ref:a,className:e("grid gap-2",r),...o})}),Vs=({className:t,...r})=>Or(Et,{className:e("grid gap-2",t),...r}),na=(t)=>t!==void 0&&t!==null&&t!==!1&&t!==0&&t!==""&&!Number.isNaN(t),io=Ar.forwardRef(function({title:r,description:o,descriptionId:a,wrapDescription:s=!1,disabled:i=!1,control:l,className:c,children:d,...u},g){return Os("label",{ref:g,className:e("flex min-w-0 items-start gap-3 rounded-md border border-border p-3","has-[[data-state=checked]]:border-primary/50 has-[[data-state=checked]]:bg-primary/5",i?"cursor-not-allowed bg-muted/30 opacity-65":"cursor-pointer hover:bg-muted/50",c),...u,children:[l,Os("span",{className:"min-w-0 flex-1",children:[Or("span",{className:"block truncate text-sm font-medium",children:r}),na(o)?Or("span",{id:a,className:e("mt-1 block text-xs text-muted-foreground",!s&&"truncate"),children:o}):null,d]})]})}),Bs=(t)=>Object.prototype.toString.call(t)==="[object String]",Fs=(t,r)=>t!==null&&r instanceof Node&&(t.contains(r)||r instanceof HTMLInputElement&&r.getAttribute("aria-hidden")==="true"),Qd=({value:t,title:r,description:o,radioLabel:a,disabled:s=!1,onClick:i,...l})=>{let c=Ar.useId(),d=Ar.useId(),u=a??(Bs(r)?r:void 0);return Or(io,{description:o,descriptionId:d,disabled:s,title:r,onClick:(g)=>{if(i?.(g),g.defaultPrevented||s)return;let b=document.querySelector(`#${c}`);if(Fs(b,g.target))return;g.preventDefault(),b?.click()},control:Or(Mt,{"aria-describedby":na(o)?d:void 0,"aria-label":u,className:"mt-1",disabled:s,id:c,value:t}),...l})},eu=({checked:t,title:r,description:o,checkboxLabel:a,disabled:s=!1,onClick:i,onCheckedChange:l,...c})=>{let d=Ar.useId(),u=Ar.useId(),g=a??(Bs(r)?r:void 0);return Or(io,{description:o,descriptionId:u,disabled:s,title:r,onClick:(b)=>{if(i?.(b),b.defaultPrevented||s)return;if(Fs(document.querySelector(`#${d}`),b.target))return;b.preventDefault(),l(!t)},control:Or(Xe,{"aria-describedby":na(o)?u:void 0,"aria-label":g,checked:t,className:"mt-0.5",disabled:s,id:d,onCheckedChange:(b)=>{if(!s)l(b===!0)}}),...c})};Hs.displayName="CardOptionsBlock";Vs.displayName="RadioCardOptionsBlock";io.displayName="CardOption";import*as _s from"react";import{jsx as Mn,jsxs as oa}from"react/jsx-runtime";var tu=({title:t,description:r,command:o,copyLabel:a=t??o,copyErrorMessage:s,className:i,...l},c)=>oa("div",{ref:c,className:e("space-y-2",i),...l,children:[t===void 0&&r===void 0?null:oa("div",{children:[t===void 0?null:Mn("p",{className:"text-sm font-medium",children:t}),r===void 0?null:Mn("p",{className:"text-sm text-muted-foreground",children:r})]}),oa("div",{className:"flex items-start gap-2",children:[Mn("pre",{className:"flex-1 overflow-x-auto rounded-md border bg-muted px-3 py-2 font-mono text-xs",children:Mn("code",{children:o})}),Mn(Yn,{value:o,label:a,errorMessage:s})]})]}),zs=_s.forwardRef(tu);zs.displayName="CommandStep";var ru=zs;import{forwardRef as nu,useId as ou}from"react";import{jsx as In,jsxs as $s}from"react/jsx-runtime";var Js=nu(function({currency:r,label:o="Amount",hint:a,hideLabel:s=!1,hideHint:i=!1,error:l,className:c,wrapperClassName:d,id:u,decimals:g=2,step:b,placeholder:w,...P},C){let A=ou(),j=u??A,B=`Enter amount in ${r}`,O=b??1/10**g,H=w??(g>0?`0.${"0".repeat(g)}`:"0"),F=l!==null&&l!==void 0&&l.length>0;return $s("div",{className:e("w-full space-y-2",d),children:[!s&&In(y,{htmlFor:j,children:o}),$s("div",{className:"relative",children:[In("span",{className:"-translate-y-1/2 absolute top-1/2 left-3 text-sm text-muted-foreground",children:r}),In(h,{ref:C,className:e("bg-background pl-12",F&&"border-destructive",c),id:j,min:"0",placeholder:H,step:O,type:"number",...P})]}),F?In("p",{className:"text-xs text-destructive",children:l}):!i&&In("p",{className:"text-xs text-muted-foreground",children:a??B})]})});Js.displayName="CurrencyInput";var au=Js;import*as js from"react";import{jsx as lo,jsxs as aa}from"react/jsx-runtime";var Gs=js.forwardRef(function({index:r,label:o,hint:a,className:s,children:i,...l},c){let d=Boolean(r),u=Boolean(a);return aa("div",{ref:c,className:e("grid gap-x-4",d?"grid-cols-[2.25rem_1fr] sm:grid-cols-[2.5rem_1fr]":"grid-cols-1",s),...l,children:[d?lo("div",{className:"flex h-6 items-center justify-end pt-[2px]",children:lo(sn,{children:r})}):null,aa("div",{className:"min-w-0 space-y-1.5",children:[aa("div",{className:"flex items-baseline justify-between gap-2",children:[lo(an,{children:o}),u?lo("span",{className:"text-[10px] text-muted-foreground",children:a}):null]}),i]})]})});Gs.displayName="FieldRow";var su=Gs;import{jsx as ge,jsxs as Wt,Fragment as mu}from"react/jsx-runtime";var iu=(t)=>{if(t===0)return"0 Bytes";let r=1024,o=["Bytes","KB","MB","GB"],a=Math.floor(Math.log(t)/Math.log(r));return`${Math.round(t/r**a*100)/100} ${o[a]}`},lu={downloadFile:"Download file",downloadingFile:"Downloading file",dragActive:"Drop the file here",dragInactive:"Drag & drop a file here, or click to select",errorRetry:"Please try again",fileTypeHint:"PDF, DOC, DOCX up to 10MB"},cu=({active:t,activeLabel:r,inactiveLabel:o,hint:a})=>Wt("div",{className:"flex w-full items-center gap-3",children:[ge("div",{className:e("flex h-10 w-10 shrink-0 items-center justify-center rounded-full transition-colors",t?"bg-[color-mix(in_oklab,var(--primary)_14%,var(--card))]":"bg-muted"),children:ge(wr,{className:e("h-5 w-5",t?"text-primary":"text-muted-foreground")})}),Wt("div",{children:[ge("p",{className:"text-sm font-medium text-foreground",children:t?r:o}),ge("p",{className:"text-xs text-muted-foreground",children:a})]})]}),du=({message:t,retryLabel:r})=>Wt("div",{className:"flex w-full items-center gap-3",children:[ge("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-destructive/10",children:ge(x,{className:"h-5 w-5 text-destructive"})}),Wt("div",{children:[ge("p",{className:"text-sm font-medium text-destructive",children:t}),ge("p",{className:"text-xs text-destructive/80",children:r})]})]}),uu=({file:t,downloading:r,downloadLabel:o,downloadingLabel:a,onDownload:s,onRemove:i})=>Wt("div",{className:"flex w-full items-center justify-between",children:[Wt("div",{className:"flex items-center gap-3",children:[t.previewUrl!==void 0&&t.previewUrl!==null&&t.previewUrl!==""?Wt(mu,{children:[ge("span",{"aria-hidden":"true",className:"h-20 w-28 shrink-0 rounded-md border border-input bg-background bg-contain bg-center bg-no-repeat",style:{backgroundImage:`url(${t.previewUrl})`}}),ge("span",{className:"sr-only",children:t.name})]}):ge("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-[color-mix(in_oklab,var(--success)_14%,var(--card))]",children:ge(mr,{className:"h-5 w-5 text-(--success)"})}),Wt("div",{className:"flex flex-col",children:[Wt("div",{className:"flex items-center gap-2",children:[ge(vr,{className:"h-4 w-4 text-muted-foreground"}),ge("span",{className:"text-sm font-medium text-foreground",children:t.name})]}),ge("span",{className:"text-xs text-muted-foreground",children:iu(t.size)})]})]}),Wt("div",{className:"flex shrink-0 items-center gap-1",children:[s?ge(n,{"aria-label":r?a:o,className:"h-8 w-8 rounded-full p-0",disabled:r,onClick:s,size:"sm",title:r?a:o,type:"button",variant:"ghost",children:r?ge(T,{className:"h-4 w-4 animate-spin"}):ge(gr,{className:"h-4 w-4"})}):null,i?ge(n,{className:"h-8 w-8 rounded-full p-0 hover:bg-destructive/10",onClick:i,size:"sm",type:"button",variant:"ghost",children:ge(x,{className:"h-4 w-4 text-destructive"})}):null]})]}),pu=(t)=>{let{rootProps:r,inputProps:o,isDragActive:a,selectedFile:s,error:i,onRemoveFile:l,onDownloadFile:c,isDownloadingFile:d,disabled:u,className:g,labels:b}=t,w={...lu,...b},P=s!==void 0&&s!==null,C=i!==void 0&&i!==null&&i!=="";return ge("div",{className:e("w-full",g),children:Wt("div",{...r,className:e("relative flex min-h-24 cursor-pointer items-center justify-center rounded-lg border-2 border-dashed bg-transparent px-4 py-5 transition-all",a===!0?"border-primary bg-[color-mix(in_oklab,var(--primary)_8%,var(--card))]":"border-input hover:border-input",P&&"border-[color-mix(in_oklab,var(--success)_60%,var(--border))] bg-[color-mix(in_oklab,var(--success)_10%,transparent)]",C&&"border-destructive bg-[color-mix(in_oklab,var(--destructive)_10%,var(--card))]",u===!0&&"cursor-not-allowed opacity-60",r?.className),children:[ge("input",{...o}),!P&&!C?ge(cu,{active:Boolean(a),activeLabel:w.dragActive,hint:w.fileTypeHint,inactiveLabel:w.dragInactive}):null,s!==void 0&&s!==null&&!C?ge(uu,{downloadLabel:w.downloadFile,downloading:Boolean(d),downloadingLabel:w.downloadingFile,file:s,onDownload:c,onRemove:l}):null,i!==void 0&&i!==null&&i!==""?ge(du,{message:i,retryLabel:w.errorRetry}):null]})})},fu=pu;import{jsx as Ws,jsxs as bu}from"react/jsx-runtime";var gu=f("inline-flex shrink-0 cursor-pointer items-center gap-1.5 rounded-full border font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",{defaultVariants:{active:!1,size:"md"},variants:{active:{false:"border-(--border-subtle) bg-(--bg-surface)/60 text-(--text-secondary) hover:border-(--border-default) hover:text-(--text-primary)",true:"border-[color-mix(in_oklab,var(--accent)_35%,var(--border))] bg-(--bg-accent-soft) text-(--text-primary)"},size:{md:"h-8 px-3.5 text-[13px]",sm:"h-7 px-3 text-[12px]"}}}),Xs=({options:t,value:r,onValueChange:o,label:a,size:s,className:i,classes:l,...c})=>Ws("div",{"aria-label":a,className:e("flex flex-wrap items-center gap-1.5",l?.root,i),...c,children:t.map((d)=>{let u=d.value===r;return bu("button",{type:"button","aria-pressed":u,disabled:d.disabled,onClick:()=>{o(d.value)},className:e(gu({active:u,size:s}),l?.chip),children:[d.label,d.count===void 0?null:Ws("span",{className:e("tabular-nums text-[11px] text-(--text-muted)",l?.count),children:d.count})]},d.value)})});Xs.displayName="FilterChips";var vu=Xs;import*as un from"react";import{jsx as dr,jsxs as Su}from"react/jsx-runtime";var hu=52,xu=26,uo=4,co=20,yu=(t)=>({"--flow-lane":t}),Ks=un.createContext(null),Ys=(t)=>{let r=un.useContext(Ks);if(!r)throw Error(`${t} must be rendered inside a FlowBand.`);return r},wu=({lanes:t=1,stepHeight:r=hu,laneHeight:o=xu,className:a,style:s,children:i,...l})=>{let c=Math.max(r,t*o+(t-1)*uo),d=un.useMemo(()=>({height:c,stepHeight:r}),[c,r]);return dr(Ks.Provider,{value:d,children:dr("div",{className:e("flex min-w-0 items-stretch gap-1",a),style:{height:c,...s},...l,children:i})})},Nu=({className:t,style:r,children:o,...a})=>{let{stepHeight:s}=Ys("FlowStep");return dr("div",{className:e("flex min-w-0 flex-1 items-stretch self-center",t),style:{height:s,...r},...a,children:o})},Us=({centers:t,height:r,colors:o,merge:a=!1})=>{let s=r/2,i=7;return dr("svg",{"aria-hidden":!0,width:co,height:r,viewBox:`0 0 ${co} ${r}`,className:"shrink-0",style:a?{transform:"scaleX(-1)"}:void 0,children:t.map((l,c)=>{let d=o[c];return dr("path",{style:yu(d),d:`M0 ${s}H7C13 ${s} ${co-6} ${l} ${co} ${l}`,fill:"none",strokeWidth:1.5,strokeLinecap:"round",className:d!==void 0&&d!==""?"stroke-[color-mix(in_oklab,var(--flow-lane)_45%,var(--border))]":"stroke-border"},c)})})},Ru=(t,r)=>{let o=(r-uo*(t-1))/t;return Array.from({length:t},(a,s)=>s*(o+uo)+o/2)},Cu=({lanes:t,fork:r=!0,rejoin:o=!0,label:a,className:s,...i})=>{let{height:l}=Ys("FlowBranch"),c=Ru(t.length,l),d=t.map((u)=>u.color);return Su("div",{"aria-label":a,className:e("flex min-w-0 flex-1 items-stretch",s),...i,children:[r&&dr(Us,{centers:c,height:l,colors:d}),dr("div",{className:"flex min-w-0 flex-1 flex-col",style:{gap:uo},children:t.map((u)=>dr("div",{className:"flex min-w-0 flex-1 items-stretch overflow-hidden",children:u.content},u.key))}),o&&dr(Us,{centers:c,height:l,colors:d,merge:!0})]})};import*as qs from"react";import{jsx as sa,jsxs as Tu}from"react/jsx-runtime";var Pu=({index:t,className:r,children:o,...a},s)=>Tu("div",{ref:s,className:e("grid grid-cols-[1.75rem_1fr] gap-x-3 leading-relaxed",r),...a,children:[sa("div",{className:"pt-[1px] text-right",children:sa(sn,{className:"opacity-80",children:t})}),sa("p",{className:"text-[13px] text-muted-foreground",children:o})]}),Zs=qs.forwardRef(Pu);Zs.displayName="GuideStep";var ku=Zs;import*as mn from"react";import{jsx as Ue,jsxs as pn,Fragment as Du}from"react/jsx-runtime";var Qs=mn.forwardRef(function({className:r,variant:o="island",...a},s){return Ue(ie,{ref:s,variant:o,className:e("gap-0 p-0",r),...a})});Qs.displayName="HierarchyTree";var ei=mn.forwardRef(function({title:r,icon:o,count:a,actions:s,className:i,...l},c){return pn("div",{ref:c,"data-slot":"hierarchy-tree-header",className:e("flex flex-wrap items-center gap-3 border-b border-border px-4 py-3",i),...l,children:[pn("div",{className:"flex min-w-0 items-center gap-2 text-sm font-medium",children:[o!==void 0&&o!==null?Ue("span",{className:"shrink-0 text-muted-foreground [&_svg]:h-4 [&_svg]:w-4",children:o}):null,Ue("span",{className:"min-w-0 truncate",children:r}),a!==void 0&&a!==null?Ue("span",{className:"rounded-full bg-muted px-2 py-0.5 text-xs font-normal text-muted-foreground",children:a}):null]}),s!==void 0&&s!==null?Ue("div",{className:"ml-auto flex flex-wrap items-center gap-2",children:s}):null]})});ei.displayName="HierarchyTreeHeader";var ti=mn.forwardRef(function({className:r,...o},a){return Ue("div",{ref:a,"data-slot":"hierarchy-tree-body",className:e("min-w-0",r),...o})});ti.displayName="HierarchyTreeBody";var Lu=[],ri=mn.forwardRef(function({depth:r,rails:o=Lu,isLastChild:a=!1,hasChildren:s=!1,contentClassName:i,className:l,children:c,...d},u){let g=Math.max(1,r);return pn("div",{ref:u,"data-slot":"hierarchy-tree-row","data-depth":g,className:e("group flex items-stretch transition-colors hover:bg-muted/40",g===1&&"border-t border-border first:border-t-0",l),...d,children:[g>1?pn("div",{"aria-hidden":!0,className:"flex shrink-0 pl-5",children:[o.map((b,w)=>Ue("span",{className:"relative w-5",children:b?Ue("span",{className:"absolute inset-y-0 left-0 border-l border-(--border-subtle)"}):null},w)),Ue("span",{className:"relative w-5",children:a?Ue("span",{className:e("absolute left-0 top-0 h-[22px] rounded-bl-md border-b border-l border-(--border-subtle)",s?"w-full":"w-14")}):pn(Du,{children:[Ue("span",{className:"absolute inset-y-0 left-0 border-l border-(--border-subtle)"}),Ue("span",{className:e("absolute left-0 top-[22px] border-t border-(--border-subtle)",s?"w-full":"w-14")})]})})]}):null,Ue("div",{className:e("flex min-w-0 flex-1 items-start gap-2 py-3 pl-2 pr-3",i),children:c})]})});ri.displayName="HierarchyTreeRow";var ni=mn.forwardRef(function({expanded:r,count:o,visible:a=!0,className:s,...i},l){return pn(n,{ref:l,type:"button",variant:"ghost",size:"sm",className:e("h-6 shrink-0 gap-0.5 px-1 text-xs text-muted-foreground",!a&&"invisible",s),...i,children:[Ue(m,{className:e("h-3.5 w-3.5 transition-transform",r&&"rotate-90")}),o]})});ni.displayName="HierarchyTreeToggle";var Eu=Qs;import Mu,{useState as Iu}from"react";import{jsx as Pe,jsxs as Rt}from"react/jsx-runtime";var Au=f("font-mono text-sm rounded-md overflow-hidden flex flex-col",{defaultVariants:{size:"md",variant:"default"},variants:{size:{lg:"p-4 text-base",md:"p-3",sm:"p-2 text-xs"},variant:{default:"bg-card border border-border",filled:"bg-muted",outlined:"border border-border"}}}),ia=({value:t,ancestors:r})=>{if(t===null||t===void 0)return t;if(t===!0||t===!1)return t;let o=Object.prototype.toString.call(t);if(o==="[object String]"){let a=JSON.stringify(t);return a===void 0?o:a.slice(1,-1)}if(o==="[object Number]")return Number(t);if(Array.isArray(t)){if(r.has(t))return"[Circular]";r.add(t);let a=t.map((s)=>ia({ancestors:r,value:s}));return r.delete(t),a}if(t instanceof Object){if(r.has(t))return"[Circular]";r.add(t);let a=Object.fromEntries(Object.entries(t).map(([s,i])=>[s,ia({ancestors:r,value:i})]));return r.delete(t),a}return o},Ou=(t)=>{if(t===null||t===void 0)return"text-gray-500 dark:text-gray-400";if(String(t)===t)return"text-green-600 dark:text-green-400";if(t===!0||t===!1)return"text-amber-600 dark:text-amber-400";return"text-blue-600 dark:text-blue-400"},Hu=(t)=>{if(t===null)return"null";if(t===void 0)return"undefined";if(String(t)===t)return`"${t}"`;return String(t)},Vu=(t)=>t,Bu=(t)=>t!==null&&Object(t)===t,Fu=(t,r)=>{if(t)return Pe("span",{className:"w-4"});return r?Pe(v,{className:"w-4 h-4"}):Pe(m,{className:"w-4 h-4"})},_u=(t)=>t?{close:"]",open:"["}:{close:"}",open:"{"},zu=(t,r,o)=>t?{name:null,path:`${o}[${r}]`}:{name:String(r),path:`${o}.${r}`},$u=({data:t,className:r,classes:o,variant:a,size:s,expandAll:i=!1,expandRoot:l=!0,indentSize:c=16,showLineNumbers:d=!1,showToolbar:u=!1,maxHeight:g,maxWidth:b,renderValue:w})=>{let P=Mu.useMemo(()=>ia({ancestors:new WeakSet,value:t}),[t]),[C,A]=Iu(()=>{let _={};if(l)_.root=!0;return _}),j=(_,W)=>{if(_==="root"&&C[_]===void 0)return l;return C[_]??W},B=(_)=>{A((W)=>({...W,[_]:!j(_,i)}))},O=(_)=>{A({})},H=()=>{try{let _=JSON.stringify(P,null,2);navigator.clipboard.writeText(_),D.success("Copied to clipboard",{description:"JSON data has been copied to clipboard",duration:3000})}catch(_){console.error("Failed to copy JSON to clipboard",_),D.error("Copy failed",{description:"Failed to copy JSON to clipboard",duration:3000})}},F={maxWidth:b??"auto"},X=(_,W,oe,K,de)=>{let ye=[],ve=Bu(W),Re=Array.isArray(W),Me=ve&&Object.keys(W).length===0,Ae=_u(Re),be={marginLeft:oe*c},qe=Vu(K),he=de;if(!ve){let ce=w?.(W,K);return ye.push(Rt("div",{className:"flex",children:[d&&Pe("div",{className:"text-gray-400 dark:text-gray-600 select-none w-8 text-right pr-2",children:he}),Rt("div",{className:"flex min-w-0",style:be,children:[Pe("span",{"aria-hidden":!0,className:"mr-1 w-4 shrink-0"}),_!==null&&Rt("span",{className:"shrink-0 text-purple-600 dark:text-purple-400",children:[`"${_}":`,Pe("span",{className:"text-gray-600 dark:text-gray-400 mr-1",children:" "})]}),ce??Pe("span",{className:e("min-w-0 break-all",Ou(W)),children:Hu(W)})]})]},qe)),[ye,he+1]}let _e=j(K,i),q=Fu(Me,_e);if(ye.push(Rt("div",{className:"flex items-start group",children:[d&&Pe("div",{className:"text-gray-400 dark:text-gray-600 select-none w-8 text-right pr-2",children:he}),Rt("div",{className:"flex items-start",style:be,children:[Pe("button",{onClick:()=>{B(K)},className:"mr-1 w-4 h-4 mt-0.5 focus:outline-none opacity-60 hover:opacity-100","aria-label":_e?"Collapse":"Expand",tabIndex:0,type:"button",children:q}),Rt("div",{children:[_!==null&&Rt("span",{className:"text-purple-600 dark:text-purple-400",children:[`"${_}":`,Pe("span",{className:"text-gray-600 dark:text-gray-400 mr-1",children:" "})]}),Pe("span",{className:"text-gray-600 dark:text-gray-400",children:Ae.open}),Me||!_e?Rt("span",{className:"text-gray-600 dark:text-gray-400",children:[Me?"":"...",Ae.close]}):null]})]})]},`${qe}-open`)),he+=1,_e&&!Me){let ce=he,ae=Re?W.map((Ce,st)=>[st,Ce]):Object.entries(W);for(let[Ce,st]of ae){let Se=zu(Re,Ce,K),[Rr,Y]=X(Se.name,st,oe+1,Se.path,ce);ye.push(...Rr),ce=Y}return ye.push(Rt("div",{className:"flex",children:[d&&Pe("div",{className:"text-gray-400 dark:text-gray-600 select-none w-8 text-right pr-2",children:ce}),Pe("div",{className:"text-gray-600 dark:text-gray-400",style:be,children:Ae.close})]},`${qe}-close`)),ce+=1,[ye,ce]}return[ye,he]},[V]=X(null,P,0,"root",1);return Rt("div",{className:e(Au({size:s,variant:a}),o?.root,r),style:F,children:[u&&Rt("div",{className:e("flex justify-between items-center px-3 py-2 border-b border-border bg-muted/50",o?.toolbar),children:[Pe("div",{className:"text-sm font-medium",children:"JSON Viewer"}),Rt("div",{className:"flex gap-2",children:[Pe(n,{size:"sm",variant:"outline",onClick:()=>{O(!0)},children:"Expand All"}),Pe(n,{size:"sm",variant:"outline",onClick:()=>{O(!1)},children:"Collapse All"}),Rt(n,{size:"sm",variant:"outline",onClick:H,children:[Pe(ne,{className:"w-4 h-4 mr-1"}),"Copy"]})]})]}),Pe("div",{className:e("overflow-auto flex-1",o?.content),style:{maxHeight:g??void 0},children:V})]})},la=$u;import{useId as Ju,useState as ju}from"react";import Gu from"react-markdown";import{jsx as ur,jsxs as ca,Fragment as Xu}from"react/jsx-runtime";var oi=({mode:t,onModeChange:r,labels:o,disabled:a=!1,className:s})=>{let i=t==="write"?"preview":"write",l=i==="write"?o.write:o.preview,c=i==="write"?o.writeTitle??o.write:o.previewTitle??o.preview;return ur(n,{type:"button",variant:"ghost",size:"icon",className:e("size-7",s),disabled:a,"aria-label":l,title:c,onClick:()=>{r(i)},children:i==="preview"?ur(pe,{className:"size-3.5 text-muted-foreground"}):ur(hr,{className:"size-3.5 text-muted-foreground"})})},Wu=({label:t,value:r,onValueChange:o,emptyPreview:a,toggleLabels:s,mode:i,defaultMode:l="write",onModeChange:c,previewValue:d=r,disabled:u=!1,placeholder:g,editorId:b,showHeader:w=!0,footer:P,className:C,editorClassName:A,previewClassName:j,textareaProps:B})=>{let O=Ju(),H=b??O,[F,X]=ju(l),V=i??F,_=(W)=>{if(i===void 0)X(W);c?.(W)};return ca("div",{className:e("grid gap-2",C),children:[w&&ca("div",{className:"flex items-center justify-between gap-3",children:[ur(y,{htmlFor:V==="write"?H:void 0,children:t}),ur(oi,{mode:V,onModeChange:_,labels:s,disabled:u})]}),V==="write"?ca(Xu,{children:[ur(Je,{...B,id:H,value:r,disabled:u,placeholder:g,"aria-label":w?B?.["aria-label"]:B?.["aria-label"]??t,className:e("min-h-48 resize-y font-mono text-sm",A),onChange:(W)=>{o(W.target.value)}}),P]}):ur("div",{"aria-label":`${t} ${s.preview}`,className:e("prose prose-sm max-w-none rounded-lg border bg-muted/30 p-4 dark:prose-invert [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",j),children:d.trim()?ur(Gu,{children:d}):ur("div",{className:"not-prose text-muted-foreground",children:a})})]})};import{jsx as po,jsxs as Ku}from"react/jsx-runtime";var Uu=({open:t,onOpenChange:r,title:o="JSON Viewer",data:a,jsonViewerProps:s})=>po(k,{open:t,onOpenChange:r,children:Ku(E,{className:"max-w-2xl max-h-[80vh] flex flex-col",children:[po(G,{children:po(M,{children:o})}),po(la,{data:a,className:"min-h-0 flex-1",variant:"filled",size:"sm",showToolbar:!0,expandAll:!1,expandRoot:!0,...s})]})});import*as si from"react";import{jsx as ai,jsxs as da}from"react/jsx-runtime";var ii=si.forwardRef(function({id:r,label:o,optionalLabel:a,help:s,error:i,className:l,children:c,...d},u){return da("div",{ref:u,className:e("grid content-start gap-2",l),...d,children:[da(y,{htmlFor:r,children:[o,a===void 0?null:da("span",{className:"font-normal text-muted-foreground",children:["(",a,")"]})]}),c,i===void 0?null:ai("p",{role:"alert",className:"text-sm text-destructive",children:i}),i===void 0&&s!==void 0&&s!==""?ai("p",{className:"text-xs leading-relaxed text-muted-foreground",children:s}):null]})});ii.displayName="LabeledField";var Yu=ii;import{jsx as li,jsxs as ci}from"react/jsx-runtime";var qu=({href:t,children:r,className:o,external:a=!1,linkComponent:s})=>{let i=e("inline-flex items-center gap-1 text-primary hover:underline",o);if(a||!s)return ci("a",{href:t,...a?{rel:"noopener noreferrer",target:"_blank"}:{},className:i,children:[r,li(zt,{className:"h-3 w-3"})]});return ci(s,{to:t,className:i,children:[r,li(zt,{className:"h-3 w-3"})]})};import{useState as Zu}from"react";import{jsx as mo,jsxs as ep}from"react/jsx-runtime";var Qu=({value:t,isSensitive:r=!1,className:o,maskChar:a="•",showToggle:s=!0,showLabel:i="Show value",hideLabel:l="Hide value",truncate:c=!0,children:d})=>{let[u,g]=Zu(!r),w=u?t:(()=>{if(t.startsWith("{")||t.startsWith("["))return`{ ${a.repeat(10)} }`;return a.repeat(Math.min(t.length,20))})(),P=c?w.slice(0,50)+(w.length>50?"...":""):w,C=u?l:i,A=r&&s?mo(n,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6",onClick:()=>{g(!u)},title:C,"aria-label":C,children:u?mo(He,{className:"h-3 w-3"}):mo(pe,{className:"h-3 w-3"})}):null;if(d!==void 0)return d({displayValue:P,toggle:A});return ep("div",{className:e("flex items-center gap-2",o),children:[mo("code",{className:"text-sm bg-muted px-2 py-1 rounded flex-1 break-all",children:P}),A]})};import*as pi from"react";import{jsx as di,jsxs as ui}from"react/jsx-runtime";var mi=pi.forwardRef(function({icon:r,text:o,trailing:a,className:s,...i},l){return ui("div",{ref:l,className:e("flex min-w-0 items-center gap-2",s),...i,children:[ui("div",{className:"flex min-w-0 flex-1 items-center gap-2 border-b border-dashed border-border py-2 text-[13px] text-muted-foreground",children:[r!==null&&r!==void 0?di("span",{className:"text-primary/70",children:r}):null,di("span",{className:"min-w-0 truncate",children:o})]}),a]})});mi.displayName="MutedPlaceholder";var tp=mi;import{useMemo as rp,useState as np}from"react";import{jsx as Ct,jsxs as fo}from"react/jsx-runtime";var ua=({value:t,ancestors:r})=>{if(t===null||t===void 0)return t;if(t===!0||t===!1)return t;let o=Object.prototype.toString.call(t);if(o==="[object String]")return String.prototype.valueOf.call(t);if(o==="[object Number]")return Number(t);if(Array.isArray(t)){if(r.has(t))return;r.add(t);let a=t.map((s)=>ua({ancestors:r,value:s}));return r.delete(t),a}if(t instanceof Object){if(r.has(t))return;r.add(t);let a=Object.fromEntries(Object.entries(t).map(([s,i])=>[s,ua({ancestors:r,value:i})]));return r.delete(t),a}return},tr=(t)=>{if(t instanceof Object&&!Array.isArray(t))return t;return},Hr=(t)=>Array.isArray(t)?t:void 0,fi=(t)=>Object.prototype.toString.call(t)==="[object String]"&&t===String.prototype.valueOf.call(t),pa=(t)=>fi(t)?t:void 0,op=(t)=>Hr(t)?.filter(fi)??[],ap=(t)=>{let r=Hr(t.anyOf);if(!r)return t;let o=r.filter((a)=>tr(a)?.type!=="null");return o.length===1?tr(o[0])??t:t},gi=(t)=>{let r=pa(t.type);if(r!==void 0&&r!=="")return r;if(Hr(t.enum))return"enum";if(Hr(t.oneOf)||Hr(t.anyOf))return"variant";if(tr(t.properties))return"object";return"value"},bi=(t,r="schema")=>{let o=tr(t.properties);if(o){let s=new Set(op(t.required));return Object.entries(o).flatMap(([i,l])=>{let c=tr(l);return c?[{name:i,path:`${r}.properties.${i}`,required:s.has(i),schema:c}]:[]})}if(gi(t)==="array"){let s=tr(t.items);return s?[{name:"Items",path:`${r}.items`,required:!0,schema:s}]:[]}let a=Hr(t.oneOf)??Hr(t.anyOf)??Hr(t.allOf);if(!a)return[];return a.flatMap((s,i)=>{let l=tr(s);return l?[{name:`Option ${i+1}`,path:`${r}.option.${i}`,required:!0,schema:l}]:[]})},ma=(t,r,o=new Set)=>{let a=ap(t),s=pa(a.$ref);if(s===void 0||s===""||!s.startsWith("#/$defs/")||o.has(s))return a;let i=tr(tr(r.$defs)?.[s.slice(8)]);if(!i)return a;return ma(i,r,new Set([...o,s]))},vi=({child:t,depth:r,root:o,defaultExpandedDepth:a})=>{let s=ma(t.schema,o),i=bi(s,t.path),[l,c]=np(r<a),d=gi(s),u=pa(s.description),g=i.length>0,b=l?`Collapse ${t.name}`:`Expand ${t.name}`;return fo(J,{open:l,onOpenChange:c,children:[fo("div",{className:e("flex min-w-0 items-start border-b border-border/70 bg-background px-2.5 py-2 last:border-b-0",g&&"gap-2"),style:{paddingLeft:`${10+r*16}px`},children:[g?Ct(ee,{"aria-label":b,className:"mt-0.5 shrink-0 rounded-sm text-muted-foreground outline-none transition hover:text-foreground focus-visible:ring-2 focus-visible:ring-primary/40",children:Ct(m,{className:e("size-3.5 transition-transform",l&&"rotate-90")})}):null,fo("div",{className:"min-w-0 flex-1",children:[fo("div",{className:"flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1",children:[Ct("span",{className:"break-all text-xs font-medium text-foreground",children:t.name}),Ct("span",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:d}),t.required?Ct("span",{className:"text-[10px] font-medium text-destructive",children:"required"}):null]}),u!==void 0&&u!==""?Ct("p",{className:"mt-0.5 text-xs leading-snug text-muted-foreground",children:u}):null]})]}),g?Ct(te,{children:Ct("div",{className:"border-l border-border/70",children:i.map((w)=>Ct(vi,{child:w,defaultExpandedDepth:a,depth:r+1,root:o},w.path))})}):null]})},sp=({schema:t,className:r,defaultExpandedDepth:o=1,emptyLabel:a="No fields"})=>{let s=rp(()=>ua({ancestors:new WeakSet,value:t}),[t]),i=tr(s);if(!i)return Ct("p",{className:e("text-xs text-muted-foreground",r),children:a});let l=ma(i,i),c=bi(l);if(!c.length)return Ct("p",{className:e("text-xs text-muted-foreground",r),children:a});return Ct("div",{"aria-label":"Object schema",className:e("overflow-hidden rounded-lg border border-border",r),children:c.map((d)=>Ct(vi,{child:d,defaultExpandedDepth:o,depth:0,root:i},d.path))})};import rr,{createContext as Fn,useContext as yn,useEffect as xe,useState as Xt,useCallback as Kt,useMemo as Ne,useRef as Ee,memo as mp,useReducer as fp,cloneElement as lx,forwardRef as cx}from"react";import{createPortal as gp,unstable_batchedUpdates as wo}from"react-dom";import{useMemo as ga,useLayoutEffect as ip,useEffect as xi,useRef as fn,useCallback as go}from"react";function yi(){for(var t=arguments.length,r=Array(t),o=0;o<t;o++)r[o]=arguments[o];return ga(()=>(a)=>{r.forEach((s)=>s(a))},r)}var An=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function $r(t){let r=Object.prototype.toString.call(t);return r==="[object Window]"||r==="[object global]"}function bo(t){return"nodeType"in t}function ze(t){var r,o;if(!t)return window;if($r(t))return t;if(!bo(t))return window;return(r=(o=t.ownerDocument)==null?void 0:o.defaultView)!=null?r:window}function vo(t){let{Document:r}=ze(t);return t instanceof r}function gn(t){if($r(t))return!1;return t instanceof ze(t).HTMLElement}function ba(t){return t instanceof ze(t).SVGElement}function Jr(t){if(!t)return document;if($r(t))return t.document;if(!bo(t))return document;if(vo(t))return t;if(gn(t)||ba(t))return t.ownerDocument;return document}var $t=An?ip:xi;function ho(t){let r=fn(t);return $t(()=>{r.current=t}),go(function(){for(var o=arguments.length,a=Array(o),s=0;s<o;s++)a[s]=arguments[s];return r.current==null?void 0:r.current(...a)},[])}function wi(){let t=fn(null),r=go((a,s)=>{t.current=setInterval(a,s)},[]),o=go(()=>{if(t.current!==null)clearInterval(t.current),t.current=null},[]);return[r,o]}function bn(t,r){if(r===void 0)r=[t];let o=fn(t);return $t(()=>{if(o.current!==t)o.current=t},r),o}function vn(t,r){let o=fn();return ga(()=>{let a=t(o.current);return o.current=a,a},[...r])}function On(t){let r=ho(t),o=fn(null),a=go((s)=>{if(s!==o.current)r==null||r(s,o.current);o.current=s},[]);return[o,a]}function xo(t){let r=fn();return xi(()=>{r.current=t},[t]),r.current}var fa={};function jr(t,r){return ga(()=>{if(r)return r;let o=fa[t]==null?0:fa[t]+1;return fa[t]=o,t+"-"+o},[t,r])}function Ni(t){return function(r){for(var o=arguments.length,a=Array(o>1?o-1:0),s=1;s<o;s++)a[s-1]=arguments[s];return a.reduce((i,l)=>{let c=Object.entries(l);for(let[d,u]of c){let g=i[d];if(g!=null)i[d]=g+t*u}return i},{...r})}}var Gr=Ni(1),Wr=Ni(-1);function lp(t){return"clientX"in t&&"clientY"in t}function Hn(t){if(!t)return!1;let{KeyboardEvent:r}=ze(t.target);return r&&t instanceof r}function cp(t){if(!t)return!1;let{TouchEvent:r}=ze(t.target);return r&&t instanceof r}function yo(t){if(cp(t)){if(t.touches&&t.touches.length){let{clientX:r,clientY:o}=t.touches[0];return{x:r,y:o}}else if(t.changedTouches&&t.changedTouches.length){let{clientX:r,clientY:o}=t.changedTouches[0];return{x:r,y:o}}}if(lp(t))return{x:t.clientX,y:t.clientY};return null}var Vr=Object.freeze({Translate:{toString(t){if(!t)return;let{x:r,y:o}=t;return"translate3d("+(r?Math.round(r):0)+"px, "+(o?Math.round(o):0)+"px, 0)"}},Scale:{toString(t){if(!t)return;let{scaleX:r,scaleY:o}=t;return"scaleX("+r+") scaleY("+o+")"}},Transform:{toString(t){if(!t)return;return[Vr.Translate.toString(t),Vr.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:r,duration:o,easing:a}=t;return r+" "+o+"ms "+a}}}),hi="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Ri(t){if(t.matches(hi))return t;return t.querySelector(hi)}import Ci,{useState as dp,useCallback as up}from"react";var pp={display:"none"};function Si(t){let{id:r,value:o}=t;return Ci.createElement("div",{id:r,style:pp},o)}function Pi(t){let{id:r,announcement:o,ariaLiveType:a="assertive"}=t,s={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return Ci.createElement("div",{id:r,style:s,role:"status","aria-live":a,"aria-atomic":!0},o)}function Ti(){let[t,r]=dp("");return{announce:up((a)=>{if(a!=null)r(a)},[]),announcement:t}}var _i=Fn(null);function bp(t){let r=yn(_i);xe(()=>{if(!r)throw Error("useDndMonitor must be used within a children of <DndContext>");return r(t)},[t,r])}function vp(){let[t]=Xt(()=>new Set),r=Kt((a)=>(t.add(a),()=>t.delete(a)),[t]);return[Kt((a)=>{let{type:s,event:i}=a;t.forEach((l)=>{var c;return(c=l[s])==null?void 0:c.call(l,i)})},[t]),r]}var hp={draggable:`
2
+ import{Vo,St,Ve,Uo,Ho,zo,Go,$o,Gt,$t,Rt,Wo,qo,wt}from"../../index-064d20xp.js";import{i}from"../../index-dg126t3v.js";import{a}from"../../index-r2snvwyb.js";import"../../index-64r6cav3.js";import{N,O,V,sr,_,q,g,I}from"../../index-sd38wa4w.js";import{qt,jt,Kt,Ur,Ue,Yt,ue,He,Xt,Qe,Qt,Le,de,z,G,W,gr,Gr,$r,Wr,qr,jr,Kr,Tt,Zt,Jt,er,Xr,Qr,vr,xr,Jr,eo}from"../../index-vyhk8kgm.js";import{Vr,Pt,wn}from"../../index-fnk7gsdd.js";import"../../index-ngpxevag.js";import{ir,lr,cr}from"../../index-ggr2edm8.js";import{Qo}from"../../index-b1wfq5b8.js";import{T}from"../../index-r5ds1mtq.js";import{Te,Ee,ke}from"../../index-zrw7ne3f.js";import{Q,ro,oo,no,nr,ar}from"../../index-2twj52t7.js";import{br}from"../../index-9289ppfk.js";import{H,ve,Wt,It,Xe}from"../../index-2yf6mq9g.js";import{tr,rr,Ze,Je,ne,or,et}from"../../index-1hxjsnw5.js";import{b}from"../../index-ecvn2gnv.js";import{L}from"../../index-rgbg5bsy.js";import{v}from"../../index-tcwzyy71.js";import"../../index-9gtg7nt7.js";import{y,C}from"../../index-7j277075.js";import"../../index-0gzm7bb9.js";import{e}from"../../index-qbwndfn2.js";import{jsx as ic,jsxs as lc}from"react/jsx-runtime";var sc=({children:t,loading:r=!1,fullWidth:n=!1,className:o,disabled:s,variant:l,size:c,...d})=>lc(a,{variant:l,size:c,className:e(n&&"w-full",o),disabled:s===!0||r,...d,children:[r&&ic(wt,{size:20,className:"mr-2"}),t]}),cc=sc;import*as Wa from"react";import{jsx as Ga,jsxs as uc}from"react/jsx-runtime";var dc=({children:t,className:r,type:n="button",...o},s)=>uc(a,{ref:s,type:n,variant:"ghost",size:"sm",className:e("h-9 rounded-full border border-dashed border-border/80 bg-background px-3 text-xs font-medium text-muted-foreground shadow-xs transition-[transform,color,background-color,border-color] hover:border-primary/35 hover:bg-muted/45 hover:text-foreground active:scale-[0.98]",r),...o,children:[Ga("span",{className:"mr-2 inline-flex size-5 items-center justify-center rounded-full border border-border/70 bg-muted/45 text-foreground",children:Ga(Rt,{className:"size-3.5"})}),t]}),Fn=Wa.forwardRef(dc);Fn.displayName="AddItemButton";var pc=Fn;import{forwardRef as mc}from"react";import{jsx as gc}from"react/jsx-runtime";var Xa=(t,r,n)=>{if(r<1||r>12||n<1||n>31)return!1;let o=new Date(t,r-1,n);return o.getFullYear()===t&&o.getMonth()===r-1&&o.getDate()===n},fc=(t)=>{let r=t.trim();if(!r)return null;let n=/^(?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2})$/u.exec(r);if(n){let{year:s,month:l,day:c}=n.groups??{};return Xa(Number(s),Number(l),Number(c))?`${s}-${l}-${c}`:null}let o=/^(?<day>\d{1,2})[/\-.](?<month>\d{1,2})[/\-.](?<year>\d{4})$/u.exec(r);if(o){let{day:s,month:l,year:c}=o.groups??{},d=Number(s),u=Number(l),p=Number(c);if(!Xa(p,u,d))return null;return`${p}-${String(u).padStart(2,"0")}-${String(d).padStart(2,"0")}`}return null},Ua=mc(function({onPaste:r,...n},o){return gc(g,{ref:o,type:"date",onPaste:(l)=>{let c=l.clipboardData.getData("text"),d=fc(c);if(d!==null&&d!==""){l.preventDefault();let u=l.currentTarget,p=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value")?.set?.bind(u);if(p!==void 0)p(d),u.dispatchEvent(new Event("input",{bubbles:!0}))}r?.(l)},...n})});Ua.displayName="DateInput";var bc=Ua;import*as Ka from"react";import{jsx as hc}from"react/jsx-runtime";var Ya=i("font-display font-bold leading-[1.06] tracking-tight text-foreground",{defaultVariants:{size:"lg"},variants:{size:{lg:"text-[1.5rem] sm:text-[1.85rem]",md:"text-[1.15rem] sm:text-[1.25rem]",sm:"text-[1rem]",xl:"text-[2.1rem] sm:text-[2.5rem]"}}}),vc=({as:t="h2",size:r,className:n,...o},s)=>hc(t,{ref:s,className:e(Ya({size:r}),n),...o}),qa=Ka.forwardRef(vc);qa.displayName="DisplayHeading";var xc=qa;import*as Bt from"react";import{jsx as Hr,jsxs as Qa,Fragment as Za}from"react/jsx-runtime";var _n=Bt.forwardRef(function({value:r,label:n,variant:o="icon",copyLabel:s="Copy",copiedLabel:l="Copied",errorMessage:c="Failed to copy to clipboard",resetDelay:d=1500,className:u,onClick:p,...m},f){let[h,R]=Bt.useState(!1),x=Bt.useRef(null);Bt.useEffect(()=>()=>{if(x.current!==null)clearTimeout(x.current)},[]);let S=async(B)=>{p?.(B);try{if(await navigator.clipboard.writeText(r),R(!0),x.current!==null)clearTimeout(x.current);x.current=setTimeout(()=>{R(!1)},d)}catch{ue.error(c)}};if(o==="button")return Hr(a,{ref:f,type:"button",variant:"outline",onClick:(B)=>{S(B)},"aria-label":`Copy ${n}`,className:e("shrink-0",u),...m,children:h?Qa(Za,{children:[Hr(y,{className:"mr-1 size-4"}),l]}):Qa(Za,{children:[Hr(ne,{className:"mr-1 size-4"}),s]})});return Hr("button",{ref:f,type:"button",onClick:(B)=>{S(B)},"aria-label":`Copy ${n}`,className:e("flex size-8 shrink-0 items-center justify-center rounded-md border border-border bg-card text-muted-foreground transition hover:border-primary/40 hover:text-primary",u),...m,children:h?Hr(y,{className:"size-3.5 text-primary"}):Hr(ne,{className:"size-3.5"})})});_n.displayName="CopyButton";var yc=_n;import{jsx as Jo,jsxs as wc}from"react/jsx-runtime";var es="#a3d54a",ts=({className:t,...r})=>wc("svg",{...r,"aria-hidden":"true",className:e("size-6 shrink-0",t),"data-slot":"collective-intelligence-loader",fill:"none",viewBox:"0 0 24 24",children:[Jo("polyline",{className:"origin-center motion-safe:animate-[ci-breathe-left_1.8s_ease-in-out_infinite]",points:"10,5.5 4.5,12 10,18.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2.2}),Jo("polyline",{className:"origin-center motion-safe:animate-[ci-breathe-right_1.8s_ease-in-out_infinite]",points:"14,5.5 19.5,12 14,18.5",stroke:es,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2.2}),Jo("circle",{className:"origin-center [transform-box:fill-box] motion-safe:animate-[ci-pulse-dot_1.8s_ease-in-out_infinite]",cx:12,cy:12,fill:es,r:2.3})]});ts.displayName="CollectiveIntelligenceLoader";var Nc=ts;import{jsx as Cc}from"react/jsx-runtime";var Rc=({children:t,className:r})=>Cc("div",{className:e("text-destructive text-sm text-center",r),children:t}),Sc=Rc;import*as rs from"react";import{jsx as Tc}from"react/jsx-runtime";var Pc=({value:t,fallback:r="—",locale:n,className:o,...s},l)=>Tc("span",{ref:l,className:e("tabular-nums",o),...s,children:t===null||t===void 0?r:new Intl.NumberFormat(n).format(t)}),ns=rs.forwardRef(Pc);ns.displayName="FormattedNumber";var kc=ns;import*as os from"react";import{jsx as Ec}from"react/jsx-runtime";var Lc={accent:"bg-[color-mix(in_oklab,var(--chart-1)_12%,var(--card))] text-[color-mix(in_oklab,var(--chart-1)_85%,var(--foreground))] border-[color-mix(in_oklab,var(--chart-1)_22%,var(--border))]",gold:"bg-[color-mix(in_oklab,var(--chart-3)_15%,var(--card))] text-[color-mix(in_oklab,var(--chart-3)_65%,var(--foreground))] border-[color-mix(in_oklab,var(--chart-3)_28%,var(--border))]",neutral:"bg-(--bg-surface-alt)/70 text-(--text-secondary) border-(--border-subtle)",sage:"bg-[color-mix(in_oklab,var(--chart-2)_14%,var(--card))] text-[color-mix(in_oklab,var(--chart-2)_70%,var(--foreground))] border-[color-mix(in_oklab,var(--chart-2)_26%,var(--border))]",sky:"bg-[color-mix(in_oklab,var(--chart-4)_14%,var(--card))] text-[color-mix(in_oklab,var(--chart-4)_70%,var(--foreground))] border-[color-mix(in_oklab,var(--chart-4)_26%,var(--border))]",violet:"bg-[color-mix(in_oklab,var(--chart-5)_14%,var(--card))] text-[color-mix(in_oklab,var(--chart-5)_70%,var(--foreground))] border-[color-mix(in_oklab,var(--chart-5)_26%,var(--border))]"},Dc={lg:"size-12 rounded-lg text-[17px] [&_svg]:size-6",md:"size-10 rounded-lg text-[15px] [&_svg]:size-5",sm:"size-8 rounded-md text-[13px] [&_svg]:size-4"},as=os.forwardRef(function({tone:r="neutral",size:n="md",initial:o,className:s,children:l,...c},d){return Ec("span",{ref:d,"aria-hidden":!0,className:e("inline-flex shrink-0 select-none items-center justify-center border font-display font-bold",Dc[n],Lc[r],s),...c,children:l??(o!==void 0&&o!==""?o.slice(0,2).toUpperCase():null)})});as.displayName="IconTile";var Mc=as;import*as ss from"react";import{jsx as Oc}from"react/jsx-runtime";var Ic={accent:"text-(--accent)",copper:"text-(--text-muted)",default:"text-(--text-muted)",muted:"text-(--text-muted)"},Ac=({as:t="span",tone:r="default",className:n,...o},s)=>Oc(t,{ref:s,className:e("inline-block text-[11px] font-semibold uppercase tracking-[0.06em]",Ic[r],n),...o}),Br=ss.forwardRef(Ac);Br.displayName="Kicker";var Hc=Br;import*as is from"react";import{jsx as Fc}from"react/jsx-runtime";var Vc=(t)=>`+${t}`,Bc=({expanded:t,hiddenCount:r,collapsedLabel:n=Vc,expandedLabel:o="Show less",onToggle:s,className:l,...c},d)=>Fc("button",{ref:d,type:"button",onClick:s,className:e("inline-flex items-center gap-1 rounded-full border border-dashed border-muted-foreground/40 bg-muted/20 px-2.5 py-1 text-[11px] font-medium text-muted-foreground hover:bg-muted/40 hover:text-foreground transition-colors",l),...c,children:t?o:n(r)}),ls=is.forwardRef(Bc);ls.displayName="ShowMoreTag";var _c=ls;import*as cs from"react";import{jsx as jc}from"react/jsx-runtime";var zc=i("font-sans leading-none tabular-nums text-primary",{defaultVariants:{size:"md"},variants:{size:{lg:"text-[1.4rem]",md:"text-[1.1rem]",sm:"text-[0.95rem]",xl:"text-[2rem]"}}}),$c=({size:t,className:r,...n},o)=>jc("span",{ref:o,className:e(zc({size:t}),r),...n}),Fr=cs.forwardRef($c);Fr.displayName="SerifNumeral";var Jc=Fr;import*as ps from"react";import{jsx as us,jsxs as ds}from"react/jsx-runtime";var Gc={neutral:"border-(--border-subtle) bg-card text-muted-foreground",warning:"border-[color-mix(in_oklab,var(--warning)_40%,var(--border))] bg-[color-mix(in_oklab,var(--warning)_12%,var(--card))] text-[color-mix(in_oklab,var(--warning)_75%,var(--foreground))]"},Wc=({tooltip:t,tone:r="neutral",icon:n,className:o,children:s,...l},c)=>ds(Zt,{children:[us(Jt,{asChild:!0,children:ds(T,{ref:c,variant:"outline",className:e(Gc[r],o),...l,children:[n,s]})}),us(er,{children:t})]}),ms=ps.forwardRef(Wc);ms.displayName="TooltipBadge";var Xc=ms;import*as fs from"react";import{jsx as Kc}from"react/jsx-runtime";var Uc={body1:{className:"text-base",tag:"p"},body2:{className:"text-sm",tag:"p"},h1:{className:"text-2xl font-semibold",tag:"h1"},h2:{className:"text-xl font-bold",tag:"h2"},h3:{className:"text-lg font-semibold",tag:"h3"},h4:{className:"text-base font-medium",tag:"h4"},subtitle1:{className:"text-base font-normal text-muted-foreground",tag:"h6"},subtitle2:{className:"text-sm font-medium text-muted-foreground",tag:"h6"}},zn=fs.forwardRef(function({variant:r="body1",as:n,className:o,...s},l){let{tag:c,className:d}=Uc[r];return Kc(n??c,{ref:l,className:e(d,o),...s})});zn.displayName="Typography";import{jsx as qc}from"react/jsx-runtime";var Yc=({children:t,as:r="form",className:n,onSubmit:o,...s})=>{let l=(c)=>{c.preventDefault(),o?.(c)};return qc(r,{className:e("flex flex-col gap-4 min-w-[300px]",n),onSubmit:l,...s,children:t})},Zc=Yc;import{jsx as rd}from"react/jsx-runtime";var gs={},_r=(...t)=>{for(let r of t)if(r!==void 0)return r;return 1},Qc=(t=gs)=>({"--list-cols":_r(t.cols),"--list-cols-2xl":_r(t.cols2xl,t.colsXl,t.colsLg,t.colsMd,t.colsSm,t.cols),"--list-cols-lg":_r(t.colsLg,t.colsMd,t.colsSm,t.cols),"--list-cols-md":_r(t.colsMd,t.colsSm,t.cols),"--list-cols-sm":_r(t.colsSm,t.cols),"--list-cols-xl":_r(t.colsXl,t.colsLg,t.colsMd,t.colsSm,t.cols)}),ed=["grid","gap-4","[grid-template-columns:repeat(var(--list-cols),minmax(0,1fr))]","sm:[grid-template-columns:repeat(var(--list-cols-sm),minmax(0,1fr))]","md:[grid-template-columns:repeat(var(--list-cols-md),minmax(0,1fr))]","lg:[grid-template-columns:repeat(var(--list-cols-lg),minmax(0,1fr))]","xl:[grid-template-columns:repeat(var(--list-cols-xl),minmax(0,1fr))]","2xl:[grid-template-columns:repeat(var(--list-cols-2xl),minmax(0,1fr))]"].join(" "),td=({cols:t=gs,children:r,...n})=>rd("div",{className:ed,style:Qc(t),...n,children:r});import{jsx as od}from"react/jsx-runtime";var nd=({className:t,spaced:r=!1,...n})=>od("div",{className:e("animate-[rise-in_500ms_cubic-bezier(0.16,1,0.3,1)_both]",r&&"space-y-6",t),...n});var ad=nd;import{jsx as xn,jsxs as zr}from"react/jsx-runtime";var sd=(t)=>t!==null&&t!==void 0&&t.constructor===String,hn=(t)=>t!==null&&t!==void 0&&t!==!1&&t!==""&&t!==0,id=({title:t,description:r,icon:n,kicker:o,status:s,actions:l,className:c})=>zr("header",{className:e("space-y-2",c),children:[hn(o)?zr("div",{className:"flex items-center gap-2 text-(--text-muted) [&_svg]:h-3.5 [&_svg]:w-3.5",children:[hn(n)?xn("span",{className:"inline-flex h-5 w-5 items-center justify-center rounded-sm bg-(--bg-accent-soft) text-(--accent)",children:n}):null,xn("span",{className:"text-[12px] font-medium tracking-tight [&_span.sep]:mx-1.5 [&_span.sep]:text-(--accent)",children:sd(o)?o.split("·").map((d,u,p)=>zr("span",{children:[d.trim(),u<p.length-1?xn("span",{className:"sep","aria-hidden":!0,children:"·"}):null]},u)):o})]}):null,zr("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[zr("div",{className:"min-w-0 flex-1 basis-64 space-y-1.5",children:[xn("h1",{className:"font-display text-[27px] font-bold leading-tight tracking-[-0.02em] text-(--text-primary)",children:t}),hn(r)?xn("p",{className:"max-w-2xl text-[14px] leading-relaxed text-(--text-secondary)",children:r}):null]}),hn(l)||hn(s)?zr("div",{className:"flex shrink-0 items-center gap-2 pt-1",children:[s,l]}):null]})]}),ld=id;import*as vs from"react";import{jsx as $n,jsxs as bs}from"react/jsx-runtime";var Xo=(t)=>t!==void 0&&t!==null&&t!==!1&&t!==0&&t!==""&&!Number.isNaN(t),hs=vs.forwardRef(function({icon:r,title:n,description:o,action:s,className:l,...c},d){return bs("div",{ref:d,className:e("flex items-start gap-3",l),...c,children:[Xo(r)?$n("span",{"aria-hidden":!0,className:"mt-0.5 inline-flex shrink-0 items-center justify-center rounded-md bg-muted p-2 text-muted-foreground [&_svg]:h-4 [&_svg]:w-4",children:r}):null,bs("div",{className:"min-w-0 flex-1",children:[$n("h3",{className:"text-[15px] font-semibold leading-snug text-foreground",children:n}),Xo(o)?$n("p",{className:"mt-0.5 text-sm leading-relaxed text-muted-foreground",children:o}):null]}),Xo(s)?$n("div",{className:"shrink-0",children:s}):null]})});hs.displayName="SectionHeader";var cd=hs;import{jsx as xs,jsxs as ud}from"react/jsx-runtime";var dd=({title:t,toolbar:r})=>ud("div",{className:"flex items-center justify-between mb-12",children:[xs(zn,{variant:"h2",children:t}),Boolean(r)&&xs("div",{className:"flex items-center gap-2",children:r})]}),pd=dd;import*as Jn from"react";import{jsx as tt,jsxs as jn}from"react/jsx-runtime";var ys=(t,r,n)=>{if(t.length>=r)return t;return[...t,...Array.from({length:r-t.length},n)]},md=[],Ko=({values:t,defaultValues:r=md,onValuesChange:n,addLabel:o,getRemoveLabel:s,actions:l,minItems:c=0,disabled:d=!1,renderItem:u,createItem:p,validateItem:m,classes:f,className:h,id:R,...x})=>{let S=Jn.useId(),[B,E]=Jn.useState(()=>ys(r,c,p)),P=ys(t??B,c,p),k=Boolean(l),M=(j)=>{if(t===void 0)E(j);n?.(j)};return jn("div",{"data-slot":"array-input",className:e("space-y-2",f?.root,h),...x,children:[tt("div",{className:"space-y-2",children:P.map((j,D)=>{let A=D===0&&R!==void 0&&R!==""?R:`${S}-${D}`,F=m?.(j,D);return jn("div",{className:e("flex items-center gap-3",f?.row),children:[u({disabled:d,id:A,index:D,onValueChange:(Z)=>{let X=[...P];X[D]=Z,M(X)},validationMessage:F,value:j}),P.length>c?tt(a,{type:"button",variant:"ghost",size:"icon",disabled:d,"aria-label":s(D),className:e("size-10 shrink-0 text-muted-foreground hover:text-destructive",f?.removeButton),onClick:()=>{M(P.filter((Z,X)=>X!==D))},children:tt(Wo,{"aria-hidden":"true",className:"size-4"})}):null]},D)})}),jn("div",{className:e("flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",f?.actionRow),children:[tt(Fn,{disabled:d,className:f?.addButton,onClick:()=>{M([...P,p()])},children:o}),k?tt("div",{className:e("sm:ml-auto",f?.actions),children:l}):null]})]})},fd=(t)=>{let{createItem:r,getItemLabel:n,inputProps:o,placeholder:s,required:l=!1,renderItem:c,...d}=t,{className:u,...p}=o??{};if(c!==void 0)return tt(Ko,{...d,createItem:r??(()=>""),renderItem:c});return tt(Ko,{...d,createItem:r??(()=>""),renderItem:(m)=>{let{disabled:f,id:h,index:R,onValueChange:x,validationMessage:S,value:B}=m;return jn("div",{className:"min-w-0 flex-1",children:[tt(g,{...p,id:h,"aria-label":n(R),"aria-invalid":Boolean(S),value:B,placeholder:s,required:l,disabled:f,className:e("w-full",u,d.classes?.input),onChange:(E)=>{x(E.target.value)}}),S!==void 0&&S!==""?tt("p",{className:"mt-1 text-xs text-destructive",role:"alert",children:S}):null]})}})},gd=(t)=>tt(Ko,{...t}),bd=(t)=>t.createItem!==void 0&&t.renderItem!==void 0,ws=(t)=>{if(bd(t))return tt(gd,{...t});return tt(fd,{...t})};ws.displayName="ArrayInput";var vd=ws;import*as Yr from"react";var Ft=(t,r)=>{let n=[];for(let o of t){let s=n.findIndex((l)=>r(o,l)<0);if(s===-1)n.push(o);else n.splice(s,0,o)}return n};var rt={hour:9,interval:1,minute:0,mode:"day",monthday:1,weekdays:[1,2,3,4,5]},Yo=/^\*\/(?<step>\d+)$/u,hd=(t)=>{let r=[];for(let n of t.split(",")){let o=/^(?<start>\d+)-(?<end>\d+)$/u.exec(n);if(o){let s=Number(o.groups?.start),l=Number(o.groups?.end);if(s>l)return null;for(let c=s;c<=l;c+=1)r.push(c)}else if(/^\d+$/u.test(n))r.push(Number(n));else return null}return r},xd=(t,r,n,o)=>{if(r==="*"&&n==="*"&&o==="*"){let s=Yo.exec(t),l=Number(s?.groups?.step);return s&&l>=1&&l<=59?{...rt,interval:l,mode:"minutes"}:null}return},yd=(t,r,n,o)=>{if(r!=="*"||n!=="*")return;let s=Yo.exec(t);if(s){let l=Number(s.groups?.step);return l>=1&&l<=23?{...rt,interval:l,minute:o,mode:"hours"}:null}return},wd=(t,r,n)=>{let o=Yo.exec(t);if(o){let l=Number(o.groups?.step);if(l%7===0&&l>=7&&l<=28)return{...rt,hour:r,interval:l/7,minute:n,mode:"weeks"};return l>=1&&l<=31?{...rt,hour:r,interval:l,minute:n,mode:"days"}:null}let s=Number(t);return/^\d+$/u.test(t)&&s>=1&&s<=31?{...rt,hour:r,minute:n,mode:"month",monthday:s}:null},Nd=(t,r,n)=>{let o=hd(t);if(!o||o.some((l)=>l<0||l>7))return null;let s=Ft(new Set(o.map((l)=>l===7?0:l)),(l,c)=>l-c);return{...rt,hour:r,minute:n,mode:"week",weekdays:s}},yn=(t)=>{let r=t.trim().split(/\s+/u);if(r.length!==5)return null;let[n,o,s,l,c]=r;if(l!=="*")return null;let d=xd(n,o,s,c);if(d!==void 0)return d;if(!/^\d+$/u.test(n))return null;let u=Number(n);if(u<0||u>59)return null;let p=yd(o,s,c,u);if(p!==void 0)return p;if(!/^\d+$/u.test(o))return null;let m=Number(o);if(m<0||m>23)return null;if(s==="*"&&c==="*")return{...rt,hour:m,minute:u,mode:"day"};if(c==="*")return wd(s,m,u);if(s==="*")return Nd(c,m,u);return null},_t=(t)=>{let r=Math.max(1,Math.floor(t.interval));switch(t.mode){case"minutes":return`*/${Math.min(r,59)} * * * *`;case"hours":return`${t.minute} */${Math.min(r,23)} * * *`;case"day":return`${t.minute} ${t.hour} * * *`;case"days":return`${t.minute} ${t.hour} */${Math.min(r,31)} * *`;case"week":{let n=t.weekdays.length>0?Ft(new Set(t.weekdays),(o,s)=>o-s).join(","):"*";return`${t.minute} ${t.hour} * * ${n}`}case"weeks":return`${t.minute} ${t.hour} */${Math.min(r*7,28)} * *`;case"month":return`${t.minute} ${t.hour} ${Math.min(Math.max(t.monthday,1),31)} * *`;default:throw Error("Unsupported cron mode")}},Ns=(t,r,n)=>{if(t==="*")return!0;for(let o of t.split(",")){let s=/^(?<base>\*|\d+|\d+-\d+)\/(?<increment>\d+)$/u.exec(o);if(s){let c=s.groups?.base??"";if(c!=="*"&&!Ns(c,r,n))return!1;let d=Number(s.groups?.increment);if(!Number.isFinite(d)||d<1)return!1;continue}let l=/^(?<start>\d+)-(?<end>\d+)$/u.exec(o);if(l){let c=Number(l.groups?.start),d=Number(l.groups?.end);if(c<r||d>n||c>d)return!1;continue}if(/^\d+$/u.test(o)){let c=Number(o);if(c<r||c>n)return!1;continue}return!1}return!0},Rd=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Cd=(t,r)=>{let n=String(t).padStart(2,"0"),o=String(r).padStart(2,"0");return`${n}:${o}`},Gn=(t)=>{let r=yn(t);if(!r)return t;let n=Cd(r.hour,r.minute);switch(r.mode){case"minutes":return r.interval===1?"Every minute":`Every ${r.interval} minutes`;case"hours":return r.interval===1?`Every hour at :${String(r.minute).padStart(2,"0")}`:`Every ${r.interval} hours at :${String(r.minute).padStart(2,"0")}`;case"day":return`Every day at ${n}`;case"days":return r.interval===1?`Every day at ${n}`:`Every ${r.interval} days at ${n}`;case"week":{if(r.weekdays.length===0)return`Weekly at ${n}`;let o=Ft(r.weekdays,(d,u)=>d-u),s=o.length===5&&o.every((d,u)=>d===u+1),l=o.length===2&&o[0]===0&&o[1]===6;if(s)return`Weekdays at ${n}`;if(l)return`Weekends at ${n}`;return`${o.map((d)=>Rd[d].slice(0,3)).join(", ")} at ${n}`}case"weeks":return r.interval===1?`Every week at ${n}`:`Every ${r.interval} weeks at ${n}`;case"month":return`Day ${r.monthday} of every month at ${n}`;default:throw Error("Unsupported cron mode")}},Zo=(t)=>{let r=t.trim().split(/\s+/u);if(r.length!==5)return!1;let n=[[0,59],[0,23],[1,31],[1,12],[0,7]];return r.every((o,s)=>Ns(o,n[s][0],n[s][1]))};import*as Cs from"react";var Rs=(t)=>{let o=new Intl.DateTimeFormat("en-US",{timeZone:t,timeZoneName:"shortOffset"}).formatToParts(new Date).find((u)=>u.type==="timeZoneName")?.value??"GMT",s=/(?<sign>[+-])(?<hours>\d{1,2})(?::(?<minutes>\d{2}))?/u.exec(o);if(!s)return 0;let l=s.groups?.sign==="-"?-1:1,c=Number(s.groups?.hours??0),d=Number(s.groups?.minutes??0);return l*(c*60+d)},Sd=(t)=>{let r=Rs(t),n=r>=0?"+":"-",o=Math.abs(r),s=String(Math.floor(o/60)).padStart(2,"0"),l=String(o%60).padStart(2,"0");return`${n}${s}:${l}`},Wn=null,ea=()=>{if(Wn)return Wn;let t="supportedValuesOf"in Intl?Intl.supportedValuesOf("timeZone"):["UTC"];return Wn=Ft(["UTC",...t].map((r)=>({label:`${r} (UTC${Sd(r)})`,offset:Rs(r),value:r})),(r,n)=>r.offset-n.offset||r.value.localeCompare(n.value)).map(({value:r,label:n})=>({label:n,value:r})),Wn};import{jsx as Pd}from"react/jsx-runtime";var Xn=({value:t,onChange:r,className:n,width:o="100%",disabled:s,placeholder:l="Select timezone"})=>{let c=Cs.useMemo(()=>ea(),[]);return Pd(gr,{options:c,value:t,onChange:(d)=>{r(d||"UTC")},placeholder:l,searchPlaceholder:"Search timezone...",emptyMessage:"No timezone found.",className:e("bg-transparent font-normal",n),width:o,disabled:s})};import{jsx as te,jsxs as Se,Fragment as Id}from"react/jsx-runtime";var Ts=[{label:"X minutes",value:"minutes"},{label:"X hours",value:"hours"},{label:"Day",value:"day"},{label:"X days",value:"days"},{label:"Week",value:"week"},{label:"X weeks",value:"weeks"},{label:"Month",value:"month"}],Td=[{label:"Monday",short:"Mon",value:1},{label:"Tuesday",short:"Tue",value:2},{label:"Wednesday",short:"Wed",value:3},{label:"Thursday",short:"Thu",value:4},{label:"Friday",short:"Fri",value:5},{label:"Saturday",short:"Sat",value:6},{label:"Sunday",short:"Sun",value:0}],kd=(t)=>Ts.some((r)=>r.value===t),Ss=(t)=>{let r=t.trim();if(!r)return{custom:_t(rt),simple:rt,view:"simple"};let n=yn(r);if(n)return{custom:r,simple:n,view:"simple"};return{custom:r,simple:rt,view:"advanced"}},Ld=(t,r)=>{let n=r===1;switch(t.value){case"minutes":return n?"minute":"minutes";case"hours":return n?"hour":"hours";case"day":return"day";case"days":return n?"day":"days";case"week":return"week";case"weeks":return n?"week":"weeks";case"month":return"month";default:throw Error("Unsupported cron mode")}},Un=(t,r,n)=>Math.max(r,Math.min(n,t)),Ps=(t)=>String(t).padStart(2,"0"),Dd=({hour:t,minute:r,onChange:n})=>Se("div",{className:"flex items-center gap-1",children:[te(g,{type:"number",min:0,max:23,value:Ps(t),onChange:(o)=>{n(Un(Number(o.target.value)||0,0,23),r)},className:"w-16 text-center font-mono"}),te("span",{className:"text-muted-foreground",children:":"}),te(g,{type:"number",min:0,max:59,value:Ps(r),onChange:(o)=>{n(t,Un(Number(o.target.value)||0,0,59))},className:"w-16 text-center font-mono"})]}),Ed=({state:t,onChange:r,timezone:n,onTimezoneChange:o})=>{let s=t.mode==="minutes"||t.mode==="hours"||t.mode==="days"||t.mode==="weeks",l=t.mode!=="minutes"&&t.mode!=="hours",c=t.mode==="hours",d=t.mode==="week",u=t.mode==="month";return Se("div",{className:"space-y-3",children:[te("div",{className:"grid gap-2 sm:grid-cols-[minmax(0,1fr)_auto] sm:items-end",children:Se("div",{className:"space-y-2",children:[te("span",{className:"text-xs font-medium text-muted-foreground",children:"Every"}),Se("div",{className:e("grid gap-2",s?"grid-cols-[88px_minmax(0,1fr)]":"grid-cols-1"),children:[s&&te(g,{type:"number",min:1,value:t.interval,onChange:(p)=>{r({interval:Math.max(1,Number(p.target.value)||1)})},className:"font-mono"}),Se($r,{value:t.mode,onValueChange:(p)=>{if(kd(p))r({mode:p})},children:[te(qr,{className:"flex-1",children:te(Wr,{})}),te(Kr,{children:Ts.map((p)=>te(jr,{value:p.value,children:Ld(p,t.interval)},p.value))})]})]})]})}),d&&Se("div",{className:"space-y-2",children:[te("span",{className:"text-xs font-medium text-muted-foreground",children:"On"}),te(Jr,{type:"multiple",variant:"outline",size:"sm",value:t.weekdays.map(String),onValueChange:(p)=>{r({weekdays:p.length?Ft(p.map(Number),(m,f)=>m-f):[1]})},className:"w-full",children:Td.map((p)=>te(eo,{value:String(p.value),"aria-label":p.label,className:"text-xs",children:p.short},p.value))})]}),u&&Se("div",{className:"space-y-2",children:[te("span",{className:"text-xs font-medium text-muted-foreground",children:"On day"}),te(g,{type:"number",min:1,max:31,value:t.monthday,onChange:(p)=>{r({monthday:Un(Number(p.target.value)||1,1,31)})},className:"w-24"})]}),(l||n!==void 0&&o)&&Se("div",{className:e("grid gap-3",l&&n!==void 0&&o?"lg:grid-cols-[auto_minmax(0,1fr)] lg:items-end":"grid-cols-1"),children:[l&&Se("div",{className:"space-y-2",children:[te("span",{className:"text-xs font-medium text-muted-foreground",children:"At"}),te(Dd,{hour:t.hour,minute:t.minute,onChange:(p,m)=>{r({hour:p,minute:m})}})]}),n!==void 0&&o&&Se("div",{className:"space-y-2",children:[te("span",{className:"text-xs font-medium text-muted-foreground",children:"Timezone"}),te(Xn,{value:n,onChange:o})]})]}),c&&Se("div",{className:"space-y-2",children:[te("span",{className:"text-xs font-medium text-muted-foreground",children:"At minute"}),te(g,{type:"number",min:0,max:59,value:t.minute,onChange:(p)=>{r({minute:Un(Number(p.target.value)||0,0,59)})},className:"w-24"})]})]})},Md=({value:t,onChange:r,className:n,showPreview:o=!0,timezone:s,onTimezoneChange:l})=>{let[c,d]=Yr.useState(()=>Ss(t)),[u,p]=Yr.useState(t),[m,f]=Yr.useState(t);if(t!==u){if(p(t),t!==m)f(t),d(Ss(t))}let h=Yr.useCallback((P)=>{let k=P.view==="simple"?_t(P.simple):P.custom;f(k),r(k)},[r]),R=(P)=>{d((k)=>{let M={...k.simple,...P},j={...k,custom:_t(M),simple:M};return h(j),j})},x=(P)=>{d((k)=>{let M={...k,custom:P};return h(M),M})},S=(P)=>{d((k)=>{if(P===k.view)return k;if(P==="advanced"){let D=_t(k.simple),A={...k,custom:D,view:P};return h(A),A}let M=yn(k.custom),j=M?{...k,simple:M,view:P}:{...k,view:P};return h(j),j})},B=Zo(c.custom),E=null;if(c.view==="simple")E=Gn(_t(c.simple));else if(B)E=Gn(c.custom);return Se("div",{className:e("space-y-4",n),children:[Se(Xr,{value:c.view,onValueChange:(P)=>{if(P==="simple"||P==="advanced")S(P)},children:[Se(Qr,{className:"grid w-full grid-cols-2 rounded-md bg-muted/70 p-1 sm:w-[320px]",children:[te(vr,{value:"simple",className:"text-xs",children:"Simple"}),te(vr,{value:"advanced",className:"text-xs",children:"Advanced"})]}),te(xr,{value:"simple",className:"space-y-3 pt-3",children:te(Ed,{state:c.simple,onChange:R,timezone:s,onTimezoneChange:l})}),Se(xr,{value:"advanced",className:"space-y-2 pt-3",children:[te("span",{className:"text-xs font-medium text-muted-foreground",children:"Cron Expression"}),te(g,{value:c.custom,onChange:(P)=>{x(P.target.value)},placeholder:"0 9 * * 1-5",className:e("font-mono text-sm",!B&&c.custom.trim()&&"border-destructive focus-visible:ring-destructive/40"),spellCheck:!1}),te("p",{className:"text-[11px] text-muted-foreground",children:"Format: minute hour day-of-month month day-of-week"})]})]}),c.view==="advanced"&&s!==void 0&&l&&Se("div",{className:"space-y-2",children:[te("span",{className:"text-xs font-medium text-muted-foreground",children:"Timezone"}),te(Xn,{value:s,onChange:l})]}),o&&te("div",{className:"flex min-h-8 flex-wrap items-center gap-2 rounded-md bg-muted/35 px-3 py-2 text-xs",children:E===null?te("span",{className:"text-destructive",children:"Invalid cron expression"}):Se(Id,{children:[te("span",{className:"text-muted-foreground",children:E}),te(T,{variant:"secondary",className:"ml-auto font-mono text-[11px]",children:c.view==="simple"?_t(c.simple):c.custom})]})})]})};import{jsx as ta}from"react/jsx-runtime";var Ad={both:"w-full h-full",horizontal:"w-full h-auto",none:"",vertical:"h-full w-auto"},Od=({src:t,alt:r="",className:n="",width:o,height:s,fill:l="horizontal",style:c})=>{if(l==="both")return ta("div",{className:e("relative overflow-hidden rounded-lg shadow-md",n),style:{height:s,width:o,...c},children:ta("img",{src:t,alt:r,className:"object-cover w-full h-full absolute inset-0"})});return ta("img",{src:t,alt:r,width:o,height:s,className:e("object-cover rounded-lg shadow-md",Ad[l],n),style:{height:l==="vertical"?"100%":s,width:l==="horizontal"?"100%":o,...c}})},Hd=Od;import{jsx as Kn,jsxs as ks}from"react/jsx-runtime";var Vd=({title:t,className:r,children:n,...o})=>ks("section",{"data-slot":"summary-list",className:e("space-y-2",r),...o,children:[t?Kn("h3",{className:"text-sm font-semibold tracking-tight",children:t}):null,Kn("dl",{className:"divide-y divide-border overflow-hidden rounded-lg border border-border bg-card",children:n})]}),Bd=({label:t,value:r,muted:n=!1,className:o,...s})=>ks("div",{"data-slot":"summary-item",className:e("grid gap-1 px-4 py-3 sm:grid-cols-[minmax(8rem,14rem)_1fr] sm:gap-4",o),...s,children:[Kn("dt",{className:"text-sm text-muted-foreground",children:t}),Kn("dd",{className:e("min-w-0 break-words text-sm",n?"text-muted-foreground":"font-medium text-foreground"),children:r})]});import*as ra from"react";import{jsx as hr,jsxs as Ls}from"react/jsx-runtime";var Fd=({className:t,...r})=>hr(ro,{"data-slot":"choice-card-group",className:e("grid gap-3",t),...r}),_d=({title:t,description:r,media:n,footer:o,className:s,...l})=>{let c=ra.useId(),d=ra.useId(),u=Boolean(r);return Ls(oo,{"data-slot":"choice-card","aria-labelledby":c,"aria-describedby":u?d:void 0,className:e("group/choice relative flex h-full min-w-0 flex-col items-start gap-4 rounded-lg border border-border bg-card p-5 text-left shadow-(--shadow-sm) outline-none transition-[border-color,background-color,box-shadow] dark:shadow-none","hover:border-foreground/25 focus-visible:ring-[3px] focus-visible:ring-ring/50","data-[state=checked]:border-primary data-[state=checked]:bg-primary/[0.04] data-[state=checked]:ring-1 data-[state=checked]:ring-primary/25","disabled:cursor-not-allowed disabled:bg-muted/30 disabled:opacity-65 disabled:hover:border-border",s),...l,children:[hr("span",{"aria-hidden":!0,className:"absolute top-4 right-4 flex size-5 items-center justify-center rounded-full border border-input bg-background text-primary-foreground transition-colors group-data-[state=checked]/choice:border-primary group-data-[state=checked]/choice:bg-primary",children:hr(no,{children:hr(y,{className:"size-3",strokeWidth:3})})}),n,Ls("span",{className:"block min-w-0 space-y-1 pr-7",children:[hr("span",{id:c,className:"block font-semibold tracking-tight",children:t}),u?hr("span",{id:d,className:"block text-sm leading-relaxed text-muted-foreground",children:r}):null]}),o?hr("span",{className:"mt-auto block w-full",children:o}):null]})};import*as zt from"react";import{jsx as Ut,jsxs as Ds}from"react/jsx-runtime";var Es=zt.forwardRef(function({className:r,...n},o){return Ut("div",{ref:o,className:e("grid gap-2",r),...n})}),Ms=({className:t,...r})=>Ut(nr,{className:e("grid gap-2",t),...r}),na=(t)=>t!==void 0&&t!==null&&t!==!1&&t!==0&&t!==""&&!Number.isNaN(t),Yn=zt.forwardRef(function({title:r,description:n,descriptionId:o,wrapDescription:s=!1,disabled:l=!1,control:c,className:d,children:u,...p},m){return Ds("label",{ref:m,className:e("flex min-w-0 items-start gap-3 rounded-md border border-border p-3","has-[[data-state=checked]]:border-primary/50 has-[[data-state=checked]]:bg-primary/5",l?"cursor-not-allowed bg-muted/30 opacity-65":"cursor-pointer hover:bg-muted/50",d),...p,children:[c,Ds("span",{className:"min-w-0 flex-1",children:[Ut("span",{className:"block truncate text-sm font-medium",children:r}),na(n)?Ut("span",{id:o,className:e("mt-1 block text-xs text-muted-foreground",!s&&"truncate"),children:n}):null,u]})]})}),Is=(t)=>Object.prototype.toString.call(t)==="[object String]",As=(t,r)=>t!==null&&r instanceof Node&&(t.contains(r)||r instanceof HTMLInputElement&&r.getAttribute("aria-hidden")==="true"),zd=({value:t,title:r,description:n,radioLabel:o,disabled:s=!1,onClick:l,...c})=>{let d=zt.useId(),u=zt.useId(),p=o??(Is(r)?r:void 0);return Ut(Yn,{description:n,descriptionId:u,disabled:s,title:r,onClick:(m)=>{if(l?.(m),m.defaultPrevented||s)return;let f=document.querySelector(`#${d}`);if(As(f,m.target))return;m.preventDefault(),f?.click()},control:Ut(ar,{"aria-describedby":na(n)?u:void 0,"aria-label":p,className:"mt-1",disabled:s,id:d,value:t}),...c})},$d=({checked:t,title:r,description:n,checkboxLabel:o,disabled:s=!1,onClick:l,onCheckedChange:c,...d})=>{let u=zt.useId(),p=zt.useId(),m=o??(Is(r)?r:void 0);return Ut(Yn,{description:n,descriptionId:p,disabled:s,title:r,onClick:(f)=>{if(l?.(f),f.defaultPrevented||s)return;if(As(document.querySelector(`#${u}`),f.target))return;f.preventDefault(),c(!t)},control:Ut(Yt,{"aria-describedby":na(n)?p:void 0,"aria-label":m,checked:t,className:"mt-0.5",disabled:s,id:u,onCheckedChange:(f)=>{if(!s)c(f===!0)}}),...d})};Es.displayName="CardOptionsBlock";Ms.displayName="RadioCardOptionsBlock";Yn.displayName="CardOption";import*as Os from"react";import{jsx as Nn,jsxs as oa}from"react/jsx-runtime";var jd=({title:t,description:r,command:n,copyLabel:o=t??n,copyErrorMessage:s,className:l,...c},d)=>oa("div",{ref:d,className:e("space-y-2",l),...c,children:[t===void 0&&r===void 0?null:oa("div",{children:[t===void 0?null:Nn("p",{className:"text-sm font-medium",children:t}),r===void 0?null:Nn("p",{className:"text-sm text-muted-foreground",children:r})]}),oa("div",{className:"flex items-start gap-2",children:[Nn("pre",{className:"flex-1 overflow-x-auto rounded-md border bg-muted px-3 py-2 font-mono text-xs",children:Nn("code",{children:n})}),Nn(_n,{value:n,label:o,errorMessage:s})]})]}),Hs=Os.forwardRef(jd);Hs.displayName="CommandStep";var Jd=Hs;import{forwardRef as Gd,useId as Wd}from"react";import{jsx as Rn,jsxs as Vs}from"react/jsx-runtime";var Bs=Gd(function({currency:r,label:n="Amount",hint:o,hideLabel:s=!1,hideHint:l=!1,error:c,className:d,wrapperClassName:u,id:p,decimals:m=2,step:f,placeholder:h,...R},x){let S=Wd(),B=p??S,E=`Enter amount in ${r}`,P=f??1/10**m,k=h??(m>0?`0.${"0".repeat(m)}`:"0"),M=c!==null&&c!==void 0&&c.length>0;return Vs("div",{className:e("w-full space-y-2",u),children:[!s&&Rn(I,{htmlFor:B,children:n}),Vs("div",{className:"relative",children:[Rn("span",{className:"-translate-y-1/2 absolute top-1/2 left-3 text-sm text-muted-foreground",children:r}),Rn(g,{ref:x,className:e("bg-background pl-12",M&&"border-destructive",d),id:B,min:"0",placeholder:k,step:P,type:"number",...R})]}),M?Rn("p",{className:"text-xs text-destructive",children:c}):!l&&Rn("p",{className:"text-xs text-muted-foreground",children:o??E})]})});Bs.displayName="CurrencyInput";var Xd=Bs;import*as Fs from"react";import{jsx as qn,jsxs as aa}from"react/jsx-runtime";var _s=Fs.forwardRef(function({index:r,label:n,hint:o,className:s,children:l,...c},d){let u=Boolean(r),p=Boolean(o);return aa("div",{ref:d,className:e("grid gap-x-4",u?"grid-cols-[2.25rem_1fr] sm:grid-cols-[2.5rem_1fr]":"grid-cols-1",s),...c,children:[u?qn("div",{className:"flex h-6 items-center justify-end pt-[2px]",children:qn(Fr,{children:r})}):null,aa("div",{className:"min-w-0 space-y-1.5",children:[aa("div",{className:"flex items-baseline justify-between gap-2",children:[qn(Br,{children:n}),p?qn("span",{className:"text-[10px] text-muted-foreground",children:o}):null]}),l]})]})});_s.displayName="FieldRow";var Ud=_s;import{jsx as ie,jsxs as st,Fragment as tu}from"react/jsx-runtime";var Kd=(t)=>{if(t===0)return"0 Bytes";let r=1024,n=["Bytes","KB","MB","GB"],o=Math.floor(Math.log(t)/Math.log(r));return`${Math.round(t/r**o*100)/100} ${n[o]}`},Yd={downloadFile:"Download file",downloadingFile:"Downloading file",dragActive:"Drop the file here",dragInactive:"Drag & drop a file here, or click to select",errorRetry:"Please try again",fileTypeHint:"PDF, DOC, DOCX up to 10MB"},qd=({active:t,activeLabel:r,inactiveLabel:n,hint:o})=>st("div",{className:"flex w-full items-center gap-3",children:[ie("div",{className:e("flex h-10 w-10 shrink-0 items-center justify-center rounded-full transition-colors",t?"bg-[color-mix(in_oklab,var(--primary)_14%,var(--card))]":"bg-muted"),children:ie(qo,{className:e("h-5 w-5",t?"text-primary":"text-muted-foreground")})}),st("div",{children:[ie("p",{className:"text-sm font-medium text-foreground",children:t?r:n}),ie("p",{className:"text-xs text-muted-foreground",children:o})]})]}),Zd=({message:t,retryLabel:r})=>st("div",{className:"flex w-full items-center gap-3",children:[ie("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-destructive/10",children:ie(L,{className:"h-5 w-5 text-destructive"})}),st("div",{children:[ie("p",{className:"text-sm font-medium text-destructive",children:t}),ie("p",{className:"text-xs text-destructive/80",children:r})]})]}),Qd=({file:t,downloading:r,downloadLabel:n,downloadingLabel:o,onDownload:s,onRemove:l})=>st("div",{className:"flex w-full items-center justify-between",children:[st("div",{className:"flex items-center gap-3",children:[t.previewUrl!==void 0&&t.previewUrl!==null&&t.previewUrl!==""?st(tu,{children:[ie("span",{"aria-hidden":"true",className:"h-20 w-28 shrink-0 rounded-md border border-input bg-background bg-contain bg-center bg-no-repeat",style:{backgroundImage:`url(${t.previewUrl})`}}),ie("span",{className:"sr-only",children:t.name})]}):ie("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-[color-mix(in_oklab,var(--success)_14%,var(--card))]",children:ie(H,{className:"h-5 w-5 text-(--success)"})}),st("div",{className:"flex flex-col",children:[st("div",{className:"flex items-center gap-2",children:[ie(Uo,{className:"h-4 w-4 text-muted-foreground"}),ie("span",{className:"text-sm font-medium text-foreground",children:t.name})]}),ie("span",{className:"text-xs text-muted-foreground",children:Kd(t.size)})]})]}),st("div",{className:"flex shrink-0 items-center gap-1",children:[s?ie(a,{"aria-label":r?o:n,className:"h-8 w-8 rounded-full p-0",disabled:r,onClick:s,size:"sm",title:r?o:n,type:"button",variant:"ghost",children:r?ie(b,{className:"h-4 w-4 animate-spin"}):ie(Wt,{className:"h-4 w-4"})}):null,l?ie(a,{className:"h-8 w-8 rounded-full p-0 hover:bg-destructive/10",onClick:l,size:"sm",type:"button",variant:"ghost",children:ie(L,{className:"h-4 w-4 text-destructive"})}):null]})]}),eu=(t)=>{let{rootProps:r,inputProps:n,isDragActive:o,selectedFile:s,error:l,onRemoveFile:c,onDownloadFile:d,isDownloadingFile:u,disabled:p,className:m,labels:f}=t,h={...Yd,...f},R=s!==void 0&&s!==null,x=l!==void 0&&l!==null&&l!=="";return ie("div",{className:e("w-full",m),children:st("div",{...r,className:e("relative flex min-h-24 cursor-pointer items-center justify-center rounded-lg border-2 border-dashed bg-transparent px-4 py-5 transition-all",o===!0?"border-primary bg-[color-mix(in_oklab,var(--primary)_8%,var(--card))]":"border-input hover:border-input",R&&"border-[color-mix(in_oklab,var(--success)_60%,var(--border))] bg-[color-mix(in_oklab,var(--success)_10%,transparent)]",x&&"border-destructive bg-[color-mix(in_oklab,var(--destructive)_10%,var(--card))]",p===!0&&"cursor-not-allowed opacity-60",r?.className),children:[ie("input",{...n}),!R&&!x?ie(qd,{active:Boolean(o),activeLabel:h.dragActive,hint:h.fileTypeHint,inactiveLabel:h.dragInactive}):null,s!==void 0&&s!==null&&!x?ie(Qd,{downloadLabel:h.downloadFile,downloading:Boolean(u),downloadingLabel:h.downloadingFile,file:s,onDownload:d,onRemove:c}):null,l!==void 0&&l!==null&&l!==""?ie(Zd,{message:l,retryLabel:h.errorRetry}):null]})})},ru=eu;import{jsx as zs,jsxs as ou}from"react/jsx-runtime";var nu=i("inline-flex shrink-0 cursor-pointer items-center gap-1.5 rounded-full border font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",{defaultVariants:{active:!1,size:"md"},variants:{active:{false:"border-(--border-subtle) bg-(--bg-surface)/60 text-(--text-secondary) hover:border-(--border-default) hover:text-(--text-primary)",true:"border-[color-mix(in_oklab,var(--accent)_35%,var(--border))] bg-(--bg-accent-soft) text-(--text-primary)"},size:{md:"h-8 px-3.5 text-[13px]",sm:"h-7 px-3 text-[12px]"}}}),$s=({options:t,value:r,onValueChange:n,label:o,size:s,className:l,classes:c,...d})=>zs("div",{"aria-label":o,className:e("flex flex-wrap items-center gap-1.5",c?.root,l),...d,children:t.map((u)=>{let p=u.value===r;return ou("button",{type:"button","aria-pressed":p,disabled:u.disabled,onClick:()=>{n(u.value)},className:e(nu({active:p,size:s}),c?.chip),children:[u.label,u.count===void 0?null:zs("span",{className:e("tabular-nums text-[11px] text-(--text-muted)",c?.count),children:u.count})]},u.value)})});$s.displayName="FilterChips";var au=$s;import*as Zr from"react";import{jsx as Nt,jsxs as mu}from"react/jsx-runtime";var su=52,iu=26,Qn=4,Zn=20,lu=(t)=>({"--flow-lane":t}),Js=Zr.createContext(null),Gs=(t)=>{let r=Zr.useContext(Js);if(!r)throw Error(`${t} must be rendered inside a FlowBand.`);return r},cu=({lanes:t=1,stepHeight:r=su,laneHeight:n=iu,className:o,style:s,children:l,...c})=>{let d=Math.max(r,t*n+(t-1)*Qn),u=Zr.useMemo(()=>({height:d,stepHeight:r}),[d,r]);return Nt(Js.Provider,{value:u,children:Nt("div",{className:e("flex min-w-0 items-stretch gap-1",o),style:{height:d,...s},...c,children:l})})},du=({className:t,style:r,children:n,...o})=>{let{stepHeight:s}=Gs("FlowStep");return Nt("div",{className:e("flex min-w-0 flex-1 items-stretch self-center",t),style:{height:s,...r},...o,children:n})},js=({centers:t,height:r,colors:n,merge:o=!1})=>{let s=r/2,l=7;return Nt("svg",{"aria-hidden":!0,width:Zn,height:r,viewBox:`0 0 ${Zn} ${r}`,className:"shrink-0",style:o?{transform:"scaleX(-1)"}:void 0,children:t.map((c,d)=>{let u=n[d];return Nt("path",{style:lu(u),d:`M0 ${s}H7C13 ${s} ${Zn-6} ${c} ${Zn} ${c}`,fill:"none",strokeWidth:1.5,strokeLinecap:"round",className:u!==void 0&&u!==""?"stroke-[color-mix(in_oklab,var(--flow-lane)_45%,var(--border))]":"stroke-border"},d)})})},uu=(t,r)=>{let n=(r-Qn*(t-1))/t;return Array.from({length:t},(o,s)=>s*(n+Qn)+n/2)},pu=({lanes:t,fork:r=!0,rejoin:n=!0,label:o,className:s,...l})=>{let{height:c}=Gs("FlowBranch"),d=uu(t.length,c),u=t.map((p)=>p.color);return mu("div",{"aria-label":o,className:e("flex min-w-0 flex-1 items-stretch",s),...l,children:[r&&Nt(js,{centers:d,height:c,colors:u}),Nt("div",{className:"flex min-w-0 flex-1 flex-col",style:{gap:Qn},children:t.map((p)=>Nt("div",{className:"flex min-w-0 flex-1 items-stretch overflow-hidden",children:p.content},p.key))}),n&&Nt(js,{centers:d,height:c,colors:u,merge:!0})]})};import*as Ws from"react";import{jsx as sa,jsxs as gu}from"react/jsx-runtime";var fu=({index:t,className:r,children:n,...o},s)=>gu("div",{ref:s,className:e("grid grid-cols-[1.75rem_1fr] gap-x-3 leading-relaxed",r),...o,children:[sa("div",{className:"pt-[1px] text-right",children:sa(Fr,{className:"opacity-80",children:t})}),sa("p",{className:"text-[13px] text-muted-foreground",children:n})]}),Xs=Ws.forwardRef(fu);Xs.displayName="GuideStep";var bu=Xs;import*as tn from"react";import{jsx as Fe,jsxs as en,Fragment as hu}from"react/jsx-runtime";var Us=tn.forwardRef(function({className:r,variant:n="island",...o},s){return Fe(Ue,{ref:s,variant:n,className:e("gap-0 p-0",r),...o})});Us.displayName="HierarchyTree";var Ks=tn.forwardRef(function({title:r,icon:n,count:o,actions:s,className:l,...c},d){return en("div",{ref:d,"data-slot":"hierarchy-tree-header",className:e("flex flex-wrap items-center gap-3 border-b border-border px-4 py-3",l),...c,children:[en("div",{className:"flex min-w-0 items-center gap-2 text-sm font-medium",children:[n!==void 0&&n!==null?Fe("span",{className:"shrink-0 text-muted-foreground [&_svg]:h-4 [&_svg]:w-4",children:n}):null,Fe("span",{className:"min-w-0 truncate",children:r}),o!==void 0&&o!==null?Fe("span",{className:"rounded-full bg-muted px-2 py-0.5 text-xs font-normal text-muted-foreground",children:o}):null]}),s!==void 0&&s!==null?Fe("div",{className:"ml-auto flex flex-wrap items-center gap-2",children:s}):null]})});Ks.displayName="HierarchyTreeHeader";var Ys=tn.forwardRef(function({className:r,...n},o){return Fe("div",{ref:o,"data-slot":"hierarchy-tree-body",className:e("min-w-0",r),...n})});Ys.displayName="HierarchyTreeBody";var vu=[],qs=tn.forwardRef(function({depth:r,rails:n=vu,isLastChild:o=!1,hasChildren:s=!1,contentClassName:l,className:c,children:d,...u},p){let m=Math.max(1,r);return en("div",{ref:p,"data-slot":"hierarchy-tree-row","data-depth":m,className:e("group flex items-stretch transition-colors hover:bg-muted/40",m===1&&"border-t border-border first:border-t-0",c),...u,children:[m>1?en("div",{"aria-hidden":!0,className:"flex shrink-0 pl-5",children:[n.map((f,h)=>Fe("span",{className:"relative w-5",children:f?Fe("span",{className:"absolute inset-y-0 left-0 border-l border-(--border-subtle)"}):null},h)),Fe("span",{className:"relative w-5",children:o?Fe("span",{className:e("absolute left-0 top-0 h-[22px] rounded-bl-md border-b border-l border-(--border-subtle)",s?"w-full":"w-14")}):en(hu,{children:[Fe("span",{className:"absolute inset-y-0 left-0 border-l border-(--border-subtle)"}),Fe("span",{className:e("absolute left-0 top-[22px] border-t border-(--border-subtle)",s?"w-full":"w-14")})]})})]}):null,Fe("div",{className:e("flex min-w-0 flex-1 items-start gap-2 py-3 pl-2 pr-3",l),children:d})]})});qs.displayName="HierarchyTreeRow";var Zs=tn.forwardRef(function({expanded:r,count:n,visible:o=!0,className:s,...l},c){return en(a,{ref:c,type:"button",variant:"ghost",size:"sm",className:e("h-6 shrink-0 gap-0.5 px-1 text-xs text-muted-foreground",!o&&"invisible",s),...l,children:[Fe(C,{className:e("h-3.5 w-3.5 transition-transform",r&&"rotate-90")}),n]})});Zs.displayName="HierarchyTreeToggle";var xu=Us;import yu,{useState as wu}from"react";import{jsx as we,jsxs as Ke}from"react/jsx-runtime";var Nu=i("font-mono text-sm rounded-md overflow-hidden flex flex-col",{defaultVariants:{size:"md",variant:"default"},variants:{size:{lg:"p-4 text-base",md:"p-3",sm:"p-2 text-xs"},variant:{default:"bg-card border border-border",filled:"bg-muted",outlined:"border border-border"}}}),ia=({value:t,ancestors:r})=>{if(t===null||t===void 0)return t;if(t===!0||t===!1)return t;let n=Object.prototype.toString.call(t);if(n==="[object String]"){let o=JSON.stringify(t);return o===void 0?n:o.slice(1,-1)}if(n==="[object Number]")return Number(t);if(Array.isArray(t)){if(r.has(t))return"[Circular]";r.add(t);let o=t.map((s)=>ia({ancestors:r,value:s}));return r.delete(t),o}if(t instanceof Object){if(r.has(t))return"[Circular]";r.add(t);let o=Object.fromEntries(Object.entries(t).map(([s,l])=>[s,ia({ancestors:r,value:l})]));return r.delete(t),o}return n},Ru=(t)=>{if(t===null||t===void 0)return"text-gray-500 dark:text-gray-400";if(String(t)===t)return"text-green-600 dark:text-green-400";if(t===!0||t===!1)return"text-amber-600 dark:text-amber-400";return"text-blue-600 dark:text-blue-400"},Cu=(t)=>{if(t===null)return"null";if(t===void 0)return"undefined";if(String(t)===t)return`"${t}"`;return String(t)},Su=(t)=>t,Pu=(t)=>t!==null&&Object(t)===t,Tu=(t,r)=>{if(t)return we("span",{className:"w-4"});return r?we(v,{className:"w-4 h-4"}):we(C,{className:"w-4 h-4"})},ku=(t)=>t?{close:"]",open:"["}:{close:"}",open:"{"},Lu=(t,r,n)=>t?{name:null,path:`${n}[${r}]`}:{name:String(r),path:`${n}.${r}`},Du=({data:t,className:r,classes:n,variant:o,size:s,expandAll:l=!1,expandRoot:c=!0,indentSize:d=16,showLineNumbers:u=!1,showToolbar:p=!1,maxHeight:m,maxWidth:f,renderValue:h})=>{let R=yu.useMemo(()=>ia({ancestors:new WeakSet,value:t}),[t]),[x,S]=wu(()=>{let A={};if(c)A.root=!0;return A}),B=(A,F)=>{if(A==="root"&&x[A]===void 0)return c;return x[A]??F},E=(A)=>{S((F)=>({...F,[A]:!B(A,l)}))},P=(A)=>{S({})},k=()=>{try{let A=JSON.stringify(R,null,2);navigator.clipboard.writeText(A),ue.success("Copied to clipboard",{description:"JSON data has been copied to clipboard",duration:3000})}catch(A){console.error("Failed to copy JSON to clipboard",A),ue.error("Copy failed",{description:"Failed to copy JSON to clipboard",duration:3000})}},M={maxWidth:f??"auto"},j=(A,F,Z,X,oe)=>{let fe=[],ce=Pu(F),he=Array.isArray(F),De=ce&&Object.keys(F).length===0,Ie=ku(he),le={marginLeft:Z*d},_e=Su(X),pe=oe;if(!ce){let re=h?.(F,X);return fe.push(Ke("div",{className:"flex",children:[u&&we("div",{className:"text-gray-400 dark:text-gray-600 select-none w-8 text-right pr-2",children:pe}),Ke("div",{className:"flex min-w-0",style:le,children:[we("span",{"aria-hidden":!0,className:"mr-1 w-4 shrink-0"}),A!==null&&Ke("span",{className:"shrink-0 text-purple-600 dark:text-purple-400",children:[`"${A}":`,we("span",{className:"text-gray-600 dark:text-gray-400 mr-1",children:" "})]}),re??we("span",{className:e("min-w-0 break-all",Ru(F)),children:Cu(F)})]})]},_e)),[fe,pe+1]}let Ae=B(X,l),K=Tu(De,Ae);if(fe.push(Ke("div",{className:"flex items-start group",children:[u&&we("div",{className:"text-gray-400 dark:text-gray-600 select-none w-8 text-right pr-2",children:pe}),Ke("div",{className:"flex items-start",style:le,children:[we("button",{onClick:()=>{E(X)},className:"mr-1 w-4 h-4 mt-0.5 focus:outline-none opacity-60 hover:opacity-100","aria-label":Ae?"Collapse":"Expand",tabIndex:0,type:"button",children:K}),Ke("div",{children:[A!==null&&Ke("span",{className:"text-purple-600 dark:text-purple-400",children:[`"${A}":`,we("span",{className:"text-gray-600 dark:text-gray-400 mr-1",children:" "})]}),we("span",{className:"text-gray-600 dark:text-gray-400",children:Ie.open}),De||!Ae?Ke("span",{className:"text-gray-600 dark:text-gray-400",children:[De?"":"...",Ie.close]}):null]})]})]},`${_e}-open`)),pe+=1,Ae&&!De){let re=pe,ee=he?F.map((xe,ze)=>[ze,xe]):Object.entries(F);for(let[xe,ze]of ee){let ye=Lu(he,xe,X),[Et,U]=j(ye.name,ze,Z+1,ye.path,re);fe.push(...Et),re=U}return fe.push(Ke("div",{className:"flex",children:[u&&we("div",{className:"text-gray-400 dark:text-gray-600 select-none w-8 text-right pr-2",children:re}),we("div",{className:"text-gray-600 dark:text-gray-400",style:le,children:Ie.close})]},`${_e}-close`)),re+=1,[fe,re]}return[fe,pe]},[D]=j(null,R,0,"root",1);return Ke("div",{className:e(Nu({size:s,variant:o}),n?.root,r),style:M,children:[p&&Ke("div",{className:e("flex justify-between items-center px-3 py-2 border-b border-border bg-muted/50",n?.toolbar),children:[we("div",{className:"text-sm font-medium",children:"JSON Viewer"}),Ke("div",{className:"flex gap-2",children:[we(a,{size:"sm",variant:"outline",onClick:()=>{P(!0)},children:"Expand All"}),we(a,{size:"sm",variant:"outline",onClick:()=>{P(!1)},children:"Collapse All"}),Ke(a,{size:"sm",variant:"outline",onClick:k,children:[we(ne,{className:"w-4 h-4 mr-1"}),"Copy"]})]})]}),we("div",{className:e("overflow-auto flex-1",n?.content),style:{maxHeight:m??void 0},children:D})]})},la=Du;import{useId as Eu,useState as Mu}from"react";import Iu from"react-markdown";import{jsx as Ct,jsxs as ca,Fragment as Ou}from"react/jsx-runtime";var Qs=({mode:t,onModeChange:r,labels:n,disabled:o=!1,className:s})=>{let l=t==="write"?"preview":"write",c=l==="write"?n.write:n.preview,d=l==="write"?n.writeTitle??n.write:n.previewTitle??n.preview;return Ct(a,{type:"button",variant:"ghost",size:"icon",className:e("size-7",s),disabled:o,"aria-label":c,title:d,onClick:()=>{r(l)},children:l==="preview"?Ct(Ve,{className:"size-3.5 text-muted-foreground"}):Ct(Vo,{className:"size-3.5 text-muted-foreground"})})},Au=({label:t,value:r,onValueChange:n,emptyPreview:o,toggleLabels:s,mode:l,defaultMode:c="write",onModeChange:d,previewValue:u=r,disabled:p=!1,placeholder:m,editorId:f,showHeader:h=!0,footer:R,className:x,editorClassName:S,previewClassName:B,textareaProps:E})=>{let P=Eu(),k=f??P,[M,j]=Mu(c),D=l??M,A=(F)=>{if(l===void 0)j(F);d?.(F)};return ca("div",{className:e("grid gap-2",x),children:[h&&ca("div",{className:"flex items-center justify-between gap-3",children:[Ct(I,{htmlFor:D==="write"?k:void 0,children:t}),Ct(Qs,{mode:D,onModeChange:A,labels:s,disabled:p})]}),D==="write"?ca(Ou,{children:[Ct(Q,{...E,id:k,value:r,disabled:p,placeholder:m,"aria-label":h?E?.["aria-label"]:E?.["aria-label"]??t,className:e("min-h-48 resize-y font-mono text-sm",S),onChange:(F)=>{n(F.target.value)}}),R]}):Ct("div",{"aria-label":`${t} ${s.preview}`,className:e("prose prose-sm max-w-none rounded-lg border bg-muted/30 p-4 dark:prose-invert [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",B),children:u.trim()?Ct(Iu,{children:u}):Ct("div",{className:"not-prose text-muted-foreground",children:o})})]})};import{jsx as to,jsxs as Vu}from"react/jsx-runtime";var Hu=({open:t,onOpenChange:r,title:n="JSON Viewer",data:o,jsonViewerProps:s})=>to(N,{open:t,onOpenChange:r,children:Vu(O,{className:"max-w-2xl max-h-[80vh] flex flex-col",children:[to(V,{children:to(_,{children:n})}),to(la,{data:o,className:"min-h-0 flex-1",variant:"filled",size:"sm",showToolbar:!0,expandAll:!1,expandRoot:!0,...s})]})});import*as ti from"react";import{jsx as ei,jsxs as da}from"react/jsx-runtime";var ri=ti.forwardRef(function({id:r,label:n,optionalLabel:o,help:s,error:l,className:c,children:d,...u},p){return da("div",{ref:p,className:e("grid content-start gap-2",c),...u,children:[da(I,{htmlFor:r,children:[n,o===void 0?null:da("span",{className:"font-normal text-muted-foreground",children:["(",o,")"]})]}),d,l===void 0?null:ei("p",{role:"alert",className:"text-sm text-destructive",children:l}),l===void 0&&s!==void 0&&s!==""?ei("p",{className:"text-xs leading-relaxed text-muted-foreground",children:s}):null]})});ri.displayName="LabeledField";var Bu=ri;import{jsx as ni,jsxs as oi}from"react/jsx-runtime";var Fu=({href:t,children:r,className:n,external:o=!1,linkComponent:s})=>{let l=e("inline-flex items-center gap-1 text-primary hover:underline",n);if(o||!s)return oi("a",{href:t,...o?{rel:"noopener noreferrer",target:"_blank"}:{},className:l,children:[r,ni(It,{className:"h-3 w-3"})]});return oi(s,{to:t,className:l,children:[r,ni(It,{className:"h-3 w-3"})]})};import{useState as _u}from"react";import{jsx as ao,jsxs as $u}from"react/jsx-runtime";var zu=({value:t,isSensitive:r=!1,className:n,maskChar:o="•",showToggle:s=!0,showLabel:l="Show value",hideLabel:c="Hide value",truncate:d=!0,children:u})=>{let[p,m]=_u(!r),h=p?t:(()=>{if(t.startsWith("{")||t.startsWith("["))return`{ ${o.repeat(10)} }`;return o.repeat(Math.min(t.length,20))})(),R=d?h.slice(0,50)+(h.length>50?"...":""):h,x=p?c:l,S=r&&s?ao(a,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6",onClick:()=>{m(!p)},title:x,"aria-label":x,children:p?ao(St,{className:"h-3 w-3"}):ao(Ve,{className:"h-3 w-3"})}):null;if(u!==void 0)return u({displayValue:R,toggle:S});return $u("div",{className:e("flex items-center gap-2",n),children:[ao("code",{className:"text-sm bg-muted px-2 py-1 rounded flex-1 break-all",children:R}),S]})};import*as ii from"react";import{jsx as ai,jsxs as si}from"react/jsx-runtime";var li=ii.forwardRef(function({icon:r,text:n,trailing:o,className:s,...l},c){return si("div",{ref:c,className:e("flex min-w-0 items-center gap-2",s),...l,children:[si("div",{className:"flex min-w-0 flex-1 items-center gap-2 border-b border-dashed border-border py-2 text-[13px] text-muted-foreground",children:[r!==null&&r!==void 0?ai("span",{className:"text-primary/70",children:r}):null,ai("span",{className:"min-w-0 truncate",children:n})]}),o]})});li.displayName="MutedPlaceholder";var ju=li;import{useMemo as Ju,useState as Gu}from"react";import{jsx as Ye,jsxs as so}from"react/jsx-runtime";var ua=({value:t,ancestors:r})=>{if(t===null||t===void 0)return t;if(t===!0||t===!1)return t;let n=Object.prototype.toString.call(t);if(n==="[object String]")return String.prototype.valueOf.call(t);if(n==="[object Number]")return Number(t);if(Array.isArray(t)){if(r.has(t))return;r.add(t);let o=t.map((s)=>ua({ancestors:r,value:s}));return r.delete(t),o}if(t instanceof Object){if(r.has(t))return;r.add(t);let o=Object.fromEntries(Object.entries(t).map(([s,l])=>[s,ua({ancestors:r,value:l})]));return r.delete(t),o}return},ft=(t)=>{if(t instanceof Object&&!Array.isArray(t))return t;return},dr=(t)=>Array.isArray(t)?t:void 0,ci=(t)=>Object.prototype.toString.call(t)==="[object String]"&&t===String.prototype.valueOf.call(t),pa=(t)=>ci(t)?t:void 0,Wu=(t)=>dr(t)?.filter(ci)??[],Xu=(t)=>{let r=dr(t.anyOf);if(!r)return t;let n=r.filter((o)=>ft(o)?.type!=="null");return n.length===1?ft(n[0])??t:t},di=(t)=>{let r=pa(t.type);if(r!==void 0&&r!=="")return r;if(dr(t.enum))return"enum";if(dr(t.oneOf)||dr(t.anyOf))return"variant";if(ft(t.properties))return"object";return"value"},ui=(t,r="schema")=>{let n=ft(t.properties);if(n){let s=new Set(Wu(t.required));return Object.entries(n).flatMap(([l,c])=>{let d=ft(c);return d?[{name:l,path:`${r}.properties.${l}`,required:s.has(l),schema:d}]:[]})}if(di(t)==="array"){let s=ft(t.items);return s?[{name:"Items",path:`${r}.items`,required:!0,schema:s}]:[]}let o=dr(t.oneOf)??dr(t.anyOf)??dr(t.allOf);if(!o)return[];return o.flatMap((s,l)=>{let c=ft(s);return c?[{name:`Option ${l+1}`,path:`${r}.option.${l}`,required:!0,schema:c}]:[]})},ma=(t,r,n=new Set)=>{let o=Xu(t),s=pa(o.$ref);if(s===void 0||s===""||!s.startsWith("#/$defs/")||n.has(s))return o;let l=ft(ft(r.$defs)?.[s.slice(8)]);if(!l)return o;return ma(l,r,new Set([...n,s]))},pi=({child:t,depth:r,root:n,defaultExpandedDepth:o})=>{let s=ma(t.schema,n),l=ui(s,t.path),[c,d]=Gu(r<o),u=di(s),p=pa(s.description),m=l.length>0,f=c?`Collapse ${t.name}`:`Expand ${t.name}`;return so(Te,{open:c,onOpenChange:d,children:[so("div",{className:e("flex min-w-0 items-start border-b border-border/70 bg-background px-2.5 py-2 last:border-b-0",m&&"gap-2"),style:{paddingLeft:`${10+r*16}px`},children:[m?Ye(Ee,{"aria-label":f,className:"mt-0.5 shrink-0 rounded-sm text-muted-foreground outline-none transition hover:text-foreground focus-visible:ring-2 focus-visible:ring-primary/40",children:Ye(C,{className:e("size-3.5 transition-transform",c&&"rotate-90")})}):null,so("div",{className:"min-w-0 flex-1",children:[so("div",{className:"flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1",children:[Ye("span",{className:"break-all text-xs font-medium text-foreground",children:t.name}),Ye("span",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:u}),t.required?Ye("span",{className:"text-[10px] font-medium text-destructive",children:"required"}):null]}),p!==void 0&&p!==""?Ye("p",{className:"mt-0.5 text-xs leading-snug text-muted-foreground",children:p}):null]})]}),m?Ye(ke,{children:Ye("div",{className:"border-l border-border/70",children:l.map((h)=>Ye(pi,{child:h,defaultExpandedDepth:o,depth:r+1,root:n},h.path))})}):null]})},Uu=({schema:t,className:r,defaultExpandedDepth:n=1,emptyLabel:o="No fields"})=>{let s=Ju(()=>ua({ancestors:new WeakSet,value:t}),[t]),l=ft(s);if(!l)return Ye("p",{className:e("text-xs text-muted-foreground",r),children:o});let c=ma(l,l),d=ui(c);if(!d.length)return Ye("p",{className:e("text-xs text-muted-foreground",r),children:o});return Ye("div",{"aria-label":"Object schema",className:e("overflow-hidden rounded-lg border border-border",r),children:d.map((u)=>Ye(pi,{child:u,defaultExpandedDepth:n,depth:0,root:l},u.path))})};import gt,{createContext as Ln,useContext as cn,useEffect as me,useState as it,useCallback as lt,useMemo as be,useRef as Pe,memo as tp,useReducer as rp,cloneElement as Jh,forwardRef as Gh}from"react";import{createPortal as np,unstable_batchedUpdates as fo}from"react-dom";import{useMemo as ga,useLayoutEffect as Ku,useEffect as fi,useRef as rn,useCallback as io}from"react";function gi(){for(var t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];return ga(()=>(o)=>{r.forEach((s)=>s(o))},r)}var Cn=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function yr(t){let r=Object.prototype.toString.call(t);return r==="[object Window]"||r==="[object global]"}function lo(t){return"nodeType"in t}function Oe(t){var r,n;if(!t)return window;if(yr(t))return t;if(!lo(t))return window;return(r=(n=t.ownerDocument)==null?void 0:n.defaultView)!=null?r:window}function co(t){let{Document:r}=Oe(t);return t instanceof r}function nn(t){if(yr(t))return!1;return t instanceof Oe(t).HTMLElement}function ba(t){return t instanceof Oe(t).SVGElement}function wr(t){if(!t)return document;if(yr(t))return t.document;if(!lo(t))return document;if(co(t))return t;if(nn(t)||ba(t))return t.ownerDocument;return document}var nt=Cn?Ku:fi;function uo(t){let r=rn(t);return nt(()=>{r.current=t}),io(function(){for(var n=arguments.length,o=Array(n),s=0;s<n;s++)o[s]=arguments[s];return r.current==null?void 0:r.current(...o)},[])}function bi(){let t=rn(null),r=io((o,s)=>{t.current=setInterval(o,s)},[]),n=io(()=>{if(t.current!==null)clearInterval(t.current),t.current=null},[]);return[r,n]}function on(t,r){if(r===void 0)r=[t];let n=rn(t);return nt(()=>{if(n.current!==t)n.current=t},r),n}function an(t,r){let n=rn();return ga(()=>{let o=t(n.current);return n.current=o,o},[...r])}function Sn(t){let r=uo(t),n=rn(null),o=io((s)=>{if(s!==n.current)r==null||r(s,n.current);n.current=s},[]);return[n,o]}function po(t){let r=rn();return fi(()=>{r.current=t},[t]),r.current}var fa={};function Nr(t,r){return ga(()=>{if(r)return r;let n=fa[t]==null?0:fa[t]+1;return fa[t]=n,t+"-"+n},[t,r])}function vi(t){return function(r){for(var n=arguments.length,o=Array(n>1?n-1:0),s=1;s<n;s++)o[s-1]=arguments[s];return o.reduce((l,c)=>{let d=Object.entries(c);for(let[u,p]of d){let m=l[u];if(m!=null)l[u]=m+t*p}return l},{...r})}}var Rr=vi(1),Cr=vi(-1);function Yu(t){return"clientX"in t&&"clientY"in t}function Pn(t){if(!t)return!1;let{KeyboardEvent:r}=Oe(t.target);return r&&t instanceof r}function qu(t){if(!t)return!1;let{TouchEvent:r}=Oe(t.target);return r&&t instanceof r}function mo(t){if(qu(t)){if(t.touches&&t.touches.length){let{clientX:r,clientY:n}=t.touches[0];return{x:r,y:n}}else if(t.changedTouches&&t.changedTouches.length){let{clientX:r,clientY:n}=t.changedTouches[0];return{x:r,y:n}}}if(Yu(t))return{x:t.clientX,y:t.clientY};return null}var ur=Object.freeze({Translate:{toString(t){if(!t)return;let{x:r,y:n}=t;return"translate3d("+(r?Math.round(r):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(t){if(!t)return;let{scaleX:r,scaleY:n}=t;return"scaleX("+r+") scaleY("+n+")"}},Transform:{toString(t){if(!t)return;return[ur.Translate.toString(t),ur.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:r,duration:n,easing:o}=t;return r+" "+n+"ms "+o}}}),mi="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function hi(t){if(t.matches(mi))return t;return t.querySelector(mi)}import xi,{useState as Zu,useCallback as Qu}from"react";var ep={display:"none"};function yi(t){let{id:r,value:n}=t;return xi.createElement("div",{id:r,style:ep},n)}function wi(t){let{id:r,announcement:n,ariaLiveType:o="assertive"}=t,s={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return xi.createElement("div",{id:r,style:s,role:"status","aria-live":o,"aria-atomic":!0},n)}function Ni(){let[t,r]=Zu("");return{announce:Qu((o)=>{if(o!=null)r(o)},[]),announcement:t}}var Oi=Ln(null);function op(t){let r=cn(Oi);me(()=>{if(!r)throw Error("useDndMonitor must be used within a children of <DndContext>");return r(t)},[t,r])}function ap(){let[t]=it(()=>new Set),r=lt((o)=>(t.add(o),()=>t.delete(o)),[t]);return[lt((o)=>{let{type:s,event:l}=o;t.forEach((c)=>{var d;return(d=c[s])==null?void 0:d.call(c,l)})},[t]),r]}var sp={draggable:`
3
3
  To pick up a draggable item, press the space bar.
4
4
  While dragging, use the arrow keys to move the item.
5
5
  Press space again to drop the item in its new position, or press escape to cancel.
6
- `},xp={onDragStart(t){let{active:r}=t;return"Picked up draggable item "+r.id+"."},onDragOver(t){let{active:r,over:o}=t;if(o)return"Draggable item "+r.id+" was moved over droppable area "+o.id+".";return"Draggable item "+r.id+" is no longer over a droppable area."},onDragEnd(t){let{active:r,over:o}=t;if(o)return"Draggable item "+r.id+" was dropped over droppable area "+o.id;return"Draggable item "+r.id+" was dropped."},onDragCancel(t){let{active:r}=t;return"Dragging was cancelled. Draggable item "+r.id+" was dropped."}};function yp(t){let{announcements:r=xp,container:o,hiddenTextDescribedById:a,screenReaderInstructions:s=hp}=t,{announce:i,announcement:l}=Ti(),c=jr("DndLiveRegion"),[d,u]=Xt(!1);if(xe(()=>{u(!0)},[]),bp(Ne(()=>({onDragStart(b){let{active:w}=b;i(r.onDragStart({active:w}))},onDragMove(b){let{active:w,over:P}=b;if(r.onDragMove)i(r.onDragMove({active:w,over:P}))},onDragOver(b){let{active:w,over:P}=b;i(r.onDragOver({active:w,over:P}))},onDragEnd(b){let{active:w,over:P}=b;i(r.onDragEnd({active:w,over:P}))},onDragCancel(b){let{active:w,over:P}=b;i(r.onDragCancel({active:w,over:P}))}}),[i,r])),!d)return null;let g=rr.createElement(rr.Fragment,null,rr.createElement(Si,{id:a,value:s.draggable}),rr.createElement(Pi,{id:c,announcement:l}));return o?gp(g,o):g}var we;(function(t){t.DragStart="dragStart",t.DragMove="dragMove",t.DragEnd="dragEnd",t.DragCancel="dragCancel",t.DragOver="dragOver",t.RegisterDroppable="registerDroppable",t.SetDroppableDisabled="setDroppableDisabled",t.UnregisterDroppable="unregisterDroppable"})(we||(we={}));function Ro(){}function Ra(t,r){return Ne(()=>({sensor:t,options:r!=null?r:{}}),[t,r])}function zi(){for(var t=arguments.length,r=Array(t),o=0;o<t;o++)r[o]=arguments[o];return Ne(()=>[...r].filter((a)=>a!=null),[...r])}var Yt=Object.freeze({x:0,y:0});function $i(t,r){return Math.sqrt(Math.pow(t.x-r.x,2)+Math.pow(t.y-r.y,2))}function Ji(t,r){let{data:{value:o}}=t,{data:{value:a}}=r;return o-a}function wp(t,r){let{data:{value:o}}=t,{data:{value:a}}=r;return a-o}function ki(t){let{left:r,top:o,height:a,width:s}=t;return[{x:r,y:o},{x:r+s,y:o},{x:r,y:o+a},{x:r+s,y:o+a}]}function Ca(t,r){if(!t||t.length===0)return null;let[o]=t;return r?o[r]:o}function Li(t,r,o){if(r===void 0)r=t.left;if(o===void 0)o=t.top;return{x:r+t.width*0.5,y:o+t.height*0.5}}var ji=(t)=>{let{collisionRect:r,droppableRects:o,droppableContainers:a}=t,s=Li(r,r.left,r.top),i=[];for(let l of a){let{id:c}=l,d=o.get(c);if(d){let u=$i(Li(d),s);i.push({id:c,data:{droppableContainer:l,value:u}})}}return i.sort(Ji)},Gi=(t)=>{let{collisionRect:r,droppableRects:o,droppableContainers:a}=t,s=ki(r),i=[];for(let l of a){let{id:c}=l,d=o.get(c);if(d){let u=ki(d),g=s.reduce((w,P,C)=>w+$i(u[C],P),0),b=Number((g/4).toFixed(4));i.push({id:c,data:{droppableContainer:l,value:b}})}}return i.sort(Ji)};function Np(t,r){let o=Math.max(r.top,t.top),a=Math.max(r.left,t.left),s=Math.min(r.left+r.width,t.left+t.width),i=Math.min(r.top+r.height,t.top+t.height),l=s-a,c=i-o;if(a<s&&o<i){let d=r.width*r.height,u=t.width*t.height,g=l*c,b=g/(d+u-g);return Number(b.toFixed(4))}return 0}var Rp=(t)=>{let{collisionRect:r,droppableRects:o,droppableContainers:a}=t,s=[];for(let i of a){let{id:l}=i,c=o.get(l);if(c){let d=Np(c,r);if(d>0)s.push({id:l,data:{droppableContainer:i,value:d}})}}return s.sort(wp)};function Cp(t,r,o){return{...t,scaleX:r&&o?r.width/o.width:1,scaleY:r&&o?r.height/o.height:1}}function Wi(t,r){return t&&r?{x:t.left-r.left,y:t.top-r.top}:Yt}function Sp(t){return function(o){for(var a=arguments.length,s=Array(a>1?a-1:0),i=1;i<a;i++)s[i-1]=arguments[i];return s.reduce((l,c)=>({...l,top:l.top+t*c.y,bottom:l.bottom+t*c.y,left:l.left+t*c.x,right:l.right+t*c.x}),{...o})}}var Pp=Sp(1);function Tp(t){if(t.startsWith("matrix3d(")){let r=t.slice(9,-1).split(/, /);return{x:+r[12],y:+r[13],scaleX:+r[0],scaleY:+r[5]}}else if(t.startsWith("matrix(")){let r=t.slice(7,-1).split(/, /);return{x:+r[4],y:+r[5],scaleX:+r[0],scaleY:+r[3]}}return null}function kp(t,r,o){let a=Tp(r);if(!a)return t;let{scaleX:s,scaleY:i,x:l,y:c}=a,d=t.left-l-(1-s)*parseFloat(o),u=t.top-c-(1-i)*parseFloat(o.slice(o.indexOf(" ")+1)),g=s?t.width/s:t.width,b=i?t.height/i:t.height;return{width:g,height:b,top:u,right:d+g,bottom:u+b,left:d}}var Lp={ignoreTransform:!1};function Xr(t,r){if(r===void 0)r=Lp;let o=t.getBoundingClientRect();if(r.ignoreTransform){let{transform:u,transformOrigin:g}=ze(t).getComputedStyle(t);if(u)o=kp(o,u,g)}let{top:a,left:s,width:i,height:l,bottom:c,right:d}=o;return{top:a,left:s,width:i,height:l,bottom:c,right:d}}function Di(t){return Xr(t,{ignoreTransform:!0})}function Dp(t){let{innerWidth:r,innerHeight:o}=t;return{top:0,left:0,right:r,bottom:o,width:r,height:o}}function Ep(t,r){if(r===void 0)r=ze(t).getComputedStyle(t);return r.position==="fixed"}function Mp(t,r){if(r===void 0)r=ze(t).getComputedStyle(t);let o=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some((s)=>{let i=r[s];return typeof i==="string"?o.test(i):!1})}function _n(t,r){let o=[];function a(s){if(r!=null&&o.length>=r)return o;if(!s)return o;if(vo(s)&&s.scrollingElement!=null&&!o.includes(s.scrollingElement))return o.push(s.scrollingElement),o;if(!gn(s)||ba(s))return o;if(o.includes(s))return o;let i=ze(t).getComputedStyle(s);if(s!==t){if(Mp(s,i))o.push(s)}if(Ep(s,i))return o;return a(s.parentNode)}if(!t)return o;return a(t)}function Xi(t){let[r]=_n(t,1);return r!=null?r:null}function va(t){if(!An||!t)return null;if($r(t))return t;if(!bo(t))return null;if(vo(t)||t===Jr(t).scrollingElement)return window;if(gn(t))return t;return null}function Ui(t){if($r(t))return t.scrollX;return t.scrollLeft}function Ki(t){if($r(t))return t.scrollY;return t.scrollTop}function ya(t){return{x:Ui(t),y:Ki(t)}}var Te;(function(t){t[t.Forward=1]="Forward",t[t.Backward=-1]="Backward"})(Te||(Te={}));function Yi(t){if(!An||!t)return!1;return t===document.scrollingElement}function qi(t){let r={x:0,y:0},o=Yi(t)?{height:window.innerHeight,width:window.innerWidth}:{height:t.clientHeight,width:t.clientWidth},a={x:t.scrollWidth-o.width,y:t.scrollHeight-o.height},s=t.scrollTop<=r.y,i=t.scrollLeft<=r.x,l=t.scrollTop>=a.y,c=t.scrollLeft>=a.x;return{isTop:s,isLeft:i,isBottom:l,isRight:c,maxScroll:a,minScroll:r}}var Ip={x:0.2,y:0.2};function Ap(t,r,o,a,s){let{top:i,left:l,right:c,bottom:d}=o;if(a===void 0)a=10;if(s===void 0)s=Ip;let{isTop:u,isBottom:g,isLeft:b,isRight:w}=qi(t),P={x:0,y:0},C={x:0,y:0},A={height:r.height*s.y,width:r.width*s.x};if(!u&&i<=r.top+A.height)P.y=Te.Backward,C.y=a*Math.abs((r.top+A.height-i)/A.height);else if(!g&&d>=r.bottom-A.height)P.y=Te.Forward,C.y=a*Math.abs((r.bottom-A.height-d)/A.height);if(!w&&c>=r.right-A.width)P.x=Te.Forward,C.x=a*Math.abs((r.right-A.width-c)/A.width);else if(!b&&l<=r.left+A.width)P.x=Te.Backward,C.x=a*Math.abs((r.left+A.width-l)/A.width);return{direction:P,speed:C}}function Op(t){if(t===document.scrollingElement){let{innerWidth:i,innerHeight:l}=window;return{top:0,left:0,right:i,bottom:l,width:i,height:l}}let{top:r,left:o,right:a,bottom:s}=t.getBoundingClientRect();return{top:r,left:o,right:a,bottom:s,width:t.clientWidth,height:t.clientHeight}}function Zi(t){return t.reduce((r,o)=>Gr(r,ya(o)),Yt)}function Hp(t){return t.reduce((r,o)=>r+Ui(o),0)}function Vp(t){return t.reduce((r,o)=>r+Ki(o),0)}function Bp(t,r){if(r===void 0)r=Xr;if(!t)return;let{top:o,left:a,bottom:s,right:i}=r(t);if(!Xi(t))return;if(s<=0||i<=0||o>=window.innerHeight||a>=window.innerWidth)t.scrollIntoView({block:"center",inline:"center"})}var Fp=[["x",["left","right"],Hp],["y",["top","bottom"],Vp]];class So{constructor(t,r){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;let o=_n(r),a=Zi(o);this.rect={...t},this.width=t.width,this.height=t.height;for(let[s,i,l]of Fp)for(let c of i)Object.defineProperty(this,c,{get:()=>{let d=l(o),u=a[s]-d;return this.rect[c]+u},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class hn{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach((r)=>{var o;return(o=this.target)==null?void 0:o.removeEventListener(...r)})},this.target=t}add(t,r,o){var a;(a=this.target)==null||a.addEventListener(t,r,o),this.listeners.push([t,r,o])}}function _p(t){let{EventTarget:r}=ze(t);return t instanceof r?t:Jr(t)}function ha(t,r){let o=Math.abs(t.x),a=Math.abs(t.y);if(typeof r==="number")return Math.sqrt(o**2+a**2)>r;if("x"in r&&"y"in r)return o>r.x&&a>r.y;if("x"in r)return o>r.x;if("y"in r)return a>r.y;return!1}var Jt;(function(t){t.Click="click",t.DragStart="dragstart",t.Keydown="keydown",t.ContextMenu="contextmenu",t.Resize="resize",t.SelectionChange="selectionchange",t.VisibilityChange="visibilitychange"})(Jt||(Jt={}));function Ei(t){t.preventDefault()}function zp(t){t.stopPropagation()}var re;(function(t){t.Space="Space",t.Down="ArrowDown",t.Right="ArrowRight",t.Left="ArrowLeft",t.Up="ArrowUp",t.Esc="Escape",t.Enter="Enter",t.Tab="Tab"})(re||(re={}));var Qi={start:[re.Space,re.Enter],cancel:[re.Esc],end:[re.Space,re.Enter,re.Tab]},$p=(t,r)=>{let{currentCoordinates:o}=r;switch(t.code){case re.Right:return{...o,x:o.x+25};case re.Left:return{...o,x:o.x-25};case re.Down:return{...o,y:o.y+25};case re.Up:return{...o,y:o.y-25}}return};class zn{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;let{event:{target:r}}=t;this.props=t,this.listeners=new hn(Jr(r)),this.windowListeners=new hn(ze(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Jt.Resize,this.handleCancel),this.windowListeners.add(Jt.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Jt.Keydown,this.handleKeyDown))}handleStart(){let{activeNode:t,onStart:r}=this.props,o=t.node.current;if(o)Bp(o);r(Yt)}handleKeyDown(t){if(Hn(t)){let{active:r,context:o,options:a}=this.props,{keyboardCodes:s=Qi,coordinateGetter:i=$p,scrollBehavior:l="smooth"}=a,{code:c}=t;if(s.end.includes(c)){this.handleEnd(t);return}if(s.cancel.includes(c)){this.handleCancel(t);return}let{collisionRect:d}=o.current,u=d?{x:d.left,y:d.top}:Yt;if(!this.referenceCoordinates)this.referenceCoordinates=u;let g=i(t,{active:r,context:o.current,currentCoordinates:u});if(g){let b=Wr(g,u),w={x:0,y:0},{scrollableAncestors:P}=o.current;for(let C of P){let A=t.code,{isTop:j,isRight:B,isLeft:O,isBottom:H,maxScroll:F,minScroll:X}=qi(C),V=Op(C),_={x:Math.min(A===re.Right?V.right-V.width/2:V.right,Math.max(A===re.Right?V.left:V.left+V.width/2,g.x)),y:Math.min(A===re.Down?V.bottom-V.height/2:V.bottom,Math.max(A===re.Down?V.top:V.top+V.height/2,g.y))},W=A===re.Right&&!B||A===re.Left&&!O,oe=A===re.Down&&!H||A===re.Up&&!j;if(W&&_.x!==g.x){let K=C.scrollLeft+b.x,de=A===re.Right&&K<=F.x||A===re.Left&&K>=X.x;if(de&&!b.y){C.scrollTo({left:K,behavior:l});return}if(de)w.x=C.scrollLeft-K;else w.x=A===re.Right?C.scrollLeft-F.x:C.scrollLeft-X.x;if(w.x)C.scrollBy({left:-w.x,behavior:l});break}else if(oe&&_.y!==g.y){let K=C.scrollTop+b.y,de=A===re.Down&&K<=F.y||A===re.Up&&K>=X.y;if(de&&!b.x){C.scrollTo({top:K,behavior:l});return}if(de)w.y=C.scrollTop-K;else w.y=A===re.Down?C.scrollTop-F.y:C.scrollTop-X.y;if(w.y)C.scrollBy({top:-w.y,behavior:l});break}}this.handleMove(t,Gr(Wr(g,this.referenceCoordinates),w))}}}handleMove(t,r){let{onMove:o}=this.props;t.preventDefault(),o(r)}handleEnd(t){let{onEnd:r}=this.props;t.preventDefault(),this.detach(),r()}handleCancel(t){let{onCancel:r}=this.props;t.preventDefault(),this.detach(),r()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}zn.activators=[{eventName:"onKeyDown",handler:(t,r,o)=>{let{keyboardCodes:a=Qi,onActivation:s}=r,{active:i}=o,{code:l}=t.nativeEvent;if(a.start.includes(l)){let c=i.activatorNode.current;if(c&&t.target!==c)return!1;return t.preventDefault(),s==null||s({event:t.nativeEvent}),!0}return!1}}];function Mi(t){return Boolean(t&&"distance"in t)}function Ii(t){return Boolean(t&&"delay"in t)}class Po{constructor(t,r,o){var a;if(o===void 0)o=_p(t.event.target);this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=r;let{event:s}=t,{target:i}=s;this.props=t,this.events=r,this.document=Jr(i),this.documentListeners=new hn(this.document),this.listeners=new hn(o),this.windowListeners=new hn(ze(i)),this.initialCoordinates=(a=yo(s))!=null?a:Yt,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){let{events:t,props:{options:{activationConstraint:r,bypassActivationConstraint:o}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel)this.listeners.add(t.cancel.name,this.handleCancel);if(this.windowListeners.add(Jt.Resize,this.handleCancel),this.windowListeners.add(Jt.DragStart,Ei),this.windowListeners.add(Jt.VisibilityChange,this.handleCancel),this.windowListeners.add(Jt.ContextMenu,Ei),this.documentListeners.add(Jt.Keydown,this.handleKeydown),r){if(o!=null&&o({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Ii(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(Mi(r)){this.handlePending(r);return}}this.handleStart()}detach(){if(this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null)clearTimeout(this.timeoutId),this.timeoutId=null}handlePending(t,r){let{active:o,onPending:a}=this.props;a(o,t,this.initialCoordinates,r)}handleStart(){let{initialCoordinates:t}=this,{onStart:r}=this.props;if(t)this.activated=!0,this.documentListeners.add(Jt.Click,zp,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Jt.SelectionChange,this.removeTextSelection),r(t)}handleMove(t){var r;let{activated:o,initialCoordinates:a,props:s}=this,{onMove:i,options:{activationConstraint:l}}=s;if(!a)return;let c=(r=yo(t))!=null?r:Yt,d=Wr(a,c);if(!o&&l){if(Mi(l)){if(l.tolerance!=null&&ha(d,l.tolerance))return this.handleCancel();if(ha(d,l.distance))return this.handleStart()}if(Ii(l)){if(ha(d,l.tolerance))return this.handleCancel()}this.handlePending(l,d);return}if(t.cancelable)t.preventDefault();i(c)}handleEnd(){let{onAbort:t,onEnd:r}=this.props;if(this.detach(),!this.activated)t(this.props.active);r()}handleCancel(){let{onAbort:t,onCancel:r}=this.props;if(this.detach(),!this.activated)t(this.props.active);r()}handleKeydown(t){if(t.code===re.Esc)this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}var Jp={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class $n extends Po{constructor(t){let{event:r}=t,o=Jr(r.target);super(t,Jp,o)}}$n.activators=[{eventName:"onPointerDown",handler:(t,r)=>{let{nativeEvent:o}=t,{onActivation:a}=r;if(!o.isPrimary||o.button!==0)return!1;return a==null||a({event:o}),!0}}];var jp={move:{name:"mousemove"},end:{name:"mouseup"}},wa;(function(t){t[t.RightClick=2]="RightClick"})(wa||(wa={}));class el extends Po{constructor(t){super(t,jp,Jr(t.event.target))}}el.activators=[{eventName:"onMouseDown",handler:(t,r)=>{let{nativeEvent:o}=t,{onActivation:a}=r;if(o.button===wa.RightClick)return!1;return a==null||a({event:o}),!0}}];var xa={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class tl extends Po{constructor(t){super(t,xa)}static setup(){return window.addEventListener(xa.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(xa.move.name,t)};function t(){}}}tl.activators=[{eventName:"onTouchStart",handler:(t,r)=>{let{nativeEvent:o}=t,{onActivation:a}=r,{touches:s}=o;if(s.length>1)return!1;return a==null||a({event:o}),!0}}];var Vn;(function(t){t[t.Pointer=0]="Pointer",t[t.DraggableRect=1]="DraggableRect"})(Vn||(Vn={}));var Co;(function(t){t[t.TreeOrder=0]="TreeOrder",t[t.ReversedTreeOrder=1]="ReversedTreeOrder"})(Co||(Co={}));function Gp(t){let{acceleration:r,activator:o=Vn.Pointer,canScroll:a,draggingRect:s,enabled:i,interval:l=5,order:c=Co.TreeOrder,pointerCoordinates:d,scrollableAncestors:u,scrollableAncestorRects:g,delta:b,threshold:w}=t,P=Xp({delta:b,disabled:!i}),[C,A]=wi(),j=Ee({x:0,y:0}),B=Ee({x:0,y:0}),O=Ne(()=>{switch(o){case Vn.Pointer:return d?{top:d.y,bottom:d.y,left:d.x,right:d.x}:null;case Vn.DraggableRect:return s}},[o,s,d]),H=Ee(null),F=Kt(()=>{let V=H.current;if(!V)return;let _=j.current.x*B.current.x,W=j.current.y*B.current.y;V.scrollBy(_,W)},[]),X=Ne(()=>c===Co.TreeOrder?[...u].reverse():u,[c,u]);xe(()=>{if(!i||!u.length||!O){A();return}for(let V of X){if((a==null?void 0:a(V))===!1)continue;let _=u.indexOf(V),W=g[_];if(!W)continue;let{direction:oe,speed:K}=Ap(V,W,O,r,w);for(let de of["x","y"])if(!P[de][oe[de]])K[de]=0,oe[de]=0;if(K.x>0||K.y>0){A(),H.current=V,C(F,l),j.current=K,B.current=oe;return}}j.current={x:0,y:0},B.current={x:0,y:0},A()},[r,F,a,A,i,l,JSON.stringify(O),JSON.stringify(P),C,u,X,g,JSON.stringify(w)])}var Wp={x:{[Te.Backward]:!1,[Te.Forward]:!1},y:{[Te.Backward]:!1,[Te.Forward]:!1}};function Xp(t){let{delta:r,disabled:o}=t,a=xo(r);return vn((s)=>{if(o||!a||!s)return Wp;let i={x:Math.sign(r.x-a.x),y:Math.sign(r.y-a.y)};return{x:{[Te.Backward]:s.x[Te.Backward]||i.x===-1,[Te.Forward]:s.x[Te.Forward]||i.x===1},y:{[Te.Backward]:s.y[Te.Backward]||i.y===-1,[Te.Forward]:s.y[Te.Forward]||i.y===1}}},[o,r,a])}function Up(t,r){let o=r!=null?t.get(r):void 0,a=o?o.node.current:null;return vn((s)=>{var i;if(r==null)return null;return(i=a!=null?a:s)!=null?i:null},[a,r])}function Kp(t,r){return Ne(()=>t.reduce((o,a)=>{let{sensor:s}=a,i=s.activators.map((l)=>({eventName:l.eventName,handler:r(l.handler,a)}));return[...o,...i]},[]),[t,r])}var Bn;(function(t){t[t.Always=0]="Always",t[t.BeforeDragging=1]="BeforeDragging",t[t.WhileDragging=2]="WhileDragging"})(Bn||(Bn={}));var Na;(function(t){t.Optimized="optimized"})(Na||(Na={}));var Ai=new Map;function Yp(t,r){let{dragging:o,dependencies:a,config:s}=r,[i,l]=Xt(null),{frequency:c,measure:d,strategy:u}=s,g=Ee(t),b=j(),w=bn(b),P=Kt(function(B){if(B===void 0)B=[];if(w.current)return;l((O)=>{if(O===null)return B;return O.concat(B.filter((H)=>!O.includes(H)))})},[w]),C=Ee(null),A=vn((B)=>{if(b&&!o)return Ai;if(!B||B===Ai||g.current!==t||i!=null){let O=new Map;for(let H of t){if(!H)continue;if(i&&i.length>0&&!i.includes(H.id)&&H.rect.current){O.set(H.id,H.rect.current);continue}let F=H.node.current,X=F?new So(d(F),F):null;if(H.rect.current=X,X)O.set(H.id,X)}return O}return B},[t,i,o,b,d]);return xe(()=>{g.current=t},[t]),xe(()=>{if(b)return;P()},[o,b]),xe(()=>{if(i&&i.length>0)l(null)},[JSON.stringify(i)]),xe(()=>{if(b||typeof c!=="number"||C.current!==null)return;C.current=setTimeout(()=>{P(),C.current=null},c)},[c,b,P,...a]),{droppableRects:A,measureDroppableContainers:P,measuringScheduled:i!=null};function j(){switch(u){case Bn.Always:return!1;case Bn.BeforeDragging:return o;default:return!o}}}function rl(t,r){return vn((o)=>{if(!t)return null;if(o)return o;return typeof r==="function"?r(t):t},[r,t])}function qp(t,r){return rl(t,r)}function Zp(t){let{callback:r,disabled:o}=t,a=ho(r),s=Ne(()=>{if(o||typeof window>"u"||typeof window.MutationObserver>"u")return;let{MutationObserver:i}=window;return new i(a)},[a,o]);return xe(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function To(t){let{callback:r,disabled:o}=t,a=ho(r),s=Ne(()=>{if(o||typeof window>"u"||typeof window.ResizeObserver>"u")return;let{ResizeObserver:i}=window;return new i(a)},[o]);return xe(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function Qp(t){return new So(Xr(t),t)}function Oi(t,r,o){if(r===void 0)r=Qp;let[a,s]=Xt(null);function i(){s((d)=>{if(!t)return null;if(t.isConnected===!1){var u;return(u=d!=null?d:o)!=null?u:null}let g=r(t);if(JSON.stringify(d)===JSON.stringify(g))return d;return g})}let l=Zp({callback(d){if(!t)return;for(let u of d){let{type:g,target:b}=u;if(g==="childList"&&b instanceof HTMLElement&&b.contains(t)){i();break}}}}),c=To({callback:i});return $t(()=>{if(i(),t)c==null||c.observe(t),l==null||l.observe(document.body,{childList:!0,subtree:!0});else c==null||c.disconnect(),l==null||l.disconnect()},[t]),a}function em(t){let r=rl(t);return Wi(t,r)}var Hi=[];function tm(t){let r=Ee(t),o=vn((a)=>{if(!t)return Hi;if(a&&a!==Hi&&t&&r.current&&t.parentNode===r.current.parentNode)return a;return _n(t)},[t]);return xe(()=>{r.current=t},[t]),o}function rm(t){let[r,o]=Xt(null),a=Ee(t),s=Kt((i)=>{let l=va(i.target);if(!l)return;o((c)=>{if(!c)return null;return c.set(l,ya(l)),new Map(c)})},[]);return xe(()=>{let i=a.current;if(t!==i){l(i);let c=t.map((d)=>{let u=va(d);if(u)return u.addEventListener("scroll",s,{passive:!0}),[u,ya(u)];return null}).filter((d)=>d!=null);o(c.length?new Map(c):null),a.current=t}return()=>{l(t),l(i)};function l(c){c.forEach((d)=>{let u=va(d);u==null||u.removeEventListener("scroll",s)})}},[s,t]),Ne(()=>{if(t.length)return r?Array.from(r.values()).reduce((i,l)=>Gr(i,l),Yt):Zi(t);return Yt},[t,r])}function Vi(t,r){if(r===void 0)r=[];let o=Ee(null);return xe(()=>{o.current=null},r),xe(()=>{let a=t!==Yt;if(a&&!o.current)o.current=t;if(!a&&o.current)o.current=null},[t]),o.current?Wr(t,o.current):Yt}function nm(t){xe(()=>{if(!An)return;let r=t.map((o)=>{let{sensor:a}=o;return a.setup==null?void 0:a.setup()});return()=>{for(let o of r)o==null||o()}},t.map((r)=>{let{sensor:o}=r;return o}))}function om(t,r){return Ne(()=>t.reduce((o,a)=>{let{eventName:s,handler:i}=a;return o[s]=(l)=>{i(l,r)},o},{}),[t,r])}function nl(t){return Ne(()=>t?Dp(t):null,[t])}var Bi=[];function am(t,r){if(r===void 0)r=Xr;let[o]=t,a=nl(o?ze(o):null),[s,i]=Xt(Bi);function l(){i(()=>{if(!t.length)return Bi;return t.map((d)=>Yi(d)?a:new So(r(d),d))})}let c=To({callback:l});return $t(()=>{c==null||c.disconnect(),l(),t.forEach((d)=>c==null?void 0:c.observe(d))},[t]),s}function sm(t){if(!t)return null;if(t.children.length>1)return t;let r=t.children[0];return gn(r)?r:t}function im(t){let{measure:r}=t,[o,a]=Xt(null),s=Kt((u)=>{for(let{target:g}of u)if(gn(g)){a((b)=>{let w=r(g);return b?{...b,width:w.width,height:w.height}:w});break}},[r]),i=To({callback:s}),l=Kt((u)=>{let g=sm(u);if(i==null||i.disconnect(),g)i==null||i.observe(g);a(g?r(g):null)},[r,i]),[c,d]=On(l);return Ne(()=>({nodeRef:c,rect:o,setRef:d}),[o,c,d])}var lm=[{sensor:$n,options:{}},{sensor:zn,options:{}}],cm={current:{}},No={draggable:{measure:Di},droppable:{measure:Di,strategy:Bn.WhileDragging,frequency:Na.Optimized},dragOverlay:{measure:Xr}};class xn extends Map{get(t){var r;return t!=null?(r=super.get(t))!=null?r:void 0:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter((t)=>{let{disabled:r}=t;return!r})}getNodeFor(t){var r,o;return(r=(o=this.get(t))==null?void 0:o.node.current)!=null?r:void 0}}var dm={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new xn,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Ro},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:No,measureDroppableContainers:Ro,windowRect:null,measuringScheduled:!1},um={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Ro,draggableNodes:new Map,over:null,measureDroppableContainers:Ro},ko=Fn(um),ol=Fn(dm);function pm(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new xn}}}function mm(t,r){switch(r.type){case we.DragStart:return{...t,draggable:{...t.draggable,initialCoordinates:r.initialCoordinates,active:r.active}};case we.DragMove:if(t.draggable.active==null)return t;return{...t,draggable:{...t.draggable,translate:{x:r.coordinates.x-t.draggable.initialCoordinates.x,y:r.coordinates.y-t.draggable.initialCoordinates.y}}};case we.DragEnd:case we.DragCancel:return{...t,draggable:{...t.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case we.RegisterDroppable:{let{element:o}=r,{id:a}=o,s=new xn(t.droppable.containers);return s.set(a,o),{...t,droppable:{...t.droppable,containers:s}}}case we.SetDroppableDisabled:{let{id:o,key:a,disabled:s}=r,i=t.droppable.containers.get(o);if(!i||a!==i.key)return t;let l=new xn(t.droppable.containers);return l.set(o,{...i,disabled:s}),{...t,droppable:{...t.droppable,containers:l}}}case we.UnregisterDroppable:{let{id:o,key:a}=r,s=t.droppable.containers.get(o);if(!s||a!==s.key)return t;let i=new xn(t.droppable.containers);return i.delete(o),{...t,droppable:{...t.droppable,containers:i}}}default:return t}}function fm(t){let{disabled:r}=t,{active:o,activatorEvent:a,draggableNodes:s}=yn(ko),i=xo(a),l=xo(o==null?void 0:o.id);return xe(()=>{if(r)return;if(!a&&i&&l!=null){if(!Hn(i))return;if(document.activeElement===i.target)return;let c=s.get(l);if(!c)return;let{activatorNode:d,node:u}=c;if(!d.current&&!u.current)return;requestAnimationFrame(()=>{for(let g of[d.current,u.current]){if(!g)continue;let b=Ri(g);if(b){b.focus();break}}})}},[a,r,s,l,i]),null}function gm(t,r){let{transform:o,...a}=r;return t!=null&&t.length?t.reduce((s,i)=>i({transform:s,...a}),o):o}function bm(t){return Ne(()=>({draggable:{...No.draggable,...t==null?void 0:t.draggable},droppable:{...No.droppable,...t==null?void 0:t.droppable},dragOverlay:{...No.dragOverlay,...t==null?void 0:t.dragOverlay}}),[t==null?void 0:t.draggable,t==null?void 0:t.droppable,t==null?void 0:t.dragOverlay])}function vm(t){let{activeNode:r,measure:o,initialRect:a,config:s=!0}=t,i=Ee(!1),{x:l,y:c}=typeof s==="boolean"?{x:s,y:s}:s;$t(()=>{if(!l&&!c||!r){i.current=!1;return}if(i.current||!a)return;let u=r==null?void 0:r.node.current;if(!u||u.isConnected===!1)return;let g=o(u),b=Wi(g,a);if(!l)b.x=0;if(!c)b.y=0;if(i.current=!0,Math.abs(b.x)>0||Math.abs(b.y)>0){let w=Xi(u);if(w)w.scrollBy({top:b.y,left:b.x})}},[r,l,c,a,o])}var al=Fn({...Yt,scaleX:1,scaleY:1}),Br;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Initializing=1]="Initializing",t[t.Initialized=2]="Initialized"})(Br||(Br={}));var sl=mp(function(r){var o,a,s,i;let{id:l,accessibility:c,autoScroll:d=!0,children:u,sensors:g=lm,collisionDetection:b=Rp,measuring:w,modifiers:P,...C}=r,A=fp(mm,void 0,pm),[j,B]=A,[O,H]=vp(),[F,X]=Xt(Br.Uninitialized),V=F===Br.Initialized,{draggable:{active:_,nodes:W,translate:oe},droppable:{containers:K}}=j,de=_!=null?W.get(_):null,ye=Ee({initial:null,translated:null}),ve=Ne(()=>{var Ie;return _!=null?{id:_,data:(Ie=de==null?void 0:de.data)!=null?Ie:cm,rect:ye}:null},[_,de]),Re=Ee(null),[Me,Ae]=Xt(null),[be,qe]=Xt(null),he=bn(C,Object.values(C)),_e=jr("DndDescribedBy",l),q=Ne(()=>K.getEnabled(),[K]),ce=bm(w),{droppableRects:ae,measureDroppableContainers:Ce,measuringScheduled:st}=Yp(q,{dragging:V,dependencies:[oe.x,oe.y],config:ce.droppable}),Se=Up(W,_),Rr=Ne(()=>be?yo(be):null,[be]),Y=dc(),it=qp(Se,ce.draggable.measure);vm({activeNode:_!=null?W.get(_):null,config:Y.layoutShiftCompensation,initialRect:it,measure:ce.draggable.measure});let fe=Oi(Se,ce.draggable.measure,it),Cn=Oi(Se?Se.parentElement:null),Zt=Ee({activatorEvent:null,active:null,activeNode:Se,collisionRect:null,collisions:null,droppableRects:ae,draggableNodes:W,draggingNode:null,draggingNodeRect:null,droppableContainers:K,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Zr=K.getNodeFor((o=Zt.current.over)==null?void 0:o.id),lr=im({measure:ce.dragOverlay.measure}),Qr=(a=lr.nodeRef.current)!=null?a:Se,en=V?(s=lr.rect)!=null?s:fe:null,Va=Boolean(lr.nodeRef.current&&lr.rect),Ba=em(Va?null:fe),jo=nl(Qr?ze(Qr):null),Pr=tm(V?Zr!=null?Zr:Se:null),Xn=am(Pr),Un=gm(P,{transform:{x:oe.x-Ba.x,y:oe.y-Ba.y,scaleX:1,scaleY:1},activatorEvent:be,active:ve,activeNodeRect:fe,containerNodeRect:Cn,draggingNodeRect:en,over:Zt.current.over,overlayNodeRect:lr.rect,scrollableAncestors:Pr,scrollableAncestorRects:Xn,windowRect:jo}),Fa=Rr?Gr(Rr,oe):null,_a=rm(Pr),nc=Vi(_a),oc=Vi(_a,[fe]),tn=Gr(Un,nc),rn=en?Pp(en,Un):null,Sn=ve&&rn?b({active:ve,collisionRect:rn,droppableRects:ae,droppableContainers:q,pointerCoordinates:Fa}):null,za=Ca(Sn,"id"),[Tr,$a]=Xt(null),ac=Va?Un:Gr(Un,oc),sc=Cp(ac,(i=Tr==null?void 0:Tr.rect)!=null?i:null,fe),Go=Ee(null),Ja=Kt((Ie,bt)=>{let{sensor:vt,options:kr}=bt;if(Re.current==null)return;let Lt=W.get(Re.current);if(!Lt)return;let xt=Ie.nativeEvent,Qt=new vt({active:Re.current,activeNode:Lt,event:xt,options:kr,context:Zt,onAbort(Le){if(!W.get(Le))return;let{onDragAbort:er}=he.current,cr={id:Le};er==null||er(cr),O({type:"onDragAbort",event:cr})},onPending(Le,Lr,er,cr){if(!W.get(Le))return;let{onDragPending:Tn}=he.current,Dr={id:Le,constraint:Lr,initialCoordinates:er,offset:cr};Tn==null||Tn(Dr),O({type:"onDragPending",event:Dr})},onStart(Le){let Lr=Re.current;if(Lr==null)return;let er=W.get(Lr);if(!er)return;let{onDragStart:cr}=he.current,Pn={activatorEvent:xt,active:{id:Lr,data:er.data,rect:ye}};wo(()=>{cr==null||cr(Pn),X(Br.Initializing),B({type:we.DragStart,initialCoordinates:Le,active:Lr}),O({type:"onDragStart",event:Pn}),Ae(Go.current),qe(xt)})},onMove(Le){B({type:we.DragMove,coordinates:Le})},onEnd:nn(we.DragEnd),onCancel:nn(we.DragCancel)});Go.current=Qt;function nn(Le){return async function(){let{active:er,collisions:cr,over:Pn,scrollAdjustedTranslate:Tn}=Zt.current,Dr=null;if(er&&Tn){let{cancelDrop:kn}=he.current;if(Dr={activatorEvent:xt,active:er,collisions:cr,delta:Tn,over:Pn},Le===we.DragEnd&&typeof kn==="function"){if(await Promise.resolve(kn(Dr)))Le=we.DragCancel}}Re.current=null,wo(()=>{B({type:Le}),X(Br.Uninitialized),$a(null),Ae(null),qe(null),Go.current=null;let kn=Le===we.DragEnd?"onDragEnd":"onDragCancel";if(Dr){let Wo=he.current[kn];Wo==null||Wo(Dr),O({type:kn,event:Dr})}})}}},[W]),ic=Kt((Ie,bt)=>(vt,kr)=>{let Lt=vt.nativeEvent,xt=W.get(kr);if(Re.current!==null||!xt||Lt.dndKit||Lt.defaultPrevented)return;let Qt={active:xt};if(Ie(vt,bt.options,Qt)===!0)Lt.dndKit={capturedBy:bt.sensor},Re.current=kr,Ja(vt,bt)},[W,Ja]),ja=Kp(g,ic);nm(g),$t(()=>{if(fe&&F===Br.Initializing)X(Br.Initialized)},[fe,F]),xe(()=>{let{onDragMove:Ie}=he.current,{active:bt,activatorEvent:vt,collisions:kr,over:Lt}=Zt.current;if(!bt||!vt)return;let xt={active:bt,activatorEvent:vt,collisions:kr,delta:{x:tn.x,y:tn.y},over:Lt};wo(()=>{Ie==null||Ie(xt),O({type:"onDragMove",event:xt})})},[tn.x,tn.y]),xe(()=>{let{active:Ie,activatorEvent:bt,collisions:vt,droppableContainers:kr,scrollAdjustedTranslate:Lt}=Zt.current;if(!Ie||Re.current==null||!bt||!Lt)return;let{onDragOver:xt}=he.current,Qt=kr.get(za),nn=Qt&&Qt.rect.current?{id:Qt.id,rect:Qt.rect.current,data:Qt.data,disabled:Qt.disabled}:null,Le={active:Ie,activatorEvent:bt,collisions:vt,delta:{x:Lt.x,y:Lt.y},over:nn};wo(()=>{$a(nn),xt==null||xt(Le),O({type:"onDragOver",event:Le})})},[za]),$t(()=>{Zt.current={activatorEvent:be,active:ve,activeNode:Se,collisionRect:rn,collisions:Sn,droppableRects:ae,draggableNodes:W,draggingNode:Qr,draggingNodeRect:en,droppableContainers:K,over:Tr,scrollableAncestors:Pr,scrollAdjustedTranslate:tn},ye.current={initial:en,translated:rn}},[ve,Se,Sn,rn,W,Qr,en,ae,K,Tr,Pr,tn]),Gp({...Y,delta:oe,draggingRect:rn,pointerCoordinates:Fa,scrollableAncestors:Pr,scrollableAncestorRects:Xn});let lc=Ne(()=>({active:ve,activeNode:Se,activeNodeRect:fe,activatorEvent:be,collisions:Sn,containerNodeRect:Cn,dragOverlay:lr,draggableNodes:W,droppableContainers:K,droppableRects:ae,over:Tr,measureDroppableContainers:Ce,scrollableAncestors:Pr,scrollableAncestorRects:Xn,measuringConfiguration:ce,measuringScheduled:st,windowRect:jo}),[ve,Se,fe,be,Sn,Cn,lr,W,K,ae,Tr,Ce,Pr,Xn,ce,st,jo]),cc=Ne(()=>({activatorEvent:be,activators:ja,active:ve,activeNodeRect:fe,ariaDescribedById:{draggable:_e},dispatch:B,draggableNodes:W,over:Tr,measureDroppableContainers:Ce}),[be,ja,ve,fe,B,_e,W,Tr,Ce]);return rr.createElement(_i.Provider,{value:H},rr.createElement(ko.Provider,{value:cc},rr.createElement(ol.Provider,{value:lc},rr.createElement(al.Provider,{value:sc},u)),rr.createElement(fm,{disabled:(c==null?void 0:c.restoreFocus)===!1})),rr.createElement(yp,{...c,hiddenTextDescribedById:_e}));function dc(){let Ie=(Me==null?void 0:Me.autoScrollEnabled)===!1,bt=typeof d==="object"?d.enabled===!1:d===!1,vt=V&&!Ie&&!bt;if(typeof d==="object")return{...d,enabled:vt};return{enabled:vt}}}),hm=Fn(null),Fi="button",xm="Draggable";function il(t){let{id:r,data:o,disabled:a=!1,attributes:s}=t,i=jr(xm),{activators:l,activatorEvent:c,active:d,activeNodeRect:u,ariaDescribedById:g,draggableNodes:b,over:w}=yn(ko),{role:P=Fi,roleDescription:C="draggable",tabIndex:A=0}=s!=null?s:{},j=(d==null?void 0:d.id)===r,B=yn(j?al:hm),[O,H]=On(),[F,X]=On(),V=om(l,r),_=bn(o);$t(()=>(b.set(r,{id:r,key:i,node:O,activatorNode:F,data:_}),()=>{let oe=b.get(r);if(oe&&oe.key===i)b.delete(r)}),[b,r]);let W=Ne(()=>({role:P,tabIndex:A,"aria-disabled":a,"aria-pressed":j&&P===Fi?!0:void 0,"aria-roledescription":C,"aria-describedby":g.draggable}),[a,P,A,j,C,g.draggable]);return{active:d,activatorEvent:c,activeNodeRect:u,attributes:W,isDragging:j,listeners:a?void 0:V,node:O,over:w,setNodeRef:H,setActivatorNodeRef:X,transform:B}}function ll(){return yn(ol)}var ym="Droppable",wm={timeout:25};function cl(t){let{data:r,disabled:o=!1,id:a,resizeObserverConfig:s}=t,i=jr(ym),{active:l,dispatch:c,over:d,measureDroppableContainers:u}=yn(ko),g=Ee({disabled:o}),b=Ee(!1),w=Ee(null),P=Ee(null),{disabled:C,updateMeasurementsFor:A,timeout:j}={...wm,...s},B=bn(A!=null?A:a),O=Kt(()=>{if(!b.current){b.current=!0;return}if(P.current!=null)clearTimeout(P.current);P.current=setTimeout(()=>{u(Array.isArray(B.current)?B.current:[B.current]),P.current=null},j)},[j]),H=To({callback:O,disabled:C||!l}),F=Kt((W,oe)=>{if(!H)return;if(oe)H.unobserve(oe),b.current=!1;if(W)H.observe(W)},[H]),[X,V]=On(F),_=bn(r);return xe(()=>{if(!H||!X.current)return;H.disconnect(),b.current=!1,H.observe(X.current)},[X,H]),xe(()=>(c({type:we.RegisterDroppable,element:{id:a,key:i,disabled:o,node:X,rect:w,data:_}}),()=>c({type:we.UnregisterDroppable,key:i,id:a})),[a]),xe(()=>{if(o!==g.current.disabled)c({type:we.SetDroppableDisabled,id:a,key:i,disabled:o}),g.current.disabled=o},[a,i,o,c]),{active:l,rect:w,isOver:(d==null?void 0:d.id)===a,node:X,over:d,setNodeRef:V}}import dl,{useMemo as Eo,useRef as Sa,useEffect as Mo,useState as Nm,useContext as Rm}from"react";function Ao(t,r,o){let a=t.slice();return a.splice(o<0?a.length+o:o,0,a.splice(r,1)[0]),a}function Cm(t,r){return t.reduce((o,a,s)=>{let i=r.get(a);if(i)o[s]=i;return o},Array(t.length))}function Lo(t){return t!==null&&t>=0}function Sm(t,r){if(t===r)return!0;if(t.length!==r.length)return!1;for(let o=0;o<t.length;o++)if(t[o]!==r[o])return!1;return!0}function Pm(t){if(typeof t==="boolean")return{draggable:t,droppable:t};return t}var ul=(t)=>{let{rects:r,activeIndex:o,overIndex:a,index:s}=t,i=Ao(r,a,o),l=r[s],c=i[s];if(!c||!l)return null;return{x:c.left-l.left,y:c.top-l.top,scaleX:c.width/l.width,scaleY:c.height/l.height}};var Do={scaleX:1,scaleY:1},pl=(t)=>{var r;let{activeIndex:o,activeNodeRect:a,index:s,rects:i,overIndex:l}=t,c=(r=i[o])!=null?r:a;if(!c)return null;if(s===o){let u=i[l];if(!u)return null;return{x:0,y:o<l?u.top+u.height-(c.top+c.height):u.top-c.top,...Do}}let d=Tm(i,s,o);if(s>o&&s<=l)return{x:0,y:-c.height-d,...Do};if(s<o&&s>=l)return{x:0,y:c.height+d,...Do};return{x:0,y:0,...Do}};function Tm(t,r,o){let a=t[r],s=t[r-1],i=t[r+1];if(!a)return 0;if(o<r)return s?a.top-(s.top+s.height):i?i.top-(a.top+a.height):0;return i?i.top-(a.top+a.height):s?a.top-(s.top+s.height):0}var ml="Sortable",fl=dl.createContext({activeIndex:-1,containerId:ml,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:ul,disabled:{draggable:!1,droppable:!1}});function gl(t){let{children:r,id:o,items:a,strategy:s=ul,disabled:i=!1}=t,{active:l,dragOverlay:c,droppableRects:d,over:u,measureDroppableContainers:g}=ll(),b=jr(ml,o),w=Boolean(c.rect!==null),P=Eo(()=>a.map((V)=>typeof V==="object"&&("id"in V)?V.id:V),[a]),C=l!=null,A=l?P.indexOf(l.id):-1,j=u?P.indexOf(u.id):-1,B=Sa(P),O=!Sm(P,B.current),H=j!==-1&&A===-1||O,F=Pm(i);$t(()=>{if(O&&C)g(P)},[O,P,C,g]),Mo(()=>{B.current=P},[P]);let X=Eo(()=>({activeIndex:A,containerId:b,disabled:F,disableTransforms:H,items:P,overIndex:j,useDragOverlay:w,sortedRects:Cm(P,d),strategy:s}),[A,b,F.draggable,F.droppable,H,P,j,d,w,s]);return dl.createElement(fl.Provider,{value:X},r)}var km=(t)=>{let{id:r,items:o,activeIndex:a,overIndex:s}=t;return Ao(o,a,s).indexOf(r)},Lm=(t)=>{let{containerId:r,isSorting:o,wasDragging:a,index:s,items:i,newIndex:l,previousItems:c,previousContainerId:d,transition:u}=t;if(!u||!a)return!1;if(c!==i&&s===l)return!1;if(o)return!0;return l!==s&&r===d},Dm={duration:200,easing:"ease"},bl="transform",Em=Vr.Transition.toString({property:bl,duration:0,easing:"linear"}),Mm={roleDescription:"sortable"};function Im(t){let{disabled:r,index:o,node:a,rect:s}=t,[i,l]=Nm(null),c=Sa(o);return $t(()=>{if(!r&&o!==c.current&&a.current){let d=s.current;if(d){let u=Xr(a.current,{ignoreTransform:!0}),g={x:d.left-u.left,y:d.top-u.top,scaleX:d.width/u.width,scaleY:d.height/u.height};if(g.x||g.y)l(g)}}if(o!==c.current)c.current=o},[r,o,a,s]),Mo(()=>{if(i)l(null)},[i]),i}function vl(t){let{animateLayoutChanges:r=Lm,attributes:o,disabled:a,data:s,getNewIndex:i=km,id:l,strategy:c,resizeObserverConfig:d,transition:u=Dm}=t,{items:g,containerId:b,activeIndex:w,disabled:P,disableTransforms:C,sortedRects:A,overIndex:j,useDragOverlay:B,strategy:O}=Rm(fl),H=Am(a,P),F=g.indexOf(l),X=Eo(()=>({sortable:{containerId:b,index:F,items:g},...s}),[b,s,F,g]),V=Eo(()=>g.slice(g.indexOf(l)),[g,l]),{rect:_,node:W,isOver:oe,setNodeRef:K}=cl({id:l,data:X,disabled:H.droppable,resizeObserverConfig:{updateMeasurementsFor:V,...d}}),{active:de,activatorEvent:ye,activeNodeRect:ve,attributes:Re,setNodeRef:Me,listeners:Ae,isDragging:be,over:qe,setActivatorNodeRef:he,transform:_e}=il({id:l,data:X,attributes:{...Mm,...o},disabled:H.draggable}),q=yi(K,Me),ce=Boolean(de),ae=ce&&!C&&Lo(w)&&Lo(j),Ce=!B&&be,st=Ce&&ae?_e:null,Se=c!=null?c:O,Rr=ae?st!=null?st:Se({rects:A,activeNodeRect:ve,activeIndex:w,overIndex:j,index:F}):null,Y=Lo(w)&&Lo(j)?i({id:l,items:g,activeIndex:w,overIndex:j}):F,it=de==null?void 0:de.id,fe=Sa({activeId:it,items:g,newIndex:Y,containerId:b}),Cn=g!==fe.current.items,Zt=r({active:de,containerId:b,isDragging:be,isSorting:ce,id:l,index:F,items:g,newIndex:fe.current.newIndex,previousItems:fe.current.items,previousContainerId:fe.current.containerId,transition:u,wasDragging:fe.current.activeId!=null}),Zr=Im({disabled:!Zt,index:F,node:W,rect:_});return Mo(()=>{if(ce&&fe.current.newIndex!==Y)fe.current.newIndex=Y;if(b!==fe.current.containerId)fe.current.containerId=b;if(g!==fe.current.items)fe.current.items=g},[ce,Y,b,g]),Mo(()=>{if(it===fe.current.activeId)return;if(it!=null&&fe.current.activeId==null){fe.current.activeId=it;return}let Qr=setTimeout(()=>{fe.current.activeId=it},50);return()=>clearTimeout(Qr)},[it]),{active:de,activeIndex:w,attributes:Re,data:X,rect:_,index:F,newIndex:Y,items:g,isOver:oe,isSorting:ce,isDragging:be,listeners:Ae,node:W,overIndex:j,over:qe,setNodeRef:q,setActivatorNodeRef:he,setDroppableNodeRef:K,setDraggableNodeRef:Me,transform:Zr!=null?Zr:Rr,transition:lr()};function lr(){if(Zr||Cn&&fe.current.newIndex===F)return Em;if(Ce&&!Hn(ye)||!u)return;if(ce||Zt)return Vr.Transition.toString({...u,property:bl});return}}function Am(t,r){var o,a;if(typeof t==="boolean")return{draggable:t,droppable:!1};return{draggable:(o=t==null?void 0:t.draggable)!=null?o:r.draggable,droppable:(a=t==null?void 0:t.droppable)!=null?a:r.droppable}}function Io(t){if(!t)return!1;let r=t.data.current;if(r&&"sortable"in r&&typeof r.sortable==="object"&&"containerId"in r.sortable&&"items"in r.sortable&&"index"in r.sortable)return!0;return!1}var Om=[re.Down,re.Right,re.Up,re.Left],hl=(t,r)=>{let{context:{active:o,collisionRect:a,droppableRects:s,droppableContainers:i,over:l,scrollableAncestors:c}}=r;if(Om.includes(t.code)){if(t.preventDefault(),!o||!a)return;let d=[];i.getEnabled().forEach((b)=>{if(!b||b!=null&&b.disabled)return;let w=s.get(b.id);if(!w)return;switch(t.code){case re.Down:if(a.top<w.top)d.push(b);break;case re.Up:if(a.top>w.top)d.push(b);break;case re.Left:if(a.left>w.left)d.push(b);break;case re.Right:if(a.left<w.left)d.push(b);break}});let u=Gi({active:o,collisionRect:a,droppableRects:s,droppableContainers:d,pointerCoordinates:null}),g=Ca(u,"id");if(g===(l==null?void 0:l.id)&&u.length>1)g=u[1].id;if(g!=null){let b=i.get(o.id),w=i.get(g),P=w?s.get(w.id):null,C=w==null?void 0:w.node.current;if(C&&P&&b&&w){let j=_n(C).some((V,_)=>c[_]!==V),B=xl(b,w),O=Hm(b,w),H=j||!B?{x:0,y:0}:{x:O?a.width-P.width:0,y:O?a.height-P.height:0},F={x:P.left,y:P.top};return H.x&&H.y?F:Wr(F,H)}}}return};function xl(t,r){if(!Io(t)||!Io(r))return!1;return t.data.current.sortable.containerId===r.data.current.sortable.containerId}function Hm(t,r){if(!Io(t)||!Io(r))return!1;if(!xl(t,r))return!1;return t.data.current.sortable.index<r.data.current.sortable.index}import{Fragment as Vm}from"react";import{jsx as Fr,Fragment as _m}from"react/jsx-runtime";var Bm=({id:t,label:r,children:o})=>{let{attributes:a,listeners:s,setNodeRef:i,transform:l,transition:c,isDragging:d}=vl({id:t}),u={opacity:d?0.5:1,position:"relative",transform:Vr.Transform.toString(l),transition:c,zIndex:d?10:"auto"},g=Fr("button",{type:"button",className:"touch-none cursor-grab text-muted-foreground/40 hover:text-muted-foreground active:cursor-grabbing",...a,...s,title:r!==void 0&&r!==""?`Drag ${r} to reorder`:"Drag to reorder","aria-label":r!==void 0&&r!==""?`Drag ${r} to reorder`:"Drag handle",children:Fr(ft,{className:"h-3.5 w-3.5"})});return Fr("div",{ref:i,style:u,children:o(g)})},Fm=({items:t,onReorder:r,getItemLabel:o,renderItem:a,disabled:s=!1})=>{let i=zi(Ra($n,{activationConstraint:{distance:4}}),Ra(zn,{coordinateGetter:hl})),l=(c)=>{let{active:d,over:u}=c;if(!u||d.id===u.id)return;let g=t.findIndex((w)=>w.id===d.id),b=t.findIndex((w)=>w.id===u.id);if(g===-1||b===-1)return;r(Ao(t,g,b))};if(s)return t.map((c)=>Fr(Vm,{children:a(c,null)},c.id));return Fr(sl,{sensors:i,collisionDetection:ji,onDragEnd:l,children:Fr(gl,{items:t.map((c)=>c.id),strategy:pl,children:t.map((c)=>Fr(Bm,{id:c.id,label:o?.(c),children:(d)=>Fr(_m,{children:a(c,d)})},c.id))})})},zm=Fm;import*as yl from"react";import{jsx as Jn,jsxs as Pa}from"react/jsx-runtime";var wl=({open:t,onOpenChange:r,title:o,description:a,confirmLabel:s,cancelLabel:i="Cancel",confirmVariant:l="default",pendingLabel:c="Processing...",errorContent:d,keepOpenWhilePending:u=!1,onConfirm:g})=>{let[b,w]=yl.useState(!1),P=async()=>{w(!0);try{if(await g()!==!1)r(!1)}catch(C){throw w(!1),C}w(!1)};return Jn(k,{open:t,onOpenChange:(C)=>{if(!(u&&b))r(C)},children:Pa(E,{children:[Pa(G,{children:[Jn(M,{children:o}),Jn(Q,{children:a})]}),d,Pa(or,{children:[Jn(n,{variant:"outline",onClick:()=>{r(!1)},disabled:b,children:i}),Jn(n,{variant:l,onClick:()=>{P()},disabled:b,children:b?c:s})]})]})})};wl.displayName="ConfirmDialog";var $m=wl;import*as Rl from"react";import{jsx as Oo,jsxs as Nl}from"react/jsx-runtime";var Cl=Rl.forwardRef(function({step:r,total:o,title:a,helper:s,action:i,className:l,...c},d){let u=Boolean(i);return Nl("div",{ref:d,className:e("flex flex-wrap items-start justify-between gap-4",l),...c,children:[Nl("div",{className:"min-w-0 space-y-1.5",children:[Oo(an,{tone:"accent",className:"tracking-[0.16em]",children:`Step ${r} of ${o}`}),Oo("h2",{className:"text-lg font-semibold tracking-tight",children:a}),Oo("p",{className:"max-w-xl text-sm leading-relaxed text-muted-foreground",children:s})]}),u?Oo("div",{className:"shrink-0",children:i}):null]})});Cl.displayName="StageHeader";var Jm=Cl;import{jsx as _r,jsxs as Ta}from"react/jsx-runtime";var jm=f("flex h-10 w-10 shrink-0 items-center justify-center rounded-lg border [&_svg]:h-[18px] [&_svg]:w-[18px]",{defaultVariants:{tone:"default"},variants:{tone:{accent:"border-[color-mix(in_oklab,var(--accent)_28%,var(--border))] bg-[color-mix(in_oklab,var(--accent)_10%,var(--card))] text-(--accent)",danger:"border-[color-mix(in_oklab,var(--danger)_30%,var(--border))] bg-[color-mix(in_oklab,var(--danger)_12%,var(--card))] text-(--danger)",default:"border-border bg-muted/40 text-(--text-muted)",success:"border-[color-mix(in_oklab,var(--success)_30%,var(--border))] bg-[color-mix(in_oklab,var(--success)_12%,var(--card))] text-(--success)",warning:"border-[color-mix(in_oklab,var(--warning)_30%,var(--border))] bg-[color-mix(in_oklab,var(--warning)_12%,var(--card))] text-(--warning)"}}}),Gm=f("shrink-0 [&_svg]:h-4 [&_svg]:w-4",{defaultVariants:{tone:"default"},variants:{tone:{accent:"text-(--accent)",danger:"text-(--danger)",default:"text-(--text-muted)",success:"text-(--success)",warning:"text-(--warning)"}}}),Ho=(t)=>t!==null&&t!==void 0&&t!==!1&&t!==0&&t!==0n&&t!==""&&!Number.isNaN(t),Sl=({variant:t="tile",icon:r,label:o,value:a,detail:s,tone:i,className:l,...c})=>{if(t==="compact")return Ta(ie,{className:e("gap-1 px-4 py-3.5",l),...c,children:[Ta("span",{className:"flex items-center justify-between gap-2",children:[_r("span",{className:"text-[11px] font-medium uppercase tracking-[0.14em] text-(--text-muted)",children:o}),Ho(r)?_r("span",{className:e(Gm({tone:i})),"aria-hidden":!0,children:r}):null]}),_r("span",{className:"text-[22px] font-semibold leading-none tabular-nums tracking-tight text-(--text-primary)",children:a}),Ho(s)?_r("span",{className:"text-xs text-(--text-muted)",children:s}):null]});return Ta(ie,{className:e("flex flex-col items-center gap-2.5 px-4 py-5 text-center","transition-colors hover:border-[color-mix(in_oklab,var(--accent)_22%,var(--border))]",l),...c,children:[Ho(r)?_r("span",{className:e(jm({tone:i})),"aria-hidden":!0,children:r}):null,_r("span",{className:"text-[26px] font-semibold leading-none tabular-nums tracking-tight text-(--text-primary)",children:a}),_r("span",{className:"text-[11px] font-medium uppercase tracking-[0.14em] text-(--text-muted)",children:o}),Ho(s)?_r("span",{className:"text-xs text-(--text-muted)",children:s}):null]})};Sl.displayName="StatTile";var Wm=Sl;import*as Tl from"react";import{jsx as Pl,jsxs as Ym}from"react/jsx-runtime";var Xm={danger:"border-[color-mix(in_oklab,var(--danger)_40%,var(--border))] bg-[color-mix(in_oklab,var(--danger)_8%,var(--card))] text-(--danger)",live:"border-[color-mix(in_oklab,var(--primary)_45%,var(--border))] bg-[color-mix(in_oklab,var(--primary)_8%,var(--card))] text-primary",neutral:"border-border bg-card text-muted-foreground",success:"border-[color-mix(in_oklab,var(--success)_38%,var(--border))] bg-[color-mix(in_oklab,var(--success)_8%,var(--card))] text-(--success)",warning:"border-[color-mix(in_oklab,var(--warning)_42%,var(--border))] bg-[color-mix(in_oklab,var(--warning)_9%,var(--card))] text-(--warning)"},Um={danger:"danger",live:"primary",neutral:"neutral",success:"success",warning:"warning"},Km=({tone:t,active:r=!1,label:o,className:a,children:s,...i},l)=>{let c="border-border bg-card text-muted-foreground";if(t)c=Xm[t];else if(r)c="border-[color-mix(in_oklab,var(--primary)_45%,var(--border))] bg-[color-mix(in_oklab,var(--primary)_8%,var(--card))] text-primary";return Ym("div",{ref:l,className:e("inline-flex items-center gap-2 rounded-full border px-3 py-1 text-[10px] font-semibold uppercase tracking-[0.16em]",c,a),...i,children:[t?Pl(qn,{tone:Um[t],pulse:t==="live"}):Pl("span",{"aria-hidden":!0,className:e("h-1.5 w-1.5 rounded-full",r?"bg-primary shadow-[0_0_0_3px_color-mix(in_oklab,var(--primary)_22%,transparent)]":"bg-muted-foreground")}),s??o]})},kl=Tl.forwardRef(Km);kl.displayName="StatusPill";var qm=kl;import*as Bo from"react";import{jsx as Vo,jsxs as ef}from"react/jsx-runtime";var Zm=f("relative min-w-0",{defaultVariants:{size:"md",variant:"pill"},variants:{size:{md:"",sm:""},variant:{pill:"",plain:""}}}),Qm=f("pl-9 [&::-webkit-search-cancel-button]:appearance-none",{defaultVariants:{size:"md",variant:"pill"},variants:{size:{md:"",sm:"h-8 text-[13px]"},variant:{pill:"rounded-full bg-(--bg-surface)",plain:"bg-(--bg-surface)"}}}),Ll=({value:t,defaultValue:r,onValueChange:o,clearLabel:a,variant:s,size:i,className:l,classes:c,...d})=>{let[u,g]=Bo.useState(r??""),b=t!==void 0,w=b?t:u,P=Bo.useRef(null),C=(A)=>{if(!b)g(A);o?.(A)};return ef("div",{className:e(Zm({size:i,variant:s}),c?.root,l),children:[Vo(Be,{"aria-hidden":!0,className:e("pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground",c?.icon)}),Vo(h,{ref:P,type:"search",value:w,onChange:(A)=>{C(A.target.value)},className:e(Qm({size:i,variant:s}),w!==void 0&&w!==""&&a!==void 0?"pr-9":void 0,c?.input),...d}),w!==void 0&&w!==""&&a!==void 0?Vo("button",{type:"button","aria-label":a,onClick:()=>{C(""),P.current?.focus()},className:e("absolute right-2.5 top-1/2 flex size-5 -translate-y-1/2 items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-(--bg-surface-alt) hover:text-(--text-primary) focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",c?.clear),children:Vo(x,{className:"h-3.5 w-3.5"})}):null]})};Ll.displayName="SearchField";var tf=Ll;import{createContext as rf,useContext as Dl,useMemo as nf,useState as of}from"react";import{createPortal as af}from"react-dom";import{jsx as Fo,jsxs as uf}from"react/jsx-runtime";var ka=rf(null),sf=({children:t})=>{let[r,o]=of(null),a=nf(()=>({container:r,setContainer:o}),[r]);return Fo(ka.Provider,{value:a,children:t})},El=({className:t})=>{let r=Dl(ka);return Fo("div",{ref:r?.setContainer,className:e("ml-auto flex items-center gap-2 empty:hidden",t)})},lf=({children:t})=>{let r=Dl(ka);if(r===null)return t;return r.container===null?null:af(t,r.container)},cf=({count:t})=>t===void 0?null:Fo("span",{className:"text-xs text-muted-foreground tabular-nums",children:t}),df=({children:t,className:r})=>uf("div",{className:e("flex flex-wrap items-center gap-3",r),children:[t,Fo(El,{})]});import{jsx as _o,jsxs as Ml}from"react/jsx-runtime";var Il=({title:t,description:r,value:o,options:a,onValueChange:s,align:i="center",className:l,...c})=>Ml("section",{className:e("flex min-w-0 flex-col gap-3 sm:flex-row sm:justify-between",i==="center"?"sm:items-center":"sm:items-start",l),...c,children:[Ml("div",{className:"min-w-0",children:[_o("h3",{className:"truncate text-sm font-semibold",children:t}),r!==void 0&&r!==null&&r!==!1&&r!==""&&r!==0?_o("p",{className:"mt-1 text-sm text-muted-foreground",children:r}):null]}),_o("div",{className:"inline-flex shrink-0 rounded-md border border-border bg-background p-1 shadow-xs",children:a.map((d)=>_o(n,{type:"button",size:"sm",variant:d.value===o?"secondary":"ghost",disabled:d.disabled,className:e("h-8 rounded-sm px-3",d.value===o&&"bg-primary/10 text-primary hover:bg-primary/15"),"aria-label":d.ariaLabel,"aria-pressed":d.value===o,onClick:()=>{s(d.value)},children:d.label},d.value))})]});Il.displayName="SectionSwitcher";import*as ar from"react";import{jsx as qt}from"react/jsx-runtime";var Al=ar.createContext({value:1}),La=()=>ar.useContext(Al),pf=({value:t,defaultValue:r=1,indicators:o,className:a,...s})=>{let i=t??r,l=ar.useMemo(()=>({indicators:o,value:i}),[i,o]);return qt(Al.Provider,{value:l,children:qt("div",{"data-slot":"stepper",className:e("space-y-8",a),...s})})},mf=({className:t,...r})=>qt("nav",{"data-slot":"stepper-nav","data-orientation":"horizontal",className:e("group/stepper-nav flex items-start justify-between gap-2",t),...r}),Da=ar.createContext({state:"inactive",step:1}),ff=({step:t,loading:r,className:o,...a})=>{let{value:s}=La(),i="inactive";if(r===!0)i="loading";else if(t<s)i="completed";else if(t===s)i="active";let l=ar.useMemo(()=>({state:i,step:t}),[i,t]);return qt(Da.Provider,{value:l,children:qt("div",{"data-slot":"stepper-item","data-state":i,"data-step":t,className:e("group/step relative flex-1 items-start",o),...a})})},gf=({className:t,...r})=>qt("div",{"data-slot":"stepper-trigger",className:e("flex flex-col items-center gap-2.5",t),...r}),bf=({className:t,children:r,...o})=>{let{indicators:a}=La(),{state:s}=ar.useContext(Da),i=a?.completed,l=a?.loading,c=r;if(s==="completed"&&Boolean(i))c=i;else if(s==="loading"&&Boolean(l))c=l;return qt("div",{"data-slot":"stepper-indicator","data-state":s,className:e("flex size-7 shrink-0 items-center justify-center rounded-full border-2 text-xs font-semibold transition-colors",s==="completed"&&"border-primary bg-primary text-primary-foreground",s==="active"&&"border-primary bg-primary text-primary-foreground",s==="loading"&&"border-primary bg-primary text-primary-foreground",s==="inactive"&&"border-muted-foreground/30 bg-background text-muted-foreground",t),...o,children:c})},vf=({className:t,...r})=>{let{state:o}=ar.useContext(Da);return qt("span",{"data-slot":"stepper-title","data-state":o,className:e("text-sm font-medium",(o==="completed"||o==="active")&&"text-foreground",o==="inactive"&&"text-muted-foreground",t),...r})},hf=({className:t,...r})=>qt("div",{"data-slot":"stepper-separator",className:e("h-0.5 rounded-full bg-muted-foreground/30 transition-colors","group-data-[state=completed]/step:bg-primary",t),...r}),xf=({className:t,...r})=>qt("div",{"data-slot":"stepper-panel",className:e(t),...r}),yf=({value:t,className:r,...o})=>{let{value:a}=La();if(t!==a)return null;return qt("div",{"data-slot":"stepper-content",className:e(r),...o})};import*as Kr from"react";import{jsx as Ur,jsxs as Cf}from"react/jsx-runtime";var Ea=Kr.createContext({}),wf=({className:t,size:r,variant:o,...a})=>{let s=Kr.useMemo(()=>({size:r,variant:o}),[r,o]);return Ur(Ea.Provider,{value:s,children:Ur("fieldset",{"data-slot":"split-button",className:e("inline-flex min-w-0 items-stretch",t),...a})})},Nf=({className:t,...r})=>{let{size:o,variant:a}=Kr.useContext(Ea);return Ur(n,{"data-slot":"split-button-action",className:e("rounded-r-none",t),size:o,variant:a,...r})},Rf=({align:t="end",children:r,contentClassName:o,disabled:a,label:s,modal:i,onOpenChange:l,open:c})=>{let{size:d,variant:u}=Kr.useContext(Ea);return Cf(ot,{modal:i,onOpenChange:l,open:c,children:[Ur(at,{asChild:!0,children:Ur(n,{"aria-label":s,"data-slot":"split-button-menu",className:"-ml-px rounded-l-none border-l border-l-current/20 px-2",disabled:a,size:d,variant:u,children:Ur(v,{})})}),Ur(nt,{align:t,className:o,children:r})]})};import*as wn from"react";import{jsx as sr,jsxs as zo}from"react/jsx-runtime";var Sf=({items:t,title:r,triggerAriaLabel:o="Technical details",copyLabel:a="Copy",trigger:s,align:i="end",side:l,onCopy:c,className:d,classes:u})=>{let[g,b]=wn.useState(null),w=wn.useRef(null);wn.useEffect(()=>()=>{if(w.current!==null)window.clearTimeout(w.current)},[]);let P=(C)=>{if(navigator.clipboard.writeText(C.value),b(C.label),w.current!==null)window.clearTimeout(w.current);w.current=window.setTimeout(()=>{b(null)},1500),c?.(C)};return zo(R,{children:[sr(L,{asChild:!0,children:s??sr(n,{type:"button",variant:"ghost",size:"icon","aria-label":o,className:e("h-8 w-8 text-muted-foreground hover:text-foreground",u?.root,u?.trigger,d),children:sr(Sr,{className:"h-4 w-4"})})}),zo(I,{align:i,side:l,className:e("w-80 p-3",u?.content),children:[r!==void 0&&r!==null?sr("div",{className:"mb-2 text-[10px] font-medium uppercase tracking-wider text-muted-foreground",children:r}):null,sr("dl",{className:"space-y-2.5",children:t.map((C)=>zo("div",{className:e("min-w-0",u?.row),children:[sr("dt",{className:e("text-[11px] font-medium text-muted-foreground",u?.label),children:C.label}),zo("dd",{className:"mt-0.5 flex min-w-0 items-start gap-1",children:[sr("code",{className:e("min-w-0 flex-1 select-all break-all rounded bg-muted/60 px-1.5 py-1 font-mono text-xs leading-relaxed text-foreground",u?.value),children:C.value}),C.copyable===!1?null:sr(n,{type:"button",variant:"ghost",size:"icon","aria-label":`${a} ${C.label}`,className:"h-6 w-6 shrink-0 text-muted-foreground hover:text-foreground",onClick:()=>{P(C)},children:g===C.label?sr(p,{className:"h-3.5 w-3.5"}):sr(ne,{className:"h-3.5 w-3.5"})})]})]},C.label))})]})]})};var Pf=Sf;import*as Nn from"react";import{jsx as ke,jsxs as pr,Fragment as Hl}from"react/jsx-runtime";var Tf={disabled:!1,emptyMessage:"No option found.",loading:!1,loadingMessage:"Loading options...",modal:!1,placeholder:"Select option...",searchPlaceholder:"Search...",width:"200px"},kf=1,Lf=0.5,Df=(t)=>t.children!==void 0,Vl=(t)=>t.flatMap((r)=>{if(!r.children)return[r];let o=Vl(r.children);return o.length>0?[{...r,children:o}]:[]}),Bl=(t,r=[])=>t.flatMap((o)=>o.children?Bl(o.children,[...r,o]):[{ancestorIds:r.map((a)=>a.id),node:o,path:r.map((a)=>a.label).join(" / ")}]),Ol=(t)=>({paddingLeft:`${Lf+t*kf}rem`}),Fl=Nn.forwardRef(function(r,o){let a={...Tf,...r},{nodes:s,value:i,onChange:l,selectedLabel:c,placeholder:d,searchPlaceholder:u,emptyMessage:g,id:b,className:w,width:P,disabled:C,loading:A,loadingMessage:j,onSearchChange:B,modal:O}=a,[H,F]=Nn.useState(!1),[X,V]=Nn.useState(""),[_,W]=Nn.useState(()=>new Set),oe=Vl(s),K=Bl(oe),de=K.find((q)=>q.node.id===i),ye=X.trim().toLowerCase(),ve=(q)=>{if(q)W(new Set(de?.ancestorIds));else if(X!=="")V(""),B?.("");F(q)},Re=(q)=>{V(q),B?.(q)},Me=(q)=>{W((ce)=>{let ae=new Set(ce);if(!ae.delete(q))ae.add(q);return ae})},Ae=(q)=>{l(q),ve(!1)},be=(q)=>pr(Hl,{children:[ke(p,{"aria-hidden":!0,className:e(i===q.id?"opacity-100":"opacity-0")}),q.icon]}),qe=(q,ce)=>q.flatMap((ae)=>{if(!Df(ae))return[pr(N,{value:ae.id,style:Ol(ce),onSelect:()=>{Ae(ae.id)},children:[be(ae),ke("span",{className:"min-w-0 truncate",title:ae.label,children:ae.label})]},ae.id)];let Ce=_.has(ae.id),st=Ce?xr:br;return[pr(N,{value:ae.id,"aria-expanded":Ce,style:Ol(ce),onSelect:()=>{Me(ae.id)},children:[ke(m,{"aria-hidden":!0,className:e(Ce&&"rotate-90")}),ae.icon??ke(st,{"aria-hidden":!0}),ke("span",{className:"min-w-0 truncate",title:ae.label,children:ae.label})]},ae.id),...Ce&&ae.children?qe(ae.children,ce+1):[]]}),he=ye===""?[]:K.filter((q)=>B!==void 0||`${q.path} / ${q.node.label}`.toLowerCase().includes(ye)),_e=de?.node.label??c;return pr(R,{modal:O,open:H,onOpenChange:ve,children:[ke(L,{asChild:!0,children:pr(n,{ref:o,id:b,variant:"outline","aria-expanded":H,"aria-busy":A,className:e("justify-between",w),style:{width:P},disabled:C,children:[_e===void 0?ke("span",{className:"min-w-0 truncate text-muted-foreground",children:d}):ke("span",{className:"min-w-0 truncate",children:_e}),A?ke(T,{"aria-hidden":!0,className:"ml-2 size-4 shrink-0 animate-spin text-muted-foreground"}):ke(Fe,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),ke(I,{className:"p-0",style:{width:"var(--radix-popover-trigger-width)"},children:pr(se,{shouldFilter:!1,children:[ke(Ze,{"aria-label":u,placeholder:u,value:X,onValueChange:Re}),ke(me,{className:"max-h-[min(300px,calc(var(--radix-popover-content-available-height)-2.5rem))]",children:A?pr("div",{"aria-live":"polite",className:"flex items-center justify-center gap-2 px-3 py-6 text-sm text-muted-foreground",children:[ke(T,{"aria-hidden":!0,className:"size-4 animate-spin"}),j]}):pr(Hl,{children:[ke(Qe,{children:g}),ke(Z,{children:ye===""?qe(oe,0):he.map((q)=>pr(N,{value:q.node.id,onSelect:()=>{Ae(q.node.id)},children:[be(q.node),ke("span",{className:"min-w-0 truncate",title:q.node.label,children:q.node.label}),q.path===""?null:ke("span",{className:"ml-auto min-w-0 shrink truncate pl-2 text-xs text-muted-foreground",title:q.path,children:q.path})]},q.node.id))})]})})]})})]})});Fl.displayName="TreeSelect";import*as zl from"react";import{jsx as _l,jsxs as Mf}from"react/jsx-runtime";var Ef=({value:t,state:r="value",trailing:o,monospace:a=!0,className:s,...i},l)=>{let c=r==="secret";return Mf("div",{ref:l,className:e("flex min-w-0 items-center gap-2",s),...i,children:[_l("div",{className:e("flex min-w-0 flex-1 items-center border-b py-2",c?"border-[color-mix(in_oklab,var(--primary)_45%,var(--border))]":"border-border"),children:_l("code",{className:e("block min-w-0 flex-1 overflow-x-auto whitespace-nowrap text-[13px] text-foreground",a?"font-mono":"font-sans"),children:t})}),o]})},$l=zl.forwardRef(Ef);$l.displayName="ValueRow";var If=$l;import{forwardRef as Jl,useCallback as Yr,useLayoutEffect as jl,useId as Af,useRef as Gl,useState as We}from"react";import{jsx as S,jsxs as U,Fragment as jn}from"react/jsx-runtime";var Of=({mode:t,onModeChange:r,disabled:o})=>U("div",{role:"tablist","aria-label":"Value source",className:"relative inline-flex h-7 items-center rounded-full border border-border/70 bg-muted/40 p-0.5 text-[10px] font-medium tracking-[0.08em] uppercase shadow-inner",children:[S("span",{"aria-hidden":!0,className:e("absolute top-0.5 bottom-0.5 w-[calc(50%-2px)] rounded-full bg-background shadow-xs ring-1 ring-border/60 transition-transform duration-200 ease-out",t==="inline"&&"translate-x-[calc(100%+0px)]")}),U("button",{type:"button",role:"tab","aria-selected":t==="linked",disabled:o,onClick:()=>{r("linked")},className:e("relative z-10 flex items-center gap-1 rounded-full px-2.5 py-1 transition-colors",t==="linked"?"text-foreground":"text-muted-foreground hover:text-foreground"),children:[S(St,{className:"h-3 w-3"}),"Linked"]}),U("button",{type:"button",role:"tab","aria-selected":t==="inline",disabled:o,onClick:()=>{r("inline")},className:e("relative z-10 flex items-center gap-1 rounded-full px-2.5 py-1 transition-colors",t==="inline"?"text-foreground":"text-muted-foreground hover:text-foreground"),children:[S(ct,{className:"h-3 w-3"}),"Inline"]})]}),Hf=({variableKey:t,initialValue:r,isSecret:o,loading:a,saving:s,onSubmit:i,onCancel:l})=>{let[c,d]=We(r),[u,g]=We(!1),b=Gl(null);return jl(()=>{if(!a)b.current?.focus()},[a]),U("form",{role:"presentation",onSubmit:(w)=>{w.preventDefault(),i(c)},onKeyDown:(w)=>{if(w.key==="Escape")w.preventDefault(),l()},className:"space-y-3 p-3",children:[U("div",{className:"flex items-start justify-between gap-2",children:[U("div",{className:"min-w-0",children:[S("p",{className:"text-[10px] font-medium uppercase tracking-[0.1em] text-muted-foreground",children:"Editing linked variable"}),S("p",{className:"mt-0.5 truncate font-mono text-xs text-foreground",children:t})]}),S("button",{type:"button",onClick:l,"aria-label":"Close editor",className:"rounded p-0.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",children:S(x,{className:"h-3.5 w-3.5"})})]}),U("div",{className:"space-y-1",children:[S(y,{htmlFor:"linked-value",className:"text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground",children:o?"Secret value":"Value"}),U("div",{className:"relative",children:[S(h,{ref:b,id:"linked-value",type:u?"text":"password",value:c,onChange:(w)=>{d(w.target.value)},placeholder:a?"Loading current value…":"Enter value",disabled:a||s,className:"h-8 pr-8 font-mono text-xs",autoComplete:"off",spellCheck:!1}),S("button",{type:"button",onClick:()=>{g((w)=>!w)},"aria-label":u?"Hide value":"Reveal value",className:"absolute inset-y-0 right-1 my-auto flex h-6 w-6 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",children:u?S(He,{className:"h-3.5 w-3.5"}):S(pe,{className:"h-3.5 w-3.5"})})]})]}),U("div",{className:"flex items-center justify-between gap-2 pt-1",children:[U("p",{className:"text-[10px] leading-relaxed text-muted-foreground",children:["Updates the linked secret. Other connectors using"," ",S("span",{className:"font-mono",children:t})," will pick it up on their next run."]}),S(n,{type:"submit",size:"sm",disabled:a||s,className:"h-7 px-3 text-xs",children:s?U(jn,{children:[S(T,{className:"h-3 w-3 animate-spin"}),"Saving"]}):"Save"})]})]})},Vf=({suggestedName:t,onSubmit:r,onCancel:o})=>{let[a,s]=We(t),[i,l]=We(""),[c,d]=We(!0),[u,g]=We(!1),b=Gl(null);jl(()=>{b.current?.focus(),b.current?.select()},[]);let w=a.trim(),P=w.length>0;return U("form",{role:"presentation",onSubmit:(C)=>{if(C.preventDefault(),P)r({key:w,secret:c,value:i})},onClick:(C)=>{C.stopPropagation()},onKeyDown:(C)=>{if(C.key==="Escape")C.preventDefault(),C.stopPropagation(),o()},className:"flex flex-col",children:[U("div",{className:"flex items-center gap-2 border-b border-border/60 bg-muted/15 px-3 py-2",children:[S("button",{type:"button",onClick:o,"aria-label":"Back to picker",className:"-ml-1 flex h-5 w-5 shrink-0 items-center justify-center rounded text-muted-foreground/70 transition-colors hover:bg-muted hover:text-foreground",children:S(dt,{className:"h-3.5 w-3.5"})}),S("span",{className:"flex-1 text-[10.5px] font-medium uppercase tracking-[0.12em] text-muted-foreground/80",children:"New variable"}),S(Ge,{className:"h-3 w-3 text-muted-foreground/60"})]}),U("div",{className:"space-y-2.5 px-3 py-2.5",children:[U("div",{className:"space-y-1",children:[S(y,{htmlFor:"var-key",className:"text-[10px] font-medium uppercase tracking-[0.1em] text-muted-foreground/70",children:"Name"}),U("div",{className:"relative",children:[S("span",{"aria-hidden":!0,className:"pointer-events-none absolute inset-y-0 left-2.5 flex items-center text-muted-foreground/60",children:S(lt,{className:"h-3 w-3"})}),S(h,{ref:b,id:"var-key",value:a,onChange:(C)=>{s(C.target.value.toUpperCase())},placeholder:"VARIABLE_NAME",className:"h-8 pl-7 font-mono text-[12.5px] tracking-tight",autoComplete:"off",spellCheck:!1})]})]}),U("div",{className:"space-y-1",children:[S(y,{htmlFor:"var-value",className:"text-[10px] font-medium uppercase tracking-[0.1em] text-muted-foreground/70",children:"Value"}),U("div",{className:"relative",children:[S(h,{id:"var-value",type:u?"text":"password",value:i,onChange:(C)=>{l(C.target.value)},placeholder:"Encrypted at rest",className:"h-8 pr-8 font-mono text-[12.5px]",autoComplete:"off",spellCheck:!1}),S("button",{type:"button",onClick:()=>{g((C)=>!C)},"aria-label":u?"Hide value":"Reveal value",className:"absolute inset-y-0 right-1 my-auto flex h-6 w-6 items-center justify-center rounded text-muted-foreground/70 transition-colors hover:bg-muted hover:text-foreground",children:u?S(He,{className:"h-3.5 w-3.5"}):S(pe,{className:"h-3.5 w-3.5"})})]})]}),U("label",{className:"flex cursor-pointer items-center gap-2 select-none text-[11px] text-muted-foreground",children:[S("input",{type:"checkbox",checked:c,onChange:(C)=>{d(C.target.checked)},className:"h-3 w-3 accent-primary"}),U("span",{className:"flex items-center gap-1",children:[S(lt,{className:"h-3 w-3"}),"Mark as secret"]})]})]}),U("button",{type:"submit",disabled:!P,className:"group/save flex w-full items-center gap-2.5 border-t border-border/60 bg-gradient-to-r from-muted/30 to-muted/10 px-3 py-2.5 text-left text-xs transition-colors hover:from-muted/50 hover:to-muted/30 disabled:cursor-not-allowed disabled:opacity-50",children:[S("span",{className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-md bg-primary/10 text-primary ring-1 ring-primary/15",children:S(p,{className:"h-3 w-3"})}),U("span",{className:"flex min-w-0 flex-1 flex-col",children:[S("span",{className:"text-[12px] font-medium leading-tight",children:"Create variable"}),S("span",{className:"truncate text-[10px] leading-tight text-muted-foreground",children:P?U(jn,{children:["Link this field to"," ",S("span",{className:"font-mono text-foreground/80",children:w})]}):"Enter a name to continue"})]}),S(Oe,{className:"h-3.5 w-3.5 text-muted-foreground/60 transition-transform group-hover/save:translate-x-0.5 group-disabled/save:translate-x-0"})]})]})},Wl=Jl(function({selected:r,value:o,placeholder:a,disabled:s,open:i,onOpen:l},c){let d=Boolean(o),u=Boolean(r);return U("button",{ref:c,type:"button","aria-expanded":i,disabled:s,onClick:l,className:e("group/trigger relative flex h-9 w-full items-center gap-2 rounded-md border bg-background px-2.5 text-left text-sm shadow-xs transition-all outline-none","hover:border-ring/50","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","disabled:cursor-not-allowed disabled:opacity-50",d?"border-primary/20 bg-primary/[0.03]":"border-input"),children:[S("span",{"aria-hidden":!0,className:e("flex h-5 w-5 shrink-0 items-center justify-center rounded-sm transition-colors",d?"bg-primary/10 text-primary":"bg-muted text-muted-foreground"),children:S(St,{className:"h-3 w-3"})}),d?U("span",{className:"flex min-w-0 flex-1 items-center gap-1.5",children:[S("span",{className:"truncate font-mono text-[12.5px] tracking-tight",children:o}),!u&&S("span",{title:"Not in your variables list",className:"rounded-sm border border-dashed border-muted-foreground/40 px-1 py-px text-[9px] uppercase tracking-wider text-muted-foreground",children:"Unresolved"})]}):S("span",{className:"flex-1 truncate text-muted-foreground",children:a}),S(Fe,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground/60 transition-colors group-hover/trigger:text-muted-foreground"})]})});Wl.displayName="LinkedTrigger";var Bf=({value:t,onChange:r,onBlur:o,placeholder:a,disabled:s,masked:i,inputId:l})=>{let[c,d]=We(!1),u=i&&!c?"password":"text";return U("div",{className:e("group/inline relative flex h-9 w-full items-center rounded-md border border-input bg-background pl-2.5 pr-1 shadow-xs transition-all","focus-within:border-ring focus-within:ring-ring/50 focus-within:ring-[3px]"),children:[S("span",{"aria-hidden":!0,className:"mr-2 flex h-5 w-5 shrink-0 items-center justify-center rounded-sm bg-muted text-muted-foreground",children:S(ct,{className:"h-3 w-3"})}),S("input",{id:l,type:u,value:t,onChange:(g)=>{r(g.target.value)},onBlur:o,placeholder:a,disabled:s,autoComplete:"off",spellCheck:!1,className:"flex-1 bg-transparent font-mono text-[12.5px] tracking-tight outline-none placeholder:font-sans placeholder:tracking-normal placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50"}),i&&S("button",{type:"button",onClick:()=>{d((g)=>!g)},"aria-label":c?"Hide value":"Reveal value",className:"flex h-7 w-7 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",children:c?S(He,{className:"h-3.5 w-3.5"}):S(pe,{className:"h-3.5 w-3.5"})})]})},Ff=({options:t,value:r,onSelect:o})=>U("div",{className:"px-1",children:[U("div",{className:"flex items-center justify-between px-2 pt-2 pb-1",children:[S("span",{className:"text-[10px] font-medium uppercase tracking-[0.12em] text-muted-foreground/80",children:"Linked variables"}),S("span",{className:"text-[10px] tabular-nums text-muted-foreground/60",children:t.length})]}),S(Z,{className:"!p-0 [&_[cmdk-group-heading]]:hidden",children:t.map((a)=>{let s=r===a.key;return U(N,{value:a.key,keywords:[a.key,a.description??""],onSelect:()=>{o(a.key)},className:e("group/row relative my-px cursor-pointer rounded-md px-2 py-1.5 transition-colors","data-[selected=true]:bg-muted/60 data-[selected=true]:text-foreground",s&&"bg-primary/[0.05]"),children:[s&&S("span",{"aria-hidden":!0,className:"absolute inset-y-1.5 left-0 w-[2px] rounded-r bg-primary"}),S("span",{"aria-hidden":!0,className:e("flex h-5 w-5 shrink-0 items-center justify-center rounded-sm transition-colors",s?"bg-primary/15 text-primary":"bg-muted/60 text-muted-foreground/70 group-hover/row:bg-muted"),children:S(lt,{className:"h-3 w-3"})}),U("div",{className:"flex min-w-0 flex-1 flex-col",children:[S("span",{className:e("truncate font-mono text-[12.5px] tracking-tight",s&&"text-primary"),children:a.key}),a.description!==void 0&&a.description!==""&&S("span",{className:"truncate text-[10.5px] leading-tight text-muted-foreground",children:a.description})]}),s?S(p,{className:"h-3.5 w-3.5 shrink-0 text-primary"}):S("span",{"aria-hidden":!0,className:"h-3.5 w-3.5 shrink-0 text-transparent transition-colors group-data-[selected=true]/row:text-muted-foreground/40",children:S(Oe,{className:"h-3.5 w-3.5"})})]},a.key)})})]}),_f=()=>U("div",{className:"space-y-1.5 px-2 py-3",children:[U("div",{className:"flex items-center justify-between px-1 pb-1",children:[S("span",{className:"text-[10px] font-medium uppercase tracking-[0.12em] text-muted-foreground/60",children:"Loading"}),S(T,{className:"h-3 w-3 animate-spin text-muted-foreground/60"})]}),[0.95,0.7,0.85].map((t,r)=>U("div",{className:"flex items-center gap-2 rounded-md px-2 py-1.5",style:{opacity:1-r*0.18},children:[S("div",{className:"h-5 w-5 shrink-0 animate-pulse rounded-sm bg-muted/70"}),S("div",{className:"h-3 animate-pulse rounded bg-muted/70",style:{width:`${t*100}%`}})]},r))]}),zf=({query:t,canCreate:r,onCreate:o})=>{let a=t.trim();return U("div",{className:"flex flex-col items-center gap-2 px-4 py-7 text-center",children:[S("span",{"aria-hidden":!0,className:"flex h-9 w-9 items-center justify-center rounded-full bg-muted/60 text-muted-foreground/70",children:S(lt,{className:"h-4 w-4"})}),U("div",{className:"space-y-0.5",children:[S("p",{className:"text-[12px] font-medium text-foreground",children:a?U(jn,{children:["No variables match"," ",U("span",{className:"font-mono text-foreground",children:['"',a,'"']})]}):"No variables yet"}),S("p",{className:"text-[10.5px] leading-snug text-muted-foreground",children:"Variables let you reuse secrets across connectors and rotate them in one place."})]}),r&&U(n,{type:"button",size:"sm",variant:"outline",onClick:o,className:"mt-1 h-7 text-[11px]",children:[S(Ge,{className:"h-3 w-3"}),a?`Create "${a.toUpperCase().replaceAll(/[^A-Z0-9_]/gu,"_")}"`:"Create variable"]})]})},$f=({options:t,optionsLoading:r,optionsFetching:o,value:a,query:s,onQueryChange:i,onSelect:l,onCreate:c,suggestedName:d,showCreate:u,onShowCreate:g})=>{if(u&&c)return S(Vf,{suggestedName:d??s.trim(),onSubmit:(w)=>{c(w)},onCancel:()=>{g(!1)}});let b=S(Ff,{options:t,value:a,onSelect:l});if(r)b=S(_f,{});else if(t.length===0)b=S(zf,{query:s,canCreate:Boolean(c),onCreate:()=>{g(!0)}});return U("div",{className:"flex flex-col",children:[U("div",{className:"relative flex items-center gap-2 border-b border-border/60 bg-muted/15 px-3 py-2",children:[S(Be,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground/70"}),S("input",{autoFocus:!0,type:"text",value:s,onChange:(w)=>{i(w.target.value)},placeholder:"Search variables…",autoComplete:"off",spellCheck:!1,className:"flex-1 bg-transparent text-xs tracking-tight outline-none placeholder:text-muted-foreground/60"}),U("div",{className:"flex h-4 w-4 items-center justify-center",children:[o&&!r&&S(T,{className:"h-3 w-3 animate-spin text-muted-foreground/70"}),!o&&s&&S("button",{type:"button",onClick:()=>{i("")},"aria-label":"Clear search",className:"rounded p-0.5 text-muted-foreground/60 transition-colors hover:bg-muted hover:text-foreground",children:S(x,{className:"h-3 w-3"})})]})]}),S(se,{shouldFilter:!1,className:"rounded-none bg-transparent",loop:!0,children:S(me,{className:"max-h-[280px] py-1",children:b})}),c&&U("button",{type:"button",onClick:()=>{g(!0)},className:"group/cta flex w-full items-center gap-2.5 border-t border-border/60 bg-gradient-to-r from-muted/30 to-muted/10 px-3 py-2.5 text-left text-xs transition-colors hover:from-muted/50 hover:to-muted/30",children:[S("span",{className:"flex h-6 w-6 items-center justify-center rounded-md bg-primary/10 text-primary ring-1 ring-primary/15",children:S(Ge,{className:"h-3 w-3"})}),U("span",{className:"flex min-w-0 flex-1 flex-col",children:[S("span",{className:"text-[12px] font-medium leading-tight",children:"Create new variable"}),S("span",{className:"text-[10px] leading-tight text-muted-foreground",children:"Encrypted at rest · reusable across connectors"})]}),S(Oe,{className:"h-3.5 w-3.5 text-muted-foreground/60 transition-transform group-hover/cta:translate-x-0.5"})]})]})},Jf=Jl(function({value:r,mode:o,onChange:a,onBlur:s,options:i,optionsLoading:l,optionsFetching:c,onSearch:d,onCreate:u,onResolve:g,onUpdate:b,suggestedName:w,placeholder:P="Select variable…",disabled:C=!1,masked:A=!0,className:j},B){let[O,H]=We(!1),[F,X]=We(""),[V,_]=We(!1),[W,oe]=We(!1),[K,de]=We(null),[ye,ve]=We(!1),[Re,Me]=We(!1),[Ae,be]=We(null),qe=Af(),he=Yr((Y)=>{if(Y===o)return;a("",Y),_(!1),X("")},[o,a]),_e=Yr((Y)=>{a(Y===r?"":Y,"linked"),H(!1),_(!1)},[r,a]),q=Yr((Y)=>{a(Y,"inline")},[a]),ce=Yr(async(Y)=>{if(!u)return;let it=await u(Y);_(!1),H(!1),a(it.key,"linked")},[u,a]),ae=Yr(async()=>{if(!r||!g)return;oe(!0),ve(!0),be(null);try{let Y=await g(r);de(Y??{key:r,secret:!0,value:null})}catch(Y){be(Y instanceof Error?Y.message:"Failed to load variable"),de({key:r,secret:!0,value:null})}ve(!1)},[r,g]),Ce=Yr(async(Y)=>{if(!b||!r)return;Me(!0);try{await b({key:r,value:Y}),oe(!1)}catch(it){throw Me(!1),it}Me(!1)},[b,r]),st=Yr((Y)=>{X(Y),d?.(Y)},[d]),Se=i.find((Y)=>Y.key===r),Rr=o==="linked"&&Boolean(r)&&Boolean(b);return U("div",{className:e("space-y-1.5",j),children:[U("div",{className:"flex items-center gap-1.5",children:[S("div",{className:"min-w-0 flex-1",children:o==="linked"?U(R,{open:O,onOpenChange:(Y)=>{if(H(Y),!Y)_(!1),s?.()},modal:!0,children:[S(L,{asChild:!0,children:S(Wl,{ref:B,selected:Se,value:r,placeholder:P,disabled:C,open:O,onOpen:()=>{H(!0)}})}),S(I,{className:"w-[--radix-popover-trigger-width] min-w-[300px] overflow-hidden border-border/80 p-0 shadow-xl",side:"bottom",align:"start",sideOffset:6,children:S($f,{options:i,optionsLoading:Boolean(l),optionsFetching:Boolean(c),value:r,query:F,onQueryChange:st,onSelect:_e,onCreate:u?ce:void 0,suggestedName:w,showCreate:V,onShowCreate:_})})]}):S(Bf,{inputId:qe,value:r,onChange:q,onBlur:()=>s?.(),placeholder:P||"Enter value",disabled:C,masked:A})}),Rr&&U(R,{open:W,onOpenChange:(Y)=>{if(oe(Y),!Y)de(null),be(null);else if(!K)ae()},modal:!0,children:[S(L,{asChild:!0,children:S(n,{type:"button",variant:"outline",size:"icon",disabled:C,"aria-label":"Edit linked variable value",title:"Edit linked variable value",className:"h-9 w-9 shrink-0 border-input text-muted-foreground hover:text-foreground",children:S(ct,{className:"h-3.5 w-3.5"})})}),U(I,{align:"end",side:"bottom",sideOffset:6,className:"w-80 p-0 shadow-lg",children:[Ae!==null&&Ae!==""&&S("div",{className:"border-b border-destructive/30 bg-destructive/5 px-3 py-2 text-[11px] text-destructive",children:Ae}),S(Hf,{variableKey:r,initialValue:K?.value??"",isSecret:K?.secret??!0,loading:ye,saving:Re,onSubmit:(Y)=>{Ce(Y)},onCancel:()=>{oe(!1)}},`${r}:${K?.value??""}`)]})]}),S(Of,{mode:o,onModeChange:he,disabled:C})]}),S("p",{className:"flex items-center gap-1.5 text-[10.5px] leading-tight text-muted-foreground/80",children:o==="linked"?U(jn,{children:[S(St,{className:"h-3 w-3"}),S("span",{children:"Reads from an org variable. Rotate values in one place; every connector picks it up."})]}):U(jn,{children:[S(ct,{className:"h-3 w-3"}),U("span",{children:["Stored inline on this connector. Use"," ",S("span",{className:"font-medium text-foreground/80",children:"Linked"})," ","to share across connectors."]})]})})]})});import{useMemo as jf}from"react";import{jsx as $o,jsxs as Ma}from"react/jsx-runtime";var Gf=(t)=>{let r="",o=0,a=" ",s=t.replaceAll(/>\s*</gu,`>
6
+ `},ip={onDragStart(t){let{active:r}=t;return"Picked up draggable item "+r.id+"."},onDragOver(t){let{active:r,over:n}=t;if(n)return"Draggable item "+r.id+" was moved over droppable area "+n.id+".";return"Draggable item "+r.id+" is no longer over a droppable area."},onDragEnd(t){let{active:r,over:n}=t;if(n)return"Draggable item "+r.id+" was dropped over droppable area "+n.id;return"Draggable item "+r.id+" was dropped."},onDragCancel(t){let{active:r}=t;return"Dragging was cancelled. Draggable item "+r.id+" was dropped."}};function lp(t){let{announcements:r=ip,container:n,hiddenTextDescribedById:o,screenReaderInstructions:s=sp}=t,{announce:l,announcement:c}=Ni(),d=Nr("DndLiveRegion"),[u,p]=it(!1);if(me(()=>{p(!0)},[]),op(be(()=>({onDragStart(f){let{active:h}=f;l(r.onDragStart({active:h}))},onDragMove(f){let{active:h,over:R}=f;if(r.onDragMove)l(r.onDragMove({active:h,over:R}))},onDragOver(f){let{active:h,over:R}=f;l(r.onDragOver({active:h,over:R}))},onDragEnd(f){let{active:h,over:R}=f;l(r.onDragEnd({active:h,over:R}))},onDragCancel(f){let{active:h,over:R}=f;l(r.onDragCancel({active:h,over:R}))}}),[l,r])),!u)return null;let m=gt.createElement(gt.Fragment,null,gt.createElement(yi,{id:o,value:s.draggable}),gt.createElement(wi,{id:d,announcement:c}));return n?np(m,n):m}var ge;(function(t){t.DragStart="dragStart",t.DragMove="dragMove",t.DragEnd="dragEnd",t.DragCancel="dragCancel",t.DragOver="dragOver",t.RegisterDroppable="registerDroppable",t.SetDroppableDisabled="setDroppableDisabled",t.UnregisterDroppable="unregisterDroppable"})(ge||(ge={}));function bo(){}function Ra(t,r){return be(()=>({sensor:t,options:r!=null?r:{}}),[t,r])}function Hi(){for(var t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];return be(()=>[...r].filter((o)=>o!=null),[...r])}var ct=Object.freeze({x:0,y:0});function Vi(t,r){return Math.sqrt(Math.pow(t.x-r.x,2)+Math.pow(t.y-r.y,2))}function Bi(t,r){let{data:{value:n}}=t,{data:{value:o}}=r;return n-o}function cp(t,r){let{data:{value:n}}=t,{data:{value:o}}=r;return o-n}function Ri(t){let{left:r,top:n,height:o,width:s}=t;return[{x:r,y:n},{x:r+s,y:n},{x:r,y:n+o},{x:r+s,y:n+o}]}function Ca(t,r){if(!t||t.length===0)return null;let[n]=t;return r?n[r]:n}function Ci(t,r,n){if(r===void 0)r=t.left;if(n===void 0)n=t.top;return{x:r+t.width*0.5,y:n+t.height*0.5}}var Fi=(t)=>{let{collisionRect:r,droppableRects:n,droppableContainers:o}=t,s=Ci(r,r.left,r.top),l=[];for(let c of o){let{id:d}=c,u=n.get(d);if(u){let p=Vi(Ci(u),s);l.push({id:d,data:{droppableContainer:c,value:p}})}}return l.sort(Bi)},_i=(t)=>{let{collisionRect:r,droppableRects:n,droppableContainers:o}=t,s=Ri(r),l=[];for(let c of o){let{id:d}=c,u=n.get(d);if(u){let p=Ri(u),m=s.reduce((h,R,x)=>h+Vi(p[x],R),0),f=Number((m/4).toFixed(4));l.push({id:d,data:{droppableContainer:c,value:f}})}}return l.sort(Bi)};function dp(t,r){let n=Math.max(r.top,t.top),o=Math.max(r.left,t.left),s=Math.min(r.left+r.width,t.left+t.width),l=Math.min(r.top+r.height,t.top+t.height),c=s-o,d=l-n;if(o<s&&n<l){let u=r.width*r.height,p=t.width*t.height,m=c*d,f=m/(u+p-m);return Number(f.toFixed(4))}return 0}var up=(t)=>{let{collisionRect:r,droppableRects:n,droppableContainers:o}=t,s=[];for(let l of o){let{id:c}=l,d=n.get(c);if(d){let u=dp(d,r);if(u>0)s.push({id:c,data:{droppableContainer:l,value:u}})}}return s.sort(cp)};function pp(t,r,n){return{...t,scaleX:r&&n?r.width/n.width:1,scaleY:r&&n?r.height/n.height:1}}function zi(t,r){return t&&r?{x:t.left-r.left,y:t.top-r.top}:ct}function mp(t){return function(n){for(var o=arguments.length,s=Array(o>1?o-1:0),l=1;l<o;l++)s[l-1]=arguments[l];return s.reduce((c,d)=>({...c,top:c.top+t*d.y,bottom:c.bottom+t*d.y,left:c.left+t*d.x,right:c.right+t*d.x}),{...n})}}var fp=mp(1);function gp(t){if(t.startsWith("matrix3d(")){let r=t.slice(9,-1).split(/, /);return{x:+r[12],y:+r[13],scaleX:+r[0],scaleY:+r[5]}}else if(t.startsWith("matrix(")){let r=t.slice(7,-1).split(/, /);return{x:+r[4],y:+r[5],scaleX:+r[0],scaleY:+r[3]}}return null}function bp(t,r,n){let o=gp(r);if(!o)return t;let{scaleX:s,scaleY:l,x:c,y:d}=o,u=t.left-c-(1-s)*parseFloat(n),p=t.top-d-(1-l)*parseFloat(n.slice(n.indexOf(" ")+1)),m=s?t.width/s:t.width,f=l?t.height/l:t.height;return{width:m,height:f,top:p,right:u+m,bottom:p+f,left:u}}var vp={ignoreTransform:!1};function Sr(t,r){if(r===void 0)r=vp;let n=t.getBoundingClientRect();if(r.ignoreTransform){let{transform:p,transformOrigin:m}=Oe(t).getComputedStyle(t);if(p)n=bp(n,p,m)}let{top:o,left:s,width:l,height:c,bottom:d,right:u}=n;return{top:o,left:s,width:l,height:c,bottom:d,right:u}}function Si(t){return Sr(t,{ignoreTransform:!0})}function hp(t){let{innerWidth:r,innerHeight:n}=t;return{top:0,left:0,right:r,bottom:n,width:r,height:n}}function xp(t,r){if(r===void 0)r=Oe(t).getComputedStyle(t);return r.position==="fixed"}function yp(t,r){if(r===void 0)r=Oe(t).getComputedStyle(t);let n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some((s)=>{let l=r[s];return typeof l==="string"?n.test(l):!1})}function Dn(t,r){let n=[];function o(s){if(r!=null&&n.length>=r)return n;if(!s)return n;if(co(s)&&s.scrollingElement!=null&&!n.includes(s.scrollingElement))return n.push(s.scrollingElement),n;if(!nn(s)||ba(s))return n;if(n.includes(s))return n;let l=Oe(t).getComputedStyle(s);if(s!==t){if(yp(s,l))n.push(s)}if(xp(s,l))return n;return o(s.parentNode)}if(!t)return n;return o(t)}function $i(t){let[r]=Dn(t,1);return r!=null?r:null}function va(t){if(!Cn||!t)return null;if(yr(t))return t;if(!lo(t))return null;if(co(t)||t===wr(t).scrollingElement)return window;if(nn(t))return t;return null}function ji(t){if(yr(t))return t.scrollX;return t.scrollLeft}function Ji(t){if(yr(t))return t.scrollY;return t.scrollTop}function ya(t){return{x:ji(t),y:Ji(t)}}var Ne;(function(t){t[t.Forward=1]="Forward",t[t.Backward=-1]="Backward"})(Ne||(Ne={}));function Gi(t){if(!Cn||!t)return!1;return t===document.scrollingElement}function Wi(t){let r={x:0,y:0},n=Gi(t)?{height:window.innerHeight,width:window.innerWidth}:{height:t.clientHeight,width:t.clientWidth},o={x:t.scrollWidth-n.width,y:t.scrollHeight-n.height},s=t.scrollTop<=r.y,l=t.scrollLeft<=r.x,c=t.scrollTop>=o.y,d=t.scrollLeft>=o.x;return{isTop:s,isLeft:l,isBottom:c,isRight:d,maxScroll:o,minScroll:r}}var wp={x:0.2,y:0.2};function Np(t,r,n,o,s){let{top:l,left:c,right:d,bottom:u}=n;if(o===void 0)o=10;if(s===void 0)s=wp;let{isTop:p,isBottom:m,isLeft:f,isRight:h}=Wi(t),R={x:0,y:0},x={x:0,y:0},S={height:r.height*s.y,width:r.width*s.x};if(!p&&l<=r.top+S.height)R.y=Ne.Backward,x.y=o*Math.abs((r.top+S.height-l)/S.height);else if(!m&&u>=r.bottom-S.height)R.y=Ne.Forward,x.y=o*Math.abs((r.bottom-S.height-u)/S.height);if(!h&&d>=r.right-S.width)R.x=Ne.Forward,x.x=o*Math.abs((r.right-S.width-d)/S.width);else if(!f&&c<=r.left+S.width)R.x=Ne.Backward,x.x=o*Math.abs((r.left+S.width-c)/S.width);return{direction:R,speed:x}}function Rp(t){if(t===document.scrollingElement){let{innerWidth:l,innerHeight:c}=window;return{top:0,left:0,right:l,bottom:c,width:l,height:c}}let{top:r,left:n,right:o,bottom:s}=t.getBoundingClientRect();return{top:r,left:n,right:o,bottom:s,width:t.clientWidth,height:t.clientHeight}}function Xi(t){return t.reduce((r,n)=>Rr(r,ya(n)),ct)}function Cp(t){return t.reduce((r,n)=>r+ji(n),0)}function Sp(t){return t.reduce((r,n)=>r+Ji(n),0)}function Pp(t,r){if(r===void 0)r=Sr;if(!t)return;let{top:n,left:o,bottom:s,right:l}=r(t);if(!$i(t))return;if(s<=0||l<=0||n>=window.innerHeight||o>=window.innerWidth)t.scrollIntoView({block:"center",inline:"center"})}var Tp=[["x",["left","right"],Cp],["y",["top","bottom"],Sp]];class ho{constructor(t,r){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;let n=Dn(r),o=Xi(n);this.rect={...t},this.width=t.width,this.height=t.height;for(let[s,l,c]of Tp)for(let d of l)Object.defineProperty(this,d,{get:()=>{let u=c(n),p=o[s]-u;return this.rect[d]+p},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class sn{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach((r)=>{var n;return(n=this.target)==null?void 0:n.removeEventListener(...r)})},this.target=t}add(t,r,n){var o;(o=this.target)==null||o.addEventListener(t,r,n),this.listeners.push([t,r,n])}}function kp(t){let{EventTarget:r}=Oe(t);return t instanceof r?t:wr(t)}function ha(t,r){let n=Math.abs(t.x),o=Math.abs(t.y);if(typeof r==="number")return Math.sqrt(n**2+o**2)>r;if("x"in r&&"y"in r)return n>r.x&&o>r.y;if("x"in r)return n>r.x;if("y"in r)return o>r.y;return!1}var ot;(function(t){t.Click="click",t.DragStart="dragstart",t.Keydown="keydown",t.ContextMenu="contextmenu",t.Resize="resize",t.SelectionChange="selectionchange",t.VisibilityChange="visibilitychange"})(ot||(ot={}));function Pi(t){t.preventDefault()}function Lp(t){t.stopPropagation()}var Y;(function(t){t.Space="Space",t.Down="ArrowDown",t.Right="ArrowRight",t.Left="ArrowLeft",t.Up="ArrowUp",t.Esc="Escape",t.Enter="Enter",t.Tab="Tab"})(Y||(Y={}));var Ui={start:[Y.Space,Y.Enter],cancel:[Y.Esc],end:[Y.Space,Y.Enter,Y.Tab]},Dp=(t,r)=>{let{currentCoordinates:n}=r;switch(t.code){case Y.Right:return{...n,x:n.x+25};case Y.Left:return{...n,x:n.x-25};case Y.Down:return{...n,y:n.y+25};case Y.Up:return{...n,y:n.y-25}}return};class En{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;let{event:{target:r}}=t;this.props=t,this.listeners=new sn(wr(r)),this.windowListeners=new sn(Oe(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(ot.Resize,this.handleCancel),this.windowListeners.add(ot.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(ot.Keydown,this.handleKeyDown))}handleStart(){let{activeNode:t,onStart:r}=this.props,n=t.node.current;if(n)Pp(n);r(ct)}handleKeyDown(t){if(Pn(t)){let{active:r,context:n,options:o}=this.props,{keyboardCodes:s=Ui,coordinateGetter:l=Dp,scrollBehavior:c="smooth"}=o,{code:d}=t;if(s.end.includes(d)){this.handleEnd(t);return}if(s.cancel.includes(d)){this.handleCancel(t);return}let{collisionRect:u}=n.current,p=u?{x:u.left,y:u.top}:ct;if(!this.referenceCoordinates)this.referenceCoordinates=p;let m=l(t,{active:r,context:n.current,currentCoordinates:p});if(m){let f=Cr(m,p),h={x:0,y:0},{scrollableAncestors:R}=n.current;for(let x of R){let S=t.code,{isTop:B,isRight:E,isLeft:P,isBottom:k,maxScroll:M,minScroll:j}=Wi(x),D=Rp(x),A={x:Math.min(S===Y.Right?D.right-D.width/2:D.right,Math.max(S===Y.Right?D.left:D.left+D.width/2,m.x)),y:Math.min(S===Y.Down?D.bottom-D.height/2:D.bottom,Math.max(S===Y.Down?D.top:D.top+D.height/2,m.y))},F=S===Y.Right&&!E||S===Y.Left&&!P,Z=S===Y.Down&&!k||S===Y.Up&&!B;if(F&&A.x!==m.x){let X=x.scrollLeft+f.x,oe=S===Y.Right&&X<=M.x||S===Y.Left&&X>=j.x;if(oe&&!f.y){x.scrollTo({left:X,behavior:c});return}if(oe)h.x=x.scrollLeft-X;else h.x=S===Y.Right?x.scrollLeft-M.x:x.scrollLeft-j.x;if(h.x)x.scrollBy({left:-h.x,behavior:c});break}else if(Z&&A.y!==m.y){let X=x.scrollTop+f.y,oe=S===Y.Down&&X<=M.y||S===Y.Up&&X>=j.y;if(oe&&!f.x){x.scrollTo({top:X,behavior:c});return}if(oe)h.y=x.scrollTop-X;else h.y=S===Y.Down?x.scrollTop-M.y:x.scrollTop-j.y;if(h.y)x.scrollBy({top:-h.y,behavior:c});break}}this.handleMove(t,Rr(Cr(m,this.referenceCoordinates),h))}}}handleMove(t,r){let{onMove:n}=this.props;t.preventDefault(),n(r)}handleEnd(t){let{onEnd:r}=this.props;t.preventDefault(),this.detach(),r()}handleCancel(t){let{onCancel:r}=this.props;t.preventDefault(),this.detach(),r()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}En.activators=[{eventName:"onKeyDown",handler:(t,r,n)=>{let{keyboardCodes:o=Ui,onActivation:s}=r,{active:l}=n,{code:c}=t.nativeEvent;if(o.start.includes(c)){let d=l.activatorNode.current;if(d&&t.target!==d)return!1;return t.preventDefault(),s==null||s({event:t.nativeEvent}),!0}return!1}}];function Ti(t){return Boolean(t&&"distance"in t)}function ki(t){return Boolean(t&&"delay"in t)}class xo{constructor(t,r,n){var o;if(n===void 0)n=kp(t.event.target);this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=r;let{event:s}=t,{target:l}=s;this.props=t,this.events=r,this.document=wr(l),this.documentListeners=new sn(this.document),this.listeners=new sn(n),this.windowListeners=new sn(Oe(l)),this.initialCoordinates=(o=mo(s))!=null?o:ct,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){let{events:t,props:{options:{activationConstraint:r,bypassActivationConstraint:n}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel)this.listeners.add(t.cancel.name,this.handleCancel);if(this.windowListeners.add(ot.Resize,this.handleCancel),this.windowListeners.add(ot.DragStart,Pi),this.windowListeners.add(ot.VisibilityChange,this.handleCancel),this.windowListeners.add(ot.ContextMenu,Pi),this.documentListeners.add(ot.Keydown,this.handleKeydown),r){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(ki(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(Ti(r)){this.handlePending(r);return}}this.handleStart()}detach(){if(this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null)clearTimeout(this.timeoutId),this.timeoutId=null}handlePending(t,r){let{active:n,onPending:o}=this.props;o(n,t,this.initialCoordinates,r)}handleStart(){let{initialCoordinates:t}=this,{onStart:r}=this.props;if(t)this.activated=!0,this.documentListeners.add(ot.Click,Lp,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(ot.SelectionChange,this.removeTextSelection),r(t)}handleMove(t){var r;let{activated:n,initialCoordinates:o,props:s}=this,{onMove:l,options:{activationConstraint:c}}=s;if(!o)return;let d=(r=mo(t))!=null?r:ct,u=Cr(o,d);if(!n&&c){if(Ti(c)){if(c.tolerance!=null&&ha(u,c.tolerance))return this.handleCancel();if(ha(u,c.distance))return this.handleStart()}if(ki(c)){if(ha(u,c.tolerance))return this.handleCancel()}this.handlePending(c,u);return}if(t.cancelable)t.preventDefault();l(d)}handleEnd(){let{onAbort:t,onEnd:r}=this.props;if(this.detach(),!this.activated)t(this.props.active);r()}handleCancel(){let{onAbort:t,onCancel:r}=this.props;if(this.detach(),!this.activated)t(this.props.active);r()}handleKeydown(t){if(t.code===Y.Esc)this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}var Ep={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Mn extends xo{constructor(t){let{event:r}=t,n=wr(r.target);super(t,Ep,n)}}Mn.activators=[{eventName:"onPointerDown",handler:(t,r)=>{let{nativeEvent:n}=t,{onActivation:o}=r;if(!n.isPrimary||n.button!==0)return!1;return o==null||o({event:n}),!0}}];var Mp={move:{name:"mousemove"},end:{name:"mouseup"}},wa;(function(t){t[t.RightClick=2]="RightClick"})(wa||(wa={}));class Ki extends xo{constructor(t){super(t,Mp,wr(t.event.target))}}Ki.activators=[{eventName:"onMouseDown",handler:(t,r)=>{let{nativeEvent:n}=t,{onActivation:o}=r;if(n.button===wa.RightClick)return!1;return o==null||o({event:n}),!0}}];var xa={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Yi extends xo{constructor(t){super(t,xa)}static setup(){return window.addEventListener(xa.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(xa.move.name,t)};function t(){}}}Yi.activators=[{eventName:"onTouchStart",handler:(t,r)=>{let{nativeEvent:n}=t,{onActivation:o}=r,{touches:s}=n;if(s.length>1)return!1;return o==null||o({event:n}),!0}}];var Tn;(function(t){t[t.Pointer=0]="Pointer",t[t.DraggableRect=1]="DraggableRect"})(Tn||(Tn={}));var vo;(function(t){t[t.TreeOrder=0]="TreeOrder",t[t.ReversedTreeOrder=1]="ReversedTreeOrder"})(vo||(vo={}));function Ip(t){let{acceleration:r,activator:n=Tn.Pointer,canScroll:o,draggingRect:s,enabled:l,interval:c=5,order:d=vo.TreeOrder,pointerCoordinates:u,scrollableAncestors:p,scrollableAncestorRects:m,delta:f,threshold:h}=t,R=Op({delta:f,disabled:!l}),[x,S]=bi(),B=Pe({x:0,y:0}),E=Pe({x:0,y:0}),P=be(()=>{switch(n){case Tn.Pointer:return u?{top:u.y,bottom:u.y,left:u.x,right:u.x}:null;case Tn.DraggableRect:return s}},[n,s,u]),k=Pe(null),M=lt(()=>{let D=k.current;if(!D)return;let A=B.current.x*E.current.x,F=B.current.y*E.current.y;D.scrollBy(A,F)},[]),j=be(()=>d===vo.TreeOrder?[...p].reverse():p,[d,p]);me(()=>{if(!l||!p.length||!P){S();return}for(let D of j){if((o==null?void 0:o(D))===!1)continue;let A=p.indexOf(D),F=m[A];if(!F)continue;let{direction:Z,speed:X}=Np(D,F,P,r,h);for(let oe of["x","y"])if(!R[oe][Z[oe]])X[oe]=0,Z[oe]=0;if(X.x>0||X.y>0){S(),k.current=D,x(M,c),B.current=X,E.current=Z;return}}B.current={x:0,y:0},E.current={x:0,y:0},S()},[r,M,o,S,l,c,JSON.stringify(P),JSON.stringify(R),x,p,j,m,JSON.stringify(h)])}var Ap={x:{[Ne.Backward]:!1,[Ne.Forward]:!1},y:{[Ne.Backward]:!1,[Ne.Forward]:!1}};function Op(t){let{delta:r,disabled:n}=t,o=po(r);return an((s)=>{if(n||!o||!s)return Ap;let l={x:Math.sign(r.x-o.x),y:Math.sign(r.y-o.y)};return{x:{[Ne.Backward]:s.x[Ne.Backward]||l.x===-1,[Ne.Forward]:s.x[Ne.Forward]||l.x===1},y:{[Ne.Backward]:s.y[Ne.Backward]||l.y===-1,[Ne.Forward]:s.y[Ne.Forward]||l.y===1}}},[n,r,o])}function Hp(t,r){let n=r!=null?t.get(r):void 0,o=n?n.node.current:null;return an((s)=>{var l;if(r==null)return null;return(l=o!=null?o:s)!=null?l:null},[o,r])}function Vp(t,r){return be(()=>t.reduce((n,o)=>{let{sensor:s}=o,l=s.activators.map((c)=>({eventName:c.eventName,handler:r(c.handler,o)}));return[...n,...l]},[]),[t,r])}var kn;(function(t){t[t.Always=0]="Always",t[t.BeforeDragging=1]="BeforeDragging",t[t.WhileDragging=2]="WhileDragging"})(kn||(kn={}));var Na;(function(t){t.Optimized="optimized"})(Na||(Na={}));var Li=new Map;function Bp(t,r){let{dragging:n,dependencies:o,config:s}=r,[l,c]=it(null),{frequency:d,measure:u,strategy:p}=s,m=Pe(t),f=B(),h=on(f),R=lt(function(E){if(E===void 0)E=[];if(h.current)return;c((P)=>{if(P===null)return E;return P.concat(E.filter((k)=>!P.includes(k)))})},[h]),x=Pe(null),S=an((E)=>{if(f&&!n)return Li;if(!E||E===Li||m.current!==t||l!=null){let P=new Map;for(let k of t){if(!k)continue;if(l&&l.length>0&&!l.includes(k.id)&&k.rect.current){P.set(k.id,k.rect.current);continue}let M=k.node.current,j=M?new ho(u(M),M):null;if(k.rect.current=j,j)P.set(k.id,j)}return P}return E},[t,l,n,f,u]);return me(()=>{m.current=t},[t]),me(()=>{if(f)return;R()},[n,f]),me(()=>{if(l&&l.length>0)c(null)},[JSON.stringify(l)]),me(()=>{if(f||typeof d!=="number"||x.current!==null)return;x.current=setTimeout(()=>{R(),x.current=null},d)},[d,f,R,...o]),{droppableRects:S,measureDroppableContainers:R,measuringScheduled:l!=null};function B(){switch(p){case kn.Always:return!1;case kn.BeforeDragging:return n;default:return!n}}}function qi(t,r){return an((n)=>{if(!t)return null;if(n)return n;return typeof r==="function"?r(t):t},[r,t])}function Fp(t,r){return qi(t,r)}function _p(t){let{callback:r,disabled:n}=t,o=uo(r),s=be(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;let{MutationObserver:l}=window;return new l(o)},[o,n]);return me(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function yo(t){let{callback:r,disabled:n}=t,o=uo(r),s=be(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;let{ResizeObserver:l}=window;return new l(o)},[n]);return me(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function zp(t){return new ho(Sr(t),t)}function Di(t,r,n){if(r===void 0)r=zp;let[o,s]=it(null);function l(){s((u)=>{if(!t)return null;if(t.isConnected===!1){var p;return(p=u!=null?u:n)!=null?p:null}let m=r(t);if(JSON.stringify(u)===JSON.stringify(m))return u;return m})}let c=_p({callback(u){if(!t)return;for(let p of u){let{type:m,target:f}=p;if(m==="childList"&&f instanceof HTMLElement&&f.contains(t)){l();break}}}}),d=yo({callback:l});return nt(()=>{if(l(),t)d==null||d.observe(t),c==null||c.observe(document.body,{childList:!0,subtree:!0});else d==null||d.disconnect(),c==null||c.disconnect()},[t]),o}function $p(t){let r=qi(t);return zi(t,r)}var Ei=[];function jp(t){let r=Pe(t),n=an((o)=>{if(!t)return Ei;if(o&&o!==Ei&&t&&r.current&&t.parentNode===r.current.parentNode)return o;return Dn(t)},[t]);return me(()=>{r.current=t},[t]),n}function Jp(t){let[r,n]=it(null),o=Pe(t),s=lt((l)=>{let c=va(l.target);if(!c)return;n((d)=>{if(!d)return null;return d.set(c,ya(c)),new Map(d)})},[]);return me(()=>{let l=o.current;if(t!==l){c(l);let d=t.map((u)=>{let p=va(u);if(p)return p.addEventListener("scroll",s,{passive:!0}),[p,ya(p)];return null}).filter((u)=>u!=null);n(d.length?new Map(d):null),o.current=t}return()=>{c(t),c(l)};function c(d){d.forEach((u)=>{let p=va(u);p==null||p.removeEventListener("scroll",s)})}},[s,t]),be(()=>{if(t.length)return r?Array.from(r.values()).reduce((l,c)=>Rr(l,c),ct):Xi(t);return ct},[t,r])}function Mi(t,r){if(r===void 0)r=[];let n=Pe(null);return me(()=>{n.current=null},r),me(()=>{let o=t!==ct;if(o&&!n.current)n.current=t;if(!o&&n.current)n.current=null},[t]),n.current?Cr(t,n.current):ct}function Gp(t){me(()=>{if(!Cn)return;let r=t.map((n)=>{let{sensor:o}=n;return o.setup==null?void 0:o.setup()});return()=>{for(let n of r)n==null||n()}},t.map((r)=>{let{sensor:n}=r;return n}))}function Wp(t,r){return be(()=>t.reduce((n,o)=>{let{eventName:s,handler:l}=o;return n[s]=(c)=>{l(c,r)},n},{}),[t,r])}function Zi(t){return be(()=>t?hp(t):null,[t])}var Ii=[];function Xp(t,r){if(r===void 0)r=Sr;let[n]=t,o=Zi(n?Oe(n):null),[s,l]=it(Ii);function c(){l(()=>{if(!t.length)return Ii;return t.map((u)=>Gi(u)?o:new ho(r(u),u))})}let d=yo({callback:c});return nt(()=>{d==null||d.disconnect(),c(),t.forEach((u)=>d==null?void 0:d.observe(u))},[t]),s}function Up(t){if(!t)return null;if(t.children.length>1)return t;let r=t.children[0];return nn(r)?r:t}function Kp(t){let{measure:r}=t,[n,o]=it(null),s=lt((p)=>{for(let{target:m}of p)if(nn(m)){o((f)=>{let h=r(m);return f?{...f,width:h.width,height:h.height}:h});break}},[r]),l=yo({callback:s}),c=lt((p)=>{let m=Up(p);if(l==null||l.disconnect(),m)l==null||l.observe(m);o(m?r(m):null)},[r,l]),[d,u]=Sn(c);return be(()=>({nodeRef:d,rect:n,setRef:u}),[n,d,u])}var Yp=[{sensor:Mn,options:{}},{sensor:En,options:{}}],qp={current:{}},go={draggable:{measure:Si},droppable:{measure:Si,strategy:kn.WhileDragging,frequency:Na.Optimized},dragOverlay:{measure:Sr}};class ln extends Map{get(t){var r;return t!=null?(r=super.get(t))!=null?r:void 0:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter((t)=>{let{disabled:r}=t;return!r})}getNodeFor(t){var r,n;return(r=(n=this.get(t))==null?void 0:n.node.current)!=null?r:void 0}}var Zp={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new ln,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:bo},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:go,measureDroppableContainers:bo,windowRect:null,measuringScheduled:!1},Qp={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:bo,draggableNodes:new Map,over:null,measureDroppableContainers:bo},wo=Ln(Qp),Qi=Ln(Zp);function em(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new ln}}}function tm(t,r){switch(r.type){case ge.DragStart:return{...t,draggable:{...t.draggable,initialCoordinates:r.initialCoordinates,active:r.active}};case ge.DragMove:if(t.draggable.active==null)return t;return{...t,draggable:{...t.draggable,translate:{x:r.coordinates.x-t.draggable.initialCoordinates.x,y:r.coordinates.y-t.draggable.initialCoordinates.y}}};case ge.DragEnd:case ge.DragCancel:return{...t,draggable:{...t.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case ge.RegisterDroppable:{let{element:n}=r,{id:o}=n,s=new ln(t.droppable.containers);return s.set(o,n),{...t,droppable:{...t.droppable,containers:s}}}case ge.SetDroppableDisabled:{let{id:n,key:o,disabled:s}=r,l=t.droppable.containers.get(n);if(!l||o!==l.key)return t;let c=new ln(t.droppable.containers);return c.set(n,{...l,disabled:s}),{...t,droppable:{...t.droppable,containers:c}}}case ge.UnregisterDroppable:{let{id:n,key:o}=r,s=t.droppable.containers.get(n);if(!s||o!==s.key)return t;let l=new ln(t.droppable.containers);return l.delete(n),{...t,droppable:{...t.droppable,containers:l}}}default:return t}}function rm(t){let{disabled:r}=t,{active:n,activatorEvent:o,draggableNodes:s}=cn(wo),l=po(o),c=po(n==null?void 0:n.id);return me(()=>{if(r)return;if(!o&&l&&c!=null){if(!Pn(l))return;if(document.activeElement===l.target)return;let d=s.get(c);if(!d)return;let{activatorNode:u,node:p}=d;if(!u.current&&!p.current)return;requestAnimationFrame(()=>{for(let m of[u.current,p.current]){if(!m)continue;let f=hi(m);if(f){f.focus();break}}})}},[o,r,s,c,l]),null}function nm(t,r){let{transform:n,...o}=r;return t!=null&&t.length?t.reduce((s,l)=>l({transform:s,...o}),n):n}function om(t){return be(()=>({draggable:{...go.draggable,...t==null?void 0:t.draggable},droppable:{...go.droppable,...t==null?void 0:t.droppable},dragOverlay:{...go.dragOverlay,...t==null?void 0:t.dragOverlay}}),[t==null?void 0:t.draggable,t==null?void 0:t.droppable,t==null?void 0:t.dragOverlay])}function am(t){let{activeNode:r,measure:n,initialRect:o,config:s=!0}=t,l=Pe(!1),{x:c,y:d}=typeof s==="boolean"?{x:s,y:s}:s;nt(()=>{if(!c&&!d||!r){l.current=!1;return}if(l.current||!o)return;let p=r==null?void 0:r.node.current;if(!p||p.isConnected===!1)return;let m=n(p),f=zi(m,o);if(!c)f.x=0;if(!d)f.y=0;if(l.current=!0,Math.abs(f.x)>0||Math.abs(f.y)>0){let h=$i(p);if(h)h.scrollBy({top:f.y,left:f.x})}},[r,c,d,o,n])}var el=Ln({...ct,scaleX:1,scaleY:1}),pr;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Initializing=1]="Initializing",t[t.Initialized=2]="Initialized"})(pr||(pr={}));var tl=tp(function(r){var n,o,s,l;let{id:c,accessibility:d,autoScroll:u=!0,children:p,sensors:m=Yp,collisionDetection:f=up,measuring:h,modifiers:R,...x}=r,S=rp(tm,void 0,em),[B,E]=S,[P,k]=ap(),[M,j]=it(pr.Uninitialized),D=M===pr.Initialized,{draggable:{active:A,nodes:F,translate:Z},droppable:{containers:X}}=B,oe=A!=null?F.get(A):null,fe=Pe({initial:null,translated:null}),ce=be(()=>{var Me;return A!=null?{id:A,data:(Me=oe==null?void 0:oe.data)!=null?Me:qp,rect:fe}:null},[A,oe]),he=Pe(null),[De,Ie]=it(null),[le,_e]=it(null),pe=on(x,Object.values(x)),Ae=Nr("DndDescribedBy",c),K=be(()=>X.getEnabled(),[X]),re=om(h),{droppableRects:ee,measureDroppableContainers:xe,measuringScheduled:ze}=Bp(K,{dragging:D,dependencies:[Z.x,Z.y],config:re.droppable}),ye=Hp(F,A),Et=be(()=>le?mo(le):null,[le]),U=ac(),$e=Fp(ye,re.draggable.measure);am({activeNode:A!=null?F.get(A):null,config:U.layoutShiftCompensation,initialRect:$e,measure:re.draggable.measure});let se=Di(ye,re.draggable.measure,$e),mn=Di(ye?ye.parentElement:null),ut=Pe({activatorEvent:null,active:null,activeNode:ye,collisionRect:null,collisions:null,droppableRects:ee,draggableNodes:F,draggingNode:null,draggingNodeRect:null,droppableContainers:X,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Dr=X.getNodeFor((n=ut.current.over)==null?void 0:n.id),xt=Kp({measure:re.dragOverlay.measure}),Er=(o=xt.nodeRef.current)!=null?o:ye,Mr=D?(s=xt.rect)!=null?s:se:null,Va=Boolean(xt.nodeRef.current&&xt.rect),Ba=$p(Va?null:se),Fo=Zi(Er?Oe(Er):null),Mt=jp(D?Dr!=null?Dr:ye:null),Vn=Xp(Mt),Bn=nm(R,{transform:{x:Z.x-Ba.x,y:Z.y-Ba.y,scaleX:1,scaleY:1},activatorEvent:le,active:ce,activeNodeRect:se,containerNodeRect:mn,draggingNodeRect:Mr,over:ut.current.over,overlayNodeRect:xt.rect,scrollableAncestors:Mt,scrollableAncestorRects:Vn,windowRect:Fo}),Fa=Et?Rr(Et,Z):null,_a=Jp(Mt),Zl=Mi(_a),Ql=Mi(_a,[se]),Ir=Rr(Bn,Zl),Ar=Mr?fp(Mr,Bn):null,fn=ce&&Ar?f({active:ce,collisionRect:Ar,droppableRects:ee,droppableContainers:K,pointerCoordinates:Fa}):null,za=Ca(fn,"id"),[At,$a]=it(null),ec=Va?Bn:Rr(Bn,Ql),tc=pp(ec,(l=At==null?void 0:At.rect)!=null?l:null,se),_o=Pe(null),ja=lt((Me,je)=>{let{sensor:Ge,options:Ot}=je;if(he.current==null)return;let qe=F.get(he.current);if(!qe)return;let We=Me.nativeEvent,pt=new Ge({active:he.current,activeNode:qe,event:We,options:Ot,context:ut,onAbort(Ce){if(!F.get(Ce))return;let{onDragAbort:mt}=pe.current,yt={id:Ce};mt==null||mt(yt),P({type:"onDragAbort",event:yt})},onPending(Ce,Ht,mt,yt){if(!F.get(Ce))return;let{onDragPending:bn}=pe.current,Vt={id:Ce,constraint:Ht,initialCoordinates:mt,offset:yt};bn==null||bn(Vt),P({type:"onDragPending",event:Vt})},onStart(Ce){let Ht=he.current;if(Ht==null)return;let mt=F.get(Ht);if(!mt)return;let{onDragStart:yt}=pe.current,gn={activatorEvent:We,active:{id:Ht,data:mt.data,rect:fe}};fo(()=>{yt==null||yt(gn),j(pr.Initializing),E({type:ge.DragStart,initialCoordinates:Ce,active:Ht}),P({type:"onDragStart",event:gn}),Ie(_o.current),_e(We)})},onMove(Ce){E({type:ge.DragMove,coordinates:Ce})},onEnd:Or(ge.DragEnd),onCancel:Or(ge.DragCancel)});_o.current=pt;function Or(Ce){return async function(){let{active:mt,collisions:yt,over:gn,scrollAdjustedTranslate:bn}=ut.current,Vt=null;if(mt&&bn){let{cancelDrop:vn}=pe.current;if(Vt={activatorEvent:We,active:mt,collisions:yt,delta:bn,over:gn},Ce===ge.DragEnd&&typeof vn==="function"){if(await Promise.resolve(vn(Vt)))Ce=ge.DragCancel}}he.current=null,fo(()=>{E({type:Ce}),j(pr.Uninitialized),$a(null),Ie(null),_e(null),_o.current=null;let vn=Ce===ge.DragEnd?"onDragEnd":"onDragCancel";if(Vt){let jo=pe.current[vn];jo==null||jo(Vt),P({type:vn,event:Vt})}})}}},[F]),rc=lt((Me,je)=>(Ge,Ot)=>{let qe=Ge.nativeEvent,We=F.get(Ot);if(he.current!==null||!We||qe.dndKit||qe.defaultPrevented)return;let pt={active:We};if(Me(Ge,je.options,pt)===!0)qe.dndKit={capturedBy:je.sensor},he.current=Ot,ja(Ge,je)},[F,ja]),Ja=Vp(m,rc);Gp(m),nt(()=>{if(se&&M===pr.Initializing)j(pr.Initialized)},[se,M]),me(()=>{let{onDragMove:Me}=pe.current,{active:je,activatorEvent:Ge,collisions:Ot,over:qe}=ut.current;if(!je||!Ge)return;let We={active:je,activatorEvent:Ge,collisions:Ot,delta:{x:Ir.x,y:Ir.y},over:qe};fo(()=>{Me==null||Me(We),P({type:"onDragMove",event:We})})},[Ir.x,Ir.y]),me(()=>{let{active:Me,activatorEvent:je,collisions:Ge,droppableContainers:Ot,scrollAdjustedTranslate:qe}=ut.current;if(!Me||he.current==null||!je||!qe)return;let{onDragOver:We}=pe.current,pt=Ot.get(za),Or=pt&&pt.rect.current?{id:pt.id,rect:pt.rect.current,data:pt.data,disabled:pt.disabled}:null,Ce={active:Me,activatorEvent:je,collisions:Ge,delta:{x:qe.x,y:qe.y},over:Or};fo(()=>{$a(Or),We==null||We(Ce),P({type:"onDragOver",event:Ce})})},[za]),nt(()=>{ut.current={activatorEvent:le,active:ce,activeNode:ye,collisionRect:Ar,collisions:fn,droppableRects:ee,draggableNodes:F,draggingNode:Er,draggingNodeRect:Mr,droppableContainers:X,over:At,scrollableAncestors:Mt,scrollAdjustedTranslate:Ir},fe.current={initial:Mr,translated:Ar}},[ce,ye,fn,Ar,F,Er,Mr,ee,X,At,Mt,Ir]),Ip({...U,delta:Z,draggingRect:Ar,pointerCoordinates:Fa,scrollableAncestors:Mt,scrollableAncestorRects:Vn});let nc=be(()=>({active:ce,activeNode:ye,activeNodeRect:se,activatorEvent:le,collisions:fn,containerNodeRect:mn,dragOverlay:xt,draggableNodes:F,droppableContainers:X,droppableRects:ee,over:At,measureDroppableContainers:xe,scrollableAncestors:Mt,scrollableAncestorRects:Vn,measuringConfiguration:re,measuringScheduled:ze,windowRect:Fo}),[ce,ye,se,le,fn,mn,xt,F,X,ee,At,xe,Mt,Vn,re,ze,Fo]),oc=be(()=>({activatorEvent:le,activators:Ja,active:ce,activeNodeRect:se,ariaDescribedById:{draggable:Ae},dispatch:E,draggableNodes:F,over:At,measureDroppableContainers:xe}),[le,Ja,ce,se,E,Ae,F,At,xe]);return gt.createElement(Oi.Provider,{value:k},gt.createElement(wo.Provider,{value:oc},gt.createElement(Qi.Provider,{value:nc},gt.createElement(el.Provider,{value:tc},p)),gt.createElement(rm,{disabled:(d==null?void 0:d.restoreFocus)===!1})),gt.createElement(lp,{...d,hiddenTextDescribedById:Ae}));function ac(){let Me=(De==null?void 0:De.autoScrollEnabled)===!1,je=typeof u==="object"?u.enabled===!1:u===!1,Ge=D&&!Me&&!je;if(typeof u==="object")return{...u,enabled:Ge};return{enabled:Ge}}}),sm=Ln(null),Ai="button",im="Draggable";function rl(t){let{id:r,data:n,disabled:o=!1,attributes:s}=t,l=Nr(im),{activators:c,activatorEvent:d,active:u,activeNodeRect:p,ariaDescribedById:m,draggableNodes:f,over:h}=cn(wo),{role:R=Ai,roleDescription:x="draggable",tabIndex:S=0}=s!=null?s:{},B=(u==null?void 0:u.id)===r,E=cn(B?el:sm),[P,k]=Sn(),[M,j]=Sn(),D=Wp(c,r),A=on(n);nt(()=>(f.set(r,{id:r,key:l,node:P,activatorNode:M,data:A}),()=>{let Z=f.get(r);if(Z&&Z.key===l)f.delete(r)}),[f,r]);let F=be(()=>({role:R,tabIndex:S,"aria-disabled":o,"aria-pressed":B&&R===Ai?!0:void 0,"aria-roledescription":x,"aria-describedby":m.draggable}),[o,R,S,B,x,m.draggable]);return{active:u,activatorEvent:d,activeNodeRect:p,attributes:F,isDragging:B,listeners:o?void 0:D,node:P,over:h,setNodeRef:k,setActivatorNodeRef:j,transform:E}}function nl(){return cn(Qi)}var lm="Droppable",cm={timeout:25};function ol(t){let{data:r,disabled:n=!1,id:o,resizeObserverConfig:s}=t,l=Nr(lm),{active:c,dispatch:d,over:u,measureDroppableContainers:p}=cn(wo),m=Pe({disabled:n}),f=Pe(!1),h=Pe(null),R=Pe(null),{disabled:x,updateMeasurementsFor:S,timeout:B}={...cm,...s},E=on(S!=null?S:o),P=lt(()=>{if(!f.current){f.current=!0;return}if(R.current!=null)clearTimeout(R.current);R.current=setTimeout(()=>{p(Array.isArray(E.current)?E.current:[E.current]),R.current=null},B)},[B]),k=yo({callback:P,disabled:x||!c}),M=lt((F,Z)=>{if(!k)return;if(Z)k.unobserve(Z),f.current=!1;if(F)k.observe(F)},[k]),[j,D]=Sn(M),A=on(r);return me(()=>{if(!k||!j.current)return;k.disconnect(),f.current=!1,k.observe(j.current)},[j,k]),me(()=>(d({type:ge.RegisterDroppable,element:{id:o,key:l,disabled:n,node:j,rect:h,data:A}}),()=>d({type:ge.UnregisterDroppable,key:l,id:o})),[o]),me(()=>{if(n!==m.current.disabled)d({type:ge.SetDroppableDisabled,id:o,key:l,disabled:n}),m.current.disabled=n},[o,l,n,d]),{active:c,rect:h,isOver:(u==null?void 0:u.id)===o,node:j,over:u,setNodeRef:D}}import al,{useMemo as Co,useRef as Sa,useEffect as So,useState as dm,useContext as um}from"react";function To(t,r,n){let o=t.slice();return o.splice(n<0?o.length+n:n,0,o.splice(r,1)[0]),o}function pm(t,r){return t.reduce((n,o,s)=>{let l=r.get(o);if(l)n[s]=l;return n},Array(t.length))}function No(t){return t!==null&&t>=0}function mm(t,r){if(t===r)return!0;if(t.length!==r.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==r[n])return!1;return!0}function fm(t){if(typeof t==="boolean")return{draggable:t,droppable:t};return t}var sl=(t)=>{let{rects:r,activeIndex:n,overIndex:o,index:s}=t,l=To(r,o,n),c=r[s],d=l[s];if(!d||!c)return null;return{x:d.left-c.left,y:d.top-c.top,scaleX:d.width/c.width,scaleY:d.height/c.height}};var Ro={scaleX:1,scaleY:1},il=(t)=>{var r;let{activeIndex:n,activeNodeRect:o,index:s,rects:l,overIndex:c}=t,d=(r=l[n])!=null?r:o;if(!d)return null;if(s===n){let p=l[c];if(!p)return null;return{x:0,y:n<c?p.top+p.height-(d.top+d.height):p.top-d.top,...Ro}}let u=gm(l,s,n);if(s>n&&s<=c)return{x:0,y:-d.height-u,...Ro};if(s<n&&s>=c)return{x:0,y:d.height+u,...Ro};return{x:0,y:0,...Ro}};function gm(t,r,n){let o=t[r],s=t[r-1],l=t[r+1];if(!o)return 0;if(n<r)return s?o.top-(s.top+s.height):l?l.top-(o.top+o.height):0;return l?l.top-(o.top+o.height):s?o.top-(s.top+s.height):0}var ll="Sortable",cl=al.createContext({activeIndex:-1,containerId:ll,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:sl,disabled:{draggable:!1,droppable:!1}});function dl(t){let{children:r,id:n,items:o,strategy:s=sl,disabled:l=!1}=t,{active:c,dragOverlay:d,droppableRects:u,over:p,measureDroppableContainers:m}=nl(),f=Nr(ll,n),h=Boolean(d.rect!==null),R=Co(()=>o.map((D)=>typeof D==="object"&&("id"in D)?D.id:D),[o]),x=c!=null,S=c?R.indexOf(c.id):-1,B=p?R.indexOf(p.id):-1,E=Sa(R),P=!mm(R,E.current),k=B!==-1&&S===-1||P,M=fm(l);nt(()=>{if(P&&x)m(R)},[P,R,x,m]),So(()=>{E.current=R},[R]);let j=Co(()=>({activeIndex:S,containerId:f,disabled:M,disableTransforms:k,items:R,overIndex:B,useDragOverlay:h,sortedRects:pm(R,u),strategy:s}),[S,f,M.draggable,M.droppable,k,R,B,u,h,s]);return al.createElement(cl.Provider,{value:j},r)}var bm=(t)=>{let{id:r,items:n,activeIndex:o,overIndex:s}=t;return To(n,o,s).indexOf(r)},vm=(t)=>{let{containerId:r,isSorting:n,wasDragging:o,index:s,items:l,newIndex:c,previousItems:d,previousContainerId:u,transition:p}=t;if(!p||!o)return!1;if(d!==l&&s===c)return!1;if(n)return!0;return c!==s&&r===u},hm={duration:200,easing:"ease"},ul="transform",xm=ur.Transition.toString({property:ul,duration:0,easing:"linear"}),ym={roleDescription:"sortable"};function wm(t){let{disabled:r,index:n,node:o,rect:s}=t,[l,c]=dm(null),d=Sa(n);return nt(()=>{if(!r&&n!==d.current&&o.current){let u=s.current;if(u){let p=Sr(o.current,{ignoreTransform:!0}),m={x:u.left-p.left,y:u.top-p.top,scaleX:u.width/p.width,scaleY:u.height/p.height};if(m.x||m.y)c(m)}}if(n!==d.current)d.current=n},[r,n,o,s]),So(()=>{if(l)c(null)},[l]),l}function pl(t){let{animateLayoutChanges:r=vm,attributes:n,disabled:o,data:s,getNewIndex:l=bm,id:c,strategy:d,resizeObserverConfig:u,transition:p=hm}=t,{items:m,containerId:f,activeIndex:h,disabled:R,disableTransforms:x,sortedRects:S,overIndex:B,useDragOverlay:E,strategy:P}=um(cl),k=Nm(o,R),M=m.indexOf(c),j=Co(()=>({sortable:{containerId:f,index:M,items:m},...s}),[f,s,M,m]),D=Co(()=>m.slice(m.indexOf(c)),[m,c]),{rect:A,node:F,isOver:Z,setNodeRef:X}=ol({id:c,data:j,disabled:k.droppable,resizeObserverConfig:{updateMeasurementsFor:D,...u}}),{active:oe,activatorEvent:fe,activeNodeRect:ce,attributes:he,setNodeRef:De,listeners:Ie,isDragging:le,over:_e,setActivatorNodeRef:pe,transform:Ae}=rl({id:c,data:j,attributes:{...ym,...n},disabled:k.draggable}),K=gi(X,De),re=Boolean(oe),ee=re&&!x&&No(h)&&No(B),xe=!E&&le,ze=xe&&ee?Ae:null,ye=d!=null?d:P,Et=ee?ze!=null?ze:ye({rects:S,activeNodeRect:ce,activeIndex:h,overIndex:B,index:M}):null,U=No(h)&&No(B)?l({id:c,items:m,activeIndex:h,overIndex:B}):M,$e=oe==null?void 0:oe.id,se=Sa({activeId:$e,items:m,newIndex:U,containerId:f}),mn=m!==se.current.items,ut=r({active:oe,containerId:f,isDragging:le,isSorting:re,id:c,index:M,items:m,newIndex:se.current.newIndex,previousItems:se.current.items,previousContainerId:se.current.containerId,transition:p,wasDragging:se.current.activeId!=null}),Dr=wm({disabled:!ut,index:M,node:F,rect:A});return So(()=>{if(re&&se.current.newIndex!==U)se.current.newIndex=U;if(f!==se.current.containerId)se.current.containerId=f;if(m!==se.current.items)se.current.items=m},[re,U,f,m]),So(()=>{if($e===se.current.activeId)return;if($e!=null&&se.current.activeId==null){se.current.activeId=$e;return}let Er=setTimeout(()=>{se.current.activeId=$e},50);return()=>clearTimeout(Er)},[$e]),{active:oe,activeIndex:h,attributes:he,data:j,rect:A,index:M,newIndex:U,items:m,isOver:Z,isSorting:re,isDragging:le,listeners:Ie,node:F,overIndex:B,over:_e,setNodeRef:K,setActivatorNodeRef:pe,setDroppableNodeRef:X,setDraggableNodeRef:De,transform:Dr!=null?Dr:Et,transition:xt()};function xt(){if(Dr||mn&&se.current.newIndex===M)return xm;if(xe&&!Pn(fe)||!p)return;if(re||ut)return ur.Transition.toString({...p,property:ul});return}}function Nm(t,r){var n,o;if(typeof t==="boolean")return{draggable:t,droppable:!1};return{draggable:(n=t==null?void 0:t.draggable)!=null?n:r.draggable,droppable:(o=t==null?void 0:t.droppable)!=null?o:r.droppable}}function Po(t){if(!t)return!1;let r=t.data.current;if(r&&"sortable"in r&&typeof r.sortable==="object"&&"containerId"in r.sortable&&"items"in r.sortable&&"index"in r.sortable)return!0;return!1}var Rm=[Y.Down,Y.Right,Y.Up,Y.Left],ml=(t,r)=>{let{context:{active:n,collisionRect:o,droppableRects:s,droppableContainers:l,over:c,scrollableAncestors:d}}=r;if(Rm.includes(t.code)){if(t.preventDefault(),!n||!o)return;let u=[];l.getEnabled().forEach((f)=>{if(!f||f!=null&&f.disabled)return;let h=s.get(f.id);if(!h)return;switch(t.code){case Y.Down:if(o.top<h.top)u.push(f);break;case Y.Up:if(o.top>h.top)u.push(f);break;case Y.Left:if(o.left>h.left)u.push(f);break;case Y.Right:if(o.left<h.left)u.push(f);break}});let p=_i({active:n,collisionRect:o,droppableRects:s,droppableContainers:u,pointerCoordinates:null}),m=Ca(p,"id");if(m===(c==null?void 0:c.id)&&p.length>1)m=p[1].id;if(m!=null){let f=l.get(n.id),h=l.get(m),R=h?s.get(h.id):null,x=h==null?void 0:h.node.current;if(x&&R&&f&&h){let B=Dn(x).some((D,A)=>d[A]!==D),E=fl(f,h),P=Cm(f,h),k=B||!E?{x:0,y:0}:{x:P?o.width-R.width:0,y:P?o.height-R.height:0},M={x:R.left,y:R.top};return k.x&&k.y?M:Cr(M,k)}}}return};function fl(t,r){if(!Po(t)||!Po(r))return!1;return t.data.current.sortable.containerId===r.data.current.sortable.containerId}function Cm(t,r){if(!Po(t)||!Po(r))return!1;if(!fl(t,r))return!1;return t.data.current.sortable.index<r.data.current.sortable.index}import{Fragment as Sm}from"react";import{jsx as mr,Fragment as km}from"react/jsx-runtime";var Pm=({id:t,label:r,children:n})=>{let{attributes:o,listeners:s,setNodeRef:l,transform:c,transition:d,isDragging:u}=pl({id:t}),p={opacity:u?0.5:1,position:"relative",transform:ur.Transform.toString(c),transition:d,zIndex:u?10:"auto"},m=mr("button",{type:"button",className:"touch-none cursor-grab text-muted-foreground/40 hover:text-muted-foreground active:cursor-grabbing",...o,...s,title:r!==void 0&&r!==""?`Drag ${r} to reorder`:"Drag to reorder","aria-label":r!==void 0&&r!==""?`Drag ${r} to reorder`:"Drag handle",children:mr(or,{className:"h-3.5 w-3.5"})});return mr("div",{ref:l,style:p,children:n(m)})},Tm=({items:t,onReorder:r,getItemLabel:n,renderItem:o,disabled:s=!1})=>{let l=Hi(Ra(Mn,{activationConstraint:{distance:4}}),Ra(En,{coordinateGetter:ml})),c=(d)=>{let{active:u,over:p}=d;if(!p||u.id===p.id)return;let m=t.findIndex((h)=>h.id===u.id),f=t.findIndex((h)=>h.id===p.id);if(m===-1||f===-1)return;r(To(t,m,f))};if(s)return t.map((d)=>mr(Sm,{children:o(d,null)},d.id));return mr(tl,{sensors:l,collisionDetection:Fi,onDragEnd:c,children:mr(dl,{items:t.map((d)=>d.id),strategy:il,children:t.map((d)=>mr(Pm,{id:d.id,label:n?.(d),children:(u)=>mr(km,{children:o(d,u)})},d.id))})})},Lm=Tm;import*as gl from"react";import{jsx as In,jsxs as Pa}from"react/jsx-runtime";var bl=({open:t,onOpenChange:r,title:n,description:o,confirmLabel:s,cancelLabel:l="Cancel",confirmVariant:c="default",pendingLabel:d="Processing...",errorContent:u,keepOpenWhilePending:p=!1,onConfirm:m})=>{let[f,h]=gl.useState(!1),R=async()=>{h(!0);try{if(await m()!==!1)r(!1)}catch(x){throw h(!1),x}h(!1)};return In(N,{open:t,onOpenChange:(x)=>{if(!(p&&f))r(x)},children:Pa(O,{children:[Pa(V,{children:[In(_,{children:n}),In(q,{children:o})]}),u,Pa(sr,{children:[In(a,{variant:"outline",onClick:()=>{r(!1)},disabled:f,children:l}),In(a,{variant:c,onClick:()=>{R()},disabled:f,children:f?d:s})]})]})})};bl.displayName="ConfirmDialog";var Dm=bl;import*as hl from"react";import{jsx as ko,jsxs as vl}from"react/jsx-runtime";var xl=hl.forwardRef(function({step:r,total:n,title:o,helper:s,action:l,className:c,...d},u){let p=Boolean(l);return vl("div",{ref:u,className:e("flex flex-wrap items-start justify-between gap-4",c),...d,children:[vl("div",{className:"min-w-0 space-y-1.5",children:[ko(Br,{tone:"accent",className:"tracking-[0.16em]",children:`Step ${r} of ${n}`}),ko("h2",{className:"text-lg font-semibold tracking-tight",children:o}),ko("p",{className:"max-w-xl text-sm leading-relaxed text-muted-foreground",children:s})]}),p?ko("div",{className:"shrink-0",children:l}):null]})});xl.displayName="StageHeader";var Em=xl;import{jsx as fr,jsxs as Ta}from"react/jsx-runtime";var Mm=i("flex h-10 w-10 shrink-0 items-center justify-center rounded-lg border [&_svg]:h-[18px] [&_svg]:w-[18px]",{defaultVariants:{tone:"default"},variants:{tone:{accent:"border-[color-mix(in_oklab,var(--accent)_28%,var(--border))] bg-[color-mix(in_oklab,var(--accent)_10%,var(--card))] text-(--accent)",danger:"border-[color-mix(in_oklab,var(--danger)_30%,var(--border))] bg-[color-mix(in_oklab,var(--danger)_12%,var(--card))] text-(--danger)",default:"border-border bg-muted/40 text-(--text-muted)",success:"border-[color-mix(in_oklab,var(--success)_30%,var(--border))] bg-[color-mix(in_oklab,var(--success)_12%,var(--card))] text-(--success)",warning:"border-[color-mix(in_oklab,var(--warning)_30%,var(--border))] bg-[color-mix(in_oklab,var(--warning)_12%,var(--card))] text-(--warning)"}}}),Im=i("shrink-0 [&_svg]:h-4 [&_svg]:w-4",{defaultVariants:{tone:"default"},variants:{tone:{accent:"text-(--accent)",danger:"text-(--danger)",default:"text-(--text-muted)",success:"text-(--success)",warning:"text-(--warning)"}}}),Lo=(t)=>t!==null&&t!==void 0&&t!==!1&&t!==0&&t!==0n&&t!==""&&!Number.isNaN(t),yl=({variant:t="tile",icon:r,label:n,value:o,detail:s,tone:l,className:c,...d})=>{if(t==="compact")return Ta(Ue,{className:e("gap-1 px-4 py-3.5",c),...d,children:[Ta("span",{className:"flex items-center justify-between gap-2",children:[fr("span",{className:"text-[11px] font-medium uppercase tracking-[0.14em] text-(--text-muted)",children:n}),Lo(r)?fr("span",{className:e(Im({tone:l})),"aria-hidden":!0,children:r}):null]}),fr("span",{className:"text-[22px] font-semibold leading-none tabular-nums tracking-tight text-(--text-primary)",children:o}),Lo(s)?fr("span",{className:"text-xs text-(--text-muted)",children:s}):null]});return Ta(Ue,{className:e("flex flex-col items-center gap-2.5 px-4 py-5 text-center","transition-colors hover:border-[color-mix(in_oklab,var(--accent)_22%,var(--border))]",c),...d,children:[Lo(r)?fr("span",{className:e(Mm({tone:l})),"aria-hidden":!0,children:r}):null,fr("span",{className:"text-[26px] font-semibold leading-none tabular-nums tracking-tight text-(--text-primary)",children:o}),fr("span",{className:"text-[11px] font-medium uppercase tracking-[0.14em] text-(--text-muted)",children:n}),Lo(s)?fr("span",{className:"text-xs text-(--text-muted)",children:s}):null]})};yl.displayName="StatTile";var Am=yl;import*as Nl from"react";import{jsx as wl,jsxs as Bm}from"react/jsx-runtime";var Om={danger:"border-[color-mix(in_oklab,var(--danger)_40%,var(--border))] bg-[color-mix(in_oklab,var(--danger)_8%,var(--card))] text-(--danger)",live:"border-[color-mix(in_oklab,var(--primary)_45%,var(--border))] bg-[color-mix(in_oklab,var(--primary)_8%,var(--card))] text-primary",neutral:"border-border bg-card text-muted-foreground",success:"border-[color-mix(in_oklab,var(--success)_38%,var(--border))] bg-[color-mix(in_oklab,var(--success)_8%,var(--card))] text-(--success)",warning:"border-[color-mix(in_oklab,var(--warning)_42%,var(--border))] bg-[color-mix(in_oklab,var(--warning)_9%,var(--card))] text-(--warning)"},Hm={danger:"danger",live:"primary",neutral:"neutral",success:"success",warning:"warning"},Vm=({tone:t,active:r=!1,label:n,className:o,children:s,...l},c)=>{let d="border-border bg-card text-muted-foreground";if(t)d=Om[t];else if(r)d="border-[color-mix(in_oklab,var(--primary)_45%,var(--border))] bg-[color-mix(in_oklab,var(--primary)_8%,var(--card))] text-primary";return Bm("div",{ref:c,className:e("inline-flex items-center gap-2 rounded-full border px-3 py-1 text-[10px] font-semibold uppercase tracking-[0.16em]",d,o),...l,children:[t?wl(Pt,{tone:Hm[t],pulse:t==="live"}):wl("span",{"aria-hidden":!0,className:e("h-1.5 w-1.5 rounded-full",r?"bg-primary shadow-[0_0_0_3px_color-mix(in_oklab,var(--primary)_22%,transparent)]":"bg-muted-foreground")}),s??n]})},Rl=Nl.forwardRef(Vm);Rl.displayName="StatusPill";var Fm=Rl;import*as Eo from"react";import{jsx as Do,jsxs as $m}from"react/jsx-runtime";var _m=i("relative min-w-0",{defaultVariants:{size:"md",variant:"pill"},variants:{size:{md:"",sm:""},variant:{pill:"",plain:""}}}),zm=i("pl-9 [&::-webkit-search-cancel-button]:appearance-none",{defaultVariants:{size:"md",variant:"pill"},variants:{size:{md:"",sm:"h-8 text-[13px]"},variant:{pill:"rounded-full bg-(--bg-surface)",plain:"bg-(--bg-surface)"}}}),Cl=({value:t,defaultValue:r,onValueChange:n,clearLabel:o,variant:s,size:l,className:c,classes:d,...u})=>{let[p,m]=Eo.useState(r??""),f=t!==void 0,h=f?t:p,R=Eo.useRef(null),x=(S)=>{if(!f)m(S);n?.(S)};return $m("div",{className:e(_m({size:l,variant:s}),d?.root,c),children:[Do(et,{"aria-hidden":!0,className:e("pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground",d?.icon)}),Do(g,{ref:R,type:"search",value:h,onChange:(S)=>{x(S.target.value)},className:e(zm({size:l,variant:s}),h!==void 0&&h!==""&&o!==void 0?"pr-9":void 0,d?.input),...u}),h!==void 0&&h!==""&&o!==void 0?Do("button",{type:"button","aria-label":o,onClick:()=>{x(""),R.current?.focus()},className:e("absolute right-2.5 top-1/2 flex size-5 -translate-y-1/2 items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-(--bg-surface-alt) hover:text-(--text-primary) focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",d?.clear),children:Do(L,{className:"h-3.5 w-3.5"})}):null]})};Cl.displayName="SearchField";var jm=Cl;import{createContext as Jm,useContext as Sl,useMemo as Gm,useState as Wm}from"react";import{createPortal as Xm}from"react-dom";import{jsx as Mo,jsxs as Zm}from"react/jsx-runtime";var ka=Jm(null),Um=({children:t})=>{let[r,n]=Wm(null),o=Gm(()=>({container:r,setContainer:n}),[r]);return Mo(ka.Provider,{value:o,children:t})},Pl=({className:t})=>{let r=Sl(ka);return Mo("div",{ref:r?.setContainer,className:e("ml-auto flex items-center gap-2 empty:hidden",t)})},Km=({children:t})=>{let r=Sl(ka);if(r===null)return t;return r.container===null?null:Xm(t,r.container)},Ym=({count:t})=>t===void 0?null:Mo("span",{className:"text-xs text-muted-foreground tabular-nums",children:t}),qm=({children:t,className:r})=>Zm("div",{className:e("flex flex-wrap items-center gap-3",r),children:[t,Mo(Pl,{})]});import{jsx as Io,jsxs as Tl}from"react/jsx-runtime";var kl=({title:t,description:r,value:n,options:o,onValueChange:s,align:l="center",className:c,...d})=>Tl("section",{className:e("flex min-w-0 flex-col gap-3 sm:flex-row sm:justify-between",l==="center"?"sm:items-center":"sm:items-start",c),...d,children:[Tl("div",{className:"min-w-0",children:[Io("h3",{className:"truncate text-sm font-semibold",children:t}),r!==void 0&&r!==null&&r!==!1&&r!==""&&r!==0?Io("p",{className:"mt-1 text-sm text-muted-foreground",children:r}):null]}),Io("div",{className:"inline-flex shrink-0 rounded-md border border-border bg-background p-1 shadow-xs",children:o.map((u)=>Io(a,{type:"button",size:"sm",variant:u.value===n?"secondary":"ghost",disabled:u.disabled,className:e("h-8 rounded-sm px-3",u.value===n&&"bg-primary/10 text-primary hover:bg-primary/15"),"aria-label":u.ariaLabel,"aria-pressed":u.value===n,onClick:()=>{s(u.value)},children:u.label},u.value))})]});kl.displayName="SectionSwitcher";import*as bt from"react";import{jsx as dt}from"react/jsx-runtime";var Ll=bt.createContext({value:1}),La=()=>bt.useContext(Ll),Qm=({value:t,defaultValue:r=1,indicators:n,className:o,...s})=>{let l=t??r,c=bt.useMemo(()=>({indicators:n,value:l}),[l,n]);return dt(Ll.Provider,{value:c,children:dt("div",{"data-slot":"stepper",className:e("space-y-8",o),...s})})},ef=({className:t,...r})=>dt("nav",{"data-slot":"stepper-nav","data-orientation":"horizontal",className:e("group/stepper-nav flex items-start justify-between gap-2",t),...r}),Da=bt.createContext({state:"inactive",step:1}),tf=({step:t,loading:r,className:n,...o})=>{let{value:s}=La(),l="inactive";if(r===!0)l="loading";else if(t<s)l="completed";else if(t===s)l="active";let c=bt.useMemo(()=>({state:l,step:t}),[l,t]);return dt(Da.Provider,{value:c,children:dt("div",{"data-slot":"stepper-item","data-state":l,"data-step":t,className:e("group/step relative flex-1 items-start",n),...o})})},rf=({className:t,...r})=>dt("div",{"data-slot":"stepper-trigger",className:e("flex flex-col items-center gap-2.5",t),...r}),nf=({className:t,children:r,...n})=>{let{indicators:o}=La(),{state:s}=bt.useContext(Da),l=o?.completed,c=o?.loading,d=r;if(s==="completed"&&Boolean(l))d=l;else if(s==="loading"&&Boolean(c))d=c;return dt("div",{"data-slot":"stepper-indicator","data-state":s,className:e("flex size-7 shrink-0 items-center justify-center rounded-full border-2 text-xs font-semibold transition-colors",s==="completed"&&"border-primary bg-primary text-primary-foreground",s==="active"&&"border-primary bg-primary text-primary-foreground",s==="loading"&&"border-primary bg-primary text-primary-foreground",s==="inactive"&&"border-muted-foreground/30 bg-background text-muted-foreground",t),...n,children:d})},of=({className:t,...r})=>{let{state:n}=bt.useContext(Da);return dt("span",{"data-slot":"stepper-title","data-state":n,className:e("text-sm font-medium",(n==="completed"||n==="active")&&"text-foreground",n==="inactive"&&"text-muted-foreground",t),...r})},af=({className:t,...r})=>dt("div",{"data-slot":"stepper-separator",className:e("h-0.5 rounded-full bg-muted-foreground/30 transition-colors","group-data-[state=completed]/step:bg-primary",t),...r}),sf=({className:t,...r})=>dt("div",{"data-slot":"stepper-panel",className:e(t),...r}),lf=({value:t,className:r,...n})=>{let{value:o}=La();if(t!==o)return null;return dt("div",{"data-slot":"stepper-content",className:e(r),...n})};import*as Tr from"react";import{jsx as Pr,jsxs as pf}from"react/jsx-runtime";var Ea=Tr.createContext({}),cf=({className:t,size:r,variant:n,...o})=>{let s=Tr.useMemo(()=>({size:r,variant:n}),[r,n]);return Pr(Ea.Provider,{value:s,children:Pr("fieldset",{"data-slot":"split-button",className:e("inline-flex min-w-0 items-stretch",t),...o})})},df=({className:t,...r})=>{let{size:n,variant:o}=Tr.useContext(Ea);return Pr(a,{"data-slot":"split-button-action",className:e("rounded-r-none",t),size:n,variant:o,...r})},uf=({align:t="end",children:r,contentClassName:n,disabled:o,label:s,...l})=>{let{size:c,variant:d}=Tr.useContext(Ea);return pf(ir,{...l,children:[Pr(lr,{asChild:!0,children:Pr(a,{"aria-label":s,"data-slot":"split-button-menu",className:"-ml-px rounded-l-none border-l border-l-current/20 px-2",disabled:o,size:c,variant:d,children:Pr(v,{})})}),Pr(cr,{align:t,className:n,children:r})]})};import*as dn from"react";import{jsx as vt,jsxs as Ao}from"react/jsx-runtime";var mf=({items:t,title:r,triggerAriaLabel:n="Technical details",copyLabel:o="Copy",trigger:s,align:l="end",side:c="bottom",onCopy:d,className:u,classes:p})=>{let[m,f]=dn.useState(null),h=dn.useRef(null);dn.useEffect(()=>()=>{if(h.current!==null)window.clearTimeout(h.current)},[]);let R=(x)=>{if(navigator.clipboard.writeText(x.value),f(x.label),h.current!==null)window.clearTimeout(h.current);h.current=window.setTimeout(()=>{f(null)},1500),d?.(x)};return Ao(z,{children:[vt(G,{asChild:!0,children:s??vt(a,{type:"button",variant:"ghost",size:"icon","aria-label":n,className:e("h-8 w-8 text-muted-foreground hover:text-foreground",p?.root,p?.trigger,u),children:vt($o,{className:"h-4 w-4"})})}),Ao(W,{align:l,side:c,className:e("w-80 p-3",p?.content),children:[r!==void 0&&r!==null?vt("div",{className:"mb-2 text-[10px] font-medium uppercase tracking-wider text-muted-foreground",children:r}):null,vt("dl",{className:"space-y-2.5",children:t.map((x)=>Ao("div",{className:e("min-w-0",p?.row),children:[vt("dt",{className:e("text-[11px] font-medium text-muted-foreground",p?.label),children:x.label}),Ao("dd",{className:"mt-0.5 flex min-w-0 items-start gap-1",children:[vt("code",{className:e("min-w-0 flex-1 select-all break-all rounded bg-muted/60 px-1.5 py-1 font-mono text-xs leading-relaxed text-foreground",p?.value),children:x.value}),x.copyable===!1?null:vt(a,{type:"button",variant:"ghost",size:"icon","aria-label":`${o} ${x.label}`,className:"h-6 w-6 shrink-0 text-muted-foreground hover:text-foreground",onClick:()=>{R(x)},children:m===x.label?vt(y,{className:"h-3.5 w-3.5"}):vt(ne,{className:"h-3.5 w-3.5"})})]})]},x.label))})]})]})};var ff=mf;import*as un from"react";import{jsx as Re,jsxs as kt,Fragment as El}from"react/jsx-runtime";var gf={disabled:!1,emptyMessage:"No option found.",loading:!1,loadingMessage:"Loading options...",modal:!1,placeholder:"Select option...",searchPlaceholder:"Search...",width:"200px"},bf=1,vf=0.5,hf=(t)=>t.children!==void 0,Ml=(t)=>t.flatMap((r)=>{if(!r.children)return[r];let n=Ml(r.children);return n.length>0?[{...r,children:n}]:[]}),Il=(t,r=[])=>t.flatMap((n)=>n.children?Il(n.children,[...r,n]):[{ancestorIds:r.map((o)=>o.id),node:n,path:r.map((o)=>o.label).join(" / ")}]),Dl=(t)=>({paddingLeft:`${vf+t*bf}rem`}),Al=un.forwardRef(function(r,n){let o={...gf,...r},{nodes:s,value:l,onChange:c,selectedLabel:d,placeholder:u,searchPlaceholder:p,emptyMessage:m,id:f,className:h,width:R,disabled:x,loading:S,loadingMessage:B,onSearchChange:E,modal:P}=o,[k,M]=un.useState(!1),[j,D]=un.useState(""),[A,F]=un.useState(()=>new Set),Z=Ml(s),X=Il(Z),oe=X.find((K)=>K.node.id===l),fe=j.trim().toLowerCase(),ce=(K)=>{if(K)F(new Set(oe?.ancestorIds));else if(j!=="")D(""),E?.("");M(K)},he=(K)=>{D(K),E?.(K)},De=(K)=>{F((re)=>{let ee=new Set(re);if(!ee.delete(K))ee.add(K);return ee})},Ie=(K)=>{c(K),ce(!1)},le=(K)=>kt(El,{children:[Re(y,{"aria-hidden":!0,className:e(l===K.id?"opacity-100":"opacity-0")}),K.icon]}),_e=(K,re)=>K.flatMap((ee)=>{if(!hf(ee))return[kt(de,{value:ee.id,style:Dl(re),onSelect:()=>{Ie(ee.id)},children:[le(ee),Re("span",{className:"min-w-0 truncate",title:ee.label,children:ee.label})]},ee.id)];let xe=A.has(ee.id),ze=xe?Ho:zo;return[kt(de,{value:ee.id,"aria-expanded":xe,style:Dl(re),onSelect:()=>{De(ee.id)},children:[Re(C,{"aria-hidden":!0,className:e(xe&&"rotate-90")}),ee.icon??Re(ze,{"aria-hidden":!0}),Re("span",{className:"min-w-0 truncate",title:ee.label,children:ee.label})]},ee.id),...xe&&ee.children?_e(ee.children,re+1):[]]}),pe=fe===""?[]:X.filter((K)=>E!==void 0||`${K.path} / ${K.node.label}`.toLowerCase().includes(fe)),Ae=oe?.node.label??d;return kt(z,{modal:P,open:k,onOpenChange:ce,children:[Re(G,{asChild:!0,children:kt(a,{ref:n,id:f,variant:"outline","aria-expanded":k,"aria-busy":S,className:e("justify-between",h),style:{width:R},disabled:x,children:[Ae===void 0?Re("span",{className:"min-w-0 truncate text-muted-foreground",children:u}):Re("span",{className:"min-w-0 truncate",children:Ae}),S?Re(b,{"aria-hidden":!0,className:"ml-2 size-4 shrink-0 animate-spin text-muted-foreground"}):Re(Je,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),Re(W,{className:"p-0",style:{width:"var(--radix-popover-trigger-width)"},children:kt(He,{shouldFilter:!1,children:[Re(Xt,{"aria-label":p,placeholder:p,value:j,onValueChange:he}),Re(Qe,{className:"max-h-[min(300px,calc(var(--radix-popover-content-available-height)-2.5rem))]",children:S?kt("div",{"aria-live":"polite",className:"flex items-center justify-center gap-2 px-3 py-6 text-sm text-muted-foreground",children:[Re(b,{"aria-hidden":!0,className:"size-4 animate-spin"}),B]}):kt(El,{children:[Re(Qt,{children:m}),Re(Le,{children:fe===""?_e(Z,0):pe.map((K)=>kt(de,{value:K.node.id,onSelect:()=>{Ie(K.node.id)},children:[le(K.node),Re("span",{className:"min-w-0 truncate",title:K.node.label,children:K.node.label}),K.path===""?null:Re("span",{className:"ml-auto min-w-0 shrink truncate pl-2 text-xs text-muted-foreground",title:K.path,children:K.path})]},K.node.id))})]})})]})})]})});Al.displayName="TreeSelect";import*as Hl from"react";import{jsx as Ol,jsxs as yf}from"react/jsx-runtime";var xf=({value:t,state:r="value",trailing:n,monospace:o=!0,className:s,...l},c)=>{let d=r==="secret";return yf("div",{ref:c,className:e("flex min-w-0 items-center gap-2",s),...l,children:[Ol("div",{className:e("flex min-w-0 flex-1 items-center border-b py-2",d?"border-[color-mix(in_oklab,var(--primary)_45%,var(--border))]":"border-border"),children:Ol("code",{className:e("block min-w-0 flex-1 overflow-x-auto whitespace-nowrap text-[13px] text-foreground",o?"font-mono":"font-sans"),children:t})}),n]})},Vl=Hl.forwardRef(xf);Vl.displayName="ValueRow";var wf=Vl;import{forwardRef as Bl,useCallback as kr,useLayoutEffect as Fl,useId as Nf,useRef as _l,useState as Be}from"react";import{jsx as w,jsxs as J,Fragment as An}from"react/jsx-runtime";var Rf=({mode:t,onModeChange:r,disabled:n})=>J("div",{role:"tablist","aria-label":"Value source",className:"relative inline-flex h-7 items-center rounded-full border border-border/70 bg-muted/40 p-0.5 text-[10px] font-medium tracking-[0.08em] uppercase shadow-inner",children:[w("span",{"aria-hidden":!0,className:e("absolute top-0.5 bottom-0.5 w-[calc(50%-2px)] rounded-full bg-background shadow-xs ring-1 ring-border/60 transition-transform duration-200 ease-out",t==="inline"&&"translate-x-[calc(100%+0px)]")}),J("button",{type:"button",role:"tab","aria-selected":t==="linked",disabled:n,onClick:()=>{r("linked")},className:e("relative z-10 flex items-center gap-1 rounded-full px-2.5 py-1 transition-colors",t==="linked"?"text-foreground":"text-muted-foreground hover:text-foreground"),children:[w(Xe,{className:"h-3 w-3"}),"Linked"]}),J("button",{type:"button",role:"tab","aria-selected":t==="inline",disabled:n,onClick:()=>{r("inline")},className:e("relative z-10 flex items-center gap-1 rounded-full px-2.5 py-1 transition-colors",t==="inline"?"text-foreground":"text-muted-foreground hover:text-foreground"),children:[w($t,{className:"h-3 w-3"}),"Inline"]})]}),Cf=({variableKey:t,initialValue:r,isSecret:n,loading:o,saving:s,onSubmit:l,onCancel:c})=>{let[d,u]=Be(r),[p,m]=Be(!1),f=_l(null);return Fl(()=>{if(!o)f.current?.focus()},[o]),J("form",{role:"presentation",onSubmit:(h)=>{h.preventDefault(),l(d)},onKeyDown:(h)=>{if(h.key==="Escape")h.preventDefault(),c()},className:"space-y-3 p-3",children:[J("div",{className:"flex items-start justify-between gap-2",children:[J("div",{className:"min-w-0",children:[w("p",{className:"text-[10px] font-medium uppercase tracking-[0.1em] text-muted-foreground",children:"Editing linked variable"}),w("p",{className:"mt-0.5 truncate font-mono text-xs text-foreground",children:t})]}),w("button",{type:"button",onClick:c,"aria-label":"Close editor",className:"rounded p-0.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",children:w(L,{className:"h-3.5 w-3.5"})})]}),J("div",{className:"space-y-1",children:[w(I,{htmlFor:"linked-value",className:"text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground",children:n?"Secret value":"Value"}),J("div",{className:"relative",children:[w(g,{ref:f,id:"linked-value",type:p?"text":"password",value:d,onChange:(h)=>{u(h.target.value)},placeholder:o?"Loading current value…":"Enter value",disabled:o||s,className:"h-8 pr-8 font-mono text-xs",autoComplete:"off",spellCheck:!1}),w("button",{type:"button",onClick:()=>{m((h)=>!h)},"aria-label":p?"Hide value":"Reveal value",className:"absolute inset-y-0 right-1 my-auto flex h-6 w-6 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",children:p?w(St,{className:"h-3.5 w-3.5"}):w(Ve,{className:"h-3.5 w-3.5"})})]})]}),J("div",{className:"flex items-center justify-between gap-2 pt-1",children:[J("p",{className:"text-[10px] leading-relaxed text-muted-foreground",children:["Updates the linked secret. Other connectors using"," ",w("span",{className:"font-mono",children:t})," will pick it up on their next run."]}),w(a,{type:"submit",size:"sm",disabled:o||s,className:"h-7 px-3 text-xs",children:s?J(An,{children:[w(b,{className:"h-3 w-3 animate-spin"}),"Saving"]}):"Save"})]})]})},Sf=({suggestedName:t,onSubmit:r,onCancel:n})=>{let[o,s]=Be(t),[l,c]=Be(""),[d,u]=Be(!0),[p,m]=Be(!1),f=_l(null);Fl(()=>{f.current?.focus(),f.current?.select()},[]);let h=o.trim(),R=h.length>0;return J("form",{role:"presentation",onSubmit:(x)=>{if(x.preventDefault(),R)r({key:h,secret:d,value:l})},onClick:(x)=>{x.stopPropagation()},onKeyDown:(x)=>{if(x.key==="Escape")x.preventDefault(),x.stopPropagation(),n()},className:"flex flex-col",children:[J("div",{className:"flex items-center gap-2 border-b border-border/60 bg-muted/15 px-3 py-2",children:[w("button",{type:"button",onClick:n,"aria-label":"Back to picker",className:"-ml-1 flex h-5 w-5 shrink-0 items-center justify-center rounded text-muted-foreground/70 transition-colors hover:bg-muted hover:text-foreground",children:w(rr,{className:"h-3.5 w-3.5"})}),w("span",{className:"flex-1 text-[10.5px] font-medium uppercase tracking-[0.12em] text-muted-foreground/80",children:"New variable"}),w(Rt,{className:"h-3 w-3 text-muted-foreground/60"})]}),J("div",{className:"space-y-2.5 px-3 py-2.5",children:[J("div",{className:"space-y-1",children:[w(I,{htmlFor:"var-key",className:"text-[10px] font-medium uppercase tracking-[0.1em] text-muted-foreground/70",children:"Name"}),J("div",{className:"relative",children:[w("span",{"aria-hidden":!0,className:"pointer-events-none absolute inset-y-0 left-2.5 flex items-center text-muted-foreground/60",children:w(Gt,{className:"h-3 w-3"})}),w(g,{ref:f,id:"var-key",value:o,onChange:(x)=>{s(x.target.value.toUpperCase())},placeholder:"VARIABLE_NAME",className:"h-8 pl-7 font-mono text-[12.5px] tracking-tight",autoComplete:"off",spellCheck:!1})]})]}),J("div",{className:"space-y-1",children:[w(I,{htmlFor:"var-value",className:"text-[10px] font-medium uppercase tracking-[0.1em] text-muted-foreground/70",children:"Value"}),J("div",{className:"relative",children:[w(g,{id:"var-value",type:p?"text":"password",value:l,onChange:(x)=>{c(x.target.value)},placeholder:"Encrypted at rest",className:"h-8 pr-8 font-mono text-[12.5px]",autoComplete:"off",spellCheck:!1}),w("button",{type:"button",onClick:()=>{m((x)=>!x)},"aria-label":p?"Hide value":"Reveal value",className:"absolute inset-y-0 right-1 my-auto flex h-6 w-6 items-center justify-center rounded text-muted-foreground/70 transition-colors hover:bg-muted hover:text-foreground",children:p?w(St,{className:"h-3.5 w-3.5"}):w(Ve,{className:"h-3.5 w-3.5"})})]})]}),J("label",{className:"flex cursor-pointer items-center gap-2 select-none text-[11px] text-muted-foreground",children:[w("input",{type:"checkbox",checked:d,onChange:(x)=>{u(x.target.checked)},className:"h-3 w-3 accent-primary"}),J("span",{className:"flex items-center gap-1",children:[w(Gt,{className:"h-3 w-3"}),"Mark as secret"]})]})]}),J("button",{type:"submit",disabled:!R,className:"group/save flex w-full items-center gap-2.5 border-t border-border/60 bg-gradient-to-r from-muted/30 to-muted/10 px-3 py-2.5 text-left text-xs transition-colors hover:from-muted/50 hover:to-muted/30 disabled:cursor-not-allowed disabled:opacity-50",children:[w("span",{className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-md bg-primary/10 text-primary ring-1 ring-primary/15",children:w(y,{className:"h-3 w-3"})}),J("span",{className:"flex min-w-0 flex-1 flex-col",children:[w("span",{className:"text-[12px] font-medium leading-tight",children:"Create variable"}),w("span",{className:"truncate text-[10px] leading-tight text-muted-foreground",children:R?J(An,{children:["Link this field to"," ",w("span",{className:"font-mono text-foreground/80",children:h})]}):"Enter a name to continue"})]}),w(Ze,{className:"h-3.5 w-3.5 text-muted-foreground/60 transition-transform group-hover/save:translate-x-0.5 group-disabled/save:translate-x-0"})]})]})},zl=Bl(function({selected:r,value:n,placeholder:o,disabled:s,open:l,onOpen:c},d){let u=Boolean(n),p=Boolean(r);return J("button",{ref:d,type:"button","aria-expanded":l,disabled:s,onClick:c,className:e("group/trigger relative flex h-9 w-full items-center gap-2 rounded-md border bg-background px-2.5 text-left text-sm shadow-xs transition-all outline-none","hover:border-ring/50","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","disabled:cursor-not-allowed disabled:opacity-50",u?"border-primary/20 bg-primary/[0.03]":"border-input"),children:[w("span",{"aria-hidden":!0,className:e("flex h-5 w-5 shrink-0 items-center justify-center rounded-sm transition-colors",u?"bg-primary/10 text-primary":"bg-muted text-muted-foreground"),children:w(Xe,{className:"h-3 w-3"})}),u?J("span",{className:"flex min-w-0 flex-1 items-center gap-1.5",children:[w("span",{className:"truncate font-mono text-[12.5px] tracking-tight",children:n}),!p&&w("span",{title:"Not in your variables list",className:"rounded-sm border border-dashed border-muted-foreground/40 px-1 py-px text-[9px] uppercase tracking-wider text-muted-foreground",children:"Unresolved"})]}):w("span",{className:"flex-1 truncate text-muted-foreground",children:o}),w(Je,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground/60 transition-colors group-hover/trigger:text-muted-foreground"})]})});zl.displayName="LinkedTrigger";var Pf=({value:t,onChange:r,onBlur:n,placeholder:o,disabled:s,masked:l,inputId:c})=>{let[d,u]=Be(!1),p=l&&!d?"password":"text";return J("div",{className:e("group/inline relative flex h-9 w-full items-center rounded-md border border-input bg-background pl-2.5 pr-1 shadow-xs transition-all","focus-within:border-ring focus-within:ring-ring/50 focus-within:ring-[3px]"),children:[w("span",{"aria-hidden":!0,className:"mr-2 flex h-5 w-5 shrink-0 items-center justify-center rounded-sm bg-muted text-muted-foreground",children:w($t,{className:"h-3 w-3"})}),w("input",{id:c,type:p,value:t,onChange:(m)=>{r(m.target.value)},onBlur:n,placeholder:o,disabled:s,autoComplete:"off",spellCheck:!1,className:"flex-1 bg-transparent font-mono text-[12.5px] tracking-tight outline-none placeholder:font-sans placeholder:tracking-normal placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50"}),l&&w("button",{type:"button",onClick:()=>{u((m)=>!m)},"aria-label":d?"Hide value":"Reveal value",className:"flex h-7 w-7 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",children:d?w(St,{className:"h-3.5 w-3.5"}):w(Ve,{className:"h-3.5 w-3.5"})})]})},Tf=({options:t,value:r,onSelect:n})=>J("div",{className:"px-1",children:[J("div",{className:"flex items-center justify-between px-2 pt-2 pb-1",children:[w("span",{className:"text-[10px] font-medium uppercase tracking-[0.12em] text-muted-foreground/80",children:"Linked variables"}),w("span",{className:"text-[10px] tabular-nums text-muted-foreground/60",children:t.length})]}),w(Le,{className:"!p-0 [&_[cmdk-group-heading]]:hidden",children:t.map((o)=>{let s=r===o.key;return J(de,{value:o.key,keywords:[o.key,o.description??""],onSelect:()=>{n(o.key)},className:e("group/row relative my-px cursor-pointer rounded-md px-2 py-1.5 transition-colors","data-[selected=true]:bg-muted/60 data-[selected=true]:text-foreground",s&&"bg-primary/[0.05]"),children:[s&&w("span",{"aria-hidden":!0,className:"absolute inset-y-1.5 left-0 w-[2px] rounded-r bg-primary"}),w("span",{"aria-hidden":!0,className:e("flex h-5 w-5 shrink-0 items-center justify-center rounded-sm transition-colors",s?"bg-primary/15 text-primary":"bg-muted/60 text-muted-foreground/70 group-hover/row:bg-muted"),children:w(Gt,{className:"h-3 w-3"})}),J("div",{className:"flex min-w-0 flex-1 flex-col",children:[w("span",{className:e("truncate font-mono text-[12.5px] tracking-tight",s&&"text-primary"),children:o.key}),o.description!==void 0&&o.description!==""&&w("span",{className:"truncate text-[10.5px] leading-tight text-muted-foreground",children:o.description})]}),s?w(y,{className:"h-3.5 w-3.5 shrink-0 text-primary"}):w("span",{"aria-hidden":!0,className:"h-3.5 w-3.5 shrink-0 text-transparent transition-colors group-data-[selected=true]/row:text-muted-foreground/40",children:w(Ze,{className:"h-3.5 w-3.5"})})]},o.key)})})]}),kf=()=>J("div",{className:"space-y-1.5 px-2 py-3",children:[J("div",{className:"flex items-center justify-between px-1 pb-1",children:[w("span",{className:"text-[10px] font-medium uppercase tracking-[0.12em] text-muted-foreground/60",children:"Loading"}),w(b,{className:"h-3 w-3 animate-spin text-muted-foreground/60"})]}),[0.95,0.7,0.85].map((t,r)=>J("div",{className:"flex items-center gap-2 rounded-md px-2 py-1.5",style:{opacity:1-r*0.18},children:[w("div",{className:"h-5 w-5 shrink-0 animate-pulse rounded-sm bg-muted/70"}),w("div",{className:"h-3 animate-pulse rounded bg-muted/70",style:{width:`${t*100}%`}})]},r))]}),Lf=({query:t,canCreate:r,onCreate:n})=>{let o=t.trim();return J("div",{className:"flex flex-col items-center gap-2 px-4 py-7 text-center",children:[w("span",{"aria-hidden":!0,className:"flex h-9 w-9 items-center justify-center rounded-full bg-muted/60 text-muted-foreground/70",children:w(Gt,{className:"h-4 w-4"})}),J("div",{className:"space-y-0.5",children:[w("p",{className:"text-[12px] font-medium text-foreground",children:o?J(An,{children:["No variables match"," ",J("span",{className:"font-mono text-foreground",children:['"',o,'"']})]}):"No variables yet"}),w("p",{className:"text-[10.5px] leading-snug text-muted-foreground",children:"Variables let you reuse secrets across connectors and rotate them in one place."})]}),r&&J(a,{type:"button",size:"sm",variant:"outline",onClick:n,className:"mt-1 h-7 text-[11px]",children:[w(Rt,{className:"h-3 w-3"}),o?`Create "${o.toUpperCase().replaceAll(/[^A-Z0-9_]/gu,"_")}"`:"Create variable"]})]})},Df=({options:t,optionsLoading:r,optionsFetching:n,value:o,query:s,onQueryChange:l,onSelect:c,onCreate:d,suggestedName:u,showCreate:p,onShowCreate:m})=>{if(p&&d)return w(Sf,{suggestedName:u??s.trim(),onSubmit:(h)=>{d(h)},onCancel:()=>{m(!1)}});let f=w(Tf,{options:t,value:o,onSelect:c});if(r)f=w(kf,{});else if(t.length===0)f=w(Lf,{query:s,canCreate:Boolean(d),onCreate:()=>{m(!0)}});return J("div",{className:"flex flex-col",children:[J("div",{className:"relative flex items-center gap-2 border-b border-border/60 bg-muted/15 px-3 py-2",children:[w(et,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground/70"}),w("input",{autoFocus:!0,type:"text",value:s,onChange:(h)=>{l(h.target.value)},placeholder:"Search variables…",autoComplete:"off",spellCheck:!1,className:"flex-1 bg-transparent text-xs tracking-tight outline-none placeholder:text-muted-foreground/60"}),J("div",{className:"flex h-4 w-4 items-center justify-center",children:[n&&!r&&w(b,{className:"h-3 w-3 animate-spin text-muted-foreground/70"}),!n&&s&&w("button",{type:"button",onClick:()=>{l("")},"aria-label":"Clear search",className:"rounded p-0.5 text-muted-foreground/60 transition-colors hover:bg-muted hover:text-foreground",children:w(L,{className:"h-3 w-3"})})]})]}),w(He,{shouldFilter:!1,className:"rounded-none bg-transparent",loop:!0,children:w(Qe,{className:"max-h-[280px] py-1",children:f})}),d&&J("button",{type:"button",onClick:()=>{m(!0)},className:"group/cta flex w-full items-center gap-2.5 border-t border-border/60 bg-gradient-to-r from-muted/30 to-muted/10 px-3 py-2.5 text-left text-xs transition-colors hover:from-muted/50 hover:to-muted/30",children:[w("span",{className:"flex h-6 w-6 items-center justify-center rounded-md bg-primary/10 text-primary ring-1 ring-primary/15",children:w(Rt,{className:"h-3 w-3"})}),J("span",{className:"flex min-w-0 flex-1 flex-col",children:[w("span",{className:"text-[12px] font-medium leading-tight",children:"Create new variable"}),w("span",{className:"text-[10px] leading-tight text-muted-foreground",children:"Encrypted at rest · reusable across connectors"})]}),w(Ze,{className:"h-3.5 w-3.5 text-muted-foreground/60 transition-transform group-hover/cta:translate-x-0.5"})]})]})},Ef=Bl(function({value:r,mode:n,onChange:o,onBlur:s,options:l,optionsLoading:c,optionsFetching:d,onSearch:u,onCreate:p,onResolve:m,onUpdate:f,suggestedName:h,placeholder:R="Select variable…",disabled:x=!1,masked:S=!0,className:B},E){let[P,k]=Be(!1),[M,j]=Be(""),[D,A]=Be(!1),[F,Z]=Be(!1),[X,oe]=Be(null),[fe,ce]=Be(!1),[he,De]=Be(!1),[Ie,le]=Be(null),_e=Nf(),pe=kr((U)=>{if(U===n)return;o("",U),A(!1),j("")},[n,o]),Ae=kr((U)=>{o(U===r?"":U,"linked"),k(!1),A(!1)},[r,o]),K=kr((U)=>{o(U,"inline")},[o]),re=kr(async(U)=>{if(!p)return;let $e=await p(U);A(!1),k(!1),o($e.key,"linked")},[p,o]),ee=kr(async()=>{if(!r||!m)return;Z(!0),ce(!0),le(null);try{let U=await m(r);oe(U??{key:r,secret:!0,value:null})}catch(U){le(U instanceof Error?U.message:"Failed to load variable"),oe({key:r,secret:!0,value:null})}ce(!1)},[r,m]),xe=kr(async(U)=>{if(!f||!r)return;De(!0);try{await f({key:r,value:U}),Z(!1)}catch($e){throw De(!1),$e}De(!1)},[f,r]),ze=kr((U)=>{j(U),u?.(U)},[u]),ye=l.find((U)=>U.key===r),Et=n==="linked"&&Boolean(r)&&Boolean(f);return J("div",{className:e("space-y-1.5",B),children:[J("div",{className:"flex items-center gap-1.5",children:[w("div",{className:"min-w-0 flex-1",children:n==="linked"?J(z,{open:P,onOpenChange:(U)=>{if(k(U),!U)A(!1),s?.()},modal:!0,children:[w(G,{asChild:!0,children:w(zl,{ref:E,selected:ye,value:r,placeholder:R,disabled:x,open:P,onOpen:()=>{k(!0)}})}),w(W,{className:"w-[--radix-popover-trigger-width] min-w-[300px] overflow-hidden border-border/80 p-0 shadow-xl",side:"bottom",align:"start",sideOffset:6,children:w(Df,{options:l,optionsLoading:Boolean(c),optionsFetching:Boolean(d),value:r,query:M,onQueryChange:ze,onSelect:Ae,onCreate:p?re:void 0,suggestedName:h,showCreate:D,onShowCreate:A})})]}):w(Pf,{inputId:_e,value:r,onChange:K,onBlur:()=>s?.(),placeholder:R||"Enter value",disabled:x,masked:S})}),Et&&J(z,{open:F,onOpenChange:(U)=>{if(Z(U),!U)oe(null),le(null);else if(!X)ee()},modal:!0,children:[w(G,{asChild:!0,children:w(a,{type:"button",variant:"outline",size:"icon",disabled:x,"aria-label":"Edit linked variable value",title:"Edit linked variable value",className:"h-9 w-9 shrink-0 border-input text-muted-foreground hover:text-foreground",children:w($t,{className:"h-3.5 w-3.5"})})}),J(W,{align:"end",side:"bottom",sideOffset:6,className:"w-80 p-0 shadow-lg",children:[Ie!==null&&Ie!==""&&w("div",{className:"border-b border-destructive/30 bg-destructive/5 px-3 py-2 text-[11px] text-destructive",children:Ie}),w(Cf,{variableKey:r,initialValue:X?.value??"",isSecret:X?.secret??!0,loading:fe,saving:he,onSubmit:(U)=>{xe(U)},onCancel:()=>{Z(!1)}},`${r}:${X?.value??""}`)]})]}),w(Rf,{mode:n,onModeChange:pe,disabled:x})]}),w("p",{className:"flex items-center gap-1.5 text-[10.5px] leading-tight text-muted-foreground/80",children:n==="linked"?J(An,{children:[w(Xe,{className:"h-3 w-3"}),w("span",{children:"Reads from an org variable. Rotate values in one place; every connector picks it up."})]}):J(An,{children:[w($t,{className:"h-3 w-3"}),J("span",{children:["Stored inline on this connector. Use"," ",w("span",{className:"font-medium text-foreground/80",children:"Linked"})," ","to share across connectors."]})]})})]})});import{useMemo as Mf}from"react";import{jsx as Oo,jsxs as Ma}from"react/jsx-runtime";var If=(t)=>{let r="",n=0,o=" ",s=t.replaceAll(/>\s*</gu,`>
7
7
  <`).split(`
8
- `);for(let i of s){let l=i.trim();if(!l)continue;if(l.startsWith("</"))o=Math.max(0,o-1);if(r+=`${a.repeat(o)+l}
9
- `,l.startsWith("<")&&!l.startsWith("</")&&!l.startsWith("<?")&&!l.endsWith("/>")&&!/<\/[^>]+>$/u.test(l))o+=1}return r.trim()},Wf=({open:t,onOpenChange:r,title:o="XML Viewer",data:a})=>{let s=jf(()=>Gf(a??""),[a]);return $o(k,{open:t,onOpenChange:r,children:Ma(E,{className:"max-w-2xl max-h-[80vh] flex flex-col",children:[Ma(G,{className:"flex flex-row items-center justify-between gap-2",children:[$o(M,{children:o}),Ma(n,{type:"button",variant:"outline",size:"sm",onClick:()=>{navigator.clipboard.writeText(s),D.success("Copied to clipboard")},children:[$o(ne,{className:"h-3.5 w-3.5 mr-1"}),"Copy"]})]}),$o("pre",{className:"min-h-0 flex-1 overflow-auto rounded-md bg-muted p-4 text-xs font-mono whitespace-pre",children:s})]})})};import{jsx as Rn,jsxs as Ia}from"react/jsx-runtime";var Xf=({title:t,children:r,details:o,className:a,open:s,defaultOpen:i=!1,onOpenChange:l,classes:c})=>Ia(Ke,{variant:"destructive",className:e("border-destructive/25 bg-destructive/5","has-[>svg]:grid-cols-[1rem_minmax(0,1fr)]",c?.root,a),children:[Rn(ut,{"aria-hidden":"true"}),t!==void 0&&t!==null&&Rn(je,{className:e("line-clamp-none min-w-0 break-words text-foreground",c?.title),children:t}),Rn(Ye,{className:e("min-w-0 break-words",c?.message),children:r}),o!==void 0&&Ia(J,{open:s,defaultOpen:i,onOpenChange:l,className:e("col-start-2 mt-3 min-w-0",c?.details),children:[Ia(ee,{type:"button",className:e("group inline-flex max-w-full items-center gap-1.5 rounded-sm text-left","text-xs font-medium text-foreground underline-offset-4 hover:underline","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",c?.trigger),children:[Rn(v,{"aria-hidden":"true",className:"size-3.5 shrink-0 transition-transform group-data-[state=open]:rotate-180 motion-reduce:transition-none"}),o.label]}),Rn(te,{children:Rn("div",{className:e("mt-3 min-w-0 rounded-md border border-border bg-background/70 p-3 text-sm text-foreground",c?.content),children:o.content})})]})]});import{jsx as fr,jsxs as Aa,Fragment as qf}from"react/jsx-runtime";var Xl=(t)=>Math.max(0,Math.min(100,Math.round(t))),Oa=(t)=>Xl(t.value??0),Uf=(t)=>{if(t.length===0)return 0;return Xl(t.reduce((r,o)=>r+Oa(o),0)/t.length)},Kf=({lane:t})=>{let r=t.fillClassName??"bg-primary";if(t.mode==="indeterminate")return Aa(qf,{children:[fr("div",{className:e("absolute inset-y-0 w-1/3 rounded-full motion-reduce:w-full motion-reduce:opacity-40",r),"data-slot":"lane-progress-indeterminate",style:{animation:"lane-progress-indeterminate 1.35s linear infinite"}}),fr("style",{children:`@keyframes lane-progress-indeterminate {
8
+ `);for(let l of s){let c=l.trim();if(!c)continue;if(c.startsWith("</"))n=Math.max(0,n-1);if(r+=`${o.repeat(n)+c}
9
+ `,c.startsWith("<")&&!c.startsWith("</")&&!c.startsWith("<?")&&!c.endsWith("/>")&&!/<\/[^>]+>$/u.test(c))n+=1}return r.trim()},Af=({open:t,onOpenChange:r,title:n="XML Viewer",data:o})=>{let s=Mf(()=>If(o??""),[o]);return Oo(N,{open:t,onOpenChange:r,children:Ma(O,{className:"max-w-2xl max-h-[80vh] flex flex-col",children:[Ma(V,{className:"flex flex-row items-center justify-between gap-2",children:[Oo(_,{children:n}),Ma(a,{type:"button",variant:"outline",size:"sm",onClick:()=>{navigator.clipboard.writeText(s),ue.success("Copied to clipboard")},children:[Oo(ne,{className:"h-3.5 w-3.5 mr-1"}),"Copy"]})]}),Oo("pre",{className:"min-h-0 flex-1 overflow-auto rounded-md bg-muted p-4 text-xs font-mono whitespace-pre",children:s})]})})};import{jsx as pn,jsxs as Ia}from"react/jsx-runtime";var Of=({title:t,children:r,details:n,className:o,defaultOpen:s=!1,classes:l,...c})=>Ia(qt,{variant:"destructive",className:e("border-destructive/25 bg-destructive/5","has-[>svg]:grid-cols-[1rem_minmax(0,1fr)]",l?.root,o),children:[pn(tr,{"aria-hidden":"true"}),t!==void 0&&t!==null&&pn(jt,{className:e("line-clamp-none min-w-0 break-words text-foreground",l?.title),children:t}),pn(Kt,{className:e("min-w-0 break-words",l?.message),children:r}),n!==void 0&&Ia(Te,{...c,defaultOpen:s,className:e("col-start-2 mt-3 min-w-0",l?.details),children:[Ia(Ee,{type:"button",className:e("group inline-flex max-w-full items-center gap-1.5 rounded-sm text-left","text-xs font-medium text-foreground underline-offset-4 hover:underline","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",l?.trigger),children:[pn(v,{"aria-hidden":"true",className:"size-3.5 shrink-0 transition-transform group-data-[state=open]:rotate-180 motion-reduce:transition-none"}),n.label]}),pn(ke,{children:pn("div",{className:e("mt-3 min-w-0 rounded-md border border-border bg-background/70 p-3 text-sm text-foreground",l?.content),children:n.content})})]})]});import{jsx as Lt,jsxs as Aa,Fragment as Ff}from"react/jsx-runtime";var $l=(t)=>Math.max(0,Math.min(100,Math.round(t))),Oa=(t)=>$l(t.value??0),Hf=(t)=>{if(t.length===0)return 0;return $l(t.reduce((r,n)=>r+Oa(n),0)/t.length)},Vf=({lane:t})=>{let r=t.fillClassName??"bg-primary";if(t.mode==="indeterminate")return Aa(Ff,{children:[Lt("div",{className:e("absolute inset-y-0 w-1/3 rounded-full motion-reduce:w-full motion-reduce:opacity-40",r),"data-slot":"lane-progress-indeterminate",style:{animation:"lane-progress-indeterminate 1.35s linear infinite"}}),Lt("style",{children:`@keyframes lane-progress-indeterminate {
10
10
  0% { transform: translateX(-120%); }
11
11
  100% { transform: translateX(320%); }
12
12
  }
@@ -17,8 +17,8 @@ import{mr,yt,hr,ne,gr,zt,He,pe,vr,xr,br,yr,Sr,lt,St,ct,Ge,Cr,wr,$e}from"../../in
17
17
  transform: none;
18
18
  width: 100%;
19
19
  }
20
- }`})]});return fr("div",{className:e("h-full transition-all",r),style:{width:`${Oa(t)}%`}})},Yf=({className:t,detail:r,label:o,lanes:a})=>{let s=a.some((l)=>l.mode==="indeterminate"),i=Uf(a);return Aa("div",{className:e("flex w-full min-w-0 max-w-full flex-col gap-1.5",t),children:[Aa("div",{className:"grid min-w-0 grid-cols-[minmax(0,1fr)_auto] items-baseline gap-3",children:[fr("span",{className:"truncate text-xs font-medium",title:o,children:o}),r!==null&&r!==void 0&&r!==""?fr("span",{className:"shrink-0 text-[11px] text-muted-foreground",title:r,children:r}):null]}),fr("progress",{"aria-label":o,className:"sr-only",max:100,value:s?void 0:i}),fr("div",{"aria-hidden":"true",className:"flex h-2 w-full gap-0.5","data-slot":"lane-progress",children:a.map((l,c)=>fr("div",{className:"relative min-w-0 flex-1 overflow-hidden rounded-full bg-muted","data-mode":l.mode??"determinate","data-slot":"lane-progress-lane","data-value":Oa(l),children:fr(Kf,{lane:l})},c))})]})};import*as Ul from"react";import{jsx as ue,jsxs as jt}from"react/jsx-runtime";var qr=(t)=>Boolean(t)&&t!==0,Zf=({context:t})=>ue("div",{className:"sr-only","data-slot":"lifecycle-status-card-status","aria-live":"polite",children:t.statusLabel}),Qf=({error:t})=>{let[r,o]=Ul.useState(!1);return jt(Ke,{variant:t.tone==="destructive"?"destructive":"default","data-slot":"lifecycle-status-card-error",children:[ue(yt,{"aria-hidden":!0}),qr(t.title)?ue(je,{children:t.title}):null,jt(Ye,{children:[qr(t.summary)?ue("p",{children:t.summary}):null,qr(t.detail)?jt("div",{className:"mt-2 space-y-2",children:[ue(n,{"aria-expanded":r,onClick:()=>{o((a)=>!a)},size:"sm",type:"button",variant:"link",children:r?"Hide details":"Show details"}),r?ue("p",{className:"whitespace-pre-wrap break-words rounded-md bg-muted/50 p-2 text-foreground",children:t.detail}):null]}):null]})]})},eg=(t)=>Object.prototype.toString.call(t)==="[object Function]",Nr=(t,r)=>eg(t)?t(r):t,tg=(t)=>{let r;if(t?.mode!=="indeterminate"){if(t?.value!==void 0)({value:r}=t);else if(t?.completed!==void 0&&t.total!==void 0&&t.total>0)r=Math.round(t.completed/t.total*100)}return r},rg=(t)=>{if(t==="danger")return"destructive";return t==="success"?"soft":"outline"},ng=(t)=>{switch(t){case"success":return"border-emerald-200 bg-emerald-50 text-emerald-700 dark:border-emerald-900/60 dark:bg-emerald-950/30 dark:text-emerald-300";case"danger":return"border-destructive/25 bg-destructive/10 text-destructive";case"warning":return"border-amber-200 bg-amber-50 text-amber-700 dark:border-amber-900/60 dark:bg-amber-950/30 dark:text-amber-300";case"muted":return"border-border bg-muted text-muted-foreground";case void 0:case"active":case"default":return"border-primary/20 bg-primary/10 text-primary";default:return"border-primary/20 bg-primary/10 text-primary"}},og=(t)=>{switch(t){case"success":return"bg-emerald-500";case"danger":return"bg-destructive";case"warning":return"bg-amber-500";case"muted":return"bg-muted-foreground";case void 0:case"active":case"default":return"bg-primary";default:return"bg-primary"}},ag=({model:t})=>ue("span",{className:e("flex size-9 items-center justify-center rounded-md border",ng(t.tone)),children:ue("span",{className:e("flex size-4 items-center justify-center",t.iconAnimated===!0&&"animate-spin"),"aria-hidden":!0,children:t.icon})}),sg=({model:t})=>{let{progress:r}=t,o=tg(r),a=r?.label??t.currentStep;if(!r&&!qr(a))return null;return jt("div",{className:"space-y-2","data-slot":"lifecycle-status-card-progress",children:[jt("div",{className:"flex min-h-5 items-center justify-between gap-3 text-sm",children:[ue("span",{className:"min-w-0 truncate text-muted-foreground",children:a??"Waiting for updates"}),r?.completed!==void 0&&r.total!==void 0?jt("span",{className:"shrink-0 font-mono text-xs text-muted-foreground",children:[r.completed," of ",r.total]}):null]}),o===void 0?jt("div",{"aria-label":"Progress",className:"relative h-2 overflow-hidden rounded-full bg-primary/15","data-progress-mode":"indeterminate",children:[ue("div",{className:"absolute inset-y-0 w-1/3 rounded-full bg-primary/45",style:{animation:"lifecycle-status-card-indeterminate 1.35s ease-in-out infinite"}}),ue("style",{children:`@keyframes lifecycle-status-card-indeterminate {
20
+ }`})]});return Lt("div",{className:e("h-full transition-all",r),style:{width:`${Oa(t)}%`}})},Bf=({className:t,detail:r,label:n,lanes:o})=>{let s=o.some((c)=>c.mode==="indeterminate"),l=Hf(o);return Aa("div",{className:e("flex w-full min-w-0 max-w-full flex-col gap-1.5",t),children:[Aa("div",{className:"grid min-w-0 grid-cols-[minmax(0,1fr)_auto] items-baseline gap-3",children:[Lt("span",{className:"truncate text-xs font-medium",title:n,children:n}),r!==null&&r!==void 0&&r!==""?Lt("span",{className:"shrink-0 text-[11px] text-muted-foreground",title:r,children:r}):null]}),Lt("progress",{"aria-label":n,className:"sr-only",max:100,value:s?void 0:l}),Lt("div",{"aria-hidden":"true",className:"flex h-2 w-full gap-0.5","data-slot":"lane-progress",children:o.map((c,d)=>Lt("div",{className:"relative min-w-0 flex-1 overflow-hidden rounded-full bg-muted","data-mode":c.mode??"determinate","data-slot":"lane-progress-lane","data-value":Oa(c),children:Lt(Vf,{lane:c})},d))})]})};import*as jl from"react";import{jsx as ae,jsxs as at}from"react/jsx-runtime";var Lr=(t)=>Boolean(t)&&t!==0,_f=({context:t})=>ae("div",{className:"sr-only","data-slot":"lifecycle-status-card-status","aria-live":"polite",children:t.statusLabel}),zf=({error:t})=>{let[r,n]=jl.useState(!1);return at(qt,{variant:t.tone==="destructive"?"destructive":"default","data-slot":"lifecycle-status-card-error",children:[ae(ve,{"aria-hidden":!0}),Lr(t.title)?ae(jt,{children:t.title}):null,at(Kt,{children:[Lr(t.summary)?ae("p",{children:t.summary}):null,Lr(t.detail)?at("div",{className:"mt-2 space-y-2",children:[ae(a,{"aria-expanded":r,onClick:()=>{n((o)=>!o)},size:"sm",type:"button",variant:"link",children:r?"Hide details":"Show details"}),r?ae("p",{className:"whitespace-pre-wrap break-words rounded-md bg-muted/50 p-2 text-foreground",children:t.detail}):null]}):null]})]})},$f=(t)=>Object.prototype.toString.call(t)==="[object Function]",Dt=(t,r)=>$f(t)?t(r):t,jf=(t)=>{let r;if(t?.mode!=="indeterminate"){if(t?.value!==void 0)({value:r}=t);else if(t?.completed!==void 0&&t.total!==void 0&&t.total>0)r=Math.round(t.completed/t.total*100)}return r},Jf=(t)=>{if(t==="danger")return"destructive";return t==="success"?"soft":"outline"},Gf=(t)=>{switch(t){case"success":return"border-emerald-200 bg-emerald-50 text-emerald-700 dark:border-emerald-900/60 dark:bg-emerald-950/30 dark:text-emerald-300";case"danger":return"border-destructive/25 bg-destructive/10 text-destructive";case"warning":return"border-amber-200 bg-amber-50 text-amber-700 dark:border-amber-900/60 dark:bg-amber-950/30 dark:text-amber-300";case"muted":return"border-border bg-muted text-muted-foreground";case void 0:case"active":case"default":return"border-primary/20 bg-primary/10 text-primary";default:return"border-primary/20 bg-primary/10 text-primary"}},Wf=(t)=>{switch(t){case"success":return"bg-emerald-500";case"danger":return"bg-destructive";case"warning":return"bg-amber-500";case"muted":return"bg-muted-foreground";case void 0:case"active":case"default":return"bg-primary";default:return"bg-primary"}},Xf=({model:t})=>ae("span",{className:e("flex size-9 items-center justify-center rounded-md border",Gf(t.tone)),children:ae("span",{className:e("flex size-4 items-center justify-center",t.iconAnimated===!0&&"animate-spin"),"aria-hidden":!0,children:t.icon})}),Uf=({model:t})=>{let{progress:r}=t,n=jf(r),o=r?.label??t.currentStep;if(!r&&!Lr(o))return null;return at("div",{className:"space-y-2","data-slot":"lifecycle-status-card-progress",children:[at("div",{className:"flex min-h-5 items-center justify-between gap-3 text-sm",children:[ae("span",{className:"min-w-0 truncate text-muted-foreground",children:o??"Waiting for updates"}),r?.completed!==void 0&&r.total!==void 0?at("span",{className:"shrink-0 font-mono text-xs text-muted-foreground",children:[r.completed," of ",r.total]}):null]}),n===void 0?at("div",{"aria-label":"Progress",className:"relative h-2 overflow-hidden rounded-full bg-primary/15","data-progress-mode":"indeterminate",children:[ae("div",{className:"absolute inset-y-0 w-1/3 rounded-full bg-primary/45",style:{animation:"lifecycle-status-card-indeterminate 1.35s ease-in-out infinite"}}),ae("style",{children:`@keyframes lifecycle-status-card-indeterminate {
21
21
  0% { transform: translateX(-120%); }
22
22
  55% { transform: translateX(150%); }
23
23
  100% { transform: translateX(330%); }
24
- }`})]}):ue(It,{"aria-label":"Progress","data-progress-mode":"determinate",value:o})]})},ig=({milestones:t})=>{if(t===void 0||t.length===0)return null;return ue("ol",{className:"space-y-3","data-slot":"lifecycle-status-card-milestones",children:t.map((r)=>jt("li",{className:"grid grid-cols-[auto_1fr] gap-3",children:[ue("span",{"aria-hidden":!0,className:e("mt-1.5 size-2 rounded-full",og(r.tone))}),jt("div",{className:"min-w-0",children:[ue("div",{className:"text-sm font-medium leading-5 text-foreground",children:r.label}),qr(r.description)?ue("div",{className:"text-sm leading-5 text-muted-foreground",children:r.description}):null]})]},r.id))})},lg=({context:t,slots:r})=>jt("div",{className:"grid grid-cols-[auto_1fr] gap-3 sm:grid-cols-[auto_1fr_auto]",children:[ue("div",{className:"pt-0.5",children:Nr(r?.icon,t)??ue(ag,{model:t.model})}),jt("div",{className:"min-w-0 space-y-1",children:[ue("h3",{className:"text-[15px] font-semibold leading-6 text-foreground",children:Nr(r?.title,t)??t.title}),ue("div",{className:"text-sm leading-6 text-muted-foreground",children:Nr(r?.description,t)??t.description})]}),ue(z,{className:"col-start-2 w-fit sm:col-start-auto",variant:rg(t.model.tone),children:t.statusLabel})]}),cg=({model:t,slots:r,className:o,...a})=>{let s={description:t.description,model:t,statusLabel:t.statusLabel,title:t.title},i=Nr(r?.actions,s),l=Nr(r?.completedState,s)??t.completedState,c=ue(ie,{className:e("w-full gap-0 overflow-hidden py-0",o),"data-status-tone":t.tone??"default",...a,children:jt(wt,{className:"space-y-5 p-5 sm:p-6",children:[ue(Zf,{context:s}),Nr(r?.header,s)??ue(lg,{context:s,slots:r}),Nr(r?.progressBody,s)??ue(sg,{model:t}),Nr(r?.milestoneList,s)??ue(ig,{milestones:t.milestones}),qr(l)?ue("div",{"data-slot":"lifecycle-status-card-completed",children:l}):null,t.error?Nr(r?.errorPanel,s)??ue(Qf,{error:t.error}):null,qr(i)?ue("div",{className:"flex min-h-9 flex-wrap items-center gap-2 border-t border-border pt-4","data-slot":"lifecycle-status-card-actions",children:i}):null]})});return r?.shell?r.shell({...s,children:c}):c};import*as Yl from"react";import{jsx as Kl}from"react/jsx-runtime";var dg=({rows:t=5,rowClassName:r,className:o,...a},s)=>Kl("div",{ref:s,"aria-label":"Loading",className:e("flex flex-col gap-2",o),...a,children:Array.from({length:t}).map((i,l)=>Kl(Ve,{className:e("h-10 w-full",r)},l))}),ql=Yl.forwardRef(dg);ql.displayName="SkeletonRows";var ug=ql;import*as Ql from"react";import{jsx as Gn,jsxs as Zl}from"react/jsx-runtime";var ec=Ql.forwardRef(function({icon:r,illustration:o,title:a,description:s,action:i,secondaryAction:l,size:c="md",variant:d="bare",className:u,...g},b){let w=c==="sm",P=Boolean(o),C=!w&&!P,A=r??Gn(yr,{className:"h-6 w-6"}),j=Boolean(s),B=Boolean(i)||Boolean(l),O=null;if(P)O=Gn("div",{className:e("flex items-center justify-center","[&_svg]:w-auto",w?"mb-3 [&_svg]:h-16":"mb-5 [&_svg]:h-24"),children:o});else if(C)O=Gn("div",{className:"mb-4 flex h-12 w-12 items-center justify-center rounded-md bg-(--bg-accent-soft) text-(--accent)",children:A});return Zl("div",{ref:b,"data-slot":"empty-state","data-size":c,"data-variant":d,className:e("mx-auto flex w-full max-w-130 flex-col items-center justify-center rounded-lg px-6 text-center",d==="framed"&&"border border-dashed border-(--border-default)",w?"py-8":"px-8 py-14",u),...g,children:[O,Gn("h3",{className:e("font-semibold text-(--text-primary)",w?"text-[14px]":"text-[15px]"),children:a}),j?Gn("p",{className:e("mt-1 max-w-sm leading-relaxed text-(--text-secondary)",w?"text-[12px]":"text-[13px]"),children:s}):null,B?Zl("div",{className:e("flex flex-wrap items-center justify-center gap-2",w?"mt-4":"mt-5"),children:[i,l]}):null]})});ec.displayName="EmptyState";var pg=ec;import*as tc from"react";import{jsx as ir,jsxs as Wn,Fragment as fg}from"react/jsx-runtime";var mg=(t)=>Object.prototype.toString.call(t)==="[object String]",rc=tc.forwardRef(function({title:r="Something went wrong",message:o,detail:a,detailLabel:s="Show technical details",detailHeading:i="Inner error detail",defaultOpen:l=!1,className:c,...d},u){let g=Boolean(a);return ir(J,{ref:u,defaultOpen:l&&g,"data-slot":"technical-error-disclosure",className:e("rounded-md border border-destructive/25 bg-destructive/[0.035] p-4 text-sm","shadow-[inset_0_1px_0_rgba(255,255,255,0.48)]",c),...d,children:Wn("div",{className:"grid grid-cols-[auto_minmax(0,1fr)] gap-3",children:[ir("span",{className:"mt-0.5 flex size-7 items-center justify-center rounded-md bg-destructive/10 text-destructive",children:ir(yt,{className:"size-4","aria-hidden":"true"})}),Wn("div",{className:"min-w-0",children:[ir("div",{className:"font-semibold text-foreground",children:r}),ir("div",{className:"mt-1 leading-6 text-muted-foreground",children:o}),g?Wn(fg,{children:[Wn(ee,{className:e("group mt-3 inline-flex items-center gap-1.5 rounded-md","text-xs font-medium text-destructive underline-offset-4","transition-[color,transform] hover:underline","focus-visible:outline-none focus-visible:ring-2","focus-visible:ring-ring focus-visible:ring-offset-2","active:translate-y-px"),children:[ir(v,{className:"size-3.5 transition-transform group-data-[state=open]:rotate-180","aria-hidden":"true"}),s]}),ir(te,{children:Wn("div",{className:"mt-3 rounded-md border border-destructive/15 bg-background/70 p-3",children:[ir("div",{className:"mb-2 text-[11px] font-medium uppercase tracking-[0.08em] text-muted-foreground",children:i}),mg(a)?ir("pre",{className:"max-h-52 overflow-auto whitespace-pre-wrap break-words font-mono text-xs leading-5 text-foreground",children:a}):ir("div",{className:"text-xs leading-5 text-foreground",children:a})]})})]}):null]})]})})});rc.displayName="TechnicalErrorDisclosure";var gg=rc;import{jsx as Ha,jsxs as vg}from"react/jsx-runtime";var bg=({icon:t,title:r="Loading...",className:o,spinnerSize:a=30})=>vg("div",{className:e("min-h-screen flex flex-col items-center justify-center gap-6 bg-background",o),children:[t!==void 0&&t!==null&&t!==!1&&t!==""&&t!==0&&Ha("div",{children:t}),Ha("h1",{className:"text-2xl font-semibold text-center",children:r}),Ha($e,{size:a})]}),hg=bg;import{jsx as Jo,jsxs as yg}from"react/jsx-runtime";var xg=({children:t,className:r,classes:o,loading:a=!1,coverImage:s})=>Jo("div",{className:e("min-h-screen flex items-center justify-center",o?.root,r),children:yg("div",{className:e("flex flex-col md:flex-row w-full min-h-[100vh] max-h-[100vh] overflow-hidden",o?.content),children:[Jo("div",{className:e("hidden md:flex flex-1 items-center justify-center overflow-hidden bg-black",o?.left),children:s}),Jo("div",{className:e("flex-1 flex flex-col items-center justify-center gap-4 bg-background p-6 md:p-8",o?.right),children:a?Jo($e,{size:48}):t})]})}),wg=xg;export{fc as ActionButton,vc as AddItemButton,hg as AppLoadingLayout,Ld as ArrayInput,io as CardOption,Hs as CardOptionsBlock,eu as CheckboxCardOption,Zd as ChoiceCard,qd as ChoiceCardGroup,Tc as CollectiveIntelligenceLoader,ru as CommandStep,$m as ConfirmDialog,Sc as CopyButton,Ud as CoverImage,jd as CronBuilder,au as CurrencyInput,wc as DateInput,Cc as DisplayHeading,pg as EmptyState,Xf as ErrorAlert,Dc as ErrorMessage,su as FieldRow,fu as FileDropArea,vu as FilterChips,wu as FlowBand,Cu as FlowBranch,Nu as FlowStep,dd as FormFrame,Ic as FormattedNumber,md as Grid,ku as GuideStep,Eu as HierarchyTree,ti as HierarchyTreeBody,ei as HierarchyTreeHeader,ri as HierarchyTreeRow,ni as HierarchyTreeToggle,Vc as IconTile,la as JsonViewer,Uu as JsonViewerDialog,zc as Kicker,Yu as LabeledField,Yf as LaneProgress,cg as LifecycleStatusCard,qu as LinkedItem,Wu as MarkdownEditorPreview,oi as MarkdownEditorPreviewToggle,Qu as MaskedValue,tp as MutedPlaceholder,sp as ObjectSchemaExplorer,vd as PageRoot,yd as PageTitle,Qd as RadioCardOption,Vs as RadioCardOptionsBlock,Zc as Ring,tf as SearchField,wd as SectionHeader,Il as SectionSwitcher,Kc as SerifNumeral,Gc as ShowMoreTag,ug as SkeletonRows,zm as SortableList,wg as SplashScreenLayout,wf as SplitButton,Nf as SplitButtonAction,Rf as SplitButtonMenu,Jm as StageHeader,Wm as StatTile,rd as StatusDot,qm as StatusPill,pf as Stepper,yf as StepperContent,bf as StepperIndicator,ff as StepperItem,mf as StepperNav,xf as StepperPanel,hf as StepperSeparator,vf as StepperTitle,gf as StepperTrigger,Yd as SummaryItem,Kd as SummaryList,lf as TabActions,df as TabActionsRow,sf as TabActionsScope,El as TabActionsSlot,cf as TabCount,Cd as TableHead,Pf as TechnicalDetailsPopover,gg as TechnicalErrorDisclosure,nr as ThemeToggle,oo as TimezonePicker,ad as TooltipBadge,Fl as TreeSelect,Zn as Typography,If as ValueRow,Jf as VariableReferenceField,Wf as XmlViewerDialog,Ir as buildCron,Ft as defaultSimpleState,ro as describeCron,Ya as displayHeadingVariants,ea as getTimezoneOptions,Qo as isValidCron,En as parseCron,gt as useIsMobile};
24
+ }`})]}):ae(Gr,{"aria-label":"Progress","data-progress-mode":"determinate",value:n})]})},Kf=({milestones:t})=>{if(t===void 0||t.length===0)return null;return ae("ol",{className:"space-y-3","data-slot":"lifecycle-status-card-milestones",children:t.map((r)=>at("li",{className:"grid grid-cols-[auto_1fr] gap-3",children:[ae("span",{"aria-hidden":!0,className:e("mt-1.5 size-2 rounded-full",Wf(r.tone))}),at("div",{className:"min-w-0",children:[ae("div",{className:"text-sm font-medium leading-5 text-foreground",children:r.label}),Lr(r.description)?ae("div",{className:"text-sm leading-5 text-muted-foreground",children:r.description}):null]})]},r.id))})},Yf=({context:t,slots:r})=>at("div",{className:"grid grid-cols-[auto_1fr] gap-3 sm:grid-cols-[auto_1fr_auto]",children:[ae("div",{className:"pt-0.5",children:Dt(r?.icon,t)??ae(Xf,{model:t.model})}),at("div",{className:"min-w-0 space-y-1",children:[ae("h3",{className:"text-[15px] font-semibold leading-6 text-foreground",children:Dt(r?.title,t)??t.title}),ae("div",{className:"text-sm leading-6 text-muted-foreground",children:Dt(r?.description,t)??t.description})]}),ae(T,{className:"col-start-2 w-fit sm:col-start-auto",variant:Jf(t.model.tone),children:t.statusLabel})]}),qf=({model:t,slots:r,className:n,...o})=>{let s={description:t.description,model:t,statusLabel:t.statusLabel,title:t.title},l=Dt(r?.actions,s),c=Dt(r?.completedState,s)??t.completedState,d=ae(Ue,{className:e("w-full gap-0 overflow-hidden py-0",n),"data-status-tone":t.tone??"default",...o,children:at(Ur,{className:"space-y-5 p-5 sm:p-6",children:[ae(_f,{context:s}),Dt(r?.header,s)??ae(Yf,{context:s,slots:r}),Dt(r?.progressBody,s)??ae(Uf,{model:t}),Dt(r?.milestoneList,s)??ae(Kf,{milestones:t.milestones}),Lr(c)?ae("div",{"data-slot":"lifecycle-status-card-completed",children:c}):null,t.error?Dt(r?.errorPanel,s)??ae(zf,{error:t.error}):null,Lr(l)?ae("div",{className:"flex min-h-9 flex-wrap items-center gap-2 border-t border-border pt-4","data-slot":"lifecycle-status-card-actions",children:l}):null]})});return r?.shell?r.shell({...s,children:d}):d};import*as Gl from"react";import{jsx as Jl}from"react/jsx-runtime";var Zf=({rows:t=5,rowClassName:r,className:n,...o},s)=>Jl("div",{ref:s,"aria-label":"Loading",className:e("flex flex-col gap-2",n),...o,children:Array.from({length:t}).map((l,c)=>Jl(Tt,{className:e("h-10 w-full",r)},c))}),Wl=Gl.forwardRef(Zf);Wl.displayName="SkeletonRows";var Qf=Wl;import*as Ul from"react";import{jsx as On,jsxs as Xl}from"react/jsx-runtime";var Kl=Ul.forwardRef(function({icon:r,illustration:n,title:o,description:s,action:l,secondaryAction:c,size:d="md",variant:u="bare",className:p,...m},f){let h=d==="sm",R=Boolean(n),x=!h&&!R,S=r??On(Go,{className:"h-6 w-6"}),B=Boolean(s),E=Boolean(l)||Boolean(c),P=null;if(R)P=On("div",{className:e("flex items-center justify-center","[&_svg]:w-auto",h?"mb-3 [&_svg]:h-16":"mb-5 [&_svg]:h-24"),children:n});else if(x)P=On("div",{className:"mb-4 flex h-12 w-12 items-center justify-center rounded-md bg-(--bg-accent-soft) text-(--accent)",children:S});return Xl("div",{ref:f,"data-slot":"empty-state","data-size":d,"data-variant":u,className:e("mx-auto flex w-full max-w-130 flex-col items-center justify-center rounded-lg px-6 text-center",u==="framed"&&"border border-dashed border-(--border-default)",h?"py-8":"px-8 py-14",p),...m,children:[P,On("h3",{className:e("font-semibold text-(--text-primary)",h?"text-[14px]":"text-[15px]"),children:o}),B?On("p",{className:e("mt-1 max-w-sm leading-relaxed text-(--text-secondary)",h?"text-[12px]":"text-[13px]"),children:s}):null,E?Xl("div",{className:e("flex flex-wrap items-center justify-center gap-2",h?"mt-4":"mt-5"),children:[l,c]}):null]})});Kl.displayName="EmptyState";var eg=Kl;import*as Yl from"react";import{jsx as ht,jsxs as Hn,Fragment as rg}from"react/jsx-runtime";var tg=(t)=>Object.prototype.toString.call(t)==="[object String]",ql=Yl.forwardRef(function({title:r="Something went wrong",message:n,detail:o,detailLabel:s="Show technical details",detailHeading:l="Inner error detail",defaultOpen:c=!1,className:d,...u},p){let m=Boolean(o);return ht(Te,{ref:p,defaultOpen:c&&m,"data-slot":"technical-error-disclosure",className:e("rounded-md border border-destructive/25 bg-destructive/[0.035] p-4 text-sm","shadow-[inset_0_1px_0_rgba(255,255,255,0.48)]",d),...u,children:Hn("div",{className:"grid grid-cols-[auto_minmax(0,1fr)] gap-3",children:[ht("span",{className:"mt-0.5 flex size-7 items-center justify-center rounded-md bg-destructive/10 text-destructive",children:ht(ve,{className:"size-4","aria-hidden":"true"})}),Hn("div",{className:"min-w-0",children:[ht("div",{className:"font-semibold text-foreground",children:r}),ht("div",{className:"mt-1 leading-6 text-muted-foreground",children:n}),m?Hn(rg,{children:[Hn(Ee,{className:e("group mt-3 inline-flex items-center gap-1.5 rounded-md","text-xs font-medium text-destructive underline-offset-4","transition-[color,transform] hover:underline","focus-visible:outline-none focus-visible:ring-2","focus-visible:ring-ring focus-visible:ring-offset-2","active:translate-y-px"),children:[ht(v,{className:"size-3.5 transition-transform group-data-[state=open]:rotate-180","aria-hidden":"true"}),s]}),ht(ke,{children:Hn("div",{className:"mt-3 rounded-md border border-destructive/15 bg-background/70 p-3",children:[ht("div",{className:"mb-2 text-[11px] font-medium uppercase tracking-[0.08em] text-muted-foreground",children:l}),tg(o)?ht("pre",{className:"max-h-52 overflow-auto whitespace-pre-wrap break-words font-mono text-xs leading-5 text-foreground",children:o}):ht("div",{className:"text-xs leading-5 text-foreground",children:o})]})})]}):null]})]})})});ql.displayName="TechnicalErrorDisclosure";var ng=ql;import{jsx as Ha,jsxs as ag}from"react/jsx-runtime";var og=({icon:t,title:r="Loading...",className:n,spinnerSize:o=30})=>ag("div",{className:e("min-h-screen flex flex-col items-center justify-center gap-6 bg-background",n),children:[t!==void 0&&t!==null&&t!==!1&&t!==""&&t!==0&&Ha("div",{children:t}),Ha("h1",{className:"text-2xl font-semibold text-center",children:r}),Ha(wt,{size:o})]}),sg=og;import{jsx as Bo,jsxs as lg}from"react/jsx-runtime";var ig=({children:t,className:r,classes:n,loading:o=!1,coverImage:s})=>Bo("div",{className:e("min-h-screen flex items-center justify-center",n?.root,r),children:lg("div",{className:e("flex flex-col md:flex-row w-full min-h-[100vh] max-h-[100vh] overflow-hidden",n?.content),children:[Bo("div",{className:e("hidden md:flex flex-1 items-center justify-center overflow-hidden bg-black",n?.left),children:s}),Bo("div",{className:e("flex-1 flex flex-col items-center justify-center gap-4 bg-background p-6 md:p-8",n?.right),children:o?Bo(wt,{size:48}):t})]})}),cg=ig;export{cc as ActionButton,pc as AddItemButton,sg as AppLoadingLayout,vd as ArrayInput,Yn as CardOption,Es as CardOptionsBlock,$d as CheckboxCardOption,_d as ChoiceCard,Fd as ChoiceCardGroup,Nc as CollectiveIntelligenceLoader,Jd as CommandStep,Dm as ConfirmDialog,yc as CopyButton,Hd as CoverImage,Md as CronBuilder,Xd as CurrencyInput,bc as DateInput,xc as DisplayHeading,eg as EmptyState,Of as ErrorAlert,Sc as ErrorMessage,Ud as FieldRow,ru as FileDropArea,au as FilterChips,cu as FlowBand,pu as FlowBranch,du as FlowStep,Zc as FormFrame,kc as FormattedNumber,td as Grid,bu as GuideStep,xu as HierarchyTree,Ys as HierarchyTreeBody,Ks as HierarchyTreeHeader,qs as HierarchyTreeRow,Zs as HierarchyTreeToggle,Mc as IconTile,la as JsonViewer,Hu as JsonViewerDialog,Hc as Kicker,Bu as LabeledField,Bf as LaneProgress,qf as LifecycleStatusCard,Fu as LinkedItem,Au as MarkdownEditorPreview,Qs as MarkdownEditorPreviewToggle,zu as MaskedValue,ju as MutedPlaceholder,Uu as ObjectSchemaExplorer,ad as PageRoot,ld as PageTitle,zd as RadioCardOption,Ms as RadioCardOptionsBlock,Vr as Ring,jm as SearchField,cd as SectionHeader,kl as SectionSwitcher,Jc as SerifNumeral,_c as ShowMoreTag,Qf as SkeletonRows,Lm as SortableList,cg as SplashScreenLayout,cf as SplitButton,df as SplitButtonAction,uf as SplitButtonMenu,Em as StageHeader,Am as StatTile,wn as StatusDot,Fm as StatusPill,Qm as Stepper,lf as StepperContent,nf as StepperIndicator,tf as StepperItem,ef as StepperNav,sf as StepperPanel,af as StepperSeparator,of as StepperTitle,rf as StepperTrigger,Bd as SummaryItem,Vd as SummaryList,Km as TabActions,qm as TabActionsRow,Um as TabActionsScope,Pl as TabActionsSlot,Ym as TabCount,pd as TableHead,ff as TechnicalDetailsPopover,ng as TechnicalErrorDisclosure,Qo as ThemeToggle,Xn as TimezonePicker,Xc as TooltipBadge,Al as TreeSelect,zn as Typography,wf as ValueRow,Ef as VariableReferenceField,Af as XmlViewerDialog,_t as buildCron,rt as defaultSimpleState,Gn as describeCron,Ya as displayHeadingVariants,ea as getTimezoneOptions,Zo as isValidCron,yn as parseCron,br as useIsMobile};