From 6362c19f2721eb04f517bba2f8882a4616462d7b Mon Sep 17 00:00:00 2001 From: Denys Fedotov Date: Mon, 2 Sep 2024 02:17:03 -0600 Subject: [PATCH 01/21] [MWPW-155566] [MEP] Allow relevant actions in MEP to use text and HTML instead of just fragments (#2683) * getSelectedElement - V2 * getSelectedElement - V2 * getSelectedElement - V2 * getSelectedElement - V2 * getSelectedElement - V2 * added test coverage for action * cleanup * added comments * comments * comments * fixes erroring but still has failure * rooEl fix * fixed tests * added modifier * eslint * lint * removed reduncant try catch * Add target analytics for update action * removed test-results and added to .gitignore * reverted a deletion of a prependtosection validation code * removed comments * updated validation for appendtosdection * removed comments and eslint escapes * change modifier to an array that is not a separate column * add highight for update * add timeout to merch-card highlight * remove setTimeout and move preview.js call from loadPostLCP to loadDeferred * update unit test * remove update to git ignore * add temp console message for easy QA * MWPW-155566 [MEP] Changing from a new action to just expanding power of existing actions (#2764) * stash * use replace instead of update, allow html for create commands, update simplified selectors * streamline * remove export on MILO_BLOCKS * change prependToSection and appendToSection to just prepend and append * remove unused function param * change from includes to === * remove use of .parentElement * move spoof param test so you can reload the other tests * account for number used after dot notation * add test to insertbefore and insert after href * more coverage * more coverage * hopefully final coverage * remove console * rename checkSelectorType to getSelectorType * move parts of createContent into sub functions * small big fix * update modifySelectorTerm function per suggestion * update modifyNonFragmentSelector per suggestion * update to getSelectedElement * change equal to not equal * fix end number update * codecov * no longer require fragments be in URL for fragments because of gnav * call getModifiers in modifyNonFragmentSelector instead * require space before first flag * update unit tests to need space before flags * handle adding flags to fragment selectors * revert for demo * put back * remove utils update so it does not conflict --------- Co-authored-by: Denys Fedotov Co-authored-by: vgoodric Co-authored-by: markpadbe Co-authored-by: Vivian A Goodrich <101133187+vgoodric@users.noreply.github.com> --- .../personalization/personalization.js | 300 ++++++++++-------- libs/features/personalization/preview.js | 1 + test/features/personalization/actions.test.js | 36 ++- .../actionsTargetManifestId.test.js | 24 ++ .../mocks/actions/manifestInsertAfter.json | 22 ++ .../mocks/actions/manifestInsertBefore.json | 11 + .../mocks/actions/manifestTargetUpdate.json | 65 ++++ .../mocks/actions/manifestUpdate.json | 74 +++++ .../mocks/manifestSectionBlock.json | 11 +- .../mocks/personalization.html | 14 +- .../modifyNonFragmentSelector.test.js | 119 +++++++ .../personalization-params.test.js | 50 +++ .../personalization/personalization.test.js | 43 +-- 13 files changed, 602 insertions(+), 168 deletions(-) create mode 100644 test/features/personalization/mocks/actions/manifestTargetUpdate.json create mode 100644 test/features/personalization/mocks/actions/manifestUpdate.json create mode 100644 test/features/personalization/modifyNonFragmentSelector.test.js create mode 100644 test/features/personalization/personalization-params.test.js diff --git a/libs/features/personalization/personalization.js b/libs/features/personalization/personalization.js index 4586cc158b..df0f282ce8 100644 --- a/libs/features/personalization/personalization.js +++ b/libs/features/personalization/personalization.js @@ -93,46 +93,90 @@ const isInLcpSection = (el) => { return lcpSection === el || lcpSection?.contains(el); }; -export const createFrag = (el, url, manifestId, targetManifestId) => { - let href = url; +const GLOBAL_CMDS = [ + 'insertscript', + 'replacepage', + 'updatemetadata', + 'useblockcode', +]; + +const CREATE_CMDS = { + insertafter: 'afterend', + insertbefore: 'beforebegin', + prepend: 'afterbegin', + append: 'beforeend', +}; + +const COMMANDS_KEYS = { + remove: 'remove', + replace: 'replace', +}; + +function addIds(el, manifestId, targetManifestId) { + if (manifestId) el.dataset.manifestId = manifestId; + if (targetManifestId) el.dataset.adobeTargetTestid = targetManifestId; +} + +function getSelectorType(selector) { + const sel = selector.toLowerCase().trim(); + if (sel.startsWith('/') || sel.startsWith('http')) return 'fragment'; + return 'other'; +} + +const getUpdatedHref = (el, content, action) => { + const href = el.getAttribute('href'); + if (action === 'insertafter' || action === 'append') return `${href}${content}`; + if (action === 'insertbefore' || action === 'prepend') return `${content}${href}`; + return content; +}; + +const createFrag = (el, action, content, manifestId, targetManifestId) => { + if (action === 'replace') el.classList.add(CLASS_EL_DELETE, CLASS_EL_REPLACE); + let href = content; try { - const { pathname, search, hash } = new URL(url); + const { pathname, search, hash } = new URL(content); href = `${pathname}${search}${hash}`; } catch { // ignore } - const a = createTag('a', { href }, url); - if (manifestId) a.dataset.manifestId = manifestId; - if (targetManifestId) a.dataset.adobeTargetTestid = targetManifestId; - let frag = createTag('p', undefined, a); + const a = createTag('a', { href }, content); + addIds(a, manifestId, targetManifestId); + const frag = createTag('p', undefined, a); const isDelayedModalAnchor = /#.*delay=/.test(href); if (isDelayedModalAnchor) frag.classList.add('hide-block'); - const isSection = el.parentElement.nodeName === 'MAIN'; - if (isSection) { - frag = createTag('div', undefined, frag); - } if (isInLcpSection(el)) { loadLink(`${localizeLink(a.href)}.plain.html`, { as: 'fetch', crossorigin: 'anonymous', rel: 'preload' }); } return frag; }; -const GLOBAL_CMDS = [ - 'insertscript', - 'replacepage', - 'updatemetadata', - 'useblockcode', -]; +export const createContent = (el, content, manifestId, targetManifestId, action, modifiers) => { + if (action === 'replace') { + addIds(el, manifestId, targetManifestId); + } + if (el?.nodeName === 'A' && modifiers?.includes('href')) { + el.setAttribute('href', getUpdatedHref(el, content, action)); + addIds(el, manifestId, targetManifestId); + return el; + } + if (getSelectorType(content) !== 'fragment') { + if (action === 'replace') { + el.innerHTML = content; + return el; + } + const container = createTag('div', {}, content); + addIds(container, manifestId, targetManifestId); + return container; + } -const CREATE_CMDS = { - insertafter: 'afterend', - insertbefore: 'beforebegin', - prependtosection: 'afterbegin', - appendtosection: 'beforeend', + const frag = createFrag(el, action, content, manifestId, targetManifestId); + addIds(frag, manifestId, targetManifestId); + if (el?.parentElement.nodeName !== 'MAIN') return frag; + return createTag('div', undefined, frag); }; const COMMANDS = { - remove: (el, target, manifestId) => { + [COMMANDS_KEYS.remove]: ({ el, target, manifestId }) => { if (target === 'false') return; if (manifestId) { el.dataset.removedManifestId = manifestId; @@ -140,17 +184,15 @@ const COMMANDS = { } el.classList.add(CLASS_EL_DELETE); }, - replace: (el, target, manifestId, targetManifestId) => { + [COMMANDS_KEYS.replace]: ({ el, target, modifiers, manifestId, targetManifestId }) => { if (!el || el.classList.contains(CLASS_EL_REPLACE)) return; - el.insertAdjacentElement('beforebegin', createFrag(el, target, manifestId, targetManifestId)); - el.classList.add(CLASS_EL_DELETE, CLASS_EL_REPLACE); + el.insertAdjacentElement( + 'beforebegin', + createContent(el, target, manifestId, targetManifestId, 'replace', modifiers), + ); }, }; -function checkSelectorType(selector) { - return selector?.startsWith('/') || selector?.startsWith('http') ? 'fragment' : 'css'; -} - const fetchData = async (url, type = DATA_TYPE.JSON) => { try { const resp = await fetch(normalizePath(url)); @@ -240,8 +282,7 @@ const setMetadata = (metadata) => { const propName = selector.startsWith('og:') ? 'property' : 'name'; let metaEl = document.querySelector(`meta[${propName}="${selector}"]`); if (!metaEl) { - metaEl = document.createElement('meta'); - metaEl.setAttribute(propName, selector); + metaEl = createTag('meta', { [propName]: selector }); document.head.append(metaEl); } metaEl.setAttribute('content', val); @@ -259,13 +300,6 @@ function normalizeKeys(obj) { }, {}); } -const getDivInTargetedCell = (tableCell) => { - tableCell.replaceChildren(); - const div = document.createElement('div'); - tableCell.appendChild(div); - return div; -}; - const querySelector = (el, selector, all = false) => { try { return all ? el.querySelectorAll(selector) : el.querySelector(selector); @@ -275,18 +309,6 @@ const querySelector = (el, selector, all = false) => { return null; } }; - -function getTrailingNumber(s) { - const match = s.match(/\d+$/); - return match ? parseInt(match[0], 10) : null; -} - -function getSection(rootEl, idx) { - return rootEl === document - ? document.querySelector(`body > main > div:nth-child(${idx})`) - : rootEl.querySelector(`:scope > div:nth-child(${idx})`); -} - function registerInBlockActions(cmd, manifestId, targetManifestId) { const { action, target, selector } = cmd; const command = { action, target, manifestId, targetManifestId }; @@ -302,7 +324,7 @@ function registerInBlockActions(cmd, manifestId, targetManifestId) { if (blockAndSelector.length > 1) { blockSelector = blockAndSelector.slice(1).join(' '); command.selector = blockSelector; - if (checkSelectorType(blockSelector) === 'fragment') { + if (getSelectorType(blockSelector) === 'fragment') { config.mep.inBlock[blockName].fragments ??= {}; const { fragments } = config.mep.inBlock[blockName]; delete command.selector; @@ -327,70 +349,88 @@ function registerInBlockActions(cmd, manifestId, targetManifestId) { config.mep.inBlock[blockName].commands.push(command); } -function getSelectedElement(selector, action, rootEl) { - if (!selector) return null; - if ((action.includes('appendtosection') || action.includes('prependtosection'))) { - if (!selector.includes('section')) return null; - const section = selector.trim().replace('section', ''); - if (section !== '' && Number.isNaN(section)) return null; +const updateEndNumber = (endNumber, term) => (endNumber + ? term.replace(endNumber, `:nth-child(${endNumber})`) + : term); +function modifySelectorTerm(termParam) { + let term = termParam; + const specificSelectors = { + section: 'main > div', + 'primary-cta': 'p strong a', + 'secondary-cta': 'p em a', + 'action-area': 'p:has(em a, strong a)', + }; + const otherSelectors = ['row', 'col']; + const htmlEls = ['main', 'div', 'a', 'p', 'strong', 'em', 'picture', 'source', 'img', 'h']; + const startTextMatch = term.match(/^[a-zA-Z/./-]*/); + const startText = startTextMatch ? startTextMatch[0].toLowerCase() : ''; + const endNumberMatch = term.match(/[0-9]*$/); + const endNumber = endNumberMatch ? endNumberMatch[0] : ''; + if (!startText || htmlEls.includes(startText)) return term; + if (otherSelectors.includes(startText)) { + term = term.replace(startText, '> div'); + term = updateEndNumber(endNumber, term); + return term; } - if (checkSelectorType(selector) === 'fragment') { - try { - const fragment = document.querySelector(`a[href*="${normalizePath(selector, false)}"], a[href*="${normalizePath(selector, true)}"]`); - if (fragment) return fragment.parentNode; - return null; - } catch (e) { - return null; - } + if (Object.keys(specificSelectors).includes(startText)) { + term = term.replace(startText, specificSelectors[startText]); + term = updateEndNumber(endNumber, term); + return term; } - let selectedEl; - if (selector.includes('.') || !['section', 'block', 'row'].some((s) => selector.includes(s))) { - selectedEl = querySelector(rootEl, selector); - if (selectedEl) return selectedEl; + if (!startText.startsWith('.')) term = `.${term}`; + if (endNumber) { + term = term.replace(endNumber, ''); + term = `${term}:nth-child(${endNumber} of ${term})`; } - - const terms = selector.split(/\s+/); - - let section = null; - if (terms[0]?.startsWith('section')) { - const sectionIdx = getTrailingNumber(terms[0]) || 1; - section = getSection(rootEl, sectionIdx); - terms.shift(); + return term; +} +function getModifiers(selector) { + let sel = selector; + const modifiers = []; + const flags = sel.split(/\s+#_/); + if (flags.length) { + sel = flags.shift(); + flags.forEach((flag) => { + flag.split(/_|#_/).forEach((mod) => modifiers.push(mod.toLowerCase().trim())); + }); } + return { sel, modifiers }; +} +export function modifyNonFragmentSelector(selector) { + const { sel, modifiers } = getModifiers(selector); + return { + modifiedSelector: sel + .split('>').join(' > ') + .split(',').join(' , ') + .replaceAll(/main\s*>?\s*(section\d*)/gi, '$1') + .split(/\s+/) + .map(modifySelectorTerm) + .join(' ') + .trim(), + modifiers, + }; +} - if (terms.length) { - const blockStr = terms.shift(); - if (blockStr.includes('.')) { - selectedEl = querySelector(section || rootEl, blockStr); - } else { - const blockIndex = getTrailingNumber(blockStr) || 1; - const blockName = blockStr.replace(`${blockIndex}`, ''); - if (blockName === 'block') { - if (!section) section = getSection(rootEl, 1); - selectedEl = querySelector(section, `:scope > div:nth-of-type(${blockIndex})`); - } else { - selectedEl = querySelector(section || rootEl, `.${blockName}`, true)?.[blockIndex - 1]; - } - } - } else if (section) { - return section; - } - - if (terms.length) { - // find targeted table cell in rowX colY format - const rowColMatch = /row(?\d+)\s+col(?\d+)/gm.exec(terms.join(' ')); - if (rowColMatch) { - const { row, col } = rowColMatch.groups; - const tableCell = querySelector(selectedEl, `:nth-child(${row}) > :nth-child(${col})`); - if (!tableCell) return null; - return getDivInTargetedCell(tableCell); +function getSelectedElement({ selector: sel, rootEl }) { + const selector = sel.trim(); + if (!selector) return {}; + + if (getSelectorType(selector) === 'fragment') { + try { + const fragment = document.querySelector( + `a[href*="${normalizePath(selector, false)}"], a[href*="${normalizePath(selector, true)}"]`, + ); + if (fragment) return { el: fragment.parentNode }; + return {}; + } catch (e) { + /* c8 ignore next */ + return {}; } } - - return selectedEl; + const { modifiedSelector, modifiers } = modifyNonFragmentSelector(selector); + return { el: querySelector(rootEl || document, modifiedSelector), modifiers }; } - const addHash = (url, newHash) => { if (!newHash) return url; try { @@ -413,10 +453,10 @@ export const updateFragDataProps = (a, inline, sections, fragment) => { if (manifestId) setDataIdOnChildren(sections, 'manifestId', manifestId); if (adobeTargetTestid) setDataIdOnChildren(sections, 'adobeTargetTestid', adobeTargetTestid); } else { - if (manifestId) fragment.dataset.manifestId = manifestId; - if (adobeTargetTestid) fragment.dataset.adobeTargetTestid = adobeTargetTestid; + addIds(fragment, manifestId, adobeTargetTestid); } }; + export function handleCommands(commands, rootEl = document, forceInline = false) { commands.forEach((cmd) => { const { manifestId, targetManifestId, action, selector, target: trgt } = cmd; @@ -425,20 +465,20 @@ export function handleCommands(commands, rootEl = document, forceInline = false) registerInBlockActions(cmd, manifestId, targetManifestId); return; } + const { el, modifiers } = getSelectedElement({ selector, rootEl }); + + if (!el || (!(action in COMMANDS) && !(action in CREATE_CMDS))) return; if (action in COMMANDS) { - const el = getSelectedElement(selector, action, rootEl); - COMMANDS[action](el, target, manifestId, targetManifestId); - } else if (action in CREATE_CMDS) { - const el = getSelectedElement(selector, action, rootEl); - el?.insertAdjacentElement( - CREATE_CMDS[action], - createFrag(el, target, manifestId, targetManifestId), - ); - } else { - /* c8 ignore next 2 */ - console.log('Invalid command found: ', cmd); + COMMANDS[action]({ + el, target, manifestId, targetManifestId, action, modifiers, + }); + return; } + el?.insertAdjacentElement( + CREATE_CMDS[action], + createContent(el, target, manifestId, targetManifestId, action, modifiers), + ); }); } @@ -448,9 +488,11 @@ const getVariantInfo = (line, variantNames, variants, manifestPath, fTargetId) = let targetId = manifestId.replace('.json', ''); if (fTargetId) targetId = fTargetId; if (!config.mep?.preview) manifestId = false; - const action = line.action?.toLowerCase().replace('content', '').replace('fragment', ''); - const { selector } = line; + // retro support + const action = line.action?.toLowerCase() + .replace('content', '').replace('fragment', '').replace('tosection', ''); const pageFilter = line['page filter'] || line['page filter optional']; + const { selector } = line; if (pageFilter && !matchGlob(pageFilter, new URL(window.location).pathname)) return; @@ -465,14 +507,14 @@ const getVariantInfo = (line, variantNames, variants, manifestPath, fTargetId) = selector, pageFilter, target: line[vn], - selectorType: checkSelectorType(selector), + selectorType: getSelectorType(selector), manifestId, targetManifestId, }; if (action in COMMANDS && variantInfo.selectorType === 'fragment') { variants[vn].fragments.push({ - selector: normalizePath(variantInfo.selector), + selector: normalizePath(variantInfo.selector.split(' #_')[0]), val: normalizePath(line[vn]), action, manifestId, @@ -842,13 +884,12 @@ export function cleanAndSortManifestList(manifests) { export function handleFragmentCommand(command, a) { const { action, fragment, manifestId, targetManifestId } = command; - if (action === 'replace') { + if (action === COMMANDS_KEYS.replace) { a.href = fragment; - if (manifestId) a.dataset.manifestId = manifestId; - if (targetManifestId) a.dataset.adobeTargetTestid = targetManifestId; + addIds(a, manifestId, targetManifestId); return fragment; } - if (action === 'remove') { + if (action === COMMANDS_KEYS.remove) { if (manifestId) { a.parentElement.dataset.removedManifestId = manifestId; } else { @@ -885,8 +926,7 @@ export async function applyPers(manifests, postLCP = false) { if (config.mep.replacepage && !postLCP && main) { await replaceInner(config.mep.replacepage.val, main); const { manifestId, targetManifestId } = config.mep.replacepage; - if (manifestId) main.dataset.manifestId = manifestId; - if (targetManifestId) main.dataset.adobeTargetTestid = targetManifestId; + addIds(main, manifestId, targetManifestId); } if (!postLCP) handleCommands(config.mep.commands); diff --git a/libs/features/personalization/preview.js b/libs/features/personalization/preview.js index f88c0d4889..5c1d662324 100644 --- a/libs/features/personalization/preview.js +++ b/libs/features/personalization/preview.js @@ -290,6 +290,7 @@ function addHighlightData(manifests) { selectedVariant?.updatemetadata?.forEach(({ selector }) => { if (selector === 'gnav-source') updateManifestId('header, footer'); }); + // eslint-disable-next-line max-len document.querySelectorAll(`.section[class*="merch-cards"] .fragment[data-manifest-id="${manifestName}"] merch-card`) .forEach((el) => (el.dataset.manifestId = manifestName)); diff --git a/test/features/personalization/actions.test.js b/test/features/personalization/actions.test.js index fe9e935202..19057fd2eb 100644 --- a/test/features/personalization/actions.test.js +++ b/test/features/personalization/actions.test.js @@ -86,6 +86,8 @@ describe('insertAfter action', async () => { expect(document.querySelector('a[href="/fragments/insertafter"]')).to.be.null; expect(document.querySelector('a[href="/fragments/insertafterfragment"]')).to.be.null; + expect(document.querySelector('#insertafter').getAttribute('href')).to.equal('/my-page.html'); + expect(document.querySelector('#inserted-html')).to.be.null; await init(mepSettings); expect(getConfig().mep.commands[0].targetManifestId).to.equal(false); @@ -98,6 +100,8 @@ describe('insertAfter action', async () => { expect(fragment).to.not.be.null; expect(fragment.parentElement.previousElementSibling.querySelector('a[href="/fragments/insertaround"]')).to.exist; + expect(document.querySelector('#insertafter').getAttribute('href')).to.equal('/my-page.html#modal'); + expect(document.querySelector('#inserted-html')).to.not.be.null; }); }); @@ -109,6 +113,7 @@ describe('insertBefore action', async () => { setFetchResponse(manifestJson); expect(document.querySelector('a[href="/fragments/insertbefore"]')).to.be.null; + expect(document.querySelector('#insertbefore').getAttribute('href')).to.equal('/my-page.html'); await init(mepSettings); expect(getConfig().mep.commands[0].targetManifestId).to.equal(false); @@ -121,11 +126,12 @@ describe('insertBefore action', async () => { expect(fragment).to.not.be.null; expect(fragment.parentElement.nextElementSibling.querySelector('a[href="/fragments/insertaround"]')).to.exist; + expect(document.querySelector('#insertbefore').getAttribute('href')).to.equal('/de/my-page.html'); }); }); describe('prependToSection action', async () => { - it('appendToSection should add fragment to beginning of section', async () => { + it('prependToSection should add fragment to beginning of section', async () => { let manifestJson = await readFile({ path: './mocks/actions/manifestPrependToSection.json' }); manifestJson = JSON.parse(manifestJson); @@ -157,6 +163,34 @@ describe('appendToSection action', async () => { }); }); +describe('replace action with html/text instead of fragment', () => { + it('should replace marquee content', async () => { + document.body.innerHTML = await readFile({ path: './mocks/personalization.html' }); + let manifestJson = await readFile({ path: './mocks/actions/manifestUpdate.json' }); + manifestJson = JSON.parse(manifestJson); + setFetchResponse(manifestJson); + + const primaryCTA = document.querySelector('.marquee p strong a'); + const secondaryCTA = document.querySelector('.marquee p a'); + const header = document.querySelector('.marquee h2'); + const actionArea = document.querySelector('main div:nth-child(5) .marquee p:has(em a, strong a)'); + + expect(header.innerText).to.not.equal('updated text'); + expect(primaryCTA.innerText).to.not.equal('updated text'); + expect(primaryCTA.href).to.not.equal('updated text'); + expect(secondaryCTA.innerText).to.not.equal('updated text'); + expect(actionArea.innerHTML).to.not.equal('

updated text

'); + + await init(mepSettings); + + expect(header.innerText).to.equal('updated text'); + expect(primaryCTA.innerText).to.equal('updated text'); + expect(primaryCTA.href).to.equal('https://test.com/updated_href'); + expect(secondaryCTA.innerText).to.equal('updated text'); + expect(actionArea.innerHTML).to.equal('

updated text

'); + }); +}); + describe('remove action', () => { before(async () => { let manifestJson = await readFile({ path: './mocks/actions/manifestRemove.json' }); diff --git a/test/features/personalization/actionsTargetManifestId.test.js b/test/features/personalization/actionsTargetManifestId.test.js index 7345cabb8b..9f649f2e58 100644 --- a/test/features/personalization/actionsTargetManifestId.test.js +++ b/test/features/personalization/actionsTargetManifestId.test.js @@ -123,6 +123,30 @@ describe('appendToSection action', async () => { }); }); +describe('replace action with html/text instead of fragment', () => { + it('should replace marquee content', async () => { + document.body.innerHTML = await readFile({ path: './mocks/personalization.html' }); + let manifestJson = await readFile({ path: './mocks/actions/manifestTargetUpdate.json' }); + manifestJson = JSON.parse(manifestJson); + setFetchResponse(manifestJson); + + const primaryCTA = document.querySelector('.marquee p strong a'); + const secondaryCTA = document.querySelector('.marquee p a'); + const header = document.querySelector('.marquee h2'); + const actionArea = document.querySelector('main div:nth-child(5) .marquee p:has(em a, strong a)'); + + expect(header.dataset.adobeTargetTestid).not.to.exist; + expect(primaryCTA.dataset.adobeTargetTestid).not.to.exist; + expect(secondaryCTA.dataset.adobeTargetTestid).not.to.exist; + expect(actionArea.dataset.adobeTargetTestid).not.to.exist; + await init(mepSettings); + expect(header.dataset.adobeTargetTestid).to.equal('manifest'); + expect(primaryCTA.dataset.adobeTargetTestid).to.equal('manifest'); + expect(secondaryCTA.dataset.adobeTargetTestid).to.equal('manifest'); + expect(actionArea.dataset.adobeTargetTestid).to.equal('manifest'); + }); +}); + describe('useBlockCode action', async () => { it('useBlockCode should override a current block with the custom block code provided', async () => { let manifestJson = await readFile({ path: './mocks/actions/manifestUseBlockCode.json' }); diff --git a/test/features/personalization/mocks/actions/manifestInsertAfter.json b/test/features/personalization/mocks/actions/manifestInsertAfter.json index 0e40395cf9..09f24811c8 100644 --- a/test/features/personalization/mocks/actions/manifestInsertAfter.json +++ b/test/features/personalization/mocks/actions/manifestInsertAfter.json @@ -35,6 +35,28 @@ "firefox": "", "android": "", "ios": "" + }, + { + "action": "insertAfter", + "selector": "#insertafter", + "page filter (optional)": "", + "param-newoffer=123": "", + "chrome": "
Hello World
", + "target-var1": "/test/features/personalization/mocks/fragments/insertafter", + "firefox": "", + "android": "", + "ios": "" + }, + { + "action": "insertAfter", + "selector": "#insertafter #_href", + "page filter (optional)": "", + "param-newoffer=123": "", + "chrome": "#modal", + "target-var1": "", + "firefox": "", + "android": "", + "ios": "" } ], ":type": "sheet" diff --git a/test/features/personalization/mocks/actions/manifestInsertBefore.json b/test/features/personalization/mocks/actions/manifestInsertBefore.json index 057cfaacf4..dd0e845941 100644 --- a/test/features/personalization/mocks/actions/manifestInsertBefore.json +++ b/test/features/personalization/mocks/actions/manifestInsertBefore.json @@ -24,6 +24,17 @@ "firefox": "", "android": "", "ios": "" + }, + { + "action": "insertBefore", + "selector": "#insertbefore #_href", + "page filter (optional)": "", + "param-newoffer=123": "", + "chrome": "/de", + "target-var1": "", + "firefox": "", + "android": "", + "ios": "" } ], ":type": "sheet" diff --git a/test/features/personalization/mocks/actions/manifestTargetUpdate.json b/test/features/personalization/mocks/actions/manifestTargetUpdate.json new file mode 100644 index 0000000000..6e2d97793b --- /dev/null +++ b/test/features/personalization/mocks/actions/manifestTargetUpdate.json @@ -0,0 +1,65 @@ +{ + "total": 5, + "offset": 0, + "limit": 5, + "data": [ + { + "action": "replace", + "selector": ".marquee h2", + "page filter (optional)": "", + "param-newoffer=123": "", + "chrome": "", + "target-var1": "updated text", + "firefox": "", + "android": "", + "ios": "" + }, + { + "action": "replace", + "selector": "marquee primary-cta", + "page filter (optional)": "", + "param-newoffer=123": "", + "chrome": "", + "target-var1": "updated text", + "firefox": "", + "android": "", + "ios": "" + }, + { + "action": "replace", + "selector": ".marquee primary-cta", + "page filter (optional)": "", + "param-newoffer=123": "", + "chrome": "", + "'modifier": "href", + "target-var1": "https://test.com/updated_href", + "firefox": "", + "android": "", + "ios": "" + }, + { + "action": "replace", + "selector": "marquee secondary-cta", + "page filter (optional)": "", + "param-newoffer=123": "", + "chrome": "", + "target-var1": "updated text", + "firefox": "", + "android": "", + "ios": "" + }, + { + "action": "replace", + "selector": "section5 marquee action-area", + "'modifier": "html", + "page filter (optional)": "", + "param-newoffer=123": "", + "chrome": "", + "target-var1": "

updated text

", + "firefox": "", + "android": "", + "ios": "" + } + ], + ":type": "sheet" +} diff --git a/test/features/personalization/mocks/actions/manifestUpdate.json b/test/features/personalization/mocks/actions/manifestUpdate.json new file mode 100644 index 0000000000..261ef3649b --- /dev/null +++ b/test/features/personalization/mocks/actions/manifestUpdate.json @@ -0,0 +1,74 @@ +{ + "total": 5, + "offset": 0, + "limit": 5, + "data": [ + { + "action": "replace", + "selector": ".marquee h2", + "page filter (optional)": "", + "param-newoffer=123": "", + "chrome": "updated text", + "target-var1": "", + "firefox": "", + "android": "", + "ios": "" + }, + { + "action": "replace", + "selector": "marquee primary-cta", + "page filter (optional)": "", + "param-newoffer=123": "", + "chrome": "updated text", + "target-var1": "", + "firefox": "", + "android": "", + "ios": "" + }, + { + "action": "replace", + "selector": ".marquee primary-cta #_href", + "page filter (optional)": "", + "param-newoffer=123": "", + "chrome": "https://test.com/updated_href", + "target-var1": "", + "firefox": "", + "android": "", + "ios": "" + }, + { + "action": "replace", + "selector": "marquee secondary-cta", + "page filter (optional)": "", + "param-newoffer=123": "", + "chrome": "updated text", + "target-var1": "", + "firefox": "", + "android": "", + "ios": "" + }, + { + "action": "replace", + "selector": "section5 marquee action-area", + "page filter (optional)": "", + "param-newoffer=123": "", + "chrome": "

updated text

", + "target-var1": "", + "firefox": "", + "android": "", + "ios": "" + }, + { + "action": "replace", + "selector": "section5...%$@#", + "page filter (optional)": "", + "param-newoffer=123": "", + "chrome": "

updated text

", + "target-var1": "", + "firefox": "", + "android": "", + "ios": "" + } + ], + ":type": "sheet" +} diff --git a/test/features/personalization/mocks/manifestSectionBlock.json b/test/features/personalization/mocks/manifestSectionBlock.json index 77088f07f5..1a5809b040 100644 --- a/test/features/personalization/mocks/manifestSectionBlock.json +++ b/test/features/personalization/mocks/manifestSectionBlock.json @@ -5,21 +5,14 @@ "data": [ { "action": "removeContent", - "selector": "section2 block2", + "selector": ".custom-block1", "page filter (optional)": "", "param-newoffer=123": "", "all": "on" }, { "action": "removeContent", - "selector": "custom-block2", - "page filter (optional)": "", - "param-newoffer=123": "", - "all": "on" - }, - { - "action": "removeContent", - "selector": "section5 custom-block", + "selector": "section2 .custom-block", "page filter (optional)": "", "param-newoffer=123": "", "all": "on" diff --git a/test/features/personalization/mocks/personalization.html b/test/features/personalization/mocks/personalization.html index f2ed9f2cb9..d9aac62f61 100644 --- a/test/features/personalization/mocks/personalization.html +++ b/test/features/personalization/mocks/personalization.html @@ -14,8 +14,14 @@

Milo Experimentation Platform

Leverage the Milo Experimentation Platform (MEP) for all your personalization needs on Milo!

-

Review - Docs

+

+ + Review Docs + + + Secondary CTA + +

@@ -168,6 +174,10 @@

The second marquee

Custom block 4
+ + + +
diff --git a/test/features/personalization/modifyNonFragmentSelector.test.js b/test/features/personalization/modifyNonFragmentSelector.test.js new file mode 100644 index 0000000000..56db63e300 --- /dev/null +++ b/test/features/personalization/modifyNonFragmentSelector.test.js @@ -0,0 +1,119 @@ +import { expect } from '@esm-bundle/chai'; +import { modifyNonFragmentSelector } from '../../../libs/features/personalization/personalization.js'; + +const values = [ + { + b: 'main section1 marquee action-area', + a: 'main > div:nth-child(1) .marquee p:has(em a, strong a)', + }, + { + b: 'main > section1 .marquee h2', + a: 'main > div:nth-child(1) .marquee h2', + }, + { + b: '#some-random-id, section1 marquee row2 col1 p:nth-of-type(2)', + a: '#some-random-id , main > div:nth-child(1) .marquee > div:nth-child(2) > div:nth-child(1) p:nth-of-type(2)', + }, + { + b: 'marquee.light:nth-child(2) h2', + a: '.marquee.light:nth-child(2) h2', + }, + { + b: 'section2 text3', + a: 'main > div:nth-child(2) .text:nth-child(3 of .text)', + }, + { + b: 'section2 .text.light strong', + a: 'main > div:nth-child(2) .text.light strong', + }, + { + b: 'section3 table row2 col2 primary-cta', + a: 'main > div:nth-child(3) .table > div:nth-child(2) > div:nth-child(2) p strong a', + }, + { + b: 'marquee primary-cta #_href', + a: '.marquee p strong a', + m: ['href'], + }, + { + b: 'marquee primary-cta #_HREF', + a: '.marquee p strong a', + m: ['href'], + }, + { + b: 'marquee primary-cta#_href', + a: '.marquee p strong a#_href', + }, + { + b: 'marquee primary-cta #_href_all', + a: '.marquee p strong a', + m: ['href', 'all'], + }, + { + b: 'marquee primary-cta #_href#_all', + a: '.marquee p strong a', + m: ['href', 'all'], + }, + { + b: 'marquee primary-cta #_href #_all', + a: '.marquee p strong a', + m: ['href', 'all'], + }, + { + b: 'section3 table row5 col2', + a: 'main > div:nth-child(3) .table > div:nth-child(5) > div:nth-child(2)', + }, + { + b: 'section3 table row2 col4 secondary-cta', + a: 'main > div:nth-child(3) .table > div:nth-child(2) > div:nth-child(4) p em a', + }, + { + b: 'section4 merch-card', + a: 'main > div:nth-child(4) .merch-card', + }, + { + b: 'section5 tabs col2 row2', + a: 'main > div:nth-child(5) .tabs > div:nth-child(2) > div:nth-child(2)', + }, + { + b: 'section8 table row4 col2', + a: 'main > div:nth-child(8) .table > div:nth-child(4) > div:nth-child(2)', + }, + { + b: 'section5', + a: 'main > div:nth-child(5)', + }, + { + b: '.text:has(#im-a-unique-text-block) secondary-cta', + a: '.text:has(#im-a-unique-text-block) p em a', + }, + { + b: 'section1 .random-block2', + a: 'main > div:nth-child(1) .random-block:nth-child(2 of .random-block)', + }, + { + b: 'main > section30', + a: 'main > div:nth-child(30)', + }, + { + b: 'main>section30', + a: 'main > div:nth-child(30)', + }, + { + b: 'main>div:nth-child(30)', + a: 'main > div:nth-child(30)', + }, + { + b: 'custom-block3', + a: '.custom-block:nth-child(3 of .custom-block)', + }, +]; +describe('test different values', () => { + values.forEach((value) => { + it(`should return the expected value for ${value.b}`, () => { + const { modifiedSelector, modifiers } = modifyNonFragmentSelector(value.b); + expect(modifiedSelector).to.equal(value.a); + expect(modifiers).to.deep.equal(value.m || []); + }); + }); +}); diff --git a/test/features/personalization/personalization-params.test.js b/test/features/personalization/personalization-params.test.js new file mode 100644 index 0000000000..ab23c98ec5 --- /dev/null +++ b/test/features/personalization/personalization-params.test.js @@ -0,0 +1,50 @@ +import { expect } from '@esm-bundle/chai'; +import { readFile } from '@web/test-runner-commands'; +import { stub } from 'sinon'; +import { getConfig } from '../../../libs/utils/utils.js'; +import { init } from '../../../libs/features/personalization/personalization.js'; +import spoofParams from './spoofParams.js'; +import mepSettings from './mepSettings.js'; + +document.head.innerHTML = await readFile({ path: './mocks/metadata.html' }); +document.body.innerHTML = await readFile({ path: './mocks/personalization.html' }); + +const getFetchPromise = (data, type = 'json') => new Promise((resolve) => { + resolve({ + ok: true, + [type]: () => data, + }); +}); + +const setFetchResponse = (data, type = 'json') => { + window.fetch = stub().returns(getFetchPromise(data, type)); +}; + +async function loadManifestAndSetResponse(manifestPath) { + let manifestJson = await readFile({ path: manifestPath }); + manifestJson = JSON.parse(manifestJson); + setFetchResponse(manifestJson); +} + +// Note that the manifestPath doesn't matter as we stub the fetch +describe('Functional Test', () => { + before(() => { + // Add custom keys so tests doesn't rely on real data + const config = getConfig(); + config.env = { name: 'prod' }; + config.consumerEntitlements = { + '11111111-aaaa-bbbb-6666-cccccccccccc': 'my-special-app', + '22222222-xxxx-bbbb-7777-cccccccccccc': 'fireflies', + }; + }); + + it('should override to param-newoffer=123', async () => { + spoofParams({ newoffer: '123' }); + const config = getConfig(); + await loadManifestAndSetResponse('./mocks/actions/manifestAppendToSection.json'); + setTimeout(async () => { + await init(mepSettings); + expect(config.mep.experiments[0].selectedVariantName).to.equal('param-newoffer=123'); + }, 100); + }); +}); diff --git a/test/features/personalization/personalization.test.js b/test/features/personalization/personalization.test.js index b396befa72..0c25dc04ab 100644 --- a/test/features/personalization/personalization.test.js +++ b/test/features/personalization/personalization.test.js @@ -4,9 +4,8 @@ import { assert, stub } from 'sinon'; import { getConfig, setConfig } from '../../../libs/utils/utils.js'; import { handleFragmentCommand, applyPers, - init, matchGlob, createFrag, combineMepSources, buildVariantInfo, + init, matchGlob, createContent, combineMepSources, buildVariantInfo, } from '../../../libs/features/personalization/personalization.js'; -import spoofParams from './spoofParams.js'; import mepSettings from './mepSettings.js'; document.head.innerHTML = await readFile({ path: './mocks/metadata.html' }); @@ -54,37 +53,39 @@ describe('Functional Test', () => { }); it('Can select elements using block-#', async () => { + document.body.innerHTML = await readFile({ path: './mocks/personalization.html' }); await loadManifestAndSetResponse('./mocks/manifestBlockNumber.json'); - expect(document.querySelector('.marquee')).to.not.be.null; - expect(document.querySelector('a[href="/fragments/replace/marquee/r2c1"]')).to.be.null; - expect(document.querySelector('a[href="/fragments/replace/marquee-2/r3c2"]')).to.be.null; + const firstMarquee = document.getElementsByClassName('marquee')[0]; const secondMarquee = document.getElementsByClassName('marquee')[1]; + expect(firstMarquee).to.not.be.null; expect(secondMarquee).to.not.be.null; + expect(document.querySelector('a[href="/fragments/replace/marquee/r2c1"]')).to.be.null; + expect(document.querySelector('a[href="/fragments/replace/marquee-2/r3c2"]')).to.be.null; await init(mepSettings); const fragment = document.querySelector('a[href="/fragments/replace/marquee/r2c1"]'); - expect(fragment).to.not.be.null; - const replacedCell = document.querySelector('.marquee > div:nth-child(2) > div:nth-child(1)'); - expect(replacedCell.firstChild.firstChild).to.equal(fragment); const secondFrag = document.querySelector('a[href="/fragments/replace/marquee-2/r2c2"]'); - expect(secondMarquee.lastElementChild.lastElementChild.firstChild.firstChild) - .to.equal(secondFrag); + expect(fragment).to.not.be.null; + expect(secondFrag).to.not.be.null; + + const firstMarqueeReplacedCell = firstMarquee.querySelector('p > a'); + const secondMarqueeReplacedCell = secondMarquee.querySelector('p > a'); + expect(firstMarqueeReplacedCell.href).to.equal(fragment.href); + expect(secondMarqueeReplacedCell.href).to.equal(secondFrag.href); }); it('Can select blocks using section and block indexs', async () => { await loadManifestAndSetResponse('./mocks/manifestSectionBlock.json'); - expect(document.querySelector('.special-block')).to.not.be.null; + expect(document.querySelector('.custom-block-1')).to.not.be.null; expect(document.querySelector('.custom-block-2')).to.not.be.null; - expect(document.querySelector('.custom-block-3')).to.not.be.null; await init(mepSettings); - expect(document.querySelector('.special-block')).to.be.null; + expect(document.querySelector('.custom-block-1')).to.be.null; expect(document.querySelector('.custom-block-2')).to.be.null; - expect(document.querySelector('.custom-block-3')).to.be.null; }); it('scheduled manifest should apply changes if active (bts)', async () => { @@ -285,7 +286,7 @@ describe('Functional Test', () => { await init(mepSettings); - assert.calledWith(window.console.log, 'Invalid selector: ', '.bad...selector'); + assert.calledWith(window.console.log, 'Invalid selector: '); window.console.log.reset(); }); @@ -308,16 +309,6 @@ describe('Functional Test', () => { expect(document.querySelector('meta[property="og:title"]').content).to.equal('New Title'); expect(document.querySelector('meta[property="og:image"]').content).to.equal('https://adobe.com/path/to/image.jpg'); }); - - it('should override to param-newoffer=123', async () => { - spoofParams({ newoffer: '123' }); - const config = getConfig(); - await loadManifestAndSetResponse('./mocks/actions/manifestAppendToSection.json'); - setTimeout(async () => { - await init(mepSettings); - expect(config.mep.experiments[0].selectedVariantName).to.equal('param-newoffer=123'); - }, 100); - }); }); describe('matchGlob function', () => { @@ -367,7 +358,7 @@ describe('matchGlob function', () => { const parent = document.createElement('div'); const el = document.createElement('div'); parent.appendChild(el); - const wrapper = createFrag(el, '/fragments/promos/path-to-promo/#modal-hash:delay=1'); + const wrapper = createContent(el, '/fragments/promos/path-to-promo/#modal-hash:delay=1'); expect(wrapper.tagName).to.equal('P'); expect(wrapper.classList.contains('hide-block')).to.be.true; }); From 42d51a0d190a84a269becb50a4f31072cd4823b3 Mon Sep 17 00:00:00 2001 From: Mark Perry <124626043+markpadbe@users.noreply.github.com> Date: Mon, 2 Sep 2024 01:17:10 -0700 Subject: [PATCH 02/21] MWPW-156793 [MILO][Analytics] Change char limit for headers based on MD (#2765) * Add charlimit for headers analytics * Fix header for integer value only * Update libs/martech/attributes.js set header length to false for clarity Co-authored-by: Vivian A Goodrich <101133187+vgoodric@users.noreply.github.com> * Add tests * Refacter str null check per suggestion * Fix test coverage --------- Co-authored-by: Vivian A Goodrich <101133187+vgoodric@users.noreply.github.com> --- libs/martech/attributes.js | 16 ++++++++-- test/martech/attributes.test.js | 52 +++++++++++++++++++++++++++++++++ test/martech/mocks/body.html | 5 ++-- 3 files changed, 68 insertions(+), 5 deletions(-) diff --git a/libs/martech/attributes.js b/libs/martech/attributes.js index 9bb2b3dc5f..1f0af83c53 100644 --- a/libs/martech/attributes.js +++ b/libs/martech/attributes.js @@ -1,3 +1,5 @@ +import { getMetadata } from '../utils/utils.js'; + const INVALID_CHARACTERS = /[^\u00C0-\u1FFF\u2C00-\uD7FF\w]+/g; const LEAD_UNDERSCORES = /^_+|_+$/g; @@ -11,6 +13,13 @@ export function processTrackingLabels(text, config, charLimit) { return analyticsValue; } +function getHeaderCharLimit(str) { + const defaultLimit = 20; + if (!str) return defaultLimit; + if (str === 'off') return false; + if (!Number.isNaN(Number(str))) return parseInt(str, 10); + return defaultLimit; +} export function decorateDefaultLinkAnalytics(block, config) { if (block.classList.length && !block.className.includes('metadata') @@ -20,6 +29,7 @@ export function decorateDefaultLinkAnalytics(block, config) { let header = ''; let linkCount = 1; + const headerCharLimit = getHeaderCharLimit(getMetadata('analytics-header-limit')); const headerSelector = 'h1, h2, h3, h4, h5, h6'; let analyticsSelector = `${headerSelector}, .tracking-header`; const headers = block.querySelectorAll(analyticsSelector); @@ -27,13 +37,13 @@ export function decorateDefaultLinkAnalytics(block, config) { block.querySelectorAll(`${analyticsSelector}, a:not(.video.link-block), button`).forEach((item) => { if (item.nodeName === 'A' || item.nodeName === 'BUTTON') { if (item.classList.contains('tracking-header')) { - header = processTrackingLabels(item.textContent, config, 20); + header = processTrackingLabels(item.textContent, config, headerCharLimit); } else if (!header) { const section = block.closest('.section'); if (section?.className.includes('-up') || section?.classList.contains('milo-card-section')) { const previousHeader = section?.previousElementSibling?.querySelector(headerSelector); if (previousHeader) { - header = processTrackingLabels(previousHeader.textContent, config, 20); + header = processTrackingLabels(previousHeader.textContent, config, headerCharLimit); } } } @@ -59,7 +69,7 @@ export function decorateDefaultLinkAnalytics(block, config) { if (item.nodeName === 'STRONG' || item.nodeName === 'B') { item.classList.add('tracking-header'); } - header = processTrackingLabels(item.textContent, config, 20); + header = processTrackingLabels(item.textContent, config, headerCharLimit); } }); } diff --git a/test/martech/attributes.test.js b/test/martech/attributes.test.js index 0e6e89e748..97593f80d3 100644 --- a/test/martech/attributes.test.js +++ b/test/martech/attributes.test.js @@ -1,11 +1,13 @@ import { readFile } from '@web/test-runner-commands'; import { expect } from '@esm-bundle/chai'; import { decorateSectionAnalytics, processTrackingLabels } from '../../libs/martech/attributes.js'; +import { createTag } from '../../libs/utils/utils.js'; const expectedLinkValues = [ 'already-has-1', 'Traditional Link-2--Second Traditional H', 'Title Only Link-3--Tracking Header', + 'Traditional Link-5--Button Tracking Head', 'After bold-1--Bold text', 'After strong-2--Strong text', ]; @@ -44,6 +46,56 @@ describe('Analytics', async () => { expect(link.getAttribute('daa-ll')).to.equal(expectedLinkValues[idx]); }); }); + it('should limit analytics header length to analytics-header-limit when this metadata value is set to a number', async () => { + document.body.outerHTML = await readFile({ path: './mocks/body.html' }); + const analyticsHeaderLimit = 2; + const meta = createTag('meta', { name: 'analytics-header-limit', content: analyticsHeaderLimit }); + document.querySelector('head')?.append(meta); + document.querySelectorAll('main > div').forEach((section, idx) => decorateSectionAnalytics(section, idx, { mep: { martech: '|smb|hp' } })); + const section = document.querySelector('main > div'); + section.querySelectorAll('a').forEach((link) => { + const daall = link.getAttribute('daa-ll'); + const linkHeaderValue = daall.includes('--') && daall.split('--')[1]; + if (linkHeaderValue) { + expect(linkHeaderValue.length).to.be.at.most(analyticsHeaderLimit); + } + }); + }); + it('should not limit analytics header length when metadata analytics-header-limit value set to off', async () => { + document.body.outerHTML = await readFile({ path: './mocks/body.html' }); + const analyticsHeaderLimit = 'off'; + document.querySelector('meta[name="analytics-header-limit"]')?.setAttribute('content', analyticsHeaderLimit); + document.querySelectorAll('main > div').forEach((section, idx) => decorateSectionAnalytics(section, idx, { mep: { martech: '|smb|hp' } })); + const headerText = document.querySelector('#block-with-header h3:nth-of-type(2)')?.textContent.trim(); + const daall = document.querySelector('#block-with-header p:nth-of-type(2) a')?.getAttribute('daa-ll')?.split('--')[1]; + expect(headerText).to.equal(daall); + }); + it('should limit analytics header length to default when analytics-header-limit metadata value is empty', async () => { + const defaultValue = 20; + document.body.outerHTML = await readFile({ path: './mocks/body.html' }); + const analyticsHeaderLimit = ''; + document.querySelector('meta[name="analytics-header-limit"]')?.setAttribute('content', analyticsHeaderLimit); + document.querySelectorAll('main > div').forEach((section, idx) => decorateSectionAnalytics(section, idx, { mep: { martech: '|smb|hp' } })); + const daall = document.querySelector('#block-with-header p:nth-of-type(2) a')?.getAttribute('daa-ll')?.split('--')[1]; + expect(daall.length).to.be.at.most(defaultValue); + }); + it('should limit analytics header length to default when analytics-header-limit metadata value is incorrect', async () => { + const defaultValue = 20; + document.body.outerHTML = await readFile({ path: './mocks/body.html' }); + const analyticsHeaderLimit = 'offs'; + document.querySelector('meta[name="analytics-header-limit"]')?.setAttribute('content', analyticsHeaderLimit); + document.querySelectorAll('main > div').forEach((section, idx) => decorateSectionAnalytics(section, idx, { mep: { martech: '|smb|hp' } })); + const daall = document.querySelector('#block-with-header p:nth-of-type(2) a')?.getAttribute('daa-ll')?.split('--')[1]; + expect(daall.length).to.be.at.most(defaultValue); + }); + it('should limit analytics header length to default when no metadata', async () => { + const defaultValue = 20; + document.body.outerHTML = await readFile({ path: './mocks/body.html' }); + document.querySelector('meta[name="analytics-header-limit"]').remove(); + document.querySelectorAll('main > div').forEach((section, idx) => decorateSectionAnalytics(section, idx, { mep: { martech: '|smb|hp' } })); + const daall = document.querySelector('#block-with-header p:nth-of-type(2) a')?.getAttribute('daa-ll')?.split('--')[1]; + expect(daall.length).to.be.at.most(defaultValue); + }); it('should process tracking labels', () => { const longString = 'This is a long string that should be truncated'; const processedString = processTrackingLabels(longString, { locale: { ietf: 'en-US' } }, 20); diff --git a/test/martech/mocks/body.html b/test/martech/mocks/body.html index ee224e65be..be6320b7ff 100644 --- a/test/martech/mocks/body.html +++ b/test/martech/mocks/body.html @@ -9,6 +9,8 @@

Second Traditional Header

Traditional Link

Tracking Header

+ +

Traditional Link

@@ -56,6 +58,5 @@

AI for

- + - From 8467b03b315068ea0e5bd8b31e15fbd27e7d7bc3 Mon Sep 17 00:00:00 2001 From: Mariia Lukianets Date: Mon, 2 Sep 2024 10:17:17 +0200 Subject: [PATCH 03/21] MWPW-157540: fix external modals (#2806) --- libs/blocks/merch/merch.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/blocks/merch/merch.js b/libs/blocks/merch/merch.js index 4dd85521cf..98631793cc 100644 --- a/libs/blocks/merch/merch.js +++ b/libs/blocks/merch/merch.js @@ -374,7 +374,7 @@ export async function openModal(e, url, offerType) { if (/\/fragments\//.test(url)) { const fragmentPath = url.split(/hlx.(page|live)/).pop(); modal = await openFragmentModal(fragmentPath, getModal); - } else if (/^https?:/.test(url)) { + } else { modal = await openExternalModal(url, getModal); } if (modal) { From d405ac1b49ffb69a631f3ea8541f1ff005fc4d14 Mon Sep 17 00:00:00 2001 From: Axel Cureno Basurto Date: Mon, 2 Sep 2024 01:17:24 -0700 Subject: [PATCH 04/21] Mwpw 142267: What's included style fixes (#2674) --- libs/deps/mas/merch-mnemonic-list.js | 5 +++-- libs/deps/mas/merch-whats-included.js | 1 - libs/features/mas/web-components/src/merch-mnemonic-list.js | 5 +++-- libs/features/mas/web-components/src/merch-whats-included.js | 1 - 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/libs/deps/mas/merch-mnemonic-list.js b/libs/deps/mas/merch-mnemonic-list.js index c5cda0820a..946d0d034c 100644 --- a/libs/deps/mas/merch-mnemonic-list.js +++ b/libs/deps/mas/merch-mnemonic-list.js @@ -2,8 +2,9 @@ import{html as e,css as i,LitElement as s}from"/libs/deps/lit-all.min.js";var t= :host { display: flex; flex-direction: row; - gap: 10px; - margin-bottom: 10px; + gap: 5px; + margin-bottom: 5px; + margin-right: 10px; align-items: flex-end; } diff --git a/libs/deps/mas/merch-whats-included.js b/libs/deps/mas/merch-whats-included.js index 24065954d7..bee34475b6 100644 --- a/libs/deps/mas/merch-whats-included.js +++ b/libs/deps/mas/merch-whats-included.js @@ -8,7 +8,6 @@ import{html as e,css as o,LitElement as l}from"/libs/deps/lit-all.min.js";var t= place-content: stretch start; box-sizing: border-box; align-self: baseline; - margin-top: 16px; margin-bottom: 16px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); grid-auto-rows: unset; diff --git a/libs/features/mas/web-components/src/merch-mnemonic-list.js b/libs/features/mas/web-components/src/merch-mnemonic-list.js index b2d66a4e3e..2981e13d07 100644 --- a/libs/features/mas/web-components/src/merch-mnemonic-list.js +++ b/libs/features/mas/web-components/src/merch-mnemonic-list.js @@ -5,8 +5,9 @@ export class MerchMnemonicList extends LitElement { :host { display: flex; flex-direction: row; - gap: 10px; - margin-bottom: 10px; + gap: 5px; + margin-bottom: 5px; + margin-right: 10px; align-items: flex-end; } diff --git a/libs/features/mas/web-components/src/merch-whats-included.js b/libs/features/mas/web-components/src/merch-whats-included.js index c0ea4fb163..6ceb950a85 100644 --- a/libs/features/mas/web-components/src/merch-whats-included.js +++ b/libs/features/mas/web-components/src/merch-whats-included.js @@ -11,7 +11,6 @@ export class MerchWhatsIncluded extends LitElement { place-content: stretch start; box-sizing: border-box; align-self: baseline; - margin-top: 16px; margin-bottom: 16px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); grid-auto-rows: unset; From 1c4001b0fedf139dda5160ba02dc8af3cd587773 Mon Sep 17 00:00:00 2001 From: Sheridan Sunier Date: Mon, 2 Sep 2024 01:17:30 -0700 Subject: [PATCH 05/21] MWPW-156810: adding caas config change for live CTAs (#2707) * MWPW-145727: add configurator changes for alt cta on live events * MWPW-14572: get the alt cta from secondaryCTA so it can be localized by caas * lint * left something in * left something in * unit tests * unit tests * MWPW-145727: unit tests * MWPW-145727: unit tests * MWPW-145727: unit tests * MWPW-145727: unit tests * unit tests hopefully * ok finally the unit tests probably * ok this will be the one * variable name * config hash test --------- Co-authored-by: milo-pr-merge[bot] <169241390+milo-pr-merge[bot]@users.noreply.github.com> Co-authored-by: Sheridan Sunier --- libs/blocks/caas-config/caas-config.js | 1 + libs/blocks/caas/utils.js | 2 ++ test/blocks/caas-config/caas-config.test.html | 2 +- test/blocks/caas-config/expectedConfigs/defaultConfig.js | 1 + test/blocks/caas/utils.test.js | 3 +++ 5 files changed, 8 insertions(+), 1 deletion(-) diff --git a/libs/blocks/caas-config/caas-config.js b/libs/blocks/caas-config/caas-config.js index c1bec7e45d..db1859b792 100644 --- a/libs/blocks/caas-config/caas-config.js +++ b/libs/blocks/caas-config/caas-config.js @@ -366,6 +366,7 @@ const UiPanel = () => html` <${Input} label="Show total card count at top" prop="showTotalResults" type="checkbox" /> <${Input} label="Hide date for on-demand content" prop="hideDateInterval" type="checkbox" /> <${Input} label="Enable showing card badges (by default hidden)" prop="showCardBadges" type="checkbox" /> + <${Input} label="Show a different CTA for live events" prop="dynamicCTAForLiveEvents" type="checkbox" /> <${Select} label="Card Style" prop="cardStyle" options=${defaultOptions.cardStyle} /> <${Select} options=${defaultOptions.cardTitleAccessibilityLevel} prop="cardTitleAccessibilityLevel" label="Card Accessibility Title Level" /> <${Select} label="Layout" prop="container" options=${defaultOptions.container} /> diff --git a/libs/blocks/caas/utils.js b/libs/blocks/caas/utils.js index 7ea5fcbf41..e83d9b3e36 100644 --- a/libs/blocks/caas/utils.js +++ b/libs/blocks/caas/utils.js @@ -599,6 +599,7 @@ export const getConfig = async (originalState, strs = {}) => { }, detailsTextOption: state.detailsTextOption, hideDateInterval: state.hideDateInterval, + dynamicCTAForLiveEvents: state.dynamicCTAForLiveEvents, setCardBorders: state.setCardBorders, showFooterDivider: state.showFooterDivider, useOverlayLinks: state.useOverlayLinks, @@ -764,6 +765,7 @@ export const initCaas = async (state, caasStrs, el) => { export const defaultState = { additionalRequestParams: [], + dynamicCTAForLiveEvents: false, analyticsCollectionName: '', analyticsTrackImpression: false, andLogicTags: [], diff --git a/test/blocks/caas-config/caas-config.test.html b/test/blocks/caas-config/caas-config.test.html index fa0456dff4..612a76c827 100644 --- a/test/blocks/caas-config/caas-config.test.html +++ b/test/blocks/caas-config/caas-config.test.html @@ -312,7 +312,7 @@ // The header is the part before the first / in the hash // Due to this we only compare the characters after the header value - const hashWithoutHeader = 'bNhD9Fz47Wafb9kFva+8uYsCbdWMv+lAExZgcSYQpjkoO7VWK/ntB6u44b9I55FzOXPivAKU0a7JgvuI/AT3vwEHlRfbXt4UAC6ZhLf2ajEEZz32BCkUmxIQ8OJCnTVU79F6TFVkOxmM8oLZUaHmAorcXmNYULLtmC7YYTh6JThW400aS3WP01LqY4m/WTxgJTu25MTGWEkz+oURdlNwxB80GH6SMAR210dxs8YxGZL8vhBxSWbHtTdROV+AaMaXHTEcsGb4G9/r7gFkGbdGJTHz6Zbl8gfc/teKyo9Dyoalx1EO2WohMSACfdb93wccLwTNVa3Cqs83wkNyJTPzt0eRiIRR9Id7C92ZLoAY1lfZwNLgCa9H5EXaQ8+Nx+EeratI2Cnq5XD6CoiN+lFTdyVJX6OAD1PpuzFLEG2ftyFZouyrguzRBoYpRdil10JhjDsYcQZ6eRndiIXIEDm52M9eG0T2dB+stsAraqB3YWL7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lUz6bSHo4Gl2AtuqGZykHOT8f+H62qSdtI6OVy+QiKjvhRUvUgS12hgw9Q64ehShFvnLUjW6Ftu4Dv0gSFKmbZltRCQ405GHMEeXoewomZyBE4uMnNXBtGlxTYnknAMmijdmBj+5KAKmAte/OWJLSsGMx5hBdaikyQ66FJHL9K/E6gfUmX56rmpueoCMypm7++i5koEVTvptQKVwwbNf0fCo/AEzBuLKM7g+mdantDkQFbBCiw00H3/4CRdQMNhSScmEeoI0SgXsjhXQVb4puxI2uaWNuyHaee9jYhcjcXaii0TbQurK7SRx8HClRifOTZRrUN8hssfwSwrDnFtnfsbU0tkDo1GN88Hkqs8HG4aEBiSUahe3PmqhGHPhj2O3S7ROBvM+ERnCzXGk3XGo+SrALXDBX20J6Ck9iBHIlZklPjwfElXRIOqsApvCZidE/6rFWUycjSce3XSVv3ba922ojkstPqCNvcnNmnEifQgTiu+MTGYCDHUYILL3/AnvAO+EJK53rUzGTAHIKJQ6m6e1fDtfM7qkM9uXDFv4JVVO2hqo0e7fp0IA75nhxP0HW7EyZgl9FtCR3+QxnXsFMIPbozabcjMiL7NJ/PbwwpSxTZ4xW/vh83jhN4E67VjijhcvLi20wwFP4qzp/v1HhGxKOuQI47/azjyhE9djtRHOcgLrj4xKGPS04hgzb+gO/8Wrf7T7V9mgmOqX5GUNoW7csnysdoiCpJmjtQnMpIxkwEj9voOnrrgwaPr2d0BpqttqdBU6P3MzDTnQUUPLqNzSkO1X//AxGj3OyCCAAA'; const hash = copyTextArea.value.split('#')[1].trim(); diff --git a/test/blocks/caas-config/expectedConfigs/defaultConfig.js b/test/blocks/caas-config/expectedConfigs/defaultConfig.js index 0e9b72de15..4d3f1b54e9 100644 --- a/test/blocks/caas-config/expectedConfigs/defaultConfig.js +++ b/test/blocks/caas-config/expectedConfigs/defaultConfig.js @@ -40,6 +40,7 @@ const defaultConfig = { reservoir: { sample: 3, pool: 1000 }, ctaAction: '_self', additionalRequestParams: {}, + dynamicCTAForLiveEvents: false, }, headers: [], hideCtaIds: [ diff --git a/test/blocks/caas/utils.test.js b/test/blocks/caas/utils.test.js index be7df8253f..29884bb434 100644 --- a/test/blocks/caas/utils.test.js +++ b/test/blocks/caas/utils.test.js @@ -190,6 +190,7 @@ describe('getConfig', () => { showFooterDivider: false, useOverlayLinks: false, additionalRequestParams: {}, + dynamicCTAForLiveEvents: false, banner: { register: { description: 'Sign Up', url: '#registration' }, upcoming: { description: 'Upcoming' }, @@ -453,6 +454,7 @@ describe('getConfig', () => { showFooterDivider: false, useOverlayLinks: false, additionalRequestParams: {}, + dynamicCTAForLiveEvents: false, banner: { register: { description: 'Sign Up', url: '#registration' }, upcoming: { description: 'Upcoming' }, @@ -777,6 +779,7 @@ describe('getFloodgateCaasConfig', () => { showFooterDivider: false, useOverlayLinks: false, additionalRequestParams: {}, + dynamicCTAForLiveEvents: false, banner: { register: { description: 'Sign Up', url: '#registration' }, upcoming: { description: 'Upcoming' }, From 541776292e928ce01d767c1c5a4045db3824bdcb Mon Sep 17 00:00:00 2001 From: Mariia Lukianets Date: Mon, 2 Sep 2024 10:17:37 +0200 Subject: [PATCH 06/21] MWPW-156672: refactor commerce & optimize pandora dependencies (#2723) * add sitemap * remove pandora wcs client * remove obsolete dependencies * fix request&settings test * remove domainSwitch * fix tests * update deps * fix review comment * use usual error message * fix language param * commit packag-lock * bring back transitive dependencies * bring back www.stage.adobe.com * omit cookies for wcs requests * revert special logic for stage --- libs/deps/commerce.js | 6 - libs/deps/mas/commerce.js | 4 +- libs/deps/mas/mas.js | 4 +- .../internal/data-source-wcs-0.2.8.tgz | Bin 5782 -> 0 bytes .../internal/eslint-config-tacocat-1.1.2.tgz | Bin 806 -> 0 bytes .../internal/react-auth-provider-1.2.1.tgz | Bin 5309 -> 0 bytes .../internal/react-env-provider-1.2.2.tgz | Bin 3312 -> 0 bytes .../internal/react-fetch-provider-1.2.2.tgz | Bin 3179 -> 0 bytes .../commerce/internal/tacocat-core-1.12.2.tgz | Bin 18104 -> 0 bytes .../commerce/internal/tacocat-core-1.13.0.tgz | Bin 0 -> 19169 bytes .../internal/tacocat-wcs-client-1.17.0.tgz | Bin 7374 -> 0 bytes libs/features/mas/commerce/libs/commerce.d.ts | 13 +- libs/features/mas/commerce/package.json | 9 +- libs/features/mas/commerce/src/constants.js | 8 + libs/features/mas/commerce/src/defaults.js | 6 +- libs/features/mas/commerce/src/external.js | 22 +- libs/features/mas/commerce/src/index.d.ts | 13 +- libs/features/mas/commerce/src/index.js | 5 +- libs/features/mas/commerce/src/settings.js | 27 +- libs/features/mas/commerce/src/wcs.js | 106 +++-- .../mas/commerce/test/settings.test.js | 144 +++++-- libs/features/mas/commerce/test/wcs.test.js | 8 +- libs/features/mas/package-lock.json | 408 +++++------------- 23 files changed, 295 insertions(+), 488 deletions(-) delete mode 100644 libs/deps/commerce.js delete mode 100644 libs/features/mas/commerce/internal/data-source-wcs-0.2.8.tgz delete mode 100644 libs/features/mas/commerce/internal/eslint-config-tacocat-1.1.2.tgz delete mode 100644 libs/features/mas/commerce/internal/react-auth-provider-1.2.1.tgz delete mode 100644 libs/features/mas/commerce/internal/react-env-provider-1.2.2.tgz delete mode 100644 libs/features/mas/commerce/internal/react-fetch-provider-1.2.2.tgz delete mode 100644 libs/features/mas/commerce/internal/tacocat-core-1.12.2.tgz create mode 100644 libs/features/mas/commerce/internal/tacocat-core-1.13.0.tgz delete mode 100644 libs/features/mas/commerce/internal/tacocat-wcs-client-1.17.0.tgz diff --git a/libs/deps/commerce.js b/libs/deps/commerce.js deleted file mode 100644 index c3a2dc1903..0000000000 --- a/libs/deps/commerce.js +++ /dev/null @@ -1,6 +0,0 @@ -// branch: main commit: c9d55dcfbb025978f8378c6aad1a2d2a773bbdd3 Tue, 23 Jul 2024 17:39:22 GMT -var kr=Object.defineProperty;var ui=(e,t,r)=>t in e?kr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var li=(e,t)=>{for(var r in t)kr(e,r,{get:t[r],enumerable:!0})};var ne=(e,t,r)=>(ui(e,typeof t!="symbol"?t+"":t,r),r),Gr=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)};var Lt=(e,t,r)=>(Gr(e,t,"read from private field"),r?r.call(e):t.get(e)),Fr=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},Nt=(e,t,r,n)=>(Gr(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r);var Ie;(function(e){e.ServerError="ServerError",e.ClientError="ClientError",e.UnexpectedError="UnexpectedError"})(Ie||(Ie={}));var Vr=(e,t,r)=>({type:(i=>i>=500?Ie.ServerError:i<400?Ie.UnexpectedError:Ie.ClientError)(e),message:t,originatingRequest:r,status:e});var fi=function(e,t,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(u){try{l(n.next(u))}catch(p){s(p)}}function c(u){try{l(n.throw(u))}catch(p){s(p)}}function l(u){u.done?o(u.value):i(u.value).then(a,c)}l((n=n.apply(e,t||[])).next())})},Be;(function(e){e.AUTHORIZATION="Authorization",e.X_API_KEY="X-Api-Key"})(Be||(Be={}));var Ct=class{constructor(t){this.fetchOptions=t}commonHeaders(){let t={};return this.fetchOptions.apiKey&&(t[Be.X_API_KEY]=this.fetchOptions.apiKey),this.fetchOptions.accessToken&&(t[Be.AUTHORIZATION]=`Bearer ${this.fetchOptions.accessToken}`),t}transformData(t,r){return r?t.map(n=>r(n)):t.map(n=>this.identifyTransform(n))}transformDatum(t,r){return r?r(t):this.identifyTransform(t)}identifyTransform(t){return t}failOnBadStatusOrParseBody(t,r){return fi(this,void 0,void 0,function*(){if(t.ok)return t.json().then(i=>({headers:t.headers,status:t.status,statusText:t.statusText,data:i}));let n=yield t.text();return Promise.reject(Vr(t.status,n,r))})}buildUrl(t,r,n,i,o){var s;let a=(s=this.fetchOptions.baseUrl)!==null&&s!==void 0?s:i(this.fetchOptions.env),c=o(r,n);return this.generateUrl(a,t,c)}generateUrl(t,r,n){let i=new URL(r,t);return n&&(i.search=this.convertToSearchParams(n).toString()),i.toString()}convertToSearchParams(t){return new URLSearchParams(t)}setParams(t,r,n){n!=null&&typeof n=="boolean"?t[r]=String(n):n&&(t[r]=n)}},It=Ct;var Y;(function(e){e.STAGE="STAGE",e.PRODUCTION="PRODUCTION",e.LOCAL="LOCAL"})(Y||(Y={}));var Re;(function(e){e.STAGE="STAGE",e.PRODUCTION="PROD",e.LOCAL="LOCAL"})(Re||(Re={}));var G;(function(e){e.DRAFT="DRAFT",e.PUBLISHED="PUBLISHED"})(G||(G={}));var fe;(function(e){e.V2="UCv2",e.V3="UCv3"})(fe||(fe={}));var $;(function(e){e.CHECKOUT="checkout",e.CHECKOUT_EMAIL="checkout/email",e.SEGMENTATION="segmentation",e.BUNDLE="bundle",e.COMMITMENT="commitment",e.RECOMMENDATION="recommendation",e.EMAIL="email",e.PAYMENT="payment",e.CHANGE_PLAN_TEAM_PLANS="change-plan/team-upgrade/plans",e.CHANGE_PLAN_TEAM_PAYMENT="change-plan/team-upgrade/payment"})($||($={}));var Rt=function(e){var t;return(t=pi.get(e))!==null&&t!==void 0?t:e},pi=new Map([["countrySpecific","cs"],["quantity","q"],["authCode","code"],["checkoutPromoCode","apc"],["rurl","rUrl"],["curl","cUrl"],["ctxrturl","ctxRtUrl"],["country","co"],["language","lang"],["clientId","cli"],["context","ctx"],["productArrangementCode","pa"],["offerType","ot"],["marketSegment","ms"]]);var jr=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Wr=function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,o=[],s;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return o};function ve(e,t,r){var n,i;try{for(var o=jr(Object.entries(e)),s=o.next();!s.done;s=o.next()){var a=Wr(s.value,2),c=a[0],l=a[1],u=Rt(c);l!=null&&r.has(u)&&t.set(u,l)}}catch(p){n={error:p}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}}function Ye(e){switch(e){case Y.PRODUCTION:return"https://commerce.adobe.com";default:return"https://commerce-stg.adobe.com"}}function $e(e,t){var r,n;for(var i in e){var o=e[i];try{for(var s=(r=void 0,jr(Object.entries(o))),a=s.next();!a.done;a=s.next()){var c=Wr(a.value,2),l=c[0],u=c[1];if(u!=null){var p=Rt(l);t.set("items["+i+"]["+p+"]",u)}}}catch(f){r={error:f}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}}}var mi=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};function Hr(e){gi(e);var t=e.env,r=e.items,n=e.workflowStep,i=mi(e,["env","items","workflowStep"]),o=new URL(Ye(t));return o.pathname=n+"/",$e(r,o.searchParams),ve(i,o.searchParams,di),o.toString()}var di=new Set(["cli","co","lang","ctx","cUrl","mv","nglwfdata","otac","promoid","rUrl","sdid","spint","trackingid","code","campaignid","appctxid"]),Ei=["env","workflowStep","clientId","country","items"];function gi(e){var t,r;try{for(var n=hi(Ei),i=n.next();!i.done;i=n.next()){var o=i.value;if(!e[o])throw new Error('Argument "checkoutData" is not valid, missing: '+o)}}catch(s){t={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}return!0}var xi=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},_i="p_draft_landscape",vi="/store/";function Dt(e){bi(e);var t=e.env,r=e.items,n=e.workflowStep,i=e.ms,o=e.marketSegment,s=e.ot,a=e.offerType,c=e.pa,l=e.productArrangementCode,u=e.landscape,p=xi(e,["env","items","workflowStep","ms","marketSegment","ot","offerType","pa","productArrangementCode","landscape"]),f={marketSegment:o??i,offerType:a??s,productArrangementCode:l??c},d=new URL(Ye(t));return d.pathname=""+vi+n,n!==$.SEGMENTATION&&n!==$.CHANGE_PLAN_TEAM_PLANS&&$e(r,d.searchParams),n===$.SEGMENTATION&&ve(f,d.searchParams,Ut),ve(p,d.searchParams,Ut),u===G.DRAFT&&ve({af:_i},d.searchParams,Ut),d.toString()}var Ut=new Set(["af","ai","apc","appctxid","cli","co","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"]),Ti=["env","workflowStep","clientId","country"];function bi(e){var t,r;try{for(var n=yi(Ti),i=n.next();!i.done;i=n.next()){var o=i.value;if(!e[o])throw new Error('Argument "checkoutData" is not valid, missing: '+o)}}catch(s){t={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}if(e.workflowStep!==$.SEGMENTATION&&e.workflowStep!==$.CHANGE_PLAN_TEAM_PLANS&&!e.items)throw new Error('Argument "checkoutData" is not valid, missing: items');return!0}function Mt(e,t){switch(e){case fe.V2:return Hr(t);case fe.V3:return Dt(t);default:return console.warn("Unsupported CheckoutType, will use UCv3 as default. Given type: "+e),Dt(t)}}var kt;(function(e){e.BASE="BASE",e.TRIAL="TRIAL",e.PROMOTION="PROMOTION"})(kt||(kt={}));var I;(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"})(I||(I={}));var L;(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"})(L||(L={}));var Gt;(function(e){e.INDIVIDUAL="INDIVIDUAL",e.TEAM="TEAM",e.ENTERPRISE="ENTERPRISE"})(Gt||(Gt={}));var Ft;(function(e){e.COM="COM",e.EDU="EDU",e.GOV="GOV"})(Ft||(Ft={}));var Vt;(function(e){e.DIRECT="DIRECT",e.INDIRECT="INDIRECT"})(Vt||(Vt={}));var jt;(function(e){e.ENTERPRISE_PRODUCT="ENTERPRISE_PRODUCT",e.ETLA="ETLA",e.RETAIL="RETAIL",e.VIP="VIP",e.VIPMP="VIPMP",e.FREE="FREE"})(jt||(jt={}));var Wt=()=>{};Wt.createContext=Wt;var Si=G.PUBLISHED,Xr=e=>{switch(e){case Y.PRODUCTION:return"https://wcs.adobe.io";case Y.STAGE:return"https://wcs-stage.adobe.io";case Y.LOCAL:return"http://localhost:3002";default:return"https://wcs-stage.adobe.io"}},Br=(e,t)=>{var r;return e.api_key=t.apiKey,e.landscape=(r=t.landscape)!==null&&r!==void 0?r:Si,e};var Pi=function(e,t,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(u){try{l(n.next(u))}catch(p){s(p)}}function c(u){try{l(n.throw(u))}catch(p){s(p)}}function l(u){u.done?o(u.value):i(u.value).then(a,c)}l((n=n.apply(e,t||[])).next())})},Ht=class extends It{constructor(t){super(t),this.apiPaths={getWebCommerceArtifact:"web_commerce_artifact"},this.getWebCommerceArtifact=(r,n,i,o)=>Pi(this,void 0,void 0,function*(){let s=this.buildUrl(this.apiPaths.getWebCommerceArtifact,n,r,a=>Xr(a),(a,c)=>this.evaluateGetWebCommerceArtifactParams(a,c));return this.fetchOptions.fetch(s,{signal:o,headers:Object.assign({},this.commonHeaders()),mode:"cors"}).then(a=>this.failOnBadStatusOrParseBody(a,`GET ${s}`)).then(a=>{let l=a.data;return{data:this.transformDatum(l,i)}})})}evaluateGetWebCommerceArtifactParams(t,r){let n={};return this.setParams(n,"offer_selector_ids",r.offerSelectorIds.join(",")),this.setParams(n,"country",r.country),this.setParams(n,"language",r.language),this.setParams(n,"currency",r.currency),this.setParams(n,"locale",r.locale),this.setParams(n,"promotion_code",r.promotionCode),Br(n,t)}},Yr=Ht;var qe=e=>new Yr(e).getWebCommerceArtifact;var $r="tacocat.js";var ze=(e,t)=>String(e??"").toLowerCase()==String(t??"").toLowerCase(),qr=e=>`${e??""}`.replace(/[&<>'"]/g,t=>({"&":"&","<":"<",">":">","'":"'",'"':"""})[t]??t)??"";function w(e,t={},{metadata:r=!0,search:n=!0,storage:i=!0}={}){let o;if(n&&o==null){let s=new URLSearchParams(window.location.search),a=Te(n)?n:e;o=s.get(a)}if(i&&o==null){let s=Te(i)?i:e;o=window.sessionStorage.getItem(s)??window.localStorage.getItem(s)}if(r&&o==null){let s=Qr(Te(r)?r:e);o=document.documentElement.querySelector(`meta[name="${s}"]`)?.content}return o??t[e]}var be=()=>{};var zr=e=>typeof e=="boolean",ce=e=>typeof e=="function",Ze=e=>typeof e=="number",Zr=e=>e!=null&&typeof e=="object";var Te=e=>typeof e=="string",Xt=e=>Te(e)&&e,Se=e=>Ze(e)&&Number.isFinite(e)&&e>0;function Pe(e,t=r=>r==null||r===""){return e!=null&&Object.entries(e).forEach(([r,n])=>{t(n)&&delete e[r]}),e}function v(e,t){if(zr(e))return e;let r=String(e);return r==="1"||r==="true"?!0:r==="0"||r==="false"?!1:t}function ie(e,t,r){let n=Object.values(t);return n.find(i=>ze(i,e))??r??n[0]}function Qr(e=""){return String(e).replace(/(\p{Lowercase_Letter})(\p{Uppercase_Letter})/gu,(t,r,n)=>`${r}-${n}`).replace(/\W+/gu,"-").toLowerCase()}function Ae(e,t=1){return Ze(e)||(e=Number.parseInt(e,10)),!Number.isNaN(e)&&e>0&&Number.isFinite(e)?e:t}var Ai=Date.now(),Bt=()=>`(+${Date.now()-Ai}ms)`,Qe=new Set,wi=v(w("tacocat.debug",{},{metadata:!1}),typeof process<"u"&&process.env?.DEBUG);function Jr(e){let t=`[${$r}/${e}]`,r=(s,a,...c)=>s?!0:(i(a,...c),!1),n=wi?(s,...a)=>{console.debug(`${t} ${s}`,...a,Bt())}:()=>{},i=(s,...a)=>{let c=`${t} ${s}`;Qe.forEach(([l])=>l(c,...a))};return{assert:r,debug:n,error:i,warn:(s,...a)=>{let c=`${t} ${s}`;Qe.forEach(([,l])=>l(c,...a))}}}function Oi(e,t){let r=[e,t];return Qe.add(r),()=>{Qe.delete(r)}}Oi((e,...t)=>{console.error(e,...t,Bt())},(e,...t)=>{console.warn(e,...t,Bt())});var Li="no promo",Kr="promo-tag",Ni="yellow",Ci="neutral",Ii=(e,t,r)=>{let n=o=>o||Li,i=r?` (was "${n(t)}")`:"";return`${n(e)}${i}`},Ri="cancel-context",Ue=(e,t)=>{let r=e===Ri,n=!r&&e?.length>0,i=(n||r)&&(t&&t!=e||!t&&!r),o=i&&n||!i&&!!t,s=o?e||t:void 0;return{effectivePromoCode:s,overridenPromoCode:e,className:o?Kr:`${Kr} no-promo`,text:Ii(s,t,i),variant:o?Ni:Ci,isOverriden:i}};var Yt=function(e,t){return Yt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},Yt(e,t)};function De(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Yt(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var T=function(){return T=Object.assign||function(t){for(var r,n=1,i=arguments.length;n0}),r=[],n=0,i=t;n1)throw new RangeError("integer-width stems only accept a single optional option");i.options[0].replace(Mi,function(a,c,l,u,p,f){if(c)t.minimumIntegerDigits=l.length;else{if(u&&p)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(ln.test(i.stem)){t.minimumIntegerDigits=i.stem.length;continue}if(on.test(i.stem)){if(i.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");i.stem.replace(on,function(a,c,l,u,p,f){return l==="*"?t.minimumFractionDigits=c.length:u&&u[0]==="#"?t.maximumFractionDigits=u.length:p&&f?(t.minimumFractionDigits=p.length,t.maximumFractionDigits=p.length+f.length):(t.minimumFractionDigits=c.length,t.maximumFractionDigits=c.length),""}),i.options.length&&(t=T(T({},t),sn(i.options[0])));continue}if(un.test(i.stem)){t=T(T({},t),sn(i.stem));continue}var o=fn(i.stem);o&&(t=T(T({},t),o));var s=ki(i.stem);s&&(t=T(T({},t),s))}return t}var zt,Gi=new RegExp("^"+qt.source+"*"),Fi=new RegExp(qt.source+"*$");function x(e,t){return{start:e,end:t}}var Vi=!!String.prototype.startsWith,ji=!!String.fromCodePoint,Wi=!!Object.fromEntries,Hi=!!String.prototype.codePointAt,Xi=!!String.prototype.trimStart,Bi=!!String.prototype.trimEnd,Yi=!!Number.isSafeInteger,$i=Yi?Number.isSafeInteger:function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e&&Math.abs(e)<=9007199254740991},Qt=!0;try{mn=gn("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu"),Qt=((zt=mn.exec("a"))===null||zt===void 0?void 0:zt[0])==="a"}catch{Qt=!1}var mn,hn=Vi?function(t,r,n){return t.startsWith(r,n)}:function(t,r,n){return t.slice(n,n+r.length)===r},Jt=ji?String.fromCodePoint:function(){for(var t=[],r=0;ro;){if(s=t[o++],s>1114111)throw RangeError(s+" is not a valid code point");n+=s<65536?String.fromCharCode(s):String.fromCharCode(((s-=65536)>>10)+55296,s%1024+56320)}return n},dn=Wi?Object.fromEntries:function(t){for(var r={},n=0,i=t;n=n)){var i=t.charCodeAt(r),o;return i<55296||i>56319||r+1===n||(o=t.charCodeAt(r+1))<56320||o>57343?i:(i-55296<<10)+(o-56320)+65536}},qi=Xi?function(t){return t.trimStart()}:function(t){return t.replace(Gi,"")},zi=Bi?function(t){return t.trimEnd()}:function(t){return t.replace(Fi,"")};function gn(e,t){return new RegExp(e,t)}var Kt;Qt?(Zt=gn("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu"),Kt=function(t,r){var n;Zt.lastIndex=r;var i=Zt.exec(t);return(n=i[1])!==null&&n!==void 0?n:""}):Kt=function(t,r){for(var n=[];;){var i=En(t,r);if(i===void 0||yn(i)||Ji(i))break;n.push(i),r+=i>=65536?2:1}return Jt.apply(void 0,n)};var Zt,xn=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.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,n){for(var i=[];!this.isEOF();){var o=this.char();if(o===123){var s=this.parseArgument(t,n);if(s.err)return s;i.push(s.val)}else{if(o===125&&t>0)break;if(o===35&&(r==="plural"||r==="selectordinal")){var a=this.clonePosition();this.bump(),i.push({type:A.pound,location:x(a,this.clonePosition())})}else if(o===60&&!this.ignoreTag&&this.peek()===47){if(n)break;return this.error(g.UNMATCHED_CLOSING_TAG,x(this.clonePosition(),this.clonePosition()))}else if(o===60&&!this.ignoreTag&&er(this.peek()||0)){var s=this.parseTag(t,r);if(s.err)return s;i.push(s.val)}else{var s=this.parseLiteral(t,r);if(s.err)return s;i.push(s.val)}}}return{val:i,err:null}},e.prototype.parseTag=function(t,r){var n=this.clonePosition();this.bump();var i=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:A.literal,value:"<"+i+"/>",location:x(n,this.clonePosition())},err:null};if(this.bumpIf(">")){var o=this.parseMessage(t+1,r,!0);if(o.err)return o;var s=o.val,a=this.clonePosition();if(this.bumpIf("")?{val:{type:A.tag,value:i,children:s,location:x(n,this.clonePosition())},err:null}:this.error(g.INVALID_TAG,x(a,this.clonePosition())))}else return this.error(g.UNCLOSED_TAG,x(n,this.clonePosition()))}else return this.error(g.INVALID_TAG,x(n,this.clonePosition()))},e.prototype.parseTagName=function(){var t=this.offset();for(this.bump();!this.isEOF()&&Qi(this.char());)this.bump();return this.message.slice(t,this.offset())},e.prototype.parseLiteral=function(t,r){for(var n=this.clonePosition(),i="";;){var o=this.tryParseQuote(r);if(o){i+=o;continue}var s=this.tryParseUnquoted(t,r);if(s){i+=s;continue}var a=this.tryParseLeftAngleBracket();if(a){i+=a;continue}break}var c=x(n,this.clonePosition());return{val:{type:A.literal,value:i,location:c},err:null}},e.prototype.tryParseLeftAngleBracket=function(){return!this.isEOF()&&this.char()===60&&(this.ignoreTag||!Zi(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 n=this.char();if(n===39)if(this.peek()===39)r.push(39),this.bump();else{this.bump();break}else r.push(n);this.bump()}return Jt.apply(void 0,r)},e.prototype.tryParseUnquoted=function(t,r){if(this.isEOF())return null;var n=this.char();return n===60||n===123||n===35&&(r==="plural"||r==="selectordinal")||n===125&&t>0?null:(this.bump(),Jt(n))},e.prototype.parseArgument=function(t,r){var n=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(g.EXPECT_ARGUMENT_CLOSING_BRACE,x(n,this.clonePosition()));if(this.char()===125)return this.bump(),this.error(g.EMPTY_ARGUMENT,x(n,this.clonePosition()));var i=this.parseIdentifierIfPossible().value;if(!i)return this.error(g.MALFORMED_ARGUMENT,x(n,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(g.EXPECT_ARGUMENT_CLOSING_BRACE,x(n,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:A.argument,value:i,location:x(n,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(g.EXPECT_ARGUMENT_CLOSING_BRACE,x(n,this.clonePosition())):this.parseArgumentOptions(t,r,i,n);default:return this.error(g.MALFORMED_ARGUMENT,x(n,this.clonePosition()))}},e.prototype.parseIdentifierIfPossible=function(){var t=this.clonePosition(),r=this.offset(),n=Kt(this.message,r),i=r+n.length;this.bumpTo(i);var o=this.clonePosition(),s=x(t,o);return{value:n,location:s}},e.prototype.parseArgumentOptions=function(t,r,n,i){var o,s=this.clonePosition(),a=this.parseIdentifierIfPossible().value,c=this.clonePosition();switch(a){case"":return this.error(g.EXPECT_ARGUMENT_TYPE,x(s,c));case"number":case"date":case"time":{this.bumpSpace();var l=null;if(this.bumpIf(",")){this.bumpSpace();var u=this.clonePosition(),p=this.parseSimpleArgStyleIfPossible();if(p.err)return p;var f=zi(p.val);if(f.length===0)return this.error(g.EXPECT_ARGUMENT_STYLE,x(this.clonePosition(),this.clonePosition()));var d=x(u,this.clonePosition());l={style:f,styleLocation:d}}var h=this.tryParseArgumentClose(i);if(h.err)return h;var E=x(i,this.clonePosition());if(l&&hn(l?.style,"::",0)){var S=qi(l.style.slice(2));if(a==="number"){var p=this.parseNumberSkeletonFromString(S,l.styleLocation);return p.err?p:{val:{type:A.number,value:n,location:E,style:p.val},err:null}}else{if(S.length===0)return this.error(g.EXPECT_DATE_TIME_SKELETON,E);var f={type:pe.dateTime,pattern:S,location:l.styleLocation,parsedOptions:this.shouldParseSkeletons?rn(S):{}},N=a==="date"?A.date:A.time;return{val:{type:N,value:n,location:E,style:f},err:null}}}return{val:{type:a==="number"?A.number:a==="date"?A.date:A.time,value:n,location:E,style:(o=l?.style)!==null&&o!==void 0?o:null},err:null}}case"plural":case"selectordinal":case"select":{var P=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(g.EXPECT_SELECT_ARGUMENT_OPTIONS,x(P,T({},P)));this.bumpSpace();var b=this.parseIdentifierIfPossible(),O=0;if(a!=="select"&&b.value==="offset"){if(!this.bumpIf(":"))return this.error(g.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,x(this.clonePosition(),this.clonePosition()));this.bumpSpace();var p=this.tryParseDecimalInteger(g.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,g.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);if(p.err)return p;this.bumpSpace(),b=this.parseIdentifierIfPossible(),O=p.val}var y=this.tryParsePluralOrSelectOptions(t,a,r,b);if(y.err)return y;var h=this.tryParseArgumentClose(i);if(h.err)return h;var C=x(i,this.clonePosition());return a==="select"?{val:{type:A.select,value:n,options:dn(y.val),location:C},err:null}:{val:{type:A.plural,value:n,options:dn(y.val),offset:O,pluralType:a==="plural"?"cardinal":"ordinal",location:C},err:null}}default:return this.error(g.INVALID_ARGUMENT_TYPE,x(s,c))}},e.prototype.tryParseArgumentClose=function(t){return this.isEOF()||this.char()!==125?this.error(g.EXPECT_ARGUMENT_CLOSING_BRACE,x(t,this.clonePosition())):(this.bump(),{val:!0,err:null})},e.prototype.parseSimpleArgStyleIfPossible=function(){for(var t=0,r=this.clonePosition();!this.isEOF();){var n=this.char();switch(n){case 39:{this.bump();var i=this.clonePosition();if(!this.bumpUntil("'"))return this.error(g.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,x(i,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 n=[];try{n=cn(t)}catch{return this.error(g.INVALID_NUMBER_SKELETON,r)}return{val:{type:pe.number,tokens:n,location:r,parsedOptions:this.shouldParseSkeletons?pn(n):{}},err:null}},e.prototype.tryParsePluralOrSelectOptions=function(t,r,n,i){for(var o,s=!1,a=[],c=new Set,l=i.value,u=i.location;;){if(l.length===0){var p=this.clonePosition();if(r!=="select"&&this.bumpIf("=")){var f=this.tryParseDecimalInteger(g.EXPECT_PLURAL_ARGUMENT_SELECTOR,g.INVALID_PLURAL_ARGUMENT_SELECTOR);if(f.err)return f;u=x(p,this.clonePosition()),l=this.message.slice(p.offset,this.offset())}else break}if(c.has(l))return this.error(r==="select"?g.DUPLICATE_SELECT_ARGUMENT_SELECTOR:g.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,u);l==="other"&&(s=!0),this.bumpSpace();var d=this.clonePosition();if(!this.bumpIf("{"))return this.error(r==="select"?g.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:g.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,x(this.clonePosition(),this.clonePosition()));var h=this.parseMessage(t+1,r,n);if(h.err)return h;var E=this.tryParseArgumentClose(d);if(E.err)return E;a.push([l,{value:h.val,location:x(d,this.clonePosition())}]),c.add(l),this.bumpSpace(),o=this.parseIdentifierIfPossible(),l=o.value,u=o.location}return a.length===0?this.error(r==="select"?g.EXPECT_SELECT_ARGUMENT_SELECTOR:g.EXPECT_PLURAL_ARGUMENT_SELECTOR,x(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!s?this.error(g.MISSING_OTHER_CLAUSE,x(this.clonePosition(),this.clonePosition())):{val:a,err:null}},e.prototype.tryParseDecimalInteger=function(t,r){var n=1,i=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(n=-1);for(var o=!1,s=0;!this.isEOF();){var a=this.char();if(a>=48&&a<=57)o=!0,s=s*10+(a-48),this.bump();else break}var c=x(i,this.clonePosition());return o?(s*=n,$i(s)?{val:s,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=En(this.message,t);if(r===void 0)throw Error("Offset "+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(hn(this.message,t,this.offset())){for(var r=0;r=0?(this.bumpTo(n),!0):(this.bumpTo(this.message.length),!1)},e.prototype.bumpTo=function(t){if(this.offset()>t)throw Error("targetOffset "+t+" must be greater than or equal to the current offset "+this.offset());for(t=Math.min(t,this.message.length);;){var r=this.offset();if(r===t)break;if(r>t)throw Error("targetOffset "+t+" is at invalid UTF-16 code unit boundary");if(this.bump(),this.isEOF())break}},e.prototype.bumpSpace=function(){for(;!this.isEOF()&&yn(this.char());)this.bump()},e.prototype.peek=function(){if(this.isEOF())return null;var t=this.char(),r=this.offset(),n=this.message.charCodeAt(r+(t>=65536?2:1));return n??null},e}();function er(e){return e>=97&&e<=122||e>=65&&e<=90}function Zi(e){return er(e)||e===47}function Qi(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 yn(e){return e>=9&&e<=13||e===32||e===133||e>=8206&&e<=8207||e===8232||e===8233}function Ji(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 tr(e){e.forEach(function(t){if(delete t.location,rt(t)||nt(t))for(var r in t.options)delete t.options[r].location,tr(t.options[r].value);else Ke(t)&&ot(t.style)||(et(t)||tt(t))&&Me(t.style)?delete t.style.location:it(t)&&tr(t.children)})}function _n(e,t){t===void 0&&(t={}),t=T({shouldParseSkeletons:!0,requiresOtherClause:!0},t);var r=new xn(e,t).parse();if(r.err){var n=SyntaxError(g[r.err.kind]);throw n.location=r.err.location,n.originalMessage=r.err.message,n}return t?.captureLocation||tr(r.val),r.val}function ke(e,t){var r=t&&t.cache?t.cache:io,n=t&&t.serializer?t.serializer:no,i=t&&t.strategy?t.strategy:eo;return i(e,{cache:r,serializer:n})}function Ki(e){return e==null||typeof e=="number"||typeof e=="boolean"}function vn(e,t,r,n){var i=Ki(n)?n:r(n),o=t.get(i);return typeof o>"u"&&(o=e.call(this,n),t.set(i,o)),o}function Tn(e,t,r){var n=Array.prototype.slice.call(arguments,3),i=r(n),o=t.get(i);return typeof o>"u"&&(o=e.apply(this,n),t.set(i,o)),o}function rr(e,t,r,n,i){return r.bind(t,e,n,i)}function eo(e,t){var r=e.length===1?vn:Tn;return rr(e,this,r,t.cache.create(),t.serializer)}function to(e,t){return rr(e,this,Tn,t.cache.create(),t.serializer)}function ro(e,t){return rr(e,this,vn,t.cache.create(),t.serializer)}var no=function(){return JSON.stringify(arguments)};function nr(){this.cache=Object.create(null)}nr.prototype.get=function(e){return this.cache[e]};nr.prototype.set=function(e,t){this.cache[e]=t};var io={create:function(){return new nr}},st={variadic:to,monadic:ro};var me;(function(e){e.MISSING_VALUE="MISSING_VALUE",e.INVALID_VALUE="INVALID_VALUE",e.MISSING_INTL_API="MISSING_INTL_API"})(me||(me={}));var Ge=function(e){De(t,e);function t(r,n,i){var o=e.call(this,r)||this;return o.code=n,o.originalMessage=i,o}return t.prototype.toString=function(){return"[formatjs Error: "+this.code+"] "+this.message},t}(Error);var ir=function(e){De(t,e);function t(r,n,i,o){return e.call(this,'Invalid values for "'+r+'": "'+n+'". Options are "'+Object.keys(i).join('", "')+'"',me.INVALID_VALUE,o)||this}return t}(Ge);var bn=function(e){De(t,e);function t(r,n,i){return e.call(this,'Value for "'+r+'" must be of type '+n,me.INVALID_VALUE,i)||this}return t}(Ge);var Sn=function(e){De(t,e);function t(r,n){return e.call(this,'The intl string context variable "'+r+'" was not provided to the string "'+n+'"',me.MISSING_VALUE,n)||this}return t}(Ge);var U;(function(e){e[e.literal=0]="literal",e[e.object=1]="object"})(U||(U={}));function oo(e){return e.length<2?e:e.reduce(function(t,r){var n=t[t.length-1];return!n||n.type!==U.literal||r.type!==U.literal?t.push(r):n.value+=r.value,t},[])}function so(e){return typeof e=="function"}function Fe(e,t,r,n,i,o,s){if(e.length===1&&$t(e[0]))return[{type:U.literal,value:e[0].value}];for(var a=[],c=0,l=e;c0?e.substring(0,n):"";let i=wn(e.split("").reverse().join("")),o=r-i,s=e.substring(o,o+1),a=o+(s==="."||s===","?1:0);t.suffix=i>0?e.substring(a,r):"",t.mask=e.substring(n,a),t.maskHasNegativeSign=t.mask.charAt(0)==="-",t.maskHasPositiveSign=t.mask.charAt(0)==="+";let c=t.mask.match(fo);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 mo(e,t,r){let n=!1,i={value:e};e<0&&(n=!0,i.value=-i.value),i.sign=n?"-":"",i.value=Number(i.value).toFixed(t.fraction&&t.fraction.length),i.value=Number(i.value).toString();let o=t.fraction&&t.fraction.lastIndexOf("0"),[s="0",a=""]=i.value.split(".");return(!a||a&&a.length<=o)&&(a=o<0?"":(+("0."+a)).toFixed(o+1).replace("0.","")),i.integer=s,i.fraction=a,ho(i,t),(i.result==="0"||i.result==="")&&(n=!1,i.sign=""),!n&&t.maskHasPositiveSign?i.sign="+":n&&t.maskHasPositiveSign?i.sign="-":n&&(i.sign=r&&r.enforceMaskSign&&!t.maskHasNegativeSign?"":"-"),i}function ho(e,t){e.result="";let r=t.integer.split(t.separator),n=r.join(""),i=n&&n.indexOf("0");if(i>-1)for(;e.integer.lengthMath.round(e*20)/20},sr=(e,t)=>({accept:e,round:t}),_o=[sr(({divisor:e,price:t})=>t%e==0,({divisor:e,price:t})=>t/e),sr(({usePrecision:e})=>e,({divisor:e,price:t})=>Math.ceil(Math.floor(t*1e4/e)/100)/100),sr(()=>!0,({divisor:e,price:t})=>Math.ceil(Math.floor(t*100/e)/100))],ar={[I.YEAR]:{[L.MONTHLY]:Ve.MONTH,[L.ANNUAL]:Ve.YEAR},[I.MONTH]:{[L.MONTHLY]:Ve.MONTH}},vo=(e,t)=>e.indexOf(`'${t}'`)===0,To=(e,t=!0)=>{let r=e.replace(/'.*?'/,"").trim(),n=Un(r);return!!n?t||(r=r.replace(/[,\.]0+/,n)):r=r.replace(/\s?(#.*0)(?!\s)?/,"$&"+So(e)),r},bo=e=>{let t=Po(e),r=vo(e,t),n=e.replace(/'.*?'/,""),i=Cn.test(n)||In.test(n);return{currencySymbol:t,isCurrencyFirst:r,hasCurrencySpace:i}},Rn=e=>e.replace(Cn,Nn).replace(In,Nn),So=e=>e.match(/#(.?)#/)?.[1]===Ln?go:Ln,Po=e=>e.match(/'(.*?)'/)?.[1]??"",Un=e=>e.match(/0(.?)0/)?.[1]??"";function at({formatString:e,price:t,usePrecision:r,isIndianPrice:n=!1},i,o=s=>s){let{currencySymbol:s,isCurrencyFirst:a,hasCurrencySpace:c}=bo(e),l=r?Un(e):"",u=To(e,r),p=r?2:0,f=o(t,{currencySymbol:s}),d=n?f.toLocaleString("hi-IN",{minimumFractionDigits:p,maximumFractionDigits:p}):On(u,f),h=r?d.lastIndexOf(l):d.length,E=d.substring(0,h),S=d.substring(h+1);return{accessiblePrice:e.replace(/'.*?'/,"SYMBOL").replace(/#.*0/,d).replace(/SYMBOL/,s),currencySymbol:s,decimals:S,decimalsDelimiter:l,hasCurrencySpace:c,integer:E,isCurrencyFirst:a,recurrenceTerm:i}}var Dn=e=>{let{commitment:t,term:r,usePrecision:n}=e,i=xo[r]??1;return at(e,i>1?Ve.MONTH:ar[t]?.[r],(o,{currencySymbol:s})=>{let a={divisor:i,price:o,usePrecision:n},{round:c}=_o.find(({accept:u})=>u(a));if(!c)throw new Error(`Missing rounding rule for: ${JSON.stringify(a)}`);return(yo[s]??(u=>u))(c(a))})},Mn=({commitment:e,term:t,...r})=>at(r,ar[e]?.[t]),kn=e=>{let{commitment:t,term:r}=e;return t===I.YEAR&&r===L.MONTHLY?at(e,Ve.YEAR,n=>n*12):at(e,ar[t]?.[r])};var Ao={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 {alternativePrice}",strikethroughAriaLabel:"Regularly at {strikethroughPrice}"},wo=Jr("ConsonantTemplates/price"),Oo=/<.+?>/g,W={container:"price",containerOptical:"price-optical",containerStrikethrough:"price-strikethrough",containerAnnual:"price-annual",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"},he={perUnitLabel:"perUnitLabel",perUnitAriaLabel:"perUnitAriaLabel",recurrenceLabel:"recurrenceLabel",recurrenceAriaLabel:"recurrenceAriaLabel",taxExclusiveLabel:"taxExclusiveLabel",taxInclusiveLabel:"taxInclusiveLabel",strikethroughAriaLabel:"strikethroughAriaLabel"},Lo="TAX_EXCLUSIVE",No=e=>Zr(e)?Object.entries(e).filter(([,t])=>Te(t)||Ze(t)||t===!0).reduce((t,[r,n])=>t+` ${r}${n===!0?"":'="'+qr(n)+'"'}`,""):"",z=(e,t,r,n=!1)=>`${n?Rn(t):t??""}`;function Co(e,{accessibleLabel:t,currencySymbol:r,decimals:n,decimalsDelimiter:i,hasCurrencySpace:o,integer:s,isCurrencyFirst:a,recurrenceLabel:c,perUnitLabel:l,taxInclusivityLabel:u},p={}){let f=z(W.currencySymbol,r),d=z(W.currencySpace,o?" ":""),h="";return a&&(h+=f+d),h+=z(W.integer,s),h+=z(W.decimalsDelimiter,i),h+=z(W.decimals,n),a||(h+=d+f),h+=z(W.recurrence,c,null,!0),h+=z(W.unitType,l,null,!0),h+=z(W.taxInclusivity,u,!0),z(e,h,{...p,"aria-label":t})}var de=({displayOptical:e=!1,displayStrikethrough:t=!1,displayAnnual:r=!1}={})=>({country:n,displayFormatted:i=!0,displayRecurrence:o=!0,displayPerUnit:s=!1,displayTax:a=!1,language:c,literals:l={}}={},{commitment:u,formatString:p,price:f,priceWithoutDiscount:d,taxDisplay:h,taxTerm:E,term:S,usePrecision:N}={},P={})=>{Object.entries({country:n,formatString:p,language:c,price:f}).forEach(([re,wt])=>{if(wt==null)throw new Error(`Argument "${re}" is missing`)});let b={...Ao,...l},O=`${c.toLowerCase()}-${n.toUpperCase()}`;function y(re,wt){let Ot=b[re];if(Ot==null)return"";try{return new An(Ot.replace(Oo,""),O).format(wt)}catch{return wo.error("Failed to format literal:",Ot),""}}let C=t&&d?d:f,M=e?Dn:Mn;r&&(M=kn);let{accessiblePrice:X,recurrenceTerm:B,...R}=M({commitment:u,formatString:p,term:S,price:e?f:C,usePrecision:N,isIndianPrice:n==="IN"}),j=X,ae="";if(v(o)&&B){let re=y(he.recurrenceAriaLabel,{recurrenceTerm:B});re&&(j+=" "+re),ae=y(he.recurrenceLabel,{recurrenceTerm:B})}let le="";if(v(s)){le=y(he.perUnitLabel,{perUnit:"LICENSE"});let re=y(he.perUnitAriaLabel,{perUnit:"LICENSE"});re&&(j+=" "+re)}let te="";v(a)&&E&&(te=y(h===Lo?he.taxExclusiveLabel:he.taxInclusiveLabel,{taxTerm:E}),te&&(j+=" "+te)),t&&(j=y(he.strikethroughAriaLabel,{strikethroughPrice:j}));let q=W.container;if(e&&(q+=" "+W.containerOptical),t&&(q+=" "+W.containerStrikethrough),r&&(q+=" "+W.containerAnnual),v(i))return Co(q,{...R,accessibleLabel:j,recurrenceLabel:ae,perUnitLabel:le,taxInclusivityLabel:te},P);let{currencySymbol:ye,decimals:He,decimalsDelimiter:Xe,hasCurrencySpace:Ce,integer:At,isCurrencyFirst:ai}=R,_e=[At,Xe,He];ai?(_e.unshift(Ce?"\xA0":""),_e.unshift(ye)):(_e.push(Ce?"\xA0":""),_e.push(ye)),_e.push(ae,le,te);let ci=_e.join("");return z(q,ci,P)},Gn=()=>(e,t,r)=>{let i=(e.displayOldPrice===void 0||v(e.displayOldPrice))&&t.priceWithoutDiscount&&t.priceWithoutDiscount!=t.price;return`${de()(e,t,r)}${i?" "+de({displayStrikethrough:!0})(e,t,r):""}`};var cr=de(),ur=Gn(),lr=de({displayOptical:!0}),fr=de({displayStrikethrough:!0}),pr=de({displayAnnual:!0});var Io=(e,t)=>{if(!(!Se(e)||!Se(t)))return Math.floor((t-e)/t*100)},Fn=()=>(e,t,r)=>{let{price:n,priceWithoutDiscount:i}=t,o=Io(n,i);return o===void 0?'':`${o}%`};var mr=Fn();var hr="ABM",dr="PUF",Er="M2M",gr="PERPETUAL",Vn="P3Y",Ro="TAX_INCLUSIVE_DETAILS",Uo="TAX_EXCLUSIVE",jn={ABM:hr,PUF:dr,M2M:Er,PERPETUAL:gr,P3Y:Vn},tc={[hr]:{commitment:I.YEAR,term:L.MONTHLY},[dr]:{commitment:I.YEAR,term:L.ANNUAL},[Er]:{commitment:I.MONTH,term:L.MONTHLY},[gr]:{commitment:I.PERPETUAL,term:void 0},[Vn]:{commitment:I.THREE_MONTHS,term:L.P3Y}},Wn="Value is not an offer",ct=e=>{if(typeof e!="object")return Wn;let{commitment:t,term:r}=e,n=Do(t,r);return{...e,planType:n}};var Do=(e,t)=>{if(e===void 0)return Wn;if(e===""&&t==="")return"";let r="";return e===I.YEAR?t===L.MONTHLY?r=hr:t===L.ANNUAL&&(r=dr):e===I.MONTH?t===L.MONTHLY&&(r=Er):e===I.PERPETUAL&&(r=gr),r};function xr(e){let{priceDetails:t}=e,{price:r,priceWithoutDiscount:n,priceWithoutTax:i,priceWithoutDiscountAndTax:o,taxDisplay:s}=t;if(s!==Ro)return e;let a={...e,priceDetails:{...t,price:i??r,priceWithoutDiscount:o??n,taxDisplay:Uo}};return a.offerType==="TRIAL"&&a.priceDetails.price===0&&(a.priceDetails.price=a.priceDetails.priceWithoutDiscount),a}var{freeze:Ee}=Object,Z=Ee({...fe}),Q=Ee({...$}),H=Ee({...Y}),yr=Ee({...I}),we=Ee({...Re}),_r=Ee({...jn}),vr=Ee({...L});var Or={};li(Or,{CLASS_NAME_FAILED:()=>ut,CLASS_NAME_PENDING:()=>lt,CLASS_NAME_RESOLVED:()=>ft,ERROR_MESSAGE_BAD_REQUEST:()=>Tr,ERROR_MESSAGE_MISSING_LITERALS_URL:()=>Sr,ERROR_MESSAGE_OFFER_NOT_FOUND:()=>br,EVENT_TYPE_ERROR:()=>Mo,EVENT_TYPE_FAILED:()=>pt,EVENT_TYPE_PENDING:()=>mt,EVENT_TYPE_READY:()=>ge,EVENT_TYPE_RESOLVED:()=>ht,LOG_NAMESPACE:()=>Pr,PARAM_AOS_API_KEY:()=>ko,PARAM_ENV:()=>Ar,PARAM_LANDSCAPE:()=>wr,PARAM_WCS_API_KEY:()=>Go,STATE_FAILED:()=>J,STATE_PENDING:()=>K,STATE_RESOLVED:()=>ee,TAG_NAME_SERVICE:()=>oe});var ut="placeholder-failed",lt="placeholder-pending",ft="placeholder-resolved",Tr="Bad WCS request",br="Commerce offer not found",Sr="Literals URL not provided",Mo="wcms:commerce:error",pt="wcms:placeholder:failed",mt="wcms:placeholder:pending",ge="wcms:commerce:ready",ht="wcms:placeholder:resolved",Pr="wcms/commerce",Ar="commerce.env",wr="commerce.landscape",ko="commerce.aosKey",Go="commerce.wcsKey",J="failed",K="pending",ee="resolved",oe="wcms-commerce";var Lr={clientId:"merch-at-scale",delimiter:"\xB6",ignoredProperties:["analytics","literals"],serializableTypes:["Array","Object"],sampleRate:30,tags:"consumer=milo/commerce"},Hn=new Set,Fo=e=>e instanceof Error||typeof e.originatingRequest=="string";function Xn(e){if(e==null)return;let t=typeof e;if(t==="function"){let{name:r}=e;return r?`${t} ${r}`:t}if(t==="object"){if(e instanceof Error)return e.message;if(typeof e.originatingRequest=="string"){let{message:n,originatingRequest:i,status:o}=e;return[n,o,i].filter(s=>s).join(" ")}let r=e[Symbol.toStringTag]??Object.getPrototypeOf(e).constructor.name;if(!Lr.serializableTypes.includes(r))return r}return e}function Vo(e,t){if(!Lr.ignoredProperties.includes(e))return Xn(t)}var Nr={append(e){let{delimiter:t,sampleRate:r,tags:n,clientId:i}=Lr,{message:o,params:s}=e,a=[],c=o,l=[];s.forEach(f=>{f!=null&&(Fo(f)?a:l).push(f)}),a.length&&(c+=" ",c+=a.map(Xn).join(" "));let{pathname:u,search:p}=window.location;c+=`${t}page=`,c+=u+p,l.length&&(c+=`${t}facts=`,c+=JSON.stringify(l,Vo)),Hn.has(c)||(Hn.add(c),window.lana?.log(c,{sampleRate:r,tags:n,clientId:i}))}};var _=Object.freeze({checkoutClientId:"adobe_com",checkoutWorkflow:Z.V3,checkoutWorkflowStep:Q.EMAIL,country:"US",displayOldPrice:!0,displayPerUnit:!1,displayRecurrence:!0,displayTax:!1,domainSwitch:!1,env:H.PRODUCTION,forceTaxExclusive:!1,language:"en",entitlement:!1,extraOptions:{},modal:!1,promotionCode:"",quantity:1,wcsApiKey:"wcms-commerce-ims-ro-user-milo",wcsBufferDelay:1,wcsEnv:we.PRODUCTION,landscape:G.PUBLISHED,wcsBufferLimit:1});function Bn(e,{once:t=!1}={}){let r=null;function n(){let i=document.querySelector(oe);i!==r&&(r=i,i&&e(i))}return document.addEventListener(ge,n,{once:t}),ue(n),()=>document.removeEventListener(ge,n)}function je(e,{country:t,forceTaxExclusive:r,perpetual:n}){let i;if(e.length<2)i=e;else{let o=t==="GB"||n?"EN":"MULT",[s,a]=e;i=[s.language===o?s:a]}return r&&(i=i.map(xr)),i}var ue=e=>window.setTimeout(e);function Oe(e,t=1){if(e==null)return[t];let r=(Array.isArray(e)?e:String(e).split(",")).map(Ae).filter(Se);return r.length||(r=[t]),r}function dt(e){return e==null?[]:(Array.isArray(e)?e:String(e).split(",")).filter(Xt)}function F(){return window.customElements.get(oe)?.instance}var jo="en_US",m={ar:"AR_es",be_en:"BE_en",be_fr:"BE_fr",be_nl:"BE_nl",br:"BR_pt",ca:"CA_en",ch_de:"CH_de",ch_fr:"CH_fr",ch_it:"CH_it",cl:"CL_es",co:"CO_es",la:"DO_es",mx:"MX_es",pe:"PE_es",africa:"MU_en",dk:"DK_da",de:"DE_de",ee:"EE_et",eg_ar:"EG_ar",eg_en:"EG_en",es:"ES_es",fr:"FR_fr",gr_el:"GR_el",gr_en:"GR_en",ie:"IE_en",il_he:"IL_iw",it:"IT_it",lv:"LV_lv",lt:"LT_lt",lu_de:"LU_de",lu_en:"LU_en",lu_fr:"LU_fr",my_en:"MY_en",my_ms:"MY_ms",hu:"HU_hu",mt:"MT_en",mena_en:"DZ_en",mena_ar:"DZ_ar",nl:"NL_nl",no:"NO_nb",pl:"PL_pl",pt:"PT_pt",ro:"RO_ro",si:"SI_sl",sk:"SK_sk",fi:"FI_fi",se:"SE_sv",tr:"TR_tr",uk:"GB_en",at:"AT_de",cz:"CZ_cs",bg:"BG_bg",ru:"RU_ru",ua:"UA_uk",au:"AU_en",in_en:"IN_en",in_hi:"IN_hi",id_en:"ID_en",id_id:"ID_in",nz:"NZ_en",sa_ar:"SA_ar",sa_en:"SA_en",sg:"SG_en",cn:"CN_zh-Hans",tw:"TW_zh-Hant",hk_zh:"HK_zh-hant",jp:"JP_ja",kr:"KR_ko",za:"ZA_en",ng:"NG_en",cr:"CR_es",ec:"EC_es",pr:"US_es",gt:"GT_es",cis_en:"AZ_en",cis_ru:"AZ_ru",sea:"SG_en",th_en:"TH_en",th_th:"TH_th"},se=Object.freeze({LOCAL:"local",PROD:"prod",STAGE:"stage"});function Yn({locale:e={}}={}){if(!e.prefix)return{country:_.country,language:_.language,locale:jo};let t=e.prefix.replace("/","")??"",[r=_.country,n=_.language]=(m[t]??t).split("_",2);return r=r.toUpperCase(),n=n.toLowerCase(),{country:r,language:n,locale:`${n}_${r}`}}function Cr(e={}){let{commerce:t={},locale:r=void 0}=e,i=(e.env?.name===se.PROD?se.PROD:ie(w(Ar,t,{metadata:!1}),se,se.PROD))===se.STAGE?H.STAGE:H.PRODUCTION,o=w("checkoutClientId",t)??_.checkoutClientId,s=ie(w("checkoutWorkflow",t),Z,_.checkoutWorkflow),a=Q.CHECKOUT;s===Z.V3&&(a=ie(w("checkoutWorkflowStep",t),Q,_.checkoutWorkflowStep));let c=v(w("displayOldPrice",t),_.displayOldPrice),l=v(w("displayPerUnit",t),_.displayPerUnit),u=v(w("displayRecurrence",t),_.displayRecurrence),p=v(w("displayTax",t),_.displayTax),f=v(w("entitlement",t),_.entitlement),d=v(w("modal",t),_.modal),h=v(w("forceTaxExclusive",t),_.forceTaxExclusive),E=w("promotionCode",t)??_.promotionCode,S=Oe(w("quantity",t)),N=w("wcsApiKey",t)??_.wcsApiKey,P=e.env?.name===se.PROD?G.PUBLISHED:ie(w(wr,t),G,_.landscape),b=Ae(w("wcsBufferDelay",t),_.wcsBufferDelay),O=Ae(w("wcsBufferLimit",t),_.wcsBufferLimit),y=v(w("domain.switch",t),!1);return{...Yn({locale:r}),displayOldPrice:c,checkoutClientId:o,checkoutWorkflow:s,checkoutWorkflowStep:a,displayPerUnit:l,displayRecurrence:u,displayTax:p,entitlement:f,extraOptions:_.extraOptions,modal:d,env:i,forceTaxExclusive:h,priceLiteralsURL:t.priceLiteralsURL,priceLiteralsPromise:t.priceLiteralsPromise,promotionCode:E,quantity:S,wcsApiKey:N,wcsBufferDelay:b,wcsBufferLimit:O,wcsEnv:i===H.STAGE?we.STAGE:we.PRODUCTION,landscape:P,domainSwitch:y}}var qn="debug",Wo="error",Ho="info",Xo="warn",Bo=Date.now(),Ir=new Set,Rr=new Set,$n=new Map,We=Object.freeze({DEBUG:qn,ERROR:Wo,INFO:Ho,WARN:Xo}),zn={append({level:e,message:t,params:r,timestamp:n,source:i}){console[e](`${n}ms [${i}] %c${t}`,"font-weight: bold;",...r)}},Zn={filter:({level:e})=>e!==qn},Yo={filter:()=>!1};function $o(e,t,r,n,i){return{level:e,message:t,namespace:r,get params(){if(n.length===1){let[o]=n;ce(o)&&(n=o(),Array.isArray(n)||(n=[n]))}return n},source:i,timestamp:Date.now()-Bo}}function qo(e){[...Rr].every(t=>t(e))&&Ir.forEach(t=>t(e))}function Qn(e){let t=($n.get(e)??0)+1;$n.set(e,t);let r=`${e} #${t}`,n=o=>(s,...a)=>qo($o(o,s,e,a,r)),i=Object.seal({id:r,namespace:e,module(o){return Qn(`${i.namespace}/${o}`)},debug:n(We.DEBUG),error:n(We.ERROR),info:n(We.INFO),warn:n(We.WARN)});return i}function Et(...e){e.forEach(t=>{let{append:r,filter:n}=t;ce(n)?Rr.add(n):ce(r)&&Ir.add(r)})}function zo(e={}){let{name:t}=e,r=v(w("commerce.debug",{search:!0,storage:!0}),t===se.LOCAL);return Et(r?zn:Zn),t===se.PROD&&Et(Nr),D}function Zo(){Ir.clear(),Rr.clear()}var D={...Qn(Pr),Level:We,Plugins:{consoleAppender:zn,debugFilter:Zn,quietFilter:Yo,lanaAppender:Nr},init:zo,reset:Zo,use:Et};var Qo={CLASS_NAME_FAILED:ut,CLASS_NAME_PENDING:lt,CLASS_NAME_RESOLVED:ft,EVENT_TYPE_FAILED:pt,EVENT_TYPE_PENDING:mt,EVENT_TYPE_RESOLVED:ht,STATE_FAILED:J,STATE_PENDING:K,STATE_RESOLVED:ee},Jo={[J]:ut,[K]:lt,[ee]:ft},Ko={[J]:pt,[K]:mt,[ee]:ht},yt=new WeakMap;function V(e){if(!yt.has(e)){let t=D.module(e.constructor.is);yt.set(e,{changes:new Map,connected:!1,dispose:be,error:void 0,log:t,options:void 0,promises:[],state:K,timer:null,value:void 0,version:0})}return yt.get(e)}function gt(e){let t=V(e),{error:r,promises:n,state:i}=t;(i===ee||i===J)&&(t.promises=[],i===ee?n.forEach(({resolve:o})=>o(e)):i===J&&n.forEach(({reject:o})=>o(r))),e.dispatchEvent(new CustomEvent(Ko[i],{bubbles:!0}))}function xt(e){let t=yt.get(e);[J,K,ee].forEach(r=>{e.classList.toggle(Jo[r],r===t.state)})}var es={get error(){return V(this).error},get log(){return V(this).log},get options(){return V(this).options},get state(){return V(this).state},get value(){return V(this).value},attributeChangedCallback(e,t,r){V(this).changes.set(e,r),this.requestUpdate()},connectedCallback(){V(this).dispose=Bn(()=>this.requestUpdate(!0))},disconnectedCallback(){let e=V(this);e.connected&&(e.connected=!1,e.log.debug("Disconnected:",{element:this})),e.dispose(),e.dispose=be},onceSettled(){let{error:e,promises:t,state:r}=V(this);return ee===r?Promise.resolve(this):J===r?Promise.reject(e):new Promise((n,i)=>{t.push({resolve:n,reject:i})})},toggleResolved(e,t,r){let n=V(this);return e!==n.version?!1:(r!==void 0&&(n.options=r),n.state=ee,n.value=t,xt(this),this.log.debug("Resolved:",{element:this,value:t}),ue(()=>gt(this)),!0)},toggleFailed(e,t,r){let n=V(this);return e!==n.version?!1:(r!==void 0&&(n.options=r),n.error=t,n.state=J,xt(this),n.log.error("Failed:",{element:this,error:t}),ue(()=>gt(this)),!0)},togglePending(e){let t=V(this);return t.version++,e&&(t.options=e),t.state=K,xt(this),ue(()=>gt(this)),t.version},requestUpdate(e=!1){if(!this.isConnected||!F())return;let t=V(this);if(t.timer)return;let{error:r,options:n,state:i,value:o,version:s}=t;t.state=K,t.timer=ue(async()=>{t.timer=null;let a=null;if(t.changes.size&&(a=Object.fromEntries(t.changes.entries()),t.changes.clear()),t.connected?t.log.debug("Updated:",{element:this,changes:a}):(t.connected=!0,t.log.debug("Connected:",{element:this,changes:a})),a||e)try{await this.render?.()===!1&&t.state===K&&t.version===s&&(t.state=i,t.error=r,t.value=o,xt(this),gt(this))}catch(c){this.toggleFailed(t.version,c,n)}})}};function Jn(e={}){return Object.entries(e).forEach(([t,r])=>{(r==null||r===""||r?.length===0)&&delete e[t]}),e}function _t(e,t={}){let{tag:r,is:n}=e,i=document.createElement(r,{is:n});return i.setAttribute("is",n),Object.assign(i.dataset,Jn(t)),i}function vt(e){let{tag:t,is:r,prototype:n}=e,i=window.customElements.get(r);return i||(Object.defineProperties(n,Object.getOwnPropertyDescriptors(es)),i=Object.defineProperties(e,Object.getOwnPropertyDescriptors(Qo)),window.customElements.define(r,i,{extends:t})),i}function Tt(e,t=document.body){return Array.from(t?.querySelectorAll(`${e.tag}[is="${e.is}"]`)??[])}function bt(e,t={}){return e instanceof HTMLElement?(Object.assign(e.dataset,Jn(t)),e):null}var ts="download",rs="upgrade",xe,Le=class Le extends HTMLAnchorElement{constructor(){super();Fr(this,xe,void 0);this.addEventListener("click",this.clickHandler)}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"]}static createCheckoutLink(r={},n=""){let i=F();if(!i)return null;let{checkoutMarketSegment:o,checkoutWorkflow:s,checkoutWorkflowStep:a,entitlement:c,upgrade:l,modal:u,perpetual:p,promotionCode:f,quantity:d,wcsOsi:h,extraOptions:E}=i.collectCheckoutOptions(r),S=_t(Le,{checkoutMarketSegment:o,checkoutWorkflow:s,checkoutWorkflowStep:a,entitlement:c,upgrade:l,modal:u,perpetual:p,promotionCode:f,quantity:d,wcsOsi:h,extraOptions:E});return n&&(S.innerHTML=`${n}`),S}static getCheckoutLinks(r){return Tt(Le,r)}get isCheckoutLink(){return!0}get placeholder(){return this}clickHandler(r){var n;(n=Lt(this,xe))==null||n.call(this,r)}async render(r={}){if(!this.isConnected)return!1;let n=F();if(!n)return!1;this.dataset.imsCountry||n.imsCountryPromise.then(u=>{u&&(this.dataset.imsCountry=u)},be);let i=n.collectCheckoutOptions(r,this.placeholder);if(!i.wcsOsi.length)return!1;let o;try{o=JSON.parse(i.extraOptions??"{}")}catch(u){this.placeholder.log.error("cannot parse exta checkout options",u)}let s=this.placeholder.togglePending(i);this.href="";let a=n.resolveOfferSelectors(i),c=await Promise.all(a);c=c.map(u=>je(u,i));let l=await n.buildCheckoutAction(c.flat(),{...o,...i});return this.renderOffers(c.flat(),i,{},l,s)}renderOffers(r,n,i={},o=void 0,s=void 0){if(!this.isConnected)return!1;let a=F();if(!a)return!1;if(n={...JSON.parse(this.placeholder.dataset.extraOptions??"null"),...n,...i},s??(s=this.placeholder.togglePending(n)),Lt(this,xe)&&Nt(this,xe,void 0),o){this.classList.remove(ts,rs),this.placeholder.toggleResolved(s,r,n);let{url:l,text:u,className:p,handler:f}=o;return l&&(this.href=l),u&&(this.firstElementChild.innerHTML=u),p&&this.classList.add(...p.split(" ")),f&&(this.setAttribute("href","#"),Nt(this,xe,f.bind(this))),!0}else if(r.length){if(this.placeholder.toggleResolved(s,r,n)){let l=a.buildCheckoutURL(r,n);return this.setAttribute("href",l),!0}}else{let l=new Error(`Not provided: ${n?.wcsOsi??"-"}`);if(this.placeholder.toggleFailed(s,l,n))return this.setAttribute("href","#"),!0}return!1}updateOptions(r={}){let n=F();if(!n)return!1;let{checkoutMarketSegment:i,checkoutWorkflow:o,checkoutWorkflowStep:s,entitlement:a,upgrade:c,modal:l,perpetual:u,promotionCode:p,quantity:f,wcsOsi:d}=n.collectCheckoutOptions(r);return bt(this,{checkoutMarketSegment:i,checkoutWorkflow:o,checkoutWorkflowStep:s,entitlement:a,upgrade:c,modal:l,perpetual:u,promotionCode:p,quantity:f,wcsOsi:d}),!0}};xe=new WeakMap,ne(Le,"is","checkout-link"),ne(Le,"tag","a");var Ur=Le,St=vt(Ur);var Kn=[m.uk,m.au,m.fr,m.at,m.be_en,m.be_fr,m.be_nl,m.bg,m.ch_de,m.ch_fr,m.ch_it,m.cz,m.de,m.dk,m.ee,m.eg_ar,m.eg_en,m.es,m.fi,m.fr,m.gr_el,m.gr_en,m.hu,m.ie,m.it,m.lu_de,m.lu_en,m.lu_fr,m.nl,m.no,m.pl,m.pt,m.ro,m.se,m.si,m.sk,m.tr,m.ua,m.id_en,m.id_id,m.in_en,m.in_hi,m.jp,m.my_en,m.my_ms,m.nz,m.th_en,m.th_th],ns={INDIVIDUAL_COM:[m.za,m.lt,m.lv,m.ng,m.sa_ar,m.sa_en,m.za,m.sg,m.kr],TEAM_COM:[m.za,m.lt,m.lv,m.ng,m.za,m.co,m.kr],INDIVIDUAL_EDU:[m.lt,m.lv,m.sa_en,m.sea],TEAM_EDU:[m.sea,m.kr]},Ne=class Ne extends HTMLSpanElement{static get observedAttributes(){return["data-display-old-price","data-display-per-unit","data-display-recurrence","data-display-tax","data-perpetual","data-promotion-code","data-tax-exclusive","data-template","data-wcs-osi"]}static createInlinePrice(t){let r=F();if(!r)return null;let{displayOldPrice:n,displayPerUnit:i,displayRecurrence:o,displayTax:s,forceTaxExclusive:a,perpetual:c,promotionCode:l,quantity:u,template:p,wcsOsi:f}=r.collectPriceOptions(t);return _t(Ne,{displayOldPrice:n,displayPerUnit:i,displayRecurrence:o,displayTax:s,forceTaxExclusive:a,perpetual:c,promotionCode:l,quantity:u,template:p,wcsOsi:f})}static getInlinePrices(t){return Tt(Ne,t)}get isInlinePrice(){return!0}get placeholder(){return this}resolveDisplayTaxForGeoAndSegment(t,r,n,i){let o=`${t}_${r}`;if(Kn.includes(t)||Kn.includes(o))return!0;let s=ns[`${n}_${i}`];return s?!!(s.includes(t)||s.includes(o)):!1}async resolveDisplayTax(t,r){let[n]=await t.resolveOfferSelectors(r),i=je(await n,r);if(i?.length){let{country:o,language:s}=r,a=i[0],[c=""]=a.marketSegments;return this.resolveDisplayTaxForGeoAndSegment(o,s,a.customerSegment,c)}}async render(t={}){if(!this.isConnected)return!1;let r=F();if(!r)return!1;let n=r.collectPriceOptions(t,this.placeholder);if(!n.wcsOsi.length)return!1;let i=this.placeholder.togglePending(n);this.innerHTML="";let[o]=r.resolveOfferSelectors(n);return this.renderOffers(je(await o,n),n,i)}renderOffers(t,r={},n=void 0){if(!this.isConnected)return;let i=F();if(!i)return!1;let o=i.collectPriceOptions({...this.dataset,...r});if(n??(n=this.placeholder.togglePending(o)),t.length){if(this.placeholder.toggleResolved(n,t,o))return this.innerHTML=i.buildPriceHTML(t,o),!0}else{let s=new Error(`Not provided: ${o?.wcsOsi??"-"}`);if(this.placeholder.toggleFailed(n,s,o))return this.innerHTML="",!0}return!1}updateOptions(t){let r=F();if(!r)return!1;let{displayOldPrice:n,displayPerUnit:i,displayRecurrence:o,displayTax:s,forceTaxExclusive:a,perpetual:c,promotionCode:l,quantity:u,template:p,wcsOsi:f}=r.collectPriceOptions(t);return bt(this,{displayOldPrice:n,displayPerUnit:i,displayRecurrence:o,displayTax:s,forceTaxExclusive:a,perpetual:c,promotionCode:l,quantity:u,template:p,wcsOsi:f}),!0}};ne(Ne,"is","inline-price"),ne(Ne,"tag","span");var Dr=Ne,Pt=vt(Dr);function ei({providers:e,settings:t},r){let n=D.module("checkout");function i(l,u){let{checkoutClientId:p,checkoutWorkflow:f,checkoutWorkflowStep:d,country:h,language:E,promotionCode:S,quantity:N}=t,{checkoutMarketSegment:P,checkoutWorkflow:b=f,checkoutWorkflowStep:O=d,imsCountry:y,country:C=y??h,language:M=E,quantity:X=N,entitlement:B,upgrade:R,modal:j,perpetual:ae,promotionCode:le=S,wcsOsi:te,extraOptions:q,...ye}=Object.assign({},u?.dataset??{},l??{}),He=ie(b,Z,_.checkoutWorkflow),Xe=Q.CHECKOUT;He===Z.V3&&(Xe=ie(O,Q,_.checkoutWorkflowStep));let Ce=Pe({...ye,extraOptions:q,checkoutClientId:p,checkoutMarketSegment:P,country:C,quantity:Oe(X,_.quantity),checkoutWorkflow:He,checkoutWorkflowStep:Xe,language:M,entitlement:v(B),upgrade:v(R),modal:v(j),perpetual:v(ae),promotionCode:Ue(le).effectivePromoCode,wcsOsi:dt(te)});if(u)for(let At of e.checkout)At(u,Ce);return Ce}async function o(l,u){let p=F(),f=await r.getCheckoutAction?.(l,u,p.imsSignedInPromise);return f||null}function s(l,u){if(!Array.isArray(l)||!l.length||!u)return"";let{env:p,landscape:f}=t,{checkoutClientId:d,checkoutMarketSegment:h,checkoutWorkflow:E,checkoutWorkflowStep:S,country:N,promotionCode:P,quantity:b,...O}=i(u),y=window.frameElement?"if":"fp",C={checkoutPromoCode:P,clientId:d,context:y,country:N,env:p,items:[],marketSegment:h,workflowStep:S,landscape:f,...O};if(l.length===1){let[{offerId:M,offerType:X,productArrangementCode:B}]=l,{marketSegments:[R]}=l[0];Object.assign(C,{marketSegment:R,offerType:X,productArrangementCode:B}),C.items.push(b[0]===1?{id:M}:{id:M,quantity:b[0]})}else C.items.push(...l.map(({offerId:M},X)=>({id:M,quantity:b[X]??_.quantity})));return Mt(E,C)}let{createCheckoutLink:a,getCheckoutLinks:c}=St;return{CheckoutLink:St,CheckoutWorkflow:Z,CheckoutWorkflowStep:Q,buildCheckoutAction:o,buildCheckoutURL:s,collectCheckoutOptions:i,createCheckoutLink:a,getCheckoutLinks:c}}function is({interval:e=200,maxAttempts:t=25}={}){let r=D.module("ims");return new Promise(n=>{r.debug("Waing for IMS to be ready");let i=0;function o(){window.adobeIMS?.initialized?n():++i>t?(r.debug("Timeout"),n()):setTimeout(o,e)}o()})}function os(e){return e.then(()=>window.adobeIMS?.isSignedInUser()??!1)}function ss(e){let t=D.module("ims");return e.then(r=>r?window.adobeIMS.getProfile().then(({countryCode:n})=>(t.debug("Got user country:",n),n),n=>{t.error("Unable to get user country:",n)}):null)}function ti({}){let e=is(),t=os(e),r=ss(t);return{imsReadyPromise:e,imsSignedInPromise:t,imsCountryPromise:r}}function as(e){if(!e.priceLiteralsURL)throw new Error(Sr);return new Promise(t=>{window.fetch(e.priceLiteralsURL).then(r=>{r.json().then(({data:n})=>{t(n)})})})}async function ri(e){let r=await(e.priceLiteralsPromise||as(e));if(Array.isArray(r)){let n=o=>r.find(s=>ze(s.lang,o)),i=n(e.language)??n(_.language);if(i)return Object.freeze(i)}return{}}function ni({literals:e,providers:t,settings:r}){function n(a,c){let{country:l,displayOldPrice:u,displayPerUnit:p,displayRecurrence:f,displayTax:d,forceTaxExclusive:h,language:E,promotionCode:S,quantity:N}=r,{displayOldPrice:P=u,displayPerUnit:b=p,displayRecurrence:O=f,displayTax:y=d,forceTaxExclusive:C=h,country:M=l,language:X=E,perpetual:B,promotionCode:R=S,quantity:j=N,template:ae,wcsOsi:le,...te}=Object.assign({},c?.dataset??{},a??{}),q=Pe({...te,country:M,displayOldPrice:v(P),displayPerUnit:v(b),displayRecurrence:v(O),displayTax:v(y),forceTaxExclusive:v(C),language:X,perpetual:v(B),promotionCode:Ue(R).effectivePromoCode,quantity:Oe(j,_.quantity),template:ae,wcsOsi:dt(le)});if(c)for(let ye of t.price)ye(c,q);return q}function i(a,c){if(!Array.isArray(a)||!a.length||!c)return"";let{template:l}=c,u;switch(l){case"discount":u=mr;break;case"strikethrough":u=fr;break;case"optical":u=lr;break;case"annual":u=pr;break;default:u=c.promotionCode?ur:cr}let p=n(c);p.literals=Object.assign({},e.price,Pe(c.literals??{}));let[f]=a;return f={...f,...f.priceDetails},u(p,f)}let{createInlinePrice:o,getInlinePrices:s}=Pt;return{InlinePrice:Pt,buildPriceHTML:i,collectPriceOptions:n,createInlinePrice:o,getInlinePrices:s}}var Mr="_acom",ii={[H.PRODUCTION]:"https://wcs.adobe.com",[H.STAGE]:"https://wcs.stage.adobe.com",[H.PRODUCTION+Mr]:"https://www.adobe.com",[H.STAGE+Mr]:"https://www.stage.adobe.com"};function oi({settings:e}){let t=D.module("wcs"),{env:r,domainSwitch:n,wcsApiKey:i}=e,o=n?ii[r+Mr]:ii[r],s={apiKey:i,baseUrl:o,fetch:window.fetch.bind(window)},a=qe(s),c=new Map,l=new Map,u;async function p(h,E,S=!0){let N=br;try{t.debug("Fetching:",h),h.offerSelectorIds=h.offerSelectorIds.sort();let{data:P}=await a(h,{apiKey:i,environment:e.wcsEnv,landscape:r===H.STAGE?"ALL":e.landscape},({resolvedOffers:O})=>({offers:O.map(ct)}));t.debug("Fetched:",h,P);let{offers:b}=P??{};E.forEach(({resolve:O},y)=>{let C=b.filter(({offerSelectorIds:M})=>M.includes(y)).flat();C.length&&(E.delete(y),O(C))})}catch(P){P.status===404&&h.offerSelectorIds.length>1?(t.debug("Multi-osi 404, fallback to fetch-by-one strategy"),await Promise.allSettled(h.offerSelectorIds.map(b=>p({...h,offerSelectorIds:[b]},E,!1)))):(t.error("Failed:",h,P),N=Tr)}S&&E.size&&(t.debug("Missing:",{offerSelectorIds:[...E.keys()]}),E.forEach(P=>{P.reject(new Error(N))}))}function f(){clearTimeout(u);let h=[...l.values()];l.clear(),h.forEach(({options:E,promises:S})=>p(E,S))}function d({country:h,language:E,perpetual:S=!1,promotionCode:N="",wcsOsi:P=[]}){let b=`${E}_${h}`;h!=="GB"&&(E=S?"EN":"MULT");let O=[h,E,N].filter(y=>y).join("-").toLowerCase();return P.map(y=>{let C=`${y}-${O}`;if(!c.has(C)){let M=new Promise((X,B)=>{let R=l.get(O);if(!R){let j={country:h,locale:b,offerSelectorIds:[]};h!=="GB"&&(j.language=E),R={options:j,promises:new Map},l.set(O,R)}N&&(R.options.promotionCode=N),R.options.offerSelectorIds.push(y),R.promises.set(y,{resolve:X,reject:B}),R.options.offerSelectorIds.length>=e.wcsBufferLimit?f():(t.debug("Queued:",R.options),u||(u=setTimeout(f,e.wcsBufferDelay)))});c.set(C,M)}return c.get(C)})}return{WcsCommitment:yr,WcsPlanType:_r,WcsTerm:vr,resolveOfferSelectors:d}}var k=class extends HTMLElement{get isWcmsCommerce(){return!0}};ne(k,"instance"),ne(k,"promise",null);window.customElements.define(oe,k);async function cs(e,t){let r=D.init(e.env).module("service");r.debug("Activating:",e);let n={price:{}},i=Object.freeze(Cr(e));try{n.price=await ri(i)}catch(c){r.warn("Price literals were not fetched:",c)}let o={checkout:new Set,price:new Set},s=document.createElement(oe),a={literals:n,providers:o,settings:i};return k.instance=Object.defineProperties(s,Object.getOwnPropertyDescriptors({...ei(a,t),...ti(a),...ni(a),...oi(a),...Or,Log:D,get defaults(){return _},get literals(){return n},get log(){return D},get providers(){return{checkout(c){return o.checkout.add(c),()=>o.checkout.delete(c)},price(c){return o.price.add(c),()=>o.price.delete(c)}}},get settings(){return i}})),r.debug("Activated:",{literals:n,settings:i,element:s}),document.head.append(s),ue(()=>{let c=new CustomEvent(ge,{bubbles:!0,cancelable:!1,detail:k.instance});k.instance.dispatchEvent(c)}),k.instance}function si(){document.head.querySelector(oe)?.remove(),k.promise=null,D.reset()}function us(e,t){if(ce(e)){let r=ce(t)?t():{};return r.force&&si(),k.promise??(k.promise=cs(e(),r))}return k.promise?k.promise:new Promise(r=>{let n=i=>{r(i.detail)};document.head.addEventListener(ge,n,{once:!0})})}export{St as CheckoutLink,Z as CheckoutWorkflow,Q as CheckoutWorkflowStep,_ as Defaults,Pt as InlinePrice,G as Landscape,D as Log,oe as TAG_NAME_SERVICE,yr as WcsCommitment,we as WcsEnv,_r as WcsPlanType,vr as WcsTerm,ct as applyPlanType,Yn as getLocaleSettings,Cr as getSettings,us as init,si as reset}; - //# sourceMappingURL=commerce.js.map - \ No newline at end of file diff --git a/libs/deps/mas/commerce.js b/libs/deps/mas/commerce.js index 36c618ec66..cf25cfbf96 100644 --- a/libs/deps/mas/commerce.js +++ b/libs/deps/mas/commerce.js @@ -1,4 +1,4 @@ -var kr=Object.defineProperty;var ui=(e,t,r)=>t in e?kr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var li=(e,t)=>{for(var r in t)kr(e,r,{get:t[r],enumerable:!0})};var ne=(e,t,r)=>(ui(e,typeof t!="symbol"?t+"":t,r),r),Gr=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)};var Lt=(e,t,r)=>(Gr(e,t,"read from private field"),r?r.call(e):t.get(e)),Fr=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},Nt=(e,t,r,n)=>(Gr(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r);var Ie;(function(e){e.ServerError="ServerError",e.ClientError="ClientError",e.UnexpectedError="UnexpectedError"})(Ie||(Ie={}));var Vr=(e,t,r)=>({type:(i=>i>=500?Ie.ServerError:i<400?Ie.UnexpectedError:Ie.ClientError)(e),message:t,originatingRequest:r,status:e});var fi=function(e,t,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(u){try{l(n.next(u))}catch(p){s(p)}}function c(u){try{l(n.throw(u))}catch(p){s(p)}}function l(u){u.done?o(u.value):i(u.value).then(a,c)}l((n=n.apply(e,t||[])).next())})},Be;(function(e){e.AUTHORIZATION="Authorization",e.X_API_KEY="X-Api-Key"})(Be||(Be={}));var Ct=class{constructor(t){this.fetchOptions=t}commonHeaders(){let t={};return this.fetchOptions.apiKey&&(t[Be.X_API_KEY]=this.fetchOptions.apiKey),this.fetchOptions.accessToken&&(t[Be.AUTHORIZATION]=`Bearer ${this.fetchOptions.accessToken}`),t}transformData(t,r){return r?t.map(n=>r(n)):t.map(n=>this.identifyTransform(n))}transformDatum(t,r){return r?r(t):this.identifyTransform(t)}identifyTransform(t){return t}failOnBadStatusOrParseBody(t,r){return fi(this,void 0,void 0,function*(){if(t.ok)return t.json().then(i=>({headers:t.headers,status:t.status,statusText:t.statusText,data:i}));let n=yield t.text();return Promise.reject(Vr(t.status,n,r))})}buildUrl(t,r,n,i,o){var s;let a=(s=this.fetchOptions.baseUrl)!==null&&s!==void 0?s:i(this.fetchOptions.env),c=o(r,n);return this.generateUrl(a,t,c)}generateUrl(t,r,n){let i=new URL(r,t);return n&&(i.search=this.convertToSearchParams(n).toString()),i.toString()}convertToSearchParams(t){return new URLSearchParams(t)}setParams(t,r,n){n!=null&&typeof n=="boolean"?t[r]=String(n):n&&(t[r]=n)}},It=Ct;var Y;(function(e){e.STAGE="STAGE",e.PRODUCTION="PRODUCTION",e.LOCAL="LOCAL"})(Y||(Y={}));var Re;(function(e){e.STAGE="STAGE",e.PRODUCTION="PROD",e.LOCAL="LOCAL"})(Re||(Re={}));var G;(function(e){e.DRAFT="DRAFT",e.PUBLISHED="PUBLISHED"})(G||(G={}));var fe;(function(e){e.V2="UCv2",e.V3="UCv3"})(fe||(fe={}));var $;(function(e){e.CHECKOUT="checkout",e.CHECKOUT_EMAIL="checkout/email",e.SEGMENTATION="segmentation",e.BUNDLE="bundle",e.COMMITMENT="commitment",e.RECOMMENDATION="recommendation",e.EMAIL="email",e.PAYMENT="payment",e.CHANGE_PLAN_TEAM_PLANS="change-plan/team-upgrade/plans",e.CHANGE_PLAN_TEAM_PAYMENT="change-plan/team-upgrade/payment"})($||($={}));var Rt=function(e){var t;return(t=pi.get(e))!==null&&t!==void 0?t:e},pi=new Map([["countrySpecific","cs"],["quantity","q"],["authCode","code"],["checkoutPromoCode","apc"],["rurl","rUrl"],["curl","cUrl"],["ctxrturl","ctxRtUrl"],["country","co"],["language","lang"],["clientId","cli"],["context","ctx"],["productArrangementCode","pa"],["offerType","ot"],["marketSegment","ms"]]);var jr=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Wr=function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,o=[],s;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return o};function ve(e,t,r){var n,i;try{for(var o=jr(Object.entries(e)),s=o.next();!s.done;s=o.next()){var a=Wr(s.value,2),c=a[0],l=a[1],u=Rt(c);l!=null&&r.has(u)&&t.set(u,l)}}catch(p){n={error:p}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}}function Ye(e){switch(e){case Y.PRODUCTION:return"https://commerce.adobe.com";default:return"https://commerce-stg.adobe.com"}}function $e(e,t){var r,n;for(var i in e){var o=e[i];try{for(var s=(r=void 0,jr(Object.entries(o))),a=s.next();!a.done;a=s.next()){var c=Wr(a.value,2),l=c[0],u=c[1];if(u!=null){var p=Rt(l);t.set("items["+i+"]["+p+"]",u)}}}catch(f){r={error:f}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}}}var mi=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};function Hr(e){gi(e);var t=e.env,r=e.items,n=e.workflowStep,i=mi(e,["env","items","workflowStep"]),o=new URL(Ye(t));return o.pathname=n+"/",$e(r,o.searchParams),ve(i,o.searchParams,di),o.toString()}var di=new Set(["cli","co","lang","ctx","cUrl","mv","nglwfdata","otac","promoid","rUrl","sdid","spint","trackingid","code","campaignid","appctxid"]),Ei=["env","workflowStep","clientId","country","items"];function gi(e){var t,r;try{for(var n=hi(Ei),i=n.next();!i.done;i=n.next()){var o=i.value;if(!e[o])throw new Error('Argument "checkoutData" is not valid, missing: '+o)}}catch(s){t={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}return!0}var xi=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},_i="p_draft_landscape",vi="/store/";function Dt(e){bi(e);var t=e.env,r=e.items,n=e.workflowStep,i=e.ms,o=e.marketSegment,s=e.ot,a=e.offerType,c=e.pa,l=e.productArrangementCode,u=e.landscape,p=xi(e,["env","items","workflowStep","ms","marketSegment","ot","offerType","pa","productArrangementCode","landscape"]),f={marketSegment:o??i,offerType:a??s,productArrangementCode:l??c},d=new URL(Ye(t));return d.pathname=""+vi+n,n!==$.SEGMENTATION&&n!==$.CHANGE_PLAN_TEAM_PLANS&&$e(r,d.searchParams),n===$.SEGMENTATION&&ve(f,d.searchParams,Ut),ve(p,d.searchParams,Ut),u===G.DRAFT&&ve({af:_i},d.searchParams,Ut),d.toString()}var Ut=new Set(["af","ai","apc","appctxid","cli","co","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"]),Ti=["env","workflowStep","clientId","country"];function bi(e){var t,r;try{for(var n=yi(Ti),i=n.next();!i.done;i=n.next()){var o=i.value;if(!e[o])throw new Error('Argument "checkoutData" is not valid, missing: '+o)}}catch(s){t={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}if(e.workflowStep!==$.SEGMENTATION&&e.workflowStep!==$.CHANGE_PLAN_TEAM_PLANS&&!e.items)throw new Error('Argument "checkoutData" is not valid, missing: items');return!0}function Mt(e,t){switch(e){case fe.V2:return Hr(t);case fe.V3:return Dt(t);default:return console.warn("Unsupported CheckoutType, will use UCv3 as default. Given type: "+e),Dt(t)}}var kt;(function(e){e.BASE="BASE",e.TRIAL="TRIAL",e.PROMOTION="PROMOTION"})(kt||(kt={}));var I;(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"})(I||(I={}));var L;(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"})(L||(L={}));var Gt;(function(e){e.INDIVIDUAL="INDIVIDUAL",e.TEAM="TEAM",e.ENTERPRISE="ENTERPRISE"})(Gt||(Gt={}));var Ft;(function(e){e.COM="COM",e.EDU="EDU",e.GOV="GOV"})(Ft||(Ft={}));var Vt;(function(e){e.DIRECT="DIRECT",e.INDIRECT="INDIRECT"})(Vt||(Vt={}));var jt;(function(e){e.ENTERPRISE_PRODUCT="ENTERPRISE_PRODUCT",e.ETLA="ETLA",e.RETAIL="RETAIL",e.VIP="VIP",e.VIPMP="VIPMP",e.FREE="FREE"})(jt||(jt={}));var Wt=()=>{};Wt.createContext=Wt;var Si=G.PUBLISHED,Xr=e=>{switch(e){case Y.PRODUCTION:return"https://wcs.adobe.io";case Y.STAGE:return"https://wcs-stage.adobe.io";case Y.LOCAL:return"http://localhost:3002";default:return"https://wcs-stage.adobe.io"}},Br=(e,t)=>{var r;return e.api_key=t.apiKey,e.landscape=(r=t.landscape)!==null&&r!==void 0?r:Si,e};var Pi=function(e,t,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(u){try{l(n.next(u))}catch(p){s(p)}}function c(u){try{l(n.throw(u))}catch(p){s(p)}}function l(u){u.done?o(u.value):i(u.value).then(a,c)}l((n=n.apply(e,t||[])).next())})},Ht=class extends It{constructor(t){super(t),this.apiPaths={getWebCommerceArtifact:"web_commerce_artifact"},this.getWebCommerceArtifact=(r,n,i,o)=>Pi(this,void 0,void 0,function*(){let s=this.buildUrl(this.apiPaths.getWebCommerceArtifact,n,r,a=>Xr(a),(a,c)=>this.evaluateGetWebCommerceArtifactParams(a,c));return this.fetchOptions.fetch(s,{signal:o,headers:Object.assign({},this.commonHeaders()),mode:"cors"}).then(a=>this.failOnBadStatusOrParseBody(a,`GET ${s}`)).then(a=>{let l=a.data;return{data:this.transformDatum(l,i)}})})}evaluateGetWebCommerceArtifactParams(t,r){let n={};return this.setParams(n,"offer_selector_ids",r.offerSelectorIds.join(",")),this.setParams(n,"country",r.country),this.setParams(n,"language",r.language),this.setParams(n,"currency",r.currency),this.setParams(n,"locale",r.locale),this.setParams(n,"promotion_code",r.promotionCode),Br(n,t)}},Yr=Ht;var qe=e=>new Yr(e).getWebCommerceArtifact;var $r="tacocat.js";var ze=(e,t)=>String(e??"").toLowerCase()==String(t??"").toLowerCase(),qr=e=>`${e??""}`.replace(/[&<>'"]/g,t=>({"&":"&","<":"<",">":">","'":"'",'"':"""})[t]??t)??"";function w(e,t={},{metadata:r=!0,search:n=!0,storage:i=!0}={}){let o;if(n&&o==null){let s=new URLSearchParams(window.location.search),a=Te(n)?n:e;o=s.get(a)}if(i&&o==null){let s=Te(i)?i:e;o=window.sessionStorage.getItem(s)??window.localStorage.getItem(s)}if(r&&o==null){let s=Qr(Te(r)?r:e);o=document.documentElement.querySelector(`meta[name="${s}"]`)?.content}return o??t[e]}var be=()=>{};var zr=e=>typeof e=="boolean",ce=e=>typeof e=="function",Ze=e=>typeof e=="number",Zr=e=>e!=null&&typeof e=="object";var Te=e=>typeof e=="string",Xt=e=>Te(e)&&e,Se=e=>Ze(e)&&Number.isFinite(e)&&e>0;function Pe(e,t=r=>r==null||r===""){return e!=null&&Object.entries(e).forEach(([r,n])=>{t(n)&&delete e[r]}),e}function v(e,t){if(zr(e))return e;let r=String(e);return r==="1"||r==="true"?!0:r==="0"||r==="false"?!1:t}function ie(e,t,r){let n=Object.values(t);return n.find(i=>ze(i,e))??r??n[0]}function Qr(e=""){return String(e).replace(/(\p{Lowercase_Letter})(\p{Uppercase_Letter})/gu,(t,r,n)=>`${r}-${n}`).replace(/\W+/gu,"-").toLowerCase()}function Ae(e,t=1){return Ze(e)||(e=Number.parseInt(e,10)),!Number.isNaN(e)&&e>0&&Number.isFinite(e)?e:t}var Ai=Date.now(),Bt=()=>`(+${Date.now()-Ai}ms)`,Qe=new Set,wi=v(w("tacocat.debug",{},{metadata:!1}),typeof process<"u"&&process.env?.DEBUG);function Jr(e){let t=`[${$r}/${e}]`,r=(s,a,...c)=>s?!0:(i(a,...c),!1),n=wi?(s,...a)=>{console.debug(`${t} ${s}`,...a,Bt())}:()=>{},i=(s,...a)=>{let c=`${t} ${s}`;Qe.forEach(([l])=>l(c,...a))};return{assert:r,debug:n,error:i,warn:(s,...a)=>{let c=`${t} ${s}`;Qe.forEach(([,l])=>l(c,...a))}}}function Oi(e,t){let r=[e,t];return Qe.add(r),()=>{Qe.delete(r)}}Oi((e,...t)=>{console.error(e,...t,Bt())},(e,...t)=>{console.warn(e,...t,Bt())});var Li="no promo",Kr="promo-tag",Ni="yellow",Ci="neutral",Ii=(e,t,r)=>{let n=o=>o||Li,i=r?` (was "${n(t)}")`:"";return`${n(e)}${i}`},Ri="cancel-context",Ue=(e,t)=>{let r=e===Ri,n=!r&&e?.length>0,i=(n||r)&&(t&&t!=e||!t&&!r),o=i&&n||!i&&!!t,s=o?e||t:void 0;return{effectivePromoCode:s,overridenPromoCode:e,className:o?Kr:`${Kr} no-promo`,text:Ii(s,t,i),variant:o?Ni:Ci,isOverriden:i}};var Yt=function(e,t){return Yt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},Yt(e,t)};function De(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Yt(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var T=function(){return T=Object.assign||function(t){for(var r,n=1,i=arguments.length;n0}),r=[],n=0,i=t;n1)throw new RangeError("integer-width stems only accept a single optional option");i.options[0].replace(Mi,function(a,c,l,u,p,f){if(c)t.minimumIntegerDigits=l.length;else{if(u&&p)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(ln.test(i.stem)){t.minimumIntegerDigits=i.stem.length;continue}if(on.test(i.stem)){if(i.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");i.stem.replace(on,function(a,c,l,u,p,f){return l==="*"?t.minimumFractionDigits=c.length:u&&u[0]==="#"?t.maximumFractionDigits=u.length:p&&f?(t.minimumFractionDigits=p.length,t.maximumFractionDigits=p.length+f.length):(t.minimumFractionDigits=c.length,t.maximumFractionDigits=c.length),""}),i.options.length&&(t=T(T({},t),sn(i.options[0])));continue}if(un.test(i.stem)){t=T(T({},t),sn(i.stem));continue}var o=fn(i.stem);o&&(t=T(T({},t),o));var s=ki(i.stem);s&&(t=T(T({},t),s))}return t}var zt,Gi=new RegExp("^"+qt.source+"*"),Fi=new RegExp(qt.source+"*$");function x(e,t){return{start:e,end:t}}var Vi=!!String.prototype.startsWith,ji=!!String.fromCodePoint,Wi=!!Object.fromEntries,Hi=!!String.prototype.codePointAt,Xi=!!String.prototype.trimStart,Bi=!!String.prototype.trimEnd,Yi=!!Number.isSafeInteger,$i=Yi?Number.isSafeInteger:function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e&&Math.abs(e)<=9007199254740991},Qt=!0;try{mn=gn("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu"),Qt=((zt=mn.exec("a"))===null||zt===void 0?void 0:zt[0])==="a"}catch{Qt=!1}var mn,hn=Vi?function(t,r,n){return t.startsWith(r,n)}:function(t,r,n){return t.slice(n,n+r.length)===r},Jt=ji?String.fromCodePoint:function(){for(var t=[],r=0;ro;){if(s=t[o++],s>1114111)throw RangeError(s+" is not a valid code point");n+=s<65536?String.fromCharCode(s):String.fromCharCode(((s-=65536)>>10)+55296,s%1024+56320)}return n},dn=Wi?Object.fromEntries:function(t){for(var r={},n=0,i=t;n=n)){var i=t.charCodeAt(r),o;return i<55296||i>56319||r+1===n||(o=t.charCodeAt(r+1))<56320||o>57343?i:(i-55296<<10)+(o-56320)+65536}},qi=Xi?function(t){return t.trimStart()}:function(t){return t.replace(Gi,"")},zi=Bi?function(t){return t.trimEnd()}:function(t){return t.replace(Fi,"")};function gn(e,t){return new RegExp(e,t)}var Kt;Qt?(Zt=gn("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu"),Kt=function(t,r){var n;Zt.lastIndex=r;var i=Zt.exec(t);return(n=i[1])!==null&&n!==void 0?n:""}):Kt=function(t,r){for(var n=[];;){var i=En(t,r);if(i===void 0||yn(i)||Ji(i))break;n.push(i),r+=i>=65536?2:1}return Jt.apply(void 0,n)};var Zt,xn=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.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,n){for(var i=[];!this.isEOF();){var o=this.char();if(o===123){var s=this.parseArgument(t,n);if(s.err)return s;i.push(s.val)}else{if(o===125&&t>0)break;if(o===35&&(r==="plural"||r==="selectordinal")){var a=this.clonePosition();this.bump(),i.push({type:A.pound,location:x(a,this.clonePosition())})}else if(o===60&&!this.ignoreTag&&this.peek()===47){if(n)break;return this.error(g.UNMATCHED_CLOSING_TAG,x(this.clonePosition(),this.clonePosition()))}else if(o===60&&!this.ignoreTag&&er(this.peek()||0)){var s=this.parseTag(t,r);if(s.err)return s;i.push(s.val)}else{var s=this.parseLiteral(t,r);if(s.err)return s;i.push(s.val)}}}return{val:i,err:null}},e.prototype.parseTag=function(t,r){var n=this.clonePosition();this.bump();var i=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:A.literal,value:"<"+i+"/>",location:x(n,this.clonePosition())},err:null};if(this.bumpIf(">")){var o=this.parseMessage(t+1,r,!0);if(o.err)return o;var s=o.val,a=this.clonePosition();if(this.bumpIf("")?{val:{type:A.tag,value:i,children:s,location:x(n,this.clonePosition())},err:null}:this.error(g.INVALID_TAG,x(a,this.clonePosition())))}else return this.error(g.UNCLOSED_TAG,x(n,this.clonePosition()))}else return this.error(g.INVALID_TAG,x(n,this.clonePosition()))},e.prototype.parseTagName=function(){var t=this.offset();for(this.bump();!this.isEOF()&&Qi(this.char());)this.bump();return this.message.slice(t,this.offset())},e.prototype.parseLiteral=function(t,r){for(var n=this.clonePosition(),i="";;){var o=this.tryParseQuote(r);if(o){i+=o;continue}var s=this.tryParseUnquoted(t,r);if(s){i+=s;continue}var a=this.tryParseLeftAngleBracket();if(a){i+=a;continue}break}var c=x(n,this.clonePosition());return{val:{type:A.literal,value:i,location:c},err:null}},e.prototype.tryParseLeftAngleBracket=function(){return!this.isEOF()&&this.char()===60&&(this.ignoreTag||!Zi(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 n=this.char();if(n===39)if(this.peek()===39)r.push(39),this.bump();else{this.bump();break}else r.push(n);this.bump()}return Jt.apply(void 0,r)},e.prototype.tryParseUnquoted=function(t,r){if(this.isEOF())return null;var n=this.char();return n===60||n===123||n===35&&(r==="plural"||r==="selectordinal")||n===125&&t>0?null:(this.bump(),Jt(n))},e.prototype.parseArgument=function(t,r){var n=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(g.EXPECT_ARGUMENT_CLOSING_BRACE,x(n,this.clonePosition()));if(this.char()===125)return this.bump(),this.error(g.EMPTY_ARGUMENT,x(n,this.clonePosition()));var i=this.parseIdentifierIfPossible().value;if(!i)return this.error(g.MALFORMED_ARGUMENT,x(n,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(g.EXPECT_ARGUMENT_CLOSING_BRACE,x(n,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:A.argument,value:i,location:x(n,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(g.EXPECT_ARGUMENT_CLOSING_BRACE,x(n,this.clonePosition())):this.parseArgumentOptions(t,r,i,n);default:return this.error(g.MALFORMED_ARGUMENT,x(n,this.clonePosition()))}},e.prototype.parseIdentifierIfPossible=function(){var t=this.clonePosition(),r=this.offset(),n=Kt(this.message,r),i=r+n.length;this.bumpTo(i);var o=this.clonePosition(),s=x(t,o);return{value:n,location:s}},e.prototype.parseArgumentOptions=function(t,r,n,i){var o,s=this.clonePosition(),a=this.parseIdentifierIfPossible().value,c=this.clonePosition();switch(a){case"":return this.error(g.EXPECT_ARGUMENT_TYPE,x(s,c));case"number":case"date":case"time":{this.bumpSpace();var l=null;if(this.bumpIf(",")){this.bumpSpace();var u=this.clonePosition(),p=this.parseSimpleArgStyleIfPossible();if(p.err)return p;var f=zi(p.val);if(f.length===0)return this.error(g.EXPECT_ARGUMENT_STYLE,x(this.clonePosition(),this.clonePosition()));var d=x(u,this.clonePosition());l={style:f,styleLocation:d}}var h=this.tryParseArgumentClose(i);if(h.err)return h;var E=x(i,this.clonePosition());if(l&&hn(l?.style,"::",0)){var S=qi(l.style.slice(2));if(a==="number"){var p=this.parseNumberSkeletonFromString(S,l.styleLocation);return p.err?p:{val:{type:A.number,value:n,location:E,style:p.val},err:null}}else{if(S.length===0)return this.error(g.EXPECT_DATE_TIME_SKELETON,E);var f={type:pe.dateTime,pattern:S,location:l.styleLocation,parsedOptions:this.shouldParseSkeletons?rn(S):{}},N=a==="date"?A.date:A.time;return{val:{type:N,value:n,location:E,style:f},err:null}}}return{val:{type:a==="number"?A.number:a==="date"?A.date:A.time,value:n,location:E,style:(o=l?.style)!==null&&o!==void 0?o:null},err:null}}case"plural":case"selectordinal":case"select":{var P=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(g.EXPECT_SELECT_ARGUMENT_OPTIONS,x(P,T({},P)));this.bumpSpace();var b=this.parseIdentifierIfPossible(),O=0;if(a!=="select"&&b.value==="offset"){if(!this.bumpIf(":"))return this.error(g.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,x(this.clonePosition(),this.clonePosition()));this.bumpSpace();var p=this.tryParseDecimalInteger(g.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,g.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);if(p.err)return p;this.bumpSpace(),b=this.parseIdentifierIfPossible(),O=p.val}var y=this.tryParsePluralOrSelectOptions(t,a,r,b);if(y.err)return y;var h=this.tryParseArgumentClose(i);if(h.err)return h;var C=x(i,this.clonePosition());return a==="select"?{val:{type:A.select,value:n,options:dn(y.val),location:C},err:null}:{val:{type:A.plural,value:n,options:dn(y.val),offset:O,pluralType:a==="plural"?"cardinal":"ordinal",location:C},err:null}}default:return this.error(g.INVALID_ARGUMENT_TYPE,x(s,c))}},e.prototype.tryParseArgumentClose=function(t){return this.isEOF()||this.char()!==125?this.error(g.EXPECT_ARGUMENT_CLOSING_BRACE,x(t,this.clonePosition())):(this.bump(),{val:!0,err:null})},e.prototype.parseSimpleArgStyleIfPossible=function(){for(var t=0,r=this.clonePosition();!this.isEOF();){var n=this.char();switch(n){case 39:{this.bump();var i=this.clonePosition();if(!this.bumpUntil("'"))return this.error(g.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,x(i,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 n=[];try{n=cn(t)}catch{return this.error(g.INVALID_NUMBER_SKELETON,r)}return{val:{type:pe.number,tokens:n,location:r,parsedOptions:this.shouldParseSkeletons?pn(n):{}},err:null}},e.prototype.tryParsePluralOrSelectOptions=function(t,r,n,i){for(var o,s=!1,a=[],c=new Set,l=i.value,u=i.location;;){if(l.length===0){var p=this.clonePosition();if(r!=="select"&&this.bumpIf("=")){var f=this.tryParseDecimalInteger(g.EXPECT_PLURAL_ARGUMENT_SELECTOR,g.INVALID_PLURAL_ARGUMENT_SELECTOR);if(f.err)return f;u=x(p,this.clonePosition()),l=this.message.slice(p.offset,this.offset())}else break}if(c.has(l))return this.error(r==="select"?g.DUPLICATE_SELECT_ARGUMENT_SELECTOR:g.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,u);l==="other"&&(s=!0),this.bumpSpace();var d=this.clonePosition();if(!this.bumpIf("{"))return this.error(r==="select"?g.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:g.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,x(this.clonePosition(),this.clonePosition()));var h=this.parseMessage(t+1,r,n);if(h.err)return h;var E=this.tryParseArgumentClose(d);if(E.err)return E;a.push([l,{value:h.val,location:x(d,this.clonePosition())}]),c.add(l),this.bumpSpace(),o=this.parseIdentifierIfPossible(),l=o.value,u=o.location}return a.length===0?this.error(r==="select"?g.EXPECT_SELECT_ARGUMENT_SELECTOR:g.EXPECT_PLURAL_ARGUMENT_SELECTOR,x(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!s?this.error(g.MISSING_OTHER_CLAUSE,x(this.clonePosition(),this.clonePosition())):{val:a,err:null}},e.prototype.tryParseDecimalInteger=function(t,r){var n=1,i=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(n=-1);for(var o=!1,s=0;!this.isEOF();){var a=this.char();if(a>=48&&a<=57)o=!0,s=s*10+(a-48),this.bump();else break}var c=x(i,this.clonePosition());return o?(s*=n,$i(s)?{val:s,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=En(this.message,t);if(r===void 0)throw Error("Offset "+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(hn(this.message,t,this.offset())){for(var r=0;r=0?(this.bumpTo(n),!0):(this.bumpTo(this.message.length),!1)},e.prototype.bumpTo=function(t){if(this.offset()>t)throw Error("targetOffset "+t+" must be greater than or equal to the current offset "+this.offset());for(t=Math.min(t,this.message.length);;){var r=this.offset();if(r===t)break;if(r>t)throw Error("targetOffset "+t+" is at invalid UTF-16 code unit boundary");if(this.bump(),this.isEOF())break}},e.prototype.bumpSpace=function(){for(;!this.isEOF()&&yn(this.char());)this.bump()},e.prototype.peek=function(){if(this.isEOF())return null;var t=this.char(),r=this.offset(),n=this.message.charCodeAt(r+(t>=65536?2:1));return n??null},e}();function er(e){return e>=97&&e<=122||e>=65&&e<=90}function Zi(e){return er(e)||e===47}function Qi(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 yn(e){return e>=9&&e<=13||e===32||e===133||e>=8206&&e<=8207||e===8232||e===8233}function Ji(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 tr(e){e.forEach(function(t){if(delete t.location,rt(t)||nt(t))for(var r in t.options)delete t.options[r].location,tr(t.options[r].value);else Ke(t)&&ot(t.style)||(et(t)||tt(t))&&Me(t.style)?delete t.style.location:it(t)&&tr(t.children)})}function _n(e,t){t===void 0&&(t={}),t=T({shouldParseSkeletons:!0,requiresOtherClause:!0},t);var r=new xn(e,t).parse();if(r.err){var n=SyntaxError(g[r.err.kind]);throw n.location=r.err.location,n.originalMessage=r.err.message,n}return t?.captureLocation||tr(r.val),r.val}function ke(e,t){var r=t&&t.cache?t.cache:io,n=t&&t.serializer?t.serializer:no,i=t&&t.strategy?t.strategy:eo;return i(e,{cache:r,serializer:n})}function Ki(e){return e==null||typeof e=="number"||typeof e=="boolean"}function vn(e,t,r,n){var i=Ki(n)?n:r(n),o=t.get(i);return typeof o>"u"&&(o=e.call(this,n),t.set(i,o)),o}function Tn(e,t,r){var n=Array.prototype.slice.call(arguments,3),i=r(n),o=t.get(i);return typeof o>"u"&&(o=e.apply(this,n),t.set(i,o)),o}function rr(e,t,r,n,i){return r.bind(t,e,n,i)}function eo(e,t){var r=e.length===1?vn:Tn;return rr(e,this,r,t.cache.create(),t.serializer)}function to(e,t){return rr(e,this,Tn,t.cache.create(),t.serializer)}function ro(e,t){return rr(e,this,vn,t.cache.create(),t.serializer)}var no=function(){return JSON.stringify(arguments)};function nr(){this.cache=Object.create(null)}nr.prototype.get=function(e){return this.cache[e]};nr.prototype.set=function(e,t){this.cache[e]=t};var io={create:function(){return new nr}},st={variadic:to,monadic:ro};var me;(function(e){e.MISSING_VALUE="MISSING_VALUE",e.INVALID_VALUE="INVALID_VALUE",e.MISSING_INTL_API="MISSING_INTL_API"})(me||(me={}));var Ge=function(e){De(t,e);function t(r,n,i){var o=e.call(this,r)||this;return o.code=n,o.originalMessage=i,o}return t.prototype.toString=function(){return"[formatjs Error: "+this.code+"] "+this.message},t}(Error);var ir=function(e){De(t,e);function t(r,n,i,o){return e.call(this,'Invalid values for "'+r+'": "'+n+'". Options are "'+Object.keys(i).join('", "')+'"',me.INVALID_VALUE,o)||this}return t}(Ge);var bn=function(e){De(t,e);function t(r,n,i){return e.call(this,'Value for "'+r+'" must be of type '+n,me.INVALID_VALUE,i)||this}return t}(Ge);var Sn=function(e){De(t,e);function t(r,n){return e.call(this,'The intl string context variable "'+r+'" was not provided to the string "'+n+'"',me.MISSING_VALUE,n)||this}return t}(Ge);var U;(function(e){e[e.literal=0]="literal",e[e.object=1]="object"})(U||(U={}));function oo(e){return e.length<2?e:e.reduce(function(t,r){var n=t[t.length-1];return!n||n.type!==U.literal||r.type!==U.literal?t.push(r):n.value+=r.value,t},[])}function so(e){return typeof e=="function"}function Fe(e,t,r,n,i,o,s){if(e.length===1&&$t(e[0]))return[{type:U.literal,value:e[0].value}];for(var a=[],c=0,l=e;ct in e?Rr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Qn=(e,t)=>{for(var n in t)Rr(e,n,{get:t[n],enumerable:!0})};var K=(e,t,n)=>(Jn(e,typeof t!="symbol"?t+"":t,n),n),Ir=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var At=(e,t,n)=>(Ir(e,t,"read from private field"),n?n.call(e):t.get(e)),Mr=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},wt=(e,t,n,r)=>(Ir(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);var Le;(function(e){e.STAGE="STAGE",e.PRODUCTION="PRODUCTION",e.LOCAL="LOCAL"})(Le||(Le={}));var Lt;(function(e){e.STAGE="STAGE",e.PRODUCTION="PROD",e.LOCAL="LOCAL"})(Lt||(Lt={}));var Oe;(function(e){e.DRAFT="DRAFT",e.PUBLISHED="PUBLISHED"})(Oe||(Oe={}));var ae;(function(e){e.V2="UCv2",e.V3="UCv3"})(ae||(ae={}));var V;(function(e){e.CHECKOUT="checkout",e.CHECKOUT_EMAIL="checkout/email",e.SEGMENTATION="segmentation",e.BUNDLE="bundle",e.COMMITMENT="commitment",e.RECOMMENDATION="recommendation",e.EMAIL="email",e.PAYMENT="payment",e.CHANGE_PLAN_TEAM_PLANS="change-plan/team-upgrade/plans",e.CHANGE_PLAN_TEAM_PAYMENT="change-plan/team-upgrade/payment"})(V||(V={}));var Ot=function(e){var t;return(t=Kn.get(e))!==null&&t!==void 0?t:e},Kn=new Map([["countrySpecific","cs"],["quantity","q"],["authCode","code"],["checkoutPromoCode","apc"],["rurl","rUrl"],["curl","cUrl"],["ctxrturl","ctxRtUrl"],["country","co"],["language","lang"],["clientId","cli"],["context","ctx"],["productArrangementCode","pa"],["offerType","ot"],["marketSegment","ms"]]);var Dr=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Ur=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],s;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return o};function xe(e,t,n){var r,i;try{for(var o=Dr(Object.entries(e)),s=o.next();!s.done;s=o.next()){var a=Ur(s.value,2),l=a[0],u=a[1],c=Ot(l);u!=null&&n.has(c)&&t.set(c,u)}}catch(p){r={error:p}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}}function He(e){switch(e){case Le.PRODUCTION:return"https://commerce.adobe.com";default:return"https://commerce-stg.adobe.com"}}function We(e,t){var n,r;for(var i in e){var o=e[i];try{for(var s=(n=void 0,Dr(Object.entries(o))),a=s.next();!a.done;a=s.next()){var l=Ur(a.value,2),u=l[0],c=l[1];if(c!=null){var p=Ot(u);t.set("items["+i+"]["+p+"]",c)}}}catch(f){n={error:f}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}}}var ei=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};function kr(e){ii(e);var t=e.env,n=e.items,r=e.workflowStep,i=ei(e,["env","items","workflowStep"]),o=new URL(He(t));return o.pathname=r+"/",We(n,o.searchParams),xe(i,o.searchParams,ri),o.toString()}var ri=new Set(["cli","co","lang","ctx","cUrl","mv","nglwfdata","otac","promoid","rUrl","sdid","spint","trackingid","code","campaignid","appctxid"]),ni=["env","workflowStep","clientId","country","items"];function ii(e){var t,n;try{for(var r=ti(ni),i=r.next();!i.done;i=r.next()){var o=i.value;if(!e[o])throw new Error('Argument "checkoutData" is not valid, missing: '+o)}}catch(s){t={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}return!0}var oi=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},ai="p_draft_landscape",ci="/store/";function Ct(e){ui(e);var t=e.env,n=e.items,r=e.workflowStep,i=e.ms,o=e.marketSegment,s=e.ot,a=e.offerType,l=e.pa,u=e.productArrangementCode,c=e.landscape,p=oi(e,["env","items","workflowStep","ms","marketSegment","ot","offerType","pa","productArrangementCode","landscape"]),f={marketSegment:o??i,offerType:a??s,productArrangementCode:u??l},h=new URL(He(t));return h.pathname=""+ci+r,r!==V.SEGMENTATION&&r!==V.CHANGE_PLAN_TEAM_PLANS&&We(n,h.searchParams),r===V.SEGMENTATION&&xe(f,h.searchParams,Nt),xe(p,h.searchParams,Nt),c===Oe.DRAFT&&xe({af:ai},h.searchParams,Nt),h.toString()}var Nt=new Set(["af","ai","apc","appctxid","cli","co","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"]),li=["env","workflowStep","clientId","country"];function ui(e){var t,n;try{for(var r=si(li),i=r.next();!i.done;i=r.next()){var o=i.value;if(!e[o])throw new Error('Argument "checkoutData" is not valid, missing: '+o)}}catch(s){t={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}if(e.workflowStep!==V.SEGMENTATION&&e.workflowStep!==V.CHANGE_PLAN_TEAM_PLANS&&!e.items)throw new Error('Argument "checkoutData" is not valid, missing: items');return!0}function Rt(e,t){switch(e){case ae.V2:return kr(t);case ae.V3:return Ct(t);default:return console.warn("Unsupported CheckoutType, will use UCv3 as default. Given type: "+e),Ct(t)}}var It;(function(e){e.BASE="BASE",e.TRIAL="TRIAL",e.PROMOTION="PROMOTION"})(It||(It={}));var R;(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"})(R||(R={}));var O;(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"})(O||(O={}));var Mt;(function(e){e.INDIVIDUAL="INDIVIDUAL",e.TEAM="TEAM",e.ENTERPRISE="ENTERPRISE"})(Mt||(Mt={}));var Dt;(function(e){e.COM="COM",e.EDU="EDU",e.GOV="GOV"})(Dt||(Dt={}));var Ut;(function(e){e.DIRECT="DIRECT",e.INDIRECT="INDIRECT"})(Ut||(Ut={}));var kt;(function(e){e.ENTERPRISE_PRODUCT="ENTERPRISE_PRODUCT",e.ETLA="ETLA",e.RETAIL="RETAIL",e.VIP="VIP",e.VIPMP="VIPMP",e.FREE="FREE"})(kt||(kt={}));var Gr="tacocat.js";var Xe=(e,t)=>String(e??"").toLowerCase()==String(t??"").toLowerCase(),Fr=e=>`${e??""}`.replace(/[&<>'"]/g,t=>({"&":"&","<":"<",">":">","'":"'",'"':"""})[t]??t)??"";function N(e,t={},{metadata:n=!0,search:r=!0,storage:i=!0}={}){let o;if(r&&o==null){let s=new URLSearchParams(window.location.search),a=ye(r)?r:e;o=s.get(a)}if(i&&o==null){let s=ye(i)?i:e;o=window.sessionStorage.getItem(s)??window.localStorage.getItem(s)}if(n&&o==null){let s=fi(ye(n)?n:e);o=document.documentElement.querySelector(`meta[name="${s}"]`)?.content}return o??t[e]}var _e=()=>{};var Vr=e=>typeof e=="boolean",re=e=>typeof e=="function",Ye=e=>typeof e=="number",jr=e=>e!=null&&typeof e=="object";var ye=e=>typeof e=="string",Gt=e=>ye(e)&&e,Se=e=>Ye(e)&&Number.isFinite(e)&&e>0;function ve(e,t=n=>n==null||n===""){return e!=null&&Object.entries(e).forEach(([n,r])=>{t(r)&&delete e[n]}),e}function v(e,t){if(Vr(e))return e;let n=String(e);return n==="1"||n==="true"?!0:n==="0"||n==="false"?!1:t}function ne(e,t,n){let r=Object.values(t);return r.find(i=>Xe(i,e))??n??r[0]}function fi(e=""){return String(e).replace(/(\p{Lowercase_Letter})(\p{Uppercase_Letter})/gu,(t,n,r)=>`${n}-${r}`).replace(/\W+/gu,"-").toLowerCase()}function Te(e,t=1){return Ye(e)||(e=Number.parseInt(e,10)),!Number.isNaN(e)&&e>0&&Number.isFinite(e)?e:t}var pi=Date.now(),Ft=()=>`(+${Date.now()-pi}ms)`,Be=new Set,mi=v(N("tacocat.debug",{},{metadata:!1}),typeof process<"u"&&process.env?.DEBUG);function Hr(e){let t=`[${Gr}/${e}]`,n=(s,a,...l)=>s?!0:(i(a,...l),!1),r=mi?(s,...a)=>{console.debug(`${t} ${s}`,...a,Ft())}:()=>{},i=(s,...a)=>{let l=`${t} ${s}`;Be.forEach(([u])=>u(l,...a))};return{assert:n,debug:r,error:i,warn:(s,...a)=>{let l=`${t} ${s}`;Be.forEach(([,u])=>u(l,...a))}}}function hi(e,t){let n=[e,t];return Be.add(n),()=>{Be.delete(n)}}hi((e,...t)=>{console.error(e,...t,Ft())},(e,...t)=>{console.warn(e,...t,Ft())});var di="no promo",Wr="promo-tag",Ei="yellow",gi="neutral",xi=(e,t,n)=>{let r=o=>o||di,i=n?` (was "${r(t)}")`:"";return`${r(e)}${i}`},yi="cancel-context",Ne=(e,t)=>{let n=e===yi,r=!n&&e?.length>0,i=(r||n)&&(t&&t!=e||!t&&!n),o=i&&r||!i&&!!t,s=o?e||t:void 0;return{effectivePromoCode:s,overridenPromoCode:e,className:o?Wr:`${Wr} no-promo`,text:xi(s,t,i),variant:o?Ei:gi,isOverriden:i}};var Vt="ABM",jt="PUF",Ht="M2M",Wt="PERPETUAL",Xt="P3Y",_i="TAX_INCLUSIVE_DETAILS",Si="TAX_EXCLUSIVE",Xr={ABM:Vt,PUF:jt,M2M:Ht,PERPETUAL:Wt,P3Y:Xt},bs={[Vt]:{commitment:R.YEAR,term:O.MONTHLY},[jt]:{commitment:R.YEAR,term:O.ANNUAL},[Ht]:{commitment:R.MONTH,term:O.MONTHLY},[Wt]:{commitment:R.PERPETUAL,term:void 0},[Xt]:{commitment:R.THREE_MONTHS,term:O.P3Y}},Yr="Value is not an offer",$e=e=>{if(typeof e!="object")return Yr;let{commitment:t,term:n}=e,r=vi(t,n);return{...e,planType:r}};var vi=(e,t)=>{switch(e){case void 0:return Yr;case"":return"";case R.YEAR:return t===O.MONTHLY?Vt:t===O.ANNUAL?jt:"";case R.MONTH:return t===O.MONTHLY?Ht:"";case R.PERPETUAL:return Wt;case R.TERM_LICENSE:return t===O.P3Y?Xt:"";default:return""}};function Yt(e){let{priceDetails:t}=e,{price:n,priceWithoutDiscount:r,priceWithoutTax:i,priceWithoutDiscountAndTax:o,taxDisplay:s}=t;if(s!==_i)return e;let a={...e,priceDetails:{...t,price:i??n,priceWithoutDiscount:o??r,taxDisplay:Si}};return a.offerType==="TRIAL"&&a.priceDetails.price===0&&(a.priceDetails.price=a.priceDetails.priceWithoutDiscount),a}var Bt=function(e,t){return Bt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},Bt(e,t)};function Ce(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Bt(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var y=function(){return y=Object.assign||function(t){for(var n,r=1,i=arguments.length;r0}),n=[],r=0,i=t;r1)throw new RangeError("integer-width stems only accept a single optional option");i.options[0].replace(bi,function(a,l,u,c,p,f){if(l)t.minimumIntegerDigits=u.length;else{if(c&&p)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(tn.test(i.stem)){t.minimumIntegerDigits=i.stem.length;continue}if(Zr.test(i.stem)){if(i.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");i.stem.replace(Zr,function(a,l,u,c,p,f){return u==="*"?t.minimumFractionDigits=l.length:c&&c[0]==="#"?t.maximumFractionDigits=c.length:p&&f?(t.minimumFractionDigits=p.length,t.maximumFractionDigits=p.length+f.length):(t.minimumFractionDigits=l.length,t.maximumFractionDigits=l.length),""}),i.options.length&&(t=y(y({},t),Jr(i.options[0])));continue}if(en.test(i.stem)){t=y(y({},t),Jr(i.stem));continue}var o=rn(i.stem);o&&(t=y(y({},t),o));var s=Ai(i.stem);s&&(t=y(y({},t),s))}return t}var zt,wi=new RegExp("^"+qt.source+"*"),Li=new RegExp(qt.source+"*$");function g(e,t){return{start:e,end:t}}var Oi=!!String.prototype.startsWith,Ni=!!String.fromCodePoint,Ci=!!Object.fromEntries,Ri=!!String.prototype.codePointAt,Ii=!!String.prototype.trimStart,Mi=!!String.prototype.trimEnd,Di=!!Number.isSafeInteger,Ui=Di?Number.isSafeInteger:function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e&&Math.abs(e)<=9007199254740991},Jt=!0;try{on=ln("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu"),Jt=((zt=on.exec("a"))===null||zt===void 0?void 0:zt[0])==="a"}catch{Jt=!1}var on,sn=Oi?function(t,n,r){return t.startsWith(n,r)}:function(t,n,r){return t.slice(r,r+n.length)===n},Qt=Ni?String.fromCodePoint:function(){for(var t=[],n=0;no;){if(s=t[o++],s>1114111)throw RangeError(s+" is not a valid code point");r+=s<65536?String.fromCharCode(s):String.fromCharCode(((s-=65536)>>10)+55296,s%1024+56320)}return r},an=Ci?Object.fromEntries:function(t){for(var n={},r=0,i=t;r=r)){var i=t.charCodeAt(n),o;return i<55296||i>56319||n+1===r||(o=t.charCodeAt(n+1))<56320||o>57343?i:(i-55296<<10)+(o-56320)+65536}},ki=Ii?function(t){return t.trimStart()}:function(t){return t.replace(wi,"")},Gi=Mi?function(t){return t.trimEnd()}:function(t){return t.replace(Li,"")};function ln(e,t){return new RegExp(e,t)}var Kt;Jt?(Zt=ln("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu"),Kt=function(t,n){var r;Zt.lastIndex=n;var i=Zt.exec(t);return(r=i[1])!==null&&r!==void 0?r:""}):Kt=function(t,n){for(var r=[];;){var i=cn(t,n);if(i===void 0||fn(i)||ji(i))break;r.push(i),n+=i>=65536?2:1}return Qt.apply(void 0,r)};var Zt,un=function(){function e(t,n){n===void 0&&(n={}),this.message=t,this.position={offset:0,line:1,column:1},this.ignoreTag=!!n.ignoreTag,this.requiresOtherClause=!!n.requiresOtherClause,this.shouldParseSkeletons=!!n.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,n,r){for(var i=[];!this.isEOF();){var o=this.char();if(o===123){var s=this.parseArgument(t,r);if(s.err)return s;i.push(s.val)}else{if(o===125&&t>0)break;if(o===35&&(n==="plural"||n==="selectordinal")){var a=this.clonePosition();this.bump(),i.push({type:b.pound,location:g(a,this.clonePosition())})}else if(o===60&&!this.ignoreTag&&this.peek()===47){if(r)break;return this.error(E.UNMATCHED_CLOSING_TAG,g(this.clonePosition(),this.clonePosition()))}else if(o===60&&!this.ignoreTag&&er(this.peek()||0)){var s=this.parseTag(t,n);if(s.err)return s;i.push(s.val)}else{var s=this.parseLiteral(t,n);if(s.err)return s;i.push(s.val)}}}return{val:i,err:null}},e.prototype.parseTag=function(t,n){var r=this.clonePosition();this.bump();var i=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:b.literal,value:"<"+i+"/>",location:g(r,this.clonePosition())},err:null};if(this.bumpIf(">")){var o=this.parseMessage(t+1,n,!0);if(o.err)return o;var s=o.val,a=this.clonePosition();if(this.bumpIf("")?{val:{type:b.tag,value:i,children:s,location:g(r,this.clonePosition())},err:null}:this.error(E.INVALID_TAG,g(a,this.clonePosition())))}else return this.error(E.UNCLOSED_TAG,g(r,this.clonePosition()))}else return this.error(E.INVALID_TAG,g(r,this.clonePosition()))},e.prototype.parseTagName=function(){var t=this.offset();for(this.bump();!this.isEOF()&&Vi(this.char());)this.bump();return this.message.slice(t,this.offset())},e.prototype.parseLiteral=function(t,n){for(var r=this.clonePosition(),i="";;){var o=this.tryParseQuote(n);if(o){i+=o;continue}var s=this.tryParseUnquoted(t,n);if(s){i+=s;continue}var a=this.tryParseLeftAngleBracket();if(a){i+=a;continue}break}var l=g(r,this.clonePosition());return{val:{type:b.literal,value:i,location:l},err:null}},e.prototype.tryParseLeftAngleBracket=function(){return!this.isEOF()&&this.char()===60&&(this.ignoreTag||!Fi(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 n=[this.char()];for(this.bump();!this.isEOF();){var r=this.char();if(r===39)if(this.peek()===39)n.push(39),this.bump();else{this.bump();break}else n.push(r);this.bump()}return Qt.apply(void 0,n)},e.prototype.tryParseUnquoted=function(t,n){if(this.isEOF())return null;var r=this.char();return r===60||r===123||r===35&&(n==="plural"||n==="selectordinal")||r===125&&t>0?null:(this.bump(),Qt(r))},e.prototype.parseArgument=function(t,n){var r=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(E.EXPECT_ARGUMENT_CLOSING_BRACE,g(r,this.clonePosition()));if(this.char()===125)return this.bump(),this.error(E.EMPTY_ARGUMENT,g(r,this.clonePosition()));var i=this.parseIdentifierIfPossible().value;if(!i)return this.error(E.MALFORMED_ARGUMENT,g(r,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(E.EXPECT_ARGUMENT_CLOSING_BRACE,g(r,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:b.argument,value:i,location:g(r,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(E.EXPECT_ARGUMENT_CLOSING_BRACE,g(r,this.clonePosition())):this.parseArgumentOptions(t,n,i,r);default:return this.error(E.MALFORMED_ARGUMENT,g(r,this.clonePosition()))}},e.prototype.parseIdentifierIfPossible=function(){var t=this.clonePosition(),n=this.offset(),r=Kt(this.message,n),i=n+r.length;this.bumpTo(i);var o=this.clonePosition(),s=g(t,o);return{value:r,location:s}},e.prototype.parseArgumentOptions=function(t,n,r,i){var o,s=this.clonePosition(),a=this.parseIdentifierIfPossible().value,l=this.clonePosition();switch(a){case"":return this.error(E.EXPECT_ARGUMENT_TYPE,g(s,l));case"number":case"date":case"time":{this.bumpSpace();var u=null;if(this.bumpIf(",")){this.bumpSpace();var c=this.clonePosition(),p=this.parseSimpleArgStyleIfPossible();if(p.err)return p;var f=Gi(p.val);if(f.length===0)return this.error(E.EXPECT_ARGUMENT_STYLE,g(this.clonePosition(),this.clonePosition()));var h=g(c,this.clonePosition());u={style:f,styleLocation:h}}var d=this.tryParseArgumentClose(i);if(d.err)return d;var _=g(i,this.clonePosition());if(u&&sn(u?.style,"::",0)){var S=ki(u.style.slice(2));if(a==="number"){var p=this.parseNumberSkeletonFromString(S,u.styleLocation);return p.err?p:{val:{type:b.number,value:r,location:_,style:p.val},err:null}}else{if(S.length===0)return this.error(E.EXPECT_DATE_TIME_SKELETON,_);var f={type:ce.dateTime,pattern:S,location:u.styleLocation,parsedOptions:this.shouldParseSkeletons?qr(S):{}},A=a==="date"?b.date:b.time;return{val:{type:A,value:r,location:_,style:f},err:null}}}return{val:{type:a==="number"?b.number:a==="date"?b.date:b.time,value:r,location:_,style:(o=u?.style)!==null&&o!==void 0?o:null},err:null}}case"plural":case"selectordinal":case"select":{var w=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(E.EXPECT_SELECT_ARGUMENT_OPTIONS,g(w,y({},w)));this.bumpSpace();var T=this.parseIdentifierIfPossible(),C=0;if(a!=="select"&&T.value==="offset"){if(!this.bumpIf(":"))return this.error(E.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,g(this.clonePosition(),this.clonePosition()));this.bumpSpace();var p=this.tryParseDecimalInteger(E.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,E.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);if(p.err)return p;this.bumpSpace(),T=this.parseIdentifierIfPossible(),C=p.val}var P=this.tryParsePluralOrSelectOptions(t,a,n,T);if(P.err)return P;var d=this.tryParseArgumentClose(i);if(d.err)return d;var L=g(i,this.clonePosition());return a==="select"?{val:{type:b.select,value:r,options:an(P.val),location:L},err:null}:{val:{type:b.plural,value:r,options:an(P.val),offset:C,pluralType:a==="plural"?"cardinal":"ordinal",location:L},err:null}}default:return this.error(E.INVALID_ARGUMENT_TYPE,g(s,l))}},e.prototype.tryParseArgumentClose=function(t){return this.isEOF()||this.char()!==125?this.error(E.EXPECT_ARGUMENT_CLOSING_BRACE,g(t,this.clonePosition())):(this.bump(),{val:!0,err:null})},e.prototype.parseSimpleArgStyleIfPossible=function(){for(var t=0,n=this.clonePosition();!this.isEOF();){var r=this.char();switch(r){case 39:{this.bump();var i=this.clonePosition();if(!this.bumpUntil("'"))return this.error(E.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,g(i,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(n.offset,this.offset()),err:null};break}default:this.bump();break}}return{val:this.message.slice(n.offset,this.offset()),err:null}},e.prototype.parseNumberSkeletonFromString=function(t,n){var r=[];try{r=Kr(t)}catch{return this.error(E.INVALID_NUMBER_SKELETON,n)}return{val:{type:ce.number,tokens:r,location:n,parsedOptions:this.shouldParseSkeletons?nn(r):{}},err:null}},e.prototype.tryParsePluralOrSelectOptions=function(t,n,r,i){for(var o,s=!1,a=[],l=new Set,u=i.value,c=i.location;;){if(u.length===0){var p=this.clonePosition();if(n!=="select"&&this.bumpIf("=")){var f=this.tryParseDecimalInteger(E.EXPECT_PLURAL_ARGUMENT_SELECTOR,E.INVALID_PLURAL_ARGUMENT_SELECTOR);if(f.err)return f;c=g(p,this.clonePosition()),u=this.message.slice(p.offset,this.offset())}else break}if(l.has(u))return this.error(n==="select"?E.DUPLICATE_SELECT_ARGUMENT_SELECTOR:E.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,c);u==="other"&&(s=!0),this.bumpSpace();var h=this.clonePosition();if(!this.bumpIf("{"))return this.error(n==="select"?E.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:E.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,g(this.clonePosition(),this.clonePosition()));var d=this.parseMessage(t+1,n,r);if(d.err)return d;var _=this.tryParseArgumentClose(h);if(_.err)return _;a.push([u,{value:d.val,location:g(h,this.clonePosition())}]),l.add(u),this.bumpSpace(),o=this.parseIdentifierIfPossible(),u=o.value,c=o.location}return a.length===0?this.error(n==="select"?E.EXPECT_SELECT_ARGUMENT_SELECTOR:E.EXPECT_PLURAL_ARGUMENT_SELECTOR,g(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!s?this.error(E.MISSING_OTHER_CLAUSE,g(this.clonePosition(),this.clonePosition())):{val:a,err:null}},e.prototype.tryParseDecimalInteger=function(t,n){var r=1,i=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(r=-1);for(var o=!1,s=0;!this.isEOF();){var a=this.char();if(a>=48&&a<=57)o=!0,s=s*10+(a-48),this.bump();else break}var l=g(i,this.clonePosition());return o?(s*=r,Ui(s)?{val:s,err:null}:this.error(n,l)):this.error(t,l)},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 n=cn(this.message,t);if(n===void 0)throw Error("Offset "+t+" is at invalid UTF-16 code unit boundary");return n},e.prototype.error=function(t,n){return{val:null,err:{kind:t,message:this.message,location:n}}},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(sn(this.message,t,this.offset())){for(var n=0;n=0?(this.bumpTo(r),!0):(this.bumpTo(this.message.length),!1)},e.prototype.bumpTo=function(t){if(this.offset()>t)throw Error("targetOffset "+t+" must be greater than or equal to the current offset "+this.offset());for(t=Math.min(t,this.message.length);;){var n=this.offset();if(n===t)break;if(n>t)throw Error("targetOffset "+t+" is at invalid UTF-16 code unit boundary");if(this.bump(),this.isEOF())break}},e.prototype.bumpSpace=function(){for(;!this.isEOF()&&fn(this.char());)this.bump()},e.prototype.peek=function(){if(this.isEOF())return null;var t=this.char(),n=this.offset(),r=this.message.charCodeAt(n+(t>=65536?2:1));return r??null},e}();function er(e){return e>=97&&e<=122||e>=65&&e<=90}function Fi(e){return er(e)||e===47}function Vi(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 fn(e){return e>=9&&e<=13||e===32||e===133||e>=8206&&e<=8207||e===8232||e===8233}function ji(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 tr(e){e.forEach(function(t){if(delete t.location,Qe(t)||Ke(t))for(var n in t.options)delete t.options[n].location,tr(t.options[n].value);else ze(t)&&tt(t.style)||(Ze(t)||Je(t))&&Re(t.style)?delete t.style.location:et(t)&&tr(t.children)})}function pn(e,t){t===void 0&&(t={}),t=y({shouldParseSkeletons:!0,requiresOtherClause:!0},t);var n=new un(e,t).parse();if(n.err){var r=SyntaxError(E[n.err.kind]);throw r.location=n.err.location,r.originalMessage=n.err.message,r}return t?.captureLocation||tr(n.val),n.val}function Ie(e,t){var n=t&&t.cache?t.cache:$i,r=t&&t.serializer?t.serializer:Bi,i=t&&t.strategy?t.strategy:Wi;return i(e,{cache:n,serializer:r})}function Hi(e){return e==null||typeof e=="number"||typeof e=="boolean"}function mn(e,t,n,r){var i=Hi(r)?r:n(r),o=t.get(i);return typeof o>"u"&&(o=e.call(this,r),t.set(i,o)),o}function hn(e,t,n){var r=Array.prototype.slice.call(arguments,3),i=n(r),o=t.get(i);return typeof o>"u"&&(o=e.apply(this,r),t.set(i,o)),o}function rr(e,t,n,r,i){return n.bind(t,e,r,i)}function Wi(e,t){var n=e.length===1?mn:hn;return rr(e,this,n,t.cache.create(),t.serializer)}function Xi(e,t){return rr(e,this,hn,t.cache.create(),t.serializer)}function Yi(e,t){return rr(e,this,mn,t.cache.create(),t.serializer)}var Bi=function(){return JSON.stringify(arguments)};function nr(){this.cache=Object.create(null)}nr.prototype.get=function(e){return this.cache[e]};nr.prototype.set=function(e,t){this.cache[e]=t};var $i={create:function(){return new nr}},rt={variadic:Xi,monadic:Yi};var le;(function(e){e.MISSING_VALUE="MISSING_VALUE",e.INVALID_VALUE="INVALID_VALUE",e.MISSING_INTL_API="MISSING_INTL_API"})(le||(le={}));var Me=function(e){Ce(t,e);function t(n,r,i){var o=e.call(this,n)||this;return o.code=r,o.originalMessage=i,o}return t.prototype.toString=function(){return"[formatjs Error: "+this.code+"] "+this.message},t}(Error);var ir=function(e){Ce(t,e);function t(n,r,i,o){return e.call(this,'Invalid values for "'+n+'": "'+r+'". Options are "'+Object.keys(i).join('", "')+'"',le.INVALID_VALUE,o)||this}return t}(Me);var dn=function(e){Ce(t,e);function t(n,r,i){return e.call(this,'Value for "'+n+'" must be of type '+r,le.INVALID_VALUE,i)||this}return t}(Me);var En=function(e){Ce(t,e);function t(n,r){return e.call(this,'The intl string context variable "'+n+'" was not provided to the string "'+r+'"',le.MISSING_VALUE,r)||this}return t}(Me);var I;(function(e){e[e.literal=0]="literal",e[e.object=1]="object"})(I||(I={}));function qi(e){return e.length<2?e:e.reduce(function(t,n){var r=t[t.length-1];return!r||r.type!==I.literal||n.type!==I.literal?t.push(n):r.value+=n.value,t},[])}function zi(e){return typeof e=="function"}function De(e,t,n,r,i,o,s){if(e.length===1&&$t(e[0]))return[{type:I.literal,value:e[0].value}];for(var a=[],l=0,u=e;l0?e.substring(0,n):"";let i=wn(e.split("").reverse().join("")),o=r-i,s=e.substring(o,o+1),a=o+(s==="."||s===","?1:0);t.suffix=i>0?e.substring(a,r):"",t.mask=e.substring(n,a),t.maskHasNegativeSign=t.mask.charAt(0)==="-",t.maskHasPositiveSign=t.mask.charAt(0)==="+";let c=t.mask.match(fo);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 mo(e,t,r){let n=!1,i={value:e};e<0&&(n=!0,i.value=-i.value),i.sign=n?"-":"",i.value=Number(i.value).toFixed(t.fraction&&t.fraction.length),i.value=Number(i.value).toString();let o=t.fraction&&t.fraction.lastIndexOf("0"),[s="0",a=""]=i.value.split(".");return(!a||a&&a.length<=o)&&(a=o<0?"":(+("0."+a)).toFixed(o+1).replace("0.","")),i.integer=s,i.fraction=a,ho(i,t),(i.result==="0"||i.result==="")&&(n=!1,i.sign=""),!n&&t.maskHasPositiveSign?i.sign="+":n&&t.maskHasPositiveSign?i.sign="-":n&&(i.sign=r&&r.enforceMaskSign&&!t.maskHasNegativeSign?"":"-"),i}function ho(e,t){e.result="";let r=t.integer.split(t.separator),n=r.join(""),i=n&&n.indexOf("0");if(i>-1)for(;e.integer.lengthMath.round(e*20)/20},sr=(e,t)=>({accept:e,round:t}),_o=[sr(({divisor:e,price:t})=>t%e==0,({divisor:e,price:t})=>t/e),sr(({usePrecision:e})=>e,({divisor:e,price:t})=>Math.ceil(Math.floor(t*1e4/e)/100)/100),sr(()=>!0,({divisor:e,price:t})=>Math.ceil(Math.floor(t*100/e)/100))],ar={[I.YEAR]:{[L.MONTHLY]:Ve.MONTH,[L.ANNUAL]:Ve.YEAR},[I.MONTH]:{[L.MONTHLY]:Ve.MONTH}},vo=(e,t)=>e.indexOf(`'${t}'`)===0,To=(e,t=!0)=>{let r=e.replace(/'.*?'/,"").trim(),n=Un(r);return!!n?t||(r=r.replace(/[,\.]0+/,n)):r=r.replace(/\s?(#.*0)(?!\s)?/,"$&"+So(e)),r},bo=e=>{let t=Po(e),r=vo(e,t),n=e.replace(/'.*?'/,""),i=Cn.test(n)||In.test(n);return{currencySymbol:t,isCurrencyFirst:r,hasCurrencySpace:i}},Rn=e=>e.replace(Cn,Nn).replace(In,Nn),So=e=>e.match(/#(.?)#/)?.[1]===Ln?go:Ln,Po=e=>e.match(/'(.*?)'/)?.[1]??"",Un=e=>e.match(/0(.?)0/)?.[1]??"";function at({formatString:e,price:t,usePrecision:r,isIndianPrice:n=!1},i,o=s=>s){let{currencySymbol:s,isCurrencyFirst:a,hasCurrencySpace:c}=bo(e),l=r?Un(e):"",u=To(e,r),p=r?2:0,f=o(t,{currencySymbol:s}),d=n?f.toLocaleString("hi-IN",{minimumFractionDigits:p,maximumFractionDigits:p}):On(u,f),h=r?d.lastIndexOf(l):d.length,E=d.substring(0,h),S=d.substring(h+1);return{accessiblePrice:e.replace(/'.*?'/,"SYMBOL").replace(/#.*0/,d).replace(/SYMBOL/,s),currencySymbol:s,decimals:S,decimalsDelimiter:l,hasCurrencySpace:c,integer:E,isCurrencyFirst:a,recurrenceTerm:i}}var Dn=e=>{let{commitment:t,term:r,usePrecision:n}=e,i=xo[r]??1;return at(e,i>1?Ve.MONTH:ar[t]?.[r],(o,{currencySymbol:s})=>{let a={divisor:i,price:o,usePrecision:n},{round:c}=_o.find(({accept:u})=>u(a));if(!c)throw new Error(`Missing rounding rule for: ${JSON.stringify(a)}`);return(yo[s]??(u=>u))(c(a))})},Mn=({commitment:e,term:t,...r})=>at(r,ar[e]?.[t]),kn=e=>{let{commitment:t,term:r}=e;return t===I.YEAR&&r===L.MONTHLY?at(e,Ve.YEAR,n=>n*12):at(e,ar[t]?.[r])};var Ao={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 {alternativePrice}",strikethroughAriaLabel:"Regularly at {strikethroughPrice}"},wo=Jr("ConsonantTemplates/price"),Oo=/<.+?>/g,W={container:"price",containerOptical:"price-optical",containerStrikethrough:"price-strikethrough",containerAnnual:"price-annual",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"},he={perUnitLabel:"perUnitLabel",perUnitAriaLabel:"perUnitAriaLabel",recurrenceLabel:"recurrenceLabel",recurrenceAriaLabel:"recurrenceAriaLabel",taxExclusiveLabel:"taxExclusiveLabel",taxInclusiveLabel:"taxInclusiveLabel",strikethroughAriaLabel:"strikethroughAriaLabel"},Lo="TAX_EXCLUSIVE",No=e=>Zr(e)?Object.entries(e).filter(([,t])=>Te(t)||Ze(t)||t===!0).reduce((t,[r,n])=>t+` ${r}${n===!0?"":'="'+qr(n)+'"'}`,""):"",z=(e,t,r,n=!1)=>`${n?Rn(t):t??""}`;function Co(e,{accessibleLabel:t,currencySymbol:r,decimals:n,decimalsDelimiter:i,hasCurrencySpace:o,integer:s,isCurrencyFirst:a,recurrenceLabel:c,perUnitLabel:l,taxInclusivityLabel:u},p={}){let f=z(W.currencySymbol,r),d=z(W.currencySpace,o?" ":""),h="";return a&&(h+=f+d),h+=z(W.integer,s),h+=z(W.decimalsDelimiter,i),h+=z(W.decimals,n),a||(h+=d+f),h+=z(W.recurrence,c,null,!0),h+=z(W.unitType,l,null,!0),h+=z(W.taxInclusivity,u,!0),z(e,h,{...p,"aria-label":t})}var de=({displayOptical:e=!1,displayStrikethrough:t=!1,displayAnnual:r=!1}={})=>({country:n,displayFormatted:i=!0,displayRecurrence:o=!0,displayPerUnit:s=!1,displayTax:a=!1,language:c,literals:l={}}={},{commitment:u,formatString:p,price:f,priceWithoutDiscount:d,taxDisplay:h,taxTerm:E,term:S,usePrecision:N}={},P={})=>{Object.entries({country:n,formatString:p,language:c,price:f}).forEach(([re,wt])=>{if(wt==null)throw new Error(`Argument "${re}" is missing`)});let b={...Ao,...l},O=`${c.toLowerCase()}-${n.toUpperCase()}`;function y(re,wt){let Ot=b[re];if(Ot==null)return"";try{return new An(Ot.replace(Oo,""),O).format(wt)}catch{return wo.error("Failed to format literal:",Ot),""}}let C=t&&d?d:f,M=e?Dn:Mn;r&&(M=kn);let{accessiblePrice:X,recurrenceTerm:B,...R}=M({commitment:u,formatString:p,term:S,price:e?f:C,usePrecision:N,isIndianPrice:n==="IN"}),j=X,ae="";if(v(o)&&B){let re=y(he.recurrenceAriaLabel,{recurrenceTerm:B});re&&(j+=" "+re),ae=y(he.recurrenceLabel,{recurrenceTerm:B})}let le="";if(v(s)){le=y(he.perUnitLabel,{perUnit:"LICENSE"});let re=y(he.perUnitAriaLabel,{perUnit:"LICENSE"});re&&(j+=" "+re)}let te="";v(a)&&E&&(te=y(h===Lo?he.taxExclusiveLabel:he.taxInclusiveLabel,{taxTerm:E}),te&&(j+=" "+te)),t&&(j=y(he.strikethroughAriaLabel,{strikethroughPrice:j}));let q=W.container;if(e&&(q+=" "+W.containerOptical),t&&(q+=" "+W.containerStrikethrough),r&&(q+=" "+W.containerAnnual),v(i))return Co(q,{...R,accessibleLabel:j,recurrenceLabel:ae,perUnitLabel:le,taxInclusivityLabel:te},P);let{currencySymbol:ye,decimals:He,decimalsDelimiter:Xe,hasCurrencySpace:Ce,integer:At,isCurrencyFirst:ai}=R,_e=[At,Xe,He];ai?(_e.unshift(Ce?"\xA0":""),_e.unshift(ye)):(_e.push(Ce?"\xA0":""),_e.push(ye)),_e.push(ae,le,te);let ci=_e.join("");return z(q,ci,P)},Gn=()=>(e,t,r)=>{let i=(e.displayOldPrice===void 0||v(e.displayOldPrice))&&t.priceWithoutDiscount&&t.priceWithoutDiscount!=t.price;return`${de()(e,t,r)}${i?" "+de({displayStrikethrough:!0})(e,t,r):""}`};var cr=de(),ur=Gn(),lr=de({displayOptical:!0}),fr=de({displayStrikethrough:!0}),pr=de({displayAnnual:!0});var Io=(e,t)=>{if(!(!Se(e)||!Se(t)))return Math.floor((t-e)/t*100)},Fn=()=>(e,t,r)=>{let{price:n,priceWithoutDiscount:i}=t,o=Io(n,i);return o===void 0?'':`${o}%`};var mr=Fn();var hr="ABM",dr="PUF",Er="M2M",gr="PERPETUAL",Vn="P3Y",Ro="TAX_INCLUSIVE_DETAILS",Uo="TAX_EXCLUSIVE",jn={ABM:hr,PUF:dr,M2M:Er,PERPETUAL:gr,P3Y:Vn},tc={[hr]:{commitment:I.YEAR,term:L.MONTHLY},[dr]:{commitment:I.YEAR,term:L.ANNUAL},[Er]:{commitment:I.MONTH,term:L.MONTHLY},[gr]:{commitment:I.PERPETUAL,term:void 0},[Vn]:{commitment:I.THREE_MONTHS,term:L.P3Y}},Wn="Value is not an offer",ct=e=>{if(typeof e!="object")return Wn;let{commitment:t,term:r}=e,n=Do(t,r);return{...e,planType:n}};var Do=(e,t)=>{if(e===void 0)return Wn;if(e===""&&t==="")return"";let r="";return e===I.YEAR?t===L.MONTHLY?r=hr:t===L.ANNUAL&&(r=dr):e===I.MONTH?t===L.MONTHLY&&(r=Er):e===I.PERPETUAL&&(r=gr),r};function xr(e){let{priceDetails:t}=e,{price:r,priceWithoutDiscount:n,priceWithoutTax:i,priceWithoutDiscountAndTax:o,taxDisplay:s}=t;if(s!==Ro)return e;let a={...e,priceDetails:{...t,price:i??r,priceWithoutDiscount:o??n,taxDisplay:Uo}};return a.offerType==="TRIAL"&&a.priceDetails.price===0&&(a.priceDetails.price=a.priceDetails.priceWithoutDiscount),a}var{freeze:Ee}=Object,Z=Ee({...fe}),Q=Ee({...$}),H=Ee({...Y}),yr=Ee({...I}),we=Ee({...Re}),_r=Ee({...jn}),vr=Ee({...L});var Or={};li(Or,{CLASS_NAME_FAILED:()=>ut,CLASS_NAME_PENDING:()=>lt,CLASS_NAME_RESOLVED:()=>ft,ERROR_MESSAGE_BAD_REQUEST:()=>Tr,ERROR_MESSAGE_MISSING_LITERALS_URL:()=>Sr,ERROR_MESSAGE_OFFER_NOT_FOUND:()=>br,EVENT_TYPE_ERROR:()=>Mo,EVENT_TYPE_FAILED:()=>pt,EVENT_TYPE_PENDING:()=>mt,EVENT_TYPE_READY:()=>ge,EVENT_TYPE_RESOLVED:()=>ht,LOG_NAMESPACE:()=>Pr,PARAM_AOS_API_KEY:()=>ko,PARAM_ENV:()=>Ar,PARAM_LANDSCAPE:()=>wr,PARAM_WCS_API_KEY:()=>Go,STATE_FAILED:()=>J,STATE_PENDING:()=>K,STATE_RESOLVED:()=>ee,TAG_NAME_SERVICE:()=>oe});var ut="placeholder-failed",lt="placeholder-pending",ft="placeholder-resolved",Tr="Bad WCS request",br="Commerce offer not found",Sr="Literals URL not provided",Mo="wcms:commerce:error",pt="wcms:placeholder:failed",mt="wcms:placeholder:pending",ge="wcms:commerce:ready",ht="wcms:placeholder:resolved",Pr="wcms/commerce",Ar="commerce.env",wr="commerce.landscape",ko="commerce.aosKey",Go="commerce.wcsKey",J="failed",K="pending",ee="resolved",oe="wcms-commerce";var Lr={clientId:"merch-at-scale",delimiter:"\xB6",ignoredProperties:["analytics","literals"],serializableTypes:["Array","Object"],sampleRate:30,tags:"consumer=milo/commerce"},Hn=new Set,Fo=e=>e instanceof Error||typeof e.originatingRequest=="string";function Xn(e){if(e==null)return;let t=typeof e;if(t==="function"){let{name:r}=e;return r?`${t} ${r}`:t}if(t==="object"){if(e instanceof Error)return e.message;if(typeof e.originatingRequest=="string"){let{message:n,originatingRequest:i,status:o}=e;return[n,o,i].filter(s=>s).join(" ")}let r=e[Symbol.toStringTag]??Object.getPrototypeOf(e).constructor.name;if(!Lr.serializableTypes.includes(r))return r}return e}function Vo(e,t){if(!Lr.ignoredProperties.includes(e))return Xn(t)}var Nr={append(e){let{delimiter:t,sampleRate:r,tags:n,clientId:i}=Lr,{message:o,params:s}=e,a=[],c=o,l=[];s.forEach(f=>{f!=null&&(Fo(f)?a:l).push(f)}),a.length&&(c+=" ",c+=a.map(Xn).join(" "));let{pathname:u,search:p}=window.location;c+=`${t}page=`,c+=u+p,l.length&&(c+=`${t}facts=`,c+=JSON.stringify(l,Vo)),Hn.has(c)||(Hn.add(c),window.lana?.log(c,{sampleRate:r,tags:n,clientId:i}))}};var _=Object.freeze({checkoutClientId:"adobe_com",checkoutWorkflow:Z.V3,checkoutWorkflowStep:Q.EMAIL,country:"US",displayOldPrice:!0,displayPerUnit:!1,displayRecurrence:!0,displayTax:!1,domainSwitch:!1,env:H.PRODUCTION,forceTaxExclusive:!1,language:"en",entitlement:!1,extraOptions:{},modal:!1,promotionCode:"",quantity:1,wcsApiKey:"wcms-commerce-ims-ro-user-milo",wcsBufferDelay:1,wcsEnv:we.PRODUCTION,landscape:G.PUBLISHED,wcsBufferLimit:1});function Bn(e,{once:t=!1}={}){let r=null;function n(){let i=document.querySelector(oe);i!==r&&(r=i,i&&e(i))}return document.addEventListener(ge,n,{once:t}),ue(n),()=>document.removeEventListener(ge,n)}function je(e,{country:t,forceTaxExclusive:r,perpetual:n}){let i;if(e.length<2)i=e;else{let o=t==="GB"||n?"EN":"MULT",[s,a]=e;i=[s.language===o?s:a]}return r&&(i=i.map(xr)),i}var ue=e=>window.setTimeout(e);function Oe(e,t=1){if(e==null)return[t];let r=(Array.isArray(e)?e:String(e).split(",")).map(Ae).filter(Se);return r.length||(r=[t]),r}function dt(e){return e==null?[]:(Array.isArray(e)?e:String(e).split(",")).filter(Xt)}function F(){return window.customElements.get(oe)?.instance}var jo="en_US",m={ar:"AR_es",be_en:"BE_en",be_fr:"BE_fr",be_nl:"BE_nl",br:"BR_pt",ca:"CA_en",ch_de:"CH_de",ch_fr:"CH_fr",ch_it:"CH_it",cl:"CL_es",co:"CO_es",la:"DO_es",mx:"MX_es",pe:"PE_es",africa:"MU_en",dk:"DK_da",de:"DE_de",ee:"EE_et",eg_ar:"EG_ar",eg_en:"EG_en",es:"ES_es",fr:"FR_fr",gr_el:"GR_el",gr_en:"GR_en",ie:"IE_en",il_he:"IL_iw",it:"IT_it",lv:"LV_lv",lt:"LT_lt",lu_de:"LU_de",lu_en:"LU_en",lu_fr:"LU_fr",my_en:"MY_en",my_ms:"MY_ms",hu:"HU_hu",mt:"MT_en",mena_en:"DZ_en",mena_ar:"DZ_ar",nl:"NL_nl",no:"NO_nb",pl:"PL_pl",pt:"PT_pt",ro:"RO_ro",si:"SI_sl",sk:"SK_sk",fi:"FI_fi",se:"SE_sv",tr:"TR_tr",uk:"GB_en",at:"AT_de",cz:"CZ_cs",bg:"BG_bg",ru:"RU_ru",ua:"UA_uk",au:"AU_en",in_en:"IN_en",in_hi:"IN_hi",id_en:"ID_en",id_id:"ID_in",nz:"NZ_en",sa_ar:"SA_ar",sa_en:"SA_en",sg:"SG_en",cn:"CN_zh-Hans",tw:"TW_zh-Hant",hk_zh:"HK_zh-hant",jp:"JP_ja",kr:"KR_ko",za:"ZA_en",ng:"NG_en",cr:"CR_es",ec:"EC_es",pr:"US_es",gt:"GT_es",cis_en:"AZ_en",cis_ru:"AZ_ru",sea:"SG_en",th_en:"TH_en",th_th:"TH_th"},se=Object.freeze({LOCAL:"local",PROD:"prod",STAGE:"stage"});function Yn({locale:e={}}={}){if(!e.prefix)return{country:_.country,language:_.language,locale:jo};let t=e.prefix.replace("/","")??"",[r=_.country,n=_.language]=(m[t]??t).split("_",2);return r=r.toUpperCase(),n=n.toLowerCase(),{country:r,language:n,locale:`${n}_${r}`}}function Cr(e={}){let{commerce:t={},locale:r=void 0}=e,i=(e.env?.name===se.PROD?se.PROD:ie(w(Ar,t,{metadata:!1}),se,se.PROD))===se.STAGE?H.STAGE:H.PRODUCTION,o=w("checkoutClientId",t)??_.checkoutClientId,s=ie(w("checkoutWorkflow",t),Z,_.checkoutWorkflow),a=Q.CHECKOUT;s===Z.V3&&(a=ie(w("checkoutWorkflowStep",t),Q,_.checkoutWorkflowStep));let c=v(w("displayOldPrice",t),_.displayOldPrice),l=v(w("displayPerUnit",t),_.displayPerUnit),u=v(w("displayRecurrence",t),_.displayRecurrence),p=v(w("displayTax",t),_.displayTax),f=v(w("entitlement",t),_.entitlement),d=v(w("modal",t),_.modal),h=v(w("forceTaxExclusive",t),_.forceTaxExclusive),E=w("promotionCode",t)??_.promotionCode,S=Oe(w("quantity",t)),N=w("wcsApiKey",t)??_.wcsApiKey,P=e.env?.name===se.PROD?G.PUBLISHED:ie(w(wr,t),G,_.landscape),b=Ae(w("wcsBufferDelay",t),_.wcsBufferDelay),O=Ae(w("wcsBufferLimit",t),_.wcsBufferLimit),y=v(w("domain.switch",t),!1);return{...Yn({locale:r}),displayOldPrice:c,checkoutClientId:o,checkoutWorkflow:s,checkoutWorkflowStep:a,displayPerUnit:l,displayRecurrence:u,displayTax:p,entitlement:f,extraOptions:_.extraOptions,modal:d,env:i,forceTaxExclusive:h,priceLiteralsURL:t.priceLiteralsURL,priceLiteralsPromise:t.priceLiteralsPromise,promotionCode:E,quantity:S,wcsApiKey:N,wcsBufferDelay:b,wcsBufferLimit:O,wcsEnv:i===H.STAGE?we.STAGE:we.PRODUCTION,landscape:P,domainSwitch:y}}var qn="debug",Wo="error",Ho="info",Xo="warn",Bo=Date.now(),Ir=new Set,Rr=new Set,$n=new Map,We=Object.freeze({DEBUG:qn,ERROR:Wo,INFO:Ho,WARN:Xo}),zn={append({level:e,message:t,params:r,timestamp:n,source:i}){console[e](`${n}ms [${i}] %c${t}`,"font-weight: bold;",...r)}},Zn={filter:({level:e})=>e!==qn},Yo={filter:()=>!1};function $o(e,t,r,n,i){return{level:e,message:t,namespace:r,get params(){if(n.length===1){let[o]=n;ce(o)&&(n=o(),Array.isArray(n)||(n=[n]))}return n},source:i,timestamp:Date.now()-Bo}}function qo(e){[...Rr].every(t=>t(e))&&Ir.forEach(t=>t(e))}function Qn(e){let t=($n.get(e)??0)+1;$n.set(e,t);let r=`${e} #${t}`,n=o=>(s,...a)=>qo($o(o,s,e,a,r)),i=Object.seal({id:r,namespace:e,module(o){return Qn(`${i.namespace}/${o}`)},debug:n(We.DEBUG),error:n(We.ERROR),info:n(We.INFO),warn:n(We.WARN)});return i}function Et(...e){e.forEach(t=>{let{append:r,filter:n}=t;ce(n)?Rr.add(n):ce(r)&&Ir.add(r)})}function zo(e={}){let{name:t}=e,r=v(w("commerce.debug",{search:!0,storage:!0}),t===se.LOCAL);return Et(r?zn:Zn),t===se.PROD&&Et(Nr),D}function Zo(){Ir.clear(),Rr.clear()}var D={...Qn(Pr),Level:We,Plugins:{consoleAppender:zn,debugFilter:Zn,quietFilter:Yo,lanaAppender:Nr},init:zo,reset:Zo,use:Et};var Qo={CLASS_NAME_FAILED:ut,CLASS_NAME_PENDING:lt,CLASS_NAME_RESOLVED:ft,EVENT_TYPE_FAILED:pt,EVENT_TYPE_PENDING:mt,EVENT_TYPE_RESOLVED:ht,STATE_FAILED:J,STATE_PENDING:K,STATE_RESOLVED:ee},Jo={[J]:ut,[K]:lt,[ee]:ft},Ko={[J]:pt,[K]:mt,[ee]:ht},yt=new WeakMap;function V(e){if(!yt.has(e)){let t=D.module(e.constructor.is);yt.set(e,{changes:new Map,connected:!1,dispose:be,error:void 0,log:t,options:void 0,promises:[],state:K,timer:null,value:void 0,version:0})}return yt.get(e)}function gt(e){let t=V(e),{error:r,promises:n,state:i}=t;(i===ee||i===J)&&(t.promises=[],i===ee?n.forEach(({resolve:o})=>o(e)):i===J&&n.forEach(({reject:o})=>o(r))),e.dispatchEvent(new CustomEvent(Ko[i],{bubbles:!0}))}function xt(e){let t=yt.get(e);[J,K,ee].forEach(r=>{e.classList.toggle(Jo[r],r===t.state)})}var es={get error(){return V(this).error},get log(){return V(this).log},get options(){return V(this).options},get state(){return V(this).state},get value(){return V(this).value},attributeChangedCallback(e,t,r){V(this).changes.set(e,r),this.requestUpdate()},connectedCallback(){V(this).dispose=Bn(()=>this.requestUpdate(!0))},disconnectedCallback(){let e=V(this);e.connected&&(e.connected=!1,e.log.debug("Disconnected:",{element:this})),e.dispose(),e.dispose=be},onceSettled(){let{error:e,promises:t,state:r}=V(this);return ee===r?Promise.resolve(this):J===r?Promise.reject(e):new Promise((n,i)=>{t.push({resolve:n,reject:i})})},toggleResolved(e,t,r){let n=V(this);return e!==n.version?!1:(r!==void 0&&(n.options=r),n.state=ee,n.value=t,xt(this),this.log.debug("Resolved:",{element:this,value:t}),ue(()=>gt(this)),!0)},toggleFailed(e,t,r){let n=V(this);return e!==n.version?!1:(r!==void 0&&(n.options=r),n.error=t,n.state=J,xt(this),n.log.error("Failed:",{element:this,error:t}),ue(()=>gt(this)),!0)},togglePending(e){let t=V(this);return t.version++,e&&(t.options=e),t.state=K,xt(this),ue(()=>gt(this)),t.version},requestUpdate(e=!1){if(!this.isConnected||!F())return;let t=V(this);if(t.timer)return;let{error:r,options:n,state:i,value:o,version:s}=t;t.state=K,t.timer=ue(async()=>{t.timer=null;let a=null;if(t.changes.size&&(a=Object.fromEntries(t.changes.entries()),t.changes.clear()),t.connected?t.log.debug("Updated:",{element:this,changes:a}):(t.connected=!0,t.log.debug("Connected:",{element:this,changes:a})),a||e)try{await this.render?.()===!1&&t.state===K&&t.version===s&&(t.state=i,t.error=r,t.value=o,xt(this),gt(this))}catch(c){this.toggleFailed(t.version,c,n)}})}};function Jn(e={}){return Object.entries(e).forEach(([t,r])=>{(r==null||r===""||r?.length===0)&&delete e[t]}),e}function _t(e,t={}){let{tag:r,is:n}=e,i=document.createElement(r,{is:n});return i.setAttribute("is",n),Object.assign(i.dataset,Jn(t)),i}function vt(e){let{tag:t,is:r,prototype:n}=e,i=window.customElements.get(r);return i||(Object.defineProperties(n,Object.getOwnPropertyDescriptors(es)),i=Object.defineProperties(e,Object.getOwnPropertyDescriptors(Qo)),window.customElements.define(r,i,{extends:t})),i}function Tt(e,t=document.body){return Array.from(t?.querySelectorAll(`${e.tag}[is="${e.is}"]`)??[])}function bt(e,t={}){return e instanceof HTMLElement?(Object.assign(e.dataset,Jn(t)),e):null}var ts="download",rs="upgrade",xe,Le=class Le extends HTMLAnchorElement{constructor(){super();Fr(this,xe,void 0);this.addEventListener("click",this.clickHandler)}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"]}static createCheckoutLink(r={},n=""){let i=F();if(!i)return null;let{checkoutMarketSegment:o,checkoutWorkflow:s,checkoutWorkflowStep:a,entitlement:c,upgrade:l,modal:u,perpetual:p,promotionCode:f,quantity:d,wcsOsi:h,extraOptions:E}=i.collectCheckoutOptions(r),S=_t(Le,{checkoutMarketSegment:o,checkoutWorkflow:s,checkoutWorkflowStep:a,entitlement:c,upgrade:l,modal:u,perpetual:p,promotionCode:f,quantity:d,wcsOsi:h,extraOptions:E});return n&&(S.innerHTML=`${n}`),S}static getCheckoutLinks(r){return Tt(Le,r)}get isCheckoutLink(){return!0}get placeholder(){return this}clickHandler(r){var n;(n=Lt(this,xe))==null||n.call(this,r)}async render(r={}){if(!this.isConnected)return!1;let n=F();if(!n)return!1;this.dataset.imsCountry||n.imsCountryPromise.then(u=>{u&&(this.dataset.imsCountry=u)},be);let i=n.collectCheckoutOptions(r,this.placeholder);if(!i.wcsOsi.length)return!1;let o;try{o=JSON.parse(i.extraOptions??"{}")}catch(u){this.placeholder.log.error("cannot parse exta checkout options",u)}let s=this.placeholder.togglePending(i);this.href="";let a=n.resolveOfferSelectors(i),c=await Promise.all(a);c=c.map(u=>je(u,i));let l=await n.buildCheckoutAction(c.flat(),{...o,...i});return this.renderOffers(c.flat(),i,{},l,s)}renderOffers(r,n,i={},o=void 0,s=void 0){if(!this.isConnected)return!1;let a=F();if(!a)return!1;if(n={...JSON.parse(this.placeholder.dataset.extraOptions??"null"),...n,...i},s??(s=this.placeholder.togglePending(n)),Lt(this,xe)&&Nt(this,xe,void 0),o){this.classList.remove(ts,rs),this.placeholder.toggleResolved(s,r,n);let{url:l,text:u,className:p,handler:f}=o;return l&&(this.href=l),u&&(this.firstElementChild.innerHTML=u),p&&this.classList.add(...p.split(" ")),f&&(this.setAttribute("href","#"),Nt(this,xe,f.bind(this))),!0}else if(r.length){if(this.placeholder.toggleResolved(s,r,n)){let l=a.buildCheckoutURL(r,n);return this.setAttribute("href",l),!0}}else{let l=new Error(`Not provided: ${n?.wcsOsi??"-"}`);if(this.placeholder.toggleFailed(s,l,n))return this.setAttribute("href","#"),!0}return!1}updateOptions(r={}){let n=F();if(!n)return!1;let{checkoutMarketSegment:i,checkoutWorkflow:o,checkoutWorkflowStep:s,entitlement:a,upgrade:c,modal:l,perpetual:u,promotionCode:p,quantity:f,wcsOsi:d}=n.collectCheckoutOptions(r);return bt(this,{checkoutMarketSegment:i,checkoutWorkflow:o,checkoutWorkflowStep:s,entitlement:a,upgrade:c,modal:l,perpetual:u,promotionCode:p,quantity:f,wcsOsi:d}),!0}};xe=new WeakMap,ne(Le,"is","checkout-link"),ne(Le,"tag","a");var Ur=Le,St=vt(Ur);var Kn=[m.uk,m.au,m.fr,m.at,m.be_en,m.be_fr,m.be_nl,m.bg,m.ch_de,m.ch_fr,m.ch_it,m.cz,m.de,m.dk,m.ee,m.eg_ar,m.eg_en,m.es,m.fi,m.fr,m.gr_el,m.gr_en,m.hu,m.ie,m.it,m.lu_de,m.lu_en,m.lu_fr,m.nl,m.no,m.pl,m.pt,m.ro,m.se,m.si,m.sk,m.tr,m.ua,m.id_en,m.id_id,m.in_en,m.in_hi,m.jp,m.my_en,m.my_ms,m.nz,m.th_en,m.th_th],ns={INDIVIDUAL_COM:[m.za,m.lt,m.lv,m.ng,m.sa_ar,m.sa_en,m.za,m.sg,m.kr],TEAM_COM:[m.za,m.lt,m.lv,m.ng,m.za,m.co,m.kr],INDIVIDUAL_EDU:[m.lt,m.lv,m.sa_en,m.sea],TEAM_EDU:[m.sea,m.kr]},Ne=class Ne extends HTMLSpanElement{static get observedAttributes(){return["data-display-old-price","data-display-per-unit","data-display-recurrence","data-display-tax","data-perpetual","data-promotion-code","data-tax-exclusive","data-template","data-wcs-osi"]}static createInlinePrice(t){let r=F();if(!r)return null;let{displayOldPrice:n,displayPerUnit:i,displayRecurrence:o,displayTax:s,forceTaxExclusive:a,perpetual:c,promotionCode:l,quantity:u,template:p,wcsOsi:f}=r.collectPriceOptions(t);return _t(Ne,{displayOldPrice:n,displayPerUnit:i,displayRecurrence:o,displayTax:s,forceTaxExclusive:a,perpetual:c,promotionCode:l,quantity:u,template:p,wcsOsi:f})}static getInlinePrices(t){return Tt(Ne,t)}get isInlinePrice(){return!0}get placeholder(){return this}resolveDisplayTaxForGeoAndSegment(t,r,n,i){let o=`${t}_${r}`;if(Kn.includes(t)||Kn.includes(o))return!0;let s=ns[`${n}_${i}`];return s?!!(s.includes(t)||s.includes(o)):!1}async resolveDisplayTax(t,r){let[n]=await t.resolveOfferSelectors(r),i=je(await n,r);if(i?.length){let{country:o,language:s}=r,a=i[0],[c=""]=a.marketSegments;return this.resolveDisplayTaxForGeoAndSegment(o,s,a.customerSegment,c)}}async render(t={}){if(!this.isConnected)return!1;let r=F();if(!r)return!1;let n=r.collectPriceOptions(t,this.placeholder);if(!n.wcsOsi.length)return!1;let i=this.placeholder.togglePending(n);this.innerHTML="";let[o]=r.resolveOfferSelectors(n);return this.renderOffers(je(await o,n),n,i)}renderOffers(t,r={},n=void 0){if(!this.isConnected)return;let i=F();if(!i)return!1;let o=i.collectPriceOptions({...this.dataset,...r});if(n??(n=this.placeholder.togglePending(o)),t.length){if(this.placeholder.toggleResolved(n,t,o))return this.innerHTML=i.buildPriceHTML(t,o),!0}else{let s=new Error(`Not provided: ${o?.wcsOsi??"-"}`);if(this.placeholder.toggleFailed(n,s,o))return this.innerHTML="",!0}return!1}updateOptions(t){let r=F();if(!r)return!1;let{displayOldPrice:n,displayPerUnit:i,displayRecurrence:o,displayTax:s,forceTaxExclusive:a,perpetual:c,promotionCode:l,quantity:u,template:p,wcsOsi:f}=r.collectPriceOptions(t);return bt(this,{displayOldPrice:n,displayPerUnit:i,displayRecurrence:o,displayTax:s,forceTaxExclusive:a,perpetual:c,promotionCode:l,quantity:u,template:p,wcsOsi:f}),!0}};ne(Ne,"is","inline-price"),ne(Ne,"tag","span");var Dr=Ne,Pt=vt(Dr);function ei({providers:e,settings:t},r){let n=D.module("checkout");function i(l,u){let{checkoutClientId:p,checkoutWorkflow:f,checkoutWorkflowStep:d,country:h,language:E,promotionCode:S,quantity:N}=t,{checkoutMarketSegment:P,checkoutWorkflow:b=f,checkoutWorkflowStep:O=d,imsCountry:y,country:C=y??h,language:M=E,quantity:X=N,entitlement:B,upgrade:R,modal:j,perpetual:ae,promotionCode:le=S,wcsOsi:te,extraOptions:q,...ye}=Object.assign({},u?.dataset??{},l??{}),He=ie(b,Z,_.checkoutWorkflow),Xe=Q.CHECKOUT;He===Z.V3&&(Xe=ie(O,Q,_.checkoutWorkflowStep));let Ce=Pe({...ye,extraOptions:q,checkoutClientId:p,checkoutMarketSegment:P,country:C,quantity:Oe(X,_.quantity),checkoutWorkflow:He,checkoutWorkflowStep:Xe,language:M,entitlement:v(B),upgrade:v(R),modal:v(j),perpetual:v(ae),promotionCode:Ue(le).effectivePromoCode,wcsOsi:dt(te)});if(u)for(let At of e.checkout)At(u,Ce);return Ce}async function o(l,u){let p=F(),f=await r.getCheckoutAction?.(l,u,p.imsSignedInPromise);return f||null}function s(l,u){if(!Array.isArray(l)||!l.length||!u)return"";let{env:p,landscape:f}=t,{checkoutClientId:d,checkoutMarketSegment:h,checkoutWorkflow:E,checkoutWorkflowStep:S,country:N,promotionCode:P,quantity:b,...O}=i(u),y=window.frameElement?"if":"fp",C={checkoutPromoCode:P,clientId:d,context:y,country:N,env:p,items:[],marketSegment:h,workflowStep:S,landscape:f,...O};if(l.length===1){let[{offerId:M,offerType:X,productArrangementCode:B}]=l,{marketSegments:[R]}=l[0];Object.assign(C,{marketSegment:R,offerType:X,productArrangementCode:B}),C.items.push(b[0]===1?{id:M}:{id:M,quantity:b[0]})}else C.items.push(...l.map(({offerId:M},X)=>({id:M,quantity:b[X]??_.quantity})));return Mt(E,C)}let{createCheckoutLink:a,getCheckoutLinks:c}=St;return{CheckoutLink:St,CheckoutWorkflow:Z,CheckoutWorkflowStep:Q,buildCheckoutAction:o,buildCheckoutURL:s,collectCheckoutOptions:i,createCheckoutLink:a,getCheckoutLinks:c}}function is({interval:e=200,maxAttempts:t=25}={}){let r=D.module("ims");return new Promise(n=>{r.debug("Waing for IMS to be ready");let i=0;function o(){window.adobeIMS?.initialized?n():++i>t?(r.debug("Timeout"),n()):setTimeout(o,e)}o()})}function os(e){return e.then(()=>window.adobeIMS?.isSignedInUser()??!1)}function ss(e){let t=D.module("ims");return e.then(r=>r?window.adobeIMS.getProfile().then(({countryCode:n})=>(t.debug("Got user country:",n),n),n=>{t.error("Unable to get user country:",n)}):null)}function ti({}){let e=is(),t=os(e),r=ss(t);return{imsReadyPromise:e,imsSignedInPromise:t,imsCountryPromise:r}}function as(e){if(!e.priceLiteralsURL)throw new Error(Sr);return new Promise(t=>{window.fetch(e.priceLiteralsURL).then(r=>{r.json().then(({data:n})=>{t(n)})})})}async function ri(e){let r=await(e.priceLiteralsPromise||as(e));if(Array.isArray(r)){let n=o=>r.find(s=>ze(s.lang,o)),i=n(e.language)??n(_.language);if(i)return Object.freeze(i)}return{}}function ni({literals:e,providers:t,settings:r}){function n(a,c){let{country:l,displayOldPrice:u,displayPerUnit:p,displayRecurrence:f,displayTax:d,forceTaxExclusive:h,language:E,promotionCode:S,quantity:N}=r,{displayOldPrice:P=u,displayPerUnit:b=p,displayRecurrence:O=f,displayTax:y=d,forceTaxExclusive:C=h,country:M=l,language:X=E,perpetual:B,promotionCode:R=S,quantity:j=N,template:ae,wcsOsi:le,...te}=Object.assign({},c?.dataset??{},a??{}),q=Pe({...te,country:M,displayOldPrice:v(P),displayPerUnit:v(b),displayRecurrence:v(O),displayTax:v(y),forceTaxExclusive:v(C),language:X,perpetual:v(B),promotionCode:Ue(R).effectivePromoCode,quantity:Oe(j,_.quantity),template:ae,wcsOsi:dt(le)});if(c)for(let ye of t.price)ye(c,q);return q}function i(a,c){if(!Array.isArray(a)||!a.length||!c)return"";let{template:l}=c,u;switch(l){case"discount":u=mr;break;case"strikethrough":u=fr;break;case"optical":u=lr;break;case"annual":u=pr;break;default:u=c.promotionCode?ur:cr}let p=n(c);p.literals=Object.assign({},e.price,Pe(c.literals??{}));let[f]=a;return f={...f,...f.priceDetails},u(p,f)}let{createInlinePrice:o,getInlinePrices:s}=Pt;return{InlinePrice:Pt,buildPriceHTML:i,collectPriceOptions:n,createInlinePrice:o,getInlinePrices:s}}var Mr="_acom",ii={[H.PRODUCTION]:"https://www.adobe.com",[H.STAGE]:"https://www.stage.adobe.com",[H.PRODUCTION+Mr]:"https://www.adobe.com",[H.STAGE+Mr]:"https://www.stage.adobe.com"};function oi({settings:e}){let t=D.module("wcs"),{env:r,domainSwitch:n,wcsApiKey:i}=e,o=n?ii[r+Mr]:ii[r],s={apiKey:i,baseUrl:o,fetch:window.fetch.bind(window)},a=qe(s),c=new Map,l=new Map,u;async function p(h,E,S=!0){let N=br;try{t.debug("Fetching:",h),h.offerSelectorIds=h.offerSelectorIds.sort();let{data:P}=await a(h,{apiKey:i,environment:e.wcsEnv,landscape:r===H.STAGE?"ALL":e.landscape},({resolvedOffers:O})=>({offers:O.map(ct)}));t.debug("Fetched:",h,P);let{offers:b}=P??{};E.forEach(({resolve:O},y)=>{let C=b.filter(({offerSelectorIds:M})=>M.includes(y)).flat();C.length&&(E.delete(y),O(C))})}catch(P){P.status===404&&h.offerSelectorIds.length>1?(t.debug("Multi-osi 404, fallback to fetch-by-one strategy"),await Promise.allSettled(h.offerSelectorIds.map(b=>p({...h,offerSelectorIds:[b]},E,!1)))):(t.error("Failed:",h,P),N=Tr)}S&&E.size&&(t.debug("Missing:",{offerSelectorIds:[...E.keys()]}),E.forEach(P=>{P.reject(new Error(N))}))}function f(){clearTimeout(u);let h=[...l.values()];l.clear(),h.forEach(({options:E,promises:S})=>p(E,S))}function d({country:h,language:E,perpetual:S=!1,promotionCode:N="",wcsOsi:P=[]}){let b=`${E}_${h}`;h!=="GB"&&(E=S?"EN":"MULT");let O=[h,E,N].filter(y=>y).join("-").toLowerCase();return P.map(y=>{let C=`${y}-${O}`;if(!c.has(C)){let M=new Promise((X,B)=>{let R=l.get(O);if(!R){let j={country:h,locale:b,offerSelectorIds:[]};h!=="GB"&&(j.language=E),R={options:j,promises:new Map},l.set(O,R)}N&&(R.options.promotionCode=N),R.options.offerSelectorIds.push(y),R.promises.set(y,{resolve:X,reject:B}),R.options.offerSelectorIds.length>=e.wcsBufferLimit?f():(t.debug("Queued:",R.options),u||(u=setTimeout(f,e.wcsBufferDelay)))});c.set(C,M)}return c.get(C)})}return{WcsCommitment:yr,WcsPlanType:_r,WcsTerm:vr,resolveOfferSelectors:d}}var k=class extends HTMLElement{get isWcmsCommerce(){return!0}};ne(k,"instance"),ne(k,"promise",null);window.customElements.define(oe,k);async function cs(e,t){let r=D.init(e.env).module("service");r.debug("Activating:",e);let n={price:{}},i=Object.freeze(Cr(e));try{n.price=await ri(i)}catch(c){r.warn("Price literals were not fetched:",c)}let o={checkout:new Set,price:new Set},s=document.createElement(oe),a={literals:n,providers:o,settings:i};return k.instance=Object.defineProperties(s,Object.getOwnPropertyDescriptors({...ei(a,t),...ti(a),...ni(a),...oi(a),...Or,Log:D,get defaults(){return _},get literals(){return n},get log(){return D},get providers(){return{checkout(c){return o.checkout.add(c),()=>o.checkout.delete(c)},price(c){return o.price.add(c),()=>o.price.delete(c)}}},get settings(){return i}})),r.debug("Activated:",{literals:n,settings:i,element:s}),document.head.append(s),ue(()=>{let c=new CustomEvent(ge,{bubbles:!0,cancelable:!1,detail:k.instance});k.instance.dispatchEvent(c)}),k.instance}function si(){document.head.querySelector(oe)?.remove(),k.promise=null,D.reset()}function us(e,t){if(ce(e)){let r=ce(t)?t():{};return r.force&&si(),k.promise??(k.promise=cs(e(),r))}return k.promise?k.promise:new Promise(r=>{let n=i=>{r(i.detail)};document.head.addEventListener(ge,n,{once:!0})})}export{St as CheckoutLink,Z as CheckoutWorkflow,Q as CheckoutWorkflowStep,_ as Defaults,Pt as InlinePrice,G as Landscape,D as Log,oe as TAG_NAME_SERVICE,yr as WcsCommitment,we as WcsEnv,_r as WcsPlanType,vr as WcsTerm,ct as applyPlanType,Yn as getLocaleSettings,Cr as getSettings,us as init,si as reset}; +`,le.MISSING_INTL_API,s);var C=n.getPluralRules(t,{type:c.pluralType}).select(f-(c.offset||0));T=c.options[C]||c.options.other}if(!T)throw new ir(c.value,f,Object.keys(c.options),s);a.push.apply(a,De(T.value,t,n,r,i,f-(c.offset||0)));continue}}return qi(a)}function Zi(e,t){return t?y(y(y({},e||{}),t||{}),Object.keys(e).reduce(function(n,r){return n[r]=y(y({},e[r]),t[r]||{}),n},{})):e}function Ji(e,t){return t?Object.keys(e).reduce(function(n,r){return n[r]=Zi(e[r],t[r]),n},y({},e)):e}function or(e){return{create:function(){return{get:function(t){return e[t]},set:function(t,n){e[t]=n}}}}}function Qi(e){return e===void 0&&(e={number:{},dateTime:{},pluralRules:{}}),{getNumberFormat:Ie(function(){for(var t,n=[],r=0;r0?e.substring(0,r):"";let i=yn(e.split("").reverse().join("")),o=n-i,s=e.substring(o,o+1),a=o+(s==="."||s===","?1:0);t.suffix=i>0?e.substring(a,n):"",t.mask=e.substring(r,a),t.maskHasNegativeSign=t.mask.charAt(0)==="-",t.maskHasPositiveSign=t.mask.charAt(0)==="+";let l=t.mask.match(eo);return t.decimal=l&&l[l.length-1]||".",t.separator=l&&l[1]&&l[0]||",",l=t.mask.split(t.decimal),t.integer=l[0],t.fraction=l[1],t}function ro(e,t,n){let r=!1,i={value:e};e<0&&(r=!0,i.value=-i.value),i.sign=r?"-":"",i.value=Number(i.value).toFixed(t.fraction&&t.fraction.length),i.value=Number(i.value).toString();let o=t.fraction&&t.fraction.lastIndexOf("0"),[s="0",a=""]=i.value.split(".");return(!a||a&&a.length<=o)&&(a=o<0?"":(+("0."+a)).toFixed(o+1).replace("0.","")),i.integer=s,i.fraction=a,no(i,t),(i.result==="0"||i.result==="")&&(r=!1,i.sign=""),!r&&t.maskHasPositiveSign?i.sign="+":r&&t.maskHasPositiveSign?i.sign="-":r&&(i.sign=n&&n.enforceMaskSign&&!t.maskHasNegativeSign?"":"-"),i}function no(e,t){e.result="";let n=t.integer.split(t.separator),r=n.join(""),i=r&&r.indexOf("0");if(i>-1)for(;e.integer.lengthMath.round(e*20)/20},sr=(e,t)=>({accept:e,round:t}),co=[sr(({divisor:e,price:t})=>t%e==0,({divisor:e,price:t})=>t/e),sr(({usePrecision:e})=>e,({divisor:e,price:t})=>Math.ceil(Math.floor(t*1e4/e)/100)/100),sr(()=>!0,({divisor:e,price:t})=>Math.ceil(Math.floor(t*100/e)/100))],ar={[R.YEAR]:{[O.MONTHLY]:Ue.MONTH,[O.ANNUAL]:Ue.YEAR},[R.MONTH]:{[O.MONTHLY]:Ue.MONTH}},lo=(e,t)=>e.indexOf(`'${t}'`)===0,uo=(e,t=!0)=>{let n=e.replace(/'.*?'/,"").trim(),r=An(n);return!!r?t||(n=n.replace(/[,\.]0+/,r)):n=n.replace(/\s?(#.*0)(?!\s)?/,"$&"+po(e)),n},fo=e=>{let t=mo(e),n=lo(e,t),r=e.replace(/'.*?'/,""),i=Tn.test(r)||Pn.test(r);return{currencySymbol:t,isCurrencyFirst:n,hasCurrencySpace:i}},bn=e=>e.replace(Tn,vn).replace(Pn,vn),po=e=>e.match(/#(.?)#/)?.[1]===Sn?oo:Sn,mo=e=>e.match(/'(.*?)'/)?.[1]??"",An=e=>e.match(/0(.?)0/)?.[1]??"";function nt({formatString:e,price:t,usePrecision:n,isIndianPrice:r=!1},i,o=s=>s){let{currencySymbol:s,isCurrencyFirst:a,hasCurrencySpace:l}=fo(e),u=n?An(e):"",c=uo(e,n),p=n?2:0,f=o(t,{currencySymbol:s}),h=r?f.toLocaleString("hi-IN",{minimumFractionDigits:p,maximumFractionDigits:p}):_n(c,f),d=n?h.lastIndexOf(u):h.length,_=h.substring(0,d),S=h.substring(d+1);return{accessiblePrice:e.replace(/'.*?'/,"SYMBOL").replace(/#.*0/,h).replace(/SYMBOL/,s),currencySymbol:s,decimals:S,decimalsDelimiter:u,hasCurrencySpace:l,integer:_,isCurrencyFirst:a,recurrenceTerm:i}}var wn=e=>{let{commitment:t,term:n,usePrecision:r}=e,i=so[n]??1;return nt(e,i>1?Ue.MONTH:ar[t]?.[n],(o,{currencySymbol:s})=>{let a={divisor:i,price:o,usePrecision:r},{round:l}=co.find(({accept:c})=>c(a));if(!l)throw new Error(`Missing rounding rule for: ${JSON.stringify(a)}`);return(ao[s]??(c=>c))(l(a))})},Ln=({commitment:e,term:t,...n})=>nt(n,ar[e]?.[t]),On=e=>{let{commitment:t,term:n}=e;return t===R.YEAR&&n===O.MONTHLY?nt(e,Ue.YEAR,r=>r*12):nt(e,ar[t]?.[n])};var ho={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 {alternativePrice}",strikethroughAriaLabel:"Regularly at {strikethroughPrice}"},Eo=Hr("ConsonantTemplates/price"),go=/<.+?>/g,F={container:"price",containerOptical:"price-optical",containerStrikethrough:"price-strikethrough",containerAnnual:"price-annual",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"},ue={perUnitLabel:"perUnitLabel",perUnitAriaLabel:"perUnitAriaLabel",recurrenceLabel:"recurrenceLabel",recurrenceAriaLabel:"recurrenceAriaLabel",taxExclusiveLabel:"taxExclusiveLabel",taxInclusiveLabel:"taxInclusiveLabel",strikethroughAriaLabel:"strikethroughAriaLabel"},xo="TAX_EXCLUSIVE",yo=e=>jr(e)?Object.entries(e).filter(([,t])=>ye(t)||Ye(t)||t===!0).reduce((t,[n,r])=>t+` ${n}${r===!0?"":'="'+Fr(r)+'"'}`,""):"",X=(e,t,n,r=!1)=>`${r?bn(t):t??""}`;function _o(e,{accessibleLabel:t,currencySymbol:n,decimals:r,decimalsDelimiter:i,hasCurrencySpace:o,integer:s,isCurrencyFirst:a,recurrenceLabel:l,perUnitLabel:u,taxInclusivityLabel:c},p={}){let f=X(F.currencySymbol,n),h=X(F.currencySpace,o?" ":""),d="";return a&&(d+=f+h),d+=X(F.integer,s),d+=X(F.decimalsDelimiter,i),d+=X(F.decimals,r),a||(d+=h+f),d+=X(F.recurrence,l,null,!0),d+=X(F.unitType,u,null,!0),d+=X(F.taxInclusivity,c,!0),X(e,d,{...p,"aria-label":t})}var fe=({displayOptical:e=!1,displayStrikethrough:t=!1,displayAnnual:n=!1}={})=>({country:r,displayFormatted:i=!0,displayRecurrence:o=!0,displayPerUnit:s=!1,displayTax:a=!1,language:l,literals:u={}}={},{commitment:c,formatString:p,price:f,priceWithoutDiscount:h,taxDisplay:d,taxTerm:_,term:S,usePrecision:A}={},w={})=>{Object.entries({country:r,formatString:p,language:l,price:f}).forEach(([Q,Pt])=>{if(Pt==null)throw new Error(`Argument "${Q}" is missing`)});let T={...ho,...u},C=`${l.toLowerCase()}-${r.toUpperCase()}`;function P(Q,Pt){let bt=T[Q];if(bt==null)return"";try{return new xn(bt.replace(go,""),C).format(Pt)}catch{return Eo.error("Failed to format literal:",bt),""}}let L=t&&h?h:f,U=e?wn:Ln;n&&(U=On);let{accessiblePrice:j,recurrenceTerm:Z,...te}=U({commitment:c,formatString:p,term:S,price:e?f:L,usePrecision:A,isIndianPrice:r==="IN"}),H=j,oe="";if(v(o)&&Z){let Q=P(ue.recurrenceAriaLabel,{recurrenceTerm:Z});Q&&(H+=" "+Q),oe=P(ue.recurrenceLabel,{recurrenceTerm:Z})}let se="";if(v(s)){se=P(ue.perUnitLabel,{perUnit:"LICENSE"});let Q=P(ue.perUnitAriaLabel,{perUnit:"LICENSE"});Q&&(H+=" "+Q)}let J="";v(a)&&_&&(J=P(d===xo?ue.taxExclusiveLabel:ue.taxInclusiveLabel,{taxTerm:_}),J&&(H+=" "+J)),t&&(H=P(ue.strikethroughAriaLabel,{strikethroughPrice:H}));let W=F.container;if(e&&(W+=" "+F.containerOptical),t&&(W+=" "+F.containerStrikethrough),n&&(W+=" "+F.containerAnnual),v(i))return _o(W,{...te,accessibleLabel:H,recurrenceLabel:oe,perUnitLabel:se,taxInclusivityLabel:J},w);let{currencySymbol:Ee,decimals:Ve,decimalsDelimiter:je,hasCurrencySpace:we,integer:Tt,isCurrencyFirst:zn}=te,ge=[Tt,je,Ve];zn?(ge.unshift(we?"\xA0":""),ge.unshift(Ee)):(ge.push(we?"\xA0":""),ge.push(Ee)),ge.push(oe,se,J);let Zn=ge.join("");return X(W,Zn,w)},Nn=()=>(e,t,n)=>{let i=(e.displayOldPrice===void 0||v(e.displayOldPrice))&&t.priceWithoutDiscount&&t.priceWithoutDiscount!=t.price;return`${fe()(e,t,n)}${i?" "+fe({displayStrikethrough:!0})(e,t,n):""}`};var cr=fe(),lr=Nn(),ur=fe({displayOptical:!0}),fr=fe({displayStrikethrough:!0}),pr=fe({displayAnnual:!0});var So=(e,t)=>{if(!(!Se(e)||!Se(t)))return Math.floor((t-e)/t*100)},Cn=()=>(e,t,n)=>{let{price:r,priceWithoutDiscount:i}=t,o=So(r,i);return o===void 0?'':`${o}%`};var mr=Cn();var{freeze:ke}=Object,Y=ke({...ae}),B=ke({...V}),pe={STAGE:"STAGE",PRODUCTION:"PRODUCTION",LOCAL:"LOCAL"},hr=ke({...R}),dr=ke({...Xr}),Er=ke({...O});var Pr={};Qn(Pr,{CLASS_NAME_FAILED:()=>it,CLASS_NAME_PENDING:()=>ot,CLASS_NAME_RESOLVED:()=>st,ERROR_MESSAGE_BAD_REQUEST:()=>at,ERROR_MESSAGE_MISSING_LITERALS_URL:()=>xr,ERROR_MESSAGE_OFFER_NOT_FOUND:()=>gr,EVENT_TYPE_ERROR:()=>vo,EVENT_TYPE_FAILED:()=>ct,EVENT_TYPE_PENDING:()=>lt,EVENT_TYPE_READY:()=>me,EVENT_TYPE_RESOLVED:()=>ut,LOG_NAMESPACE:()=>yr,Landscape:()=>he,PARAM_AOS_API_KEY:()=>To,PARAM_ENV:()=>_r,PARAM_LANDSCAPE:()=>Sr,PARAM_WCS_API_KEY:()=>Po,STATE_FAILED:()=>$,STATE_PENDING:()=>q,STATE_RESOLVED:()=>z,TAG_NAME_SERVICE:()=>ee,WCS_PROD_URL:()=>vr,WCS_STAGE_URL:()=>Tr});var it="placeholder-failed",ot="placeholder-pending",st="placeholder-resolved",at="Bad WCS request",gr="Commerce offer not found",xr="Literals URL not provided",vo="wcms:commerce:error",ct="wcms:placeholder:failed",lt="wcms:placeholder:pending",me="wcms:commerce:ready",ut="wcms:placeholder:resolved",yr="wcms/commerce",_r="commerce.env",Sr="commerce.landscape",To="commerce.aosKey",Po="commerce.wcsKey",vr="https://www.adobe.com/web_commerce_artifact",Tr="https://www.stage.adobe.com/web_commerce_artifact_stage",$="failed",q="pending",z="resolved",ee="wcms-commerce",he={DRAFT:"DRAFT",PUBLISHED:"PUBLISHED"};var br={clientId:"merch-at-scale",delimiter:"\xB6",ignoredProperties:["analytics","literals"],serializableTypes:["Array","Object"],sampleRate:30,tags:"consumer=milo/commerce"},Rn=new Set,bo=e=>e instanceof Error||typeof e.originatingRequest=="string";function In(e){if(e==null)return;let t=typeof e;if(t==="function"){let{name:n}=e;return n?`${t} ${n}`:t}if(t==="object"){if(e instanceof Error)return e.message;if(typeof e.originatingRequest=="string"){let{message:r,originatingRequest:i,status:o}=e;return[r,o,i].filter(s=>s).join(" ")}let n=e[Symbol.toStringTag]??Object.getPrototypeOf(e).constructor.name;if(!br.serializableTypes.includes(n))return n}return e}function Ao(e,t){if(!br.ignoredProperties.includes(e))return In(t)}var Ar={append(e){let{delimiter:t,sampleRate:n,tags:r,clientId:i}=br,{message:o,params:s}=e,a=[],l=o,u=[];s.forEach(f=>{f!=null&&(bo(f)?a:u).push(f)}),a.length&&(l+=" ",l+=a.map(In).join(" "));let{pathname:c,search:p}=window.location;l+=`${t}page=`,l+=c+p,u.length&&(l+=`${t}facts=`,l+=JSON.stringify(u,Ao)),Rn.has(l)||(Rn.add(l),window.lana?.log(l,{sampleRate:n,tags:r,clientId:i}))}};var x=Object.freeze({checkoutClientId:"adobe_com",checkoutWorkflow:Y.V3,checkoutWorkflowStep:B.EMAIL,country:"US",displayOldPrice:!0,displayPerUnit:!1,displayRecurrence:!0,displayTax:!1,env:pe.PRODUCTION,forceTaxExclusive:!1,language:"en",entitlement:!1,extraOptions:{},modal:!1,promotionCode:"",quantity:1,wcsApiKey:"wcms-commerce-ims-ro-user-milo",wcsBufferDelay:1,wcsURL:"https://www.adobe.com/web_commerce_artifact",landscape:he.PUBLISHED,wcsBufferLimit:1});function Mn(e,{once:t=!1}={}){let n=null;function r(){let i=document.querySelector(ee);i!==n&&(n=i,i&&e(i))}return document.addEventListener(me,r,{once:t}),ie(r),()=>document.removeEventListener(me,r)}function Ge(e,{country:t,forceTaxExclusive:n,perpetual:r}){let i;if(e.length<2)i=e;else{let o=t==="GB"||r?"EN":"MULT",[s,a]=e;i=[s.language===o?s:a]}return n&&(i=i.map(Yt)),i}var ie=e=>window.setTimeout(e);function Pe(e,t=1){if(e==null)return[t];let n=(Array.isArray(e)?e:String(e).split(",")).map(Te).filter(Se);return n.length||(n=[t]),n}function ft(e){return e==null?[]:(Array.isArray(e)?e:String(e).split(",")).filter(Gt)}function k(){return window.customElements.get(ee)?.instance}var wo="en_US",m={ar:"AR_es",be_en:"BE_en",be_fr:"BE_fr",be_nl:"BE_nl",br:"BR_pt",ca:"CA_en",ch_de:"CH_de",ch_fr:"CH_fr",ch_it:"CH_it",cl:"CL_es",co:"CO_es",la:"DO_es",mx:"MX_es",pe:"PE_es",africa:"MU_en",dk:"DK_da",de:"DE_de",ee:"EE_et",eg_ar:"EG_ar",eg_en:"EG_en",es:"ES_es",fr:"FR_fr",gr_el:"GR_el",gr_en:"GR_en",ie:"IE_en",il_he:"IL_iw",it:"IT_it",lv:"LV_lv",lt:"LT_lt",lu_de:"LU_de",lu_en:"LU_en",lu_fr:"LU_fr",my_en:"MY_en",my_ms:"MY_ms",hu:"HU_hu",mt:"MT_en",mena_en:"DZ_en",mena_ar:"DZ_ar",nl:"NL_nl",no:"NO_nb",pl:"PL_pl",pt:"PT_pt",ro:"RO_ro",si:"SI_sl",sk:"SK_sk",fi:"FI_fi",se:"SE_sv",tr:"TR_tr",uk:"GB_en",at:"AT_de",cz:"CZ_cs",bg:"BG_bg",ru:"RU_ru",ua:"UA_uk",au:"AU_en",in_en:"IN_en",in_hi:"IN_hi",id_en:"ID_en",id_id:"ID_in",nz:"NZ_en",sa_ar:"SA_ar",sa_en:"SA_en",sg:"SG_en",cn:"CN_zh-Hans",tw:"TW_zh-Hant",hk_zh:"HK_zh-hant",jp:"JP_ja",kr:"KR_ko",za:"ZA_en",ng:"NG_en",cr:"CR_es",ec:"EC_es",pr:"US_es",gt:"GT_es",cis_en:"AZ_en",cis_ru:"AZ_ru",sea:"SG_en",th_en:"TH_en",th_th:"TH_th"},pt=Object.freeze({LOCAL:"local",PROD:"prod",STAGE:"stage"});function Dn({locale:e={}}={}){if(!e.prefix)return{country:x.country,language:x.language,locale:wo};let t=e.prefix.replace("/","")??"",[n=x.country,r=x.language]=(m[t]??t).split("_",2);return n=n.toUpperCase(),r=r.toLowerCase(),{country:n,language:r,locale:`${r}_${n}`}}function wr(e={}){let{commerce:t={},locale:n=void 0}=e,r=pe.PRODUCTION,i=vr,o=["local","stage"].includes(e.env?.name),s=N(_r,t,{metadata:!1})?.toLowerCase()==="stage";o&&s&&(r=pe.STAGE,i=Tr);let a=N("checkoutClientId",t)??x.checkoutClientId,l=ne(N("checkoutWorkflow",t),Y,x.checkoutWorkflow),u=B.CHECKOUT;l===Y.V3&&(u=ne(N("checkoutWorkflowStep",t),B,x.checkoutWorkflowStep));let c=v(N("displayOldPrice",t),x.displayOldPrice),p=v(N("displayPerUnit",t),x.displayPerUnit),f=v(N("displayRecurrence",t),x.displayRecurrence),h=v(N("displayTax",t),x.displayTax),d=v(N("entitlement",t),x.entitlement),_=v(N("modal",t),x.modal),S=v(N("forceTaxExclusive",t),x.forceTaxExclusive),A=N("promotionCode",t)??x.promotionCode,w=Pe(N("quantity",t)),T=N("wcsApiKey",t)??x.wcsApiKey,C=e.env?.name===pt.PROD?he.PUBLISHED:ne(N(Sr,t),he,x.landscape),P=Te(N("wcsBufferDelay",t),x.wcsBufferDelay),L=Te(N("wcsBufferLimit",t),x.wcsBufferLimit);return{...Dn({locale:n}),displayOldPrice:c,checkoutClientId:a,checkoutWorkflow:l,checkoutWorkflowStep:u,displayPerUnit:p,displayRecurrence:f,displayTax:h,entitlement:d,extraOptions:x.extraOptions,modal:_,env:r,forceTaxExclusive:S,priceLiteralsURL:t.priceLiteralsURL,priceLiteralsPromise:t.priceLiteralsPromise,promotionCode:A,quantity:w,wcsApiKey:T,wcsBufferDelay:P,wcsBufferLimit:L,wcsURL:i,landscape:C}}var kn="debug",Lo="error",Oo="info",No="warn",Co=Date.now(),Lr=new Set,Or=new Set,Un=new Map,Fe=Object.freeze({DEBUG:kn,ERROR:Lo,INFO:Oo,WARN:No}),Gn={append({level:e,message:t,params:n,timestamp:r,source:i}){console[e](`${r}ms [${i}] %c${t}`,"font-weight: bold;",...n)}},Fn={filter:({level:e})=>e!==kn},Ro={filter:()=>!1};function Io(e,t,n,r,i){return{level:e,message:t,namespace:n,get params(){if(r.length===1){let[o]=r;re(o)&&(r=o(),Array.isArray(r)||(r=[r]))}return r},source:i,timestamp:Date.now()-Co}}function Mo(e){[...Or].every(t=>t(e))&&Lr.forEach(t=>t(e))}function Vn(e){let t=(Un.get(e)??0)+1;Un.set(e,t);let n=`${e} #${t}`,r=o=>(s,...a)=>Mo(Io(o,s,e,a,n)),i=Object.seal({id:n,namespace:e,module(o){return Vn(`${i.namespace}/${o}`)},debug:r(Fe.DEBUG),error:r(Fe.ERROR),info:r(Fe.INFO),warn:r(Fe.WARN)});return i}function mt(...e){e.forEach(t=>{let{append:n,filter:r}=t;re(r)?Or.add(r):re(n)&&Lr.add(n)})}function Do(e={}){let{name:t}=e,n=v(N("commerce.debug",{search:!0,storage:!0}),t===pt.LOCAL);return mt(n?Gn:Fn),t===pt.PROD&&mt(Ar),M}function Uo(){Lr.clear(),Or.clear()}var M={...Vn(yr),Level:Fe,Plugins:{consoleAppender:Gn,debugFilter:Fn,quietFilter:Ro,lanaAppender:Ar},init:Do,reset:Uo,use:mt};var ko={CLASS_NAME_FAILED:it,CLASS_NAME_PENDING:ot,CLASS_NAME_RESOLVED:st,EVENT_TYPE_FAILED:ct,EVENT_TYPE_PENDING:lt,EVENT_TYPE_RESOLVED:ut,STATE_FAILED:$,STATE_PENDING:q,STATE_RESOLVED:z},Go={[$]:it,[q]:ot,[z]:st},Fo={[$]:ct,[q]:lt,[z]:ut},Et=new WeakMap;function G(e){if(!Et.has(e)){let t=M.module(e.constructor.is);Et.set(e,{changes:new Map,connected:!1,dispose:_e,error:void 0,log:t,options:void 0,promises:[],state:q,timer:null,value:void 0,version:0})}return Et.get(e)}function ht(e){let t=G(e),{error:n,promises:r,state:i}=t;(i===z||i===$)&&(t.promises=[],i===z?r.forEach(({resolve:o})=>o(e)):i===$&&r.forEach(({reject:o})=>o(n))),e.dispatchEvent(new CustomEvent(Fo[i],{bubbles:!0}))}function dt(e){let t=Et.get(e);[$,q,z].forEach(n=>{e.classList.toggle(Go[n],n===t.state)})}var Vo={get error(){return G(this).error},get log(){return G(this).log},get options(){return G(this).options},get state(){return G(this).state},get value(){return G(this).value},attributeChangedCallback(e,t,n){G(this).changes.set(e,n),this.requestUpdate()},connectedCallback(){G(this).dispose=Mn(()=>this.requestUpdate(!0))},disconnectedCallback(){let e=G(this);e.connected&&(e.connected=!1,e.log.debug("Disconnected:",{element:this})),e.dispose(),e.dispose=_e},onceSettled(){let{error:e,promises:t,state:n}=G(this);return z===n?Promise.resolve(this):$===n?Promise.reject(e):new Promise((r,i)=>{t.push({resolve:r,reject:i})})},toggleResolved(e,t,n){let r=G(this);return e!==r.version?!1:(n!==void 0&&(r.options=n),r.state=z,r.value=t,dt(this),this.log.debug("Resolved:",{element:this,value:t}),ie(()=>ht(this)),!0)},toggleFailed(e,t,n){let r=G(this);return e!==r.version?!1:(n!==void 0&&(r.options=n),r.error=t,r.state=$,dt(this),r.log.error("Failed:",{element:this,error:t}),ie(()=>ht(this)),!0)},togglePending(e){let t=G(this);return t.version++,e&&(t.options=e),t.state=q,dt(this),ie(()=>ht(this)),t.version},requestUpdate(e=!1){if(!this.isConnected||!k())return;let t=G(this);if(t.timer)return;let{error:n,options:r,state:i,value:o,version:s}=t;t.state=q,t.timer=ie(async()=>{t.timer=null;let a=null;if(t.changes.size&&(a=Object.fromEntries(t.changes.entries()),t.changes.clear()),t.connected?t.log.debug("Updated:",{element:this,changes:a}):(t.connected=!0,t.log.debug("Connected:",{element:this,changes:a})),a||e)try{await this.render?.()===!1&&t.state===q&&t.version===s&&(t.state=i,t.error=n,t.value=o,dt(this),ht(this))}catch(l){this.toggleFailed(t.version,l,r)}})}};function jn(e={}){return Object.entries(e).forEach(([t,n])=>{(n==null||n===""||n?.length===0)&&delete e[t]}),e}function gt(e,t={}){let{tag:n,is:r}=e,i=document.createElement(n,{is:r});return i.setAttribute("is",r),Object.assign(i.dataset,jn(t)),i}function xt(e){let{tag:t,is:n,prototype:r}=e,i=window.customElements.get(n);return i||(Object.defineProperties(r,Object.getOwnPropertyDescriptors(Vo)),i=Object.defineProperties(e,Object.getOwnPropertyDescriptors(ko)),window.customElements.define(n,i,{extends:t})),i}function yt(e,t=document.body){return Array.from(t?.querySelectorAll(`${e.tag}[is="${e.is}"]`)??[])}function _t(e,t={}){return e instanceof HTMLElement?(Object.assign(e.dataset,jn(t)),e):null}var jo="download",Ho="upgrade",de,be=class be extends HTMLAnchorElement{constructor(){super();Mr(this,de,void 0);this.addEventListener("click",this.clickHandler)}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"]}static createCheckoutLink(n={},r=""){let i=k();if(!i)return null;let{checkoutMarketSegment:o,checkoutWorkflow:s,checkoutWorkflowStep:a,entitlement:l,upgrade:u,modal:c,perpetual:p,promotionCode:f,quantity:h,wcsOsi:d,extraOptions:_}=i.collectCheckoutOptions(n),S=gt(be,{checkoutMarketSegment:o,checkoutWorkflow:s,checkoutWorkflowStep:a,entitlement:l,upgrade:u,modal:c,perpetual:p,promotionCode:f,quantity:h,wcsOsi:d,extraOptions:_});return r&&(S.innerHTML=`${r}`),S}static getCheckoutLinks(n){return yt(be,n)}get isCheckoutLink(){return!0}get placeholder(){return this}clickHandler(n){var r;(r=At(this,de))==null||r.call(this,n)}async render(n={}){if(!this.isConnected)return!1;let r=k();if(!r)return!1;this.dataset.imsCountry||r.imsCountryPromise.then(c=>{c&&(this.dataset.imsCountry=c)},_e);let i=r.collectCheckoutOptions(n,this.placeholder);if(!i.wcsOsi.length)return!1;let o;try{o=JSON.parse(i.extraOptions??"{}")}catch(c){this.placeholder.log.error("cannot parse exta checkout options",c)}let s=this.placeholder.togglePending(i);this.href="";let a=r.resolveOfferSelectors(i),l=await Promise.all(a);l=l.map(c=>Ge(c,i));let u=await r.buildCheckoutAction(l.flat(),{...o,...i});return this.renderOffers(l.flat(),i,{},u,s)}renderOffers(n,r,i={},o=void 0,s=void 0){if(!this.isConnected)return!1;let a=k();if(!a)return!1;if(r={...JSON.parse(this.placeholder.dataset.extraOptions??"null"),...r,...i},s??(s=this.placeholder.togglePending(r)),At(this,de)&&wt(this,de,void 0),o){this.classList.remove(jo,Ho),this.placeholder.toggleResolved(s,n,r);let{url:u,text:c,className:p,handler:f}=o;return u&&(this.href=u),c&&(this.firstElementChild.innerHTML=c),p&&this.classList.add(...p.split(" ")),f&&(this.setAttribute("href","#"),wt(this,de,f.bind(this))),!0}else if(n.length){if(this.placeholder.toggleResolved(s,n,r)){let u=a.buildCheckoutURL(n,r);return this.setAttribute("href",u),!0}}else{let u=new Error(`Not provided: ${r?.wcsOsi??"-"}`);if(this.placeholder.toggleFailed(s,u,r))return this.setAttribute("href","#"),!0}return!1}updateOptions(n={}){let r=k();if(!r)return!1;let{checkoutMarketSegment:i,checkoutWorkflow:o,checkoutWorkflowStep:s,entitlement:a,upgrade:l,modal:u,perpetual:c,promotionCode:p,quantity:f,wcsOsi:h}=r.collectCheckoutOptions(n);return _t(this,{checkoutMarketSegment:i,checkoutWorkflow:o,checkoutWorkflowStep:s,entitlement:a,upgrade:l,modal:u,perpetual:c,promotionCode:p,quantity:f,wcsOsi:h}),!0}};de=new WeakMap,K(be,"is","checkout-link"),K(be,"tag","a");var Nr=be,St=xt(Nr);var Hn=[m.uk,m.au,m.fr,m.at,m.be_en,m.be_fr,m.be_nl,m.bg,m.ch_de,m.ch_fr,m.ch_it,m.cz,m.de,m.dk,m.ee,m.eg_ar,m.eg_en,m.es,m.fi,m.fr,m.gr_el,m.gr_en,m.hu,m.ie,m.it,m.lu_de,m.lu_en,m.lu_fr,m.nl,m.no,m.pl,m.pt,m.ro,m.se,m.si,m.sk,m.tr,m.ua,m.id_en,m.id_id,m.in_en,m.in_hi,m.jp,m.my_en,m.my_ms,m.nz,m.th_en,m.th_th],Wo={INDIVIDUAL_COM:[m.za,m.lt,m.lv,m.ng,m.sa_ar,m.sa_en,m.za,m.sg,m.kr],TEAM_COM:[m.za,m.lt,m.lv,m.ng,m.za,m.co,m.kr],INDIVIDUAL_EDU:[m.lt,m.lv,m.sa_en,m.sea],TEAM_EDU:[m.sea,m.kr]},Ae=class Ae extends HTMLSpanElement{static get observedAttributes(){return["data-display-old-price","data-display-per-unit","data-display-recurrence","data-display-tax","data-perpetual","data-promotion-code","data-tax-exclusive","data-template","data-wcs-osi"]}static createInlinePrice(t){let n=k();if(!n)return null;let{displayOldPrice:r,displayPerUnit:i,displayRecurrence:o,displayTax:s,forceTaxExclusive:a,perpetual:l,promotionCode:u,quantity:c,template:p,wcsOsi:f}=n.collectPriceOptions(t);return gt(Ae,{displayOldPrice:r,displayPerUnit:i,displayRecurrence:o,displayTax:s,forceTaxExclusive:a,perpetual:l,promotionCode:u,quantity:c,template:p,wcsOsi:f})}static getInlinePrices(t){return yt(Ae,t)}get isInlinePrice(){return!0}get placeholder(){return this}resolveDisplayTaxForGeoAndSegment(t,n,r,i){let o=`${t}_${n}`;if(Hn.includes(t)||Hn.includes(o))return!0;let s=Wo[`${r}_${i}`];return s?!!(s.includes(t)||s.includes(o)):!1}async resolveDisplayTax(t,n){let[r]=await t.resolveOfferSelectors(n),i=Ge(await r,n);if(i?.length){let{country:o,language:s}=n,a=i[0],[l=""]=a.marketSegments;return this.resolveDisplayTaxForGeoAndSegment(o,s,a.customerSegment,l)}}async render(t={}){if(!this.isConnected)return!1;let n=k();if(!n)return!1;let r=n.collectPriceOptions(t,this.placeholder);if(!r.wcsOsi.length)return!1;let i=this.placeholder.togglePending(r);this.innerHTML="";let[o]=n.resolveOfferSelectors(r);return this.renderOffers(Ge(await o,r),r,i)}renderOffers(t,n={},r=void 0){if(!this.isConnected)return;let i=k();if(!i)return!1;let o=i.collectPriceOptions({...this.dataset,...n});if(r??(r=this.placeholder.togglePending(o)),t.length){if(this.placeholder.toggleResolved(r,t,o))return this.innerHTML=i.buildPriceHTML(t,o),!0}else{let s=new Error(`Not provided: ${o?.wcsOsi??"-"}`);if(this.placeholder.toggleFailed(r,s,o))return this.innerHTML="",!0}return!1}updateOptions(t){let n=k();if(!n)return!1;let{displayOldPrice:r,displayPerUnit:i,displayRecurrence:o,displayTax:s,forceTaxExclusive:a,perpetual:l,promotionCode:u,quantity:c,template:p,wcsOsi:f}=n.collectPriceOptions(t);return _t(this,{displayOldPrice:r,displayPerUnit:i,displayRecurrence:o,displayTax:s,forceTaxExclusive:a,perpetual:l,promotionCode:u,quantity:c,template:p,wcsOsi:f}),!0}};K(Ae,"is","inline-price"),K(Ae,"tag","span");var Cr=Ae,vt=xt(Cr);function Wn({providers:e,settings:t},n){let r=M.module("checkout");function i(u,c){let{checkoutClientId:p,checkoutWorkflow:f,checkoutWorkflowStep:h,country:d,language:_,promotionCode:S,quantity:A}=t,{checkoutMarketSegment:w,checkoutWorkflow:T=f,checkoutWorkflowStep:C=h,imsCountry:P,country:L=P??d,language:U=_,quantity:j=A,entitlement:Z,upgrade:te,modal:H,perpetual:oe,promotionCode:se=S,wcsOsi:J,extraOptions:W,...Ee}=Object.assign({},c?.dataset??{},u??{}),Ve=ne(T,Y,x.checkoutWorkflow),je=B.CHECKOUT;Ve===Y.V3&&(je=ne(C,B,x.checkoutWorkflowStep));let we=ve({...Ee,extraOptions:W,checkoutClientId:p,checkoutMarketSegment:w,country:L,quantity:Pe(j,x.quantity),checkoutWorkflow:Ve,checkoutWorkflowStep:je,language:U,entitlement:v(Z),upgrade:v(te),modal:v(H),perpetual:v(oe),promotionCode:Ne(se).effectivePromoCode,wcsOsi:ft(J)});if(c)for(let Tt of e.checkout)Tt(c,we);return we}async function o(u,c){let p=k(),f=await n.getCheckoutAction?.(u,c,p.imsSignedInPromise);return f||null}function s(u,c){if(!Array.isArray(u)||!u.length||!c)return"";let{env:p,landscape:f}=t,{checkoutClientId:h,checkoutMarketSegment:d,checkoutWorkflow:_,checkoutWorkflowStep:S,country:A,promotionCode:w,quantity:T,...C}=i(c),P=window.frameElement?"if":"fp",L={checkoutPromoCode:w,clientId:h,context:P,country:A,env:p,items:[],marketSegment:d,workflowStep:S,landscape:f,...C};if(u.length===1){let[{offerId:U,offerType:j,productArrangementCode:Z}]=u,{marketSegments:[te]}=u[0];Object.assign(L,{marketSegment:te,offerType:j,productArrangementCode:Z}),L.items.push(T[0]===1?{id:U}:{id:U,quantity:T[0]})}else L.items.push(...u.map(({offerId:U},j)=>({id:U,quantity:T[j]??x.quantity})));return Rt(_,L)}let{createCheckoutLink:a,getCheckoutLinks:l}=St;return{CheckoutLink:St,CheckoutWorkflow:Y,CheckoutWorkflowStep:B,buildCheckoutAction:o,buildCheckoutURL:s,collectCheckoutOptions:i,createCheckoutLink:a,getCheckoutLinks:l}}function Xo({interval:e=200,maxAttempts:t=25}={}){let n=M.module("ims");return new Promise(r=>{n.debug("Waing for IMS to be ready");let i=0;function o(){window.adobeIMS?.initialized?r():++i>t?(n.debug("Timeout"),r()):setTimeout(o,e)}o()})}function Yo(e){return e.then(()=>window.adobeIMS?.isSignedInUser()??!1)}function Bo(e){let t=M.module("ims");return e.then(n=>n?window.adobeIMS.getProfile().then(({countryCode:r})=>(t.debug("Got user country:",r),r),r=>{t.error("Unable to get user country:",r)}):null)}function Xn({}){let e=Xo(),t=Yo(e),n=Bo(t);return{imsReadyPromise:e,imsSignedInPromise:t,imsCountryPromise:n}}function $o(e){if(!e.priceLiteralsURL)throw new Error(xr);return new Promise(t=>{window.fetch(e.priceLiteralsURL).then(n=>{n.json().then(({data:r})=>{t(r)})})})}async function Yn(e){let n=await(e.priceLiteralsPromise||$o(e));if(Array.isArray(n)){let r=o=>n.find(s=>Xe(s.lang,o)),i=r(e.language)??r(x.language);if(i)return Object.freeze(i)}return{}}function Bn({literals:e,providers:t,settings:n}){function r(a,l){let{country:u,displayOldPrice:c,displayPerUnit:p,displayRecurrence:f,displayTax:h,forceTaxExclusive:d,language:_,promotionCode:S,quantity:A}=n,{displayOldPrice:w=c,displayPerUnit:T=p,displayRecurrence:C=f,displayTax:P=h,forceTaxExclusive:L=d,country:U=u,language:j=_,perpetual:Z,promotionCode:te=S,quantity:H=A,template:oe,wcsOsi:se,...J}=Object.assign({},l?.dataset??{},a??{}),W=ve({...J,country:U,displayOldPrice:v(w),displayPerUnit:v(T),displayRecurrence:v(C),displayTax:v(P),forceTaxExclusive:v(L),language:j,perpetual:v(Z),promotionCode:Ne(te).effectivePromoCode,quantity:Pe(H,x.quantity),template:oe,wcsOsi:ft(se)});if(l)for(let Ee of t.price)Ee(l,W);return W}function i(a,l){if(!Array.isArray(a)||!a.length||!l)return"";let{template:u}=l,c;switch(u){case"discount":c=mr;break;case"strikethrough":c=fr;break;case"optical":c=ur;break;case"annual":c=pr;break;default:c=l.promotionCode?lr:cr}let p=r(l);p.literals=Object.assign({},e.price,ve(l.literals??{}));let[f]=a;return f={...f,...f.priceDetails},c(p,f)}let{createInlinePrice:o,getInlinePrices:s}=vt;return{InlinePrice:vt,buildPriceHTML:i,collectPriceOptions:r,createInlinePrice:o,getInlinePrices:s}}function $n({settings:e}){let t=M.module("wcs"),{env:n,wcsApiKey:r}=e,i=new Map,o=new Map,s;async function a(c,p,f=!0){let h=gr;t.debug("Fetching:",c);try{c.offerSelectorIds=c.offerSelectorIds.sort();let d=new URL(e.wcsURL);d.searchParams.set("offer_selector_ids",c.offerSelectorIds.join(",")),d.searchParams.set("country",c.country),d.searchParams.set("locale",c.locale),d.searchParams.set("landscape",n===pe.STAGE?"ALL":e.landscape),d.searchParams.set("api_key",r),c.language&&d.searchParams.set("language",c.language),c.promotionCode&&d.searchParams.set("promotion_code",c.promotionCode),c.currency&&d.searchParams.set("currency",c.currency);let _=await fetch(d.toString(),{credentials:"omit"});if(_.ok){let S=await _.json();t.debug("Fetched:",c,S);let A=S.resolvedOffers??[];A=A.map($e),p.forEach(({resolve:w},T)=>{let C=A.filter(({offerSelectorIds:P})=>P.includes(T)).flat();C.length&&(p.delete(T),w(C))})}else _.status===404&&c.offerSelectorIds.length>1?(t.debug("Multi-osi 404, fallback to fetch-by-one strategy"),await Promise.allSettled(c.offerSelectorIds.map(S=>a({...c,offerSelectorIds:[S]},p,!1)))):(h=at,t.error(h,c))}catch(d){h=at,t.error(h,c,d)}f&&p.size&&(t.debug("Missing:",{offerSelectorIds:[...p.keys()]}),p.forEach(d=>{d.reject(new Error(h))}))}function l(){clearTimeout(s);let c=[...o.values()];o.clear(),c.forEach(({options:p,promises:f})=>a(p,f))}function u({country:c,language:p,perpetual:f=!1,promotionCode:h="",wcsOsi:d=[]}){let _=`${p}_${c}`;c!=="GB"&&(p=f?"EN":"MULT");let S=[c,p,h].filter(A=>A).join("-").toLowerCase();return d.map(A=>{let w=`${A}-${S}`;if(!i.has(w)){let T=new Promise((C,P)=>{let L=o.get(S);if(!L){let U={country:c,locale:_,offerSelectorIds:[]};c!=="GB"&&(U.language=p),L={options:U,promises:new Map},o.set(S,L)}h&&(L.options.promotionCode=h),L.options.offerSelectorIds.push(A),L.promises.set(A,{resolve:C,reject:P}),L.options.offerSelectorIds.length>=e.wcsBufferLimit?l():(t.debug("Queued:",L.options),s||(s=setTimeout(l,e.wcsBufferDelay)))});i.set(w,T)}return i.get(w)})}return{WcsCommitment:hr,WcsPlanType:dr,WcsTerm:Er,resolveOfferSelectors:u}}var D=class extends HTMLElement{get isWcmsCommerce(){return!0}};K(D,"instance"),K(D,"promise",null);window.customElements.define(ee,D);async function qo(e,t){let n=M.init(e.env).module("service");n.debug("Activating:",e);let r={price:{}},i=Object.freeze(wr(e));try{r.price=await Yn(i)}catch(l){n.warn("Price literals were not fetched:",l)}let o={checkout:new Set,price:new Set},s=document.createElement(ee),a={literals:r,providers:o,settings:i};return D.instance=Object.defineProperties(s,Object.getOwnPropertyDescriptors({...Wn(a,t),...Xn(a),...Bn(a),...$n(a),...Pr,Log:M,get defaults(){return x},get literals(){return r},get log(){return M},get providers(){return{checkout(l){return o.checkout.add(l),()=>o.checkout.delete(l)},price(l){return o.price.add(l),()=>o.price.delete(l)}}},get settings(){return i}})),n.debug("Activated:",{literals:r,settings:i,element:s}),document.head.append(s),ie(()=>{let l=new CustomEvent(me,{bubbles:!0,cancelable:!1,detail:D.instance});D.instance.dispatchEvent(l)}),D.instance}function qn(){document.head.querySelector(ee)?.remove(),D.promise=null,M.reset()}function zo(e,t){if(re(e)){let n=re(t)?t():{};return n.force&&qn(),D.promise??(D.promise=qo(e(),n))}return D.promise?D.promise:new Promise(n=>{let r=i=>{n(i.detail)};document.head.addEventListener(me,r,{once:!0})})}export{St as CheckoutLink,Y as CheckoutWorkflow,B as CheckoutWorkflowStep,x as Defaults,vt as InlinePrice,he as Landscape,M as Log,ee as TAG_NAME_SERVICE,hr as WcsCommitment,dr as WcsPlanType,Er as WcsTerm,$e as applyPlanType,Dn as getLocaleSettings,wr as getSettings,zo as init,qn as reset}; //# sourceMappingURL=commerce.js.map diff --git a/libs/deps/mas/mas.js b/libs/deps/mas/mas.js index 83267703e1..6e761a8a42 100644 --- a/libs/deps/mas/mas.js +++ b/libs/deps/mas/mas.js @@ -1,4 +1,4 @@ -var Dr=Object.defineProperty;var Mr=e=>{throw TypeError(e)};var pi=(e,t,r)=>t in e?Dr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var mi=(e,t)=>{for(var r in t)Dr(e,r,{get:t[r],enumerable:!0})};var te=(e,t,r)=>pi(e,typeof t!="symbol"?t+"":t,r),kr=(e,t,r)=>t.has(e)||Mr("Cannot "+r);var wt=(e,t,r)=>(kr(e,t,"read from private field"),r?r.call(e):t.get(e)),Gr=(e,t,r)=>t.has(e)?Mr("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),Ot=(e,t,r,n)=>(kr(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r);var Ce;(function(e){e.ServerError="ServerError",e.ClientError="ClientError",e.UnexpectedError="UnexpectedError"})(Ce||(Ce={}));var Fr=(e,t,r)=>({type:(i=>i>=500?Ce.ServerError:i<400?Ce.UnexpectedError:Ce.ClientError)(e),message:t,originatingRequest:r,status:e});var hi=function(e,t,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{u(n.next(l))}catch(p){s(p)}}function c(l){try{u(n.throw(l))}catch(p){s(p)}}function u(l){l.done?o(l.value):i(l.value).then(a,c)}u((n=n.apply(e,t||[])).next())})},Be;(function(e){e.AUTHORIZATION="Authorization",e.X_API_KEY="X-Api-Key"})(Be||(Be={}));var Lt=class{constructor(t){this.fetchOptions=t}commonHeaders(){let t={};return this.fetchOptions.apiKey&&(t[Be.X_API_KEY]=this.fetchOptions.apiKey),this.fetchOptions.accessToken&&(t[Be.AUTHORIZATION]=`Bearer ${this.fetchOptions.accessToken}`),t}transformData(t,r){return r?t.map(n=>r(n)):t.map(n=>this.identifyTransform(n))}transformDatum(t,r){return r?r(t):this.identifyTransform(t)}identifyTransform(t){return t}failOnBadStatusOrParseBody(t,r){return hi(this,void 0,void 0,function*(){if(t.ok)return t.json().then(i=>({headers:t.headers,status:t.status,statusText:t.statusText,data:i}));let n=yield t.text();return Promise.reject(Fr(t.status,n,r))})}buildUrl(t,r,n,i,o){var s;let a=(s=this.fetchOptions.baseUrl)!==null&&s!==void 0?s:i(this.fetchOptions.env),c=o(r,n);return this.generateUrl(a,t,c)}generateUrl(t,r,n){let i=new URL(r,t);return n&&(i.search=this.convertToSearchParams(n).toString()),i.toString()}convertToSearchParams(t){return new URLSearchParams(t)}setParams(t,r,n){n!=null&&typeof n=="boolean"?t[r]=String(n):n&&(t[r]=n)}},Nt=Lt;var Y;(function(e){e.STAGE="STAGE",e.PRODUCTION="PRODUCTION",e.LOCAL="LOCAL"})(Y||(Y={}));var Ie;(function(e){e.STAGE="STAGE",e.PRODUCTION="PROD",e.LOCAL="LOCAL"})(Ie||(Ie={}));var j;(function(e){e.DRAFT="DRAFT",e.PUBLISHED="PUBLISHED"})(j||(j={}));var fe;(function(e){e.V2="UCv2",e.V3="UCv3"})(fe||(fe={}));var $;(function(e){e.CHECKOUT="checkout",e.CHECKOUT_EMAIL="checkout/email",e.SEGMENTATION="segmentation",e.BUNDLE="bundle",e.COMMITMENT="commitment",e.RECOMMENDATION="recommendation",e.EMAIL="email",e.PAYMENT="payment",e.CHANGE_PLAN_TEAM_PLANS="change-plan/team-upgrade/plans",e.CHANGE_PLAN_TEAM_PAYMENT="change-plan/team-upgrade/payment"})($||($={}));var Ct=function(e){var t;return(t=di.get(e))!==null&&t!==void 0?t:e},di=new Map([["countrySpecific","cs"],["quantity","q"],["authCode","code"],["checkoutPromoCode","apc"],["rurl","rUrl"],["curl","cUrl"],["ctxrturl","ctxRtUrl"],["country","co"],["language","lang"],["clientId","cli"],["context","ctx"],["productArrangementCode","pa"],["offerType","ot"],["marketSegment","ms"]]);var Vr=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},jr=function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,o=[],s;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return o};function ve(e,t,r){var n,i;try{for(var o=Vr(Object.entries(e)),s=o.next();!s.done;s=o.next()){var a=jr(s.value,2),c=a[0],u=a[1],l=Ct(c);u!=null&&r.has(l)&&t.set(l,u)}}catch(p){n={error:p}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}}function Ye(e){switch(e){case Y.PRODUCTION:return"https://commerce.adobe.com";default:return"https://commerce-stg.adobe.com"}}function $e(e,t){var r,n;for(var i in e){var o=e[i];try{for(var s=(r=void 0,Vr(Object.entries(o))),a=s.next();!a.done;a=s.next()){var c=jr(a.value,2),u=c[0],l=c[1];if(l!=null){var p=Ct(u);t.set("items["+i+"]["+p+"]",l)}}}catch(f){r={error:f}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}}}var Ei=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};function Wr(e){_i(e);var t=e.env,r=e.items,n=e.workflowStep,i=Ei(e,["env","items","workflowStep"]),o=new URL(Ye(t));return o.pathname=n+"/",$e(r,o.searchParams),ve(i,o.searchParams,xi),o.toString()}var xi=new Set(["cli","co","lang","ctx","cUrl","mv","nglwfdata","otac","promoid","rUrl","sdid","spint","trackingid","code","campaignid","appctxid"]),yi=["env","workflowStep","clientId","country","items"];function _i(e){var t,r;try{for(var n=gi(yi),i=n.next();!i.done;i=n.next()){var o=i.value;if(!e[o])throw new Error('Argument "checkoutData" is not valid, missing: '+o)}}catch(s){t={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}return!0}var vi=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Si="p_draft_landscape",bi="/store/";function Rt(e){Ai(e);var t=e.env,r=e.items,n=e.workflowStep,i=e.ms,o=e.marketSegment,s=e.ot,a=e.offerType,c=e.pa,u=e.productArrangementCode,l=e.landscape,p=vi(e,["env","items","workflowStep","ms","marketSegment","ot","offerType","pa","productArrangementCode","landscape"]),f={marketSegment:o??i,offerType:a??s,productArrangementCode:u??c},d=new URL(Ye(t));return d.pathname=""+bi+n,n!==$.SEGMENTATION&&n!==$.CHANGE_PLAN_TEAM_PLANS&&$e(r,d.searchParams),n===$.SEGMENTATION&&ve(f,d.searchParams,It),ve(p,d.searchParams,It),l===j.DRAFT&&ve({af:Si},d.searchParams,It),d.toString()}var It=new Set(["af","ai","apc","appctxid","cli","co","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"]),Pi=["env","workflowStep","clientId","country"];function Ai(e){var t,r;try{for(var n=Ti(Pi),i=n.next();!i.done;i=n.next()){var o=i.value;if(!e[o])throw new Error('Argument "checkoutData" is not valid, missing: '+o)}}catch(s){t={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}if(e.workflowStep!==$.SEGMENTATION&&e.workflowStep!==$.CHANGE_PLAN_TEAM_PLANS&&!e.items)throw new Error('Argument "checkoutData" is not valid, missing: items');return!0}function Ut(e,t){switch(e){case fe.V2:return Wr(t);case fe.V3:return Rt(t);default:return console.warn("Unsupported CheckoutType, will use UCv3 as default. Given type: "+e),Rt(t)}}var Dt;(function(e){e.BASE="BASE",e.TRIAL="TRIAL",e.PROMOTION="PROMOTION"})(Dt||(Dt={}));var I;(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"})(I||(I={}));var L;(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"})(L||(L={}));var Mt;(function(e){e.INDIVIDUAL="INDIVIDUAL",e.TEAM="TEAM",e.ENTERPRISE="ENTERPRISE"})(Mt||(Mt={}));var kt;(function(e){e.COM="COM",e.EDU="EDU",e.GOV="GOV"})(kt||(kt={}));var Gt;(function(e){e.DIRECT="DIRECT",e.INDIRECT="INDIRECT"})(Gt||(Gt={}));var Ft;(function(e){e.ENTERPRISE_PRODUCT="ENTERPRISE_PRODUCT",e.ETLA="ETLA",e.RETAIL="RETAIL",e.VIP="VIP",e.VIPMP="VIPMP",e.FREE="FREE"})(Ft||(Ft={}));var Vt=()=>{};Vt.createContext=Vt;var wi=j.PUBLISHED,Hr=e=>{switch(e){case Y.PRODUCTION:return"https://wcs.adobe.io";case Y.STAGE:return"https://wcs-stage.adobe.io";case Y.LOCAL:return"http://localhost:3002";default:return"https://wcs-stage.adobe.io"}},Xr=(e,t)=>{var r;return e.api_key=t.apiKey,e.landscape=(r=t.landscape)!==null&&r!==void 0?r:wi,e};var Oi=function(e,t,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{u(n.next(l))}catch(p){s(p)}}function c(l){try{u(n.throw(l))}catch(p){s(p)}}function u(l){l.done?o(l.value):i(l.value).then(a,c)}u((n=n.apply(e,t||[])).next())})},jt=class extends Nt{constructor(t){super(t),this.apiPaths={getWebCommerceArtifact:"web_commerce_artifact"},this.getWebCommerceArtifact=(r,n,i,o)=>Oi(this,void 0,void 0,function*(){let s=this.buildUrl(this.apiPaths.getWebCommerceArtifact,n,r,a=>Hr(a),(a,c)=>this.evaluateGetWebCommerceArtifactParams(a,c));return this.fetchOptions.fetch(s,{signal:o,headers:Object.assign({},this.commonHeaders()),mode:"cors"}).then(a=>this.failOnBadStatusOrParseBody(a,`GET ${s}`)).then(a=>{let u=a.data;return{data:this.transformDatum(u,i)}})})}evaluateGetWebCommerceArtifactParams(t,r){let n={};return this.setParams(n,"offer_selector_ids",r.offerSelectorIds.join(",")),this.setParams(n,"country",r.country),this.setParams(n,"language",r.language),this.setParams(n,"currency",r.currency),this.setParams(n,"locale",r.locale),this.setParams(n,"promotion_code",r.promotionCode),Xr(n,t)}},Br=jt;var qe=e=>new Br(e).getWebCommerceArtifact;var Yr="tacocat.js";var ze=(e,t)=>String(e??"").toLowerCase()==String(t??"").toLowerCase(),$r=e=>`${e??""}`.replace(/[&<>'"]/g,t=>({"&":"&","<":"<",">":">","'":"'",'"':"""})[t]??t)??"";function w(e,t={},{metadata:r=!0,search:n=!0,storage:i=!0}={}){let o;if(n&&o==null){let s=new URLSearchParams(window.location.search),a=Te(n)?n:e;o=s.get(a)}if(i&&o==null){let s=Te(i)?i:e;o=window.sessionStorage.getItem(s)??window.localStorage.getItem(s)}if(r&&o==null){let s=Zr(Te(r)?r:e);o=document.documentElement.querySelector(`meta[name="${s}"]`)?.content}return o??t[e]}var Se=()=>{};var qr=e=>typeof e=="boolean",ae=e=>typeof e=="function",Ze=e=>typeof e=="number",zr=e=>e!=null&&typeof e=="object";var Te=e=>typeof e=="string",Wt=e=>Te(e)&&e,be=e=>Ze(e)&&Number.isFinite(e)&&e>0;function Pe(e,t=r=>r==null||r===""){return e!=null&&Object.entries(e).forEach(([r,n])=>{t(n)&&delete e[r]}),e}function _(e,t){if(qr(e))return e;let r=String(e);return r==="1"||r==="true"?!0:r==="0"||r==="false"?!1:t}function re(e,t,r){let n=Object.values(t);return n.find(i=>ze(i,e))??r??n[0]}function Zr(e=""){return String(e).replace(/(\p{Lowercase_Letter})(\p{Uppercase_Letter})/gu,(t,r,n)=>`${r}-${n}`).replace(/\W+/gu,"-").toLowerCase()}function Ae(e,t=1){return Ze(e)||(e=Number.parseInt(e,10)),!Number.isNaN(e)&&e>0&&Number.isFinite(e)?e:t}var Li=Date.now(),Ht=()=>`(+${Date.now()-Li}ms)`,Qe=new Set,Ni=_(w("tacocat.debug",{},{metadata:!1}),typeof process<"u"&&process.env?.DEBUG);function Qr(e){let t=`[${Yr}/${e}]`,r=(s,a,...c)=>s?!0:(i(a,...c),!1),n=Ni?(s,...a)=>{console.debug(`${t} ${s}`,...a,Ht())}:()=>{},i=(s,...a)=>{let c=`${t} ${s}`;Qe.forEach(([u])=>u(c,...a))};return{assert:r,debug:n,error:i,warn:(s,...a)=>{let c=`${t} ${s}`;Qe.forEach(([,u])=>u(c,...a))}}}function Ci(e,t){let r=[e,t];return Qe.add(r),()=>{Qe.delete(r)}}Ci((e,...t)=>{console.error(e,...t,Ht())},(e,...t)=>{console.warn(e,...t,Ht())});var Ii="no promo",Jr="promo-tag",Ri="yellow",Ui="neutral",Di=(e,t,r)=>{let n=o=>o||Ii,i=r?` (was "${n(t)}")`:"";return`${n(e)}${i}`},Mi="cancel-context",Re=(e,t)=>{let r=e===Mi,n=!r&&e?.length>0,i=(n||r)&&(t&&t!=e||!t&&!r),o=i&&n||!i&&!!t,s=o?e||t:void 0;return{effectivePromoCode:s,overridenPromoCode:e,className:o?Jr:`${Jr} no-promo`,text:Di(s,t,i),variant:o?Ri:Ui,isOverriden:i}};var Xt=function(e,t){return Xt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},Xt(e,t)};function Ue(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Xt(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var v=function(){return v=Object.assign||function(t){for(var r,n=1,i=arguments.length;n0}),r=[],n=0,i=t;n1)throw new RangeError("integer-width stems only accept a single optional option");i.options[0].replace(Fi,function(a,c,u,l,p,f){if(c)t.minimumIntegerDigits=u.length;else{if(l&&p)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(ln.test(i.stem)){t.minimumIntegerDigits=i.stem.length;continue}if(nn.test(i.stem)){if(i.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");i.stem.replace(nn,function(a,c,u,l,p,f){return u==="*"?t.minimumFractionDigits=c.length:l&&l[0]==="#"?t.maximumFractionDigits=l.length:p&&f?(t.minimumFractionDigits=p.length,t.maximumFractionDigits=p.length+f.length):(t.minimumFractionDigits=c.length,t.maximumFractionDigits=c.length),""}),i.options.length&&(t=v(v({},t),on(i.options[0])));continue}if(cn.test(i.stem)){t=v(v({},t),on(i.stem));continue}var o=un(i.stem);o&&(t=v(v({},t),o));var s=Vi(i.stem);s&&(t=v(v({},t),s))}return t}var $t,ji=new RegExp("^"+Yt.source+"*"),Wi=new RegExp(Yt.source+"*$");function x(e,t){return{start:e,end:t}}var Hi=!!String.prototype.startsWith,Xi=!!String.fromCodePoint,Bi=!!Object.fromEntries,Yi=!!String.prototype.codePointAt,$i=!!String.prototype.trimStart,qi=!!String.prototype.trimEnd,zi=!!Number.isSafeInteger,Zi=zi?Number.isSafeInteger:function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e&&Math.abs(e)<=9007199254740991},zt=!0;try{pn=En("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu"),zt=(($t=pn.exec("a"))===null||$t===void 0?void 0:$t[0])==="a"}catch{zt=!1}var pn,mn=Hi?function(t,r,n){return t.startsWith(r,n)}:function(t,r,n){return t.slice(n,n+r.length)===r},Zt=Xi?String.fromCodePoint:function(){for(var t=[],r=0;ro;){if(s=t[o++],s>1114111)throw RangeError(s+" is not a valid code point");n+=s<65536?String.fromCharCode(s):String.fromCharCode(((s-=65536)>>10)+55296,s%1024+56320)}return n},hn=Bi?Object.fromEntries:function(t){for(var r={},n=0,i=t;n=n)){var i=t.charCodeAt(r),o;return i<55296||i>56319||r+1===n||(o=t.charCodeAt(r+1))<56320||o>57343?i:(i-55296<<10)+(o-56320)+65536}},Qi=$i?function(t){return t.trimStart()}:function(t){return t.replace(ji,"")},Ji=qi?function(t){return t.trimEnd()}:function(t){return t.replace(Wi,"")};function En(e,t){return new RegExp(e,t)}var Qt;zt?(qt=En("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu"),Qt=function(t,r){var n;qt.lastIndex=r;var i=qt.exec(t);return(n=i[1])!==null&&n!==void 0?n:""}):Qt=function(t,r){for(var n=[];;){var i=dn(t,r);if(i===void 0||xn(i)||to(i))break;n.push(i),r+=i>=65536?2:1}return Zt.apply(void 0,n)};var qt,gn=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.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,n){for(var i=[];!this.isEOF();){var o=this.char();if(o===123){var s=this.parseArgument(t,n);if(s.err)return s;i.push(s.val)}else{if(o===125&&t>0)break;if(o===35&&(r==="plural"||r==="selectordinal")){var a=this.clonePosition();this.bump(),i.push({type:A.pound,location:x(a,this.clonePosition())})}else if(o===60&&!this.ignoreTag&&this.peek()===47){if(n)break;return this.error(g.UNMATCHED_CLOSING_TAG,x(this.clonePosition(),this.clonePosition()))}else if(o===60&&!this.ignoreTag&&Jt(this.peek()||0)){var s=this.parseTag(t,r);if(s.err)return s;i.push(s.val)}else{var s=this.parseLiteral(t,r);if(s.err)return s;i.push(s.val)}}}return{val:i,err:null}},e.prototype.parseTag=function(t,r){var n=this.clonePosition();this.bump();var i=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:A.literal,value:"<"+i+"/>",location:x(n,this.clonePosition())},err:null};if(this.bumpIf(">")){var o=this.parseMessage(t+1,r,!0);if(o.err)return o;var s=o.val,a=this.clonePosition();if(this.bumpIf("")?{val:{type:A.tag,value:i,children:s,location:x(n,this.clonePosition())},err:null}:this.error(g.INVALID_TAG,x(a,this.clonePosition())))}else return this.error(g.UNCLOSED_TAG,x(n,this.clonePosition()))}else return this.error(g.INVALID_TAG,x(n,this.clonePosition()))},e.prototype.parseTagName=function(){var t=this.offset();for(this.bump();!this.isEOF()&&eo(this.char());)this.bump();return this.message.slice(t,this.offset())},e.prototype.parseLiteral=function(t,r){for(var n=this.clonePosition(),i="";;){var o=this.tryParseQuote(r);if(o){i+=o;continue}var s=this.tryParseUnquoted(t,r);if(s){i+=s;continue}var a=this.tryParseLeftAngleBracket();if(a){i+=a;continue}break}var c=x(n,this.clonePosition());return{val:{type:A.literal,value:i,location:c},err:null}},e.prototype.tryParseLeftAngleBracket=function(){return!this.isEOF()&&this.char()===60&&(this.ignoreTag||!Ki(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 n=this.char();if(n===39)if(this.peek()===39)r.push(39),this.bump();else{this.bump();break}else r.push(n);this.bump()}return Zt.apply(void 0,r)},e.prototype.tryParseUnquoted=function(t,r){if(this.isEOF())return null;var n=this.char();return n===60||n===123||n===35&&(r==="plural"||r==="selectordinal")||n===125&&t>0?null:(this.bump(),Zt(n))},e.prototype.parseArgument=function(t,r){var n=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(g.EXPECT_ARGUMENT_CLOSING_BRACE,x(n,this.clonePosition()));if(this.char()===125)return this.bump(),this.error(g.EMPTY_ARGUMENT,x(n,this.clonePosition()));var i=this.parseIdentifierIfPossible().value;if(!i)return this.error(g.MALFORMED_ARGUMENT,x(n,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(g.EXPECT_ARGUMENT_CLOSING_BRACE,x(n,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:A.argument,value:i,location:x(n,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(g.EXPECT_ARGUMENT_CLOSING_BRACE,x(n,this.clonePosition())):this.parseArgumentOptions(t,r,i,n);default:return this.error(g.MALFORMED_ARGUMENT,x(n,this.clonePosition()))}},e.prototype.parseIdentifierIfPossible=function(){var t=this.clonePosition(),r=this.offset(),n=Qt(this.message,r),i=r+n.length;this.bumpTo(i);var o=this.clonePosition(),s=x(t,o);return{value:n,location:s}},e.prototype.parseArgumentOptions=function(t,r,n,i){var o,s=this.clonePosition(),a=this.parseIdentifierIfPossible().value,c=this.clonePosition();switch(a){case"":return this.error(g.EXPECT_ARGUMENT_TYPE,x(s,c));case"number":case"date":case"time":{this.bumpSpace();var u=null;if(this.bumpIf(",")){this.bumpSpace();var l=this.clonePosition(),p=this.parseSimpleArgStyleIfPossible();if(p.err)return p;var f=Ji(p.val);if(f.length===0)return this.error(g.EXPECT_ARGUMENT_STYLE,x(this.clonePosition(),this.clonePosition()));var d=x(l,this.clonePosition());u={style:f,styleLocation:d}}var h=this.tryParseArgumentClose(i);if(h.err)return h;var E=x(i,this.clonePosition());if(u&&mn(u?.style,"::",0)){var b=Qi(u.style.slice(2));if(a==="number"){var p=this.parseNumberSkeletonFromString(b,u.styleLocation);return p.err?p:{val:{type:A.number,value:n,location:E,style:p.val},err:null}}else{if(b.length===0)return this.error(g.EXPECT_DATE_TIME_SKELETON,E);var f={type:pe.dateTime,pattern:b,location:u.styleLocation,parsedOptions:this.shouldParseSkeletons?tn(b):{}},N=a==="date"?A.date:A.time;return{val:{type:N,value:n,location:E,style:f},err:null}}}return{val:{type:a==="number"?A.number:a==="date"?A.date:A.time,value:n,location:E,style:(o=u?.style)!==null&&o!==void 0?o:null},err:null}}case"plural":case"selectordinal":case"select":{var P=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(g.EXPECT_SELECT_ARGUMENT_OPTIONS,x(P,v({},P)));this.bumpSpace();var S=this.parseIdentifierIfPossible(),O=0;if(a!=="select"&&S.value==="offset"){if(!this.bumpIf(":"))return this.error(g.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,x(this.clonePosition(),this.clonePosition()));this.bumpSpace();var p=this.tryParseDecimalInteger(g.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,g.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);if(p.err)return p;this.bumpSpace(),S=this.parseIdentifierIfPossible(),O=p.val}var y=this.tryParsePluralOrSelectOptions(t,a,r,S);if(y.err)return y;var h=this.tryParseArgumentClose(i);if(h.err)return h;var C=x(i,this.clonePosition());return a==="select"?{val:{type:A.select,value:n,options:hn(y.val),location:C},err:null}:{val:{type:A.plural,value:n,options:hn(y.val),offset:O,pluralType:a==="plural"?"cardinal":"ordinal",location:C},err:null}}default:return this.error(g.INVALID_ARGUMENT_TYPE,x(s,c))}},e.prototype.tryParseArgumentClose=function(t){return this.isEOF()||this.char()!==125?this.error(g.EXPECT_ARGUMENT_CLOSING_BRACE,x(t,this.clonePosition())):(this.bump(),{val:!0,err:null})},e.prototype.parseSimpleArgStyleIfPossible=function(){for(var t=0,r=this.clonePosition();!this.isEOF();){var n=this.char();switch(n){case 39:{this.bump();var i=this.clonePosition();if(!this.bumpUntil("'"))return this.error(g.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,x(i,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 n=[];try{n=an(t)}catch{return this.error(g.INVALID_NUMBER_SKELETON,r)}return{val:{type:pe.number,tokens:n,location:r,parsedOptions:this.shouldParseSkeletons?fn(n):{}},err:null}},e.prototype.tryParsePluralOrSelectOptions=function(t,r,n,i){for(var o,s=!1,a=[],c=new Set,u=i.value,l=i.location;;){if(u.length===0){var p=this.clonePosition();if(r!=="select"&&this.bumpIf("=")){var f=this.tryParseDecimalInteger(g.EXPECT_PLURAL_ARGUMENT_SELECTOR,g.INVALID_PLURAL_ARGUMENT_SELECTOR);if(f.err)return f;l=x(p,this.clonePosition()),u=this.message.slice(p.offset,this.offset())}else break}if(c.has(u))return this.error(r==="select"?g.DUPLICATE_SELECT_ARGUMENT_SELECTOR:g.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,l);u==="other"&&(s=!0),this.bumpSpace();var d=this.clonePosition();if(!this.bumpIf("{"))return this.error(r==="select"?g.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:g.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,x(this.clonePosition(),this.clonePosition()));var h=this.parseMessage(t+1,r,n);if(h.err)return h;var E=this.tryParseArgumentClose(d);if(E.err)return E;a.push([u,{value:h.val,location:x(d,this.clonePosition())}]),c.add(u),this.bumpSpace(),o=this.parseIdentifierIfPossible(),u=o.value,l=o.location}return a.length===0?this.error(r==="select"?g.EXPECT_SELECT_ARGUMENT_SELECTOR:g.EXPECT_PLURAL_ARGUMENT_SELECTOR,x(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!s?this.error(g.MISSING_OTHER_CLAUSE,x(this.clonePosition(),this.clonePosition())):{val:a,err:null}},e.prototype.tryParseDecimalInteger=function(t,r){var n=1,i=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(n=-1);for(var o=!1,s=0;!this.isEOF();){var a=this.char();if(a>=48&&a<=57)o=!0,s=s*10+(a-48),this.bump();else break}var c=x(i,this.clonePosition());return o?(s*=n,Zi(s)?{val:s,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=dn(this.message,t);if(r===void 0)throw Error("Offset "+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(mn(this.message,t,this.offset())){for(var r=0;r=0?(this.bumpTo(n),!0):(this.bumpTo(this.message.length),!1)},e.prototype.bumpTo=function(t){if(this.offset()>t)throw Error("targetOffset "+t+" must be greater than or equal to the current offset "+this.offset());for(t=Math.min(t,this.message.length);;){var r=this.offset();if(r===t)break;if(r>t)throw Error("targetOffset "+t+" is at invalid UTF-16 code unit boundary");if(this.bump(),this.isEOF())break}},e.prototype.bumpSpace=function(){for(;!this.isEOF()&&xn(this.char());)this.bump()},e.prototype.peek=function(){if(this.isEOF())return null;var t=this.char(),r=this.offset(),n=this.message.charCodeAt(r+(t>=65536?2:1));return n??null},e}();function Jt(e){return e>=97&&e<=122||e>=65&&e<=90}function Ki(e){return Jt(e)||e===47}function eo(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 xn(e){return e>=9&&e<=13||e===32||e===133||e>=8206&&e<=8207||e===8232||e===8233}function to(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 Kt(e){e.forEach(function(t){if(delete t.location,rt(t)||nt(t))for(var r in t.options)delete t.options[r].location,Kt(t.options[r].value);else Ke(t)&&ot(t.style)||(et(t)||tt(t))&&De(t.style)?delete t.style.location:it(t)&&Kt(t.children)})}function yn(e,t){t===void 0&&(t={}),t=v({shouldParseSkeletons:!0,requiresOtherClause:!0},t);var r=new gn(e,t).parse();if(r.err){var n=SyntaxError(g[r.err.kind]);throw n.location=r.err.location,n.originalMessage=r.err.message,n}return t?.captureLocation||Kt(r.val),r.val}function Me(e,t){var r=t&&t.cache?t.cache:ao,n=t&&t.serializer?t.serializer:so,i=t&&t.strategy?t.strategy:no;return i(e,{cache:r,serializer:n})}function ro(e){return e==null||typeof e=="number"||typeof e=="boolean"}function _n(e,t,r,n){var i=ro(n)?n:r(n),o=t.get(i);return typeof o>"u"&&(o=e.call(this,n),t.set(i,o)),o}function vn(e,t,r){var n=Array.prototype.slice.call(arguments,3),i=r(n),o=t.get(i);return typeof o>"u"&&(o=e.apply(this,n),t.set(i,o)),o}function er(e,t,r,n,i){return r.bind(t,e,n,i)}function no(e,t){var r=e.length===1?_n:vn;return er(e,this,r,t.cache.create(),t.serializer)}function io(e,t){return er(e,this,vn,t.cache.create(),t.serializer)}function oo(e,t){return er(e,this,_n,t.cache.create(),t.serializer)}var so=function(){return JSON.stringify(arguments)};function tr(){this.cache=Object.create(null)}tr.prototype.get=function(e){return this.cache[e]};tr.prototype.set=function(e,t){this.cache[e]=t};var ao={create:function(){return new tr}},st={variadic:io,monadic:oo};var me;(function(e){e.MISSING_VALUE="MISSING_VALUE",e.INVALID_VALUE="INVALID_VALUE",e.MISSING_INTL_API="MISSING_INTL_API"})(me||(me={}));var ke=function(e){Ue(t,e);function t(r,n,i){var o=e.call(this,r)||this;return o.code=n,o.originalMessage=i,o}return t.prototype.toString=function(){return"[formatjs Error: "+this.code+"] "+this.message},t}(Error);var rr=function(e){Ue(t,e);function t(r,n,i,o){return e.call(this,'Invalid values for "'+r+'": "'+n+'". Options are "'+Object.keys(i).join('", "')+'"',me.INVALID_VALUE,o)||this}return t}(ke);var Tn=function(e){Ue(t,e);function t(r,n,i){return e.call(this,'Value for "'+r+'" must be of type '+n,me.INVALID_VALUE,i)||this}return t}(ke);var Sn=function(e){Ue(t,e);function t(r,n){return e.call(this,'The intl string context variable "'+r+'" was not provided to the string "'+n+'"',me.MISSING_VALUE,n)||this}return t}(ke);var U;(function(e){e[e.literal=0]="literal",e[e.object=1]="object"})(U||(U={}));function co(e){return e.length<2?e:e.reduce(function(t,r){var n=t[t.length-1];return!n||n.type!==U.literal||r.type!==U.literal?t.push(r):n.value+=r.value,t},[])}function lo(e){return typeof e=="function"}function Ge(e,t,r,n,i,o,s){if(e.length===1&&Bt(e[0]))return[{type:U.literal,value:e[0].value}];for(var a=[],c=0,u=e;c{throw TypeError(e)};var ei=(e,t,n)=>t in e?Nr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ti=(e,t)=>{for(var n in t)Nr(e,n,{get:t[n],enumerable:!0})};var J=(e,t,n)=>ei(e,typeof t!="symbol"?t+"":t,n),Rr=(e,t,n)=>t.has(e)||Cr("Cannot "+n);var Tt=(e,t,n)=>(Rr(e,t,"read from private field"),n?n.call(e):t.get(e)),Ir=(e,t,n)=>t.has(e)?Cr("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),bt=(e,t,n,r)=>(Rr(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);var Le;(function(e){e.STAGE="STAGE",e.PRODUCTION="PRODUCTION",e.LOCAL="LOCAL"})(Le||(Le={}));var At;(function(e){e.STAGE="STAGE",e.PRODUCTION="PROD",e.LOCAL="LOCAL"})(At||(At={}));var Oe;(function(e){e.DRAFT="DRAFT",e.PUBLISHED="PUBLISHED"})(Oe||(Oe={}));var ae;(function(e){e.V2="UCv2",e.V3="UCv3"})(ae||(ae={}));var V;(function(e){e.CHECKOUT="checkout",e.CHECKOUT_EMAIL="checkout/email",e.SEGMENTATION="segmentation",e.BUNDLE="bundle",e.COMMITMENT="commitment",e.RECOMMENDATION="recommendation",e.EMAIL="email",e.PAYMENT="payment",e.CHANGE_PLAN_TEAM_PLANS="change-plan/team-upgrade/plans",e.CHANGE_PLAN_TEAM_PAYMENT="change-plan/team-upgrade/payment"})(V||(V={}));var wt=function(e){var t;return(t=ri.get(e))!==null&&t!==void 0?t:e},ri=new Map([["countrySpecific","cs"],["quantity","q"],["authCode","code"],["checkoutPromoCode","apc"],["rurl","rUrl"],["curl","cUrl"],["ctxrturl","ctxRtUrl"],["country","co"],["language","lang"],["clientId","cli"],["context","ctx"],["productArrangementCode","pa"],["offerType","ot"],["marketSegment","ms"]]);var Mr=function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Dr=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],s;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return o};function ge(e,t,n){var r,i;try{for(var o=Mr(Object.entries(e)),s=o.next();!s.done;s=o.next()){var a=Dr(s.value,2),l=a[0],u=a[1],c=wt(l);u!=null&&n.has(c)&&t.set(c,u)}}catch(p){r={error:p}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}}function He(e){switch(e){case Le.PRODUCTION:return"https://commerce.adobe.com";default:return"https://commerce-stg.adobe.com"}}function We(e,t){var n,r;for(var i in e){var o=e[i];try{for(var s=(n=void 0,Mr(Object.entries(o))),a=s.next();!a.done;a=s.next()){var l=Dr(a.value,2),u=l[0],c=l[1];if(c!=null){var p=wt(u);t.set("items["+i+"]["+p+"]",c)}}}catch(f){n={error:f}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}}}var ni=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};function Ur(e){ai(e);var t=e.env,n=e.items,r=e.workflowStep,i=ni(e,["env","items","workflowStep"]),o=new URL(He(t));return o.pathname=r+"/",We(n,o.searchParams),ge(i,o.searchParams,oi),o.toString()}var oi=new Set(["cli","co","lang","ctx","cUrl","mv","nglwfdata","otac","promoid","rUrl","sdid","spint","trackingid","code","campaignid","appctxid"]),si=["env","workflowStep","clientId","country","items"];function ai(e){var t,n;try{for(var r=ii(si),i=r.next();!i.done;i=r.next()){var o=i.value;if(!e[o])throw new Error('Argument "checkoutData" is not valid, missing: '+o)}}catch(s){t={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}return!0}var ci=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},ui="p_draft_landscape",fi="/store/";function Ot(e){mi(e);var t=e.env,n=e.items,r=e.workflowStep,i=e.ms,o=e.marketSegment,s=e.ot,a=e.offerType,l=e.pa,u=e.productArrangementCode,c=e.landscape,p=ci(e,["env","items","workflowStep","ms","marketSegment","ot","offerType","pa","productArrangementCode","landscape"]),f={marketSegment:o??i,offerType:a??s,productArrangementCode:u??l},h=new URL(He(t));return h.pathname=""+fi+r,r!==V.SEGMENTATION&&r!==V.CHANGE_PLAN_TEAM_PLANS&&We(n,h.searchParams),r===V.SEGMENTATION&&ge(f,h.searchParams,Lt),ge(p,h.searchParams,Lt),c===Oe.DRAFT&&ge({af:ui},h.searchParams,Lt),h.toString()}var Lt=new Set(["af","ai","apc","appctxid","cli","co","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"]),pi=["env","workflowStep","clientId","country"];function mi(e){var t,n;try{for(var r=li(pi),i=r.next();!i.done;i=r.next()){var o=i.value;if(!e[o])throw new Error('Argument "checkoutData" is not valid, missing: '+o)}}catch(s){t={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}if(e.workflowStep!==V.SEGMENTATION&&e.workflowStep!==V.CHANGE_PLAN_TEAM_PLANS&&!e.items)throw new Error('Argument "checkoutData" is not valid, missing: items');return!0}function Nt(e,t){switch(e){case ae.V2:return Ur(t);case ae.V3:return Ot(t);default:return console.warn("Unsupported CheckoutType, will use UCv3 as default. Given type: "+e),Ot(t)}}var Ct;(function(e){e.BASE="BASE",e.TRIAL="TRIAL",e.PROMOTION="PROMOTION"})(Ct||(Ct={}));var R;(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"})(R||(R={}));var O;(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"})(O||(O={}));var Rt;(function(e){e.INDIVIDUAL="INDIVIDUAL",e.TEAM="TEAM",e.ENTERPRISE="ENTERPRISE"})(Rt||(Rt={}));var It;(function(e){e.COM="COM",e.EDU="EDU",e.GOV="GOV"})(It||(It={}));var Mt;(function(e){e.DIRECT="DIRECT",e.INDIRECT="INDIRECT"})(Mt||(Mt={}));var Dt;(function(e){e.ENTERPRISE_PRODUCT="ENTERPRISE_PRODUCT",e.ETLA="ETLA",e.RETAIL="RETAIL",e.VIP="VIP",e.VIPMP="VIPMP",e.FREE="FREE"})(Dt||(Dt={}));var kr="tacocat.js";var Xe=(e,t)=>String(e??"").toLowerCase()==String(t??"").toLowerCase(),Gr=e=>`${e??""}`.replace(/[&<>'"]/g,t=>({"&":"&","<":"<",">":">","'":"'",'"':"""})[t]??t)??"";function N(e,t={},{metadata:n=!0,search:r=!0,storage:i=!0}={}){let o;if(r&&o==null){let s=new URLSearchParams(window.location.search),a=xe(r)?r:e;o=s.get(a)}if(i&&o==null){let s=xe(i)?i:e;o=window.sessionStorage.getItem(s)??window.localStorage.getItem(s)}if(n&&o==null){let s=hi(xe(n)?n:e);o=document.documentElement.querySelector(`meta[name="${s}"]`)?.content}return o??t[e]}var ye=()=>{};var Fr=e=>typeof e=="boolean",te=e=>typeof e=="function",Ye=e=>typeof e=="number",Vr=e=>e!=null&&typeof e=="object";var xe=e=>typeof e=="string",Ut=e=>xe(e)&&e,_e=e=>Ye(e)&&Number.isFinite(e)&&e>0;function Se(e,t=n=>n==null||n===""){return e!=null&&Object.entries(e).forEach(([n,r])=>{t(r)&&delete e[n]}),e}function v(e,t){if(Fr(e))return e;let n=String(e);return n==="1"||n==="true"?!0:n==="0"||n==="false"?!1:t}function re(e,t,n){let r=Object.values(t);return r.find(i=>Xe(i,e))??n??r[0]}function hi(e=""){return String(e).replace(/(\p{Lowercase_Letter})(\p{Uppercase_Letter})/gu,(t,n,r)=>`${n}-${r}`).replace(/\W+/gu,"-").toLowerCase()}function ve(e,t=1){return Ye(e)||(e=Number.parseInt(e,10)),!Number.isNaN(e)&&e>0&&Number.isFinite(e)?e:t}var di=Date.now(),kt=()=>`(+${Date.now()-di}ms)`,Be=new Set,Ei=v(N("tacocat.debug",{},{metadata:!1}),typeof process<"u"&&process.env?.DEBUG);function jr(e){let t=`[${kr}/${e}]`,n=(s,a,...l)=>s?!0:(i(a,...l),!1),r=Ei?(s,...a)=>{console.debug(`${t} ${s}`,...a,kt())}:()=>{},i=(s,...a)=>{let l=`${t} ${s}`;Be.forEach(([u])=>u(l,...a))};return{assert:n,debug:r,error:i,warn:(s,...a)=>{let l=`${t} ${s}`;Be.forEach(([,u])=>u(l,...a))}}}function gi(e,t){let n=[e,t];return Be.add(n),()=>{Be.delete(n)}}gi((e,...t)=>{console.error(e,...t,kt())},(e,...t)=>{console.warn(e,...t,kt())});var xi="no promo",Hr="promo-tag",yi="yellow",_i="neutral",Si=(e,t,n)=>{let r=o=>o||xi,i=n?` (was "${r(t)}")`:"";return`${r(e)}${i}`},vi="cancel-context",Ne=(e,t)=>{let n=e===vi,r=!n&&e?.length>0,i=(r||n)&&(t&&t!=e||!t&&!n),o=i&&r||!i&&!!t,s=o?e||t:void 0;return{effectivePromoCode:s,overridenPromoCode:e,className:o?Hr:`${Hr} no-promo`,text:Si(s,t,i),variant:o?yi:_i,isOverriden:i}};var Gt="ABM",Ft="PUF",Vt="M2M",jt="PERPETUAL",Ht="P3Y",Pi="TAX_INCLUSIVE_DETAILS",Ti="TAX_EXCLUSIVE",Wr={ABM:Gt,PUF:Ft,M2M:Vt,PERPETUAL:jt,P3Y:Ht},Ms={[Gt]:{commitment:R.YEAR,term:O.MONTHLY},[Ft]:{commitment:R.YEAR,term:O.ANNUAL},[Vt]:{commitment:R.MONTH,term:O.MONTHLY},[jt]:{commitment:R.PERPETUAL,term:void 0},[Ht]:{commitment:R.THREE_MONTHS,term:O.P3Y}},Xr="Value is not an offer",Wt=e=>{if(typeof e!="object")return Xr;let{commitment:t,term:n}=e,r=bi(t,n);return{...e,planType:r}};var bi=(e,t)=>{switch(e){case void 0:return Xr;case"":return"";case R.YEAR:return t===O.MONTHLY?Gt:t===O.ANNUAL?Ft:"";case R.MONTH:return t===O.MONTHLY?Vt:"";case R.PERPETUAL:return jt;case R.TERM_LICENSE:return t===O.P3Y?Ht:"";default:return""}};function Xt(e){let{priceDetails:t}=e,{price:n,priceWithoutDiscount:r,priceWithoutTax:i,priceWithoutDiscountAndTax:o,taxDisplay:s}=t;if(s!==Pi)return e;let a={...e,priceDetails:{...t,price:i??n,priceWithoutDiscount:o??r,taxDisplay:Ti}};return a.offerType==="TRIAL"&&a.priceDetails.price===0&&(a.priceDetails.price=a.priceDetails.priceWithoutDiscount),a}var Yt=function(e,t){return Yt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},Yt(e,t)};function Ce(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Yt(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var x=function(){return x=Object.assign||function(t){for(var n,r=1,i=arguments.length;r0}),n=[],r=0,i=t;r1)throw new RangeError("integer-width stems only accept a single optional option");i.options[0].replace(Li,function(a,l,u,c,p,f){if(l)t.minimumIntegerDigits=u.length;else{if(c&&p)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(en.test(i.stem)){t.minimumIntegerDigits=i.stem.length;continue}if(zr.test(i.stem)){if(i.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");i.stem.replace(zr,function(a,l,u,c,p,f){return u==="*"?t.minimumFractionDigits=l.length:c&&c[0]==="#"?t.maximumFractionDigits=c.length:p&&f?(t.minimumFractionDigits=p.length,t.maximumFractionDigits=p.length+f.length):(t.minimumFractionDigits=l.length,t.maximumFractionDigits=l.length),""}),i.options.length&&(t=x(x({},t),Zr(i.options[0])));continue}if(Kr.test(i.stem)){t=x(x({},t),Zr(i.stem));continue}var o=tn(i.stem);o&&(t=x(x({},t),o));var s=Oi(i.stem);s&&(t=x(x({},t),s))}return t}var qt,Ni=new RegExp("^"+$t.source+"*"),Ci=new RegExp($t.source+"*$");function g(e,t){return{start:e,end:t}}var Ri=!!String.prototype.startsWith,Ii=!!String.fromCodePoint,Mi=!!Object.fromEntries,Di=!!String.prototype.codePointAt,Ui=!!String.prototype.trimStart,ki=!!String.prototype.trimEnd,Gi=!!Number.isSafeInteger,Fi=Gi?Number.isSafeInteger:function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e&&Math.abs(e)<=9007199254740991},Zt=!0;try{nn=cn("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu"),Zt=((qt=nn.exec("a"))===null||qt===void 0?void 0:qt[0])==="a"}catch{Zt=!1}var nn,on=Ri?function(t,n,r){return t.startsWith(n,r)}:function(t,n,r){return t.slice(r,r+n.length)===n},Jt=Ii?String.fromCodePoint:function(){for(var t=[],n=0;no;){if(s=t[o++],s>1114111)throw RangeError(s+" is not a valid code point");r+=s<65536?String.fromCharCode(s):String.fromCharCode(((s-=65536)>>10)+55296,s%1024+56320)}return r},sn=Mi?Object.fromEntries:function(t){for(var n={},r=0,i=t;r=r)){var i=t.charCodeAt(n),o;return i<55296||i>56319||n+1===r||(o=t.charCodeAt(n+1))<56320||o>57343?i:(i-55296<<10)+(o-56320)+65536}},Vi=Ui?function(t){return t.trimStart()}:function(t){return t.replace(Ni,"")},ji=ki?function(t){return t.trimEnd()}:function(t){return t.replace(Ci,"")};function cn(e,t){return new RegExp(e,t)}var Qt;Zt?(zt=cn("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu"),Qt=function(t,n){var r;zt.lastIndex=n;var i=zt.exec(t);return(r=i[1])!==null&&r!==void 0?r:""}):Qt=function(t,n){for(var r=[];;){var i=an(t,n);if(i===void 0||un(i)||Xi(i))break;r.push(i),n+=i>=65536?2:1}return Jt.apply(void 0,r)};var zt,ln=function(){function e(t,n){n===void 0&&(n={}),this.message=t,this.position={offset:0,line:1,column:1},this.ignoreTag=!!n.ignoreTag,this.requiresOtherClause=!!n.requiresOtherClause,this.shouldParseSkeletons=!!n.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,n,r){for(var i=[];!this.isEOF();){var o=this.char();if(o===123){var s=this.parseArgument(t,r);if(s.err)return s;i.push(s.val)}else{if(o===125&&t>0)break;if(o===35&&(n==="plural"||n==="selectordinal")){var a=this.clonePosition();this.bump(),i.push({type:b.pound,location:g(a,this.clonePosition())})}else if(o===60&&!this.ignoreTag&&this.peek()===47){if(r)break;return this.error(E.UNMATCHED_CLOSING_TAG,g(this.clonePosition(),this.clonePosition()))}else if(o===60&&!this.ignoreTag&&Kt(this.peek()||0)){var s=this.parseTag(t,n);if(s.err)return s;i.push(s.val)}else{var s=this.parseLiteral(t,n);if(s.err)return s;i.push(s.val)}}}return{val:i,err:null}},e.prototype.parseTag=function(t,n){var r=this.clonePosition();this.bump();var i=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:b.literal,value:"<"+i+"/>",location:g(r,this.clonePosition())},err:null};if(this.bumpIf(">")){var o=this.parseMessage(t+1,n,!0);if(o.err)return o;var s=o.val,a=this.clonePosition();if(this.bumpIf("")?{val:{type:b.tag,value:i,children:s,location:g(r,this.clonePosition())},err:null}:this.error(E.INVALID_TAG,g(a,this.clonePosition())))}else return this.error(E.UNCLOSED_TAG,g(r,this.clonePosition()))}else return this.error(E.INVALID_TAG,g(r,this.clonePosition()))},e.prototype.parseTagName=function(){var t=this.offset();for(this.bump();!this.isEOF()&&Wi(this.char());)this.bump();return this.message.slice(t,this.offset())},e.prototype.parseLiteral=function(t,n){for(var r=this.clonePosition(),i="";;){var o=this.tryParseQuote(n);if(o){i+=o;continue}var s=this.tryParseUnquoted(t,n);if(s){i+=s;continue}var a=this.tryParseLeftAngleBracket();if(a){i+=a;continue}break}var l=g(r,this.clonePosition());return{val:{type:b.literal,value:i,location:l},err:null}},e.prototype.tryParseLeftAngleBracket=function(){return!this.isEOF()&&this.char()===60&&(this.ignoreTag||!Hi(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 n=[this.char()];for(this.bump();!this.isEOF();){var r=this.char();if(r===39)if(this.peek()===39)n.push(39),this.bump();else{this.bump();break}else n.push(r);this.bump()}return Jt.apply(void 0,n)},e.prototype.tryParseUnquoted=function(t,n){if(this.isEOF())return null;var r=this.char();return r===60||r===123||r===35&&(n==="plural"||n==="selectordinal")||r===125&&t>0?null:(this.bump(),Jt(r))},e.prototype.parseArgument=function(t,n){var r=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(E.EXPECT_ARGUMENT_CLOSING_BRACE,g(r,this.clonePosition()));if(this.char()===125)return this.bump(),this.error(E.EMPTY_ARGUMENT,g(r,this.clonePosition()));var i=this.parseIdentifierIfPossible().value;if(!i)return this.error(E.MALFORMED_ARGUMENT,g(r,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(E.EXPECT_ARGUMENT_CLOSING_BRACE,g(r,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:b.argument,value:i,location:g(r,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(E.EXPECT_ARGUMENT_CLOSING_BRACE,g(r,this.clonePosition())):this.parseArgumentOptions(t,n,i,r);default:return this.error(E.MALFORMED_ARGUMENT,g(r,this.clonePosition()))}},e.prototype.parseIdentifierIfPossible=function(){var t=this.clonePosition(),n=this.offset(),r=Qt(this.message,n),i=n+r.length;this.bumpTo(i);var o=this.clonePosition(),s=g(t,o);return{value:r,location:s}},e.prototype.parseArgumentOptions=function(t,n,r,i){var o,s=this.clonePosition(),a=this.parseIdentifierIfPossible().value,l=this.clonePosition();switch(a){case"":return this.error(E.EXPECT_ARGUMENT_TYPE,g(s,l));case"number":case"date":case"time":{this.bumpSpace();var u=null;if(this.bumpIf(",")){this.bumpSpace();var c=this.clonePosition(),p=this.parseSimpleArgStyleIfPossible();if(p.err)return p;var f=ji(p.val);if(f.length===0)return this.error(E.EXPECT_ARGUMENT_STYLE,g(this.clonePosition(),this.clonePosition()));var h=g(c,this.clonePosition());u={style:f,styleLocation:h}}var d=this.tryParseArgumentClose(i);if(d.err)return d;var _=g(i,this.clonePosition());if(u&&on(u?.style,"::",0)){var S=Vi(u.style.slice(2));if(a==="number"){var p=this.parseNumberSkeletonFromString(S,u.styleLocation);return p.err?p:{val:{type:b.number,value:r,location:_,style:p.val},err:null}}else{if(S.length===0)return this.error(E.EXPECT_DATE_TIME_SKELETON,_);var f={type:ce.dateTime,pattern:S,location:u.styleLocation,parsedOptions:this.shouldParseSkeletons?$r(S):{}},A=a==="date"?b.date:b.time;return{val:{type:A,value:r,location:_,style:f},err:null}}}return{val:{type:a==="number"?b.number:a==="date"?b.date:b.time,value:r,location:_,style:(o=u?.style)!==null&&o!==void 0?o:null},err:null}}case"plural":case"selectordinal":case"select":{var w=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(E.EXPECT_SELECT_ARGUMENT_OPTIONS,g(w,x({},w)));this.bumpSpace();var P=this.parseIdentifierIfPossible(),C=0;if(a!=="select"&&P.value==="offset"){if(!this.bumpIf(":"))return this.error(E.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,g(this.clonePosition(),this.clonePosition()));this.bumpSpace();var p=this.tryParseDecimalInteger(E.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,E.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);if(p.err)return p;this.bumpSpace(),P=this.parseIdentifierIfPossible(),C=p.val}var T=this.tryParsePluralOrSelectOptions(t,a,n,P);if(T.err)return T;var d=this.tryParseArgumentClose(i);if(d.err)return d;var L=g(i,this.clonePosition());return a==="select"?{val:{type:b.select,value:r,options:sn(T.val),location:L},err:null}:{val:{type:b.plural,value:r,options:sn(T.val),offset:C,pluralType:a==="plural"?"cardinal":"ordinal",location:L},err:null}}default:return this.error(E.INVALID_ARGUMENT_TYPE,g(s,l))}},e.prototype.tryParseArgumentClose=function(t){return this.isEOF()||this.char()!==125?this.error(E.EXPECT_ARGUMENT_CLOSING_BRACE,g(t,this.clonePosition())):(this.bump(),{val:!0,err:null})},e.prototype.parseSimpleArgStyleIfPossible=function(){for(var t=0,n=this.clonePosition();!this.isEOF();){var r=this.char();switch(r){case 39:{this.bump();var i=this.clonePosition();if(!this.bumpUntil("'"))return this.error(E.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,g(i,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(n.offset,this.offset()),err:null};break}default:this.bump();break}}return{val:this.message.slice(n.offset,this.offset()),err:null}},e.prototype.parseNumberSkeletonFromString=function(t,n){var r=[];try{r=Qr(t)}catch{return this.error(E.INVALID_NUMBER_SKELETON,n)}return{val:{type:ce.number,tokens:r,location:n,parsedOptions:this.shouldParseSkeletons?rn(r):{}},err:null}},e.prototype.tryParsePluralOrSelectOptions=function(t,n,r,i){for(var o,s=!1,a=[],l=new Set,u=i.value,c=i.location;;){if(u.length===0){var p=this.clonePosition();if(n!=="select"&&this.bumpIf("=")){var f=this.tryParseDecimalInteger(E.EXPECT_PLURAL_ARGUMENT_SELECTOR,E.INVALID_PLURAL_ARGUMENT_SELECTOR);if(f.err)return f;c=g(p,this.clonePosition()),u=this.message.slice(p.offset,this.offset())}else break}if(l.has(u))return this.error(n==="select"?E.DUPLICATE_SELECT_ARGUMENT_SELECTOR:E.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,c);u==="other"&&(s=!0),this.bumpSpace();var h=this.clonePosition();if(!this.bumpIf("{"))return this.error(n==="select"?E.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:E.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,g(this.clonePosition(),this.clonePosition()));var d=this.parseMessage(t+1,n,r);if(d.err)return d;var _=this.tryParseArgumentClose(h);if(_.err)return _;a.push([u,{value:d.val,location:g(h,this.clonePosition())}]),l.add(u),this.bumpSpace(),o=this.parseIdentifierIfPossible(),u=o.value,c=o.location}return a.length===0?this.error(n==="select"?E.EXPECT_SELECT_ARGUMENT_SELECTOR:E.EXPECT_PLURAL_ARGUMENT_SELECTOR,g(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!s?this.error(E.MISSING_OTHER_CLAUSE,g(this.clonePosition(),this.clonePosition())):{val:a,err:null}},e.prototype.tryParseDecimalInteger=function(t,n){var r=1,i=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(r=-1);for(var o=!1,s=0;!this.isEOF();){var a=this.char();if(a>=48&&a<=57)o=!0,s=s*10+(a-48),this.bump();else break}var l=g(i,this.clonePosition());return o?(s*=r,Fi(s)?{val:s,err:null}:this.error(n,l)):this.error(t,l)},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 n=an(this.message,t);if(n===void 0)throw Error("Offset "+t+" is at invalid UTF-16 code unit boundary");return n},e.prototype.error=function(t,n){return{val:null,err:{kind:t,message:this.message,location:n}}},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(on(this.message,t,this.offset())){for(var n=0;n=0?(this.bumpTo(r),!0):(this.bumpTo(this.message.length),!1)},e.prototype.bumpTo=function(t){if(this.offset()>t)throw Error("targetOffset "+t+" must be greater than or equal to the current offset "+this.offset());for(t=Math.min(t,this.message.length);;){var n=this.offset();if(n===t)break;if(n>t)throw Error("targetOffset "+t+" is at invalid UTF-16 code unit boundary");if(this.bump(),this.isEOF())break}},e.prototype.bumpSpace=function(){for(;!this.isEOF()&&un(this.char());)this.bump()},e.prototype.peek=function(){if(this.isEOF())return null;var t=this.char(),n=this.offset(),r=this.message.charCodeAt(n+(t>=65536?2:1));return r??null},e}();function Kt(e){return e>=97&&e<=122||e>=65&&e<=90}function Hi(e){return Kt(e)||e===47}function Wi(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 un(e){return e>=9&&e<=13||e===32||e===133||e>=8206&&e<=8207||e===8232||e===8233}function Xi(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 er(e){e.forEach(function(t){if(delete t.location,Je(t)||Qe(t))for(var n in t.options)delete t.options[n].location,er(t.options[n].value);else qe(t)&&et(t.style)||(ze(t)||Ze(t))&&Re(t.style)?delete t.style.location:Ke(t)&&er(t.children)})}function fn(e,t){t===void 0&&(t={}),t=x({shouldParseSkeletons:!0,requiresOtherClause:!0},t);var n=new ln(e,t).parse();if(n.err){var r=SyntaxError(E[n.err.kind]);throw r.location=n.err.location,r.originalMessage=n.err.message,r}return t?.captureLocation||er(n.val),n.val}function Ie(e,t){var n=t&&t.cache?t.cache:Zi,r=t&&t.serializer?t.serializer:zi,i=t&&t.strategy?t.strategy:Bi;return i(e,{cache:n,serializer:r})}function Yi(e){return e==null||typeof e=="number"||typeof e=="boolean"}function pn(e,t,n,r){var i=Yi(r)?r:n(r),o=t.get(i);return typeof o>"u"&&(o=e.call(this,r),t.set(i,o)),o}function mn(e,t,n){var r=Array.prototype.slice.call(arguments,3),i=n(r),o=t.get(i);return typeof o>"u"&&(o=e.apply(this,r),t.set(i,o)),o}function tr(e,t,n,r,i){return n.bind(t,e,r,i)}function Bi(e,t){var n=e.length===1?pn:mn;return tr(e,this,n,t.cache.create(),t.serializer)}function $i(e,t){return tr(e,this,mn,t.cache.create(),t.serializer)}function qi(e,t){return tr(e,this,pn,t.cache.create(),t.serializer)}var zi=function(){return JSON.stringify(arguments)};function rr(){this.cache=Object.create(null)}rr.prototype.get=function(e){return this.cache[e]};rr.prototype.set=function(e,t){this.cache[e]=t};var Zi={create:function(){return new rr}},tt={variadic:$i,monadic:qi};var le;(function(e){e.MISSING_VALUE="MISSING_VALUE",e.INVALID_VALUE="INVALID_VALUE",e.MISSING_INTL_API="MISSING_INTL_API"})(le||(le={}));var Me=function(e){Ce(t,e);function t(n,r,i){var o=e.call(this,n)||this;return o.code=r,o.originalMessage=i,o}return t.prototype.toString=function(){return"[formatjs Error: "+this.code+"] "+this.message},t}(Error);var nr=function(e){Ce(t,e);function t(n,r,i,o){return e.call(this,'Invalid values for "'+n+'": "'+r+'". Options are "'+Object.keys(i).join('", "')+'"',le.INVALID_VALUE,o)||this}return t}(Me);var hn=function(e){Ce(t,e);function t(n,r,i){return e.call(this,'Value for "'+n+'" must be of type '+r,le.INVALID_VALUE,i)||this}return t}(Me);var dn=function(e){Ce(t,e);function t(n,r){return e.call(this,'The intl string context variable "'+n+'" was not provided to the string "'+r+'"',le.MISSING_VALUE,r)||this}return t}(Me);var I;(function(e){e[e.literal=0]="literal",e[e.object=1]="object"})(I||(I={}));function Ji(e){return e.length<2?e:e.reduce(function(t,n){var r=t[t.length-1];return!r||r.type!==I.literal||n.type!==I.literal?t.push(n):r.value+=n.value,t},[])}function Qi(e){return typeof e=="function"}function De(e,t,n,r,i,o,s){if(e.length===1&&Bt(e[0]))return[{type:I.literal,value:e[0].value}];for(var a=[],l=0,u=e;l0?e.substring(0,n):"";let i=An(e.split("").reverse().join("")),o=r-i,s=e.substring(o,o+1),a=o+(s==="."||s===","?1:0);t.suffix=i>0?e.substring(a,r):"",t.mask=e.substring(n,a),t.maskHasNegativeSign=t.mask.charAt(0)==="-",t.maskHasPositiveSign=t.mask.charAt(0)==="+";let c=t.mask.match(ho);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 go(e,t,r){let n=!1,i={value:e};e<0&&(n=!0,i.value=-i.value),i.sign=n?"-":"",i.value=Number(i.value).toFixed(t.fraction&&t.fraction.length),i.value=Number(i.value).toString();let o=t.fraction&&t.fraction.lastIndexOf("0"),[s="0",a=""]=i.value.split(".");return(!a||a&&a.length<=o)&&(a=o<0?"":(+("0."+a)).toFixed(o+1).replace("0.","")),i.integer=s,i.fraction=a,xo(i,t),(i.result==="0"||i.result==="")&&(n=!1,i.sign=""),!n&&t.maskHasPositiveSign?i.sign="+":n&&t.maskHasPositiveSign?i.sign="-":n&&(i.sign=r&&r.enforceMaskSign&&!t.maskHasNegativeSign?"":"-"),i}function xo(e,t){e.result="";let r=t.integer.split(t.separator),n=r.join(""),i=n&&n.indexOf("0");if(i>-1)for(;e.integer.lengthMath.round(e*20)/20},ir=(e,t)=>({accept:e,round:t}),So=[ir(({divisor:e,price:t})=>t%e==0,({divisor:e,price:t})=>t/e),ir(({usePrecision:e})=>e,({divisor:e,price:t})=>Math.ceil(Math.floor(t*1e4/e)/100)/100),ir(()=>!0,({divisor:e,price:t})=>Math.ceil(Math.floor(t*100/e)/100))],or={[I.YEAR]:{[L.MONTHLY]:Fe.MONTH,[L.ANNUAL]:Fe.YEAR},[I.MONTH]:{[L.MONTHLY]:Fe.MONTH}},bo=(e,t)=>e.indexOf(`'${t}'`)===0,Po=(e,t=!0)=>{let r=e.replace(/'.*?'/,"").trim(),n=Rn(r);return!!n?t||(r=r.replace(/[,\.]0+/,n)):r=r.replace(/\s?(#.*0)(?!\s)?/,"$&"+wo(e)),r},Ao=e=>{let t=Oo(e),r=bo(e,t),n=e.replace(/'.*?'/,""),i=Nn.test(n)||Cn.test(n);return{currencySymbol:t,isCurrencyFirst:r,hasCurrencySpace:i}},In=e=>e.replace(Nn,Ln).replace(Cn,Ln),wo=e=>e.match(/#(.?)#/)?.[1]===On?_o:On,Oo=e=>e.match(/'(.*?)'/)?.[1]??"",Rn=e=>e.match(/0(.?)0/)?.[1]??"";function at({formatString:e,price:t,usePrecision:r,isIndianPrice:n=!1},i,o=s=>s){let{currencySymbol:s,isCurrencyFirst:a,hasCurrencySpace:c}=Ao(e),u=r?Rn(e):"",l=Po(e,r),p=r?2:0,f=o(t,{currencySymbol:s}),d=n?f.toLocaleString("hi-IN",{minimumFractionDigits:p,maximumFractionDigits:p}):wn(l,f),h=r?d.lastIndexOf(u):d.length,E=d.substring(0,h),b=d.substring(h+1);return{accessiblePrice:e.replace(/'.*?'/,"SYMBOL").replace(/#.*0/,d).replace(/SYMBOL/,s),currencySymbol:s,decimals:b,decimalsDelimiter:u,hasCurrencySpace:c,integer:E,isCurrencyFirst:a,recurrenceTerm:i}}var Un=e=>{let{commitment:t,term:r,usePrecision:n}=e,i=vo[r]??1;return at(e,i>1?Fe.MONTH:or[t]?.[r],(o,{currencySymbol:s})=>{let a={divisor:i,price:o,usePrecision:n},{round:c}=So.find(({accept:l})=>l(a));if(!c)throw new Error(`Missing rounding rule for: ${JSON.stringify(a)}`);return(To[s]??(l=>l))(c(a))})},Dn=({commitment:e,term:t,...r})=>at(r,or[e]?.[t]),Mn=e=>{let{commitment:t,term:r}=e;return t===I.YEAR&&r===L.MONTHLY?at(e,Fe.YEAR,n=>n*12):at(e,or[t]?.[r])};var Lo={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 {alternativePrice}",strikethroughAriaLabel:"Regularly at {strikethroughPrice}"},No=Qr("ConsonantTemplates/price"),Co=/<.+?>/g,W={container:"price",containerOptical:"price-optical",containerStrikethrough:"price-strikethrough",containerAnnual:"price-annual",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"},he={perUnitLabel:"perUnitLabel",perUnitAriaLabel:"perUnitAriaLabel",recurrenceLabel:"recurrenceLabel",recurrenceAriaLabel:"recurrenceAriaLabel",taxExclusiveLabel:"taxExclusiveLabel",taxInclusiveLabel:"taxInclusiveLabel",strikethroughAriaLabel:"strikethroughAriaLabel"},Io="TAX_EXCLUSIVE",Ro=e=>zr(e)?Object.entries(e).filter(([,t])=>Te(t)||Ze(t)||t===!0).reduce((t,[r,n])=>t+` ${r}${n===!0?"":'="'+$r(n)+'"'}`,""):"",z=(e,t,r,n=!1)=>`${n?In(t):t??""}`;function Uo(e,{accessibleLabel:t,currencySymbol:r,decimals:n,decimalsDelimiter:i,hasCurrencySpace:o,integer:s,isCurrencyFirst:a,recurrenceLabel:c,perUnitLabel:u,taxInclusivityLabel:l},p={}){let f=z(W.currencySymbol,r),d=z(W.currencySpace,o?" ":""),h="";return a&&(h+=f+d),h+=z(W.integer,s),h+=z(W.decimalsDelimiter,i),h+=z(W.decimals,n),a||(h+=d+f),h+=z(W.recurrence,c,null,!0),h+=z(W.unitType,u,null,!0),h+=z(W.taxInclusivity,l,!0),z(e,h,{...p,"aria-label":t})}var de=({displayOptical:e=!1,displayStrikethrough:t=!1,displayAnnual:r=!1}={})=>({country:n,displayFormatted:i=!0,displayRecurrence:o=!0,displayPerUnit:s=!1,displayTax:a=!1,language:c,literals:u={}}={},{commitment:l,formatString:p,price:f,priceWithoutDiscount:d,taxDisplay:h,taxTerm:E,term:b,usePrecision:N}={},P={})=>{Object.entries({country:n,formatString:p,language:c,price:f}).forEach(([ee,Pt])=>{if(Pt==null)throw new Error(`Argument "${ee}" is missing`)});let S={...Lo,...u},O=`${c.toLowerCase()}-${n.toUpperCase()}`;function y(ee,Pt){let At=S[ee];if(At==null)return"";try{return new Pn(At.replace(Co,""),O).format(Pt)}catch{return No.error("Failed to format literal:",At),""}}let C=t&&d?d:f,D=e?Un:Dn;r&&(D=Mn);let{accessiblePrice:X,recurrenceTerm:B,...R}=D({commitment:l,formatString:p,term:b,price:e?f:C,usePrecision:N,isIndianPrice:n==="IN"}),V=X,se="";if(_(o)&&B){let ee=y(he.recurrenceAriaLabel,{recurrenceTerm:B});ee&&(V+=" "+ee),se=y(he.recurrenceLabel,{recurrenceTerm:B})}let ue="";if(_(s)){ue=y(he.perUnitLabel,{perUnit:"LICENSE"});let ee=y(he.perUnitAriaLabel,{perUnit:"LICENSE"});ee&&(V+=" "+ee)}let K="";_(a)&&E&&(K=y(h===Io?he.taxExclusiveLabel:he.taxInclusiveLabel,{taxTerm:E}),K&&(V+=" "+K)),t&&(V=y(he.strikethroughAriaLabel,{strikethroughPrice:V}));let q=W.container;if(e&&(q+=" "+W.containerOptical),t&&(q+=" "+W.containerStrikethrough),r&&(q+=" "+W.containerAnnual),_(i))return Uo(q,{...R,accessibleLabel:V,recurrenceLabel:se,perUnitLabel:ue,taxInclusivityLabel:K},P);let{currencySymbol:ye,decimals:He,decimalsDelimiter:Xe,hasCurrencySpace:Ne,integer:bt,isCurrencyFirst:ui}=R,_e=[bt,Xe,He];ui?(_e.unshift(Ne?"\xA0":""),_e.unshift(ye)):(_e.push(Ne?"\xA0":""),_e.push(ye)),_e.push(se,ue,K);let fi=_e.join("");return z(q,fi,P)},kn=()=>(e,t,r)=>{let i=(e.displayOldPrice===void 0||_(e.displayOldPrice))&&t.priceWithoutDiscount&&t.priceWithoutDiscount!=t.price;return`${de()(e,t,r)}${i?" "+de({displayStrikethrough:!0})(e,t,r):""}`};var sr=de(),ar=kn(),cr=de({displayOptical:!0}),lr=de({displayStrikethrough:!0}),ur=de({displayAnnual:!0});var Do=(e,t)=>{if(!(!be(e)||!be(t)))return Math.floor((t-e)/t*100)},Gn=()=>(e,t,r)=>{let{price:n,priceWithoutDiscount:i}=t,o=Do(n,i);return o===void 0?'':`${o}%`};var fr=Gn();var pr="ABM",mr="PUF",hr="M2M",dr="PERPETUAL",Fn="P3Y",Mo="TAX_INCLUSIVE_DETAILS",ko="TAX_EXCLUSIVE",Vn={ABM:pr,PUF:mr,M2M:hr,PERPETUAL:dr,P3Y:Fn},uc={[pr]:{commitment:I.YEAR,term:L.MONTHLY},[mr]:{commitment:I.YEAR,term:L.ANNUAL},[hr]:{commitment:I.MONTH,term:L.MONTHLY},[dr]:{commitment:I.PERPETUAL,term:void 0},[Fn]:{commitment:I.THREE_MONTHS,term:L.P3Y}},jn="Value is not an offer",Er=e=>{if(typeof e!="object")return jn;let{commitment:t,term:r}=e,n=Go(t,r);return{...e,planType:n}};var Go=(e,t)=>{if(e===void 0)return jn;if(e===""&&t==="")return"";let r="";return e===I.YEAR?t===L.MONTHLY?r=pr:t===L.ANNUAL&&(r=mr):e===I.MONTH?t===L.MONTHLY&&(r=hr):e===I.PERPETUAL&&(r=dr),r};function gr(e){let{priceDetails:t}=e,{price:r,priceWithoutDiscount:n,priceWithoutTax:i,priceWithoutDiscountAndTax:o,taxDisplay:s}=t;if(s!==Mo)return e;let a={...e,priceDetails:{...t,price:i??r,priceWithoutDiscount:o??n,taxDisplay:ko}};return a.offerType==="TRIAL"&&a.priceDetails.price===0&&(a.priceDetails.price=a.priceDetails.priceWithoutDiscount),a}var{freeze:Ee}=Object,ne=Ee({...fe}),ie=Ee({...$}),H=Ee({...Y}),Wn=Ee({...I}),Ve=Ee({...Ie}),Hn=Ee({...Vn}),Xn=Ee({...L});var br={};mi(br,{CLASS_NAME_FAILED:()=>ct,CLASS_NAME_PENDING:()=>lt,CLASS_NAME_RESOLVED:()=>ut,ERROR_MESSAGE_BAD_REQUEST:()=>xr,ERROR_MESSAGE_MISSING_LITERALS_URL:()=>_r,ERROR_MESSAGE_OFFER_NOT_FOUND:()=>yr,EVENT_TYPE_ERROR:()=>Fo,EVENT_TYPE_FAILED:()=>ft,EVENT_TYPE_PENDING:()=>pt,EVENT_TYPE_READY:()=>ge,EVENT_TYPE_RESOLVED:()=>mt,LOG_NAMESPACE:()=>vr,PARAM_AOS_API_KEY:()=>Vo,PARAM_ENV:()=>Tr,PARAM_LANDSCAPE:()=>Sr,PARAM_WCS_API_KEY:()=>jo,STATE_FAILED:()=>Z,STATE_PENDING:()=>Q,STATE_RESOLVED:()=>J,TAG_NAME_SERVICE:()=>ce});var ct="placeholder-failed",lt="placeholder-pending",ut="placeholder-resolved",xr="Bad WCS request",yr="Commerce offer not found",_r="Literals URL not provided",Fo="wcms:commerce:error",ft="wcms:placeholder:failed",pt="wcms:placeholder:pending",ge="wcms:commerce:ready",mt="wcms:placeholder:resolved",vr="wcms/commerce",Tr="commerce.env",Sr="commerce.landscape",Vo="commerce.aosKey",jo="commerce.wcsKey",Z="failed",Q="pending",J="resolved",ce="wcms-commerce";var Pr={clientId:"merch-at-scale",delimiter:"\xB6",ignoredProperties:["analytics","literals"],serializableTypes:["Array","Object"],sampleRate:30,tags:"consumer=milo/commerce"},Bn=new Set,Wo=e=>e instanceof Error||typeof e.originatingRequest=="string";function Yn(e){if(e==null)return;let t=typeof e;if(t==="function"){let{name:r}=e;return r?`${t} ${r}`:t}if(t==="object"){if(e instanceof Error)return e.message;if(typeof e.originatingRequest=="string"){let{message:n,originatingRequest:i,status:o}=e;return[n,o,i].filter(s=>s).join(" ")}let r=e[Symbol.toStringTag]??Object.getPrototypeOf(e).constructor.name;if(!Pr.serializableTypes.includes(r))return r}return e}function Ho(e,t){if(!Pr.ignoredProperties.includes(e))return Yn(t)}var Ar={append(e){let{delimiter:t,sampleRate:r,tags:n,clientId:i}=Pr,{message:o,params:s}=e,a=[],c=o,u=[];s.forEach(f=>{f!=null&&(Wo(f)?a:u).push(f)}),a.length&&(c+=" ",c+=a.map(Yn).join(" "));let{pathname:l,search:p}=window.location;c+=`${t}page=`,c+=l+p,u.length&&(c+=`${t}facts=`,c+=JSON.stringify(u,Ho)),Bn.has(c)||(Bn.add(c),window.lana?.log(c,{sampleRate:r,tags:n,clientId:i}))}};var T=Object.freeze({checkoutClientId:"adobe_com",checkoutWorkflow:ne.V3,checkoutWorkflowStep:ie.EMAIL,country:"US",displayOldPrice:!0,displayPerUnit:!1,displayRecurrence:!0,displayTax:!1,domainSwitch:!1,env:H.PRODUCTION,forceTaxExclusive:!1,language:"en",entitlement:!1,extraOptions:{},modal:!1,promotionCode:"",quantity:1,wcsApiKey:"wcms-commerce-ims-ro-user-milo",wcsBufferDelay:1,wcsEnv:Ve.PRODUCTION,landscape:j.PUBLISHED,wcsBufferLimit:1});function $n(e,{once:t=!1}={}){let r=null;function n(){let i=document.querySelector(ce);i!==r&&(r=i,i&&e(i))}return document.addEventListener(ge,n,{once:t}),le(n),()=>document.removeEventListener(ge,n)}function je(e,{country:t,forceTaxExclusive:r,perpetual:n}){let i;if(e.length<2)i=e;else{let o=t==="GB"||n?"EN":"MULT",[s,a]=e;i=[s.language===o?s:a]}return r&&(i=i.map(gr)),i}var le=e=>window.setTimeout(e);function we(e,t=1){if(e==null)return[t];let r=(Array.isArray(e)?e:String(e).split(",")).map(Ae).filter(be);return r.length||(r=[t]),r}function ht(e){return e==null?[]:(Array.isArray(e)?e:String(e).split(",")).filter(Wt)}function G(){return window.customElements.get(ce)?.instance}var Xo="en_US",m={ar:"AR_es",be_en:"BE_en",be_fr:"BE_fr",be_nl:"BE_nl",br:"BR_pt",ca:"CA_en",ch_de:"CH_de",ch_fr:"CH_fr",ch_it:"CH_it",cl:"CL_es",co:"CO_es",la:"DO_es",mx:"MX_es",pe:"PE_es",africa:"MU_en",dk:"DK_da",de:"DE_de",ee:"EE_et",eg_ar:"EG_ar",eg_en:"EG_en",es:"ES_es",fr:"FR_fr",gr_el:"GR_el",gr_en:"GR_en",ie:"IE_en",il_he:"IL_iw",it:"IT_it",lv:"LV_lv",lt:"LT_lt",lu_de:"LU_de",lu_en:"LU_en",lu_fr:"LU_fr",my_en:"MY_en",my_ms:"MY_ms",hu:"HU_hu",mt:"MT_en",mena_en:"DZ_en",mena_ar:"DZ_ar",nl:"NL_nl",no:"NO_nb",pl:"PL_pl",pt:"PT_pt",ro:"RO_ro",si:"SI_sl",sk:"SK_sk",fi:"FI_fi",se:"SE_sv",tr:"TR_tr",uk:"GB_en",at:"AT_de",cz:"CZ_cs",bg:"BG_bg",ru:"RU_ru",ua:"UA_uk",au:"AU_en",in_en:"IN_en",in_hi:"IN_hi",id_en:"ID_en",id_id:"ID_in",nz:"NZ_en",sa_ar:"SA_ar",sa_en:"SA_en",sg:"SG_en",cn:"CN_zh-Hans",tw:"TW_zh-Hant",hk_zh:"HK_zh-hant",jp:"JP_ja",kr:"KR_ko",za:"ZA_en",ng:"NG_en",cr:"CR_es",ec:"EC_es",pr:"US_es",gt:"GT_es",cis_en:"AZ_en",cis_ru:"AZ_ru",sea:"SG_en",th_en:"TH_en",th_th:"TH_th"},oe=Object.freeze({LOCAL:"local",PROD:"prod",STAGE:"stage"});function Bo({locale:e={}}={}){if(!e.prefix)return{country:T.country,language:T.language,locale:Xo};let t=e.prefix.replace("/","")??"",[r=T.country,n=T.language]=(m[t]??t).split("_",2);return r=r.toUpperCase(),n=n.toLowerCase(),{country:r,language:n,locale:`${n}_${r}`}}function qn(e={}){let{commerce:t={},locale:r=void 0}=e,i=(e.env?.name===oe.PROD?oe.PROD:re(w(Tr,t,{metadata:!1}),oe,oe.PROD))===oe.STAGE?H.STAGE:H.PRODUCTION,o=w("checkoutClientId",t)??T.checkoutClientId,s=re(w("checkoutWorkflow",t),ne,T.checkoutWorkflow),a=ie.CHECKOUT;s===ne.V3&&(a=re(w("checkoutWorkflowStep",t),ie,T.checkoutWorkflowStep));let c=_(w("displayOldPrice",t),T.displayOldPrice),u=_(w("displayPerUnit",t),T.displayPerUnit),l=_(w("displayRecurrence",t),T.displayRecurrence),p=_(w("displayTax",t),T.displayTax),f=_(w("entitlement",t),T.entitlement),d=_(w("modal",t),T.modal),h=_(w("forceTaxExclusive",t),T.forceTaxExclusive),E=w("promotionCode",t)??T.promotionCode,b=we(w("quantity",t)),N=w("wcsApiKey",t)??T.wcsApiKey,P=e.env?.name===oe.PROD?j.PUBLISHED:re(w(Sr,t),j,T.landscape),S=Ae(w("wcsBufferDelay",t),T.wcsBufferDelay),O=Ae(w("wcsBufferLimit",t),T.wcsBufferLimit),y=_(w("domain.switch",t),!1);return{...Bo({locale:r}),displayOldPrice:c,checkoutClientId:o,checkoutWorkflow:s,checkoutWorkflowStep:a,displayPerUnit:u,displayRecurrence:l,displayTax:p,entitlement:f,extraOptions:T.extraOptions,modal:d,env:i,forceTaxExclusive:h,priceLiteralsURL:t.priceLiteralsURL,priceLiteralsPromise:t.priceLiteralsPromise,promotionCode:E,quantity:b,wcsApiKey:N,wcsBufferDelay:S,wcsBufferLimit:O,wcsEnv:i===H.STAGE?Ve.STAGE:Ve.PRODUCTION,landscape:P,domainSwitch:y}}var Zn="debug",Yo="error",$o="info",qo="warn",zo=Date.now(),wr=new Set,Or=new Set,zn=new Map,We=Object.freeze({DEBUG:Zn,ERROR:Yo,INFO:$o,WARN:qo}),Qn={append({level:e,message:t,params:r,timestamp:n,source:i}){console[e](`${n}ms [${i}] %c${t}`,"font-weight: bold;",...r)}},Jn={filter:({level:e})=>e!==Zn},Zo={filter:()=>!1};function Qo(e,t,r,n,i){return{level:e,message:t,namespace:r,get params(){if(n.length===1){let[o]=n;ae(o)&&(n=o(),Array.isArray(n)||(n=[n]))}return n},source:i,timestamp:Date.now()-zo}}function Jo(e){[...Or].every(t=>t(e))&&wr.forEach(t=>t(e))}function Kn(e){let t=(zn.get(e)??0)+1;zn.set(e,t);let r=`${e} #${t}`,n=o=>(s,...a)=>Jo(Qo(o,s,e,a,r)),i=Object.seal({id:r,namespace:e,module(o){return Kn(`${i.namespace}/${o}`)},debug:n(We.DEBUG),error:n(We.ERROR),info:n(We.INFO),warn:n(We.WARN)});return i}function dt(...e){e.forEach(t=>{let{append:r,filter:n}=t;ae(n)?Or.add(n):ae(r)&&wr.add(r)})}function Ko(e={}){let{name:t}=e,r=_(w("commerce.debug",{search:!0,storage:!0}),t===oe.LOCAL);return dt(r?Qn:Jn),t===oe.PROD&&dt(Ar),M}function es(){wr.clear(),Or.clear()}var M={...Kn(vr),Level:We,Plugins:{consoleAppender:Qn,debugFilter:Jn,quietFilter:Zo,lanaAppender:Ar},init:Ko,reset:es,use:dt};var ts={CLASS_NAME_FAILED:ct,CLASS_NAME_PENDING:lt,CLASS_NAME_RESOLVED:ut,EVENT_TYPE_FAILED:ft,EVENT_TYPE_PENDING:pt,EVENT_TYPE_RESOLVED:mt,STATE_FAILED:Z,STATE_PENDING:Q,STATE_RESOLVED:J},rs={[Z]:ct,[Q]:lt,[J]:ut},ns={[Z]:ft,[Q]:pt,[J]:mt},xt=new WeakMap;function F(e){if(!xt.has(e)){let t=M.module(e.constructor.is);xt.set(e,{changes:new Map,connected:!1,dispose:Se,error:void 0,log:t,options:void 0,promises:[],state:Q,timer:null,value:void 0,version:0})}return xt.get(e)}function Et(e){let t=F(e),{error:r,promises:n,state:i}=t;(i===J||i===Z)&&(t.promises=[],i===J?n.forEach(({resolve:o})=>o(e)):i===Z&&n.forEach(({reject:o})=>o(r))),e.dispatchEvent(new CustomEvent(ns[i],{bubbles:!0}))}function gt(e){let t=xt.get(e);[Z,Q,J].forEach(r=>{e.classList.toggle(rs[r],r===t.state)})}var is={get error(){return F(this).error},get log(){return F(this).log},get options(){return F(this).options},get state(){return F(this).state},get value(){return F(this).value},attributeChangedCallback(e,t,r){F(this).changes.set(e,r),this.requestUpdate()},connectedCallback(){F(this).dispose=$n(()=>this.requestUpdate(!0))},disconnectedCallback(){let e=F(this);e.connected&&(e.connected=!1,e.log.debug("Disconnected:",{element:this})),e.dispose(),e.dispose=Se},onceSettled(){let{error:e,promises:t,state:r}=F(this);return J===r?Promise.resolve(this):Z===r?Promise.reject(e):new Promise((n,i)=>{t.push({resolve:n,reject:i})})},toggleResolved(e,t,r){let n=F(this);return e!==n.version?!1:(r!==void 0&&(n.options=r),n.state=J,n.value=t,gt(this),this.log.debug("Resolved:",{element:this,value:t}),le(()=>Et(this)),!0)},toggleFailed(e,t,r){let n=F(this);return e!==n.version?!1:(r!==void 0&&(n.options=r),n.error=t,n.state=Z,gt(this),n.log.error("Failed:",{element:this,error:t}),le(()=>Et(this)),!0)},togglePending(e){let t=F(this);return t.version++,e&&(t.options=e),t.state=Q,gt(this),le(()=>Et(this)),t.version},requestUpdate(e=!1){if(!this.isConnected||!G())return;let t=F(this);if(t.timer)return;let{error:r,options:n,state:i,value:o,version:s}=t;t.state=Q,t.timer=le(async()=>{t.timer=null;let a=null;if(t.changes.size&&(a=Object.fromEntries(t.changes.entries()),t.changes.clear()),t.connected?t.log.debug("Updated:",{element:this,changes:a}):(t.connected=!0,t.log.debug("Connected:",{element:this,changes:a})),a||e)try{await this.render?.()===!1&&t.state===Q&&t.version===s&&(t.state=i,t.error=r,t.value=o,gt(this),Et(this))}catch(c){this.toggleFailed(t.version,c,n)}})}};function ei(e={}){return Object.entries(e).forEach(([t,r])=>{(r==null||r===""||r?.length===0)&&delete e[t]}),e}function yt(e,t={}){let{tag:r,is:n}=e,i=document.createElement(r,{is:n});return i.setAttribute("is",n),Object.assign(i.dataset,ei(t)),i}function _t(e){let{tag:t,is:r,prototype:n}=e,i=window.customElements.get(r);return i||(Object.defineProperties(n,Object.getOwnPropertyDescriptors(is)),i=Object.defineProperties(e,Object.getOwnPropertyDescriptors(ts)),window.customElements.define(r,i,{extends:t})),i}function vt(e,t=document.body){return Array.from(t?.querySelectorAll(`${e.tag}[is="${e.is}"]`)??[])}function Tt(e,t={}){return e instanceof HTMLElement?(Object.assign(e.dataset,ei(t)),e):null}var os="download",ss="upgrade",xe,Oe=class Oe extends HTMLAnchorElement{constructor(){super();Gr(this,xe);this.addEventListener("click",this.clickHandler)}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"]}static createCheckoutLink(r={},n=""){let i=G();if(!i)return null;let{checkoutMarketSegment:o,checkoutWorkflow:s,checkoutWorkflowStep:a,entitlement:c,upgrade:u,modal:l,perpetual:p,promotionCode:f,quantity:d,wcsOsi:h,extraOptions:E}=i.collectCheckoutOptions(r),b=yt(Oe,{checkoutMarketSegment:o,checkoutWorkflow:s,checkoutWorkflowStep:a,entitlement:c,upgrade:u,modal:l,perpetual:p,promotionCode:f,quantity:d,wcsOsi:h,extraOptions:E});return n&&(b.innerHTML=`${n}`),b}static getCheckoutLinks(r){return vt(Oe,r)}get isCheckoutLink(){return!0}get placeholder(){return this}clickHandler(r){var n;(n=wt(this,xe))==null||n.call(this,r)}async render(r={}){if(!this.isConnected)return!1;let n=G();if(!n)return!1;this.dataset.imsCountry||n.imsCountryPromise.then(l=>{l&&(this.dataset.imsCountry=l)},Se);let i=n.collectCheckoutOptions(r,this.placeholder);if(!i.wcsOsi.length)return!1;let o;try{o=JSON.parse(i.extraOptions??"{}")}catch(l){this.placeholder.log.error("cannot parse exta checkout options",l)}let s=this.placeholder.togglePending(i);this.href="";let a=n.resolveOfferSelectors(i),c=await Promise.all(a);c=c.map(l=>je(l,i));let u=await n.buildCheckoutAction(c.flat(),{...o,...i});return this.renderOffers(c.flat(),i,{},u,s)}renderOffers(r,n,i={},o=void 0,s=void 0){if(!this.isConnected)return!1;let a=G();if(!a)return!1;if(n={...JSON.parse(this.placeholder.dataset.extraOptions??"null"),...n,...i},s??(s=this.placeholder.togglePending(n)),wt(this,xe)&&Ot(this,xe,void 0),o){this.classList.remove(os,ss),this.placeholder.toggleResolved(s,r,n);let{url:u,text:l,className:p,handler:f}=o;return u&&(this.href=u),l&&(this.firstElementChild.innerHTML=l),p&&this.classList.add(...p.split(" ")),f&&(this.setAttribute("href","#"),Ot(this,xe,f.bind(this))),!0}else if(r.length){if(this.placeholder.toggleResolved(s,r,n)){let u=a.buildCheckoutURL(r,n);return this.setAttribute("href",u),!0}}else{let u=new Error(`Not provided: ${n?.wcsOsi??"-"}`);if(this.placeholder.toggleFailed(s,u,n))return this.setAttribute("href","#"),!0}return!1}updateOptions(r={}){let n=G();if(!n)return!1;let{checkoutMarketSegment:i,checkoutWorkflow:o,checkoutWorkflowStep:s,entitlement:a,upgrade:c,modal:u,perpetual:l,promotionCode:p,quantity:f,wcsOsi:d}=n.collectCheckoutOptions(r);return Tt(this,{checkoutMarketSegment:i,checkoutWorkflow:o,checkoutWorkflowStep:s,entitlement:a,upgrade:c,modal:u,perpetual:l,promotionCode:p,quantity:f,wcsOsi:d}),!0}};xe=new WeakMap,te(Oe,"is","checkout-link"),te(Oe,"tag","a");var Lr=Oe,Nr=_t(Lr);var ti=[m.uk,m.au,m.fr,m.at,m.be_en,m.be_fr,m.be_nl,m.bg,m.ch_de,m.ch_fr,m.ch_it,m.cz,m.de,m.dk,m.ee,m.eg_ar,m.eg_en,m.es,m.fi,m.fr,m.gr_el,m.gr_en,m.hu,m.ie,m.it,m.lu_de,m.lu_en,m.lu_fr,m.nl,m.no,m.pl,m.pt,m.ro,m.se,m.si,m.sk,m.tr,m.ua,m.id_en,m.id_id,m.in_en,m.in_hi,m.jp,m.my_en,m.my_ms,m.nz,m.th_en,m.th_th],as={INDIVIDUAL_COM:[m.za,m.lt,m.lv,m.ng,m.sa_ar,m.sa_en,m.za,m.sg,m.kr],TEAM_COM:[m.za,m.lt,m.lv,m.ng,m.za,m.co,m.kr],INDIVIDUAL_EDU:[m.lt,m.lv,m.sa_en,m.sea],TEAM_EDU:[m.sea,m.kr]},Le=class Le extends HTMLSpanElement{static get observedAttributes(){return["data-display-old-price","data-display-per-unit","data-display-recurrence","data-display-tax","data-perpetual","data-promotion-code","data-tax-exclusive","data-template","data-wcs-osi"]}static createInlinePrice(t){let r=G();if(!r)return null;let{displayOldPrice:n,displayPerUnit:i,displayRecurrence:o,displayTax:s,forceTaxExclusive:a,perpetual:c,promotionCode:u,quantity:l,template:p,wcsOsi:f}=r.collectPriceOptions(t);return yt(Le,{displayOldPrice:n,displayPerUnit:i,displayRecurrence:o,displayTax:s,forceTaxExclusive:a,perpetual:c,promotionCode:u,quantity:l,template:p,wcsOsi:f})}static getInlinePrices(t){return vt(Le,t)}get isInlinePrice(){return!0}get placeholder(){return this}resolveDisplayTaxForGeoAndSegment(t,r,n,i){let o=`${t}_${r}`;if(ti.includes(t)||ti.includes(o))return!0;let s=as[`${n}_${i}`];return s?!!(s.includes(t)||s.includes(o)):!1}async resolveDisplayTax(t,r){let[n]=await t.resolveOfferSelectors(r),i=je(await n,r);if(i?.length){let{country:o,language:s}=r,a=i[0],[c=""]=a.marketSegments;return this.resolveDisplayTaxForGeoAndSegment(o,s,a.customerSegment,c)}}async render(t={}){if(!this.isConnected)return!1;let r=G();if(!r)return!1;let n=r.collectPriceOptions(t,this.placeholder);if(!n.wcsOsi.length)return!1;let i=this.placeholder.togglePending(n);this.innerHTML="";let[o]=r.resolveOfferSelectors(n);return this.renderOffers(je(await o,n),n,i)}renderOffers(t,r={},n=void 0){if(!this.isConnected)return;let i=G();if(!i)return!1;let o=i.collectPriceOptions({...this.dataset,...r});if(n??(n=this.placeholder.togglePending(o)),t.length){if(this.placeholder.toggleResolved(n,t,o))return this.innerHTML=i.buildPriceHTML(t,o),!0}else{let s=new Error(`Not provided: ${o?.wcsOsi??"-"}`);if(this.placeholder.toggleFailed(n,s,o))return this.innerHTML="",!0}return!1}updateOptions(t){let r=G();if(!r)return!1;let{displayOldPrice:n,displayPerUnit:i,displayRecurrence:o,displayTax:s,forceTaxExclusive:a,perpetual:c,promotionCode:u,quantity:l,template:p,wcsOsi:f}=r.collectPriceOptions(t);return Tt(this,{displayOldPrice:n,displayPerUnit:i,displayRecurrence:o,displayTax:s,forceTaxExclusive:a,perpetual:c,promotionCode:u,quantity:l,template:p,wcsOsi:f}),!0}};te(Le,"is","inline-price"),te(Le,"tag","span");var Cr=Le,Ir=_t(Cr);function ri({providers:e,settings:t},r){let n=M.module("checkout");function i(u,l){let{checkoutClientId:p,checkoutWorkflow:f,checkoutWorkflowStep:d,country:h,language:E,promotionCode:b,quantity:N}=t,{checkoutMarketSegment:P,checkoutWorkflow:S=f,checkoutWorkflowStep:O=d,imsCountry:y,country:C=y??h,language:D=E,quantity:X=N,entitlement:B,upgrade:R,modal:V,perpetual:se,promotionCode:ue=b,wcsOsi:K,extraOptions:q,...ye}=Object.assign({},l?.dataset??{},u??{}),He=re(S,ne,T.checkoutWorkflow),Xe=ie.CHECKOUT;He===ne.V3&&(Xe=re(O,ie,T.checkoutWorkflowStep));let Ne=Pe({...ye,extraOptions:q,checkoutClientId:p,checkoutMarketSegment:P,country:C,quantity:we(X,T.quantity),checkoutWorkflow:He,checkoutWorkflowStep:Xe,language:D,entitlement:_(B),upgrade:_(R),modal:_(V),perpetual:_(se),promotionCode:Re(ue).effectivePromoCode,wcsOsi:ht(K)});if(l)for(let bt of e.checkout)bt(l,Ne);return Ne}async function o(u,l){let p=G(),f=await r.getCheckoutAction?.(u,l,p.imsSignedInPromise);return f||null}function s(u,l){if(!Array.isArray(u)||!u.length||!l)return"";let{env:p,landscape:f}=t,{checkoutClientId:d,checkoutMarketSegment:h,checkoutWorkflow:E,checkoutWorkflowStep:b,country:N,promotionCode:P,quantity:S,...O}=i(l),y=window.frameElement?"if":"fp",C={checkoutPromoCode:P,clientId:d,context:y,country:N,env:p,items:[],marketSegment:h,workflowStep:b,landscape:f,...O};if(u.length===1){let[{offerId:D,offerType:X,productArrangementCode:B}]=u,{marketSegments:[R]}=u[0];Object.assign(C,{marketSegment:R,offerType:X,productArrangementCode:B}),C.items.push(S[0]===1?{id:D}:{id:D,quantity:S[0]})}else C.items.push(...u.map(({offerId:D},X)=>({id:D,quantity:S[X]??T.quantity})));return Ut(E,C)}let{createCheckoutLink:a,getCheckoutLinks:c}=Nr;return{CheckoutLink:Nr,CheckoutWorkflow:ne,CheckoutWorkflowStep:ie,buildCheckoutAction:o,buildCheckoutURL:s,collectCheckoutOptions:i,createCheckoutLink:a,getCheckoutLinks:c}}function cs({interval:e=200,maxAttempts:t=25}={}){let r=M.module("ims");return new Promise(n=>{r.debug("Waing for IMS to be ready");let i=0;function o(){window.adobeIMS?.initialized?n():++i>t?(r.debug("Timeout"),n()):setTimeout(o,e)}o()})}function ls(e){return e.then(()=>window.adobeIMS?.isSignedInUser()??!1)}function us(e){let t=M.module("ims");return e.then(r=>r?window.adobeIMS.getProfile().then(({countryCode:n})=>(t.debug("Got user country:",n),n),n=>{t.error("Unable to get user country:",n)}):null)}function ni({}){let e=cs(),t=ls(e),r=us(t);return{imsReadyPromise:e,imsSignedInPromise:t,imsCountryPromise:r}}function fs(e){if(!e.priceLiteralsURL)throw new Error(_r);return new Promise(t=>{window.fetch(e.priceLiteralsURL).then(r=>{r.json().then(({data:n})=>{t(n)})})})}async function ii(e){let r=await(e.priceLiteralsPromise||fs(e));if(Array.isArray(r)){let n=o=>r.find(s=>ze(s.lang,o)),i=n(e.language)??n(T.language);if(i)return Object.freeze(i)}return{}}function oi({literals:e,providers:t,settings:r}){function n(a,c){let{country:u,displayOldPrice:l,displayPerUnit:p,displayRecurrence:f,displayTax:d,forceTaxExclusive:h,language:E,promotionCode:b,quantity:N}=r,{displayOldPrice:P=l,displayPerUnit:S=p,displayRecurrence:O=f,displayTax:y=d,forceTaxExclusive:C=h,country:D=u,language:X=E,perpetual:B,promotionCode:R=b,quantity:V=N,template:se,wcsOsi:ue,...K}=Object.assign({},c?.dataset??{},a??{}),q=Pe({...K,country:D,displayOldPrice:_(P),displayPerUnit:_(S),displayRecurrence:_(O),displayTax:_(y),forceTaxExclusive:_(C),language:X,perpetual:_(B),promotionCode:Re(R).effectivePromoCode,quantity:we(V,T.quantity),template:se,wcsOsi:ht(ue)});if(c)for(let ye of t.price)ye(c,q);return q}function i(a,c){if(!Array.isArray(a)||!a.length||!c)return"";let{template:u}=c,l;switch(u){case"discount":l=fr;break;case"strikethrough":l=lr;break;case"optical":l=cr;break;case"annual":l=ur;break;default:l=c.promotionCode?ar:sr}let p=n(c);p.literals=Object.assign({},e.price,Pe(c.literals??{}));let[f]=a;return f={...f,...f.priceDetails},l(p,f)}let{createInlinePrice:o,getInlinePrices:s}=Ir;return{InlinePrice:Ir,buildPriceHTML:i,collectPriceOptions:n,createInlinePrice:o,getInlinePrices:s}}var Rr="_acom",si={[H.PRODUCTION]:"https://www.adobe.com",[H.STAGE]:"https://www.stage.adobe.com",[H.PRODUCTION+Rr]:"https://www.adobe.com",[H.STAGE+Rr]:"https://www.stage.adobe.com"};function ai({settings:e}){let t=M.module("wcs"),{env:r,domainSwitch:n,wcsApiKey:i}=e,o=n?si[r+Rr]:si[r],s={apiKey:i,baseUrl:o,fetch:window.fetch.bind(window)},a=qe(s),c=new Map,u=new Map,l;async function p(h,E,b=!0){let N=yr;try{t.debug("Fetching:",h),h.offerSelectorIds=h.offerSelectorIds.sort();let{data:P}=await a(h,{apiKey:i,environment:e.wcsEnv,landscape:r===H.STAGE?"ALL":e.landscape},({resolvedOffers:O})=>({offers:O.map(Er)}));t.debug("Fetched:",h,P);let{offers:S}=P??{};E.forEach(({resolve:O},y)=>{let C=S.filter(({offerSelectorIds:D})=>D.includes(y)).flat();C.length&&(E.delete(y),O(C))})}catch(P){P.status===404&&h.offerSelectorIds.length>1?(t.debug("Multi-osi 404, fallback to fetch-by-one strategy"),await Promise.allSettled(h.offerSelectorIds.map(S=>p({...h,offerSelectorIds:[S]},E,!1)))):(t.error("Failed:",h,P),N=xr)}b&&E.size&&(t.debug("Missing:",{offerSelectorIds:[...E.keys()]}),E.forEach(P=>{P.reject(new Error(N))}))}function f(){clearTimeout(l);let h=[...u.values()];u.clear(),h.forEach(({options:E,promises:b})=>p(E,b))}function d({country:h,language:E,perpetual:b=!1,promotionCode:N="",wcsOsi:P=[]}){let S=`${E}_${h}`;h!=="GB"&&(E=b?"EN":"MULT");let O=[h,E,N].filter(y=>y).join("-").toLowerCase();return P.map(y=>{let C=`${y}-${O}`;if(!c.has(C)){let D=new Promise((X,B)=>{let R=u.get(O);if(!R){let V={country:h,locale:S,offerSelectorIds:[]};h!=="GB"&&(V.language=E),R={options:V,promises:new Map},u.set(O,R)}N&&(R.options.promotionCode=N),R.options.offerSelectorIds.push(y),R.promises.set(y,{resolve:X,reject:B}),R.options.offerSelectorIds.length>=e.wcsBufferLimit?f():(t.debug("Queued:",R.options),l||(l=setTimeout(f,e.wcsBufferDelay)))});c.set(C,D)}return c.get(C)})}return{WcsCommitment:Wn,WcsPlanType:Hn,WcsTerm:Xn,resolveOfferSelectors:d}}var k=class extends HTMLElement{get isWcmsCommerce(){return!0}};te(k,"instance"),te(k,"promise",null);window.customElements.define(ce,k);async function ps(e,t){let r=M.init(e.env).module("service");r.debug("Activating:",e);let n={price:{}},i=Object.freeze(qn(e));try{n.price=await ii(i)}catch(c){r.warn("Price literals were not fetched:",c)}let o={checkout:new Set,price:new Set},s=document.createElement(ce),a={literals:n,providers:o,settings:i};return k.instance=Object.defineProperties(s,Object.getOwnPropertyDescriptors({...ri(a,t),...ni(a),...oi(a),...ai(a),...br,Log:M,get defaults(){return T},get literals(){return n},get log(){return M},get providers(){return{checkout(c){return o.checkout.add(c),()=>o.checkout.delete(c)},price(c){return o.price.add(c),()=>o.price.delete(c)}}},get settings(){return i}})),r.debug("Activated:",{literals:n,settings:i,element:s}),document.head.append(s),le(()=>{let c=new CustomEvent(ge,{bubbles:!0,cancelable:!1,detail:k.instance});k.instance.dispatchEvent(c)}),k.instance}function ci(){document.head.querySelector(ce)?.remove(),k.promise=null,M.reset()}function Ur(e,t){if(ae(e)){let r=ae(t)?t():{};return r.force&&ci(),k.promise??(k.promise=ps(e(),r))}return k.promise?k.promise:new Promise(r=>{let n=i=>{r(i.detail)};document.head.addEventListener(ge,n,{once:!0})})}var{origin:ms,searchParams:St}=new URL(import.meta.url),hs=St.get("locale")??"US_en",Dl=St.get("lang")??"en",li=St.get("env")==="stage",ds=St.get("features"),Es=li?"stage":"prod",gs=li?"STAGE":"PROD",xs=()=>({env:{name:Es},commerce:{"commerce.env":gs},locale:{prefix:hs}});Ur(xs);ds.includes("merch-card")&&import(`${ms}/libs/deps/merch-card-all.js`); +`,le.MISSING_INTL_API,s);var C=n.getPluralRules(t,{type:c.pluralType}).select(f-(c.offset||0));P=c.options[C]||c.options.other}if(!P)throw new nr(c.value,f,Object.keys(c.options),s);a.push.apply(a,De(P.value,t,n,r,i,f-(c.offset||0)));continue}}return Ji(a)}function Ki(e,t){return t?x(x(x({},e||{}),t||{}),Object.keys(e).reduce(function(n,r){return n[r]=x(x({},e[r]),t[r]||{}),n},{})):e}function eo(e,t){return t?Object.keys(e).reduce(function(n,r){return n[r]=Ki(e[r],t[r]),n},x({},e)):e}function ir(e){return{create:function(){return{get:function(t){return e[t]},set:function(t,n){e[t]=n}}}}}function to(e){return e===void 0&&(e={number:{},dateTime:{},pluralRules:{}}),{getNumberFormat:Ie(function(){for(var t,n=[],r=0;r0?e.substring(0,r):"";let i=xn(e.split("").reverse().join("")),o=n-i,s=e.substring(o,o+1),a=o+(s==="."||s===","?1:0);t.suffix=i>0?e.substring(a,n):"",t.mask=e.substring(r,a),t.maskHasNegativeSign=t.mask.charAt(0)==="-",t.maskHasPositiveSign=t.mask.charAt(0)==="+";let l=t.mask.match(no);return t.decimal=l&&l[l.length-1]||".",t.separator=l&&l[1]&&l[0]||",",l=t.mask.split(t.decimal),t.integer=l[0],t.fraction=l[1],t}function oo(e,t,n){let r=!1,i={value:e};e<0&&(r=!0,i.value=-i.value),i.sign=r?"-":"",i.value=Number(i.value).toFixed(t.fraction&&t.fraction.length),i.value=Number(i.value).toString();let o=t.fraction&&t.fraction.lastIndexOf("0"),[s="0",a=""]=i.value.split(".");return(!a||a&&a.length<=o)&&(a=o<0?"":(+("0."+a)).toFixed(o+1).replace("0.","")),i.integer=s,i.fraction=a,so(i,t),(i.result==="0"||i.result==="")&&(r=!1,i.sign=""),!r&&t.maskHasPositiveSign?i.sign="+":r&&t.maskHasPositiveSign?i.sign="-":r&&(i.sign=n&&n.enforceMaskSign&&!t.maskHasNegativeSign?"":"-"),i}function so(e,t){e.result="";let n=t.integer.split(t.separator),r=n.join(""),i=r&&r.indexOf("0");if(i>-1)for(;e.integer.lengthMath.round(e*20)/20},or=(e,t)=>({accept:e,round:t}),fo=[or(({divisor:e,price:t})=>t%e==0,({divisor:e,price:t})=>t/e),or(({usePrecision:e})=>e,({divisor:e,price:t})=>Math.ceil(Math.floor(t*1e4/e)/100)/100),or(()=>!0,({divisor:e,price:t})=>Math.ceil(Math.floor(t*100/e)/100))],sr={[R.YEAR]:{[O.MONTHLY]:Ue.MONTH,[O.ANNUAL]:Ue.YEAR},[R.MONTH]:{[O.MONTHLY]:Ue.MONTH}},po=(e,t)=>e.indexOf(`'${t}'`)===0,mo=(e,t=!0)=>{let n=e.replace(/'.*?'/,"").trim(),r=bn(n);return!!r?t||(n=n.replace(/[,\.]0+/,r)):n=n.replace(/\s?(#.*0)(?!\s)?/,"$&"+Eo(e)),n},ho=e=>{let t=go(e),n=po(e,t),r=e.replace(/'.*?'/,""),i=vn.test(r)||Pn.test(r);return{currencySymbol:t,isCurrencyFirst:n,hasCurrencySpace:i}},Tn=e=>e.replace(vn,Sn).replace(Pn,Sn),Eo=e=>e.match(/#(.?)#/)?.[1]===_n?co:_n,go=e=>e.match(/'(.*?)'/)?.[1]??"",bn=e=>e.match(/0(.?)0/)?.[1]??"";function rt({formatString:e,price:t,usePrecision:n,isIndianPrice:r=!1},i,o=s=>s){let{currencySymbol:s,isCurrencyFirst:a,hasCurrencySpace:l}=ho(e),u=n?bn(e):"",c=mo(e,n),p=n?2:0,f=o(t,{currencySymbol:s}),h=r?f.toLocaleString("hi-IN",{minimumFractionDigits:p,maximumFractionDigits:p}):yn(c,f),d=n?h.lastIndexOf(u):h.length,_=h.substring(0,d),S=h.substring(d+1);return{accessiblePrice:e.replace(/'.*?'/,"SYMBOL").replace(/#.*0/,h).replace(/SYMBOL/,s),currencySymbol:s,decimals:S,decimalsDelimiter:u,hasCurrencySpace:l,integer:_,isCurrencyFirst:a,recurrenceTerm:i}}var An=e=>{let{commitment:t,term:n,usePrecision:r}=e,i=lo[n]??1;return rt(e,i>1?Ue.MONTH:sr[t]?.[n],(o,{currencySymbol:s})=>{let a={divisor:i,price:o,usePrecision:r},{round:l}=fo.find(({accept:c})=>c(a));if(!l)throw new Error(`Missing rounding rule for: ${JSON.stringify(a)}`);return(uo[s]??(c=>c))(l(a))})},wn=({commitment:e,term:t,...n})=>rt(n,sr[e]?.[t]),Ln=e=>{let{commitment:t,term:n}=e;return t===R.YEAR&&n===O.MONTHLY?rt(e,Ue.YEAR,r=>r*12):rt(e,sr[t]?.[n])};var xo={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 {alternativePrice}",strikethroughAriaLabel:"Regularly at {strikethroughPrice}"},yo=jr("ConsonantTemplates/price"),_o=/<.+?>/g,F={container:"price",containerOptical:"price-optical",containerStrikethrough:"price-strikethrough",containerAnnual:"price-annual",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"},ue={perUnitLabel:"perUnitLabel",perUnitAriaLabel:"perUnitAriaLabel",recurrenceLabel:"recurrenceLabel",recurrenceAriaLabel:"recurrenceAriaLabel",taxExclusiveLabel:"taxExclusiveLabel",taxInclusiveLabel:"taxInclusiveLabel",strikethroughAriaLabel:"strikethroughAriaLabel"},So="TAX_EXCLUSIVE",vo=e=>Vr(e)?Object.entries(e).filter(([,t])=>xe(t)||Ye(t)||t===!0).reduce((t,[n,r])=>t+` ${n}${r===!0?"":'="'+Gr(r)+'"'}`,""):"",X=(e,t,n,r=!1)=>`${r?Tn(t):t??""}`;function Po(e,{accessibleLabel:t,currencySymbol:n,decimals:r,decimalsDelimiter:i,hasCurrencySpace:o,integer:s,isCurrencyFirst:a,recurrenceLabel:l,perUnitLabel:u,taxInclusivityLabel:c},p={}){let f=X(F.currencySymbol,n),h=X(F.currencySpace,o?" ":""),d="";return a&&(d+=f+h),d+=X(F.integer,s),d+=X(F.decimalsDelimiter,i),d+=X(F.decimals,r),a||(d+=h+f),d+=X(F.recurrence,l,null,!0),d+=X(F.unitType,u,null,!0),d+=X(F.taxInclusivity,c,!0),X(e,d,{...p,"aria-label":t})}var fe=({displayOptical:e=!1,displayStrikethrough:t=!1,displayAnnual:n=!1}={})=>({country:r,displayFormatted:i=!0,displayRecurrence:o=!0,displayPerUnit:s=!1,displayTax:a=!1,language:l,literals:u={}}={},{commitment:c,formatString:p,price:f,priceWithoutDiscount:h,taxDisplay:d,taxTerm:_,term:S,usePrecision:A}={},w={})=>{Object.entries({country:r,formatString:p,language:l,price:f}).forEach(([Z,vt])=>{if(vt==null)throw new Error(`Argument "${Z}" is missing`)});let P={...xo,...u},C=`${l.toLowerCase()}-${r.toUpperCase()}`;function T(Z,vt){let Pt=P[Z];if(Pt==null)return"";try{return new gn(Pt.replace(_o,""),C).format(vt)}catch{return yo.error("Failed to format literal:",Pt),""}}let L=t&&h?h:f,U=e?An:wn;n&&(U=Ln);let{accessiblePrice:j,recurrenceTerm:q,...ee}=U({commitment:c,formatString:p,term:S,price:e?f:L,usePrecision:A,isIndianPrice:r==="IN"}),H=j,oe="";if(v(o)&&q){let Z=T(ue.recurrenceAriaLabel,{recurrenceTerm:q});Z&&(H+=" "+Z),oe=T(ue.recurrenceLabel,{recurrenceTerm:q})}let se="";if(v(s)){se=T(ue.perUnitLabel,{perUnit:"LICENSE"});let Z=T(ue.perUnitAriaLabel,{perUnit:"LICENSE"});Z&&(H+=" "+Z)}let z="";v(a)&&_&&(z=T(d===So?ue.taxExclusiveLabel:ue.taxInclusiveLabel,{taxTerm:_}),z&&(H+=" "+z)),t&&(H=T(ue.strikethroughAriaLabel,{strikethroughPrice:H}));let W=F.container;if(e&&(W+=" "+F.containerOptical),t&&(W+=" "+F.containerStrikethrough),n&&(W+=" "+F.containerAnnual),v(i))return Po(W,{...ee,accessibleLabel:H,recurrenceLabel:oe,perUnitLabel:se,taxInclusivityLabel:z},w);let{currencySymbol:de,decimals:Ve,decimalsDelimiter:je,hasCurrencySpace:we,integer:St,isCurrencyFirst:Qn}=ee,Ee=[St,je,Ve];Qn?(Ee.unshift(we?"\xA0":""),Ee.unshift(de)):(Ee.push(we?"\xA0":""),Ee.push(de)),Ee.push(oe,se,z);let Kn=Ee.join("");return X(W,Kn,w)},On=()=>(e,t,n)=>{let i=(e.displayOldPrice===void 0||v(e.displayOldPrice))&&t.priceWithoutDiscount&&t.priceWithoutDiscount!=t.price;return`${fe()(e,t,n)}${i?" "+fe({displayStrikethrough:!0})(e,t,n):""}`};var ar=fe(),cr=On(),lr=fe({displayOptical:!0}),ur=fe({displayStrikethrough:!0}),fr=fe({displayAnnual:!0});var To=(e,t)=>{if(!(!_e(e)||!_e(t)))return Math.floor((t-e)/t*100)},Nn=()=>(e,t,n)=>{let{price:r,priceWithoutDiscount:i}=t,o=To(r,i);return o===void 0?'':`${o}%`};var pr=Nn();var{freeze:ke}=Object,Q=ke({...ae}),K=ke({...V}),pe={STAGE:"STAGE",PRODUCTION:"PRODUCTION",LOCAL:"LOCAL"},Cn=ke({...R}),Rn=ke({...Wr}),In=ke({...O});var _r={};ti(_r,{CLASS_NAME_FAILED:()=>nt,CLASS_NAME_PENDING:()=>it,CLASS_NAME_RESOLVED:()=>ot,ERROR_MESSAGE_BAD_REQUEST:()=>st,ERROR_MESSAGE_MISSING_LITERALS_URL:()=>hr,ERROR_MESSAGE_OFFER_NOT_FOUND:()=>mr,EVENT_TYPE_ERROR:()=>bo,EVENT_TYPE_FAILED:()=>at,EVENT_TYPE_PENDING:()=>ct,EVENT_TYPE_READY:()=>me,EVENT_TYPE_RESOLVED:()=>lt,LOG_NAMESPACE:()=>dr,Landscape:()=>Pe,PARAM_AOS_API_KEY:()=>Ao,PARAM_ENV:()=>Er,PARAM_LANDSCAPE:()=>gr,PARAM_WCS_API_KEY:()=>wo,STATE_FAILED:()=>Y,STATE_PENDING:()=>B,STATE_RESOLVED:()=>$,TAG_NAME_SERVICE:()=>ne,WCS_PROD_URL:()=>xr,WCS_STAGE_URL:()=>yr});var nt="placeholder-failed",it="placeholder-pending",ot="placeholder-resolved",st="Bad WCS request",mr="Commerce offer not found",hr="Literals URL not provided",bo="wcms:commerce:error",at="wcms:placeholder:failed",ct="wcms:placeholder:pending",me="wcms:commerce:ready",lt="wcms:placeholder:resolved",dr="wcms/commerce",Er="commerce.env",gr="commerce.landscape",Ao="commerce.aosKey",wo="commerce.wcsKey",xr="https://www.adobe.com/web_commerce_artifact",yr="https://www.stage.adobe.com/web_commerce_artifact_stage",Y="failed",B="pending",$="resolved",ne="wcms-commerce",Pe={DRAFT:"DRAFT",PUBLISHED:"PUBLISHED"};var Sr={clientId:"merch-at-scale",delimiter:"\xB6",ignoredProperties:["analytics","literals"],serializableTypes:["Array","Object"],sampleRate:30,tags:"consumer=milo/commerce"},Mn=new Set,Lo=e=>e instanceof Error||typeof e.originatingRequest=="string";function Dn(e){if(e==null)return;let t=typeof e;if(t==="function"){let{name:n}=e;return n?`${t} ${n}`:t}if(t==="object"){if(e instanceof Error)return e.message;if(typeof e.originatingRequest=="string"){let{message:r,originatingRequest:i,status:o}=e;return[r,o,i].filter(s=>s).join(" ")}let n=e[Symbol.toStringTag]??Object.getPrototypeOf(e).constructor.name;if(!Sr.serializableTypes.includes(n))return n}return e}function Oo(e,t){if(!Sr.ignoredProperties.includes(e))return Dn(t)}var vr={append(e){let{delimiter:t,sampleRate:n,tags:r,clientId:i}=Sr,{message:o,params:s}=e,a=[],l=o,u=[];s.forEach(f=>{f!=null&&(Lo(f)?a:u).push(f)}),a.length&&(l+=" ",l+=a.map(Dn).join(" "));let{pathname:c,search:p}=window.location;l+=`${t}page=`,l+=c+p,u.length&&(l+=`${t}facts=`,l+=JSON.stringify(u,Oo)),Mn.has(l)||(Mn.add(l),window.lana?.log(l,{sampleRate:n,tags:r,clientId:i}))}};var y=Object.freeze({checkoutClientId:"adobe_com",checkoutWorkflow:Q.V3,checkoutWorkflowStep:K.EMAIL,country:"US",displayOldPrice:!0,displayPerUnit:!1,displayRecurrence:!0,displayTax:!1,env:pe.PRODUCTION,forceTaxExclusive:!1,language:"en",entitlement:!1,extraOptions:{},modal:!1,promotionCode:"",quantity:1,wcsApiKey:"wcms-commerce-ims-ro-user-milo",wcsBufferDelay:1,wcsURL:"https://www.adobe.com/web_commerce_artifact",landscape:Pe.PUBLISHED,wcsBufferLimit:1});function Un(e,{once:t=!1}={}){let n=null;function r(){let i=document.querySelector(ne);i!==n&&(n=i,i&&e(i))}return document.addEventListener(me,r,{once:t}),ie(r),()=>document.removeEventListener(me,r)}function Ge(e,{country:t,forceTaxExclusive:n,perpetual:r}){let i;if(e.length<2)i=e;else{let o=t==="GB"||r?"EN":"MULT",[s,a]=e;i=[s.language===o?s:a]}return n&&(i=i.map(Xt)),i}var ie=e=>window.setTimeout(e);function Te(e,t=1){if(e==null)return[t];let n=(Array.isArray(e)?e:String(e).split(",")).map(ve).filter(_e);return n.length||(n=[t]),n}function ut(e){return e==null?[]:(Array.isArray(e)?e:String(e).split(",")).filter(Ut)}function k(){return window.customElements.get(ne)?.instance}var No="en_US",m={ar:"AR_es",be_en:"BE_en",be_fr:"BE_fr",be_nl:"BE_nl",br:"BR_pt",ca:"CA_en",ch_de:"CH_de",ch_fr:"CH_fr",ch_it:"CH_it",cl:"CL_es",co:"CO_es",la:"DO_es",mx:"MX_es",pe:"PE_es",africa:"MU_en",dk:"DK_da",de:"DE_de",ee:"EE_et",eg_ar:"EG_ar",eg_en:"EG_en",es:"ES_es",fr:"FR_fr",gr_el:"GR_el",gr_en:"GR_en",ie:"IE_en",il_he:"IL_iw",it:"IT_it",lv:"LV_lv",lt:"LT_lt",lu_de:"LU_de",lu_en:"LU_en",lu_fr:"LU_fr",my_en:"MY_en",my_ms:"MY_ms",hu:"HU_hu",mt:"MT_en",mena_en:"DZ_en",mena_ar:"DZ_ar",nl:"NL_nl",no:"NO_nb",pl:"PL_pl",pt:"PT_pt",ro:"RO_ro",si:"SI_sl",sk:"SK_sk",fi:"FI_fi",se:"SE_sv",tr:"TR_tr",uk:"GB_en",at:"AT_de",cz:"CZ_cs",bg:"BG_bg",ru:"RU_ru",ua:"UA_uk",au:"AU_en",in_en:"IN_en",in_hi:"IN_hi",id_en:"ID_en",id_id:"ID_in",nz:"NZ_en",sa_ar:"SA_ar",sa_en:"SA_en",sg:"SG_en",cn:"CN_zh-Hans",tw:"TW_zh-Hant",hk_zh:"HK_zh-hant",jp:"JP_ja",kr:"KR_ko",za:"ZA_en",ng:"NG_en",cr:"CR_es",ec:"EC_es",pr:"US_es",gt:"GT_es",cis_en:"AZ_en",cis_ru:"AZ_ru",sea:"SG_en",th_en:"TH_en",th_th:"TH_th"},ft=Object.freeze({LOCAL:"local",PROD:"prod",STAGE:"stage"});function Co({locale:e={}}={}){if(!e.prefix)return{country:y.country,language:y.language,locale:No};let t=e.prefix.replace("/","")??"",[n=y.country,r=y.language]=(m[t]??t).split("_",2);return n=n.toUpperCase(),r=r.toLowerCase(),{country:n,language:r,locale:`${r}_${n}`}}function kn(e={}){let{commerce:t={},locale:n=void 0}=e,r=pe.PRODUCTION,i=xr,o=["local","stage"].includes(e.env?.name),s=N(Er,t,{metadata:!1})==="stage";o&&s&&(r=pe.STAGE,i=yr);let a=N("checkoutClientId",t)??y.checkoutClientId,l=re(N("checkoutWorkflow",t),Q,y.checkoutWorkflow),u=K.CHECKOUT;l===Q.V3&&(u=re(N("checkoutWorkflowStep",t),K,y.checkoutWorkflowStep));let c=v(N("displayOldPrice",t),y.displayOldPrice),p=v(N("displayPerUnit",t),y.displayPerUnit),f=v(N("displayRecurrence",t),y.displayRecurrence),h=v(N("displayTax",t),y.displayTax),d=v(N("entitlement",t),y.entitlement),_=v(N("modal",t),y.modal),S=v(N("forceTaxExclusive",t),y.forceTaxExclusive),A=N("promotionCode",t)??y.promotionCode,w=Te(N("quantity",t)),P=N("wcsApiKey",t)??y.wcsApiKey,C=e.env?.name===ft.PROD?Pe.PUBLISHED:re(N(gr,t),Pe,y.landscape),T=ve(N("wcsBufferDelay",t),y.wcsBufferDelay),L=ve(N("wcsBufferLimit",t),y.wcsBufferLimit);return{...Co({locale:n}),displayOldPrice:c,checkoutClientId:a,checkoutWorkflow:l,checkoutWorkflowStep:u,displayPerUnit:p,displayRecurrence:f,displayTax:h,entitlement:d,extraOptions:y.extraOptions,modal:_,env:r,forceTaxExclusive:S,priceLiteralsURL:t.priceLiteralsURL,priceLiteralsPromise:t.priceLiteralsPromise,promotionCode:A,quantity:w,wcsApiKey:P,wcsBufferDelay:T,wcsBufferLimit:L,wcsURL:i,landscape:C}}var Fn="debug",Ro="error",Io="info",Mo="warn",Do=Date.now(),Pr=new Set,Tr=new Set,Gn=new Map,Fe=Object.freeze({DEBUG:Fn,ERROR:Ro,INFO:Io,WARN:Mo}),Vn={append({level:e,message:t,params:n,timestamp:r,source:i}){console[e](`${r}ms [${i}] %c${t}`,"font-weight: bold;",...n)}},jn={filter:({level:e})=>e!==Fn},Uo={filter:()=>!1};function ko(e,t,n,r,i){return{level:e,message:t,namespace:n,get params(){if(r.length===1){let[o]=r;te(o)&&(r=o(),Array.isArray(r)||(r=[r]))}return r},source:i,timestamp:Date.now()-Do}}function Go(e){[...Tr].every(t=>t(e))&&Pr.forEach(t=>t(e))}function Hn(e){let t=(Gn.get(e)??0)+1;Gn.set(e,t);let n=`${e} #${t}`,r=o=>(s,...a)=>Go(ko(o,s,e,a,n)),i=Object.seal({id:n,namespace:e,module(o){return Hn(`${i.namespace}/${o}`)},debug:r(Fe.DEBUG),error:r(Fe.ERROR),info:r(Fe.INFO),warn:r(Fe.WARN)});return i}function pt(...e){e.forEach(t=>{let{append:n,filter:r}=t;te(r)?Tr.add(r):te(n)&&Pr.add(n)})}function Fo(e={}){let{name:t}=e,n=v(N("commerce.debug",{search:!0,storage:!0}),t===ft.LOCAL);return pt(n?Vn:jn),t===ft.PROD&&pt(vr),M}function Vo(){Pr.clear(),Tr.clear()}var M={...Hn(dr),Level:Fe,Plugins:{consoleAppender:Vn,debugFilter:jn,quietFilter:Uo,lanaAppender:vr},init:Fo,reset:Vo,use:pt};var jo={CLASS_NAME_FAILED:nt,CLASS_NAME_PENDING:it,CLASS_NAME_RESOLVED:ot,EVENT_TYPE_FAILED:at,EVENT_TYPE_PENDING:ct,EVENT_TYPE_RESOLVED:lt,STATE_FAILED:Y,STATE_PENDING:B,STATE_RESOLVED:$},Ho={[Y]:nt,[B]:it,[$]:ot},Wo={[Y]:at,[B]:ct,[$]:lt},dt=new WeakMap;function G(e){if(!dt.has(e)){let t=M.module(e.constructor.is);dt.set(e,{changes:new Map,connected:!1,dispose:ye,error:void 0,log:t,options:void 0,promises:[],state:B,timer:null,value:void 0,version:0})}return dt.get(e)}function mt(e){let t=G(e),{error:n,promises:r,state:i}=t;(i===$||i===Y)&&(t.promises=[],i===$?r.forEach(({resolve:o})=>o(e)):i===Y&&r.forEach(({reject:o})=>o(n))),e.dispatchEvent(new CustomEvent(Wo[i],{bubbles:!0}))}function ht(e){let t=dt.get(e);[Y,B,$].forEach(n=>{e.classList.toggle(Ho[n],n===t.state)})}var Xo={get error(){return G(this).error},get log(){return G(this).log},get options(){return G(this).options},get state(){return G(this).state},get value(){return G(this).value},attributeChangedCallback(e,t,n){G(this).changes.set(e,n),this.requestUpdate()},connectedCallback(){G(this).dispose=Un(()=>this.requestUpdate(!0))},disconnectedCallback(){let e=G(this);e.connected&&(e.connected=!1,e.log.debug("Disconnected:",{element:this})),e.dispose(),e.dispose=ye},onceSettled(){let{error:e,promises:t,state:n}=G(this);return $===n?Promise.resolve(this):Y===n?Promise.reject(e):new Promise((r,i)=>{t.push({resolve:r,reject:i})})},toggleResolved(e,t,n){let r=G(this);return e!==r.version?!1:(n!==void 0&&(r.options=n),r.state=$,r.value=t,ht(this),this.log.debug("Resolved:",{element:this,value:t}),ie(()=>mt(this)),!0)},toggleFailed(e,t,n){let r=G(this);return e!==r.version?!1:(n!==void 0&&(r.options=n),r.error=t,r.state=Y,ht(this),r.log.error("Failed:",{element:this,error:t}),ie(()=>mt(this)),!0)},togglePending(e){let t=G(this);return t.version++,e&&(t.options=e),t.state=B,ht(this),ie(()=>mt(this)),t.version},requestUpdate(e=!1){if(!this.isConnected||!k())return;let t=G(this);if(t.timer)return;let{error:n,options:r,state:i,value:o,version:s}=t;t.state=B,t.timer=ie(async()=>{t.timer=null;let a=null;if(t.changes.size&&(a=Object.fromEntries(t.changes.entries()),t.changes.clear()),t.connected?t.log.debug("Updated:",{element:this,changes:a}):(t.connected=!0,t.log.debug("Connected:",{element:this,changes:a})),a||e)try{await this.render?.()===!1&&t.state===B&&t.version===s&&(t.state=i,t.error=n,t.value=o,ht(this),mt(this))}catch(l){this.toggleFailed(t.version,l,r)}})}};function Wn(e={}){return Object.entries(e).forEach(([t,n])=>{(n==null||n===""||n?.length===0)&&delete e[t]}),e}function Et(e,t={}){let{tag:n,is:r}=e,i=document.createElement(n,{is:r});return i.setAttribute("is",r),Object.assign(i.dataset,Wn(t)),i}function gt(e){let{tag:t,is:n,prototype:r}=e,i=window.customElements.get(n);return i||(Object.defineProperties(r,Object.getOwnPropertyDescriptors(Xo)),i=Object.defineProperties(e,Object.getOwnPropertyDescriptors(jo)),window.customElements.define(n,i,{extends:t})),i}function xt(e,t=document.body){return Array.from(t?.querySelectorAll(`${e.tag}[is="${e.is}"]`)??[])}function yt(e,t={}){return e instanceof HTMLElement?(Object.assign(e.dataset,Wn(t)),e):null}var Yo="download",Bo="upgrade",he,be=class be extends HTMLAnchorElement{constructor(){super();Ir(this,he);this.addEventListener("click",this.clickHandler)}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"]}static createCheckoutLink(n={},r=""){let i=k();if(!i)return null;let{checkoutMarketSegment:o,checkoutWorkflow:s,checkoutWorkflowStep:a,entitlement:l,upgrade:u,modal:c,perpetual:p,promotionCode:f,quantity:h,wcsOsi:d,extraOptions:_}=i.collectCheckoutOptions(n),S=Et(be,{checkoutMarketSegment:o,checkoutWorkflow:s,checkoutWorkflowStep:a,entitlement:l,upgrade:u,modal:c,perpetual:p,promotionCode:f,quantity:h,wcsOsi:d,extraOptions:_});return r&&(S.innerHTML=`${r}`),S}static getCheckoutLinks(n){return xt(be,n)}get isCheckoutLink(){return!0}get placeholder(){return this}clickHandler(n){var r;(r=Tt(this,he))==null||r.call(this,n)}async render(n={}){if(!this.isConnected)return!1;let r=k();if(!r)return!1;this.dataset.imsCountry||r.imsCountryPromise.then(c=>{c&&(this.dataset.imsCountry=c)},ye);let i=r.collectCheckoutOptions(n,this.placeholder);if(!i.wcsOsi.length)return!1;let o;try{o=JSON.parse(i.extraOptions??"{}")}catch(c){this.placeholder.log.error("cannot parse exta checkout options",c)}let s=this.placeholder.togglePending(i);this.href="";let a=r.resolveOfferSelectors(i),l=await Promise.all(a);l=l.map(c=>Ge(c,i));let u=await r.buildCheckoutAction(l.flat(),{...o,...i});return this.renderOffers(l.flat(),i,{},u,s)}renderOffers(n,r,i={},o=void 0,s=void 0){if(!this.isConnected)return!1;let a=k();if(!a)return!1;if(r={...JSON.parse(this.placeholder.dataset.extraOptions??"null"),...r,...i},s??(s=this.placeholder.togglePending(r)),Tt(this,he)&&bt(this,he,void 0),o){this.classList.remove(Yo,Bo),this.placeholder.toggleResolved(s,n,r);let{url:u,text:c,className:p,handler:f}=o;return u&&(this.href=u),c&&(this.firstElementChild.innerHTML=c),p&&this.classList.add(...p.split(" ")),f&&(this.setAttribute("href","#"),bt(this,he,f.bind(this))),!0}else if(n.length){if(this.placeholder.toggleResolved(s,n,r)){let u=a.buildCheckoutURL(n,r);return this.setAttribute("href",u),!0}}else{let u=new Error(`Not provided: ${r?.wcsOsi??"-"}`);if(this.placeholder.toggleFailed(s,u,r))return this.setAttribute("href","#"),!0}return!1}updateOptions(n={}){let r=k();if(!r)return!1;let{checkoutMarketSegment:i,checkoutWorkflow:o,checkoutWorkflowStep:s,entitlement:a,upgrade:l,modal:u,perpetual:c,promotionCode:p,quantity:f,wcsOsi:h}=r.collectCheckoutOptions(n);return yt(this,{checkoutMarketSegment:i,checkoutWorkflow:o,checkoutWorkflowStep:s,entitlement:a,upgrade:l,modal:u,perpetual:c,promotionCode:p,quantity:f,wcsOsi:h}),!0}};he=new WeakMap,J(be,"is","checkout-link"),J(be,"tag","a");var br=be,Ar=gt(br);var Xn=[m.uk,m.au,m.fr,m.at,m.be_en,m.be_fr,m.be_nl,m.bg,m.ch_de,m.ch_fr,m.ch_it,m.cz,m.de,m.dk,m.ee,m.eg_ar,m.eg_en,m.es,m.fi,m.fr,m.gr_el,m.gr_en,m.hu,m.ie,m.it,m.lu_de,m.lu_en,m.lu_fr,m.nl,m.no,m.pl,m.pt,m.ro,m.se,m.si,m.sk,m.tr,m.ua,m.id_en,m.id_id,m.in_en,m.in_hi,m.jp,m.my_en,m.my_ms,m.nz,m.th_en,m.th_th],$o={INDIVIDUAL_COM:[m.za,m.lt,m.lv,m.ng,m.sa_ar,m.sa_en,m.za,m.sg,m.kr],TEAM_COM:[m.za,m.lt,m.lv,m.ng,m.za,m.co,m.kr],INDIVIDUAL_EDU:[m.lt,m.lv,m.sa_en,m.sea],TEAM_EDU:[m.sea,m.kr]},Ae=class Ae extends HTMLSpanElement{static get observedAttributes(){return["data-display-old-price","data-display-per-unit","data-display-recurrence","data-display-tax","data-perpetual","data-promotion-code","data-tax-exclusive","data-template","data-wcs-osi"]}static createInlinePrice(t){let n=k();if(!n)return null;let{displayOldPrice:r,displayPerUnit:i,displayRecurrence:o,displayTax:s,forceTaxExclusive:a,perpetual:l,promotionCode:u,quantity:c,template:p,wcsOsi:f}=n.collectPriceOptions(t);return Et(Ae,{displayOldPrice:r,displayPerUnit:i,displayRecurrence:o,displayTax:s,forceTaxExclusive:a,perpetual:l,promotionCode:u,quantity:c,template:p,wcsOsi:f})}static getInlinePrices(t){return xt(Ae,t)}get isInlinePrice(){return!0}get placeholder(){return this}resolveDisplayTaxForGeoAndSegment(t,n,r,i){let o=`${t}_${n}`;if(Xn.includes(t)||Xn.includes(o))return!0;let s=$o[`${r}_${i}`];return s?!!(s.includes(t)||s.includes(o)):!1}async resolveDisplayTax(t,n){let[r]=await t.resolveOfferSelectors(n),i=Ge(await r,n);if(i?.length){let{country:o,language:s}=n,a=i[0],[l=""]=a.marketSegments;return this.resolveDisplayTaxForGeoAndSegment(o,s,a.customerSegment,l)}}async render(t={}){if(!this.isConnected)return!1;let n=k();if(!n)return!1;let r=n.collectPriceOptions(t,this.placeholder);if(!r.wcsOsi.length)return!1;let i=this.placeholder.togglePending(r);this.innerHTML="";let[o]=n.resolveOfferSelectors(r);return this.renderOffers(Ge(await o,r),r,i)}renderOffers(t,n={},r=void 0){if(!this.isConnected)return;let i=k();if(!i)return!1;let o=i.collectPriceOptions({...this.dataset,...n});if(r??(r=this.placeholder.togglePending(o)),t.length){if(this.placeholder.toggleResolved(r,t,o))return this.innerHTML=i.buildPriceHTML(t,o),!0}else{let s=new Error(`Not provided: ${o?.wcsOsi??"-"}`);if(this.placeholder.toggleFailed(r,s,o))return this.innerHTML="",!0}return!1}updateOptions(t){let n=k();if(!n)return!1;let{displayOldPrice:r,displayPerUnit:i,displayRecurrence:o,displayTax:s,forceTaxExclusive:a,perpetual:l,promotionCode:u,quantity:c,template:p,wcsOsi:f}=n.collectPriceOptions(t);return yt(this,{displayOldPrice:r,displayPerUnit:i,displayRecurrence:o,displayTax:s,forceTaxExclusive:a,perpetual:l,promotionCode:u,quantity:c,template:p,wcsOsi:f}),!0}};J(Ae,"is","inline-price"),J(Ae,"tag","span");var wr=Ae,Lr=gt(wr);function Yn({providers:e,settings:t},n){let r=M.module("checkout");function i(u,c){let{checkoutClientId:p,checkoutWorkflow:f,checkoutWorkflowStep:h,country:d,language:_,promotionCode:S,quantity:A}=t,{checkoutMarketSegment:w,checkoutWorkflow:P=f,checkoutWorkflowStep:C=h,imsCountry:T,country:L=T??d,language:U=_,quantity:j=A,entitlement:q,upgrade:ee,modal:H,perpetual:oe,promotionCode:se=S,wcsOsi:z,extraOptions:W,...de}=Object.assign({},c?.dataset??{},u??{}),Ve=re(P,Q,y.checkoutWorkflow),je=K.CHECKOUT;Ve===Q.V3&&(je=re(C,K,y.checkoutWorkflowStep));let we=Se({...de,extraOptions:W,checkoutClientId:p,checkoutMarketSegment:w,country:L,quantity:Te(j,y.quantity),checkoutWorkflow:Ve,checkoutWorkflowStep:je,language:U,entitlement:v(q),upgrade:v(ee),modal:v(H),perpetual:v(oe),promotionCode:Ne(se).effectivePromoCode,wcsOsi:ut(z)});if(c)for(let St of e.checkout)St(c,we);return we}async function o(u,c){let p=k(),f=await n.getCheckoutAction?.(u,c,p.imsSignedInPromise);return f||null}function s(u,c){if(!Array.isArray(u)||!u.length||!c)return"";let{env:p,landscape:f}=t,{checkoutClientId:h,checkoutMarketSegment:d,checkoutWorkflow:_,checkoutWorkflowStep:S,country:A,promotionCode:w,quantity:P,...C}=i(c),T=window.frameElement?"if":"fp",L={checkoutPromoCode:w,clientId:h,context:T,country:A,env:p,items:[],marketSegment:d,workflowStep:S,landscape:f,...C};if(u.length===1){let[{offerId:U,offerType:j,productArrangementCode:q}]=u,{marketSegments:[ee]}=u[0];Object.assign(L,{marketSegment:ee,offerType:j,productArrangementCode:q}),L.items.push(P[0]===1?{id:U}:{id:U,quantity:P[0]})}else L.items.push(...u.map(({offerId:U},j)=>({id:U,quantity:P[j]??y.quantity})));return Nt(_,L)}let{createCheckoutLink:a,getCheckoutLinks:l}=Ar;return{CheckoutLink:Ar,CheckoutWorkflow:Q,CheckoutWorkflowStep:K,buildCheckoutAction:o,buildCheckoutURL:s,collectCheckoutOptions:i,createCheckoutLink:a,getCheckoutLinks:l}}function qo({interval:e=200,maxAttempts:t=25}={}){let n=M.module("ims");return new Promise(r=>{n.debug("Waing for IMS to be ready");let i=0;function o(){window.adobeIMS?.initialized?r():++i>t?(n.debug("Timeout"),r()):setTimeout(o,e)}o()})}function zo(e){return e.then(()=>window.adobeIMS?.isSignedInUser()??!1)}function Zo(e){let t=M.module("ims");return e.then(n=>n?window.adobeIMS.getProfile().then(({countryCode:r})=>(t.debug("Got user country:",r),r),r=>{t.error("Unable to get user country:",r)}):null)}function Bn({}){let e=qo(),t=zo(e),n=Zo(t);return{imsReadyPromise:e,imsSignedInPromise:t,imsCountryPromise:n}}function Jo(e){if(!e.priceLiteralsURL)throw new Error(hr);return new Promise(t=>{window.fetch(e.priceLiteralsURL).then(n=>{n.json().then(({data:r})=>{t(r)})})})}async function $n(e){let n=await(e.priceLiteralsPromise||Jo(e));if(Array.isArray(n)){let r=o=>n.find(s=>Xe(s.lang,o)),i=r(e.language)??r(y.language);if(i)return Object.freeze(i)}return{}}function qn({literals:e,providers:t,settings:n}){function r(a,l){let{country:u,displayOldPrice:c,displayPerUnit:p,displayRecurrence:f,displayTax:h,forceTaxExclusive:d,language:_,promotionCode:S,quantity:A}=n,{displayOldPrice:w=c,displayPerUnit:P=p,displayRecurrence:C=f,displayTax:T=h,forceTaxExclusive:L=d,country:U=u,language:j=_,perpetual:q,promotionCode:ee=S,quantity:H=A,template:oe,wcsOsi:se,...z}=Object.assign({},l?.dataset??{},a??{}),W=Se({...z,country:U,displayOldPrice:v(w),displayPerUnit:v(P),displayRecurrence:v(C),displayTax:v(T),forceTaxExclusive:v(L),language:j,perpetual:v(q),promotionCode:Ne(ee).effectivePromoCode,quantity:Te(H,y.quantity),template:oe,wcsOsi:ut(se)});if(l)for(let de of t.price)de(l,W);return W}function i(a,l){if(!Array.isArray(a)||!a.length||!l)return"";let{template:u}=l,c;switch(u){case"discount":c=pr;break;case"strikethrough":c=ur;break;case"optical":c=lr;break;case"annual":c=fr;break;default:c=l.promotionCode?cr:ar}let p=r(l);p.literals=Object.assign({},e.price,Se(l.literals??{}));let[f]=a;return f={...f,...f.priceDetails},c(p,f)}let{createInlinePrice:o,getInlinePrices:s}=Lr;return{InlinePrice:Lr,buildPriceHTML:i,collectPriceOptions:r,createInlinePrice:o,getInlinePrices:s}}function zn({settings:e}){let t=M.module("wcs"),{env:n,wcsApiKey:r}=e,i=new Map,o=new Map,s;async function a(c,p,f=!0){let h=mr;t.debug("Fetching:",c);try{c.offerSelectorIds=c.offerSelectorIds.sort();let d=new URL(e.wcsURL);d.searchParams.set("offer_selector_ids",c.offerSelectorIds.join(",")),d.searchParams.set("country",c.country),d.searchParams.set("language",c.language),d.searchParams.set("locale",c.locale),d.searchParams.set("landscape",n===pe.STAGE?"ALL":e.landscape),d.searchParams.set("api_key",r),c.promotionCode&&d.searchParams.set("promotion_code",c.promotionCode),c.currency&&d.searchParams.set("currency",c.currency);let _=await fetch(d.toString());if(_.ok){let S=await _.json();t.debug("Fetched:",c,S);let A=S.resolvedOffers??[];A=A.map(Wt),p.forEach(({resolve:w},P)=>{let C=A.filter(({offerSelectorIds:T})=>T.includes(P)).flat();C.length&&(p.delete(P),w(C))})}else _.status===404&&c.offerSelectorIds.length>1?(t.debug("Multi-osi 404, fallback to fetch-by-one strategy"),await Promise.allSettled(c.offerSelectorIds.map(S=>a({...c,offerSelectorIds:[S]},p,!1)))):(h=st,t.error(h,c))}catch(d){h=st,t.error(h,c,d)}f&&p.size&&(t.debug("Missing:",{offerSelectorIds:[...p.keys()]}),p.forEach(d=>{d.reject(new Error(h))}))}function l(){clearTimeout(s);let c=[...o.values()];o.clear(),c.forEach(({options:p,promises:f})=>a(p,f))}function u({country:c,language:p,perpetual:f=!1,promotionCode:h="",wcsOsi:d=[]}){let _=`${p}_${c}`;c!=="GB"&&(p=f?"EN":"MULT");let S=[c,p,h].filter(A=>A).join("-").toLowerCase();return d.map(A=>{let w=`${A}-${S}`;if(!i.has(w)){let P=new Promise((C,T)=>{let L=o.get(S);if(!L){let U={country:c,locale:_,offerSelectorIds:[]};c!=="GB"&&(U.language=p),L={options:U,promises:new Map},o.set(S,L)}h&&(L.options.promotionCode=h),L.options.offerSelectorIds.push(A),L.promises.set(A,{resolve:C,reject:T}),L.options.offerSelectorIds.length>=e.wcsBufferLimit?l():(t.debug("Queued:",L.options),s||(s=setTimeout(l,e.wcsBufferDelay)))});i.set(w,P)}return i.get(w)})}return{WcsCommitment:Cn,WcsPlanType:Rn,WcsTerm:In,resolveOfferSelectors:u}}var D=class extends HTMLElement{get isWcmsCommerce(){return!0}};J(D,"instance"),J(D,"promise",null);window.customElements.define(ne,D);async function Qo(e,t){let n=M.init(e.env).module("service");n.debug("Activating:",e);let r={price:{}},i=Object.freeze(kn(e));try{r.price=await $n(i)}catch(l){n.warn("Price literals were not fetched:",l)}let o={checkout:new Set,price:new Set},s=document.createElement(ne),a={literals:r,providers:o,settings:i};return D.instance=Object.defineProperties(s,Object.getOwnPropertyDescriptors({...Yn(a,t),...Bn(a),...qn(a),...zn(a),..._r,Log:M,get defaults(){return y},get literals(){return r},get log(){return M},get providers(){return{checkout(l){return o.checkout.add(l),()=>o.checkout.delete(l)},price(l){return o.price.add(l),()=>o.price.delete(l)}}},get settings(){return i}})),n.debug("Activated:",{literals:r,settings:i,element:s}),document.head.append(s),ie(()=>{let l=new CustomEvent(me,{bubbles:!0,cancelable:!1,detail:D.instance});D.instance.dispatchEvent(l)}),D.instance}function Zn(){document.head.querySelector(ne)?.remove(),D.promise=null,M.reset()}function Or(e,t){if(te(e)){let n=te(t)?t():{};return n.force&&Zn(),D.promise??(D.promise=Qo(e(),n))}return D.promise?D.promise:new Promise(n=>{let r=i=>{n(i.detail)};document.head.addEventListener(me,r,{once:!0})})}var{origin:Ko,searchParams:_t}=new URL(import.meta.url),es=_t.get("locale")??"US_en",nl=_t.get("lang")??"en",Jn=_t.get("env")==="stage",ts=_t.get("features"),rs=Jn?"stage":"prod",ns=Jn?"STAGE":"PROD",is=()=>({env:{name:rs},commerce:{"commerce.env":ns},locale:{prefix:es}});Or(is);ts.includes("merch-card")&&import(`${Ko}/libs/deps/merch-card-all.js`); //# sourceMappingURL=mas.js.map diff --git a/libs/features/mas/commerce/internal/data-source-wcs-0.2.8.tgz b/libs/features/mas/commerce/internal/data-source-wcs-0.2.8.tgz deleted file mode 100644 index edddf7e0d1a26a52db75f0ad6985a65f0487d6f4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5782 zcmV;H7HR1piwFP!00000|Lt9SSKCOk-@pASddZ%_=E%Y}24>7883)J=_cDPCReUEiT! z&Ck)_<{TQ0#zwnMisB(O+Z*fTZ)@utjb?LWqXGHgVZFHtf9K6eQ5Z$B6#^?yrNbLT zlE42UVRdDtLRQGid;*f{?i{?^CEEud-tX<~emL3d?qlqEK0q|4YzM<}=w4pMq}6D( zNY@E^l+p1#a)j{_Iie8_uc>2V{D*^+z3tr&OLzT#5Du)^4SZq;er&lub;uPBsp}Ir zGKl3nB%}j~kFacfMaeJ>hBS=FB>0JF*$SVt73R7%M;vj8Yu1XdoN&xW~$n?gp~9q2*8#Q9GnDqiiRgj9FPf?zmAz2d>Y14>}{ha-&R-1|jqv z)ZvWmOdd$4q03o-pHUpTcI=G_l>ne<5KB)`eKXOIwx7LGLq&7t^7ASeu7Jyj1xj z0tvHpeomu5K_GZ^$so5CLar@uL^~jGMznHQ+q#!P@iG*|s6T>e6m^`U0dbc!?vVb- z=OUkn#FZ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t&;ZT=07SxMJ^%m! diff --git a/libs/features/mas/commerce/internal/eslint-config-tacocat-1.1.2.tgz b/libs/features/mas/commerce/internal/eslint-config-tacocat-1.1.2.tgz deleted file mode 100644 index ea3f1a8869a3bc526529c98df0ace53164e24d2e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 806 zcmV+>1KIo^iwFP!00002|Ls`aZ`v>r=Q)2xls z(`Vv(daLVtmTh~UrEr#Q9XU#8we}#1keI8fJVBC5^!4?HNXYyo00hgJaVhk7I)~p0 zB3iYx>GR z=l|mR4DA0X|GRd#&i}UCYtDcBOz_QTL}K0THCj_7$$Qn(}JoZMTZGO%;S*e{X0 zRgP;t4}d@RY_ifFBYVr3L(Bw~jNewxWYJ{jw9+{f9u(SB^+Sa57-64HLEVP^8xjh$ zSl((?p_;L;-h@aI$|xvOR5wR4xtH3+R{X!-di#I>cU))d{on02{J$4D&?h@Nf1+vc z_3>yh>g(#jNI1>T(3*B|pnnr;;b_`qGSQTcka}S<%=~=F+>}2k?2MCsUC>Ok2sId< kk3N4LU!0AH`q`IHS&Zha)<`3bH1d@47wSCl zX>2RVl24K$zJ&jN-7^|#^zb9W*jX}N3ASf?x<@_Jk9lgS8+Uq-R;WLy817)`I@Ae# z?W6zG;-FfsZf|XoymWy2*5)SpX|u6it<|=-tAJOn)f+oC_*`HeCc?-MbPuZXR66`& zNc8y^fqUH}?Y8dwR?i{(q!jcmpZx7_1V1&Au};2xA>EN<1eWWN(mMHEAOKRi^UgoZq=YQ}GO?gotxT}A?)63k*6(cU^n(5_WbP3MKK}l9xj2F^?U#}218;w#9t>?mz2WF4Lvt-gYl4ReceBQa4tM|NWEaJ8M^#n15;QjCe zaP;9L=JXhS^Jp;g91`%nNB$8e3h`+AaA=R2WXo~Y*LMqmUU|JJD3I6W=;Zt#EpmK* z_WS8c>+JgU=nbZ}vjEAMbLhMi)}Y8o7o7mJ?9hhV~ojHWESffEsnDO+AZO0e<>{XBmM##;)J7Op`ifg=5v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>?*CW{DEw_D`}nB=G1W7!z5x^pT}pg@6w PXM_I(@NDmY0N?-sX7$LV diff --git a/libs/features/mas/commerce/internal/react-env-provider-1.2.2.tgz b/libs/features/mas/commerce/internal/react-env-provider-1.2.2.tgz deleted file mode 100644 index 0b66ec771f221a7caa07d7c58f0fe99e1ddf6ca4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3312 zcmVC6T?U>+e!7n-!WgznAUZjx!!_Cu#j zj4eQ|v3+GZDU;>D-*Y5C1UQejENOdvrVU1q^OAHPvP59npR6&h({Nh1{b}HP)Dz~% z@Rv10qtV!Hw@F?(!1i{#MSj`d*=;nNySoi&*J!rdja~R$Clfb86bg$2E8mJo2}9D) z9|Y=;*98W7Ob(Au|J5hG(~}p+NBxuYlL#+sfV%s3lQ1Zg!|4RYxCLn`sO zE_sFJA$dhZ$}g#7#$8TM&yRckj%>obk7$3Q1WK_W7c^Y;90C7}zr| zU^qE5%$bc+a;<8);{IU;9aJhuDyMXPt--wt66edc7dkbfW zH{MFOIQ@B zr@-RY6xW2MBqQL1aUs-o?qTZo<>)L-nRHwL&#{+@mre9?CU&K(D^c&!HRjzVRh@DF zk~x$wP#jn~O<*>nP(QFt`B)|Pgt-o=Kout67Rc&~@4HkgIb+dG$l_|1NINkZ7~*@4 z51D6dRHR%F?P0%f2;%t9Wy1%G|8{mT=39#Yw)a{^{I>}xfvJdHc&Td`r^AmBUziRZ zfpb2KExw#F8Olm z=o*k1a&?p8x+XB!tjHA|Xg*i^kpp#;(s@Nu7c$x~Csqg|rsxDt87VU&LPvBB=?4bY z{$S9NV}KsQf{NU!j!5GQKy-TLB^5_Bv^fie4_bvlmz1Sb2KSD#$T<+pfntIK)(}bR zC^#~!p)?_ybW!n9r6S!OCk*(qVEFD}L3JXXcup}SR%X~7M}nCl6_pIj(qi_YFC+`H z`}^nvE=Bl&Ns>-fGZqD_aB50Lhp5*o@nEugIHQWhu}B<$+QiXV$^&z}8alt##Ben& zyeTQXUru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s}@k{{$nfTj94!-;57+Dz2tR9}t)hy^J}MXlk}ZQ@eqM zhju~*JQxJI_x~~cULTD+_J3M?tM|Wli}!z2FFeakB=snd=>_3b3px+I6mNb=rPke_$ta(tp z(_IJT-~WDi|6jcS-3%1|zwrNs|1bQ1;s5_XVfFssdVN2_9p`^{TH7nPM^MpK2q2CqL1KPuj1t{b1Jn+hO(o-}hku zn|r&(@BeND3j1H!|HA$k_Fuaow{{wL*#E}%%KeXKyIt7-jX;jY&NJ6WuBFa3)5cd@ u=x;aA-)x)LV3@z&DzCvLf4e=_jqyWI&H@T3pnwAYG58-eDqz9@asU7~BZ3J4 diff --git a/libs/features/mas/commerce/internal/react-fetch-provider-1.2.2.tgz b/libs/features/mas/commerce/internal/react-fetch-provider-1.2.2.tgz deleted file mode 100644 index 632564fda63dfb5be90d3f91d9e2c83e96f1b5f8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3179 zcmV-x43zU9iwFP!00000|Lt3CQyaGy?q~lB)xA^fjJ)ov+10L%Ce$SCs`(m5GBrde+YT9^LIxo_Z^qix!BBJhRI${kbCk;28L}9=J z<$RJqtg$qk&FxNytg467-rQ`GA2zqPo2}ONb`$8Dt#+r`hTnB|;;u54iVEn;x5_bt zA<6GQq%@wbtCYwya`5u>zenWo^yJm?%cGOG#|N*mw!d7U8e0y-XeRh*tVp}rZjl2o z955}%_sKcdOLER66IaZ0VwRKBx5tM^T}{G+VJIe4@h~867%0jE=8-WIj0c3v8lizl z1e-v;L|!#!Bobl7gqo3XX!L0!4w~dNihRxl@bMwk&K&X<7uscT{m5UxPXU`8m6ks^gl2mW$TlA-wY8ao}h z{?y~ah$ullMkI3uQ(Cf{*cnODl;kCsl1+GEtOv$WV=i+R4F%W^ba+!YM+41FaMJ~N zl}d0|`7;8X1MYb&Ak)BSQbPYY$ha0R zCKS0PL#Es@nHxj`%Jz8kKnU%P2)zq z3ze9%(mX*r>11HeRxN^1u0DmktB`x7*()J*^euJ>_Q#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k1`}{2yyYwVVK0007E0L7o5r diff --git a/libs/features/mas/commerce/internal/tacocat-core-1.12.2.tgz b/libs/features/mas/commerce/internal/tacocat-core-1.12.2.tgz deleted file mode 100644 index 453ba1fa8af5a914e7a0bb05b3c352a003a5e9c5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 18104 zcmV)FK)=5qiwFP!00002|LuM4cH20zVE^`0ptXG>DlOBJ<0RX1oJ=}#_vDTfXJe;( zc71&#nuKI_C{jaEwl$7k=RU%HfO)b#g>Mkxhd<(;>9NnriA?~7LZJW@3iUA$!q34J zZ;(9Pi0}mGd64+Ok#BDEXD}E%+1f&`?}Nc$b8~BezIpWc$zV8q@?@}uz8MTRhfkiO zZwBAo!OwyeLH^BPa0`PR329yd+A;ZQk%mQ_rCQBJ5hrmGW2m_nW+{Q1NjB}HFvmfGUlM}zqK_gxiBl{)+9~zz zbzgHv?Diy}fVO>$i_wW9W+~z0-azKpb4)! z>aIao8xJ3@p@-;C1)j~5pukA9CG7KZj$!PS2wvCUfDfeG^BEQb>u0jnbF^AR4>#6C zH^{8$F@$>Pl3_kU-nXuCih80V{N%V;^Z!nM_|khQ4{;#`cDL88vLu^2KL=^x`aVyB5T9mA zg!5NfTHuSKq1O96JBuTnH&okAr*VoKDjo7OyrJ4b5lpGTVpYmN1es zZ=TIE*l4@|G#i_~{$U=!!t$?Q|HG}plTB;=KiYhBzy9yyXXD{R^zb%+))1AUU%uY| zaTmSXfA`ay*Sqfy-@M#|ub-?RULC#4=F2>uo)&0xu=xnRjItAq4wj_AGlJfvVV2Lc zJScEPYrjkq^Z{xU^Z^r`pW(>oklyVdzInAfqE+H_lI632iQZXS1aXQZbc%Bvrzj?U z6r>T#@hpf_D&ZHW7|ru+j`L!PvPlgVv}IfnL>BXT662io0YE%KLAvzO;VDLOT3{-y zErNtrFK~F8#$k{EE+L*5L?H!@IbK1|kjP_P1o;vbSqnU%y+nn6bB-7%|&4d~wH4_wmZ z-8RS5m=rkQ%c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3X&OmvQ%|aS#Q!yW6EC`q0@|mXbvUE&YCqU)Q7JI&6@BrP0#T8q+#pJF|WJg!a zk-5}c#b(F)@_nC$pwo{t*=@jJ>#g>V^U+99DffQzPmT3p2V z656wicTPh*z>QqG9R^d_tFjn=hgGUYVJR(Bri_$A?yn-^ihwj_Bjtl*YhI>NwlH!pbuHG^mKv&E`=A2orcYIG#$sM;7 zNgQ^^C?kf^LN8LcV-xT}?`n@(i~ zabsAO2ffrOm81@hunfoB5tdDWO8tW=X;DRxF&%_ueL+gijET>~z#)Evs}05oj?)E1HQjhUu&0IVM+E?qArbC_c&-`=Q^jy=A^*%^!7 zo}(e5q{G=z(~{F;FeL?(4gq<5!B$WKgh*%tdLca%Mf*7C2X|DdQ2mnTtn(?;zRG|W z84FAy6m$->Kvx$eK(IMF!;p?v48w&?X+evso&Y?kkTF2hsfi6G%1QLkxUskkQED5` zh{gKgv}EE#wX*p=sC4Tn0MQCSXQc*ij&hdXXq=k9vUYVb*-N}T)-5~MRaKYnC(cSC zZ<%Rt?I#SxQkw?1AgFmF7B`<|Ffp%miZVh?$ArSN^y}$H>>{3WDLdV_WyI*}78N_J zYSGcIYPQLQmU{1wbhyjei77TqoSe!mq&zctN%hn)vvNw2672_9@nkmP)=gAm7U}$o zY%b!J&`37mP{&^XrPL@h5TxA7M}U1t?WfLgaS3}FPfx<)G3H&kI!xjuiCKn|+*gkw z)DfTz?BD`t5XndcT!jFS1>dD@?5e@b3uY(LeQC6PMNtq)>u$(23Z{O0qs~5TeNhEJ wb(Nsu66odWj0W;xZ}ik60A7x=7^fkAG=qKodHi|&`Gf!b|7RSY%>bYQ058?IrT_o{ literal 0 HcmV?d00001 diff --git a/libs/features/mas/commerce/internal/tacocat-wcs-client-1.17.0.tgz b/libs/features/mas/commerce/internal/tacocat-wcs-client-1.17.0.tgz deleted file mode 100644 index f7a959da63466a2d9aa7e91d77d200894fbd92f8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7374 zc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X$ zjp}a96XWpxns}PprCY!Vtj9ULaOZ~I#{4^P4cJ-_-rjI%79UuXko=Or8hZAG+r%Ha!&j{7L9wo^+WVPmK5>x(BUC;k9RGreG&p02mey4Lu2I z>Db3%a!ULl8Fj8Y_(yt9hKAzVqK`#8->hCprFyvketpZclWFEkmp6inYD?1Zw}?Bl zR{pZ4`qBlGI24HuAeYQXoA1VQH%5EGUROVrLXy97rj&eCnAMHro`2xhB=_*=@9O`n z|Ndu|#9z9NdjG%s;(5vc@2))U|9qT}td-b>5vBqhgrH~~k}Ll+(?CZe zdzX5vA3~&Ib1)zQhxV*{?-yV*>R3F@6wJbSavD)~CV-F;EDr~ZDTxSX1T8Lx>Gfhd ziS2#@M{p>9Nlrm75F_aYu}i>4Lnr|0chKVECET`-78i>}`T^CY}~>(|J(JK4C*T?rlg|eTpPMn-4(y*tXl{MLFpxb#eZI1I7^8n3-|mVXBHMI zo@DW5zgxuN#haOEBrKw_z~X=o7Zq+SwB#VBWSlU{lk_?d3|t(jGo;+^@g$AZ)1QZw z7iQJ|WiVoz82)GG7b=G|6~{!NsRgBcS;rDLHFZrJkE8!V_(Z(U4}H!aQ~xh_pLdJ; zzqj-h|9#~6@4kH`tBpR)oy{#55zcM9e1kbY5Q4m~4oOP^5UHAXRhD1zF?*|gx5Q6xx5;tTy>=Z6x%%`Q86j_oCQGzt|V2_i^!BDklR8F9@dMDCY*BcgNW zVVMmb%(~{_;GdwVk_`ptPoTo_=5gdyERW-);vXjt`r*hn7v}oO8Y3Rnwd^5GVEZ3Az zFHH-J0hb#OBmk@c0BVC} A-2eap diff --git a/libs/features/mas/commerce/libs/commerce.d.ts b/libs/features/mas/commerce/libs/commerce.d.ts index 4f909701e9..20c92d59e8 100644 --- a/libs/features/mas/commerce/libs/commerce.d.ts +++ b/libs/features/mas/commerce/libs/commerce.d.ts @@ -2,11 +2,6 @@ import { CheckoutType, WorkflowStep, } from '@pandora/commerce-checkout-url-builder'; -import { - ProviderEnvironment, - Landscape, - Environment, -} from '@pandora/data-source-utils'; import { PriceDetails, ResolvedOffer, @@ -131,8 +126,8 @@ declare global { interface Settings { country: string; - env: ProviderEnvironment; - landscape: Landscape; + env: string; + landscape: string; // TODO: ideally, this setting should be processed by price template and belong to price settings forceTaxExclusive: boolean; language: string; @@ -334,7 +329,6 @@ declare global { checkoutWorkflow: CheckoutType; checkoutWorkflowStep: WorkflowStep; entitlement: boolean; - upgrade: boolean; modal: boolean; extraOptions: Partial>; } @@ -575,8 +569,7 @@ declare global { wcsApiKey: string; wcsBufferDelay: number; wcsBufferLimit: number; - wcsEnv: Environment; - domainSwitch: boolean; + wcsURL: string; } } } diff --git a/libs/features/mas/commerce/package.json b/libs/features/mas/commerce/package.json index 4b27bd07eb..7a1964d597 100644 --- a/libs/features/mas/commerce/package.json +++ b/libs/features/mas/commerce/package.json @@ -11,7 +11,7 @@ "types": "src/index.d.ts", "sideEffects": false, "scripts": { - "build": "npm run build:bundle && npm run build:types", + "build": "npm run test:ci && npm run build:bundle && npm run build:types", "build:bundle": "node ./build.mjs", "build:types": "cp ./src/index.d.ts ./libs/commerce.d.ts", "build:watch": "npm run build:bundle --watch", @@ -20,16 +20,11 @@ }, "dependencies": { "@dexter/tacocat-consonant-templates": "file:./internal/tacocat-consonant-templates-1.13.0.tgz", - "@dexter/tacocat-core": "file:./internal/tacocat-core-1.12.2.tgz", - "@dexter/tacocat-wcs-client": "file:./internal/tacocat-wcs-client-1.17.0.tgz", + "@dexter/tacocat-core": "file:./internal/tacocat-core-1.13.0.tgz", "@pandora/commerce-checkout-url-builder": "file:./internal/commerce-checkout-url-builder-1.6.0.tgz", "@pandora/data-models-odm": "file:./internal/data-models-odm-0.5.4.tgz", - "@pandora/data-source-wcs": "file:./internal/data-source-wcs-0.2.8.tgz", "@pandora/data-source-utils": "file:./internal/data-source-utils-0.3.1.tgz", "@pandora/fetch": "file:./internal/fetch-1.3.4.tgz", - "@pandora/react-auth-provider": "file:./internal/react-auth-provider-1.2.1.tgz", - "@pandora/react-env-provider": "file:./internal/react-env-provider-1.2.2.tgz", - "@pandora/react-fetch-provider": "file:./internal/react-fetch-provider-1.2.2.tgz", "@pandora/logger": "file:./internal/logger-1.3.0.tgz" }, "devDependencies": { diff --git a/libs/features/mas/commerce/src/constants.js b/libs/features/mas/commerce/src/constants.js index 29be2fafa6..77cb8387b9 100644 --- a/libs/features/mas/commerce/src/constants.js +++ b/libs/features/mas/commerce/src/constants.js @@ -19,8 +19,16 @@ export const PARAM_LANDSCAPE = 'commerce.landscape'; export const PARAM_AOS_API_KEY = 'commerce.aosKey'; export const PARAM_WCS_API_KEY = 'commerce.wcsKey'; +export const WCS_PROD_URL = 'https://www.adobe.com/web_commerce_artifact'; +export const WCS_STAGE_URL = 'https://www.stage.adobe.com/web_commerce_artifact_stage'; + export const STATE_FAILED = 'failed'; export const STATE_PENDING = 'pending'; export const STATE_RESOLVED = 'resolved'; export const TAG_NAME_SERVICE = 'wcms-commerce'; + +export const Landscape = { + DRAFT: "DRAFT", + PUBLISHED: "PUBLISHED" +} diff --git a/libs/features/mas/commerce/src/defaults.js b/libs/features/mas/commerce/src/defaults.js index 46921d00fb..da7ac92f14 100644 --- a/libs/features/mas/commerce/src/defaults.js +++ b/libs/features/mas/commerce/src/defaults.js @@ -2,9 +2,8 @@ import { CheckoutWorkflow, CheckoutWorkflowStep, Env, - Landscape, - WcsEnv, } from './external.js'; +import { Landscape } from './constants.js'; /** @type {Commerce.Defaults} */ export const Defaults = Object.freeze({ @@ -16,7 +15,6 @@ export const Defaults = Object.freeze({ displayPerUnit: false, displayRecurrence: true, displayTax: false, - domainSwitch: false, env: Env.PRODUCTION, forceTaxExclusive: false, language: 'en', @@ -27,7 +25,7 @@ export const Defaults = Object.freeze({ quantity: 1, wcsApiKey: 'wcms-commerce-ims-ro-user-milo', wcsBufferDelay: 1, - wcsEnv: WcsEnv.PRODUCTION, + wcsURL: 'https://www.adobe.com/web_commerce_artifact', landscape: Landscape.PUBLISHED, wcsBufferLimit: 1, }); diff --git a/libs/features/mas/commerce/src/external.js b/libs/features/mas/commerce/src/external.js index 8680e7f772..c611e50e60 100644 --- a/libs/features/mas/commerce/src/external.js +++ b/libs/features/mas/commerce/src/external.js @@ -5,12 +5,6 @@ import { buildCheckoutUrl, } from '@pandora/commerce-checkout-url-builder'; import { Term, Commitment } from '@pandora/data-models-odm'; -import { - Environment, - Landscape, - ProviderEnvironment, -} from '@pandora/data-source-utils'; -import { webCommerceArtifact } from '@pandora/data-source-wcs'; import { price, @@ -33,14 +27,11 @@ import { omitProperties, toBoolean, toEnumeration, - toKebabCase, toPositiveFiniteInteger, -} from '@dexter/tacocat-core'; -import { applyPlanType, forceTaxExclusivePrice, PlanType, -} from '@dexter/tacocat-wcs-client'; +} from '@dexter/tacocat-core'; const { freeze } = Object; @@ -48,10 +39,13 @@ const { freeze } = Object; const CheckoutWorkflow = freeze({ ...CheckoutType }); /** @type {Commerce.Checkout.CheckoutWorkflowStep} */ const CheckoutWorkflowStep = freeze({ ...WorkflowStep }); -const Env = freeze({ ...ProviderEnvironment }); +const Env = { + STAGE: "STAGE", + PRODUCTION: "PRODUCTION", + LOCAL: "LOCAL" +}; /** @type {Commerce.Wcs.WcsCommitment} */ const WcsCommitment = freeze({ ...Commitment }); -const WcsEnv = freeze({ ...Environment }); /** @type {Commerce.Wcs.WcsPlanType} */ const WcsPlanType = freeze({ ...PlanType }); /** @type {Commerce.Wcs.WcsTerm} */ @@ -62,8 +56,6 @@ export { CheckoutWorkflowStep, Env, WcsCommitment, - WcsEnv, - Landscape, WcsTerm, WcsPlanType, applyPlanType, @@ -87,7 +79,5 @@ export { discount, toBoolean, toEnumeration, - toKebabCase, toPositiveFiniteInteger, - webCommerceArtifact, }; diff --git a/libs/features/mas/commerce/src/index.d.ts b/libs/features/mas/commerce/src/index.d.ts index 4f909701e9..20c92d59e8 100644 --- a/libs/features/mas/commerce/src/index.d.ts +++ b/libs/features/mas/commerce/src/index.d.ts @@ -2,11 +2,6 @@ import { CheckoutType, WorkflowStep, } from '@pandora/commerce-checkout-url-builder'; -import { - ProviderEnvironment, - Landscape, - Environment, -} from '@pandora/data-source-utils'; import { PriceDetails, ResolvedOffer, @@ -131,8 +126,8 @@ declare global { interface Settings { country: string; - env: ProviderEnvironment; - landscape: Landscape; + env: string; + landscape: string; // TODO: ideally, this setting should be processed by price template and belong to price settings forceTaxExclusive: boolean; language: string; @@ -334,7 +329,6 @@ declare global { checkoutWorkflow: CheckoutType; checkoutWorkflowStep: WorkflowStep; entitlement: boolean; - upgrade: boolean; modal: boolean; extraOptions: Partial>; } @@ -575,8 +569,7 @@ declare global { wcsApiKey: string; wcsBufferDelay: number; wcsBufferLimit: number; - wcsEnv: Environment; - domainSwitch: boolean; + wcsURL: string; } } } diff --git a/libs/features/mas/commerce/src/index.js b/libs/features/mas/commerce/src/index.js index 762a9906ab..2a46453a1e 100644 --- a/libs/features/mas/commerce/src/index.js +++ b/libs/features/mas/commerce/src/index.js @@ -1,12 +1,10 @@ import { CheckoutLink } from './checkout-link.js'; -import { TAG_NAME_SERVICE } from './constants.js'; +import { TAG_NAME_SERVICE, Landscape } from './constants.js'; import { Defaults } from './defaults.js'; import { CheckoutWorkflow, CheckoutWorkflowStep, WcsCommitment, - WcsEnv, - Landscape, WcsTerm, WcsPlanType, applyPlanType, @@ -25,7 +23,6 @@ export { InlinePrice, Log, WcsCommitment, - WcsEnv, Landscape, WcsTerm, WcsPlanType, diff --git a/libs/features/mas/commerce/src/settings.js b/libs/features/mas/commerce/src/settings.js index b780e36c2b..1c47fdde58 100644 --- a/libs/features/mas/commerce/src/settings.js +++ b/libs/features/mas/commerce/src/settings.js @@ -1,11 +1,9 @@ -import { PARAM_ENV, PARAM_LANDSCAPE } from './constants.js'; +import { PARAM_ENV, PARAM_LANDSCAPE, Landscape, WCS_PROD_URL, WCS_STAGE_URL } from './constants.js'; import { Defaults } from './defaults.js'; import { CheckoutWorkflow, CheckoutWorkflowStep, Env, - WcsEnv, - Landscape, getParameter, toBoolean, toEnumeration, @@ -135,15 +133,16 @@ function getSettings(config = {}) { // TODO: add alias names for meta, search and storage // See https://git.corp.adobe.com/wcms/tacocat.js/pull/348#discussion_r6557570 const { commerce = {}, locale = undefined } = config; - const hostEnv = - config.env?.name === HostEnv.PROD - ? HostEnv.PROD - : toEnumeration( - getParameter(PARAM_ENV, commerce, { metadata: false }), - HostEnv, - HostEnv.PROD, - ); - const env = hostEnv === HostEnv.STAGE ? Env.STAGE : Env.PRODUCTION; + let env = Env.PRODUCTION; + let wcsURL = WCS_PROD_URL; + + const lowHostEnv = ['local', 'stage'].includes(config.env?.name); + const forceWcsStage = getParameter(PARAM_ENV, commerce, { metadata: false })?.toLowerCase() === 'stage'; + if (lowHostEnv && forceWcsStage) { + env = Env.STAGE; + wcsURL = WCS_STAGE_URL; + } + const checkoutClientId = getParameter('checkoutClientId', commerce) ?? Defaults.checkoutClientId; const checkoutWorkflow = toEnumeration( @@ -204,7 +203,6 @@ function getSettings(config = {}) { getParameter('wcsBufferLimit', commerce), Defaults.wcsBufferLimit, ); - const domainSwitch = toBoolean(getParameter('domain.switch', commerce), false); return { ...getLocaleSettings({ locale }), @@ -227,9 +225,8 @@ function getSettings(config = {}) { wcsApiKey, wcsBufferDelay, wcsBufferLimit, - wcsEnv: env === Env.STAGE ? WcsEnv.STAGE : WcsEnv.PRODUCTION, + wcsURL, landscape, - domainSwitch, }; } diff --git a/libs/features/mas/commerce/src/wcs.js b/libs/features/mas/commerce/src/wcs.js index 3c3088bab1..1773378891 100644 --- a/libs/features/mas/commerce/src/wcs.js +++ b/libs/features/mas/commerce/src/wcs.js @@ -8,42 +8,22 @@ import { WcsPlanType, WcsTerm, applyPlanType, - webCommerceArtifact, } from './external.js'; import { Log } from './log.js'; -/** @typedef {import('@pandora/data-source-wcs').GetWebCommerceArtifactOptions} WcsOptions */ -/** @typedef {import('@pandora/data-source-wcs').getWebCommerceArtifactPromise} getWcsOffers */ /** * @typedef {Map void, * reject: (reason: Error) => void * }>} WcsPromises */ -const ACOM = '_acom'; -const WcsBaseUrl = { - [Env.PRODUCTION]: 'https://www.adobe.com', - [Env.STAGE]: 'https://www.stage.adobe.com', - [Env.PRODUCTION + ACOM]: 'https://www.adobe.com', - [Env.STAGE + ACOM]: 'https://www.stage.adobe.com', -}; - /** * @param {{ settings: Commerce.Wcs.Settings }} params * @returns {Commerce.Wcs.Client} */ export function Wcs({ settings }) { const log = Log.module('wcs'); - const { env, domainSwitch, wcsApiKey: apiKey } = settings; - const baseUrl = domainSwitch ? WcsBaseUrl[env + ACOM] : WcsBaseUrl[env]; - // Create @pandora Wcs client. - const fetchOptions = { - apiKey, - baseUrl, - fetch: window.fetch.bind(window), - }; - const getWcsOffers = webCommerceArtifact(fetchOptions); - + const { env, wcsApiKey: apiKey } = settings; /** * Cache of promises resolving to arrays of Wcs offers grouped by osi-based keys. * @type {Map>} @@ -51,7 +31,7 @@ export function Wcs({ settings }) { const cache = new Map(); /** * Queue of pending requests to Wcs grouped by locale and promo. - * @type {Map} + * @type {Map} */ const queue = new Map(); let timer; @@ -63,29 +43,40 @@ export function Wcs({ settings }) { * If WCS does not provide an offer for particular osi, * its pending promise will be rejected with "not found". * In case of any other Wcs/Network error, promises are rejected with "bad request". - * @param {WcsOptions} options + * @param options * @param {WcsPromises} promises * @param reject - used for recursion, prevents rejection of promises with missing offers */ async function resolveWcsOffers(options, promises, reject = true) { let message = ERROR_MESSAGE_OFFER_NOT_FOUND; + log.debug('Fetching:', options); try { - log.debug('Fetching:', options); - options.offerSelectorIds = options.offerSelectorIds.sort(); - const { data } = await getWcsOffers( - options, - { - apiKey, - environment: settings.wcsEnv, - // @ts-ignore - landscape: env === Env.STAGE ? 'ALL' : settings.landscape, - }, - ({ resolvedOffers }) => ({ - offers: resolvedOffers.map(applyPlanType), - }), - ); + options.offerSelectorIds = options.offerSelectorIds.sort(); + const url = new URL(settings.wcsURL); + url.searchParams.set('offer_selector_ids', options.offerSelectorIds.join(',')); + url.searchParams.set('country', options.country); + url.searchParams.set('locale', options.locale); + url.searchParams.set('landscape', env === Env.STAGE ? 'ALL' : settings.landscape); + url.searchParams.set('api_key', apiKey); + // language can be undefined if its a UK offer + if (options.language) { + url.searchParams.set('language', options.language); + } + if (options.promotionCode) { + url.searchParams.set('promotion_code', options.promotionCode); + } + if (options.currency) { + url.searchParams.set('currency', options.currency); + } + + const response = await fetch(url.toString(), { + credentials: 'omit' + }); + if (response.ok) { + const data = await response.json(); log.debug('Fetched:', options, data); - const { offers } = data ?? {}; + let offers = data.resolvedOffers ?? []; + offers = offers.map(applyPlanType); // resolve all promises that have offers promises.forEach(({ resolve }, offerSelectorId) => { // select offers with current OSI @@ -99,25 +90,28 @@ export function Wcs({ settings }) { promises.delete(offerSelectorId); resolve(resolved); } - }); - } catch (error) { - // in case of 404 WCS error caused by a request with multiple osis, - // fallback to `fetch-by-one` strategy - if (error.status === 404 && options.offerSelectorIds.length > 1) { - log.debug('Multi-osi 404, fallback to fetch-by-one strategy'); - await Promise.allSettled( - options.offerSelectorIds.map((offerSelectorId) => - resolveWcsOffers( - { ...options, offerSelectorIds: [offerSelectorId] }, - promises, - false, // do not reject promises for missing offers, this will be done below - ), + }); + } + // in case of 404 WCS error caused by a request with multiple osis, + // fallback to `fetch-by-one` strategy + else if (response.status === 404 && options.offerSelectorIds.length > 1) { + log.debug('Multi-osi 404, fallback to fetch-by-one strategy'); + await Promise.allSettled( + options.offerSelectorIds.map((offerSelectorId) => + resolveWcsOffers( + { ...options, offerSelectorIds: [offerSelectorId] }, + promises, + false, // do not reject promises for missing offers, this will be done below ), - ); - } else { - log.error('Failed:', options, error); - message = ERROR_MESSAGE_BAD_REQUEST; - } + ), + ); + } else { + message = ERROR_MESSAGE_BAD_REQUEST; + log.error(message, options); + } + } catch (e) { + message = ERROR_MESSAGE_BAD_REQUEST; + log.error(message, options, e); } if (reject && promises.size) { diff --git a/libs/features/mas/commerce/test/settings.test.js b/libs/features/mas/commerce/test/settings.test.js index 65aefb560b..4ab9f2da9c 100644 --- a/libs/features/mas/commerce/test/settings.test.js +++ b/libs/features/mas/commerce/test/settings.test.js @@ -1,4 +1,5 @@ -import { Env, WcsEnv, Landscape } from '../src/external.js'; +import { Env } from '../src/external.js'; +import { Landscape, WCS_PROD_URL, WCS_STAGE_URL } from '../src/constants.js'; import { Defaults } from '../src/defaults.js'; import { getSettings } from '../src/settings.js'; @@ -11,7 +12,11 @@ describe('getSettings', () => { after(() => { document.head.querySelectorAll('meta').forEach((meta) => meta.remove()); window.history.replaceState({}, '', href); + }); + + afterEach(() => { window.sessionStorage.clear(); + window.history.replaceState({}, '', href); }); before(() => { @@ -28,10 +33,58 @@ describe('getSettings', () => { }); }); - it('uses location search, document metadata and storage', () => { - const checkoutClientId = 'checkout-client-id'; - const url = `${window.location.href}&checkoutClientId=${checkoutClientId}`; - window.history.replaceState({}, '', url); + it('overrides with search parameters', () => { + const checkoutClientId = 'adobecom'; + const checkoutWorkflowStep = 'segmentation'; + const promotionCode = 'nicopromo'; + + const url = new URL(window.location.href); + url.searchParams.set('checkoutClientId', checkoutClientId); + url.searchParams.set('checkoutWorkflowStep', checkoutWorkflowStep); + url.searchParams.set('promotionCode', promotionCode); + url.searchParams.set('displayOldPrice', 'false'); + url.searchParams.set('displayPerUnit', 'true'); + url.searchParams.set('displayRecurrence', 'false'); + url.searchParams.set('displayTax', 'true'); + url.searchParams.set('entitlement', 'true'); + url.searchParams.set('modal', 'true'); + url.searchParams.set('commerce.landscape', 'DRAFT'); + url.searchParams.set('commerce.env', 'STAGE'); + url.searchParams.set('wcsBufferDelay', '30'); + url.searchParams.set('wcsBufferLimit', '5'); + url.searchParams.set('quantity', '2'); + url.searchParams.set('wcsApiKey', 'testapikey'); + window.history.replaceState({}, '', url.toString()); + + const config = { commerce: {}, env: { name: 'stage' }, }; + expect( + getSettings(config), + ).to.deep.equal({ + ...Defaults, + checkoutClientId, + checkoutWorkflowStep, + promotionCode, + displayOldPrice: false, + displayPerUnit: true, + displayRecurrence: false, + displayTax: true, + entitlement: true, + modal: true, + landscape: 'DRAFT', + wcsBufferDelay: 30, + wcsBufferLimit: 5, + quantity: [2], + wcsApiKey: 'testapikey', + locale: "en_US", + priceLiteralsURL: undefined, + priceLiteralsPromise: undefined, + env: "STAGE", + wcsURL: WCS_STAGE_URL + }); + }); + + + it('uses document metadata and storage', () => { const wcsApiKey = 'wcs-api-key'; const meta = document.createElement('meta'); meta.content = wcsApiKey; @@ -54,7 +107,6 @@ describe('getSettings', () => { ...Defaults, forceTaxExclusive: true, promotionCode: 'promo1', - checkoutClientId, country: 'NO', env: Env.STAGE, language: 'nb', @@ -63,53 +115,61 @@ describe('getSettings', () => { priceLiteralsPromise: undefined, quantity: [Defaults.quantity], wcsApiKey, - wcsEnv: WcsEnv.STAGE, + wcsURL: WCS_STAGE_URL, landscape: Landscape.DRAFT, }); window.sessionStorage.removeItem(PARAM_ENV); }); - it('if host env is "dev" - override commerce landscape', () => { - window.sessionStorage.setItem(PARAM_LANDSCAPE, 'DRAFT'); + it('host env "local" -> WCS prod origin + prod akamai', () => { + const config = { commerce: {}, env: { name: 'local' }, }; + const settings = getSettings(config); + expect(settings.wcsURL).to.equal(WCS_PROD_URL); + expect(settings.env).to.equal(Env.PRODUCTION); + }); - const config = { - commerce: {}, - env: { name: 'local' }, - }; - expect(getSettings(config)).to.deep.equal({ - ...Defaults, - checkoutClientId: 'checkout-client-id', - wcsApiKey: 'wcs-api-key', - env: Env.PRODUCTION, - locale: 'en_US', - priceLiteralsURL: undefined, - priceLiteralsPromise: undefined, - quantity: [Defaults.quantity], - wcsEnv: WcsEnv.PRODUCTION, - landscape: Landscape.DRAFT, - }); + it('host env "stage" -> WCS prod origin + prod akamai', () => { + const config = { commerce: {}, env: { name: 'stage' }, }; + const settings = getSettings(config); + expect(settings.wcsURL).to.equal(WCS_PROD_URL); + expect(settings.env).to.equal(Env.PRODUCTION); + }); + + it('host env "prod" -> WCS prod origin + prod akamai', () => { + const config = { commerce: {}, env: { name: 'prod' }, }; + const settings = getSettings(config); + expect(settings.wcsURL).to.equal(WCS_PROD_URL); + expect(settings.env).to.equal(Env.PRODUCTION); }); - it('if host env is "prod" - doesnt override commerce env and landscape', () => { + it('host env "local" - override landscape and WCS origin (_stage)', () => { window.sessionStorage.setItem(PARAM_ENV, 'stage'); window.sessionStorage.setItem(PARAM_LANDSCAPE, 'DRAFT'); + const config = { commerce: {}, env: { name: 'local' }, }; + const settings = getSettings(config); + expect(settings.wcsURL).to.equal(WCS_STAGE_URL); + expect(settings.landscape).to.equal(Landscape.DRAFT); + expect(settings.env).to.equal(Env.STAGE); + }); - const config = { - commerce: {}, - env: { name: 'prod' }, - }; - expect(getSettings(config)).to.deep.equal({ - ...Defaults, - checkoutClientId: 'checkout-client-id', - wcsApiKey: 'wcs-api-key', - env: Env.PRODUCTION, - locale: 'en_US', - priceLiteralsURL: undefined, - priceLiteralsPromise: undefined, - quantity: [Defaults.quantity], - wcsEnv: WcsEnv.PRODUCTION, - landscape: Landscape.PUBLISHED, - }); + it('host env "stage" - override landscape and WCS origin (_stage)', () => { + window.sessionStorage.setItem(PARAM_ENV, 'stage'); + window.sessionStorage.setItem(PARAM_LANDSCAPE, 'DRAFT'); + const config = { commerce: {}, env: { name: 'stage' }, }; + const settings = getSettings(config); + expect(settings.wcsURL).to.equal(WCS_STAGE_URL); + expect(settings.landscape).to.equal(Landscape.DRAFT); + expect(settings.env).to.equal(Env.STAGE); + }); + + it('if host env is "prod" - cant override landscape or WCS origin', () => { + window.sessionStorage.setItem(PARAM_ENV, 'stage'); + window.sessionStorage.setItem(PARAM_LANDSCAPE, 'DRAFT'); + const config = { commerce: {}, env: { name: 'prod' }, }; + const settings = getSettings(config); + expect(settings.wcsURL).to.equal(WCS_PROD_URL); + expect(settings.landscape).to.equal(Landscape.PUBLISHED); + expect(settings.env).to.equal(Env.PRODUCTION); }); [ diff --git a/libs/features/mas/commerce/test/wcs.test.js b/libs/features/mas/commerce/test/wcs.test.js index da6c5bad2d..f8f26fdfb5 100644 --- a/libs/features/mas/commerce/test/wcs.test.js +++ b/libs/features/mas/commerce/test/wcs.test.js @@ -1,4 +1,5 @@ import { ERROR_MESSAGE_OFFER_NOT_FOUND } from '../src/constants.js'; +import { Defaults } from '../src/defaults.js'; import { Wcs } from '../src/wcs.js'; import { mockFetch } from './mocks/fetch.js'; @@ -12,9 +13,9 @@ describe('resolveOfferSelectors', () => { const client = Wcs({ // @ts-ignore settings: { - country: 'US', - language: 'en', + ...Defaults, locale: 'en_US', + wcsBufferLimit: 4, }, }); const results = await Promise.allSettled( @@ -41,8 +42,7 @@ describe('resolveOfferSelectors', () => { const client = Wcs({ // @ts-ignore settings: { - country: 'US', - language: 'en', + ...Defaults, locale: 'en_US', wcsBufferLimit: 2, }, diff --git a/libs/features/mas/package-lock.json b/libs/features/mas/package-lock.json index 30161f54af..50c44c2a05 100644 --- a/libs/features/mas/package-lock.json +++ b/libs/features/mas/package-lock.json @@ -69,17 +69,12 @@ "version": "2.0.0", "dependencies": { "@dexter/tacocat-consonant-templates": "file:./internal/tacocat-consonant-templates-1.13.0.tgz", - "@dexter/tacocat-core": "file:./internal/tacocat-core-1.12.2.tgz", - "@dexter/tacocat-wcs-client": "file:./internal/tacocat-wcs-client-1.17.0.tgz", + "@dexter/tacocat-core": "file:./internal/tacocat-core-1.13.0.tgz", "@pandora/commerce-checkout-url-builder": "file:./internal/commerce-checkout-url-builder-1.6.0.tgz", "@pandora/data-models-odm": "file:./internal/data-models-odm-0.5.4.tgz", "@pandora/data-source-utils": "file:./internal/data-source-utils-0.3.1.tgz", - "@pandora/data-source-wcs": "file:./internal/data-source-wcs-0.2.8.tgz", "@pandora/fetch": "file:./internal/fetch-1.3.4.tgz", - "@pandora/logger": "file:./internal/logger-1.3.0.tgz", - "@pandora/react-auth-provider": "file:./internal/react-auth-provider-1.2.1.tgz", - "@pandora/react-env-provider": "file:./internal/react-env-provider-1.2.2.tgz", - "@pandora/react-fetch-provider": "file:./internal/react-fetch-provider-1.2.2.tgz" + "@pandora/logger": "file:./internal/logger-1.3.0.tgz" }, "devDependencies": { "@web/dev-server-import-maps": "^0.1.1", @@ -89,44 +84,6 @@ "esbuild": "0.18.11" } }, - "commons/node_modules/esbuild": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", - "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", - "extraneous": true, - "hasInstallScript": true, - "bin": { - "esbuild": "bin/esbuild" - }, - "engines": { - "node": ">=12" - }, - "optionalDependencies": { - "@esbuild/aix-ppc64": "0.21.5", - "@esbuild/android-arm": "0.21.5", - "@esbuild/android-arm64": "0.21.5", - "@esbuild/android-x64": "0.21.5", - "@esbuild/darwin-arm64": "0.21.5", - "@esbuild/darwin-x64": "0.21.5", - "@esbuild/freebsd-arm64": "0.21.5", - "@esbuild/freebsd-x64": "0.21.5", - "@esbuild/linux-arm": "0.21.5", - "@esbuild/linux-arm64": "0.21.5", - "@esbuild/linux-ia32": "0.21.5", - "@esbuild/linux-loong64": "0.21.5", - "@esbuild/linux-mips64el": "0.21.5", - "@esbuild/linux-ppc64": "0.21.5", - "@esbuild/linux-riscv64": "0.21.5", - "@esbuild/linux-s390x": "0.21.5", - "@esbuild/linux-x64": "0.21.5", - "@esbuild/netbsd-x64": "0.21.5", - "@esbuild/openbsd-x64": "0.21.5", - "@esbuild/sunos-x64": "0.21.5", - "@esbuild/win32-arm64": "0.21.5", - "@esbuild/win32-ia32": "0.21.5", - "@esbuild/win32-x64": "0.21.5" - } - }, "mas": { "name": "@adobe/mas", "version": "0.0.1", @@ -176,28 +133,6 @@ "@esbuild/win32-x64": "0.21.5" } }, - "node_modules/@75lb/deep-merge": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@75lb/deep-merge/-/deep-merge-1.1.1.tgz", - "integrity": "sha512-xvgv6pkMGBA6GwdyJbNAnDmfAIR/DfWhrj9jgWh3TY7gRm3KO46x/GPjRg6wJ0nOepwqrNxFfojebh0Df4h4Tw==", - "dev": true, - "dependencies": { - "lodash.assignwith": "^4.2.0", - "typical": "^7.1.1" - }, - "engines": { - "node": ">=12.17" - } - }, - "node_modules/@75lb/deep-merge/node_modules/typical": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/typical/-/typical-7.1.1.tgz", - "integrity": "sha512-T+tKVNs6Wu7IWiAce5BgMd7OZfNYUndHwc5MknN+UHOudi7sGZzuHdCadllRuqJ3fPtgFtIH9+lt9qRv6lmpfA==", - "dev": true, - "engines": { - "node": ">=12.17" - } - }, "node_modules/@adobe/mas": { "resolved": "mas", "link": true @@ -358,22 +293,9 @@ } }, "node_modules/@dexter/tacocat-core": { - "version": "1.12.2", - "resolved": "file:commerce/internal/tacocat-core-1.12.2.tgz", - "integrity": "sha512-ydBx5I1uxsQY5KjlN7VVs+J7kg0js/x2fBjuQ0DY9cKgZY7nYnzZfz/E7q8uGTVuqk5hW9cVzDFGLazUVqAmYg==" - }, - "node_modules/@dexter/tacocat-wcs-client": { - "version": "1.17.0", - "resolved": "file:commerce/internal/tacocat-wcs-client-1.17.0.tgz", - "integrity": "sha512-UVuXQaVvLhhFSYfq6bIYVOhEDMXAh95xCBR7qizH8ug0+DouDl12qjm+nWZGNcnw3iXke9tvYH0aGj+dYVQ6Uw==", - "dependencies": { - "@dexter/tacocat-consonant-templates": "^1.0.0", - "@dexter/tacocat-core": "^1.0.0", - "@pandora/commerce-checkout-url-builder": "^1.5.2", - "@pandora/data-models-odm": "0.5.4", - "@pandora/data-source-utils": "0.3.1", - "@pandora/data-source-wcs": "0.2.8" - } + "version": "1.13.0", + "resolved": "file:commerce/internal/tacocat-core-1.13.0.tgz", + "integrity": "sha512-3XWBVZk8/pvFxE+qcwcDHgpSYVrhK1Sm8I4PfMELpCxP2l0MbcxiBSMXAyLJZXbjSVT5gCzG45aHZEIAerBjBw==" }, "node_modules/@esbuild/aix-ppc64": { "version": "0.21.5", @@ -780,9 +702,9 @@ } }, "node_modules/@eslint/config-array": { - "version": "0.17.0", - "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.17.0.tgz", - "integrity": "sha512-A68TBu6/1mHHuc5YJL0U0VVeGNiklLAL6rRmhTCP2B5XjWLMnrX+HkO+IAXyHvks5cyyY1jjK5ITPQ1HGS2EVA==", + "version": "0.17.1", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.17.1.tgz", + "integrity": "sha512-BlYOpej8AQ8Ev9xVqroV7a02JK3SkBAaN9GfMMH9W6Ch8FlQlkjGw4Ir7+FgYwfirivAf4t+GtzuAxqfukmISA==", "dev": true, "dependencies": { "@eslint/object-schema": "^2.1.4", @@ -817,9 +739,9 @@ } }, "node_modules/@eslint/js": { - "version": "9.6.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.6.0.tgz", - "integrity": "sha512-D9B0/3vNg44ZeWbYMpBoXqNP4j6eQD5vNwIlGAuFRRzK/WtT/jvDQW3Bi9kkf3PMDMlM7Yi+73VLUsn5bJcl8A==", + "version": "9.9.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.9.0.tgz", + "integrity": "sha512-hhetes6ZHP3BlXLxmd8K2SNgkhNSi+UcecbnwWKwpP7kyi/uC75DJ1lOOBO3xrC4jyojtGE3YxKZPHfk4yrgug==", "dev": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -850,26 +772,26 @@ "dev": true }, "node_modules/@floating-ui/core": { - "version": "1.6.6", - "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.6.6.tgz", - "integrity": "sha512-Vkvsw6EcpMHjvZZdMkSY+djMGFbt7CRssW99Ne8tar2WLnZ/l3dbxeTShbLQj+/s35h+Qb4cmnob+EzwtjrXGQ==", + "version": "1.6.7", + "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.6.7.tgz", + "integrity": "sha512-yDzVT/Lm101nQ5TCVeK65LtdN7Tj4Qpr9RTXJ2vPFLqtLxwOrpoxAHAJI8J3yYWUc40J0BDBheaitK5SJmno2g==", "dependencies": { - "@floating-ui/utils": "^0.2.6" + "@floating-ui/utils": "^0.2.7" } }, "node_modules/@floating-ui/dom": { - "version": "1.6.9", - "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.6.9.tgz", - "integrity": "sha512-zB1PcI350t4tkm3rvUhSRKa9sT7vH5CrAbQxW+VaPYJXKAO0gsg4CTueL+6Ajp7XzAQC8CW4Jj1Wgqc0sB6oUQ==", + "version": "1.6.10", + "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.6.10.tgz", + "integrity": "sha512-fskgCFv8J8OamCmyun8MfjB1Olfn+uZKjOKZ0vhYF3gRmEUXcGOjxWL8bBr7i4kIuPZ2KD2S3EUIOxnjC8kl2A==", "dependencies": { "@floating-ui/core": "^1.6.0", - "@floating-ui/utils": "^0.2.6" + "@floating-ui/utils": "^0.2.7" } }, "node_modules/@floating-ui/utils": { - "version": "0.2.6", - "resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.2.6.tgz", - "integrity": "sha512-0KI3zGxIUs1KDR/pjQPdJH4Z8nGBm0yJ5WRoRfdw1Kzeh45jkIfA0rmD0kBF6fKHH+xaH7g8y4jIXyAV5MGK3g==" + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.2.7.tgz", + "integrity": "sha512-X8R8Oj771YRl/w+c1HqAC1szL8zWQRwFvgDwT129k9ACdBoud/+/rX9V0qiMl6LWUdP9voC2nDVZYPMQQsb6eA==" }, "node_modules/@formatjs/ecma402-abstract": { "version": "1.9.7", @@ -1045,22 +967,6 @@ "@pandora/fetch": "^1.0.1" } }, - "node_modules/@pandora/data-source-wcs": { - "version": "0.2.8", - "resolved": "file:commerce/internal/data-source-wcs-0.2.8.tgz", - "integrity": "sha512-eetfLZRhgiIKDmtWbb3oG8B+Zy+X5oqtwztmBzdw4FolB5y/A2Tgz0YzLX3Wn68wPq1STNPlt+Hffl4o320/Lg==", - "dependencies": { - "@pandora/data-models-odm": "^0.5.4", - "@pandora/data-source-utils": "^0.3.1", - "@pandora/react-auth-provider": "^1.0.1", - "@pandora/react-env-provider": "^1.1.0", - "@pandora/react-fetch-provider": "^1.0.1" - }, - "peerDependencies": { - "react": "^16.12.0 || ^17.0.0 || ^18.0.0", - "react-dom": "^16.12.0 || ^17.0.0 || ^18.0.0" - } - }, "node_modules/@pandora/fetch": { "version": "1.3.4", "resolved": "file:commerce/internal/fetch-1.3.4.tgz", @@ -1083,36 +989,6 @@ "ts-log": "^2.1.4" } }, - "node_modules/@pandora/react-auth-provider": { - "version": "1.2.1", - "resolved": "file:commerce/internal/react-auth-provider-1.2.1.tgz", - "integrity": "sha512-ulYG/WKP8oRvC7GMJTjmiklS925LenGmLZJitEQHkUYuik576HZn3tF7DbSCnA7L1IzaRMmw6cictRaCZ2skAg==", - "peerDependencies": { - "react": "^16.12.0 || ^17.0.0 || ^18.0.0", - "react-dom": "^16.12.0 || ^17.0.0 || ^18.0.0" - } - }, - "node_modules/@pandora/react-env-provider": { - "version": "1.2.2", - "resolved": "file:commerce/internal/react-env-provider-1.2.2.tgz", - "integrity": "sha512-uuj1d+Idn1nZ3YDZVCduO/kp/ZyBSGu1ThBErrIqPpopUk+uCfaYCNqS2kgznoEdAJ/9Lu0mMfq3asOvSURVLA==", - "peerDependencies": { - "react": "^16.12.0 || ^17.0.0 || ^18.0.0", - "react-dom": "^16.12.0 || ^17.0.0 || ^18.0.0" - } - }, - "node_modules/@pandora/react-fetch-provider": { - "version": "1.2.2", - "resolved": "file:commerce/internal/react-fetch-provider-1.2.2.tgz", - "integrity": "sha512-6qXrPeIuNxisEUfI2JhUuidIUIr4/gRy1Oq84CfuGhsj5rsaWMtJPLMSB5b1ezyNBsKHaPrG/tvp1lNsCk4Ltw==", - "dependencies": { - "@pandora/fetch": "^1.2.5" - }, - "peerDependencies": { - "react": "^16.12.0 || ^17.0.0 || ^18.0.0", - "react-dom": "^16.12.0 || ^17.0.0 || ^18.0.0" - } - }, "node_modules/@pkgr/core": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.1.1.tgz", @@ -1202,9 +1078,9 @@ } }, "node_modules/@sinonjs/text-encoding": { - "version": "0.7.2", - "resolved": "https://registry.npmjs.org/@sinonjs/text-encoding/-/text-encoding-0.7.2.tgz", - "integrity": "sha512-sXXKG+uL9IrKqViTtao2Ws6dy0znu9sOaP1di/jKGW1M6VssO8vlpXCQcpZ+jisQ1tTFAC5Jo/EOzFbggBagFQ==", + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/@sinonjs/text-encoding/-/text-encoding-0.7.3.tgz", + "integrity": "sha512-DE427ROAphMQzU4ENbliGYrBSYPXF+TtLg9S8vzeA+OF4ZKzoDdzfL8sxuMUGS/lgRhM6j1URSk9ghf7Xo1tyA==", "dev": true }, "node_modules/@spectrum-web-components/action-button": { @@ -1691,9 +1567,9 @@ } }, "node_modules/@types/chai": { - "version": "4.3.16", - "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.16.tgz", - "integrity": "sha512-PatH4iOdyh3MyWtmHVFXLWCCIhUbopaltqddG9BzB+gMIzee2MJrvd+jouii9Z3wzQJruGWAm7WOMjgfG8hQlQ==", + "version": "4.3.17", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.17.tgz", + "integrity": "sha512-zmZ21EWzR71B4Sscphjief5djsLre50M6lI622OSySTmn9DB3j+C3kWroHfBQWXbOBwbgg/M8CG/hUxDLIloow==", "dev": true }, "node_modules/@types/chai-as-promised": { @@ -1879,12 +1755,12 @@ "dev": true }, "node_modules/@types/node": { - "version": "20.14.10", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.10.tgz", - "integrity": "sha512-MdiXf+nDuMvY0gJKxyfZ7/6UFsETO7mGKF54MVD/ekJS6HdFtpZFBgrh6Pseu64XTb2MLyFPlbW6hj8HYRQNOQ==", + "version": "22.5.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.5.0.tgz", + "integrity": "sha512-DkFrJOe+rfdHTqqMg0bSNlGlQ85hSoh2TPzZyhHsXnMtligRWpxUySiyw8FY14ITt24HVCiQPWxS3KO/QlGmWg==", "dev": true, "dependencies": { - "undici-types": "~5.26.4" + "undici-types": "~6.19.2" } }, "node_modules/@types/parse5": { @@ -2972,14 +2848,14 @@ } }, "node_modules/@web/test-runner/node_modules/@web/dev-server/node_modules/command-line-usage": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/command-line-usage/-/command-line-usage-7.0.2.tgz", - "integrity": "sha512-MwNFB8nxi3IVnzir+nkSIbDTU4H6ne26zqicO2eTt1wPrvdOAphPhnYqWOjxXKWYLNYDu4Z/r2ESEziEqKuOVg==", + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/command-line-usage/-/command-line-usage-7.0.3.tgz", + "integrity": "sha512-PqMLy5+YGwhMh1wS04mVG44oqDsgyLRSKJBdOo1bnYhMKBW65gZF1dRp2OZRhiTjgUHljy99qkO7bsctLaw35Q==", "dev": true, "dependencies": { "array-back": "^6.2.2", "chalk-template": "^0.4.0", - "table-layout": "^3.0.2", + "table-layout": "^4.1.0", "typical": "^7.1.1" }, "engines": { @@ -3707,14 +3583,14 @@ } }, "node_modules/command-line-usage": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/command-line-usage/-/command-line-usage-7.0.2.tgz", - "integrity": "sha512-MwNFB8nxi3IVnzir+nkSIbDTU4H6ne26zqicO2eTt1wPrvdOAphPhnYqWOjxXKWYLNYDu4Z/r2ESEziEqKuOVg==", + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/command-line-usage/-/command-line-usage-7.0.3.tgz", + "integrity": "sha512-PqMLy5+YGwhMh1wS04mVG44oqDsgyLRSKJBdOo1bnYhMKBW65gZF1dRp2OZRhiTjgUHljy99qkO7bsctLaw35Q==", "dev": true, "dependencies": { "array-back": "^6.2.2", "chalk-template": "^0.4.0", - "table-layout": "^3.0.2", + "table-layout": "^4.1.0", "typical": "^7.1.1" }, "engines": { @@ -3814,9 +3690,9 @@ "dev": true }, "node_modules/debug": { - "version": "4.3.5", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.5.tgz", - "integrity": "sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==", + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz", + "integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==", "dev": true, "dependencies": { "ms": "2.1.2" @@ -4459,16 +4335,16 @@ } }, "node_modules/eslint": { - "version": "9.6.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.6.0.tgz", - "integrity": "sha512-ElQkdLMEEqQNM9Njff+2Y4q2afHk7JpkPvrd7Xh7xefwgQynqPxwf55J7di9+MEibWUGdNjFF9ITG9Pck5M84w==", + "version": "9.9.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.9.0.tgz", + "integrity": "sha512-JfiKJrbx0506OEerjK2Y1QlldtBxkAlLxT5OEcRF8uaQ86noDe2k31Vw9rnSWv+MXZHj7OOUV/dA0AhdLFcyvA==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", - "@eslint-community/regexpp": "^4.6.1", - "@eslint/config-array": "^0.17.0", + "@eslint-community/regexpp": "^4.11.0", + "@eslint/config-array": "^0.17.1", "@eslint/eslintrc": "^3.1.0", - "@eslint/js": "9.6.0", + "@eslint/js": "9.9.0", "@humanwhocodes/module-importer": "^1.0.1", "@humanwhocodes/retry": "^0.3.0", "@nodelib/fs.walk": "^1.2.8", @@ -4477,7 +4353,7 @@ "cross-spawn": "^7.0.2", "debug": "^4.3.2", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^8.0.1", + "eslint-scope": "^8.0.2", "eslint-visitor-keys": "^4.0.0", "espree": "^10.1.0", "esquery": "^1.5.0", @@ -4507,6 +4383,14 @@ }, "funding": { "url": "https://eslint.org/donate" + }, + "peerDependencies": { + "jiti": "*" + }, + "peerDependenciesMeta": { + "jiti": { + "optional": true + } } }, "node_modules/eslint-config-prettier": { @@ -4522,13 +4406,13 @@ } }, "node_modules/eslint-plugin-prettier": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.1.3.tgz", - "integrity": "sha512-C9GCVAs4Eq7ZC/XFQHITLiHJxQngdtraXaM+LoUFoFp/lHNl2Zn8f3WQbe9HvTBBQ9YnKFB0/2Ajdqwo5D1EAw==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.2.1.tgz", + "integrity": "sha512-gH3iR3g4JfF+yYPaJYkN7jEl9QbweL/YfkoRlNnuIEHEz1vHVlCmWOS+eGGiRuzHQXdJFCOTxRgvju9b8VUmrw==", "dev": true, "dependencies": { "prettier-linter-helpers": "^1.0.0", - "synckit": "^0.8.6" + "synckit": "^0.9.1" }, "engines": { "node": "^14.18.0 || >=16.0.0" @@ -4552,9 +4436,9 @@ } }, "node_modules/eslint-scope": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.0.1.tgz", - "integrity": "sha512-pL8XjgP4ZOmmwfFE8mEhSxA7ZY4C+LWyqjQ3o4yWkkmD0qcMT9kkW3zWHOczhWcjTSgqycYAgwSlXvZltv65og==", + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.0.2.tgz", + "integrity": "sha512-6E4xmrTw5wtxnLA5wYL3WDfhZ/1bUBGOXV0zQvVRDOtrR8D0p6W7fs3JweNYhwRYeGvd/1CKX2se0/2s7Q/nJA==", "dev": true, "dependencies": { "esrecurse": "^4.3.0", @@ -4853,9 +4737,9 @@ "dev": true }, "node_modules/focus-visible": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/focus-visible/-/focus-visible-5.2.0.tgz", - "integrity": "sha512-Rwix9pBtC1Nuy5wysTmKy+UjbDJpIfg8eHjw0rjZ1mX4GNLz1Bmd16uDpI3Gk1i70Fgcs8Csg2lPm8HULFg9DQ==" + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/focus-visible/-/focus-visible-5.2.1.tgz", + "integrity": "sha512-8Bx950VD1bWTQJEH/AM6SpEk+SU55aVnp4Ujhuuxy3eMEBCRwBnTBnVXr9YAPvZL3/CNjCa8u4IWfNmEO53whA==" }, "node_modules/fresh": { "version": "0.5.2", @@ -5144,12 +5028,12 @@ } }, "node_modules/husky": { - "version": "9.0.11", - "resolved": "https://registry.npmjs.org/husky/-/husky-9.0.11.tgz", - "integrity": "sha512-AB6lFlbwwyIqMdHYhwPe+kjOC3Oc5P3nThEoW/AaO2BX3vJDjWPFxYLxokUZOo6RNX20He3AaT8sESs9NJcmEw==", + "version": "9.1.5", + "resolved": "https://registry.npmjs.org/husky/-/husky-9.1.5.tgz", + "integrity": "sha512-rowAVRUBfI0b4+niA4SJMhfQwc107VLkBUgEYYAOQAbqDCnra1nYh83hF/MDmhYs9t9n1E3DuKOrs2LYNC+0Ag==", "dev": true, "bin": { - "husky": "bin.mjs" + "husky": "bin.js" }, "engines": { "node": ">=18" @@ -5191,9 +5075,9 @@ ] }, "node_modules/ignore": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", - "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", "dev": true, "engines": { "node": ">= 4" @@ -5330,9 +5214,9 @@ } }, "node_modules/is-core-module": { - "version": "2.14.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.14.0.tgz", - "integrity": "sha512-a5dFJih5ZLYlRtDc0dZWP7RiKr6xIKzmn/oAYCDvdLThadVgyJwlaoQPmRtMSpz+rk0OGAgIu+TcM9HUF0fk1A==", + "version": "2.15.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.15.1.tgz", + "integrity": "sha512-z0vtXSwucUJtANQWldhbtbt7BnL0vxiFjIdDLAatwhDYty2bad6s+rijD6Ri4YuYJubLzIJLUidCh09e1djEVQ==", "dev": true, "dependencies": { "hasown": "^2.0.2" @@ -5521,7 +5405,8 @@ "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true }, "node_modules/js-yaml": { "version": "4.1.0", @@ -5797,12 +5682,6 @@ "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", "dev": true }, - "node_modules/lodash.assignwith": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/lodash.assignwith/-/lodash.assignwith-4.2.0.tgz", - "integrity": "sha512-ZznplvbvtjK2gMvnQ1BR/zqPFZmS6jbK4p+6Up4xcRYA7yMIwxHCfbTcrYxXKzzqLsQ05eJPVznEW3tuwV7k1g==", - "dev": true - }, "node_modules/lodash.camelcase": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", @@ -5844,18 +5723,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/loose-envify": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", - "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", - "peer": true, - "dependencies": { - "js-tokens": "^3.0.0 || ^4.0.0" - }, - "bin": { - "loose-envify": "cli.js" - } - }, "node_modules/lru-cache": { "version": "8.0.5", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-8.0.5.tgz", @@ -6586,9 +6453,9 @@ } }, "node_modules/prettier": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.2.tgz", - "integrity": "sha512-rAVeHYMcv8ATV5d508CFdn+8/pHPpXeIid1DdrPwXnaAdH7cqjVbpJaT5eq4yRAFU/lsbwYwSF/n5iNrdJHPQA==", + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz", + "integrity": "sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==", "dev": true, "bin": { "prettier": "bin/prettier.cjs" @@ -6796,9 +6663,9 @@ } }, "node_modules/qs": { - "version": "6.12.3", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.12.3.tgz", - "integrity": "sha512-AWJm14H1vVaO/iNZ4/hO+HyaTehuy9nRqVdkTqlJt0HWvBiBIEXFmb4C0DGeYo3Xes9rrEW+TxHsaigCbN5ICQ==", + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", + "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", "dev": true, "dependencies": { "side-channel": "^1.0.6" @@ -6870,31 +6737,6 @@ "node": ">= 0.8" } }, - "node_modules/react": { - "version": "18.3.1", - "resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz", - "integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==", - "peer": true, - "dependencies": { - "loose-envify": "^1.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/react-dom": { - "version": "18.3.1", - "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz", - "integrity": "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==", - "peer": true, - "dependencies": { - "loose-envify": "^1.1.0", - "scheduler": "^0.23.2" - }, - "peerDependencies": { - "react": "^18.3.1" - } - }, "node_modules/readable-stream": { "version": "3.6.2", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", @@ -7112,19 +6954,10 @@ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "dev": true }, - "node_modules/scheduler": { - "version": "0.23.2", - "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.2.tgz", - "integrity": "sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==", - "peer": true, - "dependencies": { - "loose-envify": "^1.1.0" - } - }, "node_modules/semver": { - "version": "7.6.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", - "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", "dev": true, "bin": { "semver": "bin/semver.js" @@ -7264,15 +7097,6 @@ "node": ">= 0.6" } }, - "node_modules/stream-read-all": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/stream-read-all/-/stream-read-all-3.0.1.tgz", - "integrity": "sha512-EWZT9XOceBPlVJRrYcykW8jyRSZYbkb/0ZK36uLEmoWVO5gxBOnntNTseNzfREsqxqdfEGQrD8SXQ3QWbBmq8A==", - "dev": true, - "engines": { - "node": ">=10" - } - }, "node_modules/string_decoder": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", @@ -7354,9 +7178,9 @@ } }, "node_modules/synckit": { - "version": "0.8.8", - "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.8.8.tgz", - "integrity": "sha512-HwOKAP7Wc5aRGYdKH+dw0PRRpbO841v2DENBtjnR5HFWoiNByAl7vrx3p0G/rCyYXQsrxqtX48TImFtPcIHSpQ==", + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.9.1.tgz", + "integrity": "sha512-7gr8p9TQP6RAHusBOSLs46F4564ZrjV8xFmw5zCmgmhGUcw2hxsShhJ6CEiHQMgPDwAQ1fWHPM0ypc4RMAig4A==", "dev": true, "dependencies": { "@pkgr/core": "^0.1.0", @@ -7370,22 +7194,14 @@ } }, "node_modules/table-layout": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/table-layout/-/table-layout-3.0.2.tgz", - "integrity": "sha512-rpyNZYRw+/C+dYkcQ3Pr+rLxW4CfHpXjPDnG7lYhdRoUcZTUt+KEsX+94RGp/aVp/MQU35JCITv2T/beY4m+hw==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/table-layout/-/table-layout-4.1.1.tgz", + "integrity": "sha512-iK5/YhZxq5GO5z8wb0bY1317uDF3Zjpha0QFFLA8/trAoiLbQD0HUbMesEaxyzUgDxi2QlcbM8IvqOlEjgoXBA==", "dev": true, "dependencies": { - "@75lb/deep-merge": "^1.1.1", "array-back": "^6.2.2", - "command-line-args": "^5.2.1", - "command-line-usage": "^7.0.0", - "stream-read-all": "^3.0.1", - "typical": "^7.1.1", "wordwrapjs": "^5.1.0" }, - "bin": { - "table-layout": "bin/cli.js" - }, "engines": { "node": ">=12.17" } @@ -7399,15 +7215,6 @@ "node": ">=12.17" } }, - "node_modules/table-layout/node_modules/typical": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/typical/-/typical-7.1.1.tgz", - "integrity": "sha512-T+tKVNs6Wu7IWiAce5BgMd7OZfNYUndHwc5MknN+UHOudi7sGZzuHdCadllRuqJ3fPtgFtIH9+lt9qRv6lmpfA==", - "dev": true, - "engines": { - "node": ">=12.17" - } - }, "node_modules/tar-fs": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz", @@ -7589,9 +7396,9 @@ } }, "node_modules/undici-types": { - "version": "5.26.5", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", - "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "version": "6.19.8", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", + "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", "dev": true }, "node_modules/unpipe": { @@ -7774,25 +7581,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "studio": { - "name": "@adobe/mas-studio", - "version": "0.0.1", - "extraneous": true, - "license": "ISC", - "dependencies": { - "@adobe/lit-mobx": "^2.2.2", - "@adobe/mas": "^0.0.1", - "@adobe/mas-web-components": "^0.0.1", - "mobx": "^6.12.4" - }, - "devDependencies": { - "@web/dev-server-import-maps": "^0.2.1", - "@web/test-runner": "^0.13.27", - "@web/test-runner-commands": "^0.6.1", - "esbuild": "^0.21.5", - "esbuild-node-externals": "^1.13.1" - } - }, "web-components": { "name": "@adobe/mas-web-components", "version": "0.0.1", From 3551ffd610e157923303fafa82489cb6c7f04a44 Mon Sep 17 00:00:00 2001 From: Ryan Parrish Date: Mon, 2 Sep 2024 02:17:44 -0600 Subject: [PATCH 07/21] MWPW-154209 - [hero-marquee] bugs (#2727) * hero bugz updates * added wrapInnerHTMLInPTag for single line entries * changed order to wrapInnerinP so it happens before decorateButtons * PR feedback * PR feedback - minor logic fix for potential null value * minor fix, missing scope for flex dir col for .bg-bottom-tablet * missing selector for bg-bottom-tablet btm padding * Fixed scope so row-lockup also gets iconography.css * PR feedback, shorten some code logic * await loadIconography --- libs/blocks/hero-marquee/hero-marquee.css | 74 +++++------------------ libs/blocks/hero-marquee/hero-marquee.js | 68 +++++++++++++++------ 2 files changed, 64 insertions(+), 78 deletions(-) diff --git a/libs/blocks/hero-marquee/hero-marquee.css b/libs/blocks/hero-marquee/hero-marquee.css index 67a3d5eade..34c9175a3f 100644 --- a/libs/blocks/hero-marquee/hero-marquee.css +++ b/libs/blocks/hero-marquee/hero-marquee.css @@ -62,22 +62,8 @@ justify-content: center; } -/* Lockup Area */ -.hero-marquee .lockup-area { - font-weight: 700; - display: flex; - align-items: center; - gap: var(--spacing-xs); - margin: 0 0 var(--spacing-xxs); - font-size: var(--type-body-m-size); - line-height: var(--type-body-m-lh); - text-transform: initial; - white-space: nowrap; -} - -.hero-marquee .lockup-area picture { - line-height: 0; - display: block; +.hero-marquee .row-lockup .lockup-area { + margin: 0; } .hero-marquee .lockup-area a, @@ -102,45 +88,6 @@ display: block; } -/* Lockup Area sizes - default large */ -.hero-marquee .lockup-area picture img, -.hero-marquee .l-icon .lockup-area, -.hero-marquee.l-icon .lockup-area { - font-size: var(--type-body-m-size); - line-height: var(--type-body-m-lh); -} - -.hero-marquee .lockup-area picture img, -.hero-marquee .l-icon .lockup-area picture img, -.hero-marquee.l-icon .lockup-area picture img { - min-width: var(--icon-size-l); - height: var(--icon-size-l); -} - -.hero-marquee .m-icon .lockup-area, -.hero-marquee.m-icon .lockup-area { - font-size: var(--type-body-s-size); - line-height: var(--type-body-s-lh); -} - -.hero-marquee .m-icon .lockup-area picture img, -.hero-marquee.m-icon .lockup-area picture img { - min-width: var(--icon-size-m); - height: var(--icon-size-m); -} - -.hero-marquee .xl-icon .lockup-area, -.hero-marquee.xl-icon .lockup-area { - font-size: var(--type-body-xl-size); - line-height: var(--type-body-xl-lh); -} - -.hero-marquee .xl-icon .lockup-area picture img, -.hero-marquee.xl-icon .lockup-area picture img { - min-width: var(--icon-size-xl); - height: var(--icon-size-xl); -} - .hero-marquee.center { text-align: center; align-items: center; @@ -158,7 +105,6 @@ .hero-marquee .main-copy [class^="heading"], .hero-marquee .norm p:only-child { margin: 0; } .hero-marquee .norm :is(h1, h2, h3, h4, h5, h6) { margin: 0 0 var(--spacing-xs) 0; } -.hero-marquee .norm .action-area { margin-top: var(--spacing-s); } .hero-marquee .norm div > *:last-child { margin-bottom: 0; } .hero-marquee .norm div *:first-child { margin-top: 0; } @@ -322,8 +268,10 @@ html[dir="rtl"] .hero-marquee li.icon-item span.icon { } /* con-vars support */ - .hero-marquee:is(.bg-top-mobile, .bg-top-mobile, .bg-bottom-mobile) .background { + .hero-marquee:is(.bg-top-mobile, .bg-bottom-mobile, .bg-top-tablet, .bg-bottom-tablet) .background, + .hero-marquee:is(.bg-top-mobile, .bg-bottom-mobile, .bg-top-tablet, .bg-bottom-tablet) .background video { position: relative; + width: 100%; } .hero-marquee.bg-top-mobile { @@ -375,14 +323,19 @@ html[dir="rtl"] .hero-marquee li.icon-item span.icon { } /* con-vars support */ - .hero-marquee.bg-top-tablet .background, - .hero-marquee.bg-bottom-tablet .background { + .hero-marquee:is(.bg-top-tablet, .bg-bottom-tablet) .background, + .hero-marquee:is(.bg-top-tablet, .bg-bottom-tablet) .background video { position: relative; + width: 100%; } .hero-marquee.bg-top-tablet { padding-top: 0; } + + .hero-marquee.bg-bottom-tablet { + padding-bottom: 0; + } .hero-marquee.bg-bottom-tablet .background { order: 2; @@ -413,7 +366,8 @@ html[dir="rtl"] .hero-marquee li.icon-item span.icon { justify-content: center; } - .hero-marquee.bg-top-tablet { + .hero-marquee.bg-top-tablet, + .hero-marquee.bg-bottom-tablet { flex-direction: column; } diff --git a/libs/blocks/hero-marquee/hero-marquee.js b/libs/blocks/hero-marquee/hero-marquee.js index 230742aa5a..550c5aa2c9 100644 --- a/libs/blocks/hero-marquee/hero-marquee.js +++ b/libs/blocks/hero-marquee/hero-marquee.js @@ -11,9 +11,13 @@ import { createTag, loadStyle, getConfig } from '../../utils/utils.js'; const contentTypes = ['list', 'qrcode', 'lockup', 'text', 'bgcolor', 'supplemental']; const rowTypeKeyword = 'con-block-row-'; const breakpointThemeClasses = ['dark-mobile', 'light-mobile', 'dark-tablet', 'light-tablet', 'dark-desktop', 'light-desktop']; +const textDefault = ['xxl', 'm', 'l']; // heading, body, detail + +const { miloLibs, codeRoot } = getConfig(); +const base = miloLibs || codeRoot; function distillClasses(el, classes) { - const taps = ['-heading', '-body', '-detail']; + const taps = ['-heading', '-body', '-detail', '-button']; classes?.forEach((elClass) => { const elTaps = taps.filter((tap) => elClass.endsWith(tap)); if (!elTaps.length) return; @@ -48,10 +52,31 @@ function decorateQr(el) { }); } -function decorateLockupFromContent(el) { +async function loadIconography() { + await new Promise((resolve) => { loadStyle(`${base}/styles/iconography.css`, resolve); }); +} + +async function decorateLockupFromContent(el) { const rows = el.querySelectorAll(':scope > p'); const firstRowImg = rows[0]?.querySelector('img'); - if (firstRowImg) rows[0].classList.add('lockup-area'); + if (!firstRowImg) return; + await loadIconography(); + rows[0].classList.add('lockup-area'); + rows[0].childNodes.forEach((node) => { + if (node.nodeType === 3 && node.nodeValue?.trim()) { + const newSpan = createTag('span', { class: 'lockup-label' }, node.nodeValue); + node.parentElement.replaceChild(newSpan, node); + } + }); +} + +async function decorateLockupRow(el, classes) { + const child = el.querySelector(':scope > div'); + await loadIconography(); + child?.classList.add('lockup-area'); + const iconSizeClass = classes?.find((c) => c.endsWith('-icon')); + if (iconSizeClass) el.classList.remove(iconSizeClass); + el.classList.add(`${iconSizeClass?.split('-')[0] || 'l'}-lockup`); } function decorateBg(el) { @@ -60,22 +85,29 @@ function decorateBg(el) { el.remove(); } +function wrapInnerHTMLInPTag(el) { + const innerDiv = el.querySelector(':scope > div'); + const containsPTag = [...innerDiv.childNodes].some((node) => node.nodeName === 'P'); + if (!containsPTag) { + const pTag = createTag('p'); + while (innerDiv.firstChild) pTag.appendChild(innerDiv.firstChild); + innerDiv.appendChild(pTag); + } +} + function decorateText(el, classes) { el.classList.add('norm'); + wrapInnerHTMLInPTag(el); const btnClass = classes?.find((c) => c.endsWith('-button')); if (btnClass) { const [theme, size] = btnClass.split('-').reverse(); el.classList.remove(btnClass); - decorateButtons(el, `${size}-${theme}`); + decorateButtons(el, `${theme}-${size}`); } else { decorateButtons(el, 'button-xl'); } - distillClasses(el, classes); -} - -function decorateLockupRow(el) { - const child = el.querySelector(':scope > div'); - if (child) child.classList.add('lockup-area'); + decorateBlockText(el, textDefault); + decorateTextOverrides(el, ['-heading', '-body', '-detail']); } function decorateSup(el, classes) { @@ -107,7 +139,7 @@ function loadContentType(el, key, classes) { decorateBg(el); break; case 'lockup': - decorateLockupRow(el); + decorateLockupRow(el, classes); break; case 'qrcode': decorateQr(el); @@ -126,8 +158,7 @@ function loadContentType(el, key, classes) { } function loadBreakpointThemes() { - const { miloLibs, codeRoot } = getConfig(); - loadStyle(`${miloLibs || codeRoot}/styles/breakpoint-theme.css`); + loadStyle(`${base}/styles/breakpoint-theme.css`); } export default async function init(el) { @@ -175,8 +206,8 @@ export default async function init(el) { : null; if (assetUnknown) assetUnknown.classList.add('asset-unknown'); - decorateBlockText(copy, ['xxl', 'm', 'l']); // heading, body, detail - decorateLockupFromContent(copy); + decorateBlockText(copy, textDefault); + await decorateLockupFromContent(copy); extendButtonsClass(copy); /* c8 ignore next 2 */ @@ -187,15 +218,16 @@ export default async function init(el) { const assetRow = allRows[0].classList.contains('asset'); if (assetRow) el.classList.add('asset-left'); - const mainCopy = createTag('div', { class: 'main-copy' }, copy.innerHTML); + const mainCopy = createTag('div', { class: 'main-copy' }); + while (copy.childNodes.length > 0) { + mainCopy.appendChild(copy.childNodes[0]); + } rows.splice(mainRowIndex, 1); if (mainRowIndex > 0) { for (let i = 0; i < mainRowIndex; i += 1) { rows[i].classList.add('prepend'); } } - - copy.innerHTML = ''; copy.append(mainCopy); [...rows].forEach((row) => { if (row.classList.contains('prepend')) { From 10cfc4b4750a252585f727e19b7b380e31ac5baa Mon Sep 17 00:00:00 2001 From: nishantka <126539566+nishantka@users.noreply.github.com> Date: Mon, 2 Sep 2024 13:47:51 +0530 Subject: [PATCH 08/21] Dark nav for standalone Gnav (#2730) * gnav dark theme init * Dark gnav icon changes * Dark gnav changes * add theme in standalone gnav config * allow 2 logo for dark mode * UTs for gnav dark theme * UTs for gnav dark theme * Dark gnav color changes * gnav dark mode refactor css * gnav dark mode refactor css * load darknav after base to override variables * update darknav promo css * lightmode promobar link color * update region nav link color * update nav background color for darkmode * fix outline for windows * update darknav css --- libs/blocks/global-footer/global-footer.css | 34 +- libs/blocks/global-footer/global-footer.js | 2 + libs/blocks/global-navigation/base.css | 51 +-- libs/blocks/global-navigation/dark-nav.css | 256 ++++++++++++++ .../features/profile/dropdown.css | 6 +- .../features/search/gnav-search.css | 4 +- .../global-navigation/global-navigation.css | 52 +-- .../global-navigation/global-navigation.js | 15 +- .../global-navigation/utilities/menu/menu.css | 16 +- .../global-navigation/utilities/utilities.js | 19 +- libs/navigation/navigation.css | 11 +- libs/navigation/navigation.js | 5 +- libs/styles/styles.css | 2 +- .../global-footer/global-footer.test.js | 11 + test/blocks/global-footer/test-utilities.js | 4 +- .../global-navigation.test.js | 20 ++ .../mocks/adobe-dark-logo.svg | 9 + .../mocks/dark-global-navigation.plain.js | 326 ++++++++++++++++++ 18 files changed, 755 insertions(+), 88 deletions(-) create mode 100644 libs/blocks/global-navigation/dark-nav.css create mode 100644 test/blocks/global-navigation/mocks/adobe-dark-logo.svg create mode 100644 test/blocks/global-navigation/mocks/dark-global-navigation.plain.js diff --git a/libs/blocks/global-footer/global-footer.css b/libs/blocks/global-footer/global-footer.css index 1a240cf2c0..9d70ef3eb7 100644 --- a/libs/blocks/global-footer/global-footer.css +++ b/libs/blocks/global-footer/global-footer.css @@ -4,7 +4,7 @@ display: flex; justify-content: center; font-size: 12px; - background: var(--feds-background-footer--light); + background: var(--feds-background-footer); } .global-footer ul { @@ -26,7 +26,7 @@ display: flex; flex-direction: column; row-gap: 30px; - color: var(--feds-color-headline--light); + color: var(--feds-color-headline); } .feds-footer-wrapper ul { @@ -65,7 +65,7 @@ margin: 0 var(--feds-gutter-footer); border-width: 1px 0 1px 0; border-style: solid; - border-color: var(--feds-borderColor-featuredProducts--light); + border-color: var(--feds-borderColor-featuredProducts); } .feds-featuredProducts-label { @@ -99,15 +99,15 @@ /* Region picker */ .feds-regionPicker { column-gap: 10px; - color: var(--feds-color-link--light); - border-color: var(--feds-color-link--light); - fill: var(--feds-color-link--light); + color: var(--feds-color-link); + border-color: var(--feds-color-link); + fill: var(--feds-color-link); } .feds-regionPicker:hover { - color: var(--feds-color-link--hover--light); - border-color: var(--feds-color-link--hover--light); - fill: var(--feds-color-link--hover--light); + color: var(--feds-color-link--hover); + border-color: var(--feds-color-link--hover); + fill: var(--feds-color-link--hover); } .feds-regionPicker:after { @@ -145,8 +145,8 @@ min-width: 130px; max-height: 300px; overflow-y: auto; - background: var(--feds-background-nav--light); - border: 1px solid var(--feds-color-border--light); + background: var(--feds-background-nav); + border: 1px solid var(--feds-borderColor); border-radius: 4px; } @@ -186,11 +186,11 @@ padding: 0 20px; display: block; line-height: 2; - color: var(--feds-color-link--hover--light); + color: var(--feds-color-link--hover); } .feds-regionPicker-wrapper > .fragment a:hover { - background: var(--feds-background-link--hover--light); + background: var(--feds-background-link--hover); } /* Social */ @@ -234,13 +234,13 @@ display: flex; column-gap: 5px; align-items: center; - color: var(--feds-color-link--light); - fill: var(--feds-color-link--light); + color: var(--feds-color-link); + fill: var(--feds-color-link); } .feds-footer-privacyLink:hover { - color: var(--feds-color-link--hover--light); - fill: var(--feds-color-link--hover--light); + color: var(--feds-color-link--hover); + fill: var(--feds-color-link--hover); } .feds-adChoices-icon { diff --git a/libs/blocks/global-footer/global-footer.js b/libs/blocks/global-footer/global-footer.js index 29a6a4b3c2..2cd9f35559 100644 --- a/libs/blocks/global-footer/global-footer.js +++ b/libs/blocks/global-footer/global-footer.js @@ -20,6 +20,7 @@ import { logErrorFor, toFragment, federatePictureSources, + isDarkMode, } from '../global-navigation/utilities/utilities.js'; import { getFederatedUrl } from '../../utils/federated.js'; @@ -370,6 +371,7 @@ class Footer { export default function init(block) { try { const footer = new Footer({ block }); + if (isDarkMode()) block.classList.add('feds--dark'); return footer; } catch (e) { lanaLog({ message: 'Could not create footer', e }); diff --git a/libs/blocks/global-navigation/base.css b/libs/blocks/global-navigation/base.css index 1ebe34e97a..9bbffc30c4 100644 --- a/libs/blocks/global-navigation/base.css +++ b/libs/blocks/global-navigation/base.css @@ -7,26 +7,31 @@ --feds-height-breadcrumbs: 33px; --feds-gutter: 8px; /* Top navigation - backgrounds */ - --feds-background-nav--light: #fff; - --feds-background-popup--light: #fafafa; + --feds-background-nav: #fff; + --feds-background-popup: #fafafa; --feds-background-promo--dark: #000; /* Top navigation - borders */ - --feds-borderColor--light: #eaeaea; - --feds-borderColor-menu--light: #e1e1e1; + --feds-borderColor: #eaeaea; + --feds-borderColor-menu: #e1e1e1; + --feds-borderColor-navLink: #2c2c2c; /* Top navigation - colors */ --feds-color-adobeBrand: #EB1000; - --feds-color-headline--light: #505050; + --feds-color-headline: #505050; + --feds-color-hamburger: #2d2d2d; + --feds-color-breadcrumbs--current: #2c2c2c; + --feds-color-signIn: #4B4B4B; /* Top navigation - misc */ --feds-radius-utilityIcon: 4px; /* Links */ - --feds-background-link--hover--light: #f5f5f5; - --feds-borderColor-link--light: #f3f3f3; - --feds-color-link--light: #2c2c2c; - --feds-color-link--hover--light: #1473e6; - --feds-color-navLink-description--light: #656565; + --feds-background-link--hover: #f5f5f5; + --feds-borderColor-link: #f3f3f3; + --feds-color-link: #2c2c2c; + --feds-color-link--hover: #1473e6; + --feds-color-navLink-description: #656565; + --feds-color-link-breadcrumbs: #707070; /* Footer */ - --feds-background-footer--light: #fafafa; - --feds-borderColor-featuredProducts--light: #999; + --feds-background-footer: #fafafa; + --feds-borderColor-featuredProducts: #999; --feds-gutter-footer: 32px; } @@ -36,7 +41,7 @@ align-items: center; padding: 12px; border: none; - color: var(--feds-color-link--light); + color: var(--feds-color-link); font: inherit; white-space: nowrap; flex-shrink: 0; @@ -44,7 +49,7 @@ .feds-navLink:hover, .feds-navLink:focus { - color: var(--feds-color-link--hover--light); + color: var(--feds-color-link--hover); } .feds-navLink:not(.feds-navLink--hoverCaret) { @@ -52,7 +57,7 @@ } .feds-navLink--blue { - color: var(--feds-color-link--hover--light); + color: var(--feds-color-link--hover); } .feds-navLink--hoverCaret { @@ -62,7 +67,7 @@ .feds-navLink--hoverCaret:hover, .feds-navLink--hoverCaret:focus { - color: var(--feds-color-link--light); + color: var(--feds-color-link); } .feds-navLink--hoverCaret:after, @@ -70,7 +75,7 @@ display: flex; border-width: 0 1px 1px 0; border-style: solid; - border-color: var(--feds-color-link--light); + border-color: var(--feds-color-link); transform-origin: 75% 75%; transition: transform 0.1s ease; box-sizing: content-box; @@ -134,7 +139,7 @@ header.global-navigation { .feds-navItem--active > .feds-navLink:only-child:hover, .feds-navItem--active > .feds-navLink:only-child:focus { - color: var(--feds-color-link--light); + color: var(--feds-color-link); } .feds-navItem--active > .feds-navLink:before { @@ -142,7 +147,7 @@ header.global-navigation { bottom: 0; left: 0; right: 0; - border-bottom: 2px solid #2c2c2c; + border-bottom: 2px solid var(--feds-borderColor-navLink); content: ""; } @@ -172,7 +177,7 @@ header.global-navigation { .feds-navLink--hoverCaret:hover, .feds-navLink--hoverCaret:focus { - background-color: var(--feds-background-popup--light); + background-color: var(--feds-background-popup); } .feds-navLink--hoverCaret:after { @@ -214,12 +219,12 @@ header.global-navigation { .feds-navLink-description { display: flex; font-size: 12px; - color: var(--feds-color-navLink-description--light); + color: var(--feds-color-navLink-description); } .feds-navLink:hover .feds-navLink-description, .feds-navLink:focus .feds-navLink-description { - color: var(--feds-color-navLink-description--light); + color: var(--feds-color-navLink-description); } /* Nav Link special styles for A/B test */ @@ -260,7 +265,7 @@ header.global-navigation { .feds-navLink[class *= '-gradient']:hover .feds-navLink-title:after, .feds-navLink[class *= '-gradient']:focus .feds-navLink-title:after { - border-color: var(--feds-color-link--hover--light); + border-color: var(--feds-color-link--hover); } .feds-navLink--photo-gradient { diff --git a/libs/blocks/global-navigation/dark-nav.css b/libs/blocks/global-navigation/dark-nav.css new file mode 100644 index 0000000000..9f9caa2819 --- /dev/null +++ b/libs/blocks/global-navigation/dark-nav.css @@ -0,0 +1,256 @@ +:root { + --text-color: #F2F2F2; + --background-color: #111; + --link-color: #1473e6; + --link-hover-color: #1473e6; + /* Top navigation - backgrounds */ + --feds-background-popup: #111; + --feds-background-nav: #222; + --feds-background-nav--desktop: #1B1B1B; + /* Top navigation - borders */ + --feds-borderColor: #303030; + --feds-borderColor-menu: #4B4B4B; + --feds-borderColor-navLink: #DBDBDB; + /* Top navigation - colors */ + --feds-color-adobeBrand: #FFF; + --feds-color-headline--mobile: #F2F2F2; + --feds-color-headline: #EBEBEB; + --feds-color-popup: #EBEBEB; + --feds-color-hamburger: #FFF; + --feds-color-breadcrumbs--current: #DBDBDB; + --feds-color-signIn: #DBDBDB; + --feds-color-search: #DBDBDB; + /* Links */ + --feds-color-link: #F2F2F2; + /* --feds-color-link--mobile: #F2F2F2; */ + --feds-color-link--desktop: #DBDBDB; + --feds-color-link--hover: #1473e6; + --feds-color-blue-link: #5eaaf7; + --feds-color-navLink-description: #B0B0B0; + --feds-color-link-breadcrumbs: #B0B0B0; + --feds-background-link--hover: #1B1B1B; + --feds-borderColor-link: #323232; + /* Footer */ + --feds-background-footer: #222; + --feds-background-footer--desktop: #1B1B1B; + --feds-borderColor-featuredProducts: #999; + /* Dropdown */ + --feds-color-profile-heading--dark: #909090; + --feds-color-profile--dark: #DBDBDB; + --feds-color-profile--emphasis--dark: #F2F2F2; + --feds-border-profile--dark: 1px solid var(--feds-borderColor); +} + +.feds--dark .feds-navLink--hoverCaret:hover, +.feds--dark .feds-navLink--hoverCaret:focus { + background-color: #151515; +} + +/* Desktop styles */ +@media (min-width: 900px) { + .feds--dark .feds-navLink { + color: var(--feds-color-link--desktop); + } + + .feds--dark .feds-navLink:hover { + color: var(--feds-color-link--hover); + } + + .feds--dark .feds-navLink--hoverCaret:hover, + .feds--dark .feds-navLink--hoverCaret:focus { + color: var(--feds-color-link--desktop); + background-color: var(--background-color); + } +} + +/* global-navigation.css */ +.feds-cta--primary { + background-color: #066ce7; + border-color: #066ce7; + color: #fff; +} + +.feds--dark .feds-cta--secondary { + background-color: var(--background-color); + border-color: #393939; + color: var(--feds-color-link--dark); +} + +.feds--dark .feds-cta--secondary:hover, +.feds--dark .feds-cta--secondary:focus { + border-color: #444; + background-color: #2C2C2C; + color: var(--feds-color-link--dark); +} + +/* Popup */ +.feds--dark .feds-popup { + background-color: #151515; +} + +.feds--dark .feds-popup .feds-navLink { + color: var(--feds-color-popup); +} + +.feds--dark .feds-popup .feds-navLink:hover, +.feds--dark .feds-popup .feds-navLink:focus { + color: var(--feds-color-link--hover); +} + +.feds--dark .feds-popup .feds-navLink--blue { + color: var(--feds-color-blue-link); +} + +.feds--dark .feds-popup .feds-navLink--blue:hover, +.feds--dark .feds-popup .feds-navLink--blue:focus { + color: var(--feds-color-link--hover); +} + +.feds--dark .feds-brand-label, +.feds--dark .feds-brand-image, +.feds--dark .feds-logo, +.feds--dark .feds-logo-label { + color: var(--feds-color-adobeBrand); +} + +/* Desktop styles */ +@media (min-width: 900px) { + header.global-navigation.feds--dark { + background-color: var(--feds-background-nav--desktop); + } + + .feds--dark .feds-topnav-wrapper { + background-color: var(--feds-background-nav--desktop); + } + + /* Popup */ + .feds--dark .feds-popup { + background-color: var(--feds-background-popup); + box-shadow: 0 3px 3px 0 rgb(255 255 255 / 20%); + } +} + +/* gnav-search.css */ +.feds--dark .feds-search-input { + border: 1px solid var(--feds-borderColor); + background-color: transparent; + color: var(--feds-color-search); +} + +.feds--dark .feds-search-icons svg path { + fill: var(--feds-color-search); +} + +.feds--dark .feds-search-clear { + border: none; + color: var(--feds-color-search); +} + +.feds--dark .feds-search-clear:hover { + color: var(--feds-color-link--hover); +} + +.feds--dark .feds-search-results:not(:empty) { + border-color: var(--feds-borderColor); +} + +.feds--dark .feds-search-result { + color: var(--feds-color-link); +} + +.feds--dark .feds-search-result:hover, +.feds--dark .feds-search-result:focus { + background: var(--feds-background-nav); +} + +@media (min-width: 900px) { + .feds--dark .feds-promo { + border: 1px solid var(--feds-borderColor); + background: #1D1D1D; + } + + .feds--dark .feds-promo--dark, + .feds--dark .feds-promo--dark a:not(.feds-cta) { + color: var(--feds-color-headline); + } + + .feds--dark .feds-promo-link { + color: var(--feds-color-blue-link); + } + + .feds--dark .feds-promo-link:hover { + color: var(--feds-color-link--hover); + } +} + +@media (min-width: 1200px) { + .feds--dark .feds-crossCloudMenu-wrapper { + border-top: solid 1px var(--feds-borderColor); + background-color: var(--feds-background-popup); + } +} + +/* dropdown.css */ +.feds--dark .feds-profile-name { + color: var(--feds-color-profile--emphasis--dark); +} + +.feds--dark .feds-profile-email { + color: var(--feds-color-profile-heading--dark); +} + +.feds--dark .feds-profile-account { + color: var(--feds-color-profile--dark); +} + +.feds--dark .feds-profile-menu { + border: var(--feds-border-profile--dark); + background: var(--feds-background-nav); +} + +.feds--dark .feds-local-menu { + border-top: var(--feds-border-profile--dark); +} + +.feds--dark .feds-local-menu h5 { + color: var(--feds-color-profile-heading--dark); +} + +.feds--dark .feds-profile-action { + border-top: var(--feds-border-profile--dark); +} + +.feds--dark .feds-regionPicker-wrapper > .fragment { + background: var(--feds-background-popup); +} + +.feds--dark .feds-social-icon { + color: #AAA; +} + +.feds-social-link:hover .feds-social-icon { + color: #CCC; +} + +.dialog-modal .region-nav { + color: var(--feds-color-link); + background-color: var(--feds-background-popup); +} + +.dialog-modal .region-nav a { + color: var(--feds-color-blue-link); +} + +.dialog-modal .region-nav a:hover { + text-decoration: underline; +} + +header.global-navigation.feds--dark { + visibility: visible; +} + +@media (min-width: 900px) { + .global-footer.feds--dark { + background: var(--feds-background-footer--desktop); + } +} diff --git a/libs/blocks/global-navigation/features/profile/dropdown.css b/libs/blocks/global-navigation/features/profile/dropdown.css index 3475affa70..dabc767618 100644 --- a/libs/blocks/global-navigation/features/profile/dropdown.css +++ b/libs/blocks/global-navigation/features/profile/dropdown.css @@ -97,13 +97,13 @@ .feds-local-menu a, .feds-profile-actions a { display: block; - color: var(--feds-color-link--light); + color: var(--feds-color-link); } .feds-local-menu a:hover, .feds-profile-actions a:hover { - color: var(--feds-color-link--hover--light); - background-color: var(--feds-background-link--hover--light); + color: var(--feds-color-link--hover); + background-color: var(--feds-background-link--hover); } .feds-local-menu a { diff --git a/libs/blocks/global-navigation/features/search/gnav-search.css b/libs/blocks/global-navigation/features/search/gnav-search.css index 6d4d4f7f0e..db93014727 100644 --- a/libs/blocks/global-navigation/features/search/gnav-search.css +++ b/libs/blocks/global-navigation/features/search/gnav-search.css @@ -3,8 +3,8 @@ } .feds-search-dropdown { - border-bottom: 1px solid var(--feds-borderColor--light); - background-color: var(--feds-background-nav--light); + border-bottom: 1px solid var(--feds-borderColor); + background-color: var(--feds-background-nav); } .feds-search-bar { diff --git a/libs/blocks/global-navigation/global-navigation.css b/libs/blocks/global-navigation/global-navigation.css index 86eb13d5c7..60f84165b3 100644 --- a/libs/blocks/global-navigation/global-navigation.css +++ b/libs/blocks/global-navigation/global-navigation.css @@ -32,7 +32,7 @@ header.global-navigation { position: sticky; top: 0; z-index: 10; - background-color: var(--feds-background-nav--light); + background-color: var(--feds-background-nav); box-sizing: content-box; overflow-x: clip; } @@ -43,7 +43,7 @@ header.global-navigation { display: flex; justify-content: center; height: var(--feds-height-nav); - background-color: var(--feds-background-nav--light); + background-color: var(--feds-background-nav); } .feds-topnav { @@ -62,8 +62,8 @@ header.global-navigation { display: none; flex-direction: column; height: 100vh; - border-top: 1px solid var(--feds-borderColor--light); - background-color: var(--feds-background-nav--light); + border-top: 1px solid var(--feds-borderColor); + background-color: var(--feds-background-nav); } [dir = "rtl"] .feds-nav-wrapper { @@ -94,7 +94,7 @@ header.global-navigation { border: none; background: transparent; box-shadow: none; - color: #2d2d2d; + color: var(--feds-color-hamburger); cursor: pointer; font-size: 20px; font-weight: 300; @@ -153,7 +153,7 @@ header.global-navigation { /* Popup */ .feds-popup { display: none; - background-color: var(--feds-background-popup--light); + background-color: var(--feds-background-popup); } .feds-popup p { @@ -174,7 +174,7 @@ header.global-navigation { font-size: 14px; font-weight: 400; line-height: 1.4; - color: var(--feds-color-link--light); + color: var(--feds-color-link); white-space: nowrap; } @@ -187,7 +187,7 @@ header.global-navigation { } .feds-navItem:not(:last-child) > .feds-navLink { - border-bottom: 1px solid var(--feds-borderColor-link--light); + border-bottom: 1px solid var(--feds-borderColor-link); } /* Item with active dropdown */ @@ -201,7 +201,7 @@ header.global-navigation { bottom: 0; left: 0; width: 2px; - background: var(--feds-color-link--light); + background: var(--feds-color-link); content: ""; z-index: 1; } @@ -213,7 +213,7 @@ header.global-navigation { .feds-popup .feds-navLink:hover, .feds-popup .feds-navLink:focus { - background-color: var(--feds-background-link--hover--light); + background-color: var(--feds-background-link--hover); } .feds-cta-wrapper { @@ -287,11 +287,11 @@ header.global-navigation { display: none; font-size: 20px; line-height: 1; - color: var(--feds-color-link--light); + color: var(--feds-color-link); } .feds-search-close:hover { - color: var(--feds-color-link--hover--light); + color: var(--feds-color-link--hover); } .feds-search-close:before { @@ -302,7 +302,7 @@ header.global-navigation { .feds-breadcrumbs-wrapper { display: flex; order: -1; - border-bottom: 1px solid var(--feds-borderColor--light); + border-bottom: 1px solid var(--feds-borderColor); } .feds-breadcrumbs { @@ -355,11 +355,11 @@ header.global-navigation { .feds-breadcrumbs a { display: block; - color: #707070; + color: var(--feds-color-link-breadcrumbs); } .feds-breadcrumbs [aria-current] { - color: #2c2c2c; + color: var(--feds-color-breadcrumbs--current); } .feds-breadcrumbs li:not(:first-of-type)::before { @@ -408,7 +408,7 @@ header.global-navigation { .feds-signIn { padding: 11px var(--feds-gutter); border-radius: var(--feds-radius-utilityIcon); - color: #4B4B4B; + color: var(--feds-color-signIn); white-space: nowrap; border: none; font: inherit; @@ -425,7 +425,7 @@ header.global-navigation { display: none; right: 0; top: 100%; - background-color: var(--feds-background-popup--light); + background-color: var(--feds-background-popup); overflow: hidden; box-shadow: 0 3px 3px 0 rgb(0 0 0 / 20%); line-height: 1.4; @@ -451,14 +451,14 @@ header.global-navigation { .feds-signIn-dropdown li > a, .feds-signIn-dropdown .feds-signIn { display: block; - color: var(--feds-color-link--light); + color: var(--feds-color-link); padding: 6px 32px; } .feds-signIn-dropdown li > a:hover, .feds-signIn-dropdown .feds-signIn:hover { - color: var(--feds-color-link--hover--light); - background-color: var(--feds-background-link--hover--light); + color: var(--feds-color-link--hover); + background-color: var(--feds-background-link--hover); } #feds-googleLogin { @@ -482,7 +482,7 @@ header.global-navigation { } .feds-topnav-wrapper { - border-bottom: 1px solid var(--feds-borderColor--light); + border-bottom: 1px solid var(--feds-borderColor); box-sizing: content-box; } @@ -588,8 +588,8 @@ header.global-navigation { } .feds-navItem--section:only-of-type { - border-left: 1px solid var(--feds-borderColor--light); - border-right: 1px solid var(--feds-borderColor--light); + border-left: 1px solid var(--feds-borderColor); + border-right: 1px solid var(--feds-borderColor); } .feds-navItem--section > .feds-navLink { @@ -642,11 +642,11 @@ header.global-navigation { } .feds-search-trigger svg path { - fill: var(--feds-color-link--light); + fill: var(--feds-color-link); } .feds-search-trigger:hover svg path { - fill: var(--feds-color-link--hover--light); + fill: var(--feds-color-link--hover); } /* Breadcrumbs */ @@ -658,7 +658,7 @@ header.global-navigation { justify-content: center; border-bottom: unset; box-shadow: 0 3px 2px rgb(142 142 142 / 30%); - background: var(--feds-background-nav--light); + background: var(--feds-background-nav); transform: translate3d(0,0,0); /* Fix Safari issues w/ position: sticky */ } diff --git a/libs/blocks/global-navigation/global-navigation.js b/libs/blocks/global-navigation/global-navigation.js index a83ba5d6bc..1440b0b94c 100644 --- a/libs/blocks/global-navigation/global-navigation.js +++ b/libs/blocks/global-navigation/global-navigation.js @@ -34,12 +34,14 @@ import { trigger, yieldToMain, addMepHighlightAndTargetId, + isDarkMode, + darkIcons, } from './utilities/utilities.js'; import { replaceKey, replaceKeyArray } from '../../features/placeholders.js'; export const CONFIG = { - icons, + icons: isDarkMode() ? darkIcons : icons, delays: { mainNavDropdowns: 800, loadDelayed: 3000, @@ -605,7 +607,7 @@ class Gnav { env: environment, locale, imsClientId: window.adobeid?.client_id, - theme: 'light', + theme: isDarkMode() ? 'dark' : 'light', onReady: () => { this.decorateAppPrompt({ getAnchorState: () => window.UniversalNav.getComponent?.('app-switcher') }); }, @@ -746,6 +748,14 @@ class Gnav { // Create image element const getImageEl = () => { + if (isDarkMode()) { + const allSvgImgs = rawBlock.querySelectorAll('picture img[src$=".svg"]'); + if (allSvgImgs.length === 2) return allSvgImgs[1]; + + const images = blockLinks.filter((blockLink) => imgRegex.test(blockLink.href) + || imgRegex.test(blockLink.textContent)); + if (images.length === 2) return getBrandImage(images[1]); + } const svgImg = rawBlock.querySelector('picture img[src$=".svg"]'); if (svgImg) return svgImg; @@ -1027,6 +1037,7 @@ export default async function init(block) { block.setAttribute('daa-im', 'true'); const mepMartech = mep?.martech || ''; block.setAttribute('daa-lh', `gnav|${getExperienceName()}${mepMartech}`); + if (isDarkMode()) block.classList.add('feds--dark'); return gnav; } catch (e) { lanaLog({ message: 'Could not create global navigation.', e, tags: 'errorType=error,module=gnav' }); diff --git a/libs/blocks/global-navigation/utilities/menu/menu.css b/libs/blocks/global-navigation/utilities/menu/menu.css index c99630ddb8..f9add4aab1 100644 --- a/libs/blocks/global-navigation/utilities/menu/menu.css +++ b/libs/blocks/global-navigation/utilities/menu/menu.css @@ -35,14 +35,14 @@ .feds-menu-column--group .feds-menu-column:not(:last-child) { padding-bottom: 12px; margin-bottom: 12px; - border-bottom: 1px solid var(--feds-borderColor-menu--light); + border-bottom: 1px solid var(--feds-borderColor-menu); } .feds-menu-headline { position: relative; padding: 12px 44px 12px 32px; - border-bottom: 1px solid var(--feds-borderColor-menu--light); - color: var(--feds-color-headline--light); + border-bottom: 1px solid var(--feds-borderColor-menu); + color: var(--feds-color-headline); font-weight: 600; white-space: nowrap; cursor: pointer; @@ -63,7 +63,7 @@ margin-top: -3px; border-width: 0 1px 1px 0; border-style: solid; - border-color: var(--feds-color-link--light); + border-color: var(--feds-color-link); transform-origin: 75% 75%; transform: rotateZ(45deg); transition: transform 0.1s ease; @@ -77,7 +77,7 @@ } .feds-menu-items { - border-bottom: solid 1px var(--feds-borderColor-menu--light); + border-bottom: solid 1px var(--feds-borderColor-menu); } .feds-promo { @@ -164,8 +164,8 @@ display: flex; flex-direction: column; width: 100%; - border: 1px solid var(--feds-borderColor--light); - background: var(--feds-background-nav--light); + border: 1px solid var(--feds-borderColor); + background: var(--feds-background-nav); white-space: normal; box-sizing: content-box; } @@ -209,7 +209,7 @@ .feds-promo--dark, .feds-promo--dark a:not(.feds-cta) { - color: var(--feds-background-nav--light); + color: var(--feds-background-nav); } .feds-promo--dark a, diff --git a/libs/blocks/global-navigation/utilities/utilities.js b/libs/blocks/global-navigation/utilities/utilities.js index a4c73212f7..3c1e9b7ee6 100644 --- a/libs/blocks/global-navigation/utilities/utilities.js +++ b/libs/blocks/global-navigation/utilities/utilities.js @@ -30,6 +30,11 @@ export const icons = { home: '', }; +export const darkIcons = { + ...icons, + company: '', +}; + export const lanaLog = ({ message, e = '', tags = 'errorType=default' }) => { const url = getMetadata('gnav-source'); window.lana.log(`${message} | gnav-source: ${url} | href: ${window.location.href} | ${e.reason || e.error || e.message || e}`, { @@ -156,12 +161,22 @@ export function loadStyles(url) { }); } +export function isDarkMode() { + const { theme } = getConfig(); + return theme === 'dark'; +} + // Base styles are shared between top navigation and footer, // since they can be independent of each other. // CSS imports were not used due to duplication of file include export async function loadBaseStyles() { - const url = rootPath('base.css'); - await loadStyles(url); + if (isDarkMode()) { + new Promise((resolve) => { loadStyle(rootPath('base.css'), resolve); }) + .then(() => loadStyles(rootPath('dark-nav.css'))); + } else { + const url = rootPath('base.css'); + await loadStyles(url); + } } export function loadBlock(path) { diff --git a/libs/navigation/navigation.css b/libs/navigation/navigation.css index 96ac72d5de..e7fbbdc1bc 100644 --- a/libs/navigation/navigation.css +++ b/libs/navigation/navigation.css @@ -24,7 +24,16 @@ font-size: 18px; } -header.global-navigation { +header.global-navigation, header.global-navigation.feds--dark { height: 64px; visibility: hidden; } + +@media (min-width: 900px) { + .feds-promo-link { + color: #035FE6; + } + .feds-promo-link:hover { + color: #136FF6; + } +} diff --git a/libs/navigation/navigation.js b/libs/navigation/navigation.js index c74bcaed2e..e31dd77195 100644 --- a/libs/navigation/navigation.js +++ b/libs/navigation/navigation.js @@ -34,7 +34,9 @@ function getParamsConfigs(configs) { } export default async function loadBlock(configs, customLib) { - const { header, footer, authoringPath, env = 'prod', locale = '' } = configs || {}; + const { + header, footer, authoringPath, env = 'prod', locale = '', theme, + } = configs || {}; const branch = new URLSearchParams(window.location.search).get('navbranch'); const miloLibs = branch ? `https://${branch}--milo--adobecom.hlx.page` : customLib || envMap[env]; if (!header && !footer) { @@ -55,6 +57,7 @@ export default async function loadBlock(configs, customLib) { pathname: `/${locale}`, locales: configs.locales || locales, contentRoot: authoringPath || footer.authoringPath, + theme, ...paramConfigs, }; setConfig(clientConfig); diff --git a/libs/styles/styles.css b/libs/styles/styles.css index 7413807321..53eca9bd3c 100644 --- a/libs/styles/styles.css +++ b/libs/styles/styles.css @@ -703,7 +703,7 @@ header:not(.global-navigation) ~ main { the 'global-navigation' class should also be removed from the 'header' selector all of the ':not(.global-navigation)' rules can be entirely removed. */ -header.global-navigation { +header.global-navigation, header.global-navigation.feds--dark { height: var(--global-height-nav); visibility: hidden; } diff --git a/test/blocks/global-footer/global-footer.test.js b/test/blocks/global-footer/global-footer.test.js index 0010dfdc56..d99e9868c5 100644 --- a/test/blocks/global-footer/global-footer.test.js +++ b/test/blocks/global-footer/global-footer.test.js @@ -422,4 +422,15 @@ describe('global footer', () => { expect(window.lana.log.getCalls().find((c) => c.args[0].includes('Issue with loadIcons'))); }); }); + + describe('dark mode footer', async () => { + it('should not contain dark theme class if dark theme is not configured', async () => { + await createFullGlobalFooter({ waitForDecoration: true }); + expect(document.querySelector('footer').classList.contains('feds--dark')).to.be.false; + }); + it('should contain dark theme class if dark theme is configured', async () => { + await createFullGlobalFooter({ waitForDecoration: true, customConfig: { theme: 'dark' } }); + expect(document.querySelector('footer').classList.contains('feds--dark')).to.be.true; + }); + }); }); diff --git a/test/blocks/global-footer/test-utilities.js b/test/blocks/global-footer/test-utilities.js index 6bb9a9e1ba..24e65614f6 100644 --- a/test/blocks/global-footer/test-utilities.js +++ b/test/blocks/global-footer/test-utilities.js @@ -74,9 +74,9 @@ export const waitForFooterToDecorate = (targetedSelectors = allSelectors) => Pro .map((key) => waitForElement(allSelectors[key])), ); -export const createFullGlobalFooter = async ({ waitForDecoration, viewport = 'desktop' }) => { +export const createFullGlobalFooter = async ({ waitForDecoration, viewport = 'desktop', customConfig = {} }) => { await setViewport(viewports[viewport]); - setConfig(config); + setConfig({ ...config, ...customConfig }); // we need to import the footer class in here so it can use the config we have set above // if we import it at the top of the file, an empty config will be defined and used by the footer diff --git a/test/blocks/global-navigation/global-navigation.test.js b/test/blocks/global-navigation/global-navigation.test.js index 61f6c91a23..4af0799b83 100644 --- a/test/blocks/global-navigation/global-navigation.test.js +++ b/test/blocks/global-navigation/global-navigation.test.js @@ -16,6 +16,7 @@ import initGnav, { getUniversalNavLocale, osMap } from '../../../libs/blocks/glo import { isDesktop, isTangentToViewport, toFragment } from '../../../libs/blocks/global-navigation/utilities/utilities.js'; import logoOnlyNav from './mocks/global-navigation-only-logo.plain.js'; import longNav from './mocks/global-navigation-long.plain.js'; +import darkNav from './mocks/dark-global-navigation.plain.js'; import globalNavigationMock from './mocks/global-navigation.plain.js'; import { getConfig } from '../../../tools/send-to-caas/send-utils.js'; @@ -600,4 +601,23 @@ describe('global navigation', () => { expect(!!weAppPrompt).to.be.true; }); }); + + describe('GNav Dark theme', () => { + it('should not contain dark theme class if dark theme is not configured', async () => { + await createFullGlobalNavigation(); + expect(document.querySelector(selectors.globalNav).classList.contains('feds--dark')).to.be.false; + }); + it('should contain dark theme class if dark theme is configured', async () => { + await createFullGlobalNavigation({ customConfig: { theme: 'dark' } }); + expect(document.querySelector(selectors.globalNav).classList.contains('feds--dark')).to.be.true; + }); + it('should use first image if not dark theme', async () => { + await createFullGlobalNavigation({ globalNavigation: darkNav }); + expect(document.querySelector(`${selectors.brandImage} img`).getAttribute('src')).to.equal('http://localhost:2000/test/blocks/global-navigation/mocks/adobe-logo.svg'); + }); + it('should use second image for dark theme', async () => { + await createFullGlobalNavigation({ globalNavigation: darkNav, customConfig: { theme: 'dark' } }); + expect(document.querySelector(`${selectors.brandImage} img`).getAttribute('src')).to.equal('http://localhost:2000/test/blocks/global-navigation/mocks/adobe-dark-logo.svg'); + }); + }); }); diff --git a/test/blocks/global-navigation/mocks/adobe-dark-logo.svg b/test/blocks/global-navigation/mocks/adobe-dark-logo.svg new file mode 100644 index 0000000000..f799476f23 --- /dev/null +++ b/test/blocks/global-navigation/mocks/adobe-dark-logo.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/test/blocks/global-navigation/mocks/dark-global-navigation.plain.js b/test/blocks/global-navigation/mocks/dark-global-navigation.plain.js new file mode 100644 index 0000000000..a2124ee177 --- /dev/null +++ b/test/blocks/global-navigation/mocks/dark-global-navigation.plain.js @@ -0,0 +1,326 @@ +// Uses the franklin structure without any customizations +export default `

+ +
+
+
+
+
+

+ Cloud Menu +

+
+
+
+
+
+
+
+
+

+ FEDS Menu +

+
+
+
+
+
+

w/ Promo

+ +
+
+
+

Business Resilience: Leading Through Change

+

+ Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas + porttitor congue massa. +

+

Check it out

+
+
+
+
+ + + + + + +
+
+
+
+
+

2 Col

+
Column 1 heading
+ + +
Column 2 heading
+ +

+ Events +

+
+ +
+

+ Primary +

+
+
+

+ Secondary +

+
+
+

Random text

+
+ +
+ +
+
+
+
Local Menu Title
+

+ Creativity +

+

+ Digital Transformation +

+

+ Trends & Research +

+
+
+ +
+
+ +
+ +
+ `; From ad50e4b21bb0b54e7a1892ee1ba7619647317600 Mon Sep 17 00:00:00 2001 From: Vivian A Goodrich <101133187+vgoodric@users.noreply.github.com> Date: Mon, 2 Sep 2024 02:17:57 -0600 Subject: [PATCH 09/21] MWPW-157034 [MEP] move call for preview from loadPostLCP to loadDeferred (#2770) * move call for preview from loadPostLCP to loadDeferred * change function name to getSelectorType * revert --- libs/utils/utils.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libs/utils/utils.js b/libs/utils/utils.js index 52d3b0e190..6931da2a23 100644 --- a/libs/utils/utils.js +++ b/libs/utils/utils.js @@ -1013,10 +1013,6 @@ async function loadPostLCP(config) { import('../features/personalization/personalization.js') .then(({ addMepAnalytics }) => addMepAnalytics(config, header)); } - if (config.mep?.preview) { - import('../features/personalization/preview.js') - .then(({ default: decoratePreviewMode }) => decoratePreviewMode()); - } } export function scrollToHashedElement(hash) { @@ -1072,6 +1068,10 @@ export async function loadDeferred(area, blocks, config) { sampleRate: parseInt(getMetadata('pageperf-rate'), 10), })); } + if (config.mep?.preview) { + import('../features/personalization/preview.js') + .then(({ default: decoratePreviewMode }) => decoratePreviewMode()); + } } function initSidekick() { From 77268c0e81be855f03c13fcc3ffcce6354cfbdef Mon Sep 17 00:00:00 2001 From: Drashti Modasara Date: Mon, 2 Sep 2024 13:48:04 +0530 Subject: [PATCH 10/21] [MWPW-152968] mWeb - Passing ECID to Branch.io banner - Implementation (#2772) * branch banner ecid * review changes * passing ecid value --------- Co-authored-by: Drashti Modasara --- .../mobile-app-banner/mobile-app-banner.js | 21 +++++++++++- .../mobile-app-banner.test.js | 34 ++++++++++++++++++- 2 files changed, 53 insertions(+), 2 deletions(-) diff --git a/libs/blocks/mobile-app-banner/mobile-app-banner.js b/libs/blocks/mobile-app-banner/mobile-app-banner.js index 0e2e546b07..9c5988ee44 100644 --- a/libs/blocks/mobile-app-banner/mobile-app-banner.js +++ b/libs/blocks/mobile-app-banner/mobile-app-banner.js @@ -13,9 +13,20 @@ async function getKey(product) { return keyMatch[0]?.key; } +async function getECID() { + let ecid = null; + if (window.alloy) { + await window.alloy('getIdentity').then((data) => { + ecid = data?.identity?.ECID; + }).catch((err) => window.lana.log(`Error fetching ECID: ${err}`, { tags: 'errorType=error,module=mobile-app-banner' })); + } + return ecid; +} + /* eslint-disable */ -function branchInit(key) { +async function branchInit(key) { let initValue = false; + const ecid = await getECID(); function initBranch() { if (initValue) { return; @@ -48,8 +59,16 @@ function branchInit(key) { 0 ); const privacyConsent = window.adobePrivacy?.hasUserProvidedConsent(); + const isAndroid = navigator.userAgent.includes('Android'); + + const cookieGrp = window.adobePrivacy?.activeCookieGroups(); + const performanceCookieConsent = cookieGrp.includes('C0002'); + const advertisingCookieConsent = cookieGrp.includes('C0004'); + + if (performanceCookieConsent && advertisingCookieConsent && isAndroid) branch.setBranchViewData({ data: { ecid }}); branch.init(key, { tracking_disabled: !privacyConsent }); } + ['adobePrivacy:PrivacyConsent', 'adobePrivacy:PrivacyReject', 'adobePrivacy:PrivacyCustom'] .forEach((event) => { window.addEventListener(event, initBranch); diff --git a/test/blocks/mobile-app-banner/mobile-app-banner.test.js b/test/blocks/mobile-app-banner/mobile-app-banner.test.js index b8656f95f1..81b65f8e19 100644 --- a/test/blocks/mobile-app-banner/mobile-app-banner.test.js +++ b/test/blocks/mobile-app-banner/mobile-app-banner.test.js @@ -51,7 +51,11 @@ describe('mobile-app-banner', () => { }); it('should init by adding branchio script', async () => { - window.adobePrivacy = { hasUserProvidedConsent: () => true }; + window.adobePrivacy = { + hasUserProvidedConsent: () => true, + activeCookieGroups: () => ['C0002', 'C0004'], + }; + const userAgentStub = sinon.stub(navigator, 'userAgent').get(() => 'Android'); const module = await import('../../../libs/blocks/mobile-app-banner/mobile-app-banner.js'); const banner = document.body.querySelector('.mobile-app-banner.product-test'); await module.default(banner); @@ -63,5 +67,33 @@ describe('mobile-app-banner', () => { if (scriptTag.getAttribute('src') !== null) scriptSrcs.push(scriptTag.getAttribute('src')); }); expect(scriptSrcs).to.include('https://cdn.branch.io/branch-latest.min.js'); + userAgentStub.restore(); + }); + + it('should fetch ecid from alloy and return if event is dispatched twice', async () => { + window.adobePrivacy = { + hasUserProvidedConsent: () => true, + activeCookieGroups: () => ['C0002', 'C0004'], + }; + window.alloy = () => {}; + const alloyStub = sinon.stub(window, 'alloy').callsFake((command) => { + if (command === 'getIdentity') { + return Promise.resolve({ identity: { ECID: 'test-ecid' } }); + } + return 'test-ecid'; + }); + const module = await import('../../../libs/blocks/mobile-app-banner/mobile-app-banner.js'); + const banner = document.body.querySelector('.mobile-app-banner.product-test'); + await module.default(banner); + window.dispatchEvent(new CustomEvent('adobePrivacy:PrivacyConsent')); + await delay(0); + const scriptTags = document.querySelectorAll('head > script'); + const scriptSrcs = []; + scriptTags.forEach((scriptTag) => { + if (scriptTag.getAttribute('src') !== null) scriptSrcs.push(scriptTag.getAttribute('src')); + }); + window.dispatchEvent(new CustomEvent('adobePrivacy:PrivacyConsent')); + expect(scriptSrcs).to.include('https://cdn.branch.io/branch-latest.min.js'); + alloyStub.restore(); }); }); From 4e85f88a6bda5a37482e8c2b6bf5bc02c338e22f Mon Sep 17 00:00:00 2001 From: Elan Bartholomew <79870969+elan-tbx@users.noreply.github.com> Date: Mon, 2 Sep 2024 02:18:11 -0600 Subject: [PATCH 11/21] MWPW-153372 - Add ability to further customize buttons (#2776) * update button decorator to handle custom classes * add dash character to regex * add coverage * add safeguard for href-less buttons * account for modals * Revert "MWPW-151936 - Aside Tiger Team Enhancements (redux)" (#2777) Revert "MWPW-151936 - Aside Tiger Team Enhancements (redux) (#2767)" This reverts commit 88cb1010512d247531a75bfef6bdc174a2b957b7. * add modal coverage * Revert "Revert "MWPW-151936 - Aside Tiger Team Enhancements (redux)" (#2777)" This reverts commit b1a39486ec5141de57018960a7c8515a93e78340. --- libs/utils/decorate.js | 18 ++++++++++++++---- test/blocks/text/mocks/body.html | 15 +++++++++++++++ 2 files changed, 29 insertions(+), 4 deletions(-) diff --git a/libs/utils/decorate.js b/libs/utils/decorate.js index 25a0e8203c..06b84a971b 100644 --- a/libs/utils/decorate.js +++ b/libs/utils/decorate.js @@ -5,17 +5,27 @@ export function decorateButtons(el, size) { if (buttons.length === 0) return; const buttonTypeMap = { STRONG: 'blue', EM: 'outline', A: 'blue' }; buttons.forEach((button) => { + let target = button; const parent = button.parentElement; const buttonType = buttonTypeMap[parent.nodeName] || 'outline'; if (button.nodeName === 'STRONG') { - parent.classList.add('con-button', buttonType); - if (size) parent.classList.add(size); /* button-l, button-xl */ + target = parent; } else { - button.classList.add('con-button', buttonType); - if (size) button.classList.add(size); /* button-l, button-xl */ parent.insertAdjacentElement('afterend', button); parent.remove(); } + target.classList.add('con-button', buttonType); + if (size) target.classList.add(size); /* button-l, button-xl */ + const customClasses = target.href && [...target.href.matchAll(/#_button-([a-zA-Z-]+)/g)]; + if (customClasses) { + customClasses.forEach((match) => { + target.href = target.href.replace(match[0], ''); + if (target.dataset.modalHash) { + target.setAttribute('data-modal-hash', target.dataset.modalHash.replace(match[0], '')); + } + target.classList.add(match[1]); + }); + } const actionArea = button.closest('p, div'); if (actionArea) { actionArea.classList.add('action-area'); diff --git a/test/blocks/text/mocks/body.html b/test/blocks/text/mocks/body.html index 3c10028ad6..2db780be10 100644 --- a/test/blocks/text/mocks/body.html +++ b/test/blocks/text/mocks/body.html @@ -220,3 +220,18 @@

+
+
#ffffff
+
+
+
+

Text – Full-Width, Medium

+

Featuring over 600,000 hand-picked stock photos and graphics, curated from the world’s leading photographers, illustrators, and agencies. Our Premium collection is perfect for organizations looking for authentic, high-quality commercial content, and easy licensing plans.

+

Milo

+
+
+ + From e675bf41c2a97f5c52119d3f32944d38acf3260b Mon Sep 17 00:00:00 2001 From: Cody Lloyd <119891065+colloyd@users.noreply.github.com> Date: Mon, 2 Sep 2024 02:18:17 -0600 Subject: [PATCH 12/21] MWPW-156126 - quiz-entry contrast and accessibility (#2785) * adjustment to colors for better contrast * aria-label for carousel arrows * css clean up Resolves: [MWPW-156126](https://jira.corp.adobe.com/browse/MWPW-156126) --- libs/blocks/quiz-entry/quiz-entry.css | 58 +++++++-------------------- libs/blocks/quiz-entry/quizoption.js | 4 +- 2 files changed, 16 insertions(+), 46 deletions(-) diff --git a/libs/blocks/quiz-entry/quiz-entry.css b/libs/blocks/quiz-entry/quiz-entry.css index 858604ce0d..049f39a0b9 100644 --- a/libs/blocks/quiz-entry/quiz-entry.css +++ b/libs/blocks/quiz-entry/quiz-entry.css @@ -1,3 +1,8 @@ +.quiz-entry { + --quiz-button-disabled-bg: #757575; + --quiz-button-disabled-text: #FFF6F6; +} + .quiz-container { align-items: center; color: var(--color-black); @@ -17,15 +22,15 @@ } .quiz-title { - font-size: 28px; - line-height: 36px; + font-size: var(--type-heading-xl-size); + line-height: var(--type-heading-xl-lh); font-weight: var(--type-heading-all-weight); margin-bottom: 8px; } .quiz-subtitle { - font-size: 20px; - line-height: 30px; + font-size: var(--type-heading-l-size); + line-height: var(--type-heading-l-lh); } .quiz-question-container { @@ -134,7 +139,7 @@ .quiz-directions { align-items: center; - background: linear-gradient(90deg, #E200D9 1.24%, #E84601 100%); + background: linear-gradient(90deg, #A900A2 1.24%, #E84601 100%); border-radius: 8px; color: #FFF; display: flex; @@ -230,25 +235,6 @@ position: relative; } -.quiz-option-icon { - align-items: center; - background-color: var(--quiz-icon-bg); - border-radius: 0.5rem; - display: flex; - line-height: 0; - padding: 0 24px; -} - -.quiz-option-icon img { - height: var(--icon-size-l); - width: var(--icon-size-l); - max-width: var(--icon-size-l); -} - -.quiz-option.has-icon .no-icon-default { - display: none; -} - .quiz-option-image { display: flex; align-items: center; @@ -256,7 +242,7 @@ justify-content: center; margin: 0; height: 100%; - filter: brightness(33%); + filter: brightness(35%); } .quiz-option-text-container { @@ -289,14 +275,6 @@ text-align: start; } -.quiz-option:hover .quiz-option-icon { - background-color: color-mix(in srgb, var(--quiz-icon-bg) 70%, var(--color-white)); -} - -.quiz-option:focus-visible .quiz-option-icon { - background-color: color-mix(in srgb, var(--quiz-icon-bg) 80%, var(--color-white)); -} - .quiz-option.selected { border: 5px solid #FC00F2; border-radius: 13px; @@ -314,14 +292,10 @@ z-index: 1; } -.quiz-option.selected .quiz-option-icon { - background-color: color-mix(in srgb, var(--quiz-icon-bg) 70%, var(--color-white)); -} - .quiz-option:hover .quiz-option-image, .quiz-option.selected .quiz-option-image, .quiz-option:focus-visible .quiz-option-image { - filter: brightness(33%); + filter: brightness(20%); } .quiz-option:focus-visible::after { @@ -382,12 +356,12 @@ } .quiz-button[disabled] { - background: var(--color-gray-400); + background: var(--quiz-button-disabled-bg); cursor: not-allowed; } .quiz-button[disabled] .quiz-button-label{ - color: var(--color-white); + color: var(--quiz-button-disabled-text); } /* Tablet up */ @@ -477,10 +451,6 @@ min-height: 232px; } - .quiz-option-image { - filter: brightness(55%); - } - .quiz-option-title { font-size: 24px; line-height: 30px; diff --git a/libs/blocks/quiz-entry/quizoption.js b/libs/blocks/quiz-entry/quizoption.js index 4681a86e54..bb3f88bf15 100644 --- a/libs/blocks/quiz-entry/quizoption.js +++ b/libs/blocks/quiz-entry/quizoption.js @@ -144,7 +144,7 @@ export const GetQuizOption = ({ return html`
- ${index > 0 && html``} + ${index > 0 && html``} - ${(index + visibleCount < options.data.length) && html``} + ${(index + visibleCount < options.data.length) && html``}
`; }; From 76a13443e73af38f3ceee17c901dcc5d8673161a Mon Sep 17 00:00:00 2001 From: Santoshkumar Nateekar Date: Mon, 2 Sep 2024 01:18:25 -0700 Subject: [PATCH 13/21] MWPW-157346:[NALA] Move Nala tests to Milo repository (#2795) * nala initial commit * gitignore * updated the tests * update to the packages * updating util file * remove new line * update base-reporter.js * update geo pom * update nala run * update git ignore * fixing eslint errors * eslint fixes --------- Co-authored-by: milo-pr-merge[bot] <169241390+milo-pr-merge[bot]@users.noreply.github.com> Co-authored-by: Santoshkumar Sharanappa Nateekar Co-authored-by: Santoshkumar Sharanappa Nateekar --- .gitignore | 2 + .../.nala-snippets/spec-snippet.code-snippets | 25 ++ nala/blocks/accordion/accordion.page.js | 22 ++ nala/blocks/accordion/accordion.spec.js | 56 +++ nala/blocks/accordion/accordion.test.js | 136 ++++++++ nala/features/georouting/georouting.page.js | 78 +++++ nala/features/georouting/georouting.spec.js | 104 ++++++ nala/features/georouting/georouting.test.js | 137 ++++++++ nala/libs/baseurl.js | 17 + nala/libs/webutil.js | 329 ++++++++++++++++++ nala/utils/base-reporter.js | 223 ++++++++++++ nala/utils/global.setup.js | 132 +++++++ nala/utils/nala.run.js | 181 ++++++++++ nala/utils/slack.js | 21 ++ package-lock.json | 103 +++++- package.json | 3 + playwright.config.js | 71 ++++ 17 files changed, 1633 insertions(+), 7 deletions(-) create mode 100644 nala/.nala-snippets/spec-snippet.code-snippets create mode 100644 nala/blocks/accordion/accordion.page.js create mode 100644 nala/blocks/accordion/accordion.spec.js create mode 100644 nala/blocks/accordion/accordion.test.js create mode 100644 nala/features/georouting/georouting.page.js create mode 100644 nala/features/georouting/georouting.spec.js create mode 100644 nala/features/georouting/georouting.test.js create mode 100644 nala/libs/baseurl.js create mode 100644 nala/libs/webutil.js create mode 100644 nala/utils/base-reporter.js create mode 100644 nala/utils/global.setup.js create mode 100644 nala/utils/nala.run.js create mode 100644 nala/utils/slack.js create mode 100644 playwright.config.js diff --git a/.gitignore b/.gitignore index b2dfb8c210..5fba7ff881 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,5 @@ logs/* .iml .env **/mas/*/stats.json +test-html-results/ +test-results/ diff --git a/nala/.nala-snippets/spec-snippet.code-snippets b/nala/.nala-snippets/spec-snippet.code-snippets new file mode 100644 index 0000000000..1c5e123bf3 --- /dev/null +++ b/nala/.nala-snippets/spec-snippet.code-snippets @@ -0,0 +1,25 @@ +{ + "Create Nala Spec": { + "prefix": "create nala spec", + "body": [ + "module.exports = {", + " FeatureName: '${1:Block or Feature Name}',", + " features: [", + " {", + " tcid: '0',", + " name: '@${2:spec-name}',", + " path: '/drafts/nala/[${3:test-page-path}]',", + " data: {", + " attribute-1: '${4:value}',", + " attribute-2: '${5:value}',", + " attribute-3: '${6:value}',", + " },", + " tags: '@Block @smoke @regression @milo',", + " },", + " ],", + "};" + ], + "description": "Create a Nala spec with block name or feature name" + } +} + diff --git a/nala/blocks/accordion/accordion.page.js b/nala/blocks/accordion/accordion.page.js new file mode 100644 index 0000000000..4d49b6fb94 --- /dev/null +++ b/nala/blocks/accordion/accordion.page.js @@ -0,0 +1,22 @@ +export default class Accordion { + constructor(page, nth = 0) { + this.page = page; + // accordion locators + this.section = this.page.locator('.section').nth(nth); + this.accordion = this.page.locator('.accordion-container').nth(nth); + this.accordionForeground = this.accordion.locator('.foreground'); + this.accordionHeaders = this.accordion.locator('dt[role=heading]'); + this.accordionButtons = this.accordion.locator('dt button'); + this.accordionButtonIcons = this.accordion.locator('.accordion-icon'); + this.outlineButton = this.accordion.locator('.con-button.outline').nth(nth); + this.blueButton = this.accordion.locator('.con-button.blue').nth(nth); + this.textLink = this.accordion.locator('//a[contains(text(), "Text link")]').nth(nth); + + // accordion blocks attributes + this.attributes = { + 'accordion-container': { class: 'accordion-container con-block max-width-10-desktop' }, + 'accordion-container.seo': { class: 'accordion-container seo con-block max-width-10-desktop' }, + 'accordion-container-quiet-large': { class: 'accordion-container quiet max-width-12-desktop-large con-block' }, + }; + } +} diff --git a/nala/blocks/accordion/accordion.spec.js b/nala/blocks/accordion/accordion.spec.js new file mode 100644 index 0000000000..a40d8740e3 --- /dev/null +++ b/nala/blocks/accordion/accordion.spec.js @@ -0,0 +1,56 @@ +module.exports = { + FeatureName: 'Accordion Block', + features: [ + { + tcid: '0', + name: '@accordion-container', + path: '/drafts/nala/blocks/accordion/accordion#', + data: { + headers: 3, + heading0: 'How do I compress a PDF without losing quality?', + heading1: 'What size PDFs can I compress?', + heading2: 'How do I check my PDF file size?', + }, + tags: '@accordion @t1 @smoke @regression @milo', + }, + { + tcid: '1', + name: '@accordion(seo)', + path: '/drafts/nala/blocks/accordion/accordion-seo#', + data: { + headers: 3, + heading0: 'How do I compress a PDF without losing quality?', + heading1: 'What size PDFs can I compress?', + heading2: 'How do I check my PDF file size?', + }, + tags: '@accordion @accordion-seo @smoke @regression @milo', + }, + { + tcid: '2', + name: '@accordion (quiet, max-width-12-desktop-large)', + path: '/drafts/nala/blocks/accordion/accordion-quiet-max-width-12-desktop-large#', + data: { + headers: 3, + heading0: 'How do I compress a PDF without losing quality?', + heading1: 'What size PDFs can I compress?', + heading2: 'How do I check my PDF file size?', + }, + tags: '@accordion @accordion-quiet-max @smoke @regression @milo', + }, + { + tcid: '3', + name: '@accordion-seo-editorial', + path: '/drafts/nala/blocks/accordion/accordion-seo-editorial', + data: { + headers: 3, + heading0: 'How do I compress a PDF without losing quality?', + heading1: 'What size PDFs can I compress?', + heading2: 'How do I check my PDF file size?', + outlineButtonText: 'Lorem ipsum', + blueButtonText: 'Learn more', + }, + tags: '@accordion @t3 @smoke @regression @milo', + }, + + ], +}; diff --git a/nala/blocks/accordion/accordion.test.js b/nala/blocks/accordion/accordion.test.js new file mode 100644 index 0000000000..86dfa7d275 --- /dev/null +++ b/nala/blocks/accordion/accordion.test.js @@ -0,0 +1,136 @@ +import { expect, test } from '@playwright/test'; +import WebUtil from '../../libs/webutil.js'; +import { features } from './accordion.spec.js'; +import AccordionBlock from './accordion.page.js'; + +let webUtil; +let accordion; + +const miloLibs = process.env.MILO_LIBS || ''; + +test.describe('Milo Accordion Block test suite', () => { + test.beforeEach(async ({ page }) => { + webUtil = new WebUtil(page); + accordion = new AccordionBlock(page); + }); + + // Test 0 : Accordion Container + test(`${features[0].name},${features[0].tags}`, async ({ page, baseURL }) => { + console.info(`[Test Page]: ${baseURL}${features[0].path}${miloLibs}`); + const { data } = features[0]; + + await test.step('step-1: Go to Accordion block test page', async () => { + await page.goto(`${baseURL}${features[0].path}${miloLibs}`); + await page.waitForLoadState('domcontentloaded'); + await expect(page).toHaveURL(`${baseURL}${features[0].path}${miloLibs}`); + }); + + await test.step('step-2: Verify Accrodion block content/specs', async () => { + await expect(await accordion.accordion).toBeVisible(); + + // verify accordion headers, buttons, and icons count + await expect(await accordion.accordionHeaders).toHaveCount(data.headers); + await expect(await accordion.accordionButtons).toHaveCount(data.headers); + await expect(await accordion.accordionButtonIcons).toHaveCount(data.headers); + + // verify accordion headers text content + await expect(await accordion.accordionHeaders.nth(0)).toContainText(data.heading0); + await expect(await accordion.accordionHeaders.nth(1)).toContainText(data.heading1); + await expect(await accordion.accordionHeaders.nth(2)).toContainText(data.heading2); + + // verify accordion buttons open close clicks + await expect(await accordion.accordionButtons.nth(0)).toHaveAttribute('aria-expanded', 'false'); + await accordion.accordionButtonIcons.nth(0).click(); + await expect(await accordion.accordionButtons.nth(0)).toHaveAttribute('aria-expanded', 'true'); + await accordion.accordionButtonIcons.nth(0).click(); + await expect(await accordion.accordionButtons.nth(0)).toHaveAttribute('aria-expanded', 'false'); + }); + + await test.step('step-3: Verify analytics attributes', async () => { + await expect(await accordion.section).toHaveAttribute('daa-lh', await webUtil.getSectionDaalh(1)); + await expect(await accordion.accordion).toHaveAttribute('daa-lh', await webUtil.getBlockDaalh('accordion-container', 1)); + }); + }); + + // Test 1 : Accordion (seo) + test(`${features[1].name},${features[1].tags}`, async ({ page, baseURL }) => { + console.info(`[Test Page]: ${baseURL}${features[1].path}${miloLibs}`); + + await test.step('step-1: Go to Accordion block test page', async () => { + await page.goto(`${baseURL}${features[1].path}${miloLibs}`); + await page.waitForLoadState('domcontentloaded'); + await expect(page).toHaveURL(`${baseURL}${features[1].path}${miloLibs}`); + }); + + await test.step('step-2: Verify Accrodion seo block specs', async () => { + await expect(await accordion.accordion).toBeVisible(); + + const scriptContent = await page.evaluate(() => { + const scriptElement = document.querySelector('script[type="application/ld+json"]'); + return scriptElement ? scriptElement.textContent : null; + }); + expect(scriptContent).toBeTruthy(); + console.log('[SEO Script content]:', scriptContent); + + expect(await webUtil.verifyAttributes(accordion.accordion, accordion.attributes['accordion-container.seo'])).toBeTruthy(); + }); + + await test.step('step-3: Verify analytics attributes', async () => { + await expect(await accordion.accordion).toHaveAttribute('daa-lh', await webUtil.getBlockDaalh('accordion-container', 1)); + }); + }); + + // Test 2 : Accordion (quiet, max-width-12-desktop-large) + test(`${features[2].name},${features[2].tags}`, async ({ page, baseURL }) => { + console.info(`[Test Page]: ${baseURL}${features[2].path}${miloLibs}`); + const { data } = features[2]; + + await test.step('step-1: Go to Accordion block test page', async () => { + await page.goto(`${baseURL}${features[2].path}${miloLibs}`); + await page.waitForLoadState('domcontentloaded'); + await expect(page).toHaveURL(`${baseURL}${features[2].path}${miloLibs}`); + }); + + await test.step('step-2: Verify Accrodion block content/specs', async () => { + await expect(await accordion.accordion).toBeVisible(); + + // verify accordion headers, buttons, and icons count + await expect(await accordion.accordionHeaders).toHaveCount(data.headers); + await expect(await accordion.accordionButtons).toHaveCount(data.headers); + await expect(await accordion.accordionButtonIcons).toHaveCount(data.headers); + + // verify accordion headers text content + await expect(await accordion.accordionHeaders.nth(0)).toContainText(data.heading0); + await expect(await accordion.accordionHeaders.nth(1)).toContainText(data.heading1); + await expect(await accordion.accordionHeaders.nth(2)).toContainText(data.heading2); + + expect(await webUtil.verifyAttributes(accordion.accordion, accordion.attributes['accordion-container-quiet-large'])).toBeTruthy(); + }); + + await test.step('step-3: Verify analytics attributes', async () => { + await expect(await accordion.accordion).toHaveAttribute('daa-lh', await webUtil.getBlockDaalh('accordion-container', 1)); + }); + }); + + // Test 3 : Accordion seo editorial + test(`${features[3].name},${features[3].tags}`, async ({ page, baseURL }) => { + console.info(`[Test Page]: ${baseURL}${features[3].path}${miloLibs}`); + const { data } = features[3]; + + await test.step('step-1: Go to accordion test page', async () => { + await page.goto(`${baseURL}${features[3].path}${miloLibs}`); + await page.waitForLoadState('domcontentloaded'); + await expect(page).toHaveURL(`${baseURL}${features[3].path}${miloLibs}`); + }); + + await test.step('step-2: Verify accordion content/specs', async () => { + // verify action area buttons, links and text visibility and content + await expect(await accordion.outlineButton).toBeVisible(); + await expect(await accordion.blueButton).toBeVisible(); + await expect(await accordion.textLink).toBeVisible(); + + await expect(await accordion.outlineButton).toContainText(data.outlineButtonText); + await expect(await accordion.blueButton).toContainText(data.blueButtonText); + }); + }); +}); diff --git a/nala/features/georouting/georouting.page.js b/nala/features/georouting/georouting.page.js new file mode 100644 index 0000000000..8388b6bd71 --- /dev/null +++ b/nala/features/georouting/georouting.page.js @@ -0,0 +1,78 @@ +/* eslint-disable import/no-extraneous-dependencies, max-len, no-console */ +import { expect } from '@playwright/test'; + +export default class Georouting { + constructor(page) { + this.page = page; + + // global footer locators + this.footer = this.page.locator('.global-footer'); + this.changeRegionLink = this.footer.locator('.modal.link-block'); + + // change region modal locators + this.changeRegionModal = this.page.locator('.dialog-modal'); + this.fragment = this.changeRegionModal.locator('.fragment'); + this.regionNav = this.changeRegionModal.locator('.region-nav'); + this.deLink = this.changeRegionModal.locator('//a[text()="Deutschland"]'); + this.usLink = this.changeRegionModal.locator('//a[text()="United States"]/@href'); + this.modalClose = this.changeRegionModal.locator('.dialog-close'); + + // georouting modal locators + this.geoModal = this.page.locator('#locale-modal-v2'); + this.geoModalTitle = this.geoModal.locator('h3'); + this.geoModalText = this.geoModal.locator('.locale-text'); + this.geoModalClose = this.geoModal.locator('.dialog-close'); + this.usButton = this.geoModal.locator('//a[text()="United States"][@lang="en-US"]'); + } + + /** + * Verifies georouting modal content. + * @param {data} - data object from spec. + * @returns {Promise} - Returns true if modal content matches the expected data. + */ + async verifyGeoModal(data) { + try { + await expect(this.geoModal).toBeVisible(); + await expect(this.geoModalClose).toBeVisible(); + await expect(this.geoModalTitle).toContainText(data.title); + await expect(this.geoModalText).toContainText(data.text); + await expect(this.geoModal.locator(`//a[text()="${data.button}"]`)).toBeVisible({ timeout: 1000 }); + await expect(this.geoModal.locator(`//a[text()="${data.link}"]`)).toBeVisible({ timeout: 1000 }); + await expect(this.geoModal.locator(`//img[@alt="${data.flag}"]`)).toBeVisible({ timeout: 1000 }); + + return true; + } catch (error) { + console.error('Georouting modal verification is failed:', error); + return false; + } + } + + /** + * Verifies multi tab georouting modal. + * @param {data} - data object from spec. + * @returns {Promise} - Returns true if modal content is as expected. + */ + async verifyMultiTabGeoModal(data) { + /* eslint-disable no-restricted-syntax, guard-for-in */ + try { + await expect(this.geoModal).toBeVisible(); + await expect(this.geoModalClose).toBeVisible(); + let index = 0; + for (const tab in data) { + console.info(`[Tab]: "${data[tab].name}"`); + await this.geoModal.locator(`//button[text()="${data[tab].name}"]`).click(); + await expect(this.geoModalTitle.nth(index)).toContainText(data[tab].title); + await expect(this.geoModalText.nth(index)).toContainText(data[tab].text); + await expect(this.geoModal.locator(`//a[text()="${data[tab].button}"]`)).toBeVisible({ timeout: 1000 }); + await expect(this.geoModal.locator(`//a[text()="${data[tab].link}"]`).nth(index)).toBeVisible({ timeout: 1000 }); + await expect(this.geoModal.locator(`//img[@alt="${data[tab].flag}"]`)).toBeVisible({ timeout: 1000 }); + index = +1; + } + + return true; + } catch (error) { + console.log('Georouting multi tab modal verification is failed:', error); + return false; + } + } +} diff --git a/nala/features/georouting/georouting.spec.js b/nala/features/georouting/georouting.spec.js new file mode 100644 index 0000000000..6235b4e1c0 --- /dev/null +++ b/nala/features/georouting/georouting.spec.js @@ -0,0 +1,104 @@ +module.exports = { + name: 'Georouting Feature', + features: [ + { + tcid: '0', + name: '@Georouting modal', + desc: 'User accessing DE page from US locale.', + path: '/de/drafts/nala/features/georouting/georouting', + data: { + title: /This Adobe site doesn[' ’]t match your location./, + text: 'Based on your location, we think you may prefer the United States website', + button: 'United States', + link: 'Deutschland', + flag: 'United States', + cookieName: 'international', + cookieValue: 'de', + }, + tags: '@georouting @smoke @regression @milo @nopr', + }, + { + tcid: '1', + name: '@Georouting with query param', + desc: 'User is accessing the US page with a query parameter (akamaiLocale=DE).', + path: '/drafts/nala/features/georouting/georouting?akamaiLocale=DE', + data: { + title: 'Diese Adobe-Site passt nicht zu deinem Standort.', + text: 'Basierend auf deiner IP-Adresse könnte die Website für Deutschland passender sein.', + button: 'Deutschland', + link: 'United States', + flag: 'Deutschland', + cookieName: 'international', + cookieValue: 'de', + }, + tags: '@georouting @georouting-query-param @smoke @regression @milo', + }, + { + tcid: '2', + name: '@Georouting through Change region', + desc: 'User navigating to DE site through "Change region" modal.', + path: '/drafts/nala/features/georouting/georouting', + data: { + title: 'Diese Adobe-Site passt nicht zu deinem Standort.', + text: 'Basierend auf deiner IP-Adresse könnte die Website für Deutschland passender sein.', + button: 'Deutschland', + link: 'United States', + flag: 'Deutschland', + cookieName: 'international', + cookieValue: 'de', + }, + tags: '@georouting @smoke @regression @milo ', + }, + { + tcid: '3', + name: '@Georouting multi tab', + desc: 'User is accessing the CH page with a query parameter, the CH georouting modal will have multiple tabs for languages', + path: '/drafts/nala/features/georouting/georouting?akamaiLocale=CH', + data: { + tab1: { + name: 'Deutsch', + title: 'Diese Adobe-Site passt nicht zu deinem Standort.', + text: 'Basierend auf deiner IP-Adresse könnte die Website für Schweiz passender sein.', + button: 'Schweiz', + link: 'United States', + flag: 'Schweiz', + }, + tab2: { + name: 'Français', + title: 'Ce site Adobe ne correspond pas à votre zone géographique.', + text: 'Pour accéder à du contenu, des offres et des tarifs correspondant davantage à votre zone géographique, rendez-vous plutôt sur le site web Suisse.', + button: 'Suisse', + link: 'United States', + flag: 'Suisse', + }, + tab3: { + name: 'Italiano', + title: 'Questo sito Adobe non corrisponde alla tua posizione geografica.', + text: 'In base alla tua posizione, ti consigliamo di consultare il sito web di Adobe Svizzera, dove troverai contenuti, offerte e prezzi specifici per la tua area geografica.', + button: 'Svizzera', + link: 'United States', + flag: 'Svizzera', + }, + }, + tags: '@georouting @georouting-multi-tab @smoke @regression @milo ', + }, + { + tcid: '4', + name: '@Georouting-off', + desc: 'User is accessing "de" page for which georouting is turned off', + path: '/de/drafts/nala/features/georouting/geo-off', + tags: '@georouting @georouting-off @milo @smoke @regression', + }, + { + tcid: '5', + name: '@Georouting modal close', + desc: 'If user closes an georouting modal, the international cookie should not be added to the browser.', + path: '/de/drafts/nala/features/georouting/georouting', + data: { + cookieName: 'international', + cookieValue: 'de', + }, + tags: '@georouting @georouting-close @regression @milo @nopr', + }, + ], +}; diff --git a/nala/features/georouting/georouting.test.js b/nala/features/georouting/georouting.test.js new file mode 100644 index 0000000000..53b9cd1c61 --- /dev/null +++ b/nala/features/georouting/georouting.test.js @@ -0,0 +1,137 @@ +/* eslint-disable import/no-extraneous-dependencies, max-len, no-console */ +import { expect, test } from '@playwright/test'; +import { features } from './georouting.spec.js'; +import Georouting from './georouting.page.js'; + +let modal; + +const miloLibs = process.env.MILO_LIBS || ''; + +test.describe('Milo Georouting feature test suite', () => { + test.beforeEach(async ({ page }) => { + modal = new Georouting(page); + }); + + test(`${features[0].name},${features[0].tags}`, async ({ page, baseURL, browserName }) => { + test.skip(browserName === 'webkit', 'This feature is failing on Webkit browsers'); + test.slow(); + console.info(`[Test Page]: ${baseURL}${features[0].path}${miloLibs}`); + const { data } = features[0]; + + await test.step('step-1: Clear cookies and access "DE" page from "US" region', async () => { + await page.context().clearCookies(); + await page.goto(`${baseURL}${features[0].path}${miloLibs}`); + await page.waitForLoadState('domcontentloaded'); + await expect(page).toHaveURL(`${baseURL}${features[0].path}${miloLibs}`); + await modal.geoModal.waitFor({ state: 'visible', timeout: 30000 }); + }); + + await test.step('step-2: Verify georouting modal and its content', async () => { + expect(await modal.verifyGeoModal(data)).toBeTruthy(); + }); + + await test.step('step-3: Click "Deutschland" link from modal and then verify international cookie value', async () => { + await modal.deLink.click(); + expect((await page.context().cookies()).find((cookie) => cookie.name === data.cookieName).value).toEqual(data.cookieValue); + }); + }); + + test(`${features[1].name},${features[1].tags}`, async ({ page, baseURL }) => { + test.slow(); + console.info(`[Test Page]: ${baseURL}${features[1].path}&${miloLibs}`); + const { data } = features[1]; + + await test.step('step-1: Clear cookies and access "US" page with query param (akamailLocale=DE)', async () => { + await page.context().clearCookies(); + await page.goto(`${baseURL}${features[1].path}&${miloLibs}`); + await page.waitForLoadState('domcontentloaded'); + await expect(page).toHaveURL(`${baseURL}${features[1].path}&${miloLibs}`); + await modal.geoModal.waitFor({ state: 'visible', timeout: 10000 }); + }); + + await test.step('step-2: Verify georouting modal and its content', async () => { + expect(await modal.verifyGeoModal(data)).toBeTruthy(); + }); + + await test.step('step-3: Click "Deutschland" button and then verify international cookie value', async () => { + await modal.deLink.click(); + expect((await page.context().cookies()).find((cookie) => cookie.name === data.cookieName).value).toEqual(data.cookieValue); + }); + }); + + test(`${features[2].name},${features[2].tags}`, async ({ page, baseURL }) => { + test.slow(); + console.info(`[Test Page]: ${baseURL}${features[2].path}${miloLibs}`); + const { data } = features[2]; + + await test.step('step-1: Clear cookies and access "US" page', async () => { + await page.context().clearCookies(); + await page.goto(`${baseURL}${features[2].path}${miloLibs}`); + await page.waitForLoadState('domcontentloaded'); + await expect(page).toHaveURL(`${baseURL}${features[2].path}${miloLibs}`); + }); + + await test.step('step-2: Click "Change region" link from footer and navigate to "Deutschland" page', async () => { + await modal.changeRegionLink.click(); + await modal.changeRegionModal.waitFor({ state: 'visible', timeout: 10000 }); + await modal.deLink.click(); + }); + + await test.step('step-3: Verify international cookie value', async () => { + expect((await page.context().cookies()).find((cookie) => cookie.name === data.cookieName).value).toEqual(data.cookieValue); + }); + }); + + test(`${features[3].name},${features[3].tags}`, async ({ page, baseURL }) => { + test.slow(); + console.info(`[Test Page]: ${baseURL}${features[3].path}&${miloLibs}`); + const { data } = features[3]; + + await test.step('step-1: Clear cookies and access "US" page', async () => { + await page.context().clearCookies(); + await page.goto(`${baseURL}${features[3].path}&${miloLibs}`); + await page.waitForLoadState('domcontentloaded'); + await expect(page).toHaveURL(`${baseURL}${features[3].path}&${miloLibs}`); + await modal.geoModal.waitFor({ state: 'visible', timeout: 10000 }); + }); + + await test.step('step-2: Verify multi tab georouting modal and its content', async () => { + expect(await modal.verifyMultiTabGeoModal(data)).toBeTruthy(); + }); + }); + + test(`${features[4].name},${features[4].tags}`, async ({ page, baseURL }) => { + console.info(`[Test Page]: ${baseURL}${features[4].path}${miloLibs}`); + + await test.step('step-1: Clear cookies and access given "DE" page', async () => { + await page.context().clearCookies(); + await page.goto(`${baseURL}${features[4].path}${miloLibs}`); + await page.waitForLoadState('domcontentloaded'); + await expect(page).toHaveURL(`${baseURL}${features[4].path}${miloLibs}`); + }); + + await test.step('step-2: Verify that georouting modal is not shown', async () => { + await expect(await modal.geoModal).not.toBeVisible(); + }); + }); + + test(`${features[5].name},${features[5].tags}`, async ({ page, browserName, baseURL }) => { + test.skip(browserName === 'webkit', 'This feature is failing on Webkit browsers'); + test.slow(); + console.info(`[Test Page]: ${baseURL}${features[5].path}${miloLibs}`); + const { data } = features[5]; + + await test.step('step-1: Clear cookies and access given "DE" page', async () => { + await page.context().clearCookies(); + await page.goto(`${baseURL}${features[5].path}${miloLibs}`); + await page.waitForLoadState('domcontentloaded'); + await expect(page).toHaveURL(`${baseURL}${features[5].path}${miloLibs}`); + await modal.geoModal.waitFor({ state: 'visible', timeout: 10000 }); + }); + + await test.step('step-2: Close the georouting modal and then check that international cookie is not added', async () => { + await modal.geoModalClose.click(); + expect((await page.context().cookies()).find((cookie) => cookie.name === data.cookieName)).toBeUndefined(); + }); + }); +}); diff --git a/nala/libs/baseurl.js b/nala/libs/baseurl.js new file mode 100644 index 0000000000..3dbc001040 --- /dev/null +++ b/nala/libs/baseurl.js @@ -0,0 +1,17 @@ +/* eslint-disable import/no-extraneous-dependencies, import/prefer-default-export, max-len, no-console */ +import { head } from 'axios'; + +export async function isBranchURLValid(url) { + try { + const response = await head(url); + if (response.status === 200) { + console.info(`\nURL (${url}) returned a 200 status code. It is valid.`); + return true; + } + console.info(`\nURL (${url}) returned a non-200 status code (${response.status}). It is invalid.`); + return false; + } catch (error) { + console.info(`\nError checking URL (${url}): returned a non-200 status code (${error.message})`); + return false; + } +} diff --git a/nala/libs/webutil.js b/nala/libs/webutil.js new file mode 100644 index 0000000000..1fcbe0a732 --- /dev/null +++ b/nala/libs/webutil.js @@ -0,0 +1,329 @@ +/* eslint-disable import/no-extraneous-dependencies, max-len, no-console, class-methods-use-this */ + +import { expect } from '@playwright/test'; + +const { request } = require('@playwright/test'); + +/** + * A utility class for common web interactions. + */ +export default class WebUtil { + /** + * Create a new instance of WebUtil. + * @param {object} page - A Playwright page object. + */ + constructor(page) { + this.page = page; + this.locator = null; + } + + /** + * Check if the element associated with the current locator is visible. + * @param {Locator} locator - The Playwright locator for the element to check. + * + */ + static async isVisible(locator) { + this.locator = locator; + await expect(this.locator).toBeVisible(); + return true; + } + + /** + * Check if the element associated with the current locator is displayed. + * @param {Locator} locator - The Playwright locator for the element to check. + * @returns {Promise} - Resolves to `true` if the element is displayed, or `false`. + */ + static async isDisplayed(locator) { + this.locator = locator; + try { + return await this.locator.evaluate((e) => e.offsetWidth > 0 && e.offsetHeight > 0); + } catch (e) { + console.error(`Error checking if element is displayed for locator: ${locator.toString()}`, e); + return false; + } + } + + /** + * Click the element associated with the current locator. + * @param {Locator} locator - The Playwright locator for the element to click. + * @returns {Promise} A Promise that resolves when the element has been clicked. + */ + static async click(locator) { + this.locator = locator; + return this.locator.click(); + } + + /** + * Get the inner text of the element associated with the current locator. + * @param {Locator} locator - The Playwright locator for the element to retrieve text from. + * @returns {Promise} A Promise that resolves to the inner text of the element. + */ + static async getInnerText(locator) { + this.locator = locator; + const innerText = await this.locator.innerText(); + return innerText; + } + + /** + * Get the text of the element associated with the current locator, filtered by the specified tag name. + * @param {Locator} locator - The Playwright locator for the element to retrieve text from. + * @param {string} tagName - The name of the tag to filter by (e.g. "p", "span", etc.). + * @returns {Promise} A Promise that resolves to the text of the element, filtered by the specified tag name. + */ + static async getTextByTag(locator, tagName) { + this.locator = locator; + return this.locator.$eval(tagName, (e) => e.textContent); + } + + /** + * Get the value of the specified attribute on the element associated with the current locator. + * @param {Locator} locator - The Playwright locator for the element to retrieve the attribute from. + * @param {string} attributeName - The name of the attribute to retrieve (e.g. "class", "data-attr", etc.). + * @returns {Promise} A Promise that resolves to the value of the specified attribute on the element. + */ + static async getAttribute(locator, attributeName) { + this.locator = locator; + return this.locator.getAttribute(attributeName); + } + + /** + * Verifies that the specified CSS properties of the given locator match the expected values. + * @param {Object} locator - The locator to verify CSS properties for. + * @param {Object} cssProps - The CSS properties and expected values to verify. + * @returns {Boolean} - True if all CSS properties match the expected values, false otherwise. + */ + async verifyCSS(locator, cssProps) { + this.locator = locator; + let result = true; + await Promise.allSettled( + Object.entries(cssProps).map(async ([property, expectedValue]) => { + try { + await expect(this.locator).toHaveCSS(property, expectedValue); + } catch (error) { + console.error(`CSS property ${property} not found:`, error); + result = false; + } + }), + ); + return result; + } + + /** + * Verifies that the specified attribute properties of the given locator match the expected values. + * @param {Object} locator - The locator to verify attributes. + * @param {Object} attProps - The attribute properties and expected values to verify. + * @returns {Boolean} - True if all attribute properties match the expected values, false otherwise. + */ + async verifyAttributes(locator, attProps) { + this.locator = locator; + let result = true; + await Promise.allSettled( + Object.entries(attProps).map(async ([property, expectedValue]) => { + if (property === 'class' && typeof expectedValue === 'string') { + // If the property is 'class' and the expected value is an string, + // split the string value into individual classes + const classes = expectedValue.split(' '); + try { + await expect(await this.locator).toHaveClass(classes.join(' ')); + } catch (error) { + console.error('Attribute class not found:', error); + result = false; + } + } else { + try { + await expect(await this.locator).toHaveAttribute(property, expectedValue); + } catch (error) { + console.error(`Attribute ${property} not found:`, error); + result = false; + } + } + }), + ); + return result; + } + + /** + * Slow/fast scroll of entire page JS evaluation method, aides with lazy loaded content. + * This wrapper method calls a scroll script in page.evaluate, i.e. page.evaluate(scroll, { dir: 'direction', spd: 'speed' }); + * @param direction string direction you want to scroll on the page + * @param speed string speed you would like to scroll through the page. Options: slow, fast + */ + async scrollPage(direction, speed) { + const scroll = async (args) => { + const { dir, spd } = args; + // eslint-disable-next-line no-promise-executor-return + const delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms)); + const scrollHeight = () => document.body.scrollHeight; + const start = dir === 'down' ? 0 : scrollHeight(); + const shouldStop = (position) => (dir === 'down' ? position > scrollHeight() : position < 0); + const increment = dir === 'down' ? 100 : -100; + const delayTime = spd === 'slow' ? 30 : 5; + console.error(start, shouldStop(start), increment); + for (let i = start; !shouldStop(i); i += increment) { + window.scrollTo(0, i); + // eslint-disable-next-line no-await-in-loop + await delay(delayTime); + } + }; + + await this.page.evaluate(scroll, { dir: direction, spd: speed }); + } + + /** + * Check if the modal associated with the current locator is within the viewport. + * @param page - calling method page object. + * @returns {Promise} - Resolves to true if the modal is within the viewport, or false. + */ + static async isModalInViewport(page, selector) { + try { + const inViewport = await page.evaluate((sel) => { + const modalDialog = document.querySelector('.dialog-modal'); + if (!modalDialog) { + throw new Error(`Modal element with selector '${sel}' not found.`); + } + const rect = modalDialog.getBoundingClientRect(); + return ( + rect.top >= 0 + && rect.left >= 0 + && rect.bottom + <= (window.innerHeight || document.documentElement.clientHeight) + && rect.right + <= (window.innerWidth || document.documentElement.clientWidth) + ); + }, selector); + + return inViewport; + } catch (error) { + console.error('Error verifying modal veiwport:', error); + return false; + } + } + + /** + * Load test data from remote json file + * @param {string} path + * @param {string} url + */ + static async loadTestDataFromAPI(url, path) { + const context = await request.newContext({ baseURL: url }); + const res = await context.fetch(path); + return res.json(); + } + + /** + * Enable network logging + * @param {Array} networklogs - An array to store all network logs + */ + async enableNetworkLogging(networklogs) { + await this.page.route('**', (route) => { + const url = route.request().url(); + if (url.includes('sstats.adobe.com/ee/or2/v1/interact') + || url.includes('sstats.adobe.com/ee/or2/v1/collect')) { + networklogs.push(url); + const firstEvent = route.request().postDataJSON().events[0]; + // eslint-disable-next-line no-underscore-dangle + if (firstEvent.data._adobe_corpnew.digitalData.primaryEvent) { + // eslint-disable-next-line no-underscore-dangle + networklogs.push(JSON.stringify(firstEvent.data._adobe_corpnew.digitalData.primaryEvent)); + } + + // eslint-disable-next-line no-underscore-dangle + if (firstEvent.data._adobe_corpnew.digitalData.search) { + // eslint-disable-next-line no-underscore-dangle + networklogs.push(JSON.stringify(firstEvent.data._adobe_corpnew.digitalData.search)); + } + } + route.continue(); + }); + } + + /** + * Disable network logging + */ + async disableNetworkLogging() { + await this.page.unroute('**'); + } + + /** + * Generates analytic string for a given project. + * @param {string} project - The project identifier, defaulting to 'milo' if not provided. + * @returns {string} - A string formatted as 'gnav||nopzn|nopzn'. + */ + async getGnavDaalh(project) { + return `gnav|${project}|nopzn|nopzn`; + } + + /** + * Generates analytic string for a given project. + * @param {string} project - The project identifier, defaulting to 'milo' if not provided. + * @param {string} pznExpName - Personalized experience name, which is sliced to its first 15 characters. + * @param {string} pznFileName - Manifest filename, which is sliced to its first 20 characters. + * @returns {string} - A string formatted as 'gnav|||'. + */ + async getPznGnavDaalh(pznExpName, pznFileName, project) { + const slicedExpName = pznExpName.slice(0, 15); + const slicedFileName = pznFileName.slice(0, 15); + return `gnav|${project}|${slicedExpName}|${slicedFileName}`; + } + + /** + * Generates analytic string for a section based on a given counter value. + * @param {number|string} counter - A counter value used to generate the section identifier. + * @returns {string} - A string formatted as 's'. + */ + async getSectionDaalh(counter) { + return `s${counter}`; + } + + /** + * Generates personalization analytic string for a given block name and a counter. + * @param {string} blockName - The name of the block, which is sliced to its first 20 characters. + * @param {number|string} counter - A counter value i.e. block number. + * @param {string} pznExpName - Personalized experience name, which is sliced to its first 15 characters. + * @param {string} pznExpName - Manifest filename, which is sliced to its first 20 characters. + * @returns {string} - A string formatted as 'b|||'. + */ + async getPznBlockDaalh(blockName, counter, pznExpName, pznFileName) { + const slicedBlockName = blockName.slice(0, 20); + const slicedExpName = pznExpName.slice(0, 15); + const slicedFileName = pznFileName.slice(0, 15); + return `b${counter}|${slicedBlockName}|${slicedExpName}|${slicedFileName}`; + } + + /** + * Generates an analytic string for a given block name and a counter. + * @param {string} blockName - The name of the block, which is sliced to its first 20 characters. + * @param {number|string} counter - A counter value, i.e., block number. + * @param {boolean} [pzn=false] - A boolean flag indicating whether to use pzntext. + * @param {string} [pzntext='nopzn'] - The pzntext to use when pzn is true, sliced to its first 15 characters. + * @returns {string} - A formatted string. + */ + async getBlockDaalh(blockName, counter, pzn = false, pzntext = 'nopzn') { + const slicedBlockName = blockName.slice(0, 15); + const slicedPzntext = pzntext.slice(0, 15); + if (pzn) { + return `b${counter}|${slicedBlockName}|${slicedPzntext}|nopzn`; + } + return `b${counter}|${slicedBlockName}`; + } + + /** + * Generates analytic string for link or button based on link/button text , a counter, and the last header text. + * @param {string} linkText - The text of the link, which is cleaned and sliced to its first 20 characters. + * @param {number|string} counter - A counter value used in the identifier. + * @param {string} lastHeaderText - The last header text, which is cleaned and sliced to its first 20 characters. + * @param {boolean} [pzn=false] - boolean parameter, defaulting to false.(for personalization) + * @returns {string} - A string formatted as '---'. + */ + async getLinkDaall(linkText, counter, lastHeaderText) { + const cleanAndSliceText = (text) => text + ?.replace(/[^\w\s]+/g, ' ') + .replace(/\s+/g, ' ') + .replace(/^_+|_+$/g, '') + .trim() + .slice(0, 20); + const slicedLinkText = cleanAndSliceText(linkText); + const slicedLastHeaderText = cleanAndSliceText(lastHeaderText); + return `${slicedLinkText}-${counter}--${slicedLastHeaderText}`; + } +} diff --git a/nala/utils/base-reporter.js b/nala/utils/base-reporter.js new file mode 100644 index 0000000000..86235f6f26 --- /dev/null +++ b/nala/utils/base-reporter.js @@ -0,0 +1,223 @@ +/* eslint-disable max-len, class-methods-use-this, no-empty-function, no-console */ + +const { sendSlackMessage } = require('./slack.js'); + +// Playwright will include ANSI color characters and regex from below +// https://github.com/microsoft/playwright/issues/13522 +// https://github.com/chalk/ansi-regex/blob/main/index.js#L3 + +const pattern = [ + '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)', + '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))', +].join('|'); + +const ansiRegex = new RegExp(pattern, 'g'); + +// limit failed status +const failedStatus = ['failed', 'flaky', 'timedOut', 'interrupted']; + +function stripAnsi(str) { + if (!str || typeof str !== 'string') return str; + return str.replace(ansiRegex, ''); +} + +class BaseReporter { + constructor(options) { + this.options = options; + this.results = []; + this.passedTests = 0; + this.failedTests = 0; + this.skippedTests = 0; + } + + onBegin(config, suite) { + this.config = config; + this.rootSuite = suite; + } + + async onTestEnd(test, result) { + const { title, retries, _projectId } = test; + const { + name, tags, url, browser, env, branch, repo, + } = this.parseTestTitle(title, _projectId); + const { + status, + duration, + error: { message: errorMessage, value: errorValue, stack: errorStack } = {}, + retry, + } = result; + + if (retry < retries && status === 'failed') { + return; + } + this.results.push({ + title, + name, + tags, + url, + env, + browser, + branch, + repo, + status: failedStatus.includes(status) ? 'failed' : status, + errorMessage: stripAnsi(errorMessage), + errorValue, + errorStack: stripAnsi(errorStack), + stdout: test.stdout, + stderr: test.stderr, + duration, + retry, + }); + if (status === 'passed') { + this.passedTests += 1; + } else if (failedStatus.includes(status)) { + this.failedTests += 1; + } else if (status === 'skipped') { + this.skippedTests += 1; + } + } + + async onEnd() { + const summary = this.printResultSummary(); + const resultSummary = { summary }; + + if (process.env.SLACK_WH) { + try { + await sendSlackMessage(process.env.SLACK_WH, resultSummary); + } catch (error) { + console.log('----Failed to publish result to slack channel----'); + } + } + } + + printResultSummary() { + const totalTests = this.results.length; + const passPercentage = ((this.passedTests / totalTests) * 100).toFixed(2); + const failPercentage = ((this.failedTests / totalTests) * 100).toFixed(2); + const miloLibs = process.env.MILO_LIBS || ''; + const prBranchUrl = process.env.PR_BRANCH_LIVE_URL ? (process.env.PR_BRANCH_LIVE_URL + miloLibs) : undefined; + const projectBaseUrl = this.config.projects[0].use.baseURL; + const envURL = prBranchUrl || projectBaseUrl; + + let exeEnv = 'Local Environment'; + let runUrl = 'Local Environment'; + let runName = 'Nala Local Run'; + + if (process.env.GITHUB_ACTIONS === 'true') { + exeEnv = 'GitHub Actions Environment'; + const repo = process.env.GITHUB_REPOSITORY; + const runId = process.env.GITHUB_RUN_ID; + const prNumber = process.env.GITHUB_REF.split('/')[2]; + runUrl = `https://github.com/${repo}/actions/runs/${runId}`; + runName = `${process.env.WORKFLOW_NAME ? (process.env.WORKFLOW_NAME || 'Nala Daily Run') : 'Nala PR Run'} (${prNumber})`; + } else if (process.env.CIRCLECI) { + exeEnv = 'CircleCI Environment'; + const workflowId = process.env.CIRCLE_WORKFLOW_ID; + const jobNumber = process.env.CIRCLE_BUILD_NUM; + runUrl = `https://app.circle.ci.adobe.com/pipelines/github/wcms/nala/${jobNumber}/workflows/${workflowId}/jobs/${jobNumber}`; + runName = 'Nala CircleCI/Stage Run'; + } + + const summary = ` + \x1b[1m\x1b[34m---------Nala Test Run Summary------------\x1b[0m + \x1b[1m\x1b[33m# Total Test executed:\x1b[0m \x1b[32m${totalTests}\x1b[0m + \x1b[1m\x1b[33m# Test Pass :\x1b[0m \x1b[32m${this.passedTests} (${passPercentage}%)\x1b[0m + \x1b[1m\x1b[33m# Test Fail :\x1b[0m \x1b[31m${this.failedTests} (${failPercentage}%)\x1b[0m + \x1b[1m\x1b[33m# Test Skipped :\x1b[0m \x1b[32m${this.skippedTests}\x1b[0m + \x1b[1m\x1b[33m** Application URL :\x1b[0m \x1b[32m${envURL}\x1b[0m + \x1b[1m\x1b[33m** Executed on :\x1b[0m \x1b[32m${exeEnv}\x1b[0m + \x1b[1m\x1b[33m** Execution details:\x1b[0m \x1b[32m${runUrl}\x1b[0m + \x1b[1m\x1b[33m** Workflow name :\x1b[0m \x1b[32m${runName}\x1b[0m`; + + console.log(summary); + + if (this.failedTests > 0) { + console.log('-------- Test Failures --------'); + this.results + .filter((result) => result.status === 'failed') + .forEach((failedTest) => { + console.log(`Test: ${failedTest.title.split('@')[1]}`); + console.log(`Error Message: ${failedTest.errorMessage}`); + console.log(`Error Stack: ${failedTest.errorStack}`); + console.log('-------------------------'); + }); + } + return summary; + } + + /** + This method takes test title and projectId strings and then processes it . + @param {string, string} str - The input string to be processed + @returns {'name', 'tags', 'url', 'browser', 'env', 'branch' and 'repo'} + */ + parseTestTitle(title, projectId) { + let env = 'live'; + let browser = 'chrome'; + let branch; + let repo; + let url; + + const titleParts = title.split('@'); + const name = titleParts[1].trim(); + const tags = titleParts.slice(2).map((tag) => tag.trim()); + + const projectConfig = this.config.projects.find((project) => project.name === projectId); + + // Get baseURL from project config + if (projectConfig?.use?.baseURL) { + ({ baseURL: url, defaultBrowserType: browser } = projectConfig.use); + } else if (this.config.baseURL) { + url = this.config.baseURL; + } + // Get environment from baseURL + if (url.includes('prod')) { + env = 'prod'; + } else if (url.includes('stage')) { + env = 'stage'; + } + // Get branch and repo from baseURL + if (url.includes('localhost')) { + branch = 'local'; + repo = 'local'; + } else { + const urlParts = url.split('/'); + const branchAndRepo = urlParts[urlParts.length - 1]; + [branch, repo] = branchAndRepo.split('--'); + } + + return { + name, tags, url, browser, env, branch, repo, + }; + } + + async persistData() {} + + printPersistingOption() { + if (this.options?.persist) { + console.log( + `Persisting results using ${this.options.persist?.type} to ${this.options.persist?.path}`, + ); + } else { + console.log('Not persisting data'); + } + this.branch = process.env.LOCAL_TEST_LIVE_URL; + } + + getPersistedDataObject() { + const gitBranch = process.env.GITHUB_REF_NAME ?? 'local'; + + // strip out git owner since it can usually be too long to show on the ui + const [, gitRepo] = /[A-Za-z0-9_.-]+\/([A-Za-z0-9_.-]+)/.exec( + process.env.GITHUB_REPOSITORY, + ) ?? [null, 'local']; + + const currTime = new Date(); + return { + gitBranch, + gitRepo, + results: this.results, + timestamp: currTime, + }; + } +} +export default BaseReporter; diff --git a/nala/utils/global.setup.js b/nala/utils/global.setup.js new file mode 100644 index 0000000000..e453973589 --- /dev/null +++ b/nala/utils/global.setup.js @@ -0,0 +1,132 @@ +/* eslint-disable import/no-extraneous-dependencies, no-console */ + +const { execSync } = require('child_process'); +const { isBranchURLValid } = require('../libs/baseurl.js'); + +const MAIN_BRANCH_LIVE_URL = 'https://main--milo--adobecom.hlx.live'; +const STAGE_BRANCH_URL = 'https://milo.stage.adobe.com'; + +async function getGitHubPRBranchLiveUrl() { + // get the pr number + const prReference = process.env.GITHUB_REF; + const prNumber = prReference.split('/')[2]; + + // get the pr branch name + const branch = process.env.GITHUB_HEAD_REF; + const prBranch = branch.replace(/\//g, '-'); + + // get the org and repo + const repository = process.env.GITHUB_REPOSITORY; + const repoParts = repository.split('/'); + const toRepoOrg = repoParts[0]; + const toRepoName = repoParts[1]; + + // Get the org and repo from the environment variables + const prFromOrg = process.env.prOrg; + const prFromRepoName = process.env.prRepo; + + const prBranchLiveUrl = `https://${prBranch}--${prFromRepoName}--${prFromOrg}.hlx.live`; + + try { + if (await isBranchURLValid(prBranchLiveUrl)) { + process.env.PR_BRANCH_LIVE_URL = prBranchLiveUrl; + } + console.info('PR Repository : ', repository); + console.info('PR TO ORG : ', toRepoOrg); + console.info('PR TO REPO : ', toRepoName); + console.info('PR From ORG : ', prFromOrg); + console.info('PR From REPO : ', prFromRepoName); + console.info('PR Branch : ', branch); + console.info('PR Branch(U) : ', prBranch); + console.info('PR Number : ', prNumber); + console.info('PR From Branch live url : ', prBranchLiveUrl); + } catch (err) { + console.error(`Error => Error in setting PR Branch test URL : ${prBranchLiveUrl}`); + console.info(`Note: PR branch test url ${prBranchLiveUrl} is not valid, Exiting test execution.`); + process.exit(1); + } +} + +async function getGitHubMiloLibsBranchLiveUrl() { + const repository = process.env.GITHUB_REPOSITORY; + const prBranchLiveUrl = process.env.PR_BRANCH_MILOLIBS_LIVE_URL; + const miloLibs = process.env.MILO_LIBS; + + try { + if (await isBranchURLValid(prBranchLiveUrl)) { + process.env.PR_BRANCH_LIVE_URL = prBranchLiveUrl; + } + console.info('PR Repository : ', repository); + console.info('PR Branch live url : ', prBranchLiveUrl); + console.info('Milo Libs : ', miloLibs); + } catch (err) { + console.error(`Error => Error in setting PR Branch test URL : ${prBranchLiveUrl}`); + console.info(`Note: PR branch test url ${prBranchLiveUrl} is not valid, Exiting test execution.`); + process.exit(1); + } +} + +async function getCircleCIBranchLiveUrl() { + const stageBranchLiveUrl = STAGE_BRANCH_URL; + + try { + if (await isBranchURLValid(stageBranchLiveUrl)) { + process.env.PR_BRANCH_LIVE_URL = stageBranchLiveUrl; + } + console.info('Stage Branch Live URL : ', stageBranchLiveUrl); + } catch (err) { + console.error('Error => Error in setting Stage Branch test URL : ', stageBranchLiveUrl); + console.info('Note: Stage branch test url is not valid, Exiting test execution.'); + process.exit(1); + } +} + +async function getLocalBranchLiveUrl() { + let localTestLiveUrl; + try { + const localGitRootDir = execSync('git rev-parse --show-toplevel', { encoding: 'utf-8' }).trim(); + + if (localGitRootDir) { + const gitRemoteOriginUrl = execSync('git config --get remote.origin.url', { cwd: localGitRootDir, encoding: 'utf-8' }).trim(); + const match = gitRemoteOriginUrl.match(/github\.com\/(.*?)\/(.*?)\.git/); + + if (match) { + const [localOrg, localRepo] = match.slice(1, 3); + const localBranch = execSync('git rev-parse --abbrev-ref HEAD', { cwd: localGitRootDir, encoding: 'utf-8' }).trim(); + localTestLiveUrl = process.env.LOCAL_TEST_LIVE_URL || MAIN_BRANCH_LIVE_URL; + if (await isBranchURLValid(localTestLiveUrl)) { + console.info('Git ORG : ', localOrg); + console.info('Git REPO : ', localRepo); + console.info('Local Branch : ', localBranch); + console.info('Local Test Live URL : ', localTestLiveUrl); + } + } + } + } catch (error) { + console.error(`Error => Error in setting local test URL : ${localTestLiveUrl}\n`); + console.info('Note: Local or branch test url is not valid, Exiting test execution.\n'); + process.exit(1); + } +} + +async function globalSetup() { + console.info('---- Executing Nala Global setup ----\n'); + + if (process.env.GITHUB_ACTIONS === 'true') { + console.info('---- Running Nala Tests in the GitHub environment ----\n'); + + if (process.env.MILO_LIBS_RUN === 'true') { + await getGitHubMiloLibsBranchLiveUrl(); + } else { + await getGitHubPRBranchLiveUrl(); + } + } else if (process.env.CIRCLECI) { + console.info('---- Running Nala Tests in the CircleCI environment ----\n'); + await getCircleCIBranchLiveUrl(); + } else { + console.info('---- Running Nala Tests in the Local environment ----\n'); + await getLocalBranchLiveUrl(); + } +} + +export default globalSetup; diff --git a/nala/utils/nala.run.js b/nala/utils/nala.run.js new file mode 100644 index 0000000000..11d1354006 --- /dev/null +++ b/nala/utils/nala.run.js @@ -0,0 +1,181 @@ +#!/usr/bin/env node + +/* eslint-disable no-console */ + +const { spawn } = require('child_process'); + +function displayHelp() { + console.log(` + +\x1b[1m\x1b[37m## Nala command:\x1b[0m \x1b[1m\x1b[32mnpm run nala [env] [options]\x1b[0m + +\x1b[1m1] Env:\x1b[0m [\x1b[32mlocal\x1b[0m | \x1b[32mlibs\x1b[0m | \x1b[32mbranch\x1b[0m | \x1b[32mstage\x1b[0m | \x1b[32metc\x1b[0m ] \x1b[3mdefault: local\x1b[0m + +\x1b[1m2] Options:\x1b[0m + + \x1b[33m* browser=\x1b[0m Browser to use (default: chrome) + \x1b[33m* device=\x1b[0m Device (default: desktop) + \x1b[33m* test=<.test.js>\x1b[0m Test file to run (default: all tests) + \x1b[33m* tag=<@tag>\x1b[0m Tags to filter tests by annotations ex: @test1 @accordion @marquee + \x1b[33m* -g, --g=<@tag>\x1b[0m Tags to filter tests by annotations ex: @test1 @accordion @marquee + \x1b[33m* mode=\x1b[0m Mode (default: headless) + \x1b[33m* config=\x1b[0m Configuration file (default: Playwright default) + \x1b[33m* project=\x1b[0m Project configuration (default: milo-live-chromium) + \x1b[33m* milolibs=\x1b[0m Milo library environment (default: none) + +\x1b[1mExamples:\x1b[0m + | \x1b[36mCommand\x1b[0m | \x1b[36mDescription\x1b[0m | + |--------------------------------------------------------|------------------------------------------------------------------------------------| + | npm run nala local | Runs all nala tests on local environment on chrome browser | + | npm run nala local accordion.test.js | Runs only accordion tests on local environment on chrome browser | + | npm run nala local @accordion | Runs only accordion annotated/tagged tests on local environment on chrome browser | + | npm run nala local @accordion browser=firefox | Runs only accordion annotated/tagged tests on local environment on firefox browser | + | npm run nala local mode=ui | Runs all nala tests on local environment in UI mode on chrome browser | + | npm run nala local tags=@tag1,@tag2 | Runs tests annotated with @tag1 and @tag2 on local environment on chrome browser | + +\x1b[1mDebugging:\x1b[0m +----------- + | \x1b[36mCommand\x1b[0m | \x1b[36mDescription\x1b[0m | + |--------------------------------------------------------|------------------------------------------------------------------------------------| + | npm run nala local @test1 mode=debug | Runs @test1 on local environment in debug mode | + +`); +} + +function parseArgs(args) { + const defaultParams = { + env: 'local', + browser: 'chromium', + device: 'desktop', + test: '', + tag: '', + mode: 'headless', + config: '', + project: '', + milolibs: '', + }; + + const parsedParams = { ...defaultParams }; + + args.forEach((arg) => { + if (arg.includes('=')) { + const [key, value] = arg.split('='); + parsedParams[key] = value; + } else if (arg.startsWith('-g') || arg.startsWith('--g')) { + const value = arg.includes('=') ? arg.split('=')[1] : args[args.indexOf(arg) + 1]; + parsedParams.tag = value; + } else if (arg.startsWith('@')) { + parsedParams.tag += parsedParams.tag ? ` ${arg.substring(1)}` : arg.substring(1); + } else if (arg.endsWith('.test.js')) { + parsedParams.test = arg; + } else if (arg.endsWith('.config.js')) { + parsedParams.config = arg; + } else if (['ui', 'debug', 'headless', 'headed'].includes(arg)) { + parsedParams.mode = arg; + } else { + parsedParams.env = arg; + } + }); + + // Set the project if not provided + if (!parsedParams.project) { + parsedParams.project = `milo-live-${parsedParams.browser}`; + } + + return parsedParams; +} + +function getLocalTestLiveUrl(env, milolibs) { + if (milolibs) { + process.env.MILO_LIBS = `?milolibs=${milolibs}`; + if (env === 'local') { + return 'http://127.0.0.1:3000'; + } if (env === 'libs') { + return 'http://127.0.0.1:6456'; + } + return `https://${env}--milo--adobecom.hlx.live`; + } + if (env === 'local') { + return 'http://127.0.0.1:3000'; + } if (env === 'libs') { + return 'http://127.0.0.1:6456'; + } + return `https://${env}--milo--adobecom.hlx.live`; +} + +function buildPlaywrightCommand(parsedParams, localTestLiveUrl) { + const { + browser, device, test, tag, mode, config, project, + } = parsedParams; + + const envVariables = { + ...process.env, + BROWSER: browser, + DEVICE: device, + HEADLESS: mode === 'headless' || mode === 'headed' ? 'true' : 'false', + LOCAL_TEST_LIVE_URL: localTestLiveUrl, + }; + + const command = 'npx playwright test'; + const options = []; + + if (test) { + options.push(test); + } + + options.push(`--project=${project}`); + options.push('--grep-invert nopr'); + + if (tag) { + options.push(`-g "${tag.replace(/,/g, ' ')}"`); + } + + if (mode === 'ui' || mode === 'headed') { + options.push('--headed'); + } else if (mode === 'debug') { + options.push('--debug'); + } + + if (config) { + options.push(`--config=${config}`); + } + + return { finalCommand: `${command} ${options.join(' ')}`, envVariables }; +} + +function runNalaTest() { + const args = process.argv.slice(2); + + if (args.length === 0 || args.includes('help')) { + displayHelp(); + process.exit(0); + } + + const parsedParams = parseArgs(args); + const localTestLiveUrl = getLocalTestLiveUrl(parsedParams.env, parsedParams.milolibs); + const { finalCommand, envVariables } = buildPlaywrightCommand(parsedParams, localTestLiveUrl); + + console.log(`\n Executing nala run command: ${finalCommand}`); + console.log(`\n Using URL: ${localTestLiveUrl}\n`); + console.log(`\n\x1b[1m\x1b[33mExecuting nala run command:\x1b[0m \x1b[32m${finalCommand}\x1b[0m\n\x1b[1m\x1b[33mUsing URL:\x1b[0m \x1b[32m${localTestLiveUrl}\x1b[0m\n`); + + const testProcess = spawn(finalCommand, { stdio: 'inherit', shell: true, env: envVariables }); + + testProcess.on('close', (code) => { + // eslint-disable-next-line no-console + console.log(`Nala tests exited with code ${code}`); + process.exit(code); + }); +} + +if (require.main === module) { + runNalaTest(); +} + +module.exports = { + displayHelp, + parseArgs, + getLocalTestLiveUrl, + buildPlaywrightCommand, + runNalaTest, +}; diff --git a/nala/utils/slack.js b/nala/utils/slack.js new file mode 100644 index 0000000000..f6283f6272 --- /dev/null +++ b/nala/utils/slack.js @@ -0,0 +1,21 @@ +/* eslint-disable import/no-extraneous-dependencies, no-console */ + +import axios from 'axios'; + +/** + * Sends a message to Slack using a webhook URL. + * @param {string} webhookUrl - The Slack channel webhook. + * @param {Object} messageContent - The content of the message to send. + */ +export default async function sendSlackMessage(webhookUrl, messageContent) { + try { + const response = await axios.post(webhookUrl, messageContent, { headers: { 'Content-Type': 'application/json' } }); + + if (response.status !== 200) { + throw new Error(`Error sending message to Slack. Status: ${response.status}. Message: ${response.data}`); + } + console.log('---Result summary is sent to slack---'); + } catch (error) { + console.error('Axios error:', error); + } +} diff --git a/package-lock.json b/package-lock.json index ddfc83e018..af5cc902a8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,10 +18,12 @@ "@babel/eslint-parser": "7.17.0", "@esm-bundle/chai": "4.3.4-fix.0", "@octokit/rest": "^20.0.2", + "@playwright/test": "^1.46.1", "@web/dev-server-import-maps": "^0.2.1", "@web/test-runner": "^0.18.2", "@web/test-runner-commands": "^0.9.0", "@web/test-runner-playwright": "^0.11.0", + "axios": "^1.7.5", "chai": "^5.1.1", "eslint": "8.11.0", "eslint-config-airbnb-base": "15.0.0", @@ -2293,6 +2295,21 @@ "@octokit/openapi-types": "^22.2.0" } }, + "node_modules/@playwright/test": { + "version": "1.46.1", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.46.1.tgz", + "integrity": "sha512-Fq6SwLujA/DOIvNC2EL/SojJnkKf/rAwJ//APpJJHRyMi1PdKrY3Az+4XNQ51N4RTbItbIByQ0jgd1tayq1aeA==", + "dev": true, + "dependencies": { + "playwright": "1.46.1" + }, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=18" + } + }, "node_modules/@preact/signals": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/@preact/signals/-/signals-1.0.4.tgz", @@ -3523,6 +3540,12 @@ "tslib": "^2.4.0" } }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "dev": true + }, "node_modules/asyncro": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/asyncro/-/asyncro-3.0.0.tgz", @@ -3581,6 +3604,17 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/axios": { + "version": "1.7.5", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.5.tgz", + "integrity": "sha512-fZu86yCo+svH3uqJ/yTdQ0QHpQu5oL+/QE+QPSv6BZSkDAoky9vytxp7u5qk83OJFS3kEBcesWni9WTZAv3tSw==", + "dev": true, + "dependencies": { + "follow-redirects": "^1.15.6", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, "node_modules/b4a": { "version": "1.6.6", "resolved": "https://registry.npmjs.org/b4a/-/b4a-1.6.6.tgz", @@ -4375,6 +4409,18 @@ "integrity": "sha512-jeC1axXpnb0/2nn/Y1LPuLdgXBLH7aDcHu4KEKfqw3CUhX7ZpfBSlPKyqXE6btIgEzfWtrX3/tyBCaCvXvMkOw==", "dev": true }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/command-line-args": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/command-line-args/-/command-line-args-5.2.1.tgz", @@ -4959,6 +5005,15 @@ "node": ">= 14" } }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/delegates": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", @@ -6513,6 +6568,26 @@ "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==", "dev": true }, + "node_modules/follow-redirects": { + "version": "1.15.6", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz", + "integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, "node_modules/for-each": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", @@ -6522,6 +6597,20 @@ "is-callable": "^1.1.3" } }, + "node_modules/form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "dev": true, + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/fraction.js": { "version": "4.3.7", "resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-4.3.7.tgz", @@ -9937,12 +10026,12 @@ } }, "node_modules/playwright": { - "version": "1.45.2", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.45.2.tgz", - "integrity": "sha512-ReywF2t/0teRvNBpfIgh5e4wnrI/8Su8ssdo5XsQKpjxJj+jspm00jSoz9BTg91TT0c9HRjXO7LBNVrgYj9X0g==", + "version": "1.46.1", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.46.1.tgz", + "integrity": "sha512-oPcr1yqoXLCkgKtD5eNUPLiN40rYEM39odNpIb6VE6S7/15gJmA1NzVv6zJYusV0e7tzvkU/utBFNa/Kpxmwng==", "dev": true, "dependencies": { - "playwright-core": "1.45.2" + "playwright-core": "1.46.1" }, "bin": { "playwright": "cli.js" @@ -9955,9 +10044,9 @@ } }, "node_modules/playwright-core": { - "version": "1.45.2", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.45.2.tgz", - "integrity": "sha512-ha175tAWb0dTK0X4orvBIqi3jGEt701SMxMhyujxNrgd8K0Uy5wMSwwcQHtyB4om7INUkfndx02XnQ2p6dvLDw==", + "version": "1.46.1", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.46.1.tgz", + "integrity": "sha512-h9LqIQaAv+CYvWzsZ+h3RsrqCStkBHlgo6/TJlFst3cOTlLghBQlJwPOZKQJTKNaD3QIB7aAVQ+gfWbN3NXB7A==", "dev": true, "bin": { "playwright-core": "cli.js" diff --git a/package.json b/package.json index cb1a4d78d5..d780674eed 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,7 @@ "test:watch": "npx playwright install && npm test -- --watch", "test:file": "npx playwright install && wtr --config ./web-test-runner.config.mjs --node-resolve --port=2000 --coverage", "test:file:watch": "npx playwright install && wtr --config ./web-test-runner.config.mjs --node-resolve --port=2000 --coverage --watch", + "nala": "node nala/utils/nala.run.js", "libs": "aem up --port=6456", "lint": "npm run lint:js && npm run lint:css", "lint:js": "eslint .", @@ -37,10 +38,12 @@ "@babel/eslint-parser": "7.17.0", "@esm-bundle/chai": "4.3.4-fix.0", "@octokit/rest": "^20.0.2", + "@playwright/test": "^1.46.1", "@web/dev-server-import-maps": "^0.2.1", "@web/test-runner": "^0.18.2", "@web/test-runner-commands": "^0.9.0", "@web/test-runner-playwright": "^0.11.0", + "axios": "^1.7.5", "chai": "^5.1.1", "eslint": "8.11.0", "eslint-config-airbnb-base": "15.0.0", diff --git a/playwright.config.js b/playwright.config.js new file mode 100644 index 0000000000..e07668f1c0 --- /dev/null +++ b/playwright.config.js @@ -0,0 +1,71 @@ +/* eslint-disable import/no-extraneous-dependencies */ + +const { devices } = require('@playwright/test'); + +/** + * @see https://playwright.dev/docs/test-configuration + * @type {import('@playwright/test').PlaywrightTestConfig} + */ +const config = { + testDir: './nala', + outputDir: './test-results', + globalSetup: './nala/utils/global.setup.js', + /* Maximum time one test can run for. */ + timeout: 30 * 1000, + expect: { + /** + * Maximum time expect() should wait for the condition to be met. + * For example in `await expect(locator).toHaveText();` + */ + timeout: 5000, + }, + testMatch: '**/*.test.js', + /* Run tests in files in parallel */ + fullyParallel: true, + /* Fail the build on CI if you accidentally left test.only in the source code. */ + forbidOnly: !!process.env.CI, + /* Retry on CI only */ + retries: process.env.CI ? 1 : 0, + /* Opt out of parallel tests on CI. */ + workers: process.env.CI ? 4 : 3, + /* Reporter to use. */ + reporter: process.env.CI + ? [['github'], ['list'], ['./nala/utils/base-reporter.js']] + : [['html', { outputFolder: 'test-html-results' }], ['list'], ['./nala/utils/base-reporter.js']], + /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ + use: { + /* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */ + actionTimeout: 60000, + + trace: 'on-first-retry', + baseURL: process.env.PR_BRANCH_LIVE_URL || (process.env.LOCAL_TEST_LIVE_URL || 'https://main--milo--adobecom.hlx.live'), + }, + + /* Configure projects for major browsers */ + projects: [ + { + name: 'milo-live-chromium', + use: { ...devices['Desktop Chrome'] }, + }, + + { + name: 'milo-live-firefox', + use: { ...devices['Desktop Firefox'] }, + }, + { + name: 'milo-live-webkit', + use: { ...devices['Desktop Safari'] }, + }, + /* Test Against Mobile View ports */ + { + name: 'mobile-chrome-pixel5', + use: { ...devices['Pixel 5'] }, + }, + { + name: 'mobile-safari-iPhone12', + use: { ...devices['iPhone 12'] }, + }, + ], +}; + +module.exports = config; From fc587078863a8b8a0bb92c6536fc4fe66958cced Mon Sep 17 00:00:00 2001 From: Sean Choi Date: Mon, 2 Sep 2024 17:18:32 +0900 Subject: [PATCH 14/21] [MWPW-157556] Eagerly import lit from merch-card block (#2809) Eagerly import lit from merch-card block --- libs/blocks/merch-card/merch-card.js | 1 + 1 file changed, 1 insertion(+) diff --git a/libs/blocks/merch-card/merch-card.js b/libs/blocks/merch-card/merch-card.js index e7bf71ca32..2517abfb17 100644 --- a/libs/blocks/merch-card/merch-card.js +++ b/libs/blocks/merch-card/merch-card.js @@ -3,6 +3,7 @@ import { getConfig, createTag, loadStyle } from '../../utils/utils.js'; import { getMetadata } from '../section-metadata/section-metadata.js'; import { processTrackingLabels } from '../../martech/attributes.js'; import '../../deps/mas/merch-card.js'; +import '../../deps/lit-all.min.js'; const TAG_PATTERN = /^[a-zA-Z0-9_-]+:[a-zA-Z0-9_-]+\/[a-zA-Z0-9_-].*$/; From 582c244cd194a660859a71a25f379e5dcf35b6ab Mon Sep 17 00:00:00 2001 From: Brandon Marshall Date: Mon, 2 Sep 2024 01:21:12 -0700 Subject: [PATCH 15/21] MWPW-157005 Marketo thank you fixes (#2779) * MWPW-157005 Marketo thank you fixes * PR Changes --- libs/blocks/marketo/marketo.css | 37 ++++++++++++++++------ libs/blocks/marketo/marketo.js | 21 ++++++++++-- test/blocks/marketo/marketo.test.html | 6 +++- test/blocks/marketo/mocks/marketo-utils.js | 4 +++ 4 files changed, 55 insertions(+), 13 deletions(-) diff --git a/libs/blocks/marketo/marketo.css b/libs/blocks/marketo/marketo.css index 5d468a288f..130a6848c7 100644 --- a/libs/blocks/marketo/marketo.css +++ b/libs/blocks/marketo/marketo.css @@ -4,18 +4,25 @@ --marketo-form-border: #6E6E6E; --marketo-form-error: #D7373F; --marketo-form-selected: #0265DC; + --marketo-form-placeholder-height: calc(78px * 3 + 57px); /* 3 rows + submit */ + --marketo-form-min-height: 215px; + --marketo-form-max-height: 10000px; } /* stylelint-disable selector-class-pattern */ .marketo .marketo-form-wrapper { box-sizing: border-box; max-width: 600px; - min-height: 400px; + min-height: var(--marketo-form-min-height); margin: 0 auto; padding: var(--spacing-l) 30px; background-color: var(--marketo-form-background); } +.marketo.loading form { + min-height: var(--marketo-form-placeholder-height); +} + .marketo .marketo-title { font-size: 28px; font-weight: bold; @@ -29,25 +36,37 @@ } .marketo .mktoForm { + display: flex; + flex-flow: row wrap; + justify-content: space-between; + column-gap: 4.6%; + align-items: flex-start; + max-height: var(--marketo-form-placeholder-height); + overflow: hidden; font-size: 16px; font-weight: bold; width: 100%!important; + visibility: hidden; + opacity: 0; } -.marketo form.mktoForm--fade-in { +.marketo.success .marketo-title, +.marketo.success .marketo-description, +.marketo.success form.mktoVisible.mktoForm { + display: none; +} + +.marketo form.mktoForm.mktoForm--fade-in { + transition: opacity 0.5s ease-in, max-height 0.5s ease-in; visibility: hidden; opacity: 0; } -.marketo form.mktoForm--fade-in.mktoVisible { - display: flex; - flex-flow: row wrap; - justify-content: space-between; - column-gap: 4.6%; - align-items: flex-start; +.marketo form.mktoForm.mktoForm--fade-in.mktoVisible { + max-height: var(--marketo-form-max-height); + overflow: visible; visibility: visible; opacity: 1; - transition: opacity 1s ease-in, height 1s ease-in; } .marketo .mktoFormRow.mktoFormRowTop.comments, diff --git a/libs/blocks/marketo/marketo.js b/libs/blocks/marketo/marketo.js index 1602d0694a..d558cfcdba 100644 --- a/libs/blocks/marketo/marketo.js +++ b/libs/blocks/marketo/marketo.js @@ -13,9 +13,16 @@ /* * Marketo Form */ -import { parseEncodedConfig, loadScript, localizeLink, createTag, createIntersectionObserver } from '../../utils/utils.js'; - -const ROOT_MARGIN = 1000; +import { + parseEncodedConfig, + loadScript, + loadLink, + localizeLink, + createTag, + createIntersectionObserver, +} from '../../utils/utils.js'; + +const ROOT_MARGIN = 50; const FORM_ID = 'form id'; const BASE_URL = 'marketo host'; const MUNCHKIN_ID = 'marketo munckin'; @@ -61,6 +68,7 @@ export const decorateURL = (destination, baseURL = window.location) => { return destinationUrl.href; } catch (e) { + /* c8 ignore next 4 */ window.lana?.log(`Error with Marketo destination URL: ${destination} ${e.message}`); } @@ -84,9 +92,11 @@ export const setPreferences = (formData) => { }; export const formSuccess = (formEl, formData) => { + const el = formEl.closest('.marketo'); const parentModal = formEl?.closest('.dialog-modal'); const mktoSubmit = new Event('mktoSubmit'); + el.classList.add('success'); window.dispatchEvent(mktoSubmit); window.mktoSubmitted = true; @@ -115,7 +125,9 @@ export const formSuccess = (formEl, formData) => { const readyForm = (form, formData) => { const formEl = form.getFormElem().get(0); + const el = formEl.closest('.marketo'); const isDesktop = matchMedia('(min-width: 900px)'); + el.classList.remove('loading'); formEl.addEventListener('focus', ({ target }) => { /* c8 ignore next 9 */ @@ -216,6 +228,9 @@ export default function init(el) { fragment.append(formWrapper); el.replaceChildren(fragment); + el.classList.add('loading'); + + loadLink(`https://${baseURL}`, { rel: 'dns-prefetch' }); createIntersectionObserver({ el, diff --git a/test/blocks/marketo/marketo.test.html b/test/blocks/marketo/marketo.test.html index 862ee6f6e1..20556d343a 100644 --- a/test/blocks/marketo/marketo.test.html +++ b/test/blocks/marketo/marketo.test.html @@ -65,7 +65,7 @@

Fill out the form to view the repo import { expect } from '@esm-bundle/chai'; import { stub } from 'sinon'; import { waitForElement } from '../../helpers/waitfor.js'; - import { loadScript, parseEncodedConfig } from '../../../libs/utils/utils.js'; + import { loadScript, loadLink, parseEncodedConfig } from '../../../libs/utils/utils.js'; import init, { setPreferences, formValidate, formSuccess } from '../../../libs/blocks/marketo/marketo.js'; runTests(() => { @@ -86,6 +86,10 @@

Fill out the form to view the repo expect(desc).to.exist; }); + it('preload Marketo', async () => { + expect(loadLink.calledOnce).to.be.true; + }); + it('loads Marketo script', async () => { expect(loadScript.calledOnce).to.be.true; expect(loadScript.calledWith('https://engage.adobe.com/js/forms2/js/forms2.min.js')).to.be.true; diff --git a/test/blocks/marketo/mocks/marketo-utils.js b/test/blocks/marketo/mocks/marketo-utils.js index 0c98787010..9cf1cf9f9a 100644 --- a/test/blocks/marketo/mocks/marketo-utils.js +++ b/test/blocks/marketo/mocks/marketo-utils.js @@ -63,3 +63,7 @@ export function createIntersectionObserver({ el, callback /* , once = true, opti } export const localizeLink = (href) => href; + +export const loadLink = stub().returns(new Promise((resolve) => { + resolve(); +})); From 3331e1170c529e0d6973337556d3038492e643c3 Mon Sep 17 00:00:00 2001 From: Rares Munteanu Date: Mon, 2 Sep 2024 10:22:15 +0200 Subject: [PATCH 16/21] [MWPW-148140] Adjust table strikethrough pricing (#2786) --- libs/blocks/table/table.css | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libs/blocks/table/table.css b/libs/blocks/table/table.css index 87836b1ae9..5087a46867 100644 --- a/libs/blocks/table/table.css +++ b/libs/blocks/table/table.css @@ -247,6 +247,11 @@ padding: var(--spacing-xxs) 0; } +.table .row-heading .col-heading .pricing .price-strikethrough { + display: inline-block; + font-size: var(--type-body-s-size); +} + /* section */ .table .divider { display: none; From 3ad052c4874a04d2730eb317fd0113673bd51444 Mon Sep 17 00:00:00 2001 From: Okan Sahin <39759830+mokimo@users.noreply.github.com> Date: Mon, 2 Sep 2024 14:19:43 +0200 Subject: [PATCH 17/21] Parallelize Placeholder loading for an LCP improvement (#2752) mwpw-156840: parallelize loading placeholders --- libs/blocks/chart/chart.js | 3 +- libs/blocks/fragment/fragment.js | 3 +- libs/features/placeholders.js | 65 ++++++++++++++-------- libs/utils/helpers.js | 9 --- libs/utils/utils.js | 42 +++++++++----- test/blocks/caas/mocks/utils.js | 2 + test/blocks/instagram/mocks/embed-utils.js | 2 + test/blocks/marketo/mocks/marketo-utils.js | 2 + test/blocks/merch/mocks/embed-utils.js | 2 + test/blocks/ost/mocks/ost-utils.js | 14 ++++- test/blocks/slideshare/mocks/utils.js | 2 +- test/utils/helpers.test.js | 19 ------- test/utils/utils.test.js | 9 ++- 13 files changed, 100 insertions(+), 74 deletions(-) delete mode 100644 test/utils/helpers.test.js diff --git a/libs/blocks/chart/chart.js b/libs/blocks/chart/chart.js index c2a5a23be5..295e9b52a6 100644 --- a/libs/blocks/chart/chart.js +++ b/libs/blocks/chart/chart.js @@ -1,4 +1,4 @@ -import { loadScript, getConfig, createTag } from '../../utils/utils.js'; +import { loadScript, getConfig, createTag, customFetch } from '../../utils/utils.js'; import { throttle, parseValue, @@ -122,7 +122,6 @@ export function processMarkData(series, xUnit) { } export async function fetchData(link) { - const { customFetch } = await import('../../utils/helpers.js'); const resp = await customFetch({ resource: link.href.toLowerCase(), withCacheRules: true }) .catch(() => ({})); diff --git a/libs/blocks/fragment/fragment.js b/libs/blocks/fragment/fragment.js index 84a922d6f5..7e740c50c3 100644 --- a/libs/blocks/fragment/fragment.js +++ b/libs/blocks/fragment/fragment.js @@ -1,5 +1,5 @@ /* eslint-disable max-classes-per-file */ -import { createTag, getConfig, loadArea, localizeLink } from '../../utils/utils.js'; +import { createTag, getConfig, loadArea, localizeLink, customFetch } from '../../utils/utils.js'; const fragMap = {}; @@ -83,7 +83,6 @@ export default async function init(a) { return; } - const { customFetch } = await import('../../utils/helpers.js'); let resourcePath = a.href; if (a.href.includes('/federal/')) { const { getFederatedUrl } = await import('../../utils/federated.js'); diff --git a/libs/features/placeholders.js b/libs/features/placeholders.js index c782e046a9..5898fef5c0 100644 --- a/libs/features/placeholders.js +++ b/libs/features/placeholders.js @@ -1,3 +1,5 @@ +import { customFetch, getConfig } from '../utils/utils.js'; + const fetchedPlaceholders = {}; window.mph = {}; @@ -7,26 +9,23 @@ const getPlaceholdersPath = (config, sheet) => { return `${path}${query}`; }; -const fetchPlaceholders = async (config, sheet) => { - const placeholdersPath = getPlaceholdersPath(config, sheet); - const { customFetch } = await import('../utils/helpers.js'); - - fetchedPlaceholders[placeholdersPath] = fetchedPlaceholders[placeholdersPath] - // eslint-disable-next-line no-async-promise-executor - || new Promise(async (resolve) => { - const resp = await customFetch({ resource: placeholdersPath, withCacheRules: true }) - .catch(() => ({})); - const json = resp.ok ? await resp.json() : { data: [] }; - if (json.data.length === 0) { resolve({}); return; } - const placeholders = {}; - json.data.forEach((item) => { - placeholders[item.key] = item.value; - window.mph[item.key] = item.value; - }); - resolve(placeholders); +const fetchPlaceholders = async ({ config, sheet, placeholderRequest, placeholderPath }) => { + const path = placeholderPath || getPlaceholdersPath(config, sheet); + // eslint-disable-next-line no-async-promise-executor + fetchedPlaceholders[path] = fetchedPlaceholders[path] || new Promise(async (resolve) => { + const resp = await placeholderRequest || await customFetch( + { resource: path, withCacheRules: true }, + ).catch(() => ({})); + const json = resp.ok ? await resp.json() : { data: [] }; + if (json.data.length === 0) { resolve({}); return; } + const placeholders = {}; + json.data.forEach((item) => { + window.mph[item.key] = item.value; + placeholders[item.key] = item.value; }); - - return fetchedPlaceholders[placeholdersPath]; + resolve(placeholders); + }); + return fetchedPlaceholders[path]; }; function keyToStr(key) { @@ -60,7 +59,7 @@ async function getPlaceholder(key, config, sheet) { }, }; - const defaultPlaceholders = await fetchPlaceholders(defaultConfig, sheet) + const defaultPlaceholders = await fetchPlaceholders({ config: defaultConfig, sheet }) .catch(() => ({})); defaultFetched = true; return defaultPlaceholders; @@ -68,7 +67,7 @@ async function getPlaceholder(key, config, sheet) { if (config.placeholders?.[key]) return config.placeholders[key]; - const placeholders = await fetchPlaceholders(config, sheet).catch(async () => { + const placeholders = await fetchPlaceholders({ config, sheet }).catch(async () => { const defaultPlaceholders = await getDefaultPlaceholders(); return defaultPlaceholders; }); @@ -102,14 +101,19 @@ export async function replaceKeyArray(keys, config, sheet = 'default') { return placeholders; } -export async function replaceText(text, config, regex = /{{(.*?)}}|%7B%7B(.*?)%7D%7D/g, sheet = 'default') { +export async function replaceText( + text, + config, + regex = /{{(.*?)}}|%7B%7B(.*?)%7D%7D/g, + sheet = 'default', +) { if (typeof text !== 'string' || !text.length) return ''; const matches = [...text.matchAll(new RegExp(regex))]; if (!matches.length) { return text; } - const keys = Array.from(matches, (match) => (match[1] || match[2])); + const keys = Array.from(matches, (match) => match[1] || match[2]); const placeholders = await replaceKeyArray(keys, config, sheet); // The .shift method is very slow, thus using normal iterator let i = 0; @@ -117,3 +121,18 @@ export async function replaceText(text, config, regex = /{{(.*?)}}|%7B%7B(.*?)%7 const finalText = text.replaceAll(regex, () => placeholders[i++]); return finalText; } + +export async function decoratePlaceholderArea({ + placeholderPath, + placeholderRequest, + nodes, +}) { + if (!nodes.length) return; + const config = getConfig(); + await fetchPlaceholders({ placeholderPath, config, placeholderRequest }); + const replaceNodes = nodes.map(async (textNode) => { + textNode.nodeValue = await replaceText(textNode.nodeValue, config); + textNode.nodeValue = textNode.nodeValue.replace(/ /g, '\u00A0'); + }); + await Promise.all(replaceNodes); +} diff --git a/libs/utils/helpers.js b/libs/utils/helpers.js index 7e6fc5ad62..73274a4988 100644 --- a/libs/utils/helpers.js +++ b/libs/utils/helpers.js @@ -19,12 +19,3 @@ export function updateLinkWithLangRoot(link) { return link; } } - -export async function customFetch({ resource, withCacheRules }) { - const options = {}; - if (withCacheRules) { - const params = new URLSearchParams(window.location.search); - options.cache = params.get('cache') === 'off' ? 'reload' : 'default'; - } - return fetch(resource, options); -} diff --git a/libs/utils/utils.js b/libs/utils/utils.js index 6931da2a23..ede1d199c0 100644 --- a/libs/utils/utils.js +++ b/libs/utils/utils.js @@ -727,15 +727,25 @@ async function decorateIcons(area, config) { await loadIcons(icons, config); } -async function decoratePlaceholders(area, config) { - const el = area.querySelector('main') || area; +export async function customFetch({ resource, withCacheRules }) { + const options = {}; + if (withCacheRules) { + const params = new URLSearchParams(window.location.search); + options.cache = params.get('cache') === 'off' ? 'reload' : 'default'; + } + return fetch(resource, options); +} + +const findReplaceableNodes = (area) => { const regex = /{{(.*?)}}|%7B%7B(.*?)%7D%7D/g; const walker = document.createTreeWalker( - el, + area, NodeFilter.SHOW_TEXT, { acceptNode(node) { - const a = regex.test(node.nodeValue) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_REJECT; + const a = regex.test(node.nodeValue) + ? NodeFilter.FILTER_ACCEPT + : NodeFilter.FILTER_REJECT; regex.lastIndex = 0; return a; }, @@ -747,13 +757,20 @@ async function decoratePlaceholders(area, config) { nodes.push(node); node = walker.nextNode(); } + return nodes; +}; + +let placeholderRequest; +async function decoratePlaceholders(area, config) { + if (!area) return; + const nodes = findReplaceableNodes(area); if (!nodes.length) return; - const { replaceText } = await import('../features/placeholders.js'); - const replaceNodes = nodes.map(async (textNode) => { - textNode.nodeValue = await replaceText(textNode.nodeValue, config, regex); - textNode.nodeValue = textNode.nodeValue.replace(/ /g, '\u00A0'); - }); - await Promise.all(replaceNodes); + const placeholderPath = `${config.locale?.contentRoot}/placeholders.json`; + placeholderRequest = placeholderRequest + || customFetch({ resource: placeholderPath, withCacheRules: true }) + .catch(() => ({})); + const { decoratePlaceholderArea } = await import('../features/placeholders.js'); + await decoratePlaceholderArea({ placeholderPath, placeholderRequest, nodes }); } async function loadFooter() { @@ -987,6 +1004,7 @@ async function checkForPageMods() { } async function loadPostLCP(config) { + await decoratePlaceholders(document.body.querySelector('header'), config); if (config.mep?.targetEnabled === 'gnav') { /* c8 ignore next 2 */ const { init } = await import('../features/personalization/personalization.js'); @@ -1174,11 +1192,11 @@ async function processSection(section, config, isDoc) { const { default: loadInlineFrags } = await import('../blocks/fragment/fragment.js'); const fragPromises = inlineFrags.map((link) => loadInlineFrags(link)); await Promise.all(fragPromises); - await decoratePlaceholders(section.el, config); const newlyDecoratedSection = decorateSection(section.el, section.idx); section.blocks = newlyDecoratedSection.blocks; section.preloadLinks = newlyDecoratedSection.preloadLinks; } + await decoratePlaceholders(section.el, config); if (section.preloadLinks.length) { const [modals, nonModals] = partition(section.preloadLinks, (block) => block.classList.contains('modal')); @@ -1215,8 +1233,6 @@ export async function loadArea(area = document) { } const config = getConfig(); - await decoratePlaceholders(area, config); - if (isDoc) { decorateDocumentExtras(); } diff --git a/test/blocks/caas/mocks/utils.js b/test/blocks/caas/mocks/utils.js index 65de883798..5736d0e567 100644 --- a/test/blocks/caas/mocks/utils.js +++ b/test/blocks/caas/mocks/utils.js @@ -12,6 +12,8 @@ export const utf8ToB64 = (str) => window.btoa(unescape(encodeURIComponent(str))) export const b64ToUtf8 = (str) => decodeURIComponent(escape(window.atob(str))); +export const customFetch = stub(); + export function getMetadata(name, doc = document) { const attr = name && name.includes(':') ? 'property' : 'name'; const meta = doc.head.querySelector(`meta[${attr}="${name}"]`); diff --git a/test/blocks/instagram/mocks/embed-utils.js b/test/blocks/instagram/mocks/embed-utils.js index 4e37247e24..8f69fa3854 100644 --- a/test/blocks/instagram/mocks/embed-utils.js +++ b/test/blocks/instagram/mocks/embed-utils.js @@ -27,6 +27,8 @@ export function createTag(tag, attributes, html) { export const getConfig = () => ({}); +export const customFetch = stub(); + export const loadStyle = stub(); export const loadScript = stub(); diff --git a/test/blocks/marketo/mocks/marketo-utils.js b/test/blocks/marketo/mocks/marketo-utils.js index 9cf1cf9f9a..6aef9cfc38 100644 --- a/test/blocks/marketo/mocks/marketo-utils.js +++ b/test/blocks/marketo/mocks/marketo-utils.js @@ -67,3 +67,5 @@ export const localizeLink = (href) => href; export const loadLink = stub().returns(new Promise((resolve) => { resolve(); })); + +export const customFetch = stub(); diff --git a/test/blocks/merch/mocks/embed-utils.js b/test/blocks/merch/mocks/embed-utils.js index d5a171656a..9c956f7a7a 100644 --- a/test/blocks/merch/mocks/embed-utils.js +++ b/test/blocks/merch/mocks/embed-utils.js @@ -27,6 +27,8 @@ export const getConfig = () => config; export const setConfig = (c) => { config = c; }; +export const customFetch = stub(); + export const loadArea = stub(); export const loadScript = stub(); diff --git a/test/blocks/ost/mocks/ost-utils.js b/test/blocks/ost/mocks/ost-utils.js index e8f4ff9b28..d3dfa6a52f 100644 --- a/test/blocks/ost/mocks/ost-utils.js +++ b/test/blocks/ost/mocks/ost-utils.js @@ -22,7 +22,6 @@ function getMetadata(name, doc = document) { const loadScript = () => Promise.resolve(); const loadStyle = () => Promise.resolve(); - const mockRes = ({ payload, status = 200 } = {}) => new Promise((resolve) => { resolve({ status, @@ -32,7 +31,6 @@ const mockRes = ({ payload, status = 200 } = {}) => new Promise((resolve) => { text: () => payload, }); }); - function mockOstDeps({ failStatus = false, failMetadata = false, mockToken, overrideParams } = {}) { const options = { country: 'CH', @@ -100,6 +98,16 @@ function unmockOstDeps() { window.history.replaceState({}, '', ogUrl); } +const customFetch = window.fetch; + export { - getConfig, getLocale, getMetadata, loadScript, loadStyle, mockOstDeps, unmockOstDeps, mockRes, + getConfig, + getLocale, + getMetadata, + loadScript, + loadStyle, + mockOstDeps, + unmockOstDeps, + mockRes, + customFetch, }; diff --git a/test/blocks/slideshare/mocks/utils.js b/test/blocks/slideshare/mocks/utils.js index 5e173b915c..26eeff57ef 100644 --- a/test/blocks/slideshare/mocks/utils.js +++ b/test/blocks/slideshare/mocks/utils.js @@ -30,7 +30,7 @@ export const getConfig = () => ({}); export const loadStyle = stub(); export const loadScript = stub(); - +export const customFetch = stub(); export const utf8ToB64 = (str) => window.btoa(unescape(encodeURIComponent(str))); export function createIntersectionObserver({ el, callback /* , once = true, options = {} */ }) { diff --git a/test/utils/helpers.test.js b/test/utils/helpers.test.js deleted file mode 100644 index 2c8fb91ddb..0000000000 --- a/test/utils/helpers.test.js +++ /dev/null @@ -1,19 +0,0 @@ -import { expect } from '@esm-bundle/chai'; -import { stub } from 'sinon'; - -const { customFetch } = await import('../../libs/utils/helpers.js'); - -describe('Cache control', async () => { - it('fetches with cache param', async () => { - const paramsGet = stub(URLSearchParams.prototype, 'get'); - const fetchStub = stub(window, 'fetch'); - const goodResponse = { ok: true, json: () => true }; - const mockUrl = './mocks/taxonomy.json'; - paramsGet.withArgs('cache').returns('off'); - fetchStub.withArgs(mockUrl, { cache: 'reload' }).resolves(goodResponse); - const resp = await customFetch({ resource: mockUrl, withCacheRules: true }); - expect(resp.json()).to.be.true; - paramsGet.restore(); - fetchStub.restore(); - }); -}); diff --git a/test/utils/utils.test.js b/test/utils/utils.test.js index 57822bbe5f..430168e7a2 100644 --- a/test/utils/utils.test.js +++ b/test/utils/utils.test.js @@ -3,10 +3,9 @@ import { expect } from '@esm-bundle/chai'; import sinon from 'sinon'; import { waitFor, waitForElement } from '../helpers/waitfor.js'; import { mockFetch } from '../helpers/generalHelpers.js'; -import { createTag } from '../../libs/utils/utils.js'; +import { createTag, customFetch } from '../../libs/utils/utils.js'; const utils = {}; - const config = { codeRoot: '/libs', locales: { '': { ietf: 'en-US', tk: 'hah7vzn.css' } }, @@ -31,6 +30,12 @@ describe('Utils', () => { delete window.hlx; }); + it('fetches with cache param', async () => { + window.fetch = mockFetch({ payload: true }); + const resp = await customFetch({ resource: './mocks/taxonomy.json', withCacheRules: true }); + expect(resp.json()).to.be.true; + }); + describe('with body', () => { beforeEach(async () => { window.fetch = mockFetch({ payload: { data: '' } }); From 8b62e93dda56194996df775d4a6f77e8c7b1f068 Mon Sep 17 00:00:00 2001 From: Ryan Parrish Date: Mon, 2 Sep 2024 07:18:02 -0600 Subject: [PATCH 18/21] MWPW-151932 - Section metadata style grid enhancement for tablet VP (#2800) * poc for up-tablet * moved one-up to approp mq * remove redundant two-up-tablet. Use min-max defaults --- libs/blocks/section-metadata/section-metadata.css | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/libs/blocks/section-metadata/section-metadata.css b/libs/blocks/section-metadata/section-metadata.css index d053a42980..c027f794d5 100644 --- a/libs/blocks/section-metadata/section-metadata.css +++ b/libs/blocks/section-metadata/section-metadata.css @@ -248,12 +248,17 @@ main > .section[class*='-up'] > .content { .section.two-up.reverse-mobile > div:nth-child(2) { order: 1; } + } @media screen and (min-width: 600px) and (max-width: 1200px) { .section.five-up { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); } + + .section.one-up-tablet { grid-template-columns: 1fr; } + .section.three-up-tablet { grid-template-columns: repeat(3, 1fr); } + .section.four-up-tablet { grid-template-columns: repeat(4, 1fr); } .section.masonry-layout { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); @@ -264,15 +269,6 @@ main > .section[class*='-up'] > .content { } } -@media screen and (max-width: 900px) { - .section.two-up.one-up-tablet, - .section.three-up.one-up-tablet, - .section.four-up.one-up-tablet, - .section.five-up.one-up-tablet { - grid-template-columns: 1fr; - } -} - @media screen and (min-width: 720px) { .section.grid-width-6 { padding-left: calc((100vw - 600px) / 2); From bc61484271c68e85dff0224ae1125db4acae84e0 Mon Sep 17 00:00:00 2001 From: Siva S <163842332+sivasadobe@users.noreply.github.com> Date: Tue, 3 Sep 2024 13:43:24 +0530 Subject: [PATCH 19/21] MWPW-154448: Content should be in a data table but is not (#2667) * fix(a11y): added a11y two header tables * fix(heading): fixing the first row as columnheader * fix: heading more describable * fix(table): dynamic id added * fix: unique id for header body,pricing tag * chore: code opt * chore: eslint fix * fix(tab-focus): fixed key event in expand section * fix: review changes --- libs/blocks/table/table.js | 36 +++++++++++++++++++++++++++++++----- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/libs/blocks/table/table.js b/libs/blocks/table/table.js index b3ffb88085..6f2213c57c 100644 --- a/libs/blocks/table/table.js +++ b/libs/blocks/table/table.js @@ -5,7 +5,7 @@ import { decorateButtons } from '../../utils/decorate.js'; const DESKTOP_SIZE = 900; const MOBILE_SIZE = 768; const tableHighlightLoadedEvent = new Event('milo:table:highlight:loaded'); - +let tableIndex = 0; function defineDeviceByScreenSize() { const screenWidth = window.innerWidth; if (screenWidth >= DESKTOP_SIZE) { @@ -19,7 +19,7 @@ function defineDeviceByScreenSize() { function handleHeading(table, headingCols) { const isPriceBottom = table.classList.contains('pricing-bottom'); - headingCols.forEach((col) => { + headingCols.forEach((col, i) => { col.classList.add('col-heading'); if (!col.innerHTML) return; @@ -65,6 +65,28 @@ function handleHeading(table, headingCols) { headingButton.appendChild(buttonsWrapper); col.append(headingContent, headingButton); } + + const trackingHeader = col.querySelector('.tracking-header'); + const nodeToApplyRoleScope = trackingHeader ?? col; + + if (trackingHeader) { + const trackingHeaderID = `t${tableIndex + 1}-c${i + 1}-header`; + trackingHeader.setAttribute('id', trackingHeaderID); + + const headerBody = col.querySelector('.body:not(.action-area)'); + headerBody?.setAttribute('id', `${trackingHeaderID}-body`); + + const headerPricing = col.querySelector('.pricing'); + headerPricing?.setAttribute('id', `${trackingHeaderID}-pricing`); + + const describedBy = `${headerBody?.id ?? ''} ${headerPricing?.id ?? ''}`.trim(); + trackingHeader.setAttribute('aria-describedby', describedBy); + + col.removeAttribute('role'); + } + + nodeToApplyRoleScope.setAttribute('role', 'columnheader'); + nodeToApplyRoleScope.setAttribute('scope', 'col'); }); } @@ -190,6 +212,8 @@ function handleSection(sectionParams) { if (!isMerch) { const sectionRowTitle = nextRowCols?.[0]; sectionRowTitle.classList.add('section-row-title'); + sectionRowTitle.setAttribute('role', 'rowheader'); + sectionRowTitle.setAttribute('scope', 'row'); } } else if (!row.classList.contains('row-1') && (!isHighlightTable || !row.classList.contains('row-2'))) { row.classList.add('section-row'); @@ -216,6 +240,8 @@ function handleSection(sectionParams) { const sectionRowTitle = rowCols[0]; handleTitleText(sectionRowTitle); sectionRowTitle.classList.add('section-row-title'); + sectionRowTitle.setAttribute('role', 'rowheader'); + sectionRowTitle.setAttribute('scope', 'row'); } } return expandSection; @@ -335,6 +361,7 @@ function applyStylesBasedOnScreenSize(table, originTable) { tableEl.querySelectorAll('.icon.expand').forEach((icon) => { icon.parentElement.classList.add('point-cursor'); icon.parentElement.addEventListener('click', () => handleExpand(icon)); + icon.parentElement.setAttribute('tabindex', 0); icon.parentElement.addEventListener('keydown', (e) => { e.preventDefault(); if (e.key === 'Enter' || e.key === ' ') handleExpand(icon); @@ -469,9 +496,6 @@ export default function init(el) { col.dataset.colIndex = cdx + 1; col.classList.add('col', `col-${cdx + 1}`); col.setAttribute('role', 'cell'); - if (col.innerHTML) { - col.tabIndex = 0; - } }); expandSection = handleSection(sectionParams); @@ -525,4 +549,6 @@ export default function init(el) { }); observer.observe(el); + + tableIndex++; } From 47dea19e01b8afb158b35c8e97a5b27b89b1e040 Mon Sep 17 00:00:00 2001 From: Dave Linhart <132396886+AdobeLinhart@users.noreply.github.com> Date: Tue, 3 Sep 2024 02:13:30 -0600 Subject: [PATCH 20/21] MWPW-156866 [MILO][MEP] Create martech metadata table if placeholders are used in non EN page (#2780) * Initial checkin - Working state. * Optimization. Good State. * Semi-colon fix. * Linting fixes. * Unit test file creation. * Placeholders update/fix. * Fixed US data values. * Unit testing WIP. * fix unit test * unit test working * add before each * fix linter issue of using same name above * update processTrackingLabels * add coverage to attributes.js unit test * Unit test updates. --------- Co-authored-by: vgoodric --- .../personalization/personalization.js | 22 ++++ libs/martech/attributes.js | 10 +- .../createMartechMetadata.test.js | 51 +++++++++ .../personalization/mocks/placeholders.js | 103 ++++++++++++++++++ test/martech/attributes.test.js | 9 ++ 5 files changed, 193 insertions(+), 2 deletions(-) create mode 100644 test/features/personalization/createMartechMetadata.test.js create mode 100644 test/features/personalization/mocks/placeholders.js diff --git a/libs/features/personalization/personalization.js b/libs/features/personalization/personalization.js index df0f282ce8..29cfddd65d 100644 --- a/libs/features/personalization/personalization.js +++ b/libs/features/personalization/personalization.js @@ -582,6 +582,25 @@ export function parseManifestVariants(data, manifestPath, targetId) { return null; } +export async function createMartechMetadata(placeholders, config, column) { + if (config.locale.ietf === 'en-US') return; + + await import('../../martech/attributes.js').then(({ processTrackingLabels }) => { + config.mep.analyticLocalization ??= {}; + + placeholders.forEach((item, i) => { + const firstRow = placeholders[i]; + let usValue = firstRow['en-us'] || firstRow.us || firstRow.en || firstRow.key; + + if (!usValue) return; + + usValue = processTrackingLabels(usValue); + const translatedValue = processTrackingLabels(item[column]); + config.mep.analyticLocalization[translatedValue] = usValue; + }); + }); +} + /* c8 ignore start */ function parsePlaceholders(placeholders, config, selectedVariantName = '') { if (!placeholders?.length || selectedVariantName === 'default') return config; @@ -603,6 +622,9 @@ function parsePlaceholders(placeholders, config, selectedVariantName = '') { }, {}); config.placeholders = { ...(config.placeholders || {}), ...results }; } + + createMartechMetadata(placeholders, config, val); + return config; } diff --git a/libs/martech/attributes.js b/libs/martech/attributes.js index 1f0af83c53..5d661d98dc 100644 --- a/libs/martech/attributes.js +++ b/libs/martech/attributes.js @@ -6,8 +6,14 @@ const LEAD_UNDERSCORES = /^_+|_+$/g; export function processTrackingLabels(text, config, charLimit) { let analyticsValue = text?.replace(INVALID_CHARACTERS, ' ').replace(LEAD_UNDERSCORES, '').trim(); if (config) { - const { analyticLocalization, loc = analyticLocalization?.[analyticsValue] } = config; - if (loc) analyticsValue = loc; + const { analyticLocalization, mep } = config; + const mepLoc = mep?.analyticLocalization?.[analyticsValue]; + if (mepLoc) { + analyticsValue = mepLoc; + } else { + const loc = analyticLocalization?.[analyticsValue]; + if (loc) analyticsValue = loc; + } } if (charLimit) return analyticsValue.slice(0, charLimit); return analyticsValue; diff --git a/test/features/personalization/createMartechMetadata.test.js b/test/features/personalization/createMartechMetadata.test.js new file mode 100644 index 0000000000..ba6a94eae2 --- /dev/null +++ b/test/features/personalization/createMartechMetadata.test.js @@ -0,0 +1,51 @@ +import { expect } from '@esm-bundle/chai'; +import { createMartechMetadata } from '../../../libs/features/personalization/personalization.js'; +import placeholders from './mocks/placeholders.js'; + +const config = { + locale: { ietf: 'fr-fr' }, + mep: {}, +}; + +// Note that the manifestPath doesn't matter as we stub the fetch +describe('test martech metadata creation', () => { + beforeEach(() => { + config.mep = {}; + }); + it('test two non US manifests', async () => { + expect(config.mep).to.deep.equal({}); + + await createMartechMetadata(placeholders.geoTest, config, 'fr'); + expect(config.mep.analyticLocalization).to.deep.equal({ + 'value1 fr': 'value1 en us', + 'value2 fr': 'value2 en us', + 'bonjour fr': 'Hello en us', + 'buy now fr': 'buy now en us', + 'try now fr': 'try now en us', + }); + await createMartechMetadata(placeholders.secondManifestTest, config, 'fr'); + expect(config.mep.analyticLocalization).to.deep.equal({ + 'new fr': 'new en us', + 'value1 fr': 'value1 en us', + 'value2 fr': 'new2 en us', + 'bonjour fr': 'Hello en us', + 'buy now fr': 'buy now en us', + 'try now fr': 'try now en us', + }); + }); + it('test one manifest non US withou en-us keys', async () => { + await createMartechMetadata(placeholders.keyTest, config, 'fr'); + expect(config.mep.analyticLocalization).to.deep.equal({ + 'value1 fr': 'test placeholder', + 'value2 fr': 'test placeholder2', + 'bonjour fr': 'marquee headline', + 'buy now fr': 'marquee hollow', + 'try now fr': 'marquee solid', + }); + }); + it('test one manifest en-US', async () => { + config.locale.ietf = 'en-US'; + await createMartechMetadata(placeholders.keyTest, config, 'us'); + expect(config.mep).to.deep.equal({}); + }); +}); diff --git a/test/features/personalization/mocks/placeholders.js b/test/features/personalization/mocks/placeholders.js new file mode 100644 index 0000000000..6cf3a8a9d3 --- /dev/null +++ b/test/features/personalization/mocks/placeholders.js @@ -0,0 +1,103 @@ +const placeholders = { + geoTest: [ + { + key: 'test-placeholder', + 'mobile-device & us': 'US Mobile Value', + us: 'value1-us', + 'en-us': 'value1-en-us', + 'ca & not fr': 'value1-ca-not-fr', + fr: 'value1-fr', + 'mobile-device': 'value1-mobile', + }, + { + key: 'test-placeholder2', + 'mobile-device & us': 'US Mobile Value2', + us: 'value2-us', + 'en-us': 'value2-en-us', + 'ca & not fr': 'value2-ca-not-fr', + fr: 'value2-fr', + 'mobile-device': 'value2-mobile', + }, + { + key: 'marquee-headline', + 'mobile-device & us': 'hello US mobile', + us: 'hello-us', + 'en-us': 'Hello-en-us', + 'ca & not fr': 'hello-ca-not-fr', + fr: 'bonjour-fr', + 'mobile-device': 'hello-mobile', + }, + { + key: 'marquee-hollow', + 'mobile-device & us': 'buy-now-mobile-us', + us: 'buy-now-us', + 'en-us': 'buy-now-en-us', + 'ca & not fr': 'buy-now-ca-not-fr', + fr: 'buy-now-fr', + 'mobile-device': 'buy-now-mobile', + }, + { + key: 'marquee-solid', + 'mobile-device & us': 'try-now-mobile-us', + us: 'try-now-us', + 'en-us': 'try-now-en-us', + 'ca & not fr': 'try-now-ca-not-fr', + fr: 'try-now-fr', + 'mobile-device': 'try-now-mobile', + }, + ], + secondManifestTest: [ + { + key: 'test-placeholder', + 'mobile-device & us': 'US Mobile Value', + us: 'value1-us', + 'en-us': 'new-en-us', + 'ca & not fr': 'value1-ca-not-fr', + fr: 'new-fr', + 'mobile-device': 'value1-mobile', + }, + { + key: 'test-placeholder2', + 'mobile-device & us': 'US Mobile Value2', + us: 'value2-us', + 'en-us': 'new2-en-us', + 'ca & not fr': 'value2-ca-not-fr', + fr: 'value2-fr', + 'mobile-device': 'value2-mobile', + }, + ], + keyTest: [ + { + key: 'test-placeholder', + 'mobile-device & us': 'US Mobile Value', + fr: 'value1-fr', + 'mobile-device': 'value1-mobile', + }, + { + key: 'test-placeholder2', + 'mobile-device & us': 'US Mobile Value2', + fr: 'value2-fr', + 'mobile-device': 'value2-mobile', + }, + { + key: 'marquee-headline', + 'mobile-device & us': 'hello US mobile', + fr: 'bonjour-fr', + 'mobile-device': 'hello-mobile', + }, + { + key: 'marquee-hollow', + 'mobile-device & us': 'buy-now-mobile-us', + fr: 'buy-now-fr', + 'mobile-device': 'buy-now-mobile', + }, + { + key: 'marquee-solid', + 'mobile-device & us': 'try-now-mobile-us', + fr: 'try-now-fr', + 'mobile-device': 'try-now-mobile', + }, + ], +}; + +export default placeholders; diff --git a/test/martech/attributes.test.js b/test/martech/attributes.test.js index 97593f80d3..263dec0b70 100644 --- a/test/martech/attributes.test.js +++ b/test/martech/attributes.test.js @@ -109,4 +109,13 @@ describe('Analytics', async () => { }, 20); expect(processedString).to.equal('Buy now'); }); + it('should process tracking labels with foreign locale and MEP placeholder', () => { + const translatedString = 'Comprar ahora'; + const processedString = processTrackingLabels(translatedString, { + locale: { ietf: 'es-ES' }, + analyticLocalization: { 'Comprar ahora': 'Buy now' }, + mep: { analyticLocalization: { 'Comprar ahora': 'Buy right now' } }, + }, 20); + expect(processedString).to.equal('Buy right now'); + }); }); From 721645234c38ae69cf110e5b822ce4cc29ea821a Mon Sep 17 00:00:00 2001 From: Chris Peyer Date: Tue, 3 Sep 2024 04:39:05 -0400 Subject: [PATCH 21/21] MWPW-157445 Additional Lana LCP data (#2805) --- libs/utils/logWebVitals.js | 25 +++++++++++++++++++++++-- test/utils/logWebVitals.test.js | 11 +++-------- 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/libs/utils/logWebVitals.js b/libs/utils/logWebVitals.js index a7e4bc39a5..0564ffe510 100644 --- a/libs/utils/logWebVitals.js +++ b/libs/utils/logWebVitals.js @@ -62,7 +62,21 @@ function getElementInfo(el) { return `${el.outerHTML.substring(0, 100)}...`; } -function observeLCP(lanaData, delay) { +function isFragmentFromMep(fragPath, mep) { + return mep.experiments?.some(({ selectedVariant }) => { + const { commands = [], fragments = [] } = selectedVariant || {}; + + return commands.some((cmd) => { + try { + return new URL(cmd.target).pathname === fragPath; + } catch { + return false; + } + }) || fragments.some((cmd) => cmd?.val === fragPath); + }); +} + +function observeLCP(lanaData, delay, mep) { new PerformanceObserver((list) => { const entries = list.getEntries(); const lastEntry = entries[entries.length - 1]; // Use the latest LCP candidate @@ -70,6 +84,13 @@ function observeLCP(lanaData, delay) { const lcpEl = lastEntry.element; lanaData.lcpElType = lcpEl.nodeName.toLowerCase(); lanaData.lcpEl = getElementInfo(lcpEl); + const closestFrag = lcpEl.closest('.fragment'); + lanaData.isFrag = closestFrag ? 'true' : 'false'; + if (closestFrag) { + lanaData.isMep = isFragmentFromMep(closestFrag.dataset.path, mep) ? 'true' : 'false'; + } else { + lanaData.isMep = 'false'; + } setTimeout(() => { sendToLana(lanaData); @@ -99,7 +120,7 @@ export default function webVitals(mep, { delay = 1000, sampleRate = 50 } = {}) { const lanaData = {}; logMepExperiments(lanaData, mep); observeCLS(lanaData); - observeLCP(lanaData, delay); + observeLCP(lanaData, delay, mep); } if (getConsent()) { handleEvent(); diff --git a/test/utils/logWebVitals.test.js b/test/utils/logWebVitals.test.js index e04db9805a..199e7ca1dd 100644 --- a/test/utils/logWebVitals.test.js +++ b/test/utils/logWebVitals.test.js @@ -5,15 +5,8 @@ import logWebVitals from '../../libs/utils/logWebVitals.js'; document.body.innerHTML = await readFile({ path: './mocks/body.html' }); +window.adobePrivacy = { activeCookieGroups: () => ['C0002'] }; describe('Log Web Vitals', () => { - before(() => { - window.adobePrivacy = { activeCookieGroups: () => ['C0002'] }; - }); - - after(() => { - delete window.adobePrivacy; - }); - it('Logs data to lana', (done) => { window.lana = { log: (logStr, logOpts) => { @@ -39,6 +32,8 @@ describe('Log Web Vitals', () => { expect(vitals.manifest4selected).to.equal('target-var-marqueelink'); expect(vitals.os).to.be.oneOf(['mac', 'win', 'android', 'linux', '']); expect(vitals.url).to.equal('localhost:2000/'); + expect(vitals.isMep).to.equal('false'); + expect(vitals.isFrag).to.equal('false'); expect(parseInt(vitals.windowHeight, 10)).to.be.greaterThan(200); expect(parseInt(vitals.windowWidth, 10)).to.be.greaterThan(200);