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

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