diff --git a/libs/blocks/card/cardUtils.js b/libs/blocks/card/cardUtils.js index 76a726aa73..3ca7a6da71 100644 --- a/libs/blocks/card/cardUtils.js +++ b/libs/blocks/card/cardUtils.js @@ -20,7 +20,7 @@ export const addVideoBtn = (link, cardType, card) => { return cardImage.append(link); }; -const getUpFromSectionMetadata = (section) => { +export const getUpFromSectionMetadata = (section) => { const sectionMetadata = section.querySelector('.section-metadata'); if (!sectionMetadata) return null; const metadata = getMetadata(sectionMetadata); diff --git a/libs/blocks/merch-card/img/checkmark-white-small.svg b/libs/blocks/merch-card/img/checkmark-white-small.svg new file mode 100644 index 0000000000..b7e8978ccc --- /dev/null +++ b/libs/blocks/merch-card/img/checkmark-white-small.svg @@ -0,0 +1,10 @@ + + + + + + diff --git a/libs/blocks/merch-card/img/ellipsis.svg b/libs/blocks/merch-card/img/ellipsis.svg new file mode 100644 index 0000000000..56416384c2 --- /dev/null +++ b/libs/blocks/merch-card/img/ellipsis.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/libs/blocks/merch-card/img/secure-transaction.svg b/libs/blocks/merch-card/img/secure-transaction.svg new file mode 100644 index 0000000000..461460b91b --- /dev/null +++ b/libs/blocks/merch-card/img/secure-transaction.svg @@ -0,0 +1,10 @@ + + + + + + + + diff --git a/libs/blocks/merch-card/legacy-merch-card.css b/libs/blocks/merch-card/legacy-merch-card.css new file mode 100644 index 0000000000..5b06912d3a --- /dev/null +++ b/libs/blocks/merch-card/legacy-merch-card.css @@ -0,0 +1,352 @@ +/* stylelint-disable selector-class-pattern */ +.merch-card hr { + background-color: var(--color-gray-200); + border: none; + height: 1px; + width: 100%; + margin-bottom: var(--spacing-xs); +} + +.merch-card p { + font-size: var(--type-body-xs-size); + font-weight: 400; + line-height: 1.5; + margin-bottom: var(--spacing-xxs); + margin-top: 0; + color: var(--color-black); +} + +.merch-card h1, +.merch-card h2, +.merch-card h3, +.merch-card h4, +.merch-card h5, +.merch-card h6 { + line-height: 1.25; + margin-top: 0; + color: var(--color-black); +} + +.merch-card h2 { + font-size: var(--type-heading-l-size); + margin-bottom: var(--spacing-xxs); +} + +.merch-card h3, +.merch-card h4 { + font-size: var(--type-heading-xs-size); + margin-bottom: var(--spacing-xxs); +} + +.merch-card h5 { + font-size: var(--type-heading-xs-size); +} + +.merch-card .consonant-MerchCard-ProductIcon { + background-size: contain; + background-repeat: no-repeat; + position: relative; + margin-right: var(--spacing-xxs); + margin-bottom: var(--spacing-xxs); + display: block; + float: left; + width: 40px; + height: 40px; +} + +.merch-card div[class$="-title"] { + width: 100%; + font-size: var(--type-heading-xs-lh); + font-weight: var(--type-heading-all-weight); + align-self: flex-start; + max-height: max-content; + flex: none; +} + +.merch-card h4.consonant-SpecialOffers-title { + text-transform: uppercase; +} + +.merch-card h2.consonant-PlansCard-title { + font-size: var(--type-heading-m-size); + line-height: var(--type-heading-l-lh); +} + +.merch-card h3.consonant-SpecialOffers-title, +.merch-card h3.consonant-PlansCard-title { + margin-bottom: 0; +} + +.merch-card h3.consonant-PlansCard-title { + margin-bottom: var(--spacing-xxs); + line-height: var(--type-heading-s-lh); +} + +.merch-card h4.consonant-PlansCard-title { + font-size: var(--type-body-xxs-size); + font-style: italic; +} + +.merch-card h5[class$="-title"] { + font-size: var(--type-heading-xxs-size); + font-weight: 500; +} + +.merch-card.segment { + position: relative; + display: flex; + flex-direction: column; + min-height: 222px; + width: 100%; + flex: 1; + min-width: 378px; + max-width: 378px; +} + +.merch-card.special-offers, +.merch-card.segment, +.merch-card.plans { + border-radius: 16px; +} + +.merch-card.special-offers.full-width { + min-width: 100%; + max-width: 100%; + width: 1200px; +} + +.merch-card.special-offers.center { + text-align: center; +} + +.merch-card div[class$="-inner"] { + display: flex; + flex-direction: column; + flex-grow: 1; + padding: 16px 16px 20px; + border-radius: 4px; + background-color: var(--color-white); + text-decoration: none; +} + +.merch-card .consonant-PlansCard-inner { + padding: var(--spacing-xs); +} + +.merch-card div[class$="-prices"] { + font-size: var(--type-body-s-size); + line-height: 24px; + margin-bottom: var(--spacing-xxs); +} + +.merch-card div[class$="-description"] { + width: 100%; + font-size: var(--type-heading-xs-size); + line-height: 1.5; + margin-top: 0; + align-self: flex-start; + flex-grow: 1; +} + +.merch-card .consonant-SegmentBlade-description span.placeholder-resolved, +.merch-card .consonant-SpecialOffers-description span.placeholder-resolved, +.merch-card .consonant-PlansCard-description span.placeholder-resolved { + font-size: var(--type-heading-xs-size); +} + +.merch-card .consonant-SegmentBlade-description span.placeholder-resolved[data-template="priceStrikethrough"], +.merch-card .consonant-SpecialOffers-description span.placeholder-resolved[data-template="priceStrikethrough"], +.merch-card .consonant-PlansCard-description span.placeholder-resolved[data-template="priceStrikethrough"] { + font-size: var(--type-body-xs-size); +} + +.merch-card.consonant-SpecialOffers-Card { + border-radius: 16px; +} + +.merch-card .consonant-SpecialOffers-img, +.merch-card .consonant-PlansCard-img { + flex-grow: 1; + position: relative; + width: 100%; + height: 213px; + background-color: var(--background-color); + background-position: 50% 50%; + background-repeat: no-repeat; + background-size: cover; +} + +.merch-card div[class$="-ribbon"] { + position: absolute; + top: 16px; + right: 0; + font-size: var(--type-heading-xxs-size); + font-weight: 500; + max-width: 150px; + line-height: 16px; + text-align: center; + padding: 8px 11px; + border-radius: 5px 0 0 5px; +} + +.merch-card .consonant-SpecialOffers-ribbon { + text-transform: uppercase; +} + +.merch-card .consonant-SpecialOffers-inner, +.merch-card .consonant-PlansCard-inner { + justify-content: center; + height: 100%; +} + +.merch-card.special-offers .consonant-SpecialOffers-description p, +.merch-card.special-offers .consonant-PlansCard-description p { + font-size: var(--type-body-xs-size); +} + +.merch-card .consonant-SpecialOffers-description em, +.merch-card .consonant-PlansCard-description em { + color: var(--color-gray-600); +} + +.merch-card.special-offers h4 { + font-size: var(--type-body-xxs-size); + text-transform: uppercase; + letter-spacing: 1px; +} + +.merch-card .checkbox-container { + cursor: pointer; + margin-bottom: var(--spacing-xs); +} + +.merch-card .checkbox-container, +.merch-card .secure-transaction-wrapper { + display: grid; + grid-template-columns: 12px auto; + gap: var(--spacing-xxs); +} + +.merch-card .checkbox-label, +.merch-card .secure-transaction-label { + font-size: var(--type-body-xxs-size); + line-height: 1.3; + color: var(--color-gray-600); +} + +.merch-card .secure-transaction-icon { + height: 15px; + width: 12px; + background: url('/libs/img/ui/secure-transaction.svg') no-repeat left center; +} + +.merch-card .secure-transaction-label { + white-space: nowrap; +} + +.merch-card .checkbox-container input[type="checkbox"] { + display: none; +} + +.merch-card .checkbox-container .checkmark { + position: relative; + display: inline-block; + width: 12px; + height: 12px; + border: 2px solid #757575; + background: #fff; + border-radius: 2px; + cursor: pointer; + margin-top: 2px; +} + +.merch-card .checkbox-container input[type="checkbox"]:checked + .checkmark { + background-color: var(--color-accent); + background-image: url('/libs/img/ui/checkmark-white-small.svg'); + border-color: var(--color-accent); +} + +.merch-card.has-divider hr { + margin: var(--spacing-xxs) 0; +} + +.merch-card.has-divider .consonant-CardFooter hr { + display: none; +} + +.merch-card.background-opacity-70 { + background-color: rgba(255 255 255 / 70%); +} + +.merch-card.background-opacity-70 div[class$="-inner"] { + background-color: transparent; +} + +.merch-card.inline-heading .consonant-SegmentBlade-inner { + display: grid; + column-gap: 12px; + align-items: center; + grid-template-columns: 40px 1fr; +} + +.merch-card ul[class$="-list"] { + list-style: none; + margin: 0; + padding-left: var(--spacing-xxs); + font-size: var(--type-body-xxs-size); + line-height: 1.5; + color: var(--color-black); +} + +.merch-card li[class$="-list-item"] { + position: relative; +} + +.merch-card li[class$="-list-item"]::before { + content: "\B7"; + position: absolute; + left: -0.4em; + font-size: 1.5em; + top: calc(0.5 * 1.5 * var(--type-body-xxs-size) - 0.05em); + transform: translateY(-50%); +} + +.merch-card.inline-heading .consonant-SegmentBlade-description, +.merch-card.inline-heading .consonant-CardFooter { + grid-column: span 2; +} + +.merch-card.special-offers .consonant-CardFooter { + margin-top: 0; + padding-top: 0; + justify-content: center; + box-sizing: border-box; + align-self: flex-end; + width: 100%; +} + +.merch-card .consonant-CardFooter .standard-wrapper { + display: flex; + flex-wrap: wrap; + gap: var(--spacing-xs); + align-items: center; +} + +.merch-card .consonant-CardFooter-row, +.merch-card .consonant-CardFooter-cell { + display: flex; + gap: var(--spacing-xs); + flex-wrap: wrap; + margin-left: auto; + height: auto; + width: auto; +} + +.merch-card .consonant-CardFooter-row .button--inactive { + display: none; +} + +.dark .merch-card .consonant-CardFooter .con-button.outline { + border-color: var(--color-black); + color: var(--color-black); +} diff --git a/libs/blocks/merch-card/legacy-merch-card.js b/libs/blocks/merch-card/legacy-merch-card.js new file mode 100644 index 0000000000..d8ba397264 --- /dev/null +++ b/libs/blocks/merch-card/legacy-merch-card.js @@ -0,0 +1,207 @@ +/* eslint-disable prefer-destructuring */ +import { decorateButtons, decorateBlockHrs } from '../../utils/decorate.js'; +import { loadStyle, getConfig, createTag } from '../../utils/utils.js'; +import { addBackgroundImg, addWrapper, addFooter } from '../card/cardUtils.js'; +import { replaceKey } from '../../features/placeholders.js'; + +const { miloLibs, codeRoot } = getConfig(); +const base = miloLibs || codeRoot; + +const SEGMENT_BLADE = 'SegmentBlade'; +const SPECIAL_OFFERS = 'SpecialOffers'; +const PLANS_CARD = 'PlansCard'; +const cardTypes = { + segment: SEGMENT_BLADE, + 'special-offers': SPECIAL_OFFERS, + plans: PLANS_CARD, +}; +const getPodType = (styles) => { + const authoredType = styles?.find((style) => style in cardTypes); + + return cardTypes[authoredType] || SEGMENT_BLADE; +}; + +const decorateFooter = (el, altCtaMetaData, cardType) => { + const cardFooter = el.querySelector('.consonant-CardFooter'); + + const decorateWithSecureTransactionSign = () => { + const secureTransactionWrapper = createTag('div', { class: 'secure-transaction-wrapper' }); + const label = createTag('span', { class: 'secure-transaction-label' }); + const secureElement = createTag('span', { class: 'secure-transaction-icon' }); + secureTransactionWrapper.append(secureElement, label); + replaceKey('secure-transaction', getConfig()).then((replacedKey) => { + label.textContent = replacedKey; + }); + return secureTransactionWrapper; + }; + + const createCheckbox = (checkBoxText) => { + const container = createTag('label', { class: 'checkbox-container' }); + const input = createTag('input', { id: 'alt-cta', type: 'checkbox' }); + const checkmark = createTag('span', { class: 'checkmark' }); + const label = createTag('span', { class: 'checkbox-label' }, checkBoxText.innerHTML); + + container.append(input, checkmark, label); + return container; + }; + + const createSecureSign = () => { + const cardFooterRow = el.querySelector('.consonant-CardFooter-row'); + const standardWrapper = createTag('div', { class: 'standard-wrapper' }); + const secureTransactionWrapper = decorateWithSecureTransactionSign(); + + standardWrapper.append(secureTransactionWrapper, cardFooterRow); + cardFooter?.append(standardWrapper); + }; + + const decorateAlternativeCta = () => { + const altCtaRegex = /href=".*"/; + if (!altCtaRegex.test(altCtaMetaData[1]?.innerHTML)) return; + const cardFooterRow = el.querySelector('.consonant-CardFooter-row'); + const originalCtaButton = cardFooterRow.querySelector('.consonant-CardFooter-cell--right'); + const checkboxContainer = createCheckbox(altCtaMetaData[0]); + const altCtaButtonData = altCtaMetaData[1]; + decorateButtons(altCtaButtonData); + const altCtaButton = createTag( + 'div', + { class: originalCtaButton.classList }, + altCtaButtonData.innerHTML, + ); + altCtaButton.classList.add('button--inactive'); + checkboxContainer + .querySelector('input[type="checkbox"]') + .addEventListener('change', ({ target: { checked } }) => { + originalCtaButton.classList.toggle('button--inactive', checked); + altCtaButton.classList.toggle('button--inactive', !checked); + }); + cardFooterRow.append(altCtaButton); + cardFooter.prepend(checkboxContainer); + altCtaMetaData[0].parentNode.remove(); + }; + if (altCtaMetaData !== null) decorateAlternativeCta(); + if (el.classList.contains('secure')) createSecureSign(); + cardFooter.querySelectorAll('.consonant-CardFooter-cell').forEach( + (cell) => cell.classList.add(`consonant-${cardType}-cell`), + ); +}; + +const addInner = (el, altCta, cardType, merchCard) => { + const innerElements = [...el.querySelectorAll('h1, h2, h3, h4, h5, h6, p, ul')]; + const styles = [...el.classList]; + const merch = styles.includes('merch-card'); + const pElement = merch && el.querySelector(':scope > div > div > p:last-of-type'); + const links = pElement + ? pElement.querySelectorAll('a:not([data-dnd]), checkout-link') + : el.querySelectorAll('a:not([data-dnd]), checkout-link'); + const list = el.querySelector('ul'); + + const inner = el.querySelector(':scope > div:not([class])'); + inner.classList.add(`consonant-${cardType}-inner`); + + innerElements.forEach((element) => { + if (element.tagName.match(/^H[1-6]$/)) element.classList.add(`consonant-${cardType}-title`); + if (element.tagName.match(/^P$/)) element.classList.add(`consonant-${cardType}-description`); + if (element.tagName.match(/^UL$/)) { + list.classList.add(`consonant-${cardType}-list`); + list.querySelectorAll('li').forEach((li) => { + li.classList.add(`consonant-${cardType}-list-item`); + }); + } + }); + + inner.append(...innerElements); + addFooter(links, inner, cardType !== PLANS_CARD); + decorateFooter(el, altCta, cardType); + merchCard.append(inner); +}; + +const decorateRibbon = (el, ribbonMetadata, cardType) => { + const ribbonStyleRegex = /^#[0-9a-fA-F]+, #[0-9a-fA-F]+$/; + if (!ribbonStyleRegex.test(ribbonMetadata[0]?.innerText)) return; + const ribbonStyle = ribbonMetadata[0].innerText.trim(); + const [ribbonBgColor, ribbonTextColor] = ribbonStyle.split(', '); + const ribbonWrapper = ribbonMetadata[0].parentNode; + const ribbon = ribbonMetadata[1]; + ribbon.classList.add(`consonant-${cardType}-ribbon`); + const borderStyle = `1px solid ${ribbonBgColor}`; + if (el.classList.contains('evergreen')) { + ribbon.style.border = borderStyle; + ribbon.style.borderRight = 'none'; + } else { + ribbon.style.backgroundColor = ribbonBgColor; + el.style.border = borderStyle; + } + ribbon.style.color = ribbonTextColor; + const picture = el.querySelector(`.consonant-${cardType}-img`); + if (picture) { + picture.insertAdjacentElement('afterend', ribbon); + } else { + el.insertAdjacentElement('beforeend', ribbon); + } + ribbonWrapper.remove(); +}; + +const decorateIcon = (el, icons, cardType) => { + if (!icons) return; + const inner = el.querySelector(`.consonant-${cardType}-inner`); + const iconWrapper = createTag('div', { class: `consonant-${cardType}-iconWrapper` }); + icons.forEach((icon) => { + const url = icon.querySelector('img').src; + const iconDiv = createTag( + 'div', + { + class: 'consonant-MerchCard-ProductIcon', + style: `background-image: url(${url})`, + }, + ); + iconWrapper.appendChild(iconDiv); + icon.parentNode?.remove(); + }); + inner.prepend(iconWrapper); +}; + +export const initLegacyMerchCard = (el) => { + loadStyle(`${base}/blocks/merch-card/legacy-merch-card.css`); + loadStyle(`${base}/deps/caas.css`); + const section = el.closest('.section'); + section.classList.add('milo-card-section'); + const images = el.querySelectorAll('picture'); + let image; + const icons = []; + const rows = el.querySelectorAll(':scope > *'); + const ribbonMetadata = rows[0].children?.length === 2 ? rows[0].children : null; + const row = rows[ribbonMetadata === null ? 0 : 1]; + const altCta = rows[rows.length - 1].children?.length === 2 + ? rows[rows.length - 1].children : null; + const allPElems = row.querySelectorAll('p'); + const ctas = allPElems[allPElems.length - 1]; + const styles = [...el.classList]; + const cardType = getPodType(styles); + const merchCard = el; + decorateBlockHrs(el); + images.forEach((img) => { + const imgNode = img.querySelector('img'); + const { width, height } = imgNode; + const isSquare = Math.abs(width - height) <= 10; + if (img) { + if (isSquare) { + icons.push(img); + } else { + image = img; + } + } + }); + addWrapper(el, section, cardType); + merchCard.classList.add('consonant-Card', 'consonant-ProductCard', `consonant-${cardType}`); + if (image) addBackgroundImg(image, cardType, merchCard); + if (ribbonMetadata !== null) decorateRibbon(el, ribbonMetadata, cardType); + image?.parentElement.remove(); + if (ctas) decorateButtons(ctas); + addInner(el, altCta, cardType, merchCard); + decorateIcon(el, icons, cardType); + const inner = el.querySelector(`.consonant-${cardType}-inner`); + const innerCleanup = inner.querySelectorAll(':scope > div')[1]; + if (innerCleanup.classList.length === 0) innerCleanup.remove(); +}; + +export default initLegacyMerchCard; diff --git a/libs/blocks/merch-card/merch-card.css b/libs/blocks/merch-card/merch-card.css index c8d646c908..3ae881b0ce 100644 --- a/libs/blocks/merch-card/merch-card.css +++ b/libs/blocks/merch-card/merch-card.css @@ -1,353 +1,14 @@ -/* stylelint-disable selector-class-pattern */ -.merch-card hr { - background-color: var(--color-gray-200); - border: none; - height: 1px; - width: 100%; - margin-bottom: var(--spacing-xs); -} - -.merch-card p { - font-size: var(--type-body-xs-size); - font-weight: 400; - line-height: 1.5; - margin-bottom: var(--spacing-xxs); - margin-top: 0; - color: var(--color-black); -} - -.merch-card h1, -.merch-card h2, -.merch-card h3, -.merch-card h4, -.merch-card h5, -.merch-card h6 { - line-height: 1.25; - margin-top: 0; - color: var(--color-black); -} - -.merch-card h2 { - font-size: var(--type-heading-l-size); - margin-bottom: var(--spacing-xxs); -} - -.merch-card h3, -.merch-card h4 { - font-size: var(--type-heading-xs-size); - margin-bottom: var(--spacing-xxs); -} - -.merch-card h5 { - font-size: var(--type-heading-xs-size); -} - -.merch-card .consonant-MerchCard-ProductIcon { - background-size: contain; - background-repeat: no-repeat; - position: relative; - margin-right: var(--spacing-xxs); - margin-bottom: var(--spacing-xxs); - display: block; - float: left; - width: 40px; - height: 40px; -} - -.merch-card div[class$="-title"] { - width: 100%; - font-size: var(--type-heading-xs-lh); - font-weight: var(--type-heading-all-weight); - align-self: flex-start; - max-height: max-content; - flex: none; -} - -.merch-card h4.consonant-SpecialOffers-title { - text-transform: uppercase; -} - -.merch-card h2.consonant-PlansCard-title { - font-size: var(--type-heading-m-size); - line-height: var(--type-heading-l-lh); -} - -.merch-card h3.consonant-SpecialOffers-title, -.merch-card h3.consonant-PlansCard-title { - margin-bottom: 0; -} - -.merch-card h3.consonant-PlansCard-title { - margin-bottom: var(--spacing-xxs); - line-height: var(--type-heading-s-lh); -} - -.merch-card h4.consonant-PlansCard-title { - font-size: var(--type-body-xxs-size); - font-style: italic; -} - -.merch-card h5[class$="-title"] { - font-size: var(--type-heading-xxs-size); - font-weight: 500; -} - -.merch-card.segment { - position: relative; - display: flex; - flex-direction: column; - min-height: 222px; - width: 100%; - flex: 1; - min-width: 378px; - max-width: 378px; -} - -.merch-card.special-offers, -.merch-card.segment, -.merch-card.plans { - border-radius: 16px; -} - -.merch-card.special-offers.full-width { - min-width: 100%; - max-width: 100%; - width: 1200px; -} - -.merch-card.special-offers.center { - text-align: center; -} - -.merch-card div[class$="-inner"] { - display: flex; - flex-direction: column; - flex-grow: 1; - padding: 16px 16px 20px; - border-radius: 4px; - background-color: var(--color-white); - text-decoration: none; -} - -.merch-card .consonant-PlansCard-inner { - padding: var(--spacing-xs); -} - -.merch-card div[class$="-prices"] { - font-size: var(--type-body-s-size); - line-height: 24px; - margin-bottom: var(--spacing-xxs); -} - -.merch-card div[class$="-description"] { - width: 100%; - font-size: var(--type-heading-xs-size); - line-height: 1.5; - margin-top: 0; - align-self: flex-start; - flex-grow: 1; -} - -.merch-card .consonant-SegmentBlade-description span.placeholder-resolved, -.merch-card .consonant-SpecialOffers-description span.placeholder-resolved, -.merch-card .consonant-PlansCard-description span.placeholder-resolved { - font-size: var(--type-heading-xs-size);; -} - -.merch-card .consonant-SegmentBlade-description span.placeholder-resolved[data-template="priceStrikethrough"], -.merch-card .consonant-SpecialOffers-description span.placeholder-resolved[data-template="priceStrikethrough"], -.merch-card .consonant-PlansCard-description span.placeholder-resolved[data-template="priceStrikethrough"] { - font-size: var(--type-body-xs-size); -} - -.merch-card.consonant-SpecialOffers-Card { - border-radius: 16px; -} - -.merch-card .consonant-SpecialOffers-img, -.merch-card .consonant-PlansCard-img { - flex-grow: 1; - position: relative; - width: 100%; - min-height: 213px; - max-height: 213px; - background-color: var(--background-color); - background-position: 50% 50%; - background-repeat: no-repeat; - background-size: cover; -} - -.merch-card div[class$="-ribbon"] { - position: absolute; - top: 16px; - right: 0; - font-size: var(--type-heading-xxs-size); - font-weight: 500; - max-width: 150px; - line-height: 16px; - text-align: center; - padding: 8px 11px; - border-radius: 5px 0 0 5px; -} - -.merch-card .consonant-SpecialOffers-ribbon { - text-transform: uppercase; -} - -.merch-card .consonant-SpecialOffers-inner, -.merch-card .consonant-PlansCard-inner { - justify-content: center; - height: 100%; -} - -.merch-card.special-offers .consonant-SpecialOffers-description p, -.merch-card.special-offers .consonant-PlansCard-description p { - font-size: var(--type-body-xs-size); -} - -.merch-card .consonant-SpecialOffers-description em, -.merch-card .consonant-PlansCard-description em { - color: var(--color-gray-600); -} - -.merch-card.special-offers h4 { - font-size: var(--type-body-xxs-size); - text-transform: uppercase; - letter-spacing: 1px; -} - -.merch-card .checkbox-container { - cursor: pointer; - margin-bottom: var(--spacing-xs); -} - -.merch-card .checkbox-container, -.merch-card .secure-transaction-wrapper { +main > div[class*="-merch-card"], +main > div[class*="-merch-cards"] { display: grid; - grid-template-columns: 12px auto; - gap: var(--spacing-xxs); -} - -.merch-card .checkbox-label, -.merch-card .secure-transaction-label { - font-size: var(--type-body-xxs-size); - line-height: 1.3; - color: var(--color-gray-600); -} - -.merch-card .secure-transaction-icon { - height: 15px; - width: 12px; - background: url('/libs/img/ui/secure-transaction.svg') no-repeat left center; -} - -.merch-card .secure-transaction-label { - white-space: nowrap; -} - -.merch-card .checkbox-container input[type="checkbox"] { - display: none; } -.merch-card .checkbox-container .checkmark { - position: relative; - display: inline-block; - width: 12px; - height: 12px; - border: 2px solid #757575; - background: #fff; - border-radius: 2px; - cursor: pointer; - margin-top: 2px; -} - -.merch-card .checkbox-container input[type="checkbox"]:checked + .checkmark { - background-color: var(--color-accent); - background-image: url('/libs/img/ui/checkmark-white-small.svg'); - border-color: var(--color-accent); -} - -.merch-card.has-divider hr { - margin: var(--spacing-xxs) 0; -} - -.merch-card.has-divider .consonant-CardFooter hr { - display: none; -} - -.merch-card.background-opacity-70 { - background-color: rgba(255 255 255 / 70%); -} - -.merch-card.background-opacity-70 div[class$="-inner"] { - background-color: transparent; -} - -.merch-card.inline-heading .consonant-SegmentBlade-inner { - display: grid; - column-gap: 12px; - align-items: center; - grid-template-columns: 40px 1fr; -} - -.merch-card ul[class$="-list"] { - list-style: none; - margin: 0; - padding-left: var(--spacing-xxs); - font-size: var(--type-body-xxs-size); - line-height: 1.5; - color: var(--color-black); -} - -.merch-card li[class$="-list-item"] { - position: relative; -} - -.merch-card li[class$="-list-item"]::before { - content: "\B7"; - position: absolute; - left: -0.4em; - font-size: 1.5em; - top: calc(0.5 * 1.5 * var(--type-body-xxs-size) - 0.05em); - transform: translateY(-50%); -} - -.merch-card.inline-heading .consonant-SegmentBlade-description, -.merch-card.inline-heading .consonant-CardFooter { - grid-column: span 2; -} - -.merch-card.special-offers .consonant-CardFooter { - margin-top: 0; - padding-top: 0; - justify-content: center; - box-sizing: border-box; - align-self: flex-end; + div[class*="-merch-card"] > div, + div[class*="-merch-cards"] > div { width: 100%; + grid-column: 1 / -1; } -.merch-card .consonant-CardFooter .standard-wrapper { - display: flex; - flex-wrap: wrap; - gap: var(--spacing-xs); - align-items: center; -} - -.merch-card .consonant-CardFooter-row, -.merch-card .consonant-CardFooter-cell { - display: flex; - gap: var(--spacing-xs); - flex-wrap: wrap; - margin-left: auto; - height: auto; - width: auto; -} - -.dark .merch-card .consonant-CardFooter .con-button.outline { - border-color: var(--color-black); - color: var(--color-black); -} - -.merch-card .consonant-CardFooter-row .button--inactive { +div[data-removed-manifest-id] { display: none; } diff --git a/libs/blocks/merch-card/merch-card.js b/libs/blocks/merch-card/merch-card.js index ae6a9d2bb1..cee17afe0b 100644 --- a/libs/blocks/merch-card/merch-card.js +++ b/libs/blocks/merch-card/merch-card.js @@ -1,184 +1,205 @@ -/* eslint-disable prefer-destructuring */ import { decorateButtons, decorateBlockHrs } from '../../utils/decorate.js'; -import { loadStyle, getConfig, createTag } from '../../utils/utils.js'; -import { addBackgroundImg, addWrapper, addFooter } from '../card/cardUtils.js'; +import { createTag, getConfig } from '../../utils/utils.js'; +import { getUpFromSectionMetadata } from '../card/cardUtils.js'; +import { decorateLinkAnalytics } from '../../martech/attributes.js'; import { replaceKey } from '../../features/placeholders.js'; +import '../../deps/commerce.js'; +import '../../deps/merch-card.js'; +import { getMetadata } from '../section-metadata/section-metadata.js'; -const { miloLibs, codeRoot } = getConfig(); -const base = miloLibs || codeRoot; +const CARD_TYPES = ['segment', 'special-offers', 'plans', 'catalog', 'product', 'inline-heading']; +const MERCH_CARD_GRIDS = ['one-merch-card', 'two-merch-cards', 'three-merch-cards', 'four-merch-cards']; -const SEGMENT_BLADE = 'SegmentBlade'; -const SPECIAL_OFFERS = 'SpecialOffers'; -const PLANS_CARD = 'PlansCard'; -const cardTypes = { - segment: SEGMENT_BLADE, - 'special-offers': SPECIAL_OFFERS, - plans: PLANS_CARD, -}; -const getPodType = (styles) => { - const authoredType = styles?.find((style) => style in cardTypes); - return cardTypes[authoredType] || SEGMENT_BLADE; +const textStyles = { + H5: 'detail-m', + H4: 'body-xxs', + H3: 'heading-xs', + H2: 'heading-m', }; -const decorateFooter = (el, altCtaMetaData, cardType) => { - const cardFooter = el.querySelector('.consonant-CardFooter'); - const decorateWithSecureTransactionSign = () => { - const secureTransactionWrapper = createTag('div', { class: 'secure-transaction-wrapper' }); - const label = createTag('span', { class: 'secure-transaction-label' }); - const secureElement = createTag('span', { class: 'secure-transaction-icon' }); - secureTransactionWrapper.append(secureElement, label); - replaceKey('secure-transaction', getConfig()).then((replacedKey) => { - label.textContent = replacedKey; - }); - return secureTransactionWrapper; - }; +const getPodType = (styles) => styles?.find((style) => CARD_TYPES.includes(style)); - const createCheckbox = (checkBoxText) => { - const container = createTag('label', { class: 'checkbox-container' }); - const input = createTag('input', { id: 'alt-cta', type: 'checkbox' }); - const checkmark = createTag('span', { class: 'checkmark' }); - const label = createTag('span', { class: 'checkbox-label' }, checkBoxText.innerHTML); - container.append(input, checkmark, label); - return container; - }; +const checkBoxLabel = (ctas, altCtaMetaData) => { + const altCtaRegex = /href=".*"/; + if (!altCtaRegex.test(altCtaMetaData[1]?.innerHTML)) return null; + const allButtons = ctas.querySelectorAll('a'); + const originalCtaButton = allButtons[allButtons.length - 1]; + const altCtaButtonData = altCtaMetaData[1]; + const altCtaButton = createTag('a', { class: [...originalCtaButton.classList, 'alt-cta', 'button--inactive'].join(' ') }, altCtaButtonData.textContent); + originalCtaButton.classList.add('active'); + decorateButtons(altCtaButton); + ctas.appendChild(altCtaButton); + return altCtaMetaData[0].textContent; +}; - const createSecureSign = () => { - const cardFooterRow = el.querySelector('.consonant-CardFooter-row'); - const standardWrapper = createTag('div', { class: 'standard-wrapper' }); - const secureTransactionWrapper = decorateWithSecureTransactionSign(); - standardWrapper.append(secureTransactionWrapper, cardFooterRow); - cardFooter?.append(standardWrapper); - }; +const isHeadingTag = (tagName) => /^H[1-5]$/.test(tagName); +const isParagraphTag = (tagName) => tagName === 'P'; - const decorateAlternativeCta = () => { - const altCtaRegex = /href=".*"/; - if (!altCtaRegex.test(altCtaMetaData[1]?.innerHTML)) return; - const cardFooterRow = el.querySelector('.consonant-CardFooter-row'); - const originalCtaButton = cardFooterRow.querySelector('.consonant-CardFooter-cell--right'); - const checkboxContainer = createCheckbox(altCtaMetaData[0]); - const altCtaButtonData = altCtaMetaData[1]; - decorateButtons(altCtaButtonData); - const altCtaButton = createTag('div', { class: originalCtaButton.classList }, altCtaButtonData.innerHTML); - altCtaButton.classList.add('button--inactive'); - checkboxContainer.querySelector('input[type="checkbox"]').addEventListener('change', ({ target: { checked } }) => { - originalCtaButton.classList.toggle('button--inactive', checked); - altCtaButton.classList.toggle('button--inactive', !checked); - }); - cardFooterRow.append(altCtaButton); - cardFooter.prepend(checkboxContainer); - altCtaMetaData[0].parentNode.remove(); - }; - if (altCtaMetaData !== null) decorateAlternativeCta(); - if (el.classList.contains('secure')) createSecureSign(); - cardFooter.querySelectorAll('.consonant-CardFooter-cell').forEach((cell) => cell.classList.add(`consonant-${cardType}-cell`)); +const createAndAppendTag = (tagName, attributes, content, parent) => { + const newTag = createTag(tagName, attributes, content); + parent.append(newTag); + return newTag; }; -const addInner = (el, altCta, cardType, merchCard) => { +const parseContent = (el, altCta, cardType, merchCard) => { const innerElements = [...el.querySelectorAll('h1, h2, h3, h4, h5, h6, p, ul')]; - const styles = [...el.classList]; - const merch = styles.includes('merch-card'); - const pElement = merch && el.querySelector(':scope > div > div > p:last-of-type'); - const links = pElement ? pElement.querySelectorAll('a') : el.querySelectorAll('a'); - const list = el.querySelector('ul'); - - const inner = el.querySelector(':scope > div:not([class])'); - inner.classList.add(`consonant-${cardType}-inner`); + const bodySlot = createTag('div', { slot: 'body-xs' }); innerElements.forEach((element) => { - if (element.tagName.match(/^H[1-6]$/)) element.classList.add(`consonant-${cardType}-title`); - if (element.tagName.match(/^P$/)) element.classList.add(`consonant-${cardType}-description`); - if (element.tagName.match(/^UL$/)) { - list.classList.add(`consonant-${cardType}-list`); - list.querySelectorAll('li').forEach((li) => li.classList.add(`consonant-${cardType}-list-item`)); + const { tagName } = element; + if (isHeadingTag(tagName)) { + createAndAppendTag(tagName, { slot: textStyles[tagName] }, element.innerHTML, merchCard); + return; + } + if (isParagraphTag(tagName)) { + bodySlot.append(element); } }); - - inner.append(...innerElements); - addFooter(links, inner, cardType !== PLANS_CARD); - decorateFooter(el, altCta, cardType); - merchCard.append(inner); + merchCard.append(bodySlot); }; -const decorateRibbon = (el, ribbonMetadata, cardType) => { +const returnRibbonStyle = (ribbonMetadata) => { const ribbonStyleRegex = /^#[0-9a-fA-F]+, #[0-9a-fA-F]+$/; - if (!ribbonStyleRegex.test(ribbonMetadata[0]?.innerText)) return; - const ribbonStyle = ribbonMetadata[0].innerText; - const [ribbonBgColor, ribbonTextColor] = ribbonStyle.split(', '); + if (!ribbonStyleRegex.test(ribbonMetadata[0]?.innerText)) return null; + const style = ribbonMetadata[0].innerText; + const badgeBackgroundColor = style.split(',')[0].trim(); + const badgeColor = style.split(',')[1].trim(); const ribbonWrapper = ribbonMetadata[0].parentNode; - const ribbon = ribbonMetadata[1]; - ribbon.classList.add(`consonant-${cardType}-ribbon`); - const borderStyle = `1px solid ${ribbonBgColor}`; - if (el.classList.contains('evergreen')) { - ribbon.style.border = borderStyle; - ribbon.style.borderRight = 'none'; - } else { - ribbon.style.backgroundColor = ribbonBgColor; - el.style.border = borderStyle; - } - ribbon.style.color = ribbonTextColor; - const picture = el.querySelector(`.consonant-${cardType}-img`); - if (picture) { - picture.insertAdjacentElement('afterend', ribbon); - } else { - el.insertAdjacentElement('beforeend', ribbon); - } + const badgeText = ribbonMetadata[1].innerText; ribbonWrapper.remove(); + return { badgeBackgroundColor, badgeColor, badgeText }; }; -const decorateIcon = (el, icons, cardType) => { - if (!icons) return; - const inner = el.querySelector(`.consonant-${cardType}-inner`); - const iconWrapper = createTag('div', { class: `consonant-${cardType}-iconWrapper` }); - icons?.forEach((icon) => { - const url = icon.querySelector('img').src; - const iconDiv = createTag('div', { class: 'consonant-MerchCard-ProductIcon', style: `background-image: url(${url})` }); - iconWrapper.appendChild(iconDiv); - icon.parentNode?.remove(); - }); - inner.prepend(iconWrapper); +const getActionMenuContent = (el, ribbonMetadata) => { + const index = ribbonMetadata !== null ? 1 : 0; + const expectedChildren = ribbonMetadata !== null ? 3 : 2; + if (el.childElementCount !== expectedChildren) { + return null; + } + const actionMenuContentWrapper = el.children[index]; + const actionMenuContent = actionMenuContentWrapper.children[0]; + actionMenuContentWrapper.remove(); + return actionMenuContent; }; +function getMerchCardRows(rows, ribbonMetadata, cardType, actionMenuContent) { + const index = ribbonMetadata === null ? 0 : 1; + if (cardType === 'catalog') { + return actionMenuContent !== null ? rows[index + 1] : rows[index]; + } + return rows[index]; +} + +function addMerchCardGridsIfMissing(section) { + let styleClasses = []; + const el = section.querySelector('.section-metadata'); + if (el) { + const metadata = getMetadata(el); + styleClasses = metadata?.style?.text?.split(',').map((token) => token.split(' ').join('-')) ?? []; + } + if (!MERCH_CARD_GRIDS.some((styleClass) => styleClasses.includes(styleClass))) { + section.classList.add('three-merch-cards'); + } +} + const init = (el) => { - loadStyle(`${base}/deps/caas.css`); - const section = el.closest('.section'); - section.classList.add('milo-card-section'); - const images = el.querySelectorAll('picture'); - let image; - const icons = []; - const rows = el.querySelectorAll(':scope > *'); - const ribbonMetadata = rows[0].children?.length === 2 ? rows[0].children : null; - const row = rows[ribbonMetadata === null ? 0 : 1]; - const altCta = rows[rows.length - 1].children?.length === 2 - ? rows[rows.length - 1].children : null; - const allPElems = row.querySelectorAll('p'); - const ctas = allPElems[allPElems.length - 1]; - const styles = [...el.classList]; - const cardType = getPodType(styles); - const merchCard = el; - decorateBlockHrs(el); - images.forEach((img) => { - const imgNode = img.querySelector('img'); - const { width, height } = imgNode; - const isSquare = Math.abs(width - height) <= 10; - if (img) { - if (isSquare) { - icons.push(img); - } else { - image = img; + let section = el.closest('.section'); + const upClass = getUpFromSectionMetadata(section); + if (upClass) { + import('./legacy-merch-card.js') + .then((module) => { + module.initLegacyMerchCard(el); + }); + } else { + if (section.parentElement.classList.contains('fragment')) { + const fragment = section.parentElement; + const fragmentParent = fragment.parentElement; + section.style.display = 'contents'; + fragment.style.display = 'contents'; + fragmentParent.style.display = 'contents'; + section = fragmentParent.parentElement; + } + addMerchCardGridsIfMissing(section); + const headings = el.querySelectorAll('h1, h2, h3, h4, h5, h6'); + decorateLinkAnalytics(el, headings); + const images = el.querySelectorAll('picture'); + let image; + const icons = []; + const rows = el.querySelectorAll(':scope > *'); + const styles = [...el.classList]; + const cardType = getPodType(styles); + const ribbonMetadata = rows[0].children?.length === 2 ? rows[0].children : null; + const actionMenuContent = cardType === 'catalog' ? getActionMenuContent(el, ribbonMetadata) : null; + const row = getMerchCardRows(rows, ribbonMetadata, cardType, actionMenuContent); + const altCta = rows[rows.length - 1].children?.length === 2 + ? rows[rows.length - 1].children : null; + const allPElems = row.querySelectorAll('p'); + const ctas = allPElems[allPElems.length - 1]; + images.forEach((img) => { + const imgNode = img.querySelector('img'); + const { width, height } = imgNode; + const isSquare = Math.abs(width - height) <= 10; + if (img) { + if (isSquare) { + icons.push(img); + } else { + image = img; + } + } + }); + + const merchCard = createTag('merch-card', { class: el.className, variant: cardType }); + if (ribbonMetadata !== null) { + const badge = returnRibbonStyle(ribbonMetadata); + if (badge !== null) { + merchCard.setAttribute('badge-background-color', badge.badgeBackgroundColor); + merchCard.setAttribute('badge-color', badge.badgeColor); + merchCard.setAttribute('badge-text', badge.badgeText); } } - }); - addWrapper(el, section, cardType); - merchCard.classList.add('consonant-Card', 'consonant-ProductCard', `consonant-${cardType}`); - if (image) addBackgroundImg(image, cardType, merchCard); - if (ribbonMetadata !== null) decorateRibbon(el, ribbonMetadata, cardType); - image?.parentElement.remove(); - if (ctas) decorateButtons(ctas); - addInner(el, altCta, cardType, merchCard); - decorateIcon(el, icons, cardType); - const inner = el.querySelector(`.consonant-${cardType}-inner`); - const innerCleanup = inner.querySelectorAll(':scope > div')[1]; - if (innerCleanup.classList.length === 0) innerCleanup.remove(); + if (actionMenuContent !== null) { + merchCard.setAttribute('action-menu', true); + merchCard.append(createTag('div', { slot: 'action-menu-content' }, actionMenuContent.innerHTML)); + } + if (ctas) { + const footer = createTag('div', { slot: 'footer' }); + decorateButtons(ctas); + footer.append(ctas); + merchCard.appendChild(footer); + } + if (image !== undefined) { + const imageSlot = createTag('div', { slot: 'bg-image' }); + imageSlot.appendChild(image); + merchCard.appendChild(imageSlot); + } + if (!icons || icons.length > 0) { + const iconImgs = Array.from(icons).map((icon) => { + const img = { + src: icon.querySelector('img').src, + alt: icon.querySelector('img').alt, + }; + return img; + }); + merchCard.setAttribute('icons', JSON.stringify(Array.from(iconImgs))); + icons.forEach((icon) => icon.remove()); + } + if (styles.includes('secure')) { + replaceKey('secure-transaction', getConfig()) + .then((key) => merchCard.setAttribute('secure-label', key)); + } + if (altCta) { + const label = checkBoxLabel(ctas, altCta); + if (label !== null) { + merchCard.setAttribute('checkbox-label', label); + } + } + parseContent(el, altCta, cardType, merchCard); + decorateBlockHrs(merchCard); + if (merchCard.classList.contains('has-divider')) { + merchCard.setAttribute('custom-hr', true); + } + el.replaceWith(merchCard); + } }; export default init; diff --git a/libs/blocks/table/table.css b/libs/blocks/table/table.css index b44b512acb..2a72c62c71 100644 --- a/libs/blocks/table/table.css +++ b/libs/blocks/table/table.css @@ -87,9 +87,10 @@ /* heading */ .table .row-heading .col-heading.hidden { - border-top: none; - border-left: none; - border-right: none; + border-top: none !important; + border-left: none !important; + border-right: none !important; + border-radius: 0 !important; } .table .row-heading .col-heading:last-child { @@ -247,6 +248,45 @@ border-color: transparent; } +/* rtl */ +[dir="rtl"] .table .col { + border-right: 1px var(--border-color) solid; + border-left: 0; +} + +[dir="rtl"] .table.merch .col { + border-left: 1px var(--border-color) solid; +} + +[dir="rtl"] .table .col:first-child { + border-right: 1px var(--border-color) solid; +} + +[dir="rtl"] .table .col:last-child:not(.hover) { + border-left: 1px var(--border-color) solid; +} + +[dir="rtl"] .table .row-heading .col-heading:last-child { + border-top-right-radius: 0; + border-top-left-radius: 16px; +} + +[dir="rtl"] .table .row-heading .col-heading.top-left-rounded { + border-top-right-radius: 16px; + border-top-left-radius: 0; +} + +[dir="rtl"] .table .row-heading .col-heading.top-right-rounded { + border-top-left-radius: 16px; + border-top-right-radius: 0; +} + +[dir="rtl"] .table .row-heading .col.no-rounded { + border-top-left-radius: 0; + border-top-right-radius: 0; +} + + /* hover */ @media (min-width: 900px) { .table .col.hover { diff --git a/libs/deps/lit-all.min.js b/libs/deps/lit-all.min.js new file mode 100644 index 0000000000..00265df79e --- /dev/null +++ b/libs/deps/lit-all.min.js @@ -0,0 +1,278 @@ +var Z=window,J=Z.ShadowRoot&&(Z.ShadyCSS===void 0||Z.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,ut=Symbol(),Tt=new WeakMap,I=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==ut)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(J&&t===void 0){let i=e!==void 0&&e.length===1;i&&(t=Tt.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&Tt.set(e,t))}return t}toString(){return this.cssText}},Rt=s=>new I(typeof s=="string"?s:s+"",void 0,ut),le=(s,...t)=>{let e=s.length===1?s[0]:t.reduce((i,r,o)=>i+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+s[o+1],s[0]);return new I(e,s,ut)},pt=(s,t)=>{J?s.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet):t.forEach(e=>{let i=document.createElement("style"),r=Z.litNonce;r!==void 0&&i.setAttribute("nonce",r),i.textContent=e.cssText,s.appendChild(i)})},Q=J?s=>s:s=>s instanceof CSSStyleSheet?(t=>{let e="";for(let i of t.cssRules)e+=i.cssText;return Rt(e)})(s):s;var ft,X=window,Ut=X.trustedTypes,ae=Ut?Ut.emptyScript:"",kt=X.reactiveElementPolyfillSupport,vt={toAttribute(s,t){switch(t){case Boolean:s=s?ae:null;break;case Object:case Array:s=s==null?s:JSON.stringify(s)}return s},fromAttribute(s,t){let e=s;switch(t){case Boolean:e=s!==null;break;case Number:e=s===null?null:Number(s);break;case Object:case Array:try{e=JSON.parse(s)}catch{e=null}}return e}},Nt=(s,t)=>t!==s&&(t==t||s==s),mt={attribute:!0,type:String,converter:vt,reflect:!1,hasChanged:Nt},$t="finalized",C=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(t){var e;this.finalize(),((e=this.h)!==null&&e!==void 0?e:this.h=[]).push(t)}static get observedAttributes(){this.finalize();let t=[];return this.elementProperties.forEach((e,i)=>{let r=this._$Ep(i,e);r!==void 0&&(this._$Ev.set(r,i),t.push(r))}),t}static createProperty(t,e=mt){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){let i=typeof t=="symbol"?Symbol():"__"+t,r=this.getPropertyDescriptor(t,i,e);r!==void 0&&Object.defineProperty(this.prototype,t,r)}}static getPropertyDescriptor(t,e,i){return{get(){return this[e]},set(r){let o=this[t];this[e]=r,this.requestUpdate(t,o,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||mt}static finalize(){if(this.hasOwnProperty($t))return!1;this[$t]=!0;let t=Object.getPrototypeOf(this);if(t.finalize(),t.h!==void 0&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){let e=this.properties,i=[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e)];for(let r of i)this.createProperty(r,e[r])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let i=new Set(t.flat(1/0).reverse());for(let r of i)e.unshift(Q(r))}else t!==void 0&&e.push(Q(t));return e}static _$Ep(t,e){let i=e.attribute;return i===!1?void 0:typeof i=="string"?i:typeof t=="string"?t.toLowerCase():void 0}_$Eu(){var t;this._$E_=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(t=this.constructor.h)===null||t===void 0||t.forEach(e=>e(this))}addController(t){var e,i;((e=this._$ES)!==null&&e!==void 0?e:this._$ES=[]).push(t),this.renderRoot!==void 0&&this.isConnected&&((i=t.hostConnected)===null||i===void 0||i.call(t))}removeController(t){var e;(e=this._$ES)===null||e===void 0||e.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach((t,e)=>{this.hasOwnProperty(e)&&(this._$Ei.set(e,this[e]),delete this[e])})}createRenderRoot(){var t;let e=(t=this.shadowRoot)!==null&&t!==void 0?t:this.attachShadow(this.constructor.shadowRootOptions);return pt(e,this.constructor.elementStyles),e}connectedCallback(){var t;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$ES)===null||t===void 0||t.forEach(e=>{var i;return(i=e.hostConnected)===null||i===void 0?void 0:i.call(e)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$ES)===null||t===void 0||t.forEach(e=>{var i;return(i=e.hostDisconnected)===null||i===void 0?void 0:i.call(e)})}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$EO(t,e,i=mt){var r;let o=this.constructor._$Ep(t,i);if(o!==void 0&&i.reflect===!0){let n=(((r=i.converter)===null||r===void 0?void 0:r.toAttribute)!==void 0?i.converter:vt).toAttribute(e,i.type);this._$El=t,n==null?this.removeAttribute(o):this.setAttribute(o,n),this._$El=null}}_$AK(t,e){var i;let r=this.constructor,o=r._$Ev.get(t);if(o!==void 0&&this._$El!==o){let n=r.getPropertyOptions(o),a=typeof n.converter=="function"?{fromAttribute:n.converter}:((i=n.converter)===null||i===void 0?void 0:i.fromAttribute)!==void 0?n.converter:vt;this._$El=o,this[o]=a.fromAttribute(e,n.type),this._$El=null}}requestUpdate(t,e,i){let r=!0;t!==void 0&&(((i=i||this.constructor.getPropertyOptions(t)).hasChanged||Nt)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),i.reflect===!0&&this._$El!==t&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(t,i))):r=!1),!this.isUpdatePending&&r&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach((r,o)=>this[o]=r),this._$Ei=void 0);let e=!1,i=this._$AL;try{e=this.shouldUpdate(i),e?(this.willUpdate(i),(t=this._$ES)===null||t===void 0||t.forEach(r=>{var o;return(o=r.hostUpdate)===null||o===void 0?void 0:o.call(r)}),this.update(i)):this._$Ek()}catch(r){throw e=!1,this._$Ek(),r}e&&this._$AE(i)}willUpdate(t){}_$AE(t){var e;(e=this._$ES)===null||e===void 0||e.forEach(i=>{var r;return(r=i.hostUpdated)===null||r===void 0?void 0:r.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){this._$EC!==void 0&&(this._$EC.forEach((e,i)=>this._$EO(i,this[i],e)),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}};C[$t]=!0,C.elementProperties=new Map,C.elementStyles=[],C.shadowRootOptions={mode:"open"},kt?.({ReactiveElement:C}),((ft=X.reactiveElementVersions)!==null&&ft!==void 0?ft:X.reactiveElementVersions=[]).push("1.6.3");var _t,F=window,O=F.trustedTypes,Ht=O?O.createPolicy("lit-html",{createHTML:s=>s}):void 0,tt="$lit$",b=`lit$${(Math.random()+"").slice(9)}$`,At="?"+b,ce=`<${At}>`,U=document,j=()=>U.createComment(""),q=s=>s===null||typeof s!="object"&&typeof s!="function",Bt=Array.isArray,jt=s=>Bt(s)||typeof s?.[Symbol.iterator]=="function",yt=`[ +\f\r]`,B=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Ot=/-->/g,Mt=/>/g,T=RegExp(`>|${yt}(?:([^\\s"'>=/]+)(${yt}*=${yt}*(?:[^ +\f\r"'\`<>=]|("|')|))|$)`,"g"),Dt=/'/g,Lt=/"/g,qt=/^(?:script|style|textarea|title)$/i,Gt=s=>(t,...e)=>({_$litType$:s,strings:t,values:e}),Se=Gt(1),be=Gt(2),p=Symbol.for("lit-noChange"),u=Symbol.for("lit-nothing"),Vt=new WeakMap,R=U.createTreeWalker(U,129,null,!1);function zt(s,t){if(!Array.isArray(s)||!s.hasOwnProperty("raw"))throw Error("invalid template strings array");return Ht!==void 0?Ht.createHTML(t):t}var Kt=(s,t)=>{let e=s.length-1,i=[],r,o=t===2?"":"",n=B;for(let a=0;a"?(n=r??B,m=-1):d[1]===void 0?m=-2:(m=n.lastIndex-d[2].length,c=d[1],n=d[3]===void 0?T:d[3]==='"'?Lt:Dt):n===Lt||n===Dt?n=T:n===Ot||n===Mt?n=B:(n=T,r=void 0);let v=n===T&&s[a+1].startsWith("/>")?" ":"";o+=n===B?l+ce:m>=0?(i.push(c),l.slice(0,m)+tt+l.slice(m)+b+v):l+b+(m===-2?(i.push(void 0),a):v)}return[zt(s,o+(s[e]||"")+(t===2?"":"")),i]},G=class s{constructor({strings:t,_$litType$:e},i){let r;this.parts=[];let o=0,n=0,a=t.length-1,l=this.parts,[c,d]=Kt(t,e);if(this.el=s.createElement(c,i),R.currentNode=this.el.content,e===2){let m=this.el.content,h=m.firstChild;h.remove(),m.append(...h.childNodes)}for(;(r=R.nextNode())!==null&&l.length0){r.textContent=O?O.emptyScript:"";for(let v=0;v2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=u}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,r){let o=this.strings,n=!1;if(o===void 0)t=k(this,t,e,0),n=!q(t)||t!==this._$AH&&t!==p,n&&(this._$AH=t);else{let a=t,l,c;for(t=o[0],l=0;l{var i,r;let o=(i=e?.renderBefore)!==null&&i!==void 0?i:t,n=o._$litPart$;if(n===void 0){let a=(r=e?.renderBefore)!==null&&r!==void 0?r:null;o._$litPart$=n=new M(t.insertBefore(j(),a),a,void 0,e??{})}return n._$AI(s),n};var gt,xt,Re=C,D=class extends C{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,e;let i=super.createRenderRoot();return(t=(e=this.renderOptions).renderBefore)!==null&&t!==void 0||(e.renderBefore=i.firstChild),i}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=nt(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)===null||t===void 0||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)===null||t===void 0||t.setConnected(!1)}render(){return p}};D.finalized=!0,D._$litElement$=!0,(gt=globalThis.litElementHydrateSupport)===null||gt===void 0||gt.call(globalThis,{LitElement:D});var Yt=globalThis.litElementPolyfillSupport;Yt?.({LitElement:D});var Ue={_$AK:(s,t,e)=>{s._$AK(t,e)},_$AL:s=>s._$AL};((xt=globalThis.litElementVersions)!==null&&xt!==void 0?xt:globalThis.litElementVersions=[]).push("3.3.3");var Oe=!1;var{I:de}=Wt,Jt=s=>s===null||typeof s!="object"&&typeof s!="function",qe={HTML:1,SVG:2},Ct=(s,t)=>t===void 0?s?._$litType$!==void 0:s?._$litType$===t,Qt=s=>{var t;return((t=s?._$litType$)===null||t===void 0?void 0:t.h)!=null},Ge=s=>s?._$litDirective$!==void 0,ze=s=>s?._$litDirective$,lt=s=>s.strings===void 0,Zt=()=>document.createComment(""),x=(s,t,e)=>{var i;let r=s._$AA.parentNode,o=t===void 0?s._$AB:t._$AA;if(e===void 0){let n=r.insertBefore(Zt(),o),a=r.insertBefore(Zt(),o);e=new de(n,a,s,s.options)}else{let n=e._$AB.nextSibling,a=e._$AM,l=a!==s;if(l){let c;(i=e._$AQ)===null||i===void 0||i.call(e,s),e._$AM=s,e._$AP!==void 0&&(c=s._$AU)!==a._$AU&&e._$AP(c)}if(n!==o||l){let c=e._$AA;for(;c!==n;){let d=c.nextSibling;r.insertBefore(c,o),c=d}}}return e},E=(s,t,e=s)=>(s._$AI(t,e),s),ue={},w=(s,t=ue)=>s._$AH=t,z=s=>s._$AH,at=s=>{var t;(t=s._$AP)===null||t===void 0||t.call(s,!1,!0);let e=s._$AA,i=s._$AB.nextSibling;for(;e!==i;){let r=e.nextSibling;e.remove(),e=r}},ct=s=>{s._$AR()};var _={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},f=s=>(...t)=>({_$litDirective$:s,values:t}),$=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};var K=(s,t)=>{var e,i;let r=s._$AN;if(r===void 0)return!1;for(let o of r)(i=(e=o)._$AO)===null||i===void 0||i.call(e,t,!1),K(o,t);return!0},ht=s=>{let t,e;do{if((t=s._$AM)===void 0)break;e=t._$AN,e.delete(s),s=t}while(e?.size===0)},Xt=s=>{for(let t;t=s._$AM;s=t){let e=t._$AN;if(e===void 0)t._$AN=e=new Set;else if(e.has(s))break;e.add(s),me(t)}};function pe(s){this._$AN!==void 0?(ht(this),this._$AM=s,Xt(this)):this._$AM=s}function fe(s,t=!1,e=0){let i=this._$AH,r=this._$AN;if(r!==void 0&&r.size!==0)if(t)if(Array.isArray(i))for(let o=e;o{var t,e,i,r;s.type==_.CHILD&&((t=(i=s)._$AP)!==null&&t!==void 0||(i._$AP=fe),(e=(r=s)._$AQ)!==null&&e!==void 0||(r._$AQ=pe))},P=class extends ${constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,i){super._$AT(t,e,i),Xt(this),this.isConnected=t._$AU}_$AO(t,e=!0){var i,r;t!==this.isConnected&&(this.isConnected=t,t?(i=this.reconnected)===null||i===void 0||i.call(this):(r=this.disconnected)===null||r===void 0||r.call(this)),e&&(K(this,t),ht(this))}setValue(t){if(lt(this._$Ct))this._$Ct._$AI(t,this);else{let e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}};var Ft=async(s,t)=>{for await(let e of s)if(await t(e)===!1)return},L=class{constructor(t){this.G=t}disconnect(){this.G=void 0}reconnect(t){this.G=t}deref(){return this.G}},V=class{constructor(){this.Y=void 0,this.Z=void 0}get(){return this.Y}pause(){var t;(t=this.Y)!==null&&t!==void 0||(this.Y=new Promise(e=>this.Z=e))}resume(){var t;(t=this.Z)===null||t===void 0||t.call(this),this.Y=this.Z=void 0}};var W=class extends P{constructor(){super(...arguments),this._$Cq=new L(this),this._$CK=new V}render(t,e){return p}update(t,[e,i]){if(this.isConnected||this.disconnected(),e===this._$CX)return;this._$CX=e;let r=0,{_$Cq:o,_$CK:n}=this;return Ft(e,async a=>{for(;n.get();)await n.get();let l=o.deref();if(l!==void 0){if(l._$CX!==e)return!1;i!==void 0&&(a=i(a,r)),l.commitValue(a,r),r++}return!0}),p}commitValue(t,e){this.setValue(t)}disconnected(){this._$Cq.disconnect(),this._$CK.pause()}reconnected(){this._$Cq.reconnect(this),this._$CK.resume()}},cs=f(W);var fs=f(class extends W{constructor(s){if(super(s),s.type!==_.CHILD)throw Error("asyncAppend can only be used in child expressions")}update(s,t){return this._$CJ=s,super.update(s,t)}commitValue(s,t){t===0&&ct(this._$CJ);let e=x(this._$CJ);E(e,s)}});var te=s=>Qt(s)?s._$litType$.h:s.strings,Es=f(class extends ${constructor(s){super(s),this.tt=new WeakMap}render(s){return[s]}update(s,[t]){let e=Ct(this.et)?te(this.et):null,i=Ct(t)?te(t):null;if(e!==null&&(i===null||e!==i)){let r=z(s).pop(),o=this.tt.get(e);if(o===void 0){let n=document.createDocumentFragment();o=nt(u,n),o.setConnected(!1),this.tt.set(e,o)}w(o,[r]),x(o,void 0,r)}if(i!==null){if(e===null||e!==i){let r=this.tt.get(i);if(r!==void 0){let o=z(r).pop();ct(s),x(s,void 0,o),w(s,[o])}}this.et=t}else this.et=void 0;return this.render(t)}});var Ts=(s,t,e)=>{for(let i of t)if(i[0]===s)return(0,i[1])();return e?.()};var Os=f(class extends ${constructor(s){var t;if(super(s),s.type!==_.ATTRIBUTE||s.name!=="class"||((t=s.strings)===null||t===void 0?void 0:t.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(s){return" "+Object.keys(s).filter(t=>s[t]).join(" ")+" "}update(s,[t]){var e,i;if(this.it===void 0){this.it=new Set,s.strings!==void 0&&(this.nt=new Set(s.strings.join(" ").split(/\s/).filter(o=>o!=="")));for(let o in t)t[o]&&!(!((e=this.nt)===null||e===void 0)&&e.has(o))&&this.it.add(o);return this.render(t)}let r=s.element.classList;this.it.forEach(o=>{o in t||(r.remove(o),this.it.delete(o))});for(let o in t){let n=!!t[o];n===this.it.has(o)||!((i=this.nt)===null||i===void 0)&&i.has(o)||(n?(r.add(o),this.it.add(o)):(r.remove(o),this.it.delete(o)))}return p}});var ve={},js=f(class extends ${constructor(){super(...arguments),this.st=ve}render(s,t){return t()}update(s,[t,e]){if(Array.isArray(t)){if(Array.isArray(this.st)&&this.st.length===t.length&&t.every((i,r)=>i===this.st[r]))return p}else if(this.st===t)return p;return this.st=Array.isArray(t)?Array.from(t):t,this.render(t,e)}});var Ys=s=>s??u;function*Xs(s,t){let e=typeof t=="function";if(s!==void 0){let i=-1;for(let r of s)i>-1&&(yield e?t(i):t),i++,yield r}}var oi=f(class extends ${constructor(){super(...arguments),this.key=u}render(s,t){return this.key=s,t}update(s,[t,e]){return t!==this.key&&(w(s),this.key=t),e}});var pi=f(class extends ${constructor(s){if(super(s),s.type!==_.PROPERTY&&s.type!==_.ATTRIBUTE&&s.type!==_.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!lt(s))throw Error("`live` bindings can only contain a single expression")}render(s){return s}update(s,[t]){if(t===p||t===u)return t;let e=s.element,i=s.name;if(s.type===_.PROPERTY){if(t===e[i])return p}else if(s.type===_.BOOLEAN_ATTRIBUTE){if(!!t===e.hasAttribute(i))return p}else if(s.type===_.ATTRIBUTE&&e.getAttribute(i)===t+"")return p;return w(s),t}});function*_i(s,t){if(s!==void 0){let e=0;for(let i of s)yield t(i,e++)}}function*xi(s,t,e=1){let i=t===void 0?0:s;t!=null||(t=s);for(let r=i;e>0?rnew St,St=class{},Et=new WeakMap,Ri=f(class extends P{render(s){return u}update(s,[t]){var e;let i=t!==this.G;return i&&this.G!==void 0&&this.ot(void 0),(i||this.rt!==this.lt)&&(this.G=t,this.dt=(e=s.options)===null||e===void 0?void 0:e.host,this.ot(this.lt=s.element)),u}ot(s){var t;if(typeof this.G=="function"){let e=(t=this.dt)!==null&&t!==void 0?t:globalThis,i=Et.get(e);i===void 0&&(i=new WeakMap,Et.set(e,i)),i.get(this.G)!==void 0&&this.G.call(this.dt,void 0),i.set(this.G,s),s!==void 0&&this.G.call(this.dt,s)}else this.G.value=s}get rt(){var s,t,e;return typeof this.G=="function"?(t=Et.get((s=this.dt)!==null&&s!==void 0?s:globalThis))===null||t===void 0?void 0:t.get(this.G):(e=this.G)===null||e===void 0?void 0:e.value}disconnected(){this.rt===this.lt&&this.ot(void 0)}reconnected(){this.ot(this.lt)}});var ee=(s,t,e)=>{let i=new Map;for(let r=t;r<=e;r++)i.set(s[r],r);return i},Li=f(class extends ${constructor(s){if(super(s),s.type!==_.CHILD)throw Error("repeat() can only be used in text expressions")}ct(s,t,e){let i;e===void 0?e=t:t!==void 0&&(i=t);let r=[],o=[],n=0;for(let a of s)r[n]=i?i(a,n):n,o[n]=e(a,n),n++;return{values:o,keys:r}}render(s,t,e){return this.ct(s,t,e).values}update(s,[t,e,i]){var r;let o=z(s),{values:n,keys:a}=this.ct(t,e,i);if(!Array.isArray(o))return this.ut=a,n;let l=(r=this.ut)!==null&&r!==void 0?r:this.ut=[],c=[],d,m,h=0,v=o.length-1,y=0,A=n.length-1;for(;h<=v&&y<=A;)if(o[h]===null)h++;else if(o[v]===null)v--;else if(l[h]===a[y])c[y]=E(o[h],n[y]),h++,y++;else if(l[v]===a[A])c[A]=E(o[v],n[A]),v--,A--;else if(l[h]===a[A])c[A]=E(o[h],n[A]),x(s,c[A+1],o[h]),h++,A--;else if(l[v]===a[y])c[y]=E(o[v],n[y]),x(s,o[h],o[v]),v--,y++;else if(d===void 0&&(d=ee(a,y,A),m=ee(l,h,v)),d.has(l[h]))if(d.has(l[v])){let S=m.get(a[y]),dt=S!==void 0?o[S]:null;if(dt===null){let Pt=x(s,o[h]);E(Pt,n[y]),c[y]=Pt}else c[y]=E(dt,n[y]),x(s,o[h],dt),o[S]=null;y++}else at(o[v]),v--;else at(o[h]),h++;for(;y<=A;){let S=x(s,c[A+1]);E(S,n[y]),c[y++]=S}for(;h<=v;){let S=o[h++];S!==null&&at(S)}return this.ut=a,w(s,c),p}});var se="important",$e=" !"+se,zi=f(class extends ${constructor(s){var t;if(super(s),s.type!==_.ATTRIBUTE||s.name!=="style"||((t=s.strings)===null||t===void 0?void 0:t.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(s){return Object.keys(s).reduce((t,e)=>{let i=s[e];return i==null?t:t+`${e=e.includes("-")?e:e.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`},"")}update(s,[t]){let{style:e}=s.element;if(this.ht===void 0){this.ht=new Set;for(let i in t)this.ht.add(i);return this.render(t)}this.ht.forEach(i=>{t[i]==null&&(this.ht.delete(i),i.includes("-")?e.removeProperty(i):e[i]="")});for(let i in t){let r=t[i];if(r!=null){this.ht.add(i);let o=typeof r=="string"&&r.endsWith($e);i.includes("-")||o?e.setProperty(i,o?r.slice(0,-11):r,o?se:""):e[i]=r}}return p}});var Xi=f(class extends ${constructor(s){if(super(s),s.type!==_.CHILD)throw Error("templateContent can only be used in child bindings")}render(s){return this.vt===s?p:(this.vt=s,document.importNode(s.content,!0))}});var H=class extends ${constructor(t){if(super(t),this.et=u,t.type!==_.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===u||t==null)return this.ft=void 0,this.et=t;if(t===p)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.et)return this.ft;this.et=t;let e=[t];return e.raw=e,this.ft={_$litType$:this.constructor.resultType,strings:e,values:[]}}};H.directiveName="unsafeHTML",H.resultType=1;var or=f(H);var Y=class extends H{};Y.directiveName="unsafeSVG",Y.resultType=2;var dr=f(Y);var ie=s=>!Jt(s)&&typeof s.then=="function",re=1073741823,bt=class extends P{constructor(){super(...arguments),this._$C_t=re,this._$Cwt=[],this._$Cq=new L(this),this._$CK=new V}render(...t){var e;return(e=t.find(i=>!ie(i)))!==null&&e!==void 0?e:p}update(t,e){let i=this._$Cwt,r=i.length;this._$Cwt=e;let o=this._$Cq,n=this._$CK;this.isConnected||this.disconnected();for(let a=0;athis._$C_t);a++){let l=e[a];if(!ie(l))return this._$C_t=a,l;a{for(;n.get();)await n.get();let d=o.deref();if(d!==void 0){let m=d._$Cwt.indexOf(l);m>-1&&mt=>typeof t=="function"?((e,i)=>(customElements.define(e,i),i))(s,t):((e,i)=>{let{kind:r,elements:o}=i;return{kind:r,elements:o,finisher(n){customElements.define(e,n)}}})(s,t);var _e=(s,t)=>t.kind==="method"&&t.descriptor&&!("value"in t.descriptor)?{...t,finisher(e){e.createProperty(t.key,s)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:t.key,initializer(){typeof t.initializer=="function"&&(this[t.key]=t.initializer.call(this))},finisher(e){e.createProperty(t.key,s)}},ye=(s,t,e)=>{t.constructor.createProperty(e,s)};function oe(s){return(t,e)=>e!==void 0?ye(s,t,e):_e(s,t)}function kr(s){return oe({...s,state:!0})}var g=({finisher:s,descriptor:t})=>(e,i)=>{var r;if(i===void 0){let o=(r=e.originalKey)!==null&&r!==void 0?r:e.key,n=t!=null?{kind:"method",placement:"prototype",key:o,descriptor:t(e.key)}:{...e,key:o};return s!=null&&(n.finisher=function(a){s(a,o)}),n}{let o=e.constructor;t!==void 0&&Object.defineProperty(e,i,t(i)),s?.(o,i)}};function Mr(s){return g({finisher:(t,e)=>{Object.assign(t.prototype[e],s)}})}function Vr(s,t){return g({descriptor:e=>{let i={get(){var r,o;return(o=(r=this.renderRoot)===null||r===void 0?void 0:r.querySelector(s))!==null&&o!==void 0?o:null},enumerable:!0,configurable:!0};if(t){let r=typeof e=="symbol"?Symbol():"__"+e;i.get=function(){var o,n;return this[r]===void 0&&(this[r]=(n=(o=this.renderRoot)===null||o===void 0?void 0:o.querySelector(s))!==null&&n!==void 0?n:null),this[r]}}return i}})}function jr(s){return g({descriptor:t=>({get(){var e,i;return(i=(e=this.renderRoot)===null||e===void 0?void 0:e.querySelectorAll(s))!==null&&i!==void 0?i:[]},enumerable:!0,configurable:!0})})}function zr(s){return g({descriptor:t=>({async get(){var e;return await this.updateComplete,(e=this.renderRoot)===null||e===void 0?void 0:e.querySelector(s)},enumerable:!0,configurable:!0})})}var wt,Ae=((wt=window.HTMLSlotElement)===null||wt===void 0?void 0:wt.prototype.assignedElements)!=null?(s,t)=>s.assignedElements(t):(s,t)=>s.assignedNodes(t).filter(e=>e.nodeType===Node.ELEMENT_NODE);function ne(s){let{slot:t,selector:e}=s??{};return g({descriptor:i=>({get(){var r;let o="slot"+(t?`[name=${t}]`:":not([name])"),n=(r=this.renderRoot)===null||r===void 0?void 0:r.querySelector(o),a=n!=null?Ae(n,s):[];return e?a.filter(l=>l.matches(e)):a},enumerable:!0,configurable:!0})})}function Qr(s,t,e){let i,r=s;return typeof s=="object"?(r=s.slot,i=s):i={flatten:t},e?ne({slot:r,flatten:t,selector:e}):g({descriptor:o=>({get(){var n,a;let l="slot"+(r?`[name=${r}]`:":not([name])"),c=(n=this.renderRoot)===null||n===void 0?void 0:n.querySelector(l);return(a=c?.assignedNodes(i))!==null&&a!==void 0?a:[]},enumerable:!0,configurable:!0})})}export{P as AsyncDirective,W as AsyncReplaceDirective,I as CSSResult,$ as Directive,D as LitElement,_ as PartType,C as ReactiveElement,qe as TemplateResultType,H as UnsafeHTMLDirective,bt as UntilDirective,Re as UpdatingElement,Ue as _$LE,Wt as _$LH,pt as adoptStyles,fs as asyncAppend,cs as asyncReplace,Es as cache,Ts as choose,Os as classMap,ct as clearPart,Ti as createRef,le as css,Pr as customElement,vt as defaultConverter,f as directive,Mr as eventOptions,z as getCommittedValue,Q as getCompatibleStyle,ze as getDirectiveClass,js as guard,Se as html,Ys as ifDefined,x as insertPart,Qt as isCompiledTemplateResult,Ge as isDirectiveResult,Jt as isPrimitive,Oe as isServer,lt as isSingleExpression,Ct as isTemplateResult,Xs as join,oi as keyed,pi as live,_i as map,p as noChange,Nt as notEqual,u as nothing,oe as property,Vr as query,jr as queryAll,ne as queryAssignedElements,Qr as queryAssignedNodes,zr as queryAsync,xi as range,Ri as ref,at as removePart,nt as render,Li as repeat,E as setChildPartValue,w as setCommittedValue,kr as state,zi as styleMap,J as supportsAdoptingStyleSheets,be as svg,Xi as templateContent,Rt as unsafeCSS,or as unsafeHTML,dr as unsafeSVG,Ar as until,Er as when}; +/*! Bundled license information: + +@lit/reactive-element/css-tag.js: + (** + * @license + * Copyright 2019 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +@lit/reactive-element/reactive-element.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +lit-html/lit-html.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +lit-element/lit-element.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +lit-html/is-server.js: + (** + * @license + * Copyright 2022 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +lit-html/directive-helpers.js: + (** + * @license + * Copyright 2020 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +lit-html/directive.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +lit-html/async-directive.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +lit-html/directives/private-async-helpers.js: + (** + * @license + * Copyright 2021 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +lit-html/directives/async-replace.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +lit-html/directives/async-append.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +lit-html/directives/cache.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +lit-html/directives/choose.js: + (** + * @license + * Copyright 2021 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +lit-html/directives/class-map.js: + (** + * @license + * Copyright 2018 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +lit-html/directives/guard.js: + (** + * @license + * Copyright 2018 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +lit-html/directives/if-defined.js: + (** + * @license + * Copyright 2018 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +lit-html/directives/join.js: + (** + * @license + * Copyright 2021 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +lit-html/directives/keyed.js: + (** + * @license + * Copyright 2021 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +lit-html/directives/live.js: + (** + * @license + * Copyright 2020 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +lit-html/directives/map.js: + (** + * @license + * Copyright 2021 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +lit-html/directives/range.js: + (** + * @license + * Copyright 2021 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +lit-html/directives/ref.js: + (** + * @license + * Copyright 2020 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +lit-html/directives/repeat.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +lit-html/directives/style-map.js: + (** + * @license + * Copyright 2018 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +lit-html/directives/template-content.js: + (** + * @license + * Copyright 2020 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +lit-html/directives/unsafe-html.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +lit-html/directives/unsafe-svg.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +lit-html/directives/until.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +lit-html/directives/when.js: + (** + * @license + * Copyright 2021 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +@lit/reactive-element/decorators/custom-element.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +@lit/reactive-element/decorators/property.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +@lit/reactive-element/decorators/state.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +@lit/reactive-element/decorators/base.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +@lit/reactive-element/decorators/event-options.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +@lit/reactive-element/decorators/query.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +@lit/reactive-element/decorators/query-all.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +@lit/reactive-element/decorators/query-async.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +@lit/reactive-element/decorators/query-assigned-elements.js: + (** + * @license + * Copyright 2021 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) + +@lit/reactive-element/decorators/query-assigned-nodes.js: + (** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + *) +*/ diff --git a/libs/deps/merch-card.js b/libs/deps/merch-card.js new file mode 100644 index 0000000000..21ed0207c1 --- /dev/null +++ b/libs/deps/merch-card.js @@ -0,0 +1,761 @@ +// Thu, 16 Nov 2023 19:37:46 GMT +import{html as a,LitElement as C}from"./lit-all.min.js";import{css as S,unsafeCSS as b}from"./lit-all.min.js";var p="(max-width: 899px)",l="(min-width: 700px) and (max-width: 1199px)",h="(min-width: 1200px)",x="(min-width: 1440px)";var f=S` + :host { + position: relative; + display: flex; + flex-direction: column; + height: 100%; + flex: 1 1 0; + text-align: left; + border-radius: var(--consonant-merch-spacing-xxxs); + background-color: var(--consonant-merch-card-background-color); + overflow: auto; + grid-template-columns: repeat(auto-fit, minmax(300px, max-content)); + background-color: var(--consonant-merch-card-background-color); + font-family: var(--body-font-family, 'Adobe Clean'); + border-radius: var(--consonant-merch-spacing-xs); + border: 1px solid var(--consonant-merch-card-border-color); + } + + .invisible { + visibility: hidden; + } + + :host(:hover) .invisible { + visibility: visible; + background-image: var(--ellipsis-icon); + cursor: pointer; + } + + slot { + display: block; + } + + .top-section { + display: flex; + justify-content: flex-start; + flex-flow: wrap; + align-items: center; + } + + .top-section > .icons img:last-child { + margin-right: var(--consonant-merch-spacing-xs); + } + + .icons { + display: flex; + width: fit-content; + fle-direction: row; + } + + .icons img { + width: var(--consonant-merch-card-plans-icon-size); + height: var(--consonant-merch-card-plans-icon-size); + margin-right: var(--consonant-merch-spacing-xxs); + } + + .body { + display: flex; + flex-direction: column; + justify-content: flex-start; + height: 100%; + flex-direction: column; + gap: var(--consonant-merch-spacing-xxs); + padding: var(--consonant-merch-spacing-xs); + } + + ::slotted([slot='footer']) { + display: flex; + justify-content: flex-end; + margin-top: auto; + box-sizing: border-box; + align-self: flex-end; + width: 100%; + padding-top: var(--consonant-merch-spacing-xs); + padding-bottom: var(--consonant-merch-spacing-xs); + pading-left: 0; + padding-left: var(--consonant-merch-spacing-xs); + } + + hr { + background-color: var(--color-gray-200); + border: none; + height: 1px; + width: auto; + margin-top: 0; + margin-bottom: 0; + margin-left: var(--consonant-merch-spacing-xs); + margin-right: var(--consonant-merch-spacing-xs); + } + + div[class$='-ribbon'] { + position: absolute; + top: 16px; + right: 0; + font-size: var(--type-heading-xxs-size); + font-weight: 500; + max-width: 150px; + line-height: 16px; + text-align: center; + padding: 8px 11px; + border-radius: 5px 0 0 5px; + } + + .body .catalog-ribbon { + display: flex; + height: fit-content; + flex-direction: column; + width: fit-content; + border-radius: 5px; + position: relative; + top: 0; + margin-left: var(--consonant-merch-spacing-xxs); + } + + .detail-bg-container { + right: 0; + padding: var(--consonant-merch-spacing-xs); + border-radius: 5px; + font-size: var(--consonant-merch-card-body-font-size); + margin: var(--consonant-merch-spacing-xs); + } + + .action-menu { + display: flex; + width: 32px; + height: 32px; + position: absolute; + top: 16px; + right: 16px; + background-color: #f6f6f6; + background-repeat: no-repeat; + background-position: center; + background-size: 16px 16px; + } + .hidden { + visibility: hidden; + } + + .standard-wrapper { + display: flex; + flex-wrap: wrap; + gap: var(--spacing-xs); + align-items: center; + justify-content: space-between; + padding-left: var(--consonant-merch-spacing-xs); + } + + #stock-checkbox, + .secure-transaction-label { + font-size: var(--consonant-merch-card-body-xxs-font-size); + line-height: 1.3; + color: var(--color-gray-600); + } + + #stock-checkbox { + display: inline-flex; + align-items: center; + cursor: pointer; + gap: 10px; /*same as spectrum */ + } + + #stock-checkbox > input { + display: none; + } + + #stock-checkbox > span { + display: inline-block; + box-sizing: border-box; + border: 2px solid rgb(117, 117, 117); + border-radius: 2px; + width: 14px; + height: 14px; + } + + #stock-checkbox > input:checked + span { + background: var(--checkmark-icon) no-repeat var(--color-accent); + border-color: var(--color-accent); + } + + .secure-transaction-label { + white-space: nowrap; + display: inline-flex; + gap: var(--consonant-merch-spacing-xxs); + align-items: center; + } + + .secure-transaction-label::before { + display: inline-block; + content: ''; + width: 12px; + height: 15px; + background: var(--secure-icon) no-repeat; + background-position: center; + background-size: contain; + } + + .checkbox-container { + display: flex; + align-items: center; + gap: var(--consonant-merch-spacing-xxs); + } + + .checkbox-container input[type='checkbox']:checked + .checkmark { + background-color: var(--color-accent); + background-image: var(--checkmark-icon); + border-color: var(--color-accent); + } + + .checkbox-container input[type='checkbox'] { + display: none; + } + + .checkbox-container .checkmark { + position: relative; + display: inline-block; + width: 12px; + height: 12px; + border: 2px solid #757575; + background: #fff; + border-radius: 2px; + cursor: pointer; + margin-top: 2px; + } + + :host([type='super-wide']) { + grid-column: span 4; + } + + :host([type='wide']) { + grid-column: span 2; + } + + :host([variant='special-offers']) { + min-height: 438px; + } + + :host([variant='special-offers'].center) { + text-align: center; + } + + :host([variant='special-offers'].wide) { + grid-column: span 3; + width: auto; + } + + :host([variant='special-offers'].super-wide) { + grid-column: span 3; + width: auto; + } + + /* catalog */ + :host([variant='catalog']) { + min-height: 296px; + } + + :host([variant='catalog'][type='wide']) { + width: auto; + } + + :host([variant='catalog'][type='super-wide']) { + width: auto; + } + + /* Tablet */ + @media screen and ${b(l)} { + } + + /* Laptop */ + @media screen and ${b(h)} { + } +`;var[u,v,y,w]=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"];var k=document.createElement("style");k.innerHTML=` +:root { + + --consonant-merch-card-detail-font-size: 12px; + --consonant-merch-card-detail-font-weight: 500; + --consonant-merch-card-detail-letter-spacing: 0.8px; + --consonant-merch-card-background-color: #fff; + + --consonant-merch-card-heading-font-size: 18px; + --consonant-merch-card-heading-line-height: 22.5px; + --consonant-merch-card-heading-secondary-font-size: 14px; + --consonant-merch-card-body-font-size: 14px; + --consonant-merch-card-body-line-height: 21px; + + /* responsive width */ + --consonant-merch-card-mobile-width: 300px; + + /* spacing */ + --consonant-merch-spacing-xxxs: 4px; + --consonant-merch-spacing-xxs: 8px; + --consonant-merch-spacing-xs: 16px; + --consonant-merch-spacing-s: 24px; + --consonant-merch-spacing-m: 32px; + + /* headings */ + --consonant-merch-card-heading-xs-font-size: 18px; + --consonant-merch-card-heading-xs-line-height: 22.5px; + --consonant-merch-card-heading-s-font-size: 20px; + --consonant-merch-card-heading-s-line-height: 25px; + --consonant-merch-card-heading-m-font-size: 24px; + --consonant-merch-card-heading-m-line-height: 30px; + --consonant-merch-card-heading-l-font-size: 20px; + --consonant-merch-card-heading-l-line-height: 30px; + --consonant-merch-card-heading-xl-font-size: 36px; + --consonant-merch-card-heading-xl-line-height: 45px; + + /* detail */ + --consonant-merch-card-detail-m-font-size: 12px; + --consonant-merch-card-detail-m-line-height: 15px; + --consonant-merch-card-detail-m-font-weight: 700; + --consonant-merch-card-detail-m-letter-spacing: 1px; + + /* body */ + --consonant-merch-card-body-xxs-font-size: 12px; + --consonant-merch-card-body-xxs-line-height: 18px; + --consonant-merch-card-body-xxs-letter-spacing: 1px; + --consonant-merch-card-body-xs-font-size: 14px; + --consonant-merch-card-body-xs-line-height: 21px; + --consonant-merch-card-body-m-font-size: 18px; + --consonant-merch-card-body-m-line-height: 27px; + --consonant-merch-card-body-l-font-size: 20px; + --consonant-merch-card-body-l-line-height: 30px; + --consonant-merch-card-body-xl-font-size: 22px; + --consonant-merch-card-body-xl-line-height: 33px; + + + --consonant-merch-card-heading-padding: 0; + --consonant-merch-card-image-height: 180px; + + /* colors */ + --consonant-merch-card-border-color: #eaeaea; + --color-accent: #1473E6; + --color-black: #000; + --color-grey-80: #2c2c2c; + + /* merch card generic */ + --consonant-merch-card-max-width: 378px; + + /* special offers mobile */ + --consonant-merch-card-special-offer-width: 300px; + + /* special offers */ + --consonant-merch-card-special-offers-width: 378px; + + /* segment */ + --consonant-merch-card-segment-width: 378px; + + /* inline-heading */ + --consonant-merch-card-inline-heading-width: 378px; + + /* plans */ + --consonant-merch-card-plans-max-width: 302px; + --consonant-merch-card-plans-width: 276px; + --consonant-merch-card-plans-icon-size: 40px; + + /* catalog */ + --consonant-merch-card-catalog-width: 276px; + --consonant-merch-card-catalog-icon-size: 40px; + + /* inline SVGs */ + --checkmark-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' viewBox='0 0 10 10'%3E%3Cpath fill='%23fff' d='M3.788 9A.999.999 0 0 1 3 8.615l-2.288-3a1 1 0 1 1 1.576-1.23l1.5 1.991 3.924-4.991a1 1 0 1 1 1.576 1.23l-4.712 6A.999.999 0 0 1 3.788 9z' class='spectrum-UIIcon--medium'/%3E%3C/svg%3E%0A"); + + --secure-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' width='10' height='10' fill='%23757575' viewBox='0 0 12 15'%3E%3Cpath d='M11.5 6H11V5A5 5 0 1 0 1 5v1H.5a.5.5 0 0 0-.5.5v8a.5.5 0 0 0 .5.5h11a.5.5 0 0 0 .5-.5v-8a.5.5 0 0 0-.5-.5ZM3 5a3 3 0 1 1 6 0v1H3Zm4 6.111V12.5a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5v-1.389a1.5 1.5 0 1 1 2 0Z'/%3E%3C/svg%3E"); + + --ellipsis-icon: url('data:image/svg+xml,'); + +} + +merch-cards { + display: contents; +} + +merch-cards > button { + grid-column: 1 / -1; + place-self: baseline; + background-color: transparent; + border-radius: 16px; + border: 2px solid var(--text-color, #2c2c2c); + color: var(--text-color, #2c2c2c); + display: inline-block; + font-size: 15px; + font-style: normal; + font-weight: 700; + line-height: 16px; + padding: 5px 14px; +} + +merch-cards > button:hover { + background-color: var(--color-black, #000); + border-color: var(--color-black, #000); + color: var(--color-white, #fff); +} + +.one-merch-card, +.two-merch-cards, +.three-merch-cards, +.four-merch-cards { + display: grid; + justify-content: center; + justify-items: center; + padding: var(--spacing-m); + gap: var(--spacing-m); +} + + +merch-card[variant="special-offers"] { + width: var(--consonant-merch-card-special-offers-width); +} + +merch-card[variant="segment"] { + width: var(--consonant-merch-card-segment-width); +} + +merch-card[variant="plans"] { + width: var(--consonant-merch-card-plans-width); +} + +merch-card[variant="inline-heading"] { + width: var(--consonant-merch-card-inline-heading-width); +} + +merch-card[variant="catalog"] { + width: var(--consonant-merch-card-catalog-width); +} + +@media screen and ${p} { + :root { + --consonant-merch-card-mobile-width: 300px; + } + .one-merch-card, + .two-merch-cards, + .three-merch-cards, + .four-merch-cards { + grid-template-columns: fit-content(100%); + } + + merch-card[variant="special-offers"].merch-card, + merch-card[variant="segment"].merch-card, + merch-card[variant="plans"].merch-card, + merch-card[variant="catalog"].merch-card, + merch-card[variant="inline-heading"].merch-card { + width: var(--consonant-merch-card-mobile-width); + } +} + +/* Tablet */ +@media screen and ${l} { + :root { + --consonant-merch-card-special-offer-width: 302px; + --consonant-merch-card-catalog-width: 302px; + } + + .two-merch-cards, + .three-merch-cards, + .four-merch-cards { + grid-template-columns: repeat(2, fit-content(100%)); + } + +} + +/* desktop */ +@media screen and ${h} { + :root { + --consonant-merch-card-special-offer-width: 378px; + --consonant-merch-card-catalog-width: 276px; + } + + .three-merch-cards, + .four-merch-cards { + grid-template-columns: repeat(3, fit-content(100%)); + } +} + +/* Large desktop */ + @media screen and ${x} { + :root { + + } + + .four-merch-cards { + grid-template-columns: repeat(4, fit-content(100%)); + } +} + +[class*="-merch-cards"].m-gap { + gap: var(--consonant-merch-spacing-xs); + padding: var(--consonant-merch-spacing-xs); +} + +[class*="-merch-cards"].l-gap { + gap: var(--consonant-merch-spacing-s); + padding: var(--consonant-merch-spacing-s); +} + +[class*="-merch-cards"].xl-gap { + gap: var(--consonant-merch-spacing-m); + padding: var(--consonant-merch-spacing-m); +} + +div[class$='-badge'] { + position: absolute; + top: 16px; + right: 0; + font-size: var(--type-heading-xxs-size); + font-weight: 500; + max-width: 150px; + line-height: 16px; + text-align: center; + padding: 8px 11px; + border-radius: 5px 0 0 5px; +} + +merch-card.background-opacity-70 { + background-color: rgba(255 255 255 / 70%); +} + +merch-card hr { + background-color: var(--color-gray-200); + border: none; + height: 1px; + width: 100%; + margin-bottom: var(--consonant-merch-card-spacing-xs); +} + +merch-card.has-divider hr { + margin-bottom: var(--spacing-xxs); +} + +merch-card[variant="special-offers"] span[is="inline-price"][data-template="priceStrikethrough"] { + font-size: var(--consonant-merch-card-body-xs-font-size); +} + +merch-card p, merch-card h3, merch-card h4 { + margin: 0; +} + +merch-card span[is=inline-price] { + display: inline-block; +} + +merch-card [slot='heading-xs'] { + font-size: var(--consonant-merch-card-heading-xs-font-size); + line-height: var(--consonant-merch-card-heading-xs-line-height); + margin: 0; + margin-bottom: var(--consonant-merch-spacing-xxs); + color: var(--color-grey-80); +} + +merch-card [slot='heading-s'] { + font-size: var(--consonant-merch-card-heading-s-font-size); + line-height: var(--consonant-merch-card-heading-s-line-height); + margin: 0; + color: var(--color-grey-80); +} + +merch-card [slot='heading-m'] { + font-size: var(--consonant-merch-card-heading-m-font-size); + line-height: var(--consonant-merch-card-heading-m-line-height); + margin: 0; + color: var(--color-grey-80); +} + +merch-card [slot='heading-l'] { + font-size: var(--consonant-merch-card-heading-l-font-size); + line-height: var(--consonant-merch-card-heading-l-line-height); + margin: 0; + color: var(--color-grey-80); +} + +merch-card [slot='heading-xl'] { + font-size: var(--consonant-merch-card-heading-xl-font-size); + line-height: var(--consonant-merch-card-heading-xl-line-height); + margin: 0; + color: var(--color-grey-80); +} + +merch-card [slot='detail-m'] { + font-size: var(--consonant-merch-card-detail-m-font-size); + letter-spacing: var(--consonant-merch-card-detail-m-letter-spacing); + font-weight: var(--consonant-merch-card-detail-m-font-weight); + text-transform: uppercase; + margin: 0; + color: var(--color-grey-80); +} + +merch-card [slot="body-xxs"] { + font-size: var(--consonant-merch-card-body-xxs-font-size); + line-height: var(--consonant-merch-card-body-xxs-line-height); + font-weight: normal; + letter-spacing: var(--consonant-merch-card-body-xxs-letter-spacing); + color: var(--color-grey-80); +} + +merch-card [slot="body-xs"] { + font-size: var(--consonant-merch-card-body-xs-font-size); + line-height: var(--consonant-merch-card-body-xs-line-height); + color: var(--color-grey-80); +} + +merch-card [slot="body-m"] { + font-size: var(--consonant-merch-card-body-m-font-size); + line-height: var(--consonant-merch-card-body-m-line-height); + color: var(--color-grey-80); +} + +merch-card [slot="body-l"] { + font-size: var(--consonant-merch-card-body-l-font-size); + line-height: var(--consonant-merch-card-body-l-line-height); + color: var(--color-grey-80); +} + +merch-card [slot="body-xl"] { + font-size: var(--consonant-merch-card-body-xl-font-size); + line-height: var(--consonant-merch-card-body-xl-line-height); + color: var(--color-grey-80); +} + +merch-card[variant="catalog"] [slot="action-menu-content"] { + background-color: #000; + color: var(--color-white, #fff); + font-size: var(--consonant-merch-card-body-xs-font-size); + width: fit-content; + padding: var(--consonant-merch-spacing-xs); + border-radius: var(--consonant-merch-spacing-xxxs); + position: absolute; + top: 55px; + right: 15px; + line-height: var(--consonant-merch-card-body-line-height); +} + +merch-card[variant="catalog"] [slot="action-menu-content"] ul { + padding-left: 0; + padding-bottom: var(--consonant-merch-spacing-xss); + margin-top: 0; + margin-bottom: 0; + list-style-position: inside; + list-style-type: '\u2022 '; +} + +merch-card[variant="catalog"] [slot="action-menu-content"] ul li { + padding-left: 0; + line-height: var(--consonant-merch-card-body-line-height); +} + +merch-card[variant="catalog"] [slot="action-menu-content"] ::marker { + margin-right: 0; +} + +merch-card[variant="catalog"] [slot="action-menu-content"] p { + color: var(--color-white, #fff); +} + +merch-card[variant="catalog"] [slot="action-menu-content"] a { + color: var(--consonant-merch-card-background-color); + text-decoration: underline; +} + +.button--inactive { + display: none; +} + +div[slot="footer"] a.con-button { + margin-right: var(--consonant-merch-spacing-xs); +} + +div[slot='bg-image'] img { + position: relative; + width: 100%; + min-height: var(--consonant-merch-card-image-height); + max-height: var(--consonant-merch-card-image-height); + object-fit: cover; +} + +`;document.head.appendChild(k);var E="MERCH-CARD",$="merch-card",m=class extends C{static properties={name:{type:String},variant:{type:String},type:{type:String},badgeColor:{type:String,attribute:"badge-color"},badgeBackgroundColor:{type:String,attribute:"badge-background-color"},badgeText:{type:String,attribute:"badge-text"},icons:{type:Array},actionmenu:{type:Boolean,attribute:"action-menu"},actionMenuContent:{type:String,attribute:"action-menu-content"},title:{type:String},description:{type:String},customHr:{type:Boolean,attribute:"custom-hr"},detailBg:{type:String,attribute:"detail-bg"},secureLabel:{type:String,attribute:"secure-label"},checkboxLabel:{type:String,attribute:"checkbox-label"},stockOfferOsi:{type:String,attribute:"stock-offer-osi"},evergreen:{type:Boolean},filters:{type:String,reflect:!0,converter:{fromAttribute:e=>Object.fromEntries(e.split(",").map(n=>{let[t,o]=n.split(":"),r=Number(o);return[t,isNaN(r)?{}:r]})),toAttribute:e=>Object.entries(e).map(([n,t])=>isNaN(t)?n:`${n}:${t}`).join(",")}},types:{type:String,attribute:"types",reflect:!0}};static styles=[f];constructor(){super(),this.filters={},this.types=""}updated(e){e.has("badgeBackgroundColor")&&(this.style.border=`1px solid ${this.badgeBackgroundColor}`)}renderIcons(){return this.icons&&this.icons.length>0?a` +
+ ${this.icons.map(e=>a`${e.alt}`)} +
+ `:""}get stockCheckbox(){return this.checkboxLabel?a``:""}get plansFooter(){let e=a` `,n=this.secureLabel;return n?a`
+ ${n} + ${e} +
`:e}decorateRibbon(){let e;if(!(!this.badgeBackgroundColor||!this.badgeColor||!this.badgeText))return this.evergreen&&(e=`border: 1px solid ${this.badgeBackgroundColor}; border-right: none;`),a` +
+ ${this.badgeText} +
+ `}get headingmMSlot(){return this.shadowRoot.querySelector('slot[name="heading-m"]').assignedElements()[0]}get footerSlot(){return this.shadowRoot.querySelector('slot[name="footer"]').assignedElements()[0]}get price(){return this.headingmMSlot?.querySelector('span[is="inline-price"]')}get checkoutLinks(){return[...this.footerSlot?.querySelectorAll('a[is="checkout-link"]')??[]]}toggleStockOffer(e){this.stockOfferOsi&&this.toggleStock(this.checkoutLinks,e.target.checked)}toggleStock(e,n){e.length!==0&&e.forEach(t=>{let o=t.dataset.wcsOsi.split(",").filter(r=>r!==this.stockOfferOsi);n&&o.push(this.stockOfferOsi),t.dataset.wcsOsi=o.join(",")})}toggleActionMenu(e){let n=e?.type==="mouseleave"?!0:void 0,t=this.shadowRoot.querySelector('slot[name="action-menu-content"]');t&&t.classList.toggle("hidden",n)}get title(){return this.querySelector('[slot="heading-xs"]').textContent.trim()}updateFilters(e){let n={...this.filters};Object.keys(n).forEach(t=>{if(e){n[t]=Math.min(n[t],2);return}let o=n[t];o===1||isNaN(o)||(n[t]=Number(o)+1)}),this.filters=n}includes(e){return this.textContent.match(new RegExp(e,"i"))!==null}render(){switch(this.variant){case"special-offers":return this.renderSpecialOffer();case"segment":return this.renderSegment();case"plans":return this.renderPlans();case"catalog":return this.renderCatalog();case"inline-heading":return this.renderInlineHeading();default:return this.renderDefault()}}renderSpecialOffer(){return a`
+ + ${this.decorateRibbon()} +
+
+ + + +
+ ${this.evergreen?a` +
+ +
+ `:a` +
+ + `}`}renderSegment(){return a` ${this.decorateRibbon()} +
+ + +
+
+ `}renderPlans(){return a` ${this.decorateRibbon()} +
+ ${this.renderIcons()} + + + + + ${this.stockCheckbox} +
+ ${this.plansFooter}`}renderCatalog(){return a`
+
+ ${this.renderIcons()} ${this.decorateRibbon()} +
+
+ ${this.actionMenuContent} + + + + +
+ `}renderInlineHeading(){return a` + ${this.decorateRibbon()} +
+
+ ${this.renderIcons()} + +
+ +
+ ${this.customHr?"":a`
`} + + `}renderDefault(){return a` ${this.decorateRibbon()} +
+ ${this.renderIcons()} + + +
+ `}connectedCallback(){super.connectedCallback(),this.setAttribute("tabindex","0"),this.addEventListener("keydown",this.keydownHandler),this.addEventListener("mouseleave",this.toggleActionMenu)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("keydown",this.keydownHandler)}keydownHandler(e){let n=document.activeElement;if(n&&n.tagName===E){let s=function(c){let i=o.indexOf(c);return{row:Math.floor(i/r),col:i%r}},t,o=Array.from(this.parentElement.querySelectorAll("merch-card")).filter(c=>window.getComputedStyle(c).display!=="none").sort((c,i)=>parseInt(window.getComputedStyle(c).order,0)-parseInt(window.getComputedStyle(i).order,0)),r=1,z=o[0].getBoundingClientRect().top;for(;r0&&(t=o[c.row*r+(c.col-1)]);break;case v:let i=s(n);i.col0&&(t=o[(g.row-1)*r+g.col]);break;case w:let d=s(n);d.rowd.col?0:1)&&(t=o[(d.row+1)*r+d.col]);break}t&&(t.focus(),e.preventDefault())}}};customElements.get($.toLowerCase())||customElements.define("merch-card",m);export{$ as MERCH_CARD,E as MERCH_CARD_NODE_NAME,m as MerchCard}; diff --git a/libs/utils/utils.js b/libs/utils/utils.js index c4722d2bd7..ec29f4de5e 100644 --- a/libs/utils/utils.js +++ b/libs/utils/utils.js @@ -664,7 +664,7 @@ async function decorateIcons(area, config) { } async function decoratePlaceholders(area, config) { - const el = area.documentElement ? area.body : area; + const el = area.documentElement ? document.querySelector('main') : area; const regex = /{{(.*?)}}|%7B%7B(.*?)%7D%7D/g; const found = regex.test(el.innerHTML); if (!found) return; diff --git a/test/blocks/merch-card/legacy-merch-card/legacy-merch-card.test.js b/test/blocks/merch-card/legacy-merch-card/legacy-merch-card.test.js new file mode 100644 index 0000000000..a2a7a06935 --- /dev/null +++ b/test/blocks/merch-card/legacy-merch-card/legacy-merch-card.test.js @@ -0,0 +1,168 @@ +import { readFile } from '@web/test-runner-commands'; +import { expect } from '@esm-bundle/chai'; + +const { default: initLegacyMerchCard } = await import('../../../../libs/blocks/merch-card/legacy-merch-card.js'); + +describe('Merch Card', () => { + it('Shows segment card', async () => { + document.body.innerHTML = await readFile({ path: './mocks/segment-card.html' }); + await initLegacyMerchCard(document.querySelector('.merch-card')); + const inner = document.querySelector('.consonant-SegmentBlade-inner'); + const cardFooter = inner.querySelector('.consonant-CardFooter'); + const buttons = cardFooter.querySelectorAll('.con-button'); + + expect(document.querySelector('.consonant-ProductCard')).to.exist; + expect(inner.querySelector('.consonant-SegmentBlade-title')).to.exist; + expect(inner.querySelector('.consonant-SegmentBlade-description')).to.exist; + expect(cardFooter.querySelector('.con-button')).to.exist; + expect(buttons.length).to.be.equal(2); + expect(buttons[0].textContent).to.be.equal('Learn More'); + expect(buttons[1].textContent).to.be.equal('Save now'); + }); + + describe('Wrapper', async () => { + before(async () => { + document.body.innerHTML = await readFile({ path: './mocks/segment-card.html' }); + const merchCards = document.querySelectorAll('.segment'); + await initLegacyMerchCard(merchCards[0]); + await initLegacyMerchCard(merchCards[1]); + }); + + it('Has one per section', () => { + expect(document.querySelectorAll('.consonant-Wrapper').length).to.equal(1); + }); + + it('Is in correct position', async () => { + const wrapper = document.querySelector('.consonant-Wrapper'); + expect(wrapper.previousElementSibling).to.equal(document.querySelector('.before')); + expect(wrapper.nextElementSibling).to.equal(document.querySelector('.after')); + }); + }); + + it('Supports Special Offers card', async () => { + document.body.innerHTML = await readFile({ path: './mocks/special-offers.html' }); + await initLegacyMerchCard(document.querySelector('.special-offers')); + const inner = document.querySelector('.consonant-SpecialOffers-inner'); + const cardFooter = inner.querySelector('.consonant-CardFooter'); + const ribbon = document.querySelector('.consonant-SpecialOffers-ribbon'); + const buttons = cardFooter.querySelectorAll('.con-button'); + + expect(document.querySelector('.consonant-ProductCard')).to.exist; + expect(inner.querySelector('.consonant-SpecialOffers-title')).to.exist; + expect(inner.querySelector('.consonant-SpecialOffers-description')).to.exist; + expect(document.querySelector('.consonant-SpecialOffers-iconWrapper')).to.exist; + expect(ribbon).to.exist; + expect(ribbon.style.backgroundColor).to.be.equal(''); + expect(ribbon.style.color).to.be.equal('rgb(0, 0, 0)'); + expect(ribbon.textContent).to.be.equal('LOREM IPSUM DOLOR'); + expect(ribbon.style.borderLeft).to.be.equal('1px solid rgb(237, 204, 45)'); + expect(ribbon.style.borderRight).to.be.equal('none'); + expect(ribbon.style.borderTop).to.be.equal('1px solid rgb(237, 204, 45)'); + expect(ribbon.style.borderBottom).to.be.equal('1px solid rgb(237, 204, 45)'); + expect(buttons.length).to.be.equal(2); + expect(buttons[0].textContent).to.be.equal('Learn More'); + expect(buttons[1].textContent).to.be.equal('Save now'); + }); + + describe('Plans Card', () => { + before(async () => { + document.body.innerHTML = await readFile({ path: './mocks/plans-card.html' }); + }); + + it('Supports Plans card', async () => { + document.body.innerHTML = await readFile({ path: './mocks/plans-card.html' }); + await initLegacyMerchCard(document.querySelector('.plans.icons')); + const inner = document.querySelector('.consonant-PlansCard-inner'); + const cardFooter = inner.querySelector('.consonant-CardFooter'); + const ribbon = document.querySelector('.consonant-PlansCard-ribbon'); + const buttons = cardFooter.querySelectorAll('.con-button'); + const inactiveButton = cardFooter.querySelector('.button--inactive'); + const secureWrapper = cardFooter.querySelector('.secure-transaction-wrapper'); + const checkBoxContainer = cardFooter.querySelector('.checkbox-container'); + const plansCard = document.querySelector('.consonant-ProductCard'); + const iconsWrapper = document.querySelector('.consonant-PlansCard-iconWrapper'); + const icons = iconsWrapper.querySelectorAll('.consonant-MerchCard-ProductIcon'); + const list = document.querySelector('.consonant-PlansCard-list'); + const listItems = list.querySelectorAll('li'); + + expect(plansCard).to.exist; + expect(plansCard.style.border).to.be.equal('1px solid rgb(237, 204, 45)'); + expect(inner.querySelector('.consonant-PlansCard-title')).to.exist; + expect(inner.querySelector('.consonant-PlansCard-description')).to.exist; + expect(iconsWrapper).to.exist; + expect(icons.length).to.be.equal(2); + expect(ribbon).to.exist; + expect(ribbon.style.backgroundColor).to.be.equal('rgb(237, 204, 45)'); + expect(ribbon.style.color).to.be.equal('rgb(0, 0, 0)'); + expect(ribbon.textContent).to.be.equal('LOREM IPSUM DOLOR'); + expect(buttons.length).to.be.equal(2); + expect(buttons[0].textContent).to.be.equal('Learn More'); + expect(buttons[1].textContent).to.be.equal('Save now'); + expect(secureWrapper).to.exist; + expect(list).to.exist; + expect(list.classList.contains('consonant-PlansCard-list')).to.be.true; + expect(listItems.length).to.be.equal(2); + expect(listItems[0].textContent).to.be.equal('Maecenas porttitor congue massa'); + expect(listItems[1].textContent).to.be.equal('Nunc viverra imperdiet enim.'); + + expect(checkBoxContainer.querySelector('.checkMark')).to.exist; + expect(checkBoxContainer.querySelector('.checkbox-label').textContent).to.be.equal('Lorem ipsum dolor sit amet'); + expect(secureWrapper.querySelector('.secure-transaction-icon').classList).to.exist; + expect(secureWrapper.querySelector('.secure-transaction-label')).to.exist; + + expect(inactiveButton.classList.contains('button--inactive')).to.be.true; + checkBoxContainer.querySelector('.checkMark').click(); + expect(inactiveButton.classList.contains('button--inactive')).to.be.false; + checkBoxContainer.querySelector('.checkMark').click(); + expect(inactiveButton.classList.contains('button--inactive')).to.be.true; + }); + + it('should skip ribbon and altCta creation', async () => { + document.body.innerHTML = await readFile({ path: './mocks/plans-card.html' }); + await initLegacyMerchCard(document.querySelector('.plans.icons.skip-ribbon.skip-altCta')); + const inner = document.querySelector('.consonant-PlansCard-inner'); + const cardFooter = inner.querySelector('.consonant-CardFooter'); + const ribbon = document.querySelector('.consonant-PlansCard-ribbon'); + const buttons = cardFooter.querySelectorAll('.con-button'); + const inactiveButton = cardFooter.querySelectorAll('.button--inactiive'); + const secureWrapper = cardFooter.querySelector('.secure-transaction-wrapper'); + const checkBoxContainer = cardFooter.querySelector('.checkbox-container'); + const plansCard = document.querySelector('.consonant-ProductCard'); + const iconsWrapper = document.querySelector('.consonant-PlansCard-iconWrapper'); + const icons = iconsWrapper.querySelectorAll('.consonant-MerchCard-ProductIcon'); + + expect(plansCard).to.exist; + console.log(plansCard.style.border); + expect(inner.querySelector('.consonant-PlansCard-title')).to.exist; + expect(inner.querySelector('.consonant-PlansCard-description')).to.exist; + expect(iconsWrapper).to.exist; + expect(icons.length).to.be.equal(2); + expect(ribbon).to.not.exist; + expect(buttons.length).to.be.equal(2); + expect(buttons[0].textContent).to.be.equal('Learn More'); + expect(buttons[1].textContent).to.be.equal('Save now'); + expect(inactiveButton).to.exist; + expect(secureWrapper).to.not.exist; + expect(checkBoxContainer).to.not.exist; + }); + + it('does not display undefined if no content', async () => { + const el = document.querySelector('.merch-card.empty'); + await initLegacyMerchCard(el); + expect(el.outerHTML.includes('undefined')).to.be.false; + }); + }); + + describe('UAR Card', () => { + before(async () => { + document.body.innerHTML = await readFile({ path: './mocks/uar-card.html' }); + }); + it('handles decorated
', async () => { + const cards = document.querySelectorAll('.merch-card'); + cards.forEach((card) => { + initLegacyMerchCard(card); + }); + expect(cards[0].classList.contains('has-divider')).to.be.true; + }); + }); +}); diff --git a/test/blocks/merch-card/legacy-merch-card/mocks/plans-card.html b/test/blocks/merch-card/legacy-merch-card/mocks/plans-card.html new file mode 100644 index 0000000000..490011c422 --- /dev/null +++ b/test/blocks/merch-card/legacy-merch-card/mocks/plans-card.html @@ -0,0 +1,76 @@ +
+
+
+
+
+
+
+
+
#EDCC2D, #000000
+
LOREM IPSUM DOLOR
+
+
+
+ + + + + + + + + + + + +

Lorem ipsum dolor sit amet

+

Lorem ipsum dolor

+

Maecenas porttitor congue massa. Fusce posuere, magna sed pulvinar ultricies, purus lectus malesuada libero, + sit amet commodo magna eros quis urna. Nunc viverra imperdiet enim.

+

Maecenas

+
    +
  • Maecenas porttitor congue massa
  • +
  • Nunc viverra imperdiet enim.
  • +
+

See terms about lorem ipsum

+

Learn More Save now

+
+
+
+
Lorem ipsum dolor sit amet
+ +
+
+
+
+
+
LOREM IPSUM DOLOR
+
+
+
+ + + + + + + + + + + + +

Lorem ipsum dolor sit amet

+

Lorem ipsum dolor

+

Maecenas porttitor congue massa. Fusce posuere, magna sed pulvinar ultricies, purus lectus malesuada libero, + sit amet commodo magna eros quis urna. Nunc viverra imperdiet enim.

+

See terms about lorem ipsum

+

Learn More Save now

+
+
+
+
Lorem ipsum dolor sit amet
+
+
+
+
diff --git a/test/blocks/merch-card/legacy-merch-card/mocks/segment-card.html b/test/blocks/merch-card/legacy-merch-card/mocks/segment-card.html new file mode 100644 index 0000000000..c816cac7f4 --- /dev/null +++ b/test/blocks/merch-card/legacy-merch-card/mocks/segment-card.html @@ -0,0 +1,24 @@ +
+
+
+
+
+

Lorem ipsum dolor sit amet

+

Maecenas porttitor congue massa. Fusce posuere, magna sed pulvinar ultricies, purus lectus malesuada libero, sit amet commodo magna eros quis urna. Nunc viverra imperdiet enim.

+

See what's included | Learn more

+

Learn More Save now

+
+
+
+
+
+
+

Lorem ipsum dolor sit amet

+

Maecenas porttitor congue massa. Fusce posuere, magna sed pulvinar ultricies, purus lectus malesuada libero, sit amet commodo magna eros quis urna. Nunc viverra imperdiet enim.

+

See what's included | Learn more

+

Learn More Save now

+
+
+
+
+
diff --git a/test/blocks/merch-card/legacy-merch-card/mocks/special-offers.html b/test/blocks/merch-card/legacy-merch-card/mocks/special-offers.html new file mode 100644 index 0000000000..9c48a9aaae --- /dev/null +++ b/test/blocks/merch-card/legacy-merch-card/mocks/special-offers.html @@ -0,0 +1,25 @@ +
+
+
+
#EDCC2D, #000000
+
LOREM IPSUM DOLOR
+
+
+
+

+ + + + + + +

+

INDIVIDUALS

+

Get 10% off Photoshop.

+

Create gorgeous images, rich graphics, and incredible art. Save 10% for the first year. Ends Mar 20.

+

See terms

+

Learn More Save now

+
+
+
+
diff --git a/test/blocks/merch-card/legacy-merch-card/mocks/uar-card.html b/test/blocks/merch-card/legacy-merch-card/mocks/uar-card.html new file mode 100644 index 0000000000..5955045e1d --- /dev/null +++ b/test/blocks/merch-card/legacy-merch-card/mocks/uar-card.html @@ -0,0 +1,49 @@ +
+ +

UAR CARDS

+ +
+
+
+

https://main--milo--adobecom.hlx.page/drafts/rparrish/assets/merch/photoshop.svg

+

Photoshop

+

PRICE - PUF - Photoshop with 2TB PRICE - ABM - Photoshop with 2TB

+

HR in between price and link? Variant UAR - Create gorgeous images, rich graphics, and incredible art.

+


--- #00ffff

+

See terms

+

Learn More Save now

+
+
+
+ +

inline heading

+
+
+
+

https://main--milo--adobecom.hlx.page/drafts/rparrish/assets/merch/indesign.svg

+

InDesign

+

PRICE - PUF - Photoshop with 2TB PRICE - ABM - Photoshop with 2TB

+

--- #FF3266

+

Variant: ‘inline headline’ is used to keep the title inline w/ the icon.

+

See terms

+

Learn More Save now

+
+
+
+ +

background opacity 70

+
+
+
+

https://main--milo--adobecom.hlx.page/drafts/rparrish/assets/merch/xd.svg

+

XD

+

PRICE - PUF - Photoshop with 2TB PRICE - ABM - Photoshop with 2TB

+

HR between link and ctas? Variant: ‘background opacity 70’ is used to have a 70% white bg.

+

See terms

+

See terms

+

Learn More Save now

+
+
+
+ +
diff --git a/test/blocks/merch-card/merch-card.test.js b/test/blocks/merch-card/merch-card.test.js index d49b9e8dbe..6f5991cb3d 100644 --- a/test/blocks/merch-card/merch-card.test.js +++ b/test/blocks/merch-card/merch-card.test.js @@ -1,64 +1,60 @@ import { readFile } from '@web/test-runner-commands'; import { expect } from '@esm-bundle/chai'; +import { setConfig } from '../../../libs/utils/utils.js'; const { default: init } = await import('../../../libs/blocks/merch-card/merch-card.js'); +const locales = { '': { ietf: 'en-US', tk: 'hah7vzn.css' } }; +const conf = { locales }; +setConfig(conf); + describe('Merch Card', () => { it('Shows segment card', async () => { document.body.innerHTML = await readFile({ path: './mocks/segment-card.html' }); - await init(document.querySelector('.merch-card')); - const inner = document.querySelector('.consonant-SegmentBlade-inner'); - const cardFooter = inner.querySelector('.consonant-CardFooter'); - const buttons = cardFooter.querySelectorAll('.con-button'); - - expect(document.querySelector('.consonant-ProductCard')).to.exist; - expect(inner.querySelector('.consonant-SegmentBlade-title')).to.exist; - expect(inner.querySelector('.consonant-SegmentBlade-description')).to.exist; - expect(cardFooter.querySelector('.con-button')).to.exist; + await init(document.querySelector('.segment')); + const merchCard = document.querySelector('merch-card'); + const fragment = document.querySelector('.fragment'); + const section = document.querySelector('.section'); + const heading = merchCard.querySelector('h3[slot="heading-xs"]'); + const body = merchCard.querySelector('div[slot="body-xs"]'); + const footer = merchCard.querySelector('div[slot="footer"]'); + const buttons = footer.querySelectorAll('.con-button'); + expect(merchCard).to.exist; + expect(body).to.exist; + expect(heading).to.exist; + expect(merchCard.getAttribute('variant')).to.be.equal('segment'); + expect(heading.textContent).to.be.equal('Lorem ipsum dolor sit amet'); + expect(body.textContent).to.be.equal('Maecenas porttitor congue massa. Fusce posuere, magna sed pulvinar ultricies, purus lectus malesuada libero, sit amet commodo magna eros quis urna. Nunc viverra imperdiet enim.See what\'s included | Learn more'); expect(buttons.length).to.be.equal(2); expect(buttons[0].textContent).to.be.equal('Learn More'); expect(buttons[1].textContent).to.be.equal('Save now'); - }); - describe('Wrapper', async () => { - before(async () => { - document.body.innerHTML = await readFile({ path: './mocks/segment-card.html' }); - const merchCards = document.querySelectorAll('.segment'); - await init(merchCards[0]); - await init(merchCards[1]); - }); + expect(fragment).to.exist; + expect(fragment.style.display).to.be.equal('contents'); - it('Has one per section', () => { - expect(document.querySelectorAll('.consonant-Wrapper').length).to.equal(1); - }); - - it('Is in correct position', async () => { - const wrapper = document.querySelector('.consonant-Wrapper'); - expect(wrapper.previousElementSibling).to.equal(document.querySelector('.before')); - expect(wrapper.nextElementSibling).to.equal(document.querySelector('.after')); - }); + expect(section).to.exist; + expect(section.style.display).to.be.equal('contents'); }); it('Supports Special Offers card', async () => { document.body.innerHTML = await readFile({ path: './mocks/special-offers.html' }); - await init(document.querySelector('.special-offers')); - const inner = document.querySelector('.consonant-SpecialOffers-inner'); - const cardFooter = inner.querySelector('.consonant-CardFooter'); - const ribbon = document.querySelector('.consonant-SpecialOffers-ribbon'); - const buttons = cardFooter.querySelectorAll('.con-button'); - - expect(document.querySelector('.consonant-ProductCard')).to.exist; - expect(inner.querySelector('.consonant-SpecialOffers-title')).to.exist; - expect(inner.querySelector('.consonant-SpecialOffers-description')).to.exist; - expect(document.querySelector('.consonant-SpecialOffers-iconWrapper')).to.exist; - expect(ribbon).to.exist; - expect(ribbon.style.backgroundColor).to.be.equal(''); - expect(ribbon.style.color).to.be.equal('rgb(0, 0, 0)'); - expect(ribbon.textContent).to.be.equal('LOREM IPSUM DOLOR'); - expect(ribbon.style.borderLeft).to.be.equal('1px solid rgb(237, 204, 45)'); - expect(ribbon.style.borderRight).to.be.equal('none'); - expect(ribbon.style.borderTop).to.be.equal('1px solid rgb(237, 204, 45)'); - expect(ribbon.style.borderBottom).to.be.equal('1px solid rgb(237, 204, 45)'); + await init(document.querySelector('.merch-card.special-offers')); + const merchCard = document.querySelector('merch-card'); + const heading = merchCard.querySelector('h2[slot="heading-m"]'); + const headingOne = merchCard.querySelector('h3[slot="heading-xs"]'); + const body = merchCard.querySelector('div[slot="body-xs"]'); + const footer = merchCard.querySelector('div[slot="footer"]'); + const buttons = footer.querySelectorAll('.con-button'); + + expect(merchCard).to.exist; + expect(heading).to.exist; + expect(headingOne).to.exist; + expect(body).to.exist; + expect(merchCard.getAttribute('variant')).to.be.equal('special-offers'); + expect(merchCard.getAttribute('badge-background-color')).to.be.equal('#EDCC2D'); + expect(merchCard.getAttribute('badge-color')).to.be.equal('#000000'); + expect(merchCard.getAttribute('badge-text')).to.be.equal('LOREM IPSUM DOLOR'); + expect(body.textContent).to.be.equal('Create gorgeous images, rich graphics, and incredible art. Save 10% for the first year. Ends Mar 20.Best for:See terms'); expect(buttons.length).to.be.equal(2); expect(buttons[0].textContent).to.be.equal('Learn More'); expect(buttons[1].textContent).to.be.equal('Save now'); @@ -71,79 +67,58 @@ describe('Merch Card', () => { it('Supports Plans card', async () => { document.body.innerHTML = await readFile({ path: './mocks/plans-card.html' }); - await init(document.querySelector('.plans.icons')); - const inner = document.querySelector('.consonant-PlansCard-inner'); - const cardFooter = inner.querySelector('.consonant-CardFooter'); - const ribbon = document.querySelector('.consonant-PlansCard-ribbon'); - const buttons = cardFooter.querySelectorAll('.con-button'); - const inactiveButton = cardFooter.querySelector('.button--inactive'); - const secureWrapper = cardFooter.querySelector('.secure-transaction-wrapper'); - const checkBoxContainer = cardFooter.querySelector('.checkbox-container'); - const plansCard = document.querySelector('.consonant-ProductCard'); - const iconsWrapper = document.querySelector('.consonant-PlansCard-iconWrapper'); - const icons = iconsWrapper.querySelectorAll('.consonant-MerchCard-ProductIcon'); - const list = document.querySelector('.consonant-PlansCard-list'); - const listItems = list.querySelectorAll('li'); - - expect(plansCard).to.exist; - expect(plansCard.style.border).to.be.equal('1px solid rgb(237, 204, 45)'); - expect(inner.querySelector('.consonant-PlansCard-title')).to.exist; - expect(inner.querySelector('.consonant-PlansCard-description')).to.exist; - expect(iconsWrapper).to.exist; - expect(icons.length).to.be.equal(2); - expect(ribbon).to.exist; - expect(ribbon.style.backgroundColor).to.be.equal('rgb(237, 204, 45)'); - expect(ribbon.style.color).to.be.equal('rgb(0, 0, 0)'); - expect(ribbon.textContent).to.be.equal('LOREM IPSUM DOLOR'); - expect(buttons.length).to.be.equal(2); + await init(document.querySelector('.merch-card.plans.icons.secure')); + const merchCard = document.querySelector('merch-card'); + const heading = merchCard.querySelector('h4[slot="body-xxs"]'); + const headingOne = merchCard.querySelector('h3[slot="heading-xs"]'); + const body = merchCard.querySelector('div[slot="body-xs"]'); + const detail = merchCard.querySelector('h5[slot="detail-m"]'); + const footer = merchCard.querySelector('div[slot="footer"]'); + const buttons = footer.querySelectorAll('.con-button'); + + expect(merchCard).to.exist; + expect(heading).to.exist; + expect(headingOne).to.exist; + expect(body).to.exist; + expect(detail).to.exist; + expect(merchCard.getAttribute('variant')).to.be.equal('plans'); + expect(merchCard.getAttribute('badge-text')).to.be.equal('LOREM IPSUM DOLOR'); + expect(merchCard.getAttribute('badge-background-color')).to.be.equal('#EDCC2D'); + expect(merchCard.getAttribute('badge-color')).to.be.equal('#000000'); + expect(JSON.parse(merchCard.getAttribute('icons'))).to.have.lengthOf(2); + expect(merchCard.getAttribute('checkbox-label')).to.be.equal('Lorem ipsum dolor sit amet'); + expect(body.textContent).to.be.equal('Maecenas porttitor congue massa. Fusce posuere, magna sed pulvinar ultricies, purus lectus malesuada libero, sit amet commodo magna eros quis urna. Nunc viverra imperdiet enim.MaecenasSee terms about lorem ipsum'); + expect(detail.textContent).to.be.equal('Maecenas porttitor enim.'); + expect(buttons.length).to.be.equal(3); expect(buttons[0].textContent).to.be.equal('Learn More'); expect(buttons[1].textContent).to.be.equal('Save now'); - expect(secureWrapper).to.exist; - expect(list).to.exist; - expect(list.classList.contains('consonant-PlansCard-list')).to.be.true; - expect(listItems.length).to.be.equal(2); - expect(listItems[0].textContent).to.be.equal('Maecenas porttitor congue massa'); - expect(listItems[1].textContent).to.be.equal('Nunc viverra imperdiet enim.'); - - expect(checkBoxContainer.querySelector('.checkMark')).to.exist; - expect(checkBoxContainer.querySelector('.checkbox-label').textContent).to.be.equal('Lorem ipsum dolor sit amet'); - expect(secureWrapper.querySelector('.secure-transaction-icon').classList).to.exist; - expect(secureWrapper.querySelector('.secure-transaction-label')).to.exist; - - expect(inactiveButton.classList.contains('button--inactive')).to.be.true; - checkBoxContainer.querySelector('.checkMark').click(); - expect(inactiveButton.classList.contains('button--inactive')).to.be.false; - checkBoxContainer.querySelector('.checkMark').click(); - expect(inactiveButton.classList.contains('button--inactive')).to.be.true; + expect(buttons[2].textContent).to.be.equal('free-trial'); }); it('should skip ribbon and altCta creation', async () => { document.body.innerHTML = await readFile({ path: './mocks/plans-card.html' }); await init(document.querySelector('.plans.icons.skip-ribbon.skip-altCta')); - const inner = document.querySelector('.consonant-PlansCard-inner'); - const cardFooter = inner.querySelector('.consonant-CardFooter'); - const ribbon = document.querySelector('.consonant-PlansCard-ribbon'); - const buttons = cardFooter.querySelectorAll('.con-button'); - const inactiveButton = cardFooter.querySelectorAll('.button--inactiive'); - const secureWrapper = cardFooter.querySelector('.secure-transaction-wrapper'); - const checkBoxContainer = cardFooter.querySelector('.checkbox-container'); - const plansCard = document.querySelector('.consonant-ProductCard'); - const iconsWrapper = document.querySelector('.consonant-PlansCard-iconWrapper'); - const icons = iconsWrapper.querySelectorAll('.consonant-MerchCard-ProductIcon'); - - expect(plansCard).to.exist; - console.log(plansCard.style.border); - expect(inner.querySelector('.consonant-PlansCard-title')).to.exist; - expect(inner.querySelector('.consonant-PlansCard-description')).to.exist; - expect(iconsWrapper).to.exist; - expect(icons.length).to.be.equal(2); - expect(ribbon).to.not.exist; + const merchCard = document.querySelector('merch-card'); + const heading = merchCard.querySelector('h3[slot=heading-xs]'); + const headingOne = merchCard.querySelector('h2[slot=heading-m]'); + const body = merchCard.querySelector('div[slot=body-xs]'); + const detail = merchCard.querySelector('h4[slot="body-xxs"]'); + const footer = merchCard.querySelector('div[slot="footer"]'); + const buttons = footer.querySelectorAll('.con-button'); + + expect(merchCard).to.exist; + expect(heading).to.exist; + expect(headingOne).to.exist; + expect(body).to.exist; + expect(detail).to.exist; + expect(merchCard.getAttribute('variant')).to.be.equal('plans'); + expect(merchCard.getAttribute('badge')).to.not.exist; + expect(JSON.parse(merchCard.getAttribute('icons'))).to.have.lengthOf(2); + expect(body.textContent).to.be.equal('Maecenas porttitor congue massa. Fusce posuere, magna sed pulvinar ultricies, purus lectus malesuada libero, sit amet commodo magna eros quis urna. Nunc viverra imperdiet enim.See terms about lorem ipsum'); + expect(detail.textContent).to.be.equal('Lorem ipsum dolor sit'); expect(buttons.length).to.be.equal(2); expect(buttons[0].textContent).to.be.equal('Learn More'); expect(buttons[1].textContent).to.be.equal('Save now'); - expect(inactiveButton).to.exist; - expect(secureWrapper).to.not.exist; - expect(checkBoxContainer).to.not.exist; }); it('does not display undefined if no content', async () => { @@ -153,6 +128,125 @@ describe('Merch Card', () => { }); }); + describe('Catalog Card', () => { + it('Supports Catalog card', async () => { + document.body.innerHTML = await readFile({ path: './mocks/catalog.html' }); + await init(document.querySelector('.merch-card.ribbon')); + const merchCard = document.querySelector('merch-card'); + const heading = merchCard.querySelector('h4[slot="body-xxs"]'); + const headingOne = merchCard.querySelector('h3[slot="heading-xs"]'); + const detail = merchCard.querySelector('h5[slot="detail-m"]'); + const body = merchCard.querySelector('div[slot="body-xs"]'); + const actionMenu = merchCard.querySelector('div[slot="action-menu-content"]'); + const footer = merchCard.querySelector('div[slot="footer"]'); + const buttons = footer.querySelectorAll('.con-button'); + + expect(merchCard).to.exist; + expect(heading).to.exist; + expect(headingOne).to.exist; + expect(body).to.exist; + expect(actionMenu).to.exist; + expect(detail).to.exist; + expect(merchCard.getAttribute('variant')).to.be.equal('catalog'); + expect(merchCard.getAttribute('badge-text')).to.be.equal('LOREM IPSUM DOLOR'); + expect(merchCard.getAttribute('badge-background-color')).to.be.equal('#EDCC2D'); + expect(merchCard.getAttribute('badge-color')).to.be.equal('#000000'); + expect(merchCard.getAttribute('action-menu')).to.be.equal('true'); + // expect(merchCard.getAttribute('image')).to.exist; + expect(body.textContent).to.be.equal('Create gorgeous images, rich graphics, and incredible art. Save 10% for the first year. Ends Mar 20.See terms'); + expect(detail.textContent).to.be.equal('Desktop + Mobile'); + expect(buttons.length).to.be.equal(2); + expect(buttons[0].textContent).to.be.equal('Learn More'); + expect(buttons[1].textContent).to.be.equal('Save now'); + }); + + it('Supports Catalog card without badge', async () => { + document.body.innerHTML = await readFile({ path: './mocks/catalog.html' }); + await init(document.querySelector('.merch-card.catalog.empty-badge')); + const merchCard = document.querySelector('merch-card'); + const heading = merchCard.querySelector('h3[slot="heading-xs"]'); + const headingM = merchCard.querySelector('h2[slot="heading-m"]'); + const detailM = merchCard.querySelector('h5[slot="detail-m"]'); + const body = merchCard.querySelector('div[slot="body-xs"]'); + const actionMenu = merchCard.querySelector('div[slot="action-menu-content"]'); + const footer = merchCard.querySelector('div[slot="footer"]'); + const buttons = footer.querySelectorAll('.con-button'); + console.log('MERCH_CARD-empty', merchCard); + expect(merchCard).to.exist; + expect(heading).to.exist; + expect(headingM).to.exist; + expect(body).to.exist; + expect(actionMenu).to.exist; + expect(merchCard.getAttribute('variant')).to.be.equal('catalog'); + expect(merchCard.getAttribute('badge')).to.not.exist; + expect(merchCard.getAttribute('action-menu')).to.be.equal('true'); + // expect(merchCard.getAttribute('image')).to.exist; + expect(body.textContent).to.be.equal('Create gorgeous images, rich graphics, and incredible art. Save 10% for the first year. Ends Mar 20.See terms'); + expect(detailM.textContent).to.be.equal('Desktop + Mobile'); + expect(buttons.length).to.be.equal(2); + expect(buttons[0].textContent).to.be.equal('Learn More'); + expect(buttons[1].textContent).to.be.equal('Save now'); + }); + + it('Supports Catalog card without badge and action-menu', async () => { + document.body.innerHTML = await readFile({ path: './mocks/catalog.html' }); + await init(document.querySelector('.merch-card.catalog.empty-action-menu')); + const merchCard = document.querySelector('merch-card'); + const heading = merchCard.querySelector('h3[slot="heading-xs"]'); + const headingOne = merchCard.querySelector('h2[slot="heading-m"]'); + const body = merchCard.querySelector('div[slot="body-xs"]'); + const actionMenu = merchCard.querySelector('div[slot="action-menu-content"]'); + const detail = merchCard.querySelector('h5[slot="detail-m"]'); + const footer = merchCard.querySelector('div[slot="footer"]'); + const buttons = footer.querySelectorAll('.con-button'); + console.log('MERCH_CARD-empty-action', merchCard); + expect(merchCard).to.exist; + expect(heading).to.exist; + expect(headingOne).to.exist; + expect(body).to.exist; + expect(detail).to.exist; + expect(actionMenu).to.not.exist; + expect(merchCard.getAttribute('variant')).to.be.equal('catalog'); + expect(merchCard.getAttribute('badge')).to.not.exist; + expect(merchCard.getAttribute('action-menu')).to.not.exist; + // expect(merchCard.getAttribute('image')).to.exist; + expect(body.textContent).to.be.equal('Create gorgeous images, rich graphics, and incredible art. Save 10% for the first year. Ends Mar 20.See terms'); + expect(detail.textContent).to.be.equal('Desktop + Mobile'); + expect(buttons.length).to.be.equal(2); + expect(buttons[0].textContent).to.be.equal('Learn More'); + expect(buttons[1].textContent).to.be.equal('Save now'); + }); + + it('Supports Catalog card with badge without action-menu', async () => { + document.body.innerHTML = await readFile({ path: './mocks/catalog.html' }); + await init(document.querySelector('.merch-card.catalog.empty-badge.action-menu-exist')); + const merchCard = document.querySelector('merch-card'); + const heading = merchCard.querySelector('h2[slot="heading-m"]'); + const headingOne = merchCard.querySelector('h3[slot="heading-xs"]'); + const body = merchCard.querySelector('div[slot="body-xs"]'); + const actionMenu = merchCard.querySelector('div[slot="action-menu-content"]'); + const detail = merchCard.querySelector('h5[slot="detail-m"]'); + const footer = merchCard.querySelector('div[slot="footer"]'); + const buttons = footer.querySelectorAll('.con-button'); + console.log('MERCH_CARD-action', merchCard); + expect(merchCard).to.exist; + expect(heading).to.exist; + expect(headingOne).to.exist; + expect(body).to.exist; + expect(detail).to.exist; + expect(actionMenu).to.not.exist; + expect(merchCard.getAttribute('variant')).to.be.equal('catalog'); + expect(merchCard.getAttribute('badge')).to.not.exist; + expect(merchCard.getAttribute('action-menu')).to.not.exist; + // expect(merchCard.getAttribute('image')).to.exist; + expect(body.textContent).to.be.equal('Create gorgeous images, rich graphics, and incredible art. Save 10% for the first year. Ends Mar 20.See terms'); + expect(detail.textContent).to.be.equal('Desktop + Mobile'); + expect(buttons.length).to.be.equal(2); + expect(buttons[0].textContent).to.be.equal('Learn More'); + expect(buttons[1].textContent).to.be.equal('Save now'); + }); + }); + describe('UAR Card', () => { before(async () => { document.body.innerHTML = await readFile({ path: './mocks/uar-card.html' }); diff --git a/test/blocks/merch-card/mocks/catalog.html b/test/blocks/merch-card/mocks/catalog.html new file mode 100644 index 0000000000..26468d66df --- /dev/null +++ b/test/blocks/merch-card/mocks/catalog.html @@ -0,0 +1,109 @@ +
+
+
+
#EDCC2D, #000000
+
LOREM IPSUM DOLOR
+
+
+
+

Best for:

+
    +
  • Photo editing
  • +
  • Compositing
  • +
  • Drawing and painting
  • +
  • Graphic design
  • +
+

Storage:

+

100 GB of cloud storage

+

See system requirements

+
+
+
+
+ + + + + + +

INDIVIDUALS

+

Get 10% off Photoshop.

+
Desktop + Mobile
+

Create gorgeous images, rich graphics, and incredible art. Save 10% for the first year. Ends Mar 20.

+

See terms

+

Learn More Save now

+
+
+
+
+
+

Best for:

+
    +
  • Photo editing
  • +
  • Compositing
  • +
  • Drawing and painting
  • +
  • Graphic design
  • +
+

Storage:

+

100 GB of cloud storage

+

See system requirements

+
+
+
+ + + + + + +

INDIVIDUALS

+

Get 10% off Photoshop.

+
Desktop + Mobile
+

Create gorgeous images, rich graphics, and incredible art. Save 10% for the first year. Ends Mar 20.

+

See terms

+

Learn More Save now

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

INDIVIDUALS

+

Get 10% off Photoshop.

+
Desktop + Mobile
+

Create gorgeous images, rich graphics, and incredible art. Save 10% for the first year. Ends Mar 20.

+

See terms

+

Learn More Save now

+
+
+
+
+
+
#EDCC2D, #000000
+
LOREM IPSUM DOLOR
+
+
+
+ + + + + + +

INDIVIDUALS

+

Get 10% off Photoshop.

+
Desktop + Mobile
+

Create gorgeous images, rich graphics, and incredible art. Save 10% for the first year. Ends Mar 20.

+

See terms

+

Learn More Save now

+
+
+
+
diff --git a/test/blocks/merch-card/mocks/plans-card.html b/test/blocks/merch-card/mocks/plans-card.html index 490011c422..6c270af50e 100644 --- a/test/blocks/merch-card/mocks/plans-card.html +++ b/test/blocks/merch-card/mocks/plans-card.html @@ -23,15 +23,12 @@ -

Lorem ipsum dolor sit amet

-

Lorem ipsum dolor

-

Maecenas porttitor congue massa. Fusce posuere, magna sed pulvinar ultricies, purus lectus malesuada libero, - sit amet commodo magna eros quis urna. Nunc viverra imperdiet enim.

+

Lorem ipsum dolor sit amet

+

Lorem ipsum dolor

+

Lorem ipsum dolor sit

+
Maecenas porttitor enim.
+

Maecenas porttitor congue massa. Fusce posuere, magna sed pulvinar ultricies, purus lectus malesuada libero, sit amet commodo magna eros quis urna. Nunc viverra imperdiet enim.

Maecenas

-
    -
  • Maecenas porttitor congue massa
  • -
  • Nunc viverra imperdiet enim.
  • -

See terms about lorem ipsum

Learn More Save now

@@ -60,10 +57,10 @@

Lorem ipsum dolor

-

Lorem ipsum dolor sit amet

-

Lorem ipsum dolor

-

Maecenas porttitor congue massa. Fusce posuere, magna sed pulvinar ultricies, purus lectus malesuada libero, - sit amet commodo magna eros quis urna. Nunc viverra imperdiet enim.

+

Lorem ipsum dolor sit lorem-ipsum-dolor-sit-amet1

+

Lorem ipsum dolor

+

Lorem ipsum dolor sit

+

Maecenas porttitor congue massa. Fusce posuere, magna sed pulvinar ultricies, purus lectus malesuada libero, sit amet commodo magna eros quis urna. Nunc viverra imperdiet enim.

See terms about lorem ipsum

Learn More Save now

diff --git a/test/blocks/merch-card/mocks/segment-card.html b/test/blocks/merch-card/mocks/segment-card.html index c816cac7f4..77c5354747 100644 --- a/test/blocks/merch-card/mocks/segment-card.html +++ b/test/blocks/merch-card/mocks/segment-card.html @@ -1,3 +1,4 @@ +
@@ -10,15 +11,6 @@

Lorem ipsum dolor sit amet

-
-
-
-

Lorem ipsum dolor sit amet

-

Maecenas porttitor congue massa. Fusce posuere, magna sed pulvinar ultricies, purus lectus malesuada libero, sit amet commodo magna eros quis urna. Nunc viverra imperdiet enim.

-

See what's included | Learn more

-

Learn More Save now

-
-
-
+ diff --git a/test/blocks/merch-card/mocks/special-offers.html b/test/blocks/merch-card/mocks/special-offers.html index 9c48a9aaae..4f9b337728 100644 --- a/test/blocks/merch-card/mocks/special-offers.html +++ b/test/blocks/merch-card/mocks/special-offers.html @@ -1,22 +1,21 @@
-
+
#EDCC2D, #000000
LOREM IPSUM DOLOR
-

-

-

INDIVIDUALS

+

INDIVIDUALS

Get 10% off Photoshop.

Create gorgeous images, rich graphics, and incredible art. Save 10% for the first year. Ends Mar 20.

+

Best for:

See terms

Learn More Save now