@rudderstack/analytics-js 3.18.2 → 3.19.0-beta.pr.2278.cd218f2

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.
@@ -4,6 +4,9 @@
4
4
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.rudderanalytics = {}));
5
5
  })(this, (function (exports) { 'use strict';
6
6
 
7
+ function _OverloadYield(e, d) {
8
+ this.v = e, this.k = d;
9
+ }
7
10
  function _arrayLikeToArray(r, a) {
8
11
  (null == a || a > r.length) && (a = r.length);
9
12
  for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
@@ -217,274 +220,180 @@
217
220
  if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
218
221
  return _assertThisInitialized(t);
219
222
  }
220
- function _regeneratorRuntime() {
221
- _regeneratorRuntime = function () {
222
- return r;
223
- };
224
- var t,
225
- r = {},
226
- e = Object.prototype,
227
- n = e.hasOwnProperty,
228
- o = "function" == typeof Symbol ? Symbol : {},
229
- i = o.iterator || "@@iterator",
230
- a = o.asyncIterator || "@@asyncIterator",
231
- u = o.toStringTag || "@@toStringTag";
232
- function c(t, r, e, n) {
233
- return Object.defineProperty(t, r, {
234
- value: e,
235
- enumerable: !n,
236
- configurable: !n,
237
- writable: !n
238
- });
239
- }
240
- try {
241
- c({}, "");
242
- } catch (t) {
243
- c = function (t, r, e) {
244
- return t[r] = e;
245
- };
246
- }
247
- function h(r, e, n, o) {
248
- var i = e && e.prototype instanceof Generator ? e : Generator,
249
- a = Object.create(i.prototype);
250
- return c(a, "_invoke", function (r, e, n) {
251
- var o = 1;
252
- return function (i, a) {
253
- if (3 === o) throw Error("Generator is already running");
254
- if (4 === o) {
255
- if ("throw" === i) throw a;
256
- return {
257
- value: t,
258
- done: true
259
- };
260
- }
261
- for (n.method = i, n.arg = a;;) {
262
- var u = n.delegate;
263
- if (u) {
264
- var c = d(u, n);
265
- if (c) {
266
- if (c === f) continue;
267
- return c;
268
- }
223
+ function _regenerator() {
224
+ /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
225
+ var e,
226
+ t,
227
+ r = "function" == typeof Symbol ? Symbol : {},
228
+ n = r.iterator || "@@iterator",
229
+ o = r.toStringTag || "@@toStringTag";
230
+ function i(r, n, o, i) {
231
+ var c = n && n.prototype instanceof Generator ? n : Generator,
232
+ u = Object.create(c.prototype);
233
+ return _regeneratorDefine(u, "_invoke", function (r, n, o) {
234
+ var i,
235
+ c,
236
+ u,
237
+ f = 0,
238
+ p = o || [],
239
+ y = false,
240
+ G = {
241
+ p: 0,
242
+ n: 0,
243
+ v: e,
244
+ a: d,
245
+ f: d.bind(e, 4),
246
+ d: function (t, r) {
247
+ return i = t, c = 0, u = e, G.n = r, a;
269
248
  }
270
- if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
271
- if (1 === o) throw o = 4, n.arg;
272
- n.dispatchException(n.arg);
273
- } else "return" === n.method && n.abrupt("return", n.arg);
274
- o = 3;
275
- var h = s(r, e, n);
276
- if ("normal" === h.type) {
277
- if (o = n.done ? 4 : 2, h.arg === f) continue;
278
- return {
279
- value: h.arg,
280
- done: n.done
281
- };
249
+ };
250
+ function d(r, n) {
251
+ for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) {
252
+ var o,
253
+ i = p[t],
254
+ d = G.p,
255
+ l = i[2];
256
+ r > 3 ? (o = l === n) && (c = i[4] || 3, u = i[5] === e ? i[3] : i[5], i[4] = 3, i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0));
257
+ }
258
+ if (o || r > 1) return a;
259
+ throw y = true, n;
260
+ }
261
+ return function (o, p, l) {
262
+ if (f > 1) throw TypeError("Generator is already running");
263
+ for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) {
264
+ i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u);
265
+ try {
266
+ if (f = 2, i) {
267
+ if (c || (o = "next"), t = i[o]) {
268
+ if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object");
269
+ if (!t.done) return t;
270
+ u = t.value, c < 2 && (c = 0);
271
+ } else 1 === c && (t = i.return) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1);
272
+ i = e;
273
+ } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break;
274
+ } catch (t) {
275
+ i = e, c = 1, u = t;
276
+ } finally {
277
+ f = 1;
282
278
  }
283
- "throw" === h.type && (o = 4, n.method = "throw", n.arg = h.arg);
284
279
  }
280
+ return {
281
+ value: t,
282
+ done: y
283
+ };
285
284
  };
286
- }(r, n, new Context(o || [])), true), a;
285
+ }(r, o, i), true), u;
287
286
  }
288
- function s(t, r, e) {
289
- try {
290
- return {
291
- type: "normal",
292
- arg: t.call(r, e)
293
- };
294
- } catch (t) {
295
- return {
296
- type: "throw",
297
- arg: t
298
- };
299
- }
300
- }
301
- r.wrap = h;
302
- var f = {};
287
+ var a = {};
303
288
  function Generator() {}
304
289
  function GeneratorFunction() {}
305
290
  function GeneratorFunctionPrototype() {}
306
- var l = {};
307
- c(l, i, function () {
291
+ t = Object.getPrototypeOf;
292
+ var c = [][n] ? t(t([][n]())) : (_regeneratorDefine(t = {}, n, function () {
293
+ return this;
294
+ }), t),
295
+ u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c);
296
+ function f(e) {
297
+ return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e;
298
+ }
299
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine(u), _regeneratorDefine(u, o, "Generator"), _regeneratorDefine(u, n, function () {
308
300
  return this;
301
+ }), _regeneratorDefine(u, "toString", function () {
302
+ return "[object Generator]";
303
+ }), (_regenerator = function () {
304
+ return {
305
+ w: i,
306
+ m: f
307
+ };
308
+ })();
309
+ }
310
+ function _regeneratorAsync(n, e, r, t, o) {
311
+ var a = _regeneratorAsyncGen(n, e, r, t, o);
312
+ return a.next().then(function (n) {
313
+ return n.done ? n.value : a.next();
309
314
  });
310
- var p = Object.getPrototypeOf,
311
- y = p && p(p(x([])));
312
- y && y !== e && n.call(y, i) && (l = y);
313
- var v = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(l);
314
- function g(t) {
315
- ["next", "throw", "return"].forEach(function (r) {
316
- c(t, r, function (t) {
317
- return this._invoke(r, t);
315
+ }
316
+ function _regeneratorAsyncGen(r, e, t, o, n) {
317
+ return new _regeneratorAsyncIterator(_regenerator().w(r, e, t, o), n || Promise);
318
+ }
319
+ function _regeneratorAsyncIterator(t, e) {
320
+ function n(r, o, i, f) {
321
+ try {
322
+ var c = t[r](o),
323
+ u = c.value;
324
+ return u instanceof _OverloadYield ? e.resolve(u.v).then(function (t) {
325
+ n("next", t, i, f);
326
+ }, function (t) {
327
+ n("throw", t, i, f);
328
+ }) : e.resolve(u).then(function (t) {
329
+ c.value = t, i(c);
330
+ }, function (t) {
331
+ return n("throw", t, i, f);
318
332
  });
319
- });
320
- }
321
- function AsyncIterator(t, r) {
322
- function e(o, i, a, u) {
323
- var c = s(t[o], t, i);
324
- if ("throw" !== c.type) {
325
- var h = c.arg,
326
- f = h.value;
327
- return f && "object" == typeof f && n.call(f, "__await") ? r.resolve(f.__await).then(function (t) {
328
- e("next", t, a, u);
329
- }, function (t) {
330
- e("throw", t, a, u);
331
- }) : r.resolve(f).then(function (t) {
332
- h.value = t, a(h);
333
- }, function (t) {
334
- return e("throw", t, a, u);
335
- });
336
- }
337
- u(c.arg);
333
+ } catch (t) {
334
+ f(t);
338
335
  }
339
- var o;
340
- c(this, "_invoke", function (t, n) {
341
- function i() {
342
- return new r(function (r, o) {
343
- e(t, n, r, o);
344
- });
345
- }
346
- return o = o ? o.then(i, i) : i();
347
- }, true);
348
- }
349
- function d(r, e) {
350
- var n = e.method,
351
- o = r.i[n];
352
- if (o === t) return e.delegate = null, "throw" === n && r.i.return && (e.method = "return", e.arg = t, d(r, e), "throw" === e.method) || "return" !== n && (e.method = "throw", e.arg = new TypeError("The iterator does not provide a '" + n + "' method")), f;
353
- var i = s(o, r.i, e.arg);
354
- if ("throw" === i.type) return e.method = "throw", e.arg = i.arg, e.delegate = null, f;
355
- var a = i.arg;
356
- return a ? a.done ? (e[r.r] = a.value, e.next = r.n, "return" !== e.method && (e.method = "next", e.arg = t), e.delegate = null, f) : a : (e.method = "throw", e.arg = new TypeError("iterator result is not an object"), e.delegate = null, f);
357
- }
358
- function w(t) {
359
- this.tryEntries.push(t);
360
336
  }
361
- function m(r) {
362
- var e = r[4] || {};
363
- e.type = "normal", e.arg = t, r[4] = e;
364
- }
365
- function Context(t) {
366
- this.tryEntries = [[-1]], t.forEach(w, this), this.reset(true);
367
- }
368
- function x(r) {
369
- if (null != r) {
370
- var e = r[i];
371
- if (e) return e.call(r);
372
- if ("function" == typeof r.next) return r;
373
- if (!isNaN(r.length)) {
374
- var o = -1,
375
- a = function e() {
376
- for (; ++o < r.length;) if (n.call(r, o)) return e.value = r[o], e.done = false, e;
377
- return e.value = t, e.done = true, e;
378
- };
379
- return a.next = a;
380
- }
337
+ var r;
338
+ this.next || (_regeneratorDefine(_regeneratorAsyncIterator.prototype), _regeneratorDefine(_regeneratorAsyncIterator.prototype, "function" == typeof Symbol && Symbol.asyncIterator || "@asyncIterator", function () {
339
+ return this;
340
+ })), _regeneratorDefine(this, "_invoke", function (t, o, i) {
341
+ function f() {
342
+ return new e(function (e, r) {
343
+ n(t, i, e, r);
344
+ });
381
345
  }
382
- throw new TypeError(typeof r + " is not iterable");
346
+ return r = r ? r.then(f, f) : f();
347
+ }, true);
348
+ }
349
+ function _regeneratorDefine(e, r, n, t) {
350
+ var i = Object.defineProperty;
351
+ try {
352
+ i({}, "", {});
353
+ } catch (e) {
354
+ i = 0;
383
355
  }
384
- return GeneratorFunction.prototype = GeneratorFunctionPrototype, c(v, "constructor", GeneratorFunctionPrototype), c(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = c(GeneratorFunctionPrototype, u, "GeneratorFunction"), r.isGeneratorFunction = function (t) {
385
- var r = "function" == typeof t && t.constructor;
386
- return !!r && (r === GeneratorFunction || "GeneratorFunction" === (r.displayName || r.name));
387
- }, r.mark = function (t) {
388
- return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, c(t, u, "GeneratorFunction")), t.prototype = Object.create(v), t;
389
- }, r.awrap = function (t) {
390
- return {
391
- __await: t
392
- };
393
- }, g(AsyncIterator.prototype), c(AsyncIterator.prototype, a, function () {
394
- return this;
395
- }), r.AsyncIterator = AsyncIterator, r.async = function (t, e, n, o, i) {
396
- void 0 === i && (i = Promise);
397
- var a = new AsyncIterator(h(t, e, n, o), i);
398
- return r.isGeneratorFunction(e) ? a : a.next().then(function (t) {
399
- return t.done ? t.value : a.next();
400
- });
401
- }, g(v), c(v, u, "Generator"), c(v, i, function () {
402
- return this;
403
- }), c(v, "toString", function () {
404
- return "[object Generator]";
405
- }), r.keys = function (t) {
406
- var r = Object(t),
407
- e = [];
408
- for (var n in r) e.unshift(n);
409
- return function t() {
410
- for (; e.length;) if ((n = e.pop()) in r) return t.value = n, t.done = false, t;
411
- return t.done = true, t;
412
- };
413
- }, r.values = x, Context.prototype = {
414
- constructor: Context,
415
- reset: function (r) {
416
- if (this.prev = this.next = 0, this.sent = this._sent = t, this.done = false, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(m), !r) for (var e in this) "t" === e.charAt(0) && n.call(this, e) && !isNaN(+e.slice(1)) && (this[e] = t);
417
- },
418
- stop: function () {
419
- this.done = true;
420
- var t = this.tryEntries[0][4];
421
- if ("throw" === t.type) throw t.arg;
422
- return this.rval;
423
- },
424
- dispatchException: function (r) {
425
- if (this.done) throw r;
426
- var e = this;
427
- function n(t) {
428
- a.type = "throw", a.arg = r, e.next = t;
429
- }
430
- for (var o = e.tryEntries.length - 1; o >= 0; --o) {
431
- var i = this.tryEntries[o],
432
- a = i[4],
433
- u = this.prev,
434
- c = i[1],
435
- h = i[2];
436
- if (-1 === i[0]) return n("end"), false;
437
- if (!c && !h) throw Error("try statement without catch or finally");
438
- if (null != i[0] && i[0] <= u) {
439
- if (u < c) return this.method = "next", this.arg = t, n(c), true;
440
- if (u < h) return n(h), false;
441
- }
442
- }
443
- },
444
- abrupt: function (t, r) {
445
- for (var e = this.tryEntries.length - 1; e >= 0; --e) {
446
- var n = this.tryEntries[e];
447
- if (n[0] > -1 && n[0] <= this.prev && this.prev < n[2]) {
448
- var o = n;
449
- break;
450
- }
451
- }
452
- o && ("break" === t || "continue" === t) && o[0] <= r && r <= o[2] && (o = null);
453
- var i = o ? o[4] : {};
454
- return i.type = t, i.arg = r, o ? (this.method = "next", this.next = o[2], f) : this.complete(i);
455
- },
456
- complete: function (t, r) {
457
- if ("throw" === t.type) throw t.arg;
458
- return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && r && (this.next = r), f;
459
- },
460
- finish: function (t) {
461
- for (var r = this.tryEntries.length - 1; r >= 0; --r) {
462
- var e = this.tryEntries[r];
463
- if (e[2] === t) return this.complete(e[4], e[3]), m(e), f;
464
- }
465
- },
466
- catch: function (t) {
467
- for (var r = this.tryEntries.length - 1; r >= 0; --r) {
468
- var e = this.tryEntries[r];
469
- if (e[0] === t) {
470
- var n = e[4];
471
- if ("throw" === n.type) {
472
- var o = n.arg;
473
- m(e);
474
- }
475
- return o;
476
- }
356
+ _regeneratorDefine = function (e, r, n, t) {
357
+ if (r) i ? i(e, r, {
358
+ value: n,
359
+ enumerable: !t,
360
+ configurable: !t,
361
+ writable: !t
362
+ }) : e[r] = n;else {
363
+ function o(r, n) {
364
+ _regeneratorDefine(e, r, function (e) {
365
+ return this._invoke(r, n, e);
366
+ });
477
367
  }
478
- throw Error("illegal catch attempt");
479
- },
480
- delegateYield: function (r, e, n) {
481
- return this.delegate = {
482
- i: x(r),
483
- r: e,
484
- n: n
485
- }, "next" === this.method && (this.arg = t), f;
368
+ o("next", 0), o("throw", 1), o("return", 2);
486
369
  }
487
- }, r;
370
+ }, _regeneratorDefine(e, r, n, t);
371
+ }
372
+ function _regeneratorKeys(e) {
373
+ var n = Object(e),
374
+ r = [];
375
+ for (var t in n) r.unshift(t);
376
+ return function e() {
377
+ for (; r.length;) if ((t = r.pop()) in n) return e.value = t, e.done = false, e;
378
+ return e.done = true, e;
379
+ };
380
+ }
381
+ function _regeneratorValues(e) {
382
+ if (null != e) {
383
+ var t = e["function" == typeof Symbol && Symbol.iterator || "@@iterator"],
384
+ r = 0;
385
+ if (t) return t.call(e);
386
+ if ("function" == typeof e.next) return e;
387
+ if (!isNaN(e.length)) return {
388
+ next: function () {
389
+ return e && r >= e.length && (e = void 0), {
390
+ value: e && e[r++],
391
+ done: !e
392
+ };
393
+ }
394
+ };
395
+ }
396
+ throw new TypeError(typeof e + " is not iterable");
488
397
  }
489
398
  function _setPrototypeOf(t, e) {
490
399
  return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
@@ -537,6 +446,74 @@
537
446
  return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
538
447
  }
539
448
  }
449
+ function _regeneratorRuntime() {
450
+
451
+ var r = _regenerator(),
452
+ e = r.m(_regeneratorRuntime),
453
+ t = (Object.getPrototypeOf ? Object.getPrototypeOf(e) : e.__proto__).constructor;
454
+ function n(r) {
455
+ var e = "function" == typeof r && r.constructor;
456
+ return !!e && (e === t || "GeneratorFunction" === (e.displayName || e.name));
457
+ }
458
+ var o = {
459
+ throw: 1,
460
+ return: 2,
461
+ break: 3,
462
+ continue: 3
463
+ };
464
+ function a(r) {
465
+ var e, t;
466
+ return function (n) {
467
+ e || (e = {
468
+ stop: function () {
469
+ return t(n.a, 2);
470
+ },
471
+ catch: function () {
472
+ return n.v;
473
+ },
474
+ abrupt: function (r, e) {
475
+ return t(n.a, o[r], e);
476
+ },
477
+ delegateYield: function (r, o, a) {
478
+ return e.resultName = o, t(n.d, _regeneratorValues(r), a);
479
+ },
480
+ finish: function (r) {
481
+ return t(n.f, r);
482
+ }
483
+ }, t = function (r, t, o) {
484
+ n.p = e.prev, n.n = e.next;
485
+ try {
486
+ return r(t, o);
487
+ } finally {
488
+ e.next = n.n;
489
+ }
490
+ }), e.resultName && (e[e.resultName] = n.v, e.resultName = void 0), e.sent = n.v, e.next = n.n;
491
+ try {
492
+ return r.call(this, e);
493
+ } finally {
494
+ n.p = e.prev, n.n = e.next;
495
+ }
496
+ };
497
+ }
498
+ return (_regeneratorRuntime = function () {
499
+ return {
500
+ wrap: function (e, t, n, o) {
501
+ return r.w(a(e), t, n, o && o.reverse());
502
+ },
503
+ isGeneratorFunction: n,
504
+ mark: r.m,
505
+ awrap: function (r, e) {
506
+ return new _OverloadYield(r, e);
507
+ },
508
+ AsyncIterator: _regeneratorAsyncIterator,
509
+ async: function (r, e, t, o, u) {
510
+ return (n(e) ? _regeneratorAsyncGen : _regeneratorAsync)(a(r), e, t, o, u);
511
+ },
512
+ keys: _regeneratorKeys,
513
+ values: _regeneratorValues
514
+ };
515
+ })();
516
+ }
540
517
 
541
518
  function _isPlaceholder(a){return a!=null&&_typeof(a)==='object'&&a['@@functional/placeholder']===true;}
542
519
 
@@ -827,7 +804,11 @@
827
804
  * Determines if the input is of type error
828
805
  * @param value input value
829
806
  * @returns true if the input is of type error else false
830
- */var isTypeOfError=function isTypeOfError(value){switch(Object.prototype.toString.call(value)){case '[object Error]':case '[object Exception]':case '[object DOMException]':return true;default:return value instanceof Error;}};
807
+ */var isTypeOfError=function isTypeOfError(value){switch(Object.prototype.toString.call(value)){case '[object Error]':case '[object Exception]':case '[object DOMException]':return true;default:return value instanceof Error;}};/**
808
+ * A function to check given value is a boolean
809
+ * @param value input value
810
+ * @returns boolean
811
+ */var isBoolean=function isBoolean(value){return typeof value==='boolean';};
831
812
 
832
813
  var getValueByPath=function getValueByPath(obj,keyPath){var pathParts=keyPath.split('.');return path(pathParts,obj);};var hasValueByPath=function hasValueByPath(obj,path){return Boolean(getValueByPath(obj,path));};var isObject=function isObject(value){return _typeof(value)==='object';};/**
833
814
  * Checks if the input is an object literal or built-in object type and not null
@@ -950,6 +931,8 @@
950
931
  *//**
951
932
  * Represents the destinations queue options parameter in loadOptions type
952
933
  */var PageLifecycleEvents=/*#__PURE__*/function(PageLifecycleEvents){PageLifecycleEvents["UNLOADED"]="Page Unloaded";return PageLifecycleEvents;}({});/**
934
+ * Represents the source configuration override options for destinations
935
+ *//**
953
936
  * Represents the options parameter in the load API
954
937
  */
955
938
 
@@ -1031,7 +1014,7 @@
1031
1014
  error.stacktrace="".concat(stacktrace,"\n").concat(MANUAL_ERROR_IDENTIFIER);break;case operaSourceloc:default:// eslint-disable-next-line no-param-reassign
1032
1015
  error['opera#sourceloc']="".concat(operaSourceloc,"\n").concat(MANUAL_ERROR_IDENTIFIER);break;}}}globalThis.dispatchEvent(new ErrorEvent('error',{error:error,bubbles:true,cancelable:true,composed:true}));};
1033
1016
 
1034
- var APP_NAME='RudderLabs JavaScript SDK';var APP_VERSION='3.18.2';var APP_NAMESPACE='com.rudderlabs.javascript';var MODULE_TYPE='npm';var ADBLOCK_PAGE_CATEGORY='RudderJS-Initiated';var ADBLOCK_PAGE_NAME='ad-block page request';var ADBLOCK_PAGE_PATH='/ad-blocked';var GLOBAL_PRELOAD_BUFFER='preloadedEventsBuffer';var CONSENT_TRACK_EVENT_NAME='Consent Management Interaction';
1017
+ var APP_NAME='RudderLabs JavaScript SDK';var APP_VERSION='3.19.0-beta.pr.2278.cd218f2';var APP_NAMESPACE='com.rudderlabs.javascript';var MODULE_TYPE='npm';var ADBLOCK_PAGE_CATEGORY='RudderJS-Initiated';var ADBLOCK_PAGE_NAME='ad-block page request';var ADBLOCK_PAGE_PATH='/ad-blocked';var GLOBAL_PRELOAD_BUFFER='preloadedEventsBuffer';var CONSENT_TRACK_EVENT_NAME='Consent Management Interaction';
1035
1018
 
1036
1019
  var QUERY_PARAM_TRAIT_PREFIX='ajs_trait_';var QUERY_PARAM_PROPERTY_PREFIX='ajs_prop_';var QUERY_PARAM_ANONYMOUS_ID_KEY='ajs_aid';var QUERY_PARAM_USER_ID_KEY='ajs_uid';var QUERY_PARAM_TRACK_EVENT_NAME_KEY='ajs_event';
1037
1020
 
@@ -1123,7 +1106,7 @@
1123
1106
  * Handle errors
1124
1107
  */},{key:"onError",value:function onError(error){this.errorHandler.onError(error,EXTERNAL_SRC_LOADER);}}]);}();
1125
1108
 
1126
- var i$2=Symbol.for("preact-signals");function t$1(){if(!(s>1)){var i,t=false;while(void 0!==h){var r=h;h=void 0;f++;while(void 0!==r){var o=r.o;r.o=void 0;r.f&=-3;if(!(8&r.f)&&c(r))try{r.c();}catch(r){if(!t){i=r;t=true;}}r=o;}}f=0;s--;if(t)throw i;}else s--;}function r(i){if(s>0)return i();s++;try{return i();}finally{t$1();}}var o=void 0;var h=void 0,s=0,f=0,v=0;function e(i){if(void 0!==o){var t=i.n;if(void 0===t||t.t!==o){t={i:0,S:i,p:o.s,n:void 0,t:o,e:void 0,x:void 0,r:t};if(void 0!==o.s)o.s.n=t;o.s=t;i.n=t;if(32&o.f)i.S(t);return t;}else if(-1===t.i){t.i=0;if(void 0!==t.n){t.n.p=t.p;if(void 0!==t.p)t.p.n=t.n;t.p=o.s;t.n=void 0;o.s.n=t;o.s=t;}return t;}}}function u(i){this.v=i;this.i=0;this.n=void 0;this.t=void 0;}u.prototype.brand=i$2;u.prototype.h=function(){return true;};u.prototype.S=function(i){if(this.t!==i&&void 0===i.e){i.x=this.t;if(void 0!==this.t)this.t.e=i;this.t=i;}};u.prototype.U=function(i){if(void 0!==this.t){var t=i.e,r=i.x;if(void 0!==t){t.x=r;i.e=void 0;}if(void 0!==r){r.e=t;i.x=void 0;}if(i===this.t)this.t=r;}};u.prototype.subscribe=function(i){var t=this;return E(function(){var r=t.value,n=o;o=void 0;try{i(r);}finally{o=n;}});};u.prototype.valueOf=function(){return this.value;};u.prototype.toString=function(){return this.value+"";};u.prototype.toJSON=function(){return this.value;};u.prototype.peek=function(){var i=o;o=void 0;try{return this.value;}finally{o=i;}};Object.defineProperty(u.prototype,"value",{get:function get(){var i=e(this);if(void 0!==i)i.i=this.i;return this.v;},set:function set(i){if(i!==this.v){if(f>100)throw new Error("Cycle detected");this.v=i;this.i++;v++;s++;try{for(var r=this.t;void 0!==r;r=r.x)r.t.N();}finally{t$1();}}}});function d$1(i){return new u(i);}function c(i){for(var t=i.s;void 0!==t;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return true;return false;}function a(i){for(var t=i.s;void 0!==t;t=t.n){var r=t.S.n;if(void 0!==r)t.r=r;t.S.n=t;t.i=-1;if(void 0===t.n){i.s=t;break;}}}function l(i){var t=i.s,r=void 0;while(void 0!==t){var o=t.p;if(-1===t.i){t.S.U(t);if(void 0!==o)o.n=t.n;if(void 0!==t.n)t.n.p=o;}else r=t;t.S.n=t.r;if(void 0!==t.r)t.r=void 0;t=o;}i.s=r;}function y(i){u.call(this,void 0);this.x=i;this.s=void 0;this.g=v-1;this.f=4;}(y.prototype=new u()).h=function(){this.f&=-3;if(1&this.f)return false;if(32==(36&this.f))return true;this.f&=-5;if(this.g===v)return true;this.g=v;this.f|=1;if(this.i>0&&!c(this)){this.f&=-2;return true;}var i=o;try{a(this);o=this;var t=this.x();if(16&this.f||this.v!==t||0===this.i){this.v=t;this.f&=-17;this.i++;}}catch(i){this.v=i;this.f|=16;this.i++;}o=i;l(this);this.f&=-2;return true;};y.prototype.S=function(i){if(void 0===this.t){this.f|=36;for(var t=this.s;void 0!==t;t=t.n)t.S.S(t);}u.prototype.S.call(this,i);};y.prototype.U=function(i){if(void 0!==this.t){u.prototype.U.call(this,i);if(void 0===this.t){this.f&=-33;for(var t=this.s;void 0!==t;t=t.n)t.S.U(t);}}};y.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var i=this.t;void 0!==i;i=i.x)i.t.N();}};Object.defineProperty(y.prototype,"value",{get:function get(){if(1&this.f)throw new Error("Cycle detected");var i=e(this);this.h();if(void 0!==i)i.i=this.i;if(16&this.f)throw this.v;return this.v;}});function _(i){var r=i.u;i.u=void 0;if("function"==typeof r){s++;var n=o;o=void 0;try{r();}catch(t){i.f&=-2;i.f|=8;g(i);throw t;}finally{o=n;t$1();}}}function g(i){for(var t=i.s;void 0!==t;t=t.n)t.S.U(t);i.x=void 0;i.s=void 0;_(i);}function p(i){if(o!==this)throw new Error("Out-of-order effect");l(this);o=i;this.f&=-2;if(8&this.f)g(this);t$1();}function b(i){this.x=i;this.u=void 0;this.s=void 0;this.o=void 0;this.f=32;}b.prototype.c=function(){var i=this.S();try{if(8&this.f)return;if(void 0===this.x)return;var t=this.x();if("function"==typeof t)this.u=t;}finally{i();}};b.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1;this.f&=-9;_(this);a(this);s++;var i=o;o=this;return p.bind(this,i);};b.prototype.N=function(){if(!(2&this.f)){this.f|=2;this.o=h;h=this;}};b.prototype.d=function(){this.f|=8;if(!(1&this.f))g(this);};function E(i){var t=new b(i);try{t.c();}catch(i){t.d();throw i;}return t.d.bind(t);}
1109
+ var i$2=Symbol.for("preact-signals");function t$1(){if(!(s>1)){var i,t=false;while(void 0!==h){var r=h;h=void 0;f++;while(void 0!==r){var o=r.o;r.o=void 0;r.f&=-3;if(!(8&r.f)&&c(r))try{r.c();}catch(r){if(!t){i=r;t=true;}}r=o;}}f=0;s--;if(t)throw i;}else s--;}function r(i){if(s>0)return i();s++;try{return i();}finally{t$1();}}var o=void 0;function n(i){var t=o;o=void 0;try{return i();}finally{o=t;}}var h=void 0,s=0,f=0,v=0;function e(i){if(void 0!==o){var t=i.n;if(void 0===t||t.t!==o){t={i:0,S:i,p:o.s,n:void 0,t:o,e:void 0,x:void 0,r:t};if(void 0!==o.s)o.s.n=t;o.s=t;i.n=t;if(32&o.f)i.S(t);return t;}else if(-1===t.i){t.i=0;if(void 0!==t.n){t.n.p=t.p;if(void 0!==t.p)t.p.n=t.n;t.p=o.s;t.n=void 0;o.s.n=t;o.s=t;}return t;}}}function u(i,t){this.v=i;this.i=0;this.n=void 0;this.t=void 0;this.W=null==t?void 0:t.watched;this.Z=null==t?void 0:t.unwatched;}u.prototype.brand=i$2;u.prototype.h=function(){return true;};u.prototype.S=function(i){var t=this,r=this.t;if(r!==i&&void 0===i.e){i.x=r;this.t=i;if(void 0!==r)r.e=i;else n(function(){var i;null==(i=t.W)||i.call(t);});}};u.prototype.U=function(i){var t=this;if(void 0!==this.t){var r=i.e,o=i.x;if(void 0!==r){r.x=o;i.e=void 0;}if(void 0!==o){o.e=r;i.x=void 0;}if(i===this.t){this.t=o;if(void 0===o)n(function(){var i;null==(i=t.Z)||i.call(t);});}}};u.prototype.subscribe=function(i){var t=this;return E(function(){var r=t.value,n=o;o=void 0;try{i(r);}finally{o=n;}});};u.prototype.valueOf=function(){return this.value;};u.prototype.toString=function(){return this.value+"";};u.prototype.toJSON=function(){return this.value;};u.prototype.peek=function(){var i=o;o=void 0;try{return this.value;}finally{o=i;}};Object.defineProperty(u.prototype,"value",{get:function get(){var i=e(this);if(void 0!==i)i.i=this.i;return this.v;},set:function set(i){if(i!==this.v){if(f>100)throw new Error("Cycle detected");this.v=i;this.i++;v++;s++;try{for(var r=this.t;void 0!==r;r=r.x)r.t.N();}finally{t$1();}}}});function d$1(i,t){return new u(i,t);}function c(i){for(var t=i.s;void 0!==t;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return true;return false;}function a(i){for(var t=i.s;void 0!==t;t=t.n){var r=t.S.n;if(void 0!==r)t.r=r;t.S.n=t;t.i=-1;if(void 0===t.n){i.s=t;break;}}}function l(i){var t=i.s,r=void 0;while(void 0!==t){var o=t.p;if(-1===t.i){t.S.U(t);if(void 0!==o)o.n=t.n;if(void 0!==t.n)t.n.p=o;}else r=t;t.S.n=t.r;if(void 0!==t.r)t.r=void 0;t=o;}i.s=r;}function y(i,t){u.call(this,void 0);this.x=i;this.s=void 0;this.g=v-1;this.f=4;this.W=null==t?void 0:t.watched;this.Z=null==t?void 0:t.unwatched;}y.prototype=new u();y.prototype.h=function(){this.f&=-3;if(1&this.f)return false;if(32==(36&this.f))return true;this.f&=-5;if(this.g===v)return true;this.g=v;this.f|=1;if(this.i>0&&!c(this)){this.f&=-2;return true;}var i=o;try{a(this);o=this;var t=this.x();if(16&this.f||this.v!==t||0===this.i){this.v=t;this.f&=-17;this.i++;}}catch(i){this.v=i;this.f|=16;this.i++;}o=i;l(this);this.f&=-2;return true;};y.prototype.S=function(i){if(void 0===this.t){this.f|=36;for(var t=this.s;void 0!==t;t=t.n)t.S.S(t);}u.prototype.S.call(this,i);};y.prototype.U=function(i){if(void 0!==this.t){u.prototype.U.call(this,i);if(void 0===this.t){this.f&=-33;for(var t=this.s;void 0!==t;t=t.n)t.S.U(t);}}};y.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var i=this.t;void 0!==i;i=i.x)i.t.N();}};Object.defineProperty(y.prototype,"value",{get:function get(){if(1&this.f)throw new Error("Cycle detected");var i=e(this);this.h();if(void 0!==i)i.i=this.i;if(16&this.f)throw this.v;return this.v;}});function _(i){var r=i.u;i.u=void 0;if("function"==typeof r){s++;var n=o;o=void 0;try{r();}catch(t){i.f&=-2;i.f|=8;g(i);throw t;}finally{o=n;t$1();}}}function g(i){for(var t=i.s;void 0!==t;t=t.n)t.S.U(t);i.x=void 0;i.s=void 0;_(i);}function p(i){if(o!==this)throw new Error("Out-of-order effect");l(this);o=i;this.f&=-2;if(8&this.f)g(this);t$1();}function b(i){this.x=i;this.u=void 0;this.s=void 0;this.o=void 0;this.f=32;}b.prototype.c=function(){var i=this.S();try{if(8&this.f)return;if(void 0===this.x)return;var t=this.x();if("function"==typeof t)this.u=t;}finally{i();}};b.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1;this.f&=-9;_(this);a(this);s++;var i=o;o=this;return p.bind(this,i);};b.prototype.N=function(){if(!(2&this.f)){this.f|=2;this.o=h;h=this;}};b.prototype.d=function(){this.f|=8;if(!(1&this.f))g(this);};function E(i){var t=new b(i);try{t.c();}catch(i){t.d();throw i;}return t.d.bind(t);}
1127
1110
 
1128
1111
  /**
1129
1112
  * A buffer queue to serve as a store for any type of data
@@ -1171,7 +1154,7 @@
1171
1154
 
1172
1155
  var DEFAULT_STORAGE_ENCRYPTION_VERSION='v3';var DEFAULT_DATA_PLANE_EVENTS_TRANSPORT='xhr';var ConsentManagersToPluginNameMap={iubenda:'IubendaConsentManager',oneTrust:'OneTrustConsentManager',ketch:'KetchConsentManager',custom:'CustomConsentManager'};var StorageEncryptionVersionsToPluginNameMap=_defineProperty(_defineProperty({},DEFAULT_STORAGE_ENCRYPTION_VERSION,'StorageEncryption'),"legacy",'StorageEncryptionLegacy');var DataPlaneEventsTransportToPluginNameMap=_defineProperty(_defineProperty({},DEFAULT_DATA_PLANE_EVENTS_TRANSPORT,'XhrQueue'),"beacon",'BeaconQueue');var DEFAULT_DATA_SERVICE_ENDPOINT='rsaRequest';var METRICS_SERVICE_ENDPOINT='rsaMetrics';
1173
1156
 
1174
- var defaultLoadOptions={configUrl:DEFAULT_CONFIG_BE_URL,loadIntegration:true,sessions:{autoTrack:true,timeout:DEFAULT_SESSION_TIMEOUT_MS,cutOff:{enabled:false}},sameSiteCookie:'Lax',polyfillIfRequired:true,integrations:DEFAULT_INTEGRATIONS_CONFIG,useBeacon:false,beaconQueueOptions:{},destinationsQueueOptions:{},queueOptions:{},lockIntegrationsVersion:true,lockPluginsVersion:true,uaChTrackLevel:'none',plugins:[],useGlobalIntegrationsConfigInEvents:false,bufferDataPlaneEventsUntilReady:false,dataPlaneEventsBufferTimeout:DEFAULT_DATA_PLANE_EVENTS_BUFFER_TIMEOUT_MS,storage:{encryption:{version:DEFAULT_STORAGE_ENCRYPTION_VERSION},migrate:true,cookie:{}},sendAdblockPage:false,sameDomainCookiesOnly:false,secureCookie:false,sendAdblockPageOptions:{},useServerSideCookies:false};var loadOptionsState=d$1(clone(defaultLoadOptions));
1157
+ var defaultLoadOptions={configUrl:DEFAULT_CONFIG_BE_URL,loadIntegration:true,sessions:{autoTrack:true,timeout:DEFAULT_SESSION_TIMEOUT_MS,cutOff:{enabled:false}},sameSiteCookie:'Lax',polyfillIfRequired:true,integrations:DEFAULT_INTEGRATIONS_CONFIG,useBeacon:false,beaconQueueOptions:{},destinationsQueueOptions:{},queueOptions:{},lockIntegrationsVersion:false,lockPluginsVersion:false,uaChTrackLevel:'none',plugins:[],useGlobalIntegrationsConfigInEvents:false,bufferDataPlaneEventsUntilReady:false,dataPlaneEventsBufferTimeout:DEFAULT_DATA_PLANE_EVENTS_BUFFER_TIMEOUT_MS,storage:{encryption:{version:DEFAULT_STORAGE_ENCRYPTION_VERSION},migrate:true,cookie:{}},sendAdblockPage:false,sameDomainCookiesOnly:false,secureCookie:false,sendAdblockPageOptions:{},useServerSideCookies:false};var loadOptionsState=d$1(clone(defaultLoadOptions));
1175
1158
 
1176
1159
  var DEFAULT_USER_SESSION_VALUES={userId:'',userTraits:{},anonymousId:'',groupId:'',groupTraits:{},initialReferrer:'',initialReferringDomain:'',sessionInfo:{},authToken:null};var SERVER_SIDE_COOKIES_DEBOUNCE_TIME=10;// milliseconds
1177
1160
 
@@ -1294,8 +1277,8 @@
1294
1277
 
1295
1278
  var getErrInstance=function getErrInstance(err,errorType){switch(errorType){case ErrorType.UNHANDLEDEXCEPTION:{var _ref=err,error=_ref.error;return error||err;}case ErrorType.UNHANDLEDREJECTION:{return err.reason;}case ErrorType.HANDLEDEXCEPTION:default:return err;}};var createNewBreadcrumb=function createNewBreadcrumb(message){return {type:'manual',name:message,timestamp:new Date(),metaData:{}};};/**
1296
1279
  * A function to get the Bugsnag release stage for the current environment
1297
- * @returns 'development' if the host is empty (for file:// protocol etc.) or a dev host (localhost, 127.0.0.1, etc.), otherwise 'production' (it'll be replaced with the actual release stage during the build)
1298
- */var getReleaseStage=function getReleaseStage(){var host=globalThis.location.hostname;return !host||host&&DEV_HOSTS.includes(host)?'development':'production';};var getAppStateForMetadata=function getAppStateForMetadata(state){var stateStr=stringifyWithoutCircular(state,false,APP_STATE_EXCLUDE_KEYS);return stateStr!==null?JSON.parse(stateStr):{};};var getURLWithoutQueryString=function getURLWithoutQueryString(){var url=globalThis.location.href.split('?');return url[0];};var getUserDetails=function getUserDetails(source,session,lifecycle,autoTrack){var _source$value$id,_source$value,_session$sessionInfo$,_autoTrack$pageLifecy,_source$value$name,_source$value2;return {id:"".concat((_source$value$id=(_source$value=source.value)===null||_source$value===void 0?void 0:_source$value.id)!==null&&_source$value$id!==void 0?_source$value$id:lifecycle.writeKey.value,"..").concat((_session$sessionInfo$=session.sessionInfo.value.id)!==null&&_session$sessionInfo$!==void 0?_session$sessionInfo$:'NA',"..").concat((_autoTrack$pageLifecy=autoTrack.pageLifecycle.pageViewId.value)!==null&&_autoTrack$pageLifecy!==void 0?_autoTrack$pageLifecy:'NA'),name:(_source$value$name=(_source$value2=source.value)===null||_source$value2===void 0?void 0:_source$value2.name)!==null&&_source$value$name!==void 0?_source$value$name:'NA'};};var getDeviceDetails=function getDeviceDetails(locale,userAgent){var _locale$value,_userAgent$value;return {locale:(_locale$value=locale.value)!==null&&_locale$value!==void 0?_locale$value:'NA',userAgent:(_userAgent$value=userAgent.value)!==null&&_userAgent$value!==void 0?_userAgent$value:'NA',time:new Date()};};var getBugsnagErrorEvent=function getBugsnagErrorEvent(exception,errorState,state,groupingHash){var context=state.context,lifecycle=state.lifecycle,session=state.session,source=state.source,reporting=state.reporting,autoTrack=state.autoTrack;var app=context.app,locale=context.locale,userAgent=context.userAgent,timezone=context.timezone,screen=context.screen,library=context.library;return {payloadVersion:'5',notifier:{name:NOTIFIER_NAME,version:app.value.version,url:SDK_GITHUB_URL},events:[{exceptions:[clone(exception)],severity:errorState.severity,unhandled:errorState.unhandled,severityReason:errorState.severityReason,app:{version:app.value.version,releaseStage:getReleaseStage(),type:app.value.installType},device:getDeviceDetails(locale,userAgent),request:{url:getURLWithoutQueryString(),clientIp:'[NOT COLLECTED]'},breadcrumbs:clone(reporting.breadcrumbs.value),context:exception.message,groupingHash:groupingHash,metaData:_objectSpread2({app:{snippetVersion:library.value.snippetVersion},device:_objectSpread2(_objectSpread2({},screen.value),{},{timezone:timezone.value})},getAppStateForMetadata(state)),user:getUserDetails(source,session,lifecycle,autoTrack)}]};};/**
1280
+ * @returns 'development' if the host is empty (for file:// protocol etc.) or a dev host (localhost, 127.0.0.1, etc.), otherwise 'beta' (it'll be replaced with the actual release stage during the build)
1281
+ */var getReleaseStage=function getReleaseStage(){var host=globalThis.location.hostname;return !host||host&&DEV_HOSTS.includes(host)?'development':'beta';};var getAppStateForMetadata=function getAppStateForMetadata(state){var stateStr=stringifyWithoutCircular(state,false,APP_STATE_EXCLUDE_KEYS);return stateStr!==null?JSON.parse(stateStr):{};};var getURLWithoutQueryString=function getURLWithoutQueryString(){var url=globalThis.location.href.split('?');return url[0];};var getUserDetails=function getUserDetails(source,session,lifecycle,autoTrack){var _source$value$id,_source$value,_session$sessionInfo$,_autoTrack$pageLifecy,_source$value$name,_source$value2;return {id:"".concat((_source$value$id=(_source$value=source.value)===null||_source$value===void 0?void 0:_source$value.id)!==null&&_source$value$id!==void 0?_source$value$id:lifecycle.writeKey.value,"..").concat((_session$sessionInfo$=session.sessionInfo.value.id)!==null&&_session$sessionInfo$!==void 0?_session$sessionInfo$:'NA',"..").concat((_autoTrack$pageLifecy=autoTrack.pageLifecycle.pageViewId.value)!==null&&_autoTrack$pageLifecy!==void 0?_autoTrack$pageLifecy:'NA'),name:(_source$value$name=(_source$value2=source.value)===null||_source$value2===void 0?void 0:_source$value2.name)!==null&&_source$value$name!==void 0?_source$value$name:'NA'};};var getDeviceDetails=function getDeviceDetails(locale,userAgent){var _locale$value,_userAgent$value;return {locale:(_locale$value=locale.value)!==null&&_locale$value!==void 0?_locale$value:'NA',userAgent:(_userAgent$value=userAgent.value)!==null&&_userAgent$value!==void 0?_userAgent$value:'NA',time:new Date()};};var getBugsnagErrorEvent=function getBugsnagErrorEvent(exception,errorState,state,groupingHash){var context=state.context,lifecycle=state.lifecycle,session=state.session,source=state.source,reporting=state.reporting,autoTrack=state.autoTrack;var app=context.app,locale=context.locale,userAgent=context.userAgent,timezone=context.timezone,screen=context.screen,library=context.library;return {payloadVersion:'5',notifier:{name:NOTIFIER_NAME,version:app.value.version,url:SDK_GITHUB_URL},events:[{exceptions:[clone(exception)],severity:errorState.severity,unhandled:errorState.unhandled,severityReason:errorState.severityReason,app:{version:app.value.version,releaseStage:getReleaseStage(),type:app.value.installType},device:getDeviceDetails(locale,userAgent),request:{url:getURLWithoutQueryString(),clientIp:'[NOT COLLECTED]'},breadcrumbs:clone(reporting.breadcrumbs.value),context:exception.message,groupingHash:groupingHash,metaData:_objectSpread2({app:{snippetVersion:library.value.snippetVersion},device:_objectSpread2(_objectSpread2({},screen.value),{},{timezone:timezone.value})},getAppStateForMetadata(state)),user:getUserDetails(source,session,lifecycle,autoTrack)}]};};/**
1299
1282
  * A function to determine whether the error should be promoted to notify or not
1300
1283
  * @param {Error} exception
1301
1284
  * @returns
@@ -1434,7 +1417,7 @@
1434
1417
 
1435
1418
  var QueueStatuses={IN_PROGRESS:'inProgress',QUEUE:'queue',RECLAIM_START:'reclaimStart',RECLAIM_END:'reclaimEnd',ACK:'ack',BATCH_QUEUE:'batchQueue'};
1436
1419
 
1437
- var BEACON_PLUGIN_EVENTS_QUEUE_DEBUG=function BEACON_PLUGIN_EVENTS_QUEUE_DEBUG(context){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"Sending events to data plane.");};var BEACON_QUEUE_STRING_CONVERSION_FAILURE_ERROR=function BEACON_QUEUE_STRING_CONVERSION_FAILURE_ERROR(context){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"Failed to convert events batch object to string.");};var BEACON_QUEUE_BLOB_CONVERSION_FAILURE_ERROR=function BEACON_QUEUE_BLOB_CONVERSION_FAILURE_ERROR(context){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"Failed to convert events batch object to Blob.");};var BEACON_QUEUE_SEND_ERROR=function BEACON_QUEUE_SEND_ERROR(context){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"Failed to send events batch data to the browser's beacon queue. The events will be dropped.");};var BEACON_QUEUE_DELIVERY_ERROR=function BEACON_QUEUE_DELIVERY_ERROR(url){return "Failed to send events batch data to the browser's beacon queue for URL ".concat(url,".");};
1420
+ var BEACON_PLUGIN_EVENTS_QUEUE_DEBUG=function BEACON_PLUGIN_EVENTS_QUEUE_DEBUG(context){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"Sending events to data plane.");};var BEACON_QUEUE_STRING_CONVERSION_FAILURE_ERROR=function BEACON_QUEUE_STRING_CONVERSION_FAILURE_ERROR(context){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"Failed to convert events batch object to string.");};var BEACON_QUEUE_BLOB_CONVERSION_FAILURE_ERROR=function BEACON_QUEUE_BLOB_CONVERSION_FAILURE_ERROR(context){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"Failed to convert events batch object to Blob.");};var BEACON_QUEUE_SEND_ERROR=function BEACON_QUEUE_SEND_ERROR(context){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"Failed to send events batch data to the browser's beacon queue.");};var BEACON_QUEUE_DELIVERY_ERROR=function BEACON_QUEUE_DELIVERY_ERROR(url){return "Failed to send events batch data to the browser's beacon queue for URL ".concat(url,".");};
1438
1421
 
1439
1422
  var DEFAULT_BEACON_QUEUE_MAX_SIZE=10;var DEFAULT_BEACON_QUEUE_FLUSH_INTERVAL_MS=10*60*1000;// 10 minutes
1440
1423
  // Limit of the Beacon transfer mechanism on the browsers
@@ -1531,7 +1514,7 @@
1531
1514
  inProgressItem.firstAttemptedAt=firstAttemptedAt;// Update the last attempted at to current timestamp for the in progress item
1532
1515
  inProgressItem.lastAttemptedAt=_now;_inProgress[el.id]=inProgressItem;_this.setStorageEntry(QueueStatuses.IN_PROGRESS,_inProgress);}// A decimal integer representing the seconds since the first attempt
1533
1516
  var timeSinceFirstAttempt=Math.round((_now-firstAttemptedAt)/1000);// A decimal integer representing the seconds since the last attempt
1534
- var timeSinceLastAttempt=Math.round((_now-lastAttemptedAt)/1000);var willBeRetried=_this.shouldRetry(el.item,el.attemptNumber+1);_this.processQueueCb(el.item,el.done,{retryAttemptNumber:el.attemptNumber,maxRetryAttempts:_this.maxAttempts,willBeRetried:willBeRetried,timeSinceFirstAttempt:timeSinceFirstAttempt,timeSinceLastAttempt:timeSinceLastAttempt,reclaimed:reclaimed});}catch(err){var _this$logger;var errMsg='';if(el.attemptNumber<_this.maxAttempts){errMsg='The item will be requeued.';if(el.attemptNumber>0){errMsg="".concat(errMsg," Retry attempt ").concat(el.attemptNumber," of ").concat(_this.maxAttempts,".");}// requeue the item to be retried
1517
+ var timeSinceLastAttempt=Math.round((_now-lastAttemptedAt)/1000);var willBeRetried=_this.shouldRetry(el.item,el.attemptNumber+1);_this.processQueueCb(el.item,el.done,{retryAttemptNumber:el.attemptNumber,maxRetryAttempts:_this.maxAttempts,willBeRetried:willBeRetried,timeSinceFirstAttempt:timeSinceFirstAttempt,timeSinceLastAttempt:timeSinceLastAttempt,reclaimed:reclaimed,isPageAccessible:_this.isPageAccessible});}catch(err){var _this$logger;var errMsg='';if(el.attemptNumber<_this.maxAttempts){errMsg='The item will be requeued.';if(el.attemptNumber>0){errMsg="".concat(errMsg," Retry attempt ").concat(el.attemptNumber," of ").concat(_this.maxAttempts,".");}// requeue the item to be retried
1535
1518
  el.done(err);}else {errMsg="Retries exhausted (".concat(_this.maxAttempts,"). The item will be dropped.");// drop the event as we're unable to process it
1536
1519
  // after the max attempts are exhausted
1537
1520
  el.done();}(_this$logger=_this.logger)===null||_this$logger===void 0||_this$logger.error(RETRY_QUEUE_PROCESS_ERROR(RETRY_QUEUE,errMsg),err);}});// re-read the queue in case the process function finished immediately or added another item
@@ -1562,8 +1545,11 @@
1562
1545
  * @param errorHandler Error handler instance
1563
1546
  * @param logger Logger instance
1564
1547
  * @returns BeaconItemsQueue instance
1565
- */init:function init(state,httpClient,storeManager,errorHandler,logger){var _state$loadOptions$va;var writeKey=state.lifecycle.writeKey.value;var dataplaneUrl=state.lifecycle.activeDataplaneUrl.value;var url=getDeliveryUrl$1(dataplaneUrl,writeKey);var finalQOpts=getNormalizedBeaconQueueOptions((_state$loadOptions$va=state.loadOptions.value.beaconQueueOptions)!==null&&_state$loadOptions$va!==void 0?_state$loadOptions$va:{});var queueProcessCallback=function queueProcessCallback(itemData,done){logger===null||logger===void 0||logger.debug(BEACON_PLUGIN_EVENTS_QUEUE_DEBUG(BEACON_QUEUE_PLUGIN));var currentTime=getCurrentTimeFormatted();var finalEvents=itemData.map(function(queueItemData){return getFinalEventForDeliveryMutator(queueItemData.event,currentTime);});var data=getBatchDeliveryPayload$1(finalEvents,currentTime,logger);if(data){try{var isEnqueuedInBeacon=navigator.sendBeacon(url,data);if(!isEnqueuedInBeacon){logger===null||logger===void 0||logger.error(BEACON_QUEUE_SEND_ERROR(BEACON_QUEUE_PLUGIN));}done(null,isEnqueuedInBeacon);}catch(err){errorHandler===null||errorHandler===void 0||errorHandler.onError(err,BEACON_QUEUE_PLUGIN,BEACON_QUEUE_DELIVERY_ERROR(url));// Remove the item from queue
1566
- done(null);}}else {// Mark the item as done so that it can be removed from the queue
1548
+ */init:function init(state,httpClient,storeManager,errorHandler,logger){var _state$loadOptions$va;var writeKey=state.lifecycle.writeKey.value;var dataplaneUrl=state.lifecycle.activeDataplaneUrl.value;var url=getDeliveryUrl$1(dataplaneUrl,writeKey);var finalQOpts=getNormalizedBeaconQueueOptions((_state$loadOptions$va=state.loadOptions.value.beaconQueueOptions)!==null&&_state$loadOptions$va!==void 0?_state$loadOptions$va:{});var queueProcessCallback=function queueProcessCallback(itemData,done,info){var isPageAccessible=info.isPageAccessible;logger===null||logger===void 0||logger.debug(BEACON_PLUGIN_EVENTS_QUEUE_DEBUG(BEACON_QUEUE_PLUGIN));var currentTime=getCurrentTimeFormatted();var finalEvents=itemData.map(function(queueItemData){return getFinalEventForDeliveryMutator(queueItemData.event,currentTime);});var data=getBatchDeliveryPayload$1(finalEvents,currentTime,logger);if(!data){// Mark the item as done so that it can be removed from the queue
1549
+ done(null);return;}try{if(!navigator.sendBeacon(url,data)){if(isPageAccessible){logger===null||logger===void 0||logger.error("".concat(BEACON_QUEUE_SEND_ERROR(BEACON_QUEUE_PLUGIN)," The event(s) will be dropped."));// Remove the item from queue
1550
+ done(null);}else {// Note: We're not removing the item from the queue as we want to retry the request
1551
+ logger===null||logger===void 0||logger.warn("".concat(BEACON_QUEUE_SEND_ERROR(BEACON_QUEUE_PLUGIN)," The event(s) will be retried as the current page is being unloaded."));}}else {// Remove the item from queue as the request was successful
1552
+ done(null);}}catch(err){errorHandler===null||errorHandler===void 0||errorHandler.onError(err,BEACON_QUEUE_PLUGIN,BEACON_QUEUE_DELIVERY_ERROR(url));// Remove the item from queue
1567
1553
  done(null);}};var eventsQueue=new RetryQueue("".concat(QUEUE_NAME$3,"_").concat(writeKey),{batch:{enabled:true,flushInterval:finalQOpts.flushQueueInterval,maxSize:MAX_BATCH_PAYLOAD_SIZE_BYTES,// set the hard limit
1568
1554
  maxItems:finalQOpts.maxItems}},queueProcessCallback,storeManager,LOCAL_STORAGE,logger,function(itemData){var currentTime=getCurrentTimeFormatted();var events=itemData.map(function(queueItemData){return queueItemData.event;});// type casting to Blob as we know that the event has already been validated prior to enqueue
1569
1555
  return getBatchDeliveryPayload$1(events,currentTime,logger).size;});return eventsQueue;},/**
@@ -1793,11 +1779,45 @@
1793
1779
  * @returns Combined destinations integrations config
1794
1780
  */var getCumulativeIntegrationsConfig=function getCumulativeIntegrationsConfig(dest,curDestIntgConfig,errorHandler){var _dest$instance;var integrationsConfig=curDestIntgConfig;if(isFunction((_dest$instance=dest.instance)===null||_dest$instance===void 0?void 0:_dest$instance.getDataForIntegrationsObject)){try{var _dest$instance2;integrationsConfig=mergeDeepRight(curDestIntgConfig,getSanitizedValue((_dest$instance2=dest.instance)===null||_dest$instance2===void 0?void 0:_dest$instance2.getDataForIntegrationsObject()));}catch(err){errorHandler===null||errorHandler===void 0||errorHandler.onError(err,DEVICE_MODE_DESTINATIONS_PLUGIN,DESTINATION_INTEGRATIONS_DATA_ERROR(dest.userFriendlyId));}}return integrationsConfig;};var initializeDestination=function initializeDestination(dest,state,destSDKIdentifier,sdkTypeName,errorHandler,logger){try{var initializedDestination=clone(dest);var destInstance=createDestinationInstance(destSDKIdentifier,sdkTypeName,dest,state);initializedDestination.instance=destInstance;destInstance.init();_isDestinationReady(initializedDestination).then(function(){// Collect the integrations data for the hybrid mode destinations
1795
1781
  if(isHybridModeDestination(initializedDestination)){state.nativeDestinations.integrationsConfig.value=getCumulativeIntegrationsConfig(initializedDestination,state.nativeDestinations.integrationsConfig.value,errorHandler);}state.nativeDestinations.initializedDestinations.value=[].concat(_toConsumableArray(state.nativeDestinations.initializedDestinations.value),[initializedDestination]);}).catch(function(err){state.nativeDestinations.failedDestinations.value=[].concat(_toConsumableArray(state.nativeDestinations.failedDestinations.value),[dest]);// The error message is already formatted in the isDestinationReady function
1796
- logger===null||logger===void 0||logger.error(err);});}catch(err){state.nativeDestinations.failedDestinations.value=[].concat(_toConsumableArray(state.nativeDestinations.failedDestinations.value),[dest]);errorHandler===null||errorHandler===void 0||errorHandler.onError(err,DEVICE_MODE_DESTINATIONS_PLUGIN,DESTINATION_INIT_ERROR(dest.userFriendlyId));}};
1782
+ logger===null||logger===void 0||logger.error(err);});}catch(err){state.nativeDestinations.failedDestinations.value=[].concat(_toConsumableArray(state.nativeDestinations.failedDestinations.value),[dest]);errorHandler===null||errorHandler===void 0||errorHandler.onError(err,DEVICE_MODE_DESTINATIONS_PLUGIN,DESTINATION_INIT_ERROR(dest.userFriendlyId));}};/**
1783
+ * Applies source configuration overrides to destinations
1784
+ * @param destinations Array of destinations to process
1785
+ * @param sourceConfigOverride Source configuration override options
1786
+ * @param logger Logger instance for warnings
1787
+ * @returns Array of destinations with overrides applied
1788
+ */var applySourceConfigurationOverrides=function applySourceConfigurationOverrides(destinations,sourceConfigOverride,logger){var _sourceConfigOverride;if(!(sourceConfigOverride!==null&&sourceConfigOverride!==void 0&&(_sourceConfigOverride=sourceConfigOverride.destinations)!==null&&_sourceConfigOverride!==void 0&&_sourceConfigOverride.length)){return filterDisabledDestination(destinations);}var destIds=destinations.map(function(dest){return dest.id;});// Group overrides by destination ID to support future cloning
1789
+ // When cloning is implemented, multiple overrides with same ID will create multiple destination instances
1790
+ var overridesByDestId={};sourceConfigOverride.destinations.forEach(function(override){var existing=overridesByDestId[override.id]||[];existing.push(override);overridesByDestId[override.id]=existing;});// Find unmatched destination IDs and log warning
1791
+ var unmatchedIds=Object.keys(overridesByDestId).filter(function(id){return !destIds.includes(id);});if(unmatchedIds.length>0){logger===null||logger===void 0||logger.warn("".concat(DEVICE_MODE_DESTINATIONS_PLUGIN,":: Source configuration override - Unable to identify the destinations with the following IDs: \"").concat(unmatchedIds.join(', '),"\""));}// Process overrides and apply them to destinations
1792
+ var processedDestinations=[];destinations.forEach(function(dest){var overrides=overridesByDestId[dest.id];if(!overrides||overrides.length===0){// No override for this destination, keep original
1793
+ processedDestinations.push(dest);return;}if(overrides.length>1){// Multiple overrides for the same destination, create clones
1794
+ overrides.forEach(function(override,index){var overriddenDestination=applyOverrideToDestination(dest,override,"".concat(index+1));overriddenDestination.cloned=true;processedDestinations.push(overriddenDestination);});}else {var overriddenDestination=applyOverrideToDestination(dest,overrides[0]);processedDestinations.push(overriddenDestination);}});return filterDisabledDestination(processedDestinations);};/**
1795
+ * This function filters out disabled destinations from the provided array.
1796
+ * @param destinations Array of destinations to filter
1797
+ * @returns Filtered destinations to only include enabled ones
1798
+ */var filterDisabledDestination=function filterDisabledDestination(destinations){return destinations.filter(function(dest){return dest.enabled;});};/**
1799
+ * Applies a single override configuration to a destination
1800
+ * @param destination Original destination
1801
+ * @param override Override configuration
1802
+ * @param cloneId Unique identifier for the clone,
1803
+ * if provided, the value is appended to the id and userFriendlyId of the destination
1804
+ * @returns Modified destination with override applied
1805
+ */var applyOverrideToDestination=function applyOverrideToDestination(destination,override,cloneId){// Check if any changes are needed
1806
+ var isEnabledStatusChanged=isBoolean(override.enabled)&&override.enabled!==destination.enabled;// Check if config is provided
1807
+ var isConfigChanged=isNonEmptyObject(override.config);// Determine the final enabled status after applying overrides
1808
+ var finalEnabledStatus=isBoolean(override.enabled)?override.enabled:destination.enabled;// Check if config will actually be applied (only for enabled destinations)
1809
+ var willApplyConfig=isConfigChanged&&finalEnabledStatus;// If no changes needed and no cloneId, return original destination
1810
+ if(!isEnabledStatusChanged&&!willApplyConfig&&!cloneId){return destination;}// Clone destination and apply overrides
1811
+ var clonedDest=clone(destination);if(cloneId){clonedDest.id="".concat(destination.id,"_").concat(cloneId);clonedDest.userFriendlyId="".concat(destination.userFriendlyId,"_").concat(cloneId);}// Apply enabled status override if provided and different
1812
+ if(isEnabledStatusChanged){clonedDest.enabled=override.enabled;// Mark as overridden
1813
+ clonedDest.overridden=true;}// Apply config overrides if provided for enabled destination
1814
+ if(willApplyConfig){// Override the config with the new config and remove undefined and null values
1815
+ clonedDest.config=_removeUndefinedAndNullValues(_objectSpread2(_objectSpread2({},clonedDest.config),override.config));clonedDest.overridden=true;}return clonedDest;};
1797
1816
 
1798
1817
  var pluginName$b='DeviceModeDestinations';var DeviceModeDestinations=function DeviceModeDestinations(){return {name:pluginName$b,initialize:function initialize(state){state.plugins.loadedPlugins.value=[].concat(_toConsumableArray(state.plugins.loadedPlugins.value),[pluginName$b]);},nativeDestinations:{setActiveDestinations:function setActiveDestinations(state,pluginsManager,errorHandler,logger){var _state$consents$postC,_state$consents$postC2;state.nativeDestinations.loadIntegration.value=state.loadOptions.value.loadIntegration;// Filter destination that doesn't have mapping config-->Integration names
1799
- var configSupportedDestinations=state.nativeDestinations.configuredDestinations.value.filter(function(configDest){if(destDisplayNamesToFileNamesMap[configDest.displayName]){return true;}errorHandler===null||errorHandler===void 0||errorHandler.onError(new Error(DESTINATION_NOT_SUPPORTED_ERROR(configDest.userFriendlyId)),DEVICE_MODE_DESTINATIONS_PLUGIN);return false;});// Filter destinations that are disabled through load or consent API options
1800
- var destinationsToLoad=filterDestinations((_state$consents$postC=(_state$consents$postC2=state.consents.postConsent.value)===null||_state$consents$postC2===void 0?void 0:_state$consents$postC2.integrations)!==null&&_state$consents$postC!==void 0?_state$consents$postC:state.nativeDestinations.loadOnlyIntegrations.value,configSupportedDestinations);var consentedDestinations=destinationsToLoad.filter(function(dest){var _pluginsManager$invok;return(// if consent manager is not configured, then default to load the destination
1818
+ var configSupportedDestinations=state.nativeDestinations.configuredDestinations.value.filter(function(configDest){if(destDisplayNamesToFileNamesMap[configDest.displayName]){return true;}errorHandler===null||errorHandler===void 0||errorHandler.onError(new Error(DESTINATION_NOT_SUPPORTED_ERROR(configDest.userFriendlyId)),DEVICE_MODE_DESTINATIONS_PLUGIN);return false;});// Apply source configuration overrides if provided
1819
+ var destinationsWithOverrides=state.loadOptions.value.sourceConfigurationOverride?applySourceConfigurationOverrides(configSupportedDestinations,state.loadOptions.value.sourceConfigurationOverride,logger):configSupportedDestinations;// Filter destinations that are disabled through load or consent API options
1820
+ var destinationsToLoad=filterDestinations((_state$consents$postC=(_state$consents$postC2=state.consents.postConsent.value)===null||_state$consents$postC2===void 0?void 0:_state$consents$postC2.integrations)!==null&&_state$consents$postC!==void 0?_state$consents$postC:state.nativeDestinations.loadOnlyIntegrations.value,destinationsWithOverrides);var consentedDestinations=destinationsToLoad.filter(function(dest){var _pluginsManager$invok;return(// if consent manager is not configured, then default to load the destination
1801
1821
  (_pluginsManager$invok=pluginsManager.invokeSingle("consentManager.isDestinationConsented",state,dest.config,errorHandler,logger))!==null&&_pluginsManager$invok!==void 0?_pluginsManager$invok:true);});state.nativeDestinations.activeDestinations.value=consentedDestinations;},load:function load(state,externalSrcLoader,errorHandler,logger,externalScriptOnLoad){var integrationsCDNPath=state.lifecycle.integrationsCDNPath.value;var activeDestinations=state.nativeDestinations.activeDestinations.value;activeDestinations.forEach(function(dest){var sdkName=destDisplayNamesToFileNamesMap[dest.displayName];var destSDKIdentifier="".concat(sdkName,"_RS");// this is the name of the object loaded on the window
1802
1822
  var sdkTypeName=sdkName;if(sdkTypeName&&!isDestinationSDKMounted(destSDKIdentifier,sdkTypeName)){var destSdkURL="".concat(integrationsCDNPath,"/").concat(sdkName,".min.js");externalSrcLoader.loadJSFile({url:destSdkURL,id:dest.userFriendlyId,callback:externalScriptOnLoad!==null&&externalScriptOnLoad!==void 0?externalScriptOnLoad:function(id){if(!id){logger===null||logger===void 0||logger.error(DESTINATION_SDK_LOAD_ERROR(DEVICE_MODE_DESTINATIONS_PLUGIN,dest.userFriendlyId));state.nativeDestinations.failedDestinations.value=[].concat(_toConsumableArray(state.nativeDestinations.failedDestinations.value),[dest]);}else {initializeDestination(dest,state,destSDKIdentifier,sdkTypeName,errorHandler,logger);}},timeout:SCRIPT_LOAD_TIMEOUT_MS});}else if(sdkTypeName){initializeDestination(dest,state,destSDKIdentifier,sdkTypeName,errorHandler,logger);}else {logger===null||logger===void 0||logger.error(DESTINATION_SDK_LOAD_ERROR(DEVICE_MODE_DESTINATIONS_PLUGIN,dest.displayName));}});}}};};
1803
1823
 
@@ -1998,7 +2018,11 @@
1998
2018
  case 'blacklistedEvents':{if(!isValidEventName(eventName)){return false;}var trimmedEventName=eventName.trim();if(Array.isArray(blacklistedEvents)){return blacklistedEvents.some(function(eventObj){return eventObj.eventName.trim()===trimmedEventName;});}return false;}// Whitelist is chosen for filtering events
1999
2019
  case 'whitelistedEvents':{if(!isValidEventName(eventName)){return true;}var _trimmedEventName=eventName.trim();if(Array.isArray(whitelistedEvents)){return !whitelistedEvents.some(function(eventObj){return eventObj.eventName.trim()===_trimmedEventName;});}return true;}case 'disable':default:return false;}};var sendEventToDestination=function sendEventToDestination(item,dest,errorHandler,logger){var methodName=item.type.toString();try{var _dest$instance,_dest$instance$method;// Destinations expect the event to be wrapped under the `message` key
2000
2020
  // This will remain until we update the destinations to accept the event directly
2001
- (_dest$instance=dest.instance)===null||_dest$instance===void 0||(_dest$instance$method=_dest$instance[methodName])===null||_dest$instance$method===void 0||_dest$instance$method.call(_dest$instance,{message:item});}catch(err){errorHandler===null||errorHandler===void 0||errorHandler.onError(err,NATIVE_DESTINATION_QUEUE_PLUGIN,DESTINATION_EVENT_FORWARDING_ERROR(dest.userFriendlyId));}};
2021
+ (_dest$instance=dest.instance)===null||_dest$instance===void 0||(_dest$instance$method=_dest$instance[methodName])===null||_dest$instance$method===void 0||_dest$instance$method.call(_dest$instance,{message:item});}catch(err){errorHandler===null||errorHandler===void 0||errorHandler.onError(err,NATIVE_DESTINATION_QUEUE_PLUGIN,DESTINATION_EVENT_FORWARDING_ERROR(dest.userFriendlyId));}};/**
2022
+ * A function to check if device mode transformation should be applied for a destination.
2023
+ * @param dest Destination object
2024
+ * @returns Boolean indicating whether the transformation should be applied
2025
+ */var shouldApplyTransformation=function shouldApplyTransformation(dest){return dest.shouldApplyDeviceModeTransformation&&!dest.cloned;};
2002
2026
 
2003
2027
  var pluginName$5='NativeDestinationQueue';var NativeDestinationQueue=function NativeDestinationQueue(){return {name:pluginName$5,deps:[],initialize:function initialize(state){state.plugins.loadedPlugins.value=[].concat(_toConsumableArray(state.plugins.loadedPlugins.value),[pluginName$5]);},destinationsEventsQueue:{/**
2004
2028
  * Initialize the queue for delivery to destinations
@@ -2010,7 +2034,7 @@
2010
2034
  * @returns IQueue instance
2011
2035
  */init:function init(state,pluginsManager,storeManager,dmtQueue,errorHandler,logger){var finalQOpts=getNormalizedQueueOptions$1(state.loadOptions.value.destinationsQueueOptions);var writeKey=state.lifecycle.writeKey.value;var eventsQueue=new RetryQueue(// adding write key to the queue name to avoid conflicts
2012
2036
  "".concat(QUEUE_NAME$1,"_").concat(writeKey),finalQOpts,function(rudderEvent,done){var destinationsToSend=filterDestinations(rudderEvent.integrations,state.nativeDestinations.initializedDestinations.value);// list of destinations which are enable for DMT
2013
- var destWithTransformationEnabled=[];var clonedRudderEvent=clone(rudderEvent);destinationsToSend.forEach(function(dest){try{var sendEvent=!isEventDenyListed(clonedRudderEvent.type,clonedRudderEvent.event,dest);if(!sendEvent){logger===null||logger===void 0||logger.warn(DESTINATION_EVENT_FILTERING_WARNING(NATIVE_DESTINATION_QUEUE_PLUGIN,clonedRudderEvent.event,dest.userFriendlyId));return;}if(dest.shouldApplyDeviceModeTransformation){destWithTransformationEnabled.push(dest);}else {sendEventToDestination(clonedRudderEvent,dest,errorHandler,logger);}}catch(e){errorHandler===null||errorHandler===void 0||errorHandler.onError(e,NATIVE_DESTINATION_QUEUE_PLUGIN);}});if(destWithTransformationEnabled.length>0){pluginsManager.invokeSingle('transformEvent.enqueue',state,dmtQueue,clonedRudderEvent,destWithTransformationEnabled,errorHandler,logger);}// Mark success always
2037
+ var destWithTransformationEnabled=[];var clonedRudderEvent=clone(rudderEvent);destinationsToSend.forEach(function(dest){try{var sendEvent=!isEventDenyListed(clonedRudderEvent.type,clonedRudderEvent.event,dest);if(!sendEvent){logger===null||logger===void 0||logger.warn(DESTINATION_EVENT_FILTERING_WARNING(NATIVE_DESTINATION_QUEUE_PLUGIN,clonedRudderEvent.event,dest.userFriendlyId));return;}if(shouldApplyTransformation(dest)){destWithTransformationEnabled.push(dest);}else {sendEventToDestination(clonedRudderEvent,dest,errorHandler,logger);}}catch(e){errorHandler===null||errorHandler===void 0||errorHandler.onError(e,NATIVE_DESTINATION_QUEUE_PLUGIN);}});if(destWithTransformationEnabled.length>0){pluginsManager.invokeSingle('transformEvent.enqueue',state,dmtQueue,clonedRudderEvent,destWithTransformationEnabled,errorHandler,logger);}// Mark success always
2014
2038
  done(null);},storeManager,MEMORY_STORAGE);// TODO: This seems to not work as expected. Need to investigate
2015
2039
  // effect(() => {
2016
2040
  // if (state.nativeDestinations.clientDestinationsReady.value === true) {
@@ -3077,7 +3101,9 @@
3077
3101
 
3078
3102
  var EVENT_DELIVERY_FAILURE_ERROR_PREFIX=function EVENT_DELIVERY_FAILURE_ERROR_PREFIX(context,originalErrorMsg){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"Failed to deliver event(s). Cause: ").concat(originalErrorMsg,".");};
3079
3103
 
3080
- var getBatchDeliveryPayload=function getBatchDeliveryPayload(events,currentTime,logger){var batchPayload={batch:events,sentAt:currentTime};return stringifyWithoutCircular(batchPayload,true,undefined,logger);};var getNormalizedQueueOptions=function getNormalizedQueueOptions(queueOpts){return mergeDeepRight(DEFAULT_RETRY_QUEUE_OPTIONS,queueOpts);};var getDeliveryUrl=function getDeliveryUrl(dataplaneUrl,endpoint){var dpUrl=new URL(dataplaneUrl);return new URL(removeDuplicateSlashes([dpUrl.pathname,'/',DATA_PLANE_API_VERSION,'/',endpoint].join('')),dpUrl).href;};var getBatchDeliveryUrl=function getBatchDeliveryUrl(dataplaneUrl){return getDeliveryUrl(dataplaneUrl,'batch');};var logErrorOnFailure=function logErrorOnFailure(details,isRetryable,qItemProcessInfo,logger){var _details$error$messag,_details$error;var errMsg=EVENT_DELIVERY_FAILURE_ERROR_PREFIX(XHR_QUEUE_PLUGIN,(_details$error$messag=details===null||details===void 0||(_details$error=details.error)===null||_details$error===void 0?void 0:_details$error.message)!==null&&_details$error$messag!==void 0?_details$error$messag:'Unknown');var dropMsg="The event(s) will be dropped.";if(isRetryable){if(qItemProcessInfo.willBeRetried){errMsg="".concat(errMsg," The event(s) will be retried.");if(qItemProcessInfo.retryAttemptNumber>0){errMsg="".concat(errMsg," Retry attempt ").concat(qItemProcessInfo.retryAttemptNumber," of ").concat(qItemProcessInfo.maxRetryAttempts,".");}}else {errMsg="".concat(errMsg," Retries exhausted (").concat(qItemProcessInfo.maxRetryAttempts,"). ").concat(dropMsg);}}else {errMsg="".concat(errMsg," ").concat(dropMsg);}logger===null||logger===void 0||logger.error(errMsg);};var getRequestInfo=function getRequestInfo(itemData,state,qItemProcessInfo,logger){var data;var headers;var url;var currentTime=getCurrentTimeFormatted();if(Array.isArray(itemData)){var finalEvents=itemData.map(function(queueItemData){return getFinalEventForDeliveryMutator(queueItemData.event,currentTime);});data=getBatchDeliveryPayload(finalEvents,currentTime,logger);headers=itemData[0]?clone(itemData[0].headers):{};url=getBatchDeliveryUrl(state.lifecycle.activeDataplaneUrl.value);}else {var eventUrl=itemData.url,event=itemData.event,eventHeaders=itemData.headers;var finalEvent=getFinalEventForDeliveryMutator(event,currentTime);data=getDeliveryPayload(finalEvent,logger);headers=clone(eventHeaders);url=eventUrl;}// Add current timestamp as sentAt header
3104
+ var getBatchDeliveryPayload=function getBatchDeliveryPayload(events,currentTime,logger){var batchPayload={batch:events,sentAt:currentTime};return stringifyWithoutCircular(batchPayload,true,undefined,logger);};var getNormalizedQueueOptions=function getNormalizedQueueOptions(queueOpts){return mergeDeepRight(DEFAULT_RETRY_QUEUE_OPTIONS,queueOpts);};var getDeliveryUrl=function getDeliveryUrl(dataplaneUrl,endpoint){var dpUrl=new URL(dataplaneUrl);return new URL(removeDuplicateSlashes([dpUrl.pathname,'/',DATA_PLANE_API_VERSION,'/',endpoint].join('')),dpUrl).href;};var getBatchDeliveryUrl=function getBatchDeliveryUrl(dataplaneUrl){return getDeliveryUrl(dataplaneUrl,'batch');};var logMessageOnFailure=function logMessageOnFailure(details,isRetryable,qItemProcessInfo,logger){var _details$error$messag,_details$error;if(!logger){return;}var logMsg=EVENT_DELIVERY_FAILURE_ERROR_PREFIX(XHR_QUEUE_PLUGIN,(_details$error$messag=details===null||details===void 0||(_details$error=details.error)===null||_details$error===void 0?void 0:_details$error.message)!==null&&_details$error$messag!==void 0?_details$error$messag:'Unknown');var dropMsg="The event(s) will be dropped.";if(isRetryable){if(qItemProcessInfo.willBeRetried){logMsg="".concat(logMsg," The event(s) will be retried.");if(qItemProcessInfo.retryAttemptNumber>0){logMsg="".concat(logMsg," Retry attempt ").concat(qItemProcessInfo.retryAttemptNumber," of ").concat(qItemProcessInfo.maxRetryAttempts,".");}// Use warning for retryable failures that will be retried
3105
+ logger.warn(logMsg);}else {logger.error("".concat(logMsg," Retries exhausted (").concat(qItemProcessInfo.maxRetryAttempts,"). ").concat(dropMsg));}}else {// Use error for non-retryable failures
3106
+ logger.error("".concat(logMsg," ").concat(dropMsg));}};var getRequestInfo=function getRequestInfo(itemData,state,qItemProcessInfo,logger){var data;var headers;var url;var currentTime=getCurrentTimeFormatted();if(Array.isArray(itemData)){var finalEvents=itemData.map(function(queueItemData){return getFinalEventForDeliveryMutator(queueItemData.event,currentTime);});data=getBatchDeliveryPayload(finalEvents,currentTime,logger);headers=itemData[0]?clone(itemData[0].headers):{};url=getBatchDeliveryUrl(state.lifecycle.activeDataplaneUrl.value);}else {var eventUrl=itemData.url,event=itemData.event,eventHeaders=itemData.headers;var finalEvent=getFinalEventForDeliveryMutator(event,currentTime);data=getDeliveryPayload(finalEvent,logger);headers=clone(eventHeaders);url=eventUrl;}// Add current timestamp as sentAt header
3081
3107
  // The same value is added in the event payload as well
3082
3108
  headers.SentAt=currentTime;// Add a header to indicate if the item has been reclaimed from
3083
3109
  // local storage
@@ -3098,7 +3124,7 @@
3098
3124
  */init:function init(state,httpClient,storeManager,errorHandler,logger){var writeKey=state.lifecycle.writeKey.value;httpClient.setAuthHeader(writeKey);var finalQOpts=getNormalizedQueueOptions(state.loadOptions.value.queueOptions);var eventsQueue=new RetryQueue(// adding write key to the queue name to avoid conflicts
3099
3125
  "".concat(QUEUE_NAME,"_").concat(writeKey),finalQOpts,function(itemData,done,qItemProcessInfo){var _getRequestInfo=getRequestInfo(itemData,state,qItemProcessInfo,logger),data=_getRequestInfo.data,url=_getRequestInfo.url,headers=_getRequestInfo.headers;httpClient.getAsyncData({url:url,options:{method:'POST',headers:headers,data:data,sendRawData:true},isRawResponse:true,timeout:REQUEST_TIMEOUT_MS,callback:function callback(result,details){var _details$xhr$status,_details$xhr;// If there is no error, we can consider the item as delivered
3100
3126
  if(isUndefined(details===null||details===void 0?void 0:details.error)){// null means item will not be processed further and will be removed from the queue (even from the storage)
3101
- done(null);return;}var isRetryable=isErrRetryable((_details$xhr$status=details===null||details===void 0||(_details$xhr=details.xhr)===null||_details$xhr===void 0?void 0:_details$xhr.status)!==null&&_details$xhr$status!==void 0?_details$xhr$status:0);logErrorOnFailure(details,isRetryable,qItemProcessInfo,logger);// null means item will not be processed further and will be removed from the queue (even from the storage)
3127
+ done(null);return;}var isRetryable=isErrRetryable((_details$xhr$status=details===null||details===void 0||(_details$xhr=details.xhr)===null||_details$xhr===void 0?void 0:_details$xhr.status)!==null&&_details$xhr$status!==void 0?_details$xhr$status:0);logMessageOnFailure(details,isRetryable,qItemProcessInfo,logger);// null means item will not be processed further and will be removed from the queue (even from the storage)
3102
3128
  var queueErrResp=isRetryable?details:null;done(queueErrResp);}});},storeManager,LOCAL_STORAGE,logger,function(itemData){var _getBatchDeliveryPayl;var currentTime=getCurrentTimeFormatted();var events=itemData.map(function(queueItemData){return queueItemData.event;});// type casting to string as we know that the event has already been validated prior to enqueue
3103
3129
  return (_getBatchDeliveryPayl=getBatchDeliveryPayload(events,currentTime,logger))===null||_getBatchDeliveryPayl===void 0?void 0:_getBatchDeliveryPayl.length;});return eventsQueue;},/**
3104
3130
  * Add event to the queue for delivery
@@ -3343,13 +3369,6 @@
3343
3369
  topDomain="".concat(parts[parts.length-2],".").concat(parts[parts.length-1]);}else {// If only two parts or less, return as it is
3344
3370
  topDomain=host;}return {topDomain:topDomain,protocol:protocol};};var getTopDomainUrl=function getTopDomainUrl(url){var _getTopDomain=getTopDomain(url),topDomain=_getTopDomain.topDomain,protocol=_getTopDomain.protocol;return "".concat(protocol,"//").concat(topDomain);};var getDataServiceUrl=function getDataServiceUrl(endpoint,useExactDomain){var url=useExactDomain?window.location.origin:getTopDomainUrl(window.location.href);var formattedEndpoint=endpoint.startsWith('/')?endpoint.substring(1):endpoint;return "".concat(url,"/").concat(formattedEndpoint);};var isWebpageTopLevelDomain=function isWebpageTopLevelDomain(providedDomain){var _getTopDomain2=getTopDomain(window.location.href),topDomain=_getTopDomain2.topDomain;return topDomain===providedDomain;};
3345
3371
 
3346
- /**
3347
- * A function to filter enabled destinations and map to required properties only
3348
- * @param destinations
3349
- *
3350
- * @returns Destination[]
3351
- */var filterEnabledDestination=function filterEnabledDestination(destinations){var nativeDestinations=[];destinations.forEach(function(destination){if(destination.enabled&&!destination.deleted){nativeDestinations.push({id:destination.id,displayName:destination.destinationDefinition.displayName,config:destination.config,shouldApplyDeviceModeTransformation:destination.shouldApplyDeviceModeTransformation||false,propagateEventsUntransformedOnError:destination.propagateEventsUntransformedOnError||false,userFriendlyId:"".concat(destination.destinationDefinition.displayName.replaceAll(' ','-'),"___").concat(destination.id)});}});return nativeDestinations;};
3352
-
3353
3372
  /**
3354
3373
  * Removes trailing slash from url
3355
3374
  * @param url
@@ -3441,7 +3460,11 @@
3441
3460
  * @param resp Source config response
3442
3461
  * @param logger Logger instance
3443
3462
  */var updateConsentsState=function updateConsentsState(resp){var resolutionStrategy=state.consents.resolutionStrategy.value;var cmpMetadata;if(isObjectLiteralAndNotNull(resp.consentManagementMetadata)){if(state.consents.provider.value){var _resp$consentManageme,_resp$consentManageme2;resolutionStrategy=(_resp$consentManageme=(_resp$consentManageme2=resp.consentManagementMetadata.providers.find(function(p){return p.provider===state.consents.provider.value;}))===null||_resp$consentManageme2===void 0?void 0:_resp$consentManageme2.resolutionStrategy)!==null&&_resp$consentManageme!==void 0?_resp$consentManageme:state.consents.resolutionStrategy.value;}cmpMetadata=resp.consentManagementMetadata;}// If the provider is custom, then the resolution strategy is not applicable
3444
- if(state.consents.provider.value==='custom'){resolutionStrategy=undefined;}r(function(){state.consents.metadata.value=clone(cmpMetadata);state.consents.resolutionStrategy.value=resolutionStrategy;});};var updateDataPlaneEventsStateFromLoadOptions=function updateDataPlaneEventsStateFromLoadOptions(logger){if(state.dataPlaneEvents.deliveryEnabled.value){var defaultEventsQueuePluginName='XhrQueue';var eventsQueuePluginName=defaultEventsQueuePluginName;if(state.loadOptions.value.useBeacon){if(state.capabilities.isBeaconAvailable.value){eventsQueuePluginName='BeaconQueue';}else {eventsQueuePluginName=defaultEventsQueuePluginName;logger.warn(UNSUPPORTED_BEACON_API_WARNING(CONFIG_MANAGER));}}r(function(){state.dataPlaneEvents.eventsQueuePluginName.value=eventsQueuePluginName;});}};var getSourceConfigURL=function getSourceConfigURL(configUrl,writeKey,lockIntegrationsVersion,lockPluginsVersion,logger){var defSearchParams=new URLSearchParams({p:MODULE_TYPE,v:APP_VERSION,build:BUILD_TYPE,writeKey:writeKey,lockIntegrationsVersion:lockIntegrationsVersion.toString(),lockPluginsVersion:lockPluginsVersion.toString()});var origin=DEFAULT_CONFIG_BE_URL;var searchParams=defSearchParams;var pathname='/sourceConfig/';var hash='';if(isValidURL(configUrl)){var configUrlInstance=new URL(configUrl);if(!_removeTrailingSlashes(configUrlInstance.pathname).endsWith('/sourceConfig')){configUrlInstance.pathname="".concat(_removeTrailingSlashes(configUrlInstance.pathname),"/sourceConfig/");}configUrlInstance.pathname=removeDuplicateSlashes(configUrlInstance.pathname);defSearchParams.forEach(function(value,key){if(configUrlInstance.searchParams.get(key)===null){configUrlInstance.searchParams.set(key,value);}});origin=configUrlInstance.origin;pathname=configUrlInstance.pathname;searchParams=configUrlInstance.searchParams;hash=configUrlInstance.hash;}else {logger.warn(INVALID_CONFIG_URL_WARNING(CONFIG_MANAGER,configUrl));}return "".concat(origin).concat(pathname,"?").concat(searchParams).concat(hash);};
3463
+ if(state.consents.provider.value==='custom'){resolutionStrategy=undefined;}r(function(){state.consents.metadata.value=clone(cmpMetadata);state.consents.resolutionStrategy.value=resolutionStrategy;});};var updateDataPlaneEventsStateFromLoadOptions=function updateDataPlaneEventsStateFromLoadOptions(logger){if(state.dataPlaneEvents.deliveryEnabled.value){var defaultEventsQueuePluginName='XhrQueue';var eventsQueuePluginName=defaultEventsQueuePluginName;if(state.loadOptions.value.useBeacon){if(state.capabilities.isBeaconAvailable.value){eventsQueuePluginName='BeaconQueue';}else {eventsQueuePluginName=defaultEventsQueuePluginName;logger.warn(UNSUPPORTED_BEACON_API_WARNING(CONFIG_MANAGER));}}r(function(){state.dataPlaneEvents.eventsQueuePluginName.value=eventsQueuePluginName;});}};var getSourceConfigURL=function getSourceConfigURL(configUrl,writeKey,lockIntegrationsVersion,lockPluginsVersion,logger){var defSearchParams=new URLSearchParams({p:MODULE_TYPE,v:APP_VERSION,build:BUILD_TYPE,writeKey:writeKey,lockIntegrationsVersion:lockIntegrationsVersion.toString(),lockPluginsVersion:lockPluginsVersion.toString()});var origin=DEFAULT_CONFIG_BE_URL;var searchParams=defSearchParams;var pathname='/sourceConfig/';var hash='';if(isValidURL(configUrl)){var configUrlInstance=new URL(configUrl);if(!_removeTrailingSlashes(configUrlInstance.pathname).endsWith('/sourceConfig')){configUrlInstance.pathname="".concat(_removeTrailingSlashes(configUrlInstance.pathname),"/sourceConfig/");}configUrlInstance.pathname=removeDuplicateSlashes(configUrlInstance.pathname);defSearchParams.forEach(function(value,key){if(configUrlInstance.searchParams.get(key)===null){configUrlInstance.searchParams.set(key,value);}});origin=configUrlInstance.origin;pathname=configUrlInstance.pathname;searchParams=configUrlInstance.searchParams;hash=configUrlInstance.hash;}else {logger.warn(INVALID_CONFIG_URL_WARNING(CONFIG_MANAGER,configUrl));}return "".concat(origin).concat(pathname,"?").concat(searchParams).concat(hash);};/**
3464
+ * Transforms destinations config from source config response to Destination format
3465
+ * @param destinations Array of destination items from config response
3466
+ * @returns Array of transformed Destination objects
3467
+ */var getDestinationsFromConfig=function getDestinationsFromConfig(destinations){return destinations.map(function(destination){var _destination$shouldAp,_destination$propagat;return {id:destination.id,displayName:destination.destinationDefinition.displayName,enabled:destination.enabled,config:destination.config,shouldApplyDeviceModeTransformation:(_destination$shouldAp=destination.shouldApplyDeviceModeTransformation)!==null&&_destination$shouldAp!==void 0?_destination$shouldAp:false,propagateEventsUntransformedOnError:(_destination$propagat=destination.propagateEventsUntransformedOnError)!==null&&_destination$propagat!==void 0?_destination$propagat:false,userFriendlyId:"".concat(destination.destinationDefinition.displayName.replaceAll(' ','-'),"___").concat(destination.id)};});};
3445
3468
 
3446
3469
  /**
3447
3470
  * A function that determines the base URL for the integrations or plugins SDK
@@ -3483,7 +3506,7 @@
3483
3506
  // We can use isErrRetryable utility method
3484
3507
  if(!isDefined(response)){if(isDefined(details)){this.onError(details.error,SOURCE_CONFIG_FETCH_ERROR);}else {this.onError(new Error(SOURCE_CONFIG_FETCH_ERROR));}return;}var res;try{if(isString(response)){res=JSON.parse(response);}else {res=response;}}catch(err){this.onError(err,SOURCE_CONFIG_RESOLUTION_ERROR);return;}if(!isValidSourceConfig(res)){this.onError(new Error(SOURCE_CONFIG_RESOLUTION_ERROR));return;}// Log error and abort if source is disabled
3485
3508
  if(res.source.enabled===false){this.logger.error(SOURCE_DISABLED_ERROR);return;}// set the values in state for reporting slice
3486
- updateReportingState(res);var nativeDestinations=res.source.destinations.length>0?filterEnabledDestination(res.source.destinations):[];// set in the state --> source, destination, lifecycle, reporting
3509
+ updateReportingState(res);var nativeDestinations=res.source.destinations.length>0?getDestinationsFromConfig(res.source.destinations):[];// set in the state --> source, destination, lifecycle, reporting
3487
3510
  r(function(){var _state$loadOptions$va2;// set source related information in state
3488
3511
  state.source.value={config:res.source.config,name:res.source.name,id:res.source.id,workspaceId:res.source.workspaceId};// set device mode destination related information in state
3489
3512
  state.nativeDestinations.configuredDestinations.value=nativeDestinations;// set the desired optional plugins
@@ -3852,7 +3875,7 @@
3852
3875
  */var defaultOptionalPluginsList=['BeaconQueue','CustomConsentManager','DeviceModeDestinations','DeviceModeTransformation','ExternalAnonymousId','GoogleLinker','IubendaConsentManager','KetchConsentManager','NativeDestinationQueue','OneTrustConsentManager','StorageEncryption','StorageEncryptionLegacy','StorageMigrator','XhrQueue'];
3853
3876
 
3854
3877
  var normalizeLoadOptions=function normalizeLoadOptions(loadOptionsFromState,loadOptions){// TODO: Maybe add warnings for invalid values
3855
- var normalizedLoadOpts=clone(loadOptions);if(!isString(normalizedLoadOpts.setCookieDomain)){normalizedLoadOpts.setCookieDomain=undefined;}var cookieSameSiteValues=['Strict','Lax','None'];if(!cookieSameSiteValues.includes(normalizedLoadOpts.sameSiteCookie)){normalizedLoadOpts.sameSiteCookie=undefined;}normalizedLoadOpts.secureCookie=getNormalizedBooleanValue(normalizedLoadOpts.secureCookie,loadOptionsFromState.secureCookie);normalizedLoadOpts.sameDomainCookiesOnly=getNormalizedBooleanValue(normalizedLoadOpts.sameDomainCookiesOnly,loadOptionsFromState.sameDomainCookiesOnly);var uaChTrackLevels=['none','default','full'];if(!uaChTrackLevels.includes(normalizedLoadOpts.uaChTrackLevel)){normalizedLoadOpts.uaChTrackLevel=undefined;}normalizedLoadOpts.integrations=getNormalizedObjectValue(normalizedLoadOpts.integrations);if(!Array.isArray(normalizedLoadOpts.plugins)){normalizedLoadOpts.plugins=defaultOptionalPluginsList;}normalizedLoadOpts.useGlobalIntegrationsConfigInEvents=getNormalizedBooleanValue(normalizedLoadOpts.useGlobalIntegrationsConfigInEvents,loadOptionsFromState.useGlobalIntegrationsConfigInEvents);normalizedLoadOpts.bufferDataPlaneEventsUntilReady=getNormalizedBooleanValue(normalizedLoadOpts.bufferDataPlaneEventsUntilReady,loadOptionsFromState.bufferDataPlaneEventsUntilReady);normalizedLoadOpts.sendAdblockPage=getNormalizedBooleanValue(normalizedLoadOpts.sendAdblockPage,loadOptionsFromState.sendAdblockPage);normalizedLoadOpts.useServerSideCookies=getNormalizedBooleanValue(normalizedLoadOpts.useServerSideCookies,loadOptionsFromState.useServerSideCookies);if(!isString(normalizedLoadOpts.dataServiceEndpoint)){normalizedLoadOpts.dataServiceEndpoint=undefined;}normalizedLoadOpts.sendAdblockPageOptions=getNormalizedObjectValue(normalizedLoadOpts.sendAdblockPageOptions);normalizedLoadOpts.loadIntegration=getNormalizedBooleanValue(normalizedLoadOpts.loadIntegration,loadOptionsFromState.loadIntegration);if(!isNonEmptyObject(normalizedLoadOpts.storage)){normalizedLoadOpts.storage=undefined;}else {var _loadOptionsFromState;normalizedLoadOpts.storage.migrate=getNormalizedBooleanValue(normalizedLoadOpts.storage.migrate,(_loadOptionsFromState=loadOptionsFromState.storage)===null||_loadOptionsFromState===void 0?void 0:_loadOptionsFromState.migrate);normalizedLoadOpts.storage.cookie=getNormalizedObjectValue(normalizedLoadOpts.storage.cookie);normalizedLoadOpts.storage.encryption=getNormalizedObjectValue(normalizedLoadOpts.storage.encryption);normalizedLoadOpts.storage=_removeUndefinedAndNullValues(normalizedLoadOpts.storage);}normalizedLoadOpts.destinationsQueueOptions=getNormalizedObjectValue(normalizedLoadOpts.destinationsQueueOptions);normalizedLoadOpts.queueOptions=getNormalizedObjectValue(normalizedLoadOpts.queueOptions);normalizedLoadOpts.lockIntegrationsVersion=getNormalizedBooleanValue(normalizedLoadOpts.lockIntegrationsVersion,loadOptionsFromState.lockIntegrationsVersion);normalizedLoadOpts.lockPluginsVersion=getNormalizedBooleanValue(normalizedLoadOpts.lockPluginsVersion,loadOptionsFromState.lockPluginsVersion);if(!isNumber(normalizedLoadOpts.dataPlaneEventsBufferTimeout)){normalizedLoadOpts.dataPlaneEventsBufferTimeout=undefined;}normalizedLoadOpts.beaconQueueOptions=getNormalizedObjectValue(normalizedLoadOpts.beaconQueueOptions);normalizedLoadOpts.preConsent=getNormalizedObjectValue(normalizedLoadOpts.preConsent);var mergedLoadOptions=mergeDeepRight(loadOptionsFromState,_removeUndefinedAndNullValues(normalizedLoadOpts));return mergedLoadOptions;};
3878
+ var normalizedLoadOpts=clone(loadOptions);if(!isString(normalizedLoadOpts.setCookieDomain)){normalizedLoadOpts.setCookieDomain=undefined;}var cookieSameSiteValues=['Strict','Lax','None'];if(!cookieSameSiteValues.includes(normalizedLoadOpts.sameSiteCookie)){normalizedLoadOpts.sameSiteCookie=undefined;}normalizedLoadOpts.secureCookie=getNormalizedBooleanValue(normalizedLoadOpts.secureCookie,loadOptionsFromState.secureCookie);normalizedLoadOpts.sameDomainCookiesOnly=getNormalizedBooleanValue(normalizedLoadOpts.sameDomainCookiesOnly,loadOptionsFromState.sameDomainCookiesOnly);var uaChTrackLevels=['none','default','full'];if(!uaChTrackLevels.includes(normalizedLoadOpts.uaChTrackLevel)){normalizedLoadOpts.uaChTrackLevel=undefined;}normalizedLoadOpts.integrations=getNormalizedObjectValue(normalizedLoadOpts.integrations);if(!Array.isArray(normalizedLoadOpts.plugins)){normalizedLoadOpts.plugins=defaultOptionalPluginsList;}normalizedLoadOpts.useGlobalIntegrationsConfigInEvents=getNormalizedBooleanValue(normalizedLoadOpts.useGlobalIntegrationsConfigInEvents,loadOptionsFromState.useGlobalIntegrationsConfigInEvents);normalizedLoadOpts.bufferDataPlaneEventsUntilReady=getNormalizedBooleanValue(normalizedLoadOpts.bufferDataPlaneEventsUntilReady,loadOptionsFromState.bufferDataPlaneEventsUntilReady);normalizedLoadOpts.sendAdblockPage=getNormalizedBooleanValue(normalizedLoadOpts.sendAdblockPage,loadOptionsFromState.sendAdblockPage);normalizedLoadOpts.useServerSideCookies=getNormalizedBooleanValue(normalizedLoadOpts.useServerSideCookies,loadOptionsFromState.useServerSideCookies);if(!isString(normalizedLoadOpts.dataServiceEndpoint)){normalizedLoadOpts.dataServiceEndpoint=undefined;}normalizedLoadOpts.sendAdblockPageOptions=getNormalizedObjectValue(normalizedLoadOpts.sendAdblockPageOptions);normalizedLoadOpts.loadIntegration=getNormalizedBooleanValue(normalizedLoadOpts.loadIntegration,loadOptionsFromState.loadIntegration);if(!isNonEmptyObject(normalizedLoadOpts.storage)){normalizedLoadOpts.storage=undefined;}else {var _loadOptionsFromState;normalizedLoadOpts.storage.migrate=getNormalizedBooleanValue(normalizedLoadOpts.storage.migrate,(_loadOptionsFromState=loadOptionsFromState.storage)===null||_loadOptionsFromState===void 0?void 0:_loadOptionsFromState.migrate);normalizedLoadOpts.storage.cookie=getNormalizedObjectValue(normalizedLoadOpts.storage.cookie);normalizedLoadOpts.storage.encryption=getNormalizedObjectValue(normalizedLoadOpts.storage.encryption);normalizedLoadOpts.storage=_removeUndefinedAndNullValues(normalizedLoadOpts.storage);}normalizedLoadOpts.destinationsQueueOptions=getNormalizedObjectValue(normalizedLoadOpts.destinationsQueueOptions);normalizedLoadOpts.queueOptions=getNormalizedObjectValue(normalizedLoadOpts.queueOptions);normalizedLoadOpts.lockIntegrationsVersion=getNormalizedBooleanValue(normalizedLoadOpts.lockIntegrationsVersion,loadOptionsFromState.lockIntegrationsVersion);normalizedLoadOpts.lockPluginsVersion=getNormalizedBooleanValue(normalizedLoadOpts.lockPluginsVersion,loadOptionsFromState.lockPluginsVersion);if(!isNumber(normalizedLoadOpts.dataPlaneEventsBufferTimeout)){normalizedLoadOpts.dataPlaneEventsBufferTimeout=undefined;}normalizedLoadOpts.beaconQueueOptions=getNormalizedObjectValue(normalizedLoadOpts.beaconQueueOptions);normalizedLoadOpts.preConsent=getNormalizedObjectValue(normalizedLoadOpts.preConsent);normalizedLoadOpts.sourceConfigurationOverride=getNormalizedObjectValue(normalizedLoadOpts.sourceConfigurationOverride);var mergedLoadOptions=mergeDeepRight(loadOptionsFromState,_removeUndefinedAndNullValues(normalizedLoadOpts));return mergedLoadOptions;};
3856
3879
 
3857
3880
  var DATA_PLANE_QUEUE_EXT_POINT_PREFIX='dataplaneEventsQueue';var DESTINATIONS_QUEUE_EXT_POINT_PREFIX='destinationsEventsQueue';var DMT_EXT_POINT_PREFIX='transformEvent';
3858
3881