Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Full file version
!(function () {
"use strict";
var e = {
693: function (e, t, n) {
var r,
o =
(this && this.__extends) ||
((r = function (e, t) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (e, t) {
e.__proto__ = t;
}) ||
function (e, t) {
for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
})(e, t);
}),
function (e, t) {
function n() {
this.constructor = e;
}
r(e, t), (e.prototype = null === t ? Object.create(t) : ((n.prototype = t.prototype), new n()));
});
Object.defineProperty(t, "__esModule", { value: !0 }), (t.CustomerEventsObserver = void 0);
var i = (function (e) {
function t() {
return (null !== e && e.apply(this, arguments)) || this;
}
return (
o(t, e),
(t.prototype.onPageView = function (e) {}),
(t.prototype.onViewedProductCategory = function (e) {}),
(t.prototype.onViewedProductVariant = function (e) {}),
(t.prototype.onViewedProduct = function (e) {}),
(t.prototype.onAddedProduct = function (e) {}),
(t.prototype.onAddedPayment = function (e) {}),
(t.prototype.onPerformedSearch = function (e) {}),
(t.prototype.onStartedOrder = function (e) {}),
(t.prototype.onCompletedOrder = function (e) {}),
t
);
})(n(385).EcommerceIntegration);
t.CustomerEventsObserver = i;
},
385: function (e, t, n) {
var r,
o =
(this && this.__extends) ||
((r = function (e, t) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (e, t) {
e.__proto__ = t;
}) ||
function (e, t) {
for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
})(e, t);
}),
function (e, t) {
function n() {
this.constructor = e;
}
r(e, t), (e.prototype = null === t ? Object.create(t) : ((n.prototype = t.prototype), new n()));
});
Object.defineProperty(t, "__esModule", { value: !0 }),
(t.EcommerceIntegration = t.ANALYTICS_ADDED_PAYMENT = t.ANALYTICS_PERFORMED_SEARCH = t.ANALYTICS_STARTED_ORDER = t.ANALYTICS_COMPLETED_ORDER = t.ANALYTICS_ADDED_PRODUCT = t.ANALYTICS_VIEWED_PRODUCT_CATEGORY = t.ANALYTICS_VIEWED_PRODUCT = t.ANALYTICS_PAGE_VIEW = t.ANALYTICS_GENERIC_EVENT = void 0);
var i = n(372),
a = n(454),
c = n(930),
s = n(542),
u = n(997),
p = n(102),
d = {
viewedProduct: /^[ _]?viewed[ _]?product[ _]?$/i,
viewedProductCategory: /^[ _]?viewed[ _]?product[ _]?category[ _]?$/i,
viewedProductVariant: /^[ _]?viewed[ _]?product[ _]?variant[ _]?$/i,
addedProduct: /^[ _]?added[ _]?product[ _]?$/i,
completedOrder: /^[ _]?completed[ _]?order[ _]?$/i,
startedOrder: /^[ _]?started[ _]?order[ _]?$/i,
performedSearch: /^[ _]?performed[ _]?search[ _]?$/i,
addedPayment: /^[ _]?added[ _]?payment[ _]?$/i,
};
(t.ANALYTICS_GENERIC_EVENT = "genericEvent"),
(t.ANALYTICS_PAGE_VIEW = "pageView"),
(t.ANALYTICS_VIEWED_PRODUCT = "viewedProduct"),
(t.ANALYTICS_VIEWED_PRODUCT_CATEGORY = "viewedProductCategory"),
(t.ANALYTICS_ADDED_PRODUCT = "addedProduct"),
(t.ANALYTICS_COMPLETED_ORDER = "completedOrder"),
(t.ANALYTICS_STARTED_ORDER = "startedOrder"),
(t.ANALYTICS_PERFORMED_SEARCH = "performedSearch"),
(t.ANALYTICS_ADDED_PAYMENT = "addedPayment");
var v = (function (e) {
function t(t, n, r) {
var o = e.call(this, t, n) || this;
return (
(o.shopId = void 0),
(o.checkoutToken = void 0),
(o.visitToken = void 0),
(o.uniqueToken = void 0),
(o.appName = void 0),
o.wrapTrack(),
r && ((o.shopId = r.shopId), (o.appName = r.appName), (o.checkoutToken = r.checkoutToken), (o.visitToken = r.visitToken), (o.uniqueToken = r.uniqToken)),
o
);
}
return (
o(t, e),
(t.prototype.ensureTrackingConsent = function (e, t) {
u.privacyApiMethods.userCanBeTracked() ? e() : (document.addEventListener(s.TrackingConsentEvents.TRACKING_ACCEPTED, e), t());
}),
(t.prototype.wrapTrack = function () {
var e = this.track;
this.track = function (t) {
var n = t.event,
r = !1;
for (var o in d) {
var i = d[o];
if (this[o] && i.test(n)) {
this[o].apply(this, [t]), (r = !0);
break;
}
}
r || e.apply(this, Array.prototype.slice.call(arguments));
};
}),
(t.prototype.executeMonorailEvent = function (e, t) {
var n = e.eventName,
r = e.eventProperties,
o = void 0 === r ? void 0 : r,
i = e.eventId,
a = void 0 === i ? void 0 : i,
s = e.schemaId,
u = void 0 === s ? void 0 : s;
if (this.appName && this.appName in c.appNameToEcommerceEventSchemaId) {
var d = this.getEcommercePixelIds();
t({
schemaId: u || c.appNameToEcommerceEventSchemaId[this.appName],
payload: p.objectAssignFilterUndefined(
{ shop_id: this.shopId, partner_name: this.getEcommerceMetricsTag(), event_name: n, unique_token: this.uniqueToken, visit_token: this.visitToken },
{ pixel_id: d && d.length > 0 ? d[0] : void 0, event_properties: o, checkout_token: this.checkoutToken, event_id: a }
),
}),
n in c.ecommerceEventNameSchemaId && t({ schemaId: c.ecommerceEventNameSchemaId[n], payload: { shop_id: this.shopId, partner_name: this.getEcommerceMetricsTag() } });
}
}),
(t.prototype.addMonorailBatchEvent = function (e) {
this.executeMonorailEvent(e, a.addBatchEvent);
}),
(t.prototype.produceMonorailEvent = function (e) {
this.executeMonorailEvent(e, function (e) {
return a.produce([e]);
});
}),
t
);
})(i.Integration);
t.EcommerceIntegration = v;
},
372: function (e, t) {
var n =
(this && this.__assign) ||
function () {
return (n =
Object.assign ||
function (e) {
for (var t, n = 1, r = arguments.length; n < r; n++) for (var o in (t = arguments[n])) Object.prototype.hasOwnProperty.call(t, o) && (e[o] = t[o]);
return e;
}).apply(this, arguments);
};
Object.defineProperty(t, "__esModule", { value: !0 }), (t.Integration = void 0);
var r = (function () {
function e(e, t) {
(this.options = {}), (this.options = n(n({}, e), t));
}
return (
(e.flatten = function (e) {
var t = n({}, e);
return (t.properties = {}), n(n({}, t), e.properties);
}),
(e.isEqual = function (e, t) {
for (var n in e) if (e[n] !== t[n]) return !1;
for (var n in t) if (t[n] !== e[n]) return !1;
return !0;
}),
e
);
})();
t.Integration = r;
},
930: function (e, t) {
Object.defineProperty(t, "__esModule", { value: !0 }),
(t.extractSchemaIdFromEventName = t.trekkieAssetContextSchemaId = t.customerEventSchemaId = t.ecommerceEventNameSchemaId = t.eventParityTestingSchemaId = t.appNameToEcommerceEventSchemaId = t.appNameToPageViewSchemaId = void 0),
(t.appNameToPageViewSchemaId = {
admin: "trekkie_admin_page_view/1.0",
appstore: "trekkie_appstore_page_view/1.2",
blog: "trekkie_blog_page_view/1.2",
brochure: "trekkie_brochure_page_view/1.2",
checkout: "trekkie_checkout_page_view/1.2",
"compass-web": "trekkie_compass_web_page_view/1.2",
docs: "trekkie_docs_page_view/1.2",
development: "edge_test/1.0",
exchange: "trekkie_exchange_page_view/1.2",
handshake: "trekkie_handshake_page_view/1.0",
identity: "trekkie_identity_page_view/1.2",
"marketing-misc": "trekkie_marketing_misc_page_view/1.2",
oberlo: "trekkie_oberlo_app_page_view/1.0",
"oberlo-home": "trekkie_oberlo_home_page_view/1.3",
"oberlo-courses": "trekkie_oberlo_courses_page_view/1.0",
opinions: "trekkie_opinions_page_view/1.2",
partners: "trekkie_partners_page_view/1.2",
"shopify-ping-web": "trekkie_shopify_ping_web_page_view/1.0",
smiley: "trekkie_smiley_page_view/1.2",
storefront: "trekkie_storefront_page_view/1.2",
testing: "edge_test/1.0",
themestore: "trekkie_themestore_page_view/1.2",
}),
(t.appNameToEcommerceEventSchemaId = { storefront: "trekkie_storefront_ecommerce_event_emit/3.0", checkout: "trekkie_checkout_ecommerce_event_emit/3.0", test: "edge_test_ecommerce_event_emit/1.0" }),
(t.eventParityTestingSchemaId = "trekkie_integration_parity_event_emit/2.0"),
(t.ecommerceEventNameSchemaId = {
addedPayment: "trekkie_ecommerce_event_emit_added_payment/1.0",
addedProduct: "trekkie_ecommerce_event_emit_added_product/1.0",
completedOrder: "trekkie_ecommerce_event_emit_completed_order/1.0",
genericEvent: "trekkie_ecommerce_event_emit_generic_event/1.0",
pageView: "trekkie_ecommerce_event_emit_page_view/1.0",
performedSearch: "trekkie_ecommerce_event_emit_performed_search/1.0",
viewedProductCategory: "trekkie_ecommerce_event_emit_product_category_view/1.0",
viewedProduct: "trekkie_ecommerce_event_emit_product_view/1.0",
startedOrder: "trekkie_ecommerce_event_emit_started_order/1.0",
}),
(t.customerEventSchemaId = "trekkie_customer_events/2.0"),
(t.trekkieAssetContextSchemaId = "trekkie_asset_context/1.0"),
(t.extractSchemaIdFromEventName = function (e) {
var t = "monorail://",
n = e.toLowerCase();
if (0 === n.lastIndexOf(t) && n.length > t.length) return n.substr(t.length);
});
},
793: function (e, t) {
Object.defineProperty(t, "__esModule", { value: !0 }), (t.TrackingConsentEvents = void 0), ((t.TrackingConsentEvents || (t.TrackingConsentEvents = {})).TRACKING_ACCEPTED = "trackingConsentAccepted");
},
291: function (e, t) {
var n;
Object.defineProperty(t, "__esModule", { value: !0 }), (t.TrackingRegulations = void 0), ((n = t.TrackingRegulations || (t.TrackingRegulations = {})).GDPR = "GDPR"), (n.CCPA = "CCPA"), (n.NO_VALUE = "");
},
542: function (e, t, n) {
Object.defineProperty(t, "__esModule", { value: !0 }), (t.TrackingRegulations = t.TrackingConsentEvents = void 0);
var r = n(793);
Object.defineProperty(t, "TrackingConsentEvents", {
enumerable: !0,
get: function () {
return r.TrackingConsentEvents;
},
});
var o = n(291);
Object.defineProperty(t, "TrackingRegulations", {
enumerable: !0,
get: function () {
return o.TrackingRegulations;
},
});
},
878: function (e, t, n) {
var r,
o =
(this && this.__extends) ||
((r = function (e, t) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (e, t) {
e.__proto__ = t;
}) ||
function (e, t) {
for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
})(e, t);
}),
function (e, t) {
function n() {
this.constructor = e;
}
r(e, t), (e.prototype = null === t ? Object.create(t) : ((n.prototype = t.prototype), new n()));
}),
i =
(this && this.__assign) ||
function () {
return (i =
Object.assign ||
function (e) {
for (var t, n = 1, r = arguments.length; n < r; n++) for (var o in (t = arguments[n])) Object.prototype.hasOwnProperty.call(t, o) && (e[o] = t[o]);
return e;
}).apply(this, arguments);
};
Object.defineProperty(t, "__esModule", { value: !0 }), (t.FacebookPixel = void 0);
var a = n(724),
c = n(385),
s = n(930),
u = n(503),
p = n(997),
d = n(725),
v = n(454),
f = (function (e) {
function t(n, r, o) {
var c = e.call(this, t.defaultOptions, i(i({}, n), { agent: "shopify" }), r.defaultAttributes) || this;
return (
(c.campaignManager = new a.CampaignManager()),
e.prototype.ensureTrackingConsent.call(
c,
function () {
c.initialize(o);
},
o
),
c
);
}
return (
o(t, e),
(t.prototype.isEssential = function () {
return !1;
}),
(t.prototype.identify = function (e) {
throw new Error("identify is not supported");
}),
(t.prototype.page = function (e) {
window.fbq("track", "PageView"), this.addMonorailBatchEvent({ eventName: c.ANALYTICS_PAGE_VIEW });
}),
(t.prototype.track = function (e) {
var t = {};
for (var n in e.properties) "revenue" === n ? (t.value = this.formatRevenue(e.properties.revenue)) : (t[n] = e.properties[n]);
}),
(t.prototype.viewedProductCategory = function (e) {}),
(t.prototype.viewedProductVariant = function (e) {}),
(t.prototype.viewedProduct = function (e) {
var t = e.properties,
n = {
content_ids: this.getProductContentIds(t),
content_type: this.getProductContentType(t),
content_name: t.name || "",
content_category: t.category || "",
currency: this.getCurrency(t.currency),
value: this.formatRevenue(t.price),
};
window.fbq("track", "ViewContent", n), this.addMonorailBatchEvent({ eventName: c.ANALYTICS_VIEWED_PRODUCT, eventProperties: JSON.stringify(n) });
}),
(t.prototype.addedProduct = function (e) {
var t = e.properties,
n = {
content_ids: this.getProductContentIds(t),
content_type: this.getProductContentType(t),
content_name: t.name || "",
content_category: t.category || "",
currency: this.getCurrency(t.currency),
value: this.formatRevenue(t.price),
num_items: this.getProductNumItems(t),
};
window.fbq("track", "AddToCart", n), this.addMonorailBatchEvent({ eventName: c.ANALYTICS_ADDED_PRODUCT, eventProperties: JSON.stringify(n) });
}),
(t.prototype.addedPayment = function (e) {
var t = e.properties,
n = { currency: this.getCurrency(t.currency), value: this.formatRevenue(t.total) };
window.fbq("track", "AddPaymentInfo", n), this.addMonorailBatchEvent({ eventName: c.ANALYTICS_ADDED_PAYMENT, eventProperties: JSON.stringify(n) });
}),
(t.prototype.performedSearch = function (e) {
var t = { search_string: e.properties.query || "" };
window.fbq("track", "Search", t), this.addMonorailBatchEvent({ eventName: c.ANALYTICS_PERFORMED_SEARCH, eventProperties: JSON.stringify(t) });
}),
(t.prototype.startedOrder = function (e) {
var t = e.properties,
n = {
content_ids: this.getOrderContentIds(t),
content_type: this.getOrderContentType(t),
currency: this.getCurrency(t.currency),
value: this.formatRevenue(t.revenue),
num_items: this.getOrderNumItems(t),
};
window.fbq("track", "InitiateCheckout", n), this.addMonorailBatchEvent({ eventName: c.ANALYTICS_STARTED_ORDER, eventProperties: JSON.stringify(n) });
}),
(t.prototype.completedOrder = function (e) {
var t = e.properties,
n = {
content_ids: this.getOrderContentIds(t),
content_type: this.getOrderContentType(t),
currency: this.getCurrency(t.currency),
value: this.formatRevenue(t.revenue),
num_items: this.getOrderNumItems(t),
};
if (this.options.conversionsAPIEnabled && t.customerApiData) {
var r = (this.campaignManager.fetch() || "").match("&?fbclid=([^&]+)"),
o = null;
r && (o = decodeURIComponent(r[1]));
var a = JSON.stringify(i(i({}, n), { checkoutURL: d.href() })),
u = {
schemaId: s.customerEventSchemaId,
payload: {
first_name: t.customerApiData.customer.firstName,
last_name: t.customerApiData.customer.lastName,
event_id: t.customerApiData.pixelEventID,
shop_id: this.shopId,
facebook_pixel_id: t.customerApiData.pixelID,
event_name: "Purchase",
payload: a,
fbclid: o,
fbc: p.read("_fbc") || null,
fbp: p.read("_fbp") || null,
address: JSON.stringify({ city: t.customerApiData.address.city, province: t.customerApiData.address.province, country: t.customerApiData.address.country, zip: t.customerApiData.address.zip }),
phone: t.customerApiData.customer.phoneNumber,
email: t.customerApiData.customer.emailAddress,
ccpa_enforced: p.isCCPAEnforced(),
},
};
v.produce([u]),
window.fbq("track", "Purchase", n, { eventID: t.customerApiData.pixelEventID }),
this.addMonorailBatchEvent({ eventName: c.ANALYTICS_COMPLETED_ORDER, eventProperties: JSON.stringify(n), eventId: t.customerApiData.pixelEventID });
} else window.fbq("track", "Purchase", n), this.addMonorailBatchEvent({ eventName: c.ANALYTICS_COMPLETED_ORDER, eventProperties: JSON.stringify(n) });
}),
(t.prototype.setLimitedDataUseMode = function () {
window.fbq("dataProcessingOptions", ["LDU"], 1, 1e3);
}),
(t.prototype.initialize = function (e) {
this.loadFacebookScript();
for (var t = this.options, n = 0, r = this.getFacebookPixelIds(t); n < r.length; n++) {
var o = r[n];
p.privacyApiMethods.userDataCannotBeSold() && this.setLimitedDataUseMode(), window.fbq("init", o), "" !== t.agent && window.fbq("set", "agent", t.agent, o);
}
e();
}),
(t.prototype.generateScriptTag = function () {
var e = u.virtualDocument().createElement("script");
return (e.async = !0), (e.src = "https://connect.facebook.net/en_US/fbevents.js"), e;
}),
(t.prototype.getFacebookPixelIds = function (e) {
for (var t = [], n = 0, r = e.pixelIds.concat([e.pixelId]); n < r.length; n++) {
var o = r[n];
null !== o && "" !== o && t.push(o);
}
return t;
}),
(t.prototype.loadFacebookScript = function () {
if (!window.fbq || "function" != typeof window.fbq) {
(window.fbq = function () {
window.fbq.callMethod ? window.fbq.callMethod.apply(window.fbq, arguments) : window.fbq.queue.push(arguments);
}),
window._fbq || (window._fbq = window.fbq),
(window.fbq.push = window.fbq),
(window.fbq.loaded = !0),
(window.fbq.version = "2.0"),
(window.fbq.queue = []);
var e = u.virtualDocument().getElementsByTagName("script")[0];
void 0 === e ? document.head.appendChild(this.generateScriptTag()) : e.parentNode.insertBefore(this.generateScriptTag(), e);
}
}),
(t.prototype.formatRevenue = function (e) {
return Number(e || 0).toFixed(2);
}),
(t.prototype.getCurrency = function (e) {
return e || "USD";
}),
(t.prototype.getProductContentIds = function (e) {
var t = e.productId || e.variantId || e.sku;
return t ? [t] : [];
}),
(t.prototype.getProductContentType = function (e) {
return e.productId ? "product_group" : "product";
}),
(t.prototype.getProductNumItems = function (e) {
return e.quantity || this.getProductContentIds(e).length;
}),
(t.prototype.getProductKey = function (e) {
return e.productId || e.variantId || e.sku;
}),
(t.prototype.getOrderContentIds = function (e) {
for (var t = [], n = 0, r = e.products || []; n < r.length; n++) {
var o = r[n],
i = this.getProductKey(o);
i && -1 === t.indexOf(i) && t.push(i);
}
return t;
}),
(t.prototype.getOrderContentType = function (e) {
for (var t = 0, n = e.products || []; t < n.length; t++) if (n[t].productId) return "product_group";
return "product";
}),
(t.prototype.getOrderNumItems = function (e) {
for (var t = 0, n = 0, r = e.products || []; n < r.length; n++) {
var o = r[n];
this.getProductKey(o) && (t += o.quantity || 1);
}
return t;
}),
(t.prototype.getEcommerceMetricsTag = function () {
return "facebook";
}),
(t.prototype.getEcommercePixelIds = function () {
var e = this.options;
return this.getFacebookPixelIds(e);
}),
(t.defaultOptions = { pixelId: "", pixelIds: [], agent: "shopify", conversionsAPIEnabled: !1 }),
t
);
})(c.EcommerceIntegration);
t.FacebookPixel = f;
},
575: function (e, t, n) {
var r,
o =
(this && this.__extends) ||
((r = function (e, t) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (e, t) {
e.__proto__ = t;
}) ||
function (e, t) {
for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
})(e, t);
}),
function (e, t) {
function n() {
this.constructor = e;
}
r(e, t), (e.prototype = null === t ? Object.create(t) : ((n.prototype = t.prototype), new n()));
}),
i =
(this && this.__assign) ||
function () {
return (i =
Object.assign ||
function (e) {
for (var t, n = 1, r = arguments.length; n < r; n++) for (var o in (t = arguments[n])) Object.prototype.hasOwnProperty.call(t, o) && (e[o] = t[o]);
return e;
}).apply(this, arguments);
};
Object.defineProperty(t, "__esModule", { value: !0 }), (t.GoogleAnalytics = void 0);
var a = n(385),
c = n(725),
s = n(503),
u = (function (e) {
function t(n, r, o) {
var i = e.call(this, t.defaultOptions, n, r.defaultAttributes) || this;
return (
(i.pageCalled = !1),
(i.ecommerce = !1),
(i.enhancedEcommerceLoaded = !1),
i.setWindowGa(),
e.prototype.ensureTrackingConsent.call(
i,
function () {
i.initialize(o);
},
o
),
i
);
}
return (
o(t, e),
(t.prototype.identify = function (e) {
throw new Error("identify is not supported");
}),
(t.prototype.isEssential = function () {
return !1;
}),
(t.prototype.page = function (e) {
this.overrideDefaultPageProperties(e);
var t = this.options,
n = this.path(e),
r = e.name || e.title,
o = { page: n, title: r };
window.ga("set", o);
var i = { page: n, title: r, location: e.url };
if (
(this.pageCalled && delete i.location, window.ga("send", "pageview", i), this.addMonorailBatchEvent({ eventName: a.ANALYTICS_PAGE_VIEW, eventProperties: JSON.stringify(i) }), e.name && t.trackNamedPages)
) {
var c = this.convertPageToTrack(e);
(c.properties.nonInteraction = !0), this.trackInternal(c);
}
this.pageCalled = !0;
}),
(t.prototype.track = function (e) {}),
(t.prototype.trackInternal = function (e) {
var t = this.options,
n = e.properties,
r = {
eventAction: e.event,
eventCategory: n.category || "All",
eventLabel: n.label,
eventValue: this.formatValue(n.value || n.revenue),
nonInteraction: !!(n.hasOwnProperty("nonInteraction") ? n.nonInteraction : t.nonInteraction),
};
window.ga("send", "event", r), this.addMonorailBatchEvent({ eventName: a.ANALYTICS_GENERIC_EVENT, eventProperties: JSON.stringify(r) });
}),
(t.prototype.completedOrder = function (e) {
var t = e.properties,
n = t.total || t.revenue || 0,
r = t.orderName || t.checkoutId,
o = t.products || [];
if (r) {
this.ecommerce || (window.ga("require", "ecommerce"), (this.ecommerce = !0));
var i = { affiliation: t.affiliation, shipping: t.shipping, revenue: n, tax: t.tax, id: r, currency: this.getCurrency(t.currency) };
window.ga("ecommerce:addTransaction", i);
for (var c = [], s = 0, u = o; s < u.length; s++) {
var p = u[s],
d = this.createProductTrack(t, p),
v = { category: d.category, quantity: this.getProductQuantity(d), price: d.price, name: d.name, sku: d.sku || d.variantId, id: r, currency: this.getCurrency(d.currency) };
window.ga("ecommerce:addItem", v), c.push(v);
}
window.ga("ecommerce:send"), this.addMonorailBatchEvent({ eventName: a.ANALYTICS_COMPLETED_ORDER, eventProperties: JSON.stringify({ orderInfo: i, items: c }) });
}
}),
(t.prototype.viewedProductVariant = function (e) {}),
(t.prototype.viewedProductEnhanced = function (e) {
var t = e.properties;
this.loadEnhancedEcommerce(e);
var n = this.enhancedEcommerceTrackProduct(t);
window.ga("ec:setAction", "detail");
var r = this.pushEnhancedEcommerce(e);
this.addMonorailBatchEvent({ eventName: a.ANALYTICS_VIEWED_PRODUCT, eventProperties: JSON.stringify({ item: n, event: r }) });
}),
(t.prototype.addedProductEnhanced = function (e) {
var t = e.properties;
this.loadEnhancedEcommerce(e);
var n = this.enhancedEcommerceTrackProduct(t);
window.ga("ec:setAction", "add");
var r = this.pushEnhancedEcommerce(e);
this.addMonorailBatchEvent({ eventName: a.ANALYTICS_ADDED_PRODUCT, eventProperties: JSON.stringify({ item: n, event: r }) });
}),
(t.prototype.startedOrderEnhanced = function (e) {
var t = e.properties,
n = t.products || [];
this.loadEnhancedEcommerce(e);
for (var r = [], o = 0, i = n; o < i.length; o++) {
var c = i[o],
s = this.createProductTrack(t, c),
u = this.enhancedEcommerceTrackProduct(s);
r.push(u);
}
var p = t.step || 1;
window.ga("ec:setAction", "checkout", { step: p });
var d = this.pushEnhancedEcommerce(e);
this.addMonorailBatchEvent({ eventName: a.ANALYTICS_STARTED_ORDER, eventProperties: JSON.stringify({ items: r, checkoutStep: p, event: d }) });
}),
(t.prototype.completedOrderEnhanced = function (e) {
var t = e.properties,
n = t.total || t.revenue || 0,
r = t.orderName || t.checkoutId,
o = t.products || [];
if (r) {
this.loadEnhancedEcommerce(e);
for (var i = [], c = 0, s = o; c < s.length; c++) {
var u = s[c],
p = this.createProductTrack(t, u),
d = this.enhancedEcommerceTrackProduct(p);
i.push(d);
}
var v = { id: r, affiliation: t.affiliation, revenue: n, tax: t.tax, shipping: t.shipping, coupon: t.coupon };
window.ga("ec:setAction", "purchase", v);
var f = this.pushEnhancedEcommerce(e);
this.addMonorailBatchEvent({ eventName: a.ANALYTICS_COMPLETED_ORDER, eventProperties: JSON.stringify({ orderInfo: v, items: i, event: f }) });
}
}),
(t.prototype.initialize = function (e) {
(this.pageCalled = !1), this.loadGAScript();
var n = this.options;
"localhost" === c.hostname() && (n.domain = "none"),
n.enhancedEcommerce && this.enhancedEcommerce(),
window.ga("create", n.trackingId, { cookieDomain: n.domain || t.defaultOptions.domain, siteSpeedSampleRate: n.siteSpeedSampleRate, sampleRate: n.sampleRate, allowLinker: !0 }),
n.doubleClick && window.ga("require", "displayfeatures"),
n.enhancedLinkAttribution && window.ga("require", "linkid"),
n.anonymizeIp && window.ga("set", "anonymizeIp", !0),
e();
}),
(t.prototype.setWindowGa = function () {
(window.ga && "function" == typeof window.ga) ||
(window.ga = function () {
(window.ga.q = window.ga.q || []).push(arguments);
});
}),
(t.prototype.loadGAScript = function () {
(window.GoogleAnalyticsObject = "ga"), this.setWindowGa(), (window.ga.l = new Date().getTime());
var e = s.virtualDocument().createElement("script");
(e.async = !0), (e.src = "https://www.google-analytics.com/analytics.js");
var t = s.virtualDocument().getElementsByTagName("script")[0];
void 0 === t ? document.head.appendChild(e) : t.parentNode.insertBefore(e, t);
}),
(t.prototype.enhancedEcommerce = function () {
(this.viewedProduct = this.viewedProductEnhanced),
(this.addedProduct = this.addedProductEnhanced),
(this.startedOrder = this.startedOrderEnhanced),
(this.completedOrder = this.completedOrderEnhanced);
}),
(t.prototype.path = function (e) {
var t = e.path;
return this.options.includeSearch && e.search && (t += e.search), t;
}),
(t.prototype.formatValue = function (e) {
return !e || e < 0 ? 0 : Math.round(e);
}),
(t.prototype.getProductQuantity = function (e) {
return e.quantity || 1;
}),
(t.prototype.getCurrency = function (e) {
return e || "USD";
}),
(t.prototype.createProductTrack = function (e, t) {
var n = i({}, t);
return (n.currency = t.currency || this.getCurrency(e.currency)), n;
}),
(t.prototype.loadEnhancedEcommerce = function (e) {
this.enhancedEcommerceLoaded || (window.ga("require", "ec"), (this.enhancedEcommerceLoaded = !0));
var t = e.properties;
window.ga("set", "&cu", this.getCurrency(t.currency));
}),
(t.prototype.enhancedEcommerceTrackProduct = function (e) {
var t = { id: e.sku || e.variantId, name: e.name, category: e.category, quantity: this.getProductQuantity(e), price: e.price, brand: e.brand, variant: e.variant, currency: this.getCurrency(e.currency) };
return e.coupon && (t.coupon = e.coupon), window.ga("ec:addProduct", t), t;
}),
(t.prototype.pushEnhancedEcommerce = function (e) {
var t = e.properties,
n = { eventCategory: t.category || "EnhancedEcommerce", eventAction: e.event || "Action not defined", eventLabel: t.label, nonInteraction: !0 };
return window.ga("send", "event", n), n;
}),
(t.prototype.convertPageToTrack = function (e) {
return { event: e.name ? "Viewed " + e.name + " Page" : "Loaded a Page", properties: e.properties, eventId: e.eventId };
}),
(t.prototype.overrideDefaultPageProperties = function (e) {
for (var t in e.properties) "properties" !== t && "name" !== t && t in e && (e[t] = e.properties[t]);
}),
(t.prototype.getEcommerceMetricsTag = function () {
return "google_analytics";
}),
(t.prototype.getEcommercePixelIds = function () {
return [this.options.trackingId];
}),
(t.defaultOptions = {
anonymizeIp: !1,
domain: "auto",
doubleClick: !1,
enhancedEcommerce: !1,
enhancedLinkAttribution: !1,
includeSearch: !1,
nonInteraction: !1,
siteSpeedSampleRate: 1,
sampleRate: 100,
trackNamedPages: !0,
trackingId: "",
}),
t
);
})(a.EcommerceIntegration);
t.GoogleAnalytics = u;
},
87: function (e, t, n) {
var r,
o =
(this && this.__extends) ||
((r = function (e, t) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (e, t) {
e.__proto__ = t;
}) ||
function (e, t) {
for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
})(e, t);
}),
function (e, t) {
function n() {
this.constructor = e;
}
r(e, t), (e.prototype = null === t ? Object.create(t) : ((n.prototype = t.prototype), new n()));
}),
i =
(this && this.__assign) ||
function () {
return (i =
Object.assign ||
function (e) {
for (var t, n = 1, r = arguments.length; n < r; n++) for (var o in (t = arguments[n])) Object.prototype.hasOwnProperty.call(t, o) && (e[o] = t[o]);
return e;
}).apply(this, arguments);
};
Object.defineProperty(t, "__esModule", { value: !0 }), (t.GoogleGtag = void 0);
var a = n(385),
c = n(522),
s = n(997),
u = (function (e) {
function t(t, n, r) {
var o = e.call(this, {}, t, n.defaultAttributes) || this;
return (
e.prototype.ensureTrackingConsent.call(
o,
function () {
o.initialize(r);
},
r
),
o
);
}
return (
o(t, e),
(t.prototype.isEssential = function () {
return !0;
}),
(t.prototype.identify = function (e) {
throw new Error("identify is not supported");
}),
(t.prototype.track = function (e) {}),
(t.prototype.setLimitedDataUseMode = function (e) {
var t = i({}, e);
return (t.restricted_data_processing = !0), t;
}),
(t.prototype.initialize = function (e) {
var t = this.options,
n = { send_page_view: !1 };
this.loadGtagScript(), s.privacyApiMethods.userDataCannotBeSold() && (n = this.setLimitedDataUseMode(n)), window.gtag("config", t.conversionId, n), e();
}),
(t.prototype.loadGtagScript = function () {
var e = this.options;
(!window.dataLayer || (window.dataLayer && !Array.isArray(window.dataLayer))) && (window.dataLayer = []),
(!window.gtag || (window.gtag && "function" != typeof window.gtag)) &&
(window.gtag = function () {
window.dataLayer.push(arguments);
}),
window.gtag("js", new Date()),
c.script({ src: "https://www.googletagmanager.com/gtag/js?id=" + e.conversionId });
}),
(t.prototype.page = function (e) {
var t = "page_view",
n = { send_to: this.gtagEventLabelFor(t), page_path: e.path || "", page_title: e.name || e.title, page_location: e.url };
window.gtag("event", t, n), this.addMonorailBatchEvent({ eventName: a.ANALYTICS_PAGE_VIEW, eventProperties: JSON.stringify(n) });
}),
(t.prototype.viewedProduct = function (e) {
var t = "view_item",
n = e.properties,
r = {
send_to: this.gtagEventLabelFor(t),
ecomm_prodid: this.generateProductIds([n]),
ecomm_totalvalue: n.price * n.quantity,
ecomm_pagetype: "product",
items: [{ id: n.productId || n.variantId, name: n.name, brand: n.brand, category: n.category, coupon: n.coupon, price: n.price.toString(), quantity: n.quantity, variant: n.variant }],
};
window.gtag("event", t, r), this.addMonorailBatchEvent({ eventName: a.ANALYTICS_VIEWED_PRODUCT, eventProperties: JSON.stringify(r) });
}),
(t.prototype.addedProduct = function (e) {
var t = "add_to_cart",
n = e.properties,
r = {
send_to: this.gtagEventLabelFor(t),
ecomm_prodid: this.generateProductIds([n]),
ecomm_totalvalue: n.price * n.quantity,
ecomm_pagetype: "cart",
value: n.price * n.quantity,
currency: n.currency || "USD",
items: [{ id: n.productId || n.variantId, name: n.name, brand: n.brand, category: n.category, coupon: n.coupon, price: n.price.toString(), quantity: n.quantity, variant: n.variant }],
};
window.gtag("event", t, r), this.addMonorailBatchEvent({ eventName: a.ANALYTICS_ADDED_PRODUCT, eventProperties: JSON.stringify(r) });
}),
(t.prototype.completedOrder = function (e) {
var t = "purchase",
n = e.properties,
r = {
send_to: this.gtagEventLabelFor(t),
transaction_id: n.orderName || n.checkoutId,
value: n.revenue,
currency: n.currency || "USD",
tax: n.tax.toString(),
shipping: n.shipping.toString(),
items: n.products.map(function (e) {
return { id: e.productId || e.variantId, name: e.name, brand: e.brand, category: e.category, coupon: e.coupon, price: e.price.toString(), quantity: e.quantity, variant: e.variant };
}),
};
window.gtag("event", t, r), this.addMonorailBatchEvent({ eventName: a.ANALYTICS_COMPLETED_ORDER, eventProperties: JSON.stringify(r) });
}),
(t.prototype.startedOrder = function (e) {
var t = "begin_checkout",
n = e.properties,
r = {
send_to: this.gtagEventLabelFor(t),
ecomm_prodid: this.generateProductIds(n.products),
ecomm_totalvalue: this.cartTotalValue(n.products),
ecomm_pagetype: "cart",
value: n.revenue,
currency: n.currency || "USD",
items: n.products.map(function (e) {
return { id: e.productId || e.variantId, name: e.name, brand: e.brand, category: e.category, coupon: e.coupon, price: e.price.toString(), quantity: e.quantity, variant: e.variant };
}),
coupon: n.coupon,
};
window.gtag("event", t, r), this.addMonorailBatchEvent({ eventName: a.ANALYTICS_STARTED_ORDER, eventProperties: JSON.stringify(r) });
}),
(t.prototype.performedSearch = function (e) {
var t = "search",
n = e.properties,
r = { send_to: this.gtagEventLabelFor(t), search_term: n.query };
window.gtag("event", t, r), this.addMonorailBatchEvent({ eventName: a.ANALYTICS_PERFORMED_SEARCH, eventProperties: JSON.stringify(r) });
}),
(t.prototype.addedPayment = function (e) {
var t = "add_payment_info",
n = e.properties,
r = { send_to: this.gtagEventLabelFor(t), currency: n.currency, total: n.total };
window.gtag("event", t, r), this.addMonorailBatchEvent({ eventName: a.ANALYTICS_ADDED_PAYMENT, eventProperties: JSON.stringify(r) });
}),
(t.prototype.generateProductIds = function (e) {
for (var t = [], n = 0, r = e; n < r.length; n++) {
var o = r[n],
i = "shopify_" + this.targetCountry() + "_" + o.productId + "_" + o.variantId;
t.push(i);
}
return t;
}),
(t.prototype.cartTotalValue = function (e) {
for (var t = 0, n = 0, r = e; n < r.length; n++) {
var o = r[n];
t += o.price * o.quantity;
}
return t;
}),
(t.prototype.targetCountry = function () {
return this.options.targetCountry || "US";
}),
(t.prototype.gtagEventLabelFor = function (e) {
for (var t = 0, n = this.options.eventLabels; t < n.length; t++) {
var r = n[t];
if (r.type === e) return r.action_label;
}
}),
(t.prototype.getEcommerceMetricsTag = function () {
return "google_gtag";
}),
(t.prototype.getEcommercePixelIds = function () {
return [this.options.conversionId];
}),
t
);
})(a.EcommerceIntegration);
t.GoogleGtag = u;
},
142: function (e, t, n) {
var r,
o =
(this && this.__extends) ||
((r = function (e, t) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (e, t) {
e.__proto__ = t;
}) ||
function (e, t) {
for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
})(e, t);
}),
function (e, t) {
function n() {
this.constructor = e;
}
r(e, t), (e.prototype = null === t ? Object.create(t) : ((n.prototype = t.prototype), new n()));
});
Object.defineProperty(t, "__esModule", { value: !0 }), (t.Pinterest = void 0);
var i = n(385),
a = n(930),
c = n(454),
s = n(102),
u = (function (e) {
function t(n, r, o) {
var i = e.call(this, t.defaultOptions, n, r.defaultAttributes) || this;
return (
e.prototype.ensureTrackingConsent.call(
i,
function () {
i.initialize(o);
},
o
),
i
);
}
return (
o(t, e),
(t.prototype.identify = function (e) {}),
(t.prototype.track = function (e) {}),
(t.prototype.page = function (e) {
var t = e.properties;
(t && "product" === t.pageType) || this.emitEvent("PageVisit", e.eventId, i.ANALYTICS_PAGE_VIEW);
}),
(t.prototype.isEssential = function () {
return !1;
}),
(t.prototype.viewedProduct = function (e) {
var t = e.properties,
n = { currency: t.currency, line_items: [{ product_id: t.productId, product_variant_id: t.variantId, product_name: t.name, product_price: t.price, product_quantity: t.quantity }] };
this.emitEvent("PageVisit", e.eventId, i.ANALYTICS_VIEWED_PRODUCT, n);
}),
(t.prototype.viewedProductCategory = function (e) {
this.emitEvent("ViewCategory", e.eventId, i.ANALYTICS_VIEWED_PRODUCT_CATEGORY);
}),
(t.prototype.addedProduct = function (e) {
var t = e.properties,
n = { currency: t.currency, line_items: [{ product_id: t.productId, product_variant_id: t.variantId, product_name: t.name, product_price: t.price, product_quantity: Number(e.properties.quantity) }] };
this.emitEvent("AddToCart", e.eventId, i.ANALYTICS_ADDED_PRODUCT, n);
}),
(t.prototype.completedOrder = function (e) {
var t = e.properties,
n = {
value: t.revenue,
currency: t.currency,
order_quantity: this.getOrderNumItems(t),
line_items: t.products.map(function (e, t) {
return { product_id: e.productId, product_variant_id: e.variantId, product_name: e.name, product_price: e.price, product_quantity: e.quantity };
}),
};
this.emitEvent("Checkout", e.eventId, i.ANALYTICS_COMPLETED_ORDER, n);
}),
(t.prototype.performedSearch = function (e) {
var t = { search_query: e.properties.query };
this.emitEvent("Search", e.eventId, i.ANALYTICS_PERFORMED_SEARCH, t);
}),
(t.prototype.emitEvent = function (e, t, n, r) {
!0 !== this.options.disablePartnerCommunication &&
(window.pintrk("track", e, Object.assign({ np: "shopify" }, r)),
this.addMonorailBatchEvent(s.objectAssignFilterUndefined({ eventName: n }, { eventId: t, eventProperties: r ? JSON.stringify(r) : void 0 }))),
c.addBatchEvent({
schemaId: a.eventParityTestingSchemaId,
payload: s.objectAssignFilterUndefined({ event_id: t, event_name: n, shop_id: this.shopId, integration_id: this.constructor.name }, { event_properties: r ? JSON.stringify(r) : void 0 }),
});
}),
(t.prototype.getOrderNumItems = function (e) {
for (var t = 0, n = 0, r = e.products || []; n < r.length; n++) {
var o = r[n];
this.getProductKey(o) && (t += o.quantity || 1);
}
return t;
}),
(t.prototype.getProductKey = function (e) {
return e.productId || e.variantId || e.sku;
}),
(t.prototype.initialize = function (e) {
var t = this.options;
!0 !== t.disablePartnerCommunication && (this.loadPinterestScript(), window.pintrk("load", t.pixelId, { np: "shopify" }), window.pintrk("page")), e();
}),
(t.prototype.loadPinterestScript = function () {
if (!window.pintrk || "function" != typeof window.pintrk) {
(window.pintrk = function () {
window.pintrk.queue.push(Array.prototype.slice.call(arguments));
}),
(window.pintrk.queue = []),
(window.pintrk.version = "3.0");
var e = document.createElement("script");
(e.async = !0), (e.src = "https://s.pinimg.com/ct/core.js");
var t = document.getElementsByTagName("script")[0];
void 0 === t ? document.head.appendChild(e) : t.parentNode.insertBefore(e, t);
}
}),
(t.prototype.getEcommerceMetricsTag = function () {
return "pinterest";
}),
(t.prototype.getEcommercePixelIds = function () {
return [this.options.pixelId];
}),
(t.defaultOptions = { pixelId: "", disablePartnerCommunication: !1 }),
t
);
})(i.EcommerceIntegration);
t.Pinterest = u;
},
724: function (e, t, n) {
var r,
o =
(this && this.__extends) ||
((r = function (e, t) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (e, t) {
e.__proto__ = t;
}) ||
function (e, t) {
for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
})(e, t);
}),
function (e, t) {
function n() {
this.constructor = e;
}
r(e, t), (e.prototype = null === t ? Object.create(t) : ((n.prototype = t.prototype), new n()));
});
Object.defineProperty(t, "__esModule", { value: !0 }),
(t.CampaignManager = t.TimestampManager = t.SessionAttribution = t.orderCompletionEventKey = t.sessionAttributionTimestampKey = t.sessionAttributionParamsKey = t.sessionAttributionMonorailSchema = t.sessionAttributionEventKey = void 0);
var i = n(997),
a = n(668),
c = n(372),
s = n(725),
u = n(503);
(t.sessionAttributionEventKey = "session-attribution"),
(t.sessionAttributionMonorailSchema = "trekkie_session_attribution/1.2"),
(t.sessionAttributionParamsKey = "_shopify_sa_p"),
(t.sessionAttributionTimestampKey = "_shopify_sa_t"),
(t.orderCompletionEventKey = "Completed Order");
var p = (function (e) {
function n(t, n, r) {
var o = e.call(this, {}, t) || this;
return (
(o.trekkie = n),
(o.timestampManager = new d()),
(o.campaignManager = new v()),
setTimeout(function () {
o.attributeSession();
}, 0),
r(),
o
);
}
return (
o(n, e),
(n.prototype.isEssential = function () {
return !0;
}),
(n.prototype.identify = function (e) {}),
(n.prototype.page = function (e) {}),
(n.prototype.track = function (e) {
var n = this;
e.event === t.sessionAttributionEventKey
? setTimeout(function () {
n.trekkie.emit(t.sessionAttributionEventKey, e, t.sessionAttributionMonorailSchema);
}, 0)
: e.event === t.orderCompletionEventKey && (i.clear(t.sessionAttributionTimestampKey), i.clear(t.sessionAttributionParamsKey));
}),
(n.prototype.attributeSession = function () {
var e = new Date(),
n = s.search(),
r = this.campaignManager.constructCanonicalUtmString(n);
if (this.timestampManager.isValid(e) && this.campaignManager.isValid(r));
else {
var o = "";
try {
o = e.toJSON();
} catch (e) {}
this.track({
event: t.sessionAttributionEventKey,
properties: {
sa_url: s.href(),
sa_referrer: u.virtualDocument().referrer(),
sa_utm_string: r,
sa_token: a.buildToken(),
over_30_minutes: !this.timestampManager.isWithin30MinuteCutOff(e),
cross_utc_midnight: this.timestampManager.isWithin30MinuteCutOff(e) && !this.timestampManager.isSameDayAs(e),
new_campaign: !this.campaignManager.isValid(r),
prev_campaign_params: this.campaignManager.fetch(),
last_extended: this.timestampManager.fetch(),
local_now: o,
},
eventId: a.buildToken(),
});
}
this.timestampManager.extend(e.toJSON()), this.campaignManager.extend(r);
}),
n
);
})(c.Integration);
t.SessionAttribution = p;
var d = (function () {
function e() {}
return (
(e.prototype.fetch = function () {
return i.read(t.sessionAttributionTimestampKey);
}),
(e.prototype.extend = function (e) {
i.cleanupMyShopifyDotComCookie(t.sessionAttributionTimestampKey), i.write(t.sessionAttributionTimestampKey, e, !1);
}),
(e.prototype.isValid = function (e) {
return this.isWithin30MinuteCutOff(e) && this.isSameDayAs(e);
}),
(e.prototype.isWithin30MinuteCutOff = function (e) {
return this.testStoredTimestamp(function (e, t) {
return t.getTime() - e.getTime() <= 18e5;
}, e);
}),
(e.prototype.isSameDayAs = function (e) {
return this.testStoredTimestamp(function (e, t) {
return e.getUTCDate() === t.getUTCDate();
}, e);
}),
(e.prototype.testStoredTimestamp = function (e, t) {
var n = this.fetch();
if (!n) return !1;
try {
return e(new Date(n), t);
} catch (e) {
return !1;
}
}),
e
);
})();
t.TimestampManager = d;
var v = (function () {
function e() {}
return (
(e.prototype.fetch = function () {
return i.read(t.sessionAttributionParamsKey);
}),
(e.prototype.extend = function (e) {
"" === e && (e = this.fetch() || ""), i.cleanupMyShopifyDotComCookie(t.sessionAttributionParamsKey), i.write(t.sessionAttributionParamsKey, e, !1);
}),
(e.prototype.isValid = function (e) {
return "" === e || this.fetch() === e;
}),
(e.prototype.constructCanonicalUtmString = function (t) {
if ("" === t || null == t || "?" === t) return "";
t = "?" === t[0] ? t.slice(1) : t;
for (var n = {}, r = 0, o = t.split("&"); r < o.length; r++) {
var i = o[r].split("=");
if (!(i.length < 2)) {
var a = this.decodeReplacingPlus(i[0]),
c = this.decodeReplacingPlus(i[1]);
c && a && (n[a] = c);
}
}
return e.acceptedQueryStringParams
.filter(function (e) {
return n[e];
})
.map(function (e) {
return encodeURIComponent(e) + "=" + encodeURIComponent(n[e]);
})
.join("&");
}),
(e.prototype.decodeReplacingPlus = function (e) {
return decodeURIComponent(e.replace(/\+/g, " "));
}),
(e.acceptedQueryStringParams = ["utm_source", "utm_medium", "utm_campaign", "utm_term", "utm_content", "ref", "gclid", "fbclid", "shpxid"]),
e
);
})();
t.CampaignManager = v;
},
384: function (e, t, n) {
var r,
o =
(this && this.__extends) ||
((r = function (e, t) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (e, t) {
e.__proto__ = t;
}) ||
function (e, t) {
for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
})(e, t);
}),
function (e, t) {
function n() {
this.constructor = e;
}
r(e, t), (e.prototype = null === t ? Object.create(t) : ((n.prototype = t.prototype), new n()));
});
Object.defineProperty(t, "__esModule", { value: !0 }), (t.Snap = void 0);
var i = n(385),
a = n(503),
c = n(102),
s = (function (e) {
function t(n, r, o) {
var i = e.call(this, t.defaultOptions, n, r.defaultAttributes) || this;
return (
e.prototype.ensureTrackingConsent.call(
i,
function () {
i.initialize(o);
},
o
),
i
);
}
return (
o(t, e),
(t.prototype.isEssential = function () {
return !1;
}),
(t.prototype.identify = function (e) {
throw new Error("identify is not supported");
}),
(t.prototype.page = function (e) {
window.snaptr("track", "PAGE_VIEW", { integration: "shopify-native" }), this.addMonorailBatchEvent({ eventName: i.ANALYTICS_PAGE_VIEW });
}),
(t.prototype.track = function (e) {
var t = {};
for (var n in e.properties) "revenue" === n ? (t.price = this.formatRevenue(e.properties.revenue)) : (t[n] = e.properties[n]);
}),
(t.prototype.viewedProductCategory = function (e) {}),
(t.prototype.viewedProductVariant = function (e) {}),
(t.prototype.viewedProduct = function (e) {
var t = e.properties,
n = {
item_ids: this.getProductContentIds(t),
item_type: this.getProductContentType(t),
item_name: t.name || "",
item_category: t.category || "",
currency: this.getCurrency(t.currency),
price: this.formatRevenue(t.price),
integration: "shopify-native",
};
window.snaptr("track", "VIEW_CONTENT", n), this.addMonorailBatchEvent({ eventName: i.ANALYTICS_VIEWED_PRODUCT, eventProperties: JSON.stringify(n) });
}),
(t.prototype.addedProduct = function (e) {
var t = e.properties,
n = {
item_ids: this.getProductContentIds(t),
item_type: this.getProductContentType(t),
item_name: t.name || "",
item_category: t.category || "",
currency: this.getCurrency(t.currency),
price: this.formatRevenue(t.price),
number_items: this.getProductNumItems(t),
integration: "shopify-native",
};
window.snaptr("track", "ADD_CART", n), this.addMonorailBatchEvent({ eventName: i.ANALYTICS_ADDED_PRODUCT, eventProperties: JSON.stringify(n) });
}),
(t.prototype.addedPayment = function (e) {
var t = e.properties,
n = { currency: this.getCurrency(t.currency), price: this.formatRevenue(t.total), integration: "shopify-native" };
window.snaptr("track", "ADD_BILLING", n), this.addMonorailBatchEvent({ eventName: i.ANALYTICS_ADDED_PAYMENT, eventProperties: JSON.stringify(n) });
}),
(t.prototype.performedSearch = function (e) {
var t = { search_string: e.properties.query || "", integration: "shopify-native" };
window.snaptr("track", "SEARCH", t), this.addMonorailBatchEvent({ eventName: i.ANALYTICS_PERFORMED_SEARCH, eventProperties: JSON.stringify(t) });
}),
(t.prototype.startedOrder = function (e) {
var t = e.properties,
n = {
item_ids: this.getOrderContentIds(t),
item_type: this.getOrderContentType(t),
currency: this.getCurrency(t.currency),
price: this.formatRevenue(t.revenue),
number_items: this.getOrderNumItems(t),
integration: "shopify-native",
};
window.snaptr("track", "START_CHECKOUT", n), this.addMonorailBatchEvent({ eventName: i.ANALYTICS_STARTED_ORDER, eventProperties: JSON.stringify(n) });
}),
(t.prototype.completedOrder = function (e) {
var t = e.properties,
n = c.objectAssignFilterUndefined(
{
item_ids: this.getOrderContentIds(t),
item_type: this.getOrderContentType(t),
currency: this.getCurrency(t.currency),
price: this.formatRevenue(t.revenue),
number_items: this.getOrderNumItems(t),
integration: "shopify-native",
},
{ transaction_id: t.orderId }
);
window.snaptr("track", "PURCHASE", n), this.addMonorailBatchEvent({ eventName: i.ANALYTICS_COMPLETED_ORDER, eventProperties: JSON.stringify(n) });
}),
(t.prototype.initialize = function (e) {
this.loadSnapScript();
var t = this.options;
window.snaptr("init", t.pixelId), e();
}),
(t.prototype.loadSnapScript = function () {
if (!window.snaptr || "function" != typeof window.snaptr) {
(window.snaptr = function () {
window.snaptr.handleRequest ? window.snaptr.handleRequest.apply(window.snaptr, arguments) : window.snaptr.queue.push(arguments);
}),
(window.snaptr.queue = []),
(window.snaptr.push = window.snaptr),
(window.snaptr.loaded = !0);
var e = a.virtualDocument().createElement("script");
(e.async = !0), (e.src = "https://sc-static.net/scevent.min.js");
var t = a.virtualDocument().getElementsByTagName("script")[0];
void 0 === t ? document.head.appendChild(e) : t.parentNode.insertBefore(e, t);
}
}),
(t.prototype.formatRevenue = function (e) {
return Number(e || 0).toFixed(2);
}),
(t.prototype.getCurrency = function (e) {
return e || "USD";
}),
(t.prototype.getProductContentIds = function (e) {
var t = e.productId || e.variantId || e.sku;
return t ? [t] : [];
}),
(t.prototype.getProductContentType = function (e) {
return e.productId ? "product_group" : "product";
}),
(t.prototype.getProductNumItems = function (e) {
return e.quantity || this.getProductContentIds(e).length;
}),
(t.prototype.getProductKey = function (e) {
return e.productId || e.variantId || e.sku;
}),
(t.prototype.getOrderContentIds = function (e) {
for (var t = [], n = 0, r = e.products || []; n < r.length; n++) {
var o = r[n],
i = this.getProductKey(o);
i && -1 === t.indexOf(i) && t.push(i);
}
return t;
}),
(t.prototype.getOrderContentType = function (e) {
for (var t = 0, n = e.products || []; t < n.length; t++) if (n[t].productId) return "product_group";
return "product";
}),
(t.prototype.getOrderNumItems = function (e) {
for (var t = 0, n = 0, r = e.products || []; n < r.length; n++) {
var o = r[n];
this.getProductKey(o) && (t += o.quantity || 1);
}
return t;
}),
(t.prototype.getEcommerceMetricsTag = function () {
return "snap";
}),
(t.prototype.getEcommercePixelIds = function () {
return [this.options.pixelId];
}),
(t.defaultOptions = { pixelId: "" }),
t
);
})(i.EcommerceIntegration);
t.Snap = s;
},
342: function (e, t, n) {
var r,
o =
(this && this.__extends) ||
((r = function (e, t) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (e, t) {
e.__proto__ = t;
}) ||
function (e, t) {
for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
})(e, t);
}),
function (e, t) {
function n() {
this.constructor = e;
}
r(e, t), (e.prototype = null === t ? Object.create(t) : ((n.prototype = t.prototype), new n()));
});
Object.defineProperty(t, "__esModule", { value: !0 }), (t.TikTok = void 0);
var i = n(385),
a = n(503),
c = (function (e) {
function t(n, r, o) {
var i = e.call(this, t.defaultOptions, n, r.defaultAttributes) || this;
return (
e.prototype.ensureTrackingConsent.call(
i,
function () {
i.initialize(o);
},
o
),
i
);
}
return (
o(t, e),
(t.prototype.isEssential = function () {
return !1;
}),
(t.prototype.identify = function (e) {
throw new Error("identify is not supported");
}),
(t.prototype.page = function (e) {
window.ttq.track("Browse"), this.addMonorailBatchEvent({ eventName: i.ANALYTICS_PAGE_VIEW });
}),
(t.prototype.track = function (e) {}),
(t.prototype.viewedProductCategory = function (e) {}),
(t.prototype.viewedProductVariant = function (e) {}),
(t.prototype.viewedProduct = function (e) {
var t = e.properties,
n = {
content_id: this.getProductKey(t),
content_type: this.getProductContentType(t),
content_name: t.name || "",
content_category: t.category || "",
currency: this.getCurrency(t.currency),
price: this.formatRevenue(t.price),
};
window.ttq.track("ViewContent", n), this.addMonorailBatchEvent({ eventName: i.ANALYTICS_VIEWED_PRODUCT, eventProperties: JSON.stringify(n) });
}),
(t.prototype.addedProduct = function (e) {
var t = e.properties,
n = {
content_id: this.getProductKey(t),
content_type: this.getProductContentType(t),
content_name: t.name || "",
content_category: t.category || "",
currency: this.getCurrency(t.currency),
price: this.formatRevenue(t.price),
quantity: this.getProductNumItems(t),
};
window.ttq.track("AddToCart", n), this.addMonorailBatchEvent({ eventName: i.ANALYTICS_ADDED_PRODUCT, eventProperties: JSON.stringify(n) });
}),
(t.prototype.addedPayment = function (e) {
var t = e.properties,
n = { currency: this.getCurrency(t.currency), value: this.formatRevenue(t.total) };
window.ttq.track("AddBilling", n), this.addMonorailBatchEvent({ eventName: i.ANALYTICS_ADDED_PAYMENT, eventProperties: JSON.stringify(n) });
}),
(t.prototype.performedSearch = function (e) {
var t = { query: e.properties.query || "" };
window.ttq.track("Search", t), this.addMonorailBatchEvent({ eventName: i.ANALYTICS_PERFORMED_SEARCH, eventProperties: JSON.stringify(t) });
}),
(t.prototype.startedOrder = function (e) {
var t = e.properties,
n = { contents: this.getOrderContents(t), value: this.formatRevenue(t.revenue), quantity: this.getOrderNumItems(t), currency: this.getCurrency(t.currency) };
window.ttq.track("StartCheckout", n), this.addMonorailBatchEvent({ eventName: i.ANALYTICS_STARTED_ORDER, eventProperties: JSON.stringify(n) });
}),
(t.prototype.completedOrder = function (e) {
var t = e.properties,
n = { contents: this.getOrderContents(t), value: this.formatRevenue(t.revenue), quantity: this.getOrderNumItems(t), currency: this.getCurrency(t.currency) };
window.ttq.track("Purchase", n), this.addMonorailBatchEvent({ eventName: i.ANALYTICS_COMPLETED_ORDER, eventProperties: JSON.stringify(n) });
}),
(t.prototype.initialize = function (e) {
var t = this.options;
this.loadTikTokScript(t.pixelId), e();
}),
(t.prototype.loadTikTokScript = function (e) {
if (!window.ttq || !window.ttq.loaded) {
window.TiktokAnalyticsObject = "ttq";
var t = (window.ttq = window.ttq || []);
(t.methods = ["page", "track", "identify", "instances", "debug", "on", "off", "once", "ready", "alias", "group"]),
(t.setAndDefer = function (e, t) {
e[t] = function () {
e.push([t].concat(Array.prototype.slice.call(arguments, 0)));
};
});
for (var n = 0; n < t.methods.length; n++) t.setAndDefer(t, t.methods[n]);
(t.instance = function (e) {
for (var n = t._i[e] || [], r = 0; r < t.methods.length; r++) t.setAndDefer(n, t.methods[r]);
return n;
}),
(t.load = function (e) {
var n = "https://analytics.tiktok.com/i18n/pixel/events.js";
(t._i = t._i || {}), (t._i[e] = []), (t._i[e]._u = n);
var r = a.virtualDocument().createElement("script");
(r.type = "text/javascript"), (r.async = !0), (r.src = n + "?sdkid=" + e + "&lib=ttq");
var o = a.virtualDocument().getElementsByTagName("script")[0];
void 0 === o ? document.head.appendChild(r) : o.parentNode.insertBefore(r, o), (window.ttq.loaded = !0);
}),
t.load(e),
t.page();
}
}),
(t.prototype.formatRevenue = function (e) {
return Number(e || 0).toFixed(2);
}),
(t.prototype.getCurrency = function (e) {
return e || "USD";
}),
(t.prototype.getProductContentType = function (e) {
return e.productId ? "product_group" : "product";
}),
(t.prototype.getProductNumItems = function (e) {
return e.quantity || 1;
}),
(t.prototype.getProductKey = function (e) {
return e.productId || e.variantId || e.sku || "";
}),
(t.prototype.getOrderContents = function (e) {
for (var t = [], n = 0, r = e.products || []; n < r.length; n++) {
var o = r[n];
t.push({
content_id: this.getProductKey(o),
content_type: this.getProductContentType(o),
content_name: o.name || "",
content_category: o.category || "",
currency: this.getCurrency(o.currency),
price: this.formatRevenue(o.price),
quantity: this.getProductNumItems(o),
});
}
return t;
}),
(t.prototype.getOrderNumItems = function (e) {
for (var t = 0, n = 0, r = e.products || []; n < r.length; n++) {
var o = r[n];
this.getProductKey(o) && (t += o.quantity || 1);
}
return t;
}),
(t.prototype.getEcommerceMetricsTag = function () {
return "tiktok";
}),
(t.prototype.getEcommercePixelIds = function () {
return [this.options.pixelId];
}),
(t.defaultOptions = { pixelId: "" }),
t
);
})(i.EcommerceIntegration);
t.TikTok = c;
},
831: function (e, t, n) {
var r,
o =
(this && this.__extends) ||
((r = function (e, t) {
return (r =
Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array &&
function (e, t) {
e.__proto__ = t;
}) ||
function (e, t) {
for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
})(e, t);
}),
function (e, t) {
function n() {
this.constructor = e;
}
r(e, t), (e.prototype = null === t ? Object.create(t) : ((n.prototype = t.prototype), new n()));
}),
i =
(this && this.__assign) ||
function () {
return (i =
Object.assign ||
function (e) {
for (var t, n = 1, r = arguments.length; n < r; n++) for (var o in (t = arguments[n])) Object.prototype.hasOwnProperty.call(t, o) && (e[o] = t[o]);
return e;
}).apply(this, arguments);
};
Object.defineProperty(t, "__esModule", { value: !0 }), (t.Trekkie = void 0);
var a = n(372),
c = n(930),
s = n(668),
u = n(454),
p = n(971),
d = n(997),
v = (function (e) {
function t(t, n) {
var r = e.call(this, {}, t) || this;
return r.init(t, n), r;
}
return (
o(t, e),
(t.prototype.isEssential = function () {
return !0;
}),
(t.prototype.init = function (e, t) {
var n = "global";
e.monorailRegion && (n = e.monorailRegion),
e.development && (n = "staging"),
u.setMonorailRegion(n),
window.addEventListener("beforeunload", function (e) {
u.flushBatchEvents();
}),
e.defaultAttributes && p.setMetricsOptions(e.defaultAttributes.shopId);
var r = !1;
e.isServerSideCookieWritingEnabled && (r = e.isServerSideCookieWritingEnabled);
var o = new s.UniqueIdManager(r),
a = new s.FirstSeenManager();
(this.defaultAttributes = {
appName: e.appName,
uniqToken: o.longTerm(),
visitToken: o.shortTerm(),
microSessionId: s.buildToken(),
microSessionCount: 0,
firstSeen: a.firstSeen(),
isPersistentCookie: d.isPersistentCookie(),
}),
e.defaultAttributes && (this.defaultAttributes = i(i({}, e.defaultAttributes), this.defaultAttributes)),
d.cleanupOverScopedCookies(),
t();
}),
(t.prototype.identify = function (e) {}),
(t.prototype.page = function (e) {
var t = c.appNameToPageViewSchemaId[this.defaultAttributes.appName];
this.emit("page", e, t);
}),
(t.prototype.track = function (e) {
var t = c.extractSchemaIdFromEventName(e.event);
this.emit("track", e, t);
}),
(t.prototype.emit = function (e, t, n) {
++this.defaultAttributes.microSessionCount, (t = a.Integration.flatten(t));
var r = i(i({}, t), this.defaultAttributes);
(r.eventType = e), n && u.produce([{ schemaId: n, payload: r }]);
}),
t
);
})(a.Integration);
t.Trekkie = v;
},
997: function (e, t, n) {
Object.defineProperty(t, "__esModule", { value: !0 }),
(t.privacyAPISubMethods = t.TrackingRegulationLimitations = t.ConsentValuesV2 = t.CONSENT_COOKIE_NAME = t.resetCookieDomain = t.determineCookieDomain = t.cleanupOverScopedCookies = t.clear = t.write = t.isPersistentCookie = t.read = t.allowed = t.enabled = t.isCCPAEnforced = t.privacyApiMethods = t.cleanupMyShopifyDotComCookie = t.cookieImpl = void 0);
var r,
o,
i = n(503),
a = n(725),
c = n(102),
s = n(542),
u = "_shopify_d",
p = void 0,
d = void 0;
function v() {
if (void 0 === p)
if (l()) p = a.hostname();
else {
for (var e = "", n = 0, r = a.hostname().split(".").reverse(); n < r.length; n++) {
var o = r[n];
e = "" === e ? "." + o : "." + o + e;
var i = c.generateShopifyDValue();
if ((f(u, i, 0, e), (s = u), (d = i), (v = void 0), (v = t.cookieImpl.read(s)) && v === d)) return f(u, i, -1, e), void (p = e);
}
p = "";
}
var s, d, v;
}
function f(e, n, r, o) {
var i = { domain: o, path: "/", maxage: r };
t.cookieImpl.write(e, n, i);
}
function l() {
return -1 !== a.hostname().indexOf("myshopify.com");
}
(t.cookieImpl = {
parse: function (e) {
for (var t = {}, n = 0, r = e.split(/ *; */); n < r.length; n++) {
var o = r[n].split("=");
try {
t[decodeURIComponent(o[0])] = decodeURIComponent(o[1] || "");
} catch (e) {}
}
return t;
},
read: function (e) {
if (t.cookieImpl.enabled()) return t.cookieImpl.parse(i.virtualDocument().cookie())[e];
},
write: function (e, n, r) {
if ((void 0 === r && (r = {}), t.cookieImpl.enabled() && t.cookieImpl.allowed())) {
var o = encodeURIComponent(e) + "=" + encodeURIComponent(n);
r.maxage && (r.expires = new Date(new Date().getTime() + r.maxage)),
r.path && (o += "; path=" + r.path),
r.domain && (o += "; domain=" + r.domain),
r.expires && t.cookieImpl.hasConsent() && (o += "; expires=" + r.expires.toUTCString()),
r.secure && (o += "; secure"),
i.virtualDocument().setCookie(o);
}
},
enabled: function (e) {
if ((void 0 === e && (e = !1), !e && void 0 !== d)) return d;
try {
if (void 0 === i.virtualDocument().cookie()) return !1;
var t = "cookietest";
i.virtualDocument().setCookie(t + "=1");
var n =
-1 !==
i
.virtualDocument()
.cookie()
.indexOf(t + "=");
return i.virtualDocument().setCookie(t + "=1; expires=Thu, 01-Jan-1970 00:00:01 GMT"), n && (d = n), n;
} catch (e) {
return !1;
}
},
allowed: function () {
var e = t.cookieImpl.read("_cookie_consent");
if (e)
try {
var n = JSON.parse(e);
if (n && "non_essential" === n.block) return !1;
} catch (e) {
return !0;
}
return !0;
},
hasConsent: function () {
return t.privacyApiMethods.userCanBeTracked();
},
isPersistentCookie: function () {
var e = t.cookieImpl.read("_shopify_m");
return void 0 === e || "persistent" === e;
},
readConsentCookie: function () {
try {
var e = t.cookieImpl.read("_tracking_consent");
if (void 0 === e) return;
var n = JSON.parse(e);
if (
(function (e) {
var t = Object.keys(e),
n = ["lim", "v", "con", "reg"].slice().sort();
return !(
t.length === n.length &&
t
.slice()
.sort()
.every(function (e, t) {
return e === n[t];
})
);
})(n)
)
return;
return n;
} catch (e) {
return;
}
},
}),
(t.cleanupMyShopifyDotComCookie = function (e) {
if (l()) {
var t = e + "=; path=/; max-age=0; expires=Thu, 01 Jan 1970 00:00:01 GMT";
i.virtualDocument().setCookie(t);
}
}),
(t.privacyApiMethods = {
userCanBeTracked: function () {
return t.privacyAPISubMethods.haveConsentToTrack();
},
hasCustomerPrivacyAPI: function () {
return t.privacyAPISubMethods.hasConsentCookie();
},
userDataCanBeSold: function () {
return t.privacyAPISubMethods.haveConsentToSellData();
},
userDataCannotBeSold: function () {
return !t.privacyApiMethods.userDataCanBeSold();
},
getRegulation: function () {
return t.privacyAPISubMethods.currentRegulation();
},
}),
(t.isCCPAEnforced = function () {
return Boolean(t.privacyApiMethods.getRegulation() === s.TrackingRegulations.CCPA && !0 === t.privacyApiMethods.userDataCannotBeSold());
}),
(t.enabled = function () {
return t.cookieImpl.enabled();
}),
(t.allowed = function () {
return t.cookieImpl.allowed();
}),
(t.read = function (e) {
return t.cookieImpl.read(e);
}),
(t.isPersistentCookie = function () {
return t.cookieImpl.isPersistentCookie();
}),
(t.write = function (e, t, n) {
v(), f(e, t, n ? 31104e6 : 18e5, p);
}),
(t.clear = function (e) {
v(), f(e, "", -1, p);
}),
(t.cleanupOverScopedCookies = function () {
if (l())
for (var e = 0, t = ["_s", "_shopify_fs", "_shopify_s", "_shopify_sa_p", "_shopify_sa_t", "_shopify_y", "_y"]; e < t.length; e++) {
var n = t[e] + "=; domain=.myshopify.com; path=/; max-age=0; expires=Thu, 01 Jan 1970 00:00:01 GMT;";
i.virtualDocument().setCookie(n);
}
}),
(t.determineCookieDomain = v),
(t.resetCookieDomain = function () {
p = void 0;
}),
(t.CONSENT_COOKIE_NAME = "_tracking_consent"),
(function (e) {
(e.NO_VALUE = ""), (e.ACCEPTED = "1"), (e.DECLINED = "0");
})((r = t.ConsentValuesV2 || (t.ConsentValuesV2 = {}))),
(function (e) {
(e.CCPA_BLOCK_ALL = "CCPA_BLOCK_ALL"), (e.GDPR = "GDPR"), (e.CCPA = "CCPA");
})((o = t.TrackingRegulationLimitations || (t.TrackingRegulationLimitations = {}))),
(t.privacyAPISubMethods = {
hasConsentCookie: function () {
return void 0 !== t.cookieImpl.readConsentCookie();
},
haveConsentToTrack: function () {
var e = t.cookieImpl.readConsentCookie();
if (void 0 === e) return !0;
if (!e.lim.includes(o.GDPR)) return !0;
var n = e.con.GDPR,
i = e.reg;
return n !== r.DECLINED && (n !== r.NO_VALUE || i !== s.TrackingRegulations.GDPR);
},
haveConsentToSellData: function () {
var e = t.cookieImpl.readConsentCookie();
if (void 0 === e) return !0;
if (e.reg !== s.TrackingRegulations.CCPA) return !0;