'use client';
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core");const Select=({builderProps:e,setting:t={},className:r,style:s})=>{let{options:l="",arrow:a=!0,disabled:n=!1,iconSvg:p}=t,i=`<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="chevron-down" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">
              <path d="M207.029 381.476L12.686 187.132c-9.373-9.373-9.373-24.569 0-33.941l22.667-22.667c9.357-9.357 24.522-9.375 33.901-.04L224 284.505l154.745-154.021c9.379-9.335 24.544-9.317 33.901.04l22.667 22.667c9.373 9.373 9.373 24.569 0 33.941L240.971 381.476c-9.373 9.372-24.569 9.372-33.942 0z"></path>
            </svg>`;p&&(i=p);let c=e=>{let t=[];try{t=JSON.parse(e)}catch(e){}if(t.length)return t.map((e,t)=>{let r=e?.content||"",s=e?.value||"",l=e?.disabled||!1;return jsxRuntime.jsx("option",{value:s,disabled:l,children:r},t)})};return jsxRuntime.jsxs("div",{"data-id":e?.uid,className:core.cls("gp-relative",r),"data-testid":"select",children:[jsxRuntime.jsx("select",{style:s,disabled:n,className:core.cls(r,"gp-w-full gp-appearance-none gp-rounded-[3px] gp-border gp-border-solid gp-border-[#e2e8f0] gp-px-4 gp-py-2 gp-outline-0",{"gp-cursor-pointer":!n,"gp-cursor-not-allowed":n}),children:c(l)}),a&&jsxRuntime.jsx("span",{"aria-hidden":"true",className:"gp-pointer-events-none gp-absolute gp-right-[6px] gp-top-[calc(50%_-_0.5em)] gp-inline-flex gp-h-4 gp-w-4",dangerouslySetInnerHTML:{__html:i}})]})};exports.default=Select;
