import{o as e}from"./rolldown-runtime-FhOqtrmT.js";import{n as t,r as n,t as r}from"./cn-BOQea7EA.js";import{In as i,Ln as a,Mi as o,Mn as s,Nn as c,Qn as l,ia as u,ra as d}from"./vendor-react-Vbe32VU9.js";import{c as f,l as p,s as m}from"./vendor-tanstack-B8xOiRT8.js";import{t as h}from"./label-DTuYaIbU.js";function g(e){let t=`Error`,n=`We had some trouble!`;console.error(e);let r=e,i=e;if(typeof e==`string`?n=e:r?.response?.data?typeof r.response.data==`string`?n=r.response.data:r.response.data.error?n=r.response.data.error:r.response.data.message&&(n=r.response.data.message):i?.message&&(n=i.message),n.includes(`:`)){let e=n.split(`:`);t=e.shift(),n=e.join(`:`)}l.error(t,{description:n,action:{label:`Dismiss`,onClick:()=>l.dismiss()}})}var _=new m({queryCache:new f({onError:g}),mutationCache:new p({onError:g})});function v(){localStorage.clear()}function y(){sessionStorage.clear()}async function b(){n.setUserForEntity(t,null),_.getQueryCache().clear(),v(),y(),await _.invalidateQueries({refetchType:`none`})}var x=c,S=e(u(),1),C=(0,S.createContext)({}),w=(0,S.createContext)({});function T(){let e=(0,S.useContext)(C),t=(0,S.useContext)(w),{getFieldState:n}=i(),r=a({name:e.name}),o=n(e.name,r);if(!e)throw Error(`useFormField should be used within <FormField>`);let{id:s}=t;return{id:s,name:e.name,formItemId:`${s}-form-item`,formDescriptionId:`${s}-form-item-description`,formMessageId:`${s}-form-item-message`,...o}}var E=d();function D({...e}){let{error:t,formItemId:n,formDescriptionId:r,formMessageId:i}=T();return(0,E.jsx)(o,{"data-slot":`form-control`,id:n,"aria-describedby":t?`${r} ${i}`:`${r}`,"aria-invalid":!!t,...e})}function O({...e}){return(0,E.jsx)(C,{value:{name:e.name},children:(0,E.jsx)(s,{...e})})}function k({className:e,...t}){return(0,E.jsx)(w,{value:{id:(0,S.useId)()},children:(0,E.jsx)(`div`,{"data-slot":`form-item`,className:r(`grid gap-2`,e),...t})})}function A({className:e,...t}){let{error:n,formItemId:i}=T();return(0,E.jsx)(h,{"data-slot":`form-label`,"data-error":!!n,className:r(`data-[error=true]:text-destructive`,e),htmlFor:i,...t})}function j({className:e,...t}){let{error:n,formMessageId:i}=T(),a=n?String(n?.message):t.children;return a?(0,E.jsx)(`p`,{"data-slot":`form-message`,id:i,className:r(`text-destructive text-sm`,e),...t,children:a}):null}function M({className:e,type:t,...n}){return(0,E.jsx)(`input`,{type:t,"data-slot":`input`,className:r(`border-input file:text-foreground placeholder:text-muted-foreground selection:bg-purple
        selection:text-primary-foreground
        dark:aria-invalid:outline-destructive dark:aria-invalid:ring-destructive/50 ring-ring/10
        dark:ring-ring/20 dark:outline-ring/40 outline-ring/50 aria-invalid:outline-destructive/60
        aria-invalid:ring-destructive/20 aria-invalid:border-destructive/60 dark:aria-invalid:border-destructive
        flex h-9 w-full min-w-0 rounded-md border bg-grey-700 px-3 py-1 text-base text-white
        file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium
        focus-visible:ring-1 focus-visible:outline-none focus-visible:ring-purple  disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50
        aria-invalid:focus-visible:ring-[1px] aria-invalid:focus-visible:outline-none md:text-sm dark:aria-invalid:focus-visible:ring-1`,e),...n})}export{O as a,x as c,k as i,b as l,j as n,D as o,A as r,T as s,M as t,_ as u};
//# sourceMappingURL=input-Kn9SJu2o.js.map