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,CAmBQ,0BAAA1H,GACN,IAAK3D,KAAKwD,SAAWxD,KAAKwD,QAAQT,cAAcmH,OAAS,EACvD,OAGF,MAAMoB,EAAiBtL,KAAKwD,QAAQT,cAAc,GAAGpB,KAC/C4J,EAAkBvL,KAAKF,gBAAgBwL,GAOvC9G,EAAWxE,KAAKwD,QAAQgB,SAC3BgH,OAAO9G,GAAWA,EAAQuE,UAAYsC,GACzC,IAAK,MAAM7G,KAAWF,EAAU,CAC9B,MAAM0E,EAAUxE,EAAQwE,QAClBuC,EAAQzL,KAAKkB,WAAWC,cAC5B,wDAAwD+H,aAErDuC,IAID/G,EAAQqF,UACV0B,EAAMpC,UAAUqC,OAAO,gBAEvBD,EAAMpC,UAAUC,IAAI,gBAExB,CACF,EAQF,SAASI,EAAa7G,GACpB,OAAOA,EAAO2B,SAASmH,MAAMjH,IAAYA,EAAQqF,UACnD,CAEA,SAAStB,EAAeI,GACtB,OAAOA,EAAM+C,QAAQ,MAAO,IAC9B,CA0UKC,eAAeC,IAAI,mCACtBD,eAAeE,OAAO,iCAAkCpM","sources":["webpack://lange/webpack/bootstrap","webpack://lange/webpack/runtime/jsonp chunk loading","webpack://lange/./sections/product-variant-selector-modal/product-variant-selector-modal/index.html","webpack://lange/./sections/product-variant-selector-modal/product-variant-selector-modal/index.ts"],"sourcesContent":["// The module cache\nlet __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tlet cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tlet module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","__webpack_require__.b = (typeof document !== 'undefined' && document.baseURI) || self.location.href;\n\n// no installed chunks\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n// no on chunks loaded\n\n// no jsonp function","// Imports\nvar ___HTML_LOADER_IMPORT_0___ = new URL(\"data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\", import.meta.url);\n// Module\nvar code = \"<div style=\\\"display: flex; flex-direction: column;\\\"><close-button style=\\\"position: absolute;\\\"></close-button><img width=\\\"320\\\" height=\\\"400\\\" src=\\\"\" + ___HTML_LOADER_IMPORT_0___ + \"\\\" alt=\\\"\\\" style=\\\"display: block; aspect-ratio: 4/5; max-width: 320px; width: 90%; margin: 0 auto 12px; object-fit: contain;\\\"><header style=\\\"margin-bottom: 12px;\\\"><h2 class=\\\"title\\\" style=\\\"font-weight: 700; font-size: 1.5rem; line-height: 1.4; margin: 0;\\\"></h2><p class=\\\"subtitle\\\" style=\\\"font-size: 1.125rem; line-height: 1.5; margin: 0;\\\"></p></header><div style=\\\"margin-bottom: 12px;\\\"><product-rating-stars data-average=\\\"\\\" data-count=\\\"\\\"></product-rating-stars></div><div class=\\\"variant-options\\\" hidden style=\\\"margin-bottom: 12px;\\\"></div><div class=\\\"backorder\\\" hidden style=\\\"color: #616161; font-size: 0.875rem; font-weight: 400; line-height: 1.5; margin-bottom: 12px;\\\"></div><div class=\\\"pricing\\\" style=\\\"margin-bottom: 12px;\\\"></div><div class=\\\"message\\\" style=\\\"color: #C12E6F; font-weight: 400; line-height: 1.5; text-align: left; margin-bottom: 12px;\\\"></div></div><div style=\\\"display: flex; flex-direction: column; gap: 8px;\\\"><div class=\\\"primary-action\\\"></div><div class=\\\"product-link\\\" style=\\\"display: flex; justify-content: center;\\\"></div></div>\";\n// Exports\nexport default code;","import type { CustomElement } from '@integrabeauty/custom-elements';\nimport html from './index.html';\nimport styles from './index.scss';\n\n/**\n * Renders product variant selector modal used by collection, slideshow and search results product\n * cards to allow customers to select variant options without navigation to the PDP.\n *\n * The modal shows and hides itself off `data-modal-state`. For now it sets that attribute itself\n * when it opens and closes. Later the modal manager sets it instead.\n */\nclass ProductVariantSelectorModal extends HTMLElement implements CustomElement {\n  public static get observedAttributes() {\n    return ['data-modal-state'];\n  }\n\n  declare readonly dataset: {\n    /**\n     * Currency ISO code. Required.\n     *\n     * @example \"US\"\n     */\n    currencyCode: string;\n\n    /**\n     * Currency Symbol. Required.\n     *\n     * @example \"$\"\n     */\n    currencySymbol: string;\n\n    /**\n     * Email of currently signed in customer.\n     */\n    customerEmail: string;\n\n    /**\n     * Feature flag to enable or disable discount modal, a string representing a boolean value. If\n     * the feature is enabled, we shouldn't show the discount message.\n     */\n    enableDiscountModal: 'false' | 'true';\n\n    /**\n     * Whether the modal is shown, as \"open\". Anything else, or no value at all, means closed.\n     *\n     * A change only takes effect while the element is on the page. A change made while it is\n     * detached is ignored, and connecting it later does not pick it up. Markup that arrives with\n     * the attribute already set still works.\n     */\n    modalState: string;\n  };\n\n  private declare product: Partial<Product>;\n  private declare selectedVariantId: number;\n  private declare country: string;\n  private selectedOptions: Record<string, string> = {};\n\n  private onSelectOptionRequestedBound = this.onSelectOptionRequested.bind(this);\n  private onProductVariantOptionChangedBound = this.onProductVariantOptionChanged.bind(this);\n  private onModalDismissRequestedBound = this.onModalDismissRequested.bind(this);\n  private onCartOpenRequestedBound = this.onCartOpenRequested.bind(this);\n  private onNotifyMeClickedBound = this.onNotifyMeClicked.bind(this);\n  private onCompareAtPriceModalRequestedBound = this.onCompareAtPriceModalRequested.bind(this);\n  private onCloseButtonClickedBound = this.onCloseButtonClicked.bind(this);\n\n  public connectedCallback() {\n    this.initializeShadowRoot();\n\n    const closeButton = this.shadowRoot.querySelector('close-button');\n    closeButton?.addEventListener('click', this.onCloseButtonClickedBound);\n\n    this.addEventListener('cart-open-requested', this.onCartOpenRequestedBound);\n    addEventListener('select-option-requested', this.onSelectOptionRequestedBound);\n    addEventListener('modal-dismiss-requested', this.onModalDismissRequestedBound);\n    addEventListener('notify-me-clicked', this.onNotifyMeClickedBound);\n    addEventListener('compare-at-price-modal-requested', this.onCompareAtPriceModalRequestedBound);\n    addEventListener('product-variant-option-changed', this.onProductVariantOptionChangedBound);\n  }\n\n  public disconnectedCallback() {\n    removeEventListener('select-option-requested', this.onSelectOptionRequestedBound);\n    removeEventListener('modal-dismiss-requested', this.onModalDismissRequestedBound);\n    this.removeEventListener('cart-open-requested', this.onCartOpenRequestedBound);\n    removeEventListener('notify-me-clicked', this.onNotifyMeClickedBound);\n    removeEventListener('compare-at-price-modal-requested',\n      this.onCompareAtPriceModalRequestedBound);\n    removeEventListener('product-variant-option-changed', this.onProductVariantOptionChangedBound);\n\n    const closeButton = this.shadowRoot.querySelector('close-button');\n    closeButton?.removeEventListener('click', this.onCloseButtonClickedBound);\n  }\n\n  private initializeShadowRoot() {\n    if (!this.shadowRoot) {\n      this.attachShadow({ mode: 'open' });\n      this.shadowRoot.innerHTML = `<style>${styles}</style>${html}`;\n    }\n  }\n\n  public attributeChangedCallback(name: string, oldValue: string, newValue: string) {\n    this.initializeShadowRoot();\n\n    if (this.isConnected && name === 'data-modal-state' && oldValue !== newValue) {\n      if (newValue === 'open') {\n        this.show();\n      } else if (oldValue === 'open') {\n        this.hide();\n      }\n    }\n  }\n\n  private showModal() {\n    this.dataset.modalState = 'open';\n  }\n\n  private show() {\n    // Reveal the modal. The markup renders it with the hidden attribute so it stays hidden before\n    // this element upgrades.\n    this.hidden = false;\n\n    const event = new Event('modal-open-requested', { bubbles: true, composed: true });\n    this.dispatchEvent(event);\n  }\n\n  private closeModal() {\n    // Do nothing when already closed. The handlers that call this react to page-wide broadcasts\n    // heard by every modal, so without this guard a closed modal would tear down the shared\n    // backdrop out from under whichever modal is actually open.\n    if (this.hidden) {\n      return;\n    }\n\n    this.dataset.modalState = 'closed';\n  }\n\n  private hide() {\n    const event = new Event('modal-close-requested', { bubbles: true, composed: true });\n    this.dispatchEvent(event);\n\n    const productImageEl = this.shadowRoot.querySelector<HTMLImageElement>('img');\n    // set to a 1x1px gif to avoid flashing previous image when modal is opened again\n    productImageEl.src =\n      'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==';\n\n    // Re-hide the modal via the global hidden attribute css rule.\n    this.hidden = true;\n  }\n\n  /**\n   * Close the modal when the backdrop has been clicked.\n   */\n  private onModalDismissRequested(_event: WindowEventMap['modal-dismiss-requested']) {\n    this.closeModal();\n  }\n\n  /**\n   * Close the modal when its add to cart button asks the cart drawer to open, which happens at\n   * click time, before the add finishes. The request bubbles up through this element before it\n   * reaches the window, where the drawer control listens, so the modal closes before the drawer\n   * opens. Closing after it would have the modal manager tear down the backdrop, the inert\n   * background, and the scroll lock out from under the open drawer.\n   */\n  private onCartOpenRequested(_event: GlobalEventHandlersEventMap['cart-open-requested']) {\n    this.closeModal();\n  }\n\n  /**\n   * Close the modal when the notify me button on the product card has been clicked, making way for\n   * the notify me modal.\n   */\n  private onNotifyMeClicked(_event: WindowEventMap['notify-me-clicked']) {\n    this.closeModal();\n  }\n\n  /**\n   * Close the modal when the user clicked to view the compare at price modal on the product card,\n   * making way for it.\n   */\n  private onCompareAtPriceModalRequested(\n    _event: WindowEventMap['compare-at-price-modal-requested']) {\n    this.closeModal();\n  }\n\n  private onCloseButtonClicked(_event: MouseEvent) {\n    this.closeModal();\n  }\n\n  private onProductVariantOptionChanged(event: WindowEventMap['product-variant-option-changed']) {\n    // Option changes are broadcast page-wide by every variant picker. Re-render only when this\n    // modal is open, otherwise a closed modal would react to a selection made elsewhere on the\n    // page.\n    if (this.hidden) {\n      return;\n    }\n\n    for (const option of event.detail.option_groups || []) {\n      this.selectedOptions[option.name] = option.selected_option;\n    }\n\n    this.selectedVariantId = event.detail.selected_variant_id;\n\n    this.renderProductImage();\n    this.renderBackorderMessage();\n    this.renderMessage();\n  }\n\n  private onSelectOptionRequested(event: WindowEventMap['select-option-requested']) {\n    // Careful with this assignment. These are two different product interface types that happen to\n    // be compatible because of careful design of the properties that happen to be in common. The\n    // type of event product is different than the type of the product property. This would be\n    // avoided if we used a shared type, but we cannot use a shared type because of the implicit\n    // rule that modules must be isolated and independent.\n    this.product = event.detail?.product;\n\n    this.selectedVariantId = this.product.selected_variant_id;\n    this.country = event.detail?.country;\n    this.selectedOptions = {};\n\n    for (const option of this.product.option_groups) {\n      this.selectedOptions[option.name] = option.selected_option;\n    }\n\n    this.render();\n    this.setOOSForSecondOptionGroup();\n\n    // The price and add to cart elements we just rendered wait for a zero delay timeout before they\n    // render their own content. If we show the modal right away, the browser can paint it before\n    // they fill in, and then the modal grows and its top jumps up, since it is centered. Timeouts\n    // with the same delay run in the order they were queued, so waiting on one of our own here\n    // means we show the modal only after theirs have run.\n    //\n    // This leaves a short window where the modal is rendered but still hidden. A close request in\n    // that window is ignored, because closing does nothing while the modal is hidden, and then the\n    // modal opens anyway once our timeout fires.\n    setTimeout(() => {\n      this.showModal();\n\n      const closeButton = this.shadowRoot.querySelector('close-button');\n      closeButton.focus({ focusVisible: true });\n    }, 0);\n  }\n\n  private render() {\n    if (!this.product?.title) {\n      return;\n    }\n\n    this.renderTitle();\n    this.renderVariantOptions();\n    this.renderBackorderMessage();\n    this.renderProductImage();\n    this.renderPricing();\n    this.renderMessage();\n    this.renderPrimaryAction();\n    this.renderProductLink();\n  }\n\n  private renderProductImage() {\n    const productImageEl = this.shadowRoot.querySelector<HTMLImageElement>('img');\n\n    const selectedVariant = this.product.variants.find(\n      variant => variant.id === this.selectedVariantId);\n\n    if (selectedVariant) {\n      productImageEl.src = selectedVariant.image_src || this.product.main_image;\n    } else {\n      productImageEl.src = this.product.main_image;\n    }\n  }\n\n  private renderTitle() {\n    const titleEl = this.shadowRoot.querySelector<HTMLElement>('.title');\n    titleEl.innerText = this.product.title;\n\n    const subtitleEl = this.shadowRoot.querySelector<HTMLElement>('.subtitle');\n    subtitleEl.innerText = this.product.metafields_subtitle || '';\n\n    const ratingEl = this.shadowRoot.querySelector('product-rating-stars');\n    ratingEl.dataset.average = this.product.reviews_average?.toString() || '0';\n    ratingEl.dataset.count = this.product.reviews_count?.toString() || '0';\n  }\n\n  private renderPricing() {\n    const pricingEl = this.shadowRoot.querySelector('.pricing');\n    if (pricingEl) {\n      pricingEl.innerHTML = '';\n    }\n\n    const priceElement = document.createElement('product-price');\n    priceElement.dataset.currencyCode = this.dataset.currencyCode;\n    priceElement.dataset.currencySymbol = this.dataset.currencySymbol;\n\n    let selectedVariant = this.product.variants.find(variant =>\n      variant.id === this.product.selected_variant_id);\n\n    if (!selectedVariant) {\n      selectedVariant = this.product.variants[0];\n    }\n\n    if (!selectedVariant) {\n      return;\n    }\n\n    const productEl = document.createElement('product-element');\n    productEl.slot = 'product-price-data';\n    productEl.dataset.id = `${this.product.id}`;\n    productEl.dataset.type = this.product.type;\n    productEl.dataset.selectedVariantId = `${selectedVariant.id}`;\n\n    for (const variant of this.product.variants) {\n      const variantEl = document.createElement('variant-element');\n      variantEl.dataset.id = `${variant.id}`;\n      variantEl.dataset.price = `${variant.price}`;\n      variantEl.dataset.compareAtPrice = variant.compare_at_price ?\n        variant.compare_at_price.toString() : '';\n      variantEl.dataset.compareAtPriceModalContent =\n        variant.metafield_compare_at_price_modal_content || '';\n\n      productEl.appendChild(variantEl);\n    }\n\n    priceElement.appendChild(productEl);\n\n    pricingEl.appendChild(priceElement);\n  }\n\n  private renderBackorderMessage() {\n    if (!this.product) {\n      return;\n    }\n\n    const selectedVariant = this.product.variants.find(variant =>\n      variant.id === this.selectedVariantId);\n\n    const backorderMessage = this.shadowRoot.querySelector<HTMLElement>('.backorder');\n    if (selectedVariant?.backorder) {\n      backorderMessage.textContent = selectedVariant.backorder;\n      backorderMessage.hidden = false;\n    } else {\n      backorderMessage.textContent = '';\n      backorderMessage.hidden = true;\n    }\n  }\n\n  private renderMessage() {\n    const message = this.shadowRoot.querySelector<HTMLElement>('.message');\n    message.innerHTML = '';\n    message.hidden = true;\n\n    // If the discount modal feature is enabled, we do not render the discount message element.\n    if (this.dataset.enableDiscountModal === 'true') {\n      return;\n    }\n\n    // We apply the additional condition of discount percentage not equaling 0 to account for offer-\n    // 1 overrides using just the final sale price to drive discount messaging overrides.\n\n    if (!this.product.metafields_discount_code || (!this.product.metafields_discount_percentage &&\n      this.product.metafields_discount_percentage !== 0)) {\n      return;\n    }\n\n    // Variants can have different prices, so the message follows the variant the shopper picks\n    const selectedVariant = this.product.variants.find(variant =>\n      variant.id === this.selectedVariantId);\n\n    // We are not guaranteed to find a selected variant due to misconfiguration. In this case we do\n    // not render the discount message element.\n\n    if (selectedVariant) {\n      const discountMessageElement = document.createElement('product-discount-message');\n      discountMessageElement.dataset.price = `${selectedVariant.price}`;\n      discountMessageElement.dataset.currencyCode = this.dataset.currencyCode;\n      discountMessageElement.dataset.currencySymbol = this.dataset.currencySymbol;\n      discountMessageElement.dataset.compareAtPrice = selectedVariant.compare_at_price ?\n        selectedVariant.compare_at_price.toString() : '';\n      discountMessageElement.dataset.discountCode = this.product.metafields_discount_code;\n      discountMessageElement.dataset.discountPercentage =\n        `${this.product.metafields_discount_percentage}`;\n\n      if (this.product.metafields_discount_override) {\n        discountMessageElement.dataset.messageOverride = this.product.metafields_discount_override;\n      }\n\n      message.innerHTML = '';\n      message.append(discountMessageElement);\n      message.hidden = false;\n    } else {\n      console.debug('Could not find selected variant when rendering discount text');\n    }\n  }\n\n  /**\n   * Builds one option group per entry on the product, which for an ordinary product means one group\n   * per choice the shopper makes about that product.\n   *\n   * A bundle works differently and is worth knowing about, because it is where the option groups\n   * stop lining up with anything a shopper would recognize as one product. Shopify represents a\n   * bundle as its own product whose variants are every combination of the bundled products'\n   * variants, so the groups here belong to several different products flattened into one list. The\n   * only thing marking which product a group came from is its name, which the Bundles app writes as\n   * the bundled product's title followed by the option name in parentheses. The product detail page\n   * avoids the flattened form entirely and renders a picker per bundled product instead, so this\n   * modal is the only place the flattened groups get shown as they are.\n   */\n  private renderVariantOptions() {\n    const variantOptionsContainer = this.shadowRoot.querySelector<HTMLElement>('.variant-options');\n    variantOptionsContainer.innerHTML = '';\n\n    const variantOptionsEl = document.createElement('variant-options');\n    variantOptionsEl.dataset.productId = this.product.id.toString();\n    variantOptionsEl.dataset.productTitle = this.product.title;\n    variantOptionsEl.dataset.productType = this.product.type;\n    variantOptionsEl.dataset.productUrl = this.product.url;\n    variantOptionsEl.dataset.selectedVariant = this.selectedVariantId.toString();\n    variantOptionsEl.dataset.discountCode = this.product.metafields_discount_code;\n\n    const variantOptionsSlotEl = document.createElement('div');\n    variantOptionsSlotEl.slot = 'groups';\n\n    for (const optionGroup of this.product.option_groups) {\n      const optionGroupEl = document.createElement('variant-option-group');\n      optionGroupEl.dataset.productId = this.product.id.toString();\n      optionGroupEl.dataset.name = optionGroup.name;\n      optionGroupEl.dataset.selectedValue = optionGroup.selected_option;\n      optionGroupEl.dataset.position = optionGroup.position.toString();\n      if (optionGroup.use_swatches_for_color !== undefined) {\n        optionGroupEl.dataset.useSwatchesForColor = optionGroup.use_swatches_for_color;\n      }\n\n      if (optionGroup.name === 'Size') {\n        for (const option of optionGroup.options) {\n          for (const variant of option.variants) {\n            if (variant.id === this.selectedVariantId && variant.sizeDescription) {\n              optionGroupEl.dataset.selectedDescription = variant.sizeDescription;\n            }\n          }\n        }\n      }\n\n      this.selectedOptions[optionGroup.name] = optionGroup.selected_option;\n\n      const variantOptionsGroupSlot = document.createElement('div');\n      variantOptionsGroupSlot.slot = 'options';\n\n      let count = 1;\n      for (const option of optionGroup.options) {\n        const optionName = toCSSClassName(optionGroup.name.toLowerCase());\n        const optionId = `${this.product.id}${optionName}${count}`;\n        const optionEl = document.createElement('div');\n        optionEl.dataset.value = option.value;\n\n        const inputEl = document.createElement('input');\n        inputEl.type = 'radio';\n        inputEl.name = `${this.product.id}${optionName}`;\n        inputEl.id = optionId;\n        inputEl.value = option.value;\n\n        if (optionGroup.selected_option === option.value) {\n          inputEl.checked = true;\n        }\n\n        if (optionGroup.name === 'Size') {\n          const variant = option.variants.find(variant => {\n            return variant.option1 === option.value || variant.option2 === option.value;\n          });\n          inputEl.dataset.description = variant?.sizeDescription ?? '';\n        }\n\n        const labelEl = document.createElement('label');\n        labelEl.classList.add(optionName);\n\n        if (optionGroup.use_swatches_for_color === 'true' && option.color) {\n          labelEl.style.backgroundColor = option.color;\n        }\n\n        if (isOutOfStock(option)) {\n          labelEl.classList.add('out-of-stock');\n        }\n\n        labelEl.htmlFor = optionId;\n        labelEl.appendChild(inputEl);\n        labelEl.appendChild(document.createTextNode(option.value));\n\n        optionEl.appendChild(labelEl);\n\n        variantOptionsGroupSlot.appendChild(optionEl);\n\n        count++;\n      }\n\n      optionGroupEl.appendChild(variantOptionsGroupSlot);\n      variantOptionsSlotEl.appendChild(optionGroupEl);\n    }\n\n    variantOptionsEl.appendChild(variantOptionsSlotEl);\n\n    for (const variant of this.product.variants) {\n      const div = document.createElement('variant-element');\n      div.dataset.available = variant.available.toString();\n      div.dataset.compareAtPrice = variant.compare_at_price?.toString();\n      div.dataset.price = variant.price.toString();\n      div.dataset.sku = variant.sku;\n      div.dataset.title = variant.title;\n      div.dataset.id = variant.id.toString();\n      div.dataset.option1 = variant.option1;\n      div.dataset.option2 = variant.option2;\n      div.dataset.option3 = variant.option3;\n\n      variantOptionsEl.appendChild(div);\n    }\n\n    variantOptionsContainer.appendChild(variantOptionsEl);\n\n    if (this.product.option_groups.length > 0) {\n      variantOptionsContainer.hidden = false;\n    } else {\n      variantOptionsContainer.hidden = true;\n    }\n  }\n\n  private renderPrimaryAction() {\n    let selectedVariant = this.product.variants.find(variant =>\n      variant.id === this.product.selected_variant_id);\n\n    if (!selectedVariant) {\n      selectedVariant = this.product.variants[0];\n    }\n\n    if (!selectedVariant) {\n      return;\n    }\n\n    const addToCart = document.createElement('add-to-cart');\n    addToCart.dataset.country = this.country;\n    addToCart.dataset.productListingDisplay = 'true';\n    addToCart.dataset.hideBackorderMessage = 'true';\n    addToCart.dataset.backorder = selectedVariant.backorder;\n    addToCart.dataset.discountCode = this.product.metafields_discount_code;\n    if (this.dataset.customerEmail) {\n      addToCart.dataset.customerEmail = this.dataset.customerEmail;\n    }\n\n    const product = document.createElement('product-element');\n    product.slot = 'product';\n    product.dataset.id = `${this.product.id}`;\n    product.dataset.available = `${this.product.available}`;\n    product.dataset.url = this.product.url;\n    product.dataset.title = this.product.title;\n    product.dataset.type = this.product.type;\n    product.dataset.selectedVariantId = `${selectedVariant.id}`;\n    product.dataset.tags = this.product.tags || '';\n\n    for (const variant of this.product.variants) {\n      const variantElement = document.createElement('variant-element');\n      variantElement.dataset.id = `${variant.id}`;\n      variantElement.dataset.available = `${variant.available}`;\n      variantElement.dataset.sku = variant.sku;\n      variantElement.dataset.title = variant.title;\n\n      if (variant.backorder) {\n        variantElement.dataset.backorder = variant.backorder;\n        const customAttribute = document.createElement('custom-attribute');\n        customAttribute.dataset.key = '_backorder_message';\n        customAttribute.dataset.value = variant.backorder;\n        variantElement.appendChild(customAttribute);\n\n        if (variant.hide_backorder_in_collection) {\n          variantElement.dataset.hideBackorderInCollection = variant.hide_backorder_in_collection;\n        }\n      }\n\n      if (Number.isInteger(variant.backorder_selling_plan_id)) {\n        const customAttribute = document.createElement('custom-attribute');\n        customAttribute.dataset.key = 'selling_plan';\n        customAttribute.dataset.value = variant.backorder_selling_plan_id.toString();\n        variantElement.appendChild(customAttribute);\n      }\n\n      // It is possible that this.product.tags is undefined\n      const tags = this.product.tags || '';\n\n      if (tags.includes('Contains Alcohol')) {\n        const customAttribute = document.createElement('custom-attribute');\n        customAttribute.dataset.key = '_contains_alcohol';\n        customAttribute.dataset.value = 'true';\n        variantElement.appendChild(customAttribute);\n      }\n\n      if (tags.includes('compatibility-soleil')) {\n        const customAttribute = document.createElement('custom-attribute');\n        customAttribute.dataset.key = '_compatibility';\n        customAttribute.dataset.value = 'soleil';\n        variantElement.appendChild(customAttribute);\n      }\n\n      if (tags.includes('compatibility-max-high-volume')) {\n        const customAttribute = document.createElement('custom-attribute');\n        customAttribute.dataset.key = '_compatibility';\n        customAttribute.dataset.value = 'max-high-volume';\n        variantElement.appendChild(customAttribute);\n      }\n\n      if (tags.includes('final-sale')) {\n        const customAttribute = document.createElement('custom-attribute');\n        customAttribute.dataset.key = '_final_sale';\n        customAttribute.dataset.value = 'true';\n        variantElement.appendChild(customAttribute);\n\n        // signals to our returns vendor Loop that this line item is final sale and not eligible for\n        // return, mirroring add-to-cart.liquid\n        const loopAttribute = document.createElement('custom-attribute');\n        loopAttribute.dataset.key = '_LPROP';\n        loopAttribute.dataset.value = 'final-sale';\n        variantElement.appendChild(loopAttribute);\n      }\n\n      product.appendChild(variantElement);\n    }\n\n    addToCart.appendChild(product);\n\n    addToCart.dataset.full = 'true';\n\n    const primaryActionEl = this.shadowRoot.querySelector('.primary-action');\n    primaryActionEl.innerHTML = '';\n    primaryActionEl.appendChild(addToCart);\n  }\n\n  private renderProductLink() {\n    const productLinkEl = this.shadowRoot.querySelector('.product-link');\n    productLinkEl.innerHTML = '';\n    const anchor = document.createElement('a');\n    anchor.href = this.product.url;\n    anchor.innerText = 'View Details';\n    productLinkEl.appendChild(anchor);\n  }\n\n  /**\n   * Utility method to update variant options out-of-stock status when the product has 2 or more\n   * option groups. There can be a case when for the selected option1 variant for some option2 is\n   * not available. We need to mark them as OOS. E.g. there are 2 option groups: Color (with options\n   * \"Blush\" and \"Black\") and Size (with options \"25mm\" and \"75mm\"). For the option \"Blush\" there is\n   * no available variant. So when the user selects \"Blush\" all Size options will be marked as OOS.\n   *\n   * This method should only be called after initialization of modal after the select-option-\n   * requested event is emitted and is no longer required to be called on every option change.\n   *\n   * By the time this runs, the render pass has already struck out every option that is unavailable\n   * across the whole product. So all this adds is the second group's availability relative to the\n   * option picked in the first group. Nothing here touches a third group.\n   *\n   * The equivalent pass for later option changes lives in the shared variant-options element rather\n   * than here, which is why this one only runs at open. See issue 6803.\n   */\n  private setOOSForSecondOptionGroup() {\n    if (!this.product || this.product.option_groups.length < 2) {\n      return;\n    }\n\n    const mainOptionName = this.product.option_groups[0].name;\n    const mainOptionValue = this.selectedOptions[mainOptionName];\n\n    // Each pass through the loop overwrites whatever the previous one wrote for the same label, so\n    // the last variant visited decides how the option looks. That works while exactly one variant\n    // matches each value in the second group, which holds for a product with two option groups.\n    // With three, several variants share a second group value and differ only in the third, so\n    // which one wins comes down to the order the variants arrive in.\n    const variants = this.product.variants\n      .filter(variant => variant.option1 === mainOptionValue);\n    for (const variant of variants) {\n      const option2 = variant.option2;\n      const label = this.shadowRoot.querySelector(\n        `variant-option-group[data-position=\"2\"] [data-value=\"${option2}\"] label`);\n\n      if (!label) {\n        continue;\n      }\n\n      if (variant.available) {\n        label.classList.remove('out-of-stock');\n      } else {\n        label.classList.add('out-of-stock');\n      }\n    }\n  }\n}\n\n/**\n * Whether an option is unavailable no matter what else is picked, meaning no variant carrying it is\n * available. This is the blanket check the render pass uses, so it knows nothing about the current\n * selection and cannot say that an option is unavailable only in combination with another one.\n */\nfunction isOutOfStock(option: ProductVariantOption) {\n  return option.variants.every(variant => !variant.available);\n}\n\nfunction toCSSClassName(value: string) {\n  return value.replace(/\\W/g, '-');\n}\n\ninterface ProductVariantOption {\n  value: string;\n  variants: Partial<{\n    /**\n     * Whether the variant has inventory in stock and is available for sale.\n     */\n    available: boolean;\n\n    backorder_message: string;\n\n    /**\n     * The \"Pre-Order\" deferred payment selling plan ID associated with a backordered variant.\n     */\n    backorder_selling_plan_id: number;\n\n    compare_at_price: number | null;\n\n    customAttributes: {\n      /**\n       * Key or name of the attribute.\n       */\n      key: string;\n\n      /**\n       * Value of the attribute.\n       */\n      value: string;\n    }[];\n\n    hideBackorderInCollection: string;\n\n    /**\n     * Variant id\n     */\n    id: number;\n\n    price: number;\n\n    sku: string;\n\n    title: string;\n  }>[];\n}\n\ninterface Product {\n  /**\n   * Product inventory availability\n   */\n  available: boolean;\n\n  /**\n   * Product award image\n   */\n  award_badge_image: string;\n\n  /**\n   * Product award tag\n   */\n  award_tag: string;\n\n  /**\n   * Product badge type\n   */\n  badge_type: '' | 'best-seller' | 'favorite' | 'new' | 'travel-friendly';\n\n  /**\n   * Bundles created using the Shopify app use an abstraction product created by the application to\n   * represent the bundle. If a product's variant options are being presented in the context of a\n   * product in a bundle this attribute identifies the product ID for the abstraction product\n   * created by the Shopify Bundle App to represent that bundle.\n   */\n  bundle_product_id: number;\n\n  /**\n   * Shopify product id\n   */\n  id: number;\n\n  /**\n   * Product main image loading method\n   */\n  lazyload: boolean;\n\n  /**\n   * Product main image\n   */\n  main_image: string;\n\n  /**\n   * Product metafields discount code (used to promote public discount codes)\n   */\n  metafields_discount_code: string;\n\n  /**\n   * Product metafields discount override to use one-off messages instead of generated text\n   */\n  metafields_discount_override: string;\n\n  /**\n   * Product metafields discount percentage (used to render public discount code prices)\n   */\n  metafields_discount_percentage: number;\n\n  /**\n   * Product metafields subtitle\n   */\n  metafields_subtitle: string;\n\n  /**\n   * Product metafields title\n   */\n  metafields_title: string;\n\n  option_groups: {\n    name: string;\n    options: {\n      color?: string;\n      value: string;\n      variants: Partial<{\n        /**\n         * Whether the variant has inventory in stock and is available for sale.\n         */\n        available: boolean;\n\n        backorder_message: string;\n\n        compare_at_price: number | null;\n\n        customAttributes: {\n          /**\n           * Key or name of the attribute.\n           */\n          key: string;\n\n          /**\n           * Value of the attribute.\n           */\n          value: string;\n        }[];\n\n        hideBackorderInCollection: string;\n\n        /**\n         * Variant id\n         */\n        id: number;\n\n        /**\n         * The value of the variant for the first product option. If there's no first product\n         * option, then nil is returned.\n         */\n        option1: string;\n\n        /**\n         * The value of the variant for the second product option. If there's no second product\n         * option, then nil is returned.\n         */\n        option2: string;\n\n        /**\n         * The value of the variant for the third product option. If there's no third product\n         * option, then nil is returned.\n         */\n        option3: string;\n\n        price: number;\n\n        /**\n         * The short description associated with the variant size option.\n         */\n        sizeDescription: string;\n\n        sku: string;\n\n        title: string;\n      }>[];\n    }[];\n    position?: number;\n    selected_option: string;\n    use_swatches_for_color?: 'false' | 'true';\n  }[];\n\n  /**\n   * Product yotpo reviews average value\n   */\n  reviews_average: number;\n\n  /**\n   * Product yotpo reviews count\n   */\n  reviews_count: number;\n\n  /**\n   * Selected variant id\n   */\n  selected_variant_id: number;\n\n  /**\n   * Product sku\n   */\n  sku: string;\n\n  /**\n   * Product tags\n   */\n  tags: string;\n\n  /**\n   * Product title\n   */\n  title: string;\n\n  /**\n   * Product type\n   *\n   * @example \"hair-care\"\n   */\n  type: string;\n\n  /**\n   * Shopify product url\n   */\n  url: string;\n\n  /**\n   * A list of the product's variants with some information about variant\n   */\n  variants: {\n    /**\n     * Whether the variant is in stock\n     */\n    available: boolean;\n\n    /**\n     * Whether the variant is on backorder\n     */\n    backorder: string;\n\n    /**\n     * The \"Pre-Order\" deferred payment selling plan ID associated with a backordered variant.\n     */\n    backorder_selling_plan_id: number;\n\n    /**\n     * The MSRP, or original sales price before discounts, per unit\n     */\n    compare_at_price: number | null;\n\n    /**\n     * The currency code associated with the price\n     */\n    currency_code: string;\n\n    /**\n     * Boolean as a string to indicate whether to hide any backorder message if the product card is\n     * being viewed in a collection context.\n     */\n    hide_backorder_in_collection: string;\n\n    /**\n     * Variant id\n     *\n     * @example 12345568943\n     */\n    id: number;\n\n    /**\n     * URL of the image associated with the variant. Only populated by some dispatchers (e.g. the\n     * product card), so it is optional on this shared event contract.\n     */\n    image_src?: string;\n\n    /**\n     * Content to be displayed in the compare at price modal for a particular variant. Only\n     * populated by some dispatchers (e.g. the product card), so it is optional on this shared event\n     * contract.\n     */\n    metafield_compare_at_price_modal_content?: string;\n\n    /**\n     * The value of the variant for the first product option. If there's no first product option,\n     * then nil is returned.\n     */\n    option1: string;\n\n    /**\n     * The value of the variant for the second product option. If there's no second product option,\n     * then nil is returned.\n     */\n    option2: string;\n\n    /**\n     * The value of the variant for the third product option. If there's no third product option,\n     * then nil is returned.\n     */\n    option3: string;\n\n    /**\n     * The price of the variant in the currency's subunit.\n     *\n     * @see https://shopify.dev/docs/api/liquid/objects/variant#variant-price\n     */\n    price: number;\n\n    /**\n     * Whether this variant is the currently selected variant out of all the variants for the\n     * product\n     */\n    selected: boolean;\n\n    /**\n     * The Stock Keeping Unit associated with the variant. This is another kind of product id.\n     */\n    sku: string;\n\n    /**\n     * The title of the variant.\n     */\n    title: string;\n  }[];\n}\n\ndeclare global {\n  interface HTMLElementTagNameMap {\n    'product-variant-selector-modal': ProductVariantSelectorModal;\n  }\n}\n\nif (!customElements.get('product-variant-selector-modal')) {\n  customElements.define('product-variant-selector-modal', ProductVariantSelectorModal);\n}\n"],"names":["__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","exports","module","__webpack_modules__","b","document","baseURI","self","location","href","product_variant_selector_modal","URL","ProductVariantSelectorModal","HTMLElement","observedAttributes","selectedOptions","onSelectOptionRequestedBound","this","onSelectOptionRequested","bind","onProductVariantOptionChangedBound","onProductVariantOptionChanged","onModalDismissRequestedBound","onModalDismissRequested","onCartOpenRequestedBound","onCartOpenRequested","onNotifyMeClickedBound","onNotifyMeClicked","onCompareAtPriceModalRequestedBound","onCompareAtPriceModalRequested","onCloseButtonClickedBound","onCloseButtonClicked","connectedCallback","initializeShadowRoot","closeButton","shadowRoot","querySelector","addEventListener","disconnectedCallback","removeEventListener","attachShadow","mode","innerHTML","attributeChangedCallback","name","oldValue","newValue","isConnected","show","hide","showModal","dataset","modalState","hidden","event","Event","bubbles","composed","dispatchEvent","closeModal","src","_event","option","detail","option_groups","selected_option","selectedVariantId","selected_variant_id","renderProductImage","renderBackorderMessage","renderMessage","_event$detail","_event$detail2","product","country","render","setOOSForSecondOptionGroup","setTimeout","focus","focusVisible","_this$product","title","renderTitle","renderVariantOptions","renderPricing","renderPrimaryAction","renderProductLink","productImageEl","selectedVariant","variants","find","variant","id","image_src","main_image","_this$product$reviews","_this$product$reviews2","innerText","metafields_subtitle","ratingEl","average","reviews_average","toString","count","reviews_count","pricingEl","priceElement","createElement","currencyCode","currencySymbol","productEl","slot","type","variantEl","price","compareAtPrice","compare_at_price","compareAtPriceModalContent","metafield_compare_at_price_modal_content","appendChild","backorderMessage","backorder","textContent","message","enableDiscountModal","metafields_discount_code","metafields_discount_percentage","discountMessageElement","discountCode","discountPercentage","metafields_discount_override","messageOverride","append","console","debug","variantOptionsContainer","variantOptionsEl","productId","productTitle","productType","productUrl","url","variantOptionsSlotEl","optionGroup","optionGroupEl","selectedValue","position","use_swatches_for_color","useSwatchesForColor","options","sizeDescription","selectedDescription","variantOptionsGroupSlot","optionName","toCSSClassName","toLowerCase","optionId","optionEl","value","inputEl","checked","_variant$sizeDescript","option1","option2","description","labelEl","classList","add","color","style","backgroundColor","isOutOfStock","htmlFor","createTextNode","_variant$compare_at_p","div","available","sku","option3","length","addToCart","productListingDisplay","hideBackorderMessage","customerEmail","tags","variantElement","customAttribute","key","hide_backorder_in_collection","hideBackorderInCollection","Number","isInteger","backorder_selling_plan_id","includes","loopAttribute","full","primaryActionEl","productLinkEl","anchor","mainOptionName","mainOptionValue","filter","label","remove","every","replace","customElements","get","define"],"sourceRoot":""}