"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),ProductPropertyChoice_liquid=require("./property-choice/ProductPropertyChoice.liquid.js"),ProductPropertyInput_liquid=require("./property-input/ProductPropertyInput.liquid.js"),ProductPropertySelect_liquid=require("./property-select/ProductPropertySelect.liquid.js"),helpers$1=require("../../../helpers.js"),system=require("@gem-sdk/system"),helpers=require("./common/helpers.js"),attrs=require("./common/attrs.js"),styles=require("./common/styles.js"),classes=require("./common/classes.js");const ProductProperties=({setting:e,styles:s,builderProps:t,advanced:r,pageContext:l})=>{let{name:a,type:o,childItem:p}=e??{},{isDisplayLabel:c=!0}=s??{};e&&!a&&(e.name="Property");let d=t?.uid,{displayLabel:i}=helpers.getContents({uniqId:d,pageContext:l??{},setting:e}),u=system.createAttr({...attrs.getWrapperLiquidAttrs({uniqId:d,pageContext:l??{},setting:e})}),y=system.createStyle({...styles.getWrapperStyles(s)}),n=system.createStyle({...styles.getLabelStyles(s)}),g=system.createClass({...classes.getLabelClasses(s)}),m=system.createClass({...classes.getLiquidTagClasses(e)}),C=system.createClass({...classes.getLabelWrapperClasses(r)}),P=system.createStyle({...styles.getLabelContentStyles()}),$=helpers.getLabelContent(e),h=system.createClass({...classes.getWrapperErrorMessageClasses(),...core.composeClasses("data-[hidden=true]:gp-hidden")}),q=system.createStyle({...styles.getWrapperErrorMessageStyles(s)}),v=system.createAttr({...attrs.getWrapperErrorMessageAttrs()});return core.template`
    <gp-product-property ${{...u}} class="${m}"
      style="${y}"
    >
      ${core.RenderIf(c,core.template`<div class="${C}">
        <label htmlFor="${d}-${a}" class="${g}" style="${n}">
          ${i}
          <span style="${P}">${$}</span>
        </label>
      </div>`)}

      <div>
        ${core.RenderIf("dropdown"===o,ProductPropertySelect_liquid.default({setting:e,styles:s,builderProps:t,pageContext:l}))}
        ${core.RenderIf("checkbox"===o||"radio"===o,ProductPropertyChoice_liquid.default({setting:{...e,childItem:p,name:a},styles:s,builderProps:t,pageContext:l}))}
        ${core.RenderIf("text"===o||"textarea"===o||"email"===o||"hidden"===o,ProductPropertyInput_liquid.default({setting:e,styles:s,builderProps:t,pageContext:l}))}
        <div
          ${{...v}}
          class="${h}"
          style="${q}"
        >
          <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>
    ${core.RenderIf(core.isLocalEnv,`<script ${helpers$1.getSettingPreloadData('class="gps-link" delay',"src")}="{{ 'gp-product-property-v7-5.js' | asset_url }}" defer="defer"></script>`,`<script ${helpers$1.getSettingPreloadData('class="gps-link" delay',"src")}="${core.baseAssetURL}/assets-v2/gp-product-property-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}`};exports.default=ProductProperties;
