@texturehq/edges 3.2.0 → 5.0.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.
@@ -1,3 +1,3 @@
1
- 'use strict';var reactHookForm=require('react-hook-form'),st=require('react'),reactAria=require('react-aria'),reactAriaComponents=require('react-aria-components'),reactStately=require('react-stately'),tailwindMerge=require('tailwind-merge'),Vo=require('@phosphor-icons/react'),jsxRuntime=require('react/jsx-runtime'),lucideReact=require('lucide-react'),reactColorful=require('react-colorful'),Zi=require('@tiptap/extension-link'),react=require('@tiptap/react'),menus=require('@tiptap/react/menus'),rs=require('@tiptap/starter-kit');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}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 st__namespace=/*#__PURE__*/_interopNamespace(st);var Vo__namespace=/*#__PURE__*/_interopNamespace(Vo);var Zi__default=/*#__PURE__*/_interopDefault(Zi);var rs__default=/*#__PURE__*/_interopDefault(rs);var Er=Object.defineProperty;var Vr=(e,r,t)=>r in e?Er(e,r,{enumerable:true,configurable:true,writable:true,value:t}):e[r]=t;var Lt=(e,r,t)=>Vr(e,typeof r!="symbol"?r+"":r,t);function _e(e,r=false){let[t,o]=st.useState(r);return st.useEffect(()=>{if(typeof window>"u")return;let n=window.matchMedia(e);o(n.matches);let a=i=>{o(i.matches);};return n.addEventListener("change",a),()=>{n.removeEventListener("change",a);}},[e]),t}var Ze={sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"};function pt(e="base"){let r=_e(`(min-width: ${Ze.sm})`,e!=="base"),t=_e(`(min-width: ${Ze.md})`,["md","lg","xl","2xl"].includes(e)),o=_e(`(min-width: ${Ze.lg})`,["lg","xl","2xl"].includes(e)),n=_e(`(min-width: ${Ze.xl})`,["xl","2xl"].includes(e)),a=_e(`(min-width: ${Ze["2xl"]})`,e==="2xl"),i=!t,s=t,d="base";return a?d="2xl":n?d="xl":o?d="lg":t?d="md":r&&(d="sm"),{current:d,isSm:r,isMd:t,isLg:o,isXl:n,is2Xl:a,isMobile:i,isDesktop:s}}function So(e,r=300){let[t,o]=st.useState(e);return st.useEffect(()=>{let n=setTimeout(()=>o(e),r);return ()=>clearTimeout(n)},[e,r]),t}function ft(e,r=300){let[t,o]=st.useState(false);return st.useEffect(()=>{if(e){let n=setTimeout(()=>{o(true);},r);return ()=>clearTimeout(n)}o(false);},[e,r]),t}function gt(...e){return e.filter(Boolean).join(" ")}var Pe={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 wo(e,...r){return gt(Pe[e],...r)}function Be(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"}`}function G(e,r){return reactAriaComponents.composeRenderProps(e,t=>tailwindMerge.twMerge(r,t))}var q={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 K(e,r){let t=st.forwardRef(({size:o=24,color:n="currentColor",className:a,mirrored:i,alt:s,...d},u)=>{let c=!!s||"aria-label"in d;return jsxRuntime.jsx("svg",{ref:u,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 256 256",fill:n,className:a,transform:i?"scale(-1, 1)":void 0,"aria-hidden":c?void 0:true,role:c?"img":void 0,"aria-label":s,...d,children:r})});return t.displayName=e,t}var xt=()=>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"})]}),Io=()=>jsxRuntime.jsx("path",{d:"M166 120 88 70",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round"}),Bo=()=>jsxRuntime.jsx("path",{d:"M162 122 92 128",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round"}),Eo=()=>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"})]}),$r=K("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"})]})),qr=K("TextureFuse",jsxRuntime.jsx("path",{d:"M20 128h72q18 -84 36 0q18 84 36 0h72",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round",strokeLinejoin:"round"})),Ur=K("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"})]})),Kr=K("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"})]})),Yr=K("TextureCapacitor",jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx("path",{d:"M4 128h106M146 128h106M110 72v112M146 72v112",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round"})})),jr=K("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"})]})),Qr=K("TextureSwitch",jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(xt,{}),jsxRuntime.jsx(Io,{})]})),Xr=K("TextureSwitchClosed",jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(xt,{}),jsxRuntime.jsx(Bo,{})]})),Jr=K("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"})]})),Zr=K("TextureSectionalizerOpen",jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(xt,{}),jsxRuntime.jsx(Io,{}),jsxRuntime.jsx(Eo,{})]})),en=K("TextureSectionalizerClosed",jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(xt,{}),jsxRuntime.jsx(Bo,{}),jsxRuntime.jsx(Eo,{})]})),tn=K("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"})]})),ze={1:[128],2:[110,146],3:[92,128,164]},Dt=e=>jsxRuntime.jsx("path",{d:`M24 ${e}h208`,fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round"},e),At=e=>jsxRuntime.jsx("path",{d:`M24 ${e}h208`,fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round",pathLength:100,strokeDasharray:"20 20"},e),on=K("TextureSinglePhaseOverheadLine",jsxRuntime.jsx(jsxRuntime.Fragment,{children:ze[1].map(Dt)})),rn=K("TextureTwoPhaseOverheadLine",jsxRuntime.jsx(jsxRuntime.Fragment,{children:ze[2].map(Dt)})),nn=K("TextureThreePhaseOverheadLine",jsxRuntime.jsx(jsxRuntime.Fragment,{children:ze[3].map(Dt)})),an=K("TextureSinglePhaseUndergroundLine",jsxRuntime.jsx(jsxRuntime.Fragment,{children:ze[1].map(At)})),sn=K("TextureTwoPhaseUndergroundLine",jsxRuntime.jsx(jsxRuntime.Fragment,{children:ze[2].map(At)})),ln=K("TextureThreePhaseUndergroundLine",jsxRuntime.jsx(jsxRuntime.Fragment,{children:ze[3].map(At)})),dn=K("TextureSupportStructure",jsxRuntime.jsx("circle",{cx:"128",cy:"128",r:"40",fill:"currentColor",stroke:"none"})),bt={TextureRecloser:$r,TextureFuse:qr,TextureBreaker:Ur,TextureSource:Kr,TextureCapacitor:Yr,TextureRegulator:jr,TextureSwitch:Qr,TextureSwitchClosed:Xr,TextureOpenPoint:Jr,TextureSectionalizerOpen:Zr,TextureSectionalizerClosed:en,TextureTransformer:tn,TextureSinglePhaseOverheadLine:on,TextureTwoPhaseOverheadLine:rn,TextureThreePhaseOverheadLine:nn,TextureSinglePhaseUndergroundLine:an,TextureTwoPhaseUndergroundLine:sn,TextureThreePhaseUndergroundLine:ln,TextureSupportStructure:dn};if(process.env.NODE_ENV==="development")for(let e of Object.keys(bt))e in Vo__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 He={xs:16,sm:20,md:24,lg:32,xl:40,"2xl":48},y=st.memo(({name:e,size:r="md",color:t,weight:o="regular",className:n,ariaLabel:a,...i})=>{let s=bt[e]??Vo__namespace[e];if(!s)return process.env.NODE_ENV==="development"&&console.error(`Icon "${e}" not found in @phosphor-icons/react or the custom icon registry`),null;let d=typeof r=="string"&&r in He?He[r]:r,u=tailwindMerge.twMerge("inline-block flex-shrink-0",!t&&"text-current",n);return jsxRuntime.jsx(s,{...i,size:d,color:t,weight:o,className:u,"aria-label":a||`${e} icon`,"data-testid":`icon-${e}`})});y.displayName="Icon";var cn=st.memo(({variant:e="subtle",shape:r="square",containerSize:t,containerClassName:o,size:n="md",className:a,name:i,color:s,weight:d,ariaLabel:u,ref:c,...l})=>{let g=typeof n=="string"&&n in He?He[n]:n,v=t?typeof t=="string"&&t in He?He[t]:t:g*1.75,m=tailwindMerge.twMerge("inline-flex items-center justify-center flex-shrink-0",r==="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:m,style:{width:v,height:v},children:jsxRuntime.jsx(y,{...l,name:i,size:n,color:s,weight:d,className:a,ariaLabel:u})})});cn.displayName="IconWithContainer";var gn=({isEntering:e,isExiting:r,className:t})=>["max-w-[200px] group bg-action-default border border-action-default-hover text-[color:var(--color-action-default-text)] text-sm rounded-lg drop-shadow-lg will-change-transform px-3 py-1",e?"animate-in fade-in placement-bottom:slide-in-from-top-0.5 placement-top:slide-in-from-bottom-0.5 placement-left:slide-in-from-right-0.5 placement-right:slide-in-from-left-0.5 ease-out duration-200":"",r?"animate-out fade-out placement-bottom:slide-out-to-top-0.5 placement-top:slide-out-to-bottom-0.5 placement-left:slide-out-to-right-0.5 placement-right:slide-out-to-left-0.5 ease-in duration-150":"",t].filter(Boolean).join(" ");function Mo({children:e,content:r,...t}){return jsxRuntime.jsxs(reactAriaComponents.TooltipTrigger,{delay:200,children:[e,jsxRuntime.jsxs(reactAriaComponents.Tooltip,{...t,offset:10,className:reactAriaComponents.composeRenderProps(t.className,(o,n)=>gn({...n,className:o})),children:[jsxRuntime.jsx(reactAriaComponents.OverlayArrow,{children:jsxRuntime.jsx("svg",{width:8,height:8,viewBox:"0 0 8 8",className:"fill-action-default stroke-action-default-hover group-placement-left:-rotate-90 group-placement-right:rotate-90 group-placement-bottom:rotate-180 forced-colors:fill-[Canvas] forced-colors:stroke-[ButtonBorder]",children:jsxRuntime.jsx("path",{d:"M0 0 L4 4 L8 0"})})}),r]})]})}function ke(){let[e,r]=st__namespace.default.useState(false),t=st__namespace.default.useCallback((n,a)=>{r(true),a?.(n);},[]),o=st__namespace.default.useCallback((n,a)=>{r(false),a?.(n);},[]);return {isFocused:e,handleFocus:t,handleBlur:o}}var oe=st__namespace.default.forwardRef(({children:e,className:r},t)=>jsxRuntime.jsx("div",{ref:t,className:tailwindMerge.twMerge("relative w-full",r),children:e}));oe.displayName="InputWrapper";function et({onClick:e,size:r="md",className:t}){return jsxRuntime.jsx("button",{type:"button",onClick:o=>{o.preventDefault(),o.stopPropagation(),e();},className:tailwindMerge.twMerge("absolute right-2 top-[48%] -translate-y-1/2 transform text-text-secondary hover:text-text-primary cursor-pointer",t),"aria-label":"Clear input",onMouseDown:o=>{o.preventDefault(),o.stopPropagation();},children:jsxRuntime.jsx(y,{name:"X",size:r==="sm"?16:20})})}function tt(e){let{isInvalid:r,isDisabled:t,isFocused:o}=e,n="border rounded-[var(--control-border-radius)] !outline-none ";return t?`${n} border-border-muted`:r&&o?`${n} border-feedback-error-border shadow-[inset_0_0_0_1px_var(--color-feedback-error-border)]`:r?`${n} border-feedback-error-border`:o?`${n} border-border-focus shadow-[inset_0_0_0_1px_var(--color-border-focus)]`:`${n} border-border-input`}function xn(e){return e.isDisabled?"bg-background-muted":e.transparent?"bg-transparent":"bg-background-input"}function bn(e){return e==="sm"?"!text-base md:!text-[length:var(--control-text-sm)]":e==="md"?"!text-base md:!text-[length:var(--control-text-md)]":""}function ae(e){let{isInvalid:r,isDisabled:t,isFocused:o,transparent:n,size:a="md",className:i}=e;return tailwindMerge.twMerge("w-full",tt({isInvalid:r,isDisabled:t,isFocused:o}),xn({transparent:n,isDisabled:t}),q[a].text,q[a].height,q[a].padding,bn(a),i)}function W({children:e,size:r="md",tooltip:t,description:o,descriptionPlacement:n="below",isRequired:a,className:i,htmlFor:s}){let d=t||o&&n==="tooltip",u=t||o,c=o&&n==="inline",l=jsxRuntime.jsxs("label",{htmlFor:s,className:tailwindMerge.twMerge(q[r].text,"!text-text-label font-semibold flex items-center gap-1",i),children:[e,a&&jsxRuntime.jsx("span",{children:"*"}),d&&jsxRuntime.jsx("span",{className:"inline-flex items-center text-text-secondary",children:jsxRuntime.jsx(y,{name:"Info",size:r==="sm"?16:20})}),c&&jsxRuntime.jsx("span",{className:"text-text-secondary font-normal ml-1",children:o})]});return d&&u?jsxRuntime.jsx(Mo,{content:u,children:l}):l}function I({size:e="md",className:r,children:t,...o}){return jsxRuntime.jsx("div",{...o,className:tailwindMerge.twMerge("leading-[2.25] text-text-secondary",q[e].text,r),children:t})}function f({children:e,size:r="md",className:t}){return jsxRuntime.jsx("div",{role:"alert",className:tailwindMerge.twMerge(q[r].text,"text-feedback-error-text",t),children:e})}function yt({size:e="md",isInvalid:r,isDisabled:t,isFocused:o,transparent:n,className:a,...i}){return jsxRuntime.jsx("input",{className:ae({isInvalid:r,isDisabled:t,isFocused:o,transparent:n,size:e,className:a}),...i})}var Pn="flex font-medium justify-center items-center gap-2 text-center transition rounded-[var(--control-border-radius)] whitespace-nowrap box-border",Cn="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",Rn={primary:Cn,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"},zo={full:"w-full",default:"w-fit"},Fn="opacity-50 cursor-not-allowed pointer-events-none",Tn="opacity-100 cursor-pointer",Nn={"top-right":"-right-2 -top-2","top-left":"-left-2 -top-2","bottom-right":"-right-2 -bottom-2","bottom-left":"-left-2 -bottom-2"},kn={primary:"bg-action-primary text-[color:var(--color-action-primary-text)]",destructive:"bg-feedback-error-border text-text-inverse"};function Sn(e){return !e||e==="default"||e==="brand"?"primary":e}function wn(e){let{variant:r="primary",size:t="md",isDisabled:o,fullWidth:n=false,isLoading:a=false}=e,i=Sn(r),s=i==="unstyled"?"":`${Pn} ${Rn[i]}`;i!=="unstyled"&&(s+=` ${q[t].text} ${q[t].height} ${q[t].padding} ${q[t].gap}`),o||a?s+=` ${Fn}`:s+=` ${Tn}`,n?s+=` ${zo.full}`:s+=` ${zo.default}`;let d=i==="primary"?"focus-visible:outline-action-primary":void 0;return [s,Be(),d].filter(Boolean).join(" ")}function T(e){let{icon:r,children:t,isLoading:o=false,loadingText:n,loadingIndicator:a,size:i="md",iconPosition:s="left",iconWeight:d,href:u,className:c,badgeNumber:l,badgeVariant:g="primary",badgePosition:v="top-right",style:m,target:p,rel:C,...R}=e,P=r?jsxRuntime.jsx(y,{name:r,size:i,weight:d}):null,V=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[s==="left"&&P,typeof t=="function"?null:t,s==="right"&&P]}),A=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(y,{name:"CircleNotch",size:i,className:"animate-spin","aria-hidden":"true"})}),jsxRuntime.jsx("div",{className:"invisible","aria-hidden":"true",children:V}),n&&jsxRuntime.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:n})]}),B=(l??0)>0,F=tailwindMerge.twMerge(wn(e),c),k=u?{href:u,target:p,rel:C,...R}:{};if(u){let{onPress:S,onPressStart:ne,onPressEnd:z,onPressChange:ce,onPressUp:X,onAuxClick:U,onContextMenu:de,onDoubleClick:H,...h}=R;Object.assign(k,h);}let Q=u?jsxRuntime.jsx(reactAriaComponents.Link,{...k,...o&&{"aria-busy":true},style:B?void 0:m,className:F,children:o?A:typeof t=="function"?(function(S){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[s==="left"&&P,t(S),s==="right"&&P]})}):V}):jsxRuntime.jsx(reactAriaComponents.Button,{...R,...o&&{"aria-busy":true},style:B?void 0:m,className:F,children:o?A:typeof t=="function"?(function(S){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[s==="left"&&P,t(S),s==="right"&&P]})}):V});return B?jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("relative flex",c),style:m,children:[Q,jsxRuntime.jsx("span",{className:`absolute ${Nn[v]} flex h-5 w-5 items-center justify-center rounded-full ${kn[g]} text-xs font-medium`,"aria-label":`${l} items`,children:l})]}):Q}function Ee({transparent:e=false,className:r,children:t,...o}){return jsxRuntime.jsx(reactAriaComponents.ModalOverlay,{...o,className:reactAriaComponents.composeRenderProps(r,(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:t})}function Hn({isEntering:e,isExiting:r,className:t="",disableGroup:o=false}){let n=[!o&&"group","bg-background-surface","forced-colors:bg-[Canvas]","shadow-lg","rounded-[var(--control-border-radius)]","bg-clip-padding","border","border-border-default","outline-none"].filter(Boolean).join(" "),a=e?["animate-in","fade-in","placement-bottom:slide-in-from-top-1","placement-top:slide-in-from-bottom-1","placement-left:slide-in-from-right-1","placement-right:slide-in-from-left-1","ease-out","duration-200"].join(" "):"",i=r?["animate-out","fade-out","placement-bottom:slide-out-to-top-1","placement-top:slide-out-to-bottom-1","placement-left:slide-out-to-right-1","placement-right:slide-out-to-left-1","ease-in","duration-150"].join(" "):"";return [n,a,i,t].filter(Boolean).join(" ")}function Ge({children:e,showArrow:r=false,withBackdrop:t=false,className:o,isDismissable:n=true,disableGroup:a=false,...i}){let d=reactAriaComponents.useSlottedContext(reactAriaComponents.PopoverContext)?.trigger==="SubmenuTrigger",u=r?12:8;u=d?u-6:u;let c=jsxRuntime.jsxs(reactAriaComponents.Popover,{offset:u,...i,className:reactAriaComponents.composeRenderProps(o,(l,g)=>Hn({...g,className:l,disableGroup:a})),children:[r&&jsxRuntime.jsx(reactAriaComponents.OverlayArrow,{children:jsxRuntime.jsx("svg",{width:12,height:12,viewBox:"0 0 12 12",className:"block fill-background-surface stroke-border-default stroke-1 group-placement-left:-rotate-90 group-placement-right:rotate-90 group-placement-bottom:rotate-180 forced-colors:fill-[Canvas] forced-colors:stroke-[ButtonBorder]",children:jsxRuntime.jsx("path",{d:"M0 0 L6 6 L12 0"})})}),e]});return t?jsxRuntime.jsx(Ee,{isDismissable:n,children:jsxRuntime.jsx(reactAriaComponents.Modal,{className:"outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0 focus-visible:ring-0",isDismissable:n,children:c})}):c}function Ho(e=true){let[r,t]=st.useState(null);return st.useEffect(()=>{if(!e){t(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));t({height:o.height,keyboardOffset:a});};return n(),o.addEventListener("resize",n),o.addEventListener("scroll",n),()=>{o.removeEventListener("resize",n),o.removeEventListener("scroll",n);}},[e]),r}function Ht({action:e,defaultVariant:r,defaultSize:t="lg"}){let o=!!e.formId;return jsxRuntime.jsx(T,{type:o?"submit":"button",form:o?e.formId:void 0,size:e.size||t,variant:e.variant||r,onPress:o?void 0:e.onPress,isLoading:e.isLoading,isDisabled:e.isDisabled,children:e.label})}function Gt({primaryAction:e,secondaryAction:r,tertiaryAction:t,footerContent:o}){let n=e||r||t;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:t&&jsxRuntime.jsx(Ht,{action:t,defaultVariant:"destructive"})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[r&&jsxRuntime.jsx(Ht,{action:r,defaultVariant:"secondary"}),e&&jsxRuntime.jsx(Ht,{action:e,defaultVariant:"primary"})]})]})]})}var $n={heading:{sm:Pe.headingSm,md:Pe.headingMd,lg:Pe.headingLg,xl:Pe.headingXl},display:{sm:Pe.displaySm,md:Pe.displayMd,lg:Pe.displayLg,xl:Pe.displayXl}},qn={page:"h-16 leading-[62px]"};function nt({tag:e="h1",variant:r="heading",size:t="lg",height:o,className:n="",children:a}){let i=t==="xs"?"sm":t,s=$n[r][i],d=o?qn[o]:"";return jsxRuntime.jsx(e,{className:gt(s,"text-text-primary",d,n),children:a})}var $e=({title:e,onClose:r,hideCloseIcon:t=false,titleAlign:o="left",hasBackArrow:n=false,onBack:a,headerContent:i})=>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(T,{variant:"icon",onPress:a,className:"absolute left-6","aria-label":"Go back",children:jsxRuntime.jsx(y,{name:"CaretLeft","data-testid":"back-arrow"})}),i||jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[e&&jsxRuntime.jsx(nt,{size:"xs",children:e}),r&&!t&&jsxRuntime.jsx(T,{variant:"icon",onPress:r,"aria-label":"Close dialog",children:jsxRuntime.jsx(y,{name:"X","data-testid":"close-button"})})]})]});var xe=({width:e,height:r,variant:t="rect",animation:o="pulse",gradient:n=false,flex:a=false,stack:i,responsive:s,delay:d=0,adjustAnimationSpeedBasedOnWidth:u=false,ariaLabel:c,className:l,"data-testid":g})=>{let[v,m]=st.useState(d===0);if(st.useEffect(()=>{if(d>0){let B=setTimeout(()=>m(true),d);return ()=>clearTimeout(B)}},[d]),!v)return null;let p=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)]",C=u&&e?(()=>{let B=typeof e=="number"?e:parseFloat(String(e));return isNaN(B)?"":`animation-duration-[${Math.max(.8,B/100)}s]`})():"",R=o==="pulse"?`animate-pulse ${C}`: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 ${C}`:"",P="rounded-sm";t==="circle"&&(P="rounded-full"),t==="text"&&(P="h-4 w-full rounded-sm");let V=a?"flex-1 min-w-0":"",A=s?Object.entries(s).map(([B,F])=>`${B}:w-[${F}]`).join(" "):"";return i?jsxRuntime.jsx("div",{className:"space-y-2","data-testid":g,children:i.map((B,F)=>jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(p,R,P,V,A,l),style:{width:B,height:r}},F))}):jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(p,R,P,V,A,l),style:{width:e,height:r},role:"presentation","aria-hidden":!c,"aria-label":c??void 0,"data-testid":g})};var Xn={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"},Jn="rounded-lg",$t={square:"aspect-square",video:"aspect-video",wide:"aspect-[2/1]",auto:""},Zn={start:"justify-start",end:"justify-end",center:"justify-center",between:"justify-between"};function be({variant:e="outlined",className:r,children:t,isLoading:o=false,layout:n="default"}){return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("w-full overflow-hidden",Xn[e],Jn,n==="flex"&&"flex flex-col",r),"data-testid":"card",children:o?jsxRuntime.jsx(xe,{width:"100%",height:"100%",className:"rounded-none"}):t})}function vt({title:e,subtitle:r,actions:t,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(xe,{width:120,height:20}),jsxRuntime.jsx(xe,{width:24,height:24})]}),r&&jsxRuntime.jsx(xe,{width:200,height:16})]}):!e&&!r&&!t&&!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(nt,{tag:"h3",size:"sm",className:"text-text-primary",children:e}):e}),r&&jsxRuntime.jsx("div",{className:wo("bodySm","text-text-secondary"),children:r})]}),t&&jsxRuntime.jsx("div",{className:"flex-shrink-0",children:t})]})})}function Wo({src:e,alt:r,aspectRatio:t="auto",className:o,children:n,isLoading:a=false}){return a?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("bg-background-muted",$t[t],o),children:jsxRuntime.jsx(xe,{width:"100%",height:"100%"})}):n?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("overflow-hidden",$t[t],o),children:n}):e?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("overflow-hidden",$t[t],o),children:jsxRuntime.jsx("img",{src:e,alt:r||"",className:"w-full h-full object-cover",loading:"lazy"})}):null}function Pt({className:e,children:r,isLoading:t=false,fill:o=false,style:n}){let i=e?.match(/p(?:t|b|l|r|x|y)?-(?:\d+(?:\.\d+)?|px|\[.+?\])/)?"":"px-6 py-4";return t?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(i,o&&"flex-1 flex flex-col min-h-0",e),style:n,children:jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(xe,{width:"100%",height:16}),jsxRuntime.jsx(xe,{width:"80%",height:16}),jsxRuntime.jsx(xe,{width:"60%",height:16})]})}):r?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(i,"text-text-primary",o&&"flex-1 flex flex-col min-h-0",e),style:n,children:r}):null}function $o({className:e,children:r,align:t="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(xe,{width:80,height:32}),jsxRuntime.jsx(xe,{width:60,height:32})]}):r?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("px-6 py-4 flex items-center gap-2",Zn[t],e),children:r}):null}be.Header=vt;be.Media=Wo;be.Content=Pt;be.Footer=$o;var it=class extends st.Component{constructor(){super(...arguments);Lt(this,"state",{hasError:false});Lt(this,"handleRetry",()=>{this.setState({hasError:false,error:void 0}),typeof window<"u"&&window.location.reload();});}static getDerivedStateFromError(t){return {hasError:true,error:t}}componentDidCatch(t,o){console.error("Error Boundary caught an error:",t,o);}render(){return this.state.hasError?this.props.fallback?this.props.fallback:jsxRuntime.jsxs(be,{children:[this.props.title&&jsxRuntime.jsx(be.Header,{title:this.props.title}),jsxRuntime.jsx(be.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}};var ra=.3,na=.5;function Ue({children:e,title:r,headerContent:t,titleAlign:o="left",hideCloseIcon:n=false,hasBackArrow:a=false,onBack:i,isOpen:s,onClose:d,isDismissable:u=true,transparentOverlay:c=false,primaryAction:l,secondaryAction:g,footerContent:v,maxHeight:m="80vh",height:p,maxWidth:C="640px",contentPadding:R=true,showHandle:P=true,animationVariant:V="scale",className:A}){let[B,F]=st.useState(false),[k,Q]=st.useState(0),[S,ne]=st.useState(false),z=Ho(s),ce=z?.height??null,X=z?.keyboardOffset??0,U=st.useRef(null),de=st.useRef(null),H=st.useRef(null),h=st.useRef({isDragging:false,startY:0,startTime:0,pointerId:null});st.useEffect(()=>{if(s){let b=setTimeout(()=>{F(true),setTimeout(()=>F(false),600);},400);return ()=>clearTimeout(b)}},[s]),st.useEffect(()=>{s||(Q(0),ne(false),h.current={isDragging:false,startY:0,startTime:0,pointerId:null});},[s]),st.useEffect(()=>{let b=de.current;if(!b||!s)return;let Y=null,O=Z=>{let ye=Z.target;ye&&["INPUT","TEXTAREA","SELECT"].includes(ye.tagName)&&(Y&&clearTimeout(Y),Y=setTimeout(()=>{ye.scrollIntoView({block:"nearest",behavior:"smooth"});},320));};return b.addEventListener("focusin",O),()=>{b.removeEventListener("focusin",O),Y&&clearTimeout(Y);}},[s]);let Ie=st.useCallback(b=>{u&&(b.pointerType!=="touch"&&b.pointerType!=="pen"||(H.current&&(clearTimeout(H.current),H.current=null),h.current={isDragging:true,startY:b.clientY,startTime:Date.now(),pointerId:b.pointerId},ne(false),b.currentTarget.setPointerCapture(b.pointerId)));},[u]),Te=st.useCallback(b=>{let{isDragging:Y,startY:O,pointerId:Z}=h.current;if(!Y||b.pointerId!==Z)return;let ye=b.clientY-O;Q(Math.max(0,ye));},[]),ue=st.useCallback(b=>{let{isDragging:Y,startY:O,startTime:Z,pointerId:ye}=h.current;if(!Y||b.pointerId!==ye)return;let ee=b.clientY-O,Me=Date.now()-Z,Je=ee/Me;h.current={isDragging:false,startY:0,startTime:0,pointerId:null};let mt=(U.current?.getBoundingClientRect().height??0)*ra;(ee>mt||Je>na&&ee>50)&&u?(d?.(),Q(0)):(ne(true),Q(0),H.current=setTimeout(()=>{ne(false),H.current=null;},200));},[u,d]);if(!s)return null;let Fe=r||t,Ne=l||g||v;return jsxRuntime.jsx(it,{children:jsxRuntime.jsx(Ee,{isOpen:s,onOpenChange:b=>{b||d?.();},isDismissable:u,transparent:c,style:{paddingBottom:X>0?`${X}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:u,children:jsxRuntime.jsx("div",{ref:U,className:tailwindMerge.twMerge("w-full",S&&"transition-transform duration-200"),style:{transform:k>0?`translateY(${k}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",V==="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)]",V==="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)]",A),style:{maxWidth:C,...p?{height:p}:{maxHeight:/\d/.test(m)?ce!==null?`min(${m}, ${Math.max(ce-8,0)}px, 100dvh)`:`min(${m}, 100dvh)`:m}},children:[P&&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:Ie,onPointerMove:Te,onPointerUp:ue,onPointerCancel:ue,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",B&&"animate-[handle-wiggle_0.6s_ease-in-out]")})}),Fe&&(a?jsxRuntime.jsx($e,{title:r,headerContent:t,titleAlign:o,hideCloseIcon:n||!d,hasBackArrow:true,onBack:i??(()=>{}),onClose:d||(()=>{})}):jsxRuntime.jsx($e,{title:r,headerContent:t,titleAlign:o,hideCloseIcon:n||!d,onClose:d||(()=>{})})),jsxRuntime.jsx("div",{ref:de,className:tailwindMerge.twMerge("flex-1 min-h-0 overflow-y-auto overscroll-contain",R?"p-4":"p-0"),children:e}),Ne&&jsxRuntime.jsx(Gt,{primaryAction:l,secondaryAction:g,footerContent:v})]})})})})})}Ue.displayName="Tray";var Jt=st.createContext("md");function Qo(){return st.useContext(Jt)}function jt(e="md"){let r=e==="sm"?"!text-base md:!text-[length:var(--control-text-sm)]":e==="md"?"!text-base md:!text-[length:var(--control-text-md)]":"";return `flex-1 text-start data-[placeholder]:text-text-disabled overflow-hidden text-ellipsis whitespace-nowrap ${q[e].text} ${r}`}function ca(){let e=st__namespace.default.useCallback((t,o)=>{o?.(t);},[]),r=st__namespace.default.useCallback((t,o)=>{o?.(t);},[]);return {handleFocus:e,handleBlur:r}}function Zt({label:e,description:r,errorMessage:t,children:o,items:n,renderItem:a,renderSelectedValue:i,size:s="md",selectedKey:d,defaultSelectedKey:u,onSelectionChange:c,placeholder:l,showErrors:g=false,tooltip:v,isRequired:m,transparent:p,reserveErrorSpace:C=false,placement:R="bottom start",shouldFlip:P=true,menuWidth:V="match",descriptionPlacement:A="below",useMobileTray:B=true,...F}){let[k,Q]=st.useState(null),[S,ne]=st.useState(null),[z,ce]=st.useState(false),X=d??k??u,{handleFocus:U,handleBlur:de}=ca(),{isMobile:H}=pt(),h=B&&H,Ie=st__namespace.default.useMemo(()=>!i||!X||!n?null:Array.from(n).find(Y=>Y.id===X)??null,[i,X,n]),Te=b=>{c&&b!==null&&c(b),c||Q(b);},ue=st.useRef(null),Fe=st.useRef(null),Ne=()=>{h&&ce(!z);};return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(reactAriaComponents.Select,{...F,selectedKey:X,defaultSelectedKey:u,onSelectionChange:Te,placeholder:l,className:G(F.className,"group flex w-full flex-col"),ref:ue,onOpenChange:b=>{h||(b&&Fe.current?ne(Fe.current.offsetWidth):b||ue.current?.blur());},children:({isDisabled:b,isInvalid:Y,isOpen:O})=>jsxRuntime.jsxs("div",{className:"flex flex-col",children:[e&&jsxRuntime.jsx(W,{size:s,tooltip:v,description:A==="tooltip"||A==="inline"?r:void 0,descriptionPlacement:A,isRequired:m,children:e}),jsxRuntime.jsx(oe,{children:jsxRuntime.jsx("div",{ref:Fe,children:jsxRuntime.jsxs(T,{variant:"unstyled",className:tailwindMerge.twMerge(ae({isInvalid:Y||g&&!!t,isDisabled:b,isFocused:h?z:O,transparent:p,size:s}),"flex items-center text-start gap-4 cursor-pointer pl-[var(--control-padding-sm)]"),onFocus:Z=>U(Z,F.onFocus),onBlur:Z=>de(Z,F.onBlur),onPress:h?Ne:void 0,"data-open":h?z:O,children:[i&&Ie?jsxRuntime.jsx("div",{className:jt(s),children:i(Ie)}):h&&X?jsxRuntime.jsx("div",{className:jt(s),children:n?Array.from(n).find(ee=>ee.id===X)?.label:String(X)}):jsxRuntime.jsx(reactAriaComponents.SelectValue,{className:jt(s)}),jsxRuntime.jsx(y,{name:"CaretDown","aria-hidden":true,className:tailwindMerge.twMerge("h-4 w-4 text-text-primary group-disabled:text-text-disabled forced-colors:text-[ButtonText] transition-transform",(h?z:O)&&"rotate-180")})]})})}),C?jsxRuntime.jsx("div",{className:"mt-1 min-h-[20px]",children:g?jsxRuntime.jsx(f,{size:s,className:"text-feedback-error-text",children:typeof t=="function"&&F.validationResult?t(F.validationResult):typeof t=="string"?t:null}):r&&A==="below"?jsxRuntime.jsx(I,{size:s,children:r}):null}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:g?jsxRuntime.jsx(f,{size:s,className:"mt-1 text-feedback-error-text",children:typeof t=="function"&&F.validationResult?t(F.validationResult):typeof t=="string"?t:null}):r&&A==="below"?jsxRuntime.jsx(I,{size:s,className:"mt-1",children:r}):null}),h?null:jsxRuntime.jsx(Ge,{className:"bg-background-input shadow-xl border border-border-input/20 backdrop-blur-sm rounded-[var(--control-border-radius)]",style:{width:V==="match"&&S?`${S}px`:void 0,minWidth:V==="auto"&&S?`${S}px`:void 0,maxWidth:V==="auto"?"min(600px, 90vw)":void 0},placement:R,shouldFlip:P,children:jsxRuntime.jsx(Jt.Provider,{value:"md",children:jsxRuntime.jsx(reactAriaComponents.ListBox,{items:n,className:"w-full max-h-[300px] overflow-auto bg-background-input p-0 outline-0",children:a&&n?Z=>jsxRuntime.jsx(we,{id:Z.id,textValue:Z.label,children:jsxRuntime.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap min-w-0 flex-1",children:a(Z)})},Z.id):o})})})]})}),h&&jsxRuntime.jsx(Ue,{isOpen:z,onClose:()=>ce(false),title:e??"Select an option",contentPadding:false,children:jsxRuntime.jsx(Jt.Provider,{value:"md",children:jsxRuntime.jsx(reactAriaComponents.ListBox,{items:n,className:"w-full bg-background-surface p-0 outline-0 [&_[role=option]]:border-b [&_[role=option]]:border-border-default [&_[role=option]:last-child]:border-0 [&_[role=option]]:!px-6 [&_[role=option]]:!py-4 [&_[role=option]]:rounded-none",selectionMode:"single",selectedKeys:X!=null?[X]:[],onSelectionChange:b=>{let Y=Array.from(b)[0];Y!=null&&(Te(Y),ce(false));},children:a&&n?b=>jsxRuntime.jsx(we,{id:b.id,textValue:b.label,children:jsxRuntime.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap min-w-0 flex-1",children:a(b)})},b.id):o})})})]})}function we({size:e,className:r,...t}){let o=Qo(),n=e??o;return jsxRuntime.jsx(reactAriaComponents.ListBoxItem,{...t,className:tailwindMerge.twMerge("flex cursor-default items-center gap-2 rounded-sm px-3 outline-none text-text-primary data-[focused]:bg-background-hover data-[focus-visible]:ring-2 data-[focus-visible]:ring-action-default data-[focus-visible]:ring-inset data-[selected]:bg-background-selected data-[selected]:font-medium overflow-hidden",q[n].paddingY,q[n].text,r)})}var Ke=({className:e,size:r=24,color:t="text-action-brand"})=>jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("inline-block animate-spin rounded-full border-2 border-solid border-current border-r-transparent",t,e),style:{width:r,height:r},role:"status","aria-label":"loading",children:jsxRuntime.jsx("span",{className:"sr-only",children:"Loading..."})});var Ra=[],Fa={sm:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6",xl:"h-7 w-7"},Ta={sm:"pl-8",md:"pl-10",lg:"pl-11",xl:"pl-13"},Zo={sm:"py-1",md:"py-2",lg:"py-3",xl:"py-4"},to=(e,r,t)=>{if(e==null||e==="")return "";let n=(t?t.flatMap(a=>a.items):r||[]).find(a=>a.id===e);return n?n.name:""};async function Na(e,r,t){try{let o=e.url.replace("{q}",r),n=new URLSearchParams;e.extraParams&&Object.entries(e.extraParams).forEach(([d,u])=>{n.append(d,u.toString());});let a=`${o}${n.toString()?"?"+n.toString():""}`,i=await fetch(a,{method:"GET",headers:e.headers,signal:t});if(!i.ok)throw new Error(`HTTP error! status: ${i.status}`);let s=await i.json();return {items:e.transformResponse(s)}}catch(o){if(o instanceof Error&&o.name==="AbortError")return {items:[]};console.error("Error in REST request:",o);let n=o instanceof Error?o.message:"Unknown error occurred";return {items:[],error:n}}}async function ka(e,r,t){try{let o=e.graphqlQuery.replace(`$${e.variableKey||"filter"}`,`"${r}"`),n=await fetch(e.url,{method:"POST",headers:{"Content-Type":"application/json",...e.headers},body:JSON.stringify({query:o}),signal:t});if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);let a=await n.json();if(a.errors)throw new Error(a.errors[0]?.message||"GraphQL error occurred");return e.responsePath&&(a=e.responsePath.split(".").reduce((i,s)=>i?.[s],a)),{items:e.transformResponse(a)}}catch(o){if(o instanceof Error&&o.name==="AbortError")return {items:[]};console.error("Error in GraphQL request:",o);let n=o instanceof Error?o.message:"Unknown error occurred";return {items:[],error:n}}}function oo({label:e,staticItems:r=Ra,sections:t,selectedKey:o,defaultSelectedKey:n,onSelectionChange:a,requestConfig:i,defaultFilter:s,placeholder:d,errorMessage:u,description:c,size:l="md",tooltip:g,isRequired:v,isDisabled:m,isInvalid:p,validationResult:C,showErrors:R=true,renderItem:P,renderLeftIcon:V,renderSection:A,autoFocus:B=false,reserveErrorSpace:F=false,hideChevron:k=false,useMobileTray:Q=true,className:S}){let ne=st__namespace.default.useRef(null),z=st__namespace.default.useRef(null),[ce,X]=st__namespace.default.useState(),[U,de]=st.useState(()=>to(o||n,r,t)),[H,h]=st.useState(false),[Ie,Te]=st.useState(false),ue=So(U),{contains:Fe}=reactAria.useFilter({sensitivity:"base"}),[Ne,b]=st.useState(),{isMobile:Y}=pt(),O=Q&&Y,Z=q[l].text,ye=reactStately.useAsyncList({async load({signal:w,filterText:L=""}){if(!i)return {items:[]};if(!i.url||i.shouldLoad&&!i.shouldLoad(L))return {items:[]};try{let re;return i.requestType==="GraphQL"?re=await ka(i,L,w):re=await Na(i,L,w),b(re.error),{items:re.items}}catch(re){return re instanceof Error&&re.name==="AbortError"?{items:[]}:(console.error("Error loading items:",re),b(re instanceof Error?re.message:"Unknown error occurred"),{items:[]})}},initialFilterText:""}),ee=i&&ue!==""?ye:null,Me=false,Je=st.useRef("");st.useEffect(()=>{B&&h(true);},[B]),st.useEffect(()=>{let w=to(o,r,t);w!==U&&de(w);},[o,r,t]),st.useEffect(()=>{let w=()=>{ne.current&&X(ne.current.offsetWidth);};return w(),window.addEventListener("resize",w),()=>window.removeEventListener("resize",w)},[]),st.useEffect(()=>{ue===""?Je.current="":ee&&ue!==Je.current&&(Je.current=ue,ee.setFilterText(ue));},[ue,ee]),Me=ft(!!ee?.isLoading,300);let No=st__namespace.default.useMemo(()=>{if(!O||!U)return ee?ee.items:r;let w=ee?ee.items:r,L=s??(i?()=>true:Fe);return w.filter(re=>L(re.name,U))},[O,U,ee,r,s,Fe]),mt=w=>{let L=to(w,r,t);de(L),a&&a(w);},Vt=w=>{de(w);},ko=()=>{O&&Te(true);};return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(reactAriaComponents.ComboBox,{onSelectionChange:mt,selectedKey:o||void 0,defaultSelectedKey:n||void 0,items:ee?ee.items:t?t.flatMap(w=>w.items):r,className:G(S,"group flex flex-col w-full"),menuTrigger:O?"manual":i?"input":"focus",allowsEmptyCollection:!!i,isDisabled:m,isInvalid:p||!!u,inputValue:U,onInputChange:Vt,autoFocus:B&&!O,defaultFilter:s??(i?()=>true:Fe),"aria-label":e||d||"Autocomplete",children:w=>jsxRuntime.jsxs("div",{className:"flex flex-col",children:[e&&jsxRuntime.jsx(W,{size:l,tooltip:g,isRequired:v,children:e}),jsxRuntime.jsxs(oe,{ref:ne,children:[V?jsxRuntime.jsx("div",{className:"pointer-events-none absolute left-3 top-[45%] -translate-y-1/2 z-10",children:V(Me)}):jsxRuntime.jsx("div",{className:"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 z-10 flex items-center",children:Me?jsxRuntime.jsx(Ke,{size:16,color:"text-text-secondary"}):jsxRuntime.jsx(y,{name:"MagnifyingGlass",className:`${Fa[l]} text-text-secondary`})}),jsxRuntime.jsx(reactAriaComponents.Input,{className:ae({isInvalid:p||!!u,isDisabled:m,isFocused:H||(O?Ie:w.isOpen),size:l,className:tailwindMerge.twMerge(Ta[l],U&&!m||!k&&!U?"pr-10":"pr-3",O&&"cursor-pointer",S)}),placeholder:d,disabled:m,onFocus:L=>{h(true),O&&(L.currentTarget.blur(),ko());},onBlur:()=>{h(false);},onClick:O?ko:void 0,readOnly:O,"aria-label":e||d||"Autocomplete"}),U&&!m&&jsxRuntime.jsx(et,{onClick:()=>{de(""),a?.(null);},size:l}),!k&&!U&&jsxRuntime.jsx(reactAriaComponents.Button,{className:"absolute right-3 top-[46%] -translate-y-1/2 transform text-text-secondary hover:text-text-primary","aria-label":"Toggle menu",isDisabled:m,children:({isPressed:L})=>jsxRuntime.jsx(y,{name:L?"CaretUp":"CaretDown",className:"h-4 w-4"})})]}),F?jsxRuntime.jsx("div",{className:"mt-1 min-h-[20px]",children:R&&Ne?jsxRuntime.jsx(f,{size:l,className:"text-feedback-error-text",children:Ne}):R&&typeof u=="string"?jsxRuntime.jsx(f,{size:l,className:"text-feedback-error-text",children:u}):R&&typeof u=="function"&&C?jsxRuntime.jsx(f,{size:l,className:"text-feedback-error-text",children:u(C)}):c?jsxRuntime.jsx(I,{size:l,children:c}):null}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[c&&jsxRuntime.jsx(I,{size:l,className:"mt-1",children:c}),R&&Ne&&jsxRuntime.jsx(f,{size:l,className:"text-feedback-error-text mt-1",children:Ne}),R&&typeof u=="string"&&jsxRuntime.jsx(f,{size:l,className:"text-feedback-error-text mt-1",children:u}),R&&typeof u=="function"&&C&&jsxRuntime.jsx(f,{size:l,className:"text-feedback-error-text mt-1",children:u(C)})]}),!O&&jsxRuntime.jsx(Ge,{className:"bg-background-input shadow-xl border border-border-input/20 backdrop-blur-sm ring-1 ring-black/5 rounded-[var(--control-border-radius)]",style:{minWidth:ce?`${ce}px`:void 0,zIndex:9999},children:jsxRuntime.jsx(reactAriaComponents.ListBox,{"aria-label":e||d||"Suggestions",className:`max-h-[300px] overflow-auto bg-background-input outline-none ${Z}`,children:t?t.map(L=>{let re=L.items.map(ve=>jsxRuntime.jsx(we,{id:ve.id,textValue:ve.name,size:l,className:`flex cursor-default items-center gap-2 px-3 ${Zo[l]} text-text-primary outline-none data-[focused]:bg-background-hover data-[selected]:bg-background-selected data-[selected]:font-medium data-[focus-visible]:ring-0`,children:P?P(ve):ve.name},ve.id));if(A){let ve=A(L,re);return st__namespace.default.isValidElement(ve)&&ve.type===reactAriaComponents.ListBoxSection?ve:jsxRuntime.jsx(reactAriaComponents.ListBoxSection,{children:ve},L.name)}return jsxRuntime.jsxs(reactAriaComponents.ListBoxSection,{children:[jsxRuntime.jsx(reactAriaComponents.Header,{className:"px-3 py-1 text-sm font-bold text-text-secondary",children:L.name}),re]},L.name)}):L=>jsxRuntime.jsx(we,{id:L.id,textValue:L.name,size:l,className:`flex cursor-default items-center gap-2 px-3 ${Zo[l]} text-text-primary outline-none data-[focused]:bg-background-hover data-[selected]:bg-background-selected data-[selected]:font-medium data-[focus-visible]:ring-0`,children:P?P(L):L.name},L.id)})})]})}),O&&jsxRuntime.jsx(Ue,{isOpen:Ie,onClose:()=>Te(false),title:e??d??"Search",contentPadding:false,height:"80vh",children:jsxRuntime.jsxs("div",{className:"flex flex-col h-full",children:[jsxRuntime.jsx("div",{className:"p-4 border-b border-border-default",children:jsxRuntime.jsxs(oe,{children:[jsxRuntime.jsx("div",{className:"pointer-events-none absolute left-3 top-[45%] -translate-y-1/2 z-10 flex items-center",children:Me?jsxRuntime.jsx(Ke,{size:16,color:"text-text-secondary"}):jsxRuntime.jsx(y,{name:"MagnifyingGlass",className:"h-4 w-4 text-text-secondary"})}),jsxRuntime.jsx("input",{ref:z,type:"text",value:U,onChange:w=>Vt(w.target.value),placeholder:d,autoFocus:true,className:ae({isInvalid:false,isDisabled:false,isFocused:true,size:"md",className:"pl-10 pr-10"})}),U&&jsxRuntime.jsx(et,{onClick:()=>{de(""),a?.(null);},size:"md"})]})}),jsxRuntime.jsx("div",{className:"flex-1 overflow-auto",children:jsxRuntime.jsx(reactAriaComponents.ListBox,{"aria-label":e||d||"Suggestions",items:No,selectedKeys:o?[o]:[],selectionMode:"single",onSelectionChange:w=>{let L=Array.from(w)[0];L&&(mt(L),Te(false));},className:"bg-background-input outline-none",children:w=>jsxRuntime.jsx(we,{id:w.id,textValue:w.name,size:"md",className:"flex cursor-default items-center gap-2 px-4 py-3 text-text-primary outline-none data-[focused]:bg-background-hover data-[selected]:bg-background-selected data-[selected]:font-medium data-[focus-visible]:ring-0",children:P?P(w):w.name},w.id)})})]})})]})}function D(e,r){let t=r.split("."),o=e;for(let a of t)if(o&&typeof o=="object"&&a in o)o=o[a];else {o=void 0;break}let n=o?.message;return typeof n=="string"?n:void 0}function gu({name:e,defaultValue:r,...t}){let{control:o,formState:n}=reactHookForm.useFormContext(),a=D(n.errors,e);return jsxRuntime.jsx(reactHookForm.Controller,{control:o,name:e,defaultValue:r,render:({field:i})=>jsxRuntime.jsx(oo,{...t,selectedKey:i.value??null,onSelectionChange:s=>i.onChange(s),showErrors:!!a,errorMessage:a})})}var Da="focus:ring-action-primary",Aa="bg-action-primary border-action-primary text-[color:var(--color-action-primary-text)] hover:bg-action-primary-hover hover:border-action-primary-hover";function rr(e){return jsxRuntime.jsxs(reactAriaComponents.CheckboxGroup,{...e,className:G(e.className,"flex flex-col gap-2"),children:[jsxRuntime.jsx(W,{children:e.label}),e.children,e.description&&jsxRuntime.jsx(I,{children:e.description}),jsxRuntime.jsx(f,{children:typeof e.errorMessage=="function"?void 0:e.errorMessage})]})}function Ma({isDisabled:e}){return `relative flex gap-2 items-center group text-sm transition ${e?"text-text-disabled":"text-text-secondary"}`}function _a({isSelected:e,isInvalid:r,isDisabled:t,isIndeterminate:o}){let n="w-5 h-5 flex-shrink-0 rounded-[var(--control-border-radius)] flex items-center justify-center border-2 transition ring-offset-2 focus:ring-2",a=Da,i="";return t?i="border-border-muted bg-background-muted":r?i="border-feedback-error-border bg-feedback-error-background":e||o?i=Aa:i="bg-background-input border-border-input hover:border-border-focus",`${n} ${a} ${i}`}var or="w-4 h-4 text-current group-disabled:text-text-disabled";function nr(e){let{children:r,variant:t,...o}=e;return jsxRuntime.jsx(reactAriaComponents.Checkbox,{...o,className:reactAriaComponents.composeRenderProps(e.className,(n,a)=>`${Ma(a)} ${n||""}`),children:n=>{let{isSelected:a,isIndeterminate:i,...s}=n,d=jsxRuntime.jsx("div",{className:_a({isSelected:a,isIndeterminate:i,...s}),children:i?jsxRuntime.jsx(lucideReact.Minus,{"aria-hidden":true,className:or}):a?jsxRuntime.jsx(lucideReact.Check,{"aria-hidden":true,className:or}):null});return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[d,typeof r=="function"?r(n):r]})}})}function Eu({name:e,defaultValue:r,errorBelow:t=false,...o}){let{control:n,formState:a}=reactHookForm.useFormContext(),i=D(a.errors,e);return jsxRuntime.jsx(reactHookForm.Controller,{control:n,name:e,defaultValue:r,render:({field:s})=>jsxRuntime.jsxs("div",{className:"flex flex-col gap-1",children:[jsxRuntime.jsx(nr,{...o,isSelected:!!s.value,onChange:d=>s.onChange(d),"aria-invalid":!!i,children:o.children}),t&&i&&jsxRuntime.jsx(f,{children:i})]})})}function _u({name:e,defaultValue:r,...t}){let{control:o,formState:n}=reactHookForm.useFormContext(),a=D(n.errors,e);return jsxRuntime.jsx(reactHookForm.Controller,{control:o,name:e,defaultValue:r,render:({field:i})=>jsxRuntime.jsx(rr,{...t,value:i.value||[],onChange:s=>i.onChange(s),errorMessage:a,children:t.children})})}function Ye(e){if(!e)return false;let r=e.startsWith("#")?e.slice(1):e;return /^[0-9A-Fa-f]{3}$|^[0-9A-Fa-f]{6}$/.test(r)}function ao(e){if(!e)return "";let r=e.startsWith("#")?e.slice(1):e;return r.length===3&&(r=r.split("").map(t=>t+t).join("")),`#${r.toUpperCase()}`}function lr({label:e,description:r,errorMessage:t,size:o="md",tooltip:n,isRequired:a,transparent:i,className:s,validationResult:d,value:u,defaultValue:c,onChange:l,placeholder:g="#000000",showColorSwatch:v=true,reserveErrorSpace:m=true,...p}){let[C,R]=st.useState(c||""),[P,V]=st.useState(u||c||""),[A,B]=st.useState(false),[F,k]=st.useState(null),{isFocused:Q,handleFocus:S,handleBlur:ne}=ke(),z=u!==void 0?u:C;st.useEffect(()=>{u!==void 0&&V(u);},[u]);let ce=z?!Ye(z):false,X=st.useCallback(H=>{if(V(H),Ye(H)){let h=ao(H);l?l(h):R(h);}else H===""&&(l?l(""):R(""));},[l]),U=st.useCallback(H=>{let h=ao(H);V(h),l?l(h):R(h);},[l]),de=st.useCallback(H=>{if(Ye(P)){let h=ao(P);V(h),l&&h!==z?l(h):!l&&h!==C&&R(h);}ne(H,p.onBlur);},[P,z,C,l,ne,p.onBlur]);return jsxRuntime.jsx(reactAriaComponents.TextField,{...p,isRequired:a,className:G(s,"group flex flex-col"),children:({isDisabled:H})=>jsxRuntime.jsxs("div",{className:"flex flex-col",children:[e&&jsxRuntime.jsx(W,{size:o,tooltip:n,isRequired:a,children:e}),jsxRuntime.jsx(oe,{children:jsxRuntime.jsxs("div",{className:"flex gap-2",children:[jsxRuntime.jsxs("div",{className:"flex-1 relative",children:[jsxRuntime.jsx(yt,{size:o,disabled:H,type:"text",value:P,placeholder:g,onFocus:h=>S(h,p.onFocus),onBlur:de,onChange:h=>X(h.target.value),className:tailwindMerge.twMerge(ae({isInvalid:ce,isDisabled:H,isFocused:Q,size:o,transparent:i}),v?"pr-12":"pr-3","pl-3")}),v&&jsxRuntime.jsx("div",{className:"absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none",style:{width:q[o].height},children:jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("w-6 h-6 rounded border shadow-sm",Ye(z)?"border-border-default":"border-border-default bg-background-muted"),style:Ye(z)?{backgroundColor:z}:void 0,"aria-hidden":"true",children:!Ye(z)&&jsxRuntime.jsx("div",{className:"w-full h-full flex items-center justify-center",children:jsxRuntime.jsx("div",{className:"w-3 h-3 rounded-full border-2 border-border-muted"})})})})]}),jsxRuntime.jsx("div",{ref:k,children:jsxRuntime.jsx(T,{variant:"secondary",size:o,icon:"Palette",onPress:()=>B(!A),isDisabled:H,className:"flex-shrink-0",children:"Pick"})})]})}),m?jsxRuntime.jsx("div",{className:"mt-1 min-h-[20px]",children:typeof t=="string"?jsxRuntime.jsx(f,{size:o,children:t}):typeof t=="function"&&d?jsxRuntime.jsx(f,{size:o,children:t(d)}):r?jsxRuntime.jsx(I,{size:o,children:r}):null}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:typeof t=="string"?jsxRuntime.jsx(f,{size:o,className:"mt-1",children:t}):typeof t=="function"&&d?jsxRuntime.jsx(f,{size:o,className:"mt-1",children:t(d)}):r?jsxRuntime.jsx(I,{size:o,className:"mt-1",children:r}):null}),A&&F&&jsxRuntime.jsx(Ge,{triggerRef:{current:F},isOpen:A,onOpenChange:B,placement:"bottom end",className:"bg-background-input shadow-xl border border-border-input/20 backdrop-blur-sm rounded-lg p-4",children:jsxRuntime.jsxs("div",{className:"flex flex-col gap-4",children:[jsxRuntime.jsx(reactColorful.HexColorPicker,{color:z||"#000000",onChange:U,style:{width:"200px",height:"200px"}}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("div",{className:"w-10 h-10 rounded border border-border-default shadow-sm flex-shrink-0",style:{backgroundColor:z||"#000000"}}),jsxRuntime.jsx("div",{className:"flex-1 text-text-primary text-[length:var(--control-text-sm)] font-mono",children:z||"#000000"})]})]})})]})})}function om({name:e,defaultValue:r,...t}){let{control:o,formState:n}=reactHookForm.useFormContext(),a=D(n.errors,e);return jsxRuntime.jsx(reactHookForm.Controller,{control:o,name:e,defaultValue:r,render:({field:i})=>jsxRuntime.jsx(lr,{...t,value:i.value??"",onChange:s=>i.onChange(s),isInvalid:!!a,errorMessage:a})})}function ii({isSelected:e,isDisabled:r}){let t=[Be,"w-9 h-9 text-sm cursor-default rounded-sm flex items-center justify-center forced-color-adjust-none font-semibold"];return r?t.push("text-text-disabled forced-colors:text-[GrayText]"):e?t.push("bg-action-default text-text-inverse invalid:bg-feedback-error-border forced-colors:bg-[Highlight] forced-colors:invalid:bg-[Mark] forced-colors:text-[HighlightText]"):t.push("text-text-primary hover:bg-background-hover pressed:bg-background-selected"),t.join(" ")}function so({errorMessage:e,...r}){return jsxRuntime.jsxs(reactAriaComponents.Calendar,{...r,children:[jsxRuntime.jsx(cr,{}),jsxRuntime.jsxs(reactAriaComponents.CalendarGrid,{className:"border-separate [border-spacing:0] [&_td]:p-0 [&_td]:!border-0",children:[jsxRuntime.jsx(ur,{}),jsxRuntime.jsx(reactAriaComponents.CalendarGridBody,{children:t=>jsxRuntime.jsx(reactAriaComponents.CalendarCell,{date:t,className:({isSelected:o,isDisabled:n})=>`${ii({isSelected:o,isDisabled:n})} border-0`})})]}),e&&jsxRuntime.jsx(reactAriaComponents.Text,{slot:"errorMessage",className:"text-sm text-feedback-error-text",children:e})]})}function cr(){let{direction:e}=reactAriaComponents.useLocale(),r=18;return jsxRuntime.jsxs("header",{className:"flex w-full items-center gap-1 px-1 pb-4",children:[jsxRuntime.jsx(T,{variant:"icon",slot:"previous",className:"pl-0",children:e==="rtl"?jsxRuntime.jsx(y,{name:"CaretRight","aria-hidden":true,size:r}):jsxRuntime.jsx(y,{name:"CaretLeft","aria-hidden":true,size:r})}),jsxRuntime.jsx(reactAriaComponents.Heading,{className:"text-md mx-2 flex-1 text-center font-semibold text-text-primary"}),jsxRuntime.jsx(T,{variant:"icon",slot:"next",className:"pr-0",children:e==="rtl"?jsxRuntime.jsx(y,{name:"CaretLeft","aria-hidden":true,size:r}):jsxRuntime.jsx(y,{name:"CaretRight","aria-hidden":true,size:r})})]})}function ur(){return jsxRuntime.jsx(reactAriaComponents.CalendarGridHeader,{children:e=>jsxRuntime.jsx(reactAriaComponents.CalendarHeaderCell,{className:"text-xs font-semibold text-text-secondary",children:e})})}function co({label:e,description:r,errorMessage:t,size:o="md",tooltip:n,isRequired:a,isDisabled:i,isInvalid:s,showCalendar:d=true,reserveErrorSpace:u=true,validationResult:c,className:l,...g}){let[v,m]=st.useState(false),p=C=>{g.onChange&&C&&g.onChange(C),m(false);};return jsxRuntime.jsxs(reactAriaComponents.DateField,{...g,isDisabled:i,isRequired:a,isInvalid:s,className:G(l,"flex flex-col gap-1"),children:[e&&jsxRuntime.jsx(W,{size:o,tooltip:n,isRequired:a,children:e}),jsxRuntime.jsx(oe,{children:jsxRuntime.jsxs("div",{className:"relative w-full",children:[jsxRuntime.jsx(pr,{size:o,isDisabled:i,isInvalid:s,hasCalendar:d}),d&&!i&&jsxRuntime.jsxs(reactAriaComponents.DialogTrigger,{isOpen:v,onOpenChange:m,children:[jsxRuntime.jsx(T,{variant:"unstyled",className:"absolute right-2 top-1/2 -translate-y-1/2 flex h-8 w-8 items-center justify-center rounded hover:bg-background-hover text-text-secondary hover:text-text-primary transition-colors","aria-label":"Open calendar",children:jsxRuntime.jsx(y,{name:"Calendar",size:18})}),jsxRuntime.jsx(reactAriaComponents.Popover,{className:"bg-background-surface rounded-lg border border-border-default shadow-xl",children:jsxRuntime.jsx(reactAriaComponents.Dialog,{className:"p-4 outline-none",children:jsxRuntime.jsx(so,{value:g.value,onChange:p,minValue:g.minValue,maxValue:g.maxValue,isDisabled:i,isReadOnly:g.isReadOnly,isDateUnavailable:g.isDateUnavailable})})})]})]})}),u?jsxRuntime.jsx("div",{className:"mt-1 min-h-[20px]",children:typeof t=="string"?jsxRuntime.jsx(f,{size:o,children:t}):typeof t=="function"&&c?jsxRuntime.jsx(f,{size:o,children:t(c)}):r?jsxRuntime.jsx(I,{size:o,children:r}):null}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:typeof t=="string"?jsxRuntime.jsx(f,{size:o,className:"mt-1",children:t}):typeof t=="function"&&c?jsxRuntime.jsx(f,{size:o,className:"mt-1",children:t(c)}):r?jsxRuntime.jsx(I,{size:o,className:"mt-1",children:r}):null})]})}function fi({isPlaceholder:e,isDisabled:r,size:t="md"}){return tailwindMerge.twMerge("inline-block box-content px-0.5 rounded outline-none tabular-nums text-center transition-colors",{sm:"text-base md:text-xs",md:"text-base md:text-sm",lg:"text-base",xl:"text-lg"}[t],e?"text-text-disabled italic":"text-text-primary",r?"text-text-disabled cursor-not-allowed":"cursor-text",!r&&"hover:bg-background-hover","data-[focused]:bg-background-selected data-[focused]:text-text-primary")}function pr({size:e="md",isDisabled:r,isInvalid:t,hasCalendar:o,className:n,...a}){return jsxRuntime.jsx(reactAriaComponents.DateInput,{className:tailwindMerge.twMerge(tt({isInvalid:t,isDisabled:r}),"px-3 py-2 flex items-center gap-0.5 w-full",o&&"pr-10",n),...a,children:i=>jsxRuntime.jsx(reactAriaComponents.DateSegment,{segment:i,className:fi({isPlaceholder:i.isPlaceholder,isDisabled:!i.isEditable||r,size:e})})})}function Dm({name:e,defaultValue:r,...t}){let{control:o,formState:n}=reactHookForm.useFormContext(),a=D(n.errors,e);return jsxRuntime.jsx(reactHookForm.Controller,{control:o,name:e,defaultValue:r,render:({field:i})=>jsxRuntime.jsx(co,{...t,value:i.value??null,onChange:s=>i.onChange(s),isInvalid:!!a,errorMessage:a})})}function uo({value:e,onChange:r,onUrlChange:t,accept:o="image/*",maxSize:n,isDisabled:a=false,onUpload:i,className:s,showPreview:d=true,placeholder:u="Drop files here or click to browse"}){let[c,l]=st.useState(false),[g,v]=st.useState(false),[m,p]=st.useState(null),[C,R]=st.useState(e),P=st.useRef(null),V=async F=>{if(p(null),n&&F.size>n){p(`File size must be less than ${(n/1024/1024).toFixed(2)}MB`);return}if(d&&F.type.startsWith("image/")){let k=new FileReader;k.onloadend=()=>{R(k.result);},k.readAsDataURL(F);}if(i){v(true);try{let k=await i(F);R(k),t?.(k);}catch(k){p("Failed to upload file"),console.error("Upload error:",k);}finally{v(false);}}r?.(F,C);},A=async F=>{try{let k=F.items;if(k.length>0){let Q=k[0];if(Q.kind==="file"){let S=await Q.getFile();S&&V(S);}}}catch(k){p("Failed to upload file"),console.error("Upload error:",k);}finally{l(false);}},B=()=>{R(void 0),p(null),r?.(null),t?.(""),P.current&&(P.current.value="");};return jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("w-full",s),children:[jsxRuntime.jsxs(reactAriaComponents.DropZone,{className:tailwindMerge.twMerge("relative flex min-h-[200px] w-full flex-col items-center justify-center rounded-lg border-2 border-dashed transition-colors",c?"border-action-brand bg-action-brand/5":"border-border-muted hover:border-border-default",a&&"pointer-events-none opacity-50",m&&"border-feedback-error-border bg-feedback-error-background/50"),onDrop:A,onDropEnter:()=>l(true),onDropExit:()=>l(false),children:[C?jsxRuntime.jsxs("div",{className:"relative flex h-full w-full items-center justify-center p-4",children:[d&&(C.startsWith("data:image")||C.startsWith("http"))?jsxRuntime.jsx("img",{src:C,alt:"Preview",className:"max-h-48 max-w-full rounded-md object-contain"}):jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-2",children:[jsxRuntime.jsx(lucideReact.Image,{className:"h-12 w-12 text-text-secondary"}),jsxRuntime.jsx("span",{className:"text-sm text-text-secondary",children:"File uploaded"})]}),!a&&jsxRuntime.jsx(T,{variant:"icon",size:"sm",onPress:B,className:"absolute right-2 top-2 bg-background-surface shadow-md",children:jsxRuntime.jsx(lucideReact.X,{className:"h-4 w-4"})})]}):jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-4 p-6",children:[jsxRuntime.jsx(lucideReact.Upload,{className:"h-12 w-12 text-text-secondary"}),jsxRuntime.jsxs("div",{className:"text-center",children:[jsxRuntime.jsx("p",{className:"text-sm text-text-primary",children:u}),jsxRuntime.jsx("p",{className:"mt-1 text-xs text-text-secondary",children:o==="image/*"?"PNG, JPG, GIF up to 10MB":`Accepts ${o}`})]}),jsxRuntime.jsx(reactAriaComponents.FileTrigger,{acceptedFileTypes:o.split(","),onSelect:F=>{let k=Array.from(F||[]);k.length>0&&V(k[0]);},children:jsxRuntime.jsx(T,{variant:"secondary",size:"sm",isDisabled:a,children:"Choose File"})})]}),g&&jsxRuntime.jsx("div",{className:"absolute inset-0 flex items-center justify-center rounded-lg bg-background-surface/80",children:jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-2",children:[jsxRuntime.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-action-brand border-t-transparent"}),jsxRuntime.jsx("span",{className:"text-sm text-text-secondary",children:"Uploading..."})]})})]}),m&&jsxRuntime.jsx("p",{className:"mt-2 text-sm text-feedback-error-text",children:m})]})}function Xm({name:e,defaultValue:r,errorBelow:t=true,...o}){let{control:n,formState:a}=reactHookForm.useFormContext(),i=D(a.errors,e);return jsxRuntime.jsx(reactHookForm.Controller,{control:n,name:e,defaultValue:r,render:({field:s})=>jsxRuntime.jsxs("div",{className:"flex flex-col gap-1",children:[jsxRuntime.jsx(uo,{...o,value:s.value??"",onChange:(d,u)=>s.onChange(u||"")}),t&&i&&jsxRuntime.jsx(f,{children:i})]})})}var Ei=e=>{let r=ae({isInvalid:e.isInvalid,isDisabled:e.isDisabled,isFocused:e.isFocused,transparent:e.transparent,size:e.size});return tailwindMerge.twMerge(r,"pr-9","[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",e.className)};function fo({label:e,description:r,errorMessage:t,size:o="md",tooltip:n,isRequired:a,transparent:i,validationResult:s,reserveErrorSpace:d=true,descriptionPlacement:u="below",...c}){let l=st.useId(),{isFocused:g,handleFocus:v,handleBlur:m}=ke();return jsxRuntime.jsx(reactAriaComponents.NumberField,{...c,id:l,isRequired:a,className:G(c.className,"group flex flex-col gap-1"),step:c.step??1,onChange:p=>{typeof p=="number"&&(c.maxValue!=null&&p>c.maxValue?c.onChange?.(c.maxValue):c.minValue!=null&&p<c.minValue?c.onChange?.(c.minValue):c.onChange?.(p));},isInvalid:!!t||typeof c.value=="number"&&(c.maxValue!=null&&c.value>c.maxValue||c.minValue!=null&&c.value<c.minValue),children:({isDisabled:p,isInvalid:C})=>jsxRuntime.jsxs("div",{className:"flex flex-col gap-1",children:[e&&jsxRuntime.jsx(W,{size:o,tooltip:n,description:u==="tooltip"||u==="inline"?r:void 0,descriptionPlacement:u,isRequired:a,htmlFor:l,children:e}),jsxRuntime.jsx("div",{className:"relative",children:jsxRuntime.jsxs(reactAriaComponents.Group,{className:"relative",children:[jsxRuntime.jsx(reactAriaComponents.Input,{onFocus:P=>v(P,c.onFocus),onBlur:P=>m(P,c.onBlur),className:Ei({isInvalid:C||!!t,isDisabled:p,isFocused:g,transparent:i,size:o,className:typeof c.className=="string"?c.className:void 0})}),jsxRuntime.jsxs("div",{className:"absolute inset-y-[2px] right-[2px] flex flex-col divide-y divide-border-default border-l border-border-default overflow-hidden rounded-r-[calc(var(--control-border-radius)-2px)]",children:[jsxRuntime.jsx(reactAriaComponents.Button,{slot:"increment",isDisabled:p,className:"flex h-1/2 w-7 items-center justify-center bg-background-input hover:bg-background-input-hover active:bg-background-input-active disabled:cursor-not-allowed disabled:opacity-50",children:jsxRuntime.jsx(y,{name:"CaretUp",size:14})}),jsxRuntime.jsx(reactAriaComponents.Button,{slot:"decrement",isDisabled:p,className:"flex h-1/2 w-7 items-center justify-center bg-background-input hover:bg-background-input-hover active:bg-background-input-active disabled:cursor-not-allowed disabled:opacity-50",children:jsxRuntime.jsx(y,{name:"CaretDown",size:14})})]})]})}),d?jsxRuntime.jsx("div",{className:"mt-1 min-h-[20px]",children:t?jsxRuntime.jsx(f,{size:o,children:typeof t=="function"?t(s):t}):r&&u==="below"?jsxRuntime.jsx(I,{size:o,children:r}):null}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:t?jsxRuntime.jsx(f,{size:o,className:"mt-1",children:typeof t=="function"?t(s):t}):r&&u==="below"?jsxRuntime.jsx(I,{size:o,className:"mt-1",children:r}):null})]})})}function xp({name:e,defaultValue:r,...t}){let{control:o,formState:n}=reactHookForm.useFormContext(),a=D(n.errors,e);return jsxRuntime.jsx(reactHookForm.Controller,{control:o,name:e,defaultValue:r,render:({field:i})=>jsxRuntime.jsx(fo,{...t,value:typeof i.value=="number"?i.value:void 0,onChange:s=>i.onChange(s),isInvalid:!!a,errorMessage:a,isRequired:t.isRequired})})}function xo({value:e,defaultValue:r,onChange:t,isDisabled:o,isReadOnly:n,isRequired:a,className:i,children:s,size:d="2",variant:u="primary",columns:c="repeat(auto-fit, minmax(160px, 1fr))",gap:l="1"}){return jsxRuntime.jsx(reactAriaComponents.RadioGroup,{value:e,defaultValue:r,onChange:t,isDisabled:o,isReadOnly:n,isRequired:a,className:G(i,"grid"),style:{gridTemplateColumns:/^\d+$/.test(String(c))?`repeat(${c}, minmax(0, 1fr))`:c,gap:l==="1"?"0.25rem":l==="2"?"0.5rem":l==="3"?"0.75rem":l==="4"?"1rem":typeof l=="number"?`${l}px`:l},children:st__namespace.default.Children.map(s,g=>st__namespace.default.isValidElement(g)?st__namespace.default.cloneElement(g,{size:d,variant:u}):g)})}function Lp({name:e,defaultValue:r,label:t,description:o,children:n,...a}){let{control:i,formState:s}=reactHookForm.useFormContext(),d=D(s.errors,e);return jsxRuntime.jsx(reactHookForm.Controller,{control:i,name:e,defaultValue:r,render:({field:u})=>jsxRuntime.jsxs("div",{className:"flex flex-col gap-1",children:[t&&jsxRuntime.jsx(W,{children:t}),o&&jsxRuntime.jsx(I,{children:o}),jsxRuntime.jsx(xo,{...a,value:u.value,onChange:c=>u.onChange(c),children:n}),d&&jsxRuntime.jsx(f,{children:d})]})})}function Wi(e){return "primary"}var $i=st.createContext({variant:"primary"});function bo(e){let{variant:r="primary",...t}=e,o=Wi();return jsxRuntime.jsx($i.Provider,{value:{variant:o},children:jsxRuntime.jsxs(reactAriaComponents.RadioGroup,{...t,className:G(e.className,"group flex flex-col gap-2"),children:[jsxRuntime.jsx(W,{children:e.label}),jsxRuntime.jsx("div",{className:`flex ${t.orientation==="horizontal"?"flex-row gap-4":"flex-col gap-2"}`,children:e.children}),e.description&&jsxRuntime.jsx(I,{children:e.description}),jsxRuntime.jsx(f,{children:typeof e.errorMessage=="function"&&e.validationResult?e.errorMessage(e.validationResult):typeof e.errorMessage=="string"?e.errorMessage:null})]})})}function tf({name:e,defaultValue:r,...t}){let{control:o,formState:n}=reactHookForm.useFormContext(),a=D(n.errors,e);return jsxRuntime.jsx(reactHookForm.Controller,{control:o,name:e,defaultValue:r,render:({field:i})=>jsxRuntime.jsx(bo,{...t,value:i.value,onChange:s=>i.onChange(s),errorMessage:a,children:t.children})})}var Xi=e=>{let r=ae({isInvalid:e.isInvalid,isDisabled:e.isDisabled,isFocused:e.isFocused,transparent:e.transparent,size:e.size}),t=[e.showSearchIcon?"":"pl-3",e.isClearable&&e.hasValue||e.isPassword?"pr-8":"pr-3"].join(" ");return tailwindMerge.twMerge(r,t,e.className)};function ut({label:e,description:r,errorMessage:t,size:o="md",tooltip:n,isRequired:a,transparent:i,showSearchIcon:s,isClearable:d,onClear:u,type:c,validationResult:l,reserveErrorSpace:g=true,isLoading:v=false,descriptionPlacement:m="below",...p}){let[C,R]=st__namespace.default.useState(false),{isFocused:P,handleFocus:V,handleBlur:A}=ke(),B=c==="password",F=ft(v,300);return jsxRuntime.jsx(reactAriaComponents.TextField,{...p,isRequired:a,className:G(p.className,"group flex flex-col"),children:({isDisabled:k,isInvalid:Q})=>jsxRuntime.jsxs("div",{className:"flex flex-col",children:[e&&jsxRuntime.jsx(W,{size:o,tooltip:n,description:m==="tooltip"||m==="inline"?r:void 0,descriptionPlacement:m,isRequired:a,children:e}),jsxRuntime.jsxs(oe,{children:[s&&jsxRuntime.jsx("div",{className:"pointer-events-none absolute top-1/2 -translate-y-1/2 transform flex items-center z-10",style:{left:9},children:(()=>{let S={sm:14,md:16,lg:18,xl:20}[o];return F?jsxRuntime.jsx(Ke,{size:S,color:"text-text-secondary"}):jsxRuntime.jsx(y,{name:"MagnifyingGlass",size:S,className:`transition-colors ${P?"text-action-brand":"text-text-secondary"}`})})()}),jsxRuntime.jsx(yt,{size:o,disabled:k,type:B?C?"text":"password":c,name:p.name,autoComplete:p.autoComplete,value:p.value,defaultValue:p.defaultValue,placeholder:p.placeholder,onFocus:S=>V(S,p.onFocus),onBlur:S=>A(S,p.onBlur),onChange:S=>p.onChange?.(S.target.value),style:s?{paddingLeft:{sm:28,md:32,lg:36,xl:37}[o]}:void 0,className:Xi({isInvalid:Q,isDisabled:k,isFocused:P,size:o,transparent:i,showSearchIcon:s,isClearable:d,hasValue:!!p.value,isPassword:B,className:typeof p.className=="string"?p.className:void 0})}),d&&p.value&&!k&&jsxRuntime.jsx(et,{onClick:()=>{u?u():p.onChange&&p.onChange("");},size:o}),B&&!k&&jsxRuntime.jsx("button",{type:"button",onClick:()=>R(!C),className:"absolute right-3 top-1/2 -translate-y-1/2 transform text-text-secondary hover:text-text-primary","aria-label":C?"Hide password":"Show password",onMouseDown:S=>{S.preventDefault(),S.stopPropagation();},children:jsxRuntime.jsx(y,{name:C?"EyeSlash":"Eye",size:o==="sm"?16:20,className:"text-text-primary"})})]}),g?jsxRuntime.jsx("div",{className:"mt-1 min-h-[20px]",children:typeof t=="string"?jsxRuntime.jsx(f,{size:o,children:t}):typeof t=="function"&&l?jsxRuntime.jsx(f,{size:o,children:t(l)}):r&&m==="below"?jsxRuntime.jsx(I,{size:o,children:r}):null}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:typeof t=="string"?jsxRuntime.jsx(f,{size:o,className:"mt-1",children:t}):typeof t=="function"&&l?jsxRuntime.jsx(f,{size:o,className:"mt-1",children:t(l)}):r&&m==="below"?jsxRuntime.jsx(I,{size:o,className:"mt-1",children:r}):null})]})})}var ss={sm:{toolbar:"p-1.5",contentWrapper:"min-h-[100px]",contentPadding:"p-3",placeholderPos:"left-3 top-3",prose:"prose-xs",h1:"[&_.ProseMirror_h1]:mb-2 [&_.ProseMirror_h1]:text-base [&_.ProseMirror_h1]:font-bold",h2:"[&_.ProseMirror_h2]:mb-1.5 [&_.ProseMirror_h2]:text-sm [&_.ProseMirror_h2]:font-semibold",p:"[&_.ProseMirror_p]:mb-1",list:"[&_.ProseMirror_ul]:mb-1 [&_.ProseMirror_ul]:ml-4 [&_.ProseMirror_ol]:mb-1 [&_.ProseMirror_ol]:ml-4",li:"[&_.ProseMirror_li]:mb-0.5",placeholderText:"text-xs"},md:{toolbar:"p-2",contentWrapper:"min-h-[200px]",contentPadding:"p-4",placeholderPos:"left-4 top-4",prose:"prose-sm",h1:"[&_.ProseMirror_h1]:mb-4 [&_.ProseMirror_h1]:text-2xl [&_.ProseMirror_h1]:font-bold",h2:"[&_.ProseMirror_h2]:mb-3 [&_.ProseMirror_h2]:text-xl [&_.ProseMirror_h2]:font-semibold",p:"[&_.ProseMirror_p]:mb-2",list:"[&_.ProseMirror_ul]:mb-2 [&_.ProseMirror_ul]:ml-6 [&_.ProseMirror_ol]:mb-2 [&_.ProseMirror_ol]:ml-6",li:"[&_.ProseMirror_li]:mb-1",placeholderText:"text-sm"},lg:{toolbar:"p-2.5",contentWrapper:"min-h-[250px]",contentPadding:"p-5",placeholderPos:"left-5 top-5",prose:"prose-base",h1:"[&_.ProseMirror_h1]:mb-5 [&_.ProseMirror_h1]:text-3xl [&_.ProseMirror_h1]:font-bold",h2:"[&_.ProseMirror_h2]:mb-4 [&_.ProseMirror_h2]:text-2xl [&_.ProseMirror_h2]:font-semibold",p:"[&_.ProseMirror_p]:mb-3",list:"[&_.ProseMirror_ul]:mb-3 [&_.ProseMirror_ul]:ml-6 [&_.ProseMirror_ol]:mb-3 [&_.ProseMirror_ol]:ml-6",li:"[&_.ProseMirror_li]:mb-1.5",placeholderText:"text-base"},xl:{toolbar:"p-3",contentWrapper:"min-h-[300px]",contentPadding:"p-6",placeholderPos:"left-6 top-6",prose:"prose-lg",h1:"[&_.ProseMirror_h1]:mb-6 [&_.ProseMirror_h1]:text-4xl [&_.ProseMirror_h1]:font-bold",h2:"[&_.ProseMirror_h2]:mb-5 [&_.ProseMirror_h2]:text-3xl [&_.ProseMirror_h2]:font-semibold",p:"[&_.ProseMirror_p]:mb-3",list:"[&_.ProseMirror_ul]:mb-3 [&_.ProseMirror_ul]:ml-8 [&_.ProseMirror_ol]:mb-3 [&_.ProseMirror_ol]:ml-8",li:"[&_.ProseMirror_li]:mb-2",placeholderText:"text-lg"}},Qe=({isActive:e=false,onPress:r,children:t})=>jsxRuntime.jsx(T,{variant:e?"secondary":"ghost",size:"sm",onPress:r,className:"p-1",children:t});function ls({initialUrl:e,isOpen:r,onClose:t,onSubmit:o}){let[n,a]=st.useState(e);return st__namespace.default.useEffect(()=>{a(e);},[e]),jsxRuntime.jsx(Ee,{isDismissable:true,isOpen:r,onOpenChange:s=>!s&&t(),children:jsxRuntime.jsx(reactAriaComponents.Modal,{className:"flex items-center justify-center p-4 outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0 focus-visible:ring-0",children:jsxRuntime.jsx(reactAriaComponents.Dialog,{className:"relative bg-background-surface rounded-lg shadow-xl max-w-md w-full",children:jsxRuntime.jsxs("form",{onSubmit:s=>{s.preventDefault(),o(n),t();},children:[jsxRuntime.jsx($e,{title:"Insert Link",onClose:t}),jsxRuntime.jsx("div",{className:"p-6",children:jsxRuntime.jsx(ut,{label:"URL",type:"url",value:n,onChange:a,autoFocus:true,className:"w-full"})}),jsxRuntime.jsxs("div",{className:"flex justify-end gap-2 border-t border-border-muted p-4",children:[jsxRuntime.jsx(T,{variant:"secondary",onPress:t,children:"Cancel"}),jsxRuntime.jsx(T,{type:"submit",children:"Save"})]})]})})})})}function ho({initialContent:e="",onChange:r,className:t,isDisabled:o=false,placeholder:n="Start typing...",id:a,size:i="md",headingLevels:s=[1,2]}){let d=ss[i],[u,c]=st.useState(false),l=react.useEditor({immediatelyRender:false,extensions:[rs__default.default.configure({heading:s.length>0?{levels:s}:false}),Zi__default.default.configure({openOnClick:false,HTMLAttributes:{class:"text-text-link-default hover:text-text-link-hover underline decoration-text-link-default/30 hover:decoration-text-link-hover cursor-pointer"}})],content:e,editable:!o,onUpdate:({editor:m})=>{r?.(m.getHTML());},editorProps:{attributes:{class:tailwindMerge.twMerge(`prose ${d.prose} max-w-none`,"focus:outline-none","[&>*:first-child]:mt-0 [&>*:last-child]:mb-0")}}}),g=()=>{c(true);},v=m=>{m===""?l?.chain().focus().unsetLink().run():l?.chain().focus().setLink({href:m}).run();};return l?jsxRuntime.jsxs("div",{id:a,"data-richtexteditor":true,className:tailwindMerge.twMerge("flex flex-col rounded-md border border-border-input bg-background-input","outline-none focus-within:outline-none focus-within:border-border-input focus-within:ring-0 focus-within:shadow-none",o&&"opacity-50",t),style:{outline:"none"},children:[!o&&l&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(menus.BubbleMenu,{editor:l,shouldShow:({editor:m})=>m.isActive("link")&&!u,className:"flex items-center gap-1 rounded-md border border-border-input bg-background-surface p-1 shadow-md",children:[jsxRuntime.jsxs(T,{variant:"ghost",size:"sm",className:"h-8 px-2",onPress:()=>{let m=l.getAttributes("link").href;m&&window.open(m,"_blank","noopener,noreferrer");},children:[jsxRuntime.jsx(y,{name:"ArrowSquareOut",className:"mr-1 h-4 w-4"}),"Open"]}),jsxRuntime.jsxs(T,{variant:"ghost",size:"sm",className:"h-8 px-2",onPress:g,children:[jsxRuntime.jsx(y,{name:"PencilSimple",className:"mr-1 h-4 w-4"}),"Edit"]}),jsxRuntime.jsxs(T,{variant:"ghost",size:"sm",className:"h-8 px-2",onPress:()=>l.chain().focus().unsetLink().run(),children:[jsxRuntime.jsx(y,{name:"X",className:"mr-1 h-4 w-4"}),"Remove"]})]}),jsxRuntime.jsx(ls,{isOpen:u,onClose:()=>c(false),onSubmit:v,initialUrl:l.getAttributes("link").href||""})]}),jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("flex items-center gap-1 border-b border-border-input",d.toolbar),children:[s.map(m=>jsxRuntime.jsx(Qe,{isActive:l.isActive("heading",{level:m}),onPress:()=>l.chain().focus().toggleHeading({level:m}).run(),children:jsxRuntime.jsxs("span",{className:"text-xs font-bold",children:["H",m]})},m)),jsxRuntime.jsx(Qe,{isActive:l.isActive("bold"),onPress:()=>l.chain().focus().toggleBold().run(),children:jsxRuntime.jsx("span",{className:"text-xs font-bold",children:"B"})}),jsxRuntime.jsx(Qe,{isActive:l.isActive("italic"),onPress:()=>l.chain().focus().toggleItalic().run(),children:jsxRuntime.jsx("span",{className:"text-xs italic",children:"I"})}),jsxRuntime.jsx("div",{className:"mx-1 h-4 w-px bg-border-muted"}),jsxRuntime.jsx(Qe,{isActive:l.isActive("bulletList"),onPress:()=>l.chain().focus().toggleBulletList().run(),children:jsxRuntime.jsx(y,{name:"ListBullets",className:"h-4 w-4"})}),jsxRuntime.jsx(Qe,{isActive:l.isActive("orderedList"),onPress:()=>l.chain().focus().toggleOrderedList().run(),children:jsxRuntime.jsx(y,{name:"ListNumbers",className:"h-4 w-4"})}),jsxRuntime.jsx("div",{className:"mx-1 h-4 w-px bg-border-muted"}),jsxRuntime.jsx(Qe,{isActive:l.isActive("link"),onPress:g,children:jsxRuntime.jsx(y,{name:"PaperclipHorizontal",className:"h-4 w-4"})})]}),jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("relative w-full outline-none focus:outline-none",d.contentWrapper),children:[jsxRuntime.jsx(react.EditorContent,{editor:l,className:tailwindMerge.twMerge("w-full outline-none focus:outline-none",d.contentPadding,"[&_.ProseMirror]:min-h-[inherit]","[&_.ProseMirror]:outline-none [&_.ProseMirror]:focus:outline-none",d.h1,d.h2,d.p,"[&_.ProseMirror_ul]:list-disc","[&_.ProseMirror_ol]:list-decimal",d.list,d.li,"[&_.ProseMirror_blockquote]:border-l-4 [&_.ProseMirror_blockquote]:border-border-muted [&_.ProseMirror_blockquote]:pl-4 [&_.ProseMirror_blockquote]:italic","[&_.ProseMirror_code]:rounded [&_.ProseMirror_code]:bg-background-muted [&_.ProseMirror_code]:px-1 [&_.ProseMirror_code]:py-0.5 [&_.ProseMirror_code]:font-mono [&_.ProseMirror_code]:text-sm","[&_.ProseMirror_pre]:rounded-md [&_.ProseMirror_pre]:bg-background-muted [&_.ProseMirror_pre]:p-3 [&_.ProseMirror_pre]:font-mono [&_.ProseMirror_pre]:text-sm","[&_.ProseMirror_hr]:border-border-muted",o&&"pointer-events-none")}),l.isEmpty&&!o&&jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("pointer-events-none absolute text-text-secondary",d.placeholderPos,d.placeholderText),children:n})]})]}):null}function zf({name:e,defaultValue:r,label:t,description:o,reserveErrorSpace:n=true,...a}){let{control:i,formState:s}=reactHookForm.useFormContext(),d=D(s.errors,e);return jsxRuntime.jsx(reactHookForm.Controller,{control:i,name:e,defaultValue:r,render:({field:u})=>jsxRuntime.jsxs("div",{className:"flex flex-col gap-1",children:[t&&jsxRuntime.jsx("label",{htmlFor:e,className:"text-sm font-medium text-text-primary",children:t}),o&&jsxRuntime.jsx("p",{className:"text-sm text-text-secondary",children:o}),jsxRuntime.jsx(ho,{...a,id:e,initialContent:u.value??"",onChange:c=>u.onChange(c)}),d&&jsxRuntime.jsx("p",{className:"text-sm text-feedback-error-text",children:d}),n&&!d&&jsxRuntime.jsx("div",{className:"h-5"})]})})}function Kf({name:e,defaultValue:r,onValueChange:t,...o}){let{control:n,formState:a}=reactHookForm.useFormContext(),i=D(a.errors,e);return jsxRuntime.jsx(reactHookForm.Controller,{control:n,name:e,defaultValue:r,render:({field:s})=>jsxRuntime.jsx(Zt,{...o,selectedKey:s.value??null,onSelectionChange:d=>{s.onChange(d),t?.(d);},showErrors:!!i,errorMessage:i})})}var vo={sm:{track:"h-4 w-7",handle:"h-3.5 w-3.5",text:"text-xs"},md:{track:"h-5 w-9",handle:"h-4 w-4",text:"text-sm"},lg:{track:"h-6 w-11",handle:"h-5 w-5",text:"text-base"},xl:{track:"h-7 w-14",handle:"h-6 w-6",text:"text-lg"}};function xs({isSelected:e,isDisabled:r,size:t="md"}){let o="flex px-px items-center shrink-0 cursor-default rounded-full transition duration-200 ease-in-out shadow-inner border border-transparent",n=vo[t].track,a=Be,i="focus-visible:outline-action-primary",s="";return e?s="bg-action-primary forced-colors:!bg-[Highlight] group-pressed:bg-action-primary-hover":s="bg-border-input group-pressed:bg-border-focus",[o,n,a,i,s,r?"bg-background-muted forced-colors:group-selected:!bg-[GrayText] forced-colors:border-[GrayText]":""].filter(Boolean).join(" ")}function bs({isSelected:e,isDisabled:r,size:t="md"}){let o="transform rounded-full bg-background-surface outline-none shadow transition duration-200 ease-in-out",n=vo[t].handle;return [o,n,e?"translate-x-[100%]":"translate-x-0",r?"forced-colors:outline-[GrayText]":""].filter(Boolean).join(" ")}function Po({children:e,variant:r="primary",size:t="md",...o}){return jsxRuntime.jsx(reactAriaComponents.Switch,{...o,className:G(o.className,`relative group flex items-center gap-2 ${vo[t].text} text-text-primary transition disabled:text-text-disabled forced-colors:disabled:text-[GrayText]`),children:n=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:xs({...n,size:t}),children:jsxRuntime.jsx("span",{className:bs({...n,size:t})})}),e]})})}function ag({name:e,defaultValue:r,...t}){let{control:o}=reactHookForm.useFormContext();return jsxRuntime.jsx(reactHookForm.Controller,{control:o,name:e,defaultValue:r,render:({field:n})=>jsxRuntime.jsx(Po,{...t,isSelected:!!n.value,onChange:a=>n.onChange(a),children:t.children})})}var Rs=e=>{let r=ae({isInvalid:e.isInvalid,isDisabled:e.isDisabled,isFocused:e.isFocused,transparent:e.transparent,size:e.size}),t=`min-h-[100px] py-2 ${e.isDisabled?"resize-none":e.isResizable?"resize-y":"resize-none"}`;return tailwindMerge.twMerge(r,t,e.className)};function Co({label:e,description:r,errorMessage:t,size:o="md",tooltip:n,required:a,transparent:i,isInvalid:s,isDisabled:d,isResizable:u=false,className:c,validationResult:l,reserveErrorSpace:g=true,...v}){let{isFocused:m,handleFocus:p,handleBlur:C}=ke();return jsxRuntime.jsx("div",{className:"group flex flex-col",children:jsxRuntime.jsxs("div",{className:"flex flex-col",children:[e&&jsxRuntime.jsx(W,{size:o,tooltip:n,isRequired:a,children:e}),jsxRuntime.jsx(oe,{children:jsxRuntime.jsx("textarea",{...v,required:a,onFocus:R=>{v.onFocus&&v.onFocus(R),p(R);},onBlur:R=>{v.onBlur&&v.onBlur(R),C(R);},className:Rs({isInvalid:s,isDisabled:d,isResizable:u,isFocused:m,size:o,transparent:i,className:c}),disabled:d})}),g?jsxRuntime.jsx("div",{className:"mt-1 min-h-[20px]",children:typeof t=="string"?jsxRuntime.jsx(f,{size:o,children:t}):typeof t=="function"&&l?jsxRuntime.jsx(f,{size:o,children:t(l)}):r?jsxRuntime.jsx(I,{size:o,children:r}):null}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:typeof t=="string"?jsxRuntime.jsx(f,{size:o,className:"mt-1",children:t}):typeof t=="function"&&l?jsxRuntime.jsx(f,{size:o,className:"mt-1",children:t(l)}):r?jsxRuntime.jsx(I,{size:o,className:"mt-1",children:r}):null})]})})}function hg({name:e,defaultValue:r,...t}){let{control:o,formState:n}=reactHookForm.useFormContext(),a=D(n.errors,e);return jsxRuntime.jsx(reactHookForm.Controller,{control:o,name:e,defaultValue:r,render:({field:i})=>jsxRuntime.jsx(Co,{...t,value:i.value??"",onChange:s=>i.onChange(s.target.value),onBlur:s=>{i.onBlur(),t.onBlur?.(s);},isInvalid:!!a,errorMessage:a,required:t.required})})}function Fg({name:e,defaultValue:r,...t}){let{control:o,formState:n}=reactHookForm.useFormContext(),a=D(n.errors,e);return jsxRuntime.jsx(reactHookForm.Controller,{control:o,name:e,defaultValue:r,render:({field:i})=>jsxRuntime.jsx(ut,{...t,value:i.value??"",onChange:s=>i.onChange(s),onBlur:s=>{i.onBlur(),t.onBlur?.(s);},isInvalid:!!a,errorMessage:a,isRequired:t.isRequired})})}function Vs({isPlaceholder:e,isDisabled:r,size:t="md"}){return tailwindMerge.twMerge("inline-block box-content px-0.5 rounded outline-none tabular-nums text-center transition-colors",{sm:"text-base md:text-xs",md:"text-base md:text-sm",lg:"text-base",xl:"text-lg"}[t],e?"text-text-disabled italic":"text-text-primary",r?"text-text-disabled cursor-not-allowed":"cursor-text",!r&&"hover:bg-background-hover","data-[focused]:bg-background-selected data-[focused]:text-text-primary")}function Ro({label:e,description:r,errorMessage:t,size:o="md",tooltip:n,isRequired:a,isDisabled:i,isInvalid:s,reserveErrorSpace:d=true,validationResult:u,className:c,descriptionPlacement:l="below",...g}){return jsxRuntime.jsxs(reactAriaComponents.TimeField,{...g,isDisabled:i,isRequired:a,isInvalid:s,className:G(c,"flex flex-col gap-1"),children:[e&&jsxRuntime.jsx(W,{size:o,tooltip:n,description:l==="tooltip"||l==="inline"?r:void 0,descriptionPlacement:l,isRequired:a,children:e}),jsxRuntime.jsx(oe,{children:jsxRuntime.jsx(reactAriaComponents.DateInput,{className:tailwindMerge.twMerge(tt({isInvalid:s,isDisabled:i}),"px-3 py-2 flex items-center gap-0.5 w-full"),children:v=>jsxRuntime.jsx(reactAriaComponents.DateSegment,{segment:v,className:Vs({isPlaceholder:v.isPlaceholder,isDisabled:!v.isEditable||i,size:o})})})}),d?jsxRuntime.jsx("div",{className:"mt-1 min-h-[20px]",children:typeof t=="string"?jsxRuntime.jsx(f,{size:o,children:t}):typeof t=="function"&&u?jsxRuntime.jsx(f,{size:o,children:t(u)}):r&&l==="below"?jsxRuntime.jsx(I,{size:o,children:r}):null}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:typeof t=="string"?jsxRuntime.jsx(f,{size:o,className:"mt-1",children:t}):typeof t=="function"&&u?jsxRuntime.jsx(f,{size:o,className:"mt-1",children:t(u)}):r&&l==="below"?jsxRuntime.jsx(I,{size:o,className:"mt-1",children:r}):null})]})}function $g({name:e,...r}){let{control:t,formState:{errors:o}}=reactHookForm.useFormContext(),n=o[e],a=n?.message;return jsxRuntime.jsx(reactHookForm.Controller,{name:e,control:t,render:({field:i})=>jsxRuntime.jsx(Ro,{...r,value:i.value,onChange:i.onChange,isInvalid:!!n,errorMessage:a})})}function jg({className:e,title:r="Please fix the following errors:",autoFocus:t=true}){let{formState:o}=reactHookForm.useFormContext(),n=st__namespace.useRef(null),a=o.errors,i=Object.entries(a||{}),s=i.length>0;if(st__namespace.useEffect(()=>{t&&s&&n.current?.focus();},[t,s]),!s)return null;let d=u=>{let c=`[name="${CSS.escape(u)}"]`,l=document.querySelector(c);l&&(l.focus(),l.scrollIntoView({block:"center",behavior:"smooth"}));};return jsxRuntime.jsxs("div",{ref:n,role:"alert",tabIndex:-1,className:tailwindMerge.twMerge("rounded-md border border-feedback-error-border bg-feedback-error-background p-3 text-sm text-feedback-error-text",e),children:[jsxRuntime.jsx("div",{className:"font-medium",children:r}),jsxRuntime.jsx("ul",{className:"mt-2 list-disc pl-5",children:i.map(([u,c])=>{let l=c?.message||"Invalid value";return jsxRuntime.jsx("li",{children:jsxRuntime.jsx("button",{type:"button",className:"underline underline-offset-2",onClick:()=>d(u),children:l})},u)})})]})}function ex({formId:e,disableWhenInvalid:r,disableWhenPristine:t,isDisabled:o,children:n,...a}){let{formState:i}=reactHookForm.useFormContext(),s=o||i.isSubmitting||r&&!i.isValid||t&&!i.isDirty;return jsxRuntime.jsx(T,{type:"submit",form:e,isDisabled:s,...a,children:n})}function ix({name:e,getItemTitle:r,renderItem:t,onAdd:o}){let{control:n}=reactHookForm.useFormContext(),{fields:a,append:i,remove:s,swap:d}=reactHookForm.useFieldArray({control:n,name:e});return jsxRuntime.jsxs("div",{className:"flex flex-col gap-3",children:[a.map((u,c)=>jsxRuntime.jsxs(be,{children:[jsxRuntime.jsx(vt,{title:r?r(c):`Item ${c+1}`,actions:jsxRuntime.jsxs("div",{className:"flex gap-2",children:[c>0&&jsxRuntime.jsx(T,{size:"sm",variant:"secondary",onPress:()=>d(c,c-1),children:"Up"}),c<a.length-1&&jsxRuntime.jsx(T,{size:"sm",variant:"secondary",onPress:()=>d(c,c+1),children:"Down"}),jsxRuntime.jsx(T,{size:"sm",variant:"secondary",onPress:()=>s(c),children:"Remove"})]})}),jsxRuntime.jsx(Pt,{children:t(c)})]},u.id)),jsxRuntime.jsx("div",{children:jsxRuntime.jsx(T,{variant:"secondary",onPress:()=>i(o?.()||{}),children:"Add item"})})]})}function To(e){return jsxRuntime.jsx(reactAriaComponents.Form,{validationBehavior:"aria",...e,className:tailwindMerge.twMerge("flex flex-col gap-6",e.className)})}function kr(e){let r=e.querySelector("[aria-invalid='true'], .aria-invalid, [data-invalid='true']")||e.querySelector("input[aria-invalid='true'], select[aria-invalid='true'], textarea[aria-invalid='true']")||e.querySelector("input, select, textarea");r&&(r.focus({preventScroll:false}),r instanceof HTMLElement&&r.scrollIntoView({block:"center",behavior:"smooth"}));}function vx({id:e,onSubmit:r,onInvalid:t,children:o,shouldFocusError:n=true,className:a,...i}){let s=reactHookForm.useForm(i),d=(u,c)=>{if(n&&e){let l=document.getElementById(e);l&&kr(l);}t?.(u,c);};return jsxRuntime.jsx(reactHookForm.FormProvider,{...s,children:jsxRuntime.jsx(To,{id:e,className:a,onSubmit:s.handleSubmit(r,d),children:o})})}function Ir({formId:e,show:r,isSubmitting:t,onCancel:o,primaryLabel:n="Save changes",secondaryLabel:a="Cancel",className:i}){return r?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",i),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(T,{variant:"secondary",onPress:o,children:a}),jsxRuntime.jsx(T,{type:"submit",form:e,isDisabled:!!t,children:t?"Saving...":n})]})]})}):null}function wx({formId:e,onCancel:r,primaryLabel:t,secondaryLabel:o,className:n}){let{formState:a}=reactHookForm.useFormContext();return jsxRuntime.jsx(Ir,{formId:e,show:a.isDirty,isSubmitting:a.isSubmitting,onCancel:r,primaryLabel:t,secondaryLabel:o,className:n})}function Vx(e=true){let{formState:r}=reactHookForm.useFormContext();st__namespace.useEffect(()=>{if(!e||!r.isSubmitted||!r.errors||Object.keys(r.errors).length===0)return;let t=document.querySelector("[aria-invalid='true'], .aria-invalid, [data-invalid='true']")||document.querySelector("input[aria-invalid='true'], select[aria-invalid='true'], textarea[aria-invalid='true']");t&&t.scrollIntoView({block:"center",behavior:"smooth"});},[e,r.isSubmitted,r.errors]);}function Ax({delayMs:e=800,onAutoSave:r}){let{watch:t,formState:o,getValues:n}=reactHookForm.useFormContext(),a=st__namespace.useRef(void 0);st__namespace.useEffect(()=>{let i=t(()=>{o.isDirty&&(a.current&&window.clearTimeout(a.current),a.current=window.setTimeout(async()=>{let s=n();await r(s);},e));});return ()=>{i.unsubscribe(),a.current&&window.clearTimeout(a.current);}},[t,o.isDirty,n,e,r]);}
2
- Object.defineProperty(exports,"Controller",{enumerable:true,get:function(){return reactHookForm.Controller}});Object.defineProperty(exports,"useFieldArray",{enumerable:true,get:function(){return reactHookForm.useFieldArray}});Object.defineProperty(exports,"useFormContext",{enumerable:true,get:function(){return reactHookForm.useFormContext}});Object.defineProperty(exports,"useWatch",{enumerable:true,get:function(){return reactHookForm.useWatch}});exports.ErrorSummary=jg;exports.FieldArrayList=ix;exports.FormAutocomplete=gu;exports.FormCheckbox=Eu;exports.FormCheckboxGroup=_u;exports.FormColorField=om;exports.FormDateField=Dm;exports.FormFileUpload=Xm;exports.FormNumberField=xp;exports.FormProvider=vx;exports.FormRadioCardGroup=Lp;exports.FormRadioGroup=tf;exports.FormRichTextEditor=zf;exports.FormSaveBar=wx;exports.FormSelect=Kf;exports.FormSwitch=ag;exports.FormTextArea=hg;exports.FormTextField=Fg;exports.FormTimeField=$g;exports.SubmitButton=ex;exports.focusFirstError=kr;exports.useAutoSave=Ax;exports.useScrollIntoViewOnError=Vx;//# sourceMappingURL=index.cjs.map
1
+ 'use strict';var reactHookForm=require('react-hook-form'),lt=require('react'),reactAria=require('react-aria'),reactAriaComponents=require('react-aria-components'),reactStately=require('react-stately'),tailwindMerge=require('tailwind-merge'),Vo=require('@phosphor-icons/react'),jsxRuntime=require('react/jsx-runtime'),lucideReact=require('lucide-react'),reactColorful=require('react-colorful'),as=require('@tiptap/extension-link'),react=require('@tiptap/react'),menus=require('@tiptap/react/menus'),ds=require('@tiptap/starter-kit');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}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 lt__namespace=/*#__PURE__*/_interopNamespace(lt);var Vo__namespace=/*#__PURE__*/_interopNamespace(Vo);var as__default=/*#__PURE__*/_interopDefault(as);var ds__default=/*#__PURE__*/_interopDefault(ds);var Lr=Object.defineProperty;var Dr=(e,o,t)=>o in e?Lr(e,o,{enumerable:true,configurable:true,writable:true,value:t}):e[o]=t;var Lt=(e,o,t)=>Dr(e,typeof o!="symbol"?o+"":o,t);function _e(e,o=false){let[t,r]=lt.useState(o);return lt.useEffect(()=>{if(typeof window>"u")return;let n=window.matchMedia(e);r(n.matches);let a=i=>{r(i.matches);};return n.addEventListener("change",a),()=>{n.removeEventListener("change",a);}},[e]),t}var Ze={sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"};function ft(e="base"){let o=_e(`(min-width: ${Ze.sm})`,e!=="base"),t=_e(`(min-width: ${Ze.md})`,["md","lg","xl","2xl"].includes(e)),r=_e(`(min-width: ${Ze.lg})`,["lg","xl","2xl"].includes(e)),n=_e(`(min-width: ${Ze.xl})`,["xl","2xl"].includes(e)),a=_e(`(min-width: ${Ze["2xl"]})`,e==="2xl"),i=!t,s=t,d="base";return a?d="2xl":n?d="xl":r?d="lg":t?d="md":o&&(d="sm"),{current:d,isSm:o,isMd:t,isLg:r,isXl:n,is2Xl:a,isMobile:i,isDesktop:s}}function So(e,o=300){let[t,r]=lt.useState(e);return lt.useEffect(()=>{let n=setTimeout(()=>r(e),o);return ()=>clearTimeout(n)},[e,o]),t}function gt(e,o=300){let[t,r]=lt.useState(false);return lt.useEffect(()=>{if(e){let n=setTimeout(()=>{r(true);},o);return ()=>clearTimeout(n)}r(false);},[e,o]),t}function xt(...e){return e.filter(Boolean).join(" ")}var Pe={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 wo(e,...o){return xt(Pe[e],...o)}function Ee(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"}`}function G(e,o){return reactAriaComponents.composeRenderProps(e,t=>tailwindMerge.twMerge(o,t))}var q={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 K(e,o){let t=lt.forwardRef(({size:r=24,color:n="currentColor",className:a,mirrored:i,alt:s,...d},u)=>{let c=!!s||"aria-label"in d;return jsxRuntime.jsx("svg",{ref:u,xmlns:"http://www.w3.org/2000/svg",width:r,height:r,viewBox:"0 0 256 256",fill:n,className:a,transform:i?"scale(-1, 1)":void 0,"aria-hidden":c?void 0:true,role:c?"img":void 0,"aria-label":s,...d,children:o})});return t.displayName=e,t}var bt=()=>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"})]}),Io=()=>jsxRuntime.jsx("path",{d:"M166 120 88 70",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round"}),Eo=()=>jsxRuntime.jsx("path",{d:"M162 122 92 128",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round"}),Bo=()=>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"})]}),Ur=K("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"})]})),Kr=K("TextureFuse",jsxRuntime.jsx("path",{d:"M20 128h72q18 -84 36 0q18 84 36 0h72",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round",strokeLinejoin:"round"})),Yr=K("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"})]})),jr=K("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"})]})),Qr=K("TextureCapacitor",jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx("path",{d:"M4 128h106M146 128h106M110 72v112M146 72v112",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round"})})),Xr=K("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"})]})),Jr=K("TextureSwitch",jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(bt,{}),jsxRuntime.jsx(Io,{})]})),Zr=K("TextureSwitchClosed",jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(bt,{}),jsxRuntime.jsx(Eo,{})]})),en=K("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"})]})),tn=K("TextureSectionalizerOpen",jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(bt,{}),jsxRuntime.jsx(Io,{}),jsxRuntime.jsx(Bo,{})]})),on=K("TextureSectionalizerClosed",jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(bt,{}),jsxRuntime.jsx(Eo,{}),jsxRuntime.jsx(Bo,{})]})),rn=K("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"})]})),He={1:[128],2:[110,146],3:[92,128,164]},Dt=e=>jsxRuntime.jsx("path",{d:`M24 ${e}h208`,fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round"},e),At=e=>jsxRuntime.jsx("path",{d:`M24 ${e}h208`,fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round",pathLength:100,strokeDasharray:"20 20"},e),nn=K("TextureSinglePhaseOverheadLine",jsxRuntime.jsx(jsxRuntime.Fragment,{children:He[1].map(Dt)})),an=K("TextureTwoPhaseOverheadLine",jsxRuntime.jsx(jsxRuntime.Fragment,{children:He[2].map(Dt)})),sn=K("TextureThreePhaseOverheadLine",jsxRuntime.jsx(jsxRuntime.Fragment,{children:He[3].map(Dt)})),ln=K("TextureSinglePhaseUndergroundLine",jsxRuntime.jsx(jsxRuntime.Fragment,{children:He[1].map(At)})),dn=K("TextureTwoPhaseUndergroundLine",jsxRuntime.jsx(jsxRuntime.Fragment,{children:He[2].map(At)})),cn=K("TextureThreePhaseUndergroundLine",jsxRuntime.jsx(jsxRuntime.Fragment,{children:He[3].map(At)})),un=K("TextureSupportStructure",jsxRuntime.jsx("circle",{cx:"128",cy:"128",r:"40",fill:"currentColor",stroke:"none"})),ht={TextureRecloser:Ur,TextureFuse:Kr,TextureBreaker:Yr,TextureSource:jr,TextureCapacitor:Qr,TextureRegulator:Xr,TextureSwitch:Jr,TextureSwitchClosed:Zr,TextureOpenPoint:en,TextureSectionalizerOpen:tn,TextureSectionalizerClosed:on,TextureTransformer:rn,TextureSinglePhaseOverheadLine:nn,TextureTwoPhaseOverheadLine:an,TextureThreePhaseOverheadLine:sn,TextureSinglePhaseUndergroundLine:ln,TextureTwoPhaseUndergroundLine:dn,TextureThreePhaseUndergroundLine:cn,TextureSupportStructure:un};if(process.env.NODE_ENV==="development")for(let e of Object.keys(ht))e in Vo__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 ze={xs:16,sm:20,md:24,lg:32,xl:40,"2xl":48},y=lt.memo(({name:e,size:o="md",color:t,weight:r="regular",className:n,ariaLabel:a,...i})=>{let s=ht[e]??Vo__namespace[e];if(!s)return process.env.NODE_ENV==="development"&&console.error(`Icon "${e}" not found in @phosphor-icons/react or the custom icon registry`),null;let d=typeof o=="string"&&o in ze?ze[o]:o,u=tailwindMerge.twMerge("inline-block flex-shrink-0",!t&&"text-current",n);return jsxRuntime.jsx(s,{...i,size:d,color:t,weight:r,className:u,"aria-label":a||`${e} icon`,"data-testid":`icon-${e}`})});y.displayName="Icon";var mn=lt.memo(({variant:e="subtle",shape:o="square",containerSize:t,containerClassName:r,size:n="md",className:a,name:i,color:s,weight:d,ariaLabel:u,ref:c,...l})=>{let g=typeof n=="string"&&n in ze?ze[n]:n,v=t?typeof t=="string"&&t in ze?ze[t]:t:g*1.75,m=tailwindMerge.twMerge("inline-flex items-center justify-center flex-shrink-0",o==="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",r);return jsxRuntime.jsx("div",{className:m,style:{width:v,height:v},children:jsxRuntime.jsx(y,{...l,name:i,size:n,color:s,weight:d,className:a,ariaLabel:u})})});mn.displayName="IconWithContainer";var bn=({isEntering:e,isExiting:o,className:t})=>["max-w-[200px] group bg-action-default border border-action-default-hover text-[color:var(--color-action-default-text)] text-sm rounded-lg drop-shadow-lg will-change-transform px-3 py-1",e?"animate-in fade-in placement-bottom:slide-in-from-top-0.5 placement-top:slide-in-from-bottom-0.5 placement-left:slide-in-from-right-0.5 placement-right:slide-in-from-left-0.5 ease-out duration-200":"",o?"animate-out fade-out placement-bottom:slide-out-to-top-0.5 placement-top:slide-out-to-bottom-0.5 placement-left:slide-out-to-right-0.5 placement-right:slide-out-to-left-0.5 ease-in duration-150":"",t].filter(Boolean).join(" ");function Mo({children:e,content:o,...t}){return jsxRuntime.jsxs(reactAriaComponents.TooltipTrigger,{delay:200,children:[e,jsxRuntime.jsxs(reactAriaComponents.Tooltip,{...t,offset:10,className:reactAriaComponents.composeRenderProps(t.className,(r,n)=>bn({...n,className:r})),children:[jsxRuntime.jsx(reactAriaComponents.OverlayArrow,{children:jsxRuntime.jsx("svg",{width:8,height:8,viewBox:"0 0 8 8",className:"fill-action-default stroke-action-default-hover group-placement-left:-rotate-90 group-placement-right:rotate-90 group-placement-bottom:rotate-180 forced-colors:fill-[Canvas] forced-colors:stroke-[ButtonBorder]",children:jsxRuntime.jsx("path",{d:"M0 0 L4 4 L8 0"})})}),o]})]})}function ke(){let[e,o]=lt__namespace.default.useState(false),t=lt__namespace.default.useCallback((n,a)=>{o(true),a?.(n);},[]),r=lt__namespace.default.useCallback((n,a)=>{o(false),a?.(n);},[]);return {isFocused:e,handleFocus:t,handleBlur:r}}var oe=lt__namespace.default.forwardRef(({children:e,className:o},t)=>jsxRuntime.jsx("div",{ref:t,className:tailwindMerge.twMerge("relative w-full",o),children:e}));oe.displayName="InputWrapper";function et({onClick:e,size:o="md",className:t}){return jsxRuntime.jsx("button",{type:"button",onClick:r=>{r.preventDefault(),r.stopPropagation(),e();},className:tailwindMerge.twMerge("absolute right-2 top-[48%] -translate-y-1/2 transform text-text-secondary hover:text-text-primary cursor-pointer",t),"aria-label":"Clear input",onMouseDown:r=>{r.preventDefault(),r.stopPropagation();},children:jsxRuntime.jsx(y,{name:"X",size:o==="sm"?16:20})})}function tt(e){let{isInvalid:o,isDisabled:t,isFocused:r}=e,n="border rounded-[var(--control-border-radius)] !outline-none ";return t?`${n} border-border-muted`:o&&r?`${n} border-feedback-error-border shadow-[inset_0_0_0_1px_var(--color-feedback-error-border)]`:o?`${n} border-feedback-error-border`:r?`${n} border-border-focus shadow-[inset_0_0_0_1px_var(--color-border-focus)]`:`${n} border-border-input`}function hn(e){return e.isDisabled?"bg-background-muted":e.transparent?"bg-transparent":"bg-background-input"}function yn(e){return e==="sm"?"!text-base md:!text-[length:var(--control-text-sm)]":e==="md"?"!text-base md:!text-[length:var(--control-text-md)]":""}function ae(e){let{isInvalid:o,isDisabled:t,isFocused:r,transparent:n,size:a="md",className:i}=e;return tailwindMerge.twMerge("w-full",tt({isInvalid:o,isDisabled:t,isFocused:r}),hn({transparent:n,isDisabled:t}),q[a].text,q[a].height,q[a].padding,yn(a),i)}function W({children:e,size:o="md",tooltip:t,description:r,descriptionPlacement:n="below",isRequired:a,className:i,htmlFor:s}){let d=t||r&&n==="tooltip",u=t||r,c=r&&n==="inline",l=jsxRuntime.jsxs("label",{htmlFor:s,className:tailwindMerge.twMerge(q[o].text,"!text-text-label font-semibold flex items-center gap-1",i),children:[e,a&&jsxRuntime.jsx("span",{children:"*"}),d&&jsxRuntime.jsx("span",{className:"inline-flex items-center text-text-secondary",children:jsxRuntime.jsx(y,{name:"Info",size:o==="sm"?16:20})}),c&&jsxRuntime.jsx("span",{className:"text-text-secondary font-normal ml-1",children:r})]});return d&&u?jsxRuntime.jsx(Mo,{content:u,children:l}):l}function I({size:e="md",className:o,children:t,...r}){return jsxRuntime.jsx("div",{...r,className:tailwindMerge.twMerge("leading-[2.25] text-text-secondary",q[e].text,o),children:t})}function f({children:e,size:o="md",className:t}){return jsxRuntime.jsx("div",{role:"alert",className:tailwindMerge.twMerge(q[o].text,"text-feedback-error-text",t),children:e})}function vt({size:e="md",isInvalid:o,isDisabled:t,isFocused:r,transparent:n,className:a,...i}){return jsxRuntime.jsx("input",{className:ae({isInvalid:o,isDisabled:t,isFocused:r,transparent:n,size:e,className:a}),...i})}var Rn="flex font-medium justify-center items-center gap-2 text-center transition rounded-[var(--control-border-radius)] whitespace-nowrap box-border",Fn="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",Tn={primary:Fn,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"},Ho={full:"w-full",default:"w-fit"},Nn="opacity-50 cursor-not-allowed pointer-events-none",kn="opacity-100 cursor-pointer",Sn={"top-right":"-right-2 -top-2","top-left":"-left-2 -top-2","bottom-right":"-right-2 -bottom-2","bottom-left":"-left-2 -bottom-2"},wn={primary:"bg-action-primary text-[color:var(--color-action-primary-text)]",destructive:"bg-feedback-error-border text-text-inverse"};function In(e){return !e||e==="default"||e==="brand"?"primary":e}function En(e){let{variant:o="primary",size:t="md",isDisabled:r,fullWidth:n=false,isLoading:a=false}=e,i=In(o),s=i==="unstyled"?"":`${Rn} ${Tn[i]}`;i!=="unstyled"&&(s+=` ${q[t].text} ${q[t].height} ${q[t].padding} ${q[t].gap}`),r||a?s+=` ${Nn}`:s+=` ${kn}`,n?s+=` ${Ho.full}`:s+=` ${Ho.default}`;let d=i==="primary"?"focus-visible:outline-action-primary":void 0;return [s,Ee(),d].filter(Boolean).join(" ")}function T(e){let{icon:o,children:t,isLoading:r=false,loadingText:n,loadingIndicator:a,size:i="md",iconPosition:s="left",iconWeight:d,href:u,className:c,badgeNumber:l,badgeVariant:g="primary",badgePosition:v="top-right",style:m,target:p,rel:C,...R}=e,P=o?jsxRuntime.jsx(y,{name:o,size:i,weight:d}):null,V=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[s==="left"&&P,typeof t=="function"?null:t,s==="right"&&P]}),M=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(y,{name:"CircleNotch",size:i,className:"animate-spin","aria-hidden":"true"})}),jsxRuntime.jsx("div",{className:"invisible","aria-hidden":"true",children:V}),n&&jsxRuntime.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:n})]}),E=(l??0)>0,F=tailwindMerge.twMerge(En(e),c),k=u?{href:u,target:p,rel:C,...R}:{};if(u){let{onPress:S,onPressStart:ne,onPressEnd:H,onPressChange:ce,onPressUp:X,onAuxClick:U,onContextMenu:de,onDoubleClick:z,...h}=R;Object.assign(k,h);}let Q=u?jsxRuntime.jsx(reactAriaComponents.Link,{...k,...r&&{"aria-busy":true},style:E?void 0:m,className:F,children:r?M:typeof t=="function"?(function(S){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[s==="left"&&P,t(S),s==="right"&&P]})}):V}):jsxRuntime.jsx(reactAriaComponents.Button,{...R,...r&&{"aria-busy":true},style:E?void 0:m,className:F,children:r?M:typeof t=="function"?(function(S){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[s==="left"&&P,t(S),s==="right"&&P]})}):V});return E?jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("relative flex",c),style:m,children:[Q,jsxRuntime.jsx("span",{className:`absolute ${Sn[v]} flex h-5 w-5 items-center justify-center rounded-full ${wn[g]} text-xs font-medium`,"aria-label":`${l} items`,children:l})]}):Q}function Be({transparent:e=false,className:o,children:t,...r}){return jsxRuntime.jsx(reactAriaComponents.ModalOverlay,{...r,className:reactAriaComponents.composeRenderProps(o,(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:t})}function Gn({isEntering:e,isExiting:o,className:t="",disableGroup:r=false}){let n=[!r&&"group","bg-background-surface","forced-colors:bg-[Canvas]","shadow-lg","rounded-[var(--control-border-radius)]","bg-clip-padding","border","border-border-default","outline-none"].filter(Boolean).join(" "),a=e?["animate-in","fade-in","placement-bottom:slide-in-from-top-1","placement-top:slide-in-from-bottom-1","placement-left:slide-in-from-right-1","placement-right:slide-in-from-left-1","ease-out","duration-200"].join(" "):"",i=o?["animate-out","fade-out","placement-bottom:slide-out-to-top-1","placement-top:slide-out-to-bottom-1","placement-left:slide-out-to-right-1","placement-right:slide-out-to-left-1","ease-in","duration-150"].join(" "):"";return [n,a,i,t].filter(Boolean).join(" ")}function Ge({children:e,showArrow:o=false,withBackdrop:t=false,className:r,isDismissable:n=true,disableGroup:a=false,...i}){let d=reactAriaComponents.useSlottedContext(reactAriaComponents.PopoverContext)?.trigger==="SubmenuTrigger",u=o?12:8;u=d?u-6:u;let c=jsxRuntime.jsxs(reactAriaComponents.Popover,{offset:u,...i,className:reactAriaComponents.composeRenderProps(r,(l,g)=>Gn({...g,className:l,disableGroup:a})),children:[o&&jsxRuntime.jsx(reactAriaComponents.OverlayArrow,{children:jsxRuntime.jsx("svg",{width:12,height:12,viewBox:"0 0 12 12",className:"block fill-background-surface stroke-border-default stroke-1 group-placement-left:-rotate-90 group-placement-right:rotate-90 group-placement-bottom:rotate-180 forced-colors:fill-[Canvas] forced-colors:stroke-[ButtonBorder]",children:jsxRuntime.jsx("path",{d:"M0 0 L6 6 L12 0"})})}),e]});return t?jsxRuntime.jsx(Be,{isDismissable:n,children:jsxRuntime.jsx(reactAriaComponents.Modal,{className:"outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0 focus-visible:ring-0",isDismissable:n,children:c})}):c}function zo(e=true){let[o,t]=lt.useState(null);return lt.useEffect(()=>{if(!e){t(null);return}let r=typeof window<"u"?window.visualViewport:null;if(!r)return;let n=()=>{let a=Math.max(0,window.innerHeight-r.height-(r.offsetTop??0));t({height:r.height,keyboardOffset:a});};return n(),r.addEventListener("resize",n),r.addEventListener("scroll",n),()=>{r.removeEventListener("resize",n),r.removeEventListener("scroll",n);}},[e]),o}function zt({action:e,defaultVariant:o,defaultSize:t="lg"}){let r=!!e.formId;return jsxRuntime.jsx(T,{type:r?"submit":"button",form:r?e.formId:void 0,size:e.size||t,variant:e.variant||o,onPress:r?void 0:e.onPress,isLoading:e.isLoading,isDisabled:e.isDisabled,children:e.label})}function Gt({primaryAction:e,secondaryAction:o,tertiaryAction:t,footerContent:r}){let n=e||o||t;return !n&&!r?null:jsxRuntime.jsxs("div",{className:`flex w-full flex-col items-center justify-center border-t p-4 ${r?"h-28":""}`,children:[r&&jsxRuntime.jsx("div",{className:"flex h-10 justify-center",children:r}),n&&jsxRuntime.jsxs("div",{className:"flex w-full items-center justify-between gap-3",children:[jsxRuntime.jsx("div",{children:t&&jsxRuntime.jsx(zt,{action:t,defaultVariant:"destructive"})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[o&&jsxRuntime.jsx(zt,{action:o,defaultVariant:"secondary"}),e&&jsxRuntime.jsx(zt,{action:e,defaultVariant:"primary"})]})]})]})}var Un={heading:{sm:Pe.headingSm,md:Pe.headingMd,lg:Pe.headingLg,xl:Pe.headingXl},display:{sm:Pe.displaySm,md:Pe.displayMd,lg:Pe.displayLg,xl:Pe.displayXl}},Kn={page:"h-16 leading-[62px]"};function nt({tag:e="h1",variant:o="heading",size:t="lg",height:r,className:n="",children:a}){let i=t==="xs"?"sm":t,s=Un[o][i],d=r?Kn[r]:"";return jsxRuntime.jsx(e,{className:xt(s,"text-text-primary",d,n),children:a})}var $e=({title:e,onClose:o,hideCloseIcon:t=false,titleAlign:r="left",hasBackArrow:n=false,onBack:a,headerContent:i})=>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",r==="center"?"justify-center":""),children:[n&&jsxRuntime.jsx(T,{variant:"icon",onPress:a,className:"absolute left-6","aria-label":"Go back",children:jsxRuntime.jsx(y,{name:"CaretLeft","data-testid":"back-arrow"})}),i||jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[e&&jsxRuntime.jsx(nt,{size:"xs",children:e}),o&&!t&&jsxRuntime.jsx(T,{variant:"icon",onPress:o,"aria-label":"Close dialog",children:jsxRuntime.jsx(y,{name:"X","data-testid":"close-button"})})]})]});var Jn=lt.createContext(false);function Go({children:e}){return jsxRuntime.jsx(Jn.Provider,{value:true,children:e})}var xe=({width:e,height:o,variant:t="rect",animation:r="pulse",gradient:n=false,flex:a=false,stack:i,responsive:s,delay:d=0,adjustAnimationSpeedBasedOnWidth:u=false,ariaLabel:c,className:l,"data-testid":g})=>{let[v,m]=lt.useState(d===0);if(lt.useEffect(()=>{if(d>0){let E=setTimeout(()=>m(true),d);return ()=>clearTimeout(E)}},[d]),!v)return null;let p=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)]",C=u&&e?(()=>{let E=typeof e=="number"?e:parseFloat(String(e));return isNaN(E)?"":`animation-duration-[${Math.max(.8,E/100)}s]`})():"",R=r==="pulse"?`animate-pulse ${C}`:r==="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 ${C}`:"",P="rounded-sm";t==="circle"&&(P="rounded-full"),t==="text"&&(P="h-4 w-full rounded-sm");let V=a?"flex-1 min-w-0":"",M=s?Object.entries(s).map(([E,F])=>`${E}:w-[${F}]`).join(" "):"";return i?jsxRuntime.jsx("div",{className:"space-y-2","data-testid":g,children:i.map((E,F)=>jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(p,R,P,V,M,l),style:{width:E,height:o}},F))}):jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(p,R,P,V,M,l),style:{width:e,height:o},role:"presentation","aria-hidden":!c,"aria-label":c??void 0,"data-testid":g})};var oa={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"},ra="rounded-lg",$t={square:"aspect-square",video:"aspect-video",wide:"aspect-[2/1]",auto:""},na={start:"justify-start",end:"justify-end",center:"justify-center",between:"justify-between"};function aa(e){return lt__namespace.default.Children.toArray(e).some(o=>lt__namespace.default.isValidElement(o)&&o.type===it&&!!o.props.title)}function be({variant:e="outlined",className:o,children:t,isLoading:r=false,layout:n="default"}){let a=aa(t)?jsxRuntime.jsx(Go,{children:t}):t;return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("w-full overflow-hidden",oa[e],ra,n==="flex"&&"flex flex-col",o),"data-testid":"card",children:r?jsxRuntime.jsx(xe,{width:"100%",height:"100%",className:"rounded-none"}):a})}function it({title:e,subtitle:o,actions:t,leading:r,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(xe,{width:120,height:20}),jsxRuntime.jsx(xe,{width:24,height:24})]}),o&&jsxRuntime.jsx(xe,{width:200,height:16})]}):!e&&!o&&!t&&!r?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:[r&&jsxRuntime.jsx("div",{className:"flex-shrink-0",children:r}),jsxRuntime.jsxs("div",{className:"min-w-0 flex-1",children:[e&&jsxRuntime.jsx("div",{className:"mb-1",children:typeof e=="string"?jsxRuntime.jsx(nt,{tag:"h3",size:"sm",className:"text-text-primary",children:e}):e}),o&&jsxRuntime.jsx("div",{className:wo("bodySm","text-text-secondary"),children:o})]}),t&&jsxRuntime.jsx("div",{className:"flex-shrink-0",children:t})]})})}function qo({src:e,alt:o,aspectRatio:t="auto",className:r,children:n,isLoading:a=false}){return a?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("bg-background-muted",$t[t],r),children:jsxRuntime.jsx(xe,{width:"100%",height:"100%"})}):n?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("overflow-hidden",$t[t],r),children:n}):e?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("overflow-hidden",$t[t],r),children:jsxRuntime.jsx("img",{src:e,alt:o||"",className:"w-full h-full object-cover",loading:"lazy"})}):null}function Pt({className:e,children:o,isLoading:t=false,fill:r=false,style:n}){let i=e?.match(/p(?:t|b|l|r|x|y)?-(?:\d+(?:\.\d+)?|px|\[.+?\])/)?"":"px-6 py-4";return t?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(i,r&&"flex-1 flex flex-col min-h-0",e),style:n,children:jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(xe,{width:"100%",height:16}),jsxRuntime.jsx(xe,{width:"80%",height:16}),jsxRuntime.jsx(xe,{width:"60%",height:16})]})}):o?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(i,"text-text-primary",r&&"flex-1 flex flex-col min-h-0",e),style:n,children:o}):null}function Uo({className:e,children:o,align:t="end",isLoading:r=false}){return r?jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("px-6 py-4 flex gap-2 justify-end",e),children:[jsxRuntime.jsx(xe,{width:80,height:32}),jsxRuntime.jsx(xe,{width:60,height:32})]}):o?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("px-6 py-4 flex items-center gap-2",na[t],e),children:o}):null}be.Header=it;be.Media=qo;be.Content=Pt;be.Footer=Uo;var st=class extends lt.Component{constructor(){super(...arguments);Lt(this,"state",{hasError:false});Lt(this,"handleRetry",()=>{this.setState({hasError:false,error:void 0}),typeof window<"u"&&window.location.reload();});}static getDerivedStateFromError(t){return {hasError:true,error:t}}componentDidCatch(t,r){console.error("Error Boundary caught an error:",t,r);}render(){return this.state.hasError?this.props.fallback?this.props.fallback:jsxRuntime.jsxs(be,{children:[this.props.title&&jsxRuntime.jsx(be.Header,{title:this.props.title}),jsxRuntime.jsx(be.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}};var da=.3,ca=.5;function Ue({children:e,title:o,headerContent:t,titleAlign:r="left",hideCloseIcon:n=false,hasBackArrow:a=false,onBack:i,isOpen:s,onClose:d,isDismissable:u=true,transparentOverlay:c=false,primaryAction:l,secondaryAction:g,footerContent:v,maxHeight:m="80vh",height:p,maxWidth:C="640px",contentPadding:R=true,showHandle:P=true,animationVariant:V="scale",className:M}){let[E,F]=lt.useState(false),[k,Q]=lt.useState(0),[S,ne]=lt.useState(false),H=zo(s),ce=H?.height??null,X=H?.keyboardOffset??0,U=lt.useRef(null),de=lt.useRef(null),z=lt.useRef(null),h=lt.useRef({isDragging:false,startY:0,startTime:0,pointerId:null});lt.useEffect(()=>{if(s){let b=setTimeout(()=>{F(true),setTimeout(()=>F(false),600);},400);return ()=>clearTimeout(b)}},[s]),lt.useEffect(()=>{s||(Q(0),ne(false),h.current={isDragging:false,startY:0,startTime:0,pointerId:null});},[s]),lt.useEffect(()=>{let b=de.current;if(!b||!s)return;let Y=null,O=Z=>{let ye=Z.target;ye&&["INPUT","TEXTAREA","SELECT"].includes(ye.tagName)&&(Y&&clearTimeout(Y),Y=setTimeout(()=>{ye.scrollIntoView({block:"nearest",behavior:"smooth"});},320));};return b.addEventListener("focusin",O),()=>{b.removeEventListener("focusin",O),Y&&clearTimeout(Y);}},[s]);let Ie=lt.useCallback(b=>{u&&(b.pointerType!=="touch"&&b.pointerType!=="pen"||(z.current&&(clearTimeout(z.current),z.current=null),h.current={isDragging:true,startY:b.clientY,startTime:Date.now(),pointerId:b.pointerId},ne(false),b.currentTarget.setPointerCapture(b.pointerId)));},[u]),Te=lt.useCallback(b=>{let{isDragging:Y,startY:O,pointerId:Z}=h.current;if(!Y||b.pointerId!==Z)return;let ye=b.clientY-O;Q(Math.max(0,ye));},[]),ue=lt.useCallback(b=>{let{isDragging:Y,startY:O,startTime:Z,pointerId:ye}=h.current;if(!Y||b.pointerId!==ye)return;let ee=b.clientY-O,Me=Date.now()-Z,Je=ee/Me;h.current={isDragging:false,startY:0,startTime:0,pointerId:null};let pt=(U.current?.getBoundingClientRect().height??0)*da;(ee>pt||Je>ca&&ee>50)&&u?(d?.(),Q(0)):(ne(true),Q(0),z.current=setTimeout(()=>{ne(false),z.current=null;},200));},[u,d]);if(!s)return null;let Fe=o||t,Ne=l||g||v;return jsxRuntime.jsx(st,{children:jsxRuntime.jsx(Be,{isOpen:s,onOpenChange:b=>{b||d?.();},isDismissable:u,transparent:c,style:{paddingBottom:X>0?`${X}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:u,children:jsxRuntime.jsx("div",{ref:U,className:tailwindMerge.twMerge("w-full",S&&"transition-transform duration-200"),style:{transform:k>0?`translateY(${k}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",V==="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)]",V==="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)]",M),style:{maxWidth:C,...p?{height:p}:{maxHeight:/\d/.test(m)?ce!==null?`min(${m}, ${Math.max(ce-8,0)}px, 100dvh)`:`min(${m}, 100dvh)`:m}},children:[P&&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:Ie,onPointerMove:Te,onPointerUp:ue,onPointerCancel:ue,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",E&&"animate-[handle-wiggle_0.6s_ease-in-out]")})}),Fe&&(a?jsxRuntime.jsx($e,{title:o,headerContent:t,titleAlign:r,hideCloseIcon:n||!d,hasBackArrow:true,onBack:i??(()=>{}),onClose:d||(()=>{})}):jsxRuntime.jsx($e,{title:o,headerContent:t,titleAlign:r,hideCloseIcon:n||!d,onClose:d||(()=>{})})),jsxRuntime.jsx("div",{ref:de,className:tailwindMerge.twMerge("flex-1 min-h-0 overflow-y-auto overscroll-contain",R?"p-4":"p-0"),children:e}),Ne&&jsxRuntime.jsx(Gt,{primaryAction:l,secondaryAction:g,footerContent:v})]})})})})})}Ue.displayName="Tray";var Jt=lt.createContext("md");function Jo(){return lt.useContext(Jt)}function jt(e="md"){let o=e==="sm"?"!text-base md:!text-[length:var(--control-text-sm)]":e==="md"?"!text-base md:!text-[length:var(--control-text-md)]":"";return `flex-1 text-start data-[placeholder]:text-text-disabled overflow-hidden text-ellipsis whitespace-nowrap ${q[e].text} ${o}`}function xa(){let e=lt__namespace.default.useCallback((t,r)=>{r?.(t);},[]),o=lt__namespace.default.useCallback((t,r)=>{r?.(t);},[]);return {handleFocus:e,handleBlur:o}}function Zt({label:e,description:o,errorMessage:t,children:r,items:n,renderItem:a,renderSelectedValue:i,size:s="md",selectedKey:d,defaultSelectedKey:u,onSelectionChange:c,placeholder:l,showErrors:g=false,tooltip:v,isRequired:m,transparent:p,reserveErrorSpace:C=false,placement:R="bottom start",shouldFlip:P=true,menuWidth:V="match",descriptionPlacement:M="below",useMobileTray:E=true,...F}){let[k,Q]=lt.useState(null),[S,ne]=lt.useState(null),[H,ce]=lt.useState(false),X=d??k??u,{handleFocus:U,handleBlur:de}=xa(),{isMobile:z}=ft(),h=E&&z,Ie=lt__namespace.default.useMemo(()=>!i||!X||!n?null:Array.from(n).find(Y=>Y.id===X)??null,[i,X,n]),Te=b=>{c&&b!==null&&c(b),c||Q(b);},ue=lt.useRef(null),Fe=lt.useRef(null),Ne=()=>{h&&ce(!H);};return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(reactAriaComponents.Select,{...F,selectedKey:X,defaultSelectedKey:u,onSelectionChange:Te,placeholder:l,className:G(F.className,"group flex w-full flex-col"),ref:ue,onOpenChange:b=>{h||(b&&Fe.current?ne(Fe.current.offsetWidth):b||ue.current?.blur());},children:({isDisabled:b,isInvalid:Y,isOpen:O})=>jsxRuntime.jsxs("div",{className:"flex flex-col",children:[e&&jsxRuntime.jsx(W,{size:s,tooltip:v,description:M==="tooltip"||M==="inline"?o:void 0,descriptionPlacement:M,isRequired:m,children:e}),jsxRuntime.jsx(oe,{children:jsxRuntime.jsx("div",{ref:Fe,children:jsxRuntime.jsxs(T,{variant:"unstyled",className:tailwindMerge.twMerge(ae({isInvalid:Y||g&&!!t,isDisabled:b,isFocused:h?H:O,transparent:p,size:s}),"flex items-center text-start gap-4 cursor-pointer pl-[var(--control-padding-sm)]"),onFocus:Z=>U(Z,F.onFocus),onBlur:Z=>de(Z,F.onBlur),onPress:h?Ne:void 0,"data-open":h?H:O,children:[i&&Ie?jsxRuntime.jsx("div",{className:jt(s),children:i(Ie)}):h&&X?jsxRuntime.jsx("div",{className:jt(s),children:n?Array.from(n).find(ee=>ee.id===X)?.label:String(X)}):jsxRuntime.jsx(reactAriaComponents.SelectValue,{className:jt(s)}),jsxRuntime.jsx(y,{name:"CaretDown","aria-hidden":true,className:tailwindMerge.twMerge("h-4 w-4 text-text-primary group-disabled:text-text-disabled forced-colors:text-[ButtonText] transition-transform",(h?H:O)&&"rotate-180")})]})})}),C?jsxRuntime.jsx("div",{className:"mt-1 min-h-[20px]",children:g?jsxRuntime.jsx(f,{size:s,className:"text-feedback-error-text",children:typeof t=="function"&&F.validationResult?t(F.validationResult):typeof t=="string"?t:null}):o&&M==="below"?jsxRuntime.jsx(I,{size:s,children:o}):null}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:g?jsxRuntime.jsx(f,{size:s,className:"mt-1 text-feedback-error-text",children:typeof t=="function"&&F.validationResult?t(F.validationResult):typeof t=="string"?t:null}):o&&M==="below"?jsxRuntime.jsx(I,{size:s,className:"mt-1",children:o}):null}),h?null:jsxRuntime.jsx(Ge,{className:"bg-background-input shadow-xl border border-border-input/20 backdrop-blur-sm rounded-[var(--control-border-radius)]",style:{width:V==="match"&&S?`${S}px`:void 0,minWidth:V==="auto"&&S?`${S}px`:void 0,maxWidth:V==="auto"?"min(600px, 90vw)":void 0},placement:R,shouldFlip:P,children:jsxRuntime.jsx(Jt.Provider,{value:"md",children:jsxRuntime.jsx(reactAriaComponents.ListBox,{items:n,className:"w-full max-h-[300px] overflow-auto bg-background-input p-0 outline-0",children:a&&n?Z=>jsxRuntime.jsx(we,{id:Z.id,textValue:Z.label,children:jsxRuntime.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap min-w-0 flex-1",children:a(Z)})},Z.id):r})})})]})}),h&&jsxRuntime.jsx(Ue,{isOpen:H,onClose:()=>ce(false),title:e??"Select an option",contentPadding:false,children:jsxRuntime.jsx(Jt.Provider,{value:"md",children:jsxRuntime.jsx(reactAriaComponents.ListBox,{items:n,className:"w-full bg-background-surface p-0 outline-0 [&_[role=option]]:border-b [&_[role=option]]:border-border-default [&_[role=option]:last-child]:border-0 [&_[role=option]]:!px-6 [&_[role=option]]:!py-4 [&_[role=option]]:rounded-none",selectionMode:"single",selectedKeys:X!=null?[X]:[],onSelectionChange:b=>{let Y=Array.from(b)[0];Y!=null&&(Te(Y),ce(false));},children:a&&n?b=>jsxRuntime.jsx(we,{id:b.id,textValue:b.label,children:jsxRuntime.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap min-w-0 flex-1",children:a(b)})},b.id):r})})})]})}function we({size:e,className:o,...t}){let r=Jo(),n=e??r;return jsxRuntime.jsx(reactAriaComponents.ListBoxItem,{...t,className:tailwindMerge.twMerge("flex cursor-default items-center gap-2 rounded-sm px-3 outline-none text-text-primary data-[focused]:bg-background-hover data-[focus-visible]:ring-2 data-[focus-visible]:ring-action-default data-[focus-visible]:ring-inset data-[selected]:bg-background-selected data-[selected]:font-medium overflow-hidden",q[n].paddingY,q[n].text,o)})}var Ke=({className:e,size:o=24,color:t="text-action-brand"})=>jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("inline-block animate-spin rounded-full border-2 border-solid border-current border-r-transparent",t,e),style:{width:o,height:o},role:"status","aria-label":"loading",children:jsxRuntime.jsx("span",{className:"sr-only",children:"Loading..."})});var wa=[],Ia={sm:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6",xl:"h-7 w-7"},Ea={sm:"pl-8",md:"pl-10",lg:"pl-11",xl:"pl-13"},tr={sm:"py-1",md:"py-2",lg:"py-3",xl:"py-4"},to=(e,o,t)=>{if(e==null||e==="")return "";let n=(t?t.flatMap(a=>a.items):o||[]).find(a=>a.id===e);return n?n.name:""};async function Ba(e,o,t){try{let r=e.url.replace("{q}",o),n=new URLSearchParams;e.extraParams&&Object.entries(e.extraParams).forEach(([d,u])=>{n.append(d,u.toString());});let a=`${r}${n.toString()?"?"+n.toString():""}`,i=await fetch(a,{method:"GET",headers:e.headers,signal:t});if(!i.ok)throw new Error(`HTTP error! status: ${i.status}`);let s=await i.json();return {items:e.transformResponse(s)}}catch(r){if(r instanceof Error&&r.name==="AbortError")return {items:[]};console.error("Error in REST request:",r);let n=r instanceof Error?r.message:"Unknown error occurred";return {items:[],error:n}}}async function Va(e,o,t){try{let r=e.graphqlQuery.replace(`$${e.variableKey||"filter"}`,`"${o}"`),n=await fetch(e.url,{method:"POST",headers:{"Content-Type":"application/json",...e.headers},body:JSON.stringify({query:r}),signal:t});if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);let a=await n.json();if(a.errors)throw new Error(a.errors[0]?.message||"GraphQL error occurred");return e.responsePath&&(a=e.responsePath.split(".").reduce((i,s)=>i?.[s],a)),{items:e.transformResponse(a)}}catch(r){if(r instanceof Error&&r.name==="AbortError")return {items:[]};console.error("Error in GraphQL request:",r);let n=r instanceof Error?r.message:"Unknown error occurred";return {items:[],error:n}}}function oo({label:e,staticItems:o=wa,sections:t,selectedKey:r,defaultSelectedKey:n,onSelectionChange:a,requestConfig:i,defaultFilter:s,placeholder:d,errorMessage:u,description:c,size:l="md",tooltip:g,isRequired:v,isDisabled:m,isInvalid:p,validationResult:C,showErrors:R=true,renderItem:P,renderLeftIcon:V,renderSection:M,autoFocus:E=false,reserveErrorSpace:F=false,hideChevron:k=false,useMobileTray:Q=true,className:S}){let ne=lt__namespace.default.useRef(null),H=lt__namespace.default.useRef(null),[ce,X]=lt__namespace.default.useState(),[U,de]=lt.useState(()=>to(r||n,o,t)),[z,h]=lt.useState(false),[Ie,Te]=lt.useState(false),ue=So(U),{contains:Fe}=reactAria.useFilter({sensitivity:"base"}),[Ne,b]=lt.useState(),{isMobile:Y}=ft(),O=Q&&Y,Z=q[l].text,ye=reactStately.useAsyncList({async load({signal:w,filterText:L=""}){if(!i)return {items:[]};if(!i.url||i.shouldLoad&&!i.shouldLoad(L))return {items:[]};try{let re;return i.requestType==="GraphQL"?re=await Va(i,L,w):re=await Ba(i,L,w),b(re.error),{items:re.items}}catch(re){return re instanceof Error&&re.name==="AbortError"?{items:[]}:(console.error("Error loading items:",re),b(re instanceof Error?re.message:"Unknown error occurred"),{items:[]})}},initialFilterText:""}),ee=i&&ue!==""?ye:null,Me=false,Je=lt.useRef("");lt.useEffect(()=>{E&&h(true);},[E]),lt.useEffect(()=>{let w=to(r,o,t);w!==U&&de(w);},[r,o,t]),lt.useEffect(()=>{let w=()=>{ne.current&&X(ne.current.offsetWidth);};return w(),window.addEventListener("resize",w),()=>window.removeEventListener("resize",w)},[]),lt.useEffect(()=>{ue===""?Je.current="":ee&&ue!==Je.current&&(Je.current=ue,ee.setFilterText(ue));},[ue,ee]),Me=gt(!!ee?.isLoading,300);let No=lt__namespace.default.useMemo(()=>{if(!O||!U)return ee?ee.items:o;let w=ee?ee.items:o,L=s??(i?()=>true:Fe);return w.filter(re=>L(re.name,U))},[O,U,ee,o,s,Fe]),pt=w=>{let L=to(w,o,t);de(L),a&&a(w);},Vt=w=>{de(w);},ko=()=>{O&&Te(true);};return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(reactAriaComponents.ComboBox,{onSelectionChange:pt,selectedKey:r||void 0,defaultSelectedKey:n||void 0,items:ee?ee.items:t?t.flatMap(w=>w.items):o,className:G(S,"group flex flex-col w-full"),menuTrigger:O?"manual":i?"input":"focus",allowsEmptyCollection:!!i,isDisabled:m,isInvalid:p||!!u,inputValue:U,onInputChange:Vt,autoFocus:E&&!O,defaultFilter:s??(i?()=>true:Fe),"aria-label":e||d||"Autocomplete",children:w=>jsxRuntime.jsxs("div",{className:"flex flex-col",children:[e&&jsxRuntime.jsx(W,{size:l,tooltip:g,isRequired:v,children:e}),jsxRuntime.jsxs(oe,{ref:ne,children:[V?jsxRuntime.jsx("div",{className:"pointer-events-none absolute left-3 top-[45%] -translate-y-1/2 z-10",children:V(Me)}):jsxRuntime.jsx("div",{className:"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 z-10 flex items-center",children:Me?jsxRuntime.jsx(Ke,{size:16,color:"text-text-secondary"}):jsxRuntime.jsx(y,{name:"MagnifyingGlass",className:`${Ia[l]} text-text-secondary`})}),jsxRuntime.jsx(reactAriaComponents.Input,{className:ae({isInvalid:p||!!u,isDisabled:m,isFocused:z||(O?Ie:w.isOpen),size:l,className:tailwindMerge.twMerge(Ea[l],U&&!m||!k&&!U?"pr-10":"pr-3",O&&"cursor-pointer",S)}),placeholder:d,disabled:m,onFocus:L=>{h(true),O&&(L.currentTarget.blur(),ko());},onBlur:()=>{h(false);},onClick:O?ko:void 0,readOnly:O,"aria-label":e||d||"Autocomplete"}),U&&!m&&jsxRuntime.jsx(et,{onClick:()=>{de(""),a?.(null);},size:l}),!k&&!U&&jsxRuntime.jsx(reactAriaComponents.Button,{className:"absolute right-3 top-[46%] -translate-y-1/2 transform text-text-secondary hover:text-text-primary","aria-label":"Toggle menu",isDisabled:m,children:({isPressed:L})=>jsxRuntime.jsx(y,{name:L?"CaretUp":"CaretDown",className:"h-4 w-4"})})]}),F?jsxRuntime.jsx("div",{className:"mt-1 min-h-[20px]",children:R&&Ne?jsxRuntime.jsx(f,{size:l,className:"text-feedback-error-text",children:Ne}):R&&typeof u=="string"?jsxRuntime.jsx(f,{size:l,className:"text-feedback-error-text",children:u}):R&&typeof u=="function"&&C?jsxRuntime.jsx(f,{size:l,className:"text-feedback-error-text",children:u(C)}):c?jsxRuntime.jsx(I,{size:l,children:c}):null}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[c&&jsxRuntime.jsx(I,{size:l,className:"mt-1",children:c}),R&&Ne&&jsxRuntime.jsx(f,{size:l,className:"text-feedback-error-text mt-1",children:Ne}),R&&typeof u=="string"&&jsxRuntime.jsx(f,{size:l,className:"text-feedback-error-text mt-1",children:u}),R&&typeof u=="function"&&C&&jsxRuntime.jsx(f,{size:l,className:"text-feedback-error-text mt-1",children:u(C)})]}),!O&&jsxRuntime.jsx(Ge,{className:"bg-background-input shadow-xl border border-border-input/20 backdrop-blur-sm ring-1 ring-black/5 rounded-[var(--control-border-radius)]",style:{minWidth:ce?`${ce}px`:void 0,zIndex:9999},children:jsxRuntime.jsx(reactAriaComponents.ListBox,{"aria-label":e||d||"Suggestions",className:`max-h-[300px] overflow-auto bg-background-input outline-none ${Z}`,children:t?t.map(L=>{let re=L.items.map(ve=>jsxRuntime.jsx(we,{id:ve.id,textValue:ve.name,size:l,className:`flex cursor-default items-center gap-2 px-3 ${tr[l]} text-text-primary outline-none data-[focused]:bg-background-hover data-[selected]:bg-background-selected data-[selected]:font-medium data-[focus-visible]:ring-0`,children:P?P(ve):ve.name},ve.id));if(M){let ve=M(L,re);return lt__namespace.default.isValidElement(ve)&&ve.type===reactAriaComponents.ListBoxSection?ve:jsxRuntime.jsx(reactAriaComponents.ListBoxSection,{children:ve},L.name)}return jsxRuntime.jsxs(reactAriaComponents.ListBoxSection,{children:[jsxRuntime.jsx(reactAriaComponents.Header,{className:"px-3 py-1 text-sm font-bold text-text-secondary",children:L.name}),re]},L.name)}):L=>jsxRuntime.jsx(we,{id:L.id,textValue:L.name,size:l,className:`flex cursor-default items-center gap-2 px-3 ${tr[l]} text-text-primary outline-none data-[focused]:bg-background-hover data-[selected]:bg-background-selected data-[selected]:font-medium data-[focus-visible]:ring-0`,children:P?P(L):L.name},L.id)})})]})}),O&&jsxRuntime.jsx(Ue,{isOpen:Ie,onClose:()=>Te(false),title:e??d??"Search",contentPadding:false,height:"80vh",children:jsxRuntime.jsxs("div",{className:"flex flex-col h-full",children:[jsxRuntime.jsx("div",{className:"p-4 border-b border-border-default",children:jsxRuntime.jsxs(oe,{children:[jsxRuntime.jsx("div",{className:"pointer-events-none absolute left-3 top-[45%] -translate-y-1/2 z-10 flex items-center",children:Me?jsxRuntime.jsx(Ke,{size:16,color:"text-text-secondary"}):jsxRuntime.jsx(y,{name:"MagnifyingGlass",className:"h-4 w-4 text-text-secondary"})}),jsxRuntime.jsx("input",{ref:H,type:"text",value:U,onChange:w=>Vt(w.target.value),placeholder:d,autoFocus:true,className:ae({isInvalid:false,isDisabled:false,isFocused:true,size:"md",className:"pl-10 pr-10"})}),U&&jsxRuntime.jsx(et,{onClick:()=>{de(""),a?.(null);},size:"md"})]})}),jsxRuntime.jsx("div",{className:"flex-1 overflow-auto",children:jsxRuntime.jsx(reactAriaComponents.ListBox,{"aria-label":e||d||"Suggestions",items:No,selectedKeys:r?[r]:[],selectionMode:"single",onSelectionChange:w=>{let L=Array.from(w)[0];L&&(pt(L),Te(false));},className:"bg-background-input outline-none",children:w=>jsxRuntime.jsx(we,{id:w.id,textValue:w.name,size:"md",className:"flex cursor-default items-center gap-2 px-4 py-3 text-text-primary outline-none data-[focused]:bg-background-hover data-[selected]:bg-background-selected data-[selected]:font-medium data-[focus-visible]:ring-0",children:P?P(w):w.name},w.id)})})]})})]})}function D(e,o){let t=o.split("."),r=e;for(let a of t)if(r&&typeof r=="object"&&a in r)r=r[a];else {r=void 0;break}let n=r?.message;return typeof n=="string"?n:void 0}function Bu({name:e,defaultValue:o,...t}){let{control:r,formState:n}=reactHookForm.useFormContext(),a=D(n.errors,e);return jsxRuntime.jsx(reactHookForm.Controller,{control:r,name:e,defaultValue:o,render:({field:i})=>jsxRuntime.jsx(oo,{...t,selectedKey:i.value??null,onSelectionChange:s=>i.onChange(s),showErrors:!!a,errorMessage:a})})}var Oa="focus:ring-action-primary",Ga="bg-action-primary border-action-primary text-[color:var(--color-action-primary-text)] hover:bg-action-primary-hover hover:border-action-primary-hover";function ar(e){return jsxRuntime.jsxs(reactAriaComponents.CheckboxGroup,{...e,className:G(e.className,"flex flex-col gap-2"),children:[jsxRuntime.jsx(W,{children:e.label}),e.children,e.description&&jsxRuntime.jsx(I,{children:e.description}),jsxRuntime.jsx(f,{children:typeof e.errorMessage=="function"?void 0:e.errorMessage})]})}function Wa({isDisabled:e}){return `relative flex gap-2 items-center group text-sm transition ${e?"text-text-disabled":"text-text-secondary"}`}function $a({isSelected:e,isInvalid:o,isDisabled:t,isIndeterminate:r}){let n="w-5 h-5 flex-shrink-0 rounded-[var(--control-border-radius)] flex items-center justify-center border-2 transition ring-offset-2 focus:ring-2",a=Oa,i="";return t?i="border-border-muted bg-background-muted":o?i="border-feedback-error-border bg-feedback-error-background":e||r?i=Ga:i="bg-background-input border-border-input hover:border-border-focus",`${n} ${a} ${i}`}var nr="w-4 h-4 text-current group-disabled:text-text-disabled";function ir(e){let{children:o,variant:t,...r}=e;return jsxRuntime.jsx(reactAriaComponents.Checkbox,{...r,className:reactAriaComponents.composeRenderProps(e.className,(n,a)=>`${Wa(a)} ${n||""}`),children:n=>{let{isSelected:a,isIndeterminate:i,...s}=n,d=jsxRuntime.jsx("div",{className:$a({isSelected:a,isIndeterminate:i,...s}),children:i?jsxRuntime.jsx(lucideReact.Minus,{"aria-hidden":true,className:nr}):a?jsxRuntime.jsx(lucideReact.Check,{"aria-hidden":true,className:nr}):null});return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[d,typeof o=="function"?o(n):o]})}})}function ju({name:e,defaultValue:o,errorBelow:t=false,...r}){let{control:n,formState:a}=reactHookForm.useFormContext(),i=D(a.errors,e);return jsxRuntime.jsx(reactHookForm.Controller,{control:n,name:e,defaultValue:o,render:({field:s})=>jsxRuntime.jsxs("div",{className:"flex flex-col gap-1",children:[jsxRuntime.jsx(ir,{...r,isSelected:!!s.value,onChange:d=>s.onChange(d),"aria-invalid":!!i,children:r.children}),t&&i&&jsxRuntime.jsx(f,{children:i})]})})}function tm({name:e,defaultValue:o,...t}){let{control:r,formState:n}=reactHookForm.useFormContext(),a=D(n.errors,e);return jsxRuntime.jsx(reactHookForm.Controller,{control:r,name:e,defaultValue:o,render:({field:i})=>jsxRuntime.jsx(ar,{...t,value:i.value||[],onChange:s=>i.onChange(s),errorMessage:a,children:t.children})})}function Ye(e){if(!e)return false;let o=e.startsWith("#")?e.slice(1):e;return /^[0-9A-Fa-f]{3}$|^[0-9A-Fa-f]{6}$/.test(o)}function ao(e){if(!e)return "";let o=e.startsWith("#")?e.slice(1):e;return o.length===3&&(o=o.split("").map(t=>t+t).join("")),`#${o.toUpperCase()}`}function cr({label:e,description:o,errorMessage:t,size:r="md",tooltip:n,isRequired:a,transparent:i,className:s,validationResult:d,value:u,defaultValue:c,onChange:l,placeholder:g="#000000",showColorSwatch:v=true,reserveErrorSpace:m=true,...p}){let[C,R]=lt.useState(c||""),[P,V]=lt.useState(u||c||""),[M,E]=lt.useState(false),[F,k]=lt.useState(null),{isFocused:Q,handleFocus:S,handleBlur:ne}=ke(),H=u!==void 0?u:C;lt.useEffect(()=>{u!==void 0&&V(u);},[u]);let ce=H?!Ye(H):false,X=lt.useCallback(z=>{if(V(z),Ye(z)){let h=ao(z);l?l(h):R(h);}else z===""&&(l?l(""):R(""));},[l]),U=lt.useCallback(z=>{let h=ao(z);V(h),l?l(h):R(h);},[l]),de=lt.useCallback(z=>{if(Ye(P)){let h=ao(P);V(h),l&&h!==H?l(h):!l&&h!==C&&R(h);}ne(z,p.onBlur);},[P,H,C,l,ne,p.onBlur]);return jsxRuntime.jsx(reactAriaComponents.TextField,{...p,isRequired:a,className:G(s,"group flex flex-col"),children:({isDisabled:z})=>jsxRuntime.jsxs("div",{className:"flex flex-col",children:[e&&jsxRuntime.jsx(W,{size:r,tooltip:n,isRequired:a,children:e}),jsxRuntime.jsx(oe,{children:jsxRuntime.jsxs("div",{className:"flex gap-2",children:[jsxRuntime.jsxs("div",{className:"flex-1 relative",children:[jsxRuntime.jsx(vt,{size:r,disabled:z,type:"text",value:P,placeholder:g,onFocus:h=>S(h,p.onFocus),onBlur:de,onChange:h=>X(h.target.value),className:tailwindMerge.twMerge(ae({isInvalid:ce,isDisabled:z,isFocused:Q,size:r,transparent:i}),v?"pr-12":"pr-3","pl-3")}),v&&jsxRuntime.jsx("div",{className:"absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none",style:{width:q[r].height},children:jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("w-6 h-6 rounded border shadow-sm",Ye(H)?"border-border-default":"border-border-default bg-background-muted"),style:Ye(H)?{backgroundColor:H}:void 0,"aria-hidden":"true",children:!Ye(H)&&jsxRuntime.jsx("div",{className:"w-full h-full flex items-center justify-center",children:jsxRuntime.jsx("div",{className:"w-3 h-3 rounded-full border-2 border-border-muted"})})})})]}),jsxRuntime.jsx("div",{ref:k,children:jsxRuntime.jsx(T,{variant:"secondary",size:r,icon:"Palette",onPress:()=>E(!M),isDisabled:z,className:"flex-shrink-0",children:"Pick"})})]})}),m?jsxRuntime.jsx("div",{className:"mt-1 min-h-[20px]",children:typeof t=="string"?jsxRuntime.jsx(f,{size:r,children:t}):typeof t=="function"&&d?jsxRuntime.jsx(f,{size:r,children:t(d)}):o?jsxRuntime.jsx(I,{size:r,children:o}):null}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:typeof t=="string"?jsxRuntime.jsx(f,{size:r,className:"mt-1",children:t}):typeof t=="function"&&d?jsxRuntime.jsx(f,{size:r,className:"mt-1",children:t(d)}):o?jsxRuntime.jsx(I,{size:r,className:"mt-1",children:o}):null}),M&&F&&jsxRuntime.jsx(Ge,{triggerRef:{current:F},isOpen:M,onOpenChange:E,placement:"bottom end",className:"bg-background-input shadow-xl border border-border-input/20 backdrop-blur-sm rounded-lg p-4",children:jsxRuntime.jsxs("div",{className:"flex flex-col gap-4",children:[jsxRuntime.jsx(reactColorful.HexColorPicker,{color:H||"#000000",onChange:U,style:{width:"200px",height:"200px"}}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("div",{className:"w-10 h-10 rounded border border-border-default shadow-sm flex-shrink-0",style:{backgroundColor:H||"#000000"}}),jsxRuntime.jsx("div",{className:"flex-1 text-text-primary text-[length:var(--control-text-sm)] font-mono",children:H||"#000000"})]})]})})]})})}function ym({name:e,defaultValue:o,...t}){let{control:r,formState:n}=reactHookForm.useFormContext(),a=D(n.errors,e);return jsxRuntime.jsx(reactHookForm.Controller,{control:r,name:e,defaultValue:o,render:({field:i})=>jsxRuntime.jsx(cr,{...t,value:i.value??"",onChange:s=>i.onChange(s),isInvalid:!!a,errorMessage:a})})}function mi({isSelected:e,isDisabled:o}){let t=[Ee,"w-9 h-9 text-sm cursor-default rounded-sm flex items-center justify-center forced-color-adjust-none font-semibold"];return o?t.push("text-text-disabled forced-colors:text-[GrayText]"):e?t.push("bg-action-default text-text-inverse invalid:bg-feedback-error-border forced-colors:bg-[Highlight] forced-colors:invalid:bg-[Mark] forced-colors:text-[HighlightText]"):t.push("text-text-primary hover:bg-background-hover pressed:bg-background-selected"),t.join(" ")}function so({errorMessage:e,...o}){return jsxRuntime.jsxs(reactAriaComponents.Calendar,{...o,children:[jsxRuntime.jsx(mr,{}),jsxRuntime.jsxs(reactAriaComponents.CalendarGrid,{className:"border-separate [border-spacing:0] [&_td]:p-0 [&_td]:!border-0",children:[jsxRuntime.jsx(pr,{}),jsxRuntime.jsx(reactAriaComponents.CalendarGridBody,{children:t=>jsxRuntime.jsx(reactAriaComponents.CalendarCell,{date:t,className:({isSelected:r,isDisabled:n})=>`${mi({isSelected:r,isDisabled:n})} border-0`})})]}),e&&jsxRuntime.jsx(reactAriaComponents.Text,{slot:"errorMessage",className:"text-sm text-feedback-error-text",children:e})]})}function mr(){let{direction:e}=reactAriaComponents.useLocale(),o=18;return jsxRuntime.jsxs("header",{className:"flex w-full items-center gap-1 px-1 pb-4",children:[jsxRuntime.jsx(T,{variant:"icon",slot:"previous",className:"pl-0",children:e==="rtl"?jsxRuntime.jsx(y,{name:"CaretRight","aria-hidden":true,size:o}):jsxRuntime.jsx(y,{name:"CaretLeft","aria-hidden":true,size:o})}),jsxRuntime.jsx(reactAriaComponents.Heading,{className:"text-md mx-2 flex-1 text-center font-semibold text-text-primary"}),jsxRuntime.jsx(T,{variant:"icon",slot:"next",className:"pr-0",children:e==="rtl"?jsxRuntime.jsx(y,{name:"CaretLeft","aria-hidden":true,size:o}):jsxRuntime.jsx(y,{name:"CaretRight","aria-hidden":true,size:o})})]})}function pr(){return jsxRuntime.jsx(reactAriaComponents.CalendarGridHeader,{children:e=>jsxRuntime.jsx(reactAriaComponents.CalendarHeaderCell,{className:"text-xs font-semibold text-text-secondary",children:e})})}function co({label:e,description:o,errorMessage:t,size:r="md",tooltip:n,isRequired:a,isDisabled:i,isInvalid:s,showCalendar:d=true,reserveErrorSpace:u=true,validationResult:c,className:l,...g}){let[v,m]=lt.useState(false),p=C=>{g.onChange&&C&&g.onChange(C),m(false);};return jsxRuntime.jsxs(reactAriaComponents.DateField,{...g,isDisabled:i,isRequired:a,isInvalid:s,className:G(l,"flex flex-col gap-1"),children:[e&&jsxRuntime.jsx(W,{size:r,tooltip:n,isRequired:a,children:e}),jsxRuntime.jsx(oe,{children:jsxRuntime.jsxs("div",{className:"relative w-full",children:[jsxRuntime.jsx(gr,{size:r,isDisabled:i,isInvalid:s,hasCalendar:d}),d&&!i&&jsxRuntime.jsxs(reactAriaComponents.DialogTrigger,{isOpen:v,onOpenChange:m,children:[jsxRuntime.jsx(T,{variant:"unstyled",className:"absolute right-2 top-1/2 -translate-y-1/2 flex h-8 w-8 items-center justify-center rounded hover:bg-background-hover text-text-secondary hover:text-text-primary transition-colors","aria-label":"Open calendar",children:jsxRuntime.jsx(y,{name:"Calendar",size:18})}),jsxRuntime.jsx(reactAriaComponents.Popover,{className:"bg-background-surface rounded-lg border border-border-default shadow-xl",children:jsxRuntime.jsx(reactAriaComponents.Dialog,{className:"p-4 outline-none",children:jsxRuntime.jsx(so,{value:g.value,onChange:p,minValue:g.minValue,maxValue:g.maxValue,isDisabled:i,isReadOnly:g.isReadOnly,isDateUnavailable:g.isDateUnavailable})})})]})]})}),u?jsxRuntime.jsx("div",{className:"mt-1 min-h-[20px]",children:typeof t=="string"?jsxRuntime.jsx(f,{size:r,children:t}):typeof t=="function"&&c?jsxRuntime.jsx(f,{size:r,children:t(c)}):o?jsxRuntime.jsx(I,{size:r,children:o}):null}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:typeof t=="string"?jsxRuntime.jsx(f,{size:r,className:"mt-1",children:t}):typeof t=="function"&&c?jsxRuntime.jsx(f,{size:r,className:"mt-1",children:t(c)}):o?jsxRuntime.jsx(I,{size:r,className:"mt-1",children:o}):null})]})}function vi({isPlaceholder:e,isDisabled:o,size:t="md"}){return tailwindMerge.twMerge("inline-block box-content px-0.5 rounded outline-none tabular-nums text-center transition-colors",{sm:"text-base md:text-xs",md:"text-base md:text-sm",lg:"text-base",xl:"text-lg"}[t],e?"text-text-disabled italic":"text-text-primary",o?"text-text-disabled cursor-not-allowed":"cursor-text",!o&&"hover:bg-background-hover","data-[focused]:bg-background-selected data-[focused]:text-text-primary")}function gr({size:e="md",isDisabled:o,isInvalid:t,hasCalendar:r,className:n,...a}){return jsxRuntime.jsx(reactAriaComponents.DateInput,{className:tailwindMerge.twMerge(tt({isInvalid:t,isDisabled:o}),"px-3 py-2 flex items-center gap-0.5 w-full",r&&"pr-10",n),...a,children:i=>jsxRuntime.jsx(reactAriaComponents.DateSegment,{segment:i,className:vi({isPlaceholder:i.isPlaceholder,isDisabled:!i.isEditable||o,size:e})})})}function Jm({name:e,defaultValue:o,...t}){let{control:r,formState:n}=reactHookForm.useFormContext(),a=D(n.errors,e);return jsxRuntime.jsx(reactHookForm.Controller,{control:r,name:e,defaultValue:o,render:({field:i})=>jsxRuntime.jsx(co,{...t,value:i.value??null,onChange:s=>i.onChange(s),isInvalid:!!a,errorMessage:a})})}function uo({value:e,onChange:o,onUrlChange:t,accept:r="image/*",maxSize:n,isDisabled:a=false,onUpload:i,className:s,showPreview:d=true,placeholder:u="Drop files here or click to browse"}){let[c,l]=lt.useState(false),[g,v]=lt.useState(false),[m,p]=lt.useState(null),[C,R]=lt.useState(e),P=lt.useRef(null),V=async F=>{if(p(null),n&&F.size>n){p(`File size must be less than ${(n/1024/1024).toFixed(2)}MB`);return}if(d&&F.type.startsWith("image/")){let k=new FileReader;k.onloadend=()=>{R(k.result);},k.readAsDataURL(F);}if(i){v(true);try{let k=await i(F);R(k),t?.(k);}catch(k){p("Failed to upload file"),console.error("Upload error:",k);}finally{v(false);}}o?.(F,C);},M=async F=>{try{let k=F.items;if(k.length>0){let Q=k[0];if(Q.kind==="file"){let S=await Q.getFile();S&&V(S);}}}catch(k){p("Failed to upload file"),console.error("Upload error:",k);}finally{l(false);}},E=()=>{R(void 0),p(null),o?.(null),t?.(""),P.current&&(P.current.value="");};return jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("w-full",s),children:[jsxRuntime.jsxs(reactAriaComponents.DropZone,{className:tailwindMerge.twMerge("relative flex min-h-[200px] w-full flex-col items-center justify-center rounded-lg border-2 border-dashed transition-colors",c?"border-action-brand bg-action-brand/5":"border-border-muted hover:border-border-default",a&&"pointer-events-none opacity-50",m&&"border-feedback-error-border bg-feedback-error-background/50"),onDrop:M,onDropEnter:()=>l(true),onDropExit:()=>l(false),children:[C?jsxRuntime.jsxs("div",{className:"relative flex h-full w-full items-center justify-center p-4",children:[d&&(C.startsWith("data:image")||C.startsWith("http"))?jsxRuntime.jsx("img",{src:C,alt:"Preview",className:"max-h-48 max-w-full rounded-md object-contain"}):jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-2",children:[jsxRuntime.jsx(lucideReact.Image,{className:"h-12 w-12 text-text-secondary"}),jsxRuntime.jsx("span",{className:"text-sm text-text-secondary",children:"File uploaded"})]}),!a&&jsxRuntime.jsx(T,{variant:"icon",size:"sm",onPress:E,className:"absolute right-2 top-2 bg-background-surface shadow-md",children:jsxRuntime.jsx(lucideReact.X,{className:"h-4 w-4"})})]}):jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-4 p-6",children:[jsxRuntime.jsx(lucideReact.Upload,{className:"h-12 w-12 text-text-secondary"}),jsxRuntime.jsxs("div",{className:"text-center",children:[jsxRuntime.jsx("p",{className:"text-sm text-text-primary",children:u}),jsxRuntime.jsx("p",{className:"mt-1 text-xs text-text-secondary",children:r==="image/*"?"PNG, JPG, GIF up to 10MB":`Accepts ${r}`})]}),jsxRuntime.jsx(reactAriaComponents.FileTrigger,{acceptedFileTypes:r.split(","),onSelect:F=>{let k=Array.from(F||[]);k.length>0&&V(k[0]);},children:jsxRuntime.jsx(T,{variant:"secondary",size:"sm",isDisabled:a,children:"Choose File"})})]}),g&&jsxRuntime.jsx("div",{className:"absolute inset-0 flex items-center justify-center rounded-lg bg-background-surface/80",children:jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-2",children:[jsxRuntime.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-action-brand border-t-transparent"}),jsxRuntime.jsx("span",{className:"text-sm text-text-secondary",children:"Uploading..."})]})})]}),m&&jsxRuntime.jsx("p",{className:"mt-2 text-sm text-feedback-error-text",children:m})]})}function fp({name:e,defaultValue:o,errorBelow:t=true,...r}){let{control:n,formState:a}=reactHookForm.useFormContext(),i=D(a.errors,e);return jsxRuntime.jsx(reactHookForm.Controller,{control:n,name:e,defaultValue:o,render:({field:s})=>jsxRuntime.jsxs("div",{className:"flex flex-col gap-1",children:[jsxRuntime.jsx(uo,{...r,value:s.value??"",onChange:(d,u)=>s.onChange(u||"")}),t&&i&&jsxRuntime.jsx(f,{children:i})]})})}var _i=e=>{let o=ae({isInvalid:e.isInvalid,isDisabled:e.isDisabled,isFocused:e.isFocused,transparent:e.transparent,size:e.size});return tailwindMerge.twMerge(o,"pr-9","[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",e.className)};function fo({label:e,description:o,errorMessage:t,size:r="md",tooltip:n,isRequired:a,transparent:i,validationResult:s,reserveErrorSpace:d=true,descriptionPlacement:u="below",...c}){let l=lt.useId(),{isFocused:g,handleFocus:v,handleBlur:m}=ke();return jsxRuntime.jsx(reactAriaComponents.NumberField,{...c,id:l,isRequired:a,className:G(c.className,"group flex flex-col gap-1"),step:c.step??1,onChange:p=>{typeof p=="number"&&(c.maxValue!=null&&p>c.maxValue?c.onChange?.(c.maxValue):c.minValue!=null&&p<c.minValue?c.onChange?.(c.minValue):c.onChange?.(p));},isInvalid:!!t||typeof c.value=="number"&&(c.maxValue!=null&&c.value>c.maxValue||c.minValue!=null&&c.value<c.minValue),children:({isDisabled:p,isInvalid:C})=>jsxRuntime.jsxs("div",{className:"flex flex-col gap-1",children:[e&&jsxRuntime.jsx(W,{size:r,tooltip:n,description:u==="tooltip"||u==="inline"?o:void 0,descriptionPlacement:u,isRequired:a,htmlFor:l,children:e}),jsxRuntime.jsx("div",{className:"relative",children:jsxRuntime.jsxs(reactAriaComponents.Group,{className:"relative",children:[jsxRuntime.jsx(reactAriaComponents.Input,{onFocus:P=>v(P,c.onFocus),onBlur:P=>m(P,c.onBlur),className:_i({isInvalid:C||!!t,isDisabled:p,isFocused:g,transparent:i,size:r,className:typeof c.className=="string"?c.className:void 0})}),jsxRuntime.jsxs("div",{className:"absolute inset-y-[2px] right-[2px] flex flex-col divide-y divide-border-default border-l border-border-default overflow-hidden rounded-r-[calc(var(--control-border-radius)-2px)]",children:[jsxRuntime.jsx(reactAriaComponents.Button,{slot:"increment",isDisabled:p,className:"flex h-1/2 w-7 items-center justify-center bg-background-input hover:bg-background-input-hover active:bg-background-input-active disabled:cursor-not-allowed disabled:opacity-50",children:jsxRuntime.jsx(y,{name:"CaretUp",size:14})}),jsxRuntime.jsx(reactAriaComponents.Button,{slot:"decrement",isDisabled:p,className:"flex h-1/2 w-7 items-center justify-center bg-background-input hover:bg-background-input-hover active:bg-background-input-active disabled:cursor-not-allowed disabled:opacity-50",children:jsxRuntime.jsx(y,{name:"CaretDown",size:14})})]})]})}),d?jsxRuntime.jsx("div",{className:"mt-1 min-h-[20px]",children:t?jsxRuntime.jsx(f,{size:r,children:typeof t=="function"?t(s):t}):o&&u==="below"?jsxRuntime.jsx(I,{size:r,children:o}):null}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:t?jsxRuntime.jsx(f,{size:r,className:"mt-1",children:typeof t=="function"?t(s):t}):o&&u==="below"?jsxRuntime.jsx(I,{size:r,className:"mt-1",children:o}):null})]})})}function Vp({name:e,defaultValue:o,...t}){let{control:r,formState:n}=reactHookForm.useFormContext(),a=D(n.errors,e);return jsxRuntime.jsx(reactHookForm.Controller,{control:r,name:e,defaultValue:o,render:({field:i})=>jsxRuntime.jsx(fo,{...t,value:typeof i.value=="number"?i.value:void 0,onChange:s=>i.onChange(s),isInvalid:!!a,errorMessage:a,isRequired:t.isRequired})})}function xo({value:e,defaultValue:o,onChange:t,isDisabled:r,isReadOnly:n,isRequired:a,className:i,children:s,size:d="2",variant:u="primary",columns:c="repeat(auto-fit, minmax(160px, 1fr))",gap:l="1"}){return jsxRuntime.jsx(reactAriaComponents.RadioGroup,{value:e,defaultValue:o,onChange:t,isDisabled:r,isReadOnly:n,isRequired:a,className:G(i,"grid"),style:{gridTemplateColumns:/^\d+$/.test(String(c))?`repeat(${c}, minmax(0, 1fr))`:c,gap:l==="1"?"0.25rem":l==="2"?"0.5rem":l==="3"?"0.75rem":l==="4"?"1rem":typeof l=="number"?`${l}px`:l},children:lt__namespace.default.Children.map(s,g=>lt__namespace.default.isValidElement(g)?lt__namespace.default.cloneElement(g,{size:d,variant:u}):g)})}function Xp({name:e,defaultValue:o,label:t,description:r,children:n,...a}){let{control:i,formState:s}=reactHookForm.useFormContext(),d=D(s.errors,e);return jsxRuntime.jsx(reactHookForm.Controller,{control:i,name:e,defaultValue:o,render:({field:u})=>jsxRuntime.jsxs("div",{className:"flex flex-col gap-1",children:[t&&jsxRuntime.jsx(W,{children:t}),r&&jsxRuntime.jsx(I,{children:r}),jsxRuntime.jsx(xo,{...a,value:u.value,onChange:c=>u.onChange(c),children:n}),d&&jsxRuntime.jsx(f,{children:d})]})})}function ji(e){return "primary"}var Qi=lt.createContext({variant:"primary"});function bo(e){let{variant:o="primary",...t}=e,r=ji();return jsxRuntime.jsx(Qi.Provider,{value:{variant:r},children:jsxRuntime.jsxs(reactAriaComponents.RadioGroup,{...t,className:G(e.className,"group flex flex-col gap-2"),children:[jsxRuntime.jsx(W,{children:e.label}),jsxRuntime.jsx("div",{className:`flex ${t.orientation==="horizontal"?"flex-row gap-4":"flex-col gap-2"}`,children:e.children}),e.description&&jsxRuntime.jsx(I,{children:e.description}),jsxRuntime.jsx(f,{children:typeof e.errorMessage=="function"&&e.validationResult?e.errorMessage(e.validationResult):typeof e.errorMessage=="string"?e.errorMessage:null})]})})}function yf({name:e,defaultValue:o,...t}){let{control:r,formState:n}=reactHookForm.useFormContext(),a=D(n.errors,e);return jsxRuntime.jsx(reactHookForm.Controller,{control:r,name:e,defaultValue:o,render:({field:i})=>jsxRuntime.jsx(bo,{...t,value:i.value,onChange:s=>i.onChange(s),errorMessage:a,children:t.children})})}var rs=e=>{let o=ae({isInvalid:e.isInvalid,isDisabled:e.isDisabled,isFocused:e.isFocused,transparent:e.transparent,size:e.size}),t=[e.showSearchIcon?"":"pl-3",e.isClearable&&e.hasValue||e.isPassword?"pr-8":"pr-3"].join(" ");return tailwindMerge.twMerge(o,t,e.className)};function mt({label:e,description:o,errorMessage:t,size:r="md",tooltip:n,isRequired:a,transparent:i,showSearchIcon:s,isClearable:d,onClear:u,type:c,validationResult:l,reserveErrorSpace:g=true,isLoading:v=false,descriptionPlacement:m="below",...p}){let[C,R]=lt__namespace.default.useState(false),{isFocused:P,handleFocus:V,handleBlur:M}=ke(),E=c==="password",F=gt(v,300);return jsxRuntime.jsx(reactAriaComponents.TextField,{...p,isRequired:a,className:G(p.className,"group flex flex-col"),children:({isDisabled:k,isInvalid:Q})=>jsxRuntime.jsxs("div",{className:"flex flex-col",children:[e&&jsxRuntime.jsx(W,{size:r,tooltip:n,description:m==="tooltip"||m==="inline"?o:void 0,descriptionPlacement:m,isRequired:a,children:e}),jsxRuntime.jsxs(oe,{children:[s&&jsxRuntime.jsx("div",{className:"pointer-events-none absolute top-1/2 -translate-y-1/2 transform flex items-center z-10",style:{left:9},children:(()=>{let S={sm:14,md:16,lg:18,xl:20}[r];return F?jsxRuntime.jsx(Ke,{size:S,color:"text-text-secondary"}):jsxRuntime.jsx(y,{name:"MagnifyingGlass",size:S,className:`transition-colors ${P?"text-action-brand":"text-text-secondary"}`})})()}),jsxRuntime.jsx(vt,{size:r,disabled:k,type:E?C?"text":"password":c,name:p.name,autoComplete:p.autoComplete,value:p.value,defaultValue:p.defaultValue,placeholder:p.placeholder,onFocus:S=>V(S,p.onFocus),onBlur:S=>M(S,p.onBlur),onChange:S=>p.onChange?.(S.target.value),style:s?{paddingLeft:{sm:28,md:32,lg:36,xl:37}[r]}:void 0,className:rs({isInvalid:Q,isDisabled:k,isFocused:P,size:r,transparent:i,showSearchIcon:s,isClearable:d,hasValue:!!p.value,isPassword:E,className:typeof p.className=="string"?p.className:void 0})}),d&&p.value&&!k&&jsxRuntime.jsx(et,{onClick:()=>{u?u():p.onChange&&p.onChange("");},size:r}),E&&!k&&jsxRuntime.jsx("button",{type:"button",onClick:()=>R(!C),className:"absolute right-3 top-1/2 -translate-y-1/2 transform text-text-secondary hover:text-text-primary","aria-label":C?"Hide password":"Show password",onMouseDown:S=>{S.preventDefault(),S.stopPropagation();},children:jsxRuntime.jsx(y,{name:C?"EyeSlash":"Eye",size:r==="sm"?16:20,className:"text-text-primary"})})]}),g?jsxRuntime.jsx("div",{className:"mt-1 min-h-[20px]",children:typeof t=="string"?jsxRuntime.jsx(f,{size:r,children:t}):typeof t=="function"&&l?jsxRuntime.jsx(f,{size:r,children:t(l)}):o&&m==="below"?jsxRuntime.jsx(I,{size:r,children:o}):null}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:typeof t=="string"?jsxRuntime.jsx(f,{size:r,className:"mt-1",children:t}):typeof t=="function"&&l?jsxRuntime.jsx(f,{size:r,className:"mt-1",children:t(l)}):o&&m==="below"?jsxRuntime.jsx(I,{size:r,className:"mt-1",children:o}):null})]})})}var ps={sm:{toolbar:"p-1.5",contentWrapper:"min-h-[100px]",contentPadding:"p-3",placeholderPos:"left-3 top-3",prose:"prose-xs",h1:"[&_.ProseMirror_h1]:mb-2 [&_.ProseMirror_h1]:text-base [&_.ProseMirror_h1]:font-bold",h2:"[&_.ProseMirror_h2]:mb-1.5 [&_.ProseMirror_h2]:text-sm [&_.ProseMirror_h2]:font-semibold",p:"[&_.ProseMirror_p]:mb-1",list:"[&_.ProseMirror_ul]:mb-1 [&_.ProseMirror_ul]:ml-4 [&_.ProseMirror_ol]:mb-1 [&_.ProseMirror_ol]:ml-4",li:"[&_.ProseMirror_li]:mb-0.5",placeholderText:"text-xs"},md:{toolbar:"p-2",contentWrapper:"min-h-[200px]",contentPadding:"p-4",placeholderPos:"left-4 top-4",prose:"prose-sm",h1:"[&_.ProseMirror_h1]:mb-4 [&_.ProseMirror_h1]:text-2xl [&_.ProseMirror_h1]:font-bold",h2:"[&_.ProseMirror_h2]:mb-3 [&_.ProseMirror_h2]:text-xl [&_.ProseMirror_h2]:font-semibold",p:"[&_.ProseMirror_p]:mb-2",list:"[&_.ProseMirror_ul]:mb-2 [&_.ProseMirror_ul]:ml-6 [&_.ProseMirror_ol]:mb-2 [&_.ProseMirror_ol]:ml-6",li:"[&_.ProseMirror_li]:mb-1",placeholderText:"text-sm"},lg:{toolbar:"p-2.5",contentWrapper:"min-h-[250px]",contentPadding:"p-5",placeholderPos:"left-5 top-5",prose:"prose-base",h1:"[&_.ProseMirror_h1]:mb-5 [&_.ProseMirror_h1]:text-3xl [&_.ProseMirror_h1]:font-bold",h2:"[&_.ProseMirror_h2]:mb-4 [&_.ProseMirror_h2]:text-2xl [&_.ProseMirror_h2]:font-semibold",p:"[&_.ProseMirror_p]:mb-3",list:"[&_.ProseMirror_ul]:mb-3 [&_.ProseMirror_ul]:ml-6 [&_.ProseMirror_ol]:mb-3 [&_.ProseMirror_ol]:ml-6",li:"[&_.ProseMirror_li]:mb-1.5",placeholderText:"text-base"},xl:{toolbar:"p-3",contentWrapper:"min-h-[300px]",contentPadding:"p-6",placeholderPos:"left-6 top-6",prose:"prose-lg",h1:"[&_.ProseMirror_h1]:mb-6 [&_.ProseMirror_h1]:text-4xl [&_.ProseMirror_h1]:font-bold",h2:"[&_.ProseMirror_h2]:mb-5 [&_.ProseMirror_h2]:text-3xl [&_.ProseMirror_h2]:font-semibold",p:"[&_.ProseMirror_p]:mb-3",list:"[&_.ProseMirror_ul]:mb-3 [&_.ProseMirror_ul]:ml-8 [&_.ProseMirror_ol]:mb-3 [&_.ProseMirror_ol]:ml-8",li:"[&_.ProseMirror_li]:mb-2",placeholderText:"text-lg"}},Qe=({isActive:e=false,onPress:o,children:t})=>jsxRuntime.jsx(T,{variant:e?"secondary":"ghost",size:"sm",onPress:o,className:"p-1",children:t});function fs({initialUrl:e,isOpen:o,onClose:t,onSubmit:r}){let[n,a]=lt.useState(e);return lt__namespace.default.useEffect(()=>{a(e);},[e]),jsxRuntime.jsx(Be,{isDismissable:true,isOpen:o,onOpenChange:s=>!s&&t(),children:jsxRuntime.jsx(reactAriaComponents.Modal,{className:"flex items-center justify-center p-4 outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0 focus-visible:ring-0",children:jsxRuntime.jsx(reactAriaComponents.Dialog,{className:"relative bg-background-surface rounded-lg shadow-xl max-w-md w-full",children:jsxRuntime.jsxs("form",{onSubmit:s=>{s.preventDefault(),r(n),t();},children:[jsxRuntime.jsx($e,{title:"Insert Link",onClose:t}),jsxRuntime.jsx("div",{className:"p-6",children:jsxRuntime.jsx(mt,{label:"URL",type:"url",value:n,onChange:a,autoFocus:true,className:"w-full"})}),jsxRuntime.jsxs("div",{className:"flex justify-end gap-2 border-t border-border-muted p-4",children:[jsxRuntime.jsx(T,{variant:"secondary",onPress:t,children:"Cancel"}),jsxRuntime.jsx(T,{type:"submit",children:"Save"})]})]})})})})}function ho({initialContent:e="",onChange:o,className:t,isDisabled:r=false,placeholder:n="Start typing...",id:a,size:i="md",headingLevels:s=[1,2]}){let d=ps[i],[u,c]=lt.useState(false),l=react.useEditor({immediatelyRender:false,extensions:[ds__default.default.configure({heading:s.length>0?{levels:s}:false}),as__default.default.configure({openOnClick:false,HTMLAttributes:{class:"text-text-link-default hover:text-text-link-hover underline decoration-text-link-default/30 hover:decoration-text-link-hover cursor-pointer"}})],content:e,editable:!r,onUpdate:({editor:m})=>{o?.(m.getHTML());},editorProps:{attributes:{class:tailwindMerge.twMerge(`prose ${d.prose} max-w-none`,"focus:outline-none","[&>*:first-child]:mt-0 [&>*:last-child]:mb-0")}}}),g=()=>{c(true);},v=m=>{m===""?l?.chain().focus().unsetLink().run():l?.chain().focus().setLink({href:m}).run();};return l?jsxRuntime.jsxs("div",{id:a,"data-richtexteditor":true,className:tailwindMerge.twMerge("flex flex-col rounded-md border border-border-input bg-background-input","outline-none focus-within:outline-none focus-within:border-border-input focus-within:ring-0 focus-within:shadow-none",r&&"opacity-50",t),style:{outline:"none"},children:[!r&&l&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(menus.BubbleMenu,{editor:l,shouldShow:({editor:m})=>m.isActive("link")&&!u,className:"flex items-center gap-1 rounded-md border border-border-input bg-background-surface p-1 shadow-md",children:[jsxRuntime.jsxs(T,{variant:"ghost",size:"sm",className:"h-8 px-2",onPress:()=>{let m=l.getAttributes("link").href;m&&window.open(m,"_blank","noopener,noreferrer");},children:[jsxRuntime.jsx(y,{name:"ArrowSquareOut",className:"mr-1 h-4 w-4"}),"Open"]}),jsxRuntime.jsxs(T,{variant:"ghost",size:"sm",className:"h-8 px-2",onPress:g,children:[jsxRuntime.jsx(y,{name:"PencilSimple",className:"mr-1 h-4 w-4"}),"Edit"]}),jsxRuntime.jsxs(T,{variant:"ghost",size:"sm",className:"h-8 px-2",onPress:()=>l.chain().focus().unsetLink().run(),children:[jsxRuntime.jsx(y,{name:"X",className:"mr-1 h-4 w-4"}),"Remove"]})]}),jsxRuntime.jsx(fs,{isOpen:u,onClose:()=>c(false),onSubmit:v,initialUrl:l.getAttributes("link").href||""})]}),jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("flex items-center gap-1 border-b border-border-input",d.toolbar),children:[s.map(m=>jsxRuntime.jsx(Qe,{isActive:l.isActive("heading",{level:m}),onPress:()=>l.chain().focus().toggleHeading({level:m}).run(),children:jsxRuntime.jsxs("span",{className:"text-xs font-bold",children:["H",m]})},m)),jsxRuntime.jsx(Qe,{isActive:l.isActive("bold"),onPress:()=>l.chain().focus().toggleBold().run(),children:jsxRuntime.jsx("span",{className:"text-xs font-bold",children:"B"})}),jsxRuntime.jsx(Qe,{isActive:l.isActive("italic"),onPress:()=>l.chain().focus().toggleItalic().run(),children:jsxRuntime.jsx("span",{className:"text-xs italic",children:"I"})}),jsxRuntime.jsx("div",{className:"mx-1 h-4 w-px bg-border-muted"}),jsxRuntime.jsx(Qe,{isActive:l.isActive("bulletList"),onPress:()=>l.chain().focus().toggleBulletList().run(),children:jsxRuntime.jsx(y,{name:"ListBullets",className:"h-4 w-4"})}),jsxRuntime.jsx(Qe,{isActive:l.isActive("orderedList"),onPress:()=>l.chain().focus().toggleOrderedList().run(),children:jsxRuntime.jsx(y,{name:"ListNumbers",className:"h-4 w-4"})}),jsxRuntime.jsx("div",{className:"mx-1 h-4 w-px bg-border-muted"}),jsxRuntime.jsx(Qe,{isActive:l.isActive("link"),onPress:g,children:jsxRuntime.jsx(y,{name:"PaperclipHorizontal",className:"h-4 w-4"})})]}),jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("relative w-full outline-none focus:outline-none",d.contentWrapper),children:[jsxRuntime.jsx(react.EditorContent,{editor:l,className:tailwindMerge.twMerge("w-full outline-none focus:outline-none",d.contentPadding,"[&_.ProseMirror]:min-h-[inherit]","[&_.ProseMirror]:outline-none [&_.ProseMirror]:focus:outline-none",d.h1,d.h2,d.p,"[&_.ProseMirror_ul]:list-disc","[&_.ProseMirror_ol]:list-decimal",d.list,d.li,"[&_.ProseMirror_blockquote]:border-l-4 [&_.ProseMirror_blockquote]:border-border-muted [&_.ProseMirror_blockquote]:pl-4 [&_.ProseMirror_blockquote]:italic","[&_.ProseMirror_code]:rounded [&_.ProseMirror_code]:bg-background-muted [&_.ProseMirror_code]:px-1 [&_.ProseMirror_code]:py-0.5 [&_.ProseMirror_code]:font-mono [&_.ProseMirror_code]:text-sm","[&_.ProseMirror_pre]:rounded-md [&_.ProseMirror_pre]:bg-background-muted [&_.ProseMirror_pre]:p-3 [&_.ProseMirror_pre]:font-mono [&_.ProseMirror_pre]:text-sm","[&_.ProseMirror_hr]:border-border-muted",r&&"pointer-events-none")}),l.isEmpty&&!r&&jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("pointer-events-none absolute text-text-secondary",d.placeholderPos,d.placeholderText),children:n})]})]}):null}function og({name:e,defaultValue:o,label:t,description:r,reserveErrorSpace:n=true,...a}){let{control:i,formState:s}=reactHookForm.useFormContext(),d=D(s.errors,e);return jsxRuntime.jsx(reactHookForm.Controller,{control:i,name:e,defaultValue:o,render:({field:u})=>jsxRuntime.jsxs("div",{className:"flex flex-col gap-1",children:[t&&jsxRuntime.jsx("label",{htmlFor:e,className:"text-sm font-medium text-text-primary",children:t}),r&&jsxRuntime.jsx("p",{className:"text-sm text-text-secondary",children:r}),jsxRuntime.jsx(ho,{...a,id:e,initialContent:u.value??"",onChange:c=>u.onChange(c)}),d&&jsxRuntime.jsx("p",{className:"text-sm text-feedback-error-text",children:d}),n&&!d&&jsxRuntime.jsx("div",{className:"h-5"})]})})}function cg({name:e,defaultValue:o,onValueChange:t,...r}){let{control:n,formState:a}=reactHookForm.useFormContext(),i=D(a.errors,e);return jsxRuntime.jsx(reactHookForm.Controller,{control:n,name:e,defaultValue:o,render:({field:s})=>jsxRuntime.jsx(Zt,{...r,selectedKey:s.value??null,onSelectionChange:d=>{s.onChange(d),t?.(d);},showErrors:!!i,errorMessage:i})})}var vo={sm:{track:"h-4 w-7",handle:"h-3.5 w-3.5",text:"text-xs"},md:{track:"h-5 w-9",handle:"h-4 w-4",text:"text-sm"},lg:{track:"h-6 w-11",handle:"h-5 w-5",text:"text-base"},xl:{track:"h-7 w-14",handle:"h-6 w-6",text:"text-lg"}};function Cs({isSelected:e,isDisabled:o,size:t="md"}){let r="flex px-px items-center shrink-0 cursor-default rounded-full transition duration-200 ease-in-out shadow-inner border border-transparent",n=vo[t].track,a=Ee,i="focus-visible:outline-action-primary",s="";return e?s="bg-action-primary forced-colors:!bg-[Highlight] group-pressed:bg-action-primary-hover":s="bg-border-input group-pressed:bg-border-focus",[r,n,a,i,s,o?"bg-background-muted forced-colors:group-selected:!bg-[GrayText] forced-colors:border-[GrayText]":""].filter(Boolean).join(" ")}function Rs({isSelected:e,isDisabled:o,size:t="md"}){let r="transform rounded-full bg-background-surface outline-none shadow transition duration-200 ease-in-out",n=vo[t].handle;return [r,n,e?"translate-x-[100%]":"translate-x-0",o?"forced-colors:outline-[GrayText]":""].filter(Boolean).join(" ")}function Po({children:e,variant:o="primary",size:t="md",...r}){return jsxRuntime.jsx(reactAriaComponents.Switch,{...r,className:G(r.className,`relative group flex items-center gap-2 ${vo[t].text} text-text-primary transition disabled:text-text-disabled forced-colors:disabled:text-[GrayText]`),children:n=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:Cs({...n,size:t}),children:jsxRuntime.jsx("span",{className:Rs({...n,size:t})})}),e]})})}function Cg({name:e,defaultValue:o,...t}){let{control:r}=reactHookForm.useFormContext();return jsxRuntime.jsx(reactHookForm.Controller,{control:r,name:e,defaultValue:o,render:({field:n})=>jsxRuntime.jsx(Po,{...t,isSelected:!!n.value,onChange:a=>n.onChange(a),children:t.children})})}var ws=e=>{let o=ae({isInvalid:e.isInvalid,isDisabled:e.isDisabled,isFocused:e.isFocused,transparent:e.transparent,size:e.size}),t=`min-h-[100px] py-2 ${e.isDisabled?"resize-none":e.isResizable?"resize-y":"resize-none"}`;return tailwindMerge.twMerge(o,t,e.className)};function Co({label:e,description:o,errorMessage:t,size:r="md",tooltip:n,required:a,transparent:i,isInvalid:s,isDisabled:d,isResizable:u=false,className:c,validationResult:l,reserveErrorSpace:g=true,...v}){let{isFocused:m,handleFocus:p,handleBlur:C}=ke();return jsxRuntime.jsx("div",{className:"group flex flex-col",children:jsxRuntime.jsxs("div",{className:"flex flex-col",children:[e&&jsxRuntime.jsx(W,{size:r,tooltip:n,isRequired:a,children:e}),jsxRuntime.jsx(oe,{children:jsxRuntime.jsx("textarea",{...v,required:a,onFocus:R=>{v.onFocus&&v.onFocus(R),p(R);},onBlur:R=>{v.onBlur&&v.onBlur(R),C(R);},className:ws({isInvalid:s,isDisabled:d,isResizable:u,isFocused:m,size:r,transparent:i,className:c}),disabled:d})}),g?jsxRuntime.jsx("div",{className:"mt-1 min-h-[20px]",children:typeof t=="string"?jsxRuntime.jsx(f,{size:r,children:t}):typeof t=="function"&&l?jsxRuntime.jsx(f,{size:r,children:t(l)}):o?jsxRuntime.jsx(I,{size:r,children:o}):null}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:typeof t=="string"?jsxRuntime.jsx(f,{size:r,className:"mt-1",children:t}):typeof t=="function"&&l?jsxRuntime.jsx(f,{size:r,className:"mt-1",children:t(l)}):o?jsxRuntime.jsx(I,{size:r,className:"mt-1",children:o}):null})]})})}function Dg({name:e,defaultValue:o,...t}){let{control:r,formState:n}=reactHookForm.useFormContext(),a=D(n.errors,e);return jsxRuntime.jsx(reactHookForm.Controller,{control:r,name:e,defaultValue:o,render:({field:i})=>jsxRuntime.jsx(Co,{...t,value:i.value??"",onChange:s=>i.onChange(s.target.value),onBlur:s=>{i.onBlur(),t.onBlur?.(s);},isInvalid:!!a,errorMessage:a,required:t.required})})}function Og({name:e,defaultValue:o,...t}){let{control:r,formState:n}=reactHookForm.useFormContext(),a=D(n.errors,e);return jsxRuntime.jsx(reactHookForm.Controller,{control:r,name:e,defaultValue:o,render:({field:i})=>jsxRuntime.jsx(mt,{...t,value:i.value??"",onChange:s=>i.onChange(s),onBlur:s=>{i.onBlur(),t.onBlur?.(s);},isInvalid:!!a,errorMessage:a,isRequired:t.isRequired})})}function Hs({isPlaceholder:e,isDisabled:o,size:t="md"}){return tailwindMerge.twMerge("inline-block box-content px-0.5 rounded outline-none tabular-nums text-center transition-colors",{sm:"text-base md:text-xs",md:"text-base md:text-sm",lg:"text-base",xl:"text-lg"}[t],e?"text-text-disabled italic":"text-text-primary",o?"text-text-disabled cursor-not-allowed":"cursor-text",!o&&"hover:bg-background-hover","data-[focused]:bg-background-selected data-[focused]:text-text-primary")}function Ro({label:e,description:o,errorMessage:t,size:r="md",tooltip:n,isRequired:a,isDisabled:i,isInvalid:s,reserveErrorSpace:d=true,validationResult:u,className:c,descriptionPlacement:l="below",...g}){return jsxRuntime.jsxs(reactAriaComponents.TimeField,{...g,isDisabled:i,isRequired:a,isInvalid:s,className:G(c,"flex flex-col gap-1"),children:[e&&jsxRuntime.jsx(W,{size:r,tooltip:n,description:l==="tooltip"||l==="inline"?o:void 0,descriptionPlacement:l,isRequired:a,children:e}),jsxRuntime.jsx(oe,{children:jsxRuntime.jsx(reactAriaComponents.DateInput,{className:tailwindMerge.twMerge(tt({isInvalid:s,isDisabled:i}),"px-3 py-2 flex items-center gap-0.5 w-full"),children:v=>jsxRuntime.jsx(reactAriaComponents.DateSegment,{segment:v,className:Hs({isPlaceholder:v.isPlaceholder,isDisabled:!v.isEditable||i,size:r})})})}),d?jsxRuntime.jsx("div",{className:"mt-1 min-h-[20px]",children:typeof t=="string"?jsxRuntime.jsx(f,{size:r,children:t}):typeof t=="function"&&u?jsxRuntime.jsx(f,{size:r,children:t(u)}):o&&l==="below"?jsxRuntime.jsx(I,{size:r,children:o}):null}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:typeof t=="string"?jsxRuntime.jsx(f,{size:r,className:"mt-1",children:t}):typeof t=="function"&&u?jsxRuntime.jsx(f,{size:r,className:"mt-1",children:t(u)}):o&&l==="below"?jsxRuntime.jsx(I,{size:r,className:"mt-1",children:o}):null})]})}function sx({name:e,...o}){let{control:t,formState:{errors:r}}=reactHookForm.useFormContext(),n=r[e],a=n?.message;return jsxRuntime.jsx(reactHookForm.Controller,{name:e,control:t,render:({field:i})=>jsxRuntime.jsx(Ro,{...o,value:i.value,onChange:i.onChange,isInvalid:!!n,errorMessage:a})})}function mx({className:e,title:o="Please fix the following errors:",autoFocus:t=true}){let{formState:r}=reactHookForm.useFormContext(),n=lt__namespace.useRef(null),a=r.errors,i=Object.entries(a||{}),s=i.length>0;if(lt__namespace.useEffect(()=>{t&&s&&n.current?.focus();},[t,s]),!s)return null;let d=u=>{let c=`[name="${CSS.escape(u)}"]`,l=document.querySelector(c);l&&(l.focus(),l.scrollIntoView({block:"center",behavior:"smooth"}));};return jsxRuntime.jsxs("div",{ref:n,role:"alert",tabIndex:-1,className:tailwindMerge.twMerge("rounded-md border border-feedback-error-border bg-feedback-error-background p-3 text-sm text-feedback-error-text",e),children:[jsxRuntime.jsx("div",{className:"font-medium",children:o}),jsxRuntime.jsx("ul",{className:"mt-2 list-disc pl-5",children:i.map(([u,c])=>{let l=c?.message||"Invalid value";return jsxRuntime.jsx("li",{children:jsxRuntime.jsx("button",{type:"button",className:"underline underline-offset-2",onClick:()=>d(u),children:l})},u)})})]})}function bx({formId:e,disableWhenInvalid:o,disableWhenPristine:t,isDisabled:r,children:n,...a}){let{formState:i}=reactHookForm.useFormContext(),s=r||i.isSubmitting||o&&!i.isValid||t&&!i.isDirty;return jsxRuntime.jsx(T,{type:"submit",form:e,isDisabled:s,...a,children:n})}function Rx({name:e,getItemTitle:o,renderItem:t,onAdd:r}){let{control:n}=reactHookForm.useFormContext(),{fields:a,append:i,remove:s,swap:d}=reactHookForm.useFieldArray({control:n,name:e});return jsxRuntime.jsxs("div",{className:"flex flex-col gap-3",children:[a.map((u,c)=>jsxRuntime.jsxs(be,{children:[jsxRuntime.jsx(it,{title:o?o(c):`Item ${c+1}`,actions:jsxRuntime.jsxs("div",{className:"flex gap-2",children:[c>0&&jsxRuntime.jsx(T,{size:"sm",variant:"secondary",onPress:()=>d(c,c-1),children:"Up"}),c<a.length-1&&jsxRuntime.jsx(T,{size:"sm",variant:"secondary",onPress:()=>d(c,c+1),children:"Down"}),jsxRuntime.jsx(T,{size:"sm",variant:"secondary",onPress:()=>s(c),children:"Remove"})]})}),jsxRuntime.jsx(Pt,{children:t(c)})]},u.id)),jsxRuntime.jsx("div",{children:jsxRuntime.jsx(T,{variant:"secondary",onPress:()=>i(r?.()||{}),children:"Add item"})})]})}function To(e){return jsxRuntime.jsx(reactAriaComponents.Form,{validationBehavior:"aria",...e,className:tailwindMerge.twMerge("flex flex-col gap-6",e.className)})}function wr(e){let o=e.querySelector("[aria-invalid='true'], .aria-invalid, [data-invalid='true']")||e.querySelector("input[aria-invalid='true'], select[aria-invalid='true'], textarea[aria-invalid='true']")||e.querySelector("input, select, textarea");o&&(o.focus({preventScroll:false}),o instanceof HTMLElement&&o.scrollIntoView({block:"center",behavior:"smooth"}));}function Mx({id:e,onSubmit:o,onInvalid:t,children:r,shouldFocusError:n=true,className:a,...i}){let s=reactHookForm.useForm(i),d=(u,c)=>{if(n&&e){let l=document.getElementById(e);l&&wr(l);}t?.(u,c);};return jsxRuntime.jsx(reactHookForm.FormProvider,{...s,children:jsxRuntime.jsx(To,{id:e,className:a,onSubmit:s.handleSubmit(o,d),children:r})})}function Br({formId:e,show:o,isSubmitting:t,onCancel:r,primaryLabel:n="Save changes",secondaryLabel:a="Cancel",className:i}){return o?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",i),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(T,{variant:"secondary",onPress:r,children:a}),jsxRuntime.jsx(T,{type:"submit",form:e,isDisabled:!!t,children:t?"Saving...":n})]})]})}):null}function Ux({formId:e,onCancel:o,primaryLabel:t,secondaryLabel:r,className:n}){let{formState:a}=reactHookForm.useFormContext();return jsxRuntime.jsx(Br,{formId:e,show:a.isDirty,isSubmitting:a.isSubmitting,onCancel:o,primaryLabel:t,secondaryLabel:r,className:n})}function Qx(e=true){let{formState:o}=reactHookForm.useFormContext();lt__namespace.useEffect(()=>{if(!e||!o.isSubmitted||!o.errors||Object.keys(o.errors).length===0)return;let t=document.querySelector("[aria-invalid='true'], .aria-invalid, [data-invalid='true']")||document.querySelector("input[aria-invalid='true'], select[aria-invalid='true'], textarea[aria-invalid='true']");t&&t.scrollIntoView({block:"center",behavior:"smooth"});},[e,o.isSubmitted,o.errors]);}function Zx({delayMs:e=800,onAutoSave:o}){let{watch:t,formState:r,getValues:n}=reactHookForm.useFormContext(),a=lt__namespace.useRef(void 0);lt__namespace.useEffect(()=>{let i=t(()=>{r.isDirty&&(a.current&&window.clearTimeout(a.current),a.current=window.setTimeout(async()=>{let s=n();await o(s);},e));});return ()=>{i.unsubscribe(),a.current&&window.clearTimeout(a.current);}},[t,r.isDirty,n,e,o]);}
2
+ Object.defineProperty(exports,"Controller",{enumerable:true,get:function(){return reactHookForm.Controller}});Object.defineProperty(exports,"useFieldArray",{enumerable:true,get:function(){return reactHookForm.useFieldArray}});Object.defineProperty(exports,"useFormContext",{enumerable:true,get:function(){return reactHookForm.useFormContext}});Object.defineProperty(exports,"useWatch",{enumerable:true,get:function(){return reactHookForm.useWatch}});exports.ErrorSummary=mx;exports.FieldArrayList=Rx;exports.FormAutocomplete=Bu;exports.FormCheckbox=ju;exports.FormCheckboxGroup=tm;exports.FormColorField=ym;exports.FormDateField=Jm;exports.FormFileUpload=fp;exports.FormNumberField=Vp;exports.FormProvider=Mx;exports.FormRadioCardGroup=Xp;exports.FormRadioGroup=yf;exports.FormRichTextEditor=og;exports.FormSaveBar=Ux;exports.FormSelect=cg;exports.FormSwitch=Cg;exports.FormTextArea=Dg;exports.FormTextField=Og;exports.FormTimeField=sx;exports.SubmitButton=bx;exports.focusFirstError=wr;exports.useAutoSave=Zx;exports.useScrollIntoViewOnError=Qx;//# sourceMappingURL=index.cjs.map
3
3
  //# sourceMappingURL=index.cjs.map