import{j as e}from"./vendor-mui-69397583.js";import{r as E}from"./vendor-react-ece1c85f.js";import{bs as g,b9 as x,d as p,bx as t,b8 as w,b5 as W,bu as f,bj as Z,by as H,bz as $}from"./index-c62ac197.js";const V=E.forwardRef((o,n)=>{const{asterisk:m,children:c,className:d,errorMessage:u,extra:i,htmlFor:b,invalid:a,label:r,labelClass:I,labelWidth:L,layout:j,style:h,size:v}=o,s=g(),{controlSize:F}=x(),y=v||(s==null?void 0:s.size)||F,S=L||(s==null?void 0:s.labelWidth),l=j||(s==null?void 0:s.layout),O=()=>{switch(l){case t.HORIZONTAL:return r?`h-${f[y]} ${r&&"ltr:pr-2 rtl:pl-2"}`:"ltr:pr-2 rtl:pl-2";case t.VERTICAL:return"mb-2";case t.INLINE:return`h-${f[y]} ${r&&"ltr:pr-2 rtl:pl-2"}`}},T=p("form-item",l,d,a?"invalid":""),C=p("form-label",r&&O(),I),R=()=>l===t.HORIZONTAL?{...h,minWidth:S}:{...h},z={opacity:1,marginTop:3,bottom:-30},N={opacity:0,marginTop:-10},A=N;return e.jsxs("div",{ref:n,className:T,children:[e.jsxs("label",{htmlFor:b,className:C,style:R(),children:[m&&e.jsx("span",{className:"text-red-500 ltr:mr-1 rtl:ml-1",children:"*"}),r,i&&e.jsx("span",{children:i}),r&&l!=="vertical"&&":"]}),e.jsxs("div",{className:l===t.HORIZONTAL?"w-full flex flex-col justify-center relative":"",children:[c,e.jsx(w,{mode:"wait",children:a&&e.jsx(W.div,{className:"form-explain",initial:A,animate:z,exit:N,transition:{duration:.15,type:"tween"},children:u})})]})]})});V.displayName="FormItem";const M=o=>{const{controlSize:n}=x(),{children:m,className:c,labelWidth:d=100,layout:u=t.VERTICAL,size:i=Z.MD}=o,b={labelWidth:d,layout:u,size:i||n};return e.jsx(H,{value:b,children:e.jsx($,{children:a=>e.jsx("div",{className:p("form-container",a==null?void 0:a.layout,c),children:m})})})};M.displayName="FormContainer";export{M as F,V as a};
