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