Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions 404.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@
"imports": {
"@glidejs/glide": "https://esm.sh/@glidejs/glide@3.7.1",
"@glidejs/glide/": "https://esm.sh/@glidejs/glide@3.7.1/",
"@repobit/dex-constants": "https://esm.sh/@repobit/dex-constants@2.1.70",
"@repobit/dex-constants/": "https://esm.sh/@repobit/dex-constants@2.1.70/",
"@repobit/dex-data-layer": "https://esm.sh/@repobit/dex-data-layer@2.2.71",
"@repobit/dex-data-layer/": "https://esm.sh/@repobit/dex-data-layer@2.2.71/",
"@repobit/dex-launch": "https://esm.sh/@repobit/dex-launch@3.0.74",
"@repobit/dex-launch/": "https://esm.sh/@repobit/dex-launch@3.0.74/",
"@repobit/dex-store-elements": "https://esm.sh/@repobit/dex-store-elements@1.5.0",
"@repobit/dex-store-elements/": "https://esm.sh/@repobit/dex-store-elements@1.5.0/",
"@repobit/dex-store": "https://esm.sh/@repobit/dex-store@1.3.83",
"@repobit/dex-store/": "https://esm.sh/@repobit/dex-store@1.3.83/",
"@repobit/dex-system-design": "https://esm.sh/@repobit/dex-system-design@0.23.87",
"@repobit/dex-system-design/": "https://esm.sh/@repobit/dex-system-design@0.23.87/",
"@repobit/dex-target": "https://esm.sh/@repobit/dex-target@2.15.20",
"@repobit/dex-target/": "https://esm.sh/@repobit/dex-target@2.15.20/",
"@repobit/dex-utils": "https://esm.sh/@repobit/dex-utils@2.3.38",
"@repobit/dex-utils/": "https://esm.sh/@repobit/dex-utils@2.3.38/",
"@repobit/dex-constants": "https://esm.sh/@repobit/dex-constants@2.1.75",
"@repobit/dex-constants/": "https://esm.sh/@repobit/dex-constants@2.1.75/",
"@repobit/dex-data-layer": "https://esm.sh/@repobit/dex-data-layer@2.2.76",
"@repobit/dex-data-layer/": "https://esm.sh/@repobit/dex-data-layer@2.2.76/",
"@repobit/dex-launch": "https://esm.sh/@repobit/dex-launch@3.0.79",
"@repobit/dex-launch/": "https://esm.sh/@repobit/dex-launch@3.0.79/",
"@repobit/dex-store-elements": "https://esm.sh/@repobit/dex-store-elements@1.6.1",
"@repobit/dex-store-elements/": "https://esm.sh/@repobit/dex-store-elements@1.6.1/",
"@repobit/dex-store": "https://esm.sh/@repobit/dex-store@1.4.1",
"@repobit/dex-store/": "https://esm.sh/@repobit/dex-store@1.4.1/",
"@repobit/dex-system-design": "https://esm.sh/@repobit/dex-system-design@0.23.92",
"@repobit/dex-system-design/": "https://esm.sh/@repobit/dex-system-design@0.23.92/",
"@repobit/dex-target": "https://esm.sh/@repobit/dex-target@2.15.25",
"@repobit/dex-target/": "https://esm.sh/@repobit/dex-target@2.15.25/",
"@repobit/dex-utils": "https://esm.sh/@repobit/dex-utils@2.3.43",
"@repobit/dex-utils/": "https://esm.sh/@repobit/dex-utils@2.3.43/",
"@tsparticles/all": "https://esm.sh/@tsparticles/all@3.9.1",
"@tsparticles/all/": "https://esm.sh/@tsparticles/all@3.9.1/",
"@tsparticles/engine": "https://esm.sh/@tsparticles/engine@3.9.1",
Expand Down
4 changes: 2 additions & 2 deletions _src/blocks/mbox-canvas/mbox-canvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,8 @@ export default async function decorate(block) {
});

const canvasStore = new Store({
campaign: async () => configMbox.promotion,
locale: configMbox.useGeoIpPricing
campaign: async () => configMbox?.promotion,
locale: configMbox?.useGeoIpPricing
? (await user.locale)?.toLowerCase()
: page.locale.toLowerCase(),
provider: { name: 'vlaicu' },
Expand Down
13 changes: 12 additions & 1 deletion _src/blocks/new-prod-boxes/new-prod-boxes.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ function createPriceElement(options, card) {
billedText,
type,
perPrice,
trialDuration,
} = options;

const priceAttribute = getDiscountedPriceAttribute(type, prodName);
Expand Down Expand Up @@ -116,7 +117,11 @@ function createPriceElement(options, card) {
buyLink.href = '#';
buyLink.className = 'button primary no-arrow';
buyLink.setAttribute('data-store-render', '');
buyLink.setAttribute('data-store-buy-link', '');
if (trialDuration) {
buyLink.setAttribute('data-store-trial-link', trialDuration);
} else {
buyLink.setAttribute('data-store-buy-link', '');
}
buyLink.textContent = buyLinkSelector.innerText;
container.appendChild(buyLink);
}
Expand Down Expand Up @@ -864,6 +869,7 @@ export default async function decorate(block) {
thirdRadioButtonProducts,
saveText,
addonProductName,
trialDuration,
} = section.dataset;

section.classList.add('we-container');
Expand Down Expand Up @@ -902,6 +908,9 @@ export default async function decorate(block) {
// Determine store event type
const storeEvent = checkIfNotProductPage() ? 'product-loaded' : 'main-product-loaded';

// Set Trial Durations
const trialDurations = trialDuration.split(',').map((trial) => trial.trim());

// Process each product card
if (combinedProducts.length) {
const productCards = Array.from(block.children);
Expand Down Expand Up @@ -1044,6 +1053,7 @@ export default async function decorate(block) {
billedText,
type,
perPrice,
trialDuration: Number(productInfo.years) === 1 ? trialDurations[key] : null,
}, block.children[key]);
block.children[key].querySelector('.hero-aem__prices')?.appendChild(priceBox);

Expand All @@ -1057,6 +1067,7 @@ export default async function decorate(block) {
billedText: billed2,
type,
perPrice,
trialDuration: Number(productInfo.years) === 1 ? trialDurations[key] : null,
}, block.children[key]);
block.children[key].querySelector('.hero-aem__prices__addon')?.appendChild(addOnPriceBox);
}
Expand Down
16 changes: 5 additions & 11 deletions _src/scripts/trialLinkMap.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { getMetadata } from './lib-franklin.js';

const SUBSCRIPTION_MONTHS = 12;
const DEFAULT_CAMPAIGN = 'default';

Expand All @@ -15,8 +13,8 @@ const getTrials = async () => {
};

const getLocale = () => {
const locale = (window.location.pathname.split('/')[1]?.split('-')[0] || '').toLowerCase();
return !locale || locale === 'en' ? 'COM' : locale.toUpperCase();
const locale = (window.location.pathname.split('/')[1]?.split('-')[1] || '').toLowerCase();
return !locale || locale === 'us' ? 'COM' : locale.toUpperCase();
};

let trialMapCache = null;
Expand All @@ -41,11 +39,6 @@ let trialMapCache = null;
*/
export default async function getTrialLinkMap() {
if (trialMapCache) return trialMapCache;
const trialPeriod = getMetadata('trialbuylinks');
if (!trialPeriod) {
trialMapCache = {};
return trialMapCache;
}

const trials = await getTrials();
if (!trials?.length) {
Expand All @@ -55,7 +48,7 @@ export default async function getTrialLinkMap() {

const locale = getLocale();
const map = trials.reduce((acc, {
product, devices, buy_link: buyLink, locale: rowLocale,
product, devices, buy_link: buyLink, locale: rowLocale, duration,
}) => {
if (!product || !devices || !buyLink) return acc;
if (rowLocale?.toUpperCase() !== locale) return acc;
Expand All @@ -64,7 +57,8 @@ export default async function getTrialLinkMap() {

acc[product] ??= {};
acc[product][DEFAULT_CAMPAIGN] ??= {};
acc[product][DEFAULT_CAMPAIGN][variantKey] ??= buyLink;
acc[product][DEFAULT_CAMPAIGN][variantKey] ??= {};
acc[product][DEFAULT_CAMPAIGN][variantKey][duration] ??= buyLink;

return acc;
}, {});
Expand Down
32 changes: 16 additions & 16 deletions head.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@
"imports": {
"@glidejs/glide": "https://esm.sh/@glidejs/glide@3.7.1",
"@glidejs/glide/": "https://esm.sh/@glidejs/glide@3.7.1/",
"@repobit/dex-constants": "https://esm.sh/@repobit/dex-constants@2.1.70",
"@repobit/dex-constants/": "https://esm.sh/@repobit/dex-constants@2.1.70/",
"@repobit/dex-data-layer": "https://esm.sh/@repobit/dex-data-layer@2.2.71",
"@repobit/dex-data-layer/": "https://esm.sh/@repobit/dex-data-layer@2.2.71/",
"@repobit/dex-launch": "https://esm.sh/@repobit/dex-launch@3.0.74",
"@repobit/dex-launch/": "https://esm.sh/@repobit/dex-launch@3.0.74/",
"@repobit/dex-store-elements": "https://esm.sh/@repobit/dex-store-elements@1.5.0",
"@repobit/dex-store-elements/": "https://esm.sh/@repobit/dex-store-elements@1.5.0/",
"@repobit/dex-store": "https://esm.sh/@repobit/dex-store@1.3.83",
"@repobit/dex-store/": "https://esm.sh/@repobit/dex-store@1.3.83/",
"@repobit/dex-system-design": "https://esm.sh/@repobit/dex-system-design@0.23.87",
"@repobit/dex-system-design/": "https://esm.sh/@repobit/dex-system-design@0.23.87/",
"@repobit/dex-target": "https://esm.sh/@repobit/dex-target@2.15.20",
"@repobit/dex-target/": "https://esm.sh/@repobit/dex-target@2.15.20/",
"@repobit/dex-utils": "https://esm.sh/@repobit/dex-utils@2.3.38",
"@repobit/dex-utils/": "https://esm.sh/@repobit/dex-utils@2.3.38/",
"@repobit/dex-constants": "https://esm.sh/@repobit/dex-constants@2.1.75",
"@repobit/dex-constants/": "https://esm.sh/@repobit/dex-constants@2.1.75/",
"@repobit/dex-data-layer": "https://esm.sh/@repobit/dex-data-layer@2.2.76",
"@repobit/dex-data-layer/": "https://esm.sh/@repobit/dex-data-layer@2.2.76/",
"@repobit/dex-launch": "https://esm.sh/@repobit/dex-launch@3.0.79",
"@repobit/dex-launch/": "https://esm.sh/@repobit/dex-launch@3.0.79/",
"@repobit/dex-store-elements": "https://esm.sh/@repobit/dex-store-elements@1.6.1",
"@repobit/dex-store-elements/": "https://esm.sh/@repobit/dex-store-elements@1.6.1/",
"@repobit/dex-store": "https://esm.sh/@repobit/dex-store@1.4.1",
"@repobit/dex-store/": "https://esm.sh/@repobit/dex-store@1.4.1/",
"@repobit/dex-system-design": "https://esm.sh/@repobit/dex-system-design@0.23.92",
"@repobit/dex-system-design/": "https://esm.sh/@repobit/dex-system-design@0.23.92/",
"@repobit/dex-target": "https://esm.sh/@repobit/dex-target@2.15.25",
"@repobit/dex-target/": "https://esm.sh/@repobit/dex-target@2.15.25/",
"@repobit/dex-utils": "https://esm.sh/@repobit/dex-utils@2.3.43",
"@repobit/dex-utils/": "https://esm.sh/@repobit/dex-utils@2.3.43/",
"@tsparticles/all": "https://esm.sh/@tsparticles/all@3.9.1",
"@tsparticles/all/": "https://esm.sh/@tsparticles/all@3.9.1/",
"@tsparticles/engine": "https://esm.sh/@tsparticles/engine@3.9.1",
Expand Down
Loading
Loading