'use client';
import{jsxs as e,jsx as o}from"react/jsx-runtime";import{createStyle as t,createClass as r,If as s}from"@gem-sdk/system";import{composeContainerStyles as l,composeFormDropdownStyles as m,getStyleOption as d}from"./common/styles.js";import{composeContainerClasses as a,composeFormDropdownClasses as i}from"./common/classes.js";import{useGetColorContent as n}from"../../hooks/useGetColorContent.js";let FormDropdown=({builderProps:p,builderAttrs:c,setting:u,advanced:f,children:h,styles:N})=>{let{name:y,childItem:b,required:j}=u??{},{handleOnChange:g,getTextColor:v}=n(u),C=t(l(f,u)),O=t({...m(f,u,N),...v}),k=t(d(u)),w=r(a(f,p)),x=r(i(u));return e("div",{...c,"data-id":p?.uid,className:w,style:C,children:[e("select",{className:x,style:O,required:j,name:y,onChange:g,children:[s(!Number(u?.defaultOption),o("option",{className:"gp-hidden",value:"",disabled:!0,selected:!0,children:u?.placeholder})),b?.map((e,t)=>o("option",{value:e,style:k,...!!Number(u?.defaultOption)&&{selected:e===b[Number(u?.defaultOption)-1]},children:e},t))]}),h]})};export{FormDropdown as default};
