1import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{t}from"./react-C21x__mS.js";import{a as n}from"./react-intl-DlKP8ATg.js";import{t as r}from"./jsx-runtime-BdxMnOeJ.js";import{t as i}from"./classnames-CfLRLWYq.js";import{t as a}from"./a11y_live_region-DB4QMLtJ.js";import{t as o}from"./icon-BNrUFRb_.js";import{t as s}from"./check-C3BKu3lm.js";import{t as c}from"./info-k74D6gw-.js";import{t as l}from"./warning-DALvmvUf.js";import{t as u}from"./error-DN-cb0-U.js";var d={wrapper:`_comp_callout_inline__wrapper`,icon:`_comp_callout_inline__icon`},f=e(i()),p=r(),m={error:u,warning:l,info:c,success:s},h=({variant:e=`error`,message:t,className:n,children:r,...i})=>(0,p.jsxs)(`div`,{...i,className:(0,f.default)(n,d.wrapper),"data-variant":e,children:[(0,p.jsx)(o,{id:e,icon:m[e],className:d.icon}),t??r]}),g={fieldset:`_comp_form_fields_fieldset__fieldset`,fieldsWrapper:`_comp_form_fields_fieldset__fieldsWrapper`,status:`_comp_form_fields_fieldset__status`},_={wrapper:`_comp_form_fields_form_field_wrapper__wrapper`,labelWrapper:`_comp_form_fields_form_field_wrapper__labelWrapper`,label:`_comp_form_fields_form_field_wrapper__label`,hint:`_comp_form_fields_form_field_wrapper__hint`,status:`_comp_form_fields_form_field_wrapper__status`,inputWrapper:`_comp_form_fields_form_field_wrapper__inputWrapper`},v=e(t()),y=(0,v.createContext)(void 0),b=({legend:e,hint:t,name:n,status:r,layout:i,className:o,children:s})=>{let c=(0,v.useId)(),l=`${c}-label`,u=`${c}-hint`,d=`${c}-status`,m=n||`${c}-fieldset-name`,b=!!t,x=C(r),S=!!x?.message,w=[b?u:``,S?d:``].filter(e=>!!e).join(` `);return(0,p.jsxs)(`fieldset`,{className:(0,f.default)(g.fieldset,o),"data-has-error":r===`error`,"aria-labelledby":l,"aria-describedby":w,children:[(0,p.jsxs)(`div`,{className:_.labelWrapper,children:[(0,p.jsx)(`div`,{id:l,className:_.label,"data-label":!0,children:e}),b&&(0,p.jsx)(`p`,{id:u,className:_.hint,"data-hint":!0,children:t})]}),(0,p.jsx)(`div`,{className:g.fieldsWrapper,"data-layout":i,"data-fields":!0,children:(0,p.jsx)(y.Provider,{value:m,children:s})}),(0,p.jsx)(a,{className:g.status,id:d,children:S&&(0,p.jsx)(h,{...x})})]})},x=({inputId:e,label:t,hint:n,describedById:r,required:i,status:o,inputPlacement:s,children:c,className:l})=>{let u=(0,v.useId)(),d=e||`${u}-input`,m=`${e||u}-status`,g=`${e||u}-hint`,b=!!n,x=C(o),w=!!x?.message,T=!!(0,v.useContext)(y),E={required:i,id:d,"aria-describedby":[b?g:``,w?m:``,r].filter(e=>!!e).join(` `)||void 0},D=(0,p.jsx)(`div`,{className:_.inputWrapper,"data-input":!0,children:c(E)});return(0,p.jsxs)(`div`,{className:(0,f.default)(_.wrapper,l),"data-has-error":x?.variant===`error`,"data-input-placement":s,children:[s===`inline-start`&&D,(0,p.jsxs)(`div`,{className:_.labelWrapper,children:[(0,p.jsxs)(`label`,{htmlFor:d,className:_.label,"data-has-parent-fieldset":T,children:[t,i!==void 0&&(0,p.jsx)(S,{required:i})]}),b&&(0,p.jsx)(`span`,{className:_.hint,id:g,"data-hint":!0,children:n})]}),s!==`inline-start`&&D,(0,p.jsx)(a,{className:_.status,id:m,children:w&&(0,p.jsx)(h,{...x})})]})},S=({required:e})=>e?(0,p.jsxs)(p.Fragment,{children:[` `,(0,p.jsx)(`abbr`,{"aria-hidden":`true`,children:`*`})]}):(0,p.jsxs)(p.Fragment,{children:[` `,(0,p.jsx)(n,{id:`form_field.optional`,defaultMessage:`(optional)`})]});function C(e){return e?typeof e==`string`?{variant:e,message:``}:e:null}export{b as n,y as r,x as t}; 2//# sourceMappingURL=form_field_wrapper-B00MNsQd.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.