@expofp/loader 1.0.48 → 1.0.49

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
@@ -17,17 +17,17 @@ async function f(t, e) {
17
17
  i("importJson: dynamic import not available, falling back to fetch"), h = !0;
18
18
  }
19
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;
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.signal || null), (o = e.importCallback) == null || o.call(e, t, "json")), N.has(r) || u(r), r;
21
21
  }
22
22
  async function W(t, e, r) {
23
23
  const n = "__loadJson__" + t;
24
24
  if (e.has(n))
25
25
  return e.get(n);
26
26
  const o = (async function() {
27
- const s = await fetch(t, { signal: r });
28
- if (!s.ok)
27
+ const a = await fetch(t, { signal: r });
28
+ if (!a.ok)
29
29
  throw new Error(`Failed to fetch JSON from ${t}`);
30
- return await s.json();
30
+ return await a.json();
31
31
  })();
32
32
  return e.set(n, o), o;
33
33
  }
@@ -44,8 +44,8 @@ const B = {
44
44
  const r = l(t);
45
45
  return p(t, e.refCache, async () => {
46
46
  const n = await f(r, e), o = r.substring(0, r.lastIndexOf("/") + 1);
47
- return n.map((s) => ({
48
- $ref: `asset+${o}${s}`
47
+ return n.map((a) => ({
48
+ $ref: `asset+${o}${a}`
49
49
  }));
50
50
  });
51
51
  },
@@ -111,18 +111,18 @@ const B = {
111
111
  };
112
112
  async function O(t, e) {
113
113
  const { globalVar: r, timeoutMs: n = 1e4, pollIntervalMs: o = 10 } = e;
114
- P() ? (await z(t, e.abortSignal), r && await k(
114
+ P() ? (await z(t, e.signal), r && await k(
115
115
  () => window[r],
116
116
  r,
117
117
  n,
118
118
  o,
119
- e.abortSignal
120
- )) : (await S(t, e.abortSignal), r && await k(
119
+ e.signal
120
+ )) : (await V(t, e.signal), r && await k(
121
121
  () => globalThis[r],
122
122
  r,
123
123
  n,
124
124
  o,
125
- e.abortSignal
125
+ e.signal
126
126
  ));
127
127
  }
128
128
  function P() {
@@ -132,23 +132,23 @@ function z(t, e) {
132
132
  return new Promise((r, n) => {
133
133
  const o = document.createElement("script");
134
134
  o.src = t, o.async = !0;
135
- const a = () => {
135
+ const s = () => {
136
136
  o.onload = null, o.onerror = null, o.remove();
137
- }, s = () => {
138
- a(), n(new Error("Script load aborted"));
137
+ }, a = () => {
138
+ s(), n(new Error("Script load aborted"));
139
139
  };
140
140
  if (e != null && e.aborted) {
141
- a(), n(new Error("Script load aborted"));
141
+ s(), n(new Error("Script load aborted"));
142
142
  return;
143
143
  }
144
- e == null || e.addEventListener("abort", s, { once: !0 }), o.onload = () => {
145
- e == null || e.removeEventListener("abort", s), a(), r();
144
+ e == null || e.addEventListener("abort", a, { once: !0 }), o.onload = () => {
145
+ e == null || e.removeEventListener("abort", a), s(), r();
146
146
  }, o.onerror = () => {
147
- e == null || e.removeEventListener("abort", s), a(), n(new Error(`Failed to load script: ${t}`));
147
+ e == null || e.removeEventListener("abort", a), s(), n(new Error(`Failed to load script: ${t}`));
148
148
  }, document.head.appendChild(o);
149
149
  });
150
150
  }
151
- async function S(t, e) {
151
+ async function V(t, e) {
152
152
  if (typeof fetch != "function")
153
153
  throw new Error("loadInNode: fetch is not available. Use Node 18+ or provide a global fetch.");
154
154
  if (e != null && e.aborted)
@@ -156,8 +156,8 @@ async function S(t, e) {
156
156
  let r;
157
157
  try {
158
158
  r = await fetch(t, { signal: e });
159
- } catch (s) {
160
- throw s && s.name === "AbortError" ? new Error("Script load aborted") : s;
159
+ } catch (a) {
160
+ throw a && a.name === "AbortError" ? new Error("Script load aborted") : a;
161
161
  }
162
162
  if (!r.ok)
163
163
  throw new Error(`Failed to load script in Node (HTTP ${r.status}): ${t}`);
@@ -166,45 +166,45 @@ async function S(t, e) {
166
166
  let n;
167
167
  try {
168
168
  n = await r.text();
169
- } catch (s) {
170
- throw s && s.name === "AbortError" ? new Error("Script load aborted") : s;
169
+ } catch (a) {
170
+ throw a && a.name === "AbortError" ? new Error("Script load aborted") : a;
171
171
  }
172
172
  if (e != null && e.aborted)
173
173
  throw new Error("Script load aborted");
174
- const o = globalThis, a = o.window;
174
+ const o = globalThis, s = o.window;
175
175
  o.window = o;
176
176
  try {
177
177
  (0, eval)(n);
178
178
  } finally {
179
- a === void 0 ? delete o.window : o.window = a;
179
+ s === void 0 ? delete o.window : o.window = s;
180
180
  }
181
181
  }
182
182
  function k(t, e, r, n, o) {
183
- return new Promise((a, s) => {
183
+ return new Promise((s, a) => {
184
184
  const d = Date.now(), c = () => {
185
- s(new Error("Wait for global aborted"));
185
+ a(new Error("Wait for global aborted"));
186
186
  };
187
187
  if (o != null && o.aborted) {
188
- s(new Error("Wait for global aborted"));
188
+ a(new Error("Wait for global aborted"));
189
189
  return;
190
190
  }
191
191
  o == null || o.addEventListener("abort", c, { once: !0 });
192
192
  const w = () => {
193
193
  if (o != null && o.aborted)
194
- return s(new Error("Wait for global aborted"));
194
+ return a(new Error("Wait for global aborted"));
195
195
  try {
196
196
  if (t() !== void 0)
197
- return o == null || o.removeEventListener("abort", c), a();
197
+ return o == null || o.removeEventListener("abort", c), s();
198
198
  } catch {
199
199
  }
200
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}"`));
201
+ return o == null || o.removeEventListener("abort", c), a(new Error(`Timed out after ${r} ms waiting for global "${e}"`));
202
202
  setTimeout(w, n);
203
203
  };
204
204
  w();
205
205
  });
206
206
  }
207
- const V = {
207
+ const G = {
208
208
  schema: "legacy-asset-urls",
209
209
  resolveRef(t, e) {
210
210
  return i("legacyAssetUrlsResolver resolveRef:", t), p(t, e.refCache, async () => {
@@ -214,38 +214,38 @@ const V = {
214
214
  await O(n, {
215
215
  globalVar: "__fpDataVersion",
216
216
  timeoutMs: 3e4,
217
- abortSignal: e.abortSignal
217
+ signal: e.signal
218
218
  }), (b = e.importCallback) == null || b.call(e, n, "script");
219
219
  } catch {
220
220
  console.warn(`Could not load version.js at ${n}, proceeding without it`);
221
221
  }
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, {
222
+ const o = globalThis.__fpDataVersion || (+/* @__PURE__ */ new Date()).toString(), s = `${r}files.json?v=${o}`, a = `${r}data.js?v=${o}`, d = f(s, e), c = O(a, {
223
223
  globalVar: "__data",
224
- abortSignal: e.abortSignal
224
+ signal: e.signal
225
225
  });
226
- (R = e.importCallback) == null || R.call(e, s, "script"), await Promise.all([d, c]);
226
+ (R = e.importCallback) == null || R.call(e, a, "script"), await Promise.all([d, c]);
227
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) };
228
+ return { ...[...w, "data.js"].reduce((E, $) => (E[$] = { $ref: `asset+${r}${$}?v=${o}` }, E), {}), ...Z(r, j) };
229
229
  });
230
230
  },
231
231
  offlineMethod: "resolveRef"
232
232
  };
233
- function G(t, e) {
233
+ function Z(t, e) {
234
234
  const r = /* @__PURE__ */ new Set();
235
235
  function n(o) {
236
236
  typeof o == "string" && o.length > 0 && r.add(o);
237
237
  }
238
238
  return n(e.logo), e.exhibitors.forEach((o) => {
239
- var a;
240
- n(o.logo), (a = o.gallery) == null || a.forEach((s) => n(s));
239
+ var s;
240
+ n(o.logo), (s = o.gallery) == null || s.forEach((a) => n(a));
241
241
  }), e.events.forEach((o) => {
242
- var a;
243
- n(o.logoFile), (a = o.speakers) == null || a.forEach((s) => {
244
- n(s.photoFile);
242
+ var s;
243
+ n(o.logoFile), (s = o.speakers) == null || s.forEach((a) => {
244
+ n(a.photoFile);
245
245
  });
246
- }), Array.from(r).reduce((o, a) => (o[a] = { $ref: `asset+${t}${a}` }, o), {});
246
+ }), Array.from(r).reduce((o, s) => (o[s] = { $ref: `asset+${t}${s}` }, o), {});
247
247
  }
248
- const Z = {
248
+ const H = {
249
249
  schema: "legacy-data",
250
250
  resolveRef(t, e) {
251
251
  return i("legacyDataResolver resolveRef:", t), p(t, e.refCache, async () => {
@@ -257,23 +257,23 @@ const Z = {
257
257
  });
258
258
  },
259
259
  offlineMethod: "resolveRef"
260
- }, H = [
260
+ }, K = [
261
261
  I,
262
262
  B,
263
263
  U,
264
264
  D,
265
265
  T,
266
266
  C,
267
- Z,
268
- V
269
- ], K = /* @__PURE__ */ new Map();
267
+ H,
268
+ G
269
+ ], q = /* @__PURE__ */ new Map();
270
270
  async function v(t, e, r) {
271
271
  i("Resolving:", e, "of", t, r), typeof window < "u" && (window.__lastResolveObject = t);
272
272
  const n = {
273
273
  importCallback: r == null ? void 0 : r.importCallback,
274
- refCache: (r == null ? void 0 : r.refCache) || K,
274
+ refCache: (r == null ? void 0 : r.refCache) || q,
275
275
  forceFetch: !!(r != null && r.forceFetch),
276
- abortSignal: (r == null ? void 0 : r.abortSignal) || null
276
+ signal: (r == null ? void 0 : r.signal) || null
277
277
  };
278
278
  if (typeof e != "string")
279
279
  throw new Error(`Invalid JSON Pointer (not a string): ${e}`);
@@ -282,18 +282,18 @@ async function v(t, e, r) {
282
282
  if (e.length > 1 && e.endsWith("/"))
283
283
  throw new Error(`Invalid JSON Pointer: ${e}`);
284
284
  let o;
285
- if (e === "/" ? o = [] : o = e.substring(1).split("/"), o.some((a) => a.length === 0))
285
+ if (e === "/" ? o = [] : o = e.substring(1).split("/"), o.some((s) => s.length === 0))
286
286
  throw new Error(`Invalid JSON Pointer (empty part): ${e}`);
287
287
  if (r != null && r.mutate) {
288
288
  o.unshift("root");
289
- const a = { root: t };
290
- await A(a, o, 0, n), ee(t, a.root);
289
+ const s = { root: t };
290
+ await A(s, o, 0, n), ee(t, s.root);
291
291
  } else
292
292
  return await g(t, o, 0, n);
293
293
  }
294
294
  async function A(t, e, r, n) {
295
295
  const o = e[r];
296
- if (await q(t, o, n), r != e.length - 1) {
296
+ if (await Q(t, o, n), r != e.length - 1) {
297
297
  if (t[o] === null || typeof t[o] != "object")
298
298
  throw new Error(
299
299
  `Cannot resolve path, encountered non-object at part '${e.slice(1).join("/")}', index ${r - 1}'`
@@ -301,7 +301,7 @@ async function A(t, e, r, n) {
301
301
  return await A(t[o], e, r + 1, n);
302
302
  }
303
303
  }
304
- async function q(t, e, r) {
304
+ async function Q(t, e, r) {
305
305
  i("resolveObjectMutate:", t, e);
306
306
  let n = t[e];
307
307
  const o = await y(n, r);
@@ -315,8 +315,8 @@ async function g(t, e, r, n) {
315
315
  `Cannot resolve path, encountered non-object at part '${e.join("/")}', index ${r}'`
316
316
  );
317
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);
318
+ let s = t[o];
319
+ return s === void 0 && (s = (await y(t, n))[o]), await g(s, e, r + 1, n);
320
320
  }
321
321
  async function y(t, e) {
322
322
  i("resolveObject:", t);
@@ -324,7 +324,7 @@ async function y(t, e) {
324
324
  do {
325
325
  if (typeof r != "object" || r === null || !("$ref" in r))
326
326
  return r;
327
- const n = H.filter((a) => M(a, r.$ref));
327
+ const n = K.filter((s) => M(s, r.$ref));
328
328
  if (n.length === 0) {
329
329
  if (r.$ref)
330
330
  throw new Error(`No resolver found for ref: ${r.$ref}`);
@@ -332,11 +332,11 @@ async function y(t, e) {
332
332
  }
333
333
  if (n.length > 1)
334
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);
335
+ const o = await X(n[0], r.$ref, e);
336
+ r = S(o, r);
337
337
  } while (!0);
338
338
  }
339
- async function Q(t, e, r) {
339
+ async function X(t, e, r) {
340
340
  if (!M(t, e))
341
341
  throw new Error(`Unexpected ref: ${e}`);
342
342
  return t.resolveRef(e, r);
@@ -345,10 +345,10 @@ function M(t, e) {
345
345
  if (t.canResolve)
346
346
  return t.canResolve(e);
347
347
  if (t.schema)
348
- return X(e, t.schema);
348
+ return Y(e, t.schema);
349
349
  throw new Error("Resolver is missing canResolve method and schema property");
350
350
  }
351
- function X(t, e) {
351
+ function Y(t, e) {
352
352
  const r = [`${e}+`, `${e}:`];
353
353
  for (const n of r)
354
354
  if (t.startsWith(n))
@@ -369,14 +369,14 @@ function l(t) {
369
369
  throw new Error(`Error getting URL from: ${t}, no valid prefix found`);
370
370
  }
371
371
  typeof window < "u" && (window.__debugResolve = async function(e, r, n) {
372
- let 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);
372
+ let o, s, a;
373
+ return typeof e == "string" ? (o = window.__lastResolveObject, s = e, a = r) : (o = e, s = r, a = n), await v(o, s, a);
374
374
  });
375
375
  function m(t) {
376
376
  return async (e, ...r) => {
377
377
  try {
378
- const a = (await import(await v(e, "/runtime/entry")))[t];
379
- return a(e, ...r);
378
+ const s = (await import(await v(e, "/runtime/entry")))[t];
379
+ return s(e, ...r);
380
380
  } catch (n) {
381
381
  throw console.error("efp-loader", `Error when trying to import and call "${t}":`, n), n;
382
382
  }
@@ -397,12 +397,12 @@ function u(t) {
397
397
  function F(t) {
398
398
  return "structuredClone" in globalThis ? globalThis.structuredClone(t) : JSON.parse(JSON.stringify(t));
399
399
  }
400
- function Y(t) {
400
+ function x(t) {
401
401
  if (typeof document > "u") return;
402
402
  const e = document.createElement("link");
403
403
  e.rel = "preconnect", e.href = t, e.crossOrigin = "anonymous", document.head.appendChild(e);
404
404
  }
405
- function x(t, e) {
405
+ function S(t, e) {
406
406
  if (t === e) return;
407
407
  if (e === null || typeof e != "object")
408
408
  throw new Error("Cannot merge non-object source");
@@ -446,15 +446,15 @@ async function te(t, e, r) {
446
446
  }
447
447
  typeof window < "u" && (window.__debugMutateManifest = te);
448
448
  async function re(t) {
449
- const { makeOfflineBundle: e } = await import("./makeOfflineBundle-D4r0VqcQ.js");
449
+ const { makeOfflineBundle: e } = await import("./makeOfflineBundle-CdE5LdlF.js");
450
450
  return await e(t);
451
451
  }
452
452
  async function oe(t) {
453
- const { downloadZip: e } = await import("./downloadZip-mR_QbdG8.js");
453
+ const { downloadZip: e } = await import("./downloadZip-D1Leqczj.js");
454
454
  return await e(t);
455
455
  }
456
456
  async function ne(t) {
457
- const { makeOffline: e } = await import("./makeOffline-CfdUQ4b2.js"), r = await e(t);
457
+ const { makeOffline: e } = await import("./makeOffline-DdJq2uGI.js"), r = await e(t);
458
458
  for await (const n of (await r).files)
459
459
  "data" in n ? console.info(`🗳️ Put ${n.targetFilePath} <=`, n.data) : "url" in n && console.info(`🗳️ Download ${n.targetFilePath} <= ${n.url}`);
460
460
  console.info("Offline data: ", r.manifest);
@@ -464,10 +464,10 @@ const ie = m("mount"), le = m("load"), ce = m("initialize");
464
464
  async function fe(t, e, ...r) {
465
465
  return await m(t)(e, ...r);
466
466
  }
467
- Y("https://efp-runtime.expofp.com/");
467
+ x("https://efp-runtime.expofp.com/");
468
468
  export {
469
- x as a,
470
- Q as b,
469
+ S as a,
470
+ X as b,
471
471
  M as c,
472
472
  fe as callFunction_Experimental,
473
473
  F as d,
@@ -479,7 +479,7 @@ export {
479
479
  ie as mount,
480
480
  te as mutateManifest,
481
481
  l as p,
482
- H as r,
482
+ K as r,
483
483
  v as resolve
484
484
  };
485
485
  //# sourceMappingURL=index.js.map