import{composeClasses as e,RenderIf as r,template as t,isLocalEnv as o,baseAssetURL as s}from"@gem-sdk/core";import p from"./property-choice/ProductPropertyChoice.liquid.js";import l from"./property-input/ProductPropertyInput.liquid.js";import i from"./property-select/ProductPropertySelect.liquid.js";import{getSettingPreloadData as d}from"../../../helpers.js";import{createAttr as c,createStyle as m,createClass as a}from"@gem-sdk/system";import{getContents as n,getLabelContent as u}from"./common/helpers.js";import{getWrapperLiquidAttrs as $,getWrapperErrorMessageAttrs as y}from"./common/attrs.js";import{getWrapperStyles as f,getLabelStyles as g,getLabelContentStyles as C,getWrapperErrorMessageStyles as h}from"./common/styles.js";import{getLabelClasses as v,getLiquidTagClasses as j,getLabelWrapperClasses as P,getWrapperErrorMessageClasses as x}from"./common/classes.js";let w=({setting:w,styles:S,builderProps:k,advanced:E,pageContext:M})=>{let{name:b,type:q,childItem:V}=w??{},{isDisplayLabel:Z=!0}=S??{};w&&!b&&(w.name="Property");let A=k?.uid,{displayLabel:G}=n({uniqId:A,pageContext:M??{},setting:w}),I=c({...$({uniqId:A,pageContext:M??{},setting:w})}),_=m({...f(S)}),B=m({...g(S)}),F=a({...v(S)}),N=a({...j(w)}),O=a({...P(E)}),R=m({...C()}),T=u(w),z=a({...x(),...e("data-[hidden=true]:gp-hidden")}),D=m({...h(S)}),H=c({...y()});return t`
    <gp-product-property ${{...I}} class="${N}"
      style="${_}"
    >
      ${r(Z,t`<div class="${O}">
        <label htmlFor="${A}-${b}" class="${F}" style="${B}">
          ${G}
          <span style="${R}">${T}</span>
        </label>
      </div>`)}

      <div>
        ${r("dropdown"===q,i({setting:w,styles:S,builderProps:k,pageContext:M}))}
        ${r("checkbox"===q||"radio"===q,p({setting:{...w,childItem:V,name:b},styles:S,builderProps:k,pageContext:M}))}
        ${r("text"===q||"textarea"===q||"email"===q||"hidden"===q,l({setting:w,styles:S,builderProps:k,pageContext:M}))}
        <div
          ${{...H}}
          class="${z}"
          style="${D}"
        >
          <svg
            width="16"
            height="16"
            viewBox="0 0 16 16"
            fill="currentColor"
            xmlns="http://www.w3.org/2000/svg"
          >
            <path
              fill-rule="evenodd"
              clip-rule="evenodd"
              d="M15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1C11.866 1 15 4.13401 15 8ZM8 10.5C7.58579 10.5 7.25 10.8358 7.25 11.25C7.25 11.6642 7.58579 12 8 12C8.41421 12 8.75 11.6642 8.75 11.25C8.75 10.8358 8.41421 10.5 8 10.5ZM8.5 4C8.5 3.72386 8.27614 3.5 8 3.5C7.72386 3.5 7.5 3.72386 7.5 4V9C7.5 9.27614 7.72386 9.5 8 9.5C8.27614 9.5 8.5 9.27614 8.5 9V4Z"
              fill="currentColor"
            ></path>
          </svg>
          <span data-slot-type="message-content" class="gp-pl-1"></span>
        </div>
      </div>
    </gp-product-property>
    ${r(o,`<script ${d('class="gps-link" delay',"src")}="{{ 'gp-product-property-v7-5.js' | asset_url }}" defer="defer"></script>`,`<script ${d('class="gps-link" delay',"src")}="${s}/assets-v2/gp-product-property-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}`};export{w as default};
