@collective-intelligence/ui-react 0.1.25 → 0.1.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +40 -0
- package/dist/components/ui/index.d.ts +15 -0
- package/dist/components/ui/index.js +2 -2
- package/dist/components/ui-extensions/atoms/ThemeToggle/index.js +1 -1
- package/dist/components/ui-extensions/index.js +4 -4
- package/dist/components/ui-extensions/molecules/VideoPlayer/index.js +1 -1
- package/dist/{index-c5j7wr0c.js → index-9b0ygc2v.js} +2 -2
- package/dist/{index-3me0m2fg.js → index-w7ba75b9.js} +1 -1
- package/dist/{index-zk28jg41.js → index-way3rqhy.js} +1 -1
- package/dist/{index-jqw3cf33.js → index-wqsh9yj5.js} +1 -1
- package/dist/{index-7z26q7c0.js → index-x5ks3173.js} +4 -4
- package/dist/index-yrsgjmrw.js +6 -0
- package/dist/resources.js +1 -1
- package/package.json +2 -2
- package/dist/index-3eqse77d.js +0 -6
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{pr,yt,mr,te,hr,zt,He,ce,gr,vr,xr,br,yr,lt,St,ct,Ge,Sr,Cr,$e}from"../../index-vrj20h57.js";import{p,n}from"../../index-7z26q7c0.js";import{f,m}from"../../index-k2h122pf.js";import{k,E,H,ar,M,Z,h,b}from"../../index-c5j7wr0c.js";import{Ke,je,Ye,ue,Rt,re,Xe,de,fe,pe,oe,Ze,me,Qe,j,A,R,L,I,pt,Je,Pt,Tt,kt,Et,Mt,Dt,At,Nt,_t,Ot,Ft,Ve,et,tt,rt,Y,Ut,Vt,mt,ht,Gt,$t}from"../../index-3eqse77d.js";import{ot,at,nt}from"../../index-jqw3cf33.js";import{nr}from"../../index-3me0m2fg.js";import{gt}from"../../index-r4k327de.js";import{ut,T,dt,Oe,Fe,ft,Be}from"../../index-cxjzg167.js";import{v,S}from"../../index-dt6f1hvx.js";import"../../index-1ckm293n.js";import{e}from"../../index-fwsd4nes.js";import{jsx as lc,jsxs as cc}from"react/jsx-runtime";var ic=({children:t,loading:r=!1,fullWidth:o=!1,className:a,disabled:s,variant:i,size:l,...c})=>cc(n,{variant:i,size:l,className:e(o&&"w-full",a),disabled:s===!0||r,...c,children:[r&&lc($e,{size:20,className:"mr-2"}),t]}),dc=ic;import*as ja from"react";import{jsx as Ja,jsxs as pc}from"react/jsx-runtime";var uc=({children:t,className:r,type:o="button",...a},s)=>pc(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:[Ja("span",{className:"mr-2 inline-flex size-5 items-center justify-center rounded-full border border-border/70 bg-muted/45 text-foreground",children:Ja(Ge,{className:"size-3.5"})}),t]}),Kn=ja.forwardRef(uc);Kn.displayName="AddItemButton";var mc=Kn;import{forwardRef as fc}from"react";import{jsx as bc}from"react/jsx-runtime";var Ga=(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},gc=(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 Ga(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(!Ga(u,d,c))return null;return`${u}-${String(d).padStart(2,"0")}-${String(c).padStart(2,"0")}`}return null},Wa=fc(function({onPaste:r,...o},a){return bc(h,{ref:a,type:"date",onPaste:(i)=>{let l=i.clipboardData.getData("text"),c=gc(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})});Wa.displayName="DateInput";var vc=Wa;import*as Xa from"react";import{jsx as xc}from"react/jsx-runtime";var Ua=p("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]"}}}),hc=({as:t="h2",size:r,className:o,...a},s)=>xc(t,{ref:s,className:e(Ua({size:r}),o),...a}),Ka=Xa.forwardRef(hc);Ka.displayName="DisplayHeading";var yc=Ka;import*as Er from"react";import{jsx as on,jsxs as qa,Fragment as Ya}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},x){let[y,C]=Er.useState(!1),w=Er.useRef(null);Er.useEffect(()=>()=>{if(w.current!==null)clearTimeout(w.current)},[]);let P=async(z)=>{u?.(z);try{if(await navigator.clipboard.writeText(r),C(!0),w.current!==null)clearTimeout(w.current);w.current=setTimeout(()=>{C(!1)},c)}catch{Y.error(l)}};if(a==="button")return on(n,{ref:x,type:"button",variant:"outline",onClick:(z)=>{P(z)},"aria-label":`Copy ${o}`,className:e("shrink-0",d),...g,children:y?qa(Ya,{children:[on(f,{className:"mr-1 size-4"}),i]}):qa(Ya,{children:[on(te,{className:"mr-1 size-4"}),s]})});return on("button",{ref:x,type:"button",onClick:(z)=>{P(z)},"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:y?on(f,{className:"size-3.5 text-primary"}):on(te,{className:"size-3.5"})})});Yn.displayName="CopyButton";var wc=Yn;import{jsx as Wo,jsxs as Nc}from"react/jsx-runtime";var Za="#a3d54a",Qa=({className:t,...r})=>Nc("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:[Wo("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}),Wo("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:Za,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2.2}),Wo("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:Za,r:2.3})]});Qa.displayName="CollectiveIntelligenceLoader";var Rc=Qa;import{jsx as Sc}from"react/jsx-runtime";var Cc=({children:t,className:r})=>Sc("div",{className:e("text-destructive text-sm text-center",r),children:t}),Pc=Cc;import*as es from"react";import{jsx as kc}from"react/jsx-runtime";var Tc=({value:t,fallback:r="—",locale:o,className:a,...s},i)=>kc("span",{ref:i,className:e("tabular-nums",a),...s,children:t===null||t===void 0?r:new Intl.NumberFormat(o).format(t)}),ts=es.forwardRef(Tc);ts.displayName="FormattedNumber";var Lc=ts;import*as rs from"react";import{jsx as Mc}from"react/jsx-runtime";var Dc={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))]"},Ec={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"},ns=rs.forwardRef(function({tone:r="neutral",size:o="md",initial:a,className:s,children:i,...l},c){return Mc("span",{ref:c,"aria-hidden":!0,className:e("inline-flex shrink-0 select-none items-center justify-center border font-display font-bold",Ec[o],Dc[r],s),...l,children:i??(a!==void 0&&a!==""?a.slice(0,2).toUpperCase():null)})});ns.displayName="IconTile";var Ic=ns;import*as os from"react";import{jsx as Hc}from"react/jsx-runtime";var Ac={accent:"text-(--accent)",copper:"text-(--text-muted)",default:"text-(--text-muted)",muted:"text-(--text-muted)"},Oc=({as:t="span",tone:r="default",className:o,...a},s)=>Hc(t,{ref:s,className:e("inline-block text-[11px] font-semibold uppercase tracking-[0.06em]",Ac[r],o),...a}),an=os.forwardRef(Oc);an.displayName="Kicker";var Vc=an;import*as as from"react";import{jsx as _c}from"react/jsx-runtime";var Bc=(t)=>`+${t}`,Fc=({expanded:t,hiddenCount:r,collapsedLabel:o=Bc,expandedLabel:a="Show less",onToggle:s,className:i,...l},c)=>_c("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)}),ss=as.forwardRef(Fc);ss.displayName="ShowMoreTag";var zc=ss;import*as is from"react";import{jsx as jc}from"react/jsx-runtime";var $c=p("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]"}}}),Jc=({size:t,className:r,...o},a)=>jc("span",{ref:a,className:e($c({size:t}),r),...o}),sn=is.forwardRef(Jc);sn.displayName="SerifNumeral";var Gc=sn;import{jsx as Xo,jsxs as Xc}from"react/jsx-runtime";var Uo=9,ls=2*Math.PI*Uo,Wc=(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)))},cs=({className:t,classes:r,label:o,max:a=100,min:s=0,title:i,value:l,"aria-label":c,...d})=>{let u=Wc(l,s,a),g=Math.round(u*100),x=s+u*(a-s),y=ls*(1-u);return Xo("span",{"aria-label":c??`${o}: ${g}%`,"aria-valuemax":a,"aria-valuemin":s,"aria-valuenow":x,className:e("grid size-8 shrink-0 place-items-center text-muted-foreground",r?.root,t),title:i??`${o} ${g}%`,...d,children:Xc("svg",{"aria-hidden":"true",className:e("size-6 -rotate-90",r?.svg),viewBox:"0 0 24 24",children:[Xo("circle",{className:e("stroke-muted",r?.track),cx:"12",cy:"12",fill:"none",r:Uo,strokeWidth:"3"}),Xo("circle",{className:e("stroke-foreground transition-[stroke-dashoffset]",r?.indicator),cx:"12",cy:"12",fill:"none",r:Uo,strokeDasharray:ls,strokeDashoffset:y,strokeLinecap:"round",strokeWidth:"3"})]})})};cs.displayName="Ring";var Uc=cs;import*as ps from"react";import{jsx as us,jsxs as qc}from"react/jsx-runtime";var ds={danger:"bg-destructive",neutral:"bg-muted-foreground/40",primary:"bg-primary",success:"bg-emerald-500",warning:"bg-amber-500"},Kc={md:"size-2",sm:"size-1.5"},Yc=({tone:t="neutral",pulse:r=!1,size:o="sm",className:a,...s},i)=>qc("span",{ref:i,className:e("relative inline-flex shrink-0",Kc[o],a),...s,children:[r&&us("span",{"aria-hidden":!0,className:e("absolute inline-flex h-full w-full animate-ping rounded-full opacity-60",ds[t])}),us("span",{"aria-hidden":!0,className:e("relative inline-flex h-full w-full rounded-full",ds[t])})]}),qn=ps.forwardRef(Yc);qn.displayName="StatusDot";var Zc=qn;import*as gs from"react";import{jsx as fs,jsxs as ms}from"react/jsx-runtime";var Qc={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))]"},ed=({tooltip:t,tone:r="neutral",icon:o,className:a,children:s,...i},l)=>ms(et,{children:[fs(tt,{asChild:!0,children:ms(ue,{ref:l,variant:"outline",className:e(Qc[r],a),...i,children:[o,s]})}),fs(rt,{children:t})]}),bs=gs.forwardRef(ed);bs.displayName="TooltipBadge";var td=bs;import*as vs from"react";import{jsx as nd}from"react/jsx-runtime";var rd={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=vs.forwardRef(function({variant:r="body1",as:o,className:a,...s},i){let{tag:l,className:c}=rd[r];return nd(o??l,{ref:i,className:e(c,a),...s})});Zn.displayName="Typography";import{jsx as ad}from"react/jsx-runtime";var od=({children:t,as:r="form",className:o,onSubmit:a,...s})=>{let i=(l)=>{l.preventDefault(),a?.(l)};return ad(r,{className:e("flex flex-col gap-4 min-w-[300px]",o),onSubmit:i,...s,children:t})},sd=od;import{jsx as dd}from"react/jsx-runtime";var hs={},ln=(...t)=>{for(let r of t)if(r!==void 0)return r;return 1},id=(t=hs)=>({"--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)}),ld=["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(" "),cd=({cols:t=hs,children:r,...o})=>dd("div",{className:ld,style:id(t),...o,children:r});import{jsx as pd}from"react/jsx-runtime";var ud=({className:t,spaced:r=!1,...o})=>pd("div",{className:e("animate-[rise-in_500ms_cubic-bezier(0.16,1,0.3,1)_both]",r&&"space-y-6",t),...o});var md=ud;import{jsx as Dn,jsxs as cn}from"react/jsx-runtime";var fd=(t)=>t!==null&&t!==void 0&&t.constructor===String,Ln=(t)=>t!==null&&t!==void 0&&t!==!1&&t!==""&&t!==0,gd=({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:fd(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 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]})]}),bd=gd;import*as ys from"react";import{jsx as Qn,jsxs as xs}from"react/jsx-runtime";var Ko=(t)=>t!==void 0&&t!==null&&t!==!1&&t!==0&&t!==""&&!Number.isNaN(t),ws=ys.forwardRef(function({icon:r,title:o,description:a,action:s,className:i,...l},c){return xs("div",{ref:c,className:e("flex items-start gap-3",i),...l,children:[Ko(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,xs("div",{className:"min-w-0 flex-1",children:[Qn("h3",{className:"text-[15px] font-semibold leading-snug text-foreground",children:o}),Ko(a)?Qn("p",{className:"mt-0.5 text-sm leading-relaxed text-muted-foreground",children:a}):null]}),Ko(s)?Qn("div",{className:"shrink-0",children:s}):null]})});ws.displayName="SectionHeader";var vd=ws;import{jsx as Ns,jsxs as xd}from"react/jsx-runtime";var hd=({title:t,toolbar:r})=>xd("div",{className:"flex items-center justify-between mb-12",children:[Ns(Zn,{variant:"h2",children:t}),Boolean(r)&&Ns("div",{className:"flex items-center gap-2",children:r})]}),yd=hd;import*as to from"react";import{jsx as It,jsxs as eo}from"react/jsx-runtime";var Rs=(t,r,o)=>{if(t.length>=r)return t;return[...t,...Array.from({length:r-t.length},o)]},wd=[],Yo=({values:t,defaultValues:r=wd,onValuesChange:o,addLabel:a,getRemoveLabel:s,actions:i,minItems:l=0,disabled:c=!1,renderItem:d,createItem:u,validateItem:g,classes:x,className:y,id:C,...w})=>{let P=to.useId(),[z,B]=to.useState(()=>Rs(r,l,u)),D=Rs(t??z,l,u),O=Boolean(i),F=(G)=>{if(t===void 0)B(G);o?.(G)};return eo("div",{"data-slot":"array-input",className:e("space-y-2",x?.root,y),...w,children:[It("div",{className:"space-y-2",children:D.map((G,V)=>{let _=V===0&&C!==void 0&&C!==""?C:`${P}-${V}`,J=g?.(G,V);return eo("div",{className:e("flex items-center gap-3",x?.row),children:[d({disabled:c,id:_,index:V,onValueChange:(Q)=>{let X=[...D];X[V]=Q,F(X)},validationMessage:J,value:G}),D.length>l?It(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",x?.removeButton),onClick:()=>{F(D.filter((Q,X)=>X!==V))},children:It(Sr,{"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",x?.actionRow),children:[It(Kn,{disabled:c,className:x?.addButton,onClick:()=>{F([...D,u()])},children:a}),O?It("div",{className:e("sm:ml-auto",x?.actions),children:i}):null]})]})},Nd=(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 It(Yo,{...c,createItem:r??(()=>""),renderItem:l});return It(Yo,{...c,createItem:r??(()=>""),renderItem:(g)=>{let{disabled:x,id:y,index:C,onValueChange:w,validationMessage:P,value:z}=g;return eo("div",{className:"min-w-0 flex-1",children:[It(h,{...u,id:y,"aria-label":o(C),"aria-invalid":Boolean(P),value:z,placeholder:s,required:i,disabled:x,className:e("w-full",d,c.classes?.input),onChange:(B)=>{w(B.target.value)}}),P!==void 0&&P!==""?It("p",{className:"mt-1 text-xs text-destructive",role:"alert",children:P}):null]})}})},Rd=(t)=>It(Yo,{...t}),Cd=(t)=>t.createItem!==void 0&&t.renderItem!==void 0,Cs=(t)=>{if(Cd(t))return It(Rd,{...t});return It(Nd,{...t})};Cs.displayName="ArrayInput";var Sd=Cs;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 Ht={hour:9,interval:1,minute:0,mode:"day",monthday:1,weekdays:[1,2,3,4,5]},qo=/^\*\/(?<step>\d+)$/u,Pd=(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},Td=(t,r,o,a)=>{if(r==="*"&&o==="*"&&a==="*"){let s=qo.exec(t),i=Number(s?.groups?.step);return s&&i>=1&&i<=59?{...Ht,interval:i,mode:"minutes"}:null}return},kd=(t,r,o,a)=>{if(r!=="*"||o!=="*")return;let s=qo.exec(t);if(s){let i=Number(s.groups?.step);return i>=1&&i<=23?{...Ht,interval:i,minute:a,mode:"hours"}:null}return},Ld=(t,r,o)=>{let a=qo.exec(t);if(a){let i=Number(a.groups?.step);if(i%7===0&&i>=7&&i<=28)return{...Ht,hour:r,interval:i/7,minute:o,mode:"weeks"};return i>=1&&i<=31?{...Ht,hour:r,interval:i,minute:o,mode:"days"}:null}let s=Number(t);return/^\d+$/u.test(t)&&s>=1&&s<=31?{...Ht,hour:r,minute:o,mode:"month",monthday:s}:null},Dd=(t,r,o)=>{let a=Pd(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{...Ht,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=Td(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=kd(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{...Ht,hour:g,minute:d,mode:"day"};if(l==="*")return Ld(s,g,d);if(s==="*")return Dd(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")}},Ss=(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!=="*"&&!Ss(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},Ed=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Md=(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=Md(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)=>Ed[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")}},Zo=(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)=>Ss(a,o[s][0],o[s][1]))};import*as Ts from"react";var Ps=(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)},Id=(t)=>{let r=Ps(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,Qo=()=>{if(no)return no;let t="supportedValuesOf"in Intl?Intl.supportedValuesOf("timeZone"):["UTC"];return no=Mr(["UTC",...t].map((r)=>({label:`${r} (UTC${Id(r)})`,offset:Ps(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 Ad}from"react/jsx-runtime";var oo=({value:t,onChange:r,className:o,width:a="100%",disabled:s,placeholder:i="Select timezone"})=>{let l=Ts.useMemo(()=>Qo(),[]);return Ad(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 ne,jsxs as De,Fragment as zd}from"react/jsx-runtime";var Ds=[{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"}],Od=[{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}],Hd=(t)=>Ds.some((r)=>r.value===t),ks=(t)=>{let r=t.trim();if(!r)return{custom:Ir(Ht),simple:Ht,view:"simple"};let o=En(r);if(o)return{custom:r,simple:o,view:"simple"};return{custom:r,simple:Ht,view:"advanced"}},Vd=(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)),Ls=(t)=>String(t).padStart(2,"0"),Bd=({hour:t,minute:r,onChange:o})=>De("div",{className:"flex items-center gap-1",children:[ne(h,{type:"number",min:0,max:23,value:Ls(t),onChange:(a)=>{o(ao(Number(a.target.value)||0,0,23),r)},className:"w-16 text-center font-mono"}),ne("span",{className:"text-muted-foreground",children:":"}),ne(h,{type:"number",min:0,max:59,value:Ls(r),onChange:(a)=>{o(t,ao(Number(a.target.value)||0,0,59))},className:"w-16 text-center font-mono"})]}),Fd=({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:[ne("div",{className:"grid gap-2 sm:grid-cols-[minmax(0,1fr)_auto] sm:items-end",children:De("div",{className:"space-y-2",children:[ne("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&&ne(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(Hd(u))r({mode:u})},children:[ne(_t,{className:"flex-1",children:ne(Nt,{})}),ne(Ft,{children:Ds.map((u)=>ne(Ot,{value:u.value,children:Vd(u,t.interval)},u.value))})]})]})]})}),c&&De("div",{className:"space-y-2",children:[ne("span",{className:"text-xs font-medium text-muted-foreground",children:"On"}),ne(Gt,{type:"multiple",variant:"outline",size:"sm",value:t.weekdays.map(String),onValueChange:(u)=>{r({weekdays:u.length?Mr(u.map(Number),(g,x)=>g-x):[1]})},className:"w-full",children:Od.map((u)=>ne($t,{value:String(u.value),"aria-label":u.label,className:"text-xs",children:u.short},u.value))})]}),d&&De("div",{className:"space-y-2",children:[ne("span",{className:"text-xs font-medium text-muted-foreground",children:"On day"}),ne(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:[ne("span",{className:"text-xs font-medium text-muted-foreground",children:"At"}),ne(Bd,{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:[ne("span",{className:"text-xs font-medium text-muted-foreground",children:"Timezone"}),ne(oo,{value:o,onChange:a})]})]}),l&&De("div",{className:"space-y-2",children:[ne("span",{className:"text-xs font-medium text-muted-foreground",children:"At minute"}),ne(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"})]})]})},_d=({value:t,onChange:r,className:o,showPreview:a=!0,timezone:s,onTimezoneChange:i})=>{let[l,c]=dn.useState(()=>ks(t)),[d,u]=dn.useState(t),[g,x]=dn.useState(t);if(t!==d){if(u(t),t!==g)x(t),c(ks(t))}let y=dn.useCallback((D)=>{let O=D.view==="simple"?Ir(D.simple):D.custom;x(O),r(O)},[r]),C=(D)=>{c((O)=>{let F={...O.simple,...D},G={...O,custom:Ir(F),simple:F};return y(G),G})},w=(D)=>{c((O)=>{let F={...O,custom:D};return y(F),F})},P=(D)=>{c((O)=>{if(D===O.view)return O;if(D==="advanced"){let V=Ir(O.simple),_={...O,custom:V,view:D};return y(_),_}let F=En(O.custom),G=F?{...O,simple:F,view:D}:{...O,view:D};return y(G),G})},z=Zo(l.custom),B=null;if(l.view==="simple")B=ro(Ir(l.simple));else if(z)B=ro(l.custom);return De("div",{className:e("space-y-4",o),children:[De(Ut,{value:l.view,onValueChange:(D)=>{if(D==="simple"||D==="advanced")P(D)},children:[De(Vt,{className:"grid w-full grid-cols-2 rounded-md bg-muted/70 p-1 sm:w-[320px]",children:[ne(mt,{value:"simple",className:"text-xs",children:"Simple"}),ne(mt,{value:"advanced",className:"text-xs",children:"Advanced"})]}),ne(ht,{value:"simple",className:"space-y-3 pt-3",children:ne(Fd,{state:l.simple,onChange:C,timezone:s,onTimezoneChange:i})}),De(ht,{value:"advanced",className:"space-y-2 pt-3",children:[ne("span",{className:"text-xs font-medium text-muted-foreground",children:"Cron Expression"}),ne(h,{value:l.custom,onChange:(D)=>{w(D.target.value)},placeholder:"0 9 * * 1-5",className:e("font-mono text-sm",!z&&l.custom.trim()&&"border-destructive focus-visible:ring-destructive/40"),spellCheck:!1}),ne("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:[ne("span",{className:"text-xs font-medium text-muted-foreground",children:"Timezone"}),ne(oo,{value:s,onChange:i})]}),a&&ne("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?ne("span",{className:"text-destructive",children:"Invalid cron expression"}):De(zd,{children:[ne("span",{className:"text-muted-foreground",children:B}),ne(ue,{variant:"secondary",className:"ml-auto font-mono text-[11px]",children:l.view==="simple"?Ir(l.simple):l.custom})]})})]})};import{jsx as ea}from"react/jsx-runtime";var $d={both:"w-full h-full",horizontal:"w-full h-auto",none:"",vertical:"h-full w-auto"},Jd=({src:t,alt:r="",className:o="",width:a,height:s,fill:i="horizontal",style:l})=>{if(i==="both")return ea("div",{className:e("relative overflow-hidden rounded-lg shadow-md",o),style:{height:s,width:a,...l},children:ea("img",{src:t,alt:r,className:"object-cover w-full h-full absolute inset-0"})});return ea("img",{src:t,alt:r,width:a,height:s,className:e("object-cover rounded-lg shadow-md",$d[i],o),style:{height:i==="vertical"?"100%":s,width:i==="horizontal"?"100%":a,...l}})},jd=Jd;import{jsx as so,jsxs as Es}from"react/jsx-runtime";var Gd=({title:t,className:r,children:o,...a})=>Es("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})]}),Wd=({label:t,value:r,muted:o=!1,className:a,...s})=>Es("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 ta from"react";import{jsx as zr,jsxs as Ms}from"react/jsx-runtime";var Xd=({className:t,...r})=>zr(Tt,{"data-slot":"choice-card-group",className:e("grid gap-3",t),...r}),Ud=({title:t,description:r,media:o,footer:a,className:s,...i})=>{let l=ta.useId(),c=ta.useId(),d=Boolean(r);return Ms(kt,{"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(Et,{children:zr(f,{className:"size-3",strokeWidth:3})})}),o,Ms("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 Is}from"react/jsx-runtime";var As=Ar.forwardRef(function({className:r,...o},a){return Or("div",{ref:a,className:e("grid gap-2",r),...o})}),Os=({className:t,...r})=>Or(Mt,{className:e("grid gap-2",t),...r}),ra=(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 Is("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,Is("span",{className:"min-w-0 flex-1",children:[Or("span",{className:"block truncate text-sm font-medium",children:r}),ra(o)?Or("span",{id:a,className:e("mt-1 block text-xs text-muted-foreground",!s&&"truncate"),children:o}):null,d]})]})}),Hs=(t)=>Object.prototype.toString.call(t)==="[object String]",Vs=(t,r)=>t!==null&&r instanceof Node&&(t.contains(r)||r instanceof HTMLInputElement&&r.getAttribute("aria-hidden")==="true"),Kd=({value:t,title:r,description:o,radioLabel:a,disabled:s=!1,onClick:i,...l})=>{let c=Ar.useId(),d=Ar.useId(),u=a??(Hs(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 x=document.querySelector(`#${c}`);if(Vs(x,g.target))return;g.preventDefault(),x?.click()},control:Or(Dt,{"aria-describedby":ra(o)?d:void 0,"aria-label":u,className:"mt-1",disabled:s,id:c,value:t}),...l})},Yd=({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??(Hs(r)?r:void 0);return Or(io,{description:o,descriptionId:u,disabled:s,title:r,onClick:(x)=>{if(i?.(x),x.defaultPrevented||s)return;if(Vs(document.querySelector(`#${d}`),x.target))return;x.preventDefault(),l(!t)},control:Or(Xe,{"aria-describedby":ra(o)?u:void 0,"aria-label":g,checked:t,className:"mt-0.5",disabled:s,id:d,onCheckedChange:(x)=>{if(!s)l(x===!0)}}),...c})};As.displayName="CardOptionsBlock";Os.displayName="RadioCardOptionsBlock";io.displayName="CardOption";import*as Bs from"react";import{jsx as Mn,jsxs as na}from"react/jsx-runtime";var qd=({title:t,description:r,command:o,copyLabel:a=t??o,copyErrorMessage:s,className:i,...l},c)=>na("div",{ref:c,className:e("space-y-2",i),...l,children:[t===void 0&&r===void 0?null:na("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})]}),na("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})]})]}),Fs=Bs.forwardRef(qd);Fs.displayName="CommandStep";var Zd=Fs;import{forwardRef as Qd,useId as eu}from"react";import{jsx as In,jsxs as _s}from"react/jsx-runtime";var zs=Qd(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:x,placeholder:y,...C},w){let P=eu(),z=u??P,B=`Enter amount in ${r}`,D=x??1/10**g,O=y??(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(b,{htmlFor:z,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:w,className:e("bg-background pl-12",F&&"border-destructive",c),id:z,min:"0",placeholder:O,step:D,type:"number",...C})]}),F?In("p",{className:"text-xs text-destructive",children:l}):!i&&In("p",{className:"text-xs text-muted-foreground",children:a??B})]})});zs.displayName="CurrencyInput";var tu=zs;import*as $s from"react";import{jsx as lo,jsxs as oa}from"react/jsx-runtime";var Js=$s.forwardRef(function({index:r,label:o,hint:a,className:s,children:i,...l},c){let d=Boolean(r),u=Boolean(a);return oa("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,oa("div",{className:"min-w-0 space-y-1.5",children:[oa("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]})]})});Js.displayName="FieldRow";var ru=Js;import{jsx as ge,jsxs as Wt,Fragment as cu}from"react/jsx-runtime";var nu=(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]}`},ou={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"},au=({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(Cr,{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})]})]}),su=({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(S,{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})]})]}),iu=({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(cu,{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(pr,{className:"h-5 w-5 text-(--success)"})}),Wt("div",{className:"flex flex-col",children:[Wt("div",{className:"flex items-center gap-2",children:[ge(gr,{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:nu(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(hr,{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(S,{className:"h-4 w-4 text-destructive"})}):null]})]}),lu=(t)=>{let{rootProps:r,inputProps:o,isDragActive:a,selectedFile:s,error:i,onRemoveFile:l,onDownloadFile:c,isDownloadingFile:d,disabled:u,className:g,labels:x}=t,y={...ou,...x},C=s!==void 0&&s!==null,w=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",C&&"border-[color-mix(in_oklab,var(--success)_60%,var(--border))] bg-[color-mix(in_oklab,var(--success)_10%,transparent)]",w&&"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}),!C&&!w?ge(au,{active:Boolean(a),activeLabel:y.dragActive,hint:y.fileTypeHint,inactiveLabel:y.dragInactive}):null,s!==void 0&&s!==null&&!w?ge(iu,{downloadLabel:y.downloadFile,downloading:Boolean(d),downloadingLabel:y.downloadingFile,file:s,onDownload:c,onRemove:l}):null,i!==void 0&&i!==null&&i!==""?ge(su,{message:i,retryLabel:y.errorRetry}):null]})})},du=lu;import{jsx as js,jsxs as pu}from"react/jsx-runtime";var uu=p("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]"}}}),Gs=({options:t,value:r,onValueChange:o,label:a,size:s,className:i,classes:l,...c})=>js("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 pu("button",{type:"button","aria-pressed":u,disabled:d.disabled,onClick:()=>{o(d.value)},className:e(uu({active:u,size:s}),l?.chip),children:[d.label,d.count===void 0?null:js("span",{className:e("tabular-nums text-[11px] text-(--text-muted)",l?.count),children:d.count})]},d.value)})});Gs.displayName="FilterChips";var mu=Gs;import*as un from"react";import{jsx as dr,jsxs as wu}from"react/jsx-runtime";var fu=52,gu=26,uo=4,co=20,bu=(t)=>({"--flow-lane":t}),Xs=un.createContext(null),Us=(t)=>{let r=un.useContext(Xs);if(!r)throw Error(`${t} must be rendered inside a FlowBand.`);return r},vu=({lanes:t=1,stepHeight:r=fu,laneHeight:o=gu,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(Xs.Provider,{value:d,children:dr("div",{className:e("flex min-w-0 items-stretch gap-1",a),style:{height:c,...s},...l,children:i})})},hu=({className:t,style:r,children:o,...a})=>{let{stepHeight:s}=Us("FlowStep");return dr("div",{className:e("flex min-w-0 flex-1 items-stretch self-center",t),style:{height:s,...r},...a,children:o})},Ws=({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:bu(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)})})},xu=(t,r)=>{let o=(r-uo*(t-1))/t;return Array.from({length:t},(a,s)=>s*(o+uo)+o/2)},yu=({lanes:t,fork:r=!0,rejoin:o=!0,label:a,className:s,...i})=>{let{height:l}=Us("FlowBranch"),c=xu(t.length,l),d=t.map((u)=>u.color);return wu("div",{"aria-label":a,className:e("flex min-w-0 flex-1 items-stretch",s),...i,children:[r&&dr(Ws,{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(Ws,{centers:c,height:l,colors:d,merge:!0})]})};import*as Ks from"react";import{jsx as aa,jsxs as Ru}from"react/jsx-runtime";var Nu=({index:t,className:r,children:o,...a},s)=>Ru("div",{ref:s,className:e("grid grid-cols-[1.75rem_1fr] gap-x-3 leading-relaxed",r),...a,children:[aa("div",{className:"pt-[1px] text-right",children:aa(sn,{className:"opacity-80",children:t})}),aa("p",{className:"text-[13px] text-muted-foreground",children:o})]}),Ys=Ks.forwardRef(Nu);Ys.displayName="GuideStep";var Cu=Ys;import*as mn from"react";import{jsx as Ue,jsxs as pn,Fragment as Pu}from"react/jsx-runtime";var qs=mn.forwardRef(function({className:r,variant:o="island",...a},s){return Ue(re,{ref:s,variant:o,className:e("gap-0 p-0",r),...a})});qs.displayName="HierarchyTree";var Zs=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]})});Zs.displayName="HierarchyTreeHeader";var Qs=mn.forwardRef(function({className:r,...o},a){return Ue("div",{ref:a,"data-slot":"hierarchy-tree-body",className:e("min-w-0",r),...o})});Qs.displayName="HierarchyTreeBody";var Su=[],ei=mn.forwardRef(function({depth:r,rails:o=Su,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((x,y)=>Ue("span",{className:"relative w-5",children:x?Ue("span",{className:"absolute inset-y-0 left-0 border-l border-(--border-subtle)"}):null},y)),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(Pu,{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})]})});ei.displayName="HierarchyTreeRow";var ti=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]})});ti.displayName="HierarchyTreeToggle";var Tu=qs;import ku,{useState as Lu}from"react";import{jsx as Pe,jsxs as wt}from"react/jsx-runtime";var Du=p("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"}}}),sa=({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)=>sa({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,sa({ancestors:r,value:i})]));return r.delete(t),a}return o},Eu=(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"},Mu=(t)=>{if(t===null)return"null";if(t===void 0)return"undefined";if(String(t)===t)return`"${t}"`;return String(t)},Iu=(t)=>t,Au=(t)=>t!==null&&Object(t)===t,Ou=(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"})},Hu=(t)=>t?{close:"]",open:"["}:{close:"}",open:"{"},Vu=(t,r,o)=>t?{name:null,path:`${o}[${r}]`}:{name:String(r),path:`${o}.${r}`},Bu=({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:x,renderValue:y})=>{let C=ku.useMemo(()=>sa({ancestors:new WeakSet,value:t}),[t]),[w,P]=Lu(()=>{let _={};if(l)_.root=!0;return _}),z=(_,J)=>{if(_==="root"&&w[_]===void 0)return l;return w[_]??J},B=(_)=>{P((J)=>({...J,[_]:!z(_,i)}))},D=(_)=>{P({})},O=()=>{try{let _=JSON.stringify(C,null,2);navigator.clipboard.writeText(_),Y.success("Copied to clipboard",{description:"JSON data has been copied to clipboard",duration:3000})}catch(_){console.error("Failed to copy JSON to clipboard",_),Y.error("Copy failed",{description:"Failed to copy JSON to clipboard",duration:3000})}},F={maxWidth:x??"auto"},G=(_,J,Q,X,se)=>{let ye=[],ve=Au(J),Re=Array.isArray(J),Me=ve&&Object.keys(J).length===0,Ae=Hu(Re),be={marginLeft:Q*c},qe=Iu(X),he=se;if(!ve){let ae=y?.(J,X);return ye.push(wt("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}),wt("div",{className:"flex min-w-0",style:be,children:[Pe("span",{"aria-hidden":!0,className:"mr-1 w-4 shrink-0"}),_!==null&&wt("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:" "})]}),ae??Pe("span",{className:e("min-w-0 break-all",Eu(J)),children:Mu(J)})]})]},qe)),[ye,he+1]}let _e=z(X,i),K=Ou(Me,_e);if(ye.push(wt("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}),wt("div",{className:"flex items-start",style:be,children:[Pe("button",{onClick:()=>{B(X)},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:K}),wt("div",{children:[_!==null&&wt("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?wt("span",{className:"text-gray-600 dark:text-gray-400",children:[Me?"":"...",Ae.close]}):null]})]})]},`${qe}-open`)),he+=1,_e&&!Me){let ae=he,ee=Re?J.map((Ce,st)=>[st,Ce]):Object.entries(J);for(let[Ce,st]of ee){let Se=Vu(Re,Ce,X),[Rr,U]=G(Se.name,st,Q+1,Se.path,ae);ye.push(...Rr),ae=U}return ye.push(wt("div",{className:"flex",children:[d&&Pe("div",{className:"text-gray-400 dark:text-gray-600 select-none w-8 text-right pr-2",children:ae}),Pe("div",{className:"text-gray-600 dark:text-gray-400",style:be,children:Ae.close})]},`${qe}-close`)),ae+=1,[ye,ae]}return[ye,he]},[V]=G(null,C,0,"root",1);return wt("div",{className:e(Du({size:s,variant:a}),o?.root,r),style:F,children:[u&&wt("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"}),wt("div",{className:"flex gap-2",children:[Pe(n,{size:"sm",variant:"outline",onClick:()=>{D(!0)},children:"Expand All"}),Pe(n,{size:"sm",variant:"outline",onClick:()=>{D(!1)},children:"Collapse All"}),wt(n,{size:"sm",variant:"outline",onClick:O,children:[Pe(te,{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})]})},ia=Bu;import{useId as Fu,useState as _u}from"react";import zu from"react-markdown";import{jsx as ur,jsxs as la,Fragment as Ju}from"react/jsx-runtime";var ri=({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(ce,{className:"size-3.5 text-muted-foreground"}):ur(mr,{className:"size-3.5 text-muted-foreground"})})},$u=({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:x,showHeader:y=!0,footer:C,className:w,editorClassName:P,previewClassName:z,textareaProps:B})=>{let D=Fu(),O=x??D,[F,G]=_u(l),V=i??F,_=(J)=>{if(i===void 0)G(J);c?.(J)};return la("div",{className:e("grid gap-2",w),children:[y&&la("div",{className:"flex items-center justify-between gap-3",children:[ur(b,{htmlFor:V==="write"?O:void 0,children:t}),ur(ri,{mode:V,onModeChange:_,labels:s,disabled:u})]}),V==="write"?la(Ju,{children:[ur(Je,{...B,id:O,value:r,disabled:u,placeholder:g,"aria-label":y?B?.["aria-label"]:B?.["aria-label"]??t,className:e("min-h-48 resize-y font-mono text-sm",P),onChange:(J)=>{o(J.target.value)}}),C]}):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",z),children:d.trim()?ur(zu,{children:d}):ur("div",{className:"not-prose text-muted-foreground",children:a})})]})};import{jsx as po,jsxs as Gu}from"react/jsx-runtime";var ju=({open:t,onOpenChange:r,title:o="JSON Viewer",data:a,jsonViewerProps:s})=>po(k,{open:t,onOpenChange:r,children:Gu(E,{className:"max-w-2xl max-h-[80vh] flex flex-col",children:[po(H,{children:po(M,{children:o})}),po(ia,{data:a,className:"min-h-0 flex-1",variant:"filled",size:"sm",showToolbar:!0,expandAll:!1,expandRoot:!0,...s})]})});import*as oi from"react";import{jsx as ni,jsxs as ca}from"react/jsx-runtime";var ai=oi.forwardRef(function({id:r,label:o,optionalLabel:a,help:s,error:i,className:l,children:c,...d},u){return ca("div",{ref:u,className:e("grid content-start gap-2",l),...d,children:[ca(b,{htmlFor:r,children:[o,a===void 0?null:ca("span",{className:"font-normal text-muted-foreground",children:["(",a,")"]})]}),c,i===void 0?null:ni("p",{role:"alert",className:"text-sm text-destructive",children:i}),i===void 0&&s!==void 0&&s!==""?ni("p",{className:"text-xs leading-relaxed text-muted-foreground",children:s}):null]})});ai.displayName="LabeledField";var Wu=ai;import{jsx as si,jsxs as ii}from"react/jsx-runtime";var Xu=({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 ii("a",{href:t,...a?{rel:"noopener noreferrer",target:"_blank"}:{},className:i,children:[r,si(zt,{className:"h-3 w-3"})]});return ii(s,{to:t,className:i,children:[r,si(zt,{className:"h-3 w-3"})]})};import{useState as Uu}from"react";import{jsx as mo,jsxs as Yu}from"react/jsx-runtime";var Ku=({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]=Uu(!r),y=u?t:(()=>{if(t.startsWith("{")||t.startsWith("["))return`{ ${a.repeat(10)} }`;return a.repeat(Math.min(t.length,20))})(),C=c?y.slice(0,50)+(y.length>50?"...":""):y,w=u?l:i,P=r&&s?mo(n,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6",onClick:()=>{g(!u)},title:w,"aria-label":w,children:u?mo(He,{className:"h-3 w-3"}):mo(ce,{className:"h-3 w-3"})}):null;if(d!==void 0)return d({displayValue:C,toggle:P});return Yu("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:C}),P]})};import*as di from"react";import{jsx as li,jsxs as ci}from"react/jsx-runtime";var ui=di.forwardRef(function({icon:r,text:o,trailing:a,className:s,...i},l){return ci("div",{ref:l,className:e("flex min-w-0 items-center gap-2",s),...i,children:[ci("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?li("span",{className:"text-primary/70",children:r}):null,li("span",{className:"min-w-0 truncate",children:o})]}),a]})});ui.displayName="MutedPlaceholder";var qu=ui;import{useMemo as Zu,useState as Qu}from"react";import{jsx as Ct,jsxs as fo}from"react/jsx-runtime";var da=({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)=>da({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,da({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,pi=(t)=>Object.prototype.toString.call(t)==="[object String]"&&t===String.prototype.valueOf.call(t),ua=(t)=>pi(t)?t:void 0,ep=(t)=>Hr(t)?.filter(pi)??[],tp=(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},mi=(t)=>{let r=ua(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"},fi=(t,r="schema")=>{let o=tr(t.properties);if(o){let s=new Set(ep(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(mi(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}]:[]})},pa=(t,r,o=new Set)=>{let a=tp(t),s=ua(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 pa(i,r,new Set([...o,s]))},gi=({child:t,depth:r,root:o,defaultExpandedDepth:a})=>{let s=pa(t.schema,o),i=fi(s,t.path),[l,c]=Qu(r<a),d=mi(s),u=ua(s.description),g=i.length>0,x=l?`Collapse ${t.name}`:`Expand ${t.name}`;return fo(de,{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(fe,{"aria-label":x,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(pe,{children:Ct("div",{className:"border-l border-border/70",children:i.map((y)=>Ct(gi,{child:y,defaultExpandedDepth:a,depth:r+1,root:o},y.path))})}):null]})},rp=({schema:t,className:r,defaultExpandedDepth:o=1,emptyLabel:a="No fields"})=>{let s=Zu(()=>da({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=pa(i,i),c=fi(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(gi,{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 cp,useReducer as dp,cloneElement as Kh,forwardRef as Yh}from"react";import{createPortal as up,unstable_batchedUpdates as wo}from"react-dom";import{useMemo as fa,useLayoutEffect as np,useEffect as vi,useRef as fn,useCallback as go}from"react";function hi(){for(var t=arguments.length,r=Array(t),o=0;o<t;o++)r[o]=arguments[o];return fa(()=>(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 ga(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)||ga(t))return t.ownerDocument;return document}var Bt=An?np:vi;function ho(t){let r=fn(t);return Bt(()=>{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 xi(){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 Bt(()=>{if(o.current!==t)o.current=t},r),o}function vn(t,r){let o=fn();return fa(()=>{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 vi(()=>{r.current=t},[t]),r.current}var ma={};function jr(t,r){return fa(()=>{if(r)return r;let o=ma[t]==null?0:ma[t]+1;return ma[t]=o,t+"-"+o},[t,r])}function yi(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=yi(1),Wr=yi(-1);function op(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 ap(t){if(!t)return!1;let{TouchEvent:r}=ze(t.target);return r&&t instanceof r}function yo(t){if(ap(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(op(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}}}),bi="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function wi(t){if(t.matches(bi))return t;return t.querySelector(bi)}import Ni,{useState as sp,useCallback as ip}from"react";var lp={display:"none"};function Ri(t){let{id:r,value:o}=t;return Ni.createElement("div",{id:r,style:lp},o)}function Ci(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 Ni.createElement("div",{id:r,style:s,role:"status","aria-live":a,"aria-atomic":!0},o)}function Si(){let[t,r]=sp("");return{announce:ip((a)=>{if(a!=null)r(a)},[]),announcement:t}}var Bi=Fn(null);function pp(t){let r=yn(Bi);xe(()=>{if(!r)throw Error("useDndMonitor must be used within a children of <DndContext>");return r(t)},[t,r])}function mp(){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 fp={draggable:`
|
|
2
|
+
import{pr,yt,mr,te,hr,zt,He,ce,gr,vr,xr,br,yr,lt,St,ct,Ge,Sr,Cr,$e}from"../../index-vrj20h57.js";import{p,n}from"../../index-x5ks3173.js";import{f,m}from"../../index-k2h122pf.js";import{k,E,G,ar,M,Z,h,b}from"../../index-9b0ygc2v.js";import{Ke,je,Ye,ue,Rt,re,Xe,A,de,fe,pe,oe,Ze,me,Qe,Y,N,R,L,I,pt,Je,Pt,Tt,kt,Et,Mt,Dt,At,Nt,_t,Ot,Ft,Ve,et,tt,rt,Ut,Vt,mt,ht,Gt,$t}from"../../index-yrsgjmrw.js";import{ot,at,nt}from"../../index-wqsh9yj5.js";import{nr}from"../../index-w7ba75b9.js";import{gt}from"../../index-r4k327de.js";import{ut,T,dt,Oe,Fe,ft,Be}from"../../index-cxjzg167.js";import{v,S}from"../../index-dt6f1hvx.js";import"../../index-1ckm293n.js";import{e}from"../../index-fwsd4nes.js";import{jsx as lc,jsxs as cc}from"react/jsx-runtime";var ic=({children:t,loading:r=!1,fullWidth:o=!1,className:a,disabled:s,variant:i,size:l,...c})=>cc(n,{variant:i,size:l,className:e(o&&"w-full",a),disabled:s===!0||r,...c,children:[r&&lc($e,{size:20,className:"mr-2"}),t]}),dc=ic;import*as ja from"react";import{jsx as Ja,jsxs as pc}from"react/jsx-runtime";var uc=({children:t,className:r,type:o="button",...a},s)=>pc(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:[Ja("span",{className:"mr-2 inline-flex size-5 items-center justify-center rounded-full border border-border/70 bg-muted/45 text-foreground",children:Ja(Ge,{className:"size-3.5"})}),t]}),Kn=ja.forwardRef(uc);Kn.displayName="AddItemButton";var mc=Kn;import{forwardRef as fc}from"react";import{jsx as bc}from"react/jsx-runtime";var Ga=(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},gc=(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 Ga(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(!Ga(u,d,c))return null;return`${u}-${String(d).padStart(2,"0")}-${String(c).padStart(2,"0")}`}return null},Wa=fc(function({onPaste:r,...o},a){return bc(h,{ref:a,type:"date",onPaste:(i)=>{let l=i.clipboardData.getData("text"),c=gc(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})});Wa.displayName="DateInput";var vc=Wa;import*as Xa from"react";import{jsx as xc}from"react/jsx-runtime";var Ua=p("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]"}}}),hc=({as:t="h2",size:r,className:o,...a},s)=>xc(t,{ref:s,className:e(Ua({size:r}),o),...a}),Ka=Xa.forwardRef(hc);Ka.displayName="DisplayHeading";var yc=Ka;import*as Er from"react";import{jsx as on,jsxs as qa,Fragment as Ya}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},x){let[y,P]=Er.useState(!1),w=Er.useRef(null);Er.useEffect(()=>()=>{if(w.current!==null)clearTimeout(w.current)},[]);let D=async(z)=>{u?.(z);try{if(await navigator.clipboard.writeText(r),P(!0),w.current!==null)clearTimeout(w.current);w.current=setTimeout(()=>{P(!1)},c)}catch{A.error(l)}};if(a==="button")return on(n,{ref:x,type:"button",variant:"outline",onClick:(z)=>{D(z)},"aria-label":`Copy ${o}`,className:e("shrink-0",d),...g,children:y?qa(Ya,{children:[on(f,{className:"mr-1 size-4"}),i]}):qa(Ya,{children:[on(te,{className:"mr-1 size-4"}),s]})});return on("button",{ref:x,type:"button",onClick:(z)=>{D(z)},"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:y?on(f,{className:"size-3.5 text-primary"}):on(te,{className:"size-3.5"})})});Yn.displayName="CopyButton";var wc=Yn;import{jsx as Wo,jsxs as Nc}from"react/jsx-runtime";var Za="#a3d54a",Qa=({className:t,...r})=>Nc("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:[Wo("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}),Wo("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:Za,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2.2}),Wo("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:Za,r:2.3})]});Qa.displayName="CollectiveIntelligenceLoader";var Rc=Qa;import{jsx as Sc}from"react/jsx-runtime";var Cc=({children:t,className:r})=>Sc("div",{className:e("text-destructive text-sm text-center",r),children:t}),Pc=Cc;import*as es from"react";import{jsx as kc}from"react/jsx-runtime";var Tc=({value:t,fallback:r="—",locale:o,className:a,...s},i)=>kc("span",{ref:i,className:e("tabular-nums",a),...s,children:t===null||t===void 0?r:new Intl.NumberFormat(o).format(t)}),ts=es.forwardRef(Tc);ts.displayName="FormattedNumber";var Lc=ts;import*as rs from"react";import{jsx as Mc}from"react/jsx-runtime";var Dc={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))]"},Ec={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"},ns=rs.forwardRef(function({tone:r="neutral",size:o="md",initial:a,className:s,children:i,...l},c){return Mc("span",{ref:c,"aria-hidden":!0,className:e("inline-flex shrink-0 select-none items-center justify-center border font-display font-bold",Ec[o],Dc[r],s),...l,children:i??(a!==void 0&&a!==""?a.slice(0,2).toUpperCase():null)})});ns.displayName="IconTile";var Ic=ns;import*as os from"react";import{jsx as Hc}from"react/jsx-runtime";var Ac={accent:"text-(--accent)",copper:"text-(--text-muted)",default:"text-(--text-muted)",muted:"text-(--text-muted)"},Oc=({as:t="span",tone:r="default",className:o,...a},s)=>Hc(t,{ref:s,className:e("inline-block text-[11px] font-semibold uppercase tracking-[0.06em]",Ac[r],o),...a}),an=os.forwardRef(Oc);an.displayName="Kicker";var Vc=an;import*as as from"react";import{jsx as _c}from"react/jsx-runtime";var Bc=(t)=>`+${t}`,Fc=({expanded:t,hiddenCount:r,collapsedLabel:o=Bc,expandedLabel:a="Show less",onToggle:s,className:i,...l},c)=>_c("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)}),ss=as.forwardRef(Fc);ss.displayName="ShowMoreTag";var zc=ss;import*as is from"react";import{jsx as jc}from"react/jsx-runtime";var $c=p("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]"}}}),Jc=({size:t,className:r,...o},a)=>jc("span",{ref:a,className:e($c({size:t}),r),...o}),sn=is.forwardRef(Jc);sn.displayName="SerifNumeral";var Gc=sn;import{jsx as Xo,jsxs as Xc}from"react/jsx-runtime";var Uo=9,ls=2*Math.PI*Uo,Wc=(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)))},cs=({className:t,classes:r,label:o,max:a=100,min:s=0,title:i,value:l,"aria-label":c,...d})=>{let u=Wc(l,s,a),g=Math.round(u*100),x=s+u*(a-s),y=ls*(1-u);return Xo("span",{"aria-label":c??`${o}: ${g}%`,"aria-valuemax":a,"aria-valuemin":s,"aria-valuenow":x,className:e("grid size-8 shrink-0 place-items-center text-muted-foreground",r?.root,t),title:i??`${o} ${g}%`,...d,children:Xc("svg",{"aria-hidden":"true",className:e("size-6 -rotate-90",r?.svg),viewBox:"0 0 24 24",children:[Xo("circle",{className:e("stroke-muted",r?.track),cx:"12",cy:"12",fill:"none",r:Uo,strokeWidth:"3"}),Xo("circle",{className:e("stroke-foreground transition-[stroke-dashoffset]",r?.indicator),cx:"12",cy:"12",fill:"none",r:Uo,strokeDasharray:ls,strokeDashoffset:y,strokeLinecap:"round",strokeWidth:"3"})]})})};cs.displayName="Ring";var Uc=cs;import*as ps from"react";import{jsx as us,jsxs as qc}from"react/jsx-runtime";var ds={danger:"bg-destructive",neutral:"bg-muted-foreground/40",primary:"bg-primary",success:"bg-emerald-500",warning:"bg-amber-500"},Kc={md:"size-2",sm:"size-1.5"},Yc=({tone:t="neutral",pulse:r=!1,size:o="sm",className:a,...s},i)=>qc("span",{ref:i,className:e("relative inline-flex shrink-0",Kc[o],a),...s,children:[r&&us("span",{"aria-hidden":!0,className:e("absolute inline-flex h-full w-full animate-ping rounded-full opacity-60",ds[t])}),us("span",{"aria-hidden":!0,className:e("relative inline-flex h-full w-full rounded-full",ds[t])})]}),qn=ps.forwardRef(Yc);qn.displayName="StatusDot";var Zc=qn;import*as gs from"react";import{jsx as fs,jsxs as ms}from"react/jsx-runtime";var Qc={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))]"},ed=({tooltip:t,tone:r="neutral",icon:o,className:a,children:s,...i},l)=>ms(et,{children:[fs(tt,{asChild:!0,children:ms(ue,{ref:l,variant:"outline",className:e(Qc[r],a),...i,children:[o,s]})}),fs(rt,{children:t})]}),bs=gs.forwardRef(ed);bs.displayName="TooltipBadge";var td=bs;import*as vs from"react";import{jsx as nd}from"react/jsx-runtime";var rd={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=vs.forwardRef(function({variant:r="body1",as:o,className:a,...s},i){let{tag:l,className:c}=rd[r];return nd(o??l,{ref:i,className:e(c,a),...s})});Zn.displayName="Typography";import{jsx as ad}from"react/jsx-runtime";var od=({children:t,as:r="form",className:o,onSubmit:a,...s})=>{let i=(l)=>{l.preventDefault(),a?.(l)};return ad(r,{className:e("flex flex-col gap-4 min-w-[300px]",o),onSubmit:i,...s,children:t})},sd=od;import{jsx as dd}from"react/jsx-runtime";var hs={},ln=(...t)=>{for(let r of t)if(r!==void 0)return r;return 1},id=(t=hs)=>({"--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)}),ld=["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(" "),cd=({cols:t=hs,children:r,...o})=>dd("div",{className:ld,style:id(t),...o,children:r});import{jsx as pd}from"react/jsx-runtime";var ud=({className:t,spaced:r=!1,...o})=>pd("div",{className:e("animate-[rise-in_500ms_cubic-bezier(0.16,1,0.3,1)_both]",r&&"space-y-6",t),...o});var md=ud;import{jsx as Dn,jsxs as cn}from"react/jsx-runtime";var fd=(t)=>t!==null&&t!==void 0&&t.constructor===String,Ln=(t)=>t!==null&&t!==void 0&&t!==!1&&t!==""&&t!==0,gd=({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:fd(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 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]})]}),bd=gd;import*as ys from"react";import{jsx as Qn,jsxs as xs}from"react/jsx-runtime";var Ko=(t)=>t!==void 0&&t!==null&&t!==!1&&t!==0&&t!==""&&!Number.isNaN(t),ws=ys.forwardRef(function({icon:r,title:o,description:a,action:s,className:i,...l},c){return xs("div",{ref:c,className:e("flex items-start gap-3",i),...l,children:[Ko(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,xs("div",{className:"min-w-0 flex-1",children:[Qn("h3",{className:"text-[15px] font-semibold leading-snug text-foreground",children:o}),Ko(a)?Qn("p",{className:"mt-0.5 text-sm leading-relaxed text-muted-foreground",children:a}):null]}),Ko(s)?Qn("div",{className:"shrink-0",children:s}):null]})});ws.displayName="SectionHeader";var vd=ws;import{jsx as Ns,jsxs as xd}from"react/jsx-runtime";var hd=({title:t,toolbar:r})=>xd("div",{className:"flex items-center justify-between mb-12",children:[Ns(Zn,{variant:"h2",children:t}),Boolean(r)&&Ns("div",{className:"flex items-center gap-2",children:r})]}),yd=hd;import*as to from"react";import{jsx as It,jsxs as eo}from"react/jsx-runtime";var Rs=(t,r,o)=>{if(t.length>=r)return t;return[...t,...Array.from({length:r-t.length},o)]},wd=[],Yo=({values:t,defaultValues:r=wd,onValuesChange:o,addLabel:a,getRemoveLabel:s,actions:i,minItems:l=0,disabled:c=!1,renderItem:d,createItem:u,validateItem:g,classes:x,className:y,id:P,...w})=>{let D=to.useId(),[z,B]=to.useState(()=>Rs(r,l,u)),O=Rs(t??z,l,u),H=Boolean(i),F=(j)=>{if(t===void 0)B(j);o?.(j)};return eo("div",{"data-slot":"array-input",className:e("space-y-2",x?.root,y),...w,children:[It("div",{className:"space-y-2",children:O.map((j,V)=>{let _=V===0&&P!==void 0&&P!==""?P:`${D}-${V}`,J=g?.(j,V);return eo("div",{className:e("flex items-center gap-3",x?.row),children:[d({disabled:c,id:_,index:V,onValueChange:(Q)=>{let X=[...O];X[V]=Q,F(X)},validationMessage:J,value:j}),O.length>l?It(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",x?.removeButton),onClick:()=>{F(O.filter((Q,X)=>X!==V))},children:It(Sr,{"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",x?.actionRow),children:[It(Kn,{disabled:c,className:x?.addButton,onClick:()=>{F([...O,u()])},children:a}),H?It("div",{className:e("sm:ml-auto",x?.actions),children:i}):null]})]})},Nd=(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 It(Yo,{...c,createItem:r??(()=>""),renderItem:l});return It(Yo,{...c,createItem:r??(()=>""),renderItem:(g)=>{let{disabled:x,id:y,index:P,onValueChange:w,validationMessage:D,value:z}=g;return eo("div",{className:"min-w-0 flex-1",children:[It(h,{...u,id:y,"aria-label":o(P),"aria-invalid":Boolean(D),value:z,placeholder:s,required:i,disabled:x,className:e("w-full",d,c.classes?.input),onChange:(B)=>{w(B.target.value)}}),D!==void 0&&D!==""?It("p",{className:"mt-1 text-xs text-destructive",role:"alert",children:D}):null]})}})},Rd=(t)=>It(Yo,{...t}),Cd=(t)=>t.createItem!==void 0&&t.renderItem!==void 0,Cs=(t)=>{if(Cd(t))return It(Rd,{...t});return It(Nd,{...t})};Cs.displayName="ArrayInput";var Sd=Cs;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 Ht={hour:9,interval:1,minute:0,mode:"day",monthday:1,weekdays:[1,2,3,4,5]},qo=/^\*\/(?<step>\d+)$/u,Pd=(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},Td=(t,r,o,a)=>{if(r==="*"&&o==="*"&&a==="*"){let s=qo.exec(t),i=Number(s?.groups?.step);return s&&i>=1&&i<=59?{...Ht,interval:i,mode:"minutes"}:null}return},kd=(t,r,o,a)=>{if(r!=="*"||o!=="*")return;let s=qo.exec(t);if(s){let i=Number(s.groups?.step);return i>=1&&i<=23?{...Ht,interval:i,minute:a,mode:"hours"}:null}return},Ld=(t,r,o)=>{let a=qo.exec(t);if(a){let i=Number(a.groups?.step);if(i%7===0&&i>=7&&i<=28)return{...Ht,hour:r,interval:i/7,minute:o,mode:"weeks"};return i>=1&&i<=31?{...Ht,hour:r,interval:i,minute:o,mode:"days"}:null}let s=Number(t);return/^\d+$/u.test(t)&&s>=1&&s<=31?{...Ht,hour:r,minute:o,mode:"month",monthday:s}:null},Dd=(t,r,o)=>{let a=Pd(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{...Ht,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=Td(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=kd(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{...Ht,hour:g,minute:d,mode:"day"};if(l==="*")return Ld(s,g,d);if(s==="*")return Dd(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")}},Ss=(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!=="*"&&!Ss(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},Ed=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Md=(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=Md(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)=>Ed[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")}},Zo=(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)=>Ss(a,o[s][0],o[s][1]))};import*as Ts from"react";var Ps=(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)},Id=(t)=>{let r=Ps(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,Qo=()=>{if(no)return no;let t="supportedValuesOf"in Intl?Intl.supportedValuesOf("timeZone"):["UTC"];return no=Mr(["UTC",...t].map((r)=>({label:`${r} (UTC${Id(r)})`,offset:Ps(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 Ad}from"react/jsx-runtime";var oo=({value:t,onChange:r,className:o,width:a="100%",disabled:s,placeholder:i="Select timezone"})=>{let l=Ts.useMemo(()=>Qo(),[]);return Ad(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 ne,jsxs as De,Fragment as zd}from"react/jsx-runtime";var Ds=[{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"}],Od=[{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}],Hd=(t)=>Ds.some((r)=>r.value===t),ks=(t)=>{let r=t.trim();if(!r)return{custom:Ir(Ht),simple:Ht,view:"simple"};let o=En(r);if(o)return{custom:r,simple:o,view:"simple"};return{custom:r,simple:Ht,view:"advanced"}},Vd=(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)),Ls=(t)=>String(t).padStart(2,"0"),Bd=({hour:t,minute:r,onChange:o})=>De("div",{className:"flex items-center gap-1",children:[ne(h,{type:"number",min:0,max:23,value:Ls(t),onChange:(a)=>{o(ao(Number(a.target.value)||0,0,23),r)},className:"w-16 text-center font-mono"}),ne("span",{className:"text-muted-foreground",children:":"}),ne(h,{type:"number",min:0,max:59,value:Ls(r),onChange:(a)=>{o(t,ao(Number(a.target.value)||0,0,59))},className:"w-16 text-center font-mono"})]}),Fd=({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:[ne("div",{className:"grid gap-2 sm:grid-cols-[minmax(0,1fr)_auto] sm:items-end",children:De("div",{className:"space-y-2",children:[ne("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&&ne(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(Hd(u))r({mode:u})},children:[ne(_t,{className:"flex-1",children:ne(Nt,{})}),ne(Ft,{children:Ds.map((u)=>ne(Ot,{value:u.value,children:Vd(u,t.interval)},u.value))})]})]})]})}),c&&De("div",{className:"space-y-2",children:[ne("span",{className:"text-xs font-medium text-muted-foreground",children:"On"}),ne(Gt,{type:"multiple",variant:"outline",size:"sm",value:t.weekdays.map(String),onValueChange:(u)=>{r({weekdays:u.length?Mr(u.map(Number),(g,x)=>g-x):[1]})},className:"w-full",children:Od.map((u)=>ne($t,{value:String(u.value),"aria-label":u.label,className:"text-xs",children:u.short},u.value))})]}),d&&De("div",{className:"space-y-2",children:[ne("span",{className:"text-xs font-medium text-muted-foreground",children:"On day"}),ne(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:[ne("span",{className:"text-xs font-medium text-muted-foreground",children:"At"}),ne(Bd,{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:[ne("span",{className:"text-xs font-medium text-muted-foreground",children:"Timezone"}),ne(oo,{value:o,onChange:a})]})]}),l&&De("div",{className:"space-y-2",children:[ne("span",{className:"text-xs font-medium text-muted-foreground",children:"At minute"}),ne(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"})]})]})},_d=({value:t,onChange:r,className:o,showPreview:a=!0,timezone:s,onTimezoneChange:i})=>{let[l,c]=dn.useState(()=>ks(t)),[d,u]=dn.useState(t),[g,x]=dn.useState(t);if(t!==d){if(u(t),t!==g)x(t),c(ks(t))}let y=dn.useCallback((O)=>{let H=O.view==="simple"?Ir(O.simple):O.custom;x(H),r(H)},[r]),P=(O)=>{c((H)=>{let F={...H.simple,...O},j={...H,custom:Ir(F),simple:F};return y(j),j})},w=(O)=>{c((H)=>{let F={...H,custom:O};return y(F),F})},D=(O)=>{c((H)=>{if(O===H.view)return H;if(O==="advanced"){let V=Ir(H.simple),_={...H,custom:V,view:O};return y(_),_}let F=En(H.custom),j=F?{...H,simple:F,view:O}:{...H,view:O};return y(j),j})},z=Zo(l.custom),B=null;if(l.view==="simple")B=ro(Ir(l.simple));else if(z)B=ro(l.custom);return De("div",{className:e("space-y-4",o),children:[De(Ut,{value:l.view,onValueChange:(O)=>{if(O==="simple"||O==="advanced")D(O)},children:[De(Vt,{className:"grid w-full grid-cols-2 rounded-md bg-muted/70 p-1 sm:w-[320px]",children:[ne(mt,{value:"simple",className:"text-xs",children:"Simple"}),ne(mt,{value:"advanced",className:"text-xs",children:"Advanced"})]}),ne(ht,{value:"simple",className:"space-y-3 pt-3",children:ne(Fd,{state:l.simple,onChange:P,timezone:s,onTimezoneChange:i})}),De(ht,{value:"advanced",className:"space-y-2 pt-3",children:[ne("span",{className:"text-xs font-medium text-muted-foreground",children:"Cron Expression"}),ne(h,{value:l.custom,onChange:(O)=>{w(O.target.value)},placeholder:"0 9 * * 1-5",className:e("font-mono text-sm",!z&&l.custom.trim()&&"border-destructive focus-visible:ring-destructive/40"),spellCheck:!1}),ne("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:[ne("span",{className:"text-xs font-medium text-muted-foreground",children:"Timezone"}),ne(oo,{value:s,onChange:i})]}),a&&ne("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?ne("span",{className:"text-destructive",children:"Invalid cron expression"}):De(zd,{children:[ne("span",{className:"text-muted-foreground",children:B}),ne(ue,{variant:"secondary",className:"ml-auto font-mono text-[11px]",children:l.view==="simple"?Ir(l.simple):l.custom})]})})]})};import{jsx as ea}from"react/jsx-runtime";var $d={both:"w-full h-full",horizontal:"w-full h-auto",none:"",vertical:"h-full w-auto"},Jd=({src:t,alt:r="",className:o="",width:a,height:s,fill:i="horizontal",style:l})=>{if(i==="both")return ea("div",{className:e("relative overflow-hidden rounded-lg shadow-md",o),style:{height:s,width:a,...l},children:ea("img",{src:t,alt:r,className:"object-cover w-full h-full absolute inset-0"})});return ea("img",{src:t,alt:r,width:a,height:s,className:e("object-cover rounded-lg shadow-md",$d[i],o),style:{height:i==="vertical"?"100%":s,width:i==="horizontal"?"100%":a,...l}})},jd=Jd;import{jsx as so,jsxs as Es}from"react/jsx-runtime";var Gd=({title:t,className:r,children:o,...a})=>Es("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})]}),Wd=({label:t,value:r,muted:o=!1,className:a,...s})=>Es("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 ta from"react";import{jsx as zr,jsxs as Ms}from"react/jsx-runtime";var Xd=({className:t,...r})=>zr(Tt,{"data-slot":"choice-card-group",className:e("grid gap-3",t),...r}),Ud=({title:t,description:r,media:o,footer:a,className:s,...i})=>{let l=ta.useId(),c=ta.useId(),d=Boolean(r);return Ms(kt,{"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(Et,{children:zr(f,{className:"size-3",strokeWidth:3})})}),o,Ms("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 Is}from"react/jsx-runtime";var As=Ar.forwardRef(function({className:r,...o},a){return Or("div",{ref:a,className:e("grid gap-2",r),...o})}),Os=({className:t,...r})=>Or(Mt,{className:e("grid gap-2",t),...r}),ra=(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 Is("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,Is("span",{className:"min-w-0 flex-1",children:[Or("span",{className:"block truncate text-sm font-medium",children:r}),ra(o)?Or("span",{id:a,className:e("mt-1 block text-xs text-muted-foreground",!s&&"truncate"),children:o}):null,d]})]})}),Hs=(t)=>Object.prototype.toString.call(t)==="[object String]",Vs=(t,r)=>t!==null&&r instanceof Node&&(t.contains(r)||r instanceof HTMLInputElement&&r.getAttribute("aria-hidden")==="true"),Kd=({value:t,title:r,description:o,radioLabel:a,disabled:s=!1,onClick:i,...l})=>{let c=Ar.useId(),d=Ar.useId(),u=a??(Hs(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 x=document.querySelector(`#${c}`);if(Vs(x,g.target))return;g.preventDefault(),x?.click()},control:Or(Dt,{"aria-describedby":ra(o)?d:void 0,"aria-label":u,className:"mt-1",disabled:s,id:c,value:t}),...l})},Yd=({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??(Hs(r)?r:void 0);return Or(io,{description:o,descriptionId:u,disabled:s,title:r,onClick:(x)=>{if(i?.(x),x.defaultPrevented||s)return;if(Vs(document.querySelector(`#${d}`),x.target))return;x.preventDefault(),l(!t)},control:Or(Xe,{"aria-describedby":ra(o)?u:void 0,"aria-label":g,checked:t,className:"mt-0.5",disabled:s,id:d,onCheckedChange:(x)=>{if(!s)l(x===!0)}}),...c})};As.displayName="CardOptionsBlock";Os.displayName="RadioCardOptionsBlock";io.displayName="CardOption";import*as Bs from"react";import{jsx as Mn,jsxs as na}from"react/jsx-runtime";var qd=({title:t,description:r,command:o,copyLabel:a=t??o,copyErrorMessage:s,className:i,...l},c)=>na("div",{ref:c,className:e("space-y-2",i),...l,children:[t===void 0&&r===void 0?null:na("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})]}),na("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})]})]}),Fs=Bs.forwardRef(qd);Fs.displayName="CommandStep";var Zd=Fs;import{forwardRef as Qd,useId as eu}from"react";import{jsx as In,jsxs as _s}from"react/jsx-runtime";var zs=Qd(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:x,placeholder:y,...P},w){let D=eu(),z=u??D,B=`Enter amount in ${r}`,O=x??1/10**g,H=y??(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(b,{htmlFor:z,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:w,className:e("bg-background pl-12",F&&"border-destructive",c),id:z,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})]})});zs.displayName="CurrencyInput";var tu=zs;import*as $s from"react";import{jsx as lo,jsxs as oa}from"react/jsx-runtime";var Js=$s.forwardRef(function({index:r,label:o,hint:a,className:s,children:i,...l},c){let d=Boolean(r),u=Boolean(a);return oa("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,oa("div",{className:"min-w-0 space-y-1.5",children:[oa("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]})]})});Js.displayName="FieldRow";var ru=Js;import{jsx as ge,jsxs as Wt,Fragment as cu}from"react/jsx-runtime";var nu=(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]}`},ou={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"},au=({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(Cr,{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})]})]}),su=({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(S,{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})]})]}),iu=({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(cu,{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(pr,{className:"h-5 w-5 text-(--success)"})}),Wt("div",{className:"flex flex-col",children:[Wt("div",{className:"flex items-center gap-2",children:[ge(gr,{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:nu(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(hr,{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(S,{className:"h-4 w-4 text-destructive"})}):null]})]}),lu=(t)=>{let{rootProps:r,inputProps:o,isDragActive:a,selectedFile:s,error:i,onRemoveFile:l,onDownloadFile:c,isDownloadingFile:d,disabled:u,className:g,labels:x}=t,y={...ou,...x},P=s!==void 0&&s!==null,w=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)]",w&&"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&&!w?ge(au,{active:Boolean(a),activeLabel:y.dragActive,hint:y.fileTypeHint,inactiveLabel:y.dragInactive}):null,s!==void 0&&s!==null&&!w?ge(iu,{downloadLabel:y.downloadFile,downloading:Boolean(d),downloadingLabel:y.downloadingFile,file:s,onDownload:c,onRemove:l}):null,i!==void 0&&i!==null&&i!==""?ge(su,{message:i,retryLabel:y.errorRetry}):null]})})},du=lu;import{jsx as js,jsxs as pu}from"react/jsx-runtime";var uu=p("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]"}}}),Gs=({options:t,value:r,onValueChange:o,label:a,size:s,className:i,classes:l,...c})=>js("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 pu("button",{type:"button","aria-pressed":u,disabled:d.disabled,onClick:()=>{o(d.value)},className:e(uu({active:u,size:s}),l?.chip),children:[d.label,d.count===void 0?null:js("span",{className:e("tabular-nums text-[11px] text-(--text-muted)",l?.count),children:d.count})]},d.value)})});Gs.displayName="FilterChips";var mu=Gs;import*as un from"react";import{jsx as dr,jsxs as wu}from"react/jsx-runtime";var fu=52,gu=26,uo=4,co=20,bu=(t)=>({"--flow-lane":t}),Xs=un.createContext(null),Us=(t)=>{let r=un.useContext(Xs);if(!r)throw Error(`${t} must be rendered inside a FlowBand.`);return r},vu=({lanes:t=1,stepHeight:r=fu,laneHeight:o=gu,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(Xs.Provider,{value:d,children:dr("div",{className:e("flex min-w-0 items-stretch gap-1",a),style:{height:c,...s},...l,children:i})})},hu=({className:t,style:r,children:o,...a})=>{let{stepHeight:s}=Us("FlowStep");return dr("div",{className:e("flex min-w-0 flex-1 items-stretch self-center",t),style:{height:s,...r},...a,children:o})},Ws=({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:bu(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)})})},xu=(t,r)=>{let o=(r-uo*(t-1))/t;return Array.from({length:t},(a,s)=>s*(o+uo)+o/2)},yu=({lanes:t,fork:r=!0,rejoin:o=!0,label:a,className:s,...i})=>{let{height:l}=Us("FlowBranch"),c=xu(t.length,l),d=t.map((u)=>u.color);return wu("div",{"aria-label":a,className:e("flex min-w-0 flex-1 items-stretch",s),...i,children:[r&&dr(Ws,{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(Ws,{centers:c,height:l,colors:d,merge:!0})]})};import*as Ks from"react";import{jsx as aa,jsxs as Ru}from"react/jsx-runtime";var Nu=({index:t,className:r,children:o,...a},s)=>Ru("div",{ref:s,className:e("grid grid-cols-[1.75rem_1fr] gap-x-3 leading-relaxed",r),...a,children:[aa("div",{className:"pt-[1px] text-right",children:aa(sn,{className:"opacity-80",children:t})}),aa("p",{className:"text-[13px] text-muted-foreground",children:o})]}),Ys=Ks.forwardRef(Nu);Ys.displayName="GuideStep";var Cu=Ys;import*as mn from"react";import{jsx as Ue,jsxs as pn,Fragment as Pu}from"react/jsx-runtime";var qs=mn.forwardRef(function({className:r,variant:o="island",...a},s){return Ue(re,{ref:s,variant:o,className:e("gap-0 p-0",r),...a})});qs.displayName="HierarchyTree";var Zs=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]})});Zs.displayName="HierarchyTreeHeader";var Qs=mn.forwardRef(function({className:r,...o},a){return Ue("div",{ref:a,"data-slot":"hierarchy-tree-body",className:e("min-w-0",r),...o})});Qs.displayName="HierarchyTreeBody";var Su=[],ei=mn.forwardRef(function({depth:r,rails:o=Su,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((x,y)=>Ue("span",{className:"relative w-5",children:x?Ue("span",{className:"absolute inset-y-0 left-0 border-l border-(--border-subtle)"}):null},y)),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(Pu,{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})]})});ei.displayName="HierarchyTreeRow";var ti=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]})});ti.displayName="HierarchyTreeToggle";var Tu=qs;import ku,{useState as Lu}from"react";import{jsx as Pe,jsxs as wt}from"react/jsx-runtime";var Du=p("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"}}}),sa=({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)=>sa({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,sa({ancestors:r,value:i})]));return r.delete(t),a}return o},Eu=(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"},Mu=(t)=>{if(t===null)return"null";if(t===void 0)return"undefined";if(String(t)===t)return`"${t}"`;return String(t)},Iu=(t)=>t,Au=(t)=>t!==null&&Object(t)===t,Ou=(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"})},Hu=(t)=>t?{close:"]",open:"["}:{close:"}",open:"{"},Vu=(t,r,o)=>t?{name:null,path:`${o}[${r}]`}:{name:String(r),path:`${o}.${r}`},Bu=({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:x,renderValue:y})=>{let P=ku.useMemo(()=>sa({ancestors:new WeakSet,value:t}),[t]),[w,D]=Lu(()=>{let _={};if(l)_.root=!0;return _}),z=(_,J)=>{if(_==="root"&&w[_]===void 0)return l;return w[_]??J},B=(_)=>{D((J)=>({...J,[_]:!z(_,i)}))},O=(_)=>{D({})},H=()=>{try{let _=JSON.stringify(P,null,2);navigator.clipboard.writeText(_),A.success("Copied to clipboard",{description:"JSON data has been copied to clipboard",duration:3000})}catch(_){console.error("Failed to copy JSON to clipboard",_),A.error("Copy failed",{description:"Failed to copy JSON to clipboard",duration:3000})}},F={maxWidth:x??"auto"},j=(_,J,Q,X,se)=>{let ye=[],ve=Au(J),Re=Array.isArray(J),Me=ve&&Object.keys(J).length===0,Ae=Hu(Re),be={marginLeft:Q*c},qe=Iu(X),he=se;if(!ve){let ae=y?.(J,X);return ye.push(wt("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}),wt("div",{className:"flex min-w-0",style:be,children:[Pe("span",{"aria-hidden":!0,className:"mr-1 w-4 shrink-0"}),_!==null&&wt("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:" "})]}),ae??Pe("span",{className:e("min-w-0 break-all",Eu(J)),children:Mu(J)})]})]},qe)),[ye,he+1]}let _e=z(X,i),K=Ou(Me,_e);if(ye.push(wt("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}),wt("div",{className:"flex items-start",style:be,children:[Pe("button",{onClick:()=>{B(X)},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:K}),wt("div",{children:[_!==null&&wt("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?wt("span",{className:"text-gray-600 dark:text-gray-400",children:[Me?"":"...",Ae.close]}):null]})]})]},`${qe}-open`)),he+=1,_e&&!Me){let ae=he,ee=Re?J.map((Ce,st)=>[st,Ce]):Object.entries(J);for(let[Ce,st]of ee){let Se=Vu(Re,Ce,X),[Rr,U]=j(Se.name,st,Q+1,Se.path,ae);ye.push(...Rr),ae=U}return ye.push(wt("div",{className:"flex",children:[d&&Pe("div",{className:"text-gray-400 dark:text-gray-600 select-none w-8 text-right pr-2",children:ae}),Pe("div",{className:"text-gray-600 dark:text-gray-400",style:be,children:Ae.close})]},`${qe}-close`)),ae+=1,[ye,ae]}return[ye,he]},[V]=j(null,P,0,"root",1);return wt("div",{className:e(Du({size:s,variant:a}),o?.root,r),style:F,children:[u&&wt("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"}),wt("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"}),wt(n,{size:"sm",variant:"outline",onClick:H,children:[Pe(te,{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})]})},ia=Bu;import{useId as Fu,useState as _u}from"react";import zu from"react-markdown";import{jsx as ur,jsxs as la,Fragment as Ju}from"react/jsx-runtime";var ri=({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(ce,{className:"size-3.5 text-muted-foreground"}):ur(mr,{className:"size-3.5 text-muted-foreground"})})},$u=({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:x,showHeader:y=!0,footer:P,className:w,editorClassName:D,previewClassName:z,textareaProps:B})=>{let O=Fu(),H=x??O,[F,j]=_u(l),V=i??F,_=(J)=>{if(i===void 0)j(J);c?.(J)};return la("div",{className:e("grid gap-2",w),children:[y&&la("div",{className:"flex items-center justify-between gap-3",children:[ur(b,{htmlFor:V==="write"?H:void 0,children:t}),ur(ri,{mode:V,onModeChange:_,labels:s,disabled:u})]}),V==="write"?la(Ju,{children:[ur(Je,{...B,id:H,value:r,disabled:u,placeholder:g,"aria-label":y?B?.["aria-label"]:B?.["aria-label"]??t,className:e("min-h-48 resize-y font-mono text-sm",D),onChange:(J)=>{o(J.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",z),children:d.trim()?ur(zu,{children:d}):ur("div",{className:"not-prose text-muted-foreground",children:a})})]})};import{jsx as po,jsxs as Gu}from"react/jsx-runtime";var ju=({open:t,onOpenChange:r,title:o="JSON Viewer",data:a,jsonViewerProps:s})=>po(k,{open:t,onOpenChange:r,children:Gu(E,{className:"max-w-2xl max-h-[80vh] flex flex-col",children:[po(G,{children:po(M,{children:o})}),po(ia,{data:a,className:"min-h-0 flex-1",variant:"filled",size:"sm",showToolbar:!0,expandAll:!1,expandRoot:!0,...s})]})});import*as oi from"react";import{jsx as ni,jsxs as ca}from"react/jsx-runtime";var ai=oi.forwardRef(function({id:r,label:o,optionalLabel:a,help:s,error:i,className:l,children:c,...d},u){return ca("div",{ref:u,className:e("grid content-start gap-2",l),...d,children:[ca(b,{htmlFor:r,children:[o,a===void 0?null:ca("span",{className:"font-normal text-muted-foreground",children:["(",a,")"]})]}),c,i===void 0?null:ni("p",{role:"alert",className:"text-sm text-destructive",children:i}),i===void 0&&s!==void 0&&s!==""?ni("p",{className:"text-xs leading-relaxed text-muted-foreground",children:s}):null]})});ai.displayName="LabeledField";var Wu=ai;import{jsx as si,jsxs as ii}from"react/jsx-runtime";var Xu=({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 ii("a",{href:t,...a?{rel:"noopener noreferrer",target:"_blank"}:{},className:i,children:[r,si(zt,{className:"h-3 w-3"})]});return ii(s,{to:t,className:i,children:[r,si(zt,{className:"h-3 w-3"})]})};import{useState as Uu}from"react";import{jsx as mo,jsxs as Yu}from"react/jsx-runtime";var Ku=({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]=Uu(!r),y=u?t:(()=>{if(t.startsWith("{")||t.startsWith("["))return`{ ${a.repeat(10)} }`;return a.repeat(Math.min(t.length,20))})(),P=c?y.slice(0,50)+(y.length>50?"...":""):y,w=u?l:i,D=r&&s?mo(n,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6",onClick:()=>{g(!u)},title:w,"aria-label":w,children:u?mo(He,{className:"h-3 w-3"}):mo(ce,{className:"h-3 w-3"})}):null;if(d!==void 0)return d({displayValue:P,toggle:D});return Yu("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}),D]})};import*as di from"react";import{jsx as li,jsxs as ci}from"react/jsx-runtime";var ui=di.forwardRef(function({icon:r,text:o,trailing:a,className:s,...i},l){return ci("div",{ref:l,className:e("flex min-w-0 items-center gap-2",s),...i,children:[ci("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?li("span",{className:"text-primary/70",children:r}):null,li("span",{className:"min-w-0 truncate",children:o})]}),a]})});ui.displayName="MutedPlaceholder";var qu=ui;import{useMemo as Zu,useState as Qu}from"react";import{jsx as Ct,jsxs as fo}from"react/jsx-runtime";var da=({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)=>da({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,da({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,pi=(t)=>Object.prototype.toString.call(t)==="[object String]"&&t===String.prototype.valueOf.call(t),ua=(t)=>pi(t)?t:void 0,ep=(t)=>Hr(t)?.filter(pi)??[],tp=(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},mi=(t)=>{let r=ua(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"},fi=(t,r="schema")=>{let o=tr(t.properties);if(o){let s=new Set(ep(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(mi(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}]:[]})},pa=(t,r,o=new Set)=>{let a=tp(t),s=ua(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 pa(i,r,new Set([...o,s]))},gi=({child:t,depth:r,root:o,defaultExpandedDepth:a})=>{let s=pa(t.schema,o),i=fi(s,t.path),[l,c]=Qu(r<a),d=mi(s),u=ua(s.description),g=i.length>0,x=l?`Collapse ${t.name}`:`Expand ${t.name}`;return fo(de,{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(fe,{"aria-label":x,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(pe,{children:Ct("div",{className:"border-l border-border/70",children:i.map((y)=>Ct(gi,{child:y,defaultExpandedDepth:a,depth:r+1,root:o},y.path))})}):null]})},rp=({schema:t,className:r,defaultExpandedDepth:o=1,emptyLabel:a="No fields"})=>{let s=Zu(()=>da({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=pa(i,i),c=fi(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(gi,{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 cp,useReducer as dp,cloneElement as Kh,forwardRef as Yh}from"react";import{createPortal as up,unstable_batchedUpdates as wo}from"react-dom";import{useMemo as fa,useLayoutEffect as np,useEffect as vi,useRef as fn,useCallback as go}from"react";function hi(){for(var t=arguments.length,r=Array(t),o=0;o<t;o++)r[o]=arguments[o];return fa(()=>(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 ga(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)||ga(t))return t.ownerDocument;return document}var Bt=An?np:vi;function ho(t){let r=fn(t);return Bt(()=>{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 xi(){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 Bt(()=>{if(o.current!==t)o.current=t},r),o}function vn(t,r){let o=fn();return fa(()=>{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 vi(()=>{r.current=t},[t]),r.current}var ma={};function jr(t,r){return fa(()=>{if(r)return r;let o=ma[t]==null?0:ma[t]+1;return ma[t]=o,t+"-"+o},[t,r])}function yi(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=yi(1),Wr=yi(-1);function op(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 ap(t){if(!t)return!1;let{TouchEvent:r}=ze(t.target);return r&&t instanceof r}function yo(t){if(ap(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(op(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}}}),bi="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function wi(t){if(t.matches(bi))return t;return t.querySelector(bi)}import Ni,{useState as sp,useCallback as ip}from"react";var lp={display:"none"};function Ri(t){let{id:r,value:o}=t;return Ni.createElement("div",{id:r,style:lp},o)}function Ci(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 Ni.createElement("div",{id:r,style:s,role:"status","aria-live":a,"aria-atomic":!0},o)}function Si(){let[t,r]=sp("");return{announce:ip((a)=>{if(a!=null)r(a)},[]),announcement:t}}var Bi=Fn(null);function pp(t){let r=yn(Bi);xe(()=>{if(!r)throw Error("useDndMonitor must be used within a children of <DndContext>");return r(t)},[t,r])}function mp(){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 fp={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
|
-
`},gp={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 bp(t){let{announcements:r=gp,container:o,hiddenTextDescribedById:a,screenReaderInstructions:s=fp}=t,{announce:i,announcement:l}=Si(),c=jr("DndLiveRegion"),[d,u]=Xt(!1);if(xe(()=>{u(!0)},[]),pp(Ne(()=>({onDragStart(x){let{active:y}=x;i(r.onDragStart({active:y}))},onDragMove(x){let{active:y,over:C}=x;if(r.onDragMove)i(r.onDragMove({active:y,over:C}))},onDragOver(x){let{active:y,over:C}=x;i(r.onDragOver({active:y,over:C}))},onDragEnd(x){let{active:y,over:C}=x;i(r.onDragEnd({active:y,over:C}))},onDragCancel(x){let{active:y,over:C}=x;i(r.onDragCancel({active:y,over:C}))}}),[i,r])),!d)return null;let g=rr.createElement(rr.Fragment,null,rr.createElement(Ri,{id:a,value:s.draggable}),rr.createElement(Ci,{id:c,announcement:l}));return o?up(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 Na(t,r){return Ne(()=>({sensor:t,options:r!=null?r:{}}),[t,r])}function Fi(){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 zi(t,r){let{data:{value:o}}=t,{data:{value:a}}=r;return o-a}function vp(t,r){let{data:{value:o}}=t,{data:{value:a}}=r;return a-o}function Pi(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 Ra(t,r){if(!t||t.length===0)return null;let[o]=t;return r?o[r]:o}function Ti(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 $i=(t)=>{let{collisionRect:r,droppableRects:o,droppableContainers:a}=t,s=Ti(r,r.left,r.top),i=[];for(let l of a){let{id:c}=l,d=o.get(c);if(d){let u=_i(Ti(d),s);i.push({id:c,data:{droppableContainer:l,value:u}})}}return i.sort(zi)},Ji=(t)=>{let{collisionRect:r,droppableRects:o,droppableContainers:a}=t,s=Pi(r),i=[];for(let l of a){let{id:c}=l,d=o.get(c);if(d){let u=Pi(d),g=s.reduce((y,C,w)=>y+_i(u[w],C),0),x=Number((g/4).toFixed(4));i.push({id:c,data:{droppableContainer:l,value:x}})}}return i.sort(zi)};function hp(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,x=g/(d+u-g);return Number(x.toFixed(4))}return 0}var xp=(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=hp(c,r);if(d>0)s.push({id:l,data:{droppableContainer:i,value:d}})}}return s.sort(vp)};function yp(t,r,o){return{...t,scaleX:r&&o?r.width/o.width:1,scaleY:r&&o?r.height/o.height:1}}function ji(t,r){return t&&r?{x:t.left-r.left,y:t.top-r.top}:Yt}function wp(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 Np=wp(1);function Rp(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 Cp(t,r,o){let a=Rp(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,x=i?t.height/i:t.height;return{width:g,height:x,top:u,right:d+g,bottom:u+x,left:d}}var Sp={ignoreTransform:!1};function Xr(t,r){if(r===void 0)r=Sp;let o=t.getBoundingClientRect();if(r.ignoreTransform){let{transform:u,transformOrigin:g}=ze(t).getComputedStyle(t);if(u)o=Cp(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 ki(t){return Xr(t,{ignoreTransform:!0})}function Pp(t){let{innerWidth:r,innerHeight:o}=t;return{top:0,left:0,right:r,bottom:o,width:r,height:o}}function Tp(t,r){if(r===void 0)r=ze(t).getComputedStyle(t);return r.position==="fixed"}function kp(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)||ga(s))return o;if(o.includes(s))return o;let i=ze(t).getComputedStyle(s);if(s!==t){if(kp(s,i))o.push(s)}if(Tp(s,i))return o;return a(s.parentNode)}if(!t)return o;return a(t)}function Gi(t){let[r]=_n(t,1);return r!=null?r:null}function ba(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 Wi(t){if($r(t))return t.scrollX;return t.scrollLeft}function Xi(t){if($r(t))return t.scrollY;return t.scrollTop}function xa(t){return{x:Wi(t),y:Xi(t)}}var Te;(function(t){t[t.Forward=1]="Forward",t[t.Backward=-1]="Backward"})(Te||(Te={}));function Ui(t){if(!An||!t)return!1;return t===document.scrollingElement}function Ki(t){let r={x:0,y:0},o=Ui(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 Lp={x:0.2,y:0.2};function Dp(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=Lp;let{isTop:u,isBottom:g,isLeft:x,isRight:y}=Ki(t),C={x:0,y:0},w={x:0,y:0},P={height:r.height*s.y,width:r.width*s.x};if(!u&&i<=r.top+P.height)C.y=Te.Backward,w.y=a*Math.abs((r.top+P.height-i)/P.height);else if(!g&&d>=r.bottom-P.height)C.y=Te.Forward,w.y=a*Math.abs((r.bottom-P.height-d)/P.height);if(!y&&c>=r.right-P.width)C.x=Te.Forward,w.x=a*Math.abs((r.right-P.width-c)/P.width);else if(!x&&l<=r.left+P.width)C.x=Te.Backward,w.x=a*Math.abs((r.left+P.width-l)/P.width);return{direction:C,speed:w}}function Ep(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 Yi(t){return t.reduce((r,o)=>Gr(r,xa(o)),Yt)}function Mp(t){return t.reduce((r,o)=>r+Wi(o),0)}function Ip(t){return t.reduce((r,o)=>r+Xi(o),0)}function Ap(t,r){if(r===void 0)r=Xr;if(!t)return;let{top:o,left:a,bottom:s,right:i}=r(t);if(!Gi(t))return;if(s<=0||i<=0||o>=window.innerHeight||a>=window.innerWidth)t.scrollIntoView({block:"center",inline:"center"})}var Op=[["x",["left","right"],Mp],["y",["top","bottom"],Ip]];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=Yi(o);this.rect={...t},this.width=t.width,this.height=t.height;for(let[s,i,l]of Op)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 Hp(t){let{EventTarget:r}=ze(t);return t instanceof r?t:Jr(t)}function va(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 Li(t){t.preventDefault()}function Vp(t){t.stopPropagation()}var q;(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"})(q||(q={}));var qi={start:[q.Space,q.Enter],cancel:[q.Esc],end:[q.Space,q.Enter,q.Tab]},Bp=(t,r)=>{let{currentCoordinates:o}=r;switch(t.code){case q.Right:return{...o,x:o.x+25};case q.Left:return{...o,x:o.x-25};case q.Down:return{...o,y:o.y+25};case q.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)Ap(o);r(Yt)}handleKeyDown(t){if(Hn(t)){let{active:r,context:o,options:a}=this.props,{keyboardCodes:s=qi,coordinateGetter:i=Bp,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 x=Wr(g,u),y={x:0,y:0},{scrollableAncestors:C}=o.current;for(let w of C){let P=t.code,{isTop:z,isRight:B,isLeft:D,isBottom:O,maxScroll:F,minScroll:G}=Ki(w),V=Ep(w),_={x:Math.min(P===q.Right?V.right-V.width/2:V.right,Math.max(P===q.Right?V.left:V.left+V.width/2,g.x)),y:Math.min(P===q.Down?V.bottom-V.height/2:V.bottom,Math.max(P===q.Down?V.top:V.top+V.height/2,g.y))},J=P===q.Right&&!B||P===q.Left&&!D,Q=P===q.Down&&!O||P===q.Up&&!z;if(J&&_.x!==g.x){let X=w.scrollLeft+x.x,se=P===q.Right&&X<=F.x||P===q.Left&&X>=G.x;if(se&&!x.y){w.scrollTo({left:X,behavior:l});return}if(se)y.x=w.scrollLeft-X;else y.x=P===q.Right?w.scrollLeft-F.x:w.scrollLeft-G.x;if(y.x)w.scrollBy({left:-y.x,behavior:l});break}else if(Q&&_.y!==g.y){let X=w.scrollTop+x.y,se=P===q.Down&&X<=F.y||P===q.Up&&X>=G.y;if(se&&!x.x){w.scrollTo({top:X,behavior:l});return}if(se)y.y=w.scrollTop-X;else y.y=P===q.Down?w.scrollTop-F.y:w.scrollTop-G.y;if(y.y)w.scrollBy({top:-y.y,behavior:l});break}}this.handleMove(t,Gr(Wr(g,this.referenceCoordinates),y))}}}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 Di(t){return Boolean(t&&"distance"in t)}function Ei(t){return Boolean(t&&"delay"in t)}class Po{constructor(t,r,o){var a;if(o===void 0)o=Hp(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,Li),this.windowListeners.add(Jt.VisibilityChange,this.handleCancel),this.windowListeners.add(Jt.ContextMenu,Li),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(Ei(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(Di(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,Vp,{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(Di(l)){if(l.tolerance!=null&&va(d,l.tolerance))return this.handleCancel();if(va(d,l.distance))return this.handleStart()}if(Ei(l)){if(va(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===q.Esc)this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}var Fp={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,Fp,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 _p={move:{name:"mousemove"},end:{name:"mouseup"}},ya;(function(t){t[t.RightClick=2]="RightClick"})(ya||(ya={}));class Zi extends Po{constructor(t){super(t,_p,Jr(t.event.target))}}Zi.activators=[{eventName:"onMouseDown",handler:(t,r)=>{let{nativeEvent:o}=t,{onActivation:a}=r;if(o.button===ya.RightClick)return!1;return a==null||a({event:o}),!0}}];var ha={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Qi extends Po{constructor(t){super(t,ha)}static setup(){return window.addEventListener(ha.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(ha.move.name,t)};function t(){}}}Qi.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 zp(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:x,threshold:y}=t,C=Jp({delta:x,disabled:!i}),[w,P]=xi(),z=Ee({x:0,y:0}),B=Ee({x:0,y:0}),D=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]),O=Ee(null),F=Kt(()=>{let V=O.current;if(!V)return;let _=z.current.x*B.current.x,J=z.current.y*B.current.y;V.scrollBy(_,J)},[]),G=Ne(()=>c===Co.TreeOrder?[...u].reverse():u,[c,u]);xe(()=>{if(!i||!u.length||!D){P();return}for(let V of G){if((a==null?void 0:a(V))===!1)continue;let _=u.indexOf(V),J=g[_];if(!J)continue;let{direction:Q,speed:X}=Dp(V,J,D,r,y);for(let se of["x","y"])if(!C[se][Q[se]])X[se]=0,Q[se]=0;if(X.x>0||X.y>0){P(),O.current=V,w(F,l),z.current=X,B.current=Q;return}}z.current={x:0,y:0},B.current={x:0,y:0},P()},[r,F,a,P,i,l,JSON.stringify(D),JSON.stringify(C),w,u,G,g,JSON.stringify(y)])}var $p={x:{[Te.Backward]:!1,[Te.Forward]:!1},y:{[Te.Backward]:!1,[Te.Forward]:!1}};function Jp(t){let{delta:r,disabled:o}=t,a=xo(r);return vn((s)=>{if(o||!a||!s)return $p;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 jp(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 Gp(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 wa;(function(t){t.Optimized="optimized"})(wa||(wa={}));var Mi=new Map;function Wp(t,r){let{dragging:o,dependencies:a,config:s}=r,[i,l]=Xt(null),{frequency:c,measure:d,strategy:u}=s,g=Ee(t),x=z(),y=bn(x),C=Kt(function(B){if(B===void 0)B=[];if(y.current)return;l((D)=>{if(D===null)return B;return D.concat(B.filter((O)=>!D.includes(O)))})},[y]),w=Ee(null),P=vn((B)=>{if(x&&!o)return Mi;if(!B||B===Mi||g.current!==t||i!=null){let D=new Map;for(let O of t){if(!O)continue;if(i&&i.length>0&&!i.includes(O.id)&&O.rect.current){D.set(O.id,O.rect.current);continue}let F=O.node.current,G=F?new So(d(F),F):null;if(O.rect.current=G,G)D.set(O.id,G)}return D}return B},[t,i,o,x,d]);return xe(()=>{g.current=t},[t]),xe(()=>{if(x)return;C()},[o,x]),xe(()=>{if(i&&i.length>0)l(null)},[JSON.stringify(i)]),xe(()=>{if(x||typeof c!=="number"||w.current!==null)return;w.current=setTimeout(()=>{C(),w.current=null},c)},[c,x,C,...a]),{droppableRects:P,measureDroppableContainers:C,measuringScheduled:i!=null};function z(){switch(u){case Bn.Always:return!1;case Bn.BeforeDragging:return o;default:return!o}}}function el(t,r){return vn((o)=>{if(!t)return null;if(o)return o;return typeof r==="function"?r(t):t},[r,t])}function Xp(t,r){return el(t,r)}function Up(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 Kp(t){return new So(Xr(t),t)}function Ii(t,r,o){if(r===void 0)r=Kp;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=Up({callback(d){if(!t)return;for(let u of d){let{type:g,target:x}=u;if(g==="childList"&&x instanceof HTMLElement&&x.contains(t)){i();break}}}}),c=To({callback:i});return Bt(()=>{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 Yp(t){let r=el(t);return ji(t,r)}var Ai=[];function qp(t){let r=Ee(t),o=vn((a)=>{if(!t)return Ai;if(a&&a!==Ai&&t&&r.current&&t.parentNode===r.current.parentNode)return a;return _n(t)},[t]);return xe(()=>{r.current=t},[t]),o}function Zp(t){let[r,o]=Xt(null),a=Ee(t),s=Kt((i)=>{let l=ba(i.target);if(!l)return;o((c)=>{if(!c)return null;return c.set(l,xa(l)),new Map(c)})},[]);return xe(()=>{let i=a.current;if(t!==i){l(i);let c=t.map((d)=>{let u=ba(d);if(u)return u.addEventListener("scroll",s,{passive:!0}),[u,xa(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=ba(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):Yi(t);return Yt},[t,r])}function Oi(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 Qp(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 em(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 tl(t){return Ne(()=>t?Pp(t):null,[t])}var Hi=[];function tm(t,r){if(r===void 0)r=Xr;let[o]=t,a=tl(o?ze(o):null),[s,i]=Xt(Hi);function l(){i(()=>{if(!t.length)return Hi;return t.map((d)=>Ui(d)?a:new So(r(d),d))})}let c=To({callback:l});return Bt(()=>{c==null||c.disconnect(),l(),t.forEach((d)=>c==null?void 0:c.observe(d))},[t]),s}function rm(t){if(!t)return null;if(t.children.length>1)return t;let r=t.children[0];return gn(r)?r:t}function nm(t){let{measure:r}=t,[o,a]=Xt(null),s=Kt((u)=>{for(let{target:g}of u)if(gn(g)){a((x)=>{let y=r(g);return x?{...x,width:y.width,height:y.height}:y});break}},[r]),i=To({callback:s}),l=Kt((u)=>{let g=rm(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 om=[{sensor:$n,options:{}},{sensor:zn,options:{}}],am={current:{}},No={draggable:{measure:ki},droppable:{measure:ki,strategy:Bn.WhileDragging,frequency:wa.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 sm={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},im={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Ro,draggableNodes:new Map,over:null,measureDroppableContainers:Ro},ko=Fn(im),rl=Fn(sm);function lm(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new xn}}}function cm(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 dm(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 x=wi(g);if(x){x.focus();break}}})}},[a,r,s,l,i]),null}function um(t,r){let{transform:o,...a}=r;return t!=null&&t.length?t.reduce((s,i)=>i({transform:s,...a}),o):o}function pm(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 mm(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;Bt(()=>{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),x=ji(g,a);if(!l)x.x=0;if(!c)x.y=0;if(i.current=!0,Math.abs(x.x)>0||Math.abs(x.y)>0){let y=Gi(u);if(y)y.scrollBy({top:x.y,left:x.x})}},[r,l,c,a,o])}var nl=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 ol=cp(function(r){var o,a,s,i;let{id:l,accessibility:c,autoScroll:d=!0,children:u,sensors:g=om,collisionDetection:x=xp,measuring:y,modifiers:C,...w}=r,P=dp(cm,void 0,lm),[z,B]=P,[D,O]=mp(),[F,G]=Xt(Br.Uninitialized),V=F===Br.Initialized,{draggable:{active:_,nodes:J,translate:Q},droppable:{containers:X}}=z,se=_!=null?J.get(_):null,ye=Ee({initial:null,translated:null}),ve=Ne(()=>{var Ie;return _!=null?{id:_,data:(Ie=se==null?void 0:se.data)!=null?Ie:am,rect:ye}:null},[_,se]),Re=Ee(null),[Me,Ae]=Xt(null),[be,qe]=Xt(null),he=bn(w,Object.values(w)),_e=jr("DndDescribedBy",l),K=Ne(()=>X.getEnabled(),[X]),ae=pm(y),{droppableRects:ee,measureDroppableContainers:Ce,measuringScheduled:st}=Wp(K,{dragging:V,dependencies:[Q.x,Q.y],config:ae.droppable}),Se=jp(J,_),Rr=Ne(()=>be?yo(be):null,[be]),U=sc(),it=Xp(Se,ae.draggable.measure);mm({activeNode:_!=null?J.get(_):null,config:U.layoutShiftCompensation,initialRect:it,measure:ae.draggable.measure});let le=Ii(Se,ae.draggable.measure,it),Cn=Ii(Se?Se.parentElement:null),Zt=Ee({activatorEvent:null,active:null,activeNode:Se,collisionRect:null,collisions:null,droppableRects:ee,draggableNodes:J,draggingNode:null,draggingNodeRect:null,droppableContainers:X,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Zr=X.getNodeFor((o=Zt.current.over)==null?void 0:o.id),lr=nm({measure:ae.dragOverlay.measure}),Qr=(a=lr.nodeRef.current)!=null?a:Se,en=V?(s=lr.rect)!=null?s:le:null,Oa=Boolean(lr.nodeRef.current&&lr.rect),Ha=Yp(Oa?null:le),Jo=tl(Qr?ze(Qr):null),Pr=qp(V?Zr!=null?Zr:Se:null),Xn=tm(Pr),Un=um(C,{transform:{x:Q.x-Ha.x,y:Q.y-Ha.y,scaleX:1,scaleY:1},activatorEvent:be,active:ve,activeNodeRect:le,containerNodeRect:Cn,draggingNodeRect:en,over:Zt.current.over,overlayNodeRect:lr.rect,scrollableAncestors:Pr,scrollableAncestorRects:Xn,windowRect:Jo}),Va=Rr?Gr(Rr,Q):null,Ba=Zp(Pr),Ql=Oi(Ba),ec=Oi(Ba,[le]),tn=Gr(Un,Ql),rn=en?Np(en,Un):null,Sn=ve&&rn?x({active:ve,collisionRect:rn,droppableRects:ee,droppableContainers:K,pointerCoordinates:Va}):null,Fa=Ra(Sn,"id"),[Tr,_a]=Xt(null),tc=Oa?Un:Gr(Un,ec),rc=yp(tc,(i=Tr==null?void 0:Tr.rect)!=null?i:null,le),jo=Ee(null),za=Kt((Ie,bt)=>{let{sensor:vt,options:kr}=bt;if(Re.current==null)return;let Lt=J.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(!J.get(Le))return;let{onDragAbort:er}=he.current,cr={id:Le};er==null||er(cr),D({type:"onDragAbort",event:cr})},onPending(Le,Lr,er,cr){if(!J.get(Le))return;let{onDragPending:Tn}=he.current,Dr={id:Le,constraint:Lr,initialCoordinates:er,offset:cr};Tn==null||Tn(Dr),D({type:"onDragPending",event:Dr})},onStart(Le){let Lr=Re.current;if(Lr==null)return;let er=J.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),G(Br.Initializing),B({type:we.DragStart,initialCoordinates:Le,active:Lr}),D({type:"onDragStart",event:Pn}),Ae(jo.current),qe(xt)})},onMove(Le){B({type:we.DragMove,coordinates:Le})},onEnd:nn(we.DragEnd),onCancel:nn(we.DragCancel)});jo.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}),G(Br.Uninitialized),_a(null),Ae(null),qe(null),jo.current=null;let kn=Le===we.DragEnd?"onDragEnd":"onDragCancel";if(Dr){let Go=he.current[kn];Go==null||Go(Dr),D({type:kn,event:Dr})}})}}},[J]),nc=Kt((Ie,bt)=>(vt,kr)=>{let Lt=vt.nativeEvent,xt=J.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,za(vt,bt)},[J,za]),$a=Gp(g,nc);Qp(g),Bt(()=>{if(le&&F===Br.Initializing)G(Br.Initialized)},[le,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),D({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(Fa),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),D({type:"onDragOver",event:Le})})},[Fa]),Bt(()=>{Zt.current={activatorEvent:be,active:ve,activeNode:Se,collisionRect:rn,collisions:Sn,droppableRects:ee,draggableNodes:J,draggingNode:Qr,draggingNodeRect:en,droppableContainers:X,over:Tr,scrollableAncestors:Pr,scrollAdjustedTranslate:tn},ye.current={initial:en,translated:rn}},[ve,Se,Sn,rn,J,Qr,en,ee,X,Tr,Pr,tn]),zp({...U,delta:Q,draggingRect:rn,pointerCoordinates:Va,scrollableAncestors:Pr,scrollableAncestorRects:Xn});let oc=Ne(()=>({active:ve,activeNode:Se,activeNodeRect:le,activatorEvent:be,collisions:Sn,containerNodeRect:Cn,dragOverlay:lr,draggableNodes:J,droppableContainers:X,droppableRects:ee,over:Tr,measureDroppableContainers:Ce,scrollableAncestors:Pr,scrollableAncestorRects:Xn,measuringConfiguration:ae,measuringScheduled:st,windowRect:Jo}),[ve,Se,le,be,Sn,Cn,lr,J,X,ee,Tr,Ce,Pr,Xn,ae,st,Jo]),ac=Ne(()=>({activatorEvent:be,activators:$a,active:ve,activeNodeRect:le,ariaDescribedById:{draggable:_e},dispatch:B,draggableNodes:J,over:Tr,measureDroppableContainers:Ce}),[be,$a,ve,le,B,_e,J,Tr,Ce]);return rr.createElement(Bi.Provider,{value:O},rr.createElement(ko.Provider,{value:ac},rr.createElement(rl.Provider,{value:oc},rr.createElement(nl.Provider,{value:rc},u)),rr.createElement(dm,{disabled:(c==null?void 0:c.restoreFocus)===!1})),rr.createElement(bp,{...c,hiddenTextDescribedById:_e}));function sc(){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}}}),fm=Fn(null),Vi="button",gm="Draggable";function al(t){let{id:r,data:o,disabled:a=!1,attributes:s}=t,i=jr(gm),{activators:l,activatorEvent:c,active:d,activeNodeRect:u,ariaDescribedById:g,draggableNodes:x,over:y}=yn(ko),{role:C=Vi,roleDescription:w="draggable",tabIndex:P=0}=s!=null?s:{},z=(d==null?void 0:d.id)===r,B=yn(z?nl:fm),[D,O]=On(),[F,G]=On(),V=em(l,r),_=bn(o);Bt(()=>(x.set(r,{id:r,key:i,node:D,activatorNode:F,data:_}),()=>{let Q=x.get(r);if(Q&&Q.key===i)x.delete(r)}),[x,r]);let J=Ne(()=>({role:C,tabIndex:P,"aria-disabled":a,"aria-pressed":z&&C===Vi?!0:void 0,"aria-roledescription":w,"aria-describedby":g.draggable}),[a,C,P,z,w,g.draggable]);return{active:d,activatorEvent:c,activeNodeRect:u,attributes:J,isDragging:z,listeners:a?void 0:V,node:D,over:y,setNodeRef:O,setActivatorNodeRef:G,transform:B}}function sl(){return yn(rl)}var bm="Droppable",vm={timeout:25};function il(t){let{data:r,disabled:o=!1,id:a,resizeObserverConfig:s}=t,i=jr(bm),{active:l,dispatch:c,over:d,measureDroppableContainers:u}=yn(ko),g=Ee({disabled:o}),x=Ee(!1),y=Ee(null),C=Ee(null),{disabled:w,updateMeasurementsFor:P,timeout:z}={...vm,...s},B=bn(P!=null?P:a),D=Kt(()=>{if(!x.current){x.current=!0;return}if(C.current!=null)clearTimeout(C.current);C.current=setTimeout(()=>{u(Array.isArray(B.current)?B.current:[B.current]),C.current=null},z)},[z]),O=To({callback:D,disabled:w||!l}),F=Kt((J,Q)=>{if(!O)return;if(Q)O.unobserve(Q),x.current=!1;if(J)O.observe(J)},[O]),[G,V]=On(F),_=bn(r);return xe(()=>{if(!O||!G.current)return;O.disconnect(),x.current=!1,O.observe(G.current)},[G,O]),xe(()=>(c({type:we.RegisterDroppable,element:{id:a,key:i,disabled:o,node:G,rect:y,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:y,isOver:(d==null?void 0:d.id)===a,node:G,over:d,setNodeRef:V}}import ll,{useMemo as Eo,useRef as Ca,useEffect as Mo,useState as hm,useContext as xm}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 ym(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 wm(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 Nm(t){if(typeof t==="boolean")return{draggable:t,droppable:t};return t}var cl=(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},dl=(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=Rm(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 Rm(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 ul="Sortable",pl=ll.createContext({activeIndex:-1,containerId:ul,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:cl,disabled:{draggable:!1,droppable:!1}});function ml(t){let{children:r,id:o,items:a,strategy:s=cl,disabled:i=!1}=t,{active:l,dragOverlay:c,droppableRects:d,over:u,measureDroppableContainers:g}=sl(),x=jr(ul,o),y=Boolean(c.rect!==null),C=Eo(()=>a.map((V)=>typeof V==="object"&&("id"in V)?V.id:V),[a]),w=l!=null,P=l?C.indexOf(l.id):-1,z=u?C.indexOf(u.id):-1,B=Ca(C),D=!wm(C,B.current),O=z!==-1&&P===-1||D,F=Nm(i);Bt(()=>{if(D&&w)g(C)},[D,C,w,g]),Mo(()=>{B.current=C},[C]);let G=Eo(()=>({activeIndex:P,containerId:x,disabled:F,disableTransforms:O,items:C,overIndex:z,useDragOverlay:y,sortedRects:ym(C,d),strategy:s}),[P,x,F.draggable,F.droppable,O,C,z,d,y,s]);return ll.createElement(pl.Provider,{value:G},r)}var Cm=(t)=>{let{id:r,items:o,activeIndex:a,overIndex:s}=t;return Ao(o,a,s).indexOf(r)},Sm=(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},Pm={duration:200,easing:"ease"},fl="transform",Tm=Vr.Transition.toString({property:fl,duration:0,easing:"linear"}),km={roleDescription:"sortable"};function Lm(t){let{disabled:r,index:o,node:a,rect:s}=t,[i,l]=hm(null),c=Ca(o);return Bt(()=>{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 gl(t){let{animateLayoutChanges:r=Sm,attributes:o,disabled:a,data:s,getNewIndex:i=Cm,id:l,strategy:c,resizeObserverConfig:d,transition:u=Pm}=t,{items:g,containerId:x,activeIndex:y,disabled:C,disableTransforms:w,sortedRects:P,overIndex:z,useDragOverlay:B,strategy:D}=xm(pl),O=Dm(a,C),F=g.indexOf(l),G=Eo(()=>({sortable:{containerId:x,index:F,items:g},...s}),[x,s,F,g]),V=Eo(()=>g.slice(g.indexOf(l)),[g,l]),{rect:_,node:J,isOver:Q,setNodeRef:X}=il({id:l,data:G,disabled:O.droppable,resizeObserverConfig:{updateMeasurementsFor:V,...d}}),{active:se,activatorEvent:ye,activeNodeRect:ve,attributes:Re,setNodeRef:Me,listeners:Ae,isDragging:be,over:qe,setActivatorNodeRef:he,transform:_e}=al({id:l,data:G,attributes:{...km,...o},disabled:O.draggable}),K=hi(X,Me),ae=Boolean(se),ee=ae&&!w&&Lo(y)&&Lo(z),Ce=!B&&be,st=Ce&&ee?_e:null,Se=c!=null?c:D,Rr=ee?st!=null?st:Se({rects:P,activeNodeRect:ve,activeIndex:y,overIndex:z,index:F}):null,U=Lo(y)&&Lo(z)?i({id:l,items:g,activeIndex:y,overIndex:z}):F,it=se==null?void 0:se.id,le=Ca({activeId:it,items:g,newIndex:U,containerId:x}),Cn=g!==le.current.items,Zt=r({active:se,containerId:x,isDragging:be,isSorting:ae,id:l,index:F,items:g,newIndex:le.current.newIndex,previousItems:le.current.items,previousContainerId:le.current.containerId,transition:u,wasDragging:le.current.activeId!=null}),Zr=Lm({disabled:!Zt,index:F,node:J,rect:_});return Mo(()=>{if(ae&&le.current.newIndex!==U)le.current.newIndex=U;if(x!==le.current.containerId)le.current.containerId=x;if(g!==le.current.items)le.current.items=g},[ae,U,x,g]),Mo(()=>{if(it===le.current.activeId)return;if(it!=null&&le.current.activeId==null){le.current.activeId=it;return}let Qr=setTimeout(()=>{le.current.activeId=it},50);return()=>clearTimeout(Qr)},[it]),{active:se,activeIndex:y,attributes:Re,data:G,rect:_,index:F,newIndex:U,items:g,isOver:Q,isSorting:ae,isDragging:be,listeners:Ae,node:J,overIndex:z,over:qe,setNodeRef:K,setActivatorNodeRef:he,setDroppableNodeRef:X,setDraggableNodeRef:Me,transform:Zr!=null?Zr:Rr,transition:lr()};function lr(){if(Zr||Cn&&le.current.newIndex===F)return Tm;if(Ce&&!Hn(ye)||!u)return;if(ae||Zt)return Vr.Transition.toString({...u,property:fl});return}}function Dm(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 Em=[q.Down,q.Right,q.Up,q.Left],bl=(t,r)=>{let{context:{active:o,collisionRect:a,droppableRects:s,droppableContainers:i,over:l,scrollableAncestors:c}}=r;if(Em.includes(t.code)){if(t.preventDefault(),!o||!a)return;let d=[];i.getEnabled().forEach((x)=>{if(!x||x!=null&&x.disabled)return;let y=s.get(x.id);if(!y)return;switch(t.code){case q.Down:if(a.top<y.top)d.push(x);break;case q.Up:if(a.top>y.top)d.push(x);break;case q.Left:if(a.left>y.left)d.push(x);break;case q.Right:if(a.left<y.left)d.push(x);break}});let u=Ji({active:o,collisionRect:a,droppableRects:s,droppableContainers:d,pointerCoordinates:null}),g=Ra(u,"id");if(g===(l==null?void 0:l.id)&&u.length>1)g=u[1].id;if(g!=null){let x=i.get(o.id),y=i.get(g),C=y?s.get(y.id):null,w=y==null?void 0:y.node.current;if(w&&C&&x&&y){let z=_n(w).some((V,_)=>c[_]!==V),B=vl(x,y),D=Mm(x,y),O=z||!B?{x:0,y:0}:{x:D?a.width-C.width:0,y:D?a.height-C.height:0},F={x:C.left,y:C.top};return O.x&&O.y?F:Wr(F,O)}}}return};function vl(t,r){if(!Io(t)||!Io(r))return!1;return t.data.current.sortable.containerId===r.data.current.sortable.containerId}function Mm(t,r){if(!Io(t)||!Io(r))return!1;if(!vl(t,r))return!1;return t.data.current.sortable.index<r.data.current.sortable.index}import{Fragment as Im}from"react";import{jsx as Fr,Fragment as Hm}from"react/jsx-runtime";var Am=({id:t,label:r,children:o})=>{let{attributes:a,listeners:s,setNodeRef:i,transform:l,transition:c,isDragging:d}=gl({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)})},Om=({items:t,onReorder:r,getItemLabel:o,renderItem:a,disabled:s=!1})=>{let i=Fi(Na($n,{activationConstraint:{distance:4}}),Na(zn,{coordinateGetter:bl})),l=(c)=>{let{active:d,over:u}=c;if(!u||d.id===u.id)return;let g=t.findIndex((y)=>y.id===d.id),x=t.findIndex((y)=>y.id===u.id);if(g===-1||x===-1)return;r(Ao(t,g,x))};if(s)return t.map((c)=>Fr(Im,{children:a(c,null)},c.id));return Fr(ol,{sensors:i,collisionDetection:$i,onDragEnd:l,children:Fr(ml,{items:t.map((c)=>c.id),strategy:dl,children:t.map((c)=>Fr(Am,{id:c.id,label:o?.(c),children:(d)=>Fr(Hm,{children:a(c,d)})},c.id))})})},Vm=Om;import*as hl from"react";import{jsx as Jn,jsxs as Sa}from"react/jsx-runtime";var xl=({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[x,y]=hl.useState(!1),C=async()=>{y(!0);try{if(await g()!==!1)r(!1)}catch(w){throw y(!1),w}y(!1)};return Jn(k,{open:t,onOpenChange:(w)=>{if(!(u&&x))r(w)},children:Sa(E,{children:[Sa(H,{children:[Jn(M,{children:o}),Jn(Z,{children:a})]}),d,Sa(ar,{children:[Jn(n,{variant:"outline",onClick:()=>{r(!1)},disabled:x,children:i}),Jn(n,{variant:l,onClick:()=>{C()},disabled:x,children:x?c:s})]})]})})};xl.displayName="ConfirmDialog";var Bm=xl;import*as wl from"react";import{jsx as Oo,jsxs as yl}from"react/jsx-runtime";var Nl=wl.forwardRef(function({step:r,total:o,title:a,helper:s,action:i,className:l,...c},d){let u=Boolean(i);return yl("div",{ref:d,className:e("flex flex-wrap items-start justify-between gap-4",l),...c,children:[yl("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]})});Nl.displayName="StageHeader";var Fm=Nl;import{jsx as _r,jsxs as Pa}from"react/jsx-runtime";var _m=p("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)"}}}),zm=p("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),Rl=({variant:t="tile",icon:r,label:o,value:a,detail:s,tone:i,className:l,...c})=>{if(t==="compact")return Pa(re,{className:e("gap-1 px-4 py-3.5",l),...c,children:[Pa("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(zm({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 Pa(re,{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(_m({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]})};Rl.displayName="StatTile";var $m=Rl;import*as Sl from"react";import{jsx as Cl,jsxs as Wm}from"react/jsx-runtime";var Jm={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)"},jm={danger:"danger",live:"primary",neutral:"neutral",success:"success",warning:"warning"},Gm=({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=Jm[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 Wm("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?Cl(qn,{tone:jm[t],pulse:t==="live"}):Cl("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]})},Pl=Sl.forwardRef(Gm);Pl.displayName="StatusPill";var Xm=Pl;import*as Bo from"react";import{jsx as Vo,jsxs as Ym}from"react/jsx-runtime";var Um=p("relative min-w-0",{defaultVariants:{size:"md",variant:"pill"},variants:{size:{md:"",sm:""},variant:{pill:"",plain:""}}}),Km=p("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)"}}}),Tl=({value:t,defaultValue:r,onValueChange:o,clearLabel:a,variant:s,size:i,className:l,classes:c,...d})=>{let[u,g]=Bo.useState(r??""),x=t!==void 0,y=x?t:u,C=Bo.useRef(null),w=(P)=>{if(!x)g(P);o?.(P)};return Ym("div",{className:e(Um({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:C,type:"search",value:y,onChange:(P)=>{w(P.target.value)},className:e(Km({size:i,variant:s}),y!==void 0&&y!==""&&a!==void 0?"pr-9":void 0,c?.input),...d}),y!==void 0&&y!==""&&a!==void 0?Vo("button",{type:"button","aria-label":a,onClick:()=>{w(""),C.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(S,{className:"h-3.5 w-3.5"})}):null]})};Tl.displayName="SearchField";var qm=Tl;import{jsx as Fo,jsxs as kl}from"react/jsx-runtime";var Ll=({title:t,description:r,value:o,options:a,onValueChange:s,align:i="center",className:l,...c})=>kl("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:[kl("div",{className:"min-w-0",children:[Fo("h3",{className:"truncate text-sm font-semibold",children:t}),r!==void 0&&r!==null&&r!==!1&&r!==""&&r!==0?Fo("p",{className:"mt-1 text-sm text-muted-foreground",children:r}):null]}),Fo("div",{className:"inline-flex shrink-0 rounded-md border border-border bg-background p-1 shadow-xs",children:a.map((d)=>Fo(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))})]});Ll.displayName="SectionSwitcher";import*as or from"react";import{jsx as qt}from"react/jsx-runtime";var Dl=or.createContext({value:1}),Ta=()=>or.useContext(Dl),Zm=({value:t,defaultValue:r=1,indicators:o,className:a,...s})=>{let i=t??r,l=or.useMemo(()=>({indicators:o,value:i}),[i,o]);return qt(Dl.Provider,{value:l,children:qt("div",{"data-slot":"stepper",className:e("space-y-8",a),...s})})},Qm=({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}),ka=or.createContext({state:"inactive",step:1}),ef=({step:t,loading:r,className:o,...a})=>{let{value:s}=Ta(),i="inactive";if(r===!0)i="loading";else if(t<s)i="completed";else if(t===s)i="active";let l=or.useMemo(()=>({state:i,step:t}),[i,t]);return qt(ka.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})})},tf=({className:t,...r})=>qt("div",{"data-slot":"stepper-trigger",className:e("flex flex-col items-center gap-2.5",t),...r}),rf=({className:t,children:r,...o})=>{let{indicators:a}=Ta(),{state:s}=or.useContext(ka),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})},nf=({className:t,...r})=>{let{state:o}=or.useContext(ka);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})},of=({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}),af=({className:t,...r})=>qt("div",{"data-slot":"stepper-panel",className:e(t),...r}),sf=({value:t,className:r,...o})=>{let{value:a}=Ta();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 uf}from"react/jsx-runtime";var La=Kr.createContext({}),lf=({className:t,size:r,variant:o,...a})=>{let s=Kr.useMemo(()=>({size:r,variant:o}),[r,o]);return Ur(La.Provider,{value:s,children:Ur("fieldset",{"data-slot":"split-button",className:e("inline-flex min-w-0 items-stretch",t),...a})})},cf=({className:t,...r})=>{let{size:o,variant:a}=Kr.useContext(La);return Ur(n,{"data-slot":"split-button-action",className:e("rounded-r-none",t),size:o,variant:a,...r})},df=({align:t="end",children:r,contentClassName:o,disabled:a,label:s,modal:i,onOpenChange:l,open:c})=>{let{size:d,variant:u}=Kr.useContext(La);return uf(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 _o}from"react/jsx-runtime";var pf=({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,x]=wn.useState(null),y=wn.useRef(null);wn.useEffect(()=>()=>{if(y.current!==null)window.clearTimeout(y.current)},[]);let C=(w)=>{if(navigator.clipboard.writeText(w.value),x(w.label),y.current!==null)window.clearTimeout(y.current);y.current=window.setTimeout(()=>{x(null)},1500),c?.(w)};return _o(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(yr,{className:"h-4 w-4"})})}),_o(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((w)=>_o("div",{className:e("min-w-0",u?.row),children:[sr("dt",{className:e("text-[11px] font-medium text-muted-foreground",u?.label),children:w.label}),_o("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:w.value}),w.copyable===!1?null:sr(n,{type:"button",variant:"ghost",size:"icon","aria-label":`${a} ${w.label}`,className:"h-6 w-6 shrink-0 text-muted-foreground hover:text-foreground",onClick:()=>{C(w)},children:g===w.label?sr(f,{className:"h-3.5 w-3.5"}):sr(te,{className:"h-3.5 w-3.5"})})]})]},w.label))})]})]})};var mf=pf;import*as Nn from"react";import{jsx as ke,jsxs as fr,Fragment as Ml}from"react/jsx-runtime";var ff={disabled:!1,emptyMessage:"No option found.",loading:!1,loadingMessage:"Loading options...",modal:!1,placeholder:"Select option...",searchPlaceholder:"Search...",width:"200px"},gf=1,bf=0.5,vf=(t)=>t.children!==void 0,Il=(t)=>t.flatMap((r)=>{if(!r.children)return[r];let o=Il(r.children);return o.length>0?[{...r,children:o}]:[]}),Al=(t,r=[])=>t.flatMap((o)=>o.children?Al(o.children,[...r,o]):[{ancestorIds:r.map((a)=>a.id),node:o,path:r.map((a)=>a.label).join(" / ")}]),El=(t)=>({paddingLeft:`${bf+t*gf}rem`}),Ol=Nn.forwardRef(function(r,o){let a={...ff,...r},{nodes:s,value:i,onChange:l,selectedLabel:c,placeholder:d,searchPlaceholder:u,emptyMessage:g,id:x,className:y,width:C,disabled:w,loading:P,loadingMessage:z,onSearchChange:B,modal:D}=a,[O,F]=Nn.useState(!1),[G,V]=Nn.useState(""),[_,J]=Nn.useState(()=>new Set),Q=Il(s),X=Al(Q),se=X.find((K)=>K.node.id===i),ye=G.trim().toLowerCase(),ve=(K)=>{if(K)J(new Set(se?.ancestorIds));else if(G!=="")V(""),B?.("");F(K)},Re=(K)=>{V(K),B?.(K)},Me=(K)=>{J((ae)=>{let ee=new Set(ae);if(!ee.delete(K))ee.add(K);return ee})},Ae=(K)=>{l(K),ve(!1)},be=(K)=>fr(Ml,{children:[ke(f,{"aria-hidden":!0,className:e(i===K.id?"opacity-100":"opacity-0")}),K.icon]}),qe=(K,ae)=>K.flatMap((ee)=>{if(!vf(ee))return[fr(A,{value:ee.id,style:El(ae),onSelect:()=>{Ae(ee.id)},children:[be(ee),ke("span",{className:"min-w-0 truncate",title:ee.label,children:ee.label})]},ee.id)];let Ce=_.has(ee.id),st=Ce?vr:xr;return[fr(A,{value:ee.id,"aria-expanded":Ce,style:El(ae),onSelect:()=>{Me(ee.id)},children:[ke(m,{"aria-hidden":!0,className:e(Ce&&"rotate-90")}),ee.icon??ke(st,{"aria-hidden":!0}),ke("span",{className:"min-w-0 truncate",title:ee.label,children:ee.label})]},ee.id),...Ce&&ee.children?qe(ee.children,ae+1):[]]}),he=ye===""?[]:X.filter((K)=>B!==void 0||`${K.path} / ${K.node.label}`.toLowerCase().includes(ye)),_e=se?.node.label??c;return fr(R,{modal:D,open:O,onOpenChange:ve,children:[ke(L,{asChild:!0,children:fr(n,{ref:o,id:x,variant:"outline","aria-expanded":O,"aria-busy":P,className:e("justify-between",y),style:{width:C},disabled:w,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}),P?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:fr(oe,{shouldFilter:!1,children:[ke(Ze,{"aria-label":u,placeholder:u,value:G,onValueChange:Re}),ke(me,{className:"max-h-[min(300px,calc(var(--radix-popover-content-available-height)-2.5rem))]",children:P?fr("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"}),z]}):fr(Ml,{children:[ke(Qe,{children:g}),ke(j,{children:ye===""?qe(Q,0):he.map((K)=>fr(A,{value:K.node.id,onSelect:()=>{Ae(K.node.id)},children:[be(K.node),ke("span",{className:"min-w-0 truncate",title:K.node.label,children:K.node.label}),K.path===""?null:ke("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))})]})})]})})]})});Ol.displayName="TreeSelect";import*as Vl from"react";import{jsx as Hl,jsxs as xf}from"react/jsx-runtime";var hf=({value:t,state:r="value",trailing:o,monospace:a=!0,className:s,...i},l)=>{let c=r==="secret";return xf("div",{ref:l,className:e("flex min-w-0 items-center gap-2",s),...i,children:[Hl("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:Hl("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]})},Bl=Vl.forwardRef(hf);Bl.displayName="ValueRow";var yf=Bl;import{forwardRef as Fl,useCallback as Yr,useLayoutEffect as _l,useId as wf,useRef as zl,useState as We}from"react";import{jsx as N,jsxs as W,Fragment as jn}from"react/jsx-runtime";var Nf=({mode:t,onModeChange:r,disabled:o})=>W("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:[N("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)]")}),W("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:[N(St,{className:"h-3 w-3"}),"Linked"]}),W("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:[N(ct,{className:"h-3 w-3"}),"Inline"]})]}),Rf=({variableKey:t,initialValue:r,isSecret:o,loading:a,saving:s,onSubmit:i,onCancel:l})=>{let[c,d]=We(r),[u,g]=We(!1),x=zl(null);return _l(()=>{if(!a)x.current?.focus()},[a]),W("form",{role:"presentation",onSubmit:(y)=>{y.preventDefault(),i(c)},onKeyDown:(y)=>{if(y.key==="Escape")y.preventDefault(),l()},className:"space-y-3 p-3",children:[W("div",{className:"flex items-start justify-between gap-2",children:[W("div",{className:"min-w-0",children:[N("p",{className:"text-[10px] font-medium uppercase tracking-[0.1em] text-muted-foreground",children:"Editing linked variable"}),N("p",{className:"mt-0.5 truncate font-mono text-xs text-foreground",children:t})]}),N("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:N(S,{className:"h-3.5 w-3.5"})})]}),W("div",{className:"space-y-1",children:[N(b,{htmlFor:"linked-value",className:"text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground",children:o?"Secret value":"Value"}),W("div",{className:"relative",children:[N(h,{ref:x,id:"linked-value",type:u?"text":"password",value:c,onChange:(y)=>{d(y.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}),N("button",{type:"button",onClick:()=>{g((y)=>!y)},"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?N(He,{className:"h-3.5 w-3.5"}):N(ce,{className:"h-3.5 w-3.5"})})]})]}),W("div",{className:"flex items-center justify-between gap-2 pt-1",children:[W("p",{className:"text-[10px] leading-relaxed text-muted-foreground",children:["Updates the linked secret. Other connectors using"," ",N("span",{className:"font-mono",children:t})," will pick it up on their next run."]}),N(n,{type:"submit",size:"sm",disabled:a||s,className:"h-7 px-3 text-xs",children:s?W(jn,{children:[N(T,{className:"h-3 w-3 animate-spin"}),"Saving"]}):"Save"})]})]})},Cf=({suggestedName:t,onSubmit:r,onCancel:o})=>{let[a,s]=We(t),[i,l]=We(""),[c,d]=We(!0),[u,g]=We(!1),x=zl(null);_l(()=>{x.current?.focus(),x.current?.select()},[]);let y=a.trim(),C=y.length>0;return W("form",{role:"presentation",onSubmit:(w)=>{if(w.preventDefault(),C)r({key:y,secret:c,value:i})},onClick:(w)=>{w.stopPropagation()},onKeyDown:(w)=>{if(w.key==="Escape")w.preventDefault(),w.stopPropagation(),o()},className:"flex flex-col",children:[W("div",{className:"flex items-center gap-2 border-b border-border/60 bg-muted/15 px-3 py-2",children:[N("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:N(dt,{className:"h-3.5 w-3.5"})}),N("span",{className:"flex-1 text-[10.5px] font-medium uppercase tracking-[0.12em] text-muted-foreground/80",children:"New variable"}),N(Ge,{className:"h-3 w-3 text-muted-foreground/60"})]}),W("div",{className:"space-y-2.5 px-3 py-2.5",children:[W("div",{className:"space-y-1",children:[N(b,{htmlFor:"var-key",className:"text-[10px] font-medium uppercase tracking-[0.1em] text-muted-foreground/70",children:"Name"}),W("div",{className:"relative",children:[N("span",{"aria-hidden":!0,className:"pointer-events-none absolute inset-y-0 left-2.5 flex items-center text-muted-foreground/60",children:N(lt,{className:"h-3 w-3"})}),N(h,{ref:x,id:"var-key",value:a,onChange:(w)=>{s(w.target.value.toUpperCase())},placeholder:"VARIABLE_NAME",className:"h-8 pl-7 font-mono text-[12.5px] tracking-tight",autoComplete:"off",spellCheck:!1})]})]}),W("div",{className:"space-y-1",children:[N(b,{htmlFor:"var-value",className:"text-[10px] font-medium uppercase tracking-[0.1em] text-muted-foreground/70",children:"Value"}),W("div",{className:"relative",children:[N(h,{id:"var-value",type:u?"text":"password",value:i,onChange:(w)=>{l(w.target.value)},placeholder:"Encrypted at rest",className:"h-8 pr-8 font-mono text-[12.5px]",autoComplete:"off",spellCheck:!1}),N("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/70 transition-colors hover:bg-muted hover:text-foreground",children:u?N(He,{className:"h-3.5 w-3.5"}):N(ce,{className:"h-3.5 w-3.5"})})]})]}),W("label",{className:"flex cursor-pointer items-center gap-2 select-none text-[11px] text-muted-foreground",children:[N("input",{type:"checkbox",checked:c,onChange:(w)=>{d(w.target.checked)},className:"h-3 w-3 accent-primary"}),W("span",{className:"flex items-center gap-1",children:[N(lt,{className:"h-3 w-3"}),"Mark as secret"]})]})]}),W("button",{type:"submit",disabled:!C,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:[N("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:N(f,{className:"h-3 w-3"})}),W("span",{className:"flex min-w-0 flex-1 flex-col",children:[N("span",{className:"text-[12px] font-medium leading-tight",children:"Create variable"}),N("span",{className:"truncate text-[10px] leading-tight text-muted-foreground",children:C?W(jn,{children:["Link this field to"," ",N("span",{className:"font-mono text-foreground/80",children:y})]}):"Enter a name to continue"})]}),N(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"})]})]})},$l=Fl(function({selected:r,value:o,placeholder:a,disabled:s,open:i,onOpen:l},c){let d=Boolean(o),u=Boolean(r);return W("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:[N("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:N(St,{className:"h-3 w-3"})}),d?W("span",{className:"flex min-w-0 flex-1 items-center gap-1.5",children:[N("span",{className:"truncate font-mono text-[12.5px] tracking-tight",children:o}),!u&&N("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"})]}):N("span",{className:"flex-1 truncate text-muted-foreground",children:a}),N(Fe,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground/60 transition-colors group-hover/trigger:text-muted-foreground"})]})});$l.displayName="LinkedTrigger";var Sf=({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 W("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:[N("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:N(ct,{className:"h-3 w-3"})}),N("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&&N("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?N(He,{className:"h-3.5 w-3.5"}):N(ce,{className:"h-3.5 w-3.5"})})]})},Pf=({options:t,value:r,onSelect:o})=>W("div",{className:"px-1",children:[W("div",{className:"flex items-center justify-between px-2 pt-2 pb-1",children:[N("span",{className:"text-[10px] font-medium uppercase tracking-[0.12em] text-muted-foreground/80",children:"Linked variables"}),N("span",{className:"text-[10px] tabular-nums text-muted-foreground/60",children:t.length})]}),N(j,{className:"!p-0 [&_[cmdk-group-heading]]:hidden",children:t.map((a)=>{let s=r===a.key;return W(A,{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&&N("span",{"aria-hidden":!0,className:"absolute inset-y-1.5 left-0 w-[2px] rounded-r bg-primary"}),N("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:N(lt,{className:"h-3 w-3"})}),W("div",{className:"flex min-w-0 flex-1 flex-col",children:[N("span",{className:e("truncate font-mono text-[12.5px] tracking-tight",s&&"text-primary"),children:a.key}),a.description!==void 0&&a.description!==""&&N("span",{className:"truncate text-[10.5px] leading-tight text-muted-foreground",children:a.description})]}),s?N(f,{className:"h-3.5 w-3.5 shrink-0 text-primary"}):N("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:N(Oe,{className:"h-3.5 w-3.5"})})]},a.key)})})]}),Tf=()=>W("div",{className:"space-y-1.5 px-2 py-3",children:[W("div",{className:"flex items-center justify-between px-1 pb-1",children:[N("span",{className:"text-[10px] font-medium uppercase tracking-[0.12em] text-muted-foreground/60",children:"Loading"}),N(T,{className:"h-3 w-3 animate-spin text-muted-foreground/60"})]}),[0.95,0.7,0.85].map((t,r)=>W("div",{className:"flex items-center gap-2 rounded-md px-2 py-1.5",style:{opacity:1-r*0.18},children:[N("div",{className:"h-5 w-5 shrink-0 animate-pulse rounded-sm bg-muted/70"}),N("div",{className:"h-3 animate-pulse rounded bg-muted/70",style:{width:`${t*100}%`}})]},r))]}),kf=({query:t,canCreate:r,onCreate:o})=>{let a=t.trim();return W("div",{className:"flex flex-col items-center gap-2 px-4 py-7 text-center",children:[N("span",{"aria-hidden":!0,className:"flex h-9 w-9 items-center justify-center rounded-full bg-muted/60 text-muted-foreground/70",children:N(lt,{className:"h-4 w-4"})}),W("div",{className:"space-y-0.5",children:[N("p",{className:"text-[12px] font-medium text-foreground",children:a?W(jn,{children:["No variables match"," ",W("span",{className:"font-mono text-foreground",children:['"',a,'"']})]}):"No variables yet"}),N("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&&W(n,{type:"button",size:"sm",variant:"outline",onClick:o,className:"mt-1 h-7 text-[11px]",children:[N(Ge,{className:"h-3 w-3"}),a?`Create "${a.toUpperCase().replaceAll(/[^A-Z0-9_]/gu,"_")}"`:"Create variable"]})]})},Lf=({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 N(Cf,{suggestedName:d??s.trim(),onSubmit:(y)=>{c(y)},onCancel:()=>{g(!1)}});let x=N(Pf,{options:t,value:a,onSelect:l});if(r)x=N(Tf,{});else if(t.length===0)x=N(kf,{query:s,canCreate:Boolean(c),onCreate:()=>{g(!0)}});return W("div",{className:"flex flex-col",children:[W("div",{className:"relative flex items-center gap-2 border-b border-border/60 bg-muted/15 px-3 py-2",children:[N(Be,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground/70"}),N("input",{autoFocus:!0,type:"text",value:s,onChange:(y)=>{i(y.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"}),W("div",{className:"flex h-4 w-4 items-center justify-center",children:[o&&!r&&N(T,{className:"h-3 w-3 animate-spin text-muted-foreground/70"}),!o&&s&&N("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:N(S,{className:"h-3 w-3"})})]})]}),N(oe,{shouldFilter:!1,className:"rounded-none bg-transparent",loop:!0,children:N(me,{className:"max-h-[280px] py-1",children:x})}),c&&W("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:[N("span",{className:"flex h-6 w-6 items-center justify-center rounded-md bg-primary/10 text-primary ring-1 ring-primary/15",children:N(Ge,{className:"h-3 w-3"})}),W("span",{className:"flex min-w-0 flex-1 flex-col",children:[N("span",{className:"text-[12px] font-medium leading-tight",children:"Create new variable"}),N("span",{className:"text-[10px] leading-tight text-muted-foreground",children:"Encrypted at rest · reusable across connectors"})]}),N(Oe,{className:"h-3.5 w-3.5 text-muted-foreground/60 transition-transform group-hover/cta:translate-x-0.5"})]})]})},Df=Fl(function({value:r,mode:o,onChange:a,onBlur:s,options:i,optionsLoading:l,optionsFetching:c,onSearch:d,onCreate:u,onResolve:g,onUpdate:x,suggestedName:y,placeholder:C="Select variable…",disabled:w=!1,masked:P=!0,className:z},B){let[D,O]=We(!1),[F,G]=We(""),[V,_]=We(!1),[J,Q]=We(!1),[X,se]=We(null),[ye,ve]=We(!1),[Re,Me]=We(!1),[Ae,be]=We(null),qe=wf(),he=Yr((U)=>{if(U===o)return;a("",U),_(!1),G("")},[o,a]),_e=Yr((U)=>{a(U===r?"":U,"linked"),O(!1),_(!1)},[r,a]),K=Yr((U)=>{a(U,"inline")},[a]),ae=Yr(async(U)=>{if(!u)return;let it=await u(U);_(!1),O(!1),a(it.key,"linked")},[u,a]),ee=Yr(async()=>{if(!r||!g)return;Q(!0),ve(!0),be(null);try{let U=await g(r);se(U??{key:r,secret:!0,value:null})}catch(U){be(U instanceof Error?U.message:"Failed to load variable"),se({key:r,secret:!0,value:null})}ve(!1)},[r,g]),Ce=Yr(async(U)=>{if(!x||!r)return;Me(!0);try{await x({key:r,value:U}),Q(!1)}catch(it){throw Me(!1),it}Me(!1)},[x,r]),st=Yr((U)=>{G(U),d?.(U)},[d]),Se=i.find((U)=>U.key===r),Rr=o==="linked"&&Boolean(r)&&Boolean(x);return W("div",{className:e("space-y-1.5",z),children:[W("div",{className:"flex items-center gap-1.5",children:[N("div",{className:"min-w-0 flex-1",children:o==="linked"?W(R,{open:D,onOpenChange:(U)=>{if(O(U),!U)_(!1),s?.()},modal:!0,children:[N(L,{asChild:!0,children:N($l,{ref:B,selected:Se,value:r,placeholder:C,disabled:w,open:D,onOpen:()=>{O(!0)}})}),N(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:N(Lf,{options:i,optionsLoading:Boolean(l),optionsFetching:Boolean(c),value:r,query:F,onQueryChange:st,onSelect:_e,onCreate:u?ae:void 0,suggestedName:y,showCreate:V,onShowCreate:_})})]}):N(Sf,{inputId:qe,value:r,onChange:K,onBlur:()=>s?.(),placeholder:C||"Enter value",disabled:w,masked:P})}),Rr&&W(R,{open:J,onOpenChange:(U)=>{if(Q(U),!U)se(null),be(null);else if(!X)ee()},modal:!0,children:[N(L,{asChild:!0,children:N(n,{type:"button",variant:"outline",size:"icon",disabled:w,"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:N(ct,{className:"h-3.5 w-3.5"})})}),W(I,{align:"end",side:"bottom",sideOffset:6,className:"w-80 p-0 shadow-lg",children:[Ae!==null&&Ae!==""&&N("div",{className:"border-b border-destructive/30 bg-destructive/5 px-3 py-2 text-[11px] text-destructive",children:Ae}),N(Rf,{variableKey:r,initialValue:X?.value??"",isSecret:X?.secret??!0,loading:ye,saving:Re,onSubmit:(U)=>{Ce(U)},onCancel:()=>{Q(!1)}},`${r}:${X?.value??""}`)]})]}),N(Nf,{mode:o,onModeChange:he,disabled:w})]}),N("p",{className:"flex items-center gap-1.5 text-[10.5px] leading-tight text-muted-foreground/80",children:o==="linked"?W(jn,{children:[N(St,{className:"h-3 w-3"}),N("span",{children:"Reads from an org variable. Rotate values in one place; every connector picks it up."})]}):W(jn,{children:[N(ct,{className:"h-3 w-3"}),W("span",{children:["Stored inline on this connector. Use"," ",N("span",{className:"font-medium text-foreground/80",children:"Linked"})," ","to share across connectors."]})]})})]})});import{useMemo as Ef}from"react";import{jsx as zo,jsxs as Da}from"react/jsx-runtime";var Mf=(t)=>{let r="",o=0,a=" ",s=t.replaceAll(/>\s*</gu,`>
|
|
6
|
+
`},gp={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 bp(t){let{announcements:r=gp,container:o,hiddenTextDescribedById:a,screenReaderInstructions:s=fp}=t,{announce:i,announcement:l}=Si(),c=jr("DndLiveRegion"),[d,u]=Xt(!1);if(xe(()=>{u(!0)},[]),pp(Ne(()=>({onDragStart(x){let{active:y}=x;i(r.onDragStart({active:y}))},onDragMove(x){let{active:y,over:P}=x;if(r.onDragMove)i(r.onDragMove({active:y,over:P}))},onDragOver(x){let{active:y,over:P}=x;i(r.onDragOver({active:y,over:P}))},onDragEnd(x){let{active:y,over:P}=x;i(r.onDragEnd({active:y,over:P}))},onDragCancel(x){let{active:y,over:P}=x;i(r.onDragCancel({active:y,over:P}))}}),[i,r])),!d)return null;let g=rr.createElement(rr.Fragment,null,rr.createElement(Ri,{id:a,value:s.draggable}),rr.createElement(Ci,{id:c,announcement:l}));return o?up(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 Na(t,r){return Ne(()=>({sensor:t,options:r!=null?r:{}}),[t,r])}function Fi(){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 zi(t,r){let{data:{value:o}}=t,{data:{value:a}}=r;return o-a}function vp(t,r){let{data:{value:o}}=t,{data:{value:a}}=r;return a-o}function Pi(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 Ra(t,r){if(!t||t.length===0)return null;let[o]=t;return r?o[r]:o}function Ti(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 $i=(t)=>{let{collisionRect:r,droppableRects:o,droppableContainers:a}=t,s=Ti(r,r.left,r.top),i=[];for(let l of a){let{id:c}=l,d=o.get(c);if(d){let u=_i(Ti(d),s);i.push({id:c,data:{droppableContainer:l,value:u}})}}return i.sort(zi)},Ji=(t)=>{let{collisionRect:r,droppableRects:o,droppableContainers:a}=t,s=Pi(r),i=[];for(let l of a){let{id:c}=l,d=o.get(c);if(d){let u=Pi(d),g=s.reduce((y,P,w)=>y+_i(u[w],P),0),x=Number((g/4).toFixed(4));i.push({id:c,data:{droppableContainer:l,value:x}})}}return i.sort(zi)};function hp(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,x=g/(d+u-g);return Number(x.toFixed(4))}return 0}var xp=(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=hp(c,r);if(d>0)s.push({id:l,data:{droppableContainer:i,value:d}})}}return s.sort(vp)};function yp(t,r,o){return{...t,scaleX:r&&o?r.width/o.width:1,scaleY:r&&o?r.height/o.height:1}}function ji(t,r){return t&&r?{x:t.left-r.left,y:t.top-r.top}:Yt}function wp(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 Np=wp(1);function Rp(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 Cp(t,r,o){let a=Rp(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,x=i?t.height/i:t.height;return{width:g,height:x,top:u,right:d+g,bottom:u+x,left:d}}var Sp={ignoreTransform:!1};function Xr(t,r){if(r===void 0)r=Sp;let o=t.getBoundingClientRect();if(r.ignoreTransform){let{transform:u,transformOrigin:g}=ze(t).getComputedStyle(t);if(u)o=Cp(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 ki(t){return Xr(t,{ignoreTransform:!0})}function Pp(t){let{innerWidth:r,innerHeight:o}=t;return{top:0,left:0,right:r,bottom:o,width:r,height:o}}function Tp(t,r){if(r===void 0)r=ze(t).getComputedStyle(t);return r.position==="fixed"}function kp(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)||ga(s))return o;if(o.includes(s))return o;let i=ze(t).getComputedStyle(s);if(s!==t){if(kp(s,i))o.push(s)}if(Tp(s,i))return o;return a(s.parentNode)}if(!t)return o;return a(t)}function Gi(t){let[r]=_n(t,1);return r!=null?r:null}function ba(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 Wi(t){if($r(t))return t.scrollX;return t.scrollLeft}function Xi(t){if($r(t))return t.scrollY;return t.scrollTop}function xa(t){return{x:Wi(t),y:Xi(t)}}var Te;(function(t){t[t.Forward=1]="Forward",t[t.Backward=-1]="Backward"})(Te||(Te={}));function Ui(t){if(!An||!t)return!1;return t===document.scrollingElement}function Ki(t){let r={x:0,y:0},o=Ui(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 Lp={x:0.2,y:0.2};function Dp(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=Lp;let{isTop:u,isBottom:g,isLeft:x,isRight:y}=Ki(t),P={x:0,y:0},w={x:0,y:0},D={height:r.height*s.y,width:r.width*s.x};if(!u&&i<=r.top+D.height)P.y=Te.Backward,w.y=a*Math.abs((r.top+D.height-i)/D.height);else if(!g&&d>=r.bottom-D.height)P.y=Te.Forward,w.y=a*Math.abs((r.bottom-D.height-d)/D.height);if(!y&&c>=r.right-D.width)P.x=Te.Forward,w.x=a*Math.abs((r.right-D.width-c)/D.width);else if(!x&&l<=r.left+D.width)P.x=Te.Backward,w.x=a*Math.abs((r.left+D.width-l)/D.width);return{direction:P,speed:w}}function Ep(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 Yi(t){return t.reduce((r,o)=>Gr(r,xa(o)),Yt)}function Mp(t){return t.reduce((r,o)=>r+Wi(o),0)}function Ip(t){return t.reduce((r,o)=>r+Xi(o),0)}function Ap(t,r){if(r===void 0)r=Xr;if(!t)return;let{top:o,left:a,bottom:s,right:i}=r(t);if(!Gi(t))return;if(s<=0||i<=0||o>=window.innerHeight||a>=window.innerWidth)t.scrollIntoView({block:"center",inline:"center"})}var Op=[["x",["left","right"],Mp],["y",["top","bottom"],Ip]];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=Yi(o);this.rect={...t},this.width=t.width,this.height=t.height;for(let[s,i,l]of Op)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 Hp(t){let{EventTarget:r}=ze(t);return t instanceof r?t:Jr(t)}function va(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 Li(t){t.preventDefault()}function Vp(t){t.stopPropagation()}var q;(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"})(q||(q={}));var qi={start:[q.Space,q.Enter],cancel:[q.Esc],end:[q.Space,q.Enter,q.Tab]},Bp=(t,r)=>{let{currentCoordinates:o}=r;switch(t.code){case q.Right:return{...o,x:o.x+25};case q.Left:return{...o,x:o.x-25};case q.Down:return{...o,y:o.y+25};case q.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)Ap(o);r(Yt)}handleKeyDown(t){if(Hn(t)){let{active:r,context:o,options:a}=this.props,{keyboardCodes:s=qi,coordinateGetter:i=Bp,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 x=Wr(g,u),y={x:0,y:0},{scrollableAncestors:P}=o.current;for(let w of P){let D=t.code,{isTop:z,isRight:B,isLeft:O,isBottom:H,maxScroll:F,minScroll:j}=Ki(w),V=Ep(w),_={x:Math.min(D===q.Right?V.right-V.width/2:V.right,Math.max(D===q.Right?V.left:V.left+V.width/2,g.x)),y:Math.min(D===q.Down?V.bottom-V.height/2:V.bottom,Math.max(D===q.Down?V.top:V.top+V.height/2,g.y))},J=D===q.Right&&!B||D===q.Left&&!O,Q=D===q.Down&&!H||D===q.Up&&!z;if(J&&_.x!==g.x){let X=w.scrollLeft+x.x,se=D===q.Right&&X<=F.x||D===q.Left&&X>=j.x;if(se&&!x.y){w.scrollTo({left:X,behavior:l});return}if(se)y.x=w.scrollLeft-X;else y.x=D===q.Right?w.scrollLeft-F.x:w.scrollLeft-j.x;if(y.x)w.scrollBy({left:-y.x,behavior:l});break}else if(Q&&_.y!==g.y){let X=w.scrollTop+x.y,se=D===q.Down&&X<=F.y||D===q.Up&&X>=j.y;if(se&&!x.x){w.scrollTo({top:X,behavior:l});return}if(se)y.y=w.scrollTop-X;else y.y=D===q.Down?w.scrollTop-F.y:w.scrollTop-j.y;if(y.y)w.scrollBy({top:-y.y,behavior:l});break}}this.handleMove(t,Gr(Wr(g,this.referenceCoordinates),y))}}}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 Di(t){return Boolean(t&&"distance"in t)}function Ei(t){return Boolean(t&&"delay"in t)}class Po{constructor(t,r,o){var a;if(o===void 0)o=Hp(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,Li),this.windowListeners.add(Jt.VisibilityChange,this.handleCancel),this.windowListeners.add(Jt.ContextMenu,Li),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(Ei(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(Di(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,Vp,{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(Di(l)){if(l.tolerance!=null&&va(d,l.tolerance))return this.handleCancel();if(va(d,l.distance))return this.handleStart()}if(Ei(l)){if(va(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===q.Esc)this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}var Fp={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,Fp,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 _p={move:{name:"mousemove"},end:{name:"mouseup"}},ya;(function(t){t[t.RightClick=2]="RightClick"})(ya||(ya={}));class Zi extends Po{constructor(t){super(t,_p,Jr(t.event.target))}}Zi.activators=[{eventName:"onMouseDown",handler:(t,r)=>{let{nativeEvent:o}=t,{onActivation:a}=r;if(o.button===ya.RightClick)return!1;return a==null||a({event:o}),!0}}];var ha={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Qi extends Po{constructor(t){super(t,ha)}static setup(){return window.addEventListener(ha.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(ha.move.name,t)};function t(){}}}Qi.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 zp(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:x,threshold:y}=t,P=Jp({delta:x,disabled:!i}),[w,D]=xi(),z=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 _=z.current.x*B.current.x,J=z.current.y*B.current.y;V.scrollBy(_,J)},[]),j=Ne(()=>c===Co.TreeOrder?[...u].reverse():u,[c,u]);xe(()=>{if(!i||!u.length||!O){D();return}for(let V of j){if((a==null?void 0:a(V))===!1)continue;let _=u.indexOf(V),J=g[_];if(!J)continue;let{direction:Q,speed:X}=Dp(V,J,O,r,y);for(let se of["x","y"])if(!P[se][Q[se]])X[se]=0,Q[se]=0;if(X.x>0||X.y>0){D(),H.current=V,w(F,l),z.current=X,B.current=Q;return}}z.current={x:0,y:0},B.current={x:0,y:0},D()},[r,F,a,D,i,l,JSON.stringify(O),JSON.stringify(P),w,u,j,g,JSON.stringify(y)])}var $p={x:{[Te.Backward]:!1,[Te.Forward]:!1},y:{[Te.Backward]:!1,[Te.Forward]:!1}};function Jp(t){let{delta:r,disabled:o}=t,a=xo(r);return vn((s)=>{if(o||!a||!s)return $p;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 jp(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 Gp(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 wa;(function(t){t.Optimized="optimized"})(wa||(wa={}));var Mi=new Map;function Wp(t,r){let{dragging:o,dependencies:a,config:s}=r,[i,l]=Xt(null),{frequency:c,measure:d,strategy:u}=s,g=Ee(t),x=z(),y=bn(x),P=Kt(function(B){if(B===void 0)B=[];if(y.current)return;l((O)=>{if(O===null)return B;return O.concat(B.filter((H)=>!O.includes(H)))})},[y]),w=Ee(null),D=vn((B)=>{if(x&&!o)return Mi;if(!B||B===Mi||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,j=F?new So(d(F),F):null;if(H.rect.current=j,j)O.set(H.id,j)}return O}return B},[t,i,o,x,d]);return xe(()=>{g.current=t},[t]),xe(()=>{if(x)return;P()},[o,x]),xe(()=>{if(i&&i.length>0)l(null)},[JSON.stringify(i)]),xe(()=>{if(x||typeof c!=="number"||w.current!==null)return;w.current=setTimeout(()=>{P(),w.current=null},c)},[c,x,P,...a]),{droppableRects:D,measureDroppableContainers:P,measuringScheduled:i!=null};function z(){switch(u){case Bn.Always:return!1;case Bn.BeforeDragging:return o;default:return!o}}}function el(t,r){return vn((o)=>{if(!t)return null;if(o)return o;return typeof r==="function"?r(t):t},[r,t])}function Xp(t,r){return el(t,r)}function Up(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 Kp(t){return new So(Xr(t),t)}function Ii(t,r,o){if(r===void 0)r=Kp;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=Up({callback(d){if(!t)return;for(let u of d){let{type:g,target:x}=u;if(g==="childList"&&x instanceof HTMLElement&&x.contains(t)){i();break}}}}),c=To({callback:i});return Bt(()=>{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 Yp(t){let r=el(t);return ji(t,r)}var Ai=[];function qp(t){let r=Ee(t),o=vn((a)=>{if(!t)return Ai;if(a&&a!==Ai&&t&&r.current&&t.parentNode===r.current.parentNode)return a;return _n(t)},[t]);return xe(()=>{r.current=t},[t]),o}function Zp(t){let[r,o]=Xt(null),a=Ee(t),s=Kt((i)=>{let l=ba(i.target);if(!l)return;o((c)=>{if(!c)return null;return c.set(l,xa(l)),new Map(c)})},[]);return xe(()=>{let i=a.current;if(t!==i){l(i);let c=t.map((d)=>{let u=ba(d);if(u)return u.addEventListener("scroll",s,{passive:!0}),[u,xa(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=ba(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):Yi(t);return Yt},[t,r])}function Oi(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 Qp(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 em(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 tl(t){return Ne(()=>t?Pp(t):null,[t])}var Hi=[];function tm(t,r){if(r===void 0)r=Xr;let[o]=t,a=tl(o?ze(o):null),[s,i]=Xt(Hi);function l(){i(()=>{if(!t.length)return Hi;return t.map((d)=>Ui(d)?a:new So(r(d),d))})}let c=To({callback:l});return Bt(()=>{c==null||c.disconnect(),l(),t.forEach((d)=>c==null?void 0:c.observe(d))},[t]),s}function rm(t){if(!t)return null;if(t.children.length>1)return t;let r=t.children[0];return gn(r)?r:t}function nm(t){let{measure:r}=t,[o,a]=Xt(null),s=Kt((u)=>{for(let{target:g}of u)if(gn(g)){a((x)=>{let y=r(g);return x?{...x,width:y.width,height:y.height}:y});break}},[r]),i=To({callback:s}),l=Kt((u)=>{let g=rm(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 om=[{sensor:$n,options:{}},{sensor:zn,options:{}}],am={current:{}},No={draggable:{measure:ki},droppable:{measure:ki,strategy:Bn.WhileDragging,frequency:wa.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 sm={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},im={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Ro,draggableNodes:new Map,over:null,measureDroppableContainers:Ro},ko=Fn(im),rl=Fn(sm);function lm(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new xn}}}function cm(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 dm(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 x=wi(g);if(x){x.focus();break}}})}},[a,r,s,l,i]),null}function um(t,r){let{transform:o,...a}=r;return t!=null&&t.length?t.reduce((s,i)=>i({transform:s,...a}),o):o}function pm(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 mm(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;Bt(()=>{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),x=ji(g,a);if(!l)x.x=0;if(!c)x.y=0;if(i.current=!0,Math.abs(x.x)>0||Math.abs(x.y)>0){let y=Gi(u);if(y)y.scrollBy({top:x.y,left:x.x})}},[r,l,c,a,o])}var nl=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 ol=cp(function(r){var o,a,s,i;let{id:l,accessibility:c,autoScroll:d=!0,children:u,sensors:g=om,collisionDetection:x=xp,measuring:y,modifiers:P,...w}=r,D=dp(cm,void 0,lm),[z,B]=D,[O,H]=mp(),[F,j]=Xt(Br.Uninitialized),V=F===Br.Initialized,{draggable:{active:_,nodes:J,translate:Q},droppable:{containers:X}}=z,se=_!=null?J.get(_):null,ye=Ee({initial:null,translated:null}),ve=Ne(()=>{var Ie;return _!=null?{id:_,data:(Ie=se==null?void 0:se.data)!=null?Ie:am,rect:ye}:null},[_,se]),Re=Ee(null),[Me,Ae]=Xt(null),[be,qe]=Xt(null),he=bn(w,Object.values(w)),_e=jr("DndDescribedBy",l),K=Ne(()=>X.getEnabled(),[X]),ae=pm(y),{droppableRects:ee,measureDroppableContainers:Ce,measuringScheduled:st}=Wp(K,{dragging:V,dependencies:[Q.x,Q.y],config:ae.droppable}),Se=jp(J,_),Rr=Ne(()=>be?yo(be):null,[be]),U=sc(),it=Xp(Se,ae.draggable.measure);mm({activeNode:_!=null?J.get(_):null,config:U.layoutShiftCompensation,initialRect:it,measure:ae.draggable.measure});let le=Ii(Se,ae.draggable.measure,it),Cn=Ii(Se?Se.parentElement:null),Zt=Ee({activatorEvent:null,active:null,activeNode:Se,collisionRect:null,collisions:null,droppableRects:ee,draggableNodes:J,draggingNode:null,draggingNodeRect:null,droppableContainers:X,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Zr=X.getNodeFor((o=Zt.current.over)==null?void 0:o.id),lr=nm({measure:ae.dragOverlay.measure}),Qr=(a=lr.nodeRef.current)!=null?a:Se,en=V?(s=lr.rect)!=null?s:le:null,Oa=Boolean(lr.nodeRef.current&&lr.rect),Ha=Yp(Oa?null:le),Jo=tl(Qr?ze(Qr):null),Pr=qp(V?Zr!=null?Zr:Se:null),Xn=tm(Pr),Un=um(P,{transform:{x:Q.x-Ha.x,y:Q.y-Ha.y,scaleX:1,scaleY:1},activatorEvent:be,active:ve,activeNodeRect:le,containerNodeRect:Cn,draggingNodeRect:en,over:Zt.current.over,overlayNodeRect:lr.rect,scrollableAncestors:Pr,scrollableAncestorRects:Xn,windowRect:Jo}),Va=Rr?Gr(Rr,Q):null,Ba=Zp(Pr),Ql=Oi(Ba),ec=Oi(Ba,[le]),tn=Gr(Un,Ql),rn=en?Np(en,Un):null,Sn=ve&&rn?x({active:ve,collisionRect:rn,droppableRects:ee,droppableContainers:K,pointerCoordinates:Va}):null,Fa=Ra(Sn,"id"),[Tr,_a]=Xt(null),tc=Oa?Un:Gr(Un,ec),rc=yp(tc,(i=Tr==null?void 0:Tr.rect)!=null?i:null,le),jo=Ee(null),za=Kt((Ie,bt)=>{let{sensor:vt,options:kr}=bt;if(Re.current==null)return;let Lt=J.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(!J.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(!J.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=J.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),j(Br.Initializing),B({type:we.DragStart,initialCoordinates:Le,active:Lr}),O({type:"onDragStart",event:Pn}),Ae(jo.current),qe(xt)})},onMove(Le){B({type:we.DragMove,coordinates:Le})},onEnd:nn(we.DragEnd),onCancel:nn(we.DragCancel)});jo.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}),j(Br.Uninitialized),_a(null),Ae(null),qe(null),jo.current=null;let kn=Le===we.DragEnd?"onDragEnd":"onDragCancel";if(Dr){let Go=he.current[kn];Go==null||Go(Dr),O({type:kn,event:Dr})}})}}},[J]),nc=Kt((Ie,bt)=>(vt,kr)=>{let Lt=vt.nativeEvent,xt=J.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,za(vt,bt)},[J,za]),$a=Gp(g,nc);Qp(g),Bt(()=>{if(le&&F===Br.Initializing)j(Br.Initialized)},[le,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(Fa),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})})},[Fa]),Bt(()=>{Zt.current={activatorEvent:be,active:ve,activeNode:Se,collisionRect:rn,collisions:Sn,droppableRects:ee,draggableNodes:J,draggingNode:Qr,draggingNodeRect:en,droppableContainers:X,over:Tr,scrollableAncestors:Pr,scrollAdjustedTranslate:tn},ye.current={initial:en,translated:rn}},[ve,Se,Sn,rn,J,Qr,en,ee,X,Tr,Pr,tn]),zp({...U,delta:Q,draggingRect:rn,pointerCoordinates:Va,scrollableAncestors:Pr,scrollableAncestorRects:Xn});let oc=Ne(()=>({active:ve,activeNode:Se,activeNodeRect:le,activatorEvent:be,collisions:Sn,containerNodeRect:Cn,dragOverlay:lr,draggableNodes:J,droppableContainers:X,droppableRects:ee,over:Tr,measureDroppableContainers:Ce,scrollableAncestors:Pr,scrollableAncestorRects:Xn,measuringConfiguration:ae,measuringScheduled:st,windowRect:Jo}),[ve,Se,le,be,Sn,Cn,lr,J,X,ee,Tr,Ce,Pr,Xn,ae,st,Jo]),ac=Ne(()=>({activatorEvent:be,activators:$a,active:ve,activeNodeRect:le,ariaDescribedById:{draggable:_e},dispatch:B,draggableNodes:J,over:Tr,measureDroppableContainers:Ce}),[be,$a,ve,le,B,_e,J,Tr,Ce]);return rr.createElement(Bi.Provider,{value:H},rr.createElement(ko.Provider,{value:ac},rr.createElement(rl.Provider,{value:oc},rr.createElement(nl.Provider,{value:rc},u)),rr.createElement(dm,{disabled:(c==null?void 0:c.restoreFocus)===!1})),rr.createElement(bp,{...c,hiddenTextDescribedById:_e}));function sc(){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}}}),fm=Fn(null),Vi="button",gm="Draggable";function al(t){let{id:r,data:o,disabled:a=!1,attributes:s}=t,i=jr(gm),{activators:l,activatorEvent:c,active:d,activeNodeRect:u,ariaDescribedById:g,draggableNodes:x,over:y}=yn(ko),{role:P=Vi,roleDescription:w="draggable",tabIndex:D=0}=s!=null?s:{},z=(d==null?void 0:d.id)===r,B=yn(z?nl:fm),[O,H]=On(),[F,j]=On(),V=em(l,r),_=bn(o);Bt(()=>(x.set(r,{id:r,key:i,node:O,activatorNode:F,data:_}),()=>{let Q=x.get(r);if(Q&&Q.key===i)x.delete(r)}),[x,r]);let J=Ne(()=>({role:P,tabIndex:D,"aria-disabled":a,"aria-pressed":z&&P===Vi?!0:void 0,"aria-roledescription":w,"aria-describedby":g.draggable}),[a,P,D,z,w,g.draggable]);return{active:d,activatorEvent:c,activeNodeRect:u,attributes:J,isDragging:z,listeners:a?void 0:V,node:O,over:y,setNodeRef:H,setActivatorNodeRef:j,transform:B}}function sl(){return yn(rl)}var bm="Droppable",vm={timeout:25};function il(t){let{data:r,disabled:o=!1,id:a,resizeObserverConfig:s}=t,i=jr(bm),{active:l,dispatch:c,over:d,measureDroppableContainers:u}=yn(ko),g=Ee({disabled:o}),x=Ee(!1),y=Ee(null),P=Ee(null),{disabled:w,updateMeasurementsFor:D,timeout:z}={...vm,...s},B=bn(D!=null?D:a),O=Kt(()=>{if(!x.current){x.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},z)},[z]),H=To({callback:O,disabled:w||!l}),F=Kt((J,Q)=>{if(!H)return;if(Q)H.unobserve(Q),x.current=!1;if(J)H.observe(J)},[H]),[j,V]=On(F),_=bn(r);return xe(()=>{if(!H||!j.current)return;H.disconnect(),x.current=!1,H.observe(j.current)},[j,H]),xe(()=>(c({type:we.RegisterDroppable,element:{id:a,key:i,disabled:o,node:j,rect:y,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:y,isOver:(d==null?void 0:d.id)===a,node:j,over:d,setNodeRef:V}}import ll,{useMemo as Eo,useRef as Ca,useEffect as Mo,useState as hm,useContext as xm}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 ym(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 wm(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 Nm(t){if(typeof t==="boolean")return{draggable:t,droppable:t};return t}var cl=(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},dl=(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=Rm(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 Rm(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 ul="Sortable",pl=ll.createContext({activeIndex:-1,containerId:ul,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:cl,disabled:{draggable:!1,droppable:!1}});function ml(t){let{children:r,id:o,items:a,strategy:s=cl,disabled:i=!1}=t,{active:l,dragOverlay:c,droppableRects:d,over:u,measureDroppableContainers:g}=sl(),x=jr(ul,o),y=Boolean(c.rect!==null),P=Eo(()=>a.map((V)=>typeof V==="object"&&("id"in V)?V.id:V),[a]),w=l!=null,D=l?P.indexOf(l.id):-1,z=u?P.indexOf(u.id):-1,B=Ca(P),O=!wm(P,B.current),H=z!==-1&&D===-1||O,F=Nm(i);Bt(()=>{if(O&&w)g(P)},[O,P,w,g]),Mo(()=>{B.current=P},[P]);let j=Eo(()=>({activeIndex:D,containerId:x,disabled:F,disableTransforms:H,items:P,overIndex:z,useDragOverlay:y,sortedRects:ym(P,d),strategy:s}),[D,x,F.draggable,F.droppable,H,P,z,d,y,s]);return ll.createElement(pl.Provider,{value:j},r)}var Cm=(t)=>{let{id:r,items:o,activeIndex:a,overIndex:s}=t;return Ao(o,a,s).indexOf(r)},Sm=(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},Pm={duration:200,easing:"ease"},fl="transform",Tm=Vr.Transition.toString({property:fl,duration:0,easing:"linear"}),km={roleDescription:"sortable"};function Lm(t){let{disabled:r,index:o,node:a,rect:s}=t,[i,l]=hm(null),c=Ca(o);return Bt(()=>{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 gl(t){let{animateLayoutChanges:r=Sm,attributes:o,disabled:a,data:s,getNewIndex:i=Cm,id:l,strategy:c,resizeObserverConfig:d,transition:u=Pm}=t,{items:g,containerId:x,activeIndex:y,disabled:P,disableTransforms:w,sortedRects:D,overIndex:z,useDragOverlay:B,strategy:O}=xm(pl),H=Dm(a,P),F=g.indexOf(l),j=Eo(()=>({sortable:{containerId:x,index:F,items:g},...s}),[x,s,F,g]),V=Eo(()=>g.slice(g.indexOf(l)),[g,l]),{rect:_,node:J,isOver:Q,setNodeRef:X}=il({id:l,data:j,disabled:H.droppable,resizeObserverConfig:{updateMeasurementsFor:V,...d}}),{active:se,activatorEvent:ye,activeNodeRect:ve,attributes:Re,setNodeRef:Me,listeners:Ae,isDragging:be,over:qe,setActivatorNodeRef:he,transform:_e}=al({id:l,data:j,attributes:{...km,...o},disabled:H.draggable}),K=hi(X,Me),ae=Boolean(se),ee=ae&&!w&&Lo(y)&&Lo(z),Ce=!B&&be,st=Ce&&ee?_e:null,Se=c!=null?c:O,Rr=ee?st!=null?st:Se({rects:D,activeNodeRect:ve,activeIndex:y,overIndex:z,index:F}):null,U=Lo(y)&&Lo(z)?i({id:l,items:g,activeIndex:y,overIndex:z}):F,it=se==null?void 0:se.id,le=Ca({activeId:it,items:g,newIndex:U,containerId:x}),Cn=g!==le.current.items,Zt=r({active:se,containerId:x,isDragging:be,isSorting:ae,id:l,index:F,items:g,newIndex:le.current.newIndex,previousItems:le.current.items,previousContainerId:le.current.containerId,transition:u,wasDragging:le.current.activeId!=null}),Zr=Lm({disabled:!Zt,index:F,node:J,rect:_});return Mo(()=>{if(ae&&le.current.newIndex!==U)le.current.newIndex=U;if(x!==le.current.containerId)le.current.containerId=x;if(g!==le.current.items)le.current.items=g},[ae,U,x,g]),Mo(()=>{if(it===le.current.activeId)return;if(it!=null&&le.current.activeId==null){le.current.activeId=it;return}let Qr=setTimeout(()=>{le.current.activeId=it},50);return()=>clearTimeout(Qr)},[it]),{active:se,activeIndex:y,attributes:Re,data:j,rect:_,index:F,newIndex:U,items:g,isOver:Q,isSorting:ae,isDragging:be,listeners:Ae,node:J,overIndex:z,over:qe,setNodeRef:K,setActivatorNodeRef:he,setDroppableNodeRef:X,setDraggableNodeRef:Me,transform:Zr!=null?Zr:Rr,transition:lr()};function lr(){if(Zr||Cn&&le.current.newIndex===F)return Tm;if(Ce&&!Hn(ye)||!u)return;if(ae||Zt)return Vr.Transition.toString({...u,property:fl});return}}function Dm(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 Em=[q.Down,q.Right,q.Up,q.Left],bl=(t,r)=>{let{context:{active:o,collisionRect:a,droppableRects:s,droppableContainers:i,over:l,scrollableAncestors:c}}=r;if(Em.includes(t.code)){if(t.preventDefault(),!o||!a)return;let d=[];i.getEnabled().forEach((x)=>{if(!x||x!=null&&x.disabled)return;let y=s.get(x.id);if(!y)return;switch(t.code){case q.Down:if(a.top<y.top)d.push(x);break;case q.Up:if(a.top>y.top)d.push(x);break;case q.Left:if(a.left>y.left)d.push(x);break;case q.Right:if(a.left<y.left)d.push(x);break}});let u=Ji({active:o,collisionRect:a,droppableRects:s,droppableContainers:d,pointerCoordinates:null}),g=Ra(u,"id");if(g===(l==null?void 0:l.id)&&u.length>1)g=u[1].id;if(g!=null){let x=i.get(o.id),y=i.get(g),P=y?s.get(y.id):null,w=y==null?void 0:y.node.current;if(w&&P&&x&&y){let z=_n(w).some((V,_)=>c[_]!==V),B=vl(x,y),O=Mm(x,y),H=z||!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 vl(t,r){if(!Io(t)||!Io(r))return!1;return t.data.current.sortable.containerId===r.data.current.sortable.containerId}function Mm(t,r){if(!Io(t)||!Io(r))return!1;if(!vl(t,r))return!1;return t.data.current.sortable.index<r.data.current.sortable.index}import{Fragment as Im}from"react";import{jsx as Fr,Fragment as Hm}from"react/jsx-runtime";var Am=({id:t,label:r,children:o})=>{let{attributes:a,listeners:s,setNodeRef:i,transform:l,transition:c,isDragging:d}=gl({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)})},Om=({items:t,onReorder:r,getItemLabel:o,renderItem:a,disabled:s=!1})=>{let i=Fi(Na($n,{activationConstraint:{distance:4}}),Na(zn,{coordinateGetter:bl})),l=(c)=>{let{active:d,over:u}=c;if(!u||d.id===u.id)return;let g=t.findIndex((y)=>y.id===d.id),x=t.findIndex((y)=>y.id===u.id);if(g===-1||x===-1)return;r(Ao(t,g,x))};if(s)return t.map((c)=>Fr(Im,{children:a(c,null)},c.id));return Fr(ol,{sensors:i,collisionDetection:$i,onDragEnd:l,children:Fr(ml,{items:t.map((c)=>c.id),strategy:dl,children:t.map((c)=>Fr(Am,{id:c.id,label:o?.(c),children:(d)=>Fr(Hm,{children:a(c,d)})},c.id))})})},Vm=Om;import*as hl from"react";import{jsx as Jn,jsxs as Sa}from"react/jsx-runtime";var xl=({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[x,y]=hl.useState(!1),P=async()=>{y(!0);try{if(await g()!==!1)r(!1)}catch(w){throw y(!1),w}y(!1)};return Jn(k,{open:t,onOpenChange:(w)=>{if(!(u&&x))r(w)},children:Sa(E,{children:[Sa(G,{children:[Jn(M,{children:o}),Jn(Z,{children:a})]}),d,Sa(ar,{children:[Jn(n,{variant:"outline",onClick:()=>{r(!1)},disabled:x,children:i}),Jn(n,{variant:l,onClick:()=>{P()},disabled:x,children:x?c:s})]})]})})};xl.displayName="ConfirmDialog";var Bm=xl;import*as wl from"react";import{jsx as Oo,jsxs as yl}from"react/jsx-runtime";var Nl=wl.forwardRef(function({step:r,total:o,title:a,helper:s,action:i,className:l,...c},d){let u=Boolean(i);return yl("div",{ref:d,className:e("flex flex-wrap items-start justify-between gap-4",l),...c,children:[yl("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]})});Nl.displayName="StageHeader";var Fm=Nl;import{jsx as _r,jsxs as Pa}from"react/jsx-runtime";var _m=p("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)"}}}),zm=p("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),Rl=({variant:t="tile",icon:r,label:o,value:a,detail:s,tone:i,className:l,...c})=>{if(t==="compact")return Pa(re,{className:e("gap-1 px-4 py-3.5",l),...c,children:[Pa("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(zm({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 Pa(re,{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(_m({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]})};Rl.displayName="StatTile";var $m=Rl;import*as Sl from"react";import{jsx as Cl,jsxs as Wm}from"react/jsx-runtime";var Jm={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)"},jm={danger:"danger",live:"primary",neutral:"neutral",success:"success",warning:"warning"},Gm=({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=Jm[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 Wm("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?Cl(qn,{tone:jm[t],pulse:t==="live"}):Cl("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]})},Pl=Sl.forwardRef(Gm);Pl.displayName="StatusPill";var Xm=Pl;import*as Bo from"react";import{jsx as Vo,jsxs as Ym}from"react/jsx-runtime";var Um=p("relative min-w-0",{defaultVariants:{size:"md",variant:"pill"},variants:{size:{md:"",sm:""},variant:{pill:"",plain:""}}}),Km=p("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)"}}}),Tl=({value:t,defaultValue:r,onValueChange:o,clearLabel:a,variant:s,size:i,className:l,classes:c,...d})=>{let[u,g]=Bo.useState(r??""),x=t!==void 0,y=x?t:u,P=Bo.useRef(null),w=(D)=>{if(!x)g(D);o?.(D)};return Ym("div",{className:e(Um({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:y,onChange:(D)=>{w(D.target.value)},className:e(Km({size:i,variant:s}),y!==void 0&&y!==""&&a!==void 0?"pr-9":void 0,c?.input),...d}),y!==void 0&&y!==""&&a!==void 0?Vo("button",{type:"button","aria-label":a,onClick:()=>{w(""),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(S,{className:"h-3.5 w-3.5"})}):null]})};Tl.displayName="SearchField";var qm=Tl;import{jsx as Fo,jsxs as kl}from"react/jsx-runtime";var Ll=({title:t,description:r,value:o,options:a,onValueChange:s,align:i="center",className:l,...c})=>kl("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:[kl("div",{className:"min-w-0",children:[Fo("h3",{className:"truncate text-sm font-semibold",children:t}),r!==void 0&&r!==null&&r!==!1&&r!==""&&r!==0?Fo("p",{className:"mt-1 text-sm text-muted-foreground",children:r}):null]}),Fo("div",{className:"inline-flex shrink-0 rounded-md border border-border bg-background p-1 shadow-xs",children:a.map((d)=>Fo(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))})]});Ll.displayName="SectionSwitcher";import*as or from"react";import{jsx as qt}from"react/jsx-runtime";var Dl=or.createContext({value:1}),Ta=()=>or.useContext(Dl),Zm=({value:t,defaultValue:r=1,indicators:o,className:a,...s})=>{let i=t??r,l=or.useMemo(()=>({indicators:o,value:i}),[i,o]);return qt(Dl.Provider,{value:l,children:qt("div",{"data-slot":"stepper",className:e("space-y-8",a),...s})})},Qm=({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}),ka=or.createContext({state:"inactive",step:1}),ef=({step:t,loading:r,className:o,...a})=>{let{value:s}=Ta(),i="inactive";if(r===!0)i="loading";else if(t<s)i="completed";else if(t===s)i="active";let l=or.useMemo(()=>({state:i,step:t}),[i,t]);return qt(ka.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})})},tf=({className:t,...r})=>qt("div",{"data-slot":"stepper-trigger",className:e("flex flex-col items-center gap-2.5",t),...r}),rf=({className:t,children:r,...o})=>{let{indicators:a}=Ta(),{state:s}=or.useContext(ka),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})},nf=({className:t,...r})=>{let{state:o}=or.useContext(ka);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})},of=({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}),af=({className:t,...r})=>qt("div",{"data-slot":"stepper-panel",className:e(t),...r}),sf=({value:t,className:r,...o})=>{let{value:a}=Ta();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 uf}from"react/jsx-runtime";var La=Kr.createContext({}),lf=({className:t,size:r,variant:o,...a})=>{let s=Kr.useMemo(()=>({size:r,variant:o}),[r,o]);return Ur(La.Provider,{value:s,children:Ur("fieldset",{"data-slot":"split-button",className:e("inline-flex min-w-0 items-stretch",t),...a})})},cf=({className:t,...r})=>{let{size:o,variant:a}=Kr.useContext(La);return Ur(n,{"data-slot":"split-button-action",className:e("rounded-r-none",t),size:o,variant:a,...r})},df=({align:t="end",children:r,contentClassName:o,disabled:a,label:s,modal:i,onOpenChange:l,open:c})=>{let{size:d,variant:u}=Kr.useContext(La);return uf(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 _o}from"react/jsx-runtime";var pf=({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,x]=wn.useState(null),y=wn.useRef(null);wn.useEffect(()=>()=>{if(y.current!==null)window.clearTimeout(y.current)},[]);let P=(w)=>{if(navigator.clipboard.writeText(w.value),x(w.label),y.current!==null)window.clearTimeout(y.current);y.current=window.setTimeout(()=>{x(null)},1500),c?.(w)};return _o(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(yr,{className:"h-4 w-4"})})}),_o(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((w)=>_o("div",{className:e("min-w-0",u?.row),children:[sr("dt",{className:e("text-[11px] font-medium text-muted-foreground",u?.label),children:w.label}),_o("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:w.value}),w.copyable===!1?null:sr(n,{type:"button",variant:"ghost",size:"icon","aria-label":`${a} ${w.label}`,className:"h-6 w-6 shrink-0 text-muted-foreground hover:text-foreground",onClick:()=>{P(w)},children:g===w.label?sr(f,{className:"h-3.5 w-3.5"}):sr(te,{className:"h-3.5 w-3.5"})})]})]},w.label))})]})]})};var mf=pf;import*as Nn from"react";import{jsx as ke,jsxs as fr,Fragment as Ml}from"react/jsx-runtime";var ff={disabled:!1,emptyMessage:"No option found.",loading:!1,loadingMessage:"Loading options...",modal:!1,placeholder:"Select option...",searchPlaceholder:"Search...",width:"200px"},gf=1,bf=0.5,vf=(t)=>t.children!==void 0,Il=(t)=>t.flatMap((r)=>{if(!r.children)return[r];let o=Il(r.children);return o.length>0?[{...r,children:o}]:[]}),Al=(t,r=[])=>t.flatMap((o)=>o.children?Al(o.children,[...r,o]):[{ancestorIds:r.map((a)=>a.id),node:o,path:r.map((a)=>a.label).join(" / ")}]),El=(t)=>({paddingLeft:`${bf+t*gf}rem`}),Ol=Nn.forwardRef(function(r,o){let a={...ff,...r},{nodes:s,value:i,onChange:l,selectedLabel:c,placeholder:d,searchPlaceholder:u,emptyMessage:g,id:x,className:y,width:P,disabled:w,loading:D,loadingMessage:z,onSearchChange:B,modal:O}=a,[H,F]=Nn.useState(!1),[j,V]=Nn.useState(""),[_,J]=Nn.useState(()=>new Set),Q=Il(s),X=Al(Q),se=X.find((K)=>K.node.id===i),ye=j.trim().toLowerCase(),ve=(K)=>{if(K)J(new Set(se?.ancestorIds));else if(j!=="")V(""),B?.("");F(K)},Re=(K)=>{V(K),B?.(K)},Me=(K)=>{J((ae)=>{let ee=new Set(ae);if(!ee.delete(K))ee.add(K);return ee})},Ae=(K)=>{l(K),ve(!1)},be=(K)=>fr(Ml,{children:[ke(f,{"aria-hidden":!0,className:e(i===K.id?"opacity-100":"opacity-0")}),K.icon]}),qe=(K,ae)=>K.flatMap((ee)=>{if(!vf(ee))return[fr(N,{value:ee.id,style:El(ae),onSelect:()=>{Ae(ee.id)},children:[be(ee),ke("span",{className:"min-w-0 truncate",title:ee.label,children:ee.label})]},ee.id)];let Ce=_.has(ee.id),st=Ce?vr:xr;return[fr(N,{value:ee.id,"aria-expanded":Ce,style:El(ae),onSelect:()=>{Me(ee.id)},children:[ke(m,{"aria-hidden":!0,className:e(Ce&&"rotate-90")}),ee.icon??ke(st,{"aria-hidden":!0}),ke("span",{className:"min-w-0 truncate",title:ee.label,children:ee.label})]},ee.id),...Ce&&ee.children?qe(ee.children,ae+1):[]]}),he=ye===""?[]:X.filter((K)=>B!==void 0||`${K.path} / ${K.node.label}`.toLowerCase().includes(ye)),_e=se?.node.label??c;return fr(R,{modal:O,open:H,onOpenChange:ve,children:[ke(L,{asChild:!0,children:fr(n,{ref:o,id:x,variant:"outline","aria-expanded":H,"aria-busy":D,className:e("justify-between",y),style:{width:P},disabled:w,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}),D?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:fr(oe,{shouldFilter:!1,children:[ke(Ze,{"aria-label":u,placeholder:u,value:j,onValueChange:Re}),ke(me,{className:"max-h-[min(300px,calc(var(--radix-popover-content-available-height)-2.5rem))]",children:D?fr("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"}),z]}):fr(Ml,{children:[ke(Qe,{children:g}),ke(Y,{children:ye===""?qe(Q,0):he.map((K)=>fr(N,{value:K.node.id,onSelect:()=>{Ae(K.node.id)},children:[be(K.node),ke("span",{className:"min-w-0 truncate",title:K.node.label,children:K.node.label}),K.path===""?null:ke("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))})]})})]})})]})});Ol.displayName="TreeSelect";import*as Vl from"react";import{jsx as Hl,jsxs as xf}from"react/jsx-runtime";var hf=({value:t,state:r="value",trailing:o,monospace:a=!0,className:s,...i},l)=>{let c=r==="secret";return xf("div",{ref:l,className:e("flex min-w-0 items-center gap-2",s),...i,children:[Hl("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:Hl("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]})},Bl=Vl.forwardRef(hf);Bl.displayName="ValueRow";var yf=Bl;import{forwardRef as Fl,useCallback as Yr,useLayoutEffect as _l,useId as wf,useRef as zl,useState as We}from"react";import{jsx as C,jsxs as W,Fragment as jn}from"react/jsx-runtime";var Nf=({mode:t,onModeChange:r,disabled:o})=>W("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:[C("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)]")}),W("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:[C(St,{className:"h-3 w-3"}),"Linked"]}),W("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:[C(ct,{className:"h-3 w-3"}),"Inline"]})]}),Rf=({variableKey:t,initialValue:r,isSecret:o,loading:a,saving:s,onSubmit:i,onCancel:l})=>{let[c,d]=We(r),[u,g]=We(!1),x=zl(null);return _l(()=>{if(!a)x.current?.focus()},[a]),W("form",{role:"presentation",onSubmit:(y)=>{y.preventDefault(),i(c)},onKeyDown:(y)=>{if(y.key==="Escape")y.preventDefault(),l()},className:"space-y-3 p-3",children:[W("div",{className:"flex items-start justify-between gap-2",children:[W("div",{className:"min-w-0",children:[C("p",{className:"text-[10px] font-medium uppercase tracking-[0.1em] text-muted-foreground",children:"Editing linked variable"}),C("p",{className:"mt-0.5 truncate font-mono text-xs text-foreground",children:t})]}),C("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:C(S,{className:"h-3.5 w-3.5"})})]}),W("div",{className:"space-y-1",children:[C(b,{htmlFor:"linked-value",className:"text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground",children:o?"Secret value":"Value"}),W("div",{className:"relative",children:[C(h,{ref:x,id:"linked-value",type:u?"text":"password",value:c,onChange:(y)=>{d(y.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}),C("button",{type:"button",onClick:()=>{g((y)=>!y)},"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?C(He,{className:"h-3.5 w-3.5"}):C(ce,{className:"h-3.5 w-3.5"})})]})]}),W("div",{className:"flex items-center justify-between gap-2 pt-1",children:[W("p",{className:"text-[10px] leading-relaxed text-muted-foreground",children:["Updates the linked secret. Other connectors using"," ",C("span",{className:"font-mono",children:t})," will pick it up on their next run."]}),C(n,{type:"submit",size:"sm",disabled:a||s,className:"h-7 px-3 text-xs",children:s?W(jn,{children:[C(T,{className:"h-3 w-3 animate-spin"}),"Saving"]}):"Save"})]})]})},Cf=({suggestedName:t,onSubmit:r,onCancel:o})=>{let[a,s]=We(t),[i,l]=We(""),[c,d]=We(!0),[u,g]=We(!1),x=zl(null);_l(()=>{x.current?.focus(),x.current?.select()},[]);let y=a.trim(),P=y.length>0;return W("form",{role:"presentation",onSubmit:(w)=>{if(w.preventDefault(),P)r({key:y,secret:c,value:i})},onClick:(w)=>{w.stopPropagation()},onKeyDown:(w)=>{if(w.key==="Escape")w.preventDefault(),w.stopPropagation(),o()},className:"flex flex-col",children:[W("div",{className:"flex items-center gap-2 border-b border-border/60 bg-muted/15 px-3 py-2",children:[C("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:C(dt,{className:"h-3.5 w-3.5"})}),C("span",{className:"flex-1 text-[10.5px] font-medium uppercase tracking-[0.12em] text-muted-foreground/80",children:"New variable"}),C(Ge,{className:"h-3 w-3 text-muted-foreground/60"})]}),W("div",{className:"space-y-2.5 px-3 py-2.5",children:[W("div",{className:"space-y-1",children:[C(b,{htmlFor:"var-key",className:"text-[10px] font-medium uppercase tracking-[0.1em] text-muted-foreground/70",children:"Name"}),W("div",{className:"relative",children:[C("span",{"aria-hidden":!0,className:"pointer-events-none absolute inset-y-0 left-2.5 flex items-center text-muted-foreground/60",children:C(lt,{className:"h-3 w-3"})}),C(h,{ref:x,id:"var-key",value:a,onChange:(w)=>{s(w.target.value.toUpperCase())},placeholder:"VARIABLE_NAME",className:"h-8 pl-7 font-mono text-[12.5px] tracking-tight",autoComplete:"off",spellCheck:!1})]})]}),W("div",{className:"space-y-1",children:[C(b,{htmlFor:"var-value",className:"text-[10px] font-medium uppercase tracking-[0.1em] text-muted-foreground/70",children:"Value"}),W("div",{className:"relative",children:[C(h,{id:"var-value",type:u?"text":"password",value:i,onChange:(w)=>{l(w.target.value)},placeholder:"Encrypted at rest",className:"h-8 pr-8 font-mono text-[12.5px]",autoComplete:"off",spellCheck:!1}),C("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/70 transition-colors hover:bg-muted hover:text-foreground",children:u?C(He,{className:"h-3.5 w-3.5"}):C(ce,{className:"h-3.5 w-3.5"})})]})]}),W("label",{className:"flex cursor-pointer items-center gap-2 select-none text-[11px] text-muted-foreground",children:[C("input",{type:"checkbox",checked:c,onChange:(w)=>{d(w.target.checked)},className:"h-3 w-3 accent-primary"}),W("span",{className:"flex items-center gap-1",children:[C(lt,{className:"h-3 w-3"}),"Mark as secret"]})]})]}),W("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:[C("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:C(f,{className:"h-3 w-3"})}),W("span",{className:"flex min-w-0 flex-1 flex-col",children:[C("span",{className:"text-[12px] font-medium leading-tight",children:"Create variable"}),C("span",{className:"truncate text-[10px] leading-tight text-muted-foreground",children:P?W(jn,{children:["Link this field to"," ",C("span",{className:"font-mono text-foreground/80",children:y})]}):"Enter a name to continue"})]}),C(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"})]})]})},$l=Fl(function({selected:r,value:o,placeholder:a,disabled:s,open:i,onOpen:l},c){let d=Boolean(o),u=Boolean(r);return W("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:[C("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:C(St,{className:"h-3 w-3"})}),d?W("span",{className:"flex min-w-0 flex-1 items-center gap-1.5",children:[C("span",{className:"truncate font-mono text-[12.5px] tracking-tight",children:o}),!u&&C("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"})]}):C("span",{className:"flex-1 truncate text-muted-foreground",children:a}),C(Fe,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground/60 transition-colors group-hover/trigger:text-muted-foreground"})]})});$l.displayName="LinkedTrigger";var Sf=({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 W("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:[C("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:C(ct,{className:"h-3 w-3"})}),C("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&&C("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?C(He,{className:"h-3.5 w-3.5"}):C(ce,{className:"h-3.5 w-3.5"})})]})},Pf=({options:t,value:r,onSelect:o})=>W("div",{className:"px-1",children:[W("div",{className:"flex items-center justify-between px-2 pt-2 pb-1",children:[C("span",{className:"text-[10px] font-medium uppercase tracking-[0.12em] text-muted-foreground/80",children:"Linked variables"}),C("span",{className:"text-[10px] tabular-nums text-muted-foreground/60",children:t.length})]}),C(Y,{className:"!p-0 [&_[cmdk-group-heading]]:hidden",children:t.map((a)=>{let s=r===a.key;return W(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&&C("span",{"aria-hidden":!0,className:"absolute inset-y-1.5 left-0 w-[2px] rounded-r bg-primary"}),C("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:C(lt,{className:"h-3 w-3"})}),W("div",{className:"flex min-w-0 flex-1 flex-col",children:[C("span",{className:e("truncate font-mono text-[12.5px] tracking-tight",s&&"text-primary"),children:a.key}),a.description!==void 0&&a.description!==""&&C("span",{className:"truncate text-[10.5px] leading-tight text-muted-foreground",children:a.description})]}),s?C(f,{className:"h-3.5 w-3.5 shrink-0 text-primary"}):C("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:C(Oe,{className:"h-3.5 w-3.5"})})]},a.key)})})]}),Tf=()=>W("div",{className:"space-y-1.5 px-2 py-3",children:[W("div",{className:"flex items-center justify-between px-1 pb-1",children:[C("span",{className:"text-[10px] font-medium uppercase tracking-[0.12em] text-muted-foreground/60",children:"Loading"}),C(T,{className:"h-3 w-3 animate-spin text-muted-foreground/60"})]}),[0.95,0.7,0.85].map((t,r)=>W("div",{className:"flex items-center gap-2 rounded-md px-2 py-1.5",style:{opacity:1-r*0.18},children:[C("div",{className:"h-5 w-5 shrink-0 animate-pulse rounded-sm bg-muted/70"}),C("div",{className:"h-3 animate-pulse rounded bg-muted/70",style:{width:`${t*100}%`}})]},r))]}),kf=({query:t,canCreate:r,onCreate:o})=>{let a=t.trim();return W("div",{className:"flex flex-col items-center gap-2 px-4 py-7 text-center",children:[C("span",{"aria-hidden":!0,className:"flex h-9 w-9 items-center justify-center rounded-full bg-muted/60 text-muted-foreground/70",children:C(lt,{className:"h-4 w-4"})}),W("div",{className:"space-y-0.5",children:[C("p",{className:"text-[12px] font-medium text-foreground",children:a?W(jn,{children:["No variables match"," ",W("span",{className:"font-mono text-foreground",children:['"',a,'"']})]}):"No variables yet"}),C("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&&W(n,{type:"button",size:"sm",variant:"outline",onClick:o,className:"mt-1 h-7 text-[11px]",children:[C(Ge,{className:"h-3 w-3"}),a?`Create "${a.toUpperCase().replaceAll(/[^A-Z0-9_]/gu,"_")}"`:"Create variable"]})]})},Lf=({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 C(Cf,{suggestedName:d??s.trim(),onSubmit:(y)=>{c(y)},onCancel:()=>{g(!1)}});let x=C(Pf,{options:t,value:a,onSelect:l});if(r)x=C(Tf,{});else if(t.length===0)x=C(kf,{query:s,canCreate:Boolean(c),onCreate:()=>{g(!0)}});return W("div",{className:"flex flex-col",children:[W("div",{className:"relative flex items-center gap-2 border-b border-border/60 bg-muted/15 px-3 py-2",children:[C(Be,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground/70"}),C("input",{autoFocus:!0,type:"text",value:s,onChange:(y)=>{i(y.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"}),W("div",{className:"flex h-4 w-4 items-center justify-center",children:[o&&!r&&C(T,{className:"h-3 w-3 animate-spin text-muted-foreground/70"}),!o&&s&&C("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:C(S,{className:"h-3 w-3"})})]})]}),C(oe,{shouldFilter:!1,className:"rounded-none bg-transparent",loop:!0,children:C(me,{className:"max-h-[280px] py-1",children:x})}),c&&W("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:[C("span",{className:"flex h-6 w-6 items-center justify-center rounded-md bg-primary/10 text-primary ring-1 ring-primary/15",children:C(Ge,{className:"h-3 w-3"})}),W("span",{className:"flex min-w-0 flex-1 flex-col",children:[C("span",{className:"text-[12px] font-medium leading-tight",children:"Create new variable"}),C("span",{className:"text-[10px] leading-tight text-muted-foreground",children:"Encrypted at rest · reusable across connectors"})]}),C(Oe,{className:"h-3.5 w-3.5 text-muted-foreground/60 transition-transform group-hover/cta:translate-x-0.5"})]})]})},Df=Fl(function({value:r,mode:o,onChange:a,onBlur:s,options:i,optionsLoading:l,optionsFetching:c,onSearch:d,onCreate:u,onResolve:g,onUpdate:x,suggestedName:y,placeholder:P="Select variable…",disabled:w=!1,masked:D=!0,className:z},B){let[O,H]=We(!1),[F,j]=We(""),[V,_]=We(!1),[J,Q]=We(!1),[X,se]=We(null),[ye,ve]=We(!1),[Re,Me]=We(!1),[Ae,be]=We(null),qe=wf(),he=Yr((U)=>{if(U===o)return;a("",U),_(!1),j("")},[o,a]),_e=Yr((U)=>{a(U===r?"":U,"linked"),H(!1),_(!1)},[r,a]),K=Yr((U)=>{a(U,"inline")},[a]),ae=Yr(async(U)=>{if(!u)return;let it=await u(U);_(!1),H(!1),a(it.key,"linked")},[u,a]),ee=Yr(async()=>{if(!r||!g)return;Q(!0),ve(!0),be(null);try{let U=await g(r);se(U??{key:r,secret:!0,value:null})}catch(U){be(U instanceof Error?U.message:"Failed to load variable"),se({key:r,secret:!0,value:null})}ve(!1)},[r,g]),Ce=Yr(async(U)=>{if(!x||!r)return;Me(!0);try{await x({key:r,value:U}),Q(!1)}catch(it){throw Me(!1),it}Me(!1)},[x,r]),st=Yr((U)=>{j(U),d?.(U)},[d]),Se=i.find((U)=>U.key===r),Rr=o==="linked"&&Boolean(r)&&Boolean(x);return W("div",{className:e("space-y-1.5",z),children:[W("div",{className:"flex items-center gap-1.5",children:[C("div",{className:"min-w-0 flex-1",children:o==="linked"?W(R,{open:O,onOpenChange:(U)=>{if(H(U),!U)_(!1),s?.()},modal:!0,children:[C(L,{asChild:!0,children:C($l,{ref:B,selected:Se,value:r,placeholder:P,disabled:w,open:O,onOpen:()=>{H(!0)}})}),C(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:C(Lf,{options:i,optionsLoading:Boolean(l),optionsFetching:Boolean(c),value:r,query:F,onQueryChange:st,onSelect:_e,onCreate:u?ae:void 0,suggestedName:y,showCreate:V,onShowCreate:_})})]}):C(Sf,{inputId:qe,value:r,onChange:K,onBlur:()=>s?.(),placeholder:P||"Enter value",disabled:w,masked:D})}),Rr&&W(R,{open:J,onOpenChange:(U)=>{if(Q(U),!U)se(null),be(null);else if(!X)ee()},modal:!0,children:[C(L,{asChild:!0,children:C(n,{type:"button",variant:"outline",size:"icon",disabled:w,"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:C(ct,{className:"h-3.5 w-3.5"})})}),W(I,{align:"end",side:"bottom",sideOffset:6,className:"w-80 p-0 shadow-lg",children:[Ae!==null&&Ae!==""&&C("div",{className:"border-b border-destructive/30 bg-destructive/5 px-3 py-2 text-[11px] text-destructive",children:Ae}),C(Rf,{variableKey:r,initialValue:X?.value??"",isSecret:X?.secret??!0,loading:ye,saving:Re,onSubmit:(U)=>{Ce(U)},onCancel:()=>{Q(!1)}},`${r}:${X?.value??""}`)]})]}),C(Nf,{mode:o,onModeChange:he,disabled:w})]}),C("p",{className:"flex items-center gap-1.5 text-[10.5px] leading-tight text-muted-foreground/80",children:o==="linked"?W(jn,{children:[C(St,{className:"h-3 w-3"}),C("span",{children:"Reads from an org variable. Rotate values in one place; every connector picks it up."})]}):W(jn,{children:[C(ct,{className:"h-3 w-3"}),W("span",{children:["Stored inline on this connector. Use"," ",C("span",{className:"font-medium text-foreground/80",children:"Linked"})," ","to share across connectors."]})]})})]})});import{useMemo as Ef}from"react";import{jsx as zo,jsxs as Da}from"react/jsx-runtime";var Mf=(t)=>{let r="",o=0,a=" ",s=t.replaceAll(/>\s*</gu,`>
|
|
7
7
|
<`).split(`
|
|
8
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()},If=({open:t,onOpenChange:r,title:o="XML Viewer",data:a})=>{let s=Ef(()=>Mf(a??""),[a]);return zo(k,{open:t,onOpenChange:r,children:Da(E,{className:"max-w-2xl max-h-[80vh] flex flex-col",children:[Da(
|
|
9
|
+
`,l.startsWith("<")&&!l.startsWith("</")&&!l.startsWith("<?")&&!l.endsWith("/>")&&!/<\/[^>]+>$/u.test(l))o+=1}return r.trim()},If=({open:t,onOpenChange:r,title:o="XML Viewer",data:a})=>{let s=Ef(()=>Mf(a??""),[a]);return zo(k,{open:t,onOpenChange:r,children:Da(E,{className:"max-w-2xl max-h-[80vh] flex flex-col",children:[Da(G,{className:"flex flex-row items-center justify-between gap-2",children:[zo(M,{children:o}),Da(n,{type:"button",variant:"outline",size:"sm",onClick:()=>{navigator.clipboard.writeText(s),A.success("Copied to clipboard")},children:[zo(te,{className:"h-3.5 w-3.5 mr-1"}),"Copy"]})]}),zo("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 Ea}from"react/jsx-runtime";var Af=({title:t,children:r,details:o,className:a,open:s,defaultOpen:i=!1,onOpenChange:l,classes:c})=>Ea(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&&Ea(de,{open:s,defaultOpen:i,onOpenChange:l,className:e("col-start-2 mt-3 min-w-0",c?.details),children:[Ea(fe,{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(pe,{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 wr,jsxs as Ma,Fragment as Bf}from"react/jsx-runtime";var Jl=(t)=>Math.max(0,Math.min(100,Math.round(t))),Ia=(t)=>Jl(t.value??0),Of=(t)=>{if(t.length===0)return 0;return Jl(t.reduce((r,o)=>r+Ia(o),0)/t.length)},Hf=({lane:t})=>{let r=t.fillClassName??"bg-primary";if(t.mode==="indeterminate")return Ma(Bf,{children:[wr("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"}}),wr("style",{children:`@keyframes lane-progress-indeterminate {
|
|
10
10
|
0% { transform: translateX(-120%); }
|
|
11
11
|
100% { transform: translateX(320%); }
|
|
12
12
|
}
|
|
@@ -21,4 +21,4 @@ import{pr,yt,mr,te,hr,zt,He,ce,gr,vr,xr,br,yr,lt,St,ct,Ge,Sr,Cr,$e}from"../../in
|
|
|
21
21
|
0% { transform: translateX(-120%); }
|
|
22
22
|
55% { transform: translateX(150%); }
|
|
23
23
|
100% { transform: translateX(330%); }
|
|
24
|
-
}`})]}):ie(Pt,{"aria-label":"Progress","data-progress-mode":"determinate",value:o})]})},Uf=({milestones:t})=>{if(t===void 0||t.length===0)return null;return ie("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:[ie("span",{"aria-hidden":!0,className:e("mt-1.5 size-2 rounded-full",Gf(r.tone))}),jt("div",{className:"min-w-0",children:[ie("div",{className:"text-sm font-medium leading-5 text-foreground",children:r.label}),qr(r.description)?ie("div",{className:"text-sm leading-5 text-muted-foreground",children:r.description}):null]})]},r.id))})},Kf=({context:t,slots:r})=>jt("div",{className:"grid grid-cols-[auto_1fr] gap-3 sm:grid-cols-[auto_1fr_auto]",children:[ie("div",{className:"pt-0.5",children:Nr(r?.icon,t)??ie(Wf,{model:t.model})}),jt("div",{className:"min-w-0 space-y-1",children:[ie("h3",{className:"text-[15px] font-semibold leading-6 text-foreground",children:Nr(r?.title,t)??t.title}),ie("div",{className:"text-sm leading-6 text-muted-foreground",children:Nr(r?.description,t)??t.description})]}),ie(ue,{className:"col-start-2 w-fit sm:col-start-auto",variant:Jf(t.model.tone),children:t.statusLabel})]}),Yf=({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=ie(re,{className:e("w-full gap-0 overflow-hidden py-0",o),"data-status-tone":t.tone??"default",...a,children:jt(Rt,{className:"space-y-5 p-5 sm:p-6",children:[ie(Ff,{context:s}),Nr(r?.header,s)??ie(Kf,{context:s,slots:r}),Nr(r?.progressBody,s)??ie(Xf,{model:t}),Nr(r?.milestoneList,s)??ie(Uf,{milestones:t.milestones}),qr(l)?ie("div",{"data-slot":"lifecycle-status-card-completed",children:l}):null,t.error?Nr(r?.errorPanel,s)??ie(_f,{error:t.error}):null,qr(i)?ie("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 Wl from"react";import{jsx as Gl}from"react/jsx-runtime";var qf=({rows:t=5,rowClassName:r,className:o,...a},s)=>Gl("div",{ref:s,"aria-label":"Loading",className:e("flex flex-col gap-2",o),...a,children:Array.from({length:t}).map((i,l)=>Gl(Ve,{className:e("h-10 w-full",r)},l))}),Xl=Wl.forwardRef(qf);Xl.displayName="SkeletonRows";var Zf=Xl;import*as Kl from"react";import{jsx as Gn,jsxs as Ul}from"react/jsx-runtime";var Yl=Kl.forwardRef(function({icon:r,illustration:o,title:a,description:s,action:i,secondaryAction:l,size:c="md",variant:d="bare",className:u,...g},x){let y=c==="sm",
|
|
24
|
+
}`})]}):ie(Pt,{"aria-label":"Progress","data-progress-mode":"determinate",value:o})]})},Uf=({milestones:t})=>{if(t===void 0||t.length===0)return null;return ie("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:[ie("span",{"aria-hidden":!0,className:e("mt-1.5 size-2 rounded-full",Gf(r.tone))}),jt("div",{className:"min-w-0",children:[ie("div",{className:"text-sm font-medium leading-5 text-foreground",children:r.label}),qr(r.description)?ie("div",{className:"text-sm leading-5 text-muted-foreground",children:r.description}):null]})]},r.id))})},Kf=({context:t,slots:r})=>jt("div",{className:"grid grid-cols-[auto_1fr] gap-3 sm:grid-cols-[auto_1fr_auto]",children:[ie("div",{className:"pt-0.5",children:Nr(r?.icon,t)??ie(Wf,{model:t.model})}),jt("div",{className:"min-w-0 space-y-1",children:[ie("h3",{className:"text-[15px] font-semibold leading-6 text-foreground",children:Nr(r?.title,t)??t.title}),ie("div",{className:"text-sm leading-6 text-muted-foreground",children:Nr(r?.description,t)??t.description})]}),ie(ue,{className:"col-start-2 w-fit sm:col-start-auto",variant:Jf(t.model.tone),children:t.statusLabel})]}),Yf=({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=ie(re,{className:e("w-full gap-0 overflow-hidden py-0",o),"data-status-tone":t.tone??"default",...a,children:jt(Rt,{className:"space-y-5 p-5 sm:p-6",children:[ie(Ff,{context:s}),Nr(r?.header,s)??ie(Kf,{context:s,slots:r}),Nr(r?.progressBody,s)??ie(Xf,{model:t}),Nr(r?.milestoneList,s)??ie(Uf,{milestones:t.milestones}),qr(l)?ie("div",{"data-slot":"lifecycle-status-card-completed",children:l}):null,t.error?Nr(r?.errorPanel,s)??ie(_f,{error:t.error}):null,qr(i)?ie("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 Wl from"react";import{jsx as Gl}from"react/jsx-runtime";var qf=({rows:t=5,rowClassName:r,className:o,...a},s)=>Gl("div",{ref:s,"aria-label":"Loading",className:e("flex flex-col gap-2",o),...a,children:Array.from({length:t}).map((i,l)=>Gl(Ve,{className:e("h-10 w-full",r)},l))}),Xl=Wl.forwardRef(qf);Xl.displayName="SkeletonRows";var Zf=Xl;import*as Kl from"react";import{jsx as Gn,jsxs as Ul}from"react/jsx-runtime";var Yl=Kl.forwardRef(function({icon:r,illustration:o,title:a,description:s,action:i,secondaryAction:l,size:c="md",variant:d="bare",className:u,...g},x){let y=c==="sm",P=Boolean(o),w=!y&&!P,D=r??Gn(br,{className:"h-6 w-6"}),z=Boolean(s),B=Boolean(i)||Boolean(l),O=null;if(P)O=Gn("div",{className:e("flex items-center justify-center","[&_svg]:w-auto",y?"mb-3 [&_svg]:h-16":"mb-5 [&_svg]:h-24"),children:o});else if(w)O=Gn("div",{className:"mb-4 flex h-12 w-12 items-center justify-center rounded-md bg-(--bg-accent-soft) text-(--accent)",children:D});return Ul("div",{ref:x,"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)",y?"py-8":"px-8 py-14",u),...g,children:[O,Gn("h3",{className:e("font-semibold text-(--text-primary)",y?"text-[14px]":"text-[15px]"),children:a}),z?Gn("p",{className:e("mt-1 max-w-sm leading-relaxed text-(--text-secondary)",y?"text-[12px]":"text-[13px]"),children:s}):null,B?Ul("div",{className:e("flex flex-wrap items-center justify-center gap-2",y?"mt-4":"mt-5"),children:[i,l]}):null]})});Yl.displayName="EmptyState";var Qf=Yl;import*as ql from"react";import{jsx as ir,jsxs as Wn,Fragment as tg}from"react/jsx-runtime";var eg=(t)=>Object.prototype.toString.call(t)==="[object String]",Zl=ql.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(de,{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(tg,{children:[Wn(fe,{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(pe,{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}),eg(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]})]})})});Zl.displayName="TechnicalErrorDisclosure";var rg=Zl;import{jsx as Aa,jsxs as og}from"react/jsx-runtime";var ng=({icon:t,title:r="Loading...",className:o,spinnerSize:a=30})=>og("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&&Aa("div",{children:t}),Aa("h1",{className:"text-2xl font-semibold text-center",children:r}),Aa($e,{size:a})]}),ag=ng;import{jsx as $o,jsxs as ig}from"react/jsx-runtime";var sg=({children:t,className:r,classes:o,loading:a=!1,coverImage:s})=>$o("div",{className:e("min-h-screen flex items-center justify-center",o?.root,r),children:ig("div",{className:e("flex flex-col md:flex-row w-full min-h-[100vh] max-h-[100vh] overflow-hidden",o?.content),children:[$o("div",{className:e("hidden md:flex flex-1 items-center justify-center overflow-hidden bg-black",o?.left),children:s}),$o("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?$o($e,{size:48}):t})]})}),lg=sg;export{dc as ActionButton,mc as AddItemButton,ag as AppLoadingLayout,Sd as ArrayInput,io as CardOption,As as CardOptionsBlock,Yd as CheckboxCardOption,Ud as ChoiceCard,Xd as ChoiceCardGroup,Rc as CollectiveIntelligenceLoader,Zd as CommandStep,Bm as ConfirmDialog,wc as CopyButton,jd as CoverImage,_d as CronBuilder,tu as CurrencyInput,vc as DateInput,yc as DisplayHeading,Qf as EmptyState,Af as ErrorAlert,Pc as ErrorMessage,ru as FieldRow,du as FileDropArea,mu as FilterChips,vu as FlowBand,yu as FlowBranch,hu as FlowStep,sd as FormFrame,Lc as FormattedNumber,cd as Grid,Cu as GuideStep,Tu as HierarchyTree,Qs as HierarchyTreeBody,Zs as HierarchyTreeHeader,ei as HierarchyTreeRow,ti as HierarchyTreeToggle,Ic as IconTile,ia as JsonViewer,ju as JsonViewerDialog,Vc as Kicker,Wu as LabeledField,Vf as LaneProgress,Yf as LifecycleStatusCard,Xu as LinkedItem,$u as MarkdownEditorPreview,ri as MarkdownEditorPreviewToggle,Ku as MaskedValue,qu as MutedPlaceholder,rp as ObjectSchemaExplorer,md as PageRoot,bd as PageTitle,Kd as RadioCardOption,Os as RadioCardOptionsBlock,Uc as Ring,qm as SearchField,vd as SectionHeader,Ll as SectionSwitcher,Gc as SerifNumeral,zc as ShowMoreTag,Zf as SkeletonRows,Vm as SortableList,lg as SplashScreenLayout,lf as SplitButton,cf as SplitButtonAction,df as SplitButtonMenu,Fm as StageHeader,$m as StatTile,Zc as StatusDot,Xm as StatusPill,Zm as Stepper,sf as StepperContent,rf as StepperIndicator,ef as StepperItem,Qm as StepperNav,af as StepperPanel,of as StepperSeparator,nf as StepperTitle,tf as StepperTrigger,Wd as SummaryItem,Gd as SummaryList,yd as TableHead,mf as TechnicalDetailsPopover,rg as TechnicalErrorDisclosure,nr as ThemeToggle,oo as TimezonePicker,td as TooltipBadge,Ol as TreeSelect,Zn as Typography,yf as ValueRow,Df as VariableReferenceField,If as XmlViewerDialog,Ir as buildCron,Ht as defaultSimpleState,ro as describeCron,Ua as displayHeadingVariants,Qo as getTimezoneOptions,Zo as isValidCron,En as parseCron,gt as useIsMobile};
|