'use client';
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),system=require("@gem-sdk/system"),styles=require("./common/styles.js"),classes=require("./common/classes.js"),useGetColorContent=require("../../hooks/useGetColorContent.js");const FormDropdown=({builderProps:e,builderAttrs:s,setting:t,advanced:o,children:l,styles:r})=>{let{name:n,childItem:a,required:m}=t??{},{handleOnChange:i,getTextColor:c}=useGetColorContent.useGetColorContent(t),u=system.createStyle(styles.composeContainerStyles(o,t)),d=system.createStyle({...styles.composeFormDropdownStyles(o,t,r),...c}),y=system.createStyle(styles.getStyleOption(t)),p=system.createClass(classes.composeContainerClasses(o,e)),C=system.createClass(classes.composeFormDropdownClasses(t));return jsxRuntime.jsxs("div",{...s,"data-id":e?.uid,className:p,style:u,children:[jsxRuntime.jsxs("select",{className:C,style:d,required:m,name:n,onChange:i,children:[system.If(!Number(t?.defaultOption),jsxRuntime.jsx("option",{className:"gp-hidden",value:"",disabled:!0,selected:!0,children:t?.placeholder})),a?.map((e,s)=>jsxRuntime.jsx("option",{value:e,style:y,...!!Number(t?.defaultOption)&&{selected:e===a[Number(t?.defaultOption)-1]},children:e},s))]}),l]})};exports.default=FormDropdown;
