@soma-vertical-web/multi-lib-sacurai 0.0.1 → 0.0.2

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.
@@ -0,0 +1,1924 @@
1
+ import { jsxs as ft, Fragment as Sr, jsx as $ } from "react/jsx-runtime";
2
+ import { Utils as wr } from "@soma-vertical-web/core-components";
3
+ const Ve = (t, e = !0) => Intl.NumberFormat("pt-BR", {
4
+ style: "currency",
5
+ currency: "BRL",
6
+ minimumFractionDigits: e ? 2 : 0
7
+ }).format(t), xr = ({ valueInCents: t, hasFree: e, freeTaxMessage: r }) => t === 0 ? e ? r : Ve(0) : Ve(t / 100), Ar = (t, e) => {
8
+ const n = (t - e) * 100 / t;
9
+ return Math.floor(n);
10
+ }, qt = (t, e) => {
11
+ const [r, n] = t.split(e);
12
+ return { name: r.trim(), size: n ? n.trim() : "" };
13
+ }, Or = (t, e) => {
14
+ if (!t)
15
+ return {};
16
+ const [r, n] = t.split(e);
17
+ return { color: r == null ? void 0 : r.trim(), size: n == null ? void 0 : n.trim() };
18
+ }, Er = (t, e = "tamanho") => {
19
+ if (t.additionalProperty) {
20
+ const [r] = t.additionalProperty;
21
+ return r != null && r.name ? r.name.toLocaleLowerCase() === e ? r.value : t.name : "";
22
+ }
23
+ return t.name;
24
+ }, Pr = (t, e) => t.replace(e, "").trim(), $r = (t) => t.replace(/\//g, ""), Ir = ({ items: t, NAME_SPLIT_SYMBOL: e }) => {
25
+ const r = {
26
+ price: 0,
27
+ listPrice: 0,
28
+ installments: {
29
+ count: 0,
30
+ value: 0
31
+ }
32
+ }, n = (i, f) => {
33
+ var u;
34
+ f && (f.sellerId = i.sellerId, f.sellerName = i.sellerName, f.available = !0, f.isSellerDefault = i.sellerDefault);
35
+ const {
36
+ Price: l,
37
+ ListPrice: s,
38
+ PaymentOptions: { installmentOptions: c }
39
+ } = i.commertialOffer;
40
+ r.price = l, r.listPrice = s;
41
+ const p = (u = c == null ? void 0 : c[0]) == null ? void 0 : u.installments;
42
+ if (p) {
43
+ const { count: v, value: y } = p[p.length - 1];
44
+ r.installments = {
45
+ count: v,
46
+ value: y / 100
47
+ };
48
+ }
49
+ };
50
+ let o = !0;
51
+ const a = t.reduce((i, f) => {
52
+ var c;
53
+ const l = {
54
+ name: f.name,
55
+ sku: f.itemId,
56
+ value: ((c = f.Tamanho) == null ? void 0 : c[0]) ?? qt(f.nameComplete ?? f.name, e).size,
57
+ available: !1,
58
+ sellerId: "",
59
+ sellerName: "",
60
+ isSellerDefault: !1
61
+ }, s = f.sellers.filter((p) => (p.sellerDefault && p.commertialOffer.IsAvailable && (l.available = !0, n(p, l)), p.commertialOffer.IsAvailable));
62
+ return !l.isSellerDefault && s.length > 0 && (l.available = !0, n(s[0], {
63
+ ...l,
64
+ sellerId: s[0].sellerId,
65
+ sellerName: s[0].sellerName
66
+ })), l.available === !1 && (o = !1), i.push(l), i;
67
+ }, []);
68
+ return {
69
+ ...r,
70
+ sizes: a,
71
+ allSizesAvailable: o
72
+ };
73
+ }, Rr = (t) => t ? !t.offers.offers.find(({ quantity: e = 0 }) => e > 0) : !1, kr = (t, e) => {
74
+ const r = t.find(
75
+ (n) => n.availability.includes("InStock") && n.quantity && n.listPrice > 0 && n.seller.identifier === e
76
+ );
77
+ return r || t.find(
78
+ (n) => n.availability.includes("InStock") && n.quantity && n.listPrice > 0
79
+ );
80
+ }, Cr = ({ images: t, TEXTURE_IMAGE: e }) => t.find((r) => e.includes(r.imageLabel)) ?? t[0], Tr = (t, e) => {
81
+ const r = /\/ids\/(\d+)\//, n = t.match(r);
82
+ return n ? t.replace(
83
+ `/${n[1]}/`,
84
+ `/${n[1]}-${e.width}-${e.height}/`
85
+ ) : t;
86
+ }, Fr = (t, e) => {
87
+ const r = /\/ids\/(\d+)-(\d+)-(\d+)\//, n = t.match(r);
88
+ return n ? t.replace(
89
+ `/${n[1]}-${n[2]}-${n[3]}/`,
90
+ `/${n[1]}-${e.width}-${e.height}/`
91
+ ) : t;
92
+ }, Dr = ({
93
+ images: t,
94
+ label: e
95
+ }) => {
96
+ const r = t.filter(
97
+ (n) => n.keywords === e.first || n.keywords === e.second || n.alternateName === e.first || n.alternateName === e.second
98
+ );
99
+ return r.length === 0 ? t.slice(0, 2) : r;
100
+ }, Nr = (t) => {
101
+ const [e, r] = t.split("/").map(Number);
102
+ if (Number.isNaN(e) || Number.isNaN(r))
103
+ throw new Error("[ERROR ASPECT RATIO IMAGE]: Invalid aspect ratio format");
104
+ return r / e;
105
+ }, Mr = (t, e, r) => {
106
+ e && (t ? (e.getAttribute("src") || (e.src = r ?? ""), e.play()) : e.pause());
107
+ }, xi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
108
+ __proto__: null,
109
+ disableSKU: Rr,
110
+ formatPriceToCurrency: Ve,
111
+ freightParsePrice: xr,
112
+ getAspectRatio: Nr,
113
+ getColorAndSizeFromSkuName: Or,
114
+ getDiscountPercent: Ar,
115
+ getFirstImages: Dr,
116
+ getProductNameWithoutSku: Pr,
117
+ getSKUName: Er,
118
+ getSkuInfos: Ir,
119
+ getThumbImage: Cr,
120
+ getValidOffer: kr,
121
+ removeSlashes: $r,
122
+ resizingImg: Tr,
123
+ setVideoPlay: Mr,
124
+ splitNameAndSizeFromFullName: qt,
125
+ updatedResizedImg: Fr
126
+ }, Symbol.toStringTag, { value: "Module" })), st = "fuzzy", ut = "operator", jr = (t) => ({
127
+ isDepartment: t != null && t.length ? t[0].key === "category-1" : !1
128
+ }), Ai = (t, e) => {
129
+ const r = decodeURIComponent(e ?? "").slice(1).split("/");
130
+ return t.map((n) => {
131
+ if (n.key === "category-2" && n.__typename === "FacetBoolean") {
132
+ const o = n.values;
133
+ return {
134
+ ...n,
135
+ values: o.filter(
136
+ (a) => !r.find(
137
+ (i) => i.toLowerCase() === a.value || i.toLowerCase() === a.name.toLowerCase()
138
+ )
139
+ )
140
+ };
141
+ }
142
+ return n;
143
+ });
144
+ }, zt = (t, e) => e ? t === "category-1" : !1, Br = (t) => t.key === "operator" && (t.value === "and" || t.value === "or"), Lr = (t) => t.type === "TEXT", Ur = (t) => t.key === "fuzzy" && (t.value === "0" || t.value === "1" || t.value === "auto"), qr = (t) => {
145
+ const { key: e, name: r, values: n } = t;
146
+ return {
147
+ __typename: "FacetBoolean",
148
+ key: e,
149
+ label: r,
150
+ values: n.slice().sort((o, a) => o.name.localeCompare(a.name))
151
+ };
152
+ }, zr = ({ key: t, values: e }) => ({
153
+ __typename: "FacetRange",
154
+ key: t,
155
+ values: e
156
+ }), Oi = (t, e, r) => {
157
+ if (!(t instanceof Object) || !("facets" in t))
158
+ return [];
159
+ const { facets: n = [] } = t, o = e != null && e.length ? e[0].key === "category-1" : !1;
160
+ return n.filter(
161
+ (i) => !r || !zt(i.key, o)
162
+ ).map(
163
+ (i) => Lr(i) ? qr(i) : zr(i)
164
+ );
165
+ }, Ei = (t, e) => {
166
+ const r = t.find(({ key: o }) => o === st) ?? null, n = t.find(({ key: o }) => o === ut) ?? null;
167
+ r && Ur(r) && e.append(st, r.value), n && Br(n) && e.append(ut, n.value);
168
+ }, Wr = (t) => t.map((e) => {
169
+ const [r, n] = e.split("/");
170
+ return { key: r, value: n };
171
+ }), Pi = (t, e) => {
172
+ const r = decodeURIComponent(e ?? "").slice(1).split("/"), n = t.filter(({ value: a }) => !r.includes(decodeURIComponent(a))).map((a) => ({
173
+ ...a,
174
+ value: decodeURIComponent(a.value)
175
+ })), { isDepartment: o } = jr(n);
176
+ return n == null ? void 0 : n.filter((a) => !zt(a.key, o));
177
+ }, $i = ({ pathname: t, searchParams: e }, r) => {
178
+ const n = e.get("sort") ?? "", o = e.get("query") ?? null, a = parseInt(e.get("page") ?? "1", 10);
179
+ return {
180
+ sort: n,
181
+ facets: Wr(r),
182
+ term: o,
183
+ base: o ? "" : t,
184
+ page: a
185
+ };
186
+ }, Ii = (t) => {
187
+ const e = new URLSearchParams();
188
+ return Object.entries(t).forEach(([r, n]) => {
189
+ Array.isArray(n) ? n.forEach((o) => e.append(r, o)) : n !== void 0 && e.append(r, n);
190
+ }), e;
191
+ }, Ri = (t, e, r = 24, n = 1, o) => {
192
+ const a = `/search?query=${e ?? ""}&count=${r}&page=${n}${o ? `&sort=${o.replace("_", ":")}` : ""}`;
193
+ t.push(a);
194
+ };
195
+ var pt = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
196
+ function Gr(t) {
197
+ return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
198
+ }
199
+ function Hr(t) {
200
+ if (t.__esModule) return t;
201
+ var e = t.default;
202
+ if (typeof e == "function") {
203
+ var r = function n() {
204
+ return this instanceof n ? Reflect.construct(e, arguments, this.constructor) : e.apply(this, arguments);
205
+ };
206
+ r.prototype = e.prototype;
207
+ } else r = {};
208
+ return Object.defineProperty(r, "__esModule", { value: !0 }), Object.keys(t).forEach(function(n) {
209
+ var o = Object.getOwnPropertyDescriptor(t, n);
210
+ Object.defineProperty(r, n, o.get ? o : {
211
+ enumerable: !0,
212
+ get: function() {
213
+ return t[n];
214
+ }
215
+ });
216
+ }), r;
217
+ }
218
+ const Kr = (t = "") => t.charAt(0).toUpperCase() + t.slice(1), yt = (t, e = " ") => !t || typeof t == "string" && t.length === 0 ? t : (Array.isArray(t) ? t : t.split("-")).map(Kr).join(e), Vr = ({ canonical: t, seo: e, slug: r }) => {
219
+ const n = Array.isArray(r) ? r.join(", ") : r;
220
+ return {
221
+ id: 0,
222
+ Title: `${Array.isArray(r) ? r.map((a) => yt(a)).join(",") : yt(r)} - ${e.title}`,
223
+ MetaTagDescription: e.description,
224
+ name: n,
225
+ hasChildren: !1,
226
+ url: t,
227
+ children: []
228
+ };
229
+ }, Qr = ({ canonical: t, category: e, previousImages: r, seo: n }) => ({
230
+ category: String(e == null ? void 0 : e.id),
231
+ title: (e == null ? void 0 : e.Title) ?? n.title,
232
+ description: (e == null ? void 0 : e.MetaTagDescription) ?? n.description,
233
+ alternates: { canonical: t },
234
+ openGraph: {
235
+ type: "website",
236
+ title: (e == null ? void 0 : e.Title) ?? n.title,
237
+ description: (e == null ? void 0 : e.MetaTagDescription) ?? n.description,
238
+ images: Array.isArray(r) ? [...r] : []
239
+ }
240
+ }), Jr = ({ items: t, parent: e, apiUrl: r, find: n }) => {
241
+ const o = t.find(
242
+ (i) => i.url.replace(r, "") === decodeURIComponent(e.toLowerCase())
243
+ );
244
+ return (o == null ? void 0 : o.children.find(
245
+ (i) => i.name.toLowerCase() === decodeURIComponent(String(n))
246
+ )) ?? o;
247
+ }, Yr = (t) => {
248
+ t instanceof Error ? (console.error(`[ERROR CATEGORY INFO]: ${t.message}`), console.error(t.stack)) : console.error("[ERROR CATEGORY INFO]: Unknown error", t);
249
+ }, Xr = /* @__PURE__ */ new Set([
250
+ "brand",
251
+ "category",
252
+ "department",
253
+ "subcategory",
254
+ "collection",
255
+ "cluster"
256
+ ]), Zr = (t) => typeof (t == null ? void 0 : t.pageType) == "string" && Xr.has(t == null ? void 0 : t.pageType.toLowerCase()), en = (t) => ({
257
+ collection: t.Coleção,
258
+ categoryId: t.categoryId,
259
+ current_collection: t["Coleção Atual"],
260
+ items: t.items
261
+ }), Wt = (t, e) => t.reduce((r, n) => {
262
+ if (n.items.filter(
263
+ (i) => i.sellers.find((f) => f.commertialOffer.IsAvailable)
264
+ ).length === 0 || (r == null ? void 0 : r.find((i) => (i == null ? void 0 : i.productId) === (n == null ? void 0 : n.productId))) !== void 0)
265
+ return r;
266
+ const a = n.items[0].images.find(
267
+ (i) => e.includes(i.imageLabel)
268
+ );
269
+ return r.push({
270
+ slug: `/${n.linkText}/p`,
271
+ productId: n == null ? void 0 : n.productId,
272
+ textureImage: (a == null ? void 0 : a.imageUrl) ?? "",
273
+ textureAlt: (a == null ? void 0 : a.imageText) ?? ""
274
+ }), r;
275
+ }, []), ki = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
276
+ __proto__: null,
277
+ createEmptySeoCategory: Vr,
278
+ createSeoCategory: Qr,
279
+ findCategory: Jr,
280
+ formattedSimilars: Wt,
281
+ isCollectionPageType: Zr,
282
+ notFindCategoryError: Yr,
283
+ responseAdapter: en
284
+ }, Symbol.toStringTag, { value: "Module" })), Ci = async ({ productId: t, TEXTURE_IMAGE: e, apiUrl: r }) => {
285
+ try {
286
+ const n = await fetch(`${r}/api/catalog_system/pub/products/crossselling/similars/${t}`, {
287
+ priority: "low"
288
+ });
289
+ if (!n.ok)
290
+ throw new Error("Erro ao buscar similares.");
291
+ const o = await n.json();
292
+ return Wt(o, e);
293
+ } catch (n) {
294
+ return console.error(n), [];
295
+ }
296
+ }, se = {
297
+ "responsive-mobile-flex": "_responsive-mobile-flex_1e0ai_1",
298
+ "responsive-desktop-flex": "_responsive-desktop-flex_1e0ai_15",
299
+ "responsive-mobile-block": "_responsive-mobile-block_1e0ai_30",
300
+ "responsive-desktop-block": "_responsive-desktop-block_1e0ai_41"
301
+ }, tn = "_header_9xxjk_57", rn = "_actions_9xxjk_131", nn = "_breadcrumb_9xxjk_142", on = "_credits_9xxjk_157", an = "_pdplinks_9xxjk_185", ln = "_similars_9xxjk_212", cn = "_sizes_9xxjk_251", fn = "_measurementTable_9xxjk_267", sn = "_measurementHead_9xxjk_280", un = "_measurementRows_9xxjk_285", pn = "_measurementRowsTitle_9xxjk_302", yn = "_measurementRowsText_9xxjk_314", dn = "_measurementImage_9xxjk_325", vn = "_measurementImageContainer_9xxjk_328", mn = "_measurementContent_9xxjk_337", gn = "_measurementTitle_9xxjk_341", hn = "_measurementClose_9xxjk_352", _n = "_productref_9xxjk_417", bn = "_slideOut_9xxjk_1", Sn = "_slideIn_9xxjk_1", wn = "_content_9xxjk_397", xn = "_pdp_9xxjk_185", An = "_divider_9xxjk_575", Ti = {
302
+ "bottom-navigation": "_bottom-navigation_9xxjk_1",
303
+ "bottom-navigation__credits-modifier": "_bottom-navigation__credits-modifier_9xxjk_18",
304
+ "bottom-navigation__header": "_bottom-navigation__header_9xxjk_21",
305
+ "bottom-navigation__header-content": "_bottom-navigation__header-content_9xxjk_26",
306
+ "golden-tag-content": "_golden-tag-content_9xxjk_45",
307
+ "bottom-navigation__price-and-promo": "_bottom-navigation__price-and-promo_9xxjk_48",
308
+ header: tn,
309
+ "golden-tag": "_golden-tag_9xxjk_45",
310
+ "golden-tag-video": "_golden-tag-video_9xxjk_86",
311
+ "golden-tag-content-text": "_golden-tag-content-text_9xxjk_105",
312
+ actions: rn,
313
+ "add-to-cart": "_add-to-cart_9xxjk_138",
314
+ breadcrumb: nn,
315
+ "breadcrumb--active": "_breadcrumb--active_9xxjk_147",
316
+ credits: on,
317
+ "gallery-carousel-modifier": "_gallery-carousel-modifier_9xxjk_162",
318
+ pdplinks: an,
319
+ "links-wrapper": "_links-wrapper_9xxjk_195",
320
+ similars: ln,
321
+ "similars-info": "_similars-info_9xxjk_224",
322
+ "toggle-style-modifier": "_toggle-style-modifier_9xxjk_233",
323
+ "accessibility-info": "_accessibility-info_9xxjk_237",
324
+ sizes: cn,
325
+ "price-wrapper": "_price-wrapper_9xxjk_263",
326
+ measurementTable: fn,
327
+ measurementHead: sn,
328
+ measurementRows: un,
329
+ measurementRowsTitle: pn,
330
+ measurementRowsText: yn,
331
+ measurementImage: dn,
332
+ measurementImageContainer: vn,
333
+ measurementContent: mn,
334
+ measurementTitle: gn,
335
+ measurementClose: hn,
336
+ "tabs-root-modifier": "_tabs-root-modifier_9xxjk_358",
337
+ "tabs-list-modifier": "_tabs-list-modifier_9xxjk_376",
338
+ "tabs-item-modifier": "_tabs-item-modifier_9xxjk_393",
339
+ "content-wrapper": "_content-wrapper_9xxjk_397",
340
+ productref: _n,
341
+ "tabs-panel": "_tabs-panel_9xxjk_428",
342
+ "tabs-panel-exit": "_tabs-panel-exit_9xxjk_434",
343
+ slideOut: bn,
344
+ "tabs-panel-enter": "_tabs-panel-enter_9xxjk_438",
345
+ slideIn: Sn,
346
+ content: wn,
347
+ pdp: xn,
348
+ "pdp-main": "_pdp-main_9xxjk_496",
349
+ "pdp-main__gallery-wrapper": "_pdp-main__gallery-wrapper_9xxjk_501",
350
+ "pdp-main__info": "_pdp-main__info_9xxjk_518",
351
+ "pdp-main__info-main-content": "_pdp-main__info-main-content_9xxjk_533",
352
+ "pdp-main__info-subsection": "_pdp-main__info-subsection_9xxjk_533",
353
+ "subsection-product-info": "_subsection-product-info_9xxjk_544",
354
+ "subsection-similars": "_subsection-similars_9xxjk_547",
355
+ "subsection-sizes": "_subsection-sizes_9xxjk_550",
356
+ "subsection-actions": "_subsection-actions_9xxjk_553",
357
+ "pdp-main__info-secondary-content": "_pdp-main__info-secondary-content_9xxjk_557",
358
+ "sections-title": "_sections-title_9xxjk_563",
359
+ divider: An,
360
+ "breadcrumbs-desktop": "_breadcrumbs-desktop_9xxjk_580",
361
+ "breadcrumbs-mobile": "_breadcrumbs-mobile_9xxjk_589"
362
+ }, Fi = ({
363
+ children: t,
364
+ data: e,
365
+ SectionZone: r,
366
+ className: n
367
+ }) => {
368
+ var c, p;
369
+ const o = ((c = e == null ? void 0 : e.filter((u) => {
370
+ var v, y;
371
+ return ((y = (v = u.config) == null ? void 0 : v.responsive) == null ? void 0 : y.deviceType) === "mobile";
372
+ })[0]) == null ? void 0 : c.sections) || [], a = ((p = e == null ? void 0 : e.filter((u) => {
373
+ var v, y;
374
+ return ((y = (v = u.config) == null ? void 0 : v.responsive) == null ? void 0 : y.deviceType) === "desktop";
375
+ })[0]) == null ? void 0 : p.sections) || [], i = o.slice(0, 1), f = o.slice(1, o.length), l = a.slice(0, 1), s = a.slice(1, a.length);
376
+ return /* @__PURE__ */ ft(Sr, { children: [
377
+ /* @__PURE__ */ ft("div", { className: n, children: [
378
+ /* @__PURE__ */ $("div", { className: se["responsive-mobile-flex"], children: /* @__PURE__ */ $(r, { data: i ?? [] }) }),
379
+ /* @__PURE__ */ $("div", { className: se["responsive-desktop-flex"], children: /* @__PURE__ */ $(r, { data: l ?? [] }) })
380
+ ] }),
381
+ t,
382
+ /* @__PURE__ */ $("div", { className: se["responsive-mobile-flex"], children: /* @__PURE__ */ $(r, { data: f ?? [] }) }),
383
+ /* @__PURE__ */ $("div", { className: se["responsive-desktop-flex"], children: /* @__PURE__ */ $(r, { data: s ?? [] }) }),
384
+ /* @__PURE__ */ $(wr.Divider, {})
385
+ ] });
386
+ };
387
+ var J = TypeError;
388
+ const On = {}, En = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
389
+ __proto__: null,
390
+ default: On
391
+ }, Symbol.toStringTag, { value: "Module" })), Pn = /* @__PURE__ */ Hr(En);
392
+ var tt = typeof Map == "function" && Map.prototype, Pe = Object.getOwnPropertyDescriptor && tt ? Object.getOwnPropertyDescriptor(Map.prototype, "size") : null, me = tt && Pe && typeof Pe.get == "function" ? Pe.get : null, dt = tt && Map.prototype.forEach, rt = typeof Set == "function" && Set.prototype, $e = Object.getOwnPropertyDescriptor && rt ? Object.getOwnPropertyDescriptor(Set.prototype, "size") : null, ge = rt && $e && typeof $e.get == "function" ? $e.get : null, vt = rt && Set.prototype.forEach, $n = typeof WeakMap == "function" && WeakMap.prototype, ee = $n ? WeakMap.prototype.has : null, In = typeof WeakSet == "function" && WeakSet.prototype, te = In ? WeakSet.prototype.has : null, Rn = typeof WeakRef == "function" && WeakRef.prototype, mt = Rn ? WeakRef.prototype.deref : null, kn = Boolean.prototype.valueOf, Cn = Object.prototype.toString, Tn = Function.prototype.toString, Fn = String.prototype.match, nt = String.prototype.slice, F = String.prototype.replace, Dn = String.prototype.toUpperCase, gt = String.prototype.toLowerCase, Gt = RegExp.prototype.test, ht = Array.prototype.concat, E = Array.prototype.join, Nn = Array.prototype.slice, _t = Math.floor, Qe = typeof BigInt == "function" ? BigInt.prototype.valueOf : null, Ie = Object.getOwnPropertySymbols, Je = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? Symbol.prototype.toString : null, V = typeof Symbol == "function" && typeof Symbol.iterator == "object", re = typeof Symbol == "function" && Symbol.toStringTag && (typeof Symbol.toStringTag === V || !0) ? Symbol.toStringTag : null, Ht = Object.prototype.propertyIsEnumerable, bt = (typeof Reflect == "function" ? Reflect.getPrototypeOf : Object.getPrototypeOf) || ([].__proto__ === Array.prototype ? function(t) {
393
+ return t.__proto__;
394
+ } : null);
395
+ function St(t, e) {
396
+ if (t === 1 / 0 || t === -1 / 0 || t !== t || t && t > -1e3 && t < 1e3 || Gt.call(/e/, e))
397
+ return e;
398
+ var r = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;
399
+ if (typeof t == "number") {
400
+ var n = t < 0 ? -_t(-t) : _t(t);
401
+ if (n !== t) {
402
+ var o = String(n), a = nt.call(e, o.length + 1);
403
+ return F.call(o, r, "$&_") + "." + F.call(F.call(a, /([0-9]{3})/g, "$&_"), /_$/, "");
404
+ }
405
+ }
406
+ return F.call(e, r, "$&_");
407
+ }
408
+ var Ye = Pn, wt = Ye.custom, xt = Qt(wt) ? wt : null, Kt = {
409
+ __proto__: null,
410
+ double: '"',
411
+ single: "'"
412
+ }, Mn = {
413
+ __proto__: null,
414
+ double: /(["\\])/g,
415
+ single: /(['\\])/g
416
+ }, be = function t(e, r, n, o) {
417
+ var a = r || {};
418
+ if (I(a, "quoteStyle") && !I(Kt, a.quoteStyle))
419
+ throw new TypeError('option "quoteStyle" must be "single" or "double"');
420
+ if (I(a, "maxStringLength") && (typeof a.maxStringLength == "number" ? a.maxStringLength < 0 && a.maxStringLength !== 1 / 0 : a.maxStringLength !== null))
421
+ throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');
422
+ var i = I(a, "customInspect") ? a.customInspect : !0;
423
+ if (typeof i != "boolean" && i !== "symbol")
424
+ throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");
425
+ if (I(a, "indent") && a.indent !== null && a.indent !== " " && !(parseInt(a.indent, 10) === a.indent && a.indent > 0))
426
+ throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');
427
+ if (I(a, "numericSeparator") && typeof a.numericSeparator != "boolean")
428
+ throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');
429
+ var f = a.numericSeparator;
430
+ if (typeof e > "u")
431
+ return "undefined";
432
+ if (e === null)
433
+ return "null";
434
+ if (typeof e == "boolean")
435
+ return e ? "true" : "false";
436
+ if (typeof e == "string")
437
+ return Yt(e, a);
438
+ if (typeof e == "number") {
439
+ if (e === 0)
440
+ return 1 / 0 / e > 0 ? "0" : "-0";
441
+ var l = String(e);
442
+ return f ? St(e, l) : l;
443
+ }
444
+ if (typeof e == "bigint") {
445
+ var s = String(e) + "n";
446
+ return f ? St(e, s) : s;
447
+ }
448
+ var c = typeof a.depth > "u" ? 5 : a.depth;
449
+ if (typeof n > "u" && (n = 0), n >= c && c > 0 && typeof e == "object")
450
+ return Xe(e) ? "[Array]" : "[Object]";
451
+ var p = to(a, n);
452
+ if (typeof o > "u")
453
+ o = [];
454
+ else if (Jt(o, e) >= 0)
455
+ return "[Circular]";
456
+ function u(x, T, P) {
457
+ if (T && (o = Nn.call(o), o.push(T)), P) {
458
+ var X = {
459
+ depth: a.depth
460
+ };
461
+ return I(a, "quoteStyle") && (X.quoteStyle = a.quoteStyle), t(x, X, n + 1, o);
462
+ }
463
+ return t(x, a, n + 1, o);
464
+ }
465
+ if (typeof e == "function" && !At(e)) {
466
+ var v = Hn(e), y = ue(e, u);
467
+ return "[Function" + (v ? ": " + v : " (anonymous)") + "]" + (y.length > 0 ? " { " + E.call(y, ", ") + " }" : "");
468
+ }
469
+ if (Qt(e)) {
470
+ var h = V ? F.call(String(e), /^(Symbol\(.*\))_[^)]*$/, "$1") : Je.call(e);
471
+ return typeof e == "object" && !V ? Z(h) : h;
472
+ }
473
+ if (Xn(e)) {
474
+ for (var S = "<" + gt.call(String(e.nodeName)), w = e.attributes || [], R = 0; R < w.length; R++)
475
+ S += " " + w[R].name + "=" + Vt(jn(w[R].value), "double", a);
476
+ return S += ">", e.childNodes && e.childNodes.length && (S += "..."), S += "</" + gt.call(String(e.nodeName)) + ">", S;
477
+ }
478
+ if (Xe(e)) {
479
+ if (e.length === 0)
480
+ return "[]";
481
+ var m = ue(e, u);
482
+ return p && !eo(m) ? "[" + Ze(m, p) + "]" : "[ " + E.call(m, ", ") + " ]";
483
+ }
484
+ if (Ln(e)) {
485
+ var k = ue(e, u);
486
+ return !("cause" in Error.prototype) && "cause" in e && !Ht.call(e, "cause") ? "{ [" + String(e) + "] " + E.call(ht.call("[cause]: " + u(e.cause), k), ", ") + " }" : k.length === 0 ? "[" + String(e) + "]" : "{ [" + String(e) + "] " + E.call(k, ", ") + " }";
487
+ }
488
+ if (typeof e == "object" && i) {
489
+ if (xt && typeof e[xt] == "function" && Ye)
490
+ return Ye(e, { depth: c - n });
491
+ if (i !== "symbol" && typeof e.inspect == "function")
492
+ return e.inspect();
493
+ }
494
+ if (Kn(e)) {
495
+ var N = [];
496
+ return dt && dt.call(e, function(x, T) {
497
+ N.push(u(T, e, !0) + " => " + u(x, e));
498
+ }), Ot("Map", me.call(e), N, p);
499
+ }
500
+ if (Jn(e)) {
501
+ var Y = [];
502
+ return vt && vt.call(e, function(x) {
503
+ Y.push(u(x, e));
504
+ }), Ot("Set", ge.call(e), Y, p);
505
+ }
506
+ if (Vn(e))
507
+ return Re("WeakMap");
508
+ if (Yn(e))
509
+ return Re("WeakSet");
510
+ if (Qn(e))
511
+ return Re("WeakRef");
512
+ if (qn(e))
513
+ return Z(u(Number(e)));
514
+ if (Wn(e))
515
+ return Z(u(Qe.call(e)));
516
+ if (zn(e))
517
+ return Z(kn.call(e));
518
+ if (Un(e))
519
+ return Z(u(String(e)));
520
+ if (typeof window < "u" && e === window)
521
+ return "{ [object Window] }";
522
+ if (typeof globalThis < "u" && e === globalThis || typeof pt < "u" && e === pt)
523
+ return "{ [object globalThis] }";
524
+ if (!Bn(e) && !At(e)) {
525
+ var q = ue(e, u), ce = bt ? bt(e) === Object.prototype : e instanceof Object || e.constructor === Object, M = e instanceof Object ? "" : "null prototype", C = !ce && re && Object(e) === e && re in e ? nt.call(D(e), 8, -1) : M ? "Object" : "", fe = ce || typeof e.constructor != "function" ? "" : e.constructor.name ? e.constructor.name + " " : "", z = fe + (C || M ? "[" + E.call(ht.call([], C || [], M || []), ": ") + "] " : "");
526
+ return q.length === 0 ? z + "{}" : p ? z + "{" + Ze(q, p) + "}" : z + "{ " + E.call(q, ", ") + " }";
527
+ }
528
+ return String(e);
529
+ };
530
+ function Vt(t, e, r) {
531
+ var n = r.quoteStyle || e, o = Kt[n];
532
+ return o + t + o;
533
+ }
534
+ function jn(t) {
535
+ return F.call(String(t), /"/g, "&quot;");
536
+ }
537
+ function U(t) {
538
+ return !re || !(typeof t == "object" && (re in t || typeof t[re] < "u"));
539
+ }
540
+ function Xe(t) {
541
+ return D(t) === "[object Array]" && U(t);
542
+ }
543
+ function Bn(t) {
544
+ return D(t) === "[object Date]" && U(t);
545
+ }
546
+ function At(t) {
547
+ return D(t) === "[object RegExp]" && U(t);
548
+ }
549
+ function Ln(t) {
550
+ return D(t) === "[object Error]" && U(t);
551
+ }
552
+ function Un(t) {
553
+ return D(t) === "[object String]" && U(t);
554
+ }
555
+ function qn(t) {
556
+ return D(t) === "[object Number]" && U(t);
557
+ }
558
+ function zn(t) {
559
+ return D(t) === "[object Boolean]" && U(t);
560
+ }
561
+ function Qt(t) {
562
+ if (V)
563
+ return t && typeof t == "object" && t instanceof Symbol;
564
+ if (typeof t == "symbol")
565
+ return !0;
566
+ if (!t || typeof t != "object" || !Je)
567
+ return !1;
568
+ try {
569
+ return Je.call(t), !0;
570
+ } catch {
571
+ }
572
+ return !1;
573
+ }
574
+ function Wn(t) {
575
+ if (!t || typeof t != "object" || !Qe)
576
+ return !1;
577
+ try {
578
+ return Qe.call(t), !0;
579
+ } catch {
580
+ }
581
+ return !1;
582
+ }
583
+ var Gn = Object.prototype.hasOwnProperty || function(t) {
584
+ return t in this;
585
+ };
586
+ function I(t, e) {
587
+ return Gn.call(t, e);
588
+ }
589
+ function D(t) {
590
+ return Cn.call(t);
591
+ }
592
+ function Hn(t) {
593
+ if (t.name)
594
+ return t.name;
595
+ var e = Fn.call(Tn.call(t), /^function\s*([\w$]+)/);
596
+ return e ? e[1] : null;
597
+ }
598
+ function Jt(t, e) {
599
+ if (t.indexOf)
600
+ return t.indexOf(e);
601
+ for (var r = 0, n = t.length; r < n; r++)
602
+ if (t[r] === e)
603
+ return r;
604
+ return -1;
605
+ }
606
+ function Kn(t) {
607
+ if (!me || !t || typeof t != "object")
608
+ return !1;
609
+ try {
610
+ me.call(t);
611
+ try {
612
+ ge.call(t);
613
+ } catch {
614
+ return !0;
615
+ }
616
+ return t instanceof Map;
617
+ } catch {
618
+ }
619
+ return !1;
620
+ }
621
+ function Vn(t) {
622
+ if (!ee || !t || typeof t != "object")
623
+ return !1;
624
+ try {
625
+ ee.call(t, ee);
626
+ try {
627
+ te.call(t, te);
628
+ } catch {
629
+ return !0;
630
+ }
631
+ return t instanceof WeakMap;
632
+ } catch {
633
+ }
634
+ return !1;
635
+ }
636
+ function Qn(t) {
637
+ if (!mt || !t || typeof t != "object")
638
+ return !1;
639
+ try {
640
+ return mt.call(t), !0;
641
+ } catch {
642
+ }
643
+ return !1;
644
+ }
645
+ function Jn(t) {
646
+ if (!ge || !t || typeof t != "object")
647
+ return !1;
648
+ try {
649
+ ge.call(t);
650
+ try {
651
+ me.call(t);
652
+ } catch {
653
+ return !0;
654
+ }
655
+ return t instanceof Set;
656
+ } catch {
657
+ }
658
+ return !1;
659
+ }
660
+ function Yn(t) {
661
+ if (!te || !t || typeof t != "object")
662
+ return !1;
663
+ try {
664
+ te.call(t, te);
665
+ try {
666
+ ee.call(t, ee);
667
+ } catch {
668
+ return !0;
669
+ }
670
+ return t instanceof WeakSet;
671
+ } catch {
672
+ }
673
+ return !1;
674
+ }
675
+ function Xn(t) {
676
+ return !t || typeof t != "object" ? !1 : typeof HTMLElement < "u" && t instanceof HTMLElement ? !0 : typeof t.nodeName == "string" && typeof t.getAttribute == "function";
677
+ }
678
+ function Yt(t, e) {
679
+ if (t.length > e.maxStringLength) {
680
+ var r = t.length - e.maxStringLength, n = "... " + r + " more character" + (r > 1 ? "s" : "");
681
+ return Yt(nt.call(t, 0, e.maxStringLength), e) + n;
682
+ }
683
+ var o = Mn[e.quoteStyle || "single"];
684
+ o.lastIndex = 0;
685
+ var a = F.call(F.call(t, o, "\\$1"), /[\x00-\x1f]/g, Zn);
686
+ return Vt(a, "single", e);
687
+ }
688
+ function Zn(t) {
689
+ var e = t.charCodeAt(0), r = {
690
+ 8: "b",
691
+ 9: "t",
692
+ 10: "n",
693
+ 12: "f",
694
+ 13: "r"
695
+ }[e];
696
+ return r ? "\\" + r : "\\x" + (e < 16 ? "0" : "") + Dn.call(e.toString(16));
697
+ }
698
+ function Z(t) {
699
+ return "Object(" + t + ")";
700
+ }
701
+ function Re(t) {
702
+ return t + " { ? }";
703
+ }
704
+ function Ot(t, e, r, n) {
705
+ var o = n ? Ze(r, n) : E.call(r, ", ");
706
+ return t + " (" + e + ") {" + o + "}";
707
+ }
708
+ function eo(t) {
709
+ for (var e = 0; e < t.length; e++)
710
+ if (Jt(t[e], `
711
+ `) >= 0)
712
+ return !1;
713
+ return !0;
714
+ }
715
+ function to(t, e) {
716
+ var r;
717
+ if (t.indent === " ")
718
+ r = " ";
719
+ else if (typeof t.indent == "number" && t.indent > 0)
720
+ r = E.call(Array(t.indent + 1), " ");
721
+ else
722
+ return null;
723
+ return {
724
+ base: r,
725
+ prev: E.call(Array(e + 1), r)
726
+ };
727
+ }
728
+ function Ze(t, e) {
729
+ if (t.length === 0)
730
+ return "";
731
+ var r = `
732
+ ` + e.prev + e.base;
733
+ return r + E.call(t, "," + r) + `
734
+ ` + e.prev;
735
+ }
736
+ function ue(t, e) {
737
+ var r = Xe(t), n = [];
738
+ if (r) {
739
+ n.length = t.length;
740
+ for (var o = 0; o < t.length; o++)
741
+ n[o] = I(t, o) ? e(t[o], t) : "";
742
+ }
743
+ var a = typeof Ie == "function" ? Ie(t) : [], i;
744
+ if (V) {
745
+ i = {};
746
+ for (var f = 0; f < a.length; f++)
747
+ i["$" + a[f]] = a[f];
748
+ }
749
+ for (var l in t)
750
+ I(t, l) && (r && String(Number(l)) === l && l < t.length || V && i["$" + l] instanceof Symbol || (Gt.call(/[^\w$]/, l) ? n.push(e(l, t) + ": " + e(t[l], t)) : n.push(l + ": " + e(t[l], t))));
751
+ if (typeof Ie == "function")
752
+ for (var s = 0; s < a.length; s++)
753
+ Ht.call(t, a[s]) && n.push("[" + e(a[s]) + "]: " + e(t[a[s]], t));
754
+ return n;
755
+ }
756
+ var ro = be, no = J, Se = function(t, e, r) {
757
+ for (var n = t, o; (o = n.next) != null; n = o)
758
+ if (o.key === e)
759
+ return n.next = o.next, r || (o.next = /** @type {NonNullable<typeof list.next>} */
760
+ t.next, t.next = o), o;
761
+ }, oo = function(t, e) {
762
+ if (t) {
763
+ var r = Se(t, e);
764
+ return r && r.value;
765
+ }
766
+ }, ao = function(t, e, r) {
767
+ var n = Se(t, e);
768
+ n ? n.value = r : t.next = /** @type {import('./list.d.ts').ListNode<typeof value, typeof key>} */
769
+ {
770
+ // eslint-disable-line no-param-reassign, no-extra-parens
771
+ key: e,
772
+ next: t.next,
773
+ value: r
774
+ };
775
+ }, io = function(t, e) {
776
+ return t ? !!Se(t, e) : !1;
777
+ }, lo = function(t, e) {
778
+ if (t)
779
+ return Se(t, e, !0);
780
+ }, co = function() {
781
+ var e, r = {
782
+ assert: function(n) {
783
+ if (!r.has(n))
784
+ throw new no("Side channel does not contain " + ro(n));
785
+ },
786
+ delete: function(n) {
787
+ var o = e && e.next, a = lo(e, n);
788
+ return a && o && o === a && (e = void 0), !!a;
789
+ },
790
+ get: function(n) {
791
+ return oo(e, n);
792
+ },
793
+ has: function(n) {
794
+ return io(e, n);
795
+ },
796
+ set: function(n, o) {
797
+ e || (e = {
798
+ next: void 0
799
+ }), ao(
800
+ /** @type {NonNullable<typeof $o>} */
801
+ e,
802
+ n,
803
+ o
804
+ );
805
+ }
806
+ };
807
+ return r;
808
+ }, Xt = Object, fo = Error, so = EvalError, uo = RangeError, po = ReferenceError, yo = SyntaxError, vo = URIError, mo = Math.abs, go = Math.floor, ho = Math.max, _o = Math.min, bo = Math.pow, So = Math.round, wo = Number.isNaN || function(e) {
809
+ return e !== e;
810
+ }, xo = wo, Ao = function(e) {
811
+ return xo(e) || e === 0 ? e : e < 0 ? -1 : 1;
812
+ }, Oo = Object.getOwnPropertyDescriptor, ye = Oo;
813
+ if (ye)
814
+ try {
815
+ ye([], "length");
816
+ } catch {
817
+ ye = null;
818
+ }
819
+ var Zt = ye, de = Object.defineProperty || !1;
820
+ if (de)
821
+ try {
822
+ de({}, "a", { value: 1 });
823
+ } catch {
824
+ de = !1;
825
+ }
826
+ var Eo = de, ke, Et;
827
+ function Po() {
828
+ return Et || (Et = 1, ke = function() {
829
+ if (typeof Symbol != "function" || typeof Object.getOwnPropertySymbols != "function")
830
+ return !1;
831
+ if (typeof Symbol.iterator == "symbol")
832
+ return !0;
833
+ var e = {}, r = Symbol("test"), n = Object(r);
834
+ if (typeof r == "string" || Object.prototype.toString.call(r) !== "[object Symbol]" || Object.prototype.toString.call(n) !== "[object Symbol]")
835
+ return !1;
836
+ var o = 42;
837
+ e[r] = o;
838
+ for (var a in e)
839
+ return !1;
840
+ if (typeof Object.keys == "function" && Object.keys(e).length !== 0 || typeof Object.getOwnPropertyNames == "function" && Object.getOwnPropertyNames(e).length !== 0)
841
+ return !1;
842
+ var i = Object.getOwnPropertySymbols(e);
843
+ if (i.length !== 1 || i[0] !== r || !Object.prototype.propertyIsEnumerable.call(e, r))
844
+ return !1;
845
+ if (typeof Object.getOwnPropertyDescriptor == "function") {
846
+ var f = (
847
+ /** @type {PropertyDescriptor} */
848
+ Object.getOwnPropertyDescriptor(e, r)
849
+ );
850
+ if (f.value !== o || f.enumerable !== !0)
851
+ return !1;
852
+ }
853
+ return !0;
854
+ }), ke;
855
+ }
856
+ var Ce, Pt;
857
+ function $o() {
858
+ if (Pt) return Ce;
859
+ Pt = 1;
860
+ var t = typeof Symbol < "u" && Symbol, e = Po();
861
+ return Ce = function() {
862
+ return typeof t != "function" || typeof Symbol != "function" || typeof t("foo") != "symbol" || typeof Symbol("bar") != "symbol" ? !1 : e();
863
+ }, Ce;
864
+ }
865
+ var Te, $t;
866
+ function er() {
867
+ return $t || ($t = 1, Te = typeof Reflect < "u" && Reflect.getPrototypeOf || null), Te;
868
+ }
869
+ var Fe, It;
870
+ function tr() {
871
+ if (It) return Fe;
872
+ It = 1;
873
+ var t = Xt;
874
+ return Fe = t.getPrototypeOf || null, Fe;
875
+ }
876
+ var De, Rt;
877
+ function Io() {
878
+ if (Rt) return De;
879
+ Rt = 1;
880
+ var t = "Function.prototype.bind called on incompatible ", e = Object.prototype.toString, r = Math.max, n = "[object Function]", o = function(l, s) {
881
+ for (var c = [], p = 0; p < l.length; p += 1)
882
+ c[p] = l[p];
883
+ for (var u = 0; u < s.length; u += 1)
884
+ c[u + l.length] = s[u];
885
+ return c;
886
+ }, a = function(l, s) {
887
+ for (var c = [], p = s, u = 0; p < l.length; p += 1, u += 1)
888
+ c[u] = l[p];
889
+ return c;
890
+ }, i = function(f, l) {
891
+ for (var s = "", c = 0; c < f.length; c += 1)
892
+ s += f[c], c + 1 < f.length && (s += l);
893
+ return s;
894
+ };
895
+ return De = function(l) {
896
+ var s = this;
897
+ if (typeof s != "function" || e.apply(s) !== n)
898
+ throw new TypeError(t + s);
899
+ for (var c = a(arguments, 1), p, u = function() {
900
+ if (this instanceof p) {
901
+ var w = s.apply(
902
+ this,
903
+ o(c, arguments)
904
+ );
905
+ return Object(w) === w ? w : this;
906
+ }
907
+ return s.apply(
908
+ l,
909
+ o(c, arguments)
910
+ );
911
+ }, v = r(0, s.length - c.length), y = [], h = 0; h < v; h++)
912
+ y[h] = "$" + h;
913
+ if (p = Function("binder", "return function (" + i(y, ",") + "){ return binder.apply(this,arguments); }")(u), s.prototype) {
914
+ var S = function() {
915
+ };
916
+ S.prototype = s.prototype, p.prototype = new S(), S.prototype = null;
917
+ }
918
+ return p;
919
+ }, De;
920
+ }
921
+ var Ne, kt;
922
+ function we() {
923
+ if (kt) return Ne;
924
+ kt = 1;
925
+ var t = Io();
926
+ return Ne = Function.prototype.bind || t, Ne;
927
+ }
928
+ var Me, Ct;
929
+ function ot() {
930
+ return Ct || (Ct = 1, Me = Function.prototype.call), Me;
931
+ }
932
+ var je, Tt;
933
+ function rr() {
934
+ return Tt || (Tt = 1, je = Function.prototype.apply), je;
935
+ }
936
+ var Ro = typeof Reflect < "u" && Reflect && Reflect.apply, ko = we(), Co = rr(), To = ot(), Fo = Ro, Do = Fo || ko.call(To, Co), No = we(), Mo = J, jo = ot(), Bo = Do, nr = function(e) {
937
+ if (e.length < 1 || typeof e[0] != "function")
938
+ throw new Mo("a function is required");
939
+ return Bo(No, jo, e);
940
+ }, Be, Ft;
941
+ function Lo() {
942
+ if (Ft) return Be;
943
+ Ft = 1;
944
+ var t = nr, e = Zt, r;
945
+ try {
946
+ r = /** @type {{ __proto__?: typeof Array.prototype }} */
947
+ [].__proto__ === Array.prototype;
948
+ } catch (i) {
949
+ if (!i || typeof i != "object" || !("code" in i) || i.code !== "ERR_PROTO_ACCESS")
950
+ throw i;
951
+ }
952
+ var n = !!r && e && e(
953
+ Object.prototype,
954
+ /** @type {keyof typeof Object.prototype} */
955
+ "__proto__"
956
+ ), o = Object, a = o.getPrototypeOf;
957
+ return Be = n && typeof n.get == "function" ? t([n.get]) : typeof a == "function" ? (
958
+ /** @type {import('./get')} */
959
+ function(f) {
960
+ return a(f == null ? f : o(f));
961
+ }
962
+ ) : !1, Be;
963
+ }
964
+ var Le, Dt;
965
+ function Uo() {
966
+ if (Dt) return Le;
967
+ Dt = 1;
968
+ var t = er(), e = tr(), r = Lo();
969
+ return Le = t ? function(o) {
970
+ return t(o);
971
+ } : e ? function(o) {
972
+ if (!o || typeof o != "object" && typeof o != "function")
973
+ throw new TypeError("getProto: not an object");
974
+ return e(o);
975
+ } : r ? function(o) {
976
+ return r(o);
977
+ } : null, Le;
978
+ }
979
+ var Ue, Nt;
980
+ function qo() {
981
+ if (Nt) return Ue;
982
+ Nt = 1;
983
+ var t = Function.prototype.call, e = Object.prototype.hasOwnProperty, r = we();
984
+ return Ue = r.call(t, e), Ue;
985
+ }
986
+ var d, zo = Xt, Wo = fo, Go = so, Ho = uo, Ko = po, Q = yo, K = J, Vo = vo, Qo = mo, Jo = go, Yo = ho, Xo = _o, Zo = bo, ea = So, ta = Ao, or = Function, qe = function(t) {
987
+ try {
988
+ return or('"use strict"; return (' + t + ").constructor;")();
989
+ } catch {
990
+ }
991
+ }, oe = Zt, ra = Eo, ze = function() {
992
+ throw new K();
993
+ }, na = oe ? function() {
994
+ try {
995
+ return arguments.callee, ze;
996
+ } catch {
997
+ try {
998
+ return oe(arguments, "callee").get;
999
+ } catch {
1000
+ return ze;
1001
+ }
1002
+ }
1003
+ }() : ze, W = $o()(), b = Uo(), oa = tr(), aa = er(), ar = rr(), ae = ot(), H = {}, ia = typeof Uint8Array > "u" || !b ? d : b(Uint8Array), B = {
1004
+ __proto__: null,
1005
+ "%AggregateError%": typeof AggregateError > "u" ? d : AggregateError,
1006
+ "%Array%": Array,
1007
+ "%ArrayBuffer%": typeof ArrayBuffer > "u" ? d : ArrayBuffer,
1008
+ "%ArrayIteratorPrototype%": W && b ? b([][Symbol.iterator]()) : d,
1009
+ "%AsyncFromSyncIteratorPrototype%": d,
1010
+ "%AsyncFunction%": H,
1011
+ "%AsyncGenerator%": H,
1012
+ "%AsyncGeneratorFunction%": H,
1013
+ "%AsyncIteratorPrototype%": H,
1014
+ "%Atomics%": typeof Atomics > "u" ? d : Atomics,
1015
+ "%BigInt%": typeof BigInt > "u" ? d : BigInt,
1016
+ "%BigInt64Array%": typeof BigInt64Array > "u" ? d : BigInt64Array,
1017
+ "%BigUint64Array%": typeof BigUint64Array > "u" ? d : BigUint64Array,
1018
+ "%Boolean%": Boolean,
1019
+ "%DataView%": typeof DataView > "u" ? d : DataView,
1020
+ "%Date%": Date,
1021
+ "%decodeURI%": decodeURI,
1022
+ "%decodeURIComponent%": decodeURIComponent,
1023
+ "%encodeURI%": encodeURI,
1024
+ "%encodeURIComponent%": encodeURIComponent,
1025
+ "%Error%": Wo,
1026
+ "%eval%": eval,
1027
+ // eslint-disable-line no-eval
1028
+ "%EvalError%": Go,
1029
+ "%Float16Array%": typeof Float16Array > "u" ? d : Float16Array,
1030
+ "%Float32Array%": typeof Float32Array > "u" ? d : Float32Array,
1031
+ "%Float64Array%": typeof Float64Array > "u" ? d : Float64Array,
1032
+ "%FinalizationRegistry%": typeof FinalizationRegistry > "u" ? d : FinalizationRegistry,
1033
+ "%Function%": or,
1034
+ "%GeneratorFunction%": H,
1035
+ "%Int8Array%": typeof Int8Array > "u" ? d : Int8Array,
1036
+ "%Int16Array%": typeof Int16Array > "u" ? d : Int16Array,
1037
+ "%Int32Array%": typeof Int32Array > "u" ? d : Int32Array,
1038
+ "%isFinite%": isFinite,
1039
+ "%isNaN%": isNaN,
1040
+ "%IteratorPrototype%": W && b ? b(b([][Symbol.iterator]())) : d,
1041
+ "%JSON%": typeof JSON == "object" ? JSON : d,
1042
+ "%Map%": typeof Map > "u" ? d : Map,
1043
+ "%MapIteratorPrototype%": typeof Map > "u" || !W || !b ? d : b((/* @__PURE__ */ new Map())[Symbol.iterator]()),
1044
+ "%Math%": Math,
1045
+ "%Number%": Number,
1046
+ "%Object%": zo,
1047
+ "%Object.getOwnPropertyDescriptor%": oe,
1048
+ "%parseFloat%": parseFloat,
1049
+ "%parseInt%": parseInt,
1050
+ "%Promise%": typeof Promise > "u" ? d : Promise,
1051
+ "%Proxy%": typeof Proxy > "u" ? d : Proxy,
1052
+ "%RangeError%": Ho,
1053
+ "%ReferenceError%": Ko,
1054
+ "%Reflect%": typeof Reflect > "u" ? d : Reflect,
1055
+ "%RegExp%": RegExp,
1056
+ "%Set%": typeof Set > "u" ? d : Set,
1057
+ "%SetIteratorPrototype%": typeof Set > "u" || !W || !b ? d : b((/* @__PURE__ */ new Set())[Symbol.iterator]()),
1058
+ "%SharedArrayBuffer%": typeof SharedArrayBuffer > "u" ? d : SharedArrayBuffer,
1059
+ "%String%": String,
1060
+ "%StringIteratorPrototype%": W && b ? b(""[Symbol.iterator]()) : d,
1061
+ "%Symbol%": W ? Symbol : d,
1062
+ "%SyntaxError%": Q,
1063
+ "%ThrowTypeError%": na,
1064
+ "%TypedArray%": ia,
1065
+ "%TypeError%": K,
1066
+ "%Uint8Array%": typeof Uint8Array > "u" ? d : Uint8Array,
1067
+ "%Uint8ClampedArray%": typeof Uint8ClampedArray > "u" ? d : Uint8ClampedArray,
1068
+ "%Uint16Array%": typeof Uint16Array > "u" ? d : Uint16Array,
1069
+ "%Uint32Array%": typeof Uint32Array > "u" ? d : Uint32Array,
1070
+ "%URIError%": Vo,
1071
+ "%WeakMap%": typeof WeakMap > "u" ? d : WeakMap,
1072
+ "%WeakRef%": typeof WeakRef > "u" ? d : WeakRef,
1073
+ "%WeakSet%": typeof WeakSet > "u" ? d : WeakSet,
1074
+ "%Function.prototype.call%": ae,
1075
+ "%Function.prototype.apply%": ar,
1076
+ "%Object.defineProperty%": ra,
1077
+ "%Object.getPrototypeOf%": oa,
1078
+ "%Math.abs%": Qo,
1079
+ "%Math.floor%": Jo,
1080
+ "%Math.max%": Yo,
1081
+ "%Math.min%": Xo,
1082
+ "%Math.pow%": Zo,
1083
+ "%Math.round%": ea,
1084
+ "%Math.sign%": ta,
1085
+ "%Reflect.getPrototypeOf%": aa
1086
+ };
1087
+ if (b)
1088
+ try {
1089
+ null.error;
1090
+ } catch (t) {
1091
+ var la = b(b(t));
1092
+ B["%Error.prototype%"] = la;
1093
+ }
1094
+ var ca = function t(e) {
1095
+ var r;
1096
+ if (e === "%AsyncFunction%")
1097
+ r = qe("async function () {}");
1098
+ else if (e === "%GeneratorFunction%")
1099
+ r = qe("function* () {}");
1100
+ else if (e === "%AsyncGeneratorFunction%")
1101
+ r = qe("async function* () {}");
1102
+ else if (e === "%AsyncGenerator%") {
1103
+ var n = t("%AsyncGeneratorFunction%");
1104
+ n && (r = n.prototype);
1105
+ } else if (e === "%AsyncIteratorPrototype%") {
1106
+ var o = t("%AsyncGenerator%");
1107
+ o && b && (r = b(o.prototype));
1108
+ }
1109
+ return B[e] = r, r;
1110
+ }, Mt = {
1111
+ __proto__: null,
1112
+ "%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"],
1113
+ "%ArrayPrototype%": ["Array", "prototype"],
1114
+ "%ArrayProto_entries%": ["Array", "prototype", "entries"],
1115
+ "%ArrayProto_forEach%": ["Array", "prototype", "forEach"],
1116
+ "%ArrayProto_keys%": ["Array", "prototype", "keys"],
1117
+ "%ArrayProto_values%": ["Array", "prototype", "values"],
1118
+ "%AsyncFunctionPrototype%": ["AsyncFunction", "prototype"],
1119
+ "%AsyncGenerator%": ["AsyncGeneratorFunction", "prototype"],
1120
+ "%AsyncGeneratorPrototype%": ["AsyncGeneratorFunction", "prototype", "prototype"],
1121
+ "%BooleanPrototype%": ["Boolean", "prototype"],
1122
+ "%DataViewPrototype%": ["DataView", "prototype"],
1123
+ "%DatePrototype%": ["Date", "prototype"],
1124
+ "%ErrorPrototype%": ["Error", "prototype"],
1125
+ "%EvalErrorPrototype%": ["EvalError", "prototype"],
1126
+ "%Float32ArrayPrototype%": ["Float32Array", "prototype"],
1127
+ "%Float64ArrayPrototype%": ["Float64Array", "prototype"],
1128
+ "%FunctionPrototype%": ["Function", "prototype"],
1129
+ "%Generator%": ["GeneratorFunction", "prototype"],
1130
+ "%GeneratorPrototype%": ["GeneratorFunction", "prototype", "prototype"],
1131
+ "%Int8ArrayPrototype%": ["Int8Array", "prototype"],
1132
+ "%Int16ArrayPrototype%": ["Int16Array", "prototype"],
1133
+ "%Int32ArrayPrototype%": ["Int32Array", "prototype"],
1134
+ "%JSONParse%": ["JSON", "parse"],
1135
+ "%JSONStringify%": ["JSON", "stringify"],
1136
+ "%MapPrototype%": ["Map", "prototype"],
1137
+ "%NumberPrototype%": ["Number", "prototype"],
1138
+ "%ObjectPrototype%": ["Object", "prototype"],
1139
+ "%ObjProto_toString%": ["Object", "prototype", "toString"],
1140
+ "%ObjProto_valueOf%": ["Object", "prototype", "valueOf"],
1141
+ "%PromisePrototype%": ["Promise", "prototype"],
1142
+ "%PromiseProto_then%": ["Promise", "prototype", "then"],
1143
+ "%Promise_all%": ["Promise", "all"],
1144
+ "%Promise_reject%": ["Promise", "reject"],
1145
+ "%Promise_resolve%": ["Promise", "resolve"],
1146
+ "%RangeErrorPrototype%": ["RangeError", "prototype"],
1147
+ "%ReferenceErrorPrototype%": ["ReferenceError", "prototype"],
1148
+ "%RegExpPrototype%": ["RegExp", "prototype"],
1149
+ "%SetPrototype%": ["Set", "prototype"],
1150
+ "%SharedArrayBufferPrototype%": ["SharedArrayBuffer", "prototype"],
1151
+ "%StringPrototype%": ["String", "prototype"],
1152
+ "%SymbolPrototype%": ["Symbol", "prototype"],
1153
+ "%SyntaxErrorPrototype%": ["SyntaxError", "prototype"],
1154
+ "%TypedArrayPrototype%": ["TypedArray", "prototype"],
1155
+ "%TypeErrorPrototype%": ["TypeError", "prototype"],
1156
+ "%Uint8ArrayPrototype%": ["Uint8Array", "prototype"],
1157
+ "%Uint8ClampedArrayPrototype%": ["Uint8ClampedArray", "prototype"],
1158
+ "%Uint16ArrayPrototype%": ["Uint16Array", "prototype"],
1159
+ "%Uint32ArrayPrototype%": ["Uint32Array", "prototype"],
1160
+ "%URIErrorPrototype%": ["URIError", "prototype"],
1161
+ "%WeakMapPrototype%": ["WeakMap", "prototype"],
1162
+ "%WeakSetPrototype%": ["WeakSet", "prototype"]
1163
+ }, ie = we(), he = qo(), fa = ie.call(ae, Array.prototype.concat), sa = ie.call(ar, Array.prototype.splice), jt = ie.call(ae, String.prototype.replace), _e = ie.call(ae, String.prototype.slice), ua = ie.call(ae, RegExp.prototype.exec), pa = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g, ya = /\\(\\)?/g, da = function(e) {
1164
+ var r = _e(e, 0, 1), n = _e(e, -1);
1165
+ if (r === "%" && n !== "%")
1166
+ throw new Q("invalid intrinsic syntax, expected closing `%`");
1167
+ if (n === "%" && r !== "%")
1168
+ throw new Q("invalid intrinsic syntax, expected opening `%`");
1169
+ var o = [];
1170
+ return jt(e, pa, function(a, i, f, l) {
1171
+ o[o.length] = f ? jt(l, ya, "$1") : i || a;
1172
+ }), o;
1173
+ }, va = function(e, r) {
1174
+ var n = e, o;
1175
+ if (he(Mt, n) && (o = Mt[n], n = "%" + o[0] + "%"), he(B, n)) {
1176
+ var a = B[n];
1177
+ if (a === H && (a = ca(n)), typeof a > "u" && !r)
1178
+ throw new K("intrinsic " + e + " exists, but is not available. Please file an issue!");
1179
+ return {
1180
+ alias: o,
1181
+ name: n,
1182
+ value: a
1183
+ };
1184
+ }
1185
+ throw new Q("intrinsic " + e + " does not exist!");
1186
+ }, at = function(e, r) {
1187
+ if (typeof e != "string" || e.length === 0)
1188
+ throw new K("intrinsic name must be a non-empty string");
1189
+ if (arguments.length > 1 && typeof r != "boolean")
1190
+ throw new K('"allowMissing" argument must be a boolean');
1191
+ if (ua(/^%?[^%]*%?$/, e) === null)
1192
+ throw new Q("`%` may not be present anywhere but at the beginning and end of the intrinsic name");
1193
+ var n = da(e), o = n.length > 0 ? n[0] : "", a = va("%" + o + "%", r), i = a.name, f = a.value, l = !1, s = a.alias;
1194
+ s && (o = s[0], sa(n, fa([0, 1], s)));
1195
+ for (var c = 1, p = !0; c < n.length; c += 1) {
1196
+ var u = n[c], v = _e(u, 0, 1), y = _e(u, -1);
1197
+ if ((v === '"' || v === "'" || v === "`" || y === '"' || y === "'" || y === "`") && v !== y)
1198
+ throw new Q("property names with quotes must have matching quotes");
1199
+ if ((u === "constructor" || !p) && (l = !0), o += "." + u, i = "%" + o + "%", he(B, i))
1200
+ f = B[i];
1201
+ else if (f != null) {
1202
+ if (!(u in f)) {
1203
+ if (!r)
1204
+ throw new K("base intrinsic for " + e + " exists, but the property is not available.");
1205
+ return;
1206
+ }
1207
+ if (oe && c + 1 >= n.length) {
1208
+ var h = oe(f, u);
1209
+ p = !!h, p && "get" in h && !("originalValue" in h.get) ? f = h.get : f = f[u];
1210
+ } else
1211
+ p = he(f, u), f = f[u];
1212
+ p && !l && (B[i] = f);
1213
+ }
1214
+ }
1215
+ return f;
1216
+ }, ir = at, lr = nr, ma = lr([ir("%String.prototype.indexOf%")]), cr = function(e, r) {
1217
+ var n = (
1218
+ /** @type {(this: unknown, ...args: unknown[]) => unknown} */
1219
+ ir(e, !!r)
1220
+ );
1221
+ return typeof n == "function" && ma(e, ".prototype.") > -1 ? lr(
1222
+ /** @type {const} */
1223
+ [n]
1224
+ ) : n;
1225
+ }, ga = at, le = cr, ha = be, _a = J, Bt = ga("%Map%", !0), ba = le("Map.prototype.get", !0), Sa = le("Map.prototype.set", !0), wa = le("Map.prototype.has", !0), xa = le("Map.prototype.delete", !0), Aa = le("Map.prototype.size", !0), fr = !!Bt && /** @type {Exclude<import('.'), false>} */
1226
+ function() {
1227
+ var e, r = {
1228
+ assert: function(n) {
1229
+ if (!r.has(n))
1230
+ throw new _a("Side channel does not contain " + ha(n));
1231
+ },
1232
+ delete: function(n) {
1233
+ if (e) {
1234
+ var o = xa(e, n);
1235
+ return Aa(e) === 0 && (e = void 0), o;
1236
+ }
1237
+ return !1;
1238
+ },
1239
+ get: function(n) {
1240
+ if (e)
1241
+ return ba(e, n);
1242
+ },
1243
+ has: function(n) {
1244
+ return e ? wa(e, n) : !1;
1245
+ },
1246
+ set: function(n, o) {
1247
+ e || (e = new Bt()), Sa(e, n, o);
1248
+ }
1249
+ };
1250
+ return r;
1251
+ }, Oa = at, xe = cr, Ea = be, pe = fr, Pa = J, G = Oa("%WeakMap%", !0), $a = xe("WeakMap.prototype.get", !0), Ia = xe("WeakMap.prototype.set", !0), Ra = xe("WeakMap.prototype.has", !0), ka = xe("WeakMap.prototype.delete", !0), Ca = G ? (
1252
+ /** @type {Exclude<import('.'), false>} */
1253
+ function() {
1254
+ var e, r, n = {
1255
+ assert: function(o) {
1256
+ if (!n.has(o))
1257
+ throw new Pa("Side channel does not contain " + Ea(o));
1258
+ },
1259
+ delete: function(o) {
1260
+ if (G && o && (typeof o == "object" || typeof o == "function")) {
1261
+ if (e)
1262
+ return ka(e, o);
1263
+ } else if (pe && r)
1264
+ return r.delete(o);
1265
+ return !1;
1266
+ },
1267
+ get: function(o) {
1268
+ return G && o && (typeof o == "object" || typeof o == "function") && e ? $a(e, o) : r && r.get(o);
1269
+ },
1270
+ has: function(o) {
1271
+ return G && o && (typeof o == "object" || typeof o == "function") && e ? Ra(e, o) : !!r && r.has(o);
1272
+ },
1273
+ set: function(o, a) {
1274
+ G && o && (typeof o == "object" || typeof o == "function") ? (e || (e = new G()), Ia(e, o, a)) : pe && (r || (r = pe()), r.set(o, a));
1275
+ }
1276
+ };
1277
+ return n;
1278
+ }
1279
+ ) : pe, Ta = J, Fa = be, Da = co, Na = fr, Ma = Ca, ja = Ma || Na || Da, Ba = function() {
1280
+ var e, r = {
1281
+ assert: function(n) {
1282
+ if (!r.has(n))
1283
+ throw new Ta("Side channel does not contain " + Fa(n));
1284
+ },
1285
+ delete: function(n) {
1286
+ return !!e && e.delete(n);
1287
+ },
1288
+ get: function(n) {
1289
+ return e && e.get(n);
1290
+ },
1291
+ has: function(n) {
1292
+ return !!e && e.has(n);
1293
+ },
1294
+ set: function(n, o) {
1295
+ e || (e = ja()), e.set(n, o);
1296
+ }
1297
+ };
1298
+ return r;
1299
+ }, La = String.prototype.replace, Ua = /%20/g, We = {
1300
+ RFC1738: "RFC1738",
1301
+ RFC3986: "RFC3986"
1302
+ }, it = {
1303
+ default: We.RFC3986,
1304
+ formatters: {
1305
+ RFC1738: function(t) {
1306
+ return La.call(t, Ua, "+");
1307
+ },
1308
+ RFC3986: function(t) {
1309
+ return String(t);
1310
+ }
1311
+ },
1312
+ RFC1738: We.RFC1738,
1313
+ RFC3986: We.RFC3986
1314
+ }, qa = it, Ge = Object.prototype.hasOwnProperty, j = Array.isArray, A = function() {
1315
+ for (var t = [], e = 0; e < 256; ++e)
1316
+ t.push("%" + ((e < 16 ? "0" : "") + e.toString(16)).toUpperCase());
1317
+ return t;
1318
+ }(), za = function(e) {
1319
+ for (; e.length > 1; ) {
1320
+ var r = e.pop(), n = r.obj[r.prop];
1321
+ if (j(n)) {
1322
+ for (var o = [], a = 0; a < n.length; ++a)
1323
+ typeof n[a] < "u" && o.push(n[a]);
1324
+ r.obj[r.prop] = o;
1325
+ }
1326
+ }
1327
+ }, sr = function(e, r) {
1328
+ for (var n = r && r.plainObjects ? { __proto__: null } : {}, o = 0; o < e.length; ++o)
1329
+ typeof e[o] < "u" && (n[o] = e[o]);
1330
+ return n;
1331
+ }, Wa = function t(e, r, n) {
1332
+ if (!r)
1333
+ return e;
1334
+ if (typeof r != "object" && typeof r != "function") {
1335
+ if (j(e))
1336
+ e.push(r);
1337
+ else if (e && typeof e == "object")
1338
+ (n && (n.plainObjects || n.allowPrototypes) || !Ge.call(Object.prototype, r)) && (e[r] = !0);
1339
+ else
1340
+ return [e, r];
1341
+ return e;
1342
+ }
1343
+ if (!e || typeof e != "object")
1344
+ return [e].concat(r);
1345
+ var o = e;
1346
+ return j(e) && !j(r) && (o = sr(e, n)), j(e) && j(r) ? (r.forEach(function(a, i) {
1347
+ if (Ge.call(e, i)) {
1348
+ var f = e[i];
1349
+ f && typeof f == "object" && a && typeof a == "object" ? e[i] = t(f, a, n) : e.push(a);
1350
+ } else
1351
+ e[i] = a;
1352
+ }), e) : Object.keys(r).reduce(function(a, i) {
1353
+ var f = r[i];
1354
+ return Ge.call(a, i) ? a[i] = t(a[i], f, n) : a[i] = f, a;
1355
+ }, o);
1356
+ }, Ga = function(e, r) {
1357
+ return Object.keys(r).reduce(function(n, o) {
1358
+ return n[o] = r[o], n;
1359
+ }, e);
1360
+ }, Ha = function(t, e, r) {
1361
+ var n = t.replace(/\+/g, " ");
1362
+ if (r === "iso-8859-1")
1363
+ return n.replace(/%[0-9a-f]{2}/gi, unescape);
1364
+ try {
1365
+ return decodeURIComponent(n);
1366
+ } catch {
1367
+ return n;
1368
+ }
1369
+ }, He = 1024, Ka = function(e, r, n, o, a) {
1370
+ if (e.length === 0)
1371
+ return e;
1372
+ var i = e;
1373
+ if (typeof e == "symbol" ? i = Symbol.prototype.toString.call(e) : typeof e != "string" && (i = String(e)), n === "iso-8859-1")
1374
+ return escape(i).replace(/%u[0-9a-f]{4}/gi, function(v) {
1375
+ return "%26%23" + parseInt(v.slice(2), 16) + "%3B";
1376
+ });
1377
+ for (var f = "", l = 0; l < i.length; l += He) {
1378
+ for (var s = i.length >= He ? i.slice(l, l + He) : i, c = [], p = 0; p < s.length; ++p) {
1379
+ var u = s.charCodeAt(p);
1380
+ if (u === 45 || u === 46 || u === 95 || u === 126 || u >= 48 && u <= 57 || u >= 65 && u <= 90 || u >= 97 && u <= 122 || a === qa.RFC1738 && (u === 40 || u === 41)) {
1381
+ c[c.length] = s.charAt(p);
1382
+ continue;
1383
+ }
1384
+ if (u < 128) {
1385
+ c[c.length] = A[u];
1386
+ continue;
1387
+ }
1388
+ if (u < 2048) {
1389
+ c[c.length] = A[192 | u >> 6] + A[128 | u & 63];
1390
+ continue;
1391
+ }
1392
+ if (u < 55296 || u >= 57344) {
1393
+ c[c.length] = A[224 | u >> 12] + A[128 | u >> 6 & 63] + A[128 | u & 63];
1394
+ continue;
1395
+ }
1396
+ p += 1, u = 65536 + ((u & 1023) << 10 | s.charCodeAt(p) & 1023), c[c.length] = A[240 | u >> 18] + A[128 | u >> 12 & 63] + A[128 | u >> 6 & 63] + A[128 | u & 63];
1397
+ }
1398
+ f += c.join("");
1399
+ }
1400
+ return f;
1401
+ }, Va = function(e) {
1402
+ for (var r = [{ obj: { o: e }, prop: "o" }], n = [], o = 0; o < r.length; ++o)
1403
+ for (var a = r[o], i = a.obj[a.prop], f = Object.keys(i), l = 0; l < f.length; ++l) {
1404
+ var s = f[l], c = i[s];
1405
+ typeof c == "object" && c !== null && n.indexOf(c) === -1 && (r.push({ obj: i, prop: s }), n.push(c));
1406
+ }
1407
+ return za(r), e;
1408
+ }, Qa = function(e) {
1409
+ return Object.prototype.toString.call(e) === "[object RegExp]";
1410
+ }, Ja = function(e) {
1411
+ return !e || typeof e != "object" ? !1 : !!(e.constructor && e.constructor.isBuffer && e.constructor.isBuffer(e));
1412
+ }, Ya = function(e, r) {
1413
+ return [].concat(e, r);
1414
+ }, Xa = function(e, r) {
1415
+ if (j(e)) {
1416
+ for (var n = [], o = 0; o < e.length; o += 1)
1417
+ n.push(r(e[o]));
1418
+ return n;
1419
+ }
1420
+ return r(e);
1421
+ }, ur = {
1422
+ arrayToObject: sr,
1423
+ assign: Ga,
1424
+ combine: Ya,
1425
+ compact: Va,
1426
+ decode: Ha,
1427
+ encode: Ka,
1428
+ isBuffer: Ja,
1429
+ isRegExp: Qa,
1430
+ maybeMap: Xa,
1431
+ merge: Wa
1432
+ }, pr = Ba, ve = ur, ne = it, Za = Object.prototype.hasOwnProperty, yr = {
1433
+ brackets: function(e) {
1434
+ return e + "[]";
1435
+ },
1436
+ comma: "comma",
1437
+ indices: function(e, r) {
1438
+ return e + "[" + r + "]";
1439
+ },
1440
+ repeat: function(e) {
1441
+ return e;
1442
+ }
1443
+ }, O = Array.isArray, ei = Array.prototype.push, dr = function(t, e) {
1444
+ ei.apply(t, O(e) ? e : [e]);
1445
+ }, ti = Date.prototype.toISOString, Lt = ne.default, _ = {
1446
+ addQueryPrefix: !1,
1447
+ allowDots: !1,
1448
+ allowEmptyArrays: !1,
1449
+ arrayFormat: "indices",
1450
+ charset: "utf-8",
1451
+ charsetSentinel: !1,
1452
+ commaRoundTrip: !1,
1453
+ delimiter: "&",
1454
+ encode: !0,
1455
+ encodeDotInKeys: !1,
1456
+ encoder: ve.encode,
1457
+ encodeValuesOnly: !1,
1458
+ filter: void 0,
1459
+ format: Lt,
1460
+ formatter: ne.formatters[Lt],
1461
+ // deprecated
1462
+ indices: !1,
1463
+ serializeDate: function(e) {
1464
+ return ti.call(e);
1465
+ },
1466
+ skipNulls: !1,
1467
+ strictNullHandling: !1
1468
+ }, ri = function(e) {
1469
+ return typeof e == "string" || typeof e == "number" || typeof e == "boolean" || typeof e == "symbol" || typeof e == "bigint";
1470
+ }, Ke = {}, ni = function t(e, r, n, o, a, i, f, l, s, c, p, u, v, y, h, S, w, R) {
1471
+ for (var m = e, k = R, N = 0, Y = !1; (k = k.get(Ke)) !== void 0 && !Y; ) {
1472
+ var q = k.get(e);
1473
+ if (N += 1, typeof q < "u") {
1474
+ if (q === N)
1475
+ throw new RangeError("Cyclic object value");
1476
+ Y = !0;
1477
+ }
1478
+ typeof k.get(Ke) > "u" && (N = 0);
1479
+ }
1480
+ if (typeof c == "function" ? m = c(r, m) : m instanceof Date ? m = v(m) : n === "comma" && O(m) && (m = ve.maybeMap(m, function(Ee) {
1481
+ return Ee instanceof Date ? v(Ee) : Ee;
1482
+ })), m === null) {
1483
+ if (i)
1484
+ return s && !S ? s(r, _.encoder, w, "key", y) : r;
1485
+ m = "";
1486
+ }
1487
+ if (ri(m) || ve.isBuffer(m)) {
1488
+ if (s) {
1489
+ var ce = S ? r : s(r, _.encoder, w, "key", y);
1490
+ return [h(ce) + "=" + h(s(m, _.encoder, w, "value", y))];
1491
+ }
1492
+ return [h(r) + "=" + h(String(m))];
1493
+ }
1494
+ var M = [];
1495
+ if (typeof m > "u")
1496
+ return M;
1497
+ var C;
1498
+ if (n === "comma" && O(m))
1499
+ S && s && (m = ve.maybeMap(m, s)), C = [{ value: m.length > 0 ? m.join(",") || null : void 0 }];
1500
+ else if (O(c))
1501
+ C = c;
1502
+ else {
1503
+ var fe = Object.keys(m);
1504
+ C = p ? fe.sort(p) : fe;
1505
+ }
1506
+ var z = l ? String(r).replace(/\./g, "%2E") : String(r), x = o && O(m) && m.length === 1 ? z + "[]" : z;
1507
+ if (a && O(m) && m.length === 0)
1508
+ return x + "[]";
1509
+ for (var T = 0; T < C.length; ++T) {
1510
+ var P = C[T], X = typeof P == "object" && P && typeof P.value < "u" ? P.value : m[P];
1511
+ if (!(f && X === null)) {
1512
+ var Oe = u && l ? String(P).replace(/\./g, "%2E") : String(P), br = O(m) ? typeof n == "function" ? n(x, Oe) : x : x + (u ? "." + Oe : "[" + Oe + "]");
1513
+ R.set(e, N);
1514
+ var ct = pr();
1515
+ ct.set(Ke, R), dr(M, t(
1516
+ X,
1517
+ br,
1518
+ n,
1519
+ o,
1520
+ a,
1521
+ i,
1522
+ f,
1523
+ l,
1524
+ n === "comma" && S && O(m) ? null : s,
1525
+ c,
1526
+ p,
1527
+ u,
1528
+ v,
1529
+ y,
1530
+ h,
1531
+ S,
1532
+ w,
1533
+ ct
1534
+ ));
1535
+ }
1536
+ }
1537
+ return M;
1538
+ }, oi = function(e) {
1539
+ if (!e)
1540
+ return _;
1541
+ if (typeof e.allowEmptyArrays < "u" && typeof e.allowEmptyArrays != "boolean")
1542
+ throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");
1543
+ if (typeof e.encodeDotInKeys < "u" && typeof e.encodeDotInKeys != "boolean")
1544
+ throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");
1545
+ if (e.encoder !== null && typeof e.encoder < "u" && typeof e.encoder != "function")
1546
+ throw new TypeError("Encoder has to be a function.");
1547
+ var r = e.charset || _.charset;
1548
+ if (typeof e.charset < "u" && e.charset !== "utf-8" && e.charset !== "iso-8859-1")
1549
+ throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");
1550
+ var n = ne.default;
1551
+ if (typeof e.format < "u") {
1552
+ if (!Za.call(ne.formatters, e.format))
1553
+ throw new TypeError("Unknown format option provided.");
1554
+ n = e.format;
1555
+ }
1556
+ var o = ne.formatters[n], a = _.filter;
1557
+ (typeof e.filter == "function" || O(e.filter)) && (a = e.filter);
1558
+ var i;
1559
+ if (e.arrayFormat in yr ? i = e.arrayFormat : "indices" in e ? i = e.indices ? "indices" : "repeat" : i = _.arrayFormat, "commaRoundTrip" in e && typeof e.commaRoundTrip != "boolean")
1560
+ throw new TypeError("`commaRoundTrip` must be a boolean, or absent");
1561
+ var f = typeof e.allowDots > "u" ? e.encodeDotInKeys === !0 ? !0 : _.allowDots : !!e.allowDots;
1562
+ return {
1563
+ addQueryPrefix: typeof e.addQueryPrefix == "boolean" ? e.addQueryPrefix : _.addQueryPrefix,
1564
+ allowDots: f,
1565
+ allowEmptyArrays: typeof e.allowEmptyArrays == "boolean" ? !!e.allowEmptyArrays : _.allowEmptyArrays,
1566
+ arrayFormat: i,
1567
+ charset: r,
1568
+ charsetSentinel: typeof e.charsetSentinel == "boolean" ? e.charsetSentinel : _.charsetSentinel,
1569
+ commaRoundTrip: !!e.commaRoundTrip,
1570
+ delimiter: typeof e.delimiter > "u" ? _.delimiter : e.delimiter,
1571
+ encode: typeof e.encode == "boolean" ? e.encode : _.encode,
1572
+ encodeDotInKeys: typeof e.encodeDotInKeys == "boolean" ? e.encodeDotInKeys : _.encodeDotInKeys,
1573
+ encoder: typeof e.encoder == "function" ? e.encoder : _.encoder,
1574
+ encodeValuesOnly: typeof e.encodeValuesOnly == "boolean" ? e.encodeValuesOnly : _.encodeValuesOnly,
1575
+ filter: a,
1576
+ format: n,
1577
+ formatter: o,
1578
+ serializeDate: typeof e.serializeDate == "function" ? e.serializeDate : _.serializeDate,
1579
+ skipNulls: typeof e.skipNulls == "boolean" ? e.skipNulls : _.skipNulls,
1580
+ sort: typeof e.sort == "function" ? e.sort : null,
1581
+ strictNullHandling: typeof e.strictNullHandling == "boolean" ? e.strictNullHandling : _.strictNullHandling
1582
+ };
1583
+ }, ai = function(t, e) {
1584
+ var r = t, n = oi(e), o, a;
1585
+ typeof n.filter == "function" ? (a = n.filter, r = a("", r)) : O(n.filter) && (a = n.filter, o = a);
1586
+ var i = [];
1587
+ if (typeof r != "object" || r === null)
1588
+ return "";
1589
+ var f = yr[n.arrayFormat], l = f === "comma" && n.commaRoundTrip;
1590
+ o || (o = Object.keys(r)), n.sort && o.sort(n.sort);
1591
+ for (var s = pr(), c = 0; c < o.length; ++c) {
1592
+ var p = o[c], u = r[p];
1593
+ n.skipNulls && u === null || dr(i, ni(
1594
+ u,
1595
+ p,
1596
+ f,
1597
+ l,
1598
+ n.allowEmptyArrays,
1599
+ n.strictNullHandling,
1600
+ n.skipNulls,
1601
+ n.encodeDotInKeys,
1602
+ n.encode ? n.encoder : null,
1603
+ n.filter,
1604
+ n.sort,
1605
+ n.allowDots,
1606
+ n.serializeDate,
1607
+ n.format,
1608
+ n.formatter,
1609
+ n.encodeValuesOnly,
1610
+ n.charset,
1611
+ s
1612
+ ));
1613
+ }
1614
+ var v = i.join(n.delimiter), y = n.addQueryPrefix === !0 ? "?" : "";
1615
+ return n.charsetSentinel && (n.charset === "iso-8859-1" ? y += "utf8=%26%2310003%3B&" : y += "utf8=%E2%9C%93&"), v.length > 0 ? y + v : "";
1616
+ }, L = ur, et = Object.prototype.hasOwnProperty, Ut = Array.isArray, g = {
1617
+ allowDots: !1,
1618
+ allowEmptyArrays: !1,
1619
+ allowPrototypes: !1,
1620
+ allowSparse: !1,
1621
+ arrayLimit: 20,
1622
+ charset: "utf-8",
1623
+ charsetSentinel: !1,
1624
+ comma: !1,
1625
+ decodeDotInKeys: !1,
1626
+ decoder: L.decode,
1627
+ delimiter: "&",
1628
+ depth: 5,
1629
+ duplicates: "combine",
1630
+ ignoreQueryPrefix: !1,
1631
+ interpretNumericEntities: !1,
1632
+ parameterLimit: 1e3,
1633
+ parseArrays: !0,
1634
+ plainObjects: !1,
1635
+ strictDepth: !1,
1636
+ strictNullHandling: !1,
1637
+ throwOnLimitExceeded: !1
1638
+ }, ii = function(t) {
1639
+ return t.replace(/&#(\d+);/g, function(e, r) {
1640
+ return String.fromCharCode(parseInt(r, 10));
1641
+ });
1642
+ }, vr = function(t, e, r) {
1643
+ if (t && typeof t == "string" && e.comma && t.indexOf(",") > -1)
1644
+ return t.split(",");
1645
+ if (e.throwOnLimitExceeded && r >= e.arrayLimit)
1646
+ throw new RangeError("Array limit exceeded. Only " + e.arrayLimit + " element" + (e.arrayLimit === 1 ? "" : "s") + " allowed in an array.");
1647
+ return t;
1648
+ }, li = "utf8=%26%2310003%3B", ci = "utf8=%E2%9C%93", fi = function(e, r) {
1649
+ var n = { __proto__: null }, o = r.ignoreQueryPrefix ? e.replace(/^\?/, "") : e;
1650
+ o = o.replace(/%5B/gi, "[").replace(/%5D/gi, "]");
1651
+ var a = r.parameterLimit === 1 / 0 ? void 0 : r.parameterLimit, i = o.split(
1652
+ r.delimiter,
1653
+ r.throwOnLimitExceeded ? a + 1 : a
1654
+ );
1655
+ if (r.throwOnLimitExceeded && i.length > a)
1656
+ throw new RangeError("Parameter limit exceeded. Only " + a + " parameter" + (a === 1 ? "" : "s") + " allowed.");
1657
+ var f = -1, l, s = r.charset;
1658
+ if (r.charsetSentinel)
1659
+ for (l = 0; l < i.length; ++l)
1660
+ i[l].indexOf("utf8=") === 0 && (i[l] === ci ? s = "utf-8" : i[l] === li && (s = "iso-8859-1"), f = l, l = i.length);
1661
+ for (l = 0; l < i.length; ++l)
1662
+ if (l !== f) {
1663
+ var c = i[l], p = c.indexOf("]="), u = p === -1 ? c.indexOf("=") : p + 1, v, y;
1664
+ u === -1 ? (v = r.decoder(c, g.decoder, s, "key"), y = r.strictNullHandling ? null : "") : (v = r.decoder(c.slice(0, u), g.decoder, s, "key"), y = L.maybeMap(
1665
+ vr(
1666
+ c.slice(u + 1),
1667
+ r,
1668
+ Ut(n[v]) ? n[v].length : 0
1669
+ ),
1670
+ function(S) {
1671
+ return r.decoder(S, g.decoder, s, "value");
1672
+ }
1673
+ )), y && r.interpretNumericEntities && s === "iso-8859-1" && (y = ii(String(y))), c.indexOf("[]=") > -1 && (y = Ut(y) ? [y] : y);
1674
+ var h = et.call(n, v);
1675
+ h && r.duplicates === "combine" ? n[v] = L.combine(n[v], y) : (!h || r.duplicates === "last") && (n[v] = y);
1676
+ }
1677
+ return n;
1678
+ }, si = function(t, e, r, n) {
1679
+ var o = 0;
1680
+ if (t.length > 0 && t[t.length - 1] === "[]") {
1681
+ var a = t.slice(0, -1).join("");
1682
+ o = Array.isArray(e) && e[a] ? e[a].length : 0;
1683
+ }
1684
+ for (var i = n ? e : vr(e, r, o), f = t.length - 1; f >= 0; --f) {
1685
+ var l, s = t[f];
1686
+ if (s === "[]" && r.parseArrays)
1687
+ l = r.allowEmptyArrays && (i === "" || r.strictNullHandling && i === null) ? [] : L.combine([], i);
1688
+ else {
1689
+ l = r.plainObjects ? { __proto__: null } : {};
1690
+ var c = s.charAt(0) === "[" && s.charAt(s.length - 1) === "]" ? s.slice(1, -1) : s, p = r.decodeDotInKeys ? c.replace(/%2E/g, ".") : c, u = parseInt(p, 10);
1691
+ !r.parseArrays && p === "" ? l = { 0: i } : !isNaN(u) && s !== p && String(u) === p && u >= 0 && r.parseArrays && u <= r.arrayLimit ? (l = [], l[u] = i) : p !== "__proto__" && (l[p] = i);
1692
+ }
1693
+ i = l;
1694
+ }
1695
+ return i;
1696
+ }, ui = function(e, r, n, o) {
1697
+ if (e) {
1698
+ var a = n.allowDots ? e.replace(/\.([^.[]+)/g, "[$1]") : e, i = /(\[[^[\]]*])/, f = /(\[[^[\]]*])/g, l = n.depth > 0 && i.exec(a), s = l ? a.slice(0, l.index) : a, c = [];
1699
+ if (s) {
1700
+ if (!n.plainObjects && et.call(Object.prototype, s) && !n.allowPrototypes)
1701
+ return;
1702
+ c.push(s);
1703
+ }
1704
+ for (var p = 0; n.depth > 0 && (l = f.exec(a)) !== null && p < n.depth; ) {
1705
+ if (p += 1, !n.plainObjects && et.call(Object.prototype, l[1].slice(1, -1)) && !n.allowPrototypes)
1706
+ return;
1707
+ c.push(l[1]);
1708
+ }
1709
+ if (l) {
1710
+ if (n.strictDepth === !0)
1711
+ throw new RangeError("Input depth exceeded depth option of " + n.depth + " and strictDepth is true");
1712
+ c.push("[" + a.slice(l.index) + "]");
1713
+ }
1714
+ return si(c, r, n, o);
1715
+ }
1716
+ }, pi = function(e) {
1717
+ if (!e)
1718
+ return g;
1719
+ if (typeof e.allowEmptyArrays < "u" && typeof e.allowEmptyArrays != "boolean")
1720
+ throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");
1721
+ if (typeof e.decodeDotInKeys < "u" && typeof e.decodeDotInKeys != "boolean")
1722
+ throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");
1723
+ if (e.decoder !== null && typeof e.decoder < "u" && typeof e.decoder != "function")
1724
+ throw new TypeError("Decoder has to be a function.");
1725
+ if (typeof e.charset < "u" && e.charset !== "utf-8" && e.charset !== "iso-8859-1")
1726
+ throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");
1727
+ if (typeof e.throwOnLimitExceeded < "u" && typeof e.throwOnLimitExceeded != "boolean")
1728
+ throw new TypeError("`throwOnLimitExceeded` option must be a boolean");
1729
+ var r = typeof e.charset > "u" ? g.charset : e.charset, n = typeof e.duplicates > "u" ? g.duplicates : e.duplicates;
1730
+ if (n !== "combine" && n !== "first" && n !== "last")
1731
+ throw new TypeError("The duplicates option must be either combine, first, or last");
1732
+ var o = typeof e.allowDots > "u" ? e.decodeDotInKeys === !0 ? !0 : g.allowDots : !!e.allowDots;
1733
+ return {
1734
+ allowDots: o,
1735
+ allowEmptyArrays: typeof e.allowEmptyArrays == "boolean" ? !!e.allowEmptyArrays : g.allowEmptyArrays,
1736
+ allowPrototypes: typeof e.allowPrototypes == "boolean" ? e.allowPrototypes : g.allowPrototypes,
1737
+ allowSparse: typeof e.allowSparse == "boolean" ? e.allowSparse : g.allowSparse,
1738
+ arrayLimit: typeof e.arrayLimit == "number" ? e.arrayLimit : g.arrayLimit,
1739
+ charset: r,
1740
+ charsetSentinel: typeof e.charsetSentinel == "boolean" ? e.charsetSentinel : g.charsetSentinel,
1741
+ comma: typeof e.comma == "boolean" ? e.comma : g.comma,
1742
+ decodeDotInKeys: typeof e.decodeDotInKeys == "boolean" ? e.decodeDotInKeys : g.decodeDotInKeys,
1743
+ decoder: typeof e.decoder == "function" ? e.decoder : g.decoder,
1744
+ delimiter: typeof e.delimiter == "string" || L.isRegExp(e.delimiter) ? e.delimiter : g.delimiter,
1745
+ // eslint-disable-next-line no-implicit-coercion, no-extra-parens
1746
+ depth: typeof e.depth == "number" || e.depth === !1 ? +e.depth : g.depth,
1747
+ duplicates: n,
1748
+ ignoreQueryPrefix: e.ignoreQueryPrefix === !0,
1749
+ interpretNumericEntities: typeof e.interpretNumericEntities == "boolean" ? e.interpretNumericEntities : g.interpretNumericEntities,
1750
+ parameterLimit: typeof e.parameterLimit == "number" ? e.parameterLimit : g.parameterLimit,
1751
+ parseArrays: e.parseArrays !== !1,
1752
+ plainObjects: typeof e.plainObjects == "boolean" ? e.plainObjects : g.plainObjects,
1753
+ strictDepth: typeof e.strictDepth == "boolean" ? !!e.strictDepth : g.strictDepth,
1754
+ strictNullHandling: typeof e.strictNullHandling == "boolean" ? e.strictNullHandling : g.strictNullHandling,
1755
+ throwOnLimitExceeded: typeof e.throwOnLimitExceeded == "boolean" ? e.throwOnLimitExceeded : !1
1756
+ };
1757
+ }, yi = function(t, e) {
1758
+ var r = pi(e);
1759
+ if (t === "" || t === null || typeof t > "u")
1760
+ return r.plainObjects ? { __proto__: null } : {};
1761
+ for (var n = typeof t == "string" ? fi(t, r) : t, o = r.plainObjects ? { __proto__: null } : {}, a = Object.keys(n), i = 0; i < a.length; ++i) {
1762
+ var f = a[i], l = ui(f, n[f], r, typeof t == "string");
1763
+ o = L.merge(o, l, r);
1764
+ }
1765
+ return r.allowSparse === !0 ? o : L.compact(o);
1766
+ }, di = ai, vi = yi, mi = it, gi = {
1767
+ formats: mi,
1768
+ parse: vi,
1769
+ stringify: di
1770
+ };
1771
+ const hi = /* @__PURE__ */ Gr(gi);
1772
+ async function Ae(t, e = {}, r) {
1773
+ const { cms: n = "cms" } = e;
1774
+ return fetch(`${t.href}?${hi.stringify(e)}`, {
1775
+ method: "GET",
1776
+ cache: r ? "no-store" : "default",
1777
+ headers: {
1778
+ Accept: "application/json",
1779
+ "Content-Type": "application/json",
1780
+ "strapi-encode-source-maps": n === "strapi" && r ? "true" : "false"
1781
+ // strapi
1782
+ }
1783
+ });
1784
+ }
1785
+ function lt(t, e) {
1786
+ return !(e != null && e.cms) || (e == null ? void 0 : e.cms) === "vtex" ? `https://${e == null ? void 0 : e.storeId}.myvtex.com/_v/cms/api/${e == null ? void 0 : e.name}/${t}` : String(
1787
+ new URL(`api/${t}`, process.env.NEXT_PUBLIC_API_URL)
1788
+ );
1789
+ }
1790
+ function mr(t) {
1791
+ return Array.isArray(t) && t.length > 0 ? t[0] : Array.isArray(t) ? null : t;
1792
+ }
1793
+ async function gr(t, e = [], r = {}) {
1794
+ var n;
1795
+ if ((r == null ? void 0 : r.contentType) === t) {
1796
+ const o = (r == null ? void 0 : r.previewMode) === "true", a = (r == null ? void 0 : r.documentId) ?? "", i = a && ((n = String(a)) != null && n.length) ? `/${r.documentId}` : "", f = new URL(lt(`${t}${i}`, r)), l = await Ae(f, r, o);
1797
+ if (!l.ok)
1798
+ return console.error(`[Error fetching preview data]: ${t} - status: ${l.statusText}`), [];
1799
+ const s = await l.json(), c = e.findIndex((p) => p.documentId === s.id);
1800
+ return c !== -1 ? (e[c] = s, [...e]) : [s, ...e];
1801
+ }
1802
+ return e;
1803
+ }
1804
+ const Di = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1805
+ __proto__: null,
1806
+ createUrl: lt,
1807
+ fetchCMS: Ae,
1808
+ mergePreviewDocument: gr,
1809
+ spreadStrapiData: mr
1810
+ }, Symbol.toStringTag, { value: "Module" }));
1811
+ async function hr(t, e = {}, r) {
1812
+ const n = !!(e != null && e.previewMode), o = await Ae(t, e, n);
1813
+ if (!o.ok)
1814
+ return console.log(
1815
+ `Failed to fetch Strapi (url=${String(t)}, status=${o.status})`
1816
+ ), { status: 404, data: [], error: String(o.status) };
1817
+ const { data: a } = await o.json();
1818
+ return a ? {
1819
+ status: 200,
1820
+ data: r ? mr(a) : a
1821
+ } : { status: 404, data: [], error: "No data found" };
1822
+ }
1823
+ async function _r(t, e, r = {}) {
1824
+ const n = (r == null ? void 0 : r.previewId) ?? "", o = (r == null ? void 0 : r.previewMode) === "true", a = { ...r, versionId: n }, i = [];
1825
+ let f = 1, l = 0, s = !0;
1826
+ try {
1827
+ do {
1828
+ const c = await Ae(e, { ...a, page: f }, o).then((p) => p.json()).catch((p) => (console.error("Error fetching VTEX CMS data:", p), console.error("Error URL:", e.toString()), null));
1829
+ f === 1 && (l = c.totalItems), Array.isArray(c == null ? void 0 : c.data) && i.push(...c.data), s = !!(c != null && c.hasNextPage), f++;
1830
+ } while (s && i.length < l);
1831
+ if (o && i.length > 0) {
1832
+ if (!t || !n)
1833
+ throw new Error(
1834
+ "contentType and previewId are required for preview mode in vtexCMSData"
1835
+ );
1836
+ const c = await gr(
1837
+ t,
1838
+ i,
1839
+ a
1840
+ );
1841
+ return {
1842
+ status: c.length > 0 ? 200 : 404,
1843
+ data: c
1844
+ };
1845
+ }
1846
+ return {
1847
+ status: i.length ? 200 : 404,
1848
+ data: i
1849
+ };
1850
+ } catch (c) {
1851
+ return {
1852
+ status: 500,
1853
+ data: [],
1854
+ error: c instanceof Error ? c.message : String(c)
1855
+ };
1856
+ }
1857
+ }
1858
+ const Ni = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1859
+ __proto__: null,
1860
+ strapiCMSData: hr,
1861
+ vtexCMSData: _r
1862
+ }, Symbol.toStringTag, { value: "Module" }));
1863
+ async function _i({
1864
+ contentType: t,
1865
+ documentId: e,
1866
+ versionId: r,
1867
+ storeId: n,
1868
+ CMS_PROJECT_NAME: o
1869
+ }) {
1870
+ const a = e && e.length ? `/${e}` : "", i = r && r.length ? `?versionId=${r}` : "";
1871
+ return fetch(
1872
+ `https://${n}.myvtex.com/_v/cms/api/${o}/${t}${a}${i}`,
1873
+ { cache: "no-cache" }
1874
+ );
1875
+ }
1876
+ async function bi(t, e = {}, r) {
1877
+ const { cms: n = "vtex" } = e ?? {};
1878
+ try {
1879
+ const o = new URL(lt(t, e));
1880
+ return n !== "vtex" ? hr(o, e, r) : _r(t, o, e);
1881
+ } catch (o) {
1882
+ return console.error(`[Fetch ContentType Error CMS ${n}]`, o), r ? { status: 400, data: null } : { status: 200, data: [] };
1883
+ }
1884
+ }
1885
+ const Mi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1886
+ __proto__: null,
1887
+ fetchContentType: bi,
1888
+ getCMSContentType: _i
1889
+ }, Symbol.toStringTag, { value: "Module" }));
1890
+ export {
1891
+ Oi as A,
1892
+ Ii as B,
1893
+ Mi as C,
1894
+ Di as D,
1895
+ Ni as E,
1896
+ ki as F,
1897
+ Fi as S,
1898
+ Ir as a,
1899
+ Cr as b,
1900
+ Er as c,
1901
+ Rr as d,
1902
+ xi as e,
1903
+ Ve as f,
1904
+ Or as g,
1905
+ xr as h,
1906
+ kr as i,
1907
+ Gr as j,
1908
+ Ci as k,
1909
+ Ar as l,
1910
+ Dr as m,
1911
+ Mr as n,
1912
+ Pr as o,
1913
+ $i as p,
1914
+ Ti as q,
1915
+ se as r,
1916
+ qt as s,
1917
+ Tr as t,
1918
+ Fr as u,
1919
+ Pi as v,
1920
+ Ai as w,
1921
+ Ri as x,
1922
+ bi as y,
1923
+ Ei as z
1924
+ };