1import{j as e}from"./jsx-runtime-BgjmLhhW.js";import{$}from"./FaIcon-DTQallQy-Cfu02mpc.js";import{e as _}from"./iconsColorConfig-DWXmO4aY-DCRMUg93.js";import{r as N,I as D,m as U}from"./InputError-B3TMA7Mz-DwMIfmgR.js";import{r as b}from"./index-BqkNX_XC.js";import{D as I}from"./kebabCase-DK42R4vw-DoqIWWa7.js";const k=({isValid:o,isDisabled:t,marketingServiceUrl:l})=>!o||t?null:e.jsx($,{iconId:"circle-check",className:"oneds-validated",color:_.success,marketingServiceUrl:l}),y=({children:o,labelText:t,labelOptionalText:l,requiredIndication:i,id:s,helperText:c,helperTextPositionTop:x=!1,errorText:d,isDisabled:r,className:h,isValid:u,legend:p=!1,marketingServiceUrl:n})=>{const v=["input-layout","layout-default",h,r?"disabled":d?"error":u?"validated":"",x?"oneds-helper-text-top":""].join(" ");return e.jsxs("div",{className:v,children:[p?e.jsx("legend",{children:e.jsx(N,{text:t,optionalText:l,requiredIndication:i,htmlFor:`${s}`,"aria-describedby":`${s}-helper-text`})}):e.jsx(N,{text:t,optionalText:l,requiredIndication:i,htmlFor:`${s}`}),e.jsxs("div",{className:"oneds-input-wrapper",children:[o,e.jsx(k,{isValid:u,isDisabled:r,marketingServiceUrl:n}),d&&e.jsx(D,{id:`${s}-error`,text:d,isDisabled:r,marketingServiceUrl:n})]}),e.jsx("div",{className:"oneds-default-layout-helper-text",children:e.jsx(U,{text:c,id:`${s}-helper-text`})})]})},q=({id:o,name:t,value:l="",placeholder:i,options:s=[],isDisabled:c=!1,hasError:x=!1,marketingServiceUrl:d,inputRef:r,selectProps:h,onChange:u=()=>{},onBlur:p=()=>{}})=>{const n=b.useRef(null),v=r??n,[f,a]=b.useState(!1),[S,j]=b.useState(!1),T=!l&&!!i,g=!f&&!S?"":" darker";return e.jsxs("div",{className:`select-field${x?" select-field--error":""}`,children:[e.jsxs("select",{ref:v,id:o,name:t,value:l,onChange:m=>{u(m.target.value)},className:`select-field__input oneds-body-m-compact${T?" select-field__input--placeholder":""}`,disabled:c,onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),onFocus:()=>j(!0),onBlur:()=>{j(!1),p()},...h,children:[i&&e.jsx("option",{className:"select-field__placeholder",value:"",disabled:!0,children:i}),!i&&e.jsx("option",{className:"select-field__empty",value:"",disabled:!0}),s.map(m=>e.jsx("option",{value:m.value,disabled:m.isDisabled,children:m.label},m.value))]}),e.jsx("div",{className:"select-field__icon-container",children:e.jsx($,{iconId:"chevron-down",className:`select-field__chevron${g}`,colorVariable:g?"--oneds-icon-default":"--oneds-icon-subtle",marketingServiceUrl:d})})]})},M=({id:o,name:t,requiredIndication:l,isDisabled:i=!1,isValid:s=!1,label:c,optionalLabel:x,helper:d,errorMessage:r,placeholder:h,options:u=[],value:p="",marketingServiceUrl:n,onChange:v=()=>{},onBlur:f=()=>{}})=>{const a=o||`oneds-input-${I(c)}`;return e.jsx("div",{className:"oneds-input-container",id:`${a}-container`,children:e.jsx(y,{id:a,labelOptionalText:x,helperText:d,labelText:c,errorText:r,requiredIndication:l,isDisabled:i,className:"select",marketingServiceUrl:n,children:e.jsxs("div",{className:"select-input-field",children:[e.jsx(q,{id:`${a}-input`,name:t,value:p,placeholder:h,options:u,isDisabled:i,hasError:!!r,marketingServiceUrl:n,selectProps:{"aria-required":l==="asterisk","aria-invalid":!!r,"aria-describedby":r?`${a}-error ${a}-helper-text`:`${a}-helper-text`},onChange:v,onBlur:f}),!i&&e.jsx(k,{isValid:!!p&&s,marketingServiceUrl:n})]})})})};export{M as C,y as L,k as m};
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.