diff --git a/.gitignore b/.gitignore
index e58e738f81..d18c864199 100644
--- a/.gitignore
+++ b/.gitignore
@@ -16,3 +16,4 @@ package-lock.json
build.sh
publish.sh
coverage/**
+dist/
diff --git a/__tests__/prodsdk.js b/__tests__/prodsdk.js
index 18b5ba1ff0..f14e15e469 100644
--- a/__tests__/prodsdk.js
+++ b/__tests__/prodsdk.js
@@ -1,7959 +1,2 @@
-rudderanalytics = (function (e) {
- function t(e) {
- return (t =
- typeof Symbol === "function" && typeof Symbol.iterator === "symbol"
- ? function (e) {
- return typeof e;
- }
- : function (e) {
- return e &&
- typeof Symbol === "function" &&
- e.constructor === Symbol &&
- e !== Symbol.prototype
- ? "symbol"
- : typeof e;
- })(e);
- }
- function n(e, t) {
- if (!(e instanceof t))
- throw new TypeError("Cannot call a class as a function");
- }
- function r(e, t) {
- for (let n = 0; n < t.length; n++) {
- const r = t[n];
- (r.enumerable = r.enumerable || !1),
- (r.configurable = !0),
- "value" in r && (r.writable = !0),
- Object.defineProperty(e, r.key, r);
- }
- }
- function i(e, t, n) {
- return t && r(e.prototype, t), n && r(e, n), e;
- }
- function o(e, t, n) {
- return (
- t in e
- ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0,
- })
- : (e[t] = n),
- e
- );
- }
- function s(e, t) {
- const n = Object.keys(e);
- if (Object.getOwnPropertySymbols) {
- let r = Object.getOwnPropertySymbols(e);
- t &&
- (r = r.filter(function (t) {
- return Object.getOwnPropertyDescriptor(e, t).enumerable;
- })),
- n.push.apply(n, r);
- }
- return n;
- }
- function a(e) {
- for (let t = 1; t < arguments.length; t++) {
- var n = arguments[t] != null ? arguments[t] : {};
- t % 2
- ? s(n, !0).forEach(function (t) {
- o(e, t, n[t]);
- })
- : Object.getOwnPropertyDescriptors
- ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n))
- : s(n).forEach(function (t) {
- Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
- });
- }
- return e;
- }
- function c(e) {
- return (
- (function (e) {
- if (Array.isArray(e)) {
- for (var t = 0, n = new Array(e.length); t < e.length; t++)
- n[t] = e[t];
- return n;
- }
- })(e) ||
- (function (e) {
- if (
- Symbol.iterator in Object(e) ||
- Object.prototype.toString.call(e) === "[object Arguments]"
- )
- return Array.from(e);
- })(e) ||
- (function () {
- throw new TypeError("Invalid attempt to spread non-iterable instance");
- })()
- );
- }
- const u =
- typeof globalThis !== "undefined"
- ? globalThis
- : typeof window !== "undefined"
- ? window
- : typeof global !== "undefined"
- ? global
- : typeof self !== "undefined"
- ? self
- : {};
- function l(e, t) {
- return e((t = { exports: {} }), t.exports), t.exports;
- }
- const d = l(function (e) {
- function t(e) {
- if (e)
- return (function (e) {
- for (const n in t.prototype) e[n] = t.prototype[n];
- return e;
- })(e);
- }
- (e.exports = t),
- (t.prototype.on = t.prototype.addEventListener = function (e, t) {
- return (
- (this._callbacks = this._callbacks || {}),
- (this._callbacks[`$${e}`] = this._callbacks[`$${e}`] || []).push(t),
- this
- );
- }),
- (t.prototype.once = function (e, t) {
- function n() {
- this.off(e, n), t.apply(this, arguments);
- }
- return (n.fn = t), this.on(e, n), this;
- }),
- (t.prototype.off = t.prototype.removeListener = t.prototype.removeAllListeners = t.prototype.removeEventListener = function (
- e,
- t
- ) {
- if (((this._callbacks = this._callbacks || {}), arguments.length == 0))
- return (this._callbacks = {}), this;
- let n;
- const r = this._callbacks[`$${e}`];
- if (!r) return this;
- if (arguments.length == 1) return delete this._callbacks[`$${e}`], this;
- for (let i = 0; i < r.length; i++)
- if ((n = r[i]) === t || n.fn === t) {
- r.splice(i, 1);
- break;
- }
- return r.length === 0 && delete this._callbacks[`$${e}`], this;
- }),
- (t.prototype.emit = function (e) {
- this._callbacks = this._callbacks || {};
- for (
- var t = new Array(arguments.length - 1),
- n = this._callbacks[`$${e}`],
- r = 1;
- r < arguments.length;
- r++
- )
- t[r - 1] = arguments[r];
- if (n) {
- r = 0;
- for (let i = (n = n.slice(0)).length; r < i; ++r) n[r].apply(this, t);
- }
- return this;
- }),
- (t.prototype.listeners = function (e) {
- return (
- (this._callbacks = this._callbacks || {}),
- this._callbacks[`$${e}`] || []
- );
- }),
- (t.prototype.hasListeners = function (e) {
- return !!this.listeners(e).length;
- });
- });
- const p = function (e, t, n) {
- let r = !1;
- return (n = n || h), (i.count = e), e === 0 ? t() : i;
- function i(e, o) {
- if (i.count <= 0) throw new Error("after called too many times");
- --i.count,
- e ? ((r = !0), t(e), (t = n)) : i.count !== 0 || r || t(null, o);
- }
- };
- function h() {}
- let f = 4;
- const g = {
- setLogLevel(e) {
- switch (e.toUpperCase()) {
- case "INFO":
- return void (f = 1);
- case "DEBUG":
- return void (f = 2);
- case "WARN":
- return void (f = 3);
- }
- },
- info() {
- let e;
- f <= 1 && (e = console).info.apply(e, arguments);
- },
- debug() {
- let e;
- f <= 2 && (e = console).debug.apply(e, arguments);
- },
- warn() {
- let e;
- f <= 3 && (e = console).warn.apply(e, arguments);
- },
- error() {
- let e;
- f <= 4 && (e = console).error.apply(e, arguments);
- },
- };
- const m = {
- All: "All",
- "Google Analytics": "GA",
- GoogleAnalytics: "GA",
- GA: "GA",
- "Google Ads": "GOOGLEADS",
- GoogleAds: "GOOGLEADS",
- GOOGLEADS: "GOOGLEADS",
- Braze: "BRAZE",
- BRAZE: "BRAZE",
- Chartbeat: "CHARTBEAT",
- CHARTBEAT: "CHARTBEAT",
- Comscore: "COMSCORE",
- COMSCORE: "COMSCORE",
- Customerio: "CUSTOMERIO",
- "Customer.io": "CUSTOMERIO",
- "FB Pixel": "FACEBOOK_PIXEL",
- "Facebook Pixel": "FACEBOOK_PIXEL",
- FB_PIXEL: "FACEBOOK_PIXEL",
- "Google Tag Manager": "GOOGLETAGMANAGER",
- GTM: "GTM",
- Hotjar: "HOTJAR",
- hotjar: "HOTJAR",
- HOTJAR: "HOTJAR",
- Hubspot: "HS",
- HUBSPOT: "HS",
- Intercom: "INTERCOM",
- INTERCOM: "INTERCOM",
- Keen: "KEEN",
- "Keen.io": "KEEN",
- KEEN: "KEEN",
- Kissmetrics: "KISSMETRICS",
- KISSMETRICS: "KISSMETRICS",
- Lotame: "LOTAME",
- LOTAME: "LOTAME",
- "Visual Website Optimizer": "VWO",
- VWO: "VWO",
- };
- const y = {
- All: "All",
- GA: "Google Analytics",
- GOOGLEADS: "Google Ads",
- BRAZE: "Braze",
- CHARTBEAT: "Chartbeat",
- COMSCORE: "Comscore",
- CUSTOMERIO: "Customer IO",
- FACEBOOK_PIXEL: "Facebook Pixel",
- GTM: "Google Tag Manager",
- HOTJAR: "Hotjar",
- HS: "HubSpot",
- INTERCOM: "Intercom",
- KEEN: "Keen",
- KISSMETRICS: "Kiss Metrics",
- LOTAME: "Lotame",
- VWO: "VWO",
- };
- function v(e, t) {
- return t == null ? void 0 : t;
- }
- function b() {
- let e = new Date().getTime();
- return (
- typeof performance !== "undefined" &&
- typeof performance.now === "function" &&
- (e += performance.now()),
- "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function (t) {
- const n = (e + 16 * Math.random()) % 16 | 0;
- return (
- (e = Math.floor(e / 16)), (t === "x" ? n : (3 & n) | 8).toString(16)
- );
- })
- );
- }
- function w() {
- return new Date().toISOString();
- }
- function k(e, t) {
- let n = e.message ? e.message : void 0;
- let r = void 0;
- try {
- e instanceof Event &&
- e.target &&
- e.target.localName == "script" &&
- ((n = `error in script loading:: src:: ${e.target.src} id:: ${e.target.id}`),
- t &&
- e.target.src.includes("adsbygoogle") &&
- ((r = !0),
- t.page(
- "RudderJS-Initiated",
- "ad-block page request",
- { path: "/ad-blocked", title: n },
- t.sendAdblockPageOptions
- ))),
- n && !r && g.error("[Util] handleError:: ", n);
- } catch (e) {
- g.error("[Util] handleError:: ", e);
- }
- }
- function E() {
- const e = I();
- const t = e ? e.pathname : window.location.pathname;
- const n = document.referrer;
- const r = window.location.search;
- return {
- path: t,
- referrer: n,
- search: r,
- title: document.title,
- url: (function (e) {
- const t = I();
- const n = t ? (t.indexOf("?") > -1 ? t : t + e) : window.location.href;
- const r = n.indexOf("#");
- return r > -1 ? n.slice(0, r) : n;
- })(r),
- };
- }
- function I() {
- for (
- var e, t = document.getElementsByTagName("link"), n = 0;
- (e = t[n]);
- n++
- )
- if (e.getAttribute("rel") === "canonical") return e.getAttribute("href");
- }
- function _(e, t) {
- let n = e.revenue;
- return (
- !n &&
- t &&
- t.match(
- /^[ _]?completed[ _]?order[ _]?|^[ _]?order[ _]?completed[ _]?$/i
- ) &&
- (n = e.total),
- (function (e) {
- if (e) {
- if (typeof e === "number") return e;
- if (typeof e === "string")
- return (
- (e = e.replace(/\$/g, "")),
- (e = parseFloat(e)),
- isNaN(e) ? void 0 : e
- );
- }
- })(n)
- );
- }
- function A(e) {
- Object.keys(e).forEach(function (t) {
- e.hasOwnProperty(t) &&
- (m[t] && (e[m[t]] = e[t]),
- t != "All" && m[t] != null && m[t] != t && delete e[t]);
- });
- }
- function C(e, n) {
- const r = [];
- if (!n || n.length == 0) return r;
- let i = !0;
- return typeof n[0] === "string"
- ? (e.All != null && (i = e.All),
- n.forEach(function (t) {
- if (i) {
- let n = !0;
- e[t] != null && e[t] == 0 && (n = !1), n && r.push(t);
- } else e[t] != null && e[t] == 1 && r.push(t);
- }),
- r)
- : t(n[0]) == "object"
- ? (e.All != null && (i = e.All),
- n.forEach(function (t) {
- if (i) {
- let n = !0;
- e[t.name] != null && e[t.name] == 0 && (n = !1), n && r.push(t);
- } else e[t.name] != null && e[t.name] == 1 && r.push(t);
- }),
- r)
- : void 0;
- }
- function T(e, n) {
- return (
- (n = n || S),
- (function (e) {
- switch (toString.call(e)) {
- case "[object Function]":
- return "function";
- case "[object Date]":
- return "date";
- case "[object RegExp]":
- return "regexp";
- case "[object Arguments]":
- return "arguments";
- case "[object Array]":
- return "array";
- }
- return e === null
- ? "null"
- : void 0 === e
- ? "undefined"
- : e === Object(e)
- ? "object"
- : t(e);
- })(e) == "array"
- ? O(e, n)
- : P(e, n)
- );
- }
- var O = function (e, t) {
- for (var n = [], r = 0; r < e.length; ++r)
- t(e[r], r) || (n[n.length] = e[r]);
- return n;
- };
- var P = function (e, t) {
- const n = {};
- for (const r in e) e.hasOwnProperty(r) && !t(e[r], r) && (n[r] = e[r]);
- return n;
- };
- function S(e) {
- return e == null;
- }
- const x = { TRACK: "track", PAGE: "page", IDENTIFY: "identify" };
- const R = {
- PRODUCTS_SEARCHED: "Products Searched",
- PRODUCT_LIST_VIEWED: "Product List Viewed",
- PRODUCT_LIST_FILTERED: "Product List Filtered",
- PROMOTION_VIEWED: "Promotion Viewed",
- PROMOTION_CLICKED: "Promotion Clicked",
- PRODUCT_CLICKED: "Product Clicked",
- PRODUCT_VIEWED: "Product Viewed",
- PRODUCT_ADDED: "Product Added",
- PRODUCT_REMOVED: "Product Removed",
- CART_VIEWED: "Cart Viewed",
- CHECKOUT_STARTED: "Checkout Started",
- CHECKOUT_STEP_VIEWED: "Checkout Step Viewed",
- CHECKOUT_STEP_COMPLETED: "Checkout Step Completed",
- PAYMENT_INFO_ENTERED: "Payment Info Entered",
- ORDER_UPDATED: "Order Updated",
- ORDER_COMPLETED: "Order Completed",
- ORDER_REFUNDED: "Order Refunded",
- ORDER_CANCELLED: "Order Cancelled",
- COUPON_ENTERED: "Coupon Entered",
- COUPON_APPLIED: "Coupon Applied",
- COUPON_DENIED: "Coupon Denied",
- COUPON_REMOVED: "Coupon Removed",
- PRODUCT_ADDED_TO_WISHLIST: "Product Added to Wishlist",
- PRODUCT_REMOVED_FROM_WISHLIST: "Product Removed from Wishlist",
- WISH_LIST_PRODUCT_ADDED_TO_CART: "Wishlist Product Added to Cart",
- PRODUCT_SHARED: "Product Shared",
- CART_SHARED: "Cart Shared",
- PRODUCT_REVIEWED: "Product Reviewed",
- };
- const j = "https://hosted.rudderlabs.com";
- function L(e, t) {
- g.debug(`in script loader=== ${e}`);
- const n = document.createElement("script");
- (n.src = t), (n.async = !0), (n.type = "text/javascript"), (n.id = e);
- const r = document.getElementsByTagName("script")[0];
- g.debug("==script==", r), r.parentNode.insertBefore(n, r);
- }
- let D;
- let M;
- const U = (function () {
- function e(t) {
- n(this, e), (this.hubId = t.hubID), (this.name = "HS");
- }
- return (
- i(e, [
- {
- key: "init",
- value() {
- L(
- "hubspot-integration",
- `http://js.hs-scripts.com/${this.hubId}.js`
- ),
- g.debug("===in init HS===");
- },
- },
- {
- key: "identify",
- value(e) {
- g.debug("in HubspotAnalyticsManager identify");
- const n = e.message.context.traits;
- const r = {};
- for (const i in n)
- if (Object.getOwnPropertyDescriptor(n, i) && n[i]) {
- const o = i;
- toString.call(n[i]) == "[object Date]"
- ? (r[o] = n[i].getTime())
- : (r[o] = n[i]);
- }
- const s = e.message.context.user_properties;
- for (const a in s) {
- if (Object.getOwnPropertyDescriptor(s, a) && s[a]) r[a] = s[a];
- }
- (g.debug(r),
- void 0 !==
- (typeof window === "undefined" ? "undefined" : t(window))) &&
- (window._hsq = window._hsq || []).push(["identify", r]);
- },
- },
- {
- key: "track",
- value(e) {
- g.debug("in HubspotAnalyticsManager track");
- const t = (window._hsq = window._hsq || []);
- const n = {};
- (n.id = e.message.event),
- e.message.properties &&
- (e.message.properties.revenue || e.message.properties.value) &&
- (n.value =
- e.message.properties.revenue || e.message.properties.value),
- t.push(["trackEvent", n]);
- },
- },
- {
- key: "page",
- value(e) {
- g.debug("in HubspotAnalyticsManager page");
- const t = (window._hsq = window._hsq || []);
- e.message.properties &&
- e.message.properties.path &&
- t.push(["setPath", e.message.properties.path]),
- t.push(["trackPageView"]);
- },
- },
- {
- key: "isLoaded",
- value() {
- return (
- g.debug("in hubspot isLoaded"),
- !(!window._hsq || window._hsq.push === Array.prototype.push)
- );
- },
- },
- {
- key: "isReady",
- value() {
- return !(!window._hsq || window._hsq.push === Array.prototype.push);
- },
- },
- ]),
- e
- );
- })();
- const N = Object.prototype;
- const q = N.hasOwnProperty;
- const B = N.toString;
- typeof Symbol === "function" && (D = Symbol.prototype.valueOf),
- typeof BigInt === "function" && (M = BigInt.prototype.valueOf);
- const F = function (e) {
- return e != e;
- };
- const G = { boolean: 1, number: 1, string: 1, undefined: 1 };
- const K = /^([A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{4}|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}==)$/;
- const V = /^[A-Fa-f0-9]+$/;
- const H = {};
- (H.a = H.type = function (e, t) {
- return typeof e === t;
- }),
- (H.defined = function (e) {
- return void 0 !== e;
- }),
- (H.empty = function (e) {
- let t;
- const n = B.call(e);
- if (
- n === "[object Array]" ||
- n === "[object Arguments]" ||
- n === "[object String]"
- )
- return e.length === 0;
- if (n === "[object Object]") {
- for (t in e) if (q.call(e, t)) return !1;
- return !0;
- }
- return !e;
- }),
- (H.equal = function (e, t) {
- if (e === t) return !0;
- let n;
- const r = B.call(e);
- if (r !== B.call(t)) return !1;
- if (r === "[object Object]") {
- for (n in e) if (!(H.equal(e[n], t[n]) && n in t)) return !1;
- for (n in t) if (!(H.equal(e[n], t[n]) && n in e)) return !1;
- return !0;
- }
- if (r === "[object Array]") {
- if ((n = e.length) !== t.length) return !1;
- for (; n--; ) if (!H.equal(e[n], t[n])) return !1;
- return !0;
- }
- return r === "[object Function]"
- ? e.prototype === t.prototype
- : r === "[object Date]" && e.getTime() === t.getTime();
- }),
- (H.hosted = function (e, t) {
- const n = typeof t[e];
- return n === "object" ? !!t[e] : !G[n];
- }),
- (H.instance = H.instanceof = function (e, t) {
- return e instanceof t;
- }),
- (H.nil = H.null = function (e) {
- return e === null;
- }),
- (H.undef = H.undefined = function (e) {
- return void 0 === e;
- }),
- (H.args = H.arguments = function (e) {
- const t = B.call(e) === "[object Arguments]";
- const n = !H.array(e) && H.arraylike(e) && H.object(e) && H.fn(e.callee);
- return t || n;
- }),
- (H.array =
- Array.isArray ||
- function (e) {
- return B.call(e) === "[object Array]";
- }),
- (H.args.empty = function (e) {
- return H.args(e) && e.length === 0;
- }),
- (H.array.empty = function (e) {
- return H.array(e) && e.length === 0;
- }),
- (H.arraylike = function (e) {
- return (
- !!e &&
- !H.bool(e) &&
- q.call(e, "length") &&
- isFinite(e.length) &&
- H.number(e.length) &&
- e.length >= 0
- );
- }),
- (H.bool = H.boolean = function (e) {
- return B.call(e) === "[object Boolean]";
- }),
- (H.false = function (e) {
- return H.bool(e) && !1 === Boolean(Number(e));
- }),
- (H.true = function (e) {
- return H.bool(e) && !0 === Boolean(Number(e));
- }),
- (H.date = function (e) {
- return B.call(e) === "[object Date]";
- }),
- (H.date.valid = function (e) {
- return H.date(e) && !isNaN(Number(e));
- }),
- (H.element = function (e) {
- return (
- void 0 !== e &&
- typeof HTMLElement !== "undefined" &&
- e instanceof HTMLElement &&
- e.nodeType === 1
- );
- }),
- (H.error = function (e) {
- return B.call(e) === "[object Error]";
- }),
- (H.fn = H.function = function (e) {
- if (typeof window !== "undefined" && e === window.alert) return !0;
- const t = B.call(e);
- return (
- t === "[object Function]" ||
- t === "[object GeneratorFunction]" ||
- t === "[object AsyncFunction]"
- );
- }),
- (H.number = function (e) {
- return B.call(e) === "[object Number]";
- }),
- (H.infinite = function (e) {
- return e === 1 / 0 || e === -1 / 0;
- }),
- (H.decimal = function (e) {
- return H.number(e) && !F(e) && !H.infinite(e) && e % 1 != 0;
- }),
- (H.divisibleBy = function (e, t) {
- const n = H.infinite(e);
- const r = H.infinite(t);
- const i = H.number(e) && !F(e) && H.number(t) && !F(t) && t !== 0;
- return n || r || (i && e % t == 0);
- }),
- (H.integer = H.int = function (e) {
- return H.number(e) && !F(e) && e % 1 == 0;
- }),
- (H.maximum = function (e, t) {
- if (F(e)) throw new TypeError("NaN is not a valid value");
- if (!H.arraylike(t))
- throw new TypeError("second argument must be array-like");
- for (let n = t.length; --n >= 0; ) if (e < t[n]) return !1;
- return !0;
- }),
- (H.minimum = function (e, t) {
- if (F(e)) throw new TypeError("NaN is not a valid value");
- if (!H.arraylike(t))
- throw new TypeError("second argument must be array-like");
- for (let n = t.length; --n >= 0; ) if (e > t[n]) return !1;
- return !0;
- }),
- (H.nan = function (e) {
- return !H.number(e) || e != e;
- }),
- (H.even = function (e) {
- return H.infinite(e) || (H.number(e) && e == e && e % 2 == 0);
- }),
- (H.odd = function (e) {
- return H.infinite(e) || (H.number(e) && e == e && e % 2 != 0);
- }),
- (H.ge = function (e, t) {
- if (F(e) || F(t)) throw new TypeError("NaN is not a valid value");
- return !H.infinite(e) && !H.infinite(t) && e >= t;
- }),
- (H.gt = function (e, t) {
- if (F(e) || F(t)) throw new TypeError("NaN is not a valid value");
- return !H.infinite(e) && !H.infinite(t) && e > t;
- }),
- (H.le = function (e, t) {
- if (F(e) || F(t)) throw new TypeError("NaN is not a valid value");
- return !H.infinite(e) && !H.infinite(t) && e <= t;
- }),
- (H.lt = function (e, t) {
- if (F(e) || F(t)) throw new TypeError("NaN is not a valid value");
- return !H.infinite(e) && !H.infinite(t) && e < t;
- }),
- (H.within = function (e, t, n) {
- if (F(e) || F(t) || F(n)) throw new TypeError("NaN is not a valid value");
- if (!H.number(e) || !H.number(t) || !H.number(n))
- throw new TypeError("all arguments must be numbers");
- return (
- H.infinite(e) || H.infinite(t) || H.infinite(n) || (e >= t && e <= n)
- );
- }),
- (H.object = function (e) {
- return B.call(e) === "[object Object]";
- }),
- (H.primitive = function (e) {
- return (
- !e || !(typeof e === "object" || H.object(e) || H.fn(e) || H.array(e))
- );
- }),
- (H.hash = function (e) {
- return (
- H.object(e) && e.constructor === Object && !e.nodeType && !e.setInterval
- );
- }),
- (H.regexp = function (e) {
- return B.call(e) === "[object RegExp]";
- }),
- (H.string = function (e) {
- return B.call(e) === "[object String]";
- }),
- (H.base64 = function (e) {
- return H.string(e) && (!e.length || K.test(e));
- }),
- (H.hex = function (e) {
- return H.string(e) && (!e.length || V.test(e));
- }),
- (H.symbol = function (e) {
- return (
- typeof Symbol === "function" &&
- B.call(e) === "[object Symbol]" &&
- typeof D.call(e) === "symbol"
- );
- }),
- (H.bigint = function (e) {
- return (
- typeof BigInt === "function" &&
- B.call(e) === "[object BigInt]" &&
- typeof M.call(e) === "bigint"
- );
- });
- let z;
- const J = H;
- const W = Object.prototype.toString;
- const $ = function (e) {
- switch (W.call(e)) {
- case "[object Function]":
- return "function";
- case "[object Date]":
- return "date";
- case "[object RegExp]":
- return "regexp";
- case "[object Arguments]":
- return "arguments";
- case "[object Array]":
- return "array";
- case "[object String]":
- return "string";
- }
- return e === null
- ? "null"
- : void 0 === e
- ? "undefined"
- : e && e.nodeType === 1
- ? "element"
- : e === Object(e)
- ? "object"
- : typeof e;
- };
- const Y = /\b(Array|Date|Object|Math|JSON)\b/g;
- const Q = function (e, t) {
- const n = (function (e) {
- for (var t = [], n = 0; n < e.length; n++)
- ~t.indexOf(e[n]) || t.push(e[n]);
- return t;
- })(
- (function (e) {
- return (
- e
- .replace(/\.\w+|\w+ *\(|"[^"]*"|'[^']*'|\/([^/]+)\//g, "")
- .replace(Y, "")
- .match(/[a-zA-Z_]\w*/g) || []
- );
- })(e)
- );
- return (
- t &&
- typeof t === "string" &&
- (t = (function (e) {
- return function (t) {
- return e + t;
- };
- })(t)),
- t
- ? (function (e, t, n) {
- return e.replace(
- /\.\w+|\w+ *\(|"[^"]*"|'[^']*'|\/([^/]+)\/|[a-zA-Z_]\w*/g,
- function (e) {
- return e[e.length - 1] == "(" ? n(e) : ~t.indexOf(e) ? n(e) : e;
- }
- );
- })(e, n, t)
- : n
- );
- };
- try {
- z = Q;
- } catch (e) {
- z = Q;
- }
- const Z = X;
- function X(e) {
- switch ({}.toString.call(e)) {
- case "[object Object]":
- return (function (e) {
- const t = {};
- for (const n in e)
- t[n] = typeof e[n] === "string" ? ee(e[n]) : X(e[n]);
- return function (e) {
- if (typeof e !== "object") return !1;
- for (const n in t) {
- if (!(n in e)) return !1;
- if (!t[n](e[n])) return !1;
- }
- return !0;
- };
- })(e);
- case "[object Function]":
- return e;
- case "[object String]":
- return /^ *\W+/.test((n = e))
- ? new Function("_", `return _ ${n}`)
- : new Function(
- "_",
- `return ${(function (e) {
- let t;
- let n;
- let r;
- const i = z(e);
- if (!i.length) return `_.${e}`;
- for (n = 0; n < i.length; n++)
- (r = i[n]),
- (e = te(
- r,
- e,
- (t = `('function' == typeof ${(t = `_.${r}`)} ? ${t}() : ${t})`)
- ));
- return e;
- })(n)}`
- );
- case "[object RegExp]":
- return (
- (t = e),
- function (e) {
- return t.test(e);
- }
- );
- default:
- return ee(e);
- }
- let t;
- let n;
- }
- function ee(e) {
- return function (t) {
- return e === t;
- };
- }
- function te(e, t, n) {
- return t.replace(new RegExp(`(\\.)?${e}`, "g"), function (e, t) {
- return t ? e : n;
- });
- }
- try {
- var ne = $;
- } catch (e) {
- ne = $;
- }
- const re = Object.prototype.hasOwnProperty;
- const ie = function (e, t, n) {
- switch (((t = Z(t)), (n = n || this), ne(e))) {
- case "array":
- return oe(e, t, n);
- case "object":
- return typeof e.length === "number"
- ? oe(e, t, n)
- : (function (e, t, n) {
- for (const r in e) re.call(e, r) && t.call(n, r, e[r]);
- })(e, t, n);
- case "string":
- return (function (e, t, n) {
- for (let r = 0; r < e.length; ++r) t.call(n, e.charAt(r), r);
- })(e, t, n);
- }
- };
- function oe(e, t, n) {
- for (let r = 0; r < e.length; ++r) t.call(n, e[r], r);
- }
- const se = Math.max;
- const ae = function (e, t) {
- const n = t ? t.length : 0;
- if (!n) return [];
- for (
- var r = se(Number(e) || 0, 0), i = se(n - r, 0), o = new Array(i), s = 0;
- s < i;
- s += 1
- )
- o[s] = t[s + r];
- return o;
- };
- const ce = Math.max;
- const ue = function (e) {
- if (e == null || !e.length) return [];
- for (var t = new Array(ce(e.length - 2, 0)), n = 1; n < e.length; n += 1)
- t[n - 1] = e[n];
- return t;
- };
- const le = Object.prototype.hasOwnProperty;
- const de = Object.prototype.toString;
- const pe = function (e) {
- return Boolean(e) && typeof e === "object";
- };
- const he = function (e) {
- return Boolean(e) && de.call(e) === "[object Object]";
- };
- const fe = function (e, t, n, r) {
- return le.call(t, r) && void 0 === e[r] && (e[r] = n), t;
- };
- const ge = function (e, t, n, r) {
- return (
- le.call(t, r) &&
- (he(e[r]) && he(n)
- ? (e[r] = ye(e[r], n))
- : void 0 === e[r] && (e[r] = n)),
- t
- );
- };
- const me = function (e, t) {
- if (!pe(t)) return t;
- e = e || fe;
- for (let n = ae(2, arguments), r = 0; r < n.length; r += 1)
- for (const i in n[r]) e(t, n[r], n[r][i], i);
- return t;
- };
- var ye = function (e) {
- return me.apply(null, [ge, e].concat(ue(arguments)));
- };
- const ve = function (e) {
- return me.apply(null, [null, e].concat(ue(arguments)));
- };
- const be = ye;
- ve.deep = be;
- const we = (function () {
- function e(t) {
- n(this, e),
- (this.trackingID = t.trackingID),
- (this.sendUserId = t.sendUserId || !1),
- (this.dimensions = t.dimensions || []),
- (this.metrics = t.metrics || []),
- (this.contentGroupings = t.contentGroupings || []),
- (this.nonInteraction = t.nonInteraction || !1),
- (this.anonymizeIp = t.anonymizeIp || !1),
- (this.useGoogleAmpClientId = t.useGoogleAmpClientId || !1),
- (this.domain = t.domain || "auto"),
- (this.doubleClick = t.doubleClick || !1),
- (this.enhancedEcommerce = t.enhancedEcommerce || !1),
- (this.enhancedLinkAttribution = t.enhancedLinkAttribution || !1),
- (this.includeSearch = t.includeSearch || !1),
- (this.setAllMappedProps = t.setAllMappedProps || !0),
- (this.siteSpeedSampleRate = t.siteSpeedSampleRate || 1),
- (this.sampleRate = t.sampleRate || 100),
- (this.trackCategorizedPages = t.trackCategorizedPages || !0),
- (this.trackNamedPages = t.trackNamedPages || !0),
- (this.optimizeContainerId = t.optimize || ""),
- (this.resetCustomDimensionsOnPage =
- t.resetCustomDimensionsOnPage || []),
- (this.inputs = t),
- (this.enhancedEcommerceLoaded = 0),
- (this.name = "GA"),
- (this.eventWithCategoryFieldProductScoped = [
- "product clicked",
- "product added",
- "product viewed",
- "product removed",
- ]);
- }
- return (
- i(e, [
- {
- key: "loadScript",
- value() {
- L(
- "google-analytics",
- "https://www.google-analytics.com/analytics.js"
- );
- },
- },
- {
- key: "init",
- value() {
- (this.pageCalled = !1), (this.dimensionsArray = {});
- let e = !0;
- let t = !1;
- let n = void 0;
- try {
- for (
- var r, i = this.dimensions[Symbol.iterator]();
- !(e = (r = i.next()).done);
- e = !0
- ) {
- const o = r.value;
- this.dimensionsArray[o.from] = o.to;
- }
- } catch (e) {
- (t = !0), (n = e);
- } finally {
- try {
- e || i.return == null || i.return();
- } finally {
- if (t) throw n;
- }
- }
- this.metricsArray = {};
- let s = !0;
- let a = !1;
- let c = void 0;
- try {
- for (
- var u, l = this.metrics[Symbol.iterator]();
- !(s = (u = l.next()).done);
- s = !0
- ) {
- const d = u.value;
- this.metricsArray[d.from] = d.to;
- }
- } catch (e) {
- (a = !0), (c = e);
- } finally {
- try {
- s || l.return == null || l.return();
- } finally {
- if (a) throw c;
- }
- }
- this.contentGroupingsArray = {};
- let p = !0;
- let h = !1;
- let f = void 0;
- try {
- for (
- var m, y = this.contentGroupings[Symbol.iterator]();
- !(p = (m = y.next()).done);
- p = !0
- ) {
- const v = m.value;
- this.contentGroupingsArray[v.from] = v.to;
- }
- } catch (e) {
- (h = !0), (f = e);
- } finally {
- try {
- p || y.return == null || y.return();
- } finally {
- if (h) throw f;
- }
- }
- (window.GoogleAnalyticsObject = "ga"),
- (window.ga =
- window.ga ||
- function () {
- (window.ga.q = window.ga.q || []),
- window.ga.q.push(arguments);
- }),
- (window.ga.l = new Date().getTime());
- const b = {
- cookieDomain: this.domain,
- siteSpeedSampleRate: this.siteSpeedSampleRate,
- sampleRate: this.sampleRate,
- allowLinker: !0,
- useAmpClientId: this.useGoogleAmpClientId,
- };
- window.ga("create", this.trackingID, b),
- this.optimizeContainerId &&
- window.ga("require", this.optimizeContainerId),
- this.ecommerce ||
- (window.ga("require", "ecommerce"), (this.ecommerce = !0)),
- this.doubleClick && window.ga("require", "displayfeatures"),
- this.enhancedLinkAttribution && window.ga("require", "linkid"),
- this.anonymizeIp && window.ga("set", "anonymizeIp", !0),
- g.debug("===in init GA===");
- },
- },
- {
- key: "identify",
- value(e) {
- this.sendUserId &&
- e.message.userId &&
- window.ga("set", "userId", e.message.userId);
- const t = this.metricsFunction(
- e.message.context.traits,
- this.dimensionsArray,
- this.metricsArray,
- this.contentGroupingsArray
- );
- console.log(Object.keys(t).length),
- Object.keys(t).length && window.ga("set", t),
- g.debug("in GoogleAnalyticsManager identify");
- },
- },
- {
- key: "track",
- value(e, t) {
- const n = this;
- const r = e.message.event;
- if (r !== "Order Completed" || this.enhancedEcommerce)
- if (this.enhancedEcommerce)
- switch (r) {
- case "Checkout Started":
- case "Checkout Step Viewed":
- case "Order Updated":
- (E = (b = e.message.properties).products),
- (t = this.extractCheckoutOptions(e));
- (this.enhancedEcommerceLoaded = this.loadEnhancedEcommerce(
- e,
- this.enhancedEcommerceLoaded
- )),
- ie(E, function (t) {
- let r = n.createProductTrack(e, t);
- (r = { message: r }),
- n.enhancedEcommerceTrackProduct(r, n.inputs);
- }),
- window.ga("ec:setAction", "checkout", {
- step: b.step || 1,
- option: t || void 0,
- }),
- this.pushEnhancedEcommerce(e, this.inputs);
- break;
- case "Checkout Step Completed":
- var i = e.message.properties;
- t = this.extractCheckoutOptions(e);
- if (!i.step) return;
- var o = { step: i.step || 1, option: t || void 0 };
- (this.enhancedEcommerceLoaded = this.loadEnhancedEcommerce(
- e,
- this.enhancedEcommerceLoaded
- )),
- window.ga("ec:setAction", "checkout_option", o),
- window.ga("send", "event", "Checkout", "Option");
- break;
- case "Order Completed":
- (w =
- e.message.properties.total ||
- e.message.properties.revenue ||
- 0),
- (k = e.message.properties.orderId),
- (E = e.message.properties.products),
- (i = e.message.properties);
- if (!k) return;
- (this.enhancedEcommerceLoaded = this.loadEnhancedEcommerce(
- e,
- this.enhancedEcommerceLoaded
- )),
- ie(E, function (t) {
- let r = n.createProductTrack(e, t);
- (r = { message: r }),
- n.enhancedEcommerceTrackProduct(r, n.inputs);
- }),
- window.ga("ec:setAction", "purchase", {
- id: k,
- affiliation: i.affiliation,
- revenue: w,
- tax: i.tax,
- shipping: i.shipping,
- coupon: i.coupon,
- }),
- this.pushEnhancedEcommerce(e, this.inputs);
- break;
- case "Order Refunded":
- (k = (i = e.message.properties).orderId), (E = i.products);
- if (!k) return;
- (this.enhancedEcommerceLoaded = this.loadEnhancedEcommerce(
- e,
- this.enhancedEcommerceLoaded
- )),
- ie(E, function (e) {
- const t = { properties: e };
- window.ga("ec:addProduct", {
- id:
- t.properties.product_id ||
- t.properties.id ||
- t.properties.sku,
- quantity: t.properties.quantity,
- });
- }),
- window.ga("ec:setAction", "refund", { id: k }),
- this.pushEnhancedEcommerce(e, this.inputs);
- break;
- case "Product Added":
- (this.enhancedEcommerceLoaded = this.loadEnhancedEcommerce(
- e,
- this.enhancedEcommerceLoaded
- )),
- this.enhancedEcommerceTrackProductAction(
- e,
- "add",
- null,
- this.inputs
- ),
- this.pushEnhancedEcommerce(e, this.inputs);
- break;
- case "Product Removed":
- (this.enhancedEcommerceLoaded = this.loadEnhancedEcommerce(
- e,
- this.enhancedEcommerceLoaded
- )),
- this.enhancedEcommerceTrackProductAction(
- e,
- "remove",
- null,
- this.inputs
- ),
- this.pushEnhancedEcommerce(e, this.inputs);
- break;
- case "Product Viewed":
- i = e.message.properties;
- var s = {};
- (this.enhancedEcommerceLoaded = this.loadEnhancedEcommerce(
- e,
- this.enhancedEcommerceLoaded
- )),
- i.list && (s.list = i.list),
- this.enhancedEcommerceTrackProductAction(
- e,
- "detail",
- s,
- this.inputs
- ),
- this.pushEnhancedEcommerce(e, this.inputs);
- break;
- case "Product Clicked":
- (i = e.message.properties), (s = {});
- (this.enhancedEcommerceLoaded = this.loadEnhancedEcommerce(
- e,
- this.enhancedEcommerceLoaded
- )),
- i.list && (s.list = i.list),
- this.enhancedEcommerceTrackProductAction(
- e,
- "click",
- s,
- this.inputs
- ),
- this.pushEnhancedEcommerce(e, this.inputs);
- break;
- case "Promotion Viewed":
- i = e.message.properties;
- (this.enhancedEcommerceLoaded = this.loadEnhancedEcommerce(
- e,
- this.enhancedEcommerceLoaded
- )),
- window.ga("ec:addPromo", {
- id: i.promotionId || i.id,
- name: i.name,
- creative: i.creative,
- position: i.position,
- }),
- this.pushEnhancedEcommerce(e, this.inputs);
- break;
- case "Promotion Clicked":
- i = e.message.properties;
- (this.enhancedEcommerceLoaded = this.loadEnhancedEcommerce(
- e,
- this.enhancedEcommerceLoaded
- )),
- window.ga("ec:addPromo", {
- id: i.promotionId || i.id,
- name: i.name,
- creative: i.creative,
- position: i.position,
- }),
- window.ga("ec:setAction", "promo_click", {}),
- this.pushEnhancedEcommerce(e, this.inputs);
- break;
- case "Product List Viewed":
- E = (i = e.message.properties).products;
- (this.enhancedEcommerceLoaded = this.loadEnhancedEcommerce(
- e,
- this.enhancedEcommerceLoaded
- )),
- ie(E, function (e) {
- const t = { properties: e };
- if (
- t.properties.product_id ||
- t.properties.sku ||
- t.properties.name
- ) {
- let r = {
- id: t.properties.productId || t.properties.sku,
- name: t.properties.name,
- category: t.properties.category || i.category,
- list: i.list_id || i.category || "products",
- brand: t.properties.band,
- variant: t.properties.variant,
- price: t.properties.price,
- position: n.getProductPosition(t, E),
- };
- for (const o in (r = a(
- { impressionObj: r },
- n.metricsFunction(
- t.properties,
- n.dimensionsArray,
- n.metricsArray,
- n.contentGroupingsArray
- )
- )))
- void 0 === r[o] && delete r[o];
- window.ga("ec:addImpression", r);
- }
- }),
- this.pushEnhancedEcommerce(e, this.inputs);
- break;
- case "Product List Filtered":
- E = (i = e.message.properties).products;
- (i.filters = i.filters || []),
- (i.sorters = i.sorters || []);
- var c = i.filters
- .map(function (e) {
- return "".concat(e.type, ":").concat(e.value);
- })
- .join();
- var u = i.sorters
- .map(function (e) {
- return "".concat(e.type, ":").concat(e.value);
- })
- .join();
- (this.enhancedEcommerceLoaded = this.loadEnhancedEcommerce(
- e,
- this.enhancedEcommerceLoaded
- )),
- ie(E, function (e) {
- const t = { properties: e };
- if (
- t.properties.product_id ||
- t.properties.sku ||
- t.properties.name
- ) {
- let r = {
- id: t.properties.product_id || t.sku,
- name: t.name,
- category: t.category || i.category,
- list: i.list_id || i.category || "search results",
- brand: i.brand,
- variant: "".concat(c, "::").concat(u),
- price: t.price,
- position: n.getProductPosition(t, E),
- };
- for (const o in (r = a(
- { impressionObj: r },
- n.metricsFunction(
- t.properties,
- n.dimensionsArray,
- n.metricsArray,
- n.contentGroupingsArray
- )
- )))
- void 0 === r[o] && delete r[o];
- window.ga("ec:addImpression", r);
- }
- }),
- this.pushEnhancedEcommerce(e, this.inputs);
- break;
- default:
- var l = this.inputs;
- y = ve((y = t || {}), l);
- var d = e.message.properties.category;
- var p = e.message.event;
- var h = e.message.properties.label;
- var f = "";
- e.message.properties &&
- (f = e.message.properties.value
- ? e.message.properties.value
- : e.message.properties.revenue);
- var m = {
- eventCategory: d || "All",
- eventAction: p,
- eventLabel: h,
- eventValue: this.formatValue(f),
- nonInteraction:
- void 0 !== e.message.properties.nonInteraction
- ? !!e.message.properties.nonInteraction
- : !!y.nonInteraction,
- };
- (v = e.message.context.campaign) &&
- (v.name && (m.campaignName = v.name),
- v.source && (m.campaignSource = v.source),
- v.medium && (m.campaignMedium = v.medium),
- v.content && (m.campaignContent = v.content),
- v.term && (m.campaignKeyword = v.term)),
- (m = a(
- { payload: m },
- this.setCustomDimenionsAndMetrics(
- e.message.properties,
- this.inputs
- )
- )),
- window.ga("send", "event", m),
- g.debug("in GoogleAnalyticsManager track");
- }
- else {
- l = this.inputs;
- var y = ve(t || {}, void 0);
- y = ve(y, l);
- (d = e.message.properties.category),
- (p = e.message.event),
- (h = e.message.properties.label),
- (f = "");
- e.message.properties &&
- (f = e.message.properties.value
- ? e.message.properties.value
- : e.message.properties.revenue);
- var v;
- m = {
- eventCategory: d || "All",
- eventAction: p,
- eventLabel: h,
- eventValue: this.formatValue(f),
- nonInteraction:
- void 0 !== e.message.properties.nonInteraction
- ? !!e.message.properties.nonInteraction
- : !!y.nonInteraction,
- };
- (v = e.message.context.campaign) &&
- (v.name && (m.campaignName = v.name),
- v.source && (m.campaignSource = v.source),
- v.medium && (m.campaignMedium = v.medium),
- v.content && (m.campaignContent = v.content),
- v.term && (m.campaignKeyword = v.term)),
- (m = a(
- { payload: m },
- this.setCustomDimenionsAndMetrics(
- e.message.properties,
- this.inputs
- )
- )),
- window.ga("send", "event", m),
- g.debug("in GoogleAnalyticsManager track");
- }
- else {
- var b;
- var w = (b = e.message.properties).total;
- var k = b.orderId;
- var E = b.products;
- if (!k) return;
- window.ga("ecommerce:addTransaction", {
- affiliation: b.affiliation,
- shipping: b.shipping,
- revenue: w,
- tax: b.tax,
- id: k,
- currency: b.currency,
- }),
- ie(E, function (t) {
- const r = n.createProductTrack(e, t);
- window.ga("ecommerce:addItem", {
- category: r.category,
- quantity: r.quantity,
- price: r.price,
- name: r.name,
- sku: r.sku,
- id: k,
- currency: r.currency,
- });
- }),
- window.ga("ecommerce:send");
- }
- },
- },
- {
- key: "page",
- value(e) {
- g.debug("in GoogleAnalyticsManager page");
- let t;
- const n = e.message.properties.category;
- const r = e.message.properties;
- const i = ""
- .concat(e.message.properties.category, " ")
- .concat(e.message.name);
- const o = e.message.context.campaign | {};
- let s = {};
- const c = this.path(r, this.includeSearch);
- const u = e.message.properties.referrer || "";
- (t =
- e.message.properties.category || e.message.name
- ? e.message.properties.category
- ? e.message.name
- ? i
- : e.message.properties.category
- : e.message.name
- : r.title),
- (s.page = c),
- (s.title = t),
- (s.location = r.url),
- o &&
- (o.name && (s.campaignName = o.name),
- o.source && (s.campaignSource = o.source),
- o.medium && (s.campaignMedium = o.medium),
- o.content && (s.campaignContent = o.content),
- o.term && (s.campaignKeyword = o.term));
- for (
- var l = {}, d = 0;
- d < this.resetCustomDimensionsOnPage.length;
- d++
- ) {
- const p = this.resetCustomDimensionsOnPage[d];
- this.dimensionsArray[p] && (l[this.dimensionsArray[p]] = null);
- }
- window.ga("set", l),
- (s = a(
- { pageview: s },
- this.setCustomDimenionsAndMetrics(r, this.inputs)
- ));
- const h = { page: c, title: t };
- u !== document.referrer && (h.referrer = u),
- window.ga("set", h),
- this.pageCalled && delete s.location,
- window.ga("send", "pageview", s),
- n &&
- this.trackCategorizedPages &&
- this.track(e, { nonInteraction: 1 }),
- i && this.trackNamedPages && this.track(e, { nonInteraction: 1 }),
- (this.pageCalled = !0);
- },
- },
- {
- key: "isLoaded",
- value() {
- return g.debug("in GA isLoaded"), !!window.gaplugins;
- },
- },
- {
- key: "isReady",
- value() {
- return !!window.gaplugins;
- },
- },
- {
- key: "metricsFunction",
- value(e, t, n, r) {
- const i = {};
- return (
- ie([n, t, r], function (t) {
- ie(t, function (t, n) {
- let r = e[t];
- J.boolean(r) && (r = r.toString()),
- (r || r === 0) && (i[n] = r);
- });
- }),
- i
- );
- },
- },
- {
- key: "formatValue",
- value(e) {
- return !e || e < 0 ? 0 : Math.round(e);
- },
- },
- {
- key: "setCustomDimenionsAndMetrics",
- value(e, t) {
- const n = {};
- const r = {};
- let i = !0;
- let o = !1;
- let s = void 0;
- try {
- for (
- var a, c = t.dimensions[Symbol.iterator]();
- !(i = (a = c.next()).done);
- i = !0
- ) {
- const u = a.value;
- r[u.from] = u.to;
- }
- } catch (e) {
- (o = !0), (s = e);
- } finally {
- try {
- i || c.return == null || c.return();
- } finally {
- if (o) throw s;
- }
- }
- const l = {};
- let d = !0;
- let p = !1;
- let h = void 0;
- try {
- for (
- var f, g = t.metrics[Symbol.iterator]();
- !(d = (f = g.next()).done);
- d = !0
- ) {
- const m = f.value;
- l[m.from] = m.to;
- }
- } catch (e) {
- (p = !0), (h = e);
- } finally {
- try {
- d || g.return == null || g.return();
- } finally {
- if (p) throw h;
- }
- }
- const y = {};
- let v = !0;
- let b = !1;
- let w = void 0;
- try {
- for (
- var k, E = t.contentGroupings[Symbol.iterator]();
- !(v = (k = E.next()).done);
- v = !0
- ) {
- const I = k.value;
- y[I.from] = I.to;
- }
- } catch (e) {
- (b = !0), (w = e);
- } finally {
- try {
- v || E.return == null || E.return();
- } finally {
- if (b) throw w;
- }
- }
- const _ = this.metricsFunction(e, r, l, y);
- if (Object.keys(_).length) {
- if (!t.setAllMappedProps)
- return (
- ie(_, function (e, t) {
- n[e] = t;
- }),
- n
- );
- window.ga("set", _);
- }
- },
- },
- {
- key: "path",
- value(e, t) {
- if (e) {
- let n = e.path;
- return t && e.search && (n += e.search), n;
- }
- },
- },
- {
- key: "createProductTrack",
- value(e, t) {
- const n = t || {};
- return (
- (n.currency = t.currency || e.message.properties.currency),
- { properties: n }
- );
- },
- },
- {
- key: "loadEnhancedEcommerce",
- value(e, t) {
- return (
- t === 0 && (window.ga("require", "ec"), (t = 1)),
- window.ga("set", "&cu", e.message.properties.currency),
- t
- );
- },
- },
- {
- key: "enhancedEcommerceTrackProduct",
- value(e, t) {
- const n = {};
- let r = !0;
- let i = !1;
- let o = void 0;
- try {
- for (
- var s, c = t.dimensions[Symbol.iterator]();
- !(r = (s = c.next()).done);
- r = !0
- ) {
- const u = s.value;
- n[u.from] = u.to;
- }
- } catch (e) {
- (i = !0), (o = e);
- } finally {
- try {
- r || c.return == null || c.return();
- } finally {
- if (i) throw o;
- }
- }
- const l = {};
- let d = !0;
- let p = !1;
- let h = void 0;
- try {
- for (
- var f, g = t.metrics[Symbol.iterator]();
- !(d = (f = g.next()).done);
- d = !0
- ) {
- const m = f.value;
- l[m.from] = m.to;
- }
- } catch (e) {
- (p = !0), (h = e);
- } finally {
- try {
- d || g.return == null || g.return();
- } finally {
- if (p) throw h;
- }
- }
- const y = {};
- let v = !0;
- let b = !1;
- let w = void 0;
- try {
- for (
- var k, E = t.contentGroupings[Symbol.iterator]();
- !(v = (k = E.next()).done);
- v = !0
- ) {
- const I = k.value;
- y[I.from] = I.to;
- }
- } catch (e) {
- (b = !0), (w = e);
- } finally {
- try {
- v || E.return == null || E.return();
- } finally {
- if (b) throw w;
- }
- }
- const _ = e.message.properties;
- let A = {
- id: _.productId || _.id || _.sku,
- name: _.name,
- category: _.category,
- quantity: _.quantity,
- price: _.price,
- brand: _.brand,
- variant: _.variant,
- currency: _.currency,
- };
- _.position != null && (A.position = Math.round(_.position));
- const C = _.coupon;
- C && (A.coupon = C),
- (A = a({ product: A }, this.metricsFunction(_, n, l, y))),
- window.ga("ec:addProduct", A);
- },
- },
- {
- key: "enhancedEcommerceTrackProductAction",
- value(e, t, n, r) {
- this.enhancedEcommerceTrackProduct(e, r),
- window.ga("ec:setAction", t, n || {});
- },
- },
- {
- key: "pushEnhancedEcommerce",
- value(e, t) {
- const n = T([
- "send",
- "event",
- e.message.properties.category || "EnhancedEcommerce",
- e.message.event || "Action not defined",
- e.message.properties.label,
- a(
- { nonInteraction: 1 },
- this.setCustomDimenionsAndMetrics(e.message.properties, t)
- ),
- ]);
- let r = e.message.event;
- (r = r.toLowerCase()),
- this.eventWithCategoryFieldProductScoped.includes(r) &&
- (n[2] = "EnhancedEcommerce"),
- ga.apply(window, n);
- },
- },
- {
- key: "getProductPosition",
- value(e, t) {
- const n = e.properties.position;
- return void 0 !== n && !Number.isNaN(Number(n)) && Number(n) > -1
- ? n
- : t
- .map(function (e) {
- return e.product_id;
- })
- .indexOf(e.properties.product_id) + 1;
- },
- },
- {
- key: "extractCheckoutOptions",
- value(e) {
- const t = T([
- e.message.properties.paymentMethod,
- e.message.properties.shippingMethod,
- ]);
- return t.length > 0 ? t.join(", ") : null;
- },
- },
- ]),
- e
- );
- })();
- const ke = (function () {
- function e(t) {
- n(this, e),
- (this.siteId = t.siteID),
- (this.name = "HOTJAR"),
- (this._ready = !1);
- }
- return (
- i(e, [
- {
- key: "init",
- value() {
- (window.hotjarSiteId = this.siteId),
- (function (e, t, n, r, i, o) {
- (e.hj =
- e.hj ||
- function () {
- (e.hj.q = e.hj.q || []).push(arguments);
- }),
- (e._hjSettings = { hjid: e.hotjarSiteId, hjsv: 6 }),
- (i = t.getElementsByTagName("head")[0]),
- ((o = t.createElement("script")).async = 1),
- (o.src = `https://static.hotjar.com/c/hotjar-${e._hjSettings.hjid}.js?sv=${e._hjSettings.hjsv}`),
- i.appendChild(o);
- })(window, document),
- (this._ready = !0),
- g.debug("===in init Hotjar===");
- },
- },
- {
- key: "identify",
- value(e) {
- if (e.message.userId || e.message.anonymousId) {
- const t = e.message.context.traits;
- window.hj("identify", e.message.userId, t);
- } else g.debug("[Hotjar] identify:: user id is required");
- },
- },
- {
- key: "track",
- value(e) {
- g.debug("[Hotjar] track:: method not supported");
- },
- },
- {
- key: "page",
- value(e) {
- g.debug("[Hotjar] page:: method not supported");
- },
- },
- {
- key: "isLoaded",
- value() {
- return this._ready;
- },
- },
- {
- key: "isReady",
- value() {
- return this._ready;
- },
- },
- ]),
- e
- );
- })();
- const Ee = (function () {
- function e(t) {
- n(this, e),
- (this.conversionId = t.conversionID),
- (this.pageLoadConversions = t.pageLoadConversions),
- (this.clickEventConversions = t.clickEventConversions),
- (this.defaultPageConversion = t.defaultPageConversion),
- (this.name = "GOOGLEADS");
- }
- return (
- i(e, [
- {
- key: "init",
- value() {
- !(function (e, t, n) {
- g.debug(`in script loader=== ${e}`);
- const r = n.createElement("script");
- (r.src = t),
- (r.async = 1),
- (r.type = "text/javascript"),
- (r.id = e);
- const i = n.getElementsByTagName("head")[0];
- g.debug("==script==", i), i.appendChild(r);
- })(
- "googleAds-integration",
- `https://www.googletagmanager.com/gtag/js?id=${this.conversionId}`,
- document
- ),
- (window.dataLayer = window.dataLayer || []),
- (window.gtag = function () {
- window.dataLayer.push(arguments);
- }),
- window.gtag("js", new Date()),
- window.gtag("config", this.conversionId),
- g.debug("===in init Google Ads===");
- },
- },
- {
- key: "identify",
- value(e) {
- g.debug("[GoogleAds] identify:: method not supported");
- },
- },
- {
- key: "track",
- value(e) {
- g.debug("in GoogleAdsAnalyticsManager track");
- const t = this.getConversionData(
- this.clickEventConversions,
- e.message.event
- );
- if (t.conversionLabel) {
- const n = t.conversionLabel;
- const r = t.eventName;
- const i = `${this.conversionId}/${n}`;
- const o = {};
- e.properties &&
- ((o.value = e.properties.revenue),
- (o.currency = e.properties.currency),
- (o.transaction_id = e.properties.order_id)),
- (o.send_to = i),
- window.gtag("event", r, o);
- }
- },
- },
- {
- key: "page",
- value(e) {
- g.debug("in GoogleAdsAnalyticsManager page");
- const t = this.getConversionData(
- this.pageLoadConversions,
- e.message.name
- );
- if (t.conversionLabel) {
- const n = t.conversionLabel;
- const r = t.eventName;
- window.gtag("event", r, {
- send_to: `${this.conversionId}/${n}`,
- });
- }
- },
- },
- {
- key: "getConversionData",
- value(e, t) {
- const n = {};
- return (
- e &&
- (t
- ? e.forEach(function (e) {
- if (e.name.toLowerCase() === t.toLowerCase())
- return (
- (n.conversionLabel = e.conversionLabel),
- void (n.eventName = e.name)
- );
- })
- : this.defaultPageConversion &&
- ((n.conversionLabel = this.defaultPageConversion),
- (n.eventName = "Viewed a Page"))),
- n
- );
- },
- },
- {
- key: "isLoaded",
- value() {
- return window.dataLayer.push !== Array.prototype.push;
- },
- },
- {
- key: "isReady",
- value() {
- return window.dataLayer.push !== Array.prototype.push;
- },
- },
- ]),
- e
- );
- })();
- const Ie = (function () {
- function e(t, r) {
- n(this, e),
- (this.accountId = t.accountId),
- (this.settingsTolerance = t.settingsTolerance),
- (this.isSPA = t.isSPA),
- (this.libraryTolerance = t.libraryTolerance),
- (this.useExistingJquery = t.useExistingJquery),
- (this.sendExperimentTrack = t.sendExperimentTrack),
- (this.sendExperimentIdentify = t.sendExperimentIdentify),
- (this.name = "VWO"),
- (this.analytics = r),
- g.debug("Config ", t);
- }
- return (
- i(e, [
- {
- key: "init",
- value() {
- g.debug("===in init VWO===");
- const e = this.accountId;
- const t = this.settingsTolerance;
- const n = this.libraryTolerance;
- const r = this.useExistingJquery;
- const i = this.isSPA;
- (window._vwo_code = (function () {
- let o = !1;
- const s = document;
- return {
- use_existing_jquery() {
- return r;
- },
- library_tolerance() {
- return n;
- },
- finish() {
- if (!o) {
- o = !0;
- const e = s.getElementById("_vis_opt_path_hides");
- e && e.parentNode.removeChild(e);
- }
- },
- finished() {
- return o;
- },
- load(e) {
- const t = s.createElement("script");
- (t.src = e),
- (t.type = "text/javascript"),
- t.innerText,
- (t.onerror = function () {
- _vwo_code.finish();
- }),
- s.getElementsByTagName("head")[0].appendChild(t);
- },
- init() {
- const n = setTimeout("_vwo_code.finish()", t);
- const r = s.createElement("style");
- const o =
- "body{opacity:0 !important;filter:alpha(opacity=0) !important;background:none !important;}";
- const a = s.getElementsByTagName("head")[0];
- return (
- r.setAttribute("id", "_vis_opt_path_hides"),
- r.setAttribute("type", "text/css"),
- r.styleSheet
- ? (r.styleSheet.cssText = o)
- : r.appendChild(s.createTextNode(o)),
- a.appendChild(r),
- this.load(
- `//dev.visualwebsiteoptimizer.com/j.php?a=${e}&u=${encodeURIComponent(
- s.URL
- )}&r=${Math.random()}&f=${+i}`
- ),
- n
- );
- },
- };
- })()),
- (window._vwo_settings_timer = window._vwo_code.init()),
- (this.sendExperimentTrack || this.experimentViewedIdentify) &&
- this.experimentViewed();
- },
- },
- {
- key: "experimentViewed",
- value() {
- const e = this;
- window.VWO = window.VWO || [];
- const t = this;
- window.VWO.push([
- "onVariationApplied",
- function (n) {
- if (n) {
- g.debug("Variation Applied");
- const r = n[1];
- const i = n[2];
- if (
- (g.debug(
- "experiment id:",
- r,
- "Variation Name:",
- _vwo_exp[r].comb_n[i]
- ),
- void 0 !== _vwo_exp[r].comb_n[i] &&
- ["VISUAL_AB", "VISUAL", "SPLIT_URL", "SURVEY"].indexOf(
- _vwo_exp[r].type
- ) > -1)
- ) {
- try {
- t.sendExperimentTrack &&
- (g.debug("Tracking..."),
- e.analytics.track("Experiment Viewed", {
- experimentId: r,
- variationName: _vwo_exp[r].comb_n[i],
- }));
- } catch (e) {
- g.error("[VWO] experimentViewed:: ", e);
- }
- try {
- t.sendExperimentIdentify &&
- (g.debug("Identifying..."),
- e.analytics.identify(
- o({}, "Experiment: ".concat(r), _vwo_exp[r].comb_n[i])
- ));
- } catch (e) {
- g.error("[VWO] experimentViewed:: ", e);
- }
- }
- }
- },
- ]);
- },
- },
- {
- key: "identify",
- value(e) {
- g.debug("method not supported");
- },
- },
- {
- key: "track",
- value(e) {
- if (e.message.event === "Order Completed") {
- const t = e.message.properties
- ? e.message.properties.total || e.message.properties.revenue
- : 0;
- g.debug("Revenue", t),
- (window.VWO = window.VWO || []),
- window.VWO.push(["track.revenueConversion", t]);
- }
- },
- },
- {
- key: "page",
- value(e) {
- g.debug("method not supported");
- },
- },
- {
- key: "isLoaded",
- value() {
- return !!window._vwo_code;
- },
- },
- {
- key: "isReady",
- value() {
- return !!window._vwo_code;
- },
- },
- ]),
- e
- );
- })();
- const _e = (function () {
- function e(t) {
- n(this, e),
- (this.containerID = t.containerID),
- (this.name = "GOOGLETAGMANAGER");
- }
- return (
- i(e, [
- {
- key: "init",
- value() {
- g.debug("===in init GoogleTagManager==="),
- (function (e, t, n, r, i) {
- (e[r] = e[r] || []),
- e[r].push({
- "gtm.start": new Date().getTime(),
- event: "gtm.js",
- });
- const o = t.getElementsByTagName(n)[0];
- const s = t.createElement(n);
- (s.async = !0),
- (s.src = `https://www.googletagmanager.com/gtm.js?id=${i}`),
- o.parentNode.insertBefore(s, o);
- })(window, document, "script", "dataLayer", this.containerID);
- },
- },
- {
- key: "identify",
- value(e) {
- g.debug("[GTM] identify:: method not supported");
- },
- },
- {
- key: "track",
- value(e) {
- g.debug("===in track GoogleTagManager===");
- const t = e.message;
- const n = a(
- {
- event: t.event,
- userId: t.userId,
- anonymousId: t.anonymousId,
- },
- t.properties
- );
- this.sendToGTMDatalayer(n);
- },
- },
- {
- key: "page",
- value(e) {
- g.debug("===in page GoogleTagManager===");
- let t;
- const n = e.message;
- const r = n.name;
- const i = n.properties ? n.properties.category : void 0;
- r && (t = `Viewed ${r} page`),
- i && r && (t = `Viewed ${i} ${r} page`),
- t || (t = "Viewed a Page");
- const o = a(
- { event: t, userId: n.userId, anonymousId: n.anonymousId },
- n.properties
- );
- this.sendToGTMDatalayer(o);
- },
- },
- {
- key: "isLoaded",
- value() {
- return !(
- !window.dataLayer ||
- Array.prototype.push === window.dataLayer.push
- );
- },
- },
- {
- key: "sendToGTMDatalayer",
- value(e) {
- window.dataLayer.push(e);
- },
- },
- {
- key: "isReady",
- value() {
- return !(
- !window.dataLayer ||
- Array.prototype.push === window.dataLayer.push
- );
- },
- },
- ]),
- e
- );
- })();
- const Ae = (function () {
- function e(t, r) {
- if (
- (n(this, e),
- (this.analytics = r),
- (this.appKey = t.appKey),
- t.appKey || (this.appKey = ""),
- (this.endPoint = ""),
- t.dataCenter)
- ) {
- const i = t.dataCenter.trim().split("-");
- i[0].toLowerCase() === "eu"
- ? (this.endPoint = "sdk.fra-01.braze.eu")
- : (this.endPoint = `sdk.iad-${i[1]}.braze.com`);
- }
- (this.name = "BRAZE"), g.debug("Config ", t);
- }
- return (
- i(e, [
- {
- key: "formatGender",
- value(e) {
- if (e && typeof e === "string") {
- return ["woman", "female", "w", "f"].indexOf(e.toLowerCase()) > -1
- ? window.appboy.ab.User.Genders.FEMALE
- : ["man", "male", "m"].indexOf(e.toLowerCase()) > -1
- ? window.appboy.ab.User.Genders.MALE
- : ["other", "o"].indexOf(e.toLowerCase()) > -1
- ? window.appboy.ab.User.Genders.OTHER
- : void 0;
- }
- },
- },
- {
- key: "init",
- value() {
- g.debug("===in init Braze==="),
- (function (e, t, n, r, i) {
- (e.appboy = {}), (e.appboyQueue = []);
- for (
- let o = "initialize destroy getDeviceId toggleAppboyLogging setLogger openSession changeUser requestImmediateDataFlush requestFeedRefresh subscribeToFeedUpdates requestContentCardsRefresh subscribeToContentCardsUpdates logCardImpressions logCardClick logCardDismissal logFeedDisplayed logContentCardsDisplayed logInAppMessageImpression logInAppMessageClick logInAppMessageButtonClick logInAppMessageHtmlClick subscribeToNewInAppMessages subscribeToInAppMessage removeSubscription removeAllSubscriptions logCustomEvent logPurchase isPushSupported isPushBlocked isPushGranted isPushPermissionGranted registerAppboyPushMessages unregisterAppboyPushMessages trackLocation stopWebTracking resumeWebTracking wipeData ab ab.DeviceProperties ab.User ab.User.Genders ab.User.NotificationSubscriptionTypes ab.User.prototype.getUserId ab.User.prototype.setFirstName ab.User.prototype.setLastName ab.User.prototype.setEmail ab.User.prototype.setGender ab.User.prototype.setDateOfBirth ab.User.prototype.setCountry ab.User.prototype.setHomeCity ab.User.prototype.setLanguage ab.User.prototype.setEmailNotificationSubscriptionType ab.User.prototype.setPushNotificationSubscriptionType ab.User.prototype.setPhoneNumber ab.User.prototype.setAvatarImageUrl ab.User.prototype.setLastKnownLocation ab.User.prototype.setUserAttribute ab.User.prototype.setCustomUserAttribute ab.User.prototype.addToCustomAttributeArray ab.User.prototype.removeFromCustomAttributeArray ab.User.prototype.incrementCustomUserAttribute ab.User.prototype.addAlias ab.User.prototype.setCustomLocationAttribute ab.InAppMessage ab.InAppMessage.SlideFrom ab.InAppMessage.ClickAction ab.InAppMessage.DismissType ab.InAppMessage.OpenTarget ab.InAppMessage.ImageStyle ab.InAppMessage.TextAlignment ab.InAppMessage.Orientation ab.InAppMessage.CropType ab.InAppMessage.prototype.subscribeToClickedEvent ab.InAppMessage.prototype.subscribeToDismissedEvent ab.InAppMessage.prototype.removeSubscription ab.InAppMessage.prototype.removeAllSubscriptions ab.InAppMessage.prototype.closeMessage ab.InAppMessage.Button ab.InAppMessage.Button.prototype.subscribeToClickedEvent ab.InAppMessage.Button.prototype.removeSubscription ab.InAppMessage.Button.prototype.removeAllSubscriptions ab.SlideUpMessage ab.ModalMessage ab.FullScreenMessage ab.HtmlMessage ab.ControlMessage ab.Feed ab.Feed.prototype.getUnreadCardCount ab.ContentCards ab.ContentCards.prototype.getUnviewedCardCount ab.Card ab.Card.prototype.dismissCard ab.ClassicCard ab.CaptionedImage ab.Banner ab.ControlCard ab.WindowUtils display display.automaticallyShowNewInAppMessages display.showInAppMessage display.showFeed display.destroyFeed display.toggleFeed display.showContentCards display.hideContentCards display.toggleContentCards sharedLib".split(
- " "
- ),
- s = 0;
- s < o.length;
- s++
- ) {
- for (
- var a = o[s], c = e.appboy, u = a.split("."), l = 0;
- l < u.length - 1;
- l++
- )
- c = c[u[l]];
- c[u[l]] = new Function(
- `return function ${a.replace(
- /\./g,
- "_"
- )}(){window.appboyQueue.push(arguments); return true}`
- )();
- }
- (window.appboy.getUser = function () {
- return new window.appboy.ab.User();
- }),
- (window.appboy.getCachedFeed = function () {
- return new window.appboy.ab.Feed();
- }),
- (window.appboy.getCachedContentCards = function () {
- return new window.appboy.ab.ContentCards();
- }),
- ((i = t.createElement(n)).type = "text/javascript"),
- (i.src =
- "https://js.appboycdn.com/web-sdk/2.4/appboy.min.js"),
- (i.async = 1),
- (r = t.getElementsByTagName(n)[0]).parentNode.insertBefore(
- i,
- r
- );
- })(window, document, "script"),
- window.appboy.initialize(this.appKey, {
- enableLogging: !0,
- baseUrl: this.endPoint,
- }),
- window.appboy.display.automaticallyShowNewInAppMessages();
- const e = this.analytics.userId;
- e && appboy.changeUser(e), window.appboy.openSession();
- },
- },
- {
- key: "handleReservedProperties",
- value(e) {
- return (
- [
- "time",
- "product_id",
- "quantity",
- "event_name",
- "price",
- "currency",
- ].forEach(function (t) {
- delete e[t];
- }),
- e
- );
- },
- },
- {
- key: "identify",
- value(e) {
- const t = e.message.userId;
- const n = e.message.context.traits.address;
- const r = e.message.context.traits.avatar;
- const i = e.message.context.traits.birthday;
- const o = e.message.context.traits.email;
- const s = e.message.context.traits.firstname;
- const a = e.message.context.traits.gender;
- const c = e.message.context.traits.lastname;
- const u = e.message.context.traits.phone;
- const l = JSON.parse(JSON.stringify(e.message.context.traits));
- window.appboy.changeUser(t),
- window.appboy.getUser().setAvatarImageUrl(r),
- o && window.appboy.getUser().setEmail(o),
- s && window.appboy.getUser().setFirstName(s),
- a && window.appboy.getUser().setGender(this.formatGender(a)),
- c && window.appboy.getUser().setLastName(c),
- u && window.appboy.getUser().setPhoneNumber(u),
- n &&
- (window.appboy.getUser().setCountry(n.country),
- window.appboy.getUser().setHomeCity(n.city)),
- i &&
- window.appboy
- .getUser()
- .setDateOfBirth(
- i.getUTCFullYear(),
- i.getUTCMonth() + 1,
- i.getUTCDate()
- );
- [
- "avatar",
- "address",
- "birthday",
- "email",
- "id",
- "firstname",
- "gender",
- "lastname",
- "phone",
- "facebook",
- "twitter",
- "first_name",
- "last_name",
- "dob",
- "external_id",
- "country",
- "home_city",
- "bio",
- "gender",
- "phone",
- "email_subscribe",
- "push_subscribe",
- ].forEach(function (e) {
- delete l[e];
- }),
- Object.keys(l).forEach(function (e) {
- window.appboy.getUser().setCustomUserAttribute(e, l[e]);
- });
- },
- },
- {
- key: "handlePurchase",
- value(e, t) {
- const n = e.products;
- const r = e.currency;
- window.appboy.changeUser(t),
- del(e, "products"),
- del(e, "currency"),
- n.forEach(function (t) {
- const n = t.product_id;
- const i = t.price;
- const o = t.quantity;
- o && i && n && window.appboy.logPurchase(n, i, r, o, e);
- });
- },
- },
- {
- key: "track",
- value(e) {
- const t = e.message.userId;
- const n = e.message.event;
- let r = e.message.properties;
- window.appboy.changeUser(t),
- n.toLowerCase() === "order completed"
- ? this.handlePurchase(r, t)
- : ((r = this.handleReservedProperties(r)),
- window.appboy.logCustomEvent(n, r));
- },
- },
- {
- key: "page",
- value(e) {
- const t = e.message.userId;
- const n = e.message.name;
- let r = e.message.properties;
- (r = this.handleReservedProperties(r)),
- window.appboy.changeUser(t),
- window.appboy.logCustomEvent(n, r);
- },
- },
- {
- key: "isLoaded",
- value() {
- return window.appboyQueue === null;
- },
- },
- {
- key: "isReady",
- value() {
- return window.appboyQueue === null;
- },
- },
- ]),
- e
- );
- })();
- const Ce = l(function (e) {
- !(function () {
- const t =
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
- var n = {
- rotl(e, t) {
- return (e << t) | (e >>> (32 - t));
- },
- rotr(e, t) {
- return (e << (32 - t)) | (e >>> t);
- },
- endian(e) {
- if (e.constructor == Number)
- return (16711935 & n.rotl(e, 8)) | (4278255360 & n.rotl(e, 24));
- for (let t = 0; t < e.length; t++) e[t] = n.endian(e[t]);
- return e;
- },
- randomBytes(e) {
- for (var t = []; e > 0; e--) t.push(Math.floor(256 * Math.random()));
- return t;
- },
- bytesToWords(e) {
- for (var t = [], n = 0, r = 0; n < e.length; n++, r += 8)
- t[r >>> 5] |= e[n] << (24 - (r % 32));
- return t;
- },
- wordsToBytes(e) {
- for (var t = [], n = 0; n < 32 * e.length; n += 8)
- t.push((e[n >>> 5] >>> (24 - (n % 32))) & 255);
- return t;
- },
- bytesToHex(e) {
- for (var t = [], n = 0; n < e.length; n++)
- t.push((e[n] >>> 4).toString(16)), t.push((15 & e[n]).toString(16));
- return t.join("");
- },
- hexToBytes(e) {
- for (var t = [], n = 0; n < e.length; n += 2)
- t.push(parseInt(e.substr(n, 2), 16));
- return t;
- },
- bytesToBase64(e) {
- for (var n = [], r = 0; r < e.length; r += 3)
- for (
- let i = (e[r] << 16) | (e[r + 1] << 8) | e[r + 2], o = 0;
- o < 4;
- o++
- )
- 8 * r + 6 * o <= 8 * e.length
- ? n.push(t.charAt((i >>> (6 * (3 - o))) & 63))
- : n.push("=");
- return n.join("");
- },
- base64ToBytes(e) {
- e = e.replace(/[^A-Z0-9+\/]/gi, "");
- for (var n = [], r = 0, i = 0; r < e.length; i = ++r % 4)
- i != 0 &&
- n.push(
- ((t.indexOf(e.charAt(r - 1)) & (Math.pow(2, -2 * i + 8) - 1)) <<
- (2 * i)) |
- (t.indexOf(e.charAt(r)) >>> (6 - 2 * i))
- );
- return n;
- },
- };
- e.exports = n;
- })();
- });
- var Te = {
- utf8: {
- stringToBytes(e) {
- return Te.bin.stringToBytes(unescape(encodeURIComponent(e)));
- },
- bytesToString(e) {
- return decodeURIComponent(escape(Te.bin.bytesToString(e)));
- },
- },
- bin: {
- stringToBytes(e) {
- for (var t = [], n = 0; n < e.length; n++)
- t.push(255 & e.charCodeAt(n));
- return t;
- },
- bytesToString(e) {
- for (var t = [], n = 0; n < e.length; n++)
- t.push(String.fromCharCode(e[n]));
- return t.join("");
- },
- },
- };
- const Oe = Te;
- const Pe = function (e) {
- return (
- e != null &&
- (Se(e) ||
- (function (e) {
- return (
- typeof e.readFloatLE === "function" &&
- typeof e.slice === "function" &&
- Se(e.slice(0, 0))
- );
- })(e) ||
- !!e._isBuffer)
- );
- };
- function Se(e) {
- return (
- !!e.constructor &&
- typeof e.constructor.isBuffer === "function" &&
- e.constructor.isBuffer(e)
- );
- }
- const xe = l(function (e) {
- !(function () {
- const t = Ce;
- const n = Oe.utf8;
- const r = Pe;
- const i = Oe.bin;
- var o = function (e, s) {
- e.constructor == String
- ? (e =
- s && s.encoding === "binary"
- ? i.stringToBytes(e)
- : n.stringToBytes(e))
- : r(e)
- ? (e = Array.prototype.slice.call(e, 0))
- : Array.isArray(e) || (e = e.toString());
- for (
- var a = t.bytesToWords(e),
- c = 8 * e.length,
- u = 1732584193,
- l = -271733879,
- d = -1732584194,
- p = 271733878,
- h = 0;
- h < a.length;
- h++
- )
- a[h] =
- (16711935 & ((a[h] << 8) | (a[h] >>> 24))) |
- (4278255360 & ((a[h] << 24) | (a[h] >>> 8)));
- (a[c >>> 5] |= 128 << c % 32), (a[14 + (((c + 64) >>> 9) << 4)] = c);
- const f = o._ff;
- const g = o._gg;
- const m = o._hh;
- const y = o._ii;
- for (h = 0; h < a.length; h += 16) {
- const v = u;
- const b = l;
- const w = d;
- const k = p;
- (u = f(u, l, d, p, a[h + 0], 7, -680876936)),
- (p = f(p, u, l, d, a[h + 1], 12, -389564586)),
- (d = f(d, p, u, l, a[h + 2], 17, 606105819)),
- (l = f(l, d, p, u, a[h + 3], 22, -1044525330)),
- (u = f(u, l, d, p, a[h + 4], 7, -176418897)),
- (p = f(p, u, l, d, a[h + 5], 12, 1200080426)),
- (d = f(d, p, u, l, a[h + 6], 17, -1473231341)),
- (l = f(l, d, p, u, a[h + 7], 22, -45705983)),
- (u = f(u, l, d, p, a[h + 8], 7, 1770035416)),
- (p = f(p, u, l, d, a[h + 9], 12, -1958414417)),
- (d = f(d, p, u, l, a[h + 10], 17, -42063)),
- (l = f(l, d, p, u, a[h + 11], 22, -1990404162)),
- (u = f(u, l, d, p, a[h + 12], 7, 1804603682)),
- (p = f(p, u, l, d, a[h + 13], 12, -40341101)),
- (d = f(d, p, u, l, a[h + 14], 17, -1502002290)),
- (u = g(
- u,
- (l = f(l, d, p, u, a[h + 15], 22, 1236535329)),
- d,
- p,
- a[h + 1],
- 5,
- -165796510
- )),
- (p = g(p, u, l, d, a[h + 6], 9, -1069501632)),
- (d = g(d, p, u, l, a[h + 11], 14, 643717713)),
- (l = g(l, d, p, u, a[h + 0], 20, -373897302)),
- (u = g(u, l, d, p, a[h + 5], 5, -701558691)),
- (p = g(p, u, l, d, a[h + 10], 9, 38016083)),
- (d = g(d, p, u, l, a[h + 15], 14, -660478335)),
- (l = g(l, d, p, u, a[h + 4], 20, -405537848)),
- (u = g(u, l, d, p, a[h + 9], 5, 568446438)),
- (p = g(p, u, l, d, a[h + 14], 9, -1019803690)),
- (d = g(d, p, u, l, a[h + 3], 14, -187363961)),
- (l = g(l, d, p, u, a[h + 8], 20, 1163531501)),
- (u = g(u, l, d, p, a[h + 13], 5, -1444681467)),
- (p = g(p, u, l, d, a[h + 2], 9, -51403784)),
- (d = g(d, p, u, l, a[h + 7], 14, 1735328473)),
- (u = m(
- u,
- (l = g(l, d, p, u, a[h + 12], 20, -1926607734)),
- d,
- p,
- a[h + 5],
- 4,
- -378558
- )),
- (p = m(p, u, l, d, a[h + 8], 11, -2022574463)),
- (d = m(d, p, u, l, a[h + 11], 16, 1839030562)),
- (l = m(l, d, p, u, a[h + 14], 23, -35309556)),
- (u = m(u, l, d, p, a[h + 1], 4, -1530992060)),
- (p = m(p, u, l, d, a[h + 4], 11, 1272893353)),
- (d = m(d, p, u, l, a[h + 7], 16, -155497632)),
- (l = m(l, d, p, u, a[h + 10], 23, -1094730640)),
- (u = m(u, l, d, p, a[h + 13], 4, 681279174)),
- (p = m(p, u, l, d, a[h + 0], 11, -358537222)),
- (d = m(d, p, u, l, a[h + 3], 16, -722521979)),
- (l = m(l, d, p, u, a[h + 6], 23, 76029189)),
- (u = m(u, l, d, p, a[h + 9], 4, -640364487)),
- (p = m(p, u, l, d, a[h + 12], 11, -421815835)),
- (d = m(d, p, u, l, a[h + 15], 16, 530742520)),
- (u = y(
- u,
- (l = m(l, d, p, u, a[h + 2], 23, -995338651)),
- d,
- p,
- a[h + 0],
- 6,
- -198630844
- )),
- (p = y(p, u, l, d, a[h + 7], 10, 1126891415)),
- (d = y(d, p, u, l, a[h + 14], 15, -1416354905)),
- (l = y(l, d, p, u, a[h + 5], 21, -57434055)),
- (u = y(u, l, d, p, a[h + 12], 6, 1700485571)),
- (p = y(p, u, l, d, a[h + 3], 10, -1894986606)),
- (d = y(d, p, u, l, a[h + 10], 15, -1051523)),
- (l = y(l, d, p, u, a[h + 1], 21, -2054922799)),
- (u = y(u, l, d, p, a[h + 8], 6, 1873313359)),
- (p = y(p, u, l, d, a[h + 15], 10, -30611744)),
- (d = y(d, p, u, l, a[h + 6], 15, -1560198380)),
- (l = y(l, d, p, u, a[h + 13], 21, 1309151649)),
- (u = y(u, l, d, p, a[h + 4], 6, -145523070)),
- (p = y(p, u, l, d, a[h + 11], 10, -1120210379)),
- (d = y(d, p, u, l, a[h + 2], 15, 718787259)),
- (l = y(l, d, p, u, a[h + 9], 21, -343485551)),
- (u = (u + v) >>> 0),
- (l = (l + b) >>> 0),
- (d = (d + w) >>> 0),
- (p = (p + k) >>> 0);
- }
- return t.endian([u, l, d, p]);
- };
- (o._ff = function (e, t, n, r, i, o, s) {
- const a = e + ((t & n) | (~t & r)) + (i >>> 0) + s;
- return ((a << o) | (a >>> (32 - o))) + t;
- }),
- (o._gg = function (e, t, n, r, i, o, s) {
- const a = e + ((t & r) | (n & ~r)) + (i >>> 0) + s;
- return ((a << o) | (a >>> (32 - o))) + t;
- }),
- (o._hh = function (e, t, n, r, i, o, s) {
- const a = e + (t ^ n ^ r) + (i >>> 0) + s;
- return ((a << o) | (a >>> (32 - o))) + t;
- }),
- (o._ii = function (e, t, n, r, i, o, s) {
- const a = e + (n ^ (t | ~r)) + (i >>> 0) + s;
- return ((a << o) | (a >>> (32 - o))) + t;
- }),
- (o._blocksize = 16),
- (o._digestsize = 16),
- (e.exports = function (e, n) {
- if (e == null) throw new Error(`Illegal argument ${e}`);
- const r = t.wordsToBytes(o(e, n));
- return n && n.asBytes
- ? r
- : n && n.asString
- ? i.bytesToString(r)
- : t.bytesToHex(r);
- });
- })();
- });
- const Re = (function () {
- function e(t) {
- n(this, e),
- (this.NAME = "INTERCOM"),
- (this.API_KEY = t.apiKey),
- (this.APP_ID = t.appId),
- (this.MOBILE_APP_ID = t.mobileAppId),
- g.debug("Config ", t);
- }
- return (
- i(e, [
- {
- key: "init",
- value() {
- (window.intercomSettings = { app_id: this.APP_ID }),
- (function () {
- const e = window;
- const t = e.Intercom;
- if (typeof t === "function")
- t("reattach_activator"), t("update", e.intercomSettings);
- else {
- const n = document;
- const r = function e() {
- e.c(arguments);
- };
- (r.q = []),
- (r.c = function (e) {
- r.q.push(e);
- }),
- (e.Intercom = r);
- const i = function () {
- const e = n.createElement("script");
- (e.type = "text/javascript"),
- (e.async = !0),
- (e.src = `https://widget.intercom.io/widget/${window.intercomSettings.app_id}`);
- const t = n.getElementsByTagName("script")[0];
- t.parentNode.insertBefore(e, t);
- };
- document.readyState === "complete"
- ? (i(), (window.intercom_code = !0))
- : e.attachEvent
- ? (e.attachEvent("onload", i), (window.intercom_code = !0))
- : (e.addEventListener("load", i, !1),
- (window.intercom_code = !0));
- }
- })();
- },
- },
- {
- key: "page",
- value() {
- window.Intercom("update");
- },
- },
- {
- key: "identify",
- value(e) {
- const n = {};
- const r = e.message.context;
- if ((r.Intercom ? r.Intercom : null) != null) {
- const i = r.Intercom.user_hash ? r.Intercom.user_hash : null;
- i != null && (n.user_hash = i);
- const o = r.Intercom.hideDefaultLauncher
- ? r.Intercom.hideDefaultLauncher
- : null;
- o != null && (n.hide_default_launcher = o);
- }
- Object.keys(r.traits).forEach(function (e) {
- if (r.traits.hasOwnProperty(e)) {
- const i = r.traits[e];
- if (e === "company") {
- const o = [];
- const s = {};
- typeof r.traits[e] === "string" &&
- (s.company_id = xe(r.traits[e]));
- const a =
- (t(r.traits[e]) == "object" && Object.keys(r.traits[e])) ||
- [];
- a.forEach(function (t) {
- a.hasOwnProperty(t) &&
- (t != "id"
- ? (s[t] = r.traits[e][t])
- : (s.company_id = r.traits[e][t]));
- }),
- t(r.traits[e]) != "object" ||
- a.includes("id") ||
- (s.company_id = xe(s.name)),
- o.push(s),
- (n.companies = o);
- } else n[e] = r.traits[e];
- switch (e) {
- case "createdAt":
- n.created_at = i;
- break;
- case "anonymousId":
- n.user_id = i;
- }
- }
- }),
- (n.user_id = e.message.userId),
- window.Intercom("update", n);
- },
- },
- {
- key: "track",
- value(e) {
- const t = {};
- const n = e.message;
- (n.properties ? Object.keys(n.properties) : null).forEach(function (
- e
- ) {
- const r = n.properties[e];
- t[e] = r;
- }),
- n.event && (t.event_name = n.event),
- (t.user_id = n.userId ? n.userId : n.anonymousId),
- (t.created_at = Math.floor(
- new Date(n.originalTimestamp).getTime() / 1e3
- )),
- window.Intercom("trackEvent", t.event_name, t);
- },
- },
- {
- key: "isLoaded",
- value() {
- return !!window.intercom_code;
- },
- },
- {
- key: "isReady",
- value() {
- return !!window.intercom_code;
- },
- },
- ]),
- e
- );
- })();
- const je = (function () {
- function e(t) {
- n(this, e),
- (this.projectID = t.projectID),
- (this.writeKey = t.writeKey),
- (this.ipAddon = t.ipAddon),
- (this.uaAddon = t.uaAddon),
- (this.urlAddon = t.urlAddon),
- (this.referrerAddon = t.referrerAddon),
- (this.client = null),
- (this.name = "KEEN");
- }
- return (
- i(e, [
- {
- key: "init",
- value() {
- g.debug("===in init Keen==="),
- L(
- "keen-integration",
- "https://cdn.jsdelivr.net/npm/keen-tracking@4"
- );
- var e = setInterval(
- function () {
- void 0 !== window.KeenTracking &&
- void 0 !== window.KeenTracking &&
- ((this.client = (function (e) {
- return (
- (e.client = new window.KeenTracking({
- projectId: e.projectID,
- writeKey: e.writeKey,
- })),
- e.client
- );
- })(this)),
- clearInterval(e));
- }.bind(this),
- 1e3
- );
- },
- },
- {
- key: "identify",
- value(e) {
- g.debug("in Keen identify");
- const t = e.message.context.traits;
- const n = e.message.userId
- ? e.message.userId
- : e.message.anonymousId;
- var r = e.message.properties
- ? Object.assign(r, e.message.properties)
- : {};
- (r.user = { userId: n, traits: t }),
- (r = this.getAddOn(r)),
- this.client.extendEvents(r);
- },
- },
- {
- key: "track",
- value(e) {
- g.debug("in Keen track");
- const t = e.message.event;
- let n = e.message.properties;
- (n = this.getAddOn(n)), this.client.recordEvent(t, n);
- },
- },
- {
- key: "page",
- value(e) {
- g.debug("in Keen page");
- const t = e.message.name;
- const n = e.message.properties
- ? e.message.properties.category
- : void 0;
- let r = "Loaded a Page";
- t && (r = `Viewed ${t} page`),
- n && t && (r = `Viewed ${n} ${t} page`);
- let i = e.message.properties;
- (i = this.getAddOn(i)), this.client.recordEvent(r, i);
- },
- },
- {
- key: "isLoaded",
- value() {
- return g.debug("in Keen isLoaded"), !(this.client == null);
- },
- },
- {
- key: "isReady",
- value() {
- return !(this.client == null);
- },
- },
- {
- key: "getAddOn",
- value(e) {
- const t = [];
- return (
- this.ipAddon &&
- ((e.ip_address = "${keen.ip}"),
- t.push({
- name: "keen:ip_to_geo",
- input: { ip: "ip_address" },
- output: "ip_geo_info",
- })),
- this.uaAddon &&
- ((e.user_agent = "${keen.user_agent}"),
- t.push({
- name: "keen:ua_parser",
- input: { ua_string: "user_agent" },
- output: "parsed_user_agent",
- })),
- this.urlAddon &&
- ((e.page_url = document.location.href),
- t.push({
- name: "keen:url_parser",
- input: { url: "page_url" },
- output: "parsed_page_url",
- })),
- this.referrerAddon &&
- ((e.page_url = document.location.href),
- (e.referrer_url = document.referrer),
- t.push({
- name: "keen:referrer_parser",
- input: {
- referrer_url: "referrer_url",
- page_url: "page_url",
- },
- output: "referrer_info",
- })),
- (e.keen = { addons: t }),
- e
- );
- },
- },
- ]),
- e
- );
- })();
- const Le = Object.prototype.hasOwnProperty;
- const De = function (e) {
- for (
- let t = Array.prototype.slice.call(arguments, 1), n = 0;
- n < t.length;
- n += 1
- )
- for (const r in t[n]) Le.call(t[n], r) && (e[r] = t[n][r]);
- return e;
- };
- const Me = l(function (e) {
- function t(e) {
- return function (t, n, r, o) {
- let s;
- (normalize =
- o &&
- (function (e) {
- return typeof e === "function";
- })(o.normalizer)
- ? o.normalizer
- : i),
- (n = normalize(n));
- for (var a = !1; !a; ) c();
- function c() {
- for (s in t) {
- const e = normalize(s);
- if (n.indexOf(e) === 0) {
- const r = n.substr(e.length);
- if (r.charAt(0) === "." || r.length === 0) {
- n = r.substr(1);
- const i = t[s];
- return i == null
- ? void (a = !0)
- : n.length
- ? void (t = i)
- : void (a = !0);
- }
- }
- }
- (s = void 0), (a = !0);
- }
- if (s) return t == null ? t : e(t, s, r);
- };
- }
- function n(e, t) {
- return e.hasOwnProperty(t) && delete e[t], e;
- }
- function r(e, t, n) {
- return e.hasOwnProperty(t) && (e[t] = n), e;
- }
- function i(e) {
- return e.replace(/[^a-zA-Z0-9\.]+/g, "").toLowerCase();
- }
- (e.exports = t(function (e, t) {
- if (e.hasOwnProperty(t)) return e[t];
- })),
- (e.exports.find = e.exports),
- (e.exports.replace = function (e, n, i, o) {
- return t(r).call(this, e, n, i, o), e;
- }),
- (e.exports.del = function (e, r, i) {
- return t(n).call(this, e, r, null, i), e;
- });
- });
- const Ue =
- (Me.find,
- Me.replace,
- Me.del,
- (function () {
- function e(t) {
- n(this, e),
- (this.apiKey = t.apiKey),
- (this.prefixProperties = t.prefixProperties),
- (this.name = "KISSMETRICS");
- }
- return (
- i(e, [
- {
- key: "init",
- value() {
- g.debug("===in init Kissmetrics==="),
- (window._kmq = window._kmq || []);
- const e = window._kmk || this.apiKey;
- function t(e) {
- setTimeout(function () {
- const t = document;
- const n = t.getElementsByTagName("script")[0];
- const r = t.createElement("script");
- (r.type = "text/javascript"),
- (r.async = !0),
- (r.src = e),
- n.parentNode.insertBefore(r, n);
- }, 1);
- }
- t("//i.kissmetrics.com/i.js"),
- t(`//scripts.kissmetrics.com/${e}.2.js`),
- this.isEnvMobile() &&
- window._kmq.push(["set", { "Mobile Session": "Yes" }]);
- },
- },
- {
- key: "isEnvMobile",
- value() {
- return (
- navigator.userAgent.match(/Android/i) ||
- navigator.userAgent.match(/BlackBerry/i) ||
- navigator.userAgent.match(/IEMobile/i) ||
- navigator.userAgent.match(/Opera Mini/i) ||
- navigator.userAgent.match(/iPad/i) ||
- navigator.userAgent.match(/iPhone|iPod/i)
- );
- },
- },
- {
- key: "toUnixTimestamp",
- value(e) {
- return (e = new Date(e)), Math.floor(e.getTime() / 1e3);
- },
- },
- {
- key: "clean",
- value(e) {
- let t = {};
- for (const n in e)
- if (e.hasOwnProperty(n)) {
- const r = e[n];
- if (r == null) continue;
- if (J.date(r)) {
- t[n] = this.toUnixTimestamp(r);
- continue;
- }
- if (J.bool(r)) {
- t[n] = r;
- continue;
- }
- if (J.number(r)) {
- t[n] = r;
- continue;
- }
- if (
- (g.debug(r.toString()), r.toString() !== "[object Object]")
- ) {
- t[n] = r.toString();
- continue;
- }
- const i = {};
- i[n] = r;
- const o = this.flatten(i, { safe: !0 });
- for (const s in o) J.array(o[s]) && (o[s] = o[s].toString());
- delete (t = De(t, o))[n];
- }
- return t;
- },
- },
- {
- key: "flatten",
- value(e, t) {
- const n = (t = t || {}).delimiter || ".";
- let r = t.maxDepth;
- let i = 1;
- const o = {};
- return (
- (function e(s, a) {
- for (const c in s)
- if (s.hasOwnProperty(c)) {
- const u = s[c];
- const l = t.safe && J.array(u);
- const d = Object.prototype.toString.call(u);
- const p =
- d === "[object Object]" || d === "[object Array]";
- const h = [];
- const f = a ? a + n + c : c;
- for (const g in (t.maxDepth || (r = i + 1), u))
- u.hasOwnProperty(g) && h.push(g);
- if (!l && p && h.length && i < r) return ++i, e(u, f);
- o[f] = u;
- }
- })(e),
- o
- );
- },
- },
- {
- key: "prefix",
- value(e, t) {
- const n = {};
- return (
- ie(t, function (t, r) {
- t === "Billing Amount"
- ? (n[t] = r)
- : t === "revenue"
- ? ((n[`${e} - ${t}`] = r), (n["Billing Amount"] = r))
- : (n[`${e} - ${t}`] = r);
- }),
- n
- );
- },
- },
- {
- key: "identify",
- value(e) {
- g.debug("in Kissmetrics identify");
- const t = this.clean(e.message.context.traits);
- const n =
- e.message.userId && e.message.userId != ""
- ? e.message.userId
- : void 0;
- n && window._kmq.push(["identify", n]),
- t && window._kmq.push(["set", t]);
- },
- },
- {
- key: "track",
- value(e) {
- g.debug("in Kissmetrics track");
- const t = e.message.event;
- let n = JSON.parse(JSON.stringify(e.message.properties));
- const r = this.toUnixTimestamp(new Date());
- const i = _(n);
- i && (n.revenue = i);
- const o = n.products;
- o && delete n.products,
- (n = this.clean(n)),
- g.debug(JSON.stringify(n)),
- this.prefixProperties && (n = this.prefix(t, n)),
- window._kmq.push(["record", t, n]);
- const s = function (e, n) {
- let i = e;
- this.prefixProperties && (i = this.prefix(t, i)),
- (i._t = r + n),
- (i._d = 1),
- window.KM.set(i);
- }.bind(this);
- o &&
- window._kmq.push(function () {
- ie(o, s);
- });
- },
- },
- {
- key: "page",
- value(e) {
- g.debug("in Kissmetrics page");
- const t = e.message.name;
- const n = e.message.properties
- ? e.message.properties.category
- : void 0;
- let r = "Loaded a Page";
- t && (r = `Viewed ${t} page`),
- n && t && (r = `Viewed ${n} ${t} page`);
- let i = e.message.properties;
- this.prefixProperties && (i = this.prefix("Page", i)),
- window._kmq.push(["record", r, i]);
- },
- },
- {
- key: "alias",
- value(e) {
- const t = e.message.previousId;
- const n = e.message.userId;
- window._kmq.push(["alias", n, t]);
- },
- },
- {
- key: "group",
- value(e) {
- const t = e.message.groupId;
- let n = e.message.traits;
- (n = this.prefix("Group", n)),
- t && (n["Group - id"] = t),
- window._kmq.push(["set", n]),
- g.debug("in Kissmetrics group");
- },
- },
- {
- key: "isLoaded",
- value() {
- return J.object(window.KM);
- },
- },
- {
- key: "isReady",
- value() {
- return J.object(window.KM);
- },
- },
- ]),
- e
- );
- })());
- const Ne = (function () {
- function e(t) {
- n(this, e),
- (this.siteID = t.siteID),
- (this.apiKey = t.apiKey),
- (this.name = "CUSTOMERIO");
- }
- return (
- i(e, [
- {
- key: "init",
- value() {
- g.debug("===in init Customer IO init==="),
- (window._cio = window._cio || []);
- const e = this.siteID;
- !(function () {
- let t;
- let n;
- let r;
- for (
- t = function (e) {
- return function () {
- window._cio.push(
- [e].concat(Array.prototype.slice.call(arguments, 0))
- );
- };
- },
- n = ["load", "identify", "sidentify", "track", "page"],
- r = 0;
- r < n.length;
- r++
- )
- window._cio[n[r]] = t(n[r]);
- const i = document.createElement("script");
- const o = document.getElementsByTagName("script")[0];
- (i.async = !0),
- (i.id = "cio-tracker"),
- i.setAttribute("data-site-id", e),
- (i.src = "https://assets.customer.io/assets/track.js"),
- o.parentNode.insertBefore(i, o);
- })();
- },
- },
- {
- key: "identify",
- value(e) {
- g.debug("in Customer IO identify");
- const t = e.message.userId
- ? e.message.userId
- : e.message.anonymousId;
- const n = e.message.context.traits ? e.message.context.traits : {};
- n.created_at ||
- (n.created_at = Math.floor(new Date().getTime() / 1e3)),
- (n.id = t),
- window._cio.identify(n);
- },
- },
- {
- key: "track",
- value(e) {
- g.debug("in Customer IO track");
- const t = e.message.event;
- const n = e.message.properties;
- window._cio.track(t, n);
- },
- },
- {
- key: "page",
- value(e) {
- g.debug("in Customer IO page");
- const t = e.message.name || e.message.properties.url;
- window._cio.page(t, e.message.properties);
- },
- },
- {
- key: "isLoaded",
- value() {
- return !(!window._cio || window._cio.push === Array.prototype.push);
- },
- },
- {
- key: "isReady",
- value() {
- return !(!window._cio || window._cio.push === Array.prototype.push);
- },
- },
- ]),
- e
- );
- })();
- let qe = !1;
- const Be = [];
- var Fe = setInterval(function () {
- document.body && ((qe = !0), ie(Be, Ge), clearInterval(Fe));
- }, 5);
- function Ge(e) {
- e(document.body);
- }
- const Ke = (function () {
- function e(t, r) {
- n(this, e),
- (this.analytics = r),
- (this._sf_async_config = window._sf_async_config =
- window._sf_async_config || {}),
- (window._sf_async_config.useCanonical = !0),
- (window._sf_async_config.uid = t.uid),
- (window._sf_async_config.domain = t.domain),
- (this.isVideo = !!t.video),
- (this.sendNameAndCategoryAsTitle = t.sendNameAndCategoryAsTitle || !0),
- (this.subscriberEngagementKeys = t.subscriberEngagementKeys || []),
- (this.replayEvents = []),
- (this.failed = !1),
- (this.isFirstPageCallMade = !1),
- (this.name = "CHARTBEAT");
- }
- return (
- i(e, [
- {
- key: "init",
- value() {
- g.debug("===in init Chartbeat===");
- },
- },
- {
- key: "identify",
- value(e) {
- g.debug("in Chartbeat identify");
- },
- },
- {
- key: "track",
- value(e) {
- g.debug("in Chartbeat track");
- },
- },
- {
- key: "page",
- value(e) {
- if (
- (g.debug("in Chartbeat page"),
- this.loadConfig(e),
- this.isFirstPageCallMade)
- ) {
- if (this.failed)
- return (
- g.debug("===ignoring cause failed integration==="),
- void (this.replayEvents = [])
- );
- if (!this.isLoaded() && !this.failed)
- return (
- g.debug("===pushing to replay queue for chartbeat==="),
- void this.replayEvents.push(["page", e])
- );
- g.debug("===processing page event in chartbeat===");
- const t = e.message.properties;
- window.pSUPERFLY.virtualPage(t.path);
- } else (this.isFirstPageCallMade = !0), this.initAfterPage();
- },
- },
- {
- key: "isLoaded",
- value() {
- return (
- g.debug("in Chartbeat isLoaded"),
- !this.isFirstPageCallMade || !!window.pSUPERFLY
- );
- },
- },
- {
- key: "isFailed",
- value() {
- return this.failed;
- },
- },
- {
- key: "isReady",
- value() {
- return !!window.pSUPERFLY;
- },
- },
- {
- key: "loadConfig",
- value(e) {
- let t;
- const n = e.message.properties;
- const r = n ? n.category : void 0;
- const i = e.message.name;
- const o = n ? n.author : void 0;
- this.sendNameAndCategoryAsTitle && (t = r && i ? `${r} ${i}` : i),
- r && (window._sf_async_config.sections = r),
- o && (window._sf_async_config.authors = o),
- t && (window._sf_async_config.title = t);
- const s = (window._cbq = window._cbq || []);
- for (const a in n)
- n.hasOwnProperty(a) &&
- this.subscriberEngagementKeys.indexOf(a) > -1 &&
- s.push([a, n[a]]);
- },
- },
- {
- key: "initAfterPage",
- value() {
- let e;
- const t = this;
- (e = function () {
- let e;
- let n;
- const r = t.isVideo ? "chartbeat_video.js" : "chartbeat.js";
- (e = document.createElement("script")),
- (n = document.getElementsByTagName("script")[0]),
- (e.type = "text/javascript"),
- (e.async = !0),
- (e.src = `//static.chartbeat.com/js/${r}`),
- n.parentNode.insertBefore(e, n);
- }),
- qe ? Ge(e) : Be.push(e),
- this._isReady(this).then(function (e) {
- g.debug("===replaying on chartbeat==="),
- e.replayEvents.forEach(function (t) {
- e[t[0]](t[1]);
- });
- });
- },
- },
- {
- key: "pause",
- value(e) {
- return new Promise(function (t) {
- setTimeout(t, e);
- });
- },
- },
- {
- key: "_isReady",
- value(e) {
- const t = this;
- const n =
- arguments.length > 1 && void 0 !== arguments[1]
- ? arguments[1]
- : 0;
- return new Promise(function (r) {
- return t.isLoaded()
- ? ((t.failed = !1),
- g.debug("===chartbeat loaded successfully==="),
- e.analytics.emit("ready"),
- r(e))
- : n >= 1e4
- ? ((t.failed = !0), g.debug("===chartbeat failed==="), r(e))
- : void t.pause(1e3).then(function () {
- return t._isReady(e, n + 1e3).then(r);
- });
- });
- },
- },
- ]),
- e
- );
- })();
- const Ve = (function () {
- function e(t, r) {
- n(this, e),
- (this.c2ID = t.c2ID),
- (this.analytics = r),
- (this.comScoreBeaconParam = t.comScoreBeaconParam
- ? t.comScoreBeaconParam
- : {}),
- (this.isFirstPageCallMade = !1),
- (this.failed = !1),
- (this.comScoreParams = {}),
- (this.replayEvents = []),
- (this.name = "COMSCORE");
- }
- return (
- i(e, [
- {
- key: "init",
- value() {
- g.debug("===in init Comscore init===");
- },
- },
- {
- key: "identify",
- value(e) {
- g.debug("in Comscore identify");
- },
- },
- {
- key: "track",
- value(e) {
- g.debug("in Comscore track");
- },
- },
- {
- key: "page",
- value(e) {
- if (
- (g.debug("in Comscore page"),
- this.loadConfig(e),
- this.isFirstPageCallMade)
- ) {
- if (this.failed) return void (this.replayEvents = []);
- if (!this.isLoaded() && !this.failed)
- return void this.replayEvents.push(["page", e]);
- e.message.properties;
- window.COMSCORE.beacon(this.comScoreParams);
- } else (this.isFirstPageCallMade = !0), this.initAfterPage();
- },
- },
- {
- key: "loadConfig",
- value(e) {
- g.debug("=====in loadConfig====="),
- (this.comScoreParams = this.mapComscoreParams(
- e.message.properties
- )),
- (window._comscore = window._comscore || []),
- window._comscore.push(this.comScoreParams);
- },
- },
- {
- key: "initAfterPage",
- value() {
- g.debug("=====in initAfterPage====="),
- (function () {
- const e = document.createElement("script");
- const t = document.getElementsByTagName("script")[0];
- (e.async = !0),
- (e.src = `${
- document.location.protocol == "https:"
- ? "https://sb"
- : "http://b"
- }.scorecardresearch.com/beacon.js`),
- t.parentNode.insertBefore(e, t);
- })(),
- this._isReady(this).then(function (e) {
- e.replayEvents.forEach(function (t) {
- e[t[0]](t[1]);
- });
- });
- },
- },
- {
- key: "pause",
- value(e) {
- return new Promise(function (t) {
- setTimeout(t, e);
- });
- },
- },
- {
- key: "_isReady",
- value(e) {
- const t = this;
- const n =
- arguments.length > 1 && void 0 !== arguments[1]
- ? arguments[1]
- : 0;
- return new Promise(function (r) {
- return t.isLoaded()
- ? ((t.failed = !1), e.analytics.emit("ready"), r(e))
- : n >= 1e4
- ? ((t.failed = !0), r(e))
- : void t.pause(1e3).then(function () {
- return t._isReady(e, n + 1e3).then(r);
- });
- });
- },
- },
- {
- key: "mapComscoreParams",
- value(e) {
- g.debug("=====in mapComscoreParams=====");
- const t = this.comScoreBeaconParam;
- const n = {};
- return (
- Object.keys(t).forEach(function (r) {
- if (r in e) {
- const i = t[r];
- const o = e[r];
- n[i] = o;
- }
- }),
- (n.c1 = "2"),
- (n.c2 = this.c2ID),
- g.debug("=====in mapComscoreParams=====", n),
- n
- );
- },
- },
- {
- key: "isLoaded",
- value() {
- return (
- g.debug("in Comscore isLoaded"),
- !this.isFirstPageCallMade || !!window.COMSCORE
- );
- },
- },
- {
- key: "isReady",
- value() {
- return !!window.COMSCORE;
- },
- },
- ]),
- e
- );
- })();
- const He = Object.prototype.hasOwnProperty;
- const ze = String.prototype.charAt;
- const Je = Object.prototype.toString;
- const We = function (e, t) {
- return ze.call(e, t);
- };
- const $e = function (e, t) {
- return He.call(e, t);
- };
- const Ye = function (e, t) {
- t = t || $e;
- for (var n = [], r = 0, i = e.length; r < i; r += 1)
- t(e, r) && n.push(String(r));
- return n;
- };
- const Qe = function (e) {
- return e == null
- ? []
- : ((t = e),
- Je.call(t) === "[object String]"
- ? Ye(e, We)
- : (function (e) {
- return (
- e != null &&
- typeof e !== "function" &&
- typeof e.length === "number"
- );
- })(e)
- ? Ye(e, $e)
- : (function (e, t) {
- t = t || $e;
- const n = [];
- for (const r in e) t(e, r) && n.push(String(r));
- return n;
- })(e));
- let t;
- };
- const Ze = Object.prototype.toString;
- const Xe =
- typeof Array.isArray === "function"
- ? Array.isArray
- : function (e) {
- return Ze.call(e) === "[object Array]";
- };
- const et = function (e) {
- return (
- e != null &&
- (Xe(e) ||
- (e !== "function" &&
- (function (e) {
- const t = typeof e;
- return (
- t === "number" ||
- (t === "object" && Ze.call(e) === "[object Number]")
- );
- })(e.length)))
- );
- };
- const tt = function (e, t) {
- for (let n = 0; n < t.length && !1 !== e(t[n], n, t); n += 1);
- };
- const nt = function (e, t) {
- for (
- let n = Qe(t), r = 0;
- r < n.length && !1 !== e(t[n[r]], n[r], t);
- r += 1
- );
- };
- const rt = function (e, t) {
- return (et(t) ? tt : nt).call(this, e, t);
- };
- const it = (function () {
- function e(t) {
- n(this, e),
- (this.blacklistPiiProperties = t.blacklistPiiProperties),
- (this.categoryToContent = t.categoryToContent),
- (this.pixelId = t.pixelId),
- (this.eventsToEvents = t.eventsToEvents),
- (this.eventCustomProperties = t.eventCustomProperties),
- (this.valueFieldIdentifier = t.valueFieldIdentifier),
- (this.advancedMapping = t.advancedMapping),
- (this.traitKeyToExternalId = t.traitKeyToExternalId),
- (this.legacyConversionPixelId = t.legacyConversionPixelId),
- (this.userIdAsPixelId = t.userIdAsPixelId),
- (this.whitelistPiiProperties = t.whitelistPiiProperties),
- (this.name = "FB_PIXEL");
- }
- return (
- i(e, [
- {
- key: "init",
- value() {
- void 0 === this.categoryToContent && (this.categoryToContent = []),
- void 0 === this.legacyConversionPixelId &&
- (this.legacyConversionPixelId = []),
- void 0 === this.userIdAsPixelId && (this.userIdAsPixelId = []),
- g.debug("===in init FbPixel==="),
- (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.disablePushState = !0),
- (window.fbq.allowDuplicatePageViews = !0),
- (window.fbq.version = "2.0"),
- (window.fbq.queue = []),
- window.fbq("init", this.pixelId),
- L(
- "fbpixel-integration",
- "//connect.facebook.net/en_US/fbevents.js"
- );
- },
- },
- {
- key: "isLoaded",
- value() {
- return (
- g.debug("in FBPixel isLoaded"),
- !(!window.fbq || !window.fbq.callMethod)
- );
- },
- },
- {
- key: "isReady",
- value() {
- return (
- g.debug("in FBPixel isReady"),
- !(!window.fbq || !window.fbq.callMethod)
- );
- },
- },
- {
- key: "page",
- value(e) {
- window.fbq("track", "PageView");
- },
- },
- {
- key: "identify",
- value(e) {
- this.advancedMapping &&
- window.fbq("init", this.pixelId, e.message.context.traits);
- },
- },
- {
- key: "track",
- value(e) {
- const t = this;
- const n = this;
- const r = e.message.event;
- let i = this.formatRevenue(e.message.properties.revenue);
- const o = this.buildPayLoad(e, !0);
- void 0 === this.categoryToContent && (this.categoryToContent = []),
- void 0 === this.legacyConversionPixelId &&
- (this.legacyConversionPixelId = []),
- void 0 === this.userIdAsPixelId && (this.userIdAsPixelId = []),
- (o.value = i);
- let s;
- let a;
- const c = this.eventsToEvents;
- const u = this.legacyConversionPixelId;
- if (
- ((s = c.reduce(function (e, t) {
- return t.from === r && e.push(t.to), e;
- }, [])),
- (a = u.reduce(function (e, t) {
- return t.from === r && e.push(t.to), e;
- }, [])),
- rt(function (t) {
- (o.currency = e.message.properties.currency || "USD"),
- window.fbq("trackSingle", n.pixelId, t, o, {
- eventID: e.message.messageId,
- });
- }, s),
- rt(function (t) {
- window.fbq(
- "trackSingle",
- n.pixelId,
- t,
- { currency: e.message.properties.currency, value: i },
- { eventID: e.message.messageId }
- );
- }, a),
- r === "Product List Viewed")
- ) {
- var l = [];
- var d = e.message.properties.products;
- var p = this.buildPayLoad(e, !0);
- Array.isArray(d) &&
- d.forEach(function (t) {
- const n = t.product_id;
- n &&
- (g.push(n),
- l.push({
- id: n,
- quantity: e.message.properties.quantity,
- }));
- }),
- g.length
- ? (f = ["product"])
- : (g.push(e.message.properties.category || ""),
- l.push({
- id: e.message.properties.category || "",
- quantity: 1,
- }),
- (f = ["product_group"])),
- window.fbq(
- "trackSingle",
- n.pixelId,
- "ViewContent",
- this.merge(
- {
- content_ids: g,
- content_type: this.getContentType(e, f),
- contents: l,
- },
- p
- ),
- { eventID: e.message.messageId }
- ),
- rt(function (r) {
- window.fbq(
- "trackSingle",
- n.pixelId,
- r,
- {
- currency: e.message.properties.currency,
- value: t.formatRevenue(e.message.properties.revenue),
- },
- { eventID: e.message.messageId }
- );
- }, a);
- } else if (r === "Product Viewed") {
- var h = this.valueFieldIdentifier === "properties.value";
- p = this.buildPayLoad(e, !0);
- window.fbq(
- "trackSingle",
- n.pixelId,
- "ViewContent",
- this.merge(
- {
- content_ids: [
- e.message.properties.product_id ||
- e.message.properties.id ||
- e.message.properties.sku ||
- "",
- ],
- content_type: this.getContentType(e, ["product"]),
- content_name: e.message.properties.product_name || "",
- content_category: e.message.properties.category || "",
- currency: e.message.properties.currency,
- value: h
- ? this.formatRevenue(e.message.properties.value)
- : this.formatRevenue(e.message.properties.price),
- contents: [
- {
- id:
- e.message.properties.product_id ||
- e.message.properties.id ||
- e.message.properties.sku ||
- "",
- quantity: e.message.properties.quantity,
- item_price: e.message.properties.price,
- },
- ],
- },
- p
- ),
- { eventID: e.message.messageId }
- ),
- rt(function (r) {
- window.fbq(
- "trackSingle",
- n.pixelId,
- r,
- {
- currency: e.message.properties.currency,
- value: h
- ? t.formatRevenue(e.message.properties.value)
- : t.formatRevenue(e.message.properties.price),
- },
- { eventID: e.message.messageId }
- );
- }, a);
- } else if (r === "Product Added") {
- (h = this.valueFieldIdentifier === "properties.value"),
- (p = this.buildPayLoad(e, !0));
- window.fbq(
- "trackSingle",
- n.pixelId,
- "AddToCart",
- this.merge(
- {
- content_ids: [
- e.message.properties.product_id ||
- e.message.properties.id ||
- e.message.properties.sku ||
- "",
- ],
- content_type: this.getContentType(e, ["product"]),
- content_name: e.message.properties.product_name || "",
- content_category: e.message.properties.category || "",
- currency: e.message.properties.currency,
- value: h
- ? this.formatRevenue(e.message.properties.value)
- : this.formatRevenue(e.message.properties.price),
- contents: [
- {
- id:
- e.message.properties.product_id ||
- e.message.properties.id ||
- e.message.properties.sku ||
- "",
- quantity: e.message.properties.quantity,
- item_price: e.message.properties.price,
- },
- ],
- },
- p
- ),
- { eventID: e.message.messageId }
- ),
- rt(function (r) {
- window.fbq(
- "trackSingle",
- n.pixelId,
- r,
- {
- currency: e.message.properties.currency,
- value: h
- ? t.formatRevenue(e.message.properties.value)
- : t.formatRevenue(e.message.properties.price),
- },
- { eventID: e.message.messageId }
- );
- }, a),
- this.merge(
- {
- content_ids: [
- e.message.properties.product_id ||
- e.message.properties.id ||
- e.message.properties.sku ||
- "",
- ],
- content_type: this.getContentType(e, ["product"]),
- content_name: e.message.properties.product_name || "",
- content_category: e.message.properties.category || "",
- currency: e.message.properties.currency,
- value: h
- ? this.formatRevenue(e.message.properties.value)
- : this.formatRevenue(e.message.properties.price),
- contents: [
- {
- id:
- e.message.properties.product_id ||
- e.message.properties.id ||
- e.message.properties.sku ||
- "",
- quantity: e.message.properties.quantity,
- item_price: e.message.properties.price,
- },
- ],
- },
- p
- );
- } else if (r === "Order Completed") {
- (d = e.message.properties.products),
- (p = this.buildPayLoad(e, !0)),
- (i = this.formatRevenue(e.message.properties.revenue));
- for (
- var f = this.getContentType(e, ["product"]),
- g = [],
- m = ((l = []), 0);
- m < d.length;
- m++
- ) {
- var y = product.product_id;
- g.push(y);
- var v = { id: y, quantity: e.message.properties.quantity };
- e.message.properties.price &&
- (v.item_price = e.message.properties.price),
- l.push(v);
- }
- window.fbq(
- "trackSingle",
- n.pixelId,
- "Purchase",
- this.merge(
- {
- content_ids: g,
- content_type: f,
- currency: e.message.properties.currency,
- value: i,
- contents: l,
- num_items: g.length,
- },
- p
- ),
- { eventID: e.message.messageId }
- ),
- rt(function (r) {
- window.fbq(
- "trackSingle",
- n.pixelId,
- r,
- {
- currency: e.message.properties.currency,
- value: t.formatRevenue(e.message.properties.revenue),
- },
- { eventID: e.message.messageId }
- );
- }, a);
- } else if (r === "Products Searched") {
- p = this.buildPayLoad(e, !0);
- window.fbq(
- "trackSingle",
- n.pixelId,
- "Search",
- this.merge({ search_string: e.message.properties.query }, p),
- { eventID: e.message.messageId }
- ),
- rt(function (t) {
- window.fbq(
- "trackSingle",
- n.pixelId,
- t,
- {
- currency: e.message.properties.currency,
- value: formatRevenue(e.message.properties.revenue),
- },
- { eventID: e.message.messageId }
- );
- }, a);
- } else if (r === "Checkout Started") {
- (d = e.message.properties.products),
- (p = this.buildPayLoad(e, !0)),
- (i = this.formatRevenue(e.message.properties.revenue));
- let b = e.message.properties.category;
- for (g = [], l = [], m = 0; m < d.length; m++) {
- y = d[m].product_id;
- g.push(y);
- v = {
- id: y,
- quantity: e.message.properties.quantity,
- item_price: e.message.properties.price,
- };
- e.message.properties.price &&
- (v.item_price = e.message.properties.price),
- l.push(v);
- }
- !b && d[0] && d[0].category && (b = d[0].category),
- window.fbq(
- "trackSingle",
- n.pixelId,
- "InitiateCheckout",
- this.merge(
- {
- content_category: b,
- content_ids: g,
- content_type: this.getContentType(e, ["product"]),
- currency: e.message.properties.currency,
- value: i,
- contents: l,
- num_items: g.length,
- },
- p
- ),
- { eventID: e.message.messageId }
- ),
- rt(function (r) {
- window.fbq(
- "trackSingle",
- n.pixelId,
- r,
- {
- currency: e.message.properties.currency,
- value: t.formatRevenue(e.message.properties.revenue),
- },
- { eventID: e.message.messageId }
- );
- }, a);
- }
- },
- },
- {
- key: "getContentType",
- value(e, t) {
- const n = e.message.options;
- if (n && n.contentType) return [n.contentType];
- let r;
- let i = e.message.properties.category;
- if (!i) {
- const o = e.message.properties.products;
- o && o.length && (i = o[0].category);
- }
- if (
- i &&
- (r = this.categoryToContent.reduce(function (e, t) {
- return t.from == i && e.push(t.to), e;
- }, [])).length
- )
- return r;
- return t;
- },
- },
- {
- key: "merge",
- value(e, t) {
- const n = {};
- for (const r in e) e.hasOwnProperty(r) && (n[r] = e[r]);
- for (const i in t)
- t.hasOwnProperty(i) && !n.hasOwnProperty(i) && (n[i] = t[i]);
- return n;
- },
- },
- {
- key: "formatRevenue",
- value(e) {
- return Number(e || 0).toFixed(2);
- },
- },
- {
- key: "buildPayLoad",
- value(e, t) {
- for (
- var n = [
- "checkinDate",
- "checkoutDate",
- "departingArrivalDate",
- "departingDepartureDate",
- "returningArrivalDate",
- "returningDepartureDate",
- "travelEnd",
- "travelStart",
- ],
- r = [
- "email",
- "firstName",
- "lastName",
- "gender",
- "city",
- "country",
- "phone",
- "state",
- "zip",
- "birthday",
- ],
- i = this.whitelistPiiProperties || [],
- o = this.blacklistPiiProperties || [],
- s = this.eventCustomProperties || [],
- a = {},
- c = 0;
- c < o[c];
- c++
- ) {
- const u = o[c];
- a[u.blacklistPiiProperties] = u.blacklistPiiHash;
- }
- const l = {};
- const d = e.message.properties;
- for (const p in d)
- if (d.hasOwnProperty(p) && !(t && s.indexOf(p) < 0)) {
- const h = d[p];
- if (n.indexOf(d) >= 0 && J.date(h))
- l[p] = h.toISOTring().split("T")[0];
- else if (a.hasOwnProperty(p))
- a[p] && typeof h === "string" && (l[p] = sha256(h));
- else {
- const f = r.indexOf(p) >= 0;
- const g = i.indexOf(p) >= 0;
- (f && !g) || (l[p] = h);
- }
- }
- return l;
- },
- },
- ]),
- e
- );
- })();
- const ot = Object.prototype.toString;
- const st = function e(t) {
- const n = (function (e) {
- switch (ot.call(e)) {
- case "[object Date]":
- return "date";
- case "[object RegExp]":
- return "regexp";
- case "[object Arguments]":
- return "arguments";
- case "[object Array]":
- return "array";
- case "[object Error]":
- return "error";
- }
- return e === null
- ? "null"
- : void 0 === e
- ? "undefined"
- : e != e
- ? "nan"
- : e && e.nodeType === 1
- ? "element"
- : (t = e) != null &&
- (t._isBuffer ||
- (t.constructor &&
- typeof t.constructor.isBuffer === "function" &&
- t.constructor.isBuffer(t)))
- ? "buffer"
- : typeof (e = e.valueOf
- ? e.valueOf()
- : Object.prototype.valueOf.apply(e));
- let t;
- })(t);
- if (n === "object") {
- var r = {};
- for (const i in t) t.hasOwnProperty(i) && (r[i] = e(t[i]));
- return r;
- }
- if (n === "array") {
- r = new Array(t.length);
- for (let o = 0, s = t.length; o < s; o++) r[o] = e(t[o]);
- return r;
- }
- if (n === "regexp") {
- let a = "";
- return (
- (a += t.multiline ? "m" : ""),
- (a += t.global ? "g" : ""),
- (a += t.ignoreCase ? "i" : ""),
- new RegExp(t.source, a)
- );
- }
- return n === "date" ? new Date(t.getTime()) : t;
- };
- const at = 1e3;
- const ct = 60 * at;
- const ut = 60 * ct;
- const lt = 24 * ut;
- const dt = 365.25 * lt;
- const pt = function (e, t) {
- return (
- (t = t || {}),
- typeof e === "string"
- ? (function (e) {
- if ((e = `${e}`).length > 1e4) return;
- const t = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(
- e
- );
- if (!t) return;
- const n = parseFloat(t[1]);
- switch ((t[2] || "ms").toLowerCase()) {
- case "years":
- case "year":
- case "yrs":
- case "yr":
- case "y":
- return n * dt;
- case "days":
- case "day":
- case "d":
- return n * lt;
- case "hours":
- case "hour":
- case "hrs":
- case "hr":
- case "h":
- return n * ut;
- case "minutes":
- case "minute":
- case "mins":
- case "min":
- case "m":
- return n * ct;
- case "seconds":
- case "second":
- case "secs":
- case "sec":
- case "s":
- return n * at;
- case "milliseconds":
- case "millisecond":
- case "msecs":
- case "msec":
- case "ms":
- return n;
- }
- })(e)
- : t.long
- ? (function (e) {
- return (
- ht(e, lt, "day") ||
- ht(e, ut, "hour") ||
- ht(e, ct, "minute") ||
- ht(e, at, "second") ||
- `${e} ms`
- );
- })(e)
- : (function (e) {
- return e >= lt
- ? `${Math.round(e / lt)}d`
- : e >= ut
- ? `${Math.round(e / ut)}h`
- : e >= ct
- ? `${Math.round(e / ct)}m`
- : e >= at
- ? `${Math.round(e / at)}s`
- : `${e}ms`;
- })(e)
- );
- };
- function ht(e, t, n) {
- if (!(e < t))
- return e < 1.5 * t
- ? `${Math.floor(e / t)} ${n}`
- : `${Math.ceil(e / t)} ${n}s`;
- }
- const ft = l(function (e, t) {
- ((t = e.exports = function (e) {
- function i() {}
- function o() {
- const e = o;
- const i = +new Date();
- const s = i - (n || i);
- (e.diff = s),
- (e.prev = n),
- (e.curr = i),
- (n = i),
- e.useColors == null && (e.useColors = t.useColors()),
- e.color == null &&
- e.useColors &&
- (e.color = t.colors[r++ % t.colors.length]);
- let a = Array.prototype.slice.call(arguments);
- (a[0] = t.coerce(a[0])),
- typeof a[0] !== "string" && (a = ["%o"].concat(a));
- let c = 0;
- (a[0] = a[0].replace(/%([a-z%])/g, function (n, r) {
- if (n === "%%") return n;
- c++;
- const i = t.formatters[r];
- if (typeof i === "function") {
- const o = a[c];
- (n = i.call(e, o)), a.splice(c, 1), c--;
- }
- return n;
- })),
- typeof t.formatArgs === "function" && (a = t.formatArgs.apply(e, a)),
- (o.log || t.log || console.log.bind(console)).apply(e, a);
- }
- (i.enabled = !1), (o.enabled = !0);
- const s = t.enabled(e) ? o : i;
- return (s.namespace = e), s;
- }).coerce = function (e) {
- return e instanceof Error ? e.stack || e.message : e;
- }),
- (t.disable = function () {
- t.enable("");
- }),
- (t.enable = function (e) {
- t.save(e);
- for (let n = (e || "").split(/[\s,]+/), r = n.length, i = 0; i < r; i++)
- n[i] &&
- ((e = n[i].replace(/\*/g, ".*?"))[0] === "-"
- ? t.skips.push(new RegExp(`^${e.substr(1)}$`))
- : t.names.push(new RegExp(`^${e}$`)));
- }),
- (t.enabled = function (e) {
- let n;
- let r;
- for (n = 0, r = t.skips.length; n < r; n++)
- if (t.skips[n].test(e)) return !1;
- for (n = 0, r = t.names.length; n < r; n++)
- if (t.names[n].test(e)) return !0;
- return !1;
- }),
- (t.humanize = pt),
- (t.names = []),
- (t.skips = []),
- (t.formatters = {});
- let n;
- var r = 0;
- });
- const gt =
- (ft.coerce,
- ft.disable,
- ft.enable,
- ft.enabled,
- ft.humanize,
- ft.names,
- ft.skips,
- ft.formatters,
- l(function (e, t) {
- function n() {
- let e;
- try {
- e = t.storage.debug;
- } catch (e) {}
- return e;
- }
- ((t = e.exports = ft).log = function () {
- return (
- typeof console === "object" &&
- console.log &&
- Function.prototype.apply.call(console.log, console, arguments)
- );
- }),
- (t.formatArgs = function () {
- let e = arguments;
- const n = this.useColors;
- if (
- ((e[0] = `${
- (n ? "%c" : "") +
- this.namespace +
- (n ? " %c" : " ") +
- e[0] +
- (n ? "%c " : " ")
- }+${t.humanize(this.diff)}`),
- !n)
- )
- return e;
- const r = `color: ${this.color}`;
- e = [e[0], r, "color: inherit"].concat(
- Array.prototype.slice.call(e, 1)
- );
- let i = 0;
- let o = 0;
- return (
- e[0].replace(/%[a-z%]/g, function (e) {
- e !== "%%" && (i++, e === "%c" && (o = i));
- }),
- e.splice(o, 0, r),
- e
- );
- }),
- (t.save = function (e) {
- try {
- e == null ? t.storage.removeItem("debug") : (t.storage.debug = e);
- } catch (e) {}
- }),
- (t.load = n),
- (t.useColors = function () {
- return (
- "WebkitAppearance" in document.documentElement.style ||
- (window.console &&
- (console.firebug || (console.exception && console.table))) ||
- (navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) &&
- parseInt(RegExp.$1, 10) >= 31)
- );
- }),
- (t.storage =
- typeof chrome !== "undefined" && void 0 !== chrome.storage
- ? chrome.storage.local
- : (function () {
- try {
- return window.localStorage;
- } catch (e) {}
- })()),
- (t.colors = [
- "lightseagreen",
- "forestgreen",
- "goldenrod",
- "dodgerblue",
- "darkorchid",
- "crimson",
- ]),
- (t.formatters.j = function (e) {
- return JSON.stringify(e);
- }),
- t.enable(n());
- }));
- const mt =
- (gt.log,
- gt.formatArgs,
- gt.save,
- gt.load,
- gt.useColors,
- gt.storage,
- gt.colors,
- gt("cookie"));
- const yt = function (e, t, n) {
- switch (arguments.length) {
- case 3:
- case 2:
- return vt(e, t, n);
- case 1:
- return wt(e);
- default:
- return bt();
- }
- };
- function vt(e, t, n) {
- n = n || {};
- let r = `${kt(e)}=${kt(t)}`;
- t == null && (n.maxage = -1),
- n.maxage && (n.expires = new Date(+new Date() + n.maxage)),
- n.path && (r += `; path=${n.path}`),
- n.domain && (r += `; domain=${n.domain}`),
- n.expires && (r += `; expires=${n.expires.toUTCString()}`),
- n.samesite && (r += `; samesite=${n.samesite}`),
- n.secure && (r += "; secure"),
- (document.cookie = r);
- }
- function bt() {
- let e;
- try {
- e = document.cookie;
- } catch (e) {
- return (
- typeof console !== "undefined" &&
- typeof console.error === "function" &&
- console.error(e.stack || e),
- {}
- );
- }
- return (function (e) {
- let t;
- const n = {};
- const r = e.split(/ *; */);
- if (r[0] == "") return n;
- for (let i = 0; i < r.length; ++i)
- (t = r[i].split("=")), (n[Et(t[0])] = Et(t[1]));
- return n;
- })(e);
- }
- function wt(e) {
- return bt()[e];
- }
- function kt(e) {
- try {
- return encodeURIComponent(e);
- } catch (t) {
- mt("error `encode(%o)` - %o", e, t);
- }
- }
- function Et(e) {
- try {
- return decodeURIComponent(e);
- } catch (t) {
- mt("error `decode(%o)` - %o", e, t);
- }
- }
- const It = l(function (e, t) {
- (function () {
- const n = { function: !0, object: !0 };
- const r = t && !t.nodeType && t;
- let i = (n[typeof window] && window) || this;
- const o = r && n.object && e && !e.nodeType && typeof u === "object" && u;
- function s(e, t) {
- e || (e = i.Object()), t || (t = i.Object());
- const r = e.Number || i.Number;
- const o = e.String || i.String;
- const a = e.Object || i.Object;
- const c = e.Date || i.Date;
- const u = e.SyntaxError || i.SyntaxError;
- const l = e.TypeError || i.TypeError;
- const d = e.Math || i.Math;
- const p = e.JSON || i.JSON;
- typeof p === "object" &&
- p &&
- ((t.stringify = p.stringify), (t.parse = p.parse));
- let h;
- const f = a.prototype;
- const g = f.toString;
- const m = f.hasOwnProperty;
- function y(e, t) {
- try {
- e();
- } catch (e) {
- t && t();
- }
- }
- let v = new c(-0xc782b5b800cec);
- function b(e) {
- if (b[e] != null) return b[e];
- let n;
- if (e == "bug-string-char-index") n = "a"[0] != "a";
- else if (e == "json")
- n =
- b("json-stringify") && b("date-serialization") && b("json-parse");
- else if (e == "date-serialization") {
- if ((n = b("json-stringify") && v)) {
- var i = t.stringify;
- y(function () {
- n =
- i(new c(-864e13)) == '"-271821-04-20T00:00:00.000Z"' &&
- i(new c(864e13)) == '"+275760-09-13T00:00:00.000Z"' &&
- i(new c(-621987552e5)) == '"-000001-01-01T00:00:00.000Z"' &&
- i(new c(-1)) == '"1969-12-31T23:59:59.999Z"';
- });
- }
- } else {
- let s;
- const a = '{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}';
- if (e == "json-stringify") {
- let u = typeof (i = t.stringify) === "function";
- u &&
- (((s = function () {
- return 1;
- }).toJSON = s),
- y(
- function () {
- u =
- i(0) === "0" &&
- i(new r()) === "0" &&
- i(new o()) == '""' &&
- i(g) === h &&
- i(h) === h &&
- i() === h &&
- i(s) === "1" &&
- i([s]) == "[1]" &&
- i([h]) == "[null]" &&
- i(null) == "null" &&
- i([h, g, null]) == "[null,null,null]" &&
- i({ a: [s, !0, !1, null, "\0\b\n\f\r\t"] }) == a &&
- i(null, s) === "1" &&
- i([1, 2], null, 1) == "[\n 1,\n 2\n]";
- },
- function () {
- u = !1;
- }
- )),
- (n = u);
- }
- if (e == "json-parse") {
- let l;
- const d = t.parse;
- typeof d === "function" &&
- y(
- function () {
- d("0") !== 0 ||
- d(!1) ||
- ((s = d(a)),
- (l = s.a.length == 5 && s.a[0] === 1) &&
- (y(function () {
- l = !d('"\t"');
- }),
- l &&
- y(function () {
- l = d("01") !== 1;
- }),
- l &&
- y(function () {
- l = d("1.") !== 1;
- })));
- },
- function () {
- l = !1;
- }
- ),
- (n = l);
- }
- }
- return (b[e] = !!n);
- }
- if (
- (y(function () {
- v =
- v.getUTCFullYear() == -109252 &&
- v.getUTCMonth() === 0 &&
- v.getUTCDate() === 1 &&
- v.getUTCHours() == 10 &&
- v.getUTCMinutes() == 37 &&
- v.getUTCSeconds() == 6 &&
- v.getUTCMilliseconds() == 708;
- }),
- (b["bug-string-char-index"] = b["date-serialization"] = b.json = b[
- "json-stringify"
- ] = b["json-parse"] = null),
- !b("json"))
- ) {
- const w = b("bug-string-char-index");
- var k = function (e, t) {
- let r;
- let i;
- let o;
- let s = 0;
- for (o in (((r = function () {
- this.valueOf = 0;
- }).prototype.valueOf = 0),
- (i = new r())))
- m.call(i, o) && s++;
- return (
- (r = i = null),
- s
- ? (k = function (e, t) {
- let n;
- let r;
- const i = g.call(e) == "[object Function]";
- for (n in e)
- (i && n == "prototype") ||
- !m.call(e, n) ||
- (r = n === "constructor") ||
- t(n);
- (r || m.call(e, (n = "constructor"))) && t(n);
- })
- : ((i = [
- "valueOf",
- "toString",
- "toLocaleString",
- "propertyIsEnumerable",
- "isPrototypeOf",
- "hasOwnProperty",
- "constructor",
- ]),
- (k = function (e, t) {
- let r;
- let o;
- const s = g.call(e) == "[object Function]";
- const a =
- (!s &&
- typeof e.constructor !== "function" &&
- n[typeof e.hasOwnProperty] &&
- e.hasOwnProperty) ||
- m;
- for (r in e)
- (s && r == "prototype") || !a.call(e, r) || t(r);
- for (o = i.length; (r = i[--o]); ) a.call(e, r) && t(r);
- })),
- k(e, t)
- );
- };
- if (!b("json-stringify") && !b("date-serialization")) {
- const E = {
- 92: "\\\\",
- 34: '\\"',
- 8: "\\b",
- 12: "\\f",
- 10: "\\n",
- 13: "\\r",
- 9: "\\t",
- };
- const I = function (e, t) {
- return `000000${t || 0}`.slice(-e);
- };
- var _ = function (e) {
- let t;
- let n;
- let r;
- let i;
- let o;
- let s;
- let a;
- let c;
- let u;
- if (v)
- t = function (e) {
- (n = e.getUTCFullYear()),
- (r = e.getUTCMonth()),
- (i = e.getUTCDate()),
- (s = e.getUTCHours()),
- (a = e.getUTCMinutes()),
- (c = e.getUTCSeconds()),
- (u = e.getUTCMilliseconds());
- };
- else {
- const l = d.floor;
- const p = [
- 0,
- 31,
- 59,
- 90,
- 120,
- 151,
- 181,
- 212,
- 243,
- 273,
- 304,
- 334,
- ];
- const h = function (e, t) {
- return (
- p[t] +
- 365 * (e - 1970) +
- l((e - 1969 + (t = +(t > 1))) / 4) -
- l((e - 1901 + t) / 100) +
- l((e - 1601 + t) / 400)
- );
- };
- t = function (e) {
- for (
- i = l(e / 864e5), n = l(i / 365.2425) + 1970 - 1;
- h(n + 1, 0) <= i;
- n++
- );
- for (r = l((i - h(n, 0)) / 30.42); h(n, r + 1) <= i; r++);
- (i = 1 + i - h(n, r)),
- (s = l((o = ((e % 864e5) + 864e5) % 864e5) / 36e5) % 24),
- (a = l(o / 6e4) % 60),
- (c = l(o / 1e3) % 60),
- (u = o % 1e3);
- };
- }
- return (_ = function (e) {
- return (
- e > -1 / 0 && e < 1 / 0
- ? (t(e),
- (e = `${
- n <= 0 || n >= 1e4
- ? (n < 0 ? "-" : "+") + I(6, n < 0 ? -n : n)
- : I(4, n)
- }-${I(2, r + 1)}-${I(2, i)}T${I(2, s)}:${I(2, a)}:${I(
- 2,
- c
- )}.${I(3, u)}Z`),
- (n = r = i = s = a = c = u = null))
- : (e = null),
- e
- );
- })(e);
- };
- if (b("json-stringify") && !b("date-serialization")) {
- function A(e) {
- return _(this);
- }
- const C = t.stringify;
- t.stringify = function (e, t, n) {
- const r = c.prototype.toJSON;
- c.prototype.toJSON = A;
- const i = C(e, t, n);
- return (c.prototype.toJSON = r), i;
- };
- } else {
- const T = function (e) {
- const t = e.charCodeAt(0);
- const n = E[t];
- return n || `\\u00${I(2, t.toString(16))}`;
- };
- const O = /[\x00-\x1f\x22\x5c]/g;
- const P = function (e) {
- return (
- (O.lastIndex = 0), `"${O.test(e) ? e.replace(O, T) : e}"`
- );
- };
- var S = function (e, t, n, r, i, o, s) {
- let a;
- let u;
- let d;
- let p;
- let f;
- let m;
- let v;
- let b;
- let w;
- if (
- (y(function () {
- a = t[e];
- }),
- typeof a === "object" &&
- a &&
- (a.getUTCFullYear &&
- g.call(a) == "[object Date]" &&
- a.toJSON === c.prototype.toJSON
- ? (a = _(a))
- : typeof a.toJSON === "function" && (a = a.toJSON(e))),
- n && (a = n.call(t, e, a)),
- a == h)
- )
- return a === h ? a : "null";
- switch (
- ((u = typeof a) == "object" && (d = g.call(a)), d || u)
- ) {
- case "boolean":
- case "[object Boolean]":
- return `${a}`;
- case "number":
- case "[object Number]":
- return a > -1 / 0 && a < 1 / 0 ? `${a}` : "null";
- case "string":
- case "[object String]":
- return P(`${a}`);
- }
- if (typeof a === "object") {
- for (v = s.length; v--; ) if (s[v] === a) throw l();
- if (
- (s.push(a),
- (p = []),
- (b = o),
- (o += i),
- d == "[object Array]")
- ) {
- for (m = 0, v = a.length; m < v; m++)
- (f = S(m, a, n, r, i, o, s)),
- p.push(f === h ? "null" : f);
- w = p.length
- ? i
- ? `[\n${o}${p.join(`,\n${o}`)}\n${b}]`
- : `[${p.join(",")}]`
- : "[]";
- } else
- k(r || a, function (e) {
- const t = S(e, a, n, r, i, o, s);
- t !== h && p.push(`${P(e)}:${i ? " " : ""}${t}`);
- }),
- (w = p.length
- ? i
- ? `{\n${o}${p.join(`,\n${o}`)}\n${b}}`
- : `{${p.join(",")}}`
- : "{}");
- return s.pop(), w;
- }
- };
- t.stringify = function (e, t, r) {
- let i;
- let o;
- let s;
- let a;
- if (n[typeof t] && t)
- if ((a = g.call(t)) == "[object Function]") o = t;
- else if (a == "[object Array]") {
- s = {};
- for (var c, u = 0, l = t.length; u < l; )
- (c = t[u++]),
- ((a = g.call(c)) != "[object String]" &&
- a != "[object Number]") ||
- (s[c] = 1);
- }
- if (r)
- if ((a = g.call(r)) == "[object Number]") {
- if ((r -= r % 1) > 0)
- for (r > 10 && (r = 10), i = ""; i.length < r; ) i += " ";
- } else
- a == "[object String]" &&
- (i = r.length <= 10 ? r : r.slice(0, 10));
- return S("", (((c = {})[""] = e), c), o, s, i, "", []);
- };
- }
- }
- if (!b("json-parse")) {
- let x;
- let R;
- const j = o.fromCharCode;
- const L = {
- 92: "\\",
- 34: '"',
- 47: "/",
- 98: "\b",
- 116: "\t",
- 110: "\n",
- 102: "\f",
- 114: "\r",
- };
- const D = function () {
- throw ((x = R = null), u());
- };
- const M = function () {
- for (var e, t, n, r, i, o = R, s = o.length; x < s; )
- switch ((i = o.charCodeAt(x))) {
- case 9:
- case 10:
- case 13:
- case 32:
- x++;
- break;
- case 123:
- case 125:
- case 91:
- case 93:
- case 58:
- case 44:
- return (e = w ? o.charAt(x) : o[x]), x++, e;
- case 34:
- for (e = "@", x++; x < s; )
- if ((i = o.charCodeAt(x)) < 32) D();
- else if (i == 92)
- switch ((i = o.charCodeAt(++x))) {
- case 92:
- case 34:
- case 47:
- case 98:
- case 116:
- case 110:
- case 102:
- case 114:
- (e += L[i]), x++;
- break;
- case 117:
- for (t = ++x, n = x + 4; x < n; x++)
- ((i = o.charCodeAt(x)) >= 48 && i <= 57) ||
- (i >= 97 && i <= 102) ||
- (i >= 65 && i <= 70) ||
- D();
- e += j(`0x${o.slice(t, x)}`);
- break;
- default:
- D();
- }
- else {
- if (i == 34) break;
- for (
- i = o.charCodeAt(x), t = x;
- i >= 32 && i != 92 && i != 34;
-
- )
- i = o.charCodeAt(++x);
- e += o.slice(t, x);
- }
- if (o.charCodeAt(x) == 34) return x++, e;
- D();
- default:
- if (
- ((t = x),
- i == 45 && ((r = !0), (i = o.charCodeAt(++x))),
- i >= 48 && i <= 57)
- ) {
- for (
- i == 48 &&
- (i = o.charCodeAt(x + 1)) >= 48 &&
- i <= 57 &&
- D(),
- r = !1;
- x < s && (i = o.charCodeAt(x)) >= 48 && i <= 57;
- x++
- );
- if (o.charCodeAt(x) == 46) {
- for (
- n = ++x;
- n < s && !((i = o.charCodeAt(n)) < 48 || i > 57);
- n++
- );
- n == x && D(), (x = n);
- }
- if ((i = o.charCodeAt(x)) == 101 || i == 69) {
- for (
- ((i = o.charCodeAt(++x)) != 43 && i != 45) || x++,
- n = x;
- n < s && !((i = o.charCodeAt(n)) < 48 || i > 57);
- n++
- );
- n == x && D(), (x = n);
- }
- return +o.slice(t, x);
- }
- r && D();
- var a = o.slice(x, x + 4);
- if (a == "true") return (x += 4), !0;
- if (a == "fals" && o.charCodeAt(x + 4) == 101)
- return (x += 5), !1;
- if (a == "null") return (x += 4), null;
- D();
- }
- return "$";
- };
- var U = function (e) {
- let t;
- let n;
- if ((e == "$" && D(), typeof e === "string")) {
- if ((w ? e.charAt(0) : e[0]) == "@") return e.slice(1);
- if (e == "[") {
- for (t = []; (e = M()) != "]"; )
- n ? (e == "," ? (e = M()) == "]" && D() : D()) : (n = !0),
- e == "," && D(),
- t.push(U(e));
- return t;
- }
- if (e == "{") {
- for (t = {}; (e = M()) != "}"; )
- n ? (e == "," ? (e = M()) == "}" && D() : D()) : (n = !0),
- (e != "," &&
- typeof e === "string" &&
- (w ? e.charAt(0) : e[0]) == "@" &&
- M() == ":") ||
- D(),
- (t[e.slice(1)] = U(M()));
- return t;
- }
- D();
- }
- return e;
- };
- const N = function (e, t, n) {
- const r = q(e, t, n);
- r === h ? delete e[t] : (e[t] = r);
- };
- var q = function (e, t, n) {
- let r;
- const i = e[t];
- if (typeof i === "object" && i)
- if (g.call(i) == "[object Array]")
- for (r = i.length; r--; ) N(g, k, i);
- else
- k(i, function (e) {
- N(i, e, n);
- });
- return n.call(e, t, i);
- };
- t.parse = function (e, t) {
- let n;
- let r;
- return (
- (x = 0),
- (R = `${e}`),
- (n = U(M())),
- M() != "$" && D(),
- (x = R = null),
- t && g.call(t) == "[object Function]"
- ? q((((r = {})[""] = n), r), "", t)
- : n
- );
- };
- }
- }
- return (t.runInContext = s), t;
- }
- if (
- (!o || (o.global !== o && o.window !== o && o.self !== o) || (i = o), r)
- )
- s(i, r);
- else {
- let a = i.JSON;
- let c = i.JSON3;
- let l = !1;
- var d = s(
- i,
- (i.JSON3 = {
- noConflict() {
- return (
- l || ((l = !0), (i.JSON = a), (i.JSON3 = c), (a = c = null)), d
- );
- },
- })
- );
- i.JSON = { parse: d.parse, stringify: d.stringify };
- }
- }.call(u));
- });
- const _t = l(function (e, t) {
- function n(e) {
- switch (e) {
- case "http:":
- return 80;
- case "https:":
- return 443;
- default:
- return location.port;
- }
- }
- (t.parse = function (e) {
- const t = document.createElement("a");
- return (
- (t.href = e),
- {
- href: t.href,
- host: t.host || location.host,
- port: t.port === "0" || t.port === "" ? n(t.protocol) : t.port,
- hash: t.hash,
- hostname: t.hostname || location.hostname,
- pathname: t.pathname.charAt(0) != "/" ? `/${t.pathname}` : t.pathname,
- protocol:
- t.protocol && t.protocol != ":" ? t.protocol : location.protocol,
- search: t.search,
- query: t.search.slice(1),
- }
- );
- }),
- (t.isAbsolute = function (e) {
- return e.indexOf("//") == 0 || !!~e.indexOf("://");
- }),
- (t.isRelative = function (e) {
- return !t.isAbsolute(e);
- }),
- (t.isCrossDomain = function (e) {
- e = t.parse(e);
- const n = t.parse(window.location.href);
- return (
- e.hostname !== n.hostname ||
- e.port !== n.port ||
- e.protocol !== n.protocol
- );
- });
- });
- const At = (_t.parse, _t.isAbsolute, _t.isRelative, _t.isCrossDomain, 1e3);
- const Ct = 60 * At;
- const Tt = 60 * Ct;
- const Ot = 24 * Tt;
- const Pt = 365.25 * Ot;
- const St = function (e, t) {
- return (
- (t = t || {}),
- typeof e === "string"
- ? (function (e) {
- if ((e = `${e}`).length > 1e4) return;
- const t = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(
- e
- );
- if (!t) return;
- const n = parseFloat(t[1]);
- switch ((t[2] || "ms").toLowerCase()) {
- case "years":
- case "year":
- case "yrs":
- case "yr":
- case "y":
- return n * Pt;
- case "days":
- case "day":
- case "d":
- return n * Ot;
- case "hours":
- case "hour":
- case "hrs":
- case "hr":
- case "h":
- return n * Tt;
- case "minutes":
- case "minute":
- case "mins":
- case "min":
- case "m":
- return n * Ct;
- case "seconds":
- case "second":
- case "secs":
- case "sec":
- case "s":
- return n * At;
- case "milliseconds":
- case "millisecond":
- case "msecs":
- case "msec":
- case "ms":
- return n;
- }
- })(e)
- : t.long
- ? (function (e) {
- return (
- xt(e, Ot, "day") ||
- xt(e, Tt, "hour") ||
- xt(e, Ct, "minute") ||
- xt(e, At, "second") ||
- `${e} ms`
- );
- })(e)
- : (function (e) {
- return e >= Ot
- ? `${Math.round(e / Ot)}d`
- : e >= Tt
- ? `${Math.round(e / Tt)}h`
- : e >= Ct
- ? `${Math.round(e / Ct)}m`
- : e >= At
- ? `${Math.round(e / At)}s`
- : `${e}ms`;
- })(e)
- );
- };
- function xt(e, t, n) {
- if (!(e < t))
- return e < 1.5 * t
- ? `${Math.floor(e / t)} ${n}`
- : `${Math.ceil(e / t)} ${n}s`;
- }
- const Rt = l(function (e, t) {
- ((t = e.exports = function (e) {
- function i() {}
- function o() {
- const e = o;
- const i = +new Date();
- const s = i - (n || i);
- (e.diff = s),
- (e.prev = n),
- (e.curr = i),
- (n = i),
- e.useColors == null && (e.useColors = t.useColors()),
- e.color == null &&
- e.useColors &&
- (e.color = t.colors[r++ % t.colors.length]);
- let a = Array.prototype.slice.call(arguments);
- (a[0] = t.coerce(a[0])),
- typeof a[0] !== "string" && (a = ["%o"].concat(a));
- let c = 0;
- (a[0] = a[0].replace(/%([a-z%])/g, function (n, r) {
- if (n === "%%") return n;
- c++;
- const i = t.formatters[r];
- if (typeof i === "function") {
- const o = a[c];
- (n = i.call(e, o)), a.splice(c, 1), c--;
- }
- return n;
- })),
- typeof t.formatArgs === "function" && (a = t.formatArgs.apply(e, a)),
- (o.log || t.log || console.log.bind(console)).apply(e, a);
- }
- (i.enabled = !1), (o.enabled = !0);
- const s = t.enabled(e) ? o : i;
- return (s.namespace = e), s;
- }).coerce = function (e) {
- return e instanceof Error ? e.stack || e.message : e;
- }),
- (t.disable = function () {
- t.enable("");
- }),
- (t.enable = function (e) {
- t.save(e);
- for (let n = (e || "").split(/[\s,]+/), r = n.length, i = 0; i < r; i++)
- n[i] &&
- ((e = n[i].replace(/\*/g, ".*?"))[0] === "-"
- ? t.skips.push(new RegExp(`^${e.substr(1)}$`))
- : t.names.push(new RegExp(`^${e}$`)));
- }),
- (t.enabled = function (e) {
- let n;
- let r;
- for (n = 0, r = t.skips.length; n < r; n++)
- if (t.skips[n].test(e)) return !1;
- for (n = 0, r = t.names.length; n < r; n++)
- if (t.names[n].test(e)) return !0;
- return !1;
- }),
- (t.humanize = St),
- (t.names = []),
- (t.skips = []),
- (t.formatters = {});
- let n;
- var r = 0;
- });
- const jt =
- (Rt.coerce,
- Rt.disable,
- Rt.enable,
- Rt.enabled,
- Rt.humanize,
- Rt.names,
- Rt.skips,
- Rt.formatters,
- l(function (e, t) {
- function n() {
- let e;
- try {
- e = t.storage.debug;
- } catch (e) {}
- return e;
- }
- ((t = e.exports = Rt).log = function () {
- return (
- typeof console === "object" &&
- console.log &&
- Function.prototype.apply.call(console.log, console, arguments)
- );
- }),
- (t.formatArgs = function () {
- let e = arguments;
- const n = this.useColors;
- if (
- ((e[0] = `${
- (n ? "%c" : "") +
- this.namespace +
- (n ? " %c" : " ") +
- e[0] +
- (n ? "%c " : " ")
- }+${t.humanize(this.diff)}`),
- !n)
- )
- return e;
- const r = `color: ${this.color}`;
- e = [e[0], r, "color: inherit"].concat(
- Array.prototype.slice.call(e, 1)
- );
- let i = 0;
- let o = 0;
- return (
- e[0].replace(/%[a-z%]/g, function (e) {
- e !== "%%" && (i++, e === "%c" && (o = i));
- }),
- e.splice(o, 0, r),
- e
- );
- }),
- (t.save = function (e) {
- try {
- e == null ? t.storage.removeItem("debug") : (t.storage.debug = e);
- } catch (e) {}
- }),
- (t.load = n),
- (t.useColors = function () {
- return (
- "WebkitAppearance" in document.documentElement.style ||
- (window.console &&
- (console.firebug || (console.exception && console.table))) ||
- (navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) &&
- parseInt(RegExp.$1, 10) >= 31)
- );
- }),
- (t.storage =
- typeof chrome !== "undefined" && void 0 !== chrome.storage
- ? chrome.storage.local
- : (function () {
- try {
- return window.localStorage;
- } catch (e) {}
- })()),
- (t.colors = [
- "lightseagreen",
- "forestgreen",
- "goldenrod",
- "dodgerblue",
- "darkorchid",
- "crimson",
- ]),
- (t.formatters.j = function (e) {
- return JSON.stringify(e);
- }),
- t.enable(n());
- }));
- const Lt =
- (jt.log,
- jt.formatArgs,
- jt.save,
- jt.load,
- jt.useColors,
- jt.storage,
- jt.colors,
- jt("cookie"));
- const Dt = function (e, t, n) {
- switch (arguments.length) {
- case 3:
- case 2:
- return Mt(e, t, n);
- case 1:
- return Nt(e);
- default:
- return Ut();
- }
- };
- function Mt(e, t, n) {
- n = n || {};
- let r = `${qt(e)}=${qt(t)}`;
- t == null && (n.maxage = -1),
- n.maxage && (n.expires = new Date(+new Date() + n.maxage)),
- n.path && (r += `; path=${n.path}`),
- n.domain && (r += `; domain=${n.domain}`),
- n.expires && (r += `; expires=${n.expires.toUTCString()}`),
- n.secure && (r += "; secure"),
- (document.cookie = r);
- }
- function Ut() {
- let e;
- try {
- e = document.cookie;
- } catch (e) {
- return (
- typeof console !== "undefined" &&
- typeof console.error === "function" &&
- console.error(e.stack || e),
- {}
- );
- }
- return (function (e) {
- let t;
- const n = {};
- const r = e.split(/ *; */);
- if (r[0] == "") return n;
- for (let i = 0; i < r.length; ++i)
- (t = r[i].split("=")), (n[Bt(t[0])] = Bt(t[1]));
- return n;
- })(e);
- }
- function Nt(e) {
- return Ut()[e];
- }
- function qt(e) {
- try {
- return encodeURIComponent(e);
- } catch (t) {
- Lt("error `encode(%o)` - %o", e, t);
- }
- }
- function Bt(e) {
- try {
- return decodeURIComponent(e);
- } catch (t) {
- Lt("error `decode(%o)` - %o", e, t);
- }
- }
- for (
- var Ft = l(function (e, t) {
- const n = _t.parse;
- function r(e) {
- for (let n = t.cookie, r = t.levels(e), i = 0; i < r.length; ++i) {
- const o = r[i];
- const s = { domain: `.${o}` };
- if ((n("__tld__", 1, s), n("__tld__")))
- return n("__tld__", null, s), o;
- }
- return "";
- }
- (r.levels = function (e) {
- const t = n(e).hostname.split(".");
- const r = t[t.length - 1];
- const i = [];
- if (t.length === 4 && r === parseInt(r, 10)) return i;
- if (t.length <= 1) return i;
- for (let o = t.length - 2; o >= 0; --o) i.push(t.slice(o).join("."));
- return i;
- }),
- (r.cookie = Dt),
- (t = e.exports = r);
- }),
- Gt = new ((function () {
- function e(t) {
- n(this, e), (this._options = {}), this.options(t);
- }
- return (
- i(e, [
- {
- key: "options",
- value() {
- const e =
- arguments.length > 0 && void 0 !== arguments[0]
- ? arguments[0]
- : {};
- if (arguments.length === 0) return this._options;
- let t = `.${Ft(window.location.href)}`;
- t === "." && (t = null),
- (this._options = ve(e, {
- maxage: 31536e6,
- path: "/",
- domain: t,
- samesite: "Lax",
- })),
- this.set("test_rudder", !0),
- this.get("test_rudder") || (this._options.domain = null),
- this.remove("test_rudder");
- },
- },
- {
- key: "set",
- value(e, t) {
- try {
- return (t = It.stringify(t)), yt(e, t, st(this._options)), !0;
- } catch (e) {
- return !1;
- }
- },
- },
- {
- key: "get",
- value(e) {
- let t;
- try {
- return (t = (t = yt(e)) ? It.parse(t) : null);
- } catch (e) {
- return t || null;
- }
- },
- },
- {
- key: "remove",
- value(e) {
- try {
- return yt(e, null, st(this._options)), !0;
- } catch (e) {
- return !1;
- }
- },
- },
- ]),
- e
- );
- })())({}),
- Kt = (function () {
- let e;
- const t = {};
- const n = typeof window !== "undefined" ? window : u;
- const r = n.document;
- const i = "localStorage";
- if (
- ((t.disabled = !1),
- (t.version = "1.3.20"),
- (t.set = function (e, t) {}),
- (t.get = function (e, t) {}),
- (t.has = function (e) {
- return void 0 !== t.get(e);
- }),
- (t.remove = function (e) {}),
- (t.clear = function () {}),
- (t.transact = function (e, n, r) {
- r == null && ((r = n), (n = null)), n == null && (n = {});
- const i = t.get(e, n);
- r(i), t.set(e, i);
- }),
- (t.getAll = function () {
- const e = {};
- return (
- t.forEach(function (t, n) {
- e[t] = n;
- }),
- e
- );
- }),
- (t.forEach = function () {}),
- (t.serialize = function (e) {
- return It.stringify(e);
- }),
- (t.deserialize = function (e) {
- if (typeof e === "string")
- try {
- return It.parse(e);
- } catch (t) {
- return e || void 0;
- }
- }),
- (function () {
- try {
- return (i in n) && n[i];
- } catch (e) {
- return !1;
- }
- })())
- )
- (e = n[i]),
- (t.set = function (n, r) {
- return void 0 === r
- ? t.remove(n)
- : (e.setItem(n, t.serialize(r)), r);
- }),
- (t.get = function (n, r) {
- const i = t.deserialize(e.getItem(n));
- return void 0 === i ? r : i;
- }),
- (t.remove = function (t) {
- e.removeItem(t);
- }),
- (t.clear = function () {
- e.clear();
- }),
- (t.forEach = function (n) {
- for (let r = 0; r < e.length; r++) {
- const i = e.key(r);
- n(i, t.get(i));
- }
- });
- else if (r && r.documentElement.addBehavior) {
- let o;
- let s;
- try {
- (s = new ActiveXObject("htmlfile")).open(),
- s.write(
- ''
- ),
- s.close(),
- (o = s.w.frames[0].document),
- (e = o.createElement("div"));
- } catch (t) {
- (e = r.createElement("div")), (o = r.body);
- }
- const a = function (n) {
- return function () {
- const r = Array.prototype.slice.call(arguments, 0);
- r.unshift(e),
- o.appendChild(e),
- e.addBehavior("#default#userData"),
- e.load(i);
- const s = n.apply(t, r);
- return o.removeChild(e), s;
- };
- };
- const c = new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]", "g");
- const l = function (e) {
- return e.replace(/^d/, "___$&").replace(c, "___");
- };
- (t.set = a(function (e, n, r) {
- return (
- (n = l(n)),
- void 0 === r
- ? t.remove(n)
- : (e.setAttribute(n, t.serialize(r)), e.save(i), r)
- );
- })),
- (t.get = a(function (e, n, r) {
- n = l(n);
- const i = t.deserialize(e.getAttribute(n));
- return void 0 === i ? r : i;
- })),
- (t.remove = a(function (e, t) {
- (t = l(t)), e.removeAttribute(t), e.save(i);
- })),
- (t.clear = a(function (e) {
- const t = e.XMLDocument.documentElement.attributes;
- e.load(i);
- for (let n = t.length - 1; n >= 0; n--)
- e.removeAttribute(t[n].name);
- e.save(i);
- })),
- (t.forEach = a(function (e, n) {
- for (
- var r, i = e.XMLDocument.documentElement.attributes, o = 0;
- (r = i[o]);
- ++o
- )
- n(r.name, t.deserialize(e.getAttribute(r.name)));
- }));
- }
- try {
- const d = "__storejs__";
- t.set(d, d), t.get(d) != d && (t.disabled = !0), t.remove(d);
- } catch (e) {
- t.disabled = !0;
- }
- return (t.enabled = !t.disabled), t;
- })(),
- Vt = new ((function () {
- function e(t) {
- n(this, e),
- (this._options = {}),
- (this.enabled = !1),
- this.options(t);
- }
- return (
- i(e, [
- {
- key: "options",
- value() {
- const e =
- arguments.length > 0 && void 0 !== arguments[0]
- ? arguments[0]
- : {};
- if (arguments.length === 0) return this._options;
- ve(e, { enabled: !0 }),
- (this.enabled = e.enabled && Kt.enabled),
- (this._options = e);
- },
- },
- {
- key: "set",
- value(e, t) {
- return !!this.enabled && Kt.set(e, t);
- },
- },
- {
- key: "get",
- value(e) {
- return this.enabled ? Kt.get(e) : null;
- },
- },
- {
- key: "remove",
- value(e) {
- return !!this.enabled && Kt.remove(e);
- },
- },
- ]),
- e
- );
- })())({}),
- Ht = "rl_user_id",
- zt = "rl_trait",
- Jt = "rl_anonymous_id",
- Wt = "rl_group_id",
- $t = "rl_group_trait",
- Yt = new ((function () {
- function e() {
- if (
- (n(this, e), Gt.set("rudder_cookies", !0), Gt.get("rudder_cookies"))
- )
- return Gt.remove("rudder_cookies"), void (this.storage = Gt);
- Vt.enabled && (this.storage = Vt);
- }
- return (
- i(e, [
- {
- key: "setItem",
- value(e, t) {
- this.storage.set(e, t);
- },
- },
- {
- key: "setUserId",
- value(e) {
- typeof e === "string"
- ? this.storage.set(Ht, e)
- : g.error("[Storage] setUserId:: userId should be string");
- },
- },
- {
- key: "setUserTraits",
- value(e) {
- this.storage.set(zt, e);
- },
- },
- {
- key: "setGroupId",
- value(e) {
- typeof e === "string"
- ? this.storage.set(Wt, e)
- : g.error("[Storage] setGroupId:: groupId should be string");
- },
- },
- {
- key: "setGroupTraits",
- value(e) {
- this.storage.set($t, e);
- },
- },
- {
- key: "setAnonymousId",
- value(e) {
- typeof e === "string"
- ? this.storage.set(Jt, e)
- : g.error(
- "[Storage] setAnonymousId:: anonymousId should be string"
- );
- },
- },
- {
- key: "getItem",
- value(e) {
- return this.storage.get(e);
- },
- },
- {
- key: "getUserId",
- value() {
- return this.storage.get(Ht);
- },
- },
- {
- key: "getUserTraits",
- value() {
- return this.storage.get(zt);
- },
- },
- {
- key: "getGroupId",
- value() {
- return this.storage.get(Wt);
- },
- },
- {
- key: "getGroupTraits",
- value() {
- return this.storage.get($t);
- },
- },
- {
- key: "getAnonymousId",
- value() {
- return this.storage.get(Jt);
- },
- },
- {
- key: "removeItem",
- value(e) {
- return this.storage.remove(e);
- },
- },
- {
- key: "clear",
- value() {
- this.storage.remove(Ht), this.storage.remove(zt);
- },
- },
- ]),
- e
- );
- })())(),
- Qt = "lt_synch_timestamp",
- Zt = new ((function () {
- function e() {
- n(this, e), (this.storage = Yt);
- }
- return (
- i(e, [
- {
- key: "setLotameSynchTime",
- value(e) {
- this.storage.setItem(Qt, e);
- },
- },
- {
- key: "getLotameSynchTime",
- value() {
- return this.storage.getItem(Qt);
- },
- },
- ]),
- e
- );
- })())(),
- Xt = {
- HS: U,
- GA: we,
- HOTJAR: ke,
- GOOGLEADS: Ee,
- VWO: Ie,
- GTM: _e,
- BRAZE: Ae,
- INTERCOM: Re,
- KEEN: je,
- KISSMETRICS: Ue,
- CUSTOMERIO: Ne,
- CHARTBEAT: Ke,
- COMSCORE: Ve,
- FACEBOOK_PIXEL: it,
- LOTAME: (function () {
- function e(t, r) {
- const i = this;
- n(this, e),
- (this.name = "LOTAME"),
- (this.analytics = r),
- (this.storage = Zt),
- (this.bcpUrlSettingsPixel = t.bcpUrlSettingsPixel),
- (this.bcpUrlSettingsIframe = t.bcpUrlSettingsIframe),
- (this.dspUrlSettingsPixel = t.dspUrlSettingsPixel),
- (this.dspUrlSettingsIframe = t.dspUrlSettingsIframe),
- (this.mappings = {}),
- t.mappings.forEach(function (e) {
- const t = e.key;
- const n = e.value;
- i.mappings[t] = n;
- });
- }
- return (
- i(e, [
- {
- key: "init",
- value() {
- g.debug("===in init Lotame==="),
- (window.LOTAME_SYNCH_CALLBACK = function () {});
- },
- },
- {
- key: "addPixel",
- value(e, t, n) {
- g.debug(`Adding pixel for :: ${e}`);
- const r = document.createElement("img");
- (r.src = e),
- r.setAttribute("width", t),
- r.setAttribute("height", n),
- g.debug(`Image Pixel :: ${r}`),
- document.getElementsByTagName("body")[0].appendChild(r);
- },
- },
- {
- key: "addIFrame",
- value(e) {
- g.debug(`Adding iframe for :: ${e}`);
- const t = document.createElement("iframe");
- (t.src = e),
- (t.title = "empty"),
- t.setAttribute("id", "LOTCCFrame"),
- t.setAttribute("tabindex", "-1"),
- t.setAttribute("role", "presentation"),
- t.setAttribute("aria-hidden", "true"),
- t.setAttribute(
- "style",
- "border: 0px; width: 0px; height: 0px; display: block;"
- ),
- g.debug(`IFrame :: ${t}`),
- document.getElementsByTagName("body")[0].appendChild(t);
- },
- },
- {
- key: "syncPixel",
- value(e) {
- const t = this;
- if (
- (g.debug("===== in syncPixel ======"),
- g.debug("Firing DSP Pixel URLs"),
- this.dspUrlSettingsPixel &&
- this.dspUrlSettingsPixel.length > 0)
- ) {
- const n = Date.now();
- this.dspUrlSettingsPixel.forEach(function (r) {
- const i = t.compileUrl(
- a({}, t.mappings, { userId: e, random: n }),
- r.dspUrlTemplate
- );
- t.addPixel(i, "1", "1");
- });
- }
- if (
- (g.debug("Firing DSP IFrame URLs"),
- this.dspUrlSettingsIframe &&
- this.dspUrlSettingsIframe.length > 0)
- ) {
- const r = Date.now();
- this.dspUrlSettingsIframe.forEach(function (n) {
- const i = t.compileUrl(
- a({}, t.mappings, { userId: e, random: r }),
- n.dspUrlTemplate
- );
- t.addIFrame(i);
- });
- }
- this.storage.setLotameSynchTime(Date.now()),
- this.analytics.methodToCallbackMapping.syncPixel &&
- this.analytics.emit("syncPixel", {
- destination: this.name,
- });
- },
- },
- {
- key: "compileUrl",
- value(e, t) {
- return (
- Object.keys(e).forEach(function (n) {
- if (e.hasOwnProperty(n)) {
- const r = new RegExp(`{{${n}}}`, "gi");
- t = t.replace(r, e[n]);
- }
- }),
- t
- );
- },
- },
- {
- key: "identify",
- value(e) {
- g.debug("in Lotame identify");
- const t = e.message.userId;
- this.syncPixel(t);
- },
- },
- {
- key: "track",
- value(e) {
- g.debug("track not supported for lotame");
- },
- },
- {
- key: "page",
- value(e) {
- const t = this;
- if (
- (g.debug("in Lotame page"),
- g.debug("Firing BCP Pixel URLs"),
- this.bcpUrlSettingsPixel &&
- this.bcpUrlSettingsPixel.length > 0)
- ) {
- const n = Date.now();
- this.bcpUrlSettingsPixel.forEach(function (e) {
- const r = t.compileUrl(
- a({}, t.mappings, { random: n }),
- e.bcpUrlTemplate
- );
- t.addPixel(r, "1", "1");
- });
- }
- if (
- (g.debug("Firing BCP IFrame URLs"),
- this.bcpUrlSettingsIframe &&
- this.bcpUrlSettingsIframe.length > 0)
- ) {
- const r = Date.now();
- this.bcpUrlSettingsIframe.forEach(function (e) {
- const n = t.compileUrl(
- a({}, t.mappings, { random: r }),
- e.bcpUrlTemplate
- );
- t.addIFrame(n);
- });
- }
- e.message.userId &&
- this.isPixelToBeSynched() &&
- this.syncPixel(e.message.userId);
- },
- },
- {
- key: "isPixelToBeSynched",
- value() {
- const e = this.storage.getLotameSynchTime();
- const t = Date.now();
- return !e || Math.floor((t - e) / 864e5) >= 7;
- },
- },
- {
- key: "isLoaded",
- value() {
- return g.debug("in Lotame isLoaded"), !0;
- },
- },
- {
- key: "isReady",
- value() {
- return !0;
- },
- },
- ]),
- e
- );
- })(),
- },
- en = function e() {
- n(this, e),
- (this.build = "1.0.0"),
- (this.name = "RudderLabs JavaScript SDK"),
- (this.namespace = "com.rudderlabs.javascript"),
- (this.version = "1.1.2");
- },
- tn = function e() {
- n(this, e),
- (this.name = "RudderLabs JavaScript SDK"),
- (this.version = "1.1.2");
- },
- nn = function e() {
- n(this, e), (this.name = ""), (this.version = "");
- },
- rn = function e() {
- n(this, e), (this.density = 0), (this.width = 0), (this.height = 0);
- },
- on = function e() {
- n(this, e),
- (this.app = new en()),
- (this.traits = null),
- (this.library = new tn());
- const t = new nn();
- t.version = "";
- const r = new rn();
- (r.width = window.width),
- (r.height = window.height),
- (r.density = window.devicePixelRatio),
- (this.userAgent = navigator.userAgent),
- (this.locale = navigator.language || navigator.browserLanguage),
- (this.os = t),
- (this.screen = r),
- (this.device = null),
- (this.network = null);
- },
- sn = (function () {
- function e() {
- n(this, e),
- (this.channel = "web"),
- (this.context = new on()),
- (this.type = null),
- (this.action = null),
- (this.messageId = b().toString()),
- (this.originalTimestamp = new Date().toISOString()),
- (this.anonymousId = null),
- (this.userId = null),
- (this.event = null),
- (this.properties = {}),
- (this.integrations = {}),
- (this.integrations.All = !0);
- }
- return (
- i(e, [
- {
- key: "getProperty",
- value(e) {
- return this.properties[e];
- },
- },
- {
- key: "addProperty",
- value(e, t) {
- this.properties[e] = t;
- },
- },
- {
- key: "validateFor",
- value(e) {
- if (!this.properties)
- throw new Error("Key properties is required");
- switch (e) {
- case x.TRACK:
- if (!this.event)
- throw new Error("Key event is required for track event");
- if ((this.event in Object.values(R)))
- switch (this.event) {
- case R.CHECKOUT_STEP_VIEWED:
- case R.CHECKOUT_STEP_COMPLETED:
- case R.PAYMENT_INFO_ENTERED:
- this.checkForKey("checkout_id"),
- this.checkForKey("step");
- break;
- case R.PROMOTION_VIEWED:
- case R.PROMOTION_CLICKED:
- this.checkForKey("promotion_id");
- break;
- case R.ORDER_REFUNDED:
- this.checkForKey("order_id");
- }
- else
- this.properties.category ||
- (this.properties.category = this.event);
- break;
- case x.PAGE:
- break;
- case x.SCREEN:
- if (!this.properties.name)
- throw new Error("Key 'name' is required in properties");
- }
- },
- },
- {
- key: "checkForKey",
- value(e) {
- if (!this.properties[e])
- throw new Error(`Key '${e}' is required in properties`);
- },
- },
- ]),
- e
- );
- })(),
- an = (function () {
- function e() {
- n(this, e), (this.message = new sn());
- }
- return (
- i(e, [
- {
- key: "setType",
- value(e) {
- this.message.type = e;
- },
- },
- {
- key: "setProperty",
- value(e) {
- this.message.properties = e;
- },
- },
- {
- key: "setUserProperty",
- value(e) {
- this.message.user_properties = e;
- },
- },
- {
- key: "setUserId",
- value(e) {
- this.message.userId = e;
- },
- },
- {
- key: "setEventName",
- value(e) {
- this.message.event = e;
- },
- },
- {
- key: "updateTraits",
- value(e) {
- this.message.context.traits = e;
- },
- },
- {
- key: "getElementContent",
- value() {
- return this.message;
- },
- },
- ]),
- e
- );
- })(),
- cn = (function () {
- function e() {
- n(this, e),
- (this.rudderProperty = null),
- (this.rudderUserProperty = null),
- (this.event = null),
- (this.userId = null),
- (this.channel = null),
- (this.type = null);
- }
- return (
- i(e, [
- {
- key: "setProperty",
- value(e) {
- return (this.rudderProperty = e), this;
- },
- },
- {
- key: "setPropertyBuilder",
- value(e) {
- return (this.rudderProperty = e.build()), this;
- },
- },
- {
- key: "setUserProperty",
- value(e) {
- return (this.rudderUserProperty = e), this;
- },
- },
- {
- key: "setUserPropertyBuilder",
- value(e) {
- return (this.rudderUserProperty = e.build()), this;
- },
- },
- {
- key: "setEvent",
- value(e) {
- return (this.event = e), this;
- },
- },
- {
- key: "setUserId",
- value(e) {
- return (this.userId = e), this;
- },
- },
- {
- key: "setChannel",
- value(e) {
- return (this.channel = e), this;
- },
- },
- {
- key: "setType",
- value(e) {
- return (this.type = e), this;
- },
- },
- {
- key: "build",
- value() {
- const e = new an();
- return (
- e.setUserId(this.userId),
- e.setType(this.type),
- e.setEventName(this.event),
- e.setProperty(this.rudderProperty),
- e.setUserProperty(this.rudderUserProperty),
- e
- );
- },
- },
- ]),
- e
- );
- })(),
- un = function e() {
- n(this, e), (this.batch = null), (this.writeKey = null);
- },
- ln = l(function (e) {
- const t =
- (typeof crypto !== "undefined" &&
- crypto.getRandomValues &&
- crypto.getRandomValues.bind(crypto)) ||
- (typeof msCrypto !== "undefined" &&
- typeof window.msCrypto.getRandomValues === "function" &&
- msCrypto.getRandomValues.bind(msCrypto));
- if (t) {
- const n = new Uint8Array(16);
- e.exports = function () {
- return t(n), n;
- };
- } else {
- const r = new Array(16);
- e.exports = function () {
- for (var e, t = 0; t < 16; t++)
- (3 & t) == 0 && (e = 4294967296 * Math.random()),
- (r[t] = (e >>> ((3 & t) << 3)) & 255);
- return r;
- };
- }
- }),
- dn = [],
- pn = 0;
- pn < 256;
- ++pn
- )
- dn[pn] = (pn + 256).toString(16).substr(1);
- let hn;
- let fn;
- const gn = function (e, t) {
- let n = t || 0;
- const r = dn;
- return [
- r[e[n++]],
- r[e[n++]],
- r[e[n++]],
- r[e[n++]],
- "-",
- r[e[n++]],
- r[e[n++]],
- "-",
- r[e[n++]],
- r[e[n++]],
- "-",
- r[e[n++]],
- r[e[n++]],
- "-",
- r[e[n++]],
- r[e[n++]],
- r[e[n++]],
- r[e[n++]],
- r[e[n++]],
- r[e[n++]],
- ].join("");
- };
- let mn = 0;
- let yn = 0;
- const vn = function (e, t, n) {
- let r = (t && n) || 0;
- const i = t || [];
- let o = (e = e || {}).node || hn;
- let s = void 0 !== e.clockseq ? e.clockseq : fn;
- if (o == null || s == null) {
- const a = ln();
- o == null && (o = hn = [1 | a[0], a[1], a[2], a[3], a[4], a[5]]),
- s == null && (s = fn = 16383 & ((a[6] << 8) | a[7]));
- }
- let c = void 0 !== e.msecs ? e.msecs : new Date().getTime();
- let u = void 0 !== e.nsecs ? e.nsecs : yn + 1;
- const l = c - mn + (u - yn) / 1e4;
- if (
- (l < 0 && void 0 === e.clockseq && (s = (s + 1) & 16383),
- (l < 0 || c > mn) && void 0 === e.nsecs && (u = 0),
- u >= 1e4)
- )
- throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");
- (mn = c), (yn = u), (fn = s);
- const d = (1e4 * (268435455 & (c += 122192928e5)) + u) % 4294967296;
- (i[r++] = (d >>> 24) & 255),
- (i[r++] = (d >>> 16) & 255),
- (i[r++] = (d >>> 8) & 255),
- (i[r++] = 255 & d);
- const p = ((c / 4294967296) * 1e4) & 268435455;
- (i[r++] = (p >>> 8) & 255),
- (i[r++] = 255 & p),
- (i[r++] = ((p >>> 24) & 15) | 16),
- (i[r++] = (p >>> 16) & 255),
- (i[r++] = (s >>> 8) | 128),
- (i[r++] = 255 & s);
- for (let h = 0; h < 6; ++h) i[r + h] = o[h];
- return t || gn(i);
- };
- const bn = function (e, t, n) {
- const r = (t && n) || 0;
- typeof e === "string" &&
- ((t = e === "binary" ? new Array(16) : null), (e = null));
- const i = (e = e || {}).random || (e.rng || ln)();
- if (((i[6] = (15 & i[6]) | 64), (i[8] = (63 & i[8]) | 128), t))
- for (let o = 0; o < 16; ++o) t[r + o] = i[o];
- return t || gn(i);
- };
- const wn = bn;
- (wn.v1 = vn), (wn.v4 = bn);
- const kn = wn;
- const En = kn.v4;
- const In = {
- _data: {},
- length: 0,
- setItem(e, t) {
- return (this._data[e] = t), (this.length = Qe(this._data).length), t;
- },
- getItem(e) {
- return e in this._data ? this._data[e] : null;
- },
- removeItem(e) {
- return (
- e in this._data && delete this._data[e],
- (this.length = Qe(this._data).length),
- null
- );
- },
- clear() {
- (this._data = {}), (this.length = 0);
- },
- key(e) {
- return Qe(this._data)[e];
- },
- };
- const _n = {
- defaultEngine: (function () {
- try {
- if (!window.localStorage) return !1;
- const e = En();
- window.localStorage.setItem(e, "test_value");
- const t = window.localStorage.getItem(e);
- return window.localStorage.removeItem(e), t === "test_value";
- } catch (e) {
- return !1;
- }
- })()
- ? window.localStorage
- : In,
- inMemoryEngine: In,
- };
- const An = _n.defaultEngine;
- const Cn = _n.inMemoryEngine;
- function Tn(e, t, n, r) {
- (this.id = t),
- (this.name = e),
- (this.keys = n || {}),
- (this.engine = r || An);
- }
- (Tn.prototype.set = function (e, t) {
- const n = this._createValidKey(e);
- if (n)
- try {
- this.engine.setItem(n, It.stringify(t));
- } catch (n) {
- (function (e) {
- let t = !1;
- if (e.code)
- switch (e.code) {
- case 22:
- t = !0;
- break;
- case 1014:
- e.name === "NS_ERROR_DOM_QUOTA_REACHED" && (t = !0);
- }
- else e.number === -2147024882 && (t = !0);
- return t;
- })(n) && (this._swapEngine(), this.set(e, t));
- }
- }),
- (Tn.prototype.get = function (e) {
- try {
- const t = this.engine.getItem(this._createValidKey(e));
- return t === null ? null : It.parse(t);
- } catch (e) {
- return null;
- }
- }),
- (Tn.prototype.remove = function (e) {
- this.engine.removeItem(this._createValidKey(e));
- }),
- (Tn.prototype._createValidKey = function (e) {
- let t;
- const n = this.name;
- const r = this.id;
- return Qe(this.keys).length
- ? (rt(function (i) {
- i === e && (t = [n, r, e].join("."));
- }, this.keys),
- t)
- : [n, r, e].join(".");
- }),
- (Tn.prototype._swapEngine = function () {
- const e = this;
- rt(function (t) {
- const n = e.get(t);
- Cn.setItem([e.name, e.id, t].join("."), n), e.remove(t);
- }, this.keys),
- (this.engine = Cn);
- });
- const On = Tn;
- const Pn = {
- setTimeout(e, t) {
- return window.setTimeout(e, t);
- },
- clearTimeout(e) {
- return window.clearTimeout(e);
- },
- Date: window.Date,
- };
- let Sn = Pn;
- function xn() {
- (this.tasks = {}), (this.nextId = 1);
- }
- (xn.prototype.now = function () {
- return +new Sn.Date();
- }),
- (xn.prototype.run = function (e, t) {
- const n = this.nextId++;
- return (this.tasks[n] = Sn.setTimeout(this._handle(n, e), t)), n;
- }),
- (xn.prototype.cancel = function (e) {
- this.tasks[e] && (Sn.clearTimeout(this.tasks[e]), delete this.tasks[e]);
- }),
- (xn.prototype.cancelAll = function () {
- rt(Sn.clearTimeout, this.tasks), (this.tasks = {});
- }),
- (xn.prototype._handle = function (e, t) {
- const n = this;
- return function () {
- return delete n.tasks[e], t();
- };
- }),
- (xn.setClock = function (e) {
- Sn = e;
- }),
- (xn.resetClock = function () {
- Sn = Pn;
- });
- const Rn = xn;
- const jn = Ln;
- function Ln(e) {
- return Ln.enabled(e)
- ? function (t) {
- t = Dn(t);
- const n = new Date();
- const r = n - (Ln[e] || n);
- (Ln[e] = n),
- (t = `${e} ${t} +${Ln.humanize(r)}`),
- window.console &&
- console.log &&
- Function.prototype.apply.call(console.log, console, arguments);
- }
- : function () {};
- }
- function Dn(e) {
- return e instanceof Error ? e.stack || e.message : e;
- }
- (Ln.names = []),
- (Ln.skips = []),
- (Ln.enable = function (e) {
- try {
- localStorage.debug = e;
- } catch (e) {}
- for (let t = (e || "").split(/[\s,]+/), n = t.length, r = 0; r < n; r++)
- (e = t[r].replace("*", ".*?"))[0] === "-"
- ? Ln.skips.push(new RegExp(`^${e.substr(1)}$`))
- : Ln.names.push(new RegExp(`^${e}$`));
- }),
- (Ln.disable = function () {
- Ln.enable("");
- }),
- (Ln.humanize = function (e) {
- return e >= 36e5
- ? `${(e / 36e5).toFixed(1)}h`
- : e >= 6e4
- ? `${(e / 6e4).toFixed(1)}m`
- : e >= 1e3
- ? `${(e / 1e3) | 0}s`
- : `${e}ms`;
- }),
- (Ln.enabled = function (e) {
- for (var t = 0, n = Ln.skips.length; t < n; t++)
- if (Ln.skips[t].test(e)) return !1;
- for (t = 0, n = Ln.names.length; t < n; t++)
- if (Ln.names[t].test(e)) return !0;
- return !1;
- });
- try {
- window.localStorage && Ln.enable(localStorage.debug);
- } catch (e) {}
- const Mn = kn.v4;
- const Un = jn("localstorage-retry");
- function Nn(e, t) {
- return function () {
- return e.apply(t, arguments);
- };
- }
- function qn(e, t, n) {
- typeof t === "function" && (n = t),
- (this.name = e),
- (this.id = Mn()),
- (this.fn = n),
- (this.maxItems = t.maxItems || 1 / 0),
- (this.maxAttempts = t.maxAttempts || 1 / 0),
- (this.backoff = {
- MIN_RETRY_DELAY: t.minRetryDelay || 1e3,
- MAX_RETRY_DELAY: t.maxRetryDelay || 3e4,
- FACTOR: t.backoffFactor || 2,
- JITTER: t.backoffJitter || 0,
- }),
- (this.timeouts = {
- ACK_TIMER: 1e3,
- RECLAIM_TIMER: 3e3,
- RECLAIM_TIMEOUT: 1e4,
- RECLAIM_WAIT: 500,
- }),
- (this.keys = {
- IN_PROGRESS: "inProgress",
- QUEUE: "queue",
- ACK: "ack",
- RECLAIM_START: "reclaimStart",
- RECLAIM_END: "reclaimEnd",
- }),
- (this._schedule = new Rn()),
- (this._processId = 0),
- (this._store = new On(this.name, this.id, this.keys)),
- this._store.set(this.keys.IN_PROGRESS, {}),
- this._store.set(this.keys.QUEUE, []),
- (this._ack = Nn(this._ack, this)),
- (this._checkReclaim = Nn(this._checkReclaim, this)),
- (this._processHead = Nn(this._processHead, this)),
- (this._running = !1);
- }
- d(qn.prototype),
- (qn.prototype.start = function () {
- this._running && this.stop(),
- (this._running = !0),
- this._ack(),
- this._checkReclaim(),
- this._processHead();
- }),
- (qn.prototype.stop = function () {
- this._schedule.cancelAll(), (this._running = !1);
- }),
- (qn.prototype.shouldRetry = function (e, t) {
- return !(t > this.maxAttempts);
- }),
- (qn.prototype.getDelay = function (e) {
- let t = this.backoff.MIN_RETRY_DELAY * Math.pow(this.backoff.FACTOR, e);
- if (this.backoff.JITTER) {
- const n = Math.random();
- const r = Math.floor(n * this.backoff.JITTER * t);
- Math.floor(10 * n) < 5 ? (t -= r) : (t += r);
- }
- return Number(Math.min(t, this.backoff.MAX_RETRY_DELAY).toPrecision(1));
- }),
- (qn.prototype.addItem = function (e) {
- this._enqueue({ item: e, attemptNumber: 0, time: this._schedule.now() });
- }),
- (qn.prototype.requeue = function (e, t, n) {
- this.shouldRetry(e, t, n)
- ? this._enqueue({
- item: e,
- attemptNumber: t,
- time: this._schedule.now() + this.getDelay(t),
- })
- : this.emit("discard", e, t);
- }),
- (qn.prototype._enqueue = function (e) {
- let t = this._store.get(this.keys.QUEUE) || [];
- (t = t.slice(-(this.maxItems - 1))).push(e),
- (t = t.sort(function (e, t) {
- return e.time - t.time;
- })),
- this._store.set(this.keys.QUEUE, t),
- this._running && this._processHead();
- }),
- (qn.prototype._processHead = function () {
- const e = this;
- const t = this._store;
- this._schedule.cancel(this._processId);
- let n = t.get(this.keys.QUEUE) || [];
- const r = t.get(this.keys.IN_PROGRESS) || {};
- const i = this._schedule.now();
- const o = [];
- function s(n, r) {
- o.push({
- item: n.item,
- done(i, o) {
- const s = t.get(e.keys.IN_PROGRESS) || {};
- delete s[r],
- t.set(e.keys.IN_PROGRESS, s),
- e.emit("processed", i, o, n.item),
- i && e.requeue(n.item, n.attemptNumber + 1, i);
- },
- });
- }
- for (
- let a = Object.keys(r).length;
- n.length && n[0].time <= i && a++ < e.maxItems;
-
- ) {
- const c = n.shift();
- const u = Mn();
- (r[u] = {
- item: c.item,
- attemptNumber: c.attemptNumber,
- time: e._schedule.now(),
- }),
- s(c, u);
- }
- t.set(this.keys.QUEUE, n),
- t.set(this.keys.IN_PROGRESS, r),
- rt(function (t) {
- try {
- e.fn(t.item, t.done);
- } catch (e) {
- Un(`Process function threw error: ${e}`);
- }
- }, o),
- (n = t.get(this.keys.QUEUE) || []),
- this._schedule.cancel(this._processId),
- n.length > 0 &&
- (this._processId = this._schedule.run(
- this._processHead,
- n[0].time - i
- ));
- }),
- (qn.prototype._ack = function () {
- this._store.set(this.keys.ACK, this._schedule.now()),
- this._store.set(this.keys.RECLAIM_START, null),
- this._store.set(this.keys.RECLAIM_END, null),
- this._schedule.run(this._ack, this.timeouts.ACK_TIMER);
- }),
- (qn.prototype._checkReclaim = function () {
- const e = this;
- rt(
- function (t) {
- t.id !== e.id &&
- (e._schedule.now() - t.get(e.keys.ACK) <
- e.timeouts.RECLAIM_TIMEOUT ||
- (function (t) {
- t.set(e.keys.RECLAIM_START, e.id),
- t.set(e.keys.ACK, e._schedule.now()),
- e._schedule.run(function () {
- t.get(e.keys.RECLAIM_START) === e.id &&
- (t.set(e.keys.RECLAIM_END, e.id),
- e._schedule.run(function () {
- t.get(e.keys.RECLAIM_END) === e.id &&
- t.get(e.keys.RECLAIM_START) === e.id &&
- e._reclaim(t.id);
- }, e.timeouts.RECLAIM_WAIT));
- }, e.timeouts.RECLAIM_WAIT);
- })(t));
- },
- (function (t) {
- for (var n = [], r = e._store.engine, i = 0; i < r.length; i++) {
- const o = r.key(i).split(".");
- o.length === 3 &&
- o[0] === t &&
- o[2] === "ack" &&
- n.push(new On(t, o[1], e.keys));
- }
- return n;
- })(this.name)
- ),
- this._schedule.run(this._checkReclaim, this.timeouts.RECLAIM_TIMER);
- }),
- (qn.prototype._reclaim = function (e) {
- const t = this;
- const n = new On(this.name, e, this.keys);
- const r = { queue: this._store.get(this.keys.QUEUE) || [] };
- const i = {
- inProgress: n.get(this.keys.IN_PROGRESS) || {},
- queue: n.get(this.keys.QUEUE) || [],
- };
- rt(function (e) {
- r.queue.push({
- item: e.item,
- attemptNumber: e.attemptNumber,
- time: t._schedule.now(),
- });
- }, i.queue),
- rt(function (e) {
- r.queue.push({
- item: e.item,
- attemptNumber: e.attemptNumber + 1,
- time: t._schedule.now(),
- });
- }, i.inProgress),
- (r.queue = r.queue.sort(function (e, t) {
- return e.time - t.time;
- })),
- this._store.set(this.keys.QUEUE, r.queue),
- n.remove(this.keys.ACK),
- n.remove(this.keys.RECLAIM_START),
- n.remove(this.keys.RECLAIM_END),
- n.remove(this.keys.IN_PROGRESS),
- n.remove(this.keys.QUEUE),
- this._processHead();
- });
- const Bn = qn;
- const Fn = {
- maxRetryDelay: 36e4,
- minRetryDelay: 1e3,
- backoffFactor: 2,
- maxAttempts: 10,
- maxItems: 100,
- };
- var Gn = new ((function () {
- function e() {
- n(this, e),
- (this.eventsBuffer = []),
- (this.writeKey = ""),
- (this.url = j),
- (this.state = "READY"),
- (this.batchSize = 0),
- (this.payloadQueue = new Bn("rudder", Fn, function (e, t) {
- (e.message.sentAt = w()),
- Gn.processQueueElement(e.url, e.headers, e.message, 1e4, function (
- e,
- n
- ) {
- if (e) return t(e);
- t(null, n);
- });
- })),
- this.payloadQueue.start();
- }
- return (
- i(e, [
- {
- key: "preaparePayloadAndFlush",
- value(e) {
- if (
- (g.debug(
- `==== in preaparePayloadAndFlush with state: ${e.state}`
- ),
- g.debug(e.eventsBuffer),
- e.eventsBuffer.length != 0 && e.state !== "PROCESSING")
- ) {
- const t = e.eventsBuffer;
- const n = new un();
- (n.batch = t),
- (n.writeKey = e.writeKey),
- (n.sentAt = w()),
- n.batch.forEach(function (e) {
- e.sentAt = n.sentAt;
- }),
- (e.batchSize = e.eventsBuffer.length);
- const r = new XMLHttpRequest();
- g.debug("==== in flush sending to Rudder BE ===="),
- g.debug(JSON.stringify(n, v)),
- r.open("POST", e.url, !0),
- r.setRequestHeader("Content-Type", "application/json"),
- r.setRequestHeader(
- "Authorization",
- `Basic ${btoa(`${n.writeKey}:`)}`
- ),
- (r.onreadystatechange = function () {
- r.readyState === 4 && r.status === 200
- ? (g.debug(
- `====== request processed successfully: ${r.status}`
- ),
- (e.eventsBuffer = e.eventsBuffer.slice(e.batchSize)),
- g.debug(e.eventsBuffer.length))
- : r.readyState === 4 &&
- r.status !== 200 &&
- k(
- new Error(
- `request failed with status: ${r.status} for url: ${e.url}`
- )
- ),
- (e.state = "READY");
- }),
- r.send(JSON.stringify(n, v)),
- (e.state = "PROCESSING");
- }
- },
- },
- {
- key: "processQueueElement",
- value(e, t, n, r, i) {
- try {
- const o = new XMLHttpRequest();
- for (const s in (o.open("POST", e, !0), t))
- o.setRequestHeader(s, t[s]);
- (o.timeout = r),
- (o.ontimeout = i),
- (o.onerror = i),
- (o.onreadystatechange = function () {
- o.readyState === 4 &&
- (o.status === 429 || (o.status >= 500 && o.status < 600)
- ? (k(
- new Error(
- `request failed with status: ${o.status}${o.statusText} for url: ${e}`
- )
- ),
- i(
- new Error(
- `request failed with status: ${o.status}${o.statusText} for url: ${e}`
- )
- ))
- : (g.debug(
- `====== request processed successfully: ${o.status}`
- ),
- i(null, o.status)));
- }),
- o.send(JSON.stringify(n, v));
- } catch (e) {
- i(e);
- }
- },
- },
- {
- key: "enqueue",
- value(e, t) {
- const n = e.getElementContent();
- const r = {
- "Content-Type": "application/json",
- Authorization: `Basic ${btoa(`${this.writeKey}:`)}`,
- AnonymousId: btoa(n.anonymousId),
- };
- (n.originalTimestamp = w()),
- (n.sentAt = w()),
- JSON.stringify(n).length > 32e3 &&
- g.error(
- "[EventRepository] enqueue:: message length greater 32 Kb ",
- n
- );
- const i =
- this.url.slice(-1) == "/" ? this.url.slice(0, -1) : this.url;
- this.payloadQueue.addItem({
- url: `${i}/v1/${t}`,
- headers: r,
- message: n,
- });
- },
- },
- ]),
- e
- );
- })())();
- function Kn(e) {
- const t = function (t) {
- let n = (t = t || window.event).target || t.srcElement;
- Wn(n) && (n = n.parentNode),
- Hn(n, t)
- ? g.debug("to be tracked ", t.type)
- : g.debug("not to be tracked ", t.type),
- (function (e, t) {
- let n = e.target || e.srcElement;
- let r = void 0;
- Wn(n) && (n = n.parentNode);
- if (Hn(n, e)) {
- if (n.tagName.toLowerCase() == "form") {
- r = {};
- for (let i = 0; i < n.elements.length; i++) {
- const o = n.elements[i];
- if (Qn(o) && Yn(o, t.trackValues)) {
- const s = o.id ? o.id : o.name;
- if (s && typeof s === "string") {
- const a = o.id ? o.id : o.name;
- let c = o.id
- ? document.getElementById(o.id).value
- : document.getElementsByName(o.name)[0].value;
- (o.type !== "checkbox" && o.type !== "radio") ||
- (c = o.checked),
- a.trim() !== "" &&
- (r[encodeURIComponent(a)] = encodeURIComponent(c));
- }
- }
- }
- }
- for (var u = [n], l = n; l.parentNode && !zn(l, "body"); )
- u.push(l.parentNode), (l = l.parentNode);
- let d;
- const p = [];
- let h = !1;
- if (
- (u.forEach(function (e) {
- const n = (function (e) {
- return !(!e.parentNode || zn(e, "body"));
- })(e);
- e.tagName.toLowerCase() === "a" &&
- ((d = e.getAttribute("href")), (d = n && d)),
- (h = h || !Qn(e)),
- p.push(
- (function (e, t) {
- for (
- var n = {
- classes: $n(e).split(" "),
- tag_name: e.tagName.toLowerCase(),
- },
- r = e.attributes.length,
- i = 0;
- i < r;
- i++
- ) {
- const o = e.attributes[i].name;
- const s = e.attributes[i].value;
- s && (n[`attr__${o}`] = s),
- (o != "name" && o != "id") ||
- !Yn(e, t.trackValues) ||
- ((n.field_value =
- o == "id"
- ? document.getElementById(s).value
- : document.getElementsByName(s)[0].value),
- (e.type !== "checkbox" && e.type !== "radio") ||
- (n.field_value = e.checked));
- }
- let a = 1;
- let c = 1;
- let u = e;
- for (; (u = Zn(u)); ) a++, u.tagName === e.tagName && c++;
- return (n.nth_child = a), (n.nth_of_type = c), n;
- })(e, t)
- );
- }),
- h)
- )
- return !1;
- let f = "";
- const m = (function (e) {
- let t = "";
- return (
- e.childNodes.forEach(function (e) {
- e.nodeType === Node.TEXT_NODE && (t += e.nodeValue);
- }),
- t.trim()
- );
- })(n);
- m && m.length && (f = m);
- const y = {
- event_type: e.type,
- page: E(),
- elements: p,
- el_attr_href: d,
- el_text: f,
- };
- r && (y.form_values = r),
- g.debug("web_event", y),
- t.track("autotrack", y);
- }
- })(t, e);
- };
- Vn(document, "submit", t, !0),
- Vn(document, "change", t, !0),
- Vn(document, "click", t, !0),
- e.page();
- }
- function Vn(e, t, n, r) {
- e
- ? e.addEventListener(t, n, !!r)
- : g.error(
- "[Autotrack] register_event:: No valid element provided to register_event"
- );
- }
- function Hn(e, t) {
- if (!e || zn(e, "html") || !Jn(e)) return !1;
- switch (e.tagName.toLowerCase()) {
- case "html":
- return !1;
- case "form":
- return t.type === "submit";
- case "input":
- return ["button", "submit"].indexOf(e.getAttribute("type")) === -1
- ? t.type === "change"
- : t.type === "click";
- case "select":
- case "textarea":
- return t.type === "change";
- default:
- return t.type === "click";
- }
- }
- function zn(e, t) {
- return e && e.tagName && e.tagName.toLowerCase() === t.toLowerCase();
- }
- function Jn(e) {
- return e && e.nodeType === 1;
- }
- function Wn(e) {
- return e && e.nodeType === 3;
- }
- function $n(e) {
- switch (t(e.className)) {
- case "string":
- return e.className;
- case "object":
- return e.className.baseVal || e.getAttribute("class") || "";
- default:
- return "";
- }
- }
- function Yn(e, t) {
- for (let n = e.attributes.length, r = 0; r < n; r++) {
- const i = e.attributes[r].value;
- if (t.indexOf(i) > -1) return !0;
- }
- return !1;
- }
- function Qn(e) {
- return !($n(e).split(" ").indexOf("rudder-no-track") >= 0);
- }
- function Zn(e) {
- if (e.previousElementSibling) return e.previousElementSibling;
- do {
- e = e.previousSibling;
- } while (e && !Jn(e));
- return e;
- }
- function Xn(e, t) {
- this.eventRepository || (this.eventRepository = Gn),
- this.eventRepository.enqueue(e, t);
- }
- var er = new ((function () {
- function e() {
- n(this, e),
- (this.autoTrackHandlersRegistered = !1),
- (this.autoTrackFeatureEnabled = !1),
- (this.initialized = !1),
- (this.trackValues = []),
- (this.eventsBuffer = []),
- (this.clientIntegrations = []),
- (this.loadOnlyIntegrations = {}),
- (this.clientIntegrationObjects = void 0),
- (this.successfullyLoadedIntegration = []),
- (this.failedToBeLoadedIntegration = []),
- (this.toBeProcessedArray = []),
- (this.toBeProcessedByIntegrationArray = []),
- (this.storage = Yt),
- (this.userId =
- this.storage.getUserId() != null ? this.storage.getUserId() : ""),
- (this.userTraits =
- this.storage.getUserTraits() != null
- ? this.storage.getUserTraits()
- : {}),
- (this.groupId =
- this.storage.getGroupId() != null ? this.storage.getGroupId() : ""),
- (this.groupTraits =
- this.storage.getGroupTraits() != null
- ? this.storage.getGroupTraits()
- : {}),
- (this.anonymousId = this.getAnonymousId()),
- this.storage.setUserId(this.userId),
- (this.eventRepository = Gn),
- (this.sendAdblockPage = !1),
- (this.sendAdblockPageOptions = {}),
- (this.clientSuppliedCallbacks = {}),
- (this.readyCallback = function () {}),
- (this.executeReadyCallback = void 0),
- (this.methodToCallbackMapping = { syncPixel: "syncPixelCallback" });
- }
- return (
- i(e, [
- {
- key: "processResponse",
- value(e, t) {
- try {
- g.debug("===in process response=== ".concat(e)),
- (t = JSON.parse(t)).source.useAutoTracking &&
- !this.autoTrackHandlersRegistered &&
- ((this.autoTrackFeatureEnabled = !0),
- Kn(this),
- (this.autoTrackHandlersRegistered = !0)),
- t.source.destinations.forEach(function (e, t) {
- g.debug(
- "Destination "
- .concat(t, " Enabled? ")
- .concat(e.enabled, " Type: ")
- .concat(e.destinationDefinition.name, " Use Native SDK? ")
- .concat(e.config.useNativeSDK)
- ),
- e.enabled &&
- this.clientIntegrations.push({
- name: e.destinationDefinition.name,
- config: e.config,
- });
- }, this),
- console.log(
- "this.clientIntegrations: ",
- this.clientIntegrations
- ),
- (this.clientIntegrations = C(
- this.loadOnlyIntegrations,
- this.clientIntegrations
- )),
- (this.clientIntegrations = this.clientIntegrations.filter(
- function (e) {
- return Xt[e.name] != null;
- }
- )),
- this.init(this.clientIntegrations);
- } catch (e) {
- k(e),
- g.debug("===handling config BE response processing error==="),
- g.debug(
- "autoTrackHandlersRegistered",
- this.autoTrackHandlersRegistered
- ),
- this.autoTrackFeatureEnabled &&
- !this.autoTrackHandlersRegistered &&
- (Kn(this), (this.autoTrackHandlersRegistered = !0));
- }
- },
- },
- {
- key: "init",
- value(e) {
- const t = this;
- const n = this;
- if ((g.debug("supported intgs ", Xt), !e || e.length == 0))
- return (
- this.readyCallback && this.readyCallback(),
- void (this.toBeProcessedByIntegrationArray = [])
- );
- e.forEach(function (e) {
- try {
- g.debug(
- "[Analytics] init :: trying to initialize integration name:: ",
- e.name
- );
- const r = new (0, Xt[e.name])(e.config, n);
- r.init(),
- g.debug("initializing destination: ", e),
- t.isInitialized(r).then(t.replayEvents);
- } catch (t) {
- g.error(
- "[Analytics] initialize integration (integration.init()) failed :: ",
- e.name
- );
- }
- });
- },
- },
- {
- key: "replayEvents",
- value(e) {
- e.successfullyLoadedIntegration.length +
- e.failedToBeLoadedIntegration.length ==
- e.clientIntegrations.length &&
- e.toBeProcessedByIntegrationArray.length > 0 &&
- (g.debug(
- "===replay events called====",
- e.successfullyLoadedIntegration.length,
- e.failedToBeLoadedIntegration.length
- ),
- (e.clientIntegrationObjects = []),
- (e.clientIntegrationObjects = e.successfullyLoadedIntegration),
- g.debug(
- "==registering after callback===",
- e.clientIntegrationObjects.length
- ),
- (e.executeReadyCallback = p(
- e.clientIntegrationObjects.length,
- e.readyCallback
- )),
- g.debug("==registering ready callback==="),
- e.on("ready", e.executeReadyCallback),
- e.clientIntegrationObjects.forEach(function (t) {
- g.debug("===looping over each successful integration===="),
- (t.isReady && !t.isReady()) ||
- (g.debug("===letting know I am ready=====", t.name),
- e.emit("ready"));
- }),
- e.toBeProcessedByIntegrationArray.forEach(function (t) {
- const n = t[0];
- t.shift(),
- Object.keys(t[0].message.integrations).length > 0 &&
- A(t[0].message.integrations);
- for (
- let r = C(
- t[0].message.integrations,
- e.clientIntegrationObjects
- ),
- i = 0;
- i < r.length;
- i++
- )
- try {
- var o;
- if (!r[i].isFailed || !r[i].isFailed())
- if (r[i][n]) (o = r[i])[n].apply(o, c(t));
- } catch (e) {
- k(e);
- }
- }),
- (e.toBeProcessedByIntegrationArray = []));
- },
- },
- {
- key: "pause",
- value(e) {
- return new Promise(function (t) {
- setTimeout(t, e);
- });
- },
- },
- {
- key: "isInitialized",
- value(e) {
- const t = this;
- const n =
- arguments.length > 1 && void 0 !== arguments[1]
- ? arguments[1]
- : 0;
- return new Promise(function (r) {
- return e.isLoaded()
- ? (g.debug("===integration loaded successfully====", e.name),
- t.successfullyLoadedIntegration.push(e),
- r(t))
- : n >= 1e4
- ? (g.debug("====max wait over===="),
- t.failedToBeLoadedIntegration.push(e),
- r(t))
- : void t.pause(1e3).then(function () {
- return (
- g.debug("====after pause, again checking===="),
- t.isInitialized(e, n + 1e3).then(r)
- );
- });
- });
- },
- },
- {
- key: "page",
- value(e, n, r, i, o) {
- typeof i === "function" && ((o = i), (i = null)),
- typeof r === "function" && ((o = r), (i = r = null)),
- typeof n === "function" && ((o = n), (i = r = n = null)),
- t(e) === "object" && ((i = n), (r = e), (n = e = null)),
- t(n) === "object" && ((i = r), (r = n), (n = null)),
- typeof e === "string" &&
- typeof n !== "string" &&
- ((n = e), (e = null)),
- this.sendAdblockPage &&
- e != "RudderJS-Initiated" &&
- this.sendSampleRequest(),
- this.processPage(e, n, r, i, o);
- },
- },
- {
- key: "track",
- value(e, t, n, r) {
- typeof n === "function" && ((r = n), (n = null)),
- typeof t === "function" && ((r = t), (n = null), (t = null)),
- this.processTrack(e, t, n, r);
- },
- },
- {
- key: "identify",
- value(e, n, r, i) {
- typeof r === "function" && ((i = r), (r = null)),
- typeof n === "function" && ((i = n), (r = null), (n = null)),
- t(e) === "object" && ((r = n), (n = e), (e = this.userId)),
- this.processIdentify(e, n, r, i);
- },
- },
- {
- key: "alias",
- value(e, n, r, i) {
- typeof r === "function" && ((i = r), (r = null)),
- typeof n === "function" && ((i = n), (r = null), (n = null)),
- t(n) === "object" && ((r = n), (n = null));
- const o = new cn().setType("alias").build();
- (o.message.previousId =
- n || (this.userId ? this.userId : this.getAnonymousId())),
- (o.message.userId = e),
- this.processAndSendDataToDestinations("alias", o, r, i);
- },
- },
- {
- key: "group",
- value(e, n, r, i) {
- if (arguments.length) {
- typeof r === "function" && ((i = r), (r = null)),
- typeof n === "function" && ((i = n), (r = null), (n = null)),
- t(e) === "object" && ((r = n), (n = e), (e = this.groupId)),
- (this.groupId = e),
- this.storage.setGroupId(this.groupId);
- const o = new cn().setType("group").build();
- if (n) for (const s in n) this.groupTraits[s] = n[s];
- else this.groupTraits = {};
- this.storage.setGroupTraits(this.groupTraits),
- this.processAndSendDataToDestinations("group", o, r, i);
- }
- },
- },
- {
- key: "processPage",
- value(e, t, n, r, i) {
- const o = new cn().setType("page").build();
- t && (o.message.name = t),
- n || (n = {}),
- e && (n.category = e),
- n && (o.message.properties = this.getPageProperties(n)),
- this.trackPage(o, r, i);
- },
- },
- {
- key: "processTrack",
- value(e, t, n, r) {
- const i = new cn().setType("track").build();
- e && i.setEventName(e),
- t ? i.setProperty(t) : i.setProperty({}),
- this.trackEvent(i, n, r);
- },
- },
- {
- key: "processIdentify",
- value(e, t, n, r) {
- e && this.userId && e !== this.userId && this.reset(),
- (this.userId = e),
- this.storage.setUserId(this.userId);
- const i = new cn().setType("identify").build();
- if (t) {
- for (const o in t) this.userTraits[o] = t[o];
- this.storage.setUserTraits(this.userTraits);
- }
- this.identifyUser(i, n, r);
- },
- },
- {
- key: "identifyUser",
- value(e, t, n) {
- e.message.userId &&
- ((this.userId = e.message.userId),
- this.storage.setUserId(this.userId)),
- e &&
- e.message &&
- e.message.context &&
- e.message.context.traits &&
- ((this.userTraits = a({}, e.message.context.traits)),
- this.storage.setUserTraits(this.userTraits)),
- this.processAndSendDataToDestinations("identify", e, t, n);
- },
- },
- {
- key: "trackPage",
- value(e, t, n) {
- this.processAndSendDataToDestinations("page", e, t, n);
- },
- },
- {
- key: "trackEvent",
- value(e, t, n) {
- this.processAndSendDataToDestinations("track", e, t, n);
- },
- },
- {
- key: "processAndSendDataToDestinations",
- value(e, t, n, r) {
- try {
- this.anonymousId || this.setAnonymousId(),
- (t.message.context.page = E()),
- (t.message.context.traits = a({}, this.userTraits)),
- g.debug("anonymousId: ", this.anonymousId),
- (t.message.anonymousId = this.anonymousId),
- (t.message.userId = t.message.userId
- ? t.message.userId
- : this.userId),
- e == "group" &&
- (this.groupId && (t.message.groupId = this.groupId),
- this.groupTraits &&
- (t.message.traits = a({}, this.groupTraits))),
- n && this.processOptionsParam(t, n),
- g.debug(JSON.stringify(t)),
- Object.keys(t.message.integrations).length > 0 &&
- A(t.message.integrations),
- C(
- t.message.integrations,
- this.clientIntegrationObjects
- ).forEach(function (n) {
- (n.isFailed && n.isFailed()) || (n[e] && n[e](t));
- }),
- this.clientIntegrationObjects ||
- (g.debug("pushing in replay queue"),
- this.toBeProcessedByIntegrationArray.push([e, t])),
- (i = t.message.integrations),
- Object.keys(i).forEach(function (e) {
- i.hasOwnProperty(e) &&
- (y[e] && (i[y[e]] = i[e]),
- e != "All" && y[e] != null && y[e] != e && delete i[e]);
- }),
- Xn.call(this, t, e),
- g.debug("".concat(e, " is called ")),
- r && r();
- } catch (e) {
- k(e);
- }
- let i;
- },
- },
- {
- key: "processOptionsParam",
- value(e, t) {
- const n = ["integrations", "anonymousId", "originalTimestamp"];
- for (const r in t)
- if (n.includes(r)) e.message[r] = t[r];
- else if (r !== "context") e.message.context[r] = t[r];
- else for (const i in t[r]) e.message.context[i] = t[r][i];
- },
- },
- {
- key: "getPageProperties",
- value(e) {
- const t = E();
- for (const n in t) void 0 === e[n] && (e[n] = t[n]);
- return e;
- },
- },
- {
- key: "reset",
- value() {
- (this.userId = ""), (this.userTraits = {}), this.storage.clear();
- },
- },
- {
- key: "getAnonymousId",
- value() {
- return (
- (this.anonymousId = this.storage.getAnonymousId()),
- this.anonymousId || this.setAnonymousId(),
- this.anonymousId
- );
- },
- },
- {
- key: "setAnonymousId",
- value(e) {
- (this.anonymousId = e || b()),
- this.storage.setAnonymousId(this.anonymousId);
- },
- },
- {
- key: "load",
- value(e, n, r) {
- const i = this;
- g.debug("inside load ");
- let o = "https://api.rudderlabs.com/sourceConfig/?p=web&v=1.1.2";
- if (!e || !n || n.length == 0)
- throw (
- (k({
- message:
- "[Analytics] load:: Unable to load due to wrong writeKey or serverUrl",
- }),
- Error("failed to initialize"))
- );
- if (
- (r && r.logLevel && g.setLogLevel(r.logLevel),
- r &&
- r.integrations &&
- (Object.assign(this.loadOnlyIntegrations, r.integrations),
- A(this.loadOnlyIntegrations)),
- r && r.configUrl && (o = r.configUrl),
- r && r.sendAdblockPage && (this.sendAdblockPage = !0),
- r &&
- r.sendAdblockPageOptions &&
- t(r.sendAdblockPageOptions) === "object" &&
- (this.sendAdblockPageOptions = r.sendAdblockPageOptions),
- r && r.clientSuppliedCallbacks)
- ) {
- const s = {};
- Object.keys(this.methodToCallbackMapping).forEach(function (e) {
- i.methodToCallbackMapping.hasOwnProperty(e) &&
- r.clientSuppliedCallbacks[i.methodToCallbackMapping[e]] &&
- (s[e] =
- r.clientSuppliedCallbacks[i.methodToCallbackMapping[e]]);
- }),
- Object.assign(this.clientSuppliedCallbacks, s),
- this.registerCallbacks(!0);
- }
- (this.eventRepository.writeKey = e),
- n && (this.eventRepository.url = n),
- r &&
- r.valTrackingList &&
- r.valTrackingList.push == Array.prototype.push &&
- (this.trackValues = r.valTrackingList),
- r &&
- r.useAutoTracking &&
- ((this.autoTrackFeatureEnabled = !0),
- this.autoTrackFeatureEnabled &&
- !this.autoTrackHandlersRegistered &&
- (Kn(this),
- (this.autoTrackHandlersRegistered = !0),
- g.debug(
- "autoTrackHandlersRegistered",
- this.autoTrackHandlersRegistered
- )));
- try {
- !(function (e, t, n, r) {
- let i;
- const o = r.bind(e);
- (i = new XMLHttpRequest()).open("GET", t, !0),
- i.setRequestHeader("Authorization", `Basic ${btoa(`${n}:`)}`),
- (i.onload = function () {
- const e = i.status;
- e == 200
- ? (g.debug("status 200 calling callback"),
- o(200, i.responseText))
- : (k(
- new Error(
- `request failed with status: ${i.status} for url: ${t}`
- )
- ),
- o(e));
- }),
- i.send();
- })(this, o, e, this.processResponse);
- } catch (e) {
- k(e),
- this.autoTrackFeatureEnabled &&
- !this.autoTrackHandlersRegistered &&
- Kn(er);
- }
- },
- },
- {
- key: "ready",
- value(e) {
- typeof e !== "function"
- ? g.error("ready callback is not a function")
- : (this.readyCallback = e);
- },
- },
- {
- key: "initializeCallbacks",
- value() {
- const e = this;
- Object.keys(this.methodToCallbackMapping).forEach(function (t) {
- e.methodToCallbackMapping.hasOwnProperty(t) &&
- e.on(t, function () {});
- });
- },
- },
- {
- key: "registerCallbacks",
- value(e) {
- const t = this;
- e ||
- Object.keys(this.methodToCallbackMapping).forEach(function (e) {
- t.methodToCallbackMapping.hasOwnProperty(e) &&
- window.rudderanalytics &&
- typeof window.rudderanalytics[
- t.methodToCallbackMapping[e]
- ] === "function" &&
- (t.clientSuppliedCallbacks[e] =
- window.rudderanalytics[t.methodToCallbackMapping[e]]);
- }),
- Object.keys(this.clientSuppliedCallbacks).forEach(function (e) {
- t.clientSuppliedCallbacks.hasOwnProperty(e) &&
- (g.debug(
- "registerCallbacks",
- e,
- t.clientSuppliedCallbacks[e]
- ),
- t.on(e, t.clientSuppliedCallbacks[e]));
- });
- },
- },
- {
- key: "sendSampleRequest",
- value() {
- L(
- "ad-block",
- "//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"
- );
- },
- },
- ]),
- e
- );
- })())();
- console.log("====instance formed======="),
- d(er),
- window.addEventListener(
- "error",
- function (e) {
- k(e, er);
- },
- !0
- ),
- er.initializeCallbacks(),
- er.registerCallbacks(!1);
- const tr =
- !!window.rudderanalytics &&
- window.rudderanalytics.push == Array.prototype.push;
- const nr = window.rudderanalytics ? window.rudderanalytics[0] : [];
- if (nr.length > 0 && nr[0] == "load") {
- const rr = nr[0];
- nr.shift(),
- g.debug("=====from init, calling method:: ", rr),
- er[rr].apply(er, c(nr));
- }
- if (tr) {
- for (let ir = 1; ir < window.rudderanalytics.length; ir++)
- er.toBeProcessedArray.push(window.rudderanalytics[ir]);
- for (let or = 0; or < er.toBeProcessedArray.length; or++) {
- const sr = c(er.toBeProcessedArray[or]);
- const ar = sr[0];
- sr.shift(),
- g.debug("=====from init, calling method:: ", ar),
- er[ar].apply(er, c(sr));
- }
- er.toBeProcessedArray = [];
- }
- const cr = er.ready.bind(er);
- const ur = er.identify.bind(er);
- const lr = er.page.bind(er);
- const dr = er.track.bind(er);
- const pr = er.alias.bind(er);
- const hr = er.group.bind(er);
- const fr = er.reset.bind(er);
- const gr = er.load.bind(er);
- const mr = (er.initialized = !0);
- const yr = er.getAnonymousId.bind(er);
- const vr = er.setAnonymousId.bind(er);
- return (
- (e.alias = pr),
- (e.getAnonymousId = yr),
- (e.group = hr),
- (e.identify = ur),
- (e.initialized = mr),
- (e.load = gr),
- (e.page = lr),
- (e.ready = cr),
- (e.reset = fr),
- (e.setAnonymousId = vr),
- (e.track = dr),
- e
- );
-})({});
-// # sourceMappingURL=rudder-analytics.min.js.map
+rudderanalytics=function(e){"use strict";function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){for(var u=0;ue.length)&&(t=e.length);for(var u=0,n=new Array(t);u-1},W.prototype.set=function(e,t){var u=this.__data__,n=X(u,e);return n<0?(++this.size,u.push([e,t])):u[n][1]=t,this},J.prototype.clear=function(){this.size=0,this.__data__={hash:new H,map:new(G||W),string:new H}},J.prototype.delete=function(e){var t=ce(this,e).delete(e);return this.size-=t?1:0,t},J.prototype.get=function(e){return ce(this,e).get(e)},J.prototype.has=function(e){return ce(this,e).has(e)},J.prototype.set=function(e,t){var u=ce(this,e),n=u.size;return u.set(e,t),this.size+=u.size==n?0:1,this},$.prototype.clear=function(){this.__data__=new W,this.size=0},$.prototype.delete=function(e){var t=this.__data__,u=t.delete(e);return this.size=t.size,u},$.prototype.get=function(e){return this.__data__.get(e)},$.prototype.has=function(e){return this.__data__.has(e)},$.prototype.set=function(e,t){var u=this.__data__;if(u instanceof W){var n=u.__data__;if(!G||n.length<199)return n.push([e,t]),this.size=++u.size,this;u=this.__data__=new J(n)}return u.set(e,t),this.size=u.size,this};var te,ue=function(e,t,u){for(var n=-1,r=Object(e),i=u(e),o=i.length;o--;){var a=i[te?o:++n];if(!1===t(r[a],a,r))break}return e};function ne(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":L&&L in Object(e)?function(e){var t=b.call(e,L),u=e[L];try{e[L]=void 0;var n=!0}catch(e){}var r=_.call(e);n&&(t?e[L]=u:delete e[L]);return r}(e):function(e){return _.call(e)}(e)}function re(e){return Fe(e)&&"[object Arguments]"==ne(e)}function ie(e){return!(!ve(e)||function(e){return!!B&&B in e}(e))&&(Ee(e)?I:n).test(function(e){if(null!=e){try{return w.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function oe(e){if(!ve(e))return function(e){var t=[];if(null!=e)for(var u in Object(e))t.push(u);return t}(e);var t=pe(e),u=[];for(var n in e)("constructor"!=n||!t&&b.call(e,n))&&u.push(n);return u}function ae(e,t,u,n,r){e!==t&&ue(t,(function(i,o){if(r||(r=new $),ve(i))!function(e,t,u,n,r,i,o){var a=De(e,u),s=De(t,u),c=o.get(s);if(c)return void Q(e,u,c);var l=i?i(a,s,u+"",e,t,o):void 0,d=void 0===l;if(d){var p=me(s),D=!p&&Ce(s),f=!p&&!D&&we(s);l=s,p||D||f?me(a)?l=a:Fe(C=a)&&ye(C)?l=function(e,t){var u=-1,n=e.length;t||(t=Array(n));for(;++u-1&&e%1==0&&e0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(M?function(e,t){return M(e,"toString",{configurable:!0,enumerable:!1,value:(u=t,function(){return u}),writable:!0});var u}:ke);function he(e,t){return e===t||e!=e&&t!=t}var ge=re(function(){return arguments}())?re:function(e){return Fe(e)&&b.call(e,"callee")&&!j.call(e,"callee")},me=Array.isArray;function ye(e){return null!=e&&Ae(e.length)&&!Ee(e)}var Ce=U||function(){return!1};function Ee(e){if(!ve(e))return!1;var t=ne(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Ae(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function ve(e){var u=t(e);return null!=e&&("object"==u||"function"==u)}function Fe(e){return null!=e&&"object"==t(e)}var we=h?function(e){return function(t){return e(t)}}(h):function(e){return Fe(e)&&Ae(e.length)&&!!i[ne(e)]};function be(e){return ye(e)?Y(e,!0):oe(e)}var Be,_e=(Be=function(e,t,u){ae(e,t,u)},se((function(e,u){var n=-1,r=u.length,i=r>1?u[r-1]:void 0,o=r>2?u[2]:void 0;for(i=Be.length>3&&"function"==typeof i?(r--,i):void 0,o&&function(e,u,n){if(!ve(n))return!1;var r=t(u);return!!("number"==r?ye(n)&&de(u,n.length):"string"==r&&u in n)&&he(n[u],e)}(u[0],u[1],o)&&(i=r<3?void 0:i,r=1),e=Object(e);++n-1?t:t+e:window.location.href,n=u.indexOf("#");return n>-1?u.slice(0,n):u}(n)}}function ue(){for(var e,t=document.getElementsByTagName("link"),u=0;e=t[u];u++)if("canonical"===e.getAttribute("rel"))return e.getAttribute("href")}function ne(e,t){var u=e.revenue;return!u&&t&&t.match(/^[ _]?completed[ _]?order[ _]?|^[ _]?order[ _]?completed[ _]?$/i)&&(u=e.total),function(e){if(e){if("number"==typeof e)return e;if("string"==typeof e)return e=e.replace(/\$/g,""),e=parseFloat(e),isNaN(e)?void 0:e}}(u)}function re(e){Object.keys(e).forEach((function(t){e.hasOwnProperty(t)&&(H[t]&&(e[H[t]]=e[t]),"All"!=t&&null!=H[t]&&H[t]!=t&&delete e[t])}))}function ie(e,u){var n=[];if(!u||0==u.length)return n;var r=!0;return"string"==typeof u[0]?(null!=e.All&&(r=e.All),u.forEach((function(t){if(r){var u=!0;null!=e[t]&&0==e[t]&&(u=!1),u&&n.push(t)}else null!=e[t]&&1==e[t]&&n.push(t)})),n):"object"===t(u[0])?(null!=e.All&&(r=e.All),u.forEach((function(t){if(r){var u=!0;null!=e[t.name]&&0==e[t.name]&&(u=!1),u&&n.push(t)}else null!=e[t.name]&&1==e[t.name]&&n.push(t)})),n):void 0}function oe(e,u){return u=u||ce,"array"==function(e){switch(Object.prototype.toString.call(e)){case"[object Function]":return"function";case"[object Date]":return"date";case"[object RegExp]":return"regexp";case"[object Arguments]":return"arguments";case"[object Array]":return"array"}return null===e?"null":void 0===e?"undefined":e===Object(e)?"object":t(e)}(e)?ae(e,u):se(e,u)}var ae=function(e,t){for(var u=[],n=0;n=0},Ae.bool=Ae.boolean=function(e){return"[object Boolean]"===ge.call(e)},Ae.false=function(e){return Ae.bool(e)&&!1===Boolean(Number(e))},Ae.true=function(e){return Ae.bool(e)&&!0===Boolean(Number(e))},Ae.date=function(e){return"[object Date]"===ge.call(e)},Ae.date.valid=function(e){return Ae.date(e)&&!isNaN(Number(e))},Ae.element=function(e){return void 0!==e&&"undefined"!=typeof HTMLElement&&e instanceof HTMLElement&&1===e.nodeType},Ae.error=function(e){return"[object Error]"===ge.call(e)},Ae.fn=Ae.function=function(e){if("undefined"!=typeof window&&e===window.alert)return!0;var t=ge.call(e);return"[object Function]"===t||"[object GeneratorFunction]"===t||"[object AsyncFunction]"===t},Ae.number=function(e){return"[object Number]"===ge.call(e)},Ae.infinite=function(e){return e===1/0||e===-1/0},Ae.decimal=function(e){return Ae.number(e)&&!me(e)&&!Ae.infinite(e)&&e%1!=0},Ae.divisibleBy=function(e,t){var u=Ae.infinite(e),n=Ae.infinite(t),r=Ae.number(e)&&!me(e)&&Ae.number(t)&&!me(t)&&0!==t;return u||n||r&&e%t==0},Ae.integer=Ae.int=function(e){return Ae.number(e)&&!me(e)&&e%1==0},Ae.maximum=function(e,t){if(me(e))throw new TypeError("NaN is not a valid value");if(!Ae.arraylike(t))throw new TypeError("second argument must be array-like");for(var u=t.length;--u>=0;)if(e=0;)if(e>t[u])return!1;return!0},Ae.nan=function(e){return!Ae.number(e)||e!=e},Ae.even=function(e){return Ae.infinite(e)||Ae.number(e)&&e==e&&e%2==0},Ae.odd=function(e){return Ae.infinite(e)||Ae.number(e)&&e==e&&e%2!=0},Ae.ge=function(e,t){if(me(e)||me(t))throw new TypeError("NaN is not a valid value");return!Ae.infinite(e)&&!Ae.infinite(t)&&e>=t},Ae.gt=function(e,t){if(me(e)||me(t))throw new TypeError("NaN is not a valid value");return!Ae.infinite(e)&&!Ae.infinite(t)&&e>t},Ae.le=function(e,t){if(me(e)||me(t))throw new TypeError("NaN is not a valid value");return!Ae.infinite(e)&&!Ae.infinite(t)&&e<=t},Ae.lt=function(e,t){if(me(e)||me(t))throw new TypeError("NaN is not a valid value");return!Ae.infinite(e)&&!Ae.infinite(t)&&e=t&&e<=u},Ae.object=function(e){return"[object Object]"===ge.call(e)},Ae.primitive=function(e){return!e||!("object"===t(e)||Ae.object(e)||Ae.fn(e)||Ae.array(e))},Ae.hash=function(e){return Ae.object(e)&&e.constructor===Object&&!e.nodeType&&!e.setInterval},Ae.regexp=function(e){return"[object RegExp]"===ge.call(e)},Ae.string=function(e){return"[object String]"===ge.call(e)},Ae.base64=function(e){return Ae.string(e)&&(!e.length||Ce.test(e))},Ae.hex=function(e){return Ae.string(e)&&(!e.length||Ee.test(e))},Ae.symbol=function(e){return"function"==typeof Symbol&&"[object Symbol]"===ge.call(e)&&"symbol"===t(le.call(e))},Ae.bigint=function(e){return"function"==typeof BigInt&&"[object BigInt]"===ge.call(e)&&"bigint"==typeof de.call(e)};var ve,Fe=Ae,we=Object.prototype.toString,be=function(e){switch(we.call(e)){case"[object Function]":return"function";case"[object Date]":return"date";case"[object RegExp]":return"regexp";case"[object Arguments]":return"arguments";case"[object Array]":return"array";case"[object String]":return"string"}return null===e?"null":void 0===e?"undefined":e&&1===e.nodeType?"element":e===Object(e)?"object":t(e)},Be=/\b(Array|Date|Object|Math|JSON)\b/g,_e=function(e,t){var u=function(e){for(var t=[],u=0;u-1?u:t.map((function(e){return e.product_id})).indexOf(e.properties.product_id)+1}},{key:"extractCheckoutOptions",value:function(e){var t=oe([e.message.properties.paymentMethod,e.message.properties.shippingMethod]);return t.length>0?t.join(", "):null}}]),e}(),Ne=function(){function e(t){u(this,e),this.siteId=t.siteID,this.name="HOTJAR",this._ready=!1}return r(e,[{key:"init",value:function(){window.hotjarSiteId=this.siteId,function(e,t,u,n,r,i){e.hj=e.hj||function(){(e.hj.q=e.hj.q||[]).push(arguments)},e._hjSettings={hjid:e.hotjarSiteId,hjsv:6},r=t.getElementsByTagName("head")[0],(i=t.createElement("script")).async=1,i.src="https://static.hotjar.com/c/hotjar-"+e._hjSettings.hjid+".js?sv="+e._hjSettings.hjsv,r.appendChild(i)}(window,document),this._ready=!0,K("===in init Hotjar===")}},{key:"identify",value:function(e){if(e.message.userId||e.message.anonymousId){var t=e.message.context.traits;window.hj("identify",e.message.userId,t)}else K("[Hotjar] identify:: user id is required")}},{key:"track",value:function(e){K("[Hotjar] track:: method not supported")}},{key:"page",value:function(e){K("[Hotjar] page:: method not supported")}},{key:"isLoaded",value:function(){return this._ready}},{key:"isReady",value:function(){return this._ready}}]),e}(),Le=function(){function e(t){u(this,e),this.conversionId=t.conversionID,this.pageLoadConversions=t.pageLoadConversions,this.clickEventConversions=t.clickEventConversions,this.defaultPageConversion=t.defaultPageConversion,this.name="GOOGLEADS"}return r(e,[{key:"init",value:function(){!function(e,t,u){K("in script loader=== ".concat(e));var n=u.createElement("script");n.src=t,n.async=1,n.type="text/javascript",n.id=e;var r=u.getElementsByTagName("head")[0];K("==script==",r),r.appendChild(n)}("googleAds-integration","https://www.googletagmanager.com/gtag/js?id=".concat(this.conversionId),document),window.dataLayer=window.dataLayer||[],window.gtag=function(){window.dataLayer.push(arguments)},window.gtag("js",new Date),window.gtag("config",this.conversionId),K("===in init Google Ads===")}},{key:"identify",value:function(e){K("[GoogleAds] identify:: method not supported")}},{key:"track",value:function(e){K("in GoogleAdsAnalyticsManager track");var t=this.getConversionData(this.clickEventConversions,e.message.event);if(t.conversionLabel){var u=t.conversionLabel,n=t.eventName,r="".concat(this.conversionId,"/").concat(u),i={};e.properties&&(i.value=e.properties.revenue,i.currency=e.properties.currency,i.transaction_id=e.properties.order_id),i.send_to=r,window.gtag("event",n,i)}}},{key:"page",value:function(e){K("in GoogleAdsAnalyticsManager page");var t=this.getConversionData(this.pageLoadConversions,e.message.name);if(t.conversionLabel){var u=t.conversionLabel,n=t.eventName;window.gtag("event",n,{send_to:"".concat(this.conversionId,"/").concat(u)})}}},{key:"getConversionData",value:function(e,t){var u={};return e&&(t?e.forEach((function(e){e.name.toLowerCase()===t.toLowerCase()&&(u.conversionLabel=e.conversionLabel,u.eventName=e.name)})):this.defaultPageConversion&&(u.conversionLabel=this.defaultPageConversion,u.eventName="Viewed a Page")),u}},{key:"isLoaded",value:function(){return window.dataLayer.push!==Array.prototype.push}},{key:"isReady",value:function(){return window.dataLayer.push!==Array.prototype.push}}]),e}(),Me=function(){function e(t,n){u(this,e),this.accountId=t.accountId,this.settingsTolerance=t.settingsTolerance,this.isSPA=t.isSPA,this.libraryTolerance=t.libraryTolerance,this.useExistingJquery=t.useExistingJquery,this.sendExperimentTrack=t.sendExperimentTrack,this.sendExperimentIdentify=t.sendExperimentIdentify,this.name="VWO",this.analytics=n,K("Config ",t)}return r(e,[{key:"init",value:function(){K("===in init VWO===");var e=this.accountId,t=this.settingsTolerance,u=this.libraryTolerance,n=this.useExistingJquery,r=this.isSPA;window._vwo_code=function(){var i=!1,o=document;return{use_existing_jquery:function(){return n},library_tolerance:function(){return u},finish:function(){if(!i){i=!0;var e=o.getElementById("_vis_opt_path_hides");e&&e.parentNode.removeChild(e)}},finished:function(){return i},load:function(e){var t=o.createElement("script");t.src=e,t.type="text/javascript",t.innerText,t.onerror=function(){_vwo_code.finish()},o.getElementsByTagName("head")[0].appendChild(t)},init:function(){var u=setTimeout("_vwo_code.finish()",t),n=o.createElement("style"),i="body{opacity:0 !important;filter:alpha(opacity=0) !important;background:none !important;}",a=o.getElementsByTagName("head")[0];return n.setAttribute("id","_vis_opt_path_hides"),n.setAttribute("type","text/css"),n.styleSheet?n.styleSheet.cssText=i:n.appendChild(o.createTextNode(i)),a.appendChild(n),this.load("//dev.visualwebsiteoptimizer.com/j.php?a=".concat(e,"&u=").concat(encodeURIComponent(o.URL),"&r=").concat(Math.random(),"&f=").concat(+r)),u}}}(),window._vwo_settings_timer=window._vwo_code.init(),(this.sendExperimentTrack||this.experimentViewedIdentify)&&this.experimentViewed()}},{key:"experimentViewed",value:function(){var e=this;window.VWO=window.VWO||[];var t=this;window.VWO.push(["onVariationApplied",function(u){if(u){K("Variation Applied");var n=u[1],r=u[2];if(K("experiment id:",n,"Variation Name:",_vwo_exp[n].comb_n[r]),void 0!==_vwo_exp[n].comb_n[r]&&["VISUAL_AB","VISUAL","SPLIT_URL","SURVEY"].indexOf(_vwo_exp[n].type)>-1){try{t.sendExperimentTrack&&(K("Tracking..."),e.analytics.track("Experiment Viewed",{experimentId:n,variationName:_vwo_exp[n].comb_n[r]}))}catch(e){V("[VWO] experimentViewed:: ",e)}try{t.sendExperimentIdentify&&(K("Identifying..."),e.analytics.identify(i({},"Experiment: ".concat(n),_vwo_exp[n].comb_n[r])))}catch(e){V("[VWO] experimentViewed:: ",e)}}}}])}},{key:"identify",value:function(e){K("method not supported")}},{key:"track",value:function(e){if("Order Completed"===e.message.event){var t=e.message.properties?e.message.properties.total||e.message.properties.revenue:0;K("Revenue",t),window.VWO=window.VWO||[],window.VWO.push(["track.revenueConversion",t])}}},{key:"page",value:function(e){K("method not supported")}},{key:"isLoaded",value:function(){return!!window._vwo_code}},{key:"isReady",value:function(){return!!window._vwo_code}}]),e}(),Ue=function(){function e(t){u(this,e),this.containerID=t.containerID,this.name="GOOGLETAGMANAGER"}return r(e,[{key:"init",value:function(){K("===in init GoogleTagManager==="),function(e,t,u,n,r){e[n]=e[n]||[],e[n].push({"gtm.start":(new Date).getTime(),event:"gtm.js"});var i=t.getElementsByTagName(u)[0],o=t.createElement(u);o.async=!0,o.src="https://www.googletagmanager.com/gtm.js?id=".concat(r).concat(""),i.parentNode.insertBefore(o,i)}(window,document,"script","dataLayer",this.containerID)}},{key:"identify",value:function(e){K("[GTM] identify:: method not supported")}},{key:"track",value:function(e){K("===in track GoogleTagManager===");var t=e.message,u=a({event:t.event,userId:t.userId,anonymousId:t.anonymousId},t.properties);this.sendToGTMDatalayer(u)}},{key:"page",value:function(e){K("===in page GoogleTagManager===");var t,u=e.message,n=u.name,r=u.properties?u.properties.category:void 0;n&&(t="Viewed ".concat(n," page")),r&&n&&(t="Viewed ".concat(r," ").concat(n," page")),t||(t="Viewed a Page");var i=a({event:t,userId:u.userId,anonymousId:u.anonymousId},u.properties);this.sendToGTMDatalayer(i)}},{key:"isLoaded",value:function(){return!(!window.dataLayer||Array.prototype.push===window.dataLayer.push)}},{key:"sendToGTMDatalayer",value:function(e){window.dataLayer.push(e)}},{key:"isReady",value:function(){return!(!window.dataLayer||Array.prototype.push===window.dataLayer.push)}}]),e}(),qe=function(){function e(t,n){if(u(this,e),this.analytics=n,this.appKey=t.appKey,t.appKey||(this.appKey=""),this.endPoint="",t.dataCenter){var r=t.dataCenter.trim().split("-");"eu"===r[0].toLowerCase()?this.endPoint="sdk.fra-01.braze.eu":this.endPoint="sdk.iad-".concat(r[1],".braze.com")}this.name="BRAZE",K("Config ",t)}return r(e,[{key:"formatGender",value:function(e){if(e&&"string"==typeof e){return["woman","female","w","f"].indexOf(e.toLowerCase())>-1?window.appboy.ab.User.Genders.FEMALE:["man","male","m"].indexOf(e.toLowerCase())>-1?window.appboy.ab.User.Genders.MALE:["other","o"].indexOf(e.toLowerCase())>-1?window.appboy.ab.User.Genders.OTHER:void 0}}},{key:"init",value:function(){K("===in init Braze==="),function(e,t,u,n,r){e.appboy={},e.appboyQueue=[];for(var i="initialize destroy getDeviceId toggleAppboyLogging setLogger openSession changeUser requestImmediateDataFlush requestFeedRefresh subscribeToFeedUpdates requestContentCardsRefresh subscribeToContentCardsUpdates logCardImpressions logCardClick logCardDismissal logFeedDisplayed logContentCardsDisplayed logInAppMessageImpression logInAppMessageClick logInAppMessageButtonClick logInAppMessageHtmlClick subscribeToNewInAppMessages subscribeToInAppMessage removeSubscription removeAllSubscriptions logCustomEvent logPurchase isPushSupported isPushBlocked isPushGranted isPushPermissionGranted registerAppboyPushMessages unregisterAppboyPushMessages trackLocation stopWebTracking resumeWebTracking wipeData ab ab.DeviceProperties ab.User ab.User.Genders ab.User.NotificationSubscriptionTypes ab.User.prototype.getUserId ab.User.prototype.setFirstName ab.User.prototype.setLastName ab.User.prototype.setEmail ab.User.prototype.setGender ab.User.prototype.setDateOfBirth ab.User.prototype.setCountry ab.User.prototype.setHomeCity ab.User.prototype.setLanguage ab.User.prototype.setEmailNotificationSubscriptionType ab.User.prototype.setPushNotificationSubscriptionType ab.User.prototype.setPhoneNumber ab.User.prototype.setAvatarImageUrl ab.User.prototype.setLastKnownLocation ab.User.prototype.setUserAttribute ab.User.prototype.setCustomUserAttribute ab.User.prototype.addToCustomAttributeArray ab.User.prototype.removeFromCustomAttributeArray ab.User.prototype.incrementCustomUserAttribute ab.User.prototype.addAlias ab.User.prototype.setCustomLocationAttribute ab.InAppMessage ab.InAppMessage.SlideFrom ab.InAppMessage.ClickAction ab.InAppMessage.DismissType ab.InAppMessage.OpenTarget ab.InAppMessage.ImageStyle ab.InAppMessage.TextAlignment ab.InAppMessage.Orientation ab.InAppMessage.CropType ab.InAppMessage.prototype.subscribeToClickedEvent ab.InAppMessage.prototype.subscribeToDismissedEvent ab.InAppMessage.prototype.removeSubscription ab.InAppMessage.prototype.removeAllSubscriptions ab.InAppMessage.prototype.closeMessage ab.InAppMessage.Button ab.InAppMessage.Button.prototype.subscribeToClickedEvent ab.InAppMessage.Button.prototype.removeSubscription ab.InAppMessage.Button.prototype.removeAllSubscriptions ab.SlideUpMessage ab.ModalMessage ab.FullScreenMessage ab.HtmlMessage ab.ControlMessage ab.Feed ab.Feed.prototype.getUnreadCardCount ab.ContentCards ab.ContentCards.prototype.getUnviewedCardCount ab.Card ab.Card.prototype.dismissCard ab.ClassicCard ab.CaptionedImage ab.Banner ab.ControlCard ab.WindowUtils display display.automaticallyShowNewInAppMessages display.showInAppMessage display.showFeed display.destroyFeed display.toggleFeed display.showContentCards display.hideContentCards display.toggleContentCards sharedLib".split(" "),o=0;o>>32-t},rotr:function(e,t){return e<<32-t|e>>>t},endian:function(e){if(e.constructor==Number)return 16711935&u.rotl(e,8)|4278255360&u.rotl(e,24);for(var t=0;t0;e--)t.push(Math.floor(256*Math.random()));return t},bytesToWords:function(e){for(var t=[],u=0,n=0;u>>5]|=e[u]<<24-n%32;return t},wordsToBytes:function(e){for(var t=[],u=0;u<32*e.length;u+=8)t.push(e[u>>>5]>>>24-u%32&255);return t},bytesToHex:function(e){for(var t=[],u=0;u>>4).toString(16)),t.push((15&e[u]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],u=0;u>>6*(3-i)&63)):u.push("=");return u.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var u=[],n=0,r=0;n>>6-2*r);return u}};e.exports=u}()})),Ge={utf8:{stringToBytes:function(e){return Ge.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(Ge.bin.bytesToString(e)))}},bin:{stringToBytes:function(e){for(var t=[],u=0;u>>24)|4278255360&(a[D]<<24|a[D]>>>8);a[s>>>5]|=128<>>9<<4)]=s;var f=e._ff,h=e._gg,g=e._hh,m=e._ii;for(D=0;D>>0,l=l+C>>>0,d=d+E>>>0,p=p+A>>>0}return t.endian([c,l,d,p])};i._ff=function(e,t,u,n,r,i,o){var a=e+(t&u|~t&n)+(r>>>0)+o;return(a<>>32-i)+t},i._gg=function(e,t,u,n,r,i,o){var a=e+(t&n|u&~n)+(r>>>0)+o;return(a<>>32-i)+t},i._hh=function(e,t,u,n,r,i,o){var a=e+(t^u^n)+(r>>>0)+o;return(a<>>32-i)+t},i._ii=function(e,t,u,n,r,i,o){var a=e+(u^(t|~n))+(r>>>0)+o;return(a<>>32-i)+t},i._blocksize=16,i._digestsize=16,e.exports=function(e,u){if(null==e)throw new Error("Illegal argument "+e);var n=t.wordsToBytes(i(e,u));return u&&u.asBytes?n:u&&u.asString?r.bytesToString(n):t.bytesToHex(n)}}()})),Je=function(){function e(t){u(this,e),this.NAME="INTERCOM",this.API_KEY=t.apiKey,this.APP_ID=t.appId,this.MOBILE_APP_ID=t.mobileAppId,K("Config ",t)}return r(e,[{key:"init",value:function(){window.intercomSettings={app_id:this.APP_ID},function(){var e=window,t=e.Intercom;if("function"==typeof t)t("reattach_activator"),t("update",e.intercomSettings);else{var u=document,n=function e(){e.c(arguments)};n.q=[],n.c=function(e){n.q.push(e)},e.Intercom=n;var r=function(){var e=u.createElement("script");e.type="text/javascript",e.async=!0,e.src="https://widget.intercom.io/widget/".concat(window.intercomSettings.app_id);var t=u.getElementsByTagName("script")[0];t.parentNode.insertBefore(e,t)};"complete"===document.readyState?(r(),window.intercom_code=!0):e.attachEvent?(e.attachEvent("onload",r),window.intercom_code=!0):(e.addEventListener("load",r,!1),window.intercom_code=!0)}}()}},{key:"page",value:function(){window.Intercom("update")}},{key:"identify",value:function(e){var u={},n=e.message.context;if(null!=(n.Intercom?n.Intercom:null)){var r=n.Intercom.user_hash?n.Intercom.user_hash:null;null!=r&&(u.user_hash=r);var i=n.Intercom.hideDefaultLauncher?n.Intercom.hideDefaultLauncher:null;null!=i&&(u.hide_default_launcher=i)}Object.keys(n.traits).forEach((function(e){if(n.traits.hasOwnProperty(e)){var r=n.traits[e];if("company"===e){var i=[],o={};"string"==typeof n.traits[e]&&(o.company_id=We(n.traits[e]));var a="object"===t(n.traits[e])&&Object.keys(n.traits[e])||[];a.forEach((function(t){a.hasOwnProperty(t)&&("id"!=t?o[t]=n.traits[e][t]:o.company_id=n.traits[e][t])})),"object"!==t(n.traits[e])||a.includes("id")||(o.company_id=We(o.name)),i.push(o),u.companies=i}else u[e]=n.traits[e];switch(e){case"createdAt":u.created_at=r;break;case"anonymousId":u.user_id=r}}})),u.user_id=e.message.userId,window.Intercom("update",u)}},{key:"track",value:function(e){var t={},u=e.message;(u.properties?Object.keys(u.properties):null).forEach((function(e){var n=u.properties[e];t[e]=n})),u.event&&(t.event_name=u.event),t.user_id=u.userId?u.userId:u.anonymousId,t.created_at=Math.floor(new Date(u.originalTimestamp).getTime()/1e3),window.Intercom("trackEvent",t.event_name,t)}},{key:"isLoaded",value:function(){return!!window.intercom_code}},{key:"isReady",value:function(){return!!window.intercom_code}}]),e}(),$e=function(){function e(t){u(this,e),this.projectID=t.projectID,this.writeKey=t.writeKey,this.ipAddon=t.ipAddon,this.uaAddon=t.uaAddon,this.urlAddon=t.urlAddon,this.referrerAddon=t.referrerAddon,this.client=null,this.name="KEEN"}return r(e,[{key:"init",value:function(){K("===in init Keen==="),pe("keen-integration","https://cdn.jsdelivr.net/npm/keen-tracking@4");var e=setInterval(function(){void 0!==window.KeenTracking&&void 0!==window.KeenTracking&&(this.client=function(e){return e.client=new window.KeenTracking({projectId:e.projectID,writeKey:e.writeKey}),e.client}(this),clearInterval(e))}.bind(this),1e3)}},{key:"identify",value:function(e){K("in Keen identify");var t=e.message.context.traits,u=e.message.userId?e.message.userId:e.message.anonymousId,n=e.message.properties?Object.assign(n,e.message.properties):{};n.user={userId:u,traits:t},n=this.getAddOn(n),this.client.extendEvents(n)}},{key:"track",value:function(e){K("in Keen track");var t=e.message.event,u=e.message.properties;u=this.getAddOn(u),this.client.recordEvent(t,u)}},{key:"page",value:function(e){K("in Keen page");var t=e.message.name,u=e.message.properties?e.message.properties.category:void 0,n="Loaded a Page";t&&(n="Viewed ".concat(t," page")),u&&t&&(n="Viewed ".concat(u," ").concat(t," page"));var r=e.message.properties;r=this.getAddOn(r),this.client.recordEvent(n,r)}},{key:"isLoaded",value:function(){return K("in Keen isLoaded"),!(null==this.client)}},{key:"isReady",value:function(){return!(null==this.client)}},{key:"getAddOn",value:function(e){var t=[];return this.ipAddon&&(e.ip_address="${keen.ip}",t.push({name:"keen:ip_to_geo",input:{ip:"ip_address"},output:"ip_geo_info"})),this.uaAddon&&(e.user_agent="${keen.user_agent}",t.push({name:"keen:ua_parser",input:{ua_string:"user_agent"},output:"parsed_user_agent"})),this.urlAddon&&(e.page_url=document.location.href,t.push({name:"keen:url_parser",input:{url:"page_url"},output:"parsed_page_url"})),this.referrerAddon&&(e.page_url=document.location.href,e.referrer_url=document.referrer,t.push({name:"keen:referrer_parser",input:{referrer_url:"referrer_url",page_url:"page_url"},output:"referrer_info"})),e.keen={addons:t},e}}]),e}(),Ye=Object.prototype.hasOwnProperty,Qe=function(e){for(var t=Array.prototype.slice.call(arguments,1),u=0;u-1&&o.push([a,u[a]])}},{key:"initAfterPage",value:function(){var e,t=this;e=function(){var e,u,n=t.isVideo?"chartbeat_video.js":"chartbeat.js";e=document.createElement("script"),u=document.getElementsByTagName("script")[0],e.type="text/javascript",e.async=!0,e.src="//static.chartbeat.com/js/".concat(n),u.parentNode.insertBefore(e,u)},tt?rt(e):ut.push(e),this._isReady(this).then((function(e){K("===replaying on chartbeat==="),e.replayEvents.forEach((function(t){e[t[0]](t[1])}))}))}},{key:"pause",value:function(e){return new Promise((function(t){setTimeout(t,e)}))}},{key:"_isReady",value:function(e){var t=this,u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return new Promise((function(n){return t.isLoaded()?(t.failed=!1,K("===chartbeat loaded successfully==="),e.analytics.emit("ready"),n(e)):u>=1e4?(t.failed=!0,K("===chartbeat failed==="),n(e)):void t.pause(1e3).then((function(){return t._isReady(e,u+1e3).then(n)}))}))}}]),e}(),ot=function(){function e(t,n){u(this,e),this.c2ID=t.c2ID,this.analytics=n,this.comScoreBeaconParam=t.comScoreBeaconParam?t.comScoreBeaconParam:{},this.isFirstPageCallMade=!1,this.failed=!1,this.comScoreParams={},this.replayEvents=[],this.name="COMSCORE"}return r(e,[{key:"init",value:function(){K("===in init Comscore init===")}},{key:"identify",value:function(e){K("in Comscore identify")}},{key:"track",value:function(e){K("in Comscore track")}},{key:"page",value:function(e){if(K("in Comscore page"),this.loadConfig(e),this.isFirstPageCallMade){if(this.failed)return void(this.replayEvents=[]);if(!this.isLoaded()&&!this.failed)return void this.replayEvents.push(["page",e]);e.message.properties;window.COMSCORE.beacon(this.comScoreParams)}else this.isFirstPageCallMade=!0,this.initAfterPage()}},{key:"loadConfig",value:function(e){K("=====in loadConfig====="),this.comScoreParams=this.mapComscoreParams(e.message.properties),window._comscore=window._comscore||[],window._comscore.push(this.comScoreParams)}},{key:"initAfterPage",value:function(){K("=====in initAfterPage====="),function(){var e=document.createElement("script"),t=document.getElementsByTagName("script")[0];e.async=!0,e.src="".concat("https:"==document.location.protocol?"https://sb":"http://b",".scorecardresearch.com/beacon.js"),t.parentNode.insertBefore(e,t)}(),this._isReady(this).then((function(e){e.replayEvents.forEach((function(t){e[t[0]](t[1])}))}))}},{key:"pause",value:function(e){return new Promise((function(t){setTimeout(t,e)}))}},{key:"_isReady",value:function(e){var t=this,u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return new Promise((function(n){return t.isLoaded()?(t.failed=!1,e.analytics.emit("ready"),n(e)):u>=1e4?(t.failed=!0,n(e)):void t.pause(1e3).then((function(){return t._isReady(e,u+1e3).then(n)}))}))}},{key:"mapComscoreParams",value:function(e){K("=====in mapComscoreParams=====");var t=this.comScoreBeaconParam,u={};return Object.keys(t).forEach((function(n){if(n in e){var r=t[n],i=e[n];u[r]=i}})),u.c1="2",u.c2=this.c2ID,K("=====in mapComscoreParams=====",u),u}},{key:"isLoaded",value:function(){return K("in Comscore isLoaded"),!this.isFirstPageCallMade||!!window.COMSCORE}},{key:"isReady",value:function(){return!!window.COMSCORE}}]),e}(),at=function(){function e(t){u(this,e),this.blacklistPiiProperties=t.blacklistPiiProperties,this.categoryToContent=t.categoryToContent,this.pixelId=t.pixelId,this.eventsToEvents=t.eventsToEvents,this.eventCustomProperties=t.eventCustomProperties,this.valueFieldIdentifier=t.valueFieldIdentifier,this.advancedMapping=t.advancedMapping,this.traitKeyToExternalId=t.traitKeyToExternalId,this.legacyConversionPixelId=t.legacyConversionPixelId,this.userIdAsPixelId=t.userIdAsPixelId,this.whitelistPiiProperties=t.whitelistPiiProperties,this.name="FB_PIXEL"}return r(e,[{key:"init",value:function(){void 0===this.categoryToContent&&(this.categoryToContent=[]),void 0===this.legacyConversionPixelId&&(this.legacyConversionPixelId=[]),void 0===this.userIdAsPixelId&&(this.userIdAsPixelId=[]),K("===in init FbPixel==="),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.disablePushState=!0,window.fbq.allowDuplicatePageViews=!0,window.fbq.version="2.0",window.fbq.queue=[],window.fbq("init",this.pixelId),pe("fbpixel-integration","https://connect.facebook.net/en_US/fbevents.js")}},{key:"isLoaded",value:function(){return K("in FBPixel isLoaded"),!(!window.fbq||!window.fbq.callMethod)}},{key:"isReady",value:function(){return K("in FBPixel isReady"),!(!window.fbq||!window.fbq.callMethod)}},{key:"page",value:function(e){window.fbq("track","PageView")}},{key:"identify",value:function(e){this.advancedMapping&&window.fbq("init",this.pixelId,e.message.context.traits)}},{key:"track",value:function(e){var t=this,u=this,n=e.message.event,r=this.formatRevenue(e.message.properties.revenue),i=this.buildPayLoad(e,!0);void 0===this.categoryToContent&&(this.categoryToContent=[]),void 0===this.legacyConversionPixelId&&(this.legacyConversionPixelId=[]),void 0===this.userIdAsPixelId&&(this.userIdAsPixelId=[]),i.value=r;var o,a,s=this.eventsToEvents,c=this.legacyConversionPixelId;if(o=s.reduce((function(e,t){return t.from===n&&e.push(t.to),e}),[]),a=c.reduce((function(e,t){return t.from===n&&e.push(t.to),e}),[]),S((function(t){i.currency=e.message.properties.currency||"USD",window.fbq("trackSingle",u.pixelId,t,i,{eventID:e.message.messageId})}),o),S((function(t){window.fbq("trackSingle",u.pixelId,t,{currency:e.message.properties.currency,value:r},{eventID:e.message.messageId})}),a),"Product List Viewed"===n){var l=[],d=e.message.properties.products,p=this.buildPayLoad(e,!0);Array.isArray(d)&&d.forEach((function(t){var u=t.product_id;u&&(h.push(u),l.push({id:u,quantity:e.message.properties.quantity}))})),h.length?f=["product"]:(h.push(e.message.properties.category||""),l.push({id:e.message.properties.category||"",quantity:1}),f=["product_group"]),window.fbq("trackSingle",u.pixelId,"ViewContent",this.merge({content_ids:h,content_type:this.getContentType(e,f),contents:l},p),{eventID:e.message.messageId}),S((function(n){window.fbq("trackSingle",u.pixelId,n,{currency:e.message.properties.currency,value:t.formatRevenue(e.message.properties.revenue)},{eventID:e.message.messageId})}),a)}else if("Product Viewed"===n){var D="properties.value"===this.valueFieldIdentifier;p=this.buildPayLoad(e,!0);window.fbq("trackSingle",u.pixelId,"ViewContent",this.merge({content_ids:[e.message.properties.product_id||e.message.properties.id||e.message.properties.sku||""],content_type:this.getContentType(e,["product"]),content_name:e.message.properties.product_name||"",content_category:e.message.properties.category||"",currency:e.message.properties.currency,value:D?this.formatRevenue(e.message.properties.value):this.formatRevenue(e.message.properties.price),contents:[{id:e.message.properties.product_id||e.message.properties.id||e.message.properties.sku||"",quantity:e.message.properties.quantity,item_price:e.message.properties.price}]},p),{eventID:e.message.messageId}),S((function(n){window.fbq("trackSingle",u.pixelId,n,{currency:e.message.properties.currency,value:D?t.formatRevenue(e.message.properties.value):t.formatRevenue(e.message.properties.price)},{eventID:e.message.messageId})}),a)}else if("Product Added"===n){D="properties.value"===this.valueFieldIdentifier,p=this.buildPayLoad(e,!0);window.fbq("trackSingle",u.pixelId,"AddToCart",this.merge({content_ids:[e.message.properties.product_id||e.message.properties.id||e.message.properties.sku||""],content_type:this.getContentType(e,["product"]),content_name:e.message.properties.product_name||"",content_category:e.message.properties.category||"",currency:e.message.properties.currency,value:D?this.formatRevenue(e.message.properties.value):this.formatRevenue(e.message.properties.price),contents:[{id:e.message.properties.product_id||e.message.properties.id||e.message.properties.sku||"",quantity:e.message.properties.quantity,item_price:e.message.properties.price}]},p),{eventID:e.message.messageId}),S((function(n){window.fbq("trackSingle",u.pixelId,n,{currency:e.message.properties.currency,value:D?t.formatRevenue(e.message.properties.value):t.formatRevenue(e.message.properties.price)},{eventID:e.message.messageId})}),a),this.merge({content_ids:[e.message.properties.product_id||e.message.properties.id||e.message.properties.sku||""],content_type:this.getContentType(e,["product"]),content_name:e.message.properties.product_name||"",content_category:e.message.properties.category||"",currency:e.message.properties.currency,value:D?this.formatRevenue(e.message.properties.value):this.formatRevenue(e.message.properties.price),contents:[{id:e.message.properties.product_id||e.message.properties.id||e.message.properties.sku||"",quantity:e.message.properties.quantity,item_price:e.message.properties.price}]},p)}else if("Order Completed"===n){d=e.message.properties.products,p=this.buildPayLoad(e,!0),r=this.formatRevenue(e.message.properties.revenue);for(var f=this.getContentType(e,["product"]),h=[],g=(l=[],0);g=0&&Fe.date(D))l[p]=D.toISOTring().split("T")[0];else if(a.hasOwnProperty(p))a[p]&&"string"==typeof D&&(l[p]=sha256(D));else{var f=n.indexOf(p)>=0,h=r.indexOf(p)>=0;f&&!h||(l[p]=D)}}return l}}]),e}(),st=d((function(e,t){var u;e.exports=(u=u||function(e,t){var u=Object.create||function(){function e(){}return function(t){var u;return e.prototype=t,u=new e,e.prototype=null,u}}(),n={},r=n.lib={},i=r.Base={extend:function(e){var t=u(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},o=r.WordArray=i.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||s).stringify(this)},concat:function(e){var t=this.words,u=e.words,n=this.sigBytes,r=e.sigBytes;if(this.clamp(),n%4)for(var i=0;i>>2]>>>24-i%4*8&255;t[n+i>>>2]|=o<<24-(n+i)%4*8}else for(i=0;i>>2]=u[i>>>2];return this.sigBytes+=r,this},clamp:function(){var t=this.words,u=this.sigBytes;t[u>>>2]&=4294967295<<32-u%4*8,t.length=e.ceil(u/4)},clone:function(){var e=i.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var u,n=[],r=function(t){t=t;var u=987654321,n=4294967295;return function(){var r=((u=36969*(65535&u)+(u>>16)&n)<<16)+(t=18e3*(65535&t)+(t>>16)&n)&n;return r/=4294967296,(r+=.5)*(e.random()>.5?1:-1)}},i=0;i>>2]>>>24-r%4*8&255;n.push((i>>>4).toString(16)),n.push((15&i).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,u=[],n=0;n>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new o.init(u,t/2)}},c=a.Latin1={stringify:function(e){for(var t=e.words,u=e.sigBytes,n=[],r=0;r>>2]>>>24-r%4*8&255;n.push(String.fromCharCode(i))}return n.join("")},parse:function(e){for(var t=e.length,u=[],n=0;n>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new o.init(u,t)}},l=a.Utf8={stringify:function(e){try{return decodeURIComponent(escape(c.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return c.parse(unescape(encodeURIComponent(e)))}},d=r.BufferedBlockAlgorithm=i.extend({reset:function(){this._data=new o.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=l.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var u=this._data,n=u.words,r=u.sigBytes,i=this.blockSize,a=r/(4*i),s=(a=t?e.ceil(a):e.max((0|a)-this._minBufferSize,0))*i,c=e.min(4*s,r);if(s){for(var l=0;l>>2]>>>24-i%4*8&255)<<16|(t[i+1>>>2]>>>24-(i+1)%4*8&255)<<8|t[i+2>>>2]>>>24-(i+2)%4*8&255,a=0;a<4&&i+.75*a>>6*(3-a)&63));var s=n.charAt(64);if(s)for(;r.length%4;)r.push(s);return r.join("")},parse:function(e){var t=e.length,u=this._map,r=this._reverseMap;if(!r){r=this._reverseMap=[];for(var i=0;i>>6-o%4*2;r[i>>>2]|=(a|s)<<24-i%4*8,i++}return n.create(r,i)}(e,t,r)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},r.enc.Base64)})),d((function(e,t){var u;e.exports=(u=st,function(e){var t=u,n=t.lib,r=n.WordArray,i=n.Hasher,o=t.algo,a=[];!function(){for(var t=0;t<64;t++)a[t]=4294967296*e.abs(e.sin(t+1))|0}();var s=o.MD5=i.extend({_doReset:function(){this._hash=new r.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var u=0;u<16;u++){var n=t+u,r=e[n];e[n]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8)}var i=this._hash.words,o=e[t+0],s=e[t+1],D=e[t+2],f=e[t+3],h=e[t+4],g=e[t+5],m=e[t+6],y=e[t+7],C=e[t+8],E=e[t+9],A=e[t+10],v=e[t+11],F=e[t+12],w=e[t+13],b=e[t+14],B=e[t+15],_=i[0],k=i[1],I=i[2],O=i[3];_=c(_,k,I,O,o,7,a[0]),O=c(O,_,k,I,s,12,a[1]),I=c(I,O,_,k,D,17,a[2]),k=c(k,I,O,_,f,22,a[3]),_=c(_,k,I,O,h,7,a[4]),O=c(O,_,k,I,g,12,a[5]),I=c(I,O,_,k,m,17,a[6]),k=c(k,I,O,_,y,22,a[7]),_=c(_,k,I,O,C,7,a[8]),O=c(O,_,k,I,E,12,a[9]),I=c(I,O,_,k,A,17,a[10]),k=c(k,I,O,_,v,22,a[11]),_=c(_,k,I,O,F,7,a[12]),O=c(O,_,k,I,w,12,a[13]),I=c(I,O,_,k,b,17,a[14]),_=l(_,k=c(k,I,O,_,B,22,a[15]),I,O,s,5,a[16]),O=l(O,_,k,I,m,9,a[17]),I=l(I,O,_,k,v,14,a[18]),k=l(k,I,O,_,o,20,a[19]),_=l(_,k,I,O,g,5,a[20]),O=l(O,_,k,I,A,9,a[21]),I=l(I,O,_,k,B,14,a[22]),k=l(k,I,O,_,h,20,a[23]),_=l(_,k,I,O,E,5,a[24]),O=l(O,_,k,I,b,9,a[25]),I=l(I,O,_,k,f,14,a[26]),k=l(k,I,O,_,C,20,a[27]),_=l(_,k,I,O,w,5,a[28]),O=l(O,_,k,I,D,9,a[29]),I=l(I,O,_,k,y,14,a[30]),_=d(_,k=l(k,I,O,_,F,20,a[31]),I,O,g,4,a[32]),O=d(O,_,k,I,C,11,a[33]),I=d(I,O,_,k,v,16,a[34]),k=d(k,I,O,_,b,23,a[35]),_=d(_,k,I,O,s,4,a[36]),O=d(O,_,k,I,h,11,a[37]),I=d(I,O,_,k,y,16,a[38]),k=d(k,I,O,_,A,23,a[39]),_=d(_,k,I,O,w,4,a[40]),O=d(O,_,k,I,o,11,a[41]),I=d(I,O,_,k,f,16,a[42]),k=d(k,I,O,_,m,23,a[43]),_=d(_,k,I,O,E,4,a[44]),O=d(O,_,k,I,F,11,a[45]),I=d(I,O,_,k,B,16,a[46]),_=p(_,k=d(k,I,O,_,D,23,a[47]),I,O,o,6,a[48]),O=p(O,_,k,I,y,10,a[49]),I=p(I,O,_,k,b,15,a[50]),k=p(k,I,O,_,g,21,a[51]),_=p(_,k,I,O,F,6,a[52]),O=p(O,_,k,I,f,10,a[53]),I=p(I,O,_,k,A,15,a[54]),k=p(k,I,O,_,s,21,a[55]),_=p(_,k,I,O,C,6,a[56]),O=p(O,_,k,I,B,10,a[57]),I=p(I,O,_,k,m,15,a[58]),k=p(k,I,O,_,w,21,a[59]),_=p(_,k,I,O,h,6,a[60]),O=p(O,_,k,I,v,10,a[61]),I=p(I,O,_,k,D,15,a[62]),k=p(k,I,O,_,E,21,a[63]),i[0]=i[0]+_|0,i[1]=i[1]+k|0,i[2]=i[2]+I|0,i[3]=i[3]+O|0},_doFinalize:function(){var t=this._data,u=t.words,n=8*this._nDataBytes,r=8*t.sigBytes;u[r>>>5]|=128<<24-r%32;var i=e.floor(n/4294967296),o=n;u[15+(r+64>>>9<<4)]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),u[14+(r+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),t.sigBytes=4*(u.length+1),this._process();for(var a=this._hash,s=a.words,c=0;c<4;c++){var l=s[c];s[c]=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8)}return a},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});function c(e,t,u,n,r,i,o){var a=e+(t&u|~t&n)+r+o;return(a<>>32-i)+t}function l(e,t,u,n,r,i,o){var a=e+(t&n|u&~n)+r+o;return(a<>>32-i)+t}function d(e,t,u,n,r,i,o){var a=e+(t^u^n)+r+o;return(a<>>32-i)+t}function p(e,t,u,n,r,i,o){var a=e+(u^(t|~n))+r+o;return(a<>>32-i)+t}t.MD5=i._createHelper(s),t.HmacMD5=i._createHmacHelper(s)}(Math),u.MD5)})),d((function(e,t){var u,n,r,i,o,a,s,c;e.exports=(n=(u=c=st).lib,r=n.WordArray,i=n.Hasher,o=u.algo,a=[],s=o.SHA1=i.extend({_doReset:function(){this._hash=new r.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var u=this._hash.words,n=u[0],r=u[1],i=u[2],o=u[3],s=u[4],c=0;c<80;c++){if(c<16)a[c]=0|e[t+c];else{var l=a[c-3]^a[c-8]^a[c-14]^a[c-16];a[c]=l<<1|l>>>31}var d=(n<<5|n>>>27)+s+a[c];d+=c<20?1518500249+(r&i|~r&o):c<40?1859775393+(r^i^o):c<60?(r&i|r&o|i&o)-1894007588:(r^i^o)-899497514,s=o,o=i,i=r<<30|r>>>2,r=n,n=d}u[0]=u[0]+n|0,u[1]=u[1]+r|0,u[2]=u[2]+i|0,u[3]=u[3]+o|0,u[4]=u[4]+s|0},_doFinalize:function(){var e=this._data,t=e.words,u=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=Math.floor(u/4294967296),t[15+(n+64>>>9<<4)]=u,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}}),u.SHA1=i._createHelper(s),u.HmacSHA1=i._createHmacHelper(s),c.SHA1)})),d((function(e,t){var u,n,r;e.exports=(n=(u=st).lib.Base,r=u.enc.Utf8,void(u.algo.HMAC=n.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=r.parse(t));var u=e.blockSize,n=4*u;t.sigBytes>n&&(t=e.finalize(t)),t.clamp();for(var i=this._oKey=t.clone(),o=this._iKey=t.clone(),a=i.words,s=o.words,c=0;c>>2];e.sigBytes-=t}},r.BlockCipher=d.extend({cfg:d.cfg.extend({mode:f,padding:h}),reset:function(){d.reset.call(this);var e=this.cfg,t=e.iv,u=e.mode;if(this._xformMode==this._ENC_XFORM_MODE)var n=u.createEncryptor;else n=u.createDecryptor,this._minBufferSize=1;this._mode&&this._mode.__creator==n?this._mode.init(this,t&&t.words):(this._mode=n.call(u,this,t&&t.words),this._mode.__creator=n)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){e.pad(this._data,this.blockSize);var t=this._process(!0)}else t=this._process(!0),e.unpad(t);return t},blockSize:4}),g=r.CipherParams=i.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),m=(n.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext,u=e.salt;if(u)var n=o.create([1398893684,1701076831]).concat(u).concat(t);else n=t;return n.toString(c)},parse:function(e){var t=c.parse(e),u=t.words;if(1398893684==u[0]&&1701076831==u[1]){var n=o.create(u.slice(2,4));u.splice(0,4),t.sigBytes-=16}return g.create({ciphertext:t,salt:n})}},y=r.SerializableCipher=i.extend({cfg:i.extend({format:m}),encrypt:function(e,t,u,n){n=this.cfg.extend(n);var r=e.createEncryptor(u,n),i=r.finalize(t),o=r.cfg;return g.create({ciphertext:i,key:u,iv:o.iv,algorithm:e,mode:o.mode,padding:o.padding,blockSize:e.blockSize,formatter:n.format})},decrypt:function(e,t,u,n){return n=this.cfg.extend(n),t=this._parse(t,n.format),e.createDecryptor(u,n).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),C=(n.kdf={}).OpenSSL={execute:function(e,t,u,n){n||(n=o.random(8));var r=l.create({keySize:t+u}).compute(e,n),i=o.create(r.words.slice(t),4*u);return r.sigBytes=4*t,g.create({key:r,iv:i,salt:n})}},E=r.PasswordBasedCipher=y.extend({cfg:y.cfg.extend({kdf:C}),encrypt:function(e,t,u,n){var r=(n=this.cfg.extend(n)).kdf.execute(u,e.keySize,e.ivSize);n.iv=r.iv;var i=y.encrypt.call(this,e,t,r.key,n);return i.mixIn(r),i},decrypt:function(e,t,u,n){n=this.cfg.extend(n),t=this._parse(t,n.format);var r=n.kdf.execute(u,e.keySize,e.ivSize,t.salt);return n.iv=r.iv,y.decrypt.call(this,e,t,r.key,n)}})))})),d((function(e,t){var u;e.exports=(u=st,function(){var e=u,t=e.lib.BlockCipher,n=e.algo,r=[],i=[],o=[],a=[],s=[],c=[],l=[],d=[],p=[],D=[];!function(){for(var e=[],t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;var u=0,n=0;for(t=0;t<256;t++){var f=n^n<<1^n<<2^n<<3^n<<4;f=f>>>8^255&f^99,r[u]=f,i[f]=u;var h=e[u],g=e[h],m=e[g],y=257*e[f]^16843008*f;o[u]=y<<24|y>>>8,a[u]=y<<16|y>>>16,s[u]=y<<8|y>>>24,c[u]=y,y=16843009*m^65537*g^257*h^16843008*u,l[f]=y<<24|y>>>8,d[f]=y<<16|y>>>16,p[f]=y<<8|y>>>24,D[f]=y,u?(u=h^e[e[e[m^h]]],n^=e[e[n]]):u=n=1}}();var f=[0,1,2,4,8,16,32,64,128,27,54],h=n.AES=t.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,t=e.words,u=e.sigBytes/4,n=4*((this._nRounds=u+6)+1),i=this._keySchedule=[],o=0;o6&&o%u==4&&(a=r[a>>>24]<<24|r[a>>>16&255]<<16|r[a>>>8&255]<<8|r[255&a]):(a=r[(a=a<<8|a>>>24)>>>24]<<24|r[a>>>16&255]<<16|r[a>>>8&255]<<8|r[255&a],a^=f[o/u|0]<<24),i[o]=i[o-u]^a}for(var s=this._invKeySchedule=[],c=0;c>>24]]^d[r[a>>>16&255]]^p[r[a>>>8&255]]^D[r[255&a]]}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,o,a,s,c,r)},decryptBlock:function(e,t){var u=e[t+1];e[t+1]=e[t+3],e[t+3]=u,this._doCryptBlock(e,t,this._invKeySchedule,l,d,p,D,i),u=e[t+1],e[t+1]=e[t+3],e[t+3]=u},_doCryptBlock:function(e,t,u,n,r,i,o,a){for(var s=this._nRounds,c=e[t]^u[0],l=e[t+1]^u[1],d=e[t+2]^u[2],p=e[t+3]^u[3],D=4,f=1;f>>24]^r[l>>>16&255]^i[d>>>8&255]^o[255&p]^u[D++],g=n[l>>>24]^r[d>>>16&255]^i[p>>>8&255]^o[255&c]^u[D++],m=n[d>>>24]^r[p>>>16&255]^i[c>>>8&255]^o[255&l]^u[D++],y=n[p>>>24]^r[c>>>16&255]^i[l>>>8&255]^o[255&d]^u[D++];c=h,l=g,d=m,p=y}h=(a[c>>>24]<<24|a[l>>>16&255]<<16|a[d>>>8&255]<<8|a[255&p])^u[D++],g=(a[l>>>24]<<24|a[d>>>16&255]<<16|a[p>>>8&255]<<8|a[255&c])^u[D++],m=(a[d>>>24]<<24|a[p>>>16&255]<<16|a[c>>>8&255]<<8|a[255&l])^u[D++],y=(a[p>>>24]<<24|a[c>>>16&255]<<16|a[l>>>8&255]<<8|a[255&d])^u[D++],e[t]=h,e[t+1]=g,e[t+2]=m,e[t+3]=y},keySize:8});e.AES=t._createHelper(h)}(),u.AES)}))),lt=d((function(e,t){e.exports=st.enc.Utf8})),dt=Object.prototype.toString;var pt=function e(u){var n=function(e){switch(dt.call(e)){case"[object Date]":return"date";case"[object RegExp]":return"regexp";case"[object Arguments]":return"arguments";case"[object Array]":return"array";case"[object Error]":return"error"}return null===e?"null":void 0===e?"undefined":e!=e?"nan":e&&1===e.nodeType?"element":null!=(u=e)&&(u._isBuffer||u.constructor&&"function"==typeof u.constructor.isBuffer&&u.constructor.isBuffer(u))?"buffer":t(e=e.valueOf?e.valueOf():Object.prototype.valueOf.apply(e));var u}(u);if("object"===n){var r={};for(var i in u)u.hasOwnProperty(i)&&(r[i]=e(u[i]));return r}if("array"===n){r=new Array(u.length);for(var o=0,a=u.length;o1e4)return;var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(!t)return;var u=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*u;case"days":case"day":case"d":return u*gt;case"hours":case"hour":case"hrs":case"hr":case"h":return u*ht;case"minutes":case"minute":case"mins":case"min":case"m":return u*ft;case"seconds":case"second":case"secs":case"sec":case"s":return u*Dt;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return u}}(e):t.long?function(e){return yt(e,gt,"day")||yt(e,ht,"hour")||yt(e,ft,"minute")||yt(e,Dt,"second")||e+" ms"}(e):function(e){return e>=gt?Math.round(e/gt)+"d":e>=ht?Math.round(e/ht)+"h":e>=ft?Math.round(e/ft)+"m":e>=Dt?Math.round(e/Dt)+"s":e+"ms"}(e)};function yt(e,t,u){if(!(e=31},u.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),u.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],u.formatters.j=function(e){return JSON.stringify(e)},u.enable(n())}))),At=(Et.log,Et.formatArgs,Et.save,Et.load,Et.useColors,Et.storage,Et.colors,Et("cookie")),vt=function(e,t,u){switch(arguments.length){case 3:case 2:return Ft(e,t,u);case 1:return bt(e);default:return wt()}};function Ft(e,t,u){u=u||{};var n=Bt(e)+"="+Bt(t);null==t&&(u.maxage=-1),u.maxage&&(u.expires=new Date(+new Date+u.maxage)),u.path&&(n+="; path="+u.path),u.domain&&(n+="; domain="+u.domain),u.expires&&(n+="; expires="+u.expires.toUTCString()),u.samesite&&(n+="; samesite="+u.samesite),u.secure&&(n+="; secure"),document.cookie=n}function wt(){var e;try{e=document.cookie}catch(e){return"undefined"!=typeof console&&"function"==typeof console.error&&console.error(e.stack||e),{}}return function(e){var t,u={},n=e.split(/ *; */);if(""==n[0])return u;for(var r=0;r1)))/4)-l((e-1901+t)/100)+l((e-1601+t)/400)};t=function(e){for(r=l(e/864e5),u=l(r/365.2425)+1970-1;D(u+1,0)<=r;u++);for(n=l((r-D(u,0))/30.42);D(u,n+1)<=r;n++);r=1+r-D(u,n),o=l((i=(e%864e5+864e5)%864e5)/36e5)%24,a=l(i/6e4)%60,s=l(i/1e3)%60,c=i%1e3}}return(w=function(e){return e>-1/0&&e<1/0?(t(e),e=(u<=0||u>=1e4?(u<0?"-":"+")+F(6,u<0?-u:u):F(4,u))+"-"+F(2,n+1)+"-"+F(2,r)+"T"+F(2,o)+":"+F(2,a)+":"+F(2,s)+"."+F(3,c)+"Z",u=n=r=o=a=s=c=null):e=null,e})(e)};if(C("json-stringify")&&!C("date-serialization")){var b=function(e){return w(this)},B=u.stringify;u.stringify=function(e,t,u){var n=c.prototype.toJSON;c.prototype.toJSON=b;var r=B(e,t,u);return c.prototype.toJSON=n,r}}else{var _=function(e){var t=e.charCodeAt(0),u=v[t];return u||"\\u00"+F(2,t.toString(16))},k=/[\x00-\x1f\x22\x5c]/g,I=function(e){return k.lastIndex=0,'"'+(k.test(e)?e.replace(k,_):e)+'"'};u.stringify=function(e,u,r){var i,o,a,s;if(n[t(u)]&&u)if("[object Function]"==(s=h.call(u)))o=u;else if("[object Array]"==s){a={};for(var l,p=0,D=u.length;p0)for(r>10&&(r=10),i="";i.length-1/0&&l<1/0?""+l:"null";case"string":case"[object String]":return I(""+l)}if("object"==t(l)){for(C=s.length;C--;)if(s[C]===l)throw d();if(s.push(l),f=[],E=a,a+=o,"[object Array]"==D){for(y=0,C=l.length;y=48&&r<=57||r>=97&&r<=102||r>=65&&r<=70||P();e+=S("0x"+i.slice(t,O));break;default:P()}else{if(34==r)break;for(r=i.charCodeAt(O),t=O;r>=32&&92!=r&&34!=r;)r=i.charCodeAt(++O);e+=i.slice(t,O)}if(34==i.charCodeAt(O))return O++,e;P();default:if(t=O,45==r&&(n=!0,r=i.charCodeAt(++O)),r>=48&&r<=57){for(48==r&&((r=i.charCodeAt(O+1))>=48&&r<=57)&&P(),n=!1;O=48&&r<=57);O++);if(46==i.charCodeAt(O)){for(u=++O;u57);u++);u==O&&P(),O=u}if(101==(r=i.charCodeAt(O))||69==r){for(43!=(r=i.charCodeAt(++O))&&45!=r||O++,u=O;u57);u++);u==O&&P(),O=u}return+i.slice(t,O)}n&&P();var a=i.slice(O,O+4);if("true"==a)return O+=4,!0;if("fals"==a&&101==i.charCodeAt(O+4))return O+=5,!1;if("null"==a)return O+=4,null;P()}return"$"},j=function(e,t,u){var n=N(e,t,u);void 0===n?delete e[t]:e[t]=n},N=function(e,u,n){var r,i=e[u];if("object"==t(i)&&i)if("[object Array]"==h.call(i))for(r=i.length;r--;)j(h,A,i);else A(i,(function(e){j(i,e,n)}));return n.call(e,u,i)};u.parse=function(e,t){var u,n;return O=0,T=""+e,u=function e(t){var u,n;if("$"==t&&P(),"string"==typeof t){if("@"==(E?t.charAt(0):t[0]))return t.slice(1);if("["==t){for(u=[];"]"!=(t=R());)n?","==t?"]"==(t=R())&&P():P():n=!0,","==t&&P(),u.push(e(t));return u}if("{"==t){for(u={};"}"!=(t=R());)n?","==t?"}"==(t=R())&&P():P():n=!0,","!=t&&"string"==typeof t&&"@"==(E?t.charAt(0):t[0])&&":"==R()||P(),u[t.slice(1)]=e(R());return u}P()}return t}(R()),"$"!=R()&&P(),O=T=null,t&&"[object Function]"==h.call(t)?N(((n={})[""]=u,n),"",t):u}}}return u.runInContext=a,u}if(!o||o.global!==o&&o.window!==o&&o.self!==o||(i=o),r)a(i,r);else{var s=i.JSON,c=i.JSON3,d=!1,p=a(i,i.JSON3={noConflict:function(){return d||(d=!0,i.JSON=s,i.JSON3=c,s=c=null),p}});i.JSON={parse:p.parse,stringify:p.stringify}}}).call(l)})),Gt=d((function(e,t){(t=e.exports=function(e){function n(){}function i(){var e=i,n=+new Date,o=n-(u||n);e.diff=o,e.prev=u,e.curr=n,u=n,null==e.useColors&&(e.useColors=t.useColors()),null==e.color&&e.useColors&&(e.color=r());var a=Array.prototype.slice.call(arguments);a[0]=t.coerce(a[0]),"string"!=typeof a[0]&&(a=["%o"].concat(a));var s=0;a[0]=a[0].replace(/%([a-z%])/g,(function(u,n){if("%%"===u)return u;s++;var r=t.formatters[n];if("function"==typeof r){var i=a[s];u=r.call(e,i),a.splice(s,1),s--}return u})),"function"==typeof t.formatArgs&&(a=t.formatArgs.apply(e,a));var c=i.log||t.log||console.log.bind(console);c.apply(e,a)}n.enabled=!1,i.enabled=!0;var o=t.enabled(e)?i:n;return o.namespace=e,o}).coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){t.enable("")},t.enable=function(e){t.save(e);for(var u=(e||"").split(/[\s,]+/),n=u.length,r=0;r=31},u.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),u.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],u.formatters.j=function(e){return JSON.stringify(e)},u.enable(n())}))),Vt=(Kt.log,Kt.formatArgs,Kt.save,Kt.load,Kt.useColors,Kt.storage,Kt.colors,Kt("cookie")),Ht=function(e,t,u){switch(arguments.length){case 3:case 2:return Wt(e,t,u);case 1:return $t(e);default:return Jt()}};function Wt(e,t,u){u=u||{};var n=Yt(e)+"="+Yt(t);null==t&&(u.maxage=-1),u.maxage&&(u.expires=new Date(+new Date+u.maxage)),u.path&&(n+="; path="+u.path),u.domain&&(n+="; domain="+u.domain),u.expires&&(n+="; expires="+u.expires.toUTCString()),u.secure&&(n+="; secure"),document.cookie=n}function Jt(){var e;try{e=document.cookie}catch(e){return"undefined"!=typeof console&&"function"==typeof console.error&&console.error(e.stack||e),{}}return function(e){var t,u={},n=e.split(/ *; */);if(""==n[0])return u;for(var r=0;r=0;--i)r.push(t.slice(i).join("."));return r},n.cookie=Ht,t=e.exports=n})),Xt=new(function(){function e(t){u(this,e),this._options={},this.options(t)}return r(e,[{key:"options",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(0===arguments.length)return this._options;var t=".".concat(Zt(window.location.href));"."===t&&(t=null),this._options=Ut(e,{maxage:31536e6,path:"/",domain:t,samesite:"Lax"}),this.set("test_rudder",!0),this.get("test_rudder")||(this._options.domain=null),this.remove("test_rudder")}},{key:"set",value:function(e,t){try{return vt(e,t,pt(this._options)),!0}catch(e){return V(e),!1}}},{key:"get",value:function(e){return vt(e)}},{key:"remove",value:function(e){try{return vt(e,null,pt(this._options)),!0}catch(e){return!1}}}]),e}())({}),eu=function(){var e,t={},u="undefined"!=typeof window?window:l,n=u.document;if(t.disabled=!1,t.version="1.3.20",t.set=function(e,t){},t.get=function(e,t){},t.has=function(e){return void 0!==t.get(e)},t.remove=function(e){},t.clear=function(){},t.transact=function(e,u,n){null==n&&(n=u,u=null),null==u&&(u={});var r=t.get(e,u);n(r),t.set(e,r)},t.getAll=function(){var e={};return t.forEach((function(t,u){e[t]=u})),e},t.forEach=function(){},t.serialize=function(e){return zt.stringify(e)},t.deserialize=function(e){if("string"==typeof e)try{return zt.parse(e)}catch(t){return e||void 0}},function(){try{return"localStorage"in u&&u.localStorage}catch(e){return!1}}())e=u.localStorage,t.set=function(u,n){return void 0===n?t.remove(u):(e.setItem(u,t.serialize(n)),n)},t.get=function(u,n){var r=t.deserialize(e.getItem(u));return void 0===r?n:r},t.remove=function(t){e.removeItem(t)},t.clear=function(){e.clear()},t.forEach=function(u){for(var n=0;ndocument.w=window<\/script>'),i.close(),r=i.w.frames[0].document,e=r.createElement("div")}catch(t){e=n.createElement("div"),r=n.body}var o=function(u){return function(){var n=Array.prototype.slice.call(arguments,0);n.unshift(e),r.appendChild(e),e.addBehavior("#default#userData"),e.load("localStorage");var i=u.apply(t,n);return r.removeChild(e),i}},a=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g"),s=function(e){return e.replace(/^d/,"___$&").replace(a,"___")};t.set=o((function(e,u,n){return u=s(u),void 0===n?t.remove(u):(e.setAttribute(u,t.serialize(n)),e.save("localStorage"),n)})),t.get=o((function(e,u,n){u=s(u);var r=t.deserialize(e.getAttribute(u));return void 0===r?n:r})),t.remove=o((function(e,t){t=s(t),e.removeAttribute(t),e.save("localStorage")})),t.clear=o((function(e){var t=e.XMLDocument.documentElement.attributes;e.load("localStorage");for(var u=t.length-1;u>=0;u--)e.removeAttribute(t[u].name);e.save("localStorage")})),t.forEach=o((function(e,u){for(var n,r=e.XMLDocument.documentElement.attributes,i=0;n=r[i];++i)u(n.name,t.deserialize(e.getAttribute(n.name)))}))}try{var c="__storejs__";t.set(c,c),t.get(c)!=c&&(t.disabled=!0),t.remove(c)}catch(e){t.disabled=!0}return t.enabled=!t.disabled,t}(),tu=new(function(){function e(t){u(this,e),this._options={},this.enabled=!1,this.options(t)}return r(e,[{key:"options",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(0===arguments.length)return this._options;Ut(e,{enabled:!0}),this.enabled=e.enabled&&eu.enabled,this._options=e}},{key:"set",value:function(e,t){return!!this.enabled&&eu.set(e,t)}},{key:"get",value:function(e){return this.enabled?eu.get(e):null}},{key:"remove",value:function(e){return!!this.enabled&&eu.remove(e)}}]),e}())({}),uu="rl_user_id",nu="rl_trait",ru="rl_anonymous_id",iu="rl_group_id",ou="rl_group_trait",au="RudderEncrypt:",su="Rudder",cu=new(function(){function e(){if(u(this,e),Xt.set("rudder_cookies",!0),Xt.get("rudder_cookies"))return Xt.remove("rudder_cookies"),void(this.storage=Xt);tu.enabled&&(this.storage=tu)}return r(e,[{key:"stringify",value:function(e){return JSON.stringify(e)}},{key:"parse",value:function(e){try{return e?JSON.parse(e):null}catch(t){return V(t),e||null}}},{key:"trim",value:function(e){return e.replace(/^\s+|\s+$/gm,"")}},{key:"encryptValue",value:function(e){return""==this.trim(e)?e:"".concat(au).concat(ct.encrypt(e,su).toString())}},{key:"decryptValue",value:function(e){return!e||"string"==typeof e&&""==this.trim(e)?e:e.substring(0,au.length)==au?ct.decrypt(e.substring(au.length),su).toString(lt):e}},{key:"setItem",value:function(e,t){this.storage.set(e,this.encryptValue(this.stringify(t)))}},{key:"setUserId",value:function(e){"string"==typeof e?this.storage.set(uu,this.encryptValue(this.stringify(e))):V("[Storage] setUserId:: userId should be string")}},{key:"setUserTraits",value:function(e){this.storage.set(nu,this.encryptValue(this.stringify(e)))}},{key:"setGroupId",value:function(e){"string"==typeof e?this.storage.set(iu,this.encryptValue(this.stringify(e))):V("[Storage] setGroupId:: groupId should be string")}},{key:"setGroupTraits",value:function(e){this.storage.set(ou,this.encryptValue(this.stringify(e)))}},{key:"setAnonymousId",value:function(e){"string"==typeof e?this.storage.set(ru,this.encryptValue(this.stringify(e))):V("[Storage] setAnonymousId:: anonymousId should be string")}},{key:"getItem",value:function(e){return this.parse(this.decryptValue(this.storage.get(e)))}},{key:"getUserId",value:function(){return this.parse(this.decryptValue(this.storage.get(uu)))}},{key:"getUserTraits",value:function(){return this.parse(this.decryptValue(this.storage.get(nu)))}},{key:"getGroupId",value:function(){return this.parse(this.decryptValue(this.storage.get(iu)))}},{key:"getGroupTraits",value:function(){return this.parse(this.decryptValue(this.storage.get(ou)))}},{key:"getAnonymousId",value:function(){return this.parse(this.decryptValue(this.storage.get(ru)))}},{key:"removeItem",value:function(e){return this.storage.remove(e)}},{key:"clear",value:function(){this.storage.remove(uu),this.storage.remove(nu),this.storage.remove(iu),this.storage.remove(ou)}}]),e}()),lu="lt_synch_timestamp",du=new(function(){function e(){u(this,e),this.storage=cu}return r(e,[{key:"setLotameSynchTime",value:function(e){this.storage.setItem(lu,e)}},{key:"getLotameSynchTime",value:function(){return this.storage.getItem(lu)}}]),e}()),pu=function(){function e(t,n){var r=this;u(this,e),this.name="LOTAME",this.analytics=n,this.storage=du,this.bcpUrlSettingsPixel=t.bcpUrlSettingsPixel,this.bcpUrlSettingsIframe=t.bcpUrlSettingsIframe,this.dspUrlSettingsPixel=t.dspUrlSettingsPixel,this.dspUrlSettingsIframe=t.dspUrlSettingsIframe,this.mappings={},t.mappings.forEach((function(e){var t=e.key,u=e.value;r.mappings[t]=u}))}return r(e,[{key:"init",value:function(){K("===in init Lotame==="),window.LOTAME_SYNCH_CALLBACK=function(){}}},{key:"addPixel",value:function(e,t,u){K("Adding pixel for :: ".concat(e));var n=document.createElement("img");n.src=e,n.setAttribute("width",t),n.setAttribute("height",u),K("Image Pixel :: ".concat(n)),document.getElementsByTagName("body")[0].appendChild(n)}},{key:"addIFrame",value:function(e){K("Adding iframe for :: ".concat(e));var t=document.createElement("iframe");t.src=e,t.title="empty",t.setAttribute("id","LOTCCFrame"),t.setAttribute("tabindex","-1"),t.setAttribute("role","presentation"),t.setAttribute("aria-hidden","true"),t.setAttribute("style","border: 0px; width: 0px; height: 0px; display: block;"),K("IFrame :: ".concat(t)),document.getElementsByTagName("body")[0].appendChild(t)}},{key:"syncPixel",value:function(e){var t=this;if(K("===== in syncPixel ======"),K("Firing DSP Pixel URLs"),this.dspUrlSettingsPixel&&this.dspUrlSettingsPixel.length>0){var u=Date.now();this.dspUrlSettingsPixel.forEach((function(n){var r=t.compileUrl(a(a({},t.mappings),{},{userId:e,random:u}),n.dspUrlTemplate);t.addPixel(r,"1","1")}))}if(K("Firing DSP IFrame URLs"),this.dspUrlSettingsIframe&&this.dspUrlSettingsIframe.length>0){var n=Date.now();this.dspUrlSettingsIframe.forEach((function(u){var r=t.compileUrl(a(a({},t.mappings),{},{userId:e,random:n}),u.dspUrlTemplate);t.addIFrame(r)}))}this.storage.setLotameSynchTime(Date.now()),this.analytics.methodToCallbackMapping.syncPixel&&this.analytics.emit("syncPixel",{destination:this.name})}},{key:"compileUrl",value:function(e,t){return Object.keys(e).forEach((function(u){if(e.hasOwnProperty(u)){var n="{{".concat(u,"}}"),r=new RegExp(n,"gi");t=t.replace(r,e[u])}})),t}},{key:"identify",value:function(e){K("in Lotame identify");var t=e.message.userId;this.syncPixel(t)}},{key:"track",value:function(e){K("track not supported for lotame")}},{key:"page",value:function(e){var t=this;if(K("in Lotame page"),K("Firing BCP Pixel URLs"),this.bcpUrlSettingsPixel&&this.bcpUrlSettingsPixel.length>0){var u=Date.now();this.bcpUrlSettingsPixel.forEach((function(e){var n=t.compileUrl(a(a({},t.mappings),{},{random:u}),e.bcpUrlTemplate);t.addPixel(n,"1","1")}))}if(K("Firing BCP IFrame URLs"),this.bcpUrlSettingsIframe&&this.bcpUrlSettingsIframe.length>0){var n=Date.now();this.bcpUrlSettingsIframe.forEach((function(e){var u=t.compileUrl(a(a({},t.mappings),{},{random:n}),e.bcpUrlTemplate);t.addIFrame(u)}))}e.message.userId&&this.isPixelToBeSynched()&&this.syncPixel(e.message.userId)}},{key:"isPixelToBeSynched",value:function(){var e=this.storage.getLotameSynchTime(),t=Date.now();return!e||Math.floor((t-e)/864e5)>=7}},{key:"isLoaded",value:function(){return K("in Lotame isLoaded"),!0}},{key:"isReady",value:function(){return!0}}]),e}(),Du=function(){function e(t,n){var r=this;u(this,e),this.referrerOverride=function(e){if(e)return window.optimizelyEffectiveReferrer=e,e},this.sendDataToRudder=function(e){K(e);var t=e.experiment,u=e.variation,n={integrations:{All:!0}},i=e.audiences,o={};i.forEach((function(e){o[e.id]=e.name}));var a=Object.keys(o).sort().join(),s=Object.values(o).sort().join(", ");if(r.sendExperimentTrack){var c={campaignName:e.campaignName,campaignId:e.id,experimentId:t.id,experimentName:t.name,variationName:u.name,variationId:u.id,audienceId:a,audienceName:s,isInCampaignHoldback:e.isInCampaignHoldback};if(t.referrer&&(c.referrer=t.referrer,n.page={referrer:t.referrer}),r.sendExperimentTrackAsNonInteractive&&(c.nonInteraction=1),e&&r.customCampaignProperties.length>0)for(var l=0;l1){var u=t.pop();switch(u){case"str":case"int":case"date":case"real":case"bool":case"strs":case"ints":case"dates":case"reals":case"bools":return"".concat(gu(t.join("_")),"_").concat(u)}}return gu(e)}}]),e}(),TVSQUARED:function(){function e(t){u(this,e),this.isLoaded=function(){return K("in TVSqaured isLoaded"),!(!window._tvq||window._tvq.push===Array.prototype.push)},this.isReady=function(){return K("in TVSqaured isReady"),!(!window._tvq||window._tvq.push===Array.prototype.push)},this.page=function(){window._tvq.push(["trackPageView"])},this.formatRevenue=function(e){var t=e;return t=parseFloat(t.toString().replace(/^[^\d.]*/,""))},this.brandId=t.brandId,this.clientId=t.clientId,this.eventWhiteList=t.eventWhiteList||[],this.customMetrics=t.customMetrics||[],this.name="TVSquared"}return r(e,[{key:"init",value:function(){K("===in init TVSquared==="),window._tvq=window._tvq||[];var e="https:"===document.location.protocol?"https://":"http://";e+="collector-".concat(this.clientId,".tvsquared.com/"),window._tvq.push(["setSiteId",this.brandId]),window._tvq.push(["setTrackerUrl","".concat(e,"tv2track.php")]),pe("TVSquared-integration","".concat(e,"tv2track.js"))}},{key:"track",value:function(e){var t,u,n=e.message,r=n.event,i=n.userId,o=n.anonymousId,a=e.message.properties,s=a.revenue,c=a.productType,l=a.category,d=a.order_id,p=a.promotion_id,D=this.eventWhiteList.slice();for(D=D.filter((function(e){return""!==e.event})),t=0;t>>((3&t)<<3)&255;return n}}})),ku=[],Iu=0;Iu<256;++Iu)ku[Iu]=(Iu+256).toString(16).substr(1);var Ou,Tu,Su=function(e,t){var u=t||0,n=ku;return[n[e[u++]],n[e[u++]],n[e[u++]],n[e[u++]],"-",n[e[u++]],n[e[u++]],"-",n[e[u++]],n[e[u++]],"-",n[e[u++]],n[e[u++]],"-",n[e[u++]],n[e[u++]],n[e[u++]],n[e[u++]],n[e[u++]],n[e[u++]]].join("")},xu=0,Pu=0;var Ru=function(e,t,u){var n=t&&u||0,r=t||[],i=(e=e||{}).node||Ou,o=void 0!==e.clockseq?e.clockseq:Tu;if(null==i||null==o){var a=_u();null==i&&(i=Ou=[1|a[0],a[1],a[2],a[3],a[4],a[5]]),null==o&&(o=Tu=16383&(a[6]<<8|a[7]))}var s=void 0!==e.msecs?e.msecs:(new Date).getTime(),c=void 0!==e.nsecs?e.nsecs:Pu+1,l=s-xu+(c-Pu)/1e4;if(l<0&&void 0===e.clockseq&&(o=o+1&16383),(l<0||s>xu)&&void 0===e.nsecs&&(c=0),c>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");xu=s,Pu=c,Tu=o;var d=(1e4*(268435455&(s+=122192928e5))+c)%4294967296;r[n++]=d>>>24&255,r[n++]=d>>>16&255,r[n++]=d>>>8&255,r[n++]=255&d;var p=s/4294967296*1e4&268435455;r[n++]=p>>>8&255,r[n++]=255&p,r[n++]=p>>>24&15|16,r[n++]=p>>>16&255,r[n++]=o>>>8|128,r[n++]=255&o;for(var D=0;D<6;++D)r[n+D]=i[D];return t||Su(r)};var ju=function(e,t,u){var n=t&&u||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var r=(e=e||{}).random||(e.rng||_u)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t)for(var i=0;i<16;++i)t[n+i]=r[i];return t||Su(r)},Nu=ju;Nu.v1=Ru,Nu.v4=ju;var Lu=Nu,Mu=Lu.v4,Uu={_data:{},length:0,setItem:function(e,t){return this._data[e]=t,this.length=B(this._data).length,t},getItem:function(e){return e in this._data?this._data[e]:null},removeItem:function(e){return e in this._data&&delete this._data[e],this.length=B(this._data).length,null},clear:function(){this._data={},this.length=0},key:function(e){return B(this._data)[e]}};var qu={defaultEngine:function(){try{if(!window.localStorage)return!1;var e=Mu();window.localStorage.setItem(e,"test_value");var t=window.localStorage.getItem(e);return window.localStorage.removeItem(e),"test_value"===t}catch(e){return!1}}()?window.localStorage:Uu,inMemoryEngine:Uu},zu=qu.defaultEngine,Gu=qu.inMemoryEngine;function Ku(e,t,u,n){this.id=t,this.name=e,this.keys=u||{},this.engine=n||zu,this.originalEngine=this.engine}Ku.prototype.set=function(e,t){var u=this._createValidKey(e);if(u)try{this.engine.setItem(u,zt.stringify(t))}catch(u){(function(e){var t=!1;if(e.code)switch(e.code){case 22:t=!0;break;case 1014:"NS_ERROR_DOM_QUOTA_REACHED"===e.name&&(t=!0)}else-2147024882===e.number&&(t=!0);return t})(u)&&(this._swapEngine(),this.set(e,t))}},Ku.prototype.get=function(e){try{var t=this.engine.getItem(this._createValidKey(e));return null===t?null:zt.parse(t)}catch(e){return null}},Ku.prototype.getOriginalEngine=function(){return this.originalEngine},Ku.prototype.remove=function(e){this.engine.removeItem(this._createValidKey(e))},Ku.prototype._createValidKey=function(e){var t,u=this.name,n=this.id;return B(this.keys).length?(S((function(r){r===e&&(t=[u,n,e].join("."))}),this.keys),t):[u,n,e].join(".")},Ku.prototype._swapEngine=function(){var e=this;S((function(t){var u=e.get(t);Gu.setItem([e.name,e.id,t].join("."),u),e.remove(t)}),this.keys),this.engine=Gu};var Vu=Ku;var Hu={setTimeout:function(e,t){return window.setTimeout(e,t)},clearTimeout:function(e){return window.clearTimeout(e)},Date:window.Date},Wu=Hu;function Ju(){this.tasks={},this.nextId=1}Ju.prototype.now=function(){return+new Wu.Date},Ju.prototype.run=function(e,t){var u=this.nextId++;return this.tasks[u]=Wu.setTimeout(this._handle(u,e),t),u},Ju.prototype.cancel=function(e){this.tasks[e]&&(Wu.clearTimeout(this.tasks[e]),delete this.tasks[e])},Ju.prototype.cancelAll=function(){S(Wu.clearTimeout,this.tasks),this.tasks={}},Ju.prototype._handle=function(e,t){var u=this;return function(){return delete u.tasks[e],t()}},Ju.setClock=function(e){Wu=e},Ju.resetClock=function(){Wu=Hu};var $u=Ju,Yu=Qu;function Qu(e){return Qu.enabled(e)?function(t){t=Zu(t);var u=new Date,n=u-(Qu[e]||u);Qu[e]=u,t=e+" "+t+" +"+Qu.humanize(n),window.console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}:function(){}}function Zu(e){return e instanceof Error?e.stack||e.message:e}Qu.names=[],Qu.skips=[],Qu.enable=function(e){try{localStorage.debug=e}catch(e){}for(var t=(e||"").split(/[\s,]+/),u=t.length,n=0;n=36e5?(e/36e5).toFixed(1)+"h":e>=6e4?(e/6e4).toFixed(1)+"m":e>=1e3?(e/1e3|0)+"s":e+"ms"},Qu.enabled=function(e){for(var t=0,u=Qu.skips.length;tthis.maxAttempts)},un.prototype.getDelay=function(e){var t=this.backoff.MIN_RETRY_DELAY*Math.pow(this.backoff.FACTOR,e);if(this.backoff.JITTER){var u=Math.random(),n=Math.floor(u*this.backoff.JITTER*t);Math.floor(10*u)<5?t-=n:t+=n}return Number(Math.min(t,this.backoff.MAX_RETRY_DELAY).toPrecision(1))},un.prototype.addItem=function(e){this._enqueue({item:e,attemptNumber:0,time:this._schedule.now()})},un.prototype.requeue=function(e,t,u){this.shouldRetry(e,t,u)?this._enqueue({item:e,attemptNumber:t,time:this._schedule.now()+this.getDelay(t)}):this.emit("discard",e,t)},un.prototype._enqueue=function(e){var t=this._store.get(this.keys.QUEUE)||[];(t=t.slice(-(this.maxItems-1))).push(e),t=t.sort((function(e,t){return e.time-t.time})),this._store.set(this.keys.QUEUE,t),this._running&&this._processHead()},un.prototype._processHead=function(){var e=this,t=this._store;this._schedule.cancel(this._processId);var u=t.get(this.keys.QUEUE)||[],n=t.get(this.keys.IN_PROGRESS)||{},r=this._schedule.now(),i=[];function o(u,n){i.push({item:u.item,done:function(r,i){var o=t.get(e.keys.IN_PROGRESS)||{};delete o[n],t.set(e.keys.IN_PROGRESS,o),e.emit("processed",r,i,u.item),r&&e.requeue(u.item,u.attemptNumber+1,r)}})}for(var a=Object.keys(n).length;u.length&&u[0].time<=r&&a++0&&(this._processId=this._schedule.run(this._processHead,u[0].time-r))},un.prototype._ack=function(){this._store.set(this.keys.ACK,this._schedule.now()),this._store.set(this.keys.RECLAIM_START,null),this._store.set(this.keys.RECLAIM_END,null),this._schedule.run(this._ack,this.timeouts.ACK_TIMER)},un.prototype._checkReclaim=function(){var e=this;S((function(t){t.id!==e.id&&(e._schedule.now()-t.get(e.keys.ACK)=500&&i.status<600?(ee(new Error("request failed with status: ".concat(i.status).concat(i.statusText," for url: ").concat(e))),r(new Error("request failed with status: ".concat(i.status).concat(i.statusText," for url: ").concat(e)))):(K("====== request processed successfully: ".concat(i.status)),r(null,i.status)))},i.send(JSON.stringify(u,Q))}catch(e){r(e)}}},{key:"enqueue",value:function(e,t){var u=e.getElementContent(),n={"Content-Type":"application/json",Authorization:"Basic ".concat(btoa("".concat(this.writeKey,":"))),AnonymousId:btoa(u.anonymousId)};u.originalTimestamp=X(),u.sentAt=X(),JSON.stringify(u).length>32e3&&V("[EventRepository] enqueue:: message length greater 32 Kb ",u);var r="/"==this.url.slice(-1)?this.url.slice(0,-1):this.url;this.payloadQueue.addItem({url:"".concat(r,"/v1/").concat(t),headers:n,message:u})}}]),e}());function sn(e){var t=function(t){var u=(t=t||window.event).target||t.srcElement;Dn(u)&&(u=u.parentNode),ln(u,t)?K("to be tracked ",t.type):K("not to be tracked ",t.type),function(e,t){var u,n=e.target||e.srcElement;Dn(n)&&(n=n.parentNode);if(ln(n,e)){if("form"==n.tagName.toLowerCase()){u={};for(var r=0;r=0)return!0;return!1}(l))return!1;for(;l.parentNode&&!dn(l,"body");)fn(l)&&c.push(l),l=l.parentNode;var d,p=[];if(c.forEach((function(e){"a"===e.tagName.toLowerCase()&&(d=gn(d=e.getAttribute("href"))&&d),p.push(function(e,t){for(var u={classes:hn(e).split(" "),tag_name:e.tagName.toLowerCase()},n=e.attributes.length,r=0;r=0)return!1;t=t.parentNode}if(hn(e).split(" ").indexOf("rudder-include")>=0)return!0;if(dn(e,"input")||dn(e,"select")||dn(e,"textarea")||"true"===e.getAttribute("contenteditable"))return!1;if("inherit"===e.getAttribute("contenteditable"))for(t=e.parentNode;t.parentNode&&!dn(t,"body");t=t.parentNode)if("true"===t.getAttribute("contenteditable"))return!1;var u=e.type||"";if("string"==typeof u)switch(u.toLowerCase()){case"hidden":case"password":return!1}var n=e.name||e.id||"";if("string"==typeof n){if(/^adhar|cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pan|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(n.replace(/[^a-zA-Z0-9]/g,"")))return!1}return!0}function hn(e){switch(t(e.className)){case"string":return e.className;case"object":return e.className.baseVal||e.getAttribute("class")||"";default:return""}}function gn(e){if(null==e)return!1;if("string"==typeof e){e=e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");if(/^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$/.test((e||"").replace(/[- ]/g,"")))return!1;if(/(^\d{3}-?\d{2}-?\d{4}$)/.test(e))return!1;if(/(^\d{4}-?\d{4}-?\d{4}$)/.test(e))return!1;if(/(^\w{5}-?\d{4}-?\w{1}$)/.test(e))return!1}return!0}function mn(e,t){for(var u=e.attributes.length,n=0;n-1)return!0}return!1}function yn(e){if(e.previousElementSibling)return e.previousElementSibling;do{e=e.previousSibling}while(e&&!pn(e));return e}var Cn="ajs_trait_",En="ajs_prop_";function An(e,t){this.eventRepository||(this.eventRepository=an),this.eventRepository.enqueue(e,t)}var vn=new(function(){function e(){u(this,e),this.autoTrackHandlersRegistered=!1,this.autoTrackFeatureEnabled=!1,this.initialized=!1,this.trackValues=[],this.eventsBuffer=[],this.clientIntegrations=[],this.loadOnlyIntegrations={},this.clientIntegrationObjects=void 0,this.successfullyLoadedIntegration=[],this.failedToBeLoadedIntegration=[],this.toBeProcessedArray=[],this.toBeProcessedByIntegrationArray=[],this.storage=cu,this.eventRepository=an,this.sendAdblockPage=!1,this.sendAdblockPageOptions={},this.clientSuppliedCallbacks={},this.readyCallback=function(){},this.executeReadyCallback=void 0,this.methodToCallbackMapping={syncPixel:"syncPixelCallback"},this.loaded=!1}return r(e,[{key:"initializeUser",value:function(){this.userId=null!=this.storage.getUserId()?this.storage.getUserId():"",this.userTraits=null!=this.storage.getUserTraits()?this.storage.getUserTraits():{},this.groupId=null!=this.storage.getGroupId()?this.storage.getGroupId():"",this.groupTraits=null!=this.storage.getGroupTraits()?this.storage.getGroupTraits():{},this.anonymousId=this.getAnonymousId(),this.storage.setUserId(this.userId),this.storage.setAnonymousId(this.anonymousId),this.storage.setGroupId(this.groupId),this.storage.setUserTraits(this.userTraits),this.storage.setGroupTraits(this.groupTraits)}},{key:"processResponse",value:function(e,t){try{K("===in process response=== ".concat(e)),(t=JSON.parse(t)).source.useAutoTracking&&!this.autoTrackHandlersRegistered&&(this.autoTrackFeatureEnabled=!0,sn(this),this.autoTrackHandlersRegistered=!0),t.source.destinations.forEach((function(e,t){K("Destination ".concat(t," Enabled? ").concat(e.enabled," Type: ").concat(e.destinationDefinition.name," Use Native SDK? ").concat(e.config.useNativeSDK)),e.enabled&&this.clientIntegrations.push({name:e.destinationDefinition.name,config:e.config})}),this),K("this.clientIntegrations: ",this.clientIntegrations),this.clientIntegrations=ie(this.loadOnlyIntegrations,this.clientIntegrations),this.clientIntegrations=this.clientIntegrations.filter((function(e){return null!=yu[e.name]})),this.init(this.clientIntegrations)}catch(e){ee(e),K("===handling config BE response processing error==="),K("autoTrackHandlersRegistered",this.autoTrackHandlersRegistered),this.autoTrackFeatureEnabled&&!this.autoTrackHandlersRegistered&&(sn(this),this.autoTrackHandlersRegistered=!0)}}},{key:"init",value:function(e){var t=this,u=this;if(K("supported intgs ",yu),!e||0==e.length)return this.readyCallback&&this.readyCallback(),void(this.toBeProcessedByIntegrationArray=[]);e.forEach((function(e){try{K("[Analytics] init :: trying to initialize integration name:: ",e.name);var n=new(0,yu[e.name])(e.config,u);n.init(),K("initializing destination: ",e),t.isInitialized(n).then(t.replayEvents)}catch(t){V("[Analytics] initialize integration (integration.init()) failed :: ",e.name)}}))}},{key:"replayEvents",value:function(e){e.successfullyLoadedIntegration.length+e.failedToBeLoadedIntegration.length===e.clientIntegrations.length&&(K("===replay events called====",e.successfullyLoadedIntegration.length,e.failedToBeLoadedIntegration.length),e.clientIntegrationObjects=[],e.clientIntegrationObjects=e.successfullyLoadedIntegration,K("==registering after callback===",e.clientIntegrationObjects.length),e.executeReadyCallback=D(e.clientIntegrationObjects.length,e.readyCallback),K("==registering ready callback==="),e.on("ready",e.executeReadyCallback),e.clientIntegrationObjects.forEach((function(t){K("===looping over each successful integration===="),t.isReady&&!t.isReady()||(K("===letting know I am ready=====",t.name),e.emit("ready"))})),e.toBeProcessedByIntegrationArray.length>0&&(e.toBeProcessedByIntegrationArray.forEach((function(t){var u=t[0];t.shift(),Object.keys(t[0].message.integrations).length>0&&re(t[0].message.integrations);for(var n=ie(t[0].message.integrations,e.clientIntegrationObjects),r=0;r1&&void 0!==arguments[1]?arguments[1]:0;return new Promise((function(n){return e.isLoaded()?(K("===integration loaded successfully====",e.name),t.successfullyLoadedIntegration.push(e),n(t)):u>=1e4?(K("====max wait over===="),t.failedToBeLoadedIntegration.push(e),n(t)):void t.pause(1e3).then((function(){return K("====after pause, again checking===="),t.isInitialized(e,u+1e3).then(n)}))}))}},{key:"page",value:function(e,u,n,r,i){this.loaded&&("function"==typeof r&&(i=r,r=null),"function"==typeof n&&(i=n,r=n=null),"function"==typeof u&&(i=u,r=n=u=null),"object"===t(e)&&null!=e&&null!=e&&(r=u,n=e,u=e=null),"object"===t(u)&&null!=u&&null!=u&&(r=n,n=u,u=null),"string"==typeof e&&"string"!=typeof u&&(u=e,e=null),this.sendAdblockPage&&"RudderJS-Initiated"!=e&&this.sendSampleRequest(),this.processPage(e,u,n,r,i))}},{key:"track",value:function(e,t,u,n){this.loaded&&("function"==typeof u&&(n=u,u=null),"function"==typeof t&&(n=t,u=null,t=null),this.processTrack(e,t,u,n))}},{key:"identify",value:function(e,u,n,r){this.loaded&&("function"==typeof n&&(r=n,n=null),"function"==typeof u&&(r=u,n=null,u=null),"object"===t(e)&&(n=u,u=e,e=this.userId),this.processIdentify(e,u,n,r))}},{key:"alias",value:function(e,u,n,r){if(this.loaded){"function"==typeof n&&(r=n,n=null),"function"==typeof u&&(r=u,n=null,u=null),"object"===t(u)&&(n=u,u=null);var i=(new Bu).setType("alias").build();i.message.previousId=u||(this.userId?this.userId:this.getAnonymousId()),i.message.userId=e,this.processAndSendDataToDestinations("alias",i,n,r)}}},{key:"group",value:function(e,u,n,r){if(this.loaded&&arguments.length){"function"==typeof n&&(r=n,n=null),"function"==typeof u&&(r=u,n=null,u=null),"object"===t(e)&&(n=u,u=e,e=this.groupId),this.groupId=e,this.storage.setGroupId(this.groupId);var i=(new Bu).setType("group").build();if(u)for(var o in u)this.groupTraits[o]=u[o];else this.groupTraits={};this.storage.setGroupTraits(this.groupTraits),this.processAndSendDataToDestinations("group",i,n,r)}}},{key:"processPage",value:function(e,t,u,n,r){var i=(new Bu).setType("page").build();u||(u={}),t&&(i.message.name=t,u.name=t),e&&(i.message.category=e,u.category=e),i.message.properties=this.getPageProperties(u),this.trackPage(i,n,r)}},{key:"processTrack",value:function(e,t,u,n){var r=(new Bu).setType("track").build();e&&r.setEventName(e),t?r.setProperty(t):r.setProperty({}),this.trackEvent(r,u,n)}},{key:"processIdentify",value:function(e,t,u,n){e&&this.userId&&e!==this.userId&&this.reset(),this.userId=e,this.storage.setUserId(this.userId);var r=(new Bu).setType("identify").build();if(t){for(var i in t)this.userTraits[i]=t[i];this.storage.setUserTraits(this.userTraits)}this.identifyUser(r,u,n)}},{key:"identifyUser",value:function(e,t,u){e.message.userId&&(this.userId=e.message.userId,this.storage.setUserId(this.userId)),e&&e.message&&e.message.context&&e.message.context.traits&&(this.userTraits=a({},e.message.context.traits),this.storage.setUserTraits(this.userTraits)),this.processAndSendDataToDestinations("identify",e,t,u)}},{key:"trackPage",value:function(e,t,u){this.processAndSendDataToDestinations("page",e,t,u)}},{key:"trackEvent",value:function(e,t,u){this.processAndSendDataToDestinations("track",e,t,u)}},{key:"processAndSendDataToDestinations",value:function(e,t,u,n){try{this.anonymousId||this.setAnonymousId(),t.message.context.traits=a({},this.userTraits),K("anonymousId: ",this.anonymousId),t.message.anonymousId=this.anonymousId,t.message.userId=t.message.userId?t.message.userId:this.userId,"group"==e&&(this.groupId&&(t.message.groupId=this.groupId),this.groupTraits&&(t.message.traits=a({},this.groupTraits))),this.processOptionsParam(t,u),K(JSON.stringify(t)),Object.keys(t.message.integrations).length>0&&re(t.message.integrations);var r=ie(t.message.integrations,this.clientIntegrationObjects);try{r.forEach((function(u){u.isFailed&&u.isFailed()||u[e]&&u[e](t)}))}catch(e){ee({message:"[sendToNative]:".concat(e)})}this.clientIntegrationObjects||(K("pushing in replay queue"),this.toBeProcessedByIntegrationArray.push([e,t])),i=t.message.integrations,Object.keys(i).forEach((function(e){i.hasOwnProperty(e)&&(W[e]&&(i[W[e]]=i[e]),"All"!=e&&null!=W[e]&&W[e]!=e&&delete i[e])})),An.call(this,t,e),K("".concat(e," is called ")),n&&n()}catch(e){ee(e)}var i}},{key:"addCampaignInfo",value:function(e){var u=te().search,n=L(u);e.message.context&&"object"===t(e.message.context)&&(e.message.context.campaign=n)}},{key:"processOptionsParam",value:function(e,u){var n=e.message,r=n.type,o=n.properties;this.addCampaignInfo(e),e.message.context.page="page"==r?this.getContextPageProperties(o):this.getContextPageProperties();var s=["integrations","anonymousId","originalTimestamp"];for(var c in u)s.includes(c)?e.message[c]=u[c]:"context"!==c?e.message.context=C(e.message.context,i({},c,u[c])):"object"===t(u[c])&&null!=u[c]?e.message.context=C(e.message.context,a({},u[c])):V("[Analytics: processOptionsParam] context passed in options is not object")}},{key:"getPageProperties",value:function(e,t){var u=te(),n=t&&t.page?t.page:{};for(var r in u)void 0===e[r]&&(e[r]=n[r]||u[r]);return e}},{key:"getContextPageProperties",value:function(e){var t=te(),u={};for(var n in t)u[n]=e&&e[n]?e[n]:t[n];return u}},{key:"reset",value:function(){this.loaded&&(this.userId="",this.userTraits={},this.groupId="",this.groupTraits={},this.storage.clear())}},{key:"getAnonymousId",value:function(){return this.anonymousId=this.storage.getAnonymousId(),this.anonymousId||this.setAnonymousId(),this.anonymousId}},{key:"setAnonymousId",value:function(e){this.anonymousId=e||Z(),this.storage.setAnonymousId(this.anonymousId)}},{key:"isValidWriteKey",value:function(e){return!(!e||"string"!=typeof e||0==e.trim().length)}},{key:"isValidServerUrl",value:function(e){return!(!e||"string"!=typeof e||0==e.trim().length)}},{key:"load",value:function(e,u,n){var r=this;if(K("inside load "),!this.loaded){var i=Y;if(!this.isValidWriteKey(e)||!this.isValidServerUrl(u))throw ee({message:"[Analytics] load:: Unable to load due to wrong writeKey or serverUrl"}),Error("failed to initialize");if(n&&n.logLevel&&G(n.logLevel),n&&n.integrations&&(Object.assign(this.loadOnlyIntegrations,n.integrations),re(this.loadOnlyIntegrations)),n&&n.configUrl&&(i=function(e){var t=e;return-1==e.indexOf("sourceConfig")&&(t="/"==t.slice(-1)?t.slice(0,-1):t,t="".concat(t,"/sourceConfig/")),(t="/"==t.slice(-1)?t:"".concat(t,"/")).indexOf("?")>-1?t.split("?")[1]!==Y.split("?")[1]&&(t="".concat(t.split("?")[0],"?").concat(Y.split("?")[1])):t="".concat(t,"?").concat(Y.split("?")[1]),t}(n.configUrl)),n&&n.sendAdblockPage&&(this.sendAdblockPage=!0),n&&n.sendAdblockPageOptions&&"object"===t(n.sendAdblockPageOptions)&&(this.sendAdblockPageOptions=n.sendAdblockPageOptions),n&&n.clientSuppliedCallbacks){var o={};Object.keys(this.methodToCallbackMapping).forEach((function(e){r.methodToCallbackMapping.hasOwnProperty(e)&&n.clientSuppliedCallbacks[r.methodToCallbackMapping[e]]&&(o[e]=n.clientSuppliedCallbacks[r.methodToCallbackMapping[e]])})),Object.assign(this.clientSuppliedCallbacks,o),this.registerCallbacks(!0)}n&&n.queueOptions&&null!=n.queueOptions&&"object"==t(n.queueOptions)?this.eventRepository.startQueue(n.queueOptions):this.eventRepository.startQueue({}),this.eventRepository.writeKey=e,u&&(this.eventRepository.url=u),this.initializeUser(),this.loaded=!0,n&&n.valTrackingList&&n.valTrackingList.push==Array.prototype.push&&(this.trackValues=n.valTrackingList),n&&n.useAutoTracking&&(this.autoTrackFeatureEnabled=!0,this.autoTrackFeatureEnabled&&!this.autoTrackHandlersRegistered&&(sn(this),this.autoTrackHandlersRegistered=!0,K("autoTrackHandlersRegistered",this.autoTrackHandlersRegistered)));try{!function(e,t,u,n){var r=n.bind(e),i=new XMLHttpRequest;i.open("GET",t,!0),i.setRequestHeader("Authorization","Basic ".concat(btoa("".concat(u,":")))),i.onload=function(){var e=i.status;200==e?(K("status 200 calling callback"),r(200,i.responseText)):(ee(new Error("request failed with status: ".concat(i.status," for url: ").concat(t))),r(e))},i.send()}(this,i,e,this.processResponse)}catch(e){ee(e),this.autoTrackFeatureEnabled&&!this.autoTrackHandlersRegistered&&sn(this)}}}},{key:"ready",value:function(e){this.loaded&&("function"!=typeof e?V("ready callback is not a function"):this.readyCallback=e)}},{key:"initializeCallbacks",value:function(){var e=this;Object.keys(this.methodToCallbackMapping).forEach((function(t){e.methodToCallbackMapping.hasOwnProperty(t)&&e.on(t,(function(){}))}))}},{key:"registerCallbacks",value:function(e){var t=this;e||Object.keys(this.methodToCallbackMapping).forEach((function(e){t.methodToCallbackMapping.hasOwnProperty(e)&&window.rudderanalytics&&"function"==typeof window.rudderanalytics[t.methodToCallbackMapping[e]]&&(t.clientSuppliedCallbacks[e]=window.rudderanalytics[t.methodToCallbackMapping[e]])})),Object.keys(this.clientSuppliedCallbacks).forEach((function(e){t.clientSuppliedCallbacks.hasOwnProperty(e)&&(K("registerCallbacks",e,t.clientSuppliedCallbacks[e]),t.on(e,t.clientSuppliedCallbacks[e]))}))}},{key:"sendSampleRequest",value:function(){pe("ad-block","//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js")}},{key:"parseQueryString",value:function(e){var t,u,n={},r=y(e),i=(t=r,u={},Object.keys(t).forEach((function(e){e.substr(0,Cn.length)==Cn&&(u[e.substr(Cn.length)]=t[e])})),u),o=function(e){var t={};return Object.keys(e).forEach((function(u){u.substr(0,En.length)==En&&(t[u.substr(En.length)]=e[u])})),t}(r);return r.ajs_uid&&(n.userId=r.ajs_uid,n.traits=i),r.ajs_aid&&(n.anonymousId=r.ajs_aid),r.ajs_event&&(n.event=r.ajs_event,n.properties=o),n}}]),e}());p(vn),window.addEventListener("error",(function(e){ee(e,vn)}),!0),vn.initializeCallbacks(),vn.registerCallbacks(!1);for(var Fn=!!window.rudderanalytics&&window.rudderanalytics.push==Array.prototype.push,wn=window.rudderanalytics;wn&&wn[0]&&"load"!==wn[0][0];)wn.shift();if(wn&&wn.length>0&&"load"===wn[0][0]){var bn=wn[0][0];wn[0].shift(),K("=====from init, calling method:: ",bn),vn[bn].apply(vn,s(wn[0])),wn.shift()}if(function(e,t){t.anonymousId?t.userId?e.unshift(["setAnonymousId",t.anonymousId],["identify",t.userId,t.traits]):e.unshift(["setAnonymousId",t.anonymousId]):t.userId&&e.unshift(["identify",t.userId,t.traits]),t.event&&e.push(["track",t.event,t.properties])}(wn,vn.parseQueryString(window.location.search)),Fn&&wn&&wn.length>0){for(var Bn=0;Bn arr.length) len = arr.length;
-
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
-
- return arr2;
- }
-
- function _nonIterableSpread() {
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
- }
-
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
-
- function createCommonjsModule(fn, module) {
- return module = { exports: {} }, fn(module, module.exports), module.exports;
- }
-
- var componentEmitter = createCommonjsModule(function (module) {
- /**
- * Expose `Emitter`.
- */
-
- {
- module.exports = Emitter;
- }
-
- /**
- * Initialize a new `Emitter`.
- *
- * @api public
- */
-
- function Emitter(obj) {
- if (obj) return mixin(obj);
- }
- /**
- * Mixin the emitter properties.
- *
- * @param {Object} obj
- * @return {Object}
- * @api private
- */
-
- function mixin(obj) {
- for (var key in Emitter.prototype) {
- obj[key] = Emitter.prototype[key];
- }
- return obj;
- }
-
- /**
- * Listen on the given `event` with `fn`.
- *
- * @param {String} event
- * @param {Function} fn
- * @return {Emitter}
- * @api public
- */
-
- Emitter.prototype.on =
- Emitter.prototype.addEventListener = function(event, fn){
- this._callbacks = this._callbacks || {};
- (this._callbacks['$' + event] = this._callbacks['$' + event] || [])
- .push(fn);
- return this;
- };
-
- /**
- * Adds an `event` listener that will be invoked a single
- * time then automatically removed.
- *
- * @param {String} event
- * @param {Function} fn
- * @return {Emitter}
- * @api public
- */
-
- Emitter.prototype.once = function(event, fn){
- function on() {
- this.off(event, on);
- fn.apply(this, arguments);
- }
-
- on.fn = fn;
- this.on(event, on);
- return this;
- };
-
- /**
- * Remove the given callback for `event` or all
- * registered callbacks.
- *
- * @param {String} event
- * @param {Function} fn
- * @return {Emitter}
- * @api public
- */
-
- Emitter.prototype.off =
- Emitter.prototype.removeListener =
- Emitter.prototype.removeAllListeners =
- Emitter.prototype.removeEventListener = function(event, fn){
- this._callbacks = this._callbacks || {};
-
- // all
- if (0 == arguments.length) {
- this._callbacks = {};
- return this;
- }
-
- // specific event
- var callbacks = this._callbacks['$' + event];
- if (!callbacks) return this;
-
- // remove all handlers
- if (1 == arguments.length) {
- delete this._callbacks['$' + event];
- return this;
- }
-
- // remove specific handler
- var cb;
- for (var i = 0; i < callbacks.length; i++) {
- cb = callbacks[i];
- if (cb === fn || cb.fn === fn) {
- callbacks.splice(i, 1);
- break;
- }
- }
-
- // Remove event specific arrays for event types that no
- // one is subscribed for to avoid memory leak.
- if (callbacks.length === 0) {
- delete this._callbacks['$' + event];
- }
-
- return this;
- };
-
- /**
- * Emit `event` with the given args.
- *
- * @param {String} event
- * @param {Mixed} ...
- * @return {Emitter}
- */
-
- Emitter.prototype.emit = function(event){
- this._callbacks = this._callbacks || {};
-
- var args = new Array(arguments.length - 1)
- , callbacks = this._callbacks['$' + event];
-
- for (var i = 1; i < arguments.length; i++) {
- args[i - 1] = arguments[i];
- }
-
- if (callbacks) {
- callbacks = callbacks.slice(0);
- for (var i = 0, len = callbacks.length; i < len; ++i) {
- callbacks[i].apply(this, args);
- }
- }
-
- return this;
- };
-
- /**
- * Return array of callbacks for `event`.
- *
- * @param {String} event
- * @return {Array}
- * @api public
- */
-
- Emitter.prototype.listeners = function(event){
- this._callbacks = this._callbacks || {};
- return this._callbacks['$' + event] || [];
- };
-
- /**
- * Check if this emitter has `event` handlers.
- *
- * @param {String} event
- * @return {Boolean}
- * @api public
- */
-
- Emitter.prototype.hasListeners = function(event){
- return !! this.listeners(event).length;
- };
- });
-
- var after_1 = after;
-
- function after(count, callback, err_cb) {
- var bail = false;
- err_cb = err_cb || noop;
- proxy.count = count;
-
- return (count === 0) ? callback() : proxy
-
- function proxy(err, result) {
- if (proxy.count <= 0) {
- throw new Error('after called too many times')
- }
- --proxy.count;
-
- // after first error, rest are passed to err_cb
- if (err) {
- bail = true;
- callback(err);
- // future error callbacks will go to error handler
- callback = err_cb;
- } else if (proxy.count === 0 && !bail) {
- callback(null, result);
- }
- }
- }
-
- function noop() {}
-
- var LOG_LEVEL_INFO = 1;
- var LOG_LEVEL_DEBUG = 2;
- var LOG_LEVEL_WARN = 3;
- var LOG_LEVEL_ERROR = 4;
- var LOG_LEVEL = LOG_LEVEL_ERROR;
- var logger = {
- setLogLevel: function setLogLevel(logLevel) {
- switch (logLevel.toUpperCase()) {
- case "INFO":
- LOG_LEVEL = LOG_LEVEL_INFO;
- return;
-
- case "DEBUG":
- LOG_LEVEL = LOG_LEVEL_DEBUG;
- return;
-
- case "WARN":
- LOG_LEVEL = LOG_LEVEL_WARN;
- }
- },
- info: function info() {
- if (LOG_LEVEL <= LOG_LEVEL_INFO) {
- var _console;
-
- (_console = console).info.apply(_console, arguments);
- }
- },
- debug: function debug() {
- if (LOG_LEVEL <= LOG_LEVEL_DEBUG) {
- var _console2;
-
- (_console2 = console).debug.apply(_console2, arguments);
- }
- },
- warn: function warn() {
- if (LOG_LEVEL <= LOG_LEVEL_WARN) {
- var _console3;
-
- (_console3 = console).warn.apply(_console3, arguments);
- }
- },
- error: function error() {
- if (LOG_LEVEL <= LOG_LEVEL_ERROR) {
- var _console4;
-
- (_console4 = console).error.apply(_console4, arguments);
- }
- }
- };
-
- // for sdk side native integration identification
- // add a mapping from common names to index.js exported key names as identified by Rudder
- var commonNames = {
- All: "All",
- "Google Analytics": "GA",
- GoogleAnalytics: "GA",
- GA: "GA",
- "Google Ads": "GOOGLEADS",
- GoogleAds: "GOOGLEADS",
- GOOGLEADS: "GOOGLEADS",
- Braze: "BRAZE",
- BRAZE: "BRAZE",
- Chartbeat: "CHARTBEAT",
- CHARTBEAT: "CHARTBEAT",
- Comscore: "COMSCORE",
- COMSCORE: "COMSCORE",
- Customerio: "CUSTOMERIO",
- "Customer.io": "CUSTOMERIO",
- "FB Pixel": "FACEBOOK_PIXEL",
- "Facebook Pixel": "FACEBOOK_PIXEL",
- FB_PIXEL: "FACEBOOK_PIXEL",
- "Google Tag Manager": "GOOGLETAGMANAGER",
- GTM: "GTM",
- Hotjar: "HOTJAR",
- hotjar: "HOTJAR",
- HOTJAR: "HOTJAR",
- Hubspot: "HS",
- HUBSPOT: "HS",
- Intercom: "INTERCOM",
- INTERCOM: "INTERCOM",
- Keen: "KEEN",
- "Keen.io": "KEEN",
- KEEN: "KEEN",
- Kissmetrics: "KISSMETRICS",
- KISSMETRICS: "KISSMETRICS",
- Lotame: "LOTAME",
- LOTAME: "LOTAME",
- "Visual Website Optimizer": "VWO",
- VWO: "VWO"
- };
-
- // from client native integration name to server identified display name
- // add a mapping from Rudder identified key names to Rudder server recognizable names
- var clientToServerNames = {
- All: "All",
- GA: "Google Analytics",
- GOOGLEADS: "Google Ads",
- BRAZE: "Braze",
- CHARTBEAT: "Chartbeat",
- COMSCORE: "Comscore",
- CUSTOMERIO: "Customer IO",
- FACEBOOK_PIXEL: "Facebook Pixel",
- GTM: "Google Tag Manager",
- HOTJAR: "Hotjar",
- HS: "HubSpot",
- INTERCOM: "Intercom",
- KEEN: "Keen",
- KISSMETRICS: "Kiss Metrics",
- LOTAME: "Lotame",
- VWO: "VWO"
- };
-
- /**
- *
- * Utility method for excluding null and empty values in JSON
- * @param {*} key
- * @param {*} value
- * @returns
- */
-
-
- function replacer(key, value) {
- if (value === null || value === undefined) {
- return undefined;
- }
-
- return value;
- }
- /**
- *
- * Utility function for UUID genration
- * @returns
- */
-
-
- function generateUUID() {
- // Public Domain/MIT
- var d = new Date().getTime();
-
- if (typeof performance !== "undefined" && typeof performance.now === "function") {
- d += performance.now(); // use high-precision timer if available
- }
-
- return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function (c) {
- var r = (d + Math.random() * 16) % 16 | 0;
- d = Math.floor(d / 16);
- return (c === "x" ? r : r & 0x3 | 0x8).toString(16);
- });
- }
- /**
- *
- * Utility function to get current time (formatted) for including in sent_at field
- * @returns
- */
-
-
- function getCurrentTimeFormatted() {
- var curDateTime = new Date().toISOString(); // Keeping same as iso string
-
- /* let curDate = curDateTime.split("T")[0];
- let curTimeExceptMillis = curDateTime
- .split("T")[1]
- .split("Z")[0]
- .split(".")[0];
- let curTimeMillis = curDateTime.split("Z")[0].split(".")[1];
- return curDate + " " + curTimeExceptMillis + "+" + curTimeMillis; */
-
- return curDateTime;
- }
- /**
- *
- * Utility function to retrieve configuration JSON from server
- * @param {*} context
- * @param {*} url
- * @param {*} callback
- */
-
-
- function getJSONTrimmed(context, url, writeKey, callback) {
- // server-side integration, XHR is node module
- var cb_ = callback.bind(context);
-
- if (true) {
- var xhr = new XMLHttpRequest();
- } else {
- var xhr;
- }
-
- xhr.open("GET", url, true);
-
- {
- xhr.setRequestHeader("Authorization", "Basic ".concat(btoa("".concat(writeKey, ":"))));
- }
-
- xhr.onload = function () {
- var _xhr2 = xhr,
- status = _xhr2.status;
-
- if (status == 200) {
- logger.debug("status 200 " + "calling callback");
- cb_(200, xhr.responseText);
- } else {
- handleError(new Error("request failed with status: ".concat(xhr.status, " for url: ").concat(url)));
- cb_(status);
- }
- };
-
- xhr.send();
- }
-
- function handleError(error, analyticsInstance) {
- var errorMessage = error.message ? error.message : undefined;
- var sampleAdBlockTest;
-
- try {
- if (error instanceof Event) {
- if (error.target && error.target.localName == "script") {
- errorMessage = "error in script loading:: src:: ".concat(error.target.src, " id:: ").concat(error.target.id);
-
- if (analyticsInstance && error.target.src.includes("adsbygoogle")) {
- sampleAdBlockTest = true;
- analyticsInstance.page("RudderJS-Initiated", "ad-block page request", {
- path: "/ad-blocked",
- title: errorMessage
- }, analyticsInstance.sendAdblockPageOptions);
- }
- }
- }
-
- if (errorMessage && !sampleAdBlockTest) {
- logger.error("[Util] handleError:: ", errorMessage);
- }
- } catch (e) {
- logger.error("[Util] handleError:: ", e);
- }
- }
-
- function getDefaultPageProperties() {
- var canonicalUrl = getCanonicalUrl();
- var path = canonicalUrl ? canonicalUrl.pathname : window.location.pathname;
- var _document = document,
- referrer = _document.referrer;
- var search = window.location.search;
- var _document2 = document,
- title = _document2.title;
- var url = getUrl(search);
- return {
- path: path,
- referrer: referrer,
- search: search,
- title: title,
- url: url
- };
- }
-
- function getUrl(search) {
- var canonicalUrl = getCanonicalUrl();
- var url = canonicalUrl ? canonicalUrl.indexOf("?") > -1 ? canonicalUrl : canonicalUrl + search : window.location.href;
- var hashIndex = url.indexOf("#");
- return hashIndex > -1 ? url.slice(0, hashIndex) : url;
- }
-
- function getCanonicalUrl() {
- var tags = document.getElementsByTagName("link");
-
- for (var i = 0, tag; tag = tags[i]; i++) {
- if (tag.getAttribute("rel") === "canonical") {
- return tag.getAttribute("href");
- }
- }
- }
-
- function getCurrency(val) {
- if (!val) return;
-
- if (typeof val === "number") {
- return val;
- }
-
- if (typeof val !== "string") {
- return;
- }
-
- val = val.replace(/\$/g, "");
- val = parseFloat(val);
-
- if (!isNaN(val)) {
- return val;
- }
- }
-
- function getRevenue(properties, eventName) {
- var revenue = properties.revenue;
- var orderCompletedRegExp = /^[ _]?completed[ _]?order[ _]?|^[ _]?order[ _]?completed[ _]?$/i; // it's always revenue, unless it's called during an order completion.
-
- if (!revenue && eventName && eventName.match(orderCompletedRegExp)) {
- revenue = properties.total;
- }
-
- return getCurrency(revenue);
- }
- /**
- *
- *
- * @param {*} integrationObject
- */
-
-
- function tranformToRudderNames(integrationObject) {
- Object.keys(integrationObject).forEach(function (key) {
- if (integrationObject.hasOwnProperty(key)) {
- if (commonNames[key]) {
- integrationObject[commonNames[key]] = integrationObject[key];
- }
-
- if (key != "All") {
- // delete user supplied keys except All and if except those where oldkeys are not present or oldkeys are same as transformed keys
- if (commonNames[key] != undefined && commonNames[key] != key) {
- delete integrationObject[key];
- }
- }
- }
- });
- }
-
- function transformToServerNames(integrationObject) {
- Object.keys(integrationObject).forEach(function (key) {
- if (integrationObject.hasOwnProperty(key)) {
- if (clientToServerNames[key]) {
- integrationObject[clientToServerNames[key]] = integrationObject[key];
- }
-
- if (key != "All") {
- // delete user supplied keys except All and if except those where oldkeys are not present or oldkeys are same as transformed keys
- if (clientToServerNames[key] != undefined && clientToServerNames[key] != key) {
- delete integrationObject[key];
- }
- }
- }
- });
- }
- /**
- *
- * @param {*} sdkSuppliedIntegrations
- * @param {*} configPlaneEnabledIntegrations
- */
-
-
- function findAllEnabledDestinations(sdkSuppliedIntegrations, configPlaneEnabledIntegrations) {
- var enabledList = [];
-
- if (!configPlaneEnabledIntegrations || configPlaneEnabledIntegrations.length == 0) {
- return enabledList;
- }
-
- var allValue = true;
-
- if (typeof configPlaneEnabledIntegrations[0] === "string") {
- if (sdkSuppliedIntegrations.All != undefined) {
- allValue = sdkSuppliedIntegrations.All;
- }
-
- configPlaneEnabledIntegrations.forEach(function (intg) {
- if (!allValue) {
- // All false ==> check if intg true supplied
- if (sdkSuppliedIntegrations[intg] != undefined && sdkSuppliedIntegrations[intg] == true) {
- enabledList.push(intg);
- }
- } else {
- // All true ==> intg true by default
- var intgValue = true; // check if intg false supplied
-
- if (sdkSuppliedIntegrations[intg] != undefined && sdkSuppliedIntegrations[intg] == false) {
- intgValue = false;
- }
-
- if (intgValue) {
- enabledList.push(intg);
- }
- }
- });
- return enabledList;
- }
-
- if (_typeof(configPlaneEnabledIntegrations[0]) === "object") {
- if (sdkSuppliedIntegrations.All != undefined) {
- allValue = sdkSuppliedIntegrations.All;
- }
-
- configPlaneEnabledIntegrations.forEach(function (intg) {
- if (!allValue) {
- // All false ==> check if intg true supplied
- if (sdkSuppliedIntegrations[intg.name] != undefined && sdkSuppliedIntegrations[intg.name] == true) {
- enabledList.push(intg);
- }
- } else {
- // All true ==> intg true by default
- var intgValue = true; // check if intg false supplied
-
- if (sdkSuppliedIntegrations[intg.name] != undefined && sdkSuppliedIntegrations[intg.name] == false) {
- intgValue = false;
- }
-
- if (intgValue) {
- enabledList.push(intg);
- }
- }
- });
- return enabledList;
- }
- }
- /**
- * reject all null values from array/object
- * @param {} obj
- * @param {} fn
- */
-
-
- function rejectArr(obj, fn) {
- fn = fn || compact;
- return type(obj) == "array" ? rejectarray(obj, fn) : rejectobject(obj, fn);
- }
- /**
- * particular case when rejecting an array
- * @param {} arr
- * @param {} fn
- */
-
-
- var rejectarray = function rejectarray(arr, fn) {
- var ret = [];
-
- for (var i = 0; i < arr.length; ++i) {
- if (!fn(arr[i], i)) ret[ret.length] = arr[i];
- }
-
- return ret;
- };
- /**
- * Rejecting null from any object other than arrays
- * @param {} obj
- * @param {} fn
- *
- */
-
-
- var rejectobject = function rejectobject(obj, fn) {
- var ret = {};
-
- for (var k in obj) {
- if (obj.hasOwnProperty(k) && !fn(obj[k], k)) {
- ret[k] = obj[k];
- }
- }
-
- return ret;
- };
-
- function compact(value) {
- return value == null;
- }
- /**
- * check type of object incoming in the rejectArr function
- * @param {} val
- */
-
-
- function type(val) {
- switch (toString.call(val)) {
- case "[object Function]":
- return "function";
-
- case "[object Date]":
- return "date";
-
- case "[object RegExp]":
- return "regexp";
-
- case "[object Arguments]":
- return "arguments";
-
- case "[object Array]":
- return "array";
- }
-
- if (val === null) return "null";
- if (val === undefined) return "undefined";
- if (val === Object(val)) return "object";
- return _typeof(val);
- }
-
- var version = "1.1.2";
-
- var MessageType = {
- TRACK: "track",
- PAGE: "page",
- // SCREEN: "screen",
- IDENTIFY: "identify"
- }; // ECommerce Parameter Names Enumeration
-
- var ECommerceEvents = {
- PRODUCTS_SEARCHED: "Products Searched",
- PRODUCT_LIST_VIEWED: "Product List Viewed",
- PRODUCT_LIST_FILTERED: "Product List Filtered",
- PROMOTION_VIEWED: "Promotion Viewed",
- PROMOTION_CLICKED: "Promotion Clicked",
- PRODUCT_CLICKED: "Product Clicked",
- PRODUCT_VIEWED: "Product Viewed",
- PRODUCT_ADDED: "Product Added",
- PRODUCT_REMOVED: "Product Removed",
- CART_VIEWED: "Cart Viewed",
- CHECKOUT_STARTED: "Checkout Started",
- CHECKOUT_STEP_VIEWED: "Checkout Step Viewed",
- CHECKOUT_STEP_COMPLETED: "Checkout Step Completed",
- PAYMENT_INFO_ENTERED: "Payment Info Entered",
- ORDER_UPDATED: "Order Updated",
- ORDER_COMPLETED: "Order Completed",
- ORDER_REFUNDED: "Order Refunded",
- ORDER_CANCELLED: "Order Cancelled",
- COUPON_ENTERED: "Coupon Entered",
- COUPON_APPLIED: "Coupon Applied",
- COUPON_DENIED: "Coupon Denied",
- COUPON_REMOVED: "Coupon Removed",
- PRODUCT_ADDED_TO_WISHLIST: "Product Added to Wishlist",
- PRODUCT_REMOVED_FROM_WISHLIST: "Product Removed from Wishlist",
- WISH_LIST_PRODUCT_ADDED_TO_CART: "Wishlist Product Added to Cart",
- PRODUCT_SHARED: "Product Shared",
- CART_SHARED: "Cart Shared",
- PRODUCT_REVIEWED: "Product Reviewed"
- }; // Enumeration for integrations supported
- var BASE_URL = "https://hosted.rudderlabs.com"; // default to RudderStack
-
- var CONFIG_URL = "https://api.rudderlabs.com/sourceConfig/?p=web&v=".concat(version);
- var MAX_WAIT_FOR_INTEGRATION_LOAD = 10000;
- var INTEGRATION_LOAD_CHECK_INTERVAL = 1000;
- /* module.exports = {
- MessageType: MessageType,
- ECommerceParamNames: ECommerceParamNames,
- ECommerceEvents: ECommerceEvents,
- RudderIntegrationPlatform: RudderIntegrationPlatform,
- BASE_URL: BASE_URL,
- CONFIG_URL: CONFIG_URL,
- FLUSH_QUEUE_SIZE: FLUSH_QUEUE_SIZE
- }; */
-
- var ScriptLoader = function ScriptLoader(id, src) {
- logger.debug("in script loader=== ".concat(id));
- var js = document.createElement("script");
- js.src = src;
- js.async = true;
- js.type = "text/javascript";
- js.id = id;
- var e = document.getElementsByTagName("script")[0];
- logger.debug("==script==", e);
- e.parentNode.insertBefore(js, e);
- };
-
- var HubSpot = /*#__PURE__*/function () {
- function HubSpot(config) {
- _classCallCheck(this, HubSpot);
-
- this.hubId = config.hubID; // 6405167
-
- this.name = "HS";
- }
-
- _createClass(HubSpot, [{
- key: "init",
- value: function init() {
- var hubspotJs = "http://js.hs-scripts.com/".concat(this.hubId, ".js");
- ScriptLoader("hubspot-integration", hubspotJs);
- logger.debug("===in init HS===");
- }
- }, {
- key: "identify",
- value: function identify(rudderElement) {
- logger.debug("in HubspotAnalyticsManager identify");
- var traits = rudderElement.message.context.traits;
- var traitsValue = {};
-
- for (var k in traits) {
- if (!!Object.getOwnPropertyDescriptor(traits, k) && traits[k]) {
- var hubspotkey = k; // k.startsWith("rl_") ? k.substring(3, k.length) : k;
-
- if (toString.call(traits[k]) == "[object Date]") {
- traitsValue[hubspotkey] = traits[k].getTime();
- } else {
- traitsValue[hubspotkey] = traits[k];
- }
- }
- }
- /* if (traitsValue["address"]) {
- let address = traitsValue["address"];
- //traitsValue.delete(address)
- delete traitsValue["address"];
- for (let k in address) {
- if (!!Object.getOwnPropertyDescriptor(address, k) && address[k]) {
- let hubspotkey = k;//k.startsWith("rl_") ? k.substring(3, k.length) : k;
- hubspotkey = hubspotkey == "street" ? "address" : hubspotkey;
- traitsValue[hubspotkey] = address[k];
- }
- }
- } */
-
-
- var userProperties = rudderElement.message.context.user_properties;
-
- for (var _k in userProperties) {
- if (!!Object.getOwnPropertyDescriptor(userProperties, _k) && userProperties[_k]) {
- var _hubspotkey = _k; // k.startsWith("rl_") ? k.substring(3, k.length) : k;
-
- traitsValue[_hubspotkey] = userProperties[_k];
- }
- }
-
- logger.debug(traitsValue);
-
- if ((typeof window === "undefined" ? "undefined" : _typeof(window)) !== undefined) {
- var _hsq = window._hsq = window._hsq || [];
-
- _hsq.push(["identify", traitsValue]);
- }
- }
- }, {
- key: "track",
- value: function track(rudderElement) {
- logger.debug("in HubspotAnalyticsManager track");
-
- var _hsq = window._hsq = window._hsq || [];
-
- var eventValue = {};
- eventValue.id = rudderElement.message.event;
-
- if (rudderElement.message.properties && (rudderElement.message.properties.revenue || rudderElement.message.properties.value)) {
- eventValue.value = rudderElement.message.properties.revenue || rudderElement.message.properties.value;
- }
-
- _hsq.push(["trackEvent", eventValue]);
- }
- }, {
- key: "page",
- value: function page(rudderElement) {
- logger.debug("in HubspotAnalyticsManager page");
-
- var _hsq = window._hsq = window._hsq || []; // logger.debug("path: " + rudderElement.message.properties.path);
- // _hsq.push(["setPath", rudderElement.message.properties.path]);
-
- /* _hsq.push(["identify",{
- email: "testtrackpage@email.com"
- }]); */
-
-
- if (rudderElement.message.properties && rudderElement.message.properties.path) {
- _hsq.push(["setPath", rudderElement.message.properties.path]);
- }
-
- _hsq.push(["trackPageView"]);
- }
- }, {
- key: "isLoaded",
- value: function isLoaded() {
- logger.debug("in hubspot isLoaded");
- return !!(window._hsq && window._hsq.push !== Array.prototype.push);
- }
- }, {
- key: "isReady",
- value: function isReady() {
- return !!(window._hsq && window._hsq.push !== Array.prototype.push);
- }
- }]);
-
- return HubSpot;
- }();
-
- var index = HubSpot ;
-
- /* globals window, HTMLElement */
-
- /**!
- * is
- * the definitive JavaScript type testing library
- *
- * @copyright 2013-2014 Enrico Marino / Jordan Harband
- * @license MIT
- */
-
- var objProto = Object.prototype;
- var owns = objProto.hasOwnProperty;
- var toStr = objProto.toString;
- var symbolValueOf;
- if (typeof Symbol === 'function') {
- symbolValueOf = Symbol.prototype.valueOf;
- }
- var bigIntValueOf;
- if (typeof BigInt === 'function') {
- bigIntValueOf = BigInt.prototype.valueOf;
- }
- var isActualNaN = function (value) {
- return value !== value;
- };
- var NON_HOST_TYPES = {
- 'boolean': 1,
- number: 1,
- string: 1,
- undefined: 1
- };
-
- var base64Regex = /^([A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{4}|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}==)$/;
- var hexRegex = /^[A-Fa-f0-9]+$/;
-
- /**
- * Expose `is`
- */
-
- var is = {};
-
- /**
- * Test general.
- */
-
- /**
- * is.type
- * Test if `value` is a type of `type`.
- *
- * @param {*} value value to test
- * @param {String} type type
- * @return {Boolean} true if `value` is a type of `type`, false otherwise
- * @api public
- */
-
- is.a = is.type = function (value, type) {
- return typeof value === type;
- };
-
- /**
- * is.defined
- * Test if `value` is defined.
- *
- * @param {*} value value to test
- * @return {Boolean} true if 'value' is defined, false otherwise
- * @api public
- */
-
- is.defined = function (value) {
- return typeof value !== 'undefined';
- };
-
- /**
- * is.empty
- * Test if `value` is empty.
- *
- * @param {*} value value to test
- * @return {Boolean} true if `value` is empty, false otherwise
- * @api public
- */
-
- is.empty = function (value) {
- var type = toStr.call(value);
- var key;
-
- if (type === '[object Array]' || type === '[object Arguments]' || type === '[object String]') {
- return value.length === 0;
- }
-
- if (type === '[object Object]') {
- for (key in value) {
- if (owns.call(value, key)) {
- return false;
- }
- }
- return true;
- }
-
- return !value;
- };
-
- /**
- * is.equal
- * Test if `value` is equal to `other`.
- *
- * @param {*} value value to test
- * @param {*} other value to compare with
- * @return {Boolean} true if `value` is equal to `other`, false otherwise
- */
-
- is.equal = function equal(value, other) {
- if (value === other) {
- return true;
- }
-
- var type = toStr.call(value);
- var key;
-
- if (type !== toStr.call(other)) {
- return false;
- }
-
- if (type === '[object Object]') {
- for (key in value) {
- if (!is.equal(value[key], other[key]) || !(key in other)) {
- return false;
- }
- }
- for (key in other) {
- if (!is.equal(value[key], other[key]) || !(key in value)) {
- return false;
- }
- }
- return true;
- }
-
- if (type === '[object Array]') {
- key = value.length;
- if (key !== other.length) {
- return false;
- }
- while (key--) {
- if (!is.equal(value[key], other[key])) {
- return false;
- }
- }
- return true;
- }
-
- if (type === '[object Function]') {
- return value.prototype === other.prototype;
- }
-
- if (type === '[object Date]') {
- return value.getTime() === other.getTime();
- }
-
- return false;
- };
-
- /**
- * is.hosted
- * Test if `value` is hosted by `host`.
- *
- * @param {*} value to test
- * @param {*} host host to test with
- * @return {Boolean} true if `value` is hosted by `host`, false otherwise
- * @api public
- */
-
- is.hosted = function (value, host) {
- var type = typeof host[value];
- return type === 'object' ? !!host[value] : !NON_HOST_TYPES[type];
- };
-
- /**
- * is.instance
- * Test if `value` is an instance of `constructor`.
- *
- * @param {*} value value to test
- * @return {Boolean} true if `value` is an instance of `constructor`
- * @api public
- */
-
- is.instance = is['instanceof'] = function (value, constructor) {
- return value instanceof constructor;
- };
-
- /**
- * is.nil / is.null
- * Test if `value` is null.
- *
- * @param {*} value value to test
- * @return {Boolean} true if `value` is null, false otherwise
- * @api public
- */
-
- is.nil = is['null'] = function (value) {
- return value === null;
- };
-
- /**
- * is.undef / is.undefined
- * Test if `value` is undefined.
- *
- * @param {*} value value to test
- * @return {Boolean} true if `value` is undefined, false otherwise
- * @api public
- */
-
- is.undef = is.undefined = function (value) {
- return typeof value === 'undefined';
- };
-
- /**
- * Test arguments.
- */
-
- /**
- * is.args
- * Test if `value` is an arguments object.
- *
- * @param {*} value value to test
- * @return {Boolean} true if `value` is an arguments object, false otherwise
- * @api public
- */
-
- is.args = is.arguments = function (value) {
- var isStandardArguments = toStr.call(value) === '[object Arguments]';
- var isOldArguments = !is.array(value) && is.arraylike(value) && is.object(value) && is.fn(value.callee);
- return isStandardArguments || isOldArguments;
- };
-
- /**
- * Test array.
- */
-
- /**
- * is.array
- * Test if 'value' is an array.
- *
- * @param {*} value value to test
- * @return {Boolean} true if `value` is an array, false otherwise
- * @api public
- */
-
- is.array = Array.isArray || function (value) {
- return toStr.call(value) === '[object Array]';
- };
-
- /**
- * is.arguments.empty
- * Test if `value` is an empty arguments object.
- *
- * @param {*} value value to test
- * @return {Boolean} true if `value` is an empty arguments object, false otherwise
- * @api public
- */
- is.args.empty = function (value) {
- return is.args(value) && value.length === 0;
- };
-
- /**
- * is.array.empty
- * Test if `value` is an empty array.
- *
- * @param {*} value value to test
- * @return {Boolean} true if `value` is an empty array, false otherwise
- * @api public
- */
- is.array.empty = function (value) {
- return is.array(value) && value.length === 0;
- };
-
- /**
- * is.arraylike
- * Test if `value` is an arraylike object.
- *
- * @param {*} value value to test
- * @return {Boolean} true if `value` is an arguments object, false otherwise
- * @api public
- */
-
- is.arraylike = function (value) {
- return !!value && !is.bool(value)
- && owns.call(value, 'length')
- && isFinite(value.length)
- && is.number(value.length)
- && value.length >= 0;
- };
-
- /**
- * Test boolean.
- */
-
- /**
- * is.bool
- * Test if `value` is a boolean.
- *
- * @param {*} value value to test
- * @return {Boolean} true if `value` is a boolean, false otherwise
- * @api public
- */
-
- is.bool = is['boolean'] = function (value) {
- return toStr.call(value) === '[object Boolean]';
- };
-
- /**
- * is.false
- * Test if `value` is false.
- *
- * @param {*} value value to test
- * @return {Boolean} true if `value` is false, false otherwise
- * @api public
- */
-
- is['false'] = function (value) {
- return is.bool(value) && Boolean(Number(value)) === false;
- };
-
- /**
- * is.true
- * Test if `value` is true.
- *
- * @param {*} value value to test
- * @return {Boolean} true if `value` is true, false otherwise
- * @api public
- */
-
- is['true'] = function (value) {
- return is.bool(value) && Boolean(Number(value)) === true;
- };
-
- /**
- * Test date.
- */
-
- /**
- * is.date
- * Test if `value` is a date.
- *
- * @param {*} value value to test
- * @return {Boolean} true if `value` is a date, false otherwise
- * @api public
- */
-
- is.date = function (value) {
- return toStr.call(value) === '[object Date]';
- };
-
- /**
- * is.date.valid
- * Test if `value` is a valid date.
- *
- * @param {*} value value to test
- * @returns {Boolean} true if `value` is a valid date, false otherwise
- */
- is.date.valid = function (value) {
- return is.date(value) && !isNaN(Number(value));
- };
-
- /**
- * Test element.
- */
-
- /**
- * is.element
- * Test if `value` is an html element.
- *
- * @param {*} value value to test
- * @return {Boolean} true if `value` is an HTML Element, false otherwise
- * @api public
- */
-
- is.element = function (value) {
- return value !== undefined
- && typeof HTMLElement !== 'undefined'
- && value instanceof HTMLElement
- && value.nodeType === 1;
- };
-
- /**
- * Test error.
- */
-
- /**
- * is.error
- * Test if `value` is an error object.
- *
- * @param {*} value value to test
- * @return {Boolean} true if `value` is an error object, false otherwise
- * @api public
- */
-
- is.error = function (value) {
- return toStr.call(value) === '[object Error]';
- };
-
- /**
- * Test function.
- */
-
- /**
- * is.fn / is.function (deprecated)
- * Test if `value` is a function.
- *
- * @param {*} value value to test
- * @return {Boolean} true if `value` is a function, false otherwise
- * @api public
- */
-
- is.fn = is['function'] = function (value) {
- var isAlert = typeof window !== 'undefined' && value === window.alert;
- if (isAlert) {
- return true;
- }
- var str = toStr.call(value);
- return str === '[object Function]' || str === '[object GeneratorFunction]' || str === '[object AsyncFunction]';
- };
-
- /**
- * Test number.
- */
-
- /**
- * is.number
- * Test if `value` is a number.
- *
- * @param {*} value value to test
- * @return {Boolean} true if `value` is a number, false otherwise
- * @api public
- */
-
- is.number = function (value) {
- return toStr.call(value) === '[object Number]';
- };
-
- /**
- * is.infinite
- * Test if `value` is positive or negative infinity.
- *
- * @param {*} value value to test
- * @return {Boolean} true if `value` is positive or negative Infinity, false otherwise
- * @api public
- */
- is.infinite = function (value) {
- return value === Infinity || value === -Infinity;
- };
-
- /**
- * is.decimal
- * Test if `value` is a decimal number.
- *
- * @param {*} value value to test
- * @return {Boolean} true if `value` is a decimal number, false otherwise
- * @api public
- */
-
- is.decimal = function (value) {
- return is.number(value) && !isActualNaN(value) && !is.infinite(value) && value % 1 !== 0;
- };
-
- /**
- * is.divisibleBy
- * Test if `value` is divisible by `n`.
- *
- * @param {Number} value value to test
- * @param {Number} n dividend
- * @return {Boolean} true if `value` is divisible by `n`, false otherwise
- * @api public
- */
-
- is.divisibleBy = function (value, n) {
- var isDividendInfinite = is.infinite(value);
- var isDivisorInfinite = is.infinite(n);
- var isNonZeroNumber = is.number(value) && !isActualNaN(value) && is.number(n) && !isActualNaN(n) && n !== 0;
- return isDividendInfinite || isDivisorInfinite || (isNonZeroNumber && value % n === 0);
- };
-
- /**
- * is.integer
- * Test if `value` is an integer.
- *
- * @param value to test
- * @return {Boolean} true if `value` is an integer, false otherwise
- * @api public
- */
-
- is.integer = is['int'] = function (value) {
- return is.number(value) && !isActualNaN(value) && value % 1 === 0;
- };
-
- /**
- * is.maximum
- * Test if `value` is greater than 'others' values.
- *
- * @param {Number} value value to test
- * @param {Array} others values to compare with
- * @return {Boolean} true if `value` is greater than `others` values
- * @api public
- */
-
- is.maximum = function (value, others) {
- if (isActualNaN(value)) {
- throw new TypeError('NaN is not a valid value');
- } else if (!is.arraylike(others)) {
- throw new TypeError('second argument must be array-like');
- }
- var len = others.length;
-
- while (--len >= 0) {
- if (value < others[len]) {
- return false;
- }
- }
-
- return true;
- };
-
- /**
- * is.minimum
- * Test if `value` is less than `others` values.
- *
- * @param {Number} value value to test
- * @param {Array} others values to compare with
- * @return {Boolean} true if `value` is less than `others` values
- * @api public
- */
-
- is.minimum = function (value, others) {
- if (isActualNaN(value)) {
- throw new TypeError('NaN is not a valid value');
- } else if (!is.arraylike(others)) {
- throw new TypeError('second argument must be array-like');
- }
- var len = others.length;
-
- while (--len >= 0) {
- if (value > others[len]) {
- return false;
- }
- }
-
- return true;
- };
-
- /**
- * is.nan
- * Test if `value` is not a number.
- *
- * @param {*} value value to test
- * @return {Boolean} true if `value` is not a number, false otherwise
- * @api public
- */
-
- is.nan = function (value) {
- return !is.number(value) || value !== value;
- };
-
- /**
- * is.even
- * Test if `value` is an even number.
- *
- * @param {Number} value value to test
- * @return {Boolean} true if `value` is an even number, false otherwise
- * @api public
- */
-
- is.even = function (value) {
- return is.infinite(value) || (is.number(value) && value === value && value % 2 === 0);
- };
-
- /**
- * is.odd
- * Test if `value` is an odd number.
- *
- * @param {Number} value value to test
- * @return {Boolean} true if `value` is an odd number, false otherwise
- * @api public
- */
-
- is.odd = function (value) {
- return is.infinite(value) || (is.number(value) && value === value && value % 2 !== 0);
- };
-
- /**
- * is.ge
- * Test if `value` is greater than or equal to `other`.
- *
- * @param {Number} value value to test
- * @param {Number} other value to compare with
- * @return {Boolean}
- * @api public
- */
-
- is.ge = function (value, other) {
- if (isActualNaN(value) || isActualNaN(other)) {
- throw new TypeError('NaN is not a valid value');
- }
- return !is.infinite(value) && !is.infinite(other) && value >= other;
- };
-
- /**
- * is.gt
- * Test if `value` is greater than `other`.
- *
- * @param {Number} value value to test
- * @param {Number} other value to compare with
- * @return {Boolean}
- * @api public
- */
-
- is.gt = function (value, other) {
- if (isActualNaN(value) || isActualNaN(other)) {
- throw new TypeError('NaN is not a valid value');
- }
- return !is.infinite(value) && !is.infinite(other) && value > other;
- };
-
- /**
- * is.le
- * Test if `value` is less than or equal to `other`.
- *
- * @param {Number} value value to test
- * @param {Number} other value to compare with
- * @return {Boolean} if 'value' is less than or equal to 'other'
- * @api public
- */
-
- is.le = function (value, other) {
- if (isActualNaN(value) || isActualNaN(other)) {
- throw new TypeError('NaN is not a valid value');
- }
- return !is.infinite(value) && !is.infinite(other) && value <= other;
- };
-
- /**
- * is.lt
- * Test if `value` is less than `other`.
- *
- * @param {Number} value value to test
- * @param {Number} other value to compare with
- * @return {Boolean} if `value` is less than `other`
- * @api public
- */
-
- is.lt = function (value, other) {
- if (isActualNaN(value) || isActualNaN(other)) {
- throw new TypeError('NaN is not a valid value');
- }
- return !is.infinite(value) && !is.infinite(other) && value < other;
- };
-
- /**
- * is.within
- * Test if `value` is within `start` and `finish`.
- *
- * @param {Number} value value to test
- * @param {Number} start lower bound
- * @param {Number} finish upper bound
- * @return {Boolean} true if 'value' is is within 'start' and 'finish'
- * @api public
- */
- is.within = function (value, start, finish) {
- if (isActualNaN(value) || isActualNaN(start) || isActualNaN(finish)) {
- throw new TypeError('NaN is not a valid value');
- } else if (!is.number(value) || !is.number(start) || !is.number(finish)) {
- throw new TypeError('all arguments must be numbers');
- }
- var isAnyInfinite = is.infinite(value) || is.infinite(start) || is.infinite(finish);
- return isAnyInfinite || (value >= start && value <= finish);
- };
-
- /**
- * Test object.
- */
-
- /**
- * is.object
- * Test if `value` is an object.
- *
- * @param {*} value value to test
- * @return {Boolean} true if `value` is an object, false otherwise
- * @api public
- */
- is.object = function (value) {
- return toStr.call(value) === '[object Object]';
- };
-
- /**
- * is.primitive
- * Test if `value` is a primitive.
- *
- * @param {*} value value to test
- * @return {Boolean} true if `value` is a primitive, false otherwise
- * @api public
- */
- is.primitive = function isPrimitive(value) {
- if (!value) {
- return true;
- }
- if (typeof value === 'object' || is.object(value) || is.fn(value) || is.array(value)) {
- return false;
- }
- return true;
- };
-
- /**
- * is.hash
- * Test if `value` is a hash - a plain object literal.
- *
- * @param {*} value value to test
- * @return {Boolean} true if `value` is a hash, false otherwise
- * @api public
- */
-
- is.hash = function (value) {
- return is.object(value) && value.constructor === Object && !value.nodeType && !value.setInterval;
- };
-
- /**
- * Test regexp.
- */
-
- /**
- * is.regexp
- * Test if `value` is a regular expression.
- *
- * @param {*} value value to test
- * @return {Boolean} true if `value` is a regexp, false otherwise
- * @api public
- */
-
- is.regexp = function (value) {
- return toStr.call(value) === '[object RegExp]';
- };
-
- /**
- * Test string.
- */
-
- /**
- * is.string
- * Test if `value` is a string.
- *
- * @param {*} value value to test
- * @return {Boolean} true if 'value' is a string, false otherwise
- * @api public
- */
-
- is.string = function (value) {
- return toStr.call(value) === '[object String]';
- };
-
- /**
- * Test base64 string.
- */
-
- /**
- * is.base64
- * Test if `value` is a valid base64 encoded string.
- *
- * @param {*} value value to test
- * @return {Boolean} true if 'value' is a base64 encoded string, false otherwise
- * @api public
- */
-
- is.base64 = function (value) {
- return is.string(value) && (!value.length || base64Regex.test(value));
- };
-
- /**
- * Test base64 string.
- */
-
- /**
- * is.hex
- * Test if `value` is a valid hex encoded string.
- *
- * @param {*} value value to test
- * @return {Boolean} true if 'value' is a hex encoded string, false otherwise
- * @api public
- */
-
- is.hex = function (value) {
- return is.string(value) && (!value.length || hexRegex.test(value));
- };
-
- /**
- * is.symbol
- * Test if `value` is an ES6 Symbol
- *
- * @param {*} value value to test
- * @return {Boolean} true if `value` is a Symbol, false otherise
- * @api public
- */
-
- is.symbol = function (value) {
- return typeof Symbol === 'function' && toStr.call(value) === '[object Symbol]' && typeof symbolValueOf.call(value) === 'symbol';
- };
-
- /**
- * is.bigint
- * Test if `value` is an ES-proposed BigInt
- *
- * @param {*} value value to test
- * @return {Boolean} true if `value` is a BigInt, false otherise
- * @api public
- */
-
- is.bigint = function (value) {
- // eslint-disable-next-line valid-typeof
- return typeof BigInt === 'function' && toStr.call(value) === '[object BigInt]' && typeof bigIntValueOf.call(value) === 'bigint';
- };
-
- var is_1 = is;
-
- /**
- * toString ref.
- */
-
- var toString$1 = Object.prototype.toString;
-
- /**
- * Return the type of `val`.
- *
- * @param {Mixed} val
- * @return {String}
- * @api public
- */
-
- var componentType = function(val){
- switch (toString$1.call(val)) {
- case '[object Function]': return 'function';
- case '[object Date]': return 'date';
- case '[object RegExp]': return 'regexp';
- case '[object Arguments]': return 'arguments';
- case '[object Array]': return 'array';
- case '[object String]': return 'string';
- }
-
- if (val === null) return 'null';
- if (val === undefined) return 'undefined';
- if (val && val.nodeType === 1) return 'element';
- if (val === Object(val)) return 'object';
-
- return typeof val;
- };
-
- /**
- * Global Names
- */
-
- var globals = /\b(Array|Date|Object|Math|JSON)\b/g;
-
- /**
- * Return immediate identifiers parsed from `str`.
- *
- * @param {String} str
- * @param {String|Function} map function or prefix
- * @return {Array}
- * @api public
- */
-
- var componentProps = function(str, fn){
- var p = unique(props(str));
- if (fn && 'string' == typeof fn) fn = prefixed(fn);
- if (fn) return map(str, p, fn);
- return p;
- };
-
- /**
- * Return immediate identifiers in `str`.
- *
- * @param {String} str
- * @return {Array}
- * @api private
- */
-
- function props(str) {
- return str
- .replace(/\.\w+|\w+ *\(|"[^"]*"|'[^']*'|\/([^/]+)\//g, '')
- .replace(globals, '')
- .match(/[a-zA-Z_]\w*/g)
- || [];
- }
-
- /**
- * Return `str` with `props` mapped with `fn`.
- *
- * @param {String} str
- * @param {Array} props
- * @param {Function} fn
- * @return {String}
- * @api private
- */
-
- function map(str, props, fn) {
- var re = /\.\w+|\w+ *\(|"[^"]*"|'[^']*'|\/([^/]+)\/|[a-zA-Z_]\w*/g;
- return str.replace(re, function(_){
- if ('(' == _[_.length - 1]) return fn(_);
- if (!~props.indexOf(_)) return _;
- return fn(_);
- });
- }
-
- /**
- * Return unique array.
- *
- * @param {Array} arr
- * @return {Array}
- * @api private
- */
-
- function unique(arr) {
- var ret = [];
-
- for (var i = 0; i < arr.length; i++) {
- if (~ret.indexOf(arr[i])) continue;
- ret.push(arr[i]);
- }
-
- return ret;
- }
-
- /**
- * Map with prefix `str`.
- */
-
- function prefixed(str) {
- return function(_){
- return str + _;
- };
- }
-
- /**
- * Module Dependencies
- */
-
- var expr;
- try {
- expr = componentProps;
- } catch(e) {
- expr = componentProps;
- }
-
- /**
- * Expose `toFunction()`.
- */
-
- var toFunction_1 = toFunction;
-
- /**
- * Convert `obj` to a `Function`.
- *
- * @param {Mixed} obj
- * @return {Function}
- * @api private
- */
-
- function toFunction(obj) {
- switch ({}.toString.call(obj)) {
- case '[object Object]':
- return objectToFunction(obj);
- case '[object Function]':
- return obj;
- case '[object String]':
- return stringToFunction(obj);
- case '[object RegExp]':
- return regexpToFunction(obj);
- default:
- return defaultToFunction(obj);
- }
- }
-
- /**
- * Default to strict equality.
- *
- * @param {Mixed} val
- * @return {Function}
- * @api private
- */
-
- function defaultToFunction(val) {
- return function(obj){
- return val === obj;
- };
- }
-
- /**
- * Convert `re` to a function.
- *
- * @param {RegExp} re
- * @return {Function}
- * @api private
- */
-
- function regexpToFunction(re) {
- return function(obj){
- return re.test(obj);
- };
- }
-
- /**
- * Convert property `str` to a function.
- *
- * @param {String} str
- * @return {Function}
- * @api private
- */
-
- function stringToFunction(str) {
- // immediate such as "> 20"
- if (/^ *\W+/.test(str)) return new Function('_', 'return _ ' + str);
-
- // properties such as "name.first" or "age > 18" or "age > 18 && age < 36"
- return new Function('_', 'return ' + get(str));
- }
-
- /**
- * Convert `object` to a function.
- *
- * @param {Object} object
- * @return {Function}
- * @api private
- */
-
- function objectToFunction(obj) {
- var match = {};
- for (var key in obj) {
- match[key] = typeof obj[key] === 'string'
- ? defaultToFunction(obj[key])
- : toFunction(obj[key]);
- }
- return function(val){
- if (typeof val !== 'object') return false;
- for (var key in match) {
- if (!(key in val)) return false;
- if (!match[key](val[key])) return false;
- }
- return true;
- };
- }
-
- /**
- * Built the getter function. Supports getter style functions
- *
- * @param {String} str
- * @return {String}
- * @api private
- */
-
- function get(str) {
- var props = expr(str);
- if (!props.length) return '_.' + str;
-
- var val, i, prop;
- for (i = 0; i < props.length; i++) {
- prop = props[i];
- val = '_.' + prop;
- val = "('function' == typeof " + val + " ? " + val + "() : " + val + ")";
-
- // mimic negative lookbehind to avoid problems with nested properties
- str = stripNested(prop, str, val);
- }
-
- return str;
- }
-
- /**
- * Mimic negative lookbehind to avoid problems with nested properties.
- *
- * See: http://blog.stevenlevithan.com/archives/mimic-lookbehind-javascript
- *
- * @param {String} prop
- * @param {String} str
- * @param {String} val
- * @return {String}
- * @api private
- */
-
- function stripNested (prop, str, val) {
- return str.replace(new RegExp('(\\.)?' + prop, 'g'), function($0, $1) {
- return $1 ? $0 : val;
- });
- }
-
- /**
- * Module dependencies.
- */
-
- try {
- var type$1 = componentType;
- } catch (err) {
- var type$1 = componentType;
- }
-
-
-
- /**
- * HOP reference.
- */
-
- var has = Object.prototype.hasOwnProperty;
-
- /**
- * Iterate the given `obj` and invoke `fn(val, i)`
- * in optional context `ctx`.
- *
- * @param {String|Array|Object} obj
- * @param {Function} fn
- * @param {Object} [ctx]
- * @api public
- */
-
- var componentEach = function(obj, fn, ctx){
- fn = toFunction_1(fn);
- ctx = ctx || this;
- switch (type$1(obj)) {
- case 'array':
- return array(obj, fn, ctx);
- case 'object':
- if ('number' == typeof obj.length) return array(obj, fn, ctx);
- return object(obj, fn, ctx);
- case 'string':
- return string(obj, fn, ctx);
- }
- };
-
- /**
- * Iterate string chars.
- *
- * @param {String} obj
- * @param {Function} fn
- * @param {Object} ctx
- * @api private
- */
-
- function string(obj, fn, ctx) {
- for (var i = 0; i < obj.length; ++i) {
- fn.call(ctx, obj.charAt(i), i);
- }
- }
-
- /**
- * Iterate object keys.
- *
- * @param {Object} obj
- * @param {Function} fn
- * @param {Object} ctx
- * @api private
- */
-
- function object(obj, fn, ctx) {
- for (var key in obj) {
- if (has.call(obj, key)) {
- fn.call(ctx, key, obj[key]);
- }
- }
- }
-
- /**
- * Iterate array-ish.
- *
- * @param {Array|Object} obj
- * @param {Function} fn
- * @param {Object} ctx
- * @api private
- */
-
- function array(obj, fn, ctx) {
- for (var i = 0; i < obj.length; ++i) {
- fn.call(ctx, obj[i], i);
- }
- }
-
- var GA = /*#__PURE__*/function () {
- function GA(config) {
- _classCallCheck(this, GA);
-
- this.trackingID = config.trackingID;
- this.sendUserId = config.sendUserId || false;
- this.dimensions = config.dimensions || [];
- this.metrics = config.metrics || [];
- this.contentGroupings = config.contentGroupings || [];
- this.nonInteraction = config.nonInteraction || false;
- this.anonymizeIp = config.anonymizeIp || false;
- this.useGoogleAmpClientId = config.useGoogleAmpClientId || false;
- this.domain = config.domain || "auto";
- this.doubleClick = config.doubleClick || false;
- this.enhancedEcommerce = config.enhancedEcommerce || false;
- this.enhancedLinkAttribution = config.enhancedLinkAttribution || false;
- this.includeSearch = config.includeSearch || false;
- this.setAllMappedProps = config.setAllMappedProps || true;
- this.siteSpeedSampleRate = config.siteSpeedSampleRate || 1;
- this.sampleRate = config.sampleRate || 100;
- this.trackCategorizedPages = config.trackCategorizedPages || true;
- this.trackNamedPages = config.trackNamedPages || true;
- this.optimizeContainerId = config.optimize || "";
- this.resetCustomDimensionsOnPage = config.resetCustomDimensionsOnPage || [];
- this.enhancedEcommerceLoaded = 0;
- this.name = "GA";
- this.eventWithCategoryFieldProductScoped = ["product clicked", "product added", "product viewed", "product removed"];
- }
-
- _createClass(GA, [{
- key: "loadScript",
- value: function loadScript() {
- ScriptLoader("google-analytics", "https://www.google-analytics.com/analytics.js");
- }
- }, {
- key: "init",
- value: function init() {
- var _this = this;
-
- this.pageCalled = false;
- this.dimensionsArray = {};
- this.dimensions.forEach(function (element) {
- _this.dimensionsArray[element.from] = element.to;
- });
- this.metricsArray = {};
- this.metrics.forEach(function (element) {
- _this.metricsArray[element.from] = element.to;
- });
- this.contentGroupingsArray = {};
- this.contentGroupings.forEach(function (element) {
- _this.contentGroupingsArray[element.from] = element.to;
- });
- window.GoogleAnalyticsObject = "ga";
-
- window.ga = window.ga || function a() {
- window.ga.q = window.ga.q || [];
- window.ga.q.push(arguments);
- };
-
- window.ga.l = new Date().getTime();
- this.loadScript(); // create ga with these properties. if the properties are empty it will take default values.
-
- var config = {
- cookieDomain: this.domain || GA.prototype.defaults.domain,
- siteSpeedSampleRate: this.siteSpeedSampleRate,
- sampleRate: this.sampleRate,
- allowLinker: true,
- useAmpClientId: this.useGoogleAmpClientId
- };
- window.ga("create", this.trackingID, config);
-
- if (this.optimizeContainerId) {
- window.ga("require", this.optimizeContainerId);
- } // ecommerce is required
-
-
- if (!this.ecommerce) {
- window.ga("require", "ecommerce");
- this.ecommerce = true;
- } // this is to display advertising
-
-
- if (this.doubleClick) {
- window.ga("require", "displayfeatures");
- } // https://support.google.com/analytics/answer/2558867?hl=en
-
-
- if (this.enhancedLinkAttribution) {
- window.ga("require", "linkid");
- } // a warning is in ga debugger if anonymize is false after initialization
-
-
- if (this.anonymizeIp) {
- window.ga("set", "anonymizeIp", true);
- }
-
- logger.debug("===in init GA===");
- }
- }, {
- key: "identify",
- value: function identify(rudderElement) {
- // send global id
- if (this.sendUserId && rudderElement.message.userId) {
- window.ga("set", "userId", rudderElement.message.userId);
- } // custom dimensions and metrics
-
-
- var custom = this.metricsFunction(rudderElement.message.context.traits, this.dimensionsArray, this.metricsArray, this.contentGroupingsArray);
-
- if (Object.keys(custom).length) {
- window.ga("set", custom);
- }
-
- logger.debug("in GoogleAnalyticsManager identify");
- }
- }, {
- key: "track",
- value: function track(rudderElement) {
- var self = this; // Ecommerce events
-
- var _rudderElement$messag = rudderElement.message,
- event = _rudderElement$messag.event,
- properties = _rudderElement$messag.properties,
- name = _rudderElement$messag.name;
- var options = this.extractCheckoutOptions(rudderElement);
- var props = rudderElement.message.properties;
- var products = properties.products;
- var total = properties.total;
- var data = {};
- var eventCategory = rudderElement.message.properties.category;
- var orderId = properties.order_id;
- var eventAction = event || name || "";
- var eventLabel = rudderElement.message.properties.label;
- var eventValue = "";
- var payload;
- var campaign = rudderElement.message.context.campaign;
- var params;
- var filters;
- var sorts;
-
- if (event === "Order Completed" && !this.enhancedEcommerce) {
- // order_id is required
- if (!orderId) return; // add transaction
-
- window.ga("ecommerce:addTransaction", {
- affiliation: properties.affiliation,
- shipping: properties.shipping,
- revenue: total,
- tax: properties.tax,
- id: orderId,
- currency: properties.currency
- }); // products added
-
- products.forEach(function (product) {
- var productTrack = self.createProductTrack(rudderElement, product);
- window.ga("ecommerce:addItem", {
- category: productTrack.properties.category,
- quantity: productTrack.properties.quantity,
- price: productTrack.properties.price,
- name: productTrack.properties.name,
- sku: productTrack.properties.sku,
- id: orderId,
- currency: productTrack.properties.currency
- });
- });
- window.ga("ecommerce:send");
- } // enhanced ecommerce events
- else if (this.enhancedEcommerce) {
- switch (event) {
- case "Checkout Started":
- case "Checkout Step Viewed":
- case "Order Updated":
- this.loadEnhancedEcommerce(rudderElement);
- componentEach(products, function (product) {
- var productTrack = self.createProductTrack(rudderElement, product);
- productTrack = {
- message: productTrack
- };
- self.enhancedEcommerceTrackProduct(productTrack);
- });
- window.ga("ec:setAction", "checkout", {
- step: properties.step || 1,
- option: options || undefined
- });
- this.pushEnhancedEcommerce(rudderElement);
- break;
-
- case "Checkout Step Completed":
- if (!props.step) return;
- params = {
- step: props.step || 1,
- option: options || undefined
- };
- this.loadEnhancedEcommerce(rudderElement);
- window.ga("ec:setAction", "checkout_option", params);
- window.ga("send", "event", "Checkout", "Option");
- break;
-
- case "Order Completed":
- total = rudderElement.message.properties.total || rudderElement.message.properties.revenue || 0;
- if (!orderId) return;
- this.loadEnhancedEcommerce(rudderElement);
- componentEach(products, function (product) {
- var productTrack = self.createProductTrack(rudderElement, product);
- productTrack = {
- message: productTrack
- };
- self.enhancedEcommerceTrackProduct(productTrack);
- });
- window.ga("ec:setAction", "purchase", {
- id: orderId,
- affiliation: props.affiliation,
- revenue: total,
- tax: props.tax,
- shipping: props.shipping,
- coupon: props.coupon
- });
- this.pushEnhancedEcommerce(rudderElement);
- break;
-
- case "Order Refunded":
- if (!orderId) return;
- this.loadEnhancedEcommerce(rudderElement);
- componentEach(products, function (product) {
- var track = {
- properties: product
- };
- window.ga("ec:addProduct", {
- id: track.properties.product_id || track.properties.id || track.properties.sku,
- quantity: track.properties.quantity
- });
- });
- window.ga("ec:setAction", "refund", {
- id: orderId
- });
- this.pushEnhancedEcommerce(rudderElement);
- break;
-
- case "Product Added":
- this.loadEnhancedEcommerce(rudderElement);
- this.enhancedEcommerceTrackProductAction(rudderElement, "add", null, this.dimensions, this.metrics, this.contentGroupings);
- this.pushEnhancedEcommerce(rudderElement);
- break;
-
- case "Product Removed":
- this.loadEnhancedEcommerce(rudderElement);
- this.enhancedEcommerceTrackProductAction(rudderElement, "remove", null, this.dimensions, this.metrics, this.contentGroupings);
- this.pushEnhancedEcommerce(rudderElement);
- break;
-
- case "Product Viewed":
- this.loadEnhancedEcommerce(rudderElement);
- if (props.list) data.list = props.list;
- this.enhancedEcommerceTrackProductAction(rudderElement, "detail", data, this.dimensions, this.metrics, this.contentGroupings);
- this.pushEnhancedEcommerce(rudderElement);
- break;
-
- case "Product Clicked":
- this.loadEnhancedEcommerce(rudderElement);
- if (props.list) data.list = props.list;
- this.enhancedEcommerceTrackProductAction(rudderElement, "click", data, this.dimensions, this.metrics, this.contentGroupings);
- this.pushEnhancedEcommerce(rudderElement);
- break;
-
- case "Promotion Viewed":
- this.loadEnhancedEcommerce(rudderElement);
- window.ga("ec:addPromo", {
- id: props.promotionId || props.id,
- name: props.name,
- creative: props.creative,
- position: props.position
- });
- this.pushEnhancedEcommerce(rudderElement);
- break;
-
- case "Promotion Clicked":
- this.loadEnhancedEcommerce(rudderElement);
- window.ga("ec:addPromo", {
- id: props.promotionId || props.id,
- name: props.name,
- creative: props.creative,
- position: props.position
- });
- window.ga("ec:setAction", "promo_click", {});
- this.pushEnhancedEcommerce(rudderElement);
- break;
-
- case "Product List Viewed":
- this.loadEnhancedEcommerce(rudderElement);
- componentEach(products, function (product) {
- var item = {
- properties: product
- };
- if (!(item.properties.product_id || item.properties.sku) && !item.properties.name) return;
- var impressionObj = {
- id: item.properties.product_id || item.properties.sku,
- name: item.properties.name,
- category: item.properties.category || props.category,
- list: props.list_id || props.category || "products",
- brand: item.properties.band,
- variant: item.properties.variant,
- price: item.properties.price,
- position: self.getProductPosition(item, products)
- };
- impressionObj = _objectSpread2({
- impressionObj: impressionObj
- }, self.metricsFunction(item.properties, self.dimensionsArray, self.metricsArray, self.contentGroupingsArray));
- Object.keys(impressionObj).forEach(function (key) {
- if (impressionObj[key] === undefined) delete impressionObj[key];
- });
- window.ga("ec:addImpression", impressionObj);
- });
- this.pushEnhancedEcommerce(rudderElement);
- break;
-
- case "Product List Filtered":
- props.filters = props.filters || [];
- props.sorters = props.sorters || [];
- filters = props.filters.map(function (obj) {
- return "".concat(obj.type, ":").concat(obj.value);
- }).join();
- sorts = props.sorters.map(function (obj) {
- return "".concat(obj.type, ":").concat(obj.value);
- }).join();
- this.loadEnhancedEcommerce(rudderElement);
- componentEach(products, function (product) {
- var item = {
- properties: product
- };
-
- if (!(item.properties.product_id || item.properties.sku) && !item.properties.name) {
- return;
- }
-
- var impressionObj = {
- id: item.properties.product_id || item.sku,
- name: item.name,
- category: item.category || props.category,
- list: props.list_id || props.category || "search results",
- brand: props.brand,
- variant: "".concat(filters, "::").concat(sorts),
- price: item.price,
- position: self.getProductPosition(item, products)
- };
- impressionObj = _objectSpread2({
- impressionObj: impressionObj
- }, self.metricsFunction(item.properties, self.dimensionsArray, self.metricsArray, self.contentGroupingsArray));
- Object.keys(impressionObj).forEach(function (key) {
- if (impressionObj[key] === undefined) delete impressionObj[key];
- });
- window.ga("ec:addImpression", impressionObj);
- });
- this.pushEnhancedEcommerce(rudderElement);
- break;
-
- default:
- if (rudderElement.message.properties) {
- eventValue = rudderElement.message.properties.value ? rudderElement.message.properties.value : rudderElement.message.properties.revenue;
- }
-
- payload = {
- eventCategory: eventCategory || "All",
- eventAction: eventAction,
- eventLabel: eventLabel,
- eventValue: this.formatValue(eventValue),
- // Allow users to override their nonInteraction integration setting for any single particluar event.
- nonInteraction: rudderElement.message.properties.nonInteraction !== undefined ? !!rudderElement.message.properties.nonInteraction : !!this.nonInteraction
- };
-
- if (campaign) {
- if (campaign.name) payload.campaignName = campaign.name;
- if (campaign.source) payload.campaignSource = campaign.source;
- if (campaign.medium) payload.campaignMedium = campaign.medium;
- if (campaign.content) payload.campaignContent = campaign.content;
- if (campaign.term) payload.campaignKeyword = campaign.term;
- }
-
- payload = _objectSpread2({
- payload: payload
- }, this.setCustomDimenionsAndMetrics(rudderElement.message.properties));
- window.ga("send", "event", payload.payload);
- logger.debug("in GoogleAnalyticsManager track");
- }
- } else {
- if (rudderElement.message.properties) {
- eventValue = rudderElement.message.properties.value ? rudderElement.message.properties.value : rudderElement.message.properties.revenue;
- }
-
- payload = {
- eventCategory: eventCategory || "All",
- eventAction: eventAction,
- eventLabel: eventLabel,
- eventValue: this.formatValue(eventValue),
- // Allow users to override their nonInteraction integration setting for any single particluar event.
- nonInteraction: rudderElement.message.properties.nonInteraction !== undefined ? !!rudderElement.message.properties.nonInteraction : !!this.nonInteraction
- };
-
- if (campaign) {
- if (campaign.name) payload.campaignName = campaign.name;
- if (campaign.source) payload.campaignSource = campaign.source;
- if (campaign.medium) payload.campaignMedium = campaign.medium;
- if (campaign.content) payload.campaignContent = campaign.content;
- if (campaign.term) payload.campaignKeyword = campaign.term;
- }
-
- payload = _objectSpread2({
- payload: payload
- }, this.setCustomDimenionsAndMetrics(rudderElement.message.properties));
- window.ga("send", "event", payload.payload);
- logger.debug("in GoogleAnalyticsManager track");
- }
- }
- }, {
- key: "page",
- value: function page(rudderElement) {
- logger.debug("in GoogleAnalyticsManager page");
- var category = rudderElement.message.properties.category;
- var eventProperties = rudderElement.message.properties;
- var name;
-
- if (rudderElement.message.properties.category && rudderElement.message.name) {
- name = "".concat(rudderElement.message.properties.category, " ").concat(rudderElement.message.name);
- } else if (!rudderElement.message.properties.category && !rudderElement.message.name) {
- name = "";
- } else {
- name = rudderElement.message.name || rudderElement.message.properties.category;
- }
-
- var campaign = rudderElement.message.context.campaign || {};
- var pageview = {};
- var pagePath = this.path(eventProperties, this.includeSearch);
- var pageReferrer = rudderElement.message.properties.referrer || "";
- var pageTitle;
- if (!rudderElement.message.properties.category && !rudderElement.message.name) pageTitle = eventProperties.title;else if (!rudderElement.message.properties.category) pageTitle = rudderElement.message.name;else if (!rudderElement.message.name) pageTitle = rudderElement.message.properties.category;else pageTitle = name;
- pageview.page = pagePath;
- pageview.title = pageTitle;
- pageview.location = eventProperties.url;
-
- if (campaign) {
- if (campaign.name) pageview.campaignName = campaign.name;
- if (campaign.source) pageview.campaignSource = campaign.source;
- if (campaign.medium) pageview.campaignMedium = campaign.medium;
- if (campaign.content) pageview.campaignContent = campaign.content;
- if (campaign.term) pageview.campaignKeyword = campaign.term;
- }
-
- var resetCustomDimensions = {};
-
- for (var i = 0; i < this.resetCustomDimensionsOnPage.length; i += 1) {
- var property = this.resetCustomDimensionsOnPage[i].resetCustomDimensionsOnPage;
-
- if (this.dimensionsArray[property]) {
- resetCustomDimensions[this.dimensionsArray[property]] = null;
- }
- }
-
- window.ga("set", resetCustomDimensions); // adds more properties to pageview which will be sent
-
- pageview = _objectSpread2({}, pageview, {}, this.setCustomDimenionsAndMetrics(eventProperties));
- var payload = {
- page: pagePath,
- title: pageTitle
- };
- logger.debug(pageReferrer);
- logger.debug(document.referrer);
- if (pageReferrer !== document.referrer) payload.referrer = pageReferrer;
- window.ga("set", payload);
- if (this.pageCalled) delete pageview.location;
- window.ga("send", "pageview", pageview); // categorized pages
-
- if (category && this.trackCategorizedPages) {
- this.track(rudderElement, {
- nonInteraction: 1
- });
- } // named pages
-
-
- if (name && this.trackNamedPages) {
- this.track(rudderElement, {
- nonInteraction: 1
- });
- }
-
- this.pageCalled = true;
- }
- }, {
- key: "isLoaded",
- value: function isLoaded() {
- logger.debug("in GA isLoaded");
- return !!window.gaplugins;
- }
- }, {
- key: "isReady",
- value: function isReady() {
- return !!window.gaplugins;
- }
- /**
- *
- *
- * @param {} obj incoming properties
- * @param {} dimensions the dimension mapping which is entered by the user in the ui. Eg: firstName : dimension1
- * @param {} metrics the metrics mapping which is entered by the user in the ui. Eg: age : metrics1
- * @param {} contentGroupings the contentGrouping mapping which is entered by the user in the ui. Eg: section : contentGrouping1
- *
- * This function maps these dimensions,metrics and contentGroupings with the incoming properties to send it to GA where the user has to set the corresponding dimension/metric/content group.
- * For example if:
- * if obj -> {age: 24}
- * metrics -> {age: metric1}
- * then the function will return {metric1:24} and it will be shown sent to GA if metric1 is set there.
- *
- * if obj -> {age: 24}
- * metrics - {revenue: metric2}
- * then the function will return {} as there is no corresponding mapping of metric.
- *
- */
-
- }, {
- key: "metricsFunction",
- value: function metricsFunction(obj, dimensions, metrics, contentGroupings) {
- var ret = {};
- componentEach([metrics, dimensions, contentGroupings], function (group) {
- componentEach(group, function (prop, key) {
- var value = obj[prop];
- if (is_1["boolean"](value)) value = value.toString();
- if (value || value === 0) ret[key] = value;
- });
- });
- return ret;
- }
- }, {
- key: "formatValue",
- value: function formatValue(value) {
- if (!value || value < 0) return 0;
- return Math.round(value);
- }
- /**
- * @param {} props
- * @param {} inputs
- */
-
- }, {
- key: "setCustomDimenionsAndMetrics",
- value: function setCustomDimenionsAndMetrics(props) {
- var ret = {};
- var custom = this.metricsFunction(props, this.dimensionsArray, this.metricsArray, this.contentGroupingsArray);
-
- if (Object.keys(custom).length) {
- if (this.setAllMappedProps) {
- window.ga("set", custom);
- } else {
- Object.keys(custom).forEach(function (key) {
- ret[key] = custom[key];
- }); // each(custom, (key, value) => {
- // ret[key] = value;
- // });
- }
- }
-
- return ret;
- }
- /**
- * Return the path based on `properties` and `options`
- *
- * @param {} properties
- * @param {} includeSearch
- */
-
- }, {
- key: "path",
- value: function path(properties, includeSearch) {
- var str = properties.path;
-
- if (properties) {
- if (includeSearch && properties.search) {
- str += properties.search;
- }
- }
-
- return str;
- }
- /**
- * Creates a track out of product properties
- * @param {} rudderElement
- * @param {} properties
- */
-
- }, {
- key: "createProductTrack",
- value: function createProductTrack(rudderElement, properties) {
- var props = properties || {};
- props.currency = properties.currency || rudderElement.message.properties.currency;
- return {
- properties: props
- };
- }
- /**
- * Loads ec.js (unless already loaded)
- * @param {} rudderElement
- * @param {} a
- */
-
- }, {
- key: "loadEnhancedEcommerce",
- value: function loadEnhancedEcommerce(rudderElement) {
- if (this.enhancedEcommerceLoaded === 0) {
- window.ga("require", "ec");
- this.enhancedEcommerceLoaded = 1;
- }
-
- window.ga("set", "&cu", rudderElement.message.properties.currency);
- }
- /**
- * helper class to not repeat `ec:addProduct`
- * @param {} rudderElement
- * @param {} inputs
- */
-
- }, {
- key: "enhancedEcommerceTrackProduct",
- value: function enhancedEcommerceTrackProduct(rudderElement) {
- var props = rudderElement.message.properties;
- var product = {
- id: props.product_id || props.id || props.sku,
- name: props.name,
- category: props.category,
- quantity: props.quantity,
- price: props.price,
- brand: props.brand,
- variant: props.variant,
- currency: props.currency
- };
-
- if (props.position != null) {
- product.position = Math.round(props.position);
- }
-
- var coupon = props.coupon;
- if (coupon) product.coupon = coupon;
- product = _objectSpread2({
- product: product
- }, this.metricsFunction(props, this.dimensionsArray, this.metricsArray, this.contentGroupingsArray));
- window.ga("ec:addProduct", product.product);
- }
- /**
- * set action with data
- * @param {} rudderElement
- * @param {} action
- * @param {} data
- * @param {} inputs
- */
-
- }, {
- key: "enhancedEcommerceTrackProductAction",
- value: function enhancedEcommerceTrackProductAction(rudderElement, action, data) {
- this.enhancedEcommerceTrackProduct(rudderElement);
- window.ga("ec:setAction", action, data || {});
- }
- /**
- * @param {} rudderElement
- * @param {} inputs
- */
-
- }, {
- key: "pushEnhancedEcommerce",
- value: function pushEnhancedEcommerce(rudderElement) {
- var _window$ga;
-
- var args = rejectArr(["send", "event", rudderElement.message.properties.category || "EnhancedEcommerce", rudderElement.message.event || "Action not defined", rudderElement.message.properties.label, _objectSpread2({
- nonInteraction: 1
- }, this.setCustomDimenionsAndMetrics(rudderElement.message.properties))]);
- var event = rudderElement.message.event;
- event = event.toLowerCase();
-
- if (this.eventWithCategoryFieldProductScoped.includes(event)) {
- args[2] = "EnhancedEcommerce";
- }
-
- (_window$ga = window.ga).apply.apply(_window$ga, [window].concat(_toConsumableArray(args)));
- }
- /**
- * @param {} item
- * @param {} products
- */
-
- }, {
- key: "getProductPosition",
- value: function getProductPosition(item, products) {
- var position = item.properties.position;
-
- if (typeof position !== "undefined" && !Number.isNaN(Number(position)) && Number(position) > -1) {
- return position;
- }
-
- return products.map(function (x) {
- return x.product_id;
- }).indexOf(item.properties.product_id) + 1;
- }
- /**
- *extracts checkout options
- * @param {} rudderElement
- */
-
- }, {
- key: "extractCheckoutOptions",
- value: function extractCheckoutOptions(rudderElement) {
- var options = [rudderElement.message.properties.paymentMethod, rudderElement.message.properties.shippingMethod]; // remove all nulls and join with commas.
-
- var valid = rejectArr(options);
- return valid.length > 0 ? valid.join(", ") : null;
- }
- }]);
-
- return GA;
- }();
-
- var index$1 = GA ;
-
- var Hotjar = /*#__PURE__*/function () {
- function Hotjar(config) {
- _classCallCheck(this, Hotjar);
-
- this.siteId = config.siteID; // 1549611
-
- this.name = "HOTJAR";
- this._ready = false;
- }
-
- _createClass(Hotjar, [{
- key: "init",
- value: function init() {
- window.hotjarSiteId = this.siteId;
-
- (function (h, o, t, j, a, r) {
- h.hj = h.hj || function () {
- (h.hj.q = h.hj.q || []).push(arguments);
- };
-
- h._hjSettings = {
- hjid: h.hotjarSiteId,
- hjsv: 6
- };
- a = o.getElementsByTagName("head")[0];
- r = o.createElement("script");
- r.async = 1;
- r.src = t + h._hjSettings.hjid + j + h._hjSettings.hjsv;
- a.appendChild(r);
- })(window, document, "https://static.hotjar.com/c/hotjar-", ".js?sv=");
-
- this._ready = true;
- logger.debug("===in init Hotjar===");
- }
- }, {
- key: "identify",
- value: function identify(rudderElement) {
- var userId = rudderElement.message.userId || rudderElement.message.anonymousId;
-
- if (!userId) {
- logger.debug("[Hotjar] identify:: user id is required");
- return;
- }
-
- var traits = rudderElement.message.context.traits;
- window.hj("identify", rudderElement.message.userId, traits);
- }
- }, {
- key: "track",
- value: function track(rudderElement) {
- logger.debug("[Hotjar] track:: method not supported");
- }
- }, {
- key: "page",
- value: function page(rudderElement) {
- logger.debug("[Hotjar] page:: method not supported");
- }
- }, {
- key: "isLoaded",
- value: function isLoaded() {
- return this._ready;
- }
- }, {
- key: "isReady",
- value: function isReady() {
- return this._ready;
- }
- }]);
-
- return Hotjar;
- }();
-
- var index$2 = Hotjar ;
-
- var GoogleAds = /*#__PURE__*/function () {
- function GoogleAds(config) {
- _classCallCheck(this, GoogleAds);
-
- // this.accountId = config.accountId;//AW-696901813
- this.conversionId = config.conversionID;
- this.pageLoadConversions = config.pageLoadConversions;
- this.clickEventConversions = config.clickEventConversions;
- this.defaultPageConversion = config.defaultPageConversion;
- this.name = "GOOGLEADS";
- }
-
- _createClass(GoogleAds, [{
- key: "init",
- value: function init() {
- var sourceUrl = "https://www.googletagmanager.com/gtag/js?id=".concat(this.conversionId);
-
- (function (id, src, document) {
- logger.debug("in script loader=== ".concat(id));
- var js = document.createElement("script");
- js.src = src;
- js.async = 1;
- js.type = "text/javascript";
- js.id = id;
- var e = document.getElementsByTagName("head")[0];
- logger.debug("==script==", e);
- e.appendChild(js);
- })("googleAds-integration", sourceUrl, document);
-
- window.dataLayer = window.dataLayer || [];
-
- window.gtag = function () {
- window.dataLayer.push(arguments);
- };
-
- window.gtag("js", new Date());
- window.gtag("config", this.conversionId);
- logger.debug("===in init Google Ads===");
- }
- }, {
- key: "identify",
- value: function identify(rudderElement) {
- logger.debug("[GoogleAds] identify:: method not supported");
- } // https://developers.google.com/gtagjs/reference/event
-
- }, {
- key: "track",
- value: function track(rudderElement) {
- logger.debug("in GoogleAdsAnalyticsManager track");
- var conversionData = this.getConversionData(this.clickEventConversions, rudderElement.message.event);
-
- if (conversionData.conversionLabel) {
- var conversionLabel = conversionData.conversionLabel;
- var eventName = conversionData.eventName;
- var sendToValue = "".concat(this.conversionId, "/").concat(conversionLabel);
- var properties = {};
-
- if (rudderElement.properties) {
- properties.value = rudderElement.properties.revenue;
- properties.currency = rudderElement.properties.currency;
- properties.transaction_id = rudderElement.properties.order_id;
- }
-
- properties.send_to = sendToValue;
- window.gtag("event", eventName, properties);
- }
- }
- }, {
- key: "page",
- value: function page(rudderElement) {
- logger.debug("in GoogleAdsAnalyticsManager page");
- var conversionData = this.getConversionData(this.pageLoadConversions, rudderElement.message.name);
-
- if (conversionData.conversionLabel) {
- var conversionLabel = conversionData.conversionLabel;
- var eventName = conversionData.eventName;
- window.gtag("event", eventName, {
- send_to: "".concat(this.conversionId, "/").concat(conversionLabel)
- });
- }
- }
- }, {
- key: "getConversionData",
- value: function getConversionData(eventTypeConversions, eventName) {
- var conversionData = {};
-
- if (eventTypeConversions) {
- if (eventName) {
- eventTypeConversions.forEach(function (eventTypeConversion) {
- if (eventTypeConversion.name.toLowerCase() === eventName.toLowerCase()) {
- // rudderElement["message"]["name"]
- conversionData.conversionLabel = eventTypeConversion.conversionLabel;
- conversionData.eventName = eventTypeConversion.name;
- }
- });
- } else if (this.defaultPageConversion) {
- conversionData.conversionLabel = this.defaultPageConversion;
- conversionData.eventName = "Viewed a Page";
- }
- }
-
- return conversionData;
- }
- }, {
- key: "isLoaded",
- value: function isLoaded() {
- return window.dataLayer.push !== Array.prototype.push;
- }
- }, {
- key: "isReady",
- value: function isReady() {
- return window.dataLayer.push !== Array.prototype.push;
- }
- }]);
-
- return GoogleAds;
- }();
-
- var index$3 = GoogleAds ;
-
- var VWO = /*#__PURE__*/function () {
- function VWO(config, analytics) {
- _classCallCheck(this, VWO);
-
- this.accountId = config.accountId; // 1549611
-
- this.settingsTolerance = config.settingsTolerance;
- this.isSPA = config.isSPA;
- this.libraryTolerance = config.libraryTolerance;
- this.useExistingJquery = config.useExistingJquery;
- this.sendExperimentTrack = config.sendExperimentTrack;
- this.sendExperimentIdentify = config.sendExperimentIdentify;
- this.name = "VWO";
- this.analytics = analytics;
- logger.debug("Config ", config);
- }
-
- _createClass(VWO, [{
- key: "init",
- value: function init() {
- logger.debug("===in init VWO===");
- var account_id = this.accountId;
- var settings_tolerance = this.settingsTolerance;
- var _library_tolerance = this.libraryTolerance;
- var _use_existing_jquery = this.useExistingJquery;
- var isSPA = this.isSPA;
-
- window._vwo_code = function () {
- var f = false;
- var d = document;
- return {
- use_existing_jquery: function use_existing_jquery() {
- return _use_existing_jquery;
- },
- library_tolerance: function library_tolerance() {
- return _library_tolerance;
- },
- finish: function finish() {
- if (!f) {
- f = true;
- var a = d.getElementById("_vis_opt_path_hides");
- if (a) a.parentNode.removeChild(a);
- }
- },
- finished: function finished() {
- return f;
- },
- load: function load(a) {
- var b = d.createElement("script");
- b.src = a;
- b.type = "text/javascript";
- b.innerText;
-
- b.onerror = function () {
- _vwo_code.finish();
- };
-
- d.getElementsByTagName("head")[0].appendChild(b);
- },
- init: function init() {
- var settings_timer = setTimeout("_vwo_code.finish()", settings_tolerance);
- var a = d.createElement("style");
- var b = "body{opacity:0 !important;filter:alpha(opacity=0) !important;background:none !important;}";
- var h = d.getElementsByTagName("head")[0];
- a.setAttribute("id", "_vis_opt_path_hides");
- a.setAttribute("type", "text/css");
- if (a.styleSheet) a.styleSheet.cssText = b;else a.appendChild(d.createTextNode(b));
- h.appendChild(a);
- this.load("//dev.visualwebsiteoptimizer.com/j.php?a=".concat(account_id, "&u=").concat(encodeURIComponent(d.URL), "&r=").concat(Math.random(), "&f=").concat(+isSPA));
- return settings_timer;
- }
- };
- }();
-
- window._vwo_settings_timer = window._vwo_code.init(); // Send track or iddentify when
-
- if (this.sendExperimentTrack || this.experimentViewedIdentify) {
- this.experimentViewed();
- }
- }
- }, {
- key: "experimentViewed",
- value: function experimentViewed() {
- var _this = this;
-
- window.VWO = window.VWO || [];
- var self = this;
- window.VWO.push(["onVariationApplied", function (data) {
- if (!data) {
- return;
- }
-
- logger.debug("Variation Applied");
- var expId = data[1];
- var variationId = data[2];
- logger.debug("experiment id:", expId, "Variation Name:", _vwo_exp[expId].comb_n[variationId]);
-
- if (typeof _vwo_exp[expId].comb_n[variationId] !== "undefined" && ["VISUAL_AB", "VISUAL", "SPLIT_URL", "SURVEY"].indexOf(_vwo_exp[expId].type) > -1) {
- try {
- if (self.sendExperimentTrack) {
- logger.debug("Tracking...");
-
- _this.analytics.track("Experiment Viewed", {
- experimentId: expId,
- variationName: _vwo_exp[expId].comb_n[variationId]
- });
- }
- } catch (error) {
- logger.error("[VWO] experimentViewed:: ", error);
- }
-
- try {
- if (self.sendExperimentIdentify) {
- logger.debug("Identifying...");
-
- _this.analytics.identify(_defineProperty({}, "Experiment: ".concat(expId), _vwo_exp[expId].comb_n[variationId]));
- }
- } catch (error) {
- logger.error("[VWO] experimentViewed:: ", error);
- }
- }
- }]);
- }
- }, {
- key: "identify",
- value: function identify(rudderElement) {
- logger.debug("method not supported");
- }
- }, {
- key: "track",
- value: function track(rudderElement) {
- var eventName = rudderElement.message.event;
-
- if (eventName === "Order Completed") {
- var total = rudderElement.message.properties ? rudderElement.message.properties.total || rudderElement.message.properties.revenue : 0;
- logger.debug("Revenue", total);
- window.VWO = window.VWO || [];
- window.VWO.push(["track.revenueConversion", total]);
- }
- }
- }, {
- key: "page",
- value: function page(rudderElement) {
- logger.debug("method not supported");
- }
- }, {
- key: "isLoaded",
- value: function isLoaded() {
- return !!window._vwo_code;
- }
- }, {
- key: "isReady",
- value: function isReady() {
- return !!window._vwo_code;
- }
- }]);
-
- return VWO;
- }();
-
- var GoogleTagManager = /*#__PURE__*/function () {
- function GoogleTagManager(config) {
- _classCallCheck(this, GoogleTagManager);
-
- this.containerID = config.containerID;
- this.name = "GOOGLETAGMANAGER";
- }
-
- _createClass(GoogleTagManager, [{
- key: "init",
- value: function init() {
- logger.debug("===in init GoogleTagManager===");
-
- (function (w, d, s, l, i) {
- w[l] = w[l] || [];
- w[l].push({
- "gtm.start": new Date().getTime(),
- event: "gtm.js"
- });
- var f = d.getElementsByTagName(s)[0];
- var j = d.createElement(s);
- var dl = l != "dataLayer" ? "&l=".concat(l) : "";
- j.async = true;
- j.src = "https://www.googletagmanager.com/gtm.js?id=".concat(i).concat(dl);
- f.parentNode.insertBefore(j, f);
- })(window, document, "script", "dataLayer", this.containerID);
- }
- }, {
- key: "identify",
- value: function identify(rudderElement) {
- logger.debug("[GTM] identify:: method not supported");
- }
- }, {
- key: "track",
- value: function track(rudderElement) {
- logger.debug("===in track GoogleTagManager===");
- var rudderMessage = rudderElement.message;
-
- var props = _objectSpread2({
- event: rudderMessage.event,
- userId: rudderMessage.userId,
- anonymousId: rudderMessage.anonymousId
- }, rudderMessage.properties);
-
- this.sendToGTMDatalayer(props);
- }
- }, {
- key: "page",
- value: function page(rudderElement) {
- logger.debug("===in page GoogleTagManager===");
- var rudderMessage = rudderElement.message;
- var pageName = rudderMessage.name;
- var pageCategory = rudderMessage.properties ? rudderMessage.properties.category : undefined;
- var eventName;
-
- if (pageName) {
- eventName = "Viewed ".concat(pageName, " page");
- }
-
- if (pageCategory && pageName) {
- eventName = "Viewed ".concat(pageCategory, " ").concat(pageName, " page");
- }
-
- if (!eventName) {
- eventName = "Viewed a Page";
- }
-
- var props = _objectSpread2({
- event: eventName,
- userId: rudderMessage.userId,
- anonymousId: rudderMessage.anonymousId
- }, rudderMessage.properties);
-
- this.sendToGTMDatalayer(props);
- }
- }, {
- key: "isLoaded",
- value: function isLoaded() {
- return !!(window.dataLayer && Array.prototype.push !== window.dataLayer.push);
- }
- }, {
- key: "sendToGTMDatalayer",
- value: function sendToGTMDatalayer(props) {
- window.dataLayer.push(props);
- }
- }, {
- key: "isReady",
- value: function isReady() {
- return !!(window.dataLayer && Array.prototype.push !== window.dataLayer.push);
- }
- }]);
-
- return GoogleTagManager;
- }();
-
- /*
- E-commerce support required for logPurchase support & other e-commerce events as track with productId changed
- */
-
- var Braze = /*#__PURE__*/function () {
- function Braze(config, analytics) {
- _classCallCheck(this, Braze);
-
- this.analytics = analytics;
- this.appKey = config.appKey;
- if (!config.appKey) this.appKey = "";
- this.endPoint = "";
-
- if (config.dataCenter) {
- var dataCenterArr = config.dataCenter.trim().split("-");
-
- if (dataCenterArr[0].toLowerCase() === "eu") {
- this.endPoint = "sdk.fra-01.braze.eu";
- } else {
- this.endPoint = "sdk.iad-".concat(dataCenterArr[1], ".braze.com");
- }
- }
-
- this.name = "BRAZE";
- logger.debug("Config ", config);
- }
- /** https://js.appboycdn.com/web-sdk/latest/doc/ab.User.html#toc4
- */
-
-
- _createClass(Braze, [{
- key: "formatGender",
- value: function formatGender(gender) {
- if (!gender) return;
- if (typeof gender !== "string") return;
- var femaleGenders = ["woman", "female", "w", "f"];
- var maleGenders = ["man", "male", "m"];
- var otherGenders = ["other", "o"];
- if (femaleGenders.indexOf(gender.toLowerCase()) > -1) return window.appboy.ab.User.Genders.FEMALE;
- if (maleGenders.indexOf(gender.toLowerCase()) > -1) return window.appboy.ab.User.Genders.MALE;
- if (otherGenders.indexOf(gender.toLowerCase()) > -1) return window.appboy.ab.User.Genders.OTHER;
- }
- }, {
- key: "init",
- value: function init() {
- logger.debug("===in init Braze==="); // load appboy
-
- +function (a, p, P, b, y) {
- a.appboy = {};
- a.appboyQueue = [];
-
- for (var s = "initialize destroy getDeviceId toggleAppboyLogging setLogger openSession changeUser requestImmediateDataFlush requestFeedRefresh subscribeToFeedUpdates requestContentCardsRefresh subscribeToContentCardsUpdates logCardImpressions logCardClick logCardDismissal logFeedDisplayed logContentCardsDisplayed logInAppMessageImpression logInAppMessageClick logInAppMessageButtonClick logInAppMessageHtmlClick subscribeToNewInAppMessages subscribeToInAppMessage removeSubscription removeAllSubscriptions logCustomEvent logPurchase isPushSupported isPushBlocked isPushGranted isPushPermissionGranted registerAppboyPushMessages unregisterAppboyPushMessages trackLocation stopWebTracking resumeWebTracking wipeData ab ab.DeviceProperties ab.User ab.User.Genders ab.User.NotificationSubscriptionTypes ab.User.prototype.getUserId ab.User.prototype.setFirstName ab.User.prototype.setLastName ab.User.prototype.setEmail ab.User.prototype.setGender ab.User.prototype.setDateOfBirth ab.User.prototype.setCountry ab.User.prototype.setHomeCity ab.User.prototype.setLanguage ab.User.prototype.setEmailNotificationSubscriptionType ab.User.prototype.setPushNotificationSubscriptionType ab.User.prototype.setPhoneNumber ab.User.prototype.setAvatarImageUrl ab.User.prototype.setLastKnownLocation ab.User.prototype.setUserAttribute ab.User.prototype.setCustomUserAttribute ab.User.prototype.addToCustomAttributeArray ab.User.prototype.removeFromCustomAttributeArray ab.User.prototype.incrementCustomUserAttribute ab.User.prototype.addAlias ab.User.prototype.setCustomLocationAttribute ab.InAppMessage ab.InAppMessage.SlideFrom ab.InAppMessage.ClickAction ab.InAppMessage.DismissType ab.InAppMessage.OpenTarget ab.InAppMessage.ImageStyle ab.InAppMessage.TextAlignment ab.InAppMessage.Orientation ab.InAppMessage.CropType ab.InAppMessage.prototype.subscribeToClickedEvent ab.InAppMessage.prototype.subscribeToDismissedEvent ab.InAppMessage.prototype.removeSubscription ab.InAppMessage.prototype.removeAllSubscriptions ab.InAppMessage.prototype.closeMessage ab.InAppMessage.Button ab.InAppMessage.Button.prototype.subscribeToClickedEvent ab.InAppMessage.Button.prototype.removeSubscription ab.InAppMessage.Button.prototype.removeAllSubscriptions ab.SlideUpMessage ab.ModalMessage ab.FullScreenMessage ab.HtmlMessage ab.ControlMessage ab.Feed ab.Feed.prototype.getUnreadCardCount ab.ContentCards ab.ContentCards.prototype.getUnviewedCardCount ab.Card ab.Card.prototype.dismissCard ab.ClassicCard ab.CaptionedImage ab.Banner ab.ControlCard ab.WindowUtils display display.automaticallyShowNewInAppMessages display.showInAppMessage display.showFeed display.destroyFeed display.toggleFeed display.showContentCards display.hideContentCards display.toggleContentCards sharedLib".split(" "), i = 0; i < s.length; i++) {
- for (var m = s[i], k = a.appboy, l = m.split("."), j = 0; j < l.length - 1; j++) {
- k = k[l[j]];
- }
-
- k[l[j]] = new Function("return function ".concat(m.replace(/\./g, "_"), "(){window.appboyQueue.push(arguments); return true}"))();
- }
-
- window.appboy.getUser = function () {
- return new window.appboy.ab.User();
- };
-
- window.appboy.getCachedFeed = function () {
- return new window.appboy.ab.Feed();
- };
-
- window.appboy.getCachedContentCards = function () {
- return new window.appboy.ab.ContentCards();
- };
-
- (y = p.createElement(P)).type = "text/javascript";
- y.src = "https://js.appboycdn.com/web-sdk/2.4/appboy.min.js";
- y.async = 1;
- (b = p.getElementsByTagName(P)[0]).parentNode.insertBefore(y, b);
- }(window, document, "script");
- window.appboy.initialize(this.appKey, {
- enableLogging: true,
- baseUrl: this.endPoint
- });
- window.appboy.display.automaticallyShowNewInAppMessages();
- var userId = this.analytics.userId; // send userId if you have it https://js.appboycdn.com/web-sdk/latest/doc/module-appboy.html#.changeUser
-
- if (userId) appboy.changeUser(userId);
- window.appboy.openSession();
- }
- }, {
- key: "handleReservedProperties",
- value: function handleReservedProperties(props) {
- // remove reserved keys from custom event properties
- // https://www.appboy.com/documentation/Platform_Wide/#reserved-keys
- var reserved = ["time", "product_id", "quantity", "event_name", "price", "currency"];
- reserved.forEach(function (element) {
- delete props[element];
- });
- return props;
- }
- }, {
- key: "identify",
- value: function identify(rudderElement) {
- var userId = rudderElement.message.userId;
- var address = rudderElement.message.context.traits.address;
- var avatar = rudderElement.message.context.traits.avatar;
- var birthday = rudderElement.message.context.traits.birthday;
- var email = rudderElement.message.context.traits.email;
- var firstname = rudderElement.message.context.traits.firstname;
- var gender = rudderElement.message.context.traits.gender;
- var lastname = rudderElement.message.context.traits.lastname;
- var phone = rudderElement.message.context.traits.phone; // This is a hack to make a deep copy that is not recommended because it will often fail:
-
- var traits = JSON.parse(JSON.stringify(rudderElement.message.context.traits));
- window.appboy.changeUser(userId);
- window.appboy.getUser().setAvatarImageUrl(avatar);
- if (email) window.appboy.getUser().setEmail(email);
- if (firstname) window.appboy.getUser().setFirstName(firstname);
- if (gender) window.appboy.getUser().setGender(this.formatGender(gender));
- if (lastname) window.appboy.getUser().setLastName(lastname);
- if (phone) window.appboy.getUser().setPhoneNumber(phone);
-
- if (address) {
- window.appboy.getUser().setCountry(address.country);
- window.appboy.getUser().setHomeCity(address.city);
- }
-
- if (birthday) {
- window.appboy.getUser().setDateOfBirth(birthday.getUTCFullYear(), birthday.getUTCMonth() + 1, birthday.getUTCDate());
- } // remove reserved keys https://www.appboy.com/documentation/Platform_Wide/#reserved-keys
-
-
- var reserved = ["avatar", "address", "birthday", "email", "id", "firstname", "gender", "lastname", "phone", "facebook", "twitter", "first_name", "last_name", "dob", "external_id", "country", "home_city", "bio", "gender", "phone", "email_subscribe", "push_subscribe"];
- reserved.forEach(function (element) {
- delete traits[element];
- });
- Object.keys(traits).forEach(function (key) {
- window.appboy.getUser().setCustomUserAttribute(key, traits[key]);
- });
- }
- }, {
- key: "handlePurchase",
- value: function handlePurchase(properties, userId) {
- var products = properties.products;
- var currencyCode = properties.currency;
- window.appboy.changeUser(userId); // del used properties
-
- del(properties, "products");
- del(properties, "currency"); // we have to make a separate call to appboy for each product
-
- products.forEach(function (product) {
- var productId = product.product_id;
- var price = product.price;
- var quantity = product.quantity;
- if (quantity && price && productId) window.appboy.logPurchase(productId, price, currencyCode, quantity, properties);
- });
- }
- }, {
- key: "track",
- value: function track(rudderElement) {
- var userId = rudderElement.message.userId;
- var eventName = rudderElement.message.event;
- var properties = rudderElement.message.properties;
- window.appboy.changeUser(userId);
-
- if (eventName.toLowerCase() === "order completed") {
- this.handlePurchase(properties, userId);
- } else {
- properties = this.handleReservedProperties(properties);
- window.appboy.logCustomEvent(eventName, properties);
- }
- }
- }, {
- key: "page",
- value: function page(rudderElement) {
- var userId = rudderElement.message.userId;
- var eventName = rudderElement.message.name;
- var properties = rudderElement.message.properties;
- properties = this.handleReservedProperties(properties);
- window.appboy.changeUser(userId);
- window.appboy.logCustomEvent(eventName, properties);
- }
- }, {
- key: "isLoaded",
- value: function isLoaded() {
- return window.appboyQueue === null;
- }
- }, {
- key: "isReady",
- value: function isReady() {
- return window.appboyQueue === null;
- }
- }]);
-
- return Braze;
- }();
-
- var crypt = createCommonjsModule(function (module) {
- (function() {
- var base64map
- = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/',
-
- crypt = {
- // Bit-wise rotation left
- rotl: function(n, b) {
- return (n << b) | (n >>> (32 - b));
- },
-
- // Bit-wise rotation right
- rotr: function(n, b) {
- return (n << (32 - b)) | (n >>> b);
- },
-
- // Swap big-endian to little-endian and vice versa
- endian: function(n) {
- // If number given, swap endian
- if (n.constructor == Number) {
- return crypt.rotl(n, 8) & 0x00FF00FF | crypt.rotl(n, 24) & 0xFF00FF00;
- }
-
- // Else, assume array and swap all items
- for (var i = 0; i < n.length; i++)
- n[i] = crypt.endian(n[i]);
- return n;
- },
-
- // Generate an array of any length of random bytes
- randomBytes: function(n) {
- for (var bytes = []; n > 0; n--)
- bytes.push(Math.floor(Math.random() * 256));
- return bytes;
- },
-
- // Convert a byte array to big-endian 32-bit words
- bytesToWords: function(bytes) {
- for (var words = [], i = 0, b = 0; i < bytes.length; i++, b += 8)
- words[b >>> 5] |= bytes[i] << (24 - b % 32);
- return words;
- },
-
- // Convert big-endian 32-bit words to a byte array
- wordsToBytes: function(words) {
- for (var bytes = [], b = 0; b < words.length * 32; b += 8)
- bytes.push((words[b >>> 5] >>> (24 - b % 32)) & 0xFF);
- return bytes;
- },
-
- // Convert a byte array to a hex string
- bytesToHex: function(bytes) {
- for (var hex = [], i = 0; i < bytes.length; i++) {
- hex.push((bytes[i] >>> 4).toString(16));
- hex.push((bytes[i] & 0xF).toString(16));
- }
- return hex.join('');
- },
-
- // Convert a hex string to a byte array
- hexToBytes: function(hex) {
- for (var bytes = [], c = 0; c < hex.length; c += 2)
- bytes.push(parseInt(hex.substr(c, 2), 16));
- return bytes;
- },
-
- // Convert a byte array to a base-64 string
- bytesToBase64: function(bytes) {
- for (var base64 = [], i = 0; i < bytes.length; i += 3) {
- var triplet = (bytes[i] << 16) | (bytes[i + 1] << 8) | bytes[i + 2];
- for (var j = 0; j < 4; j++)
- if (i * 8 + j * 6 <= bytes.length * 8)
- base64.push(base64map.charAt((triplet >>> 6 * (3 - j)) & 0x3F));
- else
- base64.push('=');
- }
- return base64.join('');
- },
-
- // Convert a base-64 string to a byte array
- base64ToBytes: function(base64) {
- // Remove non-base-64 characters
- base64 = base64.replace(/[^A-Z0-9+\/]/ig, '');
-
- for (var bytes = [], i = 0, imod4 = 0; i < base64.length;
- imod4 = ++i % 4) {
- if (imod4 == 0) continue;
- bytes.push(((base64map.indexOf(base64.charAt(i - 1))
- & (Math.pow(2, -2 * imod4 + 8) - 1)) << (imod4 * 2))
- | (base64map.indexOf(base64.charAt(i)) >>> (6 - imod4 * 2)));
- }
- return bytes;
- }
- };
-
- module.exports = crypt;
- })();
- });
-
- var charenc = {
- // UTF-8 encoding
- utf8: {
- // Convert a string to a byte array
- stringToBytes: function(str) {
- return charenc.bin.stringToBytes(unescape(encodeURIComponent(str)));
- },
-
- // Convert a byte array to a string
- bytesToString: function(bytes) {
- return decodeURIComponent(escape(charenc.bin.bytesToString(bytes)));
- }
- },
-
- // Binary encoding
- bin: {
- // Convert a string to a byte array
- stringToBytes: function(str) {
- for (var bytes = [], i = 0; i < str.length; i++)
- bytes.push(str.charCodeAt(i) & 0xFF);
- return bytes;
- },
-
- // Convert a byte array to a string
- bytesToString: function(bytes) {
- for (var str = [], i = 0; i < bytes.length; i++)
- str.push(String.fromCharCode(bytes[i]));
- return str.join('');
- }
- }
- };
-
- var charenc_1 = charenc;
-
- /*!
- * Determine if an object is a Buffer
- *
- * @author Feross Aboukhadijeh
- * @license MIT
- */
-
- // The _isBuffer check is for Safari 5-7 support, because it's missing
- // Object.prototype.constructor. Remove this eventually
- var isBuffer_1 = function (obj) {
- return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer)
- };
-
- function isBuffer (obj) {
- return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)
- }
-
- // For Node v0.10 support. Remove this eventually.
- function isSlowBuffer (obj) {
- return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))
- }
-
- var md5 = createCommonjsModule(function (module) {
- (function(){
- var crypt$1 = crypt,
- utf8 = charenc_1.utf8,
- isBuffer = isBuffer_1,
- bin = charenc_1.bin,
-
- // The core
- md5 = function (message, options) {
- // Convert to byte array
- if (message.constructor == String)
- if (options && options.encoding === 'binary')
- message = bin.stringToBytes(message);
- else
- message = utf8.stringToBytes(message);
- else if (isBuffer(message))
- message = Array.prototype.slice.call(message, 0);
- else if (!Array.isArray(message))
- message = message.toString();
- // else, assume byte array already
-
- var m = crypt$1.bytesToWords(message),
- l = message.length * 8,
- a = 1732584193,
- b = -271733879,
- c = -1732584194,
- d = 271733878;
-
- // Swap endian
- for (var i = 0; i < m.length; i++) {
- m[i] = ((m[i] << 8) | (m[i] >>> 24)) & 0x00FF00FF |
- ((m[i] << 24) | (m[i] >>> 8)) & 0xFF00FF00;
- }
-
- // Padding
- m[l >>> 5] |= 0x80 << (l % 32);
- m[(((l + 64) >>> 9) << 4) + 14] = l;
-
- // Method shortcuts
- var FF = md5._ff,
- GG = md5._gg,
- HH = md5._hh,
- II = md5._ii;
-
- for (var i = 0; i < m.length; i += 16) {
-
- var aa = a,
- bb = b,
- cc = c,
- dd = d;
-
- a = FF(a, b, c, d, m[i+ 0], 7, -680876936);
- d = FF(d, a, b, c, m[i+ 1], 12, -389564586);
- c = FF(c, d, a, b, m[i+ 2], 17, 606105819);
- b = FF(b, c, d, a, m[i+ 3], 22, -1044525330);
- a = FF(a, b, c, d, m[i+ 4], 7, -176418897);
- d = FF(d, a, b, c, m[i+ 5], 12, 1200080426);
- c = FF(c, d, a, b, m[i+ 6], 17, -1473231341);
- b = FF(b, c, d, a, m[i+ 7], 22, -45705983);
- a = FF(a, b, c, d, m[i+ 8], 7, 1770035416);
- d = FF(d, a, b, c, m[i+ 9], 12, -1958414417);
- c = FF(c, d, a, b, m[i+10], 17, -42063);
- b = FF(b, c, d, a, m[i+11], 22, -1990404162);
- a = FF(a, b, c, d, m[i+12], 7, 1804603682);
- d = FF(d, a, b, c, m[i+13], 12, -40341101);
- c = FF(c, d, a, b, m[i+14], 17, -1502002290);
- b = FF(b, c, d, a, m[i+15], 22, 1236535329);
-
- a = GG(a, b, c, d, m[i+ 1], 5, -165796510);
- d = GG(d, a, b, c, m[i+ 6], 9, -1069501632);
- c = GG(c, d, a, b, m[i+11], 14, 643717713);
- b = GG(b, c, d, a, m[i+ 0], 20, -373897302);
- a = GG(a, b, c, d, m[i+ 5], 5, -701558691);
- d = GG(d, a, b, c, m[i+10], 9, 38016083);
- c = GG(c, d, a, b, m[i+15], 14, -660478335);
- b = GG(b, c, d, a, m[i+ 4], 20, -405537848);
- a = GG(a, b, c, d, m[i+ 9], 5, 568446438);
- d = GG(d, a, b, c, m[i+14], 9, -1019803690);
- c = GG(c, d, a, b, m[i+ 3], 14, -187363961);
- b = GG(b, c, d, a, m[i+ 8], 20, 1163531501);
- a = GG(a, b, c, d, m[i+13], 5, -1444681467);
- d = GG(d, a, b, c, m[i+ 2], 9, -51403784);
- c = GG(c, d, a, b, m[i+ 7], 14, 1735328473);
- b = GG(b, c, d, a, m[i+12], 20, -1926607734);
-
- a = HH(a, b, c, d, m[i+ 5], 4, -378558);
- d = HH(d, a, b, c, m[i+ 8], 11, -2022574463);
- c = HH(c, d, a, b, m[i+11], 16, 1839030562);
- b = HH(b, c, d, a, m[i+14], 23, -35309556);
- a = HH(a, b, c, d, m[i+ 1], 4, -1530992060);
- d = HH(d, a, b, c, m[i+ 4], 11, 1272893353);
- c = HH(c, d, a, b, m[i+ 7], 16, -155497632);
- b = HH(b, c, d, a, m[i+10], 23, -1094730640);
- a = HH(a, b, c, d, m[i+13], 4, 681279174);
- d = HH(d, a, b, c, m[i+ 0], 11, -358537222);
- c = HH(c, d, a, b, m[i+ 3], 16, -722521979);
- b = HH(b, c, d, a, m[i+ 6], 23, 76029189);
- a = HH(a, b, c, d, m[i+ 9], 4, -640364487);
- d = HH(d, a, b, c, m[i+12], 11, -421815835);
- c = HH(c, d, a, b, m[i+15], 16, 530742520);
- b = HH(b, c, d, a, m[i+ 2], 23, -995338651);
-
- a = II(a, b, c, d, m[i+ 0], 6, -198630844);
- d = II(d, a, b, c, m[i+ 7], 10, 1126891415);
- c = II(c, d, a, b, m[i+14], 15, -1416354905);
- b = II(b, c, d, a, m[i+ 5], 21, -57434055);
- a = II(a, b, c, d, m[i+12], 6, 1700485571);
- d = II(d, a, b, c, m[i+ 3], 10, -1894986606);
- c = II(c, d, a, b, m[i+10], 15, -1051523);
- b = II(b, c, d, a, m[i+ 1], 21, -2054922799);
- a = II(a, b, c, d, m[i+ 8], 6, 1873313359);
- d = II(d, a, b, c, m[i+15], 10, -30611744);
- c = II(c, d, a, b, m[i+ 6], 15, -1560198380);
- b = II(b, c, d, a, m[i+13], 21, 1309151649);
- a = II(a, b, c, d, m[i+ 4], 6, -145523070);
- d = II(d, a, b, c, m[i+11], 10, -1120210379);
- c = II(c, d, a, b, m[i+ 2], 15, 718787259);
- b = II(b, c, d, a, m[i+ 9], 21, -343485551);
-
- a = (a + aa) >>> 0;
- b = (b + bb) >>> 0;
- c = (c + cc) >>> 0;
- d = (d + dd) >>> 0;
- }
-
- return crypt$1.endian([a, b, c, d]);
- };
-
- // Auxiliary functions
- md5._ff = function (a, b, c, d, x, s, t) {
- var n = a + (b & c | ~b & d) + (x >>> 0) + t;
- return ((n << s) | (n >>> (32 - s))) + b;
- };
- md5._gg = function (a, b, c, d, x, s, t) {
- var n = a + (b & d | c & ~d) + (x >>> 0) + t;
- return ((n << s) | (n >>> (32 - s))) + b;
- };
- md5._hh = function (a, b, c, d, x, s, t) {
- var n = a + (b ^ c ^ d) + (x >>> 0) + t;
- return ((n << s) | (n >>> (32 - s))) + b;
- };
- md5._ii = function (a, b, c, d, x, s, t) {
- var n = a + (c ^ (b | ~d)) + (x >>> 0) + t;
- return ((n << s) | (n >>> (32 - s))) + b;
- };
-
- // Package private blocksize
- md5._blocksize = 16;
- md5._digestsize = 16;
-
- module.exports = function (message, options) {
- if (message === undefined || message === null)
- throw new Error('Illegal argument ' + message);
-
- var digestbytes = crypt$1.wordsToBytes(md5(message, options));
- return options && options.asBytes ? digestbytes :
- options && options.asString ? bin.bytesToString(digestbytes) :
- crypt$1.bytesToHex(digestbytes);
- };
-
- })();
- });
-
- var INTERCOM = /*#__PURE__*/function () {
- function INTERCOM(config) {
- _classCallCheck(this, INTERCOM);
-
- this.NAME = "INTERCOM";
- this.API_KEY = config.apiKey;
- this.APP_ID = config.appId;
- this.MOBILE_APP_ID = config.mobileAppId;
- logger.debug("Config ", config);
- }
-
- _createClass(INTERCOM, [{
- key: "init",
- value: function init() {
- window.intercomSettings = {
- app_id: this.APP_ID
- };
-
- (function () {
- var w = window;
- var ic = w.Intercom;
-
- if (typeof ic === "function") {
- ic("reattach_activator");
- ic("update", w.intercomSettings);
- } else {
- var d = document;
-
- var i = function i() {
- i.c(arguments);
- };
-
- i.q = [];
-
- i.c = function (args) {
- i.q.push(args);
- };
-
- w.Intercom = i;
-
- var l = function l() {
- var s = d.createElement("script");
- s.type = "text/javascript";
- s.async = true;
- s.src = "https://widget.intercom.io/widget/".concat(window.intercomSettings.app_id);
- var x = d.getElementsByTagName("script")[0];
- x.parentNode.insertBefore(s, x);
- };
-
- if (document.readyState === "complete") {
- l();
- window.intercom_code = true;
- } else if (w.attachEvent) {
- w.attachEvent("onload", l);
- window.intercom_code = true;
- } else {
- w.addEventListener("load", l, false);
- window.intercom_code = true;
- }
- }
- })();
- }
- }, {
- key: "page",
- value: function page() {
- // Get new messages of the current user
- window.Intercom("update");
- }
- }, {
- key: "identify",
- value: function identify(rudderElement) {
- var rawPayload = {};
- var context = rudderElement.message.context;
- var identityVerificationProps = context.Intercom ? context.Intercom : null;
-
- if (identityVerificationProps != null) {
- // user hash
- var userHash = context.Intercom.user_hash ? context.Intercom.user_hash : null;
-
- if (userHash != null) {
- rawPayload.user_hash = userHash;
- } // hide default launcher
-
-
- var hideDefaultLauncher = context.Intercom.hideDefaultLauncher ? context.Intercom.hideDefaultLauncher : null;
-
- if (hideDefaultLauncher != null) {
- rawPayload.hide_default_launcher = hideDefaultLauncher;
- }
- } // map rudderPayload to desired
-
-
- Object.keys(context.traits).forEach(function (field) {
- if (context.traits.hasOwnProperty(field)) {
- var value = context.traits[field];
-
- if (field === "company") {
- var companies = [];
- var company = {}; // special handling string
-
- if (typeof context.traits[field] === "string") {
- company.company_id = md5(context.traits[field]);
- }
-
- var companyFields = _typeof(context.traits[field]) === "object" && Object.keys(context.traits[field]) || [];
- companyFields.forEach(function (key) {
- if (companyFields.hasOwnProperty(key)) {
- if (key != "id") {
- company[key] = context.traits[field][key];
- } else {
- company.company_id = context.traits[field][key];
- }
- }
- });
-
- if (_typeof(context.traits[field]) === "object" && !companyFields.includes("id")) {
- company.company_id = md5(company.name);
- }
-
- companies.push(company);
- rawPayload.companies = companies;
- } else {
- rawPayload[field] = context.traits[field];
- }
-
- switch (field) {
- case "createdAt":
- rawPayload.created_at = value;
- break;
-
- case "anonymousId":
- rawPayload.user_id = value;
- break;
- }
- }
- });
- rawPayload.user_id = rudderElement.message.userId;
- window.Intercom("update", rawPayload);
- }
- }, {
- key: "track",
- value: function track(rudderElement) {
- var rawPayload = {};
- var message = rudderElement.message;
- var properties = message.properties ? Object.keys(message.properties) : null;
- properties.forEach(function (property) {
- var value = message.properties[property];
- rawPayload[property] = value;
- });
-
- if (message.event) {
- rawPayload.event_name = message.event;
- }
-
- rawPayload.user_id = message.userId ? message.userId : message.anonymousId;
- rawPayload.created_at = Math.floor(new Date(message.originalTimestamp).getTime() / 1000);
- window.Intercom("trackEvent", rawPayload.event_name, rawPayload);
- }
- }, {
- key: "isLoaded",
- value: function isLoaded() {
- return !!window.intercom_code;
- }
- }, {
- key: "isReady",
- value: function isReady() {
- return !!window.intercom_code;
- }
- }]);
-
- return INTERCOM;
- }();
-
- var Keen = /*#__PURE__*/function () {
- function Keen(config) {
- _classCallCheck(this, Keen);
-
- this.projectID = config.projectID;
- this.writeKey = config.writeKey;
- this.ipAddon = config.ipAddon;
- this.uaAddon = config.uaAddon;
- this.urlAddon = config.urlAddon;
- this.referrerAddon = config.referrerAddon;
- this.client = null;
- this.name = "KEEN";
- }
-
- _createClass(Keen, [{
- key: "init",
- value: function init() {
- logger.debug("===in init Keen===");
- ScriptLoader("keen-integration", "https://cdn.jsdelivr.net/npm/keen-tracking@4");
- var check = setInterval(checkAndInitKeen.bind(this), 1000);
-
- function initKeen(object) {
- object.client = new window.KeenTracking({
- projectId: object.projectID,
- writeKey: object.writeKey
- });
- return object.client;
- }
-
- function checkAndInitKeen() {
- if (window.KeenTracking !== undefined && window.KeenTracking !== void 0) {
- this.client = initKeen(this);
- clearInterval(check);
- }
- }
- }
- }, {
- key: "identify",
- value: function identify(rudderElement) {
- logger.debug("in Keen identify");
- var traits = rudderElement.message.context.traits;
- var userId = rudderElement.message.userId ? rudderElement.message.userId : rudderElement.message.anonymousId;
- var properties = rudderElement.message.properties ? Object.assign(properties, rudderElement.message.properties) : {};
- properties.user = {
- userId: userId,
- traits: traits
- };
- properties = this.getAddOn(properties);
- this.client.extendEvents(properties);
- }
- }, {
- key: "track",
- value: function track(rudderElement) {
- logger.debug("in Keen track");
- var event = rudderElement.message.event;
- var properties = rudderElement.message.properties;
- properties = this.getAddOn(properties);
- this.client.recordEvent(event, properties);
- }
- }, {
- key: "page",
- value: function page(rudderElement) {
- logger.debug("in Keen page");
- var pageName = rudderElement.message.name;
- var pageCategory = rudderElement.message.properties ? rudderElement.message.properties.category : undefined;
- var name = "Loaded a Page";
-
- if (pageName) {
- name = "Viewed ".concat(pageName, " page");
- }
-
- if (pageCategory && pageName) {
- name = "Viewed ".concat(pageCategory, " ").concat(pageName, " page");
- }
-
- var properties = rudderElement.message.properties;
- properties = this.getAddOn(properties);
- this.client.recordEvent(name, properties);
- }
- }, {
- key: "isLoaded",
- value: function isLoaded() {
- logger.debug("in Keen isLoaded");
- return !!(this.client != null);
- }
- }, {
- key: "isReady",
- value: function isReady() {
- return !!(this.client != null);
- }
- }, {
- key: "getAddOn",
- value: function getAddOn(properties) {
- var addOns = [];
-
- if (this.ipAddon) {
- properties.ip_address = "${keen.ip}";
- addOns.push({
- name: "keen:ip_to_geo",
- input: {
- ip: "ip_address"
- },
- output: "ip_geo_info"
- });
- }
-
- if (this.uaAddon) {
- properties.user_agent = "${keen.user_agent}";
- addOns.push({
- name: "keen:ua_parser",
- input: {
- ua_string: "user_agent"
- },
- output: "parsed_user_agent"
- });
- }
-
- if (this.urlAddon) {
- properties.page_url = document.location.href;
- addOns.push({
- name: "keen:url_parser",
- input: {
- url: "page_url"
- },
- output: "parsed_page_url"
- });
- }
-
- if (this.referrerAddon) {
- properties.page_url = document.location.href;
- properties.referrer_url = document.referrer;
- addOns.push({
- name: "keen:referrer_parser",
- input: {
- referrer_url: "referrer_url",
- page_url: "page_url"
- },
- output: "referrer_info"
- });
- }
-
- properties.keen = {
- addons: addOns
- };
- return properties;
- }
- }]);
-
- return Keen;
- }();
-
- var has$1 = Object.prototype.hasOwnProperty;
-
- /**
- * Copy the properties of one or more `objects` onto a destination object. Input objects are iterated over
- * in left-to-right order, so duplicate properties on later objects will overwrite those from
- * erevious ones. Only enumerable and own properties of the input objects are copied onto the
- * resulting object.
- *
- * @name extend
- * @api public
- * @category Object
- * @param {Object} dest The destination object.
- * @param {...Object} sources The source objects.
- * @return {Object} `dest`, extended with the properties of all `sources`.
- * @example
- * var a = { a: 'a' };
- * var b = { b: 'b' };
- * var c = { c: 'c' };
- *
- * extend(a, b, c);
- * //=> { a: 'a', b: 'b', c: 'c' };
- */
- var extend = function extend(dest /*, sources */) {
- var sources = Array.prototype.slice.call(arguments, 1);
-
- for (var i = 0; i < sources.length; i += 1) {
- for (var key in sources[i]) {
- if (has$1.call(sources[i], key)) {
- dest[key] = sources[i][key];
- }
- }
- }
-
- return dest;
- };
-
- /*
- * Exports.
- */
-
- var extend_1 = extend;
-
- var objCase = createCommonjsModule(function (module) {
-
-
- /**
- * Module exports, export
- */
-
- module.exports = multiple(find);
- module.exports.find = module.exports;
-
-
- /**
- * Export the replacement function, return the modified object
- */
-
- module.exports.replace = function (obj, key, val, options) {
- multiple(replace).call(this, obj, key, val, options);
- return obj;
- };
-
-
- /**
- * Export the delete function, return the modified object
- */
-
- module.exports.del = function (obj, key, options) {
- multiple(del).call(this, obj, key, null, options);
- return obj;
- };
-
-
- /**
- * Compose applying the function to a nested key
- */
-
- function multiple (fn) {
- return function (obj, path, val, options) {
- normalize = options && isFunction(options.normalizer) ? options.normalizer : defaultNormalize;
- path = normalize(path);
-
- var key;
- var finished = false;
-
- while (!finished) loop();
-
- function loop() {
- for (key in obj) {
- var normalizedKey = normalize(key);
- if (0 === path.indexOf(normalizedKey)) {
- var temp = path.substr(normalizedKey.length);
- if (temp.charAt(0) === '.' || temp.length === 0) {
- path = temp.substr(1);
- var child = obj[key];
-
- // we're at the end and there is nothing.
- if (null == child) {
- finished = true;
- return;
- }
-
- // we're at the end and there is something.
- if (!path.length) {
- finished = true;
- return;
- }
-
- // step into child
- obj = child;
-
- // but we're done here
- return;
- }
- }
- }
-
- key = undefined;
- // if we found no matching properties
- // on the current object, there's no match.
- finished = true;
- }
-
- if (!key) return;
- if (null == obj) return obj;
-
- // the `obj` and `key` is one above the leaf object and key, so
- // start object: { a: { 'b.c': 10 } }
- // end object: { 'b.c': 10 }
- // end key: 'b.c'
- // this way, you can do `obj[key]` and get `10`.
- return fn(obj, key, val);
- };
- }
-
-
- /**
- * Find an object by its key
- *
- * find({ first_name : 'Calvin' }, 'firstName')
- */
-
- function find (obj, key) {
- if (obj.hasOwnProperty(key)) return obj[key];
- }
-
-
- /**
- * Delete a value for a given key
- *
- * del({ a : 'b', x : 'y' }, 'X' }) -> { a : 'b' }
- */
-
- function del (obj, key) {
- if (obj.hasOwnProperty(key)) delete obj[key];
- return obj;
- }
-
-
- /**
- * Replace an objects existing value with a new one
- *
- * replace({ a : 'b' }, 'a', 'c') -> { a : 'c' }
- */
-
- function replace (obj, key, val) {
- if (obj.hasOwnProperty(key)) obj[key] = val;
- return obj;
- }
-
- /**
- * Normalize a `dot.separated.path`.
- *
- * A.HELL(!*(!)O_WOR LD.bar => ahelloworldbar
- *
- * @param {String} path
- * @return {String}
- */
-
- function defaultNormalize(path) {
- return path.replace(/[^a-zA-Z0-9\.]+/g, '').toLowerCase();
- }
-
- /**
- * Check if a value is a function.
- *
- * @param {*} val
- * @return {boolean} Returns `true` if `val` is a function, otherwise `false`.
- */
-
- function isFunction(val) {
- return typeof val === 'function';
- }
- });
- var objCase_1 = objCase.find;
- var objCase_2 = objCase.replace;
- var objCase_3 = objCase.del;
-
- var Kissmetrics = /*#__PURE__*/function () {
- function Kissmetrics(config) {
- _classCallCheck(this, Kissmetrics);
-
- this.apiKey = config.apiKey;
- this.prefixProperties = config.prefixProperties;
- this.name = "KISSMETRICS";
- }
-
- _createClass(Kissmetrics, [{
- key: "init",
- value: function init() {
- logger.debug("===in init Kissmetrics===");
- window._kmq = window._kmq || [];
-
- var _kmk = window._kmk || this.apiKey;
-
- function _kms(u) {
- setTimeout(function () {
- var d = document;
- var f = d.getElementsByTagName("script")[0];
- var s = d.createElement("script");
- s.type = "text/javascript";
- s.async = true;
- s.src = u;
- f.parentNode.insertBefore(s, f);
- }, 1);
- }
-
- _kms("//i.kissmetrics.com/i.js");
-
- _kms("//scripts.kissmetrics.com/".concat(_kmk, ".2.js"));
-
- if (this.isEnvMobile()) {
- window._kmq.push(["set", {
- "Mobile Session": "Yes"
- }]);
- }
- }
- }, {
- key: "isEnvMobile",
- value: function isEnvMobile() {
- return navigator.userAgent.match(/Android/i) || navigator.userAgent.match(/BlackBerry/i) || navigator.userAgent.match(/IEMobile/i) || navigator.userAgent.match(/Opera Mini/i) || navigator.userAgent.match(/iPad/i) || navigator.userAgent.match(/iPhone|iPod/i);
- } // source : https://github.com/segment-integrations/analytics.js-integration-kissmetrics/blob/master/lib/index.js
-
- }, {
- key: "toUnixTimestamp",
- value: function toUnixTimestamp(date) {
- date = new Date(date);
- return Math.floor(date.getTime() / 1000);
- } // source : https://github.com/segment-integrations/analytics.js-integration-kissmetrics/blob/master/lib/index.js
-
- }, {
- key: "clean",
- value: function clean(obj) {
- var ret = {};
-
- for (var k in obj) {
- if (obj.hasOwnProperty(k)) {
- var value = obj[k];
- if (value === null || typeof value === "undefined") continue; // convert date to unix
-
- if (is_1.date(value)) {
- ret[k] = this.toUnixTimestamp(value);
- continue;
- } // leave boolean as is
-
-
- if (is_1.bool(value)) {
- ret[k] = value;
- continue;
- } // leave numbers as is
-
-
- if (is_1.number(value)) {
- ret[k] = value;
- continue;
- } // convert non objects to strings
-
-
- logger.debug(value.toString());
-
- if (value.toString() !== "[object Object]") {
- ret[k] = value.toString();
- continue;
- } // json
- // must flatten including the name of the original trait/property
-
-
- var nestedObj = {};
- nestedObj[k] = value;
- var flattenedObj = this.flatten(nestedObj, {
- safe: true
- }); // stringify arrays inside nested object to be consistent with top level behavior of arrays
-
- for (var key in flattenedObj) {
- if (is_1.array(flattenedObj[key])) {
- flattenedObj[key] = flattenedObj[key].toString();
- }
- }
-
- ret = extend_1(ret, flattenedObj);
- delete ret[k];
- }
- }
-
- return ret;
- } // source : https://github.com/segment-integrations/analytics.js-integration-kissmetrics/blob/master/lib/index.js
-
- }, {
- key: "flatten",
- value: function flatten(target, opts) {
- opts = opts || {};
- var delimiter = opts.delimiter || ".";
- var _opts = opts,
- maxDepth = _opts.maxDepth;
- var currentDepth = 1;
- var output = {};
-
- function step(object, prev) {
- for (var key in object) {
- if (object.hasOwnProperty(key)) {
- var value = object[key];
- var isarray = opts.safe && is_1.array(value);
- var type = Object.prototype.toString.call(value);
- var isobject = type === "[object Object]" || type === "[object Array]";
- var arr = [];
- var newKey = prev ? prev + delimiter + key : key;
-
- if (!opts.maxDepth) {
- maxDepth = currentDepth + 1;
- }
-
- for (var keys in value) {
- if (value.hasOwnProperty(keys)) {
- arr.push(keys);
- }
- }
-
- if (!isarray && isobject && arr.length && currentDepth < maxDepth) {
- ++currentDepth;
- return step(value, newKey);
- }
-
- output[newKey] = value;
- }
- }
- }
-
- step(target);
- return output;
- } // source : https://github.com/segment-integrations/analytics.js-integration-kissmetrics/blob/master/lib/index.js
-
- }, {
- key: "prefix",
- value: function prefix(event, properties) {
- var prefixed = {};
- componentEach(properties, function (key, val) {
- if (key === "Billing Amount") {
- prefixed[key] = val;
- } else if (key === "revenue") {
- prefixed["".concat(event, " - ").concat(key)] = val;
- prefixed["Billing Amount"] = val;
- } else {
- prefixed["".concat(event, " - ").concat(key)] = val;
- }
- });
- return prefixed;
- }
- }, {
- key: "identify",
- value: function identify(rudderElement) {
- logger.debug("in Kissmetrics identify");
- var traits = this.clean(rudderElement.message.context.traits);
- var userId = rudderElement.message.userId && rudderElement.message.userId != "" ? rudderElement.message.userId : undefined;
-
- if (userId) {
- window._kmq.push(["identify", userId]);
- }
-
- if (traits) {
- window._kmq.push(["set", traits]);
- }
- }
- }, {
- key: "track",
- value: function track(rudderElement) {
- logger.debug("in Kissmetrics track");
- var event = rudderElement.message.event;
- var properties = JSON.parse(JSON.stringify(rudderElement.message.properties));
- var timestamp = this.toUnixTimestamp(new Date());
- var revenue = getRevenue(properties);
-
- if (revenue) {
- properties.revenue = revenue;
- }
-
- var _properties = properties,
- products = _properties.products;
-
- if (products) {
- delete properties.products;
- }
-
- properties = this.clean(properties);
- logger.debug(JSON.stringify(properties));
-
- if (this.prefixProperties) {
- properties = this.prefix(event, properties);
- }
-
- window._kmq.push(["record", event, properties]);
-
- var iterator = function pushItem(product, i) {
- var item = product;
- if (this.prefixProperties) item = this.prefix(event, item);
- item._t = timestamp + i;
- item._d = 1;
- window.KM.set(item);
- }.bind(this);
-
- if (products) {
- window._kmq.push(function () {
- componentEach(products, iterator);
- });
- }
- }
- }, {
- key: "page",
- value: function page(rudderElement) {
- logger.debug("in Kissmetrics page");
- var pageName = rudderElement.message.name;
- var pageCategory = rudderElement.message.properties ? rudderElement.message.properties.category : undefined;
- var name = "Loaded a Page";
-
- if (pageName) {
- name = "Viewed ".concat(pageName, " page");
- }
-
- if (pageCategory && pageName) {
- name = "Viewed ".concat(pageCategory, " ").concat(pageName, " page");
- }
-
- var properties = rudderElement.message.properties;
-
- if (this.prefixProperties) {
- properties = this.prefix("Page", properties);
- }
-
- window._kmq.push(["record", name, properties]);
- }
- }, {
- key: "alias",
- value: function alias(rudderElement) {
- var prev = rudderElement.message.previousId;
- var userId = rudderElement.message.userId;
-
- window._kmq.push(["alias", userId, prev]);
- }
- }, {
- key: "group",
- value: function group(rudderElement) {
- var groupId = rudderElement.message.groupId;
- var groupTraits = rudderElement.message.traits;
- groupTraits = this.prefix("Group", groupTraits);
-
- if (groupId) {
- groupTraits["Group - id"] = groupId;
- }
-
- window._kmq.push(["set", groupTraits]);
-
- logger.debug("in Kissmetrics group");
- }
- }, {
- key: "isLoaded",
- value: function isLoaded() {
- return is_1.object(window.KM);
- }
- }, {
- key: "isReady",
- value: function isReady() {
- return is_1.object(window.KM);
- }
- }]);
-
- return Kissmetrics;
- }();
-
- var CustomerIO = /*#__PURE__*/function () {
- function CustomerIO(config) {
- _classCallCheck(this, CustomerIO);
-
- this.siteID = config.siteID;
- this.apiKey = config.apiKey;
- this.name = "CUSTOMERIO";
- }
-
- _createClass(CustomerIO, [{
- key: "init",
- value: function init() {
- logger.debug("===in init Customer IO init===");
- window._cio = window._cio || [];
- var siteID = this.siteID;
-
- (function () {
- var a;
- var b;
- var c;
-
- a = function a(f) {
- return function () {
- window._cio.push([f].concat(Array.prototype.slice.call(arguments, 0)));
- };
- };
-
- b = ["load", "identify", "sidentify", "track", "page"];
-
- for (c = 0; c < b.length; c++) {
- window._cio[b[c]] = a(b[c]);
- }
-
- var t = document.createElement("script");
- var s = document.getElementsByTagName("script")[0];
- t.async = true;
- t.id = "cio-tracker";
- t.setAttribute("data-site-id", siteID);
- t.src = "https://assets.customer.io/assets/track.js";
- s.parentNode.insertBefore(t, s);
- })();
- }
- }, {
- key: "identify",
- value: function identify(rudderElement) {
- logger.debug("in Customer IO identify");
- var userId = rudderElement.message.userId ? rudderElement.message.userId : rudderElement.message.anonymousId;
- var traits = rudderElement.message.context.traits ? rudderElement.message.context.traits : {};
-
- if (!traits.created_at) {
- traits.created_at = Math.floor(new Date().getTime() / 1000);
- }
-
- traits.id = userId;
-
- window._cio.identify(traits);
- }
- }, {
- key: "track",
- value: function track(rudderElement) {
- logger.debug("in Customer IO track");
- var eventName = rudderElement.message.event;
- var properties = rudderElement.message.properties;
-
- window._cio.track(eventName, properties);
- }
- }, {
- key: "page",
- value: function page(rudderElement) {
- logger.debug("in Customer IO page");
- var name = rudderElement.message.name || rudderElement.message.properties.url;
-
- window._cio.page(name, rudderElement.message.properties);
- }
- }, {
- key: "isLoaded",
- value: function isLoaded() {
- return !!(window._cio && window._cio.push !== Array.prototype.push);
- }
- }, {
- key: "isReady",
- value: function isReady() {
- return !!(window._cio && window._cio.push !== Array.prototype.push);
- }
- }]);
-
- return CustomerIO;
- }();
-
- /**
- * Cache whether `` exists.
- */
-
- var body = false;
-
-
- /**
- * Callbacks to call when the body exists.
- */
-
- var callbacks = [];
-
-
- /**
- * Export a way to add handlers to be invoked once the body exists.
- *
- * @param {Function} callback A function to call when the body exists.
- */
-
- var onBody = function onBody (callback) {
- if (body) {
- call(callback);
- } else {
- callbacks.push(callback);
- }
- };
-
-
- /**
- * Set an interval to check for `document.body`.
- */
-
- var interval = setInterval(function () {
- if (!document.body) return;
- body = true;
- componentEach(callbacks, call);
- clearInterval(interval);
- }, 5);
-
-
- /**
- * Call a callback, passing it the body.
- *
- * @param {Function} callback The callback to call.
- */
-
- function call (callback) {
- callback(document.body);
- }
-
- var Chartbeat = /*#__PURE__*/function () {
- function Chartbeat(config, analytics) {
- _classCallCheck(this, Chartbeat);
-
- this.analytics = analytics; // use this to modify failed integrations or for passing events from callback to other destinations
-
- this._sf_async_config = window._sf_async_config = window._sf_async_config || {};
- window._sf_async_config.useCanonical = true;
- window._sf_async_config.uid = config.uid;
- window._sf_async_config.domain = config.domain;
- this.isVideo = !!config.video;
- this.sendNameAndCategoryAsTitle = config.sendNameAndCategoryAsTitle || true;
- this.subscriberEngagementKeys = config.subscriberEngagementKeys || [];
- this.replayEvents = [];
- this.failed = false;
- this.isFirstPageCallMade = false;
- this.name = "CHARTBEAT";
- }
-
- _createClass(Chartbeat, [{
- key: "init",
- value: function init() {
- logger.debug("===in init Chartbeat===");
- }
- }, {
- key: "identify",
- value: function identify(rudderElement) {
- logger.debug("in Chartbeat identify");
- }
- }, {
- key: "track",
- value: function track(rudderElement) {
- logger.debug("in Chartbeat track");
- }
- }, {
- key: "page",
- value: function page(rudderElement) {
- logger.debug("in Chartbeat page");
- this.loadConfig(rudderElement);
-
- if (!this.isFirstPageCallMade) {
- this.isFirstPageCallMade = true;
- this.initAfterPage();
- } else {
- if (this.failed) {
- logger.debug("===ignoring cause failed integration===");
- this.replayEvents = [];
- return;
- }
-
- if (!this.isLoaded() && !this.failed) {
- logger.debug("===pushing to replay queue for chartbeat===");
- this.replayEvents.push(["page", rudderElement]);
- return;
- }
-
- logger.debug("===processing page event in chartbeat===");
- var properties = rudderElement.message.properties;
- window.pSUPERFLY.virtualPage(properties.path);
- }
- }
- }, {
- key: "isLoaded",
- value: function isLoaded() {
- logger.debug("in Chartbeat isLoaded");
-
- if (!this.isFirstPageCallMade) {
- return true;
- }
-
- return !!window.pSUPERFLY;
- }
- }, {
- key: "isFailed",
- value: function isFailed() {
- return this.failed;
- }
- }, {
- key: "isReady",
- value: function isReady() {
- return !!window.pSUPERFLY;
- }
- }, {
- key: "loadConfig",
- value: function loadConfig(rudderElement) {
- var properties = rudderElement.message.properties;
- var category = properties ? properties.category : undefined;
- var name = rudderElement.message.name;
- var author = properties ? properties.author : undefined;
- var title;
-
- if (this.sendNameAndCategoryAsTitle) {
- title = category && name ? "".concat(category, " ").concat(name) : name;
- }
-
- if (category) window._sf_async_config.sections = category;
- if (author) window._sf_async_config.authors = author;
- if (title) window._sf_async_config.title = title;
-
- var _cbq = window._cbq = window._cbq || [];
-
- for (var key in properties) {
- if (!properties.hasOwnProperty(key)) continue;
-
- if (this.subscriberEngagementKeys.indexOf(key) > -1) {
- _cbq.push([key, properties[key]]);
- }
- }
- }
- }, {
- key: "initAfterPage",
- value: function initAfterPage() {
- var _this = this;
-
- onBody(function () {
- var script = _this.isVideo ? "chartbeat_video.js" : "chartbeat.js";
-
- function loadChartbeat() {
- var e = document.createElement("script");
- var n = document.getElementsByTagName("script")[0];
- e.type = "text/javascript";
- e.async = true;
- e.src = "//static.chartbeat.com/js/".concat(script);
- n.parentNode.insertBefore(e, n);
- }
-
- loadChartbeat();
- });
-
- this._isReady(this).then(function (instance) {
- logger.debug("===replaying on chartbeat===");
- instance.replayEvents.forEach(function (event) {
- instance[event[0]](event[1]);
- });
- });
- }
- }, {
- key: "pause",
- value: function pause(time) {
- return new Promise(function (resolve) {
- setTimeout(resolve, time);
- });
- }
- }, {
- key: "_isReady",
- value: function _isReady(instance) {
- var _this2 = this;
-
- var time = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
- return new Promise(function (resolve) {
- if (_this2.isLoaded()) {
- _this2.failed = false;
- logger.debug("===chartbeat loaded successfully===");
- instance.analytics.emit("ready");
- return resolve(instance);
- }
-
- if (time >= MAX_WAIT_FOR_INTEGRATION_LOAD) {
- _this2.failed = true;
- logger.debug("===chartbeat failed===");
- return resolve(instance);
- }
-
- _this2.pause(INTEGRATION_LOAD_CHECK_INTERVAL).then(function () {
- return _this2._isReady(instance, time + INTEGRATION_LOAD_CHECK_INTERVAL).then(resolve);
- });
- });
- }
- }]);
-
- return Chartbeat;
- }();
-
- var Comscore = /*#__PURE__*/function () {
- function Comscore(config, analytics) {
- _classCallCheck(this, Comscore);
-
- this.c2ID = config.c2ID;
- this.analytics = analytics;
- this.comScoreBeaconParam = config.comScoreBeaconParam ? config.comScoreBeaconParam : {};
- this.isFirstPageCallMade = false;
- this.failed = false;
- this.comScoreParams = {};
- this.replayEvents = [];
- this.name = "COMSCORE";
- }
-
- _createClass(Comscore, [{
- key: "init",
- value: function init() {
- logger.debug("===in init Comscore init===");
- }
- }, {
- key: "identify",
- value: function identify(rudderElement) {
- logger.debug("in Comscore identify");
- }
- }, {
- key: "track",
- value: function track(rudderElement) {
- logger.debug("in Comscore track");
- }
- }, {
- key: "page",
- value: function page(rudderElement) {
- logger.debug("in Comscore page");
- this.loadConfig(rudderElement);
-
- if (!this.isFirstPageCallMade) {
- this.isFirstPageCallMade = true;
- this.initAfterPage();
- } else {
- if (this.failed) {
- this.replayEvents = [];
- return;
- }
-
- if (!this.isLoaded() && !this.failed) {
- this.replayEvents.push(["page", rudderElement]);
- return;
- }
-
- var properties = rudderElement.message.properties; // window.COMSCORE.beacon({c1:"2", c2: ""});
- // this.comScoreParams = this.mapComscoreParams(properties);
-
- window.COMSCORE.beacon(this.comScoreParams);
- }
- }
- }, {
- key: "loadConfig",
- value: function loadConfig(rudderElement) {
- logger.debug("=====in loadConfig=====");
- this.comScoreParams = this.mapComscoreParams(rudderElement.message.properties);
- window._comscore = window._comscore || [];
-
- window._comscore.push(this.comScoreParams);
- }
- }, {
- key: "initAfterPage",
- value: function initAfterPage() {
- logger.debug("=====in initAfterPage=====");
-
- (function () {
- var s = document.createElement("script");
- var el = document.getElementsByTagName("script")[0];
- s.async = true;
- s.src = "".concat(document.location.protocol == "https:" ? "https://sb" : "http://b", ".scorecardresearch.com/beacon.js");
- el.parentNode.insertBefore(s, el);
- })();
-
- this._isReady(this).then(function (instance) {
- instance.replayEvents.forEach(function (event) {
- instance[event[0]](event[1]);
- });
- });
- }
- }, {
- key: "pause",
- value: function pause(time) {
- return new Promise(function (resolve) {
- setTimeout(resolve, time);
- });
- }
- }, {
- key: "_isReady",
- value: function _isReady(instance) {
- var _this = this;
-
- var time = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
- return new Promise(function (resolve) {
- if (_this.isLoaded()) {
- _this.failed = false;
- instance.analytics.emit("ready");
- return resolve(instance);
- }
-
- if (time >= MAX_WAIT_FOR_INTEGRATION_LOAD) {
- _this.failed = true;
- return resolve(instance);
- }
-
- _this.pause(INTEGRATION_LOAD_CHECK_INTERVAL).then(function () {
- return _this._isReady(instance, time + INTEGRATION_LOAD_CHECK_INTERVAL).then(resolve);
- });
- });
- }
- }, {
- key: "mapComscoreParams",
- value: function mapComscoreParams(properties) {
- logger.debug("=====in mapComscoreParams=====");
- var comScoreBeaconParamsMap = this.comScoreBeaconParam;
- var comScoreParams = {};
- Object.keys(comScoreBeaconParamsMap).forEach(function (property) {
- if (property in properties) {
- var key = comScoreBeaconParamsMap[property];
- var value = properties[property];
- comScoreParams[key] = value;
- }
- });
- comScoreParams.c1 = "2";
- comScoreParams.c2 = this.c2ID;
- /* if (this.options.comscorekw.length) {
- comScoreParams.comscorekw = this.options.comscorekw;
- } */
-
- logger.debug("=====in mapComscoreParams=====", comScoreParams);
- return comScoreParams;
- }
- }, {
- key: "isLoaded",
- value: function isLoaded() {
- logger.debug("in Comscore isLoaded");
-
- if (!this.isFirstPageCallMade) {
- return true;
- }
-
- return !!window.COMSCORE;
- }
- }, {
- key: "isReady",
- value: function isReady() {
- return !!window.COMSCORE;
- }
- }]);
-
- return Comscore;
- }();
-
- var hop = Object.prototype.hasOwnProperty;
- var strCharAt = String.prototype.charAt;
- var toStr$1 = Object.prototype.toString;
-
- /**
- * Returns the character at a given index.
- *
- * @param {string} str
- * @param {number} index
- * @return {string|undefined}
- */
- // TODO: Move to a library
- var charAt = function(str, index) {
- return strCharAt.call(str, index);
- };
-
- /**
- * hasOwnProperty, wrapped as a function.
- *
- * @name has
- * @api private
- * @param {*} context
- * @param {string|number} prop
- * @return {boolean}
- */
-
- // TODO: Move to a library
- var has$2 = function has(context, prop) {
- return hop.call(context, prop);
- };
-
- /**
- * Returns true if a value is a string, otherwise false.
- *
- * @name isString
- * @api private
- * @param {*} val
- * @return {boolean}
- */
-
- // TODO: Move to a library
- var isString = function isString(val) {
- return toStr$1.call(val) === '[object String]';
- };
-
- /**
- * Returns true if a value is array-like, otherwise false. Array-like means a
- * value is not null, undefined, or a function, and has a numeric `length`
- * property.
- *
- * @name isArrayLike
- * @api private
- * @param {*} val
- * @return {boolean}
- */
- // TODO: Move to a library
- var isArrayLike = function isArrayLike(val) {
- return val != null && (typeof val !== 'function' && typeof val.length === 'number');
- };
-
-
- /**
- * indexKeys
- *
- * @name indexKeys
- * @api private
- * @param {} target
- * @param {Function} pred
- * @return {Array}
- */
- var indexKeys = function indexKeys(target, pred) {
- pred = pred || has$2;
-
- var results = [];
-
- for (var i = 0, len = target.length; i < len; i += 1) {
- if (pred(target, i)) {
- results.push(String(i));
- }
- }
-
- return results;
- };
-
- /**
- * Returns an array of an object's owned keys.
- *
- * @name objectKeys
- * @api private
- * @param {*} target
- * @param {Function} pred Predicate function used to include/exclude values from
- * the resulting array.
- * @return {Array}
- */
- var objectKeys = function objectKeys(target, pred) {
- pred = pred || has$2;
-
- var results = [];
-
- for (var key in target) {
- if (pred(target, key)) {
- results.push(String(key));
- }
- }
-
- return results;
- };
-
- /**
- * Creates an array composed of all keys on the input object. Ignores any non-enumerable properties.
- * More permissive than the native `Object.keys` function (non-objects will not throw errors).
- *
- * @name keys
- * @api public
- * @category Object
- * @param {Object} source The value to retrieve keys from.
- * @return {Array} An array containing all the input `source`'s keys.
- * @example
- * keys({ likes: 'avocado', hates: 'pineapple' });
- * //=> ['likes', 'pineapple'];
- *
- * // Ignores non-enumerable properties
- * var hasHiddenKey = { name: 'Tim' };
- * Object.defineProperty(hasHiddenKey, 'hidden', {
- * value: 'i am not enumerable!',
- * enumerable: false
- * })
- * keys(hasHiddenKey);
- * //=> ['name'];
- *
- * // Works on arrays
- * keys(['a', 'b', 'c']);
- * //=> ['0', '1', '2']
- *
- * // Skips unpopulated indices in sparse arrays
- * var arr = [1];
- * arr[4] = 4;
- * keys(arr);
- * //=> ['0', '4']
- */
- var keys = function keys(source) {
- if (source == null) {
- return [];
- }
-
- // IE6-8 compatibility (string)
- if (isString(source)) {
- return indexKeys(source, charAt);
- }
-
- // IE6-8 compatibility (arguments)
- if (isArrayLike(source)) {
- return indexKeys(source, has$2);
- }
-
- return objectKeys(source);
- };
-
- /*
- * Exports.
- */
-
- var keys_1 = keys;
-
- /*
- * Module dependencies.
- */
-
-
-
- var objToString = Object.prototype.toString;
-
- /**
- * Tests if a value is a number.
- *
- * @name isNumber
- * @api private
- * @param {*} val The value to test.
- * @return {boolean} Returns `true` if `val` is a number, otherwise `false`.
- */
- // TODO: Move to library
- var isNumber = function isNumber(val) {
- var type = typeof val;
- return type === 'number' || (type === 'object' && objToString.call(val) === '[object Number]');
- };
-
- /**
- * Tests if a value is an array.
- *
- * @name isArray
- * @api private
- * @param {*} val The value to test.
- * @return {boolean} Returns `true` if the value is an array, otherwise `false`.
- */
- // TODO: Move to library
- var isArray = typeof Array.isArray === 'function' ? Array.isArray : function isArray(val) {
- return objToString.call(val) === '[object Array]';
- };
-
- /**
- * Tests if a value is array-like. Array-like means the value is not a function and has a numeric
- * `.length` property.
- *
- * @name isArrayLike
- * @api private
- * @param {*} val
- * @return {boolean}
- */
- // TODO: Move to library
- var isArrayLike$1 = function isArrayLike(val) {
- return val != null && (isArray(val) || (val !== 'function' && isNumber(val.length)));
- };
-
- /**
- * Internal implementation of `each`. Works on arrays and array-like data structures.
- *
- * @name arrayEach
- * @api private
- * @param {Function(value, key, collection)} iterator The function to invoke per iteration.
- * @param {Array} array The array(-like) structure to iterate over.
- * @return {undefined}
- */
- var arrayEach = function arrayEach(iterator, array) {
- for (var i = 0; i < array.length; i += 1) {
- // Break iteration early if `iterator` returns `false`
- if (iterator(array[i], i, array) === false) {
- break;
- }
- }
- };
-
- /**
- * Internal implementation of `each`. Works on objects.
- *
- * @name baseEach
- * @api private
- * @param {Function(value, key, collection)} iterator The function to invoke per iteration.
- * @param {Object} object The object to iterate over.
- * @return {undefined}
- */
- var baseEach = function baseEach(iterator, object) {
- var ks = keys_1(object);
-
- for (var i = 0; i < ks.length; i += 1) {
- // Break iteration early if `iterator` returns `false`
- if (iterator(object[ks[i]], ks[i], object) === false) {
- break;
- }
- }
- };
-
- /**
- * Iterate over an input collection, invoking an `iterator` function for each element in the
- * collection and passing to it three arguments: `(value, index, collection)`. The `iterator`
- * function can end iteration early by returning `false`.
- *
- * @name each
- * @api public
- * @param {Function(value, key, collection)} iterator The function to invoke per iteration.
- * @param {Array|Object|string} collection The collection to iterate over.
- * @return {undefined} Because `each` is run only for side effects, always returns `undefined`.
- * @example
- * var log = console.log.bind(console);
- *
- * each(log, ['a', 'b', 'c']);
- * //-> 'a', 0, ['a', 'b', 'c']
- * //-> 'b', 1, ['a', 'b', 'c']
- * //-> 'c', 2, ['a', 'b', 'c']
- * //=> undefined
- *
- * each(log, 'tim');
- * //-> 't', 2, 'tim'
- * //-> 'i', 1, 'tim'
- * //-> 'm', 0, 'tim'
- * //=> undefined
- *
- * // Note: Iteration order not guaranteed across environments
- * each(log, { name: 'tim', occupation: 'enchanter' });
- * //-> 'tim', 'name', { name: 'tim', occupation: 'enchanter' }
- * //-> 'enchanter', 'occupation', { name: 'tim', occupation: 'enchanter' }
- * //=> undefined
- */
- var each = function each(iterator, collection) {
- return (isArrayLike$1(collection) ? arrayEach : baseEach).call(this, iterator, collection);
- };
-
- /*
- * Exports.
- */
-
- var each_1 = each;
-
- var FacebookPixel = /*#__PURE__*/function () {
- function FacebookPixel(config) {
- _classCallCheck(this, FacebookPixel);
-
- this.blacklistPiiProperties = config.blacklistPiiProperties;
- this.categoryToContent = config.categoryToContent;
- this.pixelId = config.pixelId;
- this.eventsToEvents = config.eventsToEvents;
- this.eventCustomProperties = config.eventCustomProperties;
- this.valueFieldIdentifier = config.valueFieldIdentifier;
- this.advancedMapping = config.advancedMapping;
- this.traitKeyToExternalId = config.traitKeyToExternalId;
- this.legacyConversionPixelId = config.legacyConversionPixelId;
- this.userIdAsPixelId = config.userIdAsPixelId;
- this.whitelistPiiProperties = config.whitelistPiiProperties;
- this.name = "FB_PIXEL";
- }
-
- _createClass(FacebookPixel, [{
- key: "init",
- value: function init() {
- if (this.categoryToContent === undefined) {
- this.categoryToContent = [];
- }
-
- if (this.legacyConversionPixelId === undefined) {
- this.legacyConversionPixelId = [];
- }
-
- if (this.userIdAsPixelId === undefined) {
- this.userIdAsPixelId = [];
- }
-
- logger.debug("===in init FbPixel===");
-
- window._fbq = function () {
- if (window.fbq.callMethod) {
- window.fbq.callMethod.apply(window.fbq, arguments);
- } else {
- window.fbq.queue.push(arguments);
- }
- };
-
- window.fbq = window.fbq || window._fbq;
- window.fbq.push = window.fbq;
- window.fbq.loaded = true;
- window.fbq.disablePushState = true; // disables automatic pageview tracking
-
- window.fbq.allowDuplicatePageViews = true; // enables fb
-
- window.fbq.version = "2.0";
- window.fbq.queue = [];
- window.fbq("init", this.pixelId);
- ScriptLoader("fbpixel-integration", "//connect.facebook.net/en_US/fbevents.js");
- }
- }, {
- key: "isLoaded",
- value: function isLoaded() {
- logger.debug("in FBPixel isLoaded");
- return !!(window.fbq && window.fbq.callMethod);
- }
- }, {
- key: "isReady",
- value: function isReady() {
- logger.debug("in FBPixel isReady");
- return !!(window.fbq && window.fbq.callMethod);
- }
- }, {
- key: "page",
- value: function page(rudderElement) {
- window.fbq("track", "PageView");
- }
- }, {
- key: "identify",
- value: function identify(rudderElement) {
- if (this.advancedMapping) {
- window.fbq("init", this.pixelId, rudderElement.message.context.traits);
- }
- }
- }, {
- key: "track",
- value: function track(rudderElement) {
- var _this = this;
-
- var self = this;
- var event = rudderElement.message.event;
- var revenue = this.formatRevenue(rudderElement.message.properties.revenue);
- var payload = this.buildPayLoad(rudderElement, true);
-
- if (this.categoryToContent === undefined) {
- this.categoryToContent = [];
- }
-
- if (this.legacyConversionPixelId === undefined) {
- this.legacyConversionPixelId = [];
- }
-
- if (this.userIdAsPixelId === undefined) {
- this.userIdAsPixelId = [];
- }
-
- payload.value = revenue;
- var standard = this.eventsToEvents;
- var legacy = this.legacyConversionPixelId;
- var standardTo;
- var legacyTo;
- standardTo = standard.reduce(function (filtered, standard) {
- if (standard.from === event) {
- filtered.push(standard.to);
- }
-
- return filtered;
- }, []);
- legacyTo = legacy.reduce(function (filtered, legacy) {
- if (legacy.from === event) {
- filtered.push(legacy.to);
- }
-
- return filtered;
- }, []);
- each_1(function (event) {
- payload.currency = rudderElement.message.properties.currency || "USD";
- window.fbq("trackSingle", self.pixelId, event, payload, {
- eventID: rudderElement.message.messageId
- });
- }, standardTo);
- each_1(function (event) {
- window.fbq("trackSingle", self.pixelId, event, {
- currency: rudderElement.message.properties.currency,
- value: revenue
- }, {
- eventID: rudderElement.message.messageId
- });
- }, legacyTo);
-
- if (event === "Product List Viewed") {
- var contentType;
- var contentIds;
- var contents = [];
- var products = rudderElement.message.properties.products;
- var customProperties = this.buildPayLoad(rudderElement, true);
-
- if (Array.isArray(products)) {
- products.forEach(function (product) {
- var productId = product.product_id;
-
- if (productId) {
- contentIds.push(productId);
- contents.push({
- id: productId,
- quantity: rudderElement.message.properties.quantity
- });
- }
- });
- }
-
- if (contentIds.length) {
- contentType = ["product"];
- } else {
- contentIds.push(rudderElement.message.properties.category || "");
- contents.push({
- id: rudderElement.message.properties.category || "",
- quantity: 1
- });
- contentType = ["product_group"];
- }
-
- window.fbq("trackSingle", self.pixelId, "ViewContent", this.merge({
- content_ids: contentIds,
- content_type: this.getContentType(rudderElement, contentType),
- contents: contents
- }, customProperties), {
- eventID: rudderElement.message.messageId
- });
- each_1(function (event) {
- window.fbq("trackSingle", self.pixelId, event, {
- currency: rudderElement.message.properties.currency,
- value: _this.formatRevenue(rudderElement.message.properties.revenue)
- }, {
- eventID: rudderElement.message.messageId
- });
- }, legacyTo);
- } else if (event === "Product Viewed") {
- var useValue = this.valueFieldIdentifier === "properties.value";
- var customProperties = this.buildPayLoad(rudderElement, true);
- window.fbq("trackSingle", self.pixelId, "ViewContent", this.merge({
- content_ids: [rudderElement.message.properties.product_id || rudderElement.message.properties.id || rudderElement.message.properties.sku || ""],
- content_type: this.getContentType(rudderElement, ["product"]),
- content_name: rudderElement.message.properties.product_name || "",
- content_category: rudderElement.message.properties.category || "",
- currency: rudderElement.message.properties.currency,
- value: useValue ? this.formatRevenue(rudderElement.message.properties.value) : this.formatRevenue(rudderElement.message.properties.price),
- contents: [{
- id: rudderElement.message.properties.product_id || rudderElement.message.properties.id || rudderElement.message.properties.sku || "",
- quantity: rudderElement.message.properties.quantity,
- item_price: rudderElement.message.properties.price
- }]
- }, customProperties), {
- eventID: rudderElement.message.messageId
- });
- each_1(function (event) {
- window.fbq("trackSingle", self.pixelId, event, {
- currency: rudderElement.message.properties.currency,
- value: useValue ? _this.formatRevenue(rudderElement.message.properties.value) : _this.formatRevenue(rudderElement.message.properties.price)
- }, {
- eventID: rudderElement.message.messageId
- });
- }, legacyTo);
- } else if (event === "Product Added") {
- var useValue = this.valueFieldIdentifier === "properties.value";
- var customProperties = this.buildPayLoad(rudderElement, true);
- window.fbq("trackSingle", self.pixelId, "AddToCart", this.merge({
- content_ids: [rudderElement.message.properties.product_id || rudderElement.message.properties.id || rudderElement.message.properties.sku || ""],
- content_type: this.getContentType(rudderElement, ["product"]),
- content_name: rudderElement.message.properties.product_name || "",
- content_category: rudderElement.message.properties.category || "",
- currency: rudderElement.message.properties.currency,
- value: useValue ? this.formatRevenue(rudderElement.message.properties.value) : this.formatRevenue(rudderElement.message.properties.price),
- contents: [{
- id: rudderElement.message.properties.product_id || rudderElement.message.properties.id || rudderElement.message.properties.sku || "",
- quantity: rudderElement.message.properties.quantity,
- item_price: rudderElement.message.properties.price
- }]
- }, customProperties), {
- eventID: rudderElement.message.messageId
- });
- each_1(function (event) {
- window.fbq("trackSingle", self.pixelId, event, {
- currency: rudderElement.message.properties.currency,
- value: useValue ? _this.formatRevenue(rudderElement.message.properties.value) : _this.formatRevenue(rudderElement.message.properties.price)
- }, {
- eventID: rudderElement.message.messageId
- });
- }, legacyTo);
- this.merge({
- content_ids: [rudderElement.message.properties.product_id || rudderElement.message.properties.id || rudderElement.message.properties.sku || ""],
- content_type: this.getContentType(rudderElement, ["product"]),
- content_name: rudderElement.message.properties.product_name || "",
- content_category: rudderElement.message.properties.category || "",
- currency: rudderElement.message.properties.currency,
- value: useValue ? this.formatRevenue(rudderElement.message.properties.value) : this.formatRevenue(rudderElement.message.properties.price),
- contents: [{
- id: rudderElement.message.properties.product_id || rudderElement.message.properties.id || rudderElement.message.properties.sku || "",
- quantity: rudderElement.message.properties.quantity,
- item_price: rudderElement.message.properties.price
- }]
- }, customProperties);
- } else if (event === "Order Completed") {
- var products = rudderElement.message.properties.products;
- var customProperties = this.buildPayLoad(rudderElement, true);
- var revenue = this.formatRevenue(rudderElement.message.properties.revenue);
- var contentType = this.getContentType(rudderElement, ["product"]);
- var contentIds = [];
- var contents = [];
-
- for (var i = 0; i < products.length; i++) {
- var pId = product.product_id;
- contentIds.push(pId);
- var content = {
- id: pId,
- quantity: rudderElement.message.properties.quantity
- };
-
- if (rudderElement.message.properties.price) {
- content.item_price = rudderElement.message.properties.price;
- }
-
- contents.push(content);
- }
-
- window.fbq("trackSingle", self.pixelId, "Purchase", this.merge({
- content_ids: contentIds,
- content_type: contentType,
- currency: rudderElement.message.properties.currency,
- value: revenue,
- contents: contents,
- num_items: contentIds.length
- }, customProperties), {
- eventID: rudderElement.message.messageId
- });
- each_1(function (event) {
- window.fbq("trackSingle", self.pixelId, event, {
- currency: rudderElement.message.properties.currency,
- value: _this.formatRevenue(rudderElement.message.properties.revenue)
- }, {
- eventID: rudderElement.message.messageId
- });
- }, legacyTo);
- } else if (event === "Products Searched") {
- var customProperties = this.buildPayLoad(rudderElement, true);
- window.fbq("trackSingle", self.pixelId, "Search", this.merge({
- search_string: rudderElement.message.properties.query
- }, customProperties), {
- eventID: rudderElement.message.messageId
- });
- each_1(function (event) {
- window.fbq("trackSingle", self.pixelId, event, {
- currency: rudderElement.message.properties.currency,
- value: formatRevenue(rudderElement.message.properties.revenue)
- }, {
- eventID: rudderElement.message.messageId
- });
- }, legacyTo);
- } else if (event === "Checkout Started") {
- var products = rudderElement.message.properties.products;
- var customProperties = this.buildPayLoad(rudderElement, true);
- var revenue = this.formatRevenue(rudderElement.message.properties.revenue);
- var contentCategory = rudderElement.message.properties.category;
- var contentIds = [];
- var contents = [];
-
- for (var i = 0; i < products.length; i++) {
- var _product = products[i];
- var pId = _product.product_id;
- contentIds.push(pId);
- var content = {
- id: pId,
- quantity: rudderElement.message.properties.quantity,
- item_price: rudderElement.message.properties.price
- };
-
- if (rudderElement.message.properties.price) {
- content.item_price = rudderElement.message.properties.price;
- }
-
- contents.push(content);
- }
-
- if (!contentCategory && products[0] && products[0].category) {
- contentCategory = products[0].category;
- }
-
- window.fbq("trackSingle", self.pixelId, "InitiateCheckout", this.merge({
- content_category: contentCategory,
- content_ids: contentIds,
- content_type: this.getContentType(rudderElement, ["product"]),
- currency: rudderElement.message.properties.currency,
- value: revenue,
- contents: contents,
- num_items: contentIds.length
- }, customProperties), {
- eventID: rudderElement.message.messageId
- });
- each_1(function (event) {
- window.fbq("trackSingle", self.pixelId, event, {
- currency: rudderElement.message.properties.currency,
- value: _this.formatRevenue(rudderElement.message.properties.revenue)
- }, {
- eventID: rudderElement.message.messageId
- });
- }, legacyTo);
- }
- }
- }, {
- key: "getContentType",
- value: function getContentType(rudderElement, defaultValue) {
- var options = rudderElement.message.options;
-
- if (options && options.contentType) {
- return [options.contentType];
- }
-
- var category = rudderElement.message.properties.category;
-
- if (!category) {
- var products = rudderElement.message.properties.products;
-
- if (products && products.length) {
- category = products[0].category;
- }
- }
-
- if (category) {
- var mapped = this.categoryToContent;
- var mappedTo;
- mappedTo = mapped.reduce(function (filtered, mapped) {
- if (mapped.from == category) {
- filtered.push(mapped.to);
- }
-
- return filtered;
- }, []);
-
- if (mappedTo.length) {
- return mappedTo;
- }
- }
-
- return defaultValue;
- }
- }, {
- key: "merge",
- value: function merge(obj1, obj2) {
- var res = {}; // All properties of obj1
-
- for (var propObj1 in obj1) {
- if (obj1.hasOwnProperty(propObj1)) {
- res[propObj1] = obj1[propObj1];
- }
- } // Extra properties of obj2
-
-
- for (var propObj2 in obj2) {
- if (obj2.hasOwnProperty(propObj2) && !res.hasOwnProperty(propObj2)) {
- res[propObj2] = obj2[propObj2];
- }
- }
-
- return res;
- }
- }, {
- key: "formatRevenue",
- value: function formatRevenue(revenue) {
- return Number(revenue || 0).toFixed(2);
- }
- }, {
- key: "buildPayLoad",
- value: function buildPayLoad(rudderElement, isStandardEvent) {
- var dateFields = ["checkinDate", "checkoutDate", "departingArrivalDate", "departingDepartureDate", "returningArrivalDate", "returningDepartureDate", "travelEnd", "travelStart"];
- var defaultPiiProperties = ["email", "firstName", "lastName", "gender", "city", "country", "phone", "state", "zip", "birthday"];
- var whitelistPiiProperties = this.whitelistPiiProperties || [];
- var blacklistPiiProperties = this.blacklistPiiProperties || [];
- var eventCustomProperties = this.eventCustomProperties || [];
- var customPiiProperties = {};
-
- for (var i = 0; i < blacklistPiiProperties[i]; i++) {
- var configuration = blacklistPiiProperties[i];
- customPiiProperties[configuration.blacklistPiiProperties] = configuration.blacklistPiiHash;
- }
-
- var payload = {};
- var properties = rudderElement.message.properties;
-
- for (var property in properties) {
- if (!properties.hasOwnProperty(property)) {
- continue;
- }
-
- if (isStandardEvent && eventCustomProperties.indexOf(property) < 0) {
- continue;
- }
-
- var value = properties[property];
-
- if (dateFields.indexOf(properties) >= 0) {
- if (is_1.date(value)) {
- payload[property] = value.toISOTring().split("T")[0];
- continue;
- }
- }
-
- if (customPiiProperties.hasOwnProperty(property)) {
- if (customPiiProperties[property] && typeof value === "string") {
- payload[property] = sha256(value);
- }
-
- continue;
- }
-
- var isPropertyPii = defaultPiiProperties.indexOf(property) >= 0;
- var isProperyWhiteListed = whitelistPiiProperties.indexOf(property) >= 0;
-
- if (!isPropertyPii || isProperyWhiteListed) {
- payload[property] = value;
- }
- }
-
- return payload;
- }
- }]);
-
- return FacebookPixel;
- }();
-
- /**
- * toString ref.
- */
-
- var toString$2 = Object.prototype.toString;
-
- /**
- * Return the type of `val`.
- *
- * @param {Mixed} val
- * @return {String}
- * @api public
- */
-
- var componentType$1 = function(val){
- switch (toString$2.call(val)) {
- case '[object Date]': return 'date';
- case '[object RegExp]': return 'regexp';
- case '[object Arguments]': return 'arguments';
- case '[object Array]': return 'array';
- case '[object Error]': return 'error';
- }
-
- if (val === null) return 'null';
- if (val === undefined) return 'undefined';
- if (val !== val) return 'nan';
- if (val && val.nodeType === 1) return 'element';
-
- if (isBuffer$1(val)) return 'buffer';
-
- val = val.valueOf
- ? val.valueOf()
- : Object.prototype.valueOf.apply(val);
-
- return typeof val;
- };
-
- // code borrowed from https://github.com/feross/is-buffer/blob/master/index.js
- function isBuffer$1(obj) {
- return !!(obj != null &&
- (obj._isBuffer || // For Safari 5-7 (missing Object.prototype.constructor)
- (obj.constructor &&
- typeof obj.constructor.isBuffer === 'function' &&
- obj.constructor.isBuffer(obj))
- ))
- }
-
- /*
- * Module dependencies.
- */
-
-
-
- /**
- * Deeply clone an object.
- *
- * @param {*} obj Any object.
- */
-
- var clone = function clone(obj) {
- var t = componentType$1(obj);
-
- if (t === 'object') {
- var copy = {};
- for (var key in obj) {
- if (obj.hasOwnProperty(key)) {
- copy[key] = clone(obj[key]);
- }
- }
- return copy;
- }
-
- if (t === 'array') {
- var copy = new Array(obj.length);
- for (var i = 0, l = obj.length; i < l; i++) {
- copy[i] = clone(obj[i]);
- }
- return copy;
- }
-
- if (t === 'regexp') {
- // from millermedeiros/amd-utils - MIT
- var flags = '';
- flags += obj.multiline ? 'm' : '';
- flags += obj.global ? 'g' : '';
- flags += obj.ignoreCase ? 'i' : '';
- return new RegExp(obj.source, flags);
- }
-
- if (t === 'date') {
- return new Date(obj.getTime());
- }
-
- // string, number, boolean, etc.
- return obj;
- };
-
- /*
- * Exports.
- */
-
- var clone_1 = clone;
-
- /**
- * Helpers.
- */
-
- var s = 1000;
- var m = s * 60;
- var h = m * 60;
- var d = h * 24;
- var y = d * 365.25;
-
- /**
- * Parse or format the given `val`.
- *
- * Options:
- *
- * - `long` verbose formatting [false]
- *
- * @param {String|Number} val
- * @param {Object} options
- * @return {String|Number}
- * @api public
- */
-
- var ms = function(val, options){
- options = options || {};
- if ('string' == typeof val) return parse(val);
- return options.long
- ? long(val)
- : short(val);
- };
-
- /**
- * Parse the given `str` and return milliseconds.
- *
- * @param {String} str
- * @return {Number}
- * @api private
- */
-
- function parse(str) {
- str = '' + str;
- if (str.length > 10000) return;
- var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(str);
- if (!match) return;
- var n = parseFloat(match[1]);
- var type = (match[2] || 'ms').toLowerCase();
- switch (type) {
- case 'years':
- case 'year':
- case 'yrs':
- case 'yr':
- case 'y':
- return n * y;
- case 'days':
- case 'day':
- case 'd':
- return n * d;
- case 'hours':
- case 'hour':
- case 'hrs':
- case 'hr':
- case 'h':
- return n * h;
- case 'minutes':
- case 'minute':
- case 'mins':
- case 'min':
- case 'm':
- return n * m;
- case 'seconds':
- case 'second':
- case 'secs':
- case 'sec':
- case 's':
- return n * s;
- case 'milliseconds':
- case 'millisecond':
- case 'msecs':
- case 'msec':
- case 'ms':
- return n;
- }
- }
-
- /**
- * Short format for `ms`.
- *
- * @param {Number} ms
- * @return {String}
- * @api private
- */
-
- function short(ms) {
- if (ms >= d) return Math.round(ms / d) + 'd';
- if (ms >= h) return Math.round(ms / h) + 'h';
- if (ms >= m) return Math.round(ms / m) + 'm';
- if (ms >= s) return Math.round(ms / s) + 's';
- return ms + 'ms';
- }
-
- /**
- * Long format for `ms`.
- *
- * @param {Number} ms
- * @return {String}
- * @api private
- */
-
- function long(ms) {
- return plural(ms, d, 'day')
- || plural(ms, h, 'hour')
- || plural(ms, m, 'minute')
- || plural(ms, s, 'second')
- || ms + ' ms';
- }
-
- /**
- * Pluralization helper.
- */
-
- function plural(ms, n, name) {
- if (ms < n) return;
- if (ms < n * 1.5) return Math.floor(ms / n) + ' ' + name;
- return Math.ceil(ms / n) + ' ' + name + 's';
- }
-
- var debug_1 = createCommonjsModule(function (module, exports) {
- /**
- * This is the common logic for both the Node.js and web browser
- * implementations of `debug()`.
- *
- * Expose `debug()` as the module.
- */
-
- exports = module.exports = debug;
- exports.coerce = coerce;
- exports.disable = disable;
- exports.enable = enable;
- exports.enabled = enabled;
- exports.humanize = ms;
-
- /**
- * The currently active debug mode names, and names to skip.
- */
-
- exports.names = [];
- exports.skips = [];
-
- /**
- * Map of special "%n" handling functions, for the debug "format" argument.
- *
- * Valid key names are a single, lowercased letter, i.e. "n".
- */
-
- exports.formatters = {};
-
- /**
- * Previously assigned color.
- */
-
- var prevColor = 0;
-
- /**
- * Previous log timestamp.
- */
-
- var prevTime;
-
- /**
- * Select a color.
- *
- * @return {Number}
- * @api private
- */
-
- function selectColor() {
- return exports.colors[prevColor++ % exports.colors.length];
- }
-
- /**
- * Create a debugger with the given `namespace`.
- *
- * @param {String} namespace
- * @return {Function}
- * @api public
- */
-
- function debug(namespace) {
-
- // define the `disabled` version
- function disabled() {
- }
- disabled.enabled = false;
-
- // define the `enabled` version
- function enabled() {
-
- var self = enabled;
-
- // set `diff` timestamp
- var curr = +new Date();
- var ms = curr - (prevTime || curr);
- self.diff = ms;
- self.prev = prevTime;
- self.curr = curr;
- prevTime = curr;
-
- // add the `color` if not set
- if (null == self.useColors) self.useColors = exports.useColors();
- if (null == self.color && self.useColors) self.color = selectColor();
-
- var args = Array.prototype.slice.call(arguments);
-
- args[0] = exports.coerce(args[0]);
-
- if ('string' !== typeof args[0]) {
- // anything else let's inspect with %o
- args = ['%o'].concat(args);
- }
-
- // apply any `formatters` transformations
- var index = 0;
- args[0] = args[0].replace(/%([a-z%])/g, function(match, format) {
- // if we encounter an escaped % then don't increase the array index
- if (match === '%%') return match;
- index++;
- var formatter = exports.formatters[format];
- if ('function' === typeof formatter) {
- var val = args[index];
- match = formatter.call(self, val);
-
- // now we need to remove `args[index]` since it's inlined in the `format`
- args.splice(index, 1);
- index--;
- }
- return match;
- });
-
- if ('function' === typeof exports.formatArgs) {
- args = exports.formatArgs.apply(self, args);
- }
- var logFn = enabled.log || exports.log || console.log.bind(console);
- logFn.apply(self, args);
- }
- enabled.enabled = true;
-
- var fn = exports.enabled(namespace) ? enabled : disabled;
-
- fn.namespace = namespace;
-
- return fn;
- }
-
- /**
- * Enables a debug mode by namespaces. This can include modes
- * separated by a colon and wildcards.
- *
- * @param {String} namespaces
- * @api public
- */
-
- function enable(namespaces) {
- exports.save(namespaces);
-
- var split = (namespaces || '').split(/[\s,]+/);
- var len = split.length;
-
- for (var i = 0; i < len; i++) {
- if (!split[i]) continue; // ignore empty strings
- namespaces = split[i].replace(/\*/g, '.*?');
- if (namespaces[0] === '-') {
- exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
- } else {
- exports.names.push(new RegExp('^' + namespaces + '$'));
- }
- }
- }
-
- /**
- * Disable debug output.
- *
- * @api public
- */
-
- function disable() {
- exports.enable('');
- }
-
- /**
- * Returns true if the given mode name is enabled, false otherwise.
- *
- * @param {String} name
- * @return {Boolean}
- * @api public
- */
-
- function enabled(name) {
- var i, len;
- for (i = 0, len = exports.skips.length; i < len; i++) {
- if (exports.skips[i].test(name)) {
- return false;
- }
- }
- for (i = 0, len = exports.names.length; i < len; i++) {
- if (exports.names[i].test(name)) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Coerce `val`.
- *
- * @param {Mixed} val
- * @return {Mixed}
- * @api private
- */
-
- function coerce(val) {
- if (val instanceof Error) return val.stack || val.message;
- return val;
- }
- });
- var debug_2 = debug_1.coerce;
- var debug_3 = debug_1.disable;
- var debug_4 = debug_1.enable;
- var debug_5 = debug_1.enabled;
- var debug_6 = debug_1.humanize;
- var debug_7 = debug_1.names;
- var debug_8 = debug_1.skips;
- var debug_9 = debug_1.formatters;
-
- var browser = createCommonjsModule(function (module, exports) {
- /**
- * This is the web browser implementation of `debug()`.
- *
- * Expose `debug()` as the module.
- */
-
- exports = module.exports = debug_1;
- exports.log = log;
- exports.formatArgs = formatArgs;
- exports.save = save;
- exports.load = load;
- exports.useColors = useColors;
- exports.storage = 'undefined' != typeof chrome
- && 'undefined' != typeof chrome.storage
- ? chrome.storage.local
- : localstorage();
-
- /**
- * Colors.
- */
-
- exports.colors = [
- 'lightseagreen',
- 'forestgreen',
- 'goldenrod',
- 'dodgerblue',
- 'darkorchid',
- 'crimson'
- ];
-
- /**
- * Currently only WebKit-based Web Inspectors, Firefox >= v31,
- * and the Firebug extension (any Firefox version) are known
- * to support "%c" CSS customizations.
- *
- * TODO: add a `localStorage` variable to explicitly enable/disable colors
- */
-
- function useColors() {
- // is webkit? http://stackoverflow.com/a/16459606/376773
- return ('WebkitAppearance' in document.documentElement.style) ||
- // is firebug? http://stackoverflow.com/a/398120/376773
- (window.console && (console.firebug || (console.exception && console.table))) ||
- // is firefox >= v31?
- // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
- (navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31);
- }
-
- /**
- * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
- */
-
- exports.formatters.j = function(v) {
- return JSON.stringify(v);
- };
-
-
- /**
- * Colorize log arguments if enabled.
- *
- * @api public
- */
-
- function formatArgs() {
- var args = arguments;
- var useColors = this.useColors;
-
- args[0] = (useColors ? '%c' : '')
- + this.namespace
- + (useColors ? ' %c' : ' ')
- + args[0]
- + (useColors ? '%c ' : ' ')
- + '+' + exports.humanize(this.diff);
-
- if (!useColors) return args;
-
- var c = 'color: ' + this.color;
- args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));
-
- // the final "%c" is somewhat tricky, because there could be other
- // arguments passed either before or after the %c, so we need to
- // figure out the correct index to insert the CSS into
- var index = 0;
- var lastC = 0;
- args[0].replace(/%[a-z%]/g, function(match) {
- if ('%%' === match) return;
- index++;
- if ('%c' === match) {
- // we only are interested in the *last* %c
- // (the user may have provided their own)
- lastC = index;
- }
- });
-
- args.splice(lastC, 0, c);
- return args;
- }
-
- /**
- * Invokes `console.log()` when available.
- * No-op when `console.log` is not a "function".
- *
- * @api public
- */
-
- function log() {
- // this hackery is required for IE8/9, where
- // the `console.log` function doesn't have 'apply'
- return 'object' === typeof console
- && console.log
- && Function.prototype.apply.call(console.log, console, arguments);
- }
-
- /**
- * Save `namespaces`.
- *
- * @param {String} namespaces
- * @api private
- */
-
- function save(namespaces) {
- try {
- if (null == namespaces) {
- exports.storage.removeItem('debug');
- } else {
- exports.storage.debug = namespaces;
- }
- } catch(e) {}
- }
-
- /**
- * Load `namespaces`.
- *
- * @return {String} returns the previously persisted debug modes
- * @api private
- */
-
- function load() {
- var r;
- try {
- r = exports.storage.debug;
- } catch(e) {}
- return r;
- }
-
- /**
- * Enable namespaces listed in `localStorage.debug` initially.
- */
-
- exports.enable(load());
-
- /**
- * Localstorage attempts to return the localstorage.
- *
- * This is necessary because safari throws
- * when a user disables cookies/localstorage
- * and you attempt to access it.
- *
- * @return {LocalStorage}
- * @api private
- */
-
- function localstorage(){
- try {
- return window.localStorage;
- } catch (e) {}
- }
- });
- var browser_1 = browser.log;
- var browser_2 = browser.formatArgs;
- var browser_3 = browser.save;
- var browser_4 = browser.load;
- var browser_5 = browser.useColors;
- var browser_6 = browser.storage;
- var browser_7 = browser.colors;
-
- /**
- * Module dependencies.
- */
-
- var debug = browser('cookie');
-
- /**
- * Set or get cookie `name` with `value` and `options` object.
- *
- * @param {String} name
- * @param {String} value
- * @param {Object} options
- * @return {Mixed}
- * @api public
- */
-
- var rudderComponentCookie = function(name, value, options){
- switch (arguments.length) {
- case 3:
- case 2:
- return set(name, value, options);
- case 1:
- return get$1(name);
- default:
- return all();
- }
- };
-
- /**
- * Set cookie `name` to `value`.
- *
- * @param {String} name
- * @param {String} value
- * @param {Object} options
- * @api private
- */
-
- function set(name, value, options) {
- options = options || {};
- var str = encode(name) + '=' + encode(value);
-
- if (null == value) options.maxage = -1;
-
- if (options.maxage) {
- options.expires = new Date(+new Date + options.maxage);
- }
-
- if (options.path) str += '; path=' + options.path;
- if (options.domain) str += '; domain=' + options.domain;
- if (options.expires) str += '; expires=' + options.expires.toUTCString();
- if (options.samesite) str += '; samesite=' + options.samesite;
- if (options.secure) str += '; secure';
-
- document.cookie = str;
- }
-
- /**
- * Return all cookies.
- *
- * @return {Object}
- * @api private
- */
-
- function all() {
- var str;
- try {
- str = document.cookie;
- } catch (err) {
- if (typeof console !== 'undefined' && typeof console.error === 'function') {
- console.error(err.stack || err);
- }
- return {};
- }
- return parse$1(str);
- }
-
- /**
- * Get cookie `name`.
- *
- * @param {String} name
- * @return {String}
- * @api private
- */
-
- function get$1(name) {
- return all()[name];
- }
-
- /**
- * Parse cookie `str`.
- *
- * @param {String} str
- * @return {Object}
- * @api private
- */
-
- function parse$1(str) {
- var obj = {};
- var pairs = str.split(/ *; */);
- var pair;
- if ('' == pairs[0]) return obj;
- for (var i = 0; i < pairs.length; ++i) {
- pair = pairs[i].split('=');
- obj[decode(pair[0])] = decode(pair[1]);
- }
- return obj;
- }
-
- /**
- * Encode.
- */
-
- function encode(value){
- try {
- return encodeURIComponent(value);
- } catch (e) {
- debug('error `encode(%o)` - %o', value, e);
- }
- }
-
- /**
- * Decode.
- */
-
- function decode(value) {
- try {
- return decodeURIComponent(value);
- } catch (e) {
- debug('error `decode(%o)` - %o', value, e);
- }
- }
-
- var max = Math.max;
-
- /**
- * Produce a new array composed of all but the first `n` elements of an input `collection`.
- *
- * @name drop
- * @api public
- * @param {number} count The number of elements to drop.
- * @param {Array} collection The collection to iterate over.
- * @return {Array} A new array containing all but the first element from `collection`.
- * @example
- * drop(0, [1, 2, 3]); // => [1, 2, 3]
- * drop(1, [1, 2, 3]); // => [2, 3]
- * drop(2, [1, 2, 3]); // => [3]
- * drop(3, [1, 2, 3]); // => []
- * drop(4, [1, 2, 3]); // => []
- */
- var drop = function drop(count, collection) {
- var length = collection ? collection.length : 0;
-
- if (!length) {
- return [];
- }
-
- // Preallocating an array *significantly* boosts performance when dealing with
- // `arguments` objects on v8. For a summary, see:
- // https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#32-leaking-arguments
- var toDrop = max(Number(count) || 0, 0);
- var resultsLength = max(length - toDrop, 0);
- var results = new Array(resultsLength);
-
- for (var i = 0; i < resultsLength; i += 1) {
- results[i] = collection[i + toDrop];
- }
-
- return results;
- };
-
- /*
- * Exports.
- */
-
- var drop_1 = drop;
-
- var max$1 = Math.max;
-
- /**
- * Produce a new array by passing each value in the input `collection` through a transformative
- * `iterator` function. The `iterator` function is passed three arguments:
- * `(value, index, collection)`.
- *
- * @name rest
- * @api public
- * @param {Array} collection The collection to iterate over.
- * @return {Array} A new array containing all but the first element from `collection`.
- * @example
- * rest([1, 2, 3]); // => [2, 3]
- */
- var rest = function rest(collection) {
- if (collection == null || !collection.length) {
- return [];
- }
-
- // Preallocating an array *significantly* boosts performance when dealing with
- // `arguments` objects on v8. For a summary, see:
- // https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#32-leaking-arguments
- var results = new Array(max$1(collection.length - 2, 0));
-
- for (var i = 1; i < collection.length; i += 1) {
- results[i - 1] = collection[i];
- }
-
- return results;
- };
-
- /*
- * Exports.
- */
-
- var rest_1 = rest;
-
- /*
- * Module dependencies.
- */
-
-
-
-
- var has$3 = Object.prototype.hasOwnProperty;
- var objToString$1 = Object.prototype.toString;
-
- /**
- * Returns `true` if a value is an object, otherwise `false`.
- *
- * @name isObject
- * @api private
- * @param {*} val The value to test.
- * @return {boolean}
- */
- // TODO: Move to a library
- var isObject = function isObject(value) {
- return Boolean(value) && typeof value === 'object';
- };
-
- /**
- * Returns `true` if a value is a plain object, otherwise `false`.
- *
- * @name isPlainObject
- * @api private
- * @param {*} val The value to test.
- * @return {boolean}
- */
- // TODO: Move to a library
- var isPlainObject = function isPlainObject(value) {
- return Boolean(value) && objToString$1.call(value) === '[object Object]';
- };
-
- /**
- * Assigns a key-value pair to a target object when the value assigned is owned,
- * and where target[key] is undefined.
- *
- * @name shallowCombiner
- * @api private
- * @param {Object} target
- * @param {Object} source
- * @param {*} value
- * @param {string} key
- */
- var shallowCombiner = function shallowCombiner(target, source, value, key) {
- if (has$3.call(source, key) && target[key] === undefined) {
- target[key] = value;
- }
- return source;
- };
-
- /**
- * Assigns a key-value pair to a target object when the value assigned is owned,
- * and where target[key] is undefined; also merges objects recursively.
- *
- * @name deepCombiner
- * @api private
- * @param {Object} target
- * @param {Object} source
- * @param {*} value
- * @param {string} key
- * @return {Object}
- */
- var deepCombiner = function(target, source, value, key) {
- if (has$3.call(source, key)) {
- if (isPlainObject(target[key]) && isPlainObject(value)) {
- target[key] = defaultsDeep(target[key], value);
- } else if (target[key] === undefined) {
- target[key] = value;
- }
- }
-
- return source;
- };
-
- /**
- * TODO: Document
- *
- * @name defaultsWith
- * @api private
- * @param {Function} combiner
- * @param {Object} target
- * @param {...Object} sources
- * @return {Object} Return the input `target`.
- */
- var defaultsWith = function(combiner, target /*, ...sources */) {
- if (!isObject(target)) {
- return target;
- }
-
- combiner = combiner || shallowCombiner;
- var sources = drop_1(2, arguments);
-
- for (var i = 0; i < sources.length; i += 1) {
- for (var key in sources[i]) {
- combiner(target, sources[i], sources[i][key], key);
- }
- }
-
- return target;
- };
-
- /**
- * Copies owned, enumerable properties from a source object(s) to a target
- * object when the value of that property on the source object is `undefined`.
- * Recurses on objects.
- *
- * @name defaultsDeep
- * @api public
- * @param {Object} target
- * @param {...Object} sources
- * @return {Object} The input `target`.
- */
- var defaultsDeep = function defaultsDeep(target /*, sources */) {
- // TODO: Replace with `partial` call?
- return defaultsWith.apply(null, [deepCombiner, target].concat(rest_1(arguments)));
- };
-
- /**
- * Copies owned, enumerable properties from a source object(s) to a target
- * object when the value of that property on the source object is `undefined`.
- *
- * @name defaults
- * @api public
- * @param {Object} target
- * @param {...Object} sources
- * @return {Object}
- * @example
- * var a = { a: 1 };
- * var b = { a: 2, b: 2 };
- *
- * defaults(a, b);
- * console.log(a); //=> { a: 1, b: 2 }
- */
- var defaults = function(target /*, ...sources */) {
- // TODO: Replace with `partial` call?
- return defaultsWith.apply(null, [null, target].concat(rest_1(arguments)));
- };
-
- /*
- * Exports.
- */
-
- var defaults_1 = defaults;
- var deep = defaultsDeep;
- defaults_1.deep = deep;
-
- var json3 = createCommonjsModule(function (module, exports) {
- (function () {
- // Detect the `define` function exposed by asynchronous module loaders. The
- // strict `define` check is necessary for compatibility with `r.js`.
- var isLoader = typeof undefined === "function" ;
-
- // A set of types used to distinguish objects from primitives.
- var objectTypes = {
- "function": true,
- "object": true
- };
-
- // Detect the `exports` object exposed by CommonJS implementations.
- var freeExports = objectTypes['object'] && exports && !exports.nodeType && exports;
-
- // Use the `global` object exposed by Node (including Browserify via
- // `insert-module-globals`), Narwhal, and Ringo as the default context,
- // and the `window` object in browsers. Rhino exports a `global` function
- // instead.
- var root = objectTypes[typeof window] && window || this,
- freeGlobal = freeExports && objectTypes['object'] && module && !module.nodeType && typeof commonjsGlobal == "object" && commonjsGlobal;
-
- if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal || freeGlobal.self === freeGlobal)) {
- root = freeGlobal;
- }
-
- // Public: Initializes JSON 3 using the given `context` object, attaching the
- // `stringify` and `parse` functions to the specified `exports` object.
- function runInContext(context, exports) {
- context || (context = root.Object());
- exports || (exports = root.Object());
-
- // Native constructor aliases.
- var Number = context.Number || root.Number,
- String = context.String || root.String,
- Object = context.Object || root.Object,
- Date = context.Date || root.Date,
- SyntaxError = context.SyntaxError || root.SyntaxError,
- TypeError = context.TypeError || root.TypeError,
- Math = context.Math || root.Math,
- nativeJSON = context.JSON || root.JSON;
-
- // Delegate to the native `stringify` and `parse` implementations.
- if (typeof nativeJSON == "object" && nativeJSON) {
- exports.stringify = nativeJSON.stringify;
- exports.parse = nativeJSON.parse;
- }
-
- // Convenience aliases.
- var objectProto = Object.prototype,
- getClass = objectProto.toString,
- isProperty = objectProto.hasOwnProperty,
- undefined$1;
-
- // Internal: Contains `try...catch` logic used by other functions.
- // This prevents other functions from being deoptimized.
- function attempt(func, errorFunc) {
- try {
- func();
- } catch (exception) {
- if (errorFunc) {
- errorFunc();
- }
- }
- }
-
- // Test the `Date#getUTC*` methods. Based on work by @Yaffle.
- var isExtended = new Date(-3509827334573292);
- attempt(function () {
- // The `getUTCFullYear`, `Month`, and `Date` methods return nonsensical
- // results for certain dates in Opera >= 10.53.
- isExtended = isExtended.getUTCFullYear() == -109252 && isExtended.getUTCMonth() === 0 && isExtended.getUTCDate() === 1 &&
- isExtended.getUTCHours() == 10 && isExtended.getUTCMinutes() == 37 && isExtended.getUTCSeconds() == 6 && isExtended.getUTCMilliseconds() == 708;
- });
-
- // Internal: Determines whether the native `JSON.stringify` and `parse`
- // implementations are spec-compliant. Based on work by Ken Snyder.
- function has(name) {
- if (has[name] != null) {
- // Return cached feature test result.
- return has[name];
- }
- var isSupported;
- if (name == "bug-string-char-index") {
- // IE <= 7 doesn't support accessing string characters using square
- // bracket notation. IE 8 only supports this for primitives.
- isSupported = "a"[0] != "a";
- } else if (name == "json") {
- // Indicates whether both `JSON.stringify` and `JSON.parse` are
- // supported.
- isSupported = has("json-stringify") && has("date-serialization") && has("json-parse");
- } else if (name == "date-serialization") {
- // Indicates whether `Date`s can be serialized accurately by `JSON.stringify`.
- isSupported = has("json-stringify") && isExtended;
- if (isSupported) {
- var stringify = exports.stringify;
- attempt(function () {
- isSupported =
- // JSON 2, Prototype <= 1.7, and older WebKit builds incorrectly
- // serialize extended years.
- stringify(new Date(-8.64e15)) == '"-271821-04-20T00:00:00.000Z"' &&
- // The milliseconds are optional in ES 5, but required in 5.1.
- stringify(new Date(8.64e15)) == '"+275760-09-13T00:00:00.000Z"' &&
- // Firefox <= 11.0 incorrectly serializes years prior to 0 as negative
- // four-digit years instead of six-digit years. Credits: @Yaffle.
- stringify(new Date(-621987552e5)) == '"-000001-01-01T00:00:00.000Z"' &&
- // Safari <= 5.1.5 and Opera >= 10.53 incorrectly serialize millisecond
- // values less than 1000. Credits: @Yaffle.
- stringify(new Date(-1)) == '"1969-12-31T23:59:59.999Z"';
- });
- }
- } else {
- var value, serialized = '{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}';
- // Test `JSON.stringify`.
- if (name == "json-stringify") {
- var stringify = exports.stringify, stringifySupported = typeof stringify == "function";
- if (stringifySupported) {
- // A test function object with a custom `toJSON` method.
- (value = function () {
- return 1;
- }).toJSON = value;
- attempt(function () {
- stringifySupported =
- // Firefox 3.1b1 and b2 serialize string, number, and boolean
- // primitives as object literals.
- stringify(0) === "0" &&
- // FF 3.1b1, b2, and JSON 2 serialize wrapped primitives as object
- // literals.
- stringify(new Number()) === "0" &&
- stringify(new String()) == '""' &&
- // FF 3.1b1, 2 throw an error if the value is `null`, `undefined`, or
- // does not define a canonical JSON representation (this applies to
- // objects with `toJSON` properties as well, *unless* they are nested
- // within an object or array).
- stringify(getClass) === undefined$1 &&
- // IE 8 serializes `undefined` as `"undefined"`. Safari <= 5.1.7 and
- // FF 3.1b3 pass this test.
- stringify(undefined$1) === undefined$1 &&
- // Safari <= 5.1.7 and FF 3.1b3 throw `Error`s and `TypeError`s,
- // respectively, if the value is omitted entirely.
- stringify() === undefined$1 &&
- // FF 3.1b1, 2 throw an error if the given value is not a number,
- // string, array, object, Boolean, or `null` literal. This applies to
- // objects with custom `toJSON` methods as well, unless they are nested
- // inside object or array literals. YUI 3.0.0b1 ignores custom `toJSON`
- // methods entirely.
- stringify(value) === "1" &&
- stringify([value]) == "[1]" &&
- // Prototype <= 1.6.1 serializes `[undefined]` as `"[]"` instead of
- // `"[null]"`.
- stringify([undefined$1]) == "[null]" &&
- // YUI 3.0.0b1 fails to serialize `null` literals.
- stringify(null) == "null" &&
- // FF 3.1b1, 2 halts serialization if an array contains a function:
- // `[1, true, getClass, 1]` serializes as "[1,true,],". FF 3.1b3
- // elides non-JSON values from objects and arrays, unless they
- // define custom `toJSON` methods.
- stringify([undefined$1, getClass, null]) == "[null,null,null]" &&
- // Simple serialization test. FF 3.1b1 uses Unicode escape sequences
- // where character escape codes are expected (e.g., `\b` => `\u0008`).
- stringify({ "a": [value, true, false, null, "\x00\b\n\f\r\t"] }) == serialized &&
- // FF 3.1b1 and b2 ignore the `filter` and `width` arguments.
- stringify(null, value) === "1" &&
- stringify([1, 2], null, 1) == "[\n 1,\n 2\n]";
- }, function () {
- stringifySupported = false;
- });
- }
- isSupported = stringifySupported;
- }
- // Test `JSON.parse`.
- if (name == "json-parse") {
- var parse = exports.parse, parseSupported;
- if (typeof parse == "function") {
- attempt(function () {
- // FF 3.1b1, b2 will throw an exception if a bare literal is provided.
- // Conforming implementations should also coerce the initial argument to
- // a string prior to parsing.
- if (parse("0") === 0 && !parse(false)) {
- // Simple parsing test.
- value = parse(serialized);
- parseSupported = value["a"].length == 5 && value["a"][0] === 1;
- if (parseSupported) {
- attempt(function () {
- // Safari <= 5.1.2 and FF 3.1b1 allow unescaped tabs in strings.
- parseSupported = !parse('"\t"');
- });
- if (parseSupported) {
- attempt(function () {
- // FF 4.0 and 4.0.1 allow leading `+` signs and leading
- // decimal points. FF 4.0, 4.0.1, and IE 9-10 also allow
- // certain octal literals.
- parseSupported = parse("01") !== 1;
- });
- }
- if (parseSupported) {
- attempt(function () {
- // FF 4.0, 4.0.1, and Rhino 1.7R3-R4 allow trailing decimal
- // points. These environments, along with FF 3.1b1 and 2,
- // also allow trailing commas in JSON objects and arrays.
- parseSupported = parse("1.") !== 1;
- });
- }
- }
- }
- }, function () {
- parseSupported = false;
- });
- }
- isSupported = parseSupported;
- }
- }
- return has[name] = !!isSupported;
- }
- has["bug-string-char-index"] = has["date-serialization"] = has["json"] = has["json-stringify"] = has["json-parse"] = null;
-
- if (!has("json")) {
- // Common `[[Class]]` name aliases.
- var functionClass = "[object Function]",
- dateClass = "[object Date]",
- numberClass = "[object Number]",
- stringClass = "[object String]",
- arrayClass = "[object Array]",
- booleanClass = "[object Boolean]";
-
- // Detect incomplete support for accessing string characters by index.
- var charIndexBuggy = has("bug-string-char-index");
-
- // Internal: Normalizes the `for...in` iteration algorithm across
- // environments. Each enumerated key is yielded to a `callback` function.
- var forOwn = function (object, callback) {
- var size = 0, Properties, dontEnums, property;
-
- // Tests for bugs in the current environment's `for...in` algorithm. The
- // `valueOf` property inherits the non-enumerable flag from
- // `Object.prototype` in older versions of IE, Netscape, and Mozilla.
- (Properties = function () {
- this.valueOf = 0;
- }).prototype.valueOf = 0;
-
- // Iterate over a new instance of the `Properties` class.
- dontEnums = new Properties();
- for (property in dontEnums) {
- // Ignore all properties inherited from `Object.prototype`.
- if (isProperty.call(dontEnums, property)) {
- size++;
- }
- }
- Properties = dontEnums = null;
-
- // Normalize the iteration algorithm.
- if (!size) {
- // A list of non-enumerable properties inherited from `Object.prototype`.
- dontEnums = ["valueOf", "toString", "toLocaleString", "propertyIsEnumerable", "isPrototypeOf", "hasOwnProperty", "constructor"];
- // IE <= 8, Mozilla 1.0, and Netscape 6.2 ignore shadowed non-enumerable
- // properties.
- forOwn = function (object, callback) {
- var isFunction = getClass.call(object) == functionClass, property, length;
- var hasProperty = !isFunction && typeof object.constructor != "function" && objectTypes[typeof object.hasOwnProperty] && object.hasOwnProperty || isProperty;
- for (property in object) {
- // Gecko <= 1.0 enumerates the `prototype` property of functions under
- // certain conditions; IE does not.
- if (!(isFunction && property == "prototype") && hasProperty.call(object, property)) {
- callback(property);
- }
- }
- // Manually invoke the callback for each non-enumerable property.
- for (length = dontEnums.length; property = dontEnums[--length];) {
- if (hasProperty.call(object, property)) {
- callback(property);
- }
- }
- };
- } else {
- // No bugs detected; use the standard `for...in` algorithm.
- forOwn = function (object, callback) {
- var isFunction = getClass.call(object) == functionClass, property, isConstructor;
- for (property in object) {
- if (!(isFunction && property == "prototype") && isProperty.call(object, property) && !(isConstructor = property === "constructor")) {
- callback(property);
- }
- }
- // Manually invoke the callback for the `constructor` property due to
- // cross-environment inconsistencies.
- if (isConstructor || isProperty.call(object, (property = "constructor"))) {
- callback(property);
- }
- };
- }
- return forOwn(object, callback);
- };
-
- // Public: Serializes a JavaScript `value` as a JSON string. The optional
- // `filter` argument may specify either a function that alters how object and
- // array members are serialized, or an array of strings and numbers that
- // indicates which properties should be serialized. The optional `width`
- // argument may be either a string or number that specifies the indentation
- // level of the output.
- if (!has("json-stringify") && !has("date-serialization")) {
- // Internal: A map of control characters and their escaped equivalents.
- var Escapes = {
- 92: "\\\\",
- 34: '\\"',
- 8: "\\b",
- 12: "\\f",
- 10: "\\n",
- 13: "\\r",
- 9: "\\t"
- };
-
- // Internal: Converts `value` into a zero-padded string such that its
- // length is at least equal to `width`. The `width` must be <= 6.
- var leadingZeroes = "000000";
- var toPaddedString = function (width, value) {
- // The `|| 0` expression is necessary to work around a bug in
- // Opera <= 7.54u2 where `0 == -0`, but `String(-0) !== "0"`.
- return (leadingZeroes + (value || 0)).slice(-width);
- };
-
- // Internal: Serializes a date object.
- var serializeDate = function (value) {
- var getData, year, month, date, time, hours, minutes, seconds, milliseconds;
- // Define additional utility methods if the `Date` methods are buggy.
- if (!isExtended) {
- var floor = Math.floor;
- // A mapping between the months of the year and the number of days between
- // January 1st and the first of the respective month.
- var Months = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334];
- // Internal: Calculates the number of days between the Unix epoch and the
- // first day of the given month.
- var getDay = function (year, month) {
- return Months[month] + 365 * (year - 1970) + floor((year - 1969 + (month = +(month > 1))) / 4) - floor((year - 1901 + month) / 100) + floor((year - 1601 + month) / 400);
- };
- getData = function (value) {
- // Manually compute the year, month, date, hours, minutes,
- // seconds, and milliseconds if the `getUTC*` methods are
- // buggy. Adapted from @Yaffle's `date-shim` project.
- date = floor(value / 864e5);
- for (year = floor(date / 365.2425) + 1970 - 1; getDay(year + 1, 0) <= date; year++);
- for (month = floor((date - getDay(year, 0)) / 30.42); getDay(year, month + 1) <= date; month++);
- date = 1 + date - getDay(year, month);
- // The `time` value specifies the time within the day (see ES
- // 5.1 section 15.9.1.2). The formula `(A % B + B) % B` is used
- // to compute `A modulo B`, as the `%` operator does not
- // correspond to the `modulo` operation for negative numbers.
- time = (value % 864e5 + 864e5) % 864e5;
- // The hours, minutes, seconds, and milliseconds are obtained by
- // decomposing the time within the day. See section 15.9.1.10.
- hours = floor(time / 36e5) % 24;
- minutes = floor(time / 6e4) % 60;
- seconds = floor(time / 1e3) % 60;
- milliseconds = time % 1e3;
- };
- } else {
- getData = function (value) {
- year = value.getUTCFullYear();
- month = value.getUTCMonth();
- date = value.getUTCDate();
- hours = value.getUTCHours();
- minutes = value.getUTCMinutes();
- seconds = value.getUTCSeconds();
- milliseconds = value.getUTCMilliseconds();
- };
- }
- serializeDate = function (value) {
- if (value > -1 / 0 && value < 1 / 0) {
- // Dates are serialized according to the `Date#toJSON` method
- // specified in ES 5.1 section 15.9.5.44. See section 15.9.1.15
- // for the ISO 8601 date time string format.
- getData(value);
- // Serialize extended years correctly.
- value = (year <= 0 || year >= 1e4 ? (year < 0 ? "-" : "+") + toPaddedString(6, year < 0 ? -year : year) : toPaddedString(4, year)) +
- "-" + toPaddedString(2, month + 1) + "-" + toPaddedString(2, date) +
- // Months, dates, hours, minutes, and seconds should have two
- // digits; milliseconds should have three.
- "T" + toPaddedString(2, hours) + ":" + toPaddedString(2, minutes) + ":" + toPaddedString(2, seconds) +
- // Milliseconds are optional in ES 5.0, but required in 5.1.
- "." + toPaddedString(3, milliseconds) + "Z";
- year = month = date = hours = minutes = seconds = milliseconds = null;
- } else {
- value = null;
- }
- return value;
- };
- return serializeDate(value);
- };
-
- // For environments with `JSON.stringify` but buggy date serialization,
- // we override the native `Date#toJSON` implementation with a
- // spec-compliant one.
- if (has("json-stringify") && !has("date-serialization")) {
- // Internal: the `Date#toJSON` implementation used to override the native one.
- function dateToJSON (key) {
- return serializeDate(this);
- }
-
- // Public: `JSON.stringify`. See ES 5.1 section 15.12.3.
- var nativeStringify = exports.stringify;
- exports.stringify = function (source, filter, width) {
- var nativeToJSON = Date.prototype.toJSON;
- Date.prototype.toJSON = dateToJSON;
- var result = nativeStringify(source, filter, width);
- Date.prototype.toJSON = nativeToJSON;
- return result;
- };
- } else {
- // Internal: Double-quotes a string `value`, replacing all ASCII control
- // characters (characters with code unit values between 0 and 31) with
- // their escaped equivalents. This is an implementation of the
- // `Quote(value)` operation defined in ES 5.1 section 15.12.3.
- var unicodePrefix = "\\u00";
- var escapeChar = function (character) {
- var charCode = character.charCodeAt(0), escaped = Escapes[charCode];
- if (escaped) {
- return escaped;
- }
- return unicodePrefix + toPaddedString(2, charCode.toString(16));
- };
- var reEscape = /[\x00-\x1f\x22\x5c]/g;
- var quote = function (value) {
- reEscape.lastIndex = 0;
- return '"' +
- (
- reEscape.test(value)
- ? value.replace(reEscape, escapeChar)
- : value
- ) +
- '"';
- };
-
- // Internal: Recursively serializes an object. Implements the
- // `Str(key, holder)`, `JO(value)`, and `JA(value)` operations.
- var serialize = function (property, object, callback, properties, whitespace, indentation, stack) {
- var value, type, className, results, element, index, length, prefix, result;
- attempt(function () {
- // Necessary for host object support.
- value = object[property];
- });
- if (typeof value == "object" && value) {
- if (value.getUTCFullYear && getClass.call(value) == dateClass && value.toJSON === Date.prototype.toJSON) {
- value = serializeDate(value);
- } else if (typeof value.toJSON == "function") {
- value = value.toJSON(property);
- }
- }
- if (callback) {
- // If a replacement function was provided, call it to obtain the value
- // for serialization.
- value = callback.call(object, property, value);
- }
- // Exit early if value is `undefined` or `null`.
- if (value == undefined$1) {
- return value === undefined$1 ? value : "null";
- }
- type = typeof value;
- // Only call `getClass` if the value is an object.
- if (type == "object") {
- className = getClass.call(value);
- }
- switch (className || type) {
- case "boolean":
- case booleanClass:
- // Booleans are represented literally.
- return "" + value;
- case "number":
- case numberClass:
- // JSON numbers must be finite. `Infinity` and `NaN` are serialized as
- // `"null"`.
- return value > -1 / 0 && value < 1 / 0 ? "" + value : "null";
- case "string":
- case stringClass:
- // Strings are double-quoted and escaped.
- return quote("" + value);
- }
- // Recursively serialize objects and arrays.
- if (typeof value == "object") {
- // Check for cyclic structures. This is a linear search; performance
- // is inversely proportional to the number of unique nested objects.
- for (length = stack.length; length--;) {
- if (stack[length] === value) {
- // Cyclic structures cannot be serialized by `JSON.stringify`.
- throw TypeError();
- }
- }
- // Add the object to the stack of traversed objects.
- stack.push(value);
- results = [];
- // Save the current indentation level and indent one additional level.
- prefix = indentation;
- indentation += whitespace;
- if (className == arrayClass) {
- // Recursively serialize array elements.
- for (index = 0, length = value.length; index < length; index++) {
- element = serialize(index, value, callback, properties, whitespace, indentation, stack);
- results.push(element === undefined$1 ? "null" : element);
- }
- result = results.length ? (whitespace ? "[\n" + indentation + results.join(",\n" + indentation) + "\n" + prefix + "]" : ("[" + results.join(",") + "]")) : "[]";
- } else {
- // Recursively serialize object members. Members are selected from
- // either a user-specified list of property names, or the object
- // itself.
- forOwn(properties || value, function (property) {
- var element = serialize(property, value, callback, properties, whitespace, indentation, stack);
- if (element !== undefined$1) {
- // According to ES 5.1 section 15.12.3: "If `gap` {whitespace}
- // is not the empty string, let `member` {quote(property) + ":"}
- // be the concatenation of `member` and the `space` character."
- // The "`space` character" refers to the literal space
- // character, not the `space` {width} argument provided to
- // `JSON.stringify`.
- results.push(quote(property) + ":" + (whitespace ? " " : "") + element);
- }
- });
- result = results.length ? (whitespace ? "{\n" + indentation + results.join(",\n" + indentation) + "\n" + prefix + "}" : ("{" + results.join(",") + "}")) : "{}";
- }
- // Remove the object from the traversed object stack.
- stack.pop();
- return result;
- }
- };
-
- // Public: `JSON.stringify`. See ES 5.1 section 15.12.3.
- exports.stringify = function (source, filter, width) {
- var whitespace, callback, properties, className;
- if (objectTypes[typeof filter] && filter) {
- className = getClass.call(filter);
- if (className == functionClass) {
- callback = filter;
- } else if (className == arrayClass) {
- // Convert the property names array into a makeshift set.
- properties = {};
- for (var index = 0, length = filter.length, value; index < length;) {
- value = filter[index++];
- className = getClass.call(value);
- if (className == "[object String]" || className == "[object Number]") {
- properties[value] = 1;
- }
- }
- }
- }
- if (width) {
- className = getClass.call(width);
- if (className == numberClass) {
- // Convert the `width` to an integer and create a string containing
- // `width` number of space characters.
- if ((width -= width % 1) > 0) {
- if (width > 10) {
- width = 10;
- }
- for (whitespace = ""; whitespace.length < width;) {
- whitespace += " ";
- }
- }
- } else if (className == stringClass) {
- whitespace = width.length <= 10 ? width : width.slice(0, 10);
- }
- }
- // Opera <= 7.54u2 discards the values associated with empty string keys
- // (`""`) only if they are used directly within an object member list
- // (e.g., `!("" in { "": 1})`).
- return serialize("", (value = {}, value[""] = source, value), callback, properties, whitespace, "", []);
- };
- }
- }
-
- // Public: Parses a JSON source string.
- if (!has("json-parse")) {
- var fromCharCode = String.fromCharCode;
-
- // Internal: A map of escaped control characters and their unescaped
- // equivalents.
- var Unescapes = {
- 92: "\\",
- 34: '"',
- 47: "/",
- 98: "\b",
- 116: "\t",
- 110: "\n",
- 102: "\f",
- 114: "\r"
- };
-
- // Internal: Stores the parser state.
- var Index, Source;
-
- // Internal: Resets the parser state and throws a `SyntaxError`.
- var abort = function () {
- Index = Source = null;
- throw SyntaxError();
- };
-
- // Internal: Returns the next token, or `"$"` if the parser has reached
- // the end of the source string. A token may be a string, number, `null`
- // literal, or Boolean literal.
- var lex = function () {
- var source = Source, length = source.length, value, begin, position, isSigned, charCode;
- while (Index < length) {
- charCode = source.charCodeAt(Index);
- switch (charCode) {
- case 9: case 10: case 13: case 32:
- // Skip whitespace tokens, including tabs, carriage returns, line
- // feeds, and space characters.
- Index++;
- break;
- case 123: case 125: case 91: case 93: case 58: case 44:
- // Parse a punctuator token (`{`, `}`, `[`, `]`, `:`, or `,`) at
- // the current position.
- value = charIndexBuggy ? source.charAt(Index) : source[Index];
- Index++;
- return value;
- case 34:
- // `"` delimits a JSON string; advance to the next character and
- // begin parsing the string. String tokens are prefixed with the
- // sentinel `@` character to distinguish them from punctuators and
- // end-of-string tokens.
- for (value = "@", Index++; Index < length;) {
- charCode = source.charCodeAt(Index);
- if (charCode < 32) {
- // Unescaped ASCII control characters (those with a code unit
- // less than the space character) are not permitted.
- abort();
- } else if (charCode == 92) {
- // A reverse solidus (`\`) marks the beginning of an escaped
- // control character (including `"`, `\`, and `/`) or Unicode
- // escape sequence.
- charCode = source.charCodeAt(++Index);
- switch (charCode) {
- case 92: case 34: case 47: case 98: case 116: case 110: case 102: case 114:
- // Revive escaped control characters.
- value += Unescapes[charCode];
- Index++;
- break;
- case 117:
- // `\u` marks the beginning of a Unicode escape sequence.
- // Advance to the first character and validate the
- // four-digit code point.
- begin = ++Index;
- for (position = Index + 4; Index < position; Index++) {
- charCode = source.charCodeAt(Index);
- // A valid sequence comprises four hexdigits (case-
- // insensitive) that form a single hexadecimal value.
- if (!(charCode >= 48 && charCode <= 57 || charCode >= 97 && charCode <= 102 || charCode >= 65 && charCode <= 70)) {
- // Invalid Unicode escape sequence.
- abort();
- }
- }
- // Revive the escaped character.
- value += fromCharCode("0x" + source.slice(begin, Index));
- break;
- default:
- // Invalid escape sequence.
- abort();
- }
- } else {
- if (charCode == 34) {
- // An unescaped double-quote character marks the end of the
- // string.
- break;
- }
- charCode = source.charCodeAt(Index);
- begin = Index;
- // Optimize for the common case where a string is valid.
- while (charCode >= 32 && charCode != 92 && charCode != 34) {
- charCode = source.charCodeAt(++Index);
- }
- // Append the string as-is.
- value += source.slice(begin, Index);
- }
- }
- if (source.charCodeAt(Index) == 34) {
- // Advance to the next character and return the revived string.
- Index++;
- return value;
- }
- // Unterminated string.
- abort();
- default:
- // Parse numbers and literals.
- begin = Index;
- // Advance past the negative sign, if one is specified.
- if (charCode == 45) {
- isSigned = true;
- charCode = source.charCodeAt(++Index);
- }
- // Parse an integer or floating-point value.
- if (charCode >= 48 && charCode <= 57) {
- // Leading zeroes are interpreted as octal literals.
- if (charCode == 48 && ((charCode = source.charCodeAt(Index + 1)), charCode >= 48 && charCode <= 57)) {
- // Illegal octal literal.
- abort();
- }
- isSigned = false;
- // Parse the integer component.
- for (; Index < length && ((charCode = source.charCodeAt(Index)), charCode >= 48 && charCode <= 57); Index++);
- // Floats cannot contain a leading decimal point; however, this
- // case is already accounted for by the parser.
- if (source.charCodeAt(Index) == 46) {
- position = ++Index;
- // Parse the decimal component.
- for (; position < length; position++) {
- charCode = source.charCodeAt(position);
- if (charCode < 48 || charCode > 57) {
- break;
- }
- }
- if (position == Index) {
- // Illegal trailing decimal.
- abort();
- }
- Index = position;
- }
- // Parse exponents. The `e` denoting the exponent is
- // case-insensitive.
- charCode = source.charCodeAt(Index);
- if (charCode == 101 || charCode == 69) {
- charCode = source.charCodeAt(++Index);
- // Skip past the sign following the exponent, if one is
- // specified.
- if (charCode == 43 || charCode == 45) {
- Index++;
- }
- // Parse the exponential component.
- for (position = Index; position < length; position++) {
- charCode = source.charCodeAt(position);
- if (charCode < 48 || charCode > 57) {
- break;
- }
- }
- if (position == Index) {
- // Illegal empty exponent.
- abort();
- }
- Index = position;
- }
- // Coerce the parsed value to a JavaScript number.
- return +source.slice(begin, Index);
- }
- // A negative sign may only precede numbers.
- if (isSigned) {
- abort();
- }
- // `true`, `false`, and `null` literals.
- var temp = source.slice(Index, Index + 4);
- if (temp == "true") {
- Index += 4;
- return true;
- } else if (temp == "fals" && source.charCodeAt(Index + 4 ) == 101) {
- Index += 5;
- return false;
- } else if (temp == "null") {
- Index += 4;
- return null;
- }
- // Unrecognized token.
- abort();
- }
- }
- // Return the sentinel `$` character if the parser has reached the end
- // of the source string.
- return "$";
- };
-
- // Internal: Parses a JSON `value` token.
- var get = function (value) {
- var results, hasMembers;
- if (value == "$") {
- // Unexpected end of input.
- abort();
- }
- if (typeof value == "string") {
- if ((charIndexBuggy ? value.charAt(0) : value[0]) == "@") {
- // Remove the sentinel `@` character.
- return value.slice(1);
- }
- // Parse object and array literals.
- if (value == "[") {
- // Parses a JSON array, returning a new JavaScript array.
- results = [];
- for (;;) {
- value = lex();
- // A closing square bracket marks the end of the array literal.
- if (value == "]") {
- break;
- }
- // If the array literal contains elements, the current token
- // should be a comma separating the previous element from the
- // next.
- if (hasMembers) {
- if (value == ",") {
- value = lex();
- if (value == "]") {
- // Unexpected trailing `,` in array literal.
- abort();
- }
- } else {
- // A `,` must separate each array element.
- abort();
- }
- } else {
- hasMembers = true;
- }
- // Elisions and leading commas are not permitted.
- if (value == ",") {
- abort();
- }
- results.push(get(value));
- }
- return results;
- } else if (value == "{") {
- // Parses a JSON object, returning a new JavaScript object.
- results = {};
- for (;;) {
- value = lex();
- // A closing curly brace marks the end of the object literal.
- if (value == "}") {
- break;
- }
- // If the object literal contains members, the current token
- // should be a comma separator.
- if (hasMembers) {
- if (value == ",") {
- value = lex();
- if (value == "}") {
- // Unexpected trailing `,` in object literal.
- abort();
- }
- } else {
- // A `,` must separate each object member.
- abort();
- }
- } else {
- hasMembers = true;
- }
- // Leading commas are not permitted, object property names must be
- // double-quoted strings, and a `:` must separate each property
- // name and value.
- if (value == "," || typeof value != "string" || (charIndexBuggy ? value.charAt(0) : value[0]) != "@" || lex() != ":") {
- abort();
- }
- results[value.slice(1)] = get(lex());
- }
- return results;
- }
- // Unexpected token encountered.
- abort();
- }
- return value;
- };
-
- // Internal: Updates a traversed object member.
- var update = function (source, property, callback) {
- var element = walk(source, property, callback);
- if (element === undefined$1) {
- delete source[property];
- } else {
- source[property] = element;
- }
- };
-
- // Internal: Recursively traverses a parsed JSON object, invoking the
- // `callback` function for each value. This is an implementation of the
- // `Walk(holder, name)` operation defined in ES 5.1 section 15.12.2.
- var walk = function (source, property, callback) {
- var value = source[property], length;
- if (typeof value == "object" && value) {
- // `forOwn` can't be used to traverse an array in Opera <= 8.54
- // because its `Object#hasOwnProperty` implementation returns `false`
- // for array indices (e.g., `![1, 2, 3].hasOwnProperty("0")`).
- if (getClass.call(value) == arrayClass) {
- for (length = value.length; length--;) {
- update(getClass, forOwn, value, length, callback);
- }
- } else {
- forOwn(value, function (property) {
- update(value, property, callback);
- });
- }
- }
- return callback.call(source, property, value);
- };
-
- // Public: `JSON.parse`. See ES 5.1 section 15.12.2.
- exports.parse = function (source, callback) {
- var result, value;
- Index = 0;
- Source = "" + source;
- result = get(lex());
- // If a JSON string contains multiple tokens, it is invalid.
- if (lex() != "$") {
- abort();
- }
- // Reset the parser state.
- Index = Source = null;
- return callback && getClass.call(callback) == functionClass ? walk((value = {}, value[""] = result, value), "", callback) : result;
- };
- }
- }
-
- exports.runInContext = runInContext;
- return exports;
- }
-
- if (freeExports && !isLoader) {
- // Export for CommonJS environments.
- runInContext(root, freeExports);
- } else {
- // Export for web browsers and JavaScript engines.
- var nativeJSON = root.JSON,
- previousJSON = root.JSON3,
- isRestored = false;
-
- var JSON3 = runInContext(root, (root.JSON3 = {
- // Public: Restores the original value of the global `JSON` object and
- // returns a reference to the `JSON3` object.
- "noConflict": function () {
- if (!isRestored) {
- isRestored = true;
- root.JSON = nativeJSON;
- root.JSON3 = previousJSON;
- nativeJSON = previousJSON = null;
- }
- return JSON3;
- }
- }));
-
- root.JSON = {
- "parse": JSON3.parse,
- "stringify": JSON3.stringify
- };
- }
- }).call(commonjsGlobal);
- });
-
- var componentUrl = createCommonjsModule(function (module, exports) {
- /**
- * Parse the given `url`.
- *
- * @param {String} str
- * @return {Object}
- * @api public
- */
-
- exports.parse = function(url){
- var a = document.createElement('a');
- a.href = url;
- return {
- href: a.href,
- host: a.host || location.host,
- port: ('0' === a.port || '' === a.port) ? port(a.protocol) : a.port,
- hash: a.hash,
- hostname: a.hostname || location.hostname,
- pathname: a.pathname.charAt(0) != '/' ? '/' + a.pathname : a.pathname,
- protocol: !a.protocol || ':' == a.protocol ? location.protocol : a.protocol,
- search: a.search,
- query: a.search.slice(1)
- };
- };
-
- /**
- * Check if `url` is absolute.
- *
- * @param {String} url
- * @return {Boolean}
- * @api public
- */
-
- exports.isAbsolute = function(url){
- return 0 == url.indexOf('//') || !!~url.indexOf('://');
- };
-
- /**
- * Check if `url` is relative.
- *
- * @param {String} url
- * @return {Boolean}
- * @api public
- */
-
- exports.isRelative = function(url){
- return !exports.isAbsolute(url);
- };
-
- /**
- * Check if `url` is cross domain.
- *
- * @param {String} url
- * @return {Boolean}
- * @api public
- */
-
- exports.isCrossDomain = function(url){
- url = exports.parse(url);
- var location = exports.parse(window.location.href);
- return url.hostname !== location.hostname
- || url.port !== location.port
- || url.protocol !== location.protocol;
- };
-
- /**
- * Return default port for `protocol`.
- *
- * @param {String} protocol
- * @return {String}
- * @api private
- */
- function port (protocol){
- switch (protocol) {
- case 'http:':
- return 80;
- case 'https:':
- return 443;
- default:
- return location.port;
- }
- }
- });
- var componentUrl_1 = componentUrl.parse;
- var componentUrl_2 = componentUrl.isAbsolute;
- var componentUrl_3 = componentUrl.isRelative;
- var componentUrl_4 = componentUrl.isCrossDomain;
-
- var debug_1$1 = createCommonjsModule(function (module, exports) {
- /**
- * This is the common logic for both the Node.js and web browser
- * implementations of `debug()`.
- *
- * Expose `debug()` as the module.
- */
-
- exports = module.exports = debug;
- exports.coerce = coerce;
- exports.disable = disable;
- exports.enable = enable;
- exports.enabled = enabled;
- exports.humanize = ms;
-
- /**
- * The currently active debug mode names, and names to skip.
- */
-
- exports.names = [];
- exports.skips = [];
-
- /**
- * Map of special "%n" handling functions, for the debug "format" argument.
- *
- * Valid key names are a single, lowercased letter, i.e. "n".
- */
-
- exports.formatters = {};
-
- /**
- * Previously assigned color.
- */
-
- var prevColor = 0;
-
- /**
- * Previous log timestamp.
- */
-
- var prevTime;
-
- /**
- * Select a color.
- *
- * @return {Number}
- * @api private
- */
-
- function selectColor() {
- return exports.colors[prevColor++ % exports.colors.length];
- }
-
- /**
- * Create a debugger with the given `namespace`.
- *
- * @param {String} namespace
- * @return {Function}
- * @api public
- */
-
- function debug(namespace) {
-
- // define the `disabled` version
- function disabled() {
- }
- disabled.enabled = false;
-
- // define the `enabled` version
- function enabled() {
-
- var self = enabled;
-
- // set `diff` timestamp
- var curr = +new Date();
- var ms = curr - (prevTime || curr);
- self.diff = ms;
- self.prev = prevTime;
- self.curr = curr;
- prevTime = curr;
-
- // add the `color` if not set
- if (null == self.useColors) self.useColors = exports.useColors();
- if (null == self.color && self.useColors) self.color = selectColor();
-
- var args = Array.prototype.slice.call(arguments);
-
- args[0] = exports.coerce(args[0]);
-
- if ('string' !== typeof args[0]) {
- // anything else let's inspect with %o
- args = ['%o'].concat(args);
- }
-
- // apply any `formatters` transformations
- var index = 0;
- args[0] = args[0].replace(/%([a-z%])/g, function(match, format) {
- // if we encounter an escaped % then don't increase the array index
- if (match === '%%') return match;
- index++;
- var formatter = exports.formatters[format];
- if ('function' === typeof formatter) {
- var val = args[index];
- match = formatter.call(self, val);
-
- // now we need to remove `args[index]` since it's inlined in the `format`
- args.splice(index, 1);
- index--;
- }
- return match;
- });
-
- if ('function' === typeof exports.formatArgs) {
- args = exports.formatArgs.apply(self, args);
- }
- var logFn = enabled.log || exports.log || console.log.bind(console);
- logFn.apply(self, args);
- }
- enabled.enabled = true;
-
- var fn = exports.enabled(namespace) ? enabled : disabled;
-
- fn.namespace = namespace;
-
- return fn;
- }
-
- /**
- * Enables a debug mode by namespaces. This can include modes
- * separated by a colon and wildcards.
- *
- * @param {String} namespaces
- * @api public
- */
-
- function enable(namespaces) {
- exports.save(namespaces);
-
- var split = (namespaces || '').split(/[\s,]+/);
- var len = split.length;
-
- for (var i = 0; i < len; i++) {
- if (!split[i]) continue; // ignore empty strings
- namespaces = split[i].replace(/\*/g, '.*?');
- if (namespaces[0] === '-') {
- exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
- } else {
- exports.names.push(new RegExp('^' + namespaces + '$'));
- }
- }
- }
-
- /**
- * Disable debug output.
- *
- * @api public
- */
-
- function disable() {
- exports.enable('');
- }
-
- /**
- * Returns true if the given mode name is enabled, false otherwise.
- *
- * @param {String} name
- * @return {Boolean}
- * @api public
- */
-
- function enabled(name) {
- var i, len;
- for (i = 0, len = exports.skips.length; i < len; i++) {
- if (exports.skips[i].test(name)) {
- return false;
- }
- }
- for (i = 0, len = exports.names.length; i < len; i++) {
- if (exports.names[i].test(name)) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Coerce `val`.
- *
- * @param {Mixed} val
- * @return {Mixed}
- * @api private
- */
-
- function coerce(val) {
- if (val instanceof Error) return val.stack || val.message;
- return val;
- }
- });
- var debug_2$1 = debug_1$1.coerce;
- var debug_3$1 = debug_1$1.disable;
- var debug_4$1 = debug_1$1.enable;
- var debug_5$1 = debug_1$1.enabled;
- var debug_6$1 = debug_1$1.humanize;
- var debug_7$1 = debug_1$1.names;
- var debug_8$1 = debug_1$1.skips;
- var debug_9$1 = debug_1$1.formatters;
-
- var browser$1 = createCommonjsModule(function (module, exports) {
- /**
- * This is the web browser implementation of `debug()`.
- *
- * Expose `debug()` as the module.
- */
-
- exports = module.exports = debug_1$1;
- exports.log = log;
- exports.formatArgs = formatArgs;
- exports.save = save;
- exports.load = load;
- exports.useColors = useColors;
- exports.storage = 'undefined' != typeof chrome
- && 'undefined' != typeof chrome.storage
- ? chrome.storage.local
- : localstorage();
-
- /**
- * Colors.
- */
-
- exports.colors = [
- 'lightseagreen',
- 'forestgreen',
- 'goldenrod',
- 'dodgerblue',
- 'darkorchid',
- 'crimson'
- ];
-
- /**
- * Currently only WebKit-based Web Inspectors, Firefox >= v31,
- * and the Firebug extension (any Firefox version) are known
- * to support "%c" CSS customizations.
- *
- * TODO: add a `localStorage` variable to explicitly enable/disable colors
- */
-
- function useColors() {
- // is webkit? http://stackoverflow.com/a/16459606/376773
- return ('WebkitAppearance' in document.documentElement.style) ||
- // is firebug? http://stackoverflow.com/a/398120/376773
- (window.console && (console.firebug || (console.exception && console.table))) ||
- // is firefox >= v31?
- // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
- (navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31);
- }
-
- /**
- * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
- */
-
- exports.formatters.j = function(v) {
- return JSON.stringify(v);
- };
-
-
- /**
- * Colorize log arguments if enabled.
- *
- * @api public
- */
-
- function formatArgs() {
- var args = arguments;
- var useColors = this.useColors;
-
- args[0] = (useColors ? '%c' : '')
- + this.namespace
- + (useColors ? ' %c' : ' ')
- + args[0]
- + (useColors ? '%c ' : ' ')
- + '+' + exports.humanize(this.diff);
-
- if (!useColors) return args;
-
- var c = 'color: ' + this.color;
- args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));
-
- // the final "%c" is somewhat tricky, because there could be other
- // arguments passed either before or after the %c, so we need to
- // figure out the correct index to insert the CSS into
- var index = 0;
- var lastC = 0;
- args[0].replace(/%[a-z%]/g, function(match) {
- if ('%%' === match) return;
- index++;
- if ('%c' === match) {
- // we only are interested in the *last* %c
- // (the user may have provided their own)
- lastC = index;
- }
- });
-
- args.splice(lastC, 0, c);
- return args;
- }
-
- /**
- * Invokes `console.log()` when available.
- * No-op when `console.log` is not a "function".
- *
- * @api public
- */
-
- function log() {
- // this hackery is required for IE8/9, where
- // the `console.log` function doesn't have 'apply'
- return 'object' === typeof console
- && console.log
- && Function.prototype.apply.call(console.log, console, arguments);
- }
-
- /**
- * Save `namespaces`.
- *
- * @param {String} namespaces
- * @api private
- */
-
- function save(namespaces) {
- try {
- if (null == namespaces) {
- exports.storage.removeItem('debug');
- } else {
- exports.storage.debug = namespaces;
- }
- } catch(e) {}
- }
-
- /**
- * Load `namespaces`.
- *
- * @return {String} returns the previously persisted debug modes
- * @api private
- */
-
- function load() {
- var r;
- try {
- r = exports.storage.debug;
- } catch(e) {}
- return r;
- }
-
- /**
- * Enable namespaces listed in `localStorage.debug` initially.
- */
-
- exports.enable(load());
-
- /**
- * Localstorage attempts to return the localstorage.
- *
- * This is necessary because safari throws
- * when a user disables cookies/localstorage
- * and you attempt to access it.
- *
- * @return {LocalStorage}
- * @api private
- */
-
- function localstorage(){
- try {
- return window.localStorage;
- } catch (e) {}
- }
- });
- var browser_1$1 = browser$1.log;
- var browser_2$1 = browser$1.formatArgs;
- var browser_3$1 = browser$1.save;
- var browser_4$1 = browser$1.load;
- var browser_5$1 = browser$1.useColors;
- var browser_6$1 = browser$1.storage;
- var browser_7$1 = browser$1.colors;
-
- /**
- * Module dependencies.
- */
-
- var debug$1 = browser$1('cookie');
-
- /**
- * Set or get cookie `name` with `value` and `options` object.
- *
- * @param {String} name
- * @param {String} value
- * @param {Object} options
- * @return {Mixed}
- * @api public
- */
-
- var componentCookie = function(name, value, options){
- switch (arguments.length) {
- case 3:
- case 2:
- return set$1(name, value, options);
- case 1:
- return get$2(name);
- default:
- return all$1();
- }
- };
-
- /**
- * Set cookie `name` to `value`.
- *
- * @param {String} name
- * @param {String} value
- * @param {Object} options
- * @api private
- */
-
- function set$1(name, value, options) {
- options = options || {};
- var str = encode$1(name) + '=' + encode$1(value);
-
- if (null == value) options.maxage = -1;
-
- if (options.maxage) {
- options.expires = new Date(+new Date + options.maxage);
- }
-
- if (options.path) str += '; path=' + options.path;
- if (options.domain) str += '; domain=' + options.domain;
- if (options.expires) str += '; expires=' + options.expires.toUTCString();
- if (options.secure) str += '; secure';
-
- document.cookie = str;
- }
-
- /**
- * Return all cookies.
- *
- * @return {Object}
- * @api private
- */
-
- function all$1() {
- var str;
- try {
- str = document.cookie;
- } catch (err) {
- if (typeof console !== 'undefined' && typeof console.error === 'function') {
- console.error(err.stack || err);
- }
- return {};
- }
- return parse$2(str);
- }
-
- /**
- * Get cookie `name`.
- *
- * @param {String} name
- * @return {String}
- * @api private
- */
-
- function get$2(name) {
- return all$1()[name];
- }
-
- /**
- * Parse cookie `str`.
- *
- * @param {String} str
- * @return {Object}
- * @api private
- */
-
- function parse$2(str) {
- var obj = {};
- var pairs = str.split(/ *; */);
- var pair;
- if ('' == pairs[0]) return obj;
- for (var i = 0; i < pairs.length; ++i) {
- pair = pairs[i].split('=');
- obj[decode$1(pair[0])] = decode$1(pair[1]);
- }
- return obj;
- }
-
- /**
- * Encode.
- */
-
- function encode$1(value){
- try {
- return encodeURIComponent(value);
- } catch (e) {
- debug$1('error `encode(%o)` - %o', value, e);
- }
- }
-
- /**
- * Decode.
- */
-
- function decode$1(value) {
- try {
- return decodeURIComponent(value);
- } catch (e) {
- debug$1('error `decode(%o)` - %o', value, e);
- }
- }
-
- var lib = createCommonjsModule(function (module, exports) {
-
- /**
- * Module dependencies.
- */
-
- var parse = componentUrl.parse;
-
-
- /**
- * Get the top domain.
- *
- * The function constructs the levels of domain and attempts to set a global
- * cookie on each one when it succeeds it returns the top level domain.
- *
- * The method returns an empty string when the hostname is an ip or `localhost`.
- *
- * Example levels:
- *
- * domain.levels('http://www.google.co.uk');
- * // => ["co.uk", "google.co.uk", "www.google.co.uk"]
- *
- * Example:
- *
- * domain('http://localhost:3000/baz');
- * // => ''
- * domain('http://dev:3000/baz');
- * // => ''
- * domain('http://127.0.0.1:3000/baz');
- * // => ''
- * domain('http://segment.io/baz');
- * // => 'segment.io'
- *
- * @param {string} url
- * @return {string}
- * @api public
- */
- function domain(url) {
- var cookie = exports.cookie;
- var levels = exports.levels(url);
-
- // Lookup the real top level one.
- for (var i = 0; i < levels.length; ++i) {
- var cname = '__tld__';
- var domain = levels[i];
- var opts = { domain: '.' + domain };
-
- cookie(cname, 1, opts);
- if (cookie(cname)) {
- cookie(cname, null, opts);
- return domain;
- }
- }
-
- return '';
- }
-
- /**
- * Levels returns all levels of the given url.
- *
- * @param {string} url
- * @return {Array}
- * @api public
- */
- domain.levels = function(url) {
- var host = parse(url).hostname;
- var parts = host.split('.');
- var last = parts[parts.length - 1];
- var levels = [];
-
- // Ip address.
- if (parts.length === 4 && last === parseInt(last, 10)) {
- return levels;
- }
-
- // Localhost.
- if (parts.length <= 1) {
- return levels;
- }
-
- // Create levels.
- for (var i = parts.length - 2; i >= 0; --i) {
- levels.push(parts.slice(i).join('.'));
- }
-
- return levels;
- };
-
- /**
- * Expose cookie on domain.
- */
- domain.cookie = componentCookie;
-
- /*
- * Exports.
- */
-
- exports = module.exports = domain;
- });
-
- /**
- * An object utility to persist values in cookies
- */
-
- var CookieLocal = /*#__PURE__*/function () {
- function CookieLocal(options) {
- _classCallCheck(this, CookieLocal);
-
- this._options = {};
- this.options(options);
- }
- /**
- *
- * @param {*} options
- */
-
-
- _createClass(CookieLocal, [{
- key: "options",
- value: function options() {
- var _options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
-
- if (arguments.length === 0) return this._options;
- var domain = ".".concat(lib(window.location.href));
- if (domain === ".") domain = null; // the default maxage and path
-
- this._options = defaults_1(_options, {
- maxage: 31536000000,
- path: "/",
- domain: domain,
- samesite: "Lax"
- }); // try setting a cookie first
-
- this.set("test_rudder", true);
-
- if (!this.get("test_rudder")) {
- this._options.domain = null;
- }
-
- this.remove("test_rudder");
- }
- /**
- *
- * @param {*} key
- * @param {*} value
- */
-
- }, {
- key: "set",
- value: function set(key, value) {
- try {
- value = json3.stringify(value);
- rudderComponentCookie(key, value, clone_1(this._options));
- return true;
- } catch (e) {
- return false;
- }
- }
- /**
- *
- * @param {*} key
- */
-
- }, {
- key: "get",
- value: function get(key) {
- // if not parseable, return as is without json parse
- var value;
-
- try {
- value = rudderComponentCookie(key);
- value = value ? json3.parse(value) : null;
- return value;
- } catch (e) {
- if (value) {
- return value;
- }
-
- return null;
- }
- }
- /**
- *
- * @param {*} key
- */
-
- }, {
- key: "remove",
- value: function remove(key) {
- try {
- rudderComponentCookie(key, null, clone_1(this._options));
- return true;
- } catch (e) {
- return false;
- }
- }
- }]);
-
- return CookieLocal;
- }(); // Exporting only the instance
-
-
- var Cookie = new CookieLocal({});
-
- var store = (function() {
- // Store.js
- var store = {},
- win = (typeof window != 'undefined' ? window : commonjsGlobal),
- doc = win.document,
- localStorageName = 'localStorage',
- scriptTag = 'script',
- storage;
-
- store.disabled = false;
- store.version = '1.3.20';
- store.set = function(key, value) {};
- store.get = function(key, defaultVal) {};
- store.has = function(key) { return store.get(key) !== undefined };
- store.remove = function(key) {};
- store.clear = function() {};
- store.transact = function(key, defaultVal, transactionFn) {
- if (transactionFn == null) {
- transactionFn = defaultVal;
- defaultVal = null;
- }
- if (defaultVal == null) {
- defaultVal = {};
- }
- var val = store.get(key, defaultVal);
- transactionFn(val);
- store.set(key, val);
- };
- store.getAll = function() {
- var ret = {};
- store.forEach(function(key, val) {
- ret[key] = val;
- });
- return ret
- };
- store.forEach = function() {};
- store.serialize = function(value) {
- return json3.stringify(value)
- };
- store.deserialize = function(value) {
- if (typeof value != 'string') { return undefined }
- try { return json3.parse(value) }
- catch(e) { return value || undefined }
- };
-
- // Functions to encapsulate questionable FireFox 3.6.13 behavior
- // when about.config::dom.storage.enabled === false
- // See https://github.com/marcuswestin/store.js/issues#issue/13
- function isLocalStorageNameSupported() {
- try { return (localStorageName in win && win[localStorageName]) }
- catch(err) { return false }
- }
-
- if (isLocalStorageNameSupported()) {
- storage = win[localStorageName];
- store.set = function(key, val) {
- if (val === undefined) { return store.remove(key) }
- storage.setItem(key, store.serialize(val));
- return val
- };
- store.get = function(key, defaultVal) {
- var val = store.deserialize(storage.getItem(key));
- return (val === undefined ? defaultVal : val)
- };
- store.remove = function(key) { storage.removeItem(key); };
- store.clear = function() { storage.clear(); };
- store.forEach = function(callback) {
- for (var i=0; idocument.w=window'+scriptTag+'>');
- storageContainer.close();
- storageOwner = storageContainer.w.frames[0].document;
- storage = storageOwner.createElement('div');
- } catch(e) {
- // somehow ActiveXObject instantiation failed (perhaps some special
- // security settings or otherwse), fall back to per-path storage
- storage = doc.createElement('div');
- storageOwner = doc.body;
- }
- var withIEStorage = function(storeFunction) {
- return function() {
- var args = Array.prototype.slice.call(arguments, 0);
- args.unshift(storage);
- // See http://msdn.microsoft.com/en-us/library/ms531081(v=VS.85).aspx
- // and http://msdn.microsoft.com/en-us/library/ms531424(v=VS.85).aspx
- storageOwner.appendChild(storage);
- storage.addBehavior('#default#userData');
- storage.load(localStorageName);
- var result = storeFunction.apply(store, args);
- storageOwner.removeChild(storage);
- return result
- }
- };
-
- // In IE7, keys cannot start with a digit or contain certain chars.
- // See https://github.com/marcuswestin/store.js/issues/40
- // See https://github.com/marcuswestin/store.js/issues/83
- var forbiddenCharsRegex = new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]", "g");
- var ieKeyFix = function(key) {
- return key.replace(/^d/, '___$&').replace(forbiddenCharsRegex, '___')
- };
- store.set = withIEStorage(function(storage, key, val) {
- key = ieKeyFix(key);
- if (val === undefined) { return store.remove(key) }
- storage.setAttribute(key, store.serialize(val));
- storage.save(localStorageName);
- return val
- });
- store.get = withIEStorage(function(storage, key, defaultVal) {
- key = ieKeyFix(key);
- var val = store.deserialize(storage.getAttribute(key));
- return (val === undefined ? defaultVal : val)
- });
- store.remove = withIEStorage(function(storage, key) {
- key = ieKeyFix(key);
- storage.removeAttribute(key);
- storage.save(localStorageName);
- });
- store.clear = withIEStorage(function(storage) {
- var attributes = storage.XMLDocument.documentElement.attributes;
- storage.load(localStorageName);
- for (var i=attributes.length-1; i>=0; i--) {
- storage.removeAttribute(attributes[i].name);
- }
- storage.save(localStorageName);
- });
- store.forEach = withIEStorage(function(storage, callback) {
- var attributes = storage.XMLDocument.documentElement.attributes;
- for (var i=0, attr; attr=attributes[i]; ++i) {
- callback(attr.name, store.deserialize(storage.getAttribute(attr.name)));
- }
- });
- }
-
- try {
- var testKey = '__storejs__';
- store.set(testKey, testKey);
- if (store.get(testKey) != testKey) { store.disabled = true; }
- store.remove(testKey);
- } catch(e) {
- store.disabled = true;
- }
- store.enabled = !store.disabled;
-
- return store
- }());
-
- /**
- * An object utility to persist user and other values in localstorage
- */
-
- var StoreLocal = /*#__PURE__*/function () {
- function StoreLocal(options) {
- _classCallCheck(this, StoreLocal);
-
- this._options = {};
- this.enabled = false;
- this.options(options);
- }
- /**
- *
- * @param {*} options
- */
-
-
- _createClass(StoreLocal, [{
- key: "options",
- value: function options() {
- var _options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
-
- if (arguments.length === 0) return this._options;
- defaults_1(_options, {
- enabled: true
- });
- this.enabled = _options.enabled && store.enabled;
- this._options = _options;
- }
- /**
- *
- * @param {*} key
- * @param {*} value
- */
-
- }, {
- key: "set",
- value: function set(key, value) {
- if (!this.enabled) return false;
- return store.set(key, value);
- }
- /**
- *
- * @param {*} key
- */
-
- }, {
- key: "get",
- value: function get(key) {
- if (!this.enabled) return null;
- return store.get(key);
- }
- /**
- *
- * @param {*} key
- */
-
- }, {
- key: "remove",
- value: function remove(key) {
- if (!this.enabled) return false;
- return store.remove(key);
- }
- }]);
-
- return StoreLocal;
- }(); // Exporting only the instance
-
-
- var Store = new StoreLocal({});
-
- var defaults$1 = {
- user_storage_key: "rl_user_id",
- user_storage_trait: "rl_trait",
- user_storage_anonymousId: "rl_anonymous_id",
- group_storage_key: "rl_group_id",
- group_storage_trait: "rl_group_trait"
- };
- /**
- * An object that handles persisting key-val from Analytics
- */
-
- var Storage = /*#__PURE__*/function () {
- function Storage() {
- _classCallCheck(this, Storage);
-
- // First try setting the storage to cookie else to localstorage
- Cookie.set("rudder_cookies", true);
-
- if (Cookie.get("rudder_cookies")) {
- Cookie.remove("rudder_cookies");
- this.storage = Cookie;
- return;
- } // localStorage is enabled.
-
-
- if (Store.enabled) {
- this.storage = Store;
- }
- }
- /**
- *
- * @param {*} key
- * @param {*} value
- */
-
-
- _createClass(Storage, [{
- key: "setItem",
- value: function setItem(key, value) {
- this.storage.set(key, value);
- }
- /**
- *
- * @param {*} value
- */
-
- }, {
- key: "setUserId",
- value: function setUserId(value) {
- if (typeof value !== "string") {
- logger.error("[Storage] setUserId:: userId should be string");
- return;
- }
-
- this.storage.set(defaults$1.user_storage_key, value);
- }
- /**
- *
- * @param {*} value
- */
-
- }, {
- key: "setUserTraits",
- value: function setUserTraits(value) {
- this.storage.set(defaults$1.user_storage_trait, value);
- }
- /**
- *
- * @param {*} value
- */
-
- }, {
- key: "setGroupId",
- value: function setGroupId(value) {
- if (typeof value !== "string") {
- logger.error("[Storage] setGroupId:: groupId should be string");
- return;
- }
-
- this.storage.set(defaults$1.group_storage_key, value);
- }
- /**
- *
- * @param {*} value
- */
-
- }, {
- key: "setGroupTraits",
- value: function setGroupTraits(value) {
- this.storage.set(defaults$1.group_storage_trait, value);
- }
- /**
- *
- * @param {*} value
- */
-
- }, {
- key: "setAnonymousId",
- value: function setAnonymousId(value) {
- if (typeof value !== "string") {
- logger.error("[Storage] setAnonymousId:: anonymousId should be string");
- return;
- }
-
- this.storage.set(defaults$1.user_storage_anonymousId, value);
- }
- /**
- *
- * @param {*} key
- */
-
- }, {
- key: "getItem",
- value: function getItem(key) {
- return this.storage.get(key);
- }
- /**
- * get the stored userId
- */
-
- }, {
- key: "getUserId",
- value: function getUserId() {
- return this.storage.get(defaults$1.user_storage_key);
- }
- /**
- * get the stored user traits
- */
-
- }, {
- key: "getUserTraits",
- value: function getUserTraits() {
- return this.storage.get(defaults$1.user_storage_trait);
- }
- /**
- * get the stored userId
- */
-
- }, {
- key: "getGroupId",
- value: function getGroupId() {
- return this.storage.get(defaults$1.group_storage_key);
- }
- /**
- * get the stored user traits
- */
-
- }, {
- key: "getGroupTraits",
- value: function getGroupTraits() {
- return this.storage.get(defaults$1.group_storage_trait);
- }
- /**
- * get stored anonymous id
- */
-
- }, {
- key: "getAnonymousId",
- value: function getAnonymousId() {
- return this.storage.get(defaults$1.user_storage_anonymousId);
- }
- /**
- *
- * @param {*} key
- */
-
- }, {
- key: "removeItem",
- value: function removeItem(key) {
- return this.storage.remove(key);
- }
- /**
- * remove stored keys
- */
-
- }, {
- key: "clear",
- value: function clear() {
- this.storage.remove(defaults$1.user_storage_key);
- this.storage.remove(defaults$1.user_storage_trait); // this.storage.remove(defaults.user_storage_anonymousId);
- }
- }]);
-
- return Storage;
- }();
-
- var Storage$1 = new Storage();
-
- var defaults$2 = {
- lotame_synch_time_key: "lt_synch_timestamp"
- };
-
- var LotameStorage = /*#__PURE__*/function () {
- function LotameStorage() {
- _classCallCheck(this, LotameStorage);
-
- this.storage = Storage$1; // new Storage();
- }
-
- _createClass(LotameStorage, [{
- key: "setLotameSynchTime",
- value: function setLotameSynchTime(value) {
- this.storage.setItem(defaults$2.lotame_synch_time_key, value);
- }
- }, {
- key: "getLotameSynchTime",
- value: function getLotameSynchTime() {
- return this.storage.getItem(defaults$2.lotame_synch_time_key);
- }
- }]);
-
- return LotameStorage;
- }();
-
- var lotameStorage = new LotameStorage();
-
- var Lotame = /*#__PURE__*/function () {
- function Lotame(config, analytics) {
- var _this = this;
-
- _classCallCheck(this, Lotame);
-
- this.name = "LOTAME";
- this.analytics = analytics;
- this.storage = lotameStorage;
- this.bcpUrlSettingsPixel = config.bcpUrlSettingsPixel;
- this.bcpUrlSettingsIframe = config.bcpUrlSettingsIframe;
- this.dspUrlSettingsPixel = config.dspUrlSettingsPixel;
- this.dspUrlSettingsIframe = config.dspUrlSettingsIframe;
- this.mappings = {};
- config.mappings.forEach(function (mapping) {
- var key = mapping.key;
- var value = mapping.value;
- _this.mappings[key] = value;
- });
- }
-
- _createClass(Lotame, [{
- key: "init",
- value: function init() {
- logger.debug("===in init Lotame===");
-
- window.LOTAME_SYNCH_CALLBACK = function () {};
- }
- }, {
- key: "addPixel",
- value: function addPixel(source, width, height) {
- logger.debug("Adding pixel for :: ".concat(source));
- var image = document.createElement("img");
- image.src = source;
- image.setAttribute("width", width);
- image.setAttribute("height", height);
- logger.debug("Image Pixel :: ".concat(image));
- document.getElementsByTagName("body")[0].appendChild(image);
- }
- }, {
- key: "addIFrame",
- value: function addIFrame(source) {
- logger.debug("Adding iframe for :: ".concat(source));
- var iframe = document.createElement("iframe");
- iframe.src = source;
- iframe.title = "empty";
- iframe.setAttribute("id", "LOTCCFrame");
- iframe.setAttribute("tabindex", "-1");
- iframe.setAttribute("role", "presentation");
- iframe.setAttribute("aria-hidden", "true");
- iframe.setAttribute("style", "border: 0px; width: 0px; height: 0px; display: block;");
- logger.debug("IFrame :: ".concat(iframe));
- document.getElementsByTagName("body")[0].appendChild(iframe);
- }
- }, {
- key: "syncPixel",
- value: function syncPixel(userId) {
- var _this2 = this;
-
- logger.debug("===== in syncPixel ======");
- logger.debug("Firing DSP Pixel URLs");
-
- if (this.dspUrlSettingsPixel && this.dspUrlSettingsPixel.length > 0) {
- var currentTime = Date.now();
- this.dspUrlSettingsPixel.forEach(function (urlSettings) {
- var dspUrl = _this2.compileUrl(_objectSpread2({}, _this2.mappings, {
- userId: userId,
- random: currentTime
- }), urlSettings.dspUrlTemplate);
-
- _this2.addPixel(dspUrl, "1", "1");
- });
- }
-
- logger.debug("Firing DSP IFrame URLs");
-
- if (this.dspUrlSettingsIframe && this.dspUrlSettingsIframe.length > 0) {
- var _currentTime = Date.now();
-
- this.dspUrlSettingsIframe.forEach(function (urlSettings) {
- var dspUrl = _this2.compileUrl(_objectSpread2({}, _this2.mappings, {
- userId: userId,
- random: _currentTime
- }), urlSettings.dspUrlTemplate);
-
- _this2.addIFrame(dspUrl);
- });
- }
-
- this.storage.setLotameSynchTime(Date.now()); // emit on syncPixel
-
- if (this.analytics.methodToCallbackMapping.syncPixel) {
- this.analytics.emit("syncPixel", {
- destination: this.name
- });
- }
- }
- }, {
- key: "compileUrl",
- value: function compileUrl(map, url) {
- Object.keys(map).forEach(function (key) {
- if (map.hasOwnProperty(key)) {
- var replaceKey = "{{".concat(key, "}}");
- var regex = new RegExp(replaceKey, "gi");
- url = url.replace(regex, map[key]);
- }
- });
- return url;
- }
- }, {
- key: "identify",
- value: function identify(rudderElement) {
- logger.debug("in Lotame identify");
- var userId = rudderElement.message.userId;
- this.syncPixel(userId);
- }
- }, {
- key: "track",
- value: function track(rudderElement) {
- logger.debug("track not supported for lotame");
- }
- }, {
- key: "page",
- value: function page(rudderElement) {
- var _this3 = this;
-
- logger.debug("in Lotame page");
- logger.debug("Firing BCP Pixel URLs");
-
- if (this.bcpUrlSettingsPixel && this.bcpUrlSettingsPixel.length > 0) {
- var currentTime = Date.now();
- this.bcpUrlSettingsPixel.forEach(function (urlSettings) {
- var bcpUrl = _this3.compileUrl(_objectSpread2({}, _this3.mappings, {
- random: currentTime
- }), urlSettings.bcpUrlTemplate);
-
- _this3.addPixel(bcpUrl, "1", "1");
- });
- }
-
- logger.debug("Firing BCP IFrame URLs");
-
- if (this.bcpUrlSettingsIframe && this.bcpUrlSettingsIframe.length > 0) {
- var _currentTime2 = Date.now();
-
- this.bcpUrlSettingsIframe.forEach(function (urlSettings) {
- var bcpUrl = _this3.compileUrl(_objectSpread2({}, _this3.mappings, {
- random: _currentTime2
- }), urlSettings.bcpUrlTemplate);
-
- _this3.addIFrame(bcpUrl);
- });
- }
-
- if (rudderElement.message.userId && this.isPixelToBeSynched()) {
- this.syncPixel(rudderElement.message.userId);
- }
- }
- }, {
- key: "isPixelToBeSynched",
- value: function isPixelToBeSynched() {
- var lastSynchedTime = this.storage.getLotameSynchTime();
- var currentTime = Date.now();
-
- if (!lastSynchedTime) {
- return true;
- }
-
- var difference = Math.floor((currentTime - lastSynchedTime) / (1000 * 3600 * 24));
- return difference >= 7;
- }
- }, {
- key: "isLoaded",
- value: function isLoaded() {
- logger.debug("in Lotame isLoaded");
- return true;
- }
- }, {
- key: "isReady",
- value: function isReady() {
- return true;
- }
- }]);
-
- return Lotame;
- }();
-
- // (config-plan name, native destination.name , exported integration name(this one below))
-
- var integrations = {
- HS: index,
- GA: index$1,
- HOTJAR: index$2,
- GOOGLEADS: index$3,
- VWO: VWO,
- GTM: GoogleTagManager,
- BRAZE: Braze,
- INTERCOM: INTERCOM,
- KEEN: Keen,
- KISSMETRICS: Kissmetrics,
- CUSTOMERIO: CustomerIO,
- CHARTBEAT: Chartbeat,
- COMSCORE: Comscore,
- FACEBOOK_PIXEL: FacebookPixel,
- LOTAME: Lotame
- };
-
- // Application class
- var RudderApp = function RudderApp() {
- _classCallCheck(this, RudderApp);
-
- this.build = "1.0.0";
- this.name = "RudderLabs JavaScript SDK";
- this.namespace = "com.rudderlabs.javascript";
- this.version = "1.1.2";
- };
-
- // Library information class
- var RudderLibraryInfo = function RudderLibraryInfo() {
- _classCallCheck(this, RudderLibraryInfo);
-
- this.name = "RudderLabs JavaScript SDK";
- this.version = "1.1.2";
- }; // Operating System information class
-
-
- var RudderOSInfo = function RudderOSInfo() {
- _classCallCheck(this, RudderOSInfo);
-
- this.name = "";
- this.version = "";
- }; // Screen information class
-
-
- var RudderScreenInfo = function RudderScreenInfo() {
- _classCallCheck(this, RudderScreenInfo);
-
- this.density = 0;
- this.width = 0;
- this.height = 0;
- }; // Device information class
-
- var RudderContext = function RudderContext() {
- _classCallCheck(this, RudderContext);
-
- this.app = new RudderApp();
- this.traits = null;
- this.library = new RudderLibraryInfo(); // this.os = null;
-
- var os = new RudderOSInfo();
- os.version = ""; // skipping version for simplicity now
-
- var screen = new RudderScreenInfo(); // Depending on environment within which the code is executing, screen
- // dimensions can be set
- // User agent and locale can be retrieved only for browser
- // For server-side integration, same needs to be set by calling program
-
- {
- // running within browser
- screen.width = window.width;
- screen.height = window.height;
- screen.density = window.devicePixelRatio;
- this.userAgent = navigator.userAgent; // property name differs based on browser version
-
- this.locale = navigator.language || navigator.browserLanguage;
- }
-
- this.os = os;
- this.screen = screen;
- this.device = null;
- this.network = null;
- };
-
- var RudderMessage = /*#__PURE__*/function () {
- function RudderMessage() {
- _classCallCheck(this, RudderMessage);
-
- this.channel = "web";
- this.context = new RudderContext();
- this.type = null;
- this.action = null;
- this.messageId = generateUUID().toString();
- this.originalTimestamp = new Date().toISOString();
- this.anonymousId = null;
- this.userId = null;
- this.event = null;
- this.properties = {};
- this.integrations = {}; // By default, all integrations will be set as enabled from client
- // Decision to route to specific destinations will be taken at server end
-
- this.integrations.All = true;
- } // Get property
-
-
- _createClass(RudderMessage, [{
- key: "getProperty",
- value: function getProperty(key) {
- return this.properties[key];
- } // Add property
-
- }, {
- key: "addProperty",
- value: function addProperty(key, value) {
- this.properties[key] = value;
- } // Validate whether this message is semantically valid for the type mentioned
-
- }, {
- key: "validateFor",
- value: function validateFor(messageType) {
- // First check that properties is populated
- if (!this.properties) {
- throw new Error("Key properties is required");
- } // Event type specific checks
-
-
- switch (messageType) {
- case MessageType.TRACK:
- // check if event is present
- if (!this.event) {
- throw new Error("Key event is required for track event");
- } // Next make specific checks for e-commerce events
-
-
- if (this.event in Object.values(ECommerceEvents)) {
- switch (this.event) {
- case ECommerceEvents.CHECKOUT_STEP_VIEWED:
- case ECommerceEvents.CHECKOUT_STEP_COMPLETED:
- case ECommerceEvents.PAYMENT_INFO_ENTERED:
- this.checkForKey("checkout_id");
- this.checkForKey("step");
- break;
-
- case ECommerceEvents.PROMOTION_VIEWED:
- case ECommerceEvents.PROMOTION_CLICKED:
- this.checkForKey("promotion_id");
- break;
-
- case ECommerceEvents.ORDER_REFUNDED:
- this.checkForKey("order_id");
- break;
- }
- } else if (!this.properties.category) {
- // if category is not there, set to event
- this.properties.category = this.event;
- }
-
- break;
-
- case MessageType.PAGE:
- break;
-
- case MessageType.SCREEN:
- if (!this.properties.name) {
- throw new Error("Key 'name' is required in properties");
- }
-
- break;
- }
- } // Function for checking existence of a particular property
-
- }, {
- key: "checkForKey",
- value: function checkForKey(propertyName) {
- if (!this.properties[propertyName]) {
- throw new Error("Key '".concat(propertyName, "' is required in properties"));
- }
- }
- }]);
-
- return RudderMessage;
- }();
-
- var RudderElement = /*#__PURE__*/function () {
- function RudderElement() {
- _classCallCheck(this, RudderElement);
-
- this.message = new RudderMessage();
- } // Setters that in turn set the field values for the contained object
-
-
- _createClass(RudderElement, [{
- key: "setType",
- value: function setType(type) {
- this.message.type = type;
- }
- }, {
- key: "setProperty",
- value: function setProperty(rudderProperty) {
- this.message.properties = rudderProperty;
- }
- }, {
- key: "setUserProperty",
- value: function setUserProperty(rudderUserProperty) {
- this.message.user_properties = rudderUserProperty;
- }
- }, {
- key: "setUserId",
- value: function setUserId(userId) {
- this.message.userId = userId;
- }
- }, {
- key: "setEventName",
- value: function setEventName(eventName) {
- this.message.event = eventName;
- }
- }, {
- key: "updateTraits",
- value: function updateTraits(traits) {
- this.message.context.traits = traits;
- }
- }, {
- key: "getElementContent",
- value: function getElementContent() {
- return this.message;
- }
- }]);
-
- return RudderElement;
- }();
-
- var RudderElementBuilder = /*#__PURE__*/function () {
- function RudderElementBuilder() {
- _classCallCheck(this, RudderElementBuilder);
-
- this.rudderProperty = null;
- this.rudderUserProperty = null;
- this.event = null;
- this.userId = null;
- this.channel = null;
- this.type = null;
- } // Set the property
-
-
- _createClass(RudderElementBuilder, [{
- key: "setProperty",
- value: function setProperty(inputRudderProperty) {
- this.rudderProperty = inputRudderProperty;
- return this;
- } // Build and set the property object
-
- }, {
- key: "setPropertyBuilder",
- value: function setPropertyBuilder(rudderPropertyBuilder) {
- this.rudderProperty = rudderPropertyBuilder.build();
- return this;
- }
- }, {
- key: "setUserProperty",
- value: function setUserProperty(inputRudderUserProperty) {
- this.rudderUserProperty = inputRudderUserProperty;
- return this;
- }
- }, {
- key: "setUserPropertyBuilder",
- value: function setUserPropertyBuilder(rudderUserPropertyBuilder) {
- this.rudderUserProperty = rudderUserPropertyBuilder.build();
- return this;
- } // Setter methods for all variables. Instance is returned for each call in
- // accordance with the Builder pattern
-
- }, {
- key: "setEvent",
- value: function setEvent(event) {
- this.event = event;
- return this;
- }
- }, {
- key: "setUserId",
- value: function setUserId(userId) {
- this.userId = userId;
- return this;
- }
- }, {
- key: "setChannel",
- value: function setChannel(channel) {
- this.channel = channel;
- return this;
- }
- }, {
- key: "setType",
- value: function setType(eventType) {
- this.type = eventType;
- return this;
- }
- }, {
- key: "build",
- value: function build() {
- var element = new RudderElement();
- element.setUserId(this.userId);
- element.setType(this.type);
- element.setEventName(this.event);
- element.setProperty(this.rudderProperty);
- element.setUserProperty(this.rudderUserProperty);
- return element;
- }
- }]);
-
- return RudderElementBuilder;
- }();
-
- var rngBrowser = createCommonjsModule(function (module) {
- // Unique ID creation requires a high quality random # generator. In the
- // browser this is a little complicated due to unknown quality of Math.random()
- // and inconsistent support for the `crypto` API. We do the best we can via
- // feature-detection
-
- // getRandomValues needs to be invoked in a context where "this" is a Crypto
- // implementation. Also, find the complete implementation of crypto on IE11.
- var getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto)) ||
- (typeof(msCrypto) != 'undefined' && typeof window.msCrypto.getRandomValues == 'function' && msCrypto.getRandomValues.bind(msCrypto));
-
- if (getRandomValues) {
- // WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto
- var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef
-
- module.exports = function whatwgRNG() {
- getRandomValues(rnds8);
- return rnds8;
- };
- } else {
- // Math.random()-based (RNG)
- //
- // If all else fails, use Math.random(). It's fast, but is of unspecified
- // quality.
- var rnds = new Array(16);
-
- module.exports = function mathRNG() {
- for (var i = 0, r; i < 16; i++) {
- if ((i & 0x03) === 0) r = Math.random() * 0x100000000;
- rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;
- }
-
- return rnds;
- };
- }
- });
-
- /**
- * Convert array of 16 byte values to UUID string format of the form:
- * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
- */
- var byteToHex = [];
- for (var i = 0; i < 256; ++i) {
- byteToHex[i] = (i + 0x100).toString(16).substr(1);
- }
-
- function bytesToUuid(buf, offset) {
- var i = offset || 0;
- var bth = byteToHex;
- // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
- return ([
- bth[buf[i++]], bth[buf[i++]],
- bth[buf[i++]], bth[buf[i++]], '-',
- bth[buf[i++]], bth[buf[i++]], '-',
- bth[buf[i++]], bth[buf[i++]], '-',
- bth[buf[i++]], bth[buf[i++]], '-',
- bth[buf[i++]], bth[buf[i++]],
- bth[buf[i++]], bth[buf[i++]],
- bth[buf[i++]], bth[buf[i++]]
- ]).join('');
- }
-
- var bytesToUuid_1 = bytesToUuid;
-
- // **`v1()` - Generate time-based UUID**
- //
- // Inspired by https://github.com/LiosK/UUID.js
- // and http://docs.python.org/library/uuid.html
-
- var _nodeId;
- var _clockseq;
-
- // Previous uuid creation time
- var _lastMSecs = 0;
- var _lastNSecs = 0;
-
- // See https://github.com/uuidjs/uuid for API details
- function v1(options, buf, offset) {
- var i = buf && offset || 0;
- var b = buf || [];
-
- options = options || {};
- var node = options.node || _nodeId;
- var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq;
-
- // node and clockseq need to be initialized to random values if they're not
- // specified. We do this lazily to minimize issues related to insufficient
- // system entropy. See #189
- if (node == null || clockseq == null) {
- var seedBytes = rngBrowser();
- if (node == null) {
- // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
- node = _nodeId = [
- seedBytes[0] | 0x01,
- seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]
- ];
- }
- if (clockseq == null) {
- // Per 4.2.2, randomize (14 bit) clockseq
- clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;
- }
- }
-
- // UUID timestamps are 100 nano-second units since the Gregorian epoch,
- // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so
- // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
- // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
- var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime();
-
- // Per 4.2.1.2, use count of uuid's generated during the current clock
- // cycle to simulate higher resolution clock
- var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1;
-
- // Time since last uuid creation (in msecs)
- var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000;
-
- // Per 4.2.1.2, Bump clockseq on clock regression
- if (dt < 0 && options.clockseq === undefined) {
- clockseq = clockseq + 1 & 0x3fff;
- }
-
- // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
- // time interval
- if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {
- nsecs = 0;
- }
-
- // Per 4.2.1.2 Throw error if too many uuids are requested
- if (nsecs >= 10000) {
- throw new Error('uuid.v1(): Can\'t create more than 10M uuids/sec');
- }
-
- _lastMSecs = msecs;
- _lastNSecs = nsecs;
- _clockseq = clockseq;
-
- // Per 4.1.4 - Convert from unix epoch to Gregorian epoch
- msecs += 12219292800000;
-
- // `time_low`
- var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;
- b[i++] = tl >>> 24 & 0xff;
- b[i++] = tl >>> 16 & 0xff;
- b[i++] = tl >>> 8 & 0xff;
- b[i++] = tl & 0xff;
-
- // `time_mid`
- var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff;
- b[i++] = tmh >>> 8 & 0xff;
- b[i++] = tmh & 0xff;
-
- // `time_high_and_version`
- b[i++] = tmh >>> 24 & 0xf | 0x10; // include version
- b[i++] = tmh >>> 16 & 0xff;
-
- // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
- b[i++] = clockseq >>> 8 | 0x80;
-
- // `clock_seq_low`
- b[i++] = clockseq & 0xff;
-
- // `node`
- for (var n = 0; n < 6; ++n) {
- b[i + n] = node[n];
- }
-
- return buf ? buf : bytesToUuid_1(b);
- }
-
- var v1_1 = v1;
-
- function v4(options, buf, offset) {
- var i = buf && offset || 0;
-
- if (typeof(options) == 'string') {
- buf = options === 'binary' ? new Array(16) : null;
- options = null;
- }
- options = options || {};
-
- var rnds = options.random || (options.rng || rngBrowser)();
-
- // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
- rnds[6] = (rnds[6] & 0x0f) | 0x40;
- rnds[8] = (rnds[8] & 0x3f) | 0x80;
-
- // Copy bytes to buffer, if provided
- if (buf) {
- for (var ii = 0; ii < 16; ++ii) {
- buf[i + ii] = rnds[ii];
- }
- }
-
- return buf || bytesToUuid_1(rnds);
- }
-
- var v4_1 = v4;
-
- var uuid = v4_1;
- uuid.v1 = v1_1;
- uuid.v4 = v4_1;
-
- var uuid_1 = uuid;
-
- var uuid$1 = uuid_1.v4;
-
- var inMemoryStore = {
- _data: {},
- length: 0,
- setItem: function(key, value) {
- this._data[key] = value;
- this.length = keys_1(this._data).length;
- return value;
- },
- getItem: function(key) {
- if (key in this._data) {
- return this._data[key];
- }
- return null;
- },
- removeItem: function(key) {
- if (key in this._data) {
- delete this._data[key];
- }
- this.length = keys_1(this._data).length;
- return null;
- },
- clear: function() {
- this._data = {};
- this.length = 0;
- },
- key: function(index) {
- return keys_1(this._data)[index];
- }
- };
-
- function isSupportedNatively() {
- try {
- if (!window.localStorage) return false;
- var key = uuid$1();
- window.localStorage.setItem(key, 'test_value');
- var value = window.localStorage.getItem(key);
- window.localStorage.removeItem(key);
-
- // handle localStorage silently failing
- return value === 'test_value';
- } catch (e) {
- // Can throw if localStorage is disabled
- return false;
- }
- }
-
- function pickStorage() {
- if (isSupportedNatively()) {
- return window.localStorage;
- }
- // fall back to in-memory
- return inMemoryStore;
- }
-
- // Return a shared instance
- var defaultEngine = pickStorage();
- // Expose the in-memory store explicitly for testing
- var inMemoryEngine = inMemoryStore;
-
- var engine = {
- defaultEngine: defaultEngine,
- inMemoryEngine: inMemoryEngine
- };
-
- var defaultEngine$1 = engine.defaultEngine;
- var inMemoryEngine$1 = engine.inMemoryEngine;
-
-
-
-
- /**
- * Store Implementation with dedicated
- */
-
- function Store$1(name, id, keys, optionalEngine) {
- this.id = id;
- this.name = name;
- this.keys = keys || {};
- this.engine = optionalEngine || defaultEngine$1;
- }
-
- /**
- * Set value by key.
- */
-
- Store$1.prototype.set = function(key, value) {
- var compoundKey = this._createValidKey(key);
- if (!compoundKey) return;
- try {
- this.engine.setItem(compoundKey, json3.stringify(value));
- } catch (err) {
- if (isQuotaExceeded(err)) {
- // switch to inMemory engine
- this._swapEngine();
- // and save it there
- this.set(key, value);
- }
- }
- };
-
- /**
- * Get by Key.
- */
-
- Store$1.prototype.get = function(key) {
- try {
- var str = this.engine.getItem(this._createValidKey(key));
- if (str === null) {
- return null;
- }
- return json3.parse(str);
- } catch (err) {
- return null;
- }
- };
-
- /**
- * Remove by Key.
- */
-
- Store$1.prototype.remove = function(key) {
- this.engine.removeItem(this._createValidKey(key));
- };
-
- /**
- * Ensure the key is valid
- */
-
- Store$1.prototype._createValidKey = function(key) {
- var name = this.name;
- var id = this.id;
-
- if (!keys_1(this.keys).length) return [name, id, key].join('.');
-
- // validate and return undefined if invalid key
- var compoundKey;
- each_1(function(value) {
- if (value === key) {
- compoundKey = [name, id, key].join('.');
- }
- }, this.keys);
- return compoundKey;
- };
-
- /**
- * Switch to inMemoryEngine, bringing any existing data with.
- */
-
- Store$1.prototype._swapEngine = function() {
- var self = this;
-
- // grab existing data, but only for this page's queue instance, not all
- // better to keep other queues in localstorage to be flushed later
- // than to pull them into memory and remove them from durable storage
- each_1(function(key) {
- var value = self.get(key);
- inMemoryEngine$1.setItem([self.name, self.id, key].join('.'), value);
- self.remove(key);
- }, this.keys);
-
- this.engine = inMemoryEngine$1;
- };
-
- var store$1 = Store$1;
-
- function isQuotaExceeded(e) {
- var quotaExceeded = false;
- if (e.code) {
- switch (e.code) {
- case 22:
- quotaExceeded = true;
- break;
- case 1014:
- // Firefox
- if (e.name === 'NS_ERROR_DOM_QUOTA_REACHED') {
- quotaExceeded = true;
- }
- break;
- }
- } else if (e.number === -2147024882) {
- // Internet Explorer 8
- quotaExceeded = true;
- }
- return quotaExceeded;
- }
-
- var defaultClock = {
- setTimeout: function(fn, ms) {
- return window.setTimeout(fn, ms);
- },
- clearTimeout: function(id) {
- return window.clearTimeout(id);
- },
- Date: window.Date
- };
-
- var clock = defaultClock;
-
- function Schedule() {
- this.tasks = {};
- this.nextId = 1;
- }
-
- Schedule.prototype.now = function() {
- return +new clock.Date();
- };
-
- Schedule.prototype.run = function(task, timeout) {
- var id = this.nextId++;
- this.tasks[id] = clock.setTimeout(this._handle(id, task), timeout);
- return id;
- };
-
- Schedule.prototype.cancel = function(id) {
- if (this.tasks[id]) {
- clock.clearTimeout(this.tasks[id]);
- delete this.tasks[id];
- }
- };
-
- Schedule.prototype.cancelAll = function() {
- each_1(clock.clearTimeout, this.tasks);
- this.tasks = {};
- };
-
- Schedule.prototype._handle = function(id, callback) {
- var self = this;
- return function() {
- delete self.tasks[id];
- return callback();
- };
- };
-
- Schedule.setClock = function(newClock) {
- clock = newClock;
- };
-
- Schedule.resetClock = function() {
- clock = defaultClock;
- };
-
- var schedule = Schedule;
-
- /**
- * Expose `debug()` as the module.
- */
-
- var debug_1$2 = debug$2;
-
- /**
- * Create a debugger with the given `name`.
- *
- * @param {String} name
- * @return {Type}
- * @api public
- */
-
- function debug$2(name) {
- if (!debug$2.enabled(name)) return function(){};
-
- return function(fmt){
- fmt = coerce(fmt);
-
- var curr = new Date;
- var ms = curr - (debug$2[name] || curr);
- debug$2[name] = curr;
-
- fmt = name
- + ' '
- + fmt
- + ' +' + debug$2.humanize(ms);
-
- // This hackery is required for IE8
- // where `console.log` doesn't have 'apply'
- window.console
- && console.log
- && Function.prototype.apply.call(console.log, console, arguments);
- }
- }
-
- /**
- * The currently active debug mode names.
- */
-
- debug$2.names = [];
- debug$2.skips = [];
-
- /**
- * Enables a debug mode by name. This can include modes
- * separated by a colon and wildcards.
- *
- * @param {String} name
- * @api public
- */
-
- debug$2.enable = function(name) {
- try {
- localStorage.debug = name;
- } catch(e){}
-
- var split = (name || '').split(/[\s,]+/)
- , len = split.length;
-
- for (var i = 0; i < len; i++) {
- name = split[i].replace('*', '.*?');
- if (name[0] === '-') {
- debug$2.skips.push(new RegExp('^' + name.substr(1) + '$'));
- }
- else {
- debug$2.names.push(new RegExp('^' + name + '$'));
- }
- }
- };
-
- /**
- * Disable debug output.
- *
- * @api public
- */
-
- debug$2.disable = function(){
- debug$2.enable('');
- };
-
- /**
- * Humanize the given `ms`.
- *
- * @param {Number} m
- * @return {String}
- * @api private
- */
-
- debug$2.humanize = function(ms) {
- var sec = 1000
- , min = 60 * 1000
- , hour = 60 * min;
-
- if (ms >= hour) return (ms / hour).toFixed(1) + 'h';
- if (ms >= min) return (ms / min).toFixed(1) + 'm';
- if (ms >= sec) return (ms / sec | 0) + 's';
- return ms + 'ms';
- };
-
- /**
- * Returns true if the given mode name is enabled, false otherwise.
- *
- * @param {String} name
- * @return {Boolean}
- * @api public
- */
-
- debug$2.enabled = function(name) {
- for (var i = 0, len = debug$2.skips.length; i < len; i++) {
- if (debug$2.skips[i].test(name)) {
- return false;
- }
- }
- for (var i = 0, len = debug$2.names.length; i < len; i++) {
- if (debug$2.names[i].test(name)) {
- return true;
- }
- }
- return false;
- };
-
- /**
- * Coerce `val`.
- */
-
- function coerce(val) {
- if (val instanceof Error) return val.stack || val.message;
- return val;
- }
-
- // persist
-
- try {
- if (window.localStorage) debug$2.enable(localStorage.debug);
- } catch(e){}
-
- var uuid$2 = uuid_1.v4;
-
-
-
- var debug$3 = debug_1$2('localstorage-retry');
-
-
- // Some browsers don't support Function.prototype.bind, so just including a simplified version here
- function bind(func, obj) {
- return function() {
- return func.apply(obj, arguments);
- };
- }
-
- /**
- * @callback processFunc
- * @param {Mixed} item The item added to the queue to process
- * @param {Function} done A function to call when processing is completed.
- * @param {Error} Optional error parameter if the processing failed
- * @param {Response} Optional response parameter to emit for async handling
- */
-
- /**
- * Constructs a Queue backed by localStorage
- *
- * @constructor
- * @param {String} name The name of the queue. Will be used to find abandoned queues and retry their items
- * @param {processFunc} fn The function to call in order to process an item added to the queue
- */
- function Queue(name, opts, fn) {
- if (typeof opts === 'function') fn = opts;
- this.name = name;
- this.id = uuid$2();
- this.fn = fn;
- this.maxItems = opts.maxItems || Infinity;
- this.maxAttempts = opts.maxAttempts || Infinity;
-
- this.backoff = {
- MIN_RETRY_DELAY: opts.minRetryDelay || 1000,
- MAX_RETRY_DELAY: opts.maxRetryDelay || 30000,
- FACTOR: opts.backoffFactor || 2,
- JITTER: opts.backoffJitter || 0
- };
-
- // painstakingly tuned. that's why they're not "easily" configurable
- this.timeouts = {
- ACK_TIMER: 1000,
- RECLAIM_TIMER: 3000,
- RECLAIM_TIMEOUT: 10000,
- RECLAIM_WAIT: 500
- };
-
- this.keys = {
- IN_PROGRESS: 'inProgress',
- QUEUE: 'queue',
- ACK: 'ack',
- RECLAIM_START: 'reclaimStart',
- RECLAIM_END: 'reclaimEnd'
- };
-
- this._schedule = new schedule();
- this._processId = 0;
-
- // Set up our empty queues
- this._store = new store$1(this.name, this.id, this.keys);
- this._store.set(this.keys.IN_PROGRESS, {});
- this._store.set(this.keys.QUEUE, []);
-
- // bind recurring tasks for ease of use
- this._ack = bind(this._ack, this);
- this._checkReclaim = bind(this._checkReclaim, this);
- this._processHead = bind(this._processHead, this);
-
- this._running = false;
- }
-
- /**
- * Mix in event emitter
- */
-
- componentEmitter(Queue.prototype);
-
- /**
- * Starts processing the queue
- */
- Queue.prototype.start = function() {
- if (this._running) {
- this.stop();
- }
- this._running = true;
- this._ack();
- this._checkReclaim();
- this._processHead();
- };
-
- /**
- * Stops processing the queue
- */
- Queue.prototype.stop = function() {
- this._schedule.cancelAll();
- this._running = false;
- };
-
- /**
- * Decides whether to retry. Overridable.
- *
- * @param {Object} item The item being processed
- * @param {Number} attemptNumber The attemptNumber (1 for first retry)
- * @param {Error} error The error from previous attempt, if there was one
- * @return {Boolean} Whether to requeue the message
- */
- Queue.prototype.shouldRetry = function(_, attemptNumber) {
- if (attemptNumber > this.maxAttempts) return false;
- return true;
- };
-
- /**
- * Calculates the delay (in ms) for a retry attempt
- *
- * @param {Number} attemptNumber The attemptNumber (1 for first retry)
- * @return {Number} The delay in milliseconds to wait before attempting a retry
- */
- Queue.prototype.getDelay = function(attemptNumber) {
- var ms = this.backoff.MIN_RETRY_DELAY * Math.pow(this.backoff.FACTOR, attemptNumber);
- if (this.backoff.JITTER) {
- var rand = Math.random();
- var deviation = Math.floor(rand * this.backoff.JITTER * ms);
- if (Math.floor(rand * 10) < 5) {
- ms -= deviation;
- } else {
- ms += deviation;
- }
- }
- return Number(Math.min(ms, this.backoff.MAX_RETRY_DELAY).toPrecision(1));
- };
-
- /**
- * Adds an item to the queue
- *
- * @param {Mixed} item The item to process
- */
- Queue.prototype.addItem = function(item) {
- this._enqueue({
- item: item,
- attemptNumber: 0,
- time: this._schedule.now()
- });
- };
-
- /**
- * Adds an item to the retry queue
- *
- * @param {Mixed} item The item to retry
- * @param {Number} attemptNumber The attempt number (1 for first retry)
- * @param {Error} [error] The error from previous attempt, if there was one
- */
- Queue.prototype.requeue = function(item, attemptNumber, error) {
- if (this.shouldRetry(item, attemptNumber, error)) {
- this._enqueue({
- item: item,
- attemptNumber: attemptNumber,
- time: this._schedule.now() + this.getDelay(attemptNumber)
- });
- } else {
- this.emit('discard', item, attemptNumber);
- }
- };
-
- Queue.prototype._enqueue = function(entry) {
- var queue = this._store.get(this.keys.QUEUE) || [];
- queue = queue.slice(-(this.maxItems - 1));
- queue.push(entry);
- queue = queue.sort(function(a,b) {
- return a.time - b.time;
- });
-
- this._store.set(this.keys.QUEUE, queue);
-
- if (this._running) {
- this._processHead();
- }
- };
-
- Queue.prototype._processHead = function() {
- var self = this;
- var store = this._store;
-
- // cancel the scheduled task if it exists
- this._schedule.cancel(this._processId);
-
- // Pop the head off the queue
- var queue = store.get(this.keys.QUEUE) || [];
- var inProgress = store.get(this.keys.IN_PROGRESS) || {};
- var now = this._schedule.now();
- var toRun = [];
-
- function enqueue(el, id) {
- toRun.push({
- item: el.item,
- done: function handle(err, res) {
- var inProgress = store.get(self.keys.IN_PROGRESS) || {};
- delete inProgress[id];
- store.set(self.keys.IN_PROGRESS, inProgress);
- self.emit('processed', err, res, el.item);
- if (err) {
- self.requeue(el.item, el.attemptNumber + 1, err);
- }
- }
- });
- }
-
- var inProgressSize = Object.keys(inProgress).length;
-
- while (queue.length && queue[0].time <= now && inProgressSize++ < self.maxItems) {
- var el = queue.shift();
- var id = uuid$2();
-
- // Save this to the in progress map
- inProgress[id] = {
- item: el.item,
- attemptNumber: el.attemptNumber,
- time: self._schedule.now()
- };
-
- enqueue(el, id);
- }
-
- store.set(this.keys.QUEUE, queue);
- store.set(this.keys.IN_PROGRESS, inProgress);
-
- each_1(function(el) {
- // TODO: handle fn timeout
- try {
- self.fn(el.item, el.done);
- } catch (err) {
- debug$3('Process function threw error: ' + err);
- }
- }, toRun);
-
- // re-read the queue in case the process function finished immediately or added another item
- queue = store.get(this.keys.QUEUE) || [];
- this._schedule.cancel(this._processId);
- if (queue.length > 0) {
- this._processId = this._schedule.run(this._processHead, queue[0].time - now);
- }
- };
-
- // Ack continuously to prevent other tabs from claiming our queue
- Queue.prototype._ack = function() {
- this._store.set(this.keys.ACK, this._schedule.now());
- this._store.set(this.keys.RECLAIM_START, null);
- this._store.set(this.keys.RECLAIM_END, null);
- this._schedule.run(this._ack, this.timeouts.ACK_TIMER);
- };
-
- Queue.prototype._checkReclaim = function() {
- var self = this;
-
- function tryReclaim(store) {
- store.set(self.keys.RECLAIM_START, self.id);
- store.set(self.keys.ACK, self._schedule.now());
-
- self._schedule.run(function() {
- if (store.get(self.keys.RECLAIM_START) !== self.id) return;
- store.set(self.keys.RECLAIM_END, self.id);
-
- self._schedule.run(function() {
- if (store.get(self.keys.RECLAIM_END) !== self.id) return;
- if (store.get(self.keys.RECLAIM_START) !== self.id) return;
- self._reclaim(store.id);
- }, self.timeouts.RECLAIM_WAIT);
- }, self.timeouts.RECLAIM_WAIT);
- }
-
- function findOtherQueues(name) {
- var res = [];
- var storage = self._store.engine;
- for (var i = 0; i < storage.length; i++) {
- var k = storage.key(i);
- var parts = k.split('.');
- if (parts.length !== 3) continue;
- if (parts[0] !== name) continue;
- if (parts[2] !== 'ack') continue;
- res.push(new store$1(name, parts[1], self.keys));
- }
- return res;
- }
-
- each_1(function(store) {
- if (store.id === self.id) return;
- if (self._schedule.now() - store.get(self.keys.ACK) < self.timeouts.RECLAIM_TIMEOUT) return;
- tryReclaim(store);
- }, findOtherQueues(this.name));
-
- this._schedule.run(this._checkReclaim, this.timeouts.RECLAIM_TIMER);
- };
-
- Queue.prototype._reclaim = function(id) {
- var self = this;
- var other = new store$1(this.name, id, this.keys);
-
- var our = {
- queue: this._store.get(this.keys.QUEUE) || []
- };
-
- var their = {
- inProgress: other.get(this.keys.IN_PROGRESS) || {},
- queue: other.get(this.keys.QUEUE) || []
- };
-
- // add their queue to ours, resetting run-time to immediate and copying the attempt#
- each_1(function(el) {
- our.queue.push({
- item: el.item,
- attemptNumber: el.attemptNumber,
- time: self._schedule.now()
- });
- }, their.queue);
-
- // if the queue is abandoned, all the in-progress are failed. retry them immediately and increment the attempt#
- each_1(function(el) {
- our.queue.push({
- item: el.item,
- attemptNumber: el.attemptNumber + 1,
- time: self._schedule.now()
- });
- }, their.inProgress);
-
- our.queue = our.queue.sort(function(a,b) {
- return a.time - b.time;
- });
-
- this._store.set(this.keys.QUEUE, our.queue);
-
- // remove all keys
- other.remove(this.keys.ACK);
- other.remove(this.keys.RECLAIM_START);
- other.remove(this.keys.RECLAIM_END);
- other.remove(this.keys.IN_PROGRESS);
- other.remove(this.keys.QUEUE);
-
- // process the new items we claimed
- this._processHead();
- };
-
- var lib$1 = Queue;
-
- // Payload class, contains batch of Elements
- var RudderPayload = function RudderPayload() {
- _classCallCheck(this, RudderPayload);
-
- this.batch = null;
- this.writeKey = null;
- };
-
- var queueOptions = {
- maxRetryDelay: 360000,
- minRetryDelay: 1000,
- backoffFactor: 2,
- maxAttempts: 10,
- maxItems: 100
- };
- var MESSAGE_LENGTH = 32 * 1000; // ~32 Kb
-
- /**
- *
- * @class EventRepository responsible for adding events into
- * flush queue and sending data to rudder backend
- * in batch and maintains order of the event.
- */
-
- var EventRepository = /*#__PURE__*/function () {
- /**
- *Creates an instance of EventRepository.
- * @memberof EventRepository
- */
- function EventRepository() {
- _classCallCheck(this, EventRepository);
-
- this.eventsBuffer = [];
- this.writeKey = "";
- this.url = BASE_URL;
- this.state = "READY";
- this.batchSize = 0; // previous implementation
- // setInterval(this.preaparePayloadAndFlush, FLUSH_INTERVAL_DEFAULT, this);
-
- this.payloadQueue = new lib$1("rudder", queueOptions, function (item, done) {
- // apply sentAt at flush time and reset on each retry
- item.message.sentAt = getCurrentTimeFormatted(); // send this item for processing, with a callback to enable queue to get the done status
-
- eventRepository.processQueueElement(item.url, item.headers, item.message, 10 * 1000, function (err, res) {
- if (err) {
- return done(err);
- }
-
- done(null, res);
- });
- }); // start queue
-
- this.payloadQueue.start();
- }
- /**
- *
- *
- * @param {EventRepository} repo
- * @returns
- * @memberof EventRepository
- */
-
-
- _createClass(EventRepository, [{
- key: "preaparePayloadAndFlush",
- value: function preaparePayloadAndFlush(repo) {
- // construct payload
- logger.debug("==== in preaparePayloadAndFlush with state: ".concat(repo.state));
- logger.debug(repo.eventsBuffer);
-
- if (repo.eventsBuffer.length == 0 || repo.state === "PROCESSING") {
- return;
- }
-
- var eventsPayload = repo.eventsBuffer;
- var payload = new RudderPayload();
- payload.batch = eventsPayload;
- payload.writeKey = repo.writeKey;
- payload.sentAt = getCurrentTimeFormatted(); // add sentAt to individual events as well
-
- payload.batch.forEach(function (event) {
- event.sentAt = payload.sentAt;
- });
- repo.batchSize = repo.eventsBuffer.length; // server-side integration, XHR is node module
-
- if (true) {
- var xhr = new XMLHttpRequest();
- } else {
- var xhr;
- }
-
- logger.debug("==== in flush sending to Rudder BE ====");
- logger.debug(JSON.stringify(payload, replacer));
- xhr.open("POST", repo.url, true);
- xhr.setRequestHeader("Content-Type", "application/json");
-
- {
- xhr.setRequestHeader("Authorization", "Basic ".concat(btoa("".concat(payload.writeKey, ":"))));
- } // register call back to reset event buffer on successfull POST
-
-
- xhr.onreadystatechange = function () {
- if (xhr.readyState === 4 && xhr.status === 200) {
- logger.debug("====== request processed successfully: ".concat(xhr.status));
- repo.eventsBuffer = repo.eventsBuffer.slice(repo.batchSize);
- logger.debug(repo.eventsBuffer.length);
- } else if (xhr.readyState === 4 && xhr.status !== 200) {
- handleError(new Error("request failed with status: ".concat(xhr.status, " for url: ").concat(repo.url)));
- }
-
- repo.state = "READY";
- };
-
- xhr.send(JSON.stringify(payload, replacer));
- repo.state = "PROCESSING";
- }
- /**
- * the queue item proceesor
- * @param {*} url to send requests to
- * @param {*} headers
- * @param {*} message
- * @param {*} timeout
- * @param {*} queueFn the function to call after request completion
- */
-
- }, {
- key: "processQueueElement",
- value: function processQueueElement(url, headers, message, timeout, queueFn) {
- try {
- var xhr = new XMLHttpRequest();
- xhr.open("POST", url, true);
-
- for (var k in headers) {
- xhr.setRequestHeader(k, headers[k]);
- }
-
- xhr.timeout = timeout;
- xhr.ontimeout = queueFn;
- xhr.onerror = queueFn;
-
- xhr.onreadystatechange = function () {
- if (xhr.readyState === 4) {
- if (xhr.status === 429 || xhr.status >= 500 && xhr.status < 600) {
- handleError(new Error("request failed with status: ".concat(xhr.status).concat(xhr.statusText, " for url: ").concat(url)));
- queueFn(new Error("request failed with status: ".concat(xhr.status).concat(xhr.statusText, " for url: ").concat(url)));
- } else {
- logger.debug("====== request processed successfully: ".concat(xhr.status));
- queueFn(null, xhr.status);
- }
- }
- };
-
- xhr.send(JSON.stringify(message, replacer));
- } catch (error) {
- queueFn(error);
- }
- }
- /**
- *
- *
- * @param {RudderElement} rudderElement
- * @memberof EventRepository
- */
-
- }, {
- key: "enqueue",
- value: function enqueue(rudderElement, type) {
- var message = rudderElement.getElementContent();
- var headers = {
- "Content-Type": "application/json",
- Authorization: "Basic ".concat(btoa("".concat(this.writeKey, ":"))),
- AnonymousId: btoa(message.anonymousId)
- };
- message.originalTimestamp = getCurrentTimeFormatted();
- message.sentAt = getCurrentTimeFormatted(); // add this, will get modified when actually being sent
- // check message size, if greater log an error
-
- if (JSON.stringify(message).length > MESSAGE_LENGTH) {
- logger.error("[EventRepository] enqueue:: message length greater 32 Kb ", message);
- } // modify the url for event specific endpoints
-
-
- var url = this.url.slice(-1) == "/" ? this.url.slice(0, -1) : this.url; // add items to the queue
-
- this.payloadQueue.addItem({
- url: "".concat(url, "/v1/").concat(type),
- headers: headers,
- message: message
- });
- }
- }]);
-
- return EventRepository;
- }();
-
- var eventRepository = new EventRepository();
-
- function addDomEventHandlers(rudderanalytics) {
- var handler = function handler(e) {
- e = e || window.event;
- var target = e.target || e.srcElement;
-
- if (isTextNode(target)) {
- target = target.parentNode;
- }
-
- if (shouldTrackDomEvent(target, e)) {
- logger.debug("to be tracked ", e.type);
- } else {
- logger.debug("not to be tracked ", e.type);
- }
-
- trackWindowEvent(e, rudderanalytics);
- };
-
- register_event(document, "submit", handler, true);
- register_event(document, "change", handler, true);
- register_event(document, "click", handler, true);
- rudderanalytics.page();
- }
-
- function register_event(element, type, handler, useCapture) {
- if (!element) {
- logger.error("[Autotrack] register_event:: No valid element provided to register_event");
- return;
- }
-
- element.addEventListener(type, handler, !!useCapture);
- }
-
- function shouldTrackDomEvent(el, event) {
- if (!el || isTag(el, "html") || !isElementNode(el)) {
- return false;
- }
-
- var tag = el.tagName.toLowerCase();
-
- switch (tag) {
- case "html":
- return false;
-
- case "form":
- return event.type === "submit";
-
- case "input":
- if (["button", "submit"].indexOf(el.getAttribute("type")) === -1) {
- return event.type === "change";
- }
-
- return event.type === "click";
-
- case "select":
- case "textarea":
- return event.type === "change";
-
- default:
- return event.type === "click";
- }
- }
-
- function isTag(el, tag) {
- return el && el.tagName && el.tagName.toLowerCase() === tag.toLowerCase();
- }
-
- function isElementNode(el) {
- return el && el.nodeType === 1; // Node.ELEMENT_NODE - use integer constant for browser portability
- }
-
- function isTextNode(el) {
- return el && el.nodeType === 3; // Node.TEXT_NODE - use integer constant for browser portability
- }
-
- function shouldTrackElement(el) {
- if (!el.parentNode || isTag(el, "body")) return false;
- return true;
- }
-
- function getClassName(el) {
- switch (_typeof(el.className)) {
- case "string":
- return el.className;
-
- case "object":
- // handle cases where className might be SVGAnimatedString or some other type
- return el.className.baseVal || el.getAttribute("class") || "";
-
- default:
- // future proof
- return "";
- }
- }
-
- function trackWindowEvent(e, rudderanalytics) {
- var target = e.target || e.srcElement;
- var formValues;
-
- if (isTextNode(target)) {
- target = target.parentNode;
- }
-
- if (shouldTrackDomEvent(target, e)) {
- if (target.tagName.toLowerCase() == "form") {
- formValues = {};
-
- for (var i = 0; i < target.elements.length; i++) {
- var formElement = target.elements[i];
-
- if (isElToBeTracked(formElement) && isElValueToBeTracked(formElement, rudderanalytics.trackValues)) {
- var name = formElement.id ? formElement.id : formElement.name;
-
- if (name && typeof name === "string") {
- var key = formElement.id ? formElement.id : formElement.name; // formElement.value gives the same thing
-
- var value = formElement.id ? document.getElementById(formElement.id).value : document.getElementsByName(formElement.name)[0].value;
-
- if (formElement.type === "checkbox" || formElement.type === "radio") {
- value = formElement.checked;
- }
-
- if (key.trim() !== "") {
- formValues[encodeURIComponent(key)] = encodeURIComponent(value);
- }
- }
- }
- }
- }
-
- var targetElementList = [target];
- var curEl = target;
-
- while (curEl.parentNode && !isTag(curEl, "body")) {
- targetElementList.push(curEl.parentNode);
- curEl = curEl.parentNode;
- }
-
- var elementsJson = [];
- var href;
- var explicitNoTrack = false;
- targetElementList.forEach(function (el) {
- var shouldTrackEl = shouldTrackElement(el); // if the element or a parent element is an anchor tag
- // include the href as a property
-
- if (el.tagName.toLowerCase() === "a") {
- href = el.getAttribute("href");
- href = shouldTrackEl && href;
- } // allow users to programatically prevent tracking of elements by adding class 'rudder-no-track'
-
-
- explicitNoTrack = explicitNoTrack || !isElToBeTracked(el); // explicitNoTrack = !isElToBeTracked(el);
-
- elementsJson.push(getPropertiesFromElement(el, rudderanalytics));
- });
-
- if (explicitNoTrack) {
- return false;
- }
-
- var elementText = "";
- var text = getText(target); // target.innerText//target.textContent//getSafeText(target);
-
- if (text && text.length) {
- elementText = text;
- }
-
- var props = {
- event_type: e.type,
- page: getDefaultPageProperties(),
- elements: elementsJson,
- el_attr_href: href,
- el_text: elementText
- };
-
- if (formValues) {
- props.form_values = formValues;
- }
-
- logger.debug("web_event", props);
- rudderanalytics.track("autotrack", props);
- return true;
- }
- }
-
- function isElValueToBeTracked(el, includeList) {
- var elAttributesLength = el.attributes.length;
-
- for (var i = 0; i < elAttributesLength; i++) {
- var value = el.attributes[i].value;
-
- if (includeList.indexOf(value) > -1) {
- return true;
- }
- }
-
- return false;
- }
-
- function isElToBeTracked(el) {
- var classes = getClassName(el).split(" ");
-
- if (classes.indexOf("rudder-no-track") >= 0) {
- return false;
- }
-
- return true;
- }
-
- function getText(el) {
- var text = "";
- el.childNodes.forEach(function (value) {
- if (value.nodeType === Node.TEXT_NODE) {
- text += value.nodeValue;
- }
- });
- return text.trim();
- }
-
- function getPropertiesFromElement(elem, rudderanalytics) {
- var props = {
- classes: getClassName(elem).split(" "),
- tag_name: elem.tagName.toLowerCase()
- };
- var attrLength = elem.attributes.length;
-
- for (var i = 0; i < attrLength; i++) {
- var name = elem.attributes[i].name;
- var value = elem.attributes[i].value;
-
- if (value) {
- props["attr__".concat(name)] = value;
- }
-
- if ((name == "name" || name == "id") && isElValueToBeTracked(elem, rudderanalytics.trackValues)) {
- props.field_value = name == "id" ? document.getElementById(value).value : document.getElementsByName(value)[0].value;
-
- if (elem.type === "checkbox" || elem.type === "radio") {
- props.field_value = elem.checked;
- }
- }
- }
-
- var nthChild = 1;
- var nthOfType = 1;
- var currentElem = elem;
-
- while (currentElem = previousElementSibling(currentElem)) {
- nthChild++;
-
- if (currentElem.tagName === elem.tagName) {
- nthOfType++;
- }
- }
-
- props.nth_child = nthChild;
- props.nth_of_type = nthOfType;
- return props;
- }
-
- function previousElementSibling(el) {
- if (el.previousElementSibling) {
- return el.previousElementSibling;
- }
-
- do {
- el = el.previousSibling;
- } while (el && !isElementNode(el));
-
- return el;
- }
-
- /**
- * Add the rudderelement object to flush queue
- *
- * @param {RudderElement} rudderElement
- */
-
- function enqueue(rudderElement, type) {
- if (!this.eventRepository) {
- this.eventRepository = eventRepository;
- }
-
- this.eventRepository.enqueue(rudderElement, type);
- }
- /**
- * class responsible for handling core
- * event tracking functionalities
- */
-
-
- var Analytics = /*#__PURE__*/function () {
- /**
- * Creates an instance of Analytics.
- * @memberof Analytics
- */
- function Analytics() {
- _classCallCheck(this, Analytics);
-
- this.autoTrackHandlersRegistered = false;
- this.autoTrackFeatureEnabled = false;
- this.initialized = false;
- this.trackValues = [];
- this.eventsBuffer = [];
- this.clientIntegrations = [];
- this.loadOnlyIntegrations = {};
- this.clientIntegrationObjects = undefined;
- this.successfullyLoadedIntegration = [];
- this.failedToBeLoadedIntegration = [];
- this.toBeProcessedArray = [];
- this.toBeProcessedByIntegrationArray = [];
- this.storage = Storage$1;
- this.userId = this.storage.getUserId() != undefined ? this.storage.getUserId() : "";
- this.userTraits = this.storage.getUserTraits() != undefined ? this.storage.getUserTraits() : {};
- this.groupId = this.storage.getGroupId() != undefined ? this.storage.getGroupId() : "";
- this.groupTraits = this.storage.getGroupTraits() != undefined ? this.storage.getGroupTraits() : {};
- this.anonymousId = this.getAnonymousId();
- this.storage.setUserId(this.userId);
- this.eventRepository = eventRepository;
- this.sendAdblockPage = false;
- this.sendAdblockPageOptions = {};
- this.clientSuppliedCallbacks = {};
-
- this.readyCallback = function () {};
-
- this.executeReadyCallback = undefined;
- this.methodToCallbackMapping = {
- syncPixel: "syncPixelCallback"
- };
- }
- /**
- * Process the response from control plane and
- * call initialize for integrations
- *
- * @param {*} status
- * @param {*} response
- * @memberof Analytics
- */
-
-
- _createClass(Analytics, [{
- key: "processResponse",
- value: function processResponse(status, response) {
- try {
- logger.debug("===in process response=== ".concat(status));
- response = JSON.parse(response);
-
- if (response.source.useAutoTracking && !this.autoTrackHandlersRegistered) {
- this.autoTrackFeatureEnabled = true;
- addDomEventHandlers(this);
- this.autoTrackHandlersRegistered = true;
- }
-
- response.source.destinations.forEach(function (destination, index) {
- logger.debug("Destination ".concat(index, " Enabled? ").concat(destination.enabled, " Type: ").concat(destination.destinationDefinition.name, " Use Native SDK? ").concat(destination.config.useNativeSDK));
-
- if (destination.enabled) {
- this.clientIntegrations.push({
- name: destination.destinationDefinition.name,
- config: destination.config
- });
- }
- }, this);
- console.log("this.clientIntegrations: ", this.clientIntegrations); // intersection of config-plane native sdk destinations with sdk load time destination list
-
- this.clientIntegrations = findAllEnabledDestinations(this.loadOnlyIntegrations, this.clientIntegrations); // remove from the list which don't have support yet in SDK
-
- this.clientIntegrations = this.clientIntegrations.filter(function (intg) {
- return integrations[intg.name] != undefined;
- });
- this.init(this.clientIntegrations);
- } catch (error) {
- handleError(error);
- logger.debug("===handling config BE response processing error===");
- logger.debug("autoTrackHandlersRegistered", this.autoTrackHandlersRegistered);
-
- if (this.autoTrackFeatureEnabled && !this.autoTrackHandlersRegistered) {
- addDomEventHandlers(this);
- this.autoTrackHandlersRegistered = true;
- }
- }
- }
- /**
- * Initialize integrations by addinfg respective scripts
- * keep the instances reference in core
- *
- * @param {*} intgArray
- * @returns
- * @memberof Analytics
- */
-
- }, {
- key: "init",
- value: function init(intgArray) {
- var _this = this;
-
- var self = this;
- logger.debug("supported intgs ", integrations); // this.clientIntegrationObjects = [];
-
- if (!intgArray || intgArray.length == 0) {
- if (this.readyCallback) {
- this.readyCallback();
- }
-
- this.toBeProcessedByIntegrationArray = [];
- return;
- }
-
- intgArray.forEach(function (intg) {
- try {
- logger.debug("[Analytics] init :: trying to initialize integration name:: ", intg.name);
- var intgClass = integrations[intg.name];
- var destConfig = intg.config;
- var intgInstance = new intgClass(destConfig, self);
- intgInstance.init();
- logger.debug("initializing destination: ", intg);
-
- _this.isInitialized(intgInstance).then(_this.replayEvents);
- } catch (e) {
- logger.error("[Analytics] initialize integration (integration.init()) failed :: ", intg.name);
- }
- });
- }
- }, {
- key: "replayEvents",
- value: function replayEvents(object) {
- if (object.successfullyLoadedIntegration.length + object.failedToBeLoadedIntegration.length == object.clientIntegrations.length && object.toBeProcessedByIntegrationArray.length > 0) {
- logger.debug("===replay events called====", object.successfullyLoadedIntegration.length, object.failedToBeLoadedIntegration.length);
- object.clientIntegrationObjects = [];
- object.clientIntegrationObjects = object.successfullyLoadedIntegration;
- logger.debug("==registering after callback===", object.clientIntegrationObjects.length);
- object.executeReadyCallback = after_1(object.clientIntegrationObjects.length, object.readyCallback);
- logger.debug("==registering ready callback===");
- object.on("ready", object.executeReadyCallback);
- object.clientIntegrationObjects.forEach(function (intg) {
- logger.debug("===looping over each successful integration====");
-
- if (!intg.isReady || intg.isReady()) {
- logger.debug("===letting know I am ready=====", intg.name);
- object.emit("ready");
- }
- }); // send the queued events to the fetched integration
-
- object.toBeProcessedByIntegrationArray.forEach(function (event) {
- var methodName = event[0];
- event.shift(); // convert common names to sdk identified name
-
- if (Object.keys(event[0].message.integrations).length > 0) {
- tranformToRudderNames(event[0].message.integrations);
- } // if not specified at event level, All: true is default
-
-
- var clientSuppliedIntegrations = event[0].message.integrations; // get intersection between config plane native enabled destinations
- // (which were able to successfully load on the page) vs user supplied integrations
-
- var succesfulLoadedIntersectClientSuppliedIntegrations = findAllEnabledDestinations(clientSuppliedIntegrations, object.clientIntegrationObjects); // send to all integrations now from the 'toBeProcessedByIntegrationArray' replay queue
-
- for (var i = 0; i < succesfulLoadedIntersectClientSuppliedIntegrations.length; i++) {
- try {
- if (!succesfulLoadedIntersectClientSuppliedIntegrations[i].isFailed || !succesfulLoadedIntersectClientSuppliedIntegrations[i].isFailed()) {
- if (succesfulLoadedIntersectClientSuppliedIntegrations[i][methodName]) {
- var _succesfulLoadedInter;
-
- (_succesfulLoadedInter = succesfulLoadedIntersectClientSuppliedIntegrations[i])[methodName].apply(_succesfulLoadedInter, _toConsumableArray(event));
- }
- }
- } catch (error) {
- handleError(error);
- }
- }
- });
- object.toBeProcessedByIntegrationArray = [];
- }
- }
- }, {
- key: "pause",
- value: function pause(time) {
- return new Promise(function (resolve) {
- setTimeout(resolve, time);
- });
- }
- }, {
- key: "isInitialized",
- value: function isInitialized(instance) {
- var _this2 = this;
-
- var time = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
- return new Promise(function (resolve) {
- if (instance.isLoaded()) {
- logger.debug("===integration loaded successfully====", instance.name);
-
- _this2.successfullyLoadedIntegration.push(instance);
-
- return resolve(_this2);
- }
-
- if (time >= MAX_WAIT_FOR_INTEGRATION_LOAD) {
- logger.debug("====max wait over====");
-
- _this2.failedToBeLoadedIntegration.push(instance);
-
- return resolve(_this2);
- }
-
- _this2.pause(INTEGRATION_LOAD_CHECK_INTERVAL).then(function () {
- logger.debug("====after pause, again checking====");
- return _this2.isInitialized(instance, time + INTEGRATION_LOAD_CHECK_INTERVAL).then(resolve);
- });
- });
- }
- /**
- * Process page params and forward to page call
- *
- * @param {*} category
- * @param {*} name
- * @param {*} properties
- * @param {*} options
- * @param {*} callback
- * @memberof Analytics
- */
-
- }, {
- key: "page",
- value: function page(category, name, properties, options, callback) {
- if (typeof options === "function") callback = options, options = null;
- if (typeof properties === "function") callback = properties, options = properties = null;
- if (typeof name === "function") callback = name, options = properties = name = null;
- if (_typeof(category) === "object") options = name, properties = category, name = category = null;
- if (_typeof(name) === "object") options = properties, properties = name, name = null;
- if (typeof category === "string" && typeof name !== "string") name = category, category = null;
-
- if (this.sendAdblockPage && category != "RudderJS-Initiated") {
- this.sendSampleRequest();
- }
-
- this.processPage(category, name, properties, options, callback);
- }
- /**
- * Process track params and forward to track call
- *
- * @param {*} event
- * @param {*} properties
- * @param {*} options
- * @param {*} callback
- * @memberof Analytics
- */
-
- }, {
- key: "track",
- value: function track(event, properties, options, callback) {
- if (typeof options === "function") callback = options, options = null;
- if (typeof properties === "function") callback = properties, options = null, properties = null;
- this.processTrack(event, properties, options, callback);
- }
- /**
- * Process identify params and forward to indentify call
- *
- * @param {*} userId
- * @param {*} traits
- * @param {*} options
- * @param {*} callback
- * @memberof Analytics
- */
-
- }, {
- key: "identify",
- value: function identify(userId, traits, options, callback) {
- if (typeof options === "function") callback = options, options = null;
- if (typeof traits === "function") callback = traits, options = null, traits = null;
- if (_typeof(userId) === "object") options = traits, traits = userId, userId = this.userId;
- this.processIdentify(userId, traits, options, callback);
- }
- /**
- *
- * @param {*} to
- * @param {*} from
- * @param {*} options
- * @param {*} callback
- */
-
- }, {
- key: "alias",
- value: function alias(to, from, options, callback) {
- if (typeof options === "function") callback = options, options = null;
- if (typeof from === "function") callback = from, options = null, from = null;
- if (_typeof(from) === "object") options = from, from = null;
- var rudderElement = new RudderElementBuilder().setType("alias").build();
- rudderElement.message.previousId = from || (this.userId ? this.userId : this.getAnonymousId());
- rudderElement.message.userId = to;
- this.processAndSendDataToDestinations("alias", rudderElement, options, callback);
- }
- /**
- *
- * @param {*} to
- * @param {*} from
- * @param {*} options
- * @param {*} callback
- */
-
- }, {
- key: "group",
- value: function group(groupId, traits, options, callback) {
- if (!arguments.length) return;
- if (typeof options === "function") callback = options, options = null;
- if (typeof traits === "function") callback = traits, options = null, traits = null;
- if (_typeof(groupId) === "object") options = traits, traits = groupId, groupId = this.groupId;
- this.groupId = groupId;
- this.storage.setGroupId(this.groupId);
- var rudderElement = new RudderElementBuilder().setType("group").build();
-
- if (traits) {
- for (var key in traits) {
- this.groupTraits[key] = traits[key];
- }
- } else {
- this.groupTraits = {};
- }
-
- this.storage.setGroupTraits(this.groupTraits);
- this.processAndSendDataToDestinations("group", rudderElement, options, callback);
- }
- /**
- * Send page call to Rudder BE and to initialized integrations
- *
- * @param {*} category
- * @param {*} name
- * @param {*} properties
- * @param {*} options
- * @param {*} callback
- * @memberof Analytics
- */
-
- }, {
- key: "processPage",
- value: function processPage(category, name, properties, options, callback) {
- var rudderElement = new RudderElementBuilder().setType("page").build();
-
- if (name) {
- rudderElement.message.name = name;
- }
-
- if (!properties) {
- properties = {};
- }
-
- if (category) {
- properties.category = category;
- }
-
- if (properties) {
- rudderElement.message.properties = this.getPageProperties(properties); // properties;
- }
-
- this.trackPage(rudderElement, options, callback);
- }
- /**
- * Send track call to Rudder BE and to initialized integrations
- *
- * @param {*} event
- * @param {*} properties
- * @param {*} options
- * @param {*} callback
- * @memberof Analytics
- */
-
- }, {
- key: "processTrack",
- value: function processTrack(event, properties, options, callback) {
- var rudderElement = new RudderElementBuilder().setType("track").build();
-
- if (event) {
- rudderElement.setEventName(event);
- }
-
- if (properties) {
- rudderElement.setProperty(properties);
- } else {
- rudderElement.setProperty({});
- }
-
- this.trackEvent(rudderElement, options, callback);
- }
- /**
- * Send identify call to Rudder BE and to initialized integrations
- *
- * @param {*} userId
- * @param {*} traits
- * @param {*} options
- * @param {*} callback
- * @memberof Analytics
- */
-
- }, {
- key: "processIdentify",
- value: function processIdentify(userId, traits, options, callback) {
- if (userId && this.userId && userId !== this.userId) {
- this.reset();
- }
-
- this.userId = userId;
- this.storage.setUserId(this.userId);
- var rudderElement = new RudderElementBuilder().setType("identify").build();
-
- if (traits) {
- for (var key in traits) {
- this.userTraits[key] = traits[key];
- }
-
- this.storage.setUserTraits(this.userTraits);
- }
-
- this.identifyUser(rudderElement, options, callback);
- }
- /**
- * Identify call supporting rudderelement from builder
- *
- * @param {*} rudderElement
- * @param {*} callback
- * @memberof Analytics
- */
-
- }, {
- key: "identifyUser",
- value: function identifyUser(rudderElement, options, callback) {
- if (rudderElement.message.userId) {
- this.userId = rudderElement.message.userId;
- this.storage.setUserId(this.userId);
- }
-
- if (rudderElement && rudderElement.message && rudderElement.message.context && rudderElement.message.context.traits) {
- this.userTraits = _objectSpread2({}, rudderElement.message.context.traits);
- this.storage.setUserTraits(this.userTraits);
- }
-
- this.processAndSendDataToDestinations("identify", rudderElement, options, callback);
- }
- /**
- * Page call supporting rudderelement from builder
- *
- * @param {*} rudderElement
- * @param {*} callback
- * @memberof Analytics
- */
-
- }, {
- key: "trackPage",
- value: function trackPage(rudderElement, options, callback) {
- this.processAndSendDataToDestinations("page", rudderElement, options, callback);
- }
- /**
- * Track call supporting rudderelement from builder
- *
- * @param {*} rudderElement
- * @param {*} callback
- * @memberof Analytics
- */
-
- }, {
- key: "trackEvent",
- value: function trackEvent(rudderElement, options, callback) {
- this.processAndSendDataToDestinations("track", rudderElement, options, callback);
- }
- /**
- * Process and send data to destinations along with rudder BE
- *
- * @param {*} type
- * @param {*} rudderElement
- * @param {*} callback
- * @memberof Analytics
- */
-
- }, {
- key: "processAndSendDataToDestinations",
- value: function processAndSendDataToDestinations(type, rudderElement, options, callback) {
- try {
- if (!this.anonymousId) {
- this.setAnonymousId();
- } // assign page properties to context
-
-
- rudderElement.message.context.page = getDefaultPageProperties();
- rudderElement.message.context.traits = _objectSpread2({}, this.userTraits);
- logger.debug("anonymousId: ", this.anonymousId);
- rudderElement.message.anonymousId = this.anonymousId;
- rudderElement.message.userId = rudderElement.message.userId ? rudderElement.message.userId : this.userId;
-
- if (type == "group") {
- if (this.groupId) {
- rudderElement.message.groupId = this.groupId;
- }
-
- if (this.groupTraits) {
- rudderElement.message.traits = _objectSpread2({}, this.groupTraits);
- }
- }
-
- if (options) {
- this.processOptionsParam(rudderElement, options);
- }
-
- logger.debug(JSON.stringify(rudderElement)); // structure user supplied integrations object to rudder format
-
- if (Object.keys(rudderElement.message.integrations).length > 0) {
- tranformToRudderNames(rudderElement.message.integrations);
- } // if not specified at event level, All: true is default
-
-
- var clientSuppliedIntegrations = rudderElement.message.integrations; // get intersection between config plane native enabled destinations
- // (which were able to successfully load on the page) vs user supplied integrations
-
- var succesfulLoadedIntersectClientSuppliedIntegrations = findAllEnabledDestinations(clientSuppliedIntegrations, this.clientIntegrationObjects); // try to first send to all integrations, if list populated from BE
-
- succesfulLoadedIntersectClientSuppliedIntegrations.forEach(function (obj) {
- if (!obj.isFailed || !obj.isFailed()) {
- if (obj[type]) {
- obj[type](rudderElement);
- }
- }
- }); // config plane native enabled destinations, still not completely loaded
- // in the page, add the events to a queue and process later
-
- if (!this.clientIntegrationObjects) {
- logger.debug("pushing in replay queue"); // new event processing after analytics initialized but integrations not fetched from BE
-
- this.toBeProcessedByIntegrationArray.push([type, rudderElement]);
- } // convert integrations object to server identified names, kind of hack now!
-
-
- transformToServerNames(rudderElement.message.integrations); // self analytics process, send to rudder
-
- enqueue.call(this, rudderElement, type);
- logger.debug("".concat(type, " is called "));
-
- if (callback) {
- callback();
- }
- } catch (error) {
- handleError(error);
- }
- }
- /**
- * process options parameter
- *
- * @param {*} rudderElement
- * @param {*} options
- * @memberof Analytics
- */
-
- }, {
- key: "processOptionsParam",
- value: function processOptionsParam(rudderElement, options) {
- var toplevelElements = ["integrations", "anonymousId", "originalTimestamp"];
-
- for (var key in options) {
- if (toplevelElements.includes(key)) {
- rudderElement.message[key] = options[key]; // special handle for ananymousId as transformation expects anonymousId in traits.
-
- /* if (key === "anonymousId") {
- rudderElement.message.context.traits["anonymousId"] = options[key];
- } */
- } else if (key !== "context") rudderElement.message.context[key] = options[key];else {
- for (var k in options[key]) {
- rudderElement.message.context[k] = options[key][k];
- }
- }
- }
- }
- }, {
- key: "getPageProperties",
- value: function getPageProperties(properties) {
- var defaultPageProperties = getDefaultPageProperties();
-
- for (var key in defaultPageProperties) {
- if (properties[key] === undefined) {
- properties[key] = defaultPageProperties[key];
- }
- }
-
- return properties;
- }
- /**
- * Clear user information
- *
- * @memberof Analytics
- */
-
- }, {
- key: "reset",
- value: function reset() {
- this.userId = "";
- this.userTraits = {};
- this.storage.clear();
- }
- }, {
- key: "getAnonymousId",
- value: function getAnonymousId() {
- this.anonymousId = this.storage.getAnonymousId();
-
- if (!this.anonymousId) {
- this.setAnonymousId();
- }
-
- return this.anonymousId;
- }
- }, {
- key: "setAnonymousId",
- value: function setAnonymousId(anonymousId) {
- this.anonymousId = anonymousId || generateUUID();
- this.storage.setAnonymousId(this.anonymousId);
- }
- /**
- * Call control pane to get client configs
- *
- * @param {*} writeKey
- * @memberof Analytics
- */
-
- }, {
- key: "load",
- value: function load(writeKey, serverUrl, options) {
- var _this3 = this;
-
- logger.debug("inside load ");
- var configUrl = CONFIG_URL;
-
- if (!writeKey || !serverUrl || serverUrl.length == 0) {
- handleError({
- message: "[Analytics] load:: Unable to load due to wrong writeKey or serverUrl"
- });
- throw Error("failed to initialize");
- }
-
- if (options && options.logLevel) {
- logger.setLogLevel(options.logLevel);
- }
-
- if (options && options.integrations) {
- Object.assign(this.loadOnlyIntegrations, options.integrations);
- tranformToRudderNames(this.loadOnlyIntegrations);
- }
-
- if (options && options.configUrl) {
- configUrl = options.configUrl;
- }
-
- if (options && options.sendAdblockPage) {
- this.sendAdblockPage = true;
- }
-
- if (options && options.sendAdblockPageOptions) {
- if (_typeof(options.sendAdblockPageOptions) === "object") {
- this.sendAdblockPageOptions = options.sendAdblockPageOptions;
- }
- }
-
- if (options && options.clientSuppliedCallbacks) {
- // convert to rudder recognised method names
- var tranformedCallbackMapping = {};
- Object.keys(this.methodToCallbackMapping).forEach(function (methodName) {
- if (_this3.methodToCallbackMapping.hasOwnProperty(methodName)) {
- if (options.clientSuppliedCallbacks[_this3.methodToCallbackMapping[methodName]]) {
- tranformedCallbackMapping[methodName] = options.clientSuppliedCallbacks[_this3.methodToCallbackMapping[methodName]];
- }
- }
- });
- Object.assign(this.clientSuppliedCallbacks, tranformedCallbackMapping);
- this.registerCallbacks(true);
- }
-
- this.eventRepository.writeKey = writeKey;
-
- if (serverUrl) {
- this.eventRepository.url = serverUrl;
- }
-
- if (options && options.valTrackingList && options.valTrackingList.push == Array.prototype.push) {
- this.trackValues = options.valTrackingList;
- }
-
- if (options && options.useAutoTracking) {
- this.autoTrackFeatureEnabled = true;
-
- if (this.autoTrackFeatureEnabled && !this.autoTrackHandlersRegistered) {
- addDomEventHandlers(this);
- this.autoTrackHandlersRegistered = true;
- logger.debug("autoTrackHandlersRegistered", this.autoTrackHandlersRegistered);
- }
- }
-
- try {
- getJSONTrimmed(this, configUrl, writeKey, this.processResponse);
- } catch (error) {
- handleError(error);
-
- if (this.autoTrackFeatureEnabled && !this.autoTrackHandlersRegistered) {
- addDomEventHandlers(instance);
- }
- }
- }
- }, {
- key: "ready",
- value: function ready(callback) {
- if (typeof callback === "function") {
- this.readyCallback = callback;
- return;
- }
-
- logger.error("ready callback is not a function");
- }
- }, {
- key: "initializeCallbacks",
- value: function initializeCallbacks() {
- var _this4 = this;
-
- Object.keys(this.methodToCallbackMapping).forEach(function (methodName) {
- if (_this4.methodToCallbackMapping.hasOwnProperty(methodName)) {
- _this4.on(methodName, function () {});
- }
- });
- }
- }, {
- key: "registerCallbacks",
- value: function registerCallbacks(calledFromLoad) {
- var _this5 = this;
-
- if (!calledFromLoad) {
- Object.keys(this.methodToCallbackMapping).forEach(function (methodName) {
- if (_this5.methodToCallbackMapping.hasOwnProperty(methodName)) {
- if (window.rudderanalytics) {
- if (typeof window.rudderanalytics[_this5.methodToCallbackMapping[methodName]] === "function") {
- _this5.clientSuppliedCallbacks[methodName] = window.rudderanalytics[_this5.methodToCallbackMapping[methodName]];
- }
- } // let callback =
- // ? typeof window.rudderanalytics[
- // this.methodToCallbackMapping[methodName]
- // ] == "function"
- // ? window.rudderanalytics[this.methodToCallbackMapping[methodName]]
- // : () => {}
- // : () => {};
- // logger.debug("registerCallbacks", methodName, callback);
- // this.on(methodName, callback);
-
- }
- });
- }
-
- Object.keys(this.clientSuppliedCallbacks).forEach(function (methodName) {
- if (_this5.clientSuppliedCallbacks.hasOwnProperty(methodName)) {
- logger.debug("registerCallbacks", methodName, _this5.clientSuppliedCallbacks[methodName]);
-
- _this5.on(methodName, _this5.clientSuppliedCallbacks[methodName]);
- }
- });
- }
- }, {
- key: "sendSampleRequest",
- value: function sendSampleRequest() {
- ScriptLoader("ad-block", "//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js");
- }
- }]);
-
- return Analytics;
- }();
-
- var instance = new Analytics();
- componentEmitter(instance);
- window.addEventListener("error", function (e) {
- handleError(e, instance);
- }, true); // if (true) {
- // test for adblocker
- // instance.sendSampleRequest()
- // initialize supported callbacks
-
- instance.initializeCallbacks(); // register supported callbacks
-
- instance.registerCallbacks(false);
- var eventsPushedAlready = !!window.rudderanalytics && window.rudderanalytics.push == Array.prototype.push;
- var methodArg = window.rudderanalytics ? window.rudderanalytics[0] : [];
-
- if (methodArg.length > 0 && methodArg[0] == "load") {
- var method = methodArg[0];
- methodArg.shift();
- logger.debug("=====from init, calling method:: ", method);
- instance[method].apply(instance, _toConsumableArray(methodArg));
- }
-
- if (eventsPushedAlready) {
- for (var i$1 = 1; i$1 < window.rudderanalytics.length; i$1++) {
- instance.toBeProcessedArray.push(window.rudderanalytics[i$1]);
- }
-
- for (var _i = 0; _i < instance.toBeProcessedArray.length; _i++) {
- var event = _toConsumableArray(instance.toBeProcessedArray[_i]);
-
- var _method = event[0];
- event.shift();
- logger.debug("=====from init, calling method:: ", _method);
-
- instance[_method].apply(instance, _toConsumableArray(event));
- }
-
- instance.toBeProcessedArray = [];
- } // }
-
-
- var ready = instance.ready.bind(instance);
- var identify = instance.identify.bind(instance);
- var page = instance.page.bind(instance);
- var track = instance.track.bind(instance);
- var alias = instance.alias.bind(instance);
- var group = instance.group.bind(instance);
- var reset = instance.reset.bind(instance);
- var load = instance.load.bind(instance);
- var initialized = instance.initialized = true;
- var getAnonymousId = instance.getAnonymousId.bind(instance);
- var setAnonymousId = instance.setAnonymousId.bind(instance);
-
- exports.alias = alias;
- exports.getAnonymousId = getAnonymousId;
- exports.group = group;
- exports.identify = identify;
- exports.initialized = initialized;
- exports.load = load;
- exports.page = page;
- exports.ready = ready;
- exports.reset = reset;
- exports.setAnonymousId = setAnonymousId;
- exports.track = track;
-
- return exports;
-
-}({}));
\ No newline at end of file
diff --git a/dist/rudder-analytics-map.min.js b/dist/rudder-analytics-map.min.js
deleted file mode 100644
index 4e42f0dd5f..0000000000
--- a/dist/rudder-analytics-map.min.js
+++ /dev/null
@@ -1,7070 +0,0 @@
-const rudderanalytics = (function (e) {
- function t(e) {
- return (t =
- typeof Symbol === "function" && typeof Symbol.iterator === "symbol"
- ? function (e) {
- return typeof e;
- }
- : function (e) {
- return e &&
- typeof Symbol === "function" &&
- e.constructor === Symbol &&
- e !== Symbol.prototype
- ? "symbol"
- : typeof e;
- })(e);
- }
- function n(e, t) {
- if (!(e instanceof t))
- throw new TypeError("Cannot call a class as a function");
- }
- function r(e, t) {
- for (let n = 0; n < t.length; n++) {
- const r = t[n];
- (r.enumerable = r.enumerable || !1),
- (r.configurable = !0),
- "value" in r && (r.writable = !0),
- Object.defineProperty(e, r.key, r);
- }
- }
- function i(e, t, n) {
- return t && r(e.prototype, t), n && r(e, n), e;
- }
- function o(e, t, n) {
- return (
- t in e
- ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0,
- })
- : (e[t] = n),
- e
- );
- }
- function s(e, t) {
- const n = Object.keys(e);
- if (Object.getOwnPropertySymbols) {
- let r = Object.getOwnPropertySymbols(e);
- t &&
- (r = r.filter(function (t) {
- return Object.getOwnPropertyDescriptor(e, t).enumerable;
- })),
- n.push.apply(n, r);
- }
- return n;
- }
- function a(e) {
- for (let t = 1; t < arguments.length; t++) {
- var n = arguments[t] != null ? arguments[t] : {};
- t % 2
- ? s(Object(n), !0).forEach(function (t) {
- o(e, t, n[t]);
- })
- : Object.getOwnPropertyDescriptors
- ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n))
- : s(Object(n)).forEach(function (t) {
- Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
- });
- }
- return e;
- }
- function u(e) {
- return (
- (function (e) {
- if (Array.isArray(e)) return c(e);
- })(e) ||
- (function (e) {
- if (typeof Symbol !== "undefined" && Symbol.iterator in Object(e))
- return Array.from(e);
- })(e) ||
- (function (e, t) {
- if (!e) return;
- if (typeof e === "string") return c(e, t);
- let n = Object.prototype.toString.call(e).slice(8, -1);
- n === "Object" && e.constructor && (n = e.constructor.name);
- if (n === "Map" || n === "Set") return Array.from(n);
- if (
- n === "Arguments" ||
- /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)
- )
- return c(e, t);
- })(e) ||
- (function () {
- throw new TypeError(
- "Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."
- );
- })()
- );
- }
- function c(e, t) {
- (t == null || t > e.length) && (t = e.length);
- for (var n = 0, r = new Array(t); n < t; n++) r[n] = e[n];
- return r;
- }
- let l = 4;
- const d = function (e) {
- switch (e.toUpperCase()) {
- case "INFO":
- return void (l = 1);
- case "DEBUG":
- return void (l = 2);
- case "WARN":
- return void (l = 3);
- }
- };
- const p = function () {
- let e;
- l <= 2 && (e = console).debug.apply(e, arguments);
- };
- const f = function () {
- let e;
- l <= 4 && (e = console).error.apply(e, arguments);
- };
- const h = {
- All: "All",
- "Google Analytics": "GA",
- GoogleAnalytics: "GA",
- GA: "GA",
- "Google Ads": "GOOGLEADS",
- GoogleAds: "GOOGLEADS",
- GOOGLEADS: "GOOGLEADS",
- Braze: "BRAZE",
- BRAZE: "BRAZE",
- Chartbeat: "CHARTBEAT",
- CHARTBEAT: "CHARTBEAT",
- Comscore: "COMSCORE",
- COMSCORE: "COMSCORE",
- Customerio: "CUSTOMERIO",
- "Customer.io": "CUSTOMERIO",
- "FB Pixel": "FACEBOOK_PIXEL",
- "Facebook Pixel": "FACEBOOK_PIXEL",
- FB_PIXEL: "FACEBOOK_PIXEL",
- "Google Tag Manager": "GOOGLETAGMANAGER",
- GTM: "GTM",
- Hotjar: "HOTJAR",
- hotjar: "HOTJAR",
- HOTJAR: "HOTJAR",
- Hubspot: "HS",
- HUBSPOT: "HS",
- Intercom: "INTERCOM",
- INTERCOM: "INTERCOM",
- Keen: "KEEN",
- "Keen.io": "KEEN",
- KEEN: "KEEN",
- Kissmetrics: "KISSMETRICS",
- KISSMETRICS: "KISSMETRICS",
- Lotame: "LOTAME",
- LOTAME: "LOTAME",
- "Visual Website Optimizer": "VWO",
- VWO: "VWO",
- };
- const g = {
- All: "All",
- GA: "Google Analytics",
- GOOGLEADS: "Google Ads",
- BRAZE: "Braze",
- CHARTBEAT: "Chartbeat",
- COMSCORE: "Comscore",
- CUSTOMERIO: "Customer IO",
- FACEBOOK_PIXEL: "Facebook Pixel",
- GTM: "Google Tag Manager",
- HOTJAR: "Hotjar",
- HS: "HubSpot",
- INTERCOM: "Intercom",
- KEEN: "Keen",
- KISSMETRICS: "Kiss Metrics",
- LOTAME: "Lotame",
- VWO: "VWO",
- };
- function y(e, t) {
- return t == null ? void 0 : t;
- }
- function m() {
- let e = new Date().getTime();
- return (
- typeof performance !== "undefined" &&
- typeof performance.now === "function" &&
- (e += performance.now()),
- "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function (t) {
- const n = (e + 16 * Math.random()) % 16 | 0;
- return (
- (e = Math.floor(e / 16)), (t === "x" ? n : (3 & n) | 8).toString(16)
- );
- })
- );
- }
- function v() {
- return new Date().toISOString();
- }
- function b(e, t) {
- let n = e.message ? e.message : void 0;
- let r = void 0;
- try {
- e instanceof Event &&
- e.target &&
- e.target.localName == "script" &&
- ((n = `error in script loading:: src:: ${e.target.src} id:: ${e.target.id}`),
- t &&
- e.target.src.includes("adsbygoogle") &&
- ((r = !0),
- t.page(
- "RudderJS-Initiated",
- "ad-block page request",
- { path: "/ad-blocked", title: n },
- t.sendAdblockPageOptions
- ))),
- n && !r && f("[Util] handleError:: ", n);
- } catch (e) {
- f("[Util] handleError:: ", e);
- }
- }
- function w() {
- const e = k();
- const t = e ? e.pathname : window.location.pathname;
- const n = document.referrer;
- const r = window.location.search;
- return {
- path: t,
- referrer: n,
- search: r,
- title: document.title,
- url: (function (e) {
- const t = k();
- const n = t ? (t.indexOf("?") > -1 ? t : t + e) : window.location.href;
- const r = n.indexOf("#");
- return r > -1 ? n.slice(0, r) : n;
- })(r),
- };
- }
- function k() {
- for (
- var e, t = document.getElementsByTagName("link"), n = 0;
- (e = t[n]);
- n++
- )
- if (e.getAttribute("rel") === "canonical") return e.getAttribute("href");
- }
- function I(e, t) {
- let n = e.revenue;
- return (
- !n &&
- t &&
- t.match(
- /^[ _]?completed[ _]?order[ _]?|^[ _]?order[ _]?completed[ _]?$/i
- ) &&
- (n = e.total),
- (function (e) {
- if (e) {
- if (typeof e === "number") return e;
- if (typeof e === "string")
- return (
- (e = e.replace(/\$/g, "")),
- (e = parseFloat(e)),
- isNaN(e) ? void 0 : e
- );
- }
- })(n)
- );
- }
- function _(e) {
- Object.keys(e).forEach(function (t) {
- e.hasOwnProperty(t) &&
- (h[t] && (e[h[t]] = e[t]),
- t != "All" && h[t] != null && h[t] != t && delete e[t]);
- });
- }
- function E(e, n) {
- const r = [];
- if (!n || n.length == 0) return r;
- let i = !0;
- return typeof n[0] === "string"
- ? (e.All != null && (i = e.All),
- n.forEach(function (t) {
- if (i) {
- let n = !0;
- e[t] != null && e[t] == 0 && (n = !1), n && r.push(t);
- } else e[t] != null && e[t] == 1 && r.push(t);
- }),
- r)
- : t(n[0]) == "object"
- ? (e.All != null && (i = e.All),
- n.forEach(function (t) {
- if (i) {
- let n = !0;
- e[t.name] != null && e[t.name] == 0 && (n = !1), n && r.push(t);
- } else e[t.name] != null && e[t.name] == 1 && r.push(t);
- }),
- r)
- : void 0;
- }
- const A = { TRACK: "track", PAGE: "page", IDENTIFY: "identify" };
- const C = {
- PRODUCTS_SEARCHED: "Products Searched",
- PRODUCT_LIST_VIEWED: "Product List Viewed",
- PRODUCT_LIST_FILTERED: "Product List Filtered",
- PROMOTION_VIEWED: "Promotion Viewed",
- PROMOTION_CLICKED: "Promotion Clicked",
- PRODUCT_CLICKED: "Product Clicked",
- PRODUCT_VIEWED: "Product Viewed",
- PRODUCT_ADDED: "Product Added",
- PRODUCT_REMOVED: "Product Removed",
- CART_VIEWED: "Cart Viewed",
- CHECKOUT_STARTED: "Checkout Started",
- CHECKOUT_STEP_VIEWED: "Checkout Step Viewed",
- CHECKOUT_STEP_COMPLETED: "Checkout Step Completed",
- PAYMENT_INFO_ENTERED: "Payment Info Entered",
- ORDER_UPDATED: "Order Updated",
- ORDER_COMPLETED: "Order Completed",
- ORDER_REFUNDED: "Order Refunded",
- ORDER_CANCELLED: "Order Cancelled",
- COUPON_ENTERED: "Coupon Entered",
- COUPON_APPLIED: "Coupon Applied",
- COUPON_DENIED: "Coupon Denied",
- COUPON_REMOVED: "Coupon Removed",
- PRODUCT_ADDED_TO_WISHLIST: "Product Added to Wishlist",
- PRODUCT_REMOVED_FROM_WISHLIST: "Product Removed from Wishlist",
- WISH_LIST_PRODUCT_ADDED_TO_CART: "Wishlist Product Added to Cart",
- PRODUCT_SHARED: "Product Shared",
- CART_SHARED: "Cart Shared",
- PRODUCT_REVIEWED: "Product Reviewed",
- };
- function T(e, t) {
- p(`in script loader=== ${e}`);
- const n = document.createElement("script");
- (n.src = t), (n.async = !0), (n.type = "text/javascript"), (n.id = e);
- const r = document.getElementsByTagName("script")[0];
- p("==script==", r), r.parentNode.insertBefore(n, r);
- }
- const O = (function () {
- function e(t) {
- n(this, e), (this.hubId = t.hubID), (this.name = "HS");
- }
- return (
- i(e, [
- {
- key: "init",
- value() {
- T(
- "hubspot-integration",
- `http://js.hs-scripts.com/${this.hubId}.js`
- ),
- p("===in init HS===");
- },
- },
- {
- key: "identify",
- value(e) {
- p("in HubspotAnalyticsManager identify");
- const n = e.message.context.traits;
- const r = {};
- for (const i in n)
- if (Object.getOwnPropertyDescriptor(n, i) && n[i]) {
- const o = i;
- toString.call(n[i]) == "[object Date]"
- ? (r[o] = n[i].getTime())
- : (r[o] = n[i]);
- }
- const s = e.message.context.user_properties;
- for (const a in s) {
- if (Object.getOwnPropertyDescriptor(s, a) && s[a]) r[a] = s[a];
- }
- (p(r),
- void 0 !==
- (typeof window === "undefined" ? "undefined" : t(window))) &&
- (window._hsq = window._hsq || []).push(["identify", r]);
- },
- },
- {
- key: "track",
- value(e) {
- p("in HubspotAnalyticsManager track");
- const t = (window._hsq = window._hsq || []);
- const n = {};
- (n.id = e.message.event),
- e.message.properties &&
- (e.message.properties.revenue || e.message.properties.value) &&
- (n.value =
- e.message.properties.revenue || e.message.properties.value),
- t.push(["trackEvent", n]);
- },
- },
- {
- key: "page",
- value(e) {
- p("in HubspotAnalyticsManager page");
- const t = (window._hsq = window._hsq || []);
- e.message.properties &&
- e.message.properties.path &&
- t.push(["setPath", e.message.properties.path]),
- t.push(["trackPageView"]);
- },
- },
- {
- key: "isLoaded",
- value() {
- return (
- p("in hubspot isLoaded"),
- !(!window._hsq || window._hsq.push === Array.prototype.push)
- );
- },
- },
- {
- key: "isReady",
- value() {
- return !(!window._hsq || window._hsq.push === Array.prototype.push);
- },
- },
- ]),
- e
- );
- })();
- const S = Object.prototype.toString;
- const P = function e(t) {
- const n = (function (e) {
- switch (S.call(e)) {
- case "[object Date]":
- return "date";
- case "[object RegExp]":
- return "regexp";
- case "[object Arguments]":
- return "arguments";
- case "[object Array]":
- return "array";
- case "[object Error]":
- return "error";
- }
- return e === null
- ? "null"
- : void 0 === e
- ? "undefined"
- : e != e
- ? "nan"
- : e && e.nodeType === 1
- ? "element"
- : (t = e) != null &&
- (t._isBuffer ||
- (t.constructor &&
- typeof t.constructor.isBuffer === "function" &&
- t.constructor.isBuffer(t)))
- ? "buffer"
- : typeof (e = e.valueOf
- ? e.valueOf()
- : Object.prototype.valueOf.apply(e));
- let t;
- })(t);
- if (n === "object") {
- var r = {};
- for (const i in t) t.hasOwnProperty(i) && (r[i] = e(t[i]));
- return r;
- }
- if (n === "array") {
- r = new Array(t.length);
- for (let o = 0, s = t.length; o < s; o++) r[o] = e(t[o]);
- return r;
- }
- if (n === "regexp") {
- let a = "";
- return (
- (a += t.multiline ? "m" : ""),
- (a += t.global ? "g" : ""),
- (a += t.ignoreCase ? "i" : ""),
- new RegExp(t.source, a)
- );
- }
- return n === "date" ? new Date(t.getTime()) : t;
- };
- const x =
- typeof globalThis !== "undefined"
- ? globalThis
- : typeof window !== "undefined"
- ? window
- : typeof global !== "undefined"
- ? global
- : typeof self !== "undefined"
- ? self
- : {};
- function R(e, t) {
- return e((t = { exports: {} }), t.exports), t.exports;
- }
- const j = 1e3;
- const D = 6e4;
- const U = 60 * D;
- const L = 24 * U;
- const M = function (e, t) {
- return (
- (t = t || {}),
- typeof e === "string"
- ? (function (e) {
- if ((e = `${e}`).length > 1e4) return;
- const t = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(
- e
- );
- if (!t) return;
- const n = parseFloat(t[1]);
- switch ((t[2] || "ms").toLowerCase()) {
- case "years":
- case "year":
- case "yrs":
- case "yr":
- case "y":
- return 315576e5 * n;
- case "days":
- case "day":
- case "d":
- return n * L;
- case "hours":
- case "hour":
- case "hrs":
- case "hr":
- case "h":
- return n * U;
- case "minutes":
- case "minute":
- case "mins":
- case "min":
- case "m":
- return n * D;
- case "seconds":
- case "second":
- case "secs":
- case "sec":
- case "s":
- return n * j;
- case "milliseconds":
- case "millisecond":
- case "msecs":
- case "msec":
- case "ms":
- return n;
- }
- })(e)
- : t.long
- ? (function (e) {
- return (
- N(e, L, "day") ||
- N(e, U, "hour") ||
- N(e, D, "minute") ||
- N(e, j, "second") ||
- `${e} ms`
- );
- })(e)
- : (function (e) {
- return e >= L
- ? `${Math.round(e / L)}d`
- : e >= U
- ? `${Math.round(e / U)}h`
- : e >= D
- ? `${Math.round(e / D)}m`
- : e >= j
- ? `${Math.round(e / j)}s`
- : `${e}ms`;
- })(e)
- );
- };
- function N(e, t, n) {
- if (!(e < t))
- return e < 1.5 * t
- ? `${Math.floor(e / t)} ${n}`
- : `${Math.ceil(e / t)} ${n}s`;
- }
- const B = R(function (e, t) {
- ((t = e.exports = function (e) {
- function r() {}
- function o() {
- const e = o;
- const r = +new Date();
- const s = r - (n || r);
- (e.diff = s),
- (e.prev = n),
- (e.curr = r),
- (n = r),
- e.useColors == null && (e.useColors = t.useColors()),
- e.color == null && e.useColors && (e.color = i());
- let a = Array.prototype.slice.call(arguments);
- (a[0] = t.coerce(a[0])),
- typeof a[0] !== "string" && (a = ["%o"].concat(a));
- let u = 0;
- (a[0] = a[0].replace(/%([a-z%])/g, function (n, r) {
- if (n === "%%") return n;
- u++;
- const i = t.formatters[r];
- if (typeof i === "function") {
- const o = a[u];
- (n = i.call(e, o)), a.splice(u, 1), u--;
- }
- return n;
- })),
- typeof t.formatArgs === "function" && (a = t.formatArgs.apply(e, a));
- const c = o.log || t.log || console.log.bind(console);
- c.apply(e, a);
- }
- (r.enabled = !1), (o.enabled = !0);
- const s = t.enabled(e) ? o : r;
- return (s.namespace = e), s;
- }).coerce = function (e) {
- return e instanceof Error ? e.stack || e.message : e;
- }),
- (t.disable = function () {
- t.enable("");
- }),
- (t.enable = function (e) {
- t.save(e);
- for (let n = (e || "").split(/[\s,]+/), r = n.length, i = 0; i < r; i++)
- n[i] &&
- ((e = n[i].replace(/\*/g, ".*?"))[0] === "-"
- ? t.skips.push(new RegExp(`^${e.substr(1)}$`))
- : t.names.push(new RegExp(`^${e}$`)));
- }),
- (t.enabled = function (e) {
- let n;
- let r;
- for (n = 0, r = t.skips.length; n < r; n++)
- if (t.skips[n].test(e)) return !1;
- for (n = 0, r = t.names.length; n < r; n++)
- if (t.names[n].test(e)) return !0;
- return !1;
- }),
- (t.humanize = M),
- (t.names = []),
- (t.skips = []),
- (t.formatters = {});
- let n;
- let r = 0;
- function i() {
- return t.colors[r++ % t.colors.length];
- }
- });
- const q =
- (B.coerce,
- B.disable,
- B.enable,
- B.enabled,
- B.humanize,
- B.names,
- B.skips,
- B.formatters,
- R(function (e, t) {
- function n() {
- let e;
- try {
- e = t.storage.debug;
- } catch (e) {}
- return e;
- }
- ((t = e.exports = B).log = function () {
- return (
- typeof console === "object" &&
- console.log &&
- Function.prototype.apply.call(console.log, console, arguments)
- );
- }),
- (t.formatArgs = function () {
- let e = arguments;
- const n = this.useColors;
- if (
- ((e[0] = `${
- (n ? "%c" : "") +
- this.namespace +
- (n ? " %c" : " ") +
- e[0] +
- (n ? "%c " : " ")
- }+${t.humanize(this.diff)}`),
- !n)
- )
- return e;
- const r = `color: ${this.color}`;
- e = [e[0], r, "color: inherit"].concat(
- Array.prototype.slice.call(e, 1)
- );
- let i = 0;
- let o = 0;
- return (
- e[0].replace(/%[a-z%]/g, function (e) {
- e !== "%%" && (i++, e === "%c" && (o = i));
- }),
- e.splice(o, 0, r),
- e
- );
- }),
- (t.save = function (e) {
- try {
- e == null ? t.storage.removeItem("debug") : (t.storage.debug = e);
- } catch (e) {}
- }),
- (t.load = n),
- (t.useColors = function () {
- return (
- "WebkitAppearance" in document.documentElement.style ||
- (window.console &&
- (console.firebug || (console.exception && console.table))) ||
- (navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) &&
- parseInt(RegExp.$1, 10) >= 31)
- );
- }),
- (t.storage =
- typeof chrome !== "undefined" && void 0 !== chrome.storage
- ? chrome.storage.local
- : (function () {
- try {
- return window.localStorage;
- } catch (e) {}
- })()),
- (t.colors = [
- "lightseagreen",
- "forestgreen",
- "goldenrod",
- "dodgerblue",
- "darkorchid",
- "crimson",
- ]),
- (t.formatters.j = function (e) {
- return JSON.stringify(e);
- }),
- t.enable(n());
- }));
- const F =
- (q.log,
- q.formatArgs,
- q.save,
- q.load,
- q.useColors,
- q.storage,
- q.colors,
- q("cookie"));
- const K = function (e, t, n) {
- switch (arguments.length) {
- case 3:
- case 2:
- return G(e, t, n);
- case 1:
- return V(e);
- default:
- return H();
- }
- };
- function G(e, t, n) {
- n = n || {};
- let r = `${z(e)}=${z(t)}`;
- t == null && (n.maxage = -1),
- n.maxage && (n.expires = new Date(+new Date() + n.maxage)),
- n.path && (r += `; path=${n.path}`),
- n.domain && (r += `; domain=${n.domain}`),
- n.expires && (r += `; expires=${n.expires.toUTCString()}`),
- n.samesite && (r += `; samesite=${n.samesite}`),
- n.secure && (r += "; secure"),
- (document.cookie = r);
- }
- function H() {
- let e;
- try {
- e = document.cookie;
- } catch (e) {
- return (
- typeof console !== "undefined" &&
- typeof console.error === "function" &&
- console.error(e.stack || e),
- {}
- );
- }
- return (function (e) {
- let t;
- const n = {};
- const r = e.split(/ *; */);
- if (r[0] == "") return n;
- for (let i = 0; i < r.length; ++i)
- (t = r[i].split("=")), (n[J(t[0])] = J(t[1]));
- return n;
- })(e);
- }
- function V(e) {
- return H()[e];
- }
- function z(e) {
- try {
- return encodeURIComponent(e);
- } catch (t) {
- F("error `encode(%o)` - %o", e, t);
- }
- }
- function J(e) {
- try {
- return decodeURIComponent(e);
- } catch (t) {
- F("error `decode(%o)` - %o", e, t);
- }
- }
- const W = Math.max;
- const $ = function (e, t) {
- const n = t ? t.length : 0;
- if (!n) return [];
- for (
- var r = W(Number(e) || 0, 0), i = W(n - r, 0), o = new Array(i), s = 0;
- s < i;
- s += 1
- )
- o[s] = t[s + r];
- return o;
- };
- const Y = Math.max;
- const Q = function (e) {
- if (e == null || !e.length) return [];
- for (var t = new Array(Y(e.length - 2, 0)), n = 1; n < e.length; n += 1)
- t[n - 1] = e[n];
- return t;
- };
- const Z = Object.prototype.hasOwnProperty;
- const X = Object.prototype.toString;
- const ee = function (e) {
- return Boolean(e) && typeof e === "object";
- };
- const te = function (e) {
- return Boolean(e) && X.call(e) === "[object Object]";
- };
- const ne = function (e, t, n, r) {
- return Z.call(t, r) && void 0 === e[r] && (e[r] = n), t;
- };
- const re = function (e, t, n, r) {
- return (
- Z.call(t, r) &&
- (te(e[r]) && te(n)
- ? (e[r] = oe(e[r], n))
- : void 0 === e[r] && (e[r] = n)),
- t
- );
- };
- const ie = function (e, t) {
- if (!ee(t)) return t;
- e = e || ne;
- for (let n = $(2, arguments), r = 0; r < n.length; r += 1)
- for (const i in n[r]) e(t, n[r], n[r][i], i);
- return t;
- };
- var oe = function (e) {
- return ie.apply(null, [re, e].concat(Q(arguments)));
- };
- const se = function (e) {
- return ie.apply(null, [null, e].concat(Q(arguments)));
- };
- const ae = oe;
- se.deep = ae;
- const ue = R(function (e, t) {
- (function () {
- const n = { function: !0, object: !0 };
- const r = n.object && t && !t.nodeType && t;
- let i = (n[typeof window] && window) || this;
- const o = r && n.object && e && !e.nodeType && typeof x === "object" && x;
- function s(e, t) {
- e || (e = i.Object()), t || (t = i.Object());
- const r = e.Number || i.Number;
- const o = e.String || i.String;
- const a = e.Object || i.Object;
- const u = e.Date || i.Date;
- const c = e.SyntaxError || i.SyntaxError;
- const l = e.TypeError || i.TypeError;
- const d = e.Math || i.Math;
- const p = e.JSON || i.JSON;
- typeof p === "object" &&
- p &&
- ((t.stringify = p.stringify), (t.parse = p.parse));
- const f = a.prototype;
- const h = f.toString;
- const g = f.hasOwnProperty;
- function y(e, t) {
- try {
- e();
- } catch (e) {
- t && t();
- }
- }
- let m = new u(-0xc782b5b800cec);
- function v(e) {
- if (v[e] != null) return v[e];
- let n;
- if (e == "bug-string-char-index") n = "a"[0] != "a";
- else if (e == "json")
- n =
- v("json-stringify") && v("date-serialization") && v("json-parse");
- else if (e == "date-serialization") {
- if ((n = v("json-stringify") && m)) {
- var i = t.stringify;
- y(function () {
- n =
- i(new u(-864e13)) == '"-271821-04-20T00:00:00.000Z"' &&
- i(new u(864e13)) == '"+275760-09-13T00:00:00.000Z"' &&
- i(new u(-621987552e5)) == '"-000001-01-01T00:00:00.000Z"' &&
- i(new u(-1)) == '"1969-12-31T23:59:59.999Z"';
- });
- }
- } else {
- let s;
- const a = '{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}';
- if (e == "json-stringify") {
- let c = typeof (i = t.stringify) === "function";
- c &&
- (((s = function () {
- return 1;
- }).toJSON = s),
- y(
- function () {
- c =
- i(0) === "0" &&
- i(new r()) === "0" &&
- i(new o()) == '""' &&
- void 0 === i(h) &&
- void 0 === i(void 0) &&
- void 0 === i() &&
- i(s) === "1" &&
- i([s]) == "[1]" &&
- i([void 0]) == "[null]" &&
- i(null) == "null" &&
- i([void 0, h, null]) == "[null,null,null]" &&
- i({ a: [s, !0, !1, null, "\0\b\n\f\r\t"] }) == a &&
- i(null, s) === "1" &&
- i([1, 2], null, 1) == "[\n 1,\n 2\n]";
- },
- function () {
- c = !1;
- }
- )),
- (n = c);
- }
- if (e == "json-parse") {
- let l;
- const d = t.parse;
- typeof d === "function" &&
- y(
- function () {
- d("0") !== 0 ||
- d(!1) ||
- ((s = d(a)),
- (l = s.a.length == 5 && s.a[0] === 1) &&
- (y(function () {
- l = !d('"\t"');
- }),
- l &&
- y(function () {
- l = d("01") !== 1;
- }),
- l &&
- y(function () {
- l = d("1.") !== 1;
- })));
- },
- function () {
- l = !1;
- }
- ),
- (n = l);
- }
- }
- return (v[e] = !!n);
- }
- if (
- (y(function () {
- m =
- m.getUTCFullYear() == -109252 &&
- m.getUTCMonth() === 0 &&
- m.getUTCDate() === 1 &&
- m.getUTCHours() == 10 &&
- m.getUTCMinutes() == 37 &&
- m.getUTCSeconds() == 6 &&
- m.getUTCMilliseconds() == 708;
- }),
- (v["bug-string-char-index"] = v["date-serialization"] = v.json = v[
- "json-stringify"
- ] = v["json-parse"] = null),
- !v("json"))
- ) {
- const b = v("bug-string-char-index");
- var w = function (e, t) {
- let r;
- let i;
- let o;
- let s = 0;
- for (o in (((r = function () {
- this.valueOf = 0;
- }).prototype.valueOf = 0),
- (i = new r())))
- g.call(i, o) && s++;
- return (
- (r = i = null),
- s
- ? (w = function (e, t) {
- let n;
- let r;
- const i = h.call(e) == "[object Function]";
- for (n in e)
- (i && n == "prototype") ||
- !g.call(e, n) ||
- (r = n === "constructor") ||
- t(n);
- (r || g.call(e, (n = "constructor"))) && t(n);
- })
- : ((i = [
- "valueOf",
- "toString",
- "toLocaleString",
- "propertyIsEnumerable",
- "isPrototypeOf",
- "hasOwnProperty",
- "constructor",
- ]),
- (w = function (e, t) {
- let r;
- let o;
- const s = h.call(e) == "[object Function]";
- const a =
- (!s &&
- typeof e.constructor !== "function" &&
- n[typeof e.hasOwnProperty] &&
- e.hasOwnProperty) ||
- g;
- for (r in e)
- (s && r == "prototype") || !a.call(e, r) || t(r);
- for (o = i.length; (r = i[--o]); ) a.call(e, r) && t(r);
- })),
- w(e, t)
- );
- };
- if (!v("json-stringify") && !v("date-serialization")) {
- const k = {
- 92: "\\\\",
- 34: '\\"',
- 8: "\\b",
- 12: "\\f",
- 10: "\\n",
- 13: "\\r",
- 9: "\\t",
- };
- const I = function (e, t) {
- return `000000${t || 0}`.slice(-e);
- };
- var _ = function (e) {
- let t;
- let n;
- let r;
- let i;
- let o;
- let s;
- let a;
- let u;
- let c;
- if (m)
- t = function (e) {
- (n = e.getUTCFullYear()),
- (r = e.getUTCMonth()),
- (i = e.getUTCDate()),
- (s = e.getUTCHours()),
- (a = e.getUTCMinutes()),
- (u = e.getUTCSeconds()),
- (c = e.getUTCMilliseconds());
- };
- else {
- const l = d.floor;
- const p = [
- 0,
- 31,
- 59,
- 90,
- 120,
- 151,
- 181,
- 212,
- 243,
- 273,
- 304,
- 334,
- ];
- const f = function (e, t) {
- return (
- p[t] +
- 365 * (e - 1970) +
- l((e - 1969 + (t = +(t > 1))) / 4) -
- l((e - 1901 + t) / 100) +
- l((e - 1601 + t) / 400)
- );
- };
- t = function (e) {
- for (
- i = l(e / 864e5), n = l(i / 365.2425) + 1970 - 1;
- f(n + 1, 0) <= i;
- n++
- );
- for (r = l((i - f(n, 0)) / 30.42); f(n, r + 1) <= i; r++);
- (i = 1 + i - f(n, r)),
- (s = l((o = ((e % 864e5) + 864e5) % 864e5) / 36e5) % 24),
- (a = l(o / 6e4) % 60),
- (u = l(o / 1e3) % 60),
- (c = o % 1e3);
- };
- }
- return (_ = function (e) {
- return (
- e > -1 / 0 && e < 1 / 0
- ? (t(e),
- (e = `${
- n <= 0 || n >= 1e4
- ? (n < 0 ? "-" : "+") + I(6, n < 0 ? -n : n)
- : I(4, n)
- }-${I(2, r + 1)}-${I(2, i)}T${I(2, s)}:${I(2, a)}:${I(
- 2,
- u
- )}.${I(3, c)}Z`),
- (n = r = i = s = a = u = c = null))
- : (e = null),
- e
- );
- })(e);
- };
- if (v("json-stringify") && !v("date-serialization")) {
- function E(e) {
- return _(this);
- }
- const A = t.stringify;
- t.stringify = function (e, t, n) {
- const r = u.prototype.toJSON;
- u.prototype.toJSON = E;
- const i = A(e, t, n);
- return (u.prototype.toJSON = r), i;
- };
- } else {
- const C = function (e) {
- const t = e.charCodeAt(0);
- const n = k[t];
- return n || `\\u00${I(2, t.toString(16))}`;
- };
- const T = /[\x00-\x1f\x22\x5c]/g;
- const O = function (e) {
- return (
- (T.lastIndex = 0), `"${T.test(e) ? e.replace(T, C) : e}"`
- );
- };
- var S = function (e, t, n, r, i, o, s) {
- let a;
- let c;
- let d;
- let p;
- let f;
- let g;
- let m;
- let v;
- let b;
- if (
- (y(function () {
- a = t[e];
- }),
- typeof a === "object" &&
- a &&
- (a.getUTCFullYear &&
- h.call(a) == "[object Date]" &&
- a.toJSON === u.prototype.toJSON
- ? (a = _(a))
- : typeof a.toJSON === "function" && (a = a.toJSON(e))),
- n && (a = n.call(t, e, a)),
- a == null)
- )
- return void 0 === a ? a : "null";
- switch (
- ((c = typeof a) == "object" && (d = h.call(a)), d || c)
- ) {
- case "boolean":
- case "[object Boolean]":
- return `${a}`;
- case "number":
- case "[object Number]":
- return a > -1 / 0 && a < 1 / 0 ? `${a}` : "null";
- case "string":
- case "[object String]":
- return O(`${a}`);
- }
- if (typeof a === "object") {
- for (m = s.length; m--; ) if (s[m] === a) throw l();
- if (
- (s.push(a),
- (p = []),
- (v = o),
- (o += i),
- d == "[object Array]")
- ) {
- for (g = 0, m = a.length; g < m; g++)
- (f = S(g, a, n, r, i, o, s)),
- p.push(void 0 === f ? "null" : f);
- b = p.length
- ? i
- ? `[\n${o}${p.join(`,\n${o}`)}\n${v}]`
- : `[${p.join(",")}]`
- : "[]";
- } else
- w(r || a, function (e) {
- const t = S(e, a, n, r, i, o, s);
- void 0 !== t && p.push(`${O(e)}:${i ? " " : ""}${t}`);
- }),
- (b = p.length
- ? i
- ? `{\n${o}${p.join(`,\n${o}`)}\n${v}}`
- : `{${p.join(",")}}`
- : "{}");
- return s.pop(), b;
- }
- };
- t.stringify = function (e, t, r) {
- let i;
- let o;
- let s;
- let a;
- if (n[typeof t] && t)
- if ((a = h.call(t)) == "[object Function]") o = t;
- else if (a == "[object Array]") {
- s = {};
- for (var u, c = 0, l = t.length; c < l; )
- (u = t[c++]),
- ((a = h.call(u)) != "[object String]" &&
- a != "[object Number]") ||
- (s[u] = 1);
- }
- if (r)
- if ((a = h.call(r)) == "[object Number]") {
- if ((r -= r % 1) > 0)
- for (r > 10 && (r = 10), i = ""; i.length < r; ) i += " ";
- } else
- a == "[object String]" &&
- (i = r.length <= 10 ? r : r.slice(0, 10));
- return S("", (((u = {})[""] = e), u), o, s, i, "", []);
- };
- }
- }
- if (!v("json-parse")) {
- let P;
- let x;
- const R = o.fromCharCode;
- const j = {
- 92: "\\",
- 34: '"',
- 47: "/",
- 98: "\b",
- 116: "\t",
- 110: "\n",
- 102: "\f",
- 114: "\r",
- };
- const D = function () {
- throw ((P = x = null), c());
- };
- const U = function () {
- for (var e, t, n, r, i, o = x, s = o.length; P < s; )
- switch ((i = o.charCodeAt(P))) {
- case 9:
- case 10:
- case 13:
- case 32:
- P++;
- break;
- case 123:
- case 125:
- case 91:
- case 93:
- case 58:
- case 44:
- return (e = b ? o.charAt(P) : o[P]), P++, e;
- case 34:
- for (e = "@", P++; P < s; )
- if ((i = o.charCodeAt(P)) < 32) D();
- else if (i == 92)
- switch ((i = o.charCodeAt(++P))) {
- case 92:
- case 34:
- case 47:
- case 98:
- case 116:
- case 110:
- case 102:
- case 114:
- (e += j[i]), P++;
- break;
- case 117:
- for (t = ++P, n = P + 4; P < n; P++)
- ((i = o.charCodeAt(P)) >= 48 && i <= 57) ||
- (i >= 97 && i <= 102) ||
- (i >= 65 && i <= 70) ||
- D();
- e += R(`0x${o.slice(t, P)}`);
- break;
- default:
- D();
- }
- else {
- if (i == 34) break;
- for (
- i = o.charCodeAt(P), t = P;
- i >= 32 && i != 92 && i != 34;
-
- )
- i = o.charCodeAt(++P);
- e += o.slice(t, P);
- }
- if (o.charCodeAt(P) == 34) return P++, e;
- D();
- default:
- if (
- ((t = P),
- i == 45 && ((r = !0), (i = o.charCodeAt(++P))),
- i >= 48 && i <= 57)
- ) {
- for (
- i == 48 &&
- (i = o.charCodeAt(P + 1)) >= 48 &&
- i <= 57 &&
- D(),
- r = !1;
- P < s && (i = o.charCodeAt(P)) >= 48 && i <= 57;
- P++
- );
- if (o.charCodeAt(P) == 46) {
- for (
- n = ++P;
- n < s && !((i = o.charCodeAt(n)) < 48 || i > 57);
- n++
- );
- n == P && D(), (P = n);
- }
- if ((i = o.charCodeAt(P)) == 101 || i == 69) {
- for (
- ((i = o.charCodeAt(++P)) != 43 && i != 45) || P++,
- n = P;
- n < s && !((i = o.charCodeAt(n)) < 48 || i > 57);
- n++
- );
- n == P && D(), (P = n);
- }
- return +o.slice(t, P);
- }
- r && D();
- var a = o.slice(P, P + 4);
- if (a == "true") return (P += 4), !0;
- if (a == "fals" && o.charCodeAt(P + 4) == 101)
- return (P += 5), !1;
- if (a == "null") return (P += 4), null;
- D();
- }
- return "$";
- };
- var L = function (e) {
- let t;
- let n;
- if ((e == "$" && D(), typeof e === "string")) {
- if ((b ? e.charAt(0) : e[0]) == "@") return e.slice(1);
- if (e == "[") {
- for (t = []; (e = U()) != "]"; )
- n ? (e == "," ? (e = U()) == "]" && D() : D()) : (n = !0),
- e == "," && D(),
- t.push(L(e));
- return t;
- }
- if (e == "{") {
- for (t = {}; (e = U()) != "}"; )
- n ? (e == "," ? (e = U()) == "}" && D() : D()) : (n = !0),
- (e != "," &&
- typeof e === "string" &&
- (b ? e.charAt(0) : e[0]) == "@" &&
- U() == ":") ||
- D(),
- (t[e.slice(1)] = L(U()));
- return t;
- }
- D();
- }
- return e;
- };
- const M = function (e, t, n) {
- const r = N(e, t, n);
- void 0 === r ? delete e[t] : (e[t] = r);
- };
- var N = function (e, t, n) {
- let r;
- const i = e[t];
- if (typeof i === "object" && i)
- if (h.call(i) == "[object Array]")
- for (r = i.length; r--; ) M(h, w, i);
- else
- w(i, function (e) {
- M(i, e, n);
- });
- return n.call(e, t, i);
- };
- t.parse = function (e, t) {
- let n;
- let r;
- return (
- (P = 0),
- (x = `${e}`),
- (n = L(U())),
- U() != "$" && D(),
- (P = x = null),
- t && h.call(t) == "[object Function]"
- ? N((((r = {})[""] = n), r), "", t)
- : n
- );
- };
- }
- }
- return (t.runInContext = s), t;
- }
- if (
- (!o || (o.global !== o && o.window !== o && o.self !== o) || (i = o), r)
- )
- s(i, r);
- else {
- let a = i.JSON;
- let u = i.JSON3;
- let c = !1;
- var l = s(
- i,
- (i.JSON3 = {
- noConflict() {
- return (
- c || ((c = !0), (i.JSON = a), (i.JSON3 = u), (a = u = null)), l
- );
- },
- })
- );
- i.JSON = { parse: l.parse, stringify: l.stringify };
- }
- }.call(x));
- });
- const ce = R(function (e, t) {
- function n(e) {
- switch (e) {
- case "http:":
- return 80;
- case "https:":
- return 443;
- default:
- return location.port;
- }
- }
- (t.parse = function (e) {
- const t = document.createElement("a");
- return (
- (t.href = e),
- {
- href: t.href,
- host: t.host || location.host,
- port: t.port === "0" || t.port === "" ? n(t.protocol) : t.port,
- hash: t.hash,
- hostname: t.hostname || location.hostname,
- pathname: t.pathname.charAt(0) != "/" ? `/${t.pathname}` : t.pathname,
- protocol:
- t.protocol && t.protocol != ":" ? t.protocol : location.protocol,
- search: t.search,
- query: t.search.slice(1),
- }
- );
- }),
- (t.isAbsolute = function (e) {
- return e.indexOf("//") == 0 || !!~e.indexOf("://");
- }),
- (t.isRelative = function (e) {
- return !t.isAbsolute(e);
- }),
- (t.isCrossDomain = function (e) {
- e = t.parse(e);
- const n = t.parse(window.location.href);
- return (
- e.hostname !== n.hostname ||
- e.port !== n.port ||
- e.protocol !== n.protocol
- );
- });
- });
- const le =
- (ce.parse,
- ce.isAbsolute,
- ce.isRelative,
- ce.isCrossDomain,
- R(function (e, t) {
- ((t = e.exports = function (e) {
- function r() {}
- function o() {
- const e = o;
- const r = +new Date();
- const s = r - (n || r);
- (e.diff = s),
- (e.prev = n),
- (e.curr = r),
- (n = r),
- e.useColors == null && (e.useColors = t.useColors()),
- e.color == null && e.useColors && (e.color = i());
- let a = Array.prototype.slice.call(arguments);
- (a[0] = t.coerce(a[0])),
- typeof a[0] !== "string" && (a = ["%o"].concat(a));
- let u = 0;
- (a[0] = a[0].replace(/%([a-z%])/g, function (n, r) {
- if (n === "%%") return n;
- u++;
- const i = t.formatters[r];
- if (typeof i === "function") {
- const o = a[u];
- (n = i.call(e, o)), a.splice(u, 1), u--;
- }
- return n;
- })),
- typeof t.formatArgs === "function" &&
- (a = t.formatArgs.apply(e, a));
- const c = o.log || t.log || console.log.bind(console);
- c.apply(e, a);
- }
- (r.enabled = !1), (o.enabled = !0);
- const s = t.enabled(e) ? o : r;
- return (s.namespace = e), s;
- }).coerce = function (e) {
- return e instanceof Error ? e.stack || e.message : e;
- }),
- (t.disable = function () {
- t.enable("");
- }),
- (t.enable = function (e) {
- t.save(e);
- for (
- let n = (e || "").split(/[\s,]+/), r = n.length, i = 0;
- i < r;
- i++
- )
- n[i] &&
- ((e = n[i].replace(/\*/g, ".*?"))[0] === "-"
- ? t.skips.push(new RegExp(`^${e.substr(1)}$`))
- : t.names.push(new RegExp(`^${e}$`)));
- }),
- (t.enabled = function (e) {
- let n;
- let r;
- for (n = 0, r = t.skips.length; n < r; n++)
- if (t.skips[n].test(e)) return !1;
- for (n = 0, r = t.names.length; n < r; n++)
- if (t.names[n].test(e)) return !0;
- return !1;
- }),
- (t.humanize = M),
- (t.names = []),
- (t.skips = []),
- (t.formatters = {});
- let n;
- let r = 0;
- function i() {
- return t.colors[r++ % t.colors.length];
- }
- }));
- const de =
- (le.coerce,
- le.disable,
- le.enable,
- le.enabled,
- le.humanize,
- le.names,
- le.skips,
- le.formatters,
- R(function (e, t) {
- function n() {
- let e;
- try {
- e = t.storage.debug;
- } catch (e) {}
- return e;
- }
- ((t = e.exports = le).log = function () {
- return (
- typeof console === "object" &&
- console.log &&
- Function.prototype.apply.call(console.log, console, arguments)
- );
- }),
- (t.formatArgs = function () {
- let e = arguments;
- const n = this.useColors;
- if (
- ((e[0] = `${
- (n ? "%c" : "") +
- this.namespace +
- (n ? " %c" : " ") +
- e[0] +
- (n ? "%c " : " ")
- }+${t.humanize(this.diff)}`),
- !n)
- )
- return e;
- const r = `color: ${this.color}`;
- e = [e[0], r, "color: inherit"].concat(
- Array.prototype.slice.call(e, 1)
- );
- let i = 0;
- let o = 0;
- return (
- e[0].replace(/%[a-z%]/g, function (e) {
- e !== "%%" && (i++, e === "%c" && (o = i));
- }),
- e.splice(o, 0, r),
- e
- );
- }),
- (t.save = function (e) {
- try {
- e == null ? t.storage.removeItem("debug") : (t.storage.debug = e);
- } catch (e) {}
- }),
- (t.load = n),
- (t.useColors = function () {
- return (
- "WebkitAppearance" in document.documentElement.style ||
- (window.console &&
- (console.firebug || (console.exception && console.table))) ||
- (navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) &&
- parseInt(RegExp.$1, 10) >= 31)
- );
- }),
- (t.storage =
- typeof chrome !== "undefined" && void 0 !== chrome.storage
- ? chrome.storage.local
- : (function () {
- try {
- return window.localStorage;
- } catch (e) {}
- })()),
- (t.colors = [
- "lightseagreen",
- "forestgreen",
- "goldenrod",
- "dodgerblue",
- "darkorchid",
- "crimson",
- ]),
- (t.formatters.j = function (e) {
- return JSON.stringify(e);
- }),
- t.enable(n());
- }));
- const pe =
- (de.log,
- de.formatArgs,
- de.save,
- de.load,
- de.useColors,
- de.storage,
- de.colors,
- de("cookie"));
- const fe = function (e, t, n) {
- switch (arguments.length) {
- case 3:
- case 2:
- return he(e, t, n);
- case 1:
- return ye(e);
- default:
- return ge();
- }
- };
- function he(e, t, n) {
- n = n || {};
- let r = `${me(e)}=${me(t)}`;
- t == null && (n.maxage = -1),
- n.maxage && (n.expires = new Date(+new Date() + n.maxage)),
- n.path && (r += `; path=${n.path}`),
- n.domain && (r += `; domain=${n.domain}`),
- n.expires && (r += `; expires=${n.expires.toUTCString()}`),
- n.secure && (r += "; secure"),
- (document.cookie = r);
- }
- function ge() {
- let e;
- try {
- e = document.cookie;
- } catch (e) {
- return (
- typeof console !== "undefined" &&
- typeof console.error === "function" &&
- console.error(e.stack || e),
- {}
- );
- }
- return (function (e) {
- let t;
- const n = {};
- const r = e.split(/ *; */);
- if (r[0] == "") return n;
- for (let i = 0; i < r.length; ++i)
- (t = r[i].split("=")), (n[ve(t[0])] = ve(t[1]));
- return n;
- })(e);
- }
- function ye(e) {
- return ge()[e];
- }
- function me(e) {
- try {
- return encodeURIComponent(e);
- } catch (t) {
- pe("error `encode(%o)` - %o", e, t);
- }
- }
- function ve(e) {
- try {
- return decodeURIComponent(e);
- } catch (t) {
- pe("error `decode(%o)` - %o", e, t);
- }
- }
- const be = R(function (e, t) {
- const n = ce.parse;
- function r(e) {
- for (let n = t.cookie, r = t.levels(e), i = 0; i < r.length; ++i) {
- const o = r[i];
- const s = { domain: `.${o}` };
- if ((n("__tld__", 1, s), n("__tld__"))) return n("__tld__", null, s), o;
- }
- return "";
- }
- (r.levels = function (e) {
- const t = n(e).hostname.split(".");
- const r = t[t.length - 1];
- const i = [];
- if (t.length === 4 && r === parseInt(r, 10)) return i;
- if (t.length <= 1) return i;
- for (let o = t.length - 2; o >= 0; --o) i.push(t.slice(o).join("."));
- return i;
- }),
- (r.cookie = fe),
- (t = e.exports = r);
- });
- const we = new ((function () {
- function e(t) {
- n(this, e), (this._options = {}), this.options(t);
- }
- return (
- i(e, [
- {
- key: "options",
- value() {
- const e =
- arguments.length > 0 && void 0 !== arguments[0]
- ? arguments[0]
- : {};
- if (arguments.length === 0) return this._options;
- let t = `.${be(window.location.href)}`;
- t === "." && (t = null),
- (this._options = se(e, {
- maxage: 31536e6,
- path: "/",
- domain: t,
- samesite: "Lax",
- })),
- this.set("test_rudder", !0),
- this.get("test_rudder") || (this._options.domain = null),
- this.remove("test_rudder");
- },
- },
- {
- key: "set",
- value(e, t) {
- try {
- return (t = ue.stringify(t)), K(e, t, P(this._options)), !0;
- } catch (e) {
- return !1;
- }
- },
- },
- {
- key: "get",
- value(e) {
- let t;
- try {
- return (t = (t = K(e)) ? ue.parse(t) : null);
- } catch (e) {
- return t || null;
- }
- },
- },
- {
- key: "remove",
- value(e) {
- try {
- return K(e, null, P(this._options)), !0;
- } catch (e) {
- return !1;
- }
- },
- },
- ]),
- e
- );
- })())({});
- const ke = (function () {
- let e;
- const t = {};
- const n = typeof window !== "undefined" ? window : x;
- const r = n.document;
- if (
- ((t.disabled = !1),
- (t.version = "1.3.20"),
- (t.set = function (e, t) {}),
- (t.get = function (e, t) {}),
- (t.has = function (e) {
- return void 0 !== t.get(e);
- }),
- (t.remove = function (e) {}),
- (t.clear = function () {}),
- (t.transact = function (e, n, r) {
- r == null && ((r = n), (n = null)), n == null && (n = {});
- const i = t.get(e, n);
- r(i), t.set(e, i);
- }),
- (t.getAll = function () {
- const e = {};
- return (
- t.forEach(function (t, n) {
- e[t] = n;
- }),
- e
- );
- }),
- (t.forEach = function () {}),
- (t.serialize = function (e) {
- return ue.stringify(e);
- }),
- (t.deserialize = function (e) {
- if (typeof e === "string")
- try {
- return ue.parse(e);
- } catch (t) {
- return e || void 0;
- }
- }),
- (function () {
- try {
- return "localStorage" in n && n.localStorage;
- } catch (e) {
- return !1;
- }
- })())
- )
- (e = n.localStorage),
- (t.set = function (n, r) {
- return void 0 === r ? t.remove(n) : (e.setItem(n, t.serialize(r)), r);
- }),
- (t.get = function (n, r) {
- const i = t.deserialize(e.getItem(n));
- return void 0 === i ? r : i;
- }),
- (t.remove = function (t) {
- e.removeItem(t);
- }),
- (t.clear = function () {
- e.clear();
- }),
- (t.forEach = function (n) {
- for (let r = 0; r < e.length; r++) {
- const i = e.key(r);
- n(i, t.get(i));
- }
- });
- else if (r && r.documentElement.addBehavior) {
- let i;
- let o;
- try {
- (o = new ActiveXObject("htmlfile")).open(),
- o.write(
- ''
- ),
- o.close(),
- (i = o.w.frames[0].document),
- (e = i.createElement("div"));
- } catch (t) {
- (e = r.createElement("div")), (i = r.body);
- }
- const s = function (n) {
- return function () {
- const r = Array.prototype.slice.call(arguments, 0);
- r.unshift(e),
- i.appendChild(e),
- e.addBehavior("#default#userData"),
- e.load("localStorage");
- const o = n.apply(t, r);
- return i.removeChild(e), o;
- };
- };
- const a = new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]", "g");
- const u = function (e) {
- return e.replace(/^d/, "___$&").replace(a, "___");
- };
- (t.set = s(function (e, n, r) {
- return (
- (n = u(n)),
- void 0 === r
- ? t.remove(n)
- : (e.setAttribute(n, t.serialize(r)), e.save("localStorage"), r)
- );
- })),
- (t.get = s(function (e, n, r) {
- n = u(n);
- const i = t.deserialize(e.getAttribute(n));
- return void 0 === i ? r : i;
- })),
- (t.remove = s(function (e, t) {
- (t = u(t)), e.removeAttribute(t), e.save("localStorage");
- })),
- (t.clear = s(function (e) {
- const t = e.XMLDocument.documentElement.attributes;
- e.load("localStorage");
- for (let n = t.length - 1; n >= 0; n--) e.removeAttribute(t[n].name);
- e.save("localStorage");
- })),
- (t.forEach = s(function (e, n) {
- for (
- var r, i = e.XMLDocument.documentElement.attributes, o = 0;
- (r = i[o]);
- ++o
- )
- n(r.name, t.deserialize(e.getAttribute(r.name)));
- }));
- }
- try {
- const c = "__storejs__";
- t.set(c, c), t.get(c) != c && (t.disabled = !0), t.remove(c);
- } catch (e) {
- t.disabled = !0;
- }
- return (t.enabled = !t.disabled), t;
- })();
- const Ie = new ((function () {
- function e(t) {
- n(this, e), (this._options = {}), (this.enabled = !1), this.options(t);
- }
- return (
- i(e, [
- {
- key: "options",
- value() {
- const e =
- arguments.length > 0 && void 0 !== arguments[0]
- ? arguments[0]
- : {};
- if (arguments.length === 0) return this._options;
- se(e, { enabled: !0 }),
- (this.enabled = e.enabled && ke.enabled),
- (this._options = e);
- },
- },
- {
- key: "set",
- value(e, t) {
- return !!this.enabled && ke.set(e, t);
- },
- },
- {
- key: "get",
- value(e) {
- return this.enabled ? ke.get(e) : null;
- },
- },
- {
- key: "remove",
- value(e) {
- return !!this.enabled && ke.remove(e);
- },
- },
- ]),
- e
- );
- })())({});
- const _e = "rl_user_id";
- const Ee = "rl_trait";
- const Ae = "rl_anonymous_id";
- const Ce = "rl_group_id";
- const Te = "rl_group_trait";
- const Oe = new ((function () {
- function e() {
- if ((n(this, e), we.set("rudder_cookies", !0), we.get("rudder_cookies")))
- return we.remove("rudder_cookies"), void (this.storage = we);
- Ie.enabled && (this.storage = Ie);
- }
- return (
- i(e, [
- {
- key: "setItem",
- value(e, t) {
- this.storage.set(e, t);
- },
- },
- {
- key: "setUserId",
- value(e) {
- typeof e === "string"
- ? this.storage.set(_e, e)
- : f("[Storage] setUserId:: userId should be string");
- },
- },
- {
- key: "setUserTraits",
- value(e) {
- this.storage.set(Ee, e);
- },
- },
- {
- key: "setGroupId",
- value(e) {
- typeof e === "string"
- ? this.storage.set(Ce, e)
- : f("[Storage] setGroupId:: groupId should be string");
- },
- },
- {
- key: "setGroupTraits",
- value(e) {
- this.storage.set(Te, e);
- },
- },
- {
- key: "setAnonymousId",
- value(e) {
- typeof e === "string"
- ? this.storage.set(Ae, e)
- : f("[Storage] setAnonymousId:: anonymousId should be string");
- },
- },
- {
- key: "getItem",
- value(e) {
- return this.storage.get(e);
- },
- },
- {
- key: "getUserId",
- value() {
- return this.storage.get(_e);
- },
- },
- {
- key: "getUserTraits",
- value() {
- return this.storage.get(Ee);
- },
- },
- {
- key: "getGroupId",
- value() {
- return this.storage.get(Ce);
- },
- },
- {
- key: "getGroupTraits",
- value() {
- return this.storage.get(Te);
- },
- },
- {
- key: "getAnonymousId",
- value() {
- return this.storage.get(Ae);
- },
- },
- {
- key: "removeItem",
- value(e) {
- return this.storage.remove(e);
- },
- },
- {
- key: "clear",
- value() {
- this.storage.remove(_e), this.storage.remove(Ee);
- },
- },
- ]),
- e
- );
- })())();
- const Se = (function () {
- function e(t) {
- n(this, e),
- (this.trackingID = t.trackingID),
- (this.allowLinker = t.allowLinker || !1),
- (this.name = "GA");
- }
- return (
- i(e, [
- {
- key: "init",
- value() {
- !(function (e, t, n, r, i, o, s) {
- (e.GoogleAnalyticsObject = i),
- (e.ga =
- e.ga ||
- function () {
- (e.ga.q = e.ga.q || []).push(arguments);
- }),
- (e.ga.l = 1 * new Date()),
- (o = t.createElement(n)),
- (s = t.getElementsByTagName(n)[0]),
- (o.async = 1),
- (o.src = "https://www.google-analytics.com/analytics.js"),
- s.parentNode.insertBefore(o, s);
- })(window, document, "script", 0, "ga"),
- ga("create", this.trackingID, "auto", "rudder_ga", {
- allowLinker: this.allowLinker,
- });
- const e = Oe.getUserId();
- e && e !== "" && ga("rudder_ga.set", "userId", e),
- p("===in init GA===");
- },
- },
- {
- key: "identify",
- value(e) {
- const t =
- e.message.userId !== ""
- ? e.message.userId
- : e.message.anonymousId;
- ga("rudder_ga.set", "userId", t),
- p("in GoogleAnalyticsManager identify");
- },
- },
- {
- key: "track",
- value(e) {
- let t = e.message.event;
- const n = e.message.event;
- let r = e.message.event;
- let i = "";
- e.message.properties &&
- ((i = e.message.properties.value
- ? e.message.properties.value
- : e.message.properties.revenue),
- (t = e.message.properties.category
- ? e.message.properties.category
- : t),
- (r = e.message.properties.label
- ? e.message.properties.label
- : r)),
- ga("rudder_ga.send", "event", {
- hitType: "event",
- eventCategory: t,
- eventAction: n,
- eventLabel: r,
- eventValue: i,
- }),
- p("in GoogleAnalyticsManager track");
- },
- },
- {
- key: "page",
- value(e) {
- p("in GoogleAnalyticsManager page");
- const t =
- e.message.properties && e.message.properties.path
- ? e.message.properties.path
- : void 0;
- const n =
- e.message.properties && e.message.properties.title
- ? e.message.properties.title
- : void 0;
- const r =
- e.message.properties && e.message.properties.url
- ? e.message.properties.url
- : void 0;
- t && ga("rudder_ga.set", "page", t),
- n && ga("rudder_ga.set", "title", n),
- r && ga("rudder_ga.set", "location", r),
- ga("rudder_ga.send", "pageview");
- },
- },
- {
- key: "isLoaded",
- value() {
- return p("in GA isLoaded"), !!window.gaplugins;
- },
- },
- {
- key: "isReady",
- value() {
- return !!window.gaplugins;
- },
- },
- ]),
- e
- );
- })();
- const Pe = (function () {
- function e(t) {
- n(this, e),
- (this.siteId = t.siteID),
- (this.name = "HOTJAR"),
- (this._ready = !1);
- }
- return (
- i(e, [
- {
- key: "init",
- value() {
- (window.hotjarSiteId = this.siteId),
- (function (e, t, n, r, i, o) {
- (e.hj =
- e.hj ||
- function () {
- (e.hj.q = e.hj.q || []).push(arguments);
- }),
- (e._hjSettings = { hjid: e.hotjarSiteId, hjsv: 6 }),
- (i = t.getElementsByTagName("head")[0]),
- ((o = t.createElement("script")).async = 1),
- (o.src = `https://static.hotjar.com/c/hotjar-${e._hjSettings.hjid}.js?sv=${e._hjSettings.hjsv}`),
- i.appendChild(o);
- })(window, document),
- (this._ready = !0),
- p("===in init Hotjar===");
- },
- },
- {
- key: "identify",
- value(e) {
- if (e.message.userId || e.message.anonymousId) {
- const t = e.message.context.traits;
- window.hj("identify", e.message.userId, t);
- } else p("[Hotjar] identify:: user id is required");
- },
- },
- {
- key: "track",
- value(e) {
- p("[Hotjar] track:: method not supported");
- },
- },
- {
- key: "page",
- value(e) {
- p("[Hotjar] page:: method not supported");
- },
- },
- {
- key: "isLoaded",
- value() {
- return this._ready;
- },
- },
- {
- key: "isReady",
- value() {
- return this._ready;
- },
- },
- ]),
- e
- );
- })();
- const xe = (function () {
- function e(t) {
- n(this, e),
- (this.conversionId = t.conversionID),
- (this.pageLoadConversions = t.pageLoadConversions),
- (this.clickEventConversions = t.clickEventConversions),
- (this.defaultPageConversion = t.defaultPageConversion),
- (this.name = "GOOGLEADS");
- }
- return (
- i(e, [
- {
- key: "init",
- value() {
- !(function (e, t, n) {
- p(`in script loader=== ${e}`);
- const r = n.createElement("script");
- (r.src = t),
- (r.async = 1),
- (r.type = "text/javascript"),
- (r.id = e);
- const i = n.getElementsByTagName("head")[0];
- p("==script==", i), i.appendChild(r);
- })(
- "googleAds-integration",
- `https://www.googletagmanager.com/gtag/js?id=${this.conversionId}`,
- document
- ),
- (window.dataLayer = window.dataLayer || []),
- (window.gtag = function () {
- window.dataLayer.push(arguments);
- }),
- window.gtag("js", new Date()),
- window.gtag("config", this.conversionId),
- p("===in init Google Ads===");
- },
- },
- {
- key: "identify",
- value(e) {
- p("[GoogleAds] identify:: method not supported");
- },
- },
- {
- key: "track",
- value(e) {
- p("in GoogleAdsAnalyticsManager track");
- const t = this.getConversionData(
- this.clickEventConversions,
- e.message.event
- );
- if (t.conversionLabel) {
- const n = t.conversionLabel;
- const r = t.eventName;
- const i = `${this.conversionId}/${n}`;
- const o = {};
- e.properties &&
- ((o.value = e.properties.revenue),
- (o.currency = e.properties.currency),
- (o.transaction_id = e.properties.order_id)),
- (o.send_to = i),
- window.gtag("event", r, o);
- }
- },
- },
- {
- key: "page",
- value(e) {
- p("in GoogleAdsAnalyticsManager page");
- const t = this.getConversionData(
- this.pageLoadConversions,
- e.message.name
- );
- if (t.conversionLabel) {
- const n = t.conversionLabel;
- const r = t.eventName;
- window.gtag("event", r, {
- send_to: `${this.conversionId}/${n}`,
- });
- }
- },
- },
- {
- key: "getConversionData",
- value(e, t) {
- const n = {};
- return (
- e &&
- (t
- ? e.forEach(function (e) {
- if (e.name.toLowerCase() === t.toLowerCase())
- return (
- (n.conversionLabel = e.conversionLabel),
- void (n.eventName = e.name)
- );
- })
- : this.defaultPageConversion &&
- ((n.conversionLabel = this.defaultPageConversion),
- (n.eventName = "Viewed a Page"))),
- n
- );
- },
- },
- {
- key: "isLoaded",
- value() {
- return window.dataLayer.push !== Array.prototype.push;
- },
- },
- {
- key: "isReady",
- value() {
- return window.dataLayer.push !== Array.prototype.push;
- },
- },
- ]),
- e
- );
- })();
- const Re = (function () {
- function e(t, r) {
- n(this, e),
- (this.accountId = t.accountId),
- (this.settingsTolerance = t.settingsTolerance),
- (this.isSPA = t.isSPA),
- (this.libraryTolerance = t.libraryTolerance),
- (this.useExistingJquery = t.useExistingJquery),
- (this.sendExperimentTrack = t.sendExperimentTrack),
- (this.sendExperimentIdentify = t.sendExperimentIdentify),
- (this.name = "VWO"),
- (this.analytics = r),
- p("Config ", t);
- }
- return (
- i(e, [
- {
- key: "init",
- value() {
- p("===in init VWO===");
- const e = this.accountId;
- const t = this.settingsTolerance;
- const n = this.libraryTolerance;
- const r = this.useExistingJquery;
- const i = this.isSPA;
- (window._vwo_code = (function () {
- let o = !1;
- const s = document;
- return {
- use_existing_jquery() {
- return r;
- },
- library_tolerance() {
- return n;
- },
- finish() {
- if (!o) {
- o = !0;
- const e = s.getElementById("_vis_opt_path_hides");
- e && e.parentNode.removeChild(e);
- }
- },
- finished() {
- return o;
- },
- load(e) {
- const t = s.createElement("script");
- (t.src = e),
- (t.type = "text/javascript"),
- t.innerText,
- (t.onerror = function () {
- _vwo_code.finish();
- }),
- s.getElementsByTagName("head")[0].appendChild(t);
- },
- init() {
- const n = setTimeout("_vwo_code.finish()", t);
- const r = s.createElement("style");
- const o =
- "body{opacity:0 !important;filter:alpha(opacity=0) !important;background:none !important;}";
- const a = s.getElementsByTagName("head")[0];
- return (
- r.setAttribute("id", "_vis_opt_path_hides"),
- r.setAttribute("type", "text/css"),
- r.styleSheet
- ? (r.styleSheet.cssText = o)
- : r.appendChild(s.createTextNode(o)),
- a.appendChild(r),
- this.load(
- `//dev.visualwebsiteoptimizer.com/j.php?a=${e}&u=${encodeURIComponent(
- s.URL
- )}&r=${Math.random()}&f=${+i}`
- ),
- n
- );
- },
- };
- })()),
- (window._vwo_settings_timer = window._vwo_code.init()),
- (this.sendExperimentTrack || this.experimentViewedIdentify) &&
- this.experimentViewed();
- },
- },
- {
- key: "experimentViewed",
- value() {
- const e = this;
- window.VWO = window.VWO || [];
- const t = this;
- window.VWO.push([
- "onVariationApplied",
- function (n) {
- if (n) {
- p("Variation Applied");
- const r = n[1];
- const i = n[2];
- if (
- (p(
- "experiment id:",
- r,
- "Variation Name:",
- _vwo_exp[r].comb_n[i]
- ),
- void 0 !== _vwo_exp[r].comb_n[i] &&
- ["VISUAL_AB", "VISUAL", "SPLIT_URL", "SURVEY"].indexOf(
- _vwo_exp[r].type
- ) > -1)
- ) {
- try {
- t.sendExperimentTrack &&
- (p("Tracking..."),
- e.analytics.track("Experiment Viewed", {
- experimentId: r,
- variationName: _vwo_exp[r].comb_n[i],
- }));
- } catch (e) {
- f("[VWO] experimentViewed:: ", e);
- }
- try {
- t.sendExperimentIdentify &&
- (p("Identifying..."),
- e.analytics.identify(
- o({}, "Experiment: ".concat(r), _vwo_exp[r].comb_n[i])
- ));
- } catch (e) {
- f("[VWO] experimentViewed:: ", e);
- }
- }
- }
- },
- ]);
- },
- },
- {
- key: "identify",
- value(e) {
- p("method not supported");
- },
- },
- {
- key: "track",
- value(e) {
- if (e.message.event === "Order Completed") {
- const t = e.message.properties
- ? e.message.properties.total || e.message.properties.revenue
- : 0;
- p("Revenue", t),
- (window.VWO = window.VWO || []),
- window.VWO.push(["track.revenueConversion", t]);
- }
- },
- },
- {
- key: "page",
- value(e) {
- p("method not supported");
- },
- },
- {
- key: "isLoaded",
- value() {
- return !!window._vwo_code;
- },
- },
- {
- key: "isReady",
- value() {
- return !!window._vwo_code;
- },
- },
- ]),
- e
- );
- })();
- const je = (function () {
- function e(t) {
- n(this, e),
- (this.containerID = t.containerID),
- (this.name = "GOOGLETAGMANAGER");
- }
- return (
- i(e, [
- {
- key: "init",
- value() {
- p("===in init GoogleTagManager==="),
- (function (e, t, n, r, i) {
- (e[r] = e[r] || []),
- e[r].push({
- "gtm.start": new Date().getTime(),
- event: "gtm.js",
- });
- const o = t.getElementsByTagName(n)[0];
- const s = t.createElement(n);
- (s.async = !0),
- (s.src = `https://www.googletagmanager.com/gtm.js?id=${i}`),
- o.parentNode.insertBefore(s, o);
- })(window, document, "script", "dataLayer", this.containerID);
- },
- },
- {
- key: "identify",
- value(e) {
- p("[GTM] identify:: method not supported");
- },
- },
- {
- key: "track",
- value(e) {
- p("===in track GoogleTagManager===");
- const t = e.message;
- const n = a(
- {
- event: t.event,
- userId: t.userId,
- anonymousId: t.anonymousId,
- },
- t.properties
- );
- this.sendToGTMDatalayer(n);
- },
- },
- {
- key: "page",
- value(e) {
- p("===in page GoogleTagManager===");
- let t;
- const n = e.message;
- const r = n.name;
- const i = n.properties ? n.properties.category : void 0;
- r && (t = `Viewed ${r} page`),
- i && r && (t = `Viewed ${i} ${r} page`),
- t || (t = "Viewed a Page");
- const o = a(
- { event: t, userId: n.userId, anonymousId: n.anonymousId },
- n.properties
- );
- this.sendToGTMDatalayer(o);
- },
- },
- {
- key: "isLoaded",
- value() {
- return !(
- !window.dataLayer ||
- Array.prototype.push === window.dataLayer.push
- );
- },
- },
- {
- key: "sendToGTMDatalayer",
- value(e) {
- window.dataLayer.push(e);
- },
- },
- {
- key: "isReady",
- value() {
- return !(
- !window.dataLayer ||
- Array.prototype.push === window.dataLayer.push
- );
- },
- },
- ]),
- e
- );
- })();
- const De = (function () {
- function e(t, r) {
- if (
- (n(this, e),
- (this.analytics = r),
- (this.appKey = t.appKey),
- t.appKey || (this.appKey = ""),
- (this.endPoint = ""),
- t.dataCenter)
- ) {
- const i = t.dataCenter.trim().split("-");
- i[0].toLowerCase() === "eu"
- ? (this.endPoint = "sdk.fra-01.braze.eu")
- : (this.endPoint = `sdk.iad-${i[1]}.braze.com`);
- }
- (this.name = "BRAZE"), p("Config ", t);
- }
- return (
- i(e, [
- {
- key: "formatGender",
- value(e) {
- if (e && typeof e === "string") {
- return ["woman", "female", "w", "f"].indexOf(e.toLowerCase()) > -1
- ? window.appboy.ab.User.Genders.FEMALE
- : ["man", "male", "m"].indexOf(e.toLowerCase()) > -1
- ? window.appboy.ab.User.Genders.MALE
- : ["other", "o"].indexOf(e.toLowerCase()) > -1
- ? window.appboy.ab.User.Genders.OTHER
- : void 0;
- }
- },
- },
- {
- key: "init",
- value() {
- p("===in init Braze==="),
- (function (e, t, n, r, i) {
- (e.appboy = {}), (e.appboyQueue = []);
- for (
- let o = "initialize destroy getDeviceId toggleAppboyLogging setLogger openSession changeUser requestImmediateDataFlush requestFeedRefresh subscribeToFeedUpdates requestContentCardsRefresh subscribeToContentCardsUpdates logCardImpressions logCardClick logCardDismissal logFeedDisplayed logContentCardsDisplayed logInAppMessageImpression logInAppMessageClick logInAppMessageButtonClick logInAppMessageHtmlClick subscribeToNewInAppMessages subscribeToInAppMessage removeSubscription removeAllSubscriptions logCustomEvent logPurchase isPushSupported isPushBlocked isPushGranted isPushPermissionGranted registerAppboyPushMessages unregisterAppboyPushMessages trackLocation stopWebTracking resumeWebTracking wipeData ab ab.DeviceProperties ab.User ab.User.Genders ab.User.NotificationSubscriptionTypes ab.User.prototype.getUserId ab.User.prototype.setFirstName ab.User.prototype.setLastName ab.User.prototype.setEmail ab.User.prototype.setGender ab.User.prototype.setDateOfBirth ab.User.prototype.setCountry ab.User.prototype.setHomeCity ab.User.prototype.setLanguage ab.User.prototype.setEmailNotificationSubscriptionType ab.User.prototype.setPushNotificationSubscriptionType ab.User.prototype.setPhoneNumber ab.User.prototype.setAvatarImageUrl ab.User.prototype.setLastKnownLocation ab.User.prototype.setUserAttribute ab.User.prototype.setCustomUserAttribute ab.User.prototype.addToCustomAttributeArray ab.User.prototype.removeFromCustomAttributeArray ab.User.prototype.incrementCustomUserAttribute ab.User.prototype.addAlias ab.User.prototype.setCustomLocationAttribute ab.InAppMessage ab.InAppMessage.SlideFrom ab.InAppMessage.ClickAction ab.InAppMessage.DismissType ab.InAppMessage.OpenTarget ab.InAppMessage.ImageStyle ab.InAppMessage.TextAlignment ab.InAppMessage.Orientation ab.InAppMessage.CropType ab.InAppMessage.prototype.subscribeToClickedEvent ab.InAppMessage.prototype.subscribeToDismissedEvent ab.InAppMessage.prototype.removeSubscription ab.InAppMessage.prototype.removeAllSubscriptions ab.InAppMessage.prototype.closeMessage ab.InAppMessage.Button ab.InAppMessage.Button.prototype.subscribeToClickedEvent ab.InAppMessage.Button.prototype.removeSubscription ab.InAppMessage.Button.prototype.removeAllSubscriptions ab.SlideUpMessage ab.ModalMessage ab.FullScreenMessage ab.HtmlMessage ab.ControlMessage ab.Feed ab.Feed.prototype.getUnreadCardCount ab.ContentCards ab.ContentCards.prototype.getUnviewedCardCount ab.Card ab.Card.prototype.dismissCard ab.ClassicCard ab.CaptionedImage ab.Banner ab.ControlCard ab.WindowUtils display display.automaticallyShowNewInAppMessages display.showInAppMessage display.showFeed display.destroyFeed display.toggleFeed display.showContentCards display.hideContentCards display.toggleContentCards sharedLib".split(
- " "
- ),
- s = 0;
- s < o.length;
- s++
- ) {
- for (
- var a = o[s], u = e.appboy, c = a.split("."), l = 0;
- l < c.length - 1;
- l++
- )
- u = u[c[l]];
- u[c[l]] = new Function(
- `return function ${a.replace(
- /\./g,
- "_"
- )}(){window.appboyQueue.push(arguments); return true}`
- )();
- }
- (window.appboy.getUser = function () {
- return new window.appboy.ab.User();
- }),
- (window.appboy.getCachedFeed = function () {
- return new window.appboy.ab.Feed();
- }),
- (window.appboy.getCachedContentCards = function () {
- return new window.appboy.ab.ContentCards();
- }),
- ((i = t.createElement(n)).type = "text/javascript"),
- (i.src =
- "https://js.appboycdn.com/web-sdk/2.4/appboy.min.js"),
- (i.async = 1),
- (r = t.getElementsByTagName(n)[0]).parentNode.insertBefore(
- i,
- r
- );
- })(window, document, "script"),
- window.appboy.initialize(this.appKey, {
- enableLogging: !0,
- baseUrl: this.endPoint,
- }),
- window.appboy.display.automaticallyShowNewInAppMessages();
- const e = this.analytics.userId;
- e && appboy.changeUser(e), window.appboy.openSession();
- },
- },
- {
- key: "handleReservedProperties",
- value(e) {
- return (
- [
- "time",
- "product_id",
- "quantity",
- "event_name",
- "price",
- "currency",
- ].forEach(function (t) {
- delete e[t];
- }),
- e
- );
- },
- },
- {
- key: "identify",
- value(e) {
- const t = e.message.userId;
- const n = e.message.context.traits.address;
- const r = e.message.context.traits.avatar;
- const i = e.message.context.traits.birthday;
- const o = e.message.context.traits.email;
- const s = e.message.context.traits.firstname;
- const a = e.message.context.traits.gender;
- const u = e.message.context.traits.lastname;
- const c = e.message.context.traits.phone;
- const l = JSON.parse(JSON.stringify(e.message.context.traits));
- window.appboy.changeUser(t),
- window.appboy.getUser().setAvatarImageUrl(r),
- o && window.appboy.getUser().setEmail(o),
- s && window.appboy.getUser().setFirstName(s),
- a && window.appboy.getUser().setGender(this.formatGender(a)),
- u && window.appboy.getUser().setLastName(u),
- c && window.appboy.getUser().setPhoneNumber(c),
- n &&
- (window.appboy.getUser().setCountry(n.country),
- window.appboy.getUser().setHomeCity(n.city)),
- i &&
- window.appboy
- .getUser()
- .setDateOfBirth(
- i.getUTCFullYear(),
- i.getUTCMonth() + 1,
- i.getUTCDate()
- );
- [
- "avatar",
- "address",
- "birthday",
- "email",
- "id",
- "firstname",
- "gender",
- "lastname",
- "phone",
- "facebook",
- "twitter",
- "first_name",
- "last_name",
- "dob",
- "external_id",
- "country",
- "home_city",
- "bio",
- "gender",
- "phone",
- "email_subscribe",
- "push_subscribe",
- ].forEach(function (e) {
- delete l[e];
- }),
- Object.keys(l).forEach(function (e) {
- window.appboy.getUser().setCustomUserAttribute(e, l[e]);
- });
- },
- },
- {
- key: "handlePurchase",
- value(e, t) {
- const n = e.products;
- const r = e.currency;
- window.appboy.changeUser(t),
- del(e, "products"),
- del(e, "currency"),
- n.forEach(function (t) {
- const n = t.product_id;
- const i = t.price;
- const o = t.quantity;
- o && i && n && window.appboy.logPurchase(n, i, r, o, e);
- });
- },
- },
- {
- key: "track",
- value(e) {
- const t = e.message.userId;
- const n = e.message.event;
- let r = e.message.properties;
- window.appboy.changeUser(t),
- n.toLowerCase() === "order completed"
- ? this.handlePurchase(r, t)
- : ((r = this.handleReservedProperties(r)),
- window.appboy.logCustomEvent(n, r));
- },
- },
- {
- key: "page",
- value(e) {
- const t = e.message.userId;
- const n = e.message.name;
- let r = e.message.properties;
- (r = this.handleReservedProperties(r)),
- window.appboy.changeUser(t),
- window.appboy.logCustomEvent(n, r);
- },
- },
- {
- key: "isLoaded",
- value() {
- return window.appboyQueue === null;
- },
- },
- {
- key: "isReady",
- value() {
- return window.appboyQueue === null;
- },
- },
- ]),
- e
- );
- })();
- const Ue = R(function (e) {
- !(function () {
- const t =
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
- var n = {
- rotl(e, t) {
- return (e << t) | (e >>> (32 - t));
- },
- rotr(e, t) {
- return (e << (32 - t)) | (e >>> t);
- },
- endian(e) {
- if (e.constructor == Number)
- return (16711935 & n.rotl(e, 8)) | (4278255360 & n.rotl(e, 24));
- for (let t = 0; t < e.length; t++) e[t] = n.endian(e[t]);
- return e;
- },
- randomBytes(e) {
- for (var t = []; e > 0; e--) t.push(Math.floor(256 * Math.random()));
- return t;
- },
- bytesToWords(e) {
- for (var t = [], n = 0, r = 0; n < e.length; n++, r += 8)
- t[r >>> 5] |= e[n] << (24 - (r % 32));
- return t;
- },
- wordsToBytes(e) {
- for (var t = [], n = 0; n < 32 * e.length; n += 8)
- t.push((e[n >>> 5] >>> (24 - (n % 32))) & 255);
- return t;
- },
- bytesToHex(e) {
- for (var t = [], n = 0; n < e.length; n++)
- t.push((e[n] >>> 4).toString(16)), t.push((15 & e[n]).toString(16));
- return t.join("");
- },
- hexToBytes(e) {
- for (var t = [], n = 0; n < e.length; n += 2)
- t.push(parseInt(e.substr(n, 2), 16));
- return t;
- },
- bytesToBase64(e) {
- for (var n = [], r = 0; r < e.length; r += 3)
- for (
- let i = (e[r] << 16) | (e[r + 1] << 8) | e[r + 2], o = 0;
- o < 4;
- o++
- )
- 8 * r + 6 * o <= 8 * e.length
- ? n.push(t.charAt((i >>> (6 * (3 - o))) & 63))
- : n.push("=");
- return n.join("");
- },
- base64ToBytes(e) {
- e = e.replace(/[^A-Z0-9+\/]/gi, "");
- for (var n = [], r = 0, i = 0; r < e.length; i = ++r % 4)
- i != 0 &&
- n.push(
- ((t.indexOf(e.charAt(r - 1)) & (Math.pow(2, -2 * i + 8) - 1)) <<
- (2 * i)) |
- (t.indexOf(e.charAt(r)) >>> (6 - 2 * i))
- );
- return n;
- },
- };
- e.exports = n;
- })();
- });
- var Le = {
- utf8: {
- stringToBytes(e) {
- return Le.bin.stringToBytes(unescape(encodeURIComponent(e)));
- },
- bytesToString(e) {
- return decodeURIComponent(escape(Le.bin.bytesToString(e)));
- },
- },
- bin: {
- stringToBytes(e) {
- for (var t = [], n = 0; n < e.length; n++)
- t.push(255 & e.charCodeAt(n));
- return t;
- },
- bytesToString(e) {
- for (var t = [], n = 0; n < e.length; n++)
- t.push(String.fromCharCode(e[n]));
- return t.join("");
- },
- },
- };
- const Me = Le;
- const Ne = function (e) {
- return (
- e != null &&
- (Be(e) ||
- (function (e) {
- return (
- typeof e.readFloatLE === "function" &&
- typeof e.slice === "function" &&
- Be(e.slice(0, 0))
- );
- })(e) ||
- !!e._isBuffer)
- );
- };
- function Be(e) {
- return (
- !!e.constructor &&
- typeof e.constructor.isBuffer === "function" &&
- e.constructor.isBuffer(e)
- );
- }
- let qe;
- let Fe;
- const Ke = R(function (e) {
- !(function () {
- const t = Ue;
- const n = Me.utf8;
- const r = Ne;
- const i = Me.bin;
- var o = function (e, s) {
- e.constructor == String
- ? (e =
- s && s.encoding === "binary"
- ? i.stringToBytes(e)
- : n.stringToBytes(e))
- : r(e)
- ? (e = Array.prototype.slice.call(e, 0))
- : Array.isArray(e) || (e = e.toString());
- for (
- var a = t.bytesToWords(e),
- u = 8 * e.length,
- c = 1732584193,
- l = -271733879,
- d = -1732584194,
- p = 271733878,
- f = 0;
- f < a.length;
- f++
- )
- a[f] =
- (16711935 & ((a[f] << 8) | (a[f] >>> 24))) |
- (4278255360 & ((a[f] << 24) | (a[f] >>> 8)));
- (a[u >>> 5] |= 128 << u % 32), (a[14 + (((u + 64) >>> 9) << 4)] = u);
- const h = o._ff;
- const g = o._gg;
- const y = o._hh;
- const m = o._ii;
- for (f = 0; f < a.length; f += 16) {
- const v = c;
- const b = l;
- const w = d;
- const k = p;
- (c = h(c, l, d, p, a[f + 0], 7, -680876936)),
- (p = h(p, c, l, d, a[f + 1], 12, -389564586)),
- (d = h(d, p, c, l, a[f + 2], 17, 606105819)),
- (l = h(l, d, p, c, a[f + 3], 22, -1044525330)),
- (c = h(c, l, d, p, a[f + 4], 7, -176418897)),
- (p = h(p, c, l, d, a[f + 5], 12, 1200080426)),
- (d = h(d, p, c, l, a[f + 6], 17, -1473231341)),
- (l = h(l, d, p, c, a[f + 7], 22, -45705983)),
- (c = h(c, l, d, p, a[f + 8], 7, 1770035416)),
- (p = h(p, c, l, d, a[f + 9], 12, -1958414417)),
- (d = h(d, p, c, l, a[f + 10], 17, -42063)),
- (l = h(l, d, p, c, a[f + 11], 22, -1990404162)),
- (c = h(c, l, d, p, a[f + 12], 7, 1804603682)),
- (p = h(p, c, l, d, a[f + 13], 12, -40341101)),
- (d = h(d, p, c, l, a[f + 14], 17, -1502002290)),
- (c = g(
- c,
- (l = h(l, d, p, c, a[f + 15], 22, 1236535329)),
- d,
- p,
- a[f + 1],
- 5,
- -165796510
- )),
- (p = g(p, c, l, d, a[f + 6], 9, -1069501632)),
- (d = g(d, p, c, l, a[f + 11], 14, 643717713)),
- (l = g(l, d, p, c, a[f + 0], 20, -373897302)),
- (c = g(c, l, d, p, a[f + 5], 5, -701558691)),
- (p = g(p, c, l, d, a[f + 10], 9, 38016083)),
- (d = g(d, p, c, l, a[f + 15], 14, -660478335)),
- (l = g(l, d, p, c, a[f + 4], 20, -405537848)),
- (c = g(c, l, d, p, a[f + 9], 5, 568446438)),
- (p = g(p, c, l, d, a[f + 14], 9, -1019803690)),
- (d = g(d, p, c, l, a[f + 3], 14, -187363961)),
- (l = g(l, d, p, c, a[f + 8], 20, 1163531501)),
- (c = g(c, l, d, p, a[f + 13], 5, -1444681467)),
- (p = g(p, c, l, d, a[f + 2], 9, -51403784)),
- (d = g(d, p, c, l, a[f + 7], 14, 1735328473)),
- (c = y(
- c,
- (l = g(l, d, p, c, a[f + 12], 20, -1926607734)),
- d,
- p,
- a[f + 5],
- 4,
- -378558
- )),
- (p = y(p, c, l, d, a[f + 8], 11, -2022574463)),
- (d = y(d, p, c, l, a[f + 11], 16, 1839030562)),
- (l = y(l, d, p, c, a[f + 14], 23, -35309556)),
- (c = y(c, l, d, p, a[f + 1], 4, -1530992060)),
- (p = y(p, c, l, d, a[f + 4], 11, 1272893353)),
- (d = y(d, p, c, l, a[f + 7], 16, -155497632)),
- (l = y(l, d, p, c, a[f + 10], 23, -1094730640)),
- (c = y(c, l, d, p, a[f + 13], 4, 681279174)),
- (p = y(p, c, l, d, a[f + 0], 11, -358537222)),
- (d = y(d, p, c, l, a[f + 3], 16, -722521979)),
- (l = y(l, d, p, c, a[f + 6], 23, 76029189)),
- (c = y(c, l, d, p, a[f + 9], 4, -640364487)),
- (p = y(p, c, l, d, a[f + 12], 11, -421815835)),
- (d = y(d, p, c, l, a[f + 15], 16, 530742520)),
- (c = m(
- c,
- (l = y(l, d, p, c, a[f + 2], 23, -995338651)),
- d,
- p,
- a[f + 0],
- 6,
- -198630844
- )),
- (p = m(p, c, l, d, a[f + 7], 10, 1126891415)),
- (d = m(d, p, c, l, a[f + 14], 15, -1416354905)),
- (l = m(l, d, p, c, a[f + 5], 21, -57434055)),
- (c = m(c, l, d, p, a[f + 12], 6, 1700485571)),
- (p = m(p, c, l, d, a[f + 3], 10, -1894986606)),
- (d = m(d, p, c, l, a[f + 10], 15, -1051523)),
- (l = m(l, d, p, c, a[f + 1], 21, -2054922799)),
- (c = m(c, l, d, p, a[f + 8], 6, 1873313359)),
- (p = m(p, c, l, d, a[f + 15], 10, -30611744)),
- (d = m(d, p, c, l, a[f + 6], 15, -1560198380)),
- (l = m(l, d, p, c, a[f + 13], 21, 1309151649)),
- (c = m(c, l, d, p, a[f + 4], 6, -145523070)),
- (p = m(p, c, l, d, a[f + 11], 10, -1120210379)),
- (d = m(d, p, c, l, a[f + 2], 15, 718787259)),
- (l = m(l, d, p, c, a[f + 9], 21, -343485551)),
- (c = (c + v) >>> 0),
- (l = (l + b) >>> 0),
- (d = (d + w) >>> 0),
- (p = (p + k) >>> 0);
- }
- return t.endian([c, l, d, p]);
- };
- (o._ff = function (e, t, n, r, i, o, s) {
- const a = e + ((t & n) | (~t & r)) + (i >>> 0) + s;
- return ((a << o) | (a >>> (32 - o))) + t;
- }),
- (o._gg = function (e, t, n, r, i, o, s) {
- const a = e + ((t & r) | (n & ~r)) + (i >>> 0) + s;
- return ((a << o) | (a >>> (32 - o))) + t;
- }),
- (o._hh = function (e, t, n, r, i, o, s) {
- const a = e + (t ^ n ^ r) + (i >>> 0) + s;
- return ((a << o) | (a >>> (32 - o))) + t;
- }),
- (o._ii = function (e, t, n, r, i, o, s) {
- const a = e + (n ^ (t | ~r)) + (i >>> 0) + s;
- return ((a << o) | (a >>> (32 - o))) + t;
- }),
- (o._blocksize = 16),
- (o._digestsize = 16),
- (e.exports = function (e, n) {
- if (e == null) throw new Error(`Illegal argument ${e}`);
- const r = t.wordsToBytes(o(e, n));
- return n && n.asBytes
- ? r
- : n && n.asString
- ? i.bytesToString(r)
- : t.bytesToHex(r);
- });
- })();
- });
- const Ge = (function () {
- function e(t) {
- n(this, e),
- (this.NAME = "INTERCOM"),
- (this.API_KEY = t.apiKey),
- (this.APP_ID = t.appId),
- (this.MOBILE_APP_ID = t.mobileAppId),
- p("Config ", t);
- }
- return (
- i(e, [
- {
- key: "init",
- value() {
- (window.intercomSettings = { app_id: this.APP_ID }),
- (function () {
- const e = window;
- const t = e.Intercom;
- if (typeof t === "function")
- t("reattach_activator"), t("update", e.intercomSettings);
- else {
- const n = document;
- const r = function e() {
- e.c(arguments);
- };
- (r.q = []),
- (r.c = function (e) {
- r.q.push(e);
- }),
- (e.Intercom = r);
- const i = function () {
- const e = n.createElement("script");
- (e.type = "text/javascript"),
- (e.async = !0),
- (e.src = `https://widget.intercom.io/widget/${window.intercomSettings.app_id}`);
- const t = n.getElementsByTagName("script")[0];
- t.parentNode.insertBefore(e, t);
- };
- document.readyState === "complete"
- ? (i(), (window.intercom_code = !0))
- : e.attachEvent
- ? (e.attachEvent("onload", i), (window.intercom_code = !0))
- : (e.addEventListener("load", i, !1),
- (window.intercom_code = !0));
- }
- })();
- },
- },
- {
- key: "page",
- value() {
- window.Intercom("update");
- },
- },
- {
- key: "identify",
- value(e) {
- const n = {};
- const r = e.message.context;
- if ((r.Intercom ? r.Intercom : null) != null) {
- const i = r.Intercom.user_hash ? r.Intercom.user_hash : null;
- i != null && (n.user_hash = i);
- const o = r.Intercom.hideDefaultLauncher
- ? r.Intercom.hideDefaultLauncher
- : null;
- o != null && (n.hide_default_launcher = o);
- }
- Object.keys(r.traits).forEach(function (e) {
- if (r.traits.hasOwnProperty(e)) {
- const i = r.traits[e];
- if (e === "company") {
- const o = [];
- const s = {};
- typeof r.traits[e] === "string" &&
- (s.company_id = Ke(r.traits[e]));
- const a =
- (t(r.traits[e]) == "object" && Object.keys(r.traits[e])) ||
- [];
- a.forEach(function (t) {
- a.hasOwnProperty(t) &&
- (t != "id"
- ? (s[t] = r.traits[e][t])
- : (s.company_id = r.traits[e][t]));
- }),
- t(r.traits[e]) != "object" ||
- a.includes("id") ||
- (s.company_id = Ke(s.name)),
- o.push(s),
- (n.companies = o);
- } else n[e] = r.traits[e];
- switch (e) {
- case "createdAt":
- n.created_at = i;
- break;
- case "anonymousId":
- n.user_id = i;
- }
- }
- }),
- (n.user_id = e.message.userId),
- window.Intercom("update", n);
- },
- },
- {
- key: "track",
- value(e) {
- const t = {};
- const n = e.message;
- (n.properties ? Object.keys(n.properties) : null).forEach(function (
- e
- ) {
- const r = n.properties[e];
- t[e] = r;
- }),
- n.event && (t.event_name = n.event),
- (t.user_id = n.userId ? n.userId : n.anonymousId),
- (t.created_at = Math.floor(
- new Date(n.originalTimestamp).getTime() / 1e3
- )),
- window.Intercom("trackEvent", t.event_name, t);
- },
- },
- {
- key: "isLoaded",
- value() {
- return !!window.intercom_code;
- },
- },
- {
- key: "isReady",
- value() {
- return !!window.intercom_code;
- },
- },
- ]),
- e
- );
- })();
- const He = (function () {
- function e(t) {
- n(this, e),
- (this.projectID = t.projectID),
- (this.writeKey = t.writeKey),
- (this.ipAddon = t.ipAddon),
- (this.uaAddon = t.uaAddon),
- (this.urlAddon = t.urlAddon),
- (this.referrerAddon = t.referrerAddon),
- (this.client = null),
- (this.name = "KEEN");
- }
- return (
- i(e, [
- {
- key: "init",
- value() {
- p("===in init Keen==="),
- T(
- "keen-integration",
- "https://cdn.jsdelivr.net/npm/keen-tracking@4"
- );
- var e = setInterval(
- function () {
- void 0 !== window.KeenTracking &&
- void 0 !== window.KeenTracking &&
- ((this.client = (function (e) {
- return (
- (e.client = new window.KeenTracking({
- projectId: e.projectID,
- writeKey: e.writeKey,
- })),
- e.client
- );
- })(this)),
- clearInterval(e));
- }.bind(this),
- 1e3
- );
- },
- },
- {
- key: "identify",
- value(e) {
- p("in Keen identify");
- const t = e.message.context.traits;
- const n = e.message.userId
- ? e.message.userId
- : e.message.anonymousId;
- var r = e.message.properties
- ? Object.assign(r, e.message.properties)
- : {};
- (r.user = { userId: n, traits: t }),
- (r = this.getAddOn(r)),
- this.client.extendEvents(r);
- },
- },
- {
- key: "track",
- value(e) {
- p("in Keen track");
- const t = e.message.event;
- let n = e.message.properties;
- (n = this.getAddOn(n)), this.client.recordEvent(t, n);
- },
- },
- {
- key: "page",
- value(e) {
- p("in Keen page");
- const t = e.message.name;
- const n = e.message.properties
- ? e.message.properties.category
- : void 0;
- let r = "Loaded a Page";
- t && (r = `Viewed ${t} page`),
- n && t && (r = `Viewed ${n} ${t} page`);
- let i = e.message.properties;
- (i = this.getAddOn(i)), this.client.recordEvent(r, i);
- },
- },
- {
- key: "isLoaded",
- value() {
- return p("in Keen isLoaded"), !(this.client == null);
- },
- },
- {
- key: "isReady",
- value() {
- return !(this.client == null);
- },
- },
- {
- key: "getAddOn",
- value(e) {
- const t = [];
- return (
- this.ipAddon &&
- ((e.ip_address = "${keen.ip}"),
- t.push({
- name: "keen:ip_to_geo",
- input: { ip: "ip_address" },
- output: "ip_geo_info",
- })),
- this.uaAddon &&
- ((e.user_agent = "${keen.user_agent}"),
- t.push({
- name: "keen:ua_parser",
- input: { ua_string: "user_agent" },
- output: "parsed_user_agent",
- })),
- this.urlAddon &&
- ((e.page_url = document.location.href),
- t.push({
- name: "keen:url_parser",
- input: { url: "page_url" },
- output: "parsed_page_url",
- })),
- this.referrerAddon &&
- ((e.page_url = document.location.href),
- (e.referrer_url = document.referrer),
- t.push({
- name: "keen:referrer_parser",
- input: {
- referrer_url: "referrer_url",
- page_url: "page_url",
- },
- output: "referrer_info",
- })),
- (e.keen = { addons: t }),
- e
- );
- },
- },
- ]),
- e
- );
- })();
- const Ve = Object.prototype;
- const ze = Ve.hasOwnProperty;
- const Je = Ve.toString;
- typeof Symbol === "function" && (qe = Symbol.prototype.valueOf),
- typeof BigInt === "function" && (Fe = BigInt.prototype.valueOf);
- const We = function (e) {
- return e != e;
- };
- const $e = { boolean: 1, number: 1, string: 1, undefined: 1 };
- const Ye = /^([A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{4}|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}==)$/;
- const Qe = /^[A-Fa-f0-9]+$/;
- const Ze = {};
- (Ze.a = Ze.type = function (e, t) {
- return typeof e === t;
- }),
- (Ze.defined = function (e) {
- return void 0 !== e;
- }),
- (Ze.empty = function (e) {
- let t;
- const n = Je.call(e);
- if (
- n === "[object Array]" ||
- n === "[object Arguments]" ||
- n === "[object String]"
- )
- return e.length === 0;
- if (n === "[object Object]") {
- for (t in e) if (ze.call(e, t)) return !1;
- return !0;
- }
- return !e;
- }),
- (Ze.equal = function (e, t) {
- if (e === t) return !0;
- let n;
- const r = Je.call(e);
- if (r !== Je.call(t)) return !1;
- if (r === "[object Object]") {
- for (n in e) if (!Ze.equal(e[n], t[n]) || !(n in t)) return !1;
- for (n in t) if (!Ze.equal(e[n], t[n]) || !(n in e)) return !1;
- return !0;
- }
- if (r === "[object Array]") {
- if ((n = e.length) !== t.length) return !1;
- for (; n--; ) if (!Ze.equal(e[n], t[n])) return !1;
- return !0;
- }
- return r === "[object Function]"
- ? e.prototype === t.prototype
- : r === "[object Date]" && e.getTime() === t.getTime();
- }),
- (Ze.hosted = function (e, t) {
- const n = typeof t[e];
- return n === "object" ? !!t[e] : !$e[n];
- }),
- (Ze.instance = Ze.instanceof = function (e, t) {
- return e instanceof t;
- }),
- (Ze.nil = Ze.null = function (e) {
- return e === null;
- }),
- (Ze.undef = Ze.undefined = function (e) {
- return void 0 === e;
- }),
- (Ze.args = Ze.arguments = function (e) {
- const t = Je.call(e) === "[object Arguments]";
- const n =
- !Ze.array(e) && Ze.arraylike(e) && Ze.object(e) && Ze.fn(e.callee);
- return t || n;
- }),
- (Ze.array =
- Array.isArray ||
- function (e) {
- return Je.call(e) === "[object Array]";
- }),
- (Ze.args.empty = function (e) {
- return Ze.args(e) && e.length === 0;
- }),
- (Ze.array.empty = function (e) {
- return Ze.array(e) && e.length === 0;
- }),
- (Ze.arraylike = function (e) {
- return (
- !!e &&
- !Ze.bool(e) &&
- ze.call(e, "length") &&
- isFinite(e.length) &&
- Ze.number(e.length) &&
- e.length >= 0
- );
- }),
- (Ze.bool = Ze.boolean = function (e) {
- return Je.call(e) === "[object Boolean]";
- }),
- (Ze.false = function (e) {
- return Ze.bool(e) && !1 === Boolean(Number(e));
- }),
- (Ze.true = function (e) {
- return Ze.bool(e) && !0 === Boolean(Number(e));
- }),
- (Ze.date = function (e) {
- return Je.call(e) === "[object Date]";
- }),
- (Ze.date.valid = function (e) {
- return Ze.date(e) && !isNaN(Number(e));
- }),
- (Ze.element = function (e) {
- return (
- void 0 !== e &&
- typeof HTMLElement !== "undefined" &&
- e instanceof HTMLElement &&
- e.nodeType === 1
- );
- }),
- (Ze.error = function (e) {
- return Je.call(e) === "[object Error]";
- }),
- (Ze.fn = Ze.function = function (e) {
- if (typeof window !== "undefined" && e === window.alert) return !0;
- const t = Je.call(e);
- return (
- t === "[object Function]" ||
- t === "[object GeneratorFunction]" ||
- t === "[object AsyncFunction]"
- );
- }),
- (Ze.number = function (e) {
- return Je.call(e) === "[object Number]";
- }),
- (Ze.infinite = function (e) {
- return e === 1 / 0 || e === -1 / 0;
- }),
- (Ze.decimal = function (e) {
- return Ze.number(e) && !We(e) && !Ze.infinite(e) && e % 1 != 0;
- }),
- (Ze.divisibleBy = function (e, t) {
- const n = Ze.infinite(e);
- const r = Ze.infinite(t);
- const i = Ze.number(e) && !We(e) && Ze.number(t) && !We(t) && t !== 0;
- return n || r || (i && e % t == 0);
- }),
- (Ze.integer = Ze.int = function (e) {
- return Ze.number(e) && !We(e) && e % 1 == 0;
- }),
- (Ze.maximum = function (e, t) {
- if (We(e)) throw new TypeError("NaN is not a valid value");
- if (!Ze.arraylike(t))
- throw new TypeError("second argument must be array-like");
- for (let n = t.length; --n >= 0; ) if (e < t[n]) return !1;
- return !0;
- }),
- (Ze.minimum = function (e, t) {
- if (We(e)) throw new TypeError("NaN is not a valid value");
- if (!Ze.arraylike(t))
- throw new TypeError("second argument must be array-like");
- for (let n = t.length; --n >= 0; ) if (e > t[n]) return !1;
- return !0;
- }),
- (Ze.nan = function (e) {
- return !Ze.number(e) || e != e;
- }),
- (Ze.even = function (e) {
- return Ze.infinite(e) || (Ze.number(e) && e == e && e % 2 == 0);
- }),
- (Ze.odd = function (e) {
- return Ze.infinite(e) || (Ze.number(e) && e == e && e % 2 != 0);
- }),
- (Ze.ge = function (e, t) {
- if (We(e) || We(t)) throw new TypeError("NaN is not a valid value");
- return !Ze.infinite(e) && !Ze.infinite(t) && e >= t;
- }),
- (Ze.gt = function (e, t) {
- if (We(e) || We(t)) throw new TypeError("NaN is not a valid value");
- return !Ze.infinite(e) && !Ze.infinite(t) && e > t;
- }),
- (Ze.le = function (e, t) {
- if (We(e) || We(t)) throw new TypeError("NaN is not a valid value");
- return !Ze.infinite(e) && !Ze.infinite(t) && e <= t;
- }),
- (Ze.lt = function (e, t) {
- if (We(e) || We(t)) throw new TypeError("NaN is not a valid value");
- return !Ze.infinite(e) && !Ze.infinite(t) && e < t;
- }),
- (Ze.within = function (e, t, n) {
- if (We(e) || We(t) || We(n))
- throw new TypeError("NaN is not a valid value");
- if (!Ze.number(e) || !Ze.number(t) || !Ze.number(n))
- throw new TypeError("all arguments must be numbers");
- return (
- Ze.infinite(e) || Ze.infinite(t) || Ze.infinite(n) || (e >= t && e <= n)
- );
- }),
- (Ze.object = function (e) {
- return Je.call(e) === "[object Object]";
- }),
- (Ze.primitive = function (e) {
- return (
- !e ||
- !(typeof e === "object" || Ze.object(e) || Ze.fn(e) || Ze.array(e))
- );
- }),
- (Ze.hash = function (e) {
- return (
- Ze.object(e) &&
- e.constructor === Object &&
- !e.nodeType &&
- !e.setInterval
- );
- }),
- (Ze.regexp = function (e) {
- return Je.call(e) === "[object RegExp]";
- }),
- (Ze.string = function (e) {
- return Je.call(e) === "[object String]";
- }),
- (Ze.base64 = function (e) {
- return Ze.string(e) && (!e.length || Ye.test(e));
- }),
- (Ze.hex = function (e) {
- return Ze.string(e) && (!e.length || Qe.test(e));
- }),
- (Ze.symbol = function (e) {
- return (
- typeof Symbol === "function" &&
- Je.call(e) === "[object Symbol]" &&
- typeof qe.call(e) === "symbol"
- );
- }),
- (Ze.bigint = function (e) {
- return (
- typeof BigInt === "function" &&
- Je.call(e) === "[object BigInt]" &&
- typeof Fe.call(e) === "bigint"
- );
- });
- let Xe;
- const et = Ze;
- const tt = Object.prototype.hasOwnProperty;
- const nt = function (e) {
- for (
- let t = Array.prototype.slice.call(arguments, 1), n = 0;
- n < t.length;
- n += 1
- )
- for (const r in t[n]) tt.call(t[n], r) && (e[r] = t[n][r]);
- return e;
- };
- const rt = R(function (e) {
- function t(e) {
- return function (t, n, r, o) {
- let s;
- (normalize =
- o &&
- (function (e) {
- return typeof e === "function";
- })(o.normalizer)
- ? o.normalizer
- : i),
- (n = normalize(n));
- for (var a = !1; !a; ) u();
- function u() {
- for (s in t) {
- const e = normalize(s);
- if (n.indexOf(e) === 0) {
- const r = n.substr(e.length);
- if (r.charAt(0) === "." || r.length === 0) {
- n = r.substr(1);
- const i = t[s];
- return i == null
- ? void (a = !0)
- : n.length
- ? void (t = i)
- : void (a = !0);
- }
- }
- }
- (s = void 0), (a = !0);
- }
- if (s) return t == null ? t : e(t, s, r);
- };
- }
- function n(e, t) {
- return e.hasOwnProperty(t) && delete e[t], e;
- }
- function r(e, t, n) {
- return e.hasOwnProperty(t) && (e[t] = n), e;
- }
- function i(e) {
- return e.replace(/[^a-zA-Z0-9\.]+/g, "").toLowerCase();
- }
- (e.exports = t(function (e, t) {
- if (e.hasOwnProperty(t)) return e[t];
- })),
- (e.exports.find = e.exports),
- (e.exports.replace = function (e, n, i, o) {
- return t(r).call(this, e, n, i, o), e;
- }),
- (e.exports.del = function (e, r, i) {
- return t(n).call(this, e, r, null, i), e;
- });
- });
- const it = (rt.find, rt.replace, rt.del, Object.prototype.toString);
- const ot = function (e) {
- switch (it.call(e)) {
- case "[object Function]":
- return "function";
- case "[object Date]":
- return "date";
- case "[object RegExp]":
- return "regexp";
- case "[object Arguments]":
- return "arguments";
- case "[object Array]":
- return "array";
- case "[object String]":
- return "string";
- }
- return e === null
- ? "null"
- : void 0 === e
- ? "undefined"
- : e && e.nodeType === 1
- ? "element"
- : e === Object(e)
- ? "object"
- : typeof e;
- };
- const st = /\b(Array|Date|Object|Math|JSON)\b/g;
- const at = function (e, t) {
- const n = (function (e) {
- for (var t = [], n = 0; n < e.length; n++)
- ~t.indexOf(e[n]) || t.push(e[n]);
- return t;
- })(
- (function (e) {
- return (
- e
- .replace(/\.\w+|\w+ *\(|"[^"]*"|'[^']*'|\/([^/]+)\//g, "")
- .replace(st, "")
- .match(/[a-zA-Z_]\w*/g) || []
- );
- })(e)
- );
- return (
- t &&
- typeof t === "string" &&
- (t = (function (e) {
- return function (t) {
- return e + t;
- };
- })(t)),
- t
- ? (function (e, t, n) {
- return e.replace(
- /\.\w+|\w+ *\(|"[^"]*"|'[^']*'|\/([^/]+)\/|[a-zA-Z_]\w*/g,
- function (e) {
- return e[e.length - 1] == "(" || ~t.indexOf(e) ? n(e) : e;
- }
- );
- })(e, n, t)
- : n
- );
- };
- try {
- Xe = at;
- } catch (e) {
- Xe = at;
- }
- const ut = ct;
- function ct(e) {
- switch ({}.toString.call(e)) {
- case "[object Object]":
- return (function (e) {
- const t = {};
- for (const n in e)
- t[n] = typeof e[n] === "string" ? lt(e[n]) : ct(e[n]);
- return function (e) {
- if (typeof e !== "object") return !1;
- for (const n in t) {
- if (!(n in e)) return !1;
- if (!t[n](e[n])) return !1;
- }
- return !0;
- };
- })(e);
- case "[object Function]":
- return e;
- case "[object String]":
- return /^ *\W+/.test((n = e))
- ? new Function("_", `return _ ${n}`)
- : new Function(
- "_",
- `return ${(function (e) {
- let t;
- let n;
- let r;
- const i = Xe(e);
- if (!i.length) return `_.${e}`;
- for (n = 0; n < i.length; n++)
- (r = i[n]),
- (e = dt(
- r,
- e,
- (t = `('function' == typeof ${(t = `_.${r}`)} ? ${t}() : ${t})`)
- ));
- return e;
- })(n)}`
- );
- case "[object RegExp]":
- return (
- (t = e),
- function (e) {
- return t.test(e);
- }
- );
- default:
- return lt(e);
- }
- let t;
- let n;
- }
- function lt(e) {
- return function (t) {
- return e === t;
- };
- }
- function dt(e, t, n) {
- return t.replace(new RegExp(`(\\.)?${e}`, "g"), function (e, t) {
- return t ? e : n;
- });
- }
- try {
- var pt = ot;
- } catch (e) {
- pt = ot;
- }
- const ft = Object.prototype.hasOwnProperty;
- const ht = function (e, t, n) {
- switch (((t = ut(t)), (n = n || this), pt(e))) {
- case "array":
- return gt(e, t, n);
- case "object":
- return typeof e.length === "number"
- ? gt(e, t, n)
- : (function (e, t, n) {
- for (const r in e) ft.call(e, r) && t.call(n, r, e[r]);
- })(e, t, n);
- case "string":
- return (function (e, t, n) {
- for (let r = 0; r < e.length; ++r) t.call(n, e.charAt(r), r);
- })(e, t, n);
- }
- };
- function gt(e, t, n) {
- for (let r = 0; r < e.length; ++r) t.call(n, e[r], r);
- }
- const yt = (function () {
- function e(t) {
- n(this, e),
- (this.apiKey = t.apiKey),
- (this.prefixProperties = t.prefixProperties),
- (this.name = "KISSMETRICS");
- }
- return (
- i(e, [
- {
- key: "init",
- value() {
- p("===in init Kissmetrics==="), (window._kmq = window._kmq || []);
- const e = window._kmk || this.apiKey;
- function t(e) {
- setTimeout(function () {
- const t = document;
- const n = t.getElementsByTagName("script")[0];
- const r = t.createElement("script");
- (r.type = "text/javascript"),
- (r.async = !0),
- (r.src = e),
- n.parentNode.insertBefore(r, n);
- }, 1);
- }
- t("//i.kissmetrics.com/i.js"),
- t(`//scripts.kissmetrics.com/${e}.2.js`),
- this.isEnvMobile() &&
- window._kmq.push(["set", { "Mobile Session": "Yes" }]);
- },
- },
- {
- key: "isEnvMobile",
- value() {
- return (
- navigator.userAgent.match(/Android/i) ||
- navigator.userAgent.match(/BlackBerry/i) ||
- navigator.userAgent.match(/IEMobile/i) ||
- navigator.userAgent.match(/Opera Mini/i) ||
- navigator.userAgent.match(/iPad/i) ||
- navigator.userAgent.match(/iPhone|iPod/i)
- );
- },
- },
- {
- key: "toUnixTimestamp",
- value(e) {
- return (e = new Date(e)), Math.floor(e.getTime() / 1e3);
- },
- },
- {
- key: "clean",
- value(e) {
- let t = {};
- for (const n in e)
- if (e.hasOwnProperty(n)) {
- const r = e[n];
- if (r == null) continue;
- if (et.date(r)) {
- t[n] = this.toUnixTimestamp(r);
- continue;
- }
- if (et.bool(r)) {
- t[n] = r;
- continue;
- }
- if (et.number(r)) {
- t[n] = r;
- continue;
- }
- if ((p(r.toString()), r.toString() !== "[object Object]")) {
- t[n] = r.toString();
- continue;
- }
- const i = {};
- i[n] = r;
- const o = this.flatten(i, { safe: !0 });
- for (const s in o) et.array(o[s]) && (o[s] = o[s].toString());
- delete (t = nt(t, o))[n];
- }
- return t;
- },
- },
- {
- key: "flatten",
- value(e, t) {
- const n = (t = t || {}).delimiter || ".";
- let r = t.maxDepth;
- let i = 1;
- const o = {};
- return (
- (function e(s, a) {
- for (const u in s)
- if (s.hasOwnProperty(u)) {
- const c = s[u];
- const l = t.safe && et.array(c);
- const d = Object.prototype.toString.call(c);
- const p = d === "[object Object]" || d === "[object Array]";
- const f = [];
- const h = a ? a + n + u : u;
- for (const g in (t.maxDepth || (r = i + 1), c))
- c.hasOwnProperty(g) && f.push(g);
- if (!l && p && f.length && i < r) return ++i, e(c, h);
- o[h] = c;
- }
- })(e),
- o
- );
- },
- },
- {
- key: "prefix",
- value(e, t) {
- const n = {};
- return (
- ht(t, function (t, r) {
- t === "Billing Amount"
- ? (n[t] = r)
- : t === "revenue"
- ? ((n[`${e} - ${t}`] = r), (n["Billing Amount"] = r))
- : (n[`${e} - ${t}`] = r);
- }),
- n
- );
- },
- },
- {
- key: "identify",
- value(e) {
- p("in Kissmetrics identify");
- const t = this.clean(e.message.context.traits);
- const n =
- e.message.userId && e.message.userId != ""
- ? e.message.userId
- : void 0;
- n && window._kmq.push(["identify", n]),
- t && window._kmq.push(["set", t]);
- },
- },
- {
- key: "track",
- value(e) {
- p("in Kissmetrics track");
- const t = e.message.event;
- let n = JSON.parse(JSON.stringify(e.message.properties));
- const r = this.toUnixTimestamp(new Date());
- const i = I(n);
- i && (n.revenue = i);
- const o = n.products;
- o && delete n.products,
- (n = this.clean(n)),
- p(JSON.stringify(n)),
- this.prefixProperties && (n = this.prefix(t, n)),
- window._kmq.push(["record", t, n]);
- const s = function (e, n) {
- let i = e;
- this.prefixProperties && (i = this.prefix(t, i)),
- (i._t = r + n),
- (i._d = 1),
- window.KM.set(i);
- }.bind(this);
- o &&
- window._kmq.push(function () {
- ht(o, s);
- });
- },
- },
- {
- key: "page",
- value(e) {
- p("in Kissmetrics page");
- const t = e.message.name;
- const n = e.message.properties
- ? e.message.properties.category
- : void 0;
- let r = "Loaded a Page";
- t && (r = `Viewed ${t} page`),
- n && t && (r = `Viewed ${n} ${t} page`);
- let i = e.message.properties;
- this.prefixProperties && (i = this.prefix("Page", i)),
- window._kmq.push(["record", r, i]);
- },
- },
- {
- key: "alias",
- value(e) {
- const t = e.message.previousId;
- const n = e.message.userId;
- window._kmq.push(["alias", n, t]);
- },
- },
- {
- key: "group",
- value(e) {
- const t = e.message.groupId;
- let n = e.message.traits;
- (n = this.prefix("Group", n)),
- t && (n["Group - id"] = t),
- window._kmq.push(["set", n]),
- p("in Kissmetrics group");
- },
- },
- {
- key: "isLoaded",
- value() {
- return et.object(window.KM);
- },
- },
- {
- key: "isReady",
- value() {
- return et.object(window.KM);
- },
- },
- ]),
- e
- );
- })();
- const mt = (function () {
- function e(t) {
- n(this, e),
- (this.siteID = t.siteID),
- (this.apiKey = t.apiKey),
- (this.name = "CUSTOMERIO");
- }
- return (
- i(e, [
- {
- key: "init",
- value() {
- p("===in init Customer IO init==="),
- (window._cio = window._cio || []);
- const e = this.siteID;
- !(function () {
- let t;
- let n;
- let r;
- for (
- t = function (e) {
- return function () {
- window._cio.push(
- [e].concat(Array.prototype.slice.call(arguments, 0))
- );
- };
- },
- n = ["load", "identify", "sidentify", "track", "page"],
- r = 0;
- r < n.length;
- r++
- )
- window._cio[n[r]] = t(n[r]);
- const i = document.createElement("script");
- const o = document.getElementsByTagName("script")[0];
- (i.async = !0),
- (i.id = "cio-tracker"),
- i.setAttribute("data-site-id", e),
- (i.src = "https://assets.customer.io/assets/track.js"),
- o.parentNode.insertBefore(i, o);
- })();
- },
- },
- {
- key: "identify",
- value(e) {
- p("in Customer IO identify");
- const t = e.message.userId
- ? e.message.userId
- : e.message.anonymousId;
- const n = e.message.context.traits ? e.message.context.traits : {};
- n.created_at ||
- (n.created_at = Math.floor(new Date().getTime() / 1e3)),
- (n.id = t),
- window._cio.identify(n);
- },
- },
- {
- key: "track",
- value(e) {
- p("in Customer IO track");
- const t = e.message.event;
- const n = e.message.properties;
- window._cio.track(t, n);
- },
- },
- {
- key: "page",
- value(e) {
- p("in Customer IO page");
- const t = e.message.name || e.message.properties.url;
- window._cio.page(t, e.message.properties);
- },
- },
- {
- key: "isLoaded",
- value() {
- return !(!window._cio || window._cio.push === Array.prototype.push);
- },
- },
- {
- key: "isReady",
- value() {
- return !(!window._cio || window._cio.push === Array.prototype.push);
- },
- },
- ]),
- e
- );
- })();
- let vt = !1;
- const bt = [];
- var wt = setInterval(function () {
- document.body && ((vt = !0), ht(bt, kt), clearInterval(wt));
- }, 5);
- function kt(e) {
- e(document.body);
- }
- for (
- var It = (function () {
- function e(t, r) {
- n(this, e),
- (this.analytics = r),
- (this._sf_async_config = window._sf_async_config =
- window._sf_async_config || {}),
- (window._sf_async_config.useCanonical = !0),
- (window._sf_async_config.uid = t.uid),
- (window._sf_async_config.domain = t.domain),
- (this.isVideo = !!t.video),
- (this.sendNameAndCategoryAsTitle =
- t.sendNameAndCategoryAsTitle || !0),
- (this.subscriberEngagementKeys = t.subscriberEngagementKeys || []),
- (this.replayEvents = []),
- (this.failed = !1),
- (this.isFirstPageCallMade = !1),
- (this.name = "CHARTBEAT");
- }
- return (
- i(e, [
- {
- key: "init",
- value() {
- p("===in init Chartbeat===");
- },
- },
- {
- key: "identify",
- value(e) {
- p("in Chartbeat identify");
- },
- },
- {
- key: "track",
- value(e) {
- p("in Chartbeat track");
- },
- },
- {
- key: "page",
- value(e) {
- if (
- (p("in Chartbeat page"),
- this.loadConfig(e),
- this.isFirstPageCallMade)
- ) {
- if (this.failed)
- return (
- p("===ignoring cause failed integration==="),
- void (this.replayEvents = [])
- );
- if (!this.isLoaded() && !this.failed)
- return (
- p("===pushing to replay queue for chartbeat==="),
- void this.replayEvents.push(["page", e])
- );
- p("===processing page event in chartbeat===");
- const t = e.message.properties;
- window.pSUPERFLY.virtualPage(t.path);
- } else (this.isFirstPageCallMade = !0), this.initAfterPage();
- },
- },
- {
- key: "isLoaded",
- value() {
- return (
- p("in Chartbeat isLoaded"),
- !this.isFirstPageCallMade || !!window.pSUPERFLY
- );
- },
- },
- {
- key: "isFailed",
- value() {
- return this.failed;
- },
- },
- {
- key: "isReady",
- value() {
- return !!window.pSUPERFLY;
- },
- },
- {
- key: "loadConfig",
- value(e) {
- let t;
- const n = e.message.properties;
- const r = n ? n.category : void 0;
- const i = e.message.name;
- const o = n ? n.author : void 0;
- this.sendNameAndCategoryAsTitle &&
- (t = r && i ? `${r} ${i}` : i),
- r && (window._sf_async_config.sections = r),
- o && (window._sf_async_config.authors = o),
- t && (window._sf_async_config.title = t);
- const s = (window._cbq = window._cbq || []);
- for (const a in n)
- n.hasOwnProperty(a) &&
- this.subscriberEngagementKeys.indexOf(a) > -1 &&
- s.push([a, n[a]]);
- },
- },
- {
- key: "initAfterPage",
- value() {
- let e;
- const t = this;
- (e = function () {
- let e;
- let n;
- const r = t.isVideo ? "chartbeat_video.js" : "chartbeat.js";
- (e = document.createElement("script")),
- (n = document.getElementsByTagName("script")[0]),
- (e.type = "text/javascript"),
- (e.async = !0),
- (e.src = `//static.chartbeat.com/js/${r}`),
- n.parentNode.insertBefore(e, n);
- }),
- vt ? kt(e) : bt.push(e),
- this._isReady(this).then(function (e) {
- p("===replaying on chartbeat==="),
- e.replayEvents.forEach(function (t) {
- e[t[0]](t[1]);
- });
- });
- },
- },
- {
- key: "pause",
- value(e) {
- return new Promise(function (t) {
- setTimeout(t, e);
- });
- },
- },
- {
- key: "_isReady",
- value(e) {
- const t = this;
- const n =
- arguments.length > 1 && void 0 !== arguments[1]
- ? arguments[1]
- : 0;
- return new Promise(function (r) {
- return t.isLoaded()
- ? ((t.failed = !1),
- p("===chartbeat loaded successfully==="),
- e.analytics.emit("ready"),
- r(e))
- : n >= 1e4
- ? ((t.failed = !0), p("===chartbeat failed==="), r(e))
- : void t.pause(1e3).then(function () {
- return t._isReady(e, n + 1e3).then(r);
- });
- });
- },
- },
- ]),
- e
- );
- })(),
- _t = (function () {
- function e(t, r) {
- n(this, e),
- (this.c2ID = t.c2ID),
- (this.analytics = r),
- (this.comScoreBeaconParam = t.comScoreBeaconParam
- ? t.comScoreBeaconParam
- : {}),
- (this.isFirstPageCallMade = !1),
- (this.failed = !1),
- (this.comScoreParams = {}),
- (this.replayEvents = []),
- (this.name = "COMSCORE");
- }
- return (
- i(e, [
- {
- key: "init",
- value() {
- p("===in init Comscore init===");
- },
- },
- {
- key: "identify",
- value(e) {
- p("in Comscore identify");
- },
- },
- {
- key: "track",
- value(e) {
- p("in Comscore track");
- },
- },
- {
- key: "page",
- value(e) {
- if (
- (p("in Comscore page"),
- this.loadConfig(e),
- this.isFirstPageCallMade)
- ) {
- if (this.failed) return void (this.replayEvents = []);
- if (!this.isLoaded() && !this.failed)
- return void this.replayEvents.push(["page", e]);
- e.message.properties;
- window.COMSCORE.beacon(this.comScoreParams);
- } else (this.isFirstPageCallMade = !0), this.initAfterPage();
- },
- },
- {
- key: "loadConfig",
- value(e) {
- p("=====in loadConfig====="),
- (this.comScoreParams = this.mapComscoreParams(
- e.message.properties
- )),
- (window._comscore = window._comscore || []),
- window._comscore.push(this.comScoreParams);
- },
- },
- {
- key: "initAfterPage",
- value() {
- p("=====in initAfterPage====="),
- (function () {
- const e = document.createElement("script");
- const t = document.getElementsByTagName("script")[0];
- (e.async = !0),
- (e.src = `${
- document.location.protocol == "https:"
- ? "https://sb"
- : "http://b"
- }.scorecardresearch.com/beacon.js`),
- t.parentNode.insertBefore(e, t);
- })(),
- this._isReady(this).then(function (e) {
- e.replayEvents.forEach(function (t) {
- e[t[0]](t[1]);
- });
- });
- },
- },
- {
- key: "pause",
- value(e) {
- return new Promise(function (t) {
- setTimeout(t, e);
- });
- },
- },
- {
- key: "_isReady",
- value(e) {
- const t = this;
- const n =
- arguments.length > 1 && void 0 !== arguments[1]
- ? arguments[1]
- : 0;
- return new Promise(function (r) {
- return t.isLoaded()
- ? ((t.failed = !1), e.analytics.emit("ready"), r(e))
- : n >= 1e4
- ? ((t.failed = !0), r(e))
- : void t.pause(1e3).then(function () {
- return t._isReady(e, n + 1e3).then(r);
- });
- });
- },
- },
- {
- key: "mapComscoreParams",
- value(e) {
- p("=====in mapComscoreParams=====");
- const t = this.comScoreBeaconParam;
- const n = {};
- return (
- Object.keys(t).forEach(function (r) {
- if ((r in e)) {
- const i = t[r];
- const o = e[r];
- n[i] = o;
- }
- }),
- (n.c1 = "2"),
- (n.c2 = this.c2ID),
- p("=====in mapComscoreParams=====", n),
- n
- );
- },
- },
- {
- key: "isLoaded",
- value() {
- return (
- p("in Comscore isLoaded"),
- !this.isFirstPageCallMade || !!window.COMSCORE
- );
- },
- },
- {
- key: "isReady",
- value() {
- return !!window.COMSCORE;
- },
- },
- ]),
- e
- );
- })(),
- Et = Object.prototype.hasOwnProperty,
- At = String.prototype.charAt,
- Ct = Object.prototype.toString,
- Tt = function (e, t) {
- return At.call(e, t);
- },
- Ot = function (e, t) {
- return Et.call(e, t);
- },
- St = function (e, t) {
- t = t || Ot;
- for (var n = [], r = 0, i = e.length; r < i; r += 1)
- t(e, r) && n.push(String(r));
- return n;
- },
- Pt = function (e) {
- return e == null
- ? []
- : ((t = e),
- Ct.call(t) === "[object String]"
- ? St(e, Tt)
- : (function (e) {
- return (
- e != null &&
- typeof e !== "function" &&
- typeof e.length === "number"
- );
- })(e)
- ? St(e, Ot)
- : (function (e, t) {
- t = t || Ot;
- const n = [];
- for (const r in e) t(e, r) && n.push(String(r));
- return n;
- })(e));
- let t;
- },
- xt = Object.prototype.toString,
- Rt =
- typeof Array.isArray === "function"
- ? Array.isArray
- : function (e) {
- return xt.call(e) === "[object Array]";
- },
- jt = function (e) {
- return (
- e != null &&
- (Rt(e) ||
- (e !== "function" &&
- (function (e) {
- const t = typeof e;
- return (
- t === "number" ||
- (t === "object" && xt.call(e) === "[object Number]")
- );
- })(e.length)))
- );
- },
- Dt = function (e, t) {
- for (let n = 0; n < t.length && !1 !== e(t[n], n, t); n += 1);
- },
- Ut = function (e, t) {
- for (
- let n = Pt(t), r = 0;
- r < n.length && !1 !== e(t[n[r]], n[r], t);
- r += 1
- );
- },
- Lt = function (e, t) {
- return (jt(t) ? Dt : Ut).call(this, e, t);
- },
- Mt = (function () {
- function e(t) {
- n(this, e),
- (this.blacklistPiiProperties = t.blacklistPiiProperties),
- (this.categoryToContent = t.categoryToContent),
- (this.pixelId = t.pixelId),
- (this.eventsToEvents = t.eventsToEvents),
- (this.eventCustomProperties = t.eventCustomProperties),
- (this.valueFieldIdentifier = t.valueFieldIdentifier),
- (this.advancedMapping = t.advancedMapping),
- (this.traitKeyToExternalId = t.traitKeyToExternalId),
- (this.legacyConversionPixelId = t.legacyConversionPixelId),
- (this.userIdAsPixelId = t.userIdAsPixelId),
- (this.whitelistPiiProperties = t.whitelistPiiProperties),
- (this.name = "FB_PIXEL");
- }
- return (
- i(e, [
- {
- key: "init",
- value() {
- void 0 === this.categoryToContent &&
- (this.categoryToContent = []),
- void 0 === this.legacyConversionPixelId &&
- (this.legacyConversionPixelId = []),
- void 0 === this.userIdAsPixelId &&
- (this.userIdAsPixelId = []),
- p("===in init FbPixel==="),
- (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.disablePushState = !0),
- (window.fbq.allowDuplicatePageViews = !0),
- (window.fbq.version = "2.0"),
- (window.fbq.queue = []),
- window.fbq("init", this.pixelId),
- T(
- "fbpixel-integration",
- "//connect.facebook.net/en_US/fbevents.js"
- );
- },
- },
- {
- key: "isLoaded",
- value() {
- return (
- p("in FBPixel isLoaded"),
- !(!window.fbq || !window.fbq.callMethod)
- );
- },
- },
- {
- key: "isReady",
- value() {
- return (
- p("in FBPixel isReady"),
- !(!window.fbq || !window.fbq.callMethod)
- );
- },
- },
- {
- key: "page",
- value(e) {
- window.fbq("track", "PageView");
- },
- },
- {
- key: "identify",
- value(e) {
- this.advancedMapping &&
- window.fbq("init", this.pixelId, e.message.context.traits);
- },
- },
- {
- key: "track",
- value(e) {
- const t = this;
- const n = this;
- const r = e.message.event;
- let i = this.formatRevenue(e.message.properties.revenue);
- const o = this.buildPayLoad(e, !0);
- void 0 === this.categoryToContent &&
- (this.categoryToContent = []),
- void 0 === this.legacyConversionPixelId &&
- (this.legacyConversionPixelId = []),
- void 0 === this.userIdAsPixelId &&
- (this.userIdAsPixelId = []),
- (o.value = i);
- let s;
- let a;
- const u = this.eventsToEvents;
- const c = this.legacyConversionPixelId;
- if (
- ((s = u.reduce(function (e, t) {
- return t.from === r && e.push(t.to), e;
- }, [])),
- (a = c.reduce(function (e, t) {
- return t.from === r && e.push(t.to), e;
- }, [])),
- Lt(function (t) {
- (o.currency = e.message.properties.currency || "USD"),
- window.fbq("trackSingle", n.pixelId, t, o, {
- eventID: e.message.messageId,
- });
- }, s),
- Lt(function (t) {
- window.fbq(
- "trackSingle",
- n.pixelId,
- t,
- { currency: e.message.properties.currency, value: i },
- { eventID: e.message.messageId }
- );
- }, a),
- r === "Product List Viewed")
- ) {
- var l = [];
- var d = e.message.properties.products;
- var p = this.buildPayLoad(e, !0);
- Array.isArray(d) &&
- d.forEach(function (t) {
- const n = t.product_id;
- n &&
- (g.push(n),
- l.push({
- id: n,
- quantity: e.message.properties.quantity,
- }));
- }),
- g.length
- ? (h = ["product"])
- : (g.push(e.message.properties.category || ""),
- l.push({
- id: e.message.properties.category || "",
- quantity: 1,
- }),
- (h = ["product_group"])),
- window.fbq(
- "trackSingle",
- n.pixelId,
- "ViewContent",
- this.merge(
- {
- content_ids: g,
- content_type: this.getContentType(e, h),
- contents: l,
- },
- p
- ),
- { eventID: e.message.messageId }
- ),
- Lt(function (r) {
- window.fbq(
- "trackSingle",
- n.pixelId,
- r,
- {
- currency: e.message.properties.currency,
- value: t.formatRevenue(e.message.properties.revenue),
- },
- { eventID: e.message.messageId }
- );
- }, a);
- } else if (r === "Product Viewed") {
- var f = this.valueFieldIdentifier === "properties.value";
- p = this.buildPayLoad(e, !0);
- window.fbq(
- "trackSingle",
- n.pixelId,
- "ViewContent",
- this.merge(
- {
- content_ids: [
- e.message.properties.product_id ||
- e.message.properties.id ||
- e.message.properties.sku ||
- "",
- ],
- content_type: this.getContentType(e, ["product"]),
- content_name: e.message.properties.product_name || "",
- content_category: e.message.properties.category || "",
- currency: e.message.properties.currency,
- value: f
- ? this.formatRevenue(e.message.properties.value)
- : this.formatRevenue(e.message.properties.price),
- contents: [
- {
- id:
- e.message.properties.product_id ||
- e.message.properties.id ||
- e.message.properties.sku ||
- "",
- quantity: e.message.properties.quantity,
- item_price: e.message.properties.price,
- },
- ],
- },
- p
- ),
- { eventID: e.message.messageId }
- ),
- Lt(function (r) {
- window.fbq(
- "trackSingle",
- n.pixelId,
- r,
- {
- currency: e.message.properties.currency,
- value: f
- ? t.formatRevenue(e.message.properties.value)
- : t.formatRevenue(e.message.properties.price),
- },
- { eventID: e.message.messageId }
- );
- }, a);
- } else if (r === "Product Added") {
- (f = this.valueFieldIdentifier === "properties.value"),
- (p = this.buildPayLoad(e, !0));
- window.fbq(
- "trackSingle",
- n.pixelId,
- "AddToCart",
- this.merge(
- {
- content_ids: [
- e.message.properties.product_id ||
- e.message.properties.id ||
- e.message.properties.sku ||
- "",
- ],
- content_type: this.getContentType(e, ["product"]),
- content_name: e.message.properties.product_name || "",
- content_category: e.message.properties.category || "",
- currency: e.message.properties.currency,
- value: f
- ? this.formatRevenue(e.message.properties.value)
- : this.formatRevenue(e.message.properties.price),
- contents: [
- {
- id:
- e.message.properties.product_id ||
- e.message.properties.id ||
- e.message.properties.sku ||
- "",
- quantity: e.message.properties.quantity,
- item_price: e.message.properties.price,
- },
- ],
- },
- p
- ),
- { eventID: e.message.messageId }
- ),
- Lt(function (r) {
- window.fbq(
- "trackSingle",
- n.pixelId,
- r,
- {
- currency: e.message.properties.currency,
- value: f
- ? t.formatRevenue(e.message.properties.value)
- : t.formatRevenue(e.message.properties.price),
- },
- { eventID: e.message.messageId }
- );
- }, a),
- this.merge(
- {
- content_ids: [
- e.message.properties.product_id ||
- e.message.properties.id ||
- e.message.properties.sku ||
- "",
- ],
- content_type: this.getContentType(e, ["product"]),
- content_name: e.message.properties.product_name || "",
- content_category: e.message.properties.category || "",
- currency: e.message.properties.currency,
- value: f
- ? this.formatRevenue(e.message.properties.value)
- : this.formatRevenue(e.message.properties.price),
- contents: [
- {
- id:
- e.message.properties.product_id ||
- e.message.properties.id ||
- e.message.properties.sku ||
- "",
- quantity: e.message.properties.quantity,
- item_price: e.message.properties.price,
- },
- ],
- },
- p
- );
- } else if (r === "Order Completed") {
- (d = e.message.properties.products),
- (p = this.buildPayLoad(e, !0)),
- (i = this.formatRevenue(e.message.properties.revenue));
- for (
- var h = this.getContentType(e, ["product"]),
- g = [],
- y = ((l = []), 0);
- y < d.length;
- y++
- ) {
- var m = product.product_id;
- g.push(m);
- var v = { id: m, quantity: e.message.properties.quantity };
- e.message.properties.price &&
- (v.item_price = e.message.properties.price),
- l.push(v);
- }
- window.fbq(
- "trackSingle",
- n.pixelId,
- "Purchase",
- this.merge(
- {
- content_ids: g,
- content_type: h,
- currency: e.message.properties.currency,
- value: i,
- contents: l,
- num_items: g.length,
- },
- p
- ),
- { eventID: e.message.messageId }
- ),
- Lt(function (r) {
- window.fbq(
- "trackSingle",
- n.pixelId,
- r,
- {
- currency: e.message.properties.currency,
- value: t.formatRevenue(e.message.properties.revenue),
- },
- { eventID: e.message.messageId }
- );
- }, a);
- } else if (r === "Products Searched") {
- p = this.buildPayLoad(e, !0);
- window.fbq(
- "trackSingle",
- n.pixelId,
- "Search",
- this.merge(
- { search_string: e.message.properties.query },
- p
- ),
- { eventID: e.message.messageId }
- ),
- Lt(function (t) {
- window.fbq(
- "trackSingle",
- n.pixelId,
- t,
- {
- currency: e.message.properties.currency,
- value: formatRevenue(e.message.properties.revenue),
- },
- { eventID: e.message.messageId }
- );
- }, a);
- } else if (r === "Checkout Started") {
- (d = e.message.properties.products),
- (p = this.buildPayLoad(e, !0)),
- (i = this.formatRevenue(e.message.properties.revenue));
- let b = e.message.properties.category;
- for (g = [], l = [], y = 0; y < d.length; y++) {
- m = d[y].product_id;
- g.push(m);
- v = {
- id: m,
- quantity: e.message.properties.quantity,
- item_price: e.message.properties.price,
- };
- e.message.properties.price &&
- (v.item_price = e.message.properties.price),
- l.push(v);
- }
- !b && d[0] && d[0].category && (b = d[0].category),
- window.fbq(
- "trackSingle",
- n.pixelId,
- "InitiateCheckout",
- this.merge(
- {
- content_category: b,
- content_ids: g,
- content_type: this.getContentType(e, ["product"]),
- currency: e.message.properties.currency,
- value: i,
- contents: l,
- num_items: g.length,
- },
- p
- ),
- { eventID: e.message.messageId }
- ),
- Lt(function (r) {
- window.fbq(
- "trackSingle",
- n.pixelId,
- r,
- {
- currency: e.message.properties.currency,
- value: t.formatRevenue(e.message.properties.revenue),
- },
- { eventID: e.message.messageId }
- );
- }, a);
- }
- },
- },
- {
- key: "getContentType",
- value(e, t) {
- const n = e.message.options;
- if (n && n.contentType) return [n.contentType];
- let r;
- let i = e.message.properties.category;
- if (!i) {
- const o = e.message.properties.products;
- o && o.length && (i = o[0].category);
- }
- if (
- i &&
- (r = this.categoryToContent.reduce(function (e, t) {
- return t.from == i && e.push(t.to), e;
- }, [])).length
- )
- return r;
- return t;
- },
- },
- {
- key: "merge",
- value(e, t) {
- const n = {};
- for (const r in e) e.hasOwnProperty(r) && (n[r] = e[r]);
- for (const i in t)
- t.hasOwnProperty(i) && !n.hasOwnProperty(i) && (n[i] = t[i]);
- return n;
- },
- },
- {
- key: "formatRevenue",
- value(e) {
- return Number(e || 0).toFixed(2);
- },
- },
- {
- key: "buildPayLoad",
- value(e, t) {
- for (
- var n = [
- "checkinDate",
- "checkoutDate",
- "departingArrivalDate",
- "departingDepartureDate",
- "returningArrivalDate",
- "returningDepartureDate",
- "travelEnd",
- "travelStart",
- ],
- r = [
- "email",
- "firstName",
- "lastName",
- "gender",
- "city",
- "country",
- "phone",
- "state",
- "zip",
- "birthday",
- ],
- i = this.whitelistPiiProperties || [],
- o = this.blacklistPiiProperties || [],
- s = this.eventCustomProperties || [],
- a = {},
- u = 0;
- u < o[u];
- u++
- ) {
- const c = o[u];
- a[c.blacklistPiiProperties] = c.blacklistPiiHash;
- }
- const l = {};
- const d = e.message.properties;
- for (const p in d)
- if (d.hasOwnProperty(p) && !(t && s.indexOf(p) < 0)) {
- const f = d[p];
- if (n.indexOf(d) >= 0 && et.date(f))
- l[p] = f.toISOTring().split("T")[0];
- else if (a.hasOwnProperty(p))
- a[p] && typeof f === "string" && (l[p] = sha256(f));
- else {
- const h = r.indexOf(p) >= 0;
- const g = i.indexOf(p) >= 0;
- (h && !g) || (l[p] = f);
- }
- }
- return l;
- },
- },
- ]),
- e
- );
- })(),
- Nt = "lt_synch_timestamp",
- Bt = new ((function () {
- function e() {
- n(this, e), (this.storage = Oe);
- }
- return (
- i(e, [
- {
- key: "setLotameSynchTime",
- value(e) {
- this.storage.setItem(Nt, e);
- },
- },
- {
- key: "getLotameSynchTime",
- value() {
- return this.storage.getItem(Nt);
- },
- },
- ]),
- e
- );
- })())(),
- qt = {
- HS: O,
- GA: Se,
- HOTJAR: Pe,
- GOOGLEADS: xe,
- VWO: Re,
- GTM: je,
- BRAZE: De,
- INTERCOM: Ge,
- KEEN: He,
- KISSMETRICS: yt,
- CUSTOMERIO: mt,
- CHARTBEAT: It,
- COMSCORE: _t,
- FACEBOOK_PIXEL: Mt,
- LOTAME: (function () {
- function e(t, r) {
- const i = this;
- n(this, e),
- (this.name = "LOTAME"),
- (this.analytics = r),
- (this.storage = Bt),
- (this.bcpUrlSettingsPixel = t.bcpUrlSettingsPixel),
- (this.bcpUrlSettingsIframe = t.bcpUrlSettingsIframe),
- (this.dspUrlSettingsPixel = t.dspUrlSettingsPixel),
- (this.dspUrlSettingsIframe = t.dspUrlSettingsIframe),
- (this.mappings = {}),
- t.mappings.forEach(function (e) {
- const t = e.key;
- const n = e.value;
- i.mappings[t] = n;
- });
- }
- return (
- i(e, [
- {
- key: "init",
- value() {
- p("===in init Lotame==="),
- (window.LOTAME_SYNCH_CALLBACK = function () {});
- },
- },
- {
- key: "addPixel",
- value(e, t, n) {
- p(`Adding pixel for :: ${e}`);
- const r = document.createElement("img");
- (r.src = e),
- r.setAttribute("width", t),
- r.setAttribute("height", n),
- p(`Image Pixel :: ${r}`),
- document.getElementsByTagName("body")[0].appendChild(r);
- },
- },
- {
- key: "addIFrame",
- value(e) {
- p(`Adding iframe for :: ${e}`);
- const t = document.createElement("iframe");
- (t.src = e),
- (t.title = "empty"),
- t.setAttribute("id", "LOTCCFrame"),
- t.setAttribute("tabindex", "-1"),
- t.setAttribute("role", "presentation"),
- t.setAttribute("aria-hidden", "true"),
- t.setAttribute(
- "style",
- "border: 0px; width: 0px; height: 0px; display: block;"
- ),
- p(`IFrame :: ${t}`),
- document.getElementsByTagName("body")[0].appendChild(t);
- },
- },
- {
- key: "syncPixel",
- value(e) {
- const t = this;
- if (
- (p("===== in syncPixel ======"),
- p("Firing DSP Pixel URLs"),
- this.dspUrlSettingsPixel &&
- this.dspUrlSettingsPixel.length > 0)
- ) {
- const n = Date.now();
- this.dspUrlSettingsPixel.forEach(function (r) {
- const i = t.compileUrl(
- a({}, t.mappings, { userId: e, random: n }),
- r.dspUrlTemplate
- );
- t.addPixel(i, "1", "1");
- });
- }
- if (
- (p("Firing DSP IFrame URLs"),
- this.dspUrlSettingsIframe &&
- this.dspUrlSettingsIframe.length > 0)
- ) {
- const r = Date.now();
- this.dspUrlSettingsIframe.forEach(function (n) {
- const i = t.compileUrl(
- a({}, t.mappings, { userId: e, random: r }),
- n.dspUrlTemplate
- );
- t.addIFrame(i);
- });
- }
- this.storage.setLotameSynchTime(Date.now()),
- this.analytics.methodToCallbackMapping.syncPixel &&
- this.analytics.emit("syncPixel", {
- destination: this.name,
- });
- },
- },
- {
- key: "compileUrl",
- value(e, t) {
- return (
- Object.keys(e).forEach(function (n) {
- if (e.hasOwnProperty(n)) {
- const r = new RegExp(`{{${n}}}`, "gi");
- t = t.replace(r, e[n]);
- }
- }),
- t
- );
- },
- },
- {
- key: "identify",
- value(e) {
- p("in Lotame identify");
- const t = e.message.userId;
- this.syncPixel(t);
- },
- },
- {
- key: "track",
- value(e) {
- p("track not supported for lotame");
- },
- },
- {
- key: "page",
- value(e) {
- const t = this;
- if (
- (p("in Lotame page"),
- p("Firing BCP Pixel URLs"),
- this.bcpUrlSettingsPixel &&
- this.bcpUrlSettingsPixel.length > 0)
- ) {
- const n = Date.now();
- this.bcpUrlSettingsPixel.forEach(function (e) {
- const r = t.compileUrl(
- a({}, t.mappings, { random: n }),
- e.bcpUrlTemplate
- );
- t.addPixel(r, "1", "1");
- });
- }
- if (
- (p("Firing BCP IFrame URLs"),
- this.bcpUrlSettingsIframe &&
- this.bcpUrlSettingsIframe.length > 0)
- ) {
- const r = Date.now();
- this.bcpUrlSettingsIframe.forEach(function (e) {
- const n = t.compileUrl(
- a({}, t.mappings, { random: r }),
- e.bcpUrlTemplate
- );
- t.addIFrame(n);
- });
- }
- e.message.userId &&
- this.isPixelToBeSynched() &&
- this.syncPixel(e.message.userId);
- },
- },
- {
- key: "isPixelToBeSynched",
- value() {
- const e = this.storage.getLotameSynchTime();
- const t = Date.now();
- return !e || Math.floor((t - e) / 864e5) >= 7;
- },
- },
- {
- key: "isLoaded",
- value() {
- return p("in Lotame isLoaded"), !0;
- },
- },
- {
- key: "isReady",
- value() {
- return !0;
- },
- },
- ]),
- e
- );
- })(),
- },
- Ft = function e() {
- n(this, e),
- (this.build = "1.0.0"),
- (this.name = "RudderLabs JavaScript SDK"),
- (this.namespace = "com.rudderlabs.javascript"),
- (this.version = "1.1.2");
- },
- Kt = function e() {
- n(this, e),
- (this.name = "RudderLabs JavaScript SDK"),
- (this.version = "1.1.2");
- },
- Gt = function e() {
- n(this, e), (this.name = ""), (this.version = "");
- },
- Ht = function e() {
- n(this, e), (this.density = 0), (this.width = 0), (this.height = 0);
- },
- Vt = function e() {
- n(this, e),
- (this.app = new Ft()),
- (this.traits = null),
- (this.library = new Kt());
- const t = new Gt();
- t.version = "";
- const r = new Ht();
- (r.width = window.width),
- (r.height = window.height),
- (r.density = window.devicePixelRatio),
- (this.userAgent = navigator.userAgent),
- (this.locale = navigator.language || navigator.browserLanguage),
- (this.os = t),
- (this.screen = r),
- (this.device = null),
- (this.network = null);
- },
- zt = (function () {
- function e() {
- n(this, e),
- (this.channel = "web"),
- (this.context = new Vt()),
- (this.type = null),
- (this.action = null),
- (this.messageId = m().toString()),
- (this.originalTimestamp = new Date().toISOString()),
- (this.anonymousId = null),
- (this.userId = null),
- (this.event = null),
- (this.properties = {}),
- (this.integrations = {}),
- (this.integrations.All = !0);
- }
- return (
- i(e, [
- {
- key: "getProperty",
- value(e) {
- return this.properties[e];
- },
- },
- {
- key: "addProperty",
- value(e, t) {
- this.properties[e] = t;
- },
- },
- {
- key: "validateFor",
- value(e) {
- if (!this.properties)
- throw new Error("Key properties is required");
- switch (e) {
- case A.TRACK:
- if (!this.event)
- throw new Error("Key event is required for track event");
- if ((this.event in Object.values(C)))
- switch (this.event) {
- case C.CHECKOUT_STEP_VIEWED:
- case C.CHECKOUT_STEP_COMPLETED:
- case C.PAYMENT_INFO_ENTERED:
- this.checkForKey("checkout_id"),
- this.checkForKey("step");
- break;
- case C.PROMOTION_VIEWED:
- case C.PROMOTION_CLICKED:
- this.checkForKey("promotion_id");
- break;
- case C.ORDER_REFUNDED:
- this.checkForKey("order_id");
- }
- else
- this.properties.category ||
- (this.properties.category = this.event);
- break;
- case A.PAGE:
- break;
- case A.SCREEN:
- if (!this.properties.name)
- throw new Error("Key 'name' is required in properties");
- }
- },
- },
- {
- key: "checkForKey",
- value(e) {
- if (!this.properties[e])
- throw new Error(`Key '${e}' is required in properties`);
- },
- },
- ]),
- e
- );
- })(),
- Jt = (function () {
- function e() {
- n(this, e), (this.message = new zt());
- }
- return (
- i(e, [
- {
- key: "setType",
- value(e) {
- this.message.type = e;
- },
- },
- {
- key: "setProperty",
- value(e) {
- this.message.properties = e;
- },
- },
- {
- key: "setUserProperty",
- value(e) {
- this.message.user_properties = e;
- },
- },
- {
- key: "setUserId",
- value(e) {
- this.message.userId = e;
- },
- },
- {
- key: "setEventName",
- value(e) {
- this.message.event = e;
- },
- },
- {
- key: "updateTraits",
- value(e) {
- this.message.context.traits = e;
- },
- },
- {
- key: "getElementContent",
- value() {
- return this.message;
- },
- },
- ]),
- e
- );
- })(),
- Wt = (function () {
- function e() {
- n(this, e),
- (this.rudderProperty = null),
- (this.rudderUserProperty = null),
- (this.event = null),
- (this.userId = null),
- (this.channel = null),
- (this.type = null);
- }
- return (
- i(e, [
- {
- key: "setProperty",
- value(e) {
- return (this.rudderProperty = e), this;
- },
- },
- {
- key: "setPropertyBuilder",
- value(e) {
- return (this.rudderProperty = e.build()), this;
- },
- },
- {
- key: "setUserProperty",
- value(e) {
- return (this.rudderUserProperty = e), this;
- },
- },
- {
- key: "setUserPropertyBuilder",
- value(e) {
- return (this.rudderUserProperty = e.build()), this;
- },
- },
- {
- key: "setEvent",
- value(e) {
- return (this.event = e), this;
- },
- },
- {
- key: "setUserId",
- value(e) {
- return (this.userId = e), this;
- },
- },
- {
- key: "setChannel",
- value(e) {
- return (this.channel = e), this;
- },
- },
- {
- key: "setType",
- value(e) {
- return (this.type = e), this;
- },
- },
- {
- key: "build",
- value() {
- const e = new Jt();
- return (
- e.setUserId(this.userId),
- e.setType(this.type),
- e.setEventName(this.event),
- e.setProperty(this.rudderProperty),
- e.setUserProperty(this.rudderUserProperty),
- e
- );
- },
- },
- ]),
- e
- );
- })(),
- $t = function e() {
- n(this, e), (this.batch = null), (this.writeKey = null);
- },
- Yt = R(function (e) {
- const t =
- (typeof crypto !== "undefined" &&
- crypto.getRandomValues &&
- crypto.getRandomValues.bind(crypto)) ||
- (typeof msCrypto !== "undefined" &&
- typeof window.msCrypto.getRandomValues === "function" &&
- msCrypto.getRandomValues.bind(msCrypto));
- if (t) {
- const n = new Uint8Array(16);
- e.exports = function () {
- return t(n), n;
- };
- } else {
- const r = new Array(16);
- e.exports = function () {
- for (var e, t = 0; t < 16; t++)
- (3 & t) == 0 && (e = 4294967296 * Math.random()),
- (r[t] = (e >>> ((3 & t) << 3)) & 255);
- return r;
- };
- }
- }),
- Qt = [],
- Zt = 0;
- Zt < 256;
- ++Zt
- )
- Qt[Zt] = (Zt + 256).toString(16).substr(1);
- let Xt;
- let en;
- const tn = function (e, t) {
- let n = t || 0;
- const r = Qt;
- return [
- r[e[n++]],
- r[e[n++]],
- r[e[n++]],
- r[e[n++]],
- "-",
- r[e[n++]],
- r[e[n++]],
- "-",
- r[e[n++]],
- r[e[n++]],
- "-",
- r[e[n++]],
- r[e[n++]],
- "-",
- r[e[n++]],
- r[e[n++]],
- r[e[n++]],
- r[e[n++]],
- r[e[n++]],
- r[e[n++]],
- ].join("");
- };
- let nn = 0;
- let rn = 0;
- const on = function (e, t, n) {
- let r = (t && n) || 0;
- const i = t || [];
- let o = (e = e || {}).node || Xt;
- let s = void 0 !== e.clockseq ? e.clockseq : en;
- if (o == null || s == null) {
- const a = Yt();
- o == null && (o = Xt = [1 | a[0], a[1], a[2], a[3], a[4], a[5]]),
- s == null && (s = en = 16383 & ((a[6] << 8) | a[7]));
- }
- let u = void 0 !== e.msecs ? e.msecs : new Date().getTime();
- let c = void 0 !== e.nsecs ? e.nsecs : rn + 1;
- const l = u - nn + (c - rn) / 1e4;
- if (
- (l < 0 && void 0 === e.clockseq && (s = (s + 1) & 16383),
- (l < 0 || u > nn) && void 0 === e.nsecs && (c = 0),
- c >= 1e4)
- )
- throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");
- (nn = u), (rn = c), (en = s);
- const d = (1e4 * (268435455 & (u += 122192928e5)) + c) % 4294967296;
- (i[r++] = (d >>> 24) & 255),
- (i[r++] = (d >>> 16) & 255),
- (i[r++] = (d >>> 8) & 255),
- (i[r++] = 255 & d);
- const p = ((u / 4294967296) * 1e4) & 268435455;
- (i[r++] = (p >>> 8) & 255),
- (i[r++] = 255 & p),
- (i[r++] = ((p >>> 24) & 15) | 16),
- (i[r++] = (p >>> 16) & 255),
- (i[r++] = (s >>> 8) | 128),
- (i[r++] = 255 & s);
- for (let f = 0; f < 6; ++f) i[r + f] = o[f];
- return t || tn(i);
- };
- const sn = function (e, t, n) {
- const r = (t && n) || 0;
- typeof e === "string" &&
- ((t = e === "binary" ? new Array(16) : null), (e = null));
- const i = (e = e || {}).random || (e.rng || Yt)();
- if (((i[6] = (15 & i[6]) | 64), (i[8] = (63 & i[8]) | 128), t))
- for (let o = 0; o < 16; ++o) t[r + o] = i[o];
- return t || tn(i);
- };
- const an = sn;
- (an.v1 = on), (an.v4 = sn);
- const un = an;
- const cn = un.v4;
- const ln = {
- _data: {},
- length: 0,
- setItem(e, t) {
- return (this._data[e] = t), (this.length = Pt(this._data).length), t;
- },
- getItem(e) {
- return e in this._data ? this._data[e] : null;
- },
- removeItem(e) {
- return (
- e in this._data && delete this._data[e],
- (this.length = Pt(this._data).length),
- null
- );
- },
- clear() {
- (this._data = {}), (this.length = 0);
- },
- key(e) {
- return Pt(this._data)[e];
- },
- };
- const dn = {
- defaultEngine: (function () {
- try {
- if (!window.localStorage) return !1;
- const e = cn();
- window.localStorage.setItem(e, "test_value");
- const t = window.localStorage.getItem(e);
- return window.localStorage.removeItem(e), t === "test_value";
- } catch (e) {
- return !1;
- }
- })()
- ? window.localStorage
- : ln,
- inMemoryEngine: ln,
- };
- const pn = dn.defaultEngine;
- const fn = dn.inMemoryEngine;
- function hn(e, t, n, r) {
- (this.id = t),
- (this.name = e),
- (this.keys = n || {}),
- (this.engine = r || pn);
- }
- (hn.prototype.set = function (e, t) {
- const n = this._createValidKey(e);
- if (n)
- try {
- this.engine.setItem(n, ue.stringify(t));
- } catch (n) {
- (function (e) {
- let t = !1;
- if (e.code)
- switch (e.code) {
- case 22:
- t = !0;
- break;
- case 1014:
- e.name === "NS_ERROR_DOM_QUOTA_REACHED" && (t = !0);
- }
- else e.number === -2147024882 && (t = !0);
- return t;
- })(n) && (this._swapEngine(), this.set(e, t));
- }
- }),
- (hn.prototype.get = function (e) {
- try {
- const t = this.engine.getItem(this._createValidKey(e));
- return t === null ? null : ue.parse(t);
- } catch (e) {
- return null;
- }
- }),
- (hn.prototype.remove = function (e) {
- this.engine.removeItem(this._createValidKey(e));
- }),
- (hn.prototype._createValidKey = function (e) {
- let t;
- const n = this.name;
- const r = this.id;
- return Pt(this.keys).length
- ? (Lt(function (i) {
- i === e && (t = [n, r, e].join("."));
- }, this.keys),
- t)
- : [n, r, e].join(".");
- }),
- (hn.prototype._swapEngine = function () {
- const e = this;
- Lt(function (t) {
- const n = e.get(t);
- fn.setItem([e.name, e.id, t].join("."), n), e.remove(t);
- }, this.keys),
- (this.engine = fn);
- });
- const gn = hn;
- const yn = {
- setTimeout(e, t) {
- return window.setTimeout(e, t);
- },
- clearTimeout(e) {
- return window.clearTimeout(e);
- },
- Date: window.Date,
- };
- let mn = yn;
- function vn() {
- (this.tasks = {}), (this.nextId = 1);
- }
- (vn.prototype.now = function () {
- return +new mn.Date();
- }),
- (vn.prototype.run = function (e, t) {
- const n = this.nextId++;
- return (this.tasks[n] = mn.setTimeout(this._handle(n, e), t)), n;
- }),
- (vn.prototype.cancel = function (e) {
- this.tasks[e] && (mn.clearTimeout(this.tasks[e]), delete this.tasks[e]);
- }),
- (vn.prototype.cancelAll = function () {
- Lt(mn.clearTimeout, this.tasks), (this.tasks = {});
- }),
- (vn.prototype._handle = function (e, t) {
- const n = this;
- return function () {
- return delete n.tasks[e], t();
- };
- }),
- (vn.setClock = function (e) {
- mn = e;
- }),
- (vn.resetClock = function () {
- mn = yn;
- });
- const bn = vn;
- const wn = kn;
- function kn(e) {
- return kn.enabled(e)
- ? function (t) {
- t = In(t);
- const n = new Date();
- const r = n - (kn[e] || n);
- (kn[e] = n),
- (t = `${e} ${t} +${kn.humanize(r)}`),
- window.console &&
- console.log &&
- Function.prototype.apply.call(console.log, console, arguments);
- }
- : function () {};
- }
- function In(e) {
- return e instanceof Error ? e.stack || e.message : e;
- }
- (kn.names = []),
- (kn.skips = []),
- (kn.enable = function (e) {
- try {
- localStorage.debug = e;
- } catch (e) {}
- for (let t = (e || "").split(/[\s,]+/), n = t.length, r = 0; r < n; r++)
- (e = t[r].replace("*", ".*?"))[0] === "-"
- ? kn.skips.push(new RegExp(`^${e.substr(1)}$`))
- : kn.names.push(new RegExp(`^${e}$`));
- }),
- (kn.disable = function () {
- kn.enable("");
- }),
- (kn.humanize = function (e) {
- return e >= 36e5
- ? `${(e / 36e5).toFixed(1)}h`
- : e >= 6e4
- ? `${(e / 6e4).toFixed(1)}m`
- : e >= 1e3
- ? `${(e / 1e3) | 0}s`
- : `${e}ms`;
- }),
- (kn.enabled = function (e) {
- for (var t = 0, n = kn.skips.length; t < n; t++)
- if (kn.skips[t].test(e)) return !1;
- for (t = 0, n = kn.names.length; t < n; t++)
- if (kn.names[t].test(e)) return !0;
- return !1;
- });
- try {
- window.localStorage && kn.enable(localStorage.debug);
- } catch (e) {}
- const _n = R(function (e) {
- function t(e) {
- if (e)
- return (function (e) {
- for (const n in t.prototype) e[n] = t.prototype[n];
- return e;
- })(e);
- }
- (e.exports = t),
- (t.prototype.on = t.prototype.addEventListener = function (e, t) {
- return (
- (this._callbacks = this._callbacks || {}),
- (this._callbacks[`$${e}`] = this._callbacks[`$${e}`] || []).push(t),
- this
- );
- }),
- (t.prototype.once = function (e, t) {
- function n() {
- this.off(e, n), t.apply(this, arguments);
- }
- return (n.fn = t), this.on(e, n), this;
- }),
- (t.prototype.off = t.prototype.removeListener = t.prototype.removeAllListeners = t.prototype.removeEventListener = function (
- e,
- t
- ) {
- if (((this._callbacks = this._callbacks || {}), arguments.length == 0))
- return (this._callbacks = {}), this;
- let n;
- const r = this._callbacks[`$${e}`];
- if (!r) return this;
- if (arguments.length == 1) return delete this._callbacks[`$${e}`], this;
- for (let i = 0; i < r.length; i++)
- if ((n = r[i]) === t || n.fn === t) {
- r.splice(i, 1);
- break;
- }
- return r.length === 0 && delete this._callbacks[`$${e}`], this;
- }),
- (t.prototype.emit = function (e) {
- this._callbacks = this._callbacks || {};
- for (
- var t = new Array(arguments.length - 1),
- n = this._callbacks[`$${e}`],
- r = 1;
- r < arguments.length;
- r++
- )
- t[r - 1] = arguments[r];
- if (n) {
- r = 0;
- for (let i = (n = n.slice(0)).length; r < i; ++r) n[r].apply(this, t);
- }
- return this;
- }),
- (t.prototype.listeners = function (e) {
- return (
- (this._callbacks = this._callbacks || {}),
- this._callbacks[`$${e}`] || []
- );
- }),
- (t.prototype.hasListeners = function (e) {
- return !!this.listeners(e).length;
- });
- });
- const En = un.v4;
- const An = wn("localstorage-retry");
- function Cn(e, t) {
- return function () {
- return e.apply(t, arguments);
- };
- }
- function Tn(e, t, n) {
- typeof t === "function" && (n = t),
- (this.name = e),
- (this.id = En()),
- (this.fn = n),
- (this.maxItems = t.maxItems || 1 / 0),
- (this.maxAttempts = t.maxAttempts || 1 / 0),
- (this.backoff = {
- MIN_RETRY_DELAY: t.minRetryDelay || 1e3,
- MAX_RETRY_DELAY: t.maxRetryDelay || 3e4,
- FACTOR: t.backoffFactor || 2,
- JITTER: t.backoffJitter || 0,
- }),
- (this.timeouts = {
- ACK_TIMER: 1e3,
- RECLAIM_TIMER: 3e3,
- RECLAIM_TIMEOUT: 1e4,
- RECLAIM_WAIT: 500,
- }),
- (this.keys = {
- IN_PROGRESS: "inProgress",
- QUEUE: "queue",
- ACK: "ack",
- RECLAIM_START: "reclaimStart",
- RECLAIM_END: "reclaimEnd",
- }),
- (this._schedule = new bn()),
- (this._processId = 0),
- (this._store = new gn(this.name, this.id, this.keys)),
- this._store.set(this.keys.IN_PROGRESS, {}),
- this._store.set(this.keys.QUEUE, []),
- (this._ack = Cn(this._ack, this)),
- (this._checkReclaim = Cn(this._checkReclaim, this)),
- (this._processHead = Cn(this._processHead, this)),
- (this._running = !1);
- }
- _n(Tn.prototype),
- (Tn.prototype.start = function () {
- this._running && this.stop(),
- (this._running = !0),
- this._ack(),
- this._checkReclaim(),
- this._processHead();
- }),
- (Tn.prototype.stop = function () {
- this._schedule.cancelAll(), (this._running = !1);
- }),
- (Tn.prototype.shouldRetry = function (e, t) {
- return !(t > this.maxAttempts);
- }),
- (Tn.prototype.getDelay = function (e) {
- let t = this.backoff.MIN_RETRY_DELAY * Math.pow(this.backoff.FACTOR, e);
- if (this.backoff.JITTER) {
- const n = Math.random();
- const r = Math.floor(n * this.backoff.JITTER * t);
- Math.floor(10 * n) < 5 ? (t -= r) : (t += r);
- }
- return Number(Math.min(t, this.backoff.MAX_RETRY_DELAY).toPrecision(1));
- }),
- (Tn.prototype.addItem = function (e) {
- this._enqueue({ item: e, attemptNumber: 0, time: this._schedule.now() });
- }),
- (Tn.prototype.requeue = function (e, t, n) {
- this.shouldRetry(e, t, n)
- ? this._enqueue({
- item: e,
- attemptNumber: t,
- time: this._schedule.now() + this.getDelay(t),
- })
- : this.emit("discard", e, t);
- }),
- (Tn.prototype._enqueue = function (e) {
- let t = this._store.get(this.keys.QUEUE) || [];
- (t = t.slice(-(this.maxItems - 1))).push(e),
- (t = t.sort(function (e, t) {
- return e.time - t.time;
- })),
- this._store.set(this.keys.QUEUE, t),
- this._running && this._processHead();
- }),
- (Tn.prototype._processHead = function () {
- const e = this;
- const t = this._store;
- this._schedule.cancel(this._processId);
- let n = t.get(this.keys.QUEUE) || [];
- const r = t.get(this.keys.IN_PROGRESS) || {};
- const i = this._schedule.now();
- const o = [];
- function s(n, r) {
- o.push({
- item: n.item,
- done(i, o) {
- const s = t.get(e.keys.IN_PROGRESS) || {};
- delete s[r],
- t.set(e.keys.IN_PROGRESS, s),
- e.emit("processed", i, o, n.item),
- i && e.requeue(n.item, n.attemptNumber + 1, i);
- },
- });
- }
- for (
- let a = Object.keys(r).length;
- n.length && n[0].time <= i && a++ < e.maxItems;
-
- ) {
- const u = n.shift();
- const c = En();
- (r[c] = {
- item: u.item,
- attemptNumber: u.attemptNumber,
- time: e._schedule.now(),
- }),
- s(u, c);
- }
- t.set(this.keys.QUEUE, n),
- t.set(this.keys.IN_PROGRESS, r),
- Lt(function (t) {
- try {
- e.fn(t.item, t.done);
- } catch (e) {
- An(`Process function threw error: ${e}`);
- }
- }, o),
- (n = t.get(this.keys.QUEUE) || []),
- this._schedule.cancel(this._processId),
- n.length > 0 &&
- (this._processId = this._schedule.run(
- this._processHead,
- n[0].time - i
- ));
- }),
- (Tn.prototype._ack = function () {
- this._store.set(this.keys.ACK, this._schedule.now()),
- this._store.set(this.keys.RECLAIM_START, null),
- this._store.set(this.keys.RECLAIM_END, null),
- this._schedule.run(this._ack, this.timeouts.ACK_TIMER);
- }),
- (Tn.prototype._checkReclaim = function () {
- const e = this;
- Lt(
- function (t) {
- t.id !== e.id &&
- (e._schedule.now() - t.get(e.keys.ACK) <
- e.timeouts.RECLAIM_TIMEOUT ||
- (function (t) {
- t.set(e.keys.RECLAIM_START, e.id),
- t.set(e.keys.ACK, e._schedule.now()),
- e._schedule.run(function () {
- t.get(e.keys.RECLAIM_START) === e.id &&
- (t.set(e.keys.RECLAIM_END, e.id),
- e._schedule.run(function () {
- t.get(e.keys.RECLAIM_END) === e.id &&
- t.get(e.keys.RECLAIM_START) === e.id &&
- e._reclaim(t.id);
- }, e.timeouts.RECLAIM_WAIT));
- }, e.timeouts.RECLAIM_WAIT);
- })(t));
- },
- (function (t) {
- for (var n = [], r = e._store.engine, i = 0; i < r.length; i++) {
- const o = r.key(i).split(".");
- o.length === 3 &&
- o[0] === t &&
- o[2] === "ack" &&
- n.push(new gn(t, o[1], e.keys));
- }
- return n;
- })(this.name)
- ),
- this._schedule.run(this._checkReclaim, this.timeouts.RECLAIM_TIMER);
- }),
- (Tn.prototype._reclaim = function (e) {
- const t = this;
- const n = new gn(this.name, e, this.keys);
- const r = { queue: this._store.get(this.keys.QUEUE) || [] };
- const i = {
- inProgress: n.get(this.keys.IN_PROGRESS) || {},
- queue: n.get(this.keys.QUEUE) || [],
- };
- Lt(function (e) {
- r.queue.push({
- item: e.item,
- attemptNumber: e.attemptNumber,
- time: t._schedule.now(),
- });
- }, i.queue),
- Lt(function (e) {
- r.queue.push({
- item: e.item,
- attemptNumber: e.attemptNumber + 1,
- time: t._schedule.now(),
- });
- }, i.inProgress),
- (r.queue = r.queue.sort(function (e, t) {
- return e.time - t.time;
- })),
- this._store.set(this.keys.QUEUE, r.queue),
- n.remove(this.keys.ACK),
- n.remove(this.keys.RECLAIM_START),
- n.remove(this.keys.RECLAIM_END),
- n.remove(this.keys.IN_PROGRESS),
- n.remove(this.keys.QUEUE),
- this._processHead();
- });
- const On = Tn;
- const Sn = {
- maxRetryDelay: 36e4,
- minRetryDelay: 1e3,
- backoffFactor: 2,
- maxAttempts: 10,
- maxItems: 100,
- };
- var Pn = new ((function () {
- function e() {
- n(this, e),
- (this.eventsBuffer = []),
- (this.writeKey = ""),
- (this.url = "https://hosted.rudderlabs.com"),
- (this.state = "READY"),
- (this.batchSize = 0),
- (this.payloadQueue = new On("rudder", Sn, function (e, t) {
- (e.message.sentAt = v()),
- Pn.processQueueElement(e.url, e.headers, e.message, 1e4, function (
- e,
- n
- ) {
- if (e) return t(e);
- t(null, n);
- });
- })),
- this.payloadQueue.start();
- }
- return (
- i(e, [
- {
- key: "preaparePayloadAndFlush",
- value(e) {
- if (
- (p(`==== in preaparePayloadAndFlush with state: ${e.state}`),
- p(e.eventsBuffer),
- e.eventsBuffer.length != 0 && e.state !== "PROCESSING")
- ) {
- const t = e.eventsBuffer;
- const n = new $t();
- (n.batch = t),
- (n.writeKey = e.writeKey),
- (n.sentAt = v()),
- n.batch.forEach(function (e) {
- e.sentAt = n.sentAt;
- }),
- (e.batchSize = e.eventsBuffer.length);
- const r = new XMLHttpRequest();
- p("==== in flush sending to Rudder BE ===="),
- p(JSON.stringify(n, y)),
- r.open("POST", e.url, !0),
- r.setRequestHeader("Content-Type", "application/json"),
- r.setRequestHeader(
- "Authorization",
- `Basic ${btoa(`${n.writeKey}:`)}`
- ),
- (r.onreadystatechange = function () {
- r.readyState === 4 && r.status === 200
- ? (p(`====== request processed successfully: ${r.status}`),
- (e.eventsBuffer = e.eventsBuffer.slice(e.batchSize)),
- p(e.eventsBuffer.length))
- : r.readyState === 4 &&
- r.status !== 200 &&
- b(
- new Error(
- `request failed with status: ${r.status} for url: ${e.url}`
- )
- ),
- (e.state = "READY");
- }),
- r.send(JSON.stringify(n, y)),
- (e.state = "PROCESSING");
- }
- },
- },
- {
- key: "processQueueElement",
- value(e, t, n, r, i) {
- try {
- const o = new XMLHttpRequest();
- for (const s in (o.open("POST", e, !0), t))
- o.setRequestHeader(s, t[s]);
- (o.timeout = r),
- (o.ontimeout = i),
- (o.onerror = i),
- (o.onreadystatechange = function () {
- o.readyState === 4 &&
- (o.status === 429 || (o.status >= 500 && o.status < 600)
- ? (b(
- new Error(
- `request failed with status: ${o.status}${o.statusText} for url: ${e}`
- )
- ),
- i(
- new Error(
- `request failed with status: ${o.status}${o.statusText} for url: ${e}`
- )
- ))
- : (p(
- `====== request processed successfully: ${o.status}`
- ),
- i(null, o.status)));
- }),
- o.send(JSON.stringify(n, y));
- } catch (e) {
- i(e);
- }
- },
- },
- {
- key: "enqueue",
- value(e, t) {
- const n = e.getElementContent();
- const r = {
- "Content-Type": "application/json",
- Authorization: `Basic ${btoa(`${this.writeKey}:`)}`,
- AnonymousId: btoa(n.anonymousId),
- };
- (n.originalTimestamp = v()),
- (n.sentAt = v()),
- JSON.stringify(n).length > 32e3 &&
- f(
- "[EventRepository] enqueue:: message length greater 32 Kb ",
- n
- );
- const i =
- this.url.slice(-1) == "/" ? this.url.slice(0, -1) : this.url;
- this.payloadQueue.addItem({
- url: `${i}/v1/${t}`,
- headers: r,
- message: n,
- });
- },
- },
- ]),
- e
- );
- })())();
- function xn(e) {
- const t = function (t) {
- let n = (t = t || window.event).target || t.srcElement;
- Ln(n) && (n = n.parentNode),
- jn(n, t)
- ? p("to be tracked ", t.type)
- : p("not to be tracked ", t.type),
- (function (e, t) {
- let n = e.target || e.srcElement;
- let r = void 0;
- Ln(n) && (n = n.parentNode);
- if (jn(n, e)) {
- if (n.tagName.toLowerCase() == "form") {
- r = {};
- for (let i = 0; i < n.elements.length; i++) {
- const o = n.elements[i];
- if (Bn(o) && Nn(o, t.trackValues)) {
- const s = o.id ? o.id : o.name;
- if (s && typeof s === "string") {
- const a = o.id ? o.id : o.name;
- let u = o.id
- ? document.getElementById(o.id).value
- : document.getElementsByName(o.name)[0].value;
- (o.type !== "checkbox" && o.type !== "radio") ||
- (u = o.checked),
- a.trim() !== "" &&
- (r[encodeURIComponent(a)] = encodeURIComponent(u));
- }
- }
- }
- }
- for (var c = [n], l = n; l.parentNode && !Dn(l, "body"); )
- c.push(l.parentNode), (l = l.parentNode);
- let d;
- const f = [];
- let h = !1;
- if (
- (c.forEach(function (e) {
- const n = (function (e) {
- return !(!e.parentNode || Dn(e, "body"));
- })(e);
- e.tagName.toLowerCase() === "a" &&
- ((d = e.getAttribute("href")), (d = n && d)),
- (h = h || !Bn(e)),
- f.push(
- (function (e, t) {
- for (
- var n = {
- classes: Mn(e).split(" "),
- tag_name: e.tagName.toLowerCase(),
- },
- r = e.attributes.length,
- i = 0;
- i < r;
- i++
- ) {
- const o = e.attributes[i].name;
- const s = e.attributes[i].value;
- s && (n[`attr__${o}`] = s),
- (o != "name" && o != "id") ||
- !Nn(e, t.trackValues) ||
- ((n.field_value =
- o == "id"
- ? document.getElementById(s).value
- : document.getElementsByName(s)[0].value),
- (e.type !== "checkbox" && e.type !== "radio") ||
- (n.field_value = e.checked));
- }
- let a = 1;
- let u = 1;
- let c = e;
- for (; (c = qn(c)); ) a++, c.tagName === e.tagName && u++;
- return (n.nth_child = a), (n.nth_of_type = u), n;
- })(e, t)
- );
- }),
- h)
- )
- return !1;
- let g = "";
- const y = (function (e) {
- let t = "";
- return (
- e.childNodes.forEach(function (e) {
- e.nodeType === Node.TEXT_NODE && (t += e.nodeValue);
- }),
- t.trim()
- );
- })(n);
- y && y.length && (g = y);
- const m = {
- event_type: e.type,
- page: w(),
- elements: f,
- el_attr_href: d,
- el_text: g,
- };
- r && (m.form_values = r),
- p("web_event", m),
- t.track("autotrack", m);
- }
- })(t, e);
- };
- Rn(document, "submit", t, !0),
- Rn(document, "change", t, !0),
- Rn(document, "click", t, !0),
- e.page();
- }
- function Rn(e, t, n, r) {
- e
- ? e.addEventListener(t, n, !!r)
- : f(
- "[Autotrack] register_event:: No valid element provided to register_event"
- );
- }
- function jn(e, t) {
- if (!e || Dn(e, "html") || !Un(e)) return !1;
- switch (e.tagName.toLowerCase()) {
- case "html":
- return !1;
- case "form":
- return t.type === "submit";
- case "input":
- return ["button", "submit"].indexOf(e.getAttribute("type")) === -1
- ? t.type === "change"
- : t.type === "click";
- case "select":
- case "textarea":
- return t.type === "change";
- default:
- return t.type === "click";
- }
- }
- function Dn(e, t) {
- return e && e.tagName && e.tagName.toLowerCase() === t.toLowerCase();
- }
- function Un(e) {
- return e && e.nodeType === 1;
- }
- function Ln(e) {
- return e && e.nodeType === 3;
- }
- function Mn(e) {
- switch (t(e.className)) {
- case "string":
- return e.className;
- case "object":
- return e.className.baseVal || e.getAttribute("class") || "";
- default:
- return "";
- }
- }
- function Nn(e, t) {
- for (let n = e.attributes.length, r = 0; r < n; r++) {
- const i = e.attributes[r].value;
- if (t.indexOf(i) > -1) return !0;
- }
- return !1;
- }
- function Bn(e) {
- return !(Mn(e).split(" ").indexOf("rudder-no-track") >= 0);
- }
- function qn(e) {
- if (e.previousElementSibling) return e.previousElementSibling;
- do {
- e = e.previousSibling;
- } while (e && !Un(e));
- return e;
- }
- const Fn = function (e, t, n) {
- let r = !1;
- return (n = n || Kn), (i.count = e), e === 0 ? t() : i;
- function i(e, o) {
- if (i.count <= 0) throw new Error("after called too many times");
- --i.count,
- e ? ((r = !0), t(e), (t = n)) : i.count !== 0 || r || t(null, o);
- }
- };
- function Kn() {}
- function Gn(e, t) {
- this.eventRepository || (this.eventRepository = Pn),
- this.eventRepository.enqueue(e, t);
- }
- var Hn = new ((function () {
- function e() {
- n(this, e),
- (this.autoTrackHandlersRegistered = !1),
- (this.autoTrackFeatureEnabled = !1),
- (this.initialized = !1),
- (this.trackValues = []),
- (this.eventsBuffer = []),
- (this.clientIntegrations = []),
- (this.loadOnlyIntegrations = {}),
- (this.clientIntegrationObjects = void 0),
- (this.successfullyLoadedIntegration = []),
- (this.failedToBeLoadedIntegration = []),
- (this.toBeProcessedArray = []),
- (this.toBeProcessedByIntegrationArray = []),
- (this.storage = Oe),
- (this.userId =
- this.storage.getUserId() != null ? this.storage.getUserId() : ""),
- (this.userTraits =
- this.storage.getUserTraits() != null
- ? this.storage.getUserTraits()
- : {}),
- (this.groupId =
- this.storage.getGroupId() != null ? this.storage.getGroupId() : ""),
- (this.groupTraits =
- this.storage.getGroupTraits() != null
- ? this.storage.getGroupTraits()
- : {}),
- (this.anonymousId = this.getAnonymousId()),
- this.storage.setUserId(this.userId),
- (this.eventRepository = Pn),
- (this.sendAdblockPage = !1),
- (this.sendAdblockPageOptions = {}),
- (this.clientSuppliedCallbacks = {}),
- (this.readyCallback = function () {}),
- (this.executeReadyCallback = void 0),
- (this.methodToCallbackMapping = { syncPixel: "syncPixelCallback" });
- }
- return (
- i(e, [
- {
- key: "processResponse",
- value(e, t) {
- try {
- p(`===in process response=== ${e}`),
- (t = JSON.parse(t)).source.useAutoTracking &&
- !this.autoTrackHandlersRegistered &&
- ((this.autoTrackFeatureEnabled = !0),
- xn(this),
- (this.autoTrackHandlersRegistered = !0)),
- t.source.destinations.forEach(function (e, t) {
- p(
- `Destination ${t} Enabled? ${e.enabled} Type: ${e.destinationDefinition.name} Use Native SDK? ${e.config.useNativeSDK}`
- ),
- e.enabled &&
- this.clientIntegrations.push({
- name: e.destinationDefinition.name,
- config: e.config,
- });
- }, this),
- (this.clientIntegrations = E(
- this.loadOnlyIntegrations,
- this.clientIntegrations
- )),
- (this.clientIntegrations = this.clientIntegrations.filter(
- function (e) {
- return qt[e.name] != null;
- }
- )),
- this.init(this.clientIntegrations);
- } catch (e) {
- b(e),
- p("===handling config BE response processing error==="),
- p(
- "autoTrackHandlersRegistered",
- this.autoTrackHandlersRegistered
- ),
- this.autoTrackFeatureEnabled &&
- !this.autoTrackHandlersRegistered &&
- (xn(this), (this.autoTrackHandlersRegistered = !0));
- }
- },
- },
- {
- key: "init",
- value(e) {
- const t = this;
- const n = this;
- if ((p("supported intgs ", qt), !e || e.length == 0))
- return (
- this.readyCallback && this.readyCallback(),
- void (this.toBeProcessedByIntegrationArray = [])
- );
- e.forEach(function (e) {
- try {
- p(
- "[Analytics] init :: trying to initialize integration name:: ",
- e.name
- );
- const r = new (0, qt[e.name])(e.config, n);
- r.init(),
- p("initializing destination: ", e),
- t.isInitialized(r).then(t.replayEvents);
- } catch (t) {
- f(
- "[Analytics] initialize integration (integration.init()) failed :: ",
- e.name
- );
- }
- });
- },
- },
- {
- key: "replayEvents",
- value(e) {
- e.successfullyLoadedIntegration.length +
- e.failedToBeLoadedIntegration.length ==
- e.clientIntegrations.length &&
- e.toBeProcessedByIntegrationArray.length > 0 &&
- (p(
- "===replay events called====",
- e.successfullyLoadedIntegration.length,
- e.failedToBeLoadedIntegration.length
- ),
- (e.clientIntegrationObjects = []),
- (e.clientIntegrationObjects = e.successfullyLoadedIntegration),
- p(
- "==registering after callback===",
- e.clientIntegrationObjects.length
- ),
- (e.executeReadyCallback = Fn(
- e.clientIntegrationObjects.length,
- e.readyCallback
- )),
- p("==registering ready callback==="),
- e.on("ready", e.executeReadyCallback),
- e.clientIntegrationObjects.forEach(function (t) {
- p("===looping over each successful integration===="),
- (t.isReady && !t.isReady()) ||
- (p("===letting know I am ready=====", t.name),
- e.emit("ready"));
- }),
- e.toBeProcessedByIntegrationArray.forEach(function (t) {
- const n = t[0];
- t.shift(),
- Object.keys(t[0].message.integrations).length > 0 &&
- _(t[0].message.integrations);
- for (
- let r = E(
- t[0].message.integrations,
- e.clientIntegrationObjects
- ),
- i = 0;
- i < r.length;
- i++
- )
- try {
- var o;
- if (!r[i].isFailed || !r[i].isFailed())
- if (r[i][n]) (o = r[i])[n].apply(o, u(t));
- } catch (e) {
- b(e);
- }
- }),
- (e.toBeProcessedByIntegrationArray = []));
- },
- },
- {
- key: "pause",
- value(e) {
- return new Promise(function (t) {
- setTimeout(t, e);
- });
- },
- },
- {
- key: "isInitialized",
- value(e) {
- const t = this;
- const n =
- arguments.length > 1 && void 0 !== arguments[1]
- ? arguments[1]
- : 0;
- return new Promise(function (r) {
- return e.isLoaded()
- ? (p("===integration loaded successfully====", e.name),
- t.successfullyLoadedIntegration.push(e),
- r(t))
- : n >= 1e4
- ? (p("====max wait over===="),
- t.failedToBeLoadedIntegration.push(e),
- r(t))
- : void t.pause(1e3).then(function () {
- return (
- p("====after pause, again checking===="),
- t.isInitialized(e, n + 1e3).then(r)
- );
- });
- });
- },
- },
- {
- key: "page",
- value(e, n, r, i, o) {
- typeof i === "function" && ((o = i), (i = null)),
- typeof r === "function" && ((o = r), (i = r = null)),
- typeof n === "function" && ((o = n), (i = r = n = null)),
- t(e) === "object" && ((i = n), (r = e), (n = e = null)),
- t(n) === "object" && ((i = r), (r = n), (n = null)),
- typeof e === "string" &&
- typeof n !== "string" &&
- ((n = e), (e = null)),
- this.sendAdblockPage &&
- e != "RudderJS-Initiated" &&
- this.sendSampleRequest(),
- this.processPage(e, n, r, i, o);
- },
- },
- {
- key: "track",
- value(e, t, n, r) {
- typeof n === "function" && ((r = n), (n = null)),
- typeof t === "function" && ((r = t), (n = null), (t = null)),
- this.processTrack(e, t, n, r);
- },
- },
- {
- key: "identify",
- value(e, n, r, i) {
- typeof r === "function" && ((i = r), (r = null)),
- typeof n === "function" && ((i = n), (r = null), (n = null)),
- t(e) == "object" && ((r = n), (n = e), (e = this.userId)),
- this.processIdentify(e, n, r, i);
- },
- },
- {
- key: "alias",
- value(e, n, r, i) {
- typeof r === "function" && ((i = r), (r = null)),
- typeof n === "function" && ((i = n), (r = null), (n = null)),
- t(n) == "object" && ((r = n), (n = null));
- const o = new Wt().setType("alias").build();
- (o.message.previousId =
- n || (this.userId ? this.userId : this.getAnonymousId())),
- (o.message.userId = e),
- this.processAndSendDataToDestinations("alias", o, r, i);
- },
- },
- {
- key: "group",
- value(e, n, r, i) {
- if (arguments.length) {
- typeof r === "function" && ((i = r), (r = null)),
- typeof n === "function" && ((i = n), (r = null), (n = null)),
- t(e) == "object" && ((r = n), (n = e), (e = this.groupId)),
- (this.groupId = e),
- this.storage.setGroupId(this.groupId);
- const o = new Wt().setType("group").build();
- if (n) for (const s in n) this.groupTraits[s] = n[s];
- else this.groupTraits = {};
- this.storage.setGroupTraits(this.groupTraits),
- this.processAndSendDataToDestinations("group", o, r, i);
- }
- },
- },
- {
- key: "processPage",
- value(e, t, n, r, i) {
- const o = new Wt().setType("page").build();
- t && (o.message.name = t),
- n || (n = {}),
- e && (n.category = e),
- n && (o.message.properties = this.getPageProperties(n)),
- this.trackPage(o, r, i);
- },
- },
- {
- key: "processTrack",
- value(e, t, n, r) {
- const i = new Wt().setType("track").build();
- e && i.setEventName(e),
- t ? i.setProperty(t) : i.setProperty({}),
- this.trackEvent(i, n, r);
- },
- },
- {
- key: "processIdentify",
- value(e, t, n, r) {
- e && this.userId && e !== this.userId && this.reset(),
- (this.userId = e),
- this.storage.setUserId(this.userId);
- const i = new Wt().setType("identify").build();
- if (t) {
- for (const o in t) this.userTraits[o] = t[o];
- this.storage.setUserTraits(this.userTraits);
- }
- this.identifyUser(i, n, r);
- },
- },
- {
- key: "identifyUser",
- value(e, t, n) {
- e.message.userId &&
- ((this.userId = e.message.userId),
- this.storage.setUserId(this.userId)),
- e &&
- e.message &&
- e.message.context &&
- e.message.context.traits &&
- ((this.userTraits = {
- ...e.message.context.traits,
- }),
- this.storage.setUserTraits(this.userTraits)),
- this.processAndSendDataToDestinations("identify", e, t, n);
- },
- },
- {
- key: "trackPage",
- value(e, t, n) {
- this.processAndSendDataToDestinations("page", e, t, n);
- },
- },
- {
- key: "trackEvent",
- value(e, t, n) {
- this.processAndSendDataToDestinations("track", e, t, n);
- },
- },
- {
- key: "processAndSendDataToDestinations",
- value(e, t, n, r) {
- try {
- this.anonymousId || this.setAnonymousId(),
- (t.message.context.page = w()),
- (t.message.context.traits = { ...this.userTraits }),
- p("anonymousId: ", this.anonymousId),
- (t.message.anonymousId = this.anonymousId),
- (t.message.userId = t.message.userId
- ? t.message.userId
- : this.userId),
- e == "group" &&
- (this.groupId && (t.message.groupId = this.groupId),
- this.groupTraits &&
- (t.message.traits = { ...this.groupTraits })),
- n && this.processOptionsParam(t, n),
- p(JSON.stringify(t)),
- Object.keys(t.message.integrations).length > 0 &&
- _(t.message.integrations),
- E(
- t.message.integrations,
- this.clientIntegrationObjects
- ).forEach(function (n) {
- (n.isFailed && n.isFailed()) || (n[e] && n[e](t));
- }),
- this.clientIntegrationObjects ||
- (p("pushing in replay queue"),
- this.toBeProcessedByIntegrationArray.push([e, t])),
- (i = t.message.integrations),
- Object.keys(i).forEach(function (e) {
- i.hasOwnProperty(e) &&
- (g[e] && (i[g[e]] = i[e]),
- e != "All" && g[e] != null && g[e] != e && delete i[e]);
- }),
- Gn.call(this, t, e),
- p(`${e} is called `),
- r && r();
- } catch (e) {
- b(e);
- }
- let i;
- },
- },
- {
- key: "processOptionsParam",
- value(e, t) {
- const n = ["integrations", "anonymousId", "originalTimestamp"];
- for (const r in t)
- if (n.includes(r)) e.message[r] = t[r];
- else if (r !== "context") e.message.context[r] = t[r];
- else for (const i in t[r]) e.message.context[i] = t[r][i];
- },
- },
- {
- key: "getPageProperties",
- value(e) {
- const t = w();
- for (const n in t) void 0 === e[n] && (e[n] = t[n]);
- return e;
- },
- },
- {
- key: "reset",
- value() {
- (this.userId = ""), (this.userTraits = {}), this.storage.clear();
- },
- },
- {
- key: "getAnonymousId",
- value() {
- return (
- (this.anonymousId = this.storage.getAnonymousId()),
- this.anonymousId || this.setAnonymousId(),
- this.anonymousId
- );
- },
- },
- {
- key: "setAnonymousId",
- value(e) {
- (this.anonymousId = e || m()),
- this.storage.setAnonymousId(this.anonymousId);
- },
- },
- {
- key: "load",
- value(e, n, r) {
- const i = this;
- p("inside load ");
- let o = "https://api.rudderlabs.com/sourceConfig/?p=web&v=1.1.2";
- if (!e || !n || n.length == 0)
- throw (
- (b({
- message:
- "[Analytics] load:: Unable to load due to wrong writeKey or serverUrl",
- }),
- Error("failed to initialize"))
- );
- if (
- (r && r.logLevel && d(r.logLevel),
- r &&
- r.integrations &&
- (Object.assign(this.loadOnlyIntegrations, r.integrations),
- _(this.loadOnlyIntegrations)),
- r && r.configUrl && (o = r.configUrl),
- r && r.sendAdblockPage && (this.sendAdblockPage = !0),
- r &&
- r.sendAdblockPageOptions &&
- t(r.sendAdblockPageOptions) == "object" &&
- (this.sendAdblockPageOptions = r.sendAdblockPageOptions),
- r && r.clientSuppliedCallbacks)
- ) {
- const s = {};
- Object.keys(this.methodToCallbackMapping).forEach(function (e) {
- i.methodToCallbackMapping.hasOwnProperty(e) &&
- r.clientSuppliedCallbacks[i.methodToCallbackMapping[e]] &&
- (s[e] =
- r.clientSuppliedCallbacks[i.methodToCallbackMapping[e]]);
- }),
- Object.assign(this.clientSuppliedCallbacks, s),
- this.registerCallbacks(!0);
- }
- (this.eventRepository.writeKey = e),
- n && (this.eventRepository.url = n),
- r &&
- r.valTrackingList &&
- r.valTrackingList.push == Array.prototype.push &&
- (this.trackValues = r.valTrackingList),
- r &&
- r.useAutoTracking &&
- ((this.autoTrackFeatureEnabled = !0),
- this.autoTrackFeatureEnabled &&
- !this.autoTrackHandlersRegistered &&
- (xn(this),
- (this.autoTrackHandlersRegistered = !0),
- p(
- "autoTrackHandlersRegistered",
- this.autoTrackHandlersRegistered
- )));
- try {
- !(function (e, t, n, r) {
- let i;
- const o = r.bind(e);
- (i = new XMLHttpRequest()).open("GET", t, !0),
- i.setRequestHeader("Authorization", `Basic ${btoa(`${n}:`)}`),
- (i.onload = function () {
- const e = i.status;
- e == 200
- ? (p("status 200 calling callback"),
- o(200, i.responseText))
- : (b(
- new Error(
- `request failed with status: ${i.status} for url: ${t}`
- )
- ),
- o(e));
- }),
- i.send();
- })(this, o, e, this.processResponse);
- } catch (e) {
- b(e),
- this.autoTrackFeatureEnabled &&
- !this.autoTrackHandlersRegistered &&
- xn(Hn);
- }
- },
- },
- {
- key: "ready",
- value(e) {
- typeof e !== "function"
- ? f("ready callback is not a function")
- : (this.readyCallback = e);
- },
- },
- {
- key: "initializeCallbacks",
- value() {
- const e = this;
- Object.keys(this.methodToCallbackMapping).forEach(function (t) {
- e.methodToCallbackMapping.hasOwnProperty(t) &&
- e.on(t, function () {});
- });
- },
- },
- {
- key: "registerCallbacks",
- value(e) {
- const t = this;
- e ||
- Object.keys(this.methodToCallbackMapping).forEach(function (e) {
- t.methodToCallbackMapping.hasOwnProperty(e) &&
- window.rudderanalytics &&
- typeof window.rudderanalytics[
- t.methodToCallbackMapping[e]
- ] === "function" &&
- (t.clientSuppliedCallbacks[e] =
- window.rudderanalytics[t.methodToCallbackMapping[e]]);
- }),
- Object.keys(this.clientSuppliedCallbacks).forEach(function (e) {
- t.clientSuppliedCallbacks.hasOwnProperty(e) &&
- (p("registerCallbacks", e, t.clientSuppliedCallbacks[e]),
- t.on(e, t.clientSuppliedCallbacks[e]));
- });
- },
- },
- {
- key: "sendSampleRequest",
- value() {
- T(
- "ad-block",
- "//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"
- );
- },
- },
- ]),
- e
- );
- })())();
- _n(Hn),
- window.addEventListener(
- "error",
- function (e) {
- b(e, Hn);
- },
- !0
- ),
- Hn.initializeCallbacks(),
- Hn.registerCallbacks(!1);
- const Vn =
- !!window.rudderanalytics &&
- window.rudderanalytics.push == Array.prototype.push;
- const zn = window.rudderanalytics ? window.rudderanalytics[0] : [];
- if (zn.length > 0 && zn[0] == "load") {
- const Jn = zn[0];
- zn.shift(),
- p("=====from init, calling method:: ", Jn),
- Hn[Jn].apply(Hn, u(zn));
- }
- if (Vn) {
- for (let Wn = 1; Wn < window.rudderanalytics.length; Wn++)
- Hn.toBeProcessedArray.push(window.rudderanalytics[Wn]);
- for (let $n = 0; $n < Hn.toBeProcessedArray.length; $n++) {
- const Yn = u(Hn.toBeProcessedArray[$n]);
- const Qn = Yn[0];
- Yn.shift(),
- p("=====from init, calling method:: ", Qn),
- Hn[Qn].apply(Hn, u(Yn));
- }
- Hn.toBeProcessedArray = [];
- }
- const Zn = Hn.ready.bind(Hn);
- const Xn = Hn.identify.bind(Hn);
- const er = Hn.page.bind(Hn);
- const tr = Hn.track.bind(Hn);
- const nr = Hn.alias.bind(Hn);
- const rr = Hn.group.bind(Hn);
- const ir = Hn.reset.bind(Hn);
- const or = Hn.load.bind(Hn);
- const sr = (Hn.initialized = !0);
- const ar = Hn.getAnonymousId.bind(Hn);
- const ur = Hn.setAnonymousId.bind(Hn);
- return (
- (e.alias = nr),
- (e.getAnonymousId = ar),
- (e.group = rr),
- (e.identify = Xn),
- (e.initialized = sr),
- (e.load = or),
- (e.page = er),
- (e.ready = Zn),
- (e.reset = ir),
- (e.setAnonymousId = ur),
- (e.track = tr),
- e
- );
-})({});
-// # sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicnVkZGVyLWFuYWx5dGljcy1tYXAubWluLmpzIiwic291cmNlcyI6WyIuLi91dGlscy9sb2dVdGlsLmpzIiwiLi4vaW50ZWdyYXRpb25zL2ludGVncmF0aW9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WwudG9VcHBlckNhc2UoKSl7XG4gICAgICAgICAgICBjYXNlICdJTkZPJzpcbiAgICAgICAgICAgICAgICBMT0dfTEVWRUwgPSBMT0dfTEVWRUxfSU5GTztcbiAgICAgICAgICAgICAgICByZXR1cm5cbiAgICAgICAgICAgIGNhc2UgJ0RFQlVHJzpcbiAgICAgICAgICAgICAgICBMT0dfTEVWRUwgPSBMT0dfTEVWRUxfREVCVUc7XG4gICAgICAgICAgICAgICAgcmV0dXJuXG4gICAgICAgICAgICBjYXNlICdXQVJOJzpcbiAgICAgICAgICAgICAgICBMT0dfTEVWRUwgPSBMT0dfTEVWRUxfV0FSTjtcbiAgICAgICAgICAgICAgICByZXR1cm5cbiAgICAgICAgfSAgICAgICBcbiAgICB9LFxuXG4gICAgaW5mbyA6IGZ1bmN0aW9uKCl7XG4gICAgICAgIGlmKExPR19MRVZFTCA8PSBMT0dfTEVWRUxfSU5GTyl7XG4gICAgICAgICAgICBjb25zb2xlLmluZm8oLi4uYXJndW1lbnRzKTtcbiAgICAgICAgfVxuICAgIH0sXG5cbiAgICBkZWJ1ZyA6IGZ1bmN0aW9uKCl7XG4gICAgICAgIGlmKExPR19MRVZFTCA8PSBMT0dfTEVWRUxfREVCVUcpe1xuICAgICAgICAgICAgY29uc29sZS5kZWJ1ZyguLi5hcmd1bWVudHMpO1xuICAgICAgICB9XG4gICAgfSxcblxuICAgIHdhcm4gOiBmdW5jdGlvbigpe1xuICAgICAgICBpZihMT0dfTEVWRUwgPD0gTE9HX0xFVkVMX1dBUk4pe1xuICAgICAgICAgICAgY29uc29sZS53YXJuKC4uLmFyZ3VtZW50cyk7XG4gICAgICAgIH1cbiAgICB9LFxuXG4gICAgZXJyb3IgOiBmdW5jdGlvbigpe1xuICAgICAgICBpZihMT0dfTEVWRUwgPD0gTE9HX0xFVkVMX0VSUk9SKXtcbiAgICAgICAgICAgIGNvbnNvbGUuZXJyb3IoLi4uYXJndW1lbnRzKTtcbiAgICAgICAgfVxuICAgIH1cblxuf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ICAgICB2YWx1ZSA9IHBhcnNlKHNlcmlhbGl6ZWQpO1xuICAgICAgICAgICAgICAgIHBhcnNlU3VwcG9ydGVkID0gdmFsdWVbXCJhXCJdLmxlbmd0aCA9PSA1ICYmIHZhbHVlW1wiYVwiXVswXSA9PT0gMTtcbiAgICAgICAgICAgICAgICBpZiAocGFyc2VTdXBwb3J0ZWQpIHtcbiAgICAgICAgICAgICAgICAgIGF0dGVtcHQoZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICAvLyBTYWZhcmkgPD0gNS4xLjIgYW5kIEZGIDMuMWIxIGFsbG93IHVuZXNjYXBlZCB0YWJzIGluIHN0cmluZ3MuXG4gICAgICAgICAgICAgICAgICAgIHBhcnNlU3VwcG9ydGVkID0gIXBhcnNlKCdcIlxcdFwiJyk7XG4gICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgIGlmIChwYXJzZVN1cHBvcnRlZCkge1xuICAgICAgICAgICAgICAgICAgICBhdHRlbXB0KGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAvLyBGRiA0LjAgYW5kIDQuMC4xIGFsbG93IGxlYWRpbmcgYCtgIHNpZ25zIGFuZCBsZWFkaW5nXG4gICAgICAgICAgICAgICAgICAgICAgLy8gZGVjaW1hbCBwb2ludHMuIEZGIDQuMCwgNC4wLjEsIGFuZCBJRSA5LTEwIGFsc28gYWxsb3dcbiAgICAgICAgICAgICAgICAgICAgICAvLyBjZXJ0YWluIG9jdGFsIGxpdGVyYWxzLlxuICAgICAgICAgICAgICAgICAgICAgIHBhcnNlU3VwcG9ydGVkID0gcGFyc2UoXCIwMVwiKSAhPT0gMTtcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICBpZiAocGFyc2VTdXBwb3J0ZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgYXR0ZW1wdChmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgLy8gRkYgNC4wLCA0LjAuMSwgYW5kIFJoaW5vIDEuN1IzLVI0IGFsbG93IHRyYWlsaW5nIGRlY2ltYWxcbiAgICAgICAgICAgICAgICAgICAgICAvLyBwb2ludHMuIFRoZXNlIGVudmlyb25tZW50cywgYWxvbmcgd2l0aCBGRiAzLjFiMSBhbmQgMixcbiAgICAgICAgICAgICAgICAgICAgICAvLyBhbHNvIGFsbG93IHRyYWlsaW5nIGNvbW1hcyBpbiBKU09OIG9iamVjdHMgYW5kIGFycmF5cy5cbiAgICAgICAgICAgICAgICAgICAgICBwYXJzZVN1cHBvcnRlZCA9IHBhcnNlKFwiMS5cIikgIT09IDE7XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSwgZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICBwYXJzZVN1cHBvcnRlZCA9IGZhbHNlO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgfVxuICAgICAgICAgIGlzU3VwcG9ydGVkID0gcGFyc2VTdXBwb3J0ZWQ7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIHJldHVybiBoYXNbbmFtZV0gPSAhIWlzU3VwcG9ydGVkO1xuICAgIH1cbiAgICBoYXNbXCJidWctc3RyaW5nLWNoYXItaW5kZXhcIl0gPSBoYXNbXCJkYXRlLXNlcmlhbGl6YXRpb25cIl0gPSBoYXNbXCJqc29uXCJdID0gaGFzW1wianNvbi1zdHJpbmdpZnlcIl0gPSBoYXNbXCJqc29uLXBhcnNlXCJdID0gbnVsbDtcblxuICAgIGlmICghaGFzKFwianNvblwiKSkge1xuICAgICAgLy8gQ29tbW9uIGBbW0NsYXNzXV1gIG5hbWUgYWxpYXNlcy5cbiAgICAgIHZhciBmdW5jdGlvbkNsYXNzID0gXCJbb2JqZWN0IEZ1bmN0aW9uXVwiL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Zm9yIChsZW5ndGggPSBkb250RW51bXMubGVuZ3RoOyBwcm9wZXJ0eSA9IGRvbnRFbnVtc1stLWxlbmd0aF07KSB7XG4gICAgICAgICAgICAgIGlmIChoYXNQcm9wZXJ0eS5jYWxsKG9iamVjdCwgcHJvcGVydHkpKSB7XG4gICAgICAgICAgICAgICAgY2FsbGJhY2socHJvcGVydHkpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAvLyBObyBidWdzIGRldGVjdGVkOyB1c2UgdGhlIHN0YW5kYXJkIGBmb3IuLi5pbmAgYWxnb3JpdGhtLlxuICAgICAgICAgIGZvck93biA9IGZ1bmN0aW9uIChvYmplY3QsIGNhbGxiYWNrKSB7XG4gICAgICAgICAgICB2YXIgaXNGdW5jdGlvbiA9IGdldENsYXNzLmNhbGwob2JqZWN0KSA9PSBmdW5jdGlvbkNsYXNzLCBwcm9wZXJ0eSwgaXNDb25zdHJ1Y3RvcjtcbiAgICAgICAgICAgIGZvciAocHJvcGVydHkgaW4gb2JqZWN0KSB7XG4gICAgICAgICAgICAgIGlmICghKGlzRnVuY3Rpb24gJiYgcHJvcGVydHkgPT0gXCJwcm90b3R5cGVcIikgJiYgaXNQcm9wZXJ0eS5jYWxsKG9iamVjdCwgcHJvcGVydHkpICYmICEoaXNDb25zdHJ1Y3RvciA9IHByb3BlcnR5ID09PSBcImNvbnN0cnVjdG9yXCIpKSB7XG4gICAgICAgICAgICAgICAgY2FsbGJhY2socHJvcGVydHkpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvLyBNYW51YWxseSBpbnZva2UgdGhlIGNhbGxiYWNrIGZvciB0aGUgYGNvbnN0cnVjdG9yYCBwcm9wZXJ0eSBkdWUgdG9cbiAgICAgICAgICAgIC8vIGNyb3NzLWVudmlyb25tZW50IGluY29uc2lzdGVuY2llcy5cbiAgICAgICAgICAgI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JlcnMuXG4gICAgICAgICAgICAgIHRpbWUgPSAodmFsdWUgJSA4NjRlNSArIDg2NGU1KSAlIDg2NGU1O1xuICAgICAgICAgICAgICAvLyBUaGUgaG91cnMsIG1pbnV0ZXMsIHNlY29uZHMsIGFuZCBtaWxsaXNlY29uZHMgYXJlIG9idGFpbmVkIGJ5XG4gICAgICAgICAgICAgIC8vIGRlY29tcG9zaW5nIHRoZSB0aW1lIHdpdGhpbiB0aGUgZGF5LiBTZWUgc2VjdGlvbiAxNS45LjEuMTAuXG4gICAgICAgICAgICAgIGhvdXJzID0gZmxvb3IodGltZSAvIDM2ZTUpICUgMjQ7XG4gICAgICAgICAgICAgIG1pbnV0ZXMgPSBmbG9vcih0aW1lIC8gNmU0KSAlIDYwO1xuICAgICAgICAgICAgICBzZWNvbmRzID0gZmxvb3IodGltZSAvIDFlMykgJSA2MDtcbiAgICAgICAgICAgICAgbWlsbGlzZWNvbmRzID0gdGltZSAlIDFlMztcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGdldERhdGEgPSBmdW5jdGlvbiAodmFsdWUpIHtcbiAgICAgICAgICAgICAgeWVhciA9IHZhbHVlLmdldFVUQ0Z1bGxZZWFyKCk7XG4gICAgICAgICAgICAgIG1vbnRoID0gdmFsdWUuZ2V0VVRDTW9udGgoKTtcbiAgICAgICAgICAgICAgZGF0ZSA9IHZhbHVlLmdldFVUQ0RhdGUoKTtcbiAgICAgICAgICAgICAgaG91cnMgPSB2YWx1ZS5nZXRVVENIb3VycygpO1xuICAgICAgICAgICAgICBtaW51dGVzID0gdmFsdWUuZ2V0VVRDTWludXRlcygpO1xuICAgICAgICAgICAgICBzZWNvbmRzID0gdmFsdWUuZ2V0VVRDU2Vjb25kcygpO1xuICAgICAgICAgICAgICBtaWxsaXNlY29uZHMgPSB2YWx1ZS5nZXRVVENNaWxsaXNlY29uZHMoKTtcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgfVxuICAgIC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rpb24gMTUuMTIuMy5cbiAgICAgICAgICB2YXIgdW5pY29kZVByZWZpeCA9IFwiXFxcXHUwMFwiO1xuICAgICAgICAgIHZhciBlc2NhcGVDaGFyID0gZnVuY3Rpb24gKGNoYXJhY3Rlcikge1xuICAgICAgICAgICAgdmFyIGNoYXJDb2RlID0gY2hhcmFjdGVyLmNoYXJDb2RlQXQoMCksIGVzY2FwZWQgPSBFc2NhcGVzW2NoYXJDb2RlXTtcbiAgICAgICAgICAgIGlmIChlc2NhcGVkKSB7XG4gICAgICAgICAgICAgIHJldHVybiBlc2NhcGVkO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIHVuaWNvZGVQcmVmaXggKyB0b1BhZGRlZFN0cmluZygyLCBjaGFyQ29kZS50b1N0cmluZygxNikpO1xuICAgICAgICAgIH07XG4gICAgICAgICAgdmFyIHJlRXNjYXBlID0gL1tcXHgwMC1cXHgxZlxceDIyXFx4NWNdL2c7XG4gICAgICAgICAgdmFyIHF1b3RlID0gZnVuY3Rpb24gKHZhbHVlKSB7XG4gICAgICAgICAgICByZUVzY2FwZS5sYXN0SW5kZXggPSAwO1xuICAgICAgICAgICAgcmV0dXJuICdcIicgK1xuICAgICAgICAgICAgICAoXG4gICAgICAgICAgICAgICAgcmVFc2NhcGUudGVzdCh2YWx1ZSlcbiAgICAgICAgICAgICAgICAgID8gdmFsdWUucmVwbGFjZShyZUVzY2FwZSwgZXNjYXBlQ2hhcilcbiAgICAgICAgICAgICAgICAgIDogdmFsdWVcbiAgICAgICAgICAgICAgKSArXG4gICAgICAgICAgICAgICdcIic7XG4gICAgICAgICAgfTtcblxuICAgICAgICAgIC8vIEludGVybmFsOiBSZWN1cnNpdmVseSBzZXJpYWxpemVzIGFuIG9iamVjdC4gSW1wbGVtZW50cyB0aGVcbiAgICAgICAgICAvLyBgU3RyKGtleSwgaG9sZGVyKWAsIGBKTyh2YWx1ZSlgLCBhbmQgYEpBKHZhbHVlKWAgb3BlcmF0aW9ucy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x1ZVxuICAgICAgICAgICAgICAvLyBmb3Igc2VyaWFsaXphdGlvbi5cbiAgICAgICAgICAgICAgdmFsdWUgPSBjYWxsYmFjay5jYWxsKG9iamVjdCwgcHJvcGVydHksIHZhbHVlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vIEV4aXQgZWFybHkgaWYgdmFsdWUgaXMgYHVuZGVmaW5lZGAgb3IgYG51bGxgLlxuICAgICAgICAgICAgaWYgKHZhbHVlID09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgICByZXR1cm4gdmFsdWUgPT09IHVuZGVmaW5lZCA/IHZhbHVlIDogXCJudWxsXCI7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB0eXBlID0gdHlwZW9mIHZhbHVlO1xuICAgICAgICAgICAgLy8gT25seSBjYWxsIGBnZXRDbGFzc2AgaWYgdGhlIHZhbHVlIGlzIGFuIG9iamVjdC5cbiAgICAgICAgICAgIGlmICh0eXBlID09IFwib2JqZWN0XCIpIHtcbiAgICAgICAgICAgICAgY2xhc3NOYW1lID0gZ2V0Q2xhc3MuY2FsbCh2YWx1ZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBzd2l0Y2ggKGNsYXNzTmFtZSB8fCB0eXBlKSB7XG4gICAgICAgICAgICAgIGNhc2UgXCJib29sZWFuXCI6XG4gICAgICAgICAgICAgIGNhc2UgYm9vbGVhbkNsYXNzOlxuICAgICAgICAgICAgICAgIC8vIEJvb2xlYW5zIGFyZSByZXByZXNlbnRlZCBsaXRlcmFsbHkuXG4gICAgICAgICAgICAgICAgcmV0dXJuIFwiXCIgKyB2YWx1ZTtcbiAgICAgICAgICAgICAgY2FzZSBcIm51bWJlclwiOlxuICAgICAgICAgICAgICBjYXNlIG51bWJlckNsYXNzOlxuICAgICAgICAgICAgICAgIC8vIEpTT04gbnVtYmVycyBtdXN0IGJlIGZpbml0ZS4gYEluZmluaXR5YCBhbmQgYE5hTmAgYXJlIHNlcmlhbGl6ZWQgYXNcbiAgICAgICAgICAgICAgICAvLyBgXCJudWxsXCJgLlxuICAgICAgICAgICAgICAgIHJldHVybiB2YWx1ZSA+IC0xIC8gMCAmJiB2YWx1ZSA8IDEgLyAwID8gXCJcIiArIHZhbHVlIDogXCJudWxsXCI7XG4gICAgICAgICAgICAgIGNhc2UgXCJzdHJpbmdcIjpcbiAgICAgICAgICAgICAgY2FzZSBzdHJpbmdDbGFzczpcbiAgICAgICAgICAgICAgICAvLyBTdHJpbmdzIGFyZSBkb3VibGUtcXVvdGVkIGFuZCBlc2NhcGVkLlxuICAgICAgICAgICAgICAgIHJldHVybiBxdW90ZShcIlwiICsgdmFsdWUpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy8gUmVjdXJzaXZlbHkgc2VyaWFsaXplIG9iamVjdHMgYW5kIGFycmF5cy5cbiAgICAgICAgICAgIGlmICh0eXBlb2YgdmFsdWUgPT0gXCJvYmplY3RcIikge1xuICAgICAgICAgICAgICAvLyBDaGVjayBmb3IgY3ljbGljIHN0cnVjdHVyZXMuIFRoaXMgaXMgYSBsaW5lYXIgc2VhcmNoOyBwZXJmb3JtYW5jZVxuICAgICAgICAgICAgICAvLyBpcyBpbnZlcnNlbHkgcHJvcG9ydGlvbmFsIHRvIHRoZSBudW1iZXIgb2YgdW5pcXVlIG5lc3RlZCBvYmplY3RzLlxuICAgICAgICAgICAgICBmb3IgKGxlbmd0aCA9IHN0YWNrLmxlbmd0aDsgbGVuZ3RoLS07KSB7XG4gICAgICAgICAgICAgICAgaWYgKHN0YWNrW2xlbmd0aF0gPT09IHZhbHVlKSB7XG4gICAgICAgICAgICAgICAgICAvLyBDeWNsaWMgc3RydWN0dXJlcyBjYW5ub3QgYmUgc2VyaWFsaXplZCBieSBgSlNPTi5zdHJpbmdpZnlgLlxuICAgICAgICAgICAgICAgICAgdGhyb3cgVHlwZUVycm9yKCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIC8vI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yYWN0ZXIsIG5vdCB0aGUgYHNwYWNlYCB7d2lkdGh9IGFyZ3VtZW50IHByb3ZpZGVkIHRvXG4gICAgICAgICAgICAgICAgICAgIC8vIGBKU09OLnN0cmluZ2lmeWAuXG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdHMucHVzaChxdW90ZShwcm9wZXJ0eSkgKyBcIjpcIiArICh3aGl0ZXNwYWNlID8gXCIgXCIgOiBcIlwiKSArIGVsZW1lbnQpO1xuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIHJlc3VsdCA9IHJlc3VsdHMubGVuZ3RoID8gKHdoaXRlc3BhY2UgPyBcIntcXG5cIiArIGluZGVudGF0aW9uICsgcmVzdWx0cy5qb2luKFwiLFxcblwiICsgaW5kZW50YXRpb24pICsgXCJcXG5cIiArIHByZWZpeCArIFwifVwiIDogKFwie1wiICsgcmVzdWx0cy5qb2luKFwiLFwiKSArIFwifVwiKSkgOiBcInt9XCI7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgLy8gUmVtb3ZlIHRoZSBvYmplY3QgZnJvbSB0aGUgdHJhdmVyc2VkIG9iamVjdCBzdGFjay5cbiAgICAgICAgICAgICAgc3RhY2sucG9wKCk7XG4gICAgICAgICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfTtcblxuICAgICAgICAgIC8vIFB1YmxpYzogYEpTT04uc3RyaW5naWZ5YC4gU2VlIEVTIDUuMSBzZWN0aW9uIDE1LjEyLjMuXG4gICAgICAgICAgZXhwb3J0cy5zdHJpbmdpZnkgPSBmdW5jdGlvbiAoc291cmNlLCBmaWx0ZXIsIHdpZHRoKSB7XG4gICAgICAgICAgICB2YXIgd2hpdGVzcGFjZSwgY2FsbGJhY2ssIHByb3BlcnRpZXMsIGNsYXNzTmFtZTtcbiAgICAgICAgICAgIGlmIChvYmplY3RUeXBlc1t0eXBlb2YgZmlsdGVyXSAmJiBmaWx0ZXIpIHtcbiAgICAgICAgICAgICAgY2xhc3NOYW1lID0gZ2V0Q2xhc3MuY2FsbChmaWx0ZXIpO1xuICAgICAgICAgICAgICBpZiAoY2xhc3NOYW1lID09IGZ1bmN0aW9uQ2xhc3MpIHtcbiAgICAgICAgICAgICAgICBjYWxsYmFjayA9IGZpbHRlcjtcbiAgICAgICAgICAgICAgfSBlbHNlIGlmIChjbGFzc05hbWUgPT0gYXJyYXlDbGFzcykge1xuICAgICAgICAgICAgICAgIC8vIENvbnZlcnQgdGhlIHByb3BlcnR5IG5hbWVzIGFycmF5IGludG8gYSBtYWtlc2hpZnQgc2V0LlxuICAgICAgICAgICAgICAgIHByb3BlcnRpZXMgPSB7fTtcbiAgICAgICAgICAgICAgICBmb3IgKHZhciBpbmRleCA9IDAsIGxlbmd0aCA9IGZpbHRlci5sZW5ndGgsIHZhbHVlOyBpbmRleCA8IGxlbmd0aDspIHtcbiAgICAgICAgICAgICAgICAgIHZhbHVlID0gZmlsdGVyW2luZGV4KytdO1xuICAgICAgICAgICAgICAgICAgY2xhc3NOYW1lID0gZ2V0Q2xhc3MuY2FsbCh2YWx1ZSk7XG4gICAgICAgICAgICAgICAgICBpZiAoY2xhc3NOYW1lID09IFwiW29iamVjdCBTdHJpbmddXCIgfHwgY2xhc3NOYW1lID09IFwiW29iamVjdCBOdW1iZXJdXCIpIHtcbiAgICAgICAgICAgICAgICAgICAgcHJvcGVydGllc1t2YWx1ZV0gPSAxO1xuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHdpZHRoKSB7XG4gICAgICAgICAgICAgIGNsYXNzTmFtZSA9IGdldENsYXNzLmNhbGwod2lkdGgpO1xuICAgICAgICAgICAgICBpZiAoY2xhc3NOYW1lID09IG51bWJlckNsYXNzKSB7XG4gICAgICAgICAgICAgICAgLy8gQ29udmVydCB0aGUgYHdpZHRoYCB0byBhbiBpbnRlZ2VyIGFuZCBjcmVhdGUgYSBzdHJpbmcgY29udGFpbmluZ1xuICAgICAgICAgICAgICAgIC8vIGB3aWR0aGAgbnVtYmVyIG9mIHNwYWNlIGNoYXJhY3RlcnMuXG4gICAgICAgICAgICAgICAgaWYgKCh3aWR0aCAtPSB3aWR0aCAlIDEpID4gMCkge1xuICAgICAgICAgICAgICAgICAgaWYgKHdpZHRoID4gMTApIHtcbiAgICAgICAgICAgICAgICAgICAgd2lkdGggPSAxMDtcbiAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgIGZvciAod2hpdGVzcGFjZSA9IFwiXCI7IHdoaXRlc3BhY2UubGVuZ3RoIDwgd2lkdGg7KSB7XG4gICAgICAgICAgICAgICAgICAgIHdoaXRlc3BhY2UgKz0gXCIgXCI7XG4gICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9IGVsc2UgaWYgKGNsYXNzTmFtZSA9PSBzdHJpbmdDbGFzcykge1xuICAgICAgICAgICAgICAgIHdoaXRlc3BhY2UgPSB3aWR0aC5sZW5ndGggPD0gMTAgPyB3aWR0aCA6IHdpZHRoLnNsaWNlKDAsIDEwKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy8gT3BlcmEgPD0gNy41NHUyIGRpc2NhcmRzIHRoZSB2YWx1ZXMgYXNzb2NpYXRlZCB3aXRoIGVtcHR5IHN0cmluZyBrZXlzXG4gICAgICAgICAgICAvLyAoYFwiXCJgKSBvbmx5IGlmIHRoZXkgYXJlIHVzZWQgZGlyZWN0bHkgd2l0aGluIGFuIG9iamVjdCBtZW1iZXIgbGlzdFxuICAgICAgICAgICAgLy8gKGUuZy4sIGAhKFwiXCIgaW4geyBcIlwiOiAxfSlgKS5cbiAgICAgICAgICAgIHJldHVybiBzZXJpYWxpemUoXCJcIiwgKHZhbHVlID0ge30sIHZhbHVlW1wiX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hYm9ydCgpO1xuICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChjaGFyQ29kZSA9PSA5Mikge1xuICAgICAgICAgICAgICAgICAgICAvLyBBIHJldmVyc2Ugc29saWR1cyAoYFxcYCkgbWFya3MgdGhlIGJlZ2lubmluZyBvZiBhbiBlc2NhcGVkXG4gICAgICAgICAgICAgICAgICAgIC8vIGNvbnRyb2wgY2hhcmFjdGVyIChpbmNsdWRpbmcgYFwiYCwgYFxcYCwgYW5kIGAvYCkgb3IgVW5pY29kZVxuICAgICAgICAgICAgICAgICAgICAvLyBlc2NhcGUgc2VxdWVuY2UuXG4gICAgICAgICAgICAgICAgICAgIGNoYXJDb2RlID0gc291cmNlLmNoYXJDb2RlQXQoKytJbmRleCk7XG4gICAgICAgICAgICAgICAgICAgIHN3aXRjaCAoY2hhckNvZGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICBjYXNlIDkyOiBjYXNlIDM0OiBjYXNlIDQ3OiBjYXNlIDk4OiBjYXNlIDExNjogY2FzZSAxMTA6IGNhc2UgMTAyOiBjYXNlIDExNDpcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIFJldml2ZSBlc2NhcGVkIGNvbnRyb2wgY2hhcmFjdGVycy5cbiAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlICs9IFVuZXNjYXBlc1tjaGFyQ29kZV07XG4gICAgICAgICAgICAgICAgICAgICAgICBJbmRleCsrO1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgY2FzZSAxMTc6XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBgXFx1YCBtYXJrcyB0aGUgYmVnaW5uaW5nIG9mIGEgVW5pY29kZSBlc2NhcGUgc2VxdWVuY2UuXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBBZHZhbmNlIHRvIHRoZSBmaXJzdCBjaGFyYWN0ZXIgYW5kIHZhbGlkYXRlIHRoZVxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gZm91ci1kaWdpdCBjb2RlIHBvaW50LlxuICAgICAgICAgICAgICAgICAgICAgICAgYmVnaW4gPSArK0luZGV4O1xuICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChwb3NpdGlvbiA9IEluZGV4ICsgNDsgSW5kZXggPCBwb3NpdGlvbjsgSW5kZXgrKykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICBjaGFyQ29kZSA9IHNvdXJjZS5jaGFyQ29kZUF0KEluZGV4KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gQSB2YWxpZCBzZXF1ZW5jZSBjb21wcmlzZXMgZm91ciBoZXhkaWdpdHMgKGNhc2UtXG4gICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGluc2Vuc2l0aXZlKSB0aGF0IGZvcm0gYSBzaW5nbGUgaGV4YWRlY2ltYWwgdmFsdWUuXG4gICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghKGNoYXJDb2RlID49IDQ4ICYmIGNoYXJDb2RlIDw9IDU3IHx8IGNoYXJDb2RlID49IDk3ICYmIGNoYXJDb2RlIDw9IDEwMiB8fCBjaGFyQ29kZSA+PSA2NSAmJiBjaGFyQ29kZSA8PSA3MCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBJbnZhbGlkIFVuaWNvZGUgZXNjYXBlIHNlcXVlbmNlLlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFib3J0KCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIFJldml2ZSB0aGUgZXNjYXBlZCBjaGFyYWN0ZXIuXG4gICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZSArPSBmcm9tQ2hhckNvZGUoXCIweFwiICsgc291cmNlLnNsaWNlKGJlZ2luLCBJbmRleCkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIEludmFsaWQgZXNjYXBlIHNlcXVlbmNlLlxuICAgICAgICAgICAgICAgICAgICAgICAgYWJvcnQoKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGNoYXJDb2RlID09IDM0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgLy8gQW4gdW5lc2NhcGVkIGRvdWJsZS1xdW90ZSBjaGFyYWN0ZXIgbWFya3MgdGhlIGVuZCBvZiB0aGVcbiAgICAgICAgICAgICAgICAgICAgICAvLyBzdHJpbmcuXG4gICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgY2hhckNvZGUgPSBzb3VyY2UuY2hhckNvZGVBdChJbmRleCk7XG4gICAgICAgICAgICAgICAgICAgIGJlZ2luID0gSW5kZXg7XG4gICAgICAgICAgICAgICAgICAgIC8vIE9wdGltaXplIGZvciB0aGUgY29tbW9uIGNhc2Ugd2hlcmUgYSBzdHJpbmcgaXMgdmFsaWQuXG4gICAgICAgICAgICAgICAgICAgIHdoaWxlIChjaGFyQ29kZSA+PSAzMiAmJiBjaGFyQ29kZSAhPSA5MiAmJiBjaGFyQ29kZSAhPSAzNCkge1xuICAgICAgICAgICAgICAgICAgICAgIGNoYXJDb2RlID0gc291cmNlLmNoYXJDb2RlQXQoKytJbmRleCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgLy8gQXBwZW5kIHRoZSBzdHJpbmcgYXMtaXMuXG4gICAgICAgICAgICAgICAgICAgIHZhbHVlICs9IHNvdXJjZS5zbGljZShiZWdpbiwgSW5kZXgpO1xuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoc291cmNlLmNoYXJDb2RlQXQoSW5kZXgpID09IDM0KSB7XG4gICAgICAgICAgICAgICAgICAvLyBBZHZhbmNlIHRvIHRoZSBuZXh0IGNoYXJhY3RlciBhbmQgcmV0dXJuIHRoZSByZXZpdmVkIHN0cmluZy5cbiAgICAgICAgICAgICAgICAgIEluZGV4Kys7XG4gICAgICAgICAgICAgICAgICByZXR1cm4gdmFsdWU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIC8vIFVudGVybWluYXRlZCBzdHJpbmcuXG4gICAgICAgICAgICAgICAgYWJvcnQoKTtcbiAgICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgICAgICAvLyBQYXJzZSBudW1iZXJzIGFuZCBsaXRlcmFscy5cbiAgICAgICAgICAgICAgICBiZWdpbiA9IEluZGV4O1xuICAgICAgICAgICAgICAgIC8vIEFkdmFuY2UgcGFzdCB0aGUgbmVnYXRpdmUgc2lnbiwgaWYgb25lIGlzIHNwZWNpZmllZC5cbiAgICAgICAgICAgICAgICBpZiAoY2hhckNvZGUgPT0gNDUpIHtcbiAgICAgICAgICAgICAgICAgIGlzU2lnbmVkID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgIGNoYXJDb2RlID0gc291cmNlLmNoYXJDb2RlQXQoKytJbmRleCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIC8vIFBhcnNlIGFuIGludGVnZXIgb3IgZmxvYXRpbmctcG9pbnQgdmFsdWUuXG4gICAgICAgICAgICAgICAgaWYgKGNoYXJDb2RlID49IDQ4ICYmIGNoYXJDb2RlIDw9IDU3KSB7XG4gICAgICAgICAgICAgICAgICAvLyBMZWFkaW5nIHplcm9lcyBhcmUgaW50ZXJwcmV0ZWQgYXMgb2N0YWwgbGl0ZXJhbHMuXG4gICAgICAgICAgICAgICAgICBpZiAoY2hhckNvZGUgPT0gNDggJiYgKChjaGFyQ29kZSA9IHNvdXJjZS5jaGFyQ29kZUF0KEluZGV4ICsgMSkpLCBjaGFyQ29kZSA+PSA0OCAmJiBjaGFyQ29kZSA8PSA1NykpIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gSWxsZWdhbCBvY3RhbCBsaXRlcmFsLlxuICAgICAgICAgICAgICAgICAgICBhYm9ydCgpO1xuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgaXNTaWduZWQgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgIC8vIFBhcnNlIHRoZSBpbnRlZ2VyIGNvbXBvbmVudC5cbiAgICAgICAgICAgICAgICAgIGZvciAoOyBJbmRleCA8IGxlbmd0aCAmJiAoKGNoYXJDb2RlID0gc291cmNlLmNoYXJDb2RlQXQoSW5kZXgpKSwgY2hhckNvZGUgPj0gNDggJiYgY2hhckNvZGUgPD0gNTcpOyBJbmRleCsrKTtcbiAgICAgICAgICAgICAgICAgIC8vIEZsb2F0cyBjYW5ub3QgY29udGFpbiBhIGxlYWRpbmcgZGVjaW1hbCBwb2ludDsgaG93ZXZlciwgdGhpc1xuICAgICAgICAgICAgICAgICAgLy8gY2FzZSBpcyBhbHJlYWR5IGFjY291bnRlZCBmb3IgYnkgdGhlIHBhcnNlci5cbiAgICAgICAgICAgICAgICAgIGlmIChzb3VyY2UuY2hhckNvZGVBdChJbmRleCkgPT0gNDYpIHtcbiAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSArK0luZGV4O1xuICAgICAgICAgICAgICAgICAgICAvLyBQYXJzZSB0aGUgZGVjaW1hbCBjb21wb25lbnQuXG4gICAgICAgICAgICAgICAgICAgIGZvciAoOyBwb3NpdGlvbiA8IGxlbmd0aDsgcG9zaXRpb24rKykge1xuICAgICAgICAgICAgICAgICAgICAgIGNoYXJDb2RlID0gc291cmNlLmNoYXJDb2RlQXQocG9zaXRpb24pO1xuICAgICAgICAgICAgICAgICAgICAgIGlmIChjaGFyQ29kZSA8IDQ4IHx8IGNoYXJDb2RlID4gNTcpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAocG9zaXRpb24gPT0gSW5kZXgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAvLyBJbGxlZ2FsIHRyYWlsaW5nIGRlY2ltYWwuXG4gICAgICAgICAgICAgICAgICAgICAgYWJvcnQoKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBJbmRleCA9IHBvc2l0aW9uO1xuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgLy8gUGFyc2UgZXhwb25lbnRzLiBUaGUgYGVgIGRlbm90aW5nIHRoZSBleHBvbmVudCBpc1xuICAgICAgICAgICAgICAgICAgLy8gY2FzZS1pbnNlbnNpdGl2ZS5cbiAgICAgICAgICAgICAgICAgIGNoYXJDb2RlID0gc291cmNlLmNoYXJDb2RlQXQoSW5kZXgpO1xuICAgICAgICAgICAgICAgICAgaWYgKGNoYXJDb2RlID09IDEwMSB8fCBjaGFyQ29kZSA9PSA2OSkge1xuICAgICAgICAgICAgICAgICAgICBjaGFyQ29kZSA9IHNvdXJjZS5jaGFyQ29kZUF0KCsrSW5kZXgpO1xuICAgICAgICAgICAgICAgICAgICAvLyBTa2lwIHBhc3QgdGhlIHNpZ24gZm9sbG93aW5nIHRoZSBleHBvbmVudCwgaWYgb25lIGlzXG4gICAgICAgICAgICAgICAgICAgIC8vIHNwZWNpZmllZC5cbiAgICAgICAgICAgICAgICAgICAgaWYgKGNoYXJDb2RlID09IDQzIHx8IGNoYXJDb2RlID09IDQ1KSB7XG4gICAgICAgICAgICAgICAgICAgICAgSW5kZXgrKztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAvLyBQYXJzZSB0aGUgZXhwb25lbnRpYWwgY29tcG9uZW50LlxuICAgICAgICAgICAgICAgICAgICBmb3IgKHBvc2l0aW9uID0gSW5kZXg7IHBvc2l0aW9uIDwgbGVuZ3RoOyBwb3NpdGlvbisrKSB7XG4gICAgICAgICAgICAgICAgICAgICAgY2hhckNvZGUgPSBzb3VyY2UuY2hhckNvZGVBdChwb3NpdGlvbik7XG4gICAgICAgICAgICAgICAgICAgICAgaWYgKGNoYXJDb2RlIDwgNDggfHwgY2hhckNvZGUgPiA1Nykge1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmIChwb3NpdGlvbiA9PSBJbmRleCkge1xuICAgICAgICAgICAgICAgICAgICAgIC8vIElsbGVnYWwgZW1wdHkgZXhwb25lbnQuXG4gICAgICAgICAgICAgICAgICAgICAgYWJvcnQoKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBJbmRleCA9IHBvc2l0aW9uO1xuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgLy8gQ29lcmNlIHRoZSBwYXJzZWQgdmFsdWUgdG8gYSBKYXZhU2NyaXB0IG51bWJlci5cbiAgICAgICAgICAgICAgICAgIHJldHVybiArc291cmNlLnNsaWNlKGJlZ2luLCBJbmRleCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIC8vIEEgbmVnYXRpdmUgc2lnbiBtYXkgb25seSBwcmVjZWRlIG51bWJlcnMuXG4gICAgICAgICAgICAgICAgaWYgKGlzU2lnbmVkKSB7XG4gICAgICAgICAgICAgICAgICBhYm9ydCgpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAvLyBgdHJ1ZWAsIGBmYWxzZWAsIGFuZCBgbnVsbGAgbGl0ZXJhbHMuXG4gICAgICAgICAgICAgICAgdmFyIHRlbXAgPSBzb3VyY2Uuc2xpY2UoSW5kZXgsIEluZGV4ICsgNCk7XG4gICAgICAgICAgICAgICAgaWYgKHRlbXAgPT0gXCJ0cnVlXCIpIHtcbiAgICAgICAgICAgICAgICAgIEluZGV4ICs9IDQ7XG4gICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHRlbXAgPT0gXCJmYWxzXCIgJiYgc291cmNlLmNoYXJDb2RlQXQoSW5kZXggKyA0ICkgPT0gMTAxKSB7XG4gICAgICAgICAgICAgICAgICBJbmRleCArPSA1O1xuICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodGVtcCA9PSBcIm51bGxcIikge1xuICAgICAgICAgICAgICAgICAgSW5kZXggKz0gNDtcbiAgICAgICAgICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAvLyBVbnJlY29nbml6ZWQgdG9rZW4uXG4gICAgICAgICAgICAgICAgYWJvcnQoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgLy8gUmV0dXJuIHRoZSBzZW50aW5lbCBgJGAgY2hhcmFjdGVyIGlmIHRoZSBwYXJzZXIgaGFzIHJlYWNoZWQgdGhlIGVuZFxuICAgICAgICAgIC8vIG9mIHRoZSBzb3VyY2Ugc3RyaW5nLlxuICAgICAgICAgIHJldHVybiBcIiRcIjtcbiAgICAgICAgfTtcblxuICAgICAgICAvLyBJbnRlcm5hbDogUGFyc2VzIGEgSlNPTiBgdmFsdWVgIHRva2VuLlxuICAgICAgICB2YXIgZ2V0ID0gZnVuY3Rpb24gKHZhbHVlKSB7XG4gICAgICAgICAgdmFyIHJlc3VsdHMsIGhhc01lbWJlcnM7XG4gICAgICAgICAgaWYgKHZhbHVlID09IFwiJFwiKSB7XG4gICAgICAgICAgICAvLyBVbmV4cGVjdGVkIGVuZCBvZiBpbnB1dC5cbiAgICAgICAgICAgIGFib3J0KCk7XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmICh0eXBlb2YgdmFsdWUgPT0gXCJzdHJpbmdcIikge1xuICAgICAgICAgICAgaWYgKChjaGFySW5kZXhCdWdneSA/IHZhbHVlLmNoYXJBdCgwKSA6IHZhbHVlWzBdKSA9PSBcIkBcIikge1xuICAgICAgICAgICAgICAvLyBSZW1vdmUgdGhlIHNlbnRpbmVsIGBAYCBjaGFyYWN0ZXIuXG4gICAgICAgICAgICAgIHJldHVybiB2YWx1ZS5zbGljZSgxKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vIFBhcnNlIG9iamVjdCBhbmQgYXJyYXkgbGl0ZXJhbHMuXG4gICAgICAgICAgICBpZiAodmFsdWUgPT0gXCJbXCIpIHtcbiAgICAgICAgICAgICAgLy8gUGFyc2VzIGEgSlNPTiBhcnJheSwgcmV0dXJuaW5nIGEgbmV3IEphdmFTY3JpcHQgYXJyYXkuXG4gICAgICAgICAgICAgIHJlc3VsdHMgPSBbXTtcbiAgICAgICAgICAgICAgZm9yICg7Oykge1xuICAgICAgICAgICAgICAgIHZhbHVlID0gbGV4KCk7XG4gICAgICAgICAgICAgICAgLy8gQSBjbG9zaW5nIHNxdWFyZSBicmFja2V0IG1hcmtzIHRoZSBlbmQgb2YgdGhlIGFycmF5IGxpdGVyYWwuXG4gICAgICAgICAgICAgICAgaWYgKHZhbHVlID09IFwiXVwiKSB7XG4gICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgLy8gSWYgdGhlIGFycmF5IGxpdGVyYWwgY29udGFpbnMgZWxlbWVudHMsIHRoZSBjdXJyZW50IHRva2VuXG4gICAgICAgICAgICAgICAgLy8gc2hvdWxkIGJlIGEgY29tbWEgc2VwYXJhdGluZyB0aGUgcHJldmlvdXMgZWxlbWVudCBmcm9tIHRoZVxuICAgICAgICAgICAgICAgIC8vIG5leHQuXG4gICAgICAgICAgICAgICAgaWYgKGhhc01lbWJlcnMpIHtcbiAgICAgICAgICAgICAgICAgIGlmICh2YWx1ZSA9PSBcIixcIikge1xuICAgICAgICAgICAgICAgICAgICB2YWx1ZSA9IGxleCgpO1xuICAgICAgICAgICAgICAgICAgICBpZiAodmFsdWUgPT0gXCJdXCIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAvLyBVbmV4cGVjdGVkIHRyYWlsaW5nIGAsYCBpbiBhcnJheSBsaXRlcmFsLlxuICAgICAgICAgICAgICAgICAgICAgIGFib3J0KCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIEEgYCxgIG11c3Qgc2VwYXJhdGUgZWFjaCBhcnJheSBlbGVtZW50LlxuICAgICAgICAgICAgICAgICAgICBhYm9ydCgpO1xuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICBoYXNNZW1iZXJzID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgLy8gRWxpc2lvbnMgYW5kIGxlYWRpbmcgY29tbWFzIGFyZSBub3QgcGVybWl0dGVkLlxuICAgICAgICAgICAgICAgIGlmICh2YWx1ZSA9PSBcIixcIikge1xuICAgICAgICAgICAgICAgICAgYWJvcnQoKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmVzdWx0cy5wdXNoKGdldCh2YWx1ZSkpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIHJldHVybiByZXN1bHRzO1xuICAgICAgICAgICAgfSBlbHNlIGlmICh2YWx1ZSA9PSBcIntcIikge1xuICAgICAgICAgICAgICAvLyBQYXJzZXMgYSBKU09OIG9iamVjdCwgcmV0dXJuaW5nIGEgbmV3IEphdmFTY3JpcHQgb2JqZWN0LlxuICAgICAgICAgICAgICByZXN1bHRzID0ge307XG4gICAgICAgICAgICAgIGZvciAoOzspIHtcbiAgICAgICAgICAgICAgICB2YWx1ZSA9IGxleCgpO1xuICAgICAgICAgICAgICAgIC8vIEEgY2xvc2luZyBjdXJseSBicmFjZSBtYXJrcyB0aGUgZW5kIG9mIHRoZSBvYmplY3QgbGl0ZXJhbC5cbiAgICAgICAgICAgICAgICBpZiAodmFsdWUgPT0gXCJ9XCIpIHtcbiAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAvLyBJZiB0aGUgb2JqZWN0IGxpdGVyYWwgY29udGFpbnMgbWVtYmVycywgdGhlIGN1cnJlbnQgdG9rZW5cbiAgICAgICAgICAgICAgICAvLyBzaG91bGQgYmUgYSBjb21tYSBzZXBhcmF0b3IuXG4gICAgICAgICAgICAgICAgaWYgKGhhc01lbWJlcnMpIHtcbiAgICAgICAgICAgICAgICAgIGlmICh2YWx1ZSA9PSBcIixcIikge1xuICAgICAgICAgICAgICAgICAgICB2YWx1ZSA9IGxleCgpO1xuICAgICAgICAgICAgICAgICAgICBpZiAodmFsdWUgPT0gXCJ9XCIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAvLyBVbmV4cGVjdGVkIHRyYWlsaW5nIGAsYCBpbiBvYmplY3QgbGl0ZXJhbC5cbiAgICAgICAgICAgICAgICAgICAgICBhYm9ydCgpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAvLyBBIGAsYCBtdXN0IHNlcGFyYXRlIGVhY2ggb2JqZWN0IG1lbWJlci5cbiAgICAgICAgICAgICAgICAgICAgYWJvcnQoKTtcbiAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgaGFzTWVtYmVycyA9IHRydWU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIC8vIExlYWRpbmcgY29tbWFzIGFyZSBub3QgcGVybWl0dGVkLCBvYmplY3Qg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oZSBtZXRob2QgcmV0dXJucyBhbiBlbXB0eSBzdHJpbmcgd2hlbiB0aGUgaG9zdG5hbWUgaXMgYW4gaXAgb3IgYGxvY2FsaG9zdGAuXG4gKlxuICogRXhhbXBsZSBsZXZlbHM6XG4gKlxuICogICAgICBkb21haW4ubGV2ZWxzKCdodHRwOi8vd3d3Lmdvb2dsZS5jby51aycpO1xuICogICAgICAvLyA9PiBbXCJjby51a1wiLCBcImdvb2dsZS5jby51a1wiLCBcInd3dy5nb29nbGUuY28udWtcIl1cbiAqXG4gKiBFeGFtcGxlOlxuICpcbiAqICAgICAgZG9tYWluKCdodHRwOi8vbG9jYWxob3N0OjMwMDAvYmF6Jyk7XG4gKiAgICAgIC8vID0+ICcnXG4gKiAgICAgIGRvbWFpbignaHR0cDovL2RldjozMDAwL2JheicpO1xuICogICAgICAvLyA9PiAnJ1xuICogICAgICBkb21haW4oJ2h0dHA6Ly8xMjcuMC4wLjE6MzAwMC9iYXonKTtcbiAqICAgICAgLy8gPT4gJydcbiAqICAgICAgZG9tYWluKCdodHRwOi8vc2VnbWVudC5pby9iYXonKTtcbiAqICAgICAgLy8gPT4gJ3NlZ21lbnQuaW8nXG4gKlxuICogQHBhcmFtIHtzdHJpbmd9IHVybFxuICogQHJldHVybiB7c3RyaW5nfVxuICogQGFwaSBwdWJsaWNcbiAqL1xuZnVuY3Rpb24gZG9tYWluKHVybCkge1xuICB2YXIgY29va2llID0gZXhwb3J0cy5jb29raWU7XG4gIHZhciBsZXZlbHMgPSBleHBvcnRzLmxldmVscyh1cmwpO1xuXG4gIC8vIExvb2t1cCB0aGUgcmVhbCB0b3AgbGV2ZWwgb25lLlxuICBmb3IgKHZhciBpID0gMDsgaSA8IGxldmVscy5sZW5ndGg7ICsraSkge1xuICAgIHZhciBjbmFtZSA9ICdfX3RsZF9fJztcbiAgICB2YXIgZG9tYWluID0gbGV2ZWxzW2ldO1xuICAgIHZhciBvcHRzID0geyBkb21haW46ICcuJyArIGRvbWFpbiB9O1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ghZikge1xuICAgICAgICAgICAgZiA9IHRydWU7XG4gICAgICAgICAgICB2YXIgYSA9IGQuZ2V0RWxlbWVudEJ5SWQoXCJfdmlzX29wdF9wYXRoX2hpZGVzXCIpO1xuICAgICAgICAgICAgaWYgKGEpIGEucGFyZW50Tm9kZS5yZW1vdmVDaGlsZChhKTtcbiAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIGZpbmlzaGVkOiBmdW5jdGlvbigpIHtcbiAgICAgICAgICByZXR1cm4gZjtcbiAgICAgICAgfSxcbiAgICAgICAgbG9hZDogZnVuY3Rpb24oYSkge1xuICAgICAgICAgIHZhciBiID0gZC5jcmVhdGVFbGVtZW50KFwic2NyaXB0XCIpO1xuICAgICAgICAgIGIuc3JjID0gYTtcbiAgICAgICAgICBiLnR5cGUgPSBcInRleHQvamF2YXNjcmlwdFwiO1xuICAgICAgICAgIGIuaW5uZXJUZXh0O1xuICAgICAgICAgIGIub25lcnJvciA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgX3Z3b19jb2RlLmZpbmlzaCgpO1xuICAgICAgICAgIH07XG4gICAgICAgICAgZC5nZXRFbGVtZW50c0J5VGFnTmFtZShcImhlYWRcIilbMF0uYXBwZW5kQ2hpbGQoYik7XG4gICAgICAgIH0sXG4gICAgICAgIGluaXQ6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgIHZhciBzZXR0aW5nc190aW1lciA9IHNldFRpbWVvdXQoXG4gICAgICAgICAgICBcIl92d29fY29kZS5maW5pc2goKVwiLFxuICAgICAgICAgICAgc2V0dGluZ3NfdG9sZXJhbmNlXG4gICAgICAgICAgKTtcbiAgICAgICAgICB2YXIgYSA9IGQuY3JlYXRlRWxlbWVudChcInN0eWxlXCIpLFxuICAgICAgICAgICAgYiA9XG4gICAgICAgICAgICAgIFwiYm9keXtvcGFjaXR5OjAgIWltcG9ydGFudDtmaWx0ZXI6YWxwaGEob3BhY2l0eT0wKSAhaW1wb3J0YW50O2JhY2tncm91bmQ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ZGVudGlmeSkge1xuICAgICAgdGhpcy5leHBlcmltZW50Vmlld2VkKCk7XG4gICAgfVxuICB9XG5cbiAgZXhwZXJpbWVudFZpZXdlZCgpIHtcbiAgICB3aW5kb3cuVldPID0gd2luZG93LlZXTyB8fCBbXTtcbiAgICB2YXIgc2VsZiA9IHRoaXM7XG4gICAgd2luZG93LlZXTy5wdXNoKFtcbiAgICAgIFwib25WYXJpYXRpb25BcHBsaWVkXCIsXG4gICAgICAoZGF0YSkgPT4ge1xuICAgICAgICBpZiAoIWRhdGEpIHtcbiAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cbiAgICAgICAgbG9nZ2VyLmRlYnVnKFwiVmFyaWF0aW9uIEFwcGxpZWRcIik7XG4gICAgICAgIHZhciBleHBJZCA9IGRhdGFbMV0sXG4gICAgICAgICAgdmFyaWF0aW9uSWQgPSBkYXRhWzJdO1xuICAgICAgICBsb2dnZXIuZGVidWcoXG4gICAgICAgICAgXCJleHBlcmltZW50IGlkOlwiLFxuICAgICAgICAgIGV4cElkLFxuICAgICAgICAgIFwiVmFyaWF0aW9uIE5hbWU6XCIsXG4gICAgICAgICAgX3Z3b19leHBbZXhwSWRdLmNvbWJfblt2YXJpYXRpb25JZF1cbiAgICAgICAgKTtcbiAgICAgICAgaWYgKFxuICAgICAgICAgIHR5cGVvZiBfdndvX2V4cFtleHBJZF0uY29tYl9uW3ZhcmlhdGlvbklkXSAhPT0gXCJ1bmRlZmluZWRcIiAmJlxuICAgICAgICAgIFtcIlZJU1VBTF9BQlwiLCBcIlZJU1VBTFwiLCBcIlNQTElUX1VSTFwiLCBcIlNVUlZFWVwiXS5pbmRleE9mKFxuICAgICAgICAgICAgX3Z3b19leHBbZXhwSWRdLnR5cGVcbiAgICAgICAgICApID4gLTFcbiAgICAgICAgKSB7XG4gICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgIGlmIChzZWxmLnNlbmRFeHBlcmltZW50VHJhY2spIHtcbiAgICAgICAgICAgICAgbG9nZ2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b250ZW50Q2FyZHMgZGlzcGxheS50b2dnbGVDb250ZW50Q2FyZHMgc2hhcmVkTGliXCIuc3BsaXQoXG4gICAgICAgICAgICBcIiBcIlxuICAgICAgICAgICksXG4gICAgICAgICAgaSA9IDA7XG4gICAgICAgIGkgPCBzLmxlbmd0aDtcbiAgICAgICAgaSsrXG4gICAgICApIHtcbiAgICAgICAgZm9yIChcbiAgICAgICAgICB2YXIgbSA9IHNbaV0sIGsgPSBhLmFwcGJveSwgbCA9IG0uc3BsaXQoXCIuXCIpLCBqID0gMDtcbiAgICAgICAgICBqIDwgbC5sZW5ndGggLSAxO1xuICAgICAgICAgIGorK1xuICAgICAgICApXG4gICAgICAgICAgayA9IGtbbFtqXV07XG4gICAgICAgIGtbbFtqXV0gPSBuZXcgRnVuY3Rpb24oXG4gICAgICAgICAgXCJyZXR1cm4gZnVuY3Rpb24gXCIgK1xuICAgICAgICAgICAgbS5yZXBsYWNlKC9cXC4vZywgXCJfXCIpICtcbiAgICAgICAgICAgIFwiKCl7d2luZG93LmFwcGJveVF1ZXVlLnB1c2goYXJndW1lbnRzKTsgcmV0dXJuIHRydWV9XCJcbiAgICAgICAgKSgpO1xuICAgICAgfVxuICAgICAgd2luZG93LmFwcGJveS5nZXRVc2VyID0gZnVuY3Rpb24oKSB7XG4gICAgICAgIHJldHVybiBuZXcgd2luZG93LmFwcGJveS5hYi5Vc2VyKCk7XG4gICAgICB9O1xuICAgICAgd2luZG93LmFwcGJveS5nZXRDYWNoZWRGZWVkID0gZnVuY3Rpb24oKSB7XG4gICAgICAgIHJldHVybiBuZXcgd2luZG93LmFwcGJveS5hYi5GZWVkKCk7XG4gICAgICB9O1xuICAgICAgd2luZG93LmFwcGJveS5nZXRDYWNoZWRDb250ZW50Q2FyZHMgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgcmV0dXJuIG5ldyB3aW5kb3cuYXBwYm95LmFiLkNvbnRlbnRDYXJkcygpO1xuICAgICAgfTtcbiAgICAgICh5ID0gcC5j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G4gICAgICAgIGNvbnN0IHZhbHVlID0gY29udGV4dC50cmFpdHNbZmllbGRdO1xuXG4gICAgICAgIGlmIChmaWVsZCA9PT0gXCJjb21wYW55XCIpIHtcbiAgICAgICAgICBsZXQgY29tcGFuaWVzID0gW107XG4gICAgICAgICAgbGV0IGNvbXBhbnkgPSB7fTtcbiAgICAgICAgICAvLyBzcGVjaWFsIGhhbmRsaW5nIHN0cmluZ1xuICAgICAgICAgIGlmICh0eXBlb2YgY29udGV4dC50cmFpdHNbZmllbGRdID09IFwic3RyaW5nXCIpIHtcbiAgICAgICAgICAgIGNvbXBhbnlbXCJjb21wYW55X2lkXCJdID0gbWQ1KGNvbnRleHQudHJhaXRzW2ZpZWxkXSk7XG4gICAgICAgICAgfVxuICAgICAgICAgIGNvbnN0IGNvbXBhbnlGaWVsZHMgPVxuICAgICAgICAgICAgKHR5cGVvZiBjb250ZXh0LnRyYWl0c1tmaWVsZF0gPT0gXCJvYmplY3RcIiAmJlxuICAgICAgICAgICAgICBPYmplY3Qua2V5cyhjb250ZXh0LnRyYWl0c1tmaWVsZF0pKSB8fFxuICAgICAgICAgICAgW107XG4gICAgICAgICAgY29tcGFueUZpZWxkcy5mb3JFYWNoKGtleSA9PiB7XG4gICAgICAgICAgICBpZiAoY29tcGFueUZpZWxkcy5oYXNPd25Qcm9wZXJ0eShrZXkpKSB7XG4gICAgICAgICAgICAgIGlmIChrZXkgIT0gXCJpZFwiKSB7XG4gICAgICAgICAgICAgICAgY29tcGFueVtrZXldID0gY29udGV4dC50cmFpdHNbZmllbGRdW2tleV07XG4gICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgY29tcGFueVtcImNvbXBhbnlfaWRcIl0gPSBjb250ZXh0LnRyYWl0c1tmaWVsZF1ba2V5XTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgaWYgKFxuICAgICAgICAgICAgdHlwZW9mIGNvbnRleHQudHJhaXRzW2ZpZWxkXSA9PSBcIm9iamVjdFwiICYmXG4gICAgICAgICAgICAhY29tcGFueUZpZWxkcy5pbmNsdWRlcyhcImlkXCIpXG4gICAgICAgICAgKSB7XG4gICAgICAgICAgICBjb21wYW55W1wiY29tcGFueV9pZFwiXSA9IG1kNShjb21wYW55Lm5hbWUpO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIGNvbXBhbmllcy5wdXNoKGNvbXBhbnkpO1xuICAgICAgICAgIHJhd1BheWxvYWQuY29tcGFuaWVzID0gY29tcGFuaWVzO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIHJhd1BheWxvYWRbZmllbGRdID0gY29udGV4dC50cmFpdHNbZmllbGRdO1xuICAgICAgICB9XG5cbiAgICAgICAgc3dpdGNoIChmaWVsZCkge1xuICAgICAgICAgIGNhc2UgXCJjcmVhdGVkQXRcIjpcbiAgICAgICAgICAgIHJhd1BheWxvYWRbXCJjcmVhdGVkX2F0XCJdID0gdmFsdWU7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICBjYXNlIFwiYW5vbnltb3VzSWRcIjpcbiAgICAgICAgICAgIHJhd1BheWxvYWRbXCJ1c2VyX2lkXCJdID0gdmFsdWU7XG4gICAgICAgICAgICBicmVhaztcblxuICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH0pO1xuICAgIHJhd1BheWxvYWQudXNlcl9pZCA9IHJ1ZGRlckVsZW1lbnQubWVzc2FnZS51c2VySWQ7XG4gICAgd2luZG93LkludGVyY29tKFwidXBkYXRlXCIsIHJhd1BheWxvYWQpO1xuICB9XG5cbiAgdHJhY2socnVkZGVyRWxlbWVudCkge1xuICAgIGxldCByYXdQYXlsb2FkID0ge307XG4gICAgY29uc3QgbWVzc2FnZSA9IHJ1ZGRlckVsZW1lbnQubWVzc2FnZTtcblxuICAgIGNvbnN0IHByb3BlcnRpZXMgPSBtZXN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blxuICAgIGZ1bmN0aW9uIGxvb3AoKSB7XG4gICAgICBmb3IgKGtleSBpbiBvYmopIHtcbiAgICAgICAgdmFyIG5vcm1hbGl6ZWRLZXkgPSBub3JtYWxpemUoa2V5KTtcbiAgICAgICAgaWYgKDAgPT09IHBhdGguaW5kZXhPZihub3JtYWxpemVkS2V5KSkge1xuICAgICAgICAgIHZhciB0ZW1wID0gcGF0aC5zdWJzdHIobm9ybWFsaXplZEtleS5sZW5ndGgpO1xuICAgICAgICAgIGlmICh0ZW1wLmNoYXJBdCgwKSA9PT0gJy4nIHx8IHRlbXAubGVuZ3RoID09PSAwKSB7XG4gICAgICAgICAgICBwYXRoID0gdGVtcC5zdWJzdHIoMSk7XG4gICAgICAgICAgICB2YXIgY2hpbGQgPSBvYmpba2V5XTtcblxuICAgICAgICAgICAgLy8gd2UncmUgYXQgdGhlIGVuZCBhbmQgdGhlcmUgaXMgbm90aGluZy5cbiAgICAgICAgICAgIGlmIChudWxsID09IGNoaWxkKSB7XG4gICAgICAgICAgICAgIGZpbmlzaGVkID0gdHJ1ZTtcbiAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAvLyB3ZSdyZSBhdCB0aGUgZW5kIGFuZCB0aGVyZSBpcyBzb21ldGhpbmcuXG4gICAgICAgICAgICBpZiAoIXBhdGgubGVuZ3RoKSB7XG4gICAgICAgICAgICAgIGZpbmlzaGVkID0gdHJ1ZTtcbiAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAvLyBzdGVwIGludG8gY2hpbGRcbiAgICAgICAgICAgIG9iaiA9IGNoaWxkO1xuXG4gICAgICAgICAgICAvLyBidXQgd2UncmUgZG9uZSBoZXJlXG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG5cbiAgICAgIGtleSA9IHVuZGVmaW5lZDtcbiAgICAgIC8vIGlmIHdlIGZ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AgIGlmICh2YWx1ZSA9PT0gbnVsbCB8fCB0eXBlb2YgdmFsdWUgPT09IFwidW5kZWZpbmVkXCIpIGNvbnRpbnVlO1xuXG4gICAgICAgIC8vIGNvbnZlcnQgZGF0ZSB0byB1bml4XG4gICAgICAgIGlmIChpcy5kYXRlKHZhbHVlKSkge1xuICAgICAgICAgIHJldFtrXSA9IHRoaXMudG9Vbml4VGltZXN0YW1wKHZhbHVlKTtcbiAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIGxlYXZlIGJvb2xlYW4gYXMgaXNcbiAgICAgICAgaWYgKGlzLmJvb2wodmFsdWUpKSB7XG4gICAgICAgICAgcmV0W2tdID0gdmFsdWU7XG4gICAgICAgICAgY29udGludWU7XG4gICAgICAgIH1cblxuICAgICAgICAvLyBsZWF2ZSAgbnVtYmVycyBhcyBpc1xuICAgICAgICBpZiAoaXMubnVtYmVyKHZhbHVlKSkge1xuICAgICAgICAgIHJldFtrXSA9IHZhbHVlO1xuICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gY29udmVydCBub24gb2JqZWN0cyB0byBzdHJpbmdzXG4gICAgICAgIGxvZ2dlci5kZWJ1Zyh2YWx1ZS50b1N0cmluZygpKTtcbiAgICAgICAgaWYgKHZhbHVlLnRvU3RyaW5nKCkgIT09IFwiW29iamVjdCBPYmplY3RdXCIpIHtcbiAgICAgICAgICByZXRba10gPSB2YWx1ZS50b1N0cmluZygpO1xuICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8ganNvblxuICAgICAgICAvLyBtdXN0IGZsYXR0ZW4gaW5jbHVkaW5nIHRoZSBuYW1lIG9mIHRoZSBvcmlnaW5hbCB0cmFpdC9wcm9wZXJ0eVxuICAgICAgICB2YXIgbmVzdGVkT2JqID0ge307XG4gICAgICAgIG5lc3RlZE9ialtrXSA9IHZhbHVlO1xuICAgICAgICB2YXIgZmxh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JvcGVydHkoa2V5KSkge1xuICAgICAgICAgIHZhciB2YWx1ZSA9IG9iamVjdFtrZXldO1xuICAgICAgICAgIHZhciBpc2FycmF5ID0gb3B0cy5zYWZlICYmIGlzLmFycmF5KHZhbHVlKTtcbiAgICAgICAgICB2YXIgdHlwZSA9IE9iamVjdC5wcm90b3R5cGUudG9TdHJpbmcuY2FsbCh2YWx1ZSk7XG4gICAgICAgICAgdmFyIGlzb2JqZWN0ID1cbiAgICAgICAgICAgIHR5cGUgPT09IFwiW29iamVjdCBPYmplY3RdXCIgfHwgdHlwZSA9PT0gXCJbb2JqZWN0IEFycmF5XVwiO1xuICAgICAgICAgIHZhciBhcnIgPSBbXTtcblxuICAgICAgICAgIHZhciBuZXdLZXkgPSBwcmV2ID8gcHJldiArIGRlbGltaXRlciArIGtleSA6IGtleTtcblxuICAgICAgICAgIGlmICghb3B0cy5tYXhEZXB0aCkge1xuICAgICAgICAgICAgbWF4RGVwdGggPSBjdXJyZW50RGVwdGggKyAxO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIGZvciAodmFyIGtleXMgaW4gdmFsdWUpIHtcbiAgICAgICAgICAgIGlmICh2YWx1ZS5oYXNPd25Qcm9wZXJ0eShrZXlzKSkge1xuICAgICAgICAgICAgICBhcnIucHVzaChrZXlzKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG5cbiAgICAgICAgICBpZiAoIWlzYXJyYXkgJiYgaXNvYmplY3QgJiYgYXJyLmxlbmd0aCAmJiBjdXJyZW50RGVwdGggPCBtYXhEZXB0aCkge1xuICAgICAgICAgICAgKytjdXJyZW50RGVwdGg7XG4gICAgICAgICAgICByZXR1cm4gc3RlcCh2YWx1ZSwgbmV3S2V5KTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBvdXRwdXRbbmV3S2V5XSA9IHZhbHVlO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuXG4gICAgc3RlcCh0YXJnZXQpO1xuXG4gICAgcmV0dXJuIG91d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KSB7XG4gICAgICAgICAgICBjb250ZW50SWRzLnB1c2gocHJvZHVjdElkKTtcbiAgICAgICAgICAgIGNvbnRlbnRzLnB1c2goe1xuICAgICAgICAgICAgICBpZDogcHJvZHVjdElkLFxuICAgICAgICAgICAgICBxdWFudGl0eTogcnVkZGVyRWxlbWVudC5tZXNzYWdlLnByb3BlcnRpZXMucXVhbnRpdHksXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgICAgfVxuXG4gICAgICBpZiAoY29udGVudElkcy5sZW5ndGgpIHtcbiAgICAgICAgY29udGVudFR5cGUgPSBbXCJwcm9kdWN0XCJdO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgY29udGVudElkcy5wdXNoKHJ1ZGRlckVsZW1lbnQubWVzc2FnZS5wcm9wZXJ0aWVzLmNhdGVnb3J5IHx8IFwiXCIpO1xuICAgICAgICBjb250ZW50cy5wdXNoKHtcbiAgICAgICAgICBpZDogcnVkZGVyRWxlbWVudC5tZXNzYWdlLnByb3BlcnRpZXMuY2F0ZWdvcnkgfHwgXCJcIixcbiAgICAgICAgICBxdWFudGl0eTogMSxcbiAgICAgICAgfSk7XG4gICAgICAgIGNvbnRlbnRUeXBlID0gW1wicHJvZHVjdF9ncm91cFwiXTtcbiAgICAgIH1cbiAgICAgIHdpbmRvdy5mYnEoXG4gICAgICAgIFwidHJhY2tTaW5nbGVcIixcbiAgICAgICAgc2VsZi5waXhlbElkLFxuICAgICAgICBcIlZpZXdDb250ZW50XCIsXG4gICAgICAgIHRoaXMubWVyZ2UoXG4gICAgICAgICAge1xuICAgICAgICAgICAgY29udGVudF9pZHM6IGNvbnRlbnRJZHMsXG4gICAgICAgICAgICBjb250ZW50X3R5cGU6IHRoaXMuZ2V0Q29udGVudFR5cGUocnVkZGVyRWxlbWVudCwgY29udGVudFR5cGUpLFxuICAgICAgICAgICAgY29udGVudHM6IGNvbnRlbnRzLFxuICAgICAgICAgIH0sXG4gICAgICAgICAgY3VzdG9tUHJvcGVydGllc1xuICAgICAgICApLFxuICAgICAgICB7XG4gICAgICAgICAgZXZlbnRJRDogcnVkZGVyRWxlbWVudC5tZXNzYWdlLm1lc3NhZ2VJZCxcbiAgICAgICAgfVxuICAgICAgKTtcblxuICAgICAgZWFjaCgoZXZlbnQpID0+IHtcbiAgICAgICAgd2luZG93LmZicShcbiAgICAgICAgICBcInRyYWNrU2luZ2xlXCIsXG4gICAgICAgICAgc2VsZi5waXhlbElkLFxuICAgICAgICAgIGV2ZW50LFxuICAgICAgICAgIHtcbiAgICAgICAgICAgIGN1cnJlbmN5OiBydWRkZXJFbGVtZW50Lm1lc3NhZ2UucHJvcGVydGllcy5jdXJyZW5jeSxcbiAgICAgICAgICAgIHZhbHVlOiB0aGlzLmZvcm1hdFJldmVudWUocnVkZGVyRWxlbWVudC5tZXNzYWdlLnByb3BlcnRpZXMucmV2ZW51ZSksXG4gICAgICAgICAgfSxcbiAgICAgICAgICB7XG4gICAgICAgICAgICBldmVudElEOiBydWRkZXJFbGVtZW50Lm1lc3NhZ2UubWVzc2FnZUlkLFxuICAgICAgICAgIH1cbiAgICAgICAgKTtcbiAgICAgIH0sIGxlZ2FjeVRvKTtcbiAgICB9IGVsc2UgaWYgKGV2ZW50ID09PSBcIlByb2R1Y3QgVmlld2VkXCIpIHtcbiAgICAgIHZhciB1c2VWYWx1ZSA9IHRoaXMudmFsdWVGaWVsZElkZW50aWZpZXIgPT09IFwicHJvcGVydGllcy52YWx1ZVwiO1xuICAgICAgdmFyIGN1c3RvbVByb3BlcnRpZXMgPSB0aGlzLmJ1aWxkUGF5TG9hZChydWRkZXJFbGVtZW50LCB0cnVlKTtcblxuICAgICAgd2luZG93LmZicShcbiAgICAgICAgXCJ0cmFja1NpbmdsZVwiLFxuICAgICAgICBzZWxmLnBpeGVsSWQsXG4gICAgICAgIFwiVmlld0NvbnRlbnRcIixcbiAgICAgICAgdGhpcy5tZXJnZShcbiAgICAgICAgICB7XG4gICAgICAgICAgICBjb250ZW50X2lkczogW1xuICAgICAgICAgICAgICBydWRkZXJFbGVtZW50Lm1lc3NhZ2UucHJvcGVydGllcy5wcm9kdWN0X2lkIHx8XG4gICAgICAgICAgICAgICAgcnVkZGVyRWxlbWVudC5tZXNzYWdlLnByb3BlcnRpZXMuaWQgfHxcbiAgICAgICAgICAgICAgICBydWRkZXJFbGVtZW50Lm1lc3NhZ2UucHJvcGVydGllcy5za3UgfHxcbiAgICAgICAgICAgICAgICBcIlwiLFxuICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIGNvbnRlbnRfdHlwZTogdGhpcy5nZXRDb250ZW50VHlwZShydWRkZXJFbGVtZW50LCBbXCJwcm9kdWN0XCJdKSxcbiAgICAgICAgICAgIGNvbnRlbnRfbmFtZTogcnVkZGVyRWxlbWVudC5tZXNzYWdlLnByb3BlcnRpZXMucHJvZHVjdF9uYW1lIHx8IFwiXCIsXG4gICAgICAgICAgICBjb250ZW50X2NhdGVnb3J5OiBydWRkZXJFbGVtZW50Lm1lc3NhZ2UucHJvcGVydGllcy5jYXRlZ29yeSB8fCBcIlwiLFxuICAgICAgICAgICAgY3VycmVuY3k6IHJ1ZGRlckVsZW1lbnQubWVzc2FnZS5wcm9wZXJ0aWVzLmN1cnJlbmN5LFxuICAgICAgICAgICAgdmFsdWU6IHVzZVZhbHVlXG4gICAgICAgICAgICAgID8gdGhpcy5mb3JtYXRSZXZlbnVlKHJ1ZGRlckVsZW1lbnQubWVzc2FnZS5wcm9wZXJ0aWVzLnZhbHVlKVxuICAgICAgICAgICAgICA6IHRoaXMuZm9ybWF0UmV2ZW51ZShydWRkZXJFbGVtZW50Lm1lc3NhZ2UucHJvcGVydGllcy5wcmljZSksXG4gICAgICAgICAgICBjb250ZW50czogW1xuICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgaWQ6XG4gICAgICAgICAgICAgICAgICBydWRkZXJFbGVtZW50Lm1lc3NhZ2UucHJvcGVydGllcy5wcm9kdWN0X2lkIHx8XG4gICAgICAgICAgICAgICAgICBydWRkZXJFbGVtZW50Lm1lc3NhZ2UucHJvcGVydGllcy5pZCB8fFxuICAgICAgICAgICAgICAgICAgcnVkZGVyRWxlbWVudC5tZXNzYWdlLnByb3BlcnRpZXMuc2t1IHx8XG4gICAgICAgICAgICAgICAgICBcIlwiLFxuICAgICAgICAgICAgICAgIHF1YW50aXR5OiBydWRkZXJFbGVtZW50Lm1lc3NhZ2UucHJvcGVydGllcy5xdWFudGl0eSxcbiAgICAgICAgICAgICAgICBpdGVtX3ByaWNlOiBydWRkZXJFbGVtZW50Lm1lc3NhZ2UucHJvcGVydGllcy5wcmljZSxcbiAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIF0sXG4gICAgICAgICAgfSxcbiAgICAgICAgICBjdXN0b21Qcm9wZXJ0aWVzXG4gICAgICAgICksXG4gICAgICAgIHtcbiAgICAgICAgICBldmVudElEOiBydWRkZXJFbGVtZW50Lm1lc3NhZ2UubWVzc2FnZUlkLFxuICAgICAgICB9XG4gICAgICApO1xuXG4gICAgICBlYWNoKChldmVudCkgPT4ge1xuICAgICAgICB3aW5kb3cuZmJxKFxuICAgICAgICAgIFwidHJhY2tTaW5nbGVcIixcbiAgICAgICAgICBzZWxmLnBpeGVsSWQsXG4gICAgICAgICAgZXZlbnQsXG4gICAgICAgICAge1xuICAgICAgICAgICAgY3VycmVuY3k6IHJ1ZGRlckVsZW1lbnQubWVzc2FnZS5wcm9wZXJ0aWVzLmN1cnJlbmN5LFxuICAgICAgICAgICAgdmFsdWU6IHVzZVZhbHVlXG4gICAgICAgICAgICAgID8gdGhpcy5mb3JtYXRSZXZlbnVlKHJ1ZGRlckVsZW1lbnQubWVzc2FnZS5wcm9wZXJ0aWVzLnZhbHVlKVxuICAgICAgICAgICAgICA6IHRoaXMuZm9ybWF0UmV2ZW51ZShydWRkZXJFbGVtZW50Lm1lc3NhZ2UucHJvcGVydGllcy5wcmljZSksXG4gICAgICAgICAgfSxcbiAgICAgICAgICB7XG4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dGVnb3J5OiBydWRkZXJFbGVtZW50Lm1lc3NhZ2UucHJvcGVydGllcy5jYXRlZ29yeSB8fCBcIlwiLFxuICAgICAgICAgICAgY3VycmVuY3k6IHJ1ZGRlckVsZW1lbnQubWVzc2FnZS5wcm9wZXJ0aWVzLmN1cnJlbmN5LFxuICAgICAgICAgICAgdmFsdWU6IHVzZVZhbHVlXG4gICAgICAgICAgICAgID8gdGhpcy5mb3JtYXRSZXZlbnVlKHJ1ZGRlckVsZW1lbnQubWVzc2FnZS5wcm9wZXJ0aWVzLnZhbHVlKVxuICAgICAgICAgICAgICA6IHRoaXMuZm9ybWF0UmV2ZW51ZShydWRkZXJFbGVtZW50Lm1lc3NhZ2UucHJvcGVydGllcy5wcmljZSksXG4gICAgICAgICAgICBjb250ZW50czogW1xuICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgaWQ6XG4gICAgICAgICAgICAgICAgICBydWRkZXJFbGVtZW50Lm1lc3NhZ2UucHJvcGVydGllcy5wcm9kdWN0X2lkIHx8XG4gICAgICAgICAgICAgICAgICBydWRkZXJFbGVtZW50Lm1lc3NhZ2UucHJvcGVydGllcy5pZCB8fFxuICAgICAgICAgICAgICAgICAgcnVkZGVyRWxlbWVudC5tZXNzYWdlLnByb3BlcnRpZXMuc2t1IHx8XG4gICAgICAgICAgICAgICAgICBcIlwiLFxuICAgICAgICAgICAgICAgIHF1YW50aXR5OiBydWRkZXJFbGVtZW50Lm1lc3NhZ2UucHJvcGVydGllcy5xdWFudGl0eSxcbiAgICAgICAgICAgICAgICBpdGVtX3ByaWNlOiBydWRkZXJFbGVtZW50Lm1lc3NhZ2UucHJvcGVydGllcy5wcmljZSxcbiAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIF0sXG4gICAgICAgICAgfSxcbiAgICAgICAgICBjdXN0b21Qcm9wZXJ0aWVzXG4gICAgICAgICksXG4gICAgICAgIHtcbiAgICAgICAgICBldmVudElEOiBydWRkZXJFbGVtZW50Lm1lc3NhZ2UubWVzc2FnZUlkLFxuICAgICAgICB9XG4gICAgICApO1xuXG4gICAgICBlYWNoKChldmVudCkgPT4ge1xuICAgICAgICB3aW5kb3cuZmJxKFxuICAgICAgICAgIFwidHJhY2tTaW5nbGVcIixcbiAgICAgICAgICBzZWxmLnBpeGVsSWQsXG4gICAgICAgICAgZXZlbnQsXG4gICAgICAgICAge1xuICAgICAgICAgICAgY3VycmVuY3k6IHJ1ZGRlckVsZW1lbnQubWVzc2FnZS5wcm9wZXJ0aWVzLmN1cnJlbmN5LFxuICAgICAgICAgICAgdmFsdWU6IHVzZVZhbHVlXG4gICAgICAgICAgICAgID8gdGhpcy5mb3JtYXRSZXZlbnVlKHJ1ZGRlckVsZW1lbnQubWVzc2FnZS5wcm9wZXJ0aWVzLnZhbHVlKVxuICAgICAgICAgICAgICA6IHRoaXMuZm9ybWF0UmV2ZW51ZShydWRkZXJFbGVtZW50Lm1lc3NhZ2UucHJvcGVydGllcy5wcmljZSksXG4gICAgICAgICAgfSxcbiAgICAgICAgICB7XG4gICAgICAgICAgICBldmVudElEOiBydWRkZXJFbGVtZW50Lm1lc3NhZ2UubWVzc2FnZUlkLFxuICAgICAgICAgIH1cbiAgICAgICAgKTtcbiAgICAgIH0sIGxlZ2FjeVRvKTtcbiAgICAgIHRoaXMubWVyZ2UoXG4gICAgICAgIHtcbiAgICAgICAgICBjb250ZW50X2lkczogW1xuICAgICAgICAgICAgcnVkZGVyRWxlbWVudC5tZXNzYWdlLnByb3BlcnRpZXMucHJvZHVjdF9pZCB8fFxuICAgICAgICAgICAgICBydWRkZXJFbGVtZW50Lm1lc3NhZ2UucHJvcGVydGllcy5pZCB8fFxuICAgICAgICAgICAgICBydWRkZXJFbGVtZW50Lm1lc3NhZ2UucHJvcGVydGllcy5za3UgfHxcbiAgICAgICAgICAgICAgXCJcIixcbiAgICAgICAgICBdLFxuICAgICAgICAgIGNvbnRlbnRfdHlwZTogdGhpcy5nZXRDb250ZW50VHlwZShydWRkZXJFbGVtZW50LCBbXCJwcm9kdWN0XCJdKSxcblxuICAgICAgICAgIGNvbnRlbnRfbmFtZTogcnVkZGVyRWxlbWVudC5tZXNzYWdlLnByb3BlcnRpZXMucHJvZHVjdF9uYW1lIHx8IFwiXCIsXG4gICAgICAgICAgY29udGVudF9jYXRlZ29yeTogcnVkZGVyRWxlbWVudC5tZXNzYWdlLnByb3BlcnRpZXMuY2F0ZWdvcnkgfHwgXCJcIixcbiAgICAgICAgICBjdXJyZW5jeTogcnVkZGVyRWxlbWVudC5tZXNzYWdlLnByb3BlcnRpZXMuY3VycmVuY3ksXG4gICAgICAgICAgdmFsdWU6IHVzZVZhbHVlXG4gICAgICAgICAgICA/IHRoaXMuZm9ybWF0UmV2ZW51ZShydWRkZXJFbGVtZW50Lm1lc3NhZ2UucHJvcGVydGllcy52YWx1ZSlcbiAgICAgICAgICAgIDogdGhpcy5mb3JtYXRSZXZlbnVlKHJ1ZGRlckVsZW1lbnQubWVzc2FnZS5wcm9wZXJ0aWVzLnByaWNlKSxcbiAgICAgICAgICBjb250ZW50czogW1xuICAgICAgICAgICAge1xuICAgICAgICAgICAgICBpZDpcbiAgICAgICAgICAgICAgICBydWRkZXJFbGVtZW50Lm1lc3NhZ2UucHJvcGVydGllcy5wcm9kdWN0X2lkIHx8XG4gICAgICAgICAgICAgICAgcnVkZGVyRWxlbWVudC5tZXNzYWdlLnByb3BlcnRpZXMuaWQgfHxcbiAgICAgICAgICAgICAgICBydWRkZXJFbGVtZW50Lm1lc3NhZ2UucHJvcGVydGllcy5za3UgfHxcbiAgICAgICAgICAgICAgICBcIlwiLFxuICAgICAgICAgICAgICBxdWFudGl0eTogcnVkZGVyRWxlbWVudC5tZXNzYWdlLnByb3BlcnRpZXMucXVhbnRpdHksXG4gICAgICAgICAgICAgIGl0ZW1fcHJpY2U6IHJ1ZGRlckVsZW1lbnQubWVzc2FnZS5wcm9wZXJ0aWVzLnByaWNlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICBdLFxuICAgIC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4gICAgICAgIH1cbiAgICAgICAgY29udGVudHMucHVzaChjb250ZW50KTtcbiAgICAgIH1cbiAgICAgIHdpbmRvdy5mYnEoXG4gICAgICAgIFwidHJhY2tTaW5nbGVcIixcbiAgICAgICAgc2VsZi5waXhlbElkLFxuICAgICAgICBcIlB1cmNoYXNlXCIsXG4gICAgICAgIHRoaXMubWVyZ2UoXG4gICAgICAgICAge1xuICAgICAgICAgICAgY29udGVudF9pZHM6IGNvbnRlbnRJZHMsXG4gICAgICAgICAgICBjb250ZW50X3R5cGU6IGNvbnRlbnRUeXBlLFxuICAgICAgICAgICAgY3VycmVuY3k6IHJ1ZGRlckVsZW1lbnQubWVzc2FnZS5wcm9wZXJ0aWVzLmN1cnJlbmN5LFxuICAgICAgICAgICAgdmFsdWU6IHJldmVudWUsXG4gICAgICAgICAgICBjb250ZW50czogY29udGVudHMsXG4gICAgICAgICAgICBudW1faXRlbXM6IGNvbnRlbnRJZHMubGVuZ3RoLFxuICAgICAgICAgIH0sXG4gICAgICAgICAgY3VzdG9tUHJvcGVydGllc1xuICAgICAgICApLFxuICAgICAgICB7XG4gICAgICAgICAgZXZlbnRJRDogcnVkZGVyRWxlbWVudC5tZXNzYWdlLm1lc3NhZ2VJZCxcbiAgICAgICAgfVxuICAgICAgKTtcblxuICAgICAgZWFjaCgoZXZlbnQpID0+IHtcbiAgICAgICAgd2luZG93LmZicShcbiAgICAgICAgICBcInRyYWNrU2luZ2xlXCIsXG4gICAgICAgICAgc2VsZi5waXhlbElkLFxuICAgICAgICAgIGV2ZW50LFxuICAgICAgICAgIHtcbiAgICAgICAgICAgIGN1cnJlbmN5OiBydWRkZXJFbGVtZW50Lm1lc3NhZ2UucHJvcGVydGllcy5jdXJyZW5jeSxcbiAgICAgICAgICAgIHZhbHVlOiB0aGlzLmZvcm1hdFJldmVudWUocnVkZGVyRWxlbWVudC5tZXNzYWdlLnByb3BlcnRpZXMucmV2ZW51ZSksXG4gICAgICAgICAgfSxcbiAgICAgICAgICB7X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zYWdlLnByb3BlcnRpZXMucHJpY2UsXG4gICAgICAgIH07XG4gICAgICAgIGlmIChydWRkZXJFbGVtZW50Lm1lc3NhZ2UucHJvcGVydGllcy5wcmljZSkge1xuICAgICAgICAgIGNvbnRlbnQuaXRlbV9wcmljZSA9IHJ1ZGRlckVsZW1lbnQubWVzc2FnZS5wcm9wZXJ0aWVzLnByaWNlO1xuICAgICAgICB9XG4gICAgICAgIGNvbnRlbnRzLnB1c2goY29udGVudCk7XG4gICAgICB9XG4gICAgICBpZiAoIWNvbnRlbnRDYXRlZ29yeSAmJiBwcm9kdWN0c1swXSAmJiBwcm9kdWN0c1swXS5jYXRlZ29yeSkge1xuICAgICAgICBjb250ZW50Q2F0ZWdvcnkgPSBwcm9kdWN0c1swXS5jYXRlZ29yeTtcbiAgICAgIH1cbiAgICAgIHdpbmRvdy5mYnEoXG4gICAgICAgIFwidHJhY2tTaW5nbGVcIixcbiAgICAgICAgc2VsZi5waXhlbElkLFxuICAgICAgICBcIkluaXRpYXRlQ2hlY2tvdXRcIixcbiAgICAgICAgdGhpcy5tZXJnZShcbiAgICAgICAgICB7XG4gICAgICAgICAgICBjb250ZW50X2NhdGVnb3J5OiBjb250ZW50Q2F0ZWdvcnksXG4gICAgICAgICAgICBjb250ZW50X2lkczogY29udGVudElkcyxcbiAgICAgICAgICAgIGNvbnRlbnRfdHlwZTogdGhpcy5nZXRDb250ZW50VHlwZShydWRkZXJFbGVtZW50LCBbXCJwcm9kdWN0XCJdKSxcbiAgICAgICAgICAgIGN1cnJlbmN5OiBydWRkZXJFbGVtZW50Lm1lc3NhZ2UucHJvcGVydGllcy5jdXJyZW5jeSxcbiAgICAgICAgICAgIHZhbHVlOiByZXZlbnVlLFxuICAgICAgICAgICAgY29udGVudHM6IGNvbnRlbnRzLFxuICAgICAgICAgICAgbnVtX2l0ZW1zOiBjb250ZW50SWRzLmxlbmd0aCxcbiAgICAgICAgICB9LFxuICAgICAgICAgIGN1c3RvbVByb3BlcnRpZXNcb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bmRsZUVycm9yKFxuICAgICAgICAgICAgICBuZXcgRXJyb3IoXG4gICAgICAgICAgICAgICAgXCJyZXF1ZXN0IGZhaWxlZCB3aXRoIHN0YXR1czogXCIgK1xuICAgICAgICAgICAgICAgICAgeGhyLnN0YXR1cyArXG4gICAgICAgICAgICAgICAgICB4aHIuc3RhdHVzVGV4dCArXG4gICAgICAgICAgICAgICAgICBcIiBmb3IgdXJsOiBcIiArXG4gICAgICAgICAgICAgICAgICB1cmxcbiAgICAgICAgICAgICAgKVxuICAgICAgICAgICAgKTtcbiAgICAgICAgICAgIHF1ZXVlRm4oXG4gICAgICAgICAgICAgIG5ldyBFcnJvcihcbiAgICAgICAgICAgICAgICBcInJlcXVlc3QgZmFpbGVkIHdpdGggc3RhdHVzOiBcIiArXG4gICAgICAgICAgICAgICAgICB4aHIuc3RhdHVzICtcbiAgICAgICAgICAgICAgICAgIHhoci5zdGF0dXNUZXh0ICtcbiAgICAgICAgICAgICAgICAgIFwiIGZvciB1cmw6IFwiICtcbiAgICAgICAgICAgICAgICAgIHVybFxuICAgICAgICAgICAgICApXG4gICAgICAgICAgICApO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBsb2dnZXIuZGVidWcoXG4gICAgICAgICAgICAgIFwiPT09PT09IHJlcXVlc3QgcHJvY2Vzc2VkIHN1Y2Nlc3NmdWxseTogXCIgKyB4aHIuc3RhdHVzXG4gICAgICAgICAgICApO1xuICAgICAgICAgICAgcXVldWVGbihudWxsLCB4aHIuc3RhdHVzKTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH07XG5cbiAgICAgIHhoci5zZW5kKEpTT04uc3RyaW5naWZ5KG1lc3NhZ2UsIHJlcGxhY2VyKSk7XG4gICAgfSBjYXRjaCAoZXJyb3IpIHtcbiAgICAgIHF1ZXVlRm4oZXJyb3IpO1xuICAgIH1cbiAgfVxuXG4gIC8qKlxuICAgKlxuICAgKlxuICAgKiBAcGFyYW0ge1J1ZGRlck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ExvYWRlZEludGVyc2VjdENsaWVudFN1cHBsaWVkSW50ZWdyYXRpb25zW2ldW21ldGhvZE5hbWVdKFxuICAgICAgICAgICAgICAgICAgLi4uZXZlbnRcbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIFxuICAgICAgICAgICAgfVxuICAgICAgICAgIH0gY2F0Y2ggKGVycm9yKSB7XG4gICAgICAgICAgICBoYW5kbGVFcnJvcihlcnJvcik7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9KTtcbiAgICAgIG9iamVjdC50b0JlUHJvY2Vzc2VkQnlJbnRlZ3JhdGlvbkFycmF5ID0gW107XG4gICAgfVxuICB9XG5cbiAgcGF1c2UodGltZSkge1xuICAgIHJldHVybiBuZXcgUHJvbWlzZShyZXNvbHZlID0+IHtcbiAgICAgIHNldFRpbWVvdXQocmVzb2x2ZSwgdGltZSk7XG4gICAgfSk7XG4gIH1cblxuICBpc0luaXRpYWxpemVkKGluc3RhbmNlLCB0aW1lID0gMCkge1xuICAgIHJldHVybiBuZXcgUHJvbWlzZShyZXNvbHZlID0+IHtcbiAgICAgIGlmIChpbnN0YW5jZS5pc0xvYWRlZCgpKSB7XG4gICAgICAgIGxvZ2dlci5kZWJ1ZyhcbiAgICAgICAgICBcIj09PWludGVncmF0aW9uIGxvYWRlZCBzdWNjZXNzZnVsbHk9PT09XCIsXG4gICAgICAgICAgaW5zdGFuY2VbXCJuYW1lXCJdXG4gICAgICAgICk7XG4gICAgICAgIHRoaXMuc3VjY2Vzc2Z1bGx5TG9hZGVkSW50ZWdyYXRpb24ucHVzaChpbnN0YW5jZSk7XG4gICAgICAgIHJldHVybiByZXNvbHZlKHRoaXMpO1xuICAgICAgfVxuICAgICAgaWYgKHRpbWUgPj0gTUFYX1dBSVRfRk9SX0lOVEVHUkFUSU9OX0xPQUQpIHtcbiAgICAgICAgbG9nZ2VyLmRlYnVnKFwiPT09PW1heCB3YWl0IG92ZXI9PT09XCI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BsZXZlbEVsZW1lbnRzID0gW1wiaW50ZWdyYXRpb25zXCIsIFwiYW5vbnltb3VzSWRcIiwgXCJvcmlnaW5hbFRpbWVzdGFtcFwiXTtcbiAgICBmb3IgKGxldCBrZXkgaW4gb3B0aW9ucykge1xuICAgICAgaWYgKHRvcGxldmVsRWxlbWVudHMuaW5jbHVkZXMoa2V5KSkge1xuICAgICAgICBydWRkZXJFbGVtZW50Lm1lc3NhZ2Vba2V5XSA9IG9wdGlvbnNba2V5XTtcbiAgICAgICAgLy9zcGVjaWFsIGhhbmRsZSBmb3IgYW5hbnltb3VzSWQgYXMgdHJhbnNmb3JtYXRpb24gZXhwZWN0cyBhbm9ueW1vdXNJZCBpbiB0cmFpdHMuXG4gICAgICAgIC8qIGlmIChrZXkgPT09IFwiYW5vbnltb3VzSWRcIikge1xuICAgICAgICAgIHJ1ZGRlckVsZW1lbnQubWVzc2FnZS5jb250ZXh0LnRyYWl0c1tcImFub255bW91c0lkXCJdID0gb3B0aW9uc1trZXldO1xuICAgICAgICB9ICovXG4gICAgICB9IGVsc2Uge1xuICAgICAgICBpZiAoa2V5ICE9PSBcImNvbnRleHRcIilcbiAgICAgICAgICBydWRkZXJFbGVtZW50Lm1lc3NhZ2UuY29udGV4dFtrZXldID0gb3B0aW9uc1trZXldO1xuICAgICAgICBlbHNlIHtcbiAgICAgICAgICBmb3IgKGxldCBrIGluIG9wdGlvbnNba2V5XSkge1xuICAgICAgICAgICAgcnVkZGVyRWxlbWVudC5tZXNzYWdlLmNvbnRleHRba10gPSBvcHRpb25zW2tleV1ba107XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuICB9XG5cbiAgZ2V0UGFnZVByb3BlcnRpZXMocHJvcGVydGllcykge1xuICAgIGxldCBkZWZhdWx0UGFnZVByb3BlcnRpZXMgPSBnZXREZWZhdWx0UGFnZVByb3BlcnRpZXMoKTtcbiAgICBmb3IgKGxldCBrZXkgaW4gZGVmYXVsdFBhZ2VQc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LQUFLdWdCLElBQzFCNU0sR0FBUTRNLEdBQVM1TSxNQUFNM1QsS0FBS3VnQixJQUM1QjBqQixHQUFRMWpCLEdBQVMwakIsTUFBTWprQyxLQUFLdWdCLElBQzVCMmpCLEdBQVEzakIsR0FBUzJqQixNQUFNbGtDLEtBQUt1Z0IsSUFDNUJpaUIsR0FBUWppQixHQUFTaWlCLE1BQU14aUMsS0FBS3VnQixJQUM1QnZmLEdBQU91ZixHQUFTdmYsS0FBS2hCLEtBQUt1Z0IsSUFDMUIwZixHQUFlMWYsR0FBUzBmLGFBQWMsRUFDdENZLEdBQWlCdGdCLEdBQVNzZ0IsZUFBZTdnQyxLQUFLdWdCLElBQzlDb2lCLEdBQWlCcGlCLEdBQVNvaUIsZUFBZTNpQyxLQUFLdWdCIn0=
diff --git a/dist/rudder-analytics.min.br.js.br b/dist/rudder-analytics.min.br.js.br
deleted file mode 100644
index bf7b6193e3..0000000000
Binary files a/dist/rudder-analytics.min.br.js.br and /dev/null differ
diff --git a/dist/rudder-analytics.min.gzip.js.gz b/dist/rudder-analytics.min.gzip.js.gz
deleted file mode 100644
index ecf8980f23..0000000000
Binary files a/dist/rudder-analytics.min.gzip.js.gz and /dev/null differ
diff --git a/dist/rudder-analytics.min.js b/dist/rudder-analytics.min.js
deleted file mode 100644
index 16545f6359..0000000000
--- a/dist/rudder-analytics.min.js
+++ /dev/null
@@ -1,7070 +0,0 @@
-const rudderanalytics = (function (e) {
- function t(e) {
- return (t =
- typeof Symbol === "function" && typeof Symbol.iterator === "symbol"
- ? function (e) {
- return typeof e;
- }
- : function (e) {
- return e &&
- typeof Symbol === "function" &&
- e.constructor === Symbol &&
- e !== Symbol.prototype
- ? "symbol"
- : typeof e;
- })(e);
- }
- function n(e, t) {
- if (!(e instanceof t))
- throw new TypeError("Cannot call a class as a function");
- }
- function r(e, t) {
- for (let n = 0; n < t.length; n++) {
- const r = t[n];
- (r.enumerable = r.enumerable || !1),
- (r.configurable = !0),
- "value" in r && (r.writable = !0),
- Object.defineProperty(e, r.key, r);
- }
- }
- function i(e, t, n) {
- return t && r(e.prototype, t), n && r(e, n), e;
- }
- function o(e, t, n) {
- return (
- t in e
- ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0,
- })
- : (e[t] = n),
- e
- );
- }
- function s(e, t) {
- const n = Object.keys(e);
- if (Object.getOwnPropertySymbols) {
- let r = Object.getOwnPropertySymbols(e);
- t &&
- (r = r.filter(function (t) {
- return Object.getOwnPropertyDescriptor(e, t).enumerable;
- })),
- n.push.apply(n, r);
- }
- return n;
- }
- function a(e) {
- for (let t = 1; t < arguments.length; t++) {
- var n = arguments[t] != null ? arguments[t] : {};
- t % 2
- ? s(Object(n), !0).forEach(function (t) {
- o(e, t, n[t]);
- })
- : Object.getOwnPropertyDescriptors
- ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n))
- : s(Object(n)).forEach(function (t) {
- Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
- });
- }
- return e;
- }
- function u(e) {
- return (
- (function (e) {
- if (Array.isArray(e)) return c(e);
- })(e) ||
- (function (e) {
- if (typeof Symbol !== "undefined" && Symbol.iterator in Object(e))
- return Array.from(e);
- })(e) ||
- (function (e, t) {
- if (!e) return;
- if (typeof e === "string") return c(e, t);
- let n = Object.prototype.toString.call(e).slice(8, -1);
- n === "Object" && e.constructor && (n = e.constructor.name);
- if (n === "Map" || n === "Set") return Array.from(n);
- if (
- n === "Arguments" ||
- /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)
- )
- return c(e, t);
- })(e) ||
- (function () {
- throw new TypeError(
- "Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."
- );
- })()
- );
- }
- function c(e, t) {
- (t == null || t > e.length) && (t = e.length);
- for (var n = 0, r = new Array(t); n < t; n++) r[n] = e[n];
- return r;
- }
- let l = 4;
- const d = function (e) {
- switch (e.toUpperCase()) {
- case "INFO":
- return void (l = 1);
- case "DEBUG":
- return void (l = 2);
- case "WARN":
- return void (l = 3);
- }
- };
- const p = function () {
- let e;
- l <= 2 && (e = console).debug.apply(e, arguments);
- };
- const f = function () {
- let e;
- l <= 4 && (e = console).error.apply(e, arguments);
- };
- const h = {
- All: "All",
- "Google Analytics": "GA",
- GoogleAnalytics: "GA",
- GA: "GA",
- "Google Ads": "GOOGLEADS",
- GoogleAds: "GOOGLEADS",
- GOOGLEADS: "GOOGLEADS",
- Braze: "BRAZE",
- BRAZE: "BRAZE",
- Chartbeat: "CHARTBEAT",
- CHARTBEAT: "CHARTBEAT",
- Comscore: "COMSCORE",
- COMSCORE: "COMSCORE",
- Customerio: "CUSTOMERIO",
- "Customer.io": "CUSTOMERIO",
- "FB Pixel": "FACEBOOK_PIXEL",
- "Facebook Pixel": "FACEBOOK_PIXEL",
- FB_PIXEL: "FACEBOOK_PIXEL",
- "Google Tag Manager": "GOOGLETAGMANAGER",
- GTM: "GTM",
- Hotjar: "HOTJAR",
- hotjar: "HOTJAR",
- HOTJAR: "HOTJAR",
- Hubspot: "HS",
- HUBSPOT: "HS",
- Intercom: "INTERCOM",
- INTERCOM: "INTERCOM",
- Keen: "KEEN",
- "Keen.io": "KEEN",
- KEEN: "KEEN",
- Kissmetrics: "KISSMETRICS",
- KISSMETRICS: "KISSMETRICS",
- Lotame: "LOTAME",
- LOTAME: "LOTAME",
- "Visual Website Optimizer": "VWO",
- VWO: "VWO",
- };
- const g = {
- All: "All",
- GA: "Google Analytics",
- GOOGLEADS: "Google Ads",
- BRAZE: "Braze",
- CHARTBEAT: "Chartbeat",
- COMSCORE: "Comscore",
- CUSTOMERIO: "Customer IO",
- FACEBOOK_PIXEL: "Facebook Pixel",
- GTM: "Google Tag Manager",
- HOTJAR: "Hotjar",
- HS: "HubSpot",
- INTERCOM: "Intercom",
- KEEN: "Keen",
- KISSMETRICS: "Kiss Metrics",
- LOTAME: "Lotame",
- VWO: "VWO",
- };
- function y(e, t) {
- return t == null ? void 0 : t;
- }
- function m() {
- let e = new Date().getTime();
- return (
- typeof performance !== "undefined" &&
- typeof performance.now === "function" &&
- (e += performance.now()),
- "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function (t) {
- const n = (e + 16 * Math.random()) % 16 | 0;
- return (
- (e = Math.floor(e / 16)), (t === "x" ? n : (3 & n) | 8).toString(16)
- );
- })
- );
- }
- function v() {
- return new Date().toISOString();
- }
- function b(e, t) {
- let n = e.message ? e.message : void 0;
- let r = void 0;
- try {
- e instanceof Event &&
- e.target &&
- e.target.localName == "script" &&
- ((n = `error in script loading:: src:: ${e.target.src} id:: ${e.target.id}`),
- t &&
- e.target.src.includes("adsbygoogle") &&
- ((r = !0),
- t.page(
- "RudderJS-Initiated",
- "ad-block page request",
- { path: "/ad-blocked", title: n },
- t.sendAdblockPageOptions
- ))),
- n && !r && f("[Util] handleError:: ", n);
- } catch (e) {
- f("[Util] handleError:: ", e);
- }
- }
- function w() {
- const e = k();
- const t = e ? e.pathname : window.location.pathname;
- const n = document.referrer;
- const r = window.location.search;
- return {
- path: t,
- referrer: n,
- search: r,
- title: document.title,
- url: (function (e) {
- const t = k();
- const n = t ? (t.indexOf("?") > -1 ? t : t + e) : window.location.href;
- const r = n.indexOf("#");
- return r > -1 ? n.slice(0, r) : n;
- })(r),
- };
- }
- function k() {
- for (
- var e, t = document.getElementsByTagName("link"), n = 0;
- (e = t[n]);
- n++
- )
- if (e.getAttribute("rel") === "canonical") return e.getAttribute("href");
- }
- function I(e, t) {
- let n = e.revenue;
- return (
- !n &&
- t &&
- t.match(
- /^[ _]?completed[ _]?order[ _]?|^[ _]?order[ _]?completed[ _]?$/i
- ) &&
- (n = e.total),
- (function (e) {
- if (e) {
- if (typeof e === "number") return e;
- if (typeof e === "string")
- return (
- (e = e.replace(/\$/g, "")),
- (e = parseFloat(e)),
- isNaN(e) ? void 0 : e
- );
- }
- })(n)
- );
- }
- function _(e) {
- Object.keys(e).forEach(function (t) {
- e.hasOwnProperty(t) &&
- (h[t] && (e[h[t]] = e[t]),
- t != "All" && h[t] != null && h[t] != t && delete e[t]);
- });
- }
- function E(e, n) {
- const r = [];
- if (!n || n.length == 0) return r;
- let i = !0;
- return typeof n[0] === "string"
- ? (e.All != null && (i = e.All),
- n.forEach(function (t) {
- if (i) {
- let n = !0;
- e[t] != null && e[t] == 0 && (n = !1), n && r.push(t);
- } else e[t] != null && e[t] == 1 && r.push(t);
- }),
- r)
- : t(n[0]) == "object"
- ? (e.All != null && (i = e.All),
- n.forEach(function (t) {
- if (i) {
- let n = !0;
- e[t.name] != null && e[t.name] == 0 && (n = !1), n && r.push(t);
- } else e[t.name] != null && e[t.name] == 1 && r.push(t);
- }),
- r)
- : void 0;
- }
- const A = { TRACK: "track", PAGE: "page", IDENTIFY: "identify" };
- const C = {
- PRODUCTS_SEARCHED: "Products Searched",
- PRODUCT_LIST_VIEWED: "Product List Viewed",
- PRODUCT_LIST_FILTERED: "Product List Filtered",
- PROMOTION_VIEWED: "Promotion Viewed",
- PROMOTION_CLICKED: "Promotion Clicked",
- PRODUCT_CLICKED: "Product Clicked",
- PRODUCT_VIEWED: "Product Viewed",
- PRODUCT_ADDED: "Product Added",
- PRODUCT_REMOVED: "Product Removed",
- CART_VIEWED: "Cart Viewed",
- CHECKOUT_STARTED: "Checkout Started",
- CHECKOUT_STEP_VIEWED: "Checkout Step Viewed",
- CHECKOUT_STEP_COMPLETED: "Checkout Step Completed",
- PAYMENT_INFO_ENTERED: "Payment Info Entered",
- ORDER_UPDATED: "Order Updated",
- ORDER_COMPLETED: "Order Completed",
- ORDER_REFUNDED: "Order Refunded",
- ORDER_CANCELLED: "Order Cancelled",
- COUPON_ENTERED: "Coupon Entered",
- COUPON_APPLIED: "Coupon Applied",
- COUPON_DENIED: "Coupon Denied",
- COUPON_REMOVED: "Coupon Removed",
- PRODUCT_ADDED_TO_WISHLIST: "Product Added to Wishlist",
- PRODUCT_REMOVED_FROM_WISHLIST: "Product Removed from Wishlist",
- WISH_LIST_PRODUCT_ADDED_TO_CART: "Wishlist Product Added to Cart",
- PRODUCT_SHARED: "Product Shared",
- CART_SHARED: "Cart Shared",
- PRODUCT_REVIEWED: "Product Reviewed",
- };
- function T(e, t) {
- p(`in script loader=== ${e}`);
- const n = document.createElement("script");
- (n.src = t), (n.async = !0), (n.type = "text/javascript"), (n.id = e);
- const r = document.getElementsByTagName("script")[0];
- p("==script==", r), r.parentNode.insertBefore(n, r);
- }
- const O = (function () {
- function e(t) {
- n(this, e), (this.hubId = t.hubID), (this.name = "HS");
- }
- return (
- i(e, [
- {
- key: "init",
- value() {
- T(
- "hubspot-integration",
- `http://js.hs-scripts.com/${this.hubId}.js`
- ),
- p("===in init HS===");
- },
- },
- {
- key: "identify",
- value(e) {
- p("in HubspotAnalyticsManager identify");
- const n = e.message.context.traits;
- const r = {};
- for (const i in n)
- if (Object.getOwnPropertyDescriptor(n, i) && n[i]) {
- const o = i;
- toString.call(n[i]) == "[object Date]"
- ? (r[o] = n[i].getTime())
- : (r[o] = n[i]);
- }
- const s = e.message.context.user_properties;
- for (const a in s) {
- if (Object.getOwnPropertyDescriptor(s, a) && s[a]) r[a] = s[a];
- }
- (p(r),
- void 0 !==
- (typeof window === "undefined" ? "undefined" : t(window))) &&
- (window._hsq = window._hsq || []).push(["identify", r]);
- },
- },
- {
- key: "track",
- value(e) {
- p("in HubspotAnalyticsManager track");
- const t = (window._hsq = window._hsq || []);
- const n = {};
- (n.id = e.message.event),
- e.message.properties &&
- (e.message.properties.revenue || e.message.properties.value) &&
- (n.value =
- e.message.properties.revenue || e.message.properties.value),
- t.push(["trackEvent", n]);
- },
- },
- {
- key: "page",
- value(e) {
- p("in HubspotAnalyticsManager page");
- const t = (window._hsq = window._hsq || []);
- e.message.properties &&
- e.message.properties.path &&
- t.push(["setPath", e.message.properties.path]),
- t.push(["trackPageView"]);
- },
- },
- {
- key: "isLoaded",
- value() {
- return (
- p("in hubspot isLoaded"),
- !(!window._hsq || window._hsq.push === Array.prototype.push)
- );
- },
- },
- {
- key: "isReady",
- value() {
- return !(!window._hsq || window._hsq.push === Array.prototype.push);
- },
- },
- ]),
- e
- );
- })();
- const S = Object.prototype.toString;
- const P = function e(t) {
- const n = (function (e) {
- switch (S.call(e)) {
- case "[object Date]":
- return "date";
- case "[object RegExp]":
- return "regexp";
- case "[object Arguments]":
- return "arguments";
- case "[object Array]":
- return "array";
- case "[object Error]":
- return "error";
- }
- return e === null
- ? "null"
- : void 0 === e
- ? "undefined"
- : e != e
- ? "nan"
- : e && e.nodeType === 1
- ? "element"
- : (t = e) != null &&
- (t._isBuffer ||
- (t.constructor &&
- typeof t.constructor.isBuffer === "function" &&
- t.constructor.isBuffer(t)))
- ? "buffer"
- : typeof (e = e.valueOf
- ? e.valueOf()
- : Object.prototype.valueOf.apply(e));
- let t;
- })(t);
- if (n === "object") {
- var r = {};
- for (const i in t) t.hasOwnProperty(i) && (r[i] = e(t[i]));
- return r;
- }
- if (n === "array") {
- r = new Array(t.length);
- for (let o = 0, s = t.length; o < s; o++) r[o] = e(t[o]);
- return r;
- }
- if (n === "regexp") {
- let a = "";
- return (
- (a += t.multiline ? "m" : ""),
- (a += t.global ? "g" : ""),
- (a += t.ignoreCase ? "i" : ""),
- new RegExp(t.source, a)
- );
- }
- return n === "date" ? new Date(t.getTime()) : t;
- };
- const x =
- typeof globalThis !== "undefined"
- ? globalThis
- : typeof window !== "undefined"
- ? window
- : typeof global !== "undefined"
- ? global
- : typeof self !== "undefined"
- ? self
- : {};
- function R(e, t) {
- return e((t = { exports: {} }), t.exports), t.exports;
- }
- const j = 1e3;
- const D = 6e4;
- const U = 60 * D;
- const L = 24 * U;
- const M = function (e, t) {
- return (
- (t = t || {}),
- typeof e === "string"
- ? (function (e) {
- if ((e = `${e}`).length > 1e4) return;
- const t = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(
- e
- );
- if (!t) return;
- const n = parseFloat(t[1]);
- switch ((t[2] || "ms").toLowerCase()) {
- case "years":
- case "year":
- case "yrs":
- case "yr":
- case "y":
- return 315576e5 * n;
- case "days":
- case "day":
- case "d":
- return n * L;
- case "hours":
- case "hour":
- case "hrs":
- case "hr":
- case "h":
- return n * U;
- case "minutes":
- case "minute":
- case "mins":
- case "min":
- case "m":
- return n * D;
- case "seconds":
- case "second":
- case "secs":
- case "sec":
- case "s":
- return n * j;
- case "milliseconds":
- case "millisecond":
- case "msecs":
- case "msec":
- case "ms":
- return n;
- }
- })(e)
- : t.long
- ? (function (e) {
- return (
- N(e, L, "day") ||
- N(e, U, "hour") ||
- N(e, D, "minute") ||
- N(e, j, "second") ||
- `${e} ms`
- );
- })(e)
- : (function (e) {
- return e >= L
- ? `${Math.round(e / L)}d`
- : e >= U
- ? `${Math.round(e / U)}h`
- : e >= D
- ? `${Math.round(e / D)}m`
- : e >= j
- ? `${Math.round(e / j)}s`
- : `${e}ms`;
- })(e)
- );
- };
- function N(e, t, n) {
- if (!(e < t))
- return e < 1.5 * t
- ? `${Math.floor(e / t)} ${n}`
- : `${Math.ceil(e / t)} ${n}s`;
- }
- const B = R(function (e, t) {
- ((t = e.exports = function (e) {
- function r() {}
- function o() {
- const e = o;
- const r = +new Date();
- const s = r - (n || r);
- (e.diff = s),
- (e.prev = n),
- (e.curr = r),
- (n = r),
- e.useColors == null && (e.useColors = t.useColors()),
- e.color == null && e.useColors && (e.color = i());
- let a = Array.prototype.slice.call(arguments);
- (a[0] = t.coerce(a[0])),
- typeof a[0] !== "string" && (a = ["%o"].concat(a));
- let u = 0;
- (a[0] = a[0].replace(/%([a-z%])/g, function (n, r) {
- if (n === "%%") return n;
- u++;
- const i = t.formatters[r];
- if (typeof i === "function") {
- const o = a[u];
- (n = i.call(e, o)), a.splice(u, 1), u--;
- }
- return n;
- })),
- typeof t.formatArgs === "function" && (a = t.formatArgs.apply(e, a));
- const c = o.log || t.log || console.log.bind(console);
- c.apply(e, a);
- }
- (r.enabled = !1), (o.enabled = !0);
- const s = t.enabled(e) ? o : r;
- return (s.namespace = e), s;
- }).coerce = function (e) {
- return e instanceof Error ? e.stack || e.message : e;
- }),
- (t.disable = function () {
- t.enable("");
- }),
- (t.enable = function (e) {
- t.save(e);
- for (let n = (e || "").split(/[\s,]+/), r = n.length, i = 0; i < r; i++)
- n[i] &&
- ((e = n[i].replace(/\*/g, ".*?"))[0] === "-"
- ? t.skips.push(new RegExp(`^${e.substr(1)}$`))
- : t.names.push(new RegExp(`^${e}$`)));
- }),
- (t.enabled = function (e) {
- let n;
- let r;
- for (n = 0, r = t.skips.length; n < r; n++)
- if (t.skips[n].test(e)) return !1;
- for (n = 0, r = t.names.length; n < r; n++)
- if (t.names[n].test(e)) return !0;
- return !1;
- }),
- (t.humanize = M),
- (t.names = []),
- (t.skips = []),
- (t.formatters = {});
- let n;
- let r = 0;
- function i() {
- return t.colors[r++ % t.colors.length];
- }
- });
- const q =
- (B.coerce,
- B.disable,
- B.enable,
- B.enabled,
- B.humanize,
- B.names,
- B.skips,
- B.formatters,
- R(function (e, t) {
- function n() {
- let e;
- try {
- e = t.storage.debug;
- } catch (e) {}
- return e;
- }
- ((t = e.exports = B).log = function () {
- return (
- typeof console === "object" &&
- console.log &&
- Function.prototype.apply.call(console.log, console, arguments)
- );
- }),
- (t.formatArgs = function () {
- let e = arguments;
- const n = this.useColors;
- if (
- ((e[0] = `${
- (n ? "%c" : "") +
- this.namespace +
- (n ? " %c" : " ") +
- e[0] +
- (n ? "%c " : " ")
- }+${t.humanize(this.diff)}`),
- !n)
- )
- return e;
- const r = `color: ${this.color}`;
- e = [e[0], r, "color: inherit"].concat(
- Array.prototype.slice.call(e, 1)
- );
- let i = 0;
- let o = 0;
- return (
- e[0].replace(/%[a-z%]/g, function (e) {
- e !== "%%" && (i++, e === "%c" && (o = i));
- }),
- e.splice(o, 0, r),
- e
- );
- }),
- (t.save = function (e) {
- try {
- e == null ? t.storage.removeItem("debug") : (t.storage.debug = e);
- } catch (e) {}
- }),
- (t.load = n),
- (t.useColors = function () {
- return (
- "WebkitAppearance" in document.documentElement.style ||
- (window.console &&
- (console.firebug || (console.exception && console.table))) ||
- (navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) &&
- parseInt(RegExp.$1, 10) >= 31)
- );
- }),
- (t.storage =
- typeof chrome !== "undefined" && void 0 !== chrome.storage
- ? chrome.storage.local
- : (function () {
- try {
- return window.localStorage;
- } catch (e) {}
- })()),
- (t.colors = [
- "lightseagreen",
- "forestgreen",
- "goldenrod",
- "dodgerblue",
- "darkorchid",
- "crimson",
- ]),
- (t.formatters.j = function (e) {
- return JSON.stringify(e);
- }),
- t.enable(n());
- }));
- const F =
- (q.log,
- q.formatArgs,
- q.save,
- q.load,
- q.useColors,
- q.storage,
- q.colors,
- q("cookie"));
- const K = function (e, t, n) {
- switch (arguments.length) {
- case 3:
- case 2:
- return G(e, t, n);
- case 1:
- return V(e);
- default:
- return H();
- }
- };
- function G(e, t, n) {
- n = n || {};
- let r = `${z(e)}=${z(t)}`;
- t == null && (n.maxage = -1),
- n.maxage && (n.expires = new Date(+new Date() + n.maxage)),
- n.path && (r += `; path=${n.path}`),
- n.domain && (r += `; domain=${n.domain}`),
- n.expires && (r += `; expires=${n.expires.toUTCString()}`),
- n.samesite && (r += `; samesite=${n.samesite}`),
- n.secure && (r += "; secure"),
- (document.cookie = r);
- }
- function H() {
- let e;
- try {
- e = document.cookie;
- } catch (e) {
- return (
- typeof console !== "undefined" &&
- typeof console.error === "function" &&
- console.error(e.stack || e),
- {}
- );
- }
- return (function (e) {
- let t;
- const n = {};
- const r = e.split(/ *; */);
- if (r[0] == "") return n;
- for (let i = 0; i < r.length; ++i)
- (t = r[i].split("=")), (n[J(t[0])] = J(t[1]));
- return n;
- })(e);
- }
- function V(e) {
- return H()[e];
- }
- function z(e) {
- try {
- return encodeURIComponent(e);
- } catch (t) {
- F("error `encode(%o)` - %o", e, t);
- }
- }
- function J(e) {
- try {
- return decodeURIComponent(e);
- } catch (t) {
- F("error `decode(%o)` - %o", e, t);
- }
- }
- const W = Math.max;
- const $ = function (e, t) {
- const n = t ? t.length : 0;
- if (!n) return [];
- for (
- var r = W(Number(e) || 0, 0), i = W(n - r, 0), o = new Array(i), s = 0;
- s < i;
- s += 1
- )
- o[s] = t[s + r];
- return o;
- };
- const Y = Math.max;
- const Q = function (e) {
- if (e == null || !e.length) return [];
- for (var t = new Array(Y(e.length - 2, 0)), n = 1; n < e.length; n += 1)
- t[n - 1] = e[n];
- return t;
- };
- const Z = Object.prototype.hasOwnProperty;
- const X = Object.prototype.toString;
- const ee = function (e) {
- return Boolean(e) && typeof e === "object";
- };
- const te = function (e) {
- return Boolean(e) && X.call(e) === "[object Object]";
- };
- const ne = function (e, t, n, r) {
- return Z.call(t, r) && void 0 === e[r] && (e[r] = n), t;
- };
- const re = function (e, t, n, r) {
- return (
- Z.call(t, r) &&
- (te(e[r]) && te(n)
- ? (e[r] = oe(e[r], n))
- : void 0 === e[r] && (e[r] = n)),
- t
- );
- };
- const ie = function (e, t) {
- if (!ee(t)) return t;
- e = e || ne;
- for (let n = $(2, arguments), r = 0; r < n.length; r += 1)
- for (const i in n[r]) e(t, n[r], n[r][i], i);
- return t;
- };
- var oe = function (e) {
- return ie.apply(null, [re, e].concat(Q(arguments)));
- };
- const se = function (e) {
- return ie.apply(null, [null, e].concat(Q(arguments)));
- };
- const ae = oe;
- se.deep = ae;
- const ue = R(function (e, t) {
- (function () {
- const n = { function: !0, object: !0 };
- const r = n.object && t && !t.nodeType && t;
- let i = (n[typeof window] && window) || this;
- const o = r && n.object && e && !e.nodeType && typeof x === "object" && x;
- function s(e, t) {
- e || (e = i.Object()), t || (t = i.Object());
- const r = e.Number || i.Number;
- const o = e.String || i.String;
- const a = e.Object || i.Object;
- const u = e.Date || i.Date;
- const c = e.SyntaxError || i.SyntaxError;
- const l = e.TypeError || i.TypeError;
- const d = e.Math || i.Math;
- const p = e.JSON || i.JSON;
- typeof p === "object" &&
- p &&
- ((t.stringify = p.stringify), (t.parse = p.parse));
- const f = a.prototype;
- const h = f.toString;
- const g = f.hasOwnProperty;
- function y(e, t) {
- try {
- e();
- } catch (e) {
- t && t();
- }
- }
- let m = new u(-0xc782b5b800cec);
- function v(e) {
- if (v[e] != null) return v[e];
- let n;
- if (e == "bug-string-char-index") n = "a"[0] != "a";
- else if (e == "json")
- n =
- v("json-stringify") && v("date-serialization") && v("json-parse");
- else if (e == "date-serialization") {
- if ((n = v("json-stringify") && m)) {
- var i = t.stringify;
- y(function () {
- n =
- i(new u(-864e13)) == '"-271821-04-20T00:00:00.000Z"' &&
- i(new u(864e13)) == '"+275760-09-13T00:00:00.000Z"' &&
- i(new u(-621987552e5)) == '"-000001-01-01T00:00:00.000Z"' &&
- i(new u(-1)) == '"1969-12-31T23:59:59.999Z"';
- });
- }
- } else {
- let s;
- const a = '{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}';
- if (e == "json-stringify") {
- let c = typeof (i = t.stringify) === "function";
- c &&
- (((s = function () {
- return 1;
- }).toJSON = s),
- y(
- function () {
- c =
- i(0) === "0" &&
- i(new r()) === "0" &&
- i(new o()) == '""' &&
- void 0 === i(h) &&
- void 0 === i(void 0) &&
- void 0 === i() &&
- i(s) === "1" &&
- i([s]) == "[1]" &&
- i([void 0]) == "[null]" &&
- i(null) == "null" &&
- i([void 0, h, null]) == "[null,null,null]" &&
- i({ a: [s, !0, !1, null, "\0\b\n\f\r\t"] }) == a &&
- i(null, s) === "1" &&
- i([1, 2], null, 1) == "[\n 1,\n 2\n]";
- },
- function () {
- c = !1;
- }
- )),
- (n = c);
- }
- if (e == "json-parse") {
- let l;
- const d = t.parse;
- typeof d === "function" &&
- y(
- function () {
- d("0") !== 0 ||
- d(!1) ||
- ((s = d(a)),
- (l = s.a.length == 5 && s.a[0] === 1) &&
- (y(function () {
- l = !d('"\t"');
- }),
- l &&
- y(function () {
- l = d("01") !== 1;
- }),
- l &&
- y(function () {
- l = d("1.") !== 1;
- })));
- },
- function () {
- l = !1;
- }
- ),
- (n = l);
- }
- }
- return (v[e] = !!n);
- }
- if (
- (y(function () {
- m =
- m.getUTCFullYear() == -109252 &&
- m.getUTCMonth() === 0 &&
- m.getUTCDate() === 1 &&
- m.getUTCHours() == 10 &&
- m.getUTCMinutes() == 37 &&
- m.getUTCSeconds() == 6 &&
- m.getUTCMilliseconds() == 708;
- }),
- (v["bug-string-char-index"] = v["date-serialization"] = v.json = v[
- "json-stringify"
- ] = v["json-parse"] = null),
- !v("json"))
- ) {
- const b = v("bug-string-char-index");
- var w = function (e, t) {
- let r;
- let i;
- let o;
- let s = 0;
- for (o in (((r = function () {
- this.valueOf = 0;
- }).prototype.valueOf = 0),
- (i = new r())))
- g.call(i, o) && s++;
- return (
- (r = i = null),
- s
- ? (w = function (e, t) {
- let n;
- let r;
- const i = h.call(e) == "[object Function]";
- for (n in e)
- (i && n == "prototype") ||
- !g.call(e, n) ||
- (r = n === "constructor") ||
- t(n);
- (r || g.call(e, (n = "constructor"))) && t(n);
- })
- : ((i = [
- "valueOf",
- "toString",
- "toLocaleString",
- "propertyIsEnumerable",
- "isPrototypeOf",
- "hasOwnProperty",
- "constructor",
- ]),
- (w = function (e, t) {
- let r;
- let o;
- const s = h.call(e) == "[object Function]";
- const a =
- (!s &&
- typeof e.constructor !== "function" &&
- n[typeof e.hasOwnProperty] &&
- e.hasOwnProperty) ||
- g;
- for (r in e)
- (s && r == "prototype") || !a.call(e, r) || t(r);
- for (o = i.length; (r = i[--o]); ) a.call(e, r) && t(r);
- })),
- w(e, t)
- );
- };
- if (!v("json-stringify") && !v("date-serialization")) {
- const k = {
- 92: "\\\\",
- 34: '\\"',
- 8: "\\b",
- 12: "\\f",
- 10: "\\n",
- 13: "\\r",
- 9: "\\t",
- };
- const I = function (e, t) {
- return `000000${t || 0}`.slice(-e);
- };
- var _ = function (e) {
- let t;
- let n;
- let r;
- let i;
- let o;
- let s;
- let a;
- let u;
- let c;
- if (m)
- t = function (e) {
- (n = e.getUTCFullYear()),
- (r = e.getUTCMonth()),
- (i = e.getUTCDate()),
- (s = e.getUTCHours()),
- (a = e.getUTCMinutes()),
- (u = e.getUTCSeconds()),
- (c = e.getUTCMilliseconds());
- };
- else {
- const l = d.floor;
- const p = [
- 0,
- 31,
- 59,
- 90,
- 120,
- 151,
- 181,
- 212,
- 243,
- 273,
- 304,
- 334,
- ];
- const f = function (e, t) {
- return (
- p[t] +
- 365 * (e - 1970) +
- l((e - 1969 + (t = +(t > 1))) / 4) -
- l((e - 1901 + t) / 100) +
- l((e - 1601 + t) / 400)
- );
- };
- t = function (e) {
- for (
- i = l(e / 864e5), n = l(i / 365.2425) + 1970 - 1;
- f(n + 1, 0) <= i;
- n++
- );
- for (r = l((i - f(n, 0)) / 30.42); f(n, r + 1) <= i; r++);
- (i = 1 + i - f(n, r)),
- (s = l((o = ((e % 864e5) + 864e5) % 864e5) / 36e5) % 24),
- (a = l(o / 6e4) % 60),
- (u = l(o / 1e3) % 60),
- (c = o % 1e3);
- };
- }
- return (_ = function (e) {
- return (
- e > -1 / 0 && e < 1 / 0
- ? (t(e),
- (e = `${
- n <= 0 || n >= 1e4
- ? (n < 0 ? "-" : "+") + I(6, n < 0 ? -n : n)
- : I(4, n)
- }-${I(2, r + 1)}-${I(2, i)}T${I(2, s)}:${I(2, a)}:${I(
- 2,
- u
- )}.${I(3, c)}Z`),
- (n = r = i = s = a = u = c = null))
- : (e = null),
- e
- );
- })(e);
- };
- if (v("json-stringify") && !v("date-serialization")) {
- function E(e) {
- return _(this);
- }
- const A = t.stringify;
- t.stringify = function (e, t, n) {
- const r = u.prototype.toJSON;
- u.prototype.toJSON = E;
- const i = A(e, t, n);
- return (u.prototype.toJSON = r), i;
- };
- } else {
- const C = function (e) {
- const t = e.charCodeAt(0);
- const n = k[t];
- return n || `\\u00${I(2, t.toString(16))}`;
- };
- const T = /[\x00-\x1f\x22\x5c]/g;
- const O = function (e) {
- return (
- (T.lastIndex = 0), `"${T.test(e) ? e.replace(T, C) : e}"`
- );
- };
- var S = function (e, t, n, r, i, o, s) {
- let a;
- let c;
- let d;
- let p;
- let f;
- let g;
- let m;
- let v;
- let b;
- if (
- (y(function () {
- a = t[e];
- }),
- typeof a === "object" &&
- a &&
- (a.getUTCFullYear &&
- h.call(a) == "[object Date]" &&
- a.toJSON === u.prototype.toJSON
- ? (a = _(a))
- : typeof a.toJSON === "function" && (a = a.toJSON(e))),
- n && (a = n.call(t, e, a)),
- a == null)
- )
- return void 0 === a ? a : "null";
- switch (
- ((c = typeof a) == "object" && (d = h.call(a)), d || c)
- ) {
- case "boolean":
- case "[object Boolean]":
- return `${a}`;
- case "number":
- case "[object Number]":
- return a > -1 / 0 && a < 1 / 0 ? `${a}` : "null";
- case "string":
- case "[object String]":
- return O(`${a}`);
- }
- if (typeof a === "object") {
- for (m = s.length; m--; ) if (s[m] === a) throw l();
- if (
- (s.push(a),
- (p = []),
- (v = o),
- (o += i),
- d == "[object Array]")
- ) {
- for (g = 0, m = a.length; g < m; g++)
- (f = S(g, a, n, r, i, o, s)),
- p.push(void 0 === f ? "null" : f);
- b = p.length
- ? i
- ? `[\n${o}${p.join(`,\n${o}`)}\n${v}]`
- : `[${p.join(",")}]`
- : "[]";
- } else
- w(r || a, function (e) {
- const t = S(e, a, n, r, i, o, s);
- void 0 !== t && p.push(`${O(e)}:${i ? " " : ""}${t}`);
- }),
- (b = p.length
- ? i
- ? `{\n${o}${p.join(`,\n${o}`)}\n${v}}`
- : `{${p.join(",")}}`
- : "{}");
- return s.pop(), b;
- }
- };
- t.stringify = function (e, t, r) {
- let i;
- let o;
- let s;
- let a;
- if (n[typeof t] && t)
- if ((a = h.call(t)) == "[object Function]") o = t;
- else if (a == "[object Array]") {
- s = {};
- for (var u, c = 0, l = t.length; c < l; )
- (u = t[c++]),
- ((a = h.call(u)) != "[object String]" &&
- a != "[object Number]") ||
- (s[u] = 1);
- }
- if (r)
- if ((a = h.call(r)) == "[object Number]") {
- if ((r -= r % 1) > 0)
- for (r > 10 && (r = 10), i = ""; i.length < r; ) i += " ";
- } else
- a == "[object String]" &&
- (i = r.length <= 10 ? r : r.slice(0, 10));
- return S("", (((u = {})[""] = e), u), o, s, i, "", []);
- };
- }
- }
- if (!v("json-parse")) {
- let P;
- let x;
- const R = o.fromCharCode;
- const j = {
- 92: "\\",
- 34: '"',
- 47: "/",
- 98: "\b",
- 116: "\t",
- 110: "\n",
- 102: "\f",
- 114: "\r",
- };
- const D = function () {
- throw ((P = x = null), c());
- };
- const U = function () {
- for (var e, t, n, r, i, o = x, s = o.length; P < s; )
- switch ((i = o.charCodeAt(P))) {
- case 9:
- case 10:
- case 13:
- case 32:
- P++;
- break;
- case 123:
- case 125:
- case 91:
- case 93:
- case 58:
- case 44:
- return (e = b ? o.charAt(P) : o[P]), P++, e;
- case 34:
- for (e = "@", P++; P < s; )
- if ((i = o.charCodeAt(P)) < 32) D();
- else if (i == 92)
- switch ((i = o.charCodeAt(++P))) {
- case 92:
- case 34:
- case 47:
- case 98:
- case 116:
- case 110:
- case 102:
- case 114:
- (e += j[i]), P++;
- break;
- case 117:
- for (t = ++P, n = P + 4; P < n; P++)
- ((i = o.charCodeAt(P)) >= 48 && i <= 57) ||
- (i >= 97 && i <= 102) ||
- (i >= 65 && i <= 70) ||
- D();
- e += R(`0x${o.slice(t, P)}`);
- break;
- default:
- D();
- }
- else {
- if (i == 34) break;
- for (
- i = o.charCodeAt(P), t = P;
- i >= 32 && i != 92 && i != 34;
-
- )
- i = o.charCodeAt(++P);
- e += o.slice(t, P);
- }
- if (o.charCodeAt(P) == 34) return P++, e;
- D();
- default:
- if (
- ((t = P),
- i == 45 && ((r = !0), (i = o.charCodeAt(++P))),
- i >= 48 && i <= 57)
- ) {
- for (
- i == 48 &&
- (i = o.charCodeAt(P + 1)) >= 48 &&
- i <= 57 &&
- D(),
- r = !1;
- P < s && (i = o.charCodeAt(P)) >= 48 && i <= 57;
- P++
- );
- if (o.charCodeAt(P) == 46) {
- for (
- n = ++P;
- n < s && !((i = o.charCodeAt(n)) < 48 || i > 57);
- n++
- );
- n == P && D(), (P = n);
- }
- if ((i = o.charCodeAt(P)) == 101 || i == 69) {
- for (
- ((i = o.charCodeAt(++P)) != 43 && i != 45) || P++,
- n = P;
- n < s && !((i = o.charCodeAt(n)) < 48 || i > 57);
- n++
- );
- n == P && D(), (P = n);
- }
- return +o.slice(t, P);
- }
- r && D();
- var a = o.slice(P, P + 4);
- if (a == "true") return (P += 4), !0;
- if (a == "fals" && o.charCodeAt(P + 4) == 101)
- return (P += 5), !1;
- if (a == "null") return (P += 4), null;
- D();
- }
- return "$";
- };
- var L = function (e) {
- let t;
- let n;
- if ((e == "$" && D(), typeof e === "string")) {
- if ((b ? e.charAt(0) : e[0]) == "@") return e.slice(1);
- if (e == "[") {
- for (t = []; (e = U()) != "]"; )
- n ? (e == "," ? (e = U()) == "]" && D() : D()) : (n = !0),
- e == "," && D(),
- t.push(L(e));
- return t;
- }
- if (e == "{") {
- for (t = {}; (e = U()) != "}"; )
- n ? (e == "," ? (e = U()) == "}" && D() : D()) : (n = !0),
- (e != "," &&
- typeof e === "string" &&
- (b ? e.charAt(0) : e[0]) == "@" &&
- U() == ":") ||
- D(),
- (t[e.slice(1)] = L(U()));
- return t;
- }
- D();
- }
- return e;
- };
- const M = function (e, t, n) {
- const r = N(e, t, n);
- void 0 === r ? delete e[t] : (e[t] = r);
- };
- var N = function (e, t, n) {
- let r;
- const i = e[t];
- if (typeof i === "object" && i)
- if (h.call(i) == "[object Array]")
- for (r = i.length; r--; ) M(h, w, i);
- else
- w(i, function (e) {
- M(i, e, n);
- });
- return n.call(e, t, i);
- };
- t.parse = function (e, t) {
- let n;
- let r;
- return (
- (P = 0),
- (x = `${e}`),
- (n = L(U())),
- U() != "$" && D(),
- (P = x = null),
- t && h.call(t) == "[object Function]"
- ? N((((r = {})[""] = n), r), "", t)
- : n
- );
- };
- }
- }
- return (t.runInContext = s), t;
- }
- if (
- (!o || (o.global !== o && o.window !== o && o.self !== o) || (i = o), r)
- )
- s(i, r);
- else {
- let a = i.JSON;
- let u = i.JSON3;
- let c = !1;
- var l = s(
- i,
- (i.JSON3 = {
- noConflict() {
- return (
- c || ((c = !0), (i.JSON = a), (i.JSON3 = u), (a = u = null)), l
- );
- },
- })
- );
- i.JSON = { parse: l.parse, stringify: l.stringify };
- }
- }.call(x));
- });
- const ce = R(function (e, t) {
- function n(e) {
- switch (e) {
- case "http:":
- return 80;
- case "https:":
- return 443;
- default:
- return location.port;
- }
- }
- (t.parse = function (e) {
- const t = document.createElement("a");
- return (
- (t.href = e),
- {
- href: t.href,
- host: t.host || location.host,
- port: t.port === "0" || t.port === "" ? n(t.protocol) : t.port,
- hash: t.hash,
- hostname: t.hostname || location.hostname,
- pathname: t.pathname.charAt(0) != "/" ? `/${t.pathname}` : t.pathname,
- protocol:
- t.protocol && t.protocol != ":" ? t.protocol : location.protocol,
- search: t.search,
- query: t.search.slice(1),
- }
- );
- }),
- (t.isAbsolute = function (e) {
- return e.indexOf("//") == 0 || !!~e.indexOf("://");
- }),
- (t.isRelative = function (e) {
- return !t.isAbsolute(e);
- }),
- (t.isCrossDomain = function (e) {
- e = t.parse(e);
- const n = t.parse(window.location.href);
- return (
- e.hostname !== n.hostname ||
- e.port !== n.port ||
- e.protocol !== n.protocol
- );
- });
- });
- const le =
- (ce.parse,
- ce.isAbsolute,
- ce.isRelative,
- ce.isCrossDomain,
- R(function (e, t) {
- ((t = e.exports = function (e) {
- function r() {}
- function o() {
- const e = o;
- const r = +new Date();
- const s = r - (n || r);
- (e.diff = s),
- (e.prev = n),
- (e.curr = r),
- (n = r),
- e.useColors == null && (e.useColors = t.useColors()),
- e.color == null && e.useColors && (e.color = i());
- let a = Array.prototype.slice.call(arguments);
- (a[0] = t.coerce(a[0])),
- typeof a[0] !== "string" && (a = ["%o"].concat(a));
- let u = 0;
- (a[0] = a[0].replace(/%([a-z%])/g, function (n, r) {
- if (n === "%%") return n;
- u++;
- const i = t.formatters[r];
- if (typeof i === "function") {
- const o = a[u];
- (n = i.call(e, o)), a.splice(u, 1), u--;
- }
- return n;
- })),
- typeof t.formatArgs === "function" &&
- (a = t.formatArgs.apply(e, a));
- const c = o.log || t.log || console.log.bind(console);
- c.apply(e, a);
- }
- (r.enabled = !1), (o.enabled = !0);
- const s = t.enabled(e) ? o : r;
- return (s.namespace = e), s;
- }).coerce = function (e) {
- return e instanceof Error ? e.stack || e.message : e;
- }),
- (t.disable = function () {
- t.enable("");
- }),
- (t.enable = function (e) {
- t.save(e);
- for (
- let n = (e || "").split(/[\s,]+/), r = n.length, i = 0;
- i < r;
- i++
- )
- n[i] &&
- ((e = n[i].replace(/\*/g, ".*?"))[0] === "-"
- ? t.skips.push(new RegExp(`^${e.substr(1)}$`))
- : t.names.push(new RegExp(`^${e}$`)));
- }),
- (t.enabled = function (e) {
- let n;
- let r;
- for (n = 0, r = t.skips.length; n < r; n++)
- if (t.skips[n].test(e)) return !1;
- for (n = 0, r = t.names.length; n < r; n++)
- if (t.names[n].test(e)) return !0;
- return !1;
- }),
- (t.humanize = M),
- (t.names = []),
- (t.skips = []),
- (t.formatters = {});
- let n;
- let r = 0;
- function i() {
- return t.colors[r++ % t.colors.length];
- }
- }));
- const de =
- (le.coerce,
- le.disable,
- le.enable,
- le.enabled,
- le.humanize,
- le.names,
- le.skips,
- le.formatters,
- R(function (e, t) {
- function n() {
- let e;
- try {
- e = t.storage.debug;
- } catch (e) {}
- return e;
- }
- ((t = e.exports = le).log = function () {
- return (
- typeof console === "object" &&
- console.log &&
- Function.prototype.apply.call(console.log, console, arguments)
- );
- }),
- (t.formatArgs = function () {
- let e = arguments;
- const n = this.useColors;
- if (
- ((e[0] = `${
- (n ? "%c" : "") +
- this.namespace +
- (n ? " %c" : " ") +
- e[0] +
- (n ? "%c " : " ")
- }+${t.humanize(this.diff)}`),
- !n)
- )
- return e;
- const r = `color: ${this.color}`;
- e = [e[0], r, "color: inherit"].concat(
- Array.prototype.slice.call(e, 1)
- );
- let i = 0;
- let o = 0;
- return (
- e[0].replace(/%[a-z%]/g, function (e) {
- e !== "%%" && (i++, e === "%c" && (o = i));
- }),
- e.splice(o, 0, r),
- e
- );
- }),
- (t.save = function (e) {
- try {
- e == null ? t.storage.removeItem("debug") : (t.storage.debug = e);
- } catch (e) {}
- }),
- (t.load = n),
- (t.useColors = function () {
- return (
- "WebkitAppearance" in document.documentElement.style ||
- (window.console &&
- (console.firebug || (console.exception && console.table))) ||
- (navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) &&
- parseInt(RegExp.$1, 10) >= 31)
- );
- }),
- (t.storage =
- typeof chrome !== "undefined" && void 0 !== chrome.storage
- ? chrome.storage.local
- : (function () {
- try {
- return window.localStorage;
- } catch (e) {}
- })()),
- (t.colors = [
- "lightseagreen",
- "forestgreen",
- "goldenrod",
- "dodgerblue",
- "darkorchid",
- "crimson",
- ]),
- (t.formatters.j = function (e) {
- return JSON.stringify(e);
- }),
- t.enable(n());
- }));
- const pe =
- (de.log,
- de.formatArgs,
- de.save,
- de.load,
- de.useColors,
- de.storage,
- de.colors,
- de("cookie"));
- const fe = function (e, t, n) {
- switch (arguments.length) {
- case 3:
- case 2:
- return he(e, t, n);
- case 1:
- return ye(e);
- default:
- return ge();
- }
- };
- function he(e, t, n) {
- n = n || {};
- let r = `${me(e)}=${me(t)}`;
- t == null && (n.maxage = -1),
- n.maxage && (n.expires = new Date(+new Date() + n.maxage)),
- n.path && (r += `; path=${n.path}`),
- n.domain && (r += `; domain=${n.domain}`),
- n.expires && (r += `; expires=${n.expires.toUTCString()}`),
- n.secure && (r += "; secure"),
- (document.cookie = r);
- }
- function ge() {
- let e;
- try {
- e = document.cookie;
- } catch (e) {
- return (
- typeof console !== "undefined" &&
- typeof console.error === "function" &&
- console.error(e.stack || e),
- {}
- );
- }
- return (function (e) {
- let t;
- const n = {};
- const r = e.split(/ *; */);
- if (r[0] == "") return n;
- for (let i = 0; i < r.length; ++i)
- (t = r[i].split("=")), (n[ve(t[0])] = ve(t[1]));
- return n;
- })(e);
- }
- function ye(e) {
- return ge()[e];
- }
- function me(e) {
- try {
- return encodeURIComponent(e);
- } catch (t) {
- pe("error `encode(%o)` - %o", e, t);
- }
- }
- function ve(e) {
- try {
- return decodeURIComponent(e);
- } catch (t) {
- pe("error `decode(%o)` - %o", e, t);
- }
- }
- const be = R(function (e, t) {
- const n = ce.parse;
- function r(e) {
- for (let n = t.cookie, r = t.levels(e), i = 0; i < r.length; ++i) {
- const o = r[i];
- const s = { domain: `.${o}` };
- if ((n("__tld__", 1, s), n("__tld__"))) return n("__tld__", null, s), o;
- }
- return "";
- }
- (r.levels = function (e) {
- const t = n(e).hostname.split(".");
- const r = t[t.length - 1];
- const i = [];
- if (t.length === 4 && r === parseInt(r, 10)) return i;
- if (t.length <= 1) return i;
- for (let o = t.length - 2; o >= 0; --o) i.push(t.slice(o).join("."));
- return i;
- }),
- (r.cookie = fe),
- (t = e.exports = r);
- });
- const we = new ((function () {
- function e(t) {
- n(this, e), (this._options = {}), this.options(t);
- }
- return (
- i(e, [
- {
- key: "options",
- value() {
- const e =
- arguments.length > 0 && void 0 !== arguments[0]
- ? arguments[0]
- : {};
- if (arguments.length === 0) return this._options;
- let t = `.${be(window.location.href)}`;
- t === "." && (t = null),
- (this._options = se(e, {
- maxage: 31536e6,
- path: "/",
- domain: t,
- samesite: "Lax",
- })),
- this.set("test_rudder", !0),
- this.get("test_rudder") || (this._options.domain = null),
- this.remove("test_rudder");
- },
- },
- {
- key: "set",
- value(e, t) {
- try {
- return (t = ue.stringify(t)), K(e, t, P(this._options)), !0;
- } catch (e) {
- return !1;
- }
- },
- },
- {
- key: "get",
- value(e) {
- let t;
- try {
- return (t = (t = K(e)) ? ue.parse(t) : null);
- } catch (e) {
- return t || null;
- }
- },
- },
- {
- key: "remove",
- value(e) {
- try {
- return K(e, null, P(this._options)), !0;
- } catch (e) {
- return !1;
- }
- },
- },
- ]),
- e
- );
- })())({});
- const ke = (function () {
- let e;
- const t = {};
- const n = typeof window !== "undefined" ? window : x;
- const r = n.document;
- if (
- ((t.disabled = !1),
- (t.version = "1.3.20"),
- (t.set = function (e, t) {}),
- (t.get = function (e, t) {}),
- (t.has = function (e) {
- return void 0 !== t.get(e);
- }),
- (t.remove = function (e) {}),
- (t.clear = function () {}),
- (t.transact = function (e, n, r) {
- r == null && ((r = n), (n = null)), n == null && (n = {});
- const i = t.get(e, n);
- r(i), t.set(e, i);
- }),
- (t.getAll = function () {
- const e = {};
- return (
- t.forEach(function (t, n) {
- e[t] = n;
- }),
- e
- );
- }),
- (t.forEach = function () {}),
- (t.serialize = function (e) {
- return ue.stringify(e);
- }),
- (t.deserialize = function (e) {
- if (typeof e === "string")
- try {
- return ue.parse(e);
- } catch (t) {
- return e || void 0;
- }
- }),
- (function () {
- try {
- return "localStorage" in n && n.localStorage;
- } catch (e) {
- return !1;
- }
- })())
- )
- (e = n.localStorage),
- (t.set = function (n, r) {
- return void 0 === r ? t.remove(n) : (e.setItem(n, t.serialize(r)), r);
- }),
- (t.get = function (n, r) {
- const i = t.deserialize(e.getItem(n));
- return void 0 === i ? r : i;
- }),
- (t.remove = function (t) {
- e.removeItem(t);
- }),
- (t.clear = function () {
- e.clear();
- }),
- (t.forEach = function (n) {
- for (let r = 0; r < e.length; r++) {
- const i = e.key(r);
- n(i, t.get(i));
- }
- });
- else if (r && r.documentElement.addBehavior) {
- let i;
- let o;
- try {
- (o = new ActiveXObject("htmlfile")).open(),
- o.write(
- ''
- ),
- o.close(),
- (i = o.w.frames[0].document),
- (e = i.createElement("div"));
- } catch (t) {
- (e = r.createElement("div")), (i = r.body);
- }
- const s = function (n) {
- return function () {
- const r = Array.prototype.slice.call(arguments, 0);
- r.unshift(e),
- i.appendChild(e),
- e.addBehavior("#default#userData"),
- e.load("localStorage");
- const o = n.apply(t, r);
- return i.removeChild(e), o;
- };
- };
- const a = new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]", "g");
- const u = function (e) {
- return e.replace(/^d/, "___$&").replace(a, "___");
- };
- (t.set = s(function (e, n, r) {
- return (
- (n = u(n)),
- void 0 === r
- ? t.remove(n)
- : (e.setAttribute(n, t.serialize(r)), e.save("localStorage"), r)
- );
- })),
- (t.get = s(function (e, n, r) {
- n = u(n);
- const i = t.deserialize(e.getAttribute(n));
- return void 0 === i ? r : i;
- })),
- (t.remove = s(function (e, t) {
- (t = u(t)), e.removeAttribute(t), e.save("localStorage");
- })),
- (t.clear = s(function (e) {
- const t = e.XMLDocument.documentElement.attributes;
- e.load("localStorage");
- for (let n = t.length - 1; n >= 0; n--) e.removeAttribute(t[n].name);
- e.save("localStorage");
- })),
- (t.forEach = s(function (e, n) {
- for (
- var r, i = e.XMLDocument.documentElement.attributes, o = 0;
- (r = i[o]);
- ++o
- )
- n(r.name, t.deserialize(e.getAttribute(r.name)));
- }));
- }
- try {
- const c = "__storejs__";
- t.set(c, c), t.get(c) != c && (t.disabled = !0), t.remove(c);
- } catch (e) {
- t.disabled = !0;
- }
- return (t.enabled = !t.disabled), t;
- })();
- const Ie = new ((function () {
- function e(t) {
- n(this, e), (this._options = {}), (this.enabled = !1), this.options(t);
- }
- return (
- i(e, [
- {
- key: "options",
- value() {
- const e =
- arguments.length > 0 && void 0 !== arguments[0]
- ? arguments[0]
- : {};
- if (arguments.length === 0) return this._options;
- se(e, { enabled: !0 }),
- (this.enabled = e.enabled && ke.enabled),
- (this._options = e);
- },
- },
- {
- key: "set",
- value(e, t) {
- return !!this.enabled && ke.set(e, t);
- },
- },
- {
- key: "get",
- value(e) {
- return this.enabled ? ke.get(e) : null;
- },
- },
- {
- key: "remove",
- value(e) {
- return !!this.enabled && ke.remove(e);
- },
- },
- ]),
- e
- );
- })())({});
- const _e = "rl_user_id";
- const Ee = "rl_trait";
- const Ae = "rl_anonymous_id";
- const Ce = "rl_group_id";
- const Te = "rl_group_trait";
- const Oe = new ((function () {
- function e() {
- if ((n(this, e), we.set("rudder_cookies", !0), we.get("rudder_cookies")))
- return we.remove("rudder_cookies"), void (this.storage = we);
- Ie.enabled && (this.storage = Ie);
- }
- return (
- i(e, [
- {
- key: "setItem",
- value(e, t) {
- this.storage.set(e, t);
- },
- },
- {
- key: "setUserId",
- value(e) {
- typeof e === "string"
- ? this.storage.set(_e, e)
- : f("[Storage] setUserId:: userId should be string");
- },
- },
- {
- key: "setUserTraits",
- value(e) {
- this.storage.set(Ee, e);
- },
- },
- {
- key: "setGroupId",
- value(e) {
- typeof e === "string"
- ? this.storage.set(Ce, e)
- : f("[Storage] setGroupId:: groupId should be string");
- },
- },
- {
- key: "setGroupTraits",
- value(e) {
- this.storage.set(Te, e);
- },
- },
- {
- key: "setAnonymousId",
- value(e) {
- typeof e === "string"
- ? this.storage.set(Ae, e)
- : f("[Storage] setAnonymousId:: anonymousId should be string");
- },
- },
- {
- key: "getItem",
- value(e) {
- return this.storage.get(e);
- },
- },
- {
- key: "getUserId",
- value() {
- return this.storage.get(_e);
- },
- },
- {
- key: "getUserTraits",
- value() {
- return this.storage.get(Ee);
- },
- },
- {
- key: "getGroupId",
- value() {
- return this.storage.get(Ce);
- },
- },
- {
- key: "getGroupTraits",
- value() {
- return this.storage.get(Te);
- },
- },
- {
- key: "getAnonymousId",
- value() {
- return this.storage.get(Ae);
- },
- },
- {
- key: "removeItem",
- value(e) {
- return this.storage.remove(e);
- },
- },
- {
- key: "clear",
- value() {
- this.storage.remove(_e), this.storage.remove(Ee);
- },
- },
- ]),
- e
- );
- })())();
- const Se = (function () {
- function e(t) {
- n(this, e),
- (this.trackingID = t.trackingID),
- (this.allowLinker = t.allowLinker || !1),
- (this.name = "GA");
- }
- return (
- i(e, [
- {
- key: "init",
- value() {
- !(function (e, t, n, r, i, o, s) {
- (e.GoogleAnalyticsObject = i),
- (e.ga =
- e.ga ||
- function () {
- (e.ga.q = e.ga.q || []).push(arguments);
- }),
- (e.ga.l = 1 * new Date()),
- (o = t.createElement(n)),
- (s = t.getElementsByTagName(n)[0]),
- (o.async = 1),
- (o.src = "https://www.google-analytics.com/analytics.js"),
- s.parentNode.insertBefore(o, s);
- })(window, document, "script", 0, "ga"),
- ga("create", this.trackingID, "auto", "rudder_ga", {
- allowLinker: this.allowLinker,
- });
- const e = Oe.getUserId();
- e && e !== "" && ga("rudder_ga.set", "userId", e),
- p("===in init GA===");
- },
- },
- {
- key: "identify",
- value(e) {
- const t =
- e.message.userId !== ""
- ? e.message.userId
- : e.message.anonymousId;
- ga("rudder_ga.set", "userId", t),
- p("in GoogleAnalyticsManager identify");
- },
- },
- {
- key: "track",
- value(e) {
- let t = e.message.event;
- const n = e.message.event;
- let r = e.message.event;
- let i = "";
- e.message.properties &&
- ((i = e.message.properties.value
- ? e.message.properties.value
- : e.message.properties.revenue),
- (t = e.message.properties.category
- ? e.message.properties.category
- : t),
- (r = e.message.properties.label
- ? e.message.properties.label
- : r)),
- ga("rudder_ga.send", "event", {
- hitType: "event",
- eventCategory: t,
- eventAction: n,
- eventLabel: r,
- eventValue: i,
- }),
- p("in GoogleAnalyticsManager track");
- },
- },
- {
- key: "page",
- value(e) {
- p("in GoogleAnalyticsManager page");
- const t =
- e.message.properties && e.message.properties.path
- ? e.message.properties.path
- : void 0;
- const n =
- e.message.properties && e.message.properties.title
- ? e.message.properties.title
- : void 0;
- const r =
- e.message.properties && e.message.properties.url
- ? e.message.properties.url
- : void 0;
- t && ga("rudder_ga.set", "page", t),
- n && ga("rudder_ga.set", "title", n),
- r && ga("rudder_ga.set", "location", r),
- ga("rudder_ga.send", "pageview");
- },
- },
- {
- key: "isLoaded",
- value() {
- return p("in GA isLoaded"), !!window.gaplugins;
- },
- },
- {
- key: "isReady",
- value() {
- return !!window.gaplugins;
- },
- },
- ]),
- e
- );
- })();
- const Pe = (function () {
- function e(t) {
- n(this, e),
- (this.siteId = t.siteID),
- (this.name = "HOTJAR"),
- (this._ready = !1);
- }
- return (
- i(e, [
- {
- key: "init",
- value() {
- (window.hotjarSiteId = this.siteId),
- (function (e, t, n, r, i, o) {
- (e.hj =
- e.hj ||
- function () {
- (e.hj.q = e.hj.q || []).push(arguments);
- }),
- (e._hjSettings = { hjid: e.hotjarSiteId, hjsv: 6 }),
- (i = t.getElementsByTagName("head")[0]),
- ((o = t.createElement("script")).async = 1),
- (o.src = `https://static.hotjar.com/c/hotjar-${e._hjSettings.hjid}.js?sv=${e._hjSettings.hjsv}`),
- i.appendChild(o);
- })(window, document),
- (this._ready = !0),
- p("===in init Hotjar===");
- },
- },
- {
- key: "identify",
- value(e) {
- if (e.message.userId || e.message.anonymousId) {
- const t = e.message.context.traits;
- window.hj("identify", e.message.userId, t);
- } else p("[Hotjar] identify:: user id is required");
- },
- },
- {
- key: "track",
- value(e) {
- p("[Hotjar] track:: method not supported");
- },
- },
- {
- key: "page",
- value(e) {
- p("[Hotjar] page:: method not supported");
- },
- },
- {
- key: "isLoaded",
- value() {
- return this._ready;
- },
- },
- {
- key: "isReady",
- value() {
- return this._ready;
- },
- },
- ]),
- e
- );
- })();
- const xe = (function () {
- function e(t) {
- n(this, e),
- (this.conversionId = t.conversionID),
- (this.pageLoadConversions = t.pageLoadConversions),
- (this.clickEventConversions = t.clickEventConversions),
- (this.defaultPageConversion = t.defaultPageConversion),
- (this.name = "GOOGLEADS");
- }
- return (
- i(e, [
- {
- key: "init",
- value() {
- !(function (e, t, n) {
- p(`in script loader=== ${e}`);
- const r = n.createElement("script");
- (r.src = t),
- (r.async = 1),
- (r.type = "text/javascript"),
- (r.id = e);
- const i = n.getElementsByTagName("head")[0];
- p("==script==", i), i.appendChild(r);
- })(
- "googleAds-integration",
- `https://www.googletagmanager.com/gtag/js?id=${this.conversionId}`,
- document
- ),
- (window.dataLayer = window.dataLayer || []),
- (window.gtag = function () {
- window.dataLayer.push(arguments);
- }),
- window.gtag("js", new Date()),
- window.gtag("config", this.conversionId),
- p("===in init Google Ads===");
- },
- },
- {
- key: "identify",
- value(e) {
- p("[GoogleAds] identify:: method not supported");
- },
- },
- {
- key: "track",
- value(e) {
- p("in GoogleAdsAnalyticsManager track");
- const t = this.getConversionData(
- this.clickEventConversions,
- e.message.event
- );
- if (t.conversionLabel) {
- const n = t.conversionLabel;
- const r = t.eventName;
- const i = `${this.conversionId}/${n}`;
- const o = {};
- e.properties &&
- ((o.value = e.properties.revenue),
- (o.currency = e.properties.currency),
- (o.transaction_id = e.properties.order_id)),
- (o.send_to = i),
- window.gtag("event", r, o);
- }
- },
- },
- {
- key: "page",
- value(e) {
- p("in GoogleAdsAnalyticsManager page");
- const t = this.getConversionData(
- this.pageLoadConversions,
- e.message.name
- );
- if (t.conversionLabel) {
- const n = t.conversionLabel;
- const r = t.eventName;
- window.gtag("event", r, {
- send_to: `${this.conversionId}/${n}`,
- });
- }
- },
- },
- {
- key: "getConversionData",
- value(e, t) {
- const n = {};
- return (
- e &&
- (t
- ? e.forEach(function (e) {
- if (e.name.toLowerCase() === t.toLowerCase())
- return (
- (n.conversionLabel = e.conversionLabel),
- void (n.eventName = e.name)
- );
- })
- : this.defaultPageConversion &&
- ((n.conversionLabel = this.defaultPageConversion),
- (n.eventName = "Viewed a Page"))),
- n
- );
- },
- },
- {
- key: "isLoaded",
- value() {
- return window.dataLayer.push !== Array.prototype.push;
- },
- },
- {
- key: "isReady",
- value() {
- return window.dataLayer.push !== Array.prototype.push;
- },
- },
- ]),
- e
- );
- })();
- const Re = (function () {
- function e(t, r) {
- n(this, e),
- (this.accountId = t.accountId),
- (this.settingsTolerance = t.settingsTolerance),
- (this.isSPA = t.isSPA),
- (this.libraryTolerance = t.libraryTolerance),
- (this.useExistingJquery = t.useExistingJquery),
- (this.sendExperimentTrack = t.sendExperimentTrack),
- (this.sendExperimentIdentify = t.sendExperimentIdentify),
- (this.name = "VWO"),
- (this.analytics = r),
- p("Config ", t);
- }
- return (
- i(e, [
- {
- key: "init",
- value() {
- p("===in init VWO===");
- const e = this.accountId;
- const t = this.settingsTolerance;
- const n = this.libraryTolerance;
- const r = this.useExistingJquery;
- const i = this.isSPA;
- (window._vwo_code = (function () {
- let o = !1;
- const s = document;
- return {
- use_existing_jquery() {
- return r;
- },
- library_tolerance() {
- return n;
- },
- finish() {
- if (!o) {
- o = !0;
- const e = s.getElementById("_vis_opt_path_hides");
- e && e.parentNode.removeChild(e);
- }
- },
- finished() {
- return o;
- },
- load(e) {
- const t = s.createElement("script");
- (t.src = e),
- (t.type = "text/javascript"),
- t.innerText,
- (t.onerror = function () {
- _vwo_code.finish();
- }),
- s.getElementsByTagName("head")[0].appendChild(t);
- },
- init() {
- const n = setTimeout("_vwo_code.finish()", t);
- const r = s.createElement("style");
- const o =
- "body{opacity:0 !important;filter:alpha(opacity=0) !important;background:none !important;}";
- const a = s.getElementsByTagName("head")[0];
- return (
- r.setAttribute("id", "_vis_opt_path_hides"),
- r.setAttribute("type", "text/css"),
- r.styleSheet
- ? (r.styleSheet.cssText = o)
- : r.appendChild(s.createTextNode(o)),
- a.appendChild(r),
- this.load(
- `//dev.visualwebsiteoptimizer.com/j.php?a=${e}&u=${encodeURIComponent(
- s.URL
- )}&r=${Math.random()}&f=${+i}`
- ),
- n
- );
- },
- };
- })()),
- (window._vwo_settings_timer = window._vwo_code.init()),
- (this.sendExperimentTrack || this.experimentViewedIdentify) &&
- this.experimentViewed();
- },
- },
- {
- key: "experimentViewed",
- value() {
- const e = this;
- window.VWO = window.VWO || [];
- const t = this;
- window.VWO.push([
- "onVariationApplied",
- function (n) {
- if (n) {
- p("Variation Applied");
- const r = n[1];
- const i = n[2];
- if (
- (p(
- "experiment id:",
- r,
- "Variation Name:",
- _vwo_exp[r].comb_n[i]
- ),
- void 0 !== _vwo_exp[r].comb_n[i] &&
- ["VISUAL_AB", "VISUAL", "SPLIT_URL", "SURVEY"].indexOf(
- _vwo_exp[r].type
- ) > -1)
- ) {
- try {
- t.sendExperimentTrack &&
- (p("Tracking..."),
- e.analytics.track("Experiment Viewed", {
- experimentId: r,
- variationName: _vwo_exp[r].comb_n[i],
- }));
- } catch (e) {
- f("[VWO] experimentViewed:: ", e);
- }
- try {
- t.sendExperimentIdentify &&
- (p("Identifying..."),
- e.analytics.identify(
- o({}, "Experiment: ".concat(r), _vwo_exp[r].comb_n[i])
- ));
- } catch (e) {
- f("[VWO] experimentViewed:: ", e);
- }
- }
- }
- },
- ]);
- },
- },
- {
- key: "identify",
- value(e) {
- p("method not supported");
- },
- },
- {
- key: "track",
- value(e) {
- if (e.message.event === "Order Completed") {
- const t = e.message.properties
- ? e.message.properties.total || e.message.properties.revenue
- : 0;
- p("Revenue", t),
- (window.VWO = window.VWO || []),
- window.VWO.push(["track.revenueConversion", t]);
- }
- },
- },
- {
- key: "page",
- value(e) {
- p("method not supported");
- },
- },
- {
- key: "isLoaded",
- value() {
- return !!window._vwo_code;
- },
- },
- {
- key: "isReady",
- value() {
- return !!window._vwo_code;
- },
- },
- ]),
- e
- );
- })();
- const je = (function () {
- function e(t) {
- n(this, e),
- (this.containerID = t.containerID),
- (this.name = "GOOGLETAGMANAGER");
- }
- return (
- i(e, [
- {
- key: "init",
- value() {
- p("===in init GoogleTagManager==="),
- (function (e, t, n, r, i) {
- (e[r] = e[r] || []),
- e[r].push({
- "gtm.start": new Date().getTime(),
- event: "gtm.js",
- });
- const o = t.getElementsByTagName(n)[0];
- const s = t.createElement(n);
- (s.async = !0),
- (s.src = `https://www.googletagmanager.com/gtm.js?id=${i}`),
- o.parentNode.insertBefore(s, o);
- })(window, document, "script", "dataLayer", this.containerID);
- },
- },
- {
- key: "identify",
- value(e) {
- p("[GTM] identify:: method not supported");
- },
- },
- {
- key: "track",
- value(e) {
- p("===in track GoogleTagManager===");
- const t = e.message;
- const n = a(
- {
- event: t.event,
- userId: t.userId,
- anonymousId: t.anonymousId,
- },
- t.properties
- );
- this.sendToGTMDatalayer(n);
- },
- },
- {
- key: "page",
- value(e) {
- p("===in page GoogleTagManager===");
- let t;
- const n = e.message;
- const r = n.name;
- const i = n.properties ? n.properties.category : void 0;
- r && (t = `Viewed ${r} page`),
- i && r && (t = `Viewed ${i} ${r} page`),
- t || (t = "Viewed a Page");
- const o = a(
- { event: t, userId: n.userId, anonymousId: n.anonymousId },
- n.properties
- );
- this.sendToGTMDatalayer(o);
- },
- },
- {
- key: "isLoaded",
- value() {
- return !(
- !window.dataLayer ||
- Array.prototype.push === window.dataLayer.push
- );
- },
- },
- {
- key: "sendToGTMDatalayer",
- value(e) {
- window.dataLayer.push(e);
- },
- },
- {
- key: "isReady",
- value() {
- return !(
- !window.dataLayer ||
- Array.prototype.push === window.dataLayer.push
- );
- },
- },
- ]),
- e
- );
- })();
- const De = (function () {
- function e(t, r) {
- if (
- (n(this, e),
- (this.analytics = r),
- (this.appKey = t.appKey),
- t.appKey || (this.appKey = ""),
- (this.endPoint = ""),
- t.dataCenter)
- ) {
- const i = t.dataCenter.trim().split("-");
- i[0].toLowerCase() === "eu"
- ? (this.endPoint = "sdk.fra-01.braze.eu")
- : (this.endPoint = `sdk.iad-${i[1]}.braze.com`);
- }
- (this.name = "BRAZE"), p("Config ", t);
- }
- return (
- i(e, [
- {
- key: "formatGender",
- value(e) {
- if (e && typeof e === "string") {
- return ["woman", "female", "w", "f"].indexOf(e.toLowerCase()) > -1
- ? window.appboy.ab.User.Genders.FEMALE
- : ["man", "male", "m"].indexOf(e.toLowerCase()) > -1
- ? window.appboy.ab.User.Genders.MALE
- : ["other", "o"].indexOf(e.toLowerCase()) > -1
- ? window.appboy.ab.User.Genders.OTHER
- : void 0;
- }
- },
- },
- {
- key: "init",
- value() {
- p("===in init Braze==="),
- (function (e, t, n, r, i) {
- (e.appboy = {}), (e.appboyQueue = []);
- for (
- let o = "initialize destroy getDeviceId toggleAppboyLogging setLogger openSession changeUser requestImmediateDataFlush requestFeedRefresh subscribeToFeedUpdates requestContentCardsRefresh subscribeToContentCardsUpdates logCardImpressions logCardClick logCardDismissal logFeedDisplayed logContentCardsDisplayed logInAppMessageImpression logInAppMessageClick logInAppMessageButtonClick logInAppMessageHtmlClick subscribeToNewInAppMessages subscribeToInAppMessage removeSubscription removeAllSubscriptions logCustomEvent logPurchase isPushSupported isPushBlocked isPushGranted isPushPermissionGranted registerAppboyPushMessages unregisterAppboyPushMessages trackLocation stopWebTracking resumeWebTracking wipeData ab ab.DeviceProperties ab.User ab.User.Genders ab.User.NotificationSubscriptionTypes ab.User.prototype.getUserId ab.User.prototype.setFirstName ab.User.prototype.setLastName ab.User.prototype.setEmail ab.User.prototype.setGender ab.User.prototype.setDateOfBirth ab.User.prototype.setCountry ab.User.prototype.setHomeCity ab.User.prototype.setLanguage ab.User.prototype.setEmailNotificationSubscriptionType ab.User.prototype.setPushNotificationSubscriptionType ab.User.prototype.setPhoneNumber ab.User.prototype.setAvatarImageUrl ab.User.prototype.setLastKnownLocation ab.User.prototype.setUserAttribute ab.User.prototype.setCustomUserAttribute ab.User.prototype.addToCustomAttributeArray ab.User.prototype.removeFromCustomAttributeArray ab.User.prototype.incrementCustomUserAttribute ab.User.prototype.addAlias ab.User.prototype.setCustomLocationAttribute ab.InAppMessage ab.InAppMessage.SlideFrom ab.InAppMessage.ClickAction ab.InAppMessage.DismissType ab.InAppMessage.OpenTarget ab.InAppMessage.ImageStyle ab.InAppMessage.TextAlignment ab.InAppMessage.Orientation ab.InAppMessage.CropType ab.InAppMessage.prototype.subscribeToClickedEvent ab.InAppMessage.prototype.subscribeToDismissedEvent ab.InAppMessage.prototype.removeSubscription ab.InAppMessage.prototype.removeAllSubscriptions ab.InAppMessage.prototype.closeMessage ab.InAppMessage.Button ab.InAppMessage.Button.prototype.subscribeToClickedEvent ab.InAppMessage.Button.prototype.removeSubscription ab.InAppMessage.Button.prototype.removeAllSubscriptions ab.SlideUpMessage ab.ModalMessage ab.FullScreenMessage ab.HtmlMessage ab.ControlMessage ab.Feed ab.Feed.prototype.getUnreadCardCount ab.ContentCards ab.ContentCards.prototype.getUnviewedCardCount ab.Card ab.Card.prototype.dismissCard ab.ClassicCard ab.CaptionedImage ab.Banner ab.ControlCard ab.WindowUtils display display.automaticallyShowNewInAppMessages display.showInAppMessage display.showFeed display.destroyFeed display.toggleFeed display.showContentCards display.hideContentCards display.toggleContentCards sharedLib".split(
- " "
- ),
- s = 0;
- s < o.length;
- s++
- ) {
- for (
- var a = o[s], u = e.appboy, c = a.split("."), l = 0;
- l < c.length - 1;
- l++
- )
- u = u[c[l]];
- u[c[l]] = new Function(
- `return function ${a.replace(
- /\./g,
- "_"
- )}(){window.appboyQueue.push(arguments); return true}`
- )();
- }
- (window.appboy.getUser = function () {
- return new window.appboy.ab.User();
- }),
- (window.appboy.getCachedFeed = function () {
- return new window.appboy.ab.Feed();
- }),
- (window.appboy.getCachedContentCards = function () {
- return new window.appboy.ab.ContentCards();
- }),
- ((i = t.createElement(n)).type = "text/javascript"),
- (i.src =
- "https://js.appboycdn.com/web-sdk/2.4/appboy.min.js"),
- (i.async = 1),
- (r = t.getElementsByTagName(n)[0]).parentNode.insertBefore(
- i,
- r
- );
- })(window, document, "script"),
- window.appboy.initialize(this.appKey, {
- enableLogging: !0,
- baseUrl: this.endPoint,
- }),
- window.appboy.display.automaticallyShowNewInAppMessages();
- const e = this.analytics.userId;
- e && appboy.changeUser(e), window.appboy.openSession();
- },
- },
- {
- key: "handleReservedProperties",
- value(e) {
- return (
- [
- "time",
- "product_id",
- "quantity",
- "event_name",
- "price",
- "currency",
- ].forEach(function (t) {
- delete e[t];
- }),
- e
- );
- },
- },
- {
- key: "identify",
- value(e) {
- const t = e.message.userId;
- const n = e.message.context.traits.address;
- const r = e.message.context.traits.avatar;
- const i = e.message.context.traits.birthday;
- const o = e.message.context.traits.email;
- const s = e.message.context.traits.firstname;
- const a = e.message.context.traits.gender;
- const u = e.message.context.traits.lastname;
- const c = e.message.context.traits.phone;
- const l = JSON.parse(JSON.stringify(e.message.context.traits));
- window.appboy.changeUser(t),
- window.appboy.getUser().setAvatarImageUrl(r),
- o && window.appboy.getUser().setEmail(o),
- s && window.appboy.getUser().setFirstName(s),
- a && window.appboy.getUser().setGender(this.formatGender(a)),
- u && window.appboy.getUser().setLastName(u),
- c && window.appboy.getUser().setPhoneNumber(c),
- n &&
- (window.appboy.getUser().setCountry(n.country),
- window.appboy.getUser().setHomeCity(n.city)),
- i &&
- window.appboy
- .getUser()
- .setDateOfBirth(
- i.getUTCFullYear(),
- i.getUTCMonth() + 1,
- i.getUTCDate()
- );
- [
- "avatar",
- "address",
- "birthday",
- "email",
- "id",
- "firstname",
- "gender",
- "lastname",
- "phone",
- "facebook",
- "twitter",
- "first_name",
- "last_name",
- "dob",
- "external_id",
- "country",
- "home_city",
- "bio",
- "gender",
- "phone",
- "email_subscribe",
- "push_subscribe",
- ].forEach(function (e) {
- delete l[e];
- }),
- Object.keys(l).forEach(function (e) {
- window.appboy.getUser().setCustomUserAttribute(e, l[e]);
- });
- },
- },
- {
- key: "handlePurchase",
- value(e, t) {
- const n = e.products;
- const r = e.currency;
- window.appboy.changeUser(t),
- del(e, "products"),
- del(e, "currency"),
- n.forEach(function (t) {
- const n = t.product_id;
- const i = t.price;
- const o = t.quantity;
- o && i && n && window.appboy.logPurchase(n, i, r, o, e);
- });
- },
- },
- {
- key: "track",
- value(e) {
- const t = e.message.userId;
- const n = e.message.event;
- let r = e.message.properties;
- window.appboy.changeUser(t),
- n.toLowerCase() === "order completed"
- ? this.handlePurchase(r, t)
- : ((r = this.handleReservedProperties(r)),
- window.appboy.logCustomEvent(n, r));
- },
- },
- {
- key: "page",
- value(e) {
- const t = e.message.userId;
- const n = e.message.name;
- let r = e.message.properties;
- (r = this.handleReservedProperties(r)),
- window.appboy.changeUser(t),
- window.appboy.logCustomEvent(n, r);
- },
- },
- {
- key: "isLoaded",
- value() {
- return window.appboyQueue === null;
- },
- },
- {
- key: "isReady",
- value() {
- return window.appboyQueue === null;
- },
- },
- ]),
- e
- );
- })();
- const Ue = R(function (e) {
- !(function () {
- const t =
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
- var n = {
- rotl(e, t) {
- return (e << t) | (e >>> (32 - t));
- },
- rotr(e, t) {
- return (e << (32 - t)) | (e >>> t);
- },
- endian(e) {
- if (e.constructor == Number)
- return (16711935 & n.rotl(e, 8)) | (4278255360 & n.rotl(e, 24));
- for (let t = 0; t < e.length; t++) e[t] = n.endian(e[t]);
- return e;
- },
- randomBytes(e) {
- for (var t = []; e > 0; e--) t.push(Math.floor(256 * Math.random()));
- return t;
- },
- bytesToWords(e) {
- for (var t = [], n = 0, r = 0; n < e.length; n++, r += 8)
- t[r >>> 5] |= e[n] << (24 - (r % 32));
- return t;
- },
- wordsToBytes(e) {
- for (var t = [], n = 0; n < 32 * e.length; n += 8)
- t.push((e[n >>> 5] >>> (24 - (n % 32))) & 255);
- return t;
- },
- bytesToHex(e) {
- for (var t = [], n = 0; n < e.length; n++)
- t.push((e[n] >>> 4).toString(16)), t.push((15 & e[n]).toString(16));
- return t.join("");
- },
- hexToBytes(e) {
- for (var t = [], n = 0; n < e.length; n += 2)
- t.push(parseInt(e.substr(n, 2), 16));
- return t;
- },
- bytesToBase64(e) {
- for (var n = [], r = 0; r < e.length; r += 3)
- for (
- let i = (e[r] << 16) | (e[r + 1] << 8) | e[r + 2], o = 0;
- o < 4;
- o++
- )
- 8 * r + 6 * o <= 8 * e.length
- ? n.push(t.charAt((i >>> (6 * (3 - o))) & 63))
- : n.push("=");
- return n.join("");
- },
- base64ToBytes(e) {
- e = e.replace(/[^A-Z0-9+\/]/gi, "");
- for (var n = [], r = 0, i = 0; r < e.length; i = ++r % 4)
- i != 0 &&
- n.push(
- ((t.indexOf(e.charAt(r - 1)) & (Math.pow(2, -2 * i + 8) - 1)) <<
- (2 * i)) |
- (t.indexOf(e.charAt(r)) >>> (6 - 2 * i))
- );
- return n;
- },
- };
- e.exports = n;
- })();
- });
- var Le = {
- utf8: {
- stringToBytes(e) {
- return Le.bin.stringToBytes(unescape(encodeURIComponent(e)));
- },
- bytesToString(e) {
- return decodeURIComponent(escape(Le.bin.bytesToString(e)));
- },
- },
- bin: {
- stringToBytes(e) {
- for (var t = [], n = 0; n < e.length; n++)
- t.push(255 & e.charCodeAt(n));
- return t;
- },
- bytesToString(e) {
- for (var t = [], n = 0; n < e.length; n++)
- t.push(String.fromCharCode(e[n]));
- return t.join("");
- },
- },
- };
- const Me = Le;
- const Ne = function (e) {
- return (
- e != null &&
- (Be(e) ||
- (function (e) {
- return (
- typeof e.readFloatLE === "function" &&
- typeof e.slice === "function" &&
- Be(e.slice(0, 0))
- );
- })(e) ||
- !!e._isBuffer)
- );
- };
- function Be(e) {
- return (
- !!e.constructor &&
- typeof e.constructor.isBuffer === "function" &&
- e.constructor.isBuffer(e)
- );
- }
- let qe;
- let Fe;
- const Ke = R(function (e) {
- !(function () {
- const t = Ue;
- const n = Me.utf8;
- const r = Ne;
- const i = Me.bin;
- var o = function (e, s) {
- e.constructor == String
- ? (e =
- s && s.encoding === "binary"
- ? i.stringToBytes(e)
- : n.stringToBytes(e))
- : r(e)
- ? (e = Array.prototype.slice.call(e, 0))
- : Array.isArray(e) || (e = e.toString());
- for (
- var a = t.bytesToWords(e),
- u = 8 * e.length,
- c = 1732584193,
- l = -271733879,
- d = -1732584194,
- p = 271733878,
- f = 0;
- f < a.length;
- f++
- )
- a[f] =
- (16711935 & ((a[f] << 8) | (a[f] >>> 24))) |
- (4278255360 & ((a[f] << 24) | (a[f] >>> 8)));
- (a[u >>> 5] |= 128 << u % 32), (a[14 + (((u + 64) >>> 9) << 4)] = u);
- const h = o._ff;
- const g = o._gg;
- const y = o._hh;
- const m = o._ii;
- for (f = 0; f < a.length; f += 16) {
- const v = c;
- const b = l;
- const w = d;
- const k = p;
- (c = h(c, l, d, p, a[f + 0], 7, -680876936)),
- (p = h(p, c, l, d, a[f + 1], 12, -389564586)),
- (d = h(d, p, c, l, a[f + 2], 17, 606105819)),
- (l = h(l, d, p, c, a[f + 3], 22, -1044525330)),
- (c = h(c, l, d, p, a[f + 4], 7, -176418897)),
- (p = h(p, c, l, d, a[f + 5], 12, 1200080426)),
- (d = h(d, p, c, l, a[f + 6], 17, -1473231341)),
- (l = h(l, d, p, c, a[f + 7], 22, -45705983)),
- (c = h(c, l, d, p, a[f + 8], 7, 1770035416)),
- (p = h(p, c, l, d, a[f + 9], 12, -1958414417)),
- (d = h(d, p, c, l, a[f + 10], 17, -42063)),
- (l = h(l, d, p, c, a[f + 11], 22, -1990404162)),
- (c = h(c, l, d, p, a[f + 12], 7, 1804603682)),
- (p = h(p, c, l, d, a[f + 13], 12, -40341101)),
- (d = h(d, p, c, l, a[f + 14], 17, -1502002290)),
- (c = g(
- c,
- (l = h(l, d, p, c, a[f + 15], 22, 1236535329)),
- d,
- p,
- a[f + 1],
- 5,
- -165796510
- )),
- (p = g(p, c, l, d, a[f + 6], 9, -1069501632)),
- (d = g(d, p, c, l, a[f + 11], 14, 643717713)),
- (l = g(l, d, p, c, a[f + 0], 20, -373897302)),
- (c = g(c, l, d, p, a[f + 5], 5, -701558691)),
- (p = g(p, c, l, d, a[f + 10], 9, 38016083)),
- (d = g(d, p, c, l, a[f + 15], 14, -660478335)),
- (l = g(l, d, p, c, a[f + 4], 20, -405537848)),
- (c = g(c, l, d, p, a[f + 9], 5, 568446438)),
- (p = g(p, c, l, d, a[f + 14], 9, -1019803690)),
- (d = g(d, p, c, l, a[f + 3], 14, -187363961)),
- (l = g(l, d, p, c, a[f + 8], 20, 1163531501)),
- (c = g(c, l, d, p, a[f + 13], 5, -1444681467)),
- (p = g(p, c, l, d, a[f + 2], 9, -51403784)),
- (d = g(d, p, c, l, a[f + 7], 14, 1735328473)),
- (c = y(
- c,
- (l = g(l, d, p, c, a[f + 12], 20, -1926607734)),
- d,
- p,
- a[f + 5],
- 4,
- -378558
- )),
- (p = y(p, c, l, d, a[f + 8], 11, -2022574463)),
- (d = y(d, p, c, l, a[f + 11], 16, 1839030562)),
- (l = y(l, d, p, c, a[f + 14], 23, -35309556)),
- (c = y(c, l, d, p, a[f + 1], 4, -1530992060)),
- (p = y(p, c, l, d, a[f + 4], 11, 1272893353)),
- (d = y(d, p, c, l, a[f + 7], 16, -155497632)),
- (l = y(l, d, p, c, a[f + 10], 23, -1094730640)),
- (c = y(c, l, d, p, a[f + 13], 4, 681279174)),
- (p = y(p, c, l, d, a[f + 0], 11, -358537222)),
- (d = y(d, p, c, l, a[f + 3], 16, -722521979)),
- (l = y(l, d, p, c, a[f + 6], 23, 76029189)),
- (c = y(c, l, d, p, a[f + 9], 4, -640364487)),
- (p = y(p, c, l, d, a[f + 12], 11, -421815835)),
- (d = y(d, p, c, l, a[f + 15], 16, 530742520)),
- (c = m(
- c,
- (l = y(l, d, p, c, a[f + 2], 23, -995338651)),
- d,
- p,
- a[f + 0],
- 6,
- -198630844
- )),
- (p = m(p, c, l, d, a[f + 7], 10, 1126891415)),
- (d = m(d, p, c, l, a[f + 14], 15, -1416354905)),
- (l = m(l, d, p, c, a[f + 5], 21, -57434055)),
- (c = m(c, l, d, p, a[f + 12], 6, 1700485571)),
- (p = m(p, c, l, d, a[f + 3], 10, -1894986606)),
- (d = m(d, p, c, l, a[f + 10], 15, -1051523)),
- (l = m(l, d, p, c, a[f + 1], 21, -2054922799)),
- (c = m(c, l, d, p, a[f + 8], 6, 1873313359)),
- (p = m(p, c, l, d, a[f + 15], 10, -30611744)),
- (d = m(d, p, c, l, a[f + 6], 15, -1560198380)),
- (l = m(l, d, p, c, a[f + 13], 21, 1309151649)),
- (c = m(c, l, d, p, a[f + 4], 6, -145523070)),
- (p = m(p, c, l, d, a[f + 11], 10, -1120210379)),
- (d = m(d, p, c, l, a[f + 2], 15, 718787259)),
- (l = m(l, d, p, c, a[f + 9], 21, -343485551)),
- (c = (c + v) >>> 0),
- (l = (l + b) >>> 0),
- (d = (d + w) >>> 0),
- (p = (p + k) >>> 0);
- }
- return t.endian([c, l, d, p]);
- };
- (o._ff = function (e, t, n, r, i, o, s) {
- const a = e + ((t & n) | (~t & r)) + (i >>> 0) + s;
- return ((a << o) | (a >>> (32 - o))) + t;
- }),
- (o._gg = function (e, t, n, r, i, o, s) {
- const a = e + ((t & r) | (n & ~r)) + (i >>> 0) + s;
- return ((a << o) | (a >>> (32 - o))) + t;
- }),
- (o._hh = function (e, t, n, r, i, o, s) {
- const a = e + (t ^ n ^ r) + (i >>> 0) + s;
- return ((a << o) | (a >>> (32 - o))) + t;
- }),
- (o._ii = function (e, t, n, r, i, o, s) {
- const a = e + (n ^ (t | ~r)) + (i >>> 0) + s;
- return ((a << o) | (a >>> (32 - o))) + t;
- }),
- (o._blocksize = 16),
- (o._digestsize = 16),
- (e.exports = function (e, n) {
- if (e == null) throw new Error(`Illegal argument ${e}`);
- const r = t.wordsToBytes(o(e, n));
- return n && n.asBytes
- ? r
- : n && n.asString
- ? i.bytesToString(r)
- : t.bytesToHex(r);
- });
- })();
- });
- const Ge = (function () {
- function e(t) {
- n(this, e),
- (this.NAME = "INTERCOM"),
- (this.API_KEY = t.apiKey),
- (this.APP_ID = t.appId),
- (this.MOBILE_APP_ID = t.mobileAppId),
- p("Config ", t);
- }
- return (
- i(e, [
- {
- key: "init",
- value() {
- (window.intercomSettings = { app_id: this.APP_ID }),
- (function () {
- const e = window;
- const t = e.Intercom;
- if (typeof t === "function")
- t("reattach_activator"), t("update", e.intercomSettings);
- else {
- const n = document;
- const r = function e() {
- e.c(arguments);
- };
- (r.q = []),
- (r.c = function (e) {
- r.q.push(e);
- }),
- (e.Intercom = r);
- const i = function () {
- const e = n.createElement("script");
- (e.type = "text/javascript"),
- (e.async = !0),
- (e.src = `https://widget.intercom.io/widget/${window.intercomSettings.app_id}`);
- const t = n.getElementsByTagName("script")[0];
- t.parentNode.insertBefore(e, t);
- };
- document.readyState === "complete"
- ? (i(), (window.intercom_code = !0))
- : e.attachEvent
- ? (e.attachEvent("onload", i), (window.intercom_code = !0))
- : (e.addEventListener("load", i, !1),
- (window.intercom_code = !0));
- }
- })();
- },
- },
- {
- key: "page",
- value() {
- window.Intercom("update");
- },
- },
- {
- key: "identify",
- value(e) {
- const n = {};
- const r = e.message.context;
- if ((r.Intercom ? r.Intercom : null) != null) {
- const i = r.Intercom.user_hash ? r.Intercom.user_hash : null;
- i != null && (n.user_hash = i);
- const o = r.Intercom.hideDefaultLauncher
- ? r.Intercom.hideDefaultLauncher
- : null;
- o != null && (n.hide_default_launcher = o);
- }
- Object.keys(r.traits).forEach(function (e) {
- if (r.traits.hasOwnProperty(e)) {
- const i = r.traits[e];
- if (e === "company") {
- const o = [];
- const s = {};
- typeof r.traits[e] === "string" &&
- (s.company_id = Ke(r.traits[e]));
- const a =
- (t(r.traits[e]) == "object" && Object.keys(r.traits[e])) ||
- [];
- a.forEach(function (t) {
- a.hasOwnProperty(t) &&
- (t != "id"
- ? (s[t] = r.traits[e][t])
- : (s.company_id = r.traits[e][t]));
- }),
- t(r.traits[e]) != "object" ||
- a.includes("id") ||
- (s.company_id = Ke(s.name)),
- o.push(s),
- (n.companies = o);
- } else n[e] = r.traits[e];
- switch (e) {
- case "createdAt":
- n.created_at = i;
- break;
- case "anonymousId":
- n.user_id = i;
- }
- }
- }),
- (n.user_id = e.message.userId),
- window.Intercom("update", n);
- },
- },
- {
- key: "track",
- value(e) {
- const t = {};
- const n = e.message;
- (n.properties ? Object.keys(n.properties) : null).forEach(function (
- e
- ) {
- const r = n.properties[e];
- t[e] = r;
- }),
- n.event && (t.event_name = n.event),
- (t.user_id = n.userId ? n.userId : n.anonymousId),
- (t.created_at = Math.floor(
- new Date(n.originalTimestamp).getTime() / 1e3
- )),
- window.Intercom("trackEvent", t.event_name, t);
- },
- },
- {
- key: "isLoaded",
- value() {
- return !!window.intercom_code;
- },
- },
- {
- key: "isReady",
- value() {
- return !!window.intercom_code;
- },
- },
- ]),
- e
- );
- })();
- const He = (function () {
- function e(t) {
- n(this, e),
- (this.projectID = t.projectID),
- (this.writeKey = t.writeKey),
- (this.ipAddon = t.ipAddon),
- (this.uaAddon = t.uaAddon),
- (this.urlAddon = t.urlAddon),
- (this.referrerAddon = t.referrerAddon),
- (this.client = null),
- (this.name = "KEEN");
- }
- return (
- i(e, [
- {
- key: "init",
- value() {
- p("===in init Keen==="),
- T(
- "keen-integration",
- "https://cdn.jsdelivr.net/npm/keen-tracking@4"
- );
- var e = setInterval(
- function () {
- void 0 !== window.KeenTracking &&
- void 0 !== window.KeenTracking &&
- ((this.client = (function (e) {
- return (
- (e.client = new window.KeenTracking({
- projectId: e.projectID,
- writeKey: e.writeKey,
- })),
- e.client
- );
- })(this)),
- clearInterval(e));
- }.bind(this),
- 1e3
- );
- },
- },
- {
- key: "identify",
- value(e) {
- p("in Keen identify");
- const t = e.message.context.traits;
- const n = e.message.userId
- ? e.message.userId
- : e.message.anonymousId;
- var r = e.message.properties
- ? Object.assign(r, e.message.properties)
- : {};
- (r.user = { userId: n, traits: t }),
- (r = this.getAddOn(r)),
- this.client.extendEvents(r);
- },
- },
- {
- key: "track",
- value(e) {
- p("in Keen track");
- const t = e.message.event;
- let n = e.message.properties;
- (n = this.getAddOn(n)), this.client.recordEvent(t, n);
- },
- },
- {
- key: "page",
- value(e) {
- p("in Keen page");
- const t = e.message.name;
- const n = e.message.properties
- ? e.message.properties.category
- : void 0;
- let r = "Loaded a Page";
- t && (r = `Viewed ${t} page`),
- n && t && (r = `Viewed ${n} ${t} page`);
- let i = e.message.properties;
- (i = this.getAddOn(i)), this.client.recordEvent(r, i);
- },
- },
- {
- key: "isLoaded",
- value() {
- return p("in Keen isLoaded"), !(this.client == null);
- },
- },
- {
- key: "isReady",
- value() {
- return !(this.client == null);
- },
- },
- {
- key: "getAddOn",
- value(e) {
- const t = [];
- return (
- this.ipAddon &&
- ((e.ip_address = "${keen.ip}"),
- t.push({
- name: "keen:ip_to_geo",
- input: { ip: "ip_address" },
- output: "ip_geo_info",
- })),
- this.uaAddon &&
- ((e.user_agent = "${keen.user_agent}"),
- t.push({
- name: "keen:ua_parser",
- input: { ua_string: "user_agent" },
- output: "parsed_user_agent",
- })),
- this.urlAddon &&
- ((e.page_url = document.location.href),
- t.push({
- name: "keen:url_parser",
- input: { url: "page_url" },
- output: "parsed_page_url",
- })),
- this.referrerAddon &&
- ((e.page_url = document.location.href),
- (e.referrer_url = document.referrer),
- t.push({
- name: "keen:referrer_parser",
- input: {
- referrer_url: "referrer_url",
- page_url: "page_url",
- },
- output: "referrer_info",
- })),
- (e.keen = { addons: t }),
- e
- );
- },
- },
- ]),
- e
- );
- })();
- const Ve = Object.prototype;
- const ze = Ve.hasOwnProperty;
- const Je = Ve.toString;
- typeof Symbol === "function" && (qe = Symbol.prototype.valueOf),
- typeof BigInt === "function" && (Fe = BigInt.prototype.valueOf);
- const We = function (e) {
- return e != e;
- };
- const $e = { boolean: 1, number: 1, string: 1, undefined: 1 };
- const Ye = /^([A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{4}|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}==)$/;
- const Qe = /^[A-Fa-f0-9]+$/;
- const Ze = {};
- (Ze.a = Ze.type = function (e, t) {
- return typeof e === t;
- }),
- (Ze.defined = function (e) {
- return void 0 !== e;
- }),
- (Ze.empty = function (e) {
- let t;
- const n = Je.call(e);
- if (
- n === "[object Array]" ||
- n === "[object Arguments]" ||
- n === "[object String]"
- )
- return e.length === 0;
- if (n === "[object Object]") {
- for (t in e) if (ze.call(e, t)) return !1;
- return !0;
- }
- return !e;
- }),
- (Ze.equal = function (e, t) {
- if (e === t) return !0;
- let n;
- const r = Je.call(e);
- if (r !== Je.call(t)) return !1;
- if (r === "[object Object]") {
- for (n in e) if (!Ze.equal(e[n], t[n]) || !(n in t)) return !1;
- for (n in t) if (!Ze.equal(e[n], t[n]) || !(n in e)) return !1;
- return !0;
- }
- if (r === "[object Array]") {
- if ((n = e.length) !== t.length) return !1;
- for (; n--; ) if (!Ze.equal(e[n], t[n])) return !1;
- return !0;
- }
- return r === "[object Function]"
- ? e.prototype === t.prototype
- : r === "[object Date]" && e.getTime() === t.getTime();
- }),
- (Ze.hosted = function (e, t) {
- const n = typeof t[e];
- return n === "object" ? !!t[e] : !$e[n];
- }),
- (Ze.instance = Ze.instanceof = function (e, t) {
- return e instanceof t;
- }),
- (Ze.nil = Ze.null = function (e) {
- return e === null;
- }),
- (Ze.undef = Ze.undefined = function (e) {
- return void 0 === e;
- }),
- (Ze.args = Ze.arguments = function (e) {
- const t = Je.call(e) === "[object Arguments]";
- const n =
- !Ze.array(e) && Ze.arraylike(e) && Ze.object(e) && Ze.fn(e.callee);
- return t || n;
- }),
- (Ze.array =
- Array.isArray ||
- function (e) {
- return Je.call(e) === "[object Array]";
- }),
- (Ze.args.empty = function (e) {
- return Ze.args(e) && e.length === 0;
- }),
- (Ze.array.empty = function (e) {
- return Ze.array(e) && e.length === 0;
- }),
- (Ze.arraylike = function (e) {
- return (
- !!e &&
- !Ze.bool(e) &&
- ze.call(e, "length") &&
- isFinite(e.length) &&
- Ze.number(e.length) &&
- e.length >= 0
- );
- }),
- (Ze.bool = Ze.boolean = function (e) {
- return Je.call(e) === "[object Boolean]";
- }),
- (Ze.false = function (e) {
- return Ze.bool(e) && !1 === Boolean(Number(e));
- }),
- (Ze.true = function (e) {
- return Ze.bool(e) && !0 === Boolean(Number(e));
- }),
- (Ze.date = function (e) {
- return Je.call(e) === "[object Date]";
- }),
- (Ze.date.valid = function (e) {
- return Ze.date(e) && !isNaN(Number(e));
- }),
- (Ze.element = function (e) {
- return (
- void 0 !== e &&
- typeof HTMLElement !== "undefined" &&
- e instanceof HTMLElement &&
- e.nodeType === 1
- );
- }),
- (Ze.error = function (e) {
- return Je.call(e) === "[object Error]";
- }),
- (Ze.fn = Ze.function = function (e) {
- if (typeof window !== "undefined" && e === window.alert) return !0;
- const t = Je.call(e);
- return (
- t === "[object Function]" ||
- t === "[object GeneratorFunction]" ||
- t === "[object AsyncFunction]"
- );
- }),
- (Ze.number = function (e) {
- return Je.call(e) === "[object Number]";
- }),
- (Ze.infinite = function (e) {
- return e === 1 / 0 || e === -1 / 0;
- }),
- (Ze.decimal = function (e) {
- return Ze.number(e) && !We(e) && !Ze.infinite(e) && e % 1 != 0;
- }),
- (Ze.divisibleBy = function (e, t) {
- const n = Ze.infinite(e);
- const r = Ze.infinite(t);
- const i = Ze.number(e) && !We(e) && Ze.number(t) && !We(t) && t !== 0;
- return n || r || (i && e % t == 0);
- }),
- (Ze.integer = Ze.int = function (e) {
- return Ze.number(e) && !We(e) && e % 1 == 0;
- }),
- (Ze.maximum = function (e, t) {
- if (We(e)) throw new TypeError("NaN is not a valid value");
- if (!Ze.arraylike(t))
- throw new TypeError("second argument must be array-like");
- for (let n = t.length; --n >= 0; ) if (e < t[n]) return !1;
- return !0;
- }),
- (Ze.minimum = function (e, t) {
- if (We(e)) throw new TypeError("NaN is not a valid value");
- if (!Ze.arraylike(t))
- throw new TypeError("second argument must be array-like");
- for (let n = t.length; --n >= 0; ) if (e > t[n]) return !1;
- return !0;
- }),
- (Ze.nan = function (e) {
- return !Ze.number(e) || e != e;
- }),
- (Ze.even = function (e) {
- return Ze.infinite(e) || (Ze.number(e) && e == e && e % 2 == 0);
- }),
- (Ze.odd = function (e) {
- return Ze.infinite(e) || (Ze.number(e) && e == e && e % 2 != 0);
- }),
- (Ze.ge = function (e, t) {
- if (We(e) || We(t)) throw new TypeError("NaN is not a valid value");
- return !Ze.infinite(e) && !Ze.infinite(t) && e >= t;
- }),
- (Ze.gt = function (e, t) {
- if (We(e) || We(t)) throw new TypeError("NaN is not a valid value");
- return !Ze.infinite(e) && !Ze.infinite(t) && e > t;
- }),
- (Ze.le = function (e, t) {
- if (We(e) || We(t)) throw new TypeError("NaN is not a valid value");
- return !Ze.infinite(e) && !Ze.infinite(t) && e <= t;
- }),
- (Ze.lt = function (e, t) {
- if (We(e) || We(t)) throw new TypeError("NaN is not a valid value");
- return !Ze.infinite(e) && !Ze.infinite(t) && e < t;
- }),
- (Ze.within = function (e, t, n) {
- if (We(e) || We(t) || We(n))
- throw new TypeError("NaN is not a valid value");
- if (!Ze.number(e) || !Ze.number(t) || !Ze.number(n))
- throw new TypeError("all arguments must be numbers");
- return (
- Ze.infinite(e) || Ze.infinite(t) || Ze.infinite(n) || (e >= t && e <= n)
- );
- }),
- (Ze.object = function (e) {
- return Je.call(e) === "[object Object]";
- }),
- (Ze.primitive = function (e) {
- return (
- !e ||
- !(typeof e === "object" || Ze.object(e) || Ze.fn(e) || Ze.array(e))
- );
- }),
- (Ze.hash = function (e) {
- return (
- Ze.object(e) &&
- e.constructor === Object &&
- !e.nodeType &&
- !e.setInterval
- );
- }),
- (Ze.regexp = function (e) {
- return Je.call(e) === "[object RegExp]";
- }),
- (Ze.string = function (e) {
- return Je.call(e) === "[object String]";
- }),
- (Ze.base64 = function (e) {
- return Ze.string(e) && (!e.length || Ye.test(e));
- }),
- (Ze.hex = function (e) {
- return Ze.string(e) && (!e.length || Qe.test(e));
- }),
- (Ze.symbol = function (e) {
- return (
- typeof Symbol === "function" &&
- Je.call(e) === "[object Symbol]" &&
- typeof qe.call(e) === "symbol"
- );
- }),
- (Ze.bigint = function (e) {
- return (
- typeof BigInt === "function" &&
- Je.call(e) === "[object BigInt]" &&
- typeof Fe.call(e) === "bigint"
- );
- });
- let Xe;
- const et = Ze;
- const tt = Object.prototype.hasOwnProperty;
- const nt = function (e) {
- for (
- let t = Array.prototype.slice.call(arguments, 1), n = 0;
- n < t.length;
- n += 1
- )
- for (const r in t[n]) tt.call(t[n], r) && (e[r] = t[n][r]);
- return e;
- };
- const rt = R(function (e) {
- function t(e) {
- return function (t, n, r, o) {
- let s;
- (normalize =
- o &&
- (function (e) {
- return typeof e === "function";
- })(o.normalizer)
- ? o.normalizer
- : i),
- (n = normalize(n));
- for (var a = !1; !a; ) u();
- function u() {
- for (s in t) {
- const e = normalize(s);
- if (n.indexOf(e) === 0) {
- const r = n.substr(e.length);
- if (r.charAt(0) === "." || r.length === 0) {
- n = r.substr(1);
- const i = t[s];
- return i == null
- ? void (a = !0)
- : n.length
- ? void (t = i)
- : void (a = !0);
- }
- }
- }
- (s = void 0), (a = !0);
- }
- if (s) return t == null ? t : e(t, s, r);
- };
- }
- function n(e, t) {
- return e.hasOwnProperty(t) && delete e[t], e;
- }
- function r(e, t, n) {
- return e.hasOwnProperty(t) && (e[t] = n), e;
- }
- function i(e) {
- return e.replace(/[^a-zA-Z0-9\.]+/g, "").toLowerCase();
- }
- (e.exports = t(function (e, t) {
- if (e.hasOwnProperty(t)) return e[t];
- })),
- (e.exports.find = e.exports),
- (e.exports.replace = function (e, n, i, o) {
- return t(r).call(this, e, n, i, o), e;
- }),
- (e.exports.del = function (e, r, i) {
- return t(n).call(this, e, r, null, i), e;
- });
- });
- const it = (rt.find, rt.replace, rt.del, Object.prototype.toString);
- const ot = function (e) {
- switch (it.call(e)) {
- case "[object Function]":
- return "function";
- case "[object Date]":
- return "date";
- case "[object RegExp]":
- return "regexp";
- case "[object Arguments]":
- return "arguments";
- case "[object Array]":
- return "array";
- case "[object String]":
- return "string";
- }
- return e === null
- ? "null"
- : void 0 === e
- ? "undefined"
- : e && e.nodeType === 1
- ? "element"
- : e === Object(e)
- ? "object"
- : typeof e;
- };
- const st = /\b(Array|Date|Object|Math|JSON)\b/g;
- const at = function (e, t) {
- const n = (function (e) {
- for (var t = [], n = 0; n < e.length; n++)
- ~t.indexOf(e[n]) || t.push(e[n]);
- return t;
- })(
- (function (e) {
- return (
- e
- .replace(/\.\w+|\w+ *\(|"[^"]*"|'[^']*'|\/([^/]+)\//g, "")
- .replace(st, "")
- .match(/[a-zA-Z_]\w*/g) || []
- );
- })(e)
- );
- return (
- t &&
- typeof t === "string" &&
- (t = (function (e) {
- return function (t) {
- return e + t;
- };
- })(t)),
- t
- ? (function (e, t, n) {
- return e.replace(
- /\.\w+|\w+ *\(|"[^"]*"|'[^']*'|\/([^/]+)\/|[a-zA-Z_]\w*/g,
- function (e) {
- return e[e.length - 1] == "(" || ~t.indexOf(e) ? n(e) : e;
- }
- );
- })(e, n, t)
- : n
- );
- };
- try {
- Xe = at;
- } catch (e) {
- Xe = at;
- }
- const ut = ct;
- function ct(e) {
- switch ({}.toString.call(e)) {
- case "[object Object]":
- return (function (e) {
- const t = {};
- for (const n in e)
- t[n] = typeof e[n] === "string" ? lt(e[n]) : ct(e[n]);
- return function (e) {
- if (typeof e !== "object") return !1;
- for (const n in t) {
- if (!(n in e)) return !1;
- if (!t[n](e[n])) return !1;
- }
- return !0;
- };
- })(e);
- case "[object Function]":
- return e;
- case "[object String]":
- return /^ *\W+/.test((n = e))
- ? new Function("_", `return _ ${n}`)
- : new Function(
- "_",
- `return ${(function (e) {
- let t;
- let n;
- let r;
- const i = Xe(e);
- if (!i.length) return `_.${e}`;
- for (n = 0; n < i.length; n++)
- (r = i[n]),
- (e = dt(
- r,
- e,
- (t = `('function' == typeof ${(t = `_.${r}`)} ? ${t}() : ${t})`)
- ));
- return e;
- })(n)}`
- );
- case "[object RegExp]":
- return (
- (t = e),
- function (e) {
- return t.test(e);
- }
- );
- default:
- return lt(e);
- }
- let t;
- let n;
- }
- function lt(e) {
- return function (t) {
- return e === t;
- };
- }
- function dt(e, t, n) {
- return t.replace(new RegExp(`(\\.)?${e}`, "g"), function (e, t) {
- return t ? e : n;
- });
- }
- try {
- var pt = ot;
- } catch (e) {
- pt = ot;
- }
- const ft = Object.prototype.hasOwnProperty;
- const ht = function (e, t, n) {
- switch (((t = ut(t)), (n = n || this), pt(e))) {
- case "array":
- return gt(e, t, n);
- case "object":
- return typeof e.length === "number"
- ? gt(e, t, n)
- : (function (e, t, n) {
- for (const r in e) ft.call(e, r) && t.call(n, r, e[r]);
- })(e, t, n);
- case "string":
- return (function (e, t, n) {
- for (let r = 0; r < e.length; ++r) t.call(n, e.charAt(r), r);
- })(e, t, n);
- }
- };
- function gt(e, t, n) {
- for (let r = 0; r < e.length; ++r) t.call(n, e[r], r);
- }
- const yt = (function () {
- function e(t) {
- n(this, e),
- (this.apiKey = t.apiKey),
- (this.prefixProperties = t.prefixProperties),
- (this.name = "KISSMETRICS");
- }
- return (
- i(e, [
- {
- key: "init",
- value() {
- p("===in init Kissmetrics==="), (window._kmq = window._kmq || []);
- const e = window._kmk || this.apiKey;
- function t(e) {
- setTimeout(function () {
- const t = document;
- const n = t.getElementsByTagName("script")[0];
- const r = t.createElement("script");
- (r.type = "text/javascript"),
- (r.async = !0),
- (r.src = e),
- n.parentNode.insertBefore(r, n);
- }, 1);
- }
- t("//i.kissmetrics.com/i.js"),
- t(`//scripts.kissmetrics.com/${e}.2.js`),
- this.isEnvMobile() &&
- window._kmq.push(["set", { "Mobile Session": "Yes" }]);
- },
- },
- {
- key: "isEnvMobile",
- value() {
- return (
- navigator.userAgent.match(/Android/i) ||
- navigator.userAgent.match(/BlackBerry/i) ||
- navigator.userAgent.match(/IEMobile/i) ||
- navigator.userAgent.match(/Opera Mini/i) ||
- navigator.userAgent.match(/iPad/i) ||
- navigator.userAgent.match(/iPhone|iPod/i)
- );
- },
- },
- {
- key: "toUnixTimestamp",
- value(e) {
- return (e = new Date(e)), Math.floor(e.getTime() / 1e3);
- },
- },
- {
- key: "clean",
- value(e) {
- let t = {};
- for (const n in e)
- if (e.hasOwnProperty(n)) {
- const r = e[n];
- if (r == null) continue;
- if (et.date(r)) {
- t[n] = this.toUnixTimestamp(r);
- continue;
- }
- if (et.bool(r)) {
- t[n] = r;
- continue;
- }
- if (et.number(r)) {
- t[n] = r;
- continue;
- }
- if ((p(r.toString()), r.toString() !== "[object Object]")) {
- t[n] = r.toString();
- continue;
- }
- const i = {};
- i[n] = r;
- const o = this.flatten(i, { safe: !0 });
- for (const s in o) et.array(o[s]) && (o[s] = o[s].toString());
- delete (t = nt(t, o))[n];
- }
- return t;
- },
- },
- {
- key: "flatten",
- value(e, t) {
- const n = (t = t || {}).delimiter || ".";
- let r = t.maxDepth;
- let i = 1;
- const o = {};
- return (
- (function e(s, a) {
- for (const u in s)
- if (s.hasOwnProperty(u)) {
- const c = s[u];
- const l = t.safe && et.array(c);
- const d = Object.prototype.toString.call(c);
- const p = d === "[object Object]" || d === "[object Array]";
- const f = [];
- const h = a ? a + n + u : u;
- for (const g in (t.maxDepth || (r = i + 1), c))
- c.hasOwnProperty(g) && f.push(g);
- if (!l && p && f.length && i < r) return ++i, e(c, h);
- o[h] = c;
- }
- })(e),
- o
- );
- },
- },
- {
- key: "prefix",
- value(e, t) {
- const n = {};
- return (
- ht(t, function (t, r) {
- t === "Billing Amount"
- ? (n[t] = r)
- : t === "revenue"
- ? ((n[`${e} - ${t}`] = r), (n["Billing Amount"] = r))
- : (n[`${e} - ${t}`] = r);
- }),
- n
- );
- },
- },
- {
- key: "identify",
- value(e) {
- p("in Kissmetrics identify");
- const t = this.clean(e.message.context.traits);
- const n =
- e.message.userId && e.message.userId != ""
- ? e.message.userId
- : void 0;
- n && window._kmq.push(["identify", n]),
- t && window._kmq.push(["set", t]);
- },
- },
- {
- key: "track",
- value(e) {
- p("in Kissmetrics track");
- const t = e.message.event;
- let n = JSON.parse(JSON.stringify(e.message.properties));
- const r = this.toUnixTimestamp(new Date());
- const i = I(n);
- i && (n.revenue = i);
- const o = n.products;
- o && delete n.products,
- (n = this.clean(n)),
- p(JSON.stringify(n)),
- this.prefixProperties && (n = this.prefix(t, n)),
- window._kmq.push(["record", t, n]);
- const s = function (e, n) {
- let i = e;
- this.prefixProperties && (i = this.prefix(t, i)),
- (i._t = r + n),
- (i._d = 1),
- window.KM.set(i);
- }.bind(this);
- o &&
- window._kmq.push(function () {
- ht(o, s);
- });
- },
- },
- {
- key: "page",
- value(e) {
- p("in Kissmetrics page");
- const t = e.message.name;
- const n = e.message.properties
- ? e.message.properties.category
- : void 0;
- let r = "Loaded a Page";
- t && (r = `Viewed ${t} page`),
- n && t && (r = `Viewed ${n} ${t} page`);
- let i = e.message.properties;
- this.prefixProperties && (i = this.prefix("Page", i)),
- window._kmq.push(["record", r, i]);
- },
- },
- {
- key: "alias",
- value(e) {
- const t = e.message.previousId;
- const n = e.message.userId;
- window._kmq.push(["alias", n, t]);
- },
- },
- {
- key: "group",
- value(e) {
- const t = e.message.groupId;
- let n = e.message.traits;
- (n = this.prefix("Group", n)),
- t && (n["Group - id"] = t),
- window._kmq.push(["set", n]),
- p("in Kissmetrics group");
- },
- },
- {
- key: "isLoaded",
- value() {
- return et.object(window.KM);
- },
- },
- {
- key: "isReady",
- value() {
- return et.object(window.KM);
- },
- },
- ]),
- e
- );
- })();
- const mt = (function () {
- function e(t) {
- n(this, e),
- (this.siteID = t.siteID),
- (this.apiKey = t.apiKey),
- (this.name = "CUSTOMERIO");
- }
- return (
- i(e, [
- {
- key: "init",
- value() {
- p("===in init Customer IO init==="),
- (window._cio = window._cio || []);
- const e = this.siteID;
- !(function () {
- let t;
- let n;
- let r;
- for (
- t = function (e) {
- return function () {
- window._cio.push(
- [e].concat(Array.prototype.slice.call(arguments, 0))
- );
- };
- },
- n = ["load", "identify", "sidentify", "track", "page"],
- r = 0;
- r < n.length;
- r++
- )
- window._cio[n[r]] = t(n[r]);
- const i = document.createElement("script");
- const o = document.getElementsByTagName("script")[0];
- (i.async = !0),
- (i.id = "cio-tracker"),
- i.setAttribute("data-site-id", e),
- (i.src = "https://assets.customer.io/assets/track.js"),
- o.parentNode.insertBefore(i, o);
- })();
- },
- },
- {
- key: "identify",
- value(e) {
- p("in Customer IO identify");
- const t = e.message.userId
- ? e.message.userId
- : e.message.anonymousId;
- const n = e.message.context.traits ? e.message.context.traits : {};
- n.created_at ||
- (n.created_at = Math.floor(new Date().getTime() / 1e3)),
- (n.id = t),
- window._cio.identify(n);
- },
- },
- {
- key: "track",
- value(e) {
- p("in Customer IO track");
- const t = e.message.event;
- const n = e.message.properties;
- window._cio.track(t, n);
- },
- },
- {
- key: "page",
- value(e) {
- p("in Customer IO page");
- const t = e.message.name || e.message.properties.url;
- window._cio.page(t, e.message.properties);
- },
- },
- {
- key: "isLoaded",
- value() {
- return !(!window._cio || window._cio.push === Array.prototype.push);
- },
- },
- {
- key: "isReady",
- value() {
- return !(!window._cio || window._cio.push === Array.prototype.push);
- },
- },
- ]),
- e
- );
- })();
- let vt = !1;
- const bt = [];
- var wt = setInterval(function () {
- document.body && ((vt = !0), ht(bt, kt), clearInterval(wt));
- }, 5);
- function kt(e) {
- e(document.body);
- }
- for (
- var It = (function () {
- function e(t, r) {
- n(this, e),
- (this.analytics = r),
- (this._sf_async_config = window._sf_async_config =
- window._sf_async_config || {}),
- (window._sf_async_config.useCanonical = !0),
- (window._sf_async_config.uid = t.uid),
- (window._sf_async_config.domain = t.domain),
- (this.isVideo = !!t.video),
- (this.sendNameAndCategoryAsTitle =
- t.sendNameAndCategoryAsTitle || !0),
- (this.subscriberEngagementKeys = t.subscriberEngagementKeys || []),
- (this.replayEvents = []),
- (this.failed = !1),
- (this.isFirstPageCallMade = !1),
- (this.name = "CHARTBEAT");
- }
- return (
- i(e, [
- {
- key: "init",
- value() {
- p("===in init Chartbeat===");
- },
- },
- {
- key: "identify",
- value(e) {
- p("in Chartbeat identify");
- },
- },
- {
- key: "track",
- value(e) {
- p("in Chartbeat track");
- },
- },
- {
- key: "page",
- value(e) {
- if (
- (p("in Chartbeat page"),
- this.loadConfig(e),
- this.isFirstPageCallMade)
- ) {
- if (this.failed)
- return (
- p("===ignoring cause failed integration==="),
- void (this.replayEvents = [])
- );
- if (!this.isLoaded() && !this.failed)
- return (
- p("===pushing to replay queue for chartbeat==="),
- void this.replayEvents.push(["page", e])
- );
- p("===processing page event in chartbeat===");
- const t = e.message.properties;
- window.pSUPERFLY.virtualPage(t.path);
- } else (this.isFirstPageCallMade = !0), this.initAfterPage();
- },
- },
- {
- key: "isLoaded",
- value() {
- return (
- p("in Chartbeat isLoaded"),
- !this.isFirstPageCallMade || !!window.pSUPERFLY
- );
- },
- },
- {
- key: "isFailed",
- value() {
- return this.failed;
- },
- },
- {
- key: "isReady",
- value() {
- return !!window.pSUPERFLY;
- },
- },
- {
- key: "loadConfig",
- value(e) {
- let t;
- const n = e.message.properties;
- const r = n ? n.category : void 0;
- const i = e.message.name;
- const o = n ? n.author : void 0;
- this.sendNameAndCategoryAsTitle &&
- (t = r && i ? `${r} ${i}` : i),
- r && (window._sf_async_config.sections = r),
- o && (window._sf_async_config.authors = o),
- t && (window._sf_async_config.title = t);
- const s = (window._cbq = window._cbq || []);
- for (const a in n)
- n.hasOwnProperty(a) &&
- this.subscriberEngagementKeys.indexOf(a) > -1 &&
- s.push([a, n[a]]);
- },
- },
- {
- key: "initAfterPage",
- value() {
- let e;
- const t = this;
- (e = function () {
- let e;
- let n;
- const r = t.isVideo ? "chartbeat_video.js" : "chartbeat.js";
- (e = document.createElement("script")),
- (n = document.getElementsByTagName("script")[0]),
- (e.type = "text/javascript"),
- (e.async = !0),
- (e.src = `//static.chartbeat.com/js/${r}`),
- n.parentNode.insertBefore(e, n);
- }),
- vt ? kt(e) : bt.push(e),
- this._isReady(this).then(function (e) {
- p("===replaying on chartbeat==="),
- e.replayEvents.forEach(function (t) {
- e[t[0]](t[1]);
- });
- });
- },
- },
- {
- key: "pause",
- value(e) {
- return new Promise(function (t) {
- setTimeout(t, e);
- });
- },
- },
- {
- key: "_isReady",
- value(e) {
- const t = this;
- const n =
- arguments.length > 1 && void 0 !== arguments[1]
- ? arguments[1]
- : 0;
- return new Promise(function (r) {
- return t.isLoaded()
- ? ((t.failed = !1),
- p("===chartbeat loaded successfully==="),
- e.analytics.emit("ready"),
- r(e))
- : n >= 1e4
- ? ((t.failed = !0), p("===chartbeat failed==="), r(e))
- : void t.pause(1e3).then(function () {
- return t._isReady(e, n + 1e3).then(r);
- });
- });
- },
- },
- ]),
- e
- );
- })(),
- _t = (function () {
- function e(t, r) {
- n(this, e),
- (this.c2ID = t.c2ID),
- (this.analytics = r),
- (this.comScoreBeaconParam = t.comScoreBeaconParam
- ? t.comScoreBeaconParam
- : {}),
- (this.isFirstPageCallMade = !1),
- (this.failed = !1),
- (this.comScoreParams = {}),
- (this.replayEvents = []),
- (this.name = "COMSCORE");
- }
- return (
- i(e, [
- {
- key: "init",
- value() {
- p("===in init Comscore init===");
- },
- },
- {
- key: "identify",
- value(e) {
- p("in Comscore identify");
- },
- },
- {
- key: "track",
- value(e) {
- p("in Comscore track");
- },
- },
- {
- key: "page",
- value(e) {
- if (
- (p("in Comscore page"),
- this.loadConfig(e),
- this.isFirstPageCallMade)
- ) {
- if (this.failed) return void (this.replayEvents = []);
- if (!this.isLoaded() && !this.failed)
- return void this.replayEvents.push(["page", e]);
- e.message.properties;
- window.COMSCORE.beacon(this.comScoreParams);
- } else (this.isFirstPageCallMade = !0), this.initAfterPage();
- },
- },
- {
- key: "loadConfig",
- value(e) {
- p("=====in loadConfig====="),
- (this.comScoreParams = this.mapComscoreParams(
- e.message.properties
- )),
- (window._comscore = window._comscore || []),
- window._comscore.push(this.comScoreParams);
- },
- },
- {
- key: "initAfterPage",
- value() {
- p("=====in initAfterPage====="),
- (function () {
- const e = document.createElement("script");
- const t = document.getElementsByTagName("script")[0];
- (e.async = !0),
- (e.src = `${
- document.location.protocol == "https:"
- ? "https://sb"
- : "http://b"
- }.scorecardresearch.com/beacon.js`),
- t.parentNode.insertBefore(e, t);
- })(),
- this._isReady(this).then(function (e) {
- e.replayEvents.forEach(function (t) {
- e[t[0]](t[1]);
- });
- });
- },
- },
- {
- key: "pause",
- value(e) {
- return new Promise(function (t) {
- setTimeout(t, e);
- });
- },
- },
- {
- key: "_isReady",
- value(e) {
- const t = this;
- const n =
- arguments.length > 1 && void 0 !== arguments[1]
- ? arguments[1]
- : 0;
- return new Promise(function (r) {
- return t.isLoaded()
- ? ((t.failed = !1), e.analytics.emit("ready"), r(e))
- : n >= 1e4
- ? ((t.failed = !0), r(e))
- : void t.pause(1e3).then(function () {
- return t._isReady(e, n + 1e3).then(r);
- });
- });
- },
- },
- {
- key: "mapComscoreParams",
- value(e) {
- p("=====in mapComscoreParams=====");
- const t = this.comScoreBeaconParam;
- const n = {};
- return (
- Object.keys(t).forEach(function (r) {
- if ((r in e)) {
- const i = t[r];
- const o = e[r];
- n[i] = o;
- }
- }),
- (n.c1 = "2"),
- (n.c2 = this.c2ID),
- p("=====in mapComscoreParams=====", n),
- n
- );
- },
- },
- {
- key: "isLoaded",
- value() {
- return (
- p("in Comscore isLoaded"),
- !this.isFirstPageCallMade || !!window.COMSCORE
- );
- },
- },
- {
- key: "isReady",
- value() {
- return !!window.COMSCORE;
- },
- },
- ]),
- e
- );
- })(),
- Et = Object.prototype.hasOwnProperty,
- At = String.prototype.charAt,
- Ct = Object.prototype.toString,
- Tt = function (e, t) {
- return At.call(e, t);
- },
- Ot = function (e, t) {
- return Et.call(e, t);
- },
- St = function (e, t) {
- t = t || Ot;
- for (var n = [], r = 0, i = e.length; r < i; r += 1)
- t(e, r) && n.push(String(r));
- return n;
- },
- Pt = function (e) {
- return e == null
- ? []
- : ((t = e),
- Ct.call(t) === "[object String]"
- ? St(e, Tt)
- : (function (e) {
- return (
- e != null &&
- typeof e !== "function" &&
- typeof e.length === "number"
- );
- })(e)
- ? St(e, Ot)
- : (function (e, t) {
- t = t || Ot;
- const n = [];
- for (const r in e) t(e, r) && n.push(String(r));
- return n;
- })(e));
- let t;
- },
- xt = Object.prototype.toString,
- Rt =
- typeof Array.isArray === "function"
- ? Array.isArray
- : function (e) {
- return xt.call(e) === "[object Array]";
- },
- jt = function (e) {
- return (
- e != null &&
- (Rt(e) ||
- (e !== "function" &&
- (function (e) {
- const t = typeof e;
- return (
- t === "number" ||
- (t === "object" && xt.call(e) === "[object Number]")
- );
- })(e.length)))
- );
- },
- Dt = function (e, t) {
- for (let n = 0; n < t.length && !1 !== e(t[n], n, t); n += 1);
- },
- Ut = function (e, t) {
- for (
- let n = Pt(t), r = 0;
- r < n.length && !1 !== e(t[n[r]], n[r], t);
- r += 1
- );
- },
- Lt = function (e, t) {
- return (jt(t) ? Dt : Ut).call(this, e, t);
- },
- Mt = (function () {
- function e(t) {
- n(this, e),
- (this.blacklistPiiProperties = t.blacklistPiiProperties),
- (this.categoryToContent = t.categoryToContent),
- (this.pixelId = t.pixelId),
- (this.eventsToEvents = t.eventsToEvents),
- (this.eventCustomProperties = t.eventCustomProperties),
- (this.valueFieldIdentifier = t.valueFieldIdentifier),
- (this.advancedMapping = t.advancedMapping),
- (this.traitKeyToExternalId = t.traitKeyToExternalId),
- (this.legacyConversionPixelId = t.legacyConversionPixelId),
- (this.userIdAsPixelId = t.userIdAsPixelId),
- (this.whitelistPiiProperties = t.whitelistPiiProperties),
- (this.name = "FB_PIXEL");
- }
- return (
- i(e, [
- {
- key: "init",
- value() {
- void 0 === this.categoryToContent &&
- (this.categoryToContent = []),
- void 0 === this.legacyConversionPixelId &&
- (this.legacyConversionPixelId = []),
- void 0 === this.userIdAsPixelId &&
- (this.userIdAsPixelId = []),
- p("===in init FbPixel==="),
- (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.disablePushState = !0),
- (window.fbq.allowDuplicatePageViews = !0),
- (window.fbq.version = "2.0"),
- (window.fbq.queue = []),
- window.fbq("init", this.pixelId),
- T(
- "fbpixel-integration",
- "//connect.facebook.net/en_US/fbevents.js"
- );
- },
- },
- {
- key: "isLoaded",
- value() {
- return (
- p("in FBPixel isLoaded"),
- !(!window.fbq || !window.fbq.callMethod)
- );
- },
- },
- {
- key: "isReady",
- value() {
- return (
- p("in FBPixel isReady"),
- !(!window.fbq || !window.fbq.callMethod)
- );
- },
- },
- {
- key: "page",
- value(e) {
- window.fbq("track", "PageView");
- },
- },
- {
- key: "identify",
- value(e) {
- this.advancedMapping &&
- window.fbq("init", this.pixelId, e.message.context.traits);
- },
- },
- {
- key: "track",
- value(e) {
- const t = this;
- const n = this;
- const r = e.message.event;
- let i = this.formatRevenue(e.message.properties.revenue);
- const o = this.buildPayLoad(e, !0);
- void 0 === this.categoryToContent &&
- (this.categoryToContent = []),
- void 0 === this.legacyConversionPixelId &&
- (this.legacyConversionPixelId = []),
- void 0 === this.userIdAsPixelId &&
- (this.userIdAsPixelId = []),
- (o.value = i);
- let s;
- let a;
- const u = this.eventsToEvents;
- const c = this.legacyConversionPixelId;
- if (
- ((s = u.reduce(function (e, t) {
- return t.from === r && e.push(t.to), e;
- }, [])),
- (a = c.reduce(function (e, t) {
- return t.from === r && e.push(t.to), e;
- }, [])),
- Lt(function (t) {
- (o.currency = e.message.properties.currency || "USD"),
- window.fbq("trackSingle", n.pixelId, t, o, {
- eventID: e.message.messageId,
- });
- }, s),
- Lt(function (t) {
- window.fbq(
- "trackSingle",
- n.pixelId,
- t,
- { currency: e.message.properties.currency, value: i },
- { eventID: e.message.messageId }
- );
- }, a),
- r === "Product List Viewed")
- ) {
- var l = [];
- var d = e.message.properties.products;
- var p = this.buildPayLoad(e, !0);
- Array.isArray(d) &&
- d.forEach(function (t) {
- const n = t.product_id;
- n &&
- (g.push(n),
- l.push({
- id: n,
- quantity: e.message.properties.quantity,
- }));
- }),
- g.length
- ? (h = ["product"])
- : (g.push(e.message.properties.category || ""),
- l.push({
- id: e.message.properties.category || "",
- quantity: 1,
- }),
- (h = ["product_group"])),
- window.fbq(
- "trackSingle",
- n.pixelId,
- "ViewContent",
- this.merge(
- {
- content_ids: g,
- content_type: this.getContentType(e, h),
- contents: l,
- },
- p
- ),
- { eventID: e.message.messageId }
- ),
- Lt(function (r) {
- window.fbq(
- "trackSingle",
- n.pixelId,
- r,
- {
- currency: e.message.properties.currency,
- value: t.formatRevenue(e.message.properties.revenue),
- },
- { eventID: e.message.messageId }
- );
- }, a);
- } else if (r === "Product Viewed") {
- var f = this.valueFieldIdentifier === "properties.value";
- p = this.buildPayLoad(e, !0);
- window.fbq(
- "trackSingle",
- n.pixelId,
- "ViewContent",
- this.merge(
- {
- content_ids: [
- e.message.properties.product_id ||
- e.message.properties.id ||
- e.message.properties.sku ||
- "",
- ],
- content_type: this.getContentType(e, ["product"]),
- content_name: e.message.properties.product_name || "",
- content_category: e.message.properties.category || "",
- currency: e.message.properties.currency,
- value: f
- ? this.formatRevenue(e.message.properties.value)
- : this.formatRevenue(e.message.properties.price),
- contents: [
- {
- id:
- e.message.properties.product_id ||
- e.message.properties.id ||
- e.message.properties.sku ||
- "",
- quantity: e.message.properties.quantity,
- item_price: e.message.properties.price,
- },
- ],
- },
- p
- ),
- { eventID: e.message.messageId }
- ),
- Lt(function (r) {
- window.fbq(
- "trackSingle",
- n.pixelId,
- r,
- {
- currency: e.message.properties.currency,
- value: f
- ? t.formatRevenue(e.message.properties.value)
- : t.formatRevenue(e.message.properties.price),
- },
- { eventID: e.message.messageId }
- );
- }, a);
- } else if (r === "Product Added") {
- (f = this.valueFieldIdentifier === "properties.value"),
- (p = this.buildPayLoad(e, !0));
- window.fbq(
- "trackSingle",
- n.pixelId,
- "AddToCart",
- this.merge(
- {
- content_ids: [
- e.message.properties.product_id ||
- e.message.properties.id ||
- e.message.properties.sku ||
- "",
- ],
- content_type: this.getContentType(e, ["product"]),
- content_name: e.message.properties.product_name || "",
- content_category: e.message.properties.category || "",
- currency: e.message.properties.currency,
- value: f
- ? this.formatRevenue(e.message.properties.value)
- : this.formatRevenue(e.message.properties.price),
- contents: [
- {
- id:
- e.message.properties.product_id ||
- e.message.properties.id ||
- e.message.properties.sku ||
- "",
- quantity: e.message.properties.quantity,
- item_price: e.message.properties.price,
- },
- ],
- },
- p
- ),
- { eventID: e.message.messageId }
- ),
- Lt(function (r) {
- window.fbq(
- "trackSingle",
- n.pixelId,
- r,
- {
- currency: e.message.properties.currency,
- value: f
- ? t.formatRevenue(e.message.properties.value)
- : t.formatRevenue(e.message.properties.price),
- },
- { eventID: e.message.messageId }
- );
- }, a),
- this.merge(
- {
- content_ids: [
- e.message.properties.product_id ||
- e.message.properties.id ||
- e.message.properties.sku ||
- "",
- ],
- content_type: this.getContentType(e, ["product"]),
- content_name: e.message.properties.product_name || "",
- content_category: e.message.properties.category || "",
- currency: e.message.properties.currency,
- value: f
- ? this.formatRevenue(e.message.properties.value)
- : this.formatRevenue(e.message.properties.price),
- contents: [
- {
- id:
- e.message.properties.product_id ||
- e.message.properties.id ||
- e.message.properties.sku ||
- "",
- quantity: e.message.properties.quantity,
- item_price: e.message.properties.price,
- },
- ],
- },
- p
- );
- } else if (r === "Order Completed") {
- (d = e.message.properties.products),
- (p = this.buildPayLoad(e, !0)),
- (i = this.formatRevenue(e.message.properties.revenue));
- for (
- var h = this.getContentType(e, ["product"]),
- g = [],
- y = ((l = []), 0);
- y < d.length;
- y++
- ) {
- var m = product.product_id;
- g.push(m);
- var v = { id: m, quantity: e.message.properties.quantity };
- e.message.properties.price &&
- (v.item_price = e.message.properties.price),
- l.push(v);
- }
- window.fbq(
- "trackSingle",
- n.pixelId,
- "Purchase",
- this.merge(
- {
- content_ids: g,
- content_type: h,
- currency: e.message.properties.currency,
- value: i,
- contents: l,
- num_items: g.length,
- },
- p
- ),
- { eventID: e.message.messageId }
- ),
- Lt(function (r) {
- window.fbq(
- "trackSingle",
- n.pixelId,
- r,
- {
- currency: e.message.properties.currency,
- value: t.formatRevenue(e.message.properties.revenue),
- },
- { eventID: e.message.messageId }
- );
- }, a);
- } else if (r === "Products Searched") {
- p = this.buildPayLoad(e, !0);
- window.fbq(
- "trackSingle",
- n.pixelId,
- "Search",
- this.merge(
- { search_string: e.message.properties.query },
- p
- ),
- { eventID: e.message.messageId }
- ),
- Lt(function (t) {
- window.fbq(
- "trackSingle",
- n.pixelId,
- t,
- {
- currency: e.message.properties.currency,
- value: formatRevenue(e.message.properties.revenue),
- },
- { eventID: e.message.messageId }
- );
- }, a);
- } else if (r === "Checkout Started") {
- (d = e.message.properties.products),
- (p = this.buildPayLoad(e, !0)),
- (i = this.formatRevenue(e.message.properties.revenue));
- let b = e.message.properties.category;
- for (g = [], l = [], y = 0; y < d.length; y++) {
- m = d[y].product_id;
- g.push(m);
- v = {
- id: m,
- quantity: e.message.properties.quantity,
- item_price: e.message.properties.price,
- };
- e.message.properties.price &&
- (v.item_price = e.message.properties.price),
- l.push(v);
- }
- !b && d[0] && d[0].category && (b = d[0].category),
- window.fbq(
- "trackSingle",
- n.pixelId,
- "InitiateCheckout",
- this.merge(
- {
- content_category: b,
- content_ids: g,
- content_type: this.getContentType(e, ["product"]),
- currency: e.message.properties.currency,
- value: i,
- contents: l,
- num_items: g.length,
- },
- p
- ),
- { eventID: e.message.messageId }
- ),
- Lt(function (r) {
- window.fbq(
- "trackSingle",
- n.pixelId,
- r,
- {
- currency: e.message.properties.currency,
- value: t.formatRevenue(e.message.properties.revenue),
- },
- { eventID: e.message.messageId }
- );
- }, a);
- }
- },
- },
- {
- key: "getContentType",
- value(e, t) {
- const n = e.message.options;
- if (n && n.contentType) return [n.contentType];
- let r;
- let i = e.message.properties.category;
- if (!i) {
- const o = e.message.properties.products;
- o && o.length && (i = o[0].category);
- }
- if (
- i &&
- (r = this.categoryToContent.reduce(function (e, t) {
- return t.from == i && e.push(t.to), e;
- }, [])).length
- )
- return r;
- return t;
- },
- },
- {
- key: "merge",
- value(e, t) {
- const n = {};
- for (const r in e) e.hasOwnProperty(r) && (n[r] = e[r]);
- for (const i in t)
- t.hasOwnProperty(i) && !n.hasOwnProperty(i) && (n[i] = t[i]);
- return n;
- },
- },
- {
- key: "formatRevenue",
- value(e) {
- return Number(e || 0).toFixed(2);
- },
- },
- {
- key: "buildPayLoad",
- value(e, t) {
- for (
- var n = [
- "checkinDate",
- "checkoutDate",
- "departingArrivalDate",
- "departingDepartureDate",
- "returningArrivalDate",
- "returningDepartureDate",
- "travelEnd",
- "travelStart",
- ],
- r = [
- "email",
- "firstName",
- "lastName",
- "gender",
- "city",
- "country",
- "phone",
- "state",
- "zip",
- "birthday",
- ],
- i = this.whitelistPiiProperties || [],
- o = this.blacklistPiiProperties || [],
- s = this.eventCustomProperties || [],
- a = {},
- u = 0;
- u < o[u];
- u++
- ) {
- const c = o[u];
- a[c.blacklistPiiProperties] = c.blacklistPiiHash;
- }
- const l = {};
- const d = e.message.properties;
- for (const p in d)
- if (d.hasOwnProperty(p) && !(t && s.indexOf(p) < 0)) {
- const f = d[p];
- if (n.indexOf(d) >= 0 && et.date(f))
- l[p] = f.toISOTring().split("T")[0];
- else if (a.hasOwnProperty(p))
- a[p] && typeof f === "string" && (l[p] = sha256(f));
- else {
- const h = r.indexOf(p) >= 0;
- const g = i.indexOf(p) >= 0;
- (h && !g) || (l[p] = f);
- }
- }
- return l;
- },
- },
- ]),
- e
- );
- })(),
- Nt = "lt_synch_timestamp",
- Bt = new ((function () {
- function e() {
- n(this, e), (this.storage = Oe);
- }
- return (
- i(e, [
- {
- key: "setLotameSynchTime",
- value(e) {
- this.storage.setItem(Nt, e);
- },
- },
- {
- key: "getLotameSynchTime",
- value() {
- return this.storage.getItem(Nt);
- },
- },
- ]),
- e
- );
- })())(),
- qt = {
- HS: O,
- GA: Se,
- HOTJAR: Pe,
- GOOGLEADS: xe,
- VWO: Re,
- GTM: je,
- BRAZE: De,
- INTERCOM: Ge,
- KEEN: He,
- KISSMETRICS: yt,
- CUSTOMERIO: mt,
- CHARTBEAT: It,
- COMSCORE: _t,
- FACEBOOK_PIXEL: Mt,
- LOTAME: (function () {
- function e(t, r) {
- const i = this;
- n(this, e),
- (this.name = "LOTAME"),
- (this.analytics = r),
- (this.storage = Bt),
- (this.bcpUrlSettingsPixel = t.bcpUrlSettingsPixel),
- (this.bcpUrlSettingsIframe = t.bcpUrlSettingsIframe),
- (this.dspUrlSettingsPixel = t.dspUrlSettingsPixel),
- (this.dspUrlSettingsIframe = t.dspUrlSettingsIframe),
- (this.mappings = {}),
- t.mappings.forEach(function (e) {
- const t = e.key;
- const n = e.value;
- i.mappings[t] = n;
- });
- }
- return (
- i(e, [
- {
- key: "init",
- value() {
- p("===in init Lotame==="),
- (window.LOTAME_SYNCH_CALLBACK = function () {});
- },
- },
- {
- key: "addPixel",
- value(e, t, n) {
- p(`Adding pixel for :: ${e}`);
- const r = document.createElement("img");
- (r.src = e),
- r.setAttribute("width", t),
- r.setAttribute("height", n),
- p(`Image Pixel :: ${r}`),
- document.getElementsByTagName("body")[0].appendChild(r);
- },
- },
- {
- key: "addIFrame",
- value(e) {
- p(`Adding iframe for :: ${e}`);
- const t = document.createElement("iframe");
- (t.src = e),
- (t.title = "empty"),
- t.setAttribute("id", "LOTCCFrame"),
- t.setAttribute("tabindex", "-1"),
- t.setAttribute("role", "presentation"),
- t.setAttribute("aria-hidden", "true"),
- t.setAttribute(
- "style",
- "border: 0px; width: 0px; height: 0px; display: block;"
- ),
- p(`IFrame :: ${t}`),
- document.getElementsByTagName("body")[0].appendChild(t);
- },
- },
- {
- key: "syncPixel",
- value(e) {
- const t = this;
- if (
- (p("===== in syncPixel ======"),
- p("Firing DSP Pixel URLs"),
- this.dspUrlSettingsPixel &&
- this.dspUrlSettingsPixel.length > 0)
- ) {
- const n = Date.now();
- this.dspUrlSettingsPixel.forEach(function (r) {
- const i = t.compileUrl(
- a({}, t.mappings, { userId: e, random: n }),
- r.dspUrlTemplate
- );
- t.addPixel(i, "1", "1");
- });
- }
- if (
- (p("Firing DSP IFrame URLs"),
- this.dspUrlSettingsIframe &&
- this.dspUrlSettingsIframe.length > 0)
- ) {
- const r = Date.now();
- this.dspUrlSettingsIframe.forEach(function (n) {
- const i = t.compileUrl(
- a({}, t.mappings, { userId: e, random: r }),
- n.dspUrlTemplate
- );
- t.addIFrame(i);
- });
- }
- this.storage.setLotameSynchTime(Date.now()),
- this.analytics.methodToCallbackMapping.syncPixel &&
- this.analytics.emit("syncPixel", {
- destination: this.name,
- });
- },
- },
- {
- key: "compileUrl",
- value(e, t) {
- return (
- Object.keys(e).forEach(function (n) {
- if (e.hasOwnProperty(n)) {
- const r = new RegExp(`{{${n}}}`, "gi");
- t = t.replace(r, e[n]);
- }
- }),
- t
- );
- },
- },
- {
- key: "identify",
- value(e) {
- p("in Lotame identify");
- const t = e.message.userId;
- this.syncPixel(t);
- },
- },
- {
- key: "track",
- value(e) {
- p("track not supported for lotame");
- },
- },
- {
- key: "page",
- value(e) {
- const t = this;
- if (
- (p("in Lotame page"),
- p("Firing BCP Pixel URLs"),
- this.bcpUrlSettingsPixel &&
- this.bcpUrlSettingsPixel.length > 0)
- ) {
- const n = Date.now();
- this.bcpUrlSettingsPixel.forEach(function (e) {
- const r = t.compileUrl(
- a({}, t.mappings, { random: n }),
- e.bcpUrlTemplate
- );
- t.addPixel(r, "1", "1");
- });
- }
- if (
- (p("Firing BCP IFrame URLs"),
- this.bcpUrlSettingsIframe &&
- this.bcpUrlSettingsIframe.length > 0)
- ) {
- const r = Date.now();
- this.bcpUrlSettingsIframe.forEach(function (e) {
- const n = t.compileUrl(
- a({}, t.mappings, { random: r }),
- e.bcpUrlTemplate
- );
- t.addIFrame(n);
- });
- }
- e.message.userId &&
- this.isPixelToBeSynched() &&
- this.syncPixel(e.message.userId);
- },
- },
- {
- key: "isPixelToBeSynched",
- value() {
- const e = this.storage.getLotameSynchTime();
- const t = Date.now();
- return !e || Math.floor((t - e) / 864e5) >= 7;
- },
- },
- {
- key: "isLoaded",
- value() {
- return p("in Lotame isLoaded"), !0;
- },
- },
- {
- key: "isReady",
- value() {
- return !0;
- },
- },
- ]),
- e
- );
- })(),
- },
- Ft = function e() {
- n(this, e),
- (this.build = "1.0.0"),
- (this.name = "RudderLabs JavaScript SDK"),
- (this.namespace = "com.rudderlabs.javascript"),
- (this.version = "1.1.2");
- },
- Kt = function e() {
- n(this, e),
- (this.name = "RudderLabs JavaScript SDK"),
- (this.version = "1.1.2");
- },
- Gt = function e() {
- n(this, e), (this.name = ""), (this.version = "");
- },
- Ht = function e() {
- n(this, e), (this.density = 0), (this.width = 0), (this.height = 0);
- },
- Vt = function e() {
- n(this, e),
- (this.app = new Ft()),
- (this.traits = null),
- (this.library = new Kt());
- const t = new Gt();
- t.version = "";
- const r = new Ht();
- (r.width = window.width),
- (r.height = window.height),
- (r.density = window.devicePixelRatio),
- (this.userAgent = navigator.userAgent),
- (this.locale = navigator.language || navigator.browserLanguage),
- (this.os = t),
- (this.screen = r),
- (this.device = null),
- (this.network = null);
- },
- zt = (function () {
- function e() {
- n(this, e),
- (this.channel = "web"),
- (this.context = new Vt()),
- (this.type = null),
- (this.action = null),
- (this.messageId = m().toString()),
- (this.originalTimestamp = new Date().toISOString()),
- (this.anonymousId = null),
- (this.userId = null),
- (this.event = null),
- (this.properties = {}),
- (this.integrations = {}),
- (this.integrations.All = !0);
- }
- return (
- i(e, [
- {
- key: "getProperty",
- value(e) {
- return this.properties[e];
- },
- },
- {
- key: "addProperty",
- value(e, t) {
- this.properties[e] = t;
- },
- },
- {
- key: "validateFor",
- value(e) {
- if (!this.properties)
- throw new Error("Key properties is required");
- switch (e) {
- case A.TRACK:
- if (!this.event)
- throw new Error("Key event is required for track event");
- if ((this.event in Object.values(C)))
- switch (this.event) {
- case C.CHECKOUT_STEP_VIEWED:
- case C.CHECKOUT_STEP_COMPLETED:
- case C.PAYMENT_INFO_ENTERED:
- this.checkForKey("checkout_id"),
- this.checkForKey("step");
- break;
- case C.PROMOTION_VIEWED:
- case C.PROMOTION_CLICKED:
- this.checkForKey("promotion_id");
- break;
- case C.ORDER_REFUNDED:
- this.checkForKey("order_id");
- }
- else
- this.properties.category ||
- (this.properties.category = this.event);
- break;
- case A.PAGE:
- break;
- case A.SCREEN:
- if (!this.properties.name)
- throw new Error("Key 'name' is required in properties");
- }
- },
- },
- {
- key: "checkForKey",
- value(e) {
- if (!this.properties[e])
- throw new Error(`Key '${e}' is required in properties`);
- },
- },
- ]),
- e
- );
- })(),
- Jt = (function () {
- function e() {
- n(this, e), (this.message = new zt());
- }
- return (
- i(e, [
- {
- key: "setType",
- value(e) {
- this.message.type = e;
- },
- },
- {
- key: "setProperty",
- value(e) {
- this.message.properties = e;
- },
- },
- {
- key: "setUserProperty",
- value(e) {
- this.message.user_properties = e;
- },
- },
- {
- key: "setUserId",
- value(e) {
- this.message.userId = e;
- },
- },
- {
- key: "setEventName",
- value(e) {
- this.message.event = e;
- },
- },
- {
- key: "updateTraits",
- value(e) {
- this.message.context.traits = e;
- },
- },
- {
- key: "getElementContent",
- value() {
- return this.message;
- },
- },
- ]),
- e
- );
- })(),
- Wt = (function () {
- function e() {
- n(this, e),
- (this.rudderProperty = null),
- (this.rudderUserProperty = null),
- (this.event = null),
- (this.userId = null),
- (this.channel = null),
- (this.type = null);
- }
- return (
- i(e, [
- {
- key: "setProperty",
- value(e) {
- return (this.rudderProperty = e), this;
- },
- },
- {
- key: "setPropertyBuilder",
- value(e) {
- return (this.rudderProperty = e.build()), this;
- },
- },
- {
- key: "setUserProperty",
- value(e) {
- return (this.rudderUserProperty = e), this;
- },
- },
- {
- key: "setUserPropertyBuilder",
- value(e) {
- return (this.rudderUserProperty = e.build()), this;
- },
- },
- {
- key: "setEvent",
- value(e) {
- return (this.event = e), this;
- },
- },
- {
- key: "setUserId",
- value(e) {
- return (this.userId = e), this;
- },
- },
- {
- key: "setChannel",
- value(e) {
- return (this.channel = e), this;
- },
- },
- {
- key: "setType",
- value(e) {
- return (this.type = e), this;
- },
- },
- {
- key: "build",
- value() {
- const e = new Jt();
- return (
- e.setUserId(this.userId),
- e.setType(this.type),
- e.setEventName(this.event),
- e.setProperty(this.rudderProperty),
- e.setUserProperty(this.rudderUserProperty),
- e
- );
- },
- },
- ]),
- e
- );
- })(),
- $t = function e() {
- n(this, e), (this.batch = null), (this.writeKey = null);
- },
- Yt = R(function (e) {
- const t =
- (typeof crypto !== "undefined" &&
- crypto.getRandomValues &&
- crypto.getRandomValues.bind(crypto)) ||
- (typeof msCrypto !== "undefined" &&
- typeof window.msCrypto.getRandomValues === "function" &&
- msCrypto.getRandomValues.bind(msCrypto));
- if (t) {
- const n = new Uint8Array(16);
- e.exports = function () {
- return t(n), n;
- };
- } else {
- const r = new Array(16);
- e.exports = function () {
- for (var e, t = 0; t < 16; t++)
- (3 & t) == 0 && (e = 4294967296 * Math.random()),
- (r[t] = (e >>> ((3 & t) << 3)) & 255);
- return r;
- };
- }
- }),
- Qt = [],
- Zt = 0;
- Zt < 256;
- ++Zt
- )
- Qt[Zt] = (Zt + 256).toString(16).substr(1);
- let Xt;
- let en;
- const tn = function (e, t) {
- let n = t || 0;
- const r = Qt;
- return [
- r[e[n++]],
- r[e[n++]],
- r[e[n++]],
- r[e[n++]],
- "-",
- r[e[n++]],
- r[e[n++]],
- "-",
- r[e[n++]],
- r[e[n++]],
- "-",
- r[e[n++]],
- r[e[n++]],
- "-",
- r[e[n++]],
- r[e[n++]],
- r[e[n++]],
- r[e[n++]],
- r[e[n++]],
- r[e[n++]],
- ].join("");
- };
- let nn = 0;
- let rn = 0;
- const on = function (e, t, n) {
- let r = (t && n) || 0;
- const i = t || [];
- let o = (e = e || {}).node || Xt;
- let s = void 0 !== e.clockseq ? e.clockseq : en;
- if (o == null || s == null) {
- const a = Yt();
- o == null && (o = Xt = [1 | a[0], a[1], a[2], a[3], a[4], a[5]]),
- s == null && (s = en = 16383 & ((a[6] << 8) | a[7]));
- }
- let u = void 0 !== e.msecs ? e.msecs : new Date().getTime();
- let c = void 0 !== e.nsecs ? e.nsecs : rn + 1;
- const l = u - nn + (c - rn) / 1e4;
- if (
- (l < 0 && void 0 === e.clockseq && (s = (s + 1) & 16383),
- (l < 0 || u > nn) && void 0 === e.nsecs && (c = 0),
- c >= 1e4)
- )
- throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");
- (nn = u), (rn = c), (en = s);
- const d = (1e4 * (268435455 & (u += 122192928e5)) + c) % 4294967296;
- (i[r++] = (d >>> 24) & 255),
- (i[r++] = (d >>> 16) & 255),
- (i[r++] = (d >>> 8) & 255),
- (i[r++] = 255 & d);
- const p = ((u / 4294967296) * 1e4) & 268435455;
- (i[r++] = (p >>> 8) & 255),
- (i[r++] = 255 & p),
- (i[r++] = ((p >>> 24) & 15) | 16),
- (i[r++] = (p >>> 16) & 255),
- (i[r++] = (s >>> 8) | 128),
- (i[r++] = 255 & s);
- for (let f = 0; f < 6; ++f) i[r + f] = o[f];
- return t || tn(i);
- };
- const sn = function (e, t, n) {
- const r = (t && n) || 0;
- typeof e === "string" &&
- ((t = e === "binary" ? new Array(16) : null), (e = null));
- const i = (e = e || {}).random || (e.rng || Yt)();
- if (((i[6] = (15 & i[6]) | 64), (i[8] = (63 & i[8]) | 128), t))
- for (let o = 0; o < 16; ++o) t[r + o] = i[o];
- return t || tn(i);
- };
- const an = sn;
- (an.v1 = on), (an.v4 = sn);
- const un = an;
- const cn = un.v4;
- const ln = {
- _data: {},
- length: 0,
- setItem(e, t) {
- return (this._data[e] = t), (this.length = Pt(this._data).length), t;
- },
- getItem(e) {
- return e in this._data ? this._data[e] : null;
- },
- removeItem(e) {
- return (
- e in this._data && delete this._data[e],
- (this.length = Pt(this._data).length),
- null
- );
- },
- clear() {
- (this._data = {}), (this.length = 0);
- },
- key(e) {
- return Pt(this._data)[e];
- },
- };
- const dn = {
- defaultEngine: (function () {
- try {
- if (!window.localStorage) return !1;
- const e = cn();
- window.localStorage.setItem(e, "test_value");
- const t = window.localStorage.getItem(e);
- return window.localStorage.removeItem(e), t === "test_value";
- } catch (e) {
- return !1;
- }
- })()
- ? window.localStorage
- : ln,
- inMemoryEngine: ln,
- };
- const pn = dn.defaultEngine;
- const fn = dn.inMemoryEngine;
- function hn(e, t, n, r) {
- (this.id = t),
- (this.name = e),
- (this.keys = n || {}),
- (this.engine = r || pn);
- }
- (hn.prototype.set = function (e, t) {
- const n = this._createValidKey(e);
- if (n)
- try {
- this.engine.setItem(n, ue.stringify(t));
- } catch (n) {
- (function (e) {
- let t = !1;
- if (e.code)
- switch (e.code) {
- case 22:
- t = !0;
- break;
- case 1014:
- e.name === "NS_ERROR_DOM_QUOTA_REACHED" && (t = !0);
- }
- else e.number === -2147024882 && (t = !0);
- return t;
- })(n) && (this._swapEngine(), this.set(e, t));
- }
- }),
- (hn.prototype.get = function (e) {
- try {
- const t = this.engine.getItem(this._createValidKey(e));
- return t === null ? null : ue.parse(t);
- } catch (e) {
- return null;
- }
- }),
- (hn.prototype.remove = function (e) {
- this.engine.removeItem(this._createValidKey(e));
- }),
- (hn.prototype._createValidKey = function (e) {
- let t;
- const n = this.name;
- const r = this.id;
- return Pt(this.keys).length
- ? (Lt(function (i) {
- i === e && (t = [n, r, e].join("."));
- }, this.keys),
- t)
- : [n, r, e].join(".");
- }),
- (hn.prototype._swapEngine = function () {
- const e = this;
- Lt(function (t) {
- const n = e.get(t);
- fn.setItem([e.name, e.id, t].join("."), n), e.remove(t);
- }, this.keys),
- (this.engine = fn);
- });
- const gn = hn;
- const yn = {
- setTimeout(e, t) {
- return window.setTimeout(e, t);
- },
- clearTimeout(e) {
- return window.clearTimeout(e);
- },
- Date: window.Date,
- };
- let mn = yn;
- function vn() {
- (this.tasks = {}), (this.nextId = 1);
- }
- (vn.prototype.now = function () {
- return +new mn.Date();
- }),
- (vn.prototype.run = function (e, t) {
- const n = this.nextId++;
- return (this.tasks[n] = mn.setTimeout(this._handle(n, e), t)), n;
- }),
- (vn.prototype.cancel = function (e) {
- this.tasks[e] && (mn.clearTimeout(this.tasks[e]), delete this.tasks[e]);
- }),
- (vn.prototype.cancelAll = function () {
- Lt(mn.clearTimeout, this.tasks), (this.tasks = {});
- }),
- (vn.prototype._handle = function (e, t) {
- const n = this;
- return function () {
- return delete n.tasks[e], t();
- };
- }),
- (vn.setClock = function (e) {
- mn = e;
- }),
- (vn.resetClock = function () {
- mn = yn;
- });
- const bn = vn;
- const wn = kn;
- function kn(e) {
- return kn.enabled(e)
- ? function (t) {
- t = In(t);
- const n = new Date();
- const r = n - (kn[e] || n);
- (kn[e] = n),
- (t = `${e} ${t} +${kn.humanize(r)}`),
- window.console &&
- console.log &&
- Function.prototype.apply.call(console.log, console, arguments);
- }
- : function () {};
- }
- function In(e) {
- return e instanceof Error ? e.stack || e.message : e;
- }
- (kn.names = []),
- (kn.skips = []),
- (kn.enable = function (e) {
- try {
- localStorage.debug = e;
- } catch (e) {}
- for (let t = (e || "").split(/[\s,]+/), n = t.length, r = 0; r < n; r++)
- (e = t[r].replace("*", ".*?"))[0] === "-"
- ? kn.skips.push(new RegExp(`^${e.substr(1)}$`))
- : kn.names.push(new RegExp(`^${e}$`));
- }),
- (kn.disable = function () {
- kn.enable("");
- }),
- (kn.humanize = function (e) {
- return e >= 36e5
- ? `${(e / 36e5).toFixed(1)}h`
- : e >= 6e4
- ? `${(e / 6e4).toFixed(1)}m`
- : e >= 1e3
- ? `${(e / 1e3) | 0}s`
- : `${e}ms`;
- }),
- (kn.enabled = function (e) {
- for (var t = 0, n = kn.skips.length; t < n; t++)
- if (kn.skips[t].test(e)) return !1;
- for (t = 0, n = kn.names.length; t < n; t++)
- if (kn.names[t].test(e)) return !0;
- return !1;
- });
- try {
- window.localStorage && kn.enable(localStorage.debug);
- } catch (e) {}
- const _n = R(function (e) {
- function t(e) {
- if (e)
- return (function (e) {
- for (const n in t.prototype) e[n] = t.prototype[n];
- return e;
- })(e);
- }
- (e.exports = t),
- (t.prototype.on = t.prototype.addEventListener = function (e, t) {
- return (
- (this._callbacks = this._callbacks || {}),
- (this._callbacks[`$${e}`] = this._callbacks[`$${e}`] || []).push(t),
- this
- );
- }),
- (t.prototype.once = function (e, t) {
- function n() {
- this.off(e, n), t.apply(this, arguments);
- }
- return (n.fn = t), this.on(e, n), this;
- }),
- (t.prototype.off = t.prototype.removeListener = t.prototype.removeAllListeners = t.prototype.removeEventListener = function (
- e,
- t
- ) {
- if (((this._callbacks = this._callbacks || {}), arguments.length == 0))
- return (this._callbacks = {}), this;
- let n;
- const r = this._callbacks[`$${e}`];
- if (!r) return this;
- if (arguments.length == 1) return delete this._callbacks[`$${e}`], this;
- for (let i = 0; i < r.length; i++)
- if ((n = r[i]) === t || n.fn === t) {
- r.splice(i, 1);
- break;
- }
- return r.length === 0 && delete this._callbacks[`$${e}`], this;
- }),
- (t.prototype.emit = function (e) {
- this._callbacks = this._callbacks || {};
- for (
- var t = new Array(arguments.length - 1),
- n = this._callbacks[`$${e}`],
- r = 1;
- r < arguments.length;
- r++
- )
- t[r - 1] = arguments[r];
- if (n) {
- r = 0;
- for (let i = (n = n.slice(0)).length; r < i; ++r) n[r].apply(this, t);
- }
- return this;
- }),
- (t.prototype.listeners = function (e) {
- return (
- (this._callbacks = this._callbacks || {}),
- this._callbacks[`$${e}`] || []
- );
- }),
- (t.prototype.hasListeners = function (e) {
- return !!this.listeners(e).length;
- });
- });
- const En = un.v4;
- const An = wn("localstorage-retry");
- function Cn(e, t) {
- return function () {
- return e.apply(t, arguments);
- };
- }
- function Tn(e, t, n) {
- typeof t === "function" && (n = t),
- (this.name = e),
- (this.id = En()),
- (this.fn = n),
- (this.maxItems = t.maxItems || 1 / 0),
- (this.maxAttempts = t.maxAttempts || 1 / 0),
- (this.backoff = {
- MIN_RETRY_DELAY: t.minRetryDelay || 1e3,
- MAX_RETRY_DELAY: t.maxRetryDelay || 3e4,
- FACTOR: t.backoffFactor || 2,
- JITTER: t.backoffJitter || 0,
- }),
- (this.timeouts = {
- ACK_TIMER: 1e3,
- RECLAIM_TIMER: 3e3,
- RECLAIM_TIMEOUT: 1e4,
- RECLAIM_WAIT: 500,
- }),
- (this.keys = {
- IN_PROGRESS: "inProgress",
- QUEUE: "queue",
- ACK: "ack",
- RECLAIM_START: "reclaimStart",
- RECLAIM_END: "reclaimEnd",
- }),
- (this._schedule = new bn()),
- (this._processId = 0),
- (this._store = new gn(this.name, this.id, this.keys)),
- this._store.set(this.keys.IN_PROGRESS, {}),
- this._store.set(this.keys.QUEUE, []),
- (this._ack = Cn(this._ack, this)),
- (this._checkReclaim = Cn(this._checkReclaim, this)),
- (this._processHead = Cn(this._processHead, this)),
- (this._running = !1);
- }
- _n(Tn.prototype),
- (Tn.prototype.start = function () {
- this._running && this.stop(),
- (this._running = !0),
- this._ack(),
- this._checkReclaim(),
- this._processHead();
- }),
- (Tn.prototype.stop = function () {
- this._schedule.cancelAll(), (this._running = !1);
- }),
- (Tn.prototype.shouldRetry = function (e, t) {
- return !(t > this.maxAttempts);
- }),
- (Tn.prototype.getDelay = function (e) {
- let t = this.backoff.MIN_RETRY_DELAY * Math.pow(this.backoff.FACTOR, e);
- if (this.backoff.JITTER) {
- const n = Math.random();
- const r = Math.floor(n * this.backoff.JITTER * t);
- Math.floor(10 * n) < 5 ? (t -= r) : (t += r);
- }
- return Number(Math.min(t, this.backoff.MAX_RETRY_DELAY).toPrecision(1));
- }),
- (Tn.prototype.addItem = function (e) {
- this._enqueue({ item: e, attemptNumber: 0, time: this._schedule.now() });
- }),
- (Tn.prototype.requeue = function (e, t, n) {
- this.shouldRetry(e, t, n)
- ? this._enqueue({
- item: e,
- attemptNumber: t,
- time: this._schedule.now() + this.getDelay(t),
- })
- : this.emit("discard", e, t);
- }),
- (Tn.prototype._enqueue = function (e) {
- let t = this._store.get(this.keys.QUEUE) || [];
- (t = t.slice(-(this.maxItems - 1))).push(e),
- (t = t.sort(function (e, t) {
- return e.time - t.time;
- })),
- this._store.set(this.keys.QUEUE, t),
- this._running && this._processHead();
- }),
- (Tn.prototype._processHead = function () {
- const e = this;
- const t = this._store;
- this._schedule.cancel(this._processId);
- let n = t.get(this.keys.QUEUE) || [];
- const r = t.get(this.keys.IN_PROGRESS) || {};
- const i = this._schedule.now();
- const o = [];
- function s(n, r) {
- o.push({
- item: n.item,
- done(i, o) {
- const s = t.get(e.keys.IN_PROGRESS) || {};
- delete s[r],
- t.set(e.keys.IN_PROGRESS, s),
- e.emit("processed", i, o, n.item),
- i && e.requeue(n.item, n.attemptNumber + 1, i);
- },
- });
- }
- for (
- let a = Object.keys(r).length;
- n.length && n[0].time <= i && a++ < e.maxItems;
-
- ) {
- const u = n.shift();
- const c = En();
- (r[c] = {
- item: u.item,
- attemptNumber: u.attemptNumber,
- time: e._schedule.now(),
- }),
- s(u, c);
- }
- t.set(this.keys.QUEUE, n),
- t.set(this.keys.IN_PROGRESS, r),
- Lt(function (t) {
- try {
- e.fn(t.item, t.done);
- } catch (e) {
- An(`Process function threw error: ${e}`);
- }
- }, o),
- (n = t.get(this.keys.QUEUE) || []),
- this._schedule.cancel(this._processId),
- n.length > 0 &&
- (this._processId = this._schedule.run(
- this._processHead,
- n[0].time - i
- ));
- }),
- (Tn.prototype._ack = function () {
- this._store.set(this.keys.ACK, this._schedule.now()),
- this._store.set(this.keys.RECLAIM_START, null),
- this._store.set(this.keys.RECLAIM_END, null),
- this._schedule.run(this._ack, this.timeouts.ACK_TIMER);
- }),
- (Tn.prototype._checkReclaim = function () {
- const e = this;
- Lt(
- function (t) {
- t.id !== e.id &&
- (e._schedule.now() - t.get(e.keys.ACK) <
- e.timeouts.RECLAIM_TIMEOUT ||
- (function (t) {
- t.set(e.keys.RECLAIM_START, e.id),
- t.set(e.keys.ACK, e._schedule.now()),
- e._schedule.run(function () {
- t.get(e.keys.RECLAIM_START) === e.id &&
- (t.set(e.keys.RECLAIM_END, e.id),
- e._schedule.run(function () {
- t.get(e.keys.RECLAIM_END) === e.id &&
- t.get(e.keys.RECLAIM_START) === e.id &&
- e._reclaim(t.id);
- }, e.timeouts.RECLAIM_WAIT));
- }, e.timeouts.RECLAIM_WAIT);
- })(t));
- },
- (function (t) {
- for (var n = [], r = e._store.engine, i = 0; i < r.length; i++) {
- const o = r.key(i).split(".");
- o.length === 3 &&
- o[0] === t &&
- o[2] === "ack" &&
- n.push(new gn(t, o[1], e.keys));
- }
- return n;
- })(this.name)
- ),
- this._schedule.run(this._checkReclaim, this.timeouts.RECLAIM_TIMER);
- }),
- (Tn.prototype._reclaim = function (e) {
- const t = this;
- const n = new gn(this.name, e, this.keys);
- const r = { queue: this._store.get(this.keys.QUEUE) || [] };
- const i = {
- inProgress: n.get(this.keys.IN_PROGRESS) || {},
- queue: n.get(this.keys.QUEUE) || [],
- };
- Lt(function (e) {
- r.queue.push({
- item: e.item,
- attemptNumber: e.attemptNumber,
- time: t._schedule.now(),
- });
- }, i.queue),
- Lt(function (e) {
- r.queue.push({
- item: e.item,
- attemptNumber: e.attemptNumber + 1,
- time: t._schedule.now(),
- });
- }, i.inProgress),
- (r.queue = r.queue.sort(function (e, t) {
- return e.time - t.time;
- })),
- this._store.set(this.keys.QUEUE, r.queue),
- n.remove(this.keys.ACK),
- n.remove(this.keys.RECLAIM_START),
- n.remove(this.keys.RECLAIM_END),
- n.remove(this.keys.IN_PROGRESS),
- n.remove(this.keys.QUEUE),
- this._processHead();
- });
- const On = Tn;
- const Sn = {
- maxRetryDelay: 36e4,
- minRetryDelay: 1e3,
- backoffFactor: 2,
- maxAttempts: 10,
- maxItems: 100,
- };
- var Pn = new ((function () {
- function e() {
- n(this, e),
- (this.eventsBuffer = []),
- (this.writeKey = ""),
- (this.url = "https://hosted.rudderlabs.com"),
- (this.state = "READY"),
- (this.batchSize = 0),
- (this.payloadQueue = new On("rudder", Sn, function (e, t) {
- (e.message.sentAt = v()),
- Pn.processQueueElement(e.url, e.headers, e.message, 1e4, function (
- e,
- n
- ) {
- if (e) return t(e);
- t(null, n);
- });
- })),
- this.payloadQueue.start();
- }
- return (
- i(e, [
- {
- key: "preaparePayloadAndFlush",
- value(e) {
- if (
- (p(`==== in preaparePayloadAndFlush with state: ${e.state}`),
- p(e.eventsBuffer),
- e.eventsBuffer.length != 0 && e.state !== "PROCESSING")
- ) {
- const t = e.eventsBuffer;
- const n = new $t();
- (n.batch = t),
- (n.writeKey = e.writeKey),
- (n.sentAt = v()),
- n.batch.forEach(function (e) {
- e.sentAt = n.sentAt;
- }),
- (e.batchSize = e.eventsBuffer.length);
- const r = new XMLHttpRequest();
- p("==== in flush sending to Rudder BE ===="),
- p(JSON.stringify(n, y)),
- r.open("POST", e.url, !0),
- r.setRequestHeader("Content-Type", "application/json"),
- r.setRequestHeader(
- "Authorization",
- `Basic ${btoa(`${n.writeKey}:`)}`
- ),
- (r.onreadystatechange = function () {
- r.readyState === 4 && r.status === 200
- ? (p(`====== request processed successfully: ${r.status}`),
- (e.eventsBuffer = e.eventsBuffer.slice(e.batchSize)),
- p(e.eventsBuffer.length))
- : r.readyState === 4 &&
- r.status !== 200 &&
- b(
- new Error(
- `request failed with status: ${r.status} for url: ${e.url}`
- )
- ),
- (e.state = "READY");
- }),
- r.send(JSON.stringify(n, y)),
- (e.state = "PROCESSING");
- }
- },
- },
- {
- key: "processQueueElement",
- value(e, t, n, r, i) {
- try {
- const o = new XMLHttpRequest();
- for (const s in (o.open("POST", e, !0), t))
- o.setRequestHeader(s, t[s]);
- (o.timeout = r),
- (o.ontimeout = i),
- (o.onerror = i),
- (o.onreadystatechange = function () {
- o.readyState === 4 &&
- (o.status === 429 || (o.status >= 500 && o.status < 600)
- ? (b(
- new Error(
- `request failed with status: ${o.status}${o.statusText} for url: ${e}`
- )
- ),
- i(
- new Error(
- `request failed with status: ${o.status}${o.statusText} for url: ${e}`
- )
- ))
- : (p(
- `====== request processed successfully: ${o.status}`
- ),
- i(null, o.status)));
- }),
- o.send(JSON.stringify(n, y));
- } catch (e) {
- i(e);
- }
- },
- },
- {
- key: "enqueue",
- value(e, t) {
- const n = e.getElementContent();
- const r = {
- "Content-Type": "application/json",
- Authorization: `Basic ${btoa(`${this.writeKey}:`)}`,
- AnonymousId: btoa(n.anonymousId),
- };
- (n.originalTimestamp = v()),
- (n.sentAt = v()),
- JSON.stringify(n).length > 32e3 &&
- f(
- "[EventRepository] enqueue:: message length greater 32 Kb ",
- n
- );
- const i =
- this.url.slice(-1) == "/" ? this.url.slice(0, -1) : this.url;
- this.payloadQueue.addItem({
- url: `${i}/v1/${t}`,
- headers: r,
- message: n,
- });
- },
- },
- ]),
- e
- );
- })())();
- function xn(e) {
- const t = function (t) {
- let n = (t = t || window.event).target || t.srcElement;
- Ln(n) && (n = n.parentNode),
- jn(n, t)
- ? p("to be tracked ", t.type)
- : p("not to be tracked ", t.type),
- (function (e, t) {
- let n = e.target || e.srcElement;
- let r = void 0;
- Ln(n) && (n = n.parentNode);
- if (jn(n, e)) {
- if (n.tagName.toLowerCase() == "form") {
- r = {};
- for (let i = 0; i < n.elements.length; i++) {
- const o = n.elements[i];
- if (Bn(o) && Nn(o, t.trackValues)) {
- const s = o.id ? o.id : o.name;
- if (s && typeof s === "string") {
- const a = o.id ? o.id : o.name;
- let u = o.id
- ? document.getElementById(o.id).value
- : document.getElementsByName(o.name)[0].value;
- (o.type !== "checkbox" && o.type !== "radio") ||
- (u = o.checked),
- a.trim() !== "" &&
- (r[encodeURIComponent(a)] = encodeURIComponent(u));
- }
- }
- }
- }
- for (var c = [n], l = n; l.parentNode && !Dn(l, "body"); )
- c.push(l.parentNode), (l = l.parentNode);
- let d;
- const f = [];
- let h = !1;
- if (
- (c.forEach(function (e) {
- const n = (function (e) {
- return !(!e.parentNode || Dn(e, "body"));
- })(e);
- e.tagName.toLowerCase() === "a" &&
- ((d = e.getAttribute("href")), (d = n && d)),
- (h = h || !Bn(e)),
- f.push(
- (function (e, t) {
- for (
- var n = {
- classes: Mn(e).split(" "),
- tag_name: e.tagName.toLowerCase(),
- },
- r = e.attributes.length,
- i = 0;
- i < r;
- i++
- ) {
- const o = e.attributes[i].name;
- const s = e.attributes[i].value;
- s && (n[`attr__${o}`] = s),
- (o != "name" && o != "id") ||
- !Nn(e, t.trackValues) ||
- ((n.field_value =
- o == "id"
- ? document.getElementById(s).value
- : document.getElementsByName(s)[0].value),
- (e.type !== "checkbox" && e.type !== "radio") ||
- (n.field_value = e.checked));
- }
- let a = 1;
- let u = 1;
- let c = e;
- for (; (c = qn(c)); ) a++, c.tagName === e.tagName && u++;
- return (n.nth_child = a), (n.nth_of_type = u), n;
- })(e, t)
- );
- }),
- h)
- )
- return !1;
- let g = "";
- const y = (function (e) {
- let t = "";
- return (
- e.childNodes.forEach(function (e) {
- e.nodeType === Node.TEXT_NODE && (t += e.nodeValue);
- }),
- t.trim()
- );
- })(n);
- y && y.length && (g = y);
- const m = {
- event_type: e.type,
- page: w(),
- elements: f,
- el_attr_href: d,
- el_text: g,
- };
- r && (m.form_values = r),
- p("web_event", m),
- t.track("autotrack", m);
- }
- })(t, e);
- };
- Rn(document, "submit", t, !0),
- Rn(document, "change", t, !0),
- Rn(document, "click", t, !0),
- e.page();
- }
- function Rn(e, t, n, r) {
- e
- ? e.addEventListener(t, n, !!r)
- : f(
- "[Autotrack] register_event:: No valid element provided to register_event"
- );
- }
- function jn(e, t) {
- if (!e || Dn(e, "html") || !Un(e)) return !1;
- switch (e.tagName.toLowerCase()) {
- case "html":
- return !1;
- case "form":
- return t.type === "submit";
- case "input":
- return ["button", "submit"].indexOf(e.getAttribute("type")) === -1
- ? t.type === "change"
- : t.type === "click";
- case "select":
- case "textarea":
- return t.type === "change";
- default:
- return t.type === "click";
- }
- }
- function Dn(e, t) {
- return e && e.tagName && e.tagName.toLowerCase() === t.toLowerCase();
- }
- function Un(e) {
- return e && e.nodeType === 1;
- }
- function Ln(e) {
- return e && e.nodeType === 3;
- }
- function Mn(e) {
- switch (t(e.className)) {
- case "string":
- return e.className;
- case "object":
- return e.className.baseVal || e.getAttribute("class") || "";
- default:
- return "";
- }
- }
- function Nn(e, t) {
- for (let n = e.attributes.length, r = 0; r < n; r++) {
- const i = e.attributes[r].value;
- if (t.indexOf(i) > -1) return !0;
- }
- return !1;
- }
- function Bn(e) {
- return !(Mn(e).split(" ").indexOf("rudder-no-track") >= 0);
- }
- function qn(e) {
- if (e.previousElementSibling) return e.previousElementSibling;
- do {
- e = e.previousSibling;
- } while (e && !Un(e));
- return e;
- }
- const Fn = function (e, t, n) {
- let r = !1;
- return (n = n || Kn), (i.count = e), e === 0 ? t() : i;
- function i(e, o) {
- if (i.count <= 0) throw new Error("after called too many times");
- --i.count,
- e ? ((r = !0), t(e), (t = n)) : i.count !== 0 || r || t(null, o);
- }
- };
- function Kn() {}
- function Gn(e, t) {
- this.eventRepository || (this.eventRepository = Pn),
- this.eventRepository.enqueue(e, t);
- }
- var Hn = new ((function () {
- function e() {
- n(this, e),
- (this.autoTrackHandlersRegistered = !1),
- (this.autoTrackFeatureEnabled = !1),
- (this.initialized = !1),
- (this.trackValues = []),
- (this.eventsBuffer = []),
- (this.clientIntegrations = []),
- (this.loadOnlyIntegrations = {}),
- (this.clientIntegrationObjects = void 0),
- (this.successfullyLoadedIntegration = []),
- (this.failedToBeLoadedIntegration = []),
- (this.toBeProcessedArray = []),
- (this.toBeProcessedByIntegrationArray = []),
- (this.storage = Oe),
- (this.userId =
- this.storage.getUserId() != null ? this.storage.getUserId() : ""),
- (this.userTraits =
- this.storage.getUserTraits() != null
- ? this.storage.getUserTraits()
- : {}),
- (this.groupId =
- this.storage.getGroupId() != null ? this.storage.getGroupId() : ""),
- (this.groupTraits =
- this.storage.getGroupTraits() != null
- ? this.storage.getGroupTraits()
- : {}),
- (this.anonymousId = this.getAnonymousId()),
- this.storage.setUserId(this.userId),
- (this.eventRepository = Pn),
- (this.sendAdblockPage = !1),
- (this.sendAdblockPageOptions = {}),
- (this.clientSuppliedCallbacks = {}),
- (this.readyCallback = function () {}),
- (this.executeReadyCallback = void 0),
- (this.methodToCallbackMapping = { syncPixel: "syncPixelCallback" });
- }
- return (
- i(e, [
- {
- key: "processResponse",
- value(e, t) {
- try {
- p(`===in process response=== ${e}`),
- (t = JSON.parse(t)).source.useAutoTracking &&
- !this.autoTrackHandlersRegistered &&
- ((this.autoTrackFeatureEnabled = !0),
- xn(this),
- (this.autoTrackHandlersRegistered = !0)),
- t.source.destinations.forEach(function (e, t) {
- p(
- `Destination ${t} Enabled? ${e.enabled} Type: ${e.destinationDefinition.name} Use Native SDK? ${e.config.useNativeSDK}`
- ),
- e.enabled &&
- this.clientIntegrations.push({
- name: e.destinationDefinition.name,
- config: e.config,
- });
- }, this),
- (this.clientIntegrations = E(
- this.loadOnlyIntegrations,
- this.clientIntegrations
- )),
- (this.clientIntegrations = this.clientIntegrations.filter(
- function (e) {
- return qt[e.name] != null;
- }
- )),
- this.init(this.clientIntegrations);
- } catch (e) {
- b(e),
- p("===handling config BE response processing error==="),
- p(
- "autoTrackHandlersRegistered",
- this.autoTrackHandlersRegistered
- ),
- this.autoTrackFeatureEnabled &&
- !this.autoTrackHandlersRegistered &&
- (xn(this), (this.autoTrackHandlersRegistered = !0));
- }
- },
- },
- {
- key: "init",
- value(e) {
- const t = this;
- const n = this;
- if ((p("supported intgs ", qt), !e || e.length == 0))
- return (
- this.readyCallback && this.readyCallback(),
- void (this.toBeProcessedByIntegrationArray = [])
- );
- e.forEach(function (e) {
- try {
- p(
- "[Analytics] init :: trying to initialize integration name:: ",
- e.name
- );
- const r = new (0, qt[e.name])(e.config, n);
- r.init(),
- p("initializing destination: ", e),
- t.isInitialized(r).then(t.replayEvents);
- } catch (t) {
- f(
- "[Analytics] initialize integration (integration.init()) failed :: ",
- e.name
- );
- }
- });
- },
- },
- {
- key: "replayEvents",
- value(e) {
- e.successfullyLoadedIntegration.length +
- e.failedToBeLoadedIntegration.length ==
- e.clientIntegrations.length &&
- e.toBeProcessedByIntegrationArray.length > 0 &&
- (p(
- "===replay events called====",
- e.successfullyLoadedIntegration.length,
- e.failedToBeLoadedIntegration.length
- ),
- (e.clientIntegrationObjects = []),
- (e.clientIntegrationObjects = e.successfullyLoadedIntegration),
- p(
- "==registering after callback===",
- e.clientIntegrationObjects.length
- ),
- (e.executeReadyCallback = Fn(
- e.clientIntegrationObjects.length,
- e.readyCallback
- )),
- p("==registering ready callback==="),
- e.on("ready", e.executeReadyCallback),
- e.clientIntegrationObjects.forEach(function (t) {
- p("===looping over each successful integration===="),
- (t.isReady && !t.isReady()) ||
- (p("===letting know I am ready=====", t.name),
- e.emit("ready"));
- }),
- e.toBeProcessedByIntegrationArray.forEach(function (t) {
- const n = t[0];
- t.shift(),
- Object.keys(t[0].message.integrations).length > 0 &&
- _(t[0].message.integrations);
- for (
- let r = E(
- t[0].message.integrations,
- e.clientIntegrationObjects
- ),
- i = 0;
- i < r.length;
- i++
- )
- try {
- var o;
- if (!r[i].isFailed || !r[i].isFailed())
- if (r[i][n]) (o = r[i])[n].apply(o, u(t));
- } catch (e) {
- b(e);
- }
- }),
- (e.toBeProcessedByIntegrationArray = []));
- },
- },
- {
- key: "pause",
- value(e) {
- return new Promise(function (t) {
- setTimeout(t, e);
- });
- },
- },
- {
- key: "isInitialized",
- value(e) {
- const t = this;
- const n =
- arguments.length > 1 && void 0 !== arguments[1]
- ? arguments[1]
- : 0;
- return new Promise(function (r) {
- return e.isLoaded()
- ? (p("===integration loaded successfully====", e.name),
- t.successfullyLoadedIntegration.push(e),
- r(t))
- : n >= 1e4
- ? (p("====max wait over===="),
- t.failedToBeLoadedIntegration.push(e),
- r(t))
- : void t.pause(1e3).then(function () {
- return (
- p("====after pause, again checking===="),
- t.isInitialized(e, n + 1e3).then(r)
- );
- });
- });
- },
- },
- {
- key: "page",
- value(e, n, r, i, o) {
- typeof i === "function" && ((o = i), (i = null)),
- typeof r === "function" && ((o = r), (i = r = null)),
- typeof n === "function" && ((o = n), (i = r = n = null)),
- t(e) === "object" && ((i = n), (r = e), (n = e = null)),
- t(n) === "object" && ((i = r), (r = n), (n = null)),
- typeof e === "string" &&
- typeof n !== "string" &&
- ((n = e), (e = null)),
- this.sendAdblockPage &&
- e != "RudderJS-Initiated" &&
- this.sendSampleRequest(),
- this.processPage(e, n, r, i, o);
- },
- },
- {
- key: "track",
- value(e, t, n, r) {
- typeof n === "function" && ((r = n), (n = null)),
- typeof t === "function" && ((r = t), (n = null), (t = null)),
- this.processTrack(e, t, n, r);
- },
- },
- {
- key: "identify",
- value(e, n, r, i) {
- typeof r === "function" && ((i = r), (r = null)),
- typeof n === "function" && ((i = n), (r = null), (n = null)),
- t(e) == "object" && ((r = n), (n = e), (e = this.userId)),
- this.processIdentify(e, n, r, i);
- },
- },
- {
- key: "alias",
- value(e, n, r, i) {
- typeof r === "function" && ((i = r), (r = null)),
- typeof n === "function" && ((i = n), (r = null), (n = null)),
- t(n) == "object" && ((r = n), (n = null));
- const o = new Wt().setType("alias").build();
- (o.message.previousId =
- n || (this.userId ? this.userId : this.getAnonymousId())),
- (o.message.userId = e),
- this.processAndSendDataToDestinations("alias", o, r, i);
- },
- },
- {
- key: "group",
- value(e, n, r, i) {
- if (arguments.length) {
- typeof r === "function" && ((i = r), (r = null)),
- typeof n === "function" && ((i = n), (r = null), (n = null)),
- t(e) == "object" && ((r = n), (n = e), (e = this.groupId)),
- (this.groupId = e),
- this.storage.setGroupId(this.groupId);
- const o = new Wt().setType("group").build();
- if (n) for (const s in n) this.groupTraits[s] = n[s];
- else this.groupTraits = {};
- this.storage.setGroupTraits(this.groupTraits),
- this.processAndSendDataToDestinations("group", o, r, i);
- }
- },
- },
- {
- key: "processPage",
- value(e, t, n, r, i) {
- const o = new Wt().setType("page").build();
- t && (o.message.name = t),
- n || (n = {}),
- e && (n.category = e),
- n && (o.message.properties = this.getPageProperties(n)),
- this.trackPage(o, r, i);
- },
- },
- {
- key: "processTrack",
- value(e, t, n, r) {
- const i = new Wt().setType("track").build();
- e && i.setEventName(e),
- t ? i.setProperty(t) : i.setProperty({}),
- this.trackEvent(i, n, r);
- },
- },
- {
- key: "processIdentify",
- value(e, t, n, r) {
- e && this.userId && e !== this.userId && this.reset(),
- (this.userId = e),
- this.storage.setUserId(this.userId);
- const i = new Wt().setType("identify").build();
- if (t) {
- for (const o in t) this.userTraits[o] = t[o];
- this.storage.setUserTraits(this.userTraits);
- }
- this.identifyUser(i, n, r);
- },
- },
- {
- key: "identifyUser",
- value(e, t, n) {
- e.message.userId &&
- ((this.userId = e.message.userId),
- this.storage.setUserId(this.userId)),
- e &&
- e.message &&
- e.message.context &&
- e.message.context.traits &&
- ((this.userTraits = {
- ...e.message.context.traits,
- }),
- this.storage.setUserTraits(this.userTraits)),
- this.processAndSendDataToDestinations("identify", e, t, n);
- },
- },
- {
- key: "trackPage",
- value(e, t, n) {
- this.processAndSendDataToDestinations("page", e, t, n);
- },
- },
- {
- key: "trackEvent",
- value(e, t, n) {
- this.processAndSendDataToDestinations("track", e, t, n);
- },
- },
- {
- key: "processAndSendDataToDestinations",
- value(e, t, n, r) {
- try {
- this.anonymousId || this.setAnonymousId(),
- (t.message.context.page = w()),
- (t.message.context.traits = { ...this.userTraits }),
- p("anonymousId: ", this.anonymousId),
- (t.message.anonymousId = this.anonymousId),
- (t.message.userId = t.message.userId
- ? t.message.userId
- : this.userId),
- e == "group" &&
- (this.groupId && (t.message.groupId = this.groupId),
- this.groupTraits &&
- (t.message.traits = { ...this.groupTraits })),
- n && this.processOptionsParam(t, n),
- p(JSON.stringify(t)),
- Object.keys(t.message.integrations).length > 0 &&
- _(t.message.integrations),
- E(
- t.message.integrations,
- this.clientIntegrationObjects
- ).forEach(function (n) {
- (n.isFailed && n.isFailed()) || (n[e] && n[e](t));
- }),
- this.clientIntegrationObjects ||
- (p("pushing in replay queue"),
- this.toBeProcessedByIntegrationArray.push([e, t])),
- (i = t.message.integrations),
- Object.keys(i).forEach(function (e) {
- i.hasOwnProperty(e) &&
- (g[e] && (i[g[e]] = i[e]),
- e != "All" && g[e] != null && g[e] != e && delete i[e]);
- }),
- Gn.call(this, t, e),
- p(`${e} is called `),
- r && r();
- } catch (e) {
- b(e);
- }
- let i;
- },
- },
- {
- key: "processOptionsParam",
- value(e, t) {
- const n = ["integrations", "anonymousId", "originalTimestamp"];
- for (const r in t)
- if (n.includes(r)) e.message[r] = t[r];
- else if (r !== "context") e.message.context[r] = t[r];
- else for (const i in t[r]) e.message.context[i] = t[r][i];
- },
- },
- {
- key: "getPageProperties",
- value(e) {
- const t = w();
- for (const n in t) void 0 === e[n] && (e[n] = t[n]);
- return e;
- },
- },
- {
- key: "reset",
- value() {
- (this.userId = ""), (this.userTraits = {}), this.storage.clear();
- },
- },
- {
- key: "getAnonymousId",
- value() {
- return (
- (this.anonymousId = this.storage.getAnonymousId()),
- this.anonymousId || this.setAnonymousId(),
- this.anonymousId
- );
- },
- },
- {
- key: "setAnonymousId",
- value(e) {
- (this.anonymousId = e || m()),
- this.storage.setAnonymousId(this.anonymousId);
- },
- },
- {
- key: "load",
- value(e, n, r) {
- const i = this;
- p("inside load ");
- let o = "https://api.rudderlabs.com/sourceConfig/?p=web&v=1.1.2";
- if (!e || !n || n.length == 0)
- throw (
- (b({
- message:
- "[Analytics] load:: Unable to load due to wrong writeKey or serverUrl",
- }),
- Error("failed to initialize"))
- );
- if (
- (r && r.logLevel && d(r.logLevel),
- r &&
- r.integrations &&
- (Object.assign(this.loadOnlyIntegrations, r.integrations),
- _(this.loadOnlyIntegrations)),
- r && r.configUrl && (o = r.configUrl),
- r && r.sendAdblockPage && (this.sendAdblockPage = !0),
- r &&
- r.sendAdblockPageOptions &&
- t(r.sendAdblockPageOptions) == "object" &&
- (this.sendAdblockPageOptions = r.sendAdblockPageOptions),
- r && r.clientSuppliedCallbacks)
- ) {
- const s = {};
- Object.keys(this.methodToCallbackMapping).forEach(function (e) {
- i.methodToCallbackMapping.hasOwnProperty(e) &&
- r.clientSuppliedCallbacks[i.methodToCallbackMapping[e]] &&
- (s[e] =
- r.clientSuppliedCallbacks[i.methodToCallbackMapping[e]]);
- }),
- Object.assign(this.clientSuppliedCallbacks, s),
- this.registerCallbacks(!0);
- }
- (this.eventRepository.writeKey = e),
- n && (this.eventRepository.url = n),
- r &&
- r.valTrackingList &&
- r.valTrackingList.push == Array.prototype.push &&
- (this.trackValues = r.valTrackingList),
- r &&
- r.useAutoTracking &&
- ((this.autoTrackFeatureEnabled = !0),
- this.autoTrackFeatureEnabled &&
- !this.autoTrackHandlersRegistered &&
- (xn(this),
- (this.autoTrackHandlersRegistered = !0),
- p(
- "autoTrackHandlersRegistered",
- this.autoTrackHandlersRegistered
- )));
- try {
- !(function (e, t, n, r) {
- let i;
- const o = r.bind(e);
- (i = new XMLHttpRequest()).open("GET", t, !0),
- i.setRequestHeader("Authorization", `Basic ${btoa(`${n}:`)}`),
- (i.onload = function () {
- const e = i.status;
- e == 200
- ? (p("status 200 calling callback"),
- o(200, i.responseText))
- : (b(
- new Error(
- `request failed with status: ${i.status} for url: ${t}`
- )
- ),
- o(e));
- }),
- i.send();
- })(this, o, e, this.processResponse);
- } catch (e) {
- b(e),
- this.autoTrackFeatureEnabled &&
- !this.autoTrackHandlersRegistered &&
- xn(Hn);
- }
- },
- },
- {
- key: "ready",
- value(e) {
- typeof e !== "function"
- ? f("ready callback is not a function")
- : (this.readyCallback = e);
- },
- },
- {
- key: "initializeCallbacks",
- value() {
- const e = this;
- Object.keys(this.methodToCallbackMapping).forEach(function (t) {
- e.methodToCallbackMapping.hasOwnProperty(t) &&
- e.on(t, function () {});
- });
- },
- },
- {
- key: "registerCallbacks",
- value(e) {
- const t = this;
- e ||
- Object.keys(this.methodToCallbackMapping).forEach(function (e) {
- t.methodToCallbackMapping.hasOwnProperty(e) &&
- window.rudderanalytics &&
- typeof window.rudderanalytics[
- t.methodToCallbackMapping[e]
- ] === "function" &&
- (t.clientSuppliedCallbacks[e] =
- window.rudderanalytics[t.methodToCallbackMapping[e]]);
- }),
- Object.keys(this.clientSuppliedCallbacks).forEach(function (e) {
- t.clientSuppliedCallbacks.hasOwnProperty(e) &&
- (p("registerCallbacks", e, t.clientSuppliedCallbacks[e]),
- t.on(e, t.clientSuppliedCallbacks[e]));
- });
- },
- },
- {
- key: "sendSampleRequest",
- value() {
- T(
- "ad-block",
- "//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"
- );
- },
- },
- ]),
- e
- );
- })())();
- _n(Hn),
- window.addEventListener(
- "error",
- function (e) {
- b(e, Hn);
- },
- !0
- ),
- Hn.initializeCallbacks(),
- Hn.registerCallbacks(!1);
- const Vn =
- !!window.rudderanalytics &&
- window.rudderanalytics.push == Array.prototype.push;
- const zn = window.rudderanalytics ? window.rudderanalytics[0] : [];
- if (zn.length > 0 && zn[0] == "load") {
- const Jn = zn[0];
- zn.shift(),
- p("=====from init, calling method:: ", Jn),
- Hn[Jn].apply(Hn, u(zn));
- }
- if (Vn) {
- for (let Wn = 1; Wn < window.rudderanalytics.length; Wn++)
- Hn.toBeProcessedArray.push(window.rudderanalytics[Wn]);
- for (let $n = 0; $n < Hn.toBeProcessedArray.length; $n++) {
- const Yn = u(Hn.toBeProcessedArray[$n]);
- const Qn = Yn[0];
- Yn.shift(),
- p("=====from init, calling method:: ", Qn),
- Hn[Qn].apply(Hn, u(Yn));
- }
- Hn.toBeProcessedArray = [];
- }
- const Zn = Hn.ready.bind(Hn);
- const Xn = Hn.identify.bind(Hn);
- const er = Hn.page.bind(Hn);
- const tr = Hn.track.bind(Hn);
- const nr = Hn.alias.bind(Hn);
- const rr = Hn.group.bind(Hn);
- const ir = Hn.reset.bind(Hn);
- const or = Hn.load.bind(Hn);
- const sr = (Hn.initialized = !0);
- const ar = Hn.getAnonymousId.bind(Hn);
- const ur = Hn.setAnonymousId.bind(Hn);
- return (
- (e.alias = nr),
- (e.getAnonymousId = ar),
- (e.group = rr),
- (e.identify = Xn),
- (e.initialized = sr),
- (e.load = or),
- (e.page = er),
- (e.ready = Zn),
- (e.reset = ir),
- (e.setAnonymousId = ur),
- (e.track = tr),
- e
- );
-})({});
-// # sourceMappingURL=https://cdn.rudderlabs.com/v1/rudder-analytics.min.js.map
diff --git a/dist/rudder-analytics.min.js.map b/dist/rudder-analytics.min.js.map
deleted file mode 100644
index 0765eef2e0..0000000000
--- a/dist/rudder-analytics.min.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"rudder-analytics.min.js","sources":["../utils/logUtil.js","../integrations/integration_cname.js","../integrations/client_server_name.js","../utils/utils.js","../utils/constants.js","../integrations/ScriptLoader.js","../integrations/HubSpot/browser.js","../node_modules/component-type/index.js","../node_modules/@ndhoule/clone/index.js","../node_modules/ms/index.js","../node_modules/rudder-component-cookie/node_modules/debug/debug.js","../node_modules/rudder-component-cookie/node_modules/debug/browser.js","../node_modules/rudder-component-cookie/index.js","../node_modules/@ndhoule/drop/index.js","../node_modules/@ndhoule/rest/index.js","../node_modules/@ndhoule/defaults/index.js","../node_modules/json3/lib/json3.js","../node_modules/component-url/index.js","../node_modules/component-cookie/node_modules/debug/debug.js","../node_modules/component-cookie/node_modules/debug/browser.js","../node_modules/component-cookie/index.js","../node_modules/@segment/top-domain/lib/index.js","../utils/storage/cookie.js","../node_modules/@segment/store/src/store.js","../utils/storage/store.js","../utils/storage/storage.js","../utils/storage/index.js","../integrations/GA/browser.js","../integrations/Hotjar/browser.js","../integrations/GoogleAds/browser.js","../integrations/VWO/browser.js","../integrations/GoogleTagManager/browser.js","../integrations/Braze/browser.js","../node_modules/crypt/crypt.js","../node_modules/charenc/charenc.js","../node_modules/is-buffer/index.js","../node_modules/is/index.js","../node_modules/md5/md5.js","../integrations/INTERCOM/browser.js","../integrations/Keen/browser.js","../node_modules/to-function/index.js","../node_modules/@ndhoule/extend/index.js","../node_modules/obj-case/index.js","../node_modules/component-each/node_modules/component-type/index.js","../node_modules/component-props/index.js","../node_modules/component-each/index.js","../integrations/Kissmetrics/browser.js","../integrations/CustomerIO/browser.js","../node_modules/on-body/index.js","../node_modules/uuid/lib/bytesToUuid.js","../integrations/Chartbeat/browser.js","../integrations/Comscore/browser.js","../node_modules/@ndhoule/keys/index.js","../node_modules/@ndhoule/each/index.js","../integrations/FBPixel/browser.js","../integrations/Lotame/LotameStorage.js","../integrations/index.js","../integrations/Lotame/browser.js","../utils/RudderApp.js","../utils/RudderInfo.js","../utils/RudderContext.js","../utils/RudderMessage.js","../utils/RudderElement.js","../utils/RudderElementBuilder.js","../utils/RudderPayload.js","../node_modules/uuid/lib/rng-browser.js","../node_modules/uuid/v1.js","../node_modules/uuid/v4.js","../node_modules/uuid/index.js","../node_modules/@segment/localstorage-retry/lib/engine.js","../node_modules/@segment/localstorage-retry/lib/store.js","../node_modules/@segment/localstorage-retry/lib/schedule.js","../node_modules/debug/debug.js","../node_modules/component-emitter/index.js","../node_modules/@segment/localstorage-retry/lib/index.js","../utils/EventRepository.js","../utils/autotrack.js","../node_modules/after/index.js","../analytics.js"],"sourcesContent":["var LOG_LEVEL_INFO = 1,\n LOG_LEVEL_DEBUG = 2,\n LOG_LEVEL_WARN = 3,\n LOG_LEVEL_ERROR = 4,\n LOG_LEVEL = LOG_LEVEL_ERROR;\n\nvar logger = {\n\n setLogLevel : function(logLevel){\n switch(logLevel.toUpperCase()){\n case 'INFO':\n LOG_LEVEL = LOG_LEVEL_INFO;\n return\n case 'DEBUG':\n LOG_LEVEL = LOG_LEVEL_DEBUG;\n return\n case 'WARN':\n LOG_LEVEL = LOG_LEVEL_WARN;\n return\n } \n },\n\n info : function(){\n if(LOG_LEVEL <= LOG_LEVEL_INFO){\n console.info(...arguments);\n }\n },\n\n debug : function(){\n if(LOG_LEVEL <= LOG_LEVEL_DEBUG){\n console.debug(...arguments);\n }\n },\n\n warn : function(){\n if(LOG_LEVEL <= LOG_LEVEL_WARN){\n console.warn(...arguments);\n }\n },\n\n error : function(){\n if(LOG_LEVEL <= LOG_LEVEL_ERROR){\n console.error(...arguments);\n }\n }\n\n};\nexport default logger;","// for sdk side native integration identification\n// add a mapping from common names to index.js exported key names as identified by Rudder\nlet commonNames = {\n \"All\": \"All\",\n \"Google Analytics\": \"GA\",\n \"GoogleAnalytics\": \"GA\",\n \"GA\": \"GA\",\n \"Google Ads\": \"GOOGLEADS\",\n \"GoogleAds\": \"GOOGLEADS\",\n \"GOOGLEADS\": \"GOOGLEADS\",\n \"Braze\": \"BRAZE\",\n \"BRAZE\": \"BRAZE\",\n \"Chartbeat\": \"CHARTBEAT\",\n \"CHARTBEAT\": \"CHARTBEAT\",\n \"Comscore\": \"COMSCORE\",\n \"COMSCORE\": \"COMSCORE\",\n \"Customerio\": \"CUSTOMERIO\",\n \"Customer.io\": \"CUSTOMERIO\",\n \"FB Pixel\": \"FACEBOOK_PIXEL\",\n \"Facebook Pixel\": \"FACEBOOK_PIXEL\",\n \"FB_PIXEL\": \"FACEBOOK_PIXEL\",\n \"Google Tag Manager\": \"GOOGLETAGMANAGER\",\n \"GTM\": \"GTM\",\n \"Hotjar\": \"HOTJAR\",\n \"hotjar\": \"HOTJAR\",\n \"HOTJAR\": \"HOTJAR\",\n \"Hubspot\": \"HS\",\n \"HUBSPOT\": \"HS\",\n \"Intercom\": \"INTERCOM\",\n \"INTERCOM\": \"INTERCOM\",\n \"Keen\": \"KEEN\",\n \"Keen.io\": \"KEEN\",\n \"KEEN\": \"KEEN\",\n \"Kissmetrics\": \"KISSMETRICS\",\n \"KISSMETRICS\": \"KISSMETRICS\",\n \"Lotame\": \"LOTAME\",\n \"LOTAME\": \"LOTAME\",\n \"Visual Website Optimizer\": \"VWO\",\n \"VWO\": \"VWO\"\n}\n\nexport {commonNames}","// from client native integration name to server identified display name\n// add a mapping from Rudder identified key names to Rudder server recognizable names\nlet clientToServerNames = {\n \"All\": \"All\",\n \"GA\": \"Google Analytics\",\n \"GOOGLEADS\": \"Google Ads\",\n \"BRAZE\": \"Braze\",\n \"CHARTBEAT\": \"Chartbeat\",\n \"COMSCORE\": \"Comscore\", \n \"CUSTOMERIO\": \"Customer IO\",\n \"FACEBOOK_PIXEL\": \"Facebook Pixel\",\n \"GTM\": \"Google Tag Manager\",\n \"HOTJAR\": \"Hotjar\",\n \"HS\": \"HubSpot\",\n \"INTERCOM\": \"Intercom\",\n \"KEEN\": \"Keen\", \n \"KISSMETRICS\": \"Kiss Metrics\",\n \"LOTAME\": \"Lotame\",\n \"VWO\": \"VWO\"\n}\n\nexport {clientToServerNames}","//import * as XMLHttpRequestNode from \"Xmlhttprequest\";\nimport logger from \"./logUtil\";\nimport {commonNames} from \"../integrations/integration_cname\"\nimport {clientToServerNames} from \"../integrations/client_server_name\"\n\nlet XMLHttpRequestNode;\nif (!process.browser) {\n XMLHttpRequestNode = require(\"Xmlhttprequest\");\n}\n\nlet btoaNode;\nif (!process.browser) {\n btoaNode = require(\"btoa\");\n}\n\n/**\n *\n * Utility method for excluding null and empty values in JSON\n * @param {*} key\n * @param {*} value\n * @returns\n */\nfunction replacer(key, value) {\n if (value === null || value === undefined) {\n return undefined;\n } else {\n return value;\n }\n}\n\n/**\n *\n * Utility function for UUID genration\n * @returns\n */\nfunction generateUUID() {\n // Public Domain/MIT\n let d = new Date().getTime();\n if (\n typeof performance !== \"undefined\" &&\n typeof performance.now === \"function\"\n ) {\n d += performance.now(); //use high-precision timer if available\n }\n return \"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\".replace(/[xy]/g, function(c) {\n let r = (d + Math.random() * 16) % 16 | 0;\n d = Math.floor(d / 16);\n return (c === \"x\" ? r : (r & 0x3) | 0x8).toString(16);\n });\n}\n\n/**\n *\n * Utility function to get current time (formatted) for including in sent_at field\n * @returns\n */\nfunction getCurrentTimeFormatted() {\n let curDateTime = new Date().toISOString();\n // Keeping same as iso string\n /* let curDate = curDateTime.split(\"T\")[0];\n let curTimeExceptMillis = curDateTime\n .split(\"T\")[1]\n .split(\"Z\")[0]\n .split(\".\")[0];\n let curTimeMillis = curDateTime.split(\"Z\")[0].split(\".\")[1];\n return curDate + \" \" + curTimeExceptMillis + \"+\" + curTimeMillis; */\n return curDateTime;\n}\n\n/**\n *\n * Utility function to retrieve configuration JSON from server\n * @param {*} url\n * @param {*} wrappers\n * @param {*} isLoaded\n * @param {*} callback\n */\nfunction getJSON(url, wrappers, isLoaded, callback) {\n //server-side integration, XHR is node module\n\n if (process.browser) {\n var xhr = new XMLHttpRequest();\n } else {\n var xhr = new XMLHttpRequestNode.XMLHttpRequest();\n }\n xhr.open(\"GET\", url, false);\n xhr.onload = function() {\n let status = xhr.status;\n if (status == 200) {\n logger.debug(\"status 200\");\n callback(null, xhr.responseText, wrappers, isLoaded);\n } else {\n callback(status);\n }\n };\n xhr.send();\n}\n\n/**\n *\n * Utility function to retrieve configuration JSON from server\n * @param {*} context\n * @param {*} url\n * @param {*} callback\n */\nfunction getJSONTrimmed(context, url, writeKey, callback) {\n //server-side integration, XHR is node module\n let cb_ = callback.bind(context);\n\n if (process.browser) {\n var xhr = new XMLHttpRequest();\n } else {\n var xhr = new XMLHttpRequestNode.XMLHttpRequest();\n }\n xhr.open(\"GET\", url, true);\n if (process.browser) {\n xhr.setRequestHeader(\"Authorization\", \"Basic \" + btoa(writeKey + \":\"));\n } else {\n xhr.setRequestHeader(\"Authorization\", \"Basic \" + btoaNode(writeKey + \":\"));\n }\n\n xhr.onload = function() {\n let status = xhr.status;\n if (status == 200) {\n logger.debug(\"status 200 \" + \"calling callback\");\n cb_(200, xhr.responseText);\n } else {\n handleError(\n new Error(\n \"request failed with status: \" + xhr.status + \" for url: \" + url\n )\n );\n cb_(status);\n }\n };\n xhr.send();\n}\n\nfunction handleError(error, analyticsInstance) {\n let errorMessage = error.message ? error.message : undefined;\n let sampleAdBlockTest = undefined\n try {\n if (error instanceof Event) {\n if (error.target && error.target.localName == \"script\") {\n errorMessage = \"error in script loading:: src:: \" + error.target.src + \" id:: \" + error.target.id;\n if(analyticsInstance && error.target.src.includes(\"adsbygoogle\")) {\n sampleAdBlockTest = true\n analyticsInstance.page(\"RudderJS-Initiated\", \"ad-block page request\", {path: \"/ad-blocked\", title: errorMessage}, analyticsInstance.sendAdblockPageOptions)\n }\n }\n }\n if (errorMessage && !sampleAdBlockTest) {\n logger.error(\"[Util] handleError:: \", errorMessage);\n }\n } catch (e) {\n logger.error(\"[Util] handleError:: \", e)\n }\n \n}\n\nfunction getDefaultPageProperties() {\n let canonicalUrl = getCanonicalUrl();\n let path = canonicalUrl ? canonicalUrl.pathname : window.location.pathname;\n let referrer = document.referrer;\n let search = window.location.search;\n let title = document.title;\n let url = getUrl(search);\n\n return {\n path: path,\n referrer: referrer,\n search: search,\n title: title,\n url: url\n };\n}\n\nfunction getUrl(search) {\n let canonicalUrl = getCanonicalUrl();\n let url = canonicalUrl\n ? canonicalUrl.indexOf(\"?\") > -1\n ? canonicalUrl\n : canonicalUrl + search\n : window.location.href;\n let hashIndex = url.indexOf(\"#\");\n return hashIndex > -1 ? url.slice(0, hashIndex) : url;\n}\n\nfunction getCanonicalUrl() {\n var tags = document.getElementsByTagName(\"link\");\n for (var i = 0, tag; (tag = tags[i]); i++) {\n if (tag.getAttribute(\"rel\") === \"canonical\") {\n return tag.getAttribute(\"href\");\n }\n }\n}\n\nfunction getCurrency(val) {\n if (!val) return;\n if (typeof val === \"number\") {\n return val;\n }\n if (typeof val !== \"string\") {\n return;\n }\n\n val = val.replace(/\\$/g, \"\");\n val = parseFloat(val);\n\n if (!isNaN(val)) {\n return val;\n }\n}\n\nfunction getRevenue(properties, eventName) {\n var revenue = properties.revenue;\n var orderCompletedRegExp = /^[ _]?completed[ _]?order[ _]?|^[ _]?order[ _]?completed[ _]?$/i;\n\n // it's always revenue, unless it's called during an order completion.\n if (!revenue && eventName && eventName.match(orderCompletedRegExp)) {\n revenue = properties.total;\n }\n\n return getCurrency(revenue);\n}\n\n/**\n *\n *\n * @param {*} integrationObject\n */\nfunction tranformToRudderNames(integrationObject) {\n Object.keys(integrationObject).forEach(key => {\n if(integrationObject.hasOwnProperty(key)) {\n if(commonNames[key]) {\n integrationObject[commonNames[key]] = integrationObject[key]\n }\n if(key != \"All\") {\n // delete user supplied keys except All and if except those where oldkeys are not present or oldkeys are same as transformed keys \n if(commonNames[key] != undefined && commonNames[key] != key) {\n delete integrationObject[key]\n }\n }\n \n }\n })\n}\n\nfunction transformToServerNames(integrationObject) {\n Object.keys(integrationObject).forEach(key => {\n if(integrationObject.hasOwnProperty(key)) {\n if(clientToServerNames[key]) {\n integrationObject[clientToServerNames[key]] = integrationObject[key]\n }\n if(key != \"All\") {\n // delete user supplied keys except All and if except those where oldkeys are not present or oldkeys are same as transformed keys \n if(clientToServerNames[key] != undefined && clientToServerNames[key] != key) {\n delete integrationObject[key]\n }\n }\n \n }\n })\n}\n\n/**\n * \n * @param {*} sdkSuppliedIntegrations \n * @param {*} configPlaneEnabledIntegrations \n */\nfunction findAllEnabledDestinations(sdkSuppliedIntegrations, configPlaneEnabledIntegrations) {\n let enabledList = []\n if(!configPlaneEnabledIntegrations || configPlaneEnabledIntegrations.length == 0) {\n return enabledList\n }\n let allValue = true\n if(typeof configPlaneEnabledIntegrations[0] == \"string\") {\n if(sdkSuppliedIntegrations[\"All\"] != undefined) {\n allValue = sdkSuppliedIntegrations[\"All\"]\n }\n configPlaneEnabledIntegrations.forEach(intg => {\n if(!allValue) {\n // All false ==> check if intg true supplied\n if(sdkSuppliedIntegrations[intg]!= undefined && sdkSuppliedIntegrations[intg] == true) {\n enabledList.push(intg)\n }\n } else {\n // All true ==> intg true by default\n let intgValue = true\n // check if intg false supplied\n if(sdkSuppliedIntegrations[intg] != undefined && sdkSuppliedIntegrations[intg] == false) {\n intgValue = false\n }\n if(intgValue) {\n enabledList.push(intg)\n }\n }\n })\n\n return enabledList\n }\n\n if(typeof configPlaneEnabledIntegrations[0] == \"object\") {\n if(sdkSuppliedIntegrations[\"All\"] != undefined) {\n allValue = sdkSuppliedIntegrations[\"All\"]\n }\n configPlaneEnabledIntegrations.forEach(intg => {\n if(!allValue) {\n // All false ==> check if intg true supplied\n if(sdkSuppliedIntegrations[intg.name]!= undefined && sdkSuppliedIntegrations[intg.name] == true) {\n enabledList.push(intg)\n }\n } else {\n // All true ==> intg true by default\n let intgValue = true\n // check if intg false supplied\n if(sdkSuppliedIntegrations[intg.name] != undefined && sdkSuppliedIntegrations[intg.name] == false) {\n intgValue = false\n }\n if(intgValue) {\n enabledList.push(intg)\n }\n }\n })\n\n return enabledList\n }\n\n}\n\nexport {\n replacer,\n generateUUID,\n getCurrentTimeFormatted,\n getJSONTrimmed,\n getJSON,\n getRevenue,\n getDefaultPageProperties,\n findAllEnabledDestinations,\n tranformToRudderNames,\n transformToServerNames,\n handleError\n};\n","import { version } from \"../package.json\";\n//Message Type enumeration\nlet MessageType = {\n TRACK: \"track\",\n PAGE: \"page\",\n //SCREEN: \"screen\",\n IDENTIFY: \"identify\"\n};\n\n//ECommerce Parameter Names Enumeration\nlet ECommerceParamNames = {\n QUERY: \"query\",\n PRICE: \"price\",\n PRODUCT_ID: \"product_id\",\n CATEGORY: \"category\",\n CURRENCY: \"currency\",\n LIST_ID: \"list_id\",\n PRODUCTS: \"products\",\n WISHLIST_ID: \"wishlist_id\",\n WISHLIST_NAME: \"wishlist_name\",\n QUANTITY: \"quantity\",\n CART_ID: \"cart_id\",\n CHECKOUT_ID: \"checkout_id\",\n TOTAL: \"total\",\n REVENUE: \"revenue\",\n ORDER_ID: \"order_id\",\n FILTERS: \"filters\",\n SORTS: \"sorts\",\n SHARE_VIA: \"share_via\",\n SHARE_MESSAGE: \"share_message\",\n RECIPIENT: \"recipient\"\n};\n//ECommerce Events Enumeration\nlet ECommerceEvents = {\n PRODUCTS_SEARCHED: \"Products Searched\",\n PRODUCT_LIST_VIEWED: \"Product List Viewed\",\n PRODUCT_LIST_FILTERED: \"Product List Filtered\",\n PROMOTION_VIEWED: \"Promotion Viewed\",\n PROMOTION_CLICKED: \"Promotion Clicked\",\n PRODUCT_CLICKED: \"Product Clicked\",\n PRODUCT_VIEWED: \"Product Viewed\",\n PRODUCT_ADDED: \"Product Added\",\n PRODUCT_REMOVED: \"Product Removed\",\n CART_VIEWED: \"Cart Viewed\",\n CHECKOUT_STARTED: \"Checkout Started\",\n CHECKOUT_STEP_VIEWED: \"Checkout Step Viewed\",\n CHECKOUT_STEP_COMPLETED: \"Checkout Step Completed\",\n PAYMENT_INFO_ENTERED: \"Payment Info Entered\",\n ORDER_UPDATED: \"Order Updated\",\n ORDER_COMPLETED: \"Order Completed\",\n ORDER_REFUNDED: \"Order Refunded\",\n ORDER_CANCELLED: \"Order Cancelled\",\n COUPON_ENTERED: \"Coupon Entered\",\n COUPON_APPLIED: \"Coupon Applied\",\n COUPON_DENIED: \"Coupon Denied\",\n COUPON_REMOVED: \"Coupon Removed\",\n PRODUCT_ADDED_TO_WISHLIST: \"Product Added to Wishlist\",\n PRODUCT_REMOVED_FROM_WISHLIST: \"Product Removed from Wishlist\",\n WISH_LIST_PRODUCT_ADDED_TO_CART: \"Wishlist Product Added to Cart\",\n PRODUCT_SHARED: \"Product Shared\",\n CART_SHARED: \"Cart Shared\",\n PRODUCT_REVIEWED: \"Product Reviewed\"\n};\n\n//Enumeration for integrations supported\nlet RudderIntegrationPlatform = {\n RUDDERLABS: \"rudderlabs\",\n GA: \"ga\",\n AMPLITUDE: \"amplitude\"\n};\n\nlet BASE_URL = \"https://hosted.rudderlabs.com\"; // default to RudderStack\nlet CONFIG_URL = \"https://api.rudderlabs.com/sourceConfig/?p=web&v=\" + version;\n\nlet FLUSH_QUEUE_SIZE = 30;\n\nlet FLUSH_INTERVAL_DEFAULT = 5000;\n\nconst MAX_WAIT_FOR_INTEGRATION_LOAD = 10000;\nconst INTEGRATION_LOAD_CHECK_INTERVAL = 1000;\n\nexport {\n MessageType,\n ECommerceParamNames,\n ECommerceEvents,\n RudderIntegrationPlatform,\n BASE_URL,\n CONFIG_URL,\n FLUSH_QUEUE_SIZE,\n FLUSH_INTERVAL_DEFAULT,\n MAX_WAIT_FOR_INTEGRATION_LOAD,\n INTEGRATION_LOAD_CHECK_INTERVAL\n};\n/* module.exports = {\n MessageType: MessageType,\n ECommerceParamNames: ECommerceParamNames,\n ECommerceEvents: ECommerceEvents,\n RudderIntegrationPlatform: RudderIntegrationPlatform,\n BASE_URL: BASE_URL,\n CONFIG_URL: CONFIG_URL,\n FLUSH_QUEUE_SIZE: FLUSH_QUEUE_SIZE\n}; */\n","import logger from \"../utils/logUtil\";\nfunction ScriptLoader(id, src) {\n logger.debug(\"in script loader=== \" + id);\n let js = document.createElement(\"script\");\n js.src = src;\n js.async = true;\n js.type = \"text/javascript\";\n js.id = id;\n let e = document.getElementsByTagName(\"script\")[0];\n logger.debug(\"==script==\", e);\n e.parentNode.insertBefore(js, e);\n}\n\nexport { ScriptLoader };\n","import { ScriptLoader } from \"../ScriptLoader\";\nimport logger from \"../../utils/logUtil\";\n\nclass HubSpot {\n constructor(config) {\n this.hubId = config.hubID; //6405167\n this.name = \"HS\";\n }\n\n init() {\n let hubspotJs = \"http://js.hs-scripts.com/\" + this.hubId + \".js\";\n ScriptLoader(\"hubspot-integration\", hubspotJs);\n\n logger.debug(\"===in init HS===\");\n }\n\n identify(rudderElement) {\n logger.debug(\"in HubspotAnalyticsManager identify\");\n\n let traits = rudderElement.message.context.traits;\n let traitsValue = {};\n\n for (let k in traits) {\n if (!!Object.getOwnPropertyDescriptor(traits, k) && traits[k]) {\n let hubspotkey = k; //k.startsWith(\"rl_\") ? k.substring(3, k.length) : k;\n if (toString.call(traits[k]) == \"[object Date]\") {\n traitsValue[hubspotkey] = traits[k].getTime();\n } else {\n traitsValue[hubspotkey] = traits[k];\n }\n }\n }\n /* if (traitsValue[\"address\"]) {\n let address = traitsValue[\"address\"];\n //traitsValue.delete(address)\n delete traitsValue[\"address\"];\n for (let k in address) {\n if (!!Object.getOwnPropertyDescriptor(address, k) && address[k]) {\n let hubspotkey = k;//k.startsWith(\"rl_\") ? k.substring(3, k.length) : k;\n hubspotkey = hubspotkey == \"street\" ? \"address\" : hubspotkey;\n traitsValue[hubspotkey] = address[k];\n }\n }\n } */\n let userProperties = rudderElement.message.context.user_properties;\n for (let k in userProperties) {\n if (\n !!Object.getOwnPropertyDescriptor(userProperties, k) &&\n userProperties[k]\n ) {\n let hubspotkey = k; //k.startsWith(\"rl_\") ? k.substring(3, k.length) : k;\n traitsValue[hubspotkey] = userProperties[k];\n }\n }\n\n logger.debug(traitsValue);\n\n if (typeof window !== undefined) {\n let _hsq = (window._hsq = window._hsq || []);\n _hsq.push([\"identify\", traitsValue]);\n }\n }\n\n track(rudderElement) {\n logger.debug(\"in HubspotAnalyticsManager track\");\n let _hsq = (window._hsq = window._hsq || []);\n let eventValue = {};\n eventValue[\"id\"] = rudderElement.message.event;\n if (\n rudderElement.message.properties &&\n (rudderElement.message.properties.revenue ||\n rudderElement.message.properties.value)\n ) {\n eventValue[\"value\"] =\n rudderElement.message.properties.revenue ||\n rudderElement.message.properties.value;\n }\n _hsq.push([\"trackEvent\", eventValue]);\n }\n\n page(rudderElement) {\n logger.debug(\"in HubspotAnalyticsManager page\");\n let _hsq = (window._hsq = window._hsq || []);\n //logger.debug(\"path: \" + rudderElement.message.properties.path);\n //_hsq.push([\"setPath\", rudderElement.message.properties.path]);\n /* _hsq.push([\"identify\",{\n email: \"testtrackpage@email.com\"\n }]); */\n if (\n rudderElement.message.properties &&\n rudderElement.message.properties.path\n ) {\n _hsq.push([\"setPath\", rudderElement.message.properties.path]);\n }\n _hsq.push([\"trackPageView\"]);\n }\n\n isLoaded() {\n logger.debug(\"in hubspot isLoaded\");\n return !!(window._hsq && window._hsq.push !== Array.prototype.push);\n }\n\n isReady() {\n return !!(window._hsq && window._hsq.push !== Array.prototype.push);\n }\n}\n\nexport { HubSpot };\n","/**\n * toString ref.\n */\n\nvar toString = Object.prototype.toString;\n\n/**\n * Return the type of `val`.\n *\n * @param {Mixed} val\n * @return {String}\n * @api public\n */\n\nmodule.exports = function(val){\n switch (toString.call(val)) {\n case '[object Date]': return 'date';\n case '[object RegExp]': return 'regexp';\n case '[object Arguments]': return 'arguments';\n case '[object Array]': return 'array';\n case '[object Error]': return 'error';\n }\n\n if (val === null) return 'null';\n if (val === undefined) return 'undefined';\n if (val !== val) return 'nan';\n if (val && val.nodeType === 1) return 'element';\n\n if (isBuffer(val)) return 'buffer';\n\n val = val.valueOf\n ? val.valueOf()\n : Object.prototype.valueOf.apply(val);\n\n return typeof val;\n};\n\n// code borrowed from https://github.com/feross/is-buffer/blob/master/index.js\nfunction isBuffer(obj) {\n return !!(obj != null &&\n (obj._isBuffer || // For Safari 5-7 (missing Object.prototype.constructor)\n (obj.constructor &&\n typeof obj.constructor.isBuffer === 'function' &&\n obj.constructor.isBuffer(obj))\n ))\n}\n","'use strict';\n\n/*\n * Module dependencies.\n */\n\nvar type = require('component-type');\n\n/**\n * Deeply clone an object.\n *\n * @param {*} obj Any object.\n */\n\nvar clone = function clone(obj) {\n var t = type(obj);\n\n if (t === 'object') {\n var copy = {};\n for (var key in obj) {\n if (obj.hasOwnProperty(key)) {\n copy[key] = clone(obj[key]);\n }\n }\n return copy;\n }\n\n if (t === 'array') {\n var copy = new Array(obj.length);\n for (var i = 0, l = obj.length; i < l; i++) {\n copy[i] = clone(obj[i]);\n }\n return copy;\n }\n\n if (t === 'regexp') {\n // from millermedeiros/amd-utils - MIT\n var flags = '';\n flags += obj.multiline ? 'm' : '';\n flags += obj.global ? 'g' : '';\n flags += obj.ignoreCase ? 'i' : '';\n return new RegExp(obj.source, flags);\n }\n\n if (t === 'date') {\n return new Date(obj.getTime());\n }\n\n // string, number, boolean, etc.\n return obj;\n};\n\n/*\n * Exports.\n */\n\nmodule.exports = clone;\n","/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} options\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function(val, options){\n options = options || {};\n if ('string' == typeof val) return parse(val);\n return options.long\n ? long(val)\n : short(val);\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = '' + str;\n if (str.length > 10000) return;\n var match = /^((?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(str);\n if (!match) return;\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction short(ms) {\n if (ms >= d) return Math.round(ms / d) + 'd';\n if (ms >= h) return Math.round(ms / h) + 'h';\n if (ms >= m) return Math.round(ms / m) + 'm';\n if (ms >= s) return Math.round(ms / s) + 's';\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction long(ms) {\n return plural(ms, d, 'day')\n || plural(ms, h, 'hour')\n || plural(ms, m, 'minute')\n || plural(ms, s, 'second')\n || ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, n, name) {\n if (ms < n) return;\n if (ms < n * 1.5) return Math.floor(ms / n) + ' ' + name;\n return Math.ceil(ms / n) + ' ' + name + 's';\n}\n","\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = debug;\nexports.coerce = coerce;\nexports.disable = disable;\nexports.enable = enable;\nexports.enabled = enabled;\nexports.humanize = require('ms');\n\n/**\n * The currently active debug mode names, and names to skip.\n */\n\nexports.names = [];\nexports.skips = [];\n\n/**\n * Map of special \"%n\" handling functions, for the debug \"format\" argument.\n *\n * Valid key names are a single, lowercased letter, i.e. \"n\".\n */\n\nexports.formatters = {};\n\n/**\n * Previously assigned color.\n */\n\nvar prevColor = 0;\n\n/**\n * Previous log timestamp.\n */\n\nvar prevTime;\n\n/**\n * Select a color.\n *\n * @return {Number}\n * @api private\n */\n\nfunction selectColor() {\n return exports.colors[prevColor++ % exports.colors.length];\n}\n\n/**\n * Create a debugger with the given `namespace`.\n *\n * @param {String} namespace\n * @return {Function}\n * @api public\n */\n\nfunction debug(namespace) {\n\n // define the `disabled` version\n function disabled() {\n }\n disabled.enabled = false;\n\n // define the `enabled` version\n function enabled() {\n\n var self = enabled;\n\n // set `diff` timestamp\n var curr = +new Date();\n var ms = curr - (prevTime || curr);\n self.diff = ms;\n self.prev = prevTime;\n self.curr = curr;\n prevTime = curr;\n\n // add the `color` if not set\n if (null == self.useColors) self.useColors = exports.useColors();\n if (null == self.color && self.useColors) self.color = selectColor();\n\n var args = Array.prototype.slice.call(arguments);\n\n args[0] = exports.coerce(args[0]);\n\n if ('string' !== typeof args[0]) {\n // anything else let's inspect with %o\n args = ['%o'].concat(args);\n }\n\n // apply any `formatters` transformations\n var index = 0;\n args[0] = args[0].replace(/%([a-z%])/g, function(match, format) {\n // if we encounter an escaped % then don't increase the array index\n if (match === '%%') return match;\n index++;\n var formatter = exports.formatters[format];\n if ('function' === typeof formatter) {\n var val = args[index];\n match = formatter.call(self, val);\n\n // now we need to remove `args[index]` since it's inlined in the `format`\n args.splice(index, 1);\n index--;\n }\n return match;\n });\n\n if ('function' === typeof exports.formatArgs) {\n args = exports.formatArgs.apply(self, args);\n }\n var logFn = enabled.log || exports.log || console.log.bind(console);\n logFn.apply(self, args);\n }\n enabled.enabled = true;\n\n var fn = exports.enabled(namespace) ? enabled : disabled;\n\n fn.namespace = namespace;\n\n return fn;\n}\n\n/**\n * Enables a debug mode by namespaces. This can include modes\n * separated by a colon and wildcards.\n *\n * @param {String} namespaces\n * @api public\n */\n\nfunction enable(namespaces) {\n exports.save(namespaces);\n\n var split = (namespaces || '').split(/[\\s,]+/);\n var len = split.length;\n\n for (var i = 0; i < len; i++) {\n if (!split[i]) continue; // ignore empty strings\n namespaces = split[i].replace(/\\*/g, '.*?');\n if (namespaces[0] === '-') {\n exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));\n } else {\n exports.names.push(new RegExp('^' + namespaces + '$'));\n }\n }\n}\n\n/**\n * Disable debug output.\n *\n * @api public\n */\n\nfunction disable() {\n exports.enable('');\n}\n\n/**\n * Returns true if the given mode name is enabled, false otherwise.\n *\n * @param {String} name\n * @return {Boolean}\n * @api public\n */\n\nfunction enabled(name) {\n var i, len;\n for (i = 0, len = exports.skips.length; i < len; i++) {\n if (exports.skips[i].test(name)) {\n return false;\n }\n }\n for (i = 0, len = exports.names.length; i < len; i++) {\n if (exports.names[i].test(name)) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Coerce `val`.\n *\n * @param {Mixed} val\n * @return {Mixed}\n * @api private\n */\n\nfunction coerce(val) {\n if (val instanceof Error) return val.stack || val.message;\n return val;\n}\n","\n/**\n * This is the web browser implementation of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = require('./debug');\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = 'undefined' != typeof chrome\n && 'undefined' != typeof chrome.storage\n ? chrome.storage.local\n : localstorage();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n 'lightseagreen',\n 'forestgreen',\n 'goldenrod',\n 'dodgerblue',\n 'darkorchid',\n 'crimson'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\nfunction useColors() {\n // is webkit? http://stackoverflow.com/a/16459606/376773\n return ('WebkitAppearance' in document.documentElement.style) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (window.console && (console.firebug || (console.exception && console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31);\n}\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nexports.formatters.j = function(v) {\n return JSON.stringify(v);\n};\n\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs() {\n var args = arguments;\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return args;\n\n var c = 'color: ' + this.color;\n args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n return args;\n}\n\n/**\n * Invokes `console.log()` when available.\n * No-op when `console.log` is not a \"function\".\n *\n * @api public\n */\n\nfunction log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console\n && console.log\n && Function.prototype.apply.call(console.log, console, arguments);\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\n\nfunction save(namespaces) {\n try {\n if (null == namespaces) {\n exports.storage.removeItem('debug');\n } else {\n exports.storage.debug = namespaces;\n }\n } catch(e) {}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\nfunction load() {\n var r;\n try {\n r = exports.storage.debug;\n } catch(e) {}\n return r;\n}\n\n/**\n * Enable namespaces listed in `localStorage.debug` initially.\n */\n\nexports.enable(load());\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage(){\n try {\n return window.localStorage;\n } catch (e) {}\n}\n","\n/**\n * Module dependencies.\n */\n\nvar debug = require('debug')('cookie');\n\n/**\n * Set or get cookie `name` with `value` and `options` object.\n *\n * @param {String} name\n * @param {String} value\n * @param {Object} options\n * @return {Mixed}\n * @api public\n */\n\nmodule.exports = function(name, value, options){\n switch (arguments.length) {\n case 3:\n case 2:\n return set(name, value, options);\n case 1:\n return get(name);\n default:\n return all();\n }\n};\n\n/**\n * Set cookie `name` to `value`.\n *\n * @param {String} name\n * @param {String} value\n * @param {Object} options\n * @api private\n */\n\nfunction set(name, value, options) {\n options = options || {};\n var str = encode(name) + '=' + encode(value);\n\n if (null == value) options.maxage = -1;\n\n if (options.maxage) {\n options.expires = new Date(+new Date + options.maxage);\n }\n\n if (options.path) str += '; path=' + options.path;\n if (options.domain) str += '; domain=' + options.domain;\n if (options.expires) str += '; expires=' + options.expires.toUTCString();\n if (options.samesite) str += '; samesite=' + options.samesite;\n if (options.secure) str += '; secure';\n\n document.cookie = str;\n}\n\n/**\n * Return all cookies.\n *\n * @return {Object}\n * @api private\n */\n\nfunction all() {\n var str;\n try {\n str = document.cookie;\n } catch (err) {\n if (typeof console !== 'undefined' && typeof console.error === 'function') {\n console.error(err.stack || err);\n }\n return {};\n }\n return parse(str);\n}\n\n/**\n * Get cookie `name`.\n *\n * @param {String} name\n * @return {String}\n * @api private\n */\n\nfunction get(name) {\n return all()[name];\n}\n\n/**\n * Parse cookie `str`.\n *\n * @param {String} str\n * @return {Object}\n * @api private\n */\n\nfunction parse(str) {\n var obj = {};\n var pairs = str.split(/ *; */);\n var pair;\n if ('' == pairs[0]) return obj;\n for (var i = 0; i < pairs.length; ++i) {\n pair = pairs[i].split('=');\n obj[decode(pair[0])] = decode(pair[1]);\n }\n return obj;\n}\n\n/**\n * Encode.\n */\n\nfunction encode(value){\n try {\n return encodeURIComponent(value);\n } catch (e) {\n debug('error `encode(%o)` - %o', value, e)\n }\n}\n\n/**\n * Decode.\n */\n\nfunction decode(value) {\n try {\n return decodeURIComponent(value);\n } catch (e) {\n debug('error `decode(%o)` - %o', value, e)\n }\n}\n","'use strict';\n\nvar max = Math.max;\n\n/**\n * Produce a new array composed of all but the first `n` elements of an input `collection`.\n *\n * @name drop\n * @api public\n * @param {number} count The number of elements to drop.\n * @param {Array} collection The collection to iterate over.\n * @return {Array} A new array containing all but the first element from `collection`.\n * @example\n * drop(0, [1, 2, 3]); // => [1, 2, 3]\n * drop(1, [1, 2, 3]); // => [2, 3]\n * drop(2, [1, 2, 3]); // => [3]\n * drop(3, [1, 2, 3]); // => []\n * drop(4, [1, 2, 3]); // => []\n */\nvar drop = function drop(count, collection) {\n var length = collection ? collection.length : 0;\n\n if (!length) {\n return [];\n }\n\n // Preallocating an array *significantly* boosts performance when dealing with\n // `arguments` objects on v8. For a summary, see:\n // https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#32-leaking-arguments\n var toDrop = max(Number(count) || 0, 0);\n var resultsLength = max(length - toDrop, 0);\n var results = new Array(resultsLength);\n\n for (var i = 0; i < resultsLength; i += 1) {\n results[i] = collection[i + toDrop];\n }\n\n return results;\n};\n\n/*\n * Exports.\n */\n\nmodule.exports = drop;\n","'use strict';\n\nvar max = Math.max;\n\n/**\n * Produce a new array by passing each value in the input `collection` through a transformative\n * `iterator` function. The `iterator` function is passed three arguments:\n * `(value, index, collection)`.\n *\n * @name rest\n * @api public\n * @param {Array} collection The collection to iterate over.\n * @return {Array} A new array containing all but the first element from `collection`.\n * @example\n * rest([1, 2, 3]); // => [2, 3]\n */\nvar rest = function rest(collection) {\n if (collection == null || !collection.length) {\n return [];\n }\n\n // Preallocating an array *significantly* boosts performance when dealing with\n // `arguments` objects on v8. For a summary, see:\n // https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#32-leaking-arguments\n var results = new Array(max(collection.length - 2, 0));\n\n for (var i = 1; i < collection.length; i += 1) {\n results[i - 1] = collection[i];\n }\n\n return results;\n};\n\n/*\n * Exports.\n */\n\nmodule.exports = rest;\n","'use strict';\n\n/*\n * Module dependencies.\n */\n\nvar drop = require('@ndhoule/drop');\nvar rest = require('@ndhoule/rest');\n\nvar has = Object.prototype.hasOwnProperty;\nvar objToString = Object.prototype.toString;\n\n/**\n * Returns `true` if a value is an object, otherwise `false`.\n *\n * @name isObject\n * @api private\n * @param {*} val The value to test.\n * @return {boolean}\n */\n// TODO: Move to a library\nvar isObject = function isObject(value) {\n return Boolean(value) && typeof value === 'object';\n};\n\n/**\n * Returns `true` if a value is a plain object, otherwise `false`.\n *\n * @name isPlainObject\n * @api private\n * @param {*} val The value to test.\n * @return {boolean}\n */\n// TODO: Move to a library\nvar isPlainObject = function isPlainObject(value) {\n return Boolean(value) && objToString.call(value) === '[object Object]';\n};\n\n/**\n * Assigns a key-value pair to a target object when the value assigned is owned,\n * and where target[key] is undefined.\n *\n * @name shallowCombiner\n * @api private\n * @param {Object} target\n * @param {Object} source\n * @param {*} value\n * @param {string} key\n */\nvar shallowCombiner = function shallowCombiner(target, source, value, key) {\n if (has.call(source, key) && target[key] === undefined) {\n target[key] = value;\n }\n return source;\n};\n\n/**\n * Assigns a key-value pair to a target object when the value assigned is owned,\n * and where target[key] is undefined; also merges objects recursively.\n *\n * @name deepCombiner\n * @api private\n * @param {Object} target\n * @param {Object} source\n * @param {*} value\n * @param {string} key\n * @return {Object}\n */\nvar deepCombiner = function(target, source, value, key) {\n if (has.call(source, key)) {\n if (isPlainObject(target[key]) && isPlainObject(value)) {\n target[key] = defaultsDeep(target[key], value);\n } else if (target[key] === undefined) {\n target[key] = value;\n }\n }\n\n return source;\n};\n\n/**\n * TODO: Document\n *\n * @name defaultsWith\n * @api private\n * @param {Function} combiner\n * @param {Object} target\n * @param {...Object} sources\n * @return {Object} Return the input `target`.\n */\nvar defaultsWith = function(combiner, target /*, ...sources */) {\n if (!isObject(target)) {\n return target;\n }\n\n combiner = combiner || shallowCombiner;\n var sources = drop(2, arguments);\n\n for (var i = 0; i < sources.length; i += 1) {\n for (var key in sources[i]) {\n combiner(target, sources[i], sources[i][key], key);\n }\n }\n\n return target;\n};\n\n/**\n * Copies owned, enumerable properties from a source object(s) to a target\n * object when the value of that property on the source object is `undefined`.\n * Recurses on objects.\n *\n * @name defaultsDeep\n * @api public\n * @param {Object} target\n * @param {...Object} sources\n * @return {Object} The input `target`.\n */\nvar defaultsDeep = function defaultsDeep(target /*, sources */) {\n // TODO: Replace with `partial` call?\n return defaultsWith.apply(null, [deepCombiner, target].concat(rest(arguments)));\n};\n\n/**\n * Copies owned, enumerable properties from a source object(s) to a target\n * object when the value of that property on the source object is `undefined`.\n *\n * @name defaults\n * @api public\n * @param {Object} target\n * @param {...Object} sources\n * @return {Object}\n * @example\n * var a = { a: 1 };\n * var b = { a: 2, b: 2 };\n *\n * defaults(a, b);\n * console.log(a); //=> { a: 1, b: 2 }\n */\nvar defaults = function(target /*, ...sources */) {\n // TODO: Replace with `partial` call?\n return defaultsWith.apply(null, [null, target].concat(rest(arguments)));\n};\n\n/*\n * Exports.\n */\n\nmodule.exports = defaults;\nmodule.exports.deep = defaultsDeep;\n","/*! JSON v3.3.2 | https://bestiejs.github.io/json3 | Copyright 2012-2015, Kit Cambridge, Benjamin Tan | http://kit.mit-license.org */\n;(function () {\n // Detect the `define` function exposed by asynchronous module loaders. The\n // strict `define` check is necessary for compatibility with `r.js`.\n var isLoader = typeof define === \"function\" && define.amd;\n\n // A set of types used to distinguish objects from primitives.\n var objectTypes = {\n \"function\": true,\n \"object\": true\n };\n\n // Detect the `exports` object exposed by CommonJS implementations.\n var freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports;\n\n // Use the `global` object exposed by Node (including Browserify via\n // `insert-module-globals`), Narwhal, and Ringo as the default context,\n // and the `window` object in browsers. Rhino exports a `global` function\n // instead.\n var root = objectTypes[typeof window] && window || this,\n freeGlobal = freeExports && objectTypes[typeof module] && module && !module.nodeType && typeof global == \"object\" && global;\n\n if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal || freeGlobal.self === freeGlobal)) {\n root = freeGlobal;\n }\n\n // Public: Initializes JSON 3 using the given `context` object, attaching the\n // `stringify` and `parse` functions to the specified `exports` object.\n function runInContext(context, exports) {\n context || (context = root.Object());\n exports || (exports = root.Object());\n\n // Native constructor aliases.\n var Number = context.Number || root.Number,\n String = context.String || root.String,\n Object = context.Object || root.Object,\n Date = context.Date || root.Date,\n SyntaxError = context.SyntaxError || root.SyntaxError,\n TypeError = context.TypeError || root.TypeError,\n Math = context.Math || root.Math,\n nativeJSON = context.JSON || root.JSON;\n\n // Delegate to the native `stringify` and `parse` implementations.\n if (typeof nativeJSON == \"object\" && nativeJSON) {\n exports.stringify = nativeJSON.stringify;\n exports.parse = nativeJSON.parse;\n }\n\n // Convenience aliases.\n var objectProto = Object.prototype,\n getClass = objectProto.toString,\n isProperty = objectProto.hasOwnProperty,\n undefined;\n\n // Internal: Contains `try...catch` logic used by other functions.\n // This prevents other functions from being deoptimized.\n function attempt(func, errorFunc) {\n try {\n func();\n } catch (exception) {\n if (errorFunc) {\n errorFunc();\n }\n }\n }\n\n // Test the `Date#getUTC*` methods. Based on work by @Yaffle.\n var isExtended = new Date(-3509827334573292);\n attempt(function () {\n // The `getUTCFullYear`, `Month`, and `Date` methods return nonsensical\n // results for certain dates in Opera >= 10.53.\n isExtended = isExtended.getUTCFullYear() == -109252 && isExtended.getUTCMonth() === 0 && isExtended.getUTCDate() === 1 &&\n isExtended.getUTCHours() == 10 && isExtended.getUTCMinutes() == 37 && isExtended.getUTCSeconds() == 6 && isExtended.getUTCMilliseconds() == 708;\n });\n\n // Internal: Determines whether the native `JSON.stringify` and `parse`\n // implementations are spec-compliant. Based on work by Ken Snyder.\n function has(name) {\n if (has[name] != null) {\n // Return cached feature test result.\n return has[name];\n }\n var isSupported;\n if (name == \"bug-string-char-index\") {\n // IE <= 7 doesn't support accessing string characters using square\n // bracket notation. IE 8 only supports this for primitives.\n isSupported = \"a\"[0] != \"a\";\n } else if (name == \"json\") {\n // Indicates whether both `JSON.stringify` and `JSON.parse` are\n // supported.\n isSupported = has(\"json-stringify\") && has(\"date-serialization\") && has(\"json-parse\");\n } else if (name == \"date-serialization\") {\n // Indicates whether `Date`s can be serialized accurately by `JSON.stringify`.\n isSupported = has(\"json-stringify\") && isExtended;\n if (isSupported) {\n var stringify = exports.stringify;\n attempt(function () {\n isSupported =\n // JSON 2, Prototype <= 1.7, and older WebKit builds incorrectly\n // serialize extended years.\n stringify(new Date(-8.64e15)) == '\"-271821-04-20T00:00:00.000Z\"' &&\n // The milliseconds are optional in ES 5, but required in 5.1.\n stringify(new Date(8.64e15)) == '\"+275760-09-13T00:00:00.000Z\"' &&\n // Firefox <= 11.0 incorrectly serializes years prior to 0 as negative\n // four-digit years instead of six-digit years. Credits: @Yaffle.\n stringify(new Date(-621987552e5)) == '\"-000001-01-01T00:00:00.000Z\"' &&\n // Safari <= 5.1.5 and Opera >= 10.53 incorrectly serialize millisecond\n // values less than 1000. Credits: @Yaffle.\n stringify(new Date(-1)) == '\"1969-12-31T23:59:59.999Z\"';\n });\n }\n } else {\n var value, serialized = '{\"a\":[1,true,false,null,\"\\\\u0000\\\\b\\\\n\\\\f\\\\r\\\\t\"]}';\n // Test `JSON.stringify`.\n if (name == \"json-stringify\") {\n var stringify = exports.stringify, stringifySupported = typeof stringify == \"function\";\n if (stringifySupported) {\n // A test function object with a custom `toJSON` method.\n (value = function () {\n return 1;\n }).toJSON = value;\n attempt(function () {\n stringifySupported =\n // Firefox 3.1b1 and b2 serialize string, number, and boolean\n // primitives as object literals.\n stringify(0) === \"0\" &&\n // FF 3.1b1, b2, and JSON 2 serialize wrapped primitives as object\n // literals.\n stringify(new Number()) === \"0\" &&\n stringify(new String()) == '\"\"' &&\n // FF 3.1b1, 2 throw an error if the value is `null`, `undefined`, or\n // does not define a canonical JSON representation (this applies to\n // objects with `toJSON` properties as well, *unless* they are nested\n // within an object or array).\n stringify(getClass) === undefined &&\n // IE 8 serializes `undefined` as `\"undefined\"`. Safari <= 5.1.7 and\n // FF 3.1b3 pass this test.\n stringify(undefined) === undefined &&\n // Safari <= 5.1.7 and FF 3.1b3 throw `Error`s and `TypeError`s,\n // respectively, if the value is omitted entirely.\n stringify() === undefined &&\n // FF 3.1b1, 2 throw an error if the given value is not a number,\n // string, array, object, Boolean, or `null` literal. This applies to\n // objects with custom `toJSON` methods as well, unless they are nested\n // inside object or array literals. YUI 3.0.0b1 ignores custom `toJSON`\n // methods entirely.\n stringify(value) === \"1\" &&\n stringify([value]) == \"[1]\" &&\n // Prototype <= 1.6.1 serializes `[undefined]` as `\"[]\"` instead of\n // `\"[null]\"`.\n stringify([undefined]) == \"[null]\" &&\n // YUI 3.0.0b1 fails to serialize `null` literals.\n stringify(null) == \"null\" &&\n // FF 3.1b1, 2 halts serialization if an array contains a function:\n // `[1, true, getClass, 1]` serializes as \"[1,true,],\". FF 3.1b3\n // elides non-JSON values from objects and arrays, unless they\n // define custom `toJSON` methods.\n stringify([undefined, getClass, null]) == \"[null,null,null]\" &&\n // Simple serialization test. FF 3.1b1 uses Unicode escape sequences\n // where character escape codes are expected (e.g., `\\b` => `\\u0008`).\n stringify({ \"a\": [value, true, false, null, \"\\x00\\b\\n\\f\\r\\t\"] }) == serialized &&\n // FF 3.1b1 and b2 ignore the `filter` and `width` arguments.\n stringify(null, value) === \"1\" &&\n stringify([1, 2], null, 1) == \"[\\n 1,\\n 2\\n]\";\n }, function () {\n stringifySupported = false;\n });\n }\n isSupported = stringifySupported;\n }\n // Test `JSON.parse`.\n if (name == \"json-parse\") {\n var parse = exports.parse, parseSupported;\n if (typeof parse == \"function\") {\n attempt(function () {\n // FF 3.1b1, b2 will throw an exception if a bare literal is provided.\n // Conforming implementations should also coerce the initial argument to\n // a string prior to parsing.\n if (parse(\"0\") === 0 && !parse(false)) {\n // Simple parsing test.\n value = parse(serialized);\n parseSupported = value[\"a\"].length == 5 && value[\"a\"][0] === 1;\n if (parseSupported) {\n attempt(function () {\n // Safari <= 5.1.2 and FF 3.1b1 allow unescaped tabs in strings.\n parseSupported = !parse('\"\\t\"');\n });\n if (parseSupported) {\n attempt(function () {\n // FF 4.0 and 4.0.1 allow leading `+` signs and leading\n // decimal points. FF 4.0, 4.0.1, and IE 9-10 also allow\n // certain octal literals.\n parseSupported = parse(\"01\") !== 1;\n });\n }\n if (parseSupported) {\n attempt(function () {\n // FF 4.0, 4.0.1, and Rhino 1.7R3-R4 allow trailing decimal\n // points. These environments, along with FF 3.1b1 and 2,\n // also allow trailing commas in JSON objects and arrays.\n parseSupported = parse(\"1.\") !== 1;\n });\n }\n }\n }\n }, function () {\n parseSupported = false;\n });\n }\n isSupported = parseSupported;\n }\n }\n return has[name] = !!isSupported;\n }\n has[\"bug-string-char-index\"] = has[\"date-serialization\"] = has[\"json\"] = has[\"json-stringify\"] = has[\"json-parse\"] = null;\n\n if (!has(\"json\")) {\n // Common `[[Class]]` name aliases.\n var functionClass = \"[object Function]\",\n dateClass = \"[object Date]\",\n numberClass = \"[object Number]\",\n stringClass = \"[object String]\",\n arrayClass = \"[object Array]\",\n booleanClass = \"[object Boolean]\";\n\n // Detect incomplete support for accessing string characters by index.\n var charIndexBuggy = has(\"bug-string-char-index\");\n\n // Internal: Normalizes the `for...in` iteration algorithm across\n // environments. Each enumerated key is yielded to a `callback` function.\n var forOwn = function (object, callback) {\n var size = 0, Properties, dontEnums, property;\n\n // Tests for bugs in the current environment's `for...in` algorithm. The\n // `valueOf` property inherits the non-enumerable flag from\n // `Object.prototype` in older versions of IE, Netscape, and Mozilla.\n (Properties = function () {\n this.valueOf = 0;\n }).prototype.valueOf = 0;\n\n // Iterate over a new instance of the `Properties` class.\n dontEnums = new Properties();\n for (property in dontEnums) {\n // Ignore all properties inherited from `Object.prototype`.\n if (isProperty.call(dontEnums, property)) {\n size++;\n }\n }\n Properties = dontEnums = null;\n\n // Normalize the iteration algorithm.\n if (!size) {\n // A list of non-enumerable properties inherited from `Object.prototype`.\n dontEnums = [\"valueOf\", \"toString\", \"toLocaleString\", \"propertyIsEnumerable\", \"isPrototypeOf\", \"hasOwnProperty\", \"constructor\"];\n // IE <= 8, Mozilla 1.0, and Netscape 6.2 ignore shadowed non-enumerable\n // properties.\n forOwn = function (object, callback) {\n var isFunction = getClass.call(object) == functionClass, property, length;\n var hasProperty = !isFunction && typeof object.constructor != \"function\" && objectTypes[typeof object.hasOwnProperty] && object.hasOwnProperty || isProperty;\n for (property in object) {\n // Gecko <= 1.0 enumerates the `prototype` property of functions under\n // certain conditions; IE does not.\n if (!(isFunction && property == \"prototype\") && hasProperty.call(object, property)) {\n callback(property);\n }\n }\n // Manually invoke the callback for each non-enumerable property.\n for (length = dontEnums.length; property = dontEnums[--length];) {\n if (hasProperty.call(object, property)) {\n callback(property);\n }\n }\n };\n } else {\n // No bugs detected; use the standard `for...in` algorithm.\n forOwn = function (object, callback) {\n var isFunction = getClass.call(object) == functionClass, property, isConstructor;\n for (property in object) {\n if (!(isFunction && property == \"prototype\") && isProperty.call(object, property) && !(isConstructor = property === \"constructor\")) {\n callback(property);\n }\n }\n // Manually invoke the callback for the `constructor` property due to\n // cross-environment inconsistencies.\n if (isConstructor || isProperty.call(object, (property = \"constructor\"))) {\n callback(property);\n }\n };\n }\n return forOwn(object, callback);\n };\n\n // Public: Serializes a JavaScript `value` as a JSON string. The optional\n // `filter` argument may specify either a function that alters how object and\n // array members are serialized, or an array of strings and numbers that\n // indicates which properties should be serialized. The optional `width`\n // argument may be either a string or number that specifies the indentation\n // level of the output.\n if (!has(\"json-stringify\") && !has(\"date-serialization\")) {\n // Internal: A map of control characters and their escaped equivalents.\n var Escapes = {\n 92: \"\\\\\\\\\",\n 34: '\\\\\"',\n 8: \"\\\\b\",\n 12: \"\\\\f\",\n 10: \"\\\\n\",\n 13: \"\\\\r\",\n 9: \"\\\\t\"\n };\n\n // Internal: Converts `value` into a zero-padded string such that its\n // length is at least equal to `width`. The `width` must be <= 6.\n var leadingZeroes = \"000000\";\n var toPaddedString = function (width, value) {\n // The `|| 0` expression is necessary to work around a bug in\n // Opera <= 7.54u2 where `0 == -0`, but `String(-0) !== \"0\"`.\n return (leadingZeroes + (value || 0)).slice(-width);\n };\n\n // Internal: Serializes a date object.\n var serializeDate = function (value) {\n var getData, year, month, date, time, hours, minutes, seconds, milliseconds;\n // Define additional utility methods if the `Date` methods are buggy.\n if (!isExtended) {\n var floor = Math.floor;\n // A mapping between the months of the year and the number of days between\n // January 1st and the first of the respective month.\n var Months = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334];\n // Internal: Calculates the number of days between the Unix epoch and the\n // first day of the given month.\n var getDay = function (year, month) {\n return Months[month] + 365 * (year - 1970) + floor((year - 1969 + (month = +(month > 1))) / 4) - floor((year - 1901 + month) / 100) + floor((year - 1601 + month) / 400);\n };\n getData = function (value) {\n // Manually compute the year, month, date, hours, minutes,\n // seconds, and milliseconds if the `getUTC*` methods are\n // buggy. Adapted from @Yaffle's `date-shim` project.\n date = floor(value / 864e5);\n for (year = floor(date / 365.2425) + 1970 - 1; getDay(year + 1, 0) <= date; year++);\n for (month = floor((date - getDay(year, 0)) / 30.42); getDay(year, month + 1) <= date; month++);\n date = 1 + date - getDay(year, month);\n // The `time` value specifies the time within the day (see ES\n // 5.1 section 15.9.1.2). The formula `(A % B + B) % B` is used\n // to compute `A modulo B`, as the `%` operator does not\n // correspond to the `modulo` operation for negative numbers.\n time = (value % 864e5 + 864e5) % 864e5;\n // The hours, minutes, seconds, and milliseconds are obtained by\n // decomposing the time within the day. See section 15.9.1.10.\n hours = floor(time / 36e5) % 24;\n minutes = floor(time / 6e4) % 60;\n seconds = floor(time / 1e3) % 60;\n milliseconds = time % 1e3;\n };\n } else {\n getData = function (value) {\n year = value.getUTCFullYear();\n month = value.getUTCMonth();\n date = value.getUTCDate();\n hours = value.getUTCHours();\n minutes = value.getUTCMinutes();\n seconds = value.getUTCSeconds();\n milliseconds = value.getUTCMilliseconds();\n };\n }\n serializeDate = function (value) {\n if (value > -1 / 0 && value < 1 / 0) {\n // Dates are serialized according to the `Date#toJSON` method\n // specified in ES 5.1 section 15.9.5.44. See section 15.9.1.15\n // for the ISO 8601 date time string format.\n getData(value);\n // Serialize extended years correctly.\n value = (year <= 0 || year >= 1e4 ? (year < 0 ? \"-\" : \"+\") + toPaddedString(6, year < 0 ? -year : year) : toPaddedString(4, year)) +\n \"-\" + toPaddedString(2, month + 1) + \"-\" + toPaddedString(2, date) +\n // Months, dates, hours, minutes, and seconds should have two\n // digits; milliseconds should have three.\n \"T\" + toPaddedString(2, hours) + \":\" + toPaddedString(2, minutes) + \":\" + toPaddedString(2, seconds) +\n // Milliseconds are optional in ES 5.0, but required in 5.1.\n \".\" + toPaddedString(3, milliseconds) + \"Z\";\n year = month = date = hours = minutes = seconds = milliseconds = null;\n } else {\n value = null;\n }\n return value;\n };\n return serializeDate(value);\n };\n\n // For environments with `JSON.stringify` but buggy date serialization,\n // we override the native `Date#toJSON` implementation with a\n // spec-compliant one.\n if (has(\"json-stringify\") && !has(\"date-serialization\")) {\n // Internal: the `Date#toJSON` implementation used to override the native one.\n function dateToJSON (key) {\n return serializeDate(this);\n }\n\n // Public: `JSON.stringify`. See ES 5.1 section 15.12.3.\n var nativeStringify = exports.stringify;\n exports.stringify = function (source, filter, width) {\n var nativeToJSON = Date.prototype.toJSON;\n Date.prototype.toJSON = dateToJSON;\n var result = nativeStringify(source, filter, width);\n Date.prototype.toJSON = nativeToJSON;\n return result;\n }\n } else {\n // Internal: Double-quotes a string `value`, replacing all ASCII control\n // characters (characters with code unit values between 0 and 31) with\n // their escaped equivalents. This is an implementation of the\n // `Quote(value)` operation defined in ES 5.1 section 15.12.3.\n var unicodePrefix = \"\\\\u00\";\n var escapeChar = function (character) {\n var charCode = character.charCodeAt(0), escaped = Escapes[charCode];\n if (escaped) {\n return escaped;\n }\n return unicodePrefix + toPaddedString(2, charCode.toString(16));\n };\n var reEscape = /[\\x00-\\x1f\\x22\\x5c]/g;\n var quote = function (value) {\n reEscape.lastIndex = 0;\n return '\"' +\n (\n reEscape.test(value)\n ? value.replace(reEscape, escapeChar)\n : value\n ) +\n '\"';\n };\n\n // Internal: Recursively serializes an object. Implements the\n // `Str(key, holder)`, `JO(value)`, and `JA(value)` operations.\n var serialize = function (property, object, callback, properties, whitespace, indentation, stack) {\n var value, type, className, results, element, index, length, prefix, result;\n attempt(function () {\n // Necessary for host object support.\n value = object[property];\n });\n if (typeof value == \"object\" && value) {\n if (value.getUTCFullYear && getClass.call(value) == dateClass && value.toJSON === Date.prototype.toJSON) {\n value = serializeDate(value);\n } else if (typeof value.toJSON == \"function\") {\n value = value.toJSON(property);\n }\n }\n if (callback) {\n // If a replacement function was provided, call it to obtain the value\n // for serialization.\n value = callback.call(object, property, value);\n }\n // Exit early if value is `undefined` or `null`.\n if (value == undefined) {\n return value === undefined ? value : \"null\";\n }\n type = typeof value;\n // Only call `getClass` if the value is an object.\n if (type == \"object\") {\n className = getClass.call(value);\n }\n switch (className || type) {\n case \"boolean\":\n case booleanClass:\n // Booleans are represented literally.\n return \"\" + value;\n case \"number\":\n case numberClass:\n // JSON numbers must be finite. `Infinity` and `NaN` are serialized as\n // `\"null\"`.\n return value > -1 / 0 && value < 1 / 0 ? \"\" + value : \"null\";\n case \"string\":\n case stringClass:\n // Strings are double-quoted and escaped.\n return quote(\"\" + value);\n }\n // Recursively serialize objects and arrays.\n if (typeof value == \"object\") {\n // Check for cyclic structures. This is a linear search; performance\n // is inversely proportional to the number of unique nested objects.\n for (length = stack.length; length--;) {\n if (stack[length] === value) {\n // Cyclic structures cannot be serialized by `JSON.stringify`.\n throw TypeError();\n }\n }\n // Add the object to the stack of traversed objects.\n stack.push(value);\n results = [];\n // Save the current indentation level and indent one additional level.\n prefix = indentation;\n indentation += whitespace;\n if (className == arrayClass) {\n // Recursively serialize array elements.\n for (index = 0, length = value.length; index < length; index++) {\n element = serialize(index, value, callback, properties, whitespace, indentation, stack);\n results.push(element === undefined ? \"null\" : element);\n }\n result = results.length ? (whitespace ? \"[\\n\" + indentation + results.join(\",\\n\" + indentation) + \"\\n\" + prefix + \"]\" : (\"[\" + results.join(\",\") + \"]\")) : \"[]\";\n } else {\n // Recursively serialize object members. Members are selected from\n // either a user-specified list of property names, or the object\n // itself.\n forOwn(properties || value, function (property) {\n var element = serialize(property, value, callback, properties, whitespace, indentation, stack);\n if (element !== undefined) {\n // According to ES 5.1 section 15.12.3: \"If `gap` {whitespace}\n // is not the empty string, let `member` {quote(property) + \":\"}\n // be the concatenation of `member` and the `space` character.\"\n // The \"`space` character\" refers to the literal space\n // character, not the `space` {width} argument provided to\n // `JSON.stringify`.\n results.push(quote(property) + \":\" + (whitespace ? \" \" : \"\") + element);\n }\n });\n result = results.length ? (whitespace ? \"{\\n\" + indentation + results.join(\",\\n\" + indentation) + \"\\n\" + prefix + \"}\" : (\"{\" + results.join(\",\") + \"}\")) : \"{}\";\n }\n // Remove the object from the traversed object stack.\n stack.pop();\n return result;\n }\n };\n\n // Public: `JSON.stringify`. See ES 5.1 section 15.12.3.\n exports.stringify = function (source, filter, width) {\n var whitespace, callback, properties, className;\n if (objectTypes[typeof filter] && filter) {\n className = getClass.call(filter);\n if (className == functionClass) {\n callback = filter;\n } else if (className == arrayClass) {\n // Convert the property names array into a makeshift set.\n properties = {};\n for (var index = 0, length = filter.length, value; index < length;) {\n value = filter[index++];\n className = getClass.call(value);\n if (className == \"[object String]\" || className == \"[object Number]\") {\n properties[value] = 1;\n }\n }\n }\n }\n if (width) {\n className = getClass.call(width);\n if (className == numberClass) {\n // Convert the `width` to an integer and create a string containing\n // `width` number of space characters.\n if ((width -= width % 1) > 0) {\n if (width > 10) {\n width = 10;\n }\n for (whitespace = \"\"; whitespace.length < width;) {\n whitespace += \" \";\n }\n }\n } else if (className == stringClass) {\n whitespace = width.length <= 10 ? width : width.slice(0, 10);\n }\n }\n // Opera <= 7.54u2 discards the values associated with empty string keys\n // (`\"\"`) only if they are used directly within an object member list\n // (e.g., `!(\"\" in { \"\": 1})`).\n return serialize(\"\", (value = {}, value[\"\"] = source, value), callback, properties, whitespace, \"\", []);\n };\n }\n }\n\n // Public: Parses a JSON source string.\n if (!has(\"json-parse\")) {\n var fromCharCode = String.fromCharCode;\n\n // Internal: A map of escaped control characters and their unescaped\n // equivalents.\n var Unescapes = {\n 92: \"\\\\\",\n 34: '\"',\n 47: \"/\",\n 98: \"\\b\",\n 116: \"\\t\",\n 110: \"\\n\",\n 102: \"\\f\",\n 114: \"\\r\"\n };\n\n // Internal: Stores the parser state.\n var Index, Source;\n\n // Internal: Resets the parser state and throws a `SyntaxError`.\n var abort = function () {\n Index = Source = null;\n throw SyntaxError();\n };\n\n // Internal: Returns the next token, or `\"$\"` if the parser has reached\n // the end of the source string. A token may be a string, number, `null`\n // literal, or Boolean literal.\n var lex = function () {\n var source = Source, length = source.length, value, begin, position, isSigned, charCode;\n while (Index < length) {\n charCode = source.charCodeAt(Index);\n switch (charCode) {\n case 9: case 10: case 13: case 32:\n // Skip whitespace tokens, including tabs, carriage returns, line\n // feeds, and space characters.\n Index++;\n break;\n case 123: case 125: case 91: case 93: case 58: case 44:\n // Parse a punctuator token (`{`, `}`, `[`, `]`, `:`, or `,`) at\n // the current position.\n value = charIndexBuggy ? source.charAt(Index) : source[Index];\n Index++;\n return value;\n case 34:\n // `\"` delimits a JSON string; advance to the next character and\n // begin parsing the string. String tokens are prefixed with the\n // sentinel `@` character to distinguish them from punctuators and\n // end-of-string tokens.\n for (value = \"@\", Index++; Index < length;) {\n charCode = source.charCodeAt(Index);\n if (charCode < 32) {\n // Unescaped ASCII control characters (those with a code unit\n // less than the space character) are not permitted.\n abort();\n } else if (charCode == 92) {\n // A reverse solidus (`\\`) marks the beginning of an escaped\n // control character (including `\"`, `\\`, and `/`) or Unicode\n // escape sequence.\n charCode = source.charCodeAt(++Index);\n switch (charCode) {\n case 92: case 34: case 47: case 98: case 116: case 110: case 102: case 114:\n // Revive escaped control characters.\n value += Unescapes[charCode];\n Index++;\n break;\n case 117:\n // `\\u` marks the beginning of a Unicode escape sequence.\n // Advance to the first character and validate the\n // four-digit code point.\n begin = ++Index;\n for (position = Index + 4; Index < position; Index++) {\n charCode = source.charCodeAt(Index);\n // A valid sequence comprises four hexdigits (case-\n // insensitive) that form a single hexadecimal value.\n if (!(charCode >= 48 && charCode <= 57 || charCode >= 97 && charCode <= 102 || charCode >= 65 && charCode <= 70)) {\n // Invalid Unicode escape sequence.\n abort();\n }\n }\n // Revive the escaped character.\n value += fromCharCode(\"0x\" + source.slice(begin, Index));\n break;\n default:\n // Invalid escape sequence.\n abort();\n }\n } else {\n if (charCode == 34) {\n // An unescaped double-quote character marks the end of the\n // string.\n break;\n }\n charCode = source.charCodeAt(Index);\n begin = Index;\n // Optimize for the common case where a string is valid.\n while (charCode >= 32 && charCode != 92 && charCode != 34) {\n charCode = source.charCodeAt(++Index);\n }\n // Append the string as-is.\n value += source.slice(begin, Index);\n }\n }\n if (source.charCodeAt(Index) == 34) {\n // Advance to the next character and return the revived string.\n Index++;\n return value;\n }\n // Unterminated string.\n abort();\n default:\n // Parse numbers and literals.\n begin = Index;\n // Advance past the negative sign, if one is specified.\n if (charCode == 45) {\n isSigned = true;\n charCode = source.charCodeAt(++Index);\n }\n // Parse an integer or floating-point value.\n if (charCode >= 48 && charCode <= 57) {\n // Leading zeroes are interpreted as octal literals.\n if (charCode == 48 && ((charCode = source.charCodeAt(Index + 1)), charCode >= 48 && charCode <= 57)) {\n // Illegal octal literal.\n abort();\n }\n isSigned = false;\n // Parse the integer component.\n for (; Index < length && ((charCode = source.charCodeAt(Index)), charCode >= 48 && charCode <= 57); Index++);\n // Floats cannot contain a leading decimal point; however, this\n // case is already accounted for by the parser.\n if (source.charCodeAt(Index) == 46) {\n position = ++Index;\n // Parse the decimal component.\n for (; position < length; position++) {\n charCode = source.charCodeAt(position);\n if (charCode < 48 || charCode > 57) {\n break;\n }\n }\n if (position == Index) {\n // Illegal trailing decimal.\n abort();\n }\n Index = position;\n }\n // Parse exponents. The `e` denoting the exponent is\n // case-insensitive.\n charCode = source.charCodeAt(Index);\n if (charCode == 101 || charCode == 69) {\n charCode = source.charCodeAt(++Index);\n // Skip past the sign following the exponent, if one is\n // specified.\n if (charCode == 43 || charCode == 45) {\n Index++;\n }\n // Parse the exponential component.\n for (position = Index; position < length; position++) {\n charCode = source.charCodeAt(position);\n if (charCode < 48 || charCode > 57) {\n break;\n }\n }\n if (position == Index) {\n // Illegal empty exponent.\n abort();\n }\n Index = position;\n }\n // Coerce the parsed value to a JavaScript number.\n return +source.slice(begin, Index);\n }\n // A negative sign may only precede numbers.\n if (isSigned) {\n abort();\n }\n // `true`, `false`, and `null` literals.\n var temp = source.slice(Index, Index + 4);\n if (temp == \"true\") {\n Index += 4;\n return true;\n } else if (temp == \"fals\" && source.charCodeAt(Index + 4 ) == 101) {\n Index += 5;\n return false;\n } else if (temp == \"null\") {\n Index += 4;\n return null;\n }\n // Unrecognized token.\n abort();\n }\n }\n // Return the sentinel `$` character if the parser has reached the end\n // of the source string.\n return \"$\";\n };\n\n // Internal: Parses a JSON `value` token.\n var get = function (value) {\n var results, hasMembers;\n if (value == \"$\") {\n // Unexpected end of input.\n abort();\n }\n if (typeof value == \"string\") {\n if ((charIndexBuggy ? value.charAt(0) : value[0]) == \"@\") {\n // Remove the sentinel `@` character.\n return value.slice(1);\n }\n // Parse object and array literals.\n if (value == \"[\") {\n // Parses a JSON array, returning a new JavaScript array.\n results = [];\n for (;;) {\n value = lex();\n // A closing square bracket marks the end of the array literal.\n if (value == \"]\") {\n break;\n }\n // If the array literal contains elements, the current token\n // should be a comma separating the previous element from the\n // next.\n if (hasMembers) {\n if (value == \",\") {\n value = lex();\n if (value == \"]\") {\n // Unexpected trailing `,` in array literal.\n abort();\n }\n } else {\n // A `,` must separate each array element.\n abort();\n }\n } else {\n hasMembers = true;\n }\n // Elisions and leading commas are not permitted.\n if (value == \",\") {\n abort();\n }\n results.push(get(value));\n }\n return results;\n } else if (value == \"{\") {\n // Parses a JSON object, returning a new JavaScript object.\n results = {};\n for (;;) {\n value = lex();\n // A closing curly brace marks the end of the object literal.\n if (value == \"}\") {\n break;\n }\n // If the object literal contains members, the current token\n // should be a comma separator.\n if (hasMembers) {\n if (value == \",\") {\n value = lex();\n if (value == \"}\") {\n // Unexpected trailing `,` in object literal.\n abort();\n }\n } else {\n // A `,` must separate each object member.\n abort();\n }\n } else {\n hasMembers = true;\n }\n // Leading commas are not permitted, object property names must be\n // double-quoted strings, and a `:` must separate each property\n // name and value.\n if (value == \",\" || typeof value != \"string\" || (charIndexBuggy ? value.charAt(0) : value[0]) != \"@\" || lex() != \":\") {\n abort();\n }\n results[value.slice(1)] = get(lex());\n }\n return results;\n }\n // Unexpected token encountered.\n abort();\n }\n return value;\n };\n\n // Internal: Updates a traversed object member.\n var update = function (source, property, callback) {\n var element = walk(source, property, callback);\n if (element === undefined) {\n delete source[property];\n } else {\n source[property] = element;\n }\n };\n\n // Internal: Recursively traverses a parsed JSON object, invoking the\n // `callback` function for each value. This is an implementation of the\n // `Walk(holder, name)` operation defined in ES 5.1 section 15.12.2.\n var walk = function (source, property, callback) {\n var value = source[property], length;\n if (typeof value == \"object\" && value) {\n // `forOwn` can't be used to traverse an array in Opera <= 8.54\n // because its `Object#hasOwnProperty` implementation returns `false`\n // for array indices (e.g., `![1, 2, 3].hasOwnProperty(\"0\")`).\n if (getClass.call(value) == arrayClass) {\n for (length = value.length; length--;) {\n update(getClass, forOwn, value, length, callback);\n }\n } else {\n forOwn(value, function (property) {\n update(value, property, callback);\n });\n }\n }\n return callback.call(source, property, value);\n };\n\n // Public: `JSON.parse`. See ES 5.1 section 15.12.2.\n exports.parse = function (source, callback) {\n var result, value;\n Index = 0;\n Source = \"\" + source;\n result = get(lex());\n // If a JSON string contains multiple tokens, it is invalid.\n if (lex() != \"$\") {\n abort();\n }\n // Reset the parser state.\n Index = Source = null;\n return callback && getClass.call(callback) == functionClass ? walk((value = {}, value[\"\"] = result, value), \"\", callback) : result;\n };\n }\n }\n\n exports.runInContext = runInContext;\n return exports;\n }\n\n if (freeExports && !isLoader) {\n // Export for CommonJS environments.\n runInContext(root, freeExports);\n } else {\n // Export for web browsers and JavaScript engines.\n var nativeJSON = root.JSON,\n previousJSON = root.JSON3,\n isRestored = false;\n\n var JSON3 = runInContext(root, (root.JSON3 = {\n // Public: Restores the original value of the global `JSON` object and\n // returns a reference to the `JSON3` object.\n \"noConflict\": function () {\n if (!isRestored) {\n isRestored = true;\n root.JSON = nativeJSON;\n root.JSON3 = previousJSON;\n nativeJSON = previousJSON = null;\n }\n return JSON3;\n }\n }));\n\n root.JSON = {\n \"parse\": JSON3.parse,\n \"stringify\": JSON3.stringify\n };\n }\n\n // Export for asynchronous module loaders.\n if (isLoader) {\n define(function () {\n return JSON3;\n });\n }\n}).call(this);\n","\n/**\n * Parse the given `url`.\n *\n * @param {String} str\n * @return {Object}\n * @api public\n */\n\nexports.parse = function(url){\n var a = document.createElement('a');\n a.href = url;\n return {\n href: a.href,\n host: a.host || location.host,\n port: ('0' === a.port || '' === a.port) ? port(a.protocol) : a.port,\n hash: a.hash,\n hostname: a.hostname || location.hostname,\n pathname: a.pathname.charAt(0) != '/' ? '/' + a.pathname : a.pathname,\n protocol: !a.protocol || ':' == a.protocol ? location.protocol : a.protocol,\n search: a.search,\n query: a.search.slice(1)\n };\n};\n\n/**\n * Check if `url` is absolute.\n *\n * @param {String} url\n * @return {Boolean}\n * @api public\n */\n\nexports.isAbsolute = function(url){\n return 0 == url.indexOf('//') || !!~url.indexOf('://');\n};\n\n/**\n * Check if `url` is relative.\n *\n * @param {String} url\n * @return {Boolean}\n * @api public\n */\n\nexports.isRelative = function(url){\n return !exports.isAbsolute(url);\n};\n\n/**\n * Check if `url` is cross domain.\n *\n * @param {String} url\n * @return {Boolean}\n * @api public\n */\n\nexports.isCrossDomain = function(url){\n url = exports.parse(url);\n var location = exports.parse(window.location.href);\n return url.hostname !== location.hostname\n || url.port !== location.port\n || url.protocol !== location.protocol;\n};\n\n/**\n * Return default port for `protocol`.\n *\n * @param {String} protocol\n * @return {String}\n * @api private\n */\nfunction port (protocol){\n switch (protocol) {\n case 'http:':\n return 80;\n case 'https:':\n return 443;\n default:\n return location.port;\n }\n}\n","\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = debug;\nexports.coerce = coerce;\nexports.disable = disable;\nexports.enable = enable;\nexports.enabled = enabled;\nexports.humanize = require('ms');\n\n/**\n * The currently active debug mode names, and names to skip.\n */\n\nexports.names = [];\nexports.skips = [];\n\n/**\n * Map of special \"%n\" handling functions, for the debug \"format\" argument.\n *\n * Valid key names are a single, lowercased letter, i.e. \"n\".\n */\n\nexports.formatters = {};\n\n/**\n * Previously assigned color.\n */\n\nvar prevColor = 0;\n\n/**\n * Previous log timestamp.\n */\n\nvar prevTime;\n\n/**\n * Select a color.\n *\n * @return {Number}\n * @api private\n */\n\nfunction selectColor() {\n return exports.colors[prevColor++ % exports.colors.length];\n}\n\n/**\n * Create a debugger with the given `namespace`.\n *\n * @param {String} namespace\n * @return {Function}\n * @api public\n */\n\nfunction debug(namespace) {\n\n // define the `disabled` version\n function disabled() {\n }\n disabled.enabled = false;\n\n // define the `enabled` version\n function enabled() {\n\n var self = enabled;\n\n // set `diff` timestamp\n var curr = +new Date();\n var ms = curr - (prevTime || curr);\n self.diff = ms;\n self.prev = prevTime;\n self.curr = curr;\n prevTime = curr;\n\n // add the `color` if not set\n if (null == self.useColors) self.useColors = exports.useColors();\n if (null == self.color && self.useColors) self.color = selectColor();\n\n var args = Array.prototype.slice.call(arguments);\n\n args[0] = exports.coerce(args[0]);\n\n if ('string' !== typeof args[0]) {\n // anything else let's inspect with %o\n args = ['%o'].concat(args);\n }\n\n // apply any `formatters` transformations\n var index = 0;\n args[0] = args[0].replace(/%([a-z%])/g, function(match, format) {\n // if we encounter an escaped % then don't increase the array index\n if (match === '%%') return match;\n index++;\n var formatter = exports.formatters[format];\n if ('function' === typeof formatter) {\n var val = args[index];\n match = formatter.call(self, val);\n\n // now we need to remove `args[index]` since it's inlined in the `format`\n args.splice(index, 1);\n index--;\n }\n return match;\n });\n\n if ('function' === typeof exports.formatArgs) {\n args = exports.formatArgs.apply(self, args);\n }\n var logFn = enabled.log || exports.log || console.log.bind(console);\n logFn.apply(self, args);\n }\n enabled.enabled = true;\n\n var fn = exports.enabled(namespace) ? enabled : disabled;\n\n fn.namespace = namespace;\n\n return fn;\n}\n\n/**\n * Enables a debug mode by namespaces. This can include modes\n * separated by a colon and wildcards.\n *\n * @param {String} namespaces\n * @api public\n */\n\nfunction enable(namespaces) {\n exports.save(namespaces);\n\n var split = (namespaces || '').split(/[\\s,]+/);\n var len = split.length;\n\n for (var i = 0; i < len; i++) {\n if (!split[i]) continue; // ignore empty strings\n namespaces = split[i].replace(/\\*/g, '.*?');\n if (namespaces[0] === '-') {\n exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));\n } else {\n exports.names.push(new RegExp('^' + namespaces + '$'));\n }\n }\n}\n\n/**\n * Disable debug output.\n *\n * @api public\n */\n\nfunction disable() {\n exports.enable('');\n}\n\n/**\n * Returns true if the given mode name is enabled, false otherwise.\n *\n * @param {String} name\n * @return {Boolean}\n * @api public\n */\n\nfunction enabled(name) {\n var i, len;\n for (i = 0, len = exports.skips.length; i < len; i++) {\n if (exports.skips[i].test(name)) {\n return false;\n }\n }\n for (i = 0, len = exports.names.length; i < len; i++) {\n if (exports.names[i].test(name)) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Coerce `val`.\n *\n * @param {Mixed} val\n * @return {Mixed}\n * @api private\n */\n\nfunction coerce(val) {\n if (val instanceof Error) return val.stack || val.message;\n return val;\n}\n","\n/**\n * This is the web browser implementation of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = require('./debug');\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = 'undefined' != typeof chrome\n && 'undefined' != typeof chrome.storage\n ? chrome.storage.local\n : localstorage();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n 'lightseagreen',\n 'forestgreen',\n 'goldenrod',\n 'dodgerblue',\n 'darkorchid',\n 'crimson'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\nfunction useColors() {\n // is webkit? http://stackoverflow.com/a/16459606/376773\n return ('WebkitAppearance' in document.documentElement.style) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (window.console && (console.firebug || (console.exception && console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31);\n}\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nexports.formatters.j = function(v) {\n return JSON.stringify(v);\n};\n\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs() {\n var args = arguments;\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return args;\n\n var c = 'color: ' + this.color;\n args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n return args;\n}\n\n/**\n * Invokes `console.log()` when available.\n * No-op when `console.log` is not a \"function\".\n *\n * @api public\n */\n\nfunction log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console\n && console.log\n && Function.prototype.apply.call(console.log, console, arguments);\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\n\nfunction save(namespaces) {\n try {\n if (null == namespaces) {\n exports.storage.removeItem('debug');\n } else {\n exports.storage.debug = namespaces;\n }\n } catch(e) {}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\nfunction load() {\n var r;\n try {\n r = exports.storage.debug;\n } catch(e) {}\n return r;\n}\n\n/**\n * Enable namespaces listed in `localStorage.debug` initially.\n */\n\nexports.enable(load());\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage(){\n try {\n return window.localStorage;\n } catch (e) {}\n}\n","\n/**\n * Module dependencies.\n */\n\nvar debug = require('debug')('cookie');\n\n/**\n * Set or get cookie `name` with `value` and `options` object.\n *\n * @param {String} name\n * @param {String} value\n * @param {Object} options\n * @return {Mixed}\n * @api public\n */\n\nmodule.exports = function(name, value, options){\n switch (arguments.length) {\n case 3:\n case 2:\n return set(name, value, options);\n case 1:\n return get(name);\n default:\n return all();\n }\n};\n\n/**\n * Set cookie `name` to `value`.\n *\n * @param {String} name\n * @param {String} value\n * @param {Object} options\n * @api private\n */\n\nfunction set(name, value, options) {\n options = options || {};\n var str = encode(name) + '=' + encode(value);\n\n if (null == value) options.maxage = -1;\n\n if (options.maxage) {\n options.expires = new Date(+new Date + options.maxage);\n }\n\n if (options.path) str += '; path=' + options.path;\n if (options.domain) str += '; domain=' + options.domain;\n if (options.expires) str += '; expires=' + options.expires.toUTCString();\n if (options.secure) str += '; secure';\n\n document.cookie = str;\n}\n\n/**\n * Return all cookies.\n *\n * @return {Object}\n * @api private\n */\n\nfunction all() {\n var str;\n try {\n str = document.cookie;\n } catch (err) {\n if (typeof console !== 'undefined' && typeof console.error === 'function') {\n console.error(err.stack || err);\n }\n return {};\n }\n return parse(str);\n}\n\n/**\n * Get cookie `name`.\n *\n * @param {String} name\n * @return {String}\n * @api private\n */\n\nfunction get(name) {\n return all()[name];\n}\n\n/**\n * Parse cookie `str`.\n *\n * @param {String} str\n * @return {Object}\n * @api private\n */\n\nfunction parse(str) {\n var obj = {};\n var pairs = str.split(/ *; */);\n var pair;\n if ('' == pairs[0]) return obj;\n for (var i = 0; i < pairs.length; ++i) {\n pair = pairs[i].split('=');\n obj[decode(pair[0])] = decode(pair[1]);\n }\n return obj;\n}\n\n/**\n * Encode.\n */\n\nfunction encode(value){\n try {\n return encodeURIComponent(value);\n } catch (e) {\n debug('error `encode(%o)` - %o', value, e)\n }\n}\n\n/**\n * Decode.\n */\n\nfunction decode(value) {\n try {\n return decodeURIComponent(value);\n } catch (e) {\n debug('error `decode(%o)` - %o', value, e)\n }\n}\n","'use strict';\n\n/**\n * Module dependencies.\n */\n\nvar parse = require('component-url').parse;\nvar cookie = require('component-cookie');\n\n/**\n * Get the top domain.\n *\n * The function constructs the levels of domain and attempts to set a global\n * cookie on each one when it succeeds it returns the top level domain.\n *\n * The method returns an empty string when the hostname is an ip or `localhost`.\n *\n * Example levels:\n *\n * domain.levels('http://www.google.co.uk');\n * // => [\"co.uk\", \"google.co.uk\", \"www.google.co.uk\"]\n *\n * Example:\n *\n * domain('http://localhost:3000/baz');\n * // => ''\n * domain('http://dev:3000/baz');\n * // => ''\n * domain('http://127.0.0.1:3000/baz');\n * // => ''\n * domain('http://segment.io/baz');\n * // => 'segment.io'\n *\n * @param {string} url\n * @return {string}\n * @api public\n */\nfunction domain(url) {\n var cookie = exports.cookie;\n var levels = exports.levels(url);\n\n // Lookup the real top level one.\n for (var i = 0; i < levels.length; ++i) {\n var cname = '__tld__';\n var domain = levels[i];\n var opts = { domain: '.' + domain };\n\n cookie(cname, 1, opts);\n if (cookie(cname)) {\n cookie(cname, null, opts);\n return domain;\n }\n }\n\n return '';\n}\n\n/**\n * Levels returns all levels of the given url.\n *\n * @param {string} url\n * @return {Array}\n * @api public\n */\ndomain.levels = function(url) {\n var host = parse(url).hostname;\n var parts = host.split('.');\n var last = parts[parts.length - 1];\n var levels = [];\n\n // Ip address.\n if (parts.length === 4 && last === parseInt(last, 10)) {\n return levels;\n }\n\n // Localhost.\n if (parts.length <= 1) {\n return levels;\n }\n\n // Create levels.\n for (var i = parts.length - 2; i >= 0; --i) {\n levels.push(parts.slice(i).join('.'));\n }\n\n return levels;\n};\n\n/**\n * Expose cookie on domain.\n */\ndomain.cookie = cookie;\n\n/*\n * Exports.\n */\n\nexports = module.exports = domain;\n","import clone from \"@ndhoule/clone\";\nimport cookie from \"rudder-component-cookie\";\nimport defaults from \"@ndhoule/defaults\";\nimport json from \"json3\";\nimport topDomain from \"@segment/top-domain\";\n\n/**\n * An object utility to persist values in cookies\n */\nclass CookieLocal {\n constructor(options) {\n this._options = {};\n this.options(options);\n }\n\n /**\n *\n * @param {*} options\n */\n options(options = {}) {\n if (arguments.length === 0) return this._options;\n\n let domain = \".\" + topDomain(window.location.href);\n if (domain === \".\") domain = null;\n\n // the default maxage and path\n this._options = defaults(options, {\n maxage: 31536000000,\n path: \"/\",\n domain: domain,\n samesite: \"Lax\"\n });\n\n //try setting a cookie first\n this.set(\"test_rudder\", true);\n if (!this.get(\"test_rudder\")) {\n this._options.domain = null;\n }\n this.remove(\"test_rudder\");\n }\n\n /**\n *\n * @param {*} key\n * @param {*} value\n */\n set(key, value) {\n try {\n value = json.stringify(value);\n cookie(key, value, clone(this._options));\n return true;\n } catch (e) {\n return false;\n }\n }\n\n /**\n *\n * @param {*} key\n */\n get(key) {\n // if not parseable, return as is without json parse\n let value;\n try {\n value = cookie(key);\n value = value ? json.parse(value) : null;\n return value;\n } catch (e) {\n if(value) {\n return value\n }\n return null;\n }\n }\n\n /**\n *\n * @param {*} key\n */\n remove(key) {\n try {\n cookie(key, null, clone(this._options));\n return true;\n } catch (e) {\n return false;\n }\n }\n}\n\n// Exporting only the instance\nlet Cookie = new CookieLocal({});\n\nexport { Cookie };\n","\"use strict\"\n\nvar JSON = require('json3');\n\nmodule.exports = (function() {\n\t// Store.js\n\tvar store = {},\n\t\twin = (typeof window != 'undefined' ? window : global),\n\t\tdoc = win.document,\n\t\tlocalStorageName = 'localStorage',\n\t\tscriptTag = 'script',\n\t\tstorage\n\n\tstore.disabled = false\n\tstore.version = '1.3.20'\n\tstore.set = function(key, value) {}\n\tstore.get = function(key, defaultVal) {}\n\tstore.has = function(key) { return store.get(key) !== undefined }\n\tstore.remove = function(key) {}\n\tstore.clear = function() {}\n\tstore.transact = function(key, defaultVal, transactionFn) {\n\t\tif (transactionFn == null) {\n\t\t\ttransactionFn = defaultVal\n\t\t\tdefaultVal = null\n\t\t}\n\t\tif (defaultVal == null) {\n\t\t\tdefaultVal = {}\n\t\t}\n\t\tvar val = store.get(key, defaultVal)\n\t\ttransactionFn(val)\n\t\tstore.set(key, val)\n\t}\n\tstore.getAll = function() {\n\t\tvar ret = {}\n\t\tstore.forEach(function(key, val) {\n\t\t\tret[key] = val\n\t\t})\n\t\treturn ret\n\t}\n\tstore.forEach = function() {}\n\tstore.serialize = function(value) {\n\t\treturn JSON.stringify(value)\n\t}\n\tstore.deserialize = function(value) {\n\t\tif (typeof value != 'string') { return undefined }\n\t\ttry { return JSON.parse(value) }\n\t\tcatch(e) { return value || undefined }\n\t}\n\n\t// Functions to encapsulate questionable FireFox 3.6.13 behavior\n\t// when about.config::dom.storage.enabled === false\n\t// See https://github.com/marcuswestin/store.js/issues#issue/13\n\tfunction isLocalStorageNameSupported() {\n\t\ttry { return (localStorageName in win && win[localStorageName]) }\n\t\tcatch(err) { return false }\n\t}\n\n\tif (isLocalStorageNameSupported()) {\n\t\tstorage = win[localStorageName]\n\t\tstore.set = function(key, val) {\n\t\t\tif (val === undefined) { return store.remove(key) }\n\t\t\tstorage.setItem(key, store.serialize(val))\n\t\t\treturn val\n\t\t}\n\t\tstore.get = function(key, defaultVal) {\n\t\t\tvar val = store.deserialize(storage.getItem(key))\n\t\t\treturn (val === undefined ? defaultVal : val)\n\t\t}\n\t\tstore.remove = function(key) { storage.removeItem(key) }\n\t\tstore.clear = function() { storage.clear() }\n\t\tstore.forEach = function(callback) {\n\t\t\tfor (var i=0; idocument.w=window'+scriptTag+'>')\n\t\t\tstorageContainer.close()\n\t\t\tstorageOwner = storageContainer.w.frames[0].document\n\t\t\tstorage = storageOwner.createElement('div')\n\t\t} catch(e) {\n\t\t\t// somehow ActiveXObject instantiation failed (perhaps some special\n\t\t\t// security settings or otherwse), fall back to per-path storage\n\t\t\tstorage = doc.createElement('div')\n\t\t\tstorageOwner = doc.body\n\t\t}\n\t\tvar withIEStorage = function(storeFunction) {\n\t\t\treturn function() {\n\t\t\t\tvar args = Array.prototype.slice.call(arguments, 0)\n\t\t\t\targs.unshift(storage)\n\t\t\t\t// See http://msdn.microsoft.com/en-us/library/ms531081(v=VS.85).aspx\n\t\t\t\t// and http://msdn.microsoft.com/en-us/library/ms531424(v=VS.85).aspx\n\t\t\t\tstorageOwner.appendChild(storage)\n\t\t\t\tstorage.addBehavior('#default#userData')\n\t\t\t\tstorage.load(localStorageName)\n\t\t\t\tvar result = storeFunction.apply(store, args)\n\t\t\t\tstorageOwner.removeChild(storage)\n\t\t\t\treturn result\n\t\t\t}\n\t\t}\n\n\t\t// In IE7, keys cannot start with a digit or contain certain chars.\n\t\t// See https://github.com/marcuswestin/store.js/issues/40\n\t\t// See https://github.com/marcuswestin/store.js/issues/83\n\t\tvar forbiddenCharsRegex = new RegExp(\"[!\\\"#$%&'()*+,/\\\\\\\\:;<=>?@[\\\\]^`{|}~]\", \"g\")\n\t\tvar ieKeyFix = function(key) {\n\t\t\treturn key.replace(/^d/, '___$&').replace(forbiddenCharsRegex, '___')\n\t\t}\n\t\tstore.set = withIEStorage(function(storage, key, val) {\n\t\t\tkey = ieKeyFix(key)\n\t\t\tif (val === undefined) { return store.remove(key) }\n\t\t\tstorage.setAttribute(key, store.serialize(val))\n\t\t\tstorage.save(localStorageName)\n\t\t\treturn val\n\t\t})\n\t\tstore.get = withIEStorage(function(storage, key, defaultVal) {\n\t\t\tkey = ieKeyFix(key)\n\t\t\tvar val = store.deserialize(storage.getAttribute(key))\n\t\t\treturn (val === undefined ? defaultVal : val)\n\t\t})\n\t\tstore.remove = withIEStorage(function(storage, key) {\n\t\t\tkey = ieKeyFix(key)\n\t\t\tstorage.removeAttribute(key)\n\t\t\tstorage.save(localStorageName)\n\t\t})\n\t\tstore.clear = withIEStorage(function(storage) {\n\t\t\tvar attributes = storage.XMLDocument.documentElement.attributes\n\t\t\tstorage.load(localStorageName)\n\t\t\tfor (var i=attributes.length-1; i>=0; i--) {\n\t\t\t\tstorage.removeAttribute(attributes[i].name)\n\t\t\t}\n\t\t\tstorage.save(localStorageName)\n\t\t})\n\t\tstore.forEach = withIEStorage(function(storage, callback) {\n\t\t\tvar attributes = storage.XMLDocument.documentElement.attributes\n\t\t\tfor (var i=0, attr; attr=attributes[i]; ++i) {\n\t\t\t\tcallback(attr.name, store.deserialize(storage.getAttribute(attr.name)))\n\t\t\t}\n\t\t})\n\t}\n\n\ttry {\n\t\tvar testKey = '__storejs__'\n\t\tstore.set(testKey, testKey)\n\t\tif (store.get(testKey) != testKey) { store.disabled = true }\n\t\tstore.remove(testKey)\n\t} catch(e) {\n\t\tstore.disabled = true\n\t}\n\tstore.enabled = !store.disabled\n\t\n\treturn store\n}())\n","import defaults from \"@ndhoule/defaults\";\nimport store from \"@segment/store\";\n\n/**\n * An object utility to persist user and other values in localstorage\n */\nclass StoreLocal {\n constructor(options) {\n this._options = {};\n this.enabled = false;\n this.options(options);\n }\n\n /**\n *\n * @param {*} options\n */\n options(options = {}) {\n if (arguments.length === 0) return this._options;\n\n defaults(options, { enabled: true });\n\n this.enabled = options.enabled && store.enabled;\n this._options = options;\n }\n\n /**\n *\n * @param {*} key\n * @param {*} value\n */\n set(key, value) {\n if (!this.enabled) return false;\n return store.set(key, value);\n }\n\n /**\n *\n * @param {*} key\n */\n get(key) {\n if (!this.enabled) return null;\n return store.get(key);\n }\n\n /**\n *\n * @param {*} key\n */\n remove(key) {\n if (!this.enabled) return false;\n return store.remove(key);\n }\n}\n\n// Exporting only the instance\nlet Store = new StoreLocal({});\n\nexport { Store };\n","import logger from \"../logUtil\";\nimport { Cookie } from \"./cookie\";\nimport { Store } from \"./store\";\nlet defaults = {\n user_storage_key: \"rl_user_id\",\n user_storage_trait: \"rl_trait\",\n user_storage_anonymousId: \"rl_anonymous_id\",\n group_storage_key: \"rl_group_id\",\n group_storage_trait: \"rl_group_trait\"\n};\n\n/**\n * An object that handles persisting key-val from Analytics\n */\nclass Storage {\n constructor() {\n // First try setting the storage to cookie else to localstorage\n Cookie.set(\"rudder_cookies\", true);\n\n if (Cookie.get(\"rudder_cookies\")) {\n Cookie.remove(\"rudder_cookies\");\n this.storage = Cookie;\n return;\n }\n\n // localStorage is enabled.\n if (Store.enabled) {\n this.storage = Store;\n return;\n }\n }\n\n /**\n *\n * @param {*} key\n * @param {*} value\n */\n setItem(key, value) {\n this.storage.set(key, value);\n }\n\n /**\n *\n * @param {*} value\n */\n setUserId(value) {\n if (typeof value != \"string\") {\n logger.error(\"[Storage] setUserId:: userId should be string\");\n return;\n }\n this.storage.set(defaults.user_storage_key, value);\n return;\n }\n\n /**\n *\n * @param {*} value\n */\n setUserTraits(value) {\n this.storage.set(defaults.user_storage_trait, value);\n return;\n }\n\n /**\n *\n * @param {*} value\n */\n setGroupId(value) {\n if (typeof value != \"string\") {\n logger.error(\"[Storage] setGroupId:: groupId should be string\");\n return;\n }\n this.storage.set(defaults.group_storage_key, value);\n return;\n }\n\n /**\n *\n * @param {*} value\n */\n setGroupTraits(value) {\n this.storage.set(defaults.group_storage_trait, value);\n return;\n }\n\n /**\n *\n * @param {*} value\n */\n setAnonymousId(value) {\n if (typeof value != \"string\") {\n logger.error(\"[Storage] setAnonymousId:: anonymousId should be string\");\n return;\n }\n this.storage.set(defaults.user_storage_anonymousId, value);\n return;\n }\n\n /**\n *\n * @param {*} key\n */\n getItem(key) {\n return this.storage.get(key);\n }\n\n /**\n * get the stored userId\n */\n getUserId() {\n return this.storage.get(defaults.user_storage_key);\n }\n\n /**\n * get the stored user traits\n */\n getUserTraits() {\n return this.storage.get(defaults.user_storage_trait);\n }\n\n /**\n * get the stored userId\n */\n getGroupId() {\n return this.storage.get(defaults.group_storage_key);\n }\n\n /**\n * get the stored user traits\n */\n getGroupTraits() {\n return this.storage.get(defaults.group_storage_trait);\n }\n\n /**\n * get stored anonymous id\n */\n getAnonymousId() {\n return this.storage.get(defaults.user_storage_anonymousId);\n }\n\n /**\n *\n * @param {*} key\n */\n removeItem(key) {\n return this.storage.remove(key);\n }\n\n /**\n * remove stored keys\n */\n clear() {\n this.storage.remove(defaults.user_storage_key);\n this.storage.remove(defaults.user_storage_trait);\n // this.storage.remove(defaults.user_storage_anonymousId);\n }\n}\n\nexport { Storage };\n","import { Storage } from \"./storage\";\nimport { StorageNode } from \"./storage_node\";\nexport default process.browser ? new Storage() : StorageNode;\n","import logger from \"../../utils/logUtil\";\nimport Storage from \"../../utils/storage\";\n\nclass GA {\n constructor(config) {\n this.trackingID = config.trackingID;\n // config.allowLinker = true;\n this.allowLinker = config.allowLinker || false;\n this.name = \"GA\";\n }\n\n init() {\n (function(i, s, o, g, r, a, m) {\n i[\"GoogleAnalyticsObject\"] = r;\n (i[r] =\n i[r] ||\n function() {\n (i[r].q = i[r].q || []).push(arguments);\n }),\n (i[r].l = 1 * new Date());\n (a = s.createElement(o)), (m = s.getElementsByTagName(o)[0]);\n a.async = 1;\n a.src = g;\n m.parentNode.insertBefore(a, m);\n })(\n window,\n document,\n \"script\",\n \"https://www.google-analytics.com/analytics.js\",\n \"ga\"\n );\n\n // use analytics_debug.js for debugging\n\n ga(\"create\", this.trackingID, \"auto\", \"rudder_ga\", {\n allowLinker: this.allowLinker,\n });\n\n var userId = Storage.getUserId()\n if (userId && userId !== '') {\n ga(\"rudder_ga.set\", \"userId\", userId);\n }\n //ga(\"send\", \"pageview\");\n\n logger.debug(\"===in init GA===\");\n }\n\n identify(rudderElement) {\n var userId = rudderElement.message.userId !== ''\n ? rudderElement.message.userId\n : rudderElement.message.anonymousId\n ga(\"rudder_ga.set\", \"userId\", userId);\n logger.debug(\"in GoogleAnalyticsManager identify\");\n }\n\n track(rudderElement) {\n var eventCategory = rudderElement.message.event;\n var eventAction = rudderElement.message.event;\n var eventLabel = rudderElement.message.event;\n var eventValue = \"\";\n if (rudderElement.message.properties) {\n eventValue = rudderElement.message.properties.value\n ? rudderElement.message.properties.value\n : rudderElement.message.properties.revenue;\n eventCategory = rudderElement.message.properties.category\n ? rudderElement.message.properties.category\n : eventCategory;\n eventLabel = rudderElement.message.properties.label\n ? rudderElement.message.properties.label\n : eventLabel;\n }\n\n var payLoad = {\n hitType: \"event\",\n eventCategory: eventCategory,\n eventAction: eventAction,\n eventLabel: eventLabel,\n eventValue: eventValue\n };\n ga(\"rudder_ga.send\", \"event\", payLoad);\n logger.debug(\"in GoogleAnalyticsManager track\");\n }\n\n page(rudderElement) {\n logger.debug(\"in GoogleAnalyticsManager page\");\n var path =\n rudderElement.message.properties && rudderElement.message.properties.path\n ? rudderElement.message.properties.path\n : undefined;\n var title = rudderElement.message.properties && rudderElement.message.properties.title\n ? rudderElement.message.properties.title\n : undefined;\n var location = rudderElement.message.properties && rudderElement.message.properties.url\n ? rudderElement.message.properties.url\n : undefined;\n\n if (path) {\n ga(\"rudder_ga.set\", \"page\", path);\n }\n\n if (title) {\n ga(\"rudder_ga.set\", \"title\", title);\n }\n\n if (location) {\n ga(\"rudder_ga.set\", \"location\", location);\n }\n ga(\"rudder_ga.send\", \"pageview\");\n \n }\n\n isLoaded() {\n logger.debug(\"in GA isLoaded\");\n return !!window.gaplugins;\n }\n\n isReady() {\n return !!window.gaplugins;\n }\n}\n\nexport { GA };","import logger from \"../../utils/logUtil\";\nclass Hotjar {\n constructor(config) {\n this.siteId = config.siteID; //1549611\n this.name = \"HOTJAR\";\n this._ready = false;\n }\n\n init() {\n window.hotjarSiteId = this.siteId;\n (function(h, o, t, j, a, r) {\n h.hj =\n h.hj ||\n function() {\n (h.hj.q = h.hj.q || []).push(arguments);\n };\n h._hjSettings = { hjid: h.hotjarSiteId, hjsv: 6 };\n a = o.getElementsByTagName(\"head\")[0];\n r = o.createElement(\"script\");\n r.async = 1;\n r.src = t + h._hjSettings.hjid + j + h._hjSettings.hjsv;\n a.appendChild(r);\n })(window, document, \"https://static.hotjar.com/c/hotjar-\", \".js?sv=\");\n this._ready = true;\n\n logger.debug(\"===in init Hotjar===\");\n }\n\n identify(rudderElement) {\n let userId = rudderElement.message.userId || rudderElement.message.anonymousId;\n if (!userId){\n logger.debug('[Hotjar] identify:: user id is required');\n return;\n }\n \n var traits = rudderElement.message.context.traits;\n \n window.hj('identify', rudderElement.message.userId, traits);\n }\n\n track(rudderElement) {\n logger.debug(\"[Hotjar] track:: method not supported\");\n }\n\n page(rudderElement) {\n logger.debug(\"[Hotjar] page:: method not supported\");\n }\n\n isLoaded() {\n return this._ready;\n }\n\n isReady() {\n return this._ready;\n }\n}\n\nexport { Hotjar };\n","import logger from \"../../utils/logUtil\";\nclass GoogleAds {\n constructor(config) {\n //this.accountId = config.accountId;//AW-696901813\n this.conversionId = config.conversionID;\n this.pageLoadConversions = config.pageLoadConversions;\n this.clickEventConversions = config.clickEventConversions;\n this.defaultPageConversion = config.defaultPageConversion;\n\n this.name = \"GOOGLEADS\";\n }\n\n init() {\n let sourceUrl =\n \"https://www.googletagmanager.com/gtag/js?id=\" + this.conversionId;\n (function(id, src, document) {\n logger.debug(\"in script loader=== \" + id);\n let js = document.createElement(\"script\");\n js.src = src;\n js.async = 1;\n js.type = \"text/javascript\";\n js.id = id;\n let e = document.getElementsByTagName(\"head\")[0];\n logger.debug(\"==script==\", e);\n e.appendChild(js);\n })(\"googleAds-integration\", sourceUrl, document);\n\n window.dataLayer = window.dataLayer || [];\n window.gtag = function() {\n window.dataLayer.push(arguments);\n };\n window.gtag(\"js\", new Date());\n window.gtag(\"config\", this.conversionId);\n\n logger.debug(\"===in init Google Ads===\");\n }\n\n identify(rudderElement) {\n logger.debug(\"[GoogleAds] identify:: method not supported\");\n }\n\n //https://developers.google.com/gtagjs/reference/event\n track(rudderElement) {\n logger.debug(\"in GoogleAdsAnalyticsManager track\");\n let conversionData = this.getConversionData(\n this.clickEventConversions,\n rudderElement.message.event\n );\n if (conversionData[\"conversionLabel\"]) {\n let conversionLabel = conversionData[\"conversionLabel\"];\n let eventName = conversionData[\"eventName\"];\n let sendToValue = this.conversionId + \"/\" + conversionLabel;\n let properties = {};\n if (rudderElement.properties) {\n properties[\"value\"] = rudderElement.properties[\"revenue\"];\n properties[\"currency\"] = rudderElement.properties[\"currency\"];\n properties[\"transaction_id\"] = rudderElement.properties[\"order_id\"];\n }\n properties[\"send_to\"] = sendToValue;\n window.gtag(\"event\", eventName, properties);\n }\n }\n\n page(rudderElement) {\n logger.debug(\"in GoogleAdsAnalyticsManager page\");\n let conversionData = this.getConversionData(\n this.pageLoadConversions,\n rudderElement.message.name\n );\n if (conversionData[\"conversionLabel\"]) {\n let conversionLabel = conversionData[\"conversionLabel\"];\n let eventName = conversionData[\"eventName\"];\n window.gtag(\"event\", eventName, {\n send_to: this.conversionId + \"/\" + conversionLabel\n });\n }\n }\n\n getConversionData(eventTypeConversions, eventName) {\n let conversionData = {};\n if (eventTypeConversions) {\n if (eventName) {\n eventTypeConversions.forEach(eventTypeConversion => {\n if (\n eventTypeConversion.name.toLowerCase() === eventName.toLowerCase()\n ) {\n //rudderElement[\"message\"][\"name\"]\n conversionData[\"conversionLabel\"] =\n eventTypeConversion.conversionLabel;\n conversionData[\"eventName\"] = eventTypeConversion.name;\n return;\n }\n });\n } else {\n if (this.defaultPageConversion) {\n conversionData[\"conversionLabel\"] = this.defaultPageConversion;\n conversionData[\"eventName\"] = \"Viewed a Page\";\n }\n }\n }\n return conversionData;\n }\n\n isLoaded() {\n return window.dataLayer.push !== Array.prototype.push;\n }\n\n isReady() {\n return window.dataLayer.push !== Array.prototype.push;\n }\n}\n\nexport { GoogleAds };\n","import logger from \"../../utils/logUtil\";\nclass VWO {\n constructor(config, analytics) {\n this.accountId = config.accountId; //1549611\n this.settingsTolerance = config.settingsTolerance;\n this.isSPA = config.isSPA;\n this.libraryTolerance = config.libraryTolerance;\n this.useExistingJquery = config.useExistingJquery;\n this.sendExperimentTrack = config.sendExperimentTrack;\n this.sendExperimentIdentify = config.sendExperimentIdentify;\n this.name = \"VWO\";\n this.analytics = analytics;\n logger.debug(\"Config \", config);\n }\n\n init() {\n logger.debug(\"===in init VWO===\");\n var account_id = this.accountId;\n var settings_tolerance = this.settingsTolerance;\n var library_tolerance = this.libraryTolerance;\n var use_existing_jquery = this.useExistingJquery;\n var isSPA = this.isSPA;\n window._vwo_code = (function() {\n var f = false;\n var d = document;\n return {\n use_existing_jquery: function() {\n return use_existing_jquery;\n },\n library_tolerance: function() {\n return library_tolerance;\n },\n finish: function() {\n if (!f) {\n f = true;\n var a = d.getElementById(\"_vis_opt_path_hides\");\n if (a) a.parentNode.removeChild(a);\n }\n },\n finished: function() {\n return f;\n },\n load: function(a) {\n var b = d.createElement(\"script\");\n b.src = a;\n b.type = \"text/javascript\";\n b.innerText;\n b.onerror = function() {\n _vwo_code.finish();\n };\n d.getElementsByTagName(\"head\")[0].appendChild(b);\n },\n init: function() {\n var settings_timer = setTimeout(\n \"_vwo_code.finish()\",\n settings_tolerance\n );\n var a = d.createElement(\"style\"),\n b =\n \"body{opacity:0 !important;filter:alpha(opacity=0) !important;background:none !important;}\",\n h = d.getElementsByTagName(\"head\")[0];\n a.setAttribute(\"id\", \"_vis_opt_path_hides\");\n a.setAttribute(\"type\", \"text/css\");\n if (a.styleSheet) a.styleSheet.cssText = b;\n else a.appendChild(d.createTextNode(b));\n h.appendChild(a);\n this.load(\n \"//dev.visualwebsiteoptimizer.com/j.php?a=\" +\n account_id +\n \"&u=\" +\n encodeURIComponent(d.URL) +\n \"&r=\" +\n Math.random() +\n \"&f=\" +\n +isSPA\n );\n return settings_timer;\n }\n };\n })();\n window._vwo_settings_timer = window._vwo_code.init();\n\n //Send track or iddentify when\n if (this.sendExperimentTrack || this.experimentViewedIdentify) {\n this.experimentViewed();\n }\n }\n\n experimentViewed() {\n window.VWO = window.VWO || [];\n var self = this;\n window.VWO.push([\n \"onVariationApplied\",\n (data) => {\n if (!data) {\n return;\n }\n logger.debug(\"Variation Applied\");\n var expId = data[1],\n variationId = data[2];\n logger.debug(\n \"experiment id:\",\n expId,\n \"Variation Name:\",\n _vwo_exp[expId].comb_n[variationId]\n );\n if (\n typeof _vwo_exp[expId].comb_n[variationId] !== \"undefined\" &&\n [\"VISUAL_AB\", \"VISUAL\", \"SPLIT_URL\", \"SURVEY\"].indexOf(\n _vwo_exp[expId].type\n ) > -1\n ) {\n try {\n if (self.sendExperimentTrack) {\n logger.debug(\"Tracking...\");\n this.analytics.track(\"Experiment Viewed\", {\n experimentId: expId,\n variationName: _vwo_exp[expId].comb_n[variationId]\n });\n }\n } catch (error) {\n logger.error(\"[VWO] experimentViewed:: \", error);\n }\n try {\n if (self.sendExperimentIdentify) {\n logger.debug(\"Identifying...\");\n this.analytics.identify({\n [`Experiment: ${expId}`]: _vwo_exp[expId].comb_n[variationId]\n });\n }\n } catch (error) {\n logger.error(\"[VWO] experimentViewed:: \" , error);\n }\n }\n }\n ]);\n }\n\n identify(rudderElement) {\n logger.debug(\"method not supported\");\n }\n\n track(rudderElement) {\n var eventName = rudderElement.message.event;\n if (eventName === \"Order Completed\") {\n var total = rudderElement.message.properties\n ? rudderElement.message.properties.total ||\n rudderElement.message.properties.revenue\n : 0;\n logger.debug(\"Revenue\", total);\n window.VWO = window.VWO || [];\n window.VWO.push([\"track.revenueConversion\", total]);\n }\n }\n\n page(rudderElement) {\n logger.debug(\"method not supported\");\n }\n\n isLoaded() {\n return !!window._vwo_code;\n }\n\n isReady() {\n return !!window._vwo_code;\n }\n}\n\nexport { VWO };\n","import logger from \"../../utils/logUtil\";\nclass GoogleTagManager {\n constructor(config) {\n this.containerID = config.containerID;\n this.name = \"GOOGLETAGMANAGER\";\n }\n\n init() {\n logger.debug(\"===in init GoogleTagManager===\");\n (function(w, d, s, l, i) {\n w[l] = w[l] || [];\n w[l].push({ \"gtm.start\": new Date().getTime(), event: \"gtm.js\" });\n var f = d.getElementsByTagName(s)[0],\n j = d.createElement(s),\n dl = l != \"dataLayer\" ? \"&l=\" + l : \"\";\n j.async = true;\n j.src = \"https://www.googletagmanager.com/gtm.js?id=\" + i + dl;\n f.parentNode.insertBefore(j, f);\n })(window, document, \"script\", \"dataLayer\", this.containerID);\n }\n\n identify(rudderElement) {\n logger.debug(\"[GTM] identify:: method not supported\");\n }\n\n track(rudderElement) {\n logger.debug(\"===in track GoogleTagManager===\");\n let rudderMessage = rudderElement.message;\n let props = {\n event: rudderMessage.event,\n userId: rudderMessage.userId,\n anonymousId: rudderMessage.anonymousId,\n ...rudderMessage.properties\n };\n this.sendToGTMDatalayer(props);\n }\n\n page(rudderElement) {\n logger.debug(\"===in page GoogleTagManager===\");\n let rudderMessage = rudderElement.message;\n let pageName = rudderMessage.name;\n let pageCategory = rudderMessage.properties\n ? rudderMessage.properties.category\n : undefined;\n\n let eventName;\n\n if (pageName) {\n eventName = \"Viewed \" + pageName + \" page\";\n }\n\n if (pageCategory && pageName) {\n eventName = \"Viewed \" + pageCategory + \" \" + pageName + \" page\";\n }\n\n if(!eventName) {\n eventName = \"Viewed a Page\";\n }\n \n let props = {\n event: eventName,\n userId: rudderMessage.userId,\n anonymousId: rudderMessage.anonymousId,\n ...rudderMessage.properties\n };\n\n this.sendToGTMDatalayer(props);\n }\n\n isLoaded() {\n return !!(\n window.dataLayer && Array.prototype.push !== window.dataLayer.push\n );\n }\n\n sendToGTMDatalayer(props) {\n window.dataLayer.push(props);\n }\n\n isReady() {\n return !!(\n window.dataLayer && Array.prototype.push !== window.dataLayer.push\n );\n }\n}\n\nexport { GoogleTagManager };\n","import logger from \"../../utils/logUtil\";\n\n/*\nE-commerce support required for logPurchase support & other e-commerce events as track with productId changed\n*/\nclass Braze {\n constructor(config, analytics) {\n this.analytics = analytics;\n this.appKey = config.appKey;\n if (!config.appKey) this.appKey = \"\";\n this.endPoint = \"\";\n if (config.dataCenter) {\n let dataCenterArr = config.dataCenter.trim().split(\"-\");\n if (dataCenterArr[0].toLowerCase() === \"eu\") {\n this.endPoint = \"sdk.fra-01.braze.eu\";\n } else {\n this.endPoint = \"sdk.iad-\" + dataCenterArr[1] + \".braze.com\";\n }\n }\n\n this.name = \"BRAZE\";\n\n logger.debug(\"Config \", config);\n }\n\n /** https://js.appboycdn.com/web-sdk/latest/doc/ab.User.html#toc4\n */\n\n formatGender(gender) {\n if (!gender) return;\n if (typeof gender !== \"string\") return;\n\n var femaleGenders = [\"woman\", \"female\", \"w\", \"f\"];\n var maleGenders = [\"man\", \"male\", \"m\"];\n var otherGenders = [\"other\", \"o\"];\n\n if (femaleGenders.indexOf(gender.toLowerCase()) > -1)\n return window.appboy.ab.User.Genders.FEMALE;\n if (maleGenders.indexOf(gender.toLowerCase()) > -1)\n return window.appboy.ab.User.Genders.MALE;\n if (otherGenders.indexOf(gender.toLowerCase()) > -1)\n return window.appboy.ab.User.Genders.OTHER;\n }\n\n init() {\n logger.debug(\"===in init Braze===\");\n\n //load appboy\n +(function(a, p, P, b, y) {\n a.appboy = {};\n a.appboyQueue = [];\n for (\n var s = \"initialize destroy getDeviceId toggleAppboyLogging setLogger openSession changeUser requestImmediateDataFlush requestFeedRefresh subscribeToFeedUpdates requestContentCardsRefresh subscribeToContentCardsUpdates logCardImpressions logCardClick logCardDismissal logFeedDisplayed logContentCardsDisplayed logInAppMessageImpression logInAppMessageClick logInAppMessageButtonClick logInAppMessageHtmlClick subscribeToNewInAppMessages subscribeToInAppMessage removeSubscription removeAllSubscriptions logCustomEvent logPurchase isPushSupported isPushBlocked isPushGranted isPushPermissionGranted registerAppboyPushMessages unregisterAppboyPushMessages trackLocation stopWebTracking resumeWebTracking wipeData ab ab.DeviceProperties ab.User ab.User.Genders ab.User.NotificationSubscriptionTypes ab.User.prototype.getUserId ab.User.prototype.setFirstName ab.User.prototype.setLastName ab.User.prototype.setEmail ab.User.prototype.setGender ab.User.prototype.setDateOfBirth ab.User.prototype.setCountry ab.User.prototype.setHomeCity ab.User.prototype.setLanguage ab.User.prototype.setEmailNotificationSubscriptionType ab.User.prototype.setPushNotificationSubscriptionType ab.User.prototype.setPhoneNumber ab.User.prototype.setAvatarImageUrl ab.User.prototype.setLastKnownLocation ab.User.prototype.setUserAttribute ab.User.prototype.setCustomUserAttribute ab.User.prototype.addToCustomAttributeArray ab.User.prototype.removeFromCustomAttributeArray ab.User.prototype.incrementCustomUserAttribute ab.User.prototype.addAlias ab.User.prototype.setCustomLocationAttribute ab.InAppMessage ab.InAppMessage.SlideFrom ab.InAppMessage.ClickAction ab.InAppMessage.DismissType ab.InAppMessage.OpenTarget ab.InAppMessage.ImageStyle ab.InAppMessage.TextAlignment ab.InAppMessage.Orientation ab.InAppMessage.CropType ab.InAppMessage.prototype.subscribeToClickedEvent ab.InAppMessage.prototype.subscribeToDismissedEvent ab.InAppMessage.prototype.removeSubscription ab.InAppMessage.prototype.removeAllSubscriptions ab.InAppMessage.prototype.closeMessage ab.InAppMessage.Button ab.InAppMessage.Button.prototype.subscribeToClickedEvent ab.InAppMessage.Button.prototype.removeSubscription ab.InAppMessage.Button.prototype.removeAllSubscriptions ab.SlideUpMessage ab.ModalMessage ab.FullScreenMessage ab.HtmlMessage ab.ControlMessage ab.Feed ab.Feed.prototype.getUnreadCardCount ab.ContentCards ab.ContentCards.prototype.getUnviewedCardCount ab.Card ab.Card.prototype.dismissCard ab.ClassicCard ab.CaptionedImage ab.Banner ab.ControlCard ab.WindowUtils display display.automaticallyShowNewInAppMessages display.showInAppMessage display.showFeed display.destroyFeed display.toggleFeed display.showContentCards display.hideContentCards display.toggleContentCards sharedLib\".split(\n \" \"\n ),\n i = 0;\n i < s.length;\n i++\n ) {\n for (\n var m = s[i], k = a.appboy, l = m.split(\".\"), j = 0;\n j < l.length - 1;\n j++\n )\n k = k[l[j]];\n k[l[j]] = new Function(\n \"return function \" +\n m.replace(/\\./g, \"_\") +\n \"(){window.appboyQueue.push(arguments); return true}\"\n )();\n }\n window.appboy.getUser = function() {\n return new window.appboy.ab.User();\n };\n window.appboy.getCachedFeed = function() {\n return new window.appboy.ab.Feed();\n };\n window.appboy.getCachedContentCards = function() {\n return new window.appboy.ab.ContentCards();\n };\n (y = p.createElement(P)).type = \"text/javascript\";\n y.src = \"https://js.appboycdn.com/web-sdk/2.4/appboy.min.js\";\n y.async = 1;\n (b = p.getElementsByTagName(P)[0]).parentNode.insertBefore(y, b);\n })(window, document, \"script\");\n\n window.appboy.initialize(this.appKey, {\n enableLogging: true,\n baseUrl: this.endPoint\n });\n window.appboy.display.automaticallyShowNewInAppMessages();\n\n var userId = this.analytics.userId;\n //send userId if you have it https://js.appboycdn.com/web-sdk/latest/doc/module-appboy.html#.changeUser\n if (userId) appboy.changeUser(userId);\n\n window.appboy.openSession();\n }\n\n handleReservedProperties(props) {\n // remove reserved keys from custom event properties\n // https://www.appboy.com/documentation/Platform_Wide/#reserved-keys\n var reserved = [\n \"time\",\n \"product_id\",\n \"quantity\",\n \"event_name\",\n \"price\",\n \"currency\"\n ];\n\n reserved.forEach(element => {\n delete props[element];\n });\n return props;\n }\n\n identify(rudderElement) {\n var userId = rudderElement.message.userId;\n var address = rudderElement.message.context.traits.address;\n var avatar = rudderElement.message.context.traits.avatar;\n var birthday = rudderElement.message.context.traits.birthday;\n var email = rudderElement.message.context.traits.email;\n var firstname = rudderElement.message.context.traits.firstname;\n var gender = rudderElement.message.context.traits.gender;\n var lastname = rudderElement.message.context.traits.lastname;\n var phone = rudderElement.message.context.traits.phone;\n\n // This is a hack to make a deep copy that is not recommended because it will often fail:\n var traits = JSON.parse(\n JSON.stringify(rudderElement.message.context.traits)\n );\n\n window.appboy.changeUser(userId);\n window.appboy.getUser().setAvatarImageUrl(avatar);\n if (email) window.appboy.getUser().setEmail(email);\n if (firstname) window.appboy.getUser().setFirstName(firstname);\n if (gender) window.appboy.getUser().setGender(this.formatGender(gender));\n if (lastname) window.appboy.getUser().setLastName(lastname);\n if (phone) window.appboy.getUser().setPhoneNumber(phone);\n if (address) {\n window.appboy.getUser().setCountry(address.country);\n window.appboy.getUser().setHomeCity(address.city);\n }\n if (birthday) {\n window.appboy\n .getUser()\n .setDateOfBirth(\n birthday.getUTCFullYear(),\n birthday.getUTCMonth() + 1,\n birthday.getUTCDate()\n );\n }\n\n // remove reserved keys https://www.appboy.com/documentation/Platform_Wide/#reserved-keys\n var reserved = [\n \"avatar\",\n \"address\",\n \"birthday\",\n \"email\",\n \"id\",\n \"firstname\",\n \"gender\",\n \"lastname\",\n \"phone\",\n \"facebook\",\n \"twitter\",\n \"first_name\",\n \"last_name\",\n \"dob\",\n \"external_id\",\n \"country\",\n \"home_city\",\n \"bio\",\n \"gender\",\n \"phone\",\n \"email_subscribe\",\n \"push_subscribe\"\n ];\n\n reserved.forEach(element => {\n delete traits[element];\n });\n\n Object.keys(traits).forEach(key => {\n window.appboy.getUser().setCustomUserAttribute(key, traits[key]);\n });\n }\n\n handlePurchase(properties, userId) {\n var products = properties.products;\n var currencyCode = properties.currency;\n\n window.appboy.changeUser(userId);\n\n // del used properties\n del(properties, \"products\");\n del(properties, \"currency\");\n\n // we have to make a separate call to appboy for each product\n products.forEach(product => {\n var productId = product.product_id;\n var price = product.price;\n var quantity = product.quantity;\n if (quantity && price && productId)\n window.appboy.logPurchase(\n productId,\n price,\n currencyCode,\n quantity,\n properties\n );\n });\n }\n\n track(rudderElement) {\n var userId = rudderElement.message.userId;\n var eventName = rudderElement.message.event;\n var properties = rudderElement.message.properties;\n\n window.appboy.changeUser(userId);\n\n if (eventName.toLowerCase() === \"order completed\") {\n this.handlePurchase(properties, userId);\n } else {\n properties = this.handleReservedProperties(properties);\n window.appboy.logCustomEvent(eventName, properties);\n }\n }\n\n page(rudderElement) {\n var userId = rudderElement.message.userId;\n var eventName = rudderElement.message.name;\n var properties = rudderElement.message.properties;\n\n properties = this.handleReservedProperties(properties);\n\n window.appboy.changeUser(userId);\n window.appboy.logCustomEvent(eventName, properties);\n }\n\n isLoaded() {\n return window.appboyQueue === null;\n }\n\n isReady() {\n return window.appboyQueue === null;\n }\n}\n\nexport { Braze };\n","(function() {\n var base64map\n = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/',\n\n crypt = {\n // Bit-wise rotation left\n rotl: function(n, b) {\n return (n << b) | (n >>> (32 - b));\n },\n\n // Bit-wise rotation right\n rotr: function(n, b) {\n return (n << (32 - b)) | (n >>> b);\n },\n\n // Swap big-endian to little-endian and vice versa\n endian: function(n) {\n // If number given, swap endian\n if (n.constructor == Number) {\n return crypt.rotl(n, 8) & 0x00FF00FF | crypt.rotl(n, 24) & 0xFF00FF00;\n }\n\n // Else, assume array and swap all items\n for (var i = 0; i < n.length; i++)\n n[i] = crypt.endian(n[i]);\n return n;\n },\n\n // Generate an array of any length of random bytes\n randomBytes: function(n) {\n for (var bytes = []; n > 0; n--)\n bytes.push(Math.floor(Math.random() * 256));\n return bytes;\n },\n\n // Convert a byte array to big-endian 32-bit words\n bytesToWords: function(bytes) {\n for (var words = [], i = 0, b = 0; i < bytes.length; i++, b += 8)\n words[b >>> 5] |= bytes[i] << (24 - b % 32);\n return words;\n },\n\n // Convert big-endian 32-bit words to a byte array\n wordsToBytes: function(words) {\n for (var bytes = [], b = 0; b < words.length * 32; b += 8)\n bytes.push((words[b >>> 5] >>> (24 - b % 32)) & 0xFF);\n return bytes;\n },\n\n // Convert a byte array to a hex string\n bytesToHex: function(bytes) {\n for (var hex = [], i = 0; i < bytes.length; i++) {\n hex.push((bytes[i] >>> 4).toString(16));\n hex.push((bytes[i] & 0xF).toString(16));\n }\n return hex.join('');\n },\n\n // Convert a hex string to a byte array\n hexToBytes: function(hex) {\n for (var bytes = [], c = 0; c < hex.length; c += 2)\n bytes.push(parseInt(hex.substr(c, 2), 16));\n return bytes;\n },\n\n // Convert a byte array to a base-64 string\n bytesToBase64: function(bytes) {\n for (var base64 = [], i = 0; i < bytes.length; i += 3) {\n var triplet = (bytes[i] << 16) | (bytes[i + 1] << 8) | bytes[i + 2];\n for (var j = 0; j < 4; j++)\n if (i * 8 + j * 6 <= bytes.length * 8)\n base64.push(base64map.charAt((triplet >>> 6 * (3 - j)) & 0x3F));\n else\n base64.push('=');\n }\n return base64.join('');\n },\n\n // Convert a base-64 string to a byte array\n base64ToBytes: function(base64) {\n // Remove non-base-64 characters\n base64 = base64.replace(/[^A-Z0-9+\\/]/ig, '');\n\n for (var bytes = [], i = 0, imod4 = 0; i < base64.length;\n imod4 = ++i % 4) {\n if (imod4 == 0) continue;\n bytes.push(((base64map.indexOf(base64.charAt(i - 1))\n & (Math.pow(2, -2 * imod4 + 8) - 1)) << (imod4 * 2))\n | (base64map.indexOf(base64.charAt(i)) >>> (6 - imod4 * 2)));\n }\n return bytes;\n }\n };\n\n module.exports = crypt;\n})();\n","var charenc = {\n // UTF-8 encoding\n utf8: {\n // Convert a string to a byte array\n stringToBytes: function(str) {\n return charenc.bin.stringToBytes(unescape(encodeURIComponent(str)));\n },\n\n // Convert a byte array to a string\n bytesToString: function(bytes) {\n return decodeURIComponent(escape(charenc.bin.bytesToString(bytes)));\n }\n },\n\n // Binary encoding\n bin: {\n // Convert a string to a byte array\n stringToBytes: function(str) {\n for (var bytes = [], i = 0; i < str.length; i++)\n bytes.push(str.charCodeAt(i) & 0xFF);\n return bytes;\n },\n\n // Convert a byte array to a string\n bytesToString: function(bytes) {\n for (var str = [], i = 0; i < bytes.length; i++)\n str.push(String.fromCharCode(bytes[i]));\n return str.join('');\n }\n }\n};\n\nmodule.exports = charenc;\n","/*!\n * Determine if an object is a Buffer\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n\n// The _isBuffer check is for Safari 5-7 support, because it's missing\n// Object.prototype.constructor. Remove this eventually\nmodule.exports = function (obj) {\n return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer)\n}\n\nfunction isBuffer (obj) {\n return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)\n}\n\n// For Node v0.10 support. Remove this eventually.\nfunction isSlowBuffer (obj) {\n return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))\n}\n","/* globals window, HTMLElement */\n\n'use strict';\n\n/**!\n * is\n * the definitive JavaScript type testing library\n *\n * @copyright 2013-2014 Enrico Marino / Jordan Harband\n * @license MIT\n */\n\nvar objProto = Object.prototype;\nvar owns = objProto.hasOwnProperty;\nvar toStr = objProto.toString;\nvar symbolValueOf;\nif (typeof Symbol === 'function') {\n symbolValueOf = Symbol.prototype.valueOf;\n}\nvar bigIntValueOf;\nif (typeof BigInt === 'function') {\n bigIntValueOf = BigInt.prototype.valueOf;\n}\nvar isActualNaN = function (value) {\n return value !== value;\n};\nvar NON_HOST_TYPES = {\n 'boolean': 1,\n number: 1,\n string: 1,\n undefined: 1\n};\n\nvar base64Regex = /^([A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{4}|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}==)$/;\nvar hexRegex = /^[A-Fa-f0-9]+$/;\n\n/**\n * Expose `is`\n */\n\nvar is = {};\n\n/**\n * Test general.\n */\n\n/**\n * is.type\n * Test if `value` is a type of `type`.\n *\n * @param {*} value value to test\n * @param {String} type type\n * @return {Boolean} true if `value` is a type of `type`, false otherwise\n * @api public\n */\n\nis.a = is.type = function (value, type) {\n return typeof value === type;\n};\n\n/**\n * is.defined\n * Test if `value` is defined.\n *\n * @param {*} value value to test\n * @return {Boolean} true if 'value' is defined, false otherwise\n * @api public\n */\n\nis.defined = function (value) {\n return typeof value !== 'undefined';\n};\n\n/**\n * is.empty\n * Test if `value` is empty.\n *\n * @param {*} value value to test\n * @return {Boolean} true if `value` is empty, false otherwise\n * @api public\n */\n\nis.empty = function (value) {\n var type = toStr.call(value);\n var key;\n\n if (type === '[object Array]' || type === '[object Arguments]' || type === '[object String]') {\n return value.length === 0;\n }\n\n if (type === '[object Object]') {\n for (key in value) {\n if (owns.call(value, key)) {\n return false;\n }\n }\n return true;\n }\n\n return !value;\n};\n\n/**\n * is.equal\n * Test if `value` is equal to `other`.\n *\n * @param {*} value value to test\n * @param {*} other value to compare with\n * @return {Boolean} true if `value` is equal to `other`, false otherwise\n */\n\nis.equal = function equal(value, other) {\n if (value === other) {\n return true;\n }\n\n var type = toStr.call(value);\n var key;\n\n if (type !== toStr.call(other)) {\n return false;\n }\n\n if (type === '[object Object]') {\n for (key in value) {\n if (!is.equal(value[key], other[key]) || !(key in other)) {\n return false;\n }\n }\n for (key in other) {\n if (!is.equal(value[key], other[key]) || !(key in value)) {\n return false;\n }\n }\n return true;\n }\n\n if (type === '[object Array]') {\n key = value.length;\n if (key !== other.length) {\n return false;\n }\n while (key--) {\n if (!is.equal(value[key], other[key])) {\n return false;\n }\n }\n return true;\n }\n\n if (type === '[object Function]') {\n return value.prototype === other.prototype;\n }\n\n if (type === '[object Date]') {\n return value.getTime() === other.getTime();\n }\n\n return false;\n};\n\n/**\n * is.hosted\n * Test if `value` is hosted by `host`.\n *\n * @param {*} value to test\n * @param {*} host host to test with\n * @return {Boolean} true if `value` is hosted by `host`, false otherwise\n * @api public\n */\n\nis.hosted = function (value, host) {\n var type = typeof host[value];\n return type === 'object' ? !!host[value] : !NON_HOST_TYPES[type];\n};\n\n/**\n * is.instance\n * Test if `value` is an instance of `constructor`.\n *\n * @param {*} value value to test\n * @return {Boolean} true if `value` is an instance of `constructor`\n * @api public\n */\n\nis.instance = is['instanceof'] = function (value, constructor) {\n return value instanceof constructor;\n};\n\n/**\n * is.nil / is.null\n * Test if `value` is null.\n *\n * @param {*} value value to test\n * @return {Boolean} true if `value` is null, false otherwise\n * @api public\n */\n\nis.nil = is['null'] = function (value) {\n return value === null;\n};\n\n/**\n * is.undef / is.undefined\n * Test if `value` is undefined.\n *\n * @param {*} value value to test\n * @return {Boolean} true if `value` is undefined, false otherwise\n * @api public\n */\n\nis.undef = is.undefined = function (value) {\n return typeof value === 'undefined';\n};\n\n/**\n * Test arguments.\n */\n\n/**\n * is.args\n * Test if `value` is an arguments object.\n *\n * @param {*} value value to test\n * @return {Boolean} true if `value` is an arguments object, false otherwise\n * @api public\n */\n\nis.args = is.arguments = function (value) {\n var isStandardArguments = toStr.call(value) === '[object Arguments]';\n var isOldArguments = !is.array(value) && is.arraylike(value) && is.object(value) && is.fn(value.callee);\n return isStandardArguments || isOldArguments;\n};\n\n/**\n * Test array.\n */\n\n/**\n * is.array\n * Test if 'value' is an array.\n *\n * @param {*} value value to test\n * @return {Boolean} true if `value` is an array, false otherwise\n * @api public\n */\n\nis.array = Array.isArray || function (value) {\n return toStr.call(value) === '[object Array]';\n};\n\n/**\n * is.arguments.empty\n * Test if `value` is an empty arguments object.\n *\n * @param {*} value value to test\n * @return {Boolean} true if `value` is an empty arguments object, false otherwise\n * @api public\n */\nis.args.empty = function (value) {\n return is.args(value) && value.length === 0;\n};\n\n/**\n * is.array.empty\n * Test if `value` is an empty array.\n *\n * @param {*} value value to test\n * @return {Boolean} true if `value` is an empty array, false otherwise\n * @api public\n */\nis.array.empty = function (value) {\n return is.array(value) && value.length === 0;\n};\n\n/**\n * is.arraylike\n * Test if `value` is an arraylike object.\n *\n * @param {*} value value to test\n * @return {Boolean} true if `value` is an arguments object, false otherwise\n * @api public\n */\n\nis.arraylike = function (value) {\n return !!value && !is.bool(value)\n && owns.call(value, 'length')\n && isFinite(value.length)\n && is.number(value.length)\n && value.length >= 0;\n};\n\n/**\n * Test boolean.\n */\n\n/**\n * is.bool\n * Test if `value` is a boolean.\n *\n * @param {*} value value to test\n * @return {Boolean} true if `value` is a boolean, false otherwise\n * @api public\n */\n\nis.bool = is['boolean'] = function (value) {\n return toStr.call(value) === '[object Boolean]';\n};\n\n/**\n * is.false\n * Test if `value` is false.\n *\n * @param {*} value value to test\n * @return {Boolean} true if `value` is false, false otherwise\n * @api public\n */\n\nis['false'] = function (value) {\n return is.bool(value) && Boolean(Number(value)) === false;\n};\n\n/**\n * is.true\n * Test if `value` is true.\n *\n * @param {*} value value to test\n * @return {Boolean} true if `value` is true, false otherwise\n * @api public\n */\n\nis['true'] = function (value) {\n return is.bool(value) && Boolean(Number(value)) === true;\n};\n\n/**\n * Test date.\n */\n\n/**\n * is.date\n * Test if `value` is a date.\n *\n * @param {*} value value to test\n * @return {Boolean} true if `value` is a date, false otherwise\n * @api public\n */\n\nis.date = function (value) {\n return toStr.call(value) === '[object Date]';\n};\n\n/**\n * is.date.valid\n * Test if `value` is a valid date.\n *\n * @param {*} value value to test\n * @returns {Boolean} true if `value` is a valid date, false otherwise\n */\nis.date.valid = function (value) {\n return is.date(value) && !isNaN(Number(value));\n};\n\n/**\n * Test element.\n */\n\n/**\n * is.element\n * Test if `value` is an html element.\n *\n * @param {*} value value to test\n * @return {Boolean} true if `value` is an HTML Element, false otherwise\n * @api public\n */\n\nis.element = function (value) {\n return value !== undefined\n && typeof HTMLElement !== 'undefined'\n && value instanceof HTMLElement\n && value.nodeType === 1;\n};\n\n/**\n * Test error.\n */\n\n/**\n * is.error\n * Test if `value` is an error object.\n *\n * @param {*} value value to test\n * @return {Boolean} true if `value` is an error object, false otherwise\n * @api public\n */\n\nis.error = function (value) {\n return toStr.call(value) === '[object Error]';\n};\n\n/**\n * Test function.\n */\n\n/**\n * is.fn / is.function (deprecated)\n * Test if `value` is a function.\n *\n * @param {*} value value to test\n * @return {Boolean} true if `value` is a function, false otherwise\n * @api public\n */\n\nis.fn = is['function'] = function (value) {\n var isAlert = typeof window !== 'undefined' && value === window.alert;\n if (isAlert) {\n return true;\n }\n var str = toStr.call(value);\n return str === '[object Function]' || str === '[object GeneratorFunction]' || str === '[object AsyncFunction]';\n};\n\n/**\n * Test number.\n */\n\n/**\n * is.number\n * Test if `value` is a number.\n *\n * @param {*} value value to test\n * @return {Boolean} true if `value` is a number, false otherwise\n * @api public\n */\n\nis.number = function (value) {\n return toStr.call(value) === '[object Number]';\n};\n\n/**\n * is.infinite\n * Test if `value` is positive or negative infinity.\n *\n * @param {*} value value to test\n * @return {Boolean} true if `value` is positive or negative Infinity, false otherwise\n * @api public\n */\nis.infinite = function (value) {\n return value === Infinity || value === -Infinity;\n};\n\n/**\n * is.decimal\n * Test if `value` is a decimal number.\n *\n * @param {*} value value to test\n * @return {Boolean} true if `value` is a decimal number, false otherwise\n * @api public\n */\n\nis.decimal = function (value) {\n return is.number(value) && !isActualNaN(value) && !is.infinite(value) && value % 1 !== 0;\n};\n\n/**\n * is.divisibleBy\n * Test if `value` is divisible by `n`.\n *\n * @param {Number} value value to test\n * @param {Number} n dividend\n * @return {Boolean} true if `value` is divisible by `n`, false otherwise\n * @api public\n */\n\nis.divisibleBy = function (value, n) {\n var isDividendInfinite = is.infinite(value);\n var isDivisorInfinite = is.infinite(n);\n var isNonZeroNumber = is.number(value) && !isActualNaN(value) && is.number(n) && !isActualNaN(n) && n !== 0;\n return isDividendInfinite || isDivisorInfinite || (isNonZeroNumber && value % n === 0);\n};\n\n/**\n * is.integer\n * Test if `value` is an integer.\n *\n * @param value to test\n * @return {Boolean} true if `value` is an integer, false otherwise\n * @api public\n */\n\nis.integer = is['int'] = function (value) {\n return is.number(value) && !isActualNaN(value) && value % 1 === 0;\n};\n\n/**\n * is.maximum\n * Test if `value` is greater than 'others' values.\n *\n * @param {Number} value value to test\n * @param {Array} others values to compare with\n * @return {Boolean} true if `value` is greater than `others` values\n * @api public\n */\n\nis.maximum = function (value, others) {\n if (isActualNaN(value)) {\n throw new TypeError('NaN is not a valid value');\n } else if (!is.arraylike(others)) {\n throw new TypeError('second argument must be array-like');\n }\n var len = others.length;\n\n while (--len >= 0) {\n if (value < others[len]) {\n return false;\n }\n }\n\n return true;\n};\n\n/**\n * is.minimum\n * Test if `value` is less than `others` values.\n *\n * @param {Number} value value to test\n * @param {Array} others values to compare with\n * @return {Boolean} true if `value` is less than `others` values\n * @api public\n */\n\nis.minimum = function (value, others) {\n if (isActualNaN(value)) {\n throw new TypeError('NaN is not a valid value');\n } else if (!is.arraylike(others)) {\n throw new TypeError('second argument must be array-like');\n }\n var len = others.length;\n\n while (--len >= 0) {\n if (value > others[len]) {\n return false;\n }\n }\n\n return true;\n};\n\n/**\n * is.nan\n * Test if `value` is not a number.\n *\n * @param {*} value value to test\n * @return {Boolean} true if `value` is not a number, false otherwise\n * @api public\n */\n\nis.nan = function (value) {\n return !is.number(value) || value !== value;\n};\n\n/**\n * is.even\n * Test if `value` is an even number.\n *\n * @param {Number} value value to test\n * @return {Boolean} true if `value` is an even number, false otherwise\n * @api public\n */\n\nis.even = function (value) {\n return is.infinite(value) || (is.number(value) && value === value && value % 2 === 0);\n};\n\n/**\n * is.odd\n * Test if `value` is an odd number.\n *\n * @param {Number} value value to test\n * @return {Boolean} true if `value` is an odd number, false otherwise\n * @api public\n */\n\nis.odd = function (value) {\n return is.infinite(value) || (is.number(value) && value === value && value % 2 !== 0);\n};\n\n/**\n * is.ge\n * Test if `value` is greater than or equal to `other`.\n *\n * @param {Number} value value to test\n * @param {Number} other value to compare with\n * @return {Boolean}\n * @api public\n */\n\nis.ge = function (value, other) {\n if (isActualNaN(value) || isActualNaN(other)) {\n throw new TypeError('NaN is not a valid value');\n }\n return !is.infinite(value) && !is.infinite(other) && value >= other;\n};\n\n/**\n * is.gt\n * Test if `value` is greater than `other`.\n *\n * @param {Number} value value to test\n * @param {Number} other value to compare with\n * @return {Boolean}\n * @api public\n */\n\nis.gt = function (value, other) {\n if (isActualNaN(value) || isActualNaN(other)) {\n throw new TypeError('NaN is not a valid value');\n }\n return !is.infinite(value) && !is.infinite(other) && value > other;\n};\n\n/**\n * is.le\n * Test if `value` is less than or equal to `other`.\n *\n * @param {Number} value value to test\n * @param {Number} other value to compare with\n * @return {Boolean} if 'value' is less than or equal to 'other'\n * @api public\n */\n\nis.le = function (value, other) {\n if (isActualNaN(value) || isActualNaN(other)) {\n throw new TypeError('NaN is not a valid value');\n }\n return !is.infinite(value) && !is.infinite(other) && value <= other;\n};\n\n/**\n * is.lt\n * Test if `value` is less than `other`.\n *\n * @param {Number} value value to test\n * @param {Number} other value to compare with\n * @return {Boolean} if `value` is less than `other`\n * @api public\n */\n\nis.lt = function (value, other) {\n if (isActualNaN(value) || isActualNaN(other)) {\n throw new TypeError('NaN is not a valid value');\n }\n return !is.infinite(value) && !is.infinite(other) && value < other;\n};\n\n/**\n * is.within\n * Test if `value` is within `start` and `finish`.\n *\n * @param {Number} value value to test\n * @param {Number} start lower bound\n * @param {Number} finish upper bound\n * @return {Boolean} true if 'value' is is within 'start' and 'finish'\n * @api public\n */\nis.within = function (value, start, finish) {\n if (isActualNaN(value) || isActualNaN(start) || isActualNaN(finish)) {\n throw new TypeError('NaN is not a valid value');\n } else if (!is.number(value) || !is.number(start) || !is.number(finish)) {\n throw new TypeError('all arguments must be numbers');\n }\n var isAnyInfinite = is.infinite(value) || is.infinite(start) || is.infinite(finish);\n return isAnyInfinite || (value >= start && value <= finish);\n};\n\n/**\n * Test object.\n */\n\n/**\n * is.object\n * Test if `value` is an object.\n *\n * @param {*} value value to test\n * @return {Boolean} true if `value` is an object, false otherwise\n * @api public\n */\nis.object = function (value) {\n return toStr.call(value) === '[object Object]';\n};\n\n/**\n * is.primitive\n * Test if `value` is a primitive.\n *\n * @param {*} value value to test\n * @return {Boolean} true if `value` is a primitive, false otherwise\n * @api public\n */\nis.primitive = function isPrimitive(value) {\n if (!value) {\n return true;\n }\n if (typeof value === 'object' || is.object(value) || is.fn(value) || is.array(value)) {\n return false;\n }\n return true;\n};\n\n/**\n * is.hash\n * Test if `value` is a hash - a plain object literal.\n *\n * @param {*} value value to test\n * @return {Boolean} true if `value` is a hash, false otherwise\n * @api public\n */\n\nis.hash = function (value) {\n return is.object(value) && value.constructor === Object && !value.nodeType && !value.setInterval;\n};\n\n/**\n * Test regexp.\n */\n\n/**\n * is.regexp\n * Test if `value` is a regular expression.\n *\n * @param {*} value value to test\n * @return {Boolean} true if `value` is a regexp, false otherwise\n * @api public\n */\n\nis.regexp = function (value) {\n return toStr.call(value) === '[object RegExp]';\n};\n\n/**\n * Test string.\n */\n\n/**\n * is.string\n * Test if `value` is a string.\n *\n * @param {*} value value to test\n * @return {Boolean} true if 'value' is a string, false otherwise\n * @api public\n */\n\nis.string = function (value) {\n return toStr.call(value) === '[object String]';\n};\n\n/**\n * Test base64 string.\n */\n\n/**\n * is.base64\n * Test if `value` is a valid base64 encoded string.\n *\n * @param {*} value value to test\n * @return {Boolean} true if 'value' is a base64 encoded string, false otherwise\n * @api public\n */\n\nis.base64 = function (value) {\n return is.string(value) && (!value.length || base64Regex.test(value));\n};\n\n/**\n * Test base64 string.\n */\n\n/**\n * is.hex\n * Test if `value` is a valid hex encoded string.\n *\n * @param {*} value value to test\n * @return {Boolean} true if 'value' is a hex encoded string, false otherwise\n * @api public\n */\n\nis.hex = function (value) {\n return is.string(value) && (!value.length || hexRegex.test(value));\n};\n\n/**\n * is.symbol\n * Test if `value` is an ES6 Symbol\n *\n * @param {*} value value to test\n * @return {Boolean} true if `value` is a Symbol, false otherise\n * @api public\n */\n\nis.symbol = function (value) {\n return typeof Symbol === 'function' && toStr.call(value) === '[object Symbol]' && typeof symbolValueOf.call(value) === 'symbol';\n};\n\n/**\n * is.bigint\n * Test if `value` is an ES-proposed BigInt\n *\n * @param {*} value value to test\n * @return {Boolean} true if `value` is a BigInt, false otherise\n * @api public\n */\n\nis.bigint = function (value) {\n // eslint-disable-next-line valid-typeof\n return typeof BigInt === 'function' && toStr.call(value) === '[object BigInt]' && typeof bigIntValueOf.call(value) === 'bigint';\n};\n\nmodule.exports = is;\n","(function(){\r\n var crypt = require('crypt'),\r\n utf8 = require('charenc').utf8,\r\n isBuffer = require('is-buffer'),\r\n bin = require('charenc').bin,\r\n\r\n // The core\r\n md5 = function (message, options) {\r\n // Convert to byte array\r\n if (message.constructor == String)\r\n if (options && options.encoding === 'binary')\r\n message = bin.stringToBytes(message);\r\n else\r\n message = utf8.stringToBytes(message);\r\n else if (isBuffer(message))\r\n message = Array.prototype.slice.call(message, 0);\r\n else if (!Array.isArray(message))\r\n message = message.toString();\r\n // else, assume byte array already\r\n\r\n var m = crypt.bytesToWords(message),\r\n l = message.length * 8,\r\n a = 1732584193,\r\n b = -271733879,\r\n c = -1732584194,\r\n d = 271733878;\r\n\r\n // Swap endian\r\n for (var i = 0; i < m.length; i++) {\r\n m[i] = ((m[i] << 8) | (m[i] >>> 24)) & 0x00FF00FF |\r\n ((m[i] << 24) | (m[i] >>> 8)) & 0xFF00FF00;\r\n }\r\n\r\n // Padding\r\n m[l >>> 5] |= 0x80 << (l % 32);\r\n m[(((l + 64) >>> 9) << 4) + 14] = l;\r\n\r\n // Method shortcuts\r\n var FF = md5._ff,\r\n GG = md5._gg,\r\n HH = md5._hh,\r\n II = md5._ii;\r\n\r\n for (var i = 0; i < m.length; i += 16) {\r\n\r\n var aa = a,\r\n bb = b,\r\n cc = c,\r\n dd = d;\r\n\r\n a = FF(a, b, c, d, m[i+ 0], 7, -680876936);\r\n d = FF(d, a, b, c, m[i+ 1], 12, -389564586);\r\n c = FF(c, d, a, b, m[i+ 2], 17, 606105819);\r\n b = FF(b, c, d, a, m[i+ 3], 22, -1044525330);\r\n a = FF(a, b, c, d, m[i+ 4], 7, -176418897);\r\n d = FF(d, a, b, c, m[i+ 5], 12, 1200080426);\r\n c = FF(c, d, a, b, m[i+ 6], 17, -1473231341);\r\n b = FF(b, c, d, a, m[i+ 7], 22, -45705983);\r\n a = FF(a, b, c, d, m[i+ 8], 7, 1770035416);\r\n d = FF(d, a, b, c, m[i+ 9], 12, -1958414417);\r\n c = FF(c, d, a, b, m[i+10], 17, -42063);\r\n b = FF(b, c, d, a, m[i+11], 22, -1990404162);\r\n a = FF(a, b, c, d, m[i+12], 7, 1804603682);\r\n d = FF(d, a, b, c, m[i+13], 12, -40341101);\r\n c = FF(c, d, a, b, m[i+14], 17, -1502002290);\r\n b = FF(b, c, d, a, m[i+15], 22, 1236535329);\r\n\r\n a = GG(a, b, c, d, m[i+ 1], 5, -165796510);\r\n d = GG(d, a, b, c, m[i+ 6], 9, -1069501632);\r\n c = GG(c, d, a, b, m[i+11], 14, 643717713);\r\n b = GG(b, c, d, a, m[i+ 0], 20, -373897302);\r\n a = GG(a, b, c, d, m[i+ 5], 5, -701558691);\r\n d = GG(d, a, b, c, m[i+10], 9, 38016083);\r\n c = GG(c, d, a, b, m[i+15], 14, -660478335);\r\n b = GG(b, c, d, a, m[i+ 4], 20, -405537848);\r\n a = GG(a, b, c, d, m[i+ 9], 5, 568446438);\r\n d = GG(d, a, b, c, m[i+14], 9, -1019803690);\r\n c = GG(c, d, a, b, m[i+ 3], 14, -187363961);\r\n b = GG(b, c, d, a, m[i+ 8], 20, 1163531501);\r\n a = GG(a, b, c, d, m[i+13], 5, -1444681467);\r\n d = GG(d, a, b, c, m[i+ 2], 9, -51403784);\r\n c = GG(c, d, a, b, m[i+ 7], 14, 1735328473);\r\n b = GG(b, c, d, a, m[i+12], 20, -1926607734);\r\n\r\n a = HH(a, b, c, d, m[i+ 5], 4, -378558);\r\n d = HH(d, a, b, c, m[i+ 8], 11, -2022574463);\r\n c = HH(c, d, a, b, m[i+11], 16, 1839030562);\r\n b = HH(b, c, d, a, m[i+14], 23, -35309556);\r\n a = HH(a, b, c, d, m[i+ 1], 4, -1530992060);\r\n d = HH(d, a, b, c, m[i+ 4], 11, 1272893353);\r\n c = HH(c, d, a, b, m[i+ 7], 16, -155497632);\r\n b = HH(b, c, d, a, m[i+10], 23, -1094730640);\r\n a = HH(a, b, c, d, m[i+13], 4, 681279174);\r\n d = HH(d, a, b, c, m[i+ 0], 11, -358537222);\r\n c = HH(c, d, a, b, m[i+ 3], 16, -722521979);\r\n b = HH(b, c, d, a, m[i+ 6], 23, 76029189);\r\n a = HH(a, b, c, d, m[i+ 9], 4, -640364487);\r\n d = HH(d, a, b, c, m[i+12], 11, -421815835);\r\n c = HH(c, d, a, b, m[i+15], 16, 530742520);\r\n b = HH(b, c, d, a, m[i+ 2], 23, -995338651);\r\n\r\n a = II(a, b, c, d, m[i+ 0], 6, -198630844);\r\n d = II(d, a, b, c, m[i+ 7], 10, 1126891415);\r\n c = II(c, d, a, b, m[i+14], 15, -1416354905);\r\n b = II(b, c, d, a, m[i+ 5], 21, -57434055);\r\n a = II(a, b, c, d, m[i+12], 6, 1700485571);\r\n d = II(d, a, b, c, m[i+ 3], 10, -1894986606);\r\n c = II(c, d, a, b, m[i+10], 15, -1051523);\r\n b = II(b, c, d, a, m[i+ 1], 21, -2054922799);\r\n a = II(a, b, c, d, m[i+ 8], 6, 1873313359);\r\n d = II(d, a, b, c, m[i+15], 10, -30611744);\r\n c = II(c, d, a, b, m[i+ 6], 15, -1560198380);\r\n b = II(b, c, d, a, m[i+13], 21, 1309151649);\r\n a = II(a, b, c, d, m[i+ 4], 6, -145523070);\r\n d = II(d, a, b, c, m[i+11], 10, -1120210379);\r\n c = II(c, d, a, b, m[i+ 2], 15, 718787259);\r\n b = II(b, c, d, a, m[i+ 9], 21, -343485551);\r\n\r\n a = (a + aa) >>> 0;\r\n b = (b + bb) >>> 0;\r\n c = (c + cc) >>> 0;\r\n d = (d + dd) >>> 0;\r\n }\r\n\r\n return crypt.endian([a, b, c, d]);\r\n };\r\n\r\n // Auxiliary functions\r\n md5._ff = function (a, b, c, d, x, s, t) {\r\n var n = a + (b & c | ~b & d) + (x >>> 0) + t;\r\n return ((n << s) | (n >>> (32 - s))) + b;\r\n };\r\n md5._gg = function (a, b, c, d, x, s, t) {\r\n var n = a + (b & d | c & ~d) + (x >>> 0) + t;\r\n return ((n << s) | (n >>> (32 - s))) + b;\r\n };\r\n md5._hh = function (a, b, c, d, x, s, t) {\r\n var n = a + (b ^ c ^ d) + (x >>> 0) + t;\r\n return ((n << s) | (n >>> (32 - s))) + b;\r\n };\r\n md5._ii = function (a, b, c, d, x, s, t) {\r\n var n = a + (c ^ (b | ~d)) + (x >>> 0) + t;\r\n return ((n << s) | (n >>> (32 - s))) + b;\r\n };\r\n\r\n // Package private blocksize\r\n md5._blocksize = 16;\r\n md5._digestsize = 16;\r\n\r\n module.exports = function (message, options) {\r\n if (message === undefined || message === null)\r\n throw new Error('Illegal argument ' + message);\r\n\r\n var digestbytes = crypt.wordsToBytes(md5(message, options));\r\n return options && options.asBytes ? digestbytes :\r\n options && options.asString ? bin.bytesToString(digestbytes) :\r\n crypt.bytesToHex(digestbytes);\r\n };\r\n\r\n})();\r\n","import logger from \"../../utils/logUtil\";\nimport md5 from \"md5\";\n\nclass INTERCOM {\n constructor(config) {\n this.NAME = \"INTERCOM\";\n this.API_KEY = config.apiKey;\n this.APP_ID = config.appId;\n this.MOBILE_APP_ID = config.mobileAppId;\n logger.debug(\"Config \", config);\n }\n\n init() {\n window.intercomSettings = {\n app_id: this.APP_ID\n };\n\n (function() {\n var w = window;\n var ic = w.Intercom;\n if (typeof ic === \"function\") {\n ic(\"reattach_activator\");\n ic(\"update\", w.intercomSettings);\n } else {\n var d = document;\n var i = function() {\n i.c(arguments);\n };\n i.q = [];\n i.c = function(args) {\n i.q.push(args);\n };\n w.Intercom = i;\n var l = function() {\n var s = d.createElement(\"script\");\n s.type = \"text/javascript\";\n s.async = true;\n s.src =\n \"https://widget.intercom.io/widget/\" +\n window.intercomSettings.app_id;\n var x = d.getElementsByTagName(\"script\")[0];\n x.parentNode.insertBefore(s, x);\n };\n if (document.readyState === \"complete\") {\n l();\n window.intercom_code = true;\n } else if (w.attachEvent) {\n w.attachEvent(\"onload\", l);\n window.intercom_code = true;\n } else {\n w.addEventListener(\"load\", l, false);\n window.intercom_code = true;\n }\n }\n })();\n }\n\n page() {\n // Get new messages of the current user\n window.Intercom(\"update\");\n }\n\n identify(rudderElement) {\n let rawPayload = {};\n const context = rudderElement.message.context;\n\n const identityVerificationProps = context.Intercom\n ? context.Intercom\n : null;\n if (identityVerificationProps != null) {\n // user hash\n const userHash = context.Intercom.user_hash\n ? context.Intercom.user_hash\n : null;\n\n if (userHash != null) {\n rawPayload.user_hash = userHash;\n }\n\n // hide default launcher\n const hideDefaultLauncher = context.Intercom.hideDefaultLauncher\n ? context.Intercom.hideDefaultLauncher\n : null;\n\n if (hideDefaultLauncher != null) {\n rawPayload.hide_default_launcher = hideDefaultLauncher;\n }\n }\n\n // map rudderPayload to desired\n Object.keys(context.traits).forEach(field => {\n if (context.traits.hasOwnProperty(field)) {\n const value = context.traits[field];\n\n if (field === \"company\") {\n let companies = [];\n let company = {};\n // special handling string\n if (typeof context.traits[field] == \"string\") {\n company[\"company_id\"] = md5(context.traits[field]);\n }\n const companyFields =\n (typeof context.traits[field] == \"object\" &&\n Object.keys(context.traits[field])) ||\n [];\n companyFields.forEach(key => {\n if (companyFields.hasOwnProperty(key)) {\n if (key != \"id\") {\n company[key] = context.traits[field][key];\n } else {\n company[\"company_id\"] = context.traits[field][key];\n }\n }\n });\n\n if (\n typeof context.traits[field] == \"object\" &&\n !companyFields.includes(\"id\")\n ) {\n company[\"company_id\"] = md5(company.name);\n }\n\n companies.push(company);\n rawPayload.companies = companies;\n } else {\n rawPayload[field] = context.traits[field];\n }\n\n switch (field) {\n case \"createdAt\":\n rawPayload[\"created_at\"] = value;\n break;\n case \"anonymousId\":\n rawPayload[\"user_id\"] = value;\n break;\n\n default:\n break;\n }\n }\n });\n rawPayload.user_id = rudderElement.message.userId;\n window.Intercom(\"update\", rawPayload);\n }\n\n track(rudderElement) {\n let rawPayload = {};\n const message = rudderElement.message;\n\n const properties = message.properties\n ? Object.keys(message.properties)\n : null;\n properties.forEach(property => {\n const value = message.properties[property];\n rawPayload[property] = value;\n });\n\n if (message.event) {\n rawPayload.event_name = message.event;\n }\n rawPayload.user_id = message.userId ? message.userId : message.anonymousId;\n rawPayload.created_at = Math.floor(\n new Date(message.originalTimestamp).getTime() / 1000\n );\n window.Intercom(\"trackEvent\", rawPayload.event_name, rawPayload);\n }\n\n isLoaded() {\n return !!window.intercom_code;\n }\n\n isReady() {\n return !!window.intercom_code;\n }\n}\n\nexport { INTERCOM };\n","import logger from \"../../utils/logUtil\";\nimport { ScriptLoader } from \"../ScriptLoader\";\nclass Keen {\n constructor(config) {\n this.projectID = config.projectID;\n this.writeKey = config.writeKey;\n this.ipAddon = config.ipAddon;\n this.uaAddon = config.uaAddon;\n this.urlAddon = config.urlAddon;\n this.referrerAddon = config.referrerAddon;\n this.client = null;\n this.name = \"KEEN\";\n }\n\n init() {\n logger.debug(\"===in init Keen===\");\n ScriptLoader(\n \"keen-integration\",\n \"https://cdn.jsdelivr.net/npm/keen-tracking@4\"\n );\n\n var check = setInterval(checkAndInitKeen.bind(this), 1000);\n function initKeen(object) {\n object.client = new window.KeenTracking({\n projectId: object.projectID,\n writeKey: object.writeKey\n });\n return object.client;\n }\n function checkAndInitKeen() {\n if (window.KeenTracking !== undefined && window.KeenTracking !== void 0) {\n this.client = initKeen(this);\n clearInterval(check);\n }\n }\n }\n\n identify(rudderElement) {\n logger.debug(\"in Keen identify\");\n let traits = rudderElement.message.context.traits;\n let userId = rudderElement.message.userId\n ? rudderElement.message.userId\n : rudderElement.message.anonymousId;\n let properties = rudderElement.message.properties\n ? Object.assign(properties, rudderElement.message.properties)\n : {};\n properties.user = {\n userId: userId,\n traits: traits\n };\n properties = this.getAddOn(properties);\n this.client.extendEvents(properties);\n }\n\n track(rudderElement) {\n logger.debug(\"in Keen track\");\n\n var event = rudderElement.message.event;\n var properties = rudderElement.message.properties;\n properties = this.getAddOn(properties);\n this.client.recordEvent(event, properties);\n }\n\n page(rudderElement) {\n logger.debug(\"in Keen page\");\n const pageName = rudderElement.message.name;\n const pageCategory = rudderElement.message.properties\n ? rudderElement.message.properties.category\n : undefined;\n var name = \"Loaded a Page\";\n if (pageName) {\n name = \"Viewed \" + pageName + \" page\";\n }\n if (pageCategory && pageName) {\n name = \"Viewed \" + pageCategory + \" \" + pageName + \" page\";\n }\n\n var properties = rudderElement.message.properties;\n properties = this.getAddOn(properties);\n this.client.recordEvent(name, properties);\n }\n\n isLoaded() {\n logger.debug(\"in Keen isLoaded\");\n return !!(this.client != null);\n }\n\n isReady() {\n return !!(this.client != null);\n }\n\n getAddOn(properties) {\n var addOns = [];\n if (this.ipAddon) {\n properties.ip_address = \"${keen.ip}\";\n addOns.push({\n name: \"keen:ip_to_geo\",\n input: {\n ip: \"ip_address\"\n },\n output: \"ip_geo_info\"\n });\n }\n if (this.uaAddon) {\n properties.user_agent = \"${keen.user_agent}\";\n addOns.push({\n name: \"keen:ua_parser\",\n input: {\n ua_string: \"user_agent\"\n },\n output: \"parsed_user_agent\"\n });\n }\n if (this.urlAddon) {\n properties.page_url = document.location.href;\n addOns.push({\n name: \"keen:url_parser\",\n input: {\n url: \"page_url\"\n },\n output: \"parsed_page_url\"\n });\n }\n if (this.referrerAddon) {\n properties.page_url = document.location.href;\n properties.referrer_url = document.referrer;\n addOns.push({\n name: \"keen:referrer_parser\",\n input: {\n referrer_url: \"referrer_url\",\n page_url: \"page_url\"\n },\n output: \"referrer_info\"\n });\n }\n properties.keen = {\n addons: addOns\n };\n return properties;\n }\n}\n\nexport { Keen };\n","\n/**\n * Module Dependencies\n */\n\nvar expr;\ntry {\n expr = require('props');\n} catch(e) {\n expr = require('component-props');\n}\n\n/**\n * Expose `toFunction()`.\n */\n\nmodule.exports = toFunction;\n\n/**\n * Convert `obj` to a `Function`.\n *\n * @param {Mixed} obj\n * @return {Function}\n * @api private\n */\n\nfunction toFunction(obj) {\n switch ({}.toString.call(obj)) {\n case '[object Object]':\n return objectToFunction(obj);\n case '[object Function]':\n return obj;\n case '[object String]':\n return stringToFunction(obj);\n case '[object RegExp]':\n return regexpToFunction(obj);\n default:\n return defaultToFunction(obj);\n }\n}\n\n/**\n * Default to strict equality.\n *\n * @param {Mixed} val\n * @return {Function}\n * @api private\n */\n\nfunction defaultToFunction(val) {\n return function(obj){\n return val === obj;\n };\n}\n\n/**\n * Convert `re` to a function.\n *\n * @param {RegExp} re\n * @return {Function}\n * @api private\n */\n\nfunction regexpToFunction(re) {\n return function(obj){\n return re.test(obj);\n };\n}\n\n/**\n * Convert property `str` to a function.\n *\n * @param {String} str\n * @return {Function}\n * @api private\n */\n\nfunction stringToFunction(str) {\n // immediate such as \"> 20\"\n if (/^ *\\W+/.test(str)) return new Function('_', 'return _ ' + str);\n\n // properties such as \"name.first\" or \"age > 18\" or \"age > 18 && age < 36\"\n return new Function('_', 'return ' + get(str));\n}\n\n/**\n * Convert `object` to a function.\n *\n * @param {Object} object\n * @return {Function}\n * @api private\n */\n\nfunction objectToFunction(obj) {\n var match = {};\n for (var key in obj) {\n match[key] = typeof obj[key] === 'string'\n ? defaultToFunction(obj[key])\n : toFunction(obj[key]);\n }\n return function(val){\n if (typeof val !== 'object') return false;\n for (var key in match) {\n if (!(key in val)) return false;\n if (!match[key](val[key])) return false;\n }\n return true;\n };\n}\n\n/**\n * Built the getter function. Supports getter style functions\n *\n * @param {String} str\n * @return {String}\n * @api private\n */\n\nfunction get(str) {\n var props = expr(str);\n if (!props.length) return '_.' + str;\n\n var val, i, prop;\n for (i = 0; i < props.length; i++) {\n prop = props[i];\n val = '_.' + prop;\n val = \"('function' == typeof \" + val + \" ? \" + val + \"() : \" + val + \")\";\n\n // mimic negative lookbehind to avoid problems with nested properties\n str = stripNested(prop, str, val);\n }\n\n return str;\n}\n\n/**\n * Mimic negative lookbehind to avoid problems with nested properties.\n *\n * See: http://blog.stevenlevithan.com/archives/mimic-lookbehind-javascript\n *\n * @param {String} prop\n * @param {String} str\n * @param {String} val\n * @return {String}\n * @api private\n */\n\nfunction stripNested (prop, str, val) {\n return str.replace(new RegExp('(\\\\.)?' + prop, 'g'), function($0, $1) {\n return $1 ? $0 : val;\n });\n}\n","'use strict';\n\nvar has = Object.prototype.hasOwnProperty;\n\n/**\n * Copy the properties of one or more `objects` onto a destination object. Input objects are iterated over\n * in left-to-right order, so duplicate properties on later objects will overwrite those from\n * erevious ones. Only enumerable and own properties of the input objects are copied onto the\n * resulting object.\n *\n * @name extend\n * @api public\n * @category Object\n * @param {Object} dest The destination object.\n * @param {...Object} sources The source objects.\n * @return {Object} `dest`, extended with the properties of all `sources`.\n * @example\n * var a = { a: 'a' };\n * var b = { b: 'b' };\n * var c = { c: 'c' };\n *\n * extend(a, b, c);\n * //=> { a: 'a', b: 'b', c: 'c' };\n */\nvar extend = function extend(dest /*, sources */) {\n var sources = Array.prototype.slice.call(arguments, 1);\n\n for (var i = 0; i < sources.length; i += 1) {\n for (var key in sources[i]) {\n if (has.call(sources[i], key)) {\n dest[key] = sources[i][key];\n }\n }\n }\n\n return dest;\n};\n\n/*\n * Exports.\n */\n\nmodule.exports = extend;\n","\nvar identity = function(_){ return _; };\n\n\n/**\n * Module exports, export\n */\n\nmodule.exports = multiple(find);\nmodule.exports.find = module.exports;\n\n\n/**\n * Export the replacement function, return the modified object\n */\n\nmodule.exports.replace = function (obj, key, val, options) {\n multiple(replace).call(this, obj, key, val, options);\n return obj;\n};\n\n\n/**\n * Export the delete function, return the modified object\n */\n\nmodule.exports.del = function (obj, key, options) {\n multiple(del).call(this, obj, key, null, options);\n return obj;\n};\n\n\n/**\n * Compose applying the function to a nested key\n */\n\nfunction multiple (fn) {\n return function (obj, path, val, options) {\n normalize = options && isFunction(options.normalizer) ? options.normalizer : defaultNormalize;\n path = normalize(path);\n\n var key;\n var finished = false;\n\n while (!finished) loop();\n\n function loop() {\n for (key in obj) {\n var normalizedKey = normalize(key);\n if (0 === path.indexOf(normalizedKey)) {\n var temp = path.substr(normalizedKey.length);\n if (temp.charAt(0) === '.' || temp.length === 0) {\n path = temp.substr(1);\n var child = obj[key];\n\n // we're at the end and there is nothing.\n if (null == child) {\n finished = true;\n return;\n }\n\n // we're at the end and there is something.\n if (!path.length) {\n finished = true;\n return;\n }\n\n // step into child\n obj = child;\n\n // but we're done here\n return;\n }\n }\n }\n\n key = undefined;\n // if we found no matching properties\n // on the current object, there's no match.\n finished = true;\n }\n\n if (!key) return;\n if (null == obj) return obj;\n\n // the `obj` and `key` is one above the leaf object and key, so\n // start object: { a: { 'b.c': 10 } }\n // end object: { 'b.c': 10 }\n // end key: 'b.c'\n // this way, you can do `obj[key]` and get `10`.\n return fn(obj, key, val);\n };\n}\n\n\n/**\n * Find an object by its key\n *\n * find({ first_name : 'Calvin' }, 'firstName')\n */\n\nfunction find (obj, key) {\n if (obj.hasOwnProperty(key)) return obj[key];\n}\n\n\n/**\n * Delete a value for a given key\n *\n * del({ a : 'b', x : 'y' }, 'X' }) -> { a : 'b' }\n */\n\nfunction del (obj, key) {\n if (obj.hasOwnProperty(key)) delete obj[key];\n return obj;\n}\n\n\n/**\n * Replace an objects existing value with a new one\n *\n * replace({ a : 'b' }, 'a', 'c') -> { a : 'c' }\n */\n\nfunction replace (obj, key, val) {\n if (obj.hasOwnProperty(key)) obj[key] = val;\n return obj;\n}\n\n/**\n * Normalize a `dot.separated.path`.\n *\n * A.HELL(!*(!)O_WOR LD.bar => ahelloworldbar\n *\n * @param {String} path\n * @return {String}\n */\n\nfunction defaultNormalize(path) {\n return path.replace(/[^a-zA-Z0-9\\.]+/g, '').toLowerCase();\n}\n\n/**\n * Check if a value is a function.\n *\n * @param {*} val\n * @return {boolean} Returns `true` if `val` is a function, otherwise `false`.\n */\n\nfunction isFunction(val) {\n return typeof val === 'function';\n}\n","\n/**\n * toString ref.\n */\n\nvar toString = Object.prototype.toString;\n\n/**\n * Return the type of `val`.\n *\n * @param {Mixed} val\n * @return {String}\n * @api public\n */\n\nmodule.exports = function(val){\n switch (toString.call(val)) {\n case '[object Function]': return 'function';\n case '[object Date]': return 'date';\n case '[object RegExp]': return 'regexp';\n case '[object Arguments]': return 'arguments';\n case '[object Array]': return 'array';\n case '[object String]': return 'string';\n }\n\n if (val === null) return 'null';\n if (val === undefined) return 'undefined';\n if (val && val.nodeType === 1) return 'element';\n if (val === Object(val)) return 'object';\n\n return typeof val;\n};\n","/**\n * Global Names\n */\n\nvar globals = /\\b(Array|Date|Object|Math|JSON)\\b/g;\n\n/**\n * Return immediate identifiers parsed from `str`.\n *\n * @param {String} str\n * @param {String|Function} map function or prefix\n * @return {Array}\n * @api public\n */\n\nmodule.exports = function(str, fn){\n var p = unique(props(str));\n if (fn && 'string' == typeof fn) fn = prefixed(fn);\n if (fn) return map(str, p, fn);\n return p;\n};\n\n/**\n * Return immediate identifiers in `str`.\n *\n * @param {String} str\n * @return {Array}\n * @api private\n */\n\nfunction props(str) {\n return str\n .replace(/\\.\\w+|\\w+ *\\(|\"[^\"]*\"|'[^']*'|\\/([^/]+)\\//g, '')\n .replace(globals, '')\n .match(/[a-zA-Z_]\\w*/g)\n || [];\n}\n\n/**\n * Return `str` with `props` mapped with `fn`.\n *\n * @param {String} str\n * @param {Array} props\n * @param {Function} fn\n * @return {String}\n * @api private\n */\n\nfunction map(str, props, fn) {\n var re = /\\.\\w+|\\w+ *\\(|\"[^\"]*\"|'[^']*'|\\/([^/]+)\\/|[a-zA-Z_]\\w*/g;\n return str.replace(re, function(_){\n if ('(' == _[_.length - 1]) return fn(_);\n if (!~props.indexOf(_)) return _;\n return fn(_);\n });\n}\n\n/**\n * Return unique array.\n *\n * @param {Array} arr\n * @return {Array}\n * @api private\n */\n\nfunction unique(arr) {\n var ret = [];\n\n for (var i = 0; i < arr.length; i++) {\n if (~ret.indexOf(arr[i])) continue;\n ret.push(arr[i]);\n }\n\n return ret;\n}\n\n/**\n * Map with prefix `str`.\n */\n\nfunction prefixed(str) {\n return function(_){\n return str + _;\n };\n}\n","\n/**\n * Module dependencies.\n */\n\ntry {\n var type = require('type');\n} catch (err) {\n var type = require('component-type');\n}\n\nvar toFunction = require('to-function');\n\n/**\n * HOP reference.\n */\n\nvar has = Object.prototype.hasOwnProperty;\n\n/**\n * Iterate the given `obj` and invoke `fn(val, i)`\n * in optional context `ctx`.\n *\n * @param {String|Array|Object} obj\n * @param {Function} fn\n * @param {Object} [ctx]\n * @api public\n */\n\nmodule.exports = function(obj, fn, ctx){\n fn = toFunction(fn);\n ctx = ctx || this;\n switch (type(obj)) {\n case 'array':\n return array(obj, fn, ctx);\n case 'object':\n if ('number' == typeof obj.length) return array(obj, fn, ctx);\n return object(obj, fn, ctx);\n case 'string':\n return string(obj, fn, ctx);\n }\n};\n\n/**\n * Iterate string chars.\n *\n * @param {String} obj\n * @param {Function} fn\n * @param {Object} ctx\n * @api private\n */\n\nfunction string(obj, fn, ctx) {\n for (var i = 0; i < obj.length; ++i) {\n fn.call(ctx, obj.charAt(i), i);\n }\n}\n\n/**\n * Iterate object keys.\n *\n * @param {Object} obj\n * @param {Function} fn\n * @param {Object} ctx\n * @api private\n */\n\nfunction object(obj, fn, ctx) {\n for (var key in obj) {\n if (has.call(obj, key)) {\n fn.call(ctx, key, obj[key]);\n }\n }\n}\n\n/**\n * Iterate array-ish.\n *\n * @param {Array|Object} obj\n * @param {Function} fn\n * @param {Object} ctx\n * @api private\n */\n\nfunction array(obj, fn, ctx) {\n for (var i = 0; i < obj.length; ++i) {\n fn.call(ctx, obj[i], i);\n }\n}\n","import logger from \"../../utils/logUtil\";\nimport { getRevenue } from \"../../utils/utils\";\nimport is from \"is\";\nimport extend from \"@ndhoule/extend\";\nimport { del } from \"obj-case\";\nimport each from \"component-each\";\n\nclass Kissmetrics {\n constructor(config) {\n this.apiKey = config.apiKey;\n this.prefixProperties = config.prefixProperties;\n this.name = \"KISSMETRICS\";\n }\n\n init() {\n logger.debug(\"===in init Kissmetrics===\");\n window._kmq = window._kmq || [];\n\n var _kmk = window._kmk || this.apiKey;\n function _kms(u) {\n setTimeout(function() {\n var d = document,\n f = d.getElementsByTagName(\"script\")[0],\n s = d.createElement(\"script\");\n s.type = \"text/javascript\";\n s.async = true;\n s.src = u;\n f.parentNode.insertBefore(s, f);\n }, 1);\n }\n _kms(\"//i.kissmetrics.com/i.js\");\n _kms(\"//scripts.kissmetrics.com/\" + _kmk + \".2.js\");\n\n if (this.isEnvMobile()) {\n window._kmq.push([\"set\", { \"Mobile Session\": \"Yes\" }]);\n }\n }\n\n isEnvMobile() {\n return (\n navigator.userAgent.match(/Android/i) ||\n navigator.userAgent.match(/BlackBerry/i) ||\n navigator.userAgent.match(/IEMobile/i) ||\n navigator.userAgent.match(/Opera Mini/i) ||\n navigator.userAgent.match(/iPad/i) ||\n navigator.userAgent.match(/iPhone|iPod/i)\n );\n }\n\n // source : https://github.com/segment-integrations/analytics.js-integration-kissmetrics/blob/master/lib/index.js\n toUnixTimestamp(date) {\n date = new Date(date);\n return Math.floor(date.getTime() / 1000);\n }\n\n // source : https://github.com/segment-integrations/analytics.js-integration-kissmetrics/blob/master/lib/index.js\n clean(obj) {\n var ret = {};\n\n for (var k in obj) {\n if (obj.hasOwnProperty(k)) {\n var value = obj[k];\n if (value === null || typeof value === \"undefined\") continue;\n\n // convert date to unix\n if (is.date(value)) {\n ret[k] = this.toUnixTimestamp(value);\n continue;\n }\n\n // leave boolean as is\n if (is.bool(value)) {\n ret[k] = value;\n continue;\n }\n\n // leave numbers as is\n if (is.number(value)) {\n ret[k] = value;\n continue;\n }\n\n // convert non objects to strings\n logger.debug(value.toString());\n if (value.toString() !== \"[object Object]\") {\n ret[k] = value.toString();\n continue;\n }\n\n // json\n // must flatten including the name of the original trait/property\n var nestedObj = {};\n nestedObj[k] = value;\n var flattenedObj = this.flatten(nestedObj, { safe: true });\n\n // stringify arrays inside nested object to be consistent with top level behavior of arrays\n for (var key in flattenedObj) {\n if (is.array(flattenedObj[key])) {\n flattenedObj[key] = flattenedObj[key].toString();\n }\n }\n\n ret = extend(ret, flattenedObj);\n delete ret[k];\n }\n }\n return ret;\n }\n\n // source : https://github.com/segment-integrations/analytics.js-integration-kissmetrics/blob/master/lib/index.js\n flatten(target, opts) {\n opts = opts || {};\n\n var delimiter = opts.delimiter || \".\";\n var maxDepth = opts.maxDepth;\n var currentDepth = 1;\n var output = {};\n\n function step(object, prev) {\n for (var key in object) {\n if (object.hasOwnProperty(key)) {\n var value = object[key];\n var isarray = opts.safe && is.array(value);\n var type = Object.prototype.toString.call(value);\n var isobject =\n type === \"[object Object]\" || type === \"[object Array]\";\n var arr = [];\n\n var newKey = prev ? prev + delimiter + key : key;\n\n if (!opts.maxDepth) {\n maxDepth = currentDepth + 1;\n }\n\n for (var keys in value) {\n if (value.hasOwnProperty(keys)) {\n arr.push(keys);\n }\n }\n\n if (!isarray && isobject && arr.length && currentDepth < maxDepth) {\n ++currentDepth;\n return step(value, newKey);\n }\n\n output[newKey] = value;\n }\n }\n }\n\n step(target);\n\n return output;\n }\n\n // source : https://github.com/segment-integrations/analytics.js-integration-kissmetrics/blob/master/lib/index.js\n prefix(event, properties) {\n var prefixed = {};\n each(properties, function(key, val) {\n if (key === \"Billing Amount\") {\n prefixed[key] = val;\n } else if (key === \"revenue\") {\n prefixed[event + \" - \" + key] = val;\n prefixed[\"Billing Amount\"] = val;\n } else {\n prefixed[event + \" - \" + key] = val;\n }\n });\n return prefixed;\n }\n\n identify(rudderElement) {\n logger.debug(\"in Kissmetrics identify\");\n let traits = this.clean(rudderElement.message.context.traits);\n let userId =\n rudderElement.message.userId && rudderElement.message.userId != \"\"\n ? rudderElement.message.userId\n : undefined;\n\n if (userId) {\n window._kmq.push([\"identify\", userId]);\n }\n if (traits) {\n window._kmq.push([\"set\", traits]);\n }\n }\n\n track(rudderElement) {\n logger.debug(\"in Kissmetrics track\");\n\n let event = rudderElement.message.event;\n let properties = JSON.parse(\n JSON.stringify(rudderElement.message.properties)\n );\n let timestamp = this.toUnixTimestamp(new Date());\n\n let revenue = getRevenue(properties);\n if (revenue) {\n properties.revenue = revenue;\n }\n\n let products = properties.products;\n if (products) {\n delete properties.products;\n }\n\n properties = this.clean(properties);\n logger.debug(JSON.stringify(properties));\n\n if (this.prefixProperties) {\n properties = this.prefix(event, properties);\n }\n window._kmq.push([\"record\", event, properties]);\n\n let iterator = function pushItem(product, i) {\n let item = product;\n if (this.prefixProperties) item = this.prefix(event, item);\n item._t = timestamp + i;\n item._d = 1;\n window.KM.set(item);\n }.bind(this);\n\n if (products) {\n window._kmq.push(() => {\n each(products, iterator);\n });\n }\n }\n\n page(rudderElement) {\n logger.debug(\"in Kissmetrics page\");\n const pageName = rudderElement.message.name;\n const pageCategory = rudderElement.message.properties\n ? rudderElement.message.properties.category\n : undefined;\n var name = \"Loaded a Page\";\n if (pageName) {\n name = \"Viewed \" + pageName + \" page\";\n }\n if (pageCategory && pageName) {\n name = \"Viewed \" + pageCategory + \" \" + pageName + \" page\";\n }\n\n var properties = rudderElement.message.properties;\n if (this.prefixProperties) {\n properties = this.prefix(\"Page\", properties);\n }\n\n window._kmq.push([\"record\", name, properties]);\n }\n\n alias(rudderElement) {\n var prev = rudderElement.message.previousId;\n var userId = rudderElement.message.userId;\n window._kmq.push([\"alias\", userId, prev]);\n }\n\n group(rudderElement) {\n let groupId = rudderElement.message.groupId;\n let groupTraits = rudderElement.message.traits;\n groupTraits = this.prefix(\"Group\", groupTraits);\n if(groupId){\n groupTraits[\"Group - id\"] = groupId;\n }\n window._kmq.push([\"set\", groupTraits]);\n logger.debug(\"in Kissmetrics group\");\n }\n\n isLoaded() {\n return is.object(window.KM);\n }\n\n isReady() {\n return is.object(window.KM);\n }\n}\n\nexport { Kissmetrics };\n","import logger from \"../../utils/logUtil\";\nclass CustomerIO {\n constructor(config) {\n this.siteID = config.siteID;\n this.apiKey = config.apiKey;\n\n this.name = \"CUSTOMERIO\";\n }\n\n init() {\n logger.debug(\"===in init Customer IO init===\");\n window._cio = window._cio || [];\n let siteID = this.siteID;\n (function() {\n var a, b, c;\n a = function(f) {\n return function() {\n window._cio.push(\n [f].concat(Array.prototype.slice.call(arguments, 0))\n );\n };\n };\n b = [\"load\", \"identify\", \"sidentify\", \"track\", \"page\"];\n for (c = 0; c < b.length; c++) {\n window._cio[b[c]] = a(b[c]);\n }\n var t = document.createElement(\"script\"),\n s = document.getElementsByTagName(\"script\")[0];\n t.async = true;\n t.id = \"cio-tracker\";\n t.setAttribute(\"data-site-id\", siteID);\n t.src = \"https://assets.customer.io/assets/track.js\";\n s.parentNode.insertBefore(t, s);\n })();\n }\n\n identify(rudderElement) {\n logger.debug(\"in Customer IO identify\");\n let userId = rudderElement.message.userId\n ? rudderElement.message.userId\n : rudderElement.message.anonymousId;\n let traits = rudderElement.message.context.traits\n ? rudderElement.message.context.traits\n : {};\n if (!traits.created_at) {\n traits.created_at = Math.floor(new Date().getTime() / 1000);\n }\n traits.id = userId;\n window._cio.identify(traits);\n }\n\n track(rudderElement) {\n logger.debug(\"in Customer IO track\");\n\n let eventName = rudderElement.message.event;\n let properties = rudderElement.message.properties;\n window._cio.track(eventName, properties);\n }\n\n page(rudderElement) {\n logger.debug(\"in Customer IO page\");\n\n var name =\n rudderElement.message.name || rudderElement.message.properties.url;\n window._cio.page(name, rudderElement.message.properties);\n }\n\n isLoaded() {\n return !!(window._cio && window._cio.push !== Array.prototype.push);\n }\n\n isReady() {\n return !!(window._cio && window._cio.push !== Array.prototype.push);\n }\n}\n\nexport { CustomerIO };\n","var each = require('each');\n\n\n/**\n * Cache whether `` exists.\n */\n\nvar body = false;\n\n\n/**\n * Callbacks to call when the body exists.\n */\n\nvar callbacks = [];\n\n\n/**\n * Export a way to add handlers to be invoked once the body exists.\n *\n * @param {Function} callback A function to call when the body exists.\n */\n\nmodule.exports = function onBody (callback) {\n if (body) {\n call(callback);\n } else {\n callbacks.push(callback);\n }\n};\n\n\n/**\n * Set an interval to check for `document.body`.\n */\n\nvar interval = setInterval(function () {\n if (!document.body) return;\n body = true;\n each(callbacks, call);\n clearInterval(interval);\n}, 5);\n\n\n/**\n * Call a callback, passing it the body.\n *\n * @param {Function} callback The callback to call.\n */\n\nfunction call (callback) {\n callback(document.body);\n}","/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\nvar byteToHex = [];\nfor (var i = 0; i < 256; ++i) {\n byteToHex[i] = (i + 0x100).toString(16).substr(1);\n}\n\nfunction bytesToUuid(buf, offset) {\n var i = offset || 0;\n var bth = byteToHex;\n // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4\n return ([\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]]\n ]).join('');\n}\n\nmodule.exports = bytesToUuid;\n","import logger from \"../../utils/logUtil\";\nimport onBody from \"on-body\";\nimport {\n MAX_WAIT_FOR_INTEGRATION_LOAD,\n INTEGRATION_LOAD_CHECK_INTERVAL\n} from \"../../utils/constants\";\n\nclass Chartbeat {\n constructor(config, analytics) {\n this.analytics = analytics; // use this to modify failed integrations or for passing events from callback to other destinations\n this._sf_async_config = window._sf_async_config =\n window._sf_async_config || {};\n window._sf_async_config.useCanonical = true;\n window._sf_async_config.uid = config.uid;\n window._sf_async_config.domain = config.domain;\n this.isVideo = config.video ? true : false;\n this.sendNameAndCategoryAsTitle = config.sendNameAndCategoryAsTitle || true;\n this.subscriberEngagementKeys = config.subscriberEngagementKeys || [];\n this.replayEvents = [];\n this.failed = false;\n this.isFirstPageCallMade = false;\n this.name = \"CHARTBEAT\";\n }\n\n init() {\n logger.debug(\"===in init Chartbeat===\");\n }\n\n identify(rudderElement) {\n logger.debug(\"in Chartbeat identify\");\n }\n\n track(rudderElement) {\n logger.debug(\"in Chartbeat track\");\n }\n\n page(rudderElement) {\n logger.debug(\"in Chartbeat page\");\n this.loadConfig(rudderElement);\n\n if (!this.isFirstPageCallMade) {\n this.isFirstPageCallMade = true;\n this.initAfterPage();\n } else {\n if (this.failed) {\n logger.debug(\"===ignoring cause failed integration===\");\n this.replayEvents = [];\n return;\n }\n if (!this.isLoaded() && !this.failed) {\n logger.debug(\"===pushing to replay queue for chartbeat===\");\n this.replayEvents.push([\"page\", rudderElement]);\n return;\n }\n logger.debug(\"===processing page event in chartbeat===\");\n let properties = rudderElement.message.properties;\n window.pSUPERFLY.virtualPage(properties.path);\n }\n }\n\n isLoaded() {\n logger.debug(\"in Chartbeat isLoaded\");\n if (!this.isFirstPageCallMade) {\n return true;\n } else {\n return !!window.pSUPERFLY;\n }\n }\n\n isFailed() {\n return this.failed;\n }\n\n isReady() {\n return !!window.pSUPERFLY;\n }\n\n loadConfig(rudderElement) {\n let properties = rudderElement.message.properties;\n let category = properties ? properties.category : undefined;\n let name = rudderElement.message.name;\n let author = properties ? properties.author : undefined;\n let title;\n if (this.sendNameAndCategoryAsTitle) {\n title = category && name ? category + \" \" + name : name;\n }\n if (category) window._sf_async_config.sections = category;\n if (author) window._sf_async_config.authors = author;\n if (title) window._sf_async_config.title = title;\n\n var _cbq = (window._cbq = window._cbq || []);\n\n for (var key in properties) {\n if (!properties.hasOwnProperty(key)) continue;\n if (this.subscriberEngagementKeys.indexOf(key) > -1) {\n _cbq.push([key, properties[key]]);\n }\n }\n }\n\n initAfterPage() {\n onBody(() => {\n var script = this.isVideo ? \"chartbeat_video.js\" : \"chartbeat.js\";\n function loadChartbeat() {\n var e = document.createElement(\"script\");\n var n = document.getElementsByTagName(\"script\")[0];\n e.type = \"text/javascript\";\n e.async = true;\n e.src = \"//static.chartbeat.com/js/\" + script;\n n.parentNode.insertBefore(e, n);\n }\n loadChartbeat();\n });\n\n this._isReady(this).then(instance => {\n logger.debug(\"===replaying on chartbeat===\");\n instance.replayEvents.forEach(event => {\n instance[event[0]](event[1]);\n });\n });\n }\n\n pause(time) {\n return new Promise(resolve => {\n setTimeout(resolve, time);\n });\n }\n\n _isReady(instance, time = 0) {\n return new Promise(resolve => {\n if (this.isLoaded()) {\n this.failed = false;\n logger.debug(\"===chartbeat loaded successfully===\");\n instance.analytics.emit(\"ready\");\n return resolve(instance);\n }\n if (time >= MAX_WAIT_FOR_INTEGRATION_LOAD) {\n this.failed = true;\n logger.debug(\"===chartbeat failed===\");\n return resolve(instance);\n }\n this.pause(INTEGRATION_LOAD_CHECK_INTERVAL).then(() => {\n return this._isReady(\n instance,\n time + INTEGRATION_LOAD_CHECK_INTERVAL\n ).then(resolve);\n });\n });\n }\n}\n\nexport { Chartbeat };\n","import logger from \"../../utils/logUtil\";\nimport {\n MAX_WAIT_FOR_INTEGRATION_LOAD,\n INTEGRATION_LOAD_CHECK_INTERVAL\n} from \"../../utils/constants\";\nclass Comscore {\n constructor(config, analytics) {\n this.c2ID = config.c2ID;\n this.analytics = analytics;\n this.comScoreBeaconParam = config.comScoreBeaconParam\n ? config.comScoreBeaconParam\n : {};\n this.isFirstPageCallMade = false;\n this.failed = false;\n this.comScoreParams = {};\n this.replayEvents = [];\n this.name = \"COMSCORE\";\n }\n\n init() {\n logger.debug(\"===in init Comscore init===\");\n }\n\n identify(rudderElement) {\n logger.debug(\"in Comscore identify\");\n }\n\n track(rudderElement) {\n logger.debug(\"in Comscore track\");\n }\n\n page(rudderElement) {\n logger.debug(\"in Comscore page\");\n\n this.loadConfig(rudderElement);\n\n if (!this.isFirstPageCallMade) {\n this.isFirstPageCallMade = true;\n this.initAfterPage();\n } else {\n if (this.failed) {\n this.replayEvents = [];\n return;\n }\n if (!this.isLoaded() && !this.failed) {\n this.replayEvents.push([\"page\", rudderElement]);\n return;\n }\n let properties = rudderElement.message.properties;\n //window.COMSCORE.beacon({c1:\"2\", c2: \"\"});\n //this.comScoreParams = this.mapComscoreParams(properties);\n window.COMSCORE.beacon(this.comScoreParams);\n }\n }\n\n loadConfig(rudderElement) {\n logger.debug(\"=====in loadConfig=====\");\n this.comScoreParams = this.mapComscoreParams(\n rudderElement.message.properties\n );\n window._comscore = window._comscore || [];\n window._comscore.push(this.comScoreParams);\n }\n\n initAfterPage() {\n logger.debug(\"=====in initAfterPage=====\");\n (function() {\n var s = document.createElement(\"script\"),\n el = document.getElementsByTagName(\"script\")[0];\n s.async = true;\n s.src =\n (document.location.protocol == \"https:\" ? \"https://sb\" : \"http://b\") +\n \".scorecardresearch.com/beacon.js\";\n el.parentNode.insertBefore(s, el);\n })();\n\n this._isReady(this).then(instance => {\n instance.replayEvents.forEach(event => {\n instance[event[0]](event[1]);\n });\n });\n }\n\n pause(time) {\n return new Promise(resolve => {\n setTimeout(resolve, time);\n });\n }\n\n _isReady(instance, time = 0) {\n return new Promise(resolve => {\n if (this.isLoaded()) {\n this.failed = false;\n instance.analytics.emit(\"ready\");\n return resolve(instance);\n }\n if (time >= MAX_WAIT_FOR_INTEGRATION_LOAD) {\n this.failed = true;\n return resolve(instance);\n }\n this.pause(INTEGRATION_LOAD_CHECK_INTERVAL).then(() => {\n return this._isReady(\n instance,\n time + INTEGRATION_LOAD_CHECK_INTERVAL\n ).then(resolve);\n });\n });\n }\n\n mapComscoreParams(properties) {\n logger.debug(\"=====in mapComscoreParams=====\");\n let comScoreBeaconParamsMap = this.comScoreBeaconParam;\n\n var comScoreParams = {};\n\n Object.keys(comScoreBeaconParamsMap).forEach(function(property) {\n if (property in properties) {\n var key = comScoreBeaconParamsMap[property];\n var value = properties[property];\n comScoreParams[key] = value;\n }\n });\n\n comScoreParams.c1 = \"2\";\n comScoreParams.c2 = this.c2ID;\n /* if (this.options.comscorekw.length) {\n comScoreParams.comscorekw = this.options.comscorekw;\n } */\n logger.debug(\"=====in mapComscoreParams=====\", comScoreParams);\n return comScoreParams;\n }\n\n isLoaded() {\n logger.debug(\"in Comscore isLoaded\");\n if (!this.isFirstPageCallMade) {\n return true;\n } else {\n return !!window.COMSCORE;\n }\n }\n\n isReady() {\n return !!window.COMSCORE;\n }\n}\n\nexport { Comscore };\n","'use strict';\n\nvar hop = Object.prototype.hasOwnProperty;\nvar strCharAt = String.prototype.charAt;\nvar toStr = Object.prototype.toString;\n\n/**\n * Returns the character at a given index.\n *\n * @param {string} str\n * @param {number} index\n * @return {string|undefined}\n */\n// TODO: Move to a library\nvar charAt = function(str, index) {\n return strCharAt.call(str, index);\n};\n\n/**\n * hasOwnProperty, wrapped as a function.\n *\n * @name has\n * @api private\n * @param {*} context\n * @param {string|number} prop\n * @return {boolean}\n */\n\n// TODO: Move to a library\nvar has = function has(context, prop) {\n return hop.call(context, prop);\n};\n\n/**\n * Returns true if a value is a string, otherwise false.\n *\n * @name isString\n * @api private\n * @param {*} val\n * @return {boolean}\n */\n\n// TODO: Move to a library\nvar isString = function isString(val) {\n return toStr.call(val) === '[object String]';\n};\n\n/**\n * Returns true if a value is array-like, otherwise false. Array-like means a\n * value is not null, undefined, or a function, and has a numeric `length`\n * property.\n *\n * @name isArrayLike\n * @api private\n * @param {*} val\n * @return {boolean}\n */\n// TODO: Move to a library\nvar isArrayLike = function isArrayLike(val) {\n return val != null && (typeof val !== 'function' && typeof val.length === 'number');\n};\n\n\n/**\n * indexKeys\n *\n * @name indexKeys\n * @api private\n * @param {} target\n * @param {Function} pred\n * @return {Array}\n */\nvar indexKeys = function indexKeys(target, pred) {\n pred = pred || has;\n\n var results = [];\n\n for (var i = 0, len = target.length; i < len; i += 1) {\n if (pred(target, i)) {\n results.push(String(i));\n }\n }\n\n return results;\n};\n\n/**\n * Returns an array of an object's owned keys.\n *\n * @name objectKeys\n * @api private\n * @param {*} target\n * @param {Function} pred Predicate function used to include/exclude values from\n * the resulting array.\n * @return {Array}\n */\nvar objectKeys = function objectKeys(target, pred) {\n pred = pred || has;\n\n var results = [];\n\n for (var key in target) {\n if (pred(target, key)) {\n results.push(String(key));\n }\n }\n\n return results;\n};\n\n/**\n * Creates an array composed of all keys on the input object. Ignores any non-enumerable properties.\n * More permissive than the native `Object.keys` function (non-objects will not throw errors).\n *\n * @name keys\n * @api public\n * @category Object\n * @param {Object} source The value to retrieve keys from.\n * @return {Array} An array containing all the input `source`'s keys.\n * @example\n * keys({ likes: 'avocado', hates: 'pineapple' });\n * //=> ['likes', 'pineapple'];\n *\n * // Ignores non-enumerable properties\n * var hasHiddenKey = { name: 'Tim' };\n * Object.defineProperty(hasHiddenKey, 'hidden', {\n * value: 'i am not enumerable!',\n * enumerable: false\n * })\n * keys(hasHiddenKey);\n * //=> ['name'];\n *\n * // Works on arrays\n * keys(['a', 'b', 'c']);\n * //=> ['0', '1', '2']\n *\n * // Skips unpopulated indices in sparse arrays\n * var arr = [1];\n * arr[4] = 4;\n * keys(arr);\n * //=> ['0', '4']\n */\nvar keys = function keys(source) {\n if (source == null) {\n return [];\n }\n\n // IE6-8 compatibility (string)\n if (isString(source)) {\n return indexKeys(source, charAt);\n }\n\n // IE6-8 compatibility (arguments)\n if (isArrayLike(source)) {\n return indexKeys(source, has);\n }\n\n return objectKeys(source);\n};\n\n/*\n * Exports.\n */\n\nmodule.exports = keys;\n","'use strict';\n\n/*\n * Module dependencies.\n */\n\nvar keys = require('@ndhoule/keys');\n\nvar objToString = Object.prototype.toString;\n\n/**\n * Tests if a value is a number.\n *\n * @name isNumber\n * @api private\n * @param {*} val The value to test.\n * @return {boolean} Returns `true` if `val` is a number, otherwise `false`.\n */\n// TODO: Move to library\nvar isNumber = function isNumber(val) {\n var type = typeof val;\n return type === 'number' || (type === 'object' && objToString.call(val) === '[object Number]');\n};\n\n/**\n * Tests if a value is an array.\n *\n * @name isArray\n * @api private\n * @param {*} val The value to test.\n * @return {boolean} Returns `true` if the value is an array, otherwise `false`.\n */\n// TODO: Move to library\nvar isArray = typeof Array.isArray === 'function' ? Array.isArray : function isArray(val) {\n return objToString.call(val) === '[object Array]';\n};\n\n/**\n * Tests if a value is array-like. Array-like means the value is not a function and has a numeric\n * `.length` property.\n *\n * @name isArrayLike\n * @api private\n * @param {*} val\n * @return {boolean}\n */\n// TODO: Move to library\nvar isArrayLike = function isArrayLike(val) {\n return val != null && (isArray(val) || (val !== 'function' && isNumber(val.length)));\n};\n\n/**\n * Internal implementation of `each`. Works on arrays and array-like data structures.\n *\n * @name arrayEach\n * @api private\n * @param {Function(value, key, collection)} iterator The function to invoke per iteration.\n * @param {Array} array The array(-like) structure to iterate over.\n * @return {undefined}\n */\nvar arrayEach = function arrayEach(iterator, array) {\n for (var i = 0; i < array.length; i += 1) {\n // Break iteration early if `iterator` returns `false`\n if (iterator(array[i], i, array) === false) {\n break;\n }\n }\n};\n\n/**\n * Internal implementation of `each`. Works on objects.\n *\n * @name baseEach\n * @api private\n * @param {Function(value, key, collection)} iterator The function to invoke per iteration.\n * @param {Object} object The object to iterate over.\n * @return {undefined}\n */\nvar baseEach = function baseEach(iterator, object) {\n var ks = keys(object);\n\n for (var i = 0; i < ks.length; i += 1) {\n // Break iteration early if `iterator` returns `false`\n if (iterator(object[ks[i]], ks[i], object) === false) {\n break;\n }\n }\n};\n\n/**\n * Iterate over an input collection, invoking an `iterator` function for each element in the\n * collection and passing to it three arguments: `(value, index, collection)`. The `iterator`\n * function can end iteration early by returning `false`.\n *\n * @name each\n * @api public\n * @param {Function(value, key, collection)} iterator The function to invoke per iteration.\n * @param {Array|Object|string} collection The collection to iterate over.\n * @return {undefined} Because `each` is run only for side effects, always returns `undefined`.\n * @example\n * var log = console.log.bind(console);\n *\n * each(log, ['a', 'b', 'c']);\n * //-> 'a', 0, ['a', 'b', 'c']\n * //-> 'b', 1, ['a', 'b', 'c']\n * //-> 'c', 2, ['a', 'b', 'c']\n * //=> undefined\n *\n * each(log, 'tim');\n * //-> 't', 2, 'tim'\n * //-> 'i', 1, 'tim'\n * //-> 'm', 0, 'tim'\n * //=> undefined\n *\n * // Note: Iteration order not guaranteed across environments\n * each(log, { name: 'tim', occupation: 'enchanter' });\n * //-> 'tim', 'name', { name: 'tim', occupation: 'enchanter' }\n * //-> 'enchanter', 'occupation', { name: 'tim', occupation: 'enchanter' }\n * //=> undefined\n */\nvar each = function each(iterator, collection) {\n return (isArrayLike(collection) ? arrayEach : baseEach).call(this, iterator, collection);\n};\n\n/*\n * Exports.\n */\n\nmodule.exports = each;\n","import { ScriptLoader } from \"../ScriptLoader\";\nimport logger from \"../../utils/logUtil\";\nimport is from \"is\";\nimport each from \"@ndhoule/each\";\n\nclass FBPixel {\n constructor(config) {\n this.blacklistPiiProperties = config.blacklistPiiProperties;\n this.categoryToContent = config.categoryToContent;\n this.pixelId = config.pixelId;\n this.eventsToEvents = config.eventsToEvents;\n this.eventCustomProperties = config.eventCustomProperties;\n this.valueFieldIdentifier = config.valueFieldIdentifier;\n this.advancedMapping = config.advancedMapping;\n this.traitKeyToExternalId = config.traitKeyToExternalId;\n this.legacyConversionPixelId = config.legacyConversionPixelId;\n this.userIdAsPixelId = config.userIdAsPixelId;\n this.whitelistPiiProperties = config.whitelistPiiProperties;\n this.name = \"FB_PIXEL\";\n }\n\n init() {\n if (this.categoryToContent === undefined) {\n this.categoryToContent = [];\n }\n if (this.legacyConversionPixelId === undefined) {\n this.legacyConversionPixelId = [];\n }\n if (this.userIdAsPixelId === undefined) {\n this.userIdAsPixelId = [];\n }\n\n logger.debug(\"===in init FbPixel===\");\n\n window._fbq = function () {\n if (window.fbq.callMethod) {\n window.fbq.callMethod.apply(window.fbq, arguments);\n } else {\n window.fbq.queue.push(arguments);\n }\n };\n\n window.fbq = window.fbq || window._fbq;\n window.fbq.push = window.fbq;\n window.fbq.loaded = true;\n window.fbq.disablePushState = true; // disables automatic pageview tracking\n window.fbq.allowDuplicatePageViews = true; // enables fb\n window.fbq.version = \"2.0\";\n window.fbq.queue = [];\n\n window.fbq(\"init\", this.pixelId);\n ScriptLoader(\n \"fbpixel-integration\",\n \"//connect.facebook.net/en_US/fbevents.js\"\n );\n }\n\n isLoaded() {\n logger.debug(\"in FBPixel isLoaded\");\n return !!(window.fbq && window.fbq.callMethod);\n }\n\n isReady() {\n logger.debug(\"in FBPixel isReady\");\n return !!(window.fbq && window.fbq.callMethod);\n }\n\n page(rudderElement) {\n window.fbq(\"track\", \"PageView\");\n }\n\n identify(rudderElement) {\n if (this.advancedMapping) {\n window.fbq(\"init\", this.pixelId, rudderElement.message.context.traits);\n }\n }\n\n track(rudderElement) {\n let self = this;\n var event = rudderElement.message.event;\n var revenue = this.formatRevenue(rudderElement.message.properties.revenue);\n var payload = this.buildPayLoad(rudderElement, true);\n\n if (this.categoryToContent === undefined) {\n this.categoryToContent = [];\n }\n if (this.legacyConversionPixelId === undefined) {\n this.legacyConversionPixelId = [];\n }\n if (this.userIdAsPixelId === undefined) {\n this.userIdAsPixelId = [];\n }\n\n payload.value = revenue;\n var standard = this.eventsToEvents;\n var legacy = this.legacyConversionPixelId;\n var standardTo;\n var legacyTo;\n\n standardTo = standard.reduce((filtered, standard) => {\n if (standard.from === event) {\n filtered.push(standard.to);\n }\n return filtered;\n }, []);\n\n legacyTo = legacy.reduce((filtered, legacy) => {\n if (legacy.from === event) {\n filtered.push(legacy.to);\n }\n return filtered;\n }, []);\n\n each((event) => {\n payload.currency = rudderElement.message.properties.currency || \"USD\";\n\n window.fbq(\"trackSingle\", self.pixelId, event, payload, {\n eventID: rudderElement.message.messageId,\n });\n }, standardTo);\n\n each((event) => {\n window.fbq(\n \"trackSingle\",\n self.pixelId,\n event,\n {\n currency: rudderElement.message.properties.currency,\n value: revenue,\n },\n {\n eventID: rudderElement.message.messageId,\n }\n );\n }, legacyTo);\n\n if (event === \"Product List Viewed\") {\n var contentType;\n var contentIds;\n var contents = [];\n var products = rudderElement.message.properties.products;\n var customProperties = this.buildPayLoad(rudderElement, true);\n\n if (Array.isArray(products)) {\n products.forEach(function (product) {\n var productId = product.product_id;\n if (productId) {\n contentIds.push(productId);\n contents.push({\n id: productId,\n quantity: rudderElement.message.properties.quantity,\n });\n }\n });\n }\n\n if (contentIds.length) {\n contentType = [\"product\"];\n } else {\n contentIds.push(rudderElement.message.properties.category || \"\");\n contents.push({\n id: rudderElement.message.properties.category || \"\",\n quantity: 1,\n });\n contentType = [\"product_group\"];\n }\n window.fbq(\n \"trackSingle\",\n self.pixelId,\n \"ViewContent\",\n this.merge(\n {\n content_ids: contentIds,\n content_type: this.getContentType(rudderElement, contentType),\n contents: contents,\n },\n customProperties\n ),\n {\n eventID: rudderElement.message.messageId,\n }\n );\n\n each((event) => {\n window.fbq(\n \"trackSingle\",\n self.pixelId,\n event,\n {\n currency: rudderElement.message.properties.currency,\n value: this.formatRevenue(rudderElement.message.properties.revenue),\n },\n {\n eventID: rudderElement.message.messageId,\n }\n );\n }, legacyTo);\n } else if (event === \"Product Viewed\") {\n var useValue = this.valueFieldIdentifier === \"properties.value\";\n var customProperties = this.buildPayLoad(rudderElement, true);\n\n window.fbq(\n \"trackSingle\",\n self.pixelId,\n \"ViewContent\",\n this.merge(\n {\n content_ids: [\n rudderElement.message.properties.product_id ||\n rudderElement.message.properties.id ||\n rudderElement.message.properties.sku ||\n \"\",\n ],\n content_type: this.getContentType(rudderElement, [\"product\"]),\n content_name: rudderElement.message.properties.product_name || \"\",\n content_category: rudderElement.message.properties.category || \"\",\n currency: rudderElement.message.properties.currency,\n value: useValue\n ? this.formatRevenue(rudderElement.message.properties.value)\n : this.formatRevenue(rudderElement.message.properties.price),\n contents: [\n {\n id:\n rudderElement.message.properties.product_id ||\n rudderElement.message.properties.id ||\n rudderElement.message.properties.sku ||\n \"\",\n quantity: rudderElement.message.properties.quantity,\n item_price: rudderElement.message.properties.price,\n },\n ],\n },\n customProperties\n ),\n {\n eventID: rudderElement.message.messageId,\n }\n );\n\n each((event) => {\n window.fbq(\n \"trackSingle\",\n self.pixelId,\n event,\n {\n currency: rudderElement.message.properties.currency,\n value: useValue\n ? this.formatRevenue(rudderElement.message.properties.value)\n : this.formatRevenue(rudderElement.message.properties.price),\n },\n {\n eventID: rudderElement.message.messageId,\n }\n );\n }, legacyTo);\n } else if (event === \"Product Added\") {\n var useValue = this.valueFieldIdentifier === \"properties.value\";\n var customProperties = this.buildPayLoad(rudderElement, true);\n window.fbq(\n \"trackSingle\",\n self.pixelId,\n \"AddToCart\",\n this.merge(\n {\n content_ids: [\n rudderElement.message.properties.product_id ||\n rudderElement.message.properties.id ||\n rudderElement.message.properties.sku ||\n \"\",\n ],\n content_type: this.getContentType(rudderElement, [\"product\"]),\n\n content_name: rudderElement.message.properties.product_name || \"\",\n content_category: rudderElement.message.properties.category || \"\",\n currency: rudderElement.message.properties.currency,\n value: useValue\n ? this.formatRevenue(rudderElement.message.properties.value)\n : this.formatRevenue(rudderElement.message.properties.price),\n contents: [\n {\n id:\n rudderElement.message.properties.product_id ||\n rudderElement.message.properties.id ||\n rudderElement.message.properties.sku ||\n \"\",\n quantity: rudderElement.message.properties.quantity,\n item_price: rudderElement.message.properties.price,\n },\n ],\n },\n customProperties\n ),\n {\n eventID: rudderElement.message.messageId,\n }\n );\n\n each((event) => {\n window.fbq(\n \"trackSingle\",\n self.pixelId,\n event,\n {\n currency: rudderElement.message.properties.currency,\n value: useValue\n ? this.formatRevenue(rudderElement.message.properties.value)\n : this.formatRevenue(rudderElement.message.properties.price),\n },\n {\n eventID: rudderElement.message.messageId,\n }\n );\n }, legacyTo);\n this.merge(\n {\n content_ids: [\n rudderElement.message.properties.product_id ||\n rudderElement.message.properties.id ||\n rudderElement.message.properties.sku ||\n \"\",\n ],\n content_type: this.getContentType(rudderElement, [\"product\"]),\n\n content_name: rudderElement.message.properties.product_name || \"\",\n content_category: rudderElement.message.properties.category || \"\",\n currency: rudderElement.message.properties.currency,\n value: useValue\n ? this.formatRevenue(rudderElement.message.properties.value)\n : this.formatRevenue(rudderElement.message.properties.price),\n contents: [\n {\n id:\n rudderElement.message.properties.product_id ||\n rudderElement.message.properties.id ||\n rudderElement.message.properties.sku ||\n \"\",\n quantity: rudderElement.message.properties.quantity,\n item_price: rudderElement.message.properties.price,\n },\n ],\n },\n customProperties\n );\n } else if (event === \"Order Completed\") {\n var products = rudderElement.message.properties.products;\n var customProperties = this.buildPayLoad(rudderElement, true);\n var revenue = this.formatRevenue(\n rudderElement.message.properties.revenue\n );\n\n var contentType = this.getContentType(rudderElement, [\"product\"]);\n var contentIds = [];\n var contents = [];\n\n for (var i = 0; i < products.length; i++) {\n var pId = product.product_id;\n contentIds.push(pId);\n var content = {\n id: pId,\n quantity: rudderElement.message.properties.quantity,\n };\n if (rudderElement.message.properties.price) {\n content.item_price = rudderElement.message.properties.price;\n }\n contents.push(content);\n }\n window.fbq(\n \"trackSingle\",\n self.pixelId,\n \"Purchase\",\n this.merge(\n {\n content_ids: contentIds,\n content_type: contentType,\n currency: rudderElement.message.properties.currency,\n value: revenue,\n contents: contents,\n num_items: contentIds.length,\n },\n customProperties\n ),\n {\n eventID: rudderElement.message.messageId,\n }\n );\n\n each((event) => {\n window.fbq(\n \"trackSingle\",\n self.pixelId,\n event,\n {\n currency: rudderElement.message.properties.currency,\n value: this.formatRevenue(rudderElement.message.properties.revenue),\n },\n {\n eventID: rudderElement.message.messageId,\n }\n );\n }, legacyTo);\n } else if (event === \"Products Searched\") {\n var customProperties = this.buildPayLoad(rudderElement, true);\n window.fbq(\n \"trackSingle\",\n self.pixelId,\n \"Search\",\n this.merge(\n {\n search_string: rudderElement.message.properties.query,\n },\n customProperties\n ),\n {\n eventID: rudderElement.message.messageId,\n }\n );\n\n each((event) => {\n window.fbq(\n \"trackSingle\",\n self.pixelId,\n event,\n {\n currency: rudderElement.message.properties.currency,\n value: formatRevenue(rudderElement.message.properties.revenue),\n },\n {\n eventID: rudderElement.message.messageId,\n }\n );\n }, legacyTo);\n } else if (event === \"Checkout Started\") {\n var products = rudderElement.message.properties.products;\n var customProperties = this.buildPayLoad(rudderElement, true);\n var revenue = this.formatRevenue(\n rudderElement.message.properties.revenue\n );\n var contentCategory = rudderElement.message.properties.category;\n var contentIds = [];\n var contents = [];\n\n for (var i = 0; i < products.length; i++) {\n let product = products[i];\n var pId = product.product_id;\n contentIds.push(pId);\n var content = {\n id: pId,\n quantity: rudderElement.message.properties.quantity,\n item_price: rudderElement.message.properties.price,\n };\n if (rudderElement.message.properties.price) {\n content.item_price = rudderElement.message.properties.price;\n }\n contents.push(content);\n }\n if (!contentCategory && products[0] && products[0].category) {\n contentCategory = products[0].category;\n }\n window.fbq(\n \"trackSingle\",\n self.pixelId,\n \"InitiateCheckout\",\n this.merge(\n {\n content_category: contentCategory,\n content_ids: contentIds,\n content_type: this.getContentType(rudderElement, [\"product\"]),\n currency: rudderElement.message.properties.currency,\n value: revenue,\n contents: contents,\n num_items: contentIds.length,\n },\n customProperties\n ),\n {\n eventID: rudderElement.message.messageId,\n }\n );\n\n each((event) => {\n window.fbq(\n \"trackSingle\",\n self.pixelId,\n event,\n {\n currency: rudderElement.message.properties.currency,\n value: this.formatRevenue(rudderElement.message.properties.revenue),\n },\n {\n eventID: rudderElement.message.messageId,\n }\n );\n }, legacyTo);\n }\n }\n\n getContentType(rudderElement, defaultValue) {\n var options = rudderElement.message.options;\n if (options && options.contentType) {\n return [options.contentType];\n }\n\n var category = rudderElement.message.properties.category;\n if (!category) {\n var products = rudderElement.message.properties.products;\n if (products && products.length) {\n category = products[0].category;\n }\n }\n if (category) {\n var mapped = this.categoryToContent;\n var mappedTo;\n mappedTo = mapped.reduce((filtered, mapped) => {\n if (mapped.from == category) {\n filtered.push(mapped.to);\n }\n return filtered;\n }, []);\n if (mappedTo.length) {\n return mappedTo;\n }\n }\n return defaultValue;\n }\n\n merge(obj1, obj2) {\n var res = {};\n\n // All properties of obj1\n for (var propObj1 in obj1) {\n if (obj1.hasOwnProperty(propObj1)) {\n res[propObj1] = obj1[propObj1];\n }\n }\n\n // Extra properties of obj2\n for (var propObj2 in obj2) {\n if (obj2.hasOwnProperty(propObj2) && !res.hasOwnProperty(propObj2)) {\n res[propObj2] = obj2[propObj2];\n }\n }\n\n return res;\n }\n\n formatRevenue(revenue) {\n return Number(revenue || 0).toFixed(2);\n }\n\n buildPayLoad(rudderElement, isStandardEvent) {\n var dateFields = [\n \"checkinDate\",\n \"checkoutDate\",\n \"departingArrivalDate\",\n \"departingDepartureDate\",\n \"returningArrivalDate\",\n \"returningDepartureDate\",\n \"travelEnd\",\n \"travelStart\",\n ];\n var defaultPiiProperties = [\n \"email\",\n \"firstName\",\n \"lastName\",\n \"gender\",\n \"city\",\n \"country\",\n \"phone\",\n \"state\",\n \"zip\",\n \"birthday\",\n ];\n var whitelistPiiProperties = this.whitelistPiiProperties || [];\n var blacklistPiiProperties = this.blacklistPiiProperties || [];\n var eventCustomProperties = this.eventCustomProperties || [];\n var customPiiProperties = {};\n for (var i = 0; i < blacklistPiiProperties[i]; i++) {\n var configuration = blacklistPiiProperties[i];\n customPiiProperties[configuration.blacklistPiiProperties] =\n configuration.blacklistPiiHash;\n }\n var payload = {};\n var properties = rudderElement.message.properties;\n\n for (var property in properties) {\n if (!properties.hasOwnProperty(property)) {\n continue;\n }\n\n if (isStandardEvent && eventCustomProperties.indexOf(property) < 0) {\n continue;\n }\n var value = properties[property];\n\n if (dateFields.indexOf(properties) >= 0) {\n if (is.date(value)) {\n payload[property] = value.toISOTring().split(\"T\")[0];\n continue;\n }\n }\n if (customPiiProperties.hasOwnProperty(property)) {\n if (customPiiProperties[property] && typeof value == \"string\") {\n payload[property] = sha256(value);\n }\n continue;\n }\n var isPropertyPii = defaultPiiProperties.indexOf(property) >= 0;\n var isProperyWhiteListed = whitelistPiiProperties.indexOf(property) >= 0;\n if (!isPropertyPii || isProperyWhiteListed) {\n payload[property] = value;\n }\n }\n return payload;\n }\n}\n\nexport { FBPixel };\n","import logger from \"../../utils/logUtil\";\nimport Storage from \"../../utils/storage\";\n\nlet defaults = {\n lotame_synch_time_key: \"lt_synch_timestamp\"\n};\n\nclass LotameStorage {\n constructor() {\n this.storage = Storage;//new Storage();\n }\n\n setLotameSynchTime(value) {\n this.storage.setItem(defaults.lotame_synch_time_key, value);\n }\n\n getLotameSynchTime() {\n return this.storage.getItem(defaults.lotame_synch_time_key);\n }\n}\nlet lotameStorage = new LotameStorage();\nexport {lotameStorage as LotameStorage};","import * as HubSpot from \"./HubSpot\";\nimport * as GA from \"./GA\";\nimport * as Hotjar from \"./Hotjar\";\nimport * as GoogleAds from \"./GoogleAds\";\nimport * as VWO from \"./VWO\";\nimport * as GoogleTagManager from \"./GoogleTagManager\";\nimport * as Braze from \"./Braze\";\nimport * as INTERCOM from \"./INTERCOM\";\nimport * as Keen from \"./Keen\";\nimport * as Kissmetrics from \"./Kissmetrics\";\nimport * as CustomerIO from \"./CustomerIO\";\nimport * as Chartbeat from \"./Chartbeat\";\nimport * as Comscore from \"./Comscore\";\nimport * as FBPixel from \"./FBPixel\";\nimport * as Lotame from \"./Lotame\";\n\n// the key names should match the destination.name value to keep partity everywhere \n// (config-plan name, native destination.name , exported integration name(this one below))\n\nlet integrations = {\n HS: HubSpot.default,\n GA: GA.default,\n HOTJAR: Hotjar.default,\n GOOGLEADS: GoogleAds.default,\n VWO: VWO.default,\n GTM: GoogleTagManager.default,\n BRAZE: Braze.default,\n INTERCOM: INTERCOM.default,\n KEEN: Keen.default,\n KISSMETRICS: Kissmetrics.default,\n CUSTOMERIO: CustomerIO.default,\n CHARTBEAT: Chartbeat.default,\n COMSCORE: Comscore.default,\n FACEBOOK_PIXEL: FBPixel.default,\n LOTAME: Lotame.default\n};\n\nexport { integrations };\n","import logger from \"../../utils/logUtil\";\nimport { LotameStorage } from \"./LotameStorage\";\nclass Lotame {\n constructor(config, analytics) {\n this.name = \"LOTAME\";\n this.analytics = analytics;\n this.storage = LotameStorage;\n this.bcpUrlSettingsPixel = config.bcpUrlSettingsPixel;\n this.bcpUrlSettingsIframe = config.bcpUrlSettingsIframe;\n this.dspUrlSettingsPixel = config.dspUrlSettingsPixel;\n this.dspUrlSettingsIframe = config.dspUrlSettingsIframe;\n this.mappings = {};\n config.mappings.forEach(mapping => {\n let key = mapping.key;\n let value = mapping.value;\n this.mappings[key] = value;\n });\n }\n\n init() {\n logger.debug(\"===in init Lotame===\");\n window.LOTAME_SYNCH_CALLBACK = () => {};\n }\n\n addPixel(source, width, height) {\n logger.debug(\"Adding pixel for :: \" + source);\n\n let image = document.createElement(\"img\");\n image.src = source;\n image.setAttribute(\"width\", width);\n image.setAttribute(\"height\", height);\n\n logger.debug(\"Image Pixel :: \" + image);\n document.getElementsByTagName(\"body\")[0].appendChild(image);\n }\n\n addIFrame(source) {\n logger.debug(\"Adding iframe for :: \" + source);\n\n let iframe = document.createElement(\"iframe\");\n iframe.src = source;\n iframe.title = \"empty\";\n iframe.setAttribute(\"id\", \"LOTCCFrame\");\n iframe.setAttribute(\"tabindex\", \"-1\");\n iframe.setAttribute(\"role\", \"presentation\");\n iframe.setAttribute(\"aria-hidden\", \"true\");\n iframe.setAttribute(\"style\", \"border: 0px; width: 0px; height: 0px; display: block;\");\n\n logger.debug(\"IFrame :: \" + iframe);\n document.getElementsByTagName(\"body\")[0].appendChild(iframe);\n }\n\n syncPixel(userId) {\n logger.debug(\"===== in syncPixel ======\");\n\n logger.debug(\"Firing DSP Pixel URLs\");\n if (this.dspUrlSettingsPixel && this.dspUrlSettingsPixel.length > 0) {\n let currentTime = Date.now();\n this.dspUrlSettingsPixel.forEach(urlSettings => {\n let dspUrl = this.compileUrl(\n { ...this.mappings, userId: userId, random: currentTime },\n urlSettings.dspUrlTemplate\n );\n this.addPixel(dspUrl, \"1\", \"1\");\n });\n }\n\n logger.debug(\"Firing DSP IFrame URLs\");\n if (this.dspUrlSettingsIframe && this.dspUrlSettingsIframe.length > 0) {\n let currentTime = Date.now();\n this.dspUrlSettingsIframe.forEach(urlSettings => {\n let dspUrl = this.compileUrl(\n { ...this.mappings, userId: userId, random: currentTime },\n urlSettings.dspUrlTemplate\n );\n this.addIFrame(dspUrl);\n });\n }\n\n this.storage.setLotameSynchTime(Date.now());\n // emit on syncPixel\n if (this.analytics.methodToCallbackMapping[\"syncPixel\"]) {\n this.analytics.emit(\"syncPixel\", {\n destination: this.name\n });\n }\n }\n\n compileUrl(map, url) {\n Object.keys(map).forEach(key => {\n if (map.hasOwnProperty(key)) {\n let replaceKey = \"{{\" + key + \"}}\";\n let regex = new RegExp(replaceKey, \"gi\");\n url = url.replace(regex, map[key]);\n }\n });\n return url;\n }\n\n identify(rudderElement) {\n logger.debug(\"in Lotame identify\");\n let userId = rudderElement.message.userId;\n this.syncPixel(userId);\n }\n\n track(rudderElement) {\n logger.debug(\"track not supported for lotame\");\n }\n\n page(rudderElement) {\n logger.debug(\"in Lotame page\");\n\n logger.debug(\"Firing BCP Pixel URLs\");\n if (this.bcpUrlSettingsPixel && this.bcpUrlSettingsPixel.length > 0) {\n let currentTime = Date.now();\n this.bcpUrlSettingsPixel.forEach(urlSettings => {\n let bcpUrl = this.compileUrl(\n { ...this.mappings, random: currentTime},\n urlSettings.bcpUrlTemplate\n );\n this.addPixel(bcpUrl, \"1\", \"1\");\n });\n }\n\n logger.debug(\"Firing BCP IFrame URLs\");\n if (this.bcpUrlSettingsIframe && this.bcpUrlSettingsIframe.length > 0) {\n let currentTime = Date.now();\n this.bcpUrlSettingsIframe.forEach(urlSettings => {\n let bcpUrl = this.compileUrl(\n { ...this.mappings, random: currentTime},\n urlSettings.bcpUrlTemplate\n );\n this.addIFrame(bcpUrl);\n });\n }\n\n if (rudderElement.message.userId && this.isPixelToBeSynched()) {\n this.syncPixel(rudderElement.message.userId);\n }\n }\n\n isPixelToBeSynched() {\n let lastSynchedTime = this.storage.getLotameSynchTime();\n let currentTime = Date.now();\n if (!lastSynchedTime) {\n return true;\n }\n\n let difference = Math.floor(\n (currentTime - lastSynchedTime) / (1000 * 3600 * 24)\n );\n return difference >= 7;\n }\n\n isLoaded() {\n logger.debug(\"in Lotame isLoaded\");\n return true;\n }\n\n isReady() {\n return true;\n }\n}\n\nexport { Lotame };\n","//Application class\nclass RudderApp {\n constructor() {\n this.build = \"1.0.0\";\n this.name = \"RudderLabs JavaScript SDK\";\n this.namespace = \"com.rudderlabs.javascript\";\n this.version = \"process.package_version\";\n }\n}\nexport default RudderApp;\n","//Library information class\nclass RudderLibraryInfo {\n constructor() {\n this.name = \"RudderLabs JavaScript SDK\";\n this.version = \"process.package_version\";\n }\n}\n//Operating System information class\nclass RudderOSInfo {\n constructor() {\n this.name = \"\";\n this.version = \"\";\n }\n}\n//Screen information class\nclass RudderScreenInfo {\n constructor() {\n this.density = 0;\n this.width = 0;\n this.height = 0;\n }\n}\n//Device information class\nclass RudderDeviceInfo {\n constructor() {\n this.id = \"\";\n this.manufacturer = \"\";\n this.model = \"\";\n this.name = \"\";\n }\n}\n//Carrier information\nclass RudderNetwork {\n constructor() {\n this.carrier = \"\";\n }\n}\nexport {\n RudderLibraryInfo,\n RudderOSInfo,\n RudderScreenInfo,\n RudderDeviceInfo,\n RudderNetwork\n};\n","//Context class\nimport RudderApp from \"./RudderApp\";\nimport {\n RudderLibraryInfo,\n RudderOSInfo,\n RudderScreenInfo\n} from \"./RudderInfo\";\nclass RudderContext {\n constructor() {\n this.app = new RudderApp();\n this.traits = null;\n this.library = new RudderLibraryInfo();\n //this.os = null;\n let os = new RudderOSInfo();\n os.version = \"\"; //skipping version for simplicity now\n let screen = new RudderScreenInfo();\n\n //Depending on environment within which the code is executing, screen\n //dimensions can be set\n //User agent and locale can be retrieved only for browser\n //For server-side integration, same needs to be set by calling program\n if (!process.browser) {\n //server-side integration\n screen.width = 0;\n screen.height = 0;\n screen.density = 0;\n os.version = \"\";\n os.name = \"\";\n this.userAgent = null;\n this.locale = null;\n } else {\n //running within browser\n screen.width = window.width;\n screen.height = window.height;\n screen.density = window.devicePixelRatio;\n this.userAgent = navigator.userAgent;\n //property name differs based on browser version\n this.locale = navigator.language || navigator.browserLanguage;\n }\n this.os = os;\n this.screen = screen;\n this.device = null;\n this.network = null;\n }\n}\nexport default RudderContext;\n","//Core message class with default values\nimport { generateUUID } from \"./utils\";\nimport { MessageType, ECommerceEvents } from \"./constants\";\nimport RudderContext from \"./RudderContext\";\nclass RudderMessage {\n constructor() {\n this.channel = \"web\";\n this.context = new RudderContext();\n this.type = null;\n this.action = null;\n this.messageId = generateUUID().toString();\n this.originalTimestamp = new Date().toISOString();\n this.anonymousId = null;\n this.userId = null;\n this.event = null;\n this.properties = {};\n this.integrations = {};\n //By default, all integrations will be set as enabled from client\n //Decision to route to specific destinations will be taken at server end\n this.integrations[\"All\"] = true;\n }\n\n //Get property\n getProperty(key) {\n return this.properties[key];\n }\n\n //Add property\n addProperty(key, value) {\n this.properties[key] = value;\n }\n\n //Validate whether this message is semantically valid for the type mentioned\n validateFor(messageType) {\n //First check that properties is populated\n if (!this.properties) {\n throw new Error(\"Key properties is required\");\n }\n //Event type specific checks\n switch (messageType) {\n case MessageType.TRACK:\n //check if event is present\n if (!this.event) {\n throw new Error(\"Key event is required for track event\");\n }\n //Next make specific checks for e-commerce events\n if (this.event in Object.values(ECommerceEvents)) {\n switch (this.event) {\n case ECommerceEvents.CHECKOUT_STEP_VIEWED:\n case ECommerceEvents.CHECKOUT_STEP_COMPLETED:\n case ECommerceEvents.PAYMENT_INFO_ENTERED:\n this.checkForKey(\"checkout_id\");\n this.checkForKey(\"step\");\n break;\n case ECommerceEvents.PROMOTION_VIEWED:\n case ECommerceEvents.PROMOTION_CLICKED:\n this.checkForKey(\"promotion_id\");\n break;\n case ECommerceEvents.ORDER_REFUNDED:\n this.checkForKey(\"order_id\");\n break;\n default:\n }\n } else if (!this.properties[\"category\"]) {\n //if category is not there, set to event\n this.properties[\"category\"] = this.event;\n }\n\n break;\n case MessageType.PAGE:\n break;\n case MessageType.SCREEN:\n if (!this.properties[\"name\"]) {\n throw new Error(\"Key 'name' is required in properties\");\n }\n break;\n }\n }\n\n //Function for checking existence of a particular property\n checkForKey(propertyName) {\n if (!this.properties[propertyName]) {\n throw new Error(\"Key '\" + propertyName + \"' is required in properties\");\n }\n }\n}\nexport default RudderMessage;\n","import RudderMessage from \"./RudderMessage\";\n//Individual element class containing Rudder Message\nclass RudderElement {\n constructor() {\n this.message = new RudderMessage();\n }\n\n //Setters that in turn set the field values for the contained object\n setType(type) {\n this.message.type = type;\n }\n\n setProperty(rudderProperty) {\n this.message.properties = rudderProperty;\n }\n\n setUserProperty(rudderUserProperty) {\n this.message.user_properties = rudderUserProperty;\n }\n\n setUserId(userId) {\n this.message.userId = userId;\n }\n\n setEventName(eventName) {\n this.message.event = eventName;\n }\n\n updateTraits(traits) {\n this.message.context.traits = traits;\n }\n\n getElementContent() {\n return this.message;\n }\n}\nexport default RudderElement;\n","//Class responsible for building up the individual elements in a batch\n//that is transmitted by the SDK\nimport RudderElement from \"./RudderElement.js\";\nclass RudderElementBuilder {\n constructor() {\n this.rudderProperty = null;\n this.rudderUserProperty = null;\n this.event = null;\n this.userId = null;\n this.channel = null;\n this.type = null;\n }\n\n //Set the property\n setProperty(inputRudderProperty) {\n this.rudderProperty = inputRudderProperty;\n return this;\n }\n\n //Build and set the property object\n setPropertyBuilder(rudderPropertyBuilder) {\n this.rudderProperty = rudderPropertyBuilder.build();\n return this;\n }\n\n setUserProperty(inputRudderUserProperty) {\n this.rudderUserProperty = inputRudderUserProperty;\n return this;\n }\n\n setUserPropertyBuilder(rudderUserPropertyBuilder) {\n this.rudderUserProperty = rudderUserPropertyBuilder.build();\n return this;\n }\n\n //Setter methods for all variables. Instance is returned for each call in\n //accordance with the Builder pattern\n\n setEvent(event) {\n this.event = event;\n return this;\n }\n\n setUserId(userId) {\n this.userId = userId;\n return this;\n }\n\n setChannel(channel) {\n this.channel = channel;\n return this;\n }\n\n setType(eventType) {\n this.type = eventType;\n return this;\n }\n\n build() {\n let element = new RudderElement();\n element.setUserId(this.userId);\n element.setType(this.type);\n element.setEventName(this.event);\n element.setProperty(this.rudderProperty);\n element.setUserProperty(this.rudderUserProperty);\n return element;\n }\n}\nexport default RudderElementBuilder;\n","//Payload class, contains batch of Elements\nclass RudderPayload {\n constructor() {\n this.batch = null;\n this.writeKey = null;\n }\n}\nexport { RudderPayload };\n","// Unique ID creation requires a high quality random # generator. In the\n// browser this is a little complicated due to unknown quality of Math.random()\n// and inconsistent support for the `crypto` API. We do the best we can via\n// feature-detection\n\n// getRandomValues needs to be invoked in a context where \"this\" is a Crypto\n// implementation. Also, find the complete implementation of crypto on IE11.\nvar getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto)) ||\n (typeof(msCrypto) != 'undefined' && typeof window.msCrypto.getRandomValues == 'function' && msCrypto.getRandomValues.bind(msCrypto));\n\nif (getRandomValues) {\n // WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto\n var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef\n\n module.exports = function whatwgRNG() {\n getRandomValues(rnds8);\n return rnds8;\n };\n} else {\n // Math.random()-based (RNG)\n //\n // If all else fails, use Math.random(). It's fast, but is of unspecified\n // quality.\n var rnds = new Array(16);\n\n module.exports = function mathRNG() {\n for (var i = 0, r; i < 16; i++) {\n if ((i & 0x03) === 0) r = Math.random() * 0x100000000;\n rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;\n }\n\n return rnds;\n };\n}\n","var rng = require('./lib/rng');\nvar bytesToUuid = require('./lib/bytesToUuid');\n\n// **`v1()` - Generate time-based UUID**\n//\n// Inspired by https://github.com/LiosK/UUID.js\n// and http://docs.python.org/library/uuid.html\n\nvar _nodeId;\nvar _clockseq;\n\n// Previous uuid creation time\nvar _lastMSecs = 0;\nvar _lastNSecs = 0;\n\n// See https://github.com/uuidjs/uuid for API details\nfunction v1(options, buf, offset) {\n var i = buf && offset || 0;\n var b = buf || [];\n\n options = options || {};\n var node = options.node || _nodeId;\n var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq;\n\n // node and clockseq need to be initialized to random values if they're not\n // specified. We do this lazily to minimize issues related to insufficient\n // system entropy. See #189\n if (node == null || clockseq == null) {\n var seedBytes = rng();\n if (node == null) {\n // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)\n node = _nodeId = [\n seedBytes[0] | 0x01,\n seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]\n ];\n }\n if (clockseq == null) {\n // Per 4.2.2, randomize (14 bit) clockseq\n clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;\n }\n }\n\n // UUID timestamps are 100 nano-second units since the Gregorian epoch,\n // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so\n // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'\n // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.\n var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime();\n\n // Per 4.2.1.2, use count of uuid's generated during the current clock\n // cycle to simulate higher resolution clock\n var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1;\n\n // Time since last uuid creation (in msecs)\n var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000;\n\n // Per 4.2.1.2, Bump clockseq on clock regression\n if (dt < 0 && options.clockseq === undefined) {\n clockseq = clockseq + 1 & 0x3fff;\n }\n\n // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new\n // time interval\n if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {\n nsecs = 0;\n }\n\n // Per 4.2.1.2 Throw error if too many uuids are requested\n if (nsecs >= 10000) {\n throw new Error('uuid.v1(): Can\\'t create more than 10M uuids/sec');\n }\n\n _lastMSecs = msecs;\n _lastNSecs = nsecs;\n _clockseq = clockseq;\n\n // Per 4.1.4 - Convert from unix epoch to Gregorian epoch\n msecs += 12219292800000;\n\n // `time_low`\n var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;\n b[i++] = tl >>> 24 & 0xff;\n b[i++] = tl >>> 16 & 0xff;\n b[i++] = tl >>> 8 & 0xff;\n b[i++] = tl & 0xff;\n\n // `time_mid`\n var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff;\n b[i++] = tmh >>> 8 & 0xff;\n b[i++] = tmh & 0xff;\n\n // `time_high_and_version`\n b[i++] = tmh >>> 24 & 0xf | 0x10; // include version\n b[i++] = tmh >>> 16 & 0xff;\n\n // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)\n b[i++] = clockseq >>> 8 | 0x80;\n\n // `clock_seq_low`\n b[i++] = clockseq & 0xff;\n\n // `node`\n for (var n = 0; n < 6; ++n) {\n b[i + n] = node[n];\n }\n\n return buf ? buf : bytesToUuid(b);\n}\n\nmodule.exports = v1;\n","var rng = require('./lib/rng');\nvar bytesToUuid = require('./lib/bytesToUuid');\n\nfunction v4(options, buf, offset) {\n var i = buf && offset || 0;\n\n if (typeof(options) == 'string') {\n buf = options === 'binary' ? new Array(16) : null;\n options = null;\n }\n options = options || {};\n\n var rnds = options.random || (options.rng || rng)();\n\n // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n rnds[6] = (rnds[6] & 0x0f) | 0x40;\n rnds[8] = (rnds[8] & 0x3f) | 0x80;\n\n // Copy bytes to buffer, if provided\n if (buf) {\n for (var ii = 0; ii < 16; ++ii) {\n buf[i + ii] = rnds[ii];\n }\n }\n\n return buf || bytesToUuid(rnds);\n}\n\nmodule.exports = v4;\n","var v1 = require('./v1');\nvar v4 = require('./v4');\n\nvar uuid = v4;\nuuid.v1 = v1;\nuuid.v4 = v4;\n\nmodule.exports = uuid;\n","'use strict';\n\nvar keys = require('@ndhoule/keys');\nvar uuid = require('uuid').v4;\n\nvar inMemoryStore = {\n _data: {},\n length: 0,\n setItem: function(key, value) {\n this._data[key] = value;\n this.length = keys(this._data).length;\n return value;\n },\n getItem: function(key) {\n if (key in this._data) {\n return this._data[key];\n }\n return null;\n },\n removeItem: function(key) {\n if (key in this._data) {\n delete this._data[key];\n }\n this.length = keys(this._data).length;\n return null;\n },\n clear: function() {\n this._data = {};\n this.length = 0;\n },\n key: function(index) {\n return keys(this._data)[index];\n }\n};\n\nfunction isSupportedNatively() {\n try {\n if (!window.localStorage) return false;\n var key = uuid();\n window.localStorage.setItem(key, 'test_value');\n var value = window.localStorage.getItem(key);\n window.localStorage.removeItem(key);\n\n // handle localStorage silently failing\n return value === 'test_value';\n } catch (e) {\n // Can throw if localStorage is disabled\n return false;\n }\n}\n\nfunction pickStorage() {\n if (isSupportedNatively()) {\n return window.localStorage;\n }\n // fall back to in-memory\n return inMemoryStore;\n}\n\n// Return a shared instance\nmodule.exports.defaultEngine = pickStorage();\n// Expose the in-memory store explicitly for testing\nmodule.exports.inMemoryEngine = inMemoryStore;\n","'use strict';\n\nvar defaultEngine = require('./engine').defaultEngine;\nvar inMemoryEngine = require('./engine').inMemoryEngine;\nvar each = require('@ndhoule/each');\nvar keys = require('@ndhoule/keys');\nvar json = require('json3');\n\n/**\n* Store Implementation with dedicated\n*/\n\nfunction Store(name, id, keys, optionalEngine) {\n this.id = id;\n this.name = name;\n this.keys = keys || {};\n this.engine = optionalEngine || defaultEngine;\n}\n\n/**\n* Set value by key.\n*/\n\nStore.prototype.set = function(key, value) {\n var compoundKey = this._createValidKey(key);\n if (!compoundKey) return;\n try {\n this.engine.setItem(compoundKey, json.stringify(value));\n } catch (err) {\n if (isQuotaExceeded(err)) {\n // switch to inMemory engine\n this._swapEngine();\n // and save it there\n this.set(key, value);\n }\n }\n};\n\n/**\n* Get by Key.\n*/\n\nStore.prototype.get = function(key) {\n try {\n var str = this.engine.getItem(this._createValidKey(key));\n if (str === null) {\n return null;\n }\n return json.parse(str);\n } catch (err) {\n return null;\n }\n};\n\n/**\n* Remove by Key.\n*/\n\nStore.prototype.remove = function(key) {\n this.engine.removeItem(this._createValidKey(key));\n};\n\n/**\n* Ensure the key is valid\n*/\n\nStore.prototype._createValidKey = function(key) {\n var name = this.name;\n var id = this.id;\n\n if (!keys(this.keys).length) return [name, id, key].join('.');\n\n // validate and return undefined if invalid key\n var compoundKey;\n each(function(value) {\n if (value === key) {\n compoundKey = [name, id, key].join('.');\n }\n }, this.keys);\n return compoundKey;\n};\n\n/**\n* Switch to inMemoryEngine, bringing any existing data with.\n*/\n\nStore.prototype._swapEngine = function() {\n var self = this;\n\n // grab existing data, but only for this page's queue instance, not all\n // better to keep other queues in localstorage to be flushed later\n // than to pull them into memory and remove them from durable storage\n each(function(key) {\n var value = self.get(key);\n inMemoryEngine.setItem([self.name, self.id, key].join('.'), value);\n self.remove(key);\n }, this.keys);\n\n this.engine = inMemoryEngine;\n};\n\nmodule.exports = Store;\n\nfunction isQuotaExceeded(e) {\n var quotaExceeded = false;\n if (e.code) {\n switch (e.code) {\n case 22:\n quotaExceeded = true;\n break;\n case 1014:\n // Firefox\n if (e.name === 'NS_ERROR_DOM_QUOTA_REACHED') {\n quotaExceeded = true;\n }\n break;\n default:\n break;\n }\n } else if (e.number === -2147024882) {\n // Internet Explorer 8\n quotaExceeded = true;\n }\n return quotaExceeded;\n}\n","'use strict';\n\nvar each = require('@ndhoule/each');\n\nvar defaultClock = {\n setTimeout: function(fn, ms) {\n return window.setTimeout(fn, ms);\n },\n clearTimeout: function(id) {\n return window.clearTimeout(id);\n },\n Date: window.Date\n};\n\nvar clock = defaultClock;\n\nfunction Schedule() {\n this.tasks = {};\n this.nextId = 1;\n}\n\nSchedule.prototype.now = function() {\n return +new clock.Date();\n};\n\nSchedule.prototype.run = function(task, timeout) {\n var id = this.nextId++;\n this.tasks[id] = clock.setTimeout(this._handle(id, task), timeout);\n return id;\n};\n\nSchedule.prototype.cancel = function(id) {\n if (this.tasks[id]) {\n clock.clearTimeout(this.tasks[id]);\n delete this.tasks[id];\n }\n};\n\nSchedule.prototype.cancelAll = function() {\n each(clock.clearTimeout, this.tasks);\n this.tasks = {};\n};\n\nSchedule.prototype._handle = function(id, callback) {\n var self = this;\n return function() {\n delete self.tasks[id];\n return callback();\n };\n};\n\nSchedule.setClock = function(newClock) {\n clock = newClock;\n};\n\nSchedule.resetClock = function() {\n clock = defaultClock;\n};\n\nmodule.exports = Schedule;\n","\n/**\n * Expose `debug()` as the module.\n */\n\nmodule.exports = debug;\n\n/**\n * Create a debugger with the given `name`.\n *\n * @param {String} name\n * @return {Type}\n * @api public\n */\n\nfunction debug(name) {\n if (!debug.enabled(name)) return function(){};\n\n return function(fmt){\n fmt = coerce(fmt);\n\n var curr = new Date;\n var ms = curr - (debug[name] || curr);\n debug[name] = curr;\n\n fmt = name\n + ' '\n + fmt\n + ' +' + debug.humanize(ms);\n\n // This hackery is required for IE8\n // where `console.log` doesn't have 'apply'\n window.console\n && console.log\n && Function.prototype.apply.call(console.log, console, arguments);\n }\n}\n\n/**\n * The currently active debug mode names.\n */\n\ndebug.names = [];\ndebug.skips = [];\n\n/**\n * Enables a debug mode by name. This can include modes\n * separated by a colon and wildcards.\n *\n * @param {String} name\n * @api public\n */\n\ndebug.enable = function(name) {\n try {\n localStorage.debug = name;\n } catch(e){}\n\n var split = (name || '').split(/[\\s,]+/)\n , len = split.length;\n\n for (var i = 0; i < len; i++) {\n name = split[i].replace('*', '.*?');\n if (name[0] === '-') {\n debug.skips.push(new RegExp('^' + name.substr(1) + '$'));\n }\n else {\n debug.names.push(new RegExp('^' + name + '$'));\n }\n }\n};\n\n/**\n * Disable debug output.\n *\n * @api public\n */\n\ndebug.disable = function(){\n debug.enable('');\n};\n\n/**\n * Humanize the given `ms`.\n *\n * @param {Number} m\n * @return {String}\n * @api private\n */\n\ndebug.humanize = function(ms) {\n var sec = 1000\n , min = 60 * 1000\n , hour = 60 * min;\n\n if (ms >= hour) return (ms / hour).toFixed(1) + 'h';\n if (ms >= min) return (ms / min).toFixed(1) + 'm';\n if (ms >= sec) return (ms / sec | 0) + 's';\n return ms + 'ms';\n};\n\n/**\n * Returns true if the given mode name is enabled, false otherwise.\n *\n * @param {String} name\n * @return {Boolean}\n * @api public\n */\n\ndebug.enabled = function(name) {\n for (var i = 0, len = debug.skips.length; i < len; i++) {\n if (debug.skips[i].test(name)) {\n return false;\n }\n }\n for (var i = 0, len = debug.names.length; i < len; i++) {\n if (debug.names[i].test(name)) {\n return true;\n }\n }\n return false;\n};\n\n/**\n * Coerce `val`.\n */\n\nfunction coerce(val) {\n if (val instanceof Error) return val.stack || val.message;\n return val;\n}\n\n// persist\n\ntry {\n if (window.localStorage) debug.enable(localStorage.debug);\n} catch(e){}\n","\n/**\n * Expose `Emitter`.\n */\n\nif (typeof module !== 'undefined') {\n module.exports = Emitter;\n}\n\n/**\n * Initialize a new `Emitter`.\n *\n * @api public\n */\n\nfunction Emitter(obj) {\n if (obj) return mixin(obj);\n};\n\n/**\n * Mixin the emitter properties.\n *\n * @param {Object} obj\n * @return {Object}\n * @api private\n */\n\nfunction mixin(obj) {\n for (var key in Emitter.prototype) {\n obj[key] = Emitter.prototype[key];\n }\n return obj;\n}\n\n/**\n * Listen on the given `event` with `fn`.\n *\n * @param {String} event\n * @param {Function} fn\n * @return {Emitter}\n * @api public\n */\n\nEmitter.prototype.on =\nEmitter.prototype.addEventListener = function(event, fn){\n this._callbacks = this._callbacks || {};\n (this._callbacks['$' + event] = this._callbacks['$' + event] || [])\n .push(fn);\n return this;\n};\n\n/**\n * Adds an `event` listener that will be invoked a single\n * time then automatically removed.\n *\n * @param {String} event\n * @param {Function} fn\n * @return {Emitter}\n * @api public\n */\n\nEmitter.prototype.once = function(event, fn){\n function on() {\n this.off(event, on);\n fn.apply(this, arguments);\n }\n\n on.fn = fn;\n this.on(event, on);\n return this;\n};\n\n/**\n * Remove the given callback for `event` or all\n * registered callbacks.\n *\n * @param {String} event\n * @param {Function} fn\n * @return {Emitter}\n * @api public\n */\n\nEmitter.prototype.off =\nEmitter.prototype.removeListener =\nEmitter.prototype.removeAllListeners =\nEmitter.prototype.removeEventListener = function(event, fn){\n this._callbacks = this._callbacks || {};\n\n // all\n if (0 == arguments.length) {\n this._callbacks = {};\n return this;\n }\n\n // specific event\n var callbacks = this._callbacks['$' + event];\n if (!callbacks) return this;\n\n // remove all handlers\n if (1 == arguments.length) {\n delete this._callbacks['$' + event];\n return this;\n }\n\n // remove specific handler\n var cb;\n for (var i = 0; i < callbacks.length; i++) {\n cb = callbacks[i];\n if (cb === fn || cb.fn === fn) {\n callbacks.splice(i, 1);\n break;\n }\n }\n\n // Remove event specific arrays for event types that no\n // one is subscribed for to avoid memory leak.\n if (callbacks.length === 0) {\n delete this._callbacks['$' + event];\n }\n\n return this;\n};\n\n/**\n * Emit `event` with the given args.\n *\n * @param {String} event\n * @param {Mixed} ...\n * @return {Emitter}\n */\n\nEmitter.prototype.emit = function(event){\n this._callbacks = this._callbacks || {};\n\n var args = new Array(arguments.length - 1)\n , callbacks = this._callbacks['$' + event];\n\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n\n if (callbacks) {\n callbacks = callbacks.slice(0);\n for (var i = 0, len = callbacks.length; i < len; ++i) {\n callbacks[i].apply(this, args);\n }\n }\n\n return this;\n};\n\n/**\n * Return array of callbacks for `event`.\n *\n * @param {String} event\n * @return {Array}\n * @api public\n */\n\nEmitter.prototype.listeners = function(event){\n this._callbacks = this._callbacks || {};\n return this._callbacks['$' + event] || [];\n};\n\n/**\n * Check if this emitter has `event` handlers.\n *\n * @param {String} event\n * @return {Boolean}\n * @api public\n */\n\nEmitter.prototype.hasListeners = function(event){\n return !! this.listeners(event).length;\n};\n","'use strict';\n\nvar uuid = require('uuid').v4;\nvar Store = require('./store');\nvar each = require('@ndhoule/each');\nvar Schedule = require('./schedule');\nvar debug = require('debug')('localstorage-retry');\nvar Emitter = require('component-emitter');\n\n// Some browsers don't support Function.prototype.bind, so just including a simplified version here\nfunction bind(func, obj) {\n return function() {\n return func.apply(obj, arguments);\n };\n}\n\n/**\n * @callback processFunc\n * @param {Mixed} item The item added to the queue to process\n * @param {Function} done A function to call when processing is completed.\n * @param {Error} Optional error parameter if the processing failed\n * @param {Response} Optional response parameter to emit for async handling\n */\n\n/**\n * Constructs a Queue backed by localStorage\n *\n * @constructor\n * @param {String} name The name of the queue. Will be used to find abandoned queues and retry their items\n * @param {processFunc} fn The function to call in order to process an item added to the queue\n */\nfunction Queue(name, opts, fn) {\n if (typeof opts === 'function') fn = opts;\n this.name = name;\n this.id = uuid();\n this.fn = fn;\n this.maxItems = opts.maxItems || Infinity;\n this.maxAttempts = opts.maxAttempts || Infinity;\n\n this.backoff = {\n MIN_RETRY_DELAY: opts.minRetryDelay || 1000,\n MAX_RETRY_DELAY: opts.maxRetryDelay || 30000,\n FACTOR: opts.backoffFactor || 2,\n JITTER: opts.backoffJitter || 0\n };\n\n // painstakingly tuned. that's why they're not \"easily\" configurable\n this.timeouts = {\n ACK_TIMER: 1000,\n RECLAIM_TIMER: 3000,\n RECLAIM_TIMEOUT: 10000,\n RECLAIM_WAIT: 500\n };\n\n this.keys = {\n IN_PROGRESS: 'inProgress',\n QUEUE: 'queue',\n ACK: 'ack',\n RECLAIM_START: 'reclaimStart',\n RECLAIM_END: 'reclaimEnd'\n };\n\n this._schedule = new Schedule();\n this._processId = 0;\n\n // Set up our empty queues\n this._store = new Store(this.name, this.id, this.keys);\n this._store.set(this.keys.IN_PROGRESS, {});\n this._store.set(this.keys.QUEUE, []);\n\n // bind recurring tasks for ease of use\n this._ack = bind(this._ack, this);\n this._checkReclaim = bind(this._checkReclaim, this);\n this._processHead = bind(this._processHead, this);\n\n this._running = false;\n}\n\n/**\n * Mix in event emitter\n */\n\nEmitter(Queue.prototype);\n\n/**\n * Starts processing the queue\n */\nQueue.prototype.start = function() {\n if (this._running) {\n this.stop();\n }\n this._running = true;\n this._ack();\n this._checkReclaim();\n this._processHead();\n};\n\n/**\n * Stops processing the queue\n */\nQueue.prototype.stop = function() {\n this._schedule.cancelAll();\n this._running = false;\n};\n\n/**\n * Decides whether to retry. Overridable.\n *\n * @param {Object} item The item being processed\n * @param {Number} attemptNumber The attemptNumber (1 for first retry)\n * @param {Error} error The error from previous attempt, if there was one\n * @return {Boolean} Whether to requeue the message\n */\nQueue.prototype.shouldRetry = function(_, attemptNumber) {\n if (attemptNumber > this.maxAttempts) return false;\n return true;\n};\n\n/**\n * Calculates the delay (in ms) for a retry attempt\n *\n * @param {Number} attemptNumber The attemptNumber (1 for first retry)\n * @return {Number} The delay in milliseconds to wait before attempting a retry\n */\nQueue.prototype.getDelay = function(attemptNumber) {\n var ms = this.backoff.MIN_RETRY_DELAY * Math.pow(this.backoff.FACTOR, attemptNumber);\n if (this.backoff.JITTER) {\n var rand = Math.random();\n var deviation = Math.floor(rand * this.backoff.JITTER * ms);\n if (Math.floor(rand * 10) < 5) {\n ms -= deviation;\n } else {\n ms += deviation;\n }\n }\n return Number(Math.min(ms, this.backoff.MAX_RETRY_DELAY).toPrecision(1));\n};\n\n/**\n * Adds an item to the queue\n *\n * @param {Mixed} item The item to process\n */\nQueue.prototype.addItem = function(item) {\n this._enqueue({\n item: item,\n attemptNumber: 0,\n time: this._schedule.now()\n });\n};\n\n/**\n * Adds an item to the retry queue\n *\n * @param {Mixed} item The item to retry\n * @param {Number} attemptNumber The attempt number (1 for first retry)\n * @param {Error} [error] The error from previous attempt, if there was one\n */\nQueue.prototype.requeue = function(item, attemptNumber, error) {\n if (this.shouldRetry(item, attemptNumber, error)) {\n this._enqueue({\n item: item,\n attemptNumber: attemptNumber,\n time: this._schedule.now() + this.getDelay(attemptNumber)\n });\n } else {\n this.emit('discard', item, attemptNumber);\n }\n};\n\nQueue.prototype._enqueue = function(entry) {\n var queue = this._store.get(this.keys.QUEUE) || [];\n queue = queue.slice(-(this.maxItems - 1));\n queue.push(entry);\n queue = queue.sort(function(a,b) {\n return a.time - b.time;\n });\n\n this._store.set(this.keys.QUEUE, queue);\n\n if (this._running) {\n this._processHead();\n }\n};\n\nQueue.prototype._processHead = function() {\n var self = this;\n var store = this._store;\n\n // cancel the scheduled task if it exists\n this._schedule.cancel(this._processId);\n\n // Pop the head off the queue\n var queue = store.get(this.keys.QUEUE) || [];\n var inProgress = store.get(this.keys.IN_PROGRESS) || {};\n var now = this._schedule.now();\n var toRun = [];\n\n function enqueue(el, id) {\n toRun.push({\n item: el.item,\n done: function handle(err, res) {\n var inProgress = store.get(self.keys.IN_PROGRESS) || {};\n delete inProgress[id];\n store.set(self.keys.IN_PROGRESS, inProgress);\n self.emit('processed', err, res, el.item);\n if (err) {\n self.requeue(el.item, el.attemptNumber + 1, err);\n }\n }\n });\n }\n\n var inProgressSize = Object.keys(inProgress).length;\n\n while (queue.length && queue[0].time <= now && inProgressSize++ < self.maxItems) {\n var el = queue.shift();\n var id = uuid();\n\n // Save this to the in progress map\n inProgress[id] = {\n item: el.item,\n attemptNumber: el.attemptNumber,\n time: self._schedule.now()\n };\n\n enqueue(el, id);\n }\n\n store.set(this.keys.QUEUE, queue);\n store.set(this.keys.IN_PROGRESS, inProgress);\n\n each(function(el) {\n // TODO: handle fn timeout\n try {\n self.fn(el.item, el.done);\n } catch (err) {\n debug('Process function threw error: ' + err);\n }\n }, toRun);\n\n // re-read the queue in case the process function finished immediately or added another item\n queue = store.get(this.keys.QUEUE) || [];\n this._schedule.cancel(this._processId);\n if (queue.length > 0) {\n this._processId = this._schedule.run(this._processHead, queue[0].time - now);\n }\n};\n\n// Ack continuously to prevent other tabs from claiming our queue\nQueue.prototype._ack = function() {\n this._store.set(this.keys.ACK, this._schedule.now());\n this._store.set(this.keys.RECLAIM_START, null);\n this._store.set(this.keys.RECLAIM_END, null);\n this._schedule.run(this._ack, this.timeouts.ACK_TIMER);\n};\n\nQueue.prototype._checkReclaim = function() {\n var self = this;\n\n function tryReclaim(store) {\n store.set(self.keys.RECLAIM_START, self.id);\n store.set(self.keys.ACK, self._schedule.now());\n\n self._schedule.run(function() {\n if (store.get(self.keys.RECLAIM_START) !== self.id) return;\n store.set(self.keys.RECLAIM_END, self.id);\n\n self._schedule.run(function() {\n if (store.get(self.keys.RECLAIM_END) !== self.id) return;\n if (store.get(self.keys.RECLAIM_START) !== self.id) return;\n self._reclaim(store.id);\n }, self.timeouts.RECLAIM_WAIT);\n }, self.timeouts.RECLAIM_WAIT);\n }\n\n function findOtherQueues(name) {\n var res = [];\n var storage = self._store.engine;\n for (var i = 0; i < storage.length; i++) {\n var k = storage.key(i);\n var parts = k.split('.');\n if (parts.length !== 3) continue;\n if (parts[0] !== name) continue;\n if (parts[2] !== 'ack') continue;\n res.push(new Store(name, parts[1], self.keys));\n }\n return res;\n }\n\n each(function(store) {\n if (store.id === self.id) return;\n if (self._schedule.now() - store.get(self.keys.ACK) < self.timeouts.RECLAIM_TIMEOUT) return;\n tryReclaim(store);\n }, findOtherQueues(this.name));\n\n this._schedule.run(this._checkReclaim, this.timeouts.RECLAIM_TIMER);\n};\n\nQueue.prototype._reclaim = function(id) {\n var self = this;\n var other = new Store(this.name, id, this.keys);\n\n var our = {\n queue: this._store.get(this.keys.QUEUE) || []\n };\n\n var their = {\n inProgress: other.get(this.keys.IN_PROGRESS) || {},\n queue: other.get(this.keys.QUEUE) || []\n };\n\n // add their queue to ours, resetting run-time to immediate and copying the attempt#\n each(function(el) {\n our.queue.push({\n item: el.item,\n attemptNumber: el.attemptNumber,\n time: self._schedule.now()\n });\n }, their.queue);\n\n // if the queue is abandoned, all the in-progress are failed. retry them immediately and increment the attempt#\n each(function(el) {\n our.queue.push({\n item: el.item,\n attemptNumber: el.attemptNumber + 1,\n time: self._schedule.now()\n });\n }, their.inProgress);\n\n our.queue = our.queue.sort(function(a,b) {\n return a.time - b.time;\n });\n\n this._store.set(this.keys.QUEUE, our.queue);\n\n // remove all keys\n other.remove(this.keys.ACK);\n other.remove(this.keys.RECLAIM_START);\n other.remove(this.keys.RECLAIM_END);\n other.remove(this.keys.IN_PROGRESS);\n other.remove(this.keys.QUEUE);\n\n // process the new items we claimed\n this._processHead();\n};\n\nmodule.exports = Queue;\n","import {\n BASE_URL,\n FLUSH_QUEUE_SIZE,\n FLUSH_INTERVAL_DEFAULT\n} from \"./constants\";\nimport { getCurrentTimeFormatted, handleError } from \"./utils\";\nimport { replacer } from \"./utils\";\nimport { RudderPayload } from \"./RudderPayload\";\nimport Queue from \"@segment/localstorage-retry\";\nimport logger from \"./logUtil\";\n//import * as XMLHttpRequestNode from \"Xmlhttprequest\";\n\nlet XMLHttpRequestNode;\nif (!process.browser) {\n XMLHttpRequestNode = require(\"Xmlhttprequest\");\n}\n\nlet btoaNode;\nif (!process.browser) {\n btoaNode = require(\"btoa\");\n}\n\nvar queueOptions = {\n maxRetryDelay: 360000,\n minRetryDelay: 1000,\n backoffFactor: 2,\n maxAttempts: 10,\n maxItems: 100\n};\n\nconst MESSAGE_LENGTH = 32 * 1000; // ~32 Kb\n\n/**\n *\n * @class EventRepository responsible for adding events into\n * flush queue and sending data to rudder backend\n * in batch and maintains order of the event.\n */\nclass EventRepository {\n /**\n *Creates an instance of EventRepository.\n * @memberof EventRepository\n */\n constructor() {\n this.eventsBuffer = [];\n this.writeKey = \"\";\n this.url = BASE_URL;\n this.state = \"READY\";\n this.batchSize = 0;\n\n // previous implementation\n //setInterval(this.preaparePayloadAndFlush, FLUSH_INTERVAL_DEFAULT, this);\n\n this.payloadQueue = new Queue(\"rudder\", queueOptions, function(item, done) {\n // apply sentAt at flush time and reset on each retry\n item.message.sentAt = getCurrentTimeFormatted();\n //send this item for processing, with a callback to enable queue to get the done status\n eventRepository.processQueueElement(\n item.url,\n item.headers,\n item.message,\n 10 * 1000,\n function(err, res) {\n if (err) {\n return done(err);\n }\n done(null, res);\n }\n );\n });\n\n //start queue\n this.payloadQueue.start();\n }\n\n /**\n *\n *\n * @param {EventRepository} repo\n * @returns\n * @memberof EventRepository\n */\n preaparePayloadAndFlush(repo) {\n //construct payload\n logger.debug(\"==== in preaparePayloadAndFlush with state: \" + repo.state);\n logger.debug(repo.eventsBuffer);\n if (repo.eventsBuffer.length == 0 || repo.state === \"PROCESSING\") {\n return;\n }\n var eventsPayload = repo.eventsBuffer;\n var payload = new RudderPayload();\n payload.batch = eventsPayload;\n payload.writeKey = repo.writeKey;\n payload.sentAt = getCurrentTimeFormatted();\n\n //add sentAt to individual events as well\n payload.batch.forEach(event => {\n event.sentAt = payload.sentAt;\n });\n\n repo.batchSize = repo.eventsBuffer.length;\n //server-side integration, XHR is node module\n\n if (process.browser) {\n var xhr = new XMLHttpRequest();\n } else {\n var xhr = new XMLHttpRequestNode.XMLHttpRequest();\n }\n\n logger.debug(\"==== in flush sending to Rudder BE ====\");\n logger.debug(JSON.stringify(payload, replacer));\n\n xhr.open(\"POST\", repo.url, true);\n xhr.setRequestHeader(\"Content-Type\", \"application/json\");\n\n if (process.browser) {\n xhr.setRequestHeader(\n \"Authorization\",\n \"Basic \" + btoa(payload.writeKey + \":\")\n );\n } else {\n xhr.setRequestHeader(\n \"Authorization\",\n \"Basic \" + btoaNode(payload.writeKey + \":\")\n );\n }\n\n //register call back to reset event buffer on successfull POST\n xhr.onreadystatechange = function() {\n if (xhr.readyState === 4 && xhr.status === 200) {\n logger.debug(\"====== request processed successfully: \" + xhr.status);\n repo.eventsBuffer = repo.eventsBuffer.slice(repo.batchSize);\n logger.debug(repo.eventsBuffer.length);\n } else if (xhr.readyState === 4 && xhr.status !== 200) {\n handleError(\n new Error(\n \"request failed with status: \" +\n xhr.status +\n \" for url: \" +\n repo.url\n )\n );\n }\n repo.state = \"READY\";\n };\n xhr.send(JSON.stringify(payload, replacer));\n repo.state = \"PROCESSING\";\n }\n\n /**\n * the queue item proceesor\n * @param {*} url to send requests to\n * @param {*} headers\n * @param {*} message\n * @param {*} timeout\n * @param {*} queueFn the function to call after request completion\n */\n processQueueElement(url, headers, message, timeout, queueFn) {\n try {\n var xhr = new XMLHttpRequest();\n xhr.open(\"POST\", url, true);\n for (var k in headers) {\n xhr.setRequestHeader(k, headers[k]);\n }\n xhr.timeout = timeout;\n xhr.ontimeout = queueFn;\n xhr.onerror = queueFn;\n xhr.onreadystatechange = function() {\n if (xhr.readyState === 4) {\n if (xhr.status === 429 || (xhr.status >= 500 && xhr.status < 600)) {\n handleError(\n new Error(\n \"request failed with status: \" +\n xhr.status +\n xhr.statusText +\n \" for url: \" +\n url\n )\n );\n queueFn(\n new Error(\n \"request failed with status: \" +\n xhr.status +\n xhr.statusText +\n \" for url: \" +\n url\n )\n );\n } else {\n logger.debug(\n \"====== request processed successfully: \" + xhr.status\n );\n queueFn(null, xhr.status);\n }\n }\n };\n\n xhr.send(JSON.stringify(message, replacer));\n } catch (error) {\n queueFn(error);\n }\n }\n\n /**\n *\n *\n * @param {RudderElement} rudderElement\n * @memberof EventRepository\n */\n enqueue(rudderElement, type) {\n var message = rudderElement.getElementContent();\n\n var headers = {\n \"Content-Type\": \"application/json\",\n Authorization: \"Basic \" + btoa(this.writeKey + \":\"),\n AnonymousId: btoa(message.anonymousId)\n };\n\n message.originalTimestamp = getCurrentTimeFormatted();\n message.sentAt = getCurrentTimeFormatted(); // add this, will get modified when actually being sent\n\n // check message size, if greater log an error\n if (JSON.stringify(message).length > MESSAGE_LENGTH) {\n logger.error(\"[EventRepository] enqueue:: message length greater 32 Kb \", message);\n }\n\n //modify the url for event specific endpoints\n var url = this.url.slice(-1) == \"/\" ? this.url.slice(0, -1) : this.url;\n // add items to the queue\n this.payloadQueue.addItem({\n url: url + \"/v1/\" + type,\n headers: headers,\n message: message\n });\n }\n}\nlet eventRepository = new EventRepository();\nexport { eventRepository as EventRepository };\n","import { getDefaultPageProperties } from \"./utils\";\nimport logger from \"./logUtil\";\n\nfunction addDomEventHandlers(rudderanalytics) {\n var handler = e => {\n e = e || window.event;\n var target = e.target || e.srcElement;\n\n if (isTextNode(target)) {\n target = target.parentNode;\n }\n if (shouldTrackDomEvent(target, e)) {\n logger.debug(\"to be tracked \", e.type);\n } else {\n logger.debug(\"not to be tracked \", e.type);\n }\n trackWindowEvent(e, rudderanalytics);\n };\n register_event(document, \"submit\", handler, true);\n register_event(document, \"change\", handler, true);\n register_event(document, \"click\", handler, true);\n rudderanalytics.page();\n}\n\nfunction register_event(element, type, handler, useCapture) {\n if (!element) {\n logger.error(\"[Autotrack] register_event:: No valid element provided to register_event\");\n return;\n }\n element.addEventListener(type, handler, !!useCapture);\n}\n\nfunction shouldTrackDomEvent(el, event) {\n if (!el || isTag(el, \"html\") || !isElementNode(el)) {\n return false;\n }\n var tag = el.tagName.toLowerCase();\n switch (tag) {\n case \"html\":\n return false;\n case \"form\":\n return event.type === \"submit\";\n case \"input\":\n if ([\"button\", \"submit\"].indexOf(el.getAttribute(\"type\")) === -1) {\n return event.type === \"change\";\n } else {\n return event.type === \"click\";\n }\n case \"select\":\n case \"textarea\":\n return event.type === \"change\";\n default:\n return event.type === \"click\";\n }\n}\n\nfunction isTag(el, tag) {\n return el && el.tagName && el.tagName.toLowerCase() === tag.toLowerCase();\n}\n\nfunction isElementNode(el) {\n return el && el.nodeType === 1; // Node.ELEMENT_NODE - use integer constant for browser portability\n}\n\nfunction isTextNode(el) {\n return el && el.nodeType === 3; // Node.TEXT_NODE - use integer constant for browser portability\n}\n\nfunction shouldTrackElement(el) {\n if (!el.parentNode || isTag(el, \"body\")) return false;\n return true;\n}\n\nfunction getClassName(el) {\n switch (typeof el.className) {\n case \"string\":\n return el.className;\n case \"object\": // handle cases where className might be SVGAnimatedString or some other type\n return el.className.baseVal || el.getAttribute(\"class\") || \"\";\n default:\n // future proof\n return \"\";\n }\n}\n\nfunction trackWindowEvent(e, rudderanalytics) {\n var target = e.target || e.srcElement;\n var formValues = undefined;\n if (isTextNode(target)) {\n target = target.parentNode;\n }\n\n if (shouldTrackDomEvent(target, e)) {\n if (target.tagName.toLowerCase() == \"form\") {\n formValues = {};\n for (var i = 0; i < target.elements.length; i++) {\n var formElement = target.elements[i];\n if (\n isElToBeTracked(formElement) &&\n isElValueToBeTracked(formElement, rudderanalytics.trackValues)\n ) {\n let name = formElement.id ? formElement.id : formElement.name;\n if (name && typeof name === \"string\") {\n var key = formElement.id ? formElement.id : formElement.name;\n // formElement.value gives the same thing\n var value = formElement.id\n ? document.getElementById(formElement.id).value\n : document.getElementsByName(formElement.name)[0].value;\n if (\n formElement.type === \"checkbox\" ||\n formElement.type === \"radio\"\n ) {\n value = formElement.checked;\n }\n if (key.trim() !== \"\") {\n formValues[encodeURIComponent(key)] = encodeURIComponent(value);\n }\n }\n }\n }\n }\n var targetElementList = [target];\n var curEl = target;\n while (curEl.parentNode && !isTag(curEl, \"body\")) {\n targetElementList.push(curEl.parentNode);\n curEl = curEl.parentNode;\n }\n\n var elementsJson = [];\n var href,\n explicitNoTrack = false;\n\n targetElementList.forEach(el => {\n var shouldTrackEl = shouldTrackElement(el);\n\n // if the element or a parent element is an anchor tag\n // include the href as a property\n if (el.tagName.toLowerCase() === \"a\") {\n href = el.getAttribute(\"href\");\n href = shouldTrackEl && href;\n }\n\n // allow users to programatically prevent tracking of elements by adding class 'rudder-no-track'\n\n explicitNoTrack = explicitNoTrack || !isElToBeTracked(el);\n\n //explicitNoTrack = !isElToBeTracked(el);\n\n elementsJson.push(getPropertiesFromElement(el, rudderanalytics));\n });\n\n if (explicitNoTrack) {\n return false;\n }\n\n var elementText = \"\";\n var text = getText(target); //target.innerText//target.textContent//getSafeText(target);\n if (text && text.length) {\n elementText = text;\n }\n var props = {\n event_type: e.type,\n page: getDefaultPageProperties(),\n elements: elementsJson,\n el_attr_href: href,\n el_text: elementText\n };\n\n if (formValues) {\n props[\"form_values\"] = formValues;\n }\n\n logger.debug(\"web_event\", props);\n rudderanalytics.track(\"autotrack\", props);\n return true;\n }\n}\n\nfunction isElValueToBeTracked(el, includeList) {\n var elAttributesLength = el.attributes.length;\n for (let i = 0; i < elAttributesLength; i++) {\n let value = el.attributes[i].value;\n if (includeList.indexOf(value) > -1) {\n return true;\n }\n }\n return false;\n}\n\nfunction isElToBeTracked(el) {\n var classes = getClassName(el).split(\" \");\n if (classes.indexOf(\"rudder-no-track\") >= 0) {\n return false;\n }\n return true;\n}\n\nfunction getText(el) {\n var text = \"\";\n el.childNodes.forEach(function(value) {\n if (value.nodeType === Node.TEXT_NODE) {\n text += value.nodeValue;\n }\n });\n return text.trim();\n}\n\nfunction getPropertiesFromElement(elem, rudderanalytics) {\n var props = {\n classes: getClassName(elem).split(\" \"),\n tag_name: elem.tagName.toLowerCase()\n };\n\n let attrLength = elem.attributes.length;\n for (let i = 0; i < attrLength; i++) {\n let name = elem.attributes[i].name;\n let value = elem.attributes[i].value;\n if (value) {\n props[\"attr__\" + name] = value;\n }\n if (\n (name == \"name\" || name == \"id\") &&\n isElValueToBeTracked(elem, rudderanalytics.trackValues)\n ) {\n props[\"field_value\"] =\n name == \"id\"\n ? document.getElementById(value).value\n : document.getElementsByName(value)[0].value;\n\n if (elem.type === \"checkbox\" || elem.type === \"radio\") {\n props[\"field_value\"] = elem.checked;\n }\n }\n }\n\n var nthChild = 1;\n var nthOfType = 1;\n var currentElem = elem;\n while ((currentElem = previousElementSibling(currentElem))) {\n nthChild++;\n if (currentElem.tagName === elem.tagName) {\n nthOfType++;\n }\n }\n props[\"nth_child\"] = nthChild;\n props[\"nth_of_type\"] = nthOfType;\n\n return props;\n}\n\nfunction previousElementSibling(el) {\n if (el.previousElementSibling) {\n return el.previousElementSibling;\n } else {\n do {\n el = el.previousSibling;\n } while (el && !isElementNode(el));\n return el;\n }\n}\nexport { addDomEventHandlers };\n","module.exports = after\n\nfunction after(count, callback, err_cb) {\n var bail = false\n err_cb = err_cb || noop\n proxy.count = count\n\n return (count === 0) ? callback() : proxy\n\n function proxy(err, result) {\n if (proxy.count <= 0) {\n throw new Error('after called too many times')\n }\n --proxy.count\n\n // after first error, rest are passed to err_cb\n if (err) {\n bail = true\n callback(err)\n // future error callbacks will go to error handler\n callback = err_cb\n } else if (proxy.count === 0 && !bail) {\n callback(null, result)\n }\n }\n}\n\nfunction noop() {}\n","import {\n getJSONTrimmed,\n generateUUID,\n handleError,\n getDefaultPageProperties,\n findAllEnabledDestinations,\n tranformToRudderNames,\n transformToServerNames\n} from \"./utils/utils\";\nimport {\n CONFIG_URL,\n ECommerceEvents,\n MAX_WAIT_FOR_INTEGRATION_LOAD,\n INTEGRATION_LOAD_CHECK_INTERVAL\n} from \"./utils/constants\";\nimport { integrations } from \"./integrations\";\nimport RudderElementBuilder from \"./utils/RudderElementBuilder\";\nimport Storage from \"./utils/storage\";\nimport { EventRepository } from \"./utils/EventRepository\";\nimport logger from \"./utils/logUtil\";\nimport { addDomEventHandlers } from \"./utils/autotrack.js\";\nimport Emitter from \"component-emitter\";\nimport after from \"after\";\nimport {ScriptLoader} from \"./integrations/ScriptLoader\"\n\n//https://unpkg.com/test-rudder-sdk@1.0.5/dist/browser.js\n\n/**\n * Add the rudderelement object to flush queue\n *\n * @param {RudderElement} rudderElement\n */\nfunction enqueue(rudderElement, type) {\n if (!this.eventRepository) {\n this.eventRepository = EventRepository;\n }\n this.eventRepository.enqueue(rudderElement, type);\n}\n\n/**\n * class responsible for handling core\n * event tracking functionalities\n */\nclass Analytics {\n /**\n * Creates an instance of Analytics.\n * @memberof Analytics\n */\n constructor() {\n this.autoTrackHandlersRegistered = false;\n this.autoTrackFeatureEnabled = false;\n this.initialized = false;\n this.trackValues = [];\n this.eventsBuffer = [];\n this.clientIntegrations = [];\n this.loadOnlyIntegrations = {};\n this.clientIntegrationObjects = undefined;\n this.successfullyLoadedIntegration = [];\n this.failedToBeLoadedIntegration = [];\n this.toBeProcessedArray = [];\n this.toBeProcessedByIntegrationArray = [];\n this.storage = Storage;\n this.userId =\n this.storage.getUserId() != undefined ? this.storage.getUserId() : \"\";\n\n this.userTraits =\n this.storage.getUserTraits() != undefined\n ? this.storage.getUserTraits()\n : {};\n\n this.groupId =\n this.storage.getGroupId() != undefined ? this.storage.getGroupId() : \"\";\n\n this.groupTraits =\n this.storage.getGroupTraits() != undefined\n ? this.storage.getGroupTraits()\n : {};\n\n this.anonymousId = this.getAnonymousId();\n this.storage.setUserId(this.userId);\n this.eventRepository = EventRepository;\n this.sendAdblockPage = false\n this.sendAdblockPageOptions = {}\n this.clientSuppliedCallbacks = {}\n this.readyCallback = () => {};\n this.executeReadyCallback = undefined;\n this.methodToCallbackMapping = {\n syncPixel: \"syncPixelCallback\"\n };\n }\n\n /**\n * Process the response from control plane and\n * call initialize for integrations\n *\n * @param {*} status\n * @param {*} response\n * @memberof Analytics\n */\n processResponse(status, response) {\n try {\n logger.debug(\"===in process response=== \" + status);\n response = JSON.parse(response);\n if (\n response.source.useAutoTracking &&\n !this.autoTrackHandlersRegistered\n ) {\n this.autoTrackFeatureEnabled = true;\n addDomEventHandlers(this);\n this.autoTrackHandlersRegistered = true;\n }\n response.source.destinations.forEach(function(destination, index) {\n logger.debug(\n \"Destination \" +\n index +\n \" Enabled? \" +\n destination.enabled +\n \" Type: \" +\n destination.destinationDefinition.name +\n \" Use Native SDK? \" +\n destination.config.useNativeSDK\n );\n if (destination.enabled) {\n this.clientIntegrations.push({\"name\": destination.destinationDefinition.name, \"config\": destination.config});\n }\n }, this);\n\n // intersection of config-plane native sdk destinations with sdk load time destination list\n this.clientIntegrations = findAllEnabledDestinations(\n this.loadOnlyIntegrations,\n this.clientIntegrations\n );\n\n // remove from the list which don't have support yet in SDK\n this.clientIntegrations = this.clientIntegrations.filter(intg => {\n return integrations[intg.name] != undefined\n })\n\n this.init(this.clientIntegrations);\n } catch (error) {\n handleError(error);\n logger.debug(\"===handling config BE response processing error===\");\n logger.debug(\n \"autoTrackHandlersRegistered\",\n this.autoTrackHandlersRegistered\n );\n if (this.autoTrackFeatureEnabled && !this.autoTrackHandlersRegistered) {\n addDomEventHandlers(this);\n this.autoTrackHandlersRegistered = true;\n }\n }\n }\n\n /**\n * Initialize integrations by addinfg respective scripts\n * keep the instances reference in core\n *\n * @param {*} intgArray\n * @returns\n * @memberof Analytics\n */\n init(intgArray) {\n let self = this;\n logger.debug(\"supported intgs \", integrations);\n // this.clientIntegrationObjects = [];\n\n if (!intgArray || intgArray.length == 0) {\n if (this.readyCallback) {\n this.readyCallback();\n }\n this.toBeProcessedByIntegrationArray = [];\n return;\n }\n\n intgArray.forEach((intg) => {\n try {\n logger.debug(\"[Analytics] init :: trying to initialize integration name:: \", intg.name)\n let intgClass = integrations[intg.name];\n let destConfig = intg.config;\n let intgInstance = new intgClass(destConfig, self);\n intgInstance.init();\n\n logger.debug(\"initializing destination: \", intg);\n\n this.isInitialized(intgInstance).then(this.replayEvents);\n } catch (e) {\n logger.error(\"[Analytics] initialize integration (integration.init()) failed :: \", intg.name)\n }\n \n\n });\n }\n\n replayEvents(object) {\n if (\n object.successfullyLoadedIntegration.length +\n object.failedToBeLoadedIntegration.length ==\n object.clientIntegrations.length &&\n object.toBeProcessedByIntegrationArray.length > 0\n ) {\n logger.debug(\n \"===replay events called====\",\n object.successfullyLoadedIntegration.length,\n object.failedToBeLoadedIntegration.length\n );\n object.clientIntegrationObjects = [];\n object.clientIntegrationObjects = object.successfullyLoadedIntegration;\n\n logger.debug(\n \"==registering after callback===\",\n object.clientIntegrationObjects.length\n );\n object.executeReadyCallback = after(\n object.clientIntegrationObjects.length,\n object.readyCallback\n );\n\n logger.debug(\"==registering ready callback===\");\n object.on(\"ready\", object.executeReadyCallback);\n\n object.clientIntegrationObjects.forEach(intg => {\n logger.debug(\"===looping over each successful integration====\");\n if (!intg[\"isReady\"] || intg[\"isReady\"]()) {\n logger.debug(\"===letting know I am ready=====\", intg[\"name\"]);\n object.emit(\"ready\");\n }\n });\n\n //send the queued events to the fetched integration\n object.toBeProcessedByIntegrationArray.forEach(event => {\n let methodName = event[0];\n event.shift();\n\n // convert common names to sdk identified name\n if (Object.keys(event[0].message.integrations).length > 0) {\n tranformToRudderNames(event[0].message.integrations);\n }\n \n // if not specified at event level, All: true is default\n var clientSuppliedIntegrations = event[0].message.integrations;\n \n \n\n // get intersection between config plane native enabled destinations\n // (which were able to successfully load on the page) vs user supplied integrations\n var succesfulLoadedIntersectClientSuppliedIntegrations = findAllEnabledDestinations(\n clientSuppliedIntegrations,\n object.clientIntegrationObjects\n );\n\n //send to all integrations now from the 'toBeProcessedByIntegrationArray' replay queue\n for (let i = 0; i < succesfulLoadedIntersectClientSuppliedIntegrations.length; i++) {\n try {\n if (\n !succesfulLoadedIntersectClientSuppliedIntegrations[i][\"isFailed\"] ||\n !succesfulLoadedIntersectClientSuppliedIntegrations[i][\"isFailed\"]()\n ) {\n if(succesfulLoadedIntersectClientSuppliedIntegrations[i][methodName]) {\n succesfulLoadedIntersectClientSuppliedIntegrations[i][methodName](\n ...event\n );\n }\n \n }\n } catch (error) {\n handleError(error);\n }\n }\n });\n object.toBeProcessedByIntegrationArray = [];\n }\n }\n\n pause(time) {\n return new Promise(resolve => {\n setTimeout(resolve, time);\n });\n }\n\n isInitialized(instance, time = 0) {\n return new Promise(resolve => {\n if (instance.isLoaded()) {\n logger.debug(\n \"===integration loaded successfully====\",\n instance[\"name\"]\n );\n this.successfullyLoadedIntegration.push(instance);\n return resolve(this);\n }\n if (time >= MAX_WAIT_FOR_INTEGRATION_LOAD) {\n logger.debug(\"====max wait over====\");\n this.failedToBeLoadedIntegration.push(instance);\n return resolve(this);\n }\n\n this.pause(INTEGRATION_LOAD_CHECK_INTERVAL).then(() => {\n logger.debug(\"====after pause, again checking====\");\n return this.isInitialized(\n instance,\n time + INTEGRATION_LOAD_CHECK_INTERVAL\n ).then(resolve);\n });\n });\n }\n\n /**\n * Process page params and forward to page call\n *\n * @param {*} category\n * @param {*} name\n * @param {*} properties\n * @param {*} options\n * @param {*} callback\n * @memberof Analytics\n */\n page(category, name, properties, options, callback) {\n if (typeof options == \"function\") (callback = options), (options = null);\n if (typeof properties == \"function\")\n (callback = properties), (options = properties = null);\n if (typeof name == \"function\")\n (callback = name), (options = properties = name = null);\n if (typeof category === \"object\")\n (options = name), (properties = category), (name = category = null);\n if (typeof name === \"object\")\n (options = properties), (properties = name), (name = null);\n if (typeof category === \"string\" && typeof name !== \"string\")\n (name = category), (category = null);\n if(this.sendAdblockPage && category != \"RudderJS-Initiated\") {\n this.sendSampleRequest()\n }\n this.processPage(category, name, properties, options, callback);\n }\n\n /**\n * Process track params and forward to track call\n *\n * @param {*} event\n * @param {*} properties\n * @param {*} options\n * @param {*} callback\n * @memberof Analytics\n */\n track(event, properties, options, callback) {\n if (typeof options == \"function\") (callback = options), (options = null);\n if (typeof properties == \"function\")\n (callback = properties), (options = null), (properties = null);\n\n this.processTrack(event, properties, options, callback);\n }\n\n /**\n * Process identify params and forward to indentify call\n *\n * @param {*} userId\n * @param {*} traits\n * @param {*} options\n * @param {*} callback\n * @memberof Analytics\n */\n identify(userId, traits, options, callback) {\n if (typeof options == \"function\") (callback = options), (options = null);\n if (typeof traits == \"function\")\n (callback = traits), (options = null), (traits = null);\n if (typeof userId == \"object\")\n (options = traits), (traits = userId), (userId = this.userId);\n\n this.processIdentify(userId, traits, options, callback);\n }\n\n /**\n *\n * @param {*} to\n * @param {*} from\n * @param {*} options\n * @param {*} callback\n */\n alias(to, from, options, callback) {\n if (typeof options == \"function\") (callback = options), (options = null);\n if (typeof from == \"function\")\n (callback = from), (options = null), (from = null);\n if (typeof from == \"object\") (options = from), (from = null);\n\n let rudderElement = new RudderElementBuilder().setType(\"alias\").build();\n rudderElement.message.previousId =\n from || (this.userId ? this.userId : this.getAnonymousId());\n rudderElement.message.userId = to;\n\n this.processAndSendDataToDestinations(\n \"alias\",\n rudderElement,\n options,\n callback\n );\n }\n\n /**\n *\n * @param {*} to\n * @param {*} from\n * @param {*} options\n * @param {*} callback\n */\n group(groupId, traits, options, callback) {\n if (!arguments.length) return;\n\n if (typeof options == \"function\") (callback = options), (options = null);\n if (typeof traits == \"function\")\n (callback = traits), (options = null), (traits = null);\n if (typeof groupId == \"object\")\n (options = traits), (traits = groupId), (groupId = this.groupId);\n\n this.groupId = groupId;\n this.storage.setGroupId(this.groupId);\n\n let rudderElement = new RudderElementBuilder().setType(\"group\").build();\n if (traits) {\n for (let key in traits) {\n this.groupTraits[key] = traits[key];\n }\n } else {\n this.groupTraits = {};\n }\n this.storage.setGroupTraits(this.groupTraits);\n\n this.processAndSendDataToDestinations(\n \"group\",\n rudderElement,\n options,\n callback\n );\n }\n\n /**\n * Send page call to Rudder BE and to initialized integrations\n *\n * @param {*} category\n * @param {*} name\n * @param {*} properties\n * @param {*} options\n * @param {*} callback\n * @memberof Analytics\n */\n processPage(category, name, properties, options, callback) {\n let rudderElement = new RudderElementBuilder().setType(\"page\").build();\n if (name) {\n rudderElement[\"message\"][\"name\"] = name;\n }\n if (!properties) {\n properties = {};\n }\n if (category) {\n properties[\"category\"] = category;\n }\n if (properties) {\n rudderElement[\"message\"][\"properties\"] = this.getPageProperties(\n properties\n ); //properties;\n }\n\n this.trackPage(rudderElement, options, callback);\n }\n\n /**\n * Send track call to Rudder BE and to initialized integrations\n *\n * @param {*} event\n * @param {*} properties\n * @param {*} options\n * @param {*} callback\n * @memberof Analytics\n */\n processTrack(event, properties, options, callback) {\n let rudderElement = new RudderElementBuilder().setType(\"track\").build();\n if (event) {\n rudderElement.setEventName(event);\n }\n if (properties) {\n rudderElement.setProperty(properties);\n } else {\n rudderElement.setProperty({});\n }\n\n this.trackEvent(rudderElement, options, callback);\n }\n\n /**\n * Send identify call to Rudder BE and to initialized integrations\n *\n * @param {*} userId\n * @param {*} traits\n * @param {*} options\n * @param {*} callback\n * @memberof Analytics\n */\n processIdentify(userId, traits, options, callback) {\n if (userId && this.userId && userId !== this.userId) {\n this.reset();\n }\n this.userId = userId;\n this.storage.setUserId(this.userId);\n\n let rudderElement = new RudderElementBuilder().setType(\"identify\").build();\n if (traits) {\n for (let key in traits) {\n this.userTraits[key] = traits[key];\n }\n this.storage.setUserTraits(this.userTraits);\n }\n\n this.identifyUser(rudderElement, options, callback);\n }\n\n /**\n * Identify call supporting rudderelement from builder\n *\n * @param {*} rudderElement\n * @param {*} callback\n * @memberof Analytics\n */\n identifyUser(rudderElement, options, callback) {\n if (rudderElement[\"message\"][\"userId\"]) {\n this.userId = rudderElement[\"message\"][\"userId\"];\n this.storage.setUserId(this.userId);\n }\n\n if (\n rudderElement &&\n rudderElement[\"message\"] &&\n rudderElement[\"message\"][\"context\"] &&\n rudderElement[\"message\"][\"context\"][\"traits\"]\n ) {\n this.userTraits = Object.assign(\n {},\n rudderElement[\"message\"][\"context\"][\"traits\"]\n );\n this.storage.setUserTraits(this.userTraits);\n }\n\n this.processAndSendDataToDestinations(\n \"identify\",\n rudderElement,\n options,\n callback\n );\n }\n\n /**\n * Page call supporting rudderelement from builder\n *\n * @param {*} rudderElement\n * @param {*} callback\n * @memberof Analytics\n */\n trackPage(rudderElement, options, callback) {\n this.processAndSendDataToDestinations(\n \"page\",\n rudderElement,\n options,\n callback\n );\n }\n\n /**\n * Track call supporting rudderelement from builder\n *\n * @param {*} rudderElement\n * @param {*} callback\n * @memberof Analytics\n */\n trackEvent(rudderElement, options, callback) {\n this.processAndSendDataToDestinations(\n \"track\",\n rudderElement,\n options,\n callback\n );\n }\n\n /**\n * Process and send data to destinations along with rudder BE\n *\n * @param {*} type\n * @param {*} rudderElement\n * @param {*} callback\n * @memberof Analytics\n */\n processAndSendDataToDestinations(type, rudderElement, options, callback) {\n try {\n if (!this.anonymousId) {\n this.setAnonymousId();\n }\n\n // assign page properties to context\n rudderElement[\"message\"][\"context\"][\"page\"] = getDefaultPageProperties();\n\n rudderElement[\"message\"][\"context\"][\"traits\"] = Object.assign(\n {},\n this.userTraits\n );\n \n logger.debug(\"anonymousId: \", this.anonymousId);\n rudderElement[\"message\"][\"anonymousId\"] = this.anonymousId;\n rudderElement[\"message\"][\"userId\"] = rudderElement[\"message\"][\"userId\"]\n ? rudderElement[\"message\"][\"userId\"]\n : this.userId;\n\n if (type == \"group\") {\n if (this.groupId) {\n rudderElement[\"message\"][\"groupId\"] = this.groupId;\n }\n if (this.groupTraits) {\n rudderElement[\"message\"][\"traits\"] = Object.assign(\n {},\n this.groupTraits\n );\n }\n }\n\n if (options) {\n this.processOptionsParam(rudderElement, options);\n }\n logger.debug(JSON.stringify(rudderElement));\n\n // structure user supplied integrations object to rudder format\n if (Object.keys(rudderElement.message.integrations).length > 0) {\n tranformToRudderNames(rudderElement.message.integrations);\n }\n\n // if not specified at event level, All: true is default\n var clientSuppliedIntegrations = rudderElement.message.integrations;\n\n // get intersection between config plane native enabled destinations\n // (which were able to successfully load on the page) vs user supplied integrations\n var succesfulLoadedIntersectClientSuppliedIntegrations = findAllEnabledDestinations(\n clientSuppliedIntegrations,\n this.clientIntegrationObjects\n );\n\n //try to first send to all integrations, if list populated from BE\n succesfulLoadedIntersectClientSuppliedIntegrations.forEach(obj => {\n if (!obj[\"isFailed\"] || !obj[\"isFailed\"]()) {\n if(obj[type]) {\n obj[type](rudderElement);\n }\n }\n });\n\n // config plane native enabled destinations, still not completely loaded\n // in the page, add the events to a queue and process later\n if (!this.clientIntegrationObjects) {\n logger.debug(\"pushing in replay queue\");\n //new event processing after analytics initialized but integrations not fetched from BE\n this.toBeProcessedByIntegrationArray.push([type, rudderElement]);\n }\n\n // convert integrations object to server identified names, kind of hack now!\n transformToServerNames(rudderElement.message.integrations)\n \n // self analytics process, send to rudder\n enqueue.call(this, rudderElement, type);\n\n logger.debug(type + \" is called \");\n if (callback) {\n callback();\n }\n } catch (error) {\n handleError(error);\n }\n }\n\n /**\n * process options parameter\n *\n * @param {*} rudderElement\n * @param {*} options\n * @memberof Analytics\n */\n processOptionsParam(rudderElement, options) {\n var toplevelElements = [\"integrations\", \"anonymousId\", \"originalTimestamp\"];\n for (let key in options) {\n if (toplevelElements.includes(key)) {\n rudderElement.message[key] = options[key];\n //special handle for ananymousId as transformation expects anonymousId in traits.\n /* if (key === \"anonymousId\") {\n rudderElement.message.context.traits[\"anonymousId\"] = options[key];\n } */\n } else {\n if (key !== \"context\")\n rudderElement.message.context[key] = options[key];\n else {\n for (let k in options[key]) {\n rudderElement.message.context[k] = options[key][k];\n }\n }\n }\n }\n }\n\n getPageProperties(properties) {\n let defaultPageProperties = getDefaultPageProperties();\n for (let key in defaultPageProperties) {\n if (properties[key] === undefined) {\n properties[key] = defaultPageProperties[key];\n }\n }\n return properties;\n }\n\n /**\n * Clear user information\n *\n * @memberof Analytics\n */\n reset() {\n this.userId = \"\";\n this.userTraits = {};\n this.storage.clear();\n }\n\n getAnonymousId() {\n this.anonymousId = this.storage.getAnonymousId();\n if (!this.anonymousId) {\n this.setAnonymousId();\n }\n return this.anonymousId;\n }\n\n setAnonymousId(anonymousId) {\n this.anonymousId = anonymousId ? anonymousId : generateUUID();\n this.storage.setAnonymousId(this.anonymousId);\n }\n\n /**\n * Call control pane to get client configs\n *\n * @param {*} writeKey\n * @memberof Analytics\n */\n load(writeKey, serverUrl, options) {\n logger.debug(\"inside load \");\n let configUrl = CONFIG_URL;\n if (!writeKey || !serverUrl || serverUrl.length == 0) {\n handleError({\n message:\n \"[Analytics] load:: Unable to load due to wrong writeKey or serverUrl\"\n });\n throw Error(\"failed to initialize\");\n }\n if (options && options.logLevel) {\n logger.setLogLevel(options.logLevel);\n }\n if (options && options.integrations) {\n Object.assign(this.loadOnlyIntegrations, options.integrations);\n tranformToRudderNames(this.loadOnlyIntegrations);\n }\n if (options && options.configUrl) {\n configUrl = options.configUrl;\n }\n if(options && options.sendAdblockPage) {\n this.sendAdblockPage = true\n }\n if(options && options.sendAdblockPageOptions) {\n if(typeof options.sendAdblockPageOptions == \"object\") {\n this.sendAdblockPageOptions = options.sendAdblockPageOptions\n }\n }\n if(options && options.clientSuppliedCallbacks) {\n\n // convert to rudder recognised method names\n let tranformedCallbackMapping = {}\n Object.keys(this.methodToCallbackMapping).forEach(methodName =>{\n if(this.methodToCallbackMapping.hasOwnProperty(methodName)) {\n if(options.clientSuppliedCallbacks[this.methodToCallbackMapping[methodName]]) {\n tranformedCallbackMapping[methodName] = options.clientSuppliedCallbacks[this.methodToCallbackMapping[methodName]]\n }\n }\n })\n Object.assign(this.clientSuppliedCallbacks, tranformedCallbackMapping)\n this.registerCallbacks(true)\n }\n\n this.eventRepository.writeKey = writeKey;\n if (serverUrl) {\n this.eventRepository.url = serverUrl;\n }\n if (\n options &&\n options.valTrackingList &&\n options.valTrackingList.push == Array.prototype.push\n ) {\n this.trackValues = options.valTrackingList;\n }\n if (options && options.useAutoTracking) {\n this.autoTrackFeatureEnabled = true;\n if (this.autoTrackFeatureEnabled && !this.autoTrackHandlersRegistered) {\n addDomEventHandlers(this);\n this.autoTrackHandlersRegistered = true;\n logger.debug(\n \"autoTrackHandlersRegistered\",\n this.autoTrackHandlersRegistered\n );\n }\n }\n try {\n getJSONTrimmed(this, configUrl, writeKey, this.processResponse);\n } catch (error) {\n handleError(error);\n if (this.autoTrackFeatureEnabled && !this.autoTrackHandlersRegistered) {\n addDomEventHandlers(instance);\n }\n }\n }\n\n ready(callback) {\n if (typeof callback == \"function\") {\n this.readyCallback = callback;\n return;\n }\n logger.error(\"ready callback is not a function\");\n }\n\n initializeCallbacks() {\n Object.keys(this.methodToCallbackMapping).forEach(methodName => {\n if (this.methodToCallbackMapping.hasOwnProperty(methodName)) {\n this.on(methodName, () => {});\n }\n })\n }\n\n registerCallbacks(calledFromLoad) {\n\n if(!calledFromLoad) {\n Object.keys(this.methodToCallbackMapping).forEach(methodName => {\n if (this.methodToCallbackMapping.hasOwnProperty(methodName)) {\n if(!!window.rudderanalytics) {\n if (typeof window.rudderanalytics[\n this.methodToCallbackMapping[methodName]\n ] == \"function\") {\n this.clientSuppliedCallbacks[methodName] = window.rudderanalytics[this.methodToCallbackMapping[methodName]]\n }\n }\n // let callback = \n // ? typeof window.rudderanalytics[\n // this.methodToCallbackMapping[methodName]\n // ] == \"function\"\n // ? window.rudderanalytics[this.methodToCallbackMapping[methodName]]\n // : () => {}\n // : () => {};\n \n //logger.debug(\"registerCallbacks\", methodName, callback);\n \n //this.on(methodName, callback);\n }\n });\n }\n \n Object.keys(this.clientSuppliedCallbacks).forEach(methodName => {\n if(this.clientSuppliedCallbacks.hasOwnProperty(methodName)) {\n logger.debug(\"registerCallbacks\", methodName, this.clientSuppliedCallbacks[methodName]);\n this.on(methodName, this.clientSuppliedCallbacks[methodName]);\n }\n })\n }\n\n sendSampleRequest() {\n ScriptLoader(\"ad-block\", \"//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js\")\n }\n \n}\n\nlet instance = new Analytics();\n\nEmitter(instance);\n\nif (process.browser) {\n window.addEventListener(\n \"error\",\n (e) => {\n handleError(e, instance);\n },\n true\n );\n}\n\nif (process.browser) {\n // test for adblocker\n // instance.sendSampleRequest()\n \n // initialize supported callbacks\n instance.initializeCallbacks()\n\n // register supported callbacks\n instance.registerCallbacks(false);\n let eventsPushedAlready =\n !!window.rudderanalytics &&\n window.rudderanalytics.push == Array.prototype.push;\n\n let methodArg = window.rudderanalytics ? window.rudderanalytics[0] : [];\n if (methodArg.length > 0 && methodArg[0] == \"load\") {\n let method = methodArg[0];\n methodArg.shift();\n logger.debug(\"=====from init, calling method:: \", method);\n instance[method](...methodArg);\n }\n\n if (eventsPushedAlready) {\n for (let i = 1; i < window.rudderanalytics.length; i++) {\n instance.toBeProcessedArray.push(window.rudderanalytics[i]);\n }\n\n for (let i = 0; i < instance.toBeProcessedArray.length; i++) {\n let event = [...instance.toBeProcessedArray[i]];\n let method = event[0];\n event.shift();\n logger.debug(\"=====from init, calling method:: \", method);\n instance[method](...event);\n }\n instance.toBeProcessedArray = [];\n }\n}\n\nlet ready = instance.ready.bind(instance);\nlet identify = instance.identify.bind(instance);\nlet page = instance.page.bind(instance);\nlet track = instance.track.bind(instance);\nlet alias = instance.alias.bind(instance);\nlet group = instance.group.bind(instance);\nlet reset = instance.reset.bind(instance);\nlet load = instance.load.bind(instance);\nlet initialized = (instance.initialized = true);\nlet getAnonymousId = instance.getAnonymousId.bind(instance);\nlet setAnonymousId = instance.setAnonymousId.bind(instance);\n\nexport {\n initialized,\n ready,\n page,\n track,\n load,\n identify,\n reset,\n alias,\n group,\n getAnonymousId,\n setAnonymousId\n};\n"],"names":["LOG_LEVEL","logger","logLevel","toUpperCase","console","debug","arguments","error","commonNames","clientToServerNames","replacer","key","value","generateUUID","d","Date","getTime","performance","now","replace","c","r","Math","random","floor","toString","getCurrentTimeFormatted","toISOString","handleError","analyticsInstance","errorMessage","message","undefined","sampleAdBlockTest","Event","target","localName","src","id","includes","page","path","title","sendAdblockPageOptions","e","getDefaultPageProperties","canonicalUrl","getCanonicalUrl","pathname","window","location","referrer","document","search","url","indexOf","href","hashIndex","slice","getUrl","tag","tags","getElementsByTagName","i","getAttribute","getRevenue","properties","eventName","revenue","match","total","val","parseFloat","isNaN","getCurrency","tranformToRudderNames","integrationObject","Object","keys","forEach","hasOwnProperty","findAllEnabledDestinations","sdkSuppliedIntegrations","configPlaneEnabledIntegrations","enabledList","length","allValue","intg","intgValue","push","_typeof","name","MessageType","TRACK","PAGE","IDENTIFY","ECommerceEvents","PRODUCTS_SEARCHED","PRODUCT_LIST_VIEWED","PRODUCT_LIST_FILTERED","PROMOTION_VIEWED","PROMOTION_CLICKED","PRODUCT_CLICKED","PRODUCT_VIEWED","PRODUCT_ADDED","PRODUCT_REMOVED","CART_VIEWED","CHECKOUT_STARTED","CHECKOUT_STEP_VIEWED","CHECKOUT_STEP_COMPLETED","PAYMENT_INFO_ENTERED","ORDER_UPDATED","ORDER_COMPLETED","ORDER_REFUNDED","ORDER_CANCELLED","COUPON_ENTERED","COUPON_APPLIED","COUPON_DENIED","COUPON_REMOVED","PRODUCT_ADDED_TO_WISHLIST","PRODUCT_REMOVED_FROM_WISHLIST","WISH_LIST_PRODUCT_ADDED_TO_CART","PRODUCT_SHARED","CART_SHARED","PRODUCT_REVIEWED","ScriptLoader","js","createElement","async","type","parentNode","insertBefore","config","hubId","hubID","this","rudderElement","traits","context","traitsValue","k","getOwnPropertyDescriptor","hubspotkey","call","userProperties","user_properties","_hsq","eventValue","event","Array","prototype","clone","obj","t","nodeType","_isBuffer","constructor","isBuffer","valueOf","apply","copy","l","flags","multiline","global","ignoreCase","RegExp","source","s","m","h","options","str","exec","n","toLowerCase","parse","long","ms","plural","round","short","ceil","exports","module","namespace","disabled","enabled","self","curr","prevTime","diff","prev","useColors","color","selectColor","args","coerce","concat","index","format","formatter","formatters","splice","formatArgs","logFn","log","bind","fn","Error","stack","enable","namespaces","save","split","len","skips","substr","names","test","require$$0","prevColor","colors","load","storage","Function","humanize","lastC","removeItem","documentElement","style","firebug","exception","table","navigator","userAgent","parseInt","$1","chrome","local","localStorage","localstorage","j","v","JSON","stringify","set","get","all","encode","maxage","expires","domain","toUTCString","samesite","secure","cookie","err","pair","pairs","decode","encodeURIComponent","decodeURIComponent","max","count","collection","toDrop","Number","resultsLength","results","has","objToString","isObject","Boolean","isPlainObject","shallowCombiner","deepCombiner","defaultsDeep","defaultsWith","combiner","sources","drop","rest","objectTypes","function","object","freeExports","root","freeGlobal","runInContext","String","SyntaxError","TypeError","nativeJSON","objectProto","getClass","isProperty","attempt","func","errorFunc","isExtended","isSupported","serialized","stringifySupported","toJSON","a","parseSupported","getUTCFullYear","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","getUTCMilliseconds","charIndexBuggy","forOwn","callback","Properties","dontEnums","property","size","isConstructor","isFunction","hasProperty","Escapes","92","34","8","12","10","13","9","toPaddedString","width","serializeDate","getData","year","month","date","time","hours","minutes","seconds","milliseconds","Months","getDay","dateToJSON","nativeStringify","filter","nativeToJSON","result","escapeChar","character","charCode","charCodeAt","escaped","reEscape","quote","lastIndex","serialize","whitespace","indentation","className","element","prefix","join","pop","Index","Source","fromCharCode","Unescapes","47","98","116","110","102","114","abort","lex","begin","position","isSigned","charAt","temp","hasMembers","update","walk","previousJSON","JSON3","isRestored","noConflict","port","protocol","host","hash","hostname","query","isAbsolute","levels","opts","parts","last","Cookie","_options","topDomain","defaults","remove","json","store","win","doc","version","defaultVal","clear","transact","transactionFn","getAll","ret","deserialize","isLocalStorageNameSupported","setItem","getItem","addBehavior","storageOwner","storageContainer","ActiveXObject","open","write","close","w","frames","body","withIEStorage","storeFunction","unshift","appendChild","removeChild","forbiddenCharsRegex","ieKeyFix","setAttribute","removeAttribute","attributes","XMLDocument","attr","testKey","Store","trackingID","allowLinker","o","g","q","ga","userId","Storage","getUserId","anonymousId","eventCategory","eventAction","eventLabel","category","label","hitType","gaplugins","siteId","siteID","_ready","hotjarSiteId","hj","_hjSettings","hjid","hjsv","conversionId","conversionID","pageLoadConversions","clickEventConversions","defaultPageConversion","dataLayer","gtag","conversionData","getConversionData","conversionLabel","sendToValue","send_to","eventTypeConversions","eventTypeConversion","VWO","analytics","accountId","settingsTolerance","isSPA","libraryTolerance","useExistingJquery","sendExperimentTrack","sendExperimentIdentify","account_id","settings_tolerance","library_tolerance","use_existing_jquery","_vwo_code","f","finish","getElementById","finished","b","innerText","onerror","init","settings_timer","setTimeout","styleSheet","cssText","createTextNode","URL","_vwo_settings_timer","experimentViewedIdentify","experimentViewed","data","expId","variationId","_vwo_exp","comb_n","_this","track","experimentId","variationName","identify","GoogleTagManager","containerID","rudderMessage","props","sendToGTMDatalayer","pageName","pageCategory","Braze","appKey","endPoint","dataCenter","dataCenterArr","trim","gender","appboy","ab","User","Genders","FEMALE","MALE","OTHER","p","P","y","appboyQueue","getUser","getCachedFeed","Feed","getCachedContentCards","ContentCards","initialize","enableLogging","baseUrl","display","automaticallyShowNewInAppMessages","changeUser","openSession","address","avatar","birthday","email","firstname","lastname","phone","setAvatarImageUrl","setEmail","setFirstName","setGender","formatGender","setLastName","setPhoneNumber","setCountry","country","setHomeCity","city","setDateOfBirth","setCustomUserAttribute","products","currencyCode","currency","del","product","productId","product_id","price","quantity","logPurchase","handlePurchase","handleReservedProperties","logCustomEvent","base64map","crypt","rotl","rotr","endian","randomBytes","bytes","bytesToWords","words","wordsToBytes","bytesToHex","hex","hexToBytes","bytesToBase64","base64","triplet","base64ToBytes","imod4","pow","charenc","utf8","stringToBytes","bin","unescape","bytesToString","escape","readFloatLE","isSlowBuffer","symbolValueOf","bigIntValueOf","require$$1","require$$2","md5","encoding","isArray","FF","_ff","GG","_gg","HH","_hh","II","_ii","aa","bb","cc","dd","x","_blocksize","_digestsize","digestbytes","asBytes","asString","INTERCOM","NAME","API_KEY","apiKey","APP_ID","appId","MOBILE_APP_ID","mobileAppId","intercomSettings","app_id","ic","Intercom","readyState","intercom_code","attachEvent","addEventListener","rawPayload","userHash","user_hash","hideDefaultLauncher","hide_default_launcher","field","companies","company","companyFields","user_id","event_name","created_at","originalTimestamp","Keen","projectID","writeKey","ipAddon","uaAddon","urlAddon","referrerAddon","client","check","setInterval","KeenTracking","projectId","initKeen","clearInterval","assign","user","getAddOn","extendEvents","recordEvent","addOns","ip_address","input","ip","output","user_agent","ua_string","page_url","referrer_url","keen","addons","objProto","owns","toStr","Symbol","BigInt","isActualNaN","NON_HOST_TYPES","boolean","number","string","base64Regex","hexRegex","is","defined","empty","equal","other","hosted","instance","nil","undef","isStandardArguments","isOldArguments","array","arraylike","callee","bool","isFinite","valid","HTMLElement","alert","infinite","Infinity","decimal","divisibleBy","isDividendInfinite","isDivisorInfinite","isNonZeroNumber","integer","maximum","others","minimum","nan","even","odd","ge","gt","le","lt","within","start","primitive","regexp","symbol","bigint","expr","dest","multiple","normalize","normalizer","defaultNormalize","loop","normalizedKey","child","globals","arr","unique","_","prefixed","map","toFunction","defaultToFunction","objectToFunction","prop","stripNested","re","$0","ctx","Kissmetrics","prefixProperties","_kmq","_kmk","_kms","u","isEnvMobile","toUnixTimestamp","nestedObj","flattenedObj","flatten","safe","extend","delimiter","maxDepth","currentDepth","step","isarray","isobject","newKey","each","clean","timestamp","iterator","item","_t","_d","KM","previousId","groupId","groupTraits","CustomerIO","_cio","callbacks","interval","Chartbeat","_sf_async_config","useCanonical","uid","isVideo","video","sendNameAndCategoryAsTitle","subscriberEngagementKeys","replayEvents","failed","isFirstPageCallMade","loadConfig","isLoaded","pSUPERFLY","virtualPage","initAfterPage","author","sections","authors","_cbq","script","_isReady","then","Promise","resolve","_this2","emit","pause","Comscore","c2ID","comScoreBeaconParam","comScoreParams","COMSCORE","beacon","mapComscoreParams","_comscore","el","comScoreBeaconParamsMap","c1","c2","hop","strCharAt","indexKeys","pred","isArrayLike","objectKeys","isNumber","arrayEach","baseEach","ks","FBPixel","blacklistPiiProperties","categoryToContent","pixelId","eventsToEvents","eventCustomProperties","valueFieldIdentifier","advancedMapping","traitKeyToExternalId","legacyConversionPixelId","userIdAsPixelId","whitelistPiiProperties","_fbq","fbq","callMethod","queue","loaded","disablePushState","allowDuplicatePageViews","formatRevenue","payload","buildPayLoad","standardTo","legacyTo","standard","legacy","reduce","filtered","from","to","eventID","messageId","contents","customProperties","contentIds","contentType","merge","content_ids","content_type","getContentType","useValue","sku","content_name","product_name","content_category","item_price","pId","content","num_items","search_string","contentCategory","defaultValue","mappedTo","mapped","obj1","obj2","res","propObj1","propObj2","toFixed","isStandardEvent","dateFields","defaultPiiProperties","customPiiProperties","configuration","blacklistPiiHash","toISOTring","sha256","isPropertyPii","isProperyWhiteListed","lotameStorage","integrations","HS","HubSpot","GA","HOTJAR","Hotjar","GOOGLEADS","GoogleAds","GTM","BRAZE","KEEN","KISSMETRICS","CUSTOMERIO","CHARTBEAT","FACEBOOK_PIXEL","LOTAME","LotameStorage","bcpUrlSettingsPixel","bcpUrlSettingsIframe","dspUrlSettingsPixel","dspUrlSettingsIframe","mappings","mapping","LOTAME_SYNCH_CALLBACK","height","image","iframe","currentTime","urlSettings","dspUrl","compileUrl","dspUrlTemplate","addPixel","addIFrame","setLotameSynchTime","methodToCallbackMapping","destination","regex","syncPixel","bcpUrl","_this3","bcpUrlTemplate","isPixelToBeSynched","lastSynchedTime","getLotameSynchTime","RudderApp","build","RudderLibraryInfo","RudderOSInfo","RudderScreenInfo","density","RudderContext","app","library","os","screen","devicePixelRatio","locale","language","browserLanguage","device","network","RudderMessage","channel","action","messageType","values","checkForKey","SCREEN","propertyName","RudderElement","rudderProperty","rudderUserProperty","RudderElementBuilder","inputRudderProperty","rudderPropertyBuilder","inputRudderUserProperty","rudderUserPropertyBuilder","eventType","setUserId","setType","setEventName","setProperty","setUserProperty","RudderPayload","batch","getRandomValues","crypto","msCrypto","rnds8","Uint8Array","rnds","byteToHex","_nodeId","_clockseq","buf","offset","bth","_lastMSecs","_lastNSecs","node","clockseq","seedBytes","rng","msecs","nsecs","dt","tl","tmh","bytesToUuid","ii","uuid","v4","v1","inMemoryStore","_data","isSupportedNatively","defaultEngine","inMemoryEngine","optionalEngine","engine","compoundKey","_createValidKey","quotaExceeded","code","isQuotaExceeded","_swapEngine","defaultClock","clearTimeout","clock","Schedule","tasks","nextId","run","task","timeout","_handle","cancel","cancelAll","setClock","newClock","resetClock","fmt","disable","Emitter","mixin","on","_callbacks","once","off","removeListener","removeAllListeners","removeEventListener","cb","listeners","hasListeners","Queue","maxItems","maxAttempts","backoff","MIN_RETRY_DELAY","minRetryDelay","MAX_RETRY_DELAY","maxRetryDelay","FACTOR","backoffFactor","JITTER","backoffJitter","timeouts","ACK_TIMER","RECLAIM_TIMER","RECLAIM_TIMEOUT","RECLAIM_WAIT","IN_PROGRESS","QUEUE","ACK","RECLAIM_START","RECLAIM_END","_schedule","_processId","_store","_ack","_checkReclaim","_processHead","_running","stop","shouldRetry","attemptNumber","getDelay","rand","deviation","min","toPrecision","addItem","_enqueue","requeue","entry","sort","inProgress","toRun","enqueue","done","inProgressSize","shift","_reclaim","tryReclaim","findOtherQueues","our","their","queueOptions","eventRepository","eventsBuffer","state","batchSize","payloadQueue","sentAt","processQueueElement","headers","repo","eventsPayload","xhr","XMLHttpRequest","setRequestHeader","btoa","onreadystatechange","status","send","queueFn","ontimeout","statusText","getElementContent","Authorization","AnonymousId","addDomEventHandlers","rudderanalytics","handler","srcElement","isTextNode","shouldTrackDomEvent","formValues","tagName","elements","formElement","isElToBeTracked","isElValueToBeTracked","trackValues","getElementsByName","checked","targetElementList","curEl","isTag","elementsJson","explicitNoTrack","shouldTrackEl","shouldTrackElement","elem","classes","getClassName","tag_name","attrLength","nthChild","nthOfType","currentElem","previousElementSibling","getPropertiesFromElement","elementText","text","childNodes","Node","TEXT_NODE","nodeValue","getText","event_type","el_attr_href","el_text","trackWindowEvent","register_event","useCapture","isElementNode","baseVal","includeList","elAttributesLength","previousSibling","err_cb","bail","noop","proxy","EventRepository","autoTrackHandlersRegistered","autoTrackFeatureEnabled","initialized","clientIntegrations","loadOnlyIntegrations","clientIntegrationObjects","successfullyLoadedIntegration","failedToBeLoadedIntegration","toBeProcessedArray","toBeProcessedByIntegrationArray","userTraits","getUserTraits","getGroupId","getGroupTraits","getAnonymousId","sendAdblockPage","clientSuppliedCallbacks","readyCallback","executeReadyCallback","response","useAutoTracking","destinations","destinationDefinition","useNativeSDK","intgArray","intgInstance","intgClass","isInitialized","after","methodName","succesfulLoadedIntersectClientSuppliedIntegrations","sendSampleRequest","processPage","processTrack","processIdentify","processAndSendDataToDestinations","setGroupId","setGroupTraits","getPageProperties","trackPage","trackEvent","reset","setUserTraits","identifyUser","setAnonymousId","processOptionsParam","toplevelElements","defaultPageProperties","serverUrl","configUrl","tranformedCallbackMapping","registerCallbacks","valTrackingList","cb_","onload","responseText","getJSONTrimmed","processResponse","_this4","calledFromLoad","_this5","initializeCallbacks","eventsPushedAlready","methodArg","method","ready","alias","group"],"mappings":"g/DAAA,IAIIA,EADkB,EAGlBC,EAEc,SAASC,UACZA,EAASC,mBACP,mBACDH,EAXK,OAaJ,oBACDA,EAbM,OAeL,mBACDA,EAfK,KAIjBC,EAsBQ,iBACDD,GA5BW,MA6BVI,SAAQC,cAASC,YAxBzBL,EAkCQ,iBACDD,GAtCW,MAuCVI,SAAQG,cAASD,YCxCzBE,EAAc,KACV,yBACa,qBACD,QACb,kBACQ,sBACD,sBACA,kBACJ,cACA,kBACI,sBACA,qBACD,oBACA,sBACE,2BACC,wBACH,kCACM,0BACN,sCACU,uBACf,aACG,gBACA,gBACA,iBACC,aACA,cACC,oBACA,gB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D,GAAU,GACvBA,GAAUpJ,QACVxnC,EAAa,oCAAqC6wC,IAClDxjB,GAASwjB,UAATxjB,KAAoBujB,QAGlBD,GAAqB,KAClB,IAAI7sC,GAAI,EAAGA,GAAId,OAAOumC,gBAAgBnkC,OAAQtB,KACjDupB,GAASggB,mBAAmB7nC,KAAKxC,OAAOumC,gBAAgBzlC,SAGrD,IAAIA,GAAI,EAAGA,GAAIupB,GAASggB,mBAAmBjoC,OAAQtB,KAAK,KACvDqF,KAAYkkB,GAASggB,mBAAmBvpC,KACxC+sC,GAAS1nC,GAAM,GACnBA,GAAMq+B,QACNxnC,EAAa,oCAAqC6wC,IAClDxjB,GAASwjB,UAATxjB,KAAoBlkB,KAEtBkkB,GAASggB,mBAAqB,OAI9ByD,GAAQzjB,GAASyjB,MAAMhkC,KAAKugB,IAC5BzM,GAAWyM,GAASzM,SAAS9T,KAAKugB,IAClC9qB,GAAO8qB,GAAS9qB,KAAKuK,KAAKugB,IAC1B5M,GAAQ4M,GAAS5M,MAAM3T,KAAKugB,IAC5B0jB,GAAQ1jB,GAAS0jB,MAAMjkC,KAAKugB,IAC5B2jB,GAAQ3jB,GAAS2jB,MAAMlkC,KAAKugB,IAC5BiiB,GAAQjiB,GAASiiB,MAAMxiC,KAAKugB,IAC5Bvf,GAAOuf,GAASvf,KAAKhB,KAAKugB,IAC1B0f,GAAe1f,GAAS0f,aAAc,EACtCY,GAAiBtgB,GAASsgB,eAAe7gC,KAAKugB,IAC9CoiB,GAAiBpiB,GAASoiB,eAAe3iC,KAAKugB"}
\ No newline at end of file
diff --git a/integrations/MoEngage/browser.js b/integrations/MoEngage/browser.js
new file mode 100644
index 0000000000..22c86aafa9
--- /dev/null
+++ b/integrations/MoEngage/browser.js
@@ -0,0 +1,185 @@
+import each from "@ndhoule/each";
+import logger from "../../utils/logUtil";
+
+// custom traits mapping context.traits --> moengage properties
+const traitsMap = {
+ firstName: "first_name",
+ lastName: "last_name",
+ firstname: "first_name",
+ lastname: "last_name",
+ email: "email",
+ phone: "mobile",
+ name: "user_name",
+ username: "user_name",
+ userName: "user_name",
+ gender: "gender",
+ birthday: "birthday",
+ id: null,
+};
+class MoEngage {
+ constructor(config, analyticsinstance) {
+ this.apiId = config.apiId;
+ this.debug = config.debug;
+ this.region = config.region;
+ this.name = "MoEngage";
+ this.analyticsinstance = analyticsinstance;
+ }
+
+ init() {
+ const self = this;
+ logger.debug("===in init MoEnagage===");
+ // loading the script for moengage web sdk
+ /* eslint-disable */
+ (function (i, s, o, g, r, a, m, n) {
+ i.moengage_object = r;
+ var t = {};
+ var q = function (f) {
+ return function () {
+ (i.moengage_q = i.moengage_q || []).push({ f, a: arguments });
+ };
+ };
+ var f = [
+ "track_event",
+ "add_user_attribute",
+ "add_first_name",
+ "add_last_name",
+ "add_email",
+ "add_mobile",
+ "add_user_name",
+ "add_gender",
+ "add_birthday",
+ "destroy_session",
+ "add_unique_user_id",
+ "moe_events",
+ "call_web_push",
+ "track",
+ "location_type_attribute",
+ ];
+ var h = { onsite: ["getData", "registerCallback"] };
+ for (var k in f) {
+ t[f[k]] = q(f[k]);
+ }
+ for (var k in h)
+ for (var l in h[k]) {
+ null == t[k] && (t[k] = {}), (t[k][h[k][l]] = q(k + "." + h[k][l]));
+ }
+ a = s.createElement(o);
+ m = s.getElementsByTagName(o)[0];
+ a.async = 1;
+ a.src = g;
+ m.parentNode.insertBefore(a, m);
+ i.moe =
+ i.moe ||
+ function () {
+ n = arguments[0];
+ return t;
+ };
+ a.onload = function () {
+ if (n) {
+ i[r] = moe(n);
+ }
+ };
+ })(
+ window,
+ document,
+ "script",
+ document.location.protocol === "https:"
+ ? "https://cdn.moengage.com/webpush/moe_webSdk.min.latest.js"
+ : "http://cdn.moengage.com/webpush/moe_webSdk.min.latest.js",
+ "Moengage"
+ );
+ /* eslint-enable */
+
+ // setting the region if us then not needed.
+ if (this.region !== "US") {
+ self.moeClient = window.moe({
+ app_id: this.apiId,
+ debug_logs: this.debug ? 1 : 0,
+ cluster: this.region === "EU" ? "eu" : "in",
+ });
+ } else {
+ self.moeClient = window.moe({
+ app_id: this.apiId,
+ debug_logs: this.debug ? 1 : 0,
+ });
+ }
+ this.initialUserId = this.analyticsinstance.userId;
+ }
+
+ isLoaded = () => {
+ logger.debug("in MoEngage isLoaded");
+ return !!window.moeBannerText;
+ };
+
+ isReady = () => {
+ logger.debug("in MoEngage isReady");
+ return !!window.moeBannerText;
+ };
+
+ track(rudderElement) {
+ logger.debug("inside track");
+ // Check if the user id is same as previous session if not a new session will start
+ if (!rudderElement.message) {
+ logger.error("Payload not correct");
+ return;
+ }
+ const { event, properties, userId } = rudderElement.message;
+ if (userId) {
+ if (this.initialUserId !== userId) {
+ this.reset();
+ }
+ }
+ // track event : https://docs.moengage.com/docs/tracking-events
+ if (!event) {
+ logger.error("Event name not present");
+ return;
+ }
+ if (properties) {
+ this.moeClient.track_event(event, properties);
+ } else {
+ this.moeClient.track_event(event);
+ }
+ }
+
+ reset() {
+ logger.debug("inside reset");
+ // reset the user id
+ this.initialUserId = this.analyticsinstance.userId;
+ this.moeClient.destroy_session();
+ }
+
+ identify(rudderElement) {
+ const self = this;
+ const { userId } = rudderElement.message;
+ let traits = null;
+ if (rudderElement.message.context) {
+ traits = rudderElement.message.context.traits;
+ }
+ // check if user id is same or not
+ if (this.initialUserId !== userId) {
+ this.reset();
+ }
+ // if user is present map
+ if (userId) {
+ this.moeClient.add_unique_user_id(userId);
+ }
+
+ // track user attributes : https://docs.moengage.com/docs/tracking-web-user-attributes
+ if (traits) {
+ each(function add(value, key) {
+ // check if name is present
+ if (key === "name") {
+ self.moeClient.add_user_name(value);
+ }
+ if (Object.prototype.hasOwnProperty.call(traitsMap, key)) {
+ const method = `add_${traitsMap[key]}`;
+ self.moeClient[method](value);
+ } else {
+ self.moeClient.add_user_attribute(key, value);
+ }
+ }, traits);
+ }
+ }
+}
+
+export default MoEngage;
diff --git a/integrations/MoEngage/index.js b/integrations/MoEngage/index.js
new file mode 100644
index 0000000000..cd75346993
--- /dev/null
+++ b/integrations/MoEngage/index.js
@@ -0,0 +1,3 @@
+import MoEngage from "./browser";
+
+export default MoEngage;
diff --git a/integrations/MoEngage/test/script-test-moengage.html b/integrations/MoEngage/test/script-test-moengage.html
new file mode 100644
index 0000000000..1f19d2039f
--- /dev/null
+++ b/integrations/MoEngage/test/script-test-moengage.html
@@ -0,0 +1,225 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ Relax while I finish my testing process....
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/integrations/client_server_name.js b/integrations/client_server_name.js
index 2babefcd23..1d97447ed8 100644
--- a/integrations/client_server_name.js
+++ b/integrations/client_server_name.js
@@ -19,7 +19,8 @@ const clientToServerNames = {
VWO: "VWO",
OPTIMIZELY: "Optimizely",
FULLSTORY: "Fullstory",
- TVSQUUARED: "TVSquared"
+ TVSQUUARED: "TVSquared",
+ MOENGAGE: "MoEngage",
};
export { clientToServerNames };
diff --git a/integrations/index.js b/integrations/index.js
index 83d43e5c69..e8fdce2654 100644
--- a/integrations/index.js
+++ b/integrations/index.js
@@ -17,6 +17,7 @@ import * as Optimizely from "./Optimizely";
import * as Bugsnag from "./Bugsnag";
import * as Fullstory from "./Fullstory";
import * as TVSquared from "./TVSquared";
+import * as MoEngage from "./MoEngage";
// the key names should match the destination.name value to keep partity everywhere
// (config-plan name, native destination.name , exported integration name(this one below))
@@ -41,6 +42,7 @@ const integrations = {
BUGSNAG: Bugsnag.default,
FULLSTORY: Fullstory.default,
TVSQUARED: TVSquared.default,
+ MOENGAGE: MoEngage.default,
};
export { integrations };
diff --git a/integrations/integration_cname.js b/integrations/integration_cname.js
index 70067a3677..62b935a5c6 100644
--- a/integrations/integration_cname.js
+++ b/integrations/integration_cname.js
@@ -43,6 +43,7 @@ const commonNames = {
Fullstory: "FULLSTORY",
BUGSNAG: "BUGSNAG",
TVSQUARED: "TVSQUARED",
+ MOENGAGE: "MoEngage",
};
export { commonNames };
diff --git a/tests/html/script-test.html b/tests/html/script-test.html
index 12dd76386f..6e5b992e43 100644
--- a/tests/html/script-test.html
+++ b/tests/html/script-test.html
@@ -33,8 +33,9 @@
})(method);
}
- rudderanalytics.load("1cA1w20Fe34TdZrtGshutNY8Fm1", "http://localhost:8080", {
- logLevel: "DEBUG"
+ rudderanalytics.load("1jp812ztQzHUEKHRZDHuRBuG2OP", "http://localhost:8080", {
+ logLevel: "DEBUG",
+ configUrl: "https://api.dev.rudderlabs.com"
});
// rudderanalytics.track();
@@ -48,71 +49,83 @@
console.log("we are all set!!!");
});
+ window.rudderanalytics.track('Product Added', {
+ currency: 'CAD',
+ quantity: 1,
+ price: 24.75,
+ name: 'my product',
+ category: 'cat 1',
+ sku: 'p-298',
+ testDimension: true,
+ testMetric: true,
+ position: 4
+ });
+
//page calls
// window.rudderanalytics.page();
- window.rudderanalytics.page('ruchira category', 'ruchira name', { url: 'url', path: '/path' });
-
-rudderanalytics.track('Order Completed', {
- checkout_id: 'what is checkout id here??',
- order_id: "transactionId",
- value: 31.98,
- revenue: 31.98,
- shipping: 4.00,
- coupon: 'APPARELSALE',
- currency: 'GBP',
- products: [
- {
- product_id: 'product-bacon-jam',
- sku: 'sku-1',
- category: 'Merch',
- name: 'Food/Drink',
- brand: '',
- variant: 'Extra topped',
- price: 3.00,
- quantity: 2,
- currency: 'GBP',
- position: 1,
- value: 6.00,
- typeOfProduct: 'Food',
- url: 'https://www.example.com/product/bacon-jam',
- image_url: 'https://www.example.com/product/bacon-jam.jpg'
- },
- {
- product_id: 'product-t-shirt',
- sku: 'sku-2',
- category: 'Merch',
- name: 'T-Shirt',
- brand: 'Levis',
- variant: 'White',
- price: 12.99,
- quantity: 1,
- currency: 'GBP',
- position: 2,
- value: 12.99,
- typeOfProduct: 'Shirt',
- url: 'https://www.example.com/product/t-shirt',
- image_url: 'https://www.example.com/product/t-shirt.jpg'
- },
- {
- product_id: 'offer-t-shirt',
- sku: 'sku-3',
- category: 'Merch',
- name: 'T-Shirt-on-offer',
- brand: 'Levis',
- variant: 'Black',
- price: 12.99,
- quantity: 1,
- currency: 'GBP',
- position: 1,
- value: 12.99,
- coupon: 'APPARELSALE',
- typeOfProduct: 'Shirt',
- url: 'https://www.example.com/product/offer-t-shirt',
- image_url: 'https://www.example.com/product/offer-t-shirt.jpg'
- }
- ]
- });
+ // window.rudderanalytics.page('ruchira category', 'ruchira name', { url: 'url', path: '/path' });
+
+// rudderanalytics.track('Order Completed', {
+// checkout_id: 'what is checkout id here??',
+// order_id: "transactionId",
+// value: 31.98,
+// revenue: 31.98,
+// shipping: 4.00,
+// coupon: 'APPARELSALE',
+// currency: 'GBP',
+// products: [
+// {
+// product_id: 'product-bacon-jam',
+// sku: 'sku-1',
+// category: 'Merch',
+// name: 'Food/Drink',
+// brand: '',
+// variant: 'Extra topped',
+// price: 3.00,
+// quantity: 2,
+// currency: 'GBP',
+// position: 1,
+// value: 6.00,
+// typeOfProduct: 'Food',
+// url: 'https://www.example.com/product/bacon-jam',
+// image_url: 'https://www.example.com/product/bacon-jam.jpg'
+// },
+// {
+// product_id: 'product-t-shirt',
+// sku: 'sku-2',
+// category: 'Merch',
+// name: 'T-Shirt',
+// brand: 'Levis',
+// variant: 'White',
+// price: 12.99,
+// quantity: 1,
+// currency: 'GBP',
+// position: 2,
+// value: 12.99,
+// typeOfProduct: 'Shirt',
+// url: 'https://www.example.com/product/t-shirt',
+// image_url: 'https://www.example.com/product/t-shirt.jpg'
+// },
+// {
+// product_id: 'offer-t-shirt',
+// sku: 'sku-3',
+// category: 'Merch',
+// name: 'T-Shirt-on-offer',
+// brand: 'Levis',
+// variant: 'Black',
+// price: 12.99,
+// quantity: 1,
+// currency: 'GBP',
+// position: 1,
+// value: 12.99,
+// coupon: 'APPARELSALE',
+// typeOfProduct: 'Shirt',
+// url: 'https://www.example.com/product/offer-t-shirt',
+// image_url: 'https://www.example.com/product/offer-t-shirt.jpg'
+// }
+// ]
+// });
// window.rudderanalytics.page('category', 'name', {
// url: 'ruchira url',
@@ -176,22 +189,22 @@
// //identify calls
// window.rudderanalytics.page();
- window.rudderanalytics.identify("ruchu123", {
- name: "Ruchira Moitra",
- email: "ruchira@gmail.com",
- plan: "Enterprise",
- company: {
- id: "abc123"
- },
- createdAt: "Thu Mar 24 2016 17:46:45 GMT+0000 (UTC)"
- });
- window.rudderanalytics.identify('Steven');
+ // window.rudderanalytics.identify("ruchu123", {
+ // name: "Ruchira Moitra",
+ // email: "ruchira@gmail.com",
+ // plan: "Enterprise",
+ // company: {
+ // id: "abc123"
+ // },
+ // createdAt: "Thu Mar 24 2016 17:46:45 GMT+0000 (UTC)"
+ // });
+ // window.rudderanalytics.identify('Steven');
// track calls
- // window.rudderanalytics.track('event1');
+ // window.rudderanalytics.track('event1');
- // window.rudderanalytics.track('event2', { category: 'blah' });
+ // window.rudderanalytics.track('event2', { category: 'blah' });
// window.rudderanalytics.track(
// 'event3',
@@ -234,392 +247,392 @@
- window.rudderanalytics.track("Order Completed", {
- order_id: 'ruchiraorder1',
- total: 99.99,
- shipping: 13.99,
- tax: 20.99,
- currency: 'INR',
- products: [
- {
- quantity: 1,
- price: 24.75,
- name: 'my product',
- sku: 'p-298'
- },
- {
- quantity: 3,
- price: 24.75,
- name: 'other product',
- sku: 'p-299'
- }
- ]
- });
-
- window.rudderanalytics.track('Order Completed', {
- order_id: '5d4c7cb5',
- revenue: 99.9,
- shipping: 13.99,
- tax: 20.99,
- products: []
- });
-
- window.rudderanalytics.track('Order Completed', {
- order_id: '5d4c7cb5ruchira',
- revenue: 99.9,
- shipping: 13.99,
- tax: 20.99,
- products: [],
- currency: 'EUR'
- });
-
- window.rudderanalytics.track('Product Added', {
- currency: 'CAD',
- quantity: 1,
- price: 24.75,
- name: 'my product',
- category: 'cat 1',
- sku: 'p-298',
- testDimension: true,
- testMetric: true,
- position: 4
- });
-
- window.rudderanalytics.track('Product Added', {
- currency: 'CAD',
- quantity: 1,
- price: 24.75,
- name: 'my product 1',
- category: 'cat 1',
- sku: 'p-298',
- testDimension: true,
- testMetric: true,
- position: 4.5
- });
-
- window.rudderanalytics.track('Product Added', {
- currency: 'CAD',
- quantity: 1,
- price: 24.75,
- name: 'my product 2',
- category: 'cat 1',
- sku: 'p-298',
- label: 'sample label'
- });
+// window.rudderanalytics.track("Order Completed", {
+// order_id: 'ruchiraorder1',
+// total: 99.99,
+// shipping: 13.99,
+// tax: 20.99,
+// currency: 'INR',
+// products: [
+// {
+// quantity: 1,
+// price: 24.75,
+// name: 'my product',
+// sku: 'p-298'
+// },
+// {
+// quantity: 3,
+// price: 24.75,
+// name: 'other product',
+// sku: 'p-299'
+// }
+// ]
+// });
+
+// window.rudderanalytics.track('Order Completed', {
+// order_id: '5d4c7cb5',
+// revenue: 99.9,
+// shipping: 13.99,
+// tax: 20.99,
+// products: []
+// });
+
+// window.rudderanalytics.track('Order Completed', {
+// order_id: '5d4c7cb5ruchira',
+// revenue: 99.9,
+// shipping: 13.99,
+// tax: 20.99,
+// products: [],
+// currency: 'EUR'
+// });
+
+// window.rudderanalytics.track('Product Added', {
+// currency: 'CAD',
+// quantity: 1,
+// price: 24.75,
+// name: 'my product',
+// category: 'cat 1',
+// sku: 'p-298',
+// testDimension: true,
+// testMetric: true,
+// position: 4
+// });
+
+// window.rudderanalytics.track('Product Added', {
+// currency: 'CAD',
+// quantity: 1,
+// price: 24.75,
+// name: 'my product 1',
+// category: 'cat 1',
+// sku: 'p-298',
+// testDimension: true,
+// testMetric: true,
+// position: 4.5
+// });
+
+// window.rudderanalytics.track('Product Added', {
+// currency: 'CAD',
+// quantity: 1,
+// price: 24.75,
+// name: 'my product 2',
+// category: 'cat 1',
+// sku: 'p-298',
+// label: 'sample label'
+// });
- window.rudderanalytics.track('Product Removed', {
- currency: 'CAD',
- quantity: 1,
- price: 24.75,
- name: 'my product',
- category: 'cat 1',
- sku: 'p-298',
- testDimension: true,
- testMetric: true
- });
-
- window.rudderanalytics.track('Product Viewed', {
- currency: 'CAD',
- quantity: 1,
- price: 24.75,
- name: 'my product',
- category: 'cat 1',
- sku: 'p-298',
- list: 'Apparel Gallery',
- testDimension: true,
- testMetric: true
- });
-
- window.rudderanalytics.track('Product List Filtered', {
- category: 'cat 1',
- list_id: '1234',
- filters: [
- {
- type: 'department',
- value: 'beauty'
- },
- {
- type: 'price',
- value: 'under'
- }
- ],
- sorts: [
- {
- type: 'price',
- value: 'desc'
- }
- ],
- products: [
- {
- product_id: '507f1f77bcf86cd799439011',
- productDimension: 'My Product Dimension',
- productMetric: 'My Product Metric'
- }
- ],
- testDimension: true,
- testMetric: true
- });
- window.rudderanalytics.track('Product List Viewed', {
- category: 'cat 1',
- list_id: '1234',
- products: [
- {
- product_id: '507f1f77bcf86cd799439011',
- productDimension: 'My Product Dimension1',
- productMetric: 'My Product Metric1',
- position: 10
- },
- {
- product_id: '507f1f77bcf86cd799439012',
- productDimension: 'My Product Dimension2',
- productMetric: 'My Product Metric2',
- position: 12
- },
- {
- product_id: '507f1f77bcf86cd799439015',
- productDimension: 'My Product Dimension3',
- productMetric: 'My Product Metric3',
- position: 8
- }
- ]
- });
-
- window.rudderanalytics.track('Product List Viewed', {
- category: 'cat 1',
- list_id: '1234',
- products: [
- {
- product_id: '507f1f77bcf86cd799439011',
- productDimension: 'My Product Dimension1',
- productMetric: 'My Product Metric1',
- position: -10 // will not accept -ve number
- },
- {
- product_id: '507f1f77bcf86cd799439012',
- productDimension: 'My Product Dimension2',
- productMetric: 'My Product Metric2',
- position: 'position12' // will not accept string
- },
- {
- product_id: '507f1f77bcf86cd799439015',
- productDimension: 'My Product Dimension3',
- productMetric: 'My Product Metric3',
- position: '8' // accept valid positive numberic string
- }
- ]
- });
-
- window.rudderanalytics.track('Product List Viewed', {
- category: 'cat 1',
- list_id: '1234',
- products: [
- {
- product_id: '507f1f77bcf86cd799439011',
- productDimension: 'My Product Dimension',
- productMetric: 'My Product Metric'
- }
- ],
- testDimension: true,
- testMetric: true
- });
-
- window.rudderanalytics.track('Product List Filtered', {
- category: 'cat 2',
- list_id: '1234',
- filters: [
- {
- type: 'department',
- value: 'beauty'
- },
- {
- type: 'price',
- value: 'under'
- }
- ],
- sorts: [
- {
- type: 'price',
- value: 'desc'
- }
- ],
- products: [
- {
- product_id: '507f1f77bcf86cd799439011',
- productDimension: 'My Product Dimension1',
- productMetric: 'My Product Metric1',
- position: 15
- },
- {
- product_id: '507f1f77bcf86cd799439010',
- productDimension: 'My Product Dimension2',
- productMetric: 'My Product Metric3',
- position: 10
- }
- ]
- });
-
- window.rudderanalytics.track('Product Clicked', {
- currency: 'CAD',
- quantity: 1,
- price: 24.75,
- name: 'my product',
- category: 'cat 1',
- sku: 'p-298',
- list: 'search results',
- testDimension: true,
- testMetric: true
- });
-
- window.rudderanalytics.track('Promotion Viewed', {
- currency: 'CAD',
- promotion_id: 'PROMO_1234',
- name: 'Summer Sale',
- creative: 'summer_banner2',
- position: 'banner_slot1',
- testDimension: true,
- testMetric: true
- });
-
- window.rudderanalytics.track('Promotion Clicked', {
- currency: 'CAD',
- promotion_id: 'PROMO_1234',
- name: 'Summer Sale',
- creative: 'summer_banner2',
- position: 'banner_slot1',
- testDimension: true,
- testMetric: true
- });
-
- window.rudderanalytics.track('Checkout Started', {
- currency: 'CAD',
- products: [
- {
- quantity: 1,
- price: 24.75,
- name: 'my product',
- sku: 'p-298'
- },
- {
- quantity: 3,
- price: 24.75,
- name: 'other product',
- sku: 'p-299'
- }
- ],
- step: 1,
- paymentMethod: 'Visa',
- testDimension: true,
- testMetric: true
- });
-
- window.rudderanalytics.track('Order Updated', {
- currency: 'CAD',
- products: [
- {
- quantity: 1,
- price: 24.75,
- name: 'my product',
- category: 'cat 1',
- sku: 'p-298'
- },
- {
- quantity: 3,
- price: 24.75,
- name: 'other product',
- category: 'cat 2',
- sku: 'p-299'
- }
- ],
- step: 1,
- paymentMethod: 'Visa',
- testDimension: true,
- testMetric: true
- });
-
- window.rudderanalytics.track('Checkout Step Viewed', {
- currency: 'CAD',
- step: 2
- });
-
- window.rudderanalytics.track('Checkout Step Completed', {
- currency: 'CAD',
- step: 2,
- shippingMethod: 'FedEx'
- });
- window.rudderanalytics.track('Checkout Step Completed', {
- currency: 'CAD',
- step: 2,
- paymentMethod: 'Visa',
- shippingMethod: 'FedEx1'
- });
- window.rudderanalytics.track('Checkout Step Completed', {
- currency: 'CAD',
- paymentMethod: 'Visa',
- shippingMethod: 'FedEx1'
- });
- window.rudderanalytics.track('Checkout Step Completed', {
- currency: 'CAD',
- step: 2,
- });
-
- window.rudderanalytics.track('Order Completed', {
- order_id: '780bc55ruchu',
- total: 99.9,
- shipping: 13.99,
- tax: 20.99,
- currency: 'CAD',
- coupon: 'coupon',
- affiliation: 'affiliation',
- products: [
- {
- quantity: 1,
- price: 24.75,
- name: 'my product',
- category: 'cat 1',
- sku: 'p-298',
- coupon: 'promo'
- },
- {
- quantity: 3,
- price: 24.75,
- name: 'other product',
- category: 'cat 2',
- sku: 'p-299',
- currency: 'EUR'
- }
- ]
- });
- window.rudderanalytics.track('Order Refunded', {
- order_id: '780bc55',
- testDimension: true,
- testMetric: true
- });
-
- window.rudderanalytics.track('Order Refunded', {
- order_id: '780bc55',
- products: [
- {
- quantity: 1,
- sku: 'p-298'
- },
- {
- quantity: 2,
- sku: 'p-299'
- }
- ],
- testDimension: true,
- testMetric: true
- });
-
- window.rudderanalytics.page("category", "name", {
- path: "path",
- url: "url",
- title: "title",
- search: "search",
- referrer: "referrer",
- testDimension: "true"
+// window.rudderanalytics.track('Product Removed', {
+// currency: 'CAD',
+// quantity: 1,
+// price: 24.75,
+// name: 'my product',
+// category: 'cat 1',
+// sku: 'p-298',
+// testDimension: true,
+// testMetric: true
+// });
+
+// window.rudderanalytics.track('Product Viewed', {
+// currency: 'CAD',
+// quantity: 1,
+// price: 24.75,
+// name: 'my product',
+// category: 'cat 1',
+// sku: 'p-298',
+// list: 'Apparel Gallery',
+// testDimension: true,
+// testMetric: true
+// });
+
+// window.rudderanalytics.track('Product List Filtered', {
+// category: 'cat 1',
+// list_id: '1234',
+// filters: [
+// {
+// type: 'department',
+// value: 'beauty'
+// },
+// {
+// type: 'price',
+// value: 'under'
+// }
+// ],
+// sorts: [
+// {
+// type: 'price',
+// value: 'desc'
+// }
+// ],
+// products: [
+// {
+// product_id: '507f1f77bcf86cd799439011',
+// productDimension: 'My Product Dimension',
+// productMetric: 'My Product Metric'
+// }
+// ],
+// testDimension: true,
+// testMetric: true
+// });
+// window.rudderanalytics.track('Product List Viewed', {
+// category: 'cat 1',
+// list_id: '1234',
+// products: [
+// {
+// product_id: '507f1f77bcf86cd799439011',
+// productDimension: 'My Product Dimension1',
+// productMetric: 'My Product Metric1',
+// position: 10
+// },
+// {
+// product_id: '507f1f77bcf86cd799439012',
+// productDimension: 'My Product Dimension2',
+// productMetric: 'My Product Metric2',
+// position: 12
+// },
+// {
+// product_id: '507f1f77bcf86cd799439015',
+// productDimension: 'My Product Dimension3',
+// productMetric: 'My Product Metric3',
+// position: 8
+// }
+// ]
+// });
+
+// window.rudderanalytics.track('Product List Viewed', {
+// category: 'cat 1',
+// list_id: '1234',
+// products: [
+// {
+// product_id: '507f1f77bcf86cd799439011',
+// productDimension: 'My Product Dimension1',
+// productMetric: 'My Product Metric1',
+// position: -10 // will not accept -ve number
+// },
+// {
+// product_id: '507f1f77bcf86cd799439012',
+// productDimension: 'My Product Dimension2',
+// productMetric: 'My Product Metric2',
+// position: 'position12' // will not accept string
+// },
+// {
+// product_id: '507f1f77bcf86cd799439015',
+// productDimension: 'My Product Dimension3',
+// productMetric: 'My Product Metric3',
+// position: '8' // accept valid positive numberic string
+// }
+// ]
+// });
+
+// window.rudderanalytics.track('Product List Viewed', {
+// category: 'cat 1',
+// list_id: '1234',
+// products: [
+// {
+// product_id: '507f1f77bcf86cd799439011',
+// productDimension: 'My Product Dimension',
+// productMetric: 'My Product Metric'
+// }
+// ],
+// testDimension: true,
+// testMetric: true
+// });
+
+// window.rudderanalytics.track('Product List Filtered', {
+// category: 'cat 2',
+// list_id: '1234',
+// filters: [
+// {
+// type: 'department',
+// value: 'beauty'
+// },
+// {
+// type: 'price',
+// value: 'under'
+// }
+// ],
+// sorts: [
+// {
+// type: 'price',
+// value: 'desc'
+// }
+// ],
+// products: [
+// {
+// product_id: '507f1f77bcf86cd799439011',
+// productDimension: 'My Product Dimension1',
+// productMetric: 'My Product Metric1',
+// position: 15
+// },
+// {
+// product_id: '507f1f77bcf86cd799439010',
+// productDimension: 'My Product Dimension2',
+// productMetric: 'My Product Metric3',
+// position: 10
+// }
+// ]
+// });
+
+// window.rudderanalytics.track('Product Clicked', {
+// currency: 'CAD',
+// quantity: 1,
+// price: 24.75,
+// name: 'my product',
+// category: 'cat 1',
+// sku: 'p-298',
+// list: 'search results',
+// testDimension: true,
+// testMetric: true
+// });
+
+// window.rudderanalytics.track('Promotion Viewed', {
+// currency: 'CAD',
+// promotion_id: 'PROMO_1234',
+// name: 'Summer Sale',
+// creative: 'summer_banner2',
+// position: 'banner_slot1',
+// testDimension: true,
+// testMetric: true
+// });
+
+// window.rudderanalytics.track('Promotion Clicked', {
+// currency: 'CAD',
+// promotion_id: 'PROMO_1234',
+// name: 'Summer Sale',
+// creative: 'summer_banner2',
+// position: 'banner_slot1',
+// testDimension: true,
+// testMetric: true
+// });
+
+// window.rudderanalytics.track('Checkout Started', {
+// currency: 'CAD',
+// products: [
+// {
+// quantity: 1,
+// price: 24.75,
+// name: 'my product',
+// sku: 'p-298'
+// },
+// {
+// quantity: 3,
+// price: 24.75,
+// name: 'other product',
+// sku: 'p-299'
+// }
+// ],
+// step: 1,
+// paymentMethod: 'Visa',
+// testDimension: true,
+// testMetric: true
+// });
+
+// window.rudderanalytics.track('Order Updated', {
+// currency: 'CAD',
+// products: [
+// {
+// quantity: 1,
+// price: 24.75,
+// name: 'my product',
+// category: 'cat 1',
+// sku: 'p-298'
+// },
+// {
+// quantity: 3,
+// price: 24.75,
+// name: 'other product',
+// category: 'cat 2',
+// sku: 'p-299'
+// }
+// ],
+// step: 1,
+// paymentMethod: 'Visa',
+// testDimension: true,
+// testMetric: true
+// });
+
+// window.rudderanalytics.track('Checkout Step Viewed', {
+// currency: 'CAD',
+// step: 2
+// });
+
+// window.rudderanalytics.track('Checkout Step Completed', {
+// currency: 'CAD',
+// step: 2,
+// shippingMethod: 'FedEx'
+// });
+// window.rudderanalytics.track('Checkout Step Completed', {
+// currency: 'CAD',
+// step: 2,
+// paymentMethod: 'Visa',
+// shippingMethod: 'FedEx1'
+// });
+// window.rudderanalytics.track('Checkout Step Completed', {
+// currency: 'CAD',
+// paymentMethod: 'Visa',
+// shippingMethod: 'FedEx1'
+// });
+// window.rudderanalytics.track('Checkout Step Completed', {
+// currency: 'CAD',
+// step: 2,
+// });
+
+// window.rudderanalytics.track('Order Completed', {
+// order_id: '780bc55ruchu',
+// total: 99.9,
+// shipping: 13.99,
+// tax: 20.99,
+// currency: 'CAD',
+// coupon: 'coupon',
+// affiliation: 'affiliation',
+// products: [
+// {
+// quantity: 1,
+// price: 24.75,
+// name: 'my product',
+// category: 'cat 1',
+// sku: 'p-298',
+// coupon: 'promo'
+// },
+// {
+// quantity: 3,
+// price: 24.75,
+// name: 'other product',
+// category: 'cat 2',
+// sku: 'p-299',
+// currency: 'EUR'
+// }
+// ]
+// });
+// window.rudderanalytics.track('Order Refunded', {
+// order_id: '780bc55',
+// testDimension: true,
+// testMetric: true
+// });
+
+// window.rudderanalytics.track('Order Refunded', {
+// order_id: '780bc55',
+// products: [
+// {
+// quantity: 1,
+// sku: 'p-298'
+// },
+// {
+// quantity: 2,
+// sku: 'p-299'
+// }
+// ],
+// testDimension: true,
+// testMetric: true
+// });
+
+// window.rudderanalytics.page("category", "name", {
+// path: "path",
+// url: "url",
+// title: "title",
+// search: "search",
+// referrer: "referrer",
+// testDimension: "true"
-});
+// });