storybook 9.0.0-alpha.2 → 9.0.0-alpha.21

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.
Files changed (162) hide show
  1. package/README.md +1 -1
  2. package/assets/docs/addon-backgrounds.gif +0 -0
  3. package/assets/docs/addon-controls-args-annotated.png +0 -0
  4. package/assets/docs/addon-controls-args-background-color.png +0 -0
  5. package/assets/docs/addon-controls-args-background-string.png +0 -0
  6. package/assets/docs/addon-controls-args-docs.png +0 -0
  7. package/assets/docs/addon-controls-args-logging.png +0 -0
  8. package/assets/docs/addon-controls-args-no-annotation.png +0 -0
  9. package/assets/docs/addon-controls-args-reflow-slider.png +0 -0
  10. package/assets/docs/addon-controls-args-reflow.png +0 -0
  11. package/assets/docs/addon-controls-args-template.png +0 -0
  12. package/assets/docs/addon-controls-expanded.png +0 -0
  13. package/assets/docs/addon-controls-hero.gif +0 -0
  14. package/assets/docs/addon-controls-install.png +0 -0
  15. package/assets/docs/hero.gif +0 -0
  16. package/assets/docs/highlight.png +0 -0
  17. package/assets/docs/viewport.png +0 -0
  18. package/assets/server/base-preview-head.html +1 -3
  19. package/bin/index.cjs +2 -2
  20. package/dist/actions/decorator.d.ts +6 -0
  21. package/dist/actions/decorator.js +134 -0
  22. package/dist/actions/index.cjs +123 -0
  23. package/dist/actions/index.d.ts +102 -0
  24. package/dist/actions/index.js +108 -0
  25. package/dist/actions/preview.cjs +161 -0
  26. package/dist/actions/preview.d.ts +54 -0
  27. package/dist/actions/preview.js +152 -0
  28. package/dist/babel/index.cjs +822 -816
  29. package/dist/babel/index.js +822 -816
  30. package/dist/backgrounds/index.cjs +148 -0
  31. package/dist/backgrounds/index.d.ts +91 -0
  32. package/dist/backgrounds/index.js +130 -0
  33. package/dist/backgrounds/preview.cjs +143 -0
  34. package/dist/backgrounds/preview.d.ts +54 -0
  35. package/dist/backgrounds/preview.js +127 -0
  36. package/dist/bin/index.cjs +49 -70
  37. package/dist/bin/index.js +49 -70
  38. package/dist/builder-manager/index.cjs +319 -326
  39. package/dist/builder-manager/index.js +576 -583
  40. package/dist/channels/index.cjs +1026 -981
  41. package/dist/channels/index.js +1258 -1207
  42. package/dist/cli/bin/index.cjs +483 -483
  43. package/dist/cli/bin/index.js +495 -495
  44. package/dist/cli/index.cjs +61735 -7590
  45. package/dist/cli/index.d.ts +25 -21
  46. package/dist/cli/index.js +61776 -7631
  47. package/dist/client-logger/index.cjs +56 -88
  48. package/dist/client-logger/index.js +41 -47
  49. package/dist/common/index.cjs +16137 -9085
  50. package/dist/common/index.d.ts +35 -30
  51. package/dist/common/index.js +16230 -9172
  52. package/dist/component-testing/index.cjs +23 -0
  53. package/dist/component-testing/index.d.ts +3 -0
  54. package/dist/component-testing/index.js +5 -0
  55. package/dist/component-testing/preview.cjs +40 -0
  56. package/dist/component-testing/preview.d.ts +5 -0
  57. package/dist/component-testing/preview.js +25 -0
  58. package/dist/components/index.cjs +16268 -24926
  59. package/dist/components/index.d.ts +98 -347
  60. package/dist/components/index.js +5905 -19177
  61. package/dist/controls/decorator.d.ts +5 -0
  62. package/dist/controls/decorator.js +8 -0
  63. package/dist/controls/index.cjs +26 -0
  64. package/dist/controls/index.d.ts +39 -0
  65. package/dist/controls/index.js +6 -0
  66. package/dist/controls/preview.cjs +26 -0
  67. package/dist/controls/preview.d.ts +54 -0
  68. package/dist/controls/preview.js +9 -0
  69. package/dist/core-events/index.cjs +91 -106
  70. package/dist/core-events/index.d.ts +139 -104
  71. package/dist/core-events/index.js +79 -94
  72. package/dist/core-server/index.cjs +13898 -13409
  73. package/dist/core-server/index.d.ts +270 -3
  74. package/dist/core-server/index.js +13981 -13497
  75. package/dist/core-server/presets/common-manager.css +170 -0
  76. package/dist/core-server/presets/common-manager.js +12149 -17
  77. package/dist/core-server/presets/common-preset.cjs +3009 -3155
  78. package/dist/core-server/presets/common-preset.js +2862 -3009
  79. package/dist/csf/index.cjs +76 -120
  80. package/dist/csf/index.d.ts +2 -6
  81. package/dist/csf/index.js +69 -113
  82. package/dist/csf-tools/index.cjs +412 -403
  83. package/dist/csf-tools/index.d.ts +0 -4
  84. package/dist/csf-tools/index.js +410 -401
  85. package/dist/docs-tools/index.cjs +2569 -575
  86. package/dist/docs-tools/index.d.ts +2 -2
  87. package/dist/docs-tools/index.js +2565 -564
  88. package/dist/highlight/index.cjs +27 -0
  89. package/dist/highlight/index.d.ts +61 -0
  90. package/dist/highlight/index.js +7 -0
  91. package/dist/highlight/preview.cjs +535 -0
  92. package/dist/highlight/preview.d.ts +54 -0
  93. package/dist/highlight/preview.js +519 -0
  94. package/dist/instrumenter/index.cjs +2207 -2342
  95. package/dist/instrumenter/index.d.ts +8 -7
  96. package/dist/instrumenter/index.js +2430 -2603
  97. package/dist/manager/globals-module-info.cjs +291 -151
  98. package/dist/manager/globals-module-info.d.ts +1 -1
  99. package/dist/manager/globals-module-info.js +275 -135
  100. package/dist/manager/globals-runtime.js +60263 -28383
  101. package/dist/manager/globals.cjs +23 -19
  102. package/dist/manager/globals.d.ts +8 -5
  103. package/dist/manager/globals.js +10 -6
  104. package/dist/manager/runtime.js +4625 -3921
  105. package/dist/manager-api/index.cjs +4228 -3833
  106. package/dist/manager-api/index.d.ts +398 -102
  107. package/dist/manager-api/index.js +3500 -3084
  108. package/dist/manager-errors.d.ts +25 -1
  109. package/dist/manager-errors.js +50 -30
  110. package/dist/measure/index.cjs +476 -0
  111. package/dist/measure/index.d.ts +66 -0
  112. package/dist/measure/index.js +464 -0
  113. package/dist/measure/preview.cjs +466 -0
  114. package/dist/measure/preview.d.ts +59 -0
  115. package/dist/measure/preview.js +450 -0
  116. package/dist/outline/index.cjs +528 -0
  117. package/dist/outline/index.d.ts +66 -0
  118. package/dist/outline/index.js +500 -0
  119. package/dist/outline/preview.cjs +518 -0
  120. package/dist/outline/preview.d.ts +59 -0
  121. package/dist/outline/preview.js +486 -0
  122. package/dist/preview/globals.cjs +21 -17
  123. package/dist/preview/globals.d.ts +4 -1
  124. package/dist/preview/globals.js +6 -2
  125. package/dist/preview/runtime.js +46311 -6614
  126. package/dist/preview-api/index.cjs +1363 -1899
  127. package/dist/preview-api/index.d.ts +81 -395
  128. package/dist/preview-api/index.js +1711 -2169
  129. package/dist/preview-errors.cjs +119 -88
  130. package/dist/preview-errors.d.ts +30 -2
  131. package/dist/preview-errors.js +192 -142
  132. package/dist/router/index.cjs +847 -871
  133. package/dist/router/index.js +193 -199
  134. package/dist/server-errors.cjs +188 -124
  135. package/dist/server-errors.d.ts +36 -2
  136. package/dist/server-errors.js +188 -124
  137. package/dist/telemetry/index.cjs +1056 -1979
  138. package/dist/telemetry/index.d.ts +26 -5
  139. package/dist/telemetry/index.js +1091 -2010
  140. package/dist/test/index.cjs +35686 -0
  141. package/dist/test/index.d.ts +186 -0
  142. package/dist/test/index.js +33840 -0
  143. package/dist/test/preview.cjs +15870 -0
  144. package/dist/test/preview.d.ts +48 -0
  145. package/dist/test/preview.js +14501 -0
  146. package/dist/test/spy.cjs +258 -0
  147. package/dist/test/spy.d.ts +66 -0
  148. package/dist/test/spy.js +240 -0
  149. package/dist/theming/create.cjs +79 -2269
  150. package/dist/theming/create.js +67 -841
  151. package/dist/theming/index.cjs +1065 -3232
  152. package/dist/theming/index.js +951 -1719
  153. package/dist/types/index.cjs +11 -12
  154. package/dist/types/index.d.ts +684 -163
  155. package/dist/types/index.js +1 -2
  156. package/dist/viewport/index.cjs +310 -0
  157. package/dist/viewport/index.d.ts +320 -0
  158. package/dist/viewport/index.js +290 -0
  159. package/dist/viewport/preview.cjs +35 -0
  160. package/dist/viewport/preview.d.ts +68 -0
  161. package/dist/viewport/preview.js +19 -0
  162. package/package.json +359 -12
@@ -1,247 +1,85 @@
1
- var ae = Object.create;
2
- var ut = Object.defineProperty;
3
- var se = Object.getOwnPropertyDescriptor;
4
- var le = Object.getOwnPropertyNames;
5
- var ce = Object.getPrototypeOf, pe = Object.prototype.hasOwnProperty;
6
- var a = (r, t) => ut(r, "name", { value: t, configurable: !0 }), H = /* @__PURE__ */ ((r) => typeof require < "u" ? require : typeof Proxy <
7
- "u" ? new Proxy(r, {
8
- get: (t, e) => (typeof require < "u" ? require : t)[e]
9
- }) : r)(function(r) {
10
- if (typeof require < "u") return require.apply(this, arguments);
11
- throw Error('Dynamic require of "' + r + '" is not supported');
12
- });
13
- var ue = (r, t) => () => (t || r((t = { exports: {} }).exports, t), t.exports);
14
- var fe = (r, t, e, n) => {
15
- if (t && typeof t == "object" || typeof t == "function")
16
- for (let o of le(t))
17
- !pe.call(r, o) && o !== e && ut(r, o, { get: () => t[o], enumerable: !(n = se(t, o)) || n.enumerable });
18
- return r;
19
- };
20
- var he = (r, t, e) => (e = r != null ? ae(ce(r)) : {}, fe(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- t || !r || !r.__esModule ? ut(e, "default", { value: r, enumerable: !0 }) : e,
26
- r
27
- ));
1
+ var xt = Object.defineProperty;
2
+ var s = (t, e) => xt(t, "name", { value: e, configurable: !0 });
28
3
 
29
- // ../node_modules/memoizerific/memoizerific.js
30
- var xt = ue((It, yt) => {
31
- (function(r) {
32
- if (typeof It == "object" && typeof yt < "u")
33
- yt.exports = r();
34
- else if (typeof define == "function" && define.amd)
35
- define([], r);
36
- else {
37
- var t;
38
- typeof window < "u" ? t = window : typeof global < "u" ? t = global : typeof self < "u" ? t = self : t = this, t.memoizerific = r();
39
- }
40
- })(function() {
41
- var r, t, e;
42
- return (/* @__PURE__ */ a(function n(o, s, l) {
43
- function c(p, u) {
44
- if (!s[p]) {
45
- if (!o[p]) {
46
- var y = typeof H == "function" && H;
47
- if (!u && y) return y(p, !0);
48
- if (i) return i(p, !0);
49
- var v = new Error("Cannot find module '" + p + "'");
50
- throw v.code = "MODULE_NOT_FOUND", v;
51
- }
52
- var d = s[p] = { exports: {} };
53
- o[p][0].call(d.exports, function(m) {
54
- var E = o[p][1][m];
55
- return c(E || m);
56
- }, d, d.exports, n, o, s, l);
57
- }
58
- return s[p].exports;
59
- }
60
- a(c, "s");
61
- for (var i = typeof H == "function" && H, g = 0; g < l.length; g++) c(l[g]);
62
- return c;
63
- }, "e"))({ 1: [function(n, o, s) {
64
- o.exports = function(l) {
65
- if (typeof Map != "function" || l) {
66
- var c = n("./similar");
67
- return new c();
68
- } else
69
- return /* @__PURE__ */ new Map();
70
- };
71
- }, { "./similar": 2 }], 2: [function(n, o, s) {
72
- function l() {
73
- return this.list = [], this.lastItem = void 0, this.size = 0, this;
74
- }
75
- a(l, "Similar"), l.prototype.get = function(c) {
76
- var i;
77
- if (this.lastItem && this.isEqual(this.lastItem.key, c))
78
- return this.lastItem.val;
79
- if (i = this.indexOf(c), i >= 0)
80
- return this.lastItem = this.list[i], this.list[i].val;
81
- }, l.prototype.set = function(c, i) {
82
- var g;
83
- return this.lastItem && this.isEqual(this.lastItem.key, c) ? (this.lastItem.val = i, this) : (g = this.indexOf(c), g >= 0 ? (this.lastItem =
84
- this.list[g], this.list[g].val = i, this) : (this.lastItem = { key: c, val: i }, this.list.push(this.lastItem), this.size++, this));
85
- }, l.prototype.delete = function(c) {
86
- var i;
87
- if (this.lastItem && this.isEqual(this.lastItem.key, c) && (this.lastItem = void 0), i = this.indexOf(c), i >= 0)
88
- return this.size--, this.list.splice(i, 1)[0];
89
- }, l.prototype.has = function(c) {
90
- var i;
91
- return this.lastItem && this.isEqual(this.lastItem.key, c) ? !0 : (i = this.indexOf(c), i >= 0 ? (this.lastItem = this.list[i], !0) :
92
- !1);
93
- }, l.prototype.forEach = function(c, i) {
94
- var g;
95
- for (g = 0; g < this.size; g++)
96
- c.call(i || this, this.list[g].val, this.list[g].key, this);
97
- }, l.prototype.indexOf = function(c) {
98
- var i;
99
- for (i = 0; i < this.size; i++)
100
- if (this.isEqual(this.list[i].key, c))
101
- return i;
102
- return -1;
103
- }, l.prototype.isEqual = function(c, i) {
104
- return c === i || c !== c && i !== i;
105
- }, o.exports = l;
106
- }, {}], 3: [function(n, o, s) {
107
- var l = n("map-or-similar");
108
- o.exports = function(p) {
109
- var u = new l(!1), y = [];
110
- return function(v) {
111
- var d = /* @__PURE__ */ a(function() {
112
- var m = u, E, I, T = arguments.length - 1, R = Array(T + 1), C = !0, N;
113
- if ((d.numArgs || d.numArgs === 0) && d.numArgs !== T + 1)
114
- throw new Error("Memoizerific functions should always be called with the same number of arguments");
115
- for (N = 0; N < T; N++) {
116
- if (R[N] = {
117
- cacheItem: m,
118
- arg: arguments[N]
119
- }, m.has(arguments[N])) {
120
- m = m.get(arguments[N]);
121
- continue;
122
- }
123
- C = !1, E = new l(!1), m.set(arguments[N], E), m = E;
124
- }
125
- return C && (m.has(arguments[T]) ? I = m.get(arguments[T]) : C = !1), C || (I = v.apply(null, arguments), m.set(arguments[T], I)),
126
- p > 0 && (R[T] = {
127
- cacheItem: m,
128
- arg: arguments[T]
129
- }, C ? c(y, R) : y.push(R), y.length > p && i(y.shift())), d.wasMemoized = C, d.numArgs = T + 1, I;
130
- }, "memoizerific");
131
- return d.limit = p, d.wasMemoized = !1, d.cache = u, d.lru = y, d;
132
- };
133
- };
134
- function c(p, u) {
135
- var y = p.length, v = u.length, d, m, E;
136
- for (m = 0; m < y; m++) {
137
- for (d = !0, E = 0; E < v; E++)
138
- if (!g(p[m][E].arg, u[E].arg)) {
139
- d = !1;
140
- break;
141
- }
142
- if (d)
143
- break;
144
- }
145
- p.push(p.splice(m, 1)[0]);
146
- }
147
- a(c, "moveToMostRecentLru");
148
- function i(p) {
149
- var u = p.length, y = p[u - 1], v, d;
150
- for (y.cacheItem.delete(y.arg), d = u - 2; d >= 0 && (y = p[d], v = y.cacheItem.get(y.arg), !v || !v.size); d--)
151
- y.cacheItem.delete(y.arg);
152
- }
153
- a(i, "removeCachedResult");
154
- function g(p, u) {
155
- return p === u || p !== p && u !== u;
156
- }
157
- a(g, "isEqual");
158
- }, { "map-or-similar": 1 }] }, {}, [3])(3);
159
- });
160
- });
161
-
162
- // ../node_modules/@storybook/global/dist/index.mjs
163
- var S = (() => {
164
- let r;
165
- return typeof window < "u" ? r = window : typeof globalThis < "u" ? r = globalThis : typeof global < "u" ? r = global : typeof self < "u" ?
166
- r = self : r = {}, r;
167
- })();
4
+ // src/channels/index.ts
5
+ import { global as Mo } from "@storybook/global";
168
6
 
169
7
  // ../node_modules/ts-dedent/esm/index.js
170
- function F(r) {
171
- for (var t = [], e = 1; e < arguments.length; e++)
172
- t[e - 1] = arguments[e];
173
- var n = Array.from(typeof r == "string" ? [r] : r);
8
+ function j(t) {
9
+ for (var e = [], r = 1; r < arguments.length; r++)
10
+ e[r - 1] = arguments[r];
11
+ var n = Array.from(typeof t == "string" ? [t] : t);
174
12
  n[n.length - 1] = n[n.length - 1].replace(/\r?\n([\t ]*)$/, "");
175
13
  var o = n.reduce(function(c, i) {
176
- var g = i.match(/\n([\t ]+|(?!\s).)/g);
177
- return g ? c.concat(g.map(function(p) {
14
+ var l = i.match(/\n([\t ]+|(?!\s).)/g);
15
+ return l ? c.concat(l.map(function(d) {
178
16
  var u, y;
179
- return (y = (u = p.match(/[\t ]/g)) === null || u === void 0 ? void 0 : u.length) !== null && y !== void 0 ? y : 0;
17
+ return (y = (u = d.match(/[\t ]/g)) === null || u === void 0 ? void 0 : u.length) !== null && y !== void 0 ? y : 0;
180
18
  })) : c;
181
19
  }, []);
182
20
  if (o.length) {
183
- var s = new RegExp(`
21
+ var p = new RegExp(`
184
22
  [ ]{` + Math.min.apply(Math, o) + "}", "g");
185
23
  n = n.map(function(c) {
186
- return c.replace(s, `
24
+ return c.replace(p, `
187
25
  `);
188
26
  });
189
27
  }
190
28
  n[0] = n[0].replace(/^\r?\n/, "");
191
- var l = n[0];
192
- return t.forEach(function(c, i) {
193
- var g = l.match(/(?:^|\n)( *)$/), p = g ? g[1] : "", u = c;
29
+ var a = n[0];
30
+ return e.forEach(function(c, i) {
31
+ var l = a.match(/(?:^|\n)( *)$/), d = l ? l[1] : "", u = c;
194
32
  typeof c == "string" && c.includes(`
195
33
  `) && (u = String(c).split(`
196
- `).map(function(y, v) {
197
- return v === 0 ? y : "" + p + y;
34
+ `).map(function(y, g) {
35
+ return g === 0 ? y : "" + d + y;
198
36
  }).join(`
199
- `)), l += u + n[i + 1];
200
- }), l;
37
+ `)), a += u + n[i + 1];
38
+ }), a;
201
39
  }
202
- a(F, "dedent");
40
+ s(j, "dedent");
203
41
 
204
42
  // src/shared/universal-store/instances.ts
205
- var ft = /* @__PURE__ */ new Map();
43
+ var he = /* @__PURE__ */ new Map();
206
44
 
207
45
  // src/shared/universal-store/index.ts
208
- var ye = "UNIVERSAL_STORE:", x = {
46
+ var wt = "UNIVERSAL_STORE:", x = {
209
47
  PENDING: "PENDING",
210
48
  RESOLVED: "RESOLVED",
211
49
  REJECTED: "REJECTED"
212
- }, h = class h {
213
- constructor(t, e) {
50
+ }, M = class t {
51
+ constructor(e, r) {
214
52
  /** Enable debug logs for this store */
215
53
  this.debugging = !1;
216
54
  // TODO: narrow type of listeners based on event type
217
55
  this.listeners = /* @__PURE__ */ new Map([["*", /* @__PURE__ */ new Set()]]);
218
56
  /** Gets the current state */
219
- this.getState = /* @__PURE__ */ a(() => (this.debug("getState", { state: this.state }), this.state), "getState");
57
+ this.getState = /* @__PURE__ */ s(() => (this.debug("getState", { state: this.state }), this.state), "getState");
220
58
  /**
221
59
  * Subscribes to store events
222
60
  *
223
61
  * @returns A function to unsubscribe
224
62
  */
225
- this.subscribe = /* @__PURE__ */ a((t, e) => {
226
- let n = typeof t == "function", o = n ? "*" : t, s = n ? t : e;
227
- if (this.debug("subscribe", { eventType: o, listener: s }), !s)
63
+ this.subscribe = /* @__PURE__ */ s((e, r) => {
64
+ let n = typeof e == "function", o = n ? "*" : e, p = n ? e : r;
65
+ if (this.debug("subscribe", { eventType: o, listener: p }), !p)
228
66
  throw new TypeError(
229
67
  `Missing first subscribe argument, or second if first is the event type, when subscribing to a UniversalStore with id '${this.id}'`
230
68
  );
231
- return this.listeners.has(o) || this.listeners.set(o, /* @__PURE__ */ new Set()), this.listeners.get(o).add(s), () => {
232
- this.debug("unsubscribe", { eventType: o, listener: s }), this.listeners.has(o) && (this.listeners.get(o).delete(s), this.listeners.
69
+ return this.listeners.has(o) || this.listeners.set(o, /* @__PURE__ */ new Set()), this.listeners.get(o).add(p), () => {
70
+ this.debug("unsubscribe", { eventType: o, listener: p }), this.listeners.has(o) && (this.listeners.get(o).delete(p), this.listeners.
233
71
  get(o)?.size === 0 && this.listeners.delete(o));
234
72
  };
235
73
  }, "subscribe");
236
74
  /** Sends a custom event to the other stores */
237
- this.send = /* @__PURE__ */ a((t) => {
238
- if (this.debug("send", { event: t }), this.status !== h.Status.READY)
75
+ this.send = /* @__PURE__ */ s((e) => {
76
+ if (this.debug("send", { event: e }), this.status !== t.Status.READY)
239
77
  throw new TypeError(
240
- F`Cannot send event before store is ready. You can get the current status with store.status,
78
+ j`Cannot send event before store is ready. You can get the current status with store.status,
241
79
  or await store.readyPromise to wait for the store to be ready before sending events.
242
80
  ${JSON.stringify(
243
81
  {
244
- event: t,
82
+ event: e,
245
83
  id: this.id,
246
84
  actor: this.actor,
247
85
  environment: this.environment
@@ -250,36 +88,34 @@ var ye = "UNIVERSAL_STORE:", x = {
250
88
  2
251
89
  )}`
252
90
  );
253
- this.emitToListeners(t, { actor: this.actor }), this.emitToChannel(t, { actor: this.actor });
91
+ this.emitToListeners(e, { actor: this.actor }), this.emitToChannel(e, { actor: this.actor });
254
92
  }, "send");
255
- if (this.debugging = t.debug ?? !1, !h.isInternalConstructing)
93
+ if (this.debugging = e.debug ?? !1, !t.isInternalConstructing)
256
94
  throw new TypeError(
257
95
  "UniversalStore is not constructable - use UniversalStore.create() instead"
258
96
  );
259
- if (h.isInternalConstructing = !1, this.id = t.id, this.actorId = globalThis.crypto ? globalThis.crypto.randomUUID() : (
260
- // TODO: remove this fallback in SB 9.0 when we no longer support Node 18
261
- Date.now().toString(36) + Math.random().toString(36).substring(2)
262
- ), this.actorType = t.leader ? h.ActorType.LEADER : h.ActorType.FOLLOWER, this.state = t.initialState, this.channelEventName = `${ye}${this.
263
- id}`, this.debug("constructor", {
264
- options: t,
265
- environmentOverrides: e,
97
+ if (t.isInternalConstructing = !1, this.id = e.id, this.actorId = Date.now().toString(36) + Math.random().toString(36).substring(2), this.
98
+ actorType = e.leader ? t.ActorType.LEADER : t.ActorType.FOLLOWER, this.state = e.initialState, this.channelEventName = `${wt}${this.id}`,
99
+ this.debug("constructor", {
100
+ options: e,
101
+ environmentOverrides: r,
266
102
  channelEventName: this.channelEventName
267
- }), this.actor.type === h.ActorType.LEADER)
103
+ }), this.actor.type === t.ActorType.LEADER)
268
104
  this.syncing = {
269
105
  state: x.RESOLVED,
270
106
  promise: Promise.resolve()
271
107
  };
272
108
  else {
273
- let n, o, s = new Promise((l, c) => {
274
- n = /* @__PURE__ */ a(() => {
275
- this.syncing.state === x.PENDING && (this.syncing.state = x.RESOLVED, l());
276
- }, "syncingResolve"), o = /* @__PURE__ */ a((i) => {
109
+ let n, o, p = new Promise((a, c) => {
110
+ n = /* @__PURE__ */ s(() => {
111
+ this.syncing.state === x.PENDING && (this.syncing.state = x.RESOLVED, a());
112
+ }, "syncingResolve"), o = /* @__PURE__ */ s((i) => {
277
113
  this.syncing.state === x.PENDING && (this.syncing.state = x.REJECTED, c(i));
278
114
  }, "syncingReject");
279
115
  });
280
116
  this.syncing = {
281
117
  state: x.PENDING,
282
- promise: s,
118
+ promise: p,
283
119
  resolve: n,
284
120
  reject: o
285
121
  };
@@ -287,23 +123,80 @@ var ye = "UNIVERSAL_STORE:", x = {
287
123
  this.getState = this.getState.bind(this), this.setState = this.setState.bind(this), this.subscribe = this.subscribe.bind(this), this.onStateChange =
288
124
  this.onStateChange.bind(this), this.send = this.send.bind(this), this.emitToChannel = this.emitToChannel.bind(this), this.prepareThis = this.
289
125
  prepareThis.bind(this), this.emitToListeners = this.emitToListeners.bind(this), this.handleChannelEvents = this.handleChannelEvents.bind(
290
- this), this.debug = this.debug.bind(this), this.channel = e?.channel ?? h.preparation.channel, this.environment = e?.environment ?? h.preparation.
291
- environment, this.channel && this.environment ? this.prepareThis({ channel: this.channel, environment: this.environment }) : h.preparation.
292
- promise.then(this.prepareThis);
126
+ this), this.debug = this.debug.bind(this), this.channel = r?.channel ?? t.preparation.channel, this.environment = r?.environment ?? t.preparation.
127
+ environment, this.channel && this.environment ? (t.preparation.resolve({ channel: this.channel, environment: this.environment }), this.prepareThis(
128
+ { channel: this.channel, environment: this.environment })) : t.preparation.promise.then(this.prepareThis);
129
+ }
130
+ static {
131
+ s(this, "UniversalStore");
132
+ }
133
+ static {
134
+ /**
135
+ * Defines the possible actor types in the store system
136
+ *
137
+ * @readonly
138
+ */
139
+ this.ActorType = {
140
+ LEADER: "LEADER",
141
+ FOLLOWER: "FOLLOWER"
142
+ };
143
+ }
144
+ static {
145
+ /**
146
+ * Defines the possible environments the store can run in
147
+ *
148
+ * @readonly
149
+ */
150
+ this.Environment = {
151
+ SERVER: "SERVER",
152
+ MANAGER: "MANAGER",
153
+ PREVIEW: "PREVIEW",
154
+ UNKNOWN: "UNKNOWN",
155
+ MOCK: "MOCK"
156
+ };
157
+ }
158
+ static {
159
+ /**
160
+ * Internal event types used for store synchronization
161
+ *
162
+ * @readonly
163
+ */
164
+ this.InternalEventType = {
165
+ EXISTING_STATE_REQUEST: "__EXISTING_STATE_REQUEST",
166
+ EXISTING_STATE_RESPONSE: "__EXISTING_STATE_RESPONSE",
167
+ SET_STATE: "__SET_STATE",
168
+ LEADER_CREATED: "__LEADER_CREATED",
169
+ FOLLOWER_CREATED: "__FOLLOWER_CREATED"
170
+ };
171
+ }
172
+ static {
173
+ this.Status = {
174
+ UNPREPARED: "UNPREPARED",
175
+ SYNCING: "SYNCING",
176
+ READY: "READY",
177
+ ERROR: "ERROR"
178
+ };
179
+ }
180
+ static {
181
+ // This is used to check if constructor was called from the static factory create()
182
+ this.isInternalConstructing = !1;
183
+ }
184
+ static {
185
+ t.setupPreparationPromise();
293
186
  }
294
187
  static setupPreparationPromise() {
295
- let t, e, n = new Promise(
296
- (o, s) => {
297
- t = /* @__PURE__ */ a((l) => {
298
- o(l);
299
- }, "resolveRef"), e = /* @__PURE__ */ a((...l) => {
300
- s(l);
188
+ let e, r, n = new Promise(
189
+ (o, p) => {
190
+ e = /* @__PURE__ */ s((a) => {
191
+ o(a);
192
+ }, "resolveRef"), r = /* @__PURE__ */ s((...a) => {
193
+ p(a);
301
194
  }, "rejectRef");
302
195
  }
303
196
  );
304
- h.preparation = {
305
- resolve: t,
306
- reject: e,
197
+ t.preparation = {
198
+ resolve: e,
199
+ reject: r,
307
200
  promise: n
308
201
  };
309
202
  }
@@ -312,7 +205,7 @@ var ye = "UNIVERSAL_STORE:", x = {
312
205
  return Object.freeze({
313
206
  id: this.actorId,
314
207
  type: this.actorType,
315
- environment: this.environment ?? h.Environment.UNKNOWN
208
+ environment: this.environment ?? t.Environment.UNKNOWN
316
209
  });
317
210
  }
318
211
  /**
@@ -321,16 +214,16 @@ var ye = "UNIVERSAL_STORE:", x = {
321
214
  */
322
215
  get status() {
323
216
  if (!this.channel || !this.environment)
324
- return h.Status.UNPREPARED;
217
+ return t.Status.UNPREPARED;
325
218
  switch (this.syncing?.state) {
326
219
  case x.PENDING:
327
220
  case void 0:
328
- return h.Status.SYNCING;
221
+ return t.Status.SYNCING;
329
222
  case x.REJECTED:
330
- return h.Status.ERROR;
223
+ return t.Status.ERROR;
331
224
  case x.RESOLVED:
332
225
  default:
333
- return h.Status.READY;
226
+ return t.Status.READY;
334
227
  }
335
228
  }
336
229
  /**
@@ -341,24 +234,24 @@ var ye = "UNIVERSAL_STORE:", x = {
341
234
  * hundred milliseconds.
342
235
  */
343
236
  untilReady() {
344
- return Promise.all([h.preparation.promise, this.syncing?.promise]);
237
+ return Promise.all([t.preparation.promise, this.syncing?.promise]);
345
238
  }
346
239
  /** Creates a new instance of UniversalStore */
347
- static create(t) {
348
- if (!t || typeof t?.id != "string")
240
+ static create(e) {
241
+ if (!e || typeof e?.id != "string")
349
242
  throw new TypeError("id is required and must be a string, when creating a UniversalStore");
350
- t.debug && console.debug(
351
- F`[UniversalStore]
243
+ e.debug && console.debug(
244
+ j`[UniversalStore]
352
245
  create`,
353
- { options: t }
246
+ { options: e }
354
247
  );
355
- let e = ft.get(t.id);
356
- if (e)
357
- return console.warn(F`UniversalStore with id "${t.id}" already exists in this environment, re-using existing.
358
- You should reuse the existing instance instead of trying to create a new one.`), e;
359
- h.isInternalConstructing = !0;
360
- let n = new h(t);
361
- return ft.set(t.id, n), n;
248
+ let r = he.get(e.id);
249
+ if (r)
250
+ return console.warn(j`UniversalStore with id "${e.id}" already exists in this environment, re-using existing.
251
+ You should reuse the existing instance instead of trying to create a new one.`), r;
252
+ t.isInternalConstructing = !0;
253
+ let n = new t(e);
254
+ return he.set(e.id, n), n;
362
255
  }
363
256
  /**
364
257
  * Used by Storybook to set the channel for all instances of UniversalStore in the given
@@ -366,19 +259,19 @@ var ye = "UNIVERSAL_STORE:", x = {
366
259
  *
367
260
  * @internal
368
261
  */
369
- static __prepare(t, e) {
370
- h.preparation.channel = t, h.preparation.environment = e, h.preparation.resolve({ channel: t, environment: e });
262
+ static __prepare(e, r) {
263
+ t.preparation.channel = e, t.preparation.environment = r, t.preparation.resolve({ channel: e, environment: r });
371
264
  }
372
265
  /**
373
266
  * Updates the store's state
374
267
  *
375
268
  * Either a new state or a state updater function can be passed to the method.
376
269
  */
377
- setState(t) {
378
- let e = this.state, n = typeof t == "function" ? t(e) : t;
379
- if (this.debug("setState", { newState: n, previousState: e, updater: t }), this.status !== h.Status.READY)
270
+ setState(e) {
271
+ let r = this.state, n = typeof e == "function" ? e(r) : e;
272
+ if (this.debug("setState", { newState: n, previousState: r, updater: e }), this.status !== t.Status.READY)
380
273
  throw new TypeError(
381
- F`Cannot set state before store is ready. You can get the current status with store.status,
274
+ j`Cannot set state before store is ready. You can get the current status with store.status,
382
275
  or await store.readyPromise to wait for the store to be ready before sending events.
383
276
  ${JSON.stringify(
384
277
  {
@@ -393,10 +286,10 @@ var ye = "UNIVERSAL_STORE:", x = {
393
286
  );
394
287
  this.state = n;
395
288
  let o = {
396
- type: h.InternalEventType.SET_STATE,
289
+ type: t.InternalEventType.SET_STATE,
397
290
  payload: {
398
291
  state: n,
399
- previousState: e
292
+ previousState: r
400
293
  }
401
294
  };
402
295
  this.emitToChannel(o, { actor: this.actor }), this.emitToListeners(o, { actor: this.actor });
@@ -406,33 +299,33 @@ var ye = "UNIVERSAL_STORE:", x = {
406
299
  *
407
300
  * @returns Unsubscribe function
408
301
  */
409
- onStateChange(t) {
410
- return this.debug("onStateChange", { listener: t }), this.subscribe(
411
- h.InternalEventType.SET_STATE,
412
- ({ payload: e }, n) => {
413
- t(e.state, e.previousState, n);
302
+ onStateChange(e) {
303
+ return this.debug("onStateChange", { listener: e }), this.subscribe(
304
+ t.InternalEventType.SET_STATE,
305
+ ({ payload: r }, n) => {
306
+ e(r.state, r.previousState, n);
414
307
  }
415
308
  );
416
309
  }
417
- emitToChannel(t, e) {
418
- this.debug("emitToChannel", { event: t, eventInfo: e, channel: !!this.channel }), this.channel?.emit(this.channelEventName, {
419
- event: t,
420
- eventInfo: e
310
+ emitToChannel(e, r) {
311
+ this.debug("emitToChannel", { event: e, eventInfo: r, channel: !!this.channel }), this.channel?.emit(this.channelEventName, {
312
+ event: e,
313
+ eventInfo: r
421
314
  });
422
315
  }
423
316
  prepareThis({
424
- channel: t,
425
- environment: e
317
+ channel: e,
318
+ environment: r
426
319
  }) {
427
- this.channel = t, this.environment = e, this.debug("prepared", { channel: !!t, environment: e }), this.channel.on(this.channelEventName,
428
- this.handleChannelEvents), this.actor.type === h.ActorType.LEADER ? this.emitToChannel(
429
- { type: h.InternalEventType.LEADER_CREATED },
320
+ this.channel = e, this.environment = r, this.debug("prepared", { channel: !!e, environment: r }), this.channel.on(this.channelEventName,
321
+ this.handleChannelEvents), this.actor.type === t.ActorType.LEADER ? this.emitToChannel(
322
+ { type: t.InternalEventType.LEADER_CREATED },
430
323
  { actor: this.actor }
431
324
  ) : (this.emitToChannel(
432
- { type: h.InternalEventType.FOLLOWER_CREATED },
325
+ { type: t.InternalEventType.FOLLOWER_CREATED },
433
326
  { actor: this.actor }
434
327
  ), this.emitToChannel(
435
- { type: h.InternalEventType.EXISTING_STATE_REQUEST },
328
+ { type: t.InternalEventType.EXISTING_STATE_REQUEST },
436
329
  { actor: this.actor }
437
330
  ), setTimeout(() => {
438
331
  this.syncing.reject(
@@ -443,44 +336,44 @@ var ye = "UNIVERSAL_STORE:", x = {
443
336
  );
444
337
  }, 1e3));
445
338
  }
446
- emitToListeners(t, e) {
447
- let n = this.listeners.get(t.type), o = this.listeners.get("*");
339
+ emitToListeners(e, r) {
340
+ let n = this.listeners.get(e.type), o = this.listeners.get("*");
448
341
  this.debug("emitToListeners", {
449
- event: t,
450
- eventInfo: e,
342
+ event: e,
343
+ eventInfo: r,
451
344
  eventTypeListeners: n,
452
345
  everythingListeners: o
453
346
  }), [...n ?? [], ...o ?? []].forEach(
454
- (s) => s(t, e)
347
+ (p) => p(e, r)
455
348
  );
456
349
  }
457
- handleChannelEvents(t) {
458
- let { event: e, eventInfo: n } = t;
350
+ handleChannelEvents(e) {
351
+ let { event: r, eventInfo: n } = e;
459
352
  if ([n.actor.id, n.forwardingActor?.id].includes(this.actor.id)) {
460
- this.debug("handleChannelEvents: Ignoring event from self", { channelEvent: t });
353
+ this.debug("handleChannelEvents: Ignoring event from self", { channelEvent: e });
461
354
  return;
462
- } else if (this.syncing?.state === x.PENDING && e.type !== h.InternalEventType.EXISTING_STATE_RESPONSE) {
463
- this.debug("handleChannelEvents: Ignoring event while syncing", { channelEvent: t });
355
+ } else if (this.syncing?.state === x.PENDING && r.type !== t.InternalEventType.EXISTING_STATE_RESPONSE) {
356
+ this.debug("handleChannelEvents: Ignoring event while syncing", { channelEvent: e });
464
357
  return;
465
358
  }
466
- if (this.debug("handleChannelEvents", { channelEvent: t }), this.actor.type === h.ActorType.LEADER) {
359
+ if (this.debug("handleChannelEvents", { channelEvent: e }), this.actor.type === t.ActorType.LEADER) {
467
360
  let o = !0;
468
- switch (e.type) {
469
- case h.InternalEventType.EXISTING_STATE_REQUEST:
361
+ switch (r.type) {
362
+ case t.InternalEventType.EXISTING_STATE_REQUEST:
470
363
  o = !1;
471
- let s = {
472
- type: h.InternalEventType.EXISTING_STATE_RESPONSE,
364
+ let p = {
365
+ type: t.InternalEventType.EXISTING_STATE_RESPONSE,
473
366
  payload: this.state
474
367
  };
475
368
  this.debug("handleChannelEvents: responding to existing state request", {
476
- responseEvent: s
477
- }), this.emitToChannel(s, { actor: this.actor });
369
+ responseEvent: p
370
+ }), this.emitToChannel(p, { actor: this.actor }), this.emitToListeners(p, { actor: this.actor });
478
371
  break;
479
- case h.InternalEventType.LEADER_CREATED:
372
+ case t.InternalEventType.LEADER_CREATED:
480
373
  o = !1, this.syncing.state = x.REJECTED, this.debug("handleChannelEvents: erroring due to second leader being created", {
481
- event: e
374
+ event: r
482
375
  }), console.error(
483
- F`Detected multiple UniversalStore leaders created with the same id "${this.id}".
376
+ j`Detected multiple UniversalStore leaders created with the same id "${this.id}".
484
377
  Only one leader can exists at a time, your stores are now in an invalid state.
485
378
  Leaders detected:
486
379
  this: ${JSON.stringify(this.actor, null, 2)}
@@ -488,41 +381,41 @@ var ye = "UNIVERSAL_STORE:", x = {
488
381
  );
489
382
  break;
490
383
  }
491
- o && (this.debug("handleChannelEvents: forwarding event", { channelEvent: t }), this.emitToChannel(e, { actor: n.actor, forwardingActor: this.
384
+ o && (this.debug("handleChannelEvents: forwarding event", { channelEvent: e }), this.emitToChannel(r, { actor: n.actor, forwardingActor: this.
492
385
  actor }));
493
386
  }
494
- if (this.actor.type === h.ActorType.FOLLOWER)
495
- switch (e.type) {
496
- case h.InternalEventType.EXISTING_STATE_RESPONSE:
387
+ if (this.actor.type === t.ActorType.FOLLOWER)
388
+ switch (r.type) {
389
+ case t.InternalEventType.EXISTING_STATE_RESPONSE:
497
390
  if (this.debug("handleChannelEvents: Setting state from leader's existing state response", {
498
- event: e
391
+ event: r
499
392
  }), this.syncing?.state !== x.PENDING)
500
393
  break;
501
394
  this.syncing.resolve?.();
502
395
  let o = {
503
- type: h.InternalEventType.SET_STATE,
396
+ type: t.InternalEventType.SET_STATE,
504
397
  payload: {
505
- state: e.payload,
398
+ state: r.payload,
506
399
  previousState: this.state
507
400
  }
508
401
  };
509
- this.state = e.payload, this.emitToListeners(o, n);
402
+ this.state = r.payload, this.emitToListeners(o, n);
510
403
  break;
511
404
  }
512
- switch (e.type) {
513
- case h.InternalEventType.SET_STATE:
514
- this.debug("handleChannelEvents: Setting state", { event: e }), this.state = e.payload.state;
405
+ switch (r.type) {
406
+ case t.InternalEventType.SET_STATE:
407
+ this.debug("handleChannelEvents: Setting state", { event: r }), this.state = r.payload.state;
515
408
  break;
516
409
  }
517
- this.emitToListeners(e, { actor: n.actor });
410
+ this.emitToListeners(r, { actor: n.actor });
518
411
  }
519
- debug(t, e) {
412
+ debug(e, r) {
520
413
  this.debugging && console.debug(
521
- F`[UniversalStore::${this.id}::${this.environment ?? h.Environment.UNKNOWN}]
522
- ${t}`,
414
+ j`[UniversalStore::${this.id}::${this.environment ?? t.Environment.UNKNOWN}]
415
+ ${e}`,
523
416
  JSON.stringify(
524
417
  {
525
- data: e,
418
+ data: r,
526
419
  actor: this.actor,
527
420
  state: this.state,
528
421
  status: this.status
@@ -538,139 +431,107 @@ var ye = "UNIVERSAL_STORE:", x = {
538
431
  * @internal
539
432
  */
540
433
  static __reset() {
541
- h.preparation.reject(new Error("reset")), h.setupPreparationPromise(), h.isInternalConstructing = !1;
434
+ t.preparation.reject(new Error("reset")), t.setupPreparationPromise(), t.isInternalConstructing = !1;
542
435
  }
543
436
  };
544
- a(h, "UniversalStore"), /**
545
- * Defines the possible actor types in the store system
546
- *
547
- * @readonly
548
- */
549
- h.ActorType = {
550
- LEADER: "LEADER",
551
- FOLLOWER: "FOLLOWER"
552
- }, /**
553
- * Defines the possible environments the store can run in
554
- *
555
- * @readonly
556
- */
557
- h.Environment = {
558
- SERVER: "SERVER",
559
- MANAGER: "MANAGER",
560
- PREVIEW: "PREVIEW",
561
- UNKNOWN: "UNKNOWN",
562
- MOCK: "MOCK"
563
- }, /**
564
- * Internal event types used for store synchronization
565
- *
566
- * @readonly
567
- */
568
- h.InternalEventType = {
569
- EXISTING_STATE_REQUEST: "__EXISTING_STATE_REQUEST",
570
- EXISTING_STATE_RESPONSE: "__EXISTING_STATE_RESPONSE",
571
- SET_STATE: "__SET_STATE",
572
- LEADER_CREATED: "__LEADER_CREATED",
573
- FOLLOWER_CREATED: "__FOLLOWER_CREATED"
574
- }, h.Status = {
575
- UNPREPARED: "UNPREPARED",
576
- SYNCING: "SYNCING",
577
- READY: "READY",
578
- ERROR: "ERROR"
579
- }, // This is used to check if constructor was called from the static factory create()
580
- h.isInternalConstructing = !1, h.setupPreparationPromise();
581
- var $ = h;
582
437
 
583
438
  // src/channels/main.ts
584
- var de = /* @__PURE__ */ a((r) => r.transports !== void 0, "isMulti"), ge = /* @__PURE__ */ a(() => Math.random().toString(16).slice(2), "ge\
585
- nerateRandomId"), ht = class ht {
586
- constructor(t = {}) {
587
- this.sender = ge();
439
+ var Pt = /* @__PURE__ */ s((t) => t.transports !== void 0, "isMulti"), Ot = /* @__PURE__ */ s(() => Math.random().toString(16).slice(2), "ge\
440
+ nerateRandomId"), J = class {
441
+ constructor(e = {}) {
442
+ this.sender = Ot();
588
443
  this.events = {};
589
444
  this.data = {};
590
445
  this.transports = [];
591
- this.isAsync = t.async || !1, de(t) ? (this.transports = t.transports || [], this.transports.forEach((e) => {
592
- e.setHandler((n) => this.handleEvent(n));
593
- })) : this.transports = t.transport ? [t.transport] : [], this.transports.forEach((e) => {
594
- e.setHandler((n) => this.handleEvent(n));
446
+ this.isAsync = e.async || !1, Pt(e) ? (this.transports = e.transports || [], this.transports.forEach((r) => {
447
+ r.setHandler((n) => this.handleEvent(n));
448
+ })) : this.transports = e.transport ? [e.transport] : [], this.transports.forEach((r) => {
449
+ r.setHandler((n) => this.handleEvent(n));
595
450
  });
596
451
  }
452
+ static {
453
+ s(this, "Channel");
454
+ }
597
455
  get hasTransport() {
598
456
  return this.transports.length > 0;
599
457
  }
600
- addListener(t, e) {
601
- this.events[t] = this.events[t] || [], this.events[t].push(e);
458
+ addListener(e, r) {
459
+ this.events[e] = this.events[e] || [], this.events[e].push(r);
602
460
  }
603
- emit(t, ...e) {
604
- let n = { type: t, args: e, from: this.sender }, o = {};
605
- e.length >= 1 && e[0] && e[0].options && (o = e[0].options);
606
- let s = /* @__PURE__ */ a(() => {
607
- this.transports.forEach((l) => {
608
- l.send(n, o);
461
+ emit(e, ...r) {
462
+ let n = { type: e, args: r, from: this.sender }, o = {};
463
+ r.length >= 1 && r[0] && r[0].options && (o = r[0].options);
464
+ let p = /* @__PURE__ */ s(() => {
465
+ this.transports.forEach((a) => {
466
+ a.send(n, o);
609
467
  }), this.handleEvent(n);
610
468
  }, "handler");
611
- this.isAsync ? setImmediate(s) : s();
469
+ this.isAsync ? setImmediate(p) : p();
612
470
  }
613
- last(t) {
614
- return this.data[t];
471
+ last(e) {
472
+ return this.data[e];
615
473
  }
616
474
  eventNames() {
617
475
  return Object.keys(this.events);
618
476
  }
619
- listenerCount(t) {
620
- let e = this.listeners(t);
621
- return e ? e.length : 0;
477
+ listenerCount(e) {
478
+ let r = this.listeners(e);
479
+ return r ? r.length : 0;
622
480
  }
623
- listeners(t) {
624
- return this.events[t] || void 0;
481
+ listeners(e) {
482
+ return this.events[e] || void 0;
625
483
  }
626
- once(t, e) {
627
- let n = this.onceListener(t, e);
628
- this.addListener(t, n);
484
+ once(e, r) {
485
+ let n = this.onceListener(e, r);
486
+ this.addListener(e, n);
629
487
  }
630
- removeAllListeners(t) {
631
- t ? this.events[t] && delete this.events[t] : this.events = {};
488
+ removeAllListeners(e) {
489
+ e ? this.events[e] && delete this.events[e] : this.events = {};
632
490
  }
633
- removeListener(t, e) {
634
- let n = this.listeners(t);
635
- n && (this.events[t] = n.filter((o) => o !== e));
491
+ removeListener(e, r) {
492
+ let n = this.listeners(e);
493
+ n && (this.events[e] = n.filter((o) => o !== r));
636
494
  }
637
- on(t, e) {
638
- this.addListener(t, e);
495
+ on(e, r) {
496
+ this.addListener(e, r);
639
497
  }
640
- off(t, e) {
641
- this.removeListener(t, e);
498
+ off(e, r) {
499
+ this.removeListener(e, r);
642
500
  }
643
- handleEvent(t) {
644
- let e = this.listeners(t.type);
645
- e && e.length && e.forEach((n) => {
646
- n.apply(t, t.args);
647
- }), this.data[t.type] = t.args;
501
+ handleEvent(e) {
502
+ let r = this.listeners(e.type);
503
+ r && r.length && r.forEach((n) => {
504
+ n.apply(e, e.args);
505
+ }), this.data[e.type] = e.args;
648
506
  }
649
- onceListener(t, e) {
650
- let n = /* @__PURE__ */ a((...o) => (this.removeListener(t, n), e(...o)), "onceListener");
507
+ onceListener(e, r) {
508
+ let n = /* @__PURE__ */ s((...o) => (this.removeListener(e, n), r(...o)), "onceListener");
651
509
  return n;
652
510
  }
653
511
  };
654
- a(ht, "Channel");
655
- var B = ht;
656
512
 
657
513
  // src/channels/postmessage/index.ts
658
- import { logger as Kt, pretty as Yt } from "storybook/internal/client-logger";
659
- import * as so from "storybook/internal/core-events";
514
+ import { logger as st, pretty as it } from "storybook/internal/client-logger";
515
+ import * as Do from "storybook/internal/core-events";
516
+ import { global as b } from "@storybook/global";
660
517
 
661
- // ../node_modules/telejson/dist/chunk-465TF3XA.mjs
662
- var ve = Object.create, Ot = Object.defineProperty, me = Object.getOwnPropertyDescriptor, Ct = Object.getOwnPropertyNames, Ee = Object.getPrototypeOf,
663
- be = Object.prototype.hasOwnProperty, P = /* @__PURE__ */ a((r, t) => /* @__PURE__ */ a(function() {
664
- return t || (0, r[Ct(r)[0]])((t = { exports: {} }).exports, t), t.exports;
665
- }, "__require"), "__commonJS"), Se = /* @__PURE__ */ a((r, t, e, n) => {
666
- if (t && typeof t == "object" || typeof t == "function")
667
- for (let o of Ct(t))
668
- !be.call(r, o) && o !== e && Ot(r, o, { get: /* @__PURE__ */ a(() => t[o], "get"), enumerable: !(n = me(t, o)) || n.enumerable });
669
- return r;
670
- }, "__copyProps"), ot = /* @__PURE__ */ a((r, t, e) => (e = r != null ? ve(Ee(r)) : {}, Se(
671
- t || !r || !r.__esModule ? Ot(e, "default", { value: r, enumerable: !0 }) : e,
672
- r
673
- )), "__toESM"), _e = [
518
+ // ../node_modules/telejson/dist/chunk-EAFQLD22.mjs
519
+ var Ct = Object.create, je = Object.defineProperty, Nt = Object.getOwnPropertyDescriptor, Le = Object.getOwnPropertyNames, It = Object.getPrototypeOf,
520
+ Rt = Object.prototype.hasOwnProperty, f = /* @__PURE__ */ s((t, e) => /* @__PURE__ */ s(function() {
521
+ return e || (0, t[Le(t)[0]])((e = { exports: {} }).exports, e), e.exports;
522
+ }, "__require"), "__commonJS"), jt = /* @__PURE__ */ s((t, e, r, n) => {
523
+ if (e && typeof e == "object" || typeof e == "function")
524
+ for (let o of Le(e))
525
+ !Rt.call(t, o) && o !== r && je(t, o, { get: /* @__PURE__ */ s(() => e[o], "get"), enumerable: !(n = Nt(e, o)) || n.enumerable });
526
+ return t;
527
+ }, "__copyProps"), ae = /* @__PURE__ */ s((t, e, r) => (r = t != null ? Ct(It(t)) : {}, jt(
528
+ // If the importer is in node compatibility mode or this is not an ESM
529
+ // file that has been converted to a CommonJS file using a Babel-
530
+ // compatible transform (i.e. "__esModule" has not been set), then set
531
+ // "default" to the CommonJS "module.exports" for node compatibility.
532
+ e || !t || !t.__esModule ? je(r, "default", { value: t, enumerable: !0 }) : r,
533
+ t
534
+ )), "__toESM"), Lt = [
674
535
  "bubbles",
675
536
  "cancelBubble",
676
537
  "cancelable",
@@ -684,210 +545,441 @@ be = Object.prototype.hasOwnProperty, P = /* @__PURE__ */ a((r, t) => /* @__PURE
684
545
  "target",
685
546
  "timeStamp",
686
547
  "type"
687
- ], Te = ["detail"];
688
- function Pt(r) {
689
- let t = _e.filter((e) => r[e] !== void 0).reduce((e, n) => ({ ...e, [n]: r[n] }), {});
690
- return r instanceof CustomEvent && Te.filter((e) => r[e] !== void 0).forEach((e) => {
691
- t[e] = r[e];
692
- }), t;
548
+ ], Dt = ["detail"];
549
+ function De(t) {
550
+ let e = Lt.filter((r) => t[r] !== void 0).reduce((r, n) => (r[n] = t[n], r), {});
551
+ if (t instanceof CustomEvent)
552
+ for (let r of Dt.filter(
553
+ (n) => t[n] !== void 0
554
+ ))
555
+ e[r] = t[r];
556
+ return e;
693
557
  }
694
- a(Pt, "extractEventHiddenProperties");
558
+ s(De, "extractEventHiddenProperties");
695
559
 
696
560
  // ../node_modules/telejson/dist/index.mjs
697
- var Bt = he(xt(), 1);
698
- var Ft = P({
699
- "node_modules/has-symbols/shams.js"(r, t) {
561
+ var ke = f({
562
+ "node_modules/.pnpm/es-object-atoms@1.1.1/node_modules/es-object-atoms/index.js"(t, e) {
563
+ "use strict";
564
+ e.exports = Object;
565
+ }
566
+ }), $t = f({
567
+ "node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/index.js"(t, e) {
568
+ "use strict";
569
+ e.exports = Error;
570
+ }
571
+ }), Ft = f({
572
+ "node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/eval.js"(t, e) {
573
+ "use strict";
574
+ e.exports = EvalError;
575
+ }
576
+ }), Mt = f({
577
+ "node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/range.js"(t, e) {
578
+ "use strict";
579
+ e.exports = RangeError;
580
+ }
581
+ }), Ut = f({
582
+ "node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/ref.js"(t, e) {
583
+ "use strict";
584
+ e.exports = ReferenceError;
585
+ }
586
+ }), Gt = f({
587
+ "node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/syntax.js"(t, e) {
588
+ "use strict";
589
+ e.exports = SyntaxError;
590
+ }
591
+ }), me = f({
592
+ "node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/type.js"(t, e) {
593
+ "use strict";
594
+ e.exports = TypeError;
595
+ }
596
+ }), kt = f({
597
+ "node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/uri.js"(t, e) {
598
+ "use strict";
599
+ e.exports = URIError;
600
+ }
601
+ }), Wt = f({
602
+ "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/abs.js"(t, e) {
603
+ "use strict";
604
+ e.exports = Math.abs;
605
+ }
606
+ }), qt = f({
607
+ "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/floor.js"(t, e) {
608
+ "use strict";
609
+ e.exports = Math.floor;
610
+ }
611
+ }), Bt = f({
612
+ "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/max.js"(t, e) {
613
+ "use strict";
614
+ e.exports = Math.max;
615
+ }
616
+ }), Ht = f({
617
+ "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/min.js"(t, e) {
618
+ "use strict";
619
+ e.exports = Math.min;
620
+ }
621
+ }), Vt = f({
622
+ "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/pow.js"(t, e) {
623
+ "use strict";
624
+ e.exports = Math.pow;
625
+ }
626
+ }), Jt = f({
627
+ "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/round.js"(t, e) {
628
+ "use strict";
629
+ e.exports = Math.round;
630
+ }
631
+ }), zt = f({
632
+ "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/isNaN.js"(t, e) {
633
+ "use strict";
634
+ e.exports = Number.isNaN || /* @__PURE__ */ s(function(n) {
635
+ return n !== n;
636
+ }, "isNaN2");
637
+ }
638
+ }), Yt = f({
639
+ "node_modules/.pnpm/math-intrinsics@1.1.0/node_modules/math-intrinsics/sign.js"(t, e) {
640
+ "use strict";
641
+ var r = zt();
642
+ e.exports = /* @__PURE__ */ s(function(o) {
643
+ return r(o) || o === 0 ? o : o < 0 ? -1 : 1;
644
+ }, "sign");
645
+ }
646
+ }), Kt = f({
647
+ "node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/gOPD.js"(t, e) {
648
+ "use strict";
649
+ e.exports = Object.getOwnPropertyDescriptor;
650
+ }
651
+ }), ve = f({
652
+ "node_modules/.pnpm/gopd@1.2.0/node_modules/gopd/index.js"(t, e) {
653
+ "use strict";
654
+ var r = Kt();
655
+ if (r)
656
+ try {
657
+ r([], "length");
658
+ } catch {
659
+ r = null;
660
+ }
661
+ e.exports = r;
662
+ }
663
+ }), Xt = f({
664
+ "node_modules/.pnpm/es-define-property@1.0.1/node_modules/es-define-property/index.js"(t, e) {
665
+ "use strict";
666
+ var r = Object.defineProperty || !1;
667
+ if (r)
668
+ try {
669
+ r({}, "a", { value: 1 });
670
+ } catch {
671
+ r = !1;
672
+ }
673
+ e.exports = r;
674
+ }
675
+ }), We = f({
676
+ "node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/shams.js"(t, e) {
700
677
  "use strict";
701
- t.exports = /* @__PURE__ */ a(function() {
678
+ e.exports = /* @__PURE__ */ s(function() {
702
679
  if (typeof Symbol != "function" || typeof Object.getOwnPropertySymbols != "function")
703
680
  return !1;
704
681
  if (typeof Symbol.iterator == "symbol")
705
682
  return !0;
706
- var n = {}, o = Symbol("test"), s = Object(o);
707
- if (typeof o == "string" || Object.prototype.toString.call(o) !== "[object Symbol]" || Object.prototype.toString.call(s) !== "[object \
683
+ var n = {}, o = Symbol("test"), p = Object(o);
684
+ if (typeof o == "string" || Object.prototype.toString.call(o) !== "[object Symbol]" || Object.prototype.toString.call(p) !== "[object \
708
685
  Symbol]")
709
686
  return !1;
710
- var l = 42;
711
- n[o] = l;
712
- for (o in n)
687
+ var a = 42;
688
+ n[o] = a;
689
+ for (var c in n)
713
690
  return !1;
714
691
  if (typeof Object.keys == "function" && Object.keys(n).length !== 0 || typeof Object.getOwnPropertyNames == "function" && Object.getOwnPropertyNames(
715
692
  n).length !== 0)
716
693
  return !1;
717
- var c = Object.getOwnPropertySymbols(n);
718
- if (c.length !== 1 || c[0] !== o || !Object.prototype.propertyIsEnumerable.call(n, o))
694
+ var i = Object.getOwnPropertySymbols(n);
695
+ if (i.length !== 1 || i[0] !== o || !Object.prototype.propertyIsEnumerable.call(n, o))
719
696
  return !1;
720
697
  if (typeof Object.getOwnPropertyDescriptor == "function") {
721
- var i = Object.getOwnPropertyDescriptor(n, o);
722
- if (i.value !== l || i.enumerable !== !0)
698
+ var l = (
699
+ /** @type {PropertyDescriptor} */
700
+ Object.getOwnPropertyDescriptor(n, o)
701
+ );
702
+ if (l.value !== a || l.enumerable !== !0)
723
703
  return !1;
724
704
  }
725
705
  return !0;
726
706
  }, "hasSymbols");
727
707
  }
728
- }), Mt = P({
729
- "node_modules/has-symbols/index.js"(r, t) {
708
+ }), qe = f({
709
+ "node_modules/.pnpm/has-symbols@1.1.0/node_modules/has-symbols/index.js"(t, e) {
730
710
  "use strict";
731
- var e = typeof Symbol < "u" && Symbol, n = Ft();
732
- t.exports = /* @__PURE__ */ a(function() {
733
- return typeof e != "function" || typeof Symbol != "function" || typeof e("foo") != "symbol" || typeof Symbol("bar") != "symbol" ? !1 :
711
+ var r = typeof Symbol < "u" && Symbol, n = We();
712
+ e.exports = /* @__PURE__ */ s(function() {
713
+ return typeof r != "function" || typeof Symbol != "function" || typeof r("foo") != "symbol" || typeof Symbol("bar") != "symbol" ? !1 :
734
714
  n();
735
715
  }, "hasNativeSymbols");
736
716
  }
737
- }), Ae = P({
738
- "node_modules/function-bind/implementation.js"(r, t) {
717
+ }), Be = f({
718
+ "node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/Reflect.getPrototypeOf.js"(t, e) {
719
+ "use strict";
720
+ e.exports = typeof Reflect < "u" && Reflect.getPrototypeOf || null;
721
+ }
722
+ }), He = f({
723
+ "node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/Object.getPrototypeOf.js"(t, e) {
724
+ "use strict";
725
+ var r = ke();
726
+ e.exports = r.getPrototypeOf || null;
727
+ }
728
+ }), Qt = f({
729
+ "node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/implementation.js"(t, e) {
739
730
  "use strict";
740
- var e = "Function.prototype.bind called on incompatible ", n = Array.prototype.slice, o = Object.prototype.toString, s = "[object Functi\
741
- on]";
742
- t.exports = /* @__PURE__ */ a(function(c) {
743
- var i = this;
744
- if (typeof i != "function" || o.call(i) !== s)
745
- throw new TypeError(e + i);
746
- for (var g = n.call(arguments, 1), p, u = /* @__PURE__ */ a(function() {
747
- if (this instanceof p) {
748
- var E = i.apply(
731
+ var r = "Function.prototype.bind called on incompatible ", n = Object.prototype.toString, o = Math.max, p = "[object Function]", a = /* @__PURE__ */ s(
732
+ function(d, u) {
733
+ for (var y = [], g = 0; g < d.length; g += 1)
734
+ y[g] = d[g];
735
+ for (var h = 0; h < u.length; h += 1)
736
+ y[h + d.length] = u[h];
737
+ return y;
738
+ }, "concatty2"), c = /* @__PURE__ */ s(function(d, u) {
739
+ for (var y = [], g = u || 0, h = 0; g < d.length; g += 1, h += 1)
740
+ y[h] = d[g];
741
+ return y;
742
+ }, "slicy2"), i = /* @__PURE__ */ s(function(l, d) {
743
+ for (var u = "", y = 0; y < l.length; y += 1)
744
+ u += l[y], y + 1 < l.length && (u += d);
745
+ return u;
746
+ }, "joiny");
747
+ e.exports = /* @__PURE__ */ s(function(d) {
748
+ var u = this;
749
+ if (typeof u != "function" || n.apply(u) !== p)
750
+ throw new TypeError(r + u);
751
+ for (var y = c(arguments, 1), g, h = /* @__PURE__ */ s(function() {
752
+ if (this instanceof g) {
753
+ var I = u.apply(
749
754
  this,
750
- g.concat(n.call(arguments))
755
+ a(y, arguments)
751
756
  );
752
- return Object(E) === E ? E : this;
753
- } else
754
- return i.apply(
755
- c,
756
- g.concat(n.call(arguments))
757
- );
758
- }, "binder"), y = Math.max(0, i.length - g.length), v = [], d = 0; d < y; d++)
759
- v.push("$" + d);
760
- if (p = Function("binder", "return function (" + v.join(",") + "){ return binder.apply(this,arguments); }")(u), i.prototype) {
761
- var m = /* @__PURE__ */ a(function() {
757
+ return Object(I) === I ? I : this;
758
+ }
759
+ return u.apply(
760
+ d,
761
+ a(y, arguments)
762
+ );
763
+ }, "binder"), C = o(0, u.length - y.length), w = [], A = 0; A < C; A++)
764
+ w[A] = "$" + A;
765
+ if (g = Function("binder", "return function (" + i(w, ",") + "){ return binder.apply(this,arguments); }")(h), u.prototype) {
766
+ var L = /* @__PURE__ */ s(function() {
762
767
  }, "Empty2");
763
- m.prototype = i.prototype, p.prototype = new m(), m.prototype = null;
768
+ L.prototype = u.prototype, g.prototype = new L(), L.prototype = null;
764
769
  }
765
- return p;
770
+ return g;
766
771
  }, "bind");
767
772
  }
768
- }), gt = P({
769
- "node_modules/function-bind/index.js"(r, t) {
773
+ }), pe = f({
774
+ "node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/index.js"(t, e) {
770
775
  "use strict";
771
- var e = Ae();
772
- t.exports = Function.prototype.bind || e;
776
+ var r = Qt();
777
+ e.exports = Function.prototype.bind || r;
773
778
  }
774
- }), we = P({
775
- "node_modules/has/src/index.js"(r, t) {
779
+ }), Ee = f({
780
+ "node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/functionCall.js"(t, e) {
776
781
  "use strict";
777
- var e = gt();
778
- t.exports = e.call(Function.call, Object.prototype.hasOwnProperty);
782
+ e.exports = Function.prototype.call;
779
783
  }
780
- }), $t = P({
781
- "node_modules/get-intrinsic/index.js"(r, t) {
784
+ }), Ve = f({
785
+ "node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/functionApply.js"(t, e) {
782
786
  "use strict";
783
- var e, n = SyntaxError, o = Function, s = TypeError, l = /* @__PURE__ */ a(function(j) {
784
- try {
785
- return o('"use strict"; return (' + j + ").constructor;")();
786
- } catch {
787
- }
788
- }, "getEvalledConstructor"), c = Object.getOwnPropertyDescriptor;
789
- if (c)
787
+ e.exports = Function.prototype.apply;
788
+ }
789
+ }), Zt = f({
790
+ "node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/reflectApply.js"(t, e) {
791
+ "use strict";
792
+ e.exports = typeof Reflect < "u" && Reflect && Reflect.apply;
793
+ }
794
+ }), er = f({
795
+ "node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/actualApply.js"(t, e) {
796
+ "use strict";
797
+ var r = pe(), n = Ve(), o = Ee(), p = Zt();
798
+ e.exports = p || r.call(o, n);
799
+ }
800
+ }), Je = f({
801
+ "node_modules/.pnpm/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/index.js"(t, e) {
802
+ "use strict";
803
+ var r = pe(), n = me(), o = Ee(), p = er();
804
+ e.exports = /* @__PURE__ */ s(function(c) {
805
+ if (c.length < 1 || typeof c[0] != "function")
806
+ throw new n("a function is required");
807
+ return p(r, o, c);
808
+ }, "callBindBasic");
809
+ }
810
+ }), tr = f({
811
+ "node_modules/.pnpm/dunder-proto@1.0.1/node_modules/dunder-proto/get.js"(t, e) {
812
+ "use strict";
813
+ var r = Je(), n = ve(), o;
814
+ try {
815
+ o = /** @type {{ __proto__?: typeof Array.prototype }} */
816
+ [].__proto__ === Array.prototype;
817
+ } catch (i) {
818
+ if (!i || typeof i != "object" || !("code" in i) || i.code !== "ERR_PROTO_ACCESS")
819
+ throw i;
820
+ }
821
+ var p = !!o && n && n(
822
+ Object.prototype,
823
+ /** @type {keyof typeof Object.prototype} */
824
+ "__proto__"
825
+ ), a = Object, c = a.getPrototypeOf;
826
+ e.exports = p && typeof p.get == "function" ? r([p.get]) : typeof c == "function" ? (
827
+ /** @type {import('./get')} */
828
+ /* @__PURE__ */ s(function(l) {
829
+ return c(l == null ? l : a(l));
830
+ }, "getDunder")
831
+ ) : !1;
832
+ }
833
+ }), rr = f({
834
+ "node_modules/.pnpm/get-proto@1.0.1/node_modules/get-proto/index.js"(t, e) {
835
+ "use strict";
836
+ var r = Be(), n = He(), o = tr();
837
+ e.exports = r ? /* @__PURE__ */ s(function(a) {
838
+ return r(a);
839
+ }, "getProto") : n ? /* @__PURE__ */ s(function(a) {
840
+ if (!a || typeof a != "object" && typeof a != "function")
841
+ throw new TypeError("getProto: not an object");
842
+ return n(a);
843
+ }, "getProto") : o ? /* @__PURE__ */ s(function(a) {
844
+ return o(a);
845
+ }, "getProto") : null;
846
+ }
847
+ }), ze = f({
848
+ "node_modules/.pnpm/hasown@2.0.2/node_modules/hasown/index.js"(t, e) {
849
+ "use strict";
850
+ var r = Function.prototype.call, n = Object.prototype.hasOwnProperty, o = pe();
851
+ e.exports = o.call(r, n);
852
+ }
853
+ }), nr = f({
854
+ "node_modules/.pnpm/get-intrinsic@1.3.0/node_modules/get-intrinsic/index.js"(t, e) {
855
+ "use strict";
856
+ var r, n = ke(), o = $t(), p = Ft(), a = Mt(), c = Ut(), i = Gt(), l = me(), d = kt(), u = Wt(), y = qt(), g = Bt(), h = Ht(), C = Vt(),
857
+ w = Jt(), A = Yt(), L = Function, I = /* @__PURE__ */ s(function(P) {
790
858
  try {
791
- c({}, "");
859
+ return L('"use strict"; return (' + P + ").constructor;")();
792
860
  } catch {
793
- c = null;
794
861
  }
795
- var i = /* @__PURE__ */ a(function() {
796
- throw new s();
797
- }, "throwTypeError"), g = c ? function() {
862
+ }, "getEvalledConstructor"), q = ve(), ft = Xt(), de = /* @__PURE__ */ s(function() {
863
+ throw new l();
864
+ }, "throwTypeError"), dt = q ? function() {
798
865
  try {
799
- return arguments.callee, i;
866
+ return arguments.callee, de;
800
867
  } catch {
801
868
  try {
802
- return c(arguments, "callee").get;
869
+ return q(arguments, "callee").get;
803
870
  } catch {
804
- return i;
871
+ return de;
805
872
  }
806
873
  }
807
- }() : i, p = Mt()(), u = Object.getPrototypeOf || function(j) {
808
- return j.__proto__;
809
- }, y = {}, v = typeof Uint8Array > "u" ? e : u(Uint8Array), d = {
810
- "%AggregateError%": typeof AggregateError > "u" ? e : AggregateError,
874
+ }() : de, D = qe()(), E = rr(), yt = He(), ht = Be(), Ce = Ve(), B = Ee(), $ = {}, gt = typeof Uint8Array > "u" || !E ? r : E(Uint8Array),
875
+ R = {
876
+ __proto__: null,
877
+ "%AggregateError%": typeof AggregateError > "u" ? r : AggregateError,
811
878
  "%Array%": Array,
812
- "%ArrayBuffer%": typeof ArrayBuffer > "u" ? e : ArrayBuffer,
813
- "%ArrayIteratorPrototype%": p ? u([][Symbol.iterator]()) : e,
814
- "%AsyncFromSyncIteratorPrototype%": e,
815
- "%AsyncFunction%": y,
816
- "%AsyncGenerator%": y,
817
- "%AsyncGeneratorFunction%": y,
818
- "%AsyncIteratorPrototype%": y,
819
- "%Atomics%": typeof Atomics > "u" ? e : Atomics,
820
- "%BigInt%": typeof BigInt > "u" ? e : BigInt,
879
+ "%ArrayBuffer%": typeof ArrayBuffer > "u" ? r : ArrayBuffer,
880
+ "%ArrayIteratorPrototype%": D && E ? E([][Symbol.iterator]()) : r,
881
+ "%AsyncFromSyncIteratorPrototype%": r,
882
+ "%AsyncFunction%": $,
883
+ "%AsyncGenerator%": $,
884
+ "%AsyncGeneratorFunction%": $,
885
+ "%AsyncIteratorPrototype%": $,
886
+ "%Atomics%": typeof Atomics > "u" ? r : Atomics,
887
+ "%BigInt%": typeof BigInt > "u" ? r : BigInt,
888
+ "%BigInt64Array%": typeof BigInt64Array > "u" ? r : BigInt64Array,
889
+ "%BigUint64Array%": typeof BigUint64Array > "u" ? r : BigUint64Array,
821
890
  "%Boolean%": Boolean,
822
- "%DataView%": typeof DataView > "u" ? e : DataView,
891
+ "%DataView%": typeof DataView > "u" ? r : DataView,
823
892
  "%Date%": Date,
824
893
  "%decodeURI%": decodeURI,
825
894
  "%decodeURIComponent%": decodeURIComponent,
826
895
  "%encodeURI%": encodeURI,
827
896
  "%encodeURIComponent%": encodeURIComponent,
828
- "%Error%": Error,
897
+ "%Error%": o,
829
898
  "%eval%": eval,
830
- "%EvalError%": EvalError,
831
- "%Float32Array%": typeof Float32Array > "u" ? e : Float32Array,
832
- "%Float64Array%": typeof Float64Array > "u" ? e : Float64Array,
833
- "%FinalizationRegistry%": typeof FinalizationRegistry > "u" ? e : FinalizationRegistry,
834
- "%Function%": o,
835
- "%GeneratorFunction%": y,
836
- "%Int8Array%": typeof Int8Array > "u" ? e : Int8Array,
837
- "%Int16Array%": typeof Int16Array > "u" ? e : Int16Array,
838
- "%Int32Array%": typeof Int32Array > "u" ? e : Int32Array,
899
+ // eslint-disable-line no-eval
900
+ "%EvalError%": p,
901
+ "%Float16Array%": typeof Float16Array > "u" ? r : Float16Array,
902
+ "%Float32Array%": typeof Float32Array > "u" ? r : Float32Array,
903
+ "%Float64Array%": typeof Float64Array > "u" ? r : Float64Array,
904
+ "%FinalizationRegistry%": typeof FinalizationRegistry > "u" ? r : FinalizationRegistry,
905
+ "%Function%": L,
906
+ "%GeneratorFunction%": $,
907
+ "%Int8Array%": typeof Int8Array > "u" ? r : Int8Array,
908
+ "%Int16Array%": typeof Int16Array > "u" ? r : Int16Array,
909
+ "%Int32Array%": typeof Int32Array > "u" ? r : Int32Array,
839
910
  "%isFinite%": isFinite,
840
911
  "%isNaN%": isNaN,
841
- "%IteratorPrototype%": p ? u(u([][Symbol.iterator]())) : e,
842
- "%JSON%": typeof JSON == "object" ? JSON : e,
843
- "%Map%": typeof Map > "u" ? e : Map,
844
- "%MapIteratorPrototype%": typeof Map > "u" || !p ? e : u((/* @__PURE__ */ new Map())[Symbol.iterator]()),
912
+ "%IteratorPrototype%": D && E ? E(E([][Symbol.iterator]())) : r,
913
+ "%JSON%": typeof JSON == "object" ? JSON : r,
914
+ "%Map%": typeof Map > "u" ? r : Map,
915
+ "%MapIteratorPrototype%": typeof Map > "u" || !D || !E ? r : E((/* @__PURE__ */ new Map())[Symbol.iterator]()),
845
916
  "%Math%": Math,
846
917
  "%Number%": Number,
847
- "%Object%": Object,
918
+ "%Object%": n,
919
+ "%Object.getOwnPropertyDescriptor%": q,
848
920
  "%parseFloat%": parseFloat,
849
921
  "%parseInt%": parseInt,
850
- "%Promise%": typeof Promise > "u" ? e : Promise,
851
- "%Proxy%": typeof Proxy > "u" ? e : Proxy,
852
- "%RangeError%": RangeError,
853
- "%ReferenceError%": ReferenceError,
854
- "%Reflect%": typeof Reflect > "u" ? e : Reflect,
922
+ "%Promise%": typeof Promise > "u" ? r : Promise,
923
+ "%Proxy%": typeof Proxy > "u" ? r : Proxy,
924
+ "%RangeError%": a,
925
+ "%ReferenceError%": c,
926
+ "%Reflect%": typeof Reflect > "u" ? r : Reflect,
855
927
  "%RegExp%": RegExp,
856
- "%Set%": typeof Set > "u" ? e : Set,
857
- "%SetIteratorPrototype%": typeof Set > "u" || !p ? e : u((/* @__PURE__ */ new Set())[Symbol.iterator]()),
858
- "%SharedArrayBuffer%": typeof SharedArrayBuffer > "u" ? e : SharedArrayBuffer,
928
+ "%Set%": typeof Set > "u" ? r : Set,
929
+ "%SetIteratorPrototype%": typeof Set > "u" || !D || !E ? r : E((/* @__PURE__ */ new Set())[Symbol.iterator]()),
930
+ "%SharedArrayBuffer%": typeof SharedArrayBuffer > "u" ? r : SharedArrayBuffer,
859
931
  "%String%": String,
860
- "%StringIteratorPrototype%": p ? u(""[Symbol.iterator]()) : e,
861
- "%Symbol%": p ? Symbol : e,
862
- "%SyntaxError%": n,
863
- "%ThrowTypeError%": g,
864
- "%TypedArray%": v,
865
- "%TypeError%": s,
866
- "%Uint8Array%": typeof Uint8Array > "u" ? e : Uint8Array,
867
- "%Uint8ClampedArray%": typeof Uint8ClampedArray > "u" ? e : Uint8ClampedArray,
868
- "%Uint16Array%": typeof Uint16Array > "u" ? e : Uint16Array,
869
- "%Uint32Array%": typeof Uint32Array > "u" ? e : Uint32Array,
870
- "%URIError%": URIError,
871
- "%WeakMap%": typeof WeakMap > "u" ? e : WeakMap,
872
- "%WeakRef%": typeof WeakRef > "u" ? e : WeakRef,
873
- "%WeakSet%": typeof WeakSet > "u" ? e : WeakSet
874
- }, m = /* @__PURE__ */ a(function j(b) {
875
- var A;
876
- if (b === "%AsyncFunction%")
877
- A = l("async function () {}");
878
- else if (b === "%GeneratorFunction%")
879
- A = l("function* () {}");
880
- else if (b === "%AsyncGeneratorFunction%")
881
- A = l("async function* () {}");
882
- else if (b === "%AsyncGenerator%") {
883
- var _ = j("%AsyncGeneratorFunction%");
884
- _ && (A = _.prototype);
885
- } else if (b === "%AsyncIteratorPrototype%") {
886
- var w = j("%AsyncGenerator%");
887
- w && (A = u(w.prototype));
932
+ "%StringIteratorPrototype%": D && E ? E(""[Symbol.iterator]()) : r,
933
+ "%Symbol%": D ? Symbol : r,
934
+ "%SyntaxError%": i,
935
+ "%ThrowTypeError%": dt,
936
+ "%TypedArray%": gt,
937
+ "%TypeError%": l,
938
+ "%Uint8Array%": typeof Uint8Array > "u" ? r : Uint8Array,
939
+ "%Uint8ClampedArray%": typeof Uint8ClampedArray > "u" ? r : Uint8ClampedArray,
940
+ "%Uint16Array%": typeof Uint16Array > "u" ? r : Uint16Array,
941
+ "%Uint32Array%": typeof Uint32Array > "u" ? r : Uint32Array,
942
+ "%URIError%": d,
943
+ "%WeakMap%": typeof WeakMap > "u" ? r : WeakMap,
944
+ "%WeakRef%": typeof WeakRef > "u" ? r : WeakRef,
945
+ "%WeakSet%": typeof WeakSet > "u" ? r : WeakSet,
946
+ "%Function.prototype.call%": B,
947
+ "%Function.prototype.apply%": Ce,
948
+ "%Object.defineProperty%": ft,
949
+ "%Object.getPrototypeOf%": yt,
950
+ "%Math.abs%": u,
951
+ "%Math.floor%": y,
952
+ "%Math.max%": g,
953
+ "%Math.min%": h,
954
+ "%Math.pow%": C,
955
+ "%Math.round%": w,
956
+ "%Math.sign%": A,
957
+ "%Reflect.getPrototypeOf%": ht
958
+ };
959
+ if (E)
960
+ try {
961
+ null.error;
962
+ } catch (P) {
963
+ Ne = E(E(P)), R["%Error.prototype%"] = Ne;
888
964
  }
889
- return d[b] = A, A;
890
- }, "doEval2"), E = {
965
+ var Ne, mt = /* @__PURE__ */ s(function P(m) {
966
+ var _;
967
+ if (m === "%AsyncFunction%")
968
+ _ = I("async function () {}");
969
+ else if (m === "%GeneratorFunction%")
970
+ _ = I("function* () {}");
971
+ else if (m === "%AsyncGeneratorFunction%")
972
+ _ = I("async function* () {}");
973
+ else if (m === "%AsyncGenerator%") {
974
+ var v = P("%AsyncGeneratorFunction%");
975
+ v && (_ = v.prototype);
976
+ } else if (m === "%AsyncIteratorPrototype%") {
977
+ var S = P("%AsyncGenerator%");
978
+ S && E && (_ = E(S.prototype));
979
+ }
980
+ return R[m] = _, _;
981
+ }, "doEval2"), Ie = {
982
+ __proto__: null,
891
983
  "%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"],
892
984
  "%ArrayPrototype%": ["Array", "prototype"],
893
985
  "%ArrayProto_entries%": ["Array", "prototype", "entries"],
@@ -939,601 +1031,576 @@ on]";
939
1031
  "%URIErrorPrototype%": ["URIError", "prototype"],
940
1032
  "%WeakMapPrototype%": ["WeakMap", "prototype"],
941
1033
  "%WeakSetPrototype%": ["WeakSet", "prototype"]
942
- }, I = gt(), T = we(), R = I.call(Function.call, Array.prototype.concat), C = I.call(Function.apply, Array.prototype.splice), N = I.call(
943
- Function.call, String.prototype.replace), Q = I.call(Function.call, String.prototype.slice), ee = I.call(Function.call, RegExp.prototype.
944
- exec), re = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g, ne = /\\(\\)?/g, oe = /* @__PURE__ */ a(
945
- function(b) {
946
- var A = Q(b, 0, 1), _ = Q(b, -1);
947
- if (A === "%" && _ !== "%")
948
- throw new n("invalid intrinsic syntax, expected closing `%`");
949
- if (_ === "%" && A !== "%")
950
- throw new n("invalid intrinsic syntax, expected opening `%`");
951
- var w = [];
952
- return N(b, re, function(L, M, O, Z) {
953
- w[w.length] = O ? N(Z, ne, "$1") : M || L;
954
- }), w;
955
- }, "stringToPath3"), ie = /* @__PURE__ */ a(function(b, A) {
956
- var _ = b, w;
957
- if (T(E, _) && (w = E[_], _ = "%" + w[0] + "%"), T(d, _)) {
958
- var L = d[_];
959
- if (L === y && (L = m(_)), typeof L > "u" && !A)
960
- throw new s("intrinsic " + b + " exists, but is not available. Please file an issue!");
1034
+ }, H = pe(), ee = ze(), vt = H.call(B, Array.prototype.concat), Et = H.call(Ce, Array.prototype.splice), Re = H.call(B, String.prototype.
1035
+ replace), te = H.call(B, String.prototype.slice), _t = H.call(B, RegExp.prototype.exec), bt = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,
1036
+ St = /\\(\\)?/g, Tt = /* @__PURE__ */ s(function(m) {
1037
+ var _ = te(m, 0, 1), v = te(m, -1);
1038
+ if (_ === "%" && v !== "%")
1039
+ throw new i("invalid intrinsic syntax, expected closing `%`");
1040
+ if (v === "%" && _ !== "%")
1041
+ throw new i("invalid intrinsic syntax, expected opening `%`");
1042
+ var S = [];
1043
+ return Re(m, bt, function(O, F, T, re) {
1044
+ S[S.length] = T ? Re(re, St, "$1") : F || O;
1045
+ }), S;
1046
+ }, "stringToPath3"), At = /* @__PURE__ */ s(function(m, _) {
1047
+ var v = m, S;
1048
+ if (ee(Ie, v) && (S = Ie[v], v = "%" + S[0] + "%"), ee(R, v)) {
1049
+ var O = R[v];
1050
+ if (O === $ && (O = mt(v)), typeof O > "u" && !_)
1051
+ throw new l("intrinsic " + m + " exists, but is not available. Please file an issue!");
961
1052
  return {
962
- alias: w,
963
- name: _,
964
- value: L
1053
+ alias: S,
1054
+ name: v,
1055
+ value: O
965
1056
  };
966
1057
  }
967
- throw new n("intrinsic " + b + " does not exist!");
1058
+ throw new i("intrinsic " + m + " does not exist!");
968
1059
  }, "getBaseIntrinsic2");
969
- t.exports = /* @__PURE__ */ a(function(b, A) {
970
- if (typeof b != "string" || b.length === 0)
971
- throw new s("intrinsic name must be a non-empty string");
972
- if (arguments.length > 1 && typeof A != "boolean")
973
- throw new s('"allowMissing" argument must be a boolean');
974
- if (ee(/^%?[^%]*%?$/, b) === null)
975
- throw new n("`%` may not be present anywhere but at the beginning and end of the intrinsic name");
976
- var _ = oe(b), w = _.length > 0 ? _[0] : "", L = ie("%" + w + "%", A), M = L.name, O = L.value, Z = !1, pt = L.alias;
977
- pt && (w = pt[0], C(_, R([0, 1], pt)));
978
- for (var tt = 1, z = !0; tt < _.length; tt += 1) {
979
- var D = _[tt], et = Q(D, 0, 1), rt = Q(D, -1);
980
- if ((et === '"' || et === "'" || et === "`" || rt === '"' || rt === "'" || rt === "`") && et !== rt)
981
- throw new n("property names with quotes must have matching quotes");
982
- if ((D === "constructor" || !z) && (Z = !0), w += "." + D, M = "%" + w + "%", T(d, M))
983
- O = d[M];
984
- else if (O != null) {
985
- if (!(D in O)) {
986
- if (!A)
987
- throw new s("base intrinsic for " + b + " exists, but the property is not available.");
1060
+ e.exports = /* @__PURE__ */ s(function(m, _) {
1061
+ if (typeof m != "string" || m.length === 0)
1062
+ throw new l("intrinsic name must be a non-empty string");
1063
+ if (arguments.length > 1 && typeof _ != "boolean")
1064
+ throw new l('"allowMissing" argument must be a boolean');
1065
+ if (_t(/^%?[^%]*%?$/, m) === null)
1066
+ throw new i("`%` may not be present anywhere but at the beginning and end of the intrinsic name");
1067
+ var v = Tt(m), S = v.length > 0 ? v[0] : "", O = At("%" + S + "%", _), F = O.name, T = O.value, re = !1, ye = O.alias;
1068
+ ye && (S = ye[0], Et(v, vt([0, 1], ye)));
1069
+ for (var ne = 1, V = !0; ne < v.length; ne += 1) {
1070
+ var N = v[ne], oe = te(N, 0, 1), se = te(N, -1);
1071
+ if ((oe === '"' || oe === "'" || oe === "`" || se === '"' || se === "'" || se === "`") && oe !== se)
1072
+ throw new i("property names with quotes must have matching quotes");
1073
+ if ((N === "constructor" || !V) && (re = !0), S += "." + N, F = "%" + S + "%", ee(R, F))
1074
+ T = R[F];
1075
+ else if (T != null) {
1076
+ if (!(N in T)) {
1077
+ if (!_)
1078
+ throw new l("base intrinsic for " + m + " exists, but the property is not available.");
988
1079
  return;
989
1080
  }
990
- if (c && tt + 1 >= _.length) {
991
- var nt = c(O, D);
992
- z = !!nt, z && "get" in nt && !("originalValue" in nt.get) ? O = nt.get : O = O[D];
1081
+ if (q && ne + 1 >= v.length) {
1082
+ var ie = q(T, N);
1083
+ V = !!ie, V && "get" in ie && !("originalValue" in ie.get) ? T = ie.get : T = T[N];
993
1084
  } else
994
- z = T(O, D), O = O[D];
995
- z && !Z && (d[M] = O);
1085
+ V = ee(T, N), T = T[N];
1086
+ V && !re && (R[F] = T);
996
1087
  }
997
1088
  }
998
- return O;
1089
+ return T;
999
1090
  }, "GetIntrinsic");
1000
1091
  }
1001
- }), Oe = P({
1002
- "node_modules/call-bind/index.js"(r, t) {
1092
+ }), _e = f({
1093
+ "node_modules/.pnpm/call-bound@1.0.4/node_modules/call-bound/index.js"(t, e) {
1003
1094
  "use strict";
1004
- var e = gt(), n = $t(), o = n("%Function.prototype.apply%"), s = n("%Function.prototype.call%"), l = n("%Reflect.apply%", !0) || e.call(
1005
- s, o), c = n("%Object.getOwnPropertyDescriptor%", !0), i = n("%Object.defineProperty%", !0), g = n("%Math.max%");
1006
- if (i)
1007
- try {
1008
- i({}, "a", { value: 1 });
1009
- } catch {
1010
- i = null;
1011
- }
1012
- t.exports = /* @__PURE__ */ a(function(y) {
1013
- var v = l(e, s, arguments);
1014
- if (c && i) {
1015
- var d = c(v, "length");
1016
- d.configurable && i(
1017
- v,
1018
- "length",
1019
- { value: 1 + g(0, y.length - (arguments.length - 1)) }
1020
- );
1021
- }
1022
- return v;
1023
- }, "callBind");
1024
- var p = /* @__PURE__ */ a(function() {
1025
- return l(e, o, arguments);
1026
- }, "applyBind2");
1027
- i ? i(t.exports, "apply", { value: p }) : t.exports.apply = p;
1028
- }
1029
- }), Ce = P({
1030
- "node_modules/call-bind/callBound.js"(r, t) {
1031
- "use strict";
1032
- var e = $t(), n = Oe(), o = n(e("String.prototype.indexOf"));
1033
- t.exports = /* @__PURE__ */ a(function(l, c) {
1034
- var i = e(l, !!c);
1035
- return typeof i == "function" && o(l, ".prototype.") > -1 ? n(i) : i;
1095
+ var r = nr(), n = Je(), o = n([r("%String.prototype.indexOf%")]);
1096
+ e.exports = /* @__PURE__ */ s(function(a, c) {
1097
+ var i = (
1098
+ /** @type {(this: unknown, ...args: unknown[]) => unknown} */
1099
+ r(a, !!c)
1100
+ );
1101
+ return typeof i == "function" && o(a, ".prototype.") > -1 ? n(
1102
+ /** @type {const} */
1103
+ [i]
1104
+ ) : i;
1036
1105
  }, "callBoundIntrinsic");
1037
1106
  }
1038
- }), Pe = P({
1039
- "node_modules/has-tostringtag/shams.js"(r, t) {
1107
+ }), or = f({
1108
+ "node_modules/.pnpm/has-tostringtag@1.0.2/node_modules/has-tostringtag/shams.js"(t, e) {
1040
1109
  "use strict";
1041
- var e = Ft();
1042
- t.exports = /* @__PURE__ */ a(function() {
1043
- return e() && !!Symbol.toStringTag;
1110
+ var r = We();
1111
+ e.exports = /* @__PURE__ */ s(function() {
1112
+ return r() && !!Symbol.toStringTag;
1044
1113
  }, "hasToStringTagShams");
1045
1114
  }
1046
- }), Ie = P({
1047
- "node_modules/is-regex/index.js"(r, t) {
1115
+ }), Ye = f({
1116
+ "node_modules/.pnpm/is-regex@1.2.1/node_modules/is-regex/index.js"(t, e) {
1048
1117
  "use strict";
1049
- var e = Ce(), n = Pe()(), o, s, l, c;
1050
- n && (o = e("Object.prototype.hasOwnProperty"), s = e("RegExp.prototype.exec"), l = {}, i = /* @__PURE__ */ a(function() {
1051
- throw l;
1052
- }, "throwRegexMarker"), c = {
1053
- toString: i,
1054
- valueOf: i
1055
- }, typeof Symbol.toPrimitive == "symbol" && (c[Symbol.toPrimitive] = i));
1056
- var i, g = e("Object.prototype.toString"), p = Object.getOwnPropertyDescriptor, u = "[object RegExp]";
1057
- t.exports = /* @__PURE__ */ a(n ? function(v) {
1058
- if (!v || typeof v != "object")
1118
+ var r = _e(), n = or()(), o = ze(), p = ve(), a;
1119
+ n ? (c = r("RegExp.prototype.exec"), i = {}, l = /* @__PURE__ */ s(function() {
1120
+ throw i;
1121
+ }, "throwRegexMarker"), d = {
1122
+ toString: l,
1123
+ valueOf: l
1124
+ }, typeof Symbol.toPrimitive == "symbol" && (d[Symbol.toPrimitive] = l), a = /* @__PURE__ */ s(function(h) {
1125
+ if (!h || typeof h != "object")
1059
1126
  return !1;
1060
- var d = p(v, "lastIndex"), m = d && o(d, "value");
1061
- if (!m)
1127
+ var C = (
1128
+ /** @type {NonNullable<typeof gOPD>} */
1129
+ p(
1130
+ /** @type {{ lastIndex?: unknown }} */
1131
+ h,
1132
+ "lastIndex"
1133
+ )
1134
+ ), w = C && o(C, "value");
1135
+ if (!w)
1062
1136
  return !1;
1063
1137
  try {
1064
- s(v, c);
1065
- } catch (E) {
1066
- return E === l;
1138
+ c(
1139
+ h,
1140
+ /** @type {string} */
1141
+ /** @type {unknown} */
1142
+ d
1143
+ );
1144
+ } catch (A) {
1145
+ return A === i;
1067
1146
  }
1068
- } : function(v) {
1069
- return !v || typeof v != "object" && typeof v != "function" ? !1 : g(v) === u;
1070
- }, "isRegex");
1071
- }
1072
- }), xe = P({
1073
- "node_modules/is-function/index.js"(r, t) {
1074
- t.exports = n;
1075
- var e = Object.prototype.toString;
1147
+ }, "isRegex")) : (u = r("Object.prototype.toString"), y = "[object RegExp]", a = /* @__PURE__ */ s(function(h) {
1148
+ return !h || typeof h != "object" && typeof h != "function" ? !1 : u(h) === y;
1149
+ }, "isRegex"));
1150
+ var c, i, l, d, u, y;
1151
+ e.exports = a;
1152
+ }
1153
+ }), sr = f({
1154
+ "node_modules/.pnpm/is-function@1.0.2/node_modules/is-function/index.js"(t, e) {
1155
+ e.exports = n;
1156
+ var r = Object.prototype.toString;
1076
1157
  function n(o) {
1077
1158
  if (!o)
1078
1159
  return !1;
1079
- var s = e.call(o);
1080
- return s === "[object Function]" || typeof o == "function" && s !== "[object RegExp]" || typeof window < "u" && (o === window.setTimeout ||
1081
- o === window.alert || o === window.confirm || o === window.prompt);
1160
+ var p = r.call(o);
1161
+ return p === "[object Function]" || typeof o == "function" && p !== "[object RegExp]" || typeof window < "u" && // IE8 and below
1162
+ (o === window.setTimeout || o === window.alert || o === window.confirm || o === window.prompt);
1082
1163
  }
1083
- a(n, "isFunction3");
1164
+ s(n, "isFunction3");
1084
1165
  }
1085
- }), Re = P({
1086
- "node_modules/is-symbol/index.js"(r, t) {
1166
+ }), ir = f({
1167
+ "node_modules/.pnpm/safe-regex-test@1.1.0/node_modules/safe-regex-test/index.js"(t, e) {
1168
+ "use strict";
1169
+ var r = _e(), n = Ye(), o = r("RegExp.prototype.exec"), p = me();
1170
+ e.exports = /* @__PURE__ */ s(function(c) {
1171
+ if (!n(c))
1172
+ throw new p("`regex` must be a RegExp");
1173
+ return /* @__PURE__ */ s(function(l) {
1174
+ return o(c, l) !== null;
1175
+ }, "test");
1176
+ }, "regexTester");
1177
+ }
1178
+ }), ar = f({
1179
+ "node_modules/.pnpm/is-symbol@1.1.1/node_modules/is-symbol/index.js"(t, e) {
1087
1180
  "use strict";
1088
- var e = Object.prototype.toString, n = Mt()();
1089
- n ? (o = Symbol.prototype.toString, s = /^Symbol\(.*\)$/, l = /* @__PURE__ */ a(function(i) {
1090
- return typeof i.valueOf() != "symbol" ? !1 : s.test(o.call(i));
1091
- }, "isRealSymbolObject"), t.exports = /* @__PURE__ */ a(function(i) {
1092
- if (typeof i == "symbol")
1181
+ var r = _e(), n = r("Object.prototype.toString"), o = qe()(), p = ir();
1182
+ o ? (a = r("Symbol.prototype.toString"), c = p(/^Symbol\(.*\)$/), i = /* @__PURE__ */ s(function(d) {
1183
+ return typeof d.valueOf() != "symbol" ? !1 : c(a(d));
1184
+ }, "isRealSymbolObject"), e.exports = /* @__PURE__ */ s(function(d) {
1185
+ if (typeof d == "symbol")
1093
1186
  return !0;
1094
- if (e.call(i) !== "[object Symbol]")
1187
+ if (!d || typeof d != "object" || n(d) !== "[object Symbol]")
1095
1188
  return !1;
1096
1189
  try {
1097
- return l(i);
1190
+ return i(d);
1098
1191
  } catch {
1099
1192
  return !1;
1100
1193
  }
1101
- }, "isSymbol3")) : t.exports = /* @__PURE__ */ a(function(i) {
1194
+ }, "isSymbol3")) : e.exports = /* @__PURE__ */ s(function(d) {
1102
1195
  return !1;
1103
1196
  }, "isSymbol3");
1104
- var o, s, l;
1197
+ var a, c, i;
1105
1198
  }
1106
- }), Ne = ot(Ie()), je = ot(xe()), Le = ot(Re());
1107
- function De(r) {
1108
- return r != null && typeof r == "object" && Array.isArray(r) === !1;
1199
+ }), pr = ae(Ye()), cr = ae(sr()), lr = ae(ar());
1200
+ function ur(t) {
1201
+ return t != null && typeof t == "object" && Array.isArray(t) === !1;
1109
1202
  }
1110
- a(De, "isObject");
1111
- var Fe = typeof global == "object" && global && global.Object === Object && global, Me = Fe, $e = typeof self == "object" && self && self.Object ===
1112
- Object && self, Ue = Me || $e || Function("return this")(), vt = Ue, ke = vt.Symbol, U = ke, Ut = Object.prototype, Ge = Ut.hasOwnProperty, We = Ut.
1113
- toString, q = U ? U.toStringTag : void 0;
1114
- function ze(r) {
1115
- var t = Ge.call(r, q), e = r[q];
1203
+ s(ur, "isObject");
1204
+ var fr = typeof global == "object" && global && global.Object === Object && global, dr = fr, yr = typeof self == "object" && self && self.Object ===
1205
+ Object && self, hr = dr || yr || Function("return this")(), be = hr, gr = be.Symbol, U = gr, Ke = Object.prototype, mr = Ke.hasOwnProperty, vr = Ke.
1206
+ toString, z = U ? U.toStringTag : void 0;
1207
+ function Er(t) {
1208
+ var e = mr.call(t, z), r = t[z];
1116
1209
  try {
1117
- r[q] = void 0;
1210
+ t[z] = void 0;
1118
1211
  var n = !0;
1119
1212
  } catch {
1120
1213
  }
1121
- var o = We.call(r);
1122
- return n && (t ? r[q] = e : delete r[q]), o;
1214
+ var o = vr.call(t);
1215
+ return n && (e ? t[z] = r : delete t[z]), o;
1123
1216
  }
1124
- a(ze, "getRawTag");
1125
- var He = ze, Be = Object.prototype, qe = Be.toString;
1126
- function Ve(r) {
1127
- return qe.call(r);
1217
+ s(Er, "getRawTag");
1218
+ var _r = Er, br = Object.prototype, Sr = br.toString;
1219
+ function Tr(t) {
1220
+ return Sr.call(t);
1128
1221
  }
1129
- a(Ve, "objectToString");
1130
- var Je = Ve, Ke = "[object Null]", Ye = "[object Undefined]", Rt = U ? U.toStringTag : void 0;
1131
- function Xe(r) {
1132
- return r == null ? r === void 0 ? Ye : Ke : Rt && Rt in Object(r) ? He(r) : Je(r);
1222
+ s(Tr, "objectToString");
1223
+ var Ar = Tr, xr = "[object Null]", wr = "[object Undefined]", $e = U ? U.toStringTag : void 0;
1224
+ function Pr(t) {
1225
+ return t == null ? t === void 0 ? wr : xr : $e && $e in Object(t) ? _r(t) : Ar(t);
1133
1226
  }
1134
- a(Xe, "baseGetTag");
1135
- var kt = Xe;
1136
- function Qe(r) {
1137
- return r != null && typeof r == "object";
1227
+ s(Pr, "baseGetTag");
1228
+ var Xe = Pr;
1229
+ function Or(t) {
1230
+ return t != null && typeof t == "object";
1138
1231
  }
1139
- a(Qe, "isObjectLike");
1140
- var Ze = Qe, tr = "[object Symbol]";
1141
- function er(r) {
1142
- return typeof r == "symbol" || Ze(r) && kt(r) == tr;
1232
+ s(Or, "isObjectLike");
1233
+ var Cr = Or, Nr = "[object Symbol]";
1234
+ function Ir(t) {
1235
+ return typeof t == "symbol" || Cr(t) && Xe(t) == Nr;
1143
1236
  }
1144
- a(er, "isSymbol");
1145
- var mt = er;
1146
- function rr(r, t) {
1147
- for (var e = -1, n = r == null ? 0 : r.length, o = Array(n); ++e < n; )
1148
- o[e] = t(r[e], e, r);
1237
+ s(Ir, "isSymbol");
1238
+ var Se = Ir;
1239
+ function Rr(t, e) {
1240
+ for (var r = -1, n = t == null ? 0 : t.length, o = Array(n); ++r < n; )
1241
+ o[r] = e(t[r], r, t);
1149
1242
  return o;
1150
1243
  }
1151
- a(rr, "arrayMap");
1152
- var nr = rr, or = Array.isArray, Et = or, ir = 1 / 0, Nt = U ? U.prototype : void 0, jt = Nt ? Nt.toString : void 0;
1153
- function Gt(r) {
1154
- if (typeof r == "string")
1155
- return r;
1156
- if (Et(r))
1157
- return nr(r, Gt) + "";
1158
- if (mt(r))
1159
- return jt ? jt.call(r) : "";
1160
- var t = r + "";
1161
- return t == "0" && 1 / r == -ir ? "-0" : t;
1244
+ s(Rr, "arrayMap");
1245
+ var jr = Rr, Lr = Array.isArray, Te = Lr, Dr = 1 / 0, Fe = U ? U.prototype : void 0, Me = Fe ? Fe.toString : void 0;
1246
+ function Qe(t) {
1247
+ if (typeof t == "string")
1248
+ return t;
1249
+ if (Te(t))
1250
+ return jr(t, Qe) + "";
1251
+ if (Se(t))
1252
+ return Me ? Me.call(t) : "";
1253
+ var e = t + "";
1254
+ return e == "0" && 1 / t == -Dr ? "-0" : e;
1162
1255
  }
1163
- a(Gt, "baseToString");
1164
- var ar = Gt;
1165
- function sr(r) {
1166
- var t = typeof r;
1167
- return r != null && (t == "object" || t == "function");
1256
+ s(Qe, "baseToString");
1257
+ var $r = Qe;
1258
+ function Fr(t) {
1259
+ var e = typeof t;
1260
+ return t != null && (e == "object" || e == "function");
1168
1261
  }
1169
- a(sr, "isObject2");
1170
- var Wt = sr, lr = "[object AsyncFunction]", cr = "[object Function]", pr = "[object GeneratorFunction]", ur = "[object Proxy]";
1171
- function fr(r) {
1172
- if (!Wt(r))
1262
+ s(Fr, "isObject2");
1263
+ var Ze = Fr, Mr = "[object AsyncFunction]", Ur = "[object Function]", Gr = "[object GeneratorFunction]", kr = "[object Proxy]";
1264
+ function Wr(t) {
1265
+ if (!Ze(t))
1173
1266
  return !1;
1174
- var t = kt(r);
1175
- return t == cr || t == pr || t == lr || t == ur;
1267
+ var e = Xe(t);
1268
+ return e == Ur || e == Gr || e == Mr || e == kr;
1176
1269
  }
1177
- a(fr, "isFunction");
1178
- var hr = fr, yr = vt["__core-js_shared__"], dt = yr, Lt = function() {
1179
- var r = /[^.]+$/.exec(dt && dt.keys && dt.keys.IE_PROTO || "");
1180
- return r ? "Symbol(src)_1." + r : "";
1270
+ s(Wr, "isFunction");
1271
+ var qr = Wr, Br = be["__core-js_shared__"], ge = Br, Ue = function() {
1272
+ var t = /[^.]+$/.exec(ge && ge.keys && ge.keys.IE_PROTO || "");
1273
+ return t ? "Symbol(src)_1." + t : "";
1181
1274
  }();
1182
- function dr(r) {
1183
- return !!Lt && Lt in r;
1275
+ function Hr(t) {
1276
+ return !!Ue && Ue in t;
1184
1277
  }
1185
- a(dr, "isMasked");
1186
- var gr = dr, vr = Function.prototype, mr = vr.toString;
1187
- function Er(r) {
1188
- if (r != null) {
1278
+ s(Hr, "isMasked");
1279
+ var Vr = Hr, Jr = Function.prototype, zr = Jr.toString;
1280
+ function Yr(t) {
1281
+ if (t != null) {
1189
1282
  try {
1190
- return mr.call(r);
1283
+ return zr.call(t);
1191
1284
  } catch {
1192
1285
  }
1193
1286
  try {
1194
- return r + "";
1287
+ return t + "";
1195
1288
  } catch {
1196
1289
  }
1197
1290
  }
1198
1291
  return "";
1199
1292
  }
1200
- a(Er, "toSource");
1201
- var br = Er, Sr = /[\\^$.*+?()[\]{}|]/g, _r = /^\[object .+?Constructor\]$/, Tr = Function.prototype, Ar = Object.prototype, wr = Tr.toString,
1202
- Or = Ar.hasOwnProperty, Cr = RegExp(
1203
- "^" + wr.call(Or).replace(Sr, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
1293
+ s(Yr, "toSource");
1294
+ var Kr = Yr, Xr = /[\\^$.*+?()[\]{}|]/g, Qr = /^\[object .+?Constructor\]$/, Zr = Function.prototype, en = Object.prototype, tn = Zr.toString,
1295
+ rn = en.hasOwnProperty, nn = RegExp(
1296
+ "^" + tn.call(rn).replace(Xr, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
1204
1297
  );
1205
- function Pr(r) {
1206
- if (!Wt(r) || gr(r))
1298
+ function on(t) {
1299
+ if (!Ze(t) || Vr(t))
1207
1300
  return !1;
1208
- var t = hr(r) ? Cr : _r;
1209
- return t.test(br(r));
1301
+ var e = qr(t) ? nn : Qr;
1302
+ return e.test(Kr(t));
1210
1303
  }
1211
- a(Pr, "baseIsNative");
1212
- var Ir = Pr;
1213
- function xr(r, t) {
1214
- return r?.[t];
1304
+ s(on, "baseIsNative");
1305
+ var sn = on;
1306
+ function an(t, e) {
1307
+ return t?.[e];
1215
1308
  }
1216
- a(xr, "getValue");
1217
- var Rr = xr;
1218
- function Nr(r, t) {
1219
- var e = Rr(r, t);
1220
- return Ir(e) ? e : void 0;
1309
+ s(an, "getValue");
1310
+ var pn = an;
1311
+ function cn(t, e) {
1312
+ var r = pn(t, e);
1313
+ return sn(r) ? r : void 0;
1221
1314
  }
1222
- a(Nr, "getNative");
1223
- var zt = Nr;
1224
- function jr(r, t) {
1225
- return r === t || r !== r && t !== t;
1315
+ s(cn, "getNative");
1316
+ var et = cn;
1317
+ function ln(t, e) {
1318
+ return t === e || t !== t && e !== e;
1226
1319
  }
1227
- a(jr, "eq");
1228
- var Lr = jr, Dr = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, Fr = /^\w*$/;
1229
- function Mr(r, t) {
1230
- if (Et(r))
1320
+ s(ln, "eq");
1321
+ var un = ln, fn = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, dn = /^\w*$/;
1322
+ function yn(t, e) {
1323
+ if (Te(t))
1231
1324
  return !1;
1232
- var e = typeof r;
1233
- return e == "number" || e == "symbol" || e == "boolean" || r == null || mt(r) ? !0 : Fr.test(r) || !Dr.test(r) || t != null && r in Object(
1234
- t);
1325
+ var r = typeof t;
1326
+ return r == "number" || r == "symbol" || r == "boolean" || t == null || Se(t) ? !0 : dn.test(t) || !fn.test(t) || e != null && t in Object(
1327
+ e);
1235
1328
  }
1236
- a(Mr, "isKey");
1237
- var $r = Mr, Ur = zt(Object, "create"), V = Ur;
1238
- function kr() {
1239
- this.__data__ = V ? V(null) : {}, this.size = 0;
1329
+ s(yn, "isKey");
1330
+ var hn = yn, gn = et(Object, "create"), Y = gn;
1331
+ function mn() {
1332
+ this.__data__ = Y ? Y(null) : {}, this.size = 0;
1240
1333
  }
1241
- a(kr, "hashClear");
1242
- var Gr = kr;
1243
- function Wr(r) {
1244
- var t = this.has(r) && delete this.__data__[r];
1245
- return this.size -= t ? 1 : 0, t;
1334
+ s(mn, "hashClear");
1335
+ var vn = mn;
1336
+ function En(t) {
1337
+ var e = this.has(t) && delete this.__data__[t];
1338
+ return this.size -= e ? 1 : 0, e;
1246
1339
  }
1247
- a(Wr, "hashDelete");
1248
- var zr = Wr, Hr = "__lodash_hash_undefined__", Br = Object.prototype, qr = Br.hasOwnProperty;
1249
- function Vr(r) {
1250
- var t = this.__data__;
1251
- if (V) {
1252
- var e = t[r];
1253
- return e === Hr ? void 0 : e;
1254
- }
1255
- return qr.call(t, r) ? t[r] : void 0;
1256
- }
1257
- a(Vr, "hashGet");
1258
- var Jr = Vr, Kr = Object.prototype, Yr = Kr.hasOwnProperty;
1259
- function Xr(r) {
1260
- var t = this.__data__;
1261
- return V ? t[r] !== void 0 : Yr.call(t, r);
1340
+ s(En, "hashDelete");
1341
+ var _n = En, bn = "__lodash_hash_undefined__", Sn = Object.prototype, Tn = Sn.hasOwnProperty;
1342
+ function An(t) {
1343
+ var e = this.__data__;
1344
+ if (Y) {
1345
+ var r = e[t];
1346
+ return r === bn ? void 0 : r;
1347
+ }
1348
+ return Tn.call(e, t) ? e[t] : void 0;
1262
1349
  }
1263
- a(Xr, "hashHas");
1264
- var Qr = Xr, Zr = "__lodash_hash_undefined__";
1265
- function tn(r, t) {
1350
+ s(An, "hashGet");
1351
+ var xn = An, wn = Object.prototype, Pn = wn.hasOwnProperty;
1352
+ function On(t) {
1266
1353
  var e = this.__data__;
1267
- return this.size += this.has(r) ? 0 : 1, e[r] = V && t === void 0 ? Zr : t, this;
1354
+ return Y ? e[t] !== void 0 : Pn.call(e, t);
1268
1355
  }
1269
- a(tn, "hashSet");
1270
- var en = tn;
1271
- function k(r) {
1272
- var t = -1, e = r == null ? 0 : r.length;
1273
- for (this.clear(); ++t < e; ) {
1274
- var n = r[t];
1356
+ s(On, "hashHas");
1357
+ var Cn = On, Nn = "__lodash_hash_undefined__";
1358
+ function In(t, e) {
1359
+ var r = this.__data__;
1360
+ return this.size += this.has(t) ? 0 : 1, r[t] = Y && e === void 0 ? Nn : e, this;
1361
+ }
1362
+ s(In, "hashSet");
1363
+ var Rn = In;
1364
+ function G(t) {
1365
+ var e = -1, r = t == null ? 0 : t.length;
1366
+ for (this.clear(); ++e < r; ) {
1367
+ var n = t[e];
1275
1368
  this.set(n[0], n[1]);
1276
1369
  }
1277
1370
  }
1278
- a(k, "Hash");
1279
- k.prototype.clear = Gr;
1280
- k.prototype.delete = zr;
1281
- k.prototype.get = Jr;
1282
- k.prototype.has = Qr;
1283
- k.prototype.set = en;
1284
- var Dt = k;
1285
- function rn() {
1371
+ s(G, "Hash");
1372
+ G.prototype.clear = vn;
1373
+ G.prototype.delete = _n;
1374
+ G.prototype.get = xn;
1375
+ G.prototype.has = Cn;
1376
+ G.prototype.set = Rn;
1377
+ var Ge = G;
1378
+ function jn() {
1286
1379
  this.__data__ = [], this.size = 0;
1287
1380
  }
1288
- a(rn, "listCacheClear");
1289
- var nn = rn;
1290
- function on(r, t) {
1291
- for (var e = r.length; e--; )
1292
- if (Lr(r[e][0], t))
1293
- return e;
1381
+ s(jn, "listCacheClear");
1382
+ var Ln = jn;
1383
+ function Dn(t, e) {
1384
+ for (var r = t.length; r--; )
1385
+ if (un(t[r][0], e))
1386
+ return r;
1294
1387
  return -1;
1295
1388
  }
1296
- a(on, "assocIndexOf");
1297
- var at = on, an = Array.prototype, sn = an.splice;
1298
- function ln(r) {
1299
- var t = this.__data__, e = at(t, r);
1300
- if (e < 0)
1389
+ s(Dn, "assocIndexOf");
1390
+ var ce = Dn, $n = Array.prototype, Fn = $n.splice;
1391
+ function Mn(t) {
1392
+ var e = this.__data__, r = ce(e, t);
1393
+ if (r < 0)
1301
1394
  return !1;
1302
- var n = t.length - 1;
1303
- return e == n ? t.pop() : sn.call(t, e, 1), --this.size, !0;
1395
+ var n = e.length - 1;
1396
+ return r == n ? e.pop() : Fn.call(e, r, 1), --this.size, !0;
1304
1397
  }
1305
- a(ln, "listCacheDelete");
1306
- var cn = ln;
1307
- function pn(r) {
1308
- var t = this.__data__, e = at(t, r);
1309
- return e < 0 ? void 0 : t[e][1];
1398
+ s(Mn, "listCacheDelete");
1399
+ var Un = Mn;
1400
+ function Gn(t) {
1401
+ var e = this.__data__, r = ce(e, t);
1402
+ return r < 0 ? void 0 : e[r][1];
1310
1403
  }
1311
- a(pn, "listCacheGet");
1312
- var un = pn;
1313
- function fn(r) {
1314
- return at(this.__data__, r) > -1;
1404
+ s(Gn, "listCacheGet");
1405
+ var kn = Gn;
1406
+ function Wn(t) {
1407
+ return ce(this.__data__, t) > -1;
1315
1408
  }
1316
- a(fn, "listCacheHas");
1317
- var hn = fn;
1318
- function yn(r, t) {
1319
- var e = this.__data__, n = at(e, r);
1320
- return n < 0 ? (++this.size, e.push([r, t])) : e[n][1] = t, this;
1409
+ s(Wn, "listCacheHas");
1410
+ var qn = Wn;
1411
+ function Bn(t, e) {
1412
+ var r = this.__data__, n = ce(r, t);
1413
+ return n < 0 ? (++this.size, r.push([t, e])) : r[n][1] = e, this;
1321
1414
  }
1322
- a(yn, "listCacheSet");
1323
- var dn = yn;
1324
- function G(r) {
1325
- var t = -1, e = r == null ? 0 : r.length;
1326
- for (this.clear(); ++t < e; ) {
1327
- var n = r[t];
1415
+ s(Bn, "listCacheSet");
1416
+ var Hn = Bn;
1417
+ function k(t) {
1418
+ var e = -1, r = t == null ? 0 : t.length;
1419
+ for (this.clear(); ++e < r; ) {
1420
+ var n = t[e];
1328
1421
  this.set(n[0], n[1]);
1329
1422
  }
1330
1423
  }
1331
- a(G, "ListCache");
1332
- G.prototype.clear = nn;
1333
- G.prototype.delete = cn;
1334
- G.prototype.get = un;
1335
- G.prototype.has = hn;
1336
- G.prototype.set = dn;
1337
- var gn = G, vn = zt(vt, "Map"), mn = vn;
1338
- function En() {
1424
+ s(k, "ListCache");
1425
+ k.prototype.clear = Ln;
1426
+ k.prototype.delete = Un;
1427
+ k.prototype.get = kn;
1428
+ k.prototype.has = qn;
1429
+ k.prototype.set = Hn;
1430
+ var Vn = k, Jn = et(be, "Map"), zn = Jn;
1431
+ function Yn() {
1339
1432
  this.size = 0, this.__data__ = {
1340
- hash: new Dt(),
1341
- map: new (mn || gn)(),
1342
- string: new Dt()
1433
+ hash: new Ge(),
1434
+ map: new (zn || Vn)(),
1435
+ string: new Ge()
1343
1436
  };
1344
1437
  }
1345
- a(En, "mapCacheClear");
1346
- var bn = En;
1347
- function Sn(r) {
1348
- var t = typeof r;
1349
- return t == "string" || t == "number" || t == "symbol" || t == "boolean" ? r !== "__proto__" : r === null;
1438
+ s(Yn, "mapCacheClear");
1439
+ var Kn = Yn;
1440
+ function Xn(t) {
1441
+ var e = typeof t;
1442
+ return e == "string" || e == "number" || e == "symbol" || e == "boolean" ? t !== "__proto__" : t === null;
1350
1443
  }
1351
- a(Sn, "isKeyable");
1352
- var _n = Sn;
1353
- function Tn(r, t) {
1354
- var e = r.__data__;
1355
- return _n(t) ? e[typeof t == "string" ? "string" : "hash"] : e.map;
1444
+ s(Xn, "isKeyable");
1445
+ var Qn = Xn;
1446
+ function Zn(t, e) {
1447
+ var r = t.__data__;
1448
+ return Qn(e) ? r[typeof e == "string" ? "string" : "hash"] : r.map;
1356
1449
  }
1357
- a(Tn, "getMapData");
1358
- var st = Tn;
1359
- function An(r) {
1360
- var t = st(this, r).delete(r);
1361
- return this.size -= t ? 1 : 0, t;
1450
+ s(Zn, "getMapData");
1451
+ var le = Zn;
1452
+ function eo(t) {
1453
+ var e = le(this, t).delete(t);
1454
+ return this.size -= e ? 1 : 0, e;
1362
1455
  }
1363
- a(An, "mapCacheDelete");
1364
- var wn = An;
1365
- function On(r) {
1366
- return st(this, r).get(r);
1456
+ s(eo, "mapCacheDelete");
1457
+ var to = eo;
1458
+ function ro(t) {
1459
+ return le(this, t).get(t);
1367
1460
  }
1368
- a(On, "mapCacheGet");
1369
- var Cn = On;
1370
- function Pn(r) {
1371
- return st(this, r).has(r);
1461
+ s(ro, "mapCacheGet");
1462
+ var no = ro;
1463
+ function oo(t) {
1464
+ return le(this, t).has(t);
1372
1465
  }
1373
- a(Pn, "mapCacheHas");
1374
- var In = Pn;
1375
- function xn(r, t) {
1376
- var e = st(this, r), n = e.size;
1377
- return e.set(r, t), this.size += e.size == n ? 0 : 1, this;
1466
+ s(oo, "mapCacheHas");
1467
+ var so = oo;
1468
+ function io(t, e) {
1469
+ var r = le(this, t), n = r.size;
1470
+ return r.set(t, e), this.size += r.size == n ? 0 : 1, this;
1378
1471
  }
1379
- a(xn, "mapCacheSet");
1380
- var Rn = xn;
1381
- function W(r) {
1382
- var t = -1, e = r == null ? 0 : r.length;
1383
- for (this.clear(); ++t < e; ) {
1384
- var n = r[t];
1472
+ s(io, "mapCacheSet");
1473
+ var ao = io;
1474
+ function W(t) {
1475
+ var e = -1, r = t == null ? 0 : t.length;
1476
+ for (this.clear(); ++e < r; ) {
1477
+ var n = t[e];
1385
1478
  this.set(n[0], n[1]);
1386
1479
  }
1387
1480
  }
1388
- a(W, "MapCache");
1389
- W.prototype.clear = bn;
1390
- W.prototype.delete = wn;
1391
- W.prototype.get = Cn;
1392
- W.prototype.has = In;
1393
- W.prototype.set = Rn;
1394
- var Ht = W, Nn = "Expected a function";
1395
- function bt(r, t) {
1396
- if (typeof r != "function" || t != null && typeof t != "function")
1397
- throw new TypeError(Nn);
1398
- var e = /* @__PURE__ */ a(function() {
1399
- var n = arguments, o = t ? t.apply(this, n) : n[0], s = e.cache;
1400
- if (s.has(o))
1401
- return s.get(o);
1402
- var l = r.apply(this, n);
1403
- return e.cache = s.set(o, l) || s, l;
1481
+ s(W, "MapCache");
1482
+ W.prototype.clear = Kn;
1483
+ W.prototype.delete = to;
1484
+ W.prototype.get = no;
1485
+ W.prototype.has = so;
1486
+ W.prototype.set = ao;
1487
+ var tt = W, po = "Expected a function";
1488
+ function Ae(t, e) {
1489
+ if (typeof t != "function" || e != null && typeof e != "function")
1490
+ throw new TypeError(po);
1491
+ var r = /* @__PURE__ */ s(function() {
1492
+ var n = arguments, o = e ? e.apply(this, n) : n[0], p = r.cache;
1493
+ if (p.has(o))
1494
+ return p.get(o);
1495
+ var a = t.apply(this, n);
1496
+ return r.cache = p.set(o, a) || p, a;
1404
1497
  }, "memoized");
1405
- return e.cache = new (bt.Cache || Ht)(), e;
1498
+ return r.cache = new (Ae.Cache || tt)(), r;
1406
1499
  }
1407
- a(bt, "memoize");
1408
- bt.Cache = Ht;
1409
- var jn = bt, Ln = 500;
1410
- function Dn(r) {
1411
- var t = jn(r, function(n) {
1412
- return e.size === Ln && e.clear(), n;
1413
- }), e = t.cache;
1414
- return t;
1500
+ s(Ae, "memoize");
1501
+ Ae.Cache = tt;
1502
+ var co = Ae, lo = 500;
1503
+ function uo(t) {
1504
+ var e = co(t, function(n) {
1505
+ return r.size === lo && r.clear(), n;
1506
+ }), r = e.cache;
1507
+ return e;
1415
1508
  }
1416
- a(Dn, "memoizeCapped");
1417
- var Fn = Dn, Mn = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, $n = /\\(\\)?/g, Un = Fn(
1418
- function(r) {
1419
- var t = [];
1420
- return r.charCodeAt(0) === 46 && t.push(""), r.replace(Mn, function(e, n, o, s) {
1421
- t.push(o ? s.replace($n, "$1") : n || e);
1422
- }), t;
1423
- }), kn = Un;
1424
- function Gn(r) {
1425
- return r == null ? "" : ar(r);
1509
+ s(uo, "memoizeCapped");
1510
+ var fo = uo, yo = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, ho = /\\(\\)?/g, go = fo(
1511
+ function(t) {
1512
+ var e = [];
1513
+ return t.charCodeAt(0) === 46 && e.push(""), t.replace(yo, function(r, n, o, p) {
1514
+ e.push(o ? p.replace(ho, "$1") : n || r);
1515
+ }), e;
1516
+ }), mo = go;
1517
+ function vo(t) {
1518
+ return t == null ? "" : $r(t);
1426
1519
  }
1427
- a(Gn, "toString");
1428
- var Wn = Gn;
1429
- function zn(r, t) {
1430
- return Et(r) ? r : $r(r, t) ? [r] : kn(Wn(r));
1520
+ s(vo, "toString");
1521
+ var Eo = vo;
1522
+ function _o(t, e) {
1523
+ return Te(t) ? t : hn(t, e) ? [t] : mo(Eo(t));
1431
1524
  }
1432
- a(zn, "castPath");
1433
- var Hn = zn, Bn = 1 / 0;
1434
- function qn(r) {
1435
- if (typeof r == "string" || mt(r))
1436
- return r;
1437
- var t = r + "";
1438
- return t == "0" && 1 / r == -Bn ? "-0" : t;
1525
+ s(_o, "castPath");
1526
+ var bo = _o, So = 1 / 0;
1527
+ function To(t) {
1528
+ if (typeof t == "string" || Se(t))
1529
+ return t;
1530
+ var e = t + "";
1531
+ return e == "0" && 1 / t == -So ? "-0" : e;
1439
1532
  }
1440
- a(qn, "toKey");
1441
- var Vn = qn;
1442
- function Jn(r, t) {
1443
- t = Hn(t, r);
1444
- for (var e = 0, n = t.length; r != null && e < n; )
1445
- r = r[Vn(t[e++])];
1446
- return e && e == n ? r : void 0;
1533
+ s(To, "toKey");
1534
+ var Ao = To;
1535
+ function xo(t, e) {
1536
+ e = bo(e, t);
1537
+ for (var r = 0, n = e.length; t != null && r < n; )
1538
+ t = t[Ao(e[r++])];
1539
+ return r && r == n ? t : void 0;
1447
1540
  }
1448
- a(Jn, "baseGet");
1449
- var Kn = Jn;
1450
- function Yn(r, t, e) {
1451
- var n = r == null ? void 0 : Kn(r, t);
1452
- return n === void 0 ? e : n;
1541
+ s(xo, "baseGet");
1542
+ var wo = xo;
1543
+ function Po(t, e, r) {
1544
+ var n = t == null ? void 0 : wo(t, e);
1545
+ return n === void 0 ? r : n;
1453
1546
  }
1454
- a(Yn, "get");
1455
- var Xn = Yn, it = De, Qn = /* @__PURE__ */ a((r) => {
1456
- let t = null, e = !1, n = !1, o = !1, s = "";
1457
- if (r.indexOf("//") >= 0 || r.indexOf("/*") >= 0)
1458
- for (let l = 0; l < r.length; l += 1)
1459
- !t && !e && !n && !o ? r[l] === '"' || r[l] === "'" || r[l] === "`" ? t = r[l] : r[l] === "/" && r[l + 1] === "*" ? e = !0 : r[l] === "\
1460
- /" && r[l + 1] === "/" ? n = !0 : r[l] === "/" && r[l + 1] !== "/" && (o = !0) : (t && (r[l] === t && r[l - 1] !== "\\" || r[l] === `
1461
- ` && t !== "`") && (t = null), o && (r[l] === "/" && r[l - 1] !== "\\" || r[l] === `
1462
- `) && (o = !1), e && r[l - 1] === "/" && r[l - 2] === "*" && (e = !1), n && r[l] === `
1463
- ` && (n = !1)), !e && !n && (s += r[l]);
1464
- else
1465
- s = r;
1466
- return s;
1467
- }, "removeCodeComments"), Zn = (0, Bt.default)(1e4)(
1468
- (r) => Qn(r).replace(/\n\s*/g, "").trim()
1469
- ), to = /* @__PURE__ */ a(function(t, e) {
1470
- let n = e.slice(0, e.indexOf("{")), o = e.slice(e.indexOf("{"));
1471
- if (n.includes("=>") || n.includes("function"))
1472
- return e;
1473
- let s = n;
1474
- return s = s.replace(t, "function"), s + o;
1475
- }, "convertShorthandMethods2"), eo = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{3})?Z$/, J = /* @__PURE__ */ a((r) => r.match(/^[\[\{\"\}].*[\]\}\"]$/),
1547
+ s(Po, "get");
1548
+ var Oo = Po, xe = ur, Co = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{3})?Z$/, K = /* @__PURE__ */ s((t) => t.match(/^[\[\{\"\}].*[\]\}\"]$/),
1476
1549
  "isJSON");
1477
- function qt(r) {
1478
- if (!it(r))
1479
- return r;
1480
- let t = r, e = !1;
1481
- return typeof Event < "u" && r instanceof Event && (t = Pt(t), e = !0), t = Object.keys(t).reduce((n, o) => {
1550
+ function rt(t) {
1551
+ if (!xe(t))
1552
+ return t;
1553
+ let e = t, r = !1;
1554
+ return typeof Event < "u" && t instanceof Event && (e = De(e), r = !0), e = Object.keys(e).reduce((n, o) => {
1482
1555
  try {
1483
- t[o] && t[o].toJSON, n[o] = t[o];
1556
+ e[o] && e[o].toJSON, n[o] = e[o];
1484
1557
  } catch {
1485
- e = !0;
1558
+ r = !0;
1486
1559
  }
1487
1560
  return n;
1488
- }, {}), e ? t : r;
1561
+ }, {}), r ? e : t;
1489
1562
  }
1490
- a(qt, "convertUnconventionalData");
1491
- var ro = /* @__PURE__ */ a(function(t) {
1492
- let e, n, o, s;
1493
- return /* @__PURE__ */ a(function(c, i) {
1563
+ s(rt, "convertUnconventionalData");
1564
+ var No = /* @__PURE__ */ s(function(e) {
1565
+ let r, n, o, p;
1566
+ return /* @__PURE__ */ s(function(c, i) {
1494
1567
  try {
1495
1568
  if (c === "")
1496
- return s = [], e = /* @__PURE__ */ new Map([[i, "[]"]]), n = /* @__PURE__ */ new Map(), o = [], i;
1497
- let g = n.get(this) || this;
1498
- for (; o.length && g !== o[0]; )
1499
- o.shift(), s.pop();
1569
+ return p = [], r = /* @__PURE__ */ new Map([[i, "[]"]]), n = /* @__PURE__ */ new Map(), o = [], i;
1570
+ let l = n.get(this) || this;
1571
+ for (; o.length && l !== o[0]; )
1572
+ o.shift(), p.pop();
1500
1573
  if (typeof i == "boolean")
1501
1574
  return i;
1502
1575
  if (i === void 0)
1503
- return t.allowUndefined ? "_undefined_" : void 0;
1576
+ return e.allowUndefined ? "_undefined_" : void 0;
1504
1577
  if (i === null)
1505
1578
  return null;
1506
1579
  if (typeof i == "number")
1507
- return i === -1 / 0 ? "_-Infinity_" : i === 1 / 0 ? "_Infinity_" : Number.isNaN(i) ? "_NaN_" : i;
1580
+ return i === Number.NEGATIVE_INFINITY ? "_-Infinity_" : i === Number.POSITIVE_INFINITY ? "_Infinity_" : Number.isNaN(i) ? "_NaN_" : i;
1508
1581
  if (typeof i == "bigint")
1509
1582
  return `_bigint_${i.toString()}`;
1510
1583
  if (typeof i == "string")
1511
- return eo.test(i) ? t.allowDate ? `_date_${i}` : void 0 : i;
1512
- if ((0, Ne.default)(i))
1513
- return t.allowRegExp ? `_regexp_${i.flags}|${i.source}` : void 0;
1514
- if ((0, je.default)(i)) {
1515
- if (!t.allowFunction)
1516
- return;
1517
- let { name: u } = i, y = i.toString();
1518
- return y.match(
1519
- /(\[native code\]|WEBPACK_IMPORTED_MODULE|__webpack_exports__|__webpack_require__)/
1520
- ) ? `_function_${u}|${(() => {
1521
- }).toString()}` : `_function_${u}|${Zn(to(c, y))}`;
1522
- }
1523
- if ((0, Le.default)(i)) {
1524
- if (!t.allowSymbol)
1584
+ return Co.test(i) ? e.allowDate ? `_date_${i}` : void 0 : i;
1585
+ if ((0, pr.default)(i))
1586
+ return e.allowRegExp ? `_regexp_${i.flags}|${i.source}` : void 0;
1587
+ if ((0, cr.default)(i))
1588
+ return;
1589
+ if ((0, lr.default)(i)) {
1590
+ if (!e.allowSymbol)
1525
1591
  return;
1526
1592
  let u = Symbol.keyFor(i);
1527
1593
  return u !== void 0 ? `_gsymbol_${u}` : `_symbol_${i.toString().slice(7, -1)}`;
1528
1594
  }
1529
- if (o.length >= t.maxDepth)
1595
+ if (o.length >= e.maxDepth)
1530
1596
  return Array.isArray(i) ? `[Array(${i.length})]` : "[Object]";
1531
1597
  if (i === this)
1532
- return `_duplicate_${JSON.stringify(s)}`;
1533
- if (i instanceof Error && t.allowError)
1598
+ return `_duplicate_${JSON.stringify(p)}`;
1599
+ if (i instanceof Error && e.allowError)
1534
1600
  return {
1535
1601
  __isConvertedError__: !0,
1536
1602
  errorProperties: {
1603
+ // @ts-expect-error cause is not defined in the current tsconfig target(es2020)
1537
1604
  ...i.cause ? { cause: i.cause } : {},
1538
1605
  ...i,
1539
1606
  name: i.name,
@@ -1542,152 +1609,143 @@ var ro = /* @__PURE__ */ a(function(t) {
1542
1609
  "_constructor-name_": i.constructor.name
1543
1610
  }
1544
1611
  };
1545
- if (i.constructor && i.constructor.name && i.constructor.name !== "Object" && !Array.isArray(i) && !t.allowClass)
1546
- return;
1547
- let p = e.get(i);
1548
- if (!p) {
1549
- let u = Array.isArray(i) ? i : qt(i);
1550
- if (i.constructor && i.constructor.name && i.constructor.name !== "Object" && !Array.isArray(i) && t.allowClass)
1551
- try {
1552
- Object.assign(u, { "_constructor-name_": i.constructor.name });
1553
- } catch {
1554
- }
1555
- return s.push(c), o.unshift(u), e.set(i, JSON.stringify(s)), i !== u && n.set(i, u), u;
1612
+ if (i?.constructor?.name && i.constructor.name !== "Object" && !Array.isArray(i)) {
1613
+ let u = r.get(i);
1614
+ if (!u) {
1615
+ let y = {
1616
+ __isClassInstance__: !0,
1617
+ __className__: i.constructor.name,
1618
+ ...Object.getOwnPropertyNames(i).reduce(
1619
+ (g, h) => {
1620
+ try {
1621
+ g[h] = i[h];
1622
+ } catch {
1623
+ }
1624
+ return g;
1625
+ },
1626
+ {}
1627
+ )
1628
+ };
1629
+ return p.push(c), o.unshift(y), r.set(i, JSON.stringify(p)), i !== y && n.set(i, y), y;
1630
+ }
1631
+ return `_duplicate_${u}`;
1556
1632
  }
1557
- return `_duplicate_${p}`;
1633
+ let d = r.get(i);
1634
+ if (!d) {
1635
+ let u = Array.isArray(i) ? i : rt(i);
1636
+ return p.push(c), o.unshift(u), r.set(i, JSON.stringify(p)), i !== u && n.set(i, u), u;
1637
+ }
1638
+ return `_duplicate_${d}`;
1558
1639
  } catch {
1559
1640
  return;
1560
1641
  }
1561
1642
  }, "replace");
1562
- }, "replacer2"), no = /* @__PURE__ */ a(function reviver(options) {
1563
- let refs = [], root;
1564
- return /* @__PURE__ */ a(function revive(key, value) {
1565
- if (key === "" && (root = value, refs.forEach(({ target: r, container: t, replacement: e }) => {
1566
- let n = J(e) ? JSON.parse(e) : e.split(".");
1567
- n.length === 0 ? t[r] = root : t[r] = Xn(root, n);
1568
- })), key === "_constructor-name_")
1569
- return value;
1570
- if (it(value) && value.__isConvertedError__) {
1571
- let { message: r, ...t } = value.errorProperties, e = new Error(r);
1572
- return Object.assign(e, t), e;
1643
+ }, "replacer2"), Io = /* @__PURE__ */ s(function(e) {
1644
+ let r = [], n;
1645
+ return /* @__PURE__ */ s(function(p, a) {
1646
+ if (p === "" && (n = a, r.forEach(({ target: c, container: i, replacement: l }) => {
1647
+ let d = K(l) ? JSON.parse(l) : l.split(".");
1648
+ d.length === 0 ? i[c] = n : i[c] = Oo(n, d);
1649
+ })), p === "_constructor-name_")
1650
+ return a;
1651
+ if (xe(a) && a.__isConvertedError__) {
1652
+ let { message: c, ...i } = a.errorProperties, l = new Error(c);
1653
+ return Object.assign(l, i), l;
1573
1654
  }
1574
- if (it(value) && value["_constructor-name_"] && options.allowFunction) {
1575
- let r = value["_constructor-name_"];
1576
- if (r !== "Object") {
1577
- let t = new Function(`return function ${r.replace(/[^a-zA-Z0-9$_]+/g, "")}(){}`)();
1578
- Object.setPrototypeOf(value, new t());
1579
- }
1580
- return delete value["_constructor-name_"], value;
1655
+ if (typeof a == "string" && a.startsWith("_regexp_") && e.allowRegExp) {
1656
+ let [, c, i] = a.match(/_regexp_([^|]*)\|(.*)/) || [];
1657
+ return new RegExp(i, c);
1581
1658
  }
1582
- if (typeof value == "string" && value.startsWith("_function_") && options.allowFunction) {
1583
- let [, name, source] = value.match(/_function_([^|]*)\|(.*)/) || [], sourceSanitized = source.replace(/[(\(\))|\\| |\]|`]*$/, "");
1584
- if (!options.lazyEval)
1585
- return eval(`(${sourceSanitized})`);
1586
- let result = /* @__PURE__ */ a((...args) => {
1587
- let f = eval(`(${sourceSanitized})`);
1588
- return f(...args);
1589
- }, "result");
1590
- return Object.defineProperty(result, "toString", {
1591
- value: /* @__PURE__ */ a(() => sourceSanitized, "value")
1592
- }), Object.defineProperty(result, "name", {
1593
- value: name
1594
- }), result;
1595
- }
1596
- if (typeof value == "string" && value.startsWith("_regexp_") && options.allowRegExp) {
1597
- let [, r, t] = value.match(/_regexp_([^|]*)\|(.*)/) || [];
1598
- return new RegExp(t, r);
1599
- }
1600
- return typeof value == "string" && value.startsWith("_date_") && options.allowDate ? new Date(value.replace("_date_", "")) : typeof value ==
1601
- "string" && value.startsWith("_duplicate_") ? (refs.push({ target: key, container: this, replacement: value.replace(/^_duplicate_/, "") }),
1602
- null) : typeof value == "string" && value.startsWith("_symbol_") && options.allowSymbol ? Symbol(value.replace("_symbol_", "")) : typeof value ==
1603
- "string" && value.startsWith("_gsymbol_") && options.allowSymbol ? Symbol.for(value.replace("_gsymbol_", "")) : typeof value == "string" &&
1604
- value === "_-Infinity_" ? -1 / 0 : typeof value == "string" && value === "_Infinity_" ? 1 / 0 : typeof value == "string" && value === "_\
1605
- NaN_" ? NaN : typeof value == "string" && value.startsWith("_bigint_") && typeof BigInt == "function" ? BigInt(value.replace("_bigint_", "")) :
1606
- value;
1659
+ return typeof a == "string" && a.startsWith("_date_") && e.allowDate ? new Date(a.replace("_date_", "")) : typeof a == "string" && a.startsWith(
1660
+ "_duplicate_") ? (r.push({ target: p, container: this, replacement: a.replace(/^_duplicate_/, "") }), null) : typeof a == "string" && a.
1661
+ startsWith("_symbol_") && e.allowSymbol ? Symbol(a.replace("_symbol_", "")) : typeof a == "string" && a.startsWith("_gsymbol_") && e.allowSymbol ?
1662
+ Symbol.for(a.replace("_gsymbol_", "")) : typeof a == "string" && a === "_-Infinity_" ? Number.NEGATIVE_INFINITY : typeof a == "string" &&
1663
+ a === "_Infinity_" ? Number.POSITIVE_INFINITY : typeof a == "string" && a === "_NaN_" ? Number.NaN : typeof a == "string" && a.startsWith(
1664
+ "_bigint_") && typeof BigInt == "function" ? BigInt(a.replace("_bigint_", "")) : a;
1607
1665
  }, "revive");
1608
- }, "reviver"), Vt = {
1666
+ }, "reviver2"), nt = {
1609
1667
  maxDepth: 10,
1610
1668
  space: void 0,
1611
- allowFunction: !0,
1612
1669
  allowRegExp: !0,
1613
1670
  allowDate: !0,
1614
- allowClass: !0,
1615
1671
  allowError: !0,
1616
1672
  allowUndefined: !0,
1617
- allowSymbol: !0,
1618
- lazyEval: !0
1619
- }, lt = /* @__PURE__ */ a((r, t = {}) => {
1620
- let e = { ...Vt, ...t };
1621
- return JSON.stringify(qt(r), ro(e), t.space);
1622
- }, "stringify"), oo = /* @__PURE__ */ a(() => {
1623
- let r = /* @__PURE__ */ new Map();
1624
- return /* @__PURE__ */ a(function t(e) {
1625
- it(e) && Object.entries(e).forEach(([n, o]) => {
1626
- o === "_undefined_" ? e[n] = void 0 : r.get(o) || (r.set(o, !0), t(o));
1627
- }), Array.isArray(e) && e.forEach((n, o) => {
1628
- n === "_undefined_" ? (r.set(n, !0), e[o] = void 0) : r.get(n) || (r.set(n, !0), t(n));
1673
+ allowSymbol: !0
1674
+ }, ue = /* @__PURE__ */ s((t, e = {}) => {
1675
+ let r = { ...nt, ...e };
1676
+ return JSON.stringify(rt(t), No(r), e.space);
1677
+ }, "stringify"), Ro = /* @__PURE__ */ s(() => {
1678
+ let t = /* @__PURE__ */ new Map();
1679
+ return /* @__PURE__ */ s(function e(r) {
1680
+ xe(r) && Object.entries(r).forEach(([n, o]) => {
1681
+ o === "_undefined_" ? r[n] = void 0 : t.get(o) || (t.set(o, !0), e(o));
1682
+ }), Array.isArray(r) && r.forEach((n, o) => {
1683
+ n === "_undefined_" ? (t.set(n, !0), r[o] = void 0) : t.get(n) || (t.set(n, !0), e(n));
1629
1684
  });
1630
1685
  }, "mutateUndefined");
1631
- }, "mutator"), ct = /* @__PURE__ */ a((r, t = {}) => {
1632
- let e = { ...Vt, ...t }, n = JSON.parse(r, no(e));
1633
- return oo()(n), n;
1686
+ }, "mutator"), fe = /* @__PURE__ */ s((t, e = {}) => {
1687
+ let r = { ...nt, ...e }, n = JSON.parse(t, Io(r));
1688
+ return Ro()(n), n;
1634
1689
  }, "parse");
1635
1690
 
1636
1691
  // ../node_modules/tiny-invariant/dist/esm/tiny-invariant.js
1637
- var io = !1, St = "Invariant failed";
1638
- function K(r, t) {
1639
- if (!r) {
1640
- if (io)
1641
- throw new Error(St);
1642
- var e = typeof t == "function" ? t() : t, n = e ? "".concat(St, ": ").concat(e) : St;
1692
+ var jo = !1, we = "Invariant failed";
1693
+ function X(t, e) {
1694
+ if (!t) {
1695
+ if (jo)
1696
+ throw new Error(we);
1697
+ var r = typeof e == "function" ? e() : e, n = r ? "".concat(we, ": ").concat(r) : we;
1643
1698
  throw new Error(n);
1644
1699
  }
1645
1700
  }
1646
- a(K, "invariant");
1701
+ s(X, "invariant");
1647
1702
 
1648
1703
  // src/channels/postmessage/getEventSourceUrl.ts
1649
- import { logger as ao } from "storybook/internal/client-logger";
1650
- var Jt = /* @__PURE__ */ a((r) => {
1651
- let t = Array.from(
1704
+ import { logger as Lo } from "storybook/internal/client-logger";
1705
+ var ot = /* @__PURE__ */ s((t) => {
1706
+ let e = Array.from(
1652
1707
  document.querySelectorAll("iframe[data-is-storybook]")
1653
- ), [e, ...n] = t.filter((s) => {
1708
+ ), [r, ...n] = e.filter((p) => {
1654
1709
  try {
1655
- return s.contentWindow?.location.origin === r.source.location.origin && s.contentWindow?.location.pathname === r.source.location.pathname;
1710
+ return p.contentWindow?.location.origin === t.source.location.origin && p.contentWindow?.location.pathname === t.source.location.pathname;
1656
1711
  } catch {
1657
1712
  }
1658
1713
  try {
1659
- return s.contentWindow === r.source;
1714
+ return p.contentWindow === t.source;
1660
1715
  } catch {
1661
1716
  }
1662
- let l = s.getAttribute("src"), c;
1717
+ let a = p.getAttribute("src"), c;
1663
1718
  try {
1664
- if (!l)
1719
+ if (!a)
1665
1720
  return !1;
1666
- ({ origin: c } = new URL(l, document.location.toString()));
1721
+ ({ origin: c } = new URL(a, document.location.toString()));
1667
1722
  } catch {
1668
1723
  return !1;
1669
1724
  }
1670
- return c === r.origin;
1671
- }), o = e?.getAttribute("src");
1725
+ return c === t.origin;
1726
+ }), o = r?.getAttribute("src");
1672
1727
  if (o && n.length === 0) {
1673
- let { protocol: s, host: l, pathname: c } = new URL(o, document.location.toString());
1674
- return `${s}//${l}${c}`;
1728
+ let { protocol: p, host: a, pathname: c } = new URL(o, document.location.toString());
1729
+ return `${p}//${a}${c}`;
1675
1730
  }
1676
- return n.length > 0 && ao.error("found multiple candidates for event source"), null;
1731
+ return n.length > 0 && Lo.error("found multiple candidates for event source"), null;
1677
1732
  }, "getEventSourceUrl");
1678
1733
 
1679
1734
  // src/channels/postmessage/index.ts
1680
- var { document: _t, location: Tt } = S, Xt = "storybook-channel", lo = { allowFunction: !1, maxDepth: 25 }, At = class At {
1681
- constructor(t) {
1682
- this.config = t;
1735
+ var { document: Pe, location: Oe } = b, at = "storybook-channel", $o = { maxDepth: 25 }, Q = class {
1736
+ constructor(e) {
1737
+ this.config = e;
1683
1738
  this.connected = !1;
1684
- if (this.buffer = [], typeof S?.addEventListener == "function" && S.addEventListener("message", this.handleEvent.bind(this), !1), t.page !==
1685
- "manager" && t.page !== "preview")
1686
- throw new Error(`postmsg-channel: "config.page" cannot be "${t.page}"`);
1739
+ if (this.buffer = [], typeof b?.addEventListener == "function" && b.addEventListener("message", this.handleEvent.bind(this), !1), e.page !==
1740
+ "manager" && e.page !== "preview")
1741
+ throw new Error(`postmsg-channel: "config.page" cannot be "${e.page}"`);
1687
1742
  }
1688
- setHandler(t) {
1689
- this.handler = (...e) => {
1690
- t.apply(this, e), !this.connected && this.getLocalFrame().length && (this.flush(), this.connected = !0);
1743
+ static {
1744
+ s(this, "PostMessageTransport");
1745
+ }
1746
+ setHandler(e) {
1747
+ this.handler = (...r) => {
1748
+ e.apply(this, r), !this.connected && this.getLocalFrame().length && (this.flush(), this.connected = !0);
1691
1749
  };
1692
1750
  }
1693
1751
  /**
@@ -1696,190 +1754,183 @@ var { document: _t, location: Tt } = S, Xt = "storybook-channel", lo = { allowFu
1696
1754
  *
1697
1755
  * @param event
1698
1756
  */
1699
- send(t, e) {
1757
+ send(e, r) {
1700
1758
  let {
1701
1759
  target: n,
1702
1760
  // telejson options
1703
1761
  allowRegExp: o,
1704
- allowFunction: s,
1705
- allowSymbol: l,
1706
- allowDate: c,
1707
- allowError: i,
1708
- allowUndefined: g,
1709
- allowClass: p,
1710
- maxDepth: u,
1711
- space: y,
1712
- lazyEval: v
1713
- } = e || {}, d = Object.fromEntries(
1762
+ allowSymbol: p,
1763
+ allowDate: a,
1764
+ allowError: c,
1765
+ allowUndefined: i,
1766
+ maxDepth: l,
1767
+ space: d
1768
+ } = r || {}, u = Object.fromEntries(
1714
1769
  Object.entries({
1715
1770
  allowRegExp: o,
1716
- allowFunction: s,
1717
- allowSymbol: l,
1718
- allowDate: c,
1719
- allowError: i,
1720
- allowUndefined: g,
1721
- allowClass: p,
1722
- maxDepth: u,
1723
- space: y,
1724
- lazyEval: v
1725
- }).filter(([R, C]) => typeof C < "u")
1726
- ), m = {
1727
- ...lo,
1728
- ...S.CHANNEL_OPTIONS || {},
1729
- ...d
1730
- }, E = this.getFrames(n), I = new URLSearchParams(Tt?.search || ""), T = lt(
1771
+ allowSymbol: p,
1772
+ allowDate: a,
1773
+ allowError: c,
1774
+ allowUndefined: i,
1775
+ maxDepth: l,
1776
+ space: d
1777
+ }).filter(([w, A]) => typeof A < "u")
1778
+ ), y = {
1779
+ ...$o,
1780
+ ...b.CHANNEL_OPTIONS || {},
1781
+ ...u
1782
+ }, g = this.getFrames(n), h = new URLSearchParams(Oe?.search || ""), C = ue(
1731
1783
  {
1732
- key: Xt,
1733
- event: t,
1734
- refId: I.get("refId")
1784
+ key: at,
1785
+ event: e,
1786
+ refId: h.get("refId")
1735
1787
  },
1736
- m
1788
+ y
1737
1789
  );
1738
- return E.length ? (this.buffer.length && this.flush(), E.forEach((R) => {
1790
+ return g.length ? (this.buffer.length && this.flush(), g.forEach((w) => {
1739
1791
  try {
1740
- R.postMessage(T, "*");
1792
+ w.postMessage(C, "*");
1741
1793
  } catch {
1742
- Kt.error("sending over postmessage fail");
1794
+ st.error("sending over postmessage fail");
1743
1795
  }
1744
- }), Promise.resolve(null)) : new Promise((R, C) => {
1745
- this.buffer.push({ event: t, resolve: R, reject: C });
1796
+ }), Promise.resolve(null)) : new Promise((w, A) => {
1797
+ this.buffer.push({ event: e, resolve: w, reject: A });
1746
1798
  });
1747
1799
  }
1748
1800
  flush() {
1749
- let { buffer: t } = this;
1750
- this.buffer = [], t.forEach((e) => {
1751
- this.send(e.event).then(e.resolve).catch(e.reject);
1801
+ let { buffer: e } = this;
1802
+ this.buffer = [], e.forEach((r) => {
1803
+ this.send(r.event).then(r.resolve).catch(r.reject);
1752
1804
  });
1753
1805
  }
1754
- getFrames(t) {
1806
+ getFrames(e) {
1755
1807
  if (this.config.page === "manager") {
1756
1808
  let n = Array.from(
1757
- _t.querySelectorAll("iframe[data-is-storybook][data-is-loaded]")
1809
+ Pe.querySelectorAll("iframe[data-is-storybook][data-is-loaded]")
1758
1810
  ).flatMap((o) => {
1759
1811
  try {
1760
- return o.contentWindow && o.dataset.isStorybook !== void 0 && o.id === t ? [o.contentWindow] : [];
1812
+ return o.contentWindow && o.dataset.isStorybook !== void 0 && o.id === e ? [o.contentWindow] : [];
1761
1813
  } catch {
1762
1814
  return [];
1763
1815
  }
1764
1816
  });
1765
1817
  return n?.length ? n : this.getCurrentFrames();
1766
1818
  }
1767
- return S && S.parent && S.parent !== S.self ? [S.parent] : [];
1819
+ return b && b.parent && b.parent !== b.self ? [b.parent] : [];
1768
1820
  }
1769
1821
  getCurrentFrames() {
1770
1822
  return this.config.page === "manager" ? Array.from(
1771
- _t.querySelectorAll('[data-is-storybook="true"]')
1772
- ).flatMap((e) => e.contentWindow ? [e.contentWindow] : []) : S && S.parent ? [S.parent] : [];
1823
+ Pe.querySelectorAll('[data-is-storybook="true"]')
1824
+ ).flatMap((r) => r.contentWindow ? [r.contentWindow] : []) : b && b.parent ? [b.parent] : [];
1773
1825
  }
1774
1826
  getLocalFrame() {
1775
1827
  return this.config.page === "manager" ? Array.from(
1776
- _t.querySelectorAll("#storybook-preview-iframe")
1777
- ).flatMap((e) => e.contentWindow ? [e.contentWindow] : []) : S && S.parent ? [S.parent] : [];
1828
+ Pe.querySelectorAll("#storybook-preview-iframe")
1829
+ ).flatMap((r) => r.contentWindow ? [r.contentWindow] : []) : b && b.parent ? [b.parent] : [];
1778
1830
  }
1779
- handleEvent(t) {
1831
+ handleEvent(e) {
1780
1832
  try {
1781
- let { data: e } = t, { key: n, event: o, refId: s } = typeof e == "string" && J(e) ? ct(e, S.CHANNEL_OPTIONS || {}) : e;
1782
- if (n === Xt) {
1783
- let l = this.config.page === "manager" ? '<span style="color: #37D5D3; background: black"> manager </span>' : '<span style="color: #\
1784
- 1EA7FD; background: black"> preview </span>', c = Object.values(so).includes(o.type) ? `<span style="color: #FF4785">${o.type}</span>` : `<s\
1833
+ let { data: r } = e, { key: n, event: o, refId: p } = typeof r == "string" && K(r) ? fe(r, b.CHANNEL_OPTIONS || {}) : r;
1834
+ if (n === at) {
1835
+ let a = this.config.page === "manager" ? '<span style="color: #37D5D3; background: black"> manager </span>' : '<span style="color: #\
1836
+ 1EA7FD; background: black"> preview </span>', c = Object.values(Do).includes(o.type) ? `<span style="color: #FF4785">${o.type}</span>` : `<s\
1785
1837
  pan style="color: #FFAE00">${o.type}</span>`;
1786
- if (s && (o.refId = s), o.source = this.config.page === "preview" ? t.origin : Jt(t), !o.source) {
1787
- Yt.error(
1788
- `${l} received ${c} but was unable to determine the source of the event`
1838
+ if (p && (o.refId = p), o.source = this.config.page === "preview" ? e.origin : ot(e), !o.source) {
1839
+ it.error(
1840
+ `${a} received ${c} but was unable to determine the source of the event`
1789
1841
  );
1790
1842
  return;
1791
1843
  }
1792
- let i = `${l} received ${c} (${e.length})`;
1793
- Yt.debug(
1794
- Tt.origin !== o.source ? i : `${i} <span style="color: gray">(on ${Tt.origin} from ${o.source})</span>`,
1844
+ let i = `${a} received ${c} (${r.length})`;
1845
+ it.debug(
1846
+ Oe.origin !== o.source ? i : `${i} <span style="color: gray">(on ${Oe.origin} from ${o.source})</span>`,
1795
1847
  ...o.args
1796
- ), K(this.handler, "ChannelHandler should be set"), this.handler(o);
1848
+ ), X(this.handler, "ChannelHandler should be set"), this.handler(o);
1797
1849
  }
1798
- } catch (e) {
1799
- Kt.error(e);
1850
+ } catch (r) {
1851
+ st.error(r);
1800
1852
  }
1801
1853
  }
1802
1854
  };
1803
- a(At, "PostMessageTransport");
1804
- var Y = At;
1805
1855
 
1806
1856
  // src/channels/websocket/index.ts
1807
- import * as Qt from "storybook/internal/core-events";
1808
- var { WebSocket: co } = S, Zt = 15e3, te = 5e3, wt = class wt {
1809
- constructor({ url: t, onError: e, page: n }) {
1857
+ import * as pt from "storybook/internal/core-events";
1858
+ import { global as ct } from "@storybook/global";
1859
+ var { WebSocket: Fo } = ct, lt = 15e3, ut = 5e3, Z = class {
1860
+ constructor({ url: e, onError: r, page: n }) {
1810
1861
  this.buffer = [];
1811
1862
  this.isReady = !1;
1812
1863
  this.isClosed = !1;
1813
1864
  this.pingTimeout = 0;
1814
- this.socket = new co(t), this.socket.onopen = () => {
1865
+ this.socket = new Fo(e), this.socket.onopen = () => {
1815
1866
  this.isReady = !0, this.heartbeat(), this.flush();
1816
1867
  }, this.socket.onmessage = ({ data: o }) => {
1817
- let s = typeof o == "string" && J(o) ? ct(o) : o;
1818
- K(this.handler, "WebsocketTransport handler should be set"), this.handler(s), s.type === "ping" && (this.heartbeat(), this.send({ type: "\
1868
+ let p = typeof o == "string" && K(o) ? fe(o) : o;
1869
+ X(this.handler, "WebsocketTransport handler should be set"), this.handler(p), p.type === "ping" && (this.heartbeat(), this.send({ type: "\
1819
1870
  pong" }));
1820
1871
  }, this.socket.onerror = (o) => {
1821
- e && e(o);
1872
+ r && r(o);
1822
1873
  }, this.socket.onclose = (o) => {
1823
- K(this.handler, "WebsocketTransport handler should be set"), this.handler({
1824
- type: Qt.CHANNEL_WS_DISCONNECT,
1874
+ X(this.handler, "WebsocketTransport handler should be set"), this.handler({
1875
+ type: pt.CHANNEL_WS_DISCONNECT,
1825
1876
  args: [{ reason: o.reason, code: o.code }],
1826
1877
  from: n || "preview"
1827
1878
  }), this.isClosed = !0, clearTimeout(this.pingTimeout);
1828
1879
  };
1829
1880
  }
1881
+ static {
1882
+ s(this, "WebsocketTransport");
1883
+ }
1830
1884
  heartbeat() {
1831
1885
  clearTimeout(this.pingTimeout), this.pingTimeout = setTimeout(() => {
1832
1886
  this.socket.close(3008, "timeout");
1833
- }, Zt + te);
1887
+ }, lt + ut);
1834
1888
  }
1835
- setHandler(t) {
1836
- this.handler = t;
1889
+ setHandler(e) {
1890
+ this.handler = e;
1837
1891
  }
1838
- send(t) {
1839
- this.isClosed || (this.isReady ? this.sendNow(t) : this.sendLater(t));
1892
+ send(e) {
1893
+ this.isClosed || (this.isReady ? this.sendNow(e) : this.sendLater(e));
1840
1894
  }
1841
- sendLater(t) {
1842
- this.buffer.push(t);
1895
+ sendLater(e) {
1896
+ this.buffer.push(e);
1843
1897
  }
1844
- sendNow(t) {
1845
- let e = lt(t, {
1898
+ sendNow(e) {
1899
+ let r = ue(e, {
1846
1900
  maxDepth: 15,
1847
- allowFunction: !1,
1848
- ...S.CHANNEL_OPTIONS
1901
+ ...ct.CHANNEL_OPTIONS
1849
1902
  });
1850
- this.socket.send(e);
1903
+ this.socket.send(r);
1851
1904
  }
1852
1905
  flush() {
1853
- let { buffer: t } = this;
1854
- this.buffer = [], t.forEach((e) => this.send(e));
1906
+ let { buffer: e } = this;
1907
+ this.buffer = [], e.forEach((r) => this.send(r));
1855
1908
  }
1856
1909
  };
1857
- a(wt, "WebsocketTransport");
1858
- var X = wt;
1859
1910
 
1860
1911
  // src/channels/index.ts
1861
- var { CONFIG_TYPE: po } = S, Xo = B;
1862
- function Qo({ page: r, extraTransports: t = [] }) {
1863
- let e = [new Y({ page: r }), ...t];
1864
- if (po === "DEVELOPMENT") {
1865
- let o = window.location.protocol === "http:" ? "ws" : "wss", { hostname: s, port: l } = window.location, c = `${o}://${s}:${l}/storybook\
1912
+ var { CONFIG_TYPE: Uo } = Mo, Ts = J;
1913
+ function As({ page: t, extraTransports: e = [] }) {
1914
+ let r = [new Q({ page: t }), ...e];
1915
+ if (Uo === "DEVELOPMENT") {
1916
+ let o = window.location.protocol === "http:" ? "ws" : "wss", { hostname: p, port: a } = window.location, c = `${o}://${p}:${a}/storybook\
1866
1917
  -server-channel`;
1867
- e.push(new X({ url: c, onError: /* @__PURE__ */ a(() => {
1868
- }, "onError"), page: r }));
1918
+ r.push(new Z({ url: c, onError: /* @__PURE__ */ s(() => {
1919
+ }, "onError"), page: t }));
1869
1920
  }
1870
- let n = new B({ transports: e });
1871
- return $.__prepare(
1921
+ let n = new J({ transports: r });
1922
+ return M.__prepare(
1872
1923
  n,
1873
- r === "manager" ? $.Environment.MANAGER : $.Environment.PREVIEW
1924
+ t === "manager" ? M.Environment.MANAGER : M.Environment.PREVIEW
1874
1925
  ), n;
1875
1926
  }
1876
- a(Qo, "createBrowserChannel");
1927
+ s(As, "createBrowserChannel");
1877
1928
  export {
1878
- B as Channel,
1879
- Zt as HEARTBEAT_INTERVAL,
1880
- te as HEARTBEAT_MAX_LATENCY,
1881
- Y as PostMessageTransport,
1882
- X as WebsocketTransport,
1883
- Qo as createBrowserChannel,
1884
- Xo as default
1929
+ J as Channel,
1930
+ lt as HEARTBEAT_INTERVAL,
1931
+ ut as HEARTBEAT_MAX_LATENCY,
1932
+ Q as PostMessageTransport,
1933
+ Z as WebsocketTransport,
1934
+ As as createBrowserChannel,
1935
+ Ts as default
1885
1936
  };