@texturehq/edges 5.20.0 → 5.21.0

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.
@@ -1728,6 +1728,8 @@ type DivergingScheme = "orangeYellowSeafoam" | "redYellowBlue" | "redBlue";
1728
1728
  * { by: "temp_anomaly", palette: "diverging", scheme: "redYellowBlue", center: 0 }
1729
1729
  */
1730
1730
  type ColorSpec = {
1731
+ expression: unknown[];
1732
+ } | {
1731
1733
  token: string;
1732
1734
  } | {
1733
1735
  hex: string;
@@ -2117,9 +2119,11 @@ interface LayerTreeNode {
2117
2119
  /** Stable identifier, unique across the tree. */
2118
2120
  id: string;
2119
2121
  label: string;
2120
- /** Leaf only: the `LayerSpec.id` this row shows and hides. */
2122
+ /** The `LayerSpec.id` this row shows and hides. May also have a detail pane. */
2121
2123
  layerId?: string;
2122
- /** Container only: nested rows, to any depth. */
2124
+ /** Custom detail content; content nodes do not participate in layer visibility. */
2125
+ content?: React.ReactNode;
2126
+ /** Nested rows or detail content, to any depth. */
2123
2127
  children?: LayerTreeNode[];
2124
2128
  /**
2125
2129
  * How many of this node's children may be on at once. Defaults to `multi`.
@@ -1728,6 +1728,8 @@ type DivergingScheme = "orangeYellowSeafoam" | "redYellowBlue" | "redBlue";
1728
1728
  * { by: "temp_anomaly", palette: "diverging", scheme: "redYellowBlue", center: 0 }
1729
1729
  */
1730
1730
  type ColorSpec = {
1731
+ expression: unknown[];
1732
+ } | {
1731
1733
  token: string;
1732
1734
  } | {
1733
1735
  hex: string;
@@ -2117,9 +2119,11 @@ interface LayerTreeNode {
2117
2119
  /** Stable identifier, unique across the tree. */
2118
2120
  id: string;
2119
2121
  label: string;
2120
- /** Leaf only: the `LayerSpec.id` this row shows and hides. */
2122
+ /** The `LayerSpec.id` this row shows and hides. May also have a detail pane. */
2121
2123
  layerId?: string;
2122
- /** Container only: nested rows, to any depth. */
2124
+ /** Custom detail content; content nodes do not participate in layer visibility. */
2125
+ content?: React.ReactNode;
2126
+ /** Nested rows or detail content, to any depth. */
2123
2127
  children?: LayerTreeNode[];
2124
2128
  /**
2125
2129
  * How many of this node's children may be on at once. Defaults to `multi`.
@@ -1,3 +1,3 @@
1
- 'use strict';var Oe=require('react'),reactAriaComponents=require('react-aria-components'),tailwindMerge=require('tailwind-merge'),jsxRuntime=require('react/jsx-runtime'),tt=require('@phosphor-icons/react');function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var Oe__namespace=/*#__PURE__*/_interopNamespace(Oe);var tt__namespace=/*#__PURE__*/_interopNamespace(tt);var Bt=Object.defineProperty;var Et=(e,t,r)=>t in e?Bt(e,t,{enumerable:true,configurable:true,writable:true,value:r}):e[t]=r;var Me=(e,t,r)=>Et(e,typeof t!="symbol"?t+"":t,r);function Xe(e,t=false){let[r,o]=Oe.useState(t);return Oe.useEffect(()=>{if(typeof window>"u")return;let n=window.matchMedia(e);o(n.matches);let a=s=>{o(s.matches);};return n.addEventListener("change",a),()=>{n.removeEventListener("change",a);}},[e]),r}function ve(e=true){let[t,r]=Oe.useState(null);return Oe.useEffect(()=>{if(!e){r(null);return}let o=typeof window<"u"?window.visualViewport:null;if(!o)return;let n=()=>{let a=Math.max(0,window.innerHeight-o.height-(o.offsetTop??0));r({height:o.height,keyboardOffset:a});};return n(),o.addEventListener("resize",n),o.addEventListener("scroll",n),()=>{o.removeEventListener("resize",n),o.removeEventListener("scroll",n);}},[e]),t}function ye(...e){return e.filter(Boolean).join(" ")}var F={displayXl:"text-display-xl",displayLg:"text-display-lg",displayMd:"text-display-md",displaySm:"text-display-sm",headingXl:"text-heading-xl",headingLg:"text-heading-lg",headingMd:"text-heading-md",headingSm:"text-heading-sm",bodyLg:"text-body-lg",bodyMd:"text-body-md",bodySm:"text-body-sm",labelLg:"text-label-lg",labelMd:"text-label-md",labelSm:"text-label-sm",code:"text-code",agent:"text-agent"};function Qe(e,...t){return ye(F[e],...t)}function Je(e=false){return `${e?"outline outline-1 outline-border-input data-[focus-visible]:outline-2 data-[focus-visible]:outline-action-default data-[focus-visible]:outline-offset-0 invalid:outline-2 invalid:outline-feedback-error-border group-invalid:outline-2 group-invalid:outline-feedback-error-border forced-colors:focus:outline-[Highlight] forced-colors:focus:outline-2 forced-colors:focus:outline-offset-2":"outline-none data-[focus-visible]:outline data-[focus-visible]:outline-2 data-[focus-visible]:outline-action-default data-[focus-visible]:outline-offset-0 invalid:outline-2 invalid:outline-feedback-error-border group-invalid:outline-2 group-invalid:outline-feedback-error-border forced-colors:focus:outline-[Highlight] forced-colors:focus:outline-2 forced-colors:focus:outline-offset-2"}`}var ee={sm:{text:"text-[length:var(--control-text-sm)]",height:"h-[var(--control-sm-height)]",padding:"px-[var(--control-padding-sm)]",paddingY:"py-[var(--control-gap-sm)]",gap:"gap-[var(--control-gap-sm)]"},md:{text:"text-[length:var(--control-text-md)]",height:"h-[var(--control-md-height)]",padding:"px-[var(--control-padding-md)]",paddingY:"py-[var(--control-gap-md)]",gap:"gap-[var(--control-gap-md)]"},lg:{text:"text-[length:var(--control-text-lg)]",height:"h-[var(--control-lg-height)]",padding:"px-[var(--control-padding-lg)]",paddingY:"py-[var(--control-gap-lg)]",gap:"gap-[var(--control-gap-lg)]"},xl:{text:"text-[length:var(--control-text-xl)]",height:"h-[var(--control-xl-height)]",padding:"px-[var(--control-padding-xl)]",paddingY:"py-[var(--control-gap-xl)]",gap:"gap-[var(--control-gap-xl)]"}};function h(e,t){let r=Oe.forwardRef(({size:o=24,color:n="currentColor",className:a,mirrored:s,alt:i,...l},c)=>{let p=!!i||"aria-label"in l;return jsxRuntime.jsx("svg",{ref:c,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 256 256",fill:n,className:a,transform:s?"scale(-1, 1)":void 0,"aria-hidden":p?void 0:true,role:p?"img":void 0,"aria-label":i,...l,children:t})});return r.displayName=e,r}var we=()=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M12 128h44M200 128h44",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round"}),jsxRuntime.jsx("circle",{cx:"76",cy:"128",r:"20",fill:"none",stroke:"currentColor",strokeWidth:"16"}),jsxRuntime.jsx("circle",{cx:"180",cy:"128",r:"20",fill:"none",stroke:"currentColor",strokeWidth:"16"})]}),Ke=()=>jsxRuntime.jsx("path",{d:"M166 120 88 70",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round"}),Ze=()=>jsxRuntime.jsx("path",{d:"M162 122 92 128",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round"}),et=()=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M112 85.7 A32 32 0 1 1 144 85.7",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round"}),jsxRuntime.jsx("circle",{cx:"128",cy:"58",r:"8",fill:"currentColor",stroke:"none"})]}),Wt=h("TextureRecloser",jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("rect",{x:"36",y:"36",width:"184",height:"184",fill:"none",stroke:"currentColor",strokeWidth:"16"}),jsxRuntime.jsx("text",{x:"128",y:"126",textAnchor:"middle",dominantBaseline:"central",fontFamily:"ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif",fontSize:"140",fontWeight:"700",fill:"currentColor",stroke:"none",children:"R"})]})),Vt=h("TextureFuse",jsxRuntime.jsx("path",{d:"M20 128h72q18 -84 36 0q18 84 36 0h72",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round",strokeLinejoin:"round"})),$t=h("TextureBreaker",jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("rect",{x:"36",y:"36",width:"184",height:"184",fill:"none",stroke:"currentColor",strokeWidth:"16"}),jsxRuntime.jsx("text",{x:"128",y:"126",textAnchor:"middle",dominantBaseline:"central",fontFamily:"ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif",fontSize:"140",fontWeight:"700",fill:"currentColor",stroke:"none",children:"B"})]})),Yt=h("TextureSource",jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M4 128h40M212 128h40",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round"}),jsxRuntime.jsx("circle",{cx:"128",cy:"128",r:"84",fill:"none",stroke:"currentColor",strokeWidth:"16"}),jsxRuntime.jsx("path",{d:"M92 128q18 -84 36 0q18 84 36 0",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round",strokeLinejoin:"round"})]})),Ut=h("TextureCapacitor",jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx("path",{d:"M4 128h106M146 128h106M110 72v112M146 72v112",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round"})})),jt=h("TextureRegulator",jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("circle",{cx:"128",cy:"128",r:"92",fill:"none",stroke:"currentColor",strokeWidth:"16"}),jsxRuntime.jsx("text",{x:"128",y:"126",textAnchor:"middle",dominantBaseline:"central",fontFamily:"ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif",fontSize:"128",fontWeight:"700",fill:"currentColor",stroke:"none",children:"V"})]})),Gt=h("TextureSwitch",jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(we,{}),jsxRuntime.jsx(Ke,{})]})),qt=h("TextureSwitchClosed",jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(we,{}),jsxRuntime.jsx(Ze,{})]})),Xt=h("TextureOpenPoint",jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M112 52 C 74 92, 74 164, 112 204",fill:"none",stroke:"currentColor",strokeWidth:"18",strokeLinecap:"round"}),jsxRuntime.jsx("path",{d:"M144 52 C 182 92, 182 164, 144 204",fill:"none",stroke:"currentColor",strokeWidth:"18",strokeLinecap:"round"})]})),Qt=h("TextureSectionalizerOpen",jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(we,{}),jsxRuntime.jsx(Ke,{}),jsxRuntime.jsx(et,{})]})),Jt=h("TextureSectionalizerClosed",jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(we,{}),jsxRuntime.jsx(Ze,{}),jsxRuntime.jsx(et,{})]})),Kt=h("TextureTransformer",jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M40 64H88A22 22 0 0 1 88 108A22 22 0 0 1 88 152A22 22 0 0 1 88 196H40",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{d:"M216 64H168A22 22 0 0 0 168 108A22 22 0 0 0 168 152A22 22 0 0 0 168 196H216",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round",strokeLinejoin:"round"})]})),ie={1:[128],2:[110,146],3:[92,128,164]},Be=e=>jsxRuntime.jsx("path",{d:`M24 ${e}h208`,fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round"},e),Ee=e=>jsxRuntime.jsx("path",{d:`M24 ${e}h208`,fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round",pathLength:100,strokeDasharray:"20 20"},e),Zt=h("TextureSinglePhaseOverheadLine",jsxRuntime.jsx(jsxRuntime.Fragment,{children:ie[1].map(Be)})),er=h("TextureTwoPhaseOverheadLine",jsxRuntime.jsx(jsxRuntime.Fragment,{children:ie[2].map(Be)})),tr=h("TextureThreePhaseOverheadLine",jsxRuntime.jsx(jsxRuntime.Fragment,{children:ie[3].map(Be)})),rr=h("TextureSinglePhaseUndergroundLine",jsxRuntime.jsx(jsxRuntime.Fragment,{children:ie[1].map(Ee)})),or=h("TextureTwoPhaseUndergroundLine",jsxRuntime.jsx(jsxRuntime.Fragment,{children:ie[2].map(Ee)})),nr=h("TextureThreePhaseUndergroundLine",jsxRuntime.jsx(jsxRuntime.Fragment,{children:ie[3].map(Ee)})),ar=h("TextureSupportStructure",jsxRuntime.jsx("circle",{cx:"128",cy:"128",r:"40",fill:"currentColor",stroke:"none"})),Ce={TextureRecloser:Wt,TextureFuse:Vt,TextureBreaker:$t,TextureSource:Yt,TextureCapacitor:Ut,TextureRegulator:jt,TextureSwitch:Gt,TextureSwitchClosed:qt,TextureOpenPoint:Xt,TextureSectionalizerOpen:Qt,TextureSectionalizerClosed:Jt,TextureTransformer:Kt,TextureSinglePhaseOverheadLine:Zt,TextureTwoPhaseOverheadLine:er,TextureThreePhaseOverheadLine:tr,TextureSinglePhaseUndergroundLine:rr,TextureTwoPhaseUndergroundLine:or,TextureThreePhaseUndergroundLine:nr,TextureSupportStructure:ar};if(process.env.NODE_ENV==="development")for(let e of Object.keys(Ce))e in tt__namespace&&console.error(`Custom icon "${e}" collides with a Phosphor icon of the same name. Rename it (use the "Texture" prefix) to keep the icon namespace unambiguous.`);var se={xs:16,sm:20,md:24,lg:32,xl:40,"2xl":48},I=Oe.memo(({name:e,size:t="md",color:r,weight:o="regular",className:n,ariaLabel:a,...s})=>{let i=Ce[e]??tt__namespace[e];if(!i)return process.env.NODE_ENV==="development"&&console.error(`Icon "${e}" not found in @phosphor-icons/react or the custom icon registry`),null;let l=typeof t=="string"&&t in se?se[t]:t,c=tailwindMerge.twMerge("inline-block flex-shrink-0",!r&&"text-current",n);return jsxRuntime.jsx(i,{...s,size:l,color:r,weight:o,className:c,"aria-label":a||`${e} icon`,"data-testid":`icon-${e}`})});I.displayName="Icon";var ir=Oe.memo(({variant:e="subtle",shape:t="square",containerSize:r,containerClassName:o,size:n="md",className:a,name:s,color:i,weight:l,ariaLabel:c,ref:p,...u})=>{let x=typeof n=="string"&&n in se?se[n]:n,C=r?typeof r=="string"&&r in se?se[r]:r:x*1.75,v=tailwindMerge.twMerge("inline-flex items-center justify-center flex-shrink-0",t==="circle"?"rounded-full":"rounded-lg",e==="subtle"&&"bg-background-muted",e==="solid"&&"bg-action-brand text-[color:var(--color-action-brand-text)]",e==="outline"&&"border-2 border-current",o);return jsxRuntime.jsx("div",{className:v,style:{width:C,height:C},children:jsxRuntime.jsx(I,{...u,name:s,size:n,color:i,weight:l,className:a,ariaLabel:c})})});ir.displayName="IconWithContainer";var dr="flex font-medium justify-center items-center gap-2 text-center transition rounded-[var(--control-border-radius)] whitespace-nowrap box-border",cr="bg-action-primary text-[color:var(--color-action-primary-text)] hover:bg-action-primary-hover forced-colors:bg-[ButtonText] forced-colors:text-[ButtonFace] border-2 border-transparent",ur={primary:cr,secondary:"bg-action-secondary text-[color:var(--color-action-secondary-text)] border-2 border-border-muted hover:bg-action-secondary-hover forced-colors:border-[ButtonBorder] forced-colors:bg-[ButtonFace] forced-colors:text-[ButtonText]",ghost:"border-none text-text-primary hover:bg-text-primary/5 forced-colors:text-[ButtonText] forced-colors:hover:bg-[ButtonFace]",destructive:"bg-transparent text-feedback-error-text border-2 border-border-muted hover:bg-feedback-error-background/50 forced-colors:border-[ButtonBorder] forced-colors:bg-[ButtonFace] forced-colors:text-[Mark]",link:"!text-action-primary hover:text-action-primary/90 hover:underline hover:decoration-2 hover:underline-offset-4",icon:"border-none text-text-primary hover:bg-background-hover hover:text-text-primary forced-colors:text-[ButtonText] forced-colors:hover:bg-[ButtonFace] p-1 flex-shrink-0 rounded-[var(--control-border-radius)]",unstyled:"bg-transparent"},at={full:"w-full",default:"w-fit"},pr="opacity-50 cursor-not-allowed pointer-events-none",fr="opacity-100 cursor-pointer",mr={"top-right":"-right-2 -top-2","top-left":"-left-2 -top-2","bottom-right":"-right-2 -bottom-2","bottom-left":"-left-2 -bottom-2"},gr={primary:"bg-action-primary text-[color:var(--color-action-primary-text)]",destructive:"bg-feedback-error-border text-text-inverse"};function hr(e){return !e||e==="default"||e==="brand"?"primary":e}function br(e){let{variant:t="primary",size:r="md",isDisabled:o,fullWidth:n=false,isLoading:a=false}=e,s=hr(t),i=s==="unstyled"?"":`${dr} ${ur[s]}`;s!=="unstyled"&&(i+=` ${ee[r].text} ${ee[r].height} ${ee[r].padding} ${ee[r].gap}`),o||a?i+=` ${pr}`:i+=` ${fr}`,n?i+=` ${at.full}`:i+=` ${at.default}`;let l=s==="primary"?"focus-visible:outline-action-primary":void 0;return [i,Je(),l].filter(Boolean).join(" ")}function $(e){let{icon:t,children:r,isLoading:o=false,loadingText:n,loadingIndicator:a,size:s="md",iconPosition:i="left",iconWeight:l,href:c,className:p,badgeNumber:u,badgeVariant:x="primary",badgePosition:C="top-right",style:v,target:S,rel:M,...N}=e,m=t?jsxRuntime.jsx(I,{name:t,size:s,weight:l}):null,P=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[i==="left"&&m,typeof r=="function"?null:r,i==="right"&&m]}),R=jsxRuntime.jsxs("div",{className:"relative inline-flex items-center justify-center",children:[jsxRuntime.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:a||jsxRuntime.jsx(I,{name:"CircleNotch",size:s,className:"animate-spin","aria-hidden":"true"})}),jsxRuntime.jsx("div",{className:"invisible","aria-hidden":"true",children:P}),n&&jsxRuntime.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:n})]}),y=(u??0)>0,k=tailwindMerge.twMerge(br(e),p),j=c?{href:c,target:S,rel:M,...N}:{};if(c){let{onPress:O,onPressStart:E,onPressEnd:ce,onPressChange:G,onPressUp:oe,onAuxClick:ue,onContextMenu:ne,onDoubleClick:W,...H}=N;Object.assign(j,H);}let B=c?jsxRuntime.jsx(reactAriaComponents.Link,{...j,...o&&{"aria-busy":true},style:y?void 0:v,className:k,children:o?R:typeof r=="function"?(function(O){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[i==="left"&&m,r(O),i==="right"&&m]})}):P}):jsxRuntime.jsx(reactAriaComponents.Button,{...N,...o&&{"aria-busy":true},style:y?void 0:v,className:k,children:o?R:typeof r=="function"?(function(O){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[i==="left"&&m,r(O),i==="right"&&m]})}):P});return y?jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("relative flex",p),style:v,children:[B,jsxRuntime.jsx("span",{className:`absolute ${mr[C]} flex h-5 w-5 items-center justify-center rounded-full ${gr[x]} text-xs font-medium`,"aria-label":`${u} items`,children:u})]}):B}function Ae({action:e,defaultVariant:t,defaultSize:r="lg"}){let o=!!e.formId;return jsxRuntime.jsx($,{type:o?"submit":"button",form:o?e.formId:void 0,size:e.size||r,variant:e.variant||t,onPress:o?void 0:e.onPress,isLoading:e.isLoading,isDisabled:e.isDisabled,children:e.label})}function X({primaryAction:e,secondaryAction:t,tertiaryAction:r,footerContent:o}){let n=e||t||r;return !n&&!o?null:jsxRuntime.jsxs("div",{className:`flex w-full flex-col items-center justify-center border-t p-4 ${o?"h-28":""}`,children:[o&&jsxRuntime.jsx("div",{className:"flex h-10 justify-center",children:o}),n&&jsxRuntime.jsxs("div",{className:"flex w-full items-center justify-between gap-3",children:[jsxRuntime.jsx("div",{children:r&&jsxRuntime.jsx(Ae,{action:r,defaultVariant:"destructive"})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[t&&jsxRuntime.jsx(Ae,{action:t,defaultVariant:"secondary"}),e&&jsxRuntime.jsx(Ae,{action:e,defaultVariant:"primary"})]})]})]})}var xr={heading:{sm:F.headingSm,md:F.headingMd,lg:F.headingLg,xl:F.headingXl},display:{sm:F.displaySm,md:F.displayMd,lg:F.displayLg,xl:F.displayXl}},vr={page:"h-16 leading-[62px]"};function te({tag:e="h1",variant:t="heading",size:r="lg",height:o,className:n="",children:a}){let s=r==="xs"?"sm":r,i=xr[t][s],l=o?vr[o]:"";return jsxRuntime.jsx(e,{className:ye(i,"text-text-primary",l,n),children:a})}var D=({title:e,onClose:t,hideCloseIcon:r=false,titleAlign:o="left",hasBackArrow:n=false,onBack:a,headerContent:s})=>jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("relative flex h-16 w-full flex-shrink-0 items-center justify-between border-b px-6",e&&"border-b",o==="center"?"justify-center":""),children:[n&&jsxRuntime.jsx($,{variant:"icon",onPress:a,className:"absolute left-6","aria-label":"Go back",children:jsxRuntime.jsx(I,{name:"CaretLeft","data-testid":"back-arrow"})}),s||jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[e&&jsxRuntime.jsx(te,{size:"xs",children:e}),t&&!r&&jsxRuntime.jsx($,{variant:"icon",onPress:t,"aria-label":"Close dialog",children:jsxRuntime.jsx(I,{name:"X","data-testid":"close-button"})})]})]});var Pr=Oe.createContext(false);Oe.createContext(null);function lt({children:e}){return jsxRuntime.jsx(Pr.Provider,{value:true,children:e})}var L=({width:e,height:t,variant:r="rect",animation:o="pulse",gradient:n=false,flex:a=false,stack:s,responsive:i,delay:l=0,adjustAnimationSpeedBasedOnWidth:c=false,ariaLabel:p,className:u,"data-testid":x})=>{let[C,v]=Oe.useState(l===0);if(Oe.useEffect(()=>{if(l>0){let y=setTimeout(()=>v(true),l);return ()=>clearTimeout(y)}},[l]),!C)return null;let S=n?"bg-gradient-to-r from-[var(--color-skeleton-base)] via-[var(--color-skeleton-highlight)] to-[var(--color-skeleton-base)]":"bg-[var(--color-skeleton-base)]",M=c&&e?(()=>{let y=typeof e=="number"?e:parseFloat(String(e));return isNaN(y)?"":`animation-duration-[${Math.max(.8,y/100)}s]`})():"",N=o==="pulse"?`animate-pulse ${M}`:o==="wave"?`relative overflow-hidden before:absolute before:inset-0 before:bg-gradient-to-r before:from-transparent before:via-[var(--color-skeleton-wave)] before:to-transparent before:animate-wave ${M}`:"",m="rounded-sm";r==="circle"&&(m="rounded-full"),r==="text"&&(m="h-4 w-full rounded-sm");let P=a?"flex-1 min-w-0":"",R=i?Object.entries(i).map(([y,k])=>`${y}:w-[${k}]`).join(" "):"";return s?jsxRuntime.jsx("div",{className:"space-y-2","data-testid":x,children:s.map((y,k)=>jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(S,N,m,P,R,u),style:{width:y,height:t}},k))}):jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(S,N,m,P,R,u),style:{width:e,height:t},role:"presentation","aria-hidden":!p,"aria-label":p??void 0,"data-testid":x})};var Sr={outlined:"bg-background-surface border border-border-default",elevated:"bg-background-surface border-0 shadow-md",filled:"bg-background-muted border-0",ghost:"bg-transparent border-0 shadow-none"},Tr="rounded-lg",We={square:"aspect-square",video:"aspect-video",wide:"aspect-[2/1]",auto:""},Dr={start:"justify-start",end:"justify-end",center:"justify-center",between:"justify-between"};function ct(e){return Oe__namespace.default.Children.toArray(e).some(t=>Oe__namespace.default.isValidElement(t)?t.type===Oe__namespace.default.Fragment?ct(t.props.children):t.type===Ve&&!!t.props.title:false)}function Y({variant:e="outlined",className:t,children:r,isLoading:o=false,layout:n="default"}){let a=ct(r)?jsxRuntime.jsx(lt,{children:r}):r;return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("w-full overflow-hidden",Sr[e],Tr,n==="flex"&&"flex flex-col",t),"data-testid":"card",children:o?jsxRuntime.jsx(L,{width:"100%",height:"100%",className:"rounded-none"}):a})}function Ve({title:e,subtitle:t,actions:r,leading:o,className:n,isLoading:a=false}){return a?jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("p-6 pb-4",n),children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-1",children:[jsxRuntime.jsx(L,{width:120,height:20}),jsxRuntime.jsx(L,{width:24,height:24})]}),t&&jsxRuntime.jsx(L,{width:200,height:16})]}):!e&&!t&&!r&&!o?null:jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("p-6 pb-4",n),children:jsxRuntime.jsxs("div",{className:"flex justify-between items-start gap-4",children:[o&&jsxRuntime.jsx("div",{className:"flex-shrink-0",children:o}),jsxRuntime.jsxs("div",{className:"min-w-0 flex-1",children:[e&&jsxRuntime.jsx("div",{className:"mb-1",children:typeof e=="string"?jsxRuntime.jsx(te,{tag:"h3",size:"sm",className:"text-text-primary",children:e}):e}),t&&jsxRuntime.jsx("div",{className:Qe("bodySm","text-text-secondary"),children:t})]}),r&&jsxRuntime.jsx("div",{className:"flex-shrink-0",children:r})]})})}function ut({src:e,alt:t,aspectRatio:r="auto",className:o,children:n,isLoading:a=false}){return a?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("bg-background-muted",We[r],o),children:jsxRuntime.jsx(L,{width:"100%",height:"100%"})}):n?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("overflow-hidden",We[r],o),children:n}):e?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("overflow-hidden",We[r],o),children:jsxRuntime.jsx("img",{src:e,alt:t||"",className:"w-full h-full object-cover",loading:"lazy"})}):null}function pt({className:e,children:t,isLoading:r=false,fill:o=false,style:n}){let s=e?.match(/p(?:t|b|l|r|x|y)?-(?:\d+(?:\.\d+)?|px|\[.+?\])/)?"":"px-6 py-4";return r?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(s,o&&"flex-1 flex flex-col min-h-0",e),style:n,children:jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(L,{width:"100%",height:16}),jsxRuntime.jsx(L,{width:"80%",height:16}),jsxRuntime.jsx(L,{width:"60%",height:16})]})}):t?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(s,"text-text-primary",o&&"flex-1 flex flex-col min-h-0",e),style:n,children:t}):null}function ft({className:e,children:t,align:r="end",isLoading:o=false}){return o?jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("px-6 py-4 flex gap-2 justify-end",e),children:[jsxRuntime.jsx(L,{width:80,height:32}),jsxRuntime.jsx(L,{width:60,height:32})]}):t?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("px-6 py-4 flex items-center gap-2",Dr[r],e),children:t}):null}Y.Header=Ve;Y.Media=ut;Y.Content=pt;Y.Footer=ft;var z=class extends Oe.Component{constructor(){super(...arguments);Me(this,"state",{hasError:false});Me(this,"handleRetry",()=>{this.setState({hasError:false,error:void 0}),typeof window<"u"&&window.location.reload();});}static getDerivedStateFromError(r){return {hasError:true,error:r}}componentDidCatch(r,o){console.error("Error Boundary caught an error:",r,o);}render(){return this.state.hasError?this.props.fallback?this.props.fallback:jsxRuntime.jsxs(Y,{children:[this.props.title&&jsxRuntime.jsx(Y.Header,{title:this.props.title}),jsxRuntime.jsx(Y.Content,{children:jsxRuntime.jsxs("div",{className:"flex flex-col items-center justify-center gap-4","data-testid":"error-boundary",children:[jsxRuntime.jsx("p",{className:"text-feedback-error-text",children:this.state.error?.message||"Something went wrong"}),jsxRuntime.jsx("button",{className:"rounded bg-action-default px-4 py-2 text-[color:var(--color-action-default-text)] hover:bg-action-default-hover",onClick:this.handleRetry,children:"Retry"})]})})]}):this.props.children}};function Q({transparent:e=false,className:t,children:r,...o}){return jsxRuntime.jsx(reactAriaComponents.ModalOverlay,{...o,className:reactAriaComponents.composeRenderProps(t,(n,a)=>tailwindMerge.twMerge("fixed inset-0 z-50","outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0 focus-visible:ring-0",e?"bg-transparent":["bg-gradient-to-br from-background-modal/20 via-background-modal/15 to-background-modal/20","backdrop-blur-[2px]","supports-[backdrop-filter]:bg-background-modal/15"].join(" "),a.isEntering&&["animate-in fade-in","duration-300 ease-out"].join(" "),a.isExiting&&["animate-out fade-out","duration-200 ease-in"].join(" "),n)),children:r})}var Ar=.3,zr=.5;function Re({children:e,title:t,headerContent:r,titleAlign:o="left",hideCloseIcon:n=false,hasBackArrow:a=false,onBack:s,isOpen:i,onClose:l,isDismissable:c=true,transparentOverlay:p=false,primaryAction:u,secondaryAction:x,footerContent:C,maxHeight:v="80vh",height:S,maxWidth:M="640px",contentPadding:N=true,showHandle:m=true,animationVariant:P="scale",className:R}){let[y,k]=Oe.useState(false),[j,B]=Oe.useState(0),[O,E]=Oe.useState(false),ce=ve(i),G=ce?.height??null,oe=ce?.keyboardOffset??0,ue=Oe.useRef(null),ne=Oe.useRef(null),W=Oe.useRef(null),H=Oe.useRef({isDragging:false,startY:0,startTime:0,pointerId:null});Oe.useEffect(()=>{if(i){let g=setTimeout(()=>{k(true),setTimeout(()=>k(false),600);},400);return ()=>clearTimeout(g)}},[i]),Oe.useEffect(()=>{i||(B(0),E(false),H.current={isDragging:false,startY:0,startTime:0,pointerId:null});},[i]),Oe.useEffect(()=>{let g=ne.current;if(!g||!i)return;let V=null,ae=me=>{let Z=me.target;Z&&["INPUT","TEXTAREA","SELECT"].includes(Z.tagName)&&(V&&clearTimeout(V),V=setTimeout(()=>{Z.scrollIntoView({block:"nearest",behavior:"smooth"});},320));};return g.addEventListener("focusin",ae),()=>{g.removeEventListener("focusin",ae),V&&clearTimeout(V);}},[i]);let J=Oe.useCallback(g=>{c&&(g.pointerType!=="touch"&&g.pointerType!=="pen"||(W.current&&(clearTimeout(W.current),W.current=null),H.current={isDragging:true,startY:g.clientY,startTime:Date.now(),pointerId:g.pointerId},E(false),g.currentTarget.setPointerCapture(g.pointerId)));},[c]),K=Oe.useCallback(g=>{let{isDragging:V,startY:ae,pointerId:me}=H.current;if(!V||g.pointerId!==me)return;let Z=g.clientY-ae;B(Math.max(0,Z));},[]),pe=Oe.useCallback(g=>{let{isDragging:V,startY:ae,startTime:me,pointerId:Z}=H.current;if(!V||g.pointerId!==Z)return;let Le=g.clientY-ae,It=Date.now()-me,Lt=Le/It;H.current={isDragging:false,startY:0,startTime:0,pointerId:null};let Mt=(ue.current?.getBoundingClientRect().height??0)*Ar;(Le>Mt||Lt>zr&&Le>50)&&c?(l?.(),B(0)):(E(true),B(0),W.current=setTimeout(()=>{E(false),W.current=null;},200));},[c,l]);if(!i)return null;let Ie=t||r,fe=u||x||C;return jsxRuntime.jsx(z,{children:jsxRuntime.jsx(Q,{isOpen:i,onOpenChange:g=>{g||l?.();},isDismissable:c,transparent:p,style:{paddingBottom:oe>0?`${oe}px`:void 0,transition:"padding-bottom 0.25s ease-out"},className:"flex items-end justify-center p-0 sm:p-4",children:jsxRuntime.jsx(reactAriaComponents.Modal,{className:"w-full max-w-full p-0 sm:p-2 outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0 focus-visible:ring-0",isDismissable:c,children:jsxRuntime.jsx("div",{ref:ue,className:tailwindMerge.twMerge("w-full",O&&"transition-transform duration-200"),style:{transform:j>0?`translateY(${j}px)`:void 0},children:jsxRuntime.jsxs(reactAriaComponents.Dialog,{className:tailwindMerge.twMerge("relative flex w-full flex-col overflow-hidden","bg-background-surface","shadow-2xl shadow-black/30 dark:shadow-black/60","border-t border-x border-border-default/40","outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0 focus-visible:ring-0 focus:shadow-none","origin-bottom",P==="scale"?"animate-[tray-enter-scale_400ms_cubic-bezier(0.32,0.72,0,1)]":"animate-[tray-enter_400ms_cubic-bezier(0.32,0.72,0,1)]",P==="scale"?"data-[exiting]:animate-[tray-exit-scale_250ms_cubic-bezier(0.32,0,0.67,0)]":"data-[exiting]:animate-[tray-exit_250ms_cubic-bezier(0.32,0,0.67,0)]",R),style:{maxWidth:M,...S?{height:S}:{maxHeight:/\d/.test(v)?G!==null?`min(${v}, ${Math.max(G-8,0)}px, 100dvh)`:`min(${v}, 100dvh)`:v}},children:[m&&jsxRuntime.jsx("div",{className:"absolute top-0 left-0 right-0 h-8 z-10 flex justify-center items-start pt-2 touch-none cursor-grab active:cursor-grabbing",onPointerDown:J,onPointerMove:K,onPointerUp:pe,onPointerCancel:pe,children:jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("h-1 w-12 rounded-full bg-border-muted transition-all duration-300","hover:bg-border-default hover:w-16",y&&"animate-[handle-wiggle_0.6s_ease-in-out]")})}),Ie&&(a?jsxRuntime.jsx(D,{title:t,headerContent:r,titleAlign:o,hideCloseIcon:n||!l,hasBackArrow:true,onBack:s??(()=>{}),onClose:l||(()=>{})}):jsxRuntime.jsx(D,{title:t,headerContent:r,titleAlign:o,hideCloseIcon:n||!l,onClose:l||(()=>{})})),jsxRuntime.jsx("div",{ref:ne,className:tailwindMerge.twMerge("flex-1 min-h-0 overflow-y-auto overscroll-contain",N?"p-4":"p-0"),children:e}),fe&&jsxRuntime.jsx(X,{primaryAction:u,secondaryAction:x,footerContent:C})]})})})})})}Re.displayName="Tray";function Ge({isOpen:e,onClose:t,title:r,headerContent:o,titleAlign:n="left",hideCloseIcon:a=false,hasBackArrow:s=false,onBack:i,children:l,primaryAction:c,secondaryAction:p,tertiaryAction:u,footerContent:x,transparentOverlay:C=false,maxWidth:v="600px",minWidth:S="400px",maxHeight:M="85vh",height:N,mobileMaxHeight:m="90vh",mobileHeight:P,contentPadding:R=true,className:y}){let k=Xe("(max-width: 767px)"),j=ve(k&&e===void 0),B=j?.height??null,O=j?.keyboardOffset??0,E=Oe.useRef(null),ce=Oe.useCallback(()=>{E.current&&E.current.scrollTop!==0&&(E.current.scrollTop=0);},[]),G=Oe.useRef(null),oe=Oe.useRef(null);Oe.useEffect(()=>{let J=oe.current;if(!J||!k)return;let K=null,pe=Ie=>{let fe=Ie.target;fe&&["INPUT","TEXTAREA","SELECT"].includes(fe.tagName)&&(K&&clearTimeout(K),K=setTimeout(()=>{fe.scrollIntoView({block:"nearest",behavior:"smooth"});},320));};return J.addEventListener("focusin",pe),()=>{J.removeEventListener("focusin",pe),K&&clearTimeout(K);}},[k]);let ue=Oe.useCallback(()=>{G.current&&G.current.scrollTop!==0&&(G.current.scrollTop=0);},[]);if(e===false)return null;let ne=r||o,W=c||p||u||x,H=e!==void 0;return k?H?jsxRuntime.jsx(Re,{isOpen:e,onClose:t,title:r,headerContent:o,titleAlign:n,hideCloseIcon:a,hasBackArrow:s,onBack:i,primaryAction:c,secondaryAction:p,footerContent:x,transparentOverlay:C,maxHeight:m,height:P,maxWidth:v,contentPadding:R,showHandle:true,animationVariant:"scale",className:y,children:l}):jsxRuntime.jsx(z,{children:jsxRuntime.jsx(Q,{isDismissable:true,transparent:C,style:{paddingBottom:O>0?`${O}px`:void 0,transition:"padding-bottom 0.25s ease-out"},className:"flex items-end justify-center",children:jsxRuntime.jsx(reactAriaComponents.Modal,{className:"w-full p-0 outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0 focus-visible:ring-0",children:jsxRuntime.jsxs(reactAriaComponents.Dialog,{ref:E,onScroll:ce,className:tailwindMerge.twMerge("relative flex w-full flex-col","bg-background-surface","shadow-2xl shadow-black/20","border-t border-x border-border-default/40","rounded-t-xl","overflow-hidden","animate-in slide-in-from-bottom","duration-300 ease-out","data-[exiting]:animate-out data-[exiting]:slide-out-to-bottom","data-[exiting]:duration-200 data-[exiting]:ease-in",y),style:{...P?{height:P}:{maxHeight:/\d/.test(m)?B!==null?`min(${m}, ${Math.max(B-8,0)}px, 100dvh)`:`min(${m}, 100dvh)`:m}},children:[jsxRuntime.jsx("div",{className:"flex justify-center pt-2",children:jsxRuntime.jsx("div",{className:"h-1.5 w-12 rounded-full bg-border-muted"})}),ne&&(s?jsxRuntime.jsx(D,{title:r,headerContent:o,titleAlign:n,hideCloseIcon:a||!t,hasBackArrow:true,onBack:i,onClose:t||(()=>{})}):jsxRuntime.jsx(D,{title:r,headerContent:o,titleAlign:n,hideCloseIcon:a||!t,onClose:t||(()=>{})})),jsxRuntime.jsx("div",{ref:oe,className:tailwindMerge.twMerge("flex-1 min-h-0 overflow-y-auto overscroll-contain",R?"px-6 py-6":"p-0"),children:l}),W&&jsxRuntime.jsx(X,{primaryAction:c,secondaryAction:p,tertiaryAction:u,footerContent:x})]})})})}):jsxRuntime.jsx(z,{children:jsxRuntime.jsx(Q,{...H?{isOpen:e,onOpenChange:J=>{!J&&t&&t();}}:{},isDismissable:true,transparent:C,className:"flex items-center justify-center",children:jsxRuntime.jsx(reactAriaComponents.Modal,{className:"w-full p-4 outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0 focus-visible:ring-0",style:{maxWidth:v},children:jsxRuntime.jsxs(reactAriaComponents.Dialog,{ref:G,onScroll:ue,className:tailwindMerge.twMerge("relative flex w-full flex-col","bg-background-surface","shadow-2xl shadow-black/20","border border-border-default/50","rounded-md","overflow-hidden","outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0","animate-in fade-in zoom-in-96 slide-in-from-bottom-2","duration-300 ease-out","data-[exiting]:animate-out data-[exiting]:fade-out data-[exiting]:zoom-out-95","data-[exiting]:duration-200 data-[exiting]:ease-in",y),style:{minWidth:S,...N?{height:N}:{maxHeight:M}},children:[ne&&(s?jsxRuntime.jsx(D,{title:r,headerContent:o,titleAlign:n,hideCloseIcon:a||!t,hasBackArrow:true,onBack:i,onClose:t||(()=>{})}):jsxRuntime.jsx(D,{title:r,headerContent:o,titleAlign:n,hideCloseIcon:a||!t,onClose:t||(()=>{})})),jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("flex-1 min-h-0 overflow-y-auto",R?"px-6 py-6":"p-0"),children:l}),W&&jsxRuntime.jsx(X,{primaryAction:c,secondaryAction:p,tertiaryAction:u,footerContent:x})]})})})})}function be(e){return jsxRuntime.jsx(reactAriaComponents.Form,{validationBehavior:"aria",...e,className:tailwindMerge.twMerge("flex flex-col gap-6",e.className)})}function Wa({formId:e="dialog-form",onSubmit:t,primaryLabel:r="Save",secondaryLabel:o="Cancel",onCancel:n,primaryVariant:a,secondaryVariant:s="secondary",children:i,title:l,...c}){return jsxRuntime.jsx(Ge,{title:l,primaryAction:{label:r,onPress:()=>{let u=document.getElementById(e);u&&u.requestSubmit();},variant:a},secondaryAction:n?{label:o,onPress:n,variant:s}:void 0,...c,children:jsxRuntime.jsx(be,{id:e,onSubmit:t,children:i})})}function Te({children:e,title:t,headerContent:r,titleAlign:o="left",hideCloseIcon:n=false,hasBackArrow:a=false,onBack:s,isOpen:i,slideInFrom:l="right",transparentOverlay:c=false,onClose:p,className:u,primaryAction:x,secondaryAction:C,tertiaryAction:v,footerContent:S,contentPadding:M=true,maxWidth:N="400px"}){if(!i)return null;let m=t||r,P=x||C||v||S;return jsxRuntime.jsx(z,{children:jsxRuntime.jsx(Q,{isOpen:i,onOpenChange:R=>!R&&p?.(),isDismissable:true,transparent:c,children:jsxRuntime.jsx(reactAriaComponents.Modal,{className:"outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0 focus-visible:ring-0",children:jsxRuntime.jsxs(reactAriaComponents.Dialog,{className:tailwindMerge.twMerge("fixed top-0 bottom-0 flex flex-col bg-background-surface shadow-xl overflow-hidden",l==="right"?"right-0":"left-0",l==="right"?"animate-in slide-in-from-right duration-300 ease-out":"animate-in slide-in-from-left duration-300 ease-out","data-[exiting]:animate-out",l==="right"?"data-[exiting]:slide-out-to-right":"data-[exiting]:slide-out-to-left","data-[exiting]:duration-200 data-[exiting]:ease-in","outline-none focus-visible:outline focus-visible:outline-2 focus-visible:outline-action-default focus-visible:outline-offset-0",u),style:{maxWidth:N,width:"100%"},children:[m&&(a&&s?jsxRuntime.jsx(D,{title:t,headerContent:r,titleAlign:o,hideCloseIcon:n,hasBackArrow:true,onBack:s,onClose:p}):jsxRuntime.jsx(D,{title:t,headerContent:r,titleAlign:o,hideCloseIcon:n,onClose:p})),jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("flex-1 overflow-y-auto overscroll-contain",M?"px-6 py-6":"p-0"),children:e}),P&&jsxRuntime.jsx(X,{primaryAction:x,secondaryAction:C,tertiaryAction:v,footerContent:S})]})})})})}Te.displayName="Drawer";function ri({formId:e="drawer-form",onSubmit:t,primaryLabel:r="Save",secondaryLabel:o="Cancel",onCancel:n,primaryVariant:a,secondaryVariant:s="secondary",children:i,...l}){return jsxRuntime.jsx(Te,{primaryAction:{label:r,onPress:()=>{let p=document.getElementById(e);p&&p.requestSubmit();},variant:a},secondaryAction:n?{label:o,onPress:n,variant:s}:void 0,...l,children:jsxRuntime.jsx(be,{id:e,onSubmit:t,className:"mt-2",children:i})})}function ii({align:e="end",className:t,...r}){return jsxRuntime.jsx("div",{...r,className:tailwindMerge.twMerge("flex gap-2",e==="start"?"justify-start":e==="between"?"justify-between":"justify-end",t)})}var Qr={sm:"gap-2",md:"gap-4",lg:"gap-6"};function Jr(e){if(!e)return "";let t=e.base?`grid-cols-${e.base}`:"",r=e.md?`md:grid-cols-${e.md}`:"",o=e.lg?`lg:grid-cols-${e.lg}`:"";return [t,r,o].filter(Boolean).join(" ")}function ci({cols:e={base:1},gap:t="lg",className:r,...o}){return jsxRuntime.jsx("div",{...o,className:tailwindMerge.twMerge("grid",Jr(e),Qr[t],r)})}var eo=Oe__namespace.default.forwardRef(({children:e,className:t},r)=>jsxRuntime.jsx("div",{ref:r,className:tailwindMerge.twMerge("relative w-full",t),children:e}));eo.displayName="InputWrapper";function Pt({size:e="md",className:t,children:r,...o}){return jsxRuntime.jsx("div",{...o,className:tailwindMerge.twMerge("leading-[2.25] text-text-secondary",ee[e].text,t),children:r})}function Ci({title:e,description:t,showDivider:r,className:o,children:n,...a}){return jsxRuntime.jsxs("section",{...a,className:tailwindMerge.twMerge("flex flex-col",o),children:[(e||t)&&jsxRuntime.jsxs("div",{className:"flex flex-col gap-1 mb-6",children:[typeof e=="string"?jsxRuntime.jsx(te,{tag:"h3",size:"sm",children:e}):e,t?jsxRuntime.jsx(Pt,{size:"lg",children:t}):null]}),jsxRuntime.jsx("div",{className:"flex flex-col gap-6",children:n}),r&&jsxRuntime.jsx("hr",{className:"mt-2 border-border-muted"})]})}function Pi(){return jsxRuntime.jsx("hr",{className:"border-border-muted"})}function Ti({steps:e,currentStepId:t,onStepClick:r,className:o}){let n=e.findIndex(a=>a.id===t);return jsxRuntime.jsx("nav",{"aria-label":"Progress",className:tailwindMerge.twMerge("w-full",o),children:jsxRuntime.jsx("div",{className:"relative mb-12",children:jsxRuntime.jsx("ol",{className:"relative flex items-start justify-between",children:e.map((a,s)=>{let i=a.id===t,l=s<n,c=r&&(l||i);return jsxRuntime.jsxs("li",{className:"relative flex flex-col items-center",style:{flex:`1 1 ${100/e.length}%`},children:[jsxRuntime.jsx("button",{type:"button",disabled:!c,onClick:()=>c&&r?.(a.id),className:tailwindMerge.twMerge("relative z-10 flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-full border-2 transition-colors bg-background-body",l&&"border-action-primary bg-action-primary text-text-inverse hover:bg-action-primary/90",i&&"border-action-primary bg-background-body text-action-primary",!l&&!i&&"border-border-default bg-background-body text-text-secondary",c&&"cursor-pointer",!c&&"cursor-default"),"aria-current":i?"step":void 0,children:l?jsxRuntime.jsx(I,{name:"Check",size:20,weight:"bold"}):jsxRuntime.jsx("span",{className:"text-sm font-semibold",children:s+1})}),s<e.length-1&&jsxRuntime.jsx("div",{className:"absolute top-5 h-0.5 transition-colors",style:{left:"50%",width:"100%",marginLeft:"20px",backgroundColor:s<n?"var(--color-action-primary)":"var(--color-border-default)"}}),jsxRuntime.jsxs("div",{className:"mt-3 flex flex-col items-center text-center w-32",children:[jsxRuntime.jsx("span",{className:tailwindMerge.twMerge("text-sm font-medium",i&&"text-text-default",l&&"text-text-primary",!i&&!l&&"text-text-secondary"),children:a.title}),a.description&&jsxRuntime.jsx("span",{className:"mt-1 text-xs text-text-secondary",children:a.description})]})]},a.id)})})})})}function Bi({formId:e,show:t,isSubmitting:r,onCancel:o,primaryLabel:n="Save changes",secondaryLabel:a="Cancel",className:s}){return t?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("fixed inset-x-0 bottom-0 z-40 border-t border-border-muted bg-background-surface/95 backdrop-blur supports-[backdrop-filter]:bg-background-surface/70",s),children:jsxRuntime.jsxs("div",{className:"mx-auto flex max-w-screen-lg items-center justify-between gap-3 p-3",children:[jsxRuntime.jsx("div",{className:"text-sm text-text-secondary",children:"You have unsaved changes"}),jsxRuntime.jsxs("div",{className:"flex gap-2",children:[jsxRuntime.jsx($,{variant:"secondary",onPress:o,children:a}),jsxRuntime.jsx($,{type:"submit",form:e,isDisabled:!!r,children:r?"Saving...":n})]})]})}):null}function Fi({when:e,message:t="You have unsaved changes. Leave anyway?"}){return Oe__namespace.useEffect(()=>{if(!e)return;let r=o=>(o.preventDefault(),o.returnValue=t,t);return window.addEventListener("beforeunload",r),()=>window.removeEventListener("beforeunload",r)},[e,t]),null}function zi({steps:e,initialStepId:t,canNavigate:r}){if(e.length===0)throw new Error("useWizard: steps array cannot be empty");let[o,n]=Oe__namespace.useState(t||e[0].id),a=e.findIndex(u=>u.id===o),s=a>0,i=a<e.length-1,l=async u=>u===o?true:r&&!await r(o,u)?false:(n(u),true);return {steps:e,currentStepId:o,setCurrentStepId:l,next:async()=>!i||a===-1?false:l(e[a+1].id),prev:async()=>!s||a===-1?false:l(e[a-1].id),hasNext:i,hasPrev:s,stepIndex:a}}
2
- exports.DialogForm=Wa;exports.DrawerForm=ri;exports.FormActions=ii;exports.FormDivider=Pi;exports.FormGrid=ci;exports.FormSection=Ci;exports.FormStepper=Ti;exports.SaveBar=Bi;exports.UnsavedChangesPrompt=Fi;exports.useWizard=zi;//# sourceMappingURL=index.cjs.map
1
+ 'use strict';var Oe=require('react'),reactAriaComponents=require('react-aria-components'),tailwindMerge=require('tailwind-merge'),jsxRuntime=require('react/jsx-runtime'),tt=require('@phosphor-icons/react');function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var Oe__namespace=/*#__PURE__*/_interopNamespace(Oe);var tt__namespace=/*#__PURE__*/_interopNamespace(tt);var Mt=Object.defineProperty;var Et=(e,t,r)=>t in e?Mt(e,t,{enumerable:true,configurable:true,writable:true,value:r}):e[t]=r;var Be=(e,t,r)=>Et(e,typeof t!="symbol"?t+"":t,r);function Xe(e,t=false){let[r,o]=Oe.useState(t);return Oe.useEffect(()=>{if(typeof window>"u")return;let n=window.matchMedia(e);o(n.matches);let a=s=>{o(s.matches);};return n.addEventListener("change",a),()=>{n.removeEventListener("change",a);}},[e]),r}function ve(e=true){let[t,r]=Oe.useState(null);return Oe.useEffect(()=>{if(!e){r(null);return}let o=typeof window<"u"?window.visualViewport:null;if(!o)return;let n=()=>{let a=Math.max(0,window.innerHeight-o.height-(o.offsetTop??0));r({height:o.height,keyboardOffset:a});};return n(),o.addEventListener("resize",n),o.addEventListener("scroll",n),()=>{o.removeEventListener("resize",n),o.removeEventListener("scroll",n);}},[e]),t}function ye(...e){return e.filter(Boolean).join(" ")}var F={displayXl:"text-display-xl",displayLg:"text-display-lg",displayMd:"text-display-md",displaySm:"text-display-sm",headingXl:"text-heading-xl",headingLg:"text-heading-lg",headingMd:"text-heading-md",headingSm:"text-heading-sm",bodyLg:"text-body-lg",bodyMd:"text-body-md",bodySm:"text-body-sm",labelLg:"text-label-lg",labelMd:"text-label-md",labelSm:"text-label-sm",code:"text-code",agent:"text-agent"};function Qe(e,...t){return ye(F[e],...t)}function Ke(e=false){return `${e?"outline outline-1 outline-border-input data-[focus-visible]:outline-2 data-[focus-visible]:outline-action-default data-[focus-visible]:outline-offset-0 invalid:outline-2 invalid:outline-feedback-error-border group-invalid:outline-2 group-invalid:outline-feedback-error-border forced-colors:focus:outline-[Highlight] forced-colors:focus:outline-2 forced-colors:focus:outline-offset-2":"outline-none data-[focus-visible]:outline data-[focus-visible]:outline-2 data-[focus-visible]:outline-action-default data-[focus-visible]:outline-offset-0 invalid:outline-2 invalid:outline-feedback-error-border group-invalid:outline-2 group-invalid:outline-feedback-error-border forced-colors:focus:outline-[Highlight] forced-colors:focus:outline-2 forced-colors:focus:outline-offset-2"}`}var ee={sm:{text:"text-[length:var(--control-text-sm)]",height:"h-[var(--control-sm-height)]",padding:"px-[var(--control-padding-sm)]",paddingY:"py-[var(--control-gap-sm)]",gap:"gap-[var(--control-gap-sm)]"},md:{text:"text-[length:var(--control-text-md)]",height:"h-[var(--control-md-height)]",padding:"px-[var(--control-padding-md)]",paddingY:"py-[var(--control-gap-md)]",gap:"gap-[var(--control-gap-md)]"},lg:{text:"text-[length:var(--control-text-lg)]",height:"h-[var(--control-lg-height)]",padding:"px-[var(--control-padding-lg)]",paddingY:"py-[var(--control-gap-lg)]",gap:"gap-[var(--control-gap-lg)]"},xl:{text:"text-[length:var(--control-text-xl)]",height:"h-[var(--control-xl-height)]",padding:"px-[var(--control-padding-xl)]",paddingY:"py-[var(--control-gap-xl)]",gap:"gap-[var(--control-gap-xl)]"}};function g(e,t){let r=Oe.forwardRef(({size:o=24,color:n="currentColor",className:a,mirrored:s,alt:i,...l},c)=>{let p=!!i||"aria-label"in l;return jsxRuntime.jsx("svg",{ref:c,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 256 256",fill:n,className:a,transform:s?"scale(-1, 1)":void 0,"aria-hidden":p?void 0:true,role:p?"img":void 0,"aria-label":i,...l,children:t})});return r.displayName=e,r}var we=()=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M12 128h44M200 128h44",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round"}),jsxRuntime.jsx("circle",{cx:"76",cy:"128",r:"20",fill:"none",stroke:"currentColor",strokeWidth:"16"}),jsxRuntime.jsx("circle",{cx:"180",cy:"128",r:"20",fill:"none",stroke:"currentColor",strokeWidth:"16"})]}),Je=()=>jsxRuntime.jsx("path",{d:"M166 120 88 70",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round"}),Ze=()=>jsxRuntime.jsx("path",{d:"M162 122 92 128",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round"}),et=()=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M112 85.7 A32 32 0 1 1 144 85.7",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round"}),jsxRuntime.jsx("circle",{cx:"128",cy:"58",r:"8",fill:"currentColor",stroke:"none"})]}),Wt=g("TextureRecloser",jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("rect",{x:"36",y:"36",width:"184",height:"184",fill:"none",stroke:"currentColor",strokeWidth:"16"}),jsxRuntime.jsx("text",{x:"128",y:"126",textAnchor:"middle",dominantBaseline:"central",fontFamily:"ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif",fontSize:"140",fontWeight:"700",fill:"currentColor",stroke:"none",children:"R"})]})),Vt=g("TextureFuse",jsxRuntime.jsx("path",{d:"M20 128h72q18 -84 36 0q18 84 36 0h72",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round",strokeLinejoin:"round"})),$t=g("TextureBreaker",jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("rect",{x:"36",y:"36",width:"184",height:"184",fill:"none",stroke:"currentColor",strokeWidth:"16"}),jsxRuntime.jsx("text",{x:"128",y:"126",textAnchor:"middle",dominantBaseline:"central",fontFamily:"ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif",fontSize:"140",fontWeight:"700",fill:"currentColor",stroke:"none",children:"B"})]})),Yt=g("TextureSource",jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M4 128h40M212 128h40",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round"}),jsxRuntime.jsx("circle",{cx:"128",cy:"128",r:"84",fill:"none",stroke:"currentColor",strokeWidth:"16"}),jsxRuntime.jsx("path",{d:"M92 128q18 -84 36 0q18 84 36 0",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round",strokeLinejoin:"round"})]})),jt=g("TextureCapacitor",jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx("path",{d:"M4 128h106M146 128h106M110 72v112M146 72v112",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round"})})),Ut=g("TextureRegulator",jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("circle",{cx:"128",cy:"128",r:"92",fill:"none",stroke:"currentColor",strokeWidth:"16"}),jsxRuntime.jsx("text",{x:"128",y:"126",textAnchor:"middle",dominantBaseline:"central",fontFamily:"ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif",fontSize:"128",fontWeight:"700",fill:"currentColor",stroke:"none",children:"V"})]})),Gt=g("TextureSwitch",jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(we,{}),jsxRuntime.jsx(Je,{})]})),qt=g("TextureSwitchClosed",jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(we,{}),jsxRuntime.jsx(Ze,{})]})),Xt=g("TextureOpenPoint",jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M112 52 C 74 92, 74 164, 112 204",fill:"none",stroke:"currentColor",strokeWidth:"18",strokeLinecap:"round"}),jsxRuntime.jsx("path",{d:"M144 52 C 182 92, 182 164, 144 204",fill:"none",stroke:"currentColor",strokeWidth:"18",strokeLinecap:"round"})]})),Qt=g("TextureSectionalizerOpen",jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(we,{}),jsxRuntime.jsx(Je,{}),jsxRuntime.jsx(et,{})]})),Kt=g("TextureSectionalizerClosed",jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(we,{}),jsxRuntime.jsx(Ze,{}),jsxRuntime.jsx(et,{})]})),Jt=g("TextureTransformer",jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M40 64H88A22 22 0 0 1 88 108A22 22 0 0 1 88 152A22 22 0 0 1 88 196H40",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{d:"M216 64H168A22 22 0 0 0 168 108A22 22 0 0 0 168 152A22 22 0 0 0 168 196H216",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round",strokeLinejoin:"round"})]})),ie={1:[128],2:[110,146],3:[92,128,164]},Me=e=>jsxRuntime.jsx("path",{d:`M24 ${e}h208`,fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round"},e),Ee=e=>jsxRuntime.jsx("path",{d:`M24 ${e}h208`,fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round",pathLength:100,strokeDasharray:"20 20"},e),Zt=g("TextureSinglePhaseOverheadLine",jsxRuntime.jsx(jsxRuntime.Fragment,{children:ie[1].map(Me)})),er=g("TextureTwoPhaseOverheadLine",jsxRuntime.jsx(jsxRuntime.Fragment,{children:ie[2].map(Me)})),tr=g("TextureThreePhaseOverheadLine",jsxRuntime.jsx(jsxRuntime.Fragment,{children:ie[3].map(Me)})),rr=g("TextureSinglePhaseUndergroundLine",jsxRuntime.jsx(jsxRuntime.Fragment,{children:ie[1].map(Ee)})),or=g("TextureTwoPhaseUndergroundLine",jsxRuntime.jsx(jsxRuntime.Fragment,{children:ie[2].map(Ee)})),nr=g("TextureThreePhaseUndergroundLine",jsxRuntime.jsx(jsxRuntime.Fragment,{children:ie[3].map(Ee)})),ar=g("TextureSupportStructure",jsxRuntime.jsx("circle",{cx:"128",cy:"128",r:"40",fill:"currentColor",stroke:"none"})),Ce={TextureRecloser:Wt,TextureFuse:Vt,TextureBreaker:$t,TextureSource:Yt,TextureCapacitor:jt,TextureRegulator:Ut,TextureSwitch:Gt,TextureSwitchClosed:qt,TextureOpenPoint:Xt,TextureSectionalizerOpen:Qt,TextureSectionalizerClosed:Kt,TextureTransformer:Jt,TextureSinglePhaseOverheadLine:Zt,TextureTwoPhaseOverheadLine:er,TextureThreePhaseOverheadLine:tr,TextureSinglePhaseUndergroundLine:rr,TextureTwoPhaseUndergroundLine:or,TextureThreePhaseUndergroundLine:nr,TextureSupportStructure:ar};if(process.env.NODE_ENV==="development")for(let e of Object.keys(Ce))e in tt__namespace&&console.error(`Custom icon "${e}" collides with a Phosphor icon of the same name. Rename it (use the "Texture" prefix) to keep the icon namespace unambiguous.`);var se={xs:16,sm:20,md:24,lg:32,xl:40,"2xl":48},D=Oe.memo(({name:e,size:t="md",color:r,weight:o="regular",className:n,ariaLabel:a,...s})=>{let i=Ce[e]??tt__namespace[e];if(!i)return process.env.NODE_ENV==="development"&&console.error(`Icon "${e}" not found in @phosphor-icons/react or the custom icon registry`),null;let l=typeof t=="string"&&t in se?se[t]:t,c=tailwindMerge.twMerge("inline-block flex-shrink-0",!r&&"text-current",n);return jsxRuntime.jsx(i,{...s,size:l,color:r,weight:o,className:c,"aria-label":a||`${e} icon`,"data-testid":`icon-${e}`})});D.displayName="Icon";var ir=Oe.memo(({variant:e="subtle",shape:t="square",containerSize:r,containerClassName:o,size:n="md",className:a,name:s,color:i,weight:l,ariaLabel:c,ref:p,...u})=>{let x=typeof n=="string"&&n in se?se[n]:n,C=r?typeof r=="string"&&r in se?se[r]:r:x*1.75,v=tailwindMerge.twMerge("inline-flex items-center justify-center flex-shrink-0",t==="circle"?"rounded-full":"rounded-lg",e==="subtle"&&"bg-background-muted",e==="solid"&&"bg-action-brand text-[color:var(--color-action-brand-text)]",e==="outline"&&"border-2 border-current",o);return jsxRuntime.jsx("div",{className:v,style:{width:C,height:C},children:jsxRuntime.jsx(D,{...u,name:s,size:n,color:i,weight:l,className:a,ariaLabel:c})})});ir.displayName="IconWithContainer";var dr="flex font-medium justify-center items-center gap-2 text-center transition rounded-[var(--control-border-radius)] whitespace-nowrap box-border",cr="bg-action-primary text-[color:var(--color-action-primary-text)] hover:bg-action-primary-hover forced-colors:bg-[ButtonText] forced-colors:text-[ButtonFace] border-2 border-transparent",ur={primary:cr,secondary:"bg-action-secondary text-[color:var(--color-action-secondary-text)] border-2 border-border-muted hover:bg-action-secondary-hover forced-colors:border-[ButtonBorder] forced-colors:bg-[ButtonFace] forced-colors:text-[ButtonText]",ghost:"border-none text-text-primary hover:bg-text-primary/5 forced-colors:text-[ButtonText] forced-colors:hover:bg-[ButtonFace]",destructive:"bg-transparent text-feedback-error-text border-2 border-border-muted hover:bg-feedback-error-background/50 forced-colors:border-[ButtonBorder] forced-colors:bg-[ButtonFace] forced-colors:text-[Mark]",link:"!text-action-primary hover:text-action-primary/90 hover:underline hover:decoration-2 hover:underline-offset-4",icon:"border-none text-text-primary hover:bg-background-hover hover:text-text-primary forced-colors:text-[ButtonText] forced-colors:hover:bg-[ButtonFace] p-1 flex-shrink-0 rounded-[var(--control-border-radius)]",unstyled:"bg-transparent"},at={full:"w-full",default:"w-fit"},pr="opacity-50 cursor-not-allowed pointer-events-none",fr="opacity-100 cursor-pointer",mr={"top-right":"-right-2 -top-2","top-left":"-left-2 -top-2","bottom-right":"-right-2 -bottom-2","bottom-left":"-left-2 -bottom-2"},hr={primary:"bg-action-primary text-[color:var(--color-action-primary-text)]",destructive:"bg-feedback-error-border text-text-inverse"};function gr(e){return !e||e==="default"||e==="brand"?"primary":e}function br(e){let{variant:t="primary",size:r="md",isDisabled:o,fullWidth:n=false,isLoading:a=false}=e,s=gr(t),i=s==="unstyled"?"":`${dr} ${ur[s]}`;s!=="unstyled"&&(i+=` ${ee[r].text} ${ee[r].height} ${ee[r].padding} ${ee[r].gap}`),o||a?i+=` ${pr}`:i+=` ${fr}`,n?i+=` ${at.full}`:i+=` ${at.default}`;let l=s==="primary"?"focus-visible:outline-action-primary":void 0;return [i,Ke(),l].filter(Boolean).join(" ")}function $(e){let{icon:t,children:r,isLoading:o=false,loadingText:n,loadingIndicator:a,size:s="md",iconPosition:i="left",iconWeight:l,href:c,className:p,badgeNumber:u,badgeVariant:x="primary",badgePosition:C="top-right",style:v,target:T,rel:B,...N}=e,m=t?jsxRuntime.jsx(D,{name:t,size:s,weight:l}):null,k=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[i==="left"&&m,typeof r=="function"?null:r,i==="right"&&m]}),R=jsxRuntime.jsxs("div",{className:"relative inline-flex items-center justify-center",children:[jsxRuntime.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:a||jsxRuntime.jsx(D,{name:"CircleNotch",size:s,className:"animate-spin","aria-hidden":"true"})}),jsxRuntime.jsx("div",{className:"invisible","aria-hidden":"true",children:k}),n&&jsxRuntime.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:n})]}),y=(u??0)>0,P=tailwindMerge.twMerge(br(e),p),U=c?{href:c,target:T,rel:B,...N}:{};if(c){let{onPress:O,onPressStart:E,onPressEnd:ce,onPressChange:G,onPressUp:oe,onAuxClick:ue,onContextMenu:ne,onDoubleClick:W,...H}=N;Object.assign(U,H);}let M=c?jsxRuntime.jsx(reactAriaComponents.Link,{...U,...o&&{"aria-busy":true},style:y?void 0:v,className:P,children:o?R:typeof r=="function"?(function(O){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[i==="left"&&m,r(O),i==="right"&&m]})}):k}):jsxRuntime.jsx(reactAriaComponents.Button,{...N,...o&&{"aria-busy":true},style:y?void 0:v,className:P,children:o?R:typeof r=="function"?(function(O){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[i==="left"&&m,r(O),i==="right"&&m]})}):k});return y?jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("relative flex",p),style:v,children:[M,jsxRuntime.jsx("span",{className:`absolute ${mr[C]} flex h-5 w-5 items-center justify-center rounded-full ${hr[x]} text-xs font-medium`,"aria-label":`${u} items`,children:u})]}):M}function Ae({action:e,defaultVariant:t,defaultSize:r="lg"}){let o=!!e.formId;return jsxRuntime.jsx($,{type:o?"submit":"button",form:o?e.formId:void 0,size:e.size||r,variant:e.variant||t,onPress:o?void 0:e.onPress,isLoading:e.isLoading,isDisabled:e.isDisabled,children:e.label})}function X({primaryAction:e,secondaryAction:t,tertiaryAction:r,footerContent:o}){let n=e||t||r;return !n&&!o?null:jsxRuntime.jsxs("div",{className:`flex w-full flex-col items-center justify-center border-t p-4 ${o?"h-28":""}`,children:[o&&jsxRuntime.jsx("div",{className:"flex h-10 justify-center",children:o}),n&&jsxRuntime.jsxs("div",{className:"flex w-full items-center justify-between gap-3",children:[jsxRuntime.jsx("div",{children:r&&jsxRuntime.jsx(Ae,{action:r,defaultVariant:"destructive"})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[t&&jsxRuntime.jsx(Ae,{action:t,defaultVariant:"secondary"}),e&&jsxRuntime.jsx(Ae,{action:e,defaultVariant:"primary"})]})]})]})}var xr={heading:{sm:F.headingSm,md:F.headingMd,lg:F.headingLg,xl:F.headingXl},display:{sm:F.displaySm,md:F.displayMd,lg:F.displayLg,xl:F.displayXl}},vr={page:"h-16 leading-[62px]"};function te({tag:e="h1",variant:t="heading",size:r="lg",height:o,className:n="",children:a}){let s=r==="xs"?"sm":r,i=xr[t][s],l=o?vr[o]:"";return jsxRuntime.jsx(e,{className:ye(i,"text-text-primary",l,n),children:a})}var I=({title:e,onClose:t,hideCloseIcon:r=false,titleAlign:o="left",hasBackArrow:n=false,onBack:a,headerContent:s})=>jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("relative flex h-16 w-full flex-shrink-0 items-center justify-between border-b px-6",e&&"border-b",o==="center"?"justify-center":""),children:[n&&jsxRuntime.jsx($,{variant:"icon",onPress:a,className:"absolute left-6","aria-label":"Go back",children:jsxRuntime.jsx(D,{name:"CaretLeft","data-testid":"back-arrow"})}),s||jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[e&&jsxRuntime.jsx(te,{size:"xs",children:e}),t&&!r&&jsxRuntime.jsx($,{variant:"icon",onPress:t,"aria-label":"Close dialog",children:jsxRuntime.jsx(D,{name:"X","data-testid":"close-button"})})]})]});var kr=Oe.createContext(false);Oe.createContext(null);function lt({children:e}){return jsxRuntime.jsx(kr.Provider,{value:true,children:e})}var L=({width:e,height:t,variant:r="rect",animation:o="pulse",gradient:n=false,flex:a=false,stack:s,responsive:i,delay:l=0,adjustAnimationSpeedBasedOnWidth:c=false,ariaLabel:p,className:u,"data-testid":x})=>{let[C,v]=Oe.useState(l===0);if(Oe.useEffect(()=>{if(l>0){let y=setTimeout(()=>v(true),l);return ()=>clearTimeout(y)}},[l]),!C)return null;let T=n?"bg-gradient-to-r from-[var(--color-skeleton-base)] via-[var(--color-skeleton-highlight)] to-[var(--color-skeleton-base)]":"bg-[var(--color-skeleton-base)]",B=c&&e?(()=>{let y=typeof e=="number"?e:parseFloat(String(e));return isNaN(y)?"":`animation-duration-[${Math.max(.8,y/100)}s]`})():"",N=o==="pulse"?`animate-pulse ${B}`:o==="wave"?`relative overflow-hidden before:absolute before:inset-0 before:bg-gradient-to-r before:from-transparent before:via-[var(--color-skeleton-wave)] before:to-transparent before:animate-wave ${B}`:"",m="rounded-sm";r==="circle"&&(m="rounded-full"),r==="text"&&(m="h-4 w-full rounded-sm");let k=a?"flex-1 min-w-0":"",R=i?Object.entries(i).map(([y,P])=>`${y}:w-[${P}]`).join(" "):"";return s?jsxRuntime.jsx("div",{className:"space-y-2","data-testid":x,children:s.map((y,P)=>jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(T,N,m,k,R,u),style:{width:y,height:t}},P))}):jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(T,N,m,k,R,u),style:{width:e,height:t},role:"presentation","aria-hidden":!p,"aria-label":p??void 0,"data-testid":x})};var Tr={outlined:"bg-background-surface border border-border-default",elevated:"bg-background-surface border-0 shadow-md",filled:"bg-background-muted border-0",ghost:"bg-transparent border-0 shadow-none"},Sr="rounded-lg",We={square:"aspect-square",video:"aspect-video",wide:"aspect-[2/1]",auto:""},Ir={start:"justify-start",end:"justify-end",center:"justify-center",between:"justify-between"};function ct(e){return Oe__namespace.default.Children.toArray(e).some(t=>Oe__namespace.default.isValidElement(t)?t.type===Oe__namespace.default.Fragment?ct(t.props.children):t.type===Ve&&!!t.props.title:false)}function Y({variant:e="outlined",className:t,children:r,isLoading:o=false,layout:n="default"}){let a=ct(r)?jsxRuntime.jsx(lt,{children:r}):r;return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("w-full overflow-hidden",Tr[e],Sr,n==="flex"&&"flex flex-col",t),"data-testid":"card",children:o?jsxRuntime.jsx(L,{width:"100%",height:"100%",className:"rounded-none"}):a})}function Ve({title:e,subtitle:t,actions:r,leading:o,className:n,isLoading:a=false}){return a?jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("p-6 pb-4",n),children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-1",children:[jsxRuntime.jsx(L,{width:120,height:20}),jsxRuntime.jsx(L,{width:24,height:24})]}),t&&jsxRuntime.jsx(L,{width:200,height:16})]}):!e&&!t&&!r&&!o?null:jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("p-6 pb-4",n),children:jsxRuntime.jsxs("div",{className:"flex justify-between items-start gap-4",children:[o&&jsxRuntime.jsx("div",{className:"flex-shrink-0",children:o}),jsxRuntime.jsxs("div",{className:"min-w-0 flex-1",children:[e&&jsxRuntime.jsx("div",{className:"mb-1",children:typeof e=="string"?jsxRuntime.jsx(te,{tag:"h3",size:"sm",className:"text-text-primary",children:e}):e}),t&&jsxRuntime.jsx("div",{className:Qe("bodySm","text-text-secondary"),children:t})]}),r&&jsxRuntime.jsx("div",{className:"flex-shrink-0",children:r})]})})}function ut({src:e,alt:t,aspectRatio:r="auto",className:o,children:n,isLoading:a=false}){return a?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("bg-background-muted",We[r],o),children:jsxRuntime.jsx(L,{width:"100%",height:"100%"})}):n?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("overflow-hidden",We[r],o),children:n}):e?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("overflow-hidden",We[r],o),children:jsxRuntime.jsx("img",{src:e,alt:t||"",className:"w-full h-full object-cover",loading:"lazy"})}):null}function pt({className:e,children:t,isLoading:r=false,fill:o=false,style:n}){let s=e?.match(/p(?:t|b|l|r|x|y)?-(?:\d+(?:\.\d+)?|px|\[.+?\])/)?"":"px-6 py-4";return r?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(s,o&&"flex-1 flex flex-col min-h-0",e),style:n,children:jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(L,{width:"100%",height:16}),jsxRuntime.jsx(L,{width:"80%",height:16}),jsxRuntime.jsx(L,{width:"60%",height:16})]})}):t?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(s,"text-text-primary",o&&"flex-1 flex flex-col min-h-0",e),style:n,children:t}):null}function ft({className:e,children:t,align:r="end",isLoading:o=false}){return o?jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("px-6 py-4 flex gap-2 justify-end",e),children:[jsxRuntime.jsx(L,{width:80,height:32}),jsxRuntime.jsx(L,{width:60,height:32})]}):t?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("px-6 py-4 flex items-center gap-2",Ir[r],e),children:t}):null}Y.Header=Ve;Y.Media=ut;Y.Content=pt;Y.Footer=ft;var _=class extends Oe.Component{constructor(){super(...arguments);Be(this,"state",{hasError:false});Be(this,"handleRetry",()=>{this.setState({hasError:false,error:void 0}),typeof window<"u"&&window.location.reload();});}static getDerivedStateFromError(r){return {hasError:true,error:r}}componentDidCatch(r,o){console.error("Error Boundary caught an error:",r,o);}render(){return this.state.hasError?this.props.fallback?this.props.fallback:jsxRuntime.jsxs(Y,{children:[this.props.title&&jsxRuntime.jsx(Y.Header,{title:this.props.title}),jsxRuntime.jsx(Y.Content,{children:jsxRuntime.jsxs("div",{className:"flex flex-col items-center justify-center gap-4","data-testid":"error-boundary",children:[jsxRuntime.jsx("p",{className:"text-feedback-error-text",children:this.state.error?.message||"Something went wrong"}),jsxRuntime.jsx("button",{className:"rounded bg-action-default px-4 py-2 text-[color:var(--color-action-default-text)] hover:bg-action-default-hover",onClick:this.handleRetry,children:"Retry"})]})})]}):this.props.children}};function Q({transparent:e=false,className:t,children:r,...o}){return jsxRuntime.jsx(reactAriaComponents.ModalOverlay,{...o,className:reactAriaComponents.composeRenderProps(t,(n,a)=>tailwindMerge.twMerge("fixed inset-0 z-50","outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0 focus-visible:ring-0",e?"bg-transparent":["bg-gradient-to-br from-background-modal/20 via-background-modal/15 to-background-modal/20","backdrop-blur-[2px]","supports-[backdrop-filter]:bg-background-modal/15"].join(" "),a.isEntering&&["animate-in fade-in","duration-300 ease-out"].join(" "),a.isExiting&&["animate-out fade-out","duration-200 ease-in"].join(" "),n)),children:r})}var Ar=.3,_r=.5;function Re({children:e,title:t,headerContent:r,titleAlign:o="left",hideCloseIcon:n=false,hasBackArrow:a=false,onBack:s,isOpen:i,onClose:l,isDismissable:c=true,transparentOverlay:p=false,primaryAction:u,secondaryAction:x,footerContent:C,maxHeight:v="80vh",height:T,maxWidth:B="640px",contentPadding:N=true,showHandle:m=true,animationVariant:k="scale",className:R}){let[y,P]=Oe.useState(false),[U,M]=Oe.useState(0),[O,E]=Oe.useState(false),ce=ve(i),G=ce?.height??null,oe=ce?.keyboardOffset??0,ue=Oe.useRef(null),ne=Oe.useRef(null),W=Oe.useRef(null),H=Oe.useRef({isDragging:false,startY:0,startTime:0,pointerId:null});Oe.useEffect(()=>{if(i){let h=setTimeout(()=>{P(true),setTimeout(()=>P(false),600);},400);return ()=>clearTimeout(h)}},[i]),Oe.useEffect(()=>{i||(M(0),E(false),H.current={isDragging:false,startY:0,startTime:0,pointerId:null});},[i]),Oe.useEffect(()=>{let h=ne.current;if(!h||!i)return;let V=null,ae=me=>{let Z=me.target;Z&&["INPUT","TEXTAREA","SELECT"].includes(Z.tagName)&&(V&&clearTimeout(V),V=setTimeout(()=>{Z.scrollIntoView({block:"nearest",behavior:"smooth"});},320));};return h.addEventListener("focusin",ae),()=>{h.removeEventListener("focusin",ae),V&&clearTimeout(V);}},[i]);let K=Oe.useCallback(h=>{c&&(h.pointerType!=="touch"&&h.pointerType!=="pen"||(W.current&&(clearTimeout(W.current),W.current=null),H.current={isDragging:true,startY:h.clientY,startTime:Date.now(),pointerId:h.pointerId},E(false),h.currentTarget.setPointerCapture(h.pointerId)));},[c]),J=Oe.useCallback(h=>{let{isDragging:V,startY:ae,pointerId:me}=H.current;if(!V||h.pointerId!==me)return;let Z=h.clientY-ae;M(Math.max(0,Z));},[]),pe=Oe.useCallback(h=>{let{isDragging:V,startY:ae,startTime:me,pointerId:Z}=H.current;if(!V||h.pointerId!==Z)return;let Le=h.clientY-ae,Dt=Date.now()-me,Lt=Le/Dt;H.current={isDragging:false,startY:0,startTime:0,pointerId:null};let Bt=(ue.current?.getBoundingClientRect().height??0)*Ar;(Le>Bt||Lt>_r&&Le>50)&&c?(l?.(),M(0)):(E(true),M(0),W.current=setTimeout(()=>{E(false),W.current=null;},200));},[c,l]);if(!i)return null;let De=t||r,fe=u||x||C;return jsxRuntime.jsx(_,{children:jsxRuntime.jsx(Q,{isOpen:i,onOpenChange:h=>{h||l?.();},isDismissable:c,transparent:p,style:{paddingBottom:oe>0?`${oe}px`:void 0,transition:"padding-bottom 0.25s ease-out"},className:"flex items-end justify-center p-0 sm:p-4",children:jsxRuntime.jsx(reactAriaComponents.Modal,{className:"w-full max-w-full p-0 sm:p-2 outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0 focus-visible:ring-0",isDismissable:c,children:jsxRuntime.jsx("div",{ref:ue,className:tailwindMerge.twMerge("w-full",O&&"transition-transform duration-200"),style:{transform:U>0?`translateY(${U}px)`:void 0},children:jsxRuntime.jsxs(reactAriaComponents.Dialog,{className:tailwindMerge.twMerge("relative flex w-full flex-col overflow-hidden","bg-background-surface","shadow-2xl shadow-black/30 dark:shadow-black/60","border-t border-x border-border-default/40","outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0 focus-visible:ring-0 focus:shadow-none","origin-bottom",k==="scale"?"animate-[tray-enter-scale_400ms_cubic-bezier(0.32,0.72,0,1)]":"animate-[tray-enter_400ms_cubic-bezier(0.32,0.72,0,1)]",k==="scale"?"data-[exiting]:animate-[tray-exit-scale_250ms_cubic-bezier(0.32,0,0.67,0)]":"data-[exiting]:animate-[tray-exit_250ms_cubic-bezier(0.32,0,0.67,0)]",R),style:{maxWidth:B,...T?{height:T}:{maxHeight:/\d/.test(v)?G!==null?`min(${v}, ${Math.max(G-8,0)}px, 100dvh)`:`min(${v}, 100dvh)`:v}},children:[m&&jsxRuntime.jsx("div",{className:"absolute top-0 left-0 right-0 h-8 z-10 flex justify-center items-start pt-2 touch-none cursor-grab active:cursor-grabbing",onPointerDown:K,onPointerMove:J,onPointerUp:pe,onPointerCancel:pe,children:jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("h-1 w-12 rounded-full bg-border-muted transition-all duration-300","hover:bg-border-default hover:w-16",y&&"animate-[handle-wiggle_0.6s_ease-in-out]")})}),De&&(a?jsxRuntime.jsx(I,{title:t,headerContent:r,titleAlign:o,hideCloseIcon:n||!l,hasBackArrow:true,onBack:s??(()=>{}),onClose:l||(()=>{})}):jsxRuntime.jsx(I,{title:t,headerContent:r,titleAlign:o,hideCloseIcon:n||!l,onClose:l||(()=>{})})),jsxRuntime.jsx("div",{ref:ne,className:tailwindMerge.twMerge("flex-1 min-h-0 overflow-y-auto overscroll-contain",N?"p-4":"p-0"),children:e}),fe&&jsxRuntime.jsx(X,{primaryAction:u,secondaryAction:x,footerContent:C})]})})})})})}Re.displayName="Tray";function Ge({isOpen:e,onClose:t,title:r,headerContent:o,titleAlign:n="left",hideCloseIcon:a=false,hasBackArrow:s=false,onBack:i,children:l,primaryAction:c,secondaryAction:p,tertiaryAction:u,footerContent:x,transparentOverlay:C=false,maxWidth:v="600px",minWidth:T="400px",maxHeight:B="85vh",height:N,mobileMaxHeight:m="90vh",mobileHeight:k,contentPadding:R=true,className:y}){let P=Xe("(max-width: 767px)"),U=ve(P&&e===void 0),M=U?.height??null,O=U?.keyboardOffset??0,E=Oe.useRef(null),ce=Oe.useCallback(()=>{E.current&&E.current.scrollTop!==0&&(E.current.scrollTop=0);},[]),G=Oe.useRef(null),oe=Oe.useRef(null);Oe.useEffect(()=>{let K=oe.current;if(!K||!P)return;let J=null,pe=De=>{let fe=De.target;fe&&["INPUT","TEXTAREA","SELECT"].includes(fe.tagName)&&(J&&clearTimeout(J),J=setTimeout(()=>{fe.scrollIntoView({block:"nearest",behavior:"smooth"});},320));};return K.addEventListener("focusin",pe),()=>{K.removeEventListener("focusin",pe),J&&clearTimeout(J);}},[P]);let ue=Oe.useCallback(()=>{G.current&&G.current.scrollTop!==0&&(G.current.scrollTop=0);},[]);if(e===false)return null;let ne=r||o,W=c||p||u||x,H=e!==void 0;return P?H?jsxRuntime.jsx(Re,{isOpen:e,onClose:t,title:r,headerContent:o,titleAlign:n,hideCloseIcon:a,hasBackArrow:s,onBack:i,primaryAction:c,secondaryAction:p,footerContent:x,transparentOverlay:C,maxHeight:m,height:k,maxWidth:v,contentPadding:R,showHandle:true,animationVariant:"scale",className:y,children:l}):jsxRuntime.jsx(_,{children:jsxRuntime.jsx(Q,{isDismissable:true,transparent:C,style:{paddingBottom:O>0?`${O}px`:void 0,transition:"padding-bottom 0.25s ease-out"},className:"flex items-end justify-center",children:jsxRuntime.jsx(reactAriaComponents.Modal,{className:"w-full p-0 outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0 focus-visible:ring-0",children:jsxRuntime.jsxs(reactAriaComponents.Dialog,{ref:E,onScroll:ce,className:tailwindMerge.twMerge("relative flex w-full flex-col","bg-background-surface","shadow-2xl shadow-black/20","border-t border-x border-border-default/40","rounded-t-xl","overflow-hidden","animate-in slide-in-from-bottom","duration-300 ease-out","data-[exiting]:animate-out data-[exiting]:slide-out-to-bottom","data-[exiting]:duration-200 data-[exiting]:ease-in",y),style:{...k?{height:k}:{maxHeight:/\d/.test(m)?M!==null?`min(${m}, ${Math.max(M-8,0)}px, 100dvh)`:`min(${m}, 100dvh)`:m}},children:[jsxRuntime.jsx("div",{className:"flex justify-center pt-2",children:jsxRuntime.jsx("div",{className:"h-1.5 w-12 rounded-full bg-border-muted"})}),ne&&(s?jsxRuntime.jsx(I,{title:r,headerContent:o,titleAlign:n,hideCloseIcon:a||!t,hasBackArrow:true,onBack:i,onClose:t||(()=>{})}):jsxRuntime.jsx(I,{title:r,headerContent:o,titleAlign:n,hideCloseIcon:a||!t,onClose:t||(()=>{})})),jsxRuntime.jsx("div",{ref:oe,className:tailwindMerge.twMerge("flex-1 min-h-0 overflow-y-auto overscroll-contain",R?"px-6 py-6":"p-0"),children:l}),W&&jsxRuntime.jsx(X,{primaryAction:c,secondaryAction:p,tertiaryAction:u,footerContent:x})]})})})}):jsxRuntime.jsx(_,{children:jsxRuntime.jsx(Q,{...H?{isOpen:e,onOpenChange:K=>{!K&&t&&t();}}:{},isDismissable:true,transparent:C,className:"flex items-center justify-center",children:jsxRuntime.jsx(reactAriaComponents.Modal,{className:"w-full p-4 outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0 focus-visible:ring-0",style:{maxWidth:v},children:jsxRuntime.jsxs(reactAriaComponents.Dialog,{ref:G,onScroll:ue,className:tailwindMerge.twMerge("relative flex w-full flex-col","bg-background-surface","shadow-2xl shadow-black/20","border border-border-default/50","rounded-md","overflow-hidden","outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0","animate-in fade-in zoom-in-96 slide-in-from-bottom-2","duration-300 ease-out","data-[exiting]:animate-out data-[exiting]:fade-out data-[exiting]:zoom-out-95","data-[exiting]:duration-200 data-[exiting]:ease-in",y),style:{minWidth:T,...N?{height:N}:{maxHeight:B}},children:[ne&&(s?jsxRuntime.jsx(I,{title:r,headerContent:o,titleAlign:n,hideCloseIcon:a||!t,hasBackArrow:true,onBack:i,onClose:t||(()=>{})}):jsxRuntime.jsx(I,{title:r,headerContent:o,titleAlign:n,hideCloseIcon:a||!t,onClose:t||(()=>{})})),jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("flex-1 min-h-0 overflow-y-auto",R?"px-6 py-6":"p-0"),children:l}),W&&jsxRuntime.jsx(X,{primaryAction:c,secondaryAction:p,tertiaryAction:u,footerContent:x})]})})})})}function be(e){return jsxRuntime.jsx(reactAriaComponents.Form,{validationBehavior:"aria",...e,className:tailwindMerge.twMerge("flex flex-col gap-6",e.className)})}function Wa({formId:e="dialog-form",onSubmit:t,primaryLabel:r="Save",secondaryLabel:o="Cancel",onCancel:n,primaryVariant:a,secondaryVariant:s="secondary",children:i,title:l,...c}){return jsxRuntime.jsx(Ge,{title:l,primaryAction:{label:r,onPress:()=>{let u=document.getElementById(e);u&&u.requestSubmit();},variant:a},secondaryAction:n?{label:o,onPress:n,variant:s}:void 0,...c,children:jsxRuntime.jsx(be,{id:e,onSubmit:t,children:i})})}function Se({children:e,title:t,headerContent:r,titleAlign:o="left",hideCloseIcon:n=false,hasBackArrow:a=false,onBack:s,isOpen:i,slideInFrom:l="right",transparentOverlay:c=false,onClose:p,className:u,primaryAction:x,secondaryAction:C,tertiaryAction:v,footerContent:T,contentPadding:B=true,maxWidth:N="400px"}){if(!i)return null;let m=t||r,k=x||C||v||T;return jsxRuntime.jsx(_,{children:jsxRuntime.jsx(Q,{isOpen:i,onOpenChange:R=>!R&&p?.(),isDismissable:true,transparent:c,children:jsxRuntime.jsx(reactAriaComponents.Modal,{className:"outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0 focus-visible:ring-0",children:jsxRuntime.jsxs(reactAriaComponents.Dialog,{className:tailwindMerge.twMerge("fixed top-0 bottom-0 flex flex-col bg-background-surface shadow-xl overflow-hidden",l==="right"?"right-0":"left-0",l==="right"?"animate-in slide-in-from-right duration-300 ease-out":"animate-in slide-in-from-left duration-300 ease-out","data-[exiting]:animate-out",l==="right"?"data-[exiting]:slide-out-to-right":"data-[exiting]:slide-out-to-left","data-[exiting]:duration-200 data-[exiting]:ease-in","outline-none focus-visible:outline focus-visible:outline-2 focus-visible:outline-action-default focus-visible:outline-offset-0",u),style:{maxWidth:N,width:"100%"},children:[m&&(a&&s?jsxRuntime.jsx(I,{title:t,headerContent:r,titleAlign:o,hideCloseIcon:n,hasBackArrow:true,onBack:s,onClose:p}):jsxRuntime.jsx(I,{title:t,headerContent:r,titleAlign:o,hideCloseIcon:n,onClose:p})),jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("flex-1 overflow-y-auto overscroll-contain",B?"px-6 py-6":"p-0"),children:e}),k&&jsxRuntime.jsx(X,{primaryAction:x,secondaryAction:C,tertiaryAction:v,footerContent:T})]})})})})}Se.displayName="Drawer";function ri({formId:e="drawer-form",onSubmit:t,primaryLabel:r="Save",secondaryLabel:o="Cancel",onCancel:n,primaryVariant:a,secondaryVariant:s="secondary",children:i,...l}){return jsxRuntime.jsx(Se,{primaryAction:{label:r,onPress:()=>{let p=document.getElementById(e);p&&p.requestSubmit();},variant:a},secondaryAction:n?{label:o,onPress:n,variant:s}:void 0,...l,children:jsxRuntime.jsx(be,{id:e,onSubmit:t,className:"mt-2",children:i})})}function ii({align:e="end",className:t,...r}){return jsxRuntime.jsx("div",{...r,className:tailwindMerge.twMerge("flex gap-2",e==="start"?"justify-start":e==="between"?"justify-between":"justify-end",t)})}var Qr={sm:"gap-2",md:"gap-4",lg:"gap-6"};function Kr(e){if(!e)return "";let t=e.base?`grid-cols-${e.base}`:"",r=e.md?`md:grid-cols-${e.md}`:"",o=e.lg?`lg:grid-cols-${e.lg}`:"";return [t,r,o].filter(Boolean).join(" ")}function ci({cols:e={base:1},gap:t="lg",className:r,...o}){return jsxRuntime.jsx("div",{...o,className:tailwindMerge.twMerge("grid",Kr(e),Qr[t],r)})}var eo=Oe__namespace.default.forwardRef(({children:e,className:t},r)=>jsxRuntime.jsx("div",{ref:r,className:tailwindMerge.twMerge("relative w-full",t),children:e}));eo.displayName="InputWrapper";function kt({size:e="md",className:t,children:r,...o}){return jsxRuntime.jsx("div",{...o,className:tailwindMerge.twMerge("leading-[2.25] text-text-secondary",ee[e].text,t),children:r})}function Ci({title:e,description:t,showDivider:r,className:o,children:n,...a}){return jsxRuntime.jsxs("section",{...a,className:tailwindMerge.twMerge("flex flex-col",o),children:[(e||t)&&jsxRuntime.jsxs("div",{className:"flex flex-col gap-1 mb-6",children:[typeof e=="string"?jsxRuntime.jsx(te,{tag:"h3",size:"sm",children:e}):e,t?jsxRuntime.jsx(kt,{size:"lg",children:t}):null]}),jsxRuntime.jsx("div",{className:"flex flex-col gap-6",children:n}),r&&jsxRuntime.jsx("hr",{className:"mt-2 border-border-muted"})]})}function ki(){return jsxRuntime.jsx("hr",{className:"border-border-muted"})}function Si({steps:e,currentStepId:t,onStepClick:r,className:o}){let n=e.findIndex(a=>a.id===t);return jsxRuntime.jsx("nav",{"aria-label":"Progress",className:tailwindMerge.twMerge("w-full",o),children:jsxRuntime.jsx("div",{className:"relative mb-12",children:jsxRuntime.jsx("ol",{className:"relative flex items-start justify-between",children:e.map((a,s)=>{let i=a.id===t,l=s<n,c=r&&(l||i);return jsxRuntime.jsxs("li",{className:"relative flex flex-col items-center",style:{flex:`1 1 ${100/e.length}%`},children:[jsxRuntime.jsx("button",{type:"button",disabled:!c,onClick:()=>c&&r?.(a.id),className:tailwindMerge.twMerge("relative z-10 flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-full border-2 transition-colors bg-background-body",l&&"border-action-primary bg-action-primary text-text-inverse hover:bg-action-primary/90",i&&"border-action-primary bg-background-body text-action-primary",!l&&!i&&"border-border-default bg-background-body text-text-secondary",c&&"cursor-pointer",!c&&"cursor-default"),"aria-current":i?"step":void 0,children:l?jsxRuntime.jsx(D,{name:"Check",size:20,weight:"bold"}):jsxRuntime.jsx("span",{className:"text-sm font-semibold",children:s+1})}),s<e.length-1&&jsxRuntime.jsx("div",{className:"absolute top-5 h-0.5 transition-colors",style:{left:"50%",width:"100%",marginLeft:"20px",backgroundColor:s<n?"var(--color-action-primary)":"var(--color-border-default)"}}),jsxRuntime.jsxs("div",{className:"mt-3 flex flex-col items-center text-center w-32",children:[jsxRuntime.jsx("span",{className:tailwindMerge.twMerge("text-sm font-medium",i&&"text-text-default",l&&"text-text-primary",!i&&!l&&"text-text-secondary"),children:a.title}),a.description&&jsxRuntime.jsx("span",{className:"mt-1 text-xs text-text-secondary",children:a.description})]})]},a.id)})})})})}function Mi({formId:e,show:t,isSubmitting:r,onCancel:o,primaryLabel:n="Save changes",secondaryLabel:a="Cancel",className:s}){return t?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("fixed inset-x-0 bottom-0 z-40 border-t border-border-muted bg-background-surface/95 backdrop-blur supports-[backdrop-filter]:bg-background-surface/70",s),children:jsxRuntime.jsxs("div",{className:"mx-auto flex max-w-screen-lg items-center justify-between gap-3 p-3",children:[jsxRuntime.jsx("div",{className:"text-sm text-text-secondary",children:"You have unsaved changes"}),jsxRuntime.jsxs("div",{className:"flex gap-2",children:[jsxRuntime.jsx($,{variant:"secondary",onPress:o,children:a}),jsxRuntime.jsx($,{type:"submit",form:e,isDisabled:!!r,children:r?"Saving...":n})]})]})}):null}function Fi({when:e,message:t="You have unsaved changes. Leave anyway?"}){return Oe__namespace.useEffect(()=>{if(!e)return;let r=o=>(o.preventDefault(),o.returnValue=t,t);return window.addEventListener("beforeunload",r),()=>window.removeEventListener("beforeunload",r)},[e,t]),null}function _i({steps:e,initialStepId:t,canNavigate:r}){if(e.length===0)throw new Error("useWizard: steps array cannot be empty");let[o,n]=Oe__namespace.useState(t||e[0].id),a=e.findIndex(u=>u.id===o),s=a>0,i=a<e.length-1,l=async u=>u===o?true:r&&!await r(o,u)?false:(n(u),true);return {steps:e,currentStepId:o,setCurrentStepId:l,next:async()=>!i||a===-1?false:l(e[a+1].id),prev:async()=>!s||a===-1?false:l(e[a-1].id),hasNext:i,hasPrev:s,stepIndex:a}}
2
+ exports.DialogForm=Wa;exports.DrawerForm=ri;exports.FormActions=ii;exports.FormDivider=ki;exports.FormGrid=ci;exports.FormSection=Ci;exports.FormStepper=Si;exports.SaveBar=Mi;exports.UnsavedChangesPrompt=Fi;exports.useWizard=_i;//# sourceMappingURL=index.cjs.map
3
3
  //# sourceMappingURL=index.cjs.map