@colabcommerce/elements 0.0.1

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,153 @@
1
+ import { jsx as s, jsxs as v } from "react/jsx-runtime";
2
+ import { createContext as z, useState as d } from "react";
3
+ import { h as R, u as Q, d as $, S as V, l as K, b as W, k as X, g as J } from "./index-BComOHrk.js";
4
+ import { d as U, a as Y, O as H, c as g, B as ee } from "./globals-D3YPIcjZ.js";
5
+ /**
6
+ * @license lucide-react v0.542.0 - ISC
7
+ *
8
+ * This source code is licensed under the ISC license.
9
+ * See the LICENSE file in the root directory of this source tree.
10
+ */
11
+ const te = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]], se = U("check", te);
12
+ /**
13
+ * @license lucide-react v0.542.0 - ISC
14
+ *
15
+ * This source code is licensed under the ISC license.
16
+ * See the LICENSE file in the root directory of this source tree.
17
+ */
18
+ const ne = [
19
+ ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
20
+ ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
21
+ ], j = U("x", ne), oe = z(), ke = ({ product: e, children: n }) => {
22
+ const [o, i] = d(0), m = {
23
+ currentStep: o,
24
+ setCurrentStep: i,
25
+ product: e
26
+ };
27
+ return /* @__PURE__ */ s(oe.Provider, { value: m, children: n });
28
+ }, ae = z(), we = ({ children: e }) => {
29
+ const [n, o] = d(null), [i, m] = d(null), [p, c] = d(null), [_, f] = d(null), [L, S] = d(null), [b, N] = d(null), [h, l] = d(""), [k, a] = d(!1), [r, w] = d(!1), { coords: D, isGeolocationAvailable: x, isGeolocationEnabled: B, getPosition: I } = R({ suppressLocationOnMount: !0, onError: () => w(!1), onSuccess: () => w(!1), positionOptions: { enableHighAccuracy: !1 }, userDecisionTimeout: 5e3 }), F = {
30
+ lat: n,
31
+ lng: i,
32
+ isLoading: k,
33
+ setIsLoading: a,
34
+ locationName: h,
35
+ setLocationName: l,
36
+ setLocation: ({ lat: y, lng: C }) => {
37
+ o(y), m(C);
38
+ },
39
+ mapCenter: { lat: p, lng: _ },
40
+ setMapCenter: ({ lat: y, lng: C }) => {
41
+ c(y), f(C);
42
+ },
43
+ searchCenter: { lat: L, lng: b },
44
+ setSearchCenter: ({ lat: y, lng: C }) => {
45
+ S(y), N(C);
46
+ },
47
+ loadingGeo: r,
48
+ geoCoords: D,
49
+ isGeolocationAvailable: x,
50
+ isGeolocationEnabled: B,
51
+ getPosition: I
52
+ };
53
+ return /* @__PURE__ */ s(ae.Provider, { value: F, children: e });
54
+ }, ce = "oHxQR", re = "ggY6v", ie = "B-vL7", de = "xpYRZ", le = "PD0AO", ue = "i1mIs", me = "TOu1q", pe = "BYI6o", he = "_8Athb", ge = "wpcV2", t = {
55
+ header: ce,
56
+ name: re,
57
+ address: ie,
58
+ distance: de,
59
+ selectBtn: le,
60
+ productList: ue,
61
+ productHeader: me,
62
+ productItem: pe,
63
+ inStock: he,
64
+ outOfStock: ge
65
+ }, be = ({ location: e, showProducts: n = !1 }) => {
66
+ var T, A, P;
67
+ const { t: o, i18n: i } = Y(), m = i.language, p = K(m), { products: c, searchCenter: _, setSelectedLocationId: f, selectedLocationId: L, setFocusedLocationId: S, setShowMap: b, setShowDetails: N } = Q(), h = $({ lat: (T = e == null ? void 0 : e.address) == null ? void 0 : T.latitude, lng: (A = e.address) == null ? void 0 : A.longitude }, _), l = p === "km" ? h : X(h), k = Math.round(l * 10) / 10, a = e.retailer_location_hours.find((u) => u.day === (/* @__PURE__ */ new Date()).getDay()), r = /* @__PURE__ */ new Date();
68
+ let w = /* @__PURE__ */ new Date();
69
+ a && (w = new H(r.getUTCFullYear(), r.getMonth(), r.getDate(), a.open_at_hour, a.open_at_minute, 0, 0, a.timezone));
70
+ let D = /* @__PURE__ */ new Date();
71
+ a && (D = new H(r.getUTCFullYear(), r.getMonth(), r.getDate(), a.close_at_hour, a.close_at_minute, 0, 0, a.timezone));
72
+ const x = a && r >= w && r <= D, B = a && !x && r - w > 30 * 6e4 * -1, I = a && x && D - r < 30 * 6e4;
73
+ x ? I ? (g(t.hours, t.soon), o("store.closingSoon")) : (g(t.hours, t.open), o("store.openNow")) : B ? (g(t.hours, t.soon), o("store.openingSoon")) : (g(t.hours, t.closed), o("store.closedNow"));
74
+ const F = () => {
75
+ f(e.id);
76
+ }, y = () => {
77
+ S(e.id);
78
+ }, C = e.id === L ? g(t.wrapper, t.selected) : g(t.wrapper), q = (P = e == null ? void 0 : e.store_type) != null && P.includes("Studio") ? "studio" : "retailer", E = c == null ? void 0 : c.map((u) => {
79
+ var G;
80
+ const Z = (G = e == null ? void 0 : e.retailer_location_products) == null ? void 0 : G.some((M) => (M.sku === u.sku || M.external_id === u.external_id || M.collection_id === u.collection_id) && M.stocked);
81
+ return { ...u, isStocked: Z };
82
+ });
83
+ return /* @__PURE__ */ v("div", { className: C, onClick: y, children: [
84
+ /* @__PURE__ */ v("div", { className: t.header, children: [
85
+ /* @__PURE__ */ s("h4", { className: t.name, children: e.retailer_name }),
86
+ /* @__PURE__ */ s("div", { className: "text-end", children: /* @__PURE__ */ s(V, { type: q }) })
87
+ ] }),
88
+ /* @__PURE__ */ v("div", { className: g(t.distance), children: [
89
+ k,
90
+ " ",
91
+ p,
92
+ " ",
93
+ o("away")
94
+ ] }),
95
+ /* @__PURE__ */ s("section", { className: `${t.hoursWrapper} d-flex justify-content-between align-items-center pe-3`, children: /* @__PURE__ */ s(W, { hours: e == null ? void 0 : e.retailer_location_hours }) }),
96
+ /* @__PURE__ */ s("address", { className: g(t.address), children: /* @__PURE__ */ v("div", { children: [
97
+ e.address.street_line_one,
98
+ e.address.street_line_two && `, ${e.address.street_line_two}`,
99
+ " ",
100
+ e.address.city,
101
+ ", ",
102
+ e.address.province,
103
+ " ",
104
+ e.address.postal_code
105
+ ] }) }),
106
+ (c == null ? void 0 : c.length) > 0 && n && /* @__PURE__ */ v("div", { children: [
107
+ /* @__PURE__ */ s("div", { className: t.productHeader, children: o("quote.location.product_availability") }),
108
+ /* @__PURE__ */ s("div", { className: t.productList, children: E.map((u) => /* @__PURE__ */ v("div", { className: t.productItem, children: [
109
+ /* @__PURE__ */ s("div", { className: t.productStatus, children: u.isStocked ? /* @__PURE__ */ s(se, { className: t.inStock, size: 20 }) : /* @__PURE__ */ s(j, { className: t.outOfStock, size: 20 }) }),
110
+ /* @__PURE__ */ s("div", { className: t.productName, children: u.name })
111
+ ] }, u.name)) })
112
+ ] }),
113
+ /* @__PURE__ */ s(ee, { variant: "dark", size: "sm", onClick: F, className: `d-flex align-items-center px-3 py-2 ${t.selectBtn}`, children: o("quote.location.select_location") })
114
+ ] });
115
+ }, _e = "QMwKB", fe = "tlZ-O", Le = "NQEG7", Se = "MGV0F", O = {
116
+ wrapper: _e,
117
+ message: fe,
118
+ dismiss: Le,
119
+ cta: Se
120
+ }, De = ({ onSelect: e, onDismiss: n }) => {
121
+ const { t: o } = Y(), { locations: i, searchCenter: m, setSelectedLocationId: p, isLoading: c } = Q(), { cc_company_retailer_location_id: _ } = J(), [f, L] = d(!1), S = i.length > 0 ? Math.min(...i.map((l) => $({ lat: l.address.latitude, lng: l.address.longitude }, m))) : null, b = !f && (i.length === 0 || S > 100) && !c, N = () => {
122
+ p(_);
123
+ }, h = () => {
124
+ L(!0), n && n();
125
+ };
126
+ return b ? /* @__PURE__ */ v("div", { className: O.wrapper, children: [
127
+ /* @__PURE__ */ s("button", { className: O.dismiss, onClick: h, children: /* @__PURE__ */ s(j, { size: 20 }) }),
128
+ /* @__PURE__ */ s("p", { className: O.message, children: o("form_out_of_area.message") }),
129
+ /* @__PURE__ */ s("button", { className: O.cta, onClick: N, children: o("form_out_of_area.cta") })
130
+ ] }) : null;
131
+ };
132
+ function xe(e) {
133
+ var h;
134
+ const n = (l) => {
135
+ var k;
136
+ return ((k = e.find((a) => a.types.includes(l))) == null ? void 0 : k.long_name) || "";
137
+ }, o = n("street_number"), i = n("route"), m = [o, i].filter(Boolean).join(" "), p = n("subpremise"), c = p ? `Unit ${p}` : "", _ = n("locality") || n("postal_town") || n("sublocality") || "", f = n("administrative_area_level_1"), L = n("postal_code"), S = n("country"), N = ((h = e.find((l) => l.types.includes("country"))) == null ? void 0 : h.short_name) || S;
138
+ return {
139
+ addressLine1: m,
140
+ addressLine2: c,
141
+ city: _,
142
+ province: f,
143
+ postalCode: L,
144
+ country: N
145
+ };
146
+ }
147
+ export {
148
+ De as F,
149
+ be as L,
150
+ ke as Q,
151
+ xe as a,
152
+ we as b
153
+ };
@@ -0,0 +1,339 @@
1
+ import { V as G, U as R } from "./globals-D3YPIcjZ.js";
2
+ function z(w, d) {
3
+ for (var b = 0; b < d.length; b++) {
4
+ const y = d[b];
5
+ if (typeof y != "string" && !Array.isArray(y)) {
6
+ for (const h in y)
7
+ if (h !== "default" && !(h in w)) {
8
+ const p = Object.getOwnPropertyDescriptor(y, h);
9
+ p && Object.defineProperty(w, h, p.get ? p : {
10
+ enumerable: !0,
11
+ get: () => y[h]
12
+ });
13
+ }
14
+ }
15
+ }
16
+ return Object.freeze(Object.defineProperty(w, Symbol.toStringTag, { value: "Module" }));
17
+ }
18
+ var O = { exports: {} };
19
+ (function(w, d) {
20
+ var b = typeof globalThis < "u" && globalThis || typeof self < "u" && self || typeof R < "u" && R, y = function() {
21
+ function p() {
22
+ this.fetch = !1, this.DOMException = b.DOMException;
23
+ }
24
+ return p.prototype = b, new p();
25
+ }();
26
+ (function(p) {
27
+ (function(u) {
28
+ var a = typeof p < "u" && p || typeof self < "u" && self || typeof a < "u" && a, f = {
29
+ searchParams: "URLSearchParams" in a,
30
+ iterable: "Symbol" in a && "iterator" in Symbol,
31
+ blob: "FileReader" in a && "Blob" in a && function() {
32
+ try {
33
+ return new Blob(), !0;
34
+ } catch {
35
+ return !1;
36
+ }
37
+ }(),
38
+ formData: "FormData" in a,
39
+ arrayBuffer: "ArrayBuffer" in a
40
+ };
41
+ function j(e) {
42
+ return e && DataView.prototype.isPrototypeOf(e);
43
+ }
44
+ if (f.arrayBuffer)
45
+ var S = [
46
+ "[object Int8Array]",
47
+ "[object Uint8Array]",
48
+ "[object Uint8ClampedArray]",
49
+ "[object Int16Array]",
50
+ "[object Uint16Array]",
51
+ "[object Int32Array]",
52
+ "[object Uint32Array]",
53
+ "[object Float32Array]",
54
+ "[object Float64Array]"
55
+ ], F = ArrayBuffer.isView || function(e) {
56
+ return e && S.indexOf(Object.prototype.toString.call(e)) > -1;
57
+ };
58
+ function v(e) {
59
+ if (typeof e != "string" && (e = String(e)), /[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e) || e === "")
60
+ throw new TypeError('Invalid character in header field name: "' + e + '"');
61
+ return e.toLowerCase();
62
+ }
63
+ function A(e) {
64
+ return typeof e != "string" && (e = String(e)), e;
65
+ }
66
+ function E(e) {
67
+ var t = {
68
+ next: function() {
69
+ var r = e.shift();
70
+ return { done: r === void 0, value: r };
71
+ }
72
+ };
73
+ return f.iterable && (t[Symbol.iterator] = function() {
74
+ return t;
75
+ }), t;
76
+ }
77
+ function s(e) {
78
+ this.map = {}, e instanceof s ? e.forEach(function(t, r) {
79
+ this.append(r, t);
80
+ }, this) : Array.isArray(e) ? e.forEach(function(t) {
81
+ this.append(t[0], t[1]);
82
+ }, this) : e && Object.getOwnPropertyNames(e).forEach(function(t) {
83
+ this.append(t, e[t]);
84
+ }, this);
85
+ }
86
+ s.prototype.append = function(e, t) {
87
+ e = v(e), t = A(t);
88
+ var r = this.map[e];
89
+ this.map[e] = r ? r + ", " + t : t;
90
+ }, s.prototype.delete = function(e) {
91
+ delete this.map[v(e)];
92
+ }, s.prototype.get = function(e) {
93
+ return e = v(e), this.has(e) ? this.map[e] : null;
94
+ }, s.prototype.has = function(e) {
95
+ return this.map.hasOwnProperty(v(e));
96
+ }, s.prototype.set = function(e, t) {
97
+ this.map[v(e)] = A(t);
98
+ }, s.prototype.forEach = function(e, t) {
99
+ for (var r in this.map)
100
+ this.map.hasOwnProperty(r) && e.call(t, this.map[r], r, this);
101
+ }, s.prototype.keys = function() {
102
+ var e = [];
103
+ return this.forEach(function(t, r) {
104
+ e.push(r);
105
+ }), E(e);
106
+ }, s.prototype.values = function() {
107
+ var e = [];
108
+ return this.forEach(function(t) {
109
+ e.push(t);
110
+ }), E(e);
111
+ }, s.prototype.entries = function() {
112
+ var e = [];
113
+ return this.forEach(function(t, r) {
114
+ e.push([r, t]);
115
+ }), E(e);
116
+ }, f.iterable && (s.prototype[Symbol.iterator] = s.prototype.entries);
117
+ function T(e) {
118
+ if (e.bodyUsed)
119
+ return Promise.reject(new TypeError("Already read"));
120
+ e.bodyUsed = !0;
121
+ }
122
+ function P(e) {
123
+ return new Promise(function(t, r) {
124
+ e.onload = function() {
125
+ t(e.result);
126
+ }, e.onerror = function() {
127
+ r(e.error);
128
+ };
129
+ });
130
+ }
131
+ function I(e) {
132
+ var t = new FileReader(), r = P(t);
133
+ return t.readAsArrayBuffer(e), r;
134
+ }
135
+ function M(e) {
136
+ var t = new FileReader(), r = P(t);
137
+ return t.readAsText(e), r;
138
+ }
139
+ function H(e) {
140
+ for (var t = new Uint8Array(e), r = new Array(t.length), n = 0; n < t.length; n++)
141
+ r[n] = String.fromCharCode(t[n]);
142
+ return r.join("");
143
+ }
144
+ function D(e) {
145
+ if (e.slice)
146
+ return e.slice(0);
147
+ var t = new Uint8Array(e.byteLength);
148
+ return t.set(new Uint8Array(e)), t.buffer;
149
+ }
150
+ function x() {
151
+ return this.bodyUsed = !1, this._initBody = function(e) {
152
+ this.bodyUsed = this.bodyUsed, this._bodyInit = e, e ? typeof e == "string" ? this._bodyText = e : f.blob && Blob.prototype.isPrototypeOf(e) ? this._bodyBlob = e : f.formData && FormData.prototype.isPrototypeOf(e) ? this._bodyFormData = e : f.searchParams && URLSearchParams.prototype.isPrototypeOf(e) ? this._bodyText = e.toString() : f.arrayBuffer && f.blob && j(e) ? (this._bodyArrayBuffer = D(e.buffer), this._bodyInit = new Blob([this._bodyArrayBuffer])) : f.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(e) || F(e)) ? this._bodyArrayBuffer = D(e) : this._bodyText = e = Object.prototype.toString.call(e) : this._bodyText = "", this.headers.get("content-type") || (typeof e == "string" ? this.headers.set("content-type", "text/plain;charset=UTF-8") : this._bodyBlob && this._bodyBlob.type ? this.headers.set("content-type", this._bodyBlob.type) : f.searchParams && URLSearchParams.prototype.isPrototypeOf(e) && this.headers.set("content-type", "application/x-www-form-urlencoded;charset=UTF-8"));
153
+ }, f.blob && (this.blob = function() {
154
+ var e = T(this);
155
+ if (e)
156
+ return e;
157
+ if (this._bodyBlob)
158
+ return Promise.resolve(this._bodyBlob);
159
+ if (this._bodyArrayBuffer)
160
+ return Promise.resolve(new Blob([this._bodyArrayBuffer]));
161
+ if (this._bodyFormData)
162
+ throw new Error("could not read FormData body as blob");
163
+ return Promise.resolve(new Blob([this._bodyText]));
164
+ }, this.arrayBuffer = function() {
165
+ if (this._bodyArrayBuffer) {
166
+ var e = T(this);
167
+ return e || (ArrayBuffer.isView(this._bodyArrayBuffer) ? Promise.resolve(
168
+ this._bodyArrayBuffer.buffer.slice(
169
+ this._bodyArrayBuffer.byteOffset,
170
+ this._bodyArrayBuffer.byteOffset + this._bodyArrayBuffer.byteLength
171
+ )
172
+ ) : Promise.resolve(this._bodyArrayBuffer));
173
+ } else
174
+ return this.blob().then(I);
175
+ }), this.text = function() {
176
+ var e = T(this);
177
+ if (e)
178
+ return e;
179
+ if (this._bodyBlob)
180
+ return M(this._bodyBlob);
181
+ if (this._bodyArrayBuffer)
182
+ return Promise.resolve(H(this._bodyArrayBuffer));
183
+ if (this._bodyFormData)
184
+ throw new Error("could not read FormData body as text");
185
+ return Promise.resolve(this._bodyText);
186
+ }, f.formData && (this.formData = function() {
187
+ return this.text().then(C);
188
+ }), this.json = function() {
189
+ return this.text().then(JSON.parse);
190
+ }, this;
191
+ }
192
+ var q = ["DELETE", "GET", "HEAD", "OPTIONS", "POST", "PUT"];
193
+ function L(e) {
194
+ var t = e.toUpperCase();
195
+ return q.indexOf(t) > -1 ? t : e;
196
+ }
197
+ function m(e, t) {
198
+ if (!(this instanceof m))
199
+ throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');
200
+ t = t || {};
201
+ var r = t.body;
202
+ if (e instanceof m) {
203
+ if (e.bodyUsed)
204
+ throw new TypeError("Already read");
205
+ this.url = e.url, this.credentials = e.credentials, t.headers || (this.headers = new s(e.headers)), this.method = e.method, this.mode = e.mode, this.signal = e.signal, !r && e._bodyInit != null && (r = e._bodyInit, e.bodyUsed = !0);
206
+ } else
207
+ this.url = String(e);
208
+ if (this.credentials = t.credentials || this.credentials || "same-origin", (t.headers || !this.headers) && (this.headers = new s(t.headers)), this.method = L(t.method || this.method || "GET"), this.mode = t.mode || this.mode || null, this.signal = t.signal || this.signal, this.referrer = null, (this.method === "GET" || this.method === "HEAD") && r)
209
+ throw new TypeError("Body not allowed for GET or HEAD requests");
210
+ if (this._initBody(r), (this.method === "GET" || this.method === "HEAD") && (t.cache === "no-store" || t.cache === "no-cache")) {
211
+ var n = /([?&])_=[^&]*/;
212
+ if (n.test(this.url))
213
+ this.url = this.url.replace(n, "$1_=" + (/* @__PURE__ */ new Date()).getTime());
214
+ else {
215
+ var i = /\?/;
216
+ this.url += (i.test(this.url) ? "&" : "?") + "_=" + (/* @__PURE__ */ new Date()).getTime();
217
+ }
218
+ }
219
+ }
220
+ m.prototype.clone = function() {
221
+ return new m(this, { body: this._bodyInit });
222
+ };
223
+ function C(e) {
224
+ var t = new FormData();
225
+ return e.trim().split("&").forEach(function(r) {
226
+ if (r) {
227
+ var n = r.split("="), i = n.shift().replace(/\+/g, " "), o = n.join("=").replace(/\+/g, " ");
228
+ t.append(decodeURIComponent(i), decodeURIComponent(o));
229
+ }
230
+ }), t;
231
+ }
232
+ function k(e) {
233
+ var t = new s(), r = e.replace(/\r?\n[\t ]+/g, " ");
234
+ return r.split("\r").map(function(n) {
235
+ return n.indexOf(`
236
+ `) === 0 ? n.substr(1, n.length) : n;
237
+ }).forEach(function(n) {
238
+ var i = n.split(":"), o = i.shift().trim();
239
+ if (o) {
240
+ var _ = i.join(":").trim();
241
+ t.append(o, _);
242
+ }
243
+ }), t;
244
+ }
245
+ x.call(m.prototype);
246
+ function c(e, t) {
247
+ if (!(this instanceof c))
248
+ throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');
249
+ t || (t = {}), this.type = "default", this.status = t.status === void 0 ? 200 : t.status, this.ok = this.status >= 200 && this.status < 300, this.statusText = t.statusText === void 0 ? "" : "" + t.statusText, this.headers = new s(t.headers), this.url = t.url || "", this._initBody(e);
250
+ }
251
+ x.call(c.prototype), c.prototype.clone = function() {
252
+ return new c(this._bodyInit, {
253
+ status: this.status,
254
+ statusText: this.statusText,
255
+ headers: new s(this.headers),
256
+ url: this.url
257
+ });
258
+ }, c.error = function() {
259
+ var e = new c(null, { status: 0, statusText: "" });
260
+ return e.type = "error", e;
261
+ };
262
+ var N = [301, 302, 303, 307, 308];
263
+ c.redirect = function(e, t) {
264
+ if (N.indexOf(t) === -1)
265
+ throw new RangeError("Invalid status code");
266
+ return new c(null, { status: t, headers: { location: e } });
267
+ }, u.DOMException = a.DOMException;
268
+ try {
269
+ new u.DOMException();
270
+ } catch {
271
+ u.DOMException = function(t, r) {
272
+ this.message = t, this.name = r;
273
+ var n = Error(t);
274
+ this.stack = n.stack;
275
+ }, u.DOMException.prototype = Object.create(Error.prototype), u.DOMException.prototype.constructor = u.DOMException;
276
+ }
277
+ function B(e, t) {
278
+ return new Promise(function(r, n) {
279
+ var i = new m(e, t);
280
+ if (i.signal && i.signal.aborted)
281
+ return n(new u.DOMException("Aborted", "AbortError"));
282
+ var o = new XMLHttpRequest();
283
+ function _() {
284
+ o.abort();
285
+ }
286
+ o.onload = function() {
287
+ var l = {
288
+ status: o.status,
289
+ statusText: o.statusText,
290
+ headers: k(o.getAllResponseHeaders() || "")
291
+ };
292
+ l.url = "responseURL" in o ? o.responseURL : l.headers.get("X-Request-URL");
293
+ var g = "response" in o ? o.response : o.responseText;
294
+ setTimeout(function() {
295
+ r(new c(g, l));
296
+ }, 0);
297
+ }, o.onerror = function() {
298
+ setTimeout(function() {
299
+ n(new TypeError("Network request failed"));
300
+ }, 0);
301
+ }, o.ontimeout = function() {
302
+ setTimeout(function() {
303
+ n(new TypeError("Network request failed"));
304
+ }, 0);
305
+ }, o.onabort = function() {
306
+ setTimeout(function() {
307
+ n(new u.DOMException("Aborted", "AbortError"));
308
+ }, 0);
309
+ };
310
+ function V(l) {
311
+ try {
312
+ return l === "" && a.location.href ? a.location.href : l;
313
+ } catch {
314
+ return l;
315
+ }
316
+ }
317
+ o.open(i.method, V(i.url), !0), i.credentials === "include" ? o.withCredentials = !0 : i.credentials === "omit" && (o.withCredentials = !1), "responseType" in o && (f.blob ? o.responseType = "blob" : f.arrayBuffer && i.headers.get("Content-Type") && i.headers.get("Content-Type").indexOf("application/octet-stream") !== -1 && (o.responseType = "arraybuffer")), t && typeof t.headers == "object" && !(t.headers instanceof s) ? Object.getOwnPropertyNames(t.headers).forEach(function(l) {
318
+ o.setRequestHeader(l, A(t.headers[l]));
319
+ }) : i.headers.forEach(function(l, g) {
320
+ o.setRequestHeader(g, l);
321
+ }), i.signal && (i.signal.addEventListener("abort", _), o.onreadystatechange = function() {
322
+ o.readyState === 4 && i.signal.removeEventListener("abort", _);
323
+ }), o.send(typeof i._bodyInit > "u" ? null : i._bodyInit);
324
+ });
325
+ }
326
+ return B.polyfill = !0, a.fetch || (a.fetch = B, a.Headers = s, a.Request = m, a.Response = c), u.Headers = s, u.Request = m, u.Response = c, u.fetch = B, u;
327
+ })({});
328
+ })(y), y.fetch.ponyfill = !0, delete y.fetch.polyfill;
329
+ var h = b.fetch ? b : y;
330
+ d = h.fetch, d.default = h.fetch, d.fetch = h.fetch, d.Headers = h.Headers, d.Request = h.Request, d.Response = h.Response, w.exports = d;
331
+ })(O, O.exports);
332
+ var U = O.exports;
333
+ const $ = /* @__PURE__ */ G(U), J = /* @__PURE__ */ z({
334
+ __proto__: null,
335
+ default: $
336
+ }, [U]);
337
+ export {
338
+ J as b
339
+ };