@ichaingo/translation 1.5.4 → 1.5.6-beta

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 (2) hide show
  1. package/dist/index.js +3330 -4
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -1,7 +1,3333 @@
1
- import { useTranslations as r } from "next-intl";
2
- function e({ value: t, parentKey: n = "", params: o = {} }) {
3
- return r(n)(`${t}`, o);
1
+ import "react/jsx-runtime";
2
+ import J, { useCallback as gt, useRef as In, useEffect as ht, useContext as Mn, useState as kn } from "react";
3
+ var Et;
4
+ function xn(t, e) {
5
+ for (var a = 0; a < e.length; a++) {
6
+ const n = e[a];
7
+ if (typeof n != "string" && !Array.isArray(n)) {
8
+ for (const r in n)
9
+ if (r !== "default" && !(r in t)) {
10
+ const o = Object.getOwnPropertyDescriptor(n, r);
11
+ o && Object.defineProperty(t, r, o.get ? o : {
12
+ enumerable: !0,
13
+ get: () => n[r]
14
+ });
15
+ }
16
+ }
17
+ }
18
+ return Object.freeze(Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }));
19
+ }
20
+ function Se(t) {
21
+ return !!(t && typeof t.then == "function");
22
+ }
23
+ function ut(t, e) {
24
+ return Se(t) ? Promise.resolve(t).then(e) : e(t);
25
+ }
26
+ function Ie(t, e, a) {
27
+ function n(r) {
28
+ const o = e(r);
29
+ throw t.emit(o), console.error(o), o;
30
+ }
31
+ try {
32
+ const r = a();
33
+ return Se(r) ? r.catch(n) : r;
34
+ } catch (r) {
35
+ n(r);
36
+ }
37
+ }
38
+ function ie(t) {
39
+ const e = (Array.isArray(t) ? t : [t]).map((o) => `'${o}'`), a = e.slice(-2).join(" or ");
40
+ return `Tolgee: You need to specify ${[...e.slice(0, -2), a].join(", ")} option`;
41
+ }
42
+ function Un(t) {
43
+ return typeof t == "object" && !Array.isArray(t) && t !== null;
44
+ }
45
+ function fn(t) {
46
+ if (typeof t == "string")
47
+ return [t];
48
+ if (Array.isArray(t))
49
+ return t;
50
+ }
51
+ function H(t) {
52
+ return fn(t) || [];
53
+ }
54
+ function qn(t, e) {
55
+ return Un(e) ? H(e == null ? void 0 : e[t]) : H(e);
56
+ }
57
+ function te(t) {
58
+ return Array.from(new Set(t));
59
+ }
60
+ function gn(t) {
61
+ return t && t.replace(/\/+$/, "");
62
+ }
63
+ function Fn(t) {
64
+ if (typeof t == "string")
65
+ return t;
66
+ if (typeof (t == null ? void 0 : t.message) == "string")
67
+ return t.message;
68
+ }
69
+ const Hn = (t, e) => fetch(t, e);
70
+ function Bn(t) {
71
+ return Object.fromEntries(new Headers(t).entries());
72
+ }
73
+ const pn = (t = Hn) => (e, a) => {
74
+ let n = Bn(a == null ? void 0 : a.headers);
75
+ return n["x-api-key"] && (n = Object.assign({ "x-tolgee-sdk-type": "JS", "x-tolgee-sdk-version": "prerelease" }, n)), t(e, Object.assign(Object.assign({}, a), { headers: n }));
76
+ }, W = (t, e) => {
77
+ let a = [];
78
+ return {
79
+ listen(n) {
80
+ const r = (o) => {
81
+ n(o);
82
+ };
83
+ return a.push(r), {
84
+ unsubscribe() {
85
+ a = a.filter((o) => r !== o);
86
+ }
87
+ };
88
+ },
89
+ emit(n) {
90
+ e() && a.forEach((r) => r({ type: t, value: n }));
91
+ }
92
+ };
93
+ };
94
+ function Xn(t) {
95
+ let e = [], a = [];
96
+ function n() {
97
+ if (a.length === 0)
98
+ return;
99
+ const r = a;
100
+ a = [], e.forEach((o) => {
101
+ o(r);
102
+ });
103
+ }
104
+ return Object.freeze({
105
+ listen(r) {
106
+ const o = (i) => {
107
+ r(i);
108
+ };
109
+ return e.push(o), {
110
+ unsubscribe() {
111
+ e = e.filter((i) => o !== i);
112
+ }
113
+ };
114
+ },
115
+ emit(r, o) {
116
+ t() && t() && (a.push(r), o ? setTimeout(n, 0) : n());
117
+ }
118
+ });
119
+ }
120
+ function Gn() {
121
+ let t = !0;
122
+ function e() {
123
+ return t;
124
+ }
125
+ const a = Object.freeze({
126
+ onPendingLanguageChange: W("pendingLanguage", e),
127
+ onLanguageChange: W("language", e),
128
+ onLoadingChange: W("loading", e),
129
+ onFetchingChange: W("fetching", e),
130
+ onInitialLoaded: W("initialLoad", e),
131
+ onRunningChange: W("running", e),
132
+ onCacheChange: W("cache", e),
133
+ onPermanentChange: W("permanentChange", e),
134
+ onError: W("error", e),
135
+ onUpdate: Xn(e),
136
+ setEmitterActive(n) {
137
+ t = n;
138
+ },
139
+ on: (n, r) => {
140
+ switch (n) {
141
+ case "pendingLanguage":
142
+ return a.onPendingLanguageChange.listen(r);
143
+ case "language":
144
+ return a.onLanguageChange.listen(r);
145
+ case "loading":
146
+ return a.onLoadingChange.listen(r);
147
+ case "fetching":
148
+ return a.onFetchingChange.listen(r);
149
+ case "initialLoad":
150
+ return a.onInitialLoaded.listen(r);
151
+ case "running":
152
+ return a.onRunningChange.listen(r);
153
+ case "cache":
154
+ return a.onCacheChange.listen(r);
155
+ case "update":
156
+ return a.onUpdate.listen(r);
157
+ case "permanentChange":
158
+ return a.onPermanentChange.listen(r);
159
+ case "error":
160
+ return a.onError.listen(r);
161
+ }
162
+ }
163
+ });
164
+ return a.onInitialLoaded.listen((n) => a.onUpdate.emit(n, !1)), a.onLanguageChange.listen((n) => a.onUpdate.emit(n, !1)), a.onCacheChange.listen((n) => a.onUpdate.emit(n, !0)), a;
165
+ }
166
+ class yt extends Error {
167
+ constructor(e, a, n = !1) {
168
+ const { language: r, namespace: o } = e;
169
+ super(`Tolgee: Failed to fetch record for "${r}"${o && ` and "${o}"`}`), this.cause = a, this.isDev = n, this.name = "RecordFetchError", this.language = r, this.namespace = o;
170
+ }
171
+ }
172
+ class Wn extends Error {
173
+ constructor(e, a) {
174
+ super(e), this.cause = a, this.name = "LanguageDetectorError";
175
+ }
176
+ }
177
+ class mt extends Error {
178
+ constructor(e, a) {
179
+ super(e), this.cause = a, this.name = "LanguageStorageError";
180
+ }
181
+ }
182
+ const _n = (t) => {
183
+ const e = /* @__PURE__ */ new Map();
184
+ return Object.entries(t).forEach(([a, n]) => {
185
+ if (n != null) {
186
+ if (typeof n == "object") {
187
+ _n(n).forEach((r, o) => {
188
+ e.set(a + "." + o, r);
189
+ });
190
+ return;
191
+ }
192
+ e.set(a, n);
193
+ }
194
+ }), e;
195
+ }, ee = (t) => Object.fromEntries(_n(t).entries()), Q = (t) => {
196
+ const [e, ...a] = t.split(":"), n = a.join(":");
197
+ return { language: e, namespace: n || "" };
198
+ }, X = ({ language: t, namespace: e }) => e ? `${t}:${e}` : t;
199
+ function zn(t, e, a, n, r, o, i) {
200
+ const u = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map();
201
+ let s = {}, v = 0;
202
+ function b(g, y, d) {
203
+ const p = X(g);
204
+ c.set(p, {
205
+ data: ee(y),
206
+ version: d
207
+ }), t.onCacheChange.emit(Q(p));
208
+ }
209
+ async function S(g) {
210
+ function y(E) {
211
+ const h = new yt(g, E);
212
+ throw t.onError.emit(h), console.error(h), h;
213
+ }
214
+ const d = e(g);
215
+ if (Se(d)) {
216
+ const E = await d.catch(y);
217
+ if (E !== void 0)
218
+ return E;
219
+ }
220
+ const p = s[X(g)];
221
+ if (typeof p == "function")
222
+ try {
223
+ return await p();
224
+ } catch (E) {
225
+ y(E);
226
+ }
227
+ else
228
+ return p;
229
+ }
230
+ async function w(g, y) {
231
+ let d;
232
+ if (y)
233
+ try {
234
+ d = await a(g);
235
+ } catch (p) {
236
+ const E = new yt(g, p, !0);
237
+ t.onError.emit(E), console.warn(E);
238
+ }
239
+ return d || (d = await S(g)), d;
240
+ }
241
+ const D = Object.freeze({
242
+ addStaticData(g) {
243
+ if (Array.isArray(g))
244
+ for (const y of g) {
245
+ const d = X(y), p = c.get(d);
246
+ (!p || p.version === 0) && b(y, ee(y.data), 0);
247
+ }
248
+ else g && (s = Object.assign(Object.assign({}, s), g), Object.entries(g).forEach(([y, d]) => {
249
+ if (typeof d != "function") {
250
+ const p = Q(y), E = c.get(y);
251
+ (!E || E.version === 0) && b(p, ee(d), 0);
252
+ }
253
+ }));
254
+ },
255
+ invalidate() {
256
+ u.clear(), v += 1;
257
+ },
258
+ addRecord(g, y) {
259
+ b(g, ee(y), v);
260
+ },
261
+ exists(g, y = !1) {
262
+ const d = c.get(X(g));
263
+ return d && y ? d.version === v : !!d;
264
+ },
265
+ getRecord(g) {
266
+ const y = n(g), d = X(y), p = c.get(d);
267
+ if (p)
268
+ return Object.assign(Object.assign({}, y), { cacheKey: d, data: p.data });
269
+ },
270
+ getAllRecords() {
271
+ return Array.from(c.entries()).map(([y]) => D.getRecord(Q(y)));
272
+ },
273
+ getTranslation(g, y) {
274
+ var d;
275
+ return (d = c.get(X(g))) === null || d === void 0 ? void 0 : d.data[y];
276
+ },
277
+ getTranslationNs(g, y, d) {
278
+ var p;
279
+ for (const E of g)
280
+ for (const h of y) {
281
+ const A = (p = c.get(X({ language: h, namespace: E }))) === null || p === void 0 ? void 0 : p.data[d];
282
+ if (A != null)
283
+ return [E];
284
+ }
285
+ return te(g);
286
+ },
287
+ getTranslationFallback(g, y, d) {
288
+ var p;
289
+ for (const E of g)
290
+ for (const h of y) {
291
+ const A = (p = c.get(X({ language: h, namespace: E }))) === null || p === void 0 ? void 0 : p.data[d];
292
+ if (A != null)
293
+ return A;
294
+ }
295
+ },
296
+ changeTranslation(g, y, d) {
297
+ var p;
298
+ const E = (p = c.get(X(g))) === null || p === void 0 ? void 0 : p.data;
299
+ E && (E[y] = d, t.onCacheChange.emit(Object.assign(Object.assign({}, g), { key: y })));
300
+ },
301
+ isFetching(g) {
302
+ if (r())
303
+ return !0;
304
+ if (g === void 0)
305
+ return u.size > 0;
306
+ const y = H(g);
307
+ return !!Array.from(u.keys()).find((d) => y.includes(Q(d).namespace));
308
+ },
309
+ isLoading(g, y) {
310
+ const d = H(y);
311
+ return r() ? !0 : !!Array.from(u.keys()).find((E) => {
312
+ const h = Q(E);
313
+ return (!d.length || d.includes(h.namespace)) && !D.exists({
314
+ namespace: h.namespace,
315
+ language: g
316
+ });
317
+ });
318
+ },
319
+ async loadRecords(g, y) {
320
+ const d = g.map((h) => {
321
+ const A = n(h), O = X(A);
322
+ if (y != null && y.useCache && D.exists(A, !0))
323
+ return Object.assign(Object.assign({}, A), { new: !1, cacheKey: O, data: D.getRecord(A).data });
324
+ const f = u.get(O);
325
+ if (f)
326
+ return Object.assign(Object.assign({}, A), { new: !1, promise: f, cacheKey: O });
327
+ const T = w(A, !(y != null && y.noDev)) || Promise.resolve(void 0);
328
+ return u.set(O, T), Object.assign(Object.assign({}, A), { new: !0, promise: T, cacheKey: O });
329
+ });
330
+ o.notify(), i.notify();
331
+ const p = d.map((h) => h.promise).filter(Boolean), E = await Promise.all(p);
332
+ return d.forEach((h) => {
333
+ var A;
334
+ h.promise && (h.data = ee((A = E[0]) !== null && A !== void 0 ? A : {}), E.shift());
335
+ const O = u.get(h.cacheKey) !== h.promise;
336
+ h.new && !O && (u.delete(h.cacheKey), h.data ? D.addRecord(h, h.data) : D.getRecord(h) || D.addRecord(h, {}));
337
+ }), o.notify(), i.notify(), d.map((h) => {
338
+ var A;
339
+ return {
340
+ language: h.language,
341
+ namespace: h.namespace,
342
+ data: (A = h.data) !== null && A !== void 0 ? A : {},
343
+ cacheKey: h.cacheKey
344
+ };
345
+ });
346
+ }
347
+ });
348
+ return D;
349
+ }
350
+ function hn(t, e) {
351
+ var a = {};
352
+ for (var n in t)
353
+ Object.prototype.hasOwnProperty.call(t, n) && e.indexOf(n) < 0 && (a[n] = t[n]);
354
+ if (t != null && typeof Object.getOwnPropertySymbols == "function")
355
+ for (var r = 0, n = Object.getOwnPropertySymbols(t); r < n.length; r++)
356
+ e.indexOf(n[r]) < 0 && Object.prototype.propertyIsEnumerable.call(t, n[r]) && (a[n[r]] = t[n[r]]);
357
+ return a;
358
+ }
359
+ const Yn = {
360
+ tagAttributes: {
361
+ textarea: ["placeholder"],
362
+ input: ["value", "placeholder"],
363
+ img: ["alt"],
364
+ "*": ["aria-label", "title"]
365
+ },
366
+ restrictedElements: ["script", "style"],
367
+ highlightKeys: ["Alt"],
368
+ highlightColor: "rgb(255, 0, 0)",
369
+ highlightWidth: 5,
370
+ inputPrefix: "%-%tolgee:",
371
+ inputSuffix: "%-%",
372
+ passToParent: ["option", "optgroup"],
373
+ fullKeyEncode: !1
374
+ }, st = "invalid", Kn = "https://app.tolgee.io", Vn = ({ key: t }) => t, Qn = {
375
+ observerOptions: Yn,
376
+ observerType: "invisible",
377
+ onFormatError: st,
378
+ apiUrl: Kn,
379
+ autoLoadRequiredData: !0,
380
+ fetch: pn(),
381
+ onTranslationMissing: Vn
382
+ }, ct = (...t) => {
383
+ let e = {};
384
+ return t.forEach((a) => {
385
+ e = Object.assign(Object.assign(Object.assign({}, e), a), { observerOptions: Object.assign(Object.assign({}, e.observerOptions), a == null ? void 0 : a.observerOptions) });
386
+ }), e;
387
+ };
388
+ function vt(t, e) {
389
+ const a = ct(Qn, e == null ? void 0 : e.initialOptions, t);
390
+ return a.apiUrl = gn(a.apiUrl), t != null && t.fetch && (a.fetch = pn(t.fetch)), {
391
+ initialOptions: a,
392
+ activeNamespaces: (e == null ? void 0 : e.activeNamespaces) || /* @__PURE__ */ new Map(),
393
+ language: e == null ? void 0 : e.language,
394
+ pendingLanguage: e == null ? void 0 : e.language,
395
+ isInitialLoading: !1,
396
+ isRunning: !1
397
+ };
398
+ }
399
+ function Jn(t, e, a, n, r, o, i, u) {
400
+ const c = {
401
+ ui: void 0
402
+ }, s = {
403
+ formatters: [],
404
+ finalFormatter: void 0,
405
+ observer: void 0,
406
+ devBackend: void 0,
407
+ backends: [],
408
+ ui: void 0,
409
+ languageDetector: void 0,
410
+ languageStorage: void 0
411
+ }, v = async ({ keysAndDefaults: _, target: P }) => {
412
+ var C;
413
+ const M = _.map(({ key: U, ns: k, defaultValue: B }) => ({
414
+ key: U,
415
+ defaultValue: B,
416
+ fallbackNamespaces: n(k),
417
+ namespace: r({ key: U, ns: k })[0],
418
+ translation: o({
419
+ key: U,
420
+ ns: k
421
+ })
422
+ }));
423
+ (C = s.ui) === null || C === void 0 || C.handleElementClick(M, P);
424
+ }, b = (_, P) => {
425
+ var C;
426
+ return ((C = s.observer) === null || C === void 0 ? void 0 : C.findPositions(_, P)) || [];
427
+ };
428
+ function S(_) {
429
+ const P = o({
430
+ key: _.key,
431
+ ns: _.ns
432
+ });
433
+ return j.formatTranslation(Object.assign(Object.assign({}, _), { translation: P, formatEnabled: !0 }));
434
+ }
435
+ function w() {
436
+ return { fetch: e().fetch };
437
+ }
438
+ function D(_) {
439
+ s.observer = _ == null ? void 0 : _();
440
+ }
441
+ function g() {
442
+ return !!s.observer;
443
+ }
444
+ function y(_) {
445
+ _ && s.formatters.push(_);
446
+ }
447
+ function d(_) {
448
+ s.finalFormatter = _;
449
+ }
450
+ function p(_) {
451
+ c.ui = _;
452
+ }
453
+ function E() {
454
+ return !!c.ui;
455
+ }
456
+ function h(_) {
457
+ s.languageStorage = _;
458
+ }
459
+ function A(_) {
460
+ s.languageDetector = _;
461
+ }
462
+ function O() {
463
+ return Ie(u.onError, (_) => new mt("Tolgee: Failed to load language", _), () => {
464
+ var _;
465
+ return (_ = s.languageStorage) === null || _ === void 0 ? void 0 : _.getLanguage(w());
466
+ });
467
+ }
468
+ function f() {
469
+ if (!s.languageDetector)
470
+ return;
471
+ const _ = a();
472
+ return Ie(u.onError, (P) => new Wn("Tolgee: Failed to detect language", P), () => {
473
+ var P;
474
+ return (P = s.languageDetector) === null || P === void 0 ? void 0 : P.getLanguage(Object.assign({ availableLanguages: _ }, w()));
475
+ });
476
+ }
477
+ function T(_) {
478
+ _ && s.backends.push(_);
479
+ }
480
+ function L(_) {
481
+ s.devBackend = _;
482
+ }
483
+ function I(_, P) {
484
+ const C = Object.freeze({
485
+ setFinalFormatter: d,
486
+ addFormatter: y,
487
+ setObserver: D,
488
+ hasObserver: g,
489
+ setUi: p,
490
+ hasUi: E,
491
+ setDevBackend: L,
492
+ addBackend: T,
493
+ setLanguageDetector: A,
494
+ setLanguageStorage: h
495
+ });
496
+ P(_, C);
497
+ }
498
+ const j = Object.freeze({
499
+ addPlugin: I,
500
+ findPositions: b,
501
+ run() {
502
+ var _, P;
503
+ const { apiKey: C, apiUrl: M, projectId: U, observerOptions: k, tagNewKeys: B, filterTag: Z } = e();
504
+ s.ui = (_ = c.ui) === null || _ === void 0 ? void 0 : _.call(c, {
505
+ apiKey: C,
506
+ apiUrl: M,
507
+ projectId: U,
508
+ highlight: j.highlight,
509
+ changeTranslation: i,
510
+ findPositions: b,
511
+ onPermanentChange: (Y) => u.onPermanentChange.emit(Y),
512
+ tagNewKeys: B,
513
+ filterTag: Z
514
+ }), (P = s.observer) === null || P === void 0 || P.run({
515
+ mouseHighlight: !!s.ui,
516
+ options: k,
517
+ translate: S,
518
+ onClick: v
519
+ });
520
+ },
521
+ stop() {
522
+ var _;
523
+ s.ui = void 0, (_ = s.observer) === null || _ === void 0 || _.stop();
524
+ },
525
+ getLanguageStorage() {
526
+ return s.languageStorage;
527
+ },
528
+ getInitialLanguage() {
529
+ const _ = a(), P = O();
530
+ return ut(P, (C) => (!_ || _.includes(C)) && C ? C : f());
531
+ },
532
+ setStoredLanguage(_) {
533
+ return Ie(u.onError, (P) => new mt("Tolgee: Failed to store language", P), () => {
534
+ var P;
535
+ return (P = s.languageStorage) === null || P === void 0 ? void 0 : P.setLanguage(_, w());
536
+ });
537
+ },
538
+ getDevBackend() {
539
+ return s.devBackend;
540
+ },
541
+ getBackendRecord: async ({ language: _, namespace: P }) => {
542
+ for (const C of s.backends) {
543
+ const M = await C.getRecord(Object.assign({
544
+ language: _,
545
+ namespace: P
546
+ }, w()));
547
+ if (M !== void 0)
548
+ return M;
549
+ }
550
+ },
551
+ getBackendDevRecord: async ({ language: _, namespace: P }) => {
552
+ var C;
553
+ const { apiKey: M, apiUrl: U, projectId: k, filterTag: B } = e();
554
+ if (!(!M || !U || !j.hasDevBackend()))
555
+ return (C = s.devBackend) === null || C === void 0 ? void 0 : C.getRecord(Object.assign({
556
+ apiKey: M,
557
+ apiUrl: U,
558
+ projectId: k,
559
+ language: _,
560
+ namespace: P,
561
+ filterTag: B
562
+ }, w()));
563
+ },
564
+ getLanguageDetector() {
565
+ return s.languageDetector;
566
+ },
567
+ retranslate() {
568
+ var _;
569
+ (_ = s.observer) === null || _ === void 0 || _.retranslate();
570
+ },
571
+ highlight: (_, P) => {
572
+ var C, M;
573
+ return ((M = (C = s.observer) === null || C === void 0 ? void 0 : C.highlight) === null || M === void 0 ? void 0 : M.call(C, _, P)) || { unhighlight() {
574
+ } };
575
+ },
576
+ unwrap(_) {
577
+ var P;
578
+ return s.observer ? (P = s.observer) === null || P === void 0 ? void 0 : P.unwrap(_) : { text: _, keys: [] };
579
+ },
580
+ wrap(_) {
581
+ var P;
582
+ return s.observer ? (P = s.observer) === null || P === void 0 ? void 0 : P.wrap(_) : _.translation;
583
+ },
584
+ hasDevBackend() {
585
+ return !!j.getDevBackend();
586
+ },
587
+ formatTranslation(_) {
588
+ var P, { formatEnabled: C } = _, M = hn(_, ["formatEnabled"]);
589
+ const { key: U, translation: k, defaultValue: B, noWrap: Z, params: Y, ns: Ce, orEmpty: je } = M, K = k ?? B;
590
+ let ne = "";
591
+ k == null && (ne = e().onTranslationMissing(M));
592
+ let x = K ?? (je ? "" : ne);
593
+ const V = t(), re = C || !(!((P = s.observer) === null || P === void 0) && P.outputNotFormattable), ae = (G) => s.observer && !Z ? s.observer.wrap({
594
+ key: U,
595
+ translation: G,
596
+ defaultValue: B,
597
+ params: Y,
598
+ ns: Ce
599
+ }) : G;
600
+ x = ae(x);
601
+ try {
602
+ if (K && V && re)
603
+ for (const G of s.formatters)
604
+ x = G.format({
605
+ translation: x,
606
+ language: V,
607
+ params: Y
608
+ });
609
+ s.finalFormatter && K && V && re && (x = s.finalFormatter.format({
610
+ translation: x,
611
+ language: V,
612
+ params: Y
613
+ }));
614
+ } catch (G) {
615
+ console.error(G);
616
+ const Ne = Fn(G) || st, $ = e().onFormatError, oe = typeof $;
617
+ oe === "string" ? x = $ : oe === "function" ? x = $(Ne, M) : x = st, x = ae(x);
618
+ }
619
+ return x;
620
+ }
621
+ });
622
+ return j;
623
+ }
624
+ const bt = (t, e, a) => {
625
+ let n = t;
626
+ return Object.freeze({
627
+ init(r) {
628
+ n = r;
629
+ },
630
+ notify() {
631
+ const r = e();
632
+ n !== r && a(r), n = r;
633
+ }
634
+ });
635
+ };
636
+ function Zn(t, e, a) {
637
+ let n = vt(), r;
638
+ const o = Object.freeze({
639
+ init(i) {
640
+ n = vt(i, n);
641
+ },
642
+ isRunning() {
643
+ return n.isRunning;
644
+ },
645
+ setRunning(i) {
646
+ n.isRunning !== i && (n.isRunning = i, a.emit(i));
647
+ },
648
+ isInitialLoading() {
649
+ return n.isInitialLoading;
650
+ },
651
+ setInitialLoading(i) {
652
+ n.isInitialLoading = i;
653
+ },
654
+ getLanguage() {
655
+ return n.language || n.initialOptions.language;
656
+ },
657
+ setLanguage(i) {
658
+ n.language !== i && (n.language = i, t.emit(i));
659
+ },
660
+ getPendingLanguage() {
661
+ return n.pendingLanguage || o.getLanguage();
662
+ },
663
+ setPendingLanguage(i) {
664
+ n.pendingLanguage !== i && (n.pendingLanguage = i, e.emit(i));
665
+ },
666
+ getInitialOptions() {
667
+ return Object.assign(Object.assign({}, n.initialOptions), r);
668
+ },
669
+ addActiveNs(i) {
670
+ H(i).forEach((c) => {
671
+ const s = n.activeNamespaces.get(c);
672
+ s !== void 0 ? n.activeNamespaces.set(c, s + 1) : n.activeNamespaces.set(c, 1);
673
+ });
674
+ },
675
+ removeActiveNs(i) {
676
+ H(i).forEach((c) => {
677
+ const s = n.activeNamespaces.get(c);
678
+ s !== void 0 && s > 1 ? n.activeNamespaces.set(c, s - 1) : n.activeNamespaces.delete(c);
679
+ });
680
+ },
681
+ getRequiredNamespaces() {
682
+ return te([
683
+ o.getDefaultNs(),
684
+ ...n.initialOptions.ns || [],
685
+ ...H(n.initialOptions.fallbackNs),
686
+ ...n.activeNamespaces.keys()
687
+ ]);
688
+ },
689
+ getFallbackLangs(i) {
690
+ const u = i || o.getLanguage();
691
+ return u ? te([
692
+ u,
693
+ ...qn(u, n.initialOptions.fallbackLanguage)
694
+ ]) : [];
695
+ },
696
+ getFallbackNs() {
697
+ return H(n.initialOptions.fallbackNs);
698
+ },
699
+ getNs() {
700
+ var i, u;
701
+ return !((i = n.initialOptions.ns) === null || i === void 0) && i.length ? n.initialOptions.ns : [(u = n.initialOptions.defaultNs) !== null && u !== void 0 ? u : ""];
702
+ },
703
+ getDefaultNs(i) {
704
+ var u, c, s;
705
+ return i === void 0 ? (s = (u = n.initialOptions.defaultNs) !== null && u !== void 0 ? u : (c = n.initialOptions.ns) === null || c === void 0 ? void 0 : c[0]) !== null && s !== void 0 ? s : "" : i;
706
+ },
707
+ getAvailableLanguages() {
708
+ if (n.initialOptions.availableLanguages)
709
+ return n.initialOptions.availableLanguages;
710
+ if (n.initialOptions.staticData) {
711
+ const i = Object.keys(n.initialOptions.staticData).map((u) => Q(u).language);
712
+ return Array.from(new Set(i));
713
+ }
714
+ },
715
+ getAvailableNs() {
716
+ return n.initialOptions.availableNs;
717
+ },
718
+ withDefaultNs(i) {
719
+ return {
720
+ namespace: i.namespace === void 0 ? o.getDefaultNs() : i.namespace,
721
+ language: i.language
722
+ };
723
+ },
724
+ overrideCredentials(i) {
725
+ i ? r = Object.assign(Object.assign({}, i), { apiUrl: gn(i.apiUrl) }) : r = void 0;
726
+ }
727
+ });
728
+ return o;
729
+ }
730
+ function $n(t) {
731
+ var { ns: e, noWrap: a, orEmpty: n, params: r, language: o } = t, i = hn(t, ["ns", "noWrap", "orEmpty", "params", "language"]);
732
+ return Object.assign(Object.assign({}, {
733
+ ns: e,
734
+ noWrap: a,
735
+ orEmpty: n,
736
+ language: o
737
+ }), { params: Object.assign({}, i) });
738
+ }
739
+ const En = (t, ...e) => {
740
+ let a = {}, n;
741
+ return typeof t == "object" ? a = t : (a.key = t, typeof e[0] == "string" ? (a.defaultValue = e[0], n = e[1]) : typeof e[0] == "object" && (n = e[0])), n && (a = Object.assign(Object.assign({}, $n(n)), a)), a;
742
+ };
743
+ function er({ options: t }) {
744
+ const e = Gn(), a = bt(!1, () => i.isFetching(), e.onFetchingChange.emit), n = bt(!1, () => O.isLoading(), e.onLoadingChange.emit), r = Zn(e.onLanguageChange, e.onPendingLanguageChange, e.onRunningChange), o = Jn(r.getLanguage, r.getInitialOptions, r.getAvailableLanguages, v, d, p, S, e), i = zn(e, o.getBackendRecord, o.getBackendDevRecord, r.withDefaultNs, r.isInitialLoading, a, n);
745
+ t && w(t);
746
+ let u;
747
+ e.onUpdate.listen(() => {
748
+ r.isRunning() && o.retranslate();
749
+ });
750
+ function c() {
751
+ return r.getFallbackNs();
752
+ }
753
+ function s(f) {
754
+ return r.getDefaultNs(f);
755
+ }
756
+ function v(f) {
757
+ return te([...H(s(f)), ...c()]);
758
+ }
759
+ function b(f) {
760
+ return te([
761
+ ...H(f ?? s()),
762
+ ...r.getRequiredNamespaces()
763
+ ]);
764
+ }
765
+ function S(f, T, L) {
766
+ const I = r.withDefaultNs(f), j = i.getTranslation(I, T);
767
+ return i.changeTranslation(I, T, L), {
768
+ revert() {
769
+ i.changeTranslation(I, T, j);
770
+ }
771
+ };
772
+ }
773
+ function w(f) {
774
+ r.init(f), i.addStaticData(r.getInitialOptions().staticData);
775
+ }
776
+ function D(f, T) {
777
+ const L = r.getFallbackLangs(f), I = b(T), j = [];
778
+ return L.forEach((_) => {
779
+ I.forEach((P) => {
780
+ j.push({ language: _, namespace: P });
781
+ });
782
+ }), j;
783
+ }
784
+ function g(f, T) {
785
+ return D(f, T).filter((L) => !i.exists(L, !0));
786
+ }
787
+ function y(f) {
788
+ let T = [], L = [];
789
+ if (Array.isArray(f.languages))
790
+ T = f.languages;
791
+ else if (f.languages === "all") {
792
+ const j = O.getAvailableLanguages();
793
+ if (!j)
794
+ throw new Error(ie("availableLanguages"));
795
+ T = j;
796
+ }
797
+ if (Array.isArray(f.namespaces))
798
+ L = f.namespaces;
799
+ else if (f.namespaces === "all") {
800
+ const j = O.getAvailableNs();
801
+ if (!j)
802
+ throw new Error(ie("availableNs"));
803
+ L = j;
804
+ }
805
+ const I = [];
806
+ return T.forEach((j) => {
807
+ L.forEach((_) => {
808
+ I.push({ language: j, namespace: _ });
809
+ });
810
+ }), I;
811
+ }
812
+ function d({ key: f, ns: T }) {
813
+ const L = r.getFallbackLangs(), I = v(T ?? void 0);
814
+ return i.getTranslationNs(I, L, f);
815
+ }
816
+ function p({ key: f, ns: T, language: L }) {
817
+ const I = v(T ?? void 0), j = r.getFallbackLangs(L);
818
+ return i.getTranslationFallback(I, j, f);
819
+ }
820
+ function E() {
821
+ const f = ut(h(), () => {
822
+ const T = g();
823
+ if (T.length && r.getInitialOptions().autoLoadRequiredData)
824
+ return i.loadRecords(T, { useCache: !0 });
825
+ });
826
+ if (Se(f))
827
+ return r.setInitialLoading(!0), a.notify(), n.notify(), Promise.resolve(f).then(() => {
828
+ r.setInitialLoading(!1), a.notify(), n.notify(), e.onInitialLoaded.emit();
829
+ });
830
+ e.onInitialLoaded.emit();
831
+ }
832
+ function h() {
833
+ if (r.getLanguage())
834
+ return;
835
+ const T = o.getInitialLanguage();
836
+ return ut(T, (L) => {
837
+ const I = L || r.getInitialOptions().defaultLanguage;
838
+ I && r.setLanguage(I);
839
+ });
840
+ }
841
+ function A() {
842
+ if ((o.getLanguageDetector() || o.getLanguageStorage()) && !r.getAvailableLanguages())
843
+ throw new Error(ie("availableLanguages"));
844
+ if (!r.getLanguage() && !r.getInitialOptions().defaultLanguage)
845
+ throw new Error(ie(["defaultLanguage", "language"]));
846
+ }
847
+ const O = Object.freeze(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, e), r), o), i), {
848
+ init: w,
849
+ getTranslation: p,
850
+ changeTranslation: S,
851
+ getTranslationNs: d,
852
+ getDefaultAndFallbackNs: v,
853
+ findPositions: o.findPositions,
854
+ getRequiredDescriptors: D,
855
+ async changeLanguage(f) {
856
+ r.getPendingLanguage() === f && r.getLanguage() === f || (r.setPendingLanguage(f), r.isRunning() && r.getInitialOptions().autoLoadRequiredData && await i.loadRecords(D(f), {
857
+ useCache: !0
858
+ }), f === r.getPendingLanguage() && (r.setLanguage(f), await o.setStoredLanguage(f)));
859
+ },
860
+ async addActiveNs(f, T) {
861
+ T || r.addActiveNs(f), r.isRunning() && await i.loadRecords(D(void 0, f), {
862
+ useCache: !0
863
+ });
864
+ },
865
+ async loadRecord(f, T) {
866
+ var L;
867
+ return (L = (await O.loadRecords([f], T))[0]) === null || L === void 0 ? void 0 : L.data;
868
+ },
869
+ isLoading(f) {
870
+ return i.isLoading(r.getLanguage(), f);
871
+ },
872
+ isLoaded(f) {
873
+ const T = r.getLanguage();
874
+ if (!T)
875
+ return !1;
876
+ const L = r.getFallbackLangs(T), I = b(f), j = [];
877
+ return L.forEach((_) => {
878
+ I.forEach((P) => {
879
+ i.exists({ language: _, namespace: P }) || j.push({ language: _, namespace: P });
880
+ });
881
+ }), j.length === 0;
882
+ },
883
+ t: (...f) => {
884
+ const T = En(...f), L = p(T);
885
+ return o.formatTranslation(Object.assign(Object.assign({}, T), { translation: L }));
886
+ },
887
+ isDev() {
888
+ return !!(r.getInitialOptions().apiKey && r.getInitialOptions().apiUrl);
889
+ },
890
+ async loadRequired(f) {
891
+ f != null && f.language || await h();
892
+ const T = D(f == null ? void 0 : f.language);
893
+ return O.loadRecords(T, f);
894
+ },
895
+ async loadMatrix(f) {
896
+ const T = y(f);
897
+ return O.loadRecords(T, f);
898
+ },
899
+ run() {
900
+ return A(), r.isRunning() || (r.setRunning(!0), o.run(), u = E()), Promise.resolve(u);
901
+ },
902
+ stop() {
903
+ r.isRunning() && (o.stop(), r.setRunning(!1));
904
+ }
905
+ }));
906
+ return O;
907
+ }
908
+ function tr(t) {
909
+ const e = er({
910
+ options: t
911
+ });
912
+ e.isDev() && e.invalidate();
913
+ function a(r) {
914
+ const o = e.isRunning();
915
+ o && e.stop(), r(), e.isDev() && e.invalidate(), o && e.run();
916
+ }
917
+ const n = Object.freeze({
918
+ /**
919
+ * Listen to tolgee events.
920
+ */
921
+ on: e.on,
922
+ /**
923
+ * Turn off/on events emitting. Is on by default.
924
+ */
925
+ setEmitterActive: e.setEmitterActive,
926
+ /**
927
+ * @return current language if set.
928
+ */
929
+ getLanguage: e.getLanguage,
930
+ /**
931
+ * `pendingLanguage` represents language which is currently being loaded.
932
+ * @return current `pendingLanguage` if set.
933
+ */
934
+ getPendingLanguage: e.getPendingLanguage,
935
+ /**
936
+ * Change current language.
937
+ * - if not running sets `pendingLanguage`, `language` to the new value
938
+ * - if running sets `pendingLanguage` to the value, fetches necessary data and then changes `language`
939
+ *
940
+ * @return Promise which is resolved when `language` is changed.
941
+ */
942
+ changeLanguage: e.changeLanguage,
943
+ /**
944
+ * Temporarily change translation in cache.
945
+ * @return object with revert method.
946
+ */
947
+ changeTranslation: e.changeTranslation,
948
+ /**
949
+ * Adds namespace(s) list of active namespaces. And if tolgee is running, loads required data.
950
+ */
951
+ addActiveNs: e.addActiveNs,
952
+ /**
953
+ * Remove namespace(s) from active namespaces.
954
+ *
955
+ * Tolgee internally counts how many times was each active namespace added,
956
+ * so this method will remove namespace only if the counter goes down to 0.
957
+ */
958
+ removeActiveNs: e.removeActiveNs,
959
+ /**
960
+ * Load records which would be loaded by `run` function
961
+ *
962
+ * You can provide language if not previously set on tolgee instance
963
+ */
964
+ loadRequired: e.loadRequired,
965
+ /**
966
+ * Load records in matrix (languages x namespaces)
967
+ */
968
+ loadMatrix: e.loadMatrix,
969
+ /**
970
+ * Manually load multiple records from `Backend` (or `DevBackend` when in dev mode)
971
+ *
972
+ * It loads data together and adds them to cache in one operation, to prevent partly loaded state.
973
+ */
974
+ loadRecords: e.loadRecords,
975
+ /**
976
+ * Manually load record from `Backend` (or `DevBackend` when in dev mode)
977
+ */
978
+ loadRecord: e.loadRecord,
979
+ /**
980
+ * Prefill static data
981
+ */
982
+ addStaticData: e.addStaticData,
983
+ /**
984
+ * Get record from cache.
985
+ */
986
+ getRecord: e.getRecord,
987
+ /**
988
+ * Get all records from cache.
989
+ */
990
+ getAllRecords: e.getAllRecords,
991
+ /**
992
+ * @param ns optional list of namespaces that you are interested in
993
+ * @return `true` if there are data that need to be fetched.
994
+ */
995
+ isLoaded: e.isLoaded,
996
+ /**
997
+ * Returns descriptors of records needed for instance to be `loaded`
998
+ */
999
+ getRequiredDescriptors: e.getRequiredDescriptors,
1000
+ /**
1001
+ * @return `true` if tolgee is loading initial data (triggered by `run`).
1002
+ */
1003
+ isInitialLoading: e.isInitialLoading,
1004
+ /**
1005
+ * @param ns optional list of namespaces that you are interested in
1006
+ * @return `true` if tolgee is loading some translations for the first time.
1007
+ */
1008
+ isLoading: e.isLoading,
1009
+ /**
1010
+ * @param ns optional list of namespaces that you are interested in
1011
+ * @return `true` if tolgee is fetching some translations.
1012
+ */
1013
+ isFetching: e.isFetching,
1014
+ /**
1015
+ * @return `true` if tolgee is running.
1016
+ */
1017
+ isRunning: e.isRunning,
1018
+ /**
1019
+ * Changes internal state to running: true and loads initial files.
1020
+ * Runs runnable plugins mainly Observer if present.
1021
+ */
1022
+ run: e.run,
1023
+ /**
1024
+ * Changes internal state to running: false and stops runnable plugins.
1025
+ */
1026
+ stop: e.stop,
1027
+ /**
1028
+ * Returns translated and formatted key.
1029
+ * If Observer is present and tolgee is running, wraps result to be identifiable in the DOM.
1030
+ */
1031
+ t: e.t,
1032
+ /**
1033
+ * Highlight keys that match selection.
1034
+ */
1035
+ highlight: e.highlight,
1036
+ /**
1037
+ * Find positions of keys in the DOM.
1038
+ */
1039
+ findPositions: e.findPositions,
1040
+ /**
1041
+ * @return current Tolgee options.
1042
+ */
1043
+ getInitialOptions: e.getInitialOptions,
1044
+ /**
1045
+ * Tolgee is in dev mode if `DevTools` plugin is used and `apiKey` + `apiUrl` are specified.
1046
+ * @return `true` if tolgee is in dev mode.
1047
+ */
1048
+ isDev: e.isDev,
1049
+ /**
1050
+ * Wraps translation if there is `Observer` plugin
1051
+ */
1052
+ wrap: e.wrap,
1053
+ /**
1054
+ * Unwrap translation
1055
+ */
1056
+ unwrap: e.unwrap,
1057
+ /**
1058
+ * Override creadentials passed on initialization.
1059
+ *
1060
+ * When called in running state, tolgee stops and runs again.
1061
+ */
1062
+ overrideCredentials(r) {
1063
+ a(() => e.overrideCredentials(r));
1064
+ },
1065
+ /**
1066
+ * Add tolgee plugin after initialization.
1067
+ *
1068
+ * When called in running state, tolgee stops and runs again.
1069
+ */
1070
+ addPlugin(r) {
1071
+ r && a(() => e.addPlugin(n, r));
1072
+ },
1073
+ /**
1074
+ * Updates options after instance creation. Extends existing options,
1075
+ * so it only changes the fields, that are listed.
1076
+ *
1077
+ * When called in running state, tolgee stops and runs again.
1078
+ */
1079
+ updateOptions(r) {
1080
+ r && a(() => e.init(r));
1081
+ }
1082
+ });
1083
+ return n;
1084
+ }
1085
+ const nr = () => {
1086
+ const t = {
1087
+ plugins: [],
1088
+ options: {}
1089
+ }, e = Object.freeze({
1090
+ use(a) {
1091
+ return t.plugins.push(a), e;
1092
+ },
1093
+ updateDefaults(a) {
1094
+ return t.options = ct(t.options, a), e;
1095
+ },
1096
+ init(a) {
1097
+ const n = tr(ct(t.options, a));
1098
+ return t.plugins.forEach(n.addPlugin), n;
1099
+ }
1100
+ });
1101
+ return e;
1102
+ }, yn = 0, lt = 1, rr = 2;
1103
+ class ar extends Error {
1104
+ constructor(e, a, n) {
1105
+ let r, o = "";
1106
+ e === yn ? r = "Empty parameter" : e === lt ? (r = "Unexpected character", o = "Did you forget to use FormatIcu to render ICU message syntax?") : r = "Unexpected end", super(`Tolgee parser: ${r} at ${a} in "${n}"` + (o ? `
1107
+ ` + o : "")), this.code = e, this.index = a;
1108
+ }
1109
+ }
1110
+ function Rt(t) {
1111
+ return /\s/.test(t);
1112
+ }
1113
+ const z = 0, dt = 1, Pe = 2, Me = 3, ke = 4, or = /* @__PURE__ */ new Set([
1114
+ Pe,
1115
+ dt,
1116
+ z
1117
+ ]), ft = "'", ir = /* @__PURE__ */ new Set(["{", "}", ft]), ur = (t) => /[0-9a-zA-Z_]/.test(t);
1118
+ function sr(t) {
1119
+ let e = z, a = "", n = "", r = "";
1120
+ const o = [], i = [];
1121
+ let u = 0;
1122
+ function c(S) {
1123
+ throw new ar(S, u, t);
1124
+ }
1125
+ const s = () => {
1126
+ o.push(a), a = "";
1127
+ }, v = () => {
1128
+ ur(r) || c(lt), n += r;
1129
+ }, b = () => {
1130
+ n === "" && c(yn), i.push(n), n = "";
1131
+ };
1132
+ for (u = 0; u < t.length; u++)
1133
+ switch (r = t[u], e) {
1134
+ case z:
1135
+ r === ft ? (a += r, e = dt) : r === "{" ? (s(), e = Me) : (a += r, e = z);
1136
+ break;
1137
+ case dt:
1138
+ ir.has(r) ? (a = a.slice(0, -1) + r, e = Pe) : (a += r, e = z);
1139
+ break;
1140
+ case Pe:
1141
+ r === ft ? e = z : (a += r, e = Pe);
1142
+ break;
1143
+ case Me:
1144
+ r === "}" ? (b(), e = z) : Rt(r) ? n !== "" && (b(), e = ke) : (v(), e = Me);
1145
+ break;
1146
+ case ke:
1147
+ r == "}" ? e = z : Rt(r) ? e = ke : c(lt);
1148
+ }
1149
+ return or.has(e) || c(rr), s(), [o, i];
1150
+ }
1151
+ function cr(t, e) {
1152
+ const [a, n] = sr(t), r = [a[0]];
1153
+ for (let o = 1; o < a.length; o++) {
1154
+ const i = e == null ? void 0 : e[n[o - 1]];
1155
+ if (i === void 0)
1156
+ throw new Error(`Missing parameter "${n[o - 1]}" in "${t}"`);
1157
+ r.push(String(i)), r.push(a[o]);
1158
+ }
1159
+ return r.join("");
1160
+ }
1161
+ function lr() {
1162
+ return {
1163
+ format: ({ translation: t, params: e }) => cr(t, e)
1164
+ };
1165
+ }
1166
+ const dr = () => (t, e) => (e.setFinalFormatter(lr()), t);
1167
+ var xe = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, Ot = {};
1168
+ (function(t) {
1169
+ function e(d, p) {
1170
+ var E;
1171
+ return d instanceof Buffer ? E = d : E = Buffer.from(d.buffer, d.byteOffset, d.byteLength), E.toString(p);
1172
+ }
1173
+ var a = function(d) {
1174
+ return Buffer.from(d);
1175
+ };
1176
+ function n(d) {
1177
+ for (var p = 0, E = Math.min(256 * 256, d.length + 1), h = new Uint16Array(E), A = [], O = 0; ; ) {
1178
+ var f = p < d.length;
1179
+ if (!f || O >= E - 1) {
1180
+ var T = h.subarray(0, O), L = T;
1181
+ if (A.push(String.fromCharCode.apply(null, L)), !f)
1182
+ return A.join("");
1183
+ d = d.subarray(p), p = 0, O = 0;
1184
+ }
1185
+ var I = d[p++];
1186
+ if ((I & 128) === 0)
1187
+ h[O++] = I;
1188
+ else if ((I & 224) === 192) {
1189
+ var j = d[p++] & 63;
1190
+ h[O++] = (I & 31) << 6 | j;
1191
+ } else if ((I & 240) === 224) {
1192
+ var j = d[p++] & 63, _ = d[p++] & 63;
1193
+ h[O++] = (I & 31) << 12 | j << 6 | _;
1194
+ } else if ((I & 248) === 240) {
1195
+ var j = d[p++] & 63, _ = d[p++] & 63, P = d[p++] & 63, C = (I & 7) << 18 | j << 12 | _ << 6 | P;
1196
+ C > 65535 && (C -= 65536, h[O++] = C >>> 10 & 1023 | 55296, C = 56320 | C & 1023), h[O++] = C;
1197
+ }
1198
+ }
1199
+ }
1200
+ function r(d) {
1201
+ for (var p = 0, E = d.length, h = 0, A = Math.max(32, E + (E >>> 1) + 7), O = new Uint8Array(A >>> 3 << 3); p < E; ) {
1202
+ var f = d.charCodeAt(p++);
1203
+ if (f >= 55296 && f <= 56319) {
1204
+ if (p < E) {
1205
+ var T = d.charCodeAt(p);
1206
+ (T & 64512) === 56320 && (++p, f = ((f & 1023) << 10) + (T & 1023) + 65536);
1207
+ }
1208
+ if (f >= 55296 && f <= 56319)
1209
+ continue;
1210
+ }
1211
+ if (h + 4 > O.length) {
1212
+ A += 8, A *= 1 + p / d.length * 2, A = A >>> 3 << 3;
1213
+ var L = new Uint8Array(A);
1214
+ L.set(O), O = L;
1215
+ }
1216
+ if ((f & 4294967168) === 0) {
1217
+ O[h++] = f;
1218
+ continue;
1219
+ } else if ((f & 4294965248) === 0)
1220
+ O[h++] = f >>> 6 & 31 | 192;
1221
+ else if ((f & 4294901760) === 0)
1222
+ O[h++] = f >>> 12 & 15 | 224, O[h++] = f >>> 6 & 63 | 128;
1223
+ else if ((f & 4292870144) === 0)
1224
+ O[h++] = f >>> 18 & 7 | 240, O[h++] = f >>> 12 & 63 | 128, O[h++] = f >>> 6 & 63 | 128;
1225
+ else
1226
+ continue;
1227
+ O[h++] = f & 63 | 128;
1228
+ }
1229
+ return O.slice ? O.slice(0, h) : O.subarray(0, h);
1230
+ }
1231
+ var o = "Failed to ", i = function(d, p, E) {
1232
+ if (d)
1233
+ throw new Error("".concat(o).concat(p, ": the '").concat(E, "' option is unsupported."));
1234
+ }, u = typeof Buffer == "function" && Buffer.from, c = u ? a : r;
1235
+ function s() {
1236
+ this.encoding = "utf-8";
1237
+ }
1238
+ s.prototype.encode = function(d, p) {
1239
+ return i(p && p.stream, "encode", "stream"), c(d);
1240
+ };
1241
+ function v(d) {
1242
+ var p;
1243
+ try {
1244
+ var E = new Blob([d], { type: "text/plain;charset=UTF-8" });
1245
+ p = URL.createObjectURL(E);
1246
+ var h = new XMLHttpRequest();
1247
+ return h.open("GET", p, !1), h.send(), h.responseText;
1248
+ } finally {
1249
+ p && URL.revokeObjectURL(p);
1250
+ }
1251
+ }
1252
+ var b = !u && typeof Blob == "function" && typeof URL == "function" && typeof URL.createObjectURL == "function", S = ["utf-8", "utf8", "unicode-1-1-utf-8"], w = n;
1253
+ u ? w = e : b && (w = function(d) {
1254
+ try {
1255
+ return v(d);
1256
+ } catch {
1257
+ return n(d);
1258
+ }
1259
+ });
1260
+ var D = "construct 'TextDecoder'", g = "".concat(o, " ").concat(D, ": the ");
1261
+ function y(d, p) {
1262
+ i(p && p.fatal, D, "fatal"), d = d || "utf-8";
1263
+ var E;
1264
+ if (u ? E = Buffer.isEncoding(d) : E = S.indexOf(d.toLowerCase()) !== -1, !E)
1265
+ throw new RangeError("".concat(g, " encoding label provided ('").concat(d, "') is invalid."));
1266
+ this.encoding = d, this.fatal = !1, this.ignoreBOM = !1;
1267
+ }
1268
+ y.prototype.decode = function(d, p) {
1269
+ i(p && p.stream, "decode", "stream");
1270
+ var E;
1271
+ return d instanceof Uint8Array ? E = d : d.buffer instanceof ArrayBuffer ? E = new Uint8Array(d.buffer) : E = new Uint8Array(d), w(E, this.encoding);
1272
+ }, t.TextEncoder = t.TextEncoder || s, t.TextDecoder = t.TextDecoder || y;
1273
+ })(typeof window < "u" ? window : xe);
1274
+ const fr = /* @__PURE__ */ xn({
1275
+ __proto__: null,
1276
+ default: Ot
1277
+ }, [Ot]);
1278
+ (Et = console.assert) == null || Et.call(console, fr);
1279
+ function gr(t, e) {
1280
+ const a = (n) => {
1281
+ var r, o;
1282
+ t.includes((r = n.data) == null ? void 0 : r.type) && e((o = n.data) == null ? void 0 : o.data);
1283
+ };
1284
+ return window.addEventListener("message", a, !1), {
1285
+ unsubscribe() {
1286
+ window.removeEventListener("message", a);
1287
+ }
1288
+ };
1289
+ }
1290
+ function pr({
1291
+ message: t,
1292
+ recievingMessage: e,
1293
+ data: a,
1294
+ attempts: n = 1,
1295
+ timeout: r = 300
1296
+ }) {
1297
+ let o = !1;
1298
+ const i = () => new Promise((c, s) => {
1299
+ const v = gr(e, S);
1300
+ window.postMessage({ type: t, data: a }, window.origin);
1301
+ const b = setTimeout(D, r);
1302
+ function S(g) {
1303
+ clearTimeout(b), w(), c(g);
1304
+ }
1305
+ function w() {
1306
+ v.unsubscribe();
1307
+ }
1308
+ function D() {
1309
+ w(), s();
1310
+ }
1311
+ });
1312
+ return {
1313
+ cancel() {
1314
+ o = !0;
1315
+ },
1316
+ promise: (async () => {
1317
+ for (let c = 0; c < n; c++) {
1318
+ if (o)
1319
+ return new Promise(() => {
1320
+ });
1321
+ try {
1322
+ return await i();
1323
+ } catch {
1324
+ continue;
1325
+ }
1326
+ }
1327
+ if (!o)
1328
+ throw `Didn't recieve ${e.join(" or ")} in time.`;
1329
+ return new Promise(() => {
1330
+ });
1331
+ })()
1332
+ };
1333
+ }
1334
+ function _r() {
1335
+ let t;
1336
+ async function e(a) {
1337
+ t == null || t();
1338
+ const { cancel: n, promise: r } = pr({
1339
+ message: "TOLGEE_READY",
1340
+ recievingMessage: ["TOLGEE_PLUGIN_READY", "TOLGEE_PLUGIN_UPDATED"],
1341
+ data: a,
1342
+ attempts: 4
1343
+ });
1344
+ return t = n, r;
1345
+ }
1346
+ return {
1347
+ update: e
1348
+ };
1349
+ }
1350
+ const hr = "tolgee-in-context-tools.umd.min.js", Er = "@tolgee/in-context-tools", yr = "InContextTools", mr = "https://cdn.jsdelivr.net/npm";
1351
+ function vr(t) {
1352
+ return new Promise((e, a) => {
1353
+ const n = document.createElement("script");
1354
+ n.src = t, n.addEventListener("load", () => e()), n.addEventListener("error", (r) => a(r.error)), document.head.appendChild(n);
1355
+ });
1356
+ }
1357
+ let Ue = null;
1358
+ function br(t) {
1359
+ return Ue || (Ue = vr(
1360
+ `${mr}/@tolgee/web@${t}/dist/${hr}`
1361
+ ).then(() => window[Er][yr])), Ue;
1362
+ }
1363
+ const mn = "__tolgee_apiKey", vn = "__tolgee_apiUrl";
1364
+ function Tt() {
1365
+ const t = sessionStorage.getItem(mn) || void 0, e = sessionStorage.getItem(vn) || void 0;
1366
+ if (!(!t || !e))
1367
+ return {
1368
+ apiKey: t,
1369
+ apiUrl: e
1370
+ };
1371
+ }
1372
+ function Rr() {
1373
+ sessionStorage.removeItem(mn), sessionStorage.removeItem(vn);
1374
+ }
1375
+ function Or(t) {
1376
+ document.readyState !== "loading" ? Promise.resolve().then(() => {
1377
+ t();
1378
+ }) : document.addEventListener && document.addEventListener("DOMContentLoaded", t);
1379
+ }
1380
+ let bn = () => (t) => t;
1381
+ const Tr = () => {
1382
+ if (typeof window > "u")
1383
+ return !1;
1384
+ try {
1385
+ return typeof sessionStorage < "u" && sessionStorage;
1386
+ } catch (t) {
1387
+ return console.error("sessionStorage not available", t), !1;
1388
+ }
1389
+ };
1390
+ Tr() && (bn = () => (t) => {
1391
+ const e = _r(), a = () => ({
1392
+ // prevent extension downloading ui library
1393
+ uiPresent: !0,
1394
+ uiVersion: void 0,
1395
+ // tolgee mode
1396
+ mode: t.isDev() ? "development" : "production",
1397
+ // pass credentials
1398
+ config: {
1399
+ apiUrl: t.getInitialOptions().apiUrl || "",
1400
+ apiKey: t.getInitialOptions().apiKey || ""
1401
+ }
1402
+ }), n = async () => {
1403
+ const o = await br(
1404
+ "prerelease"
1405
+ );
1406
+ return (i) => {
1407
+ const u = Tt();
1408
+ return i.addPlugin(o({ credentials: u })), i;
1409
+ };
1410
+ };
1411
+ return t.on("running", ({ value: o }) => {
1412
+ o && Or(() => {
1413
+ e.update(a()).catch(Rr);
1414
+ });
1415
+ }), Tt() && n().then((o) => {
1416
+ t.addPlugin(o);
1417
+ }).catch((o) => {
1418
+ console.error("Tolgee: Failed to load in-context tools"), console.error(o);
1419
+ }), t;
1420
+ });
1421
+ function Ar() {
1422
+ return nr().use(bn());
1423
+ }
1424
+ const Pr = () => (t) => t;
1425
+ let qe;
1426
+ const Sr = () => (qe || (qe = J.createContext(void 0)), qe);
1427
+ let wr;
1428
+ function Dr() {
1429
+ return wr;
1430
+ }
1431
+ const Cr = () => {
1432
+ const t = Sr(), e = Mn(t) || Dr();
1433
+ if (!e)
1434
+ throw new Error("Couldn't find tolgee instance, did you forgot to use `TolgeeProvider`?");
1435
+ return e;
1436
+ }, jr = () => {
1437
+ const [t, e] = kn(0), a = gt(() => {
1438
+ e((n) => n + 1);
1439
+ }, [e]);
1440
+ return { instance: t, rerender: a };
1441
+ }, Nr = (t, e) => {
1442
+ const { tolgee: a, options: n } = Cr(), r = fn(t), o = H(r).join(":"), i = Object.assign(Object.assign({}, n), e), { rerender: u, instance: c } = jr(), s = In([]);
1443
+ s.current = [];
1444
+ const v = a.isLoaded(r);
1445
+ ht(() => {
1446
+ const S = a.on("update", u);
1447
+ return () => {
1448
+ S.unsubscribe();
1449
+ };
1450
+ }, [o, a]), ht(() => (a.addActiveNs(r), () => a.removeActiveNs(r)), [o, a]);
1451
+ const b = gt((S) => {
1452
+ var w;
1453
+ const D = (w = S.ns) !== null && w !== void 0 ? w : r == null ? void 0 : r[0];
1454
+ return a.t(Object.assign(Object.assign({}, S), { ns: D }));
1455
+ }, [a, c]);
1456
+ if (i.useSuspense && !v)
1457
+ throw a.addActiveNs(r, !0);
1458
+ return { t: b, isLoading: !v };
1459
+ }, Lr = (t, e) => {
1460
+ const { t: a, isLoading: n } = Nr(t, e);
1461
+ return { t: gt((...o) => {
1462
+ const i = En(...o);
1463
+ return a(i);
1464
+ }, [a]), isLoading: n };
1465
+ };
1466
+ var ue = { exports: {} }, Fe = {}, He = {}, At;
1467
+ function Ir() {
1468
+ if (At) return He;
1469
+ At = 1;
1470
+ function t(e) {
1471
+ return e && e.__esModule ? e : { default: e };
1472
+ }
1473
+ return He._ = t, He;
1474
+ }
1475
+ var Pt;
1476
+ function Mr() {
1477
+ return Pt || (Pt = 1, (function(t) {
1478
+ "use client";
1479
+ Object.defineProperty(t, "__esModule", {
1480
+ value: !0
1481
+ });
1482
+ function e(s, v) {
1483
+ for (var b in v) Object.defineProperty(s, b, {
1484
+ enumerable: !0,
1485
+ get: v[b]
1486
+ });
1487
+ }
1488
+ e(t, {
1489
+ AppRouterContext: function() {
1490
+ return r;
1491
+ },
1492
+ GlobalLayoutRouterContext: function() {
1493
+ return i;
1494
+ },
1495
+ LayoutRouterContext: function() {
1496
+ return o;
1497
+ },
1498
+ MissingSlotContext: function() {
1499
+ return c;
1500
+ },
1501
+ TemplateContext: function() {
1502
+ return u;
1503
+ }
1504
+ });
1505
+ const n = /* @__PURE__ */ (/* @__PURE__ */ Ir())._(J), r = n.default.createContext(null), o = n.default.createContext(null), i = n.default.createContext(null), u = n.default.createContext(null);
1506
+ process.env.NODE_ENV !== "production" && (r.displayName = "AppRouterContext", o.displayName = "LayoutRouterContext", i.displayName = "GlobalLayoutRouterContext", u.displayName = "TemplateContext");
1507
+ const c = n.default.createContext(/* @__PURE__ */ new Set());
1508
+ })(Fe)), Fe;
1509
+ }
1510
+ var Be = {}, St;
1511
+ function kr() {
1512
+ return St || (St = 1, (function(t) {
1513
+ "use client";
1514
+ Object.defineProperty(t, "__esModule", {
1515
+ value: !0
1516
+ });
1517
+ function e(i, u) {
1518
+ for (var c in u) Object.defineProperty(i, c, {
1519
+ enumerable: !0,
1520
+ get: u[c]
1521
+ });
1522
+ }
1523
+ e(t, {
1524
+ PathParamsContext: function() {
1525
+ return o;
1526
+ },
1527
+ PathnameContext: function() {
1528
+ return r;
1529
+ },
1530
+ SearchParamsContext: function() {
1531
+ return n;
1532
+ }
1533
+ });
1534
+ const a = J, n = (0, a.createContext)(null), r = (0, a.createContext)(null), o = (0, a.createContext)(null);
1535
+ process.env.NODE_ENV !== "production" && (n.displayName = "SearchParamsContext", r.displayName = "PathnameContext", o.displayName = "PathParamsContext");
1536
+ })(Be)), Be;
1537
+ }
1538
+ var se = { exports: {} }, wt;
1539
+ function xr() {
1540
+ return wt || (wt = 1, (function(t, e) {
1541
+ Object.defineProperty(e, "__esModule", {
1542
+ value: !0
1543
+ }), Object.defineProperty(e, "getSegmentValue", {
1544
+ enumerable: !0,
1545
+ get: function() {
1546
+ return a;
1547
+ }
1548
+ });
1549
+ function a(n) {
1550
+ return Array.isArray(n) ? n[1] : n;
1551
+ }
1552
+ (typeof e.default == "function" || typeof e.default == "object" && e.default !== null) && typeof e.default.__esModule > "u" && (Object.defineProperty(e.default, "__esModule", { value: !0 }), Object.assign(e.default, e), t.exports = e.default);
1553
+ })(se, se.exports)), se.exports;
1554
+ }
1555
+ var Xe = {}, Dt;
1556
+ function Ur() {
1557
+ return Dt || (Dt = 1, (function(t) {
1558
+ Object.defineProperty(t, "__esModule", {
1559
+ value: !0
1560
+ });
1561
+ function e(u, c) {
1562
+ for (var s in c) Object.defineProperty(u, s, {
1563
+ enumerable: !0,
1564
+ get: c[s]
1565
+ });
1566
+ }
1567
+ e(t, {
1568
+ DEFAULT_SEGMENT_KEY: function() {
1569
+ return i;
1570
+ },
1571
+ PAGE_SEGMENT_KEY: function() {
1572
+ return o;
1573
+ },
1574
+ addSearchParamsIfPageSegment: function() {
1575
+ return r;
1576
+ },
1577
+ isGroupSegment: function() {
1578
+ return a;
1579
+ },
1580
+ isParallelRouteSegment: function() {
1581
+ return n;
1582
+ }
1583
+ });
1584
+ function a(u) {
1585
+ return u[0] === "(" && u.endsWith(")");
1586
+ }
1587
+ function n(u) {
1588
+ return u.startsWith("@") && u !== "@children";
1589
+ }
1590
+ function r(u, c) {
1591
+ if (u.includes(o)) {
1592
+ const v = JSON.stringify(c);
1593
+ return v !== "{}" ? o + "?" + v : o;
1594
+ }
1595
+ return u;
1596
+ }
1597
+ const o = "__PAGE__", i = "__DEFAULT__";
1598
+ })(Xe)), Xe;
1599
+ }
1600
+ var ce = { exports: {} }, le = { exports: {} }, de = { exports: {} }, Ct;
1601
+ function Rn() {
1602
+ return Ct || (Ct = 1, (function(t, e) {
1603
+ Object.defineProperty(e, "__esModule", {
1604
+ value: !0
1605
+ }), Object.defineProperty(e, "RedirectStatusCode", {
1606
+ enumerable: !0,
1607
+ get: function() {
1608
+ return a;
1609
+ }
1610
+ });
1611
+ var a = /* @__PURE__ */ (function(n) {
1612
+ return n[n.SeeOther = 303] = "SeeOther", n[n.TemporaryRedirect = 307] = "TemporaryRedirect", n[n.PermanentRedirect = 308] = "PermanentRedirect", n;
1613
+ })({});
1614
+ (typeof e.default == "function" || typeof e.default == "object" && e.default !== null) && typeof e.default.__esModule > "u" && (Object.defineProperty(e.default, "__esModule", { value: !0 }), Object.assign(e.default, e), t.exports = e.default);
1615
+ })(de, de.exports)), de.exports;
1616
+ }
1617
+ var fe = { exports: {} }, jt;
1618
+ function pt() {
1619
+ return jt || (jt = 1, (function(t, e) {
1620
+ Object.defineProperty(e, "__esModule", {
1621
+ value: !0
1622
+ });
1623
+ function a(u, c) {
1624
+ for (var s in c) Object.defineProperty(u, s, {
1625
+ enumerable: !0,
1626
+ get: c[s]
1627
+ });
1628
+ }
1629
+ a(e, {
1630
+ REDIRECT_ERROR_CODE: function() {
1631
+ return r;
1632
+ },
1633
+ RedirectType: function() {
1634
+ return o;
1635
+ },
1636
+ isRedirectError: function() {
1637
+ return i;
1638
+ }
1639
+ });
1640
+ const n = Rn(), r = "NEXT_REDIRECT";
1641
+ var o = /* @__PURE__ */ (function(u) {
1642
+ return u.push = "push", u.replace = "replace", u;
1643
+ })({});
1644
+ function i(u) {
1645
+ if (typeof u != "object" || u === null || !("digest" in u) || typeof u.digest != "string")
1646
+ return !1;
1647
+ const c = u.digest.split(";"), [s, v] = c, b = c.slice(2, -2).join(";"), S = c.at(-2), w = Number(S);
1648
+ return s === r && (v === "replace" || v === "push") && typeof b == "string" && !isNaN(w) && w in n.RedirectStatusCode;
1649
+ }
1650
+ (typeof e.default == "function" || typeof e.default == "object" && e.default !== null) && typeof e.default.__esModule > "u" && (Object.defineProperty(e.default, "__esModule", { value: !0 }), Object.assign(e.default, e), t.exports = e.default);
1651
+ })(fe, fe.exports)), fe.exports;
1652
+ }
1653
+ var Ge = {}, We = {}, ze = {}, Nt;
1654
+ function _t() {
1655
+ return Nt || (Nt = 1, (function(t) {
1656
+ Object.defineProperty(t, "__esModule", {
1657
+ value: !0
1658
+ });
1659
+ function e(c, s) {
1660
+ for (var v in s) Object.defineProperty(c, v, {
1661
+ enumerable: !0,
1662
+ get: s[v]
1663
+ });
1664
+ }
1665
+ e(t, {
1666
+ bindSnapshot: function() {
1667
+ return i;
1668
+ },
1669
+ createAsyncLocalStorage: function() {
1670
+ return o;
1671
+ },
1672
+ createSnapshot: function() {
1673
+ return u;
1674
+ }
1675
+ });
1676
+ const a = Object.defineProperty(new Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available"), "__NEXT_ERROR_CODE", {
1677
+ value: "E504",
1678
+ enumerable: !1,
1679
+ configurable: !0
1680
+ });
1681
+ class n {
1682
+ disable() {
1683
+ throw a;
1684
+ }
1685
+ getStore() {
1686
+ }
1687
+ run() {
1688
+ throw a;
1689
+ }
1690
+ exit() {
1691
+ throw a;
1692
+ }
1693
+ enterWith() {
1694
+ throw a;
1695
+ }
1696
+ static bind(s) {
1697
+ return s;
1698
+ }
1699
+ }
1700
+ const r = typeof globalThis < "u" && globalThis.AsyncLocalStorage;
1701
+ function o() {
1702
+ return r ? new r() : new n();
1703
+ }
1704
+ function i(c) {
1705
+ return r ? r.bind(c) : n.bind(c);
1706
+ }
1707
+ function u() {
1708
+ return r ? r.snapshot() : function(c, ...s) {
1709
+ return c(...s);
1710
+ };
1711
+ }
1712
+ })(ze)), ze;
1713
+ }
1714
+ var Lt;
1715
+ function qr() {
1716
+ return Lt || (Lt = 1, (function(t) {
1717
+ Object.defineProperty(t, "__esModule", {
1718
+ value: !0
1719
+ }), Object.defineProperty(t, "actionAsyncStorageInstance", {
1720
+ enumerable: !0,
1721
+ get: function() {
1722
+ return a;
1723
+ }
1724
+ });
1725
+ const a = (0, _t().createAsyncLocalStorage)();
1726
+ })(We)), We;
1727
+ }
1728
+ var It;
1729
+ function Fr() {
1730
+ return It || (It = 1, (function(t) {
1731
+ Object.defineProperty(t, "__esModule", {
1732
+ value: !0
1733
+ }), Object.defineProperty(t, "actionAsyncStorage", {
1734
+ enumerable: !0,
1735
+ get: function() {
1736
+ return e.actionAsyncStorageInstance;
1737
+ }
1738
+ });
1739
+ const e = qr();
1740
+ })(Ge)), Ge;
1741
+ }
1742
+ var Mt;
1743
+ function Hr() {
1744
+ return Mt || (Mt = 1, (function(t, e) {
1745
+ Object.defineProperty(e, "__esModule", {
1746
+ value: !0
1747
+ });
1748
+ function a(S, w) {
1749
+ for (var D in w) Object.defineProperty(S, D, {
1750
+ enumerable: !0,
1751
+ get: w[D]
1752
+ });
1753
+ }
1754
+ a(e, {
1755
+ getRedirectError: function() {
1756
+ return i;
1757
+ },
1758
+ getRedirectStatusCodeFromError: function() {
1759
+ return b;
1760
+ },
1761
+ getRedirectTypeFromError: function() {
1762
+ return v;
1763
+ },
1764
+ getURLFromRedirectError: function() {
1765
+ return s;
1766
+ },
1767
+ permanentRedirect: function() {
1768
+ return c;
1769
+ },
1770
+ redirect: function() {
1771
+ return u;
1772
+ }
1773
+ });
1774
+ const n = Rn(), r = pt(), o = typeof window > "u" ? Fr().actionAsyncStorage : void 0;
1775
+ function i(S, w, D) {
1776
+ D === void 0 && (D = n.RedirectStatusCode.TemporaryRedirect);
1777
+ const g = Object.defineProperty(new Error(r.REDIRECT_ERROR_CODE), "__NEXT_ERROR_CODE", {
1778
+ value: "E394",
1779
+ enumerable: !1,
1780
+ configurable: !0
1781
+ });
1782
+ return g.digest = r.REDIRECT_ERROR_CODE + ";" + w + ";" + S + ";" + D + ";", g;
1783
+ }
1784
+ function u(S, w) {
1785
+ var D;
1786
+ throw w ?? (w = !(o == null || (D = o.getStore()) == null) && D.isAction ? r.RedirectType.push : r.RedirectType.replace), i(S, w, n.RedirectStatusCode.TemporaryRedirect);
1787
+ }
1788
+ function c(S, w) {
1789
+ throw w === void 0 && (w = r.RedirectType.replace), i(S, w, n.RedirectStatusCode.PermanentRedirect);
1790
+ }
1791
+ function s(S) {
1792
+ return (0, r.isRedirectError)(S) ? S.digest.split(";").slice(2, -2).join(";") : null;
1793
+ }
1794
+ function v(S) {
1795
+ if (!(0, r.isRedirectError)(S))
1796
+ throw Object.defineProperty(new Error("Not a redirect error"), "__NEXT_ERROR_CODE", {
1797
+ value: "E260",
1798
+ enumerable: !1,
1799
+ configurable: !0
1800
+ });
1801
+ return S.digest.split(";", 2)[1];
1802
+ }
1803
+ function b(S) {
1804
+ if (!(0, r.isRedirectError)(S))
1805
+ throw Object.defineProperty(new Error("Not a redirect error"), "__NEXT_ERROR_CODE", {
1806
+ value: "E260",
1807
+ enumerable: !1,
1808
+ configurable: !0
1809
+ });
1810
+ return Number(S.digest.split(";").at(-2));
1811
+ }
1812
+ (typeof e.default == "function" || typeof e.default == "object" && e.default !== null) && typeof e.default.__esModule > "u" && (Object.defineProperty(e.default, "__esModule", { value: !0 }), Object.assign(e.default, e), t.exports = e.default);
1813
+ })(le, le.exports)), le.exports;
1814
+ }
1815
+ var ge = { exports: {} }, pe = { exports: {} }, kt;
1816
+ function we() {
1817
+ return kt || (kt = 1, (function(t, e) {
1818
+ Object.defineProperty(e, "__esModule", {
1819
+ value: !0
1820
+ });
1821
+ function a(s, v) {
1822
+ for (var b in v) Object.defineProperty(s, b, {
1823
+ enumerable: !0,
1824
+ get: v[b]
1825
+ });
1826
+ }
1827
+ a(e, {
1828
+ HTTPAccessErrorStatus: function() {
1829
+ return n;
1830
+ },
1831
+ HTTP_ERROR_FALLBACK_ERROR_CODE: function() {
1832
+ return o;
1833
+ },
1834
+ getAccessFallbackErrorTypeByStatus: function() {
1835
+ return c;
1836
+ },
1837
+ getAccessFallbackHTTPStatus: function() {
1838
+ return u;
1839
+ },
1840
+ isHTTPAccessFallbackError: function() {
1841
+ return i;
1842
+ }
1843
+ });
1844
+ const n = {
1845
+ NOT_FOUND: 404,
1846
+ FORBIDDEN: 403,
1847
+ UNAUTHORIZED: 401
1848
+ }, r = new Set(Object.values(n)), o = "NEXT_HTTP_ERROR_FALLBACK";
1849
+ function i(s) {
1850
+ if (typeof s != "object" || s === null || !("digest" in s) || typeof s.digest != "string")
1851
+ return !1;
1852
+ const [v, b] = s.digest.split(";");
1853
+ return v === o && r.has(Number(b));
1854
+ }
1855
+ function u(s) {
1856
+ const v = s.digest.split(";")[1];
1857
+ return Number(v);
1858
+ }
1859
+ function c(s) {
1860
+ switch (s) {
1861
+ case 401:
1862
+ return "unauthorized";
1863
+ case 403:
1864
+ return "forbidden";
1865
+ case 404:
1866
+ return "not-found";
1867
+ default:
1868
+ return;
1869
+ }
1870
+ }
1871
+ (typeof e.default == "function" || typeof e.default == "object" && e.default !== null) && typeof e.default.__esModule > "u" && (Object.defineProperty(e.default, "__esModule", { value: !0 }), Object.assign(e.default, e), t.exports = e.default);
1872
+ })(pe, pe.exports)), pe.exports;
1873
+ }
1874
+ var xt;
1875
+ function Br() {
1876
+ return xt || (xt = 1, (function(t, e) {
1877
+ Object.defineProperty(e, "__esModule", {
1878
+ value: !0
1879
+ }), Object.defineProperty(e, "notFound", {
1880
+ enumerable: !0,
1881
+ get: function() {
1882
+ return r;
1883
+ }
1884
+ });
1885
+ const n = "" + we().HTTP_ERROR_FALLBACK_ERROR_CODE + ";404";
1886
+ function r() {
1887
+ const o = Object.defineProperty(new Error(n), "__NEXT_ERROR_CODE", {
1888
+ value: "E394",
1889
+ enumerable: !1,
1890
+ configurable: !0
1891
+ });
1892
+ throw o.digest = n, o;
1893
+ }
1894
+ (typeof e.default == "function" || typeof e.default == "object" && e.default !== null) && typeof e.default.__esModule > "u" && (Object.defineProperty(e.default, "__esModule", { value: !0 }), Object.assign(e.default, e), t.exports = e.default);
1895
+ })(ge, ge.exports)), ge.exports;
1896
+ }
1897
+ var _e = { exports: {} }, Ut;
1898
+ function Xr() {
1899
+ return Ut || (Ut = 1, (function(t, e) {
1900
+ Object.defineProperty(e, "__esModule", {
1901
+ value: !0
1902
+ }), Object.defineProperty(e, "forbidden", {
1903
+ enumerable: !0,
1904
+ get: function() {
1905
+ return r;
1906
+ }
1907
+ });
1908
+ const n = "" + we().HTTP_ERROR_FALLBACK_ERROR_CODE + ";403";
1909
+ function r() {
1910
+ if (!process.env.__NEXT_EXPERIMENTAL_AUTH_INTERRUPTS)
1911
+ throw Object.defineProperty(new Error("`forbidden()` is experimental and only allowed to be enabled when `experimental.authInterrupts` is enabled."), "__NEXT_ERROR_CODE", {
1912
+ value: "E488",
1913
+ enumerable: !1,
1914
+ configurable: !0
1915
+ });
1916
+ const o = Object.defineProperty(new Error(n), "__NEXT_ERROR_CODE", {
1917
+ value: "E394",
1918
+ enumerable: !1,
1919
+ configurable: !0
1920
+ });
1921
+ throw o.digest = n, o;
1922
+ }
1923
+ (typeof e.default == "function" || typeof e.default == "object" && e.default !== null) && typeof e.default.__esModule > "u" && (Object.defineProperty(e.default, "__esModule", { value: !0 }), Object.assign(e.default, e), t.exports = e.default);
1924
+ })(_e, _e.exports)), _e.exports;
1925
+ }
1926
+ var he = { exports: {} }, qt;
1927
+ function Gr() {
1928
+ return qt || (qt = 1, (function(t, e) {
1929
+ Object.defineProperty(e, "__esModule", {
1930
+ value: !0
1931
+ }), Object.defineProperty(e, "unauthorized", {
1932
+ enumerable: !0,
1933
+ get: function() {
1934
+ return r;
1935
+ }
1936
+ });
1937
+ const n = "" + we().HTTP_ERROR_FALLBACK_ERROR_CODE + ";401";
1938
+ function r() {
1939
+ if (!process.env.__NEXT_EXPERIMENTAL_AUTH_INTERRUPTS)
1940
+ throw Object.defineProperty(new Error("`unauthorized()` is experimental and only allowed to be used when `experimental.authInterrupts` is enabled."), "__NEXT_ERROR_CODE", {
1941
+ value: "E411",
1942
+ enumerable: !1,
1943
+ configurable: !0
1944
+ });
1945
+ const o = Object.defineProperty(new Error(n), "__NEXT_ERROR_CODE", {
1946
+ value: "E394",
1947
+ enumerable: !1,
1948
+ configurable: !0
1949
+ });
1950
+ throw o.digest = n, o;
1951
+ }
1952
+ (typeof e.default == "function" || typeof e.default == "object" && e.default !== null) && typeof e.default.__esModule > "u" && (Object.defineProperty(e.default, "__esModule", { value: !0 }), Object.assign(e.default, e), t.exports = e.default);
1953
+ })(he, he.exports)), he.exports;
1954
+ }
1955
+ var Ee = { exports: {} }, ye = { exports: {} }, Ye = {}, Ft;
1956
+ function On() {
1957
+ return Ft || (Ft = 1, (function(t) {
1958
+ Object.defineProperty(t, "__esModule", {
1959
+ value: !0
1960
+ });
1961
+ function e(s, v) {
1962
+ for (var b in v) Object.defineProperty(s, b, {
1963
+ enumerable: !0,
1964
+ get: v[b]
1965
+ });
1966
+ }
1967
+ e(t, {
1968
+ isHangingPromiseRejectionError: function() {
1969
+ return a;
1970
+ },
1971
+ makeDevtoolsIOAwarePromise: function() {
1972
+ return c;
1973
+ },
1974
+ makeHangingPromise: function() {
1975
+ return i;
1976
+ }
1977
+ });
1978
+ function a(s) {
1979
+ return typeof s != "object" || s === null || !("digest" in s) ? !1 : s.digest === n;
1980
+ }
1981
+ const n = "HANGING_PROMISE_REJECTION";
1982
+ class r extends Error {
1983
+ constructor(v, b) {
1984
+ super(`During prerendering, ${b} rejects when the prerender is complete. Typically these errors are handled by React but if you move ${b} to a different context by using \`setTimeout\`, \`after\`, or similar functions you may observe this error and you should handle it in that context. This occurred at route "${v}".`), this.route = v, this.expression = b, this.digest = n;
1985
+ }
1986
+ }
1987
+ const o = /* @__PURE__ */ new WeakMap();
1988
+ function i(s, v, b) {
1989
+ if (s.aborted)
1990
+ return Promise.reject(new r(v, b));
1991
+ {
1992
+ const S = new Promise((w, D) => {
1993
+ const g = D.bind(null, new r(v, b));
1994
+ let y = o.get(s);
1995
+ if (y)
1996
+ y.push(g);
1997
+ else {
1998
+ const d = [
1999
+ g
2000
+ ];
2001
+ o.set(s, d), s.addEventListener("abort", () => {
2002
+ for (let p = 0; p < d.length; p++)
2003
+ d[p]();
2004
+ }, {
2005
+ once: !0
2006
+ });
2007
+ }
2008
+ });
2009
+ return S.catch(u), S;
2010
+ }
2011
+ }
2012
+ function u() {
2013
+ }
2014
+ function c(s) {
2015
+ return new Promise((v) => {
2016
+ setTimeout(() => {
2017
+ v(s);
2018
+ }, 0);
2019
+ });
2020
+ }
2021
+ })(Ye)), Ye;
2022
+ }
2023
+ var Ke = {}, Ht;
2024
+ function Wr() {
2025
+ return Ht || (Ht = 1, (function(t) {
2026
+ Object.defineProperty(t, "__esModule", {
2027
+ value: !0
2028
+ }), Object.defineProperty(t, "isPostpone", {
2029
+ enumerable: !0,
2030
+ get: function() {
2031
+ return a;
2032
+ }
2033
+ });
2034
+ const e = Symbol.for("react.postpone");
2035
+ function a(n) {
2036
+ return typeof n == "object" && n !== null && n.$$typeof === e;
2037
+ }
2038
+ })(Ke)), Ke;
2039
+ }
2040
+ var Ve = {}, Bt;
2041
+ function De() {
2042
+ return Bt || (Bt = 1, (function(t) {
2043
+ Object.defineProperty(t, "__esModule", {
2044
+ value: !0
2045
+ });
2046
+ function e(o, i) {
2047
+ for (var u in i) Object.defineProperty(o, u, {
2048
+ enumerable: !0,
2049
+ get: i[u]
2050
+ });
2051
+ }
2052
+ e(t, {
2053
+ BailoutToCSRError: function() {
2054
+ return n;
2055
+ },
2056
+ isBailoutToCSRError: function() {
2057
+ return r;
2058
+ }
2059
+ });
2060
+ const a = "BAILOUT_TO_CLIENT_SIDE_RENDERING";
2061
+ class n extends Error {
2062
+ constructor(i) {
2063
+ super("Bail out to client-side rendering: " + i), this.reason = i, this.digest = a;
2064
+ }
2065
+ }
2066
+ function r(o) {
2067
+ return typeof o != "object" || o === null || !("digest" in o) ? !1 : o.digest === a;
2068
+ }
2069
+ })(Ve)), Ve;
2070
+ }
2071
+ var me = { exports: {} }, Xt;
2072
+ function Tn() {
2073
+ return Xt || (Xt = 1, (function(t, e) {
2074
+ Object.defineProperty(e, "__esModule", {
2075
+ value: !0
2076
+ }), Object.defineProperty(e, "isNextRouterError", {
2077
+ enumerable: !0,
2078
+ get: function() {
2079
+ return r;
2080
+ }
2081
+ });
2082
+ const a = we(), n = pt();
2083
+ function r(o) {
2084
+ return (0, n.isRedirectError)(o) || (0, a.isHTTPAccessFallbackError)(o);
2085
+ }
2086
+ (typeof e.default == "function" || typeof e.default == "object" && e.default !== null) && typeof e.default.__esModule > "u" && (Object.defineProperty(e.default, "__esModule", { value: !0 }), Object.assign(e.default, e), t.exports = e.default);
2087
+ })(me, me.exports)), me.exports;
2088
+ }
2089
+ var Qe = {}, ve = { exports: {} }, Gt;
2090
+ function An() {
2091
+ return Gt || (Gt = 1, (function(t, e) {
2092
+ Object.defineProperty(e, "__esModule", {
2093
+ value: !0
2094
+ });
2095
+ function a(i, u) {
2096
+ for (var c in u) Object.defineProperty(i, c, {
2097
+ enumerable: !0,
2098
+ get: u[c]
2099
+ });
2100
+ }
2101
+ a(e, {
2102
+ DynamicServerError: function() {
2103
+ return r;
2104
+ },
2105
+ isDynamicServerError: function() {
2106
+ return o;
2107
+ }
2108
+ });
2109
+ const n = "DYNAMIC_SERVER_USAGE";
2110
+ class r extends Error {
2111
+ constructor(u) {
2112
+ super("Dynamic server usage: " + u), this.description = u, this.digest = n;
2113
+ }
2114
+ }
2115
+ function o(i) {
2116
+ return typeof i != "object" || i === null || !("digest" in i) || typeof i.digest != "string" ? !1 : i.digest === n;
2117
+ }
2118
+ (typeof e.default == "function" || typeof e.default == "object" && e.default !== null) && typeof e.default.__esModule > "u" && (Object.defineProperty(e.default, "__esModule", { value: !0 }), Object.assign(e.default, e), t.exports = e.default);
2119
+ })(ve, ve.exports)), ve.exports;
2120
+ }
2121
+ var be = { exports: {} }, Wt;
2122
+ function zr() {
2123
+ return Wt || (Wt = 1, (function(t, e) {
2124
+ Object.defineProperty(e, "__esModule", {
2125
+ value: !0
2126
+ });
2127
+ function a(i, u) {
2128
+ for (var c in u) Object.defineProperty(i, c, {
2129
+ enumerable: !0,
2130
+ get: u[c]
2131
+ });
2132
+ }
2133
+ a(e, {
2134
+ StaticGenBailoutError: function() {
2135
+ return r;
2136
+ },
2137
+ isStaticGenBailoutError: function() {
2138
+ return o;
2139
+ }
2140
+ });
2141
+ const n = "NEXT_STATIC_GEN_BAILOUT";
2142
+ class r extends Error {
2143
+ constructor(...u) {
2144
+ super(...u), this.code = n;
2145
+ }
2146
+ }
2147
+ function o(i) {
2148
+ return typeof i != "object" || i === null || !("code" in i) ? !1 : i.code === n;
2149
+ }
2150
+ (typeof e.default == "function" || typeof e.default == "object" && e.default !== null) && typeof e.default.__esModule > "u" && (Object.defineProperty(e.default, "__esModule", { value: !0 }), Object.assign(e.default, e), t.exports = e.default);
2151
+ })(be, be.exports)), be.exports;
2152
+ }
2153
+ var Je = {}, Ze = {}, zt;
2154
+ function Yr() {
2155
+ return zt || (zt = 1, (function(t) {
2156
+ Object.defineProperty(t, "__esModule", {
2157
+ value: !0
2158
+ }), Object.defineProperty(t, "workUnitAsyncStorageInstance", {
2159
+ enumerable: !0,
2160
+ get: function() {
2161
+ return a;
2162
+ }
2163
+ });
2164
+ const a = (0, _t().createAsyncLocalStorage)();
2165
+ })(Ze)), Ze;
2166
+ }
2167
+ var Re = { exports: {} }, Yt;
2168
+ function Kr() {
2169
+ return Yt || (Yt = 1, (function(t, e) {
2170
+ Object.defineProperty(e, "__esModule", {
2171
+ value: !0
2172
+ });
2173
+ function a(h, A) {
2174
+ for (var O in A) Object.defineProperty(h, O, {
2175
+ enumerable: !0,
2176
+ get: A[O]
2177
+ });
2178
+ }
2179
+ a(e, {
2180
+ ACTION_HEADER: function() {
2181
+ return r;
2182
+ },
2183
+ FLIGHT_HEADERS: function() {
2184
+ return S;
2185
+ },
2186
+ NEXT_ACTION_NOT_FOUND_HEADER: function() {
2187
+ return E;
2188
+ },
2189
+ NEXT_DID_POSTPONE_HEADER: function() {
2190
+ return g;
2191
+ },
2192
+ NEXT_HMR_REFRESH_HASH_COOKIE: function() {
2193
+ return s;
2194
+ },
2195
+ NEXT_HMR_REFRESH_HEADER: function() {
2196
+ return c;
2197
+ },
2198
+ NEXT_IS_PRERENDER_HEADER: function() {
2199
+ return p;
2200
+ },
2201
+ NEXT_REWRITTEN_PATH_HEADER: function() {
2202
+ return y;
2203
+ },
2204
+ NEXT_REWRITTEN_QUERY_HEADER: function() {
2205
+ return d;
2206
+ },
2207
+ NEXT_ROUTER_PREFETCH_HEADER: function() {
2208
+ return i;
2209
+ },
2210
+ NEXT_ROUTER_SEGMENT_PREFETCH_HEADER: function() {
2211
+ return u;
2212
+ },
2213
+ NEXT_ROUTER_STALE_TIME_HEADER: function() {
2214
+ return D;
2215
+ },
2216
+ NEXT_ROUTER_STATE_TREE_HEADER: function() {
2217
+ return o;
2218
+ },
2219
+ NEXT_RSC_UNION_QUERY: function() {
2220
+ return w;
2221
+ },
2222
+ NEXT_URL: function() {
2223
+ return v;
2224
+ },
2225
+ RSC_CONTENT_TYPE_HEADER: function() {
2226
+ return b;
2227
+ },
2228
+ RSC_HEADER: function() {
2229
+ return n;
2230
+ }
2231
+ });
2232
+ const n = "rsc", r = "next-action", o = "next-router-state-tree", i = "next-router-prefetch", u = "next-router-segment-prefetch", c = "next-hmr-refresh", s = "__next_hmr_refresh_hash__", v = "next-url", b = "text/x-component", S = [
2233
+ n,
2234
+ o,
2235
+ i,
2236
+ c,
2237
+ u
2238
+ ], w = "_rsc", D = "x-nextjs-stale-time", g = "x-nextjs-postponed", y = "x-nextjs-rewritten-path", d = "x-nextjs-rewritten-query", p = "x-nextjs-prerender", E = "x-nextjs-action-not-found";
2239
+ (typeof e.default == "function" || typeof e.default == "object" && e.default !== null) && typeof e.default.__esModule > "u" && (Object.defineProperty(e.default, "__esModule", { value: !0 }), Object.assign(e.default, e), t.exports = e.default);
2240
+ })(Re, Re.exports)), Re.exports;
2241
+ }
2242
+ var $e = {}, Kt;
2243
+ function Pn() {
2244
+ return Kt || (Kt = 1, (function(t) {
2245
+ Object.defineProperty(t, "__esModule", {
2246
+ value: !0
2247
+ }), Object.defineProperty(t, "InvariantError", {
2248
+ enumerable: !0,
2249
+ get: function() {
2250
+ return e;
2251
+ }
2252
+ });
2253
+ class e extends Error {
2254
+ constructor(n, r) {
2255
+ super("Invariant: " + (n.endsWith(".") ? n : n + ".") + " This is a bug in Next.js.", r), this.name = "InvariantError";
2256
+ }
2257
+ }
2258
+ })($e)), $e;
2259
+ }
2260
+ var Vt;
2261
+ function Sn() {
2262
+ return Vt || (Vt = 1, (function(t) {
2263
+ Object.defineProperty(t, "__esModule", {
2264
+ value: !0
2265
+ });
2266
+ function e(g, y) {
2267
+ for (var d in y) Object.defineProperty(g, d, {
2268
+ enumerable: !0,
2269
+ get: y[d]
2270
+ });
2271
+ }
2272
+ e(t, {
2273
+ getCacheSignal: function() {
2274
+ return w;
2275
+ },
2276
+ getDraftModeProviderForCacheScope: function() {
2277
+ return S;
2278
+ },
2279
+ getHmrRefreshHash: function() {
2280
+ return s;
2281
+ },
2282
+ getPrerenderResumeDataCache: function() {
2283
+ return u;
2284
+ },
2285
+ getRenderResumeDataCache: function() {
2286
+ return c;
2287
+ },
2288
+ getRuntimeStagePromise: function() {
2289
+ return D;
2290
+ },
2291
+ getServerComponentsHmrCache: function() {
2292
+ return b;
2293
+ },
2294
+ isHmrRefresh: function() {
2295
+ return v;
2296
+ },
2297
+ throwForMissingRequestStore: function() {
2298
+ return o;
2299
+ },
2300
+ throwInvariantForMissingStore: function() {
2301
+ return i;
2302
+ },
2303
+ workUnitAsyncStorage: function() {
2304
+ return a.workUnitAsyncStorageInstance;
2305
+ }
2306
+ });
2307
+ const a = Yr(), n = Kr(), r = Pn();
2308
+ function o(g) {
2309
+ throw Object.defineProperty(new Error(`\`${g}\` was called outside a request scope. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context`), "__NEXT_ERROR_CODE", {
2310
+ value: "E251",
2311
+ enumerable: !1,
2312
+ configurable: !0
2313
+ });
2314
+ }
2315
+ function i() {
2316
+ throw Object.defineProperty(new r.InvariantError("Expected workUnitAsyncStorage to have a store."), "__NEXT_ERROR_CODE", {
2317
+ value: "E696",
2318
+ enumerable: !1,
2319
+ configurable: !0
2320
+ });
2321
+ }
2322
+ function u(g) {
2323
+ switch (g.type) {
2324
+ case "prerender":
2325
+ case "prerender-runtime":
2326
+ case "prerender-ppr":
2327
+ return g.prerenderResumeDataCache;
2328
+ case "prerender-client":
2329
+ return g.prerenderResumeDataCache;
2330
+ case "prerender-legacy":
2331
+ case "request":
2332
+ case "cache":
2333
+ case "private-cache":
2334
+ case "unstable-cache":
2335
+ return null;
2336
+ default:
2337
+ return g;
2338
+ }
2339
+ }
2340
+ function c(g) {
2341
+ switch (g.type) {
2342
+ case "request":
2343
+ return g.renderResumeDataCache;
2344
+ case "prerender":
2345
+ case "prerender-runtime":
2346
+ case "prerender-client":
2347
+ if (g.renderResumeDataCache)
2348
+ return g.renderResumeDataCache;
2349
+ // fallthrough
2350
+ case "prerender-ppr":
2351
+ return g.prerenderResumeDataCache;
2352
+ case "cache":
2353
+ case "private-cache":
2354
+ case "unstable-cache":
2355
+ case "prerender-legacy":
2356
+ return null;
2357
+ default:
2358
+ return g;
2359
+ }
2360
+ }
2361
+ function s(g, y) {
2362
+ if (g.dev)
2363
+ switch (y.type) {
2364
+ case "cache":
2365
+ case "private-cache":
2366
+ case "prerender":
2367
+ case "prerender-runtime":
2368
+ return y.hmrRefreshHash;
2369
+ case "request":
2370
+ var d;
2371
+ return (d = y.cookies.get(n.NEXT_HMR_REFRESH_HASH_COOKIE)) == null ? void 0 : d.value;
2372
+ }
2373
+ }
2374
+ function v(g, y) {
2375
+ if (g.dev)
2376
+ switch (y.type) {
2377
+ case "cache":
2378
+ case "private-cache":
2379
+ case "request":
2380
+ return y.isHmrRefresh ?? !1;
2381
+ }
2382
+ return !1;
2383
+ }
2384
+ function b(g, y) {
2385
+ if (g.dev)
2386
+ switch (y.type) {
2387
+ case "cache":
2388
+ case "private-cache":
2389
+ case "request":
2390
+ return y.serverComponentsHmrCache;
2391
+ }
2392
+ }
2393
+ function S(g, y) {
2394
+ if (g.isDraftMode)
2395
+ switch (y.type) {
2396
+ case "cache":
2397
+ case "private-cache":
2398
+ case "unstable-cache":
2399
+ case "prerender-runtime":
2400
+ case "request":
2401
+ return y.draftMode;
2402
+ }
2403
+ }
2404
+ function w(g) {
2405
+ switch (g.type) {
2406
+ case "prerender":
2407
+ case "prerender-client":
2408
+ case "prerender-runtime":
2409
+ return g.cacheSignal;
2410
+ case "prerender-ppr":
2411
+ case "prerender-legacy":
2412
+ case "request":
2413
+ case "cache":
2414
+ case "private-cache":
2415
+ case "unstable-cache":
2416
+ return null;
2417
+ default:
2418
+ return g;
2419
+ }
2420
+ }
2421
+ function D(g) {
2422
+ switch (g.type) {
2423
+ case "prerender-runtime":
2424
+ case "private-cache":
2425
+ return g.runtimeStagePromise;
2426
+ case "prerender":
2427
+ case "prerender-client":
2428
+ case "prerender-ppr":
2429
+ case "prerender-legacy":
2430
+ case "request":
2431
+ case "cache":
2432
+ case "unstable-cache":
2433
+ return null;
2434
+ default:
2435
+ return g;
2436
+ }
2437
+ }
2438
+ })(Je)), Je;
2439
+ }
2440
+ var et = {}, tt = {}, Qt;
2441
+ function Vr() {
2442
+ return Qt || (Qt = 1, (function(t) {
2443
+ Object.defineProperty(t, "__esModule", {
2444
+ value: !0
2445
+ }), Object.defineProperty(t, "workAsyncStorageInstance", {
2446
+ enumerable: !0,
2447
+ get: function() {
2448
+ return a;
2449
+ }
2450
+ });
2451
+ const a = (0, _t().createAsyncLocalStorage)();
2452
+ })(tt)), tt;
2453
+ }
2454
+ var Jt;
2455
+ function wn() {
2456
+ return Jt || (Jt = 1, (function(t) {
2457
+ Object.defineProperty(t, "__esModule", {
2458
+ value: !0
2459
+ }), Object.defineProperty(t, "workAsyncStorage", {
2460
+ enumerable: !0,
2461
+ get: function() {
2462
+ return e.workAsyncStorageInstance;
2463
+ }
2464
+ });
2465
+ const e = Vr();
2466
+ })(et)), et;
2467
+ }
2468
+ var nt = {}, Zt;
2469
+ function Qr() {
2470
+ return Zt || (Zt = 1, (function(t) {
2471
+ Object.defineProperty(t, "__esModule", {
2472
+ value: !0
2473
+ });
2474
+ function e(i, u) {
2475
+ for (var c in u) Object.defineProperty(i, c, {
2476
+ enumerable: !0,
2477
+ get: u[c]
2478
+ });
2479
+ }
2480
+ e(t, {
2481
+ METADATA_BOUNDARY_NAME: function() {
2482
+ return a;
2483
+ },
2484
+ OUTLET_BOUNDARY_NAME: function() {
2485
+ return r;
2486
+ },
2487
+ ROOT_LAYOUT_BOUNDARY_NAME: function() {
2488
+ return o;
2489
+ },
2490
+ VIEWPORT_BOUNDARY_NAME: function() {
2491
+ return n;
2492
+ }
2493
+ });
2494
+ const a = "__next_metadata_boundary__", n = "__next_viewport_boundary__", r = "__next_outlet_boundary__", o = "__next_root_layout_boundary__";
2495
+ })(nt)), nt;
2496
+ }
2497
+ var rt = {}, $t;
2498
+ function Jr() {
2499
+ return $t || ($t = 1, (function(t) {
2500
+ Object.defineProperty(t, "__esModule", {
2501
+ value: !0
2502
+ });
2503
+ function e(i, u) {
2504
+ for (var c in u) Object.defineProperty(i, c, {
2505
+ enumerable: !0,
2506
+ get: u[c]
2507
+ });
2508
+ }
2509
+ e(t, {
2510
+ atLeastOneTask: function() {
2511
+ return r;
2512
+ },
2513
+ scheduleImmediate: function() {
2514
+ return n;
2515
+ },
2516
+ scheduleOnNextTick: function() {
2517
+ return a;
2518
+ },
2519
+ waitAtLeastOneReactRenderTask: function() {
2520
+ return o;
2521
+ }
2522
+ });
2523
+ const a = (i) => {
2524
+ Promise.resolve().then(() => {
2525
+ process.env.NEXT_RUNTIME === "edge" ? setTimeout(i, 0) : process.nextTick(i);
2526
+ });
2527
+ }, n = (i) => {
2528
+ process.env.NEXT_RUNTIME === "edge" ? setTimeout(i, 0) : setImmediate(i);
2529
+ };
2530
+ function r() {
2531
+ return new Promise((i) => n(i));
2532
+ }
2533
+ function o() {
2534
+ return process.env.NEXT_RUNTIME === "edge" ? new Promise((i) => setTimeout(i, 0)) : new Promise((i) => setImmediate(i));
2535
+ }
2536
+ })(rt)), rt;
2537
+ }
2538
+ var en;
2539
+ function Dn() {
2540
+ return en || (en = 1, (function(t) {
2541
+ Object.defineProperty(t, "__esModule", {
2542
+ value: !0
2543
+ });
2544
+ function e(l, m) {
2545
+ for (var R in m) Object.defineProperty(l, R, {
2546
+ enumerable: !0,
2547
+ get: m[R]
2548
+ });
2549
+ }
2550
+ e(t, {
2551
+ Postpone: function() {
2552
+ return I;
2553
+ },
2554
+ PreludeState: function() {
2555
+ return jn;
2556
+ },
2557
+ abortAndThrowOnSynchronousRequestDataAccess: function() {
2558
+ return f;
2559
+ },
2560
+ abortOnSynchronousPlatformIOAccess: function() {
2561
+ return A;
2562
+ },
2563
+ accessedDynamicData: function() {
2564
+ return B;
2565
+ },
2566
+ annotateDynamicAccess: function() {
2567
+ return ne;
2568
+ },
2569
+ consumeDynamicAccess: function() {
2570
+ return Z;
2571
+ },
2572
+ createDynamicTrackingState: function() {
2573
+ return D;
2574
+ },
2575
+ createDynamicValidationState: function() {
2576
+ return g;
2577
+ },
2578
+ createHangingInputAbortSignal: function() {
2579
+ return K;
2580
+ },
2581
+ createRenderInBrowserAbortSignal: function() {
2582
+ return je;
2583
+ },
2584
+ delayUntilRuntimeStage: function() {
2585
+ return Ln;
2586
+ },
2587
+ formatDynamicAPIAccesses: function() {
2588
+ return Y;
2589
+ },
2590
+ getFirstDynamicReason: function() {
2591
+ return y;
2592
+ },
2593
+ isDynamicPostpone: function() {
2594
+ return P;
2595
+ },
2596
+ isPrerenderInterruptedError: function() {
2597
+ return k;
2598
+ },
2599
+ logDisallowedDynamicError: function() {
2600
+ return Le;
2601
+ },
2602
+ markCurrentScopeAsDynamic: function() {
2603
+ return d;
2604
+ },
2605
+ postponeWithTracking: function() {
2606
+ return j;
2607
+ },
2608
+ throwIfDisallowedDynamic: function() {
2609
+ return Nn;
2610
+ },
2611
+ throwToInterruptStaticGeneration: function() {
2612
+ return p;
2613
+ },
2614
+ trackAllowedDynamicAccess: function() {
2615
+ return oe;
2616
+ },
2617
+ trackDynamicDataInDynamicRender: function() {
2618
+ return E;
2619
+ },
2620
+ trackSynchronousPlatformIOAccessInDev: function() {
2621
+ return O;
2622
+ },
2623
+ trackSynchronousRequestDataAccessInDev: function() {
2624
+ return L;
2625
+ },
2626
+ useDynamicRouteParams: function() {
2627
+ return x;
2628
+ },
2629
+ warnOnSyncDynamicError: function() {
2630
+ return T;
2631
+ }
2632
+ });
2633
+ const a = /* @__PURE__ */ S(J), n = An(), r = zr(), o = Sn(), i = wn(), u = On(), c = Qr(), s = Jr(), v = De(), b = Pn();
2634
+ function S(l) {
2635
+ return l && l.__esModule ? l : {
2636
+ default: l
2637
+ };
2638
+ }
2639
+ const w = typeof a.default.unstable_postpone == "function";
2640
+ function D(l) {
2641
+ return {
2642
+ isDebugDynamicAccesses: l,
2643
+ dynamicAccesses: [],
2644
+ syncDynamicErrorWithStack: null
2645
+ };
2646
+ }
2647
+ function g() {
2648
+ return {
2649
+ hasSuspenseAboveBody: !1,
2650
+ hasDynamicMetadata: !1,
2651
+ hasDynamicViewport: !1,
2652
+ hasAllowedDynamic: !1,
2653
+ dynamicErrors: []
2654
+ };
2655
+ }
2656
+ function y(l) {
2657
+ var m;
2658
+ return (m = l.dynamicAccesses[0]) == null ? void 0 : m.expression;
2659
+ }
2660
+ function d(l, m, R) {
2661
+ if (m)
2662
+ switch (m.type) {
2663
+ case "cache":
2664
+ case "unstable-cache":
2665
+ return;
2666
+ case "private-cache":
2667
+ return;
2668
+ }
2669
+ if (!(l.forceDynamic || l.forceStatic)) {
2670
+ if (l.dynamicShouldError)
2671
+ throw Object.defineProperty(new r.StaticGenBailoutError(`Route ${l.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`${R}\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`), "__NEXT_ERROR_CODE", {
2672
+ value: "E553",
2673
+ enumerable: !1,
2674
+ configurable: !0
2675
+ });
2676
+ if (m)
2677
+ switch (m.type) {
2678
+ case "prerender-ppr":
2679
+ return j(l.route, R, m.dynamicTracking);
2680
+ case "prerender-legacy":
2681
+ m.revalidate = 0;
2682
+ const N = Object.defineProperty(new n.DynamicServerError(`Route ${l.route} couldn't be rendered statically because it used ${R}. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`), "__NEXT_ERROR_CODE", {
2683
+ value: "E550",
2684
+ enumerable: !1,
2685
+ configurable: !0
2686
+ });
2687
+ throw l.dynamicUsageDescription = R, l.dynamicUsageStack = N.stack, N;
2688
+ case "request":
2689
+ process.env.NODE_ENV !== "production" && (m.usedDynamic = !0);
2690
+ break;
2691
+ }
2692
+ }
2693
+ }
2694
+ function p(l, m, R) {
2695
+ const N = Object.defineProperty(new n.DynamicServerError(`Route ${m.route} couldn't be rendered statically because it used \`${l}\`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`), "__NEXT_ERROR_CODE", {
2696
+ value: "E558",
2697
+ enumerable: !1,
2698
+ configurable: !0
2699
+ });
2700
+ throw R.revalidate = 0, m.dynamicUsageDescription = l, m.dynamicUsageStack = N.stack, N;
2701
+ }
2702
+ function E(l) {
2703
+ switch (l.type) {
2704
+ case "cache":
2705
+ case "unstable-cache":
2706
+ return;
2707
+ case "private-cache":
2708
+ return;
2709
+ case "prerender":
2710
+ case "prerender-runtime":
2711
+ case "prerender-legacy":
2712
+ case "prerender-ppr":
2713
+ case "prerender-client":
2714
+ break;
2715
+ case "request":
2716
+ process.env.NODE_ENV !== "production" && (l.usedDynamic = !0);
2717
+ break;
2718
+ }
2719
+ }
2720
+ function h(l, m, R) {
2721
+ const N = `Route ${l} needs to bail out of prerendering at this point because it used ${m}.`, F = U(N);
2722
+ R.controller.abort(F);
2723
+ const q = R.dynamicTracking;
2724
+ q && q.dynamicAccesses.push({
2725
+ // When we aren't debugging, we don't need to create another error for the
2726
+ // stack trace.
2727
+ stack: q.isDebugDynamicAccesses ? new Error().stack : void 0,
2728
+ expression: m
2729
+ });
2730
+ }
2731
+ function A(l, m, R, N) {
2732
+ const F = N.dynamicTracking;
2733
+ h(l, m, N), F && F.syncDynamicErrorWithStack === null && (F.syncDynamicErrorWithStack = R);
2734
+ }
2735
+ function O(l) {
2736
+ l.prerenderPhase = !1;
2737
+ }
2738
+ function f(l, m, R, N) {
2739
+ if (N.controller.signal.aborted === !1) {
2740
+ h(l, m, N);
2741
+ const q = N.dynamicTracking;
2742
+ q && q.syncDynamicErrorWithStack === null && (q.syncDynamicErrorWithStack = R);
2743
+ }
2744
+ throw U(`Route ${l} needs to bail out of prerendering at this point because it used ${m}.`);
2745
+ }
2746
+ function T(l) {
2747
+ l.syncDynamicErrorWithStack && console.error(l.syncDynamicErrorWithStack);
2748
+ }
2749
+ const L = O;
2750
+ function I({ reason: l, route: m }) {
2751
+ const R = o.workUnitAsyncStorage.getStore(), N = R && R.type === "prerender-ppr" ? R.dynamicTracking : null;
2752
+ j(m, l, N);
2753
+ }
2754
+ function j(l, m, R) {
2755
+ Ce(), R && R.dynamicAccesses.push({
2756
+ // When we aren't debugging, we don't need to create another error for the
2757
+ // stack trace.
2758
+ stack: R.isDebugDynamicAccesses ? new Error().stack : void 0,
2759
+ expression: m
2760
+ }), a.default.unstable_postpone(_(l, m));
2761
+ }
2762
+ function _(l, m) {
2763
+ return `Route ${l} needs to bail out of prerendering at this point because it used ${m}. React throws this special object to indicate where. It should not be caught by your own try/catch. Learn more: https://nextjs.org/docs/messages/ppr-caught-error`;
2764
+ }
2765
+ function P(l) {
2766
+ return typeof l == "object" && l !== null && typeof l.message == "string" ? C(l.message) : !1;
2767
+ }
2768
+ function C(l) {
2769
+ return l.includes("needs to bail out of prerendering at this point because it used") && l.includes("Learn more: https://nextjs.org/docs/messages/ppr-caught-error");
2770
+ }
2771
+ if (C(_("%%%", "^^^")) === !1)
2772
+ throw Object.defineProperty(new Error("Invariant: isDynamicPostpone misidentified a postpone reason. This is a bug in Next.js"), "__NEXT_ERROR_CODE", {
2773
+ value: "E296",
2774
+ enumerable: !1,
2775
+ configurable: !0
2776
+ });
2777
+ const M = "NEXT_PRERENDER_INTERRUPTED";
2778
+ function U(l) {
2779
+ const m = Object.defineProperty(new Error(l), "__NEXT_ERROR_CODE", {
2780
+ value: "E394",
2781
+ enumerable: !1,
2782
+ configurable: !0
2783
+ });
2784
+ return m.digest = M, m;
2785
+ }
2786
+ function k(l) {
2787
+ return typeof l == "object" && l !== null && l.digest === M && "name" in l && "message" in l && l instanceof Error;
2788
+ }
2789
+ function B(l) {
2790
+ return l.length > 0;
2791
+ }
2792
+ function Z(l, m) {
2793
+ return l.dynamicAccesses.push(...m.dynamicAccesses), l.dynamicAccesses;
2794
+ }
2795
+ function Y(l) {
2796
+ return l.filter((m) => typeof m.stack == "string" && m.stack.length > 0).map(({ expression: m, stack: R }) => (R = R.split(`
2797
+ `).slice(4).filter((N) => !(N.includes("node_modules/next/") || N.includes(" (<anonymous>)") || N.includes(" (node:"))).join(`
2798
+ `), `Dynamic API Usage Debug - ${m}:
2799
+ ${R}`));
2800
+ }
2801
+ function Ce() {
2802
+ if (!w)
2803
+ throw Object.defineProperty(new Error("Invariant: React.unstable_postpone is not defined. This suggests the wrong version of React was loaded. This is a bug in Next.js"), "__NEXT_ERROR_CODE", {
2804
+ value: "E224",
2805
+ enumerable: !1,
2806
+ configurable: !0
2807
+ });
2808
+ }
2809
+ function je() {
2810
+ const l = new AbortController();
2811
+ return l.abort(Object.defineProperty(new v.BailoutToCSRError("Render in Browser"), "__NEXT_ERROR_CODE", {
2812
+ value: "E721",
2813
+ enumerable: !1,
2814
+ configurable: !0
2815
+ })), l.signal;
2816
+ }
2817
+ function K(l) {
2818
+ switch (l.type) {
2819
+ case "prerender":
2820
+ case "prerender-runtime":
2821
+ const m = new AbortController();
2822
+ if (l.cacheSignal)
2823
+ l.cacheSignal.inputReady().then(() => {
2824
+ m.abort();
2825
+ });
2826
+ else {
2827
+ const R = (0, o.getRuntimeStagePromise)(l);
2828
+ R ? R.then(() => (0, s.scheduleOnNextTick)(() => m.abort())) : (0, s.scheduleOnNextTick)(() => m.abort());
2829
+ }
2830
+ return m.signal;
2831
+ case "prerender-client":
2832
+ case "prerender-ppr":
2833
+ case "prerender-legacy":
2834
+ case "request":
2835
+ case "cache":
2836
+ case "private-cache":
2837
+ case "unstable-cache":
2838
+ return;
2839
+ }
2840
+ }
2841
+ function ne(l, m) {
2842
+ const R = m.dynamicTracking;
2843
+ R && R.dynamicAccesses.push({
2844
+ stack: R.isDebugDynamicAccesses ? new Error().stack : void 0,
2845
+ expression: l
2846
+ });
2847
+ }
2848
+ function x(l) {
2849
+ const m = i.workAsyncStorage.getStore(), R = o.workUnitAsyncStorage.getStore();
2850
+ if (m && R)
2851
+ switch (R.type) {
2852
+ case "prerender-client":
2853
+ case "prerender": {
2854
+ const N = R.fallbackRouteParams;
2855
+ N && N.size > 0 && a.default.use((0, u.makeHangingPromise)(R.renderSignal, m.route, l));
2856
+ break;
2857
+ }
2858
+ case "prerender-ppr": {
2859
+ const N = R.fallbackRouteParams;
2860
+ if (N && N.size > 0)
2861
+ return j(m.route, l, R.dynamicTracking);
2862
+ break;
2863
+ }
2864
+ case "prerender-runtime":
2865
+ throw Object.defineProperty(new b.InvariantError(`\`${l}\` was called during a runtime prerender. Next.js should be preventing ${l} from being included in server components statically, but did not in this case.`), "__NEXT_ERROR_CODE", {
2866
+ value: "E771",
2867
+ enumerable: !1,
2868
+ configurable: !0
2869
+ });
2870
+ case "cache":
2871
+ case "private-cache":
2872
+ throw Object.defineProperty(new b.InvariantError(`\`${l}\` was called inside a cache scope. Next.js should be preventing ${l} from being included in server components statically, but did not in this case.`), "__NEXT_ERROR_CODE", {
2873
+ value: "E745",
2874
+ enumerable: !1,
2875
+ configurable: !0
2876
+ });
2877
+ }
2878
+ }
2879
+ const V = /\n\s+at Suspense \(<anonymous>\)/, re = "body|div|main|section|article|aside|header|footer|nav|form|p|span|h1|h2|h3|h4|h5|h6", ae = new RegExp(`\\n\\s+at Suspense \\(<anonymous>\\)(?:(?!\\n\\s+at (?:${re}) \\(<anonymous>\\))[\\s\\S])*?\\n\\s+at ${c.ROOT_LAYOUT_BOUNDARY_NAME} \\([^\\n]*\\)`), G = new RegExp(`\\n\\s+at ${c.METADATA_BOUNDARY_NAME}[\\n\\s]`), Ne = new RegExp(`\\n\\s+at ${c.VIEWPORT_BOUNDARY_NAME}[\\n\\s]`), $ = new RegExp(`\\n\\s+at ${c.OUTLET_BOUNDARY_NAME}[\\n\\s]`);
2880
+ function oe(l, m, R, N) {
2881
+ if (!$.test(m))
2882
+ if (G.test(m)) {
2883
+ R.hasDynamicMetadata = !0;
2884
+ return;
2885
+ } else if (Ne.test(m)) {
2886
+ R.hasDynamicViewport = !0;
2887
+ return;
2888
+ } else if (ae.test(m)) {
2889
+ R.hasAllowedDynamic = !0, R.hasSuspenseAboveBody = !0;
2890
+ return;
2891
+ } else if (V.test(m)) {
2892
+ R.hasAllowedDynamic = !0;
2893
+ return;
2894
+ } else if (N.syncDynamicErrorWithStack) {
2895
+ R.dynamicErrors.push(N.syncDynamicErrorWithStack);
2896
+ return;
2897
+ } else {
2898
+ const F = `Route "${l.route}": A component accessed data, headers, params, searchParams, or a short-lived cache without a Suspense boundary nor a "use cache" above it. See more info: https://nextjs.org/docs/messages/next-prerender-missing-suspense`, q = Cn(F, m);
2899
+ R.dynamicErrors.push(q);
2900
+ return;
2901
+ }
2902
+ }
2903
+ function Cn(l, m) {
2904
+ const R = process.env.NODE_ENV !== "production" && a.default.captureOwnerStack ? a.default.captureOwnerStack() : null, N = Object.defineProperty(new Error(l), "__NEXT_ERROR_CODE", {
2905
+ value: "E394",
2906
+ enumerable: !1,
2907
+ configurable: !0
2908
+ });
2909
+ return N.stack = N.name + ": " + l + (R ?? m), N;
2910
+ }
2911
+ var jn = /* @__PURE__ */ (function(l) {
2912
+ return l[l.Full = 0] = "Full", l[l.Empty = 1] = "Empty", l[l.Errored = 2] = "Errored", l;
2913
+ })({});
2914
+ function Le(l, m) {
2915
+ console.error(m), l.dev || (l.hasReadableErrorStacks ? console.error(`To get a more detailed stack trace and pinpoint the issue, start the app in development mode by running \`next dev\`, then open "${l.route}" in your browser to investigate the error.`) : console.error(`To get a more detailed stack trace and pinpoint the issue, try one of the following:
2916
+ - Start the app in development mode by running \`next dev\`, then open "${l.route}" in your browser to investigate the error.
2917
+ - Rerun the production build with \`next build --debug-prerender\` to generate better stack traces.`));
2918
+ }
2919
+ function Nn(l, m, R, N) {
2920
+ if (m !== 0) {
2921
+ if (R.hasSuspenseAboveBody)
2922
+ return;
2923
+ if (N.syncDynamicErrorWithStack)
2924
+ throw Le(l, N.syncDynamicErrorWithStack), new r.StaticGenBailoutError();
2925
+ const F = R.dynamicErrors;
2926
+ if (F.length > 0) {
2927
+ for (let q = 0; q < F.length; q++)
2928
+ Le(l, F[q]);
2929
+ throw new r.StaticGenBailoutError();
2930
+ }
2931
+ if (R.hasDynamicViewport)
2932
+ throw console.error(`Route "${l.route}" has a \`generateViewport\` that depends on Request data (\`cookies()\`, etc...) or uncached external data (\`fetch(...)\`, etc...) without explicitly allowing fully dynamic rendering. See more info here: https://nextjs.org/docs/messages/next-prerender-dynamic-viewport`), new r.StaticGenBailoutError();
2933
+ if (m === 1)
2934
+ throw console.error(`Route "${l.route}" did not produce a static shell and Next.js was unable to determine a reason. This is a bug in Next.js.`), new r.StaticGenBailoutError();
2935
+ } else if (R.hasAllowedDynamic === !1 && R.hasDynamicMetadata)
2936
+ throw console.error(`Route "${l.route}" has a \`generateMetadata\` that depends on Request data (\`cookies()\`, etc...) or uncached external data (\`fetch(...)\`, etc...) when the rest of the route does not. See more info here: https://nextjs.org/docs/messages/next-prerender-dynamic-metadata`), new r.StaticGenBailoutError();
2937
+ }
2938
+ function Ln(l, m) {
2939
+ return l.runtimeStagePromise ? l.runtimeStagePromise.then(() => m) : m;
2940
+ }
2941
+ })(Qe)), Qe;
2942
+ }
2943
+ var tn;
2944
+ function Zr() {
2945
+ return tn || (tn = 1, (function(t, e) {
2946
+ Object.defineProperty(e, "__esModule", {
2947
+ value: !0
2948
+ }), Object.defineProperty(e, "unstable_rethrow", {
2949
+ enumerable: !0,
2950
+ get: function() {
2951
+ return c;
2952
+ }
2953
+ });
2954
+ const a = On(), n = Wr(), r = De(), o = Tn(), i = Dn(), u = An();
2955
+ function c(s) {
2956
+ if ((0, o.isNextRouterError)(s) || (0, r.isBailoutToCSRError)(s) || (0, u.isDynamicServerError)(s) || (0, i.isDynamicPostpone)(s) || (0, n.isPostpone)(s) || (0, a.isHangingPromiseRejectionError)(s))
2957
+ throw s;
2958
+ s instanceof Error && "cause" in s && c(s.cause);
2959
+ }
2960
+ (typeof e.default == "function" || typeof e.default == "object" && e.default !== null) && typeof e.default.__esModule > "u" && (Object.defineProperty(e.default, "__esModule", { value: !0 }), Object.assign(e.default, e), t.exports = e.default);
2961
+ })(ye, ye.exports)), ye.exports;
2962
+ }
2963
+ var Oe = { exports: {} }, nn;
2964
+ function $r() {
2965
+ return nn || (nn = 1, (function(t, e) {
2966
+ Object.defineProperty(e, "__esModule", {
2967
+ value: !0
2968
+ }), Object.defineProperty(e, "unstable_rethrow", {
2969
+ enumerable: !0,
2970
+ get: function() {
2971
+ return r;
2972
+ }
2973
+ });
2974
+ const a = De(), n = Tn();
2975
+ function r(o) {
2976
+ if ((0, n.isNextRouterError)(o) || (0, a.isBailoutToCSRError)(o))
2977
+ throw o;
2978
+ o instanceof Error && "cause" in o && r(o.cause);
2979
+ }
2980
+ (typeof e.default == "function" || typeof e.default == "object" && e.default !== null) && typeof e.default.__esModule > "u" && (Object.defineProperty(e.default, "__esModule", { value: !0 }), Object.assign(e.default, e), t.exports = e.default);
2981
+ })(Oe, Oe.exports)), Oe.exports;
2982
+ }
2983
+ var rn;
2984
+ function ea() {
2985
+ return rn || (rn = 1, (function(t, e) {
2986
+ Object.defineProperty(e, "__esModule", {
2987
+ value: !0
2988
+ }), Object.defineProperty(e, "unstable_rethrow", {
2989
+ enumerable: !0,
2990
+ get: function() {
2991
+ return a;
2992
+ }
2993
+ });
2994
+ const a = typeof window > "u" ? Zr().unstable_rethrow : $r().unstable_rethrow;
2995
+ (typeof e.default == "function" || typeof e.default == "object" && e.default !== null) && typeof e.default.__esModule > "u" && (Object.defineProperty(e.default, "__esModule", { value: !0 }), Object.assign(e.default, e), t.exports = e.default);
2996
+ })(Ee, Ee.exports)), Ee.exports;
2997
+ }
2998
+ var an;
2999
+ function ta() {
3000
+ return an || (an = 1, (function(t, e) {
3001
+ Object.defineProperty(e, "__esModule", {
3002
+ value: !0
3003
+ });
3004
+ function a(S, w) {
3005
+ for (var D in w) Object.defineProperty(S, D, {
3006
+ enumerable: !0,
3007
+ get: w[D]
3008
+ });
3009
+ }
3010
+ a(e, {
3011
+ ReadonlyURLSearchParams: function() {
3012
+ return v;
3013
+ },
3014
+ RedirectType: function() {
3015
+ return r.RedirectType;
3016
+ },
3017
+ forbidden: function() {
3018
+ return i.forbidden;
3019
+ },
3020
+ notFound: function() {
3021
+ return o.notFound;
3022
+ },
3023
+ permanentRedirect: function() {
3024
+ return n.permanentRedirect;
3025
+ },
3026
+ redirect: function() {
3027
+ return n.redirect;
3028
+ },
3029
+ unauthorized: function() {
3030
+ return u.unauthorized;
3031
+ },
3032
+ unstable_isUnrecognizedActionError: function() {
3033
+ return b;
3034
+ },
3035
+ unstable_rethrow: function() {
3036
+ return c.unstable_rethrow;
3037
+ }
3038
+ });
3039
+ const n = Hr(), r = pt(), o = Br(), i = Xr(), u = Gr(), c = ea();
3040
+ class s extends Error {
3041
+ constructor() {
3042
+ super("Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams");
3043
+ }
3044
+ }
3045
+ class v extends URLSearchParams {
3046
+ /** @deprecated Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams */
3047
+ append() {
3048
+ throw new s();
3049
+ }
3050
+ /** @deprecated Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams */
3051
+ delete() {
3052
+ throw new s();
3053
+ }
3054
+ /** @deprecated Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams */
3055
+ set() {
3056
+ throw new s();
3057
+ }
3058
+ /** @deprecated Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams */
3059
+ sort() {
3060
+ throw new s();
3061
+ }
3062
+ }
3063
+ function b() {
3064
+ throw Object.defineProperty(new Error("`unstable_isUnrecognizedActionError` can only be used on the client."), "__NEXT_ERROR_CODE", {
3065
+ value: "E776",
3066
+ enumerable: !1,
3067
+ configurable: !0
3068
+ });
3069
+ }
3070
+ (typeof e.default == "function" || typeof e.default == "object" && e.default !== null) && typeof e.default.__esModule > "u" && (Object.defineProperty(e.default, "__esModule", { value: !0 }), Object.assign(e.default, e), t.exports = e.default);
3071
+ })(ce, ce.exports)), ce.exports;
3072
+ }
3073
+ var at = {}, ot = {}, on;
3074
+ function na() {
3075
+ if (on) return ot;
3076
+ on = 1;
3077
+ function t(a) {
3078
+ if (typeof WeakMap != "function") return null;
3079
+ var n = /* @__PURE__ */ new WeakMap(), r = /* @__PURE__ */ new WeakMap();
3080
+ return (t = function(o) {
3081
+ return o ? r : n;
3082
+ })(a);
3083
+ }
3084
+ function e(a, n) {
3085
+ if (!n && a && a.__esModule) return a;
3086
+ if (a === null || typeof a != "object" && typeof a != "function") return { default: a };
3087
+ var r = t(n);
3088
+ if (r && r.has(a)) return r.get(a);
3089
+ var o = { __proto__: null }, i = Object.defineProperty && Object.getOwnPropertyDescriptor;
3090
+ for (var u in a)
3091
+ if (u !== "default" && Object.prototype.hasOwnProperty.call(a, u)) {
3092
+ var c = i ? Object.getOwnPropertyDescriptor(a, u) : null;
3093
+ c && (c.get || c.set) ? Object.defineProperty(o, u, c) : o[u] = a[u];
3094
+ }
3095
+ return o.default = a, r && r.set(a, o), o;
3096
+ }
3097
+ return ot._ = e, ot;
3098
+ }
3099
+ var un;
3100
+ function ra() {
3101
+ return un || (un = 1, (function(t) {
3102
+ "use client";
3103
+ Object.defineProperty(t, "__esModule", {
3104
+ value: !0
3105
+ });
3106
+ function e(i, u) {
3107
+ for (var c in u) Object.defineProperty(i, c, {
3108
+ enumerable: !0,
3109
+ get: u[c]
3110
+ });
3111
+ }
3112
+ e(t, {
3113
+ ServerInsertedHTMLContext: function() {
3114
+ return r;
3115
+ },
3116
+ useServerInsertedHTML: function() {
3117
+ return o;
3118
+ }
3119
+ });
3120
+ const n = /* @__PURE__ */ (/* @__PURE__ */ na())._(J), r = /* @__PURE__ */ n.default.createContext(null);
3121
+ function o(i) {
3122
+ const u = (0, n.useContext)(r);
3123
+ u && u(i);
3124
+ }
3125
+ })(at)), at;
3126
+ }
3127
+ var Te = { exports: {} }, sn;
3128
+ function aa() {
3129
+ return sn || (sn = 1, (function(t, e) {
3130
+ Object.defineProperty(e, "__esModule", {
3131
+ value: !0
3132
+ });
3133
+ function a(o, i) {
3134
+ for (var u in i) Object.defineProperty(o, u, {
3135
+ enumerable: !0,
3136
+ get: i[u]
3137
+ });
3138
+ }
3139
+ a(e, {
3140
+ UnrecognizedActionError: function() {
3141
+ return n;
3142
+ },
3143
+ unstable_isUnrecognizedActionError: function() {
3144
+ return r;
3145
+ }
3146
+ });
3147
+ class n extends Error {
3148
+ constructor(...i) {
3149
+ super(...i), this.name = "UnrecognizedActionError";
3150
+ }
3151
+ }
3152
+ function r(o) {
3153
+ return !!(o && typeof o == "object" && o instanceof n);
3154
+ }
3155
+ (typeof e.default == "function" || typeof e.default == "object" && e.default !== null) && typeof e.default.__esModule > "u" && (Object.defineProperty(e.default, "__esModule", { value: !0 }), Object.assign(e.default, e), t.exports = e.default);
3156
+ })(Te, Te.exports)), Te.exports;
3157
+ }
3158
+ var Ae = { exports: {} }, cn;
3159
+ function oa() {
3160
+ return cn || (cn = 1, (function(t, e) {
3161
+ Object.defineProperty(e, "__esModule", {
3162
+ value: !0
3163
+ }), Object.defineProperty(e, "bailoutToClientRendering", {
3164
+ enumerable: !0,
3165
+ get: function() {
3166
+ return o;
3167
+ }
3168
+ });
3169
+ const a = De(), n = wn(), r = Sn();
3170
+ function o(i) {
3171
+ const u = n.workAsyncStorage.getStore();
3172
+ if (u != null && u.forceStatic) return;
3173
+ const c = r.workUnitAsyncStorage.getStore();
3174
+ if (c)
3175
+ switch (c.type) {
3176
+ case "prerender":
3177
+ case "prerender-runtime":
3178
+ case "prerender-client":
3179
+ case "prerender-ppr":
3180
+ case "prerender-legacy":
3181
+ throw Object.defineProperty(new a.BailoutToCSRError(i), "__NEXT_ERROR_CODE", {
3182
+ value: "E394",
3183
+ enumerable: !1,
3184
+ configurable: !0
3185
+ });
3186
+ }
3187
+ }
3188
+ (typeof e.default == "function" || typeof e.default == "object" && e.default !== null) && typeof e.default.__esModule > "u" && (Object.defineProperty(e.default, "__esModule", { value: !0 }), Object.assign(e.default, e), t.exports = e.default);
3189
+ })(Ae, Ae.exports)), Ae.exports;
3190
+ }
3191
+ var ln;
3192
+ function ia() {
3193
+ return ln || (ln = 1, (function(t, e) {
3194
+ Object.defineProperty(e, "__esModule", {
3195
+ value: !0
3196
+ });
3197
+ function a(E, h) {
3198
+ for (var A in h) Object.defineProperty(E, A, {
3199
+ enumerable: !0,
3200
+ get: h[A]
3201
+ });
3202
+ }
3203
+ a(e, {
3204
+ ReadonlyURLSearchParams: function() {
3205
+ return c.ReadonlyURLSearchParams;
3206
+ },
3207
+ RedirectType: function() {
3208
+ return c.RedirectType;
3209
+ },
3210
+ ServerInsertedHTMLContext: function() {
3211
+ return s.ServerInsertedHTMLContext;
3212
+ },
3213
+ forbidden: function() {
3214
+ return c.forbidden;
3215
+ },
3216
+ notFound: function() {
3217
+ return c.notFound;
3218
+ },
3219
+ permanentRedirect: function() {
3220
+ return c.permanentRedirect;
3221
+ },
3222
+ redirect: function() {
3223
+ return c.redirect;
3224
+ },
3225
+ unauthorized: function() {
3226
+ return c.unauthorized;
3227
+ },
3228
+ unstable_isUnrecognizedActionError: function() {
3229
+ return v.unstable_isUnrecognizedActionError;
3230
+ },
3231
+ unstable_rethrow: function() {
3232
+ return c.unstable_rethrow;
3233
+ },
3234
+ useParams: function() {
3235
+ return g;
3236
+ },
3237
+ usePathname: function() {
3238
+ return w;
3239
+ },
3240
+ useRouter: function() {
3241
+ return D;
3242
+ },
3243
+ useSearchParams: function() {
3244
+ return S;
3245
+ },
3246
+ useSelectedLayoutSegment: function() {
3247
+ return p;
3248
+ },
3249
+ useSelectedLayoutSegments: function() {
3250
+ return d;
3251
+ },
3252
+ useServerInsertedHTML: function() {
3253
+ return s.useServerInsertedHTML;
3254
+ }
3255
+ });
3256
+ const n = J, r = Mr(), o = kr(), i = xr(), u = Ur(), c = ta(), s = ra(), v = aa(), b = typeof window > "u" ? Dn().useDynamicRouteParams : void 0;
3257
+ function S() {
3258
+ const E = (0, n.useContext)(o.SearchParamsContext), h = (0, n.useMemo)(() => E ? new c.ReadonlyURLSearchParams(E) : null, [
3259
+ E
3260
+ ]);
3261
+ if (typeof window > "u") {
3262
+ const { bailoutToClientRendering: A } = oa();
3263
+ A("useSearchParams()");
3264
+ }
3265
+ return h;
3266
+ }
3267
+ function w() {
3268
+ return b == null || b("usePathname()"), (0, n.useContext)(o.PathnameContext);
3269
+ }
3270
+ function D() {
3271
+ const E = (0, n.useContext)(r.AppRouterContext);
3272
+ if (E === null)
3273
+ throw Object.defineProperty(new Error("invariant expected app router to be mounted"), "__NEXT_ERROR_CODE", {
3274
+ value: "E238",
3275
+ enumerable: !1,
3276
+ configurable: !0
3277
+ });
3278
+ return E;
3279
+ }
3280
+ function g() {
3281
+ return b == null || b("useParams()"), (0, n.useContext)(o.PathParamsContext);
3282
+ }
3283
+ function y(E, h, A, O) {
3284
+ A === void 0 && (A = !0), O === void 0 && (O = []);
3285
+ let f;
3286
+ if (A)
3287
+ f = E[1][h];
3288
+ else {
3289
+ const j = E[1];
3290
+ var T;
3291
+ f = (T = j.children) != null ? T : Object.values(j)[0];
3292
+ }
3293
+ if (!f) return O;
3294
+ const L = f[0];
3295
+ let I = (0, i.getSegmentValue)(L);
3296
+ return !I || I.startsWith(u.PAGE_SEGMENT_KEY) ? O : (O.push(I), y(f, h, !1, O));
3297
+ }
3298
+ function d(E) {
3299
+ E === void 0 && (E = "children"), b == null || b("useSelectedLayoutSegments()");
3300
+ const h = (0, n.useContext)(r.LayoutRouterContext);
3301
+ return h ? y(h.parentTree, E) : null;
3302
+ }
3303
+ function p(E) {
3304
+ E === void 0 && (E = "children"), b == null || b("useSelectedLayoutSegment()");
3305
+ const h = d(E);
3306
+ if (!h || h.length === 0)
3307
+ return null;
3308
+ const A = E === "children" ? h[0] : h[h.length - 1];
3309
+ return A === u.DEFAULT_SEGMENT_KEY ? null : A;
3310
+ }
3311
+ (typeof e.default == "function" || typeof e.default == "object" && e.default !== null) && typeof e.default.__esModule > "u" && (Object.defineProperty(e.default, "__esModule", { value: !0 }), Object.assign(e.default, e), t.exports = e.default);
3312
+ })(ue, ue.exports)), ue.exports;
3313
+ }
3314
+ var it, dn;
3315
+ function ua() {
3316
+ return dn || (dn = 1, it = ia()), it;
3317
+ }
3318
+ ua();
3319
+ function sa() {
3320
+ const t = process.env.NEXT_PUBLIC_TOLGEE_API_KEY, e = process.env.NEXT_PUBLIC_TOLGEE_API_URL;
3321
+ return Ar().use(dr()).use(Pr()).updateDefaults({
3322
+ apiKey: t,
3323
+ apiUrl: e
3324
+ });
3325
+ }
3326
+ sa().init();
3327
+ function da({ value: t, parentKey: e = "", params: a = {} }) {
3328
+ const { t: n } = Lr();
3329
+ return n(e + "." + t, a);
4
3330
  }
5
3331
  export {
6
- e as default
3332
+ da as default
7
3333
  };