riche, corsé et complexe, Belvedere Heritage 176 a été fabriqué en utilisant la méthode de maltage traditionnelle pour chauffer le seigle Dańkowskie à 176 degrés, permettant à son véritable esprit de briller. C P>
une vodka pour les amateurs de cocktails et ceux qui aiment les esprits sombres, Belvédere Heritage 176 est différent de Belvédere pure dans toutes les manières, et met en valeur le La riche profondeur de saveur du seigle.
`
document.querySelector('body').insertAdjacentHTML('beforeend', loyaltyGlobalStyles);
window.addEventListener('message', appstleLoyaltyIframeListener, false);
window.addEventListener('kp_user_logged_out', function() { window.location.reload(); });
const removeFirstSlashFromURL = (url) => url ? url?.replace(/\\\//g, "/")?.replace(/^\/+/, "") : url;
function applyDiscount(discountCode, shouldReload = false) {
const encodedDiscountCode = encodeURIComponent(discountCode?.trim());
const discountURL = `${location?.origin}/discount/${encodedDiscountCode}`;
fetch(discountURL).then(res => {
if (res.ok) {
const discountDetails = window?._ALConfig?.customerLoyalty?.rewards?.find((item) => item?.discountCode === discountCode) || null;
if (discountCode && discountDetails) {
const discountData = {discountCode: discountCode || discountDetails?.discountCode, description: discountDetails?.description, customerId: discountDetails?.customerId}
document.dispatchEvent(new CustomEvent('AppstleLoyalty:AppliedDiscountCode', { detail: discountData }));
window.dispatchEvent(new CustomEvent('AppstleLoyalty:AppliedDiscountCode', { detail: discountData }));
}
if (shouldReload) {
window.location.reload();
}
}
});
}
const applyDiscountAutomatically = (discountCode, shouldReload = false) => {
(async () => {
const encodedDiscountCode = encodeURIComponent(discountCode?.trim());
const discountURL = `${location.origin}/checkout?discount=${encodedDiscountCode}`;
const cartURL = `${location.origin}/cart.js`;
try {
const discountRes = await fetch(discountURL);
if(discountRes) {
const cartRes = await fetch(cartURL);
if (!cartRes.ok) return;
const cart = await cartRes.json();
const discount_codes = cart && Array.isArray(cart?.['discount_codes']) ? cart?.['discount_codes'] : [];
const hasDiscount = discount_codes.some(d => (d?.code || "").toLowerCase() === String(discountCode).toLowerCase());
if (hasDiscount && shouldReload) {
window.location.reload();
}
}
} catch (err) {
console.error("Error applying discount:", err);
}
})();
};
const unescapeWidgetString = (str) => {
if (!str || typeof str !== 'string') return '';
return str?.replace(/\\\//g, '/')?.replace(/\\\\/g, '\\');
};
// Market-aware account URL; absolute with new customer accounts, don't prefix origin.
const loyaltyAccountRoute = (key, fallbackPath) => {
const route = _ALConfig?.routes?.[key];
if (route) return route;
const shopRoot = _ALConfig?.routes?.root_url || window?.Shopify?.routes?.root || '/';
return (shopRoot?.replace(/\/+$/, '') ?? '') + fallbackPath;
};
// Shopify login 400s unless return_to is a store-relative "/path".
const normalizeLoyaltyReturnTo = (link) => {
const match = /([?&]return_to=)([^]*)/i.exec(link || '');
// Only our store's login route; third-party apps may want absolute return_to.
if (!match || !/(^|\/)customer_authentication\//i.test(link.slice(0, match.index))) return link;
if (/^(https?:)?\/\//i.test(link)) {
try {
if (new URL(link, window.location.origin).host !== window.location.host) return link;
} catch (e) {
return link;
}
}
let value = match[2];
try {
for (let i = 0; i < 2 && /%[0-9a-f]{2}/i.test(value); i++) value = decodeURIComponent(value);
} catch (e) {
return link;
}
value = value.trim();
if (/^(https?:)?\/\//i.test(value)) {
try {
const parsed = new URL(value, window.location.origin);
if (parsed.host !== window.location.host) return link;
value = parsed.pathname + parsed.search + parsed.hash;
} catch (e) {
return link;
}
}
value = '/' + value.replace(/^\/+/, '');
return link.slice(0, match.index) + match[1] + encodeURIComponent(value) + link.slice(match.index + match[0].length);
};
const formatUrlByLoyalty = (link) => {
if (!link) return '';
const decodedLink = decodeURIComponent(link);
const loyaltyPagePath = '/' + (_ALConfig?.hasDedicatedPageAccess ? _ALConfig?.proxy_path_prefix || 'apps/loyalty' : '');
let l = decodedLink?.replace("{{proxy_path_prefix}}", loyaltyPagePath)?.trim()?.replace(/\\\//g, '/')?.replace(/^\/+/, '') || '';
l = normalizeLoyaltyReturnTo(l?.replace(/([^:]\/)\/+/g, '$1') ?? '');
if (/^(https?:\/\/|\/\/|www\.)/i.test(l)) {
return /^www\./i.test(l) ? 'https://' + l : l;
}
const shopRoot = window?.Shopify?.routes?.root ?? '/';
return (shopRoot?.replace(/\/+$/, '') ?? '') + '/' + l;
};
function isAppstleLoyaltyMessage(event) {
if (event.origin !== window.location.origin) return false;
return event.source === window || ['appstle_loyalty_iframe', 'appstle_loyalty_cart_widget_iframe'].some(id => {
const frame = document.getElementById(id);
return frame && event.source === frame.contentWindow;
});
}
const loyaltyLabelHtmlPolicy = {
ALLOWED_TAGS: ['a', 'b', 'blockquote', 'br', 'button', 'center', 'div', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 's', 'small', 'span', 'strong', 'sub', 'sup', 'u', 'ul'],
ALLOWED_ATTR: ['alt', 'class', 'height', 'href', 'loading', 'rel', 'src', 'style', 'target', 'title', 'width'],
ALLOW_DATA_ATTR: false,
ALLOW_ARIA_ATTR: false
};
const escapeLoyaltyAttribute = value => String(value ?? '').replace(/[&<>"']/g, char => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }[char]));
const loyaltyNavigationUrl = value => {
if (typeof value !== 'string' || !value.trim()) return null;
try {
const url = new URL(value, window.location.href);
return ['https:', 'http:'].includes(url.protocol) && !url.username && !url.password ? url : null;
} catch {
return null;
}
};
// Same filter as Bundles rich labels; keeps merchant layout styles.
const sanitizeLoyaltyLabelStyle = styleText => {
const allowedProperty = /^(?:color|opacity|visibility|cursor|display|order|columns|aspect-ratio|box-shadow|box-sizing|line-height|letter-spacing|white-space|vertical-align|accent-color|caret-color|appearance|width|height|position|top|right|bottom|left|transform|(?:background|border(?!-image)|outline|font|text|margin|padding|flex|align|justify|place|grid|gap|row-gap|column|overflow|transition|list-style|word|min|max|object)(?:-[a-z]+)*)$/;
const unsafeValue = /[{}<>\\]|\b(?:url|attr|env|image|image-set|element|src|expression)\s*\(/i;
return String(styleText ?? '').split(';').filter(declaration => {
const separator = declaration.indexOf(':');
if (separator < 0) return false;
const property = declaration.slice(0, separator).trim().toLowerCase();
const value = declaration.slice(separator + 1).trim();
return (allowedProperty.test(property) || /^--[a-z0-9_-]+$/i.test(property)) && value && !unsafeValue.test(value)
&& (property !== 'position' || /^(?:relative|static)$/i.test(value));
}).join(';');
};
const sanitizeLoyaltyLabel = (value, purifier, allowLinks = true) => {
if (!purifier) return escapeLoyaltyAttribute(value);
const fragment = purifier.sanitize(String(value ?? ''), {
...loyaltyLabelHtmlPolicy,
FORBID_TAGS: allowLinks ? [] : ['a', 'button'],
RETURN_DOM_FRAGMENT: true
});
fragment.querySelectorAll('[href], [src]').forEach(element => {
for (const attribute of ['href', 'src']) {
if (element.hasAttribute(attribute) && !loyaltyNavigationUrl(element.getAttribute(attribute))) element.removeAttribute(attribute);
}
});
fragment.querySelectorAll('[style]').forEach(element => {
const style = sanitizeLoyaltyLabelStyle(element.getAttribute('style'));
if (style) element.setAttribute('style', style);
else element.removeAttribute('style');
});
fragment.querySelectorAll('[target]').forEach(element => {
if (element.tagName !== 'A' || !['_blank', '_self'].includes(element.getAttribute('target'))) element.removeAttribute('target');
else if (element.getAttribute('target') === '_blank') {
const rel = new Set((element.getAttribute('rel') || '').split(/\s+/).filter(Boolean));
rel.add('noopener');
element.setAttribute('rel', [...rel].join(' '));
}
});
fragment.querySelectorAll('button').forEach(button => button.setAttribute('type', 'button'));
const container = document.createElement('div');
container.appendChild(fragment);
return container.innerHTML;
};
let loyaltyHtmlSanitizer;
window.appstleLoyaltyLoadSanitizer = () => loyaltyHtmlSanitizer ||= new Promise(resolve => {
if (window.DOMPurify) return resolve(window.DOMPurify);
const script = document.createElement('script');
script.src = 'https://cdn.jsdelivr.net/npm/dompurify@3.4.15/dist/purify.min.js';
script.integrity = 'sha384-uUMu9JDY09vBzRf9SPcK2VgUj+W/70J6Soc+Dded5P474ElQ63iv9j5N3DE7Kp3N';
script.crossOrigin = 'anonymous';
const settle = purifier => {
clearTimeout(timeout);
resolve(purifier);
};
const timeout = setTimeout(() => settle(null), 8000);
script.onload = () => settle(window.DOMPurify);
script.onerror = () => settle(null);
document.head.appendChild(script);
});
function appstleLoyaltyIframeListener(event) {
if (!isAppstleLoyaltyMessage(event)) return;
const redirect = (link, fallback) => {
try {
const destination = link ? formatUrlByLoyalty(link) : fallback;
const url = new URL(destination, window.location.origin);
if (!['http:', 'https:'].includes(url.protocol) || url.username || url.password) return;
window.location.href = destination;
} catch {
return;
}
};
if (event.data === 'appstle_loyalty_message_to_redirect_to_account') {
if (!_ALConfig?.widget_setting?.customSignInLink && typeof kpHandleLogin === 'function') {
kpHandleLogin(window.location.href);
} else {
redirect(_ALConfig?.widget_setting?.customSignInLink, loyaltyAccountRoute('account_url', '/account'));
}
} else if (event.data === 'appstle_message_to_redirect_to_signup') {
if (typeof kpHandleLogin === 'function') {
kpHandleLogin(window.location.href);
} else {
redirect(null, loyaltyAccountRoute('account_register_url', '/account/register'));
}
} else if (event?.data && event?.data?.type === 'appstle_message_to_redirect_to_after_copied_discount_redirect_url' && typeof event?.data?.value === 'string') {
try {
const redirectUrl = new URL(event.data.value, window.location.origin);
if (redirectUrl.origin !== window.location.origin || !['http:', 'https:'].includes(redirectUrl.protocol) || redirectUrl.username || redirectUrl.password) return;
window.location.href = redirectUrl.href;
} catch (e) {
return;
}
} else if (event.data === 'appstle_message_to_redirect_to_custom_url') {
redirect(_ALConfig?.widget_setting?.createAccountLink, loyaltyAccountRoute('account_register_url', '/account/register'));
} else if (typeof event.data === 'string') {
const parts = event.data.split('|');
if (parts.length !== 2 || !parts[1].trim()) return;
const [command, discountCode] = parts;
if (command === 'appstle_message_to_apply_discount_and_reload') applyDiscount(discountCode, true);
else if (command === 'appstle_message_to_apply_discount') applyDiscount(discountCode, false);
else if (command === 'appstle_message_to_automatic_apply_discount_and_refresh') applyDiscountAutomatically(discountCode, true);
else if (command === 'appstle_message_to_automatic_apply_discount') applyDiscountAutomatically(discountCode, false);
}
}
const snackBarStyles = `
#snackbar {
visibility: hidden;
min-width: 250px;
text-align: center;
position: fixed;
z-index: 9999999;
bottom: ${nudgePlacement('bottom', '90px')};
font-size: 15px;
}
.left_snackbar {
left: ${nudgePlacement('side', '30px')};
}
#snackbar .icon {
display: flex
}
#snackbar.show {
visibility: visible;
-webkit-animation: fadein 0.5s, fadeout 0.5s 2.5s;
animation: fadein 0.5s, fadeout 0.5s 2.5s;
}
#snackbar .arrow_icon {
font-size: 25px;
}
div.snackElement {
background-color: ${_ALConfig?.widget_setting?.notificationToastBackgroundColor || '#4EC33D'};
color: ${_ALConfig?.widget_setting?.notificationToastTextColor || 'white'};
border-radius: 16px;
width: ${nudgePlacement('width', '350px')};
height: 94px;
position: relative;
overflow: hidden;
padding: 0;
margin-bottom: 10px;
text-align: left;
}
svg.appstle-green-bubble {
position: absolute;
bottom: 0;
left: 0;
z-index: 0;
}
svg.closeSnackBar {
position: absolute;
right: 16px;
top: 16px;
cursor: pointer;
}
#snackbar .message {
padding-left: 74px;
font-size: 20px;
padding-top: 10px;
padding-right: 46px;
font-weight: bold;
}
#snackbar .description {
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
padding: 0 65px;
font-weight: 400;
line-height: 1;
font-size: 14px;
}
@-webkit-keyframes fadein {
from {
bottom: ${nudgePlacement('start', '0')};
opacity: 0;
}
to {
bottom: ${nudgePlacement('bottom', '30px')};
opacity: 1;
}
}
@keyframes fadein {
from {
bottom: ${nudgePlacement('start', '0')};
opacity: 0;
}
to {
bottom: ${nudgePlacement('bottom', '30px')};
opacity: 1;
}
}
@-webkit-keyframes fadeout {
from {
bottom: ${nudgePlacement('bottom', '30px')};
opacity: 1;
}
to {
bottom: ${nudgePlacement('start', '0')};
opacity: 0;
}
}
@keyframes fadeout {
from {
bottom: ${nudgePlacement('bottom', '30px')};
opacity: 1;
}
to {
bottom: ${nudgePlacement('start', '0')};
opacity: 0;
}
}
`;
function nudgePlacement(property, fallback) {
return `var(--appstle-nudge-${property}, ${fallback})`;
}
const snackBarStyle = document.createElement('style');
snackBarStyle.textContent = snackBarStyles;
document.body.appendChild(snackBarStyle);
const snackBarHtml = `
`;
document.querySelector('body').insertAdjacentHTML('beforeend', snackBarHtml);
window.addEventListener('message', toasterEventListener, false);
function toasterEventListener(event) {
if (!isAppstleLoyaltyMessage(event)) return;
if (typeof event.data === 'string' && event.data.startsWith('appstle_message_for_notification|')) {
const message = event?.data?.split('|')[1];
showAppstleLoyaltyToaster(message);
}
}
let snackBarIndex = 0;
async function showAppstleLoyaltyToaster(msg) {
const purifier = await window.appstleLoyaltyLoadSanitizer();
const snackBar = document.getElementById('snackbar');
snackBar.classList.add('show');
snackBar.insertAdjacentHTML('beforeend', `
`);
const description = document.getElementById(`elem${snackBarIndex}`).querySelector('.description');
if (purifier) description.innerHTML = purifier.sanitize(String(msg), {
ALLOWED_TAGS: ['a', 'b', 'br', 'em', 'i', 'span', 'strong'],
ALLOWED_ATTR: ['href', 'title', 'class'],
});
else description.textContent = String(msg);
const el = snackBarIndex;
setTimeout(function() {
if (document.getElementById(`elem${el}`))
document.getElementById(`elem${el}`).remove();
}, 5000);
snackBarIndex++;
}
const closeSnackBar = (el) => document.getElementById(el).remove();
document.addEventListener('DOMContentLoaded', () => {
});
const executeLoyaltyWidget = widgetVersionReady => {
window.appstleLoyaltyLauncher?.mount({
escapeAttribute: escapeLoyaltyAttribute,
navigationUrl: loyaltyNavigationUrl,
sanitizeTitle: title => window.appstleLoyaltyLoadSanitizer().then(p => (p ? sanitizeLoyaltyLabel(title, p, false) : null)),
preparePopupWindow(win) {
win.__st = window.__st;
win.Shopify = { shop: location.host, locale: window.Shopify?.locale };
win.appstle_public_domain = location.host;
},
widgetVersionReady
});
}
const launcherScript = new Promise(resolve => {
const script = document.createElement('script');
script.src = "https:\/\/cdn.shopify.com\/extensions\/01a24b58-38b9-7504-9949-16369a5399c5\/appstle-loyalty-1669\/assets\/appstle-loyalty-launcher.js";
script.onload = resolve;
script.onerror = resolve;
document.head.appendChild(script);
});
let widgetVersionReady = Promise.resolve();
try {
const versionUrl = `${location.origin}/${_ALConfig?.proxy_path_prefix || 'apps/loyalty'}/app-loyalty-version`;
widgetVersionReady = fetch(versionUrl)
.then(res => res.json())
.then(data => {
if (data) {
const widgetJsUrl = new URL(_ALConfig.widgetJsPath);
const widgetCssUrl = new URL(_ALConfig.widgetCssPath);
widgetJsUrl.searchParams.set('v', data);
widgetCssUrl.searchParams.set('v', data);
_ALConfig.widgetJsPath = widgetJsUrl.toString();
_ALConfig.widgetCssPath = widgetCssUrl.toString();
}
})
.catch(() => {
});
} catch (err) {
}
// The launcher shows as soon as its script loads; only the popup needs the widget version
launcherScript.then(() => executeLoyaltyWidget(widgetVersionReady));
const storeCreditMismatch = _ALConfig?.customerId && _ALConfig?.customerStoreCreditBalance >= 0 && _ALConfig?.customerLoyalty?.storeCreditBalance >= 0 && _ALConfig?.customerLoyalty?.storeCreditBalance !== _ALConfig?.customerStoreCreditBalance;
if (storeCreditMismatch && _ALConfig.shop === 'olineloyalty27.myshopify.com') {
const updateCustomerUrl = `${location.origin}/${_ALConfig?.proxy_path_prefix || 'apps/loyalty'}/cp/api/update-customer`;
const updateCustomer = async () => fetch(updateCustomerUrl, { method: 'POST', headers: { 'X-Requested-With': 'XMLHttpRequest' } });
updateCustomer().catch(() => {});
}
const dedicatedPageURL = new URL(window.location.href);
const decodeUrl = (content) => {
if (typeof content !== 'string') return content;
try {
const htmlDecoded = content?.replace(/\\\//g, '/');
return JSON.parse(`"${htmlDecoded}"`);
} catch (error) {
console.error('Error parsing content:', error);
return content;
}
};
if (dedicatedPageURL?.searchParams?.get('appstle_referral') && _ALConfig?.widget_setting?.widgetType === 'DEDICATED_PAGE') {
const customUrl = decodeUrl(_ALConfig?.widget_setting?.referralCustomRedirectUrl);
if (customUrl) {
const normalizedCustomPath = customUrl.startsWith('/') ? customUrl : `/${customUrl}`;
if (window.location.pathname !== normalizedCustomPath) {
const redirectUrl = new URL(window.location.href);
redirectUrl.pathname = normalizedCustomPath;
window.open(redirectUrl.toString(), '_self');
}
}
else if (dedicatedPageURL?.searchParams?.get('appstle_referral') && _ALConfig?.widget_setting?.widgetType === 'DEDICATED_PAGE' && !window.location.href.includes(_ALConfig?.proxy_path_prefix)) {
window.open(`${window.location.origin}/${_ALConfig?.proxy_path_prefix}${window.location.search}`, '_self');
}
}
const dedicatedPageEventListener = (event) => {
if (event.origin !== window.location.origin || event.source !== window) return;
if (event.data === 'refresh_appstle_loyalty_page') {
initiateAppstleLoyaltyPage();
}
};
window.addEventListener('message', dedicatedPageEventListener, false);
function initiateAppstleLoyaltyPage() {
if (document.querySelector('#appstleLoyaltyPage')) {
const appstleLoyaltyPageElement = document.getElementById('appstleLoyaltyPage');
while (!appstleLoyaltyPageElement.__appstleReactRoot && appstleLoyaltyPageElement.firstChild) {
appstleLoyaltyPageElement.firstChild.remove();
}
document.title = decodeUrl(_ALConfig?.shop_labels?.loyaltyPageMetaTitle) || '';
setTimeout(() => {
let metaDescription = document.querySelector('meta[name="description"]');
if (metaDescription) {
metaDescription.content = decodeUrl(_ALConfig?.shop_labels?.loyaltyPageMetaDescription) || '';
} else {
metaDescription = document.createElement('meta');
metaDescription.name = 'description';
metaDescription.content = decodeUrl(_ALConfig?.shop_labels?.loyaltyPageMetaDescription) || '';
document.head.appendChild(metaDescription);
}
}, 500);
if (appstleLoyaltyPageElement) {
const loadDedicatedPageAsset = (createAsset, attempt, onSettle) => {
const asset = createAsset();
let settled = false;
const settle = () => {
if (settled) return;
settled = true;
if (typeof onSettle === 'function') {
onSettle();
}
};
asset.onload = settle;
asset.onerror = () => {
asset.remove();
if (attempt < 4) {
setTimeout(() => loadDedicatedPageAsset(createAsset, attempt + 1, onSettle), 1000 * Math.pow(2, attempt - 1));
} else {
settle();
}
};
}
const appendDedicatedPageWidgetScript = () => {
loadDedicatedPageAsset(() => {
const s = document.createElement('script');
s.setAttribute('src', _ALConfig?.widgetJsPath);
s.async = false;
document.body.appendChild(s);
return s;
}, 1);
}
const preloadWidgetScript = () => {
try {
const preload = document.createElement('link');
preload.rel = 'preload';
preload.as = 'script';
preload.href = _ALConfig?.widgetJsPath;
document.head.appendChild(preload);
} catch {
return;
}
};
const executeDedicatedPageScript = () => {
let widgetScriptAppended = false;
const appendWidgetScriptOnce = () => {
if (widgetScriptAppended) return;
widgetScriptAppended = true;
appendDedicatedPageWidgetScript();
};
preloadWidgetScript();
loadDedicatedPageAsset(() => {
const link = document.createElement('link');
link.type = 'text/css';
link.rel = 'stylesheet';
link.href = _ALConfig?.widgetCssPath;
document.head.appendChild(link);
return link;
}, 1, appendWidgetScriptOnce);
setTimeout(appendWidgetScriptOnce, 8000);
}
try {
const versionUrl = `${location.origin}/${_ALConfig?.proxy_path_prefix || 'apps/loyalty'}/app-loyalty-version`;
fetch(versionUrl).then(res => res.json()).then(data => {
if (data) {
const widgetJsUrl = new URL(_ALConfig.widgetJsPath);
const widgetCssUrl = new URL(_ALConfig.widgetCssPath);
widgetJsUrl.searchParams.set('v', data);
widgetCssUrl.searchParams.set('v', data);
_ALConfig.widgetJsPath = widgetJsUrl.toString();
_ALConfig.widgetCssPath = widgetCssUrl.toString();
}
}).catch(() => {}).finally(() => {
executeDedicatedPageScript();
});
} catch (err) {
executeDedicatedPageScript();
}
}
} else {
setTimeout(() => {
initiateAppstleLoyaltyPage();
}, 2000);
}
}
const dedicatedPageReferralUrl = new URL(window.location.href)?.searchParams.get('appstle_referral');
if (_ALConfig?.widget_setting?.showWidget === true) {
initiateAppstleLoyaltyPage();
}
(async function() {
const isAvailableVisitShop = _ALConfig?.pointEarnRules?.length > 0 && _ALConfig?.pointEarnRules?.find((rule) => rule?.type === 'VISIT_SHOP' && rule?.status === 'ACTIVE');
if (_ALConfig?.customerId && isAvailableVisitShop) {
if (!sessionStorage.getItem('syncVisitStore') && ((_ALConfig?.customerId && isAvailableVisitShop && isAvailableVisitShop?.id) || (_ALConfig?.referralEnabled && _ALConfig?.referralLoyalty?.referralType === 'VISIT_SHOP'))) {
try {
const response = await fetch(`${location.origin}/${_ALConfig?.proxy_path_prefix || 'apps/loyalty'}/cp/api/customer-visit-store`, { method: 'POST', headers: {'Content-Type': 'application/json', 'X-Requested-With': 'XMLHttpRequest'}, });
if (response?.ok) {
sessionStorage.setItem('syncVisitStore', 'true');
}
} catch (error) {
console.error('Error:', error);
}
}
}
})();
const loyaltyCustomCss = document.createElement('textarea');
loyaltyCustomCss.innerHTML = _ALConfig?.widget_setting?.customCss || '';
const loyaltyCustomStyles = document.createElement('style');
loyaltyCustomStyles.id = 'appstle-loyalty-custom-styles';
loyaltyCustomStyles.textContent = loyaltyCustomCss.value;
document.body.appendChild(loyaltyCustomStyles);