'use client';
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),getProductPropertiesChoiceClasses=require("./common/getProductPropertiesChoiceClasses.js"),getProductPropertiesChoiceStyles=require("./common/getProductPropertiesChoiceStyles.js"),getProductPropertiesChoiceInlineCss=require("./common/getProductPropertiesChoiceInlineCss.js"),system=require("@gem-sdk/system");const ProductPropertyChoice=({setting:e,styles:s,defaultName:t,currentProductId:r})=>{let o=core.useUniqProductID(),{name:i,type:c,handleChange:l,childItem:P}=e??{},{valueTextColor:C}=s??{},a=`${(i||t)??""}-${r}`,u=getProductPropertiesChoiceInlineCss.getPPCInlineStyleChoice(t,C),n=system.createClass({...getProductPropertiesChoiceClasses.getPPCWrapperClasses()}),y=system.createClass({...getProductPropertiesChoiceClasses.getPPCLabelClasses(s)}),m=system.createStyle({...getProductPropertiesChoiceStyles.getPPCWrapperStyles(s)}),d=system.createClass({...getProductPropertiesChoiceClasses.getPPCWrapperClassesMain()}),p=system.createStyle({...getProductPropertiesChoiceStyles.getPPCContainerStyles(s)}),g=system.createStyle({...getProductPropertiesChoiceStyles.getPPCLabelStyles(s)}),h=system.createStyle({...getProductPropertiesChoiceStyles.getPPCInputStyles(s)});return jsxRuntime.jsxs("div",{style:m,className:d,children:[jsxRuntime.jsx("style",{children:u}),P?.map((e,s)=>jsxRuntime.jsxs("div",{style:p,className:n,children:[jsxRuntime.jsx("input",{type:c,id:`${o}-${a}-${s}`,name:a,value:e,style:h,onChange:l}),jsxRuntime.jsx("label",{htmlFor:`${o}-${a}-${s}`,className:y,style:g,children:e})]},s))]})};exports.default=ProductPropertyChoice;
