@elevateab/sdk 1.4.2 → 1.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -1182,9 +1182,12 @@ declare function processContentTests(config: ElevateConfig, previewState?: Previ
1182
1182
  */
1183
1183
  declare function reprocessContentTests(config: ElevateConfig, previewState?: PreviewState | null, nonce?: string): void;
1184
1184
  /**
1185
- * Setup event listeners for content test re-processing
1185
+ * Setup event listeners for content test re-processing.
1186
+ *
1187
+ * Listens for ALL SPA navigation (pushState, replaceState, popstate)
1188
+ * via the shared navigation utility, plus resize for responsive changes.
1186
1189
  */
1187
- declare function setupContentTestListeners(config: ElevateConfig, previewState?: PreviewState | null, nonce?: string): () => void;
1190
+ declare function setupContentTestListeners(config: ElevateConfig, previewState?: PreviewState | null, nonce?: string, listenToNavigation?: boolean): () => void;
1188
1191
 
1189
1192
  /**
1190
1193
  * Cart attribute utilities for tagging carts with A/B test data
package/dist/index.d.ts CHANGED
@@ -1182,9 +1182,12 @@ declare function processContentTests(config: ElevateConfig, previewState?: Previ
1182
1182
  */
1183
1183
  declare function reprocessContentTests(config: ElevateConfig, previewState?: PreviewState | null, nonce?: string): void;
1184
1184
  /**
1185
- * Setup event listeners for content test re-processing
1185
+ * Setup event listeners for content test re-processing.
1186
+ *
1187
+ * Listens for ALL SPA navigation (pushState, replaceState, popstate)
1188
+ * via the shared navigation utility, plus resize for responsive changes.
1186
1189
  */
1187
- declare function setupContentTestListeners(config: ElevateConfig, previewState?: PreviewState | null, nonce?: string): () => void;
1190
+ declare function setupContentTestListeners(config: ElevateConfig, previewState?: PreviewState | null, nonce?: string, listenToNavigation?: boolean): () => void;
1188
1191
 
1189
1192
  /**
1190
1193
  * Cart attribute utilities for tagging carts with A/B test data
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import{a as Ae,b as te,c as w,d as m,e as ot,f as at,g as re,h as ne,i as st,j as oe,k as ae,l as it,m as se,n as At}from"./chunk-E3BNNKGR.js";import{A as Tt,B as S,C as Pt,D as _t,E as bt,F as pe,G as Et,H as kt,I as xt,J as St,c as ie,d as x,e as E,f as k,g as ct,h as ce,i as lt,j as $,k as dt,l as le,m as ut,n as de,o as pt,p as ue,q as ft,r as Ue,s as D,t as mt,u as gt,v as yt,w as ht,x as wt,y as Ct,z as vt}from"./chunk-B2OIRKOZ.js";function Ie(e){let t=k("ABAU")||{};t[e]||(t[e]=!0,x("ABAU",JSON.stringify(t)))}function Ve(e){let t=$("ABAV")||{};t[e]||(t[e]=!0,ce("ABAV",t))}function fe(e){Ie(e),Ve(e)}function Ut(e){return!!($("ABAV")||{})[e]}function It(e){return!!(k("ABAU")||{})[e]}function Vt(){if(typeof navigator>"u")return"desktop";let e=navigator.userAgent||navigator.vendor||window.opera||"",t=e.toLowerCase();return/windows nt.*tablet pc|pixelbook/i.test(e)||/(?:macintosh|windows nt|win(?:95|98)|linux x86_64)/i.test(e)&&!/android|mobile|tablet|ipad|iphone|ipod/i.test(t)?"desktop":/ipad|playbook|tablet|kindle|nexus (7|10)|xoom|sm-t\d+|galaxy tab|tb-\d+|tb\d+[a-z]+|lenovo.*tb|dtab|ideatab|mediapad|matepad|honor.*pad|pad\s+\d+|mi\s+pad|redmi.*pad|xiaomi.*pad|oppo.*pad|oneplus.*pad|opd\d+|tcl.*tab|9\d{3}[a-z]|kobo|archos.*5(?!\d)|ereader|droipad/i.test(e)||/android(?!.*mobile)/i.test(t)&&!/dalvik.*miui|pocophone|mi\s+mix|edge\s+\d+|sm-g9\d+|pixel\s+\d|pixel\s+fold|advan\s+\d{4}/i.test(e)?"tablet":/android.+mobile|iphone|ipod|windows phone|blackberry|mobile|phone|kaios/i.test(t)||/^mobile;/i.test(e)||/dalvik.*miui|pocophone|mi\s+mix|pixel\s+\d|pixel\s+fold/i.test(e)?"mobile":"desktop"}function Re(){if(typeof navigator>"u")return!1;let e=navigator.userAgent||navigator.vendor||window.opera;return/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i.test(e)}function Le(){if(typeof navigator>"u")return!1;let e=navigator.userAgent||navigator.vendor||window.opera;return/(instagram)[\/ ]([-\w\.]+)/i.test(e)}function Be(){if(typeof navigator>"u")return!1;let e=navigator.userAgent||navigator.vendor||window.opera;return/musical_ly/i.test(e)}function Oe(){if(typeof navigator>"u")return!1;let e=navigator.userAgent||navigator.vendor||window.opera;return/(pinterest)[\/ ]([-\w\.]+)/i.test(e)}function Rt(){if(typeof window>"u")return"direct";let e=(document.referrer||"").toLowerCase(),t=e?new URL(e).hostname.replace("www.",""):"",r=window.location.hostname,o=Re(),n=Le(),s=Be(),a=Oe();return o||["facebook.com","fb.com","fb.me","m.facebook.com","l.facebook.com","lm.facebook.com"].includes(t)?"facebook":n||t.includes("instagram")?"instagram":s||["tiktok.com","pangleglobal.com","ads.tiktok.com"].includes(t)?"tiktok":a||t.includes("pinterest")||t==="pin.it"?"pinterest":t.includes("google")?"google":!e||r===t?"direct":"other"}var U={SHOPIFY_LOCALIZATION:"localization",EAB_COUNTRY:"eabCountryCode",EAB_GEO:"eabGeoLocation"};function B(){if(typeof window>"u")return null;let t=new URLSearchParams(window.location.search).get("country");if(t)return x(U.EAB_COUNTRY,t.toUpperCase()),t.toUpperCase();let r=E(U.SHOPIFY_LOCALIZATION);if(r)return r.toUpperCase();let o=E(U.EAB_COUNTRY);if(o)return o.toUpperCase();if(typeof localStorage<"u"){let n=localStorage.getItem(U.EAB_COUNTRY);if(n)return n.toUpperCase()}return null}function Lt(){let e=B(),t=E(U.EAB_GEO);if(t)try{let r=JSON.parse(t);return{country:r.country||e,region:r.region,city:r.city}}catch{}return{country:e}}function He(e){let t=e.toUpperCase();x(U.EAB_COUNTRY,t),typeof localStorage<"u"&&localStorage.setItem(U.EAB_COUNTRY,t)}function Bt(e){e.country&&He(e.country),x(U.EAB_GEO,JSON.stringify(e))}function De(e,t){let r=t??B();return r?e.map(n=>n.toUpperCase()).includes(r.toUpperCase()):!1}function Me(e,t){let r=t??B();return r?e.map(n=>n.toUpperCase()).includes(r.toUpperCase()):!1}function Ot(e){let t=B();return!e.includeCountries?.length&&!e.excludeCountries?.length?!0:!t||e.excludeCountries?.length&&Me(e.excludeCountries,t)?!1:e.includeCountries?.length?De(e.includeCountries,t):!0}var Ht={US:"US",CA:"CA",GB:"GB",AU:"AU",DE:"DE",FR:"FR",JP:"JP",MX:"MX",BR:"BR",IN:"IN"},Dt={NORTH_AMERICA:["US","CA","MX"],EUROPE:["GB","DE","FR","IT","ES","NL","BE","AT","CH","PL","SE","NO","DK","FI","IE","PT"],APAC:["AU","NZ","JP","KR","SG","HK","TW","TH","MY","PH","ID","VN","IN"],LATAM:["MX","BR","AR","CL","CO","PE"]};function me(e){let{configUrl:t,timeout:r=2e3}=e;return`(function(){
1
+ import{a as Lt,b as it,c as w,d as g,e as de,f as ue,g as st,h as ct,i as pe,j as lt,k as dt,l as fe,m as ut,n as Be}from"./chunk-E3BNNKGR.js";import{A as Se,B as x,C as xe,D as Ae,E as Ue,F as yt,G as Ie,H as Ve,I as Re,J as Le,c as pt,d as S,e as _,f as b,g as me,h as ft,i as ge,j as J,k as he,l as mt,m as ye,n as gt,o as we,p as ht,q as Ce,r as Bt,s as D,t as ve,u as Te,v as Pe,w as Ee,x as _e,y as be,z as ke}from"./chunk-B2OIRKOZ.js";function Ot(t){let e=b("ABAU")||{};e[t]||(e[t]=!0,S("ABAU",JSON.stringify(e)))}function Ht(t){let e=J("ABAV")||{};e[t]||(e[t]=!0,ft("ABAV",e))}function wt(t){Ot(t),Ht(t)}function Oe(t){return!!(J("ABAV")||{})[t]}function He(t){return!!(b("ABAU")||{})[t]}function De(){if(typeof navigator>"u")return"desktop";let t=navigator.userAgent||navigator.vendor||window.opera||"",e=t.toLowerCase();return/windows nt.*tablet pc|pixelbook/i.test(t)||/(?:macintosh|windows nt|win(?:95|98)|linux x86_64)/i.test(t)&&!/android|mobile|tablet|ipad|iphone|ipod/i.test(e)?"desktop":/ipad|playbook|tablet|kindle|nexus (7|10)|xoom|sm-t\d+|galaxy tab|tb-\d+|tb\d+[a-z]+|lenovo.*tb|dtab|ideatab|mediapad|matepad|honor.*pad|pad\s+\d+|mi\s+pad|redmi.*pad|xiaomi.*pad|oppo.*pad|oneplus.*pad|opd\d+|tcl.*tab|9\d{3}[a-z]|kobo|archos.*5(?!\d)|ereader|droipad/i.test(t)||/android(?!.*mobile)/i.test(e)&&!/dalvik.*miui|pocophone|mi\s+mix|edge\s+\d+|sm-g9\d+|pixel\s+\d|pixel\s+fold|advan\s+\d{4}/i.test(t)?"tablet":/android.+mobile|iphone|ipod|windows phone|blackberry|mobile|phone|kaios/i.test(e)||/^mobile;/i.test(t)||/dalvik.*miui|pocophone|mi\s+mix|pixel\s+\d|pixel\s+fold/i.test(t)?"mobile":"desktop"}function Dt(){if(typeof navigator>"u")return!1;let t=navigator.userAgent||navigator.vendor||window.opera;return/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i.test(t)}function Nt(){if(typeof navigator>"u")return!1;let t=navigator.userAgent||navigator.vendor||window.opera;return/(instagram)[\/ ]([-\w\.]+)/i.test(t)}function Mt(){if(typeof navigator>"u")return!1;let t=navigator.userAgent||navigator.vendor||window.opera;return/musical_ly/i.test(t)}function zt(){if(typeof navigator>"u")return!1;let t=navigator.userAgent||navigator.vendor||window.opera;return/(pinterest)[\/ ]([-\w\.]+)/i.test(t)}function Ne(){if(typeof window>"u")return"direct";let t=(document.referrer||"").toLowerCase(),e=t?new URL(t).hostname.replace("www.",""):"",r=window.location.hostname,o=Dt(),n=Nt(),a=Mt(),i=zt();return o||["facebook.com","fb.com","fb.me","m.facebook.com","l.facebook.com","lm.facebook.com"].includes(e)?"facebook":n||e.includes("instagram")?"instagram":a||["tiktok.com","pangleglobal.com","ads.tiktok.com"].includes(e)?"tiktok":i||e.includes("pinterest")||e==="pin.it"?"pinterest":e.includes("google")?"google":!t||r===e?"direct":"other"}var U={SHOPIFY_LOCALIZATION:"localization",EAB_COUNTRY:"eabCountryCode",EAB_GEO:"eabGeoLocation"};function B(){if(typeof window>"u")return null;let e=new URLSearchParams(window.location.search).get("country");if(e)return S(U.EAB_COUNTRY,e.toUpperCase()),e.toUpperCase();let r=_(U.SHOPIFY_LOCALIZATION);if(r)return r.toUpperCase();let o=_(U.EAB_COUNTRY);if(o)return o.toUpperCase();if(typeof localStorage<"u"){let n=localStorage.getItem(U.EAB_COUNTRY);if(n)return n.toUpperCase()}return null}function Me(){let t=B(),e=_(U.EAB_GEO);if(e)try{let r=JSON.parse(e);return{country:r.country||t,region:r.region,city:r.city}}catch{}return{country:t}}function Ft(t){let e=t.toUpperCase();S(U.EAB_COUNTRY,e),typeof localStorage<"u"&&localStorage.setItem(U.EAB_COUNTRY,e)}function ze(t){t.country&&Ft(t.country),S(U.EAB_GEO,JSON.stringify(t))}function $t(t,e){let r=e??B();return r?t.map(n=>n.toUpperCase()).includes(r.toUpperCase()):!1}function qt(t,e){let r=e??B();return r?t.map(n=>n.toUpperCase()).includes(r.toUpperCase()):!1}function Fe(t){let e=B();return!t.includeCountries?.length&&!t.excludeCountries?.length?!0:!e||t.excludeCountries?.length&&qt(t.excludeCountries,e)?!1:t.includeCountries?.length?$t(t.includeCountries,e):!0}var $e={US:"US",CA:"CA",GB:"GB",AU:"AU",DE:"DE",FR:"FR",JP:"JP",MX:"MX",BR:"BR",IN:"IN"},qe={NORTH_AMERICA:["US","CA","MX"],EUROPE:["GB","DE","FR","IT","ES","NL","BE","AT","CH","PL","SE","NO","DK","FI","IE","PT"],APAC:["AU","NZ","JP","KR","SG","HK","TW","TH","MY","PH","ID","VN","IN"],LATAM:["MX","BR","AR","CL","CO","PE"]};var Y="eab:navigate",Q=!1,Ct=0,F=null,$=null;function Ge(){typeof window>"u"||(Ct++,!Q&&(Q=!0,F=history.pushState.bind(history),$=history.replaceState.bind(history),history.pushState=function(...t){F(...t),window.dispatchEvent(new Event(Y))},history.replaceState=function(...t){$(...t),window.dispatchEvent(new Event(Y))}))}function We(){typeof window>"u"||(Ct--,!(Ct>0||!Q)&&(F&&(history.pushState=F,F=null),$&&(history.replaceState=$,$=null),Q=!1))}function N(t){if(typeof window>"u")return()=>{};let e=window.location.href,r=()=>{let o=window.location.href;o!==e&&(e=o,t())};return Ge(),window.addEventListener(Y,r),window.addEventListener("popstate",r),()=>{window.removeEventListener(Y,r),window.removeEventListener("popstate",r),We()}}function vt(t){let{configUrl:e,timeout:r=2e3}=t;return`(function(){
2
2
  if(new URLSearchParams(location.search).get('abtr')==='true')return;
3
3
 
4
4
  var style=document.createElement('style');
@@ -21,10 +21,10 @@ import{a as Ae,b as te,c as w,d as m,e as ot,f as at,g as re,h as ne,i as st,j a
21
21
  }
22
22
 
23
23
  var script=document.createElement('script');
24
- script.src='${t}';
24
+ script.src='${e}';
25
25
  script.onerror=function(){
26
26
  if(window.__eab_reveal)window.__eab_reveal();
27
27
  };
28
28
  document.head.appendChild(script);
29
- })();`}function Ne(e){if(!e?.trim())return"";try{let r=`https://${e.trim().replace(/^https?:\/\//,"")}`,o=new URL(r.replace(/\/+$/,""));return o.hostname.startsWith("www.")&&(o.hostname=o.hostname.substring(4)),o.toString().replace(/\/+$/,"")}catch{return e.trim().replace(/\/+$/,"")}}function ge(e,t){let r=Ne(e.split("?")[0]);for(let o of t){let n=Ne(o.split("?")[0]);if(r===n)return!0;try{let s=new URL(e).pathname,a=new URL(o,e).pathname;if(s===a)return!0}catch{}}return!1}function Mt(e){return e.data?.redirectBehavior||"redirectAll"}function ze(e){return!!(k("eabRedirectedTests")||{})[e]}function Fe(e){let t=k("eabRedirectedTests")||{};t[e]=!0,x("eabRedirectedTests",JSON.stringify(t))}function Nt(e,t){for(let r of e.tests)if(!(r.type!=="SPLIT_URL"||!r.enabled))for(let o of r.variations){let n=o.splitUrlTestLinks||[];if(n.length!==0&&ge(t,n))return{test:r,matchedVariation:o,isControlUrl:!!o.isControl}}return null}function zt(e){if(typeof window>"u")return;let t=new URL(e,window.location.origin);t.searchParams.set("abtr","true");let r=t.toString(),o=window.__remixRouter?.navigate??window.next?.router?.push??window.$nuxt?.$router?.push??window.__navigate;if(o&&typeof o=="function")try{let n=t.pathname+t.search;o(n);return}catch{}window.location.href=r}function q(e,t){if(typeof window>"u")return!1;let r=window.location.href;if(new URLSearchParams(window.location.search).get("abtr")==="true")return!1;let n=Nt(e,r);if(!n)return!1;let{test:s,matchedVariation:a,isControlUrl:c}=n,i=s.testId,d=Mt(s),u=S(i);if(!u)return!1;let p=s.variations.find(y=>y.id===u);if(!p)return!1;let l=p.splitUrlTestLinks||[];if(l.length===0||ge(r,l))return!1;switch(d){case"redirectOnlyControlUrl":if(!c||p.isControl)return!1;break;case"redirectOnce":if(ze(i))return!1;Fe(i);break;case"redirectOnceControlUrlOnly":if(!c||ze(i)||p.isControl)return!1;Fe(i);break;default:break}let v=l[0];return zt(v),!0}var ye={type:"SPLIT_URL",shouldActivate(e,t){for(let r of e.variations){let o=r.splitUrlTestLinks||[];if(ge(t.currentUrl,o))return!0}return!1},getVariantData(){return{handlerActivated:!0}}};function _(e){return e?e.includes("gid://")&&e.split("/").pop()||e:""}function Ft(e){return!e||!e.includes("gid://")?null:e.split("/")[3]||null}function $t(e){return!!e&&e.startsWith("gid://shopify/")}function qt(){if(typeof window>"u")return;let e=window.Shopify;if(e?.currency?.active)return e.currency.active}var $e="elv-el-",qe={ELEMENT_NODE:1,TEXT_NODE:3},G=new Map,W=new Map,j=new Map,J=new Map,M=!1;function A(e,t){if(t==="*")return!0;if(t.startsWith("*")&&t.endsWith("*")){let r=t.slice(1,-1);return e.includes(r)}if(t.startsWith("*")){let r=t.slice(1);return e.endsWith(r)}return t===e}function ve(){return typeof window>"u"?!1:window.innerWidth<768}function Gt(e){let t="";for(let r=0;r<e.length;r++){let o=e[r];o>="A"&&o<="Z"?(r!==0&&(t+="-"),t+=o.toLowerCase()):t+=o}return t}function Wt(e){return e.nodeType===qe.TEXT_NODE}function he(e){return e.nodeType===qe.ELEMENT_NODE}function we(e,t){G.has(e)||G.set(e,t.cloneNode(!0))}function Ge(e){let t=e;t=t.replace(/&#96;/g,"`").replace(/&#36;/g,"$");try{t=JSON.parse('"'+t+'"')}catch{}return t}function We(e){if(typeof window>"u"||e.length===0)return;let t=window.location.pathname,r=e.filter(n=>n.pathnames?.length?n.pathnames.some(s=>A(t,s)):!0);M=ve();let o=r.map(n=>({...n,style:n.style?{...n.style.lg,...M&&n.style.sm}:void 0,content:n.content&&M&&n.content.sm?n.content.sm:n.content?.lg}));o.filter(n=>n.content!==void 0).forEach(n=>{(n.applyAll?Array.from(document.querySelectorAll(n.selector)):[document.querySelector(n.selector)].filter(Boolean)).forEach((a,c)=>{if(!a)return;let i=n.applyAll?`${n.selector}-${c}-${a.id||Math.random().toString(36).substr(2,9)}`:n.selector;we(i,a),Wt(a)?a.nodeValue=n.content:he(a)&&(a.innerHTML=n.content)})}),o.filter(n=>n.style!==void 0).forEach(n=>{let s=document.querySelector(n.selector);!s||!he(s)||(we(n.selector,s),Object.entries(n.style).forEach(([a,c])=>{let i=Gt(a),d=c.toString().includes("!important"),u=c.toString().replace(/\s*!important\s*$/,"");s.style.setProperty(i,u,d?"important":void 0)}))}),o.filter(n=>n.attributes!==void 0).forEach(n=>{let s=document.querySelector(n.selector);!s||!he(s)||(we(n.selector,s),Object.entries(n.attributes).forEach(([a,c])=>{s.setAttribute(a,c)}))})}function je(e){if(typeof window>"u"||e.length===0)return;let t=window.location.pathname;e.filter(o=>o.selector?.pathnames?.length?o.selector.pathnames.some(n=>A(t,n)):!0).forEach(o=>{let n=`${$e}${o.id}`;if(J.has(n))return;let s=document.querySelector(o.selector.target);if(!s||s.parentElement?.querySelector(`#${n}`))return;let a=Je(o);o.selector.placement==="after"?s.after(a):o.selector.placement==="before"&&s.before(a),J.set(n,a)})}function Je(e){let t=document.createElement(e.tagName);return t.id=`${$e}${e.id}`,e.style&&Object.assign(t.style,e.style),e.attributes&&Object.entries(e.attributes).forEach(([r,o])=>{t.setAttribute(r,o)}),e.kind==="text"&&e.content&&(t.innerText=e.content),e.kind==="container"&&e.childrens&&e.childrens.forEach(r=>{let o=Je(r);t.appendChild(o)}),t}function Y(e,t){if(typeof window>"u"||e.length===0)return;let r=window.location.pathname;e.filter(n=>n.pathnames?.length?n.excludePathnames?.length&&n.excludePathnames.some(a=>A(r,a))?!1:n.pathnames.some(s=>A(r,s)):!0).forEach(n=>{n.id&&(n.css&&jt(n.id,n.css),n.js&&Jt(n.id,n.js,t))})}function jt(e,t){let r=`css-${e}`;if(W.has(r)||document.getElementById(r))return;let o=document.createElement("style");o.id=r,o.textContent=Ge(t),document.head.appendChild(o),W.set(r,o)}function Jt(e,t,r){let o=`js-${e}`;if(j.has(o)||document.getElementById(o))return;let n=document.createElement("script");n.id=o,r&&n.setAttribute("nonce",r);let s=Ge(t);n.textContent="(function(){try{"+s+"}catch(e){console.error('[ElevateAB] Custom script error:', e)}})();",document.head.appendChild(n),j.set(o,n)}function Ye(){G.forEach((e,t)=>{let r=document.querySelector(t);r&&r.replaceWith(e.cloneNode(!0))})}function Qe(){W.forEach(e=>e.remove()),W.clear(),j.forEach(e=>e.remove()),j.clear(),J.forEach(e=>e.remove()),J.clear(),G.clear()}function Yt(e,t){let r=[],o=[],n=[];return e.tests.filter(a=>a.type==="CONTENT"&&a.enabled).forEach(a=>{let c=S(a.testId);if(!c)return;let i=a.variations.find(d=>d.id===c);i?.content&&(i.content.changes?.length&&r.push(...i.content.changes),i.content.elements?.length&&o.push(...i.content.elements),i.content.customCodes?.length&&n.push(...i.content.customCodes))}),{changes:r,elements:o,blocks:[],customCodes:n}}function Q(e){return e.tests.some(t=>t.type==="CONTENT"&&t.enabled)}function K(e,t,r){if(typeof window>"u"||!Q(e))return;let o=Yt(e,t);(o.changes.length>0||o.elements.length>0||o.customCodes.length>0)&&(We(o.changes),je(o.elements),Y(o.customCodes,r))}function Ce(e,t,r){if(typeof window>"u")return;let o=ve();o!==M&&(Ye(),M=o),K(e,t,r)}function Te(e,t,r){if(typeof window>"u")return()=>{};let o=()=>{ve()!==M&&Ce(e,t,r)},n=()=>{Ce(e,t,r)};return window.addEventListener("resize",o),window.addEventListener("popstate",n),()=>{window.removeEventListener("resize",o),window.removeEventListener("popstate",n),Qe()}}import{useEffect as Ke,useRef as cr,useState as lr}from"react";var Qt="https://bitter-river-9c62.support-67d.workers.dev",Kt="https://d339co84ntxcme.cloudfront.net/Prod/orders",C=null;function Pe(e){C=e}function I(e){let t=e?.storeId||C?.storeId;return t||(console.warn("[ElevateAB] No storeId provided. Call initAnalytics() first or pass storeId to tracking function."),"")}function Xt(e){return Object.entries(e).filter(([,t])=>typeof t=="string").map(([t,r])=>({test_id:t,variant_id:r}))}function Zt(e,t){return Object.entries(e).filter(([r])=>typeof t[r]=="string").map(([r])=>({test_id:r,variant_id:t[r]}))}function er(){return typeof window>"u"?!1:E("eabUserPreview")==="true"||new URLSearchParams(window.location.search).get("eabUserPreview")==="true"}function V(e,t,r){if(typeof window>"u"||er())return null;let o=navigator.userAgent,n=window.location.pathname,s=ae(n,r),{referrer:a,entryPage:c}=ue(),i=oe({referrer:a,entryPage:c,userAgent:o}),d=k("ABTL")||{},u=k("ABAU")||{},p=Xt(d),l=Zt(u,d),v=re(localStorage.getItem("shopifyCartId")),y=new Date().toISOString(),h=sessionStorage.getItem("eabIsFirstVisit")==="true",f=E("localization")||"";return{pixel_event_id:`sh-${ie()}`,shop_name:e,timestamp:y,event_type:t,client_id:E("_shopify_y")||void 0,visitor_id:le(),session_id:de(),cart_token:ne(v||E("cart")),page_url:window.location.href,page_pathname:n,page_search:window.location.search,referrer_url:a,referrer_source:i?.referrer_source,previous_page:document.referrer,page_entry:c,page_entry_path:i?.page_entry_path,page_type:s,utm_medium:i?.utm_medium,utm_source:i?.utm_source,utm_campaign:i?.utm_campaign,utm_content:i?.utm_content,utm_term:i?.utm_term,gclid:i?.gclid,fbclid:i?.fbclid,pins_campaign_id:i?.pins_campaign_id,epik:i?.epik,browser_info:i?.browser_info,os_info:i?.os_info,device_type:i?.device_type,language:navigator.language,root_route:localStorage.getItem("eabRootRoute")||"",user_agent:o,user_agent_no_browser:se(o),is_first_visit:h,shopify_country:f,ab_test_assignments:p,ab_test_views:l,is_first_order:null}}async function R(e,t=Qt){try{let r=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),keepalive:!0});if(!r.ok)throw new Error(`Worker error: ${r.status}`)}catch(r){console.error("[ElevateAB] Error sending analytics:",r)}}async function Xe(e={}){let t=I(e);if(!t)return;let r=e.hasLocalizedPaths??C?.hasLocalizedPaths,o=e.workerUrl??C?.workerUrl,n=V(t,"page_viewed",r);if(!n)return;let s={...n,cart_currency:e.currency};await R(s,o)}async function tr(e){let t=I(e);if(!t)return;let{productId:r,productVendor:o,productPrice:n,productSku:s,currency:a}=e,c=e.hasLocalizedPaths??C?.hasLocalizedPaths,i=e.workerUrl??C?.workerUrl,d=V(t,"product_viewed",c);if(!d)return;let u={...d,cart_currency:a,product_id:_(r),product_vendor:w(o),product_price:m(n),product_sku:w(s)};await R(u,i)}async function rr(e){let t=I(e);if(!t)return;let{productId:r,variantId:o,productVendor:n,productPrice:s,productQuantity:a,productSku:c,currency:i,cartId:d}=e,u=e.hasLocalizedPaths??C?.hasLocalizedPaths,p=e.workerUrl??C?.workerUrl,l=e.storefrontAccessToken??C?.storefrontAccessToken,v=V(t,"product_added_to_cart",u);if(!v)return;let y={...v,cart_currency:i,product_id:_(r),variant_id:_(o),product_vendor:w(n),product_price:m(s),product_quantity:a,product_sku:w(c)};if(await R(y,p),d&&l)try{let{updateCartAttributes:h}=await import("./cartAttributes-UOPTEP2Q.js");await h(d,{storefrontAccessToken:l})}catch(h){console.error("[ElevateAB] Failed to update cart attributes:",h)}}async function nr(e){let t=I(e);if(!t)return;let{productId:r,variantId:o,productVendor:n,productPrice:s,productQuantity:a,productSku:c,currency:i}=e,d=e.hasLocalizedPaths??C?.hasLocalizedPaths,u=e.workerUrl??C?.workerUrl,p=V(t,"product_removed_from_cart",d);if(!p)return;let l={...p,cart_currency:i,product_id:_(r),variant_id:_(o),product_vendor:w(n),product_price:m(s),product_quantity:a,product_sku:w(c)};await R(l,u)}async function or(e){let t=I(e);if(!t)return;let{cartTotalPrice:r,cartTotalQuantity:o,cartItems:n,currency:s}=e,a=e.hasLocalizedPaths??C?.hasLocalizedPaths,c=e.workerUrl??C?.workerUrl,i=V(t,"cart_viewed",a);if(!i)return;let d={...i,cart_currency:s,cart_total_price:m(r),cart_total_quantity:o,cart_items:n?.map(u=>({product_id:_(u.productId),variant_id:_(u.variantId),product_vendor:w(u.productVendor)||"",product_price:m(u.productPrice),product_quantity:u.productQuantity??null,product_sku:w(u.productSku)||""}))};await R(d,c)}async function ar(e){let t=I(e);if(!t)return;let{searchQuery:r,currency:o}=e,n=e.hasLocalizedPaths??C?.hasLocalizedPaths,s=e.workerUrl??C?.workerUrl,a=V(t,"search_submitted",n);if(!a)return;let c={...a,cart_currency:o,search_query:w(r)};await R(c,s)}async function sr(e){let t=I(e);if(!t)return;let{cartTotalPrice:r,cartSubtotalPrice:o,cartShippingPrice:n,cartTaxAmount:s,cartDiscountAmount:a,customerId:c,cartItems:i,currency:d}=e,u=e.hasLocalizedPaths??C?.hasLocalizedPaths,p=e.workerUrl??C?.workerUrl,l=V(t,"checkout_started",u);if(!l)return;let v=0,y=i?.map(f=>{let T=f.productQuantity??0;return v+=T,{product_id:_(f.productId),variant_id:_(f.variantId),product_vendor:w(f.productVendor)||"",vendor:w(f.productVendor)||"",product_price:m(f.productPrice),total_price:m(f.productPrice),product_quantity:T,quantity:T,product_sku:w(f.productSku)||"",sku:w(f.productSku)||"",total_discount:m(f.totalDiscount)}})||[],h={...l,cart_currency:d,cart_total_price:m(r),cart_subtotal_price:m(o),cart_total_quantity:v,cart_shipping_price:m(n),cart_tax_amount:m(s),cart_discount_amount:m(a),cart_items:y,customer_id:c};await R(h,p)}async function ir(e){let t=I(e);if(!t)return;let{orderId:r,cartTotalPrice:o,cartSubtotalPrice:n,cartShippingPrice:s,cartTaxAmount:a,cartDiscountAmount:c,customerId:i,isFirstOrder:d,noteAttributes:u,cartItems:p,currency:l}=e,v=e.hasLocalizedPaths??C?.hasLocalizedPaths,y=e.ordersWorkerUrl??C?.ordersWorkerUrl??Kt,h=V(t,"checkout_completed",v);if(!h)return;let f=0,T=p?.map(g=>{let N=g.productQuantity??0;return f+=N,{product_id:_(g.productId),variant_id:_(g.variantId),product_vendor:w(g.productVendor)||"",vendor:w(g.productVendor)||"",product_price:m(g.productPrice),total_price:m(g.productPrice),product_quantity:N,quantity:N,product_sku:w(g.productSku)||"",sku:w(g.productSku)||"",total_discount:m(g.totalDiscount)}})||[],P={...h,cart_currency:l,cart_total_price:m(o),cart_subtotal_price:m(n),cart_total_quantity:f,cart_shipping_price:m(s),cart_tax_amount:m(a),cart_discount_amount:m(c),cart_items:T,order_id:r,customer_id:i,is_first_order:d??null,note_attributes:u};await R(P,y)}function dr(e){let{storeId:t,hasLocalizedPaths:r,currency:o,workerUrl:n,enabled:s=!0,pathname:a}=e,c=cr(null),[i,d]=lr(()=>a||(typeof window<"u"?window.location.pathname:""));Ke(()=>{a&&d(a)},[a]),Ke(()=>{typeof window>"u"||!s||c.current!==i&&(c.current=i,Xe({storeId:t,hasLocalizedPaths:r,currency:o,workerUrl:n}))},[i,t,r,o,n,s])}import H from"react";var X=new Map;function O(e){X.set(e.type,e)}function Z(e){return X.get(e)}function Ze(){return Array.from(X.values())}function et(e){return X.has(e)}function ur(e){try{let o=new URL(e,"https://example.com").pathname.match(/\/products\/([^\/\?]+)/);return o?o[1]:null}catch{return null}}function pr(e,t,r,o){if(typeof window>"u"||!e.prices||!t)return;let n=e.prices[t];if(!n)return;let s=n.price?.[r],a=n.compare?.[r],c=o;if(c?.selectorsV2?.length)for(let i of c.selectorsV2){if(i.price&&s){let d=i.price.replace("{{variant}}",t);document.querySelectorAll(d).forEach(p=>{let l=new Intl.NumberFormat("en-US",{style:"currency",currency:r}).format(parseFloat(s));p.textContent=l})}if(i.compareAt&&a){let d=i.compareAt.replace("{{variant}}",t);document.querySelectorAll(d).forEach(p=>{let l=new Intl.NumberFormat("en-US",{style:"currency",currency:r}).format(parseFloat(a));p.textContent=l})}if(i.saving&&s&&a)for(let d of i.saving){let u=d.selector.replace("{{variant}}",t);document.querySelectorAll(u).forEach(l=>{let v=parseFloat(s),y=parseFloat(a),h=y-v;if(d.isPercentage){let f=Math.round(h/y*100);l.textContent=`${f}%`}else{let f=new Intl.NumberFormat("en-US",{style:"currency",currency:r}).format(h);l.textContent=f}})}}}var _e={type:"PRICE_PLUS",shouldActivate(e,t){let r=e.data;if(!r)return!1;let{productId:o,productHandle:n}=t,s=n||ur(t.currentUrl),a=o&&r.productIds?.includes(o),c=s&&r.handles?.includes(s);return a||c},applyEffect(e,t,r){pr(t,r.variantId,r.currencyCode||"USD",r.selectors)},getVariantData(e,t,r){let o=e.data;return{prices:t.prices,matchedProductId:r.productId,productIds:o?.productIds,handles:o?.handles,handlerActivated:!0}}};function fr(e,t){let o=e.data?.pathnames||[];if(!o.length)return!0;try{let s=new URL(t,"https://example.com").pathname;return o.some(a=>A(s,a))}catch{return!1}}var ee={type:"CONTENT",shouldActivate(e,t){return fr(e,t.currentUrl)},getVariantData(e,t,r){let o=e.data;return{content:t.content,pathnames:o?.pathnames,handlerActivated:!0}}};function mr(e,t){let o=e.data?.pathnames||[];if(!o.length)return!0;try{let s=new URL(t,"https://example.com").pathname;return o.some(a=>A(s,a))}catch{return!1}}var be={type:"CUSTOM_CODE",shouldActivate(e,t){return mr(e,t.currentUrl)},getVariantData(e,t,r){let o=e.data;return{customCode:t.customCode,pathnames:o?.pathnames,excludePathnames:o?.excludePathnames,handlerActivated:!0}}};O(_e);O(ye);O(ee);O(be);function gr(e){if(typeof window>"u")return{currentUrl:"",selectors:e};let t=window.location.href,r=window.location.pathname,o,n=r.match(/\/products\/([^\/\?]+)/);n&&(o=n[1]);let s,c=new URLSearchParams(window.location.search).get("variant");return c&&(s=c),{currentUrl:t,productHandle:o,variantId:s,selectors:e,currencyCode:"USD"}}function yr(e){let{config:t,previewState:r,selectors:o}=te(),[n,s]=H.useState(null),[a,c]=H.useState(!0),i=H.useMemo(()=>t&&t.tests.find(l=>l.testId===e)||null,[t,e]),d=H.useMemo(()=>r||D(),[r]),u=H.useRef(null),p=H.useRef(null);return H.useEffect(()=>{let l=!0;if(t===null)return;if(!i){u.current!==e&&(u.current=e,console.warn(`[ElevateAB] Test not found: ${e}`)),l&&c(!1);return}if(!i.enabled&&!d?.isPreview){u.current!==`${e}-disabled`&&(u.current=`${e}-disabled`,console.warn(`[ElevateAB] Test disabled: ${e}`)),l&&c(!1);return}let v=S(e);if(!v){l&&c(!1);return}let y=i.variations.find(P=>P.id===v);if(!y){l&&c(!1);return}let h=Z(i.type),f=gr(o),T={...y};if(h?.shouldActivate(i,f)){let P=`${e}-${y.id}`;h.applyEffect&&p.current!==P&&(p.current=P,h.applyEffect(i,y,f));let g=h.getVariantData(i,y,f);T={...T,...g}}return l&&s(T),d?.isPreview||fe(e),l&&c(!1),()=>{l=!1}},[t,i,e,d,o]),{variant:n,isLoading:a,isControl:n?.isControl??!1,isA:n?.isA??!1,isB:n?.isB??!1,isC:n?.isC??!1,isD:n?.isD??!1}}import b,{useRef as wr,useCallback as Cr}from"react";function Ee(e){return e.tests.some(t=>t.type==="CUSTOM_CODE"&&t.enabled)}function ke(e,t,r){if(typeof window>"u")return;if(console.log("[ElevateAB Custom Code] All tests:",e.tests.map(s=>({id:s.testId,type:s.type,enabled:s.enabled}))),!Ee(e)){console.log("[ElevateAB Custom Code] No CUSTOM_CODE tests found");return}let o=e.tests.filter(s=>s.type==="CUSTOM_CODE"&&s.enabled);console.log("[ElevateAB Custom Code] Found",o.length,"CUSTOM_CODE tests");let n=[];o.forEach(s=>{let a=S(s.testId);if(console.log("[ElevateAB Custom Code] Test",s.testId,"assigned variant:",a),!a)return;let c=s.variations.find(i=>i.id===a);if(console.log("[ElevateAB Custom Code] Variation data:",c),!c?.customCode){console.log("[ElevateAB Custom Code] No customCode on variation");return}(c.customCode.js||c.customCode.css)&&(console.log("[ElevateAB Custom Code] Adding custom code:",c.customCode),n.push(c.customCode))}),n.length>0?(console.log("[ElevateAB Custom Code] Applying",n.length,"custom code blocks"),Y(n,r)):console.log("[ElevateAB Custom Code] No custom code to apply")}function hr(e,t,r){typeof window>"u"||ke(e,t,r)}function tt(e,t,r){if(typeof window>"u")return()=>{};let o=()=>{hr(e,t,r)};return window.addEventListener("popstate",o),()=>{window.removeEventListener("popstate",o)}}import{jsx as _r,jsxs as br}from"react/jsx-runtime";var vr="https://ds0wlyksfn0sb.cloudfront.net/headless";function Tr(e){return e.replace(/^https?:\/\//,"").replace(".myshopify.com","")}function rt(e){return`${vr}/${Tr(e)}.js`}function Pr({storeId:e,storefrontAccessToken:t,preventFlickering:r=!1,flickerTimeout:o=3e3,nonce:n,children:s}){let[a,c]=b.useState(null),[i,d]=b.useState(null),[u,p]=b.useState(null);b.useEffect(()=>{if(typeof window>"u")return;Pe({storeId:e,storefrontAccessToken:t});let T=D();d(T);let P=B();p(P)},[e,t]);let l=Cr(()=>{typeof window<"u"&&window.__eab_reveal&&window.__eab_reveal()},[]);b.useEffect(()=>{async function T(){try{let P=typeof window<"u"?D():null,g=null;if(typeof window<"u"&&window.eab_data)g=window.eab_data;else{let F=rt(e);g=await new Promise((xe,nt)=>{let L=document.createElement("script");L.src=F,L.async=!0,L.onload=()=>{let Se=window.eab_data;L.remove(),Se?xe(Se):nt(new Error("Failed to load config: window.eab_data is undefined"))},L.onerror=()=>{L.remove(),xe({allTests:{},selectors:{selectorsV2:[]}})},document.head.appendChild(L)})}if(!g||!g.allTests||Object.keys(g.allTests).length===0){c({tests:[],selectors:void 0}),l();return}if(g.subscriptionPaused){console.error(`[ElevateAB] Subscription is paused or stopped for store: ${e}. `+(g.subscriptionMessage||"A/B tests will not run. Please reactivate your subscription.")),c({tests:[],selectors:void 0}),l();return}if(!(Object.keys(g.allTests||{}).length>0)){c({tests:[],selectors:void 0}),l();return}let z=Ue(g);if(pe(z,P),z.tests.some(F=>F.type==="SPLIT_URL")&&q(z,P))return;c(z),l()}catch(P){console.error("[ElevateAB] Failed to load config:",P),c({tests:[],selectors:void 0}),l()}}T()},[e,l]),b.useEffect(()=>!a||typeof window>"u"||!Q(a)?void 0:(K(a,i,n),Te(a,i,n)),[a,i,n]),b.useEffect(()=>!a||typeof window>"u"||!Ee(a)?void 0:(ke(a,i,n),tt(a,i,n)),[a,i,n]);let v=b.useMemo(()=>({config:a,storeId:e,storefrontAccessToken:t,isPreviewMode:i?.isPreview??!1,previewTestId:i?.previewTestId??null,previewState:i,selectors:a?.selectors,countryCode:u}),[a,e,t,i,u]),y=wr(!1);b.useEffect(()=>{!t&&!y.current&&(y.current=!0,console.warn("[ElevateAB] No storefrontAccessToken provided. Orders won't be attributed to test variants."))},[t]);let h=b.useMemo(()=>rt(e),[e]),f=b.useMemo(()=>me({configUrl:h,timeout:r?o:2e3}),[h,r,o]);return br(Ae.Provider,{value:v,children:[_r("script",{nonce:n,dangerouslySetInnerHTML:{__html:f}}),s]})}var An="1.1.2";export{Et as CART_ATTRIBUTES_UPDATE_MUTATION,Ht as COUNTRIES,At as ElevateAnalytics,Pr as ElevateProvider,Dt as REGIONS,An as VERSION,We as applyContentChanges,je as applyContentElements,Y as applyCustomCode,pe as assignAllTests,Pt as assignAndPersistVariant,yt as buildEabTestsParam,_t as canAssignToTest,Re as checkFacebookBrowser,st as checkFacebookInstagramBrowser,Le as checkInstagramBrowser,Oe as checkPinterestBrowser,Be as checkTikTokBrowser,it as checkVisitorIdParams,ne as cleanCartToken,St as cleanupCartAttributes,Qe as cleanupContentTests,wt as clearPreviewMode,ee as contentHandler,ct as deleteCookie,qt as detectShopifyCurrency,re as extractCartToken,ot as extractProductId,at as extractProductVariantId,_ as extractShopifyId,Ft as extractShopifyType,Ze as getAllHandlers,S as getAssignedVariant,kt as getCartAttributesPayload,E as getCookie,B as getCountryCode,Vt as getDeviceType,Lt as getGeoLocation,Z as getHandler,k as getJsonCookie,$ as getJsonSessionItem,ae as getPageTypeFromPathname,D as getPreviewState,gt as getPreviewVariation,ue as getReferrerData,de as getSessionId,lt as getSessionItem,me as getSplitUrlBlockingScript,vt as getTestList,Rt as getTrafficSource,se as getUserAgentNoBrowser,le as getVisitorId,Q as hasContentTests,et as hasHandler,Ut as hasSessionView,It as hasUniqueView,ft as hashString,Pe as initAnalytics,ut as initializeSessionId,dt as initializeVisitorId,Me as isCountryExcluded,De as isCountryIncluded,Ct as isInPreviewMode,mt as isPreviewTest,$t as isShopifyGid,Ot as matchesGeoTargeting,A as matchesWildcardPattern,oe as parseAddViewData,K as processContentTests,q as processSplitUrlTests,O as registerHandler,Ce as reprocessContentTests,Ye as restoreOriginalElements,m as roundToTwo,w as sanitizeString,Tt as saveTestList,x as setCookie,He as setCountryCode,Bt as setGeoLocation,pt as setReferrerData,ce as setSessionItem,Te as setupContentTestListeners,bt as shouldShowTest,rr as trackAddToCart,or as trackCartView,ir as trackCheckoutCompleted,sr as trackCheckoutStarted,Xe as trackPageView,tr as trackProductView,nr as trackRemoveFromCart,ar as trackSearchSubmitted,Ve as trackSessionView,Ie as trackUniqueView,fe as trackViews,xt as updateCartAttributes,ht as updateUrlWithTestParams,te as useElevateConfig,yr as useExperiment,dr as usePageViewTracking,ie as uuidv4};
29
+ })();`}function Gt(t){if(!t?.trim())return"";try{let r=`https://${t.trim().replace(/^https?:\/\//,"")}`,o=new URL(r.replace(/\/+$/,""));return o.hostname.startsWith("www.")&&(o.hostname=o.hostname.substring(4)),o.toString().replace(/\/+$/,"")}catch{return t.trim().replace(/\/+$/,"")}}function Tt(t,e){let r=Gt(t.split("?")[0]);for(let o of e){let n=Gt(o.split("?")[0]);if(r===n)return!0;try{let a=new URL(t).pathname,i=new URL(o,t).pathname;if(a===i)return!0}catch{}}return!1}function je(t){return t.data?.redirectBehavior||"redirectAll"}function Wt(t){return!!(b("eabRedirectedTests")||{})[t]}function jt(t){let e=b("eabRedirectedTests")||{};e[t]=!0,S("eabRedirectedTests",JSON.stringify(e))}function Je(t,e){for(let r of t.tests)if(!(r.type!=="SPLIT_URL"||!r.enabled))for(let o of r.variations){let n=o.splitUrlTestLinks||[];if(n.length!==0&&Tt(e,n))return{test:r,matchedVariation:o,isControlUrl:!!o.isControl}}return null}function Ye(t){if(typeof window>"u")return;let e=new URL(t,window.location.origin);e.searchParams.set("abtr","true");let r=e.toString(),o=window.__remixRouter?.navigate??window.next?.router?.push??window.$nuxt?.$router?.push??window.__navigate;if(o&&typeof o=="function")try{let n=e.pathname+e.search;o(n);return}catch{}window.location.href=r}function q(t,e){if(typeof window>"u")return!1;let r=window.location.href;if(new URLSearchParams(window.location.search).get("abtr")==="true")return!1;let n=Je(t,r);if(!n)return!1;let{test:a,matchedVariation:i,isControlUrl:c}=n,s=a.testId,d=je(a),u=x(s);if(!u)return!1;let p=a.variations.find(h=>h.id===u);if(!p)return!1;let l=p.splitUrlTestLinks||[];if(l.length===0||Tt(r,l))return!1;switch(d){case"redirectOnlyControlUrl":if(!c||p.isControl)return!1;break;case"redirectOnce":if(Wt(s))return!1;jt(s);break;case"redirectOnceControlUrlOnly":if(!c||Wt(s)||p.isControl)return!1;jt(s);break;default:break}let v=l[0];return Ye(v),!0}function Jt(t){return t.tests.some(e=>e.type==="SPLIT_URL"&&e.enabled)}var Pt={type:"SPLIT_URL",shouldActivate(t,e){for(let r of t.variations){let o=r.splitUrlTestLinks||[];if(Tt(e.currentUrl,o))return!0}return!1},getVariantData(){return{handlerActivated:!0}}};function E(t){return t?t.includes("gid://")&&t.split("/").pop()||t:""}function Qe(t){return!t||!t.includes("gid://")?null:t.split("/")[3]||null}function Ke(t){return!!t&&t.startsWith("gid://shopify/")}function Xe(){if(typeof window>"u")return;let t=window.Shopify;if(t?.currency?.active)return t.currency.active}var Yt="elv-el-",Qt={ELEMENT_NODE:1,TEXT_NODE:3},K=new Map,X=new Map,Z=new Map,tt=new Map,M=!1;function A(t,e){if(e==="*")return!0;if(e.startsWith("*")&&e.endsWith("*")){let r=e.slice(1,-1);return t.includes(r)}if(e.startsWith("*")){let r=e.slice(1);return t.endsWith(r)}return e===t}function kt(){return typeof window>"u"?!1:window.innerWidth<768}function Ze(t){let e="";for(let r=0;r<t.length;r++){let o=t[r];o>="A"&&o<="Z"?(r!==0&&(e+="-"),e+=o.toLowerCase()):e+=o}return e}function tr(t){return t.nodeType===Qt.TEXT_NODE}function Et(t){return t.nodeType===Qt.ELEMENT_NODE}function _t(t,e){K.has(t)||K.set(t,e.cloneNode(!0))}function Kt(t){let e=t;e=e.replace(/&#96;/g,"`").replace(/&#36;/g,"$");try{e=JSON.parse('"'+e+'"')}catch{}return e}function Xt(t){if(typeof window>"u"||t.length===0)return;let e=window.location.pathname,r=t.filter(n=>n.pathnames?.length?n.pathnames.some(a=>A(e,a)):!0);M=kt();let o=r.map(n=>({...n,style:n.style?{...n.style.lg,...M&&n.style.sm}:void 0,content:n.content&&M&&n.content.sm?n.content.sm:n.content?.lg}));o.filter(n=>n.content!==void 0).forEach(n=>{(n.applyAll?Array.from(document.querySelectorAll(n.selector)):[document.querySelector(n.selector)].filter(Boolean)).forEach((i,c)=>{if(!i)return;let s=n.applyAll?`${n.selector}-${c}-${i.id||Math.random().toString(36).substr(2,9)}`:n.selector;_t(s,i),tr(i)?i.nodeValue=n.content:Et(i)&&(i.innerHTML=n.content)})}),o.filter(n=>n.style!==void 0).forEach(n=>{let a=document.querySelector(n.selector);!a||!Et(a)||(_t(n.selector,a),Object.entries(n.style).forEach(([i,c])=>{let s=Ze(i),d=c.toString().includes("!important"),u=c.toString().replace(/\s*!important\s*$/,"");a.style.setProperty(s,u,d?"important":void 0)}))}),o.filter(n=>n.attributes!==void 0).forEach(n=>{let a=document.querySelector(n.selector);!a||!Et(a)||(_t(n.selector,a),Object.entries(n.attributes).forEach(([i,c])=>{a.setAttribute(i,c)}))})}function Zt(t){if(typeof window>"u"||t.length===0)return;let e=window.location.pathname;t.filter(o=>o.selector?.pathnames?.length?o.selector.pathnames.some(n=>A(e,n)):!0).forEach(o=>{let n=`${Yt}${o.id}`;if(tt.has(n))return;let a=document.querySelector(o.selector.target);if(!a||a.parentElement?.querySelector(`#${n}`))return;let i=te(o);o.selector.placement==="after"?a.after(i):o.selector.placement==="before"&&a.before(i),tt.set(n,i)})}function te(t){let e=document.createElement(t.tagName);return e.id=`${Yt}${t.id}`,t.style&&Object.assign(e.style,t.style),t.attributes&&Object.entries(t.attributes).forEach(([r,o])=>{e.setAttribute(r,o)}),t.kind==="text"&&t.content&&(e.innerText=t.content),t.kind==="container"&&t.childrens&&t.childrens.forEach(r=>{let o=te(r);e.appendChild(o)}),e}function et(t,e){if(typeof window>"u"||t.length===0)return;let r=window.location.pathname;t.filter(n=>n.pathnames?.length?n.excludePathnames?.length&&n.excludePathnames.some(i=>A(r,i))?!1:n.pathnames.some(a=>A(r,a)):!0).forEach(n=>{n.id&&(n.css&&er(n.id,n.css),n.js&&rr(n.id,n.js,e))})}function er(t,e){let r=`css-${t}`;if(X.has(r)||document.getElementById(r))return;let o=document.createElement("style");o.id=r,o.textContent=Kt(e),document.head.appendChild(o),X.set(r,o)}function rr(t,e,r){let o=`js-${t}`;if(Z.has(o)||document.getElementById(o))return;let n=document.createElement("script");n.id=o,r&&n.setAttribute("nonce",r);let a=Kt(e);n.textContent="(function(){try{"+a+"}catch(e){console.error('[ElevateAB] Custom script error:', e)}})();",document.head.appendChild(n),Z.set(o,n)}function ee(){K.forEach((t,e)=>{let r=document.querySelector(e);r&&r.replaceWith(t.cloneNode(!0))})}function re(){X.forEach(t=>t.remove()),X.clear(),Z.forEach(t=>t.remove()),Z.clear(),tt.forEach(t=>t.remove()),tt.clear(),K.clear()}function nr(t,e){let r=[],o=[],n=[];return t.tests.filter(i=>i.type==="CONTENT"&&i.enabled).forEach(i=>{let c=x(i.testId);if(!c)return;let s=i.variations.find(d=>d.id===c);s?.content&&(s.content.changes?.length&&r.push(...s.content.changes),s.content.elements?.length&&o.push(...s.content.elements),s.content.customCodes?.length&&n.push(...s.content.customCodes))}),{changes:r,elements:o,blocks:[],customCodes:n}}function G(t){return t.tests.some(e=>e.type==="CONTENT"&&e.enabled)}function rt(t,e,r){if(typeof window>"u"||!G(t))return;let o=nr(t,e);(o.changes.length>0||o.elements.length>0||o.customCodes.length>0)&&(Xt(o.changes),Zt(o.elements),et(o.customCodes,r))}function bt(t,e,r){if(typeof window>"u")return;let o=kt();o!==M&&(ee(),M=o),rt(t,e,r)}function St(t,e,r,o=!0){if(typeof window>"u")return()=>{};let n=()=>{kt()!==M&&bt(t,e,r)};window.addEventListener("resize",n);let a=()=>{};return o&&(a=N(()=>{bt(t,e,r)})),()=>{window.removeEventListener("resize",n),a(),re()}}import{useEffect as ne,useRef as hr,useState as yr}from"react";var or="https://bitter-river-9c62.support-67d.workers.dev",ar="https://d339co84ntxcme.cloudfront.net/Prod/orders",C=null;function xt(t){C=t}function I(t){let e=t?.storeId||C?.storeId;return e||(console.warn("[ElevateAB] No storeId provided. Call initAnalytics() first or pass storeId to tracking function."),"")}function ir(t){return Object.entries(t).filter(([,e])=>typeof e=="string").map(([e,r])=>({test_id:e,variant_id:r}))}function sr(t,e){return Object.entries(t).filter(([r])=>typeof e[r]=="string").map(([r])=>({test_id:r,variant_id:e[r]}))}function cr(){return typeof window>"u"?!1:_("eabUserPreview")==="true"||new URLSearchParams(window.location.search).get("eabUserPreview")==="true"}function V(t,e,r){if(typeof window>"u"||cr())return null;let o=navigator.userAgent,n=window.location.pathname,a=dt(n,r),{referrer:i,entryPage:c}=ht(),s=lt({referrer:i,entryPage:c,userAgent:o}),d=b("ABTL")||{},u=b("ABAU")||{},p=ir(d),l=sr(u,d),v=st(localStorage.getItem("shopifyCartId")),h=new Date().toISOString(),y=sessionStorage.getItem("eabIsFirstVisit")==="true",f=_("localization")||"";return{pixel_event_id:`sh-${pt()}`,shop_name:t,timestamp:h,event_type:e,client_id:_("_shopify_y")||void 0,visitor_id:mt(),session_id:gt(),cart_token:ct(v||_("cart")),page_url:window.location.href,page_pathname:n,page_search:window.location.search,referrer_url:i,referrer_source:s?.referrer_source,previous_page:document.referrer,page_entry:c,page_entry_path:s?.page_entry_path,page_type:a,utm_medium:s?.utm_medium,utm_source:s?.utm_source,utm_campaign:s?.utm_campaign,utm_content:s?.utm_content,utm_term:s?.utm_term,gclid:s?.gclid,fbclid:s?.fbclid,pins_campaign_id:s?.pins_campaign_id,epik:s?.epik,browser_info:s?.browser_info,os_info:s?.os_info,device_type:s?.device_type,language:navigator.language,root_route:localStorage.getItem("eabRootRoute")||"",user_agent:o,user_agent_no_browser:ut(o),is_first_visit:y,shopify_country:f,ab_test_assignments:p,ab_test_views:l,is_first_order:null}}async function R(t,e=or){try{let r=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t),keepalive:!0});if(!r.ok)throw new Error(`Worker error: ${r.status}`)}catch(r){console.error("[ElevateAB] Error sending analytics:",r)}}async function oe(t={}){let e=I(t);if(!e)return;let r=t.hasLocalizedPaths??C?.hasLocalizedPaths,o=t.workerUrl??C?.workerUrl,n=V(e,"page_viewed",r);if(!n)return;let a={...n,cart_currency:t.currency};await R(a,o)}async function lr(t){let e=I(t);if(!e)return;let{productId:r,productVendor:o,productPrice:n,productSku:a,currency:i}=t,c=t.hasLocalizedPaths??C?.hasLocalizedPaths,s=t.workerUrl??C?.workerUrl,d=V(e,"product_viewed",c);if(!d)return;let u={...d,cart_currency:i,product_id:E(r),product_vendor:w(o),product_price:g(n),product_sku:w(a)};await R(u,s)}async function dr(t){let e=I(t);if(!e)return;let{productId:r,variantId:o,productVendor:n,productPrice:a,productQuantity:i,productSku:c,currency:s,cartId:d}=t,u=t.hasLocalizedPaths??C?.hasLocalizedPaths,p=t.workerUrl??C?.workerUrl,l=t.storefrontAccessToken??C?.storefrontAccessToken,v=V(e,"product_added_to_cart",u);if(!v)return;let h={...v,cart_currency:s,product_id:E(r),variant_id:E(o),product_vendor:w(n),product_price:g(a),product_quantity:i,product_sku:w(c)};if(await R(h,p),d&&l)try{let{updateCartAttributes:y}=await import("./cartAttributes-UOPTEP2Q.js");await y(d,{storefrontAccessToken:l})}catch(y){console.error("[ElevateAB] Failed to update cart attributes:",y)}}async function ur(t){let e=I(t);if(!e)return;let{productId:r,variantId:o,productVendor:n,productPrice:a,productQuantity:i,productSku:c,currency:s}=t,d=t.hasLocalizedPaths??C?.hasLocalizedPaths,u=t.workerUrl??C?.workerUrl,p=V(e,"product_removed_from_cart",d);if(!p)return;let l={...p,cart_currency:s,product_id:E(r),variant_id:E(o),product_vendor:w(n),product_price:g(a),product_quantity:i,product_sku:w(c)};await R(l,u)}async function pr(t){let e=I(t);if(!e)return;let{cartTotalPrice:r,cartTotalQuantity:o,cartItems:n,currency:a}=t,i=t.hasLocalizedPaths??C?.hasLocalizedPaths,c=t.workerUrl??C?.workerUrl,s=V(e,"cart_viewed",i);if(!s)return;let d={...s,cart_currency:a,cart_total_price:g(r),cart_total_quantity:o,cart_items:n?.map(u=>({product_id:E(u.productId),variant_id:E(u.variantId),product_vendor:w(u.productVendor)||"",product_price:g(u.productPrice),product_quantity:u.productQuantity??null,product_sku:w(u.productSku)||""}))};await R(d,c)}async function fr(t){let e=I(t);if(!e)return;let{searchQuery:r,currency:o}=t,n=t.hasLocalizedPaths??C?.hasLocalizedPaths,a=t.workerUrl??C?.workerUrl,i=V(e,"search_submitted",n);if(!i)return;let c={...i,cart_currency:o,search_query:w(r)};await R(c,a)}async function mr(t){let e=I(t);if(!e)return;let{cartTotalPrice:r,cartSubtotalPrice:o,cartShippingPrice:n,cartTaxAmount:a,cartDiscountAmount:i,customerId:c,cartItems:s,currency:d}=t,u=t.hasLocalizedPaths??C?.hasLocalizedPaths,p=t.workerUrl??C?.workerUrl,l=V(e,"checkout_started",u);if(!l)return;let v=0,h=s?.map(f=>{let T=f.productQuantity??0;return v+=T,{product_id:E(f.productId),variant_id:E(f.variantId),product_vendor:w(f.productVendor)||"",vendor:w(f.productVendor)||"",product_price:g(f.productPrice),total_price:g(f.productPrice),product_quantity:T,quantity:T,product_sku:w(f.productSku)||"",sku:w(f.productSku)||"",total_discount:g(f.totalDiscount)}})||[],y={...l,cart_currency:d,cart_total_price:g(r),cart_subtotal_price:g(o),cart_total_quantity:v,cart_shipping_price:g(n),cart_tax_amount:g(a),cart_discount_amount:g(i),cart_items:h,customer_id:c};await R(y,p)}async function gr(t){let e=I(t);if(!e)return;let{orderId:r,cartTotalPrice:o,cartSubtotalPrice:n,cartShippingPrice:a,cartTaxAmount:i,cartDiscountAmount:c,customerId:s,isFirstOrder:d,noteAttributes:u,cartItems:p,currency:l}=t,v=t.hasLocalizedPaths??C?.hasLocalizedPaths,h=t.ordersWorkerUrl??C?.ordersWorkerUrl??ar,y=V(e,"checkout_completed",v);if(!y)return;let f=0,T=p?.map(m=>{let z=m.productQuantity??0;return f+=z,{product_id:E(m.productId),variant_id:E(m.variantId),product_vendor:w(m.productVendor)||"",vendor:w(m.productVendor)||"",product_price:g(m.productPrice),total_price:g(m.productPrice),product_quantity:z,quantity:z,product_sku:w(m.productSku)||"",sku:w(m.productSku)||"",total_discount:g(m.totalDiscount)}})||[],P={...y,cart_currency:l,cart_total_price:g(o),cart_subtotal_price:g(n),cart_total_quantity:f,cart_shipping_price:g(a),cart_tax_amount:g(i),cart_discount_amount:g(c),cart_items:T,order_id:r,customer_id:s,is_first_order:d??null,note_attributes:u};await R(P,h)}function wr(t){let{storeId:e,hasLocalizedPaths:r,currency:o,workerUrl:n,enabled:a=!0,pathname:i}=t,c=hr(null),[s,d]=yr(()=>i||(typeof window<"u"?window.location.pathname:""));ne(()=>{i&&d(i)},[i]),ne(()=>{typeof window>"u"||!a||c.current!==s&&(c.current=s,oe({storeId:e,hasLocalizedPaths:r,currency:o,workerUrl:n}))},[s,e,r,o,n,a])}import H from"react";var nt=new Map;function O(t){nt.set(t.type,t)}function ot(t){return nt.get(t)}function ae(){return Array.from(nt.values())}function ie(t){return nt.has(t)}function Cr(t){try{let o=new URL(t,"https://example.com").pathname.match(/\/products\/([^\/\?]+)/);return o?o[1]:null}catch{return null}}function vr(t,e,r,o){if(typeof window>"u"||!t.prices||!e)return;let n=t.prices[e];if(!n)return;let a=n.price?.[r],i=n.compare?.[r],c=o;if(c?.selectorsV2?.length)for(let s of c.selectorsV2){if(s.price&&a){let d=s.price.replace("{{variant}}",e);document.querySelectorAll(d).forEach(p=>{let l=new Intl.NumberFormat("en-US",{style:"currency",currency:r}).format(parseFloat(a));p.textContent=l})}if(s.compareAt&&i){let d=s.compareAt.replace("{{variant}}",e);document.querySelectorAll(d).forEach(p=>{let l=new Intl.NumberFormat("en-US",{style:"currency",currency:r}).format(parseFloat(i));p.textContent=l})}if(s.saving&&a&&i)for(let d of s.saving){let u=d.selector.replace("{{variant}}",e);document.querySelectorAll(u).forEach(l=>{let v=parseFloat(a),h=parseFloat(i),y=h-v;if(d.isPercentage){let f=Math.round(y/h*100);l.textContent=`${f}%`}else{let f=new Intl.NumberFormat("en-US",{style:"currency",currency:r}).format(y);l.textContent=f}})}}}var At={type:"PRICE_PLUS",shouldActivate(t,e){let r=t.data;if(!r)return!1;let{productId:o,productHandle:n}=e,a=n||Cr(e.currentUrl),i=o&&r.productIds?.includes(o),c=a&&r.handles?.includes(a);return i||c},applyEffect(t,e,r){vr(e,r.variantId,r.currencyCode||"USD",r.selectors)},getVariantData(t,e,r){let o=t.data;return{prices:e.prices,matchedProductId:r.productId,productIds:o?.productIds,handles:o?.handles,handlerActivated:!0}}};function Tr(t,e){let o=t.data?.pathnames||[];if(!o.length)return!0;try{let a=new URL(e,"https://example.com").pathname;return o.some(i=>A(a,i))}catch{return!1}}var at={type:"CONTENT",shouldActivate(t,e){return Tr(t,e.currentUrl)},getVariantData(t,e,r){let o=t.data;return{content:e.content,pathnames:o?.pathnames,handlerActivated:!0}}};function Pr(t,e){let o=t.data?.pathnames||[];if(!o.length)return!0;try{let a=new URL(e,"https://example.com").pathname;return o.some(i=>A(a,i))}catch{return!1}}var Ut={type:"CUSTOM_CODE",shouldActivate(t,e){return Pr(t,e.currentUrl)},getVariantData(t,e,r){let o=t.data;return{customCode:e.customCode,pathnames:o?.pathnames,excludePathnames:o?.excludePathnames,handlerActivated:!0}}};O(At);O(Pt);O(at);O(Ut);function Er(t){if(typeof window>"u")return{currentUrl:"",selectors:t};let e=window.location.href,r=window.location.pathname,o,n=r.match(/\/products\/([^\/\?]+)/);n&&(o=n[1]);let a,c=new URLSearchParams(window.location.search).get("variant");return c&&(a=c),{currentUrl:e,productHandle:o,variantId:a,selectors:t,currencyCode:"USD"}}function _r(t){let{config:e,previewState:r,selectors:o}=it(),[n,a]=H.useState(null),[i,c]=H.useState(!0),s=H.useMemo(()=>e&&e.tests.find(l=>l.testId===t)||null,[e,t]),d=H.useMemo(()=>r||D(),[r]),u=H.useRef(null),p=H.useRef(null);return H.useEffect(()=>{let l=!0;if(e===null)return;if(!s){u.current!==t&&(u.current=t,console.warn(`[ElevateAB] Test not found: ${t}`)),l&&c(!1);return}if(!s.enabled&&!d?.isPreview){u.current!==`${t}-disabled`&&(u.current=`${t}-disabled`,console.warn(`[ElevateAB] Test disabled: ${t}`)),l&&c(!1);return}let v=x(t);if(!v){l&&c(!1);return}let h=s.variations.find(P=>P.id===v);if(!h){l&&c(!1);return}let y=ot(s.type),f=Er(o),T={...h};if(y?.shouldActivate(s,f)){let P=`${t}-${h.id}`;y.applyEffect&&p.current!==P&&(p.current=P,y.applyEffect(s,h,f));let m=y.getVariantData(s,h,f);T={...T,...m}}return l&&a(T),d?.isPreview||wt(t),l&&c(!1),()=>{l=!1}},[e,s,t,d,o]),{variant:n,isLoading:i,isControl:n?.isControl??!1,isA:n?.isA??!1,isB:n?.isB??!1,isC:n?.isC??!1,isD:n?.isD??!1}}import k,{useRef as br,useCallback as kr}from"react";function It(t){return t.tests.some(e=>e.type==="CUSTOM_CODE"&&e.enabled)}function se(t,e,r){if(typeof window>"u")return;if(console.log("[ElevateAB Custom Code] All tests:",t.tests.map(a=>({id:a.testId,type:a.type,enabled:a.enabled}))),!It(t)){console.log("[ElevateAB Custom Code] No CUSTOM_CODE tests found");return}let o=t.tests.filter(a=>a.type==="CUSTOM_CODE"&&a.enabled);console.log("[ElevateAB Custom Code] Found",o.length,"CUSTOM_CODE tests");let n=[];o.forEach(a=>{let i=x(a.testId);if(console.log("[ElevateAB Custom Code] Test",a.testId,"assigned variant:",i),!i)return;let c=a.variations.find(s=>s.id===i);if(console.log("[ElevateAB Custom Code] Variation data:",c),!c?.customCode){console.log("[ElevateAB Custom Code] No customCode on variation");return}(c.customCode.js||c.customCode.css)&&(console.log("[ElevateAB Custom Code] Adding custom code:",c.customCode),n.push(c.customCode))}),n.length>0?(console.log("[ElevateAB Custom Code] Applying",n.length,"custom code blocks"),et(n,r)):console.log("[ElevateAB Custom Code] No custom code to apply")}import{jsx as Ur,jsxs as Ir}from"react/jsx-runtime";var Sr="https://ds0wlyksfn0sb.cloudfront.net/headless";function xr(t){return t.replace(/^https?:\/\//,"").replace(".myshopify.com","")}function ce(t){return`${Sr}/${xr(t)}.js`}function Ar({storeId:t,storefrontAccessToken:e,preventFlickering:r=!1,flickerTimeout:o=3e3,nonce:n,children:a}){let[i,c]=k.useState(null),[s,d]=k.useState(null),[u,p]=k.useState(null);k.useEffect(()=>{if(typeof window>"u")return;xt({storeId:t,storefrontAccessToken:e});let T=D();d(T);let P=B();p(P)},[t,e]);let l=kr(()=>{typeof window<"u"&&window.__eab_reveal&&window.__eab_reveal()},[]);k.useEffect(()=>{async function T(){try{let P=typeof window<"u"?D():null,m=null;if(typeof window<"u"&&window.eab_data)m=window.eab_data;else{let j=ce(t);m=await new Promise((Vt,le)=>{let L=document.createElement("script");L.src=j,L.async=!0,L.onload=()=>{let Rt=window.eab_data;L.remove(),Rt?Vt(Rt):le(new Error("Failed to load config: window.eab_data is undefined"))},L.onerror=()=>{L.remove(),Vt({allTests:{},selectors:{selectorsV2:[]}})},document.head.appendChild(L)})}if(!m||!m.allTests||Object.keys(m.allTests).length===0){c({tests:[],selectors:void 0}),l();return}if(m.subscriptionPaused){console.error(`[ElevateAB] Subscription is paused or stopped for store: ${t}. `+(m.subscriptionMessage||"A/B tests will not run. Please reactivate your subscription.")),c({tests:[],selectors:void 0}),l();return}if(!(Object.keys(m.allTests||{}).length>0)){c({tests:[],selectors:void 0}),l();return}let W=Bt(m);if(yt(W,P),W.tests.some(j=>j.type==="SPLIT_URL")&&q(W,P))return;c(W),l()}catch(P){console.error("[ElevateAB] Failed to load config:",P),c({tests:[],selectors:void 0}),l()}}T()},[t,l]),k.useEffect(()=>{if(!i||typeof window>"u")return;let T=()=>{Jt(i)&&q(i,s)||(G(i)&&rt(i,s,n),It(i)&&se(i,s,n))};T();let P=N(()=>{T()}),m=G(i)?St(i,s,n,!1):()=>{};return()=>{P(),m()}},[i,s,n]);let v=k.useMemo(()=>({config:i,storeId:t,storefrontAccessToken:e,isPreviewMode:s?.isPreview??!1,previewTestId:s?.previewTestId??null,previewState:s,selectors:i?.selectors,countryCode:u}),[i,t,e,s,u]),h=br(!1);k.useEffect(()=>{!e&&!h.current&&(h.current=!0,console.warn("[ElevateAB] No storefrontAccessToken provided. Orders won't be attributed to test variants."))},[e]);let y=k.useMemo(()=>ce(t),[t]),f=k.useMemo(()=>vt({configUrl:y,timeout:r?o:2e3}),[y,r,o]);return Ir(Lt.Provider,{value:v,children:[Ur("script",{nonce:n,dangerouslySetInnerHTML:{__html:f}}),a]})}var zn="1.1.2";export{Ie as CART_ATTRIBUTES_UPDATE_MUTATION,$e as COUNTRIES,Be as ElevateAnalytics,Ar as ElevateProvider,qe as REGIONS,zn as VERSION,Xt as applyContentChanges,Zt as applyContentElements,et as applyCustomCode,yt as assignAllTests,xe as assignAndPersistVariant,Pe as buildEabTestsParam,Ae as canAssignToTest,Dt as checkFacebookBrowser,pe as checkFacebookInstagramBrowser,Nt as checkInstagramBrowser,zt as checkPinterestBrowser,Mt as checkTikTokBrowser,fe as checkVisitorIdParams,ct as cleanCartToken,Le as cleanupCartAttributes,re as cleanupContentTests,_e as clearPreviewMode,at as contentHandler,me as deleteCookie,Xe as detectShopifyCurrency,st as extractCartToken,de as extractProductId,ue as extractProductVariantId,E as extractShopifyId,Qe as extractShopifyType,ae as getAllHandlers,x as getAssignedVariant,Ve as getCartAttributesPayload,_ as getCookie,B as getCountryCode,De as getDeviceType,Me as getGeoLocation,ot as getHandler,b as getJsonCookie,J as getJsonSessionItem,dt as getPageTypeFromPathname,D as getPreviewState,Te as getPreviewVariation,ht as getReferrerData,gt as getSessionId,ge as getSessionItem,vt as getSplitUrlBlockingScript,ke as getTestList,Ne as getTrafficSource,ut as getUserAgentNoBrowser,mt as getVisitorId,G as hasContentTests,ie as hasHandler,Oe as hasSessionView,He as hasUniqueView,Ce as hashString,xt as initAnalytics,ye as initializeSessionId,he as initializeVisitorId,qt as isCountryExcluded,$t as isCountryIncluded,be as isInPreviewMode,ve as isPreviewTest,Ke as isShopifyGid,Fe as matchesGeoTargeting,A as matchesWildcardPattern,lt as parseAddViewData,rt as processContentTests,q as processSplitUrlTests,O as registerHandler,bt as reprocessContentTests,ee as restoreOriginalElements,g as roundToTwo,w as sanitizeString,Se as saveTestList,S as setCookie,Ft as setCountryCode,ze as setGeoLocation,we as setReferrerData,ft as setSessionItem,St as setupContentTestListeners,Ue as shouldShowTest,dr as trackAddToCart,pr as trackCartView,gr as trackCheckoutCompleted,mr as trackCheckoutStarted,oe as trackPageView,lr as trackProductView,ur as trackRemoveFromCart,fr as trackSearchSubmitted,Ht as trackSessionView,Ot as trackUniqueView,wt as trackViews,Re as updateCartAttributes,Ee as updateUrlWithTestParams,it as useElevateConfig,_r as useExperiment,wr as usePageViewTracking,pt as uuidv4};
30
30
  //# sourceMappingURL=index.js.map