@expofp/loader 1.0.46 → 1.0.48

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,85 +1,85 @@
1
- function J(e) {
2
- return i("assetResolver resolveRef:", e), l(e);
1
+ function J(t) {
2
+ return i("assetResolver resolveRef:", t), l(t);
3
3
  }
4
4
  const U = {
5
5
  schema: "asset",
6
- resolveRef: async (e) => J(e),
6
+ resolveRef: async (t) => J(t),
7
7
  offlineMethod: "localizeRef"
8
8
  };
9
- let d;
10
- const B = /* @__PURE__ */ new WeakSet(), g = new Function("url", 'return import(url, { with: { type: "json" } });');
11
- async function f(e, t) {
12
- var r, o;
13
- if (d === void 0 && !t.forceFetch)
9
+ let h;
10
+ const N = /* @__PURE__ */ new WeakSet(), _ = new Function("url", 'return import(url, { with: { type: "json" } });');
11
+ async function f(t, e) {
12
+ var n, o;
13
+ if (h === void 0 && !e.forceFetch)
14
14
  try {
15
- await g(e), d = !1;
15
+ await _(t), h = !1;
16
16
  } catch {
17
- i("importJson: dynamic import not available, falling back to fetch"), d = !0;
17
+ i("importJson: dynamic import not available, falling back to fetch"), h = !0;
18
18
  }
19
- let n;
20
- return !d && !t.forceFetch ? (n = (await g(e)).default, (r = t.importCallback) == null || r.call(t, e, "json")) : (i("importJson: fetch", e), n = await N(e, t.refCache), (o = t.importCallback) == null || o.call(t, e, "json")), B.has(n) || u(n), n;
19
+ let r;
20
+ return !h && !e.forceFetch ? (r = (await _(t)).default, (n = e.importCallback) == null || n.call(e, t, "json")) : (i("importJson: fetch", t), r = await W(t, e.refCache, e.abortSignal || null), (o = e.importCallback) == null || o.call(e, t, "json")), N.has(r) || u(r), r;
21
21
  }
22
- async function N(e, t) {
23
- const n = "__loadJson__" + e;
24
- if (t.has(n))
25
- return t.get(n);
26
- const r = (async function() {
27
- const a = await fetch(e);
28
- if (!a.ok)
29
- throw new Error(`Failed to fetch JSON from ${e}`);
30
- return await a.json();
22
+ async function W(t, e, r) {
23
+ const n = "__loadJson__" + t;
24
+ if (e.has(n))
25
+ return e.get(n);
26
+ const o = (async function() {
27
+ const s = await fetch(t, { signal: r });
28
+ if (!s.ok)
29
+ throw new Error(`Failed to fetch JSON from ${t}`);
30
+ return await s.json();
31
31
  })();
32
- return t.set(n, r), r;
32
+ return e.set(n, o), o;
33
33
  }
34
- async function h(e, t, n) {
35
- if (t.has(e))
36
- return t.get(e);
37
- const r = n().then((o) => (u(o), o));
38
- return t.set(e, r), r;
34
+ async function p(t, e, r) {
35
+ if (e.has(t))
36
+ return e.get(t);
37
+ const n = r().then((o) => (u(o), o));
38
+ return e.set(t, n), n;
39
39
  }
40
- const T = {
40
+ const B = {
41
41
  schema: "bundle-assets",
42
- async resolveRef(e, t) {
43
- i("bundleAssetsResolver resolveRef:", e);
44
- const n = l(e);
45
- return h(e, t.refCache, async () => {
46
- const r = await f(n, t), o = n.substring(0, n.lastIndexOf("/") + 1);
47
- return r.map((s) => ({
42
+ async resolveRef(t, e) {
43
+ i("bundleAssetsResolver resolveRef:", t);
44
+ const r = l(t);
45
+ return p(t, e.refCache, async () => {
46
+ const n = await f(r, e), o = r.substring(0, r.lastIndexOf("/") + 1);
47
+ return n.map((s) => ({
48
48
  $ref: `asset+${o}${s}`
49
49
  }));
50
50
  });
51
51
  },
52
52
  offlineMethod: "localizeRef"
53
- }, C = "https://efp-runtime.expofp.com/", S = {
53
+ }, L = "https://efp-runtime.expofp.com/", T = {
54
54
  schema: "expo-runtime-branch",
55
- async resolveRef(e, t) {
56
- i("expoRuntimeBranchResolver resolveRef:", e);
57
- const n = l(e), r = `${C}branches/${n}.json`;
58
- return h(e, t.refCache, async () => ({
59
- $ref: `expo-runtime+https://efp-runtime.expofp.com/releases/${await f(r, t)}/`
55
+ async resolveRef(t, e) {
56
+ i("expoRuntimeBranchResolver resolveRef:", t);
57
+ const r = l(t), n = `${L}branches/${r}.json`;
58
+ return p(t, e.refCache, async () => ({
59
+ $ref: `expo-runtime+https://efp-runtime.expofp.com/releases/${await f(n, e)}/`
60
60
  }));
61
61
  },
62
62
  offlineMethod: "resolveRef"
63
- }, D = {
63
+ }, C = {
64
64
  schema: "expo-runtime-get-branch",
65
- async resolveRef(e, t) {
66
- i("expoRuntimeGetBranchResolver resolveRef:", e);
67
- const r = `https://${l(e)}.expofp.com/get-branch`;
68
- return f(r, t);
65
+ async resolveRef(t, e) {
66
+ i("expoRuntimeGetBranchResolver resolveRef:", t);
67
+ const n = `https://${l(t)}.expofp.com/get-branch`;
68
+ return f(n, e);
69
69
  },
70
70
  offlineMethod: "resolveRef"
71
- }, W = {
71
+ }, D = {
72
72
  schema: "expo-runtime",
73
73
  // canResolve(ref: string) {
74
74
  // return canResolveRefSchema(ref, SCHEMA);
75
75
  // },
76
- async resolveRef(e) {
77
- i("expoRuntimeResolver resolveRef:", e);
78
- const t = l(e), n = {
79
- entry: { $ref: `asset+${t}expofp.js` },
80
- assets: { $ref: `bundle-assets+${t}bundle.json` }
76
+ async resolveRef(t) {
77
+ i("expoRuntimeResolver resolveRef:", t);
78
+ const e = l(t), r = {
79
+ entry: { $ref: `asset+${e}expofp.js` },
80
+ assets: { $ref: `bundle-assets+${e}bundle.json` }
81
81
  };
82
- return u(n), n;
82
+ return u(r), r;
83
83
  },
84
84
  // async *makeOfflineRef(ref: string) {
85
85
  // log('expoRuntimeResolver makeOfflineRef:', ref);
@@ -99,336 +99,387 @@ const T = {
99
99
  // return targetFilePath;
100
100
  // },
101
101
  offlineMethod: "resolveRef"
102
- }, P = {
103
- canResolve(e) {
104
- return e.startsWith("http://") || e.startsWith("https://") || e.startsWith("./");
102
+ }, I = {
103
+ canResolve(t) {
104
+ return t.startsWith("http://") || t.startsWith("https://") || t.startsWith("./");
105
105
  },
106
- resolveRef(e, t) {
107
- if (i("httpResolver resolveRef:", e), !this.canResolve(e)) throw new Error(`Unexpected ref in httpResolver: ${e}`);
108
- return f(e, t);
106
+ resolveRef(t, e) {
107
+ if (i("httpResolver resolveRef:", t), !this.canResolve(t)) throw new Error(`Unexpected ref in httpResolver: ${t}`);
108
+ return f(t, e);
109
109
  },
110
110
  offlineMethod: "resolveRef"
111
111
  };
112
- async function $(e, t = {}) {
113
- const { globalVar: n, timeoutMs: r = 1e4, pollIntervalMs: o = 10 } = t;
114
- I() ? (await z(e), n && await E(() => window[n], n, r, o)) : (await L(e), n && await E(
115
- () => globalThis[n],
112
+ async function O(t, e) {
113
+ const { globalVar: r, timeoutMs: n = 1e4, pollIntervalMs: o = 10 } = e;
114
+ P() ? (await z(t, e.abortSignal), r && await k(
115
+ () => window[r],
116
+ r,
116
117
  n,
118
+ o,
119
+ e.abortSignal
120
+ )) : (await S(t, e.abortSignal), r && await k(
121
+ () => globalThis[r],
117
122
  r,
118
- o
123
+ n,
124
+ o,
125
+ e.abortSignal
119
126
  ));
120
127
  }
121
- function I() {
128
+ function P() {
122
129
  return typeof window < "u" && typeof document < "u";
123
130
  }
124
- function z(e) {
125
- return new Promise((t, n) => {
126
- const r = document.createElement("script");
127
- r.src = e, r.async = !0;
128
- const o = () => {
129
- r.onload = null, r.onerror = null;
131
+ function z(t, e) {
132
+ return new Promise((r, n) => {
133
+ const o = document.createElement("script");
134
+ o.src = t, o.async = !0;
135
+ const a = () => {
136
+ o.onload = null, o.onerror = null, o.remove();
137
+ }, s = () => {
138
+ a(), n(new Error("Script load aborted"));
130
139
  };
131
- r.onload = () => {
132
- o(), t();
133
- }, r.onerror = () => {
134
- o(), n(new Error(`Failed to load script: ${e}`));
135
- }, document.head.appendChild(r);
140
+ if (e != null && e.aborted) {
141
+ a(), n(new Error("Script load aborted"));
142
+ return;
143
+ }
144
+ e == null || e.addEventListener("abort", s, { once: !0 }), o.onload = () => {
145
+ e == null || e.removeEventListener("abort", s), a(), r();
146
+ }, o.onerror = () => {
147
+ e == null || e.removeEventListener("abort", s), a(), n(new Error(`Failed to load script: ${t}`));
148
+ }, document.head.appendChild(o);
136
149
  });
137
150
  }
138
- async function L(e) {
151
+ async function S(t, e) {
139
152
  if (typeof fetch != "function")
140
- throw new Error(
141
- "loadAndWaitGlobal: fetch is not available. Use Node 18+ or provide a global fetch."
142
- );
143
- const t = await fetch(e);
144
- if (!t.ok)
145
- throw new Error(`Failed to load script in Node (HTTP ${t.status}): ${e}`);
146
- const n = await t.text();
147
- globalThis.window = globalThis, (0, eval)(n);
153
+ throw new Error("loadInNode: fetch is not available. Use Node 18+ or provide a global fetch.");
154
+ if (e != null && e.aborted)
155
+ throw new Error("Script load aborted");
156
+ let r;
157
+ try {
158
+ r = await fetch(t, { signal: e });
159
+ } catch (s) {
160
+ throw s && s.name === "AbortError" ? new Error("Script load aborted") : s;
161
+ }
162
+ if (!r.ok)
163
+ throw new Error(`Failed to load script in Node (HTTP ${r.status}): ${t}`);
164
+ if (e != null && e.aborted)
165
+ throw new Error("Script load aborted");
166
+ let n;
167
+ try {
168
+ n = await r.text();
169
+ } catch (s) {
170
+ throw s && s.name === "AbortError" ? new Error("Script load aborted") : s;
171
+ }
172
+ if (e != null && e.aborted)
173
+ throw new Error("Script load aborted");
174
+ const o = globalThis, a = o.window;
175
+ o.window = o;
176
+ try {
177
+ (0, eval)(n);
178
+ } finally {
179
+ a === void 0 ? delete o.window : o.window = a;
180
+ }
148
181
  }
149
- function E(e, t, n, r) {
150
- return new Promise((o, a) => {
151
- const s = Date.now(), c = () => {
182
+ function k(t, e, r, n, o) {
183
+ return new Promise((a, s) => {
184
+ const d = Date.now(), c = () => {
185
+ s(new Error("Wait for global aborted"));
186
+ };
187
+ if (o != null && o.aborted) {
188
+ s(new Error("Wait for global aborted"));
189
+ return;
190
+ }
191
+ o == null || o.addEventListener("abort", c, { once: !0 });
192
+ const w = () => {
193
+ if (o != null && o.aborted)
194
+ return s(new Error("Wait for global aborted"));
152
195
  try {
153
- if (e() !== void 0)
154
- return o();
196
+ if (t() !== void 0)
197
+ return o == null || o.removeEventListener("abort", c), a();
155
198
  } catch {
156
199
  }
157
- if (Date.now() - s >= n)
158
- return a(new Error(`Timed out after ${n} ms waiting for global "${t}"`));
159
- setTimeout(c, r);
200
+ if (Date.now() - d >= r)
201
+ return o == null || o.removeEventListener("abort", c), s(new Error(`Timed out after ${r} ms waiting for global "${e}"`));
202
+ setTimeout(w, n);
160
203
  };
161
- c();
204
+ w();
162
205
  });
163
206
  }
164
- const G = {
207
+ const V = {
165
208
  schema: "legacy-asset-urls",
166
- resolveRef(e, t) {
167
- return i("legacyAssetUrlsResolver resolveRef:", e), h(e, t.refCache, async () => {
168
- var y, v;
169
- const n = l(e), r = `${n}version.js`;
209
+ resolveRef(t, e) {
210
+ return i("legacyAssetUrlsResolver resolveRef:", t), p(t, e.refCache, async () => {
211
+ var b, R;
212
+ const r = l(t), n = `${r}version.js`;
170
213
  try {
171
- await $(r, { globalVar: "__fpDataVersion", timeoutMs: 3e4 }), (y = t.importCallback) == null || y.call(t, r, "script");
214
+ await O(n, {
215
+ globalVar: "__fpDataVersion",
216
+ timeoutMs: 3e4,
217
+ abortSignal: e.abortSignal
218
+ }), (b = e.importCallback) == null || b.call(e, n, "script");
172
219
  } catch {
173
- console.warn(`Could not load version.js at ${r}, proceeding without it`);
220
+ console.warn(`Could not load version.js at ${n}, proceeding without it`);
174
221
  }
175
- const o = globalThis.__fpDataVersion || (+/* @__PURE__ */ new Date()).toString(), a = `${n}files.json?v=${o}`, s = `${n}data.js?v=${o}`, c = f(a, t), j = $(s, { globalVar: "__data" });
176
- (v = t.importCallback) == null || v.call(t, s, "script"), await Promise.all([c, j]);
177
- const A = await c, M = globalThis.__data || {};
178
- return { ...[...A, "data.js"].reduce((b, R) => (b[R] = { $ref: `asset+${n}${R}?v=${o}` }, b), {}), ...V(n, M) };
222
+ const o = globalThis.__fpDataVersion || (+/* @__PURE__ */ new Date()).toString(), a = `${r}files.json?v=${o}`, s = `${r}data.js?v=${o}`, d = f(a, e), c = O(s, {
223
+ globalVar: "__data",
224
+ abortSignal: e.abortSignal
225
+ });
226
+ (R = e.importCallback) == null || R.call(e, s, "script"), await Promise.all([d, c]);
227
+ const w = await d, j = globalThis.__data || {};
228
+ return { ...[...w, "data.js"].reduce((E, $) => (E[$] = { $ref: `asset+${r}${$}?v=${o}` }, E), {}), ...G(r, j) };
179
229
  });
180
230
  },
181
231
  offlineMethod: "resolveRef"
182
232
  };
183
- function V(e, t) {
184
- const n = /* @__PURE__ */ new Set();
185
- function r(o) {
186
- typeof o == "string" && o.length > 0 && n.add(o);
233
+ function G(t, e) {
234
+ const r = /* @__PURE__ */ new Set();
235
+ function n(o) {
236
+ typeof o == "string" && o.length > 0 && r.add(o);
187
237
  }
188
- return r(t.logo), t.exhibitors.forEach((o) => {
238
+ return n(e.logo), e.exhibitors.forEach((o) => {
189
239
  var a;
190
- r(o.logo), (a = o.gallery) == null || a.forEach((s) => r(s));
191
- }), t.events.forEach((o) => {
240
+ n(o.logo), (a = o.gallery) == null || a.forEach((s) => n(s));
241
+ }), e.events.forEach((o) => {
192
242
  var a;
193
- r(o.logoFile), (a = o.speakers) == null || a.forEach((s) => {
194
- r(s.photoFile);
243
+ n(o.logoFile), (a = o.speakers) == null || a.forEach((s) => {
244
+ n(s.photoFile);
195
245
  });
196
- }), Array.from(n).reduce((o, a) => (o[a] = { $ref: `asset+${e}${a}` }, o), {});
246
+ }), Array.from(r).reduce((o, a) => (o[a] = { $ref: `asset+${t}${a}` }, o), {});
197
247
  }
198
248
  const Z = {
199
249
  schema: "legacy-data",
200
- resolveRef(e, t) {
201
- return i("legacyDataResolver resolveRef:", e), h(e, t.refCache, async () => {
202
- const n = l(e);
250
+ resolveRef(t, e) {
251
+ return i("legacyDataResolver resolveRef:", t), p(t, e.refCache, async () => {
252
+ const r = l(t);
203
253
  return {
204
- _to_remove_for_offline_to_work_dataUrlBase: n,
205
- legacyAssetUrls: { $ref: `legacy-asset-urls+${n}` }
254
+ _to_remove_for_offline_to_work_dataUrlBase: r,
255
+ legacyAssetUrls: { $ref: `legacy-asset-urls+${r}` }
206
256
  };
207
257
  });
208
258
  },
209
259
  offlineMethod: "resolveRef"
210
260
  }, H = [
211
- P,
212
- T,
261
+ I,
262
+ B,
213
263
  U,
214
- W,
215
- S,
216
264
  D,
265
+ T,
266
+ C,
217
267
  Z,
218
- G
219
- ], x = /* @__PURE__ */ new Map();
220
- async function m(e, t, n) {
221
- i("Resolving:", t, "of", e, n), typeof window < "u" && (window.__lastResolveObject = e);
222
- const r = {
223
- importCallback: n == null ? void 0 : n.importCallback,
224
- refCache: (n == null ? void 0 : n.refCache) || x,
225
- forceFetch: !!(n != null && n.forceFetch)
268
+ V
269
+ ], K = /* @__PURE__ */ new Map();
270
+ async function v(t, e, r) {
271
+ i("Resolving:", e, "of", t, r), typeof window < "u" && (window.__lastResolveObject = t);
272
+ const n = {
273
+ importCallback: r == null ? void 0 : r.importCallback,
274
+ refCache: (r == null ? void 0 : r.refCache) || K,
275
+ forceFetch: !!(r != null && r.forceFetch),
276
+ abortSignal: (r == null ? void 0 : r.abortSignal) || null
226
277
  };
227
- if (typeof t != "string")
228
- throw new Error(`Invalid JSON Pointer (not a string): ${t}`);
229
- if (!t.startsWith("/"))
230
- throw new Error(`Invalid JSON Pointer: ${t}`);
231
- if (t.length > 1 && t.endsWith("/"))
232
- throw new Error(`Invalid JSON Pointer: ${t}`);
278
+ if (typeof e != "string")
279
+ throw new Error(`Invalid JSON Pointer (not a string): ${e}`);
280
+ if (!e.startsWith("/"))
281
+ throw new Error(`Invalid JSON Pointer: ${e}`);
282
+ if (e.length > 1 && e.endsWith("/"))
283
+ throw new Error(`Invalid JSON Pointer: ${e}`);
233
284
  let o;
234
- if (t === "/" ? o = [] : o = t.substring(1).split("/"), o.some((a) => a.length === 0))
235
- throw new Error(`Invalid JSON Pointer (empty part): ${t}`);
236
- if (n != null && n.mutate) {
285
+ if (e === "/" ? o = [] : o = e.substring(1).split("/"), o.some((a) => a.length === 0))
286
+ throw new Error(`Invalid JSON Pointer (empty part): ${e}`);
287
+ if (r != null && r.mutate) {
237
288
  o.unshift("root");
238
- const a = { root: e };
239
- await O(a, o, 0, r), ee(e, a.root);
289
+ const a = { root: t };
290
+ await A(a, o, 0, n), ee(t, a.root);
240
291
  } else
241
- return await k(e, o, 0, r);
292
+ return await g(t, o, 0, n);
242
293
  }
243
- async function O(e, t, n, r) {
244
- const o = t[n];
245
- if (await K(e, o, r), n != t.length - 1) {
246
- if (e[o] === null || typeof e[o] != "object")
294
+ async function A(t, e, r, n) {
295
+ const o = e[r];
296
+ if (await q(t, o, n), r != e.length - 1) {
297
+ if (t[o] === null || typeof t[o] != "object")
247
298
  throw new Error(
248
- `Cannot resolve path, encountered non-object at part '${t.slice(1).join("/")}', index ${n - 1}'`
299
+ `Cannot resolve path, encountered non-object at part '${e.slice(1).join("/")}', index ${r - 1}'`
249
300
  );
250
- return await O(e[o], t, n + 1, r);
301
+ return await A(t[o], e, r + 1, n);
251
302
  }
252
303
  }
253
- async function K(e, t, n) {
254
- i("resolveObjectMutate:", e, t);
255
- let r = e[t];
256
- const o = await p(r, n);
257
- o !== void 0 && (e[t] = o);
304
+ async function q(t, e, r) {
305
+ i("resolveObjectMutate:", t, e);
306
+ let n = t[e];
307
+ const o = await y(n, r);
308
+ o !== void 0 && (t[e] = o);
258
309
  }
259
- async function k(e, t, n, r) {
260
- if (n === t.length)
261
- return await p(e, r);
262
- if (e === null || typeof e != "object")
310
+ async function g(t, e, r, n) {
311
+ if (r === e.length)
312
+ return await y(t, n);
313
+ if (t === null || typeof t != "object")
263
314
  throw new Error(
264
- `Cannot resolve path, encountered non-object at part '${t.join("/")}', index ${n}'`
315
+ `Cannot resolve path, encountered non-object at part '${e.join("/")}', index ${r}'`
265
316
  );
266
- const o = t[n];
267
- let a = e[o];
268
- return a === void 0 && (a = (await p(e, r))[o]), await k(a, t, n + 1, r);
317
+ const o = e[r];
318
+ let a = t[o];
319
+ return a === void 0 && (a = (await y(t, n))[o]), await g(a, e, r + 1, n);
269
320
  }
270
- async function p(e, t) {
271
- i("resolveObject:", e);
272
- let n = e;
321
+ async function y(t, e) {
322
+ i("resolveObject:", t);
323
+ let r = t;
273
324
  do {
274
- if (typeof n != "object" || n === null || !("$ref" in n))
275
- return n;
276
- const r = H.filter((a) => F(a, n.$ref));
277
- if (r.length === 0) {
278
- if (n.$ref)
279
- throw new Error(`No resolver found for ref: ${n.$ref}`);
280
- return u(n), n;
325
+ if (typeof r != "object" || r === null || !("$ref" in r))
326
+ return r;
327
+ const n = H.filter((a) => M(a, r.$ref));
328
+ if (n.length === 0) {
329
+ if (r.$ref)
330
+ throw new Error(`No resolver found for ref: ${r.$ref}`);
331
+ return u(r), r;
281
332
  }
282
- if (r.length > 1)
283
- throw new Error(`Multiple resolvers can resolve ref: ${n.$ref}`);
284
- const o = await q(r[0], n.$ref, t);
285
- n = Y(o, n);
333
+ if (n.length > 1)
334
+ throw new Error(`Multiple resolvers can resolve ref: ${r.$ref}`);
335
+ const o = await Q(n[0], r.$ref, e);
336
+ r = x(o, r);
286
337
  } while (!0);
287
338
  }
288
- async function q(e, t, n) {
289
- if (!F(e, t))
290
- throw new Error(`Unexpected ref: ${t}`);
291
- return e.resolveRef(t, n);
339
+ async function Q(t, e, r) {
340
+ if (!M(t, e))
341
+ throw new Error(`Unexpected ref: ${e}`);
342
+ return t.resolveRef(e, r);
292
343
  }
293
- function F(e, t) {
294
- if (e.canResolve)
295
- return e.canResolve(t);
296
- if (e.schema)
297
- return Q(t, e.schema);
344
+ function M(t, e) {
345
+ if (t.canResolve)
346
+ return t.canResolve(e);
347
+ if (t.schema)
348
+ return X(e, t.schema);
298
349
  throw new Error("Resolver is missing canResolve method and schema property");
299
350
  }
300
- function Q(e, t) {
301
- const n = [`${t}+`, `${t}:`];
302
- for (const r of n)
303
- if (e.startsWith(r))
351
+ function X(t, e) {
352
+ const r = [`${e}+`, `${e}:`];
353
+ for (const n of r)
354
+ if (t.startsWith(n))
304
355
  return !0;
305
356
  return !1;
306
357
  }
307
- function l(e) {
308
- if (e.startsWith("http://") || e.startsWith("https://"))
309
- return e;
310
- const t = e.indexOf("+http://"), n = e.indexOf("+https://");
311
- if (t !== -1)
312
- return e.substring(t + 1);
313
- if (n !== -1)
314
- return e.substring(n + 1);
315
- const r = e.indexOf(":");
358
+ function l(t) {
359
+ if (t.startsWith("http://") || t.startsWith("https://"))
360
+ return t;
361
+ const e = t.indexOf("+http://"), r = t.indexOf("+https://");
362
+ if (e !== -1)
363
+ return t.substring(e + 1);
316
364
  if (r !== -1)
317
- return e.substring(r + 1);
318
- throw new Error(`Error getting URL from: ${e}, no valid prefix found`);
365
+ return t.substring(r + 1);
366
+ const n = t.indexOf(":");
367
+ if (n !== -1)
368
+ return t.substring(n + 1);
369
+ throw new Error(`Error getting URL from: ${t}, no valid prefix found`);
319
370
  }
320
- typeof window < "u" && (window.__debugResolve = async function(t, n, r) {
371
+ typeof window < "u" && (window.__debugResolve = async function(e, r, n) {
321
372
  let o, a, s;
322
- return typeof t == "string" ? (o = window.__lastResolveObject, a = t, s = n) : (o = t, a = n, s = r), await m(o, a, s);
373
+ return typeof e == "string" ? (o = window.__lastResolveObject, a = e, s = r) : (o = e, a = r, s = n), await v(o, a, s);
323
374
  });
324
- function w(e) {
325
- return async (t, ...n) => {
375
+ function m(t) {
376
+ return async (e, ...r) => {
326
377
  try {
327
- const a = (await import(await m(t, "/runtime/entry")))[e];
328
- return a(t, ...n);
329
- } catch (r) {
330
- throw console.error("efp-loader", `Error when trying to import and call "${e}":`, r), r;
378
+ const a = (await import(await v(e, "/runtime/entry")))[t];
379
+ return a(e, ...r);
380
+ } catch (n) {
381
+ throw console.error("efp-loader", `Error when trying to import and call "${t}":`, n), n;
331
382
  }
332
383
  };
333
384
  }
334
- function i(...e) {
335
- globalThis.__EFP_LOADER_DEBUG__ && console.debug("efp-loader", ...e);
385
+ function i(...t) {
386
+ globalThis.__EFP_LOADER_DEBUG__ && console.debug("efp-loader", ...t);
336
387
  }
337
- function u(e) {
338
- if (e === null || typeof e != "object") return e;
339
- Object.freeze(e);
340
- for (const t of Object.keys(e)) {
341
- const n = e[t];
342
- typeof n == "object" && n !== null && !Object.isFrozen(n) && u(n);
388
+ function u(t) {
389
+ if (t === null || typeof t != "object") return t;
390
+ Object.freeze(t);
391
+ for (const e of Object.keys(t)) {
392
+ const r = t[e];
393
+ typeof r == "object" && r !== null && !Object.isFrozen(r) && u(r);
343
394
  }
344
- return e;
395
+ return t;
345
396
  }
346
- function _(e) {
347
- return "structuredClone" in globalThis ? globalThis.structuredClone(e) : JSON.parse(JSON.stringify(e));
397
+ function F(t) {
398
+ return "structuredClone" in globalThis ? globalThis.structuredClone(t) : JSON.parse(JSON.stringify(t));
348
399
  }
349
- function X(e) {
400
+ function Y(t) {
350
401
  if (typeof document > "u") return;
351
- const t = document.createElement("link");
352
- t.rel = "preconnect", t.href = e, t.crossOrigin = "anonymous", document.head.appendChild(t);
402
+ const e = document.createElement("link");
403
+ e.rel = "preconnect", e.href = t, e.crossOrigin = "anonymous", document.head.appendChild(e);
353
404
  }
354
- function Y(e, t) {
355
- if (e === t) return;
356
- if (t === null || typeof t != "object")
405
+ function x(t, e) {
406
+ if (t === e) return;
407
+ if (e === null || typeof e != "object")
357
408
  throw new Error("Cannot merge non-object source");
358
- if (Array.isArray(t))
359
- throw new Error("Cannot merge arrays");
360
- const n = Object.keys(t).filter((o) => o !== "$ref");
361
- if (n.length === 0) return _(e);
362
409
  if (Array.isArray(e))
410
+ throw new Error("Cannot merge arrays");
411
+ const r = Object.keys(e).filter((o) => o !== "$ref");
412
+ if (r.length === 0) return F(t);
413
+ if (Array.isArray(t))
363
414
  throw new Error("Cannot merge into arrays");
364
- if (e === null || typeof e != "object")
415
+ if (t === null || typeof t != "object")
365
416
  throw new Error("Cannot merge into non-object target");
366
- const r = _({ ...e });
367
- for (const o of n)
368
- r[o] = t[o];
369
- return r;
417
+ const n = F({ ...t });
418
+ for (const o of r)
419
+ n[o] = e[o];
420
+ return n;
370
421
  }
371
- function ee(e, t) {
372
- if (e !== t) {
373
- if (t === null || typeof t != "object")
374
- throw new Error("Cannot replace with non-object source");
422
+ function ee(t, e) {
423
+ if (t !== e) {
375
424
  if (e === null || typeof e != "object")
425
+ throw new Error("Cannot replace with non-object source");
426
+ if (t === null || typeof t != "object")
376
427
  throw new Error("Cannot replace non-object target");
377
- if (Array.isArray(e)) {
378
- if (!Array.isArray(t))
428
+ if (Array.isArray(t)) {
429
+ if (!Array.isArray(e))
379
430
  throw new Error("replaceObjectFields does not support mixing arrays and objects");
380
- e.length = 0;
381
- for (const n of t)
382
- e.push(n);
431
+ t.length = 0;
432
+ for (const r of e)
433
+ t.push(r);
383
434
  return;
384
435
  }
385
- for (const n of Object.keys(e))
386
- n in t || delete e[n];
387
- for (const n of Object.keys(t))
388
- e[n] = t[n];
436
+ for (const r of Object.keys(t))
437
+ r in e || delete t[r];
438
+ for (const r of Object.keys(e))
439
+ t[r] = e[r];
389
440
  }
390
441
  }
391
- async function te(e, t, n) {
392
- n = n || {};
393
- for (const r of t)
394
- await m(e, r, { ...n, mutate: !0 });
442
+ async function te(t, e, r) {
443
+ r = r || {};
444
+ for (const n of e)
445
+ await v(t, n, { ...r, mutate: !0 });
395
446
  }
396
447
  typeof window < "u" && (window.__debugMutateManifest = te);
397
- async function ne(e) {
398
- const { makeOfflineBundle: t } = await import("./makeOfflineBundle-g0Y3sA2l.js");
399
- return await t(e);
448
+ async function re(t) {
449
+ const { makeOfflineBundle: e } = await import("./makeOfflineBundle-D4r0VqcQ.js");
450
+ return await e(t);
400
451
  }
401
- async function re(e) {
402
- const { downloadZip: t } = await import("./downloadZip-DMgeO3fU.js");
403
- return await t(e);
452
+ async function oe(t) {
453
+ const { downloadZip: e } = await import("./downloadZip-mR_QbdG8.js");
454
+ return await e(t);
404
455
  }
405
- async function oe(e) {
406
- const { makeOffline: t } = await import("./makeOffline-1iGrM4gF.js"), n = await t(e);
407
- for await (const r of (await n).files)
408
- "data" in r ? console.info(`🗳️ Put ${r.targetFilePath} <=`, r.data) : "url" in r && console.info(`🗳️ Download ${r.targetFilePath} <= ${r.url}`);
409
- console.info("Offline data: ", n.manifest);
456
+ async function ne(t) {
457
+ const { makeOffline: e } = await import("./makeOffline-CfdUQ4b2.js"), r = await e(t);
458
+ for await (const n of (await r).files)
459
+ "data" in n ? console.info(`🗳️ Put ${n.targetFilePath} <=`, n.data) : "url" in n && console.info(`🗳️ Download ${n.targetFilePath} <= ${n.url}`);
460
+ console.info("Offline data: ", r.manifest);
410
461
  }
411
- typeof window < "u" && (window.__debugDownloadZip = re, window.__debugMakeOfflineBundle = ne, window.__debugLogOfflineManifestFiles = oe);
412
- const ie = w("mount"), le = w("load"), ce = w("initialize");
413
- async function fe(e, t, ...n) {
414
- return await w(e)(t, ...n);
462
+ typeof window < "u" && (window.__debugDownloadZip = oe, window.__debugMakeOfflineBundle = re, window.__debugLogOfflineManifestFiles = ne);
463
+ const ie = m("mount"), le = m("load"), ce = m("initialize");
464
+ async function fe(t, e, ...r) {
465
+ return await m(t)(e, ...r);
415
466
  }
416
- X("https://efp-runtime.expofp.com/");
467
+ Y("https://efp-runtime.expofp.com/");
417
468
  export {
418
- Y as a,
419
- q as b,
420
- F as c,
469
+ x as a,
470
+ Q as b,
471
+ M as c,
421
472
  fe as callFunction_Experimental,
422
- _ as d,
423
- re as downloadZip,
473
+ F as d,
474
+ oe as downloadZip,
424
475
  ce as initialize,
425
476
  i as l,
426
477
  le as load,
427
- ne as makeOfflineBundle,
478
+ re as makeOfflineBundle,
428
479
  ie as mount,
429
480
  te as mutateManifest,
430
481
  l as p,
431
482
  H as r,
432
- m as resolve
483
+ v as resolve
433
484
  };
434
485
  //# sourceMappingURL=index.js.map