@contentful/optimization-web 0.1.0-alpha → 0.1.0-alpha4

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/index.js CHANGED
@@ -1,13 +1,13 @@
1
- var Nr = Symbol.for("preact-signals");
2
- function st() {
3
- if (X > 1)
4
- X--;
1
+ var Ur = Symbol.for("preact-signals");
2
+ function ot() {
3
+ if (J > 1)
4
+ J--;
5
5
  else {
6
- for (var t, e = !1; Oe !== void 0; ) {
7
- var n = Oe;
8
- for (Oe = void 0, Rt++; n !== void 0; ) {
6
+ for (var t, e = !1; Me !== void 0; ) {
7
+ var n = Me;
8
+ for (Me = void 0, Rt++; n !== void 0; ) {
9
9
  var r = n.o;
10
- if (n.o = void 0, n.f &= -3, !(8 & n.f) && On(n)) try {
10
+ if (n.o = void 0, n.f &= -3, !(8 & n.f) && Vn(n)) try {
11
11
  n.c();
12
12
  } catch (i) {
13
13
  e || (t = i, e = !0);
@@ -15,48 +15,48 @@ function st() {
15
15
  n = r;
16
16
  }
17
17
  }
18
- if (Rt = 0, X--, e) throw t;
18
+ if (Rt = 0, J--, e) throw t;
19
19
  }
20
20
  }
21
- function Re(t) {
22
- if (X > 0) return t();
23
- X++;
21
+ function ye(t) {
22
+ if (J > 0) return t();
23
+ J++;
24
24
  try {
25
25
  return t();
26
26
  } finally {
27
- st();
27
+ ot();
28
28
  }
29
29
  }
30
- var v = void 0;
31
- function Cn(t) {
32
- var e = v;
33
- v = void 0;
30
+ var y = void 0;
31
+ function Dt(t) {
32
+ var e = y;
33
+ y = void 0;
34
34
  try {
35
35
  return t();
36
36
  } finally {
37
- v = e;
37
+ y = e;
38
38
  }
39
39
  }
40
- var Oe = void 0, X = 0, Rt = 0, et = 0;
41
- function Rn(t) {
42
- if (v !== void 0) {
40
+ var Me = void 0, J = 0, Rt = 0, Xe = 0;
41
+ function xn(t) {
42
+ if (y !== void 0) {
43
43
  var e = t.n;
44
- if (e === void 0 || e.t !== v)
45
- return e = { i: 0, S: t, p: v.s, n: void 0, t: v, e: void 0, x: void 0, r: e }, v.s !== void 0 && (v.s.n = e), v.s = e, t.n = e, 32 & v.f && t.S(e), e;
44
+ if (e === void 0 || e.t !== y)
45
+ return e = { i: 0, S: t, p: y.s, n: void 0, t: y, e: void 0, x: void 0, r: e }, y.s !== void 0 && (y.s.n = e), y.s = e, t.n = e, 32 & y.f && t.S(e), e;
46
46
  if (e.i === -1)
47
- return e.i = 0, e.n !== void 0 && (e.n.p = e.p, e.p !== void 0 && (e.p.n = e.n), e.p = v.s, e.n = void 0, v.s.n = e, v.s = e), e;
47
+ return e.i = 0, e.n !== void 0 && (e.n.p = e.p, e.p !== void 0 && (e.p.n = e.n), e.p = y.s, e.n = void 0, y.s.n = e, y.s = e), e;
48
48
  }
49
49
  }
50
50
  function C(t, e) {
51
51
  this.v = t, this.i = 0, this.n = void 0, this.t = void 0, this.W = e?.watched, this.Z = e?.unwatched, this.name = e?.name;
52
52
  }
53
- C.prototype.brand = Nr;
53
+ C.prototype.brand = Ur;
54
54
  C.prototype.h = function() {
55
55
  return !0;
56
56
  };
57
57
  C.prototype.S = function(t) {
58
58
  var e = this, n = this.t;
59
- n !== t && t.e === void 0 && (t.x = n, this.t = t, n !== void 0 ? n.e = t : Cn(function() {
59
+ n !== t && t.e === void 0 && (t.x = n, this.t = t, n !== void 0 ? n.e = t : Dt(function() {
60
60
  var r;
61
61
  (r = e.W) == null || r.call(e);
62
62
  }));
@@ -65,7 +65,7 @@ C.prototype.U = function(t) {
65
65
  var e = this;
66
66
  if (this.t !== void 0) {
67
67
  var n = t.e, r = t.x;
68
- n !== void 0 && (n.x = r, t.e = void 0), r !== void 0 && (r.e = n, t.x = void 0), t === this.t && (this.t = r, r === void 0 && Cn(function() {
68
+ n !== void 0 && (n.x = r, t.e = void 0), r !== void 0 && (r.e = n, t.x = void 0), t === this.t && (this.t = r, r === void 0 && Dt(function() {
69
69
  var i;
70
70
  (i = e.Z) == null || i.call(e);
71
71
  }));
@@ -73,13 +73,13 @@ C.prototype.U = function(t) {
73
73
  };
74
74
  C.prototype.subscribe = function(t) {
75
75
  var e = this;
76
- return N(function() {
77
- var n = e.value, r = v;
78
- v = void 0;
76
+ return x(function() {
77
+ var n = e.value, r = y;
78
+ y = void 0;
79
79
  try {
80
80
  t(n);
81
81
  } finally {
82
- v = r;
82
+ y = r;
83
83
  }
84
84
  }, { name: "sub" });
85
85
  };
@@ -93,36 +93,36 @@ C.prototype.toJSON = function() {
93
93
  return this.value;
94
94
  };
95
95
  C.prototype.peek = function() {
96
- var t = v;
97
- v = void 0;
96
+ var t = y;
97
+ y = void 0;
98
98
  try {
99
99
  return this.value;
100
100
  } finally {
101
- v = t;
101
+ y = t;
102
102
  }
103
103
  };
104
104
  Object.defineProperty(C.prototype, "value", { get: function() {
105
- var t = Rn(this);
105
+ var t = xn(this);
106
106
  return t !== void 0 && (t.i = this.i), this.v;
107
107
  }, set: function(t) {
108
108
  if (t !== this.v) {
109
109
  if (Rt > 100) throw new Error("Cycle detected");
110
- this.v = t, this.i++, et++, X++;
110
+ this.v = t, this.i++, Xe++, J++;
111
111
  try {
112
112
  for (var e = this.t; e !== void 0; e = e.x) e.t.N();
113
113
  } finally {
114
- st();
114
+ ot();
115
115
  }
116
116
  }
117
117
  } });
118
- function me(t, e) {
118
+ function _e(t, e) {
119
119
  return new C(t, e);
120
120
  }
121
- function On(t) {
121
+ function Vn(t) {
122
122
  for (var e = t.s; e !== void 0; e = e.n) if (e.S.i !== e.i || !e.S.h() || e.S.i !== e.i) return !0;
123
123
  return !1;
124
124
  }
125
- function Mn(t) {
125
+ function Nn(t) {
126
126
  for (var e = t.s; e !== void 0; e = e.n) {
127
127
  var n = e.S.n;
128
128
  if (n !== void 0 && (e.r = n), e.S.n = e, e.i = -1, e.n === void 0) {
@@ -131,7 +131,7 @@ function Mn(t) {
131
131
  }
132
132
  }
133
133
  }
134
- function xn(t) {
134
+ function Ln(t) {
135
135
  for (var e = t.s, n = void 0; e !== void 0; ) {
136
136
  var r = e.p;
137
137
  e.i === -1 ? (e.S.U(e), r !== void 0 && (r.n = e.n), e.n !== void 0 && (e.n.p = r)) : n = e, e.S.n = e.r, e.r !== void 0 && (e.r = void 0), e = r;
@@ -139,23 +139,23 @@ function xn(t) {
139
139
  t.s = n;
140
140
  }
141
141
  function ae(t, e) {
142
- C.call(this, void 0), this.x = t, this.s = void 0, this.g = et - 1, this.f = 4, this.W = e?.watched, this.Z = e?.unwatched, this.name = e?.name;
142
+ C.call(this, void 0), this.x = t, this.s = void 0, this.g = Xe - 1, this.f = 4, this.W = e?.watched, this.Z = e?.unwatched, this.name = e?.name;
143
143
  }
144
144
  ae.prototype = new C();
145
145
  ae.prototype.h = function() {
146
146
  if (this.f &= -3, 1 & this.f) return !1;
147
- if ((36 & this.f) == 32 || (this.f &= -5, this.g === et)) return !0;
148
- if (this.g = et, this.f |= 1, this.i > 0 && !On(this))
147
+ if ((36 & this.f) == 32 || (this.f &= -5, this.g === Xe)) return !0;
148
+ if (this.g = Xe, this.f |= 1, this.i > 0 && !Vn(this))
149
149
  return this.f &= -2, !0;
150
- var t = v;
150
+ var t = y;
151
151
  try {
152
- Mn(this), v = this;
152
+ Nn(this), y = this;
153
153
  var e = this.x();
154
154
  (16 & this.f || this.v !== e || this.i === 0) && (this.v = e, this.f &= -17, this.i++);
155
155
  } catch (n) {
156
156
  this.v = n, this.f |= 16, this.i++;
157
157
  }
158
- return v = t, xn(this), this.f &= -2, !0;
158
+ return y = t, Ln(this), this.f &= -2, !0;
159
159
  };
160
160
  ae.prototype.S = function(t) {
161
161
  if (this.t === void 0) {
@@ -178,40 +178,40 @@ ae.prototype.N = function() {
178
178
  };
179
179
  Object.defineProperty(ae.prototype, "value", { get: function() {
180
180
  if (1 & this.f) throw new Error("Cycle detected");
181
- var t = Rn(this);
181
+ var t = xn(this);
182
182
  if (this.h(), t !== void 0 && (t.i = this.i), 16 & this.f) throw this.v;
183
183
  return this.v;
184
184
  } });
185
- function Lr(t, e) {
185
+ function jn(t, e) {
186
186
  return new ae(t, e);
187
187
  }
188
- function Vn(t) {
188
+ function Bn(t) {
189
189
  var e = t.u;
190
190
  if (t.u = void 0, typeof e == "function") {
191
- X++;
192
- var n = v;
193
- v = void 0;
191
+ J++;
192
+ var n = y;
193
+ y = void 0;
194
194
  try {
195
195
  e();
196
196
  } catch (r) {
197
197
  throw t.f &= -2, t.f |= 8, Zt(t), r;
198
198
  } finally {
199
- v = n, st();
199
+ y = n, ot();
200
200
  }
201
201
  }
202
202
  }
203
203
  function Zt(t) {
204
204
  for (var e = t.s; e !== void 0; e = e.n) e.S.U(e);
205
- t.x = void 0, t.s = void 0, Vn(t);
205
+ t.x = void 0, t.s = void 0, Bn(t);
206
206
  }
207
- function jr(t) {
208
- if (v !== this) throw new Error("Out-of-order effect");
209
- xn(this), v = t, this.f &= -2, 8 & this.f && Zt(this), st();
207
+ function Dr(t) {
208
+ if (y !== this) throw new Error("Out-of-order effect");
209
+ Ln(this), y = t, this.f &= -2, 8 & this.f && Zt(this), ot();
210
210
  }
211
- function be(t, e) {
211
+ function we(t, e) {
212
212
  this.x = t, this.u = void 0, this.s = void 0, this.o = void 0, this.f = 32, this.name = e?.name;
213
213
  }
214
- be.prototype.c = function() {
214
+ we.prototype.c = function() {
215
215
  var t = this.S();
216
216
  try {
217
217
  if (8 & this.f || this.x === void 0) return;
@@ -221,23 +221,23 @@ be.prototype.c = function() {
221
221
  t();
222
222
  }
223
223
  };
224
- be.prototype.S = function() {
224
+ we.prototype.S = function() {
225
225
  if (1 & this.f) throw new Error("Cycle detected");
226
- this.f |= 1, this.f &= -9, Vn(this), Mn(this), X++;
227
- var t = v;
228
- return v = this, jr.bind(this, t);
226
+ this.f |= 1, this.f &= -9, Bn(this), Nn(this), J++;
227
+ var t = y;
228
+ return y = this, Dr.bind(this, t);
229
229
  };
230
- be.prototype.N = function() {
231
- 2 & this.f || (this.f |= 2, this.o = Oe, Oe = this);
230
+ we.prototype.N = function() {
231
+ 2 & this.f || (this.f |= 2, this.o = Me, Me = this);
232
232
  };
233
- be.prototype.d = function() {
233
+ we.prototype.d = function() {
234
234
  this.f |= 8, 1 & this.f || Zt(this);
235
235
  };
236
- be.prototype.dispose = function() {
236
+ we.prototype.dispose = function() {
237
237
  this.d();
238
238
  };
239
- function N(t, e) {
240
- var n = new be(t, e);
239
+ function x(t, e) {
240
+ var n = new we(t, e);
241
241
  try {
242
242
  n.c();
243
243
  } catch (i) {
@@ -300,28 +300,28 @@ function p(t, e, n) {
300
300
  value: (a) => n?.Parent && a instanceof n.Parent ? !0 : a?._zod?.traits?.has(t)
301
301
  }), Object.defineProperty(s, "name", { value: t }), s;
302
302
  }
303
- class ve extends Error {
303
+ class me extends Error {
304
304
  constructor() {
305
305
  super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");
306
306
  }
307
307
  }
308
- class Br extends Error {
308
+ class Zr extends Error {
309
309
  constructor(e) {
310
310
  super(`Encountered unidirectional transform during encode: ${e}`), this.name = "ZodEncodeError";
311
311
  }
312
312
  }
313
- const Ur = {};
314
- function _e(t) {
315
- return Ur;
313
+ const Fr = {};
314
+ function Ee(t) {
315
+ return Fr;
316
316
  }
317
- function Zr(t) {
317
+ function qr(t) {
318
318
  const e = Object.values(t).filter((r) => typeof r == "number");
319
319
  return Object.entries(t).filter(([r, i]) => e.indexOf(+r) === -1).map(([r, i]) => i);
320
320
  }
321
- function Dr(t, e) {
321
+ function Hr(t, e) {
322
322
  return typeof e == "bigint" ? e.toString() : e;
323
323
  }
324
- function Nn(t) {
324
+ function Un(t) {
325
325
  return {
326
326
  get value() {
327
327
  {
@@ -331,20 +331,20 @@ function Nn(t) {
331
331
  }
332
332
  };
333
333
  }
334
- function Ln(t) {
334
+ function Dn(t) {
335
335
  return t == null;
336
336
  }
337
- function Dt(t) {
337
+ function Ft(t) {
338
338
  const e = t.startsWith("^") ? 1 : 0, n = t.endsWith("$") ? t.length - 1 : t.length;
339
339
  return t.slice(e, n);
340
340
  }
341
- const rn = Symbol("evaluating");
341
+ const sn = Symbol("evaluating");
342
342
  function E(t, e, n) {
343
343
  let r;
344
344
  Object.defineProperty(t, e, {
345
345
  get() {
346
- if (r !== rn)
347
- return r === void 0 && (r = rn, r = n()), r;
346
+ if (r !== sn)
347
+ return r === void 0 && (r = sn, r = n()), r;
348
348
  },
349
349
  set(i) {
350
350
  Object.defineProperty(t, e, {
@@ -355,7 +355,7 @@ function E(t, e, n) {
355
355
  configurable: !0
356
356
  });
357
357
  }
358
- function Ft(t, e, n) {
358
+ function qt(t, e, n) {
359
359
  Object.defineProperty(t, e, {
360
360
  value: n,
361
361
  writable: !0,
@@ -363,7 +363,7 @@ function Ft(t, e, n) {
363
363
  configurable: !0
364
364
  });
365
365
  }
366
- function jn(...t) {
366
+ function Zn(...t) {
367
367
  const e = {};
368
368
  for (const n of t) {
369
369
  const r = Object.getOwnPropertyDescriptors(n);
@@ -371,54 +371,54 @@ function jn(...t) {
371
371
  }
372
372
  return Object.defineProperties({}, e);
373
373
  }
374
- const Bn = "captureStackTrace" in Error ? Error.captureStackTrace : (...t) => {
374
+ const Fn = "captureStackTrace" in Error ? Error.captureStackTrace : (...t) => {
375
375
  };
376
- function tt(t) {
376
+ function et(t) {
377
377
  return typeof t == "object" && t !== null && !Array.isArray(t);
378
378
  }
379
- function qt(t) {
380
- if (tt(t) === !1)
379
+ function Ht(t) {
380
+ if (et(t) === !1)
381
381
  return !1;
382
382
  const e = t.constructor;
383
383
  if (e === void 0)
384
384
  return !0;
385
385
  const n = e.prototype;
386
- return !(tt(n) === !1 || Object.prototype.hasOwnProperty.call(n, "isPrototypeOf") === !1);
386
+ return !(et(n) === !1 || Object.prototype.hasOwnProperty.call(n, "isPrototypeOf") === !1);
387
387
  }
388
- function Fr(t) {
389
- return qt(t) ? { ...t } : t;
388
+ function Kr(t) {
389
+ return Ht(t) ? { ...t } : t;
390
390
  }
391
- const qr = /* @__PURE__ */ new Set(["string", "number", "symbol"]);
391
+ const Wr = /* @__PURE__ */ new Set(["string", "number", "symbol"]);
392
392
  function Mt(t) {
393
393
  return t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
394
394
  }
395
- function Ht(t, e, n) {
395
+ function Kt(t, e, n) {
396
396
  const r = new t._zod.constr(e ?? t._zod.def);
397
397
  return (!e || n?.parent) && (r._zod.parent = t), r;
398
398
  }
399
399
  function R(t) {
400
400
  return {};
401
401
  }
402
- function Hr(t) {
402
+ function Yr(t) {
403
403
  return Object.keys(t).filter((e) => t[e]._zod.optin === "optional" && t[e]._zod.optout === "optional");
404
404
  }
405
- function Kr(t, e) {
406
- if (!qt(e))
405
+ function Gr(t, e) {
406
+ if (!Ht(e))
407
407
  throw new Error("Invalid input to extend: expected a plain object");
408
408
  const n = t._zod.def.checks;
409
409
  if (n && n.length > 0)
410
410
  throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");
411
- const i = jn(t._zod.def, {
411
+ const i = Zn(t._zod.def, {
412
412
  get shape() {
413
413
  const o = { ...t._zod.def.shape, ...e };
414
- return Ft(this, "shape", o), o;
414
+ return qt(this, "shape", o), o;
415
415
  },
416
416
  checks: []
417
417
  });
418
- return Ht(t, i);
418
+ return Kt(t, i);
419
419
  }
420
- function Wr(t, e, n) {
421
- const r = jn(e._zod.def, {
420
+ function Jr(t, e, n) {
421
+ const r = Zn(e._zod.def, {
422
422
  get shape() {
423
423
  const i = e._zod.def.shape, o = { ...i };
424
424
  for (const s in i)
@@ -426,13 +426,13 @@ function Wr(t, e, n) {
426
426
  type: "optional",
427
427
  innerType: i[s]
428
428
  }) : i[s];
429
- return Ft(this, "shape", o), o;
429
+ return qt(this, "shape", o), o;
430
430
  },
431
431
  checks: []
432
432
  });
433
- return Ht(e, r);
433
+ return Kt(e, r);
434
434
  }
435
- function Pe(t, e = 0) {
435
+ function Ce(t, e = 0) {
436
436
  if (t.aborted === !0)
437
437
  return !0;
438
438
  for (let n = e; n < t.issues.length; n++)
@@ -440,7 +440,7 @@ function Pe(t, e = 0) {
440
440
  return !0;
441
441
  return !1;
442
442
  }
443
- function pe(t, e) {
443
+ function he(t, e) {
444
444
  return e.map((n) => {
445
445
  var r;
446
446
  return (r = n).path ?? (r.path = []), n.path.unshift(t), n;
@@ -449,7 +449,7 @@ function pe(t, e) {
449
449
  function qe(t) {
450
450
  return typeof t == "string" ? t : t?.message;
451
451
  }
452
- function we(t, e, n) {
452
+ function Se(t, e, n) {
453
453
  const r = { ...t, path: t.path ?? [] };
454
454
  if (!t.message) {
455
455
  const i = qe(t.inst?._zod.def?.error?.(t)) ?? qe(e?.error?.(t)) ?? qe(n.customError?.(t)) ?? qe(n.localeError?.(t)) ?? "Invalid input";
@@ -457,10 +457,10 @@ function we(t, e, n) {
457
457
  }
458
458
  return delete r.inst, delete r.continue, e?.reportInput || delete r.input, r;
459
459
  }
460
- function Un(t) {
460
+ function qn(t) {
461
461
  return Array.isArray(t) ? "array" : typeof t == "string" ? "string" : "unknown";
462
462
  }
463
- function Gr(...t) {
463
+ function Qr(...t) {
464
464
  const [e, n, r] = t;
465
465
  return typeof e == "string" ? {
466
466
  message: e,
@@ -469,71 +469,71 @@ function Gr(...t) {
469
469
  inst: r
470
470
  } : { ...e };
471
471
  }
472
- const Zn = (t, e) => {
472
+ const Hn = (t, e) => {
473
473
  t.name = "$ZodError", Object.defineProperty(t, "_zod", {
474
474
  value: t._zod,
475
475
  enumerable: !1
476
476
  }), Object.defineProperty(t, "issues", {
477
477
  value: e,
478
478
  enumerable: !1
479
- }), t.message = JSON.stringify(e, Dr, 2), Object.defineProperty(t, "toString", {
479
+ }), t.message = JSON.stringify(e, Hr, 2), Object.defineProperty(t, "toString", {
480
480
  value: () => t.message,
481
481
  enumerable: !1
482
482
  });
483
- }, Jr = p("$ZodError", Zn), at = p("$ZodError", Zn, { Parent: Error }), Qr = (t) => (e, n, r, i) => {
483
+ }, Xr = p("$ZodError", Hn), st = p("$ZodError", Hn, { Parent: Error }), ei = (t) => (e, n, r, i) => {
484
484
  const o = r ? Object.assign(r, { async: !1 }) : { async: !1 }, s = e._zod.run({ value: n, issues: [] }, o);
485
485
  if (s instanceof Promise)
486
- throw new ve();
486
+ throw new me();
487
487
  if (s.issues.length) {
488
- const a = new (i?.Err ?? t)(s.issues.map((c) => we(c, o, _e())));
489
- throw Bn(a, i?.callee), a;
488
+ const a = new (i?.Err ?? t)(s.issues.map((c) => Se(c, o, Ee())));
489
+ throw Fn(a, i?.callee), a;
490
490
  }
491
491
  return s.value;
492
- }, Xr = /* @__PURE__ */ Qr(at), Yr = (t) => async (e, n, r, i) => {
492
+ }, ti = /* @__PURE__ */ ei(st), ni = (t) => async (e, n, r, i) => {
493
493
  const o = r ? Object.assign(r, { async: !0 }) : { async: !0 };
494
494
  let s = e._zod.run({ value: n, issues: [] }, o);
495
495
  if (s instanceof Promise && (s = await s), s.issues.length) {
496
- const a = new (i?.Err ?? t)(s.issues.map((c) => we(c, o, _e())));
497
- throw Bn(a, i?.callee), a;
496
+ const a = new (i?.Err ?? t)(s.issues.map((c) => Se(c, o, Ee())));
497
+ throw Fn(a, i?.callee), a;
498
498
  }
499
499
  return s.value;
500
- }, ei = /* @__PURE__ */ Yr(at), ti = (t) => (e, n, r) => {
500
+ }, ri = /* @__PURE__ */ ni(st), ii = (t) => (e, n, r) => {
501
501
  const i = r ? { ...r, async: !1 } : { async: !1 }, o = e._zod.run({ value: n, issues: [] }, i);
502
502
  if (o instanceof Promise)
503
- throw new ve();
503
+ throw new me();
504
504
  return o.issues.length ? {
505
505
  success: !1,
506
- error: new (t ?? Jr)(o.issues.map((s) => we(s, i, _e())))
506
+ error: new (t ?? Xr)(o.issues.map((s) => Se(s, i, Ee())))
507
507
  } : { success: !0, data: o.value };
508
- }, Dn = /* @__PURE__ */ ti(at), ni = (t) => async (e, n, r) => {
508
+ }, Kn = /* @__PURE__ */ ii(st), oi = (t) => async (e, n, r) => {
509
509
  const i = r ? Object.assign(r, { async: !0 }) : { async: !0 };
510
510
  let o = e._zod.run({ value: n, issues: [] }, i);
511
511
  return o instanceof Promise && (o = await o), o.issues.length ? {
512
512
  success: !1,
513
- error: new t(o.issues.map((s) => we(s, i, _e())))
513
+ error: new t(o.issues.map((s) => Se(s, i, Ee())))
514
514
  } : { success: !0, data: o.value };
515
- }, Fn = /* @__PURE__ */ ni(at), ri = "(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))";
516
- function ii(t) {
515
+ }, Wn = /* @__PURE__ */ oi(st), si = "(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))";
516
+ function ai(t) {
517
517
  const e = "(?:[01]\\d|2[0-3]):[0-5]\\d";
518
518
  return typeof t.precision == "number" ? t.precision === -1 ? `${e}` : t.precision === 0 ? `${e}:[0-5]\\d` : `${e}:[0-5]\\d\\.\\d{${t.precision}}` : `${e}(?::[0-5]\\d(?:\\.\\d+)?)?`;
519
519
  }
520
- function oi(t) {
521
- const e = ii({ precision: t.precision }), n = ["Z"];
520
+ function ci(t) {
521
+ const e = ai({ precision: t.precision }), n = ["Z"];
522
522
  t.local && n.push(""), t.offset && n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");
523
523
  const r = `${e}(?:${n.join("|")})`;
524
- return new RegExp(`^${ri}T(?:${r})$`);
524
+ return new RegExp(`^${si}T(?:${r})$`);
525
525
  }
526
- const si = (t) => {
526
+ const ui = (t) => {
527
527
  const e = t ? `[\\s\\S]{${t?.minimum ?? 0},${t?.maximum ?? ""}}` : "[\\s\\S]*";
528
528
  return new RegExp(`^${e}$`);
529
- }, ai = /^-?\d+(?:\.\d+)?/i, ci = /true|false/i, ui = /null/i, ct = /* @__PURE__ */ p("$ZodCheck", (t, e) => {
529
+ }, li = /^-?\d+(?:\.\d+)?/i, di = /true|false/i, fi = /null/i, at = /* @__PURE__ */ p("$ZodCheck", (t, e) => {
530
530
  var n;
531
531
  t._zod ?? (t._zod = {}), t._zod.def = e, (n = t._zod).onattach ?? (n.onattach = []);
532
- }), li = /* @__PURE__ */ p("$ZodCheckMinLength", (t, e) => {
532
+ }), pi = /* @__PURE__ */ p("$ZodCheckMinLength", (t, e) => {
533
533
  var n;
534
- ct.init(t, e), (n = t._zod.def).when ?? (n.when = (r) => {
534
+ at.init(t, e), (n = t._zod.def).when ?? (n.when = (r) => {
535
535
  const i = r.value;
536
- return !Ln(i) && i.length !== void 0;
536
+ return !Dn(i) && i.length !== void 0;
537
537
  }), t._zod.onattach.push((r) => {
538
538
  const i = r._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
539
539
  e.minimum > i && (r._zod.bag.minimum = e.minimum);
@@ -541,7 +541,7 @@ const si = (t) => {
541
541
  const i = r.value;
542
542
  if (i.length >= e.minimum)
543
543
  return;
544
- const s = Un(i);
544
+ const s = qn(i);
545
545
  r.issues.push({
546
546
  origin: s,
547
547
  code: "too_small",
@@ -552,11 +552,11 @@ const si = (t) => {
552
552
  continue: !e.abort
553
553
  });
554
554
  };
555
- }), di = /* @__PURE__ */ p("$ZodCheckLengthEquals", (t, e) => {
555
+ }), hi = /* @__PURE__ */ p("$ZodCheckLengthEquals", (t, e) => {
556
556
  var n;
557
- ct.init(t, e), (n = t._zod.def).when ?? (n.when = (r) => {
557
+ at.init(t, e), (n = t._zod.def).when ?? (n.when = (r) => {
558
558
  const i = r.value;
559
- return !Ln(i) && i.length !== void 0;
559
+ return !Dn(i) && i.length !== void 0;
560
560
  }), t._zod.onattach.push((r) => {
561
561
  const i = r._zod.bag;
562
562
  i.minimum = e.length, i.maximum = e.length, i.length = e.length;
@@ -564,7 +564,7 @@ const si = (t) => {
564
564
  const i = r.value, o = i.length;
565
565
  if (o === e.length)
566
566
  return;
567
- const s = Un(i), a = o > e.length;
567
+ const s = qn(i), a = o > e.length;
568
568
  r.issues.push({
569
569
  origin: s,
570
570
  ...a ? { code: "too_big", maximum: e.length } : { code: "too_small", minimum: e.length },
@@ -575,9 +575,9 @@ const si = (t) => {
575
575
  continue: !e.abort
576
576
  });
577
577
  };
578
- }), fi = /* @__PURE__ */ p("$ZodCheckStringFormat", (t, e) => {
578
+ }), gi = /* @__PURE__ */ p("$ZodCheckStringFormat", (t, e) => {
579
579
  var n, r;
580
- ct.init(t, e), t._zod.onattach.push((i) => {
580
+ at.init(t, e), t._zod.onattach.push((i) => {
581
581
  const o = i._zod.bag;
582
582
  o.format = e.format, e.pattern && (o.patterns ?? (o.patterns = /* @__PURE__ */ new Set()), o.patterns.add(e.pattern));
583
583
  }), e.pattern ? (n = t._zod).check ?? (n.check = (i) => {
@@ -592,13 +592,13 @@ const si = (t) => {
592
592
  });
593
593
  }) : (r = t._zod).check ?? (r.check = () => {
594
594
  });
595
- }), pi = {
595
+ }), vi = {
596
596
  major: 4,
597
597
  minor: 1,
598
598
  patch: 5
599
599
  }, z = /* @__PURE__ */ p("$ZodType", (t, e) => {
600
600
  var n;
601
- t ?? (t = {}), t._zod.def = e, t._zod.bag = t._zod.bag || {}, t._zod.version = pi;
601
+ t ?? (t = {}), t._zod.def = e, t._zod.bag = t._zod.bag || {}, t._zod.version = vi;
602
602
  const r = [...t._zod.def.checks ?? []];
603
603
  t._zod.traits.has("$ZodCheck") && r.unshift(t);
604
604
  for (const i of r)
@@ -610,7 +610,7 @@ const si = (t) => {
610
610
  });
611
611
  else {
612
612
  const i = (s, a, c) => {
613
- let u = Pe(s), d;
613
+ let u = Ce(s), d;
614
614
  for (const m of a) {
615
615
  if (m._zod.def.when) {
616
616
  if (!m._zod.def.when(s))
@@ -619,25 +619,25 @@ const si = (t) => {
619
619
  continue;
620
620
  const _ = s.issues.length, S = m._zod.check(s);
621
621
  if (S instanceof Promise && c?.async === !1)
622
- throw new ve();
622
+ throw new me();
623
623
  if (d || S instanceof Promise)
624
624
  d = (d ?? Promise.resolve()).then(async () => {
625
- await S, s.issues.length !== _ && (u || (u = Pe(s, _)));
625
+ await S, s.issues.length !== _ && (u || (u = Ce(s, _)));
626
626
  });
627
627
  else {
628
628
  if (s.issues.length === _)
629
629
  continue;
630
- u || (u = Pe(s, _));
630
+ u || (u = Ce(s, _));
631
631
  }
632
632
  }
633
633
  return d ? d.then(() => s) : s;
634
634
  }, o = (s, a, c) => {
635
- if (Pe(s))
635
+ if (Ce(s))
636
636
  return s.aborted = !0, s;
637
637
  const u = i(a, r, c);
638
638
  if (u instanceof Promise) {
639
639
  if (c.async === !1)
640
- throw new ve();
640
+ throw new me();
641
641
  return u.then((d) => t._zod.parse(d, c));
642
642
  }
643
643
  return t._zod.parse(u, c);
@@ -652,7 +652,7 @@ const si = (t) => {
652
652
  const c = t._zod.parse(s, a);
653
653
  if (c instanceof Promise) {
654
654
  if (a.async === !1)
655
- throw new ve();
655
+ throw new me();
656
656
  return c.then((u) => i(u, r, a));
657
657
  }
658
658
  return i(c, r, a);
@@ -661,17 +661,17 @@ const si = (t) => {
661
661
  t["~standard"] = {
662
662
  validate: (i) => {
663
663
  try {
664
- const o = Dn(t, i);
664
+ const o = Kn(t, i);
665
665
  return o.success ? { value: o.data } : { issues: o.error?.issues };
666
666
  } catch {
667
- return Fn(t, i).then((s) => s.success ? { value: s.data } : { issues: s.error?.issues });
667
+ return Wn(t, i).then((s) => s.success ? { value: s.data } : { issues: s.error?.issues });
668
668
  }
669
669
  },
670
670
  vendor: "zod",
671
671
  version: 1
672
672
  };
673
- }), qn = /* @__PURE__ */ p("$ZodString", (t, e) => {
674
- z.init(t, e), t._zod.pattern = [...t?._zod.bag?.patterns ?? []].pop() ?? si(t._zod.bag), t._zod.parse = (n, r) => {
673
+ }), Yn = /* @__PURE__ */ p("$ZodString", (t, e) => {
674
+ z.init(t, e), t._zod.pattern = [...t?._zod.bag?.patterns ?? []].pop() ?? ui(t._zod.bag), t._zod.parse = (n, r) => {
675
675
  if (e.coerce)
676
676
  try {
677
677
  n.value = String(n.value);
@@ -684,12 +684,12 @@ const si = (t) => {
684
684
  inst: t
685
685
  }), n;
686
686
  };
687
- }), Hn = /* @__PURE__ */ p("$ZodStringFormat", (t, e) => {
688
- fi.init(t, e), qn.init(t, e);
689
- }), hi = /* @__PURE__ */ p("$ZodISODateTime", (t, e) => {
690
- e.pattern ?? (e.pattern = oi(e)), Hn.init(t, e);
691
- }), gi = /* @__PURE__ */ p("$ZodNumber", (t, e) => {
692
- z.init(t, e), t._zod.pattern = t._zod.bag.pattern ?? ai, t._zod.parse = (n, r) => {
687
+ }), Gn = /* @__PURE__ */ p("$ZodStringFormat", (t, e) => {
688
+ gi.init(t, e), Yn.init(t, e);
689
+ }), yi = /* @__PURE__ */ p("$ZodISODateTime", (t, e) => {
690
+ e.pattern ?? (e.pattern = ci(e)), Gn.init(t, e);
691
+ }), mi = /* @__PURE__ */ p("$ZodNumber", (t, e) => {
692
+ z.init(t, e), t._zod.pattern = t._zod.bag.pattern ?? li, t._zod.parse = (n, r) => {
693
693
  if (e.coerce)
694
694
  try {
695
695
  n.value = Number(n.value);
@@ -707,8 +707,8 @@ const si = (t) => {
707
707
  ...o ? { received: o } : {}
708
708
  }), n;
709
709
  };
710
- }), vi = /* @__PURE__ */ p("$ZodBoolean", (t, e) => {
711
- z.init(t, e), t._zod.pattern = ci, t._zod.parse = (n, r) => {
710
+ }), bi = /* @__PURE__ */ p("$ZodBoolean", (t, e) => {
711
+ z.init(t, e), t._zod.pattern = di, t._zod.parse = (n, r) => {
712
712
  if (e.coerce)
713
713
  try {
714
714
  n.value = !!n.value;
@@ -722,8 +722,8 @@ const si = (t) => {
722
722
  inst: t
723
723
  }), n;
724
724
  };
725
- }), yi = /* @__PURE__ */ p("$ZodNull", (t, e) => {
726
- z.init(t, e), t._zod.pattern = ui, t._zod.values = /* @__PURE__ */ new Set([null]), t._zod.parse = (n, r) => {
725
+ }), _i = /* @__PURE__ */ p("$ZodNull", (t, e) => {
726
+ z.init(t, e), t._zod.pattern = fi, t._zod.values = /* @__PURE__ */ new Set([null]), t._zod.parse = (n, r) => {
727
727
  const i = n.value;
728
728
  return i === null || n.issues.push({
729
729
  expected: "null",
@@ -732,15 +732,15 @@ const si = (t) => {
732
732
  inst: t
733
733
  }), n;
734
734
  };
735
- }), mi = /* @__PURE__ */ p("$ZodAny", (t, e) => {
735
+ }), wi = /* @__PURE__ */ p("$ZodAny", (t, e) => {
736
736
  z.init(t, e), t._zod.parse = (n) => n;
737
- }), bi = /* @__PURE__ */ p("$ZodUnknown", (t, e) => {
737
+ }), Ei = /* @__PURE__ */ p("$ZodUnknown", (t, e) => {
738
738
  z.init(t, e), t._zod.parse = (n) => n;
739
739
  });
740
- function on(t, e, n) {
741
- t.issues.length && e.issues.push(...pe(n, t.issues)), e.value[n] = t.value;
740
+ function an(t, e, n) {
741
+ t.issues.length && e.issues.push(...he(n, t.issues)), e.value[n] = t.value;
742
742
  }
743
- const _i = /* @__PURE__ */ p("$ZodArray", (t, e) => {
743
+ const Si = /* @__PURE__ */ p("$ZodArray", (t, e) => {
744
744
  z.init(t, e), t._zod.parse = (n, r) => {
745
745
  const i = n.value;
746
746
  if (!Array.isArray(i))
@@ -757,20 +757,20 @@ const _i = /* @__PURE__ */ p("$ZodArray", (t, e) => {
757
757
  value: a,
758
758
  issues: []
759
759
  }, r);
760
- c instanceof Promise ? o.push(c.then((u) => on(u, n, s))) : on(c, n, s);
760
+ c instanceof Promise ? o.push(c.then((u) => an(u, n, s))) : an(c, n, s);
761
761
  }
762
762
  return o.length ? Promise.all(o).then(() => n) : n;
763
763
  };
764
764
  });
765
- function nt(t, e, n, r) {
766
- t.issues.length && e.issues.push(...pe(n, t.issues)), t.value === void 0 ? n in r && (e.value[n] = void 0) : e.value[n] = t.value;
765
+ function tt(t, e, n, r) {
766
+ t.issues.length && e.issues.push(...he(n, t.issues)), t.value === void 0 ? n in r && (e.value[n] = void 0) : e.value[n] = t.value;
767
767
  }
768
- function wi(t) {
768
+ function zi(t) {
769
769
  const e = Object.keys(t.shape);
770
770
  for (const r of e)
771
771
  if (!t.shape[r]._zod.traits.has("$ZodType"))
772
772
  throw new Error(`Invalid element at key "${r}": expected a Zod schema`);
773
- const n = Hr(t.shape);
773
+ const n = Yr(t.shape);
774
774
  return {
775
775
  ...t,
776
776
  keys: e,
@@ -779,7 +779,7 @@ function wi(t) {
779
779
  optionalKeys: new Set(n)
780
780
  };
781
781
  }
782
- function Ei(t, e, n, r, i, o) {
782
+ function Ti(t, e, n, r, i, o) {
783
783
  const s = [], a = i.keySet, c = i.catchall._zod, u = c.def.type;
784
784
  for (const d of Object.keys(e)) {
785
785
  if (a.has(d))
@@ -789,7 +789,7 @@ function Ei(t, e, n, r, i, o) {
789
789
  continue;
790
790
  }
791
791
  const m = c.run({ value: e[d], issues: [] }, r);
792
- m instanceof Promise ? t.push(m.then((_) => nt(_, n, d, e))) : nt(m, n, d, e);
792
+ m instanceof Promise ? t.push(m.then((_) => tt(_, n, d, e))) : tt(m, n, d, e);
793
793
  }
794
794
  return s.length && n.issues.push({
795
795
  code: "unrecognized_keys",
@@ -798,9 +798,9 @@ function Ei(t, e, n, r, i, o) {
798
798
  inst: o
799
799
  }), t.length ? Promise.all(t).then(() => n) : n;
800
800
  }
801
- const Si = /* @__PURE__ */ p("$ZodObject", (t, e) => {
801
+ const ki = /* @__PURE__ */ p("$ZodObject", (t, e) => {
802
802
  z.init(t, e);
803
- const n = Nn(() => wi(e));
803
+ const n = Un(() => zi(e));
804
804
  E(t._zod, "propValues", () => {
805
805
  const s = e.shape, a = {};
806
806
  for (const c in s) {
@@ -813,7 +813,7 @@ const Si = /* @__PURE__ */ p("$ZodObject", (t, e) => {
813
813
  }
814
814
  return a;
815
815
  });
816
- const r = tt, i = e.catchall;
816
+ const r = et, i = e.catchall;
817
817
  let o;
818
818
  t._zod.parse = (s, a) => {
819
819
  o ?? (o = n.value);
@@ -829,31 +829,31 @@ const Si = /* @__PURE__ */ p("$ZodObject", (t, e) => {
829
829
  const u = [], d = o.shape;
830
830
  for (const m of o.keys) {
831
831
  const S = d[m]._zod.run({ value: c[m], issues: [] }, a);
832
- S instanceof Promise ? u.push(S.then((b) => nt(b, s, m, c))) : nt(S, s, m, c);
832
+ S instanceof Promise ? u.push(S.then((b) => tt(b, s, m, c))) : tt(S, s, m, c);
833
833
  }
834
- return i ? Ei(u, c, s, a, n.value, t) : u.length ? Promise.all(u).then(() => s) : s;
834
+ return i ? Ti(u, c, s, a, n.value, t) : u.length ? Promise.all(u).then(() => s) : s;
835
835
  };
836
836
  });
837
- function sn(t, e, n, r) {
837
+ function cn(t, e, n, r) {
838
838
  for (const o of t)
839
839
  if (o.issues.length === 0)
840
840
  return e.value = o.value, e;
841
- const i = t.filter((o) => !Pe(o));
841
+ const i = t.filter((o) => !Ce(o));
842
842
  return i.length === 1 ? (e.value = i[0].value, i[0]) : (e.issues.push({
843
843
  code: "invalid_union",
844
844
  input: e.value,
845
845
  inst: n,
846
- errors: t.map((o) => o.issues.map((s) => we(s, r, _e())))
846
+ errors: t.map((o) => o.issues.map((s) => Se(s, r, Ee())))
847
847
  }), e);
848
848
  }
849
- const Kn = /* @__PURE__ */ p("$ZodUnion", (t, e) => {
849
+ const Jn = /* @__PURE__ */ p("$ZodUnion", (t, e) => {
850
850
  z.init(t, e), E(t._zod, "optin", () => e.options.some((i) => i._zod.optin === "optional") ? "optional" : void 0), E(t._zod, "optout", () => e.options.some((i) => i._zod.optout === "optional") ? "optional" : void 0), E(t._zod, "values", () => {
851
851
  if (e.options.every((i) => i._zod.values))
852
852
  return new Set(e.options.flatMap((i) => Array.from(i._zod.values)));
853
853
  }), E(t._zod, "pattern", () => {
854
854
  if (e.options.every((i) => i._zod.pattern)) {
855
855
  const i = e.options.map((o) => o._zod.pattern);
856
- return new RegExp(`^(${i.map((o) => Dt(o.source)).join("|")})$`);
856
+ return new RegExp(`^(${i.map((o) => Ft(o.source)).join("|")})$`);
857
857
  }
858
858
  });
859
859
  const n = e.options.length === 1, r = e.options[0]._zod.run;
@@ -875,10 +875,10 @@ const Kn = /* @__PURE__ */ p("$ZodUnion", (t, e) => {
875
875
  a.push(u);
876
876
  }
877
877
  }
878
- return s ? Promise.all(a).then((c) => sn(c, i, t, o)) : sn(a, i, t, o);
878
+ return s ? Promise.all(a).then((c) => cn(c, i, t, o)) : cn(a, i, t, o);
879
879
  };
880
- }), zi = /* @__PURE__ */ p("$ZodDiscriminatedUnion", (t, e) => {
881
- Kn.init(t, e);
880
+ }), Ai = /* @__PURE__ */ p("$ZodDiscriminatedUnion", (t, e) => {
881
+ Jn.init(t, e);
882
882
  const n = t._zod.parse;
883
883
  E(t._zod, "propValues", () => {
884
884
  const i = {};
@@ -894,7 +894,7 @@ const Kn = /* @__PURE__ */ p("$ZodUnion", (t, e) => {
894
894
  }
895
895
  return i;
896
896
  });
897
- const r = Nn(() => {
897
+ const r = Un(() => {
898
898
  const i = e.options, o = /* @__PURE__ */ new Map();
899
899
  for (const s of i) {
900
900
  const a = s._zod.propValues?.[e.discriminator];
@@ -910,7 +910,7 @@ const Kn = /* @__PURE__ */ p("$ZodUnion", (t, e) => {
910
910
  });
911
911
  t._zod.parse = (i, o) => {
912
912
  const s = i.value;
913
- if (!tt(s))
913
+ if (!et(s))
914
914
  return i.issues.push({
915
915
  code: "invalid_type",
916
916
  expected: "object",
@@ -928,10 +928,10 @@ const Kn = /* @__PURE__ */ p("$ZodUnion", (t, e) => {
928
928
  inst: t
929
929
  }), i);
930
930
  };
931
- }), Ti = /* @__PURE__ */ p("$ZodRecord", (t, e) => {
931
+ }), $i = /* @__PURE__ */ p("$ZodRecord", (t, e) => {
932
932
  z.init(t, e), t._zod.parse = (n, r) => {
933
933
  const i = n.value;
934
- if (!qt(i))
934
+ if (!Ht(i))
935
935
  return n.issues.push({
936
936
  expected: "record",
937
937
  code: "invalid_type",
@@ -946,8 +946,8 @@ const Kn = /* @__PURE__ */ p("$ZodUnion", (t, e) => {
946
946
  if (typeof c == "string" || typeof c == "number" || typeof c == "symbol") {
947
947
  const u = e.valueType._zod.run({ value: i[c], issues: [] }, r);
948
948
  u instanceof Promise ? o.push(u.then((d) => {
949
- d.issues.length && n.issues.push(...pe(c, d.issues)), n.value[c] = d.value;
950
- })) : (u.issues.length && n.issues.push(...pe(c, u.issues)), n.value[c] = u.value);
949
+ d.issues.length && n.issues.push(...he(c, d.issues)), n.value[c] = d.value;
950
+ })) : (u.issues.length && n.issues.push(...he(c, u.issues)), n.value[c] = u.value);
951
951
  }
952
952
  let a;
953
953
  for (const c in i)
@@ -970,7 +970,7 @@ const Kn = /* @__PURE__ */ p("$ZodUnion", (t, e) => {
970
970
  n.issues.push({
971
971
  code: "invalid_key",
972
972
  origin: "record",
973
- issues: a.issues.map((u) => we(u, r, _e())),
973
+ issues: a.issues.map((u) => Se(u, r, Ee())),
974
974
  input: s,
975
975
  path: [s],
976
976
  inst: t
@@ -979,16 +979,16 @@ const Kn = /* @__PURE__ */ p("$ZodUnion", (t, e) => {
979
979
  }
980
980
  const c = e.valueType._zod.run({ value: i[s], issues: [] }, r);
981
981
  c instanceof Promise ? o.push(c.then((u) => {
982
- u.issues.length && n.issues.push(...pe(s, u.issues)), n.value[a.value] = u.value;
983
- })) : (c.issues.length && n.issues.push(...pe(s, c.issues)), n.value[a.value] = c.value);
982
+ u.issues.length && n.issues.push(...he(s, u.issues)), n.value[a.value] = u.value;
983
+ })) : (c.issues.length && n.issues.push(...he(s, c.issues)), n.value[a.value] = c.value);
984
984
  }
985
985
  }
986
986
  return o.length ? Promise.all(o).then(() => n) : n;
987
987
  };
988
- }), ki = /* @__PURE__ */ p("$ZodEnum", (t, e) => {
988
+ }), Pi = /* @__PURE__ */ p("$ZodEnum", (t, e) => {
989
989
  z.init(t, e);
990
- const n = Zr(e.entries), r = new Set(n);
991
- t._zod.values = r, t._zod.pattern = new RegExp(`^(${n.filter((i) => qr.has(typeof i)).map((i) => typeof i == "string" ? Mt(i) : i.toString()).join("|")})$`), t._zod.parse = (i, o) => {
990
+ const n = qr(e.entries), r = new Set(n);
991
+ t._zod.values = r, t._zod.pattern = new RegExp(`^(${n.filter((i) => Wr.has(typeof i)).map((i) => typeof i == "string" ? Mt(i) : i.toString()).join("|")})$`), t._zod.parse = (i, o) => {
992
992
  const s = i.value;
993
993
  return r.has(s) || i.issues.push({
994
994
  code: "invalid_value",
@@ -997,7 +997,7 @@ const Kn = /* @__PURE__ */ p("$ZodUnion", (t, e) => {
997
997
  inst: t
998
998
  }), i;
999
999
  };
1000
- }), Ai = /* @__PURE__ */ p("$ZodLiteral", (t, e) => {
1000
+ }), Ii = /* @__PURE__ */ p("$ZodLiteral", (t, e) => {
1001
1001
  if (z.init(t, e), e.values.length === 0)
1002
1002
  throw new Error("Cannot create literal schema with no valid values");
1003
1003
  t._zod.values = new Set(e.values), t._zod.pattern = new RegExp(`^(${e.values.map((n) => typeof n == "string" ? Mt(n) : n ? Mt(n.toString()) : String(n)).join("|")})$`), t._zod.parse = (n, r) => {
@@ -1009,40 +1009,40 @@ const Kn = /* @__PURE__ */ p("$ZodUnion", (t, e) => {
1009
1009
  inst: t
1010
1010
  }), n;
1011
1011
  };
1012
- }), $i = /* @__PURE__ */ p("$ZodTransform", (t, e) => {
1012
+ }), Ci = /* @__PURE__ */ p("$ZodTransform", (t, e) => {
1013
1013
  z.init(t, e), t._zod.parse = (n, r) => {
1014
1014
  if (r.direction === "backward")
1015
- throw new Br(t.constructor.name);
1015
+ throw new Zr(t.constructor.name);
1016
1016
  const i = e.transform(n.value, n);
1017
1017
  if (r.async)
1018
1018
  return (i instanceof Promise ? i : Promise.resolve(i)).then((s) => (n.value = s, n));
1019
1019
  if (i instanceof Promise)
1020
- throw new ve();
1020
+ throw new me();
1021
1021
  return n.value = i, n;
1022
1022
  };
1023
1023
  });
1024
- function an(t, e) {
1024
+ function un(t, e) {
1025
1025
  return t.issues.length && e === void 0 ? { issues: [], value: void 0 } : t;
1026
1026
  }
1027
- const Pi = /* @__PURE__ */ p("$ZodOptional", (t, e) => {
1027
+ const Ri = /* @__PURE__ */ p("$ZodOptional", (t, e) => {
1028
1028
  z.init(t, e), t._zod.optin = "optional", t._zod.optout = "optional", E(t._zod, "values", () => e.innerType._zod.values ? /* @__PURE__ */ new Set([...e.innerType._zod.values, void 0]) : void 0), E(t._zod, "pattern", () => {
1029
1029
  const n = e.innerType._zod.pattern;
1030
- return n ? new RegExp(`^(${Dt(n.source)})?$`) : void 0;
1030
+ return n ? new RegExp(`^(${Ft(n.source)})?$`) : void 0;
1031
1031
  }), t._zod.parse = (n, r) => {
1032
1032
  if (e.innerType._zod.optin === "optional") {
1033
1033
  const i = e.innerType._zod.run(n, r);
1034
- return i instanceof Promise ? i.then((o) => an(o, n.value)) : an(i, n.value);
1034
+ return i instanceof Promise ? i.then((o) => un(o, n.value)) : un(i, n.value);
1035
1035
  }
1036
1036
  return n.value === void 0 ? n : e.innerType._zod.run(n, r);
1037
1037
  };
1038
- }), Ii = /* @__PURE__ */ p("$ZodNullable", (t, e) => {
1038
+ }), Oi = /* @__PURE__ */ p("$ZodNullable", (t, e) => {
1039
1039
  z.init(t, e), E(t._zod, "optin", () => e.innerType._zod.optin), E(t._zod, "optout", () => e.innerType._zod.optout), E(t._zod, "pattern", () => {
1040
1040
  const n = e.innerType._zod.pattern;
1041
- return n ? new RegExp(`^(${Dt(n.source)}|null)$`) : void 0;
1041
+ return n ? new RegExp(`^(${Ft(n.source)}|null)$`) : void 0;
1042
1042
  }), E(t._zod, "values", () => e.innerType._zod.values ? /* @__PURE__ */ new Set([...e.innerType._zod.values, null]) : void 0), t._zod.parse = (n, r) => n.value === null ? n : e.innerType._zod.run(n, r);
1043
- }), Ci = /* @__PURE__ */ p("$ZodPrefault", (t, e) => {
1043
+ }), Mi = /* @__PURE__ */ p("$ZodPrefault", (t, e) => {
1044
1044
  z.init(t, e), t._zod.optin = "optional", E(t._zod, "values", () => e.innerType._zod.values), t._zod.parse = (n, r) => (r.direction === "backward" || n.value === void 0 && (n.value = e.defaultValue), e.innerType._zod.run(n, r));
1045
- }), Ri = /* @__PURE__ */ p("$ZodPipe", (t, e) => {
1045
+ }), xi = /* @__PURE__ */ p("$ZodPipe", (t, e) => {
1046
1046
  z.init(t, e), E(t._zod, "values", () => e.in._zod.values), E(t._zod, "optin", () => e.in._zod.optin), E(t._zod, "optout", () => e.out._zod.optout), E(t._zod, "propValues", () => e.in._zod.propValues), t._zod.parse = (n, r) => {
1047
1047
  if (r.direction === "backward") {
1048
1048
  const o = e.out._zod.run(n, r);
@@ -1055,17 +1055,17 @@ const Pi = /* @__PURE__ */ p("$ZodOptional", (t, e) => {
1055
1055
  function He(t, e, n) {
1056
1056
  return t.issues.length ? (t.aborted = !0, t) : e._zod.run({ value: t.value, issues: t.issues }, n);
1057
1057
  }
1058
- const Oi = /* @__PURE__ */ p("$ZodLazy", (t, e) => {
1058
+ const Vi = /* @__PURE__ */ p("$ZodLazy", (t, e) => {
1059
1059
  z.init(t, e), E(t._zod, "innerType", () => e.getter()), E(t._zod, "pattern", () => t._zod.innerType._zod.pattern), E(t._zod, "propValues", () => t._zod.innerType._zod.propValues), E(t._zod, "optin", () => t._zod.innerType._zod.optin ?? void 0), E(t._zod, "optout", () => t._zod.innerType._zod.optout ?? void 0), t._zod.parse = (n, r) => t._zod.innerType._zod.run(n, r);
1060
- }), Mi = /* @__PURE__ */ p("$ZodCustom", (t, e) => {
1061
- ct.init(t, e), z.init(t, e), t._zod.parse = (n, r) => n, t._zod.check = (n) => {
1060
+ }), Ni = /* @__PURE__ */ p("$ZodCustom", (t, e) => {
1061
+ at.init(t, e), z.init(t, e), t._zod.parse = (n, r) => n, t._zod.check = (n) => {
1062
1062
  const r = n.value, i = e.fn(r);
1063
1063
  if (i instanceof Promise)
1064
- return i.then((o) => cn(o, n, r, t));
1065
- cn(i, n, r, t);
1064
+ return i.then((o) => ln(o, n, r, t));
1065
+ ln(i, n, r, t);
1066
1066
  };
1067
1067
  });
1068
- function cn(t, e, n, r) {
1068
+ function ln(t, e, n, r) {
1069
1069
  if (!t) {
1070
1070
  const i = {
1071
1071
  code: "custom",
@@ -1077,16 +1077,16 @@ function cn(t, e, n, r) {
1077
1077
  continue: !r._zod.def.abort
1078
1078
  // params: inst._zod.def.params,
1079
1079
  };
1080
- r._zod.def.params && (i.params = r._zod.def.params), e.issues.push(Gr(i));
1080
+ r._zod.def.params && (i.params = r._zod.def.params), e.issues.push(Qr(i));
1081
1081
  }
1082
1082
  }
1083
- function xi(t, e) {
1083
+ function Li(t, e) {
1084
1084
  return new t({
1085
1085
  type: "string",
1086
1086
  ...R()
1087
1087
  });
1088
1088
  }
1089
- function Vi(t, e) {
1089
+ function ji(t, e) {
1090
1090
  return new t({
1091
1091
  type: "string",
1092
1092
  format: "datetime",
@@ -1097,50 +1097,50 @@ function Vi(t, e) {
1097
1097
  ...R()
1098
1098
  });
1099
1099
  }
1100
- function Ni(t, e) {
1100
+ function Bi(t, e) {
1101
1101
  return new t({
1102
1102
  type: "number",
1103
1103
  checks: [],
1104
1104
  ...R()
1105
1105
  });
1106
1106
  }
1107
- function Li(t, e) {
1107
+ function Ui(t, e) {
1108
1108
  return new t({
1109
1109
  type: "boolean",
1110
1110
  ...R()
1111
1111
  });
1112
1112
  }
1113
- function ji(t, e) {
1113
+ function Di(t, e) {
1114
1114
  return new t({
1115
1115
  type: "null",
1116
1116
  ...R()
1117
1117
  });
1118
1118
  }
1119
- function Bi(t) {
1119
+ function Zi(t) {
1120
1120
  return new t({
1121
1121
  type: "any"
1122
1122
  });
1123
1123
  }
1124
- function Ui(t) {
1124
+ function Fi(t) {
1125
1125
  return new t({
1126
1126
  type: "unknown"
1127
1127
  });
1128
1128
  }
1129
- function Zi(t, e) {
1130
- return new li({
1129
+ function qi(t, e) {
1130
+ return new pi({
1131
1131
  check: "min_length",
1132
1132
  ...R(),
1133
1133
  minimum: t
1134
1134
  });
1135
1135
  }
1136
- function Di(t, e) {
1137
- return new di({
1136
+ function Hi(t, e) {
1137
+ return new hi({
1138
1138
  check: "length_equals",
1139
1139
  ...R(),
1140
1140
  length: t
1141
1141
  });
1142
1142
  }
1143
- function Fi(t, e, n) {
1143
+ function Ki(t, e, n) {
1144
1144
  const r = R();
1145
1145
  return r.abort ?? (r.abort = !0), new t({
1146
1146
  type: "custom",
@@ -1152,7 +1152,7 @@ function Fi(t, e, n) {
1152
1152
  const T = /* @__PURE__ */ p("ZodMiniType", (t, e) => {
1153
1153
  if (!t._zod)
1154
1154
  throw new Error("Uninitialized schema in ZodMiniType.");
1155
- z.init(t, e), t.def = e, t.type = e.type, t.parse = (n, r) => Xr(t, n, r, { callee: t.parse }), t.safeParse = (n, r) => Dn(t, n, r), t.parseAsync = async (n, r) => ei(t, n, r, { callee: t.parseAsync }), t.safeParseAsync = async (n, r) => Fn(t, n, r), t.check = (...n) => t.clone(
1155
+ z.init(t, e), t.def = e, t.type = e.type, t.parse = (n, r) => ti(t, n, r, { callee: t.parse }), t.safeParse = (n, r) => Kn(t, n, r), t.parseAsync = async (n, r) => ri(t, n, r, { callee: t.parseAsync }), t.safeParseAsync = async (n, r) => Wn(t, n, r), t.check = (...n) => t.clone(
1156
1156
  {
1157
1157
  ...e,
1158
1158
  checks: [
@@ -1161,245 +1161,251 @@ const T = /* @__PURE__ */ p("ZodMiniType", (t, e) => {
1161
1161
  ]
1162
1162
  }
1163
1163
  // { parent: true }
1164
- ), t.clone = (n, r) => Ht(t, n, r), t.brand = () => t, t.register = (n, r) => (n.add(t, r), t);
1165
- }), Wn = /* @__PURE__ */ p("ZodMiniString", (t, e) => {
1166
- qn.init(t, e), T.init(t, e);
1164
+ ), t.clone = (n, r) => Kt(t, n, r), t.brand = () => t, t.register = (n, r) => (n.add(t, r), t);
1165
+ }), Qn = /* @__PURE__ */ p("ZodMiniString", (t, e) => {
1166
+ Yn.init(t, e), T.init(t, e);
1167
1167
  });
1168
1168
  function l(t) {
1169
- return xi(Wn);
1169
+ return Li(Qn);
1170
1170
  }
1171
- const qi = /* @__PURE__ */ p("ZodMiniStringFormat", (t, e) => {
1172
- Hn.init(t, e), Wn.init(t, e);
1173
- }), Hi = /* @__PURE__ */ p("ZodMiniNumber", (t, e) => {
1174
- gi.init(t, e), T.init(t, e);
1171
+ const Wi = /* @__PURE__ */ p("ZodMiniStringFormat", (t, e) => {
1172
+ Gn.init(t, e), Qn.init(t, e);
1173
+ }), Yi = /* @__PURE__ */ p("ZodMiniNumber", (t, e) => {
1174
+ mi.init(t, e), T.init(t, e);
1175
1175
  });
1176
- function A(t) {
1177
- return Ni(Hi);
1176
+ function $(t) {
1177
+ return Bi(Yi);
1178
1178
  }
1179
- const Ki = /* @__PURE__ */ p("ZodMiniBoolean", (t, e) => {
1180
- vi.init(t, e), T.init(t, e);
1179
+ const Gi = /* @__PURE__ */ p("ZodMiniBoolean", (t, e) => {
1180
+ bi.init(t, e), T.init(t, e);
1181
1181
  });
1182
1182
  function q(t) {
1183
- return Li(Ki);
1183
+ return Ui(Gi);
1184
1184
  }
1185
- const Wi = /* @__PURE__ */ p("ZodMiniNull", (t, e) => {
1186
- yi.init(t, e), T.init(t, e);
1185
+ const Ji = /* @__PURE__ */ p("ZodMiniNull", (t, e) => {
1186
+ _i.init(t, e), T.init(t, e);
1187
1187
  });
1188
- function Kt(t) {
1189
- return ji(Wi);
1188
+ function Wt(t) {
1189
+ return Di(Ji);
1190
1190
  }
1191
- const Gi = /* @__PURE__ */ p("ZodMiniAny", (t, e) => {
1192
- mi.init(t, e), T.init(t, e);
1191
+ const Qi = /* @__PURE__ */ p("ZodMiniAny", (t, e) => {
1192
+ wi.init(t, e), T.init(t, e);
1193
1193
  });
1194
- function un() {
1195
- return Bi(Gi);
1194
+ function dn() {
1195
+ return Zi(Qi);
1196
1196
  }
1197
- const Ji = /* @__PURE__ */ p("ZodMiniUnknown", (t, e) => {
1198
- bi.init(t, e), T.init(t, e);
1197
+ const Xi = /* @__PURE__ */ p("ZodMiniUnknown", (t, e) => {
1198
+ Ei.init(t, e), T.init(t, e);
1199
1199
  });
1200
- function Qi() {
1201
- return Ui(Ji);
1200
+ function eo() {
1201
+ return Fi(Xi);
1202
1202
  }
1203
- const Xi = /* @__PURE__ */ p("ZodMiniArray", (t, e) => {
1204
- _i.init(t, e), T.init(t, e);
1203
+ const to = /* @__PURE__ */ p("ZodMiniArray", (t, e) => {
1204
+ Si.init(t, e), T.init(t, e);
1205
1205
  });
1206
- function $(t, e) {
1207
- return new Xi({
1206
+ function A(t, e) {
1207
+ return new to({
1208
1208
  type: "array",
1209
1209
  element: t,
1210
1210
  ...R()
1211
1211
  });
1212
1212
  }
1213
- const Yi = /* @__PURE__ */ p("ZodMiniObject", (t, e) => {
1214
- Si.init(t, e), T.init(t, e), E(t, "shape", () => e.shape);
1213
+ const no = /* @__PURE__ */ p("ZodMiniObject", (t, e) => {
1214
+ ki.init(t, e), T.init(t, e), E(t, "shape", () => e.shape);
1215
1215
  });
1216
1216
  function h(t, e) {
1217
1217
  const n = {
1218
1218
  type: "object",
1219
1219
  get shape() {
1220
- return Ft(this, "shape", { ...t }), this.shape;
1220
+ return qt(this, "shape", { ...t }), this.shape;
1221
1221
  },
1222
1222
  ...R()
1223
1223
  };
1224
- return new Yi(n);
1224
+ return new no(n);
1225
1225
  }
1226
1226
  function g(t, e) {
1227
- return Kr(t, e);
1227
+ return Gr(t, e);
1228
1228
  }
1229
- function eo(t, e) {
1230
- return Wr(Jn, t);
1229
+ function ro(t, e) {
1230
+ return Jr(er, t);
1231
1231
  }
1232
- function je(t, e) {
1232
+ function ct(t, e) {
1233
1233
  return t.clone({ ...t._zod.def, catchall: e });
1234
1234
  }
1235
- const to = /* @__PURE__ */ p("ZodMiniUnion", (t, e) => {
1236
- Kn.init(t, e), T.init(t, e);
1235
+ const io = /* @__PURE__ */ p("ZodMiniUnion", (t, e) => {
1236
+ Jn.init(t, e), T.init(t, e);
1237
1237
  });
1238
- function Y(t, e) {
1239
- return new to({
1238
+ function Q(t, e) {
1239
+ return new io({
1240
1240
  type: "union",
1241
1241
  options: t,
1242
1242
  ...R()
1243
1243
  });
1244
1244
  }
1245
- const no = /* @__PURE__ */ p("ZodMiniDiscriminatedUnion", (t, e) => {
1246
- zi.init(t, e), T.init(t, e);
1245
+ const oo = /* @__PURE__ */ p("ZodMiniDiscriminatedUnion", (t, e) => {
1246
+ Ai.init(t, e), T.init(t, e);
1247
1247
  });
1248
1248
  function Be(t, e, n) {
1249
- return new no({
1249
+ return new oo({
1250
1250
  type: "union",
1251
1251
  options: e,
1252
1252
  discriminator: t,
1253
1253
  ...R()
1254
1254
  });
1255
1255
  }
1256
- const ro = /* @__PURE__ */ p("ZodMiniRecord", (t, e) => {
1257
- Ti.init(t, e), T.init(t, e);
1256
+ const so = /* @__PURE__ */ p("ZodMiniRecord", (t, e) => {
1257
+ $i.init(t, e), T.init(t, e);
1258
1258
  });
1259
1259
  function ce(t, e, n) {
1260
- return new ro({
1260
+ return new so({
1261
1261
  type: "record",
1262
1262
  keyType: t,
1263
1263
  valueType: e,
1264
1264
  ...R()
1265
1265
  });
1266
1266
  }
1267
- const io = /* @__PURE__ */ p("ZodMiniEnum", (t, e) => {
1268
- ki.init(t, e), T.init(t, e), t.options = Object.values(e.entries);
1267
+ const ao = /* @__PURE__ */ p("ZodMiniEnum", (t, e) => {
1268
+ Pi.init(t, e), T.init(t, e), t.options = Object.values(e.entries);
1269
1269
  });
1270
- function Gn(t, e) {
1270
+ function Xn(t, e) {
1271
1271
  const n = Array.isArray(t) ? Object.fromEntries(t.map((r) => [r, r])) : t;
1272
- return new io({
1272
+ return new ao({
1273
1273
  type: "enum",
1274
1274
  entries: n,
1275
1275
  ...R()
1276
1276
  });
1277
1277
  }
1278
- const oo = /* @__PURE__ */ p("ZodMiniLiteral", (t, e) => {
1279
- Ai.init(t, e), T.init(t, e);
1278
+ const co = /* @__PURE__ */ p("ZodMiniLiteral", (t, e) => {
1279
+ Ii.init(t, e), T.init(t, e);
1280
1280
  });
1281
- function y(t, e) {
1282
- return new oo({
1281
+ function v(t, e) {
1282
+ return new co({
1283
1283
  type: "literal",
1284
1284
  values: Array.isArray(t) ? t : [t],
1285
1285
  ...R()
1286
1286
  });
1287
1287
  }
1288
- const so = /* @__PURE__ */ p("ZodMiniTransform", (t, e) => {
1289
- $i.init(t, e), T.init(t, e);
1288
+ const uo = /* @__PURE__ */ p("ZodMiniTransform", (t, e) => {
1289
+ Ci.init(t, e), T.init(t, e);
1290
1290
  });
1291
- function ao(t) {
1292
- return new so({
1291
+ function lo(t) {
1292
+ return new uo({
1293
1293
  type: "transform",
1294
1294
  transform: t
1295
1295
  });
1296
1296
  }
1297
- const Jn = /* @__PURE__ */ p("ZodMiniOptional", (t, e) => {
1298
- Pi.init(t, e), T.init(t, e);
1297
+ const er = /* @__PURE__ */ p("ZodMiniOptional", (t, e) => {
1298
+ Ri.init(t, e), T.init(t, e);
1299
1299
  });
1300
1300
  function f(t) {
1301
- return new Jn({
1301
+ return new er({
1302
1302
  type: "optional",
1303
1303
  innerType: t
1304
1304
  });
1305
1305
  }
1306
- const co = /* @__PURE__ */ p("ZodMiniNullable", (t, e) => {
1307
- Ii.init(t, e), T.init(t, e);
1306
+ const fo = /* @__PURE__ */ p("ZodMiniNullable", (t, e) => {
1307
+ Oi.init(t, e), T.init(t, e);
1308
1308
  });
1309
- function Xe(t) {
1310
- return new co({
1309
+ function Je(t) {
1310
+ return new fo({
1311
1311
  type: "nullable",
1312
1312
  innerType: t
1313
1313
  });
1314
1314
  }
1315
- const uo = /* @__PURE__ */ p("ZodMiniPrefault", (t, e) => {
1316
- Ci.init(t, e), T.init(t, e);
1315
+ const po = /* @__PURE__ */ p("ZodMiniPrefault", (t, e) => {
1316
+ Mi.init(t, e), T.init(t, e);
1317
1317
  });
1318
1318
  function K(t, e) {
1319
- return new uo({
1319
+ return new po({
1320
1320
  type: "prefault",
1321
1321
  innerType: t,
1322
1322
  get defaultValue() {
1323
- return typeof e == "function" ? e() : Fr(e);
1323
+ return typeof e == "function" ? e() : Kr(e);
1324
1324
  }
1325
1325
  });
1326
1326
  }
1327
- const lo = /* @__PURE__ */ p("ZodMiniPipe", (t, e) => {
1328
- Ri.init(t, e), T.init(t, e);
1327
+ const ho = /* @__PURE__ */ p("ZodMiniPipe", (t, e) => {
1328
+ xi.init(t, e), T.init(t, e);
1329
1329
  });
1330
- function fo(t, e) {
1331
- return new lo({
1330
+ function go(t, e) {
1331
+ return new ho({
1332
1332
  type: "pipe",
1333
1333
  in: t,
1334
1334
  out: e
1335
1335
  });
1336
1336
  }
1337
- const po = /* @__PURE__ */ p("ZodMiniLazy", (t, e) => {
1338
- Oi.init(t, e), T.init(t, e);
1337
+ const vo = /* @__PURE__ */ p("ZodMiniLazy", (t, e) => {
1338
+ Vi.init(t, e), T.init(t, e);
1339
1339
  });
1340
- function ho(t) {
1341
- return new po({
1340
+ function yo(t) {
1341
+ return new vo({
1342
1342
  type: "lazy",
1343
1343
  getter: t
1344
1344
  });
1345
1345
  }
1346
- const go = /* @__PURE__ */ p("ZodMiniCustom", (t, e) => {
1347
- Mi.init(t, e), T.init(t, e);
1346
+ const mo = /* @__PURE__ */ p("ZodMiniCustom", (t, e) => {
1347
+ Ni.init(t, e), T.init(t, e);
1348
1348
  });
1349
- function vo(t, e) {
1350
- return Fi(go, () => !0);
1349
+ function bo(t, e) {
1350
+ return Ki(mo, () => !0);
1351
1351
  }
1352
- function G() {
1353
- const t = ho(() => Y([l(), A(), q(), Kt(), $(t), ce(l(), t)]));
1352
+ function X() {
1353
+ const t = yo(() => Q([l(), $(), q(), Wt(), A(t), ce(l(), t)]));
1354
1354
  return t;
1355
1355
  }
1356
- const yo = /* @__PURE__ */ p("$ZodISODateTime", (t, e) => {
1357
- hi.init(t, e), qi.init(t, e);
1356
+ const _o = /* @__PURE__ */ p("$ZodISODateTime", (t, e) => {
1357
+ yi.init(t, e), Wi.init(t, e);
1358
1358
  });
1359
1359
  function pt(t) {
1360
- return Vi(yo);
1360
+ return ji(_o);
1361
1361
  }
1362
- const ut = je(h({}), G()), mo = h({
1362
+ const ut = ct(h({}), X()), wo = h({
1363
1363
  sys: h({
1364
- type: y("Link"),
1364
+ type: v("Link"),
1365
1365
  linkType: l(),
1366
1366
  id: l()
1367
1367
  })
1368
- }), bo = h({
1368
+ }), Eo = h({
1369
1369
  sys: h({
1370
- type: y("Link"),
1371
- linkType: y("ContentType"),
1370
+ type: v("Link"),
1371
+ linkType: v("ContentType"),
1372
1372
  id: l()
1373
1373
  })
1374
- }), _o = h({
1374
+ }), So = h({
1375
1375
  sys: h({
1376
- type: y("Link"),
1377
- linkType: y("Environment"),
1376
+ type: v("Link"),
1377
+ linkType: v("Environment"),
1378
1378
  id: l()
1379
1379
  })
1380
- }), wo = h({
1380
+ }), zo = h({
1381
1381
  sys: h({
1382
- type: y("Link"),
1383
- linkType: y("Space"),
1382
+ type: v("Link"),
1383
+ linkType: v("Space"),
1384
1384
  id: l()
1385
1385
  })
1386
- }), Eo = h({
1386
+ }), To = h({
1387
+ sys: h({
1388
+ type: v("Link"),
1389
+ linkType: v("TaxonomyConcept"),
1390
+ id: l()
1391
+ })
1392
+ }), ko = h({
1387
1393
  sys: h({
1388
- type: y("Link"),
1389
- linkType: y("Tag"),
1394
+ type: v("Link"),
1395
+ linkType: v("Tag"),
1390
1396
  id: l()
1391
1397
  })
1392
- }), Qn = h({
1393
- type: y("Entry"),
1394
- contentType: bo,
1395
- publishedVersion: A(),
1398
+ }), tr = h({
1399
+ type: v("Entry"),
1400
+ contentType: Eo,
1401
+ publishedVersion: $(),
1396
1402
  id: l(),
1397
- createdAt: un(),
1398
- updatedAt: un(),
1403
+ createdAt: dn(),
1404
+ updatedAt: dn(),
1399
1405
  locale: f(l()),
1400
- revision: A(),
1401
- space: wo,
1402
- environment: _o
1406
+ revision: $(),
1407
+ space: zo,
1408
+ environment: So
1403
1409
  }), Ue = h({
1404
1410
  /**
1405
1411
  * The entry fields payload.
@@ -1408,21 +1414,19 @@ const ut = je(h({}), G()), mo = h({
1408
1414
  /**
1409
1415
  * Contentful metadata, including tags.
1410
1416
  */
1411
- metadata: je(
1412
- h({
1413
- tags: $(Eo)
1414
- }),
1415
- G()
1416
- ),
1417
+ metadata: h({
1418
+ tags: A(ko),
1419
+ concepts: f(A(To))
1420
+ }),
1417
1421
  /**
1418
1422
  * System-managed properties describing the entry.
1419
1423
  */
1420
- sys: Qn
1424
+ sys: tr
1421
1425
  });
1422
- function So(t) {
1426
+ function Ao(t) {
1423
1427
  return Ue.safeParse(t).success;
1424
1428
  }
1425
- const zo = g(ut, {
1429
+ const $o = g(ut, {
1426
1430
  /**
1427
1431
  * The internal id of the audience (Short Text).
1428
1432
  *
@@ -1444,9 +1448,11 @@ const zo = g(ut, {
1444
1448
  * Optional field intended for internal documentation and operator context.
1445
1449
  */
1446
1450
  nt_description: f(l())
1447
- }), To = g(Ue, {
1448
- fields: zo
1449
- }), ko = g(Ue, {
1451
+ }), nr = g(Ue, {
1452
+ fields: $o
1453
+ }), _c = g(nr, {
1454
+ contentTypeId: v("nt_audience")
1455
+ }), Po = g(Ue, {
1450
1456
  fields: h({
1451
1457
  /**
1452
1458
  * Human-readable name of the merge tag.
@@ -1464,12 +1470,12 @@ const zo = g(ut, {
1464
1470
  /**
1465
1471
  * System fields extended to constrain the content type to `nt_mergetag`.
1466
1472
  */
1467
- sys: g(Qn, {
1473
+ sys: g(tr, {
1468
1474
  contentType: h({
1469
1475
  sys: h({
1470
- type: y("Link"),
1471
- linkType: y("ContentType"),
1472
- id: y("nt_mergetag")
1476
+ type: v("Link"),
1477
+ linkType: v("ContentType"),
1478
+ id: v("nt_mergetag")
1473
1479
  })
1474
1480
  })
1475
1481
  })
@@ -1485,17 +1491,17 @@ const zo = g(ut, {
1485
1491
  */
1486
1492
  hidden: K(q(), !1)
1487
1493
  });
1488
- function Ao(t) {
1494
+ function Io(t) {
1489
1495
  return xt.safeParse(t).success;
1490
1496
  }
1491
- const $o = h({
1497
+ const Co = h({
1492
1498
  /**
1493
1499
  * Discriminator for the component type.
1494
1500
  *
1495
1501
  * @remarks
1496
1502
  * May be omitted, in which case the component is treated as an EntryReplacement.
1497
1503
  */
1498
- type: f(y("EntryReplacement")),
1504
+ type: f(v("EntryReplacement")),
1499
1505
  /**
1500
1506
  * Baseline variant used when no targeting or allocation selects another variant.
1501
1507
  */
@@ -1503,21 +1509,21 @@ const $o = h({
1503
1509
  /**
1504
1510
  * Additional variants that may be served.
1505
1511
  */
1506
- variants: $(xt)
1512
+ variants: A(xt)
1507
1513
  });
1508
- function Po(t) {
1514
+ function Ro(t) {
1509
1515
  return t.type === "EntryReplacement" || t.type === void 0;
1510
1516
  }
1511
- const ln = h({
1517
+ const fn = h({
1512
1518
  /**
1513
1519
  * Variant value for the inline variable.
1514
1520
  */
1515
- value: Y([l(), q(), Kt(), A(), ce(l(), G())])
1516
- }), Io = Gn(["Boolean", "Number", "Object", "String"]), Co = h({
1521
+ value: Q([l(), q(), Wt(), $(), ce(l(), X())])
1522
+ }), Oo = Xn(["Boolean", "Number", "Object", "String"]), Mo = h({
1517
1523
  /**
1518
1524
  * Discriminator for the inline variable component.
1519
1525
  */
1520
- type: y("InlineVariable"),
1526
+ type: v("InlineVariable"),
1521
1527
  /**
1522
1528
  * Key under which this variable is exposed to the template.
1523
1529
  */
@@ -1525,35 +1531,35 @@ const ln = h({
1525
1531
  /**
1526
1532
  * Describes the runtime type of the values for this variable.
1527
1533
  */
1528
- valueType: Io,
1534
+ valueType: Oo,
1529
1535
  /**
1530
1536
  * Baseline value used when no targeting or allocation selects another variant.
1531
1537
  */
1532
- baseline: ln,
1538
+ baseline: fn,
1533
1539
  /**
1534
1540
  * Additional variable variants for experimentation or personalization.
1535
1541
  */
1536
- variants: $(ln)
1542
+ variants: A(fn)
1537
1543
  });
1538
- function yc(t) {
1544
+ function wc(t) {
1539
1545
  return t.type === "InlineVariable";
1540
1546
  }
1541
- const Ro = Be("type", [
1542
- $o,
1543
- Co
1544
- ]), Oo = $(Ro), Mo = h({
1547
+ const xo = Be("type", [
1548
+ Co,
1549
+ Mo
1550
+ ]), Vo = A(xo), No = h({
1545
1551
  /**
1546
1552
  * Variant distribution used for traffic allocation.
1547
1553
  *
1548
1554
  * @defaultValue [0.5, 0.5]
1549
1555
  */
1550
- distribution: f(K($(A()), [0.5, 0.5])),
1556
+ distribution: f(K(A($()), [0.5, 0.5])),
1551
1557
  /**
1552
1558
  * Percentage of total traffic that should enter the personalization.
1553
1559
  *
1554
1560
  * @defaultValue 0
1555
1561
  */
1556
- traffic: f(K(A(), 0)),
1562
+ traffic: f(K($(), 0)),
1557
1563
  /**
1558
1564
  * Personalization components that define how content is varied.
1559
1565
  *
@@ -1561,7 +1567,7 @@ const Ro = Be("type", [
1561
1567
  * A single {@link EntryReplacementComponent} with an empty `baseline` and `variants` ID.
1562
1568
  */
1563
1569
  components: f(
1564
- K(Oo, [
1570
+ K(Vo, [
1565
1571
  {
1566
1572
  type: "EntryReplacement",
1567
1573
  baseline: { id: "" },
@@ -1575,10 +1581,10 @@ const Ro = Be("type", [
1575
1581
  * @defaultValue false
1576
1582
  */
1577
1583
  sticky: f(K(q(), !1))
1578
- }), xo = Y([
1579
- y("nt_experiment"),
1580
- y("nt_personalization")
1581
- ]), Vo = g(ut, {
1584
+ }), Lo = Q([
1585
+ v("nt_experiment"),
1586
+ v("nt_personalization")
1587
+ ]), jo = g(ut, {
1582
1588
  /**
1583
1589
  * The name of the personalization (Short Text).
1584
1590
  */
@@ -1589,11 +1595,11 @@ const Ro = Be("type", [
1589
1595
  * @remarks
1590
1596
  * Optional, may be `null` if no description is provided.
1591
1597
  */
1592
- nt_description: f(Xe(l())),
1598
+ nt_description: f(Je(l())),
1593
1599
  /**
1594
1600
  * The type of the personalization (`nt_experiment` | `nt_personalization`).
1595
1601
  */
1596
- nt_type: xo,
1602
+ nt_type: Lo,
1597
1603
  /**
1598
1604
  * The configuration of a {@link PersonalizationEntry } (JSON).
1599
1605
  *
@@ -1601,9 +1607,9 @@ const Ro = Be("type", [
1601
1607
  * Accepts `null` or an explicit {@link PersonalizationConfig} and converts
1602
1608
  * falsy/undefined values into a default configuration.
1603
1609
  */
1604
- nt_config: fo(
1605
- f(K(Xe(Mo), null)),
1606
- ao(
1610
+ nt_config: go(
1611
+ f(K(Je(No), null)),
1612
+ lo(
1607
1613
  (t) => t ?? {
1608
1614
  traffic: 0,
1609
1615
  distribution: [0.5, 0.5],
@@ -1619,7 +1625,7 @@ const Ro = Be("type", [
1619
1625
  * Optional and nullable; when omitted or `null`, the personalization may apply
1620
1626
  * to all users.
1621
1627
  */
1622
- nt_audience: f(Xe(To)),
1628
+ nt_audience: f(Je(nr)),
1623
1629
  /**
1624
1630
  * All used variants of the personalization (Contentful references to other Content Types).
1625
1631
  *
@@ -1627,29 +1633,31 @@ const Ro = Be("type", [
1627
1633
  * Modeled as an array of untyped Contentful entries and defaults to an empty
1628
1634
  * array when omitted.
1629
1635
  */
1630
- nt_variants: f(K($(vo()), [])),
1636
+ nt_variants: f(K(A(bo()), [])),
1631
1637
  /**
1632
1638
  * The personalization/experience ID related to this personalization entry.
1633
1639
  */
1634
1640
  nt_experience_id: l()
1635
- }), Xn = g(Ue, {
1636
- fields: Vo
1641
+ }), Yt = g(Ue, {
1642
+ fields: jo
1643
+ }), Ec = g(Yt, {
1644
+ contentTypeId: v("nt_experience")
1637
1645
  });
1638
1646
  function Ke(t) {
1639
- return Xn.safeParse(t).success;
1647
+ return Yt.safeParse(t).success;
1640
1648
  }
1641
- const No = $(Y([mo, Xn])), Lo = g(Ue, {
1649
+ const Bo = A(Q([wo, Yt])), Uo = g(Ue, {
1642
1650
  fields: g(ut, {
1643
1651
  /**
1644
1652
  * Personalization or experimentation experiences attached to this entry.
1645
1653
  */
1646
- nt_experiences: No
1654
+ nt_experiences: Bo
1647
1655
  })
1648
1656
  });
1649
1657
  function ht(t) {
1650
- return Lo.safeParse(t).success;
1658
+ return Uo.safeParse(t).success;
1651
1659
  }
1652
- const jo = f(
1660
+ const Do = f(
1653
1661
  h({
1654
1662
  /**
1655
1663
  * Name of the application.
@@ -1660,7 +1668,7 @@ const jo = f(
1660
1668
  */
1661
1669
  version: l()
1662
1670
  })
1663
- ), Yn = h({
1671
+ ), rr = h({
1664
1672
  /**
1665
1673
  * Name of the campaign (e.g., `utm_campaign`).
1666
1674
  */
@@ -1681,20 +1689,20 @@ const jo = f(
1681
1689
  * Campaign content (e.g., `utm_content`).
1682
1690
  */
1683
1691
  content: f(l())
1684
- }), Bo = Y([y("mobile"), y("server"), y("web")]), Uo = ce(l(), l()), Zo = 2, Do = h({
1692
+ }), Zo = Q([v("mobile"), v("server"), v("web")]), Fo = ce(l(), l()), qo = 2, Ho = h({
1685
1693
  /**
1686
1694
  * Latitude component of the coordinates.
1687
1695
  */
1688
- latitude: A(),
1696
+ latitude: $(),
1689
1697
  /**
1690
1698
  * Longitude component of the coordinates.
1691
1699
  */
1692
- longitude: A()
1693
- }), Wt = h({
1700
+ longitude: $()
1701
+ }), Gt = h({
1694
1702
  /**
1695
1703
  * Geographical coordinates for the location.
1696
1704
  */
1697
- coordinates: f(Do),
1705
+ coordinates: f(Ho),
1698
1706
  /**
1699
1707
  * City name associated with the location.
1700
1708
  */
@@ -1722,7 +1730,7 @@ const jo = f(
1722
1730
  * Validated to exactly COUNTRY_CODE_LENGTH characters, typically
1723
1731
  * an ISO 3166-1 alpha-2 code.
1724
1732
  */
1725
- countryCode: f(l().check(Di(Zo))),
1733
+ countryCode: f(l().check(Hi(qo))),
1726
1734
  /**
1727
1735
  * Continent name associated with the location.
1728
1736
  */
@@ -1734,7 +1742,7 @@ const jo = f(
1734
1742
  * Typically an IANA time zone string (e.g., `"Europe/Berlin"`).
1735
1743
  */
1736
1744
  timezone: f(l())
1737
- }), Fo = h({
1745
+ }), Ko = h({
1738
1746
  /**
1739
1747
  * Name of the SDK/library (e.g., `"@contentful/optimization-web"`).
1740
1748
  */
@@ -1743,7 +1751,7 @@ const jo = f(
1743
1751
  * Version of the analytics library.
1744
1752
  */
1745
1753
  version: l()
1746
- }), Ee = je(
1754
+ }), ze = ct(
1747
1755
  h({
1748
1756
  /**
1749
1757
  * Path component of the page URL (e.g., `/products/123`).
@@ -1752,7 +1760,7 @@ const jo = f(
1752
1760
  /**
1753
1761
  * Parsed query parameters for the page.
1754
1762
  */
1755
- query: Uo,
1763
+ query: Fo,
1756
1764
  /**
1757
1765
  * Referrer URL that led to the current page.
1758
1766
  */
@@ -1770,16 +1778,16 @@ const jo = f(
1770
1778
  */
1771
1779
  url: l()
1772
1780
  }),
1773
- G()
1774
- ), lt = ce(l(), G()), Gt = je(
1781
+ X()
1782
+ ), lt = ce(l(), X()), Jt = ct(
1775
1783
  h({
1776
1784
  /**
1777
1785
  * Name or label for the screen.
1778
1786
  */
1779
1787
  name: l()
1780
1788
  }),
1781
- G()
1782
- ), Jt = ce(l(), G()), qo = h({
1789
+ X()
1790
+ ), Qt = ce(l(), X()), Wo = h({
1783
1791
  /**
1784
1792
  * Unique identifier for this session statistics record.
1785
1793
  */
@@ -1799,25 +1807,25 @@ const jo = f(
1799
1807
  *
1800
1808
  * @see Page
1801
1809
  */
1802
- landingPage: Ee,
1810
+ landingPage: ze,
1803
1811
  /**
1804
1812
  * Number of sessions associated with this profile or identifier.
1805
1813
  *
1806
1814
  * @remarks
1807
1815
  * Often used in combination with {@link SessionStatistics.averageSessionLength}.
1808
1816
  */
1809
- count: A(),
1817
+ count: $(),
1810
1818
  /**
1811
1819
  * Duration of the active session.
1812
1820
  */
1813
- activeSessionLength: A(),
1821
+ activeSessionLength: $(),
1814
1822
  /**
1815
1823
  * Average session duration across all sessions represented by this record.
1816
1824
  *
1817
1825
  * @remarks
1818
1826
  * The unit should match {@link SessionStatistics.activeSessionLength}.
1819
1827
  */
1820
- averageSessionLength: A()
1828
+ averageSessionLength: $()
1821
1829
  }), dt = h({
1822
1830
  /**
1823
1831
  * Primary identifier of the profile.
@@ -1837,30 +1845,30 @@ const jo = f(
1837
1845
  * @remarks
1838
1846
  * Often used for deterministic bucketing (e.g., in experiments).
1839
1847
  */
1840
- random: A(),
1848
+ random: $(),
1841
1849
  /**
1842
1850
  * List of audience identifiers that this profile currently belongs to.
1843
1851
  */
1844
- audiences: $(l()),
1852
+ audiences: A(l()),
1845
1853
  /**
1846
1854
  * Traits describing the profile (user-level attributes).
1847
1855
  *
1848
1856
  * @see Traits
1849
1857
  */
1850
- traits: Jt,
1858
+ traits: Qt,
1851
1859
  /**
1852
1860
  * Geo-location information associated with the profile.
1853
1861
  *
1854
1862
  * @see GeoLocation
1855
1863
  */
1856
- location: Wt,
1864
+ location: Gt,
1857
1865
  /**
1858
1866
  * Aggregated session statistics for the profile.
1859
1867
  *
1860
1868
  * @see SessionStatistics
1861
1869
  */
1862
- session: qo
1863
- }), Ho = je(
1870
+ session: Wo
1871
+ }), Yo = ct(
1864
1872
  h({
1865
1873
  /**
1866
1874
  * Identifier of the profile.
@@ -1870,8 +1878,8 @@ const jo = f(
1870
1878
  */
1871
1879
  id: l()
1872
1880
  }),
1873
- G()
1874
- ), er = h({
1881
+ X()
1882
+ ), ir = h({
1875
1883
  /**
1876
1884
  * Response payload.
1877
1885
  *
@@ -1890,13 +1898,13 @@ const jo = f(
1890
1898
  * @remarks
1891
1899
  * May be `null` when the error state is unknown or not applicable.
1892
1900
  */
1893
- error: Xe(q())
1894
- }), Ko = h({
1901
+ error: Je(q())
1902
+ }), Go = h({
1895
1903
  /**
1896
1904
  * Profiles evaluated or affected by the batch experience request.
1897
1905
  */
1898
- profiles: f($(dt))
1899
- }), Wo = g(er, { data: Ko }), Go = ["Variable"], tr = h({
1906
+ profiles: f(A(dt))
1907
+ }), Jo = g(ir, { data: Go }), Qo = ["Variable"], or = h({
1900
1908
  /**
1901
1909
  * Key identifying the subject of the change.
1902
1910
  */
@@ -1907,7 +1915,7 @@ const jo = f(
1907
1915
  * @remarks
1908
1916
  * May be one of {@link ChangeType} or an arbitrary string for unknown types.
1909
1917
  */
1910
- type: Y([Gn(Go), l()]),
1918
+ type: Q([Xn(Qo), l()]),
1911
1919
  /**
1912
1920
  * Metadata describing the originating experience and variant index.
1913
1921
  */
@@ -1922,15 +1930,15 @@ const jo = f(
1922
1930
  * @remarks
1923
1931
  * Typically corresponds to the array index in the experience's distribution.
1924
1932
  */
1925
- variantIndex: A()
1933
+ variantIndex: $()
1926
1934
  })
1927
- }), Jo = Y([
1935
+ }), Xo = Q([
1928
1936
  l(),
1929
1937
  q(),
1930
- Kt(),
1931
- A(),
1932
- ce(l(), G())
1933
- ]), mc = g(tr, {
1938
+ Wt(),
1939
+ $(),
1940
+ ce(l(), X())
1941
+ ]), Sc = g(or, {
1934
1942
  /**
1935
1943
  * Unconstrained change type string.
1936
1944
  */
@@ -1938,25 +1946,25 @@ const jo = f(
1938
1946
  /**
1939
1947
  * Payload for the change value, with unknown structure.
1940
1948
  */
1941
- value: Qi()
1942
- }), Qo = g(tr, {
1949
+ value: eo()
1950
+ }), es = g(or, {
1943
1951
  /**
1944
1952
  * Discriminator for a variable change.
1945
1953
  */
1946
- type: y("Variable"),
1954
+ type: v("Variable"),
1947
1955
  /**
1948
1956
  * New value for the variable identified by {@link ChangeBase.key}.
1949
1957
  */
1950
- value: Jo
1951
- }), Xo = Be("type", [Qo]), nr = $(Xo), Qt = h({
1958
+ value: Xo
1959
+ }), ts = Be("type", [es]), sr = A(ts), Xt = h({
1952
1960
  /**
1953
1961
  * Application-level metadata.
1954
1962
  */
1955
- app: jo,
1963
+ app: Do,
1956
1964
  /**
1957
1965
  * Campaign attribution metadata.
1958
1966
  */
1959
- campaign: Yn,
1967
+ campaign: rr,
1960
1968
  /**
1961
1969
  * GDPR-related consent information.
1962
1970
  */
@@ -1969,7 +1977,7 @@ const jo = f(
1969
1977
  /**
1970
1978
  * Analytics library metadata.
1971
1979
  */
1972
- library: Fo,
1980
+ library: Ko,
1973
1981
  /**
1974
1982
  * Locale identifier of the event (e.g., `"en-US"`).
1975
1983
  */
@@ -1977,7 +1985,7 @@ const jo = f(
1977
1985
  /**
1978
1986
  * Optional geo-location information associated with the event.
1979
1987
  */
1980
- location: f(Wt),
1988
+ location: f(Gt),
1981
1989
  /**
1982
1990
  * User agent string of the client, if available.
1983
1991
  */
@@ -1988,13 +1996,13 @@ const jo = f(
1988
1996
  *
1989
1997
  * @see Channel
1990
1998
  */
1991
- channel: Bo,
1999
+ channel: Zo,
1992
2000
  /**
1993
2001
  * Context object carrying environment and client metadata.
1994
2002
  */
1995
- context: g(Qt, {
1996
- page: f(Ee),
1997
- screen: f(Gt)
2003
+ context: g(Xt, {
2004
+ page: f(ze),
2005
+ screen: f(Jt)
1998
2006
  }),
1999
2007
  /**
2000
2008
  * Unique identifier for this message.
@@ -2028,23 +2036,23 @@ const jo = f(
2028
2036
  * Identifier of the authenticated user, if known.
2029
2037
  */
2030
2038
  userId: f(l())
2031
- }), rr = g(ue, {
2039
+ }), ar = g(ue, {
2032
2040
  /**
2033
2041
  * Discriminator indicating that this event is an alias event.
2034
2042
  */
2035
- type: y("alias")
2036
- }), ye = g(ue, {
2043
+ type: v("alias")
2044
+ }), be = g(ue, {
2037
2045
  /**
2038
2046
  * Discriminator indicating that this event is a component view.
2039
2047
  */
2040
- type: y("component"),
2048
+ type: v("component"),
2041
2049
  /**
2042
2050
  * Type of component that was viewed.
2043
2051
  *
2044
2052
  * - `'Entry'` — A content entry component.
2045
2053
  * - `'Variable'` — A variable or inline value component.
2046
2054
  */
2047
- componentType: Y([y("Entry"), y("Variable")]),
2055
+ componentType: Q([v("Entry"), v("Variable")]),
2048
2056
  /**
2049
2057
  * Contentful entry ID corresponding to the component that was viewed.
2050
2058
  */
@@ -2062,33 +2070,33 @@ const jo = f(
2062
2070
  * @remarks
2063
2071
  * Typically corresponds to the index of the selected personalization entry.
2064
2072
  */
2065
- variantIndex: A()
2066
- }), ir = g(ue, {
2073
+ variantIndex: $()
2074
+ }), cr = g(ue, {
2067
2075
  /**
2068
2076
  * Discriminator indicating that this event is a group event.
2069
2077
  */
2070
- type: y("group")
2071
- }), Xt = g(ue, {
2078
+ type: v("group")
2079
+ }), en = g(ue, {
2072
2080
  /**
2073
2081
  * Discriminator indicating that this event is an identify event.
2074
2082
  */
2075
- type: y("identify"),
2083
+ type: v("identify"),
2076
2084
  /**
2077
2085
  * Traits describing the user.
2078
2086
  *
2079
2087
  * @see {@link Traits}
2080
2088
  */
2081
- traits: Jt
2082
- }), or = g(Qt, {
2089
+ traits: Qt
2090
+ }), ur = g(Xt, {
2083
2091
  /**
2084
2092
  * Page context for events that occur within a web page.
2085
2093
  */
2086
- page: Ee
2087
- }), Yt = g(ue, {
2094
+ page: ze
2095
+ }), tn = g(ue, {
2088
2096
  /**
2089
2097
  * Discriminator indicating that this event is a page view.
2090
2098
  */
2091
- type: y("page"),
2099
+ type: v("page"),
2092
2100
  /**
2093
2101
  * Optional name for the page.
2094
2102
  *
@@ -2099,22 +2107,22 @@ const jo = f(
2099
2107
  /**
2100
2108
  * Page-level properties such as URL, path, and referrer.
2101
2109
  */
2102
- properties: Ee,
2110
+ properties: ze,
2103
2111
  /*
2104
2112
  * Override the context property of {@link UniversalEventProperties}
2105
2113
  * with a page-specific context
2106
2114
  */
2107
- context: or
2108
- }), sr = g(Qt, {
2115
+ context: ur
2116
+ }), lr = g(Xt, {
2109
2117
  /**
2110
2118
  * Screen context for events that occur within a web page.
2111
2119
  */
2112
- screen: Gt
2113
- }), en = g(ue, {
2120
+ screen: Jt
2121
+ }), nn = g(ue, {
2114
2122
  /**
2115
2123
  * Discriminator indicating that this event is a screen view.
2116
2124
  */
2117
- type: y("screen"),
2125
+ type: v("screen"),
2118
2126
  /**
2119
2127
  * Name of the screen being viewed.
2120
2128
  */
@@ -2129,12 +2137,12 @@ const jo = f(
2129
2137
  * Override the context property of {@link UniversalEventProperties}
2130
2138
  * with a screen-specific context
2131
2139
  */
2132
- context: sr
2133
- }), tn = g(ue, {
2140
+ context: lr
2141
+ }), rn = g(ue, {
2134
2142
  /**
2135
2143
  * Discriminator indicating that this event is a track event.
2136
2144
  */
2137
- type: y("track"),
2145
+ type: v("track"),
2138
2146
  /**
2139
2147
  * Name of the event being tracked.
2140
2148
  */
@@ -2143,40 +2151,40 @@ const jo = f(
2143
2151
  * Additional properties describing the event.
2144
2152
  */
2145
2153
  properties: lt
2146
- }), ne = { anonymousId: l() }, Yo = Be("type", [
2147
- g(rr, ne),
2148
- g(ye, ne),
2149
- g(ir, ne),
2150
- g(Xt, ne),
2151
- g(Yt, ne),
2154
+ }), ne = { anonymousId: l() }, ns = Be("type", [
2155
+ g(ar, ne),
2156
+ g(be, ne),
2157
+ g(cr, ne),
2152
2158
  g(en, ne),
2153
- g(tn, ne)
2154
- ]), bc = $(Yo), ar = Be("type", [
2155
- rr,
2156
- ye,
2157
- ir,
2158
- Xt,
2159
- Yt,
2159
+ g(tn, ne),
2160
+ g(nn, ne),
2161
+ g(rn, ne)
2162
+ ]), zc = A(ns), dr = Be("type", [
2163
+ ar,
2164
+ be,
2165
+ cr,
2160
2166
  en,
2161
- tn
2162
- ]), Ye = $(ar), es = h({
2167
+ tn,
2168
+ nn,
2169
+ rn
2170
+ ]), Qe = A(dr), rs = h({
2163
2171
  /**
2164
2172
  * Features or capabilities to enable for this request.
2165
2173
  */
2166
- features: f($(l()))
2167
- }), _c = h({
2174
+ features: f(A(l()))
2175
+ }), Tc = h({
2168
2176
  /**
2169
2177
  * Experience events that should be evaluated by the Experience API.
2170
2178
  *
2171
2179
  * @remarks
2172
2180
  * Must contain at least one event.
2173
2181
  */
2174
- events: Ye.check(Zi(1)),
2182
+ events: Qe.check(qi(1)),
2175
2183
  /**
2176
2184
  * Optional configuration for this experience request.
2177
2185
  */
2178
- options: f(es)
2179
- }), ts = h({
2186
+ options: f(rs)
2187
+ }), is = h({
2180
2188
  /**
2181
2189
  * Identifier of the personalization or experiment experience.
2182
2190
  */
@@ -2187,7 +2195,7 @@ const jo = f(
2187
2195
  * @remarks
2188
2196
  * Typically corresponds to the index of the selected {@link PersonalizationConfig } entry.
2189
2197
  */
2190
- variantIndex: A(),
2198
+ variantIndex: $(),
2191
2199
  /**
2192
2200
  * Mapping of baseline entry IDs to their selected variant entry IDs.
2193
2201
  *
@@ -2206,7 +2214,7 @@ const jo = f(
2206
2214
  * same user, rather than re-allocating a new variant.
2207
2215
  */
2208
2216
  sticky: f(K(q(), !1))
2209
- }), cr = $(ts), ns = h({
2217
+ }), fr = A(is), os = h({
2210
2218
  /**
2211
2219
  * Profile associated with the evaluated events.
2212
2220
  */
@@ -2216,50 +2224,50 @@ const jo = f(
2216
2224
  *
2217
2225
  * @see {@link SelectedPersonalizationArray}
2218
2226
  */
2219
- experiences: cr,
2227
+ experiences: fr,
2220
2228
  /**
2221
2229
  * Currently used for Custom Flags.
2222
2230
  *
2223
2231
  * @see {@link ChangeArray}
2224
2232
  */
2225
- changes: nr
2226
- }), gt = g(er, { data: ns }), ur = Be("type", [ye]), rs = $(ur), is = h({
2233
+ changes: sr
2234
+ }), gt = g(ir, { data: os }), pr = Be("type", [be]), ss = A(pr), as = h({
2227
2235
  /**
2228
2236
  * Partial profile information used to associate events with a user.
2229
2237
  *
2230
2238
  * @see PartialProfile
2231
2239
  */
2232
- profile: Ho,
2240
+ profile: Yo,
2233
2241
  /**
2234
2242
  * Insights events that should be recorded for this profile.
2235
2243
  *
2236
2244
  * @see InsightsEventArray
2237
2245
  */
2238
- events: rs
2239
- }), lr = $(is);
2240
- var Vt = [], os = (t) => new RegExp(t.replace(/\*/g, ".*") + "$"), ss = (t) => {
2241
- Vt = t.split(/[\s,]+/).map(os);
2246
+ events: ss
2247
+ }), hr = A(as);
2248
+ var Vt = [], cs = (t) => new RegExp(t.replace(/\*/g, ".*") + "$"), us = (t) => {
2249
+ Vt = t.split(/[\s,]+/).map(cs);
2242
2250
  }, de = (t, e, n, ...r) => {
2243
2251
  for (let i = Vt.length; i--; ) if (Vt[i].test(t)) return e({ name: t, level: n, messages: r });
2244
- }, as = (t) => {
2252
+ }, ls = (t) => {
2245
2253
  let e = "";
2246
2254
  const n = console[t.level === "fatal" ? "error" : t.level];
2247
2255
  t.name && (e += `[${t.name}] `), typeof t.messages[0] == "object" ? n(e, ...t.messages) : n(e + t.messages.shift(), ...t.messages);
2248
- }, dr = (t, e) => ({ fatal: de.bind(0, t, e = e || as, "fatal"), error: de.bind(0, t, e, "error"), warn: de.bind(0, t, e, "warn"), debug: de.bind(0, t, e, "debug"), info: de.bind(0, t, e, "info"), log: de.bind(0, t, e, "log") }), Se = dr("");
2249
- Se.fatal;
2250
- Se.error;
2251
- Se.warn;
2252
- Se.debug;
2253
- Se.info;
2254
- Se.log;
2255
- class cs {
2256
+ }, gr = (t, e) => ({ fatal: de.bind(0, t, e = e || ls, "fatal"), error: de.bind(0, t, e, "error"), warn: de.bind(0, t, e, "warn"), debug: de.bind(0, t, e, "debug"), info: de.bind(0, t, e, "info"), log: de.bind(0, t, e, "log") }), Te = gr("");
2257
+ Te.fatal;
2258
+ Te.error;
2259
+ Te.warn;
2260
+ Te.debug;
2261
+ Te.info;
2262
+ Te.log;
2263
+ class ds {
2256
2264
  name = "@contentful/optimization";
2257
2265
  PREFIX_PARTS = ["Ctfl", "O10n"];
2258
2266
  DELIMITER = ":";
2259
2267
  diary;
2260
2268
  sinks = [];
2261
2269
  constructor() {
2262
- this.diary = dr(this.name, this.onLogEvent.bind(this)), ss(this.name);
2270
+ this.diary = gr(this.name, this.onLogEvent.bind(this)), us(this.name);
2263
2271
  }
2264
2272
  assembleLocationPrefix(e) {
2265
2273
  return `[${[...this.PREFIX_PARTS, e].join(this.DELIMITER)}]`;
@@ -2297,7 +2305,7 @@ class cs {
2297
2305
  });
2298
2306
  }
2299
2307
  }
2300
- const oe = new cs();
2308
+ const oe = new ds();
2301
2309
  function P(t) {
2302
2310
  return {
2303
2311
  debug: (e, ...n) => {
@@ -2320,10 +2328,10 @@ function P(t) {
2320
2328
  }
2321
2329
  };
2322
2330
  }
2323
- class us {
2331
+ class fs {
2324
2332
  }
2325
- var fe = { fatal: 60, error: 50, warn: 40, info: 30, debug: 20, log: 10 }, ls = (t, e) => e in fe && t in fe ? fe[e] === fe[t] ? 0 : fe[e] < fe[t] ? 1 : -1 : 0;
2326
- const ds = {
2333
+ var fe = { fatal: 60, error: 50, warn: 40, info: 30, debug: 20, log: 10 }, ps = (t, e) => e in fe && t in fe ? fe[e] === fe[t] ? 0 : fe[e] < fe[t] ? 1 : -1 : 0;
2334
+ const hs = {
2327
2335
  debug: (...t) => {
2328
2336
  console.debug(...t);
2329
2337
  },
@@ -2342,24 +2350,24 @@ const ds = {
2342
2350
  fatal: (...t) => {
2343
2351
  console.error(...t);
2344
2352
  }
2345
- }, fs = 0;
2346
- class ps extends us {
2353
+ }, gs = 0;
2354
+ class vs extends fs {
2347
2355
  name = "ConsoleLogSink";
2348
2356
  verbosity;
2349
2357
  constructor(e) {
2350
2358
  super(), this.verbosity = e ?? "error";
2351
2359
  }
2352
2360
  ingest(e) {
2353
- ls(this.verbosity, e.level) > fs || ds[e.level](...e.messages);
2361
+ ps(this.verbosity, e.level) > gs || hs[e.level](...e.messages);
2354
2362
  }
2355
2363
  }
2356
- function hs(t) {
2364
+ function ys(t) {
2357
2365
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
2358
2366
  }
2359
- var vt = {}, yt, dn;
2360
- function gs() {
2361
- if (dn) return yt;
2362
- dn = 1;
2367
+ var vt = {}, yt, pn;
2368
+ function ms() {
2369
+ if (pn) return yt;
2370
+ pn = 1;
2363
2371
  function t(e, n) {
2364
2372
  typeof n == "boolean" && (n = { forever: n }), this._originalTimeouts = JSON.parse(JSON.stringify(e)), this._timeouts = e, this._options = n || {}, this._maxRetryTime = n && n.maxRetryTime || 1 / 0, this._fn = null, this._errors = [], this._attempts = 1, this._operationTimeout = null, this._operationTimeoutCb = null, this._timeout = null, this._operationStart = null, this._timer = null, this._options.forever && (this._cachedTimeouts = this._timeouts.slice(0));
2365
2373
  }
@@ -2410,10 +2418,10 @@ function gs() {
2410
2418
  return n;
2411
2419
  }, yt;
2412
2420
  }
2413
- var fn;
2414
- function vs() {
2415
- return fn || (fn = 1, function(t) {
2416
- var e = gs();
2421
+ var hn;
2422
+ function bs() {
2423
+ return hn || (hn = 1, function(t) {
2424
+ var e = ms();
2417
2425
  t.operation = function(n) {
2418
2426
  var r = t.timeouts(n);
2419
2427
  return new e(r, {
@@ -2463,12 +2471,12 @@ function vs() {
2463
2471
  };
2464
2472
  }(vt)), vt;
2465
2473
  }
2466
- var mt, pn;
2467
- function ys() {
2468
- return pn || (pn = 1, mt = vs()), mt;
2474
+ var mt, gn;
2475
+ function _s() {
2476
+ return gn || (gn = 1, mt = bs()), mt;
2469
2477
  }
2470
- var ms = ys();
2471
- const bs = /* @__PURE__ */ hs(ms), _s = Object.prototype.toString, ws = (t) => _s.call(t) === "[object Error]", Es = /* @__PURE__ */ new Set([
2478
+ var ws = _s();
2479
+ const Es = /* @__PURE__ */ ys(ws), Ss = Object.prototype.toString, zs = (t) => Ss.call(t) === "[object Error]", Ts = /* @__PURE__ */ new Set([
2472
2480
  "network error",
2473
2481
  // Chrome
2474
2482
  "Failed to fetch",
@@ -2486,23 +2494,23 @@ const bs = /* @__PURE__ */ hs(ms), _s = Object.prototype.toString, ws = (t) => _
2486
2494
  "terminated"
2487
2495
  // Undici (Node.js)
2488
2496
  ]);
2489
- function Ss(t) {
2490
- return t && ws(t) && t.name === "TypeError" && typeof t.message == "string" ? t.message === "Load failed" ? t.stack === void 0 : Es.has(t.message) : !1;
2497
+ function ks(t) {
2498
+ return t && zs(t) && t.name === "TypeError" && typeof t.message == "string" ? t.message === "Load failed" ? t.stack === void 0 : Ts.has(t.message) : !1;
2491
2499
  }
2492
- class zs extends Error {
2500
+ class As extends Error {
2493
2501
  constructor(e) {
2494
2502
  super(), e instanceof Error ? (this.originalError = e, { message: e } = e) : (this.originalError = new Error(e), this.originalError.stack = this.stack), this.name = "AbortError", this.message = e;
2495
2503
  }
2496
2504
  }
2497
- const hn = (t, e, n) => {
2505
+ const vn = (t, e, n) => {
2498
2506
  const r = n.retries - (e - 1);
2499
2507
  return t.attemptNumber = e, t.retriesLeft = r, t;
2500
2508
  };
2501
- async function Ts(t, e) {
2509
+ async function $s(t, e) {
2502
2510
  return new Promise((n, r) => {
2503
2511
  e = { ...e }, e.onFailedAttempt ??= () => {
2504
2512
  }, e.shouldRetry ??= () => !0, e.retries ??= 10;
2505
- const i = bs.operation(e), o = () => {
2513
+ const i = Es.operation(e), o = () => {
2506
2514
  i.stop(), r(e.signal?.reason);
2507
2515
  };
2508
2516
  e.signal && !e.signal.aborted && e.signal.addEventListener("abort", o, { once: !0 });
@@ -2517,21 +2525,21 @@ async function Ts(t, e) {
2517
2525
  try {
2518
2526
  if (!(c instanceof Error))
2519
2527
  throw new TypeError(`Non-error was thrown: "${c}". You should only throw errors.`);
2520
- if (c instanceof zs)
2528
+ if (c instanceof As)
2521
2529
  throw c.originalError;
2522
- if (c instanceof TypeError && !Ss(c))
2530
+ if (c instanceof TypeError && !ks(c))
2523
2531
  throw c;
2524
- if (hn(c, a, e), await e.shouldRetry(c) || (i.stop(), r(c)), await e.onFailedAttempt(c), !i.retry(c))
2532
+ if (vn(c, a, e), await e.shouldRetry(c) || (i.stop(), r(c)), await e.onFailedAttempt(c), !i.retry(c))
2525
2533
  throw i.mainError();
2526
2534
  } catch (u) {
2527
- hn(u, a, e), s(), r(u);
2535
+ vn(u, a, e), s(), r(u);
2528
2536
  }
2529
2537
  }
2530
2538
  });
2531
2539
  });
2532
2540
  }
2533
- const bt = P("ApiClient:Retry"), ks = 0, As = 1, _t = 503, $s = 500;
2534
- class rt extends Error {
2541
+ const bt = P("ApiClient:Retry"), Ps = 0, Is = 1, _t = 503, Cs = 500;
2542
+ class nt extends Error {
2535
2543
  /**
2536
2544
  * The HTTP status code associated with the error.
2537
2545
  */
@@ -2542,11 +2550,11 @@ class rt extends Error {
2542
2550
  * @param message - Description of the error.
2543
2551
  * @param status - HTTP status code associated with the error.
2544
2552
  */
2545
- constructor(e, n = $s) {
2546
- super(e), Object.setPrototypeOf(this, rt.prototype), this.status = n;
2553
+ constructor(e, n = Cs) {
2554
+ super(e), Object.setPrototypeOf(this, nt.prototype), this.status = n;
2547
2555
  }
2548
2556
  }
2549
- function Ps({
2557
+ function Rs({
2550
2558
  apiName: t = "Optimization",
2551
2559
  controller: e,
2552
2560
  fetchMethod: n = fetch,
@@ -2557,7 +2565,7 @@ function Ps({
2557
2565
  try {
2558
2566
  const o = await n(i, r);
2559
2567
  if (o.status === _t)
2560
- throw new rt(
2568
+ throw new nt(
2561
2569
  `${t} API request to "${i.toString()}" failed with status: "[${o.status}] ${o.statusText}".`,
2562
2570
  _t
2563
2571
  );
@@ -2570,25 +2578,25 @@ function Ps({
2570
2578
  }
2571
2579
  return bt.debug(`Response from "${i.toString()}":`, o), o;
2572
2580
  } catch (o) {
2573
- if (o instanceof rt && o.status === _t)
2581
+ if (o instanceof nt && o.status === _t)
2574
2582
  throw o;
2575
2583
  bt.error(`Request to "${i.toString()}" failed:`, o), e.abort();
2576
2584
  }
2577
2585
  };
2578
2586
  }
2579
- function Is({
2587
+ function Os({
2580
2588
  apiName: t = "Optimization",
2581
2589
  fetchMethod: e = fetch,
2582
- intervalTimeout: n = ks,
2590
+ intervalTimeout: n = Ps,
2583
2591
  onFailedAttempt: r,
2584
- retries: i = As
2592
+ retries: i = Is
2585
2593
  } = {}) {
2586
2594
  return async (o, s) => {
2587
2595
  const a = new AbortController();
2588
2596
  let c;
2589
2597
  try {
2590
- c = await Ts(
2591
- Ps({ apiName: t, controller: a, fetchMethod: e, init: s, url: o }),
2598
+ c = await $s(
2599
+ Rs({ apiName: t, controller: a, fetchMethod: e, init: s, url: o }),
2592
2600
  {
2593
2601
  minTimeout: n,
2594
2602
  onFailedAttempt: (u) => r?.({ ...u, apiName: t }),
@@ -2605,30 +2613,30 @@ function Is({
2605
2613
  return c;
2606
2614
  };
2607
2615
  }
2608
- const Cs = P("ApiClient:Timeout"), Rs = 3e3;
2609
- function Os({
2616
+ const Ms = P("ApiClient:Timeout"), xs = 3e3;
2617
+ function Vs({
2610
2618
  apiName: t = "Optimization",
2611
2619
  fetchMethod: e = fetch,
2612
2620
  onRequestTimeout: n,
2613
- requestTimeout: r = Rs
2621
+ requestTimeout: r = xs
2614
2622
  } = {}) {
2615
2623
  return async (i, o) => {
2616
2624
  const s = new AbortController(), a = setTimeout(() => {
2617
- typeof n == "function" ? n({ apiName: t }) : Cs.error(`Request to "${i.toString()}" timed out`, new Error("Request timeout")), s.abort();
2625
+ typeof n == "function" ? n({ apiName: t }) : Ms.error(`Request to "${i.toString()}" timed out`, new Error("Request timeout")), s.abort();
2618
2626
  }, r), c = await e(i, { ...o, signal: s.signal });
2619
2627
  return clearTimeout(a), c;
2620
2628
  };
2621
2629
  }
2622
- const gn = P("ApiClient:Fetch");
2623
- function Ms(t) {
2630
+ const yn = P("ApiClient:Fetch");
2631
+ function Ns(t) {
2624
2632
  try {
2625
- const e = Os(t);
2626
- return Is({ ...t, fetchMethod: e });
2633
+ const e = Vs(t);
2634
+ return Os({ ...t, fetchMethod: e });
2627
2635
  } catch (e) {
2628
- throw e instanceof Error && (e.name === "AbortError" ? gn.warn("Request aborted due to network issues. This request may not be retried.") : gn.error("Request failed:", e)), e;
2636
+ throw e instanceof Error && (e.name === "AbortError" ? yn.warn("Request aborted due to network issues. This request may not be retried.") : yn.error("Request failed:", e)), e;
2629
2637
  }
2630
2638
  }
2631
- const xs = {
2639
+ const Ls = {
2632
2640
  /**
2633
2641
  * Creates a fully protected fetch method with timeout and retry behavior.
2634
2642
  *
@@ -2645,9 +2653,9 @@ const xs = {
2645
2653
  *
2646
2654
  * @see createProtectedFetchMethod
2647
2655
  */
2648
- create: Ms
2649
- }, vn = P("ApiClient"), Vs = "main";
2650
- class fr {
2656
+ create: Ns
2657
+ }, mn = P("ApiClient"), js = "main";
2658
+ class vr {
2651
2659
  /**
2652
2660
  * Name of the API client, used in log messages and as the `apiName` for fetch.
2653
2661
  */
@@ -2671,7 +2679,7 @@ class fr {
2671
2679
  * @param config - Configuration options for the client.
2672
2680
  */
2673
2681
  constructor(e, { fetchOptions: n, clientId: r, environment: i }) {
2674
- this.clientId = r, this.environment = i ?? Vs, this.name = e, this.fetch = xs.create({ ...n ?? {}, apiName: e });
2682
+ this.clientId = r, this.environment = i ?? js, this.name = e, this.fetch = Ls.create({ ...n ?? {}, apiName: e });
2675
2683
  }
2676
2684
  /**
2677
2685
  * Logs errors that occur during API requests with standardized messages.
@@ -2687,13 +2695,13 @@ class fr {
2687
2695
  * The log message includes the client name for better debugging context.
2688
2696
  */
2689
2697
  logRequestError(e, { requestName: n }) {
2690
- e instanceof Error && (e.name === "AbortError" ? vn.warn(
2698
+ e instanceof Error && (e.name === "AbortError" ? mn.warn(
2691
2699
  `[${this.name}] "${n}" request aborted due to network issues. This request may not be retried.`
2692
- ) : vn.error(`[${this.name}] "${n}" request failed:`, e));
2700
+ ) : mn.error(`[${this.name}] "${n}" request failed:`, e));
2693
2701
  }
2694
2702
  }
2695
- const j = P("ApiClient:Experience"), Ns = "https://experience.ninetailed.co/";
2696
- class Ls extends fr {
2703
+ const j = P("ApiClient:Experience"), Bs = "https://experience.ninetailed.co/";
2704
+ class Us extends vr {
2697
2705
  /**
2698
2706
  * Base URL used for Experience API requests.
2699
2707
  */
@@ -2711,7 +2719,7 @@ class Ls extends fr {
2711
2719
  constructor(e) {
2712
2720
  super("Experience", e);
2713
2721
  const { baseUrl: n, enabledFeatures: r, ip: i, locale: o, plainText: s, preflight: a } = e;
2714
- this.baseUrl = n || Ns, this.enabledFeatures = r, this.ip = i, this.locale = o, this.plainText = s, this.preflight = a;
2722
+ this.baseUrl = n || Bs, this.enabledFeatures = r, this.ip = i, this.locale = o, this.plainText = s, this.preflight = a;
2715
2723
  }
2716
2724
  /**
2717
2725
  * Retrieves a profile by ID.
@@ -2792,7 +2800,7 @@ class Ls extends fr {
2792
2800
  const r = "Create Profile";
2793
2801
  j.info(`Sending "${r}" request`);
2794
2802
  const i = {
2795
- events: Ye.parse(e),
2803
+ events: Qe.parse(e),
2796
2804
  options: this.constructBodyOptions(n)
2797
2805
  };
2798
2806
  j.debug(`"${r}" request body:`, i);
@@ -2832,7 +2840,7 @@ class Ls extends fr {
2832
2840
  const i = "Update Profile";
2833
2841
  j.info(`Sending "${i}" request`);
2834
2842
  const o = {
2835
- events: Ye.parse(n),
2843
+ events: Qe.parse(n),
2836
2844
  options: this.constructBodyOptions(r)
2837
2845
  };
2838
2846
  j.debug(`"${i}" request body:`, o);
@@ -2895,7 +2903,7 @@ class Ls extends fr {
2895
2903
  const r = "Upsert Many Profiles";
2896
2904
  j.info(`Sending "${r}" request`);
2897
2905
  const i = {
2898
- events: Ye.parse(e),
2906
+ events: Qe.parse(e),
2899
2907
  options: this.constructBodyOptions(n)
2900
2908
  };
2901
2909
  j.debug(`"${r}" request body:`, i);
@@ -2906,7 +2914,7 @@ class Ls extends fr {
2906
2914
  options: { plainText: !1, ...n }
2907
2915
  }), {
2908
2916
  data: { profiles: s }
2909
- } = Wo.parse(await o.json());
2917
+ } = Jo.parse(await o.json());
2910
2918
  return j.debug(`"${r}" request successfully completed`), s;
2911
2919
  } catch (o) {
2912
2920
  throw this.logRequestError(o, { requestName: r }), o;
@@ -2955,8 +2963,8 @@ class Ls extends fr {
2955
2963
  return e && Array.isArray(e) && e.length > 0 ? n.features = e : n.features = ["ip-enrichment", "location"], n;
2956
2964
  };
2957
2965
  }
2958
- const ze = P("ApiClient:Insights"), js = "https://ingest.insights.ninetailed.co/";
2959
- class Bs extends fr {
2966
+ const ke = P("ApiClient:Insights"), Ds = "https://ingest.insights.ninetailed.co/";
2967
+ class Zs extends vr {
2960
2968
  /**
2961
2969
  * Base URL used for Insights API requests.
2962
2970
  */
@@ -2984,7 +2992,7 @@ class Bs extends fr {
2984
2992
  constructor(e) {
2985
2993
  super("Insights", e);
2986
2994
  const { baseUrl: n, beaconHandler: r } = e;
2987
- this.baseUrl = n ?? js, this.beaconHandler = r;
2995
+ this.baseUrl = n ?? Ds, this.beaconHandler = r;
2988
2996
  }
2989
2997
  /**
2990
2998
  * Sends batches of insights events to the Ninetailed Insights API.
@@ -3024,16 +3032,16 @@ class Bs extends fr {
3024
3032
  const { beaconHandler: r = this.beaconHandler } = n, i = new URL(
3025
3033
  `v1/organizations/${this.clientId}/environments/${this.environment}/events`,
3026
3034
  this.baseUrl
3027
- ), o = lr.parse(e);
3035
+ ), o = hr.parse(e);
3028
3036
  if (typeof r == "function") {
3029
- if (ze.debug("Queueing events via beaconHandler"), r(i, o))
3037
+ if (ke.debug("Queueing events via beaconHandler"), r(i, o))
3030
3038
  return !0;
3031
- ze.warn(
3039
+ ke.warn(
3032
3040
  "beaconHandler failed to queue events; events will be emitted immediately via fetch"
3033
3041
  );
3034
3042
  }
3035
3043
  const s = "Event Batches";
3036
- ze.info(`Sending "${s}" request`), ze.debug(`"${s}" request body:`, o);
3044
+ ke.info(`Sending "${s}" request`), ke.debug(`"${s}" request body:`, o);
3037
3045
  try {
3038
3046
  return await this.fetch(i, {
3039
3047
  method: "POST",
@@ -3042,13 +3050,13 @@ class Bs extends fr {
3042
3050
  },
3043
3051
  body: JSON.stringify(o),
3044
3052
  keepalive: !0
3045
- }), ze.debug(`"${s}" request successfully completed`), !0;
3053
+ }), ke.debug(`"${s}" request successfully completed`), !0;
3046
3054
  } catch (a) {
3047
3055
  return this.logRequestError(a, { requestName: s }), !1;
3048
3056
  }
3049
3057
  }
3050
3058
  }
3051
- class Us {
3059
+ class Fs {
3052
3060
  /**
3053
3061
  * Shared configuration applied to both Experience and Insights clients.
3054
3062
  */
@@ -3068,51 +3076,51 @@ class Us {
3068
3076
  */
3069
3077
  constructor(e) {
3070
3078
  const { personalization: n, analytics: r, ...i } = e;
3071
- this.config = i, this.experience = new Ls({
3079
+ this.config = i, this.experience = new Us({
3072
3080
  ...i,
3073
3081
  ...n
3074
- }), this.insights = new Bs({
3082
+ }), this.insights = new Zs({
3075
3083
  ...i,
3076
3084
  ...r
3077
3085
  });
3078
3086
  }
3079
3087
  }
3080
- function Zs() {
3088
+ function qs() {
3081
3089
  }
3082
- function yn(t) {
3090
+ function bn(t) {
3083
3091
  return Object.getOwnPropertySymbols(t).filter((e) => Object.prototype.propertyIsEnumerable.call(t, e));
3084
3092
  }
3085
- function mn(t) {
3093
+ function _n(t) {
3086
3094
  return t == null ? t === void 0 ? "[object Undefined]" : "[object Null]" : Object.prototype.toString.call(t);
3087
3095
  }
3088
- const Ds = "[object RegExp]", Fs = "[object String]", qs = "[object Number]", Hs = "[object Boolean]", bn = "[object Arguments]", Ks = "[object Symbol]", Ws = "[object Date]", Gs = "[object Map]", Js = "[object Set]", Qs = "[object Array]", Xs = "[object Function]", Ys = "[object ArrayBuffer]", wt = "[object Object]", ea = "[object Error]", ta = "[object DataView]", na = "[object Uint8Array]", ra = "[object Uint8ClampedArray]", ia = "[object Uint16Array]", oa = "[object Uint32Array]", sa = "[object BigUint64Array]", aa = "[object Int8Array]", ca = "[object Int16Array]", ua = "[object Int32Array]", la = "[object BigInt64Array]", da = "[object Float32Array]", fa = "[object Float64Array]";
3089
- function it(t) {
3096
+ const Hs = "[object RegExp]", Ks = "[object String]", Ws = "[object Number]", Ys = "[object Boolean]", wn = "[object Arguments]", Gs = "[object Symbol]", Js = "[object Date]", Qs = "[object Map]", Xs = "[object Set]", ea = "[object Array]", ta = "[object Function]", na = "[object ArrayBuffer]", wt = "[object Object]", ra = "[object Error]", ia = "[object DataView]", oa = "[object Uint8Array]", sa = "[object Uint8ClampedArray]", aa = "[object Uint16Array]", ca = "[object Uint32Array]", ua = "[object BigUint64Array]", la = "[object Int8Array]", da = "[object Int16Array]", fa = "[object Int32Array]", pa = "[object BigInt64Array]", ha = "[object Float32Array]", ga = "[object Float64Array]";
3097
+ function rt(t) {
3090
3098
  if (!t || typeof t != "object")
3091
3099
  return !1;
3092
3100
  const e = Object.getPrototypeOf(t);
3093
3101
  return e === null || e === Object.prototype || Object.getPrototypeOf(e) === null ? Object.prototype.toString.call(t) === "[object Object]" : !1;
3094
3102
  }
3095
- function ot(t) {
3103
+ function it(t) {
3096
3104
  return t === "__proto__";
3097
3105
  }
3098
- function he(t, e) {
3106
+ function ge(t, e) {
3099
3107
  const n = Object.keys(e);
3100
3108
  for (let r = 0; r < n.length; r++) {
3101
3109
  const i = n[r];
3102
- if (ot(i))
3110
+ if (it(i))
3103
3111
  continue;
3104
3112
  const o = e[i], s = t[i];
3105
- Array.isArray(o) ? Array.isArray(s) ? t[i] = he(s, o) : t[i] = he([], o) : it(o) ? it(s) ? t[i] = he(s, o) : t[i] = he({}, o) : (s === void 0 || o !== void 0) && (t[i] = o);
3113
+ Array.isArray(o) ? Array.isArray(s) ? t[i] = ge(s, o) : t[i] = ge([], o) : rt(o) ? rt(s) ? t[i] = ge(s, o) : t[i] = ge({}, o) : (s === void 0 || o !== void 0) && (t[i] = o);
3106
3114
  }
3107
3115
  return t;
3108
3116
  }
3109
- function pa(t, e) {
3117
+ function va(t, e) {
3110
3118
  return t === e || Number.isNaN(t) && Number.isNaN(e);
3111
3119
  }
3112
- function ha(t, e, n) {
3113
- return Ie(t, e, void 0, void 0, void 0, void 0, n);
3120
+ function ya(t, e, n) {
3121
+ return Re(t, e, void 0, void 0, void 0, void 0, n);
3114
3122
  }
3115
- function Ie(t, e, n, r, i, o, s) {
3123
+ function Re(t, e, n, r, i, o, s) {
3116
3124
  const a = s(t, e, n, r, i, o);
3117
3125
  if (a !== void 0)
3118
3126
  return a;
@@ -3129,30 +3137,30 @@ function Ie(t, e, n, r, i, o, s) {
3129
3137
  case "function":
3130
3138
  return t === e;
3131
3139
  case "object":
3132
- return Me(t, e, o, s);
3140
+ return xe(t, e, o, s);
3133
3141
  }
3134
- return Me(t, e, o, s);
3142
+ return xe(t, e, o, s);
3135
3143
  }
3136
- function Me(t, e, n, r) {
3144
+ function xe(t, e, n, r) {
3137
3145
  if (Object.is(t, e))
3138
3146
  return !0;
3139
- let i = mn(t), o = mn(e);
3140
- if (i === bn && (i = wt), o === bn && (o = wt), i !== o)
3147
+ let i = _n(t), o = _n(e);
3148
+ if (i === wn && (i = wt), o === wn && (o = wt), i !== o)
3141
3149
  return !1;
3142
3150
  switch (i) {
3143
- case Fs:
3151
+ case Ks:
3144
3152
  return t.toString() === e.toString();
3145
- case qs: {
3153
+ case Ws: {
3146
3154
  const c = t.valueOf(), u = e.valueOf();
3147
- return pa(c, u);
3155
+ return va(c, u);
3148
3156
  }
3149
- case Hs:
3150
- case Ws:
3151
- case Ks:
3157
+ case Ys:
3158
+ case Js:
3159
+ case Gs:
3152
3160
  return Object.is(t.valueOf(), e.valueOf());
3153
- case Ds:
3161
+ case Hs:
3154
3162
  return t.source === e.source && t.flags === e.flags;
3155
- case Xs:
3163
+ case ta:
3156
3164
  return t === e;
3157
3165
  }
3158
3166
  n = n ?? /* @__PURE__ */ new Map();
@@ -3162,30 +3170,27 @@ function Me(t, e, n, r) {
3162
3170
  n.set(t, e), n.set(e, t);
3163
3171
  try {
3164
3172
  switch (i) {
3165
- case Gs: {
3173
+ case Qs: {
3166
3174
  if (t.size !== e.size)
3167
3175
  return !1;
3168
3176
  for (const [c, u] of t.entries())
3169
- if (!e.has(c) || !Ie(u, e.get(c), c, t, e, n, r))
3177
+ if (!e.has(c) || !Re(u, e.get(c), c, t, e, n, r))
3170
3178
  return !1;
3171
3179
  return !0;
3172
3180
  }
3173
- case Js: {
3181
+ case Xs: {
3174
3182
  if (t.size !== e.size)
3175
3183
  return !1;
3176
3184
  const c = Array.from(t.values()), u = Array.from(e.values());
3177
3185
  for (let d = 0; d < c.length; d++) {
3178
- const m = c[d], _ = u.findIndex((S) => Ie(m, S, void 0, t, e, n, r));
3186
+ const m = c[d], _ = u.findIndex((S) => Re(m, S, void 0, t, e, n, r));
3179
3187
  if (_ === -1)
3180
3188
  return !1;
3181
3189
  u.splice(_, 1);
3182
3190
  }
3183
3191
  return !0;
3184
3192
  }
3185
- case Qs:
3186
- case na:
3187
- case ra:
3188
- case ia:
3193
+ case ea:
3189
3194
  case oa:
3190
3195
  case sa:
3191
3196
  case aa:
@@ -3193,24 +3198,27 @@ function Me(t, e, n, r) {
3193
3198
  case ua:
3194
3199
  case la:
3195
3200
  case da:
3196
- case fa: {
3201
+ case fa:
3202
+ case pa:
3203
+ case ha:
3204
+ case ga: {
3197
3205
  if (typeof Buffer < "u" && Buffer.isBuffer(t) !== Buffer.isBuffer(e) || t.length !== e.length)
3198
3206
  return !1;
3199
3207
  for (let c = 0; c < t.length; c++)
3200
- if (!Ie(t[c], e[c], c, t, e, n, r))
3208
+ if (!Re(t[c], e[c], c, t, e, n, r))
3201
3209
  return !1;
3202
3210
  return !0;
3203
3211
  }
3204
- case Ys:
3205
- return t.byteLength !== e.byteLength ? !1 : Me(new Uint8Array(t), new Uint8Array(e), n, r);
3206
- case ta:
3207
- return t.byteLength !== e.byteLength || t.byteOffset !== e.byteOffset ? !1 : Me(new Uint8Array(t), new Uint8Array(e), n, r);
3208
- case ea:
3212
+ case na:
3213
+ return t.byteLength !== e.byteLength ? !1 : xe(new Uint8Array(t), new Uint8Array(e), n, r);
3214
+ case ia:
3215
+ return t.byteLength !== e.byteLength || t.byteOffset !== e.byteOffset ? !1 : xe(new Uint8Array(t), new Uint8Array(e), n, r);
3216
+ case ra:
3209
3217
  return t.name === e.name && t.message === e.message;
3210
3218
  case wt: {
3211
- if (!(Me(t.constructor, e.constructor, n, r) || it(t) && it(e)))
3219
+ if (!(xe(t.constructor, e.constructor, n, r) || rt(t) && rt(e)))
3212
3220
  return !1;
3213
- const u = [...Object.keys(t), ...yn(t)], d = [...Object.keys(e), ...yn(e)];
3221
+ const u = [...Object.keys(t), ...bn(t)], d = [...Object.keys(e), ...bn(e)];
3214
3222
  if (u.length !== d.length)
3215
3223
  return !1;
3216
3224
  for (let m = 0; m < u.length; m++) {
@@ -3218,7 +3226,7 @@ function Me(t, e, n, r) {
3218
3226
  if (!Object.hasOwn(e, _))
3219
3227
  return !1;
3220
3228
  const b = e[_];
3221
- if (!Ie(S, b, _, t, e, n, r))
3229
+ if (!Re(S, b, _, t, e, n, r))
3222
3230
  return !1;
3223
3231
  }
3224
3232
  return !0;
@@ -3231,32 +3239,32 @@ function Me(t, e, n, r) {
3231
3239
  }
3232
3240
  }
3233
3241
  function Et(t, e) {
3234
- return ha(t, e, Zs);
3242
+ return ya(t, e, qs);
3235
3243
  }
3236
- const Ze = h({
3237
- campaign: f(Yn),
3244
+ const De = h({
3245
+ campaign: f(rr),
3238
3246
  locale: f(l()),
3239
- location: f(Wt),
3240
- page: f(Ee),
3241
- screen: f(Gt),
3247
+ location: f(Gt),
3248
+ page: f(ze),
3249
+ screen: f(Jt),
3242
3250
  userAgent: f(l())
3243
- }), ga = g(Ze, {
3251
+ }), ma = g(De, {
3244
3252
  componentId: l(),
3245
3253
  experienceId: f(l()),
3246
- variantIndex: f(A()),
3254
+ variantIndex: f($()),
3247
3255
  sticky: f(q())
3248
- }), va = g(Ze, {
3249
- traits: f(Jt),
3256
+ }), ba = g(De, {
3257
+ traits: f(Qt),
3250
3258
  userId: l()
3251
- }), ya = g(Ze, {
3252
- properties: f(eo(Ee))
3253
- }), ma = g(Ze, {
3259
+ }), _a = g(De, {
3260
+ properties: f(ro(ze))
3261
+ }), wa = g(De, {
3254
3262
  name: l(),
3255
3263
  properties: lt
3256
- }), ba = g(Ze, {
3264
+ }), Ea = g(De, {
3257
3265
  event: l(),
3258
3266
  properties: f(K(lt, {}))
3259
- }), _n = {
3267
+ }), En = {
3260
3268
  path: "",
3261
3269
  query: {},
3262
3270
  referrer: "",
@@ -3264,7 +3272,7 @@ const Ze = h({
3264
3272
  title: "",
3265
3273
  url: ""
3266
3274
  };
3267
- class _a {
3275
+ class Sa {
3268
3276
  /**
3269
3277
  * Application metadata attached to each event.
3270
3278
  *
@@ -3321,7 +3329,7 @@ class _a {
3321
3329
  */
3322
3330
  constructor(e) {
3323
3331
  const { app: n, channel: r, library: i, getLocale: o, getPageProperties: s, getUserAgent: a } = e;
3324
- this.app = n, this.channel = r, this.library = i, this.getLocale = o ?? (() => "en-US"), this.getPageProperties = s ?? (() => _n), this.getUserAgent = a ?? (() => {
3332
+ this.app = n, this.channel = r, this.library = i, this.getLocale = o ?? (() => "en-US"), this.getPageProperties = s ?? (() => En), this.getUserAgent = a ?? (() => {
3325
3333
  });
3326
3334
  }
3327
3335
  /**
@@ -3382,7 +3390,7 @@ class _a {
3382
3390
  * ```
3383
3391
  */
3384
3392
  buildComponentView(e) {
3385
- const { componentId: n, experienceId: r, variantIndex: i, ...o } = ga.parse(e);
3393
+ const { componentId: n, experienceId: r, variantIndex: i, ...o } = ma.parse(e);
3386
3394
  return {
3387
3395
  ...this.buildUniversalEventProperties(o),
3388
3396
  type: "component",
@@ -3440,7 +3448,7 @@ class _a {
3440
3448
  * ```
3441
3449
  */
3442
3450
  buildIdentify(e) {
3443
- const { traits: n = {}, userId: r, ...i } = va.parse(e);
3451
+ const { traits: n = {}, userId: r, ...i } = ba.parse(e);
3444
3452
  return {
3445
3453
  ...this.buildUniversalEventProperties(i),
3446
3454
  type: "identify",
@@ -3473,16 +3481,16 @@ class _a {
3473
3481
  * ```
3474
3482
  */
3475
3483
  buildPageView(e = {}) {
3476
- const { properties: n = {}, ...r } = ya.parse(e), i = this.getPageProperties(), o = he(
3484
+ const { properties: n = {}, ...r } = _a.parse(e), i = this.getPageProperties(), o = ge(
3477
3485
  {
3478
3486
  ...i,
3479
- title: i.title ?? _n.title
3487
+ title: i.title ?? En.title
3480
3488
  },
3481
3489
  n
3482
3490
  ), {
3483
3491
  context: { screen: s, ...a },
3484
3492
  ...c
3485
- } = this.buildUniversalEventProperties(r), u = or.parse(a);
3493
+ } = this.buildUniversalEventProperties(r), u = ur.parse(a);
3486
3494
  return {
3487
3495
  ...c,
3488
3496
  context: u,
@@ -3509,10 +3517,10 @@ class _a {
3509
3517
  * ```
3510
3518
  */
3511
3519
  buildScreenView(e) {
3512
- const { name: n, properties: r, ...i } = ma.parse(e), {
3520
+ const { name: n, properties: r, ...i } = wa.parse(e), {
3513
3521
  context: { page: o, ...s },
3514
3522
  ...a
3515
- } = this.buildUniversalEventProperties(i), c = sr.parse(s);
3523
+ } = this.buildUniversalEventProperties(i), c = lr.parse(s);
3516
3524
  return {
3517
3525
  ...a,
3518
3526
  context: c,
@@ -3538,7 +3546,7 @@ class _a {
3538
3546
  * ```
3539
3547
  */
3540
3548
  buildTrack(e) {
3541
- const { event: n, properties: r = {}, ...i } = ba.parse(e);
3549
+ const { event: n, properties: r = {}, ...i } = Ea.parse(e);
3542
3550
  return {
3543
3551
  ...this.buildUniversalEventProperties(i),
3544
3552
  type: "track",
@@ -3547,7 +3555,7 @@ class _a {
3547
3555
  };
3548
3556
  }
3549
3557
  }
3550
- function wa(t) {
3558
+ function za(t) {
3551
3559
  switch (typeof t) {
3552
3560
  case "number":
3553
3561
  case "symbol":
@@ -3556,10 +3564,10 @@ function wa(t) {
3556
3564
  return t.includes(".") || t.includes("[") || t.includes("]");
3557
3565
  }
3558
3566
  }
3559
- function Ea(t) {
3567
+ function Ta(t) {
3560
3568
  return typeof t == "string" || typeof t == "symbol" ? t : Object.is(t?.valueOf?.(), -0) ? "-0" : String(t);
3561
3569
  }
3562
- function Sa(t) {
3570
+ function ka(t) {
3563
3571
  const e = [], n = t.length;
3564
3572
  if (n === 0)
3565
3573
  return e;
@@ -3575,39 +3583,39 @@ function Nt(t, e, n) {
3575
3583
  return n;
3576
3584
  switch (typeof e) {
3577
3585
  case "string": {
3578
- if (ot(e))
3586
+ if (it(e))
3579
3587
  return n;
3580
3588
  const r = t[e];
3581
- return r === void 0 ? wa(e) ? Nt(t, Sa(e), n) : n : r;
3589
+ return r === void 0 ? za(e) ? Nt(t, ka(e), n) : n : r;
3582
3590
  }
3583
3591
  case "number":
3584
3592
  case "symbol": {
3585
- typeof e == "number" && (e = Ea(e));
3593
+ typeof e == "number" && (e = Ta(e));
3586
3594
  const r = t[e];
3587
3595
  return r === void 0 ? n : r;
3588
3596
  }
3589
3597
  default: {
3590
3598
  if (Array.isArray(e))
3591
- return za(t, e, n);
3592
- if (Object.is(e?.valueOf(), -0) ? e = "-0" : e = String(e), ot(e))
3599
+ return Aa(t, e, n);
3600
+ if (Object.is(e?.valueOf(), -0) ? e = "-0" : e = String(e), it(e))
3593
3601
  return n;
3594
3602
  const r = t[e];
3595
3603
  return r === void 0 ? n : r;
3596
3604
  }
3597
3605
  }
3598
3606
  }
3599
- function za(t, e, n) {
3607
+ function Aa(t, e, n) {
3600
3608
  if (e.length === 0)
3601
3609
  return n;
3602
3610
  let r = t;
3603
3611
  for (let i = 0; i < e.length; i++) {
3604
- if (r == null || ot(e[i]))
3612
+ if (r == null || it(e[i]))
3605
3613
  return n;
3606
3614
  r = r[e[i]];
3607
3615
  }
3608
3616
  return r === void 0 ? n : r;
3609
3617
  }
3610
- const wn = P("Personalization"), En = "Could not resolve Merge Tag value:", xe = {
3618
+ const Sn = P("Personalization"), zn = "Could not resolve Merge Tag value:", Ve = {
3611
3619
  /**
3612
3620
  * Type guard to ensure the input is a {@link MergeTagEntry}.
3613
3621
  *
@@ -3621,7 +3629,7 @@ const wn = P("Personalization"), En = "Could not resolve Merge Tag value:", xe =
3621
3629
  * ```
3622
3630
  */
3623
3631
  isMergeTagEntry(t) {
3624
- return ko.safeParse(t).success;
3632
+ return Po.safeParse(t).success;
3625
3633
  },
3626
3634
  /**
3627
3635
  * Generate a list of candidate selectors for a merge-tag ID.
@@ -3659,7 +3667,7 @@ const wn = P("Personalization"), En = "Could not resolve Merge Tag value:", xe =
3659
3667
  * Only string/number/boolean primitives are returned; objects/arrays are ignored.
3660
3668
  */
3661
3669
  getValueFromProfile(t, e) {
3662
- const r = xe.normalizeSelectors(t).find((o) => Nt(e, o));
3670
+ const r = Ve.normalizeSelectors(t).find((o) => Nt(e, o));
3663
3671
  if (!r) return;
3664
3672
  const i = Nt(e, r);
3665
3673
  if (!(!i || typeof i != "string" && typeof i != "number" && typeof i != "boolean"))
@@ -3680,16 +3688,16 @@ const wn = P("Personalization"), En = "Could not resolve Merge Tag value:", xe =
3680
3688
  * ```
3681
3689
  */
3682
3690
  resolve(t, e) {
3683
- if (!xe.isMergeTagEntry(t)) {
3684
- wn.warn(`${En} supplied entry is not a Merge Tag entry`);
3691
+ if (!Ve.isMergeTagEntry(t)) {
3692
+ Sn.warn(`${zn} supplied entry is not a Merge Tag entry`);
3685
3693
  return;
3686
3694
  }
3687
3695
  const {
3688
3696
  fields: { nt_fallback: n }
3689
3697
  } = t;
3690
- return dt.safeParse(e).success ? xe.getValueFromProfile(t.fields.nt_mergetag_id, e) ?? n : (wn.warn(`${En} no valid profile`), n);
3698
+ return dt.safeParse(e).success ? Ve.getValueFromProfile(t.fields.nt_mergetag_id, e) ?? n : (Sn.warn(`${zn} no valid profile`), n);
3691
3699
  }
3692
- }, J = P("Personalization"), Te = "Could not resolve personalized entry variant:", ge = {
3700
+ }, Y = P("Personalization"), Ae = "Could not resolve personalized entry variant:", ve = {
3693
3701
  /**
3694
3702
  * Find the personalization entry corresponding to one of the selected experiences.
3695
3703
  *
@@ -3770,7 +3778,7 @@ const wn = P("Personalization"), En = "Could not resolve Merge Tag value:", xe =
3770
3778
  if (!r && (!ht(t) || !Ke(e)))
3771
3779
  return;
3772
3780
  const i = e.fields.nt_config?.components?.filter(
3773
- (o) => Po(o) && !o.baseline.hidden
3781
+ (o) => Ro(o) && !o.baseline.hidden
3774
3782
  ).find((o) => o.baseline.id === t.sys.id)?.variants;
3775
3783
  if (i?.length)
3776
3784
  return i.at(n - 1);
@@ -3799,12 +3807,12 @@ const wn = P("Personalization"), En = "Could not resolve Merge Tag value:", xe =
3799
3807
  personalizationEntry: t,
3800
3808
  selectedVariant: e
3801
3809
  }, n = !1) {
3802
- if (!n && (!Ke(t) || !Ao(e)))
3810
+ if (!n && (!Ke(t) || !Io(e)))
3803
3811
  return;
3804
3812
  const r = t.fields.nt_variants?.find(
3805
3813
  (i) => i.sys.id === e.id
3806
3814
  );
3807
- return So(r) ? r : void 0;
3815
+ return Ao(r) ? r : void 0;
3808
3816
  },
3809
3817
  /**
3810
3818
  * Resolve the selected entry (baseline or variant) for a personalized entry
@@ -3824,13 +3832,13 @@ const wn = P("Personalization"), En = "Could not resolve Merge Tag value:", xe =
3824
3832
  * ```
3825
3833
  */
3826
3834
  resolve(t, e) {
3827
- if (J.debug(`Resolving personalized entry for baseline entry ${t.sys.id}`), !e?.length)
3828
- return J.warn(
3829
- `${Te} no selectedPersonalizations exist for the current profile`
3835
+ if (Y.debug(`Resolving personalized entry for baseline entry ${t.sys.id}`), !e?.length)
3836
+ return Y.warn(
3837
+ `${Ae} no selectedPersonalizations exist for the current profile`
3830
3838
  ), { entry: t };
3831
3839
  if (!ht(t))
3832
- return J.warn(`${Te} entry ${t.sys.id} is not personalized`), { entry: t };
3833
- const n = ge.getPersonalizationEntry(
3840
+ return Y.warn(`${Ae} entry ${t.sys.id} is not personalized`), { entry: t };
3841
+ const n = ve.getPersonalizationEntry(
3834
3842
  {
3835
3843
  personalizedEntry: t,
3836
3844
  selectedPersonalizations: e
@@ -3838,10 +3846,10 @@ const wn = P("Personalization"), En = "Could not resolve Merge Tag value:", xe =
3838
3846
  !0
3839
3847
  );
3840
3848
  if (!n)
3841
- return J.warn(
3842
- `${Te} could not find a personalization entry for ${t.sys.id}`
3849
+ return Y.warn(
3850
+ `${Ae} could not find a personalization entry for ${t.sys.id}`
3843
3851
  ), { entry: t };
3844
- const r = ge.getSelectedPersonalization(
3852
+ const r = ve.getSelectedPersonalization(
3845
3853
  {
3846
3854
  personalizationEntry: n,
3847
3855
  selectedPersonalizations: e
@@ -3849,8 +3857,8 @@ const wn = P("Personalization"), En = "Could not resolve Merge Tag value:", xe =
3849
3857
  !0
3850
3858
  ), i = r?.variantIndex ?? 0;
3851
3859
  if (i === 0)
3852
- return J.debug(`Resolved personalization entry for entry ${t.sys.id} is baseline`), { entry: t };
3853
- const o = ge.getSelectedVariant(
3860
+ return Y.debug(`Resolved personalization entry for entry ${t.sys.id} is baseline`), { entry: t };
3861
+ const o = ve.getSelectedVariant(
3854
3862
  {
3855
3863
  personalizedEntry: t,
3856
3864
  personalizationEntry: n,
@@ -3859,10 +3867,10 @@ const wn = P("Personalization"), En = "Could not resolve Merge Tag value:", xe =
3859
3867
  !0
3860
3868
  );
3861
3869
  if (!o)
3862
- return J.warn(
3863
- `${Te} could not find a valid replacement variant entry for ${t.sys.id}`
3870
+ return Y.warn(
3871
+ `${Ae} could not find a valid replacement variant entry for ${t.sys.id}`
3864
3872
  ), { entry: t };
3865
- const s = ge.getSelectedVariantEntry(
3873
+ const s = ve.getSelectedVariantEntry(
3866
3874
  {
3867
3875
  personalizationEntry: n,
3868
3876
  selectedVariant: o
@@ -3870,42 +3878,47 @@ const wn = P("Personalization"), En = "Could not resolve Merge Tag value:", xe =
3870
3878
  !0
3871
3879
  );
3872
3880
  if (s)
3873
- J.debug(
3881
+ Y.debug(
3874
3882
  `Entry ${t.sys.id} has been resolved to variant entry ${s.sys.id}`
3875
3883
  );
3876
3884
  else
3877
- return J.warn(
3878
- `${Te} could not find a valid replacement variant entry for ${t.sys.id}`
3885
+ return Y.warn(
3886
+ `${Ae} could not find a valid replacement variant entry for ${t.sys.id}`
3879
3887
  ), { entry: t };
3880
3888
  return { entry: s, personalization: r };
3881
3889
  }
3882
- }, Q = me(), Z = me(), W = me(), nn = Lr(() => Ot.resolve(Q.value ?? [])), Ne = me(!0), D = me(), k = me();
3890
+ }, G = _e(), D = _e(), W = _e(), on = jn(() => Ot.resolve(G.value ?? [])), Le = _e(!0), Z = _e(), k = _e();
3883
3891
  function U(t) {
3884
3892
  return {
3885
3893
  subscribe(e) {
3886
- return { unsubscribe: N(() => {
3894
+ return { unsubscribe: x(() => {
3887
3895
  e(t.value);
3888
3896
  }) };
3889
3897
  }
3890
3898
  };
3891
3899
  }
3892
- const Ce = {
3893
- changes: Q,
3894
- consent: Z,
3900
+ const Oe = {
3901
+ changes: G,
3902
+ consent: D,
3895
3903
  event: W,
3896
- flags: nn,
3897
- online: Ne,
3898
- personalizations: D,
3904
+ flags: on,
3905
+ online: Le,
3906
+ personalizations: Z,
3899
3907
  profile: k
3900
- }, We = (t) => typeof t == "function", Ta = (t) => typeof t == "string" ? t : typeof t == "symbol" ? t.description ?? String(t) : String(t), ka = (t) => typeof t == "string" || typeof t == "symbol", Aa = (t) => Object.prototype.toString.call(t) === "[object AsyncFunction]";
3908
+ }, $a = {
3909
+ batch: ye,
3910
+ computed: jn,
3911
+ effect: x,
3912
+ untracked: Dt
3913
+ }, We = (t) => typeof t == "function", Pa = (t) => typeof t == "string" ? t : typeof t == "symbol" ? t.description ?? String(t) : String(t), Ia = (t) => typeof t == "string" || typeof t == "symbol", Ca = (t) => Object.prototype.toString.call(t) === "[object AsyncFunction]";
3901
3914
  function F(t, e) {
3902
3915
  return function(n, r) {
3903
- const i = Ta(r.name);
3916
+ const i = Pa(r.name);
3904
3917
  r.addInitializer(function() {
3905
3918
  const s = Reflect.get(this, r.name);
3906
3919
  if (!We(s))
3907
3920
  return;
3908
- const a = s, c = Aa(a), u = (b) => {
3921
+ const a = s, c = Ca(a), u = (b) => {
3909
3922
  const { [t]: L } = b;
3910
3923
  if (!We(L))
3911
3924
  throw new TypeError(
@@ -3922,7 +3935,7 @@ function F(t, e) {
3922
3935
  I.call(b, i, L);
3923
3936
  return;
3924
3937
  }
3925
- if (ka(I)) {
3938
+ if (Ia(I)) {
3926
3939
  const { [I]: O } = b;
3927
3940
  We(O) && O.call(b, i, L);
3928
3941
  }
@@ -3934,7 +3947,7 @@ function F(t, e) {
3934
3947
  });
3935
3948
  };
3936
3949
  }
3937
- class $a {
3950
+ class Ra {
3938
3951
  /**
3939
3952
  * Internal map of scope -> set of values present in that scope.
3940
3953
  *
@@ -4043,8 +4056,8 @@ class $a {
4043
4056
  e !== void 0 ? this.#e.get(e)?.clear() : this.#e.clear();
4044
4057
  }
4045
4058
  }
4046
- const Pa = ["page", "identify"];
4047
- class pr {
4059
+ const Oa = ["page", "identify"];
4060
+ class yr {
4048
4061
  /**
4049
4062
  * Allow‑list of event {@link AnalyticsEventType | type keys} permitted when consent is not present.
4050
4063
  */
@@ -4067,23 +4080,23 @@ class pr {
4067
4080
  */
4068
4081
  constructor(e) {
4069
4082
  const { api: n, builder: r, config: i, interceptors: o } = e;
4070
- this.allowedEventTypes = i?.allowedEventTypes ?? Pa, this.api = n, this.builder = r, this.duplicationDetector = new $a(i?.preventedComponentEvents), this.interceptors = o;
4083
+ this.allowedEventTypes = i?.allowedEventTypes ?? Oa, this.api = n, this.builder = r, this.duplicationDetector = new Ra(i?.preventedComponentEvents), this.interceptors = o;
4071
4084
  }
4072
4085
  }
4073
- class hr extends pr {
4086
+ class mr extends yr {
4074
4087
  }
4075
- var Ia = Object.create, gr = Object.defineProperty, Ca = Object.getOwnPropertyDescriptor, vr = (t, e) => (e = Symbol[t]) ? e : Symbol.for("Symbol." + t), yr = (t) => {
4088
+ var Ma = Object.create, br = Object.defineProperty, xa = Object.getOwnPropertyDescriptor, _r = (t, e) => (e = Symbol[t]) ? e : Symbol.for("Symbol." + t), wr = (t) => {
4076
4089
  throw TypeError(t);
4077
- }, mr = (t, e, n) => e in t ? gr(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, Ra = (t) => [, , , Ia(t?.[vr("metadata")] ?? null)], br = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], _r = (t) => t !== void 0 && typeof t != "function" ? yr("Function expected") : t, Oa = (t, e, n, r, i) => ({ kind: br[t], name: e, metadata: r, addInitializer: (o) => n._ ? yr("Already initialized") : i.push(_r(o || null)) }), Ma = (t, e) => mr(e, vr("metadata"), t[3]), xa = (t, e, n, r) => {
4090
+ }, Er = (t, e, n) => e in t ? br(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, Va = (t) => [, , , Ma(t?.[_r("metadata")] ?? null)], Sr = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], zr = (t) => t !== void 0 && typeof t != "function" ? wr("Function expected") : t, Na = (t, e, n, r, i) => ({ kind: Sr[t], name: e, metadata: r, addInitializer: (o) => n._ ? wr("Already initialized") : i.push(zr(o || null)) }), La = (t, e) => Er(e, _r("metadata"), t[3]), ja = (t, e, n, r) => {
4078
4091
  for (var i = 0, o = t[e >> 1], s = o && o.length; i < s; i++) o[i].call(n);
4079
4092
  return r;
4080
- }, wr = (t, e, n, r, i, o) => {
4081
- for (var s, a, c, u, d = e & 7, m = !1, _ = !1, S = 2, b = br[d + 5], L = t[S] || (t[S] = []), I = (i = i.prototype, Ca(i, n)), O = r.length - 1; O >= 0; O--)
4082
- c = Oa(d, n, a = {}, t[3], L), c.static = m, c.private = _, u = c.access = { has: (te) => n in te }, u.get = (te) => te[n], s = (0, r[O])(I[b], c), a._ = 1, _r(s) && (I[b] = s);
4083
- return I && gr(i, n, I), i;
4084
- }, Sn = (t, e, n) => mr(t, typeof e != "symbol" ? e + "" : e, n), Er, Sr, Lt, De;
4085
- const H = P("Analytics"), Va = 25;
4086
- class ft extends (Lt = hr, Sr = [F("isNotDuplicated", { onBlocked: "onBlockedByDuplication" }), F("hasConsent", { onBlocked: "onBlockedByConsent" })], Er = [F("isNotDuplicated", { onBlocked: "onBlockedByDuplication" }), F("hasConsent", { onBlocked: "onBlockedByConsent" })], Lt) {
4093
+ }, Tr = (t, e, n, r, i, o) => {
4094
+ for (var s, a, c, u, d = e & 7, m = !1, _ = !1, S = 2, b = Sr[d + 5], L = t[S] || (t[S] = []), I = (i = i.prototype, xa(i, n)), O = r.length - 1; O >= 0; O--)
4095
+ c = Na(d, n, a = {}, t[3], L), c.static = m, c.private = _, u = c.access = { has: (te) => n in te }, u.get = (te) => te[n], s = (0, r[O])(I[b], c), a._ = 1, zr(s) && (I[b] = s);
4096
+ return I && br(i, n, I), i;
4097
+ }, Tn = (t, e, n) => Er(t, typeof e != "symbol" ? e + "" : e, n), kr, Ar, Lt, Ze;
4098
+ const H = P("Analytics"), Ba = 25;
4099
+ class ft extends (Lt = mr, Ar = [F("isNotDuplicated", { onBlocked: "onBlockedByDuplication" }), F("hasConsent", { onBlocked: "onBlockedByConsent" })], kr = [F("isNotDuplicated", { onBlocked: "onBlockedByDuplication" }), F("hasConsent", { onBlocked: "onBlockedByConsent" })], Lt) {
4087
4100
  /**
4088
4101
  * Create a new stateful analytics instance.
4089
4102
  *
@@ -4091,7 +4104,7 @@ class ft extends (Lt = hr, Sr = [F("isNotDuplicated", { onBlocked: "onBlockedByD
4091
4104
  */
4092
4105
  constructor(e) {
4093
4106
  const { api: n, builder: r, config: i, interceptors: o } = e;
4094
- super({ api: n, builder: r, config: i, interceptors: o }), xa(De, 5, this), Sn(this, "queue", /* @__PURE__ */ new Map()), Sn(this, "states", {
4107
+ super({ api: n, builder: r, config: i, interceptors: o }), ja(Ze, 5, this), Tn(this, "queue", /* @__PURE__ */ new Map()), Tn(this, "states", {
4095
4108
  eventStream: U(W),
4096
4109
  profile: U(k)
4097
4110
  });
@@ -4100,20 +4113,20 @@ class ft extends (Lt = hr, Sr = [F("isNotDuplicated", { onBlocked: "onBlockedByD
4100
4113
  const { profile: a } = s;
4101
4114
  k.value = a;
4102
4115
  }
4103
- N(() => {
4116
+ x(() => {
4104
4117
  const a = k.value?.id;
4105
4118
  H.info(
4106
- `Analytics ${Z.value ? "will" : "will not"} be collected due to consent (${Z.value})`
4119
+ `Analytics ${D.value ? "will" : "will not"} be collected due to consent (${D.value})`
4107
4120
  ), H.debug(`Profile ${a && `with ID ${a}`} has been ${a ? "set" : "cleared"}`);
4108
- }), N(() => {
4109
- Ne.value && this.flush();
4121
+ }), x(() => {
4122
+ Le.value && this.flush();
4110
4123
  });
4111
4124
  }
4112
4125
  /**
4113
4126
  * Reset analytics‑related signals and the last emitted event.
4114
4127
  */
4115
4128
  reset() {
4116
- Re(() => {
4129
+ ye(() => {
4117
4130
  W.value = void 0, k.value = void 0;
4118
4131
  });
4119
4132
  }
@@ -4126,7 +4139,7 @@ class ft extends (Lt = hr, Sr = [F("isNotDuplicated", { onBlocked: "onBlockedByD
4126
4139
  * @returns `true` if the operation is permitted; otherwise `false`.
4127
4140
  */
4128
4141
  hasConsent(e) {
4129
- return !!Z.value || (this.allowedEventTypes ?? []).includes(
4142
+ return !!D.value || (this.allowedEventTypes ?? []).includes(
4130
4143
  e === "trackComponentView" || e === "trackFlagView" ? "component" : e
4131
4144
  );
4132
4145
  }
@@ -4183,7 +4196,7 @@ class ft extends (Lt = hr, Sr = [F("isNotDuplicated", { onBlocked: "onBlockedByD
4183
4196
  H.warn("Attempting to emit an event without an Optimization profile");
4184
4197
  return;
4185
4198
  }
4186
- const r = await this.interceptors.event.run(e), i = ur.parse(r);
4199
+ const r = await this.interceptors.event.run(e), i = pr.parse(r);
4187
4200
  H.debug(`Queueing ${i.type} event for profile ${n.id}`, i);
4188
4201
  const o = this.queue.get(n);
4189
4202
  W.value = i, o ? o.push(i) : this.queue.set(n, [i]), await this.flushMaxEvents();
@@ -4193,7 +4206,7 @@ class ft extends (Lt = hr, Sr = [F("isNotDuplicated", { onBlocked: "onBlockedByD
4193
4206
  * reaches {@link MAX_QUEUED_EVENTS}.
4194
4207
  */
4195
4208
  async flushMaxEvents() {
4196
- this.queue.values().toArray().flat().length >= Va && await this.flush();
4209
+ this.queue.values().toArray().flat().length >= Ba && await this.flush();
4197
4210
  }
4198
4211
  /**
4199
4212
  * Send all queued events grouped by profile and clear the queue.
@@ -4207,12 +4220,12 @@ class ft extends (Lt = hr, Sr = [F("isNotDuplicated", { onBlocked: "onBlockedByD
4207
4220
  await this.api.insights.sendBatchEvents(e) && this.queue.clear();
4208
4221
  }
4209
4222
  }
4210
- De = Ra(Lt);
4211
- wr(De, 1, "trackComponentView", Sr, ft);
4212
- wr(De, 1, "trackFlagView", Er, ft);
4213
- Ma(De, ft);
4214
- const zn = P("Analytics");
4215
- class Na extends hr {
4223
+ Ze = Va(Lt);
4224
+ Tr(Ze, 1, "trackComponentView", Ar, ft);
4225
+ Tr(Ze, 1, "trackFlagView", kr, ft);
4226
+ La(Ze, ft);
4227
+ const kn = P("Analytics");
4228
+ class Ua extends mr {
4216
4229
  /**
4217
4230
  * Build, intercept, validate, and send a component view event.
4218
4231
  *
@@ -4221,8 +4234,8 @@ class Na extends hr {
4221
4234
  * @returns A promise that resolves once the batch has been sent.
4222
4235
  */
4223
4236
  async trackComponentView(e) {
4224
- zn.info('Processing "component view" event');
4225
- const { profile: n, ...r } = e, i = this.builder.buildComponentView(r), o = await this.interceptors.event.run(i), s = ye.parse(o);
4237
+ kn.info('Processing "component view" event');
4238
+ const { profile: n, ...r } = e, i = this.builder.buildComponentView(r), o = await this.interceptors.event.run(i), s = be.parse(o);
4226
4239
  await this.sendBatchEvent(s, n);
4227
4240
  }
4228
4241
  /**
@@ -4233,8 +4246,8 @@ class Na extends hr {
4233
4246
  * @returns A promise that resolves once the batch has been sent.
4234
4247
  */
4235
4248
  async trackFlagView(e) {
4236
- zn.debug('Processing "flag view" event');
4237
- const { profile: n, ...r } = e, i = this.builder.buildFlagView(r), o = await this.interceptors.event.run(i), s = ye.parse(o);
4249
+ kn.debug('Processing "flag view" event');
4250
+ const { profile: n, ...r } = e, i = this.builder.buildFlagView(r), o = await this.interceptors.event.run(i), s = be.parse(o);
4238
4251
  await this.sendBatchEvent(s, n);
4239
4252
  }
4240
4253
  /**
@@ -4246,7 +4259,7 @@ class Na extends hr {
4246
4259
  * @internal
4247
4260
  */
4248
4261
  async sendBatchEvent(e, n) {
4249
- const r = lr.parse([
4262
+ const r = hr.parse([
4250
4263
  {
4251
4264
  profile: n,
4252
4265
  events: [e]
@@ -4255,8 +4268,8 @@ class Na extends hr {
4255
4268
  await this.api.insights.sendBatchEvents(r);
4256
4269
  }
4257
4270
  }
4258
- const La = "0.1.0-alpha", Ge = "ctfl-opt-aid";
4259
- class Tn {
4271
+ const Da = "0.1.0-alpha4", Ye = "ctfl-opt-aid", St = "__ctfl_opt_anonymous_id__", zt = "__ctfl_opt_consent__", Tt = "__ctfl_opt_changes__", kt = "__ctfl_opt_debug__", At = "__ctfl_opt_profile__", $t = "__ctfl_opt_personalizations__", An = "ntaid", $n = "__nt_anonymous_id__";
4272
+ class Pn {
4260
4273
  /**
4261
4274
  * The registry of interceptors keyed by their insertion id.
4262
4275
  *
@@ -4355,7 +4368,7 @@ class Tn {
4355
4368
  return r;
4356
4369
  }
4357
4370
  }
4358
- class zr {
4371
+ class $r {
4359
4372
  /** Shared Optimization API client instance. */
4360
4373
  api;
4361
4374
  /** Shared event builder instance. */
@@ -4363,8 +4376,8 @@ class zr {
4363
4376
  /** Resolved core configuration (minus any name metadata). */
4364
4377
  config;
4365
4378
  interceptors = {
4366
- event: new Tn(),
4367
- state: new Tn()
4379
+ event: new Pn(),
4380
+ state: new Pn()
4368
4381
  };
4369
4382
  /**
4370
4383
  * Create the core with API client and logging preconfigured.
@@ -4378,17 +4391,17 @@ class zr {
4378
4391
  constructor(e) {
4379
4392
  this.config = e;
4380
4393
  const { analytics: n, personalization: r, eventBuilder: i, logLevel: o, environment: s, clientId: a } = e;
4381
- oe.addSink(new ps(o));
4394
+ oe.addSink(new vs(o));
4382
4395
  const c = {
4383
4396
  ...n,
4384
4397
  ...r,
4385
4398
  clientId: a,
4386
4399
  environment: s
4387
4400
  };
4388
- this.api = new Us(c), this.eventBuilder = new _a(
4401
+ this.api = new Fs(c), this.eventBuilder = new Sa(
4389
4402
  i ?? {
4390
4403
  channel: "server",
4391
- library: { name: "Optimization Core", version: La }
4404
+ library: { name: "Optimization Core", version: Da }
4392
4405
  }
4393
4406
  );
4394
4407
  }
@@ -4495,7 +4508,7 @@ class zr {
4495
4508
  await this.analytics.trackFlagView(e, n);
4496
4509
  }
4497
4510
  }
4498
- class Tr extends pr {
4511
+ class Pr extends yr {
4499
4512
  /**
4500
4513
  * Static {@link FlagsResolver | resolver} for evaluating personalized
4501
4514
  * custom flags.
@@ -4505,7 +4518,7 @@ class Tr extends pr {
4505
4518
  * Static {@link MergeTagValueResolver | resolver} that returns values
4506
4519
  * sourced from a user profile based on a Contentful Merge Tag entry.
4507
4520
  */
4508
- mergeTagValueResolver = xe;
4521
+ mergeTagValueResolver = Ve;
4509
4522
  /**
4510
4523
  * Static {@link PersonalizedEntryResolver | resolver } for personalized
4511
4524
  * Contentful entries (e.g., entry variants targeted to a profile audience).
@@ -4514,7 +4527,7 @@ class Tr extends pr {
4514
4527
  * Used by higher-level personalization flows to materialize entry content
4515
4528
  * prior to event emission.
4516
4529
  */
4517
- personalizedEntryResolver = ge;
4530
+ personalizedEntryResolver = ve;
4518
4531
  /**
4519
4532
  * Get the specified Custom Flag's value from the supplied changes.
4520
4533
  * @param name - The name/key of the Custom Flag.
@@ -4542,7 +4555,7 @@ class Tr extends pr {
4542
4555
  * personalization event.
4543
4556
  */
4544
4557
  personalizeEntry(e, n) {
4545
- return ge.resolve(e, n);
4558
+ return ve.resolve(e, n);
4546
4559
  }
4547
4560
  /**
4548
4561
  * Resolve a merge tag to a value based on the current (or provided) profile.
@@ -4555,21 +4568,21 @@ class Tr extends pr {
4555
4568
  * profile can be sourced from the data returned when emitting any personalization event.
4556
4569
  */
4557
4570
  getMergeTagValue(e, n) {
4558
- return xe.resolve(e, n);
4571
+ return Ve.resolve(e, n);
4559
4572
  }
4560
4573
  }
4561
- var ja = Object.create, kr = Object.defineProperty, Ba = Object.getOwnPropertyDescriptor, Ar = (t, e) => (e = Symbol[t]) ? e : Symbol.for("Symbol." + t), $r = (t) => {
4574
+ var Za = Object.create, Ir = Object.defineProperty, Fa = Object.getOwnPropertyDescriptor, Cr = (t, e) => (e = Symbol[t]) ? e : Symbol.for("Symbol." + t), Rr = (t) => {
4562
4575
  throw TypeError(t);
4563
- }, Pr = (t, e, n) => e in t ? kr(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, Ua = (t) => [, , , ja(t?.[Ar("metadata")] ?? null)], Ir = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], Cr = (t) => t !== void 0 && typeof t != "function" ? $r("Function expected") : t, Za = (t, e, n, r, i) => ({ kind: Ir[t], name: e, metadata: r, addInitializer: (o) => n._ ? $r("Already initialized") : i.push(Cr(o || null)) }), Da = (t, e) => Pr(e, Ar("metadata"), t[3]), Fa = (t, e, n, r) => {
4576
+ }, Or = (t, e, n) => e in t ? Ir(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, qa = (t) => [, , , Za(t?.[Cr("metadata")] ?? null)], Mr = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], xr = (t) => t !== void 0 && typeof t != "function" ? Rr("Function expected") : t, Ha = (t, e, n, r, i) => ({ kind: Mr[t], name: e, metadata: r, addInitializer: (o) => n._ ? Rr("Already initialized") : i.push(xr(o || null)) }), Ka = (t, e) => Or(e, Cr("metadata"), t[3]), Wa = (t, e, n, r) => {
4564
4577
  for (var i = 0, o = t[e >> 1], s = o && o.length; i < s; i++) o[i].call(n);
4565
4578
  return r;
4566
4579
  }, Fe = (t, e, n, r, i, o) => {
4567
- for (var s, a, c, u, d = e & 7, m = !1, _ = !1, S = 2, b = Ir[d + 5], L = t[S] || (t[S] = []), I = (i = i.prototype, Ba(i, n)), O = r.length - 1; O >= 0; O--)
4568
- c = Za(d, n, a = {}, t[3], L), c.static = m, c.private = _, u = c.access = { has: (te) => n in te }, u.get = (te) => te[n], s = (0, r[O])(I[b], c), a._ = 1, Cr(s) && (I[b] = s);
4569
- return I && kr(i, n, I), i;
4570
- }, St = (t, e, n) => Pr(t, typeof e != "symbol" ? e + "" : e, n), Rr, Or, Mr, xr, Vr, jt, ee;
4580
+ for (var s, a, c, u, d = e & 7, m = !1, _ = !1, S = 2, b = Mr[d + 5], L = t[S] || (t[S] = []), I = (i = i.prototype, Fa(i, n)), O = r.length - 1; O >= 0; O--)
4581
+ c = Ha(d, n, a = {}, t[3], L), c.static = m, c.private = _, u = c.access = { has: (te) => n in te }, u.get = (te) => te[n], s = (0, r[O])(I[b], c), a._ = 1, xr(s) && (I[b] = s);
4582
+ return I && Ir(i, n, I), i;
4583
+ }, Pt = (t, e, n) => Or(t, typeof e != "symbol" ? e + "" : e, n), Vr, Nr, Lr, jr, Br, jt, ee;
4571
4584
  const M = P("Personalization");
4572
- class le extends (jt = Tr, Vr = [F("hasConsent", { onBlocked: "onBlockedByConsent" })], xr = [F("hasConsent", { onBlocked: "onBlockedByConsent" })], Mr = [F("hasConsent", { onBlocked: "onBlockedByConsent" })], Or = [F("hasConsent", { onBlocked: "onBlockedByConsent" })], Rr = [F("isNotDuplicated", { onBlocked: "onBlockedByDuplication" }), F("hasConsent", { onBlocked: "onBlockedByConsent" })], jt) {
4585
+ class le extends (jt = Pr, Br = [F("hasConsent", { onBlocked: "onBlockedByConsent" })], jr = [F("hasConsent", { onBlocked: "onBlockedByConsent" })], Lr = [F("hasConsent", { onBlocked: "onBlockedByConsent" })], Nr = [F("hasConsent", { onBlocked: "onBlockedByConsent" })], Vr = [F("isNotDuplicated", { onBlocked: "onBlockedByDuplication" }), F("hasConsent", { onBlocked: "onBlockedByConsent" })], jt) {
4573
4586
  /**
4574
4587
  * Create a new stateful personalization instance.
4575
4588
  *
@@ -4577,12 +4590,12 @@ class le extends (jt = Tr, Vr = [F("hasConsent", { onBlocked: "onBlockedByConsen
4577
4590
  */
4578
4591
  constructor(e) {
4579
4592
  const { api: n, builder: r, config: i, interceptors: o } = e;
4580
- super({ api: n, builder: r, config: i, interceptors: o }), Fa(ee, 5, this), St(this, "offlineQueue", /* @__PURE__ */ new Set()), St(this, "states", {
4593
+ super({ api: n, builder: r, config: i, interceptors: o }), Wa(ee, 5, this), Pt(this, "offlineQueue", /* @__PURE__ */ new Set()), Pt(this, "states", {
4581
4594
  eventStream: U(W),
4582
- flags: U(nn),
4595
+ flags: U(on),
4583
4596
  profile: U(k),
4584
- personalizations: U(D)
4585
- }), St(this, "getAnonymousId");
4597
+ personalizations: U(Z)
4598
+ }), Pt(this, "getAnonymousId");
4586
4599
  const { defaults: s, getAnonymousId: a } = i ?? {};
4587
4600
  if (s) {
4588
4601
  const {
@@ -4590,29 +4603,29 @@ class le extends (jt = Tr, Vr = [F("hasConsent", { onBlocked: "onBlockedByConsen
4590
4603
  personalizations: u,
4591
4604
  profile: d
4592
4605
  } = s;
4593
- Re(() => {
4594
- Q.value = c, D.value = u, k.value = d;
4606
+ ye(() => {
4607
+ G.value = c, Z.value = u, k.value = d;
4595
4608
  });
4596
4609
  }
4597
4610
  if (s?.consent !== void 0) {
4598
4611
  const { consent: c } = s;
4599
- Z.value = c;
4612
+ D.value = c;
4600
4613
  }
4601
4614
  this.getAnonymousId = a ?? (() => {
4602
- }), N(() => {
4615
+ }), x(() => {
4603
4616
  M.debug(
4604
4617
  `Profile ${k.value && `with ID ${k.value.id}`} has been ${k.value ? "set" : "cleared"}`
4605
4618
  );
4606
- }), N(() => {
4619
+ }), x(() => {
4607
4620
  M.debug(
4608
- `Variants have been ${D.value?.length ? "populated" : "cleared"}`
4621
+ `Variants have been ${Z.value?.length ? "populated" : "cleared"}`
4609
4622
  );
4610
- }), N(() => {
4623
+ }), x(() => {
4611
4624
  M.info(
4612
- `Personalization ${Z.value ? "will" : "will not"} take effect due to consent (${Z.value})`
4625
+ `Personalization ${D.value ? "will" : "will not"} take effect due to consent (${D.value})`
4613
4626
  );
4614
- }), N(() => {
4615
- Ne.value && this.flush();
4627
+ }), x(() => {
4628
+ Le.value && this.flush();
4616
4629
  });
4617
4630
  }
4618
4631
  /**
@@ -4622,8 +4635,8 @@ class le extends (jt = Tr, Vr = [F("hasConsent", { onBlocked: "onBlockedByConsen
4622
4635
  * Clears `changes`, `profile`, and selected `personalizations`.
4623
4636
  */
4624
4637
  reset() {
4625
- Re(() => {
4626
- Q.value = void 0, W.value = void 0, k.value = void 0, D.value = void 0;
4638
+ ye(() => {
4639
+ G.value = void 0, W.value = void 0, k.value = void 0, Z.value = void 0;
4627
4640
  });
4628
4641
  }
4629
4642
  /**
@@ -4631,7 +4644,7 @@ class le extends (jt = Tr, Vr = [F("hasConsent", { onBlocked: "onBlockedByConsen
4631
4644
  * @param name - The name or key of the Custom Flag.
4632
4645
  * @returns The current value of the Custom Flag if found.
4633
4646
  * */
4634
- getCustomFlag(e, n = Q.value) {
4647
+ getCustomFlag(e, n = G.value) {
4635
4648
  return super.getCustomFlag(e, n);
4636
4649
  }
4637
4650
  /**
@@ -4645,7 +4658,7 @@ class le extends (jt = Tr, Vr = [F("hasConsent", { onBlocked: "onBlockedByConsen
4645
4658
  * @param personalizations - Optional selections; defaults to the current signal value.
4646
4659
  * @returns The resolved entry data.
4647
4660
  */
4648
- personalizeEntry(e, n = D.value) {
4661
+ personalizeEntry(e, n = Z.value) {
4649
4662
  return super.personalizeEntry(e, n);
4650
4663
  }
4651
4664
  /**
@@ -4669,7 +4682,7 @@ class le extends (jt = Tr, Vr = [F("hasConsent", { onBlocked: "onBlockedByConsen
4669
4682
  * @returns `true` if the operation is permitted; otherwise `false`.
4670
4683
  */
4671
4684
  hasConsent(e) {
4672
- return !!Z.value || (this.allowedEventTypes ?? []).includes(
4685
+ return !!D.value || (this.allowedEventTypes ?? []).includes(
4673
4686
  e === "trackComponentView" || e === "trackFlagView" ? "component" : e
4674
4687
  );
4675
4688
  }
@@ -4746,8 +4759,8 @@ class le extends (jt = Tr, Vr = [F("hasConsent", { onBlocked: "onBlockedByConsen
4746
4759
  * @param event - The event to enqueue.
4747
4760
  */
4748
4761
  async sendOrEnqueueEvent(e) {
4749
- const n = await this.interceptors.event.run(e), r = ar.parse(n);
4750
- if (W.value = r, Ne.value) return await this.upsertProfile([r]);
4762
+ const n = await this.interceptors.event.run(e), r = dr.parse(n);
4763
+ if (W.value = r, Le.value) return await this.upsertProfile([r]);
4751
4764
  M.debug(`Queueing ${r.type} event`, r), this.offlineQueue.add(r);
4752
4765
  }
4753
4766
  /**
@@ -4785,20 +4798,20 @@ class le extends (jt = Tr, Vr = [F("hasConsent", { onBlocked: "onBlockedByConsen
4785
4798
  */
4786
4799
  async updateOutputSignals(e) {
4787
4800
  const n = await this.interceptors.state.run(e), { changes: r, personalizations: i, profile: o } = n;
4788
- Re(() => {
4789
- Et(Q.value, r) || (Q.value = r), Et(k.value, o) || (k.value = o), Et(D.value, i) || (D.value = i);
4801
+ ye(() => {
4802
+ Et(G.value, r) || (G.value = r), Et(k.value, o) || (k.value = o), Et(Z.value, i) || (Z.value = i);
4790
4803
  });
4791
4804
  }
4792
4805
  }
4793
- ee = Ua(jt);
4794
- Fe(ee, 1, "identify", Vr, le);
4795
- Fe(ee, 1, "page", xr, le);
4796
- Fe(ee, 1, "screen", Mr, le);
4797
- Fe(ee, 1, "track", Or, le);
4798
- Fe(ee, 1, "trackComponentView", Rr, le);
4799
- Da(ee, le);
4800
- const ke = P("Personalization");
4801
- class qa extends Tr {
4806
+ ee = qa(jt);
4807
+ Fe(ee, 1, "identify", Br, le);
4808
+ Fe(ee, 1, "page", jr, le);
4809
+ Fe(ee, 1, "screen", Lr, le);
4810
+ Fe(ee, 1, "track", Nr, le);
4811
+ Fe(ee, 1, "trackComponentView", Vr, le);
4812
+ Ka(ee, le);
4813
+ const $e = P("Personalization");
4814
+ class Ya extends Pr {
4802
4815
  /**
4803
4816
  * Identify the current profile/visitor to associate traits with a profile.
4804
4817
  *
@@ -4807,8 +4820,8 @@ class qa extends Tr {
4807
4820
  * @returns The resulting {@link OptimizationData} for the identified user.
4808
4821
  */
4809
4822
  async identify(e) {
4810
- ke.info('Sending "identify" event');
4811
- const { profile: n, ...r } = e, i = Xt.parse(this.builder.buildIdentify(r));
4823
+ $e.info('Sending "identify" event');
4824
+ const { profile: n, ...r } = e, i = en.parse(this.builder.buildIdentify(r));
4812
4825
  return await this.upsertProfile(i, n);
4813
4826
  }
4814
4827
  /**
@@ -4818,8 +4831,8 @@ class qa extends Tr {
4818
4831
  * @returns The evaluated {@link OptimizationData} for this page view.
4819
4832
  */
4820
4833
  async page(e) {
4821
- ke.info('Sending "page" event');
4822
- const { profile: n, ...r } = e, i = Yt.parse(this.builder.buildPageView(r));
4834
+ $e.info('Sending "page" event');
4835
+ const { profile: n, ...r } = e, i = tn.parse(this.builder.buildPageView(r));
4823
4836
  return await this.upsertProfile(i, n);
4824
4837
  }
4825
4838
  /**
@@ -4829,8 +4842,8 @@ class qa extends Tr {
4829
4842
  * @returns The evaluated {@link OptimizationData} for this screen view.
4830
4843
  */
4831
4844
  async screen(e) {
4832
- ke.info(`Sending "screen" event for "${e.name}"`);
4833
- const { profile: n, ...r } = e, i = en.parse(this.builder.buildScreenView(r));
4845
+ $e.info(`Sending "screen" event for "${e.name}"`);
4846
+ const { profile: n, ...r } = e, i = nn.parse(this.builder.buildScreenView(r));
4834
4847
  return await this.upsertProfile(i, n);
4835
4848
  }
4836
4849
  /**
@@ -4840,8 +4853,8 @@ class qa extends Tr {
4840
4853
  * @returns The evaluated {@link OptimizationData} for this event.
4841
4854
  */
4842
4855
  async track(e) {
4843
- ke.info(`Sending "track" event "${e.event}"`);
4844
- const { profile: n, ...r } = e, i = tn.parse(this.builder.buildTrack(r));
4856
+ $e.info(`Sending "track" event "${e.event}"`);
4857
+ const { profile: n, ...r } = e, i = rn.parse(this.builder.buildTrack(r));
4845
4858
  return await this.upsertProfile(i, n);
4846
4859
  }
4847
4860
  /**
@@ -4851,8 +4864,8 @@ class qa extends Tr {
4851
4864
  * @returns The evaluated {@link OptimizationData} for this component view.
4852
4865
  */
4853
4866
  async trackComponentView(e) {
4854
- ke.info('Sending "track personalization" event');
4855
- const { profile: n, ...r } = e, i = ye.parse(this.builder.buildComponentView(r));
4867
+ $e.info('Sending "track personalization" event');
4868
+ const { profile: n, ...r } = e, i = be.parse(this.builder.buildComponentView(r));
4856
4869
  return await this.upsertProfile(i, n);
4857
4870
  }
4858
4871
  /**
@@ -4873,7 +4886,7 @@ class qa extends Tr {
4873
4886
  });
4874
4887
  }
4875
4888
  }
4876
- class Ha extends zr {
4889
+ class Ga extends $r {
4877
4890
  /** Stateful analytics product. */
4878
4891
  analytics;
4879
4892
  /** Stateful personalization product. */
@@ -4897,7 +4910,7 @@ class Ha extends zr {
4897
4910
  const { allowedEventTypes: n, defaults: r, getAnonymousId: i, preventedComponentEvents: o } = e;
4898
4911
  if (r?.consent !== void 0) {
4899
4912
  const { consent: s } = r;
4900
- Z.value = s;
4913
+ D.value = s;
4901
4914
  }
4902
4915
  this.analytics = new ft({
4903
4916
  api: this.api,
@@ -4933,10 +4946,10 @@ class Ha extends zr {
4933
4946
  */
4934
4947
  get states() {
4935
4948
  return {
4936
- consent: U(Z),
4949
+ consent: U(D),
4937
4950
  eventStream: U(W),
4938
- flags: U(nn),
4939
- personalizations: U(D),
4951
+ flags: U(on),
4952
+ personalizations: U(Z),
4940
4953
  profile: U(k)
4941
4954
  };
4942
4955
  }
@@ -4948,8 +4961,8 @@ class Ha extends zr {
4948
4961
  * consequence of the current shared-state design.
4949
4962
  */
4950
4963
  reset() {
4951
- Re(() => {
4952
- W.value = void 0, Q.value = void 0, k.value = void 0, D.value = void 0;
4964
+ ye(() => {
4965
+ W.value = void 0, G.value = void 0, k.value = void 0, Z.value = void 0;
4953
4966
  });
4954
4967
  }
4955
4968
  /**
@@ -4967,7 +4980,7 @@ class Ha extends zr {
4967
4980
  * @param accept - `true` if the user has granted consent; `false` otherwise.
4968
4981
  */
4969
4982
  consent(e) {
4970
- Z.value = e;
4983
+ D.value = e;
4971
4984
  }
4972
4985
  /**
4973
4986
  * Update online state
@@ -4975,7 +4988,7 @@ class Ha extends zr {
4975
4988
  * @param isOnline - `true` if the browser is online; `false` otherwise.
4976
4989
  */
4977
4990
  online(e) {
4978
- Ne.value = e;
4991
+ Le.value = e;
4979
4992
  }
4980
4993
  /**
4981
4994
  * Register a preview panel compatible object to receive direct signal access.
@@ -4987,10 +5000,10 @@ class Ha extends zr {
4987
5000
  * Direct signal access allows immediate state updates without API calls.
4988
5001
  */
4989
5002
  registerPreviewPanel(e) {
4990
- e.signals = Ce;
5003
+ e.signals = Oe, e.signalFns = $a;
4991
5004
  }
4992
5005
  }
4993
- class wc extends zr {
5006
+ class kc extends $r {
4994
5007
  /** Stateless analytics product. */
4995
5008
  analytics;
4996
5009
  /** Stateless personalization product. */
@@ -5009,11 +5022,11 @@ class wc extends zr {
5009
5022
  * ```
5010
5023
  */
5011
5024
  constructor(e) {
5012
- super(e), this.analytics = new Na({
5025
+ super(e), this.analytics = new Ua({
5013
5026
  api: this.api,
5014
5027
  builder: this.eventBuilder,
5015
5028
  interceptors: this.interceptors
5016
- }), this.personalization = new qa({
5029
+ }), this.personalization = new Ya({
5017
5030
  api: this.api,
5018
5031
  builder: this.eventBuilder,
5019
5032
  interceptors: this.interceptors
@@ -5021,7 +5034,7 @@ class wc extends zr {
5021
5034
  }
5022
5035
  }
5023
5036
  /*! js-cookie v3.0.5 | MIT */
5024
- function Je(t) {
5037
+ function Ge(t) {
5025
5038
  for (var e = 1; e < arguments.length; e++) {
5026
5039
  var n = arguments[e];
5027
5040
  for (var r in n)
@@ -5029,7 +5042,7 @@ function Je(t) {
5029
5042
  }
5030
5043
  return t;
5031
5044
  }
5032
- var Ka = {
5045
+ var Ja = {
5033
5046
  read: function(t) {
5034
5047
  return t[0] === '"' && (t = t.slice(1, -1)), t.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent);
5035
5048
  },
@@ -5043,7 +5056,7 @@ var Ka = {
5043
5056
  function Bt(t, e) {
5044
5057
  function n(i, o, s) {
5045
5058
  if (!(typeof document > "u")) {
5046
- s = Je({}, e, s), typeof s.expires == "number" && (s.expires = new Date(Date.now() + s.expires * 864e5)), s.expires && (s.expires = s.expires.toUTCString()), i = encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
5059
+ s = Ge({}, e, s), typeof s.expires == "number" && (s.expires = new Date(Date.now() + s.expires * 864e5)), s.expires && (s.expires = s.expires.toUTCString()), i = encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
5047
5060
  var a = "";
5048
5061
  for (var c in s)
5049
5062
  s[c] && (a += "; " + c, s[c] !== !0 && (a += "=" + s[c].split(";")[0]));
@@ -5072,16 +5085,16 @@ function Bt(t, e) {
5072
5085
  n(
5073
5086
  i,
5074
5087
  "",
5075
- Je({}, o, {
5088
+ Ge({}, o, {
5076
5089
  expires: -1
5077
5090
  })
5078
5091
  );
5079
5092
  },
5080
5093
  withAttributes: function(i) {
5081
- return Bt(this.converter, Je({}, this.attributes, i));
5094
+ return Bt(this.converter, Ge({}, this.attributes, i));
5082
5095
  },
5083
5096
  withConverter: function(i) {
5084
- return Bt(Je({}, this.converter, i), this.attributes);
5097
+ return Bt(Ge({}, this.converter, i), this.attributes);
5085
5098
  }
5086
5099
  },
5087
5100
  {
@@ -5090,34 +5103,34 @@ function Bt(t, e) {
5090
5103
  }
5091
5104
  );
5092
5105
  }
5093
- var Qe = Bt(Ka, { path: "/" });
5106
+ var pe = Bt(Ja, { path: "/" });
5094
5107
  const Ut = P("Web:AutoTracking");
5095
- function Le(t) {
5108
+ function je(t) {
5096
5109
  if (!(typeof HTMLElement < "u" && typeof SVGElement < "u") || !t || t.nodeType !== 1 || !("dataset" in t) || !t.dataset || typeof t.dataset != "object" || !("ctflEntryId" in t.dataset)) return !1;
5097
5110
  const {
5098
5111
  dataset: { ctflEntryId: n }
5099
5112
  } = t;
5100
5113
  return typeof n == "string" && n.trim().length > 0;
5101
5114
  }
5102
- function kn(t) {
5115
+ function In(t) {
5103
5116
  return !t || typeof t != "object" ? !1 : "entryId" in t && typeof t.entryId == "string" && !!t.entryId.trim().length;
5104
5117
  }
5105
- function Wa(t) {
5118
+ function Qa(t) {
5106
5119
  return (t?.trim().toLowerCase() ?? "") === "true";
5107
5120
  }
5108
- function Ga(t) {
5121
+ function Xa(t) {
5109
5122
  if (t === void 0 || !/^\d+$/.test(t)) return;
5110
5123
  const e = Number(t);
5111
5124
  return Number.isSafeInteger(e) ? e : void 0;
5112
5125
  }
5113
- const Ja = (t) => async (e, n) => {
5114
- if (!kn(n.data) && !Le(e)) return;
5126
+ const ec = (t) => async (e, n) => {
5127
+ if (!In(n.data) && !je(e)) return;
5115
5128
  let r, i, o, s, a;
5116
- if (kn(n.data))
5129
+ if (In(n.data))
5117
5130
  ({
5118
5131
  data: { duplicationScope: r, entryId: i, personalizationId: o, sticky: s, variantIndex: a }
5119
5132
  } = n);
5120
- else if (Le(e)) {
5133
+ else if (je(e)) {
5121
5134
  ({
5122
5135
  dataset: {
5123
5136
  ctflDuplicationScope: r,
@@ -5128,7 +5141,7 @@ const Ja = (t) => async (e, n) => {
5128
5141
  const {
5129
5142
  dataset: { ctflSticky: c, ctflVariantIndex: u }
5130
5143
  } = e;
5131
- s = Wa(c), a = Ga(u);
5144
+ s = Qa(c), a = Xa(u);
5132
5145
  }
5133
5146
  if (!i) {
5134
5147
  Ut.warn(
@@ -5146,40 +5159,40 @@ const Ja = (t) => async (e, n) => {
5146
5159
  r
5147
5160
  );
5148
5161
  };
5149
- function An(t) {
5150
- if (Le(t)) return t;
5162
+ function Cn(t) {
5163
+ if (je(t)) return t;
5151
5164
  const e = t.querySelector("[data-ctfl-entry-id]") ?? void 0;
5152
- return Le(e) ? e : void 0;
5165
+ return je(e) ? e : void 0;
5153
5166
  }
5154
- const Qa = (t, e = !1) => ({
5167
+ const tc = (t, e = !1) => ({
5155
5168
  onRemoved: (n) => {
5156
5169
  n.forEach((r) => {
5157
- const i = An(r);
5170
+ const i = Cn(r);
5158
5171
  !i || !t.getStats(i) || (Ut.info("Auto-unobserving element (remove):", i), t.unobserve(i));
5159
5172
  });
5160
5173
  },
5161
5174
  onAdded: e ? (n) => {
5162
5175
  n.forEach((r) => {
5163
- const i = An(r);
5176
+ const i = Cn(r);
5164
5177
  i && (Ut.info("Auto-observing element (add):", i), t.observe(i));
5165
5178
  });
5166
5179
  } : void 0
5167
- }), Xa = P("Web:EventBuilder");
5168
- function Ya(t) {
5180
+ }), nc = P("Web:EventBuilder");
5181
+ function rc(t) {
5169
5182
  return new URL(t).searchParams.entries().reduce((e, [n, r]) => (e[n] = r, e), {});
5170
5183
  }
5171
- function ec() {
5184
+ function ic() {
5172
5185
  const { languages: t, language: e } = navigator;
5173
5186
  return t[0] ?? e;
5174
5187
  }
5175
- function tc() {
5188
+ function oc() {
5176
5189
  try {
5177
5190
  const t = new URL(window.location.href), { referrer: e, title: n } = document;
5178
5191
  return {
5179
5192
  hash: window.location.hash,
5180
5193
  height: window.innerHeight,
5181
5194
  path: t.pathname,
5182
- query: Ya(t),
5195
+ query: rc(t),
5183
5196
  referrer: e,
5184
5197
  search: t.search,
5185
5198
  title: n,
@@ -5187,7 +5200,7 @@ function tc() {
5187
5200
  width: window.innerWidth
5188
5201
  };
5189
5202
  } catch (t) {
5190
- return t instanceof Error && Xa.error("Failed to get page properties:", t), {
5203
+ return t instanceof Error && nc.error("Failed to get page properties:", t), {
5191
5204
  path: "",
5192
5205
  query: {},
5193
5206
  referrer: "",
@@ -5197,19 +5210,19 @@ function tc() {
5197
5210
  };
5198
5211
  }
5199
5212
  }
5200
- function nc() {
5213
+ function sc() {
5201
5214
  return navigator.userAgent;
5202
5215
  }
5203
- const rc = "0.1.0-alpha", x = typeof window < "u" && typeof document < "u" && typeof document.addEventListener == "function";
5204
- function ic(t, e) {
5216
+ const ac = "0.1.0-alpha4", V = typeof window < "u" && typeof document < "u" && typeof document.addEventListener == "function";
5217
+ function cc(t, e) {
5205
5218
  const n = new Blob([JSON.stringify(e)], {
5206
5219
  type: "text/plain"
5207
5220
  });
5208
5221
  return window.navigator.sendBeacon(t, n);
5209
5222
  }
5210
- const oc = P("Web:Network");
5211
- function sc(t) {
5212
- if (!x)
5223
+ const uc = P("Web:Network");
5224
+ function lc(t) {
5225
+ if (!V)
5213
5226
  return () => {
5214
5227
  };
5215
5228
  const e = (i) => {
@@ -5217,7 +5230,7 @@ function sc(t) {
5217
5230
  try {
5218
5231
  await t(i);
5219
5232
  } catch (o) {
5220
- oc.error("Error in online state callback:", o);
5233
+ uc.error("Error in online state callback:", o);
5221
5234
  }
5222
5235
  })();
5223
5236
  }, n = () => {
@@ -5229,9 +5242,9 @@ function sc(t) {
5229
5242
  window.removeEventListener("online", n), window.removeEventListener("offline", r);
5230
5243
  };
5231
5244
  }
5232
- const ac = P("Web:Visibility");
5233
- function cc(t) {
5234
- if (!x)
5245
+ const dc = P("Web:Visibility");
5246
+ function fc(t) {
5247
+ if (!V)
5235
5248
  return () => {
5236
5249
  };
5237
5250
  let e = !1;
@@ -5240,7 +5253,7 @@ function cc(t) {
5240
5253
  try {
5241
5254
  await t(a);
5242
5255
  } catch (c) {
5243
- ac.error("Error handling page visibility change:", c);
5256
+ dc.error("Error handling page visibility change:", c);
5244
5257
  }
5245
5258
  })());
5246
5259
  }, r = () => {
@@ -5256,7 +5269,7 @@ function cc(t) {
5256
5269
  document.removeEventListener("visibilitychange", i), window.removeEventListener("pagehide", o), window.removeEventListener("pageshow", s);
5257
5270
  };
5258
5271
  }
5259
- const Ae = () => typeof performance < "u" && typeof performance.now == "function" ? performance.now() : Date.now(), $e = () => x ? document.visibilityState === "visible" : !0, se = {
5272
+ const Pe = () => typeof performance < "u" && typeof performance.now == "function" ? performance.now() : Date.now(), Ie = () => V ? document.visibilityState === "visible" : !0, se = {
5260
5273
  /** Default dwell time in ms before firing. */
5261
5274
  DWELL_MS: 1e3,
5262
5275
  /** Default minimum intersection ratio considered visible. */
@@ -5271,26 +5284,26 @@ const Ae = () => typeof performance < "u" && typeof performance.now == "function
5271
5284
  JITTER_DIVISOR: 2,
5272
5285
  /** Interval for sweeping orphaned states in ms. */
5273
5286
  SWEEP_INTERVAL_MS: 3e4
5274
- }, uc = (t) => t + Math.floor(Math.random() * Math.max(1, Math.floor(t / se.JITTER_DIVISOR))), V = {
5287
+ }, pc = (t) => t + Math.floor(Math.random() * Math.max(1, Math.floor(t / se.JITTER_DIVISOR))), N = {
5275
5288
  /** Use the provided number or fall back when the value is not numeric. */
5276
5289
  n: (t, e) => typeof t == "number" ? t : e,
5277
5290
  /** Clamp a value to the [0, 1] range. */
5278
- clamp01: (t, e) => Math.min(1, Math.max(0, V.n(t, e))),
5291
+ clamp01: (t, e) => Math.min(1, Math.max(0, N.n(t, e))),
5279
5292
  /** Ensure a non-negative value. */
5280
- nonNeg: (t, e) => Math.max(0, V.n(t, e)),
5293
+ nonNeg: (t, e) => Math.max(0, N.n(t, e)),
5281
5294
  /** Ensure a value of at least 1. */
5282
- atLeast1: (t, e) => Math.max(1, V.n(t, e))
5295
+ atLeast1: (t, e) => Math.max(1, N.n(t, e))
5283
5296
  }, re = (t) => {
5284
5297
  t.fireTimer !== null && (clearTimeout(t.fireTimer), t.fireTimer = null);
5285
5298
  }, ie = (t) => {
5286
5299
  t.retryTimer !== null && (clearTimeout(t.retryTimer), t.retryTimer = null), t.retryScheduledAt = null;
5287
- }, zt = (t) => {
5300
+ }, It = (t) => {
5288
5301
  if (t.ref && typeof t.ref.deref == "function") {
5289
5302
  const e = t.ref.deref();
5290
5303
  if (e) return e;
5291
5304
  }
5292
5305
  return t.strongRef ?? null;
5293
- }, $n = 100, Pn = 250, lc = 16, dc = 1, fc = x && typeof MutationObserver < "u", In = x && typeof window.requestIdleCallback == "function", pc = x && typeof window.cancelIdleCallback == "function";
5306
+ }, Rn = 100, On = 250, hc = 16, gc = 1, vc = V && typeof MutationObserver < "u", Mn = V && typeof window.requestIdleCallback == "function", yc = V && typeof window.cancelIdleCallback == "function";
5294
5307
  class B {
5295
5308
  observer;
5296
5309
  root;
@@ -5312,18 +5325,18 @@ class B {
5312
5325
  constructor(e = {}) {
5313
5326
  const {
5314
5327
  root: n,
5315
- idleTimeoutMs: r = $n,
5316
- maxChunk: i = Pn,
5328
+ idleTimeoutMs: r = Rn,
5329
+ maxChunk: i = On,
5317
5330
  onChange: o,
5318
5331
  onAdded: s,
5319
5332
  onRemoved: a,
5320
5333
  onError: c
5321
5334
  } = e;
5322
- this.root = B.isNode(n) ? n : x ? document : null, this.idleTimeoutMs = B.sanitizeInt(
5335
+ this.root = B.isNode(n) ? n : V ? document : null, this.idleTimeoutMs = B.sanitizeInt(
5323
5336
  r,
5324
- $n,
5325
- lc
5326
- ), this.maxChunk = B.sanitizeInt(i, Pn, dc), this.onChange = o, this.onAdded = s, this.onRemoved = a, this.onError = c, fc && this.root && (this.observer = new MutationObserver((u) => {
5337
+ Rn,
5338
+ hc
5339
+ ), this.maxChunk = B.sanitizeInt(i, On, gc), this.onChange = o, this.onAdded = s, this.onRemoved = a, this.onError = c, vc && this.root && (this.observer = new MutationObserver((u) => {
5327
5340
  for (const d of u)
5328
5341
  (d.addedNodes.length > 0 || d.removedNodes.length > 0) && this.pendingRecords.push(d);
5329
5342
  this.pendingRecords.length > 0 && this.scheduleProcess();
@@ -5362,7 +5375,7 @@ class B {
5362
5375
  const e = () => {
5363
5376
  this.idleHandle = null, this.scheduled = !1, this.processNow();
5364
5377
  };
5365
- this.idleHandle = In ? window.requestIdleCallback(e, { timeout: this.idleTimeoutMs }) : window.setTimeout(e, this.idleTimeoutMs);
5378
+ this.idleHandle = Mn ? window.requestIdleCallback(e, { timeout: this.idleTimeoutMs }) : window.setTimeout(e, this.idleTimeoutMs);
5366
5379
  }
5367
5380
  /**
5368
5381
  * Process all currently pending mutation records immediately.
@@ -5376,7 +5389,7 @@ class B {
5376
5389
  * Narrow a value to `Node` when the DOM is available.
5377
5390
  */
5378
5391
  static isNode(e) {
5379
- return x && typeof Node < "u" && e instanceof Node;
5392
+ return V && typeof Node < "u" && e instanceof Node;
5380
5393
  }
5381
5394
  /**
5382
5395
  * Normalize a numeric option to a finite integer and enforce a minimum.
@@ -5430,7 +5443,7 @@ class B {
5430
5443
  * Cancel a previously scheduled idle callback or fallback timeout.
5431
5444
  */
5432
5445
  static cancelIdle(e) {
5433
- pc ? window.cancelIdleCallback(e) : x && window.clearTimeout(e);
5446
+ yc ? window.cancelIdleCallback(e) : V && window.clearTimeout(e);
5434
5447
  }
5435
5448
  /**
5436
5449
  * Drain and return the current list of pending mutation records.
@@ -5470,7 +5483,7 @@ class B {
5470
5483
  const i = () => {
5471
5484
  if (!this.isActive()) return;
5472
5485
  const o = Math.min(e.length, r + this.maxChunk), s = e.slice(r, o);
5473
- r = o, this.safeCall(() => n(s)), r < e.length && (In ? window.requestIdleCallback(i, { timeout: this.idleTimeoutMs }) : x && window.setTimeout(i, this.idleTimeoutMs));
5486
+ r = o, this.safeCall(() => n(s)), r < e.length && (Mn ? window.requestIdleCallback(i, { timeout: this.idleTimeoutMs }) : V && window.setTimeout(i, this.idleTimeoutMs));
5474
5487
  };
5475
5488
  i();
5476
5489
  }
@@ -5488,7 +5501,7 @@ class B {
5488
5501
  }
5489
5502
  }
5490
5503
  }
5491
- class Ve {
5504
+ class Ne {
5492
5505
  callback;
5493
5506
  opts;
5494
5507
  io;
@@ -5504,7 +5517,7 @@ class Ve {
5504
5517
  * @param options - Optional observer-level tuning options.
5505
5518
  */
5506
5519
  constructor(e, n) {
5507
- this.callback = e, this.opts = Ve.initOptions(n), this.io = new IntersectionObserver(
5520
+ this.callback = e, this.opts = Ne.initOptions(n), this.io = new IntersectionObserver(
5508
5521
  (r) => {
5509
5522
  this.onIntersect(r);
5510
5523
  },
@@ -5513,7 +5526,7 @@ class Ve {
5513
5526
  rootMargin: this.opts.rootMargin,
5514
5527
  threshold: this.opts.minVisibleRatio === 0 ? [0] : [0, this.opts.minVisibleRatio]
5515
5528
  }
5516
- ), x && (this.boundVisibilityHandler = () => {
5529
+ ), V && (this.boundVisibilityHandler = () => {
5517
5530
  this.onPageVisibilityChange();
5518
5531
  }, document.addEventListener("visibilitychange", this.boundVisibilityHandler));
5519
5532
  }
@@ -5544,7 +5557,7 @@ class Ve {
5544
5557
  this.io.disconnect();
5545
5558
  for (const e of this.activeStates)
5546
5559
  re(e), ie(e), e.done = !0, e.strongRef = null;
5547
- this.activeStates.clear(), x && this.boundVisibilityHandler && (document.removeEventListener("visibilitychange", this.boundVisibilityHandler), this.boundVisibilityHandler = null), this.stopSweeper();
5560
+ this.activeStates.clear(), V && this.boundVisibilityHandler && (document.removeEventListener("visibilitychange", this.boundVisibilityHandler), this.boundVisibilityHandler = null), this.stopSweeper();
5548
5561
  }
5549
5562
  /**
5550
5563
  * Lightweight, readonly stats snapshot for a given element.
@@ -5569,13 +5582,13 @@ class Ve {
5569
5582
  */
5570
5583
  static initOptions(e) {
5571
5584
  return {
5572
- dwellTimeMs: V.nonNeg(e?.dwellTimeMs, se.DWELL_MS),
5573
- minVisibleRatio: V.clamp01(e?.minVisibleRatio, se.RATIO),
5585
+ dwellTimeMs: N.nonNeg(e?.dwellTimeMs, se.DWELL_MS),
5586
+ minVisibleRatio: N.clamp01(e?.minVisibleRatio, se.RATIO),
5574
5587
  root: e?.root ?? null,
5575
5588
  rootMargin: e?.rootMargin ?? "0px",
5576
- maxRetries: V.nonNeg(e?.maxRetries, se.MAX_RETRIES),
5577
- retryBackoffMs: V.nonNeg(e?.retryBackoffMs, se.BACKOFF_MS),
5578
- backoffMultiplier: V.atLeast1(e?.backoffMultiplier, se.MULTIPLIER)
5589
+ maxRetries: N.nonNeg(e?.maxRetries, se.MAX_RETRIES),
5590
+ retryBackoffMs: N.nonNeg(e?.retryBackoffMs, se.BACKOFF_MS),
5591
+ backoffMultiplier: N.atLeast1(e?.backoffMultiplier, se.MULTIPLIER)
5579
5592
  };
5580
5593
  }
5581
5594
  /**
@@ -5584,10 +5597,10 @@ class Ve {
5584
5597
  */
5585
5598
  createState(e, n) {
5586
5599
  const r = {
5587
- dwellTimeMs: V.nonNeg(n?.dwellTimeMs, this.opts.dwellTimeMs),
5588
- maxRetries: V.nonNeg(n?.maxRetries, this.opts.maxRetries),
5589
- retryBackoffMs: V.nonNeg(n?.retryBackoffMs, this.opts.retryBackoffMs),
5590
- backoffMultiplier: V.atLeast1(n?.backoffMultiplier, this.opts.backoffMultiplier)
5600
+ dwellTimeMs: N.nonNeg(n?.dwellTimeMs, this.opts.dwellTimeMs),
5601
+ maxRetries: N.nonNeg(n?.maxRetries, this.opts.maxRetries),
5602
+ retryBackoffMs: N.nonNeg(n?.retryBackoffMs, this.opts.retryBackoffMs),
5603
+ backoffMultiplier: N.atLeast1(n?.backoffMultiplier, this.opts.backoffMultiplier)
5591
5604
  }, i = typeof WeakRef == "function";
5592
5605
  return {
5593
5606
  ref: i ? new WeakRef(e) : null,
@@ -5611,9 +5624,9 @@ class Ve {
5611
5624
  * Handle page visibility changes by pausing/resuming timers and retries.
5612
5625
  */
5613
5626
  onPageVisibilityChange() {
5614
- const e = Ae(), n = !$e();
5627
+ const e = Pe(), n = !Ie();
5615
5628
  for (const r of this.activeStates)
5616
- n ? Ve.onHidden(r, e) : this.onResume(r, e);
5629
+ n ? Ne.onHidden(r, e) : this.onResume(r, e);
5617
5630
  this.sweepOrphans();
5618
5631
  }
5619
5632
  /**
@@ -5640,11 +5653,11 @@ class Ve {
5640
5653
  * visibility state.
5641
5654
  */
5642
5655
  onIntersect(e) {
5643
- const n = Ae();
5656
+ const n = Pe();
5644
5657
  for (const r of e) {
5645
5658
  const i = this.states.get(r.target);
5646
5659
  if (!i || i.done) continue;
5647
- r.isIntersecting && r.intersectionRatio >= this.opts.minVisibleRatio && $e() ? this.onVisible(i, n) : Ve.onNotVisible(i, n);
5660
+ r.isIntersecting && r.intersectionRatio >= this.opts.minVisibleRatio && Ie() ? this.onVisible(i, n) : Ne.onNotVisible(i, n);
5648
5661
  }
5649
5662
  this.sweepOrphans();
5650
5663
  }
@@ -5676,14 +5689,14 @@ class Ve {
5676
5689
  return;
5677
5690
  }
5678
5691
  e.fireTimer = setTimeout(() => {
5679
- !e.done && e.lastKnownVisible && $e() ? this.trigger(e) : re(e);
5692
+ !e.done && e.lastKnownVisible && Ie() ? this.trigger(e) : re(e);
5680
5693
  }, Math.ceil(i));
5681
5694
  }
5682
5695
  /**
5683
5696
  * Schedule a retry attempt after a delay, if the element is currently visible.
5684
5697
  */
5685
5698
  scheduleRetry(e, n) {
5686
- e.pendingRetry = !0, e.retryDelayMs = Math.max(0, Math.ceil(n)), !(!$e() || !e.lastKnownVisible || e.done || e.inFlight) && (e.retryScheduledAt = Ae(), e.retryTimer = setTimeout(() => {
5699
+ e.pendingRetry = !0, e.retryDelayMs = Math.max(0, Math.ceil(n)), !(!Ie() || !e.lastKnownVisible || e.done || e.inFlight) && (e.retryScheduledAt = Pe(), e.retryTimer = setTimeout(() => {
5687
5700
  e.retryTimer = null, e.retryScheduledAt = null, this.attemptCallback(e);
5688
5701
  }, e.retryDelayMs));
5689
5702
  }
@@ -5693,7 +5706,7 @@ class Ve {
5693
5706
  */
5694
5707
  trigger(e) {
5695
5708
  if (e.done || e.inFlight) return;
5696
- const n = Ae(), r = e.accumulatedMs + (e.visibleSince !== null ? n - e.visibleSince : 0);
5709
+ const n = Pe(), r = e.accumulatedMs + (e.visibleSince !== null ? n - e.visibleSince : 0);
5697
5710
  ie(e), e.pendingRetry = !1, re(e), this.attemptCallback(e, r);
5698
5711
  }
5699
5712
  /**
@@ -5704,14 +5717,14 @@ class Ve {
5704
5717
  */
5705
5718
  async attemptCallback(e, n) {
5706
5719
  if (e.done || e.inFlight) return;
5707
- const r = zt(e);
5720
+ const r = It(e);
5708
5721
  if (!r) {
5709
5722
  this.finalizeDroppedState(e);
5710
5723
  return;
5711
5724
  }
5712
5725
  const i = e.attempts + 1;
5713
5726
  e.attempts = i, e.inFlight = !0;
5714
- const o = n ?? e.accumulatedMs + (e.visibleSince !== null ? Ae() - e.visibleSince : 0);
5727
+ const o = n ?? e.accumulatedMs + (e.visibleSince !== null ? Pe() - e.visibleSince : 0);
5715
5728
  try {
5716
5729
  await this.callback(r, { totalVisibleMs: o, attempts: i, data: e.data }), this.onAttemptSuccess(e, r);
5717
5730
  } catch {
@@ -5734,8 +5747,8 @@ class Ve {
5734
5747
  this.onRetriesExceeded(e);
5735
5748
  return;
5736
5749
  }
5737
- const n = e.opts.retryBackoffMs * Math.pow(e.opts.backoffMultiplier, e.attempts - 1), r = uc(n);
5738
- if (!e.lastKnownVisible || !$e()) {
5750
+ const n = e.opts.retryBackoffMs * Math.pow(e.opts.backoffMultiplier, e.attempts - 1), r = pc(n);
5751
+ if (!e.lastKnownVisible || !Ie()) {
5739
5752
  e.pendingRetry = !0, e.retryDelayMs = Math.ceil(r), e.retryScheduledAt = null;
5740
5753
  return;
5741
5754
  }
@@ -5746,7 +5759,7 @@ class Ve {
5746
5759
  */
5747
5760
  onRetriesExceeded(e) {
5748
5761
  ie(e), e.pendingRetry = !1, e.done = !0;
5749
- const n = zt(e);
5762
+ const n = It(e);
5750
5763
  n ? this.safeAutoUnobserve(n, e) : this.finalizeDroppedState(e);
5751
5764
  }
5752
5765
  /**
@@ -5792,9 +5805,9 @@ class Ve {
5792
5805
  * whose references have been lost.
5793
5806
  */
5794
5807
  sweepOrphans() {
5795
- if (x) {
5808
+ if (V) {
5796
5809
  for (const e of Array.from(this.activeStates)) {
5797
- const n = zt(e);
5810
+ const n = It(e);
5798
5811
  if (!n) {
5799
5812
  this.finalizeDroppedState(e);
5800
5813
  continue;
@@ -5805,7 +5818,7 @@ class Ve {
5805
5818
  }
5806
5819
  }
5807
5820
  }
5808
- const Tt = "__ctfl_opt_anonymous_id__", kt = "__ctfl_opt_consent__", At = "__ctfl_opt_changes__", $t = "__ctfl_opt_debug__", Pt = "__ctfl_opt_profile__", It = "__ctfl_opt_personalizations__", w = {
5821
+ const w = {
5809
5822
  /**
5810
5823
  * Reset local caches used by the Web SDK.
5811
5824
  *
@@ -5817,13 +5830,14 @@ const Tt = "__ctfl_opt_anonymous_id__", kt = "__ctfl_opt_consent__", At = "__ctf
5817
5830
  * ```
5818
5831
  */
5819
5832
  reset(t = { resetConsent: !1, resetDebug: !1 }) {
5820
- t.resetConsent && localStorage.removeItem(kt), t.resetDebug && localStorage.removeItem($t), localStorage.removeItem(Tt), localStorage.removeItem(At), localStorage.removeItem(Pt), localStorage.removeItem(It);
5833
+ t.resetConsent && localStorage.removeItem(zt), t.resetDebug && localStorage.removeItem(kt), localStorage.removeItem(St), localStorage.removeItem(Tt), localStorage.removeItem(At), localStorage.removeItem($t);
5821
5834
  },
5822
5835
  /**
5823
5836
  * Anonymous identifier currently stored in localStorage, if any.
5824
5837
  */
5825
5838
  get anonymousId() {
5826
- return localStorage.getItem(Tt) ?? void 0;
5839
+ const t = localStorage.getItem($n);
5840
+ return t && localStorage.removeItem($n), t ?? localStorage.getItem(St) ?? void 0;
5827
5841
  },
5828
5842
  /**
5829
5843
  * Set or clear the anonymous identifier.
@@ -5831,7 +5845,7 @@ const Tt = "__ctfl_opt_anonymous_id__", kt = "__ctfl_opt_consent__", At = "__ctf
5831
5845
  * @param id - The new identifier, or `undefined` to clear it.
5832
5846
  */
5833
5847
  set anonymousId(t) {
5834
- w.setCache(Tt, t);
5848
+ w.setCache(St, t);
5835
5849
  },
5836
5850
  /**
5837
5851
  * Persisted consent status.
@@ -5840,7 +5854,7 @@ const Tt = "__ctfl_opt_anonymous_id__", kt = "__ctfl_opt_consent__", At = "__ctf
5840
5854
  * `denied`, or `undefined` when no value is stored.
5841
5855
  */
5842
5856
  get consent() {
5843
- switch (localStorage.getItem(kt)) {
5857
+ switch (localStorage.getItem(zt)) {
5844
5858
  case "accepted":
5845
5859
  return !0;
5846
5860
  case "denied":
@@ -5855,7 +5869,7 @@ const Tt = "__ctfl_opt_anonymous_id__", kt = "__ctfl_opt_consent__", At = "__ctf
5855
5869
  */
5856
5870
  set consent(t) {
5857
5871
  const e = t ? "accepted" : "denied";
5858
- w.setCache(kt, t === void 0 ? void 0 : e);
5872
+ w.setCache(zt, t === void 0 ? void 0 : e);
5859
5873
  },
5860
5874
  /**
5861
5875
  * Persisted debug flag value.
@@ -5863,7 +5877,7 @@ const Tt = "__ctfl_opt_anonymous_id__", kt = "__ctfl_opt_consent__", At = "__ctf
5863
5877
  * @returns `true` or `false` when stored, or `undefined` otherwise.
5864
5878
  */
5865
5879
  get debug() {
5866
- const t = localStorage.getItem($t);
5880
+ const t = localStorage.getItem(kt);
5867
5881
  return t ? t === "true" : void 0;
5868
5882
  },
5869
5883
  /**
@@ -5872,13 +5886,13 @@ const Tt = "__ctfl_opt_anonymous_id__", kt = "__ctfl_opt_consent__", At = "__ctf
5872
5886
  * @param debug - New flag value or `undefined` to remove.
5873
5887
  */
5874
5888
  set debug(t) {
5875
- w.setCache($t, t);
5889
+ w.setCache(kt, t);
5876
5890
  },
5877
5891
  /**
5878
5892
  * Cached Custom Flags change array, if present.
5879
5893
  */
5880
5894
  get changes() {
5881
- return w.getCache(At, nr);
5895
+ return w.getCache(Tt, sr);
5882
5896
  },
5883
5897
  /**
5884
5898
  * Cache a new change array or clear it.
@@ -5886,13 +5900,13 @@ const Tt = "__ctfl_opt_anonymous_id__", kt = "__ctfl_opt_consent__", At = "__ctf
5886
5900
  * @param changes - New changes to store, or `undefined` to remove.
5887
5901
  */
5888
5902
  set changes(t) {
5889
- w.setCache(At, t);
5903
+ w.setCache(Tt, t);
5890
5904
  },
5891
5905
  /**
5892
5906
  * Cached profile from the personalization service, if present.
5893
5907
  */
5894
5908
  get profile() {
5895
- return w.getCache(Pt, dt);
5909
+ return w.getCache(At, dt);
5896
5910
  },
5897
5911
  /**
5898
5912
  * Cache a new profile or clear it.
@@ -5900,13 +5914,13 @@ const Tt = "__ctfl_opt_anonymous_id__", kt = "__ctfl_opt_consent__", At = "__ctf
5900
5914
  * @param profile - New profile to store, or `undefined` to remove.
5901
5915
  */
5902
5916
  set profile(t) {
5903
- w.setCache(Pt, t);
5917
+ w.setCache(At, t);
5904
5918
  },
5905
5919
  /**
5906
5920
  * Cached selected personalizations, if present.
5907
5921
  */
5908
5922
  get personalizations() {
5909
- return w.getCache(It, cr);
5923
+ return w.getCache($t, fr);
5910
5924
  },
5911
5925
  /**
5912
5926
  * Cache new selected personalizations or clear them.
@@ -5914,7 +5928,7 @@ const Tt = "__ctfl_opt_anonymous_id__", kt = "__ctfl_opt_consent__", At = "__ctf
5914
5928
  * @param personalizations - New selections to store, or `undefined` to remove.
5915
5929
  */
5916
5930
  set personalizations(t) {
5917
- w.setCache(It, t);
5931
+ w.setCache($t, t);
5918
5932
  },
5919
5933
  /**
5920
5934
  * Safely read and parse typed data from localStorage.
@@ -5940,8 +5954,8 @@ const Tt = "__ctfl_opt_anonymous_id__", kt = "__ctfl_opt_consent__", At = "__ctf
5940
5954
  setCache(t, e) {
5941
5955
  e === void 0 ? localStorage.removeItem(t) : localStorage.setItem(t, typeof e == "string" ? e : JSON.stringify(e));
5942
5956
  }
5943
- }, Ct = P("Web:SDK"), hc = 365;
5944
- function gc({
5957
+ }, Ct = P("Web:SDK"), mc = 365;
5958
+ function bc({
5945
5959
  app: t,
5946
5960
  defaults: e,
5947
5961
  logLevel: n,
@@ -5953,9 +5967,9 @@ function gc({
5953
5967
  changes: s = w.changes,
5954
5968
  personalizations: a = w.personalizations
5955
5969
  } = e ?? {};
5956
- return he(
5970
+ return ge(
5957
5971
  {
5958
- analytics: { beaconHandler: ic },
5972
+ analytics: { beaconHandler: cc },
5959
5973
  defaults: {
5960
5974
  consent: i,
5961
5975
  changes: s,
@@ -5965,10 +5979,10 @@ function gc({
5965
5979
  eventBuilder: {
5966
5980
  app: t,
5967
5981
  channel: "web",
5968
- library: { name: "Optimization Web API", version: rc },
5969
- getLocale: ec,
5970
- getPageProperties: tc,
5971
- getUserAgent: nc
5982
+ library: { name: "Optimization Web SDK", version: ac },
5983
+ getLocale: ic,
5984
+ getPageProperties: oc,
5985
+ getUserAgent: sc
5972
5986
  },
5973
5987
  getAnonymousId: () => w.anonymousId,
5974
5988
  logLevel: w.debug ? "debug" : n
@@ -5976,10 +5990,30 @@ function gc({
5976
5990
  r
5977
5991
  );
5978
5992
  }
5979
- class vc extends Ha {
5993
+ class Ac extends Ga {
5994
+ /**
5995
+ * Observer responsible for element view/dwell-time tracking.
5996
+ *
5997
+ * @internal
5998
+ */
5980
5999
  elementViewObserver = void 0;
6000
+ /**
6001
+ * Observer responsible for detecting entry elements added/removed in the DOM.
6002
+ *
6003
+ * @internal
6004
+ */
5981
6005
  elementExistenceObserver = void 0;
6006
+ /**
6007
+ * Whether automatic entry view tracking is enabled.
6008
+ *
6009
+ * @internal
6010
+ */
5982
6011
  autoTrackEntryViews = !1;
6012
+ /**
6013
+ * Cookie attributes used when persisting the anonymous identifier.
6014
+ *
6015
+ * @internal
6016
+ */
5983
6017
  cookieAttributes = void 0;
5984
6018
  /**
5985
6019
  * Create a new Optimization Web SDK instance.
@@ -6003,44 +6037,63 @@ class vc extends Ha {
6003
6037
  constructor(e) {
6004
6038
  if (typeof window < "u" && window.optimization)
6005
6039
  throw new Error("Optimization is already initialized");
6006
- const { autoTrackEntryViews: n, ...r } = e, i = gc(r);
6040
+ const { autoTrackEntryViews: n, ...r } = e, i = bc(r);
6007
6041
  super(i);
6008
- const o = Qe.get(Ge);
6009
- this.cookieAttributes = {
6042
+ const o = pe.get(An), s = o ?? pe.get(Ye);
6043
+ this.autoTrackEntryViews = !0, this.cookieAttributes = {
6010
6044
  domain: i.cookie?.domain,
6011
- expires: i.cookie?.expires ?? hc
6012
- }, this.autoTrackEntryViews = !0, sc((s) => {
6013
- this.online(s);
6014
- }), cc(async () => {
6045
+ expires: i.cookie?.expires ?? mc
6046
+ }, lc((a) => {
6047
+ this.online(a);
6048
+ }), fc(async () => {
6015
6049
  await this.flush();
6016
- }), N(() => {
6050
+ }), x(() => {
6017
6051
  const {
6018
- changes: { value: s }
6019
- } = Ce;
6020
- w.changes = s;
6021
- }), N(() => {
6052
+ changes: { value: a }
6053
+ } = Oe;
6054
+ w.changes = a;
6055
+ }), x(() => {
6022
6056
  const {
6023
- consent: { value: s }
6024
- } = Ce;
6025
- this.autoTrackEntryViews && (s ? this.startAutoTrackingEntryViews() : this.stopAutoTrackingEntryViews()), w.consent = s;
6026
- }), N(() => {
6057
+ consent: { value: a }
6058
+ } = Oe;
6059
+ this.autoTrackEntryViews && (a ? this.startAutoTrackingEntryViews() : this.stopAutoTrackingEntryViews()), w.consent = a;
6060
+ }), x(() => {
6027
6061
  const {
6028
- profile: { value: s }
6029
- } = Ce;
6030
- w.profile = s, this.setAnonymousId(s?.id);
6031
- }), N(() => {
6062
+ profile: { value: a }
6063
+ } = Oe;
6064
+ w.profile = a, this.setAnonymousId(a?.id);
6065
+ }), x(() => {
6032
6066
  const {
6033
- personalizations: { value: s }
6034
- } = Ce;
6035
- w.personalizations = s;
6036
- }), o && o !== w.anonymousId && (this.reset(), this.setAnonymousId(o)), typeof window < "u" && (window.optimization ??= this);
6067
+ personalizations: { value: a }
6068
+ } = Oe;
6069
+ w.personalizations = a;
6070
+ }), this.initializeFromCookieValues(s, o), typeof window < "u" && (window.optimization ??= this);
6071
+ }
6072
+ /**
6073
+ * Initialize anonymous ID state from cookies.
6074
+ *
6075
+ * @internal
6076
+ * @remarks
6077
+ * Reads the legacy anonymous ID cookie (if present), migrates to the current cookie,
6078
+ * and ensures SDK state is reset when the persisted anonymous ID differs from the
6079
+ * in-memory value.
6080
+ */
6081
+ initializeFromCookieValues(e, n) {
6082
+ n && pe.remove(An), e && e !== w.anonymousId && (this.reset(), this.setAnonymousId(e));
6037
6083
  }
6084
+ /**
6085
+ * Persist (or clear) the anonymous ID in both cookies and {@link LocalStore}.
6086
+ *
6087
+ * @param value - Anonymous identifier to persist. If omitted, clears persisted state.
6088
+ *
6089
+ * @internal
6090
+ */
6038
6091
  setAnonymousId(e) {
6039
6092
  if (!e) {
6040
- Qe.remove(Ge), w.anonymousId = void 0;
6093
+ pe.remove(Ye), w.anonymousId = void 0;
6041
6094
  return;
6042
6095
  }
6043
- Qe.set(Ge, e, this.cookieAttributes), w.anonymousId = e;
6096
+ pe.set(Ye, e, this.cookieAttributes), w.anonymousId = e;
6044
6097
  }
6045
6098
  /**
6046
6099
  * Enable automatic entry view tracking for elements with `data-ctfl-*`
@@ -6055,10 +6108,10 @@ class vc extends Ha {
6055
6108
  * ```
6056
6109
  */
6057
6110
  startAutoTrackingEntryViews(e) {
6058
- this.autoTrackEntryViews = !0, this.elementViewObserver = new Ve(Ja(this)), this.elementExistenceObserver = new B(
6059
- Qa(this.elementViewObserver, !0)
6111
+ this.autoTrackEntryViews = !0, this.elementViewObserver = new Ne(ec(this)), this.elementExistenceObserver = new B(
6112
+ tc(this.elementViewObserver, !0)
6060
6113
  ), document.querySelectorAll("[data-ctfl-entry-id]").forEach((r) => {
6061
- Le(r) && (Ct.info("Auto-observing element (init):", r), this.elementViewObserver?.observe(r, {
6114
+ je(r) && (Ct.info("Auto-observing element (init):", r), this.elementViewObserver?.observe(r, {
6062
6115
  ...e
6063
6116
  }));
6064
6117
  });
@@ -6081,6 +6134,10 @@ class vc extends Ha {
6081
6134
  * @param element - Element to observe.
6082
6135
  * @param options - Per-element observer options and callback data.
6083
6136
  *
6137
+ * @remarks
6138
+ * This method relies on an initialized {@link ElementViewObserver}. If automatic
6139
+ * tracking has not been started, the call is a no-op.
6140
+ *
6084
6141
  * @example
6085
6142
  * ```ts
6086
6143
  * const element = document.querySelector('#hero')!
@@ -6098,6 +6155,10 @@ class vc extends Ha {
6098
6155
  *
6099
6156
  * @param element - Element to stop observing.
6100
6157
  *
6158
+ * @remarks
6159
+ * This method relies on an initialized {@link ElementViewObserver}. If automatic
6160
+ * tracking has not been started, the call is a no-op.
6161
+ *
6101
6162
  * @example
6102
6163
  * ```ts
6103
6164
  * optimization.untrackEntryViewForElement(element)
@@ -6119,126 +6180,130 @@ class vc extends Ha {
6119
6180
  * ```
6120
6181
  */
6121
6182
  reset() {
6122
- this.stopAutoTrackingEntryViews(), Qe.remove(Ge), w.reset(), super.reset();
6183
+ this.stopAutoTrackingEntryViews(), pe.remove(Ye), w.reset(), super.reset();
6123
6184
  }
6124
6185
  }
6125
- typeof window < "u" && (window.Optimization ??= vc);
6126
6186
  export {
6127
- Tt as ANONYMOUS_ID,
6128
- Ge as ANONYMOUS_ID_COOKIE,
6129
- rr as AliasEvent,
6187
+ Ye as ANONYMOUS_ID_COOKIE,
6188
+ An as ANONYMOUS_ID_COOKIE_LEGACY,
6189
+ St as ANONYMOUS_ID_KEY,
6190
+ $n as ANONYMOUS_ID_KEY_LEGACY,
6191
+ ar as AliasEvent,
6130
6192
  ft as AnalyticsStateful,
6131
- Na as AnalyticsStateless,
6132
- Us as ApiClient,
6133
- jo as App,
6134
- To as AudienceEntry,
6135
- zo as AudienceEntryFields,
6136
- Ko as BatchExperienceData,
6137
- Yo as BatchExperienceEvent,
6138
- bc as BatchExperienceEventArray,
6139
- Wo as BatchExperienceResponse,
6140
- is as BatchInsightsEvent,
6141
- lr as BatchInsightsEventArray,
6142
- x as CAN_ADD_LISTENERS,
6143
- At as CHANGES_CACHE,
6144
- kt as CONSENT,
6145
- Yn as Campaign,
6146
- Xo as Change,
6147
- nr as ChangeArray,
6148
- Go as ChangeType,
6149
- Bo as Channel,
6150
- ye as ComponentViewEvent,
6151
- ps as ConsoleLogSink,
6152
- bo as ContentTypeLink,
6153
- Ha as CoreStateful,
6154
- wc as CoreStateless,
6193
+ Ua as AnalyticsStateless,
6194
+ Fs as ApiClient,
6195
+ Do as App,
6196
+ nr as AudienceEntry,
6197
+ $o as AudienceEntryFields,
6198
+ _c as AudienceEntrySkeleton,
6199
+ Go as BatchExperienceData,
6200
+ ns as BatchExperienceEvent,
6201
+ zc as BatchExperienceEventArray,
6202
+ Jo as BatchExperienceResponse,
6203
+ as as BatchInsightsEvent,
6204
+ hr as BatchInsightsEventArray,
6205
+ V as CAN_ADD_LISTENERS,
6206
+ Tt as CHANGES_CACHE_KEY,
6207
+ zt as CONSENT_KEY,
6208
+ rr as Campaign,
6209
+ ts as Change,
6210
+ sr as ChangeArray,
6211
+ Qo as ChangeType,
6212
+ Zo as Channel,
6213
+ be as ComponentViewEvent,
6214
+ vs as ConsoleLogSink,
6215
+ Eo as ContentTypeLink,
6216
+ Ga as CoreStateful,
6217
+ kc as CoreStateless,
6155
6218
  Ue as CtflEntry,
6156
- $t as DEBUG_FLAG,
6157
- _n as DEFAULT_PAGE_PROPERTIES,
6158
- Uo as Dictionary,
6159
- Ns as EXPERIENCE_BASE_URL,
6219
+ kt as DEBUG_FLAG_KEY,
6220
+ En as DEFAULT_PAGE_PROPERTIES,
6221
+ Fo as Dictionary,
6222
+ Bs as EXPERIENCE_BASE_URL,
6160
6223
  ut as EntryFields,
6161
- $o as EntryReplacementComponent,
6224
+ Co as EntryReplacementComponent,
6162
6225
  xt as EntryReplacementVariant,
6163
- Qn as EntrySys,
6164
- _o as EnvironmentLink,
6165
- _a as EventBuilder,
6166
- ns as ExperienceData,
6167
- ar as ExperienceEvent,
6168
- Ye as ExperienceEventArray,
6169
- _c as ExperienceRequestData,
6170
- es as ExperienceRequestOptions,
6226
+ tr as EntrySys,
6227
+ So as EnvironmentLink,
6228
+ Sa as EventBuilder,
6229
+ os as ExperienceData,
6230
+ dr as ExperienceEvent,
6231
+ Qe as ExperienceEventArray,
6232
+ Tc as ExperienceRequestData,
6233
+ rs as ExperienceRequestOptions,
6171
6234
  gt as ExperienceResponse,
6172
6235
  Ot as FlagsResolver,
6173
- Wt as GeoLocation,
6174
- ir as GroupEvent,
6175
- js as INSIGHTS_BASE_URL,
6176
- Xt as IdentifyEvent,
6177
- Co as InlineVariableComponent,
6178
- Io as InlineVariableComponentValueType,
6179
- ln as InlineVariableVariant,
6180
- ur as InsightsEvent,
6181
- rs as InsightsEventArray,
6182
- Tn as InterceptorManager,
6183
- Fo as Library,
6184
- mo as Link,
6185
- us as LogSink,
6186
- cs as Logger,
6187
- ko as MergeTagEntry,
6188
- xe as MergeTagValueResolver,
6189
- La as OPTIMIZATION_CORE_SDK_VERSION,
6190
- rc as OPTIMIZATION_WEB_SDK_VERSION,
6191
- vc as Optimization,
6192
- It as PERSONALIZATIONS_CACHE,
6193
- Pt as PROFILE_CACHE,
6194
- Ee as Page,
6195
- or as PageEventContext,
6196
- Yt as PageViewEvent,
6197
- Ho as PartialProfile,
6198
- Ro as PersonalizationComponent,
6199
- Oo as PersonalizationComponentArray,
6200
- Mo as PersonalizationConfig,
6201
- Xn as PersonalizationEntry,
6202
- No as PersonalizationEntryArray,
6203
- Vo as PersonalizationFields,
6236
+ Gt as GeoLocation,
6237
+ cr as GroupEvent,
6238
+ Ds as INSIGHTS_BASE_URL,
6239
+ en as IdentifyEvent,
6240
+ Mo as InlineVariableComponent,
6241
+ Oo as InlineVariableComponentValueType,
6242
+ fn as InlineVariableVariant,
6243
+ pr as InsightsEvent,
6244
+ ss as InsightsEventArray,
6245
+ Pn as InterceptorManager,
6246
+ Ko as Library,
6247
+ wo as Link,
6248
+ fs as LogSink,
6249
+ ds as Logger,
6250
+ Po as MergeTagEntry,
6251
+ Ve as MergeTagValueResolver,
6252
+ Da as OPTIMIZATION_CORE_SDK_VERSION,
6253
+ ac as OPTIMIZATION_WEB_SDK_VERSION,
6254
+ Ac as Optimization,
6255
+ $t as PERSONALIZATIONS_CACHE_KEY,
6256
+ At as PROFILE_CACHE_KEY,
6257
+ ze as Page,
6258
+ ur as PageEventContext,
6259
+ tn as PageViewEvent,
6260
+ Yo as PartialProfile,
6261
+ xo as PersonalizationComponent,
6262
+ Vo as PersonalizationComponentArray,
6263
+ No as PersonalizationConfig,
6264
+ Yt as PersonalizationEntry,
6265
+ Bo as PersonalizationEntryArray,
6266
+ Ec as PersonalizationEntrySkeleton,
6267
+ jo as PersonalizationFields,
6204
6268
  le as PersonalizationStateful,
6205
- qa as PersonalizationStateless,
6206
- xo as PersonalizationType,
6207
- Lo as PersonalizedEntry,
6208
- ge as PersonalizedEntryResolver,
6269
+ Ya as PersonalizationStateless,
6270
+ Lo as PersonalizationType,
6271
+ Uo as PersonalizedEntry,
6272
+ ve as PersonalizedEntryResolver,
6209
6273
  dt as Profile,
6210
6274
  lt as Properties,
6211
- Gt as Screen,
6212
- sr as ScreenEventContext,
6213
- en as ScreenViewEvent,
6214
- ts as SelectedPersonalization,
6215
- cr as SelectedPersonalizationArray,
6216
- qo as SessionStatistics,
6217
- wo as SpaceLink,
6218
- Eo as TagLink,
6219
- tn as TrackEvent,
6220
- Jt as Traits,
6221
- Qt as UniversalEventContext,
6275
+ Jt as Screen,
6276
+ lr as ScreenEventContext,
6277
+ nn as ScreenViewEvent,
6278
+ is as SelectedPersonalization,
6279
+ fr as SelectedPersonalizationArray,
6280
+ Wo as SessionStatistics,
6281
+ zo as SpaceLink,
6282
+ ko as TagLink,
6283
+ rn as TrackEvent,
6284
+ Qt as Traits,
6285
+ Xt as UniversalEventContext,
6222
6286
  ue as UniversalEventProperties,
6223
- mc as UnknownChange,
6224
- $a as ValuePresence,
6225
- Qo as VariableChange,
6226
- Jo as VariableChangeValue,
6227
- Re as batch,
6228
- ic as beaconHandler,
6287
+ Sc as UnknownChange,
6288
+ Ra as ValuePresence,
6289
+ es as VariableChange,
6290
+ Xo as VariableChangeValue,
6291
+ ye as batch,
6292
+ cc as beaconHandler,
6229
6293
  P as createScopedLogger,
6230
- N as effect,
6231
- ec as getLocale,
6232
- tc as getPageProperties,
6233
- nc as getUserAgent,
6294
+ x as effect,
6295
+ ic as getLocale,
6296
+ oc as getPageProperties,
6297
+ sc as getUserAgent,
6234
6298
  F as guardedBy,
6235
- So as isEntry,
6236
- Po as isEntryReplacementComponent,
6237
- Ao as isEntryReplacementVariant,
6238
- yc as isInlineVariableComponent,
6299
+ Ao as isEntry,
6300
+ Ro as isEntryReplacementComponent,
6301
+ Io as isEntryReplacementVariant,
6302
+ wc as isInlineVariableComponent,
6239
6303
  Ke as isPersonalizationEntry,
6240
6304
  ht as isPersonalizedEntry,
6241
6305
  oe as logger,
6242
- Ce as signals
6306
+ $a as signalFns,
6307
+ Oe as signals
6243
6308
  };
6244
6309
  //# sourceMappingURL=index.js.map