@leancodepl/feature-flags-react-client 9.7.2 → 9.7.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js ADDED
@@ -0,0 +1,2406 @@
1
+ var Ut = Object.defineProperty, Gt = Object.defineProperties, Vt = Object.getOwnPropertyDescriptors, et = Object.getOwnPropertySymbols, zt = Object.prototype.hasOwnProperty, Wt = Object.prototype.propertyIsEnumerable, tt = (t, r, n) => r in t ? Ut(t, r, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[r] = n, Ne = (t, r) => {
2
+ for (var n in r || (r = {}))
3
+ zt.call(r, n) && tt(t, n, r[n]);
4
+ if (et)
5
+ for (var n of et(r))
6
+ Wt.call(r, n) && tt(t, n, r[n]);
7
+ return t;
8
+ }, ke = (t, r) => Gt(t, Vt(r)), le = (t, r, n) => new Promise((i, a) => {
9
+ var c = (E) => {
10
+ try {
11
+ p(n.next(E));
12
+ } catch (y) {
13
+ a(y);
14
+ }
15
+ }, h = (E) => {
16
+ try {
17
+ p(n.throw(E));
18
+ } catch (y) {
19
+ a(y);
20
+ }
21
+ }, p = (E) => E.done ? i(E.value) : Promise.resolve(E.value).then(c, h);
22
+ p((n = n.apply(t, r)).next());
23
+ }), qt = class {
24
+ constructor() {
25
+ this.data = /* @__PURE__ */ new Map();
26
+ }
27
+ set(t, r) {
28
+ this.data.set(t, r);
29
+ }
30
+ get(t) {
31
+ return this.data.get(t);
32
+ }
33
+ has(t) {
34
+ return this.data.has(t);
35
+ }
36
+ delete(t) {
37
+ return this.data.delete(t);
38
+ }
39
+ clear() {
40
+ this.data.clear();
41
+ }
42
+ }, we = {
43
+ /**
44
+ * The resolved value was the result of the flag being disabled in the management system.
45
+ */
46
+ DISABLED: "DISABLED",
47
+ /**
48
+ * The resolved value is non-authoritative or possibly out of date.
49
+ */
50
+ STALE: "STALE",
51
+ /**
52
+ * The resolved value was the result of an error.
53
+ *
54
+ * Note: The `errorCode` and `errorMessage` fields may contain additional details of this error.
55
+ */
56
+ ERROR: "ERROR"
57
+ }, vt = /* @__PURE__ */ ((t) => (t.PROVIDER_NOT_READY = "PROVIDER_NOT_READY", t.PROVIDER_FATAL = "PROVIDER_FATAL", t.FLAG_NOT_FOUND = "FLAG_NOT_FOUND", t.PARSE_ERROR = "PARSE_ERROR", t.TYPE_MISMATCH = "TYPE_MISMATCH", t.TARGETING_KEY_MISSING = "TARGETING_KEY_MISSING", t.INVALID_CONTEXT = "INVALID_CONTEXT", t.GENERAL = "GENERAL", t))(vt || {}), te = class pt extends Error {
58
+ constructor(r, n) {
59
+ super(r), Object.setPrototypeOf(this, pt.prototype), this.name = "OpenFeatureError", this.cause = n?.cause;
60
+ }
61
+ }, Bt = class _t extends te {
62
+ constructor(r, n) {
63
+ super(r, n), Object.setPrototypeOf(this, _t.prototype), this.name = "FlagNotFoundError", this.code = "FLAG_NOT_FOUND";
64
+ }
65
+ }, gt = class Et extends te {
66
+ constructor(r, n) {
67
+ super(r, n), Object.setPrototypeOf(this, Et.prototype), this.name = "GeneralError", this.code = "GENERAL";
68
+ }
69
+ }, Qt = class mt extends te {
70
+ constructor(r, n) {
71
+ super(r, n), Object.setPrototypeOf(this, mt.prototype), this.name = "InvalidContextError", this.code = "INVALID_CONTEXT";
72
+ }
73
+ }, Kt = class yt extends te {
74
+ constructor(r, n) {
75
+ super(r, n), Object.setPrototypeOf(this, yt.prototype), this.name = "ParseError", this.code = "PARSE_ERROR";
76
+ }
77
+ }, Rt = class Ot extends te {
78
+ constructor(r, n) {
79
+ super(r, n), Object.setPrototypeOf(this, Ot.prototype), this.name = "ProviderFatalError", this.code = "PROVIDER_FATAL";
80
+ }
81
+ }, Ct = class wt extends te {
82
+ constructor(r, n) {
83
+ super(r, n), Object.setPrototypeOf(this, wt.prototype), this.name = "ProviderNotReadyError", this.code = "PROVIDER_NOT_READY";
84
+ }
85
+ }, Xt = class At extends te {
86
+ constructor(r, n) {
87
+ super(r, n), Object.setPrototypeOf(this, At.prototype), this.name = "TargetingKeyMissingError", this.code = "TARGETING_KEY_MISSING";
88
+ }
89
+ }, Zt = class Pt extends te {
90
+ constructor(r, n) {
91
+ super(r, n), Object.setPrototypeOf(this, Pt.prototype), this.name = "TypeMismatchError", this.code = "TYPE_MISMATCH";
92
+ }
93
+ }, Jt = (t, r) => {
94
+ switch (t) {
95
+ case "FLAG_NOT_FOUND":
96
+ return new Bt(r);
97
+ case "PARSE_ERROR":
98
+ return new Kt(r);
99
+ case "TYPE_MISMATCH":
100
+ return new Zt(r);
101
+ case "TARGETING_KEY_MISSING":
102
+ return new Xt(r);
103
+ case "INVALID_CONTEXT":
104
+ return new Qt(r);
105
+ case "PROVIDER_NOT_READY":
106
+ return new Ct(r);
107
+ case "PROVIDER_FATAL":
108
+ return new Rt(r);
109
+ default:
110
+ return new gt(r);
111
+ }
112
+ }, ee = /* @__PURE__ */ ((t) => (t.NOT_READY = "NOT_READY", t.READY = "READY", t.ERROR = "ERROR", t.STALE = "STALE", t.FATAL = "FATAL", t.RECONCILING = "RECONCILING", t))(ee || {}), I = /* @__PURE__ */ ((t) => (t.Ready = "PROVIDER_READY", t.Error = "PROVIDER_ERROR", t.ConfigurationChanged = "PROVIDER_CONFIGURATION_CHANGED", t.ContextChanged = "PROVIDER_CONTEXT_CHANGED", t.Reconciling = "PROVIDER_RECONCILING", t.Stale = "PROVIDER_STALE", t))(I || {}), er = {
113
+ READY: "PROVIDER_READY",
114
+ ERROR: "PROVIDER_ERROR",
115
+ FATAL: "PROVIDER_ERROR",
116
+ STALE: "PROVIDER_STALE",
117
+ RECONCILING: "PROVIDER_RECONCILING",
118
+ NOT_READY: void 0
119
+ }, bt = (t, r) => !r && t === "PROVIDER_READY" || er[r] === t, Tt = class {
120
+ error(...t) {
121
+ console.error(...t);
122
+ }
123
+ warn(...t) {
124
+ console.warn(...t);
125
+ }
126
+ info() {
127
+ }
128
+ debug() {
129
+ }
130
+ }, tr = ["error", "warn", "info", "debug"], Le = class {
131
+ constructor(t) {
132
+ this.fallbackLogger = new Tt();
133
+ try {
134
+ for (const r of tr)
135
+ if (!t[r] || typeof t[r] != "function")
136
+ throw new Error(`The provided logger is missing the ${r} method.`);
137
+ this.logger = t;
138
+ } catch (r) {
139
+ console.error(r), console.error("Falling back to the default logger."), this.logger = this.fallbackLogger;
140
+ }
141
+ }
142
+ error(...t) {
143
+ this.log("error", ...t);
144
+ }
145
+ warn(...t) {
146
+ this.log("warn", ...t);
147
+ }
148
+ info(...t) {
149
+ this.log("info", ...t);
150
+ }
151
+ debug(...t) {
152
+ this.log("debug", ...t);
153
+ }
154
+ log(t, ...r) {
155
+ try {
156
+ this.logger[t](...r);
157
+ } catch {
158
+ this.fallbackLogger[t](...r);
159
+ }
160
+ }
161
+ }, rr = class {
162
+ constructor(t) {
163
+ this.globalLogger = t, this._handlers = {
164
+ PROVIDER_CONFIGURATION_CHANGED: /* @__PURE__ */ new WeakMap(),
165
+ PROVIDER_CONTEXT_CHANGED: /* @__PURE__ */ new WeakMap(),
166
+ PROVIDER_READY: /* @__PURE__ */ new WeakMap(),
167
+ PROVIDER_ERROR: /* @__PURE__ */ new WeakMap(),
168
+ PROVIDER_STALE: /* @__PURE__ */ new WeakMap(),
169
+ PROVIDER_RECONCILING: /* @__PURE__ */ new WeakMap()
170
+ };
171
+ }
172
+ // here we use E, to restrict the events a provider can manually emit (PROVIDER_CONTEXT_CHANGED is emitted by the SDK)
173
+ emit(t, r) {
174
+ this.eventEmitter.emit(t, r);
175
+ }
176
+ addHandler(t, r) {
177
+ const n = (a) => le(this, null, function* () {
178
+ var c;
179
+ try {
180
+ yield r(a);
181
+ } catch (h) {
182
+ (c = this._logger) == null || c.error("Error running event handler:", h);
183
+ }
184
+ }), i = this._handlers[t].get(r);
185
+ this._handlers[t].set(r, [...i || [], n]), this.eventEmitter.on(t, n);
186
+ }
187
+ removeHandler(t, r) {
188
+ const n = this._handlers[t].get(r);
189
+ if (n) {
190
+ const i = n.pop();
191
+ i && this.eventEmitter.removeListener(t, i);
192
+ }
193
+ }
194
+ removeAllHandlers(t) {
195
+ t ? this.eventEmitter.removeAllListeners(t) : this.eventEmitter.removeAllListeners();
196
+ }
197
+ getHandlers(t) {
198
+ return this.eventEmitter.listeners(t);
199
+ }
200
+ setLogger(t) {
201
+ return this._eventLogger = new Le(t), this;
202
+ }
203
+ get _logger() {
204
+ var t, r;
205
+ return (r = this._eventLogger) != null ? r : (t = this.globalLogger) == null ? void 0 : t.call(this);
206
+ }
207
+ };
208
+ function nr(t) {
209
+ return typeof t == "string";
210
+ }
211
+ function ce(t) {
212
+ return nr(t) ? t : void 0;
213
+ }
214
+ function or(t) {
215
+ return typeof t == "object";
216
+ }
217
+ function z(t) {
218
+ return or(t) ? t : void 0;
219
+ }
220
+ function rt(t) {
221
+ return typeof t < "u" && t !== null;
222
+ }
223
+ var Ie = class {
224
+ constructor(t, r, n) {
225
+ this._provider = t, this._status = r, this._pendingContextChanges = 0;
226
+ var i, a, c;
227
+ (i = t.events) == null || i.addHandler("PROVIDER_READY", () => {
228
+ this._status = n.READY;
229
+ }), (a = t.events) == null || a.addHandler("PROVIDER_STALE", () => {
230
+ this._status = n.STALE;
231
+ }), (c = t.events) == null || c.addHandler("PROVIDER_ERROR", (h) => {
232
+ h?.errorCode === "PROVIDER_FATAL" ? this._status = n.FATAL : this._status = n.ERROR;
233
+ });
234
+ }
235
+ get provider() {
236
+ return this._provider;
237
+ }
238
+ set provider(t) {
239
+ this._provider = t;
240
+ }
241
+ get status() {
242
+ return this._status;
243
+ }
244
+ set status(t) {
245
+ this._status = t;
246
+ }
247
+ get allContextChangesSettled() {
248
+ return this._pendingContextChanges === 0;
249
+ }
250
+ incrementPendingContextChanges() {
251
+ this._pendingContextChanges++;
252
+ }
253
+ decrementPendingContextChanges() {
254
+ this._pendingContextChanges--;
255
+ }
256
+ }, sr = class {
257
+ constructor(t) {
258
+ this._hooks = [], this._context = {}, this._logger = new Tt(), this._clientEventHandlers = /* @__PURE__ */ new Map(), this._domainScopedContext = /* @__PURE__ */ new Map(), this._clientEvents = /* @__PURE__ */ new Map(), this._runsOn = t;
259
+ }
260
+ addHooks(...t) {
261
+ return this._hooks = [...this._hooks, ...t], this;
262
+ }
263
+ getHooks() {
264
+ return this._hooks;
265
+ }
266
+ clearHooks() {
267
+ return this._hooks = [], this;
268
+ }
269
+ setLogger(t) {
270
+ return this._logger = new Le(t), this;
271
+ }
272
+ /**
273
+ * Get metadata about the default provider.
274
+ * @returns {ProviderMetadata} Provider Metadata
275
+ */
276
+ get providerMetadata() {
277
+ return this.getProviderMetadata();
278
+ }
279
+ /**
280
+ * Get metadata about a registered provider using the client name.
281
+ * An unbound or empty client name will return metadata from the default provider.
282
+ * @param {string} domain An identifier which logically binds clients with providers
283
+ * @returns {ProviderMetadata} Provider Metadata
284
+ */
285
+ getProviderMetadata(t) {
286
+ return this.getProviderForClient(t).metadata;
287
+ }
288
+ /**
289
+ * Adds a handler for the given provider event type.
290
+ * The handlers are called in the order they have been added.
291
+ * API (global) events run for all providers.
292
+ * @param {AnyProviderEvent} eventType The provider event type to listen to
293
+ * @param {EventHandler} handler The handler to run on occurrence of the event type
294
+ * @param {EventOptions} options Optional options such as signal for aborting
295
+ */
296
+ addHandler(t, r, n) {
297
+ [.../* @__PURE__ */ new Map([[void 0, this._defaultProvider]]), ...this._domainScopedProviders].forEach((i) => {
298
+ var a;
299
+ const c = i[0], h = i[1].provider, p = i[1].status;
300
+ if (bt(t, p))
301
+ try {
302
+ r({ domain: c, providerName: h.metadata.name });
303
+ } catch (y) {
304
+ (a = this._logger) == null || a.error("Error running event handler:", y);
305
+ }
306
+ }), this._apiEmitter.addHandler(t, r), n?.signal && typeof n.signal.addEventListener == "function" && n.signal.addEventListener("abort", () => {
307
+ this.removeHandler(t, r);
308
+ });
309
+ }
310
+ /**
311
+ * Removes a handler for the given provider event type.
312
+ * @param {AnyProviderEvent} eventType The provider event type to remove the listener for
313
+ * @param {EventHandler} handler The handler to remove for the provider event type
314
+ */
315
+ removeHandler(t, r) {
316
+ this._apiEmitter.removeHandler(t, r);
317
+ }
318
+ /**
319
+ * Removes all event handlers.
320
+ */
321
+ clearHandlers() {
322
+ this._apiEmitter.removeAllHandlers();
323
+ }
324
+ /**
325
+ * Gets the current handlers for the given provider event type.
326
+ * @param {AnyProviderEvent} eventType The provider event type to get the current handlers for
327
+ * @returns {EventHandler[]} The handlers currently attached to the given provider event type
328
+ */
329
+ getHandlers(t) {
330
+ return this._apiEmitter.getHandlers(t);
331
+ }
332
+ setAwaitableProvider(t, r) {
333
+ var n, i, a, c, h, p, E, y;
334
+ const f = ce(t), v = (n = z(t)) != null ? n : z(r);
335
+ if (!v) {
336
+ this._logger.debug("No provider defined, ignoring setProvider call");
337
+ return;
338
+ }
339
+ const _ = this.getProviderForClient(f), A = v.metadata.name;
340
+ if (_ === v) {
341
+ this._logger.debug("Provider is already set, ignoring setProvider call");
342
+ return;
343
+ }
344
+ if (!v.runsOn)
345
+ this._logger.debug(`Provider '${v.metadata.name}' has not defined its intended use.`);
346
+ else if (v.runsOn !== this._runsOn)
347
+ throw new gt(`Provider '${v.metadata.name}' is intended for use on the ${v.runsOn}.`);
348
+ const k = this.getAssociatedEventEmitters(f);
349
+ let N;
350
+ const $ = new Ie(
351
+ v,
352
+ this._statusEnumType.NOT_READY,
353
+ this._statusEnumType
354
+ );
355
+ return typeof v.initialize == "function" && !this.allProviders.includes(v) ? N = (h = (c = (a = v.initialize) == null ? void 0 : a.call(v, f ? (i = this._domainScopedContext.get(f)) != null ? i : this._context : this._context)) == null ? void 0 : c.then(() => {
356
+ var g;
357
+ $.status = this._statusEnumType.READY, this.getAssociatedEventEmitters(f).forEach((Y) => {
358
+ Y?.emit("PROVIDER_READY", { clientName: f, domain: f, providerName: A });
359
+ }), (g = this._apiEmitter) == null || g.emit("PROVIDER_READY", { clientName: f, domain: f, providerName: A });
360
+ })) == null ? void 0 : h.catch((g) => {
361
+ var Y;
362
+ throw g?.code === "PROVIDER_FATAL" ? $.status = this._statusEnumType.FATAL : $.status = this._statusEnumType.ERROR, this.getAssociatedEventEmitters(f).forEach((U) => {
363
+ U?.emit("PROVIDER_ERROR", {
364
+ clientName: f,
365
+ domain: f,
366
+ providerName: A,
367
+ message: g?.message
368
+ });
369
+ }), (Y = this._apiEmitter) == null || Y.emit("PROVIDER_ERROR", {
370
+ clientName: f,
371
+ domain: f,
372
+ providerName: A,
373
+ message: g?.message
374
+ }), g;
375
+ }) : ($.status = this._statusEnumType.READY, k.forEach((g) => {
376
+ g?.emit("PROVIDER_READY", { clientName: f, domain: f, providerName: A });
377
+ }), (p = this._apiEmitter) == null || p.emit("PROVIDER_READY", { clientName: f, domain: f, providerName: A })), f ? this._domainScopedProviders.set(f, $) : this._defaultProvider = $, this.transferListeners(_, v, f, k), this.allProviders.includes(_) || (y = (E = _?.onClose) == null ? void 0 : E.call(_)) == null || y.catch((g) => {
378
+ this._logger.error(`error closing provider: ${g?.message}, ${g?.stack}`);
379
+ }), N;
380
+ }
381
+ getProviderForClient(t) {
382
+ var r, n;
383
+ return t ? (n = (r = this._domainScopedProviders.get(t)) == null ? void 0 : r.provider) != null ? n : this._defaultProvider.provider : this._defaultProvider.provider;
384
+ }
385
+ buildAndCacheEventEmitterForClient(t) {
386
+ const r = this._clientEvents.get(t);
387
+ if (r)
388
+ return r;
389
+ const n = this._createEventEmitter();
390
+ this._clientEvents.set(t, n);
391
+ const i = this.getProviderForClient(t);
392
+ return Object.values(I).forEach(
393
+ (a) => {
394
+ var c;
395
+ return (c = i.events) == null ? void 0 : c.addHandler(a, (h) => le(this, null, function* () {
396
+ n.emit(a, ke(Ne({}, h), {
397
+ clientName: t,
398
+ domain: t,
399
+ providerName: i.metadata.name
400
+ }));
401
+ }));
402
+ }
403
+ ), n;
404
+ }
405
+ getUnboundEmitters() {
406
+ const t = [...this._domainScopedProviders.keys()];
407
+ return [
408
+ // all unbound, named emitters
409
+ ...[...this._clientEvents.keys()].filter(rt).filter((i) => !t.includes(i)).map((i) => this._clientEvents.get(i)),
410
+ // the default emitter
411
+ this._clientEvents.get(void 0)
412
+ ].filter(rt);
413
+ }
414
+ getAssociatedEventEmitters(t) {
415
+ return t ? [this.buildAndCacheEventEmitterForClient(t)] : this.getUnboundEmitters();
416
+ }
417
+ transferListeners(t, r, n, i) {
418
+ var a;
419
+ (a = this._clientEventHandlers.get(n)) == null || a.forEach((h) => {
420
+ var p;
421
+ return (p = t.events) == null ? void 0 : p.removeHandler(...h);
422
+ });
423
+ const c = Object.values(I).map((h) => [h, (E) => le(this, null, function* () {
424
+ i.forEach((y) => {
425
+ y?.emit(h, ke(Ne({}, E), { clientName: n, domain: n, providerName: r.metadata.name }));
426
+ }), this._apiEmitter.emit(h, ke(Ne({}, E), {
427
+ clientName: n,
428
+ domain: n,
429
+ providerName: r.metadata.name
430
+ }));
431
+ })]);
432
+ this._clientEventHandlers.set(n, c), c.forEach((h) => {
433
+ var p;
434
+ return (p = r.events) == null ? void 0 : p.addHandler(...h);
435
+ });
436
+ }
437
+ close() {
438
+ return le(this, null, function* () {
439
+ var t, r;
440
+ try {
441
+ yield (r = (t = this == null ? void 0 : this._defaultProvider.provider) == null ? void 0 : t.onClose) == null ? void 0 : r.call(t);
442
+ } catch (i) {
443
+ this.handleShutdownError(this._defaultProvider.provider, i);
444
+ }
445
+ const n = Array.from(this._domainScopedProviders);
446
+ yield Promise.all(
447
+ n.map((i) => le(this, [i], function* ([, a]) {
448
+ var c, h;
449
+ try {
450
+ yield (h = a == null ? void 0 : (c = a.provider).onClose) == null ? void 0 : h.call(c);
451
+ } catch (p) {
452
+ this.handleShutdownError(a?.provider, p);
453
+ }
454
+ }))
455
+ );
456
+ });
457
+ }
458
+ clearProvidersAndSetDefault(t) {
459
+ return le(this, null, function* () {
460
+ try {
461
+ yield this.close();
462
+ } catch {
463
+ this._logger.error("Unable to cleanly close providers. Resetting to the default configuration.");
464
+ } finally {
465
+ this._domainScopedProviders.clear(), this._defaultProvider = new Ie(
466
+ t,
467
+ this._statusEnumType.NOT_READY,
468
+ this._statusEnumType
469
+ );
470
+ }
471
+ });
472
+ }
473
+ get allProviders() {
474
+ return [
475
+ ...[...this._domainScopedProviders.values()].map((t) => t.provider),
476
+ this._defaultProvider.provider
477
+ ];
478
+ }
479
+ handleShutdownError(t, r) {
480
+ this._logger.error(`Error during shutdown of provider ${t.metadata.name}: ${r}`), this._logger.error(r?.stack);
481
+ }
482
+ }, ir = Object.create, je = Object.defineProperty, ar = Object.defineProperties, ur = Object.getOwnPropertyDescriptor, lr = Object.getOwnPropertyDescriptors, St = Object.getOwnPropertyNames, nt = Object.getOwnPropertySymbols, Nt = Object.getPrototypeOf, kt = Object.prototype.hasOwnProperty, cr = Object.prototype.propertyIsEnumerable, fr = Reflect.get, ot = (t, r, n) => r in t ? je(t, r, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[r] = n, De = (t, r) => {
483
+ for (var n in r || (r = {}))
484
+ kt.call(r, n) && ot(t, n, r[n]);
485
+ if (nt)
486
+ for (var n of nt(r))
487
+ cr.call(r, n) && ot(t, n, r[n]);
488
+ return t;
489
+ }, dr = (t, r) => ar(t, lr(r)), hr = (t, r) => function() {
490
+ return r || (0, t[St(t)[0]])((r = { exports: {} }).exports, r), r.exports;
491
+ }, vr = (t, r, n, i) => {
492
+ if (r && typeof r == "object" || typeof r == "function")
493
+ for (let a of St(r))
494
+ !kt.call(t, a) && a !== n && je(t, a, { get: () => r[a], enumerable: !(i = ur(r, a)) || i.enumerable });
495
+ return t;
496
+ }, pr = (t, r, n) => (n = t != null ? ir(Nt(t)) : {}, vr(
497
+ // If the importer is in node compatibility mode or this is not an ESM
498
+ // file that has been converted to a CommonJS file using a Babel-
499
+ // compatible transform (i.e. "__esModule" has not been set), then set
500
+ // "default" to the CommonJS "module.exports" for node compatibility.
501
+ je(n, "default", { value: t, enumerable: !0 }),
502
+ t
503
+ )), _r = (t, r, n) => fr(Nt(t), n, r), ue = (t, r, n) => new Promise((i, a) => {
504
+ var c = (E) => {
505
+ try {
506
+ p(n.next(E));
507
+ } catch (y) {
508
+ a(y);
509
+ }
510
+ }, h = (E) => {
511
+ try {
512
+ p(n.throw(E));
513
+ } catch (y) {
514
+ a(y);
515
+ }
516
+ }, p = (E) => E.done ? i(E.value) : Promise.resolve(E.value).then(c, h);
517
+ p((n = n.apply(t, r)).next());
518
+ }), gr = hr({
519
+ "../../node_modules/eventemitter3/index.js"(t, r) {
520
+ var n = Object.prototype.hasOwnProperty, i = "~";
521
+ function a() {
522
+ }
523
+ Object.create && (a.prototype = /* @__PURE__ */ Object.create(null), new a().__proto__ || (i = !1));
524
+ function c(y, f, v) {
525
+ this.fn = y, this.context = f, this.once = v || !1;
526
+ }
527
+ function h(y, f, v, _, A) {
528
+ if (typeof v != "function")
529
+ throw new TypeError("The listener must be a function");
530
+ var k = new c(v, _ || y, A), N = i ? i + f : f;
531
+ return y._events[N] ? y._events[N].fn ? y._events[N] = [y._events[N], k] : y._events[N].push(k) : (y._events[N] = k, y._eventsCount++), y;
532
+ }
533
+ function p(y, f) {
534
+ --y._eventsCount === 0 ? y._events = new a() : delete y._events[f];
535
+ }
536
+ function E() {
537
+ this._events = new a(), this._eventsCount = 0;
538
+ }
539
+ E.prototype.eventNames = function() {
540
+ var f = [], v, _;
541
+ if (this._eventsCount === 0) return f;
542
+ for (_ in v = this._events)
543
+ n.call(v, _) && f.push(i ? _.slice(1) : _);
544
+ return Object.getOwnPropertySymbols ? f.concat(Object.getOwnPropertySymbols(v)) : f;
545
+ }, E.prototype.listeners = function(f) {
546
+ var v = i ? i + f : f, _ = this._events[v];
547
+ if (!_) return [];
548
+ if (_.fn) return [_.fn];
549
+ for (var A = 0, k = _.length, N = new Array(k); A < k; A++)
550
+ N[A] = _[A].fn;
551
+ return N;
552
+ }, E.prototype.listenerCount = function(f) {
553
+ var v = i ? i + f : f, _ = this._events[v];
554
+ return _ ? _.fn ? 1 : _.length : 0;
555
+ }, E.prototype.emit = function(f, v, _, A, k, N) {
556
+ var $ = i ? i + f : f;
557
+ if (!this._events[$]) return !1;
558
+ var g = this._events[$], Y = arguments.length, U, j;
559
+ if (g.fn) {
560
+ switch (g.once && this.removeListener(f, g.fn, void 0, !0), Y) {
561
+ case 1:
562
+ return g.fn.call(g.context), !0;
563
+ case 2:
564
+ return g.fn.call(g.context, v), !0;
565
+ case 3:
566
+ return g.fn.call(g.context, v, _), !0;
567
+ case 4:
568
+ return g.fn.call(g.context, v, _, A), !0;
569
+ case 5:
570
+ return g.fn.call(g.context, v, _, A, k), !0;
571
+ case 6:
572
+ return g.fn.call(g.context, v, _, A, k, N), !0;
573
+ }
574
+ for (j = 1, U = new Array(Y - 1); j < Y; j++)
575
+ U[j - 1] = arguments[j];
576
+ g.fn.apply(g.context, U);
577
+ } else {
578
+ var W = g.length, q;
579
+ for (j = 0; j < W; j++)
580
+ switch (g[j].once && this.removeListener(f, g[j].fn, void 0, !0), Y) {
581
+ case 1:
582
+ g[j].fn.call(g[j].context);
583
+ break;
584
+ case 2:
585
+ g[j].fn.call(g[j].context, v);
586
+ break;
587
+ case 3:
588
+ g[j].fn.call(g[j].context, v, _);
589
+ break;
590
+ case 4:
591
+ g[j].fn.call(g[j].context, v, _, A);
592
+ break;
593
+ default:
594
+ if (!U) for (q = 1, U = new Array(Y - 1); q < Y; q++)
595
+ U[q - 1] = arguments[q];
596
+ g[j].fn.apply(g[j].context, U);
597
+ }
598
+ }
599
+ return !0;
600
+ }, E.prototype.on = function(f, v, _) {
601
+ return h(this, f, v, _, !1);
602
+ }, E.prototype.once = function(f, v, _) {
603
+ return h(this, f, v, _, !0);
604
+ }, E.prototype.removeListener = function(f, v, _, A) {
605
+ var k = i ? i + f : f;
606
+ if (!this._events[k]) return this;
607
+ if (!v)
608
+ return p(this, k), this;
609
+ var N = this._events[k];
610
+ if (N.fn)
611
+ N.fn === v && (!A || N.once) && (!_ || N.context === _) && p(this, k);
612
+ else {
613
+ for (var $ = 0, g = [], Y = N.length; $ < Y; $++)
614
+ (N[$].fn !== v || A && !N[$].once || _ && N[$].context !== _) && g.push(N[$]);
615
+ g.length ? this._events[k] = g.length === 1 ? g[0] : g : p(this, k);
616
+ }
617
+ return this;
618
+ }, E.prototype.removeAllListeners = function(f) {
619
+ var v;
620
+ return f ? (v = i ? i + f : f, this._events[v] && p(this, v)) : (this._events = new a(), this._eventsCount = 0), this;
621
+ }, E.prototype.off = E.prototype.removeListener, E.prototype.addListener = E.prototype.on, E.prefixed = i, E.EventEmitter = E, typeof r < "u" && (r.exports = E);
622
+ }
623
+ }), Er = "No-op", mr = class {
624
+ constructor() {
625
+ this.metadata = {
626
+ name: "No-op Provider"
627
+ };
628
+ }
629
+ resolveBooleanEvaluation(t, r) {
630
+ return this.noOp(r);
631
+ }
632
+ resolveStringEvaluation(t, r) {
633
+ return this.noOp(r);
634
+ }
635
+ resolveNumberEvaluation(t, r) {
636
+ return this.noOp(r);
637
+ }
638
+ resolveObjectEvaluation(t, r) {
639
+ return this.noOp(r);
640
+ }
641
+ noOp(t) {
642
+ return {
643
+ value: t,
644
+ reason: Er
645
+ };
646
+ }
647
+ }, st = new mr(), yr = pr(gr()), it = class extends rr {
648
+ constructor() {
649
+ super(), this.eventEmitter = new yr.default();
650
+ }
651
+ }, Rr = class {
652
+ constructor(t, r, n, i, a, c, h) {
653
+ this.providerAccessor = t, this.providerStatusAccessor = r, this.emitterAccessor = n, this.apiContextAccessor = i, this.apiHooksAccessor = a, this.globalLogger = c, this.options = h, this._hooks = [];
654
+ }
655
+ get metadata() {
656
+ var t, r;
657
+ return {
658
+ // Use domain if name is not provided
659
+ name: (t = this.options.domain) != null ? t : this.options.name,
660
+ domain: (r = this.options.domain) != null ? r : this.options.name,
661
+ version: this.options.version,
662
+ providerMetadata: this.providerAccessor().metadata
663
+ };
664
+ }
665
+ get providerStatus() {
666
+ return this.providerStatusAccessor();
667
+ }
668
+ addHandler(t, r, n) {
669
+ var i;
670
+ if (this.emitterAccessor().addHandler(t, r), bt(t, this.providerStatus))
671
+ try {
672
+ r({
673
+ clientName: this.metadata.name,
674
+ domain: this.metadata.domain,
675
+ providerName: this._provider.metadata.name
676
+ });
677
+ } catch (c) {
678
+ (i = this._logger) == null || i.error("Error running event handler:", c);
679
+ }
680
+ n?.signal && typeof n.signal.addEventListener == "function" && n.signal.addEventListener("abort", () => {
681
+ this.removeHandler(t, r);
682
+ });
683
+ }
684
+ removeHandler(t, r) {
685
+ this.emitterAccessor().removeHandler(t, r);
686
+ }
687
+ getHandlers(t) {
688
+ return this.emitterAccessor().getHandlers(t);
689
+ }
690
+ setLogger(t) {
691
+ return this._clientLogger = new Le(t), this;
692
+ }
693
+ addHooks(...t) {
694
+ return this._hooks = [...this._hooks, ...t], this;
695
+ }
696
+ getHooks() {
697
+ return this._hooks;
698
+ }
699
+ clearHooks() {
700
+ return this._hooks = [], this;
701
+ }
702
+ getBooleanValue(t, r, n) {
703
+ return this.getBooleanDetails(t, r, n).value;
704
+ }
705
+ getBooleanDetails(t, r, n) {
706
+ return this.evaluate(t, this._provider.resolveBooleanEvaluation, r, "boolean", n);
707
+ }
708
+ getStringValue(t, r, n) {
709
+ return this.getStringDetails(t, r, n).value;
710
+ }
711
+ getStringDetails(t, r, n) {
712
+ return this.evaluate(
713
+ t,
714
+ // this isolates providers from our restricted string generic argument.
715
+ this._provider.resolveStringEvaluation,
716
+ r,
717
+ "string",
718
+ n
719
+ );
720
+ }
721
+ getNumberValue(t, r, n) {
722
+ return this.getNumberDetails(t, r, n).value;
723
+ }
724
+ getNumberDetails(t, r, n) {
725
+ return this.evaluate(
726
+ t,
727
+ // this isolates providers from our restricted number generic argument.
728
+ this._provider.resolveNumberEvaluation,
729
+ r,
730
+ "number",
731
+ n
732
+ );
733
+ }
734
+ getObjectValue(t, r, n) {
735
+ return this.getObjectDetails(t, r, n).value;
736
+ }
737
+ getObjectDetails(t, r, n) {
738
+ return this.evaluate(t, this._provider.resolveObjectEvaluation, r, "object", n);
739
+ }
740
+ track(t, r = {}) {
741
+ var n, i, a;
742
+ try {
743
+ if (this.shortCircuitIfNotReady(), typeof this._provider.track == "function") {
744
+ const c = Object.freeze(De({}, this.apiContextAccessor((n = this == null ? void 0 : this.options) == null ? void 0 : n.domain)));
745
+ return (a = (i = this._provider).track) == null ? void 0 : a.call(i, t, c, r);
746
+ } else
747
+ this._logger.debug("Provider does not support the track function; will no-op.");
748
+ } catch (c) {
749
+ this._logger.debug("Error recording tracking event.", c);
750
+ }
751
+ }
752
+ evaluate(t, r, n, i, a = {}) {
753
+ var c, h;
754
+ const p = [
755
+ ...this.apiHooksAccessor(),
756
+ ...this.getHooks(),
757
+ ...a.hooks || [],
758
+ ...this._provider.hooks || []
759
+ ], E = [...p].reverse(), y = De({}, this.apiContextAccessor((c = this == null ? void 0 : this.options) == null ? void 0 : c.domain)), f = E.map(
760
+ () => Object.freeze({
761
+ flagKey: t,
762
+ defaultValue: n,
763
+ flagValueType: i,
764
+ clientMetadata: this.metadata,
765
+ providerMetadata: this._provider.metadata,
766
+ context: y,
767
+ logger: this._logger,
768
+ hookData: new qt()
769
+ })
770
+ );
771
+ let v;
772
+ try {
773
+ this.beforeHooks(p, f, a), this.shortCircuitIfNotReady();
774
+ const _ = r.call(this._provider, t, n, y, this._logger), A = dr(De({}, _), {
775
+ flagMetadata: Object.freeze((h = _.flagMetadata) != null ? h : {}),
776
+ flagKey: t
777
+ });
778
+ if (A.errorCode) {
779
+ const k = Jt(A.errorCode, A.errorMessage);
780
+ this.errorHooks(E, f, k, a), v = this.getErrorEvaluationDetails(t, n, k, A.flagMetadata);
781
+ } else
782
+ this.afterHooks(E, f, A, a), v = A;
783
+ } catch (_) {
784
+ this.errorHooks(E, f, _, a), v = this.getErrorEvaluationDetails(t, n, _);
785
+ }
786
+ return this.finallyHooks(E, f, v, a), v;
787
+ }
788
+ beforeHooks(t, r, n) {
789
+ var i;
790
+ for (const [a, c] of t.entries()) {
791
+ const h = t.length - 1 - a, p = r[h];
792
+ Object.freeze(p), Object.freeze(p.context), (i = c?.before) == null || i.call(c, p, Object.freeze(n.hookHints));
793
+ }
794
+ }
795
+ afterHooks(t, r, n, i) {
796
+ var a;
797
+ for (const [c, h] of t.entries()) {
798
+ const p = r[c];
799
+ (a = h?.after) == null || a.call(h, p, n, i.hookHints);
800
+ }
801
+ }
802
+ errorHooks(t, r, n, i) {
803
+ var a;
804
+ for (const [c, h] of t.entries())
805
+ try {
806
+ const p = r[c];
807
+ (a = h?.error) == null || a.call(h, p, n, i.hookHints);
808
+ } catch (p) {
809
+ this._logger.error(`Unhandled error during 'error' hook: ${p}`), p instanceof Error && this._logger.error(p.stack), this._logger.error(p?.stack);
810
+ }
811
+ }
812
+ finallyHooks(t, r, n, i) {
813
+ var a;
814
+ for (const [c, h] of t.entries())
815
+ try {
816
+ const p = r[c];
817
+ (a = h?.finally) == null || a.call(h, p, n, i.hookHints);
818
+ } catch (p) {
819
+ this._logger.error(`Unhandled error during 'finally' hook: ${p}`), p instanceof Error && this._logger.error(p.stack), this._logger.error(p?.stack);
820
+ }
821
+ }
822
+ get _provider() {
823
+ return this.providerAccessor();
824
+ }
825
+ get _logger() {
826
+ return this._clientLogger || this.globalLogger();
827
+ }
828
+ shortCircuitIfNotReady() {
829
+ if (this.providerStatus === ee.NOT_READY)
830
+ throw new Ct("provider has not yet initialized");
831
+ if (this.providerStatus === ee.FATAL)
832
+ throw new Rt("provider is in an irrecoverable error state");
833
+ }
834
+ getErrorEvaluationDetails(t, r, n, i = {}) {
835
+ const a = n?.message;
836
+ return {
837
+ errorCode: n?.code || vt.GENERAL,
838
+ errorMessage: a,
839
+ value: r,
840
+ reason: we.ERROR,
841
+ flagMetadata: Object.freeze(i),
842
+ flagKey: t
843
+ };
844
+ }
845
+ }, at = /* @__PURE__ */ Symbol.for("@openfeature/web-sdk/api"), ut = globalThis, Or = class He extends sr {
846
+ constructor() {
847
+ super("client"), this._statusEnumType = ee, this._apiEmitter = new it(), this._defaultProvider = new Ie(
848
+ st,
849
+ ee.NOT_READY,
850
+ this._statusEnumType
851
+ ), this._domainScopedProviders = /* @__PURE__ */ new Map(), this._createEventEmitter = () => new it();
852
+ }
853
+ /**
854
+ * Gets a singleton instance of the OpenFeature API.
855
+ * @ignore
856
+ * @returns {OpenFeatureAPI} OpenFeature API
857
+ */
858
+ static getInstance() {
859
+ const r = ut[at];
860
+ if (r)
861
+ return r;
862
+ const n = new He();
863
+ return ut[at] = n, n;
864
+ }
865
+ getProviderStatus(r) {
866
+ var n, i;
867
+ return r ? (i = (n = this._domainScopedProviders.get(r)) == null ? void 0 : n.status) != null ? i : this._defaultProvider.status : this._defaultProvider.status;
868
+ }
869
+ setProviderAndWait(r, n, i) {
870
+ return ue(this, null, function* () {
871
+ const a = ce(r), c = z(a ? n : r), h = z(a ? i : n);
872
+ h && (a ? this._domainScopedContext.set(a, h) : this._context = h), yield this.setAwaitableProvider(a, c);
873
+ });
874
+ }
875
+ setProvider(r, n, i) {
876
+ const a = ce(r), c = z(a ? n : r), h = z(a ? i : n);
877
+ h && (a ? this._domainScopedContext.set(a, h) : this._context = h);
878
+ const p = this.setAwaitableProvider(a, c);
879
+ return Promise.resolve(p).catch((E) => {
880
+ this._logger.error("Error during provider initialization:", E);
881
+ }), this;
882
+ }
883
+ getProvider(r) {
884
+ return this.getProviderForClient(r);
885
+ }
886
+ setContext(r, n) {
887
+ return ue(this, null, function* () {
888
+ var i, a;
889
+ const c = ce(r), h = (a = (i = z(r)) != null ? i : z(n)) != null ? a : {};
890
+ if (c) {
891
+ const p = this._domainScopedProviders.get(c);
892
+ if (p) {
893
+ const E = this.getContext(c);
894
+ this._domainScopedContext.set(c, h), yield this.runProviderContextChangeHandler(c, p, E, h);
895
+ } else
896
+ this._domainScopedContext.set(c, h);
897
+ } else {
898
+ const p = this._context;
899
+ this._context = h;
900
+ const E = Array.from(this._domainScopedProviders.entries()).filter(([f]) => !this._domainScopedContext.has(f)).reduce((f, [v, _]) => (f.push({ domain: v, wrapper: _ }), f), []), y = [
901
+ // add in the default (no domain)
902
+ { domain: void 0, wrapper: this._defaultProvider },
903
+ ...E
904
+ ];
905
+ yield Promise.all(
906
+ y.map((f) => this.runProviderContextChangeHandler(f.domain, f.wrapper, p, h))
907
+ );
908
+ }
909
+ });
910
+ }
911
+ getContext(r) {
912
+ const n = ce(r);
913
+ if (n) {
914
+ const i = this._domainScopedContext.get(n);
915
+ if (i)
916
+ return i;
917
+ this._logger.debug(`Unable to find context for '${n}'.`);
918
+ }
919
+ return this._context;
920
+ }
921
+ clearContext(r) {
922
+ return ue(this, null, function* () {
923
+ const n = ce(r);
924
+ if (n) {
925
+ const i = this._domainScopedProviders.get(n);
926
+ if (i) {
927
+ const a = this.getContext(n);
928
+ this._domainScopedContext.delete(n);
929
+ const c = this.getContext();
930
+ yield this.runProviderContextChangeHandler(n, i, a, c);
931
+ } else
932
+ this._domainScopedContext.delete(n);
933
+ } else
934
+ return this.setContext({});
935
+ });
936
+ }
937
+ /**
938
+ * Resets the global evaluation context and removes the evaluation context for
939
+ * all domains.
940
+ */
941
+ clearContexts() {
942
+ return ue(this, null, function* () {
943
+ yield this.clearContext(), yield Promise.allSettled(Array.from(this._domainScopedProviders.keys()).map((r) => this.clearContext(r)));
944
+ });
945
+ }
946
+ /**
947
+ * A factory function for creating new domain-scoped OpenFeature clients. Clients
948
+ * can contain their own state (e.g. logger, hook, context). Multiple domains
949
+ * can be used to segment feature flag configuration.
950
+ *
951
+ * If there is already a provider bound to this name via {@link this.setProvider setProvider}, this provider will be used.
952
+ * Otherwise, the default provider is used until a provider is assigned to that name.
953
+ * @param {string} domain An identifier which logically binds clients with providers
954
+ * @param {string} version The version of the client (only used for metadata)
955
+ * @returns {Client} OpenFeature Client
956
+ */
957
+ getClient(r, n) {
958
+ return new Rr(
959
+ // functions are passed here to make sure that these values are always up to date,
960
+ // and so we don't have to make these public properties on the API class.
961
+ () => this.getProviderForClient(r),
962
+ () => this.getProviderStatus(r),
963
+ () => this.buildAndCacheEventEmitterForClient(r),
964
+ (i) => this.getContext(i),
965
+ () => this.getHooks(),
966
+ () => this._logger,
967
+ { domain: r, version: n }
968
+ );
969
+ }
970
+ /**
971
+ * Clears all registered providers and resets the default provider.
972
+ * @returns {Promise<void>}
973
+ */
974
+ clearProviders() {
975
+ return ue(this, null, function* () {
976
+ yield _r(He.prototype, this, "clearProvidersAndSetDefault").call(this, st), this._domainScopedContext.clear();
977
+ });
978
+ }
979
+ runProviderContextChangeHandler(r, n, i, a) {
980
+ return ue(this, null, function* () {
981
+ var c, h, p, E, y, f;
982
+ const v = ((h = (c = n.provider) == null ? void 0 : c.metadata) == null ? void 0 : h.name) || "unnamed-provider";
983
+ try {
984
+ if (typeof n.provider.onContextChange == "function") {
985
+ const _ = n.provider.onContextChange(i, a);
986
+ _ && typeof _?.then == "function" && (n.incrementPendingContextChanges(), n.status = this._statusEnumType.RECONCILING, this.getAssociatedEventEmitters(r).forEach((A) => {
987
+ A?.emit(I.Reconciling, { domain: r, providerName: v });
988
+ }), (p = this._apiEmitter) == null || p.emit(I.Reconciling, { domain: r, providerName: v }), yield _, n.decrementPendingContextChanges());
989
+ }
990
+ n.status = this._statusEnumType.READY, n.allContextChangesSettled && (this.getAssociatedEventEmitters(r).forEach((_) => {
991
+ _?.emit(I.ContextChanged, { clientName: r, domain: r, providerName: v });
992
+ }), (E = this._apiEmitter) == null || E.emit(I.ContextChanged, { clientName: r, domain: r, providerName: v }));
993
+ } catch (_) {
994
+ if (n.decrementPendingContextChanges(), n.status = this._statusEnumType.ERROR, n.allContextChangesSettled) {
995
+ const A = _, k = `Error running ${v}'s context change handler: ${A?.message}`;
996
+ (y = this._logger) == null || y.error(`${k}`, _), this.getAssociatedEventEmitters(r).forEach((N) => {
997
+ N?.emit(I.Error, { clientName: r, domain: r, providerName: v, message: k });
998
+ }), (f = this._apiEmitter) == null || f.emit(I.Error, { clientName: r, domain: r, providerName: v, message: k });
999
+ }
1000
+ }
1001
+ });
1002
+ }
1003
+ }, Ae = Or.getInstance();
1004
+ function Cr(t) {
1005
+ return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
1006
+ }
1007
+ var Oe = { exports: {} }, C = {};
1008
+ var lt;
1009
+ function wr() {
1010
+ if (lt) return C;
1011
+ lt = 1;
1012
+ var t = /* @__PURE__ */ Symbol.for("react.transitional.element"), r = /* @__PURE__ */ Symbol.for("react.portal"), n = /* @__PURE__ */ Symbol.for("react.fragment"), i = /* @__PURE__ */ Symbol.for("react.strict_mode"), a = /* @__PURE__ */ Symbol.for("react.profiler"), c = /* @__PURE__ */ Symbol.for("react.consumer"), h = /* @__PURE__ */ Symbol.for("react.context"), p = /* @__PURE__ */ Symbol.for("react.forward_ref"), E = /* @__PURE__ */ Symbol.for("react.suspense"), y = /* @__PURE__ */ Symbol.for("react.memo"), f = /* @__PURE__ */ Symbol.for("react.lazy"), v = /* @__PURE__ */ Symbol.for("react.activity"), _ = Symbol.iterator;
1013
+ function A(o) {
1014
+ return o === null || typeof o != "object" ? null : (o = _ && o[_] || o["@@iterator"], typeof o == "function" ? o : null);
1015
+ }
1016
+ var k = {
1017
+ isMounted: function() {
1018
+ return !1;
1019
+ },
1020
+ enqueueForceUpdate: function() {
1021
+ },
1022
+ enqueueReplaceState: function() {
1023
+ },
1024
+ enqueueSetState: function() {
1025
+ }
1026
+ }, N = Object.assign, $ = {};
1027
+ function g(o, l, O) {
1028
+ this.props = o, this.context = l, this.refs = $, this.updater = O || k;
1029
+ }
1030
+ g.prototype.isReactComponent = {}, g.prototype.setState = function(o, l) {
1031
+ if (typeof o != "object" && typeof o != "function" && o != null)
1032
+ throw Error(
1033
+ "takes an object of state variables to update or a function which returns an object of state variables."
1034
+ );
1035
+ this.updater.enqueueSetState(this, o, l, "setState");
1036
+ }, g.prototype.forceUpdate = function(o) {
1037
+ this.updater.enqueueForceUpdate(this, o, "forceUpdate");
1038
+ };
1039
+ function Y() {
1040
+ }
1041
+ Y.prototype = g.prototype;
1042
+ function U(o, l, O) {
1043
+ this.props = o, this.context = l, this.refs = $, this.updater = O || k;
1044
+ }
1045
+ var j = U.prototype = new Y();
1046
+ j.constructor = U, N(j, g.prototype), j.isPureReactComponent = !0;
1047
+ var W = Array.isArray;
1048
+ function q() {
1049
+ }
1050
+ var H = { H: null, A: null, T: null, S: null }, _e = Object.prototype.hasOwnProperty;
1051
+ function Q(o, l, O) {
1052
+ var R = O.ref;
1053
+ return {
1054
+ $$typeof: t,
1055
+ type: o,
1056
+ key: l,
1057
+ ref: R !== void 0 ? R : null,
1058
+ props: O
1059
+ };
1060
+ }
1061
+ function se(o, l) {
1062
+ return Q(o.type, l, o.props);
1063
+ }
1064
+ function fe(o) {
1065
+ return typeof o == "object" && o !== null && o.$$typeof === t;
1066
+ }
1067
+ function M(o) {
1068
+ var l = { "=": "=0", ":": "=2" };
1069
+ return "$" + o.replace(/[=:]/g, function(O) {
1070
+ return l[O];
1071
+ });
1072
+ }
1073
+ var de = /\/+/g;
1074
+ function X(o, l) {
1075
+ return typeof o == "object" && o !== null && o.key != null ? M("" + o.key) : l.toString(36);
1076
+ }
1077
+ function re(o) {
1078
+ switch (o.status) {
1079
+ case "fulfilled":
1080
+ return o.value;
1081
+ case "rejected":
1082
+ throw o.reason;
1083
+ default:
1084
+ switch (typeof o.status == "string" ? o.then(q, q) : (o.status = "pending", o.then(
1085
+ function(l) {
1086
+ o.status === "pending" && (o.status = "fulfilled", o.value = l);
1087
+ },
1088
+ function(l) {
1089
+ o.status === "pending" && (o.status = "rejected", o.reason = l);
1090
+ }
1091
+ )), o.status) {
1092
+ case "fulfilled":
1093
+ return o.value;
1094
+ case "rejected":
1095
+ throw o.reason;
1096
+ }
1097
+ }
1098
+ throw o;
1099
+ }
1100
+ function B(o, l, O, R, S) {
1101
+ var D = typeof o;
1102
+ (D === "undefined" || D === "boolean") && (o = null);
1103
+ var L = !1;
1104
+ if (o === null) L = !0;
1105
+ else
1106
+ switch (D) {
1107
+ case "bigint":
1108
+ case "string":
1109
+ case "number":
1110
+ L = !0;
1111
+ break;
1112
+ case "object":
1113
+ switch (o.$$typeof) {
1114
+ case t:
1115
+ case r:
1116
+ L = !0;
1117
+ break;
1118
+ case f:
1119
+ return L = o._init, B(
1120
+ L(o._payload),
1121
+ l,
1122
+ O,
1123
+ R,
1124
+ S
1125
+ );
1126
+ }
1127
+ }
1128
+ if (L)
1129
+ return S = S(o), L = R === "" ? "." + X(o, 0) : R, W(S) ? (O = "", L != null && (O = L.replace(de, "$&/") + "/"), B(S, l, O, "", function(ne) {
1130
+ return ne;
1131
+ })) : S != null && (fe(S) && (S = se(
1132
+ S,
1133
+ O + (S.key == null || o && o.key === S.key ? "" : ("" + S.key).replace(
1134
+ de,
1135
+ "$&/"
1136
+ ) + "/") + L
1137
+ )), l.push(S)), 1;
1138
+ L = 0;
1139
+ var G = R === "" ? "." : R + ":";
1140
+ if (W(o))
1141
+ for (var F = 0; F < o.length; F++)
1142
+ R = o[F], D = G + X(R, F), L += B(
1143
+ R,
1144
+ l,
1145
+ O,
1146
+ D,
1147
+ S
1148
+ );
1149
+ else if (F = A(o), typeof F == "function")
1150
+ for (o = F.call(o), F = 0; !(R = o.next()).done; )
1151
+ R = R.value, D = G + X(R, F++), L += B(
1152
+ R,
1153
+ l,
1154
+ O,
1155
+ D,
1156
+ S
1157
+ );
1158
+ else if (D === "object") {
1159
+ if (typeof o.then == "function")
1160
+ return B(
1161
+ re(o),
1162
+ l,
1163
+ O,
1164
+ R,
1165
+ S
1166
+ );
1167
+ throw l = String(o), Error(
1168
+ "Objects are not valid as a React child (found: " + (l === "[object Object]" ? "object with keys {" + Object.keys(o).join(", ") + "}" : l) + "). If you meant to render a collection of children, use an array instead."
1169
+ );
1170
+ }
1171
+ return L;
1172
+ }
1173
+ function Z(o, l, O) {
1174
+ if (o == null) return o;
1175
+ var R = [], S = 0;
1176
+ return B(o, R, "", "", function(D) {
1177
+ return l.call(O, D, S++);
1178
+ }), R;
1179
+ }
1180
+ function he(o) {
1181
+ if (o._status === -1) {
1182
+ var l = o._result;
1183
+ l = l(), l.then(
1184
+ function(O) {
1185
+ (o._status === 0 || o._status === -1) && (o._status = 1, o._result = O);
1186
+ },
1187
+ function(O) {
1188
+ (o._status === 0 || o._status === -1) && (o._status = 2, o._result = O);
1189
+ }
1190
+ ), o._status === -1 && (o._status = 0, o._result = l);
1191
+ }
1192
+ if (o._status === 1) return o._result.default;
1193
+ throw o._result;
1194
+ }
1195
+ var ie = typeof reportError == "function" ? reportError : function(o) {
1196
+ if (typeof window == "object" && typeof window.ErrorEvent == "function") {
1197
+ var l = new window.ErrorEvent("error", {
1198
+ bubbles: !0,
1199
+ cancelable: !0,
1200
+ message: typeof o == "object" && o !== null && typeof o.message == "string" ? String(o.message) : String(o),
1201
+ error: o
1202
+ });
1203
+ if (!window.dispatchEvent(l)) return;
1204
+ } else if (typeof process == "object" && typeof process.emit == "function") {
1205
+ process.emit("uncaughtException", o);
1206
+ return;
1207
+ }
1208
+ console.error(o);
1209
+ }, ge = {
1210
+ map: Z,
1211
+ forEach: function(o, l, O) {
1212
+ Z(
1213
+ o,
1214
+ function() {
1215
+ l.apply(this, arguments);
1216
+ },
1217
+ O
1218
+ );
1219
+ },
1220
+ count: function(o) {
1221
+ var l = 0;
1222
+ return Z(o, function() {
1223
+ l++;
1224
+ }), l;
1225
+ },
1226
+ toArray: function(o) {
1227
+ return Z(o, function(l) {
1228
+ return l;
1229
+ }) || [];
1230
+ },
1231
+ only: function(o) {
1232
+ if (!fe(o))
1233
+ throw Error(
1234
+ "React.Children.only expected to receive a single React element child."
1235
+ );
1236
+ return o;
1237
+ }
1238
+ };
1239
+ return C.Activity = v, C.Children = ge, C.Component = g, C.Fragment = n, C.Profiler = a, C.PureComponent = U, C.StrictMode = i, C.Suspense = E, C.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = H, C.__COMPILER_RUNTIME = {
1240
+ __proto__: null,
1241
+ c: function(o) {
1242
+ return H.H.useMemoCache(o);
1243
+ }
1244
+ }, C.cache = function(o) {
1245
+ return function() {
1246
+ return o.apply(null, arguments);
1247
+ };
1248
+ }, C.cacheSignal = function() {
1249
+ return null;
1250
+ }, C.cloneElement = function(o, l, O) {
1251
+ if (o == null)
1252
+ throw Error(
1253
+ "The argument must be a React element, but you passed " + o + "."
1254
+ );
1255
+ var R = N({}, o.props), S = o.key;
1256
+ if (l != null)
1257
+ for (D in l.key !== void 0 && (S = "" + l.key), l)
1258
+ !_e.call(l, D) || D === "key" || D === "__self" || D === "__source" || D === "ref" && l.ref === void 0 || (R[D] = l[D]);
1259
+ var D = arguments.length - 2;
1260
+ if (D === 1) R.children = O;
1261
+ else if (1 < D) {
1262
+ for (var L = Array(D), G = 0; G < D; G++)
1263
+ L[G] = arguments[G + 2];
1264
+ R.children = L;
1265
+ }
1266
+ return Q(o.type, S, R);
1267
+ }, C.createContext = function(o) {
1268
+ return o = {
1269
+ $$typeof: h,
1270
+ _currentValue: o,
1271
+ _currentValue2: o,
1272
+ _threadCount: 0,
1273
+ Provider: null,
1274
+ Consumer: null
1275
+ }, o.Provider = o, o.Consumer = {
1276
+ $$typeof: c,
1277
+ _context: o
1278
+ }, o;
1279
+ }, C.createElement = function(o, l, O) {
1280
+ var R, S = {}, D = null;
1281
+ if (l != null)
1282
+ for (R in l.key !== void 0 && (D = "" + l.key), l)
1283
+ _e.call(l, R) && R !== "key" && R !== "__self" && R !== "__source" && (S[R] = l[R]);
1284
+ var L = arguments.length - 2;
1285
+ if (L === 1) S.children = O;
1286
+ else if (1 < L) {
1287
+ for (var G = Array(L), F = 0; F < L; F++)
1288
+ G[F] = arguments[F + 2];
1289
+ S.children = G;
1290
+ }
1291
+ if (o && o.defaultProps)
1292
+ for (R in L = o.defaultProps, L)
1293
+ S[R] === void 0 && (S[R] = L[R]);
1294
+ return Q(o, D, S);
1295
+ }, C.createRef = function() {
1296
+ return { current: null };
1297
+ }, C.forwardRef = function(o) {
1298
+ return { $$typeof: p, render: o };
1299
+ }, C.isValidElement = fe, C.lazy = function(o) {
1300
+ return {
1301
+ $$typeof: f,
1302
+ _payload: { _status: -1, _result: o },
1303
+ _init: he
1304
+ };
1305
+ }, C.memo = function(o, l) {
1306
+ return {
1307
+ $$typeof: y,
1308
+ type: o,
1309
+ compare: l === void 0 ? null : l
1310
+ };
1311
+ }, C.startTransition = function(o) {
1312
+ var l = H.T, O = {};
1313
+ H.T = O;
1314
+ try {
1315
+ var R = o(), S = H.S;
1316
+ S !== null && S(O, R), typeof R == "object" && R !== null && typeof R.then == "function" && R.then(q, ie);
1317
+ } catch (D) {
1318
+ ie(D);
1319
+ } finally {
1320
+ l !== null && O.types !== null && (l.types = O.types), H.T = l;
1321
+ }
1322
+ }, C.unstable_useCacheRefresh = function() {
1323
+ return H.H.useCacheRefresh();
1324
+ }, C.use = function(o) {
1325
+ return H.H.use(o);
1326
+ }, C.useActionState = function(o, l, O) {
1327
+ return H.H.useActionState(o, l, O);
1328
+ }, C.useCallback = function(o, l) {
1329
+ return H.H.useCallback(o, l);
1330
+ }, C.useContext = function(o) {
1331
+ return H.H.useContext(o);
1332
+ }, C.useDebugValue = function() {
1333
+ }, C.useDeferredValue = function(o, l) {
1334
+ return H.H.useDeferredValue(o, l);
1335
+ }, C.useEffect = function(o, l) {
1336
+ return H.H.useEffect(o, l);
1337
+ }, C.useEffectEvent = function(o) {
1338
+ return H.H.useEffectEvent(o);
1339
+ }, C.useId = function() {
1340
+ return H.H.useId();
1341
+ }, C.useImperativeHandle = function(o, l, O) {
1342
+ return H.H.useImperativeHandle(o, l, O);
1343
+ }, C.useInsertionEffect = function(o, l) {
1344
+ return H.H.useInsertionEffect(o, l);
1345
+ }, C.useLayoutEffect = function(o, l) {
1346
+ return H.H.useLayoutEffect(o, l);
1347
+ }, C.useMemo = function(o, l) {
1348
+ return H.H.useMemo(o, l);
1349
+ }, C.useOptimistic = function(o, l) {
1350
+ return H.H.useOptimistic(o, l);
1351
+ }, C.useReducer = function(o, l, O) {
1352
+ return H.H.useReducer(o, l, O);
1353
+ }, C.useRef = function(o) {
1354
+ return H.H.useRef(o);
1355
+ }, C.useState = function(o) {
1356
+ return H.H.useState(o);
1357
+ }, C.useSyncExternalStore = function(o, l, O) {
1358
+ return H.H.useSyncExternalStore(
1359
+ o,
1360
+ l,
1361
+ O
1362
+ );
1363
+ }, C.useTransition = function() {
1364
+ return H.H.useTransition();
1365
+ }, C.version = "19.2.0", C;
1366
+ }
1367
+ var pe = { exports: {} };
1368
+ pe.exports;
1369
+ var ct;
1370
+ function Ar() {
1371
+ return ct || (ct = 1, (function(t, r) {
1372
+ process.env.NODE_ENV !== "production" && (function() {
1373
+ function n(e, s) {
1374
+ Object.defineProperty(c.prototype, e, {
1375
+ get: function() {
1376
+ console.warn(
1377
+ "%s(...) is deprecated in plain JavaScript React classes. %s",
1378
+ s[0],
1379
+ s[1]
1380
+ );
1381
+ }
1382
+ });
1383
+ }
1384
+ function i(e) {
1385
+ return e === null || typeof e != "object" ? null : (e = Ye && e[Ye] || e["@@iterator"], typeof e == "function" ? e : null);
1386
+ }
1387
+ function a(e, s) {
1388
+ e = (e = e.constructor) && (e.displayName || e.name) || "ReactClass";
1389
+ var u = e + "." + s;
1390
+ Fe[u] || (console.error(
1391
+ "Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",
1392
+ s,
1393
+ e
1394
+ ), Fe[u] = !0);
1395
+ }
1396
+ function c(e, s, u) {
1397
+ this.props = e, this.context = s, this.refs = Te, this.updater = u || Ue;
1398
+ }
1399
+ function h() {
1400
+ }
1401
+ function p(e, s, u) {
1402
+ this.props = e, this.context = s, this.refs = Te, this.updater = u || Ue;
1403
+ }
1404
+ function E() {
1405
+ }
1406
+ function y(e) {
1407
+ return "" + e;
1408
+ }
1409
+ function f(e) {
1410
+ try {
1411
+ y(e);
1412
+ var s = !1;
1413
+ } catch {
1414
+ s = !0;
1415
+ }
1416
+ if (s) {
1417
+ s = console;
1418
+ var u = s.error, d = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
1419
+ return u.call(
1420
+ s,
1421
+ "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
1422
+ d
1423
+ ), y(e);
1424
+ }
1425
+ }
1426
+ function v(e) {
1427
+ if (e == null) return null;
1428
+ if (typeof e == "function")
1429
+ return e.$$typeof === xt ? null : e.displayName || e.name || null;
1430
+ if (typeof e == "string") return e;
1431
+ switch (e) {
1432
+ case o:
1433
+ return "Fragment";
1434
+ case O:
1435
+ return "Profiler";
1436
+ case l:
1437
+ return "StrictMode";
1438
+ case L:
1439
+ return "Suspense";
1440
+ case G:
1441
+ return "SuspenseList";
1442
+ case $e:
1443
+ return "Activity";
1444
+ }
1445
+ if (typeof e == "object")
1446
+ switch (typeof e.tag == "number" && console.error(
1447
+ "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
1448
+ ), e.$$typeof) {
1449
+ case ge:
1450
+ return "Portal";
1451
+ case S:
1452
+ return e.displayName || "Context";
1453
+ case R:
1454
+ return (e._context.displayName || "Context") + ".Consumer";
1455
+ case D:
1456
+ var s = e.render;
1457
+ return e = e.displayName, e || (e = s.displayName || s.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
1458
+ case F:
1459
+ return s = e.displayName || null, s !== null ? s : v(e.type) || "Memo";
1460
+ case ne:
1461
+ s = e._payload, e = e._init;
1462
+ try {
1463
+ return v(e(s));
1464
+ } catch {
1465
+ }
1466
+ }
1467
+ return null;
1468
+ }
1469
+ function _(e) {
1470
+ if (e === o) return "<>";
1471
+ if (typeof e == "object" && e !== null && e.$$typeof === ne)
1472
+ return "<...>";
1473
+ try {
1474
+ var s = v(e);
1475
+ return s ? "<" + s + ">" : "<...>";
1476
+ } catch {
1477
+ return "<...>";
1478
+ }
1479
+ }
1480
+ function A() {
1481
+ var e = P.A;
1482
+ return e === null ? null : e.getOwner();
1483
+ }
1484
+ function k() {
1485
+ return Error("react-stack-top-frame");
1486
+ }
1487
+ function N(e) {
1488
+ if (Ee.call(e, "key")) {
1489
+ var s = Object.getOwnPropertyDescriptor(e, "key").get;
1490
+ if (s && s.isReactWarning) return !1;
1491
+ }
1492
+ return e.key !== void 0;
1493
+ }
1494
+ function $(e, s) {
1495
+ function u() {
1496
+ We || (We = !0, console.error(
1497
+ "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
1498
+ s
1499
+ ));
1500
+ }
1501
+ u.isReactWarning = !0, Object.defineProperty(e, "key", {
1502
+ get: u,
1503
+ configurable: !0
1504
+ });
1505
+ }
1506
+ function g() {
1507
+ var e = v(this.type);
1508
+ return Be[e] || (Be[e] = !0, console.error(
1509
+ "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
1510
+ )), e = this.props.ref, e !== void 0 ? e : null;
1511
+ }
1512
+ function Y(e, s, u, d, m, b) {
1513
+ var w = u.ref;
1514
+ return e = {
1515
+ $$typeof: ie,
1516
+ type: e,
1517
+ key: s,
1518
+ props: u,
1519
+ _owner: d
1520
+ }, (w !== void 0 ? w : null) !== null ? Object.defineProperty(e, "ref", {
1521
+ enumerable: !1,
1522
+ get: g
1523
+ }) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
1524
+ configurable: !1,
1525
+ enumerable: !1,
1526
+ writable: !0,
1527
+ value: 0
1528
+ }), Object.defineProperty(e, "_debugInfo", {
1529
+ configurable: !1,
1530
+ enumerable: !1,
1531
+ writable: !0,
1532
+ value: null
1533
+ }), Object.defineProperty(e, "_debugStack", {
1534
+ configurable: !1,
1535
+ enumerable: !1,
1536
+ writable: !0,
1537
+ value: m
1538
+ }), Object.defineProperty(e, "_debugTask", {
1539
+ configurable: !1,
1540
+ enumerable: !1,
1541
+ writable: !0,
1542
+ value: b
1543
+ }), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
1544
+ }
1545
+ function U(e, s) {
1546
+ return s = Y(
1547
+ e.type,
1548
+ s,
1549
+ e.props,
1550
+ e._owner,
1551
+ e._debugStack,
1552
+ e._debugTask
1553
+ ), e._store && (s._store.validated = e._store.validated), s;
1554
+ }
1555
+ function j(e) {
1556
+ W(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === ne && (e._payload.status === "fulfilled" ? W(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
1557
+ }
1558
+ function W(e) {
1559
+ return typeof e == "object" && e !== null && e.$$typeof === ie;
1560
+ }
1561
+ function q(e) {
1562
+ var s = { "=": "=0", ":": "=2" };
1563
+ return "$" + e.replace(/[=:]/g, function(u) {
1564
+ return s[u];
1565
+ });
1566
+ }
1567
+ function H(e, s) {
1568
+ return typeof e == "object" && e !== null && e.key != null ? (f(e.key), q("" + e.key)) : s.toString(36);
1569
+ }
1570
+ function _e(e) {
1571
+ switch (e.status) {
1572
+ case "fulfilled":
1573
+ return e.value;
1574
+ case "rejected":
1575
+ throw e.reason;
1576
+ default:
1577
+ switch (typeof e.status == "string" ? e.then(E, E) : (e.status = "pending", e.then(
1578
+ function(s) {
1579
+ e.status === "pending" && (e.status = "fulfilled", e.value = s);
1580
+ },
1581
+ function(s) {
1582
+ e.status === "pending" && (e.status = "rejected", e.reason = s);
1583
+ }
1584
+ )), e.status) {
1585
+ case "fulfilled":
1586
+ return e.value;
1587
+ case "rejected":
1588
+ throw e.reason;
1589
+ }
1590
+ }
1591
+ throw e;
1592
+ }
1593
+ function Q(e, s, u, d, m) {
1594
+ var b = typeof e;
1595
+ (b === "undefined" || b === "boolean") && (e = null);
1596
+ var w = !1;
1597
+ if (e === null) w = !0;
1598
+ else
1599
+ switch (b) {
1600
+ case "bigint":
1601
+ case "string":
1602
+ case "number":
1603
+ w = !0;
1604
+ break;
1605
+ case "object":
1606
+ switch (e.$$typeof) {
1607
+ case ie:
1608
+ case ge:
1609
+ w = !0;
1610
+ break;
1611
+ case ne:
1612
+ return w = e._init, Q(
1613
+ w(e._payload),
1614
+ s,
1615
+ u,
1616
+ d,
1617
+ m
1618
+ );
1619
+ }
1620
+ }
1621
+ if (w) {
1622
+ w = e, m = m(w);
1623
+ var x = d === "" ? "." + H(w, 0) : d;
1624
+ return Ve(m) ? (u = "", x != null && (u = x.replace(Ke, "$&/") + "/"), Q(m, s, u, "", function(J) {
1625
+ return J;
1626
+ })) : m != null && (W(m) && (m.key != null && (w && w.key === m.key || f(m.key)), u = U(
1627
+ m,
1628
+ u + (m.key == null || w && w.key === m.key ? "" : ("" + m.key).replace(
1629
+ Ke,
1630
+ "$&/"
1631
+ ) + "/") + x
1632
+ ), d !== "" && w != null && W(w) && w.key == null && w._store && !w._store.validated && (u._store.validated = 2), m = u), s.push(m)), 1;
1633
+ }
1634
+ if (w = 0, x = d === "" ? "." : d + ":", Ve(e))
1635
+ for (var T = 0; T < e.length; T++)
1636
+ d = e[T], b = x + H(d, T), w += Q(
1637
+ d,
1638
+ s,
1639
+ u,
1640
+ b,
1641
+ m
1642
+ );
1643
+ else if (T = i(e), typeof T == "function")
1644
+ for (T === e.entries && (Qe || console.warn(
1645
+ "Using Maps as children is not supported. Use an array of keyed ReactElements instead."
1646
+ ), Qe = !0), e = T.call(e), T = 0; !(d = e.next()).done; )
1647
+ d = d.value, b = x + H(d, T++), w += Q(
1648
+ d,
1649
+ s,
1650
+ u,
1651
+ b,
1652
+ m
1653
+ );
1654
+ else if (b === "object") {
1655
+ if (typeof e.then == "function")
1656
+ return Q(
1657
+ _e(e),
1658
+ s,
1659
+ u,
1660
+ d,
1661
+ m
1662
+ );
1663
+ throw s = String(e), Error(
1664
+ "Objects are not valid as a React child (found: " + (s === "[object Object]" ? "object with keys {" + Object.keys(e).join(", ") + "}" : s) + "). If you meant to render a collection of children, use an array instead."
1665
+ );
1666
+ }
1667
+ return w;
1668
+ }
1669
+ function se(e, s, u) {
1670
+ if (e == null) return e;
1671
+ var d = [], m = 0;
1672
+ return Q(e, d, "", "", function(b) {
1673
+ return s.call(u, b, m++);
1674
+ }), d;
1675
+ }
1676
+ function fe(e) {
1677
+ if (e._status === -1) {
1678
+ var s = e._ioInfo;
1679
+ s != null && (s.start = s.end = performance.now()), s = e._result;
1680
+ var u = s();
1681
+ if (u.then(
1682
+ function(m) {
1683
+ if (e._status === 0 || e._status === -1) {
1684
+ e._status = 1, e._result = m;
1685
+ var b = e._ioInfo;
1686
+ b != null && (b.end = performance.now()), u.status === void 0 && (u.status = "fulfilled", u.value = m);
1687
+ }
1688
+ },
1689
+ function(m) {
1690
+ if (e._status === 0 || e._status === -1) {
1691
+ e._status = 2, e._result = m;
1692
+ var b = e._ioInfo;
1693
+ b != null && (b.end = performance.now()), u.status === void 0 && (u.status = "rejected", u.reason = m);
1694
+ }
1695
+ }
1696
+ ), s = e._ioInfo, s != null) {
1697
+ s.value = u;
1698
+ var d = u.displayName;
1699
+ typeof d == "string" && (s.name = d);
1700
+ }
1701
+ e._status === -1 && (e._status = 0, e._result = u);
1702
+ }
1703
+ if (e._status === 1)
1704
+ return s = e._result, s === void 0 && console.error(
1705
+ `lazy: Expected the result of a dynamic import() call. Instead received: %s
1706
+
1707
+ Your code should look like:
1708
+ const MyComponent = lazy(() => import('./MyComponent'))
1709
+
1710
+ Did you accidentally put curly braces around the import?`,
1711
+ s
1712
+ ), "default" in s || console.error(
1713
+ `lazy: Expected the result of a dynamic import() call. Instead received: %s
1714
+
1715
+ Your code should look like:
1716
+ const MyComponent = lazy(() => import('./MyComponent'))`,
1717
+ s
1718
+ ), s.default;
1719
+ throw e._result;
1720
+ }
1721
+ function M() {
1722
+ var e = P.H;
1723
+ return e === null && console.error(
1724
+ `Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1725
+ 1. You might have mismatching versions of React and the renderer (such as React DOM)
1726
+ 2. You might be breaking the Rules of Hooks
1727
+ 3. You might have more than one copy of React in the same app
1728
+ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`
1729
+ ), e;
1730
+ }
1731
+ function de() {
1732
+ P.asyncTransitions--;
1733
+ }
1734
+ function X(e) {
1735
+ if (me === null)
1736
+ try {
1737
+ var s = ("require" + Math.random()).slice(0, 7);
1738
+ me = (t && t[s]).call(
1739
+ t,
1740
+ "timers"
1741
+ ).setImmediate;
1742
+ } catch {
1743
+ me = function(d) {
1744
+ Ze === !1 && (Ze = !0, typeof MessageChannel > "u" && console.error(
1745
+ "This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."
1746
+ ));
1747
+ var m = new MessageChannel();
1748
+ m.port1.onmessage = d, m.port2.postMessage(void 0);
1749
+ };
1750
+ }
1751
+ return me(e);
1752
+ }
1753
+ function re(e) {
1754
+ return 1 < e.length && typeof AggregateError == "function" ? new AggregateError(e) : e[0];
1755
+ }
1756
+ function B(e, s) {
1757
+ s !== ye - 1 && console.error(
1758
+ "You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "
1759
+ ), ye = s;
1760
+ }
1761
+ function Z(e, s, u) {
1762
+ var d = P.actQueue;
1763
+ if (d !== null)
1764
+ if (d.length !== 0)
1765
+ try {
1766
+ he(d), X(function() {
1767
+ return Z(e, s, u);
1768
+ });
1769
+ return;
1770
+ } catch (m) {
1771
+ P.thrownErrors.push(m);
1772
+ }
1773
+ else P.actQueue = null;
1774
+ 0 < P.thrownErrors.length ? (d = re(P.thrownErrors), P.thrownErrors.length = 0, u(d)) : s(e);
1775
+ }
1776
+ function he(e) {
1777
+ if (!Se) {
1778
+ Se = !0;
1779
+ var s = 0;
1780
+ try {
1781
+ for (; s < e.length; s++) {
1782
+ var u = e[s];
1783
+ do {
1784
+ P.didUsePromise = !1;
1785
+ var d = u(!1);
1786
+ if (d !== null) {
1787
+ if (P.didUsePromise) {
1788
+ e[s] = u, e.splice(0, s);
1789
+ return;
1790
+ }
1791
+ u = d;
1792
+ } else break;
1793
+ } while (!0);
1794
+ }
1795
+ e.length = 0;
1796
+ } catch (m) {
1797
+ e.splice(0, s + 1), P.thrownErrors.push(m);
1798
+ } finally {
1799
+ Se = !1;
1800
+ }
1801
+ }
1802
+ }
1803
+ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
1804
+ var ie = /* @__PURE__ */ Symbol.for("react.transitional.element"), ge = /* @__PURE__ */ Symbol.for("react.portal"), o = /* @__PURE__ */ Symbol.for("react.fragment"), l = /* @__PURE__ */ Symbol.for("react.strict_mode"), O = /* @__PURE__ */ Symbol.for("react.profiler"), R = /* @__PURE__ */ Symbol.for("react.consumer"), S = /* @__PURE__ */ Symbol.for("react.context"), D = /* @__PURE__ */ Symbol.for("react.forward_ref"), L = /* @__PURE__ */ Symbol.for("react.suspense"), G = /* @__PURE__ */ Symbol.for("react.suspense_list"), F = /* @__PURE__ */ Symbol.for("react.memo"), ne = /* @__PURE__ */ Symbol.for("react.lazy"), $e = /* @__PURE__ */ Symbol.for("react.activity"), Ye = Symbol.iterator, Fe = {}, Ue = {
1805
+ isMounted: function() {
1806
+ return !1;
1807
+ },
1808
+ enqueueForceUpdate: function(e) {
1809
+ a(e, "forceUpdate");
1810
+ },
1811
+ enqueueReplaceState: function(e) {
1812
+ a(e, "replaceState");
1813
+ },
1814
+ enqueueSetState: function(e) {
1815
+ a(e, "setState");
1816
+ }
1817
+ }, Ge = Object.assign, Te = {};
1818
+ Object.freeze(Te), c.prototype.isReactComponent = {}, c.prototype.setState = function(e, s) {
1819
+ if (typeof e != "object" && typeof e != "function" && e != null)
1820
+ throw Error(
1821
+ "takes an object of state variables to update or a function which returns an object of state variables."
1822
+ );
1823
+ this.updater.enqueueSetState(this, e, s, "setState");
1824
+ }, c.prototype.forceUpdate = function(e) {
1825
+ this.updater.enqueueForceUpdate(this, e, "forceUpdate");
1826
+ };
1827
+ var V = {
1828
+ isMounted: [
1829
+ "isMounted",
1830
+ "Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."
1831
+ ],
1832
+ replaceState: [
1833
+ "replaceState",
1834
+ "Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."
1835
+ ]
1836
+ };
1837
+ for (ve in V)
1838
+ V.hasOwnProperty(ve) && n(ve, V[ve]);
1839
+ h.prototype = c.prototype, V = p.prototype = new h(), V.constructor = p, Ge(V, c.prototype), V.isPureReactComponent = !0;
1840
+ var Ve = Array.isArray, xt = /* @__PURE__ */ Symbol.for("react.client.reference"), P = {
1841
+ H: null,
1842
+ A: null,
1843
+ T: null,
1844
+ S: null,
1845
+ actQueue: null,
1846
+ asyncTransitions: 0,
1847
+ isBatchingLegacy: !1,
1848
+ didScheduleLegacyUpdate: !1,
1849
+ didUsePromise: !1,
1850
+ thrownErrors: [],
1851
+ getCurrentStack: null,
1852
+ recentlyCreatedOwnerStacks: 0
1853
+ }, Ee = Object.prototype.hasOwnProperty, ze = console.createTask ? console.createTask : function() {
1854
+ return null;
1855
+ };
1856
+ V = {
1857
+ react_stack_bottom_frame: function(e) {
1858
+ return e();
1859
+ }
1860
+ };
1861
+ var We, qe, Be = {}, Mt = V.react_stack_bottom_frame.bind(
1862
+ V,
1863
+ k
1864
+ )(), $t = ze(_(k)), Qe = !1, Ke = /\/+/g, Xe = typeof reportError == "function" ? reportError : function(e) {
1865
+ if (typeof window == "object" && typeof window.ErrorEvent == "function") {
1866
+ var s = new window.ErrorEvent("error", {
1867
+ bubbles: !0,
1868
+ cancelable: !0,
1869
+ message: typeof e == "object" && e !== null && typeof e.message == "string" ? String(e.message) : String(e),
1870
+ error: e
1871
+ });
1872
+ if (!window.dispatchEvent(s)) return;
1873
+ } else if (typeof process == "object" && typeof process.emit == "function") {
1874
+ process.emit("uncaughtException", e);
1875
+ return;
1876
+ }
1877
+ console.error(e);
1878
+ }, Ze = !1, me = null, ye = 0, Re = !1, Se = !1, Je = typeof queueMicrotask == "function" ? function(e) {
1879
+ queueMicrotask(function() {
1880
+ return queueMicrotask(e);
1881
+ });
1882
+ } : X;
1883
+ V = Object.freeze({
1884
+ __proto__: null,
1885
+ c: function(e) {
1886
+ return M().useMemoCache(e);
1887
+ }
1888
+ });
1889
+ var ve = {
1890
+ map: se,
1891
+ forEach: function(e, s, u) {
1892
+ se(
1893
+ e,
1894
+ function() {
1895
+ s.apply(this, arguments);
1896
+ },
1897
+ u
1898
+ );
1899
+ },
1900
+ count: function(e) {
1901
+ var s = 0;
1902
+ return se(e, function() {
1903
+ s++;
1904
+ }), s;
1905
+ },
1906
+ toArray: function(e) {
1907
+ return se(e, function(s) {
1908
+ return s;
1909
+ }) || [];
1910
+ },
1911
+ only: function(e) {
1912
+ if (!W(e))
1913
+ throw Error(
1914
+ "React.Children.only expected to receive a single React element child."
1915
+ );
1916
+ return e;
1917
+ }
1918
+ };
1919
+ r.Activity = $e, r.Children = ve, r.Component = c, r.Fragment = o, r.Profiler = O, r.PureComponent = p, r.StrictMode = l, r.Suspense = L, r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = P, r.__COMPILER_RUNTIME = V, r.act = function(e) {
1920
+ var s = P.actQueue, u = ye;
1921
+ ye++;
1922
+ var d = P.actQueue = s !== null ? s : [], m = !1;
1923
+ try {
1924
+ var b = e();
1925
+ } catch (T) {
1926
+ P.thrownErrors.push(T);
1927
+ }
1928
+ if (0 < P.thrownErrors.length)
1929
+ throw B(s, u), e = re(P.thrownErrors), P.thrownErrors.length = 0, e;
1930
+ if (b !== null && typeof b == "object" && typeof b.then == "function") {
1931
+ var w = b;
1932
+ return Je(function() {
1933
+ m || Re || (Re = !0, console.error(
1934
+ "You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"
1935
+ ));
1936
+ }), {
1937
+ then: function(T, J) {
1938
+ m = !0, w.then(
1939
+ function(ae) {
1940
+ if (B(s, u), u === 0) {
1941
+ try {
1942
+ he(d), X(function() {
1943
+ return Z(
1944
+ ae,
1945
+ T,
1946
+ J
1947
+ );
1948
+ });
1949
+ } catch (Ft) {
1950
+ P.thrownErrors.push(Ft);
1951
+ }
1952
+ if (0 < P.thrownErrors.length) {
1953
+ var Yt = re(
1954
+ P.thrownErrors
1955
+ );
1956
+ P.thrownErrors.length = 0, J(Yt);
1957
+ }
1958
+ } else T(ae);
1959
+ },
1960
+ function(ae) {
1961
+ B(s, u), 0 < P.thrownErrors.length && (ae = re(
1962
+ P.thrownErrors
1963
+ ), P.thrownErrors.length = 0), J(ae);
1964
+ }
1965
+ );
1966
+ }
1967
+ };
1968
+ }
1969
+ var x = b;
1970
+ if (B(s, u), u === 0 && (he(d), d.length !== 0 && Je(function() {
1971
+ m || Re || (Re = !0, console.error(
1972
+ "A component suspended inside an `act` scope, but the `act` call was not awaited. When testing React components that depend on asynchronous data, you must await the result:\n\nawait act(() => ...)"
1973
+ ));
1974
+ }), P.actQueue = null), 0 < P.thrownErrors.length)
1975
+ throw e = re(P.thrownErrors), P.thrownErrors.length = 0, e;
1976
+ return {
1977
+ then: function(T, J) {
1978
+ m = !0, u === 0 ? (P.actQueue = d, X(function() {
1979
+ return Z(
1980
+ x,
1981
+ T,
1982
+ J
1983
+ );
1984
+ })) : T(x);
1985
+ }
1986
+ };
1987
+ }, r.cache = function(e) {
1988
+ return function() {
1989
+ return e.apply(null, arguments);
1990
+ };
1991
+ }, r.cacheSignal = function() {
1992
+ return null;
1993
+ }, r.captureOwnerStack = function() {
1994
+ var e = P.getCurrentStack;
1995
+ return e === null ? null : e();
1996
+ }, r.cloneElement = function(e, s, u) {
1997
+ if (e == null)
1998
+ throw Error(
1999
+ "The argument must be a React element, but you passed " + e + "."
2000
+ );
2001
+ var d = Ge({}, e.props), m = e.key, b = e._owner;
2002
+ if (s != null) {
2003
+ var w;
2004
+ e: {
2005
+ if (Ee.call(s, "ref") && (w = Object.getOwnPropertyDescriptor(
2006
+ s,
2007
+ "ref"
2008
+ ).get) && w.isReactWarning) {
2009
+ w = !1;
2010
+ break e;
2011
+ }
2012
+ w = s.ref !== void 0;
2013
+ }
2014
+ w && (b = A()), N(s) && (f(s.key), m = "" + s.key);
2015
+ for (x in s)
2016
+ !Ee.call(s, x) || x === "key" || x === "__self" || x === "__source" || x === "ref" && s.ref === void 0 || (d[x] = s[x]);
2017
+ }
2018
+ var x = arguments.length - 2;
2019
+ if (x === 1) d.children = u;
2020
+ else if (1 < x) {
2021
+ w = Array(x);
2022
+ for (var T = 0; T < x; T++)
2023
+ w[T] = arguments[T + 2];
2024
+ d.children = w;
2025
+ }
2026
+ for (d = Y(
2027
+ e.type,
2028
+ m,
2029
+ d,
2030
+ b,
2031
+ e._debugStack,
2032
+ e._debugTask
2033
+ ), m = 2; m < arguments.length; m++)
2034
+ j(arguments[m]);
2035
+ return d;
2036
+ }, r.createContext = function(e) {
2037
+ return e = {
2038
+ $$typeof: S,
2039
+ _currentValue: e,
2040
+ _currentValue2: e,
2041
+ _threadCount: 0,
2042
+ Provider: null,
2043
+ Consumer: null
2044
+ }, e.Provider = e, e.Consumer = {
2045
+ $$typeof: R,
2046
+ _context: e
2047
+ }, e._currentRenderer = null, e._currentRenderer2 = null, e;
2048
+ }, r.createElement = function(e, s, u) {
2049
+ for (var d = 2; d < arguments.length; d++)
2050
+ j(arguments[d]);
2051
+ d = {};
2052
+ var m = null;
2053
+ if (s != null)
2054
+ for (T in qe || !("__self" in s) || "key" in s || (qe = !0, console.warn(
2055
+ "Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform"
2056
+ )), N(s) && (f(s.key), m = "" + s.key), s)
2057
+ Ee.call(s, T) && T !== "key" && T !== "__self" && T !== "__source" && (d[T] = s[T]);
2058
+ var b = arguments.length - 2;
2059
+ if (b === 1) d.children = u;
2060
+ else if (1 < b) {
2061
+ for (var w = Array(b), x = 0; x < b; x++)
2062
+ w[x] = arguments[x + 2];
2063
+ Object.freeze && Object.freeze(w), d.children = w;
2064
+ }
2065
+ if (e && e.defaultProps)
2066
+ for (T in b = e.defaultProps, b)
2067
+ d[T] === void 0 && (d[T] = b[T]);
2068
+ m && $(
2069
+ d,
2070
+ typeof e == "function" ? e.displayName || e.name || "Unknown" : e
2071
+ );
2072
+ var T = 1e4 > P.recentlyCreatedOwnerStacks++;
2073
+ return Y(
2074
+ e,
2075
+ m,
2076
+ d,
2077
+ A(),
2078
+ T ? Error("react-stack-top-frame") : Mt,
2079
+ T ? ze(_(e)) : $t
2080
+ );
2081
+ }, r.createRef = function() {
2082
+ var e = { current: null };
2083
+ return Object.seal(e), e;
2084
+ }, r.forwardRef = function(e) {
2085
+ e != null && e.$$typeof === F ? console.error(
2086
+ "forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."
2087
+ ) : typeof e != "function" ? console.error(
2088
+ "forwardRef requires a render function but was given %s.",
2089
+ e === null ? "null" : typeof e
2090
+ ) : e.length !== 0 && e.length !== 2 && console.error(
2091
+ "forwardRef render functions accept exactly two parameters: props and ref. %s",
2092
+ e.length === 1 ? "Did you forget to use the ref parameter?" : "Any additional parameter will be undefined."
2093
+ ), e != null && e.defaultProps != null && console.error(
2094
+ "forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?"
2095
+ );
2096
+ var s = { $$typeof: D, render: e }, u;
2097
+ return Object.defineProperty(s, "displayName", {
2098
+ enumerable: !1,
2099
+ configurable: !0,
2100
+ get: function() {
2101
+ return u;
2102
+ },
2103
+ set: function(d) {
2104
+ u = d, e.name || e.displayName || (Object.defineProperty(e, "name", { value: d }), e.displayName = d);
2105
+ }
2106
+ }), s;
2107
+ }, r.isValidElement = W, r.lazy = function(e) {
2108
+ e = { _status: -1, _result: e };
2109
+ var s = {
2110
+ $$typeof: ne,
2111
+ _payload: e,
2112
+ _init: fe
2113
+ }, u = {
2114
+ name: "lazy",
2115
+ start: -1,
2116
+ end: -1,
2117
+ value: null,
2118
+ owner: null,
2119
+ debugStack: Error("react-stack-top-frame"),
2120
+ debugTask: console.createTask ? console.createTask("lazy()") : null
2121
+ };
2122
+ return e._ioInfo = u, s._debugInfo = [{ awaited: u }], s;
2123
+ }, r.memo = function(e, s) {
2124
+ e == null && console.error(
2125
+ "memo: The first argument must be a component. Instead received: %s",
2126
+ e === null ? "null" : typeof e
2127
+ ), s = {
2128
+ $$typeof: F,
2129
+ type: e,
2130
+ compare: s === void 0 ? null : s
2131
+ };
2132
+ var u;
2133
+ return Object.defineProperty(s, "displayName", {
2134
+ enumerable: !1,
2135
+ configurable: !0,
2136
+ get: function() {
2137
+ return u;
2138
+ },
2139
+ set: function(d) {
2140
+ u = d, e.name || e.displayName || (Object.defineProperty(e, "name", { value: d }), e.displayName = d);
2141
+ }
2142
+ }), s;
2143
+ }, r.startTransition = function(e) {
2144
+ var s = P.T, u = {};
2145
+ u._updatedFibers = /* @__PURE__ */ new Set(), P.T = u;
2146
+ try {
2147
+ var d = e(), m = P.S;
2148
+ m !== null && m(u, d), typeof d == "object" && d !== null && typeof d.then == "function" && (P.asyncTransitions++, d.then(de, de), d.then(E, Xe));
2149
+ } catch (b) {
2150
+ Xe(b);
2151
+ } finally {
2152
+ s === null && u._updatedFibers && (e = u._updatedFibers.size, u._updatedFibers.clear(), 10 < e && console.warn(
2153
+ "Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."
2154
+ )), s !== null && u.types !== null && (s.types !== null && s.types !== u.types && console.error(
2155
+ "We expected inner Transitions to have transferred the outer types set and that you cannot add to the outer Transition while inside the inner.This is a bug in React."
2156
+ ), s.types = u.types), P.T = s;
2157
+ }
2158
+ }, r.unstable_useCacheRefresh = function() {
2159
+ return M().useCacheRefresh();
2160
+ }, r.use = function(e) {
2161
+ return M().use(e);
2162
+ }, r.useActionState = function(e, s, u) {
2163
+ return M().useActionState(
2164
+ e,
2165
+ s,
2166
+ u
2167
+ );
2168
+ }, r.useCallback = function(e, s) {
2169
+ return M().useCallback(e, s);
2170
+ }, r.useContext = function(e) {
2171
+ var s = M();
2172
+ return e.$$typeof === R && console.error(
2173
+ "Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"
2174
+ ), s.useContext(e);
2175
+ }, r.useDebugValue = function(e, s) {
2176
+ return M().useDebugValue(e, s);
2177
+ }, r.useDeferredValue = function(e, s) {
2178
+ return M().useDeferredValue(e, s);
2179
+ }, r.useEffect = function(e, s) {
2180
+ return e == null && console.warn(
2181
+ "React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?"
2182
+ ), M().useEffect(e, s);
2183
+ }, r.useEffectEvent = function(e) {
2184
+ return M().useEffectEvent(e);
2185
+ }, r.useId = function() {
2186
+ return M().useId();
2187
+ }, r.useImperativeHandle = function(e, s, u) {
2188
+ return M().useImperativeHandle(e, s, u);
2189
+ }, r.useInsertionEffect = function(e, s) {
2190
+ return e == null && console.warn(
2191
+ "React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?"
2192
+ ), M().useInsertionEffect(e, s);
2193
+ }, r.useLayoutEffect = function(e, s) {
2194
+ return e == null && console.warn(
2195
+ "React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?"
2196
+ ), M().useLayoutEffect(e, s);
2197
+ }, r.useMemo = function(e, s) {
2198
+ return M().useMemo(e, s);
2199
+ }, r.useOptimistic = function(e, s) {
2200
+ return M().useOptimistic(e, s);
2201
+ }, r.useReducer = function(e, s, u) {
2202
+ return M().useReducer(e, s, u);
2203
+ }, r.useRef = function(e) {
2204
+ return M().useRef(e);
2205
+ }, r.useState = function(e) {
2206
+ return M().useState(e);
2207
+ }, r.useSyncExternalStore = function(e, s, u) {
2208
+ return M().useSyncExternalStore(
2209
+ e,
2210
+ s,
2211
+ u
2212
+ );
2213
+ }, r.useTransition = function() {
2214
+ return M().useTransition();
2215
+ }, r.version = "19.2.0", typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
2216
+ })();
2217
+ })(pe, pe.exports)), pe.exports;
2218
+ }
2219
+ var ft;
2220
+ function Pr() {
2221
+ return ft || (ft = 1, process.env.NODE_ENV === "production" ? Oe.exports = wr() : Oe.exports = Ar()), Oe.exports;
2222
+ }
2223
+ var K = Pr();
2224
+ const xe = /* @__PURE__ */ Cr(K);
2225
+ var br = Object.defineProperty, Pe = Object.getOwnPropertySymbols, Dt = Object.prototype.hasOwnProperty, It = Object.prototype.propertyIsEnumerable, dt = (t, r, n) => r in t ? br(t, r, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[r] = n, oe = (t, r) => {
2226
+ for (var n in r || (r = {}))
2227
+ Dt.call(r, n) && dt(t, n, r[n]);
2228
+ if (Pe)
2229
+ for (var n of Pe(r))
2230
+ It.call(r, n) && dt(t, n, r[n]);
2231
+ return t;
2232
+ }, Tr = (t, r) => {
2233
+ var n = {};
2234
+ for (var i in t)
2235
+ Dt.call(t, i) && r.indexOf(i) < 0 && (n[i] = t[i]);
2236
+ if (t != null && Pe)
2237
+ for (var i of Pe(t))
2238
+ r.indexOf(i) < 0 && It.call(t, i) && (n[i] = t[i]);
2239
+ return n;
2240
+ }, Me = xe.createContext(void 0);
2241
+ function Sr() {
2242
+ const { options: t } = xe.useContext(Me) || {};
2243
+ return Lt(t);
2244
+ }
2245
+ function Ht(t, r) {
2246
+ if (t === r)
2247
+ return !0;
2248
+ if (typeof t != typeof r)
2249
+ return !1;
2250
+ if (typeof t == "object" && t !== null && r !== null) {
2251
+ const n = Object.keys(t), i = Object.keys(r);
2252
+ if (n.length !== i.length)
2253
+ return !1;
2254
+ for (const a of n)
2255
+ if (!Ht(t[a], r[a]))
2256
+ return !1;
2257
+ return !0;
2258
+ }
2259
+ return !1;
2260
+ }
2261
+ var Nr = {
2262
+ updateOnContextChanged: !0,
2263
+ updateOnConfigurationChanged: !0,
2264
+ suspendUntilReady: !1,
2265
+ suspendWhileReconciling: !1
2266
+ }, Lt = (t = {}) => {
2267
+ const r = t.updateOnContextChanged, n = t.updateOnConfigurationChanged, i = "suspendUntilReady" in t ? t.suspendUntilReady : t.suspend, a = "suspendWhileReconciling" in t ? t.suspendWhileReconciling : t.suspend;
2268
+ return oe(oe(oe(oe({}, typeof i == "boolean" && { suspendUntilReady: i }), typeof a == "boolean" && { suspendWhileReconciling: a }), typeof r == "boolean" && { updateOnContextChanged: r }), typeof n == "boolean" && { updateOnConfigurationChanged: n });
2269
+ };
2270
+ function ht(t) {
2271
+ let r, n;
2272
+ throw new Promise((i, a) => {
2273
+ r = i, n = a, t.addHandler(I.Ready, r), t.addHandler(I.Error, n);
2274
+ }).finally(() => {
2275
+ t.removeHandler(I.Ready, r), t.removeHandler(I.Ready, n);
2276
+ });
2277
+ }
2278
+ function jt() {
2279
+ const { client: t } = xe.useContext(Me) || {};
2280
+ if (!t)
2281
+ throw new Error(
2282
+ "No OpenFeature client available - components using OpenFeature must be wrapped with an <OpenFeatureProvider>. If you are seeing this in a test, see: https://openfeature.dev/docs/reference/technologies/client/web/react#testing"
2283
+ );
2284
+ return t;
2285
+ }
2286
+ function kr() {
2287
+ const t = jt(), [r, n] = K.useState(t.providerStatus);
2288
+ return K.useEffect(() => {
2289
+ const i = () => n(t.providerStatus);
2290
+ return t.addHandler(I.ConfigurationChanged, i), t.addHandler(I.ContextChanged, i), t.addHandler(I.Error, i), t.addHandler(I.Ready, i), t.addHandler(I.Stale, i), t.addHandler(I.Reconciling, i), () => {
2291
+ t.removeHandler(I.ConfigurationChanged, i), t.removeHandler(I.ContextChanged, i), t.removeHandler(I.Error, i), t.removeHandler(I.Ready, i), t.removeHandler(I.Stale, i), t.removeHandler(I.Reconciling, i);
2292
+ };
2293
+ }, [t]), r;
2294
+ }
2295
+ var Ce = class {
2296
+ constructor(t) {
2297
+ this._details = t;
2298
+ }
2299
+ get details() {
2300
+ return this._details;
2301
+ }
2302
+ get value() {
2303
+ var t;
2304
+ return (t = this._details) == null ? void 0 : t.value;
2305
+ }
2306
+ get variant() {
2307
+ return this._details.variant;
2308
+ }
2309
+ get flagMetadata() {
2310
+ return this._details.flagMetadata;
2311
+ }
2312
+ get reason() {
2313
+ return this._details.reason;
2314
+ }
2315
+ get isError() {
2316
+ var t;
2317
+ return !!((t = this._details) != null && t.errorCode) || this._details.reason == we.ERROR;
2318
+ }
2319
+ get errorCode() {
2320
+ var t;
2321
+ return (t = this._details) == null ? void 0 : t.errorCode;
2322
+ }
2323
+ get errorMessage() {
2324
+ var t;
2325
+ return (t = this._details) == null ? void 0 : t.errorMessage;
2326
+ }
2327
+ get isAuthoritative() {
2328
+ return !this.isError && this._details.reason != we.STALE && this._details.reason != we.DISABLED;
2329
+ }
2330
+ get type() {
2331
+ return typeof this._details.value;
2332
+ }
2333
+ };
2334
+ function Dr(t, r, n) {
2335
+ return typeof r == "boolean" ? new Ce(Ir(t, r, n)) : typeof r == "number" ? new Ce(Lr(t, r, n)) : typeof r == "string" ? new Ce(Hr(t, r, n)) : new Ce(jr(t, r, n));
2336
+ }
2337
+ function Ir(t, r, n) {
2338
+ return be(
2339
+ t,
2340
+ r,
2341
+ (i) => i.getBooleanDetails,
2342
+ n
2343
+ );
2344
+ }
2345
+ function Hr(t, r, n) {
2346
+ return be(
2347
+ t,
2348
+ r,
2349
+ (i) => i.getStringDetails,
2350
+ n
2351
+ );
2352
+ }
2353
+ function Lr(t, r, n) {
2354
+ return be(
2355
+ t,
2356
+ r,
2357
+ (i) => i.getNumberDetails,
2358
+ n
2359
+ );
2360
+ }
2361
+ function jr(t, r, n) {
2362
+ return be(
2363
+ t,
2364
+ r,
2365
+ (i) => i.getObjectDetails,
2366
+ n
2367
+ );
2368
+ }
2369
+ function xr(t, r) {
2370
+ return !r || r.includes(t);
2371
+ }
2372
+ function be(t, r, n, i) {
2373
+ const a = oe(oe(oe({}, Nr), Sr()), Lt(i)), c = jt(), h = kr();
2374
+ a.suspendUntilReady && h === ee.NOT_READY && ht(c), a.suspendWhileReconciling && h === ee.RECONCILING && ht(c);
2375
+ const [p, E] = K.useState(
2376
+ n(c).call(c, t, r, i)
2377
+ ), y = K.useRef(p);
2378
+ K.useEffect(() => {
2379
+ y.current = p;
2380
+ }, [p]);
2381
+ const f = () => {
2382
+ const _ = n(c).call(c, t, r, i);
2383
+ Ht(_.value, y.current.value) || E(_);
2384
+ }, v = (_) => {
2385
+ xr(t, _?.flagsChanged) && f();
2386
+ };
2387
+ return K.useEffect(() => (h === ee.NOT_READY && c.addHandler(I.Ready, f), a.updateOnContextChanged && c.addHandler(I.ContextChanged, f), () => {
2388
+ c.removeHandler(I.Ready, f), c.removeHandler(I.ContextChanged, f);
2389
+ }), []), K.useEffect(() => (a.updateOnConfigurationChanged && c.addHandler(I.ConfigurationChanged, v), () => {
2390
+ c.removeHandler(I.ConfigurationChanged, v);
2391
+ }), []), p;
2392
+ }
2393
+ function Mr(t) {
2394
+ var r = t, { client: n, domain: i, children: a } = r, c = Tr(r, ["client", "domain", "children"]);
2395
+ return n || (n = Ae.getClient(i)), /* @__PURE__ */ K.createElement(Me.Provider, { value: { client: n, options: c, domain: i } }, a);
2396
+ }
2397
+ function $r(t, r) {
2398
+ return Ae.setProvider(r), {
2399
+ useFeatureFlag: (n, i) => Dr(n.toString(), i ?? t[n].defaultValue),
2400
+ FeatureFlagsProvider: Mr,
2401
+ setFeatureFlagsContext: Ae.setContext.bind(Ae)
2402
+ };
2403
+ }
2404
+ export {
2405
+ $r as mkFeatureFlags
2406
+ };