zar 0.0.24 → 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 +347 -376
- package/dist/zar.es.js.map +1 -1
- package/dist/zar.iife.js +4 -4
- package/dist/zar.iife.js.map +1 -1
- package/dist/zar.umd.js +4 -4
- package/dist/zar.umd.js.map +1 -1
- package/package.json +1 -2
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,37 +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
|
}
|
|
3689
|
-
function
|
|
3681
|
+
function warning(msg2) {
|
|
3682
|
+
console.warn(msg2);
|
|
3690
3683
|
if (window.Rollbar) {
|
|
3691
3684
|
window.Rollbar.warning(msg2);
|
|
3692
3685
|
}
|
|
3693
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
|
+
}
|
|
3694
3709
|
var supportsSessionStorage = hasSessionStorage();
|
|
3695
3710
|
function hasSessionStorage() {
|
|
3696
|
-
if (typeof supportsSessionStorage !==
|
|
3711
|
+
if (typeof supportsSessionStorage !== undef) {
|
|
3697
3712
|
return supportsSessionStorage;
|
|
3698
3713
|
}
|
|
3699
3714
|
supportsSessionStorage = true;
|
|
3700
3715
|
try {
|
|
3701
|
-
sessionStorage.setItem(
|
|
3702
|
-
sessionStorage.removeItem(
|
|
3716
|
+
sessionStorage.setItem(undef, undef);
|
|
3717
|
+
sessionStorage.removeItem(undef);
|
|
3703
3718
|
} catch (e2) {
|
|
3704
3719
|
supportsSessionStorage = false;
|
|
3705
3720
|
}
|
|
@@ -3707,7 +3722,7 @@ function hasSessionStorage() {
|
|
|
3707
3722
|
}
|
|
3708
3723
|
function getSessionStorage(key) {
|
|
3709
3724
|
var value;
|
|
3710
|
-
var globalValue =
|
|
3725
|
+
var globalValue = zarGlobal[key];
|
|
3711
3726
|
if (supportsSessionStorage) {
|
|
3712
3727
|
value = sessionStorage.getItem(key);
|
|
3713
3728
|
if (!value && globalValue) {
|
|
@@ -3724,29 +3739,15 @@ function setSessionStorage(key, value) {
|
|
|
3724
3739
|
if (supportsSessionStorage) {
|
|
3725
3740
|
sessionStorage.setItem(key, value_str);
|
|
3726
3741
|
}
|
|
3727
|
-
|
|
3742
|
+
zarGlobal[key] = value_str;
|
|
3728
3743
|
}
|
|
3729
3744
|
function removeSessionStorage(key) {
|
|
3730
3745
|
if (supportsSessionStorage) {
|
|
3731
3746
|
sessionStorage.removeItem(key);
|
|
3732
3747
|
}
|
|
3733
|
-
|
|
3734
|
-
}
|
|
3735
|
-
var lut = [];
|
|
3736
|
-
for (var i = 0; i < 256; i++) {
|
|
3737
|
-
lut[i] = (i < 16 ? "0" : "") + i.toString(16);
|
|
3738
|
-
}
|
|
3739
|
-
function uuid() {
|
|
3740
|
-
var d0 = Math.random() * 4294967296 >>> 0;
|
|
3741
|
-
var d1 = Math.random() * 4294967296 >>> 0;
|
|
3742
|
-
var d2 = Math.random() * 4294967296 >>> 0;
|
|
3743
|
-
var d3 = Math.random() * 4294967296 >>> 0;
|
|
3744
|
-
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];
|
|
3748
|
+
delete zarGlobal[key];
|
|
3745
3749
|
}
|
|
3746
|
-
var inBrowser = typeof document !== "undefined";
|
|
3747
3750
|
function hasAdBlock() {
|
|
3748
|
-
if (!inBrowser)
|
|
3749
|
-
return false;
|
|
3750
3751
|
var fakeAd = document.createElement("div");
|
|
3751
3752
|
fakeAd.innerHTML = " ";
|
|
3752
3753
|
fakeAd.className = "pub_300x250 pub_300x250m pub_728x90 text-ad textAd text_ad text_ads text-ads text-ad-links";
|
|
@@ -3812,11 +3813,13 @@ function postBeacon(_0) {
|
|
|
3812
3813
|
return __async(this, arguments, function* ({ url, data }) {
|
|
3813
3814
|
if (window && window.navigator && typeof window.navigator.sendBeacon === "function" && typeof window.Blob === "function") {
|
|
3814
3815
|
try {
|
|
3815
|
-
|
|
3816
|
+
const blob = new Blob([JSON.stringify(data)], { type: "text/plain; charset=UTF-8" });
|
|
3817
|
+
if (window.navigator.sendBeacon(url, blob)) {
|
|
3816
3818
|
return true;
|
|
3817
3819
|
}
|
|
3818
3820
|
return false;
|
|
3819
3821
|
} catch (e2) {
|
|
3822
|
+
warning("postBeacon:");
|
|
3820
3823
|
return false;
|
|
3821
3824
|
}
|
|
3822
3825
|
}
|
|
@@ -3848,23 +3851,14 @@ function httpPost(_0) {
|
|
|
3848
3851
|
return yield makeRequest({ method: "POST", url, data: finalData, json });
|
|
3849
3852
|
});
|
|
3850
3853
|
}
|
|
3851
|
-
var CID_KEY = "__zar_cid";
|
|
3852
|
-
var SID_KEY = "__zar_sid";
|
|
3853
3854
|
var VID_KEY = "__zar_vid";
|
|
3854
|
-
var NUMBER_POOL_KEY = "__zar_pool";
|
|
3855
3855
|
var NUMBER_POOL_SUCCESS = "success";
|
|
3856
3856
|
var NUMBER_POOL_ERROR = "error";
|
|
3857
3857
|
var NUMBER_POOL_RENEWAL_TIME_MS = 30 * 1e3;
|
|
3858
|
-
var
|
|
3859
|
-
var
|
|
3860
|
-
var
|
|
3858
|
+
var getNumberFailureCount = 0;
|
|
3859
|
+
var MAX_GET_NUMBER_FAILURES = 3;
|
|
3860
|
+
var poolIntervals = {};
|
|
3861
3861
|
var numberOverlayMap = /* @__PURE__ */ new Map();
|
|
3862
|
-
function generateClientId() {
|
|
3863
|
-
return uuid();
|
|
3864
|
-
}
|
|
3865
|
-
function generateSessionId() {
|
|
3866
|
-
return uuid();
|
|
3867
|
-
}
|
|
3868
3862
|
function generateVisitId() {
|
|
3869
3863
|
return Date.now().toString(36) + "." + Math.random().toString(36).substring(2);
|
|
3870
3864
|
}
|
|
@@ -3877,7 +3871,7 @@ function initId(key, generator, getter, setter) {
|
|
|
3877
3871
|
id = generator();
|
|
3878
3872
|
origReferrer = document.referrer;
|
|
3879
3873
|
isNew = true;
|
|
3880
|
-
dbg("
|
|
3874
|
+
dbg("new ID for", key, "-", id);
|
|
3881
3875
|
} else {
|
|
3882
3876
|
id = idObj.id;
|
|
3883
3877
|
origReferrer = idObj.origReferrer;
|
|
@@ -3886,11 +3880,9 @@ function initId(key, generator, getter, setter) {
|
|
|
3886
3880
|
setter(key, result);
|
|
3887
3881
|
return result;
|
|
3888
3882
|
}
|
|
3889
|
-
function
|
|
3883
|
+
function initIDs() {
|
|
3890
3884
|
var vidResult = initId(VID_KEY, generateVisitId, getSessionStorage, setSessionStorage);
|
|
3891
|
-
|
|
3892
|
-
var cidResult = initId(CID_KEY, generateClientId, getSessionStorage, setSessionStorage);
|
|
3893
|
-
return { cid: cidResult.id, sid: sidResult.id, vid: vidResult.id };
|
|
3885
|
+
return { vid: vidResult };
|
|
3894
3886
|
}
|
|
3895
3887
|
function getDefaultApiUrl() {
|
|
3896
3888
|
return window.location.host + "/api/v1";
|
|
@@ -3904,58 +3896,19 @@ function getID(key) {
|
|
|
3904
3896
|
}
|
|
3905
3897
|
function getStorage() {
|
|
3906
3898
|
return {
|
|
3907
|
-
cid: getIDObj(CID_KEY),
|
|
3908
|
-
sid: getIDObj(SID_KEY),
|
|
3909
3899
|
vid: getIDObj(VID_KEY)
|
|
3910
3900
|
};
|
|
3911
3901
|
}
|
|
3912
|
-
function
|
|
3902
|
+
function getIDs() {
|
|
3913
3903
|
return {
|
|
3914
|
-
cid: getID(CID_KEY),
|
|
3915
|
-
sid: getID(SID_KEY),
|
|
3916
3904
|
vid: getID(VID_KEY)
|
|
3917
3905
|
};
|
|
3918
3906
|
}
|
|
3919
|
-
function updateID(key, val) {
|
|
3920
|
-
var obj = getIDObj(key);
|
|
3921
|
-
if (!obj) {
|
|
3922
|
-
console.warn("could not update " + key);
|
|
3923
|
-
return;
|
|
3924
|
-
}
|
|
3925
|
-
obj.id = val;
|
|
3926
|
-
setSessionStorage(key, obj);
|
|
3927
|
-
}
|
|
3928
3907
|
function removeID(key) {
|
|
3929
3908
|
removeSessionStorage(key);
|
|
3930
3909
|
}
|
|
3931
|
-
function
|
|
3910
|
+
function removeIDs() {
|
|
3932
3911
|
removeID(VID_KEY);
|
|
3933
|
-
removeID(SID_KEY);
|
|
3934
|
-
removeID(CID_KEY);
|
|
3935
|
-
}
|
|
3936
|
-
function getPoolNumber(_0) {
|
|
3937
|
-
return __async(this, arguments, function* ({ poolId, apiUrl, number = null, context: context2 = null }) {
|
|
3938
|
-
var payload = {
|
|
3939
|
-
pool_id: poolId,
|
|
3940
|
-
number,
|
|
3941
|
-
context: context2,
|
|
3942
|
-
properties: {
|
|
3943
|
-
zar: getStorage()
|
|
3944
|
-
}
|
|
3945
|
-
};
|
|
3946
|
-
var resp = yield httpPost({ url: `${apiUrl}/number_pool`, data: payload });
|
|
3947
|
-
return resp;
|
|
3948
|
-
});
|
|
3949
|
-
}
|
|
3950
|
-
function getPoolStats(_0) {
|
|
3951
|
-
return __async(this, arguments, function* ({ apiUrl, key = null, with_contexts = false }) {
|
|
3952
|
-
var params = {
|
|
3953
|
-
key,
|
|
3954
|
-
with_contexts
|
|
3955
|
-
};
|
|
3956
|
-
var resp = yield httpGet({ url: `${apiUrl}/number_pool_stats`, params });
|
|
3957
|
-
return resp;
|
|
3958
|
-
});
|
|
3959
3912
|
}
|
|
3960
3913
|
function extractPhoneNumber({ elem }) {
|
|
3961
3914
|
var numberText = null;
|
|
@@ -3980,24 +3933,24 @@ function overlayPhoneNumber({ elems, number }) {
|
|
|
3980
3933
|
if (!number.startsWith("+1")) {
|
|
3981
3934
|
overlayNum = "+1" + number;
|
|
3982
3935
|
}
|
|
3983
|
-
for (var
|
|
3984
|
-
if (numberOverlayMap.has(elems[
|
|
3985
|
-
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]);
|
|
3986
3939
|
continue;
|
|
3987
3940
|
}
|
|
3988
|
-
var elemNum = extractPhoneNumber({ elem: elems[
|
|
3941
|
+
var elemNum = extractPhoneNumber({ elem: elems[i2] });
|
|
3989
3942
|
if (!origNum) {
|
|
3990
3943
|
origNum = elemNum;
|
|
3991
3944
|
} else if (elemNum.number && origNum.number && origNum.number !== elemNum.number) {
|
|
3992
|
-
|
|
3945
|
+
warning("overlaying multiple numbers with a single number", origNum.number, elemNum.number);
|
|
3993
3946
|
}
|
|
3994
|
-
dbg("
|
|
3995
|
-
numberOverlayMap.set(elems[
|
|
3947
|
+
dbg("overlaying", overlayNum, "on", elems[i2]);
|
|
3948
|
+
numberOverlayMap.set(elems[i2], elemNum);
|
|
3996
3949
|
if (elemNum.href) {
|
|
3997
|
-
elems[
|
|
3950
|
+
elems[i2].href = "tel:" + overlayNum;
|
|
3998
3951
|
}
|
|
3999
3952
|
if (elemNum.numberText) {
|
|
4000
|
-
elems[
|
|
3953
|
+
elems[i2].innerHTML = "";
|
|
4001
3954
|
if (elemNum.text) {
|
|
4002
3955
|
var overlay = overlayNum;
|
|
4003
3956
|
if (elemNum.numberText.indexOf("-") > -1) {
|
|
@@ -4005,177 +3958,193 @@ function overlayPhoneNumber({ elems, number }) {
|
|
|
4005
3958
|
}
|
|
4006
3959
|
if (elemNum.html.indexOf("<img") > -1) {
|
|
4007
3960
|
var numberHtml = elemNum.html.replace(elemNum.numberText, overlay);
|
|
4008
|
-
elems[
|
|
3961
|
+
elems[i2].innerHTML = numberHtml;
|
|
4009
3962
|
} else {
|
|
4010
3963
|
var numberText = elemNum.text.replace(elemNum.numberText, overlay);
|
|
4011
|
-
elems[
|
|
3964
|
+
elems[i2].appendChild(document.createTextNode(numberText));
|
|
4012
3965
|
}
|
|
4013
3966
|
} else {
|
|
4014
|
-
elems[
|
|
3967
|
+
elems[i2].appendChild(document.createTextNode(overlayNum));
|
|
4015
3968
|
}
|
|
4016
3969
|
} else {
|
|
4017
|
-
dbg("
|
|
3970
|
+
dbg("no number text found:", elems[i2]);
|
|
4018
3971
|
}
|
|
4019
3972
|
}
|
|
4020
3973
|
}
|
|
4021
3974
|
function revertOverlayNumbers({ elems }) {
|
|
4022
|
-
for (var
|
|
4023
|
-
if (numberOverlayMap.has(elems[
|
|
4024
|
-
var currentHTML = elems[
|
|
4025
|
-
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]);
|
|
4026
3979
|
dbg("orig:", origElemData);
|
|
4027
3980
|
var origHTML = origElemData.html;
|
|
4028
|
-
dbg("
|
|
4029
|
-
elems[
|
|
3981
|
+
dbg("reverting", currentHTML, "to", origHTML);
|
|
3982
|
+
elems[i2].innerHTML = origHTML;
|
|
4030
3983
|
if (origElemData.href) {
|
|
4031
|
-
elems[
|
|
3984
|
+
elems[i2].href = origElemData.href;
|
|
4032
3985
|
}
|
|
4033
|
-
numberOverlayMap.delete(elems[
|
|
3986
|
+
numberOverlayMap.delete(elems[i2]);
|
|
4034
3987
|
} else {
|
|
4035
|
-
dbg("
|
|
3988
|
+
dbg("element not in map:", elems[i2]);
|
|
4036
3989
|
}
|
|
4037
3990
|
}
|
|
4038
3991
|
}
|
|
4039
|
-
function
|
|
4040
|
-
|
|
4041
|
-
|
|
3992
|
+
function clearPoolInterval(poolId) {
|
|
3993
|
+
clearInterval(poolIntervals[poolId]);
|
|
3994
|
+
delete poolIntervals[poolId];
|
|
4042
3995
|
}
|
|
4043
|
-
function clearPoolIntervals(
|
|
4044
|
-
|
|
4045
|
-
|
|
4046
|
-
}
|
|
4047
|
-
for (var poolId in poolData.poolNumbers) {
|
|
4048
|
-
clearInterval(poolData.poolNumbers[poolId].interval);
|
|
3996
|
+
function clearPoolIntervals() {
|
|
3997
|
+
for (var poolId in poolIntervals) {
|
|
3998
|
+
clearPoolInterval(poolId);
|
|
4049
3999
|
}
|
|
4050
4000
|
}
|
|
4051
|
-
function
|
|
4052
|
-
|
|
4053
|
-
|
|
4054
|
-
|
|
4055
|
-
|
|
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
|
+
});
|
|
4056
4014
|
}
|
|
4057
|
-
function
|
|
4058
|
-
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
|
+
});
|
|
4059
4024
|
}
|
|
4060
|
-
function
|
|
4025
|
+
function renewTrackingPool() {
|
|
4061
4026
|
return __async(this, arguments, function* ({
|
|
4062
4027
|
poolId,
|
|
4028
|
+
number,
|
|
4063
4029
|
overlayElements,
|
|
4064
4030
|
apiUrl = getDefaultApiUrl(),
|
|
4065
|
-
|
|
4066
|
-
renew = true,
|
|
4067
|
-
renewalInterval = NUMBER_POOL_RENEWAL_TIME_MS,
|
|
4068
|
-
callback = null
|
|
4031
|
+
contextCallback = null
|
|
4069
4032
|
} = {}) {
|
|
4070
|
-
var
|
|
4071
|
-
|
|
4072
|
-
|
|
4073
|
-
if (!expired) {
|
|
4074
|
-
if (seshData && seshData.poolEnabled) {
|
|
4075
|
-
poolEnabled = true;
|
|
4076
|
-
} else {
|
|
4077
|
-
if (urlParams.get(urlParam) === "1") {
|
|
4078
|
-
poolEnabled = true;
|
|
4079
|
-
}
|
|
4080
|
-
}
|
|
4081
|
-
} else {
|
|
4082
|
-
clearPoolIntervals(seshData);
|
|
4083
|
-
removePoolSession({ overlayElements });
|
|
4084
|
-
}
|
|
4085
|
-
if (!poolEnabled) {
|
|
4086
|
-
dbg("pool: not enabled");
|
|
4087
|
-
if (callback) {
|
|
4088
|
-
callback(null);
|
|
4089
|
-
}
|
|
4090
|
-
return null;
|
|
4091
|
-
}
|
|
4092
|
-
var seshNumber = null;
|
|
4093
|
-
var seshInterval = null;
|
|
4094
|
-
if (seshData && seshData.poolNumbers && seshData.poolNumbers[poolId]) {
|
|
4095
|
-
var poolResult = seshData.poolNumbers[poolId];
|
|
4096
|
-
seshInterval = poolResult.interval;
|
|
4097
|
-
if (poolResult.status !== NUMBER_POOL_SUCCESS) {
|
|
4098
|
-
dbg("pool: returning cached unsuccessful pool result: " + JSON.stringify(poolResult));
|
|
4099
|
-
if (callback) {
|
|
4100
|
-
callback(poolResult);
|
|
4101
|
-
}
|
|
4102
|
-
return poolResult;
|
|
4103
|
-
}
|
|
4104
|
-
if (poolResult.number) {
|
|
4105
|
-
seshNumber = poolResult.number;
|
|
4106
|
-
dbg("pool: found session number " + seshNumber);
|
|
4107
|
-
}
|
|
4033
|
+
var context2 = {};
|
|
4034
|
+
if (contextCallback) {
|
|
4035
|
+
context2 = contextCallback() || {};
|
|
4108
4036
|
}
|
|
4109
|
-
var resp = {};
|
|
4110
4037
|
try {
|
|
4111
|
-
resp = yield getPoolNumber({ poolId, apiUrl, number
|
|
4038
|
+
var resp = yield getPoolNumber({ poolId, apiUrl, number, context: context2 });
|
|
4112
4039
|
} catch (e2) {
|
|
4113
|
-
var msg2 = "
|
|
4114
|
-
|
|
4115
|
-
|
|
4116
|
-
|
|
4117
|
-
|
|
4118
|
-
|
|
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
|
+
}
|
|
4119
4049
|
}
|
|
4120
|
-
return
|
|
4050
|
+
return { status: NUMBER_POOL_ERROR, msg: msg2 };
|
|
4121
4051
|
}
|
|
4122
4052
|
if (resp.status === NUMBER_POOL_SUCCESS && resp.number) {
|
|
4123
4053
|
if (overlayElements) {
|
|
4124
4054
|
overlayPhoneNumber({ elems: overlayElements, number: resp.number });
|
|
4125
4055
|
}
|
|
4126
|
-
if (renew) {
|
|
4127
|
-
dbg("pool: setting up renewal");
|
|
4128
|
-
resp.interval = setInterval(function() {
|
|
4129
|
-
try {
|
|
4130
|
-
initTrackingPool({ poolId, overlayElements, apiUrl, urlParam, renew: false });
|
|
4131
|
-
} catch (e2) {
|
|
4132
|
-
var msg3 = "pool: error on interval call: " + JSON.stringify(e2);
|
|
4133
|
-
rbWarning(msg3);
|
|
4134
|
-
console.warn(msg3);
|
|
4135
|
-
}
|
|
4136
|
-
}, renewalInterval);
|
|
4137
|
-
}
|
|
4138
4056
|
} else {
|
|
4139
4057
|
if (overlayElements) {
|
|
4140
4058
|
revertOverlayNumbers({ elems: overlayElements });
|
|
4141
4059
|
}
|
|
4142
|
-
if (
|
|
4143
|
-
clearInterval(
|
|
4060
|
+
if (poolIntervals[poolId]) {
|
|
4061
|
+
clearInterval(poolIntervals[poolId]);
|
|
4062
|
+
delete poolIntervals[poolId];
|
|
4144
4063
|
}
|
|
4145
|
-
resp.interval = null;
|
|
4146
4064
|
}
|
|
4147
|
-
|
|
4148
|
-
|
|
4149
|
-
|
|
4150
|
-
|
|
4151
|
-
|
|
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 });
|
|
4152
4081
|
}
|
|
4153
|
-
|
|
4154
|
-
|
|
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 });
|
|
4094
|
+
}
|
|
4095
|
+
return poolIntervals;
|
|
4096
|
+
}
|
|
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;
|
|
4155
4107
|
}
|
|
4156
|
-
} else {
|
|
4157
|
-
var poolNumbers = {};
|
|
4158
|
-
poolNumbers[poolId] = resp;
|
|
4159
|
-
seshData = {
|
|
4160
|
-
poolEnabled: true,
|
|
4161
|
-
poolNumbers,
|
|
4162
|
-
t: Date.now()
|
|
4163
|
-
};
|
|
4164
4108
|
}
|
|
4165
|
-
|
|
4166
|
-
|
|
4167
|
-
|
|
4168
|
-
|
|
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
|
+
});
|
|
4169
4140
|
}
|
|
4170
|
-
return
|
|
4141
|
+
return poolIntervals;
|
|
4171
4142
|
});
|
|
4172
4143
|
}
|
|
4173
|
-
function zar({ apiUrl }) {
|
|
4144
|
+
function zar({ apiUrl, poolConfig }) {
|
|
4174
4145
|
return {
|
|
4175
4146
|
name: "zar",
|
|
4176
|
-
config: {
|
|
4177
|
-
apiUrl
|
|
4178
|
-
},
|
|
4147
|
+
config: { apiUrl, poolConfig },
|
|
4179
4148
|
initialize: function({ config: config2 }) {
|
|
4180
4149
|
},
|
|
4181
4150
|
loaded: function() {
|
|
@@ -4183,6 +4152,8 @@ function zar({ apiUrl }) {
|
|
|
4183
4152
|
},
|
|
4184
4153
|
pageStart: function({ payload, config: config2, instance }) {
|
|
4185
4154
|
payload.properties.zar = getStorage();
|
|
4155
|
+
payload.properties.referrer = document.referrer;
|
|
4156
|
+
payload.properties.is_bot = isBot();
|
|
4186
4157
|
if ("hash" in payload.properties) {
|
|
4187
4158
|
delete payload.properties["hash"];
|
|
4188
4159
|
}
|
|
@@ -4192,79 +4163,82 @@ function zar({ apiUrl }) {
|
|
|
4192
4163
|
if ("search" in payload.properties) {
|
|
4193
4164
|
delete payload.properties["search"];
|
|
4194
4165
|
}
|
|
4195
|
-
|
|
4196
|
-
|
|
4197
|
-
|
|
4198
|
-
payload.properties.zar = getStorage();
|
|
4199
|
-
payload.properties.url = window.location.href;
|
|
4166
|
+
if (config2.poolConfig && config2.poolConfig.poolId) {
|
|
4167
|
+
payload.properties.pool_id = getPoolId(config2.poolConfig.poolId);
|
|
4168
|
+
}
|
|
4200
4169
|
return payload;
|
|
4201
4170
|
},
|
|
4202
4171
|
page: function(_0) {
|
|
4203
4172
|
return __async(this, arguments, function* ({ payload, options, instance, config: config2 }) {
|
|
4204
4173
|
dbg("page", payload, options, config2);
|
|
4205
|
-
var
|
|
4206
|
-
if (
|
|
4207
|
-
|
|
4208
|
-
}
|
|
4209
|
-
if (result.cid) {
|
|
4210
|
-
updateID(CID_KEY, result.cid);
|
|
4211
|
-
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 });
|
|
4212
4177
|
}
|
|
4213
4178
|
});
|
|
4214
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
|
+
},
|
|
4215
4186
|
track: function({ payload, options, instance, config: config2 }) {
|
|
4216
4187
|
dbg("track", payload);
|
|
4217
4188
|
httpPost({ url: `${config2.apiUrl}/track`, data: payload, beacon: true });
|
|
4218
4189
|
},
|
|
4219
4190
|
reset: function({ instance }) {
|
|
4220
|
-
|
|
4191
|
+
removeIDs();
|
|
4221
4192
|
},
|
|
4222
4193
|
bootstrap: function({ payload, config: config2, instance }) {
|
|
4223
|
-
|
|
4224
|
-
instance.setAnonymousId(result.cid);
|
|
4194
|
+
initIDs();
|
|
4225
4195
|
},
|
|
4226
4196
|
methods: {
|
|
4227
4197
|
apiUrl() {
|
|
4228
4198
|
return apiUrl;
|
|
4229
4199
|
},
|
|
4230
|
-
|
|
4231
|
-
|
|
4232
|
-
this.instance.setAnonymousId(result.cid);
|
|
4233
|
-
return result;
|
|
4200
|
+
poolConfig() {
|
|
4201
|
+
return poolConfig;
|
|
4234
4202
|
},
|
|
4235
|
-
|
|
4236
|
-
return
|
|
4203
|
+
initIDs() {
|
|
4204
|
+
return initIDs();
|
|
4205
|
+
},
|
|
4206
|
+
getIDs() {
|
|
4207
|
+
return getIDs();
|
|
4237
4208
|
},
|
|
4238
4209
|
getStorage() {
|
|
4239
4210
|
return getStorage();
|
|
4240
4211
|
},
|
|
4241
|
-
getCID() {
|
|
4242
|
-
return getID(CID_KEY);
|
|
4243
|
-
},
|
|
4244
|
-
getSID() {
|
|
4245
|
-
return getID(SID_KEY);
|
|
4246
|
-
},
|
|
4247
4212
|
getVID() {
|
|
4248
4213
|
return getID(VID_KEY);
|
|
4249
4214
|
},
|
|
4250
4215
|
hasAdBlock() {
|
|
4251
4216
|
return hasAdBlock();
|
|
4252
4217
|
},
|
|
4253
|
-
|
|
4218
|
+
isBot() {
|
|
4219
|
+
return isBot();
|
|
4220
|
+
},
|
|
4221
|
+
initTrackingPool({ poolConfig: poolConfig2 }) {
|
|
4222
|
+
var plugin = this.instance.plugins.zar;
|
|
4254
4223
|
return initTrackingPool({
|
|
4255
|
-
|
|
4256
|
-
|
|
4257
|
-
apiUrl:
|
|
4258
|
-
urlParam,
|
|
4259
|
-
renew,
|
|
4260
|
-
renewalInterval,
|
|
4261
|
-
callback
|
|
4224
|
+
poolData: null,
|
|
4225
|
+
poolConfig: Object.assign(plugin.poolConfig(), poolConfig2 || {}),
|
|
4226
|
+
apiUrl: plugin.apiUrl()
|
|
4262
4227
|
});
|
|
4263
4228
|
},
|
|
4229
|
+
getPoolIntervals() {
|
|
4230
|
+
return poolIntervals;
|
|
4231
|
+
},
|
|
4232
|
+
clearPoolInterval({ poolId }) {
|
|
4233
|
+
clearPoolInterval(poolId);
|
|
4234
|
+
},
|
|
4235
|
+
clearPoolIntervals() {
|
|
4236
|
+
clearPoolIntervals();
|
|
4237
|
+
},
|
|
4264
4238
|
extractPhoneNumbers({ elems }) {
|
|
4265
4239
|
var res = [];
|
|
4266
|
-
for (var
|
|
4267
|
-
var elemRes = extractPhoneNumber({ elem: elems[
|
|
4240
|
+
for (var i2 = 0; i2 < elems.length; i2++) {
|
|
4241
|
+
var elemRes = extractPhoneNumber({ elem: elems[i2] });
|
|
4268
4242
|
res.push(elemRes);
|
|
4269
4243
|
}
|
|
4270
4244
|
return res;
|
|
@@ -4275,20 +4249,17 @@ function zar({ apiUrl }) {
|
|
|
4275
4249
|
revertOverlayNumbers({ overlayElements }) {
|
|
4276
4250
|
revertOverlayNumbers({ elems: overlayElements });
|
|
4277
4251
|
},
|
|
4278
|
-
removePoolSession({ overlayElements }) {
|
|
4279
|
-
removePoolSession({ overlayElements });
|
|
4280
|
-
},
|
|
4281
4252
|
getPoolStats({ key = null, with_contexts = false }) {
|
|
4282
4253
|
return getPoolStats({ apiUrl: this.instance.plugins.zar.apiUrl(), key, with_contexts });
|
|
4283
4254
|
}
|
|
4284
4255
|
}
|
|
4285
4256
|
};
|
|
4286
4257
|
}
|
|
4287
|
-
function init({ app, gtmConfig = null, ga4Config = null, apiUrl = null }) {
|
|
4258
|
+
function init({ app, gtmConfig = null, ga4Config = null, apiUrl = null, poolConfig = null }) {
|
|
4288
4259
|
if (!apiUrl) {
|
|
4289
4260
|
apiUrl = getDefaultApiUrl();
|
|
4290
4261
|
}
|
|
4291
|
-
var plugins = [zar({ apiUrl })];
|
|
4262
|
+
var plugins = [zar({ apiUrl, poolConfig })];
|
|
4292
4263
|
if (ga4Config) {
|
|
4293
4264
|
plugins.push(googleAnalytics4(ga4Config));
|
|
4294
4265
|
}
|