From cdbe11836a46240143338ad93841097cb7ecd998 Mon Sep 17 00:00:00 2001 From: Bozo Jovicic Date: Fri, 20 Mar 2026 15:59:21 +0100 Subject: [PATCH 01/17] MWPW-189463 MAS Studio: Quantity selector variation --- studio/src/common/fields/quantity-select.js | 27 ++++++++++++++ studio/src/editors/merch-card-editor.js | 39 ++++++++++++++------- 2 files changed, 54 insertions(+), 12 deletions(-) diff --git a/studio/src/common/fields/quantity-select.js b/studio/src/common/fields/quantity-select.js index 91280a2db..e83014f0c 100644 --- a/studio/src/common/fields/quantity-select.js +++ b/studio/src/common/fields/quantity-select.js @@ -42,6 +42,7 @@ export class QuantitySelectField extends LitElement { step: { type: String, state: true }, layout: { type: String, reflect: true }, disabled: { type: Boolean, reflect: true }, + renderQuantityComponentOverrideIndicator: { type: Function, attribute: false }, }; static styles = css` @@ -63,6 +64,28 @@ export class QuantitySelectField extends LitElement { sp-field-group { width: 100%; } + + .field-status-indicator { + display: flex; + align-items: center; + gap: 6px; + margin-top: 6px; + font-size: 12px; + color: var(--spectrum-blue-700); + } + + .field-status-indicator a { + color: var(--spectrum-blue-700); + text-decoration: none; + cursor: pointer; + display: inline-flex; + align-items: center; + gap: 4px; + } + + .field-status-indicator a:hover { + text-decoration: underline; + } `; constructor() { @@ -73,6 +96,7 @@ export class QuantitySelectField extends LitElement { this.step = '1'; this.layout = 'grid'; this.disabled = false; + this.renderQuantityComponentOverrideIndicator = null; } willUpdate(changedProperties) { @@ -130,6 +154,7 @@ export class QuantitySelectField extends LitElement { @change=${this.#suppressNativeChange} @input=${this.#handleTitleChange} > + ${this.renderQuantityComponentOverrideIndicator('title')} Start quantity @@ -142,6 +167,7 @@ export class QuantitySelectField extends LitElement { @change=${this.#suppressNativeChange} @input=${this.#handleMinChange} > + ${this.renderQuantityComponentOverrideIndicator('min')} @@ -155,6 +181,7 @@ export class QuantitySelectField extends LitElement { @change=${this.#suppressNativeChange} @input=${this.#handleStepChange} > + ${this.renderQuantityComponentOverrideIndicator('step')} `; } diff --git a/studio/src/editors/merch-card-editor.js b/studio/src/editors/merch-card-editor.js index cf6e35a58..185466f18 100644 --- a/studio/src/editors/merch-card-editor.js +++ b/studio/src/editors/merch-card-editor.js @@ -23,6 +23,7 @@ import { toAttribute } from '../aem/aem-tag-picker-field.js'; const QUANTITY_MODEL = 'quantitySelect'; const WHAT_IS_INCLUDED = 'whatsIncluded'; +const QUANTITY_EMPTY = ''; const VARIANT_RTE_MARKS = { [VARIANT_NAMES.MINI]: { @@ -71,6 +72,7 @@ class MerchCardEditor extends LitElement { this.fieldsReady = false; this.localeSearch = ''; this.reactiveController = new ReactiveController(this, []); + this.renderQuantityComponentOverrideIndicator = this.renderQuantityComponentOverrideIndicator.bind(this); } createRenderRoot() { @@ -403,7 +405,9 @@ class MerchCardEditor extends LitElement { } get fragmentQuantityValue() { - return this.fragment?.fields.find((f) => f.name === QUANTITY_MODEL)?.values[0] || ''; + const value = this.getEffectiveFieldValue(QUANTITY_MODEL, 0) || ''; + if (value === QUANTITY_EMPTY) return ''; + return value; } get quantitySelectorDisplayed() { @@ -424,10 +428,11 @@ class MerchCardEditor extends LitElement { if (e.target.checked) { html = this.quantityValue || createQuantitySelectValue({ title: '', min: '1', step: '1' }); } else { - const qsValues = this.fragmentStore.get().getField(QUANTITY_MODEL)?.values; - this.quantitySelectorValues = qsValues?.length ? qsValues[0] : ''; + this.quantitySelectorValues = this.fragmentQuantityValue; + if (this.effectiveIsVariation) html = QUANTITY_EMPTY; } this.fragmentStore.updateField(QUANTITY_MODEL, [html]); + if (!e.target.checked) this.requestUpdate(); }; showQuantityFields(show) { @@ -959,18 +964,15 @@ class MerchCardEditor extends LitElement { ?disabled=${this.disabled} >Show quantity selector - ${this.renderFieldStatusIndicator('quantitySelect')} + ${this.renderQuantityComponentOverrideIndicator()}
- ${this.renderQuantityComponentOverrideIndicator('title')} - ${this.renderQuantityComponentOverrideIndicator('min')} - ${this.renderQuantityComponentOverrideIndicator('step')}
@@ -1708,18 +1710,31 @@ class MerchCardEditor extends LitElement { renderQuantityComponentOverrideIndicator(component) { if (!this.effectiveIsVariation) return nothing; - if (this.getQuantityComponentState(component) !== 'overridden') return nothing; + if (component && this.getQuantityComponentState(component) !== 'overridden') return nothing; + if (!component) { + const parentHtml = this.localeDefaultFragment?.getFieldValue(QUANTITY_MODEL, 0) || ''; + const ownHtml = this.fragment?.getFieldValue(QUANTITY_MODEL, 0) || ''; + if (!ownHtml) return nothing; + if (ownHtml.startsWith(' this.resetQuantityComponentToParent(component)); } async resetQuantityComponentToParent(component) { const parentHtml = this.localeDefaultFragment?.getFieldValue(QUANTITY_MODEL, 0) || ''; + if (!component && !parentHtml) { + this.fragmentStore.updateField(QUANTITY_MODEL, [parentHtml]); + this.quantitySelectorValues = parentHtml; + showToast('Field restored to parent value', 'positive'); + return; + } const parentValues = parseQuantitySelectValue(parentHtml); const currentValues = parseQuantitySelectValue(this.quantityValue); const html = createQuantitySelectValue({ - title: component === 'title' ? parentValues.title : currentValues.title, - min: component === 'min' ? parentValues.min : currentValues.min, - step: component === 'step' ? parentValues.step : currentValues.step, + title: !component || component === 'title' ? parentValues.title : currentValues.title, + min: !component || component === 'min' ? parentValues.min : currentValues.min, + step: !component || component === 'step' ? parentValues.step : currentValues.step, }); this.fragmentStore.updateField(QUANTITY_MODEL, [html]); this.quantitySelectorValues = html; From 82bd457ccc09984540244ea626f4890f9b13bc23 Mon Sep 17 00:00:00 2001 From: Bozo Jovicic Date: Fri, 20 Mar 2026 16:06:02 +0100 Subject: [PATCH 02/17] MWPW-189463 MAS Studio: Quantity selector variation --- studio/src/common/fields/quantity-select.js | 4 ++-- studio/src/editors/merch-card-editor.js | 9 ++------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/studio/src/common/fields/quantity-select.js b/studio/src/common/fields/quantity-select.js index e83014f0c..923c01e24 100644 --- a/studio/src/common/fields/quantity-select.js +++ b/studio/src/common/fields/quantity-select.js @@ -72,7 +72,7 @@ export class QuantitySelectField extends LitElement { margin-top: 6px; font-size: 12px; color: var(--spectrum-blue-700); - } + } .field-status-indicator a { color: var(--spectrum-blue-700); @@ -85,7 +85,7 @@ export class QuantitySelectField extends LitElement { .field-status-indicator a:hover { text-decoration: underline; - } + } `; constructor() { diff --git a/studio/src/editors/merch-card-editor.js b/studio/src/editors/merch-card-editor.js index 185466f18..717191e10 100644 --- a/studio/src/editors/merch-card-editor.js +++ b/studio/src/editors/merch-card-editor.js @@ -658,10 +658,6 @@ class MerchCardEditor extends LitElement { width: 100%; } - .quantity-component-restores { - margin-top: 8px; - } - sp-field-group sp-textfield { width: 100%; } @@ -972,8 +968,6 @@ class MerchCardEditor extends LitElement { @change=${this.#handleQuantityFieldChange} .renderQuantityComponentOverrideIndicator=${this.renderQuantityComponentOverrideIndicator} > -
-
@@ -1715,7 +1709,8 @@ class MerchCardEditor extends LitElement { const parentHtml = this.localeDefaultFragment?.getFieldValue(QUANTITY_MODEL, 0) || ''; const ownHtml = this.fragment?.getFieldValue(QUANTITY_MODEL, 0) || ''; if (!ownHtml) return nothing; - if (ownHtml.startsWith(' this.resetQuantityComponentToParent(component)); From b3dc652a3449e44a3c6930013c7abfe0153d0ec8 Mon Sep 17 00:00:00 2001 From: Bozo Jovicic Date: Mon, 23 Mar 2026 10:50:16 +0100 Subject: [PATCH 03/17] MWPW-189463 MAS Studio: Quantity selector variation --- studio/src/common/fields/quantity-select.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/studio/src/common/fields/quantity-select.js b/studio/src/common/fields/quantity-select.js index 923c01e24..0a1cea48e 100644 --- a/studio/src/common/fields/quantity-select.js +++ b/studio/src/common/fields/quantity-select.js @@ -96,7 +96,7 @@ export class QuantitySelectField extends LitElement { this.step = '1'; this.layout = 'grid'; this.disabled = false; - this.renderQuantityComponentOverrideIndicator = null; + this.renderQuantityComponentOverrideIndicator = () => {}; } willUpdate(changedProperties) { From be07f76f8af6433deea7644fbf7f4ab22e042911 Mon Sep 17 00:00:00 2001 From: Bozo Jovicic Date: Mon, 23 Mar 2026 14:31:32 +0100 Subject: [PATCH 04/17] MWPW-189463 MAS Studio: Quantity selector variation - unit tests --- .../test/editors/merch-card-editor.test.html | 55 +++++++++++++++++++ .../adobe/sites/cf/fragments/cc-all-apps | 7 +++ 2 files changed, 62 insertions(+) diff --git a/studio/test/editors/merch-card-editor.test.html b/studio/test/editors/merch-card-editor.test.html index f2c7dae91..330ede2b2 100644 --- a/studio/test/editors/merch-card-editor.test.html +++ b/studio/test/editors/merch-card-editor.test.html @@ -648,6 +648,61 @@ expect(relatedVariations).to.not.exist; }); + it('adds quantity to variation and removes it via override indicator', async () => { + await setupTestEnvironment(); + + const qsDiv = editor.querySelector('sp-field-group#quantitySelect div#quantitySelector'); + expect(qsDiv.style.display).to.equal('none'); + + const qsCheckboxEl = editor.querySelector('sp-field-group#quantitySelect sp-checkbox'); + expect(qsCheckboxEl.closest('sp-field-group').querySelector('.field-status-indicator a')).to.not.exist; + qsCheckboxEl.checked = true; + qsCheckboxEl.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true })); + expect(qsDiv.style.display).to.equal('block'); + + const qsTitleEl = qsDiv.querySelector('quantity-select-field').shadowRoot.querySelector('sp-textfield#quantity-selector-title'); + const qsStartEl = qsDiv.querySelector('quantity-select-field').shadowRoot.querySelector('sp-textfield#quantity-selector-start'); + const qsStepEl = qsDiv.querySelector('quantity-select-field').shadowRoot.querySelector('sp-textfield#quantity-selector-step'); + + qsTitleEl.value = 'QS'; + qsTitleEl.dispatchEvent(new CustomEvent('input', { bubbles: true, composed: true })); + qsStartEl.value = '3'; + qsStartEl.dispatchEvent(new CustomEvent('input', { bubbles: true, composed: true })); + qsStepEl.value = '2'; + qsStepEl.dispatchEvent(new CustomEvent('input', { bubbles: true, composed: true })); + + await editor.updateComplete; + + let titleOverrideEl = qsTitleEl.closest('sp-field-group').querySelector('.field-status-indicator a'); + expect(titleOverrideEl).to.exist; + let startOverrideEl = qsStartEl.closest('sp-field-group').querySelector('.field-status-indicator a'); + expect(startOverrideEl).to.exist; + let stepOverrideEl = qsStepEl.closest('sp-field-group').querySelector('.field-status-indicator a'); + expect(stepOverrideEl).to.exist; + let qsOverrideEl = qsCheckboxEl.closest('sp-field-group').querySelector('.field-status-indicator a'); + expect(qsOverrideEl).to.exist; + + titleOverrideEl.click(); + startOverrideEl.click(); + stepOverrideEl.click(); + + await editor.updateComplete; + + titleOverrideEl = qsTitleEl.closest('sp-field-group').querySelector('.field-status-indicator a'); + expect(titleOverrideEl).to.not.exist; + startOverrideEl = qsStartEl.closest('sp-field-group').querySelector('.field-status-indicator a'); + expect(startOverrideEl).to.not.exist; + stepOverrideEl = qsStepEl.closest('sp-field-group').querySelector('.field-status-indicator a'); + expect(stepOverrideEl).to.not.exist; + + qsOverrideEl.click(); + await editor.updateComplete; + + qsOverrideEl = qsCheckboxEl.closest('sp-field-group').querySelector('.field-status-indicator a'); + expect(qsOverrideEl).to.not.exist; + expect(qsDiv.style.display).to.equal('none'); + }); + describe('getWhatsIncludedProps', () => { it('extracts icon, alt, and description from a merch-icon element', async () => { await setupTestEnvironment({}, 'gwip-merch-icon'); diff --git a/studio/test/mocks/adobe/sites/cf/fragments/cc-all-apps b/studio/test/mocks/adobe/sites/cf/fragments/cc-all-apps index 045eefaac..d0860883f 100644 --- a/studio/test/mocks/adobe/sites/cf/fragments/cc-all-apps +++ b/studio/test/mocks/adobe/sites/cf/fragments/cc-all-apps @@ -172,6 +172,13 @@ "mimeType": "text/html", "values": [] }, + { + "name": "quantitySelect", + "type": "text", + "multiple": false, + "locked": false, + "values": [] + }, { "name": "secure", "type": "boolean", From ac4845c6ffa72a1eaae23dd92c5113bc0fda91c9 Mon Sep 17 00:00:00 2001 From: Bozo Jovicic Date: Mon, 23 Mar 2026 14:36:32 +0100 Subject: [PATCH 05/17] MWPW-189463 MAS Studio: Quantity selector variation - unit tests --- studio/test/editors/merch-card-editor.test.html | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/studio/test/editors/merch-card-editor.test.html b/studio/test/editors/merch-card-editor.test.html index 330ede2b2..0a40e18c9 100644 --- a/studio/test/editors/merch-card-editor.test.html +++ b/studio/test/editors/merch-card-editor.test.html @@ -660,9 +660,15 @@ qsCheckboxEl.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true })); expect(qsDiv.style.display).to.equal('block'); - const qsTitleEl = qsDiv.querySelector('quantity-select-field').shadowRoot.querySelector('sp-textfield#quantity-selector-title'); - const qsStartEl = qsDiv.querySelector('quantity-select-field').shadowRoot.querySelector('sp-textfield#quantity-selector-start'); - const qsStepEl = qsDiv.querySelector('quantity-select-field').shadowRoot.querySelector('sp-textfield#quantity-selector-step'); + const qsTitleEl = qsDiv + .querySelector('quantity-select-field') + .shadowRoot.querySelector('sp-textfield#quantity-selector-title'); + const qsStartEl = qsDiv + .querySelector('quantity-select-field') + .shadowRoot.querySelector('sp-textfield#quantity-selector-start'); + const qsStepEl = qsDiv + .querySelector('quantity-select-field') + .shadowRoot.querySelector('sp-textfield#quantity-selector-step'); qsTitleEl.value = 'QS'; qsTitleEl.dispatchEvent(new CustomEvent('input', { bubbles: true, composed: true })); @@ -701,7 +707,7 @@ qsOverrideEl = qsCheckboxEl.closest('sp-field-group').querySelector('.field-status-indicator a'); expect(qsOverrideEl).to.not.exist; expect(qsDiv.style.display).to.equal('none'); - }); + }); describe('getWhatsIncludedProps', () => { it('extracts icon, alt, and description from a merch-icon element', async () => { From e3860b9abb0a84f2152d3267be1dbc8e54ef803f Mon Sep 17 00:00:00 2001 From: Bozo Jovicic Date: Wed, 1 Apr 2026 13:18:19 +0200 Subject: [PATCH 06/17] MWPW-189463 MAS Studio: Quantity selector variation --- studio/src/common/fields/field-status.css.js | 52 ++++++++++++ studio/src/common/fields/quantity-select.js | 29 ++----- studio/src/editors/merch-card-editor.js | 83 ++++++-------------- web-components/dist/mas.js | 6 +- web-components/dist/merch-quantity-select.js | 12 +-- web-components/src/merch-quantity-select.js | 6 ++ 6 files changed, 97 insertions(+), 91 deletions(-) create mode 100644 studio/src/common/fields/field-status.css.js diff --git a/studio/src/common/fields/field-status.css.js b/studio/src/common/fields/field-status.css.js new file mode 100644 index 000000000..32e65baf2 --- /dev/null +++ b/studio/src/common/fields/field-status.css.js @@ -0,0 +1,52 @@ +import { css } from 'lit'; + +export const fieldStatusStyles = css` + .field-status-indicator { + display: flex; + align-items: center; + gap: 6px; + margin-top: 6px; + font-size: 14px; + line-height: 18px; + color: var(--spectrum-accent-content-color-default, #3b63fb); + } + + .field-status-icon { + color: inherit; + flex: none; + } + + .field-status-label { + color: inherit; + } + + .field-status-restore-link { + position: relative; + color: inherit; + font: inherit; + line-height: inherit; + text-decoration: underline; + cursor: pointer; + } + + .field-status-restore-link-prefix { + position: absolute; + width: 1px; + height: 1px; + padding: 0; + margin: -1px; + overflow: hidden; + clip: rect(0, 0, 0, 0); + white-space: nowrap; + border: 0; + } + + .field-status-restore-link:hover { + color: var(--spectrum-accent-content-color-hover, #2f55e0); + } + + .field-status-restore-link:focus-visible { + outline: 2px solid var(--spectrum-accent-content-color-key-focus, #2f55e0); + outline-offset: 2px; + } +`; \ No newline at end of file diff --git a/studio/src/common/fields/quantity-select.js b/studio/src/common/fields/quantity-select.js index 0a1cea48e..44c1d0919 100644 --- a/studio/src/common/fields/quantity-select.js +++ b/studio/src/common/fields/quantity-select.js @@ -1,4 +1,7 @@ import { css, html, LitElement } from 'lit'; +import { fieldStatusStyles } from './field-status.css.js'; + +export const QUANTITY_SELECT_TAG = 'merch-quantity-select'; /** * Builds a serialized merch quantity selector HTML value. @@ -6,7 +9,7 @@ import { css, html, LitElement } from 'lit'; * @returns {string} */ export const createQuantitySelectValue = ({ title, min, step }) => { - const element = document.createElement('merch-quantity-select'); + const element = document.createElement(QUANTITY_SELECT_TAG); element.setAttribute('title', `${title}`); element.setAttribute('min', `${min}`); element.setAttribute('max', '10'); @@ -23,7 +26,7 @@ export const parseQuantitySelectValue = (value) => { if (!value) return { title: '', min: '1', step: '1' }; const parser = new DOMParser(); const documentRoot = parser.parseFromString(value, 'text/html'); - const element = documentRoot.querySelector('merch-quantity-select'); + const element = documentRoot.querySelector(QUANTITY_SELECT_TAG); return { title: `${element?.getAttribute('title') ?? ''}`, min: `${element?.getAttribute('min') ?? '1'}`, @@ -65,27 +68,7 @@ export class QuantitySelectField extends LitElement { width: 100%; } - .field-status-indicator { - display: flex; - align-items: center; - gap: 6px; - margin-top: 6px; - font-size: 12px; - color: var(--spectrum-blue-700); - } - - .field-status-indicator a { - color: var(--spectrum-blue-700); - text-decoration: none; - cursor: pointer; - display: inline-flex; - align-items: center; - gap: 4px; - } - - .field-status-indicator a:hover { - text-decoration: underline; - } + ${fieldStatusStyles} `; constructor() { diff --git a/studio/src/editors/merch-card-editor.js b/studio/src/editors/merch-card-editor.js index e0b5cc7b0..d7d57bb7f 100644 --- a/studio/src/editors/merch-card-editor.js +++ b/studio/src/editors/merch-card-editor.js @@ -12,7 +12,7 @@ import '../fields/secure-text-field.js'; import '../fields/plan-type-field.js'; import { getFragmentMapping, showToast } from '../utils.js'; import '../fields/addon-field.js'; -import { createQuantitySelectValue, parseQuantitySelectValue } from '../common/fields/quantity-select.js'; +import { createQuantitySelectValue, parseQuantitySelectValue, QUANTITY_SELECT_TAG } from '../common/fields/quantity-select.js'; import Store from '../store.js'; import Events from '../events.js'; import { VARIANT_NAMES } from './variant-picker.js'; @@ -21,10 +21,11 @@ import { getItemFieldStateByIndex } from '../utils/field-state.js'; import { Fragment } from '../aem/fragment.js'; import { toAttribute } from '../aem/aem-tag-picker-field.js'; import { getGlobalSettingsDefaults } from '../settings/settings-store.js'; +import { fieldStatusStyles } from '../common/fields/field-status.css.js'; const QUANTITY_MODEL = 'quantitySelect'; const WHAT_IS_INCLUDED = 'whatsIncluded'; -const QUANTITY_EMPTY = ''; +const QUANTITY_EMPTY = `<${QUANTITY_SELECT_TAG}/>`; const VARIANT_RTE_MARKS = { [VARIANT_NAMES.MINI]: { @@ -604,6 +605,7 @@ class MerchCardEditor extends LitElement { if (this.effectiveIsVariation) html = QUANTITY_EMPTY; } this.fragmentStore.updateField(QUANTITY_MODEL, [html]); + // on sp-checkbox uncheck Lit does not re-render, it has to be triggered manually if (!e.target.checked) this.requestUpdate(); }; @@ -778,55 +780,6 @@ class MerchCardEditor extends LitElement { --mod-switch-handle-border-color-selected-default: var(--spectrum-blue-500); } - .field-status-indicator { - display: flex; - align-items: center; - gap: 6px; - margin-top: 6px; - font-size: 14px; - line-height: 18px; - color: var(--spectrum-accent-content-color-default, #3b63fb); - } - - .field-status-icon { - color: inherit; - flex: none; - } - - .field-status-label { - color: inherit; - } - - .field-status-restore-link { - position: relative; - color: inherit; - font: inherit; - line-height: inherit; - text-decoration: underline; - cursor: pointer; - } - - .field-status-restore-link-prefix { - position: absolute; - width: 1px; - height: 1px; - padding: 0; - margin: -1px; - overflow: hidden; - clip: rect(0, 0, 0, 0); - white-space: nowrap; - border: 0; - } - - .field-status-restore-link:hover { - color: var(--spectrum-accent-content-color-hover, #2f55e0); - } - - .field-status-restore-link:focus-visible { - outline: 2px solid var(--spectrum-accent-content-color-key-focus, #2f55e0); - outline-offset: 2px; - } - .section-title { font-size: 20px; font-weight: 700; @@ -981,6 +934,8 @@ class MerchCardEditor extends LitElement { --mod-combobox-border-color-default: var(--spectrum-blue-400); --mod-combobox-background-color-default: var(--spectrum-blue-100); } + + ${fieldStatusStyles}
${this.renderSkeleton()}
@@ -1981,20 +1936,30 @@ class MerchCardEditor extends LitElement { return this.#getCompositeComponentState(QUANTITY_MODEL, parseQuantitySelectValue, component, () => this.quantityValue); } + renderQuantityOverrideIndicator() { + const qsOpeningTag = `<${QUANTITY_SELECT_TAG} `; + const parentHtml = this.localeDefaultFragment?.getFieldValue(QUANTITY_MODEL, 0) || ''; + const ownHtml = this.fragment?.getFieldValue(QUANTITY_MODEL, 0) || ''; + if (!ownHtml) return nothing; + if (ownHtml.startsWith(qsOpeningTag) && parentHtml.startsWith(qsOpeningTag)) return nothing; + return null; + } + renderQuantityComponentOverrideIndicator(component) { if (!this.effectiveIsVariation) return nothing; if (component && this.getQuantityComponentState(component) !== 'overridden') return nothing; if (!component) { - const parentHtml = this.localeDefaultFragment?.getFieldValue(QUANTITY_MODEL, 0) || ''; - const ownHtml = this.fragment?.getFieldValue(QUANTITY_MODEL, 0) || ''; - if (!ownHtml) return nothing; - if (ownHtml.startsWith(' this.resetQuantityComponentToParent(component)); } + #getQuantitySelectValue(component, field, parentValues, currentValues) { + return !component || component === field ? parentValues[field] : currentValues[field]; + } + async resetQuantityComponentToParent(component) { const parentHtml = this.localeDefaultFragment?.getFieldValue(QUANTITY_MODEL, 0) || ''; if (!component && !parentHtml) { @@ -2006,9 +1971,9 @@ class MerchCardEditor extends LitElement { const parentValues = parseQuantitySelectValue(parentHtml); const currentValues = parseQuantitySelectValue(this.quantityValue); const html = createQuantitySelectValue({ - title: !component || component === 'title' ? parentValues.title : currentValues.title, - min: !component || component === 'min' ? parentValues.min : currentValues.min, - step: !component || component === 'step' ? parentValues.step : currentValues.step, + title: this.#getQuantitySelectValue(component, 'title', parentValues, currentValues), + min: this.#getQuantitySelectValue(component, 'min', parentValues, currentValues), + step: this.#getQuantitySelectValue(component, 'step', parentValues, currentValues), }); this.fragmentStore.updateField(QUANTITY_MODEL, [html]); this.quantitySelectorValues = html; diff --git a/web-components/dist/mas.js b/web-components/dist/mas.js index 64a610edb..f8e92f75e 100644 --- a/web-components/dist/mas.js +++ b/web-components/dist/mas.js @@ -9267,7 +9267,7 @@ merch-card[border-color="spectrum-red-700-plans"] { :host(:dir(rtl)) .item.selected { background-position: left 7px center; } -`;var[x0,v0,Bn,Fn,pl,ml]=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Enter","Tab"];var Un=class extends U{static get properties(){return{closed:{type:Boolean,reflect:!0},selected:{type:Number},min:{type:Number},max:{type:Number},step:{type:Number},maxInput:{type:Number,attribute:"max-input"},options:{type:Array},highlightedIndex:{type:Number},defaultValue:{type:Number,attribute:"default-value",reflect:!0},title:{type:String}}}static get styles(){return hl}constructor(){super(),this.options=[],this.title="",this.closed=!0,this.min=0,this.max=0,this.step=0,this.maxInput=void 0,this.defaultValue=void 0,this.selectedValue=0,this.highlightedIndex=0,this.toggleMenu=this.toggleMenu.bind(this),this.closeMenu=this.closeMenu.bind(this),this.openMenu=this.openMenu.bind(this),this.handleClickOutside=this.handleClickOutside.bind(this),this.boundKeydownListener=this.handleKeydown.bind(this),this.handleKeyupDebounced=Rr(this.handleKeyup.bind(this),500),this.debouncedQuantityUpdate=Rr(this.handleQuantityUpdate.bind(this),500)}connectedCallback(){super.connectedCallback(),this.addEventListener("keydown",this.boundKeydownListener),window.addEventListener("mousedown",this.handleClickOutside),this.addEventListener(Pt,this.debouncedQuantityUpdate)}get button(){return this.shadowRoot.querySelector("button")}handleKeyup(t){t.key===Fn||t.key===Bn||(this.handleInput(),this.sendEvent())}selectValue(){if(!this.closed){let t=this.options[this.highlightedIndex];if(!t){this.closed=!0;return}this.selectedValue=t,this.handleMenuOption(this.selectedValue),this.closed=!0}}handleKeydown(t){switch(t.key){case" ":this.selectValue();break;case"Escape":this.closed=!0;break;case ml:this.selectValue();break;case Fn:this.closed?this.openMenu():this.highlightedIndex=(this.highlightedIndex+1)%this.options.length,t.preventDefault();break;case Bn:this.closed||(this.highlightedIndex=(this.highlightedIndex-1+this.options.length)%this.options.length),t.preventDefault();break;case pl:this.selectValue(),this.button.classList.contains("focused")&&t.preventDefault();break}t.composedPath().includes(this)&&t.stopPropagation()}adjustInput(t,r){this.selectedValue=r,t.value=r,this.highlightedIndex=this.options.indexOf(r)}handleInput(){let t=this.shadowRoot.querySelector(".text-field-input"),r=t.value.replace(/\D/g,"");t.value=r;let i=parseInt(r);if(!isNaN(i))if(i>0&&i!==this.selectedValue){let a=i;this.maxInput&&i>this.maxInput&&(a=this.maxInput),this.min&&a0)for(let r=this.min;r<=this.max;r+=this.step)t.push(r);return t}update(t){(t.has("min")||t.has("max")||t.has("step")||t.has("defaultValue"))&&(this.options=this.generateOptionsArray(),this.highlightedIndex=this.defaultValue?this.options.indexOf(this.defaultValue):0,this.handleMenuOption(this.defaultValue?this.defaultValue:this.options[0])),super.update(t)}handleClickOutside(t){t.composedPath().includes(this)||this.closeMenu()}toggleMenu(){this.closed=!this.closed,this.adjustPopoverPlacement(),this.closed&&(this.highlightedIndex=this.options.indexOf(this.selectedValue))}closeMenu(){this.closed=!0,this.highlightedIndex=this.options.indexOf(this.selectedValue)}openMenu(){this.closed=!1,this.adjustPopoverPlacement()}adjustPopoverPlacement(){let t=this.shadowRoot.querySelector(".popover");this.closed||t.getBoundingClientRect().bottom<=window.innerHeight?t.setAttribute("placement","bottom"):t.setAttribute("placement","top")}handleMouseEnter(t){this.highlightedIndex=t}handleMenuOption(t,r){t===this.max&&this.shadowRoot.querySelector(".text-field-input")?.focus(),this.selectedValue=t,this.sendEvent(),r&&this.closeMenu()}sendEvent(){let t=new CustomEvent(te,{detail:{option:this.selectedValue},bubbles:!0});this.dispatchEvent(t)}get offerSelect(){return this.querySelector("merch-offer-select")}get popover(){return u`
0&&i!==this.selectedValue){let a=i;this.maxInput&&i>this.maxInput&&(a=this.maxInput),this.min&&a0)for(let r=this.min;r<=this.max;r+=this.step)t.push(r);return t}update(t){(t.has("min")||t.has("max")||t.has("step")||t.has("defaultValue"))&&(this.options=this.generateOptionsArray(),this.highlightedIndex=this.defaultValue?this.options.indexOf(this.defaultValue):0,this.handleMenuOption(this.defaultValue?this.defaultValue:this.options[0])),super.update(t)}handleClickOutside(t){t.composedPath().includes(this)||this.closeMenu()}toggleMenu(){this.closed=!this.closed,this.adjustPopoverPlacement(),this.closed&&(this.highlightedIndex=this.options.indexOf(this.selectedValue))}closeMenu(){this.closed=!0,this.highlightedIndex=this.options.indexOf(this.selectedValue)}openMenu(){this.closed=!1,this.adjustPopoverPlacement()}adjustPopoverPlacement(){let t=this.shadowRoot.querySelector(".popover");this.closed||t.getBoundingClientRect().bottom<=window.innerHeight?t.setAttribute("placement","bottom"):t.setAttribute("placement","top")}handleMouseEnter(t){this.highlightedIndex=t}handleMenuOption(t,r){t===this.max&&this.shadowRoot.querySelector(".text-field-input")?.focus(),this.selectedValue=t,this.sendEvent(),r&&this.closeMenu()}sendEvent(){let t=new CustomEvent(te,{detail:{option:this.selectedValue},bubbles:!0});this.dispatchEvent(t)}get configured(){return this.title||this.min||this.step}get offerSelect(){return this.querySelector("merch-offer-select")}get popover(){return u`
`)} -
`}handleQuantityUpdate({detail:{quantity:t}}){if(t&&t!==this.selectedValue){this.selectedValue=t;let r=this.shadowRoot.querySelector(".text-field-input");r&&(r.value=t),this.sendEvent()}}onButtonFocus(t){t.target.classList.add("focused")}onButtonBlur(t){t.target.classList.remove("focused")}render(){return u` +
`}handleQuantityUpdate({detail:{quantity:t}}){if(t&&t!==this.selectedValue){this.selectedValue=t;let r=this.shadowRoot.querySelector(".text-field-input");r&&(r.value=t),this.sendEvent()}}onButtonFocus(t){t.target.classList.add("focused")}onButtonBlur(t){t.target.classList.remove("focused")}render(){return this.configured?u`
${this.title}
${this.popover}
- `}};customElements.define("merch-quantity-select",Un);Ui();P();var ul=` + `:w}};customElements.define("merch-quantity-select",Un);Ui();P();var ul=` merch-card[variant="ccd-suggested"] [slot="heading-xs"] { font-size: var(--consonant-merch-card-heading-xxs-font-size); diff --git a/web-components/dist/merch-quantity-select.js b/web-components/dist/merch-quantity-select.js index 252365fe3..c106672a7 100644 --- a/web-components/dist/merch-quantity-select.js +++ b/web-components/dist/merch-quantity-select.js @@ -1,4 +1,4 @@ -import{html as c,LitElement as b,nothing as m}from"./lit-all.min.js";import{css as _}from"./lit-all.min.js";var h=_` +import{html as c,LitElement as b,nothing as d}from"./lit-all.min.js";import{css as _}from"./lit-all.min.js";var p=_` :host { box-sizing: border-box; --background-color: var(--qs-background-color, #f6f6f6); @@ -157,7 +157,7 @@ import{html as c,LitElement as b,nothing as m}from"./lit-all.min.js";import{css :host(:dir(rtl)) .item.selected { background-position: left 7px center; } -`;var f=Object.freeze({MONTH:"MONTH",YEAR:"YEAR",TWO_YEARS:"TWO_YEARS",THREE_YEARS:"THREE_YEARS",PERPETUAL:"PERPETUAL",TERM_LICENSE:"TERM_LICENSE",ACCESS_PASS:"ACCESS_PASS",THREE_MONTHS:"THREE_MONTHS",SIX_MONTHS:"SIX_MONTHS"}),v=Object.freeze({ANNUAL:"ANNUAL",MONTHLY:"MONTHLY",TWO_YEARS:"TWO_YEARS",THREE_YEARS:"THREE_YEARS",P1D:"P1D",P1Y:"P1Y",P3Y:"P3Y",P10Y:"P10Y",P15Y:"P15Y",P3D:"P3D",P7D:"P7D",P30D:"P30D",HALF_YEARLY:"HALF_YEARLY",QUARTERLY:"QUARTERLY"});var A='span[is="inline-price"][data-wcs-osi]',T='a[is="checkout-link"][data-wcs-osi],button[is="checkout-button"][data-wcs-osi]';var x='a[is="upt-link"]',N=`${A},${T},${x}`;var p="merch-quantity-selector:change",s="merch-card-quantity:change";var S=Object.freeze({SEGMENTATION:"segmentation",BUNDLE:"bundle",COMMITMENT:"commitment",RECOMMENDATION:"recommendation",EMAIL:"email",PAYMENT:"payment",CHANGE_PLAN_TEAM_PLANS:"change-plan/team-upgrade/plans",CHANGE_PLAN_TEAM_PAYMENT:"change-plan/team-upgrade/payment"});var L=Object.freeze({STAGE:"STAGE",PRODUCTION:"PRODUCTION",LOCAL:"LOCAL"});function n(l,e){let t;return function(){let o=this,i=arguments;clearTimeout(t),t=setTimeout(()=>l.apply(o,i),e)}}var[I,P,r,a,u,E]=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Enter","Tab"];var d=class extends b{static get properties(){return{closed:{type:Boolean,reflect:!0},selected:{type:Number},min:{type:Number},max:{type:Number},step:{type:Number},maxInput:{type:Number,attribute:"max-input"},options:{type:Array},highlightedIndex:{type:Number},defaultValue:{type:Number,attribute:"default-value",reflect:!0},title:{type:String}}}static get styles(){return h}constructor(){super(),this.options=[],this.title="",this.closed=!0,this.min=0,this.max=0,this.step=0,this.maxInput=void 0,this.defaultValue=void 0,this.selectedValue=0,this.highlightedIndex=0,this.toggleMenu=this.toggleMenu.bind(this),this.closeMenu=this.closeMenu.bind(this),this.openMenu=this.openMenu.bind(this),this.handleClickOutside=this.handleClickOutside.bind(this),this.boundKeydownListener=this.handleKeydown.bind(this),this.handleKeyupDebounced=n(this.handleKeyup.bind(this),500),this.debouncedQuantityUpdate=n(this.handleQuantityUpdate.bind(this),500)}connectedCallback(){super.connectedCallback(),this.addEventListener("keydown",this.boundKeydownListener),window.addEventListener("mousedown",this.handleClickOutside),this.addEventListener(s,this.debouncedQuantityUpdate)}get button(){return this.shadowRoot.querySelector("button")}handleKeyup(e){e.key===a||e.key===r||(this.handleInput(),this.sendEvent())}selectValue(){if(!this.closed){let e=this.options[this.highlightedIndex];if(!e){this.closed=!0;return}this.selectedValue=e,this.handleMenuOption(this.selectedValue),this.closed=!0}}handleKeydown(e){switch(e.key){case" ":this.selectValue();break;case"Escape":this.closed=!0;break;case E:this.selectValue();break;case a:this.closed?this.openMenu():this.highlightedIndex=(this.highlightedIndex+1)%this.options.length,e.preventDefault();break;case r:this.closed||(this.highlightedIndex=(this.highlightedIndex-1+this.options.length)%this.options.length),e.preventDefault();break;case u:this.selectValue(),this.button.classList.contains("focused")&&e.preventDefault();break}e.composedPath().includes(this)&&e.stopPropagation()}adjustInput(e,t){this.selectedValue=t,e.value=t,this.highlightedIndex=this.options.indexOf(t)}handleInput(){let e=this.shadowRoot.querySelector(".text-field-input"),t=e.value.replace(/\D/g,"");e.value=t;let o=parseInt(t);if(!isNaN(o))if(o>0&&o!==this.selectedValue){let i=o;this.maxInput&&o>this.maxInput&&(i=this.maxInput),this.min&&i0)for(let t=this.min;t<=this.max;t+=this.step)e.push(t);return e}update(e){(e.has("min")||e.has("max")||e.has("step")||e.has("defaultValue"))&&(this.options=this.generateOptionsArray(),this.highlightedIndex=this.defaultValue?this.options.indexOf(this.defaultValue):0,this.handleMenuOption(this.defaultValue?this.defaultValue:this.options[0])),super.update(e)}handleClickOutside(e){e.composedPath().includes(this)||this.closeMenu()}toggleMenu(){this.closed=!this.closed,this.adjustPopoverPlacement(),this.closed&&(this.highlightedIndex=this.options.indexOf(this.selectedValue))}closeMenu(){this.closed=!0,this.highlightedIndex=this.options.indexOf(this.selectedValue)}openMenu(){this.closed=!1,this.adjustPopoverPlacement()}adjustPopoverPlacement(){let e=this.shadowRoot.querySelector(".popover");this.closed||e.getBoundingClientRect().bottom<=window.innerHeight?e.setAttribute("placement","bottom"):e.setAttribute("placement","top")}handleMouseEnter(e){this.highlightedIndex=e}handleMenuOption(e,t){e===this.max&&this.shadowRoot.querySelector(".text-field-input")?.focus(),this.selectedValue=e,this.sendEvent(),t&&this.closeMenu()}sendEvent(){let e=new CustomEvent(p,{detail:{option:this.selectedValue},bubbles:!0});this.dispatchEvent(e)}get offerSelect(){return this.querySelector("merch-offer-select")}get popover(){return c`
h.apply(o,i),e)}}var[I,P,r,a,E,m]=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Enter","Tab"];var l=class extends b{static get properties(){return{closed:{type:Boolean,reflect:!0},selected:{type:Number},min:{type:Number},max:{type:Number},step:{type:Number},maxInput:{type:Number,attribute:"max-input"},options:{type:Array},highlightedIndex:{type:Number},defaultValue:{type:Number,attribute:"default-value",reflect:!0},title:{type:String}}}static get styles(){return p}constructor(){super(),this.options=[],this.title="",this.closed=!0,this.min=0,this.max=0,this.step=0,this.maxInput=void 0,this.defaultValue=void 0,this.selectedValue=0,this.highlightedIndex=0,this.toggleMenu=this.toggleMenu.bind(this),this.closeMenu=this.closeMenu.bind(this),this.openMenu=this.openMenu.bind(this),this.handleClickOutside=this.handleClickOutside.bind(this),this.boundKeydownListener=this.handleKeydown.bind(this),this.handleKeyupDebounced=n(this.handleKeyup.bind(this),500),this.debouncedQuantityUpdate=n(this.handleQuantityUpdate.bind(this),500)}connectedCallback(){super.connectedCallback(),this.addEventListener("keydown",this.boundKeydownListener),window.addEventListener("mousedown",this.handleClickOutside),this.addEventListener(s,this.debouncedQuantityUpdate)}get button(){return this.shadowRoot.querySelector("button")}handleKeyup(e){e.key===a||e.key===r||(this.handleInput(),this.sendEvent())}selectValue(){if(!this.closed){let e=this.options[this.highlightedIndex];if(!e){this.closed=!0;return}this.selectedValue=e,this.handleMenuOption(this.selectedValue),this.closed=!0}}handleKeydown(e){switch(e.key){case" ":this.selectValue();break;case"Escape":this.closed=!0;break;case m:this.selectValue();break;case a:this.closed?this.openMenu():this.highlightedIndex=(this.highlightedIndex+1)%this.options.length,e.preventDefault();break;case r:this.closed||(this.highlightedIndex=(this.highlightedIndex-1+this.options.length)%this.options.length),e.preventDefault();break;case E:this.selectValue(),this.button.classList.contains("focused")&&e.preventDefault();break}e.composedPath().includes(this)&&e.stopPropagation()}adjustInput(e,t){this.selectedValue=t,e.value=t,this.highlightedIndex=this.options.indexOf(t)}handleInput(){let e=this.shadowRoot.querySelector(".text-field-input"),t=e.value.replace(/\D/g,"");e.value=t;let o=parseInt(t);if(!isNaN(o))if(o>0&&o!==this.selectedValue){let i=o;this.maxInput&&o>this.maxInput&&(i=this.maxInput),this.min&&i0)for(let t=this.min;t<=this.max;t+=this.step)e.push(t);return e}update(e){(e.has("min")||e.has("max")||e.has("step")||e.has("defaultValue"))&&(this.options=this.generateOptionsArray(),this.highlightedIndex=this.defaultValue?this.options.indexOf(this.defaultValue):0,this.handleMenuOption(this.defaultValue?this.defaultValue:this.options[0])),super.update(e)}handleClickOutside(e){e.composedPath().includes(this)||this.closeMenu()}toggleMenu(){this.closed=!this.closed,this.adjustPopoverPlacement(),this.closed&&(this.highlightedIndex=this.options.indexOf(this.selectedValue))}closeMenu(){this.closed=!0,this.highlightedIndex=this.options.indexOf(this.selectedValue)}openMenu(){this.closed=!1,this.adjustPopoverPlacement()}adjustPopoverPlacement(){let e=this.shadowRoot.querySelector(".popover");this.closed||e.getBoundingClientRect().bottom<=window.innerHeight?e.setAttribute("placement","bottom"):e.setAttribute("placement","top")}handleMouseEnter(e){this.highlightedIndex=e}handleMenuOption(e,t){e===this.max&&this.shadowRoot.querySelector(".text-field-input")?.focus(),this.selectedValue=e,this.sendEvent(),t&&this.closeMenu()}sendEvent(){let e=new CustomEvent(u,{detail:{option:this.selectedValue},bubbles:!0});this.dispatchEvent(e)}get configured(){return this.title||this.min||this.step}get offerSelect(){return this.querySelector("merch-offer-select")}get popover(){return c`
`)} -
`}handleQuantityUpdate({detail:{quantity:e}}){if(e&&e!==this.selectedValue){this.selectedValue=e;let t=this.shadowRoot.querySelector(".text-field-input");t&&(t.value=e),this.sendEvent()}}onButtonFocus(e){e.target.classList.add("focused")}onButtonBlur(e){e.target.classList.remove("focused")}render(){return c` +
`}handleQuantityUpdate({detail:{quantity:e}}){if(e&&e!==this.selectedValue){this.selectedValue=e;let t=this.shadowRoot.querySelector(".text-field-input");t&&(t.value=e),this.sendEvent()}}onButtonFocus(e){e.target.classList.add("focused")}onButtonBlur(e){e.target.classList.remove("focused")}render(){return this.configured?c`
${this.title}
- `}};customElements.define("merch-quantity-select",d);export{d as MerchQuantitySelect}; + `:d}};customElements.define("merch-quantity-select",l);export{l as MerchQuantitySelect}; diff --git a/web-components/src/merch-quantity-select.js b/web-components/src/merch-quantity-select.js index 8d77e4b95..5716ac885 100644 --- a/web-components/src/merch-quantity-select.js +++ b/web-components/src/merch-quantity-select.js @@ -246,6 +246,10 @@ export class MerchQuantitySelect extends LitElement { this.dispatchEvent(customEvent); } + get configured() { + return this.title || this.min || this.step; + } + get offerSelect() { return this.querySelector('merch-offer-select'); } @@ -302,6 +306,8 @@ export class MerchQuantitySelect extends LitElement { } render() { + if (!this.configured) return nothing; + return html`
${this.title}
From 93b5dca6dfc38d604c973413c72db3947bf8a11a Mon Sep 17 00:00:00 2001 From: Bozo Jovicic Date: Wed, 1 Apr 2026 13:31:43 +0200 Subject: [PATCH 07/17] MWPW-189463 MAS Studio: Quantity selector variation - formatting --- studio/src/common/fields/field-status.css.js | 2 +- web-components/src/merch-quantity-select.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/studio/src/common/fields/field-status.css.js b/studio/src/common/fields/field-status.css.js index 32e65baf2..2afb3f44b 100644 --- a/studio/src/common/fields/field-status.css.js +++ b/studio/src/common/fields/field-status.css.js @@ -49,4 +49,4 @@ export const fieldStatusStyles = css` outline: 2px solid var(--spectrum-accent-content-color-key-focus, #2f55e0); outline-offset: 2px; } -`; \ No newline at end of file +`; diff --git a/web-components/src/merch-quantity-select.js b/web-components/src/merch-quantity-select.js index 5716ac885..3df2e4398 100644 --- a/web-components/src/merch-quantity-select.js +++ b/web-components/src/merch-quantity-select.js @@ -248,7 +248,7 @@ export class MerchQuantitySelect extends LitElement { get configured() { return this.title || this.min || this.step; - } + } get offerSelect() { return this.querySelector('merch-offer-select'); From 107524db7fa7f5e9327eea78f1021a3799af0a8e Mon Sep 17 00:00:00 2001 From: Bozo Jovicic Date: Wed, 1 Apr 2026 17:44:40 +0200 Subject: [PATCH 08/17] MWPW-189463 MAS Studio: Quantity selector variation - IO --- io/www/src/fragment/transformers/settings.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/io/www/src/fragment/transformers/settings.js b/io/www/src/fragment/transformers/settings.js index 090e5b9e0..e43229d14 100644 --- a/io/www/src/fragment/transformers/settings.js +++ b/io/www/src/fragment/transformers/settings.js @@ -14,7 +14,7 @@ export const SETTING_NAME_DEFINITIONS = [ { name: 'secureLabel', valueType: 'optional-text', editor: 'text', propertyName: 'showSecureLabel' }, { name: 'displayAnnual', valueType: 'boolean' }, { name: 'displayPlanType', valueType: 'boolean', propertyName: 'showPlanType' }, - { name: 'quantitySelect', valueType: 'optional-text', editor: 'quantity-select' }, + { name: 'quantitySelect', valueType: 'optional-text', editor: 'quantity-select', propertyName: 'showQuantitySelect' }, ]; export const SETTING_NAME_BY_VALUE = new Map(SETTING_NAME_DEFINITIONS.map((definition) => [definition.name, definition])); From b366502ca04330188fc13c6d71bc51b53214f84e Mon Sep 17 00:00:00 2001 From: Bozo Jovicic Date: Mon, 6 Apr 2026 12:17:14 +0200 Subject: [PATCH 09/17] MWPW-189463 MAS Studio: Quantity selector variation --- io/www/src/fragment/transformers/settings.js | 2 +- studio/src/common/fields/field-status.css.js | 8 + studio/src/common/fields/quantity-select.js | 61 +++--- studio/src/editors/merch-card-editor.js | 173 ++++++++++-------- .../fields/quantity-select-settings-field.js | 91 +++++++++ .../src/reactivity/preview-fragment-store.js | 2 +- web-components/dist/mas.js | 6 +- 7 files changed, 225 insertions(+), 118 deletions(-) create mode 100644 studio/src/fields/quantity-select-settings-field.js diff --git a/io/www/src/fragment/transformers/settings.js b/io/www/src/fragment/transformers/settings.js index e43229d14..090e5b9e0 100644 --- a/io/www/src/fragment/transformers/settings.js +++ b/io/www/src/fragment/transformers/settings.js @@ -14,7 +14,7 @@ export const SETTING_NAME_DEFINITIONS = [ { name: 'secureLabel', valueType: 'optional-text', editor: 'text', propertyName: 'showSecureLabel' }, { name: 'displayAnnual', valueType: 'boolean' }, { name: 'displayPlanType', valueType: 'boolean', propertyName: 'showPlanType' }, - { name: 'quantitySelect', valueType: 'optional-text', editor: 'quantity-select', propertyName: 'showQuantitySelect' }, + { name: 'quantitySelect', valueType: 'optional-text', editor: 'quantity-select' }, ]; export const SETTING_NAME_BY_VALUE = new Map(SETTING_NAME_DEFINITIONS.map((definition) => [definition.name, definition])); diff --git a/studio/src/common/fields/field-status.css.js b/studio/src/common/fields/field-status.css.js index 2afb3f44b..d4b376303 100644 --- a/studio/src/common/fields/field-status.css.js +++ b/studio/src/common/fields/field-status.css.js @@ -49,4 +49,12 @@ export const fieldStatusStyles = css` outline: 2px solid var(--spectrum-accent-content-color-key-focus, #2f55e0); outline-offset: 2px; } + + .setting-override-indicator { + display: inline-flex; + align-items: center; + justify-content: center; + color: var(--spectrum-blue-700); + line-height: 0; + } `; diff --git a/studio/src/common/fields/quantity-select.js b/studio/src/common/fields/quantity-select.js index 44c1d0919..b4a49d434 100644 --- a/studio/src/common/fields/quantity-select.js +++ b/studio/src/common/fields/quantity-select.js @@ -1,4 +1,4 @@ -import { css, html, LitElement } from 'lit'; +import { css, html, LitElement, nothing } from 'lit'; import { fieldStatusStyles } from './field-status.css.js'; export const QUANTITY_SELECT_TAG = 'merch-quantity-select'; @@ -45,7 +45,7 @@ export class QuantitySelectField extends LitElement { step: { type: String, state: true }, layout: { type: String, reflect: true }, disabled: { type: Boolean, reflect: true }, - renderQuantityComponentOverrideIndicator: { type: Function, attribute: false }, + fieldIndicatorTemplate: { attribute: false }, }; static styles = css` @@ -53,17 +53,6 @@ export class QuantitySelectField extends LitElement { display: block; } - .fields { - display: grid; - gap: 12px; - grid-template-columns: repeat(2, minmax(0, 1fr)); - } - - :host([layout='vertical']) .fields { - display: flex; - flex-direction: column; - } - sp-field-group { width: 100%; } @@ -79,7 +68,7 @@ export class QuantitySelectField extends LitElement { this.step = '1'; this.layout = 'grid'; this.disabled = false; - this.renderQuantityComponentOverrideIndicator = () => {}; + this.fieldIndicatorTemplate = nothing; } willUpdate(changedProperties) { @@ -126,9 +115,9 @@ export class QuantitySelectField extends LitElement { render() { return html` -
- - Quantity selector title + + Quantity selector title +
- ${this.renderQuantityComponentOverrideIndicator('title')} - - - Start quantity + ${this.fieldIndicatorTemplate('title')} +
+
+ + Start quantity +
- ${this.renderQuantityComponentOverrideIndicator('min')} - -
+ ${this.fieldIndicatorTemplate('min')} +
+ Step - - ${this.renderQuantityComponentOverrideIndicator('step')} +
+ + ${this.fieldIndicatorTemplate('step')} +
`; } diff --git a/studio/src/editors/merch-card-editor.js b/studio/src/editors/merch-card-editor.js index c8ba56945..8bd45bb61 100644 --- a/studio/src/editors/merch-card-editor.js +++ b/studio/src/editors/merch-card-editor.js @@ -10,6 +10,7 @@ import '../rte/osi-field.js'; import { CARD_MODEL_PATH } from '../constants.js'; import '../fields/secure-text-field.js'; import '../fields/plan-type-field.js'; +import '../fields/quantity-select-settings-field.js'; import { getFragmentMapping, showToast } from '../utils.js'; import '../fields/addon-field.js'; import { createQuantitySelectValue, parseQuantitySelectValue, QUANTITY_SELECT_TAG } from '../common/fields/quantity-select.js'; @@ -47,14 +48,14 @@ class MerchCardEditor extends LitElement { static SECTION_FIELDS = { Visuals: ['mnemonics', 'badge', 'trialBadge', 'border-color'], - "What's included": ['whatsIncluded', 'whatsIncludedIconPicker', 'quantitySelect'], + "What's included": ['whatsIncluded', 'whatsIncludedIconPicker'], 'Product details': ['description', 'shortDescription', 'callout'], 'Footer rows': ['footerRows'], Footer: ['ctas'], - 'Options and settings': ['addon', 'planType', 'secureLabel'], + 'Options and settings': ['addon', 'planType', 'secureLabel', 'quantitySelect'], }; - static SETTINGS_FIELDS = ['addon', 'showPlanType', 'showSecureLabel']; + static SETTINGS_FIELDS = ['addon', 'showPlanType', 'showSecureLabel', 'quantitySelect']; availableSizes = []; availableColors = []; @@ -76,7 +77,9 @@ class MerchCardEditor extends LitElement { this.fieldsReady = false; this.localeSearch = ''; this.reactiveController = new ReactiveController(this, []); - this.renderQuantityComponentOverrideIndicator = this.renderQuantityComponentOverrideIndicator.bind(this); + this.renderQuantitySelectSettingOverrideIndicator = this.renderQuantitySelectSettingOverrideIndicator.bind(this); + this.resetQuantitySettingToDefault = this.resetQuantitySettingToDefault.bind(this); + this.resetSettingToDefault = this.resetSettingToDefault.bind(this); } createRenderRoot() { @@ -377,8 +380,30 @@ class MerchCardEditor extends LitElement { return restored; } - renderSettingOverrideIndicator(fieldName) { - if (!this.isSettingVisuallyOverridden(fieldName)) return nothing; + resetQuantitySettingToDefault(fieldName) { + if (this.effectiveIsVariation) { + this.resetQuantityComponentToParent(fieldName); + } else { + const parentValues = parseQuantitySelectValue(this.globalSettingsDefaults[QUANTITY_MODEL]); + const currentValues = parseQuantitySelectValue(this.quantityValue); + const html = createQuantitySelectValue({ + title: this.#getQuantitySelectValue(fieldName, 'title', parentValues, currentValues), + min: this.#getQuantitySelectValue(fieldName, 'min', parentValues, currentValues), + step: this.#getQuantitySelectValue(fieldName, 'step', parentValues, currentValues), + }); + if (this.globalSettingsDefaults[QUANTITY_MODEL] === html) { + this.fragmentStore.updateField(QUANTITY_MODEL, ['']); + } else { + this.fragmentStore.updateField(QUANTITY_MODEL, [html]); + } + } + } + + isQuantitySelectVariationOverridden() { + return !!this.fragment?.getFieldValue(QUANTITY_MODEL, 0); + } + + restoreSettingsToDefault(clickHandler, fieldName) { return html` this.resetSettingToDefault(fieldName)} + @click=${() => clickHandler(fieldName)} > `; } + renderQuantitySelectOverrideIndicator() { + if (this.isQuantitySelectVariationOverridden()) { + return this.restoreSettingsToDefault(this.resetSettingToDefault, QUANTITY_MODEL); + } + + return nothing; + } + + renderQuantitySelectSettingOverrideIndicator(field) { + const globalSettings = parseQuantitySelectValue(this.globalSettingsDefaults[QUANTITY_MODEL]); + const effectiveSettings = parseQuantitySelectValue(this.getEffectiveSettingValue(QUANTITY_MODEL)); + + if (this.effectiveIsVariation) { + const parentHtml = + this.localeDefaultFragment?.getFieldValue(QUANTITY_MODEL, 0) || + this.globalSettingsDefaults[QUANTITY_MODEL] || + ''; + const variationHtml = this.fragment?.getFieldValue(QUANTITY_MODEL, 0) || ''; + const parent = parseQuantitySelectValue(parentHtml); + const variation = parseQuantitySelectValue(variationHtml); + + if (!variationHtml || parent[field] === variation[field]) { + return nothing; + } + } else if (effectiveSettings[field] === globalSettings[field]) { + return nothing; + } + + return this.restoreSettingsToDefault(this.resetQuantitySettingToDefault, field); + } + + renderSettingOverrideIndicator(fieldName) { + if (!this.isSettingVisuallyOverridden(fieldName)) return nothing; + return this.restoreSettingsToDefault(this.resetSettingToDefault, fieldName); + } + resetAllSettings() { let restoredAny = false; for (const fieldName of MerchCardEditor.SETTINGS_FIELDS) { @@ -466,7 +527,7 @@ class MerchCardEditor extends LitElement { } #ensureSettingsLoaded() { - if (this.effectiveIsVariation) return; + if (this.effectiveIsVariation && !this.currentVariantMapping?.quantitySelect) return; const surface = Store.surface(); if (surface) { Store.settings.ensureSurfaceLoaded(surface); @@ -583,10 +644,6 @@ class MerchCardEditor extends LitElement { return value; } - get quantitySelectorDisplayed() { - return !!this.fragmentQuantityValue.trim(); - } - #handleQuantityFieldChange = (event) => { const html = event.detail?.value ?? event.currentTarget?.value; if (typeof html !== 'string') return; @@ -594,26 +651,6 @@ class MerchCardEditor extends LitElement { this.quantitySelectorValues = html; }; - #showQuantityFields = (e) => { - this.showQuantityFields(e.target.checked); - - let html = ''; - if (e.target.checked) { - html = this.quantityValue || createQuantitySelectValue({ title: '', min: '1', step: '1' }); - } else { - this.quantitySelectorValues = this.fragmentQuantityValue; - if (this.effectiveIsVariation) html = QUANTITY_EMPTY; - } - this.fragmentStore.updateField(QUANTITY_MODEL, [html]); - // on sp-checkbox uncheck Lit does not re-render, it has to be triggered manually - if (!e.target.checked) this.requestUpdate(); - }; - - showQuantityFields(show) { - const element = this.querySelector('#quantitySelector'); - if (element) element.style.display = show ? 'block' : 'none'; - } - async updated(changedProperties) { super.updated(changedProperties); if (!this.fieldsReady && this.fragment) { @@ -650,7 +687,7 @@ class MerchCardEditor extends LitElement { const field = this.querySelector(`sp-field-group.toggle#${key}`); if (field) field.style.display = 'block'; }); - this.showQuantityFields(this.quantitySelectorDisplayed); + if (variant.borderColor) { const borderField = this.querySelector('sp-field-group.toggle#border-color'); if (borderField) borderField.style.display = 'block'; @@ -875,14 +912,6 @@ class MerchCardEditor extends LitElement { --mod-link-text-color-primary-focus: var(--spectrum-accent-content-color-key-focus); } - .setting-override-indicator { - display: inline-flex; - align-items: center; - justify-content: center; - color: var(--spectrum-blue-700); - line-height: 0; - } - .setting-override-indicator:hover { color: var(--spectrum-blue-800); } @@ -1181,27 +1210,6 @@ class MerchCardEditor extends LitElement { ${this.renderFieldStatusIndicator('footerRows')} - -
Quantity selection
- Show quantity selector - ${this.renderQuantityComponentOverrideIndicator()} -
- -
-
Background Image @@ -1429,6 +1437,23 @@ class MerchCardEditor extends LitElement { @input="${this.#handleFragmentUpdate}" > + + +
@@ -1947,10 +1972,6 @@ class MerchCardEditor extends LitElement { return ownValue === parentValue ? 'inherited' : 'overridden'; } - getQuantityComponentState(component) { - return this.#getCompositeComponentState(QUANTITY_MODEL, parseQuantitySelectValue, component, () => this.quantityValue); - } - renderQuantityOverrideIndicator() { const qsOpeningTag = `<${QUANTITY_SELECT_TAG} `; const parentHtml = this.localeDefaultFragment?.getFieldValue(QUANTITY_MODEL, 0) || ''; @@ -1960,23 +1981,13 @@ class MerchCardEditor extends LitElement { return null; } - renderQuantityComponentOverrideIndicator(component) { - if (!this.effectiveIsVariation) return nothing; - if (component && this.getQuantityComponentState(component) !== 'overridden') return nothing; - if (!component) { - const overrideIndicator = this.renderQuantityOverrideIndicator(); - if (overrideIndicator) return overrideIndicator; - } - - return this.#renderOverrideIndicatorLink(() => this.resetQuantityComponentToParent(component)); - } - #getQuantitySelectValue(component, field, parentValues, currentValues) { return !component || component === field ? parentValues[field] : currentValues[field]; } async resetQuantityComponentToParent(component) { - const parentHtml = this.localeDefaultFragment?.getFieldValue(QUANTITY_MODEL, 0) || ''; + const parentHtml = + this.localeDefaultFragment?.getFieldValue(QUANTITY_MODEL, 0) || this.globalSettingsDefaults[QUANTITY_MODEL] || ''; if (!component && !parentHtml) { this.fragmentStore.updateField(QUANTITY_MODEL, [parentHtml]); this.quantitySelectorValues = parentHtml; @@ -1990,7 +2001,11 @@ class MerchCardEditor extends LitElement { min: this.#getQuantitySelectValue(component, 'min', parentValues, currentValues), step: this.#getQuantitySelectValue(component, 'step', parentValues, currentValues), }); - this.fragmentStore.updateField(QUANTITY_MODEL, [html]); + if (parentHtml === html) { + this.fragmentStore.updateField(QUANTITY_MODEL, ['']); + } else { + this.fragmentStore.updateField(QUANTITY_MODEL, [html]); + } this.quantitySelectorValues = html; showToast('Field restored to parent value', 'positive'); } diff --git a/studio/src/fields/quantity-select-settings-field.js b/studio/src/fields/quantity-select-settings-field.js new file mode 100644 index 000000000..406ee2007 --- /dev/null +++ b/studio/src/fields/quantity-select-settings-field.js @@ -0,0 +1,91 @@ +import { html, LitElement, nothing } from 'lit'; +import { EVENT_INPUT } from '../constants.js'; +import { QUANTITY_SELECT_TAG } from '../common/fields/quantity-select.js'; + +const QUANTITY_EMPTY = `<${QUANTITY_SELECT_TAG}/>`; + +export class QuantitySelectField extends LitElement { + static properties = { + id: { type: String }, + label: { type: String }, + value: { type: String }, + settingsDefaults: { type: String }, + checked: { type: Boolean, state: true }, + indicatorTemplate: { attribute: false }, + fieldIndicatorTemplate: { attribute: false }, + handleQuantityFieldChange: { type: Function, attribute: false }, + }; + + constructor() { + super(); + this.id = ''; + this.label = ''; + this.value = ''; + this.settingsDefaults = ''; + this.disabled = false; + this.checked = false; + this.indicatorTemplate = nothing; + this.fieldIndicatorTemplate = nothing; + this.handleQuantityFieldChange = () => {}; + } + + createRenderRoot() { + return this; + } + + updated(changedProperties) { + if (changedProperties.has('value')) { + this.checked = !!this.value && this.value !== QUANTITY_EMPTY; + } + } + + #handleToggle(e) { + this.checked = e.target.checked; + if (!this.checked) { + this.handleQuantityFieldChange({ + detail: { + value: QUANTITY_EMPTY, + }, + }); + } else { + this.dispatchInputEvent(); + } + } + + dispatchInputEvent() { + const inputEvent = new CustomEvent(EVENT_INPUT, { + bubbles: true, + composed: true, + detail: this, + }); + this.dispatchEvent(inputEvent); + } + + get fields() { + if (!this.checked) return nothing; + return html` + + `; + } + + render() { + if (!this.settingsDefaults) return nothing; + return html` + +
+ ${this.label} + ${this.indicatorTemplate} +
+
${this.fields}
+
+ `; + } +} + +customElements.define('quantity-select-settings-field', QuantitySelectField); diff --git a/studio/src/reactivity/preview-fragment-store.js b/studio/src/reactivity/preview-fragment-store.js index 112ad8cf2..789cc6110 100644 --- a/studio/src/reactivity/preview-fragment-store.js +++ b/studio/src/reactivity/preview-fragment-store.js @@ -2,7 +2,7 @@ import Store from '../store.js'; import { FragmentStore } from './fragment-store.js'; import { previewStudioFragment } from 'fragment-client'; import { Fragment } from '../aem/fragment.js'; -const INHERITED_SETTINGS_FIELDS = new Set(['addon', 'showPlanType', 'showSecureLabel']); +const INHERITED_SETTINGS_FIELDS = new Set(['addon', 'showPlanType', 'showSecureLabel', 'quantitySelect']); export function serializePreviewFields(fields = []) { return fields.reduce((result, field) => { diff --git a/web-components/dist/mas.js b/web-components/dist/mas.js index be6a6a0b5..65abf7395 100644 --- a/web-components/dist/mas.js +++ b/web-components/dist/mas.js @@ -9267,7 +9267,7 @@ merch-card[border-color="spectrum-red-700-plans"] { :host(:dir(rtl)) .item.selected { background-position: left 7px center; } -`;var[y0,w0,Bn,Fn,pl,ml]=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Enter","Tab"];var Un=class extends U{static get properties(){return{closed:{type:Boolean,reflect:!0},selected:{type:Number},min:{type:Number},max:{type:Number},step:{type:Number},maxInput:{type:Number,attribute:"max-input"},options:{type:Array},highlightedIndex:{type:Number},defaultValue:{type:Number,attribute:"default-value",reflect:!0},title:{type:String}}}static get styles(){return hl}constructor(){super(),this.options=[],this.title="",this.closed=!0,this.min=0,this.max=0,this.step=0,this.maxInput=void 0,this.defaultValue=void 0,this.selectedValue=0,this.highlightedIndex=0,this.toggleMenu=this.toggleMenu.bind(this),this.closeMenu=this.closeMenu.bind(this),this.openMenu=this.openMenu.bind(this),this.handleClickOutside=this.handleClickOutside.bind(this),this.boundKeydownListener=this.handleKeydown.bind(this),this.handleKeyupDebounced=Rr(this.handleKeyup.bind(this),500),this.debouncedQuantityUpdate=Rr(this.handleQuantityUpdate.bind(this),500)}connectedCallback(){super.connectedCallback(),this.addEventListener("keydown",this.boundKeydownListener),window.addEventListener("mousedown",this.handleClickOutside),this.addEventListener(Pt,this.debouncedQuantityUpdate)}get button(){return this.shadowRoot.querySelector("button")}handleKeyup(t){t.key===Fn||t.key===Bn||(this.handleInput(),this.sendEvent())}selectValue(){if(!this.closed){let t=this.options[this.highlightedIndex];if(!t){this.closed=!0;return}this.selectedValue=t,this.handleMenuOption(this.selectedValue),this.closed=!0}}handleKeydown(t){switch(t.key){case" ":this.selectValue();break;case"Escape":this.closed=!0;break;case ml:this.selectValue();break;case Fn:this.closed?this.openMenu():this.highlightedIndex=(this.highlightedIndex+1)%this.options.length,t.preventDefault();break;case Bn:this.closed||(this.highlightedIndex=(this.highlightedIndex-1+this.options.length)%this.options.length),t.preventDefault();break;case pl:this.selectValue(),this.button.classList.contains("focused")&&t.preventDefault();break}t.composedPath().includes(this)&&t.stopPropagation()}adjustInput(t,r){this.selectedValue=r,t.value=r,this.highlightedIndex=this.options.indexOf(r)}handleInput(){let t=this.shadowRoot.querySelector(".text-field-input"),r=t.value.replace(/\D/g,"");t.value=r;let i=parseInt(r);if(!isNaN(i))if(i>0&&i!==this.selectedValue){let a=i;this.maxInput&&i>this.maxInput&&(a=this.maxInput),this.min&&a0)for(let r=this.min;r<=this.max;r+=this.step)t.push(r);return t}update(t){(t.has("min")||t.has("max")||t.has("step")||t.has("defaultValue"))&&(this.options=this.generateOptionsArray(),this.highlightedIndex=this.defaultValue?this.options.indexOf(this.defaultValue):0,this.handleMenuOption(this.defaultValue?this.defaultValue:this.options[0])),super.update(t)}handleClickOutside(t){t.composedPath().includes(this)||this.closeMenu()}toggleMenu(){this.closed=!this.closed,this.adjustPopoverPlacement(),this.closed&&(this.highlightedIndex=this.options.indexOf(this.selectedValue))}closeMenu(){this.closed=!0,this.highlightedIndex=this.options.indexOf(this.selectedValue)}openMenu(){this.closed=!1,this.adjustPopoverPlacement()}adjustPopoverPlacement(){let t=this.shadowRoot.querySelector(".popover");this.closed||t.getBoundingClientRect().bottom<=window.innerHeight?t.setAttribute("placement","bottom"):t.setAttribute("placement","top")}handleMouseEnter(t){this.highlightedIndex=t}handleMenuOption(t,r){t===this.max&&this.shadowRoot.querySelector(".text-field-input")?.focus(),this.selectedValue=t,this.sendEvent(),r&&this.closeMenu()}sendEvent(){let t=new CustomEvent(te,{detail:{option:this.selectedValue},bubbles:!0});this.dispatchEvent(t)}get offerSelect(){return this.querySelector("merch-offer-select")}get popover(){return g`
0&&i!==this.selectedValue){let a=i;this.maxInput&&i>this.maxInput&&(a=this.maxInput),this.min&&a0)for(let r=this.min;r<=this.max;r+=this.step)t.push(r);return t}update(t){(t.has("min")||t.has("max")||t.has("step")||t.has("defaultValue"))&&(this.options=this.generateOptionsArray(),this.highlightedIndex=this.defaultValue?this.options.indexOf(this.defaultValue):0,this.handleMenuOption(this.defaultValue?this.defaultValue:this.options[0])),super.update(t)}handleClickOutside(t){t.composedPath().includes(this)||this.closeMenu()}toggleMenu(){this.closed=!this.closed,this.adjustPopoverPlacement(),this.closed&&(this.highlightedIndex=this.options.indexOf(this.selectedValue))}closeMenu(){this.closed=!0,this.highlightedIndex=this.options.indexOf(this.selectedValue)}openMenu(){this.closed=!1,this.adjustPopoverPlacement()}adjustPopoverPlacement(){let t=this.shadowRoot.querySelector(".popover");this.closed||t.getBoundingClientRect().bottom<=window.innerHeight?t.setAttribute("placement","bottom"):t.setAttribute("placement","top")}handleMouseEnter(t){this.highlightedIndex=t}handleMenuOption(t,r){t===this.max&&this.shadowRoot.querySelector(".text-field-input")?.focus(),this.selectedValue=t,this.sendEvent(),r&&this.closeMenu()}sendEvent(){let t=new CustomEvent(te,{detail:{option:this.selectedValue},bubbles:!0});this.dispatchEvent(t)}get configured(){return this.title||this.min||this.step}get offerSelect(){return this.querySelector("merch-offer-select")}get popover(){return g`
`)} -
`}handleQuantityUpdate({detail:{quantity:t}}){if(t&&t!==this.selectedValue){this.selectedValue=t;let r=this.shadowRoot.querySelector(".text-field-input");r&&(r.value=t),this.sendEvent()}}onButtonFocus(t){t.target.classList.add("focused")}onButtonBlur(t){t.target.classList.remove("focused")}render(){return g` +
`}handleQuantityUpdate({detail:{quantity:t}}){if(t&&t!==this.selectedValue){this.selectedValue=t;let r=this.shadowRoot.querySelector(".text-field-input");r&&(r.value=t),this.sendEvent()}}onButtonFocus(t){t.target.classList.add("focused")}onButtonBlur(t){t.target.classList.remove("focused")}render(){return this.configured?g`
${this.title}
${this.popover}
- `}};customElements.define("merch-quantity-select",Un);Ui();P();var ul=` + `:w}};customElements.define("merch-quantity-select",Un);Ui();P();var ul=` merch-card[variant="ccd-suggested"] [slot="heading-xs"] { font-size: var(--consonant-merch-card-heading-xxs-font-size); From d838d20f3f90aa1b4bbcfd1599d360285e98dd7d Mon Sep 17 00:00:00 2001 From: Bozo Jovicic Date: Mon, 6 Apr 2026 15:08:08 +0200 Subject: [PATCH 10/17] MWPW-189463 MAS Studio: Quantity selector variation --- studio/test/editors/merch-card-editor.test.html | 6 ++++++ studio/test/settings/mas-settings.test.html | 6 ++---- web-components/dist/mas.js | 14 +++++++------- web-components/dist/merch-card.js | 8 ++++---- web-components/src/hydrate.js | 12 +++++++++--- 5 files changed, 28 insertions(+), 18 deletions(-) diff --git a/studio/test/editors/merch-card-editor.test.html b/studio/test/editors/merch-card-editor.test.html index 81314d726..077134d1f 100644 --- a/studio/test/editors/merch-card-editor.test.html +++ b/studio/test/editors/merch-card-editor.test.html @@ -146,6 +146,12 @@ valueType: 'optional-text', booleanValue: false, }), + createSettingRow({ + name: 'quantitySelect', + value: '', + valueType: 'optional-text', + booleanValue: true, + }), ]; runTests(async () => { diff --git a/studio/test/settings/mas-settings.test.html b/studio/test/settings/mas-settings.test.html index e0a0a2fcf..c27411d24 100644 --- a/studio/test/settings/mas-settings.test.html +++ b/studio/test/settings/mas-settings.test.html @@ -600,10 +600,8 @@ expect(quantitySelect).to.exist; expect(quantitySelect.getAttribute('layout')).to.equal('vertical'); - const fields = quantitySelect.shadowRoot.querySelector('.fields'); - const computedFields = getComputedStyle(fields); - expect(computedFields.display).to.equal('flex'); - expect(computedFields.flexDirection).to.equal('column'); + const fieldGroups = quantitySelect.shadowRoot.querySelectorAll('sp-field-group'); + expect(fieldGroups.length).to.equal(3); const textfields = [...quantitySelect.shadowRoot.querySelectorAll('sp-textfield')]; expect(textfields.map((field) => field.getAttribute('size'))).to.deep.equal(['m', 'm', 'm']); diff --git a/web-components/dist/mas.js b/web-components/dist/mas.js index 65abf7395..1e5fd7818 100644 --- a/web-components/dist/mas.js +++ b/web-components/dist/mas.js @@ -501,9 +501,9 @@ window.masPriceLiterals = { ":type": "sheet" } .data; -var Kn=Object.defineProperty;var Qn=e=>{throw TypeError(e)};var _l=(e,t,r)=>t in e?Kn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var et=(e,t)=>()=>(e&&(t=e(e=0)),t);var Zn=(e,t)=>{for(var r in t)Kn(e,r,{get:t[r],enumerable:!0})};var m=(e,t,r)=>_l(e,typeof t!="symbol"?t+"":t,r),ta=(e,t,r)=>t.has(e)||Qn("Cannot "+r);var h=(e,t,r)=>(ta(e,t,"read from private field"),r?r.call(e):t.get(e)),E=(e,t,r)=>t.has(e)?Qn("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),y=(e,t,r,i)=>(ta(e,t,"write to private field"),i?i.call(e,r):t.set(e,r),r),Z=(e,t,r)=>(ta(e,t,"access private method"),r);var Jn=(e,t,r,i)=>({set _(a){y(e,t,a,r)},get _(){return h(e,t,i)}});var Ii,zi,hn,Gs,zr,me,b,pn,Di,mn=et(()=>{Ii=window,zi=Ii.ShadowRoot&&(Ii.ShadyCSS===void 0||Ii.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,hn=Symbol(),Gs=new WeakMap,zr=class{constructor(t,r,i){if(this._$cssResult$=!0,i!==hn)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=r}get styleSheet(){let t=this.o,r=this.t;if(zi&&t===void 0){let i=r!==void 0&&r.length===1;i&&(t=Gs.get(r)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&Gs.set(r,t))}return t}toString(){return this.cssText}},me=e=>new zr(typeof e=="string"?e:e+"",void 0,hn),b=(e,...t)=>{let r=e.length===1?e[0]:t.reduce((i,a,n)=>i+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(a)+e[n+1],e[0]);return new zr(r,e,hn)},pn=(e,t)=>{zi?e.adoptedStyleSheets=t.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet):t.forEach(r=>{let i=document.createElement("style"),a=Ii.litNonce;a!==void 0&&i.setAttribute("nonce",a),i.textContent=r.cssText,e.appendChild(i)})},Di=zi?e=>e:e=>e instanceof CSSStyleSheet?(t=>{let r="";for(let i of t.cssRules)r+=i.cssText;return me(r)})(e):e});var un,$i,qs,Hh,Vs,fn,js,gn,xn,Be,Hi=et(()=>{mn();mn();$i=window,qs=$i.trustedTypes,Hh=qs?qs.emptyScript:"",Vs=$i.reactiveElementPolyfillSupport,fn={toAttribute(e,t){switch(t){case Boolean:e=e?Hh:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let r=e;switch(t){case Boolean:r=e!==null;break;case Number:r=e===null?null:Number(e);break;case Object:case Array:try{r=JSON.parse(e)}catch{r=null}}return r}},js=(e,t)=>t!==e&&(t==t||e==e),gn={attribute:!0,type:String,converter:fn,reflect:!1,hasChanged:js},xn="finalized",Be=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(t){var r;this.finalize(),((r=this.h)!==null&&r!==void 0?r:this.h=[]).push(t)}static get observedAttributes(){this.finalize();let t=[];return this.elementProperties.forEach((r,i)=>{let a=this._$Ep(i,r);a!==void 0&&(this._$Ev.set(a,i),t.push(a))}),t}static createProperty(t,r=gn){if(r.state&&(r.attribute=!1),this.finalize(),this.elementProperties.set(t,r),!r.noAccessor&&!this.prototype.hasOwnProperty(t)){let i=typeof t=="symbol"?Symbol():"__"+t,a=this.getPropertyDescriptor(t,i,r);a!==void 0&&Object.defineProperty(this.prototype,t,a)}}static getPropertyDescriptor(t,r,i){return{get(){return this[r]},set(a){let n=this[t];this[r]=a,this.requestUpdate(t,n,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||gn}static finalize(){if(this.hasOwnProperty(xn))return!1;this[xn]=!0;let t=Object.getPrototypeOf(this);if(t.finalize(),t.h!==void 0&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){let r=this.properties,i=[...Object.getOwnPropertyNames(r),...Object.getOwnPropertySymbols(r)];for(let a of i)this.createProperty(a,r[a])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){let r=[];if(Array.isArray(t)){let i=new Set(t.flat(1/0).reverse());for(let a of i)r.unshift(Di(a))}else t!==void 0&&r.push(Di(t));return r}static _$Ep(t,r){let i=r.attribute;return i===!1?void 0:typeof i=="string"?i:typeof t=="string"?t.toLowerCase():void 0}_$Eu(){var t;this._$E_=new Promise(r=>this.enableUpdating=r),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(t=this.constructor.h)===null||t===void 0||t.forEach(r=>r(this))}addController(t){var r,i;((r=this._$ES)!==null&&r!==void 0?r:this._$ES=[]).push(t),this.renderRoot!==void 0&&this.isConnected&&((i=t.hostConnected)===null||i===void 0||i.call(t))}removeController(t){var r;(r=this._$ES)===null||r===void 0||r.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach((t,r)=>{this.hasOwnProperty(r)&&(this._$Ei.set(r,this[r]),delete this[r])})}createRenderRoot(){var t;let r=(t=this.shadowRoot)!==null&&t!==void 0?t:this.attachShadow(this.constructor.shadowRootOptions);return pn(r,this.constructor.elementStyles),r}connectedCallback(){var t;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$ES)===null||t===void 0||t.forEach(r=>{var i;return(i=r.hostConnected)===null||i===void 0?void 0:i.call(r)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$ES)===null||t===void 0||t.forEach(r=>{var i;return(i=r.hostDisconnected)===null||i===void 0?void 0:i.call(r)})}attributeChangedCallback(t,r,i){this._$AK(t,i)}_$EO(t,r,i=gn){var a;let n=this.constructor._$Ep(t,i);if(n!==void 0&&i.reflect===!0){let o=(((a=i.converter)===null||a===void 0?void 0:a.toAttribute)!==void 0?i.converter:fn).toAttribute(r,i.type);this._$El=t,o==null?this.removeAttribute(n):this.setAttribute(n,o),this._$El=null}}_$AK(t,r){var i;let a=this.constructor,n=a._$Ev.get(t);if(n!==void 0&&this._$El!==n){let o=a.getPropertyOptions(n),s=typeof o.converter=="function"?{fromAttribute:o.converter}:((i=o.converter)===null||i===void 0?void 0:i.fromAttribute)!==void 0?o.converter:fn;this._$El=n,this[n]=s.fromAttribute(r,o.type),this._$El=null}}requestUpdate(t,r,i){let a=!0;t!==void 0&&(((i=i||this.constructor.getPropertyOptions(t)).hasChanged||js)(this[t],r)?(this._$AL.has(t)||this._$AL.set(t,r),i.reflect===!0&&this._$El!==t&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(t,i))):a=!1),!this.isUpdatePending&&a&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(r){Promise.reject(r)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach((a,n)=>this[n]=a),this._$Ei=void 0);let r=!1,i=this._$AL;try{r=this.shouldUpdate(i),r?(this.willUpdate(i),(t=this._$ES)===null||t===void 0||t.forEach(a=>{var n;return(n=a.hostUpdate)===null||n===void 0?void 0:n.call(a)}),this.update(i)):this._$Ek()}catch(a){throw r=!1,this._$Ek(),a}r&&this._$AE(i)}willUpdate(t){}_$AE(t){var r;(r=this._$ES)===null||r===void 0||r.forEach(i=>{var a;return(a=i.hostUpdated)===null||a===void 0?void 0:a.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){this._$EC!==void 0&&(this._$EC.forEach((r,i)=>this._$EO(i,this[i],r)),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}};Be[xn]=!0,Be.elementProperties=new Map,Be.elementStyles=[],Be.shadowRootOptions={mode:"open"},Vs?.({ReactiveElement:Be}),((un=$i.reactiveElementVersions)!==null&&un!==void 0?un:$i.reactiveElementVersions=[]).push("1.6.3")});function ac(e,t){if(!Array.isArray(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return Ws!==void 0?Ws.createHTML(t):t}function $t(e,t,r=e,i){var a,n,o,s;if(t===Fe)return t;let c=i!==void 0?(a=r._$Co)===null||a===void 0?void 0:a[i]:r._$Cl,l=Hr(t)?void 0:t._$litDirective$;return c?.constructor!==l&&((n=c?._$AO)===null||n===void 0||n.call(c,!1),l===void 0?c=void 0:(c=new l(e),c._$AT(e,r,i)),i!==void 0?((o=(s=r)._$Co)!==null&&o!==void 0?o:s._$Co=[])[i]=c:r._$Cl=c),c!==void 0&&(t=$t(e,c._$AS(e,t.values),c,i)),t}var vn,Bi,Dt,Ws,yn,Xe,ec,Bh,bt,$r,Hr,tc,Fh,bn,Dr,Ys,Xs,xt,Ks,Qs,rc,ic,g,lf,Fe,w,Zs,vt,Uh,Br,wn,Fr,Ht,En,Gh,An,Sn,Cn,Js,nc,Ur=et(()=>{Bi=window,Dt=Bi.trustedTypes,Ws=Dt?Dt.createPolicy("lit-html",{createHTML:e=>e}):void 0,yn="$lit$",Xe=`lit$${(Math.random()+"").slice(9)}$`,ec="?"+Xe,Bh=`<${ec}>`,bt=document,$r=()=>bt.createComment(""),Hr=e=>e===null||typeof e!="object"&&typeof e!="function",tc=Array.isArray,Fh=e=>tc(e)||typeof e?.[Symbol.iterator]=="function",bn=`[ +var Kn=Object.defineProperty;var Qn=e=>{throw TypeError(e)};var _l=(e,t,r)=>t in e?Kn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var et=(e,t)=>()=>(e&&(t=e(e=0)),t);var Zn=(e,t)=>{for(var r in t)Kn(e,r,{get:t[r],enumerable:!0})};var m=(e,t,r)=>_l(e,typeof t!="symbol"?t+"":t,r),ta=(e,t,r)=>t.has(e)||Qn("Cannot "+r);var h=(e,t,r)=>(ta(e,t,"read from private field"),r?r.call(e):t.get(e)),E=(e,t,r)=>t.has(e)?Qn("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),y=(e,t,r,i)=>(ta(e,t,"write to private field"),i?i.call(e,r):t.set(e,r),r),Z=(e,t,r)=>(ta(e,t,"access private method"),r);var Jn=(e,t,r,i)=>({set _(a){y(e,t,a,r)},get _(){return h(e,t,i)}});var Ii,zi,hn,Gs,zr,me,b,pn,Di,mn=et(()=>{Ii=window,zi=Ii.ShadowRoot&&(Ii.ShadyCSS===void 0||Ii.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,hn=Symbol(),Gs=new WeakMap,zr=class{constructor(t,r,i){if(this._$cssResult$=!0,i!==hn)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=r}get styleSheet(){let t=this.o,r=this.t;if(zi&&t===void 0){let i=r!==void 0&&r.length===1;i&&(t=Gs.get(r)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&Gs.set(r,t))}return t}toString(){return this.cssText}},me=e=>new zr(typeof e=="string"?e:e+"",void 0,hn),b=(e,...t)=>{let r=e.length===1?e[0]:t.reduce((i,a,n)=>i+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(a)+e[n+1],e[0]);return new zr(r,e,hn)},pn=(e,t)=>{zi?e.adoptedStyleSheets=t.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet):t.forEach(r=>{let i=document.createElement("style"),a=Ii.litNonce;a!==void 0&&i.setAttribute("nonce",a),i.textContent=r.cssText,e.appendChild(i)})},Di=zi?e=>e:e=>e instanceof CSSStyleSheet?(t=>{let r="";for(let i of t.cssRules)r+=i.cssText;return me(r)})(e):e});var un,$i,qs,Hh,Vs,fn,js,gn,xn,Be,Hi=et(()=>{mn();mn();$i=window,qs=$i.trustedTypes,Hh=qs?qs.emptyScript:"",Vs=$i.reactiveElementPolyfillSupport,fn={toAttribute(e,t){switch(t){case Boolean:e=e?Hh:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let r=e;switch(t){case Boolean:r=e!==null;break;case Number:r=e===null?null:Number(e);break;case Object:case Array:try{r=JSON.parse(e)}catch{r=null}}return r}},js=(e,t)=>t!==e&&(t==t||e==e),gn={attribute:!0,type:String,converter:fn,reflect:!1,hasChanged:js},xn="finalized",Be=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(t){var r;this.finalize(),((r=this.h)!==null&&r!==void 0?r:this.h=[]).push(t)}static get observedAttributes(){this.finalize();let t=[];return this.elementProperties.forEach((r,i)=>{let a=this._$Ep(i,r);a!==void 0&&(this._$Ev.set(a,i),t.push(a))}),t}static createProperty(t,r=gn){if(r.state&&(r.attribute=!1),this.finalize(),this.elementProperties.set(t,r),!r.noAccessor&&!this.prototype.hasOwnProperty(t)){let i=typeof t=="symbol"?Symbol():"__"+t,a=this.getPropertyDescriptor(t,i,r);a!==void 0&&Object.defineProperty(this.prototype,t,a)}}static getPropertyDescriptor(t,r,i){return{get(){return this[r]},set(a){let n=this[t];this[r]=a,this.requestUpdate(t,n,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||gn}static finalize(){if(this.hasOwnProperty(xn))return!1;this[xn]=!0;let t=Object.getPrototypeOf(this);if(t.finalize(),t.h!==void 0&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){let r=this.properties,i=[...Object.getOwnPropertyNames(r),...Object.getOwnPropertySymbols(r)];for(let a of i)this.createProperty(a,r[a])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){let r=[];if(Array.isArray(t)){let i=new Set(t.flat(1/0).reverse());for(let a of i)r.unshift(Di(a))}else t!==void 0&&r.push(Di(t));return r}static _$Ep(t,r){let i=r.attribute;return i===!1?void 0:typeof i=="string"?i:typeof t=="string"?t.toLowerCase():void 0}_$Eu(){var t;this._$E_=new Promise(r=>this.enableUpdating=r),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(t=this.constructor.h)===null||t===void 0||t.forEach(r=>r(this))}addController(t){var r,i;((r=this._$ES)!==null&&r!==void 0?r:this._$ES=[]).push(t),this.renderRoot!==void 0&&this.isConnected&&((i=t.hostConnected)===null||i===void 0||i.call(t))}removeController(t){var r;(r=this._$ES)===null||r===void 0||r.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach((t,r)=>{this.hasOwnProperty(r)&&(this._$Ei.set(r,this[r]),delete this[r])})}createRenderRoot(){var t;let r=(t=this.shadowRoot)!==null&&t!==void 0?t:this.attachShadow(this.constructor.shadowRootOptions);return pn(r,this.constructor.elementStyles),r}connectedCallback(){var t;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$ES)===null||t===void 0||t.forEach(r=>{var i;return(i=r.hostConnected)===null||i===void 0?void 0:i.call(r)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$ES)===null||t===void 0||t.forEach(r=>{var i;return(i=r.hostDisconnected)===null||i===void 0?void 0:i.call(r)})}attributeChangedCallback(t,r,i){this._$AK(t,i)}_$EO(t,r,i=gn){var a;let n=this.constructor._$Ep(t,i);if(n!==void 0&&i.reflect===!0){let o=(((a=i.converter)===null||a===void 0?void 0:a.toAttribute)!==void 0?i.converter:fn).toAttribute(r,i.type);this._$El=t,o==null?this.removeAttribute(n):this.setAttribute(n,o),this._$El=null}}_$AK(t,r){var i;let a=this.constructor,n=a._$Ev.get(t);if(n!==void 0&&this._$El!==n){let o=a.getPropertyOptions(n),s=typeof o.converter=="function"?{fromAttribute:o.converter}:((i=o.converter)===null||i===void 0?void 0:i.fromAttribute)!==void 0?o.converter:fn;this._$El=n,this[n]=s.fromAttribute(r,o.type),this._$El=null}}requestUpdate(t,r,i){let a=!0;t!==void 0&&(((i=i||this.constructor.getPropertyOptions(t)).hasChanged||js)(this[t],r)?(this._$AL.has(t)||this._$AL.set(t,r),i.reflect===!0&&this._$El!==t&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(t,i))):a=!1),!this.isUpdatePending&&a&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(r){Promise.reject(r)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach((a,n)=>this[n]=a),this._$Ei=void 0);let r=!1,i=this._$AL;try{r=this.shouldUpdate(i),r?(this.willUpdate(i),(t=this._$ES)===null||t===void 0||t.forEach(a=>{var n;return(n=a.hostUpdate)===null||n===void 0?void 0:n.call(a)}),this.update(i)):this._$Ek()}catch(a){throw r=!1,this._$Ek(),a}r&&this._$AE(i)}willUpdate(t){}_$AE(t){var r;(r=this._$ES)===null||r===void 0||r.forEach(i=>{var a;return(a=i.hostUpdated)===null||a===void 0?void 0:a.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){this._$EC!==void 0&&(this._$EC.forEach((r,i)=>this._$EO(i,this[i],r)),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}};Be[xn]=!0,Be.elementProperties=new Map,Be.elementStyles=[],Be.shadowRootOptions={mode:"open"},Vs?.({ReactiveElement:Be}),((un=$i.reactiveElementVersions)!==null&&un!==void 0?un:$i.reactiveElementVersions=[]).push("1.6.3")});function ac(e,t){if(!Array.isArray(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return Ws!==void 0?Ws.createHTML(t):t}function $t(e,t,r=e,i){var a,n,o,s;if(t===Fe)return t;let c=i!==void 0?(a=r._$Co)===null||a===void 0?void 0:a[i]:r._$Cl,l=Hr(t)?void 0:t._$litDirective$;return c?.constructor!==l&&((n=c?._$AO)===null||n===void 0||n.call(c,!1),l===void 0?c=void 0:(c=new l(e),c._$AT(e,r,i)),i!==void 0?((o=(s=r)._$Co)!==null&&o!==void 0?o:s._$Co=[])[i]=c:r._$Cl=c),c!==void 0&&(t=$t(e,c._$AS(e,t.values),c,i)),t}var vn,Bi,Dt,Ws,yn,Xe,ec,Bh,bt,$r,Hr,tc,Fh,bn,Dr,Ys,Xs,xt,Ks,Qs,rc,ic,g,df,Fe,w,Zs,vt,Uh,Br,wn,Fr,Ht,En,Gh,An,Sn,Cn,Js,nc,Ur=et(()=>{Bi=window,Dt=Bi.trustedTypes,Ws=Dt?Dt.createPolicy("lit-html",{createHTML:e=>e}):void 0,yn="$lit$",Xe=`lit$${(Math.random()+"").slice(9)}$`,ec="?"+Xe,Bh=`<${ec}>`,bt=document,$r=()=>bt.createComment(""),Hr=e=>e===null||typeof e!="object"&&typeof e!="function",tc=Array.isArray,Fh=e=>tc(e)||typeof e?.[Symbol.iterator]=="function",bn=`[ \f\r]`,Dr=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Ys=/-->/g,Xs=/>/g,xt=RegExp(`>|${bn}(?:([^\\s"'>=/]+)(${bn}*=${bn}*(?:[^ -\f\r"'\`<>=]|("|')|))|$)`,"g"),Ks=/'/g,Qs=/"/g,rc=/^(?:script|style|textarea|title)$/i,ic=e=>(t,...r)=>({_$litType$:e,strings:t,values:r}),g=ic(1),lf=ic(2),Fe=Symbol.for("lit-noChange"),w=Symbol.for("lit-nothing"),Zs=new WeakMap,vt=bt.createTreeWalker(bt,129,null,!1);Uh=(e,t)=>{let r=e.length-1,i=[],a,n=t===2?"":"",o=Dr;for(let s=0;s"?(o=a??Dr,p=-1):d[1]===void 0?p=-2:(p=o.lastIndex-d[2].length,l=d[1],o=d[3]===void 0?xt:d[3]==='"'?Qs:Ks):o===Qs||o===Ks?o=xt:o===Ys||o===Xs?o=Dr:(o=xt,a=void 0);let f=o===xt&&e[s+1].startsWith("/>")?" ":"";n+=o===Dr?c+Bh:p>=0?(i.push(l),c.slice(0,p)+yn+c.slice(p)+Xe+f):c+Xe+(p===-2?(i.push(void 0),s):f)}return[ac(e,n+(e[r]||"")+(t===2?"":"")),i]},Br=class e{constructor({strings:t,_$litType$:r},i){let a;this.parts=[];let n=0,o=0,s=t.length-1,c=this.parts,[l,d]=Uh(t,r);if(this.el=e.createElement(l,i),vt.currentNode=this.el.content,r===2){let p=this.el.content,u=p.firstChild;u.remove(),p.append(...u.childNodes)}for(;(a=vt.nextNode())!==null&&c.length0){a.textContent=Dt?Dt.emptyScript:"";for(let f=0;f2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=w}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,r=this,i,a){let n=this.strings,o=!1;if(n===void 0)t=$t(this,t,r,0),o=!Hr(t)||t!==this._$AH&&t!==Fe,o&&(this._$AH=t);else{let s=t,c,l;for(t=n[0],c=0;c{var i,a;let n=(i=r?.renderBefore)!==null&&i!==void 0?i:t,o=n._$litPart$;if(o===void 0){let s=(a=r?.renderBefore)!==null&&a!==void 0?a:null;n._$litPart$=o=new Fr(t.insertBefore($r(),s),s,void 0,r??{})}return o._$AI(e),o}});var Tn,kn,U,oc,sc=et(()=>{Hi();Hi();Ur();Ur();U=class extends Be{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,r;let i=super.createRenderRoot();return(t=(r=this.renderOptions).renderBefore)!==null&&t!==void 0||(r.renderBefore=i.firstChild),i}update(t){let r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=nc(r,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)===null||t===void 0||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)===null||t===void 0||t.setConnected(!1)}render(){return Fe}};U.finalized=!0,U._$litElement$=!0,(Tn=globalThis.litElementHydrateSupport)===null||Tn===void 0||Tn.call(globalThis,{LitElement:U});oc=globalThis.litElementPolyfillSupport;oc?.({LitElement:U});((kn=globalThis.litElementVersions)!==null&&kn!==void 0?kn:globalThis.litElementVersions=[]).push("3.3.3")});var cc=et(()=>{});var P=et(()=>{Hi();Ur();sc();cc()});var _n={};Zn(_n,{default:()=>Gr});function qh(){return customElements.get("sp-tooltip")!==void 0&&customElements.get("overlay-trigger")!==void 0&&document.querySelector("sp-theme")!==null}var ue,Gr,Ui=et(()=>{P();ue=class ue extends U{constructor(){super(),this.content="",this.placement="top",this.variant="info",this.size="xs",this.tooltipVisible=!1,this.lastPointerType=null,this.handleClickOutside=this.handleClickOutside.bind(this)}connectedCallback(){super.connectedCallback(),window.addEventListener("mousedown",this.handleClickOutside)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("mousedown",this.handleClickOutside)}handleClickOutside(t){let r=t.composedPath();ue.activeTooltip===this&&!r.includes(this)&&this.hideTooltip()}showTooltip(){ue.activeTooltip&&ue.activeTooltip!==this&&(ue.activeTooltip.closeOverlay(),ue.activeTooltip.tooltipVisible=!1,ue.activeTooltip.requestUpdate()),ue.activeTooltip=this,this.tooltipVisible=!0}hideTooltip(){ue.activeTooltip===this&&(ue.activeTooltip=null),this.tooltipVisible=!1}handleTap(t){t.preventDefault(),this.tooltipVisible?this.hideTooltip():this.showTooltip()}closeOverlay(){let t=this.shadowRoot?.querySelector("overlay-trigger");t?.open!==void 0&&(t.open=!1)}get effectiveContent(){return this.tooltipText||this.mnemonicText||this.content||""}get effectivePlacement(){return this.tooltipPlacement||this.mnemonicPlacement||this.placement||"top"}renderIcon(){return this.src?g`=]|("|')|))|$)`,"g"),Ks=/'/g,Qs=/"/g,rc=/^(?:script|style|textarea|title)$/i,ic=e=>(t,...r)=>({_$litType$:e,strings:t,values:r}),g=ic(1),df=ic(2),Fe=Symbol.for("lit-noChange"),w=Symbol.for("lit-nothing"),Zs=new WeakMap,vt=bt.createTreeWalker(bt,129,null,!1);Uh=(e,t)=>{let r=e.length-1,i=[],a,n=t===2?"":"",o=Dr;for(let s=0;s"?(o=a??Dr,p=-1):d[1]===void 0?p=-2:(p=o.lastIndex-d[2].length,l=d[1],o=d[3]===void 0?xt:d[3]==='"'?Qs:Ks):o===Qs||o===Ks?o=xt:o===Ys||o===Xs?o=Dr:(o=xt,a=void 0);let f=o===xt&&e[s+1].startsWith("/>")?" ":"";n+=o===Dr?c+Bh:p>=0?(i.push(l),c.slice(0,p)+yn+c.slice(p)+Xe+f):c+Xe+(p===-2?(i.push(void 0),s):f)}return[ac(e,n+(e[r]||"")+(t===2?"":"")),i]},Br=class e{constructor({strings:t,_$litType$:r},i){let a;this.parts=[];let n=0,o=0,s=t.length-1,c=this.parts,[l,d]=Uh(t,r);if(this.el=e.createElement(l,i),vt.currentNode=this.el.content,r===2){let p=this.el.content,u=p.firstChild;u.remove(),p.append(...u.childNodes)}for(;(a=vt.nextNode())!==null&&c.length0){a.textContent=Dt?Dt.emptyScript:"";for(let f=0;f2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=w}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,r=this,i,a){let n=this.strings,o=!1;if(n===void 0)t=$t(this,t,r,0),o=!Hr(t)||t!==this._$AH&&t!==Fe,o&&(this._$AH=t);else{let s=t,c,l;for(t=n[0],c=0;c{var i,a;let n=(i=r?.renderBefore)!==null&&i!==void 0?i:t,o=n._$litPart$;if(o===void 0){let s=(a=r?.renderBefore)!==null&&a!==void 0?a:null;n._$litPart$=o=new Fr(t.insertBefore($r(),s),s,void 0,r??{})}return o._$AI(e),o}});var Tn,kn,U,oc,sc=et(()=>{Hi();Hi();Ur();Ur();U=class extends Be{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,r;let i=super.createRenderRoot();return(t=(r=this.renderOptions).renderBefore)!==null&&t!==void 0||(r.renderBefore=i.firstChild),i}update(t){let r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=nc(r,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)===null||t===void 0||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)===null||t===void 0||t.setConnected(!1)}render(){return Fe}};U.finalized=!0,U._$litElement$=!0,(Tn=globalThis.litElementHydrateSupport)===null||Tn===void 0||Tn.call(globalThis,{LitElement:U});oc=globalThis.litElementPolyfillSupport;oc?.({LitElement:U});((kn=globalThis.litElementVersions)!==null&&kn!==void 0?kn:globalThis.litElementVersions=[]).push("3.3.3")});var cc=et(()=>{});var P=et(()=>{Hi();Ur();sc();cc()});var _n={};Zn(_n,{default:()=>Gr});function qh(){return customElements.get("sp-tooltip")!==void 0&&customElements.get("overlay-trigger")!==void 0&&document.querySelector("sp-theme")!==null}var ue,Gr,Ui=et(()=>{P();ue=class ue extends U{constructor(){super(),this.content="",this.placement="top",this.variant="info",this.size="xs",this.tooltipVisible=!1,this.lastPointerType=null,this.handleClickOutside=this.handleClickOutside.bind(this)}connectedCallback(){super.connectedCallback(),window.addEventListener("mousedown",this.handleClickOutside)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("mousedown",this.handleClickOutside)}handleClickOutside(t){let r=t.composedPath();ue.activeTooltip===this&&!r.includes(this)&&this.hideTooltip()}showTooltip(){ue.activeTooltip&&ue.activeTooltip!==this&&(ue.activeTooltip.closeOverlay(),ue.activeTooltip.tooltipVisible=!1,ue.activeTooltip.requestUpdate()),ue.activeTooltip=this,this.tooltipVisible=!0}hideTooltip(){ue.activeTooltip===this&&(ue.activeTooltip=null),this.tooltipVisible=!1}handleTap(t){t.preventDefault(),this.tooltipVisible?this.hideTooltip():this.showTooltip()}closeOverlay(){let t=this.shadowRoot?.querySelector("overlay-trigger");t?.open!==void 0&&(t.open=!1)}get effectiveContent(){return this.tooltipText||this.mnemonicText||this.content||""}get effectivePlacement(){return this.tooltipPlacement||this.mnemonicPlacement||this.placement||"top"}renderIcon(){return this.src?g``:g``}render(){let t=this.effectiveContent,r=this.effectivePlacement;return t?qh()?g` @@ -652,7 +652,7 @@ var Kn=Object.defineProperty;var Qn=e=>{throw TypeError(e)};var _l=(e,t,r)=>t in margin-left: 5px; border-right-color: var(--spectrum-gray-800, #323232); } - `);Gr=ue;customElements.define("mas-mnemonic",Gr)});var tt={clientId:"merch-at-scale",delimiter:"\xB6",ignoredProperties:["analytics","literals","element"],serializableTypes:["Array","Object"],sampleRate:1,severity:"e",tags:"acom",isProdDomain:!1},eo=1e3;function Pl(e){return e instanceof Error||typeof e?.originatingRequest=="string"}function to(e){if(e==null)return;let t=typeof e;if(t==="function")return e.name?`function ${e.name}`:"function";if(t==="object"){if(e instanceof Error)return e.message;if(typeof e.originatingRequest=="string"){let{message:i,originatingRequest:a,status:n}=e;return[i,n,a].filter(Boolean).join(" ")}let r=e[Symbol.toStringTag]??Object.getPrototypeOf(e).constructor.name;if(!tt.serializableTypes.includes(r))return r}return e}function Ll(e,t){if(!tt.ignoredProperties.includes(e))return to(t)}var ra={append(e){if(e.level!=="error")return;let{message:t,params:r}=e,i=[],a=[],n=t;r.forEach(l=>{l!=null&&(Pl(l)?i:a).push(l)}),i.length&&(n+=" "+i.map(to).join(" "));let{pathname:o,search:s}=window.location,c=`${tt.delimiter}page=${o}${s}`;c.length>eo&&(c=`${c.slice(0,eo)}`),n+=c,a.length&&(n+=`${tt.delimiter}facts=`,n+=JSON.stringify(a,Ll)),window.lana?.log(n,tt)}};function si(e){Object.assign(tt,Object.fromEntries(Object.entries(e).filter(([t,r])=>t in tt&&r!==""&&r!==null&&r!==void 0&&!Number.isNaN(r))))}var ya={};Zn(ya,{CLASS_NAME_FAILED:()=>oa,CLASS_NAME_HIDDEN:()=>Rl,CLASS_NAME_PENDING:()=>sa,CLASS_NAME_RESOLVED:()=>ca,CheckoutWorkflow:()=>io,CheckoutWorkflowStep:()=>ce,Commitment:()=>rt,ERROR_MESSAGE_BAD_REQUEST:()=>la,ERROR_MESSAGE_MISSING_LITERALS_URL:()=>Ul,ERROR_MESSAGE_OFFER_NOT_FOUND:()=>da,EVENT_AEM_ERROR:()=>nt,EVENT_AEM_LOAD:()=>at,EVENT_MAS_ERROR:()=>na,EVENT_MAS_READY:()=>fr,EVENT_MERCH_ADDON_AND_QUANTITY_UPDATE:()=>li,EVENT_MERCH_CARD_ACTION_MENU_TOGGLE:()=>ia,EVENT_MERCH_CARD_COLLECTION_LITERALS_CHANGED:()=>it,EVENT_MERCH_CARD_COLLECTION_SHOWMORE:()=>Bl,EVENT_MERCH_CARD_COLLECTION_SIDENAV_ATTACHED:()=>Hl,EVENT_MERCH_CARD_COLLECTION_SORT:()=>$l,EVENT_MERCH_CARD_QUANTITY_CHANGE:()=>Pt,EVENT_MERCH_OFFER_READY:()=>_t,EVENT_MERCH_OFFER_SELECT_READY:()=>gr,EVENT_MERCH_QUANTITY_SELECTOR_CHANGE:()=>te,EVENT_MERCH_SEARCH_CHANGE:()=>Dl,EVENT_MERCH_SIDENAV_SELECT:()=>Fl,EVENT_MERCH_STOCK_CHANGE:()=>Il,EVENT_MERCH_STORAGE_CHANGE:()=>zl,EVENT_OFFER_SELECTED:()=>aa,EVENT_TYPE_FAILED:()=>ha,EVENT_TYPE_READY:()=>ci,EVENT_TYPE_RESOLVED:()=>Lt,Env:()=>Me,FF_ANNUAL_PRICE:()=>Mt,FF_DEFAULTS:()=>Te,HEADER_X_REQUEST_ID:()=>xr,LOG_NAMESPACE:()=>pa,Landscape:()=>Ve,MARK_DURATION_SUFFIX:()=>ct,MARK_START_SUFFIX:()=>st,MODAL_TYPE_3_IN_1:()=>ot,NAMESPACE:()=>Ml,PARAM_AOS_API_KEY:()=>Gl,PARAM_ENV:()=>ua,PARAM_LANDSCAPE:()=>ga,PARAM_MAS_PREVIEW:()=>ma,PARAM_WCS_API_KEY:()=>ql,PROVIDER_ENVIRONMENT:()=>va,SELECTOR_MAS_CHECKOUT_LINK:()=>Se,SELECTOR_MAS_ELEMENT:()=>ur,SELECTOR_MAS_INLINE_PRICE:()=>D,SELECTOR_MAS_SP_BUTTON:()=>Nl,SELECTOR_MAS_UPT_LINK:()=>ro,SORT_ORDER:()=>Yl,STATE_FAILED:()=>Ce,STATE_PENDING:()=>qe,STATE_RESOLVED:()=>ze,SUPPORTED_COUNTRIES:()=>ba,TAG_NAME_SERVICE:()=>Ol,TEMPLATE_PRICE:()=>Vl,TEMPLATE_PRICE_ANNUAL:()=>Wl,TEMPLATE_PRICE_LEGAL:()=>xe,TEMPLATE_PRICE_STRIKETHROUGH:()=>jl,Term:()=>ye,WCS_PROD_URL:()=>fa,WCS_STAGE_URL:()=>xa});var rt=Object.freeze({MONTH:"MONTH",YEAR:"YEAR",TWO_YEARS:"TWO_YEARS",THREE_YEARS:"THREE_YEARS",PERPETUAL:"PERPETUAL",TERM_LICENSE:"TERM_LICENSE",ACCESS_PASS:"ACCESS_PASS",THREE_MONTHS:"THREE_MONTHS",SIX_MONTHS:"SIX_MONTHS"}),ye=Object.freeze({ANNUAL:"ANNUAL",MONTHLY:"MONTHLY",TWO_YEARS:"TWO_YEARS",THREE_YEARS:"THREE_YEARS",P1D:"P1D",P1Y:"P1Y",P3Y:"P3Y",P10Y:"P10Y",P15Y:"P15Y",P3D:"P3D",P7D:"P7D",P30D:"P30D",HALF_YEARLY:"HALF_YEARLY",QUARTERLY:"QUARTERLY"}),Ml="merch",Rl="hidden",ci="wcms:commerce:ready",Ol="mas-commerce-service",D='span[is="inline-price"][data-wcs-osi]',Se='a[is="checkout-link"][data-wcs-osi],button[is="checkout-button"][data-wcs-osi]',Nl="sp-button[data-wcs-osi]",ro='a[is="upt-link"]',ur=`${D},${Se},${ro}`,_t="merch-offer:ready",gr="merch-offer-select:ready",ia="merch-card:action-menu-toggle",aa="merch-offer:selected",Il="merch-stock:change",zl="merch-storage:change",te="merch-quantity-selector:change",Pt="merch-card-quantity:change",li="merch-modal:addon-and-quantity-update",Dl="merch-search:change",$l="merch-card-collection:sort",it="merch-card-collection:literals-changed",Hl="merch-card-collection:sidenav-attached",Bl="merch-card-collection:showmore",Fl="merch-sidenav:select",at="aem:load",nt="aem:error",fr="mas:ready",na="mas:error",oa="placeholder-failed",sa="placeholder-pending",ca="placeholder-resolved",la="Bad WCS request",da="Commerce offer not found",Ul="Literals URL not provided",ha="mas:failed",Lt="mas:resolved",pa="mas/commerce",ma="mas.preview",ua="commerce.env",ga="commerce.landscape",Gl="commerce.aosKey",ql="commerce.wcsKey",fa="https://www.adobe.com/web_commerce_artifact",xa="https://www.stage.adobe.com/web_commerce_artifact_stage",Ce="failed",qe="pending",ze="resolved",Ve={DRAFT:"DRAFT",PUBLISHED:"PUBLISHED"},xr="X-Request-Id",ce=Object.freeze({SEGMENTATION:"segmentation",BUNDLE:"bundle",COMMITMENT:"commitment",RECOMMENDATION:"recommendation",EMAIL:"email",PAYMENT:"payment",CHANGE_PLAN_TEAM_PLANS:"change-plan/team-upgrade/plans",CHANGE_PLAN_TEAM_PAYMENT:"change-plan/team-upgrade/payment"}),io="UCv3",Me=Object.freeze({STAGE:"STAGE",PRODUCTION:"PRODUCTION",LOCAL:"LOCAL"}),va={PRODUCTION:"PRODUCTION"},ot={TWP:"twp",D2P:"d2p",CRM:"crm"},st=":start",ct=":duration",Vl="price",jl="price-strikethrough",Wl="annual",xe="legal",Te="mas-ff-defaults",Mt="mas-ff-annual-price",Yl={alphabetical:"alphabetical",authored:"authored"},ba=["AE","AM","AR","AT","AU","AZ","BB","BD","BE","BG","BH","BO","BR","BS","BY","CA","CH","CL","CN","CO","CR","CY","CZ","DE","DK","DO","DZ","EC","EE","EG","ES","FI","FR","GB","GE","GH","GR","GT","HK","HN","HR","HU","ID","IE","IL","IN","IQ","IS","IT","JM","JO","JP","KE","KG","KR","KW","KZ","LA","LB","LK","LT","LU","LV","MA","MD","MO","MT","MU","MX","MY","NG","NI","NL","NO","NP","NZ","OM","PA","PE","PH","PK","PL","PR","PT","PY","QA","RO","RS","RU","SA","SE","SG","SI","SK","SV","TH","TJ","TM","TN","TR","TT","TW","TZ","UA","US","UY","UZ","VE","VN","YE","ZA"];var ao="tacocat.js";var wa=(e,t)=>String(e??"").toLowerCase()==String(t??"").toLowerCase(),no=e=>`${e??""}`.replace(/[&<>'"]/g,t=>({"&":"&","<":"<",">":">","'":"'",'"':"""})[t]??t)??"";function F(e,t={},{metadata:r=!0,search:i=!0,storage:a=!0}={}){let n;if(i&&n==null){let o=new URLSearchParams(window.location.search),s=Rt(i)?i:e;n=o.get(s)}if(a&&n==null){let o=Rt(a)?a:e;n=window.sessionStorage.getItem(o)??window.localStorage.getItem(o)}if(r&&n==null){let o=Kl(Rt(r)?r:e);n=document.documentElement.querySelector(`meta[name="${o}"]`)?.content}return n??t[e]}var Xl=e=>typeof e=="boolean",di=e=>typeof e=="function",hi=e=>typeof e=="number",oo=e=>e!=null&&typeof e=="object";var Rt=e=>typeof e=="string",so=e=>Rt(e)&&e,vr=e=>hi(e)&&Number.isFinite(e)&&e>0;function pi(e,t=r=>r==null||r===""){return e!=null&&Object.entries(e).forEach(([r,i])=>{t(i)&&delete e[r]}),e}function T(e,t){if(Xl(e))return e;let r=String(e);return r==="1"||r==="true"?!0:r==="0"||r==="false"?!1:t}function br(e,t,r){let i=Object.values(t);return i.find(a=>wa(a,e))??r??i[0]}function Kl(e=""){return String(e).replace(/(\p{Lowercase_Letter})(\p{Uppercase_Letter})/gu,(t,r,i)=>`${r}-${i}`).replace(/\W+/gu,"-").toLowerCase()}function co(e,t=1){return hi(e)||(e=Number.parseInt(e,10)),!Number.isNaN(e)&&e>0&&Number.isFinite(e)?e:t}var Ql=Date.now(),Ea=()=>`(+${Date.now()-Ql}ms)`,mi=new Set,Zl=T(F("tacocat.debug",{},{metadata:!1}),!1);function lo(e){let t=`[${ao}/${e}]`,r=(o,s,...c)=>o?!0:(a(s,...c),!1),i=Zl?(o,...s)=>{console.debug(`${t} ${o}`,...s,Ea())}:()=>{},a=(o,...s)=>{let c=`${t} ${o}`;mi.forEach(([l])=>l(c,...s))};return{assert:r,debug:i,error:a,warn:(o,...s)=>{let c=`${t} ${o}`;mi.forEach(([,l])=>l(c,...s))}}}function Jl(e,t){let r=[e,t];return mi.add(r),()=>{mi.delete(r)}}Jl((e,...t)=>{console.error(e,...t,Ea())},(e,...t)=>{console.warn(e,...t,Ea())});var ed="no promo",ho="promo-tag",td="yellow",rd="neutral",id=(e,t,r)=>{let i=n=>n||ed,a=r?` (was "${i(t)}")`:"";return`${i(e)}${a}`},ad="cancel-context",ui=(e,t)=>{let r=e===ad,i=!r&&e?.length>0,a=(i||r)&&(t&&t!=e||!t&&!r),n=a&&i||!a&&!!t,o=n?e||t:void 0;return{effectivePromoCode:o,overridenPromoCode:e,className:n?ho:`${ho} no-promo`,text:id(o,t,a),variant:n?td:rd,isOverriden:a}};var Aa;(function(e){e.BASE="BASE",e.TRIAL="TRIAL",e.PROMOTION="PROMOTION"})(Aa||(Aa={}));var ve;(function(e){e.MONTH="MONTH",e.YEAR="YEAR",e.TWO_YEARS="TWO_YEARS",e.THREE_YEARS="THREE_YEARS",e.PERPETUAL="PERPETUAL",e.TERM_LICENSE="TERM_LICENSE",e.ACCESS_PASS="ACCESS_PASS",e.THREE_MONTHS="THREE_MONTHS",e.SIX_MONTHS="SIX_MONTHS"})(ve||(ve={}));var we;(function(e){e.ANNUAL="ANNUAL",e.MONTHLY="MONTHLY",e.TWO_YEARS="TWO_YEARS",e.THREE_YEARS="THREE_YEARS",e.P1D="P1D",e.P1Y="P1Y",e.P3Y="P3Y",e.P10Y="P10Y",e.P15Y="P15Y",e.P3D="P3D",e.P7D="P7D",e.P30D="P30D",e.HALF_YEARLY="HALF_YEARLY",e.QUARTERLY="QUARTERLY"})(we||(we={}));var Sa;(function(e){e.INDIVIDUAL="INDIVIDUAL",e.TEAM="TEAM",e.ENTERPRISE="ENTERPRISE"})(Sa||(Sa={}));var Ca;(function(e){e.COM="COM",e.EDU="EDU",e.GOV="GOV"})(Ca||(Ca={}));var Ta;(function(e){e.DIRECT="DIRECT",e.INDIRECT="INDIRECT"})(Ta||(Ta={}));var ka;(function(e){e.ENTERPRISE_PRODUCT="ENTERPRISE_PRODUCT",e.ETLA="ETLA",e.RETAIL="RETAIL",e.VIP="VIP",e.VIPMP="VIPMP",e.FREE="FREE"})(ka||(ka={}));var _a="ABM",Pa="PUF",La="M2M",Ma="PERPETUAL",Ra="P3Y",nd="TAX_INCLUSIVE_DETAILS",od="TAX_EXCLUSIVE",po={ABM:_a,PUF:Pa,M2M:La,PERPETUAL:Ma,P3Y:Ra},Gp={[_a]:{commitment:ve.YEAR,term:we.MONTHLY},[Pa]:{commitment:ve.YEAR,term:we.ANNUAL},[La]:{commitment:ve.MONTH,term:we.MONTHLY},[Ma]:{commitment:ve.PERPETUAL,term:void 0},[Ra]:{commitment:ve.THREE_MONTHS,term:we.P3Y}},mo="Value is not an offer",yr=e=>{if(typeof e!="object")return mo;let{commitment:t,term:r}=e,i=sd(t,r);return{...e,planType:i}};var sd=(e,t)=>{switch(e){case void 0:return mo;case"":return"";case ve.YEAR:return t===we.MONTHLY?_a:t===we.ANNUAL?Pa:"";case ve.MONTH:return t===we.MONTHLY?La:"";case ve.PERPETUAL:return Ma;case ve.TERM_LICENSE:return t===we.P3Y?Ra:"";default:return""}};function uo(e){let{priceDetails:t}=e,{price:r,priceWithoutDiscount:i,priceWithoutTax:a,priceWithoutDiscountAndTax:n,taxDisplay:o}=t;if(o!==nd)return e;let s={...e,priceDetails:{...t,price:a??r,priceWithoutDiscount:n??i,taxDisplay:od}};return s.offerType==="TRIAL"&&s.priceDetails.price===0&&(s.priceDetails.price=s.priceDetails.priceWithoutDiscount),s}var go={LOCAL:"local",PROD:"prod",STAGE:"stage"},Oa={DEBUG:"debug",ERROR:"error",INFO:"info",WARN:"warn"},Na=new Set,Ia=new Set,fo=new Map,xo={append({level:e,message:t,params:r,timestamp:i,source:a}){console[e](`${i}ms [${a}] %c${t}`,"font-weight: bold;",...r)}},vo={filter:({level:e})=>e!==Oa.DEBUG},cd={filter:()=>!1};function ld(e,t,r,i,a){return{level:e,message:t,namespace:r,get params(){return i.length===1&&di(i[0])&&(i=i[0](),Array.isArray(i)||(i=[i])),i},source:a,timestamp:performance.now().toFixed(3)}}function dd(e){[...Ia].every(t=>t(e))&&Na.forEach(t=>t(e))}function bo(e){let t=(fo.get(e)??0)+1;fo.set(e,t);let r=`${e} #${t}`,i={id:r,namespace:e,module:a=>bo(`${i.namespace}/${a}`),updateConfig:si};return Object.values(Oa).forEach(a=>{i[a]=(n,...o)=>dd(ld(a,n,e,o,r))}),Object.seal(i)}function gi(...e){e.forEach(t=>{let{append:r,filter:i}=t;di(i)&&Ia.add(i),di(r)&&Na.add(r)})}function hd(e={}){let{name:t}=e,r=T(F("commerce.debug",{search:!0,storage:!0}),t===go.LOCAL);return gi(r?xo:vo),t===go.PROD&&gi(ra),le}function pd(){Na.clear(),Ia.clear()}var le={...bo(pa),Level:Oa,Plugins:{consoleAppender:xo,debugFilter:vo,quietFilter:cd,lanaAppender:ra},init:hd,reset:pd,use:gi};var md="mas-commerce-service",ud=le.module("utilities"),gd={requestId:xr,etag:"Etag",lastModified:"Last-Modified",serverTiming:"server-timing"};function wr(e,{country:t,forceTaxExclusive:r}){let i;if(e.length<2)i=e;else{let a=t==="GB"?"EN":"MULT";e.sort((n,o)=>n.language===a?-1:o.language===a?1:0),e.sort((n,o)=>!n.term&&o.term?-1:n.term&&!o.term?1:0),i=[e[0]]}return r&&(i=i.map(uo)),i}var yo=(e,t)=>{let r=e.reduce((i,a)=>i+(t(a)||0),0);return r>0?Math.round(r*100)/100:void 0};function za(e){if(!e||e.length===0)return null;if(e.length===1)return e[0];let[t,...r]=e;for(let s of r){let c=[["commitment","commitment types"],["term","terms"],["priceDetails.formatString","currency formats"]];for(let[l,d]of c){let p=l.includes(".")?t.priceDetails?.formatString:t[l],u=l.includes(".")?s.priceDetails?.formatString:s[l];u!==p&&ud.warn(`Offers have different ${d}, summing may produce unexpected results`,{expected:p,actual:u})}}let i=[["price",s=>s.priceDetails?.price],["priceWithoutDiscount",s=>s.priceDetails?.priceWithoutDiscount],["priceWithoutTax",s=>s.priceDetails?.priceWithoutTax],["priceWithoutDiscountAndTax",s=>s.priceDetails?.priceWithoutDiscountAndTax]],a={};for(let[s,c]of i){let l=yo(e,c);l!==void 0&&(a[s]=l)}let n=e.some(s=>s.priceDetails?.annualized),o;if(n){let s=[["annualizedPrice",c=>c.priceDetails?.annualized?.annualizedPrice],["annualizedPriceWithoutTax",c=>c.priceDetails?.annualized?.annualizedPriceWithoutTax],["annualizedPriceWithoutDiscount",c=>c.priceDetails?.annualized?.annualizedPriceWithoutDiscount],["annualizedPriceWithoutDiscountAndTax",c=>c.priceDetails?.annualized?.annualizedPriceWithoutDiscountAndTax]];o={};for(let[c,l]of s){let d=yo(e,l);d!==void 0&&(o[c]=d)}}return{...t,offerSelectorIds:e.flatMap(s=>s.offerSelectorIds||[]),priceDetails:{...t.priceDetails,...a,...o&&{annualized:o}}}}var fi=e=>window.setTimeout(e);function Ot(e,t=1){if(e==null)return[t];let r=(Array.isArray(e)?e:String(e).split(",")).map(co).filter(vr);return r.length||(r=[t]),r}function xi(e){return e==null?[]:(Array.isArray(e)?e:String(e).split(",")).filter(so)}function pe(){return document.getElementsByTagName(md)?.[0]}function vi(e){let t={};if(!e?.headers)return t;let r=e.headers;for(let[i,a]of Object.entries(gd)){let n=r.get(a);n&&(n=n.replace(/[,;]/g,"|"),n=n.replace(/[| ]+/g,"|"),t[i]=n)}return t}var Re=class e extends Error{constructor(t,r,i){if(super(t,{cause:i}),this.name="MasError",r.response){let a=r.response.headers?.get(xr);a&&(r.requestId=a),r.response.status&&(r.status=r.response.status,r.statusText=r.response.statusText),r.response.url&&(r.url=r.response.url)}delete r.response,this.context=r,Error.captureStackTrace&&Error.captureStackTrace(this,e)}toString(){let t=Object.entries(this.context||{}).map(([i,a])=>`${i}: ${JSON.stringify(a)}`).join(", "),r=`${this.name}: ${this.message}`;return t&&(r+=` (${t})`),this.cause&&(r+=` + `);Gr=ue;customElements.define("mas-mnemonic",Gr)});var tt={clientId:"merch-at-scale",delimiter:"\xB6",ignoredProperties:["analytics","literals","element"],serializableTypes:["Array","Object"],sampleRate:1,severity:"e",tags:"acom",isProdDomain:!1},eo=1e3;function Pl(e){return e instanceof Error||typeof e?.originatingRequest=="string"}function to(e){if(e==null)return;let t=typeof e;if(t==="function")return e.name?`function ${e.name}`:"function";if(t==="object"){if(e instanceof Error)return e.message;if(typeof e.originatingRequest=="string"){let{message:i,originatingRequest:a,status:n}=e;return[i,n,a].filter(Boolean).join(" ")}let r=e[Symbol.toStringTag]??Object.getPrototypeOf(e).constructor.name;if(!tt.serializableTypes.includes(r))return r}return e}function Ll(e,t){if(!tt.ignoredProperties.includes(e))return to(t)}var ra={append(e){if(e.level!=="error")return;let{message:t,params:r}=e,i=[],a=[],n=t;r.forEach(l=>{l!=null&&(Pl(l)?i:a).push(l)}),i.length&&(n+=" "+i.map(to).join(" "));let{pathname:o,search:s}=window.location,c=`${tt.delimiter}page=${o}${s}`;c.length>eo&&(c=`${c.slice(0,eo)}`),n+=c,a.length&&(n+=`${tt.delimiter}facts=`,n+=JSON.stringify(a,Ll)),window.lana?.log(n,tt)}};function si(e){Object.assign(tt,Object.fromEntries(Object.entries(e).filter(([t,r])=>t in tt&&r!==""&&r!==null&&r!==void 0&&!Number.isNaN(r))))}var ya={};Zn(ya,{CLASS_NAME_FAILED:()=>oa,CLASS_NAME_HIDDEN:()=>Rl,CLASS_NAME_PENDING:()=>sa,CLASS_NAME_RESOLVED:()=>ca,CheckoutWorkflow:()=>io,CheckoutWorkflowStep:()=>ce,Commitment:()=>rt,ERROR_MESSAGE_BAD_REQUEST:()=>la,ERROR_MESSAGE_MISSING_LITERALS_URL:()=>Ul,ERROR_MESSAGE_OFFER_NOT_FOUND:()=>da,EVENT_AEM_ERROR:()=>nt,EVENT_AEM_LOAD:()=>at,EVENT_MAS_ERROR:()=>na,EVENT_MAS_READY:()=>fr,EVENT_MERCH_ADDON_AND_QUANTITY_UPDATE:()=>li,EVENT_MERCH_CARD_ACTION_MENU_TOGGLE:()=>ia,EVENT_MERCH_CARD_COLLECTION_LITERALS_CHANGED:()=>it,EVENT_MERCH_CARD_COLLECTION_SHOWMORE:()=>Bl,EVENT_MERCH_CARD_COLLECTION_SIDENAV_ATTACHED:()=>Hl,EVENT_MERCH_CARD_COLLECTION_SORT:()=>$l,EVENT_MERCH_CARD_QUANTITY_CHANGE:()=>Pt,EVENT_MERCH_OFFER_READY:()=>_t,EVENT_MERCH_OFFER_SELECT_READY:()=>gr,EVENT_MERCH_QUANTITY_SELECTOR_CHANGE:()=>te,EVENT_MERCH_SEARCH_CHANGE:()=>Dl,EVENT_MERCH_SIDENAV_SELECT:()=>Fl,EVENT_MERCH_STOCK_CHANGE:()=>Il,EVENT_MERCH_STORAGE_CHANGE:()=>zl,EVENT_OFFER_SELECTED:()=>aa,EVENT_TYPE_FAILED:()=>ha,EVENT_TYPE_READY:()=>ci,EVENT_TYPE_RESOLVED:()=>Lt,Env:()=>Me,FF_ANNUAL_PRICE:()=>Mt,FF_DEFAULTS:()=>Te,HEADER_X_REQUEST_ID:()=>xr,LOG_NAMESPACE:()=>pa,Landscape:()=>Ve,MARK_DURATION_SUFFIX:()=>ct,MARK_START_SUFFIX:()=>st,MODAL_TYPE_3_IN_1:()=>ot,NAMESPACE:()=>Ml,PARAM_AOS_API_KEY:()=>Gl,PARAM_ENV:()=>ua,PARAM_LANDSCAPE:()=>ga,PARAM_MAS_PREVIEW:()=>ma,PARAM_WCS_API_KEY:()=>ql,PROVIDER_ENVIRONMENT:()=>va,SELECTOR_MAS_CHECKOUT_LINK:()=>Se,SELECTOR_MAS_ELEMENT:()=>ur,SELECTOR_MAS_INLINE_PRICE:()=>D,SELECTOR_MAS_SP_BUTTON:()=>Nl,SELECTOR_MAS_UPT_LINK:()=>ro,SORT_ORDER:()=>Yl,STATE_FAILED:()=>Ce,STATE_PENDING:()=>qe,STATE_RESOLVED:()=>ze,SUPPORTED_COUNTRIES:()=>ba,TAG_NAME_SERVICE:()=>Ol,TEMPLATE_PRICE:()=>Vl,TEMPLATE_PRICE_ANNUAL:()=>Wl,TEMPLATE_PRICE_LEGAL:()=>xe,TEMPLATE_PRICE_STRIKETHROUGH:()=>jl,Term:()=>ye,WCS_PROD_URL:()=>fa,WCS_STAGE_URL:()=>xa});var rt=Object.freeze({MONTH:"MONTH",YEAR:"YEAR",TWO_YEARS:"TWO_YEARS",THREE_YEARS:"THREE_YEARS",PERPETUAL:"PERPETUAL",TERM_LICENSE:"TERM_LICENSE",ACCESS_PASS:"ACCESS_PASS",THREE_MONTHS:"THREE_MONTHS",SIX_MONTHS:"SIX_MONTHS"}),ye=Object.freeze({ANNUAL:"ANNUAL",MONTHLY:"MONTHLY",TWO_YEARS:"TWO_YEARS",THREE_YEARS:"THREE_YEARS",P1D:"P1D",P1Y:"P1Y",P3Y:"P3Y",P10Y:"P10Y",P15Y:"P15Y",P3D:"P3D",P7D:"P7D",P30D:"P30D",HALF_YEARLY:"HALF_YEARLY",QUARTERLY:"QUARTERLY"}),Ml="merch",Rl="hidden",ci="wcms:commerce:ready",Ol="mas-commerce-service",D='span[is="inline-price"][data-wcs-osi]',Se='a[is="checkout-link"][data-wcs-osi],button[is="checkout-button"][data-wcs-osi]',Nl="sp-button[data-wcs-osi]",ro='a[is="upt-link"]',ur=`${D},${Se},${ro}`,_t="merch-offer:ready",gr="merch-offer-select:ready",ia="merch-card:action-menu-toggle",aa="merch-offer:selected",Il="merch-stock:change",zl="merch-storage:change",te="merch-quantity-selector:change",Pt="merch-card-quantity:change",li="merch-modal:addon-and-quantity-update",Dl="merch-search:change",$l="merch-card-collection:sort",it="merch-card-collection:literals-changed",Hl="merch-card-collection:sidenav-attached",Bl="merch-card-collection:showmore",Fl="merch-sidenav:select",at="aem:load",nt="aem:error",fr="mas:ready",na="mas:error",oa="placeholder-failed",sa="placeholder-pending",ca="placeholder-resolved",la="Bad WCS request",da="Commerce offer not found",Ul="Literals URL not provided",ha="mas:failed",Lt="mas:resolved",pa="mas/commerce",ma="mas.preview",ua="commerce.env",ga="commerce.landscape",Gl="commerce.aosKey",ql="commerce.wcsKey",fa="https://www.adobe.com/web_commerce_artifact",xa="https://www.stage.adobe.com/web_commerce_artifact_stage",Ce="failed",qe="pending",ze="resolved",Ve={DRAFT:"DRAFT",PUBLISHED:"PUBLISHED"},xr="X-Request-Id",ce=Object.freeze({SEGMENTATION:"segmentation",BUNDLE:"bundle",COMMITMENT:"commitment",RECOMMENDATION:"recommendation",EMAIL:"email",PAYMENT:"payment",CHANGE_PLAN_TEAM_PLANS:"change-plan/team-upgrade/plans",CHANGE_PLAN_TEAM_PAYMENT:"change-plan/team-upgrade/payment"}),io="UCv3",Me=Object.freeze({STAGE:"STAGE",PRODUCTION:"PRODUCTION",LOCAL:"LOCAL"}),va={PRODUCTION:"PRODUCTION"},ot={TWP:"twp",D2P:"d2p",CRM:"crm"},st=":start",ct=":duration",Vl="price",jl="price-strikethrough",Wl="annual",xe="legal",Te="mas-ff-defaults",Mt="mas-ff-annual-price",Yl={alphabetical:"alphabetical",authored:"authored"},ba=["AE","AM","AR","AT","AU","AZ","BB","BD","BE","BG","BH","BO","BR","BS","BY","CA","CH","CL","CN","CO","CR","CY","CZ","DE","DK","DO","DZ","EC","EE","EG","ES","FI","FR","GB","GE","GH","GR","GT","HK","HN","HR","HU","ID","IE","IL","IN","IQ","IS","IT","JM","JO","JP","KE","KG","KR","KW","KZ","LA","LB","LK","LT","LU","LV","MA","MD","MO","MT","MU","MX","MY","NG","NI","NL","NO","NP","NZ","OM","PA","PE","PH","PK","PL","PR","PT","PY","QA","RO","RS","RU","SA","SE","SG","SI","SK","SV","TH","TJ","TM","TN","TR","TT","TW","TZ","UA","US","UY","UZ","VE","VN","YE","ZA"];var ao="tacocat.js";var wa=(e,t)=>String(e??"").toLowerCase()==String(t??"").toLowerCase(),no=e=>`${e??""}`.replace(/[&<>'"]/g,t=>({"&":"&","<":"<",">":">","'":"'",'"':"""})[t]??t)??"";function F(e,t={},{metadata:r=!0,search:i=!0,storage:a=!0}={}){let n;if(i&&n==null){let o=new URLSearchParams(window.location.search),s=Rt(i)?i:e;n=o.get(s)}if(a&&n==null){let o=Rt(a)?a:e;n=window.sessionStorage.getItem(o)??window.localStorage.getItem(o)}if(r&&n==null){let o=Kl(Rt(r)?r:e);n=document.documentElement.querySelector(`meta[name="${o}"]`)?.content}return n??t[e]}var Xl=e=>typeof e=="boolean",di=e=>typeof e=="function",hi=e=>typeof e=="number",oo=e=>e!=null&&typeof e=="object";var Rt=e=>typeof e=="string",so=e=>Rt(e)&&e,vr=e=>hi(e)&&Number.isFinite(e)&&e>0;function pi(e,t=r=>r==null||r===""){return e!=null&&Object.entries(e).forEach(([r,i])=>{t(i)&&delete e[r]}),e}function T(e,t){if(Xl(e))return e;let r=String(e);return r==="1"||r==="true"?!0:r==="0"||r==="false"?!1:t}function br(e,t,r){let i=Object.values(t);return i.find(a=>wa(a,e))??r??i[0]}function Kl(e=""){return String(e).replace(/(\p{Lowercase_Letter})(\p{Uppercase_Letter})/gu,(t,r,i)=>`${r}-${i}`).replace(/\W+/gu,"-").toLowerCase()}function co(e,t=1){return hi(e)||(e=Number.parseInt(e,10)),!Number.isNaN(e)&&e>0&&Number.isFinite(e)?e:t}var Ql=Date.now(),Ea=()=>`(+${Date.now()-Ql}ms)`,mi=new Set,Zl=T(F("tacocat.debug",{},{metadata:!1}),!1);function lo(e){let t=`[${ao}/${e}]`,r=(o,s,...c)=>o?!0:(a(s,...c),!1),i=Zl?(o,...s)=>{console.debug(`${t} ${o}`,...s,Ea())}:()=>{},a=(o,...s)=>{let c=`${t} ${o}`;mi.forEach(([l])=>l(c,...s))};return{assert:r,debug:i,error:a,warn:(o,...s)=>{let c=`${t} ${o}`;mi.forEach(([,l])=>l(c,...s))}}}function Jl(e,t){let r=[e,t];return mi.add(r),()=>{mi.delete(r)}}Jl((e,...t)=>{console.error(e,...t,Ea())},(e,...t)=>{console.warn(e,...t,Ea())});var ed="no promo",ho="promo-tag",td="yellow",rd="neutral",id=(e,t,r)=>{let i=n=>n||ed,a=r?` (was "${i(t)}")`:"";return`${i(e)}${a}`},ad="cancel-context",ui=(e,t)=>{let r=e===ad,i=!r&&e?.length>0,a=(i||r)&&(t&&t!=e||!t&&!r),n=a&&i||!a&&!!t,o=n?e||t:void 0;return{effectivePromoCode:o,overridenPromoCode:e,className:n?ho:`${ho} no-promo`,text:id(o,t,a),variant:n?td:rd,isOverriden:a}};var Aa;(function(e){e.BASE="BASE",e.TRIAL="TRIAL",e.PROMOTION="PROMOTION"})(Aa||(Aa={}));var ve;(function(e){e.MONTH="MONTH",e.YEAR="YEAR",e.TWO_YEARS="TWO_YEARS",e.THREE_YEARS="THREE_YEARS",e.PERPETUAL="PERPETUAL",e.TERM_LICENSE="TERM_LICENSE",e.ACCESS_PASS="ACCESS_PASS",e.THREE_MONTHS="THREE_MONTHS",e.SIX_MONTHS="SIX_MONTHS"})(ve||(ve={}));var we;(function(e){e.ANNUAL="ANNUAL",e.MONTHLY="MONTHLY",e.TWO_YEARS="TWO_YEARS",e.THREE_YEARS="THREE_YEARS",e.P1D="P1D",e.P1Y="P1Y",e.P3Y="P3Y",e.P10Y="P10Y",e.P15Y="P15Y",e.P3D="P3D",e.P7D="P7D",e.P30D="P30D",e.HALF_YEARLY="HALF_YEARLY",e.QUARTERLY="QUARTERLY"})(we||(we={}));var Sa;(function(e){e.INDIVIDUAL="INDIVIDUAL",e.TEAM="TEAM",e.ENTERPRISE="ENTERPRISE"})(Sa||(Sa={}));var Ca;(function(e){e.COM="COM",e.EDU="EDU",e.GOV="GOV"})(Ca||(Ca={}));var Ta;(function(e){e.DIRECT="DIRECT",e.INDIRECT="INDIRECT"})(Ta||(Ta={}));var ka;(function(e){e.ENTERPRISE_PRODUCT="ENTERPRISE_PRODUCT",e.ETLA="ETLA",e.RETAIL="RETAIL",e.VIP="VIP",e.VIPMP="VIPMP",e.FREE="FREE"})(ka||(ka={}));var _a="ABM",Pa="PUF",La="M2M",Ma="PERPETUAL",Ra="P3Y",nd="TAX_INCLUSIVE_DETAILS",od="TAX_EXCLUSIVE",po={ABM:_a,PUF:Pa,M2M:La,PERPETUAL:Ma,P3Y:Ra},qp={[_a]:{commitment:ve.YEAR,term:we.MONTHLY},[Pa]:{commitment:ve.YEAR,term:we.ANNUAL},[La]:{commitment:ve.MONTH,term:we.MONTHLY},[Ma]:{commitment:ve.PERPETUAL,term:void 0},[Ra]:{commitment:ve.THREE_MONTHS,term:we.P3Y}},mo="Value is not an offer",yr=e=>{if(typeof e!="object")return mo;let{commitment:t,term:r}=e,i=sd(t,r);return{...e,planType:i}};var sd=(e,t)=>{switch(e){case void 0:return mo;case"":return"";case ve.YEAR:return t===we.MONTHLY?_a:t===we.ANNUAL?Pa:"";case ve.MONTH:return t===we.MONTHLY?La:"";case ve.PERPETUAL:return Ma;case ve.TERM_LICENSE:return t===we.P3Y?Ra:"";default:return""}};function uo(e){let{priceDetails:t}=e,{price:r,priceWithoutDiscount:i,priceWithoutTax:a,priceWithoutDiscountAndTax:n,taxDisplay:o}=t;if(o!==nd)return e;let s={...e,priceDetails:{...t,price:a??r,priceWithoutDiscount:n??i,taxDisplay:od}};return s.offerType==="TRIAL"&&s.priceDetails.price===0&&(s.priceDetails.price=s.priceDetails.priceWithoutDiscount),s}var go={LOCAL:"local",PROD:"prod",STAGE:"stage"},Oa={DEBUG:"debug",ERROR:"error",INFO:"info",WARN:"warn"},Na=new Set,Ia=new Set,fo=new Map,xo={append({level:e,message:t,params:r,timestamp:i,source:a}){console[e](`${i}ms [${a}] %c${t}`,"font-weight: bold;",...r)}},vo={filter:({level:e})=>e!==Oa.DEBUG},cd={filter:()=>!1};function ld(e,t,r,i,a){return{level:e,message:t,namespace:r,get params(){return i.length===1&&di(i[0])&&(i=i[0](),Array.isArray(i)||(i=[i])),i},source:a,timestamp:performance.now().toFixed(3)}}function dd(e){[...Ia].every(t=>t(e))&&Na.forEach(t=>t(e))}function bo(e){let t=(fo.get(e)??0)+1;fo.set(e,t);let r=`${e} #${t}`,i={id:r,namespace:e,module:a=>bo(`${i.namespace}/${a}`),updateConfig:si};return Object.values(Oa).forEach(a=>{i[a]=(n,...o)=>dd(ld(a,n,e,o,r))}),Object.seal(i)}function gi(...e){e.forEach(t=>{let{append:r,filter:i}=t;di(i)&&Ia.add(i),di(r)&&Na.add(r)})}function hd(e={}){let{name:t}=e,r=T(F("commerce.debug",{search:!0,storage:!0}),t===go.LOCAL);return gi(r?xo:vo),t===go.PROD&&gi(ra),le}function pd(){Na.clear(),Ia.clear()}var le={...bo(pa),Level:Oa,Plugins:{consoleAppender:xo,debugFilter:vo,quietFilter:cd,lanaAppender:ra},init:hd,reset:pd,use:gi};var md="mas-commerce-service",ud=le.module("utilities"),gd={requestId:xr,etag:"Etag",lastModified:"Last-Modified",serverTiming:"server-timing"};function wr(e,{country:t,forceTaxExclusive:r}){let i;if(e.length<2)i=e;else{let a=t==="GB"?"EN":"MULT";e.sort((n,o)=>n.language===a?-1:o.language===a?1:0),e.sort((n,o)=>!n.term&&o.term?-1:n.term&&!o.term?1:0),i=[e[0]]}return r&&(i=i.map(uo)),i}var yo=(e,t)=>{let r=e.reduce((i,a)=>i+(t(a)||0),0);return r>0?Math.round(r*100)/100:void 0};function za(e){if(!e||e.length===0)return null;if(e.length===1)return e[0];let[t,...r]=e;for(let s of r){let c=[["commitment","commitment types"],["term","terms"],["priceDetails.formatString","currency formats"]];for(let[l,d]of c){let p=l.includes(".")?t.priceDetails?.formatString:t[l],u=l.includes(".")?s.priceDetails?.formatString:s[l];u!==p&&ud.warn(`Offers have different ${d}, summing may produce unexpected results`,{expected:p,actual:u})}}let i=[["price",s=>s.priceDetails?.price],["priceWithoutDiscount",s=>s.priceDetails?.priceWithoutDiscount],["priceWithoutTax",s=>s.priceDetails?.priceWithoutTax],["priceWithoutDiscountAndTax",s=>s.priceDetails?.priceWithoutDiscountAndTax]],a={};for(let[s,c]of i){let l=yo(e,c);l!==void 0&&(a[s]=l)}let n=e.some(s=>s.priceDetails?.annualized),o;if(n){let s=[["annualizedPrice",c=>c.priceDetails?.annualized?.annualizedPrice],["annualizedPriceWithoutTax",c=>c.priceDetails?.annualized?.annualizedPriceWithoutTax],["annualizedPriceWithoutDiscount",c=>c.priceDetails?.annualized?.annualizedPriceWithoutDiscount],["annualizedPriceWithoutDiscountAndTax",c=>c.priceDetails?.annualized?.annualizedPriceWithoutDiscountAndTax]];o={};for(let[c,l]of s){let d=yo(e,l);d!==void 0&&(o[c]=d)}}return{...t,offerSelectorIds:e.flatMap(s=>s.offerSelectorIds||[]),priceDetails:{...t.priceDetails,...a,...o&&{annualized:o}}}}var fi=e=>window.setTimeout(e);function Ot(e,t=1){if(e==null)return[t];let r=(Array.isArray(e)?e:String(e).split(",")).map(co).filter(vr);return r.length||(r=[t]),r}function xi(e){return e==null?[]:(Array.isArray(e)?e:String(e).split(",")).filter(so)}function pe(){return document.getElementsByTagName(md)?.[0]}function vi(e){let t={};if(!e?.headers)return t;let r=e.headers;for(let[i,a]of Object.entries(gd)){let n=r.get(a);n&&(n=n.replace(/[,;]/g,"|"),n=n.replace(/[| ]+/g,"|"),t[i]=n)}return t}var Re=class e extends Error{constructor(t,r,i){if(super(t,{cause:i}),this.name="MasError",r.response){let a=r.response.headers?.get(xr);a&&(r.requestId=a),r.response.status&&(r.status=r.response.status,r.statusText=r.response.statusText),r.response.url&&(r.url=r.response.url)}delete r.response,this.context=r,Error.captureStackTrace&&Error.captureStackTrace(this,e)}toString(){let t=Object.entries(this.context||{}).map(([i,a])=>`${i}: ${JSON.stringify(a)}`).join(", "),r=`${this.name}: ${this.message}`;return t&&(r+=` (${t})`),this.cause&&(r+=` Caused by: ${this.cause}`),r}};var fd={[Ce]:oa,[qe]:sa,[ze]:ca},xd={[Ce]:ha,[ze]:Lt},Er,je=class{constructor(t){E(this,Er);m(this,"changes",new Map);m(this,"connected",!1);m(this,"error");m(this,"log");m(this,"options");m(this,"promises",[]);m(this,"state",qe);m(this,"timer",null);m(this,"value");m(this,"version",0);m(this,"wrapperElement");this.wrapperElement=t,this.log=le.module("mas-element")}update(){[Ce,qe,ze].forEach(t=>{this.wrapperElement.classList.toggle(fd[t],t===this.state)})}notify(){(this.state===ze||this.state===Ce)&&(this.state===ze?this.promises.forEach(({resolve:r})=>r(this.wrapperElement)):this.state===Ce&&this.promises.forEach(({reject:r})=>r(this.error)),this.promises=[]);let t=this.error;this.error instanceof Re&&(t={message:this.error.message,...this.error.context}),this.wrapperElement.dispatchEvent(new CustomEvent(xd[this.state],{bubbles:!0,composed:!0,detail:t}))}attributeChangedCallback(t,r,i){this.changes.set(t,i),this.requestUpdate()}connectedCallback(){y(this,Er,pe()),this.requestUpdate(!0)}disconnectedCallback(){this.connected&&(this.connected=!1,this.log?.debug("Disconnected:",{element:this.wrapperElement}))}onceSettled(){let{error:t,promises:r,state:i}=this;return ze===i?Promise.resolve(this.wrapperElement):Ce===i?Promise.reject(t):new Promise((a,n)=>{r.push({resolve:a,reject:n})})}toggleResolved(t,r,i){return t!==this.version?!1:(i!==void 0&&(this.options=i),this.state=ze,this.value=r,this.update(),this.log?.debug("Resolved:",{element:this.wrapperElement,value:r}),fi(()=>this.notify()),!0)}toggleFailed(t,r,i){if(t!==this.version)return!1;i!==void 0&&(this.options=i),this.error=r,this.state=Ce,this.update();let a=this.wrapperElement.getAttribute("is");return this.log?.error(`${a}: Failed to render: ${r.message}`,{element:this.wrapperElement,...r.context,...h(this,Er)?.duration}),fi(()=>this.notify()),!0}togglePending(t){return this.version++,t&&(this.options=t),this.state=qe,this.update(),this.log?.debug("Pending:",{osi:this.wrapperElement?.options?.wcsOsi}),this.version}requestUpdate(t=!1){if(!this.wrapperElement.isConnected||!pe()||this.timer)return;let{error:r,options:i,state:a,value:n,version:o}=this;this.state=qe,this.timer=fi(async()=>{this.timer=null;let s=null;if(this.changes.size&&(s=Object.fromEntries(this.changes.entries()),this.changes.clear()),this.connected?this.log?.debug("Updated:",{element:this.wrapperElement,changes:s}):(this.connected=!0,this.log?.debug("Connected:",{element:this.wrapperElement,changes:s})),s||t)try{await this.wrapperElement.render?.()===!1&&this.state===qe&&this.version===o&&(this.state=a,this.error=r,this.value=n,this.update(),this.notify())}catch(c){this.toggleFailed(this.version,c,i)}})}};Er=new WeakMap;function wo(e={}){return Object.entries(e).forEach(([t,r])=>{(r==null||r===""||r?.length===0)&&delete e[t]}),e}function bi(e,t={}){let{tag:r,is:i}=e,a=document.createElement(r,{is:i});return a.setAttribute("is",i),Object.assign(a.dataset,wo(t)),a}function Eo(e,t={}){return e instanceof HTMLElement?(Object.assign(e.dataset,wo(t)),e):null}var vd=/[0-9\-+#]/,bd=/[^\d\-+#]/g;function Ao(e){return e.search(vd)}function yd(e="#.##"){let t={},r=e.length,i=Ao(e);t.prefix=i>0?e.substring(0,i):"";let a=Ao(e.split("").reverse().join("")),n=r-a,o=e.substring(n,n+1),s=n+(o==="."||o===","?1:0);t.suffix=a>0?e.substring(s,r):"",t.mask=e.substring(i,s),t.maskHasNegativeSign=t.mask.charAt(0)==="-",t.maskHasPositiveSign=t.mask.charAt(0)==="+";let c=t.mask.match(bd);return t.decimal=c&&c[c.length-1]||".",t.separator=c&&c[1]&&c[0]||",",c=t.mask.split(t.decimal),t.integer=c[0],t.fraction=c[1],t}function wd(e,t,r){let i=!1,a={value:e};e<0&&(i=!0,a.value=-a.value),a.sign=i?"-":"",a.value=Number(a.value).toFixed(t.fraction&&t.fraction.length),a.value=Number(a.value).toString();let n=t.fraction&&t.fraction.lastIndexOf("0"),[o="0",s=""]=a.value.split(".");return(!s||s&&s.length<=n)&&(s=n<0?"":(+("0."+s)).toFixed(n+1).replace("0.","")),a.integer=o,a.fraction=s,Ed(a,t),(a.result==="0"||a.result==="")&&(i=!1,a.sign=""),!i&&t.maskHasPositiveSign?a.sign="+":i&&t.maskHasPositiveSign?a.sign="-":i&&(a.sign=r&&r.enforceMaskSign&&!t.maskHasNegativeSign?"":"-"),a}function Ed(e,t){e.result="";let r=t.integer.split(t.separator),i=r.join(""),a=i&&i.indexOf("0");if(a>-1)for(;e.integer.lengthe*12,dt=(e,t,r=1)=>{if(!e)return!1;let{start:i,end:a,displaySummary:{amount:n,duration:o,minProductQuantity:s=1,outcomeType:c}={}}=e;if(!(n&&o&&c)||r=d&&l<=p},lt={MONTH:"MONTH",YEAR:"YEAR"},Cd={[ye.ANNUAL]:12,[ye.MONTHLY]:1,[ye.THREE_YEARS]:36,[ye.TWO_YEARS]:24},$a=(e,t)=>({accept:e,round:t}),Td=[$a(({divisor:e,price:t})=>t%e==0,({divisor:e,price:t})=>t/e),$a(({usePrecision:e})=>e,({divisor:e,price:t})=>Math.round(t/e*100)/100),$a(()=>!0,({divisor:e,price:t})=>Math.ceil(Math.floor(t*100/e)/100))],Ha={[rt.YEAR]:{[ye.MONTHLY]:lt.MONTH,[ye.ANNUAL]:lt.YEAR},[rt.MONTH]:{[ye.MONTHLY]:lt.MONTH}},kd=(e,t)=>e.indexOf(`'${t}'`)===0,_d=(e,t=!0)=>{let r=e.replace(/'.*?'/,"").trim(),i=Lo(r);return!!i?t||(r=r.replace(/[,\.]0+/,i)):r=r.replace(/\s?(#.*0)(?!\s)?/,"$&"+Ld(e)),r},Pd=e=>{let t=Md(e),r=kd(e,t),i=e.replace(/'.*?'/,""),a=ko.test(i)||_o.test(i);return{currencySymbol:t,isCurrencyFirst:r,hasCurrencySpace:a}},Po=e=>e.replace(ko,To).replace(_o,To),Ld=e=>e.match(/#(.?)#/)?.[1]===Co?Sd:Co,Md=e=>e.match(/'(.*?)'/)?.[1]??"",Lo=e=>e.match(/0(.?)0/)?.[1]??"";function Nt({formatString:e,price:t,usePrecision:r,isIndianPrice:i=!1},a,n=o=>o){let{currencySymbol:o,isCurrencyFirst:s,hasCurrencySpace:c}=Pd(e),l=r?Lo(e):"",d=_d(e,r),p=r?2:0,u=n(t,{currencySymbol:o}),f=i?u.toLocaleString("hi-IN",{minimumFractionDigits:p,maximumFractionDigits:p}):So(d,u),x=r?f.lastIndexOf(l):f.length,v=f.substring(0,x),S=f.substring(x+1);return{accessiblePrice:e.replace(/'.*?'/,"SYMBOL").replace(/#.*0/,f).replace(/SYMBOL/,o),currencySymbol:o,decimals:S,decimalsDelimiter:l,hasCurrencySpace:c,integer:v,isCurrencyFirst:s,recurrenceTerm:a}}var Mo=e=>{let{commitment:t,term:r,usePrecision:i}=e,a=Cd[r]??1;return Nt(e,a>1?lt.MONTH:Ha[t]?.[r],n=>{let o={divisor:a,price:n,usePrecision:i},{round:s}=Td.find(({accept:c})=>c(o));if(!s)throw new Error(`Missing rounding rule for: ${JSON.stringify(o)}`);return s(o)})},Ro=({commitment:e,term:t,...r})=>Nt(r,Ha[e]?.[t]),Oo=e=>{let{commitment:t,instant:r,price:i,originalPrice:a,priceWithoutDiscount:n,promotion:o,quantity:s=1,term:c}=e;if(t===rt.YEAR&&c===ye.MONTHLY){if(!o)return Nt(e,lt.YEAR,Da);let{displaySummary:{outcomeType:l,duration:d}={}}=o;switch(l){case"PERCENTAGE_DISCOUNT":if(dt(o,r,s)){let p=parseInt(d.replace("P","").replace("M",""));if(isNaN(p))return Da(i);let u=a*p,f=n*(12-p),x=Math.round((u+f)*100)/100;return Nt({...e,price:x},lt.YEAR)}default:return Nt(e,lt.YEAR,()=>Da(n??i))}}return Nt(e,Ha[t]?.[c])};var No="download",Io="upgrade",zo={e:"EDU",t:"TEAM"};function yi(e,t={},r=""){let i=pe();if(!i)return null;let{checkoutMarketSegment:a,checkoutWorkflow:n,checkoutWorkflowStep:o,entitlement:s,upgrade:c,modal:l,perpetual:d,promotionCode:p,quantity:u,wcsOsi:f,extraOptions:x,analyticsId:v}=i.collectCheckoutOptions(t),S=bi(e,{checkoutMarketSegment:a,checkoutWorkflow:n,checkoutWorkflowStep:o,entitlement:s,upgrade:c,modal:l,perpetual:d,promotionCode:p,quantity:u,wcsOsi:f,extraOptions:x,analyticsId:v});return r&&(S.innerHTML=`${r}`),S}function wi(e){return class extends e{constructor(){super(...arguments);m(this,"checkoutActionHandler");m(this,"masElement",new je(this))}attributeChangedCallback(i,a,n){this.masElement.attributeChangedCallback(i,a,n)}connectedCallback(){this.masElement.connectedCallback(),this.addEventListener("click",this.clickHandler)}disconnectedCallback(){this.masElement.disconnectedCallback(),this.removeEventListener("click",this.clickHandler)}onceSettled(){return this.masElement.onceSettled()}get value(){return this.masElement.value}get options(){return this.masElement.options}get marketSegment(){let i=this.options?.ms??this.value?.[0].marketSegments?.[0];return zo[i]??i}get customerSegment(){let i=this.options?.cs??this.value?.[0]?.customerSegment;return zo[i]??i}get is3in1Modal(){return Object.values(ot).includes(this.getAttribute("data-modal"))}get isOpen3in1Modal(){let i=document.querySelector("meta[name=mas-ff-3in1]");return this.is3in1Modal&&(!i||i.content!=="off")}requestUpdate(i=!1){return this.masElement.requestUpdate(i)}static get observedAttributes(){return["data-checkout-workflow","data-checkout-workflow-step","data-extra-options","data-ims-country","data-perpetual","data-promotion-code","data-quantity","data-template","data-wcs-osi","data-entitlement","data-upgrade","data-modal"]}async render(i={}){let a=pe();if(!a)return!1;this.dataset.imsCountry||a.imsCountryPromise.then(f=>{f&&(this.dataset.imsCountry=f)}),i.imsCountry=null;let n=a.collectCheckoutOptions(i,this);if(!n.wcsOsi.length)return!1;let o;try{o=JSON.parse(n.extraOptions??"{}")}catch(f){this.masElement.log?.error("cannot parse exta checkout options",f)}let s=this.masElement.togglePending(n);this.setCheckoutUrl("");let c=a.resolveOfferSelectors(n),l=await Promise.all(c);l=l.map(f=>wr(f,n));let d=l.flat().find(f=>f.promotion);!dt(d?.promotion,d?.promotion?.displaySummary?.instant,n.quantity[0])&&n.promotionCode&&delete n.promotionCode,n.country=this.dataset.imsCountry||n.country;let u=await a.buildCheckoutAction?.(l.flat(),{...o,...n},this);return this.renderOffers(l.flat(),n,{},u,s)}renderOffers(i,a,n={},o=void 0,s=void 0){let c=pe();if(!c)return!1;if(a={...JSON.parse(this.dataset.extraOptions??"{}"),...a,...n},s??(s=this.masElement.togglePending(a)),this.checkoutActionHandler&&(this.checkoutActionHandler=void 0),o){this.classList.remove(No,Io),this.masElement.toggleResolved(s,i,a);let{url:d,text:p,className:u,handler:f}=o;d&&this.setCheckoutUrl(d),p&&(this.firstElementChild.innerHTML=p),u&&this.classList.add(...u.split(" ")),f&&(this.setCheckoutUrl("#"),this.checkoutActionHandler=f.bind(this))}if(i.length){if(this.masElement.toggleResolved(s,i,a)){if(!this.classList.contains(No)&&!this.classList.contains(Io)){let d=c.buildCheckoutURL(i,a);this.setCheckoutUrl(a.modal==="true"?"#":d)}return!0}}else{let d=new Error(`Not provided: ${a?.wcsOsi??"-"}`);if(this.masElement.toggleFailed(s,d,a))return this.setCheckoutUrl("#"),!0}}setCheckoutUrl(){}clickHandler(i){}updateOptions(i={}){let a=pe();if(!a)return!1;let{checkoutMarketSegment:n,checkoutWorkflow:o,checkoutWorkflowStep:s,entitlement:c,upgrade:l,modal:d,perpetual:p,promotionCode:u,quantity:f,wcsOsi:x}=a.collectCheckoutOptions(i);return Eo(this,{checkoutMarketSegment:n,checkoutWorkflow:o,checkoutWorkflowStep:s,entitlement:c,upgrade:l,modal:d,perpetual:p,promotionCode:u,quantity:f,wcsOsi:x}),!0}}}var Ar=class Ar extends wi(HTMLAnchorElement){static createCheckoutLink(t={},r=""){return yi(Ar,t,r)}setCheckoutUrl(t){this.setAttribute("href",t)}get isCheckoutLink(){return!0}clickHandler(t){if(this.checkoutActionHandler){this.checkoutActionHandler?.(t);return}}};m(Ar,"is","checkout-link"),m(Ar,"tag","a");var De=Ar;window.customElements.get(De.is)||window.customElements.define(De.is,De,{extends:De.tag});var Rd="p_draft_landscape",Od="/store/",Nd=new Map([["countrySpecific","cs"],["customerSegment","cs"],["quantity","q"],["authCode","code"],["checkoutPromoCode","apc"],["rurl","rUrl"],["curl","cUrl"],["ctxrturl","ctxRtUrl"],["country","co"],["language","lang"],["clientId","cli"],["context","ctx"],["productArrangementCode","pa"],["addonProductArrangementCode","ao"],["offerType","ot"],["marketSegment","ms"]]),Ba=new Set(["af","ai","ao","apc","appctxid","cli","co","cs","csm","ctx","ctxRtUrl","DCWATC","dp","fr","gsp","ijt","lang","lo","mal","ms","mv","mv2","nglwfdata","ot","otac","pa","pcid","promoid","q","rf","sc","scl","sdid","sid","spint","svar","th","thm","trackingid","usid","workflowid","context.guid","so.ca","so.su","so.tr","so.va"]),Id=["env","workflowStep","clientId","country"],Do=new Set(["gid","gtoken","notifauditid","cohortid","productname","sdid","attimer","gcsrc","gcprog","gcprogcat","gcpagetype","mv","mv2"]),$o=e=>Nd.get(e)??e;function Ei(e,t,r){for(let[i,a]of Object.entries(e)){let n=$o(i);a!=null&&r.has(n)&&t.set(n,a)}}function zd(e){switch(e){case va.PRODUCTION:return"https://commerce.adobe.com";default:return"https://commerce-stg.adobe.com"}}function Dd(e,t){for(let r in e){let i=e[r];for(let[a,n]of Object.entries(i)){if(n==null)continue;let o=$o(a);t.set(`items[${r}][${o}]`,n)}}}function $d({url:e,modal:t,is3in1:r}){if(!r||!e?.searchParams)return e;e.searchParams.set("rtc","t"),e.searchParams.set("lo","sl");let i=e.searchParams.get("af");return e.searchParams.set("af",[i,"uc_new_user_iframe","uc_new_system_close"].filter(Boolean).join(",")),e.searchParams.get("cli")!=="doc_cloud"&&e.searchParams.set("cli",t===ot.CRM?"creative":"mini_plans"),e}function Hd(e){let t=new URLSearchParams(window.location.search),r={};Do.forEach(i=>{let a=t.get(i);a!==null&&(r[i]=a)}),Object.keys(r).length>0&&Ei(r,e.searchParams,Do)}function Ho(e){Bd(e);let{env:t,items:r,workflowStep:i,marketSegment:a,customerSegment:n,offerType:o,productArrangementCode:s,landscape:c,modal:l,is3in1:d,preselectPlan:p,...u}=e,f=new URL(zd(t));if(f.pathname=`${Od}${i}`,i!==ce.SEGMENTATION&&i!==ce.CHANGE_PLAN_TEAM_PLANS&&Dd(r,f.searchParams),Ei({...u},f.searchParams,Ba),Hd(f),c===Ve.DRAFT&&Ei({af:Rd},f.searchParams,Ba),i===ce.SEGMENTATION){let x={marketSegment:a,offerType:o,customerSegment:n,productArrangementCode:s,quantity:r?.[0]?.quantity,addonProductArrangementCode:s?r?.find(v=>v.productArrangementCode!==s)?.productArrangementCode:r?.[1]?.productArrangementCode};p?.toLowerCase()==="edu"?f.searchParams.set("ms","EDU"):p?.toLowerCase()==="team"&&f.searchParams.set("cs","TEAM"),Ei(x,f.searchParams,Ba),f.searchParams.get("ot")==="PROMOTION"&&f.searchParams.delete("ot"),f=$d({url:f,modal:l,is3in1:d})}return f.toString()}function Bd(e){for(let t of Id)if(!e[t])throw new Error(`Argument "checkoutData" is not valid, missing: ${t}`);if(e.workflowStep!==ce.SEGMENTATION&&e.workflowStep!==ce.CHANGE_PLAN_TEAM_PLANS&&!e.items)throw new Error('Argument "checkoutData" is not valid, missing: items');return!0}var N=Object.freeze({checkoutClientId:"adobe_com",checkoutWorkflowStep:ce.EMAIL,country:"US",displayOldPrice:!0,displayPerUnit:!1,displayRecurrence:!0,displayTax:!1,displayPlanType:!1,env:Me.PRODUCTION,forceTaxExclusive:!1,language:"en",entitlement:!1,extraOptions:{},modal:!1,promotionCode:"",quantity:1,alternativePrice:!1,wcsApiKey:"wcms-commerce-ims-ro-user-milo",wcsURL:"https://www.adobe.com/web_commerce_artifact",landscape:Ve.PUBLISHED});function Bo({settings:e,providers:t}){function r(n,o){let{checkoutClientId:s,checkoutWorkflowStep:c,country:l,language:d,promotionCode:p,quantity:u,preselectPlan:f,env:x}=e,v={checkoutClientId:s,checkoutWorkflowStep:c,country:l,language:d,promotionCode:p,quantity:u,preselectPlan:f,env:x};if(o)for(let Tt of t.checkout)Tt(o,v);let{checkoutMarketSegment:S,checkoutWorkflowStep:z=c,imsCountry:I,country:C=I??l,language:O=d,quantity:K=u,entitlement:q,upgrade:Q,modal:ee,perpetual:de,promotionCode:ie=p,wcsOsi:W,extraOptions:$,...he}=Object.assign(v,o?.dataset??{},n??{}),be=br(z,ce,N.checkoutWorkflowStep);return v=pi({...he,extraOptions:$,checkoutClientId:s,checkoutMarketSegment:S,country:C,quantity:Ot(K,N.quantity),checkoutWorkflowStep:be,language:O,entitlement:T(q),upgrade:T(Q),modal:ee,perpetual:T(de),promotionCode:ui(ie).effectivePromoCode,wcsOsi:xi(W),preselectPlan:f}),v}function i(n,o){if(!Array.isArray(n)||!n.length||!o)return"";let{env:s,landscape:c}=e,{checkoutClientId:l,checkoutMarketSegment:d,checkoutWorkflowStep:p,country:u,promotionCode:f,quantity:x,preselectPlan:v,ms:S,cs:z,...I}=r(o),C=document.querySelector("meta[name=mas-ff-3in1]"),O=Object.values(ot).includes(o.modal)&&(!C||C.content!=="off"),K=window.frameElement||O?"if":"fp",[{productArrangementCode:q,marketSegments:[Q],customerSegment:ee,offerType:de}]=n,ie=S??Q??d,W=z??ee;v?.toLowerCase()==="edu"?ie="EDU":v?.toLowerCase()==="team"&&(W="TEAM");let $={is3in1:O,checkoutPromoCode:f,clientId:l,context:K,country:u,env:s,items:[],marketSegment:ie,customerSegment:W,offerType:de,productArrangementCode:q,workflowStep:p,landscape:c,...I},he=x[0]>1?x[0]:void 0;if(n.length===1){let{offerId:be}=n[0];$.items.push({id:be,quantity:he})}else $.items.push(...n.map(({offerId:be,productArrangementCode:Tt})=>({id:be,quantity:he,...O?{productArrangementCode:Tt}:{}})));return Ho($)}let{createCheckoutLink:a}=De;return{CheckoutLink:De,CheckoutWorkflowStep:ce,buildCheckoutURL:i,collectCheckoutOptions:r,createCheckoutLink:a}}function Fd({interval:e=200,maxAttempts:t=25}={}){let r=le.module("ims");return new Promise(i=>{r.debug("Waing for IMS to be ready");let a=0;function n(){window.adobeIMS?.initialized?i():++a>t?(r.debug("Timeout"),i()):setTimeout(n,e)}n()})}function Ud(e){return e.then(()=>window.adobeIMS?.isSignedInUser()??!1)}function Gd(e){let t=le.module("ims");return e.then(r=>r?window.adobeIMS.getProfile().then(({countryCode:i})=>(t.debug("Got user country:",i),i),i=>{t.error("Unable to get user country:",i)}):null)}function Fo({}){let e=Fd(),t=Ud(e),r=Gd(t);return{imsReadyPromise:e,imsSignedInPromise:t,imsCountryPromise:r}}var Uo=window.masPriceLiterals;function Go(e){if(Array.isArray(Uo)){let t=e.locale==="id_ID"?"in":e.language,r=a=>Uo.find(n=>wa(n.lang,a)),i=r(t)??r(N.language);if(i)return Object.freeze(i)}return{}}var Fa=function(e,t){return Fa=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},Fa(e,t)};function Sr(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Fa(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var L=function(){return L=Object.assign||function(t){for(var r,i=1,a=arguments.length;i0}),r=[],i=0,a=t;i1)throw new RangeError("integer-width stems only accept a single optional option");a.options[0].replace(jd,function(c,l,d,p,u,f){if(l)t.minimumIntegerDigits=d.length;else{if(p&&u)throw new Error("We currently do not support maximum integer digits");if(f)throw new Error("We currently do not support exact integer digits")}return""});continue}if(Jo.test(a.stem)){t.minimumIntegerDigits=a.stem.length;continue}if(Yo.test(a.stem)){if(a.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");a.stem.replace(Yo,function(c,l,d,p,u,f){return d==="*"?t.minimumFractionDigits=l.length:p&&p[0]==="#"?t.maximumFractionDigits=p.length:u&&f?(t.minimumFractionDigits=u.length,t.maximumFractionDigits=u.length+f.length):(t.minimumFractionDigits=l.length,t.maximumFractionDigits=l.length),""});var n=a.options[0];n==="w"?t=L(L({},t),{trailingZeroDisplay:"stripIfInteger"}):n&&(t=L(L({},t),Xo(n)));continue}if(Zo.test(a.stem)){t=L(L({},t),Xo(a.stem));continue}var o=es(a.stem);o&&(t=L(L({},t),o));var s=Wd(a.stem);s&&(t=L(L({},t),s))}return t}var Tr={AX:["H"],BQ:["H"],CP:["H"],CZ:["H"],DK:["H"],FI:["H"],ID:["H"],IS:["H"],ML:["H"],NE:["H"],RU:["H"],SE:["H"],SJ:["H"],SK:["H"],AS:["h","H"],BT:["h","H"],DJ:["h","H"],ER:["h","H"],GH:["h","H"],IN:["h","H"],LS:["h","H"],PG:["h","H"],PW:["h","H"],SO:["h","H"],TO:["h","H"],VU:["h","H"],WS:["h","H"],"001":["H","h"],AL:["h","H","hB"],TD:["h","H","hB"],"ca-ES":["H","h","hB"],CF:["H","h","hB"],CM:["H","h","hB"],"fr-CA":["H","h","hB"],"gl-ES":["H","h","hB"],"it-CH":["H","h","hB"],"it-IT":["H","h","hB"],LU:["H","h","hB"],NP:["H","h","hB"],PF:["H","h","hB"],SC:["H","h","hB"],SM:["H","h","hB"],SN:["H","h","hB"],TF:["H","h","hB"],VA:["H","h","hB"],CY:["h","H","hb","hB"],GR:["h","H","hb","hB"],CO:["h","H","hB","hb"],DO:["h","H","hB","hb"],KP:["h","H","hB","hb"],KR:["h","H","hB","hb"],NA:["h","H","hB","hb"],PA:["h","H","hB","hb"],PR:["h","H","hB","hb"],VE:["h","H","hB","hb"],AC:["H","h","hb","hB"],AI:["H","h","hb","hB"],BW:["H","h","hb","hB"],BZ:["H","h","hb","hB"],CC:["H","h","hb","hB"],CK:["H","h","hb","hB"],CX:["H","h","hb","hB"],DG:["H","h","hb","hB"],FK:["H","h","hb","hB"],GB:["H","h","hb","hB"],GG:["H","h","hb","hB"],GI:["H","h","hb","hB"],IE:["H","h","hb","hB"],IM:["H","h","hb","hB"],IO:["H","h","hb","hB"],JE:["H","h","hb","hB"],LT:["H","h","hb","hB"],MK:["H","h","hb","hB"],MN:["H","h","hb","hB"],MS:["H","h","hb","hB"],NF:["H","h","hb","hB"],NG:["H","h","hb","hB"],NR:["H","h","hb","hB"],NU:["H","h","hb","hB"],PN:["H","h","hb","hB"],SH:["H","h","hb","hB"],SX:["H","h","hb","hB"],TA:["H","h","hb","hB"],ZA:["H","h","hb","hB"],"af-ZA":["H","h","hB","hb"],AR:["H","h","hB","hb"],CL:["H","h","hB","hb"],CR:["H","h","hB","hb"],CU:["H","h","hB","hb"],EA:["H","h","hB","hb"],"es-BO":["H","h","hB","hb"],"es-BR":["H","h","hB","hb"],"es-EC":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"es-PE":["H","h","hB","hb"],GT:["H","h","hB","hb"],HN:["H","h","hB","hb"],IC:["H","h","hB","hb"],KG:["H","h","hB","hb"],KM:["H","h","hB","hb"],LK:["H","h","hB","hb"],MA:["H","h","hB","hb"],MX:["H","h","hB","hb"],NI:["H","h","hB","hb"],PY:["H","h","hB","hb"],SV:["H","h","hB","hb"],UY:["H","h","hB","hb"],JP:["H","h","K"],AD:["H","hB"],AM:["H","hB"],AO:["H","hB"],AT:["H","hB"],AW:["H","hB"],BE:["H","hB"],BF:["H","hB"],BJ:["H","hB"],BL:["H","hB"],BR:["H","hB"],CG:["H","hB"],CI:["H","hB"],CV:["H","hB"],DE:["H","hB"],EE:["H","hB"],FR:["H","hB"],GA:["H","hB"],GF:["H","hB"],GN:["H","hB"],GP:["H","hB"],GW:["H","hB"],HR:["H","hB"],IL:["H","hB"],IT:["H","hB"],KZ:["H","hB"],MC:["H","hB"],MD:["H","hB"],MF:["H","hB"],MQ:["H","hB"],MZ:["H","hB"],NC:["H","hB"],NL:["H","hB"],PM:["H","hB"],PT:["H","hB"],RE:["H","hB"],RO:["H","hB"],SI:["H","hB"],SR:["H","hB"],ST:["H","hB"],TG:["H","hB"],TR:["H","hB"],WF:["H","hB"],YT:["H","hB"],BD:["h","hB","H"],PK:["h","hB","H"],AZ:["H","hB","h"],BA:["H","hB","h"],BG:["H","hB","h"],CH:["H","hB","h"],GE:["H","hB","h"],LI:["H","hB","h"],ME:["H","hB","h"],RS:["H","hB","h"],UA:["H","hB","h"],UZ:["H","hB","h"],XK:["H","hB","h"],AG:["h","hb","H","hB"],AU:["h","hb","H","hB"],BB:["h","hb","H","hB"],BM:["h","hb","H","hB"],BS:["h","hb","H","hB"],CA:["h","hb","H","hB"],DM:["h","hb","H","hB"],"en-001":["h","hb","H","hB"],FJ:["h","hb","H","hB"],FM:["h","hb","H","hB"],GD:["h","hb","H","hB"],GM:["h","hb","H","hB"],GU:["h","hb","H","hB"],GY:["h","hb","H","hB"],JM:["h","hb","H","hB"],KI:["h","hb","H","hB"],KN:["h","hb","H","hB"],KY:["h","hb","H","hB"],LC:["h","hb","H","hB"],LR:["h","hb","H","hB"],MH:["h","hb","H","hB"],MP:["h","hb","H","hB"],MW:["h","hb","H","hB"],NZ:["h","hb","H","hB"],SB:["h","hb","H","hB"],SG:["h","hb","H","hB"],SL:["h","hb","H","hB"],SS:["h","hb","H","hB"],SZ:["h","hb","H","hB"],TC:["h","hb","H","hB"],TT:["h","hb","H","hB"],UM:["h","hb","H","hB"],US:["h","hb","H","hB"],VC:["h","hb","H","hB"],VG:["h","hb","H","hB"],VI:["h","hb","H","hB"],ZM:["h","hb","H","hB"],BO:["H","hB","h","hb"],EC:["H","hB","h","hb"],ES:["H","hB","h","hb"],GQ:["H","hB","h","hb"],PE:["H","hB","h","hb"],AE:["h","hB","hb","H"],"ar-001":["h","hB","hb","H"],BH:["h","hB","hb","H"],DZ:["h","hB","hb","H"],EG:["h","hB","hb","H"],EH:["h","hB","hb","H"],HK:["h","hB","hb","H"],IQ:["h","hB","hb","H"],JO:["h","hB","hb","H"],KW:["h","hB","hb","H"],LB:["h","hB","hb","H"],LY:["h","hB","hb","H"],MO:["h","hB","hb","H"],MR:["h","hB","hb","H"],OM:["h","hB","hb","H"],PH:["h","hB","hb","H"],PS:["h","hB","hb","H"],QA:["h","hB","hb","H"],SA:["h","hB","hb","H"],SD:["h","hB","hb","H"],SY:["h","hB","hb","H"],TN:["h","hB","hb","H"],YE:["h","hB","hb","H"],AF:["H","hb","hB","h"],LA:["H","hb","hB","h"],CN:["H","hB","hb","h"],LV:["H","hB","hb","h"],TL:["H","hB","hb","h"],"zu-ZA":["H","hB","hb","h"],CD:["hB","H"],IR:["hB","H"],"hi-IN":["hB","h","H"],"kn-IN":["hB","h","H"],"ml-IN":["hB","h","H"],"te-IN":["hB","h","H"],KH:["hB","h","H","hb"],"ta-IN":["hB","h","hb","H"],BN:["hb","hB","h","H"],MY:["hb","hB","h","H"],ET:["hB","hb","h","H"],"gu-IN":["hB","hb","h","H"],"mr-IN":["hB","hb","h","H"],"pa-IN":["hB","hb","h","H"],TW:["hB","hb","h","H"],KE:["hB","hb","H","h"],MM:["hB","hb","H","h"],TZ:["hB","hb","H","h"],UG:["hB","hb","H","h"]};function rs(e,t){for(var r="",i=0;i>1),c="a",l=Yd(t);for((l=="H"||l=="k")&&(s=0);s-- >0;)r+=c;for(;o-- >0;)r=l+r}else a==="J"?r+="H":r+=a}return r}function Yd(e){var t=e.hourCycle;if(t===void 0&&e.hourCycles&&e.hourCycles.length&&(t=e.hourCycles[0]),t)switch(t){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}var r=e.language,i;r!=="root"&&(i=e.maximize().region);var a=Tr[i||""]||Tr[r||""]||Tr["".concat(r,"-001")]||Tr["001"];return a[0]}var qa,Xd=new RegExp("^".concat(Ga.source,"*")),Kd=new RegExp("".concat(Ga.source,"*$"));function M(e,t){return{start:e,end:t}}var Qd=!!String.prototype.startsWith,Zd=!!String.fromCodePoint,Jd=!!Object.fromEntries,eh=!!String.prototype.codePointAt,th=!!String.prototype.trimStart,rh=!!String.prototype.trimEnd,ih=!!Number.isSafeInteger,ah=ih?Number.isSafeInteger:function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e&&Math.abs(e)<=9007199254740991},ja=!0;try{is=ss("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu"),ja=((qa=is.exec("a"))===null||qa===void 0?void 0:qa[0])==="a"}catch{ja=!1}var is,as=Qd?function(t,r,i){return t.startsWith(r,i)}:function(t,r,i){return t.slice(i,i+r.length)===r},Wa=Zd?String.fromCodePoint:function(){for(var t=[],r=0;rn;){if(o=t[n++],o>1114111)throw RangeError(o+" is not a valid code point");i+=o<65536?String.fromCharCode(o):String.fromCharCode(((o-=65536)>>10)+55296,o%1024+56320)}return i},ns=Jd?Object.fromEntries:function(t){for(var r={},i=0,a=t;i=i)){var a=t.charCodeAt(r),n;return a<55296||a>56319||r+1===i||(n=t.charCodeAt(r+1))<56320||n>57343?a:(a-55296<<10)+(n-56320)+65536}},nh=th?function(t){return t.trimStart()}:function(t){return t.replace(Xd,"")},oh=rh?function(t){return t.trimEnd()}:function(t){return t.replace(Kd,"")};function ss(e,t){return new RegExp(e,t)}var Ya;ja?(Va=ss("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu"),Ya=function(t,r){var i;Va.lastIndex=r;var a=Va.exec(t);return(i=a[1])!==null&&i!==void 0?i:""}):Ya=function(t,r){for(var i=[];;){var a=os(t,r);if(a===void 0||ls(a)||lh(a))break;i.push(a),r+=a>=65536?2:1}return Wa.apply(void 0,i)};var Va,cs=function(){function e(t,r){r===void 0&&(r={}),this.message=t,this.position={offset:0,line:1,column:1},this.ignoreTag=!!r.ignoreTag,this.locale=r.locale,this.requiresOtherClause=!!r.requiresOtherClause,this.shouldParseSkeletons=!!r.shouldParseSkeletons}return e.prototype.parse=function(){if(this.offset()!==0)throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},e.prototype.parseMessage=function(t,r,i){for(var a=[];!this.isEOF();){var n=this.char();if(n===123){var o=this.parseArgument(t,i);if(o.err)return o;a.push(o.val)}else{if(n===125&&t>0)break;if(n===35&&(r==="plural"||r==="selectordinal")){var s=this.clonePosition();this.bump(),a.push({type:V.pound,location:M(s,this.clonePosition())})}else if(n===60&&!this.ignoreTag&&this.peek()===47){if(i)break;return this.error(k.UNMATCHED_CLOSING_TAG,M(this.clonePosition(),this.clonePosition()))}else if(n===60&&!this.ignoreTag&&Xa(this.peek()||0)){var o=this.parseTag(t,r);if(o.err)return o;a.push(o.val)}else{var o=this.parseLiteral(t,r);if(o.err)return o;a.push(o.val)}}}return{val:a,err:null}},e.prototype.parseTag=function(t,r){var i=this.clonePosition();this.bump();var a=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:V.literal,value:"<".concat(a,"/>"),location:M(i,this.clonePosition())},err:null};if(this.bumpIf(">")){var n=this.parseMessage(t+1,r,!0);if(n.err)return n;var o=n.val,s=this.clonePosition();if(this.bumpIf("")?{val:{type:V.tag,value:a,children:o,location:M(i,this.clonePosition())},err:null}:this.error(k.INVALID_TAG,M(s,this.clonePosition())))}else return this.error(k.UNCLOSED_TAG,M(i,this.clonePosition()))}else return this.error(k.INVALID_TAG,M(i,this.clonePosition()))},e.prototype.parseTagName=function(){var t=this.offset();for(this.bump();!this.isEOF()&&ch(this.char());)this.bump();return this.message.slice(t,this.offset())},e.prototype.parseLiteral=function(t,r){for(var i=this.clonePosition(),a="";;){var n=this.tryParseQuote(r);if(n){a+=n;continue}var o=this.tryParseUnquoted(t,r);if(o){a+=o;continue}var s=this.tryParseLeftAngleBracket();if(s){a+=s;continue}break}var c=M(i,this.clonePosition());return{val:{type:V.literal,value:a,location:c},err:null}},e.prototype.tryParseLeftAngleBracket=function(){return!this.isEOF()&&this.char()===60&&(this.ignoreTag||!sh(this.peek()||0))?(this.bump(),"<"):null},e.prototype.tryParseQuote=function(t){if(this.isEOF()||this.char()!==39)return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if(t==="plural"||t==="selectordinal")break;return null;default:return null}this.bump();var r=[this.char()];for(this.bump();!this.isEOF();){var i=this.char();if(i===39)if(this.peek()===39)r.push(39),this.bump();else{this.bump();break}else r.push(i);this.bump()}return Wa.apply(void 0,r)},e.prototype.tryParseUnquoted=function(t,r){if(this.isEOF())return null;var i=this.char();return i===60||i===123||i===35&&(r==="plural"||r==="selectordinal")||i===125&&t>0?null:(this.bump(),Wa(i))},e.prototype.parseArgument=function(t,r){var i=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(k.EXPECT_ARGUMENT_CLOSING_BRACE,M(i,this.clonePosition()));if(this.char()===125)return this.bump(),this.error(k.EMPTY_ARGUMENT,M(i,this.clonePosition()));var a=this.parseIdentifierIfPossible().value;if(!a)return this.error(k.MALFORMED_ARGUMENT,M(i,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(k.EXPECT_ARGUMENT_CLOSING_BRACE,M(i,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:V.argument,value:a,location:M(i,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(k.EXPECT_ARGUMENT_CLOSING_BRACE,M(i,this.clonePosition())):this.parseArgumentOptions(t,r,a,i);default:return this.error(k.MALFORMED_ARGUMENT,M(i,this.clonePosition()))}},e.prototype.parseIdentifierIfPossible=function(){var t=this.clonePosition(),r=this.offset(),i=Ya(this.message,r),a=r+i.length;this.bumpTo(a);var n=this.clonePosition(),o=M(t,n);return{value:i,location:o}},e.prototype.parseArgumentOptions=function(t,r,i,a){var n,o=this.clonePosition(),s=this.parseIdentifierIfPossible().value,c=this.clonePosition();switch(s){case"":return this.error(k.EXPECT_ARGUMENT_TYPE,M(o,c));case"number":case"date":case"time":{this.bumpSpace();var l=null;if(this.bumpIf(",")){this.bumpSpace();var d=this.clonePosition(),p=this.parseSimpleArgStyleIfPossible();if(p.err)return p;var u=oh(p.val);if(u.length===0)return this.error(k.EXPECT_ARGUMENT_STYLE,M(this.clonePosition(),this.clonePosition()));var f=M(d,this.clonePosition());l={style:u,styleLocation:f}}var x=this.tryParseArgumentClose(a);if(x.err)return x;var v=M(a,this.clonePosition());if(l&&as(l?.style,"::",0)){var S=nh(l.style.slice(2));if(s==="number"){var p=this.parseNumberSkeletonFromString(S,l.styleLocation);return p.err?p:{val:{type:V.number,value:i,location:v,style:p.val},err:null}}else{if(S.length===0)return this.error(k.EXPECT_DATE_TIME_SKELETON,v);var z=S;this.locale&&(z=rs(S,this.locale));var u={type:ht.dateTime,pattern:z,location:l.styleLocation,parsedOptions:this.shouldParseSkeletons?jo(z):{}},I=s==="date"?V.date:V.time;return{val:{type:I,value:i,location:v,style:u},err:null}}}return{val:{type:s==="number"?V.number:s==="date"?V.date:V.time,value:i,location:v,style:(n=l?.style)!==null&&n!==void 0?n:null},err:null}}case"plural":case"selectordinal":case"select":{var C=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(k.EXPECT_SELECT_ARGUMENT_OPTIONS,M(C,L({},C)));this.bumpSpace();var O=this.parseIdentifierIfPossible(),K=0;if(s!=="select"&&O.value==="offset"){if(!this.bumpIf(":"))return this.error(k.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,M(this.clonePosition(),this.clonePosition()));this.bumpSpace();var p=this.tryParseDecimalInteger(k.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,k.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);if(p.err)return p;this.bumpSpace(),O=this.parseIdentifierIfPossible(),K=p.val}var q=this.tryParsePluralOrSelectOptions(t,s,r,O);if(q.err)return q;var x=this.tryParseArgumentClose(a);if(x.err)return x;var Q=M(a,this.clonePosition());return s==="select"?{val:{type:V.select,value:i,options:ns(q.val),location:Q},err:null}:{val:{type:V.plural,value:i,options:ns(q.val),offset:K,pluralType:s==="plural"?"cardinal":"ordinal",location:Q},err:null}}default:return this.error(k.INVALID_ARGUMENT_TYPE,M(o,c))}},e.prototype.tryParseArgumentClose=function(t){return this.isEOF()||this.char()!==125?this.error(k.EXPECT_ARGUMENT_CLOSING_BRACE,M(t,this.clonePosition())):(this.bump(),{val:!0,err:null})},e.prototype.parseSimpleArgStyleIfPossible=function(){for(var t=0,r=this.clonePosition();!this.isEOF();){var i=this.char();switch(i){case 39:{this.bump();var a=this.clonePosition();if(!this.bumpUntil("'"))return this.error(k.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,M(a,this.clonePosition()));this.bump();break}case 123:{t+=1,this.bump();break}case 125:{if(t>0)t-=1;else return{val:this.message.slice(r.offset,this.offset()),err:null};break}default:this.bump();break}}return{val:this.message.slice(r.offset,this.offset()),err:null}},e.prototype.parseNumberSkeletonFromString=function(t,r){var i=[];try{i=Qo(t)}catch{return this.error(k.INVALID_NUMBER_SKELETON,r)}return{val:{type:ht.number,tokens:i,location:r,parsedOptions:this.shouldParseSkeletons?ts(i):{}},err:null}},e.prototype.tryParsePluralOrSelectOptions=function(t,r,i,a){for(var n,o=!1,s=[],c=new Set,l=a.value,d=a.location;;){if(l.length===0){var p=this.clonePosition();if(r!=="select"&&this.bumpIf("=")){var u=this.tryParseDecimalInteger(k.EXPECT_PLURAL_ARGUMENT_SELECTOR,k.INVALID_PLURAL_ARGUMENT_SELECTOR);if(u.err)return u;d=M(p,this.clonePosition()),l=this.message.slice(p.offset,this.offset())}else break}if(c.has(l))return this.error(r==="select"?k.DUPLICATE_SELECT_ARGUMENT_SELECTOR:k.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,d);l==="other"&&(o=!0),this.bumpSpace();var f=this.clonePosition();if(!this.bumpIf("{"))return this.error(r==="select"?k.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:k.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,M(this.clonePosition(),this.clonePosition()));var x=this.parseMessage(t+1,r,i);if(x.err)return x;var v=this.tryParseArgumentClose(f);if(v.err)return v;s.push([l,{value:x.val,location:M(f,this.clonePosition())}]),c.add(l),this.bumpSpace(),n=this.parseIdentifierIfPossible(),l=n.value,d=n.location}return s.length===0?this.error(r==="select"?k.EXPECT_SELECT_ARGUMENT_SELECTOR:k.EXPECT_PLURAL_ARGUMENT_SELECTOR,M(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!o?this.error(k.MISSING_OTHER_CLAUSE,M(this.clonePosition(),this.clonePosition())):{val:s,err:null}},e.prototype.tryParseDecimalInteger=function(t,r){var i=1,a=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(i=-1);for(var n=!1,o=0;!this.isEOF();){var s=this.char();if(s>=48&&s<=57)n=!0,o=o*10+(s-48),this.bump();else break}var c=M(a,this.clonePosition());return n?(o*=i,ah(o)?{val:o,err:null}:this.error(r,c)):this.error(t,c)},e.prototype.offset=function(){return this.position.offset},e.prototype.isEOF=function(){return this.offset()===this.message.length},e.prototype.clonePosition=function(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}},e.prototype.char=function(){var t=this.position.offset;if(t>=this.message.length)throw Error("out of bound");var r=os(this.message,t);if(r===void 0)throw Error("Offset ".concat(t," is at invalid UTF-16 code unit boundary"));return r},e.prototype.error=function(t,r){return{val:null,err:{kind:t,message:this.message,location:r}}},e.prototype.bump=function(){if(!this.isEOF()){var t=this.char();t===10?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=t<65536?1:2)}},e.prototype.bumpIf=function(t){if(as(this.message,t,this.offset())){for(var r=0;r=0?(this.bumpTo(i),!0):(this.bumpTo(this.message.length),!1)},e.prototype.bumpTo=function(t){if(this.offset()>t)throw Error("targetOffset ".concat(t," must be greater than or equal to the current offset ").concat(this.offset()));for(t=Math.min(t,this.message.length);;){var r=this.offset();if(r===t)break;if(r>t)throw Error("targetOffset ".concat(t," is at invalid UTF-16 code unit boundary"));if(this.bump(),this.isEOF())break}},e.prototype.bumpSpace=function(){for(;!this.isEOF()&&ls(this.char());)this.bump()},e.prototype.peek=function(){if(this.isEOF())return null;var t=this.char(),r=this.offset(),i=this.message.charCodeAt(r+(t>=65536?2:1));return i??null},e}();function Xa(e){return e>=97&&e<=122||e>=65&&e<=90}function sh(e){return Xa(e)||e===47}function ch(e){return e===45||e===46||e>=48&&e<=57||e===95||e>=97&&e<=122||e>=65&&e<=90||e==183||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8255&&e<=8256||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}function ls(e){return e>=9&&e<=13||e===32||e===133||e>=8206&&e<=8207||e===8232||e===8233}function lh(e){return e>=33&&e<=35||e===36||e>=37&&e<=39||e===40||e===41||e===42||e===43||e===44||e===45||e>=46&&e<=47||e>=58&&e<=59||e>=60&&e<=62||e>=63&&e<=64||e===91||e===92||e===93||e===94||e===96||e===123||e===124||e===125||e===126||e===161||e>=162&&e<=165||e===166||e===167||e===169||e===171||e===172||e===174||e===176||e===177||e===182||e===187||e===191||e===215||e===247||e>=8208&&e<=8213||e>=8214&&e<=8215||e===8216||e===8217||e===8218||e>=8219&&e<=8220||e===8221||e===8222||e===8223||e>=8224&&e<=8231||e>=8240&&e<=8248||e===8249||e===8250||e>=8251&&e<=8254||e>=8257&&e<=8259||e===8260||e===8261||e===8262||e>=8263&&e<=8273||e===8274||e===8275||e>=8277&&e<=8286||e>=8592&&e<=8596||e>=8597&&e<=8601||e>=8602&&e<=8603||e>=8604&&e<=8607||e===8608||e>=8609&&e<=8610||e===8611||e>=8612&&e<=8613||e===8614||e>=8615&&e<=8621||e===8622||e>=8623&&e<=8653||e>=8654&&e<=8655||e>=8656&&e<=8657||e===8658||e===8659||e===8660||e>=8661&&e<=8691||e>=8692&&e<=8959||e>=8960&&e<=8967||e===8968||e===8969||e===8970||e===8971||e>=8972&&e<=8991||e>=8992&&e<=8993||e>=8994&&e<=9e3||e===9001||e===9002||e>=9003&&e<=9083||e===9084||e>=9085&&e<=9114||e>=9115&&e<=9139||e>=9140&&e<=9179||e>=9180&&e<=9185||e>=9186&&e<=9254||e>=9255&&e<=9279||e>=9280&&e<=9290||e>=9291&&e<=9311||e>=9472&&e<=9654||e===9655||e>=9656&&e<=9664||e===9665||e>=9666&&e<=9719||e>=9720&&e<=9727||e>=9728&&e<=9838||e===9839||e>=9840&&e<=10087||e===10088||e===10089||e===10090||e===10091||e===10092||e===10093||e===10094||e===10095||e===10096||e===10097||e===10098||e===10099||e===10100||e===10101||e>=10132&&e<=10175||e>=10176&&e<=10180||e===10181||e===10182||e>=10183&&e<=10213||e===10214||e===10215||e===10216||e===10217||e===10218||e===10219||e===10220||e===10221||e===10222||e===10223||e>=10224&&e<=10239||e>=10240&&e<=10495||e>=10496&&e<=10626||e===10627||e===10628||e===10629||e===10630||e===10631||e===10632||e===10633||e===10634||e===10635||e===10636||e===10637||e===10638||e===10639||e===10640||e===10641||e===10642||e===10643||e===10644||e===10645||e===10646||e===10647||e===10648||e>=10649&&e<=10711||e===10712||e===10713||e===10714||e===10715||e>=10716&&e<=10747||e===10748||e===10749||e>=10750&&e<=11007||e>=11008&&e<=11055||e>=11056&&e<=11076||e>=11077&&e<=11078||e>=11079&&e<=11084||e>=11085&&e<=11123||e>=11124&&e<=11125||e>=11126&&e<=11157||e===11158||e>=11159&&e<=11263||e>=11776&&e<=11777||e===11778||e===11779||e===11780||e===11781||e>=11782&&e<=11784||e===11785||e===11786||e===11787||e===11788||e===11789||e>=11790&&e<=11798||e===11799||e>=11800&&e<=11801||e===11802||e===11803||e===11804||e===11805||e>=11806&&e<=11807||e===11808||e===11809||e===11810||e===11811||e===11812||e===11813||e===11814||e===11815||e===11816||e===11817||e>=11818&&e<=11822||e===11823||e>=11824&&e<=11833||e>=11834&&e<=11835||e>=11836&&e<=11839||e===11840||e===11841||e===11842||e>=11843&&e<=11855||e>=11856&&e<=11857||e===11858||e>=11859&&e<=11903||e>=12289&&e<=12291||e===12296||e===12297||e===12298||e===12299||e===12300||e===12301||e===12302||e===12303||e===12304||e===12305||e>=12306&&e<=12307||e===12308||e===12309||e===12310||e===12311||e===12312||e===12313||e===12314||e===12315||e===12316||e===12317||e>=12318&&e<=12319||e===12320||e===12336||e===64830||e===64831||e>=65093&&e<=65094}function Ka(e){e.forEach(function(t){if(delete t.location,ki(t)||_i(t))for(var r in t.options)delete t.options[r].location,Ka(t.options[r].value);else Si(t)&&Li(t.style)||(Ci(t)||Ti(t))&&Cr(t.style)?delete t.style.location:Pi(t)&&Ka(t.children)})}function ds(e,t){t===void 0&&(t={}),t=L({shouldParseSkeletons:!0,requiresOtherClause:!0},t);var r=new cs(e,t).parse();if(r.err){var i=SyntaxError(k[r.err.kind]);throw i.location=r.err.location,i.originalMessage=r.err.message,i}return t?.captureLocation||Ka(r.val),r.val}function kr(e,t){var r=t&&t.cache?t.cache:gh,i=t&&t.serializer?t.serializer:uh,a=t&&t.strategy?t.strategy:hh;return a(e,{cache:r,serializer:i})}function dh(e){return e==null||typeof e=="number"||typeof e=="boolean"}function hs(e,t,r,i){var a=dh(i)?i:r(i),n=t.get(a);return typeof n>"u"&&(n=e.call(this,i),t.set(a,n)),n}function ps(e,t,r){var i=Array.prototype.slice.call(arguments,3),a=r(i),n=t.get(a);return typeof n>"u"&&(n=e.apply(this,i),t.set(a,n)),n}function Qa(e,t,r,i,a){return r.bind(t,e,i,a)}function hh(e,t){var r=e.length===1?hs:ps;return Qa(e,this,r,t.cache.create(),t.serializer)}function ph(e,t){return Qa(e,this,ps,t.cache.create(),t.serializer)}function mh(e,t){return Qa(e,this,hs,t.cache.create(),t.serializer)}var uh=function(){return JSON.stringify(arguments)};function Za(){this.cache=Object.create(null)}Za.prototype.get=function(e){return this.cache[e]};Za.prototype.set=function(e,t){this.cache[e]=t};var gh={create:function(){return new Za}},Mi={variadic:ph,monadic:mh};var pt;(function(e){e.MISSING_VALUE="MISSING_VALUE",e.INVALID_VALUE="INVALID_VALUE",e.MISSING_INTL_API="MISSING_INTL_API"})(pt||(pt={}));var _r=function(e){Sr(t,e);function t(r,i,a){var n=e.call(this,r)||this;return n.code=i,n.originalMessage=a,n}return t.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},t}(Error);var Ja=function(e){Sr(t,e);function t(r,i,a,n){return e.call(this,'Invalid values for "'.concat(r,'": "').concat(i,'". Options are "').concat(Object.keys(a).join('", "'),'"'),pt.INVALID_VALUE,n)||this}return t}(_r);var ms=function(e){Sr(t,e);function t(r,i,a){return e.call(this,'Value for "'.concat(r,'" must be of type ').concat(i),pt.INVALID_VALUE,a)||this}return t}(_r);var us=function(e){Sr(t,e);function t(r,i){return e.call(this,'The intl string context variable "'.concat(r,'" was not provided to the string "').concat(i,'"'),pt.MISSING_VALUE,i)||this}return t}(_r);var se;(function(e){e[e.literal=0]="literal",e[e.object=1]="object"})(se||(se={}));function fh(e){return e.length<2?e:e.reduce(function(t,r){var i=t[t.length-1];return!i||i.type!==se.literal||r.type!==se.literal?t.push(r):i.value+=r.value,t},[])}function xh(e){return typeof e=="function"}function Pr(e,t,r,i,a,n,o){if(e.length===1&&Ua(e[0]))return[{type:se.literal,value:e[0].value}];for(var s=[],c=0,l=e;c0?new Intl.Locale(r[0]):new Intl.Locale(typeof t=="string"?t:t[0])},e.__parse=ds,e.formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},e}();var fs=gs;var tn={recurrenceLabel:"{recurrenceTerm, select, MONTH {/mo} YEAR {/yr} other {}}",recurrenceAriaLabel:"{recurrenceTerm, select, MONTH {per month} YEAR {per year} other {}}",perUnitLabel:"{perUnit, select, LICENSE {per license} other {}}",perUnitAriaLabel:"{perUnit, select, LICENSE {per license} other {}}",freeLabel:"Free",freeAriaLabel:"Free",taxExclusiveLabel:"{taxTerm, select, GST {excl. GST} VAT {excl. VAT} TAX {excl. tax} IVA {excl. IVA} SST {excl. SST} KDV {excl. KDV} other {}}",taxInclusiveLabel:"{taxTerm, select, GST {incl. GST} VAT {incl. VAT} TAX {incl. tax} IVA {incl. IVA} SST {incl. SST} KDV {incl. KDV} other {}}",alternativePriceAriaLabel:"Alternatively at",strikethroughAriaLabel:"Regularly at",planTypeLabel:"{planType, select, ABM {Annual, billed monthly} other {}}"},wh=lo("ConsonantTemplates/price"),Eh=/<\/?[^>]+(>|$)/g,j={container:"price",containerOptical:"price-optical",containerStrikethrough:"price-strikethrough",containerPromoStrikethrough:"price-promo-strikethrough",containerAlternative:"price-alternative",containerAnnual:"price-annual",containerAnnualPrefix:"price-annual-prefix",containerAnnualSuffix:"price-annual-suffix",disabled:"disabled",currencySpace:"price-currency-space",currencySymbol:"price-currency-symbol",decimals:"price-decimals",decimalsDelimiter:"price-decimals-delimiter",integer:"price-integer",recurrence:"price-recurrence",taxInclusivity:"price-tax-inclusivity",unitType:"price-unit-type"},We={perUnitLabel:"perUnitLabel",perUnitAriaLabel:"perUnitAriaLabel",recurrenceLabel:"recurrenceLabel",recurrenceAriaLabel:"recurrenceAriaLabel",taxExclusiveLabel:"taxExclusiveLabel",taxInclusiveLabel:"taxInclusiveLabel",strikethroughAriaLabel:"strikethroughAriaLabel",alternativePriceAriaLabel:"alternativePriceAriaLabel"},rn="TAX_EXCLUSIVE",Ah=e=>oo(e)?Object.entries(e).filter(([,t])=>Rt(t)||hi(t)||t===!0).reduce((t,[r,i])=>t+` ${r}${i===!0?"":'="'+no(i)+'"'}`,""):"",Y=(e,t,r,i=!1)=>`${i?Po(t):t??""}`;function Sh(e){e=e.replaceAll("","</a>");let t=/]+(>|$)/g;return e.match(t)?.forEach(i=>{let a=i.replace("",">");e=e.replaceAll(i,a)}),e}function Ch(e){e=e.replaceAll("</a>","");let t=/<a (?!>)(.*?)(>|$)/g;return e.match(t)?.forEach(i=>{let a=i.replace("<a ","");e=e.replaceAll(i,a)}),e}function $e(e,t,r,i){let a=e[r];if(a==null)return"";let n=a.includes("<"),o=a.includes("${t}`:r&&(v=`${r}`),c&&(v+=f+x),v+=Y(j.integer,s),v+=Y(j.decimalsDelimiter,n),v+=Y(j.decimals,a),c||(v+=x+f),v+=Y(j.recurrence,l,null,!0),v+=Y(j.unitType,d,null,!0),v+=Y(j.taxInclusivity,p,!0),Y(e,v,{...u})}var ae=({isAlternativePrice:e=!1,displayOptical:t=!1,displayStrikethrough:r=!1,displayPromoStrikethrough:i=!1,displayAnnual:a=!1,instant:n=void 0}={})=>({country:o,displayFormatted:s=!0,displayRecurrence:c=!0,displayPerUnit:l=!1,displayTax:d=!1,language:p,literals:u={},quantity:f=1,space:x=!1,isPromoApplied:v=!1}={},{commitment:S,offerSelectorIds:z,formatString:I,price:C,priceWithoutDiscount:O,taxDisplay:K,taxTerm:q,term:Q,usePrecision:ee,promotion:de}={},ie={})=>{Object.entries({country:o,formatString:I,language:p,price:C}).forEach(([Tl,kl])=>{if(kl==null)throw new Error(`Argument "${Tl}" is missing for osi ${z?.toString()}, country ${o}, language ${p}`)});let W={...tn,...u},$=`${p.toLowerCase()}-${o.toUpperCase()}`,he;de&&!v&&O?he=e||i?C:O:r&&O?he=O:he=C;let be=t?Mo:Ro;a&&(be=Oo);let{accessiblePrice:Tt,recurrenceTerm:jn,...Wn}=be({commitment:S,formatString:I,instant:n,isIndianPrice:o==="IN",originalPrice:C,priceWithoutDiscount:O,price:t?C:he,promotion:de,quantity:f,term:Q,usePrecision:ee}),Zi="",Ji="",ea="";T(c)&&jn&&(ea=$e(W,$,We.recurrenceLabel,{recurrenceTerm:jn}));let ni="";T(l)&&(x&&(ni+=" "),ni+=$e(W,$,We.perUnitLabel,{perUnit:"LICENSE"}));let oi="";T(d)&&q&&(x&&(oi+=" "),oi+=$e(W,$,K===rn?We.taxExclusiveLabel:We.taxInclusiveLabel,{taxTerm:q})),r&&(Zi=$e(W,$,We.strikethroughAriaLabel,{strikethroughPrice:Zi})),e&&(Ji=$e(W,$,We.alternativePriceAriaLabel,{alternativePrice:Ji}));let Je=j.container;if(t&&(Je+=" "+j.containerOptical),r&&(Je+=" "+j.containerStrikethrough),i&&(Je+=" "+j.containerPromoStrikethrough),e&&(Je+=" "+j.containerAlternative),a&&(Je+=" "+j.containerAnnual),T(s))return Th(Je,{...Wn,accessibleLabel:Zi,altAccessibleLabel:Ji,recurrenceLabel:ea,perUnitLabel:ni,taxInclusivityLabel:oi},ie);let{currencySymbol:Yn,decimals:wl,decimalsDelimiter:El,hasCurrencySpace:Xn,integer:Al,isCurrencyFirst:Sl}=Wn,kt=[Al,El,wl];Sl?(kt.unshift(Xn?"\xA0":""),kt.unshift(Yn)):(kt.push(Xn?"\xA0":""),kt.push(Yn)),kt.push(ea,ni,oi);let Cl=kt.join("");return Y(Je,Cl,ie)},xs=()=>(e,t,r)=>{let i=dt(t.promotion,t.promotion?.displaySummary?.instant,Array.isArray(e.quantity)?e.quantity[0]:e.quantity),n=(e.displayOldPrice===void 0||T(e.displayOldPrice))&&t.priceWithoutDiscount&&t.priceWithoutDiscount!=t.price&&(!t.promotion||i);return`${n?ae({displayStrikethrough:!0})({isPromoApplied:i,...e},t,r)+" ":""}${ae({isAlternativePrice:n})({isPromoApplied:i,...e},t,r)}`},vs=()=>(e,t,r)=>{let{instant:i}=e;try{i||(i=new URLSearchParams(document.location.search).get("instant")),i&&(i=new Date(i))}catch{i=void 0}let a=dt(t.promotion,i,Array.isArray(e.quantity)?e.quantity[0]:e.quantity),n={...e,displayTax:!1,displayPerUnit:!1,isPromoApplied:a};if(!a)return ae()(e,{...t,price:t.priceWithoutDiscount},r)+Y(j.containerAnnualPrefix," (")+ae({displayAnnual:!0,instant:i})(n,{...t,price:t.priceWithoutDiscount},r)+Y(j.containerAnnualSuffix,")");let s=(e.displayOldPrice===void 0||T(e.displayOldPrice))&&t.priceWithoutDiscount&&t.priceWithoutDiscount!=t.price;return`${s?ae({displayStrikethrough:!0})(n,t,r)+" ":""}${ae({isAlternativePrice:s})({isPromoApplied:a,...e},t,r)}${Y(j.containerAnnualPrefix," (")}${ae({displayAnnual:!0,instant:i})(n,t,r)}${Y(j.containerAnnualSuffix,")")}`},bs=()=>(e,t,r)=>{let i={...e,displayTax:!1,displayPerUnit:!1};return`${ae({isAlternativePrice:e.displayOldPrice})(e,t,r)}${Y(j.containerAnnualPrefix," (")}${ae({displayAnnual:!0})(i,t,r)}${Y(j.containerAnnualSuffix,")")}`};var Lr={...j,containerLegal:"price-legal",planType:"price-plan-type"},Ri={...We,planTypeLabel:"planTypeLabel"};function kh(e,{perUnitLabel:t,taxInclusivityLabel:r,planTypeLabel:i},a={}){let n="";return n+=Y(Lr.unitType,t,null,!0),r&&i&&(r+=". "),n+=Y(Lr.taxInclusivity,r,!0),n+=Y(Lr.planType,i,null),Y(e,n,{...a})}var ys=({country:e,displayPerUnit:t=!1,displayTax:r=!1,displayPlanType:i=!1,language:a,literals:n={}}={},{taxDisplay:o,taxTerm:s,planType:c}={},l={})=>{let d={...tn,...n},p=`${a.toLowerCase()}-${e.toUpperCase()}`,u="";T(t)&&(u=$e(d,p,Ri.perUnitLabel,{perUnit:"LICENSE"}));let f="";e==="US"&&a==="en"&&(r=!1),T(r)&&s&&(f=$e(d,p,o===rn?Ri.taxExclusiveLabel:Ri.taxInclusiveLabel,{taxTerm:s}));let x="";T(i)&&c&&(x=$e(d,p,Ri.planTypeLabel,{planType:c}));let v=Lr.container;return v+=" "+Lr.containerLegal,kh(v,{perUnitLabel:u,taxInclusivityLabel:f,planTypeLabel:x},l)};var ws=ae(),Es=xs(),As=ae({displayOptical:!0}),Ss=ae({displayStrikethrough:!0}),Cs=ae({displayPromoStrikethrough:!0}),Ts=ae({displayAnnual:!0}),ks=ae({displayOptical:!0,isAlternativePrice:!0}),_s=ae({isAlternativePrice:!0}),Ps=bs(),Ls=vs(),Ms=ys;var _h=(e,t)=>{if(!(!vr(e)||!vr(t)))return Math.floor((t-e)/t*100)},Rs=()=>(e,t)=>{let{price:r,priceWithoutDiscount:i}=t,a=_h(r,i);return a===void 0?'':`${a}%`};var Os=Rs();var Ns="INDIVIDUAL_COM",nn="TEAM_COM",Is="INDIVIDUAL_EDU",on="TEAM_EDU",Ph=["AT_de","AU_en","BE_en","BE_fr","BE_nl","BG_bg","CH_de","CH_fr","CH_it","CZ_cs","DE_de","DK_da","EE_et","EG_ar","EG_en","ES_es","FI_fi","FR_fr","GB_en","GR_el","GR_en","HU_hu","ID_en","ID_id","ID_in","IE_en","IN_en","IN_hi","IT_it","JP_ja","LU_de","LU_en","LU_fr","MY_en","MY_ms","MU_en","NL_nl","NO_nb","NZ_en","PL_pl","PT_pt","RO_ro","SE_sv","SI_sl","SK_sk","TH_en","TH_th","TR_tr","UA_uk"],Lh={[Ns]:["LT_lt","LV_lv","NG_en","SA_ar","SA_en","SG_en","KR_ko","ZA_en"],[nn]:["LT_lt","LV_lv","NG_en","CO_es","KR_ko","ZA_en"],[Is]:["LT_lt","LV_lv","SA_en","SG_en","SA_ar"],[on]:["SG_en","KR_ko"]},Mh={MU_en:[!0,!0,!0,!0],NG_en:[!1,!1,!1,!1],AU_en:[!1,!1,!1,!1],JP_ja:[!1,!1,!1,!1],NZ_en:[!1,!1,!1,!1],TH_en:[!1,!1,!1,!1],TH_th:[!1,!1,!1,!1],CO_es:[!1,!0,!1,!1],AT_de:[!1,!1,!1,!0],SG_en:[!1,!1,!1,!0],ZA_en:[!1,!1,!1,!1]},Rh=[Ns,nn,Is,on],Oh=e=>[nn,on].includes(e);function an(e,t,r,i){if(e[t])return e[t];let a=`${t}_${r}`;if(e[a])return e[a];let n;if(i)n=e.find(o=>o.startsWith(`${t}_`));else{let o=Object.keys(e).find(s=>s.startsWith(`${t}_`));n=o?e[o]:null}return n}var Nh=(e,t,r,i)=>{let a=`${r}_${i}`,n=an(Mh,e,t,!1);if(n){let o=Rh.indexOf(a);return n[o]}return Oh(a)},Ih=(e,t,r,i)=>{if(an(Ph,e,t,!0))return!0;let a=Lh[`${r}_${i}`];return a?an(a,e,t,!0)?!0:N.displayTax:N.displayTax},Oi=async(e,t,r,i)=>{let a=Ih(e,t,r,i);return{displayTax:a,forceTaxExclusive:a?Nh(e,t,r,i):N.forceTaxExclusive}},Mr=class Mr extends HTMLSpanElement{constructor(){super();m(this,"masElement",new je(this));this.handleClick=this.handleClick.bind(this)}static get observedAttributes(){return["data-display-old-price","data-display-per-unit","data-display-recurrence","data-display-tax","data-display-plan-type","data-display-annual","data-perpetual","data-promotion-code","data-force-tax-exclusive","data-template","data-wcs-osi","data-quantity"]}static createInlinePrice(r){let i=pe();if(!i)return null;let{displayOldPrice:a,displayPerUnit:n,displayRecurrence:o,displayTax:s,displayPlanType:c,displayAnnual:l,forceTaxExclusive:d,perpetual:p,promotionCode:u,quantity:f,alternativePrice:x,template:v,wcsOsi:S}=i.collectPriceOptions(r);return bi(Mr,{displayOldPrice:a,displayPerUnit:n,displayRecurrence:o,displayTax:s,displayPlanType:c,displayAnnual:l,forceTaxExclusive:d,perpetual:p,promotionCode:u,quantity:f,alternativePrice:x,template:v,wcsOsi:S})}get isInlinePrice(){return!0}attributeChangedCallback(r,i,a){this.masElement.attributeChangedCallback(r,i,a)}connectedCallback(){this.masElement.connectedCallback(),this.addEventListener("click",this.handleClick)}disconnectedCallback(){this.masElement.disconnectedCallback(),this.removeEventListener("click",this.handleClick)}handleClick(r){r.target!==this&&(r.stopImmediatePropagation(),this.dispatchEvent(new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window})))}onceSettled(){return this.masElement.onceSettled()}get value(){return this.masElement.value}get options(){return this.masElement.options}get isFailed(){return this.masElement.state===Ce}requestUpdate(r=!1){return this.masElement.requestUpdate(r)}async render(r={}){if(!this.isConnected)return!1;let i=pe();if(!i)return!1;let a=i.collectPriceOptions(r,this),n={...i.settings,...a};if(!n.wcsOsi.length)return!1;try{let o=this.masElement.togglePending({});this.innerHTML="";let s=i.resolveOfferSelectors(n),c=await Promise.all(s),l=c.map(f=>{let x=wr(f,n);return x?.length?x[0]:null});if(l.some(f=>!f))throw new Error(`Failed to select offers for: ${n.wcsOsi}`);let d=l,p=za(l);if(i.featureFlags[Te]||n[Te]){if(a.displayPerUnit===void 0&&(n.displayPerUnit=p.customerSegment!=="INDIVIDUAL"),a.displayTax===void 0||a.forceTaxExclusive===void 0){let{country:f,language:x}=n,[v=""]=p.marketSegments,S=await Oi(f,x,p.customerSegment,v);a.displayTax===void 0&&(n.displayTax=S?.displayTax||n.displayTax),a.forceTaxExclusive===void 0&&(n.forceTaxExclusive=S?.forceTaxExclusive||n.forceTaxExclusive),n.forceTaxExclusive&&(d=c.map(z=>{let I=wr(z,n);return I?.length?I[0]:null}))}}else a.displayOldPrice===void 0&&(n.displayOldPrice=!0);if(i.featureFlags[Mt]&&n.displayAnnual!==!1&&(n.displayAnnual=!0),n.template==="discount"&&d.length===2){let[f,x]=d,v={...f,priceDetails:{...f.priceDetails,priceWithoutDiscount:x.priceDetails?.price}};return this.renderOffers([v],n,o)}let u=za(d);return this.renderOffers([u],n,o)}catch(o){throw this.innerHTML="",o}}renderOffers(r,i,a=void 0){if(!this.isConnected)return;let n=pe();if(!n)return!1;if(a??(a=this.masElement.togglePending()),r.length){if(this.masElement.toggleResolved(a,r,i)){this.innerHTML=n.buildPriceHTML(r,this.options);let o=this.closest("p, h3, div");if(!o||!o.querySelector('span[data-template="strikethrough"]')||o.querySelector(".alt-aria-label"))return!0;let s=o?.querySelectorAll('span[is="inline-price"]');return s.length>1&&s.length===o.querySelectorAll('span[data-template="strikethrough"]').length*2&&s.forEach(c=>{c.dataset.template!=="strikethrough"&&c.options&&!c.options.alternativePrice&&!c.isFailed&&(c.options.alternativePrice=!0,c.innerHTML=n.buildPriceHTML(r,c.options))}),!0}}else{let o=new Error(`Not provided: ${this.options?.wcsOsi??"-"}`);if(this.masElement.toggleFailed(a,o,this.options))return this.innerHTML="",!0}return!1}};m(Mr,"is","inline-price"),m(Mr,"tag","span");var He=Mr;window.customElements.get(He.is)||window.customElements.define(He.is,He,{extends:He.tag});function zs({literals:e,providers:t,settings:r}){function i(o,s=null){let c={country:r.country,language:r.language,locale:r.locale,literals:{...e.price}};if(s&&t?.price)for(let q of t.price)q(s,c);let{displayOldPrice:l,displayPerUnit:d,displayRecurrence:p,displayTax:u,displayPlanType:f,forceTaxExclusive:x,perpetual:v,displayAnnual:S,promotionCode:z,quantity:I,alternativePrice:C,wcsOsi:O,...K}=Object.assign(c,s?.dataset??{},o??{});return c=pi(Object.assign({...c,...K,displayOldPrice:T(l),displayPerUnit:T(d),displayRecurrence:T(p),displayTax:T(u),displayPlanType:T(f),forceTaxExclusive:T(x),perpetual:T(v),displayAnnual:T(S),promotionCode:ui(z).effectivePromoCode,quantity:Ot(I,N.quantity),alternativePrice:T(C),wcsOsi:xi(O)})),c}function a(o,s){if(!Array.isArray(o)||!o.length||!s)return"";let{template:c}=s,l;switch(c){case"discount":l=Os;break;case"strikethrough":l=Ss;break;case"promo-strikethrough":l=Cs;break;case"annual":l=Ts;break;case"legal":l=Ms;break;default:s.template==="optical"&&s.alternativePrice?l=ks:s.template==="optical"?l=As:s.displayAnnual&&o[0].planType==="ABM"?l=s.promotionCode?Ls:Ps:s.alternativePrice?l=_s:l=s.promotionCode?Es:ws}let[d]=o;return d={...d,...d.priceDetails},l({...r,...s},d)}let n=He.createInlinePrice;return{InlinePrice:He,buildPriceHTML:a,collectPriceOptions:i,createInlinePrice:n}}function zh({locale:e=void 0,country:t=void 0,language:r=void 0}={}){return r??(r=e?.split("_")?.[0]||N.language),t??(t=e?.split("_")?.[1]||N.country),e??(e=`${r}_${t}`),{locale:e,country:t,language:r}}function Ds(e={},t){let r=t.featureFlags[Te],{commerce:i={}}=e,a=Me.PRODUCTION,n=fa,o=F("checkoutClientId",i)??N.checkoutClientId,s=br(F("checkoutWorkflowStep",i),ce,N.checkoutWorkflowStep),c=T(F("displayOldPrice",i),N.displayOldPrice),l=N.displayPerUnit,d=T(F("displayRecurrence",i),N.displayRecurrence),p=T(F("displayTax",i),N.displayTax),u=T(F("displayPlanType",i),N.displayPlanType),f=T(F("entitlement",i),N.entitlement),x=T(F("modal",i),N.modal),v=T(F("forceTaxExclusive",i),N.forceTaxExclusive),S=F("promotionCode",i)??N.promotionCode,z=Ot(F("quantity",i)),I=F("wcsApiKey",i)??N.wcsApiKey,C=i?.env==="stage",O=Ve.PUBLISHED;["true",""].includes(i.allowOverride)&&(C=(F(ua,i,{metadata:!1})?.toLowerCase()??i?.env)==="stage",O=br(F(ga,i),Ve,O)),C&&(a=Me.STAGE,n=xa);let q=F(ma)??e.preview,Q=typeof q<"u"&&q!=="off"&&q!=="false",ee={};Q&&(ee={preview:Q});let de=F("mas-io-url")??e.masIOUrl??`https://www${a===Me.STAGE?".stage":""}.adobe.com/mas/io`,ie=F("preselect-plan")??void 0;return{...zh(e),...ee,displayOldPrice:c,checkoutClientId:o,checkoutWorkflowStep:s,displayPerUnit:l,displayRecurrence:d,displayTax:p,displayPlanType:u,entitlement:f,extraOptions:N.extraOptions,modal:x,env:a,forceTaxExclusive:v,promotionCode:S,quantity:z,alternativePrice:N.alternativePrice,wcsApiKey:I,wcsURL:n,landscape:O,masIOUrl:de,...ie&&{preselectPlan:ie}}}async function Ni(e,t={},r=2,i=100){let a;for(let n=0;n<=r;n++)try{let o=await fetch(e,t);return o.retryCount=n,o}catch(o){if(a=o,a.retryCount=n,n>r)break;await new Promise(s=>setTimeout(s,i*(n+1)))}throw a}var Dh="mas-commerce-service";function Rr(e,t){let r;return function(){let i=this,a=arguments;clearTimeout(r),r=setTimeout(()=>e.apply(i,a),t)}}function ne(e,t={},r=null,i=null){let a=i?document.createElement(e,{is:i}):document.createElement(e);r instanceof HTMLElement?a.appendChild(r):a.innerHTML=r;for(let[n,o]of Object.entries(t))a.setAttribute(n,o);return a}function Oe(e){return`startTime:${e.startTime.toFixed(2)}|duration:${e.duration.toFixed(2)}`}function sn(){return window.matchMedia("(max-width: 1024px)").matches}function mt(){return document.getElementsByTagName(Dh)?.[0]}function Or(e){let t=window.getComputedStyle(e);return e.offsetHeight+parseFloat(t.marginTop)+parseFloat(t.marginBottom)}var cn="wcs";function $s({settings:e}){let t=le.module(cn),{env:r,wcsApiKey:i}=e,a=new Map,n=new Map,o,s=new Map;async function c(x,v,S=!0){let z=pe(),I=da;t.debug("Fetching:",x);let C="",O;if(x.offerSelectorIds.length>1)throw new Error("Multiple OSIs are not supported anymore");let K=new Map(v),[q]=x.offerSelectorIds,Q=Date.now()+Math.random().toString(36).substring(2,7),ee=`${cn}:${q}:${Q}${st}`,de=`${cn}:${q}:${Q}${ct}`,ie;try{if(performance.mark(ee),C=new URL(e.wcsURL),C.searchParams.set("offer_selector_ids",q),C.searchParams.set("country",x.country),C.searchParams.set("locale",x.locale),C.searchParams.set("landscape",r===Me.STAGE?"ALL":e.landscape),C.searchParams.set("api_key",i),x.language&&C.searchParams.set("language",x.language),x.promotionCode&&C.searchParams.set("promotion_code",x.promotionCode),x.currency&&C.searchParams.set("currency",x.currency),O=await Ni(C.toString(),{credentials:"omit"}),O.ok){let W=[];try{let $=await O.json();t.debug("Fetched:",x,$),W=$.resolvedOffers??[]}catch($){t.error(`Error parsing JSON: ${$.message}`,{...$.context,...z?.duration})}W=W.map(yr),v.forEach(({resolve:$},he)=>{let be=W.filter(({offerSelectorIds:Tt})=>Tt.includes(he)).flat();be.length&&(K.delete(he),v.delete(he),$(be))})}else I=la}catch(W){I=`Network error: ${W.message}`}finally{ie=performance.measure(de,ee),performance.clearMarks(ee),performance.clearMeasures(de)}if(S&&v.size){t.debug("Missing:",{offerSelectorIds:[...v.keys()]});let W=vi(O);v.forEach($=>{$.reject(new Re(I,{...x,...W,response:O,measure:Oe(ie),...z?.duration}))})}}function l(){clearTimeout(o);let x=[...n.values()];n.clear(),x.forEach(({options:v,promises:S})=>c(v,S))}function d(x){if(!x||typeof x!="object")throw new TypeError("Cache must be a Map or similar object");let v=r===Me.STAGE?"stage":"prod",S=x[v];if(!S||typeof S!="object"){t.warn(`No cache found for environment: ${r}`);return}for(let[z,I]of Object.entries(S))a.set(z,Promise.resolve(I.map(yr)));t.debug(`Prefilled WCS cache with ${S.size} entries`)}function p(){let x=a.size;s=new Map(a),a.clear(),t.debug(`Moved ${x} cache entries to stale cache`)}function u(x,v,S){let z=x!=="GB"&&!S?"MULT":"en",I=ba.includes(x)?x:N.country;return{validCountry:I,validLanguage:z,locale:`${v}_${I}`}}function f({country:x,language:v,perpetual:S=!1,promotionCode:z="",wcsOsi:I=[]}){let{validCountry:C,validLanguage:O,locale:K}=u(x,v,S),q=[C,O,z].filter(Q=>Q).join("-").toLowerCase();return I.map(Q=>{let ee=`${Q}-${q}`;if(a.has(ee))return a.get(ee);let de=new Promise((ie,W)=>{let $=n.get(q);$||($={options:{country:C,locale:K,...O==="MULT"&&{language:O},offerSelectorIds:[]},promises:new Map},n.set(q,$)),z&&($.options.promotionCode=z),$.options.offerSelectorIds.push(Q),$.promises.set(Q,{resolve:ie,reject:W}),l()}).catch(ie=>{if(s.has(ee))return s.get(ee);throw ie});return a.set(ee,de),de})}return{Commitment:rt,PlanType:po,Term:ye,applyPlanType:yr,resolveOfferSelectors:f,flushWcsCacheInternal:p,prefillWcsCache:d,normalizeCountryLanguageAndLocale:u}}var Hs="mas-commerce-service",Bs="mas-commerce-service:start",Fs="mas-commerce-service:ready",Nr,It,ut,Us,dn,ln=class extends HTMLElement{constructor(){super(...arguments);E(this,ut);E(this,Nr);E(this,It);m(this,"lastLoggingTime",0)}async registerCheckoutAction(r){typeof r=="function"&&(this.buildCheckoutAction=async(i,a,n)=>{let o=await r?.(i,a,this.imsSignedInPromise,n);return o||null})}get featureFlags(){return h(this,It)||y(this,It,{[Te]:Z(this,ut,dn).call(this,Te),[Mt]:Z(this,ut,dn).call(this,Mt)}),h(this,It)}activate(){let r=h(this,ut,Us),i=Ds(r,this);si(r.lana);let a=le.init(r.hostEnv).module("service");a.debug("Activating:",r);let o={price:Go(i)},s={checkout:new Set,price:new Set},c={literals:o,providers:s,settings:i};Object.defineProperties(this,Object.getOwnPropertyDescriptors({...Bo(c),...Fo(c),...zs(c),...$s(c),...ya,Log:le,resolvePriceTaxFlags:Oi,get defaults(){return N},get log(){return le},get providers(){return{checkout(d){return s.checkout.add(d),()=>s.checkout.delete(d)},price(d){return s.price.add(d),()=>s.price.delete(d)},has:d=>s.price.has(d)||s.checkout.has(d)}},get settings(){return i}})),a.debug("Activated:",{literals:o,settings:i});let l=new CustomEvent(ci,{bubbles:!0,cancelable:!1,detail:this});performance.mark(Fs),y(this,Nr,performance.measure(Fs,Bs)),this.dispatchEvent(l),setTimeout(()=>{this.logFailedRequests()},1e4)}connectedCallback(){performance.mark(Bs),this.activate()}flushWcsCache(){this.flushWcsCacheInternal(),this.log.debug("Flushed WCS cache")}refreshOffers(){this.flushWcsCacheInternal(),document.querySelectorAll(ur).forEach(r=>r.requestUpdate(!0)),this.log.debug("Refreshed WCS offers"),this.logFailedRequests()}refreshFragments(){this.flushWcsCacheInternal(),customElements.get("aem-fragment")?.cache.clear(),document.querySelectorAll("aem-fragment").forEach(r=>r.refresh(!1)),this.log.debug("Refreshed AEM fragments"),this.logFailedRequests()}get duration(){return{"mas-commerce-service:measure":Oe(h(this,Nr))}}logFailedRequests(){let r=[...performance.getEntriesByType("resource")].filter(({startTime:a})=>a>this.lastLoggingTime).filter(({transferSize:a,duration:n,responseStatus:o})=>a===0&&n===0&&o<200||o>=400),i=Array.from(new Map(r.map(a=>[a.name,a])).values());if(i.some(({name:a})=>/(\/fragment\?|web_commerce_artifact)/.test(a))){let a=i.map(({name:n})=>n);this.log.error("Failed requests:",{failedUrls:a,...this.duration})}this.lastLoggingTime=performance.now().toFixed(3)}};Nr=new WeakMap,It=new WeakMap,ut=new WeakSet,Us=function(){let r=this.getAttribute("env")??"prod",i={commerce:{env:r},hostEnv:{name:r},lana:{tags:this.getAttribute("lana-tags"),sampleRate:parseInt(this.getAttribute("lana-sample-rate")??1,10),isProdDomain:r==="prod"},masIOUrl:this.getAttribute("mas-io-url")};return["locale","country","language","preview"].forEach(a=>{let n=this.getAttribute(a);n&&(i[a]=n)}),["checkout-workflow-step","force-tax-exclusive","checkout-client-id","allow-override","wcs-api-key"].forEach(a=>{let n=this.getAttribute(a);if(n!=null){let o=a.replace(/-([a-z])/g,s=>s[1].toUpperCase());i.commerce[o]=n}}),i},dn=function(r){return["on","true",!0].includes(this.getAttribute(`data-${r}`)||F(r))};window.customElements.get(Hs)||window.customElements.define(Hs,ln);var Ir=class Ir extends wi(HTMLButtonElement){static createCheckoutButton(t={},r=""){return yi(Ir,t,r)}setCheckoutUrl(t){this.setAttribute("data-href",t)}get href(){return this.getAttribute("data-href")}get isCheckoutButton(){return!0}clickHandler(t){if(this.checkoutActionHandler){this.checkoutActionHandler?.(t);return}this.href&&(window.location.href=this.href)}};m(Ir,"is","checkout-button"),m(Ir,"tag","button");var zt=Ir;window.customElements.get(zt.is)||window.customElements.define(zt.is,zt,{extends:zt.tag});function $h(e){return`https://${e==="PRODUCTION"?"www.adobe.com":"www.stage.adobe.com"}/offers/promo-terms.html`}var ft,gt=class gt extends HTMLAnchorElement{constructor(){super();m(this,"masElement",new je(this));E(this,ft);this.setAttribute("is",gt.is)}get isUptLink(){return!0}initializeWcsData(r,i){this.setAttribute("data-wcs-osi",r),i&&this.setAttribute("data-promotion-code",i)}attributeChangedCallback(r,i,a){this.masElement.attributeChangedCallback(r,i,a)}connectedCallback(){this.masElement.connectedCallback(),y(this,ft,mt()),h(this,ft)&&(this.log=h(this,ft).log.module("upt-link"))}disconnectedCallback(){this.masElement.disconnectedCallback(),y(this,ft,void 0)}requestUpdate(r=!1){this.masElement.requestUpdate(r)}onceSettled(){return this.masElement.onceSettled()}async render(){let r=mt();if(!r)return!1;this.dataset.imsCountry||r.imsCountryPromise.then(o=>{o&&(this.dataset.imsCountry=o)});let i=r.collectCheckoutOptions({},this);if(!i.wcsOsi)return this.log.error("Missing 'data-wcs-osi' attribute on upt-link."),!1;let a=this.masElement.togglePending(i),n=r.resolveOfferSelectors(i);try{let[[o]]=await Promise.all(n),{country:s,language:c,env:l}=i,d=`locale=${c}_${s}&country=${s}&offer_id=${o.offerId}`,p=this.getAttribute("data-promotion-code");p&&(d+=`&promotion_code=${encodeURIComponent(p)}`),this.href=`${$h(l)}?${d}`,this.masElement.toggleResolved(a,o,i)}catch(o){let s=new Error(`Could not resolve offer selectors for id: ${i.wcsOsi}.`,o.message);return this.masElement.toggleFailed(a,s,i),!1}}static createFrom(r){let i=new gt;for(let a of r.attributes)a.name!=="is"&&(a.name==="class"&&a.value.includes("upt-link")?i.setAttribute("class",a.value.replace("upt-link","").trim()):i.setAttribute(a.name,a.value));return i.innerHTML=r.innerHTML,i.setAttribute("tabindex",0),i}};ft=new WeakMap,m(gt,"is","upt-link"),m(gt,"tag","a"),m(gt,"observedAttributes",["data-wcs-osi","data-promotion-code","data-ims-country"]);var Ye=gt;window.customElements.get(Ye.is)||window.customElements.define(Ye.is,Ye,{extends:Ye.tag});P();P();var H="(max-width: 767px)",re="(max-width: 1199px)",B="(min-width: 768px)",_="(min-width: 1200px)",oe="(min-width: 1600px)",lc={matchMobile:window.matchMedia(H),matchDesktop:window.matchMedia(`${_} and (not ${oe})`),matchDesktopOrUp:window.matchMedia(_),matchLargeDesktop:window.matchMedia(oe),get isMobile(){return this.matchMobile.matches},get isDesktop(){return this.matchDesktop.matches},get isDesktopOrUp(){return this.matchDesktopOrUp.matches}},R=lc;function Fi(){return lc.isDesktop}var dc=b` @@ -8861,7 +8861,7 @@ merch-card[border-color="spectrum-red-700-plans"] { text-decoration: underline; color: var(--link-color-dark); } - `),m(ei,"properties",{heading:{type:String,attribute:!0},mobileRows:{type:Number,attribute:!0}});customElements.define("merch-whats-included",ei);var Zh="#000000",In="#F8D904",Jh="#EAEAEA",ep="#31A547",tp=/(accent|primary|secondary)(-(outline|link))?/,rp="mas:product_code/",ip="daa-ll",Ki="daa-lh",ap=["XL","L","M","S"],zn="...";function Ae(e,t,r,i){let a=i[e];if(t[e]&&a){let n={slot:a?.slot,...a?.attributes},o=t[e];if(a.maxCount&&typeof o=="string"){let[c,l]=wp(o,a.maxCount,a.withSuffix);c!==o&&(n.title=l,o=c)}let s=ne(a.tag,n,o);r.append(s)}}function np(e,t,r){let a=(e.mnemonicIcon||[]).filter(o=>o).map((o,s)=>({icon:o,alt:e.mnemonicAlt?.[s]??"",link:e.mnemonicLink?.[s]??""}));a?.forEach(({icon:o,alt:s,link:c})=>{if(c&&!/^https?:/.test(c))try{c=new URL(`https://${c}`).href.toString()}catch{c="#"}let l={slot:"icons",src:o,loading:t.loading,size:r?.size??"l"};s&&(l.alt=s),c&&(l.href=c);let d=ne("merch-icon",l);t.append(d)});let n=t.shadowRoot.querySelector('slot[name="icons"]');n&&(n.style.display=a?.length?null:"none")}function op(e,t,r){if(r.badge?.slot){if(e.badge?.length&&!e.badge?.startsWith("${e.badge}`}Ae("badge",e,t,r)}else e.badge?(t.setAttribute("badge-text",e.badge),r.disabledAttributes?.includes("badgeColor")||t.setAttribute("badge-color",e.badgeColor||Zh),r.disabledAttributes?.includes("badgeBackgroundColor")||t.setAttribute("badge-background-color",e.badgeBackgroundColor||In),t.setAttribute("border-color",e.badgeBackgroundColor||In)):t.setAttribute("border-color",e.borderColor||Jh)}function sp(e,t,r){if(r.trialBadge&&e.trialBadge){if(!e.trialBadge.startsWith("${e.trialBadge}`}Ae("trialBadge",e,t,r)}}function cp(e,t,r){r?.includes(e.size)&&t.setAttribute("size",e.size)}function lp(e,t){e.cardName&&t.setAttribute("name",e.cardName)}function dp(e,t,r){e.cardTitle&&(e.cardTitle=ar(e.cardTitle)),Ae("cardTitle",e,t,{cardTitle:r})}function hp(e,t,r){Ae("subtitle",e,t,r)}function pp(e,t,r,i){if(!e.backgroundColor||e.backgroundColor.toLowerCase()==="default"){t.style.removeProperty("--merch-card-custom-background-color"),t.removeAttribute("background-color");return}r?.[e.backgroundColor]?(t.style.setProperty("--merch-card-custom-background-color",`var(${r[e.backgroundColor]})`),t.setAttribute("background-color",e.backgroundColor)):i?.attribute&&e.backgroundColor&&(t.setAttribute(i.attribute,e.backgroundColor),t.style.removeProperty("--merch-card-custom-background-color"))}function mp(e,t,r){let i=r?.borderColor,a="--consonant-merch-card-border-color";if(e.borderColor?.toLowerCase()==="transparent")t.style.setProperty(a,"transparent");else if(e.borderColor&&i){let o=i?.specialValues?.[e.borderColor]?.includes("gradient")||/-gradient/.test(e.borderColor),s=/^spectrum-.*-(plans|special-offers)$/.test(e.borderColor);if(o){t.setAttribute("gradient-border","true");let c=e.borderColor;if(i?.specialValues){for(let[l,d]of Object.entries(i.specialValues))if(d===e.borderColor){c=l;break}}t.setAttribute("border-color",c),t.style.removeProperty(a)}else s?(t.setAttribute("border-color",e.borderColor),t.style.setProperty(a,`var(--${e.borderColor})`)):t.style.setProperty(a,`var(--${e.borderColor})`)}}function up(e,t,r){if(e.backgroundImage){let i={loading:t.loading??"lazy",src:e.backgroundImage};if(e.backgroundImageAltText?i.alt=e.backgroundImageAltText:i.role="none",!r)return;if(r?.attribute){t.setAttribute(r.attribute,e.backgroundImage);return}t.append(ne(r.tag,{slot:r.slot},ne("img",i)))}}function ar(e){return!e||typeof e!="string"||e.includes("(Ui(),_n)).catch(console.error),e}function gp(e,t,r){e.prices&&(e.prices=ar(e.prices)),Ae("prices",e,t,r)}function al(e,t,r){let i=e.hasAttribute("data-wcs-osi")&&!!e.getAttribute("data-wcs-osi"),a=e.className||"",n=tp.exec(a)?.[0]??"accent",o=n.includes("accent"),s=n.includes("primary"),c=n.includes("secondary"),l=n.includes("-outline"),d=n.includes("-link");e.classList.remove("accent","primary","secondary");let p;if(t.consonant)p=Cp(e,o,i,d,s,c,r?.ctas?.size);else if(d)p=e;else{let u;o?u="accent":s?u="primary":c&&(u="secondary"),p=t.spectrum==="swc"?Sp(e,r,l,u,i):Ap(e,r,l,u,i)}return p}function fp(e,t){let{slot:r}=t?.description,i=e.querySelectorAll(`[slot="${r}"] a[data-wcs-osi]`);i.length&&i.forEach(a=>{let n=al(a,e,t);a.replaceWith(n)})}function xp(e,t,r){e.description&&(e.description=ar(e.description)),e.promoText&&(e.promoText=ar(e.promoText)),e.shortDescription&&(e.shortDescription=ar(e.shortDescription)),Ae("promoText",e,t,r),Ae("description",e,t,r),Ae("shortDescription",e,t,r),e.shortDescription&&(t.setAttribute("action-menu","true"),e.actionMenuLabel||t.setAttribute("action-menu-label","More options")),fp(t,r),Ae("callout",e,t,r),Ae("quantitySelect",e,t,r),Ae("whatsIncluded",e,t,r)}function vp(e,t,r,i={}){if(!r.addon)return;let n=(e.addon??i.addon)?.replace(/[{}]/g,"");if(!n||/disabled/.test(n))return;let o=ne("merch-addon",{slot:"addon"},n);[...o.querySelectorAll(D)].forEach(s=>{let c=s.parentElement;c?.nodeName==="P"&&c.setAttribute("data-plan-type","")}),t.append(o)}function bp(e,t,r){e.addonConfirmation&&Ae("addonConfirmation",e,t,r)}function yp(e,t,r,i){i?.secureLabel&&r?.secureLabel&&t.setAttribute("secure-label",i.secureLabel)}function wp(e,t,r=!0){try{let i=typeof e!="string"?"":e,a=il(i);if(a.length<=t)return[i,a];let n=0,o=!1,s=r?t-zn.length<1?1:t-zn.length:t,c=[];for(let p of i){if(n++,p==="<")if(o=!0,i[n]==="/")c.pop();else{let u="";for(let f of i.substring(n)){if(f===" "||f===">")break;u+=f}c.push(u)}if(p==="/"&&i[n]===">"&&c.pop(),p===">"){o=!1;continue}if(!o&&(s--,s===0))break}let l=i.substring(0,n).trim();if(c.length>0){c[0]==="p"&&c.shift();for(let p of c.reverse())l+=``}return[`${l}${r?zn:""}`,a]}catch{let a=typeof e=="string"?e:"",n=il(a);return[a,n]}}function il(e){if(!e)return"";let t="",r=!1;for(let i of e){if(i==="<"&&(r=!0),i===">"){r=!1;continue}r||(t+=i)}return t}function Ep(e,t){t.querySelectorAll("a.upt-link").forEach(i=>{let a=Ye.createFrom(i);i.replaceWith(a),a.initializeWcsData(e.osi,e.promoCode)})}function Ap(e,t,r,i,a){let n=e;a?n=customElements.get("checkout-button").createCheckoutButton({},e.innerHTML):n.innerHTML=`${n.textContent}`,n.setAttribute("tabindex",0);for(let d of e.attributes)["class","is"].includes(d.name)||n.setAttribute(d.name,d.value);n.firstElementChild?.classList.add("spectrum-Button-label");let o=t?.ctas?.size??"M",s=`spectrum-Button--${i}`,c=ap.includes(o)?`spectrum-Button--size${o}`:"spectrum-Button--sizeM",l=["spectrum-Button",s,c];return r&&l.push("spectrum-Button--outline"),n.classList.add(...l),n}function Sp(e,t,r,i,a){let n=e;a&&(n=customElements.get("checkout-button").createCheckoutButton(e.dataset),n.connectedCallback(),n.render());let o="fill";r&&(o="outline");let s=ne("sp-button",{treatment:o,variant:i,tabIndex:0,size:t?.ctas?.size??"m",...e.dataset.analyticsId&&{"data-analytics-id":e.dataset.analyticsId}},e.innerHTML);return s.source=n,(a?n.onceSettled():Promise.resolve(n)).then(c=>{s.setAttribute("data-navigation-url",c.href)}),s.addEventListener("click",c=>{c.defaultPrevented||n.click()}),s}function Cp(e,t,r,i,a,n,o){let s=e;if(r)try{let c=customElements.get("checkout-link");c&&(s=c.createCheckoutLink(e.dataset,e.innerHTML)??e)}catch{}return i||(s.classList.add("button","con-button"),o&&o!=="m"&&s.classList.add(`button-${o}`),t&&s.classList.add("blue"),a&&s.classList.add("primary"),n&&s.classList.add("secondary")),s}function Tp(e,t,r,i){if(e.ctas){e.ctas=ar(e.ctas);let{slot:a}=r.ctas,n=ne("div",{slot:a},e.ctas),o=[...n.querySelectorAll("a")].map(s=>al(s,t,r));n.innerHTML="",n.append(...o),t.append(n)}}function kp(e,t){let{tags:r}=e,i=r?.find(n=>typeof n=="string"&&n.startsWith(rp))?.split("/").pop();if(!i)return;t.setAttribute(Ki,i),[...t.shadowRoot.querySelectorAll("a[data-analytics-id],button[data-analytics-id]"),...t.querySelectorAll("a[data-analytics-id],button[data-analytics-id]")].forEach((n,o)=>{n.setAttribute(ip,`${n.dataset.analyticsId}-${o+1}`)})}function _p(e){e.spectrum==="css"&&[["primary-link","primary"],["secondary-link","secondary"]].forEach(([t,r])=>{e.querySelectorAll(`a.${t}`).forEach(i=>{i.classList.remove(t),i.classList.add("spectrum-Link",`spectrum-Link--${r}`)})})}function Pp(e){e.querySelectorAll("[slot]").forEach(i=>{i.remove()}),e.variant=void 0,["checkbox-label","stock-offer-osis","secure-label","background-image","background-color","border-color","badge-background-color","badge-color","badge-text","gradient-border","size",Ki].forEach(i=>e.removeAttribute(i));let r=["wide-strip","thin-strip"];e.classList.remove(...r)}async function nl(e,t){if(!e){let c=t?.id||"unknown";throw console.error(`hydrate: Fragment is undefined. Cannot hydrate card (merchCard id: ${c}).`),new Error(`hydrate: Fragment is undefined for card (merchCard id: ${c}).`)}if(!e.fields){let c=e.id||"unknown",l=t?.id||"unknown";throw console.error(`hydrate: Fragment for card ID '${c}' (merchCard id: ${l}) is missing 'fields'. Cannot hydrate.`),new Error(`hydrate: Fragment for card ID '${c}' (merchCard id: ${l}) is missing 'fields'.`)}let{id:r,fields:i,settings:a={},priceLiterals:n}=e,{variant:o}=i;if(!o)throw new Error(`hydrate: no variant found in payload ${r}`);Pp(t),t.settings=a,n&&(t.priceLiterals=n),t.id??(t.id=e.id),e.variationId&&t.setAttribute("variation-id",e.variationId??""),t.variant=o,await t.updateComplete;let{aemFragmentMapping:s}=t.variantLayout;if(!s)throw new Error(`hydrate: variant mapping not found for ${r}`);s.style==="consonant"&&t.setAttribute("consonant",!0),np(i,t,s.mnemonics),sp(i,t,s),cp(i,t,s.size),lp(i,t),dp(i,t,s.title),op(i,t,s),hp(i,t,s),gp(i,t,s),up(i,t,s.backgroundImage),pp(i,t,s.allowedColors,s.backgroundColor),mp(i,t,s),xp(i,t,s),vp(i,t,s,a),bp(i,t,s),yp(i,t,s,a);try{Ep(i,t)}catch{}Tp(i,t,s,o),kp(i,t),_p(t)}var Hn="merch-card",Dn=2e4,ol="merch-card:",cl=["full-pricing-express","simplified-pricing-express"],ll=["segment","product"];function sl(e,t){let r=e.closest(Hn);if(!r)return t;r.priceLiterals&&(t.literals??(t.literals={}),Object.assign(t.literals,r.priceLiterals)),r.aemFragment&&(t[Te]=!0),r.variantLayout?.priceOptionsProvider?.(e,t)}function Lp(e){e.providers.has(sl)||e.providers.price(sl)}var ti=new IntersectionObserver(e=>{e.forEach(t=>{let r=t.target;if(cl.includes(r.variant)){if(r.clientHeight===0)return;ti.unobserve(r),r.requestUpdate();return}if(ll.includes(r.variant)){if(t.boundingClientRect.width===0)return;if(r.variant==="product"&&r.querySelector('merch-icon[slot="icons"]')){ti.unobserve(r);return}let i=r.getBoundingClientRect().width,n=r.querySelector('[slot="badge"]')?.getBoundingClientRect().width||0;if(i===0||n===0){ti.unobserve(r);return}r.style.setProperty("--consonant-merch-card-heading-xs-max-width",`${Math.round(i-n-16)}px`),ti.unobserve(r)}})}),Mp=0,nr,or,sr,Ge,St,Ie,Ct,X,At,ri,$n,Qi,Ze=class extends U{constructor(){super();E(this,X);E(this,nr);E(this,or);E(this,sr);E(this,Ge);E(this,St);E(this,Ie);E(this,Ct,new Promise(r=>{y(this,Ie,r)}));m(this,"customerSegment");m(this,"marketSegment");m(this,"variantLayout");this.id=null,this.failed=!1,this.filters={},this.types="",this.selected=!1,this.spectrum="css",this.loading="lazy",this.handleAemFragmentEvents=this.handleAemFragmentEvents.bind(this),this.handleMerchOfferSelectReady=this.handleMerchOfferSelectReady.bind(this)}firstUpdated(){this.variantLayout=Mn(this),this.variantLayout?.connectedCallbackHook()}willUpdate(r){(r.has("variant")||!this.variantLayout)&&(this.variantLayout?.disconnectedCallbackHook(),this.variantLayout=Mn(this),this.variantLayout?.connectedCallbackHook())}updated(r){(r.has("badgeBackgroundColor")||r.has("borderColor"))&&this.style.setProperty("--consonant-merch-card-border",this.computedBorderStyle),r.has("backgroundColor")&&this.style.setProperty("--merch-card-custom-background-color",this.backgroundColor?`var(--${this.backgroundColor})`:"");try{this.variantLayoutPromise=this.variantLayout?.postCardUpdateHook(r)}catch(i){Z(this,X,At).call(this,`Error in postCardUpdateHook: ${i.message}`,{},!1)}}get theme(){return this.closest("sp-theme")}get dir(){return this.closest("[dir]")?.getAttribute("dir")??"ltr"}render(){if(!(!this.isConnected||!this.variantLayout||this.style.display==="none"))return this.variantLayout.renderLayout()}get computedBorderStyle(){return["ccd-slice","ccd-suggested","ah-promoted-plans","simplified-pricing-express","full-pricing-express"].includes(this.variant)?"":`1px solid ${this.borderColor?this.borderColor:this.badgeBackgroundColor}`}get badgeElement(){return this.shadowRoot.getElementById("badge")}get headingmMSlot(){return this.shadowRoot.querySelector('slot[name="heading-m"]').assignedElements()[0]}get footerSlot(){return this.shadowRoot.querySelector('slot[name="footer"]')?.assignedElements()[0]}get descriptionSlot(){return this.shadowRoot.querySelector('slot[name="body-xs"')?.assignedElements()[0]}get descriptionSlotCompare(){return this.shadowRoot.querySelector('slot[name="body-m"')?.assignedElements()[0]}get iconButton(){return this.querySelector('[slot="callout-content"] .icon-button')}get price(){return this.headingmMSlot?.querySelector(D)}get checkoutLinks(){return[...this.footerSlot?.querySelectorAll(Se)??[]]}get checkoutLinksDescription(){return[...this.descriptionSlot?.querySelectorAll(Se)??[]]}get checkoutLinkDescriptionCompare(){return[...this.descriptionSlotCompare?.querySelectorAll(Se)??[]]}get activeDescriptionLinks(){return this.variant==="mini-compare-chart"||this.variant==="mini-compare-chart-mweb"?this.checkoutLinkDescriptionCompare:this.checkoutLinksDescription}async toggleStockOffer({target:r}){if(!this.stockOfferOsis)return;let i=this.checkoutLinks;if(i.length!==0)for(let a of i){await a.onceSettled();let n=a.value?.[0]?.planType;if(!n)return;let o=this.stockOfferOsis[n];if(!o)return;let s=a.dataset.wcsOsi.split(",").filter(c=>c!==o);r.checked&&s.push(o),a.dataset.wcsOsi=s.join(",")}}changeHandler(r){r.target.tagName==="MERCH-ADDON"&&this.toggleAddon(r.target)}toggleAddon(r){this.variantLayout?.toggleAddon?.(r);let i=[...this.checkoutLinks,...this.activeDescriptionLinks??[]];if(i.length===0)return;let a=n=>{let{offerType:o,planType:s}=n.value?.[0]??{};if(!o||!s)return;let c=r.getOsi(s,o),l=(n.dataset.wcsOsi||"").split(",").filter(d=>d&&d!==c);r.checked&&l.push(c),n.dataset.wcsOsi=l.join(",")};i.forEach(a)}handleQuantitySelection(r){let i=[...this.checkoutLinks,...this.activeDescriptionLinks??[]];if(i.length!==0)for(let a of i)a.dataset.quantity=r.detail.option}get titleElement(){return this.querySelector(this.variantLayout?.headingSelector||".card-heading")}get title(){return this.titleElement?.textContent?.trim()}get description(){return this.querySelector('[slot="body-xs"]')?.textContent?.trim()}updateFilters(r){let i={...this.filters};Object.keys(i).forEach(a=>{if(r){i[a].order=Math.min(i[a].order||2,2);return}let n=i[a].order;n===1||isNaN(n)||(i[a].order=Number(n)+1)}),this.filters=i}showInfoTooltip(r,i){let a="tooltip-left",n="tooltip-right";window.screen.width<600&&r.getAttribute("data-tooltip")?.length>12&&(this.iconButton.classList.remove(a),this.iconButton.classList.remove(n),r.getBoundingClientRect().x<100&&this.iconButton.classList.add(a),r.getBoundingClientRect().x>window.screen.width-100&&this.iconButton.classList.add(n)),this.iconButton.classList.add(i)}handleInfoIconEvents(){let r="tooltip-visible";this.iconButton&&(["mouseenter","focus"].forEach(i=>this.iconButton.addEventListener(i,a=>this.showInfoTooltip(a.target,r),!1)),["mouseleave","blur"].forEach(i=>this.iconButton.addEventListener(i,()=>this.iconButton.classList.remove(r),!1)),this.iconButton.addEventListener("keydown",i=>{i.key==="Escape"&&this.iconButton.classList.remove(r)}))}includes(r){return this.textContent.match(new RegExp(r,"i"))!==null}connectedCallback(){var i;super.connectedCallback(),h(this,or)||y(this,or,Mp++),this.aemFragment||((i=h(this,Ie))==null||i.call(this),y(this,Ie,void 0)),this.id??(this.id=this.getAttribute("id")??this.aemFragment?.getAttribute("fragment"));let r=this.id??h(this,or);y(this,St,`${ol}${r}${st}`),y(this,nr,`${ol}${r}${ct}`),performance.mark(h(this,St)),y(this,Ge,mt()),Lp(h(this,Ge)),y(this,sr,h(this,Ge).Log.module(Hn)),this.addEventListener(te,this.handleQuantitySelection),this.addEventListener(li,this.handleAddonAndQuantityUpdate),this.addEventListener(gr,this.handleMerchOfferSelectReady),this.addEventListener(nt,this.handleAemFragmentEvents),this.addEventListener(at,this.handleAemFragmentEvents),this.addEventListener(fr,this.handleInfoIconEvents),this.addEventListener("change",this.changeHandler),this.variantLayout&&this.variantLayout.connectedCallbackHook(),this.aemFragment||setTimeout(()=>this.checkReady(),0)}disconnectedCallback(){super.disconnectedCallback(),this.variantLayout?.disconnectedCallbackHook(),this.removeEventListener(te,this.handleQuantitySelection),this.removeEventListener(nt,this.handleAemFragmentEvents),this.removeEventListener(at,this.handleAemFragmentEvents),this.removeEventListener(fr,this.handleInfoIconEvents),this.removeEventListener("change",this.changeHandler),this.removeEventListener(li,this.handleAddonAndQuantityUpdate)}async handleAemFragmentEvents(r){var i;if(this.isConnected&&(r.type===nt&&Z(this,X,At).call(this,"AEM fragment cannot be loaded"),r.type===at&&(this.failed=!1,r.target.nodeName==="AEM-FRAGMENT"))){let a=r.detail;try{h(this,Ie)||y(this,Ct,new Promise(n=>{y(this,Ie,n)})),nl(a,this)}catch(n){Z(this,X,At).call(this,`hydration has failed: ${n.message}`)}finally{(i=h(this,Ie))==null||i.call(this),y(this,Ie,void 0)}this.checkReady()}}async checkReady(){if(!this.isConnected)return;h(this,Ct)&&(await h(this,Ct),(cl.includes(this.variant)||ll.includes(this.variant))&&ti.observe(this),y(this,Ct,void 0)),this.variantLayoutPromise&&(await this.variantLayoutPromise,this.variantLayoutPromise=void 0);let r=new Promise(o=>setTimeout(()=>o("timeout"),Dn));if(this.aemFragment){let o=await Promise.race([this.aemFragment.updateComplete,r]);if(o===!1||o==="timeout"){let s=o==="timeout"?`AEM fragment was not resolved within ${Dn} timeout`:"AEM fragment cannot be loaded";Z(this,X,At).call(this,s,{},!1);return}}let i=[...this.querySelectorAll(ur)],a=Promise.all(i.map(o=>o.onceSettled().catch(()=>o))).then(o=>o.every(s=>s.classList.contains("placeholder-resolved"))),n=await Promise.race([a,r]);if(n===!0){this.measure=performance.measure(h(this,nr),h(this,St));let o={...this.aemFragment?.fetchInfo,...h(this,Ge).duration,measure:Oe(this.measure)};return this.dispatchEvent(new CustomEvent(fr,{bubbles:!0,composed:!0,detail:o})),this}else{this.measure=performance.measure(h(this,nr),h(this,St));let o={measure:Oe(this.measure),...h(this,Ge).duration};n==="timeout"?Z(this,X,At).call(this,`Contains offers that were not resolved within ${Dn} timeout`,o):Z(this,X,At).call(this,"Contains unresolved offers",o)}}get aemFragment(){return this.querySelector("aem-fragment")}get addon(){return this.querySelector("merch-addon")}get quantitySelect(){return this.querySelector("merch-quantity-select")}get addonCheckbox(){return this.querySelector("merch-addon")}displayFooterElementsInColumn(){if(!this.classList.contains("product"))return;let r=this.shadowRoot.querySelector(".secure-transaction-label");(this.footerSlot?.querySelectorAll(Se)).length===2&&r&&r.parentElement.classList.add("footer-column")}handleMerchOfferSelectReady(){this.offerSelect&&!this.offerSelect.planType||this.displayFooterElementsInColumn()}get dynamicPrice(){return this.querySelector('[slot="price"]')}handleAddonAndQuantityUpdate({detail:{id:r,items:i}}){if(!r||!i?.length||this.closest('[role="tabpanel"][hidden="true"]'))return;let n=this.checkoutLinks.find(d=>d.getAttribute("data-modal-id")===r);if(!n)return;let s=new URL(n.getAttribute("href")).searchParams.get("pa"),c=i.find(d=>d.productArrangementCode===s)?.quantity,l=!!i.find(d=>d.productArrangementCode!==s);if(c&&this.quantitySelect?.dispatchEvent(new CustomEvent(Pt,{detail:{quantity:c},bubbles:!0,composed:!0})),this.addonCheckbox&&this.addonCheckbox.checked!==l){this.toggleStockOffer({target:this.addonCheckbox});let d=new Event("change",{bubbles:!0,cancelable:!0});Object.defineProperty(d,"target",{writable:!1,value:{checked:l}}),this.addonCheckbox.handleChange(d)}}get prices(){return Array.from(this.querySelectorAll(D))}get promoPrice(){if(!this.querySelector("span.price-strikethrough"))return;let r=this.querySelector(".price.price-alternative");if(r||(r=this.querySelector(`${D}[data-template="price"] > span`)),!!r)return r=r.innerText,r}get regularPrice(){return h(this,X,ri)?.innerText}get promotionCode(){let r=[...this.querySelectorAll(`${D}[data-promotion-code],${Se}[data-promotion-code]`)].map(a=>a.dataset.promotionCode),i=[...new Set(r)];return i.length>1&&h(this,sr)?.warn(`Multiple different promotion codes found: ${i.join(", ")}`),r[0]}get annualPrice(){return this.querySelector(`${D}[data-template="price"] > .price.price-annual`)?.innerText}get promoText(){}get taxText(){return(h(this,X,$n)??h(this,X,ri))?.querySelector("span.price-tax-inclusivity")?.textContent?.trim()||void 0}get recurrenceText(){return h(this,X,ri)?.querySelector("span.price-recurrence")?.textContent?.trim()}get unitText(){let r=".price-unit-type";return h(this,X,$n)?.querySelector(r)?.textContent?.trim()??h(this,X,ri)?.querySelector(r)?.textContent?.trim()??this.querySelector(r)?.textContent?.trim()??void 0}get planTypeText(){return this.querySelector('[is="inline-price"][data-template="legal"] span.price-plan-type')?.textContent?.trim()}get seeTermsInfo(){let r=this.querySelector('a[is="upt-link"]');if(r)return Z(this,X,Qi).call(this,r)}get renewalText(){return this.querySelector("span.renewal-text")?.textContent?.trim()}get promoDurationText(){return this.querySelector("span.promo-duration-text")?.textContent?.trim()}get ctas(){let r=this.querySelector('[slot="ctas"], [slot="footer"]')?.querySelectorAll(`${Se}, a`);return Array.from(r??[])}get primaryCta(){return Z(this,X,Qi).call(this,this.ctas.find(r=>r.variant==="accent"||r.matches(".spectrum-Button--accent,.con-button.blue")))}get secondaryCta(){return Z(this,X,Qi).call(this,this.ctas.find(r=>r.variant!=="accent"&&!r.matches(".spectrum-Button--accent,.con-button.blue")))}};nr=new WeakMap,or=new WeakMap,sr=new WeakMap,Ge=new WeakMap,St=new WeakMap,Ie=new WeakMap,Ct=new WeakMap,X=new WeakSet,At=function(r,i={},a=!0){if(!this.isConnected)return;let o=this.aemFragment?.getAttribute("fragment");o=`[${o}]`;let s={...this.aemFragment.fetchInfo,...h(this,Ge).duration,...i,message:r};h(this,sr).error(`merch-card${o}: ${r}`,s),this.failed=!0,a&&this.dispatchEvent(new CustomEvent(na,{bubbles:!0,composed:!0,detail:s}))},ri=function(){return this.querySelector("span.price-strikethrough")??this.querySelector(`${D}[data-template="price"] > span`)},$n=function(){return this.querySelector(`${D}[data-template="legal"]`)},Qi=function(r){if(r)return{text:r.innerText.trim(),analyticsId:r.dataset.analyticsId,href:r.getAttribute("href")??r.dataset.href}},m(Ze,"properties",{id:{type:String,attribute:"id",reflect:!0},name:{type:String,attribute:"name",reflect:!0},variant:{type:String,reflect:!0},size:{type:String,attribute:"size",reflect:!0},badgeColor:{type:String,attribute:"badge-color",reflect:!0},borderColor:{type:String,attribute:"border-color",reflect:!0},backgroundColor:{type:String,attribute:"background-color",reflect:!0},badgeBackgroundColor:{type:String,attribute:"badge-background-color",reflect:!0},backgroundImage:{type:String,attribute:"background-image",reflect:!0},badgeText:{type:String,attribute:"badge-text"},actionMenu:{type:Boolean,attribute:"action-menu"},actionMenuLabel:{type:String,attribute:"action-menu-label"},customHr:{type:Boolean,attribute:"custom-hr"},consonant:{type:Boolean,attribute:"consonant"},failed:{type:Boolean,attribute:"failed",reflect:!0},spectrum:{type:String,attribute:"spectrum"},detailBg:{type:String,attribute:"detail-bg"},secureLabel:{type:String,attribute:"secure-label"},checkboxLabel:{type:String,attribute:"checkbox-label"},addonTitle:{type:String,attribute:"addon-title"},addonOffers:{type:Object,attribute:"addon-offers"},selected:{type:Boolean,attribute:"aria-selected",reflect:!0},storageOption:{type:String,attribute:"storage",reflect:!0},planType:{type:String,attribute:"plan-type",reflect:!0},heightSync:{type:Boolean,attribute:"height-sync"},settings:{type:Object,attribute:!1},stockOfferOsis:{type:Object,attribute:"stock-offer-osis",converter:{fromAttribute:r=>{if(!r)return;let[i,a,n]=r.split(",");return{PUF:i,ABM:a,M2M:n}}}},filters:{type:String,reflect:!0,converter:{fromAttribute:r=>Object.fromEntries(r.split(",").map(i=>{let[a,n,o]=i.split(":"),s=Number(n);return[a,{order:isNaN(s)?void 0:s,size:o}]})),toAttribute:r=>Object.entries(r).map(([i,{order:a,size:n}])=>[i,a,n].filter(o=>o!=null).join(":")).join(",")}},types:{type:String,attribute:"types",reflect:!0},merchOffer:{type:Object},analyticsId:{type:String,attribute:Ki,reflect:!0},loading:{type:String},priceLiterals:{type:Object}}),m(Ze,"styles",[dc,...hc()]),m(Ze,"registerVariant",G),m(Ze,"getCollectionOptions",Uc),m(Ze,"getFragmentMapping",qi);customElements.define(Hn,Ze);P();var cr,ii=class extends U{constructor(){super();E(this,cr);this.defaults={},this.variant="plans"}saveContainerDefaultValues(){let r=this.closest(this.getAttribute("container")),i=r?.querySelector('[slot="description"]:not(merch-offer > *)')?.cloneNode(!0),a=r?.badgeText;return{description:i,badgeText:a}}getSlottedElement(r,i){return(i||this.closest(this.getAttribute("container"))).querySelector(`[slot="${r}"]:not(merch-offer > *)`)}updateSlot(r,i){let a=this.getSlottedElement(r,i);if(!a)return;let n=this.selectedOffer.getOptionValue(r)?this.selectedOffer.getOptionValue(r):this.defaults[r];n&&a.replaceWith(n.cloneNode(!0))}handleOfferSelection(r){let i=r.detail;this.selectOffer(i)}handleOfferSelectionByQuantity(r){let i=r.detail.option,a=Number.parseInt(i),n=this.findAppropriateOffer(a);this.selectOffer(n),this.getSlottedElement("cta").setAttribute("data-quantity",a)}selectOffer(r){if(!r)return;let i=this.selectedOffer;i&&(i.selected=!1),r.selected=!0,this.selectedOffer=r,this.planType=r.planType,this.updateContainer(),this.updateComplete.then(()=>{this.dispatchEvent(new CustomEvent(aa,{detail:this,bubbles:!0}))})}findAppropriateOffer(r){let i=null;return this.offers.find(n=>{let o=Number.parseInt(n.getAttribute("value"));if(o===r)return!0;if(o>r)return!1;i=n})||i}updateBadgeText(r){this.selectedOffer.badgeText===""?r.badgeText=null:this.selectedOffer.badgeText?r.badgeText=this.selectedOffer.badgeText:r.badgeText=this.defaults.badgeText}updateContainer(){let r=this.closest(this.getAttribute("container"));!r||!this.selectedOffer||(this.updateSlot("cta",r),this.updateSlot("secondary-cta",r),this.updateSlot("price",r),!this.manageableMode&&(this.updateSlot("description",r),this.updateBadgeText(r)))}render(){return g`
`}connectedCallback(){super.connectedCallback(),this.addEventListener("focusin",this.handleFocusin),this.addEventListener("click",this.handleFocusin),this.addEventListener(_t,this.handleOfferSelectReady);let r=this.closest("merch-quantity-select");this.manageableMode=r,this.offers=[...this.querySelectorAll("merch-offer")],y(this,cr,this.handleOfferSelectionByQuantity.bind(this)),this.manageableMode?r.addEventListener(te,h(this,cr)):this.defaults=this.saveContainerDefaultValues(),this.selectedOffer=this.offers[0],this.planType&&this.updateContainer()}get miniCompareMobileCard(){return(this.merchCard?.variant==="mini-compare-chart"||this.merchCard?.variant==="mini-compare-chart-mweb")&&this.isMobile}get merchCard(){return this.closest("merch-card")}get isMobile(){return window.matchMedia("(max-width: 767px)").matches}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(te,h(this,cr)),this.removeEventListener(_t,this.handleOfferSelectReady),this.removeEventListener("focusin",this.handleFocusin),this.removeEventListener("click",this.handleFocusin)}get price(){return this.querySelector('merch-offer[aria-selected] [is="inline-price"]')}get customerSegment(){return this.selectedOffer?.customerSegment}get marketSegment(){return this.selectedOffer?.marketSegment}handleFocusin(r){r.target?.nodeName==="MERCH-OFFER"&&(r.preventDefault(),r.stopImmediatePropagation(),this.selectOffer(r.target))}async handleOfferSelectReady(){this.planType||this.querySelector("merch-offer:not([plan-type])")||(this.planType=this.selectedOffer.planType,await this.updateComplete,this.selectOffer(this.selectedOffer??this.querySelector("merch-offer[aria-selected]")??this.querySelector("merch-offer")),this.dispatchEvent(new CustomEvent(gr,{bubbles:!0})))}};cr=new WeakMap,m(ii,"styles",b` + `),m(ei,"properties",{heading:{type:String,attribute:!0},mobileRows:{type:Number,attribute:!0}});customElements.define("merch-whats-included",ei);var Zh="#000000",In="#F8D904",Jh="#EAEAEA",ep="#31A547",tp=/(accent|primary|secondary)(-(outline|link))?/,rp="mas:product_code/",ip="daa-ll",Ki="daa-lh",ap=["XL","L","M","S"],zn="...";function Ae(e,t,r,i){let a=i[e];if(t[e]&&a){let n={slot:a?.slot,...a?.attributes},o=t[e];if(a.maxCount&&typeof o=="string"){let[c,l]=Ep(o,a.maxCount,a.withSuffix);c!==o&&(n.title=l,o=c)}let s=ne(a.tag,n,o);r.append(s)}}function np(e,t,r){let a=(e.mnemonicIcon||[]).filter(o=>o).map((o,s)=>({icon:o,alt:e.mnemonicAlt?.[s]??"",link:e.mnemonicLink?.[s]??""}));a?.forEach(({icon:o,alt:s,link:c})=>{if(c&&!/^https?:/.test(c))try{c=new URL(`https://${c}`).href.toString()}catch{c="#"}let l={slot:"icons",src:o,loading:t.loading,size:r?.size??"l"};s&&(l.alt=s),c&&(l.href=c);let d=ne("merch-icon",l);t.append(d)});let n=t.shadowRoot.querySelector('slot[name="icons"]');n&&(n.style.display=a?.length?null:"none")}function op(e,t,r){if(r.badge?.slot){if(e.badge?.length&&!e.badge?.startsWith("${e.badge}`}Ae("badge",e,t,r)}else e.badge?(t.setAttribute("badge-text",e.badge),r.disabledAttributes?.includes("badgeColor")||t.setAttribute("badge-color",e.badgeColor||Zh),r.disabledAttributes?.includes("badgeBackgroundColor")||t.setAttribute("badge-background-color",e.badgeBackgroundColor||In),t.setAttribute("border-color",e.badgeBackgroundColor||In)):t.setAttribute("border-color",e.borderColor||Jh)}function sp(e,t,r){if(r.trialBadge&&e.trialBadge){if(!e.trialBadge.startsWith("${e.trialBadge}`}Ae("trialBadge",e,t,r)}}function cp(e,t,r){r?.includes(e.size)&&t.setAttribute("size",e.size)}function lp(e,t){e.cardName&&t.setAttribute("name",e.cardName)}function dp(e,t,r){e.cardTitle&&(e.cardTitle=ar(e.cardTitle)),Ae("cardTitle",e,t,{cardTitle:r})}function hp(e,t,r){Ae("subtitle",e,t,r)}function pp(e,t,r,i){if(!e.backgroundColor||e.backgroundColor.toLowerCase()==="default"){t.style.removeProperty("--merch-card-custom-background-color"),t.removeAttribute("background-color");return}r?.[e.backgroundColor]?(t.style.setProperty("--merch-card-custom-background-color",`var(${r[e.backgroundColor]})`),t.setAttribute("background-color",e.backgroundColor)):i?.attribute&&e.backgroundColor&&(t.setAttribute(i.attribute,e.backgroundColor),t.style.removeProperty("--merch-card-custom-background-color"))}function mp(e,t,r){let i=r?.borderColor,a="--consonant-merch-card-border-color";if(e.borderColor?.toLowerCase()==="transparent")t.style.setProperty(a,"transparent");else if(e.borderColor&&i){let o=i?.specialValues?.[e.borderColor]?.includes("gradient")||/-gradient/.test(e.borderColor),s=/^spectrum-.*-(plans|special-offers)$/.test(e.borderColor);if(o){t.setAttribute("gradient-border","true");let c=e.borderColor;if(i?.specialValues){for(let[l,d]of Object.entries(i.specialValues))if(d===e.borderColor){c=l;break}}t.setAttribute("border-color",c),t.style.removeProperty(a)}else s?(t.setAttribute("border-color",e.borderColor),t.style.setProperty(a,`var(--${e.borderColor})`)):t.style.setProperty(a,`var(--${e.borderColor})`)}}function up(e,t,r){if(e.backgroundImage){let i={loading:t.loading??"lazy",src:e.backgroundImage};if(e.backgroundImageAltText?i.alt=e.backgroundImageAltText:i.role="none",!r)return;if(r?.attribute){t.setAttribute(r.attribute,e.backgroundImage);return}t.append(ne(r.tag,{slot:r.slot},ne("img",i)))}}function ar(e){return!e||typeof e!="string"||e.includes("(Ui(),_n)).catch(console.error),e}function gp(e,t,r){e.prices&&(e.prices=ar(e.prices)),Ae("prices",e,t,r)}function al(e,t,r){let i=e.hasAttribute("data-wcs-osi")&&!!e.getAttribute("data-wcs-osi"),a=e.className||"",n=tp.exec(a)?.[0]??"accent",o=n.includes("accent"),s=n.includes("primary"),c=n.includes("secondary"),l=n.includes("-outline"),d=n.includes("-link");e.classList.remove("accent","primary","secondary");let p;if(t.consonant)p=Tp(e,o,i,d,s,c,r?.ctas?.size);else if(d)p=e;else{let u;o?u="accent":s?u="primary":c&&(u="secondary"),p=t.spectrum==="swc"?Cp(e,r,l,u,i):Sp(e,r,l,u,i)}return p}function fp(e,t){let{slot:r}=t?.description,i=e.querySelectorAll(`[slot="${r}"] a[data-wcs-osi]`);i.length&&i.forEach(a=>{let n=al(a,e,t);a.replaceWith(n)})}function xp(e,t,r,i){e.description&&(e.description=ar(e.description)),e.promoText&&(e.promoText=ar(e.promoText)),e.shortDescription&&(e.shortDescription=ar(e.shortDescription)),Ae("promoText",e,t,r),Ae("description",e,t,r),Ae("shortDescription",e,t,r),e.shortDescription&&(t.setAttribute("action-menu","true"),e.actionMenuLabel||t.setAttribute("action-menu-label","More options")),fp(t,r),Ae("callout",e,t,r),vp(e,t,r,i),Ae("whatsIncluded",e,t,r)}function vp(e,t,r,i={}){r.quantitySelect&&(e.quantitySelect||(e.quantitySelect=i.quantitySelect),Ae("quantitySelect",e,t,r))}function bp(e,t,r,i={}){if(!r.addon)return;let n=(e.addon??i.addon)?.replace(/[{}]/g,"");if(!n||/disabled/.test(n))return;let o=ne("merch-addon",{slot:"addon"},n);[...o.querySelectorAll(D)].forEach(s=>{let c=s.parentElement;c?.nodeName==="P"&&c.setAttribute("data-plan-type","")}),t.append(o)}function yp(e,t,r){e.addonConfirmation&&Ae("addonConfirmation",e,t,r)}function wp(e,t,r,i){i?.secureLabel&&r?.secureLabel&&t.setAttribute("secure-label",i.secureLabel)}function Ep(e,t,r=!0){try{let i=typeof e!="string"?"":e,a=il(i);if(a.length<=t)return[i,a];let n=0,o=!1,s=r?t-zn.length<1?1:t-zn.length:t,c=[];for(let p of i){if(n++,p==="<")if(o=!0,i[n]==="/")c.pop();else{let u="";for(let f of i.substring(n)){if(f===" "||f===">")break;u+=f}c.push(u)}if(p==="/"&&i[n]===">"&&c.pop(),p===">"){o=!1;continue}if(!o&&(s--,s===0))break}let l=i.substring(0,n).trim();if(c.length>0){c[0]==="p"&&c.shift();for(let p of c.reverse())l+=``}return[`${l}${r?zn:""}`,a]}catch{let a=typeof e=="string"?e:"",n=il(a);return[a,n]}}function il(e){if(!e)return"";let t="",r=!1;for(let i of e){if(i==="<"&&(r=!0),i===">"){r=!1;continue}r||(t+=i)}return t}function Ap(e,t){t.querySelectorAll("a.upt-link").forEach(i=>{let a=Ye.createFrom(i);i.replaceWith(a),a.initializeWcsData(e.osi,e.promoCode)})}function Sp(e,t,r,i,a){let n=e;a?n=customElements.get("checkout-button").createCheckoutButton({},e.innerHTML):n.innerHTML=`${n.textContent}`,n.setAttribute("tabindex",0);for(let d of e.attributes)["class","is"].includes(d.name)||n.setAttribute(d.name,d.value);n.firstElementChild?.classList.add("spectrum-Button-label");let o=t?.ctas?.size??"M",s=`spectrum-Button--${i}`,c=ap.includes(o)?`spectrum-Button--size${o}`:"spectrum-Button--sizeM",l=["spectrum-Button",s,c];return r&&l.push("spectrum-Button--outline"),n.classList.add(...l),n}function Cp(e,t,r,i,a){let n=e;a&&(n=customElements.get("checkout-button").createCheckoutButton(e.dataset),n.connectedCallback(),n.render());let o="fill";r&&(o="outline");let s=ne("sp-button",{treatment:o,variant:i,tabIndex:0,size:t?.ctas?.size??"m",...e.dataset.analyticsId&&{"data-analytics-id":e.dataset.analyticsId}},e.innerHTML);return s.source=n,(a?n.onceSettled():Promise.resolve(n)).then(c=>{s.setAttribute("data-navigation-url",c.href)}),s.addEventListener("click",c=>{c.defaultPrevented||n.click()}),s}function Tp(e,t,r,i,a,n,o){let s=e;if(r)try{let c=customElements.get("checkout-link");c&&(s=c.createCheckoutLink(e.dataset,e.innerHTML)??e)}catch{}return i||(s.classList.add("button","con-button"),o&&o!=="m"&&s.classList.add(`button-${o}`),t&&s.classList.add("blue"),a&&s.classList.add("primary"),n&&s.classList.add("secondary")),s}function kp(e,t,r,i){if(e.ctas){e.ctas=ar(e.ctas);let{slot:a}=r.ctas,n=ne("div",{slot:a},e.ctas),o=[...n.querySelectorAll("a")].map(s=>al(s,t,r));n.innerHTML="",n.append(...o),t.append(n)}}function _p(e,t){let{tags:r}=e,i=r?.find(n=>typeof n=="string"&&n.startsWith(rp))?.split("/").pop();if(!i)return;t.setAttribute(Ki,i),[...t.shadowRoot.querySelectorAll("a[data-analytics-id],button[data-analytics-id]"),...t.querySelectorAll("a[data-analytics-id],button[data-analytics-id]")].forEach((n,o)=>{n.setAttribute(ip,`${n.dataset.analyticsId}-${o+1}`)})}function Pp(e){e.spectrum==="css"&&[["primary-link","primary"],["secondary-link","secondary"]].forEach(([t,r])=>{e.querySelectorAll(`a.${t}`).forEach(i=>{i.classList.remove(t),i.classList.add("spectrum-Link",`spectrum-Link--${r}`)})})}function Lp(e){e.querySelectorAll("[slot]").forEach(i=>{i.remove()}),e.variant=void 0,["checkbox-label","stock-offer-osis","secure-label","background-image","background-color","border-color","badge-background-color","badge-color","badge-text","gradient-border","size",Ki].forEach(i=>e.removeAttribute(i));let r=["wide-strip","thin-strip"];e.classList.remove(...r)}async function nl(e,t){if(!e){let c=t?.id||"unknown";throw console.error(`hydrate: Fragment is undefined. Cannot hydrate card (merchCard id: ${c}).`),new Error(`hydrate: Fragment is undefined for card (merchCard id: ${c}).`)}if(!e.fields){let c=e.id||"unknown",l=t?.id||"unknown";throw console.error(`hydrate: Fragment for card ID '${c}' (merchCard id: ${l}) is missing 'fields'. Cannot hydrate.`),new Error(`hydrate: Fragment for card ID '${c}' (merchCard id: ${l}) is missing 'fields'.`)}let{id:r,fields:i,settings:a={},priceLiterals:n}=e,{variant:o}=i;if(!o)throw new Error(`hydrate: no variant found in payload ${r}`);Lp(t),t.settings=a,n&&(t.priceLiterals=n),t.id??(t.id=e.id),e.variationId&&t.setAttribute("variation-id",e.variationId??""),t.variant=o,await t.updateComplete;let{aemFragmentMapping:s}=t.variantLayout;if(!s)throw new Error(`hydrate: variant mapping not found for ${r}`);s.style==="consonant"&&t.setAttribute("consonant",!0),np(i,t,s.mnemonics),sp(i,t,s),cp(i,t,s.size),lp(i,t),dp(i,t,s.title),op(i,t,s),hp(i,t,s),gp(i,t,s),up(i,t,s.backgroundImage),pp(i,t,s.allowedColors,s.backgroundColor),mp(i,t,s),xp(i,t,s,a),bp(i,t,s,a),yp(i,t,s),wp(i,t,s,a);try{Ap(i,t)}catch{}kp(i,t,s,o),_p(i,t),Pp(t)}var Hn="merch-card",Dn=2e4,ol="merch-card:",cl=["full-pricing-express","simplified-pricing-express"],ll=["segment","product"];function sl(e,t){let r=e.closest(Hn);if(!r)return t;r.priceLiterals&&(t.literals??(t.literals={}),Object.assign(t.literals,r.priceLiterals)),r.aemFragment&&(t[Te]=!0),r.variantLayout?.priceOptionsProvider?.(e,t)}function Mp(e){e.providers.has(sl)||e.providers.price(sl)}var ti=new IntersectionObserver(e=>{e.forEach(t=>{let r=t.target;if(cl.includes(r.variant)){if(r.clientHeight===0)return;ti.unobserve(r),r.requestUpdate();return}if(ll.includes(r.variant)){if(t.boundingClientRect.width===0)return;if(r.variant==="product"&&r.querySelector('merch-icon[slot="icons"]')){ti.unobserve(r);return}let i=r.getBoundingClientRect().width,n=r.querySelector('[slot="badge"]')?.getBoundingClientRect().width||0;if(i===0||n===0){ti.unobserve(r);return}r.style.setProperty("--consonant-merch-card-heading-xs-max-width",`${Math.round(i-n-16)}px`),ti.unobserve(r)}})}),Rp=0,nr,or,sr,Ge,St,Ie,Ct,X,At,ri,$n,Qi,Ze=class extends U{constructor(){super();E(this,X);E(this,nr);E(this,or);E(this,sr);E(this,Ge);E(this,St);E(this,Ie);E(this,Ct,new Promise(r=>{y(this,Ie,r)}));m(this,"customerSegment");m(this,"marketSegment");m(this,"variantLayout");this.id=null,this.failed=!1,this.filters={},this.types="",this.selected=!1,this.spectrum="css",this.loading="lazy",this.handleAemFragmentEvents=this.handleAemFragmentEvents.bind(this),this.handleMerchOfferSelectReady=this.handleMerchOfferSelectReady.bind(this)}firstUpdated(){this.variantLayout=Mn(this),this.variantLayout?.connectedCallbackHook()}willUpdate(r){(r.has("variant")||!this.variantLayout)&&(this.variantLayout?.disconnectedCallbackHook(),this.variantLayout=Mn(this),this.variantLayout?.connectedCallbackHook())}updated(r){(r.has("badgeBackgroundColor")||r.has("borderColor"))&&this.style.setProperty("--consonant-merch-card-border",this.computedBorderStyle),r.has("backgroundColor")&&this.style.setProperty("--merch-card-custom-background-color",this.backgroundColor?`var(--${this.backgroundColor})`:"");try{this.variantLayoutPromise=this.variantLayout?.postCardUpdateHook(r)}catch(i){Z(this,X,At).call(this,`Error in postCardUpdateHook: ${i.message}`,{},!1)}}get theme(){return this.closest("sp-theme")}get dir(){return this.closest("[dir]")?.getAttribute("dir")??"ltr"}render(){if(!(!this.isConnected||!this.variantLayout||this.style.display==="none"))return this.variantLayout.renderLayout()}get computedBorderStyle(){return["ccd-slice","ccd-suggested","ah-promoted-plans","simplified-pricing-express","full-pricing-express"].includes(this.variant)?"":`1px solid ${this.borderColor?this.borderColor:this.badgeBackgroundColor}`}get badgeElement(){return this.shadowRoot.getElementById("badge")}get headingmMSlot(){return this.shadowRoot.querySelector('slot[name="heading-m"]').assignedElements()[0]}get footerSlot(){return this.shadowRoot.querySelector('slot[name="footer"]')?.assignedElements()[0]}get descriptionSlot(){return this.shadowRoot.querySelector('slot[name="body-xs"')?.assignedElements()[0]}get descriptionSlotCompare(){return this.shadowRoot.querySelector('slot[name="body-m"')?.assignedElements()[0]}get iconButton(){return this.querySelector('[slot="callout-content"] .icon-button')}get price(){return this.headingmMSlot?.querySelector(D)}get checkoutLinks(){return[...this.footerSlot?.querySelectorAll(Se)??[]]}get checkoutLinksDescription(){return[...this.descriptionSlot?.querySelectorAll(Se)??[]]}get checkoutLinkDescriptionCompare(){return[...this.descriptionSlotCompare?.querySelectorAll(Se)??[]]}get activeDescriptionLinks(){return this.variant==="mini-compare-chart"||this.variant==="mini-compare-chart-mweb"?this.checkoutLinkDescriptionCompare:this.checkoutLinksDescription}async toggleStockOffer({target:r}){if(!this.stockOfferOsis)return;let i=this.checkoutLinks;if(i.length!==0)for(let a of i){await a.onceSettled();let n=a.value?.[0]?.planType;if(!n)return;let o=this.stockOfferOsis[n];if(!o)return;let s=a.dataset.wcsOsi.split(",").filter(c=>c!==o);r.checked&&s.push(o),a.dataset.wcsOsi=s.join(",")}}changeHandler(r){r.target.tagName==="MERCH-ADDON"&&this.toggleAddon(r.target)}toggleAddon(r){this.variantLayout?.toggleAddon?.(r);let i=[...this.checkoutLinks,...this.activeDescriptionLinks??[]];if(i.length===0)return;let a=n=>{let{offerType:o,planType:s}=n.value?.[0]??{};if(!o||!s)return;let c=r.getOsi(s,o),l=(n.dataset.wcsOsi||"").split(",").filter(d=>d&&d!==c);r.checked&&l.push(c),n.dataset.wcsOsi=l.join(",")};i.forEach(a)}handleQuantitySelection(r){let i=[...this.checkoutLinks,...this.activeDescriptionLinks??[]];if(i.length!==0)for(let a of i)a.dataset.quantity=r.detail.option}get titleElement(){return this.querySelector(this.variantLayout?.headingSelector||".card-heading")}get title(){return this.titleElement?.textContent?.trim()}get description(){return this.querySelector('[slot="body-xs"]')?.textContent?.trim()}updateFilters(r){let i={...this.filters};Object.keys(i).forEach(a=>{if(r){i[a].order=Math.min(i[a].order||2,2);return}let n=i[a].order;n===1||isNaN(n)||(i[a].order=Number(n)+1)}),this.filters=i}showInfoTooltip(r,i){let a="tooltip-left",n="tooltip-right";window.screen.width<600&&r.getAttribute("data-tooltip")?.length>12&&(this.iconButton.classList.remove(a),this.iconButton.classList.remove(n),r.getBoundingClientRect().x<100&&this.iconButton.classList.add(a),r.getBoundingClientRect().x>window.screen.width-100&&this.iconButton.classList.add(n)),this.iconButton.classList.add(i)}handleInfoIconEvents(){let r="tooltip-visible";this.iconButton&&(["mouseenter","focus"].forEach(i=>this.iconButton.addEventListener(i,a=>this.showInfoTooltip(a.target,r),!1)),["mouseleave","blur"].forEach(i=>this.iconButton.addEventListener(i,()=>this.iconButton.classList.remove(r),!1)),this.iconButton.addEventListener("keydown",i=>{i.key==="Escape"&&this.iconButton.classList.remove(r)}))}includes(r){return this.textContent.match(new RegExp(r,"i"))!==null}connectedCallback(){var i;super.connectedCallback(),h(this,or)||y(this,or,Rp++),this.aemFragment||((i=h(this,Ie))==null||i.call(this),y(this,Ie,void 0)),this.id??(this.id=this.getAttribute("id")??this.aemFragment?.getAttribute("fragment"));let r=this.id??h(this,or);y(this,St,`${ol}${r}${st}`),y(this,nr,`${ol}${r}${ct}`),performance.mark(h(this,St)),y(this,Ge,mt()),Mp(h(this,Ge)),y(this,sr,h(this,Ge).Log.module(Hn)),this.addEventListener(te,this.handleQuantitySelection),this.addEventListener(li,this.handleAddonAndQuantityUpdate),this.addEventListener(gr,this.handleMerchOfferSelectReady),this.addEventListener(nt,this.handleAemFragmentEvents),this.addEventListener(at,this.handleAemFragmentEvents),this.addEventListener(fr,this.handleInfoIconEvents),this.addEventListener("change",this.changeHandler),this.variantLayout&&this.variantLayout.connectedCallbackHook(),this.aemFragment||setTimeout(()=>this.checkReady(),0)}disconnectedCallback(){super.disconnectedCallback(),this.variantLayout?.disconnectedCallbackHook(),this.removeEventListener(te,this.handleQuantitySelection),this.removeEventListener(nt,this.handleAemFragmentEvents),this.removeEventListener(at,this.handleAemFragmentEvents),this.removeEventListener(fr,this.handleInfoIconEvents),this.removeEventListener("change",this.changeHandler),this.removeEventListener(li,this.handleAddonAndQuantityUpdate)}async handleAemFragmentEvents(r){var i;if(this.isConnected&&(r.type===nt&&Z(this,X,At).call(this,"AEM fragment cannot be loaded"),r.type===at&&(this.failed=!1,r.target.nodeName==="AEM-FRAGMENT"))){let a=r.detail;try{h(this,Ie)||y(this,Ct,new Promise(n=>{y(this,Ie,n)})),nl(a,this)}catch(n){Z(this,X,At).call(this,`hydration has failed: ${n.message}`)}finally{(i=h(this,Ie))==null||i.call(this),y(this,Ie,void 0)}this.checkReady()}}async checkReady(){if(!this.isConnected)return;h(this,Ct)&&(await h(this,Ct),(cl.includes(this.variant)||ll.includes(this.variant))&&ti.observe(this),y(this,Ct,void 0)),this.variantLayoutPromise&&(await this.variantLayoutPromise,this.variantLayoutPromise=void 0);let r=new Promise(o=>setTimeout(()=>o("timeout"),Dn));if(this.aemFragment){let o=await Promise.race([this.aemFragment.updateComplete,r]);if(o===!1||o==="timeout"){let s=o==="timeout"?`AEM fragment was not resolved within ${Dn} timeout`:"AEM fragment cannot be loaded";Z(this,X,At).call(this,s,{},!1);return}}let i=[...this.querySelectorAll(ur)],a=Promise.all(i.map(o=>o.onceSettled().catch(()=>o))).then(o=>o.every(s=>s.classList.contains("placeholder-resolved"))),n=await Promise.race([a,r]);if(n===!0){this.measure=performance.measure(h(this,nr),h(this,St));let o={...this.aemFragment?.fetchInfo,...h(this,Ge).duration,measure:Oe(this.measure)};return this.dispatchEvent(new CustomEvent(fr,{bubbles:!0,composed:!0,detail:o})),this}else{this.measure=performance.measure(h(this,nr),h(this,St));let o={measure:Oe(this.measure),...h(this,Ge).duration};n==="timeout"?Z(this,X,At).call(this,`Contains offers that were not resolved within ${Dn} timeout`,o):Z(this,X,At).call(this,"Contains unresolved offers",o)}}get aemFragment(){return this.querySelector("aem-fragment")}get addon(){return this.querySelector("merch-addon")}get quantitySelect(){return this.querySelector("merch-quantity-select")}get addonCheckbox(){return this.querySelector("merch-addon")}displayFooterElementsInColumn(){if(!this.classList.contains("product"))return;let r=this.shadowRoot.querySelector(".secure-transaction-label");(this.footerSlot?.querySelectorAll(Se)).length===2&&r&&r.parentElement.classList.add("footer-column")}handleMerchOfferSelectReady(){this.offerSelect&&!this.offerSelect.planType||this.displayFooterElementsInColumn()}get dynamicPrice(){return this.querySelector('[slot="price"]')}handleAddonAndQuantityUpdate({detail:{id:r,items:i}}){if(!r||!i?.length||this.closest('[role="tabpanel"][hidden="true"]'))return;let n=this.checkoutLinks.find(d=>d.getAttribute("data-modal-id")===r);if(!n)return;let s=new URL(n.getAttribute("href")).searchParams.get("pa"),c=i.find(d=>d.productArrangementCode===s)?.quantity,l=!!i.find(d=>d.productArrangementCode!==s);if(c&&this.quantitySelect?.dispatchEvent(new CustomEvent(Pt,{detail:{quantity:c},bubbles:!0,composed:!0})),this.addonCheckbox&&this.addonCheckbox.checked!==l){this.toggleStockOffer({target:this.addonCheckbox});let d=new Event("change",{bubbles:!0,cancelable:!0});Object.defineProperty(d,"target",{writable:!1,value:{checked:l}}),this.addonCheckbox.handleChange(d)}}get prices(){return Array.from(this.querySelectorAll(D))}get promoPrice(){if(!this.querySelector("span.price-strikethrough"))return;let r=this.querySelector(".price.price-alternative");if(r||(r=this.querySelector(`${D}[data-template="price"] > span`)),!!r)return r=r.innerText,r}get regularPrice(){return h(this,X,ri)?.innerText}get promotionCode(){let r=[...this.querySelectorAll(`${D}[data-promotion-code],${Se}[data-promotion-code]`)].map(a=>a.dataset.promotionCode),i=[...new Set(r)];return i.length>1&&h(this,sr)?.warn(`Multiple different promotion codes found: ${i.join(", ")}`),r[0]}get annualPrice(){return this.querySelector(`${D}[data-template="price"] > .price.price-annual`)?.innerText}get promoText(){}get taxText(){return(h(this,X,$n)??h(this,X,ri))?.querySelector("span.price-tax-inclusivity")?.textContent?.trim()||void 0}get recurrenceText(){return h(this,X,ri)?.querySelector("span.price-recurrence")?.textContent?.trim()}get unitText(){let r=".price-unit-type";return h(this,X,$n)?.querySelector(r)?.textContent?.trim()??h(this,X,ri)?.querySelector(r)?.textContent?.trim()??this.querySelector(r)?.textContent?.trim()??void 0}get planTypeText(){return this.querySelector('[is="inline-price"][data-template="legal"] span.price-plan-type')?.textContent?.trim()}get seeTermsInfo(){let r=this.querySelector('a[is="upt-link"]');if(r)return Z(this,X,Qi).call(this,r)}get renewalText(){return this.querySelector("span.renewal-text")?.textContent?.trim()}get promoDurationText(){return this.querySelector("span.promo-duration-text")?.textContent?.trim()}get ctas(){let r=this.querySelector('[slot="ctas"], [slot="footer"]')?.querySelectorAll(`${Se}, a`);return Array.from(r??[])}get primaryCta(){return Z(this,X,Qi).call(this,this.ctas.find(r=>r.variant==="accent"||r.matches(".spectrum-Button--accent,.con-button.blue")))}get secondaryCta(){return Z(this,X,Qi).call(this,this.ctas.find(r=>r.variant!=="accent"&&!r.matches(".spectrum-Button--accent,.con-button.blue")))}};nr=new WeakMap,or=new WeakMap,sr=new WeakMap,Ge=new WeakMap,St=new WeakMap,Ie=new WeakMap,Ct=new WeakMap,X=new WeakSet,At=function(r,i={},a=!0){if(!this.isConnected)return;let o=this.aemFragment?.getAttribute("fragment");o=`[${o}]`;let s={...this.aemFragment.fetchInfo,...h(this,Ge).duration,...i,message:r};h(this,sr).error(`merch-card${o}: ${r}`,s),this.failed=!0,a&&this.dispatchEvent(new CustomEvent(na,{bubbles:!0,composed:!0,detail:s}))},ri=function(){return this.querySelector("span.price-strikethrough")??this.querySelector(`${D}[data-template="price"] > span`)},$n=function(){return this.querySelector(`${D}[data-template="legal"]`)},Qi=function(r){if(r)return{text:r.innerText.trim(),analyticsId:r.dataset.analyticsId,href:r.getAttribute("href")??r.dataset.href}},m(Ze,"properties",{id:{type:String,attribute:"id",reflect:!0},name:{type:String,attribute:"name",reflect:!0},variant:{type:String,reflect:!0},size:{type:String,attribute:"size",reflect:!0},badgeColor:{type:String,attribute:"badge-color",reflect:!0},borderColor:{type:String,attribute:"border-color",reflect:!0},backgroundColor:{type:String,attribute:"background-color",reflect:!0},badgeBackgroundColor:{type:String,attribute:"badge-background-color",reflect:!0},backgroundImage:{type:String,attribute:"background-image",reflect:!0},badgeText:{type:String,attribute:"badge-text"},actionMenu:{type:Boolean,attribute:"action-menu"},actionMenuLabel:{type:String,attribute:"action-menu-label"},customHr:{type:Boolean,attribute:"custom-hr"},consonant:{type:Boolean,attribute:"consonant"},failed:{type:Boolean,attribute:"failed",reflect:!0},spectrum:{type:String,attribute:"spectrum"},detailBg:{type:String,attribute:"detail-bg"},secureLabel:{type:String,attribute:"secure-label"},checkboxLabel:{type:String,attribute:"checkbox-label"},addonTitle:{type:String,attribute:"addon-title"},addonOffers:{type:Object,attribute:"addon-offers"},selected:{type:Boolean,attribute:"aria-selected",reflect:!0},storageOption:{type:String,attribute:"storage",reflect:!0},planType:{type:String,attribute:"plan-type",reflect:!0},heightSync:{type:Boolean,attribute:"height-sync"},settings:{type:Object,attribute:!1},stockOfferOsis:{type:Object,attribute:"stock-offer-osis",converter:{fromAttribute:r=>{if(!r)return;let[i,a,n]=r.split(",");return{PUF:i,ABM:a,M2M:n}}}},filters:{type:String,reflect:!0,converter:{fromAttribute:r=>Object.fromEntries(r.split(",").map(i=>{let[a,n,o]=i.split(":"),s=Number(n);return[a,{order:isNaN(s)?void 0:s,size:o}]})),toAttribute:r=>Object.entries(r).map(([i,{order:a,size:n}])=>[i,a,n].filter(o=>o!=null).join(":")).join(",")}},types:{type:String,attribute:"types",reflect:!0},merchOffer:{type:Object},analyticsId:{type:String,attribute:Ki,reflect:!0},loading:{type:String},priceLiterals:{type:Object}}),m(Ze,"styles",[dc,...hc()]),m(Ze,"registerVariant",G),m(Ze,"getCollectionOptions",Uc),m(Ze,"getFragmentMapping",qi);customElements.define(Hn,Ze);P();var cr,ii=class extends U{constructor(){super();E(this,cr);this.defaults={},this.variant="plans"}saveContainerDefaultValues(){let r=this.closest(this.getAttribute("container")),i=r?.querySelector('[slot="description"]:not(merch-offer > *)')?.cloneNode(!0),a=r?.badgeText;return{description:i,badgeText:a}}getSlottedElement(r,i){return(i||this.closest(this.getAttribute("container"))).querySelector(`[slot="${r}"]:not(merch-offer > *)`)}updateSlot(r,i){let a=this.getSlottedElement(r,i);if(!a)return;let n=this.selectedOffer.getOptionValue(r)?this.selectedOffer.getOptionValue(r):this.defaults[r];n&&a.replaceWith(n.cloneNode(!0))}handleOfferSelection(r){let i=r.detail;this.selectOffer(i)}handleOfferSelectionByQuantity(r){let i=r.detail.option,a=Number.parseInt(i),n=this.findAppropriateOffer(a);this.selectOffer(n),this.getSlottedElement("cta").setAttribute("data-quantity",a)}selectOffer(r){if(!r)return;let i=this.selectedOffer;i&&(i.selected=!1),r.selected=!0,this.selectedOffer=r,this.planType=r.planType,this.updateContainer(),this.updateComplete.then(()=>{this.dispatchEvent(new CustomEvent(aa,{detail:this,bubbles:!0}))})}findAppropriateOffer(r){let i=null;return this.offers.find(n=>{let o=Number.parseInt(n.getAttribute("value"));if(o===r)return!0;if(o>r)return!1;i=n})||i}updateBadgeText(r){this.selectedOffer.badgeText===""?r.badgeText=null:this.selectedOffer.badgeText?r.badgeText=this.selectedOffer.badgeText:r.badgeText=this.defaults.badgeText}updateContainer(){let r=this.closest(this.getAttribute("container"));!r||!this.selectedOffer||(this.updateSlot("cta",r),this.updateSlot("secondary-cta",r),this.updateSlot("price",r),!this.manageableMode&&(this.updateSlot("description",r),this.updateBadgeText(r)))}render(){return g`
`}connectedCallback(){super.connectedCallback(),this.addEventListener("focusin",this.handleFocusin),this.addEventListener("click",this.handleFocusin),this.addEventListener(_t,this.handleOfferSelectReady);let r=this.closest("merch-quantity-select");this.manageableMode=r,this.offers=[...this.querySelectorAll("merch-offer")],y(this,cr,this.handleOfferSelectionByQuantity.bind(this)),this.manageableMode?r.addEventListener(te,h(this,cr)):this.defaults=this.saveContainerDefaultValues(),this.selectedOffer=this.offers[0],this.planType&&this.updateContainer()}get miniCompareMobileCard(){return(this.merchCard?.variant==="mini-compare-chart"||this.merchCard?.variant==="mini-compare-chart-mweb")&&this.isMobile}get merchCard(){return this.closest("merch-card")}get isMobile(){return window.matchMedia("(max-width: 767px)").matches}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(te,h(this,cr)),this.removeEventListener(_t,this.handleOfferSelectReady),this.removeEventListener("focusin",this.handleFocusin),this.removeEventListener("click",this.handleFocusin)}get price(){return this.querySelector('merch-offer[aria-selected] [is="inline-price"]')}get customerSegment(){return this.selectedOffer?.customerSegment}get marketSegment(){return this.selectedOffer?.marketSegment}handleFocusin(r){r.target?.nodeName==="MERCH-OFFER"&&(r.preventDefault(),r.stopImmediatePropagation(),this.selectOffer(r.target))}async handleOfferSelectReady(){this.planType||this.querySelector("merch-offer:not([plan-type])")||(this.planType=this.selectedOffer.planType,await this.updateComplete,this.selectOffer(this.selectedOffer??this.querySelector("merch-offer[aria-selected]")??this.querySelector("merch-offer")),this.dispatchEvent(new CustomEvent(gr,{bubbles:!0})))}};cr=new WeakMap,m(ii,"styles",b` :host { display: inline-block; } @@ -9091,7 +9091,7 @@ merch-card[border-color="spectrum-red-700-plans"] { position: relative; height: 40px; } -`;var Rp="merch-offer",ai=class extends U{constructor(){super();m(this,"tr");this.type="radio",this.selected=!1}getOptionValue(r){return this.querySelector(`[slot="${r}"]`)}connectedCallback(){super.connectedCallback(),this.initOffer(),this.configuration=this.closest("quantity-selector"),!this.hasAttribute("tabindex")&&!this.configuration&&(this.tabIndex=0),!this.hasAttribute("role")&&!this.configuration&&(this.role="radio")}get asRadioOption(){return g`
+`;var Op="merch-offer",ai=class extends U{constructor(){super();m(this,"tr");this.type="radio",this.selected=!1}getOptionValue(r){return this.querySelector(`[slot="${r}"]`)}connectedCallback(){super.connectedCallback(),this.initOffer(),this.configuration=this.closest("quantity-selector"),!this.hasAttribute("tabindex")&&!this.configuration&&(this.tabIndex=0),!this.hasAttribute("role")&&!this.configuration&&(this.role="radio")}get asRadioOption(){return g`
${this.text} @@ -9108,7 +9108,7 @@ merch-card[border-color="spectrum-red-700-plans"] { > -
`}render(){return this.configuration||!this.price?"":this.type==="subscription-option"?this.asSubscriptionOption:this.asRadioOption}get price(){return this.querySelector('span[is="inline-price"]:not([data-template="strikethrough"])')}get cta(){return this.querySelector(Se)}get prices(){return this.querySelectorAll('span[is="inline-price"]')}get customerSegment(){return this.price?.value?.[0].customerSegment}get marketSegment(){return this.price?.value?.[0].marketSegments[0]}async initOffer(){if(!this.price)return;this.prices.forEach(i=>i.setAttribute("slot","price")),await this.updateComplete,await Promise.all([...this.prices].map(i=>i.onceSettled()));let{value:[r]}=this.price;this.planType=r.planType,await this.updateComplete,this.dispatchEvent(new CustomEvent(_t,{bubbles:!0}))}};m(ai,"properties",{text:{type:String},selected:{type:Boolean,attribute:"aria-selected",reflect:!0},badgeText:{type:String,attribute:"badge-text"},type:{type:String,attribute:"type",reflect:!0},planType:{type:String,attribute:"plan-type",reflect:!0}}),m(ai,"styles",[dl]);customElements.define(Rp,ai);P();P();var hl=b` +
`}render(){return this.configuration||!this.price?"":this.type==="subscription-option"?this.asSubscriptionOption:this.asRadioOption}get price(){return this.querySelector('span[is="inline-price"]:not([data-template="strikethrough"])')}get cta(){return this.querySelector(Se)}get prices(){return this.querySelectorAll('span[is="inline-price"]')}get customerSegment(){return this.price?.value?.[0].customerSegment}get marketSegment(){return this.price?.value?.[0].marketSegments[0]}async initOffer(){if(!this.price)return;this.prices.forEach(i=>i.setAttribute("slot","price")),await this.updateComplete,await Promise.all([...this.prices].map(i=>i.onceSettled()));let{value:[r]}=this.price;this.planType=r.planType,await this.updateComplete,this.dispatchEvent(new CustomEvent(_t,{bubbles:!0}))}};m(ai,"properties",{text:{type:String},selected:{type:Boolean,attribute:"aria-selected",reflect:!0},badgeText:{type:String,attribute:"badge-text"},type:{type:String,attribute:"type",reflect:!0},planType:{type:String,attribute:"plan-type",reflect:!0}}),m(ai,"styles",[dl]);customElements.define(Op,ai);P();P();var hl=b` :host { box-sizing: border-box; --background-color: var(--qs-background-color, #f6f6f6); @@ -9267,7 +9267,7 @@ merch-card[border-color="spectrum-red-700-plans"] { :host(:dir(rtl)) .item.selected { background-position: left 7px center; } -`;var[y0,w0,Bn,Fn,pl,ml]=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Enter","Tab"];var Un=class extends U{static get properties(){return{closed:{type:Boolean,reflect:!0},selected:{type:Number},min:{type:Number},max:{type:Number},step:{type:Number},maxInput:{type:Number,attribute:"max-input"},options:{type:Array},highlightedIndex:{type:Number},defaultValue:{type:Number,attribute:"default-value",reflect:!0},title:{type:String}}}static get styles(){return hl}constructor(){super(),this.options=[],this.title="",this.closed=!0,this.min=0,this.max=0,this.step=0,this.maxInput=void 0,this.defaultValue=void 0,this.selectedValue=0,this.highlightedIndex=0,this.toggleMenu=this.toggleMenu.bind(this),this.closeMenu=this.closeMenu.bind(this),this.openMenu=this.openMenu.bind(this),this.handleClickOutside=this.handleClickOutside.bind(this),this.boundKeydownListener=this.handleKeydown.bind(this),this.handleKeyupDebounced=Rr(this.handleKeyup.bind(this),500),this.debouncedQuantityUpdate=Rr(this.handleQuantityUpdate.bind(this),500)}connectedCallback(){super.connectedCallback(),this.addEventListener("keydown",this.boundKeydownListener),window.addEventListener("mousedown",this.handleClickOutside),this.addEventListener(Pt,this.debouncedQuantityUpdate)}get button(){return this.shadowRoot.querySelector("button")}handleKeyup(t){t.key===Fn||t.key===Bn||(this.handleInput(),this.sendEvent())}selectValue(){if(!this.closed){let t=this.options[this.highlightedIndex];if(!t){this.closed=!0;return}this.selectedValue=t,this.handleMenuOption(this.selectedValue),this.closed=!0}}handleKeydown(t){switch(t.key){case" ":this.selectValue();break;case"Escape":this.closed=!0;break;case ml:this.selectValue();break;case Fn:this.closed?this.openMenu():this.highlightedIndex=(this.highlightedIndex+1)%this.options.length,t.preventDefault();break;case Bn:this.closed||(this.highlightedIndex=(this.highlightedIndex-1+this.options.length)%this.options.length),t.preventDefault();break;case pl:this.selectValue(),this.button.classList.contains("focused")&&t.preventDefault();break}t.composedPath().includes(this)&&t.stopPropagation()}adjustInput(t,r){this.selectedValue=r,t.value=r,this.highlightedIndex=this.options.indexOf(r)}handleInput(){let t=this.shadowRoot.querySelector(".text-field-input"),r=t.value.replace(/\D/g,"");t.value=r;let i=parseInt(r);if(!isNaN(i))if(i>0&&i!==this.selectedValue){let a=i;this.maxInput&&i>this.maxInput&&(a=this.maxInput),this.min&&a0)for(let r=this.min;r<=this.max;r+=this.step)t.push(r);return t}update(t){(t.has("min")||t.has("max")||t.has("step")||t.has("defaultValue"))&&(this.options=this.generateOptionsArray(),this.highlightedIndex=this.defaultValue?this.options.indexOf(this.defaultValue):0,this.handleMenuOption(this.defaultValue?this.defaultValue:this.options[0])),super.update(t)}handleClickOutside(t){t.composedPath().includes(this)||this.closeMenu()}toggleMenu(){this.closed=!this.closed,this.adjustPopoverPlacement(),this.closed&&(this.highlightedIndex=this.options.indexOf(this.selectedValue))}closeMenu(){this.closed=!0,this.highlightedIndex=this.options.indexOf(this.selectedValue)}openMenu(){this.closed=!1,this.adjustPopoverPlacement()}adjustPopoverPlacement(){let t=this.shadowRoot.querySelector(".popover");this.closed||t.getBoundingClientRect().bottom<=window.innerHeight?t.setAttribute("placement","bottom"):t.setAttribute("placement","top")}handleMouseEnter(t){this.highlightedIndex=t}handleMenuOption(t,r){t===this.max&&this.shadowRoot.querySelector(".text-field-input")?.focus(),this.selectedValue=t,this.sendEvent(),r&&this.closeMenu()}sendEvent(){let t=new CustomEvent(te,{detail:{option:this.selectedValue},bubbles:!0});this.dispatchEvent(t)}get configured(){return this.title||this.min||this.step}get offerSelect(){return this.querySelector("merch-offer-select")}get popover(){return g`
0&&i!==this.selectedValue){let a=i;this.maxInput&&i>this.maxInput&&(a=this.maxInput),this.min&&a0)for(let r=this.min;r<=this.max;r+=this.step)t.push(r);return t}update(t){(t.has("min")||t.has("max")||t.has("step")||t.has("defaultValue"))&&(this.options=this.generateOptionsArray(),this.highlightedIndex=this.defaultValue?this.options.indexOf(this.defaultValue):0,this.handleMenuOption(this.defaultValue?this.defaultValue:this.options[0])),super.update(t)}handleClickOutside(t){t.composedPath().includes(this)||this.closeMenu()}toggleMenu(){this.closed=!this.closed,this.adjustPopoverPlacement(),this.closed&&(this.highlightedIndex=this.options.indexOf(this.selectedValue))}closeMenu(){this.closed=!0,this.highlightedIndex=this.options.indexOf(this.selectedValue)}openMenu(){this.closed=!1,this.adjustPopoverPlacement()}adjustPopoverPlacement(){let t=this.shadowRoot.querySelector(".popover");this.closed||t.getBoundingClientRect().bottom<=window.innerHeight?t.setAttribute("placement","bottom"):t.setAttribute("placement","top")}handleMouseEnter(t){this.highlightedIndex=t}handleMenuOption(t,r){t===this.max&&this.shadowRoot.querySelector(".text-field-input")?.focus(),this.selectedValue=t,this.sendEvent(),r&&this.closeMenu()}sendEvent(){let t=new CustomEvent(te,{detail:{option:this.selectedValue},bubbles:!0});this.dispatchEvent(t)}get configured(){return this.title||this.min||this.step}get offerSelect(){return this.querySelector("merch-offer-select")}get popover(){return g`
{throw TypeError(a)};var Oa=(a,t,e)=>t in margin-left: 5px; border-right-color: var(--spectrum-gray-800, #323232); } - `);$e=P;customElements.define("mas-mnemonic",$e)});import{LitElement as kn}from"./lit-all.min.js";import{css as cr,unsafeCSS as or}from"./lit-all.min.js";var y="(max-width: 767px)",C="(max-width: 1199px)",w="(min-width: 768px)",u="(min-width: 1200px)",A="(min-width: 1600px)",nr={matchMobile:window.matchMedia(y),matchDesktop:window.matchMedia(`${u} and (not ${A})`),matchDesktopOrUp:window.matchMedia(u),matchLargeDesktop:window.matchMedia(A),get isMobile(){return this.matchMobile.matches},get isDesktop(){return this.matchDesktop.matches},get isDesktopOrUp(){return this.matchDesktopOrUp.matches}},f=nr;function it(){return nr.isDesktop}var sr=cr` + `);$e=P;customElements.define("mas-mnemonic",$e)});import{LitElement as Sn}from"./lit-all.min.js";import{css as cr,unsafeCSS as or}from"./lit-all.min.js";var y="(max-width: 767px)",C="(max-width: 1199px)",w="(min-width: 768px)",u="(min-width: 1200px)",A="(min-width: 1600px)",nr={matchMobile:window.matchMedia(y),matchDesktop:window.matchMedia(`${u} and (not ${A})`),matchDesktopOrUp:window.matchMedia(u),matchLargeDesktop:window.matchMedia(A),get isMobile(){return this.matchMobile.matches},get isDesktop(){return this.matchDesktop.matches},get isDesktopOrUp(){return this.matchDesktopOrUp.matches}},f=nr;function it(){return nr.isDesktop}var sr=cr` :host { --consonant-merch-card-background-color: #fff; --consonant-merch-card-border: 1px solid @@ -459,7 +459,7 @@ var rr=Object.defineProperty;var ar=a=>{throw TypeError(a)};var Oa=(a,t,e)=>t in width: var(--mod-img-width, var(--img-width)); height: var(--mod-img-height, var(--img-height)); } - `);customElements.define("merch-icon",me);var Dn=Object.freeze({MONTH:"MONTH",YEAR:"YEAR",TWO_YEARS:"TWO_YEARS",THREE_YEARS:"THREE_YEARS",PERPETUAL:"PERPETUAL",TERM_LICENSE:"TERM_LICENSE",ACCESS_PASS:"ACCESS_PASS",THREE_MONTHS:"THREE_MONTHS",SIX_MONTHS:"SIX_MONTHS"}),Fn=Object.freeze({ANNUAL:"ANNUAL",MONTHLY:"MONTHLY",TWO_YEARS:"TWO_YEARS",THREE_YEARS:"THREE_YEARS",P1D:"P1D",P1Y:"P1Y",P3Y:"P3Y",P10Y:"P10Y",P15Y:"P15Y",P3D:"P3D",P7D:"P7D",P30D:"P30D",HALF_YEARLY:"HALF_YEARLY",QUARTERLY:"QUARTERLY"});var b='span[is="inline-price"][data-wcs-osi]',W='a[is="checkout-link"][data-wcs-osi],button[is="checkout-button"][data-wcs-osi]';var ja='a[is="upt-link"]',hr=`${b},${W},${ja}`;var pr="merch-offer-select:ready",mr="merch-card:action-menu-toggle";var R="merch-quantity-selector:change",gr="merch-card-quantity:change",Pt="merch-modal:addon-and-quantity-update";var ge="merch-card-collection:literals-changed";var ue="aem:load",fe="aem:error",ot="mas:ready",ur="mas:error",fr="placeholder-failed",vr="placeholder-pending",xr="placeholder-resolved";var br="mas:failed",Be="mas:resolved",yr="mas/commerce";var K="failed",re="pending",Y="resolved";var ct="X-Request-Id",In=Object.freeze({SEGMENTATION:"segmentation",BUNDLE:"bundle",COMMITMENT:"commitment",RECOMMENDATION:"recommendation",EMAIL:"email",PAYMENT:"payment",CHANGE_PLAN_TEAM_PLANS:"change-plan/team-upgrade/plans",CHANGE_PLAN_TEAM_PAYMENT:"change-plan/team-upgrade/payment"});var $n=Object.freeze({STAGE:"STAGE",PRODUCTION:"PRODUCTION",LOCAL:"LOCAL"});var st=":start",lt=":duration";var N="legal",wr="mas-ff-defaults";var Ga="mas-commerce-service";function Er(a,t){let e;return function(){let r=this,i=arguments;clearTimeout(e),e=setTimeout(()=>a.apply(r,i),t)}}function T(a,t={},e=null,r=null){let i=r?document.createElement(a,{is:r}):document.createElement(a);e instanceof HTMLElement?i.appendChild(e):i.innerHTML=e;for(let[n,o]of Object.entries(t))i.setAttribute(n,o);return i}function ve(a){return`startTime:${a.startTime.toFixed(2)}|duration:${a.duration.toFixed(2)}`}function _t(){return window.matchMedia("(max-width: 1024px)").matches}function ae(){return document.getElementsByTagName(Ga)?.[0]}function qe(a){let t=window.getComputedStyle(a);return a.offsetHeight+parseFloat(t.marginTop)+parseFloat(t.marginBottom)}var He,ie,Ue,je,xe,dt=class extends HTMLElement{constructor(){super();g(this,He,"");g(this,ie);g(this,Ue,[]);g(this,je,[]);g(this,xe);m(this,xe,Er(()=>{this.isConnected&&(this.parentElement.style.background=this.value,s(this,ie)?this.parentElement.style.borderRadius=s(this,ie):s(this,ie)===""&&(this.parentElement.style.borderRadius=""))},1))}static get observedAttributes(){return["colors","positions","angle","border-radius"]}get value(){let e=s(this,Ue).map((r,i)=>{let n=s(this,je)[i]||"";return`${r} ${n}`}).join(", ");return`linear-gradient(${s(this,He)}, ${e})`}connectedCallback(){s(this,xe).call(this)}attributeChangedCallback(e,r,i){e==="border-radius"&&m(this,ie,i?.trim()),e==="colors"&&i?m(this,Ue,i?.split(",").map(n=>n.trim())??[]):e==="positions"&&i?m(this,je,i?.split(",").map(n=>n.trim())??[]):e==="angle"&&m(this,He,i?.trim()??""),s(this,xe).call(this)}};He=new WeakMap,ie=new WeakMap,Ue=new WeakMap,je=new WeakMap,xe=new WeakMap;customElements.define("merch-gradient",dt);import{LitElement as Va,html as Wa,css as Ka}from"./lit-all.min.js";var be=class extends Va{constructor(){super(),this.planType=void 0,this.checked=!1,this.updatePlanType=this.updatePlanType.bind(this),this.handleChange=this.handleChange.bind(this),this.handleCustomClick=this.handleCustomClick.bind(this)}getOsi(t,e){let n=({TRIAL:["TRIAL"],BASE:["BASE","PROMOTION","TRIAL"],PROMOTION:["PROMOTION","BASE","TRIAL"]}[e]||[e]).map(c=>`p[data-plan-type="${t}"] ${b}[data-offer-type="${c}"]`).join(", ");return this.querySelector(n)?.dataset?.wcsOsi}connectedCallback(){super.connectedCallback(),this.addEventListener(Be,this.updatePlanType)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(Be,this.updatePlanType)}updatePlanType(t){if(t.target.tagName!=="SPAN")return;let e=t.target,r=e?.value?.[0];r&&(e.setAttribute("data-offer-type",r.offerType),e.closest("p").setAttribute("data-plan-type",r.planType))}handleChange(t){this.checked=t.target.checked,this.dispatchEvent(new CustomEvent("change",{detail:{checked:this.checked},bubbles:!0,composed:!0}))}handleCustomClick(){this.shadowRoot.querySelector("input").click()}handleKeyDown(t){t.key===" "&&(t.preventDefault(),this.handleCustomClick())}render(){return Wa` a.apply(r,i),t)}}function T(a,t={},e=null,r=null){let i=r?document.createElement(a,{is:r}):document.createElement(a);e instanceof HTMLElement?i.appendChild(e):i.innerHTML=e;for(let[n,o]of Object.entries(t))i.setAttribute(n,o);return i}function ve(a){return`startTime:${a.startTime.toFixed(2)}|duration:${a.duration.toFixed(2)}`}function _t(){return window.matchMedia("(max-width: 1024px)").matches}function ae(){return document.getElementsByTagName(Ga)?.[0]}function qe(a){let t=window.getComputedStyle(a);return a.offsetHeight+parseFloat(t.marginTop)+parseFloat(t.marginBottom)}var He,ie,Ue,je,xe,dt=class extends HTMLElement{constructor(){super();g(this,He,"");g(this,ie);g(this,Ue,[]);g(this,je,[]);g(this,xe);m(this,xe,Er(()=>{this.isConnected&&(this.parentElement.style.background=this.value,s(this,ie)?this.parentElement.style.borderRadius=s(this,ie):s(this,ie)===""&&(this.parentElement.style.borderRadius=""))},1))}static get observedAttributes(){return["colors","positions","angle","border-radius"]}get value(){let e=s(this,Ue).map((r,i)=>{let n=s(this,je)[i]||"";return`${r} ${n}`}).join(", ");return`linear-gradient(${s(this,He)}, ${e})`}connectedCallback(){s(this,xe).call(this)}attributeChangedCallback(e,r,i){e==="border-radius"&&m(this,ie,i?.trim()),e==="colors"&&i?m(this,Ue,i?.split(",").map(n=>n.trim())??[]):e==="positions"&&i?m(this,je,i?.split(",").map(n=>n.trim())??[]):e==="angle"&&m(this,He,i?.trim()??""),s(this,xe).call(this)}};He=new WeakMap,ie=new WeakMap,Ue=new WeakMap,je=new WeakMap,xe=new WeakMap;customElements.define("merch-gradient",dt);import{LitElement as Va,html as Wa,css as Ka}from"./lit-all.min.js";var be=class extends Va{constructor(){super(),this.planType=void 0,this.checked=!1,this.updatePlanType=this.updatePlanType.bind(this),this.handleChange=this.handleChange.bind(this),this.handleCustomClick=this.handleCustomClick.bind(this)}getOsi(t,e){let n=({TRIAL:["TRIAL"],BASE:["BASE","PROMOTION","TRIAL"],PROMOTION:["PROMOTION","BASE","TRIAL"]}[e]||[e]).map(c=>`p[data-plan-type="${t}"] ${b}[data-offer-type="${c}"]`).join(", ");return this.querySelector(n)?.dataset?.wcsOsi}connectedCallback(){super.connectedCallback(),this.addEventListener(Be,this.updatePlanType)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(Be,this.updatePlanType)}updatePlanType(t){if(t.target.tagName!=="SPAN")return;let e=t.target,r=e?.value?.[0];r&&(e.setAttribute("data-offer-type",r.offerType),e.closest("p").setAttribute("data-plan-type",r.planType))}handleChange(t){this.checked=t.target.checked,this.dispatchEvent(new CustomEvent("change",{detail:{checked:this.checked},bubbles:!0,composed:!0}))}handleCustomClick(){this.shadowRoot.querySelector("input").click()}handleKeyDown(t){t.key===" "&&(t.preventDefault(),this.handleCustomClick())}render(){return Wa` typeof a=="boolean",yt=a=>typeof a=="function";var Bt=a=>typeof a=="string";function oa(a,t){if(bi(a))return a;let e=String(a);return e==="1"||e==="true"?!0:e==="0"||e==="false"?!1:t}function yi(a=""){return String(a).replace(/(\p{Lowercase_Letter})(\p{Uppercase_Letter})/gu,(t,e,r)=>`${e}-${r}`).replace(/\W+/gu,"-").toLowerCase()}var Z=class a extends Error{constructor(t,e,r){if(super(t,{cause:r}),this.name="MasError",e.response){let i=e.response.headers?.get(ct);i&&(e.requestId=i),e.response.status&&(e.status=e.response.status,e.statusText=e.response.statusText),e.response.url&&(e.url=e.response.url)}delete e.response,this.context=e,Error.captureStackTrace&&Error.captureStackTrace(this,a)}toString(){let t=Object.entries(this.context||{}).map(([r,i])=>`${r}: ${JSON.stringify(i)}`).join(", "),e=`${this.name}: ${this.message}`;return t&&(e+=` (${t})`),this.cause&&(e+=` -Caused by: ${this.cause}`),e}};var oe={clientId:"merch-at-scale",delimiter:"\xB6",ignoredProperties:["analytics","literals","element"],serializableTypes:["Array","Object"],sampleRate:1,severity:"e",tags:"acom",isProdDomain:!1},ca=1e3;function wi(a){return a instanceof Error||typeof a?.originatingRequest=="string"}function sa(a){if(a==null)return;let t=typeof a;if(t==="function")return a.name?`function ${a.name}`:"function";if(t==="object"){if(a instanceof Error)return a.message;if(typeof a.originatingRequest=="string"){let{message:r,originatingRequest:i,status:n}=a;return[r,n,i].filter(Boolean).join(" ")}let e=a[Symbol.toStringTag]??Object.getPrototypeOf(a).constructor.name;if(!oe.serializableTypes.includes(e))return e}return a}function Ei(a,t){if(!oe.ignoredProperties.includes(a))return sa(t)}var qt={append(a){if(a.level!=="error")return;let{message:t,params:e}=a,r=[],i=[],n=t;e.forEach(h=>{h!=null&&(wi(h)?r:i).push(h)}),r.length&&(n+=" "+r.map(sa).join(" "));let{pathname:o,search:c}=window.location,l=`${oe.delimiter}page=${o}${c}`;l.length>ca&&(l=`${l.slice(0,ca)}`),n+=l,i.length&&(n+=`${oe.delimiter}facts=`,n+=JSON.stringify(i,Ei)),window.lana?.log(n,oe)}};function la(a){Object.assign(oe,Object.fromEntries(Object.entries(a).filter(([t,e])=>t in oe&&e!==""&&e!==null&&e!==void 0&&!Number.isNaN(e))))}var da={LOCAL:"local",PROD:"prod",STAGE:"stage"},Ht={DEBUG:"debug",ERROR:"error",INFO:"info",WARN:"warn"},Ut=new Set,jt=new Set,ha=new Map,pa={append({level:a,message:t,params:e,timestamp:r,source:i}){console[a](`${r}ms [${i}] %c${t}`,"font-weight: bold;",...e)}},ma={filter:({level:a})=>a!==Ht.DEBUG},ki={filter:()=>!1};function Si(a,t,e,r,i){return{level:a,message:t,namespace:e,get params(){return r.length===1&&yt(r[0])&&(r=r[0](),Array.isArray(r)||(r=[r])),r},source:i,timestamp:performance.now().toFixed(3)}}function Ci(a){[...jt].every(t=>t(a))&&Ut.forEach(t=>t(a))}function ga(a){let t=(ha.get(a)??0)+1;ha.set(a,t);let e=`${a} #${t}`,r={id:e,namespace:a,module:i=>ga(`${r.namespace}/${i}`),updateConfig:la};return Object.values(Ht).forEach(i=>{r[i]=(n,...o)=>Ci(Si(i,n,a,o,e))}),Object.seal(r)}function wt(...a){a.forEach(t=>{let{append:e,filter:r}=t;yt(r)&&jt.add(r),yt(e)&&Ut.add(e)})}function Ai(a={}){let{name:t}=a,e=oa(bt("commerce.debug",{search:!0,storage:!0}),t===da.LOCAL);return wt(e?pa:ma),t===da.PROD&&wt(qt),Ke}function Ti(){Ut.clear(),jt.clear()}var Ke={...ga(yr),Level:Ht,Plugins:{consoleAppender:pa,debugFilter:ma,quietFilter:ki,lanaAppender:qt},init:Ai,reset:Ti,use:wt};var Li="mas-commerce-service",qs=Ke.module("utilities"),zi={requestId:ct,etag:"Etag",lastModified:"Last-Modified",serverTiming:"server-timing"};var Et=a=>window.setTimeout(a);function Gt(){return document.getElementsByTagName(Li)?.[0]}function ua(a){let t={};if(!a?.headers)return t;let e=a.headers;for(let[r,i]of Object.entries(zi)){let n=e.get(i);n&&(n=n.replace(/[,;]/g,"|"),n=n.replace(/[| ]+/g,"|"),t[r]=n)}return t}async function fa(a,t={},e=2,r=100){let i;for(let n=0;n<=e;n++)try{let o=await fetch(a,t);return o.retryCount=n,o}catch(o){if(i=o,i.retryCount=n,n>e)break;await new Promise(c=>setTimeout(c,r*(n+1)))}throw i}var va="fragment",xa="author",ba="preview",ya="loading",wa="timeout",Vt="aem-fragment",Ea="eager",ka="cache",Pi=[Ea,ka],q,ce,F,Wt=class{constructor(){g(this,q,new Map);g(this,ce,new Map);g(this,F,new Map)}clear(){s(this,q).clear(),s(this,ce).clear(),s(this,F).clear()}add(t,e=!0){if(!this.has(t.id)&&!this.has(t.fields?.originalId)){if(s(this,q).set(t.id,t),t.fields?.originalId&&s(this,q).set(t.fields.originalId,t),s(this,F).has(t.id)){let[,r]=s(this,F).get(t.id);r()}if(s(this,F).has(t.fields?.originalId)){let[,r]=s(this,F).get(t.fields?.originalId);r()}if(!(!e||typeof t.references!="object"||Array.isArray(t.references)))for(let r in t.references){let{type:i,value:n}=t.references[r];i==="content-fragment"&&(n.settings={...t?.settings,...n.settings},n.placeholders={...t?.placeholders,...n.placeholders},n.dictionary={...t?.dictionary,...n.dictionary},n.priceLiterals={...t?.priceLiterals,...n.priceLiterals},this.add(n,t))}}}has(t){return s(this,q).has(t)}entries(){return s(this,q).entries()}get(t){return s(this,q).get(t)}getAsPromise(t){let[e]=s(this,F).get(t)??[];if(e)return e;let r;return e=new Promise(i=>{r=i,this.has(t)&&i()}),s(this,F).set(t,[e,r]),e}getFetchInfo(t){let e=s(this,ce).get(t);return e||(e={url:null,retryCount:0,stale:!1,measure:null,status:null},s(this,ce).set(t,e)),e}remove(t){s(this,q).delete(t),s(this,ce).delete(t),s(this,F).delete(t)}};q=new WeakMap,ce=new WeakMap,F=new WeakMap;var J=new Wt,Me,I,G,O,M,S,Ye,Qe,$,Xe,Ze,Re,B,Sa,Ca,Kt,Aa,kt=class extends HTMLElement{constructor(){super(...arguments);g(this,B);d(this,"cache",J);g(this,Me);g(this,I,null);g(this,G,null);g(this,O,null);g(this,M);g(this,S);g(this,Ye,Ea);g(this,Qe,5e3);g(this,$);g(this,Xe,!1);g(this,Ze,0);g(this,Re)}static get observedAttributes(){return[va,ya,wa,xa,ba]}attributeChangedCallback(e,r,i){e===va&&(m(this,M,i),m(this,S,J.getFetchInfo(i))),e===ya&&Pi.includes(i)&&m(this,Ye,i),e===wa&&m(this,Qe,parseInt(i,10)),e===xa&&m(this,Xe,["","true"].includes(i)),e===ba&&m(this,Re,i)}connectedCallback(){if(!s(this,$)){if(s(this,O)??m(this,O,ae(this)),m(this,Re,s(this,O).settings?.preview),s(this,Me)??m(this,Me,s(this,O).log.module(`${Vt}[${s(this,M)}]`)),!s(this,M)||s(this,M)==="#"){s(this,S)??m(this,S,J.getFetchInfo("missing-fragment-id")),z(this,B,Kt).call(this,"Missing fragment id");return}this.refresh(!1)}}get fetchInfo(){return Object.fromEntries(Object.entries(s(this,S)).filter(([e,r])=>r!=null).map(([e,r])=>[`aem-fragment:${e}`,r]))}async refresh(e=!0){if(s(this,$)&&!await Promise.race([s(this,$),Promise.resolve(!1)]))return;e&&J.remove(s(this,M)),s(this,Ye)===ka&&await Promise.race([J.getAsPromise(s(this,M)),new Promise(c=>setTimeout(c,s(this,Qe)))]);try{m(this,$,z(this,B,Aa).call(this)),await s(this,$)}catch(c){return z(this,B,Kt).call(this,c.message),!1}let{references:r,referencesTree:i,placeholders:n,wcs:o}=s(this,I)||{};return o&&!bt("mas.disableWcsCache")&&s(this,O).prefillWcsCache(o),this.dispatchEvent(new CustomEvent(ue,{detail:{...this.data,references:r,referencesTree:i,placeholders:n,...s(this,S)},bubbles:!0,composed:!0})),s(this,$)}get updateComplete(){return s(this,$)??Promise.reject(new Error("AEM fragment cannot be loaded"))}get data(){return s(this,G)?s(this,G):(s(this,Xe)?this.transformAuthorData():this.transformPublishData(),s(this,G))}get rawData(){return s(this,I)}transformAuthorData(){let{fields:e,id:r,tags:i,variationId:n,settings:o={},priceLiterals:c={},dictionary:l={},placeholders:h={}}=s(this,I);m(this,G,e.reduce((p,{name:x,multiple:L,values:U})=>(p.fields[x]=L?U:U[0],p),{fields:{},id:r,tags:i,settings:o,priceLiterals:c,dictionary:l,placeholders:h,variationId:n}))}transformPublishData(){let{fields:e,id:r,tags:i,settings:n={},priceLiterals:o={},dictionary:c={},placeholders:l={},variationId:h}=s(this,I);m(this,G,Object.entries(e).reduce((p,[x,L])=>(p.fields[x]=L?.mimeType?L.value:L??"",p),{fields:{},id:r,tags:i,settings:n,priceLiterals:o,dictionary:c,placeholders:l,variationId:h}))}getFragmentClientUrl(){let r=new URLSearchParams(window.location.search).get("maslibs");if(!r||r.trim()==="")return"https://mas.adobe.com/studio/libs/fragment-client.js";let i=r.trim().toLowerCase();if(i==="local")return"http://localhost:3000/studio/libs/fragment-client.js";let{hostname:n}=window.location,o=n.endsWith(".page")?"page":"live";return i.includes("--")?`https://${i}.aem.${o}/studio/libs/fragment-client.js`:`https://${i}--mas--adobecom.aem.${o}/studio/libs/fragment-client.js`}async generatePreview(){let e=this.getFragmentClientUrl(),{previewFragment:r}=await import(e);return await r(s(this,M),{locale:s(this,O).settings.locale,apiKey:s(this,O).settings.wcsApiKey,fullContext:!0})}};Me=new WeakMap,I=new WeakMap,G=new WeakMap,O=new WeakMap,M=new WeakMap,S=new WeakMap,Ye=new WeakMap,Qe=new WeakMap,$=new WeakMap,Xe=new WeakMap,Ze=new WeakMap,Re=new WeakMap,B=new WeakSet,Sa=async function(e){ir(this,Ze)._++;let r=`${Vt}:${s(this,M)}:${s(this,Ze)}`,i=`${r}${st}`,n=`${r}${lt}`;if(s(this,Re)){let c=await this.generatePreview();if(c.status===200)return c.body;throw new Z(`Failed to generate preview: ${c.message}`,{})}performance.mark(i);let o;try{if(s(this,S).stale=!1,s(this,S).url=e,o=await fa(e,{cache:"default",credentials:"omit"}),z(this,B,Ca).call(this,o),s(this,S).status=o?.status,s(this,S).measure=ve(performance.measure(n,i)),s(this,S).retryCount=o.retryCount,!o?.ok)throw new Z("Unexpected fragment response",{response:o,...s(this,O).duration});return await o.json()}catch(c){if(s(this,S).measure=ve(performance.measure(n,i)),s(this,S).retryCount=c.retryCount,s(this,I))return s(this,S).stale=!0,s(this,Me).error("Serving stale data",s(this,S)),s(this,I);let l=c.message??"unknown";throw new Z(`Failed to fetch fragment: ${l}`,{})}},Ca=function(e){Object.assign(s(this,S),ua(e))},Kt=function(e){m(this,$,null),s(this,S).message=e,this.classList.add("error");let r={...s(this,S),...s(this,O).duration};s(this,Me).error(e,r),this.dispatchEvent(new CustomEvent(fe,{detail:r,bubbles:!0,composed:!0}))},Aa=async function(){var l;this.classList.remove("error"),m(this,G,null);let e=J.get(s(this,M));if(e)return m(this,I,e),!0;let{masIOUrl:r,wcsApiKey:i,country:n,locale:o}=s(this,O).settings,c=`${r}/fragment?id=${s(this,M)}&api_key=${i}&locale=${o}`;return n&&!o.endsWith(`_${n}`)&&(c+=`&country=${n}`),e=await z(this,B,Sa).call(this,c),(l=e.fields).originalId??(l.originalId=s(this,M)),J.add(e),m(this,I,e),!0},d(kt,"cache",J);customElements.define(Vt,kt);import{LitElement as _i,html as Yt,css as Mi,nothing as Ri}from"./lit-all.min.js";import{unsafeHTML as Ni}from"./lit-all.min.js";var Oi=a=>a?a.startsWith("sp-icon-")?Yt`${Ni(`<${a} class="badge-icon">`)}`:Yt``:Ri,Ne=class extends _i{constructor(){super(),this.color="",this.variant="",this.backgroundColor="",this.borderColor="",this.text=this.textContent,this.icon=""}connectedCallback(){this.borderColor&&this.borderColor!=="transparent"?this.style.setProperty("--merch-badge-border",`1px solid var(--${this.borderColor})`):this.backgroundColor.startsWith("gradient-")||this.style.setProperty("--merch-badge-border",`1px solid var(--${this.backgroundColor})`),this.style.setProperty("--merch-badge-background-color",`var(--${this.backgroundColor})`),(!this.borderColor||this.borderColor==="transparent")&&this.backgroundColor.startsWith("gradient-")?this.style.setProperty("--merch-badge-padding","3px 11px 4px 11px"):this.style.setProperty("--merch-badge-padding","2px 10px 3px 10px"),this.style.setProperty("--merch-badge-color",this.color),this.style.setProperty("--merch-badge-font-size","var(--consonant-merch-card-body-xs-font-size)"),this.querySelector('span[is="inline-price"]')||(this.textContent="");let t=this.closest("merch-card"),e=t?.getAttribute("size"),r=t?.querySelectorAll(":scope > merch-icon").length||0;this.style.setProperty("--merch-badge-offset",r),this.style.setProperty("--merch-badge-with-offset",r?1:0),this.style.setProperty("--merch-badge-card-size",e?2:1),super.connectedCallback()}render(){return Yt`
+Caused by: ${this.cause}`),e}};var oe={clientId:"merch-at-scale",delimiter:"\xB6",ignoredProperties:["analytics","literals","element"],serializableTypes:["Array","Object"],sampleRate:1,severity:"e",tags:"acom",isProdDomain:!1},ca=1e3;function wi(a){return a instanceof Error||typeof a?.originatingRequest=="string"}function sa(a){if(a==null)return;let t=typeof a;if(t==="function")return a.name?`function ${a.name}`:"function";if(t==="object"){if(a instanceof Error)return a.message;if(typeof a.originatingRequest=="string"){let{message:r,originatingRequest:i,status:n}=a;return[r,n,i].filter(Boolean).join(" ")}let e=a[Symbol.toStringTag]??Object.getPrototypeOf(a).constructor.name;if(!oe.serializableTypes.includes(e))return e}return a}function Ei(a,t){if(!oe.ignoredProperties.includes(a))return sa(t)}var qt={append(a){if(a.level!=="error")return;let{message:t,params:e}=a,r=[],i=[],n=t;e.forEach(h=>{h!=null&&(wi(h)?r:i).push(h)}),r.length&&(n+=" "+r.map(sa).join(" "));let{pathname:o,search:c}=window.location,l=`${oe.delimiter}page=${o}${c}`;l.length>ca&&(l=`${l.slice(0,ca)}`),n+=l,i.length&&(n+=`${oe.delimiter}facts=`,n+=JSON.stringify(i,Ei)),window.lana?.log(n,oe)}};function la(a){Object.assign(oe,Object.fromEntries(Object.entries(a).filter(([t,e])=>t in oe&&e!==""&&e!==null&&e!==void 0&&!Number.isNaN(e))))}var da={LOCAL:"local",PROD:"prod",STAGE:"stage"},Ht={DEBUG:"debug",ERROR:"error",INFO:"info",WARN:"warn"},Ut=new Set,jt=new Set,ha=new Map,pa={append({level:a,message:t,params:e,timestamp:r,source:i}){console[a](`${r}ms [${i}] %c${t}`,"font-weight: bold;",...e)}},ma={filter:({level:a})=>a!==Ht.DEBUG},ki={filter:()=>!1};function Si(a,t,e,r,i){return{level:a,message:t,namespace:e,get params(){return r.length===1&&yt(r[0])&&(r=r[0](),Array.isArray(r)||(r=[r])),r},source:i,timestamp:performance.now().toFixed(3)}}function Ci(a){[...jt].every(t=>t(a))&&Ut.forEach(t=>t(a))}function ga(a){let t=(ha.get(a)??0)+1;ha.set(a,t);let e=`${a} #${t}`,r={id:e,namespace:a,module:i=>ga(`${r.namespace}/${i}`),updateConfig:la};return Object.values(Ht).forEach(i=>{r[i]=(n,...o)=>Ci(Si(i,n,a,o,e))}),Object.seal(r)}function wt(...a){a.forEach(t=>{let{append:e,filter:r}=t;yt(r)&&jt.add(r),yt(e)&&Ut.add(e)})}function Ai(a={}){let{name:t}=a,e=oa(bt("commerce.debug",{search:!0,storage:!0}),t===da.LOCAL);return wt(e?pa:ma),t===da.PROD&&wt(qt),Ke}function Ti(){Ut.clear(),jt.clear()}var Ke={...ga(yr),Level:Ht,Plugins:{consoleAppender:pa,debugFilter:ma,quietFilter:ki,lanaAppender:qt},init:Ai,reset:Ti,use:wt};var Li="mas-commerce-service",Hs=Ke.module("utilities"),zi={requestId:ct,etag:"Etag",lastModified:"Last-Modified",serverTiming:"server-timing"};var Et=a=>window.setTimeout(a);function Gt(){return document.getElementsByTagName(Li)?.[0]}function ua(a){let t={};if(!a?.headers)return t;let e=a.headers;for(let[r,i]of Object.entries(zi)){let n=e.get(i);n&&(n=n.replace(/[,;]/g,"|"),n=n.replace(/[| ]+/g,"|"),t[r]=n)}return t}async function fa(a,t={},e=2,r=100){let i;for(let n=0;n<=e;n++)try{let o=await fetch(a,t);return o.retryCount=n,o}catch(o){if(i=o,i.retryCount=n,n>e)break;await new Promise(c=>setTimeout(c,r*(n+1)))}throw i}var va="fragment",xa="author",ba="preview",ya="loading",wa="timeout",Vt="aem-fragment",Ea="eager",ka="cache",Pi=[Ea,ka],q,ce,F,Wt=class{constructor(){g(this,q,new Map);g(this,ce,new Map);g(this,F,new Map)}clear(){s(this,q).clear(),s(this,ce).clear(),s(this,F).clear()}add(t,e=!0){if(!this.has(t.id)&&!this.has(t.fields?.originalId)){if(s(this,q).set(t.id,t),t.fields?.originalId&&s(this,q).set(t.fields.originalId,t),s(this,F).has(t.id)){let[,r]=s(this,F).get(t.id);r()}if(s(this,F).has(t.fields?.originalId)){let[,r]=s(this,F).get(t.fields?.originalId);r()}if(!(!e||typeof t.references!="object"||Array.isArray(t.references)))for(let r in t.references){let{type:i,value:n}=t.references[r];i==="content-fragment"&&(n.settings={...t?.settings,...n.settings},n.placeholders={...t?.placeholders,...n.placeholders},n.dictionary={...t?.dictionary,...n.dictionary},n.priceLiterals={...t?.priceLiterals,...n.priceLiterals},this.add(n,t))}}}has(t){return s(this,q).has(t)}entries(){return s(this,q).entries()}get(t){return s(this,q).get(t)}getAsPromise(t){let[e]=s(this,F).get(t)??[];if(e)return e;let r;return e=new Promise(i=>{r=i,this.has(t)&&i()}),s(this,F).set(t,[e,r]),e}getFetchInfo(t){let e=s(this,ce).get(t);return e||(e={url:null,retryCount:0,stale:!1,measure:null,status:null},s(this,ce).set(t,e)),e}remove(t){s(this,q).delete(t),s(this,ce).delete(t),s(this,F).delete(t)}};q=new WeakMap,ce=new WeakMap,F=new WeakMap;var J=new Wt,Me,I,G,O,M,S,Ye,Qe,$,Xe,Ze,Re,B,Sa,Ca,Kt,Aa,kt=class extends HTMLElement{constructor(){super(...arguments);g(this,B);d(this,"cache",J);g(this,Me);g(this,I,null);g(this,G,null);g(this,O,null);g(this,M);g(this,S);g(this,Ye,Ea);g(this,Qe,5e3);g(this,$);g(this,Xe,!1);g(this,Ze,0);g(this,Re)}static get observedAttributes(){return[va,ya,wa,xa,ba]}attributeChangedCallback(e,r,i){e===va&&(m(this,M,i),m(this,S,J.getFetchInfo(i))),e===ya&&Pi.includes(i)&&m(this,Ye,i),e===wa&&m(this,Qe,parseInt(i,10)),e===xa&&m(this,Xe,["","true"].includes(i)),e===ba&&m(this,Re,i)}connectedCallback(){if(!s(this,$)){if(s(this,O)??m(this,O,ae(this)),m(this,Re,s(this,O).settings?.preview),s(this,Me)??m(this,Me,s(this,O).log.module(`${Vt}[${s(this,M)}]`)),!s(this,M)||s(this,M)==="#"){s(this,S)??m(this,S,J.getFetchInfo("missing-fragment-id")),z(this,B,Kt).call(this,"Missing fragment id");return}this.refresh(!1)}}get fetchInfo(){return Object.fromEntries(Object.entries(s(this,S)).filter(([e,r])=>r!=null).map(([e,r])=>[`aem-fragment:${e}`,r]))}async refresh(e=!0){if(s(this,$)&&!await Promise.race([s(this,$),Promise.resolve(!1)]))return;e&&J.remove(s(this,M)),s(this,Ye)===ka&&await Promise.race([J.getAsPromise(s(this,M)),new Promise(c=>setTimeout(c,s(this,Qe)))]);try{m(this,$,z(this,B,Aa).call(this)),await s(this,$)}catch(c){return z(this,B,Kt).call(this,c.message),!1}let{references:r,referencesTree:i,placeholders:n,wcs:o}=s(this,I)||{};return o&&!bt("mas.disableWcsCache")&&s(this,O).prefillWcsCache(o),this.dispatchEvent(new CustomEvent(ue,{detail:{...this.data,references:r,referencesTree:i,placeholders:n,...s(this,S)},bubbles:!0,composed:!0})),s(this,$)}get updateComplete(){return s(this,$)??Promise.reject(new Error("AEM fragment cannot be loaded"))}get data(){return s(this,G)?s(this,G):(s(this,Xe)?this.transformAuthorData():this.transformPublishData(),s(this,G))}get rawData(){return s(this,I)}transformAuthorData(){let{fields:e,id:r,tags:i,variationId:n,settings:o={},priceLiterals:c={},dictionary:l={},placeholders:h={}}=s(this,I);m(this,G,e.reduce((p,{name:x,multiple:L,values:U})=>(p.fields[x]=L?U:U[0],p),{fields:{},id:r,tags:i,settings:o,priceLiterals:c,dictionary:l,placeholders:h,variationId:n}))}transformPublishData(){let{fields:e,id:r,tags:i,settings:n={},priceLiterals:o={},dictionary:c={},placeholders:l={},variationId:h}=s(this,I);m(this,G,Object.entries(e).reduce((p,[x,L])=>(p.fields[x]=L?.mimeType?L.value:L??"",p),{fields:{},id:r,tags:i,settings:n,priceLiterals:o,dictionary:c,placeholders:l,variationId:h}))}getFragmentClientUrl(){let r=new URLSearchParams(window.location.search).get("maslibs");if(!r||r.trim()==="")return"https://mas.adobe.com/studio/libs/fragment-client.js";let i=r.trim().toLowerCase();if(i==="local")return"http://localhost:3000/studio/libs/fragment-client.js";let{hostname:n}=window.location,o=n.endsWith(".page")?"page":"live";return i.includes("--")?`https://${i}.aem.${o}/studio/libs/fragment-client.js`:`https://${i}--mas--adobecom.aem.${o}/studio/libs/fragment-client.js`}async generatePreview(){let e=this.getFragmentClientUrl(),{previewFragment:r}=await import(e);return await r(s(this,M),{locale:s(this,O).settings.locale,apiKey:s(this,O).settings.wcsApiKey,fullContext:!0})}};Me=new WeakMap,I=new WeakMap,G=new WeakMap,O=new WeakMap,M=new WeakMap,S=new WeakMap,Ye=new WeakMap,Qe=new WeakMap,$=new WeakMap,Xe=new WeakMap,Ze=new WeakMap,Re=new WeakMap,B=new WeakSet,Sa=async function(e){ir(this,Ze)._++;let r=`${Vt}:${s(this,M)}:${s(this,Ze)}`,i=`${r}${st}`,n=`${r}${lt}`;if(s(this,Re)){let c=await this.generatePreview();if(c.status===200)return c.body;throw new Z(`Failed to generate preview: ${c.message}`,{})}performance.mark(i);let o;try{if(s(this,S).stale=!1,s(this,S).url=e,o=await fa(e,{cache:"default",credentials:"omit"}),z(this,B,Ca).call(this,o),s(this,S).status=o?.status,s(this,S).measure=ve(performance.measure(n,i)),s(this,S).retryCount=o.retryCount,!o?.ok)throw new Z("Unexpected fragment response",{response:o,...s(this,O).duration});return await o.json()}catch(c){if(s(this,S).measure=ve(performance.measure(n,i)),s(this,S).retryCount=c.retryCount,s(this,I))return s(this,S).stale=!0,s(this,Me).error("Serving stale data",s(this,S)),s(this,I);let l=c.message??"unknown";throw new Z(`Failed to fetch fragment: ${l}`,{})}},Ca=function(e){Object.assign(s(this,S),ua(e))},Kt=function(e){m(this,$,null),s(this,S).message=e,this.classList.add("error");let r={...s(this,S),...s(this,O).duration};s(this,Me).error(e,r),this.dispatchEvent(new CustomEvent(fe,{detail:r,bubbles:!0,composed:!0}))},Aa=async function(){var l;this.classList.remove("error"),m(this,G,null);let e=J.get(s(this,M));if(e)return m(this,I,e),!0;let{masIOUrl:r,wcsApiKey:i,country:n,locale:o}=s(this,O).settings,c=`${r}/fragment?id=${s(this,M)}&api_key=${i}&locale=${o}`;return n&&!o.endsWith(`_${n}`)&&(c+=`&country=${n}`),e=await z(this,B,Sa).call(this,c),(l=e.fields).originalId??(l.originalId=s(this,M)),J.add(e),m(this,I,e),!0},d(kt,"cache",J);customElements.define(Vt,kt);import{LitElement as _i,html as Yt,css as Mi,nothing as Ri}from"./lit-all.min.js";import{unsafeHTML as Ni}from"./lit-all.min.js";var Oi=a=>a?a.startsWith("sp-icon-")?Yt`${Ni(`<${a} class="badge-icon">`)}`:Yt``:Ri,Ne=class extends _i{constructor(){super(),this.color="",this.variant="",this.backgroundColor="",this.borderColor="",this.text=this.textContent,this.icon=""}connectedCallback(){this.borderColor&&this.borderColor!=="transparent"?this.style.setProperty("--merch-badge-border",`1px solid var(--${this.borderColor})`):this.backgroundColor.startsWith("gradient-")||this.style.setProperty("--merch-badge-border",`1px solid var(--${this.backgroundColor})`),this.style.setProperty("--merch-badge-background-color",`var(--${this.backgroundColor})`),(!this.borderColor||this.borderColor==="transparent")&&this.backgroundColor.startsWith("gradient-")?this.style.setProperty("--merch-badge-padding","3px 11px 4px 11px"):this.style.setProperty("--merch-badge-padding","2px 10px 3px 10px"),this.style.setProperty("--merch-badge-color",this.color),this.style.setProperty("--merch-badge-font-size","var(--consonant-merch-card-body-xs-font-size)"),this.querySelector('span[is="inline-price"]')||(this.textContent="");let t=this.closest("merch-card"),e=t?.getAttribute("size"),r=t?.querySelectorAll(":scope > merch-icon").length||0;this.style.setProperty("--merch-badge-offset",r),this.style.setProperty("--merch-badge-with-offset",r?1:0),this.style.setProperty("--merch-badge-card-size",e?2:1),super.connectedCallback()}render(){return Yt`
${Oi(this.icon)}${this.text}
`}};d(Ne,"properties",{color:{type:String},variant:{type:String},backgroundColor:{type:String,attribute:"background-color"},borderColor:{type:String,attribute:"border-color"},icon:{type:String}}),d(Ne,"styles",Mi` :host { @@ -8354,4 +8354,4 @@ Caused by: ${this.cause}`),e}};var oe={clientId:"merch-at-scale",delimiter:"\xB6 text-decoration: underline; color: var(--link-color-dark); } - `),d(et,"properties",{heading:{type:String,attribute:!0},mobileRows:{type:Number,attribute:!0}});customElements.define("merch-whats-included",et);var qi={[K]:fr,[re]:vr,[Y]:xr},Hi={[K]:br,[Y]:Be},tt,St=class{constructor(t){g(this,tt);d(this,"changes",new Map);d(this,"connected",!1);d(this,"error");d(this,"log");d(this,"options");d(this,"promises",[]);d(this,"state",re);d(this,"timer",null);d(this,"value");d(this,"version",0);d(this,"wrapperElement");this.wrapperElement=t,this.log=Ke.module("mas-element")}update(){[K,re,Y].forEach(t=>{this.wrapperElement.classList.toggle(qi[t],t===this.state)})}notify(){(this.state===Y||this.state===K)&&(this.state===Y?this.promises.forEach(({resolve:e})=>e(this.wrapperElement)):this.state===K&&this.promises.forEach(({reject:e})=>e(this.error)),this.promises=[]);let t=this.error;this.error instanceof Z&&(t={message:this.error.message,...this.error.context}),this.wrapperElement.dispatchEvent(new CustomEvent(Hi[this.state],{bubbles:!0,composed:!0,detail:t}))}attributeChangedCallback(t,e,r){this.changes.set(t,r),this.requestUpdate()}connectedCallback(){m(this,tt,Gt()),this.requestUpdate(!0)}disconnectedCallback(){this.connected&&(this.connected=!1,this.log?.debug("Disconnected:",{element:this.wrapperElement}))}onceSettled(){let{error:t,promises:e,state:r}=this;return Y===r?Promise.resolve(this.wrapperElement):K===r?Promise.reject(t):new Promise((i,n)=>{e.push({resolve:i,reject:n})})}toggleResolved(t,e,r){return t!==this.version?!1:(r!==void 0&&(this.options=r),this.state=Y,this.value=e,this.update(),this.log?.debug("Resolved:",{element:this.wrapperElement,value:e}),Et(()=>this.notify()),!0)}toggleFailed(t,e,r){if(t!==this.version)return!1;r!==void 0&&(this.options=r),this.error=e,this.state=K,this.update();let i=this.wrapperElement.getAttribute("is");return this.log?.error(`${i}: Failed to render: ${e.message}`,{element:this.wrapperElement,...e.context,...s(this,tt)?.duration}),Et(()=>this.notify()),!0}togglePending(t){return this.version++,t&&(this.options=t),this.state=re,this.update(),this.log?.debug("Pending:",{osi:this.wrapperElement?.options?.wcsOsi}),this.version}requestUpdate(t=!1){if(!this.wrapperElement.isConnected||!Gt()||this.timer)return;let{error:e,options:r,state:i,value:n,version:o}=this;this.state=re,this.timer=Et(async()=>{this.timer=null;let c=null;if(this.changes.size&&(c=Object.fromEntries(this.changes.entries()),this.changes.clear()),this.connected?this.log?.debug("Updated:",{element:this.wrapperElement,changes:c}):(this.connected=!0,this.log?.debug("Connected:",{element:this.wrapperElement,changes:c})),c||t)try{await this.wrapperElement.render?.()===!1&&this.state===re&&this.version===o&&(this.state=i,this.error=e,this.value=n,this.update(),this.notify())}catch(l){this.toggleFailed(this.version,l,r)}})}};tt=new WeakMap;function Ui(a){return`https://${a==="PRODUCTION"?"www.adobe.com":"www.stage.adobe.com"}/offers/promo-terms.html`}var le,se=class se extends HTMLAnchorElement{constructor(){super();d(this,"masElement",new St(this));g(this,le);this.setAttribute("is",se.is)}get isUptLink(){return!0}initializeWcsData(e,r){this.setAttribute("data-wcs-osi",e),r&&this.setAttribute("data-promotion-code",r)}attributeChangedCallback(e,r,i){this.masElement.attributeChangedCallback(e,r,i)}connectedCallback(){this.masElement.connectedCallback(),m(this,le,ae()),s(this,le)&&(this.log=s(this,le).log.module("upt-link"))}disconnectedCallback(){this.masElement.disconnectedCallback(),m(this,le,void 0)}requestUpdate(e=!1){this.masElement.requestUpdate(e)}onceSettled(){return this.masElement.onceSettled()}async render(){let e=ae();if(!e)return!1;this.dataset.imsCountry||e.imsCountryPromise.then(o=>{o&&(this.dataset.imsCountry=o)});let r=e.collectCheckoutOptions({},this);if(!r.wcsOsi)return this.log.error("Missing 'data-wcs-osi' attribute on upt-link."),!1;let i=this.masElement.togglePending(r),n=e.resolveOfferSelectors(r);try{let[[o]]=await Promise.all(n),{country:c,language:l,env:h}=r,p=`locale=${l}_${c}&country=${c}&offer_id=${o.offerId}`,x=this.getAttribute("data-promotion-code");x&&(p+=`&promotion_code=${encodeURIComponent(x)}`),this.href=`${Ui(h)}?${p}`,this.masElement.toggleResolved(i,o,r)}catch(o){let c=new Error(`Could not resolve offer selectors for id: ${r.wcsOsi}.`,o.message);return this.masElement.toggleFailed(i,c,r),!1}}static createFrom(e){let r=new se;for(let i of e.attributes)i.name!=="is"&&(i.name==="class"&&i.value.includes("upt-link")?r.setAttribute("class",i.value.replace("upt-link","").trim()):r.setAttribute(i.name,i.value));return r.innerHTML=e.innerHTML,r.setAttribute("tabindex",0),r}};le=new WeakMap,d(se,"is","upt-link"),d(se,"tag","a"),d(se,"observedAttributes",["data-wcs-osi","data-promotion-code","data-ims-country"]);var ee=se;window.customElements.get(ee.is)||window.customElements.define(ee.is,ee,{extends:ee.tag});var ji="#000000",Xt="#F8D904",Gi="#EAEAEA",Vi="#31A547",Wi=/(accent|primary|secondary)(-(outline|link))?/,Ki="mas:product_code/",Yi="daa-ll",Ct="daa-lh",Qi=["XL","L","M","S"],Zt="...";function D(a,t,e,r){let i=r[a];if(t[a]&&i){let n={slot:i?.slot,...i?.attributes},o=t[a];if(i.maxCount&&typeof o=="string"){let[l,h]=gn(o,i.maxCount,i.withSuffix);l!==o&&(n.title=h,o=l)}let c=T(i.tag,n,o);e.append(c)}}function Xi(a,t,e){let i=(a.mnemonicIcon||[]).filter(o=>o).map((o,c)=>({icon:o,alt:a.mnemonicAlt?.[c]??"",link:a.mnemonicLink?.[c]??""}));i?.forEach(({icon:o,alt:c,link:l})=>{if(l&&!/^https?:/.test(l))try{l=new URL(`https://${l}`).href.toString()}catch{l="#"}let h={slot:"icons",src:o,loading:t.loading,size:e?.size??"l"};c&&(h.alt=c),l&&(h.href=l);let p=T("merch-icon",h);t.append(p)});let n=t.shadowRoot.querySelector('slot[name="icons"]');n&&(n.style.display=i?.length?null:"none")}function Zi(a,t,e){if(e.badge?.slot){if(a.badge?.length&&!a.badge?.startsWith("${a.badge}`}D("badge",a,t,e)}else a.badge?(t.setAttribute("badge-text",a.badge),e.disabledAttributes?.includes("badgeColor")||t.setAttribute("badge-color",a.badgeColor||ji),e.disabledAttributes?.includes("badgeBackgroundColor")||t.setAttribute("badge-background-color",a.badgeBackgroundColor||Xt),t.setAttribute("border-color",a.badgeBackgroundColor||Xt)):t.setAttribute("border-color",a.borderColor||Gi)}function Ji(a,t,e){if(e.trialBadge&&a.trialBadge){if(!a.trialBadge.startsWith("${a.trialBadge}`}D("trialBadge",a,t,e)}}function en(a,t,e){e?.includes(a.size)&&t.setAttribute("size",a.size)}function tn(a,t){a.cardName&&t.setAttribute("name",a.cardName)}function rn(a,t,e){a.cardTitle&&(a.cardTitle=Oe(a.cardTitle)),D("cardTitle",a,t,{cardTitle:e})}function an(a,t,e){D("subtitle",a,t,e)}function nn(a,t,e,r){if(!a.backgroundColor||a.backgroundColor.toLowerCase()==="default"){t.style.removeProperty("--merch-card-custom-background-color"),t.removeAttribute("background-color");return}e?.[a.backgroundColor]?(t.style.setProperty("--merch-card-custom-background-color",`var(${e[a.backgroundColor]})`),t.setAttribute("background-color",a.backgroundColor)):r?.attribute&&a.backgroundColor&&(t.setAttribute(r.attribute,a.backgroundColor),t.style.removeProperty("--merch-card-custom-background-color"))}function on(a,t,e){let r=e?.borderColor,i="--consonant-merch-card-border-color";if(a.borderColor?.toLowerCase()==="transparent")t.style.setProperty(i,"transparent");else if(a.borderColor&&r){let o=r?.specialValues?.[a.borderColor]?.includes("gradient")||/-gradient/.test(a.borderColor),c=/^spectrum-.*-(plans|special-offers)$/.test(a.borderColor);if(o){t.setAttribute("gradient-border","true");let l=a.borderColor;if(r?.specialValues){for(let[h,p]of Object.entries(r.specialValues))if(p===a.borderColor){l=h;break}}t.setAttribute("border-color",l),t.style.removeProperty(i)}else c?(t.setAttribute("border-color",a.borderColor),t.style.setProperty(i,`var(--${a.borderColor})`)):t.style.setProperty(i,`var(--${a.borderColor})`)}}function cn(a,t,e){if(a.backgroundImage){let r={loading:t.loading??"lazy",src:a.backgroundImage};if(a.backgroundImageAltText?r.alt=a.backgroundImageAltText:r.role="none",!e)return;if(e?.attribute){t.setAttribute(e.attribute,a.backgroundImage);return}t.append(T(e.tag,{slot:e.slot},T("img",r)))}}function Oe(a){return!a||typeof a!="string"||a.includes("(zt(),Lt)).catch(console.error),a}function sn(a,t,e){a.prices&&(a.prices=Oe(a.prices)),D("prices",a,t,e)}function za(a,t,e){let r=a.hasAttribute("data-wcs-osi")&&!!a.getAttribute("data-wcs-osi"),i=a.className||"",n=Wi.exec(i)?.[0]??"accent",o=n.includes("accent"),c=n.includes("primary"),l=n.includes("secondary"),h=n.includes("-outline"),p=n.includes("-link");a.classList.remove("accent","primary","secondary");let x;if(t.consonant)x=xn(a,o,r,p,c,l,e?.ctas?.size);else if(p)x=a;else{let L;o?L="accent":c?L="primary":l&&(L="secondary"),x=t.spectrum==="swc"?vn(a,e,h,L,r):fn(a,e,h,L,r)}return x}function ln(a,t){let{slot:e}=t?.description,r=a.querySelectorAll(`[slot="${e}"] a[data-wcs-osi]`);r.length&&r.forEach(i=>{let n=za(i,a,t);i.replaceWith(n)})}function dn(a,t,e){a.description&&(a.description=Oe(a.description)),a.promoText&&(a.promoText=Oe(a.promoText)),a.shortDescription&&(a.shortDescription=Oe(a.shortDescription)),D("promoText",a,t,e),D("description",a,t,e),D("shortDescription",a,t,e),a.shortDescription&&(t.setAttribute("action-menu","true"),a.actionMenuLabel||t.setAttribute("action-menu-label","More options")),ln(t,e),D("callout",a,t,e),D("quantitySelect",a,t,e),D("whatsIncluded",a,t,e)}function hn(a,t,e,r={}){if(!e.addon)return;let n=(a.addon??r.addon)?.replace(/[{}]/g,"");if(!n||/disabled/.test(n))return;let o=T("merch-addon",{slot:"addon"},n);[...o.querySelectorAll(b)].forEach(c=>{let l=c.parentElement;l?.nodeName==="P"&&l.setAttribute("data-plan-type","")}),t.append(o)}function pn(a,t,e){a.addonConfirmation&&D("addonConfirmation",a,t,e)}function mn(a,t,e,r){r?.secureLabel&&e?.secureLabel&&t.setAttribute("secure-label",r.secureLabel)}function gn(a,t,e=!0){try{let r=typeof a!="string"?"":a,i=La(r);if(i.length<=t)return[r,i];let n=0,o=!1,c=e?t-Zt.length<1?1:t-Zt.length:t,l=[];for(let x of r){if(n++,x==="<")if(o=!0,r[n]==="/")l.pop();else{let L="";for(let U of r.substring(n)){if(U===" "||U===">")break;L+=U}l.push(L)}if(x==="/"&&r[n]===">"&&l.pop(),x===">"){o=!1;continue}if(!o&&(c--,c===0))break}let h=r.substring(0,n).trim();if(l.length>0){l[0]==="p"&&l.shift();for(let x of l.reverse())h+=``}return[`${h}${e?Zt:""}`,i]}catch{let i=typeof a=="string"?a:"",n=La(i);return[i,n]}}function La(a){if(!a)return"";let t="",e=!1;for(let r of a){if(r==="<"&&(e=!0),r===">"){e=!1;continue}e||(t+=r)}return t}function un(a,t){t.querySelectorAll("a.upt-link").forEach(r=>{let i=ee.createFrom(r);r.replaceWith(i),i.initializeWcsData(a.osi,a.promoCode)})}function fn(a,t,e,r,i){let n=a;i?n=customElements.get("checkout-button").createCheckoutButton({},a.innerHTML):n.innerHTML=`${n.textContent}`,n.setAttribute("tabindex",0);for(let p of a.attributes)["class","is"].includes(p.name)||n.setAttribute(p.name,p.value);n.firstElementChild?.classList.add("spectrum-Button-label");let o=t?.ctas?.size??"M",c=`spectrum-Button--${r}`,l=Qi.includes(o)?`spectrum-Button--size${o}`:"spectrum-Button--sizeM",h=["spectrum-Button",c,l];return e&&h.push("spectrum-Button--outline"),n.classList.add(...h),n}function vn(a,t,e,r,i){let n=a;i&&(n=customElements.get("checkout-button").createCheckoutButton(a.dataset),n.connectedCallback(),n.render());let o="fill";e&&(o="outline");let c=T("sp-button",{treatment:o,variant:r,tabIndex:0,size:t?.ctas?.size??"m",...a.dataset.analyticsId&&{"data-analytics-id":a.dataset.analyticsId}},a.innerHTML);return c.source=n,(i?n.onceSettled():Promise.resolve(n)).then(l=>{c.setAttribute("data-navigation-url",l.href)}),c.addEventListener("click",l=>{l.defaultPrevented||n.click()}),c}function xn(a,t,e,r,i,n,o){let c=a;if(e)try{let l=customElements.get("checkout-link");l&&(c=l.createCheckoutLink(a.dataset,a.innerHTML)??a)}catch{}return r||(c.classList.add("button","con-button"),o&&o!=="m"&&c.classList.add(`button-${o}`),t&&c.classList.add("blue"),i&&c.classList.add("primary"),n&&c.classList.add("secondary")),c}function bn(a,t,e,r){if(a.ctas){a.ctas=Oe(a.ctas);let{slot:i}=e.ctas,n=T("div",{slot:i},a.ctas),o=[...n.querySelectorAll("a")].map(c=>za(c,t,e));n.innerHTML="",n.append(...o),t.append(n)}}function yn(a,t){let{tags:e}=a,r=e?.find(n=>typeof n=="string"&&n.startsWith(Ki))?.split("/").pop();if(!r)return;t.setAttribute(Ct,r),[...t.shadowRoot.querySelectorAll("a[data-analytics-id],button[data-analytics-id]"),...t.querySelectorAll("a[data-analytics-id],button[data-analytics-id]")].forEach((n,o)=>{n.setAttribute(Yi,`${n.dataset.analyticsId}-${o+1}`)})}function wn(a){a.spectrum==="css"&&[["primary-link","primary"],["secondary-link","secondary"]].forEach(([t,e])=>{a.querySelectorAll(`a.${t}`).forEach(r=>{r.classList.remove(t),r.classList.add("spectrum-Link",`spectrum-Link--${e}`)})})}function En(a){a.querySelectorAll("[slot]").forEach(r=>{r.remove()}),a.variant=void 0,["checkbox-label","stock-offer-osis","secure-label","background-image","background-color","border-color","badge-background-color","badge-color","badge-text","gradient-border","size",Ct].forEach(r=>a.removeAttribute(r));let e=["wide-strip","thin-strip"];a.classList.remove(...e)}async function Pa(a,t){if(!a){let l=t?.id||"unknown";throw console.error(`hydrate: Fragment is undefined. Cannot hydrate card (merchCard id: ${l}).`),new Error(`hydrate: Fragment is undefined for card (merchCard id: ${l}).`)}if(!a.fields){let l=a.id||"unknown",h=t?.id||"unknown";throw console.error(`hydrate: Fragment for card ID '${l}' (merchCard id: ${h}) is missing 'fields'. Cannot hydrate.`),new Error(`hydrate: Fragment for card ID '${l}' (merchCard id: ${h}) is missing 'fields'.`)}let{id:e,fields:r,settings:i={},priceLiterals:n}=a,{variant:o}=r;if(!o)throw new Error(`hydrate: no variant found in payload ${e}`);En(t),t.settings=i,n&&(t.priceLiterals=n),t.id??(t.id=a.id),a.variationId&&t.setAttribute("variation-id",a.variationId??""),t.variant=o,await t.updateComplete;let{aemFragmentMapping:c}=t.variantLayout;if(!c)throw new Error(`hydrate: variant mapping not found for ${e}`);c.style==="consonant"&&t.setAttribute("consonant",!0),Xi(r,t,c.mnemonics),Ji(r,t,c),en(r,t,c.size),tn(r,t),rn(r,t,c.title),Zi(r,t,c),an(r,t,c),sn(r,t,c),cn(r,t,c.backgroundImage),nn(r,t,c.allowedColors,c.backgroundColor),on(r,t,c),dn(r,t,c),hn(r,t,c,i),pn(r,t,c),mn(r,t,c,i);try{un(r,t)}catch{}bn(r,t,c,o),yn(r,t),wn(t)}var tr="merch-card",Jt=2e4,_a="merch-card:",Ra=["full-pricing-express","simplified-pricing-express"],Na=["segment","product"];function Ma(a,t){let e=a.closest(tr);if(!e)return t;e.priceLiterals&&(t.literals??(t.literals={}),Object.assign(t.literals,e.priceLiterals)),e.aemFragment&&(t[wr]=!0),e.variantLayout?.priceOptionsProvider?.(a,t)}function Sn(a){a.providers.has(Ma)||a.providers.price(Ma)}var rt=new IntersectionObserver(a=>{a.forEach(t=>{let e=t.target;if(Ra.includes(e.variant)){if(e.clientHeight===0)return;rt.unobserve(e),e.requestUpdate();return}if(Na.includes(e.variant)){if(t.boundingClientRect.width===0)return;if(e.variant==="product"&&e.querySelector('merch-icon[slot="icons"]')){rt.unobserve(e);return}let r=e.getBoundingClientRect().width,n=e.querySelector('[slot="badge"]')?.getBoundingClientRect().width||0;if(r===0||n===0){rt.unobserve(e);return}e.style.setProperty("--consonant-merch-card-heading-xs-max-width",`${Math.round(r-n-16)}px`),rt.unobserve(e)}})}),Cn=0,De,Fe,Ie,V,he,H,pe,E,de,at,er,At,te=class extends kn{constructor(){super();g(this,E);g(this,De);g(this,Fe);g(this,Ie);g(this,V);g(this,he);g(this,H);g(this,pe,new Promise(e=>{m(this,H,e)}));d(this,"customerSegment");d(this,"marketSegment");d(this,"variantLayout");this.id=null,this.failed=!1,this.filters={},this.types="",this.selected=!1,this.spectrum="css",this.loading="lazy",this.handleAemFragmentEvents=this.handleAemFragmentEvents.bind(this),this.handleMerchOfferSelectReady=this.handleMerchOfferSelectReady.bind(this)}firstUpdated(){this.variantLayout=$t(this),this.variantLayout?.connectedCallbackHook()}willUpdate(e){(e.has("variant")||!this.variantLayout)&&(this.variantLayout?.disconnectedCallbackHook(),this.variantLayout=$t(this),this.variantLayout?.connectedCallbackHook())}updated(e){(e.has("badgeBackgroundColor")||e.has("borderColor"))&&this.style.setProperty("--consonant-merch-card-border",this.computedBorderStyle),e.has("backgroundColor")&&this.style.setProperty("--merch-card-custom-background-color",this.backgroundColor?`var(--${this.backgroundColor})`:"");try{this.variantLayoutPromise=this.variantLayout?.postCardUpdateHook(e)}catch(r){z(this,E,de).call(this,`Error in postCardUpdateHook: ${r.message}`,{},!1)}}get theme(){return this.closest("sp-theme")}get dir(){return this.closest("[dir]")?.getAttribute("dir")??"ltr"}render(){if(!(!this.isConnected||!this.variantLayout||this.style.display==="none"))return this.variantLayout.renderLayout()}get computedBorderStyle(){return["ccd-slice","ccd-suggested","ah-promoted-plans","simplified-pricing-express","full-pricing-express"].includes(this.variant)?"":`1px solid ${this.borderColor?this.borderColor:this.badgeBackgroundColor}`}get badgeElement(){return this.shadowRoot.getElementById("badge")}get headingmMSlot(){return this.shadowRoot.querySelector('slot[name="heading-m"]').assignedElements()[0]}get footerSlot(){return this.shadowRoot.querySelector('slot[name="footer"]')?.assignedElements()[0]}get descriptionSlot(){return this.shadowRoot.querySelector('slot[name="body-xs"')?.assignedElements()[0]}get descriptionSlotCompare(){return this.shadowRoot.querySelector('slot[name="body-m"')?.assignedElements()[0]}get iconButton(){return this.querySelector('[slot="callout-content"] .icon-button')}get price(){return this.headingmMSlot?.querySelector(b)}get checkoutLinks(){return[...this.footerSlot?.querySelectorAll(W)??[]]}get checkoutLinksDescription(){return[...this.descriptionSlot?.querySelectorAll(W)??[]]}get checkoutLinkDescriptionCompare(){return[...this.descriptionSlotCompare?.querySelectorAll(W)??[]]}get activeDescriptionLinks(){return this.variant==="mini-compare-chart"||this.variant==="mini-compare-chart-mweb"?this.checkoutLinkDescriptionCompare:this.checkoutLinksDescription}async toggleStockOffer({target:e}){if(!this.stockOfferOsis)return;let r=this.checkoutLinks;if(r.length!==0)for(let i of r){await i.onceSettled();let n=i.value?.[0]?.planType;if(!n)return;let o=this.stockOfferOsis[n];if(!o)return;let c=i.dataset.wcsOsi.split(",").filter(l=>l!==o);e.checked&&c.push(o),i.dataset.wcsOsi=c.join(",")}}changeHandler(e){e.target.tagName==="MERCH-ADDON"&&this.toggleAddon(e.target)}toggleAddon(e){this.variantLayout?.toggleAddon?.(e);let r=[...this.checkoutLinks,...this.activeDescriptionLinks??[]];if(r.length===0)return;let i=n=>{let{offerType:o,planType:c}=n.value?.[0]??{};if(!o||!c)return;let l=e.getOsi(c,o),h=(n.dataset.wcsOsi||"").split(",").filter(p=>p&&p!==l);e.checked&&h.push(l),n.dataset.wcsOsi=h.join(",")};r.forEach(i)}handleQuantitySelection(e){let r=[...this.checkoutLinks,...this.activeDescriptionLinks??[]];if(r.length!==0)for(let i of r)i.dataset.quantity=e.detail.option}get titleElement(){return this.querySelector(this.variantLayout?.headingSelector||".card-heading")}get title(){return this.titleElement?.textContent?.trim()}get description(){return this.querySelector('[slot="body-xs"]')?.textContent?.trim()}updateFilters(e){let r={...this.filters};Object.keys(r).forEach(i=>{if(e){r[i].order=Math.min(r[i].order||2,2);return}let n=r[i].order;n===1||isNaN(n)||(r[i].order=Number(n)+1)}),this.filters=r}showInfoTooltip(e,r){let i="tooltip-left",n="tooltip-right";window.screen.width<600&&e.getAttribute("data-tooltip")?.length>12&&(this.iconButton.classList.remove(i),this.iconButton.classList.remove(n),e.getBoundingClientRect().x<100&&this.iconButton.classList.add(i),e.getBoundingClientRect().x>window.screen.width-100&&this.iconButton.classList.add(n)),this.iconButton.classList.add(r)}handleInfoIconEvents(){let e="tooltip-visible";this.iconButton&&(["mouseenter","focus"].forEach(r=>this.iconButton.addEventListener(r,i=>this.showInfoTooltip(i.target,e),!1)),["mouseleave","blur"].forEach(r=>this.iconButton.addEventListener(r,()=>this.iconButton.classList.remove(e),!1)),this.iconButton.addEventListener("keydown",r=>{r.key==="Escape"&&this.iconButton.classList.remove(e)}))}includes(e){return this.textContent.match(new RegExp(e,"i"))!==null}connectedCallback(){var r;super.connectedCallback(),s(this,Fe)||m(this,Fe,Cn++),this.aemFragment||((r=s(this,H))==null||r.call(this),m(this,H,void 0)),this.id??(this.id=this.getAttribute("id")??this.aemFragment?.getAttribute("fragment"));let e=this.id??s(this,Fe);m(this,he,`${_a}${e}${st}`),m(this,De,`${_a}${e}${lt}`),performance.mark(s(this,he)),m(this,V,ae()),Sn(s(this,V)),m(this,Ie,s(this,V).Log.module(tr)),this.addEventListener(R,this.handleQuantitySelection),this.addEventListener(Pt,this.handleAddonAndQuantityUpdate),this.addEventListener(pr,this.handleMerchOfferSelectReady),this.addEventListener(fe,this.handleAemFragmentEvents),this.addEventListener(ue,this.handleAemFragmentEvents),this.addEventListener(ot,this.handleInfoIconEvents),this.addEventListener("change",this.changeHandler),this.variantLayout&&this.variantLayout.connectedCallbackHook(),this.aemFragment||setTimeout(()=>this.checkReady(),0)}disconnectedCallback(){super.disconnectedCallback(),this.variantLayout?.disconnectedCallbackHook(),this.removeEventListener(R,this.handleQuantitySelection),this.removeEventListener(fe,this.handleAemFragmentEvents),this.removeEventListener(ue,this.handleAemFragmentEvents),this.removeEventListener(ot,this.handleInfoIconEvents),this.removeEventListener("change",this.changeHandler),this.removeEventListener(Pt,this.handleAddonAndQuantityUpdate)}async handleAemFragmentEvents(e){var r;if(this.isConnected&&(e.type===fe&&z(this,E,de).call(this,"AEM fragment cannot be loaded"),e.type===ue&&(this.failed=!1,e.target.nodeName==="AEM-FRAGMENT"))){let i=e.detail;try{s(this,H)||m(this,pe,new Promise(n=>{m(this,H,n)})),Pa(i,this)}catch(n){z(this,E,de).call(this,`hydration has failed: ${n.message}`)}finally{(r=s(this,H))==null||r.call(this),m(this,H,void 0)}this.checkReady()}}async checkReady(){if(!this.isConnected)return;s(this,pe)&&(await s(this,pe),(Ra.includes(this.variant)||Na.includes(this.variant))&&rt.observe(this),m(this,pe,void 0)),this.variantLayoutPromise&&(await this.variantLayoutPromise,this.variantLayoutPromise=void 0);let e=new Promise(o=>setTimeout(()=>o("timeout"),Jt));if(this.aemFragment){let o=await Promise.race([this.aemFragment.updateComplete,e]);if(o===!1||o==="timeout"){let c=o==="timeout"?`AEM fragment was not resolved within ${Jt} timeout`:"AEM fragment cannot be loaded";z(this,E,de).call(this,c,{},!1);return}}let r=[...this.querySelectorAll(hr)],i=Promise.all(r.map(o=>o.onceSettled().catch(()=>o))).then(o=>o.every(c=>c.classList.contains("placeholder-resolved"))),n=await Promise.race([i,e]);if(n===!0){this.measure=performance.measure(s(this,De),s(this,he));let o={...this.aemFragment?.fetchInfo,...s(this,V).duration,measure:ve(this.measure)};return this.dispatchEvent(new CustomEvent(ot,{bubbles:!0,composed:!0,detail:o})),this}else{this.measure=performance.measure(s(this,De),s(this,he));let o={measure:ve(this.measure),...s(this,V).duration};n==="timeout"?z(this,E,de).call(this,`Contains offers that were not resolved within ${Jt} timeout`,o):z(this,E,de).call(this,"Contains unresolved offers",o)}}get aemFragment(){return this.querySelector("aem-fragment")}get addon(){return this.querySelector("merch-addon")}get quantitySelect(){return this.querySelector("merch-quantity-select")}get addonCheckbox(){return this.querySelector("merch-addon")}displayFooterElementsInColumn(){if(!this.classList.contains("product"))return;let e=this.shadowRoot.querySelector(".secure-transaction-label");(this.footerSlot?.querySelectorAll(W)).length===2&&e&&e.parentElement.classList.add("footer-column")}handleMerchOfferSelectReady(){this.offerSelect&&!this.offerSelect.planType||this.displayFooterElementsInColumn()}get dynamicPrice(){return this.querySelector('[slot="price"]')}handleAddonAndQuantityUpdate({detail:{id:e,items:r}}){if(!e||!r?.length||this.closest('[role="tabpanel"][hidden="true"]'))return;let n=this.checkoutLinks.find(p=>p.getAttribute("data-modal-id")===e);if(!n)return;let c=new URL(n.getAttribute("href")).searchParams.get("pa"),l=r.find(p=>p.productArrangementCode===c)?.quantity,h=!!r.find(p=>p.productArrangementCode!==c);if(l&&this.quantitySelect?.dispatchEvent(new CustomEvent(gr,{detail:{quantity:l},bubbles:!0,composed:!0})),this.addonCheckbox&&this.addonCheckbox.checked!==h){this.toggleStockOffer({target:this.addonCheckbox});let p=new Event("change",{bubbles:!0,cancelable:!0});Object.defineProperty(p,"target",{writable:!1,value:{checked:h}}),this.addonCheckbox.handleChange(p)}}get prices(){return Array.from(this.querySelectorAll(b))}get promoPrice(){if(!this.querySelector("span.price-strikethrough"))return;let e=this.querySelector(".price.price-alternative");if(e||(e=this.querySelector(`${b}[data-template="price"] > span`)),!!e)return e=e.innerText,e}get regularPrice(){return s(this,E,at)?.innerText}get promotionCode(){let e=[...this.querySelectorAll(`${b}[data-promotion-code],${W}[data-promotion-code]`)].map(i=>i.dataset.promotionCode),r=[...new Set(e)];return r.length>1&&s(this,Ie)?.warn(`Multiple different promotion codes found: ${r.join(", ")}`),e[0]}get annualPrice(){return this.querySelector(`${b}[data-template="price"] > .price.price-annual`)?.innerText}get promoText(){}get taxText(){return(s(this,E,er)??s(this,E,at))?.querySelector("span.price-tax-inclusivity")?.textContent?.trim()||void 0}get recurrenceText(){return s(this,E,at)?.querySelector("span.price-recurrence")?.textContent?.trim()}get unitText(){let e=".price-unit-type";return s(this,E,er)?.querySelector(e)?.textContent?.trim()??s(this,E,at)?.querySelector(e)?.textContent?.trim()??this.querySelector(e)?.textContent?.trim()??void 0}get planTypeText(){return this.querySelector('[is="inline-price"][data-template="legal"] span.price-plan-type')?.textContent?.trim()}get seeTermsInfo(){let e=this.querySelector('a[is="upt-link"]');if(e)return z(this,E,At).call(this,e)}get renewalText(){return this.querySelector("span.renewal-text")?.textContent?.trim()}get promoDurationText(){return this.querySelector("span.promo-duration-text")?.textContent?.trim()}get ctas(){let e=this.querySelector('[slot="ctas"], [slot="footer"]')?.querySelectorAll(`${W}, a`);return Array.from(e??[])}get primaryCta(){return z(this,E,At).call(this,this.ctas.find(e=>e.variant==="accent"||e.matches(".spectrum-Button--accent,.con-button.blue")))}get secondaryCta(){return z(this,E,At).call(this,this.ctas.find(e=>e.variant!=="accent"&&!e.matches(".spectrum-Button--accent,.con-button.blue")))}};De=new WeakMap,Fe=new WeakMap,Ie=new WeakMap,V=new WeakMap,he=new WeakMap,H=new WeakMap,pe=new WeakMap,E=new WeakSet,de=function(e,r={},i=!0){if(!this.isConnected)return;let o=this.aemFragment?.getAttribute("fragment");o=`[${o}]`;let c={...this.aemFragment.fetchInfo,...s(this,V).duration,...r,message:e};s(this,Ie).error(`merch-card${o}: ${e}`,c),this.failed=!0,i&&this.dispatchEvent(new CustomEvent(ur,{bubbles:!0,composed:!0,detail:c}))},at=function(){return this.querySelector("span.price-strikethrough")??this.querySelector(`${b}[data-template="price"] > span`)},er=function(){return this.querySelector(`${b}[data-template="legal"]`)},At=function(e){if(e)return{text:e.innerText.trim(),analyticsId:e.dataset.analyticsId,href:e.getAttribute("href")??e.dataset.href}},d(te,"properties",{id:{type:String,attribute:"id",reflect:!0},name:{type:String,attribute:"name",reflect:!0},variant:{type:String,reflect:!0},size:{type:String,attribute:"size",reflect:!0},badgeColor:{type:String,attribute:"badge-color",reflect:!0},borderColor:{type:String,attribute:"border-color",reflect:!0},backgroundColor:{type:String,attribute:"background-color",reflect:!0},badgeBackgroundColor:{type:String,attribute:"badge-background-color",reflect:!0},backgroundImage:{type:String,attribute:"background-image",reflect:!0},badgeText:{type:String,attribute:"badge-text"},actionMenu:{type:Boolean,attribute:"action-menu"},actionMenuLabel:{type:String,attribute:"action-menu-label"},customHr:{type:Boolean,attribute:"custom-hr"},consonant:{type:Boolean,attribute:"consonant"},failed:{type:Boolean,attribute:"failed",reflect:!0},spectrum:{type:String,attribute:"spectrum"},detailBg:{type:String,attribute:"detail-bg"},secureLabel:{type:String,attribute:"secure-label"},checkboxLabel:{type:String,attribute:"checkbox-label"},addonTitle:{type:String,attribute:"addon-title"},addonOffers:{type:Object,attribute:"addon-offers"},selected:{type:Boolean,attribute:"aria-selected",reflect:!0},storageOption:{type:String,attribute:"storage",reflect:!0},planType:{type:String,attribute:"plan-type",reflect:!0},heightSync:{type:Boolean,attribute:"height-sync"},settings:{type:Object,attribute:!1},stockOfferOsis:{type:Object,attribute:"stock-offer-osis",converter:{fromAttribute:e=>{if(!e)return;let[r,i,n]=e.split(",");return{PUF:r,ABM:i,M2M:n}}}},filters:{type:String,reflect:!0,converter:{fromAttribute:e=>Object.fromEntries(e.split(",").map(r=>{let[i,n,o]=r.split(":"),c=Number(n);return[i,{order:isNaN(c)?void 0:c,size:o}]})),toAttribute:e=>Object.entries(e).map(([r,{order:i,size:n}])=>[r,i,n].filter(o=>o!=null).join(":")).join(",")}},types:{type:String,attribute:"types",reflect:!0},merchOffer:{type:Object},analyticsId:{type:String,attribute:Ct,reflect:!0},loading:{type:String},priceLiterals:{type:Object}}),d(te,"styles",[sr,...lr()]),d(te,"registerVariant",k),d(te,"getCollectionOptions",ia),d(te,"getFragmentMapping",pt);customElements.define(tr,te);export{te as MerchCard}; + `),d(et,"properties",{heading:{type:String,attribute:!0},mobileRows:{type:Number,attribute:!0}});customElements.define("merch-whats-included",et);var qi={[K]:fr,[re]:vr,[Y]:xr},Hi={[K]:br,[Y]:Be},tt,St=class{constructor(t){g(this,tt);d(this,"changes",new Map);d(this,"connected",!1);d(this,"error");d(this,"log");d(this,"options");d(this,"promises",[]);d(this,"state",re);d(this,"timer",null);d(this,"value");d(this,"version",0);d(this,"wrapperElement");this.wrapperElement=t,this.log=Ke.module("mas-element")}update(){[K,re,Y].forEach(t=>{this.wrapperElement.classList.toggle(qi[t],t===this.state)})}notify(){(this.state===Y||this.state===K)&&(this.state===Y?this.promises.forEach(({resolve:e})=>e(this.wrapperElement)):this.state===K&&this.promises.forEach(({reject:e})=>e(this.error)),this.promises=[]);let t=this.error;this.error instanceof Z&&(t={message:this.error.message,...this.error.context}),this.wrapperElement.dispatchEvent(new CustomEvent(Hi[this.state],{bubbles:!0,composed:!0,detail:t}))}attributeChangedCallback(t,e,r){this.changes.set(t,r),this.requestUpdate()}connectedCallback(){m(this,tt,Gt()),this.requestUpdate(!0)}disconnectedCallback(){this.connected&&(this.connected=!1,this.log?.debug("Disconnected:",{element:this.wrapperElement}))}onceSettled(){let{error:t,promises:e,state:r}=this;return Y===r?Promise.resolve(this.wrapperElement):K===r?Promise.reject(t):new Promise((i,n)=>{e.push({resolve:i,reject:n})})}toggleResolved(t,e,r){return t!==this.version?!1:(r!==void 0&&(this.options=r),this.state=Y,this.value=e,this.update(),this.log?.debug("Resolved:",{element:this.wrapperElement,value:e}),Et(()=>this.notify()),!0)}toggleFailed(t,e,r){if(t!==this.version)return!1;r!==void 0&&(this.options=r),this.error=e,this.state=K,this.update();let i=this.wrapperElement.getAttribute("is");return this.log?.error(`${i}: Failed to render: ${e.message}`,{element:this.wrapperElement,...e.context,...s(this,tt)?.duration}),Et(()=>this.notify()),!0}togglePending(t){return this.version++,t&&(this.options=t),this.state=re,this.update(),this.log?.debug("Pending:",{osi:this.wrapperElement?.options?.wcsOsi}),this.version}requestUpdate(t=!1){if(!this.wrapperElement.isConnected||!Gt()||this.timer)return;let{error:e,options:r,state:i,value:n,version:o}=this;this.state=re,this.timer=Et(async()=>{this.timer=null;let c=null;if(this.changes.size&&(c=Object.fromEntries(this.changes.entries()),this.changes.clear()),this.connected?this.log?.debug("Updated:",{element:this.wrapperElement,changes:c}):(this.connected=!0,this.log?.debug("Connected:",{element:this.wrapperElement,changes:c})),c||t)try{await this.wrapperElement.render?.()===!1&&this.state===re&&this.version===o&&(this.state=i,this.error=e,this.value=n,this.update(),this.notify())}catch(l){this.toggleFailed(this.version,l,r)}})}};tt=new WeakMap;function Ui(a){return`https://${a==="PRODUCTION"?"www.adobe.com":"www.stage.adobe.com"}/offers/promo-terms.html`}var le,se=class se extends HTMLAnchorElement{constructor(){super();d(this,"masElement",new St(this));g(this,le);this.setAttribute("is",se.is)}get isUptLink(){return!0}initializeWcsData(e,r){this.setAttribute("data-wcs-osi",e),r&&this.setAttribute("data-promotion-code",r)}attributeChangedCallback(e,r,i){this.masElement.attributeChangedCallback(e,r,i)}connectedCallback(){this.masElement.connectedCallback(),m(this,le,ae()),s(this,le)&&(this.log=s(this,le).log.module("upt-link"))}disconnectedCallback(){this.masElement.disconnectedCallback(),m(this,le,void 0)}requestUpdate(e=!1){this.masElement.requestUpdate(e)}onceSettled(){return this.masElement.onceSettled()}async render(){let e=ae();if(!e)return!1;this.dataset.imsCountry||e.imsCountryPromise.then(o=>{o&&(this.dataset.imsCountry=o)});let r=e.collectCheckoutOptions({},this);if(!r.wcsOsi)return this.log.error("Missing 'data-wcs-osi' attribute on upt-link."),!1;let i=this.masElement.togglePending(r),n=e.resolveOfferSelectors(r);try{let[[o]]=await Promise.all(n),{country:c,language:l,env:h}=r,p=`locale=${l}_${c}&country=${c}&offer_id=${o.offerId}`,x=this.getAttribute("data-promotion-code");x&&(p+=`&promotion_code=${encodeURIComponent(x)}`),this.href=`${Ui(h)}?${p}`,this.masElement.toggleResolved(i,o,r)}catch(o){let c=new Error(`Could not resolve offer selectors for id: ${r.wcsOsi}.`,o.message);return this.masElement.toggleFailed(i,c,r),!1}}static createFrom(e){let r=new se;for(let i of e.attributes)i.name!=="is"&&(i.name==="class"&&i.value.includes("upt-link")?r.setAttribute("class",i.value.replace("upt-link","").trim()):r.setAttribute(i.name,i.value));return r.innerHTML=e.innerHTML,r.setAttribute("tabindex",0),r}};le=new WeakMap,d(se,"is","upt-link"),d(se,"tag","a"),d(se,"observedAttributes",["data-wcs-osi","data-promotion-code","data-ims-country"]);var ee=se;window.customElements.get(ee.is)||window.customElements.define(ee.is,ee,{extends:ee.tag});var ji="#000000",Xt="#F8D904",Gi="#EAEAEA",Vi="#31A547",Wi=/(accent|primary|secondary)(-(outline|link))?/,Ki="mas:product_code/",Yi="daa-ll",Ct="daa-lh",Qi=["XL","L","M","S"],Zt="...";function D(a,t,e,r){let i=r[a];if(t[a]&&i){let n={slot:i?.slot,...i?.attributes},o=t[a];if(i.maxCount&&typeof o=="string"){let[l,h]=un(o,i.maxCount,i.withSuffix);l!==o&&(n.title=h,o=l)}let c=T(i.tag,n,o);e.append(c)}}function Xi(a,t,e){let i=(a.mnemonicIcon||[]).filter(o=>o).map((o,c)=>({icon:o,alt:a.mnemonicAlt?.[c]??"",link:a.mnemonicLink?.[c]??""}));i?.forEach(({icon:o,alt:c,link:l})=>{if(l&&!/^https?:/.test(l))try{l=new URL(`https://${l}`).href.toString()}catch{l="#"}let h={slot:"icons",src:o,loading:t.loading,size:e?.size??"l"};c&&(h.alt=c),l&&(h.href=l);let p=T("merch-icon",h);t.append(p)});let n=t.shadowRoot.querySelector('slot[name="icons"]');n&&(n.style.display=i?.length?null:"none")}function Zi(a,t,e){if(e.badge?.slot){if(a.badge?.length&&!a.badge?.startsWith("${a.badge}`}D("badge",a,t,e)}else a.badge?(t.setAttribute("badge-text",a.badge),e.disabledAttributes?.includes("badgeColor")||t.setAttribute("badge-color",a.badgeColor||ji),e.disabledAttributes?.includes("badgeBackgroundColor")||t.setAttribute("badge-background-color",a.badgeBackgroundColor||Xt),t.setAttribute("border-color",a.badgeBackgroundColor||Xt)):t.setAttribute("border-color",a.borderColor||Gi)}function Ji(a,t,e){if(e.trialBadge&&a.trialBadge){if(!a.trialBadge.startsWith("${a.trialBadge}`}D("trialBadge",a,t,e)}}function en(a,t,e){e?.includes(a.size)&&t.setAttribute("size",a.size)}function tn(a,t){a.cardName&&t.setAttribute("name",a.cardName)}function rn(a,t,e){a.cardTitle&&(a.cardTitle=Oe(a.cardTitle)),D("cardTitle",a,t,{cardTitle:e})}function an(a,t,e){D("subtitle",a,t,e)}function nn(a,t,e,r){if(!a.backgroundColor||a.backgroundColor.toLowerCase()==="default"){t.style.removeProperty("--merch-card-custom-background-color"),t.removeAttribute("background-color");return}e?.[a.backgroundColor]?(t.style.setProperty("--merch-card-custom-background-color",`var(${e[a.backgroundColor]})`),t.setAttribute("background-color",a.backgroundColor)):r?.attribute&&a.backgroundColor&&(t.setAttribute(r.attribute,a.backgroundColor),t.style.removeProperty("--merch-card-custom-background-color"))}function on(a,t,e){let r=e?.borderColor,i="--consonant-merch-card-border-color";if(a.borderColor?.toLowerCase()==="transparent")t.style.setProperty(i,"transparent");else if(a.borderColor&&r){let o=r?.specialValues?.[a.borderColor]?.includes("gradient")||/-gradient/.test(a.borderColor),c=/^spectrum-.*-(plans|special-offers)$/.test(a.borderColor);if(o){t.setAttribute("gradient-border","true");let l=a.borderColor;if(r?.specialValues){for(let[h,p]of Object.entries(r.specialValues))if(p===a.borderColor){l=h;break}}t.setAttribute("border-color",l),t.style.removeProperty(i)}else c?(t.setAttribute("border-color",a.borderColor),t.style.setProperty(i,`var(--${a.borderColor})`)):t.style.setProperty(i,`var(--${a.borderColor})`)}}function cn(a,t,e){if(a.backgroundImage){let r={loading:t.loading??"lazy",src:a.backgroundImage};if(a.backgroundImageAltText?r.alt=a.backgroundImageAltText:r.role="none",!e)return;if(e?.attribute){t.setAttribute(e.attribute,a.backgroundImage);return}t.append(T(e.tag,{slot:e.slot},T("img",r)))}}function Oe(a){return!a||typeof a!="string"||a.includes("(zt(),Lt)).catch(console.error),a}function sn(a,t,e){a.prices&&(a.prices=Oe(a.prices)),D("prices",a,t,e)}function za(a,t,e){let r=a.hasAttribute("data-wcs-osi")&&!!a.getAttribute("data-wcs-osi"),i=a.className||"",n=Wi.exec(i)?.[0]??"accent",o=n.includes("accent"),c=n.includes("primary"),l=n.includes("secondary"),h=n.includes("-outline"),p=n.includes("-link");a.classList.remove("accent","primary","secondary");let x;if(t.consonant)x=bn(a,o,r,p,c,l,e?.ctas?.size);else if(p)x=a;else{let L;o?L="accent":c?L="primary":l&&(L="secondary"),x=t.spectrum==="swc"?xn(a,e,h,L,r):vn(a,e,h,L,r)}return x}function ln(a,t){let{slot:e}=t?.description,r=a.querySelectorAll(`[slot="${e}"] a[data-wcs-osi]`);r.length&&r.forEach(i=>{let n=za(i,a,t);i.replaceWith(n)})}function dn(a,t,e,r){a.description&&(a.description=Oe(a.description)),a.promoText&&(a.promoText=Oe(a.promoText)),a.shortDescription&&(a.shortDescription=Oe(a.shortDescription)),D("promoText",a,t,e),D("description",a,t,e),D("shortDescription",a,t,e),a.shortDescription&&(t.setAttribute("action-menu","true"),a.actionMenuLabel||t.setAttribute("action-menu-label","More options")),ln(t,e),D("callout",a,t,e),hn(a,t,e,r),D("whatsIncluded",a,t,e)}function hn(a,t,e,r={}){e.quantitySelect&&(a.quantitySelect||(a.quantitySelect=r.quantitySelect),D("quantitySelect",a,t,e))}function pn(a,t,e,r={}){if(!e.addon)return;let n=(a.addon??r.addon)?.replace(/[{}]/g,"");if(!n||/disabled/.test(n))return;let o=T("merch-addon",{slot:"addon"},n);[...o.querySelectorAll(b)].forEach(c=>{let l=c.parentElement;l?.nodeName==="P"&&l.setAttribute("data-plan-type","")}),t.append(o)}function mn(a,t,e){a.addonConfirmation&&D("addonConfirmation",a,t,e)}function gn(a,t,e,r){r?.secureLabel&&e?.secureLabel&&t.setAttribute("secure-label",r.secureLabel)}function un(a,t,e=!0){try{let r=typeof a!="string"?"":a,i=La(r);if(i.length<=t)return[r,i];let n=0,o=!1,c=e?t-Zt.length<1?1:t-Zt.length:t,l=[];for(let x of r){if(n++,x==="<")if(o=!0,r[n]==="/")l.pop();else{let L="";for(let U of r.substring(n)){if(U===" "||U===">")break;L+=U}l.push(L)}if(x==="/"&&r[n]===">"&&l.pop(),x===">"){o=!1;continue}if(!o&&(c--,c===0))break}let h=r.substring(0,n).trim();if(l.length>0){l[0]==="p"&&l.shift();for(let x of l.reverse())h+=``}return[`${h}${e?Zt:""}`,i]}catch{let i=typeof a=="string"?a:"",n=La(i);return[i,n]}}function La(a){if(!a)return"";let t="",e=!1;for(let r of a){if(r==="<"&&(e=!0),r===">"){e=!1;continue}e||(t+=r)}return t}function fn(a,t){t.querySelectorAll("a.upt-link").forEach(r=>{let i=ee.createFrom(r);r.replaceWith(i),i.initializeWcsData(a.osi,a.promoCode)})}function vn(a,t,e,r,i){let n=a;i?n=customElements.get("checkout-button").createCheckoutButton({},a.innerHTML):n.innerHTML=`${n.textContent}`,n.setAttribute("tabindex",0);for(let p of a.attributes)["class","is"].includes(p.name)||n.setAttribute(p.name,p.value);n.firstElementChild?.classList.add("spectrum-Button-label");let o=t?.ctas?.size??"M",c=`spectrum-Button--${r}`,l=Qi.includes(o)?`spectrum-Button--size${o}`:"spectrum-Button--sizeM",h=["spectrum-Button",c,l];return e&&h.push("spectrum-Button--outline"),n.classList.add(...h),n}function xn(a,t,e,r,i){let n=a;i&&(n=customElements.get("checkout-button").createCheckoutButton(a.dataset),n.connectedCallback(),n.render());let o="fill";e&&(o="outline");let c=T("sp-button",{treatment:o,variant:r,tabIndex:0,size:t?.ctas?.size??"m",...a.dataset.analyticsId&&{"data-analytics-id":a.dataset.analyticsId}},a.innerHTML);return c.source=n,(i?n.onceSettled():Promise.resolve(n)).then(l=>{c.setAttribute("data-navigation-url",l.href)}),c.addEventListener("click",l=>{l.defaultPrevented||n.click()}),c}function bn(a,t,e,r,i,n,o){let c=a;if(e)try{let l=customElements.get("checkout-link");l&&(c=l.createCheckoutLink(a.dataset,a.innerHTML)??a)}catch{}return r||(c.classList.add("button","con-button"),o&&o!=="m"&&c.classList.add(`button-${o}`),t&&c.classList.add("blue"),i&&c.classList.add("primary"),n&&c.classList.add("secondary")),c}function yn(a,t,e,r){if(a.ctas){a.ctas=Oe(a.ctas);let{slot:i}=e.ctas,n=T("div",{slot:i},a.ctas),o=[...n.querySelectorAll("a")].map(c=>za(c,t,e));n.innerHTML="",n.append(...o),t.append(n)}}function wn(a,t){let{tags:e}=a,r=e?.find(n=>typeof n=="string"&&n.startsWith(Ki))?.split("/").pop();if(!r)return;t.setAttribute(Ct,r),[...t.shadowRoot.querySelectorAll("a[data-analytics-id],button[data-analytics-id]"),...t.querySelectorAll("a[data-analytics-id],button[data-analytics-id]")].forEach((n,o)=>{n.setAttribute(Yi,`${n.dataset.analyticsId}-${o+1}`)})}function En(a){a.spectrum==="css"&&[["primary-link","primary"],["secondary-link","secondary"]].forEach(([t,e])=>{a.querySelectorAll(`a.${t}`).forEach(r=>{r.classList.remove(t),r.classList.add("spectrum-Link",`spectrum-Link--${e}`)})})}function kn(a){a.querySelectorAll("[slot]").forEach(r=>{r.remove()}),a.variant=void 0,["checkbox-label","stock-offer-osis","secure-label","background-image","background-color","border-color","badge-background-color","badge-color","badge-text","gradient-border","size",Ct].forEach(r=>a.removeAttribute(r));let e=["wide-strip","thin-strip"];a.classList.remove(...e)}async function Pa(a,t){if(!a){let l=t?.id||"unknown";throw console.error(`hydrate: Fragment is undefined. Cannot hydrate card (merchCard id: ${l}).`),new Error(`hydrate: Fragment is undefined for card (merchCard id: ${l}).`)}if(!a.fields){let l=a.id||"unknown",h=t?.id||"unknown";throw console.error(`hydrate: Fragment for card ID '${l}' (merchCard id: ${h}) is missing 'fields'. Cannot hydrate.`),new Error(`hydrate: Fragment for card ID '${l}' (merchCard id: ${h}) is missing 'fields'.`)}let{id:e,fields:r,settings:i={},priceLiterals:n}=a,{variant:o}=r;if(!o)throw new Error(`hydrate: no variant found in payload ${e}`);kn(t),t.settings=i,n&&(t.priceLiterals=n),t.id??(t.id=a.id),a.variationId&&t.setAttribute("variation-id",a.variationId??""),t.variant=o,await t.updateComplete;let{aemFragmentMapping:c}=t.variantLayout;if(!c)throw new Error(`hydrate: variant mapping not found for ${e}`);c.style==="consonant"&&t.setAttribute("consonant",!0),Xi(r,t,c.mnemonics),Ji(r,t,c),en(r,t,c.size),tn(r,t),rn(r,t,c.title),Zi(r,t,c),an(r,t,c),sn(r,t,c),cn(r,t,c.backgroundImage),nn(r,t,c.allowedColors,c.backgroundColor),on(r,t,c),dn(r,t,c,i),pn(r,t,c,i),mn(r,t,c),gn(r,t,c,i);try{fn(r,t)}catch{}yn(r,t,c,o),wn(r,t),En(t)}var tr="merch-card",Jt=2e4,_a="merch-card:",Ra=["full-pricing-express","simplified-pricing-express"],Na=["segment","product"];function Ma(a,t){let e=a.closest(tr);if(!e)return t;e.priceLiterals&&(t.literals??(t.literals={}),Object.assign(t.literals,e.priceLiterals)),e.aemFragment&&(t[wr]=!0),e.variantLayout?.priceOptionsProvider?.(a,t)}function Cn(a){a.providers.has(Ma)||a.providers.price(Ma)}var rt=new IntersectionObserver(a=>{a.forEach(t=>{let e=t.target;if(Ra.includes(e.variant)){if(e.clientHeight===0)return;rt.unobserve(e),e.requestUpdate();return}if(Na.includes(e.variant)){if(t.boundingClientRect.width===0)return;if(e.variant==="product"&&e.querySelector('merch-icon[slot="icons"]')){rt.unobserve(e);return}let r=e.getBoundingClientRect().width,n=e.querySelector('[slot="badge"]')?.getBoundingClientRect().width||0;if(r===0||n===0){rt.unobserve(e);return}e.style.setProperty("--consonant-merch-card-heading-xs-max-width",`${Math.round(r-n-16)}px`),rt.unobserve(e)}})}),An=0,De,Fe,Ie,V,he,H,pe,E,de,at,er,At,te=class extends Sn{constructor(){super();g(this,E);g(this,De);g(this,Fe);g(this,Ie);g(this,V);g(this,he);g(this,H);g(this,pe,new Promise(e=>{m(this,H,e)}));d(this,"customerSegment");d(this,"marketSegment");d(this,"variantLayout");this.id=null,this.failed=!1,this.filters={},this.types="",this.selected=!1,this.spectrum="css",this.loading="lazy",this.handleAemFragmentEvents=this.handleAemFragmentEvents.bind(this),this.handleMerchOfferSelectReady=this.handleMerchOfferSelectReady.bind(this)}firstUpdated(){this.variantLayout=$t(this),this.variantLayout?.connectedCallbackHook()}willUpdate(e){(e.has("variant")||!this.variantLayout)&&(this.variantLayout?.disconnectedCallbackHook(),this.variantLayout=$t(this),this.variantLayout?.connectedCallbackHook())}updated(e){(e.has("badgeBackgroundColor")||e.has("borderColor"))&&this.style.setProperty("--consonant-merch-card-border",this.computedBorderStyle),e.has("backgroundColor")&&this.style.setProperty("--merch-card-custom-background-color",this.backgroundColor?`var(--${this.backgroundColor})`:"");try{this.variantLayoutPromise=this.variantLayout?.postCardUpdateHook(e)}catch(r){z(this,E,de).call(this,`Error in postCardUpdateHook: ${r.message}`,{},!1)}}get theme(){return this.closest("sp-theme")}get dir(){return this.closest("[dir]")?.getAttribute("dir")??"ltr"}render(){if(!(!this.isConnected||!this.variantLayout||this.style.display==="none"))return this.variantLayout.renderLayout()}get computedBorderStyle(){return["ccd-slice","ccd-suggested","ah-promoted-plans","simplified-pricing-express","full-pricing-express"].includes(this.variant)?"":`1px solid ${this.borderColor?this.borderColor:this.badgeBackgroundColor}`}get badgeElement(){return this.shadowRoot.getElementById("badge")}get headingmMSlot(){return this.shadowRoot.querySelector('slot[name="heading-m"]').assignedElements()[0]}get footerSlot(){return this.shadowRoot.querySelector('slot[name="footer"]')?.assignedElements()[0]}get descriptionSlot(){return this.shadowRoot.querySelector('slot[name="body-xs"')?.assignedElements()[0]}get descriptionSlotCompare(){return this.shadowRoot.querySelector('slot[name="body-m"')?.assignedElements()[0]}get iconButton(){return this.querySelector('[slot="callout-content"] .icon-button')}get price(){return this.headingmMSlot?.querySelector(b)}get checkoutLinks(){return[...this.footerSlot?.querySelectorAll(W)??[]]}get checkoutLinksDescription(){return[...this.descriptionSlot?.querySelectorAll(W)??[]]}get checkoutLinkDescriptionCompare(){return[...this.descriptionSlotCompare?.querySelectorAll(W)??[]]}get activeDescriptionLinks(){return this.variant==="mini-compare-chart"||this.variant==="mini-compare-chart-mweb"?this.checkoutLinkDescriptionCompare:this.checkoutLinksDescription}async toggleStockOffer({target:e}){if(!this.stockOfferOsis)return;let r=this.checkoutLinks;if(r.length!==0)for(let i of r){await i.onceSettled();let n=i.value?.[0]?.planType;if(!n)return;let o=this.stockOfferOsis[n];if(!o)return;let c=i.dataset.wcsOsi.split(",").filter(l=>l!==o);e.checked&&c.push(o),i.dataset.wcsOsi=c.join(",")}}changeHandler(e){e.target.tagName==="MERCH-ADDON"&&this.toggleAddon(e.target)}toggleAddon(e){this.variantLayout?.toggleAddon?.(e);let r=[...this.checkoutLinks,...this.activeDescriptionLinks??[]];if(r.length===0)return;let i=n=>{let{offerType:o,planType:c}=n.value?.[0]??{};if(!o||!c)return;let l=e.getOsi(c,o),h=(n.dataset.wcsOsi||"").split(",").filter(p=>p&&p!==l);e.checked&&h.push(l),n.dataset.wcsOsi=h.join(",")};r.forEach(i)}handleQuantitySelection(e){let r=[...this.checkoutLinks,...this.activeDescriptionLinks??[]];if(r.length!==0)for(let i of r)i.dataset.quantity=e.detail.option}get titleElement(){return this.querySelector(this.variantLayout?.headingSelector||".card-heading")}get title(){return this.titleElement?.textContent?.trim()}get description(){return this.querySelector('[slot="body-xs"]')?.textContent?.trim()}updateFilters(e){let r={...this.filters};Object.keys(r).forEach(i=>{if(e){r[i].order=Math.min(r[i].order||2,2);return}let n=r[i].order;n===1||isNaN(n)||(r[i].order=Number(n)+1)}),this.filters=r}showInfoTooltip(e,r){let i="tooltip-left",n="tooltip-right";window.screen.width<600&&e.getAttribute("data-tooltip")?.length>12&&(this.iconButton.classList.remove(i),this.iconButton.classList.remove(n),e.getBoundingClientRect().x<100&&this.iconButton.classList.add(i),e.getBoundingClientRect().x>window.screen.width-100&&this.iconButton.classList.add(n)),this.iconButton.classList.add(r)}handleInfoIconEvents(){let e="tooltip-visible";this.iconButton&&(["mouseenter","focus"].forEach(r=>this.iconButton.addEventListener(r,i=>this.showInfoTooltip(i.target,e),!1)),["mouseleave","blur"].forEach(r=>this.iconButton.addEventListener(r,()=>this.iconButton.classList.remove(e),!1)),this.iconButton.addEventListener("keydown",r=>{r.key==="Escape"&&this.iconButton.classList.remove(e)}))}includes(e){return this.textContent.match(new RegExp(e,"i"))!==null}connectedCallback(){var r;super.connectedCallback(),s(this,Fe)||m(this,Fe,An++),this.aemFragment||((r=s(this,H))==null||r.call(this),m(this,H,void 0)),this.id??(this.id=this.getAttribute("id")??this.aemFragment?.getAttribute("fragment"));let e=this.id??s(this,Fe);m(this,he,`${_a}${e}${st}`),m(this,De,`${_a}${e}${lt}`),performance.mark(s(this,he)),m(this,V,ae()),Cn(s(this,V)),m(this,Ie,s(this,V).Log.module(tr)),this.addEventListener(R,this.handleQuantitySelection),this.addEventListener(Pt,this.handleAddonAndQuantityUpdate),this.addEventListener(pr,this.handleMerchOfferSelectReady),this.addEventListener(fe,this.handleAemFragmentEvents),this.addEventListener(ue,this.handleAemFragmentEvents),this.addEventListener(ot,this.handleInfoIconEvents),this.addEventListener("change",this.changeHandler),this.variantLayout&&this.variantLayout.connectedCallbackHook(),this.aemFragment||setTimeout(()=>this.checkReady(),0)}disconnectedCallback(){super.disconnectedCallback(),this.variantLayout?.disconnectedCallbackHook(),this.removeEventListener(R,this.handleQuantitySelection),this.removeEventListener(fe,this.handleAemFragmentEvents),this.removeEventListener(ue,this.handleAemFragmentEvents),this.removeEventListener(ot,this.handleInfoIconEvents),this.removeEventListener("change",this.changeHandler),this.removeEventListener(Pt,this.handleAddonAndQuantityUpdate)}async handleAemFragmentEvents(e){var r;if(this.isConnected&&(e.type===fe&&z(this,E,de).call(this,"AEM fragment cannot be loaded"),e.type===ue&&(this.failed=!1,e.target.nodeName==="AEM-FRAGMENT"))){let i=e.detail;try{s(this,H)||m(this,pe,new Promise(n=>{m(this,H,n)})),Pa(i,this)}catch(n){z(this,E,de).call(this,`hydration has failed: ${n.message}`)}finally{(r=s(this,H))==null||r.call(this),m(this,H,void 0)}this.checkReady()}}async checkReady(){if(!this.isConnected)return;s(this,pe)&&(await s(this,pe),(Ra.includes(this.variant)||Na.includes(this.variant))&&rt.observe(this),m(this,pe,void 0)),this.variantLayoutPromise&&(await this.variantLayoutPromise,this.variantLayoutPromise=void 0);let e=new Promise(o=>setTimeout(()=>o("timeout"),Jt));if(this.aemFragment){let o=await Promise.race([this.aemFragment.updateComplete,e]);if(o===!1||o==="timeout"){let c=o==="timeout"?`AEM fragment was not resolved within ${Jt} timeout`:"AEM fragment cannot be loaded";z(this,E,de).call(this,c,{},!1);return}}let r=[...this.querySelectorAll(hr)],i=Promise.all(r.map(o=>o.onceSettled().catch(()=>o))).then(o=>o.every(c=>c.classList.contains("placeholder-resolved"))),n=await Promise.race([i,e]);if(n===!0){this.measure=performance.measure(s(this,De),s(this,he));let o={...this.aemFragment?.fetchInfo,...s(this,V).duration,measure:ve(this.measure)};return this.dispatchEvent(new CustomEvent(ot,{bubbles:!0,composed:!0,detail:o})),this}else{this.measure=performance.measure(s(this,De),s(this,he));let o={measure:ve(this.measure),...s(this,V).duration};n==="timeout"?z(this,E,de).call(this,`Contains offers that were not resolved within ${Jt} timeout`,o):z(this,E,de).call(this,"Contains unresolved offers",o)}}get aemFragment(){return this.querySelector("aem-fragment")}get addon(){return this.querySelector("merch-addon")}get quantitySelect(){return this.querySelector("merch-quantity-select")}get addonCheckbox(){return this.querySelector("merch-addon")}displayFooterElementsInColumn(){if(!this.classList.contains("product"))return;let e=this.shadowRoot.querySelector(".secure-transaction-label");(this.footerSlot?.querySelectorAll(W)).length===2&&e&&e.parentElement.classList.add("footer-column")}handleMerchOfferSelectReady(){this.offerSelect&&!this.offerSelect.planType||this.displayFooterElementsInColumn()}get dynamicPrice(){return this.querySelector('[slot="price"]')}handleAddonAndQuantityUpdate({detail:{id:e,items:r}}){if(!e||!r?.length||this.closest('[role="tabpanel"][hidden="true"]'))return;let n=this.checkoutLinks.find(p=>p.getAttribute("data-modal-id")===e);if(!n)return;let c=new URL(n.getAttribute("href")).searchParams.get("pa"),l=r.find(p=>p.productArrangementCode===c)?.quantity,h=!!r.find(p=>p.productArrangementCode!==c);if(l&&this.quantitySelect?.dispatchEvent(new CustomEvent(gr,{detail:{quantity:l},bubbles:!0,composed:!0})),this.addonCheckbox&&this.addonCheckbox.checked!==h){this.toggleStockOffer({target:this.addonCheckbox});let p=new Event("change",{bubbles:!0,cancelable:!0});Object.defineProperty(p,"target",{writable:!1,value:{checked:h}}),this.addonCheckbox.handleChange(p)}}get prices(){return Array.from(this.querySelectorAll(b))}get promoPrice(){if(!this.querySelector("span.price-strikethrough"))return;let e=this.querySelector(".price.price-alternative");if(e||(e=this.querySelector(`${b}[data-template="price"] > span`)),!!e)return e=e.innerText,e}get regularPrice(){return s(this,E,at)?.innerText}get promotionCode(){let e=[...this.querySelectorAll(`${b}[data-promotion-code],${W}[data-promotion-code]`)].map(i=>i.dataset.promotionCode),r=[...new Set(e)];return r.length>1&&s(this,Ie)?.warn(`Multiple different promotion codes found: ${r.join(", ")}`),e[0]}get annualPrice(){return this.querySelector(`${b}[data-template="price"] > .price.price-annual`)?.innerText}get promoText(){}get taxText(){return(s(this,E,er)??s(this,E,at))?.querySelector("span.price-tax-inclusivity")?.textContent?.trim()||void 0}get recurrenceText(){return s(this,E,at)?.querySelector("span.price-recurrence")?.textContent?.trim()}get unitText(){let e=".price-unit-type";return s(this,E,er)?.querySelector(e)?.textContent?.trim()??s(this,E,at)?.querySelector(e)?.textContent?.trim()??this.querySelector(e)?.textContent?.trim()??void 0}get planTypeText(){return this.querySelector('[is="inline-price"][data-template="legal"] span.price-plan-type')?.textContent?.trim()}get seeTermsInfo(){let e=this.querySelector('a[is="upt-link"]');if(e)return z(this,E,At).call(this,e)}get renewalText(){return this.querySelector("span.renewal-text")?.textContent?.trim()}get promoDurationText(){return this.querySelector("span.promo-duration-text")?.textContent?.trim()}get ctas(){let e=this.querySelector('[slot="ctas"], [slot="footer"]')?.querySelectorAll(`${W}, a`);return Array.from(e??[])}get primaryCta(){return z(this,E,At).call(this,this.ctas.find(e=>e.variant==="accent"||e.matches(".spectrum-Button--accent,.con-button.blue")))}get secondaryCta(){return z(this,E,At).call(this,this.ctas.find(e=>e.variant!=="accent"&&!e.matches(".spectrum-Button--accent,.con-button.blue")))}};De=new WeakMap,Fe=new WeakMap,Ie=new WeakMap,V=new WeakMap,he=new WeakMap,H=new WeakMap,pe=new WeakMap,E=new WeakSet,de=function(e,r={},i=!0){if(!this.isConnected)return;let o=this.aemFragment?.getAttribute("fragment");o=`[${o}]`;let c={...this.aemFragment.fetchInfo,...s(this,V).duration,...r,message:e};s(this,Ie).error(`merch-card${o}: ${e}`,c),this.failed=!0,i&&this.dispatchEvent(new CustomEvent(ur,{bubbles:!0,composed:!0,detail:c}))},at=function(){return this.querySelector("span.price-strikethrough")??this.querySelector(`${b}[data-template="price"] > span`)},er=function(){return this.querySelector(`${b}[data-template="legal"]`)},At=function(e){if(e)return{text:e.innerText.trim(),analyticsId:e.dataset.analyticsId,href:e.getAttribute("href")??e.dataset.href}},d(te,"properties",{id:{type:String,attribute:"id",reflect:!0},name:{type:String,attribute:"name",reflect:!0},variant:{type:String,reflect:!0},size:{type:String,attribute:"size",reflect:!0},badgeColor:{type:String,attribute:"badge-color",reflect:!0},borderColor:{type:String,attribute:"border-color",reflect:!0},backgroundColor:{type:String,attribute:"background-color",reflect:!0},badgeBackgroundColor:{type:String,attribute:"badge-background-color",reflect:!0},backgroundImage:{type:String,attribute:"background-image",reflect:!0},badgeText:{type:String,attribute:"badge-text"},actionMenu:{type:Boolean,attribute:"action-menu"},actionMenuLabel:{type:String,attribute:"action-menu-label"},customHr:{type:Boolean,attribute:"custom-hr"},consonant:{type:Boolean,attribute:"consonant"},failed:{type:Boolean,attribute:"failed",reflect:!0},spectrum:{type:String,attribute:"spectrum"},detailBg:{type:String,attribute:"detail-bg"},secureLabel:{type:String,attribute:"secure-label"},checkboxLabel:{type:String,attribute:"checkbox-label"},addonTitle:{type:String,attribute:"addon-title"},addonOffers:{type:Object,attribute:"addon-offers"},selected:{type:Boolean,attribute:"aria-selected",reflect:!0},storageOption:{type:String,attribute:"storage",reflect:!0},planType:{type:String,attribute:"plan-type",reflect:!0},heightSync:{type:Boolean,attribute:"height-sync"},settings:{type:Object,attribute:!1},stockOfferOsis:{type:Object,attribute:"stock-offer-osis",converter:{fromAttribute:e=>{if(!e)return;let[r,i,n]=e.split(",");return{PUF:r,ABM:i,M2M:n}}}},filters:{type:String,reflect:!0,converter:{fromAttribute:e=>Object.fromEntries(e.split(",").map(r=>{let[i,n,o]=r.split(":"),c=Number(n);return[i,{order:isNaN(c)?void 0:c,size:o}]})),toAttribute:e=>Object.entries(e).map(([r,{order:i,size:n}])=>[r,i,n].filter(o=>o!=null).join(":")).join(",")}},types:{type:String,attribute:"types",reflect:!0},merchOffer:{type:Object},analyticsId:{type:String,attribute:Ct,reflect:!0},loading:{type:String},priceLiterals:{type:Object}}),d(te,"styles",[sr,...lr()]),d(te,"registerVariant",k),d(te,"getCollectionOptions",ia),d(te,"getFragmentMapping",pt);customElements.define(tr,te);export{te as MerchCard}; diff --git a/web-components/src/hydrate.js b/web-components/src/hydrate.js index 71a23625d..fc52d0408 100644 --- a/web-components/src/hydrate.js +++ b/web-components/src/hydrate.js @@ -405,7 +405,7 @@ function processDescriptionLinks(merchCard, aemFragmentMapping) { }); } -export function processDescription(fields, merchCard, mapping) { +export function processDescription(fields, merchCard, mapping, settings) { if (fields.description) { fields.description = processMnemonicElements(fields.description); } @@ -431,10 +431,16 @@ export function processDescription(fields, merchCard, mapping) { processDescriptionLinks(merchCard, mapping); appendSlot('callout', fields, merchCard, mapping); - appendSlot('quantitySelect', fields, merchCard, mapping); + processQuantitySelect(fields, merchCard, mapping, settings); appendSlot('whatsIncluded', fields, merchCard, mapping); } +function processQuantitySelect(fields, merchCard, mapping, settings = {}) { + if (!mapping.quantitySelect) return; + if (!fields.quantitySelect) fields.quantitySelect = settings.quantitySelect; + appendSlot('quantitySelect', fields, merchCard, mapping); +} + export function processAddon(fields, merchCard, mapping, settings = {}) { if (!mapping.addon) return; const addonSource = fields.addon ?? settings.addon; @@ -814,7 +820,7 @@ export async function hydrate(fragment, merchCard) { mapping.backgroundColor, ); processBorderColor(fields, merchCard, mapping); - processDescription(fields, merchCard, mapping); + processDescription(fields, merchCard, mapping, settings); processAddon(fields, merchCard, mapping, settings); processAddonConfirmation(fields, merchCard, mapping); processSecureLabel(fields, merchCard, mapping, settings); From 46c3ed9f4581eb0338b846276065f22f7cd2a2c0 Mon Sep 17 00:00:00 2001 From: Bozo Jovicic Date: Mon, 6 Apr 2026 16:26:39 +0200 Subject: [PATCH 11/17] MWPW-189463 MAS Studio: Quantity selector variation - unit tests --- studio/src/common/fields/quantity-select.js | 4 +- .../test/editors/merch-card-editor.test.html | 87 ++++++++++--------- 2 files changed, 47 insertions(+), 44 deletions(-) diff --git a/studio/src/common/fields/quantity-select.js b/studio/src/common/fields/quantity-select.js index b4a49d434..6b005d4bc 100644 --- a/studio/src/common/fields/quantity-select.js +++ b/studio/src/common/fields/quantity-select.js @@ -1,4 +1,4 @@ -import { css, html, LitElement, nothing } from 'lit'; +import { css, html, LitElement } from 'lit'; import { fieldStatusStyles } from './field-status.css.js'; export const QUANTITY_SELECT_TAG = 'merch-quantity-select'; @@ -68,7 +68,7 @@ export class QuantitySelectField extends LitElement { this.step = '1'; this.layout = 'grid'; this.disabled = false; - this.fieldIndicatorTemplate = nothing; + this.fieldIndicatorTemplate = () => {}; } willUpdate(changedProperties) { diff --git a/studio/test/editors/merch-card-editor.test.html b/studio/test/editors/merch-card-editor.test.html index 077134d1f..27badb5f9 100644 --- a/studio/test/editors/merch-card-editor.test.html +++ b/studio/test/editors/merch-card-editor.test.html @@ -1095,65 +1095,68 @@ }); }); - it('adds quantity to variation and removes it via override indicator', async () => { + it('update quantity selection value and then rollback to the settings value', async () => { await setupTestEnvironment(); - const qsDiv = editor.querySelector('sp-field-group#quantitySelect div#quantitySelector'); - expect(qsDiv.style.display).to.equal('none'); + const field = editor.querySelector('#quantity-select-settings-field'); + const toggle = editor.querySelector('#quantity-select-settings-field-toggle'); + const qsTitleEl = field + .querySelector('quantity-select-field') + .shadowRoot.querySelector('#quantity-selector-title'); - const qsCheckboxEl = editor.querySelector('sp-field-group#quantitySelect sp-checkbox'); - expect(qsCheckboxEl.closest('sp-field-group').querySelector('.field-status-indicator a')).to.not.exist; - qsCheckboxEl.checked = true; - qsCheckboxEl.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true })); - expect(qsDiv.style.display).to.equal('block'); + expect(toggle.checked).to.be.true; + expect(qsTitleEl.value).to.equal('Select quantity'); - const qsTitleEl = qsDiv - .querySelector('quantity-select-field') - .shadowRoot.querySelector('sp-textfield#quantity-selector-title'); - const qsStartEl = qsDiv - .querySelector('quantity-select-field') - .shadowRoot.querySelector('sp-textfield#quantity-selector-start'); - const qsStepEl = qsDiv + const settingOverrideIndicator1 = field .querySelector('quantity-select-field') - .shadowRoot.querySelector('sp-textfield#quantity-selector-step'); + .shadowRoot.querySelector('.setting-override-indicator'); + expect(settingOverrideIndicator1).to.not.exist; qsTitleEl.value = 'QS'; qsTitleEl.dispatchEvent(new CustomEvent('input', { bubbles: true, composed: true })); - qsStartEl.value = '3'; - qsStartEl.dispatchEvent(new CustomEvent('input', { bubbles: true, composed: true })); - qsStepEl.value = '2'; - qsStepEl.dispatchEvent(new CustomEvent('input', { bubbles: true, composed: true })); await editor.updateComplete; - let titleOverrideEl = qsTitleEl.closest('sp-field-group').querySelector('.field-status-indicator a'); - expect(titleOverrideEl).to.exist; - let startOverrideEl = qsStartEl.closest('sp-field-group').querySelector('.field-status-indicator a'); - expect(startOverrideEl).to.exist; - let stepOverrideEl = qsStepEl.closest('sp-field-group').querySelector('.field-status-indicator a'); - expect(stepOverrideEl).to.exist; - let qsOverrideEl = qsCheckboxEl.closest('sp-field-group').querySelector('.field-status-indicator a'); - expect(qsOverrideEl).to.exist; + const settingOverrideIndicator2 = field + .querySelector('quantity-select-field') + .shadowRoot.querySelector('.setting-override-indicator'); + expect(settingOverrideIndicator2).to.exist; - titleOverrideEl.click(); - startOverrideEl.click(); - stepOverrideEl.click(); + settingOverrideIndicator2.click(); - await editor.updateComplete; + await delay(200); + + const qsTitleEl2 = field + .querySelector('quantity-select-field') + .shadowRoot.querySelector('#quantity-selector-title'); + expect(qsTitleEl.value).to.equal('Select quantity'); - titleOverrideEl = qsTitleEl.closest('sp-field-group').querySelector('.field-status-indicator a'); - expect(titleOverrideEl).to.not.exist; - startOverrideEl = qsStartEl.closest('sp-field-group').querySelector('.field-status-indicator a'); - expect(startOverrideEl).to.not.exist; - stepOverrideEl = qsStepEl.closest('sp-field-group').querySelector('.field-status-indicator a'); - expect(stepOverrideEl).to.not.exist; + const settingOverrideIndicator3 = field + .querySelector('quantity-select-field') + .shadowRoot.querySelector('.setting-override-indicator'); + expect(settingOverrideIndicator3).to.not.exist; + + const qsStartl = field + .querySelector('quantity-select-field') + .shadowRoot.querySelector('#quantity-selector-start'); + expect(qsStartl.value).to.equal('1'); + + qsStartl.value = '2'; + qsStartl.dispatchEvent(new CustomEvent('input', { bubbles: true, composed: true })); - qsOverrideEl.click(); await editor.updateComplete; - qsOverrideEl = qsCheckboxEl.closest('sp-field-group').querySelector('.field-status-indicator a'); - expect(qsOverrideEl).to.not.exist; - expect(qsDiv.style.display).to.equal('none'); + const settingOverrideIndicatorMain = field.querySelector('.setting-override-indicator'); + expect(settingOverrideIndicatorMain).to.exist; + + settingOverrideIndicatorMain.click(); + + await delay(200); + + const qsStartl2 = field + .querySelector('quantity-select-field') + .shadowRoot.querySelector('#quantity-selector-start'); + expect(qsStartl2.value).to.equal('1'); }); describe('getWhatsIncludedProps', () => { From 00383385eff93ec54613db17d5b5bf83df9e0084 Mon Sep 17 00:00:00 2001 From: Bozo Jovicic Date: Tue, 14 Apr 2026 17:28:45 +0200 Subject: [PATCH 12/17] MWPW-189463 MAS Studio: Quantity selector variation --- studio/src/editors/merch-card-editor.js | 11 +++--- .../fields/quantity-select-settings-field.js | 34 ++++++++----------- 2 files changed, 18 insertions(+), 27 deletions(-) diff --git a/studio/src/editors/merch-card-editor.js b/studio/src/editors/merch-card-editor.js index 048436330..6a4f1fdd4 100644 --- a/studio/src/editors/merch-card-editor.js +++ b/studio/src/editors/merch-card-editor.js @@ -1443,8 +1443,9 @@ class MerchCardEditor extends LitElement { : this.renderSettingOverrideIndicator('quantitySelect')} .fieldIndicatorTemplate=${this.renderQuantitySelectSettingOverrideIndicator} value="${this.getEffectiveSettingValue(QUANTITY_MODEL)}" - settingsDefaults="${this.globalSettingsDefaults[QUANTITY_MODEL]}" - @input="${this.#handleFragmentUpdate}" + settingsDefaults="${this.globalSettingsDefaults[QUANTITY_MODEL] === '' + ? '' + : this.globalSettingsDefaults[QUANTITY_MODEL]}" .handleQuantityFieldChange=${this.#handleQuantityFieldChange} > @@ -1991,11 +1992,7 @@ class MerchCardEditor extends LitElement { min: this.#getQuantitySelectValue(component, 'min', parentValues, currentValues), step: this.#getQuantitySelectValue(component, 'step', parentValues, currentValues), }); - if (parentHtml === html) { - this.fragmentStore.updateField(QUANTITY_MODEL, ['']); - } else { - this.fragmentStore.updateField(QUANTITY_MODEL, [html]); - } + this.fragmentStore.updateField(QUANTITY_MODEL, [html]); this.quantitySelectorValues = html; showToast('Field restored to parent value', 'positive'); } diff --git a/studio/src/fields/quantity-select-settings-field.js b/studio/src/fields/quantity-select-settings-field.js index 406ee2007..287c1829a 100644 --- a/studio/src/fields/quantity-select-settings-field.js +++ b/studio/src/fields/quantity-select-settings-field.js @@ -3,6 +3,7 @@ import { EVENT_INPUT } from '../constants.js'; import { QUANTITY_SELECT_TAG } from '../common/fields/quantity-select.js'; const QUANTITY_EMPTY = `<${QUANTITY_SELECT_TAG}/>`; +const QUANTITY_NOT_EMPTY = `<${QUANTITY_SELECT_TAG} title="" min="1" max="10" step="1">`; export class QuantitySelectField extends LitElement { static properties = { @@ -10,7 +11,6 @@ export class QuantitySelectField extends LitElement { label: { type: String }, value: { type: String }, settingsDefaults: { type: String }, - checked: { type: Boolean, state: true }, indicatorTemplate: { attribute: false }, fieldIndicatorTemplate: { attribute: false }, handleQuantityFieldChange: { type: Function, attribute: false }, @@ -23,7 +23,6 @@ export class QuantitySelectField extends LitElement { this.value = ''; this.settingsDefaults = ''; this.disabled = false; - this.checked = false; this.indicatorTemplate = nothing; this.fieldIndicatorTemplate = nothing; this.handleQuantityFieldChange = () => {}; @@ -33,23 +32,14 @@ export class QuantitySelectField extends LitElement { return this; } - updated(changedProperties) { - if (changedProperties.has('value')) { - this.checked = !!this.value && this.value !== QUANTITY_EMPTY; - } - } - #handleToggle(e) { - this.checked = e.target.checked; - if (!this.checked) { - this.handleQuantityFieldChange({ - detail: { - value: QUANTITY_EMPTY, - }, - }); - } else { - this.dispatchInputEvent(); - } + this.value = e.target.checked ? QUANTITY_NOT_EMPTY : QUANTITY_EMPTY; + this.handleQuantityFieldChange({ + detail: { + value: this.value, + }, + }); + this.dispatchInputEvent(); } dispatchInputEvent() { @@ -61,8 +51,12 @@ export class QuantitySelectField extends LitElement { this.dispatchEvent(inputEvent); } + #isChecked() { + return !!this.value && this.value !== QUANTITY_EMPTY; + } + get fields() { - if (!this.checked) return nothing; + if (!this.#isChecked()) return nothing; return html`
- ${this.label} ${this.indicatorTemplate} From 29011ffd8726f1b15e8ba22e0307b139cbdee107 Mon Sep 17 00:00:00 2001 From: Bozo Jovicic Date: Wed, 15 Apr 2026 12:44:48 +0200 Subject: [PATCH 13/17] MWPW-189463 MAS Studio: Quantity selector variation --- studio/src/editors/merch-card-editor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/studio/src/editors/merch-card-editor.js b/studio/src/editors/merch-card-editor.js index 6a4f1fdd4..cdcb81c6a 100644 --- a/studio/src/editors/merch-card-editor.js +++ b/studio/src/editors/merch-card-editor.js @@ -1444,7 +1444,7 @@ class MerchCardEditor extends LitElement { .fieldIndicatorTemplate=${this.renderQuantitySelectSettingOverrideIndicator} value="${this.getEffectiveSettingValue(QUANTITY_MODEL)}" settingsDefaults="${this.globalSettingsDefaults[QUANTITY_MODEL] === '' - ? '' + ? QUANTITY_EMPTY : this.globalSettingsDefaults[QUANTITY_MODEL]}" .handleQuantityFieldChange=${this.#handleQuantityFieldChange} > From 54f16e0ff5a5d97c31fe2e4de701cbed6605626d Mon Sep 17 00:00:00 2001 From: Bozo Jovicic Date: Wed, 15 Apr 2026 17:08:03 +0200 Subject: [PATCH 14/17] MWPW-189463 MAS Studio: Quantity selector variation --- studio/src/editors/merch-card-editor.js | 9 --------- studio/src/fields/quantity-select-settings-field.js | 5 ++--- studio/test/editors/merch-card-editor.test.html | 2 +- 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/studio/src/editors/merch-card-editor.js b/studio/src/editors/merch-card-editor.js index cdcb81c6a..ae90991d0 100644 --- a/studio/src/editors/merch-card-editor.js +++ b/studio/src/editors/merch-card-editor.js @@ -1963,15 +1963,6 @@ class MerchCardEditor extends LitElement { return ownValue === parentValue ? 'inherited' : 'overridden'; } - renderQuantityOverrideIndicator() { - const qsOpeningTag = `<${QUANTITY_SELECT_TAG} `; - const parentHtml = this.localeDefaultFragment?.getFieldValue(QUANTITY_MODEL, 0) || ''; - const ownHtml = this.fragment?.getFieldValue(QUANTITY_MODEL, 0) || ''; - if (!ownHtml) return nothing; - if (ownHtml.startsWith(qsOpeningTag) && parentHtml.startsWith(qsOpeningTag)) return nothing; - return null; - } - #getQuantitySelectValue(component, field, parentValues, currentValues) { return !component || component === field ? parentValues[field] : currentValues[field]; } diff --git a/studio/src/fields/quantity-select-settings-field.js b/studio/src/fields/quantity-select-settings-field.js index 287c1829a..e3cd7dc8e 100644 --- a/studio/src/fields/quantity-select-settings-field.js +++ b/studio/src/fields/quantity-select-settings-field.js @@ -5,7 +5,7 @@ import { QUANTITY_SELECT_TAG } from '../common/fields/quantity-select.js'; const QUANTITY_EMPTY = `<${QUANTITY_SELECT_TAG}/>`; const QUANTITY_NOT_EMPTY = `<${QUANTITY_SELECT_TAG} title="" min="1" max="10" step="1">`; -export class QuantitySelectField extends LitElement { +export class QuantitySelectSettingsField extends LitElement { static properties = { id: { type: String }, label: { type: String }, @@ -22,7 +22,6 @@ export class QuantitySelectField extends LitElement { this.label = ''; this.value = ''; this.settingsDefaults = ''; - this.disabled = false; this.indicatorTemplate = nothing; this.fieldIndicatorTemplate = nothing; this.handleQuantityFieldChange = () => {}; @@ -82,4 +81,4 @@ export class QuantitySelectField extends LitElement { } } -customElements.define('quantity-select-settings-field', QuantitySelectField); +customElements.define('quantity-select-settings-field', QuantitySelectSettingsField); diff --git a/studio/test/editors/merch-card-editor.test.html b/studio/test/editors/merch-card-editor.test.html index ddbef8e5b..61de99586 100644 --- a/studio/test/editors/merch-card-editor.test.html +++ b/studio/test/editors/merch-card-editor.test.html @@ -1129,7 +1129,7 @@ const qsTitleEl2 = field .querySelector('quantity-select-field') .shadowRoot.querySelector('#quantity-selector-title'); - expect(qsTitleEl.value).to.equal('Select quantity'); + expect(qsTitleEl2.value).to.equal('Select quantity'); const settingOverrideIndicator3 = field .querySelector('quantity-select-field') From 001dd0300ae16eb0e7817bbbaf3f2e6ae31cf113 Mon Sep 17 00:00:00 2001 From: Bozo Jovicic Date: Fri, 17 Apr 2026 12:08:58 +0200 Subject: [PATCH 15/17] MWPW-189463 MAS Studio: Quantity selector variation - Nala --- .../specs/individuals_edit_and_discard.spec.js | 2 +- .../individuals/specs/individuals_save.spec.js | 2 +- .../tests/individuals_edit_and_discard.test.js | 16 ++++++++++------ .../individuals/tests/individuals_save.test.js | 4 ++-- nala/studio/editor.page.js | 4 ++-- .../tests/fragment_editor.test.js | 1 - 6 files changed, 16 insertions(+), 13 deletions(-) diff --git a/nala/studio/acom/plans/individuals/specs/individuals_edit_and_discard.spec.js b/nala/studio/acom/plans/individuals/specs/individuals_edit_and_discard.spec.js index f7619f939..a8165bac3 100644 --- a/nala/studio/acom/plans/individuals/specs/individuals_edit_and_discard.spec.js +++ b/nala/studio/acom/plans/individuals/specs/individuals_edit_and_discard.spec.js @@ -178,7 +178,7 @@ export default { name: '@studio-plans-individuals-edit-discard-quantity-selector', path: '/studio.html', data: { - cardid: '45e50a68-9bd7-4fc2-9665-12f39140a1be', + cardid: 'e8364315-f3d0-45c3-ab1d-8fc6455f1fe2', startValue: { original: '3', updated: '2', diff --git a/nala/studio/acom/plans/individuals/specs/individuals_save.spec.js b/nala/studio/acom/plans/individuals/specs/individuals_save.spec.js index 92016dfd6..d646e16d2 100644 --- a/nala/studio/acom/plans/individuals/specs/individuals_save.spec.js +++ b/nala/studio/acom/plans/individuals/specs/individuals_save.spec.js @@ -87,7 +87,7 @@ export default { name: '@studio-plans-individuals-save-edited-quantity-selector', path: '/studio.html', data: { - cardid: '6f189be0-d64b-468f-b340-92888206cce8', + cardid: 'e8364315-f3d0-45c3-ab1d-8fc6455f1fe2', }, browserParams: '#page=fragment-editor&path=nala&fragmentId=', tags: '@mas-studio @acom @acom-save @acom-plans @acom-plans-save @acom-plans-individuals @acom-plans-individuals-save', diff --git a/nala/studio/acom/plans/individuals/tests/individuals_edit_and_discard.test.js b/nala/studio/acom/plans/individuals/tests/individuals_edit_and_discard.test.js index 2796caae6..ed1baa291 100644 --- a/nala/studio/acom/plans/individuals/tests/individuals_edit_and_discard.test.js +++ b/nala/studio/acom/plans/individuals/tests/individuals_edit_and_discard.test.js @@ -651,7 +651,7 @@ test.describe('M@S Studio ACOM Plans Individuals card test suite', () => { await page.waitForLoadState('domcontentloaded'); await expect(await editor.panel).toBeVisible(); await expect(await individualsCard).toBeVisible(); - await expect(await individualsCard).toHaveAttribute('variant', 'plans'); + await expect(await individualsCard).toHaveAttribute('variant', 'plans-education'); }); await test.step('step-2: Toggle quantity selector', async () => { @@ -677,21 +677,25 @@ test.describe('M@S Studio ACOM Plans Individuals card test suite', () => { await expect(await individualsCard.locator(plans.cardQuantitySelector)).toBeVisible(); }); - await test.step('step-6: Edit quantity selector start value', async () => { + await test.step('step-6: Restore values from settings', async () => { + await editor.quantitySelectorFields.locator('.setting-override-indicator').first().click(); + }); + + await test.step('step-7: Edit quantity selector start value', async () => { await expect(await editor.quantitySelectorStart).toBeVisible(); await expect(await editor.quantitySelectorStart).toHaveValue(data.startValue.original); await editor.quantitySelectorStart.fill(data.startValue.updated); await expect(await editor.quantitySelectorStart).toHaveValue(data.startValue.updated); }); - await test.step('step-7: Edit quantity selector step value', async () => { + await test.step('step-8: Edit quantity selector step value', async () => { await expect(await editor.quantitySelectorStep).toBeVisible(); await expect(await editor.quantitySelectorStep).toHaveValue(data.stepValue.original); await editor.quantitySelectorStep.fill(data.stepValue.updated); await expect(await editor.quantitySelectorStep).toHaveValue(data.stepValue.updated); }); - await test.step('step-8: Validate quantity selector step value on card', async () => { + await test.step('step-9: Validate quantity selector step value on card', async () => { await expect(await individualsCard.locator(plans.cardQuantitySelector)).toHaveAttribute( 'step', data.stepValue.updated, @@ -709,11 +713,11 @@ test.describe('M@S Studio ACOM Plans Individuals card test suite', () => { ); }); - await test.step('step-9: Close the editor and verify discard is triggered', async () => { + await test.step('step-10: Close the editor and verify discard is triggered', async () => { await studio.discardEditorChanges(editor); }); - await test.step('step-10: Verify quantity selector is unchanged', async () => { + await test.step('step-11: Verify quantity selector is unchanged', async () => { await expect(await individualsCard.locator(plans.cardQuantitySelector)).toBeVisible(); }); }); diff --git a/nala/studio/acom/plans/individuals/tests/individuals_save.test.js b/nala/studio/acom/plans/individuals/tests/individuals_save.test.js index 5ffe1b781..e783382d9 100644 --- a/nala/studio/acom/plans/individuals/tests/individuals_save.test.js +++ b/nala/studio/acom/plans/individuals/tests/individuals_save.test.js @@ -422,8 +422,8 @@ test.describe('M@S Studio ACOM Plans Individuals card test suite', () => { }); await test.step('step-4: Verify quantity selector change is saved', async () => { - await expect(await editor.quantitySelectorCheckbox).toBeChecked(); - await expect(await clonedCard.locator(plans.cardQuantitySelector)).toBeVisible(); + await expect(await editor.quantitySelectorCheckbox).not.toBeChecked(); + await expect(await clonedCard.locator(plans.cardQuantitySelector)).not.toBeVisible(); }); }); diff --git a/nala/studio/editor.page.js b/nala/studio/editor.page.js index ae13df0d9..a9a268374 100644 --- a/nala/studio/editor.page.js +++ b/nala/studio/editor.page.js @@ -57,8 +57,8 @@ export default class EditorPage { this.promoCode = this.panel.locator('#promo-code input'); this.promoCodeFieldGroup = this.panel.locator('sp-field-group#promoCode'); - this.quantitySelectorCheckbox = this.panel.locator('#quantitySelect sp-checkbox input'); - this.quantitySelectorFields = this.panel.locator('#quantitySelector quantity-select-field'); + this.quantitySelectorCheckbox = this.panel.locator('#quantity-select-settings-field-toggle input'); + this.quantitySelectorFields = this.panel.locator('#quantitySelect quantity-select-settings-field'); this.quantitySelectorTitle = this.quantitySelectorFields.locator('#quantity-selector-title input'); this.quantitySelectorStart = this.quantitySelectorFields.locator('#quantity-selector-start input'); this.quantitySelectorStep = this.quantitySelectorFields.locator('#quantity-selector-step input'); diff --git a/nala/studio/fragment-editor/tests/fragment_editor.test.js b/nala/studio/fragment-editor/tests/fragment_editor.test.js index 689c8a710..15a7ed525 100644 --- a/nala/studio/fragment-editor/tests/fragment_editor.test.js +++ b/nala/studio/fragment-editor/tests/fragment_editor.test.js @@ -220,7 +220,6 @@ test.describe('M@S Studio Fragment Editor Locale test suite', () => { await expect(await editor.promoText).toBeVisible(); await expect(await editor.callout).toBeVisible(); await expect(await editor.addOnToggle).toBeVisible(); - await expect(await editor.quantitySelectorCheckbox).toBeVisible(); await expect(await editor.OSI).toBeVisible(); }); }); From ad960d271b2e7609a6d92b79945f8abddedc3dbe Mon Sep 17 00:00:00 2001 From: Bozo Jovicic Date: Fri, 17 Apr 2026 12:16:24 +0200 Subject: [PATCH 16/17] MWPW-189463 MAS Studio: Quantity selector variation - formatting --- .../individuals/tests/individuals_edit_and_discard.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nala/studio/acom/plans/individuals/tests/individuals_edit_and_discard.test.js b/nala/studio/acom/plans/individuals/tests/individuals_edit_and_discard.test.js index ed1baa291..8a304c4ea 100644 --- a/nala/studio/acom/plans/individuals/tests/individuals_edit_and_discard.test.js +++ b/nala/studio/acom/plans/individuals/tests/individuals_edit_and_discard.test.js @@ -679,7 +679,7 @@ test.describe('M@S Studio ACOM Plans Individuals card test suite', () => { await test.step('step-6: Restore values from settings', async () => { await editor.quantitySelectorFields.locator('.setting-override-indicator').first().click(); - }); + }); await test.step('step-7: Edit quantity selector start value', async () => { await expect(await editor.quantitySelectorStart).toBeVisible(); From 7f1e465e6a38dbefe133952a0433243397d093a2 Mon Sep 17 00:00:00 2001 From: Bozo Jovicic Date: Wed, 6 May 2026 20:21:24 +0200 Subject: [PATCH 17/17] Trigger Build