"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9370],{39370:(e,t,r)=>{r.r(t),r.d(t,{Form:()=>d,FormControl:()=>b,FormDescription:()=>F,FormField:()=>m,FormItem:()=>x,FormLabel:()=>p,FormMessage:()=>v,useFormField:()=>u});var a=r(53891),o=r(7349),n=r(73987),s=r(53459),l=r(91798),i=r(61971);let d=s.Op,c=n.createContext({}),m=e=>{let{...t}=e;return(0,a.jsx)(c.Provider,{value:{name:t.name},children:(0,a.jsx)(s.xI,{...t})})},u=()=>{let e=n.useContext(c),t=n.useContext(f),{getFieldState:r}=(0,s.xW)(),a=(0,s.lN)({name:e.name}),o=r(e.name,a);if(!e)throw Error("useFormField should be used within <FormField>");let{id:l}=t;return{id:l,name:e.name,formItemId:"".concat(l,"-form-item"),formDescriptionId:"".concat(l,"-form-item-description"),formMessageId:"".concat(l,"-form-item-message"),...o}},f=n.createContext({});function x(e){let{className:t,...r}=e,o=n.useId();return(0,a.jsx)(f.Provider,{value:{id:o},children:(0,a.jsx)("div",{"data-slot":"form-item",className:(0,i.cn)("grid gap-2",t),...r})})}function p(e){let{className:t,...r}=e,{error:o,formItemId:n}=u();return(0,a.jsx)(l.Label,{"data-slot":"form-label","data-error":!!o,className:(0,i.cn)("data-[error=true]:text-destructive",t),htmlFor:n,...r})}function b(e){let{...t}=e,{error:r,formItemId:n,formDescriptionId:s,formMessageId:l}=u();return(0,a.jsx)(o.DX,{"data-slot":"form-control",id:n,"aria-describedby":r?"".concat(s," ").concat(l):"".concat(s),"aria-invalid":!!r,...t})}function F(e){let{className:t,...r}=e,{formDescriptionId:o}=u();return(0,a.jsx)("p",{"data-slot":"form-description",id:o,className:(0,i.cn)("text-muted-foreground text-sm",t),...r})}function v(e){var t;let{className:r,...o}=e,{error:n,formMessageId:s}=u(),l=n?String(null!=(t=null==n?void 0:n.message)?t:""):o.children;return l?(0,a.jsx)("p",{"data-slot":"form-message",id:s,className:(0,i.cn)("text-destructive text-sm",r),...o,children:l}):null}},91798:(e,t,r)=>{r.r(t),r.d(t,{Label:()=>s});var a=r(53891),o=r(35913);r(73987);var n=r(61971);function s(e){let{className:t,...r}=e;return(0,a.jsx)(o.b,{"data-slot":"label",className:(0,n.cn)("flex select-none items-center gap-2 text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-50 group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50",t),...r})}}}]);