@telemetryos/root-sdk 1.16.0 → 1.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- const He = "1.16.0", Le = {
1
+ const He = "1.17.0", Le = {
2
2
  version: He
3
3
  };
4
4
  class De {
@@ -175,17 +175,27 @@ class ze {
175
175
  * Opens a full-screen media picker dialog in the host window.
176
176
  * This allows users to browse folders, view media, and select an item.
177
177
  *
178
+ * Uses a subscription pattern internally so the picker can remain open
179
+ * indefinitely without hitting the 30-second request timeout.
180
+ *
178
181
  * @param options Optional picker options including content type filter and current value
179
182
  * @returns A promise that resolves to the selected media, or null if cancelled
180
183
  */
181
184
  async openPicker(e) {
182
- return (await this._client.request("media.openPicker", {
183
- accept: e == null ? void 0 : e.accept,
184
- currentValue: e == null ? void 0 : e.currentValue
185
- })).selection;
185
+ return new Promise((t, s) => {
186
+ const n = (a) => {
187
+ this._client.unsubscribe("media.openPicker", n), t(a.selection);
188
+ };
189
+ this._client.subscribe("media.openPicker", {
190
+ accept: e == null ? void 0 : e.accept,
191
+ currentValue: e == null ? void 0 : e.currentValue
192
+ }, n).then((a) => {
193
+ a.success || s(new Error("Failed to open media picker"));
194
+ }).catch(s);
195
+ });
186
196
  }
187
197
  }
188
- var b;
198
+ var w;
189
199
  (function(i) {
190
200
  i.assertEqual = (n) => {
191
201
  };
@@ -221,7 +231,7 @@ var b;
221
231
  return n.map((r) => typeof r == "string" ? `'${r}'` : r).join(a);
222
232
  }
223
233
  i.joinValues = s, i.jsonStringifyReplacer = (n, a) => typeof a == "bigint" ? a.toString() : a;
224
- })(b || (b = {}));
234
+ })(w || (w = {}));
225
235
  var ye;
226
236
  (function(i) {
227
237
  i.mergeShapes = (e, t) => ({
@@ -230,7 +240,7 @@ var ye;
230
240
  // second overwrites first
231
241
  });
232
242
  })(ye || (ye = {}));
233
- const h = b.arrayToEnum([
243
+ const h = w.arrayToEnum([
234
244
  "string",
235
245
  "nan",
236
246
  "number",
@@ -251,7 +261,7 @@ const h = b.arrayToEnum([
251
261
  "never",
252
262
  "map",
253
263
  "set"
254
- ]), A = (i) => {
264
+ ]), O = (i) => {
255
265
  switch (typeof i) {
256
266
  case "undefined":
257
267
  return h.undefined;
@@ -272,7 +282,7 @@ const h = b.arrayToEnum([
272
282
  default:
273
283
  return h.unknown;
274
284
  }
275
- }, d = b.arrayToEnum([
285
+ }, d = w.arrayToEnum([
276
286
  "invalid_type",
277
287
  "invalid_literal",
278
288
  "custom",
@@ -290,7 +300,7 @@ const h = b.arrayToEnum([
290
300
  "not_multiple_of",
291
301
  "not_finite"
292
302
  ]);
293
- class N extends Error {
303
+ class Z extends Error {
294
304
  get errors() {
295
305
  return this.issues;
296
306
  }
@@ -327,14 +337,14 @@ class N extends Error {
327
337
  return n(this), s;
328
338
  }
329
339
  static assert(e) {
330
- if (!(e instanceof N))
340
+ if (!(e instanceof Z))
331
341
  throw new Error(`Not a ZodError: ${e}`);
332
342
  }
333
343
  toString() {
334
344
  return this.message;
335
345
  }
336
346
  get message() {
337
- return JSON.stringify(this.issues, b.jsonStringifyReplacer, 2);
347
+ return JSON.stringify(this.issues, w.jsonStringifyReplacer, 2);
338
348
  }
339
349
  get isEmpty() {
340
350
  return this.issues.length === 0;
@@ -353,7 +363,7 @@ class N extends Error {
353
363
  return this.flatten();
354
364
  }
355
365
  }
356
- N.create = (i) => new N(i);
366
+ Z.create = (i) => new Z(i);
357
367
  const de = (i, e) => {
358
368
  let t;
359
369
  switch (i.code) {
@@ -361,19 +371,19 @@ const de = (i, e) => {
361
371
  i.received === h.undefined ? t = "Required" : t = `Expected ${i.expected}, received ${i.received}`;
362
372
  break;
363
373
  case d.invalid_literal:
364
- t = `Invalid literal value, expected ${JSON.stringify(i.expected, b.jsonStringifyReplacer)}`;
374
+ t = `Invalid literal value, expected ${JSON.stringify(i.expected, w.jsonStringifyReplacer)}`;
365
375
  break;
366
376
  case d.unrecognized_keys:
367
- t = `Unrecognized key(s) in object: ${b.joinValues(i.keys, ", ")}`;
377
+ t = `Unrecognized key(s) in object: ${w.joinValues(i.keys, ", ")}`;
368
378
  break;
369
379
  case d.invalid_union:
370
380
  t = "Invalid input";
371
381
  break;
372
382
  case d.invalid_union_discriminator:
373
- t = `Invalid discriminator value. Expected ${b.joinValues(i.options)}`;
383
+ t = `Invalid discriminator value. Expected ${w.joinValues(i.options)}`;
374
384
  break;
375
385
  case d.invalid_enum_value:
376
- t = `Invalid enum value. Expected ${b.joinValues(i.options)}, received '${i.received}'`;
386
+ t = `Invalid enum value. Expected ${w.joinValues(i.options)}, received '${i.received}'`;
377
387
  break;
378
388
  case d.invalid_arguments:
379
389
  t = "Invalid function arguments";
@@ -385,7 +395,7 @@ const de = (i, e) => {
385
395
  t = "Invalid date";
386
396
  break;
387
397
  case d.invalid_string:
388
- typeof i.validation == "object" ? "includes" in i.validation ? (t = `Invalid input: must include "${i.validation.includes}"`, typeof i.validation.position == "number" && (t = `${t} at one or more positions greater than or equal to ${i.validation.position}`)) : "startsWith" in i.validation ? t = `Invalid input: must start with "${i.validation.startsWith}"` : "endsWith" in i.validation ? t = `Invalid input: must end with "${i.validation.endsWith}"` : b.assertNever(i.validation) : i.validation !== "regex" ? t = `Invalid ${i.validation}` : t = "Invalid";
398
+ typeof i.validation == "object" ? "includes" in i.validation ? (t = `Invalid input: must include "${i.validation.includes}"`, typeof i.validation.position == "number" && (t = `${t} at one or more positions greater than or equal to ${i.validation.position}`)) : "startsWith" in i.validation ? t = `Invalid input: must start with "${i.validation.startsWith}"` : "endsWith" in i.validation ? t = `Invalid input: must end with "${i.validation.endsWith}"` : w.assertNever(i.validation) : i.validation !== "regex" ? t = `Invalid ${i.validation}` : t = "Invalid";
389
399
  break;
390
400
  case d.too_small:
391
401
  i.type === "array" ? t = `Array must contain ${i.exact ? "exactly" : i.inclusive ? "at least" : "more than"} ${i.minimum} element(s)` : i.type === "string" ? t = `String must contain ${i.exact ? "exactly" : i.inclusive ? "at least" : "over"} ${i.minimum} character(s)` : i.type === "number" ? t = `Number must be ${i.exact ? "exactly equal to " : i.inclusive ? "greater than or equal to " : "greater than "}${i.minimum}` : i.type === "bigint" ? t = `Number must be ${i.exact ? "exactly equal to " : i.inclusive ? "greater than or equal to " : "greater than "}${i.minimum}` : i.type === "date" ? t = `Date must be ${i.exact ? "exactly equal to " : i.inclusive ? "greater than or equal to " : "greater than "}${new Date(Number(i.minimum))}` : t = "Invalid input";
@@ -406,7 +416,7 @@ const de = (i, e) => {
406
416
  t = "Number must be finite";
407
417
  break;
408
418
  default:
409
- t = e.defaultError, b.assertNever(i);
419
+ t = e.defaultError, w.assertNever(i);
410
420
  }
411
421
  return { message: t };
412
422
  };
@@ -501,7 +511,7 @@ var p;
501
511
  (function(i) {
502
512
  i.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, i.toString = (e) => typeof e == "string" ? e : e == null ? void 0 : e.message;
503
513
  })(p || (p = {}));
504
- class $ {
514
+ class P {
505
515
  constructor(e, t, s, n) {
506
516
  this._cachedPath = [], this.parent = e, this.data = t, this._path = s, this._key = n;
507
517
  }
@@ -519,7 +529,7 @@ const we = (i, e) => {
519
529
  get error() {
520
530
  if (this._error)
521
531
  return this._error;
522
- const t = new N(i.common.issues);
532
+ const t = new Z(i.common.issues);
523
533
  return this._error = t, this._error;
524
534
  }
525
535
  };
@@ -535,18 +545,18 @@ function y(i) {
535
545
  return a.code === "invalid_enum_value" ? { message: o ?? r.defaultError } : typeof r.data > "u" ? { message: o ?? s ?? r.defaultError } : a.code !== "invalid_type" ? { message: r.defaultError } : { message: o ?? t ?? r.defaultError };
536
546
  }, description: n };
537
547
  }
538
- class v {
548
+ class b {
539
549
  get description() {
540
550
  return this._def.description;
541
551
  }
542
552
  _getType(e) {
543
- return A(e.data);
553
+ return O(e.data);
544
554
  }
545
555
  _getOrReturnCtx(e, t) {
546
556
  return t || {
547
557
  common: e.parent.common,
548
558
  data: e.data,
549
- parsedType: A(e.data),
559
+ parsedType: O(e.data),
550
560
  schemaErrorMap: this._def.errorMap,
551
561
  path: e.path,
552
562
  parent: e.parent
@@ -558,7 +568,7 @@ class v {
558
568
  ctx: {
559
569
  common: e.parent.common,
560
570
  data: e.data,
561
- parsedType: A(e.data),
571
+ parsedType: O(e.data),
562
572
  schemaErrorMap: this._def.errorMap,
563
573
  path: e.path,
564
574
  parent: e.parent
@@ -592,7 +602,7 @@ class v {
592
602
  schemaErrorMap: this._def.errorMap,
593
603
  parent: null,
594
604
  data: e,
595
- parsedType: A(e)
605
+ parsedType: O(e)
596
606
  }, n = this._parseSync({ data: e, path: s.path, parent: s });
597
607
  return we(s, n);
598
608
  }
@@ -607,7 +617,7 @@ class v {
607
617
  schemaErrorMap: this._def.errorMap,
608
618
  parent: null,
609
619
  data: e,
610
- parsedType: A(e)
620
+ parsedType: O(e)
611
621
  };
612
622
  if (!this["~standard"].async)
613
623
  try {
@@ -646,7 +656,7 @@ class v {
646
656
  schemaErrorMap: this._def.errorMap,
647
657
  parent: null,
648
658
  data: e,
649
- parsedType: A(e)
659
+ parsedType: O(e)
650
660
  }, n = this._parse({ data: e, path: s.path, parent: s }), a = await (se(n) ? n : Promise.resolve(n));
651
661
  return we(s, a);
652
662
  }
@@ -681,7 +691,7 @@ class v {
681
691
  };
682
692
  }
683
693
  optional() {
684
- return E.create(this, this._def);
694
+ return $.create(this, this._def);
685
695
  }
686
696
  nullable() {
687
697
  return D.create(this, this._def);
@@ -790,7 +800,7 @@ function pt(i, e) {
790
800
  function ft(i, e) {
791
801
  return !!((e === "v4" || !e) && it.test(i) || (e === "v6" || !e) && rt.test(i));
792
802
  }
793
- class O extends v {
803
+ class E extends b {
794
804
  _parse(e) {
795
805
  if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== h.string) {
796
806
  const n = this._getOrReturnCtx(e);
@@ -942,7 +952,7 @@ class O extends v {
942
952
  validation: "base64url",
943
953
  code: d.invalid_string,
944
954
  message: n.message
945
- }), t.dirty()) : b.assertNever(n);
955
+ }), t.dirty()) : w.assertNever(n);
946
956
  return { status: t.value, value: e.data };
947
957
  }
948
958
  _regex(e, t, s) {
@@ -953,7 +963,7 @@ class O extends v {
953
963
  });
954
964
  }
955
965
  _addCheck(e) {
956
- return new O({
966
+ return new E({
957
967
  ...this._def,
958
968
  checks: [...this._def.checks, e]
959
969
  });
@@ -1089,19 +1099,19 @@ class O extends v {
1089
1099
  return this.min(1, p.errToObj(e));
1090
1100
  }
1091
1101
  trim() {
1092
- return new O({
1102
+ return new E({
1093
1103
  ...this._def,
1094
1104
  checks: [...this._def.checks, { kind: "trim" }]
1095
1105
  });
1096
1106
  }
1097
1107
  toLowerCase() {
1098
- return new O({
1108
+ return new E({
1099
1109
  ...this._def,
1100
1110
  checks: [...this._def.checks, { kind: "toLowerCase" }]
1101
1111
  });
1102
1112
  }
1103
1113
  toUpperCase() {
1104
- return new O({
1114
+ return new E({
1105
1115
  ...this._def,
1106
1116
  checks: [...this._def.checks, { kind: "toUpperCase" }]
1107
1117
  });
@@ -1167,7 +1177,7 @@ class O extends v {
1167
1177
  return e;
1168
1178
  }
1169
1179
  }
1170
- O.create = (i) => new O({
1180
+ E.create = (i) => new E({
1171
1181
  checks: [],
1172
1182
  typeName: _.ZodString,
1173
1183
  coerce: (i == null ? void 0 : i.coerce) ?? !1,
@@ -1177,7 +1187,7 @@ function mt(i, e) {
1177
1187
  const t = (i.toString().split(".")[1] || "").length, s = (e.toString().split(".")[1] || "").length, n = t > s ? t : s, a = Number.parseInt(i.toFixed(n).replace(".", "")), r = Number.parseInt(e.toFixed(n).replace(".", ""));
1178
1188
  return a % r / 10 ** n;
1179
1189
  }
1180
- class J extends v {
1190
+ class J extends b {
1181
1191
  constructor() {
1182
1192
  super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
1183
1193
  }
@@ -1193,7 +1203,7 @@ class J extends v {
1193
1203
  let t;
1194
1204
  const s = new T();
1195
1205
  for (const n of this._def.checks)
1196
- n.kind === "int" ? b.isInteger(e.data) || (t = this._getOrReturnCtx(e, t), u(t, {
1206
+ n.kind === "int" ? w.isInteger(e.data) || (t = this._getOrReturnCtx(e, t), u(t, {
1197
1207
  code: d.invalid_type,
1198
1208
  expected: "integer",
1199
1209
  received: "float",
@@ -1219,7 +1229,7 @@ class J extends v {
1219
1229
  }), s.dirty()) : n.kind === "finite" ? Number.isFinite(e.data) || (t = this._getOrReturnCtx(e, t), u(t, {
1220
1230
  code: d.not_finite,
1221
1231
  message: n.message
1222
- }), s.dirty()) : b.assertNever(n);
1232
+ }), s.dirty()) : w.assertNever(n);
1223
1233
  return { status: s.value, value: e.data };
1224
1234
  }
1225
1235
  gte(e, t) {
@@ -1331,7 +1341,7 @@ class J extends v {
1331
1341
  return e;
1332
1342
  }
1333
1343
  get isInt() {
1334
- return !!this._def.checks.find((e) => e.kind === "int" || e.kind === "multipleOf" && b.isInteger(e.value));
1344
+ return !!this._def.checks.find((e) => e.kind === "int" || e.kind === "multipleOf" && w.isInteger(e.value));
1335
1345
  }
1336
1346
  get isFinite() {
1337
1347
  let e = null, t = null;
@@ -1349,7 +1359,7 @@ J.create = (i) => new J({
1349
1359
  coerce: (i == null ? void 0 : i.coerce) || !1,
1350
1360
  ...y(i)
1351
1361
  });
1352
- class Q extends v {
1362
+ class Q extends b {
1353
1363
  constructor() {
1354
1364
  super(...arguments), this.min = this.gte, this.max = this.lte;
1355
1365
  }
@@ -1381,7 +1391,7 @@ class Q extends v {
1381
1391
  code: d.not_multiple_of,
1382
1392
  multipleOf: n.value,
1383
1393
  message: n.message
1384
- }), s.dirty()) : b.assertNever(n);
1394
+ }), s.dirty()) : w.assertNever(n);
1385
1395
  return { status: s.value, value: e.data };
1386
1396
  }
1387
1397
  _getInvalidInput(e) {
@@ -1482,7 +1492,7 @@ Q.create = (i) => new Q({
1482
1492
  coerce: (i == null ? void 0 : i.coerce) ?? !1,
1483
1493
  ...y(i)
1484
1494
  });
1485
- class ke extends v {
1495
+ class ke extends b {
1486
1496
  _parse(e) {
1487
1497
  if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== h.boolean) {
1488
1498
  const t = this._getOrReturnCtx(e);
@@ -1500,7 +1510,7 @@ ke.create = (i) => new ke({
1500
1510
  coerce: (i == null ? void 0 : i.coerce) || !1,
1501
1511
  ...y(i)
1502
1512
  });
1503
- class ne extends v {
1513
+ class ne extends b {
1504
1514
  _parse(e) {
1505
1515
  if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== h.date) {
1506
1516
  const n = this._getOrReturnCtx(e);
@@ -1533,7 +1543,7 @@ class ne extends v {
1533
1543
  exact: !1,
1534
1544
  maximum: n.value,
1535
1545
  type: "date"
1536
- }), t.dirty()) : b.assertNever(n);
1546
+ }), t.dirty()) : w.assertNever(n);
1537
1547
  return {
1538
1548
  status: t.value,
1539
1549
  value: new Date(e.data.getTime())
@@ -1578,7 +1588,7 @@ ne.create = (i) => new ne({
1578
1588
  typeName: _.ZodDate,
1579
1589
  ...y(i)
1580
1590
  });
1581
- class xe extends v {
1591
+ class xe extends b {
1582
1592
  _parse(e) {
1583
1593
  if (this._getType(e) !== h.symbol) {
1584
1594
  const t = this._getOrReturnCtx(e);
@@ -1595,7 +1605,7 @@ xe.create = (i) => new xe({
1595
1605
  typeName: _.ZodSymbol,
1596
1606
  ...y(i)
1597
1607
  });
1598
- class Se extends v {
1608
+ class Se extends b {
1599
1609
  _parse(e) {
1600
1610
  if (this._getType(e) !== h.undefined) {
1601
1611
  const t = this._getOrReturnCtx(e);
@@ -1612,7 +1622,7 @@ Se.create = (i) => new Se({
1612
1622
  typeName: _.ZodUndefined,
1613
1623
  ...y(i)
1614
1624
  });
1615
- class Te extends v {
1625
+ class Te extends b {
1616
1626
  _parse(e) {
1617
1627
  if (this._getType(e) !== h.null) {
1618
1628
  const t = this._getOrReturnCtx(e);
@@ -1629,7 +1639,7 @@ Te.create = (i) => new Te({
1629
1639
  typeName: _.ZodNull,
1630
1640
  ...y(i)
1631
1641
  });
1632
- class le extends v {
1642
+ class le extends b {
1633
1643
  constructor() {
1634
1644
  super(...arguments), this._any = !0;
1635
1645
  }
@@ -1641,7 +1651,7 @@ le.create = (i) => new le({
1641
1651
  typeName: _.ZodAny,
1642
1652
  ...y(i)
1643
1653
  });
1644
- class Ce extends v {
1654
+ class Ce extends b {
1645
1655
  constructor() {
1646
1656
  super(...arguments), this._unknown = !0;
1647
1657
  }
@@ -1653,7 +1663,7 @@ Ce.create = (i) => new Ce({
1653
1663
  typeName: _.ZodUnknown,
1654
1664
  ...y(i)
1655
1665
  });
1656
- class j extends v {
1666
+ class j extends b {
1657
1667
  _parse(e) {
1658
1668
  const t = this._getOrReturnCtx(e);
1659
1669
  return u(t, {
@@ -1667,7 +1677,7 @@ j.create = (i) => new j({
1667
1677
  typeName: _.ZodNever,
1668
1678
  ...y(i)
1669
1679
  });
1670
- class Ie extends v {
1680
+ class Ie extends b {
1671
1681
  _parse(e) {
1672
1682
  if (this._getType(e) !== h.undefined) {
1673
1683
  const t = this._getOrReturnCtx(e);
@@ -1684,7 +1694,7 @@ Ie.create = (i) => new Ie({
1684
1694
  typeName: _.ZodVoid,
1685
1695
  ...y(i)
1686
1696
  });
1687
- class I extends v {
1697
+ class I extends b {
1688
1698
  _parse(e) {
1689
1699
  const { ctx: t, status: s } = this._processInputParams(e), n = this._def;
1690
1700
  if (t.parsedType !== h.array)
@@ -1720,8 +1730,8 @@ class I extends v {
1720
1730
  exact: !1,
1721
1731
  message: n.maxLength.message
1722
1732
  }), s.dirty()), t.common.async)
1723
- return Promise.all([...t.data].map((r, o) => n.type._parseAsync(new $(t, r, t.path, o)))).then((r) => T.mergeArray(s, r));
1724
- const a = [...t.data].map((r, o) => n.type._parseSync(new $(t, r, t.path, o)));
1733
+ return Promise.all([...t.data].map((r, o) => n.type._parseAsync(new P(t, r, t.path, o)))).then((r) => T.mergeArray(s, r));
1734
+ const a = [...t.data].map((r, o) => n.type._parseSync(new P(t, r, t.path, o)));
1725
1735
  return T.mergeArray(s, a);
1726
1736
  }
1727
1737
  get element() {
@@ -1758,29 +1768,29 @@ I.create = (i, e) => new I({
1758
1768
  ...y(e)
1759
1769
  });
1760
1770
  function M(i) {
1761
- if (i instanceof k) {
1771
+ if (i instanceof x) {
1762
1772
  const e = {};
1763
1773
  for (const t in i.shape) {
1764
1774
  const s = i.shape[t];
1765
- e[t] = E.create(M(s));
1775
+ e[t] = $.create(M(s));
1766
1776
  }
1767
- return new k({
1777
+ return new x({
1768
1778
  ...i._def,
1769
1779
  shape: () => e
1770
1780
  });
1771
1781
  } else return i instanceof I ? new I({
1772
1782
  ...i._def,
1773
1783
  type: M(i.element)
1774
- }) : i instanceof E ? E.create(M(i.unwrap())) : i instanceof D ? D.create(M(i.unwrap())) : i instanceof R ? R.create(i.items.map((e) => M(e))) : i;
1784
+ }) : i instanceof $ ? $.create(M(i.unwrap())) : i instanceof D ? D.create(M(i.unwrap())) : i instanceof R ? R.create(i.items.map((e) => M(e))) : i;
1775
1785
  }
1776
- class k extends v {
1786
+ class x extends b {
1777
1787
  constructor() {
1778
1788
  super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
1779
1789
  }
1780
1790
  _getCached() {
1781
1791
  if (this._cached !== null)
1782
1792
  return this._cached;
1783
- const e = this._def.shape(), t = b.objectKeys(e);
1793
+ const e = this._def.shape(), t = w.objectKeys(e);
1784
1794
  return this._cached = { shape: e, keys: t }, this._cached;
1785
1795
  }
1786
1796
  _parse(e) {
@@ -1801,7 +1811,7 @@ class k extends v {
1801
1811
  const l = n[c], f = s.data[c];
1802
1812
  o.push({
1803
1813
  key: { status: "valid", value: c },
1804
- value: l._parse(new $(s, f, s.path, c)),
1814
+ value: l._parse(new P(s, f, s.path, c)),
1805
1815
  alwaysSet: c in s.data
1806
1816
  });
1807
1817
  }
@@ -1826,7 +1836,7 @@ class k extends v {
1826
1836
  o.push({
1827
1837
  key: { status: "valid", value: l },
1828
1838
  value: c._parse(
1829
- new $(s, f, s.path, l)
1839
+ new P(s, f, s.path, l)
1830
1840
  //, ctx.child(key), value, getParsedType(value)
1831
1841
  ),
1832
1842
  alwaysSet: l in s.data
@@ -1836,10 +1846,10 @@ class k extends v {
1836
1846
  return s.common.async ? Promise.resolve().then(async () => {
1837
1847
  const c = [];
1838
1848
  for (const l of o) {
1839
- const f = await l.key, w = await l.value;
1849
+ const f = await l.key, v = await l.value;
1840
1850
  c.push({
1841
1851
  key: f,
1842
- value: w,
1852
+ value: v,
1843
1853
  alwaysSet: l.alwaysSet
1844
1854
  });
1845
1855
  }
@@ -1850,7 +1860,7 @@ class k extends v {
1850
1860
  return this._def.shape();
1851
1861
  }
1852
1862
  strict(e) {
1853
- return p.errToObj, new k({
1863
+ return p.errToObj, new x({
1854
1864
  ...this._def,
1855
1865
  unknownKeys: "strict",
1856
1866
  ...e !== void 0 ? {
@@ -1867,13 +1877,13 @@ class k extends v {
1867
1877
  });
1868
1878
  }
1869
1879
  strip() {
1870
- return new k({
1880
+ return new x({
1871
1881
  ...this._def,
1872
1882
  unknownKeys: "strip"
1873
1883
  });
1874
1884
  }
1875
1885
  passthrough() {
1876
- return new k({
1886
+ return new x({
1877
1887
  ...this._def,
1878
1888
  unknownKeys: "passthrough"
1879
1889
  });
@@ -1896,7 +1906,7 @@ class k extends v {
1896
1906
  // }) as any;
1897
1907
  // };
1898
1908
  extend(e) {
1899
- return new k({
1909
+ return new x({
1900
1910
  ...this._def,
1901
1911
  shape: () => ({
1902
1912
  ...this._def.shape(),
@@ -1910,7 +1920,7 @@ class k extends v {
1910
1920
  * upgrade if you are experiencing issues.
1911
1921
  */
1912
1922
  merge(e) {
1913
- return new k({
1923
+ return new x({
1914
1924
  unknownKeys: e._def.unknownKeys,
1915
1925
  catchall: e._def.catchall,
1916
1926
  shape: () => ({
@@ -1980,25 +1990,25 @@ class k extends v {
1980
1990
  // return merged;
1981
1991
  // }
1982
1992
  catchall(e) {
1983
- return new k({
1993
+ return new x({
1984
1994
  ...this._def,
1985
1995
  catchall: e
1986
1996
  });
1987
1997
  }
1988
1998
  pick(e) {
1989
1999
  const t = {};
1990
- for (const s of b.objectKeys(e))
2000
+ for (const s of w.objectKeys(e))
1991
2001
  e[s] && this.shape[s] && (t[s] = this.shape[s]);
1992
- return new k({
2002
+ return new x({
1993
2003
  ...this._def,
1994
2004
  shape: () => t
1995
2005
  });
1996
2006
  }
1997
2007
  omit(e) {
1998
2008
  const t = {};
1999
- for (const s of b.objectKeys(this.shape))
2009
+ for (const s of w.objectKeys(this.shape))
2000
2010
  e[s] || (t[s] = this.shape[s]);
2001
- return new k({
2011
+ return new x({
2002
2012
  ...this._def,
2003
2013
  shape: () => t
2004
2014
  });
@@ -2011,57 +2021,57 @@ class k extends v {
2011
2021
  }
2012
2022
  partial(e) {
2013
2023
  const t = {};
2014
- for (const s of b.objectKeys(this.shape)) {
2024
+ for (const s of w.objectKeys(this.shape)) {
2015
2025
  const n = this.shape[s];
2016
2026
  e && !e[s] ? t[s] = n : t[s] = n.optional();
2017
2027
  }
2018
- return new k({
2028
+ return new x({
2019
2029
  ...this._def,
2020
2030
  shape: () => t
2021
2031
  });
2022
2032
  }
2023
2033
  required(e) {
2024
2034
  const t = {};
2025
- for (const s of b.objectKeys(this.shape))
2035
+ for (const s of w.objectKeys(this.shape))
2026
2036
  if (e && !e[s])
2027
2037
  t[s] = this.shape[s];
2028
2038
  else {
2029
2039
  let n = this.shape[s];
2030
- for (; n instanceof E; )
2040
+ for (; n instanceof $; )
2031
2041
  n = n._def.innerType;
2032
2042
  t[s] = n;
2033
2043
  }
2034
- return new k({
2044
+ return new x({
2035
2045
  ...this._def,
2036
2046
  shape: () => t
2037
2047
  });
2038
2048
  }
2039
2049
  keyof() {
2040
- return je(b.objectKeys(this.shape));
2050
+ return Pe(w.objectKeys(this.shape));
2041
2051
  }
2042
2052
  }
2043
- k.create = (i, e) => new k({
2053
+ x.create = (i, e) => new x({
2044
2054
  shape: () => i,
2045
2055
  unknownKeys: "strip",
2046
2056
  catchall: j.create(),
2047
2057
  typeName: _.ZodObject,
2048
2058
  ...y(e)
2049
2059
  });
2050
- k.strictCreate = (i, e) => new k({
2060
+ x.strictCreate = (i, e) => new x({
2051
2061
  shape: () => i,
2052
2062
  unknownKeys: "strict",
2053
2063
  catchall: j.create(),
2054
2064
  typeName: _.ZodObject,
2055
2065
  ...y(e)
2056
2066
  });
2057
- k.lazycreate = (i, e) => new k({
2067
+ x.lazycreate = (i, e) => new x({
2058
2068
  shape: i,
2059
2069
  unknownKeys: "strip",
2060
2070
  catchall: j.create(),
2061
2071
  typeName: _.ZodObject,
2062
2072
  ...y(e)
2063
2073
  });
2064
- class ie extends v {
2074
+ class ie extends b {
2065
2075
  _parse(e) {
2066
2076
  const { ctx: t } = this._processInputParams(e), s = this._def.options;
2067
2077
  function n(a) {
@@ -2071,7 +2081,7 @@ class ie extends v {
2071
2081
  for (const o of a)
2072
2082
  if (o.result.status === "dirty")
2073
2083
  return t.common.issues.push(...o.ctx.common.issues), o.result;
2074
- const r = a.map((o) => new N(o.ctx.common.issues));
2084
+ const r = a.map((o) => new Z(o.ctx.common.issues));
2075
2085
  return u(t, {
2076
2086
  code: d.invalid_union,
2077
2087
  unionErrors: r
@@ -2118,7 +2128,7 @@ class ie extends v {
2118
2128
  }
2119
2129
  if (a)
2120
2130
  return t.common.issues.push(...a.ctx.common.issues), a.result;
2121
- const o = r.map((c) => new N(c));
2131
+ const o = r.map((c) => new Z(c));
2122
2132
  return u(t, {
2123
2133
  code: d.invalid_union,
2124
2134
  unionErrors: o
@@ -2135,11 +2145,11 @@ ie.create = (i, e) => new ie({
2135
2145
  ...y(e)
2136
2146
  });
2137
2147
  function he(i, e) {
2138
- const t = A(i), s = A(e);
2148
+ const t = O(i), s = O(e);
2139
2149
  if (i === e)
2140
2150
  return { valid: !0, data: i };
2141
2151
  if (t === h.object && s === h.object) {
2142
- const n = b.objectKeys(e), a = b.objectKeys(i).filter((o) => n.indexOf(o) !== -1), r = { ...i, ...e };
2152
+ const n = w.objectKeys(e), a = w.objectKeys(i).filter((o) => n.indexOf(o) !== -1), r = { ...i, ...e };
2143
2153
  for (const o of a) {
2144
2154
  const c = he(i[o], e[o]);
2145
2155
  if (!c.valid)
@@ -2160,7 +2170,7 @@ function he(i, e) {
2160
2170
  return { valid: !0, data: n };
2161
2171
  } else return t === h.date && s === h.date && +i == +e ? { valid: !0, data: i } : { valid: !1 };
2162
2172
  }
2163
- class ae extends v {
2173
+ class ae extends b {
2164
2174
  _parse(e) {
2165
2175
  const { status: t, ctx: s } = this._processInputParams(e), n = (a, r) => {
2166
2176
  if (ve(a) || ve(r))
@@ -2198,7 +2208,7 @@ ae.create = (i, e, t) => new ae({
2198
2208
  typeName: _.ZodIntersection,
2199
2209
  ...y(t)
2200
2210
  });
2201
- class R extends v {
2211
+ class R extends b {
2202
2212
  _parse(e) {
2203
2213
  const { status: t, ctx: s } = this._processInputParams(e);
2204
2214
  if (s.parsedType !== h.array)
@@ -2224,7 +2234,7 @@ class R extends v {
2224
2234
  }), t.dirty());
2225
2235
  const n = [...s.data].map((a, r) => {
2226
2236
  const o = this._def.items[r] || this._def.rest;
2227
- return o ? o._parse(new $(s, a, s.path, r)) : null;
2237
+ return o ? o._parse(new P(s, a, s.path, r)) : null;
2228
2238
  }).filter((a) => !!a);
2229
2239
  return s.common.async ? Promise.all(n).then((a) => T.mergeArray(t, a)) : T.mergeArray(t, n);
2230
2240
  }
@@ -2248,7 +2258,7 @@ R.create = (i, e) => {
2248
2258
  ...y(e)
2249
2259
  });
2250
2260
  };
2251
- class Ne extends v {
2261
+ class Ne extends b {
2252
2262
  get keySchema() {
2253
2263
  return this._def.keyType;
2254
2264
  }
@@ -2264,8 +2274,8 @@ class Ne extends v {
2264
2274
  received: s.parsedType
2265
2275
  }), g;
2266
2276
  const n = this._def.keyType, a = this._def.valueType, r = [...s.data.entries()].map(([o, c], l) => ({
2267
- key: n._parse(new $(s, o, s.path, [l, "key"])),
2268
- value: a._parse(new $(s, c, s.path, [l, "value"]))
2277
+ key: n._parse(new P(s, o, s.path, [l, "key"])),
2278
+ value: a._parse(new P(s, c, s.path, [l, "value"]))
2269
2279
  }));
2270
2280
  if (s.common.async) {
2271
2281
  const o = /* @__PURE__ */ new Map();
@@ -2296,7 +2306,7 @@ Ne.create = (i, e, t) => new Ne({
2296
2306
  typeName: _.ZodMap,
2297
2307
  ...y(t)
2298
2308
  });
2299
- class G extends v {
2309
+ class G extends b {
2300
2310
  _parse(e) {
2301
2311
  const { status: t, ctx: s } = this._processInputParams(e);
2302
2312
  if (s.parsedType !== h.set)
@@ -2331,7 +2341,7 @@ class G extends v {
2331
2341
  }
2332
2342
  return { status: t.value, value: l };
2333
2343
  }
2334
- const o = [...s.data.values()].map((c, l) => a._parse(new $(s, c, s.path, l)));
2344
+ const o = [...s.data.values()].map((c, l) => a._parse(new P(s, c, s.path, l)));
2335
2345
  return s.common.async ? Promise.all(o).then((c) => r(c)) : r(o);
2336
2346
  }
2337
2347
  min(e, t) {
@@ -2360,7 +2370,7 @@ G.create = (i, e) => new G({
2360
2370
  typeName: _.ZodSet,
2361
2371
  ...y(e)
2362
2372
  });
2363
- class Ze extends v {
2373
+ class Ze extends b {
2364
2374
  get schema() {
2365
2375
  return this._def.getter();
2366
2376
  }
@@ -2374,7 +2384,7 @@ Ze.create = (i, e) => new Ze({
2374
2384
  typeName: _.ZodLazy,
2375
2385
  ...y(e)
2376
2386
  });
2377
- class pe extends v {
2387
+ class pe extends b {
2378
2388
  _parse(e) {
2379
2389
  if (e.data !== this._def.value) {
2380
2390
  const t = this._getOrReturnCtx(e);
@@ -2395,19 +2405,19 @@ pe.create = (i, e) => new pe({
2395
2405
  typeName: _.ZodLiteral,
2396
2406
  ...y(e)
2397
2407
  });
2398
- function je(i, e) {
2408
+ function Pe(i, e) {
2399
2409
  return new H({
2400
2410
  values: i,
2401
2411
  typeName: _.ZodEnum,
2402
2412
  ...y(e)
2403
2413
  });
2404
2414
  }
2405
- class H extends v {
2415
+ class H extends b {
2406
2416
  _parse(e) {
2407
2417
  if (typeof e.data != "string") {
2408
2418
  const t = this._getOrReturnCtx(e), s = this._def.values;
2409
2419
  return u(t, {
2410
- expected: b.joinValues(s),
2420
+ expected: w.joinValues(s),
2411
2421
  received: t.parsedType,
2412
2422
  code: d.invalid_type
2413
2423
  }), g;
@@ -2456,20 +2466,20 @@ class H extends v {
2456
2466
  });
2457
2467
  }
2458
2468
  }
2459
- H.create = je;
2460
- class Ae extends v {
2469
+ H.create = Pe;
2470
+ class Ae extends b {
2461
2471
  _parse(e) {
2462
- const t = b.getValidEnumValues(this._def.values), s = this._getOrReturnCtx(e);
2472
+ const t = w.getValidEnumValues(this._def.values), s = this._getOrReturnCtx(e);
2463
2473
  if (s.parsedType !== h.string && s.parsedType !== h.number) {
2464
- const n = b.objectValues(t);
2474
+ const n = w.objectValues(t);
2465
2475
  return u(s, {
2466
- expected: b.joinValues(n),
2476
+ expected: w.joinValues(n),
2467
2477
  received: s.parsedType,
2468
2478
  code: d.invalid_type
2469
2479
  }), g;
2470
2480
  }
2471
- if (this._cache || (this._cache = new Set(b.getValidEnumValues(this._def.values))), !this._cache.has(e.data)) {
2472
- const n = b.objectValues(t);
2481
+ if (this._cache || (this._cache = new Set(w.getValidEnumValues(this._def.values))), !this._cache.has(e.data)) {
2482
+ const n = w.objectValues(t);
2473
2483
  return u(s, {
2474
2484
  received: s.data,
2475
2485
  code: d.invalid_enum_value,
@@ -2487,7 +2497,7 @@ Ae.create = (i, e) => new Ae({
2487
2497
  typeName: _.ZodNativeEnum,
2488
2498
  ...y(e)
2489
2499
  });
2490
- class re extends v {
2500
+ class re extends b {
2491
2501
  unwrap() {
2492
2502
  return this._def.type;
2493
2503
  }
@@ -2511,7 +2521,7 @@ re.create = (i, e) => new re({
2511
2521
  typeName: _.ZodPromise,
2512
2522
  ...y(e)
2513
2523
  });
2514
- class L extends v {
2524
+ class L extends b {
2515
2525
  innerType() {
2516
2526
  return this._def.schema;
2517
2527
  }
@@ -2588,7 +2598,7 @@ class L extends v {
2588
2598
  status: t.value,
2589
2599
  value: o
2590
2600
  })) : g);
2591
- b.assertNever(n);
2601
+ w.assertNever(n);
2592
2602
  }
2593
2603
  }
2594
2604
  L.create = (i, e, t) => new L({
@@ -2603,7 +2613,7 @@ L.createWithPreprocess = (i, e, t) => new L({
2603
2613
  typeName: _.ZodEffects,
2604
2614
  ...y(t)
2605
2615
  });
2606
- class E extends v {
2616
+ class $ extends b {
2607
2617
  _parse(e) {
2608
2618
  return this._getType(e) === h.undefined ? C(void 0) : this._def.innerType._parse(e);
2609
2619
  }
@@ -2611,12 +2621,12 @@ class E extends v {
2611
2621
  return this._def.innerType;
2612
2622
  }
2613
2623
  }
2614
- E.create = (i, e) => new E({
2624
+ $.create = (i, e) => new $({
2615
2625
  innerType: i,
2616
2626
  typeName: _.ZodOptional,
2617
2627
  ...y(e)
2618
2628
  });
2619
- class D extends v {
2629
+ class D extends b {
2620
2630
  _parse(e) {
2621
2631
  return this._getType(e) === h.null ? C(null) : this._def.innerType._parse(e);
2622
2632
  }
@@ -2629,7 +2639,7 @@ D.create = (i, e) => new D({
2629
2639
  typeName: _.ZodNullable,
2630
2640
  ...y(e)
2631
2641
  });
2632
- class fe extends v {
2642
+ class fe extends b {
2633
2643
  _parse(e) {
2634
2644
  const { ctx: t } = this._processInputParams(e);
2635
2645
  let s = t.data;
@@ -2649,7 +2659,7 @@ fe.create = (i, e) => new fe({
2649
2659
  defaultValue: typeof e.default == "function" ? e.default : () => e.default,
2650
2660
  ...y(e)
2651
2661
  });
2652
- class me extends v {
2662
+ class me extends b {
2653
2663
  _parse(e) {
2654
2664
  const { ctx: t } = this._processInputParams(e), s = {
2655
2665
  ...t,
@@ -2668,7 +2678,7 @@ class me extends v {
2668
2678
  status: "valid",
2669
2679
  value: a.status === "valid" ? a.value : this._def.catchValue({
2670
2680
  get error() {
2671
- return new N(s.common.issues);
2681
+ return new Z(s.common.issues);
2672
2682
  },
2673
2683
  input: s.data
2674
2684
  })
@@ -2676,7 +2686,7 @@ class me extends v {
2676
2686
  status: "valid",
2677
2687
  value: n.status === "valid" ? n.value : this._def.catchValue({
2678
2688
  get error() {
2679
- return new N(s.common.issues);
2689
+ return new Z(s.common.issues);
2680
2690
  },
2681
2691
  input: s.data
2682
2692
  })
@@ -2692,7 +2702,7 @@ me.create = (i, e) => new me({
2692
2702
  catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
2693
2703
  ...y(e)
2694
2704
  });
2695
- class Oe extends v {
2705
+ class Oe extends b {
2696
2706
  _parse(e) {
2697
2707
  if (this._getType(e) !== h.nan) {
2698
2708
  const t = this._getOrReturnCtx(e);
@@ -2709,7 +2719,7 @@ Oe.create = (i) => new Oe({
2709
2719
  typeName: _.ZodNaN,
2710
2720
  ...y(i)
2711
2721
  });
2712
- class _t extends v {
2722
+ class _t extends b {
2713
2723
  _parse(e) {
2714
2724
  const { ctx: t } = this._processInputParams(e), s = t.data;
2715
2725
  return this._def.type._parse({
@@ -2722,7 +2732,7 @@ class _t extends v {
2722
2732
  return this._def.type;
2723
2733
  }
2724
2734
  }
2725
- class ge extends v {
2735
+ class ge extends b {
2726
2736
  _parse(e) {
2727
2737
  const { status: t, ctx: s } = this._processInputParams(e);
2728
2738
  if (s.common.async)
@@ -2762,7 +2772,7 @@ class ge extends v {
2762
2772
  });
2763
2773
  }
2764
2774
  }
2765
- class _e extends v {
2775
+ class _e extends b {
2766
2776
  _parse(e) {
2767
2777
  const t = this._def.innerType._parse(e), s = (n) => (q(n) && (n.value = Object.freeze(n.value)), n);
2768
2778
  return se(t) ? t.then((n) => s(n)) : s(t);
@@ -2780,36 +2790,36 @@ var _;
2780
2790
  (function(i) {
2781
2791
  i.ZodString = "ZodString", i.ZodNumber = "ZodNumber", i.ZodNaN = "ZodNaN", i.ZodBigInt = "ZodBigInt", i.ZodBoolean = "ZodBoolean", i.ZodDate = "ZodDate", i.ZodSymbol = "ZodSymbol", i.ZodUndefined = "ZodUndefined", i.ZodNull = "ZodNull", i.ZodAny = "ZodAny", i.ZodUnknown = "ZodUnknown", i.ZodNever = "ZodNever", i.ZodVoid = "ZodVoid", i.ZodArray = "ZodArray", i.ZodObject = "ZodObject", i.ZodUnion = "ZodUnion", i.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", i.ZodIntersection = "ZodIntersection", i.ZodTuple = "ZodTuple", i.ZodRecord = "ZodRecord", i.ZodMap = "ZodMap", i.ZodSet = "ZodSet", i.ZodFunction = "ZodFunction", i.ZodLazy = "ZodLazy", i.ZodLiteral = "ZodLiteral", i.ZodEnum = "ZodEnum", i.ZodEffects = "ZodEffects", i.ZodNativeEnum = "ZodNativeEnum", i.ZodOptional = "ZodOptional", i.ZodNullable = "ZodNullable", i.ZodDefault = "ZodDefault", i.ZodCatch = "ZodCatch", i.ZodPromise = "ZodPromise", i.ZodBranded = "ZodBranded", i.ZodPipeline = "ZodPipeline", i.ZodReadonly = "ZodReadonly";
2782
2792
  })(_ || (_ = {}));
2783
- const Z = O.create, Pe = le.create;
2793
+ const A = E.create, je = le.create;
2784
2794
  j.create;
2785
2795
  I.create;
2786
- const Re = k.create;
2796
+ const Re = x.create;
2787
2797
  ie.create;
2788
2798
  ae.create;
2789
2799
  R.create;
2790
2800
  const Fe = pe.create, gt = H.create;
2791
2801
  re.create;
2792
- E.create;
2802
+ $.create;
2793
2803
  D.create;
2794
2804
  const yt = Re({
2795
2805
  type: Fe("bridge"),
2796
- name: Z(),
2797
- data: Pe()
2806
+ name: A(),
2807
+ data: je()
2798
2808
  });
2799
- function Pt(i) {
2809
+ function jt(i) {
2800
2810
  return { ...i, type: "bridge" };
2801
2811
  }
2802
2812
  const vt = Re({
2803
2813
  type: Fe("client"),
2804
- telemetrySdkVersion: Z(),
2805
- applicationSpecifier: Z(),
2806
- applicationInstance: Z(),
2814
+ telemetrySdkVersion: A(),
2815
+ applicationSpecifier: A(),
2816
+ applicationInstance: A(),
2807
2817
  runtime: gt(["window", "worker"]),
2808
- name: Z(),
2809
- data: Pe(),
2810
- responseName: Z().optional(),
2811
- subscriptionName: Z().optional(),
2812
- unsubscribeName: Z().optional()
2818
+ name: A(),
2819
+ data: je(),
2820
+ responseName: A().optional(),
2821
+ subscriptionName: A().optional(),
2822
+ unsubscribeName: A().optional()
2813
2823
  });
2814
2824
  function Y(i) {
2815
2825
  return { ...i, type: "client" };
@@ -3066,10 +3076,10 @@ class xt {
3066
3076
  integrity: e.integrity
3067
3077
  }));
3068
3078
  let a = {};
3069
- t != null && t.headers && (t.headers instanceof Headers ? t.headers.forEach((f, w) => {
3070
- a[w] = f;
3071
- }) : Array.isArray(t.headers) ? t.headers.forEach(([f, w]) => {
3072
- a[f] = w;
3079
+ t != null && t.headers && (t.headers instanceof Headers ? t.headers.forEach((f, v) => {
3080
+ a[v] = f;
3081
+ }) : Array.isArray(t.headers) ? t.headers.forEach(([f, v]) => {
3082
+ a[f] = v;
3073
3083
  }) : a = t.headers);
3074
3084
  const r = await this._client.request("proxy.fetch", {
3075
3085
  url: n,
@@ -3089,10 +3099,10 @@ class xt {
3089
3099
  let l = null;
3090
3100
  if (r.body !== null && r.body !== void 0)
3091
3101
  if (r.bodyType === "binary") {
3092
- const f = atob(r.body), w = new Uint8Array(f.length);
3093
- for (let S = 0; S < f.length; S++)
3094
- w[S] = f.charCodeAt(S);
3095
- l = w;
3102
+ const f = atob(r.body), v = new Uint8Array(f.length);
3103
+ for (let k = 0; k < f.length; k++)
3104
+ v[k] = f.charCodeAt(k);
3105
+ l = v;
3096
3106
  } else r.bodyType === "text" ? l = r.body : r.bodyType === "json" && (l = JSON.stringify(r.body));
3097
3107
  return new Response(l, c);
3098
3108
  }
@@ -3649,23 +3659,23 @@ class At {
3649
3659
  if (r.data.type === "client") {
3650
3660
  const c = vt.safeParse(r.data);
3651
3661
  if (!c.success) {
3652
- const S = r.data;
3653
- S && typeof S == "object" && S.type === "client" && console.warn("[sdk-client] Received a message that looks like a client message but failed schema validation. This may indicate a version mismatch between the SDK and the host environment.", c.error.issues);
3662
+ const k = r.data;
3663
+ k && typeof k == "object" && k.type === "client" && console.warn("[sdk-client] Received a message that looks like a client message but failed schema validation. This may indicate a version mismatch between the SDK and the host environment.", c.error.issues);
3654
3664
  return;
3655
3665
  }
3656
3666
  const l = c.data, f = this._messageInterceptors.get(l.name);
3657
3667
  if (!f)
3658
3668
  return U(l);
3659
- let w;
3669
+ let v;
3660
3670
  try {
3661
- w = f(l);
3662
- } catch (S) {
3663
- console.error(`Error in interceptor for message ${l.name}:`, S);
3671
+ v = f(l);
3672
+ } catch (k) {
3673
+ console.error(`Error in interceptor for message ${l.name}:`, k);
3664
3674
  }
3665
- if (!w)
3675
+ if (!v)
3666
3676
  return;
3667
3677
  o = {
3668
- ...w,
3678
+ ...v,
3669
3679
  type: "bridge",
3670
3680
  ...r.data.responseName ? { name: r.data.responseName } : {}
3671
3681
  };
@@ -3673,18 +3683,18 @@ class At {
3673
3683
  if (!o) {
3674
3684
  const c = yt.safeParse(r.data);
3675
3685
  if (!c.success) {
3676
- const w = r.data;
3677
- w && typeof w == "object" && w.type === "bridge" && console.warn("[sdk-client] Received a message that looks like a bridge message but failed schema validation. This may indicate a version mismatch between the SDK and the host environment.", c.error.issues);
3686
+ const v = r.data;
3687
+ v && typeof v == "object" && v.type === "bridge" && console.warn("[sdk-client] Received a message that looks like a bridge message but failed schema validation. This may indicate a version mismatch between the SDK and the host environment.", c.error.issues);
3678
3688
  return;
3679
3689
  }
3680
3690
  o = c.data;
3681
3691
  const l = this._onHandlers.get(o.name), f = this._onceHandlers.get(o.name);
3682
3692
  if (l)
3683
- for (const w of l)
3684
- w(o.data);
3693
+ for (const v of l)
3694
+ v(o.data);
3685
3695
  if (f) {
3686
- for (const w of f)
3687
- w(o.data);
3696
+ for (const v of f)
3697
+ v(o.data);
3688
3698
  this._onceHandlers.delete(o.name);
3689
3699
  }
3690
3700
  }
@@ -3768,20 +3778,20 @@ class At {
3768
3778
  U(r);
3769
3779
  const o = (n = s == null ? void 0 : s.timeout) !== null && n !== void 0 ? n : B;
3770
3780
  let c = !1, l;
3771
- const f = new Promise((S) => {
3772
- l = (P) => {
3773
- c || S(P);
3781
+ const f = new Promise((k) => {
3782
+ l = (N) => {
3783
+ c || k(N);
3774
3784
  }, this.once(a, l);
3775
3785
  });
3776
3786
  if (o === 0)
3777
3787
  return f;
3778
- const w = new Promise((S, P) => {
3788
+ const v = new Promise((k, N) => {
3779
3789
  const V = new Error(`${e} message request with response name of ${a} timed out after ${o}`);
3780
3790
  setTimeout(() => {
3781
- c = !0, this.off(a, l), P(V);
3791
+ c = !0, this.off(a, l), N(V);
3782
3792
  }, o);
3783
3793
  });
3784
- return Promise.race([w, f]);
3794
+ return Promise.race([v, f]);
3785
3795
  }
3786
3796
  async subscribe(e, t, s) {
3787
3797
  let n, a;
@@ -3800,18 +3810,18 @@ class At {
3800
3810
  subscriptionName: r
3801
3811
  });
3802
3812
  U(l);
3803
- let f = !1, w;
3804
- const S = new Promise((V, F) => {
3813
+ let f = !1, v;
3814
+ const k = new Promise((V, F) => {
3805
3815
  const z = new Error(`${e} subscribe request with subscription name of ${r} and response name of ${o} timed out after ${B}`);
3806
3816
  setTimeout(() => {
3807
- f = !0, this.off(o, w), F(z);
3817
+ f = !0, this.off(o, v), F(z);
3808
3818
  }, B);
3809
- }), P = new Promise((V) => {
3810
- w = (F) => {
3819
+ }), N = new Promise((V) => {
3820
+ v = (F) => {
3811
3821
  f || V(F);
3812
- }, this.once(o, w);
3822
+ }, this.once(o, v);
3813
3823
  });
3814
- return Promise.race([S, P]);
3824
+ return Promise.race([k, N]);
3815
3825
  }
3816
3826
  async unsubscribe(e, t, s) {
3817
3827
  let n, a;
@@ -3838,18 +3848,18 @@ class At {
3838
3848
  unsubscribeName: c
3839
3849
  });
3840
3850
  U(l);
3841
- let f = !1, w;
3842
- const S = new Promise((F, z) => {
3851
+ let f = !1, v;
3852
+ const k = new Promise((F, z) => {
3843
3853
  const qe = new Error(`${e} unsubscribe request with unsubscribe name of ${c} and response name of ${r} timed out after ${B}`);
3844
3854
  setTimeout(() => {
3845
- f = !0, this.off(r, w), z(qe);
3855
+ f = !0, this.off(r, v), z(qe);
3846
3856
  }, B);
3847
- }), P = new Promise((F) => {
3848
- w = (z) => {
3857
+ }), N = new Promise((F) => {
3858
+ v = (z) => {
3849
3859
  f || F(z);
3850
- }, this.once(r, w);
3860
+ }, this.once(r, v);
3851
3861
  });
3852
- if (!(await Promise.race([S, P])).success)
3862
+ if (!(await Promise.race([k, N])).success)
3853
3863
  return { success: !1 };
3854
3864
  }
3855
3865
  return { success: !0 };
@@ -4011,20 +4021,20 @@ class $t {
4011
4021
  *
4012
4022
  * @returns A promise resolving to the iframe element or null
4013
4023
  */
4014
- async frame() {
4015
- return new Promise((e) => {
4024
+ async frame(e) {
4025
+ return new Promise((t) => {
4016
4026
  if (this._iframe)
4017
- return e(this._iframe);
4027
+ return t(this._iframe);
4018
4028
  if (this._status === "ready")
4019
- return this._iframe = this._buildIframe(), e(this._iframe);
4020
- let t;
4021
- const s = (n) => {
4022
- if (n === "ready")
4023
- return t(), this._iframe = this._buildIframe(), e(this._iframe);
4024
- if (n === "unloaded")
4025
- return t(), e(null);
4029
+ return this._iframe = this._buildIframe(e), t(this._iframe);
4030
+ let s;
4031
+ const n = (a) => {
4032
+ if (a === "ready")
4033
+ return s(), this._iframe = this._buildIframe(e), t(this._iframe);
4034
+ if (a === "unloaded")
4035
+ return s(), t(null);
4026
4036
  };
4027
- t = this.onStatus(s);
4037
+ s = this.onStatus(n);
4028
4038
  });
4029
4039
  }
4030
4040
  /**
@@ -4038,15 +4048,18 @@ class $t {
4038
4048
  this._onStatusHandlers.delete(e);
4039
4049
  };
4040
4050
  }
4041
- _buildIframe() {
4042
- var e, t;
4043
- const s = (t = (e = this._application) === null || e === void 0 ? void 0 : e.versions) === null || t === void 0 ? void 0 : t[0], n = s == null ? void 0 : s.baseUrl;
4044
- if (!n)
4051
+ _buildIframe(e) {
4052
+ var t, s, n, a, r, o;
4053
+ const c = (s = (t = this._application) === null || t === void 0 ? void 0 : t.versions) === null || s === void 0 ? void 0 : s[0], l = c == null ? void 0 : c.baseUrl;
4054
+ if (!l)
4045
4055
  return console.error(`No baseUrl for dependency ${this._specifier}:${this._instanceId}`), null;
4046
- const a = new URL(n);
4047
- a.searchParams.set("applicationSpecifier", this._specifier), a.searchParams.set("applicationInstance", this._instanceId), a.searchParams.set("deviceId", this._store._client.deviceId);
4048
- const r = document.createElement("iframe");
4049
- return r.src = a.toString(), r;
4056
+ const f = new URL(l), v = (o = (n = e == null ? void 0 : e.path) !== null && n !== void 0 ? n : (r = (a = c == null ? void 0 : c.mountPoints) === null || a === void 0 ? void 0 : a.find((N) => N.name === (e == null ? void 0 : e.mountPoint))) === null || r === void 0 ? void 0 : r.path) !== null && o !== void 0 ? o : (
4057
+ // TODO: Replace with a blob URL placeholder when no mount point is found
4058
+ "/"
4059
+ );
4060
+ f.pathname = v.startsWith("/") ? v : `/${v}`, f.searchParams.set("applicationSpecifier", this._specifier), f.searchParams.set("applicationInstance", this._instanceId), f.searchParams.set("deviceId", this._store._client.deviceId);
4061
+ const k = document.createElement("iframe");
4062
+ return k.src = f.toString(), k;
4050
4063
  }
4051
4064
  /**
4052
4065
  * Resets the iframe by clearing it, requesting the host to clean up
@@ -4102,69 +4115,69 @@ function Rt() {
4102
4115
  return m;
4103
4116
  }
4104
4117
  function Ft(i) {
4105
- jt(), m = new At(), m.bind();
4118
+ Pt(), m = new At(), m.bind();
4106
4119
  }
4107
- function jt() {
4120
+ function Pt() {
4108
4121
  m == null || m.unbind(), m = null;
4109
4122
  }
4110
4123
  function Mt(...i) {
4111
- return x(m), m.on(...i);
4124
+ return S(m), m.on(...i);
4112
4125
  }
4113
4126
  function qt(...i) {
4114
- return x(m), m.once(...i);
4127
+ return S(m), m.once(...i);
4115
4128
  }
4116
4129
  function Ht(...i) {
4117
- return x(m), m.off(...i);
4130
+ return S(m), m.off(...i);
4118
4131
  }
4119
4132
  function Lt(...i) {
4120
- return x(m), m.send(...i);
4133
+ return S(m), m.send(...i);
4121
4134
  }
4122
4135
  function Dt(...i) {
4123
- return x(m), m.request(...i);
4136
+ return S(m), m.request(...i);
4124
4137
  }
4125
4138
  function Vt(...i) {
4126
- return x(m), m.subscribe(...i);
4139
+ return S(m), m.subscribe(...i);
4127
4140
  }
4128
4141
  function zt(...i) {
4129
- return x(m), m.unsubscribe(...i);
4142
+ return S(m), m.unsubscribe(...i);
4130
4143
  }
4131
4144
  function Bt() {
4132
- return x(m), m.store;
4145
+ return S(m), m.store;
4133
4146
  }
4134
4147
  function Ut() {
4135
- return x(m), m.applications;
4148
+ return S(m), m.applications;
4136
4149
  }
4137
4150
  function Kt() {
4138
- return x(m), m.media;
4151
+ return S(m), m.media;
4139
4152
  }
4140
4153
  function Wt() {
4141
- return x(m), m.accounts;
4154
+ return S(m), m.accounts;
4142
4155
  }
4143
4156
  function Jt() {
4144
- return x(m), m.users;
4157
+ return S(m), m.users;
4145
4158
  }
4146
4159
  function Qt() {
4147
- return x(m), m.devices;
4160
+ return S(m), m.devices;
4148
4161
  }
4149
4162
  function Gt() {
4150
- return x(m), m.proxy;
4163
+ return S(m), m.proxy;
4151
4164
  }
4152
4165
  function Yt() {
4153
- return x(m), m.rootSettingsNavigation;
4166
+ return S(m), m.rootSettingsNavigation;
4154
4167
  }
4155
4168
  function Xt() {
4156
- return x(m), m.weather;
4169
+ return S(m), m.weather;
4157
4170
  }
4158
4171
  function es() {
4159
- return x(m), m.currency;
4172
+ return S(m), m.currency;
4160
4173
  }
4161
4174
  function ts() {
4162
- return x(m), m.environment;
4175
+ return S(m), m.environment;
4163
4176
  }
4164
4177
  function ss() {
4165
- return x(m), m.mqtt;
4178
+ return S(m), m.mqtt;
4166
4179
  }
4167
- function x(i) {
4180
+ function S(i) {
4168
4181
  if (!i)
4169
4182
  throw new Error("SDK is not configured");
4170
4183
  }
@@ -4190,10 +4203,10 @@ export {
4190
4203
  vt as clientMessageValidator,
4191
4204
  Ft as configure,
4192
4205
  es as currency,
4193
- jt as destroy,
4206
+ Pt as destroy,
4194
4207
  Qt as devices,
4195
4208
  ts as environment,
4196
- Pt as formatBridgeMessage,
4209
+ jt as formatBridgeMessage,
4197
4210
  Y as formatClientMessage,
4198
4211
  Rt as globalClient,
4199
4212
  Kt as media,