import{composeClasses as r,template as e}from"@gem-sdk/core";import{getDynamicSourceLocales as t,createSettingId as o}from"../../../../helpers.js";import{createClass as m,createStyle as s,createAttr as p}from"@gem-sdk/system";import{getClasses as a}from"./common/classes.js";import{getStyles as i}from"./common/styles.js";import{getElementContent as n}from"./common/helpers.js";import{getInputAttrs as u}from"./common/attrs.js";import{ProductProperties as d}from"../../../settings/product-properties/configs/translate.js";let ProductPropertyInput=({setting:l,styles:$,builderProps:c,pageContext:f,attributes:g})=>{let{name:h,type:b,placeholder:x,required:j,minChar:y,maxChar:N,label:P}=l??{minChar:Number,maxChar:Number,minNumber:Number,maxNumber:Number},v="textarea"===b?"textarea":"input",C=t({val:x,uid:c?.uid,settingId:o({id:d?.placeholder?.id}),pageContext:f??{}}),I=`${C}${x&&j&&!P?" *":""}`,k=m({...a($),...r("gp-shadow-none group-data-[invalid=true]:gp-border-[#F44336]")}),_=s({...i($)}),{elementValue:q}=n(l),w=p({...u(g)});return e`
    <${v}
      ${{...w}}
      type="${b}"
      placeholder="${I}"
      name="properties[${h}]"
      form="{{ product_form_id }}"
      value="${q}"
      class="${k}"
      style="${_}"
      ${j?`required="${j}"`:""}
      minlength="${y}"
      maxlength="${N}"
    ></${v}>
    `};export{ProductPropertyInput as default};
