zar 0.0.22 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/zar.es.js +357 -425
- package/dist/zar.es.js.map +1 -0
- package/dist/zar.iife.js +5 -4
- package/dist/zar.iife.js.map +1 -0
- package/dist/zar.umd.js +5 -4
- package/dist/zar.umd.js.map +1 -0
- package/package.json +2 -3
package/dist/zar.es.js
CHANGED
|
@@ -93,14 +93,14 @@ _n$4($n$4, "form");
|
|
|
93
93
|
_n$4($n$4, "button");
|
|
94
94
|
_n$4($n$4, "input");
|
|
95
95
|
_n$4($n$4, "select");
|
|
96
|
-
function n$
|
|
96
|
+
function n$5(e2) {
|
|
97
97
|
try {
|
|
98
98
|
return decodeURIComponent(e2.replace(/\+/g, " "));
|
|
99
99
|
} catch (e3) {
|
|
100
100
|
return null;
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
|
-
function o$
|
|
103
|
+
function o$8() {
|
|
104
104
|
if ($$5) {
|
|
105
105
|
var r2 = navigator, t2 = r2.languages;
|
|
106
106
|
return r2.userLanguage || (t2 && t2.length ? t2[0] : r2.language);
|
|
@@ -115,8 +115,8 @@ function a$5() {
|
|
|
115
115
|
function s(r2) {
|
|
116
116
|
return function(e2) {
|
|
117
117
|
for (var r3, t2 = /* @__PURE__ */ Object.create(null), o2 = /([^&=]+)=?([^&]*)/g; r3 = o2.exec(e2); ) {
|
|
118
|
-
var a2 = n$
|
|
119
|
-
a2.substring(a2.length - 2) === "[]" ? (t2[a2 = a2.substring(0, a2.length - 2)] || (t2[a2] = [])).push(
|
|
118
|
+
var a2 = n$5(r3[1]), i2 = n$5(r3[2]);
|
|
119
|
+
a2.substring(a2.length - 2) === "[]" ? (t2[a2 = a2.substring(0, a2.length - 2)] || (t2[a2] = [])).push(i2) : t2[a2] = i2 === "" || i2;
|
|
120
120
|
}
|
|
121
121
|
for (var u2 in t2) {
|
|
122
122
|
var c2 = u2.split("[");
|
|
@@ -149,7 +149,7 @@ function y$1() {
|
|
|
149
149
|
}
|
|
150
150
|
return e2;
|
|
151
151
|
}
|
|
152
|
-
var o$
|
|
152
|
+
var o$7 = "object", j$3 = "__", F$3 = typeof process != "undefined" ? process : {};
|
|
153
153
|
F$3.env && F$3.env.NODE_ENV || "";
|
|
154
154
|
var $$4 = typeof window != "undefined";
|
|
155
155
|
F$3.versions != null && F$3.versions.node != null;
|
|
@@ -219,19 +219,19 @@ _n$3($n$3, "form");
|
|
|
219
219
|
_n$3($n$3, "button");
|
|
220
220
|
_n$3($n$3, "input");
|
|
221
221
|
_n$3($n$3, "select");
|
|
222
|
-
var o$
|
|
222
|
+
var o$6 = j$3 + "global" + j$3, n$4 = typeof self === o$7 && self.self === self && self || typeof global === o$7 && global.global === global && global || void 0;
|
|
223
223
|
function a$4(t2) {
|
|
224
|
-
return n$
|
|
224
|
+
return n$4[o$6][t2];
|
|
225
225
|
}
|
|
226
|
-
function f$
|
|
227
|
-
return n$
|
|
226
|
+
function f$4(t2, e2) {
|
|
227
|
+
return n$4[o$6][t2] = e2;
|
|
228
228
|
}
|
|
229
|
-
function i$
|
|
230
|
-
delete n$
|
|
229
|
+
function i$4(t2) {
|
|
230
|
+
delete n$4[o$6][t2];
|
|
231
231
|
}
|
|
232
|
-
n$
|
|
233
|
-
var n$
|
|
234
|
-
((n$
|
|
232
|
+
n$4[o$6] || (n$4[o$6] = {});
|
|
233
|
+
var n$3, f$3 = "any", l$1 = "*", p = "__", h$1 = typeof process != "undefined" ? process : {};
|
|
234
|
+
((n$3 = h$1.env) == null ? void 0 : n$3.NODE_ENV) || "";
|
|
235
235
|
var z = typeof window != "undefined";
|
|
236
236
|
h$1.versions != null && h$1.versions.node != null;
|
|
237
237
|
typeof Deno != "undefined" && Deno.core !== void 0;
|
|
@@ -256,8 +256,8 @@ function M$3(n2) {
|
|
|
256
256
|
function _arrayLikeToArray(arr, len) {
|
|
257
257
|
if (len == null || len > arr.length)
|
|
258
258
|
len = arr.length;
|
|
259
|
-
for (var
|
|
260
|
-
arr2[
|
|
259
|
+
for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++) {
|
|
260
|
+
arr2[i2] = arr[i2];
|
|
261
261
|
}
|
|
262
262
|
return arr2;
|
|
263
263
|
}
|
|
@@ -349,9 +349,9 @@ function ownKeys$1(object, enumerableOnly) {
|
|
|
349
349
|
return keys;
|
|
350
350
|
}
|
|
351
351
|
function _objectSpread2$1(target) {
|
|
352
|
-
for (var
|
|
353
|
-
var source = arguments[
|
|
354
|
-
|
|
352
|
+
for (var i2 = 1; i2 < arguments.length; i2++) {
|
|
353
|
+
var source = arguments[i2] != null ? arguments[i2] : {};
|
|
354
|
+
i2 % 2 ? ownKeys$1(Object(source), true).forEach(function(key) {
|
|
355
355
|
_defineProperty$2(target, key, source[key]);
|
|
356
356
|
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function(key) {
|
|
357
357
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
@@ -666,10 +666,10 @@ var runtime = { exports: {} };
|
|
|
666
666
|
return iterable;
|
|
667
667
|
}
|
|
668
668
|
if (!isNaN(iterable.length)) {
|
|
669
|
-
var
|
|
670
|
-
while (++
|
|
671
|
-
if (hasOwn.call(iterable,
|
|
672
|
-
next2.value = iterable[
|
|
669
|
+
var i2 = -1, next = function next2() {
|
|
670
|
+
while (++i2 < iterable.length) {
|
|
671
|
+
if (hasOwn.call(iterable, i2)) {
|
|
672
|
+
next2.value = iterable[i2];
|
|
673
673
|
next2.done = false;
|
|
674
674
|
return next2;
|
|
675
675
|
}
|
|
@@ -735,8 +735,8 @@ var runtime = { exports: {} };
|
|
|
735
735
|
}
|
|
736
736
|
return !!caught;
|
|
737
737
|
}
|
|
738
|
-
for (var
|
|
739
|
-
var entry = this.tryEntries[
|
|
738
|
+
for (var i2 = this.tryEntries.length - 1; i2 >= 0; --i2) {
|
|
739
|
+
var entry = this.tryEntries[i2];
|
|
740
740
|
var record = entry.completion;
|
|
741
741
|
if (entry.tryLoc === "root") {
|
|
742
742
|
return handle("end");
|
|
@@ -765,8 +765,8 @@ var runtime = { exports: {} };
|
|
|
765
765
|
}
|
|
766
766
|
},
|
|
767
767
|
abrupt: function(type, arg) {
|
|
768
|
-
for (var
|
|
769
|
-
var entry = this.tryEntries[
|
|
768
|
+
for (var i2 = this.tryEntries.length - 1; i2 >= 0; --i2) {
|
|
769
|
+
var entry = this.tryEntries[i2];
|
|
770
770
|
if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
|
|
771
771
|
var finallyEntry = entry;
|
|
772
772
|
break;
|
|
@@ -801,8 +801,8 @@ var runtime = { exports: {} };
|
|
|
801
801
|
return ContinueSentinel;
|
|
802
802
|
},
|
|
803
803
|
finish: function(finallyLoc) {
|
|
804
|
-
for (var
|
|
805
|
-
var entry = this.tryEntries[
|
|
804
|
+
for (var i2 = this.tryEntries.length - 1; i2 >= 0; --i2) {
|
|
805
|
+
var entry = this.tryEntries[i2];
|
|
806
806
|
if (entry.finallyLoc === finallyLoc) {
|
|
807
807
|
this.complete(entry.completion, entry.afterLoc);
|
|
808
808
|
resetTryEntry(entry);
|
|
@@ -811,8 +811,8 @@ var runtime = { exports: {} };
|
|
|
811
811
|
}
|
|
812
812
|
},
|
|
813
813
|
"catch": function(tryLoc) {
|
|
814
|
-
for (var
|
|
815
|
-
var entry = this.tryEntries[
|
|
814
|
+
for (var i2 = this.tryEntries.length - 1; i2 >= 0; --i2) {
|
|
815
|
+
var entry = this.tryEntries[i2];
|
|
816
816
|
if (entry.tryLoc === tryLoc) {
|
|
817
817
|
var record = entry.completion;
|
|
818
818
|
if (record.type === "throw") {
|
|
@@ -920,8 +920,8 @@ function createStore(reducer, preloadedState, enhancer) {
|
|
|
920
920
|
isDispatching = false;
|
|
921
921
|
}
|
|
922
922
|
var listeners = currentListeners = nextListeners;
|
|
923
|
-
for (var
|
|
924
|
-
var listener = listeners[
|
|
923
|
+
for (var i2 = 0; i2 < listeners.length; i2++) {
|
|
924
|
+
var listener = listeners[i2];
|
|
925
925
|
listener();
|
|
926
926
|
}
|
|
927
927
|
return action;
|
|
@@ -988,8 +988,8 @@ function assertReducerShape(reducers) {
|
|
|
988
988
|
function combineReducers(reducers) {
|
|
989
989
|
var reducerKeys = Object.keys(reducers);
|
|
990
990
|
var finalReducers = {};
|
|
991
|
-
for (var
|
|
992
|
-
var key = reducerKeys[
|
|
991
|
+
for (var i2 = 0; i2 < reducerKeys.length; i2++) {
|
|
992
|
+
var key = reducerKeys[i2];
|
|
993
993
|
if (_typeof(reducers[key]) === FUNC) {
|
|
994
994
|
finalReducers[key] = reducers[key];
|
|
995
995
|
}
|
|
@@ -1272,7 +1272,7 @@ function identifyMiddleware(instance) {
|
|
|
1272
1272
|
removeItem(key);
|
|
1273
1273
|
});
|
|
1274
1274
|
[ID, ANONID, "traits"].forEach(function(key) {
|
|
1275
|
-
i$
|
|
1275
|
+
i$4(tempKey(key));
|
|
1276
1276
|
});
|
|
1277
1277
|
}
|
|
1278
1278
|
if (action.type === EVENTS$1.identify) {
|
|
@@ -1356,8 +1356,8 @@ function processQueue(store, getPlugins, instance) {
|
|
|
1356
1356
|
requeueIndex: []
|
|
1357
1357
|
});
|
|
1358
1358
|
if (pipeline.processIndex && pipeline.processIndex.length) {
|
|
1359
|
-
pipeline.processIndex.forEach(function(
|
|
1360
|
-
var processAction = queue.actions[
|
|
1359
|
+
pipeline.processIndex.forEach(function(i2) {
|
|
1360
|
+
var processAction = queue.actions[i2];
|
|
1361
1361
|
var currentPlugin = processAction.plugin;
|
|
1362
1362
|
var currentMethod = processAction.payload.type;
|
|
1363
1363
|
var method = pluginMethods[currentPlugin][currentMethod];
|
|
@@ -1404,7 +1404,7 @@ function _arrayWithHoles(arr) {
|
|
|
1404
1404
|
if (Array.isArray(arr))
|
|
1405
1405
|
return arr;
|
|
1406
1406
|
}
|
|
1407
|
-
function _iterableToArrayLimit(arr,
|
|
1407
|
+
function _iterableToArrayLimit(arr, i2) {
|
|
1408
1408
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
1409
1409
|
if (_i == null)
|
|
1410
1410
|
return;
|
|
@@ -1415,7 +1415,7 @@ function _iterableToArrayLimit(arr, i) {
|
|
|
1415
1415
|
try {
|
|
1416
1416
|
for (_i = _i.call(arr); !(_n2 = (_s = _i.next()).done); _n2 = true) {
|
|
1417
1417
|
_arr.push(_s.value);
|
|
1418
|
-
if (
|
|
1418
|
+
if (i2 && _arr.length === i2)
|
|
1419
1419
|
break;
|
|
1420
1420
|
}
|
|
1421
1421
|
} catch (err) {
|
|
@@ -1435,8 +1435,8 @@ function _iterableToArrayLimit(arr, i) {
|
|
|
1435
1435
|
function _nonIterableRest() {
|
|
1436
1436
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
1437
1437
|
}
|
|
1438
|
-
function _slicedToArray(arr,
|
|
1439
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr,
|
|
1438
|
+
function _slicedToArray(arr, i2) {
|
|
1439
|
+
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i2) || _unsupportedIterableToArray(arr, i2) || _nonIterableRest();
|
|
1440
1440
|
}
|
|
1441
1441
|
function fitlerDisabledPlugins(allPlugins) {
|
|
1442
1442
|
var settings = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
@@ -1618,7 +1618,7 @@ function _processEvent() {
|
|
|
1618
1618
|
}, {});
|
|
1619
1619
|
_context5.next = 10;
|
|
1620
1620
|
return data.exact.reduce(/* @__PURE__ */ function() {
|
|
1621
|
-
var _ref6 = _asyncToGenerator(/* @__PURE__ */ regenerator.mark(function _callee3(scoped, curr,
|
|
1621
|
+
var _ref6 = _asyncToGenerator(/* @__PURE__ */ regenerator.mark(function _callee3(scoped, curr, i2) {
|
|
1622
1622
|
var pluginName, curScope, scopedPayload;
|
|
1623
1623
|
return regenerator.wrap(function _callee3$(_context3) {
|
|
1624
1624
|
while (1) {
|
|
@@ -1712,13 +1712,13 @@ function _processEvent() {
|
|
|
1712
1712
|
payloads = _context5.sent;
|
|
1713
1713
|
_context5.next = 13;
|
|
1714
1714
|
return data.exact.reduce(/* @__PURE__ */ function() {
|
|
1715
|
-
var _ref8 = _asyncToGenerator(/* @__PURE__ */ regenerator.mark(function _callee4(promise, curr,
|
|
1715
|
+
var _ref8 = _asyncToGenerator(/* @__PURE__ */ regenerator.mark(function _callee4(promise, curr, i2) {
|
|
1716
1716
|
var lastLoop, pluginName, currentPlugin, currentActionValue, payloadValue, funcArgs, val, returnValue, merged, scopedPayload, nameSpaceEvent, actionDepth, updatedPayload;
|
|
1717
1717
|
return regenerator.wrap(function _callee4$(_context4) {
|
|
1718
1718
|
while (1) {
|
|
1719
1719
|
switch (_context4.prev = _context4.next) {
|
|
1720
1720
|
case 0:
|
|
1721
|
-
lastLoop = data.exact.length ===
|
|
1721
|
+
lastLoop = data.exact.length === i2 + 1;
|
|
1722
1722
|
pluginName = curr.pluginName;
|
|
1723
1723
|
currentPlugin = allPlugins[pluginName];
|
|
1724
1724
|
_context4.next = 5;
|
|
@@ -2161,8 +2161,8 @@ function storageMiddleware(storage2) {
|
|
|
2161
2161
|
};
|
|
2162
2162
|
}
|
|
2163
2163
|
function _defineProperties(target, props) {
|
|
2164
|
-
for (var
|
|
2165
|
-
var descriptor = props[
|
|
2164
|
+
for (var i2 = 0; i2 < props.length; i2++) {
|
|
2165
|
+
var descriptor = props[i2];
|
|
2166
2166
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
2167
2167
|
descriptor.configurable = true;
|
|
2168
2168
|
if ("value" in descriptor)
|
|
@@ -2344,7 +2344,7 @@ function canonicalUrl() {
|
|
|
2344
2344
|
if (!z)
|
|
2345
2345
|
return;
|
|
2346
2346
|
var tags = document.getElementsByTagName("link");
|
|
2347
|
-
for (var
|
|
2347
|
+
for (var i2 = 0, tag; tag = tags[i2]; i2++) {
|
|
2348
2348
|
if (tag.getAttribute("rel") === "canonical") {
|
|
2349
2349
|
return tag.getAttribute("href");
|
|
2350
2350
|
}
|
|
@@ -2429,7 +2429,7 @@ var timeZone;
|
|
|
2429
2429
|
{
|
|
2430
2430
|
osName = getBrowserOS();
|
|
2431
2431
|
referrer = z ? document.referrer : null;
|
|
2432
|
-
locale = o$
|
|
2432
|
+
locale = o$8();
|
|
2433
2433
|
timeZone = a$5();
|
|
2434
2434
|
}
|
|
2435
2435
|
var initialState = {
|
|
@@ -2511,14 +2511,14 @@ function watch(cb) {
|
|
|
2511
2511
|
};
|
|
2512
2512
|
}
|
|
2513
2513
|
function Debug() {
|
|
2514
|
-
f$
|
|
2514
|
+
f$4(LIB_NAME, []);
|
|
2515
2515
|
return function(createStore2) {
|
|
2516
2516
|
return function(reducer, preloadedState, enhancer) {
|
|
2517
2517
|
var store = createStore2(reducer, preloadedState, enhancer);
|
|
2518
2518
|
var origDispatch = store.dispatch;
|
|
2519
2519
|
var dispatch = function dispatch2(action) {
|
|
2520
2520
|
var a2 = action.action || action;
|
|
2521
|
-
n$
|
|
2521
|
+
n$4[o$6][LIB_NAME].push(a2);
|
|
2522
2522
|
return origDispatch(action);
|
|
2523
2523
|
};
|
|
2524
2524
|
return Object.assign(store, {
|
|
@@ -2542,9 +2542,9 @@ function ensureArray(singleOrArray) {
|
|
|
2542
2542
|
function getCallbackFromArgs(argArray) {
|
|
2543
2543
|
var args = argArray || Array.prototype.slice.call(arguments);
|
|
2544
2544
|
var cb;
|
|
2545
|
-
for (var
|
|
2546
|
-
if (_(args[
|
|
2547
|
-
cb = args[
|
|
2545
|
+
for (var i2 = 0; i2 < args.length; i2++) {
|
|
2546
|
+
if (_(args[i2])) {
|
|
2547
|
+
cb = args[i2];
|
|
2548
2548
|
break;
|
|
2549
2549
|
}
|
|
2550
2550
|
}
|
|
@@ -2628,8 +2628,8 @@ function analytics() {
|
|
|
2628
2628
|
});
|
|
2629
2629
|
var storage2 = config2.storage ? config2.storage : {
|
|
2630
2630
|
getItem: a$4,
|
|
2631
|
-
setItem: f$
|
|
2632
|
-
removeItem: i$
|
|
2631
|
+
setItem: f$4,
|
|
2632
|
+
removeItem: i$4
|
|
2633
2633
|
};
|
|
2634
2634
|
var getUserProp = getUserPropFunc(storage2);
|
|
2635
2635
|
var customPlugins = parsedOptions.plugins;
|
|
@@ -2693,7 +2693,7 @@ function analytics() {
|
|
|
2693
2693
|
data = M$3(userId) ? userId : traits;
|
|
2694
2694
|
opts = options || {};
|
|
2695
2695
|
user = instance.user();
|
|
2696
|
-
f$
|
|
2696
|
+
f$4(tempKey(ID), id);
|
|
2697
2697
|
resolvedId = id || data.userId || getUserProp(ID, instance, data);
|
|
2698
2698
|
return _context.abrupt("return", new Promise(function(resolve) {
|
|
2699
2699
|
store.dispatch(_objectSpread2$1({
|
|
@@ -3040,7 +3040,7 @@ function analytics() {
|
|
|
3040
3040
|
plugins: pluginKeys,
|
|
3041
3041
|
enabled: parsedOptions.pluginEnabled
|
|
3042
3042
|
});
|
|
3043
|
-
parsedOptions.pluginsArray.map(function(plugin,
|
|
3043
|
+
parsedOptions.pluginsArray.map(function(plugin, i2) {
|
|
3044
3044
|
var bootstrap = plugin.bootstrap, config3 = plugin.config, name = plugin.name;
|
|
3045
3045
|
if (bootstrap && _(bootstrap)) {
|
|
3046
3046
|
bootstrap({
|
|
@@ -3055,7 +3055,7 @@ function analytics() {
|
|
|
3055
3055
|
enabled: parsedOptions.pluginEnabled[name],
|
|
3056
3056
|
plugin
|
|
3057
3057
|
});
|
|
3058
|
-
if (parsedOptions.pluginsArray.length ===
|
|
3058
|
+
if (parsedOptions.pluginsArray.length === i2 + 1) {
|
|
3059
3059
|
store.dispatch({
|
|
3060
3060
|
type: EVENTS$1.initializeStart,
|
|
3061
3061
|
plugins: enabledPlugins,
|
|
@@ -3075,8 +3075,8 @@ function analytics() {
|
|
|
3075
3075
|
return function() {
|
|
3076
3076
|
var args = Array.prototype.slice.call(arguments);
|
|
3077
3077
|
var newArgs = new Array(fn.length);
|
|
3078
|
-
for (var
|
|
3079
|
-
newArgs[
|
|
3078
|
+
for (var i2 = 0; i2 < args.length; i2++) {
|
|
3079
|
+
newArgs[i2] = args[i2];
|
|
3080
3080
|
}
|
|
3081
3081
|
newArgs[newArgs.length] = instance;
|
|
3082
3082
|
return fn.apply({
|
|
@@ -3088,7 +3088,7 @@ function analytics() {
|
|
|
3088
3088
|
}
|
|
3089
3089
|
var before = "before";
|
|
3090
3090
|
var after = "after";
|
|
3091
|
-
var o$
|
|
3091
|
+
var o$5 = "object", j$2 = "__", F$2 = typeof process != "undefined" ? process : {};
|
|
3092
3092
|
F$2.env && F$2.env.NODE_ENV || "";
|
|
3093
3093
|
var $$2 = typeof window != "undefined";
|
|
3094
3094
|
F$2.versions != null && F$2.versions.node != null;
|
|
@@ -3158,18 +3158,18 @@ _n$2($n$2, "form");
|
|
|
3158
3158
|
_n$2($n$2, "button");
|
|
3159
3159
|
_n$2($n$2, "input");
|
|
3160
3160
|
_n$2($n$2, "select");
|
|
3161
|
-
var l
|
|
3161
|
+
var l = "global", o$4 = j$2 + "global" + j$2, n$2 = typeof self === o$5 && self.self === self && self || typeof global === o$5 && global.global === global && global || void 0;
|
|
3162
3162
|
function a$3(t2) {
|
|
3163
|
-
return n$
|
|
3163
|
+
return n$2[o$4][t2];
|
|
3164
3164
|
}
|
|
3165
|
-
function f$
|
|
3166
|
-
return n$
|
|
3165
|
+
function f$2(t2, e2) {
|
|
3166
|
+
return n$2[o$4][t2] = e2;
|
|
3167
3167
|
}
|
|
3168
|
-
function i$
|
|
3169
|
-
delete n$
|
|
3168
|
+
function i$3(t2) {
|
|
3169
|
+
delete n$2[o$4][t2];
|
|
3170
3170
|
}
|
|
3171
|
-
n$
|
|
3172
|
-
var o$
|
|
3171
|
+
n$2[o$4] || (n$2[o$4] = {});
|
|
3172
|
+
var o$3 = "object", j$1 = "__", F$1 = typeof process != "undefined" ? process : {};
|
|
3173
3173
|
F$1.env && F$1.env.NODE_ENV || "";
|
|
3174
3174
|
var $$1 = typeof window != "undefined";
|
|
3175
3175
|
F$1.versions != null && F$1.versions.node != null;
|
|
@@ -3239,39 +3239,39 @@ _n$1($n$1, "form");
|
|
|
3239
3239
|
_n$1($n$1, "button");
|
|
3240
3240
|
_n$1($n$1, "input");
|
|
3241
3241
|
_n$1($n$1, "select");
|
|
3242
|
-
var o$
|
|
3242
|
+
var o$2 = j$1 + "global" + j$1, n$1 = typeof self === o$3 && self.self === self && self || typeof global === o$3 && global.global === global && global || void 0;
|
|
3243
3243
|
function a$2(t2) {
|
|
3244
|
-
return n$
|
|
3244
|
+
return n$1[o$2][t2];
|
|
3245
3245
|
}
|
|
3246
|
-
function f$
|
|
3247
|
-
return n$
|
|
3246
|
+
function f$1(t2, e2) {
|
|
3247
|
+
return n$1[o$2][t2] = e2;
|
|
3248
3248
|
}
|
|
3249
|
-
function i$
|
|
3250
|
-
delete n$
|
|
3249
|
+
function i$2(t2) {
|
|
3250
|
+
delete n$1[o$2][t2];
|
|
3251
3251
|
}
|
|
3252
|
-
n$
|
|
3253
|
-
var t = "cookie", i$
|
|
3252
|
+
n$1[o$2] || (n$1[o$2] = {});
|
|
3253
|
+
var t = "cookie", i$1 = a$1(), r$1 = d$1, c$1 = d$1;
|
|
3254
3254
|
function u$1(o2) {
|
|
3255
|
-
return i$
|
|
3255
|
+
return i$1 ? d$1(o2, "", -1) : i$2(o2);
|
|
3256
3256
|
}
|
|
3257
3257
|
function a$1() {
|
|
3258
|
-
if (i$
|
|
3259
|
-
return i$
|
|
3258
|
+
if (i$1 !== void 0)
|
|
3259
|
+
return i$1;
|
|
3260
3260
|
var e2 = "cookiecookie";
|
|
3261
3261
|
try {
|
|
3262
|
-
d$1(e2, e2), i$
|
|
3262
|
+
d$1(e2, e2), i$1 = document.cookie.indexOf(e2) !== -1, u$1(e2);
|
|
3263
3263
|
} catch (e3) {
|
|
3264
|
-
i$
|
|
3264
|
+
i$1 = false;
|
|
3265
3265
|
}
|
|
3266
|
-
return i$
|
|
3266
|
+
return i$1;
|
|
3267
3267
|
}
|
|
3268
3268
|
function d$1(e2, t2, r2, c2, u2, a2) {
|
|
3269
3269
|
if (typeof window != "undefined") {
|
|
3270
3270
|
var d2 = arguments.length > 1;
|
|
3271
|
-
return i$
|
|
3271
|
+
return i$1 === false && (d2 ? f$1(e2, t2) : a$2(e2)), d2 ? document.cookie = e2 + "=" + encodeURIComponent(t2) + (r2 ? "; expires=" + new Date(+new Date() + 1e3 * r2).toUTCString() + (c2 ? "; path=" + c2 : "") + (u2 ? "; domain=" + u2 : "") + (a2 ? "; secure" : "") : "") : decodeURIComponent((("; " + document.cookie).split("; " + e2 + "=")[1] || "").split(";")[0]);
|
|
3272
3272
|
}
|
|
3273
3273
|
}
|
|
3274
|
-
var e
|
|
3274
|
+
var e = "undefined", o$1 = "object", j = "__", F = typeof process != "undefined" ? process : {};
|
|
3275
3275
|
F.env && F.env.NODE_ENV || "";
|
|
3276
3276
|
var $ = typeof window != "undefined";
|
|
3277
3277
|
F.versions != null && F.versions.node != null;
|
|
@@ -3341,15 +3341,15 @@ _n($n, "form");
|
|
|
3341
3341
|
_n($n, "button");
|
|
3342
3342
|
_n($n, "input");
|
|
3343
3343
|
_n($n, "select");
|
|
3344
|
-
var o
|
|
3344
|
+
var o = j + "global" + j, n = typeof self === o$1 && self.self === self && self || typeof global === o$1 && global.global === global && global || void 0;
|
|
3345
3345
|
function a(t2) {
|
|
3346
|
-
return n
|
|
3346
|
+
return n[o][t2];
|
|
3347
3347
|
}
|
|
3348
|
-
function f
|
|
3349
|
-
return n
|
|
3348
|
+
function f(t2, e2) {
|
|
3349
|
+
return n[o][t2] = e2;
|
|
3350
3350
|
}
|
|
3351
|
-
function i
|
|
3352
|
-
delete n
|
|
3351
|
+
function i(t2) {
|
|
3352
|
+
delete n[o][t2];
|
|
3353
3353
|
}
|
|
3354
3354
|
function u(t2, e2, r2) {
|
|
3355
3355
|
var l2;
|
|
@@ -3362,23 +3362,23 @@ function u(t2, e2, r2) {
|
|
|
3362
3362
|
}
|
|
3363
3363
|
return l2 || r2;
|
|
3364
3364
|
}
|
|
3365
|
-
n
|
|
3365
|
+
n[o] || (n[o] = {});
|
|
3366
3366
|
var c = {};
|
|
3367
3367
|
function b$1(t2) {
|
|
3368
|
-
if (typeof c[t2] !== e
|
|
3368
|
+
if (typeof c[t2] !== e)
|
|
3369
3369
|
return c[t2];
|
|
3370
3370
|
try {
|
|
3371
|
-
var
|
|
3372
|
-
|
|
3373
|
-
} catch (
|
|
3371
|
+
var e$1 = window[t2];
|
|
3372
|
+
e$1.setItem(e, e), e$1.removeItem(e);
|
|
3373
|
+
} catch (e2) {
|
|
3374
3374
|
return c[t2] = false;
|
|
3375
3375
|
}
|
|
3376
3376
|
return c[t2] = true;
|
|
3377
3377
|
}
|
|
3378
3378
|
var r = "localStorage", g = b$1.bind(null, "localStorage");
|
|
3379
3379
|
u("localStorage", "getItem", a);
|
|
3380
|
-
u("localStorage", "setItem", f
|
|
3381
|
-
u("localStorage", "removeItem", i
|
|
3380
|
+
u("localStorage", "setItem", f);
|
|
3381
|
+
u("localStorage", "removeItem", i);
|
|
3382
3382
|
function y(t2) {
|
|
3383
3383
|
var o2 = t2;
|
|
3384
3384
|
try {
|
|
@@ -3410,17 +3410,17 @@ function I(o2, r2) {
|
|
|
3410
3410
|
function x(e2, a2, u2) {
|
|
3411
3411
|
if (e2 && !$$3(a2)) {
|
|
3412
3412
|
var c2 = {}, f2 = L(u2), g2 = JSON.stringify(a2), m2 = !A(f2);
|
|
3413
|
-
return O(f2) && (c2[r] = h(r, a2, y(localStorage.getItem(e2))), localStorage.setItem(e2, g2), m2) ? c2[r] : b(f2) && (c2[t] = h(t, a2, y(r$1(e2))), c$1(e2, g2), m2) ? c2[t] : (c2[l
|
|
3413
|
+
return O(f2) && (c2[r] = h(r, a2, y(localStorage.getItem(e2))), localStorage.setItem(e2, g2), m2) ? c2[r] : b(f2) && (c2[t] = h(t, a2, y(r$1(e2))), c$1(e2, g2), m2) ? c2[t] : (c2[l] = h(l, a2, a$3(e2)), f$2(e2, a2), m2 ? c2[l] : c2);
|
|
3414
3414
|
}
|
|
3415
3415
|
}
|
|
3416
3416
|
function C(t$1, r$12) {
|
|
3417
3417
|
if (t$1) {
|
|
3418
|
-
var a2 = L(r$12),
|
|
3419
|
-
return !$$3(
|
|
3418
|
+
var a2 = L(r$12), i2 = I(t$1, l$1), n2 = {};
|
|
3419
|
+
return !$$3(i2.localStorage) && O(a2) && (localStorage.removeItem(t$1), n2[r] = i2.localStorage), !$$3(i2.cookie) && b(a2) && (u$1(t$1), n2[t] = i2.cookie), !$$3(i2.global) && d(a2, l) && (i$3(t$1), n2[l] = i2.global), n2;
|
|
3420
3420
|
}
|
|
3421
3421
|
}
|
|
3422
3422
|
function L(t2) {
|
|
3423
|
-
return t2 ? L$1(t2) ? t2 : t2.storage : f$
|
|
3423
|
+
return t2 ? L$1(t2) ? t2 : t2.storage : f$3;
|
|
3424
3424
|
}
|
|
3425
3425
|
function O(t2) {
|
|
3426
3426
|
return S && d(t2, r);
|
|
@@ -3429,10 +3429,10 @@ function b(t$1) {
|
|
|
3429
3429
|
return k && d(t$1, t);
|
|
3430
3430
|
}
|
|
3431
3431
|
function A(t2) {
|
|
3432
|
-
return t2 === l$
|
|
3432
|
+
return t2 === l$1 || t2 === "all";
|
|
3433
3433
|
}
|
|
3434
3434
|
function d(t2, o2) {
|
|
3435
|
-
return t2 === f$
|
|
3435
|
+
return t2 === f$3 || t2 === o2 || A(t2);
|
|
3436
3436
|
}
|
|
3437
3437
|
function h(t2, o2, r2) {
|
|
3438
3438
|
return { location: t2, current: o2, previous: r2 };
|
|
@@ -3466,9 +3466,9 @@ function ownKeys(object, enumerableOnly) {
|
|
|
3466
3466
|
return keys;
|
|
3467
3467
|
}
|
|
3468
3468
|
function _objectSpread2(target) {
|
|
3469
|
-
for (var
|
|
3470
|
-
var source = arguments[
|
|
3471
|
-
if (
|
|
3469
|
+
for (var i2 = 1; i2 < arguments.length; i2++) {
|
|
3470
|
+
var source = arguments[i2] != null ? arguments[i2] : {};
|
|
3471
|
+
if (i2 % 2) {
|
|
3472
3472
|
ownKeys(source, true).forEach(function(key) {
|
|
3473
3473
|
defineProperty(target, key, source[key]);
|
|
3474
3474
|
});
|
|
@@ -3504,8 +3504,8 @@ function _defineProperty(obj, key, value) {
|
|
|
3504
3504
|
return obj;
|
|
3505
3505
|
}
|
|
3506
3506
|
function _objectSpread(target) {
|
|
3507
|
-
for (var
|
|
3508
|
-
var source = arguments[
|
|
3507
|
+
for (var i2 = 1; i2 < arguments.length; i2++) {
|
|
3508
|
+
var source = arguments[i2] != null ? arguments[i2] : {};
|
|
3509
3509
|
var ownKeys2 = Object.keys(source);
|
|
3510
3510
|
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
3511
3511
|
ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
@@ -3544,7 +3544,7 @@ function googleTagManager$1() {
|
|
|
3544
3544
|
}
|
|
3545
3545
|
var scriptSrc = customScriptSrc || "https://www.googletagmanager.com/gtm.js";
|
|
3546
3546
|
if (!scriptLoaded(containerId)) {
|
|
3547
|
-
(function(w, d2, s2, l2,
|
|
3547
|
+
(function(w, d2, s2, l2, i2) {
|
|
3548
3548
|
w[l2] = w[l2] || [];
|
|
3549
3549
|
w[l2].push({
|
|
3550
3550
|
"gtm.start": new Date().getTime(),
|
|
@@ -3554,7 +3554,7 @@ function googleTagManager$1() {
|
|
|
3554
3554
|
if (execution) {
|
|
3555
3555
|
j2[execution] = true;
|
|
3556
3556
|
}
|
|
3557
|
-
j2.src = "".concat(scriptSrc, "?id=") +
|
|
3557
|
+
j2.src = "".concat(scriptSrc, "?id=") + i2 + dl + p2;
|
|
3558
3558
|
f2.parentNode.insertBefore(j2, f2);
|
|
3559
3559
|
})(window, document, "script", dataLayerName, containerId);
|
|
3560
3560
|
initializedDataLayerName = dataLayerName;
|
|
@@ -3648,10 +3648,10 @@ function googleAnalytics4(pluginConfig = {}) {
|
|
|
3648
3648
|
var setParams = {};
|
|
3649
3649
|
if (config2.customDimensions) {
|
|
3650
3650
|
var customMap = {};
|
|
3651
|
-
for (var
|
|
3652
|
-
var customDim = config2.customDimensions[
|
|
3651
|
+
for (var i2 = 0; i2 < config2.customDimensions.length; i2++) {
|
|
3652
|
+
var customDim = config2.customDimensions[i2];
|
|
3653
3653
|
configParams[customDim.name] = customDim.callback(instance, config2);
|
|
3654
|
-
customMap["dimension" + (
|
|
3654
|
+
customMap["dimension" + (i2 + 1)] = customDim.name;
|
|
3655
3655
|
}
|
|
3656
3656
|
setParams["custom_map"] = customMap;
|
|
3657
3657
|
}
|
|
@@ -3669,32 +3669,52 @@ function googleAnalytics4(pluginConfig = {}) {
|
|
|
3669
3669
|
}
|
|
3670
3670
|
};
|
|
3671
3671
|
}
|
|
3672
|
-
var l = typeof self == "object" && self.self === self && self || typeof global == "object" && global.global === global && global || void 0, e = "undefined";
|
|
3673
|
-
function o(e2) {
|
|
3674
|
-
return l[e2];
|
|
3675
|
-
}
|
|
3676
|
-
function f(e2, o2) {
|
|
3677
|
-
return l[e2] = o2, o2;
|
|
3678
|
-
}
|
|
3679
|
-
function n(l2) {
|
|
3680
|
-
f(l2);
|
|
3681
|
-
}
|
|
3682
3672
|
var urlParams = new URLSearchParams(window.location.search);
|
|
3683
3673
|
var DEBUG = urlParams.get("zdbg");
|
|
3674
|
+
var zarGlobal = {};
|
|
3675
|
+
const undef = "undefined";
|
|
3684
3676
|
function dbg() {
|
|
3685
3677
|
if (DEBUG != 1)
|
|
3686
3678
|
return;
|
|
3687
3679
|
console.debug(...arguments);
|
|
3688
3680
|
}
|
|
3681
|
+
function warning(msg2) {
|
|
3682
|
+
console.warn(msg2);
|
|
3683
|
+
if (window.Rollbar) {
|
|
3684
|
+
window.Rollbar.warning(msg2);
|
|
3685
|
+
}
|
|
3686
|
+
}
|
|
3687
|
+
function isFunc(value) {
|
|
3688
|
+
return value && (Object.prototype.toString.call(value) === "[object Function]" || typeof value === "function" || value instanceof Function);
|
|
3689
|
+
}
|
|
3690
|
+
function isBot() {
|
|
3691
|
+
var ua = navigator.userAgent || "";
|
|
3692
|
+
var bots = new RegExp([
|
|
3693
|
+
/bot/,
|
|
3694
|
+
/spider/,
|
|
3695
|
+
/crawl/,
|
|
3696
|
+
/mediapartners/,
|
|
3697
|
+
/Google-Read-Aloud/,
|
|
3698
|
+
/semrush/
|
|
3699
|
+
].map((r2) => r2.source).join("|"), "i");
|
|
3700
|
+
return bots.test(ua);
|
|
3701
|
+
}
|
|
3702
|
+
function afterDOMContentLoaded(func) {
|
|
3703
|
+
if (document.readyState === "complete" || document.readyState === "loaded" || document.readyState === "interactive") {
|
|
3704
|
+
func();
|
|
3705
|
+
} else {
|
|
3706
|
+
window.addEventListener("DOMContentLoaded", func);
|
|
3707
|
+
}
|
|
3708
|
+
}
|
|
3689
3709
|
var supportsSessionStorage = hasSessionStorage();
|
|
3690
3710
|
function hasSessionStorage() {
|
|
3691
|
-
if (typeof supportsSessionStorage !==
|
|
3711
|
+
if (typeof supportsSessionStorage !== undef) {
|
|
3692
3712
|
return supportsSessionStorage;
|
|
3693
3713
|
}
|
|
3694
3714
|
supportsSessionStorage = true;
|
|
3695
3715
|
try {
|
|
3696
|
-
sessionStorage.setItem(
|
|
3697
|
-
sessionStorage.removeItem(
|
|
3716
|
+
sessionStorage.setItem(undef, undef);
|
|
3717
|
+
sessionStorage.removeItem(undef);
|
|
3698
3718
|
} catch (e2) {
|
|
3699
3719
|
supportsSessionStorage = false;
|
|
3700
3720
|
}
|
|
@@ -3702,7 +3722,7 @@ function hasSessionStorage() {
|
|
|
3702
3722
|
}
|
|
3703
3723
|
function getSessionStorage(key) {
|
|
3704
3724
|
var value;
|
|
3705
|
-
var globalValue =
|
|
3725
|
+
var globalValue = zarGlobal[key];
|
|
3706
3726
|
if (supportsSessionStorage) {
|
|
3707
3727
|
value = sessionStorage.getItem(key);
|
|
3708
3728
|
if (!value && globalValue) {
|
|
@@ -3719,36 +3739,15 @@ function setSessionStorage(key, value) {
|
|
|
3719
3739
|
if (supportsSessionStorage) {
|
|
3720
3740
|
sessionStorage.setItem(key, value_str);
|
|
3721
3741
|
}
|
|
3722
|
-
|
|
3742
|
+
zarGlobal[key] = value_str;
|
|
3723
3743
|
}
|
|
3724
3744
|
function removeSessionStorage(key) {
|
|
3725
3745
|
if (supportsSessionStorage) {
|
|
3726
3746
|
sessionStorage.removeItem(key);
|
|
3727
3747
|
}
|
|
3728
|
-
|
|
3729
|
-
}
|
|
3730
|
-
var lut = [];
|
|
3731
|
-
for (var i = 0; i < 256; i++) {
|
|
3732
|
-
lut[i] = (i < 16 ? "0" : "") + i.toString(16);
|
|
3733
|
-
}
|
|
3734
|
-
function uuid() {
|
|
3735
|
-
var d0 = Math.random() * 4294967296 >>> 0;
|
|
3736
|
-
var d1 = Math.random() * 4294967296 >>> 0;
|
|
3737
|
-
var d2 = Math.random() * 4294967296 >>> 0;
|
|
3738
|
-
var d3 = Math.random() * 4294967296 >>> 0;
|
|
3739
|
-
return lut[d0 & 255] + lut[d0 >> 8 & 255] + lut[d0 >> 16 & 255] + lut[d0 >> 24 & 255] + "-" + lut[d1 & 255] + lut[d1 >> 8 & 255] + "-" + lut[d1 >> 16 & 15 | 64] + lut[d1 >> 24 & 255] + "-" + lut[d2 & 63 | 128] + lut[d2 >> 8 & 255] + "-" + lut[d2 >> 16 & 255] + lut[d2 >> 24 & 255] + lut[d3 & 255] + lut[d3 >> 8 & 255] + lut[d3 >> 16 & 255] + lut[d3 >> 24 & 255];
|
|
3740
|
-
}
|
|
3741
|
-
var inBrowser = typeof document !== "undefined";
|
|
3742
|
-
function decode(s2) {
|
|
3743
|
-
try {
|
|
3744
|
-
return decodeURIComponent(s2.replace(/\+/g, " "));
|
|
3745
|
-
} catch (e2) {
|
|
3746
|
-
return null;
|
|
3747
|
-
}
|
|
3748
|
+
delete zarGlobal[key];
|
|
3748
3749
|
}
|
|
3749
3750
|
function hasAdBlock() {
|
|
3750
|
-
if (!inBrowser)
|
|
3751
|
-
return false;
|
|
3752
3751
|
var fakeAd = document.createElement("div");
|
|
3753
3752
|
fakeAd.innerHTML = " ";
|
|
3754
3753
|
fakeAd.className = "pub_300x250 pub_300x250m pub_728x90 text-ad textAd text_ad text_ads text-ads text-ad-links";
|
|
@@ -3769,52 +3768,6 @@ function hasAdBlock() {
|
|
|
3769
3768
|
}
|
|
3770
3769
|
return false;
|
|
3771
3770
|
}
|
|
3772
|
-
function getSearchString(url) {
|
|
3773
|
-
if (url) {
|
|
3774
|
-
var p2 = url.match(/\?(.*)/);
|
|
3775
|
-
return p2 && p2[1] ? p2[1].split("#")[0] : "";
|
|
3776
|
-
}
|
|
3777
|
-
return inBrowser && window.location.search.substring(1);
|
|
3778
|
-
}
|
|
3779
|
-
function paramsParse(url) {
|
|
3780
|
-
return getParamsAsObject(getSearchString(url));
|
|
3781
|
-
}
|
|
3782
|
-
function getParamsAsObject(query) {
|
|
3783
|
-
var params = {};
|
|
3784
|
-
var temp;
|
|
3785
|
-
var re = /([^&=]+)=?([^&]*)/g;
|
|
3786
|
-
while (temp = re.exec(query)) {
|
|
3787
|
-
var k2 = decode(temp[1]);
|
|
3788
|
-
var v = decode(temp[2]);
|
|
3789
|
-
if (k2.substring(k2.length - 2) === "[]") {
|
|
3790
|
-
k2 = k2.substring(0, k2.length - 2);
|
|
3791
|
-
(params[k2] || (params[k2] = [])).push(v);
|
|
3792
|
-
} else {
|
|
3793
|
-
params[k2] = v === "" ? true : v;
|
|
3794
|
-
}
|
|
3795
|
-
}
|
|
3796
|
-
for (var prop in params) {
|
|
3797
|
-
var arr = prop.split("[");
|
|
3798
|
-
if (arr.length > 1) {
|
|
3799
|
-
assign(params, arr.map(function(x2) {
|
|
3800
|
-
return x2.replace(/[?[\]\\ ]/g, "");
|
|
3801
|
-
}), params[prop]);
|
|
3802
|
-
delete params[prop];
|
|
3803
|
-
}
|
|
3804
|
-
}
|
|
3805
|
-
return params;
|
|
3806
|
-
}
|
|
3807
|
-
function assign(obj, keyPath, value) {
|
|
3808
|
-
var lastKeyIndex = keyPath.length - 1;
|
|
3809
|
-
for (var i = 0; i < lastKeyIndex; ++i) {
|
|
3810
|
-
var key = keyPath[i];
|
|
3811
|
-
if (!(key in obj)) {
|
|
3812
|
-
obj[key] = {};
|
|
3813
|
-
}
|
|
3814
|
-
obj = obj[key];
|
|
3815
|
-
}
|
|
3816
|
-
obj[keyPath[lastKeyIndex]] = value;
|
|
3817
|
-
}
|
|
3818
3771
|
function makeRequest({ method, url, data, json = true }) {
|
|
3819
3772
|
return new Promise(function(resolve, reject) {
|
|
3820
3773
|
var xhr = new XMLHttpRequest();
|
|
@@ -3860,11 +3813,13 @@ function postBeacon(_0) {
|
|
|
3860
3813
|
return __async(this, arguments, function* ({ url, data }) {
|
|
3861
3814
|
if (window && window.navigator && typeof window.navigator.sendBeacon === "function" && typeof window.Blob === "function") {
|
|
3862
3815
|
try {
|
|
3863
|
-
|
|
3816
|
+
const blob = new Blob([JSON.stringify(data)], { type: "text/plain; charset=UTF-8" });
|
|
3817
|
+
if (window.navigator.sendBeacon(url, blob)) {
|
|
3864
3818
|
return true;
|
|
3865
3819
|
}
|
|
3866
3820
|
return false;
|
|
3867
3821
|
} catch (e2) {
|
|
3822
|
+
warning("postBeacon:");
|
|
3868
3823
|
return false;
|
|
3869
3824
|
}
|
|
3870
3825
|
}
|
|
@@ -3896,23 +3851,14 @@ function httpPost(_0) {
|
|
|
3896
3851
|
return yield makeRequest({ method: "POST", url, data: finalData, json });
|
|
3897
3852
|
});
|
|
3898
3853
|
}
|
|
3899
|
-
var CID_KEY = "__zar_cid";
|
|
3900
|
-
var SID_KEY = "__zar_sid";
|
|
3901
3854
|
var VID_KEY = "__zar_vid";
|
|
3902
|
-
var NUMBER_POOL_KEY = "__zar_pool";
|
|
3903
3855
|
var NUMBER_POOL_SUCCESS = "success";
|
|
3904
3856
|
var NUMBER_POOL_ERROR = "error";
|
|
3905
3857
|
var NUMBER_POOL_RENEWAL_TIME_MS = 30 * 1e3;
|
|
3906
|
-
var
|
|
3907
|
-
var
|
|
3908
|
-
var
|
|
3858
|
+
var getNumberFailureCount = 0;
|
|
3859
|
+
var MAX_GET_NUMBER_FAILURES = 3;
|
|
3860
|
+
var poolIntervals = {};
|
|
3909
3861
|
var numberOverlayMap = /* @__PURE__ */ new Map();
|
|
3910
|
-
function generateClientId() {
|
|
3911
|
-
return uuid();
|
|
3912
|
-
}
|
|
3913
|
-
function generateSessionId() {
|
|
3914
|
-
return uuid();
|
|
3915
|
-
}
|
|
3916
3862
|
function generateVisitId() {
|
|
3917
3863
|
return Date.now().toString(36) + "." + Math.random().toString(36).substring(2);
|
|
3918
3864
|
}
|
|
@@ -3925,7 +3871,7 @@ function initId(key, generator, getter, setter) {
|
|
|
3925
3871
|
id = generator();
|
|
3926
3872
|
origReferrer = document.referrer;
|
|
3927
3873
|
isNew = true;
|
|
3928
|
-
dbg("
|
|
3874
|
+
dbg("new ID for", key, "-", id);
|
|
3929
3875
|
} else {
|
|
3930
3876
|
id = idObj.id;
|
|
3931
3877
|
origReferrer = idObj.origReferrer;
|
|
@@ -3934,11 +3880,9 @@ function initId(key, generator, getter, setter) {
|
|
|
3934
3880
|
setter(key, result);
|
|
3935
3881
|
return result;
|
|
3936
3882
|
}
|
|
3937
|
-
function
|
|
3883
|
+
function initIDs() {
|
|
3938
3884
|
var vidResult = initId(VID_KEY, generateVisitId, getSessionStorage, setSessionStorage);
|
|
3939
|
-
|
|
3940
|
-
var cidResult = initId(CID_KEY, generateClientId, getSessionStorage, setSessionStorage);
|
|
3941
|
-
return { cid: cidResult.id, sid: sidResult.id, vid: vidResult.id };
|
|
3885
|
+
return { vid: vidResult };
|
|
3942
3886
|
}
|
|
3943
3887
|
function getDefaultApiUrl() {
|
|
3944
3888
|
return window.location.host + "/api/v1";
|
|
@@ -3952,58 +3896,19 @@ function getID(key) {
|
|
|
3952
3896
|
}
|
|
3953
3897
|
function getStorage() {
|
|
3954
3898
|
return {
|
|
3955
|
-
cid: getIDObj(CID_KEY),
|
|
3956
|
-
sid: getIDObj(SID_KEY),
|
|
3957
3899
|
vid: getIDObj(VID_KEY)
|
|
3958
3900
|
};
|
|
3959
3901
|
}
|
|
3960
|
-
function
|
|
3902
|
+
function getIDs() {
|
|
3961
3903
|
return {
|
|
3962
|
-
cid: getID(CID_KEY),
|
|
3963
|
-
sid: getID(SID_KEY),
|
|
3964
3904
|
vid: getID(VID_KEY)
|
|
3965
3905
|
};
|
|
3966
3906
|
}
|
|
3967
|
-
function updateID(key, val) {
|
|
3968
|
-
var obj = getIDObj(key);
|
|
3969
|
-
if (!obj) {
|
|
3970
|
-
console.warn("could not update " + key);
|
|
3971
|
-
return;
|
|
3972
|
-
}
|
|
3973
|
-
obj.id = val;
|
|
3974
|
-
setSessionStorage(key, obj);
|
|
3975
|
-
}
|
|
3976
3907
|
function removeID(key) {
|
|
3977
3908
|
removeSessionStorage(key);
|
|
3978
3909
|
}
|
|
3979
|
-
function
|
|
3910
|
+
function removeIDs() {
|
|
3980
3911
|
removeID(VID_KEY);
|
|
3981
|
-
removeID(SID_KEY);
|
|
3982
|
-
removeID(CID_KEY);
|
|
3983
|
-
}
|
|
3984
|
-
function getPoolNumber(_0) {
|
|
3985
|
-
return __async(this, arguments, function* ({ poolId, apiUrl, number = null, context: context2 = null }) {
|
|
3986
|
-
var payload = {
|
|
3987
|
-
pool_id: poolId,
|
|
3988
|
-
number,
|
|
3989
|
-
context: context2,
|
|
3990
|
-
properties: {
|
|
3991
|
-
zar: getStorage()
|
|
3992
|
-
}
|
|
3993
|
-
};
|
|
3994
|
-
var resp = yield httpPost({ url: `${apiUrl}/number_pool`, data: payload });
|
|
3995
|
-
return resp;
|
|
3996
|
-
});
|
|
3997
|
-
}
|
|
3998
|
-
function getPoolStats(_0) {
|
|
3999
|
-
return __async(this, arguments, function* ({ apiUrl, key = null, with_contexts = false }) {
|
|
4000
|
-
var params = {
|
|
4001
|
-
key,
|
|
4002
|
-
with_contexts
|
|
4003
|
-
};
|
|
4004
|
-
var resp = yield httpGet({ url: `${apiUrl}/number_pool_stats`, params });
|
|
4005
|
-
return resp;
|
|
4006
|
-
});
|
|
4007
3912
|
}
|
|
4008
3913
|
function extractPhoneNumber({ elem }) {
|
|
4009
3914
|
var numberText = null;
|
|
@@ -4028,194 +3933,218 @@ function overlayPhoneNumber({ elems, number }) {
|
|
|
4028
3933
|
if (!number.startsWith("+1")) {
|
|
4029
3934
|
overlayNum = "+1" + number;
|
|
4030
3935
|
}
|
|
4031
|
-
for (var
|
|
4032
|
-
if (numberOverlayMap.has(elems[
|
|
4033
|
-
dbg("
|
|
3936
|
+
for (var i2 = 0; i2 < elems.length; i2++) {
|
|
3937
|
+
if (numberOverlayMap.has(elems[i2])) {
|
|
3938
|
+
dbg("element already in overlay map:", elems[i2]);
|
|
4034
3939
|
continue;
|
|
4035
3940
|
}
|
|
4036
|
-
var elemNum = extractPhoneNumber({ elem: elems[
|
|
3941
|
+
var elemNum = extractPhoneNumber({ elem: elems[i2] });
|
|
4037
3942
|
if (!origNum) {
|
|
4038
3943
|
origNum = elemNum;
|
|
4039
3944
|
} else if (elemNum.number && origNum.number && origNum.number !== elemNum.number) {
|
|
4040
|
-
|
|
3945
|
+
warning("overlaying multiple numbers with a single number", origNum.number, elemNum.number);
|
|
4041
3946
|
}
|
|
4042
|
-
dbg("
|
|
4043
|
-
numberOverlayMap.set(elems[
|
|
3947
|
+
dbg("overlaying", overlayNum, "on", elems[i2]);
|
|
3948
|
+
numberOverlayMap.set(elems[i2], elemNum);
|
|
4044
3949
|
if (elemNum.href) {
|
|
4045
|
-
elems[
|
|
3950
|
+
elems[i2].href = "tel:" + overlayNum;
|
|
4046
3951
|
}
|
|
4047
3952
|
if (elemNum.numberText) {
|
|
4048
|
-
elems[
|
|
3953
|
+
elems[i2].innerHTML = "";
|
|
4049
3954
|
if (elemNum.text) {
|
|
4050
3955
|
var overlay = overlayNum;
|
|
4051
3956
|
if (elemNum.numberText.indexOf("-") > -1) {
|
|
4052
3957
|
overlay = overlayNum.slice(2, 5) + "-" + overlayNum.slice(5, 8) + "-" + overlayNum.slice(8, 12);
|
|
4053
3958
|
}
|
|
4054
|
-
|
|
4055
|
-
|
|
3959
|
+
if (elemNum.html.indexOf("<img") > -1) {
|
|
3960
|
+
var numberHtml = elemNum.html.replace(elemNum.numberText, overlay);
|
|
3961
|
+
elems[i2].innerHTML = numberHtml;
|
|
3962
|
+
} else {
|
|
3963
|
+
var numberText = elemNum.text.replace(elemNum.numberText, overlay);
|
|
3964
|
+
elems[i2].appendChild(document.createTextNode(numberText));
|
|
3965
|
+
}
|
|
4056
3966
|
} else {
|
|
4057
|
-
elems[
|
|
3967
|
+
elems[i2].appendChild(document.createTextNode(overlayNum));
|
|
4058
3968
|
}
|
|
4059
3969
|
} else {
|
|
4060
|
-
dbg("
|
|
3970
|
+
dbg("no number text found:", elems[i2]);
|
|
4061
3971
|
}
|
|
4062
3972
|
}
|
|
4063
3973
|
}
|
|
4064
3974
|
function revertOverlayNumbers({ elems }) {
|
|
4065
|
-
for (var
|
|
4066
|
-
if (numberOverlayMap.has(elems[
|
|
4067
|
-
var currentHTML = elems[
|
|
4068
|
-
var origElemData = numberOverlayMap.get(elems[
|
|
3975
|
+
for (var i2 = 0; i2 < elems.length; i2++) {
|
|
3976
|
+
if (numberOverlayMap.has(elems[i2])) {
|
|
3977
|
+
var currentHTML = elems[i2].innerHTML;
|
|
3978
|
+
var origElemData = numberOverlayMap.get(elems[i2]);
|
|
4069
3979
|
dbg("orig:", origElemData);
|
|
4070
3980
|
var origHTML = origElemData.html;
|
|
4071
|
-
dbg("
|
|
4072
|
-
elems[
|
|
3981
|
+
dbg("reverting", currentHTML, "to", origHTML);
|
|
3982
|
+
elems[i2].innerHTML = origHTML;
|
|
4073
3983
|
if (origElemData.href) {
|
|
4074
|
-
elems[
|
|
3984
|
+
elems[i2].href = origElemData.href;
|
|
4075
3985
|
}
|
|
4076
|
-
numberOverlayMap.delete(elems[
|
|
3986
|
+
numberOverlayMap.delete(elems[i2]);
|
|
4077
3987
|
} else {
|
|
4078
|
-
dbg("
|
|
3988
|
+
dbg("element not in map:", elems[i2]);
|
|
4079
3989
|
}
|
|
4080
3990
|
}
|
|
4081
3991
|
}
|
|
4082
|
-
function
|
|
4083
|
-
|
|
4084
|
-
|
|
3992
|
+
function clearPoolInterval(poolId) {
|
|
3993
|
+
clearInterval(poolIntervals[poolId]);
|
|
3994
|
+
delete poolIntervals[poolId];
|
|
4085
3995
|
}
|
|
4086
|
-
function clearPoolIntervals(
|
|
4087
|
-
|
|
4088
|
-
|
|
4089
|
-
}
|
|
4090
|
-
for (var poolId in poolData.poolNumbers) {
|
|
4091
|
-
clearInterval(poolData.poolNumbers[poolId].interval);
|
|
3996
|
+
function clearPoolIntervals() {
|
|
3997
|
+
for (var poolId in poolIntervals) {
|
|
3998
|
+
clearPoolInterval(poolId);
|
|
4092
3999
|
}
|
|
4093
4000
|
}
|
|
4094
|
-
function
|
|
4095
|
-
|
|
4096
|
-
|
|
4097
|
-
|
|
4098
|
-
|
|
4001
|
+
function getPoolNumber(_0) {
|
|
4002
|
+
return __async(this, arguments, function* ({ poolId, apiUrl, number = null, context: context2 = null }) {
|
|
4003
|
+
var payload = {
|
|
4004
|
+
pool_id: poolId,
|
|
4005
|
+
number,
|
|
4006
|
+
context: context2,
|
|
4007
|
+
properties: {
|
|
4008
|
+
zar: getStorage()
|
|
4009
|
+
}
|
|
4010
|
+
};
|
|
4011
|
+
var resp = yield httpPost({ url: `${apiUrl}/number_pool`, data: payload });
|
|
4012
|
+
return resp;
|
|
4013
|
+
});
|
|
4099
4014
|
}
|
|
4100
|
-
function
|
|
4101
|
-
return
|
|
4015
|
+
function getPoolStats(_0) {
|
|
4016
|
+
return __async(this, arguments, function* ({ apiUrl, key = null, with_contexts = false }) {
|
|
4017
|
+
var params = {
|
|
4018
|
+
key,
|
|
4019
|
+
with_contexts
|
|
4020
|
+
};
|
|
4021
|
+
var resp = yield httpGet({ url: `${apiUrl}/number_pool_stats`, params });
|
|
4022
|
+
return resp;
|
|
4023
|
+
});
|
|
4102
4024
|
}
|
|
4103
|
-
function
|
|
4025
|
+
function renewTrackingPool() {
|
|
4104
4026
|
return __async(this, arguments, function* ({
|
|
4105
4027
|
poolId,
|
|
4028
|
+
number,
|
|
4106
4029
|
overlayElements,
|
|
4107
4030
|
apiUrl = getDefaultApiUrl(),
|
|
4108
|
-
|
|
4109
|
-
renew = true,
|
|
4110
|
-
renewalInterval = NUMBER_POOL_RENEWAL_TIME_MS,
|
|
4111
|
-
callback = null
|
|
4031
|
+
contextCallback = null
|
|
4112
4032
|
} = {}) {
|
|
4113
|
-
var
|
|
4114
|
-
|
|
4115
|
-
|
|
4116
|
-
if (!expired) {
|
|
4117
|
-
if (seshData && seshData.poolEnabled) {
|
|
4118
|
-
poolEnabled = true;
|
|
4119
|
-
} else {
|
|
4120
|
-
var params = paramsParse(window.location.search);
|
|
4121
|
-
if (urlParam in params && params[urlParam] === "1") {
|
|
4122
|
-
poolEnabled = true;
|
|
4123
|
-
}
|
|
4124
|
-
}
|
|
4125
|
-
} else {
|
|
4126
|
-
clearPoolIntervals(seshData);
|
|
4127
|
-
removePoolSession({ overlayElements });
|
|
4128
|
-
}
|
|
4129
|
-
if (!poolEnabled) {
|
|
4130
|
-
dbg("pool: not enabled");
|
|
4131
|
-
if (callback) {
|
|
4132
|
-
callback(null);
|
|
4133
|
-
}
|
|
4134
|
-
return null;
|
|
4135
|
-
}
|
|
4136
|
-
var seshNumber = null;
|
|
4137
|
-
var seshInterval = null;
|
|
4138
|
-
if (seshData && seshData.poolNumbers && seshData.poolNumbers[poolId]) {
|
|
4139
|
-
var poolResult = seshData.poolNumbers[poolId];
|
|
4140
|
-
seshInterval = poolResult.interval;
|
|
4141
|
-
if (poolResult.status !== NUMBER_POOL_SUCCESS) {
|
|
4142
|
-
dbg("pool: returning cached unsuccessful pool result: " + JSON.stringify(poolResult));
|
|
4143
|
-
if (callback) {
|
|
4144
|
-
callback(poolResult);
|
|
4145
|
-
}
|
|
4146
|
-
return poolResult;
|
|
4147
|
-
}
|
|
4148
|
-
if (poolResult.number) {
|
|
4149
|
-
seshNumber = poolResult.number;
|
|
4150
|
-
dbg("pool: found session number " + seshNumber);
|
|
4151
|
-
}
|
|
4033
|
+
var context2 = {};
|
|
4034
|
+
if (contextCallback) {
|
|
4035
|
+
context2 = contextCallback() || {};
|
|
4152
4036
|
}
|
|
4153
|
-
var resp = {};
|
|
4154
4037
|
try {
|
|
4155
|
-
resp = yield getPoolNumber({ poolId, apiUrl, number
|
|
4038
|
+
var resp = yield getPoolNumber({ poolId, apiUrl, number, context: context2 });
|
|
4156
4039
|
} catch (e2) {
|
|
4157
|
-
var msg2 = "
|
|
4158
|
-
|
|
4159
|
-
|
|
4160
|
-
|
|
4161
|
-
|
|
4162
|
-
|
|
4163
|
-
|
|
4164
|
-
|
|
4040
|
+
var msg2 = "error getting number: " + JSON.stringify(e2);
|
|
4041
|
+
warning(msg2);
|
|
4042
|
+
getNumberFailureCount++;
|
|
4043
|
+
if (getNumberFailureCount >= MAX_GET_NUMBER_FAILURES) {
|
|
4044
|
+
warning("max failures, stopping pool");
|
|
4045
|
+
clearPoolIntervals();
|
|
4046
|
+
if (overlayElements) {
|
|
4047
|
+
revertOverlayNumbers({ elems: overlayElements });
|
|
4048
|
+
}
|
|
4165
4049
|
}
|
|
4166
|
-
return
|
|
4050
|
+
return { status: NUMBER_POOL_ERROR, msg: msg2 };
|
|
4167
4051
|
}
|
|
4168
4052
|
if (resp.status === NUMBER_POOL_SUCCESS && resp.number) {
|
|
4169
4053
|
if (overlayElements) {
|
|
4170
4054
|
overlayPhoneNumber({ elems: overlayElements, number: resp.number });
|
|
4171
4055
|
}
|
|
4172
|
-
if (renew) {
|
|
4173
|
-
dbg("pool: setting up renewal");
|
|
4174
|
-
resp.interval = setInterval(function() {
|
|
4175
|
-
initTrackingPool({ poolId, overlayElements, apiUrl, urlParam, renew: false });
|
|
4176
|
-
}, renewalInterval);
|
|
4177
|
-
}
|
|
4178
4056
|
} else {
|
|
4179
4057
|
if (overlayElements) {
|
|
4180
4058
|
revertOverlayNumbers({ elems: overlayElements });
|
|
4181
4059
|
}
|
|
4182
|
-
if (
|
|
4183
|
-
clearInterval(
|
|
4060
|
+
if (poolIntervals[poolId]) {
|
|
4061
|
+
clearInterval(poolIntervals[poolId]);
|
|
4062
|
+
delete poolIntervals[poolId];
|
|
4184
4063
|
}
|
|
4185
|
-
resp.interval = null;
|
|
4186
4064
|
}
|
|
4187
|
-
|
|
4188
|
-
|
|
4189
|
-
|
|
4190
|
-
|
|
4191
|
-
|
|
4065
|
+
return resp;
|
|
4066
|
+
});
|
|
4067
|
+
}
|
|
4068
|
+
function getPoolId(poolId) {
|
|
4069
|
+
if (isFunc(poolId))
|
|
4070
|
+
return poolId();
|
|
4071
|
+
return poolId;
|
|
4072
|
+
}
|
|
4073
|
+
function initTrackingPool() {
|
|
4074
|
+
return __async(this, arguments, function* ({ poolData, poolConfig, apiUrl } = {}) {
|
|
4075
|
+
var msg2;
|
|
4076
|
+
if (!poolConfig || !poolConfig.poolId || !poolConfig.overlayQuerySelector || !apiUrl) {
|
|
4077
|
+
msg2 = "missing pool config: " + JSON.stringify(poolConfig);
|
|
4078
|
+
warning(msg2);
|
|
4079
|
+
if (poolConfig.initCallback) {
|
|
4080
|
+
poolConfig.initCallback({ status: NUMBER_POOL_ERROR, msg: msg2 });
|
|
4192
4081
|
}
|
|
4193
|
-
|
|
4194
|
-
|
|
4082
|
+
return poolIntervals;
|
|
4083
|
+
}
|
|
4084
|
+
var context2 = {};
|
|
4085
|
+
if (poolConfig.contextCallback) {
|
|
4086
|
+
context2 = poolConfig.contextCallback() || {};
|
|
4087
|
+
}
|
|
4088
|
+
var poolId = getPoolId(poolConfig.poolId);
|
|
4089
|
+
if (!poolId) {
|
|
4090
|
+
msg2 = "no pool ID";
|
|
4091
|
+
warning(msg2);
|
|
4092
|
+
if (poolConfig.initCallback) {
|
|
4093
|
+
poolConfig.initCallback({ status: NUMBER_POOL_ERROR, msg: msg2 });
|
|
4195
4094
|
}
|
|
4196
|
-
|
|
4197
|
-
var poolNumbers = {};
|
|
4198
|
-
poolNumbers[poolId] = resp;
|
|
4199
|
-
seshData = {
|
|
4200
|
-
poolEnabled: true,
|
|
4201
|
-
poolNumbers,
|
|
4202
|
-
t: Date.now()
|
|
4203
|
-
};
|
|
4095
|
+
return poolIntervals;
|
|
4204
4096
|
}
|
|
4205
|
-
|
|
4206
|
-
|
|
4207
|
-
|
|
4208
|
-
|
|
4097
|
+
if (!poolData) {
|
|
4098
|
+
try {
|
|
4099
|
+
poolData = yield getPoolNumber({ poolId, apiUrl, number: null, context: context2 });
|
|
4100
|
+
} catch (e2) {
|
|
4101
|
+
msg2 = "error getting number on init: " + JSON.stringify(e2);
|
|
4102
|
+
warning(msg2);
|
|
4103
|
+
if (poolConfig.initCallback) {
|
|
4104
|
+
poolConfig.initCallback({ status: NUMBER_POOL_ERROR, msg: msg2 });
|
|
4105
|
+
}
|
|
4106
|
+
return poolIntervals;
|
|
4107
|
+
}
|
|
4209
4108
|
}
|
|
4210
|
-
|
|
4109
|
+
if (poolData && poolData.status === NUMBER_POOL_SUCCESS && poolData.number) {
|
|
4110
|
+
afterDOMContentLoaded(function() {
|
|
4111
|
+
var overlayElements = document.querySelectorAll(poolConfig.overlayQuerySelector);
|
|
4112
|
+
if (!overlayElements) {
|
|
4113
|
+
var msg3 = "No elems found for:" + poolConfig.overlayQuerySelector;
|
|
4114
|
+
warning(msg3);
|
|
4115
|
+
if (poolConfig.initCallback) {
|
|
4116
|
+
poolConfig.initCallback({ status: NUMBER_POOL_ERROR, msg: msg3 });
|
|
4117
|
+
}
|
|
4118
|
+
return;
|
|
4119
|
+
}
|
|
4120
|
+
overlayPhoneNumber({ elems: overlayElements, number: poolData.number });
|
|
4121
|
+
var interval = setInterval(function() {
|
|
4122
|
+
try {
|
|
4123
|
+
renewTrackingPool({
|
|
4124
|
+
poolId: poolData.pool_id,
|
|
4125
|
+
number: poolData.number,
|
|
4126
|
+
overlayElements,
|
|
4127
|
+
apiUrl,
|
|
4128
|
+
contextCallback: poolConfig.contextCallback
|
|
4129
|
+
});
|
|
4130
|
+
} catch (e2) {
|
|
4131
|
+
var msg4 = "error on interval: " + JSON.stringify(e2);
|
|
4132
|
+
warning(msg4);
|
|
4133
|
+
}
|
|
4134
|
+
}, poolConfig.renewalInterval || NUMBER_POOL_RENEWAL_TIME_MS);
|
|
4135
|
+
poolIntervals[poolData.pool_id] = interval;
|
|
4136
|
+
if (poolConfig.initCallback) {
|
|
4137
|
+
poolConfig.initCallback(poolData);
|
|
4138
|
+
}
|
|
4139
|
+
});
|
|
4140
|
+
}
|
|
4141
|
+
return poolIntervals;
|
|
4211
4142
|
});
|
|
4212
4143
|
}
|
|
4213
|
-
function zar({ apiUrl }) {
|
|
4144
|
+
function zar({ apiUrl, poolConfig }) {
|
|
4214
4145
|
return {
|
|
4215
4146
|
name: "zar",
|
|
4216
|
-
config: {
|
|
4217
|
-
apiUrl
|
|
4218
|
-
},
|
|
4147
|
+
config: { apiUrl, poolConfig },
|
|
4219
4148
|
initialize: function({ config: config2 }) {
|
|
4220
4149
|
},
|
|
4221
4150
|
loaded: function() {
|
|
@@ -4223,6 +4152,8 @@ function zar({ apiUrl }) {
|
|
|
4223
4152
|
},
|
|
4224
4153
|
pageStart: function({ payload, config: config2, instance }) {
|
|
4225
4154
|
payload.properties.zar = getStorage();
|
|
4155
|
+
payload.properties.referrer = document.referrer;
|
|
4156
|
+
payload.properties.is_bot = isBot();
|
|
4226
4157
|
if ("hash" in payload.properties) {
|
|
4227
4158
|
delete payload.properties["hash"];
|
|
4228
4159
|
}
|
|
@@ -4232,79 +4163,82 @@ function zar({ apiUrl }) {
|
|
|
4232
4163
|
if ("search" in payload.properties) {
|
|
4233
4164
|
delete payload.properties["search"];
|
|
4234
4165
|
}
|
|
4235
|
-
|
|
4236
|
-
|
|
4237
|
-
|
|
4238
|
-
payload.properties.zar = getStorage();
|
|
4239
|
-
payload.properties.url = window.location.href;
|
|
4166
|
+
if (config2.poolConfig && config2.poolConfig.poolId) {
|
|
4167
|
+
payload.properties.pool_id = getPoolId(config2.poolConfig.poolId);
|
|
4168
|
+
}
|
|
4240
4169
|
return payload;
|
|
4241
4170
|
},
|
|
4242
4171
|
page: function(_0) {
|
|
4243
4172
|
return __async(this, arguments, function* ({ payload, options, instance, config: config2 }) {
|
|
4244
4173
|
dbg("page", payload, options, config2);
|
|
4245
|
-
var
|
|
4246
|
-
if (
|
|
4247
|
-
|
|
4248
|
-
}
|
|
4249
|
-
if (result.cid) {
|
|
4250
|
-
updateID(CID_KEY, result.cid);
|
|
4251
|
-
instance.setAnonymousId(result.cid);
|
|
4174
|
+
var res = yield httpPost({ url: `${config2.apiUrl}/page`, data: payload });
|
|
4175
|
+
if (res.pool_data) {
|
|
4176
|
+
initTrackingPool({ poolData: res.pool_data, poolConfig: config2.poolConfig, apiUrl: config2.apiUrl });
|
|
4252
4177
|
}
|
|
4253
4178
|
});
|
|
4254
4179
|
},
|
|
4180
|
+
trackStart: function({ payload, config: config2, instance }) {
|
|
4181
|
+
payload.properties.zar = getStorage();
|
|
4182
|
+
payload.properties.url = window.location.href;
|
|
4183
|
+
payload.properties.referrer = document.referrer;
|
|
4184
|
+
return payload;
|
|
4185
|
+
},
|
|
4255
4186
|
track: function({ payload, options, instance, config: config2 }) {
|
|
4256
4187
|
dbg("track", payload);
|
|
4257
4188
|
httpPost({ url: `${config2.apiUrl}/track`, data: payload, beacon: true });
|
|
4258
4189
|
},
|
|
4259
4190
|
reset: function({ instance }) {
|
|
4260
|
-
|
|
4191
|
+
removeIDs();
|
|
4261
4192
|
},
|
|
4262
4193
|
bootstrap: function({ payload, config: config2, instance }) {
|
|
4263
|
-
|
|
4264
|
-
instance.setAnonymousId(result.cid);
|
|
4194
|
+
initIDs();
|
|
4265
4195
|
},
|
|
4266
4196
|
methods: {
|
|
4267
4197
|
apiUrl() {
|
|
4268
4198
|
return apiUrl;
|
|
4269
4199
|
},
|
|
4270
|
-
|
|
4271
|
-
|
|
4272
|
-
|
|
4273
|
-
|
|
4200
|
+
poolConfig() {
|
|
4201
|
+
return poolConfig;
|
|
4202
|
+
},
|
|
4203
|
+
initIDs() {
|
|
4204
|
+
return initIDs();
|
|
4274
4205
|
},
|
|
4275
|
-
|
|
4276
|
-
return
|
|
4206
|
+
getIDs() {
|
|
4207
|
+
return getIDs();
|
|
4277
4208
|
},
|
|
4278
4209
|
getStorage() {
|
|
4279
4210
|
return getStorage();
|
|
4280
4211
|
},
|
|
4281
|
-
getCID() {
|
|
4282
|
-
return getID(CID_KEY);
|
|
4283
|
-
},
|
|
4284
|
-
getSID() {
|
|
4285
|
-
return getID(SID_KEY);
|
|
4286
|
-
},
|
|
4287
4212
|
getVID() {
|
|
4288
4213
|
return getID(VID_KEY);
|
|
4289
4214
|
},
|
|
4290
4215
|
hasAdBlock() {
|
|
4291
4216
|
return hasAdBlock();
|
|
4292
4217
|
},
|
|
4293
|
-
|
|
4218
|
+
isBot() {
|
|
4219
|
+
return isBot();
|
|
4220
|
+
},
|
|
4221
|
+
initTrackingPool({ poolConfig: poolConfig2 }) {
|
|
4222
|
+
var plugin = this.instance.plugins.zar;
|
|
4294
4223
|
return initTrackingPool({
|
|
4295
|
-
|
|
4296
|
-
|
|
4297
|
-
apiUrl:
|
|
4298
|
-
urlParam,
|
|
4299
|
-
renew,
|
|
4300
|
-
renewalInterval,
|
|
4301
|
-
callback
|
|
4224
|
+
poolData: null,
|
|
4225
|
+
poolConfig: Object.assign(plugin.poolConfig(), poolConfig2 || {}),
|
|
4226
|
+
apiUrl: plugin.apiUrl()
|
|
4302
4227
|
});
|
|
4303
4228
|
},
|
|
4229
|
+
getPoolIntervals() {
|
|
4230
|
+
return poolIntervals;
|
|
4231
|
+
},
|
|
4232
|
+
clearPoolInterval({ poolId }) {
|
|
4233
|
+
clearPoolInterval(poolId);
|
|
4234
|
+
},
|
|
4235
|
+
clearPoolIntervals() {
|
|
4236
|
+
clearPoolIntervals();
|
|
4237
|
+
},
|
|
4304
4238
|
extractPhoneNumbers({ elems }) {
|
|
4305
4239
|
var res = [];
|
|
4306
|
-
for (var
|
|
4307
|
-
var elemRes = extractPhoneNumber({ elem: elems[
|
|
4240
|
+
for (var i2 = 0; i2 < elems.length; i2++) {
|
|
4241
|
+
var elemRes = extractPhoneNumber({ elem: elems[i2] });
|
|
4308
4242
|
res.push(elemRes);
|
|
4309
4243
|
}
|
|
4310
4244
|
return res;
|
|
@@ -4315,20 +4249,17 @@ function zar({ apiUrl }) {
|
|
|
4315
4249
|
revertOverlayNumbers({ overlayElements }) {
|
|
4316
4250
|
revertOverlayNumbers({ elems: overlayElements });
|
|
4317
4251
|
},
|
|
4318
|
-
removePoolSession({ overlayElements }) {
|
|
4319
|
-
removePoolSession({ overlayElements });
|
|
4320
|
-
},
|
|
4321
4252
|
getPoolStats({ key = null, with_contexts = false }) {
|
|
4322
4253
|
return getPoolStats({ apiUrl: this.instance.plugins.zar.apiUrl(), key, with_contexts });
|
|
4323
4254
|
}
|
|
4324
4255
|
}
|
|
4325
4256
|
};
|
|
4326
4257
|
}
|
|
4327
|
-
function init({ app, gtmConfig = null, ga4Config = null, apiUrl = null }) {
|
|
4258
|
+
function init({ app, gtmConfig = null, ga4Config = null, apiUrl = null, poolConfig = null }) {
|
|
4328
4259
|
if (!apiUrl) {
|
|
4329
4260
|
apiUrl = getDefaultApiUrl();
|
|
4330
4261
|
}
|
|
4331
|
-
var plugins = [zar({ apiUrl })];
|
|
4262
|
+
var plugins = [zar({ apiUrl, poolConfig })];
|
|
4332
4263
|
if (ga4Config) {
|
|
4333
4264
|
plugins.push(googleAnalytics4(ga4Config));
|
|
4334
4265
|
}
|
|
@@ -4338,3 +4269,4 @@ function init({ app, gtmConfig = null, ga4Config = null, apiUrl = null }) {
|
|
|
4338
4269
|
return analyticsLib({ app, plugins });
|
|
4339
4270
|
}
|
|
4340
4271
|
export { analyticsLib as Analytics, init, zar };
|
|
4272
|
+
//# sourceMappingURL=zar.es.js.map
|