import{template as e,RenderIf as s,isLocalEnv as o,baseAssetURL as r}from"@gem-sdk/core";import{getDynamicSourceLocales as t,createSettingId as d,getSettingPreloadData as p}from"../../../helpers.js";import{createStyle as l,createClass as i,If as m}from"@gem-sdk/system";import{composeContainerStyles as a,getAppendTypoStyleFirstTime as n,composeFormDropdownStyles as c,getStyleOption as f}from"./common/styles.js";import{composeContainerClasses as $,composeFormDropdownClasses as g}from"./common/classes.js";import{FormDropdown as u}from"../../settings/form-dropdown/configs/translate.js";let y=({builderProps:y,setting:j,advanced:v,pageContext:w,styles:S})=>{let{name:h,childItem:N,required:O}=j??{},b=N?.map((e,s)=>t({val:e,uid:y?.uid,settingId:d({id:u?.childItem?.id,index:s}),pageContext:w??{}})),k=l(a(v,j)),E=l({...c(v,j,S),...n(j)}),A=l(f(j)),I=i($(v,y)),x=i(g(j));return e`
    <gp-form-dropdown
      data-id="${y?.uid}"
      class="${I}"
      style="${k}"
    >
      <select
        type="email"
        class="${x}"
        style="${E}"
        ${m(O,"required")}
        name="${h}"
        gp-data='${JSON.stringify(j).replaceAll("'","&#039;")}'
      >
        ${m(!Number(j?.defaultOption),`<option class="gp-hidden" value="" disabled selected>
            ${j?.placeholder}
          </option>`)}
        ${b?.map(s=>e`
            <option
              value="${s}"
              style="${A}"
              ${m(!!Number(j?.defaultOption),`selected: ${s===b[Number(j?.defaultOption)-1]}`)}
            >
              ${s}
            </option>`).join("")}
      </select>
    </gp-form-dropdown>
    ${s(o,`<script ${p('class="gps-link" delay',"src")}="{{ 'gp-form-dropdown-v7-5.js' | asset_url }}" defer="defer"></script>`,`<script ${p('class="gps-link" delay',"src")}="${r}/assets-v2/gp-form-dropdown-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
  `};export{y as default};
