@expofp/loader 1.0.95 → 1.0.98

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.
@@ -1,4 +1,4 @@
1
- const k = ["1.0.95", "2025-12-24T13:16:53.225Z"];
1
+ const k = ["1.0.98", "2025-12-24T13:58:59.502Z"];
2
2
  function N(s) {
3
3
  return s && s.__esModule && Object.prototype.hasOwnProperty.call(s, "default") ? s.default : s;
4
4
  }
@@ -408,15 +408,18 @@ async function G(s) {
408
408
  const E = R("efp:loader");
409
409
  typeof k < "u" ? E("Initialized", { version: k[0], builtAt: k[1] }) : E("Initialized");
410
410
  async function Z(s, r) {
411
- let c = await M(s, { fetchCallback: r == null ? void 0 : r.fetchCallback }), e;
412
- if (typeof c == "string" ? e = c : typeof c == "object" && "runtimeUrl" in c && (e = await M(c.runtimeUrl, { fetchCallback: r == null ? void 0 : r.fetchCallback })), e === void 0)
411
+ let c = await M(s, {
412
+ fetchCallback: r == null ? void 0 : r.fetchCallback
413
+ }), e;
414
+ if (typeof c == "string" ? e = c : typeof c == "object" && "runtimeUrl" in c && (e = await M(c.runtimeUrl, {
415
+ fetchCallback: r == null ? void 0 : r.fetchCallback
416
+ })), e === void 0)
413
417
  throw new Error(
414
418
  "Could not determine runtime URL. It must be resolvable to a string or to a manifest with a runtimeUrl property."
415
419
  );
416
420
  if (E("Loading runtime:", e), typeof e != "string")
417
421
  throw new Error("Runtime URL must be a string");
418
- const a = await D(e);
419
- return a.meta = { runtimeUrl: e }, a;
422
+ return { ...await D(e), meta: { runtimeUrl: e } };
420
423
  }
421
424
  const K = new Proxy(
422
425
  {},
@@ -1 +1 @@
1
- {"version":3,"file":"bundle.js","sources":["../../node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js","../../node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/common.js","../../node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/browser.js","../../src/fetch.ts","../../src/importHttpRuntime.ts","../../src/resolve.ts","../../src/index.ts"],"sourcesContent":["/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar w = d * 7;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function (val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isFinite(val)) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^(-?(?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'weeks':\n case 'week':\n case 'w':\n return n * w;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (msAbs >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (msAbs >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (msAbs >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return plural(ms, msAbs, d, 'day');\n }\n if (msAbs >= h) {\n return plural(ms, msAbs, h, 'hour');\n }\n if (msAbs >= m) {\n return plural(ms, msAbs, m, 'minute');\n }\n if (msAbs >= s) {\n return plural(ms, msAbs, s, 'second');\n }\n return ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, msAbs, n, name) {\n var isPlural = msAbs >= n * 1.5;\n return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');\n}\n","\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n */\n\nfunction setup(env) {\n\tcreateDebug.debug = createDebug;\n\tcreateDebug.default = createDebug;\n\tcreateDebug.coerce = coerce;\n\tcreateDebug.disable = disable;\n\tcreateDebug.enable = enable;\n\tcreateDebug.enabled = enabled;\n\tcreateDebug.humanize = require('ms');\n\tcreateDebug.destroy = destroy;\n\n\tObject.keys(env).forEach(key => {\n\t\tcreateDebug[key] = env[key];\n\t});\n\n\t/**\n\t* The currently active debug mode names, and names to skip.\n\t*/\n\n\tcreateDebug.names = [];\n\tcreateDebug.skips = [];\n\n\t/**\n\t* Map of special \"%n\" handling functions, for the debug \"format\" argument.\n\t*\n\t* Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n\t*/\n\tcreateDebug.formatters = {};\n\n\t/**\n\t* Selects a color for a debug namespace\n\t* @param {String} namespace The namespace string for the debug instance to be colored\n\t* @return {Number|String} An ANSI color code for the given namespace\n\t* @api private\n\t*/\n\tfunction selectColor(namespace) {\n\t\tlet hash = 0;\n\n\t\tfor (let i = 0; i < namespace.length; i++) {\n\t\t\thash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n\t\t\thash |= 0; // Convert to 32bit integer\n\t\t}\n\n\t\treturn createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n\t}\n\tcreateDebug.selectColor = selectColor;\n\n\t/**\n\t* Create a debugger with the given `namespace`.\n\t*\n\t* @param {String} namespace\n\t* @return {Function}\n\t* @api public\n\t*/\n\tfunction createDebug(namespace) {\n\t\tlet prevTime;\n\t\tlet enableOverride = null;\n\t\tlet namespacesCache;\n\t\tlet enabledCache;\n\n\t\tfunction debug(...args) {\n\t\t\t// Disabled?\n\t\t\tif (!debug.enabled) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst self = debug;\n\n\t\t\t// Set `diff` timestamp\n\t\t\tconst curr = Number(new Date());\n\t\t\tconst ms = curr - (prevTime || curr);\n\t\t\tself.diff = ms;\n\t\t\tself.prev = prevTime;\n\t\t\tself.curr = curr;\n\t\t\tprevTime = curr;\n\n\t\t\targs[0] = createDebug.coerce(args[0]);\n\n\t\t\tif (typeof args[0] !== 'string') {\n\t\t\t\t// Anything else let's inspect with %O\n\t\t\t\targs.unshift('%O');\n\t\t\t}\n\n\t\t\t// Apply any `formatters` transformations\n\t\t\tlet index = 0;\n\t\t\targs[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {\n\t\t\t\t// If we encounter an escaped % then don't increase the array index\n\t\t\t\tif (match === '%%') {\n\t\t\t\t\treturn '%';\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t\tconst formatter = createDebug.formatters[format];\n\t\t\t\tif (typeof formatter === 'function') {\n\t\t\t\t\tconst val = args[index];\n\t\t\t\t\tmatch = formatter.call(self, val);\n\n\t\t\t\t\t// Now we need to remove `args[index]` since it's inlined in the `format`\n\t\t\t\t\targs.splice(index, 1);\n\t\t\t\t\tindex--;\n\t\t\t\t}\n\t\t\t\treturn match;\n\t\t\t});\n\n\t\t\t// Apply env-specific formatting (colors, etc.)\n\t\t\tcreateDebug.formatArgs.call(self, args);\n\n\t\t\tconst logFn = self.log || createDebug.log;\n\t\t\tlogFn.apply(self, args);\n\t\t}\n\n\t\tdebug.namespace = namespace;\n\t\tdebug.useColors = createDebug.useColors();\n\t\tdebug.color = createDebug.selectColor(namespace);\n\t\tdebug.extend = extend;\n\t\tdebug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.\n\n\t\tObject.defineProperty(debug, 'enabled', {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: false,\n\t\t\tget: () => {\n\t\t\t\tif (enableOverride !== null) {\n\t\t\t\t\treturn enableOverride;\n\t\t\t\t}\n\t\t\t\tif (namespacesCache !== createDebug.namespaces) {\n\t\t\t\t\tnamespacesCache = createDebug.namespaces;\n\t\t\t\t\tenabledCache = createDebug.enabled(namespace);\n\t\t\t\t}\n\n\t\t\t\treturn enabledCache;\n\t\t\t},\n\t\t\tset: v => {\n\t\t\t\tenableOverride = v;\n\t\t\t}\n\t\t});\n\n\t\t// Env-specific initialization logic for debug instances\n\t\tif (typeof createDebug.init === 'function') {\n\t\t\tcreateDebug.init(debug);\n\t\t}\n\n\t\treturn debug;\n\t}\n\n\tfunction extend(namespace, delimiter) {\n\t\tconst newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n\t\tnewDebug.log = this.log;\n\t\treturn newDebug;\n\t}\n\n\t/**\n\t* Enables a debug mode by namespaces. This can include modes\n\t* separated by a colon and wildcards.\n\t*\n\t* @param {String} namespaces\n\t* @api public\n\t*/\n\tfunction enable(namespaces) {\n\t\tcreateDebug.save(namespaces);\n\t\tcreateDebug.namespaces = namespaces;\n\n\t\tcreateDebug.names = [];\n\t\tcreateDebug.skips = [];\n\n\t\tconst split = (typeof namespaces === 'string' ? namespaces : '')\n\t\t\t.trim()\n\t\t\t.replace(/\\s+/g, ',')\n\t\t\t.split(',')\n\t\t\t.filter(Boolean);\n\n\t\tfor (const ns of split) {\n\t\t\tif (ns[0] === '-') {\n\t\t\t\tcreateDebug.skips.push(ns.slice(1));\n\t\t\t} else {\n\t\t\t\tcreateDebug.names.push(ns);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Checks if the given string matches a namespace template, honoring\n\t * asterisks as wildcards.\n\t *\n\t * @param {String} search\n\t * @param {String} template\n\t * @return {Boolean}\n\t */\n\tfunction matchesTemplate(search, template) {\n\t\tlet searchIndex = 0;\n\t\tlet templateIndex = 0;\n\t\tlet starIndex = -1;\n\t\tlet matchIndex = 0;\n\n\t\twhile (searchIndex < search.length) {\n\t\t\tif (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === '*')) {\n\t\t\t\t// Match character or proceed with wildcard\n\t\t\t\tif (template[templateIndex] === '*') {\n\t\t\t\t\tstarIndex = templateIndex;\n\t\t\t\t\tmatchIndex = searchIndex;\n\t\t\t\t\ttemplateIndex++; // Skip the '*'\n\t\t\t\t} else {\n\t\t\t\t\tsearchIndex++;\n\t\t\t\t\ttemplateIndex++;\n\t\t\t\t}\n\t\t\t} else if (starIndex !== -1) { // eslint-disable-line no-negated-condition\n\t\t\t\t// Backtrack to the last '*' and try to match more characters\n\t\t\t\ttemplateIndex = starIndex + 1;\n\t\t\t\tmatchIndex++;\n\t\t\t\tsearchIndex = matchIndex;\n\t\t\t} else {\n\t\t\t\treturn false; // No match\n\t\t\t}\n\t\t}\n\n\t\t// Handle trailing '*' in template\n\t\twhile (templateIndex < template.length && template[templateIndex] === '*') {\n\t\t\ttemplateIndex++;\n\t\t}\n\n\t\treturn templateIndex === template.length;\n\t}\n\n\t/**\n\t* Disable debug output.\n\t*\n\t* @return {String} namespaces\n\t* @api public\n\t*/\n\tfunction disable() {\n\t\tconst namespaces = [\n\t\t\t...createDebug.names,\n\t\t\t...createDebug.skips.map(namespace => '-' + namespace)\n\t\t].join(',');\n\t\tcreateDebug.enable('');\n\t\treturn namespaces;\n\t}\n\n\t/**\n\t* Returns true if the given mode name is enabled, false otherwise.\n\t*\n\t* @param {String} name\n\t* @return {Boolean}\n\t* @api public\n\t*/\n\tfunction enabled(name) {\n\t\tfor (const skip of createDebug.skips) {\n\t\t\tif (matchesTemplate(name, skip)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tfor (const ns of createDebug.names) {\n\t\t\tif (matchesTemplate(name, ns)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t* Coerce `val`.\n\t*\n\t* @param {Mixed} val\n\t* @return {Mixed}\n\t* @api private\n\t*/\n\tfunction coerce(val) {\n\t\tif (val instanceof Error) {\n\t\t\treturn val.stack || val.message;\n\t\t}\n\t\treturn val;\n\t}\n\n\t/**\n\t* XXX DO NOT USE. This is a temporary stub function.\n\t* XXX It WILL be removed in the next major release.\n\t*/\n\tfunction destroy() {\n\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t}\n\n\tcreateDebug.enable(createDebug.load());\n\n\treturn createDebug;\n}\n\nmodule.exports = setup;\n","/* eslint-env browser */\n\n/**\n * This is the web browser implementation of `debug()`.\n */\n\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = localstorage();\nexports.destroy = (() => {\n\tlet warned = false;\n\n\treturn () => {\n\t\tif (!warned) {\n\t\t\twarned = true;\n\t\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t\t}\n\t};\n})();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n\t'#0000CC',\n\t'#0000FF',\n\t'#0033CC',\n\t'#0033FF',\n\t'#0066CC',\n\t'#0066FF',\n\t'#0099CC',\n\t'#0099FF',\n\t'#00CC00',\n\t'#00CC33',\n\t'#00CC66',\n\t'#00CC99',\n\t'#00CCCC',\n\t'#00CCFF',\n\t'#3300CC',\n\t'#3300FF',\n\t'#3333CC',\n\t'#3333FF',\n\t'#3366CC',\n\t'#3366FF',\n\t'#3399CC',\n\t'#3399FF',\n\t'#33CC00',\n\t'#33CC33',\n\t'#33CC66',\n\t'#33CC99',\n\t'#33CCCC',\n\t'#33CCFF',\n\t'#6600CC',\n\t'#6600FF',\n\t'#6633CC',\n\t'#6633FF',\n\t'#66CC00',\n\t'#66CC33',\n\t'#9900CC',\n\t'#9900FF',\n\t'#9933CC',\n\t'#9933FF',\n\t'#99CC00',\n\t'#99CC33',\n\t'#CC0000',\n\t'#CC0033',\n\t'#CC0066',\n\t'#CC0099',\n\t'#CC00CC',\n\t'#CC00FF',\n\t'#CC3300',\n\t'#CC3333',\n\t'#CC3366',\n\t'#CC3399',\n\t'#CC33CC',\n\t'#CC33FF',\n\t'#CC6600',\n\t'#CC6633',\n\t'#CC9900',\n\t'#CC9933',\n\t'#CCCC00',\n\t'#CCCC33',\n\t'#FF0000',\n\t'#FF0033',\n\t'#FF0066',\n\t'#FF0099',\n\t'#FF00CC',\n\t'#FF00FF',\n\t'#FF3300',\n\t'#FF3333',\n\t'#FF3366',\n\t'#FF3399',\n\t'#FF33CC',\n\t'#FF33FF',\n\t'#FF6600',\n\t'#FF6633',\n\t'#FF9900',\n\t'#FF9933',\n\t'#FFCC00',\n\t'#FFCC33'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\n// eslint-disable-next-line complexity\nfunction useColors() {\n\t// NB: In an Electron preload script, document will be defined but not fully\n\t// initialized. Since we know we're in Chrome, we'll just detect this case\n\t// explicitly\n\tif (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {\n\t\treturn true;\n\t}\n\n\t// Internet Explorer and Edge do not support colors.\n\tif (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n\t\treturn false;\n\t}\n\n\tlet m;\n\n\t// Is webkit? http://stackoverflow.com/a/16459606/376773\n\t// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\t// eslint-disable-next-line no-return-assign\n\treturn (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n\t\t// Is firebug? http://stackoverflow.com/a/398120/376773\n\t\t(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n\t\t// Is firefox >= v31?\n\t\t// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/)) && parseInt(m[1], 10) >= 31) ||\n\t\t// Double check webkit in userAgent just in case we are in a worker\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\targs[0] = (this.useColors ? '%c' : '') +\n\t\tthis.namespace +\n\t\t(this.useColors ? ' %c' : ' ') +\n\t\targs[0] +\n\t\t(this.useColors ? '%c ' : ' ') +\n\t\t'+' + module.exports.humanize(this.diff);\n\n\tif (!this.useColors) {\n\t\treturn;\n\t}\n\n\tconst c = 'color: ' + this.color;\n\targs.splice(1, 0, c, 'color: inherit');\n\n\t// The final \"%c\" is somewhat tricky, because there could be other\n\t// arguments passed either before or after the %c, so we need to\n\t// figure out the correct index to insert the CSS into\n\tlet index = 0;\n\tlet lastC = 0;\n\targs[0].replace(/%[a-zA-Z%]/g, match => {\n\t\tif (match === '%%') {\n\t\t\treturn;\n\t\t}\n\t\tindex++;\n\t\tif (match === '%c') {\n\t\t\t// We only are interested in the *last* %c\n\t\t\t// (the user may have provided their own)\n\t\t\tlastC = index;\n\t\t}\n\t});\n\n\targs.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.debug()` when available.\n * No-op when `console.debug` is not a \"function\".\n * If `console.debug` is not available, falls back\n * to `console.log`.\n *\n * @api public\n */\nexports.log = console.debug || console.log || (() => {});\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\ttry {\n\t\tif (namespaces) {\n\t\t\texports.storage.setItem('debug', namespaces);\n\t\t} else {\n\t\t\texports.storage.removeItem('debug');\n\t\t}\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\nfunction load() {\n\tlet r;\n\ttry {\n\t\tr = exports.storage.getItem('debug') || exports.storage.getItem('DEBUG') ;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n\n\t// If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\tif (!r && typeof process !== 'undefined' && 'env' in process) {\n\t\tr = process.env.DEBUG;\n\t}\n\n\treturn r;\n}\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n\ttry {\n\t\t// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context\n\t\t// The Browser also has localStorage in the global context.\n\t\treturn localStorage;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nformatters.j = function (v) {\n\ttry {\n\t\treturn JSON.stringify(v);\n\t} catch (error) {\n\t\treturn '[UnexpectedJSONParseError]: ' + error.message;\n\t}\n};\n","let fn: typeof fetch;\nexport const fetch = async function fetch(\n ...args: Parameters<typeof window.fetch>\n): ReturnType<typeof window.fetch> {\n if (!fn) {\n if (typeof window !== 'undefined' && typeof document !== 'undefined') {\n fn = window.fetch.bind(window);\n } else {\n const fr = await import('fetch-retry');\n const fetchWithRetry = fr.default(globalThis.fetch);\n fn = fetchWithRetry;\n }\n }\n return fn.apply(null, args);\n};\n","import { fetch } from './fetch';\n\nexport async function importHttpRuntime<TModule = any>(runtime: string): Promise<TModule> {\n // if browser, use dynamic import\n if (typeof window !== 'undefined' && typeof document !== 'undefined') {\n const module = await import(/* @vite-ignore */ runtime);\n return module as TModule;\n } else {\n const { nodeImportHttpRuntime } = await import('./ImportHttpRuntime.node');\n return nodeImportHttpRuntime<TModule>(runtime, { fetchImpl: fetch });\n }\n}\n","// resolveHttpRefToString.ts\n// Follows $ref chains until finding a value without $ref.\n//\n// Rules:\n// - If value is an object with {$ref: string} -> follow it (fetch if http/https URL)\n// - Otherwise -> return the value as-is\n//\n// Browser: tries `import(url, { with: { type: 'json' } })` first, falls back to fetch.\n// Node: uses fetch (Node 18+ has global fetch).\n\nimport debug from 'debug';\nimport { fetch } from './fetch';\n\nconst log = debug('efp:loader:resolve');\n\nexport type ResolveOptions = {\n maxHops?: number;\n signal?: AbortSignal;\n // Hook if you want to observe each hop (debug/log/preload metrics)\n onHop?: (info: { hop: number; ref: string; via: 'import' | 'fetch' }) => void;\n fetchCallback?: (ref: string) => void;\n};\n\nexport async function resolve<T>(input: unknown, options: ResolveOptions = {}): Promise<T> {\n const maxHops = options.maxHops ?? 32;\n const seen = new Set<string>();\n\n let cur: unknown = input;\n\n for (let hop = 0; hop < maxHops; hop++) {\n // If it's an object with $ref, follow it\n if (cur && typeof cur === 'object' && '$ref' in cur) {\n const obj = cur as any;\n const ref = obj.$ref;\n\n if (typeof ref !== 'string') {\n throw new Error(`$ref must be a string, got: ${typeof ref}`);\n }\n\n // If it's an http/https URL, fetch it\n if (isHttpUrl(ref)) {\n if (seen.has(ref)) {\n throw new Error(`Circular $ref detected at: ${ref}`);\n }\n seen.add(ref);\n log('Loading JSON ref:', ref);\n options.fetchCallback?.(ref);\n const json = await loadJson(ref, options.signal);\n options.onHop?.({ hop, ref, via: json.__via });\n cur = json.value;\n continue;\n }\n\n // Non-http $ref (e.g., relative, custom schema) - return the object as-is\n // (caller is responsible for handling these)\n return cur as T;\n }\n\n // No $ref found - return current value\n return cur as T;\n }\n\n throw new Error(`Too many ref hops (>${maxHops}). Possible loop or unexpectedly deep chain.`);\n}\n\nfunction isHttpUrl(s: string): boolean {\n return s.startsWith('http://') || s.startsWith('https://');\n}\n\nasync function loadJson(\n url: string,\n signal?: AbortSignal\n): Promise<{ value: unknown; __via: 'import' | 'fetch' }> {\n // Try import() JSON first (browser-friendly; depends on runtime/bundler support + CORS)\n const imported = await tryImportJson(url);\n if (imported.ok) return { value: imported.value, __via: 'import' };\n\n // Fallback to fetch\n const res = await fetch(url, {\n method: 'GET',\n signal,\n headers: {\n // Helps some CDNs/content negotiation setups\n Accept: 'application/json, text/plain;q=0.9, */*;q=0.1',\n },\n });\n\n if (!res.ok) {\n throw new Error(`Failed to fetch JSON ref: ${url} (${res.status} ${res.statusText})`);\n }\n\n // Prefer JSON; if server mislabels, fallback to text->JSON parse.\n const ct = res.headers.get('content-type') || '';\n if (ct.includes('application/json') || ct.includes('+json')) {\n return { value: await res.json(), __via: 'fetch' };\n }\n\n const text = await res.text();\n try {\n return { value: JSON.parse(text), __via: 'fetch' };\n } catch {\n // If the endpoint literally returns a plain string (not JSON), accept it.\n return { value: text, __via: 'fetch' };\n }\n}\n\nasync function tryImportJson(\n url: string\n): Promise<{ ok: true; value: unknown } | { ok: false; error: unknown }> {\n // `with: { type: 'json' }` is the modern import assertion form.\n // Some environments still only accept `assert: { type: 'json' }`.\n try {\n //// @ts-expect-error - TS lib definitions differ across versions\n const mod = await import(/* @vite-ignore */ url, { with: { type: 'json' } });\n log('Imported JSON via import():', url);\n return { ok: true, value: mod?.default ?? mod };\n } catch (e1) {\n try {\n //// @ts-expect-error - fallback for older assertion syntax\n const mod = await import(/* @vite-ignore */ url, { assert: { type: 'json' } });\n return { ok: true, value: mod?.default ?? mod };\n } catch (e2) {\n return { ok: false, error: e2 ?? e1 };\n }\n }\n}\n","import debug from 'debug';\nimport { importHttpRuntime } from './importHttpRuntime';\nimport { resolve } from './resolve';\nimport type { LoaderApi, Manifest, Ref } from './types';\n\nconst log = debug('efp:loader');\n\ndeclare global {\n const __efpLoaderBuildInfo: [version: string, builtAt: string] | undefined;\n}\n\nif (typeof __efpLoaderBuildInfo !== 'undefined') {\n log('Initialized', { version: __efpLoaderBuildInfo[0], builtAt: __efpLoaderBuildInfo[1] });\n} else {\n log('Initialized');\n}\n\nexport async function loadApi(\n /**\n * \"url\" or { $ref: \"url\" }, or { runtimeUrl: \"url\" | { $ref: \"url\" } }\n */\n runtimeUrlOrManifest: string | Ref | Manifest,\n options?: {\n fetchCallback?: (ref: string) => void;\n }\n): Promise<LoaderApi> {\n let resolvedRoot = await resolve<string>(runtimeUrlOrManifest, { fetchCallback: options?.fetchCallback, });\n let runtimeUrl: string | undefined = undefined;\n if (typeof resolvedRoot === 'string') {\n runtimeUrl = resolvedRoot;\n } else if (typeof resolvedRoot === 'object' && 'runtimeUrl' in resolvedRoot) {\n const manifest = resolvedRoot as Manifest;\n runtimeUrl = await resolve<string>(manifest.runtimeUrl, { fetchCallback: options?.fetchCallback });\n }\n\n if (runtimeUrl === undefined) {\n throw new Error(\n 'Could not determine runtime URL. It must be resolvable to a string or to a manifest with a runtimeUrl property.'\n );\n }\n\n log('Loading runtime:', runtimeUrl);\n // if (typeof manifest === 'string') {\n // manifest = { $ref: manifest };\n // }\n // manifest = await resolve<Manifest>(manifest, { fetchCallback: options?.fetchCallback });\n // const runtime = await resolve<string>(manifest.runtime, {\n // fetchCallback: options?.fetchCallback,\n // });\n\n // log('Resolved runtime URL:', runtime);\n if (typeof runtimeUrl !== 'string') {\n throw new Error('Runtime URL must be a string');\n }\n\n const api = await importHttpRuntime(runtimeUrl);\n api.meta = { runtimeUrl };\n return api; //{ ...api, runtime } as LoaderApi;\n}\n\n// allow calling api functions directly from here\nconst api: LoaderApi = new Proxy(\n {},\n {\n get: (_, prop: string) => {\n return async (...args: any[]) => {\n const param0 = args[0];\n if (param0 == null || typeof param0 !== 'object') {\n throw new Error(`First argument must be a manifest object, got: ${typeof param0}`);\n }\n // const manifest = await resolve<Manifest>(param0);\n // const runtimeUrl = await resolve<string>(manifest.runtimeUrl);\n // if (typeof runtimeUrl !== 'string') {\n // throw new Error('Resolved runtime URL must be a string');\n // }\n\n const runtimeApi = await loadApi(param0);\n const fn = runtimeApi[prop];\n if (typeof fn !== 'function') {\n throw new Error(`API has no function named '${prop}'`);\n }\n return fn.apply(runtimeApi, args as any);\n };\n },\n }\n);\n\nexport async function load(manifest: Manifest | Ref, ...args: unknown[]) {\n return api.load!(manifest, ...args);\n}\n\n// export { resolve } from './resolve';\n\nexport default api;\n"],"names":["hasRequiredMs","m","h","d","w","ms","val","options","type","parse","fmtLong","fmtShort","str","match","y","msAbs","plural","name","isPlural","hasRequiredCommon","setup","env","createDebug","coerce","disable","enable","enabled","requireMs","key","selectColor","namespace","i","hash","prevTime","enableOverride","namespacesCache","debug","args","curr","self","index","format","formatter","enabledCache","v","delimiter","newDebug","namespaces","split","ns","matchesTemplate","search","template","searchIndex","templateIndex","starIndex","matchIndex","skip","destroy","module","exports","formatArgs","save","load","localstorage","warned","useColors","c","lastC","r","formatters","error","fn","fetch","n","importHttpRuntime","runtime","nodeImportHttpRuntime","log$1","resolve","maxHops","_a","seen","cur","input","hop","ref","log","_b","json","loadJson","_c","isHttpUrl","signal","imported","url","res","ct","text","tryImportJson","mod","e1","e2","__efpLoaderBuildInfo","loadApi","runtimeUrlOrManifest","resolvedRoot","runtimeUrl","api","api2","_","prop","param0","runtimeApi","manifest"],"mappings":";;;;;;;AAIA,EAAAA,IAAY;AACZ,MAAI,IAAI,KACJC,IAAI,IAAI,IACRC,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,gBAAcA;AACZ,UAAA2E,KAAU,QAAM,OAAAA,KAAA;AAClB,cAAA,IAAA,MAAA,kDAAA,OAAAA,CAAA,EAAA;AAQA,YAAMC,IAAK,QAAeD,CAAA,GACtBxC,IAAOyC;AACT,UAAA,OAAMzC,KAAU;AAClB,cAAA,IAAA,MAAA,8BAAAuC,CAAA,GAAA;AAEF,aAAAvC,EAAA,MAAAyC,GAAA5E,CAAA;AAAA,IACF;AAAA,EAEJ;AAEA;AACE,eAAW0B,EAAMmD,MAAa7E,GAAI;AACpC,SAAAuE,EAAA,KAAAM,GAAA,GAAA7E,CAAA;;","x_google_ignoreList":[0,1,2]}
1
+ {"version":3,"file":"bundle.js","sources":["../../node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js","../../node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/common.js","../../node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/browser.js","../../src/fetch.ts","../../src/importHttpRuntime.ts","../../src/resolve.ts","../../src/index.ts"],"sourcesContent":["/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar w = d * 7;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function (val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isFinite(val)) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^(-?(?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'weeks':\n case 'week':\n case 'w':\n return n * w;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (msAbs >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (msAbs >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (msAbs >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return plural(ms, msAbs, d, 'day');\n }\n if (msAbs >= h) {\n return plural(ms, msAbs, h, 'hour');\n }\n if (msAbs >= m) {\n return plural(ms, msAbs, m, 'minute');\n }\n if (msAbs >= s) {\n return plural(ms, msAbs, s, 'second');\n }\n return ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, msAbs, n, name) {\n var isPlural = msAbs >= n * 1.5;\n return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');\n}\n","\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n */\n\nfunction setup(env) {\n\tcreateDebug.debug = createDebug;\n\tcreateDebug.default = createDebug;\n\tcreateDebug.coerce = coerce;\n\tcreateDebug.disable = disable;\n\tcreateDebug.enable = enable;\n\tcreateDebug.enabled = enabled;\n\tcreateDebug.humanize = require('ms');\n\tcreateDebug.destroy = destroy;\n\n\tObject.keys(env).forEach(key => {\n\t\tcreateDebug[key] = env[key];\n\t});\n\n\t/**\n\t* The currently active debug mode names, and names to skip.\n\t*/\n\n\tcreateDebug.names = [];\n\tcreateDebug.skips = [];\n\n\t/**\n\t* Map of special \"%n\" handling functions, for the debug \"format\" argument.\n\t*\n\t* Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n\t*/\n\tcreateDebug.formatters = {};\n\n\t/**\n\t* Selects a color for a debug namespace\n\t* @param {String} namespace The namespace string for the debug instance to be colored\n\t* @return {Number|String} An ANSI color code for the given namespace\n\t* @api private\n\t*/\n\tfunction selectColor(namespace) {\n\t\tlet hash = 0;\n\n\t\tfor (let i = 0; i < namespace.length; i++) {\n\t\t\thash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n\t\t\thash |= 0; // Convert to 32bit integer\n\t\t}\n\n\t\treturn createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n\t}\n\tcreateDebug.selectColor = selectColor;\n\n\t/**\n\t* Create a debugger with the given `namespace`.\n\t*\n\t* @param {String} namespace\n\t* @return {Function}\n\t* @api public\n\t*/\n\tfunction createDebug(namespace) {\n\t\tlet prevTime;\n\t\tlet enableOverride = null;\n\t\tlet namespacesCache;\n\t\tlet enabledCache;\n\n\t\tfunction debug(...args) {\n\t\t\t// Disabled?\n\t\t\tif (!debug.enabled) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst self = debug;\n\n\t\t\t// Set `diff` timestamp\n\t\t\tconst curr = Number(new Date());\n\t\t\tconst ms = curr - (prevTime || curr);\n\t\t\tself.diff = ms;\n\t\t\tself.prev = prevTime;\n\t\t\tself.curr = curr;\n\t\t\tprevTime = curr;\n\n\t\t\targs[0] = createDebug.coerce(args[0]);\n\n\t\t\tif (typeof args[0] !== 'string') {\n\t\t\t\t// Anything else let's inspect with %O\n\t\t\t\targs.unshift('%O');\n\t\t\t}\n\n\t\t\t// Apply any `formatters` transformations\n\t\t\tlet index = 0;\n\t\t\targs[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {\n\t\t\t\t// If we encounter an escaped % then don't increase the array index\n\t\t\t\tif (match === '%%') {\n\t\t\t\t\treturn '%';\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t\tconst formatter = createDebug.formatters[format];\n\t\t\t\tif (typeof formatter === 'function') {\n\t\t\t\t\tconst val = args[index];\n\t\t\t\t\tmatch = formatter.call(self, val);\n\n\t\t\t\t\t// Now we need to remove `args[index]` since it's inlined in the `format`\n\t\t\t\t\targs.splice(index, 1);\n\t\t\t\t\tindex--;\n\t\t\t\t}\n\t\t\t\treturn match;\n\t\t\t});\n\n\t\t\t// Apply env-specific formatting (colors, etc.)\n\t\t\tcreateDebug.formatArgs.call(self, args);\n\n\t\t\tconst logFn = self.log || createDebug.log;\n\t\t\tlogFn.apply(self, args);\n\t\t}\n\n\t\tdebug.namespace = namespace;\n\t\tdebug.useColors = createDebug.useColors();\n\t\tdebug.color = createDebug.selectColor(namespace);\n\t\tdebug.extend = extend;\n\t\tdebug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.\n\n\t\tObject.defineProperty(debug, 'enabled', {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: false,\n\t\t\tget: () => {\n\t\t\t\tif (enableOverride !== null) {\n\t\t\t\t\treturn enableOverride;\n\t\t\t\t}\n\t\t\t\tif (namespacesCache !== createDebug.namespaces) {\n\t\t\t\t\tnamespacesCache = createDebug.namespaces;\n\t\t\t\t\tenabledCache = createDebug.enabled(namespace);\n\t\t\t\t}\n\n\t\t\t\treturn enabledCache;\n\t\t\t},\n\t\t\tset: v => {\n\t\t\t\tenableOverride = v;\n\t\t\t}\n\t\t});\n\n\t\t// Env-specific initialization logic for debug instances\n\t\tif (typeof createDebug.init === 'function') {\n\t\t\tcreateDebug.init(debug);\n\t\t}\n\n\t\treturn debug;\n\t}\n\n\tfunction extend(namespace, delimiter) {\n\t\tconst newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n\t\tnewDebug.log = this.log;\n\t\treturn newDebug;\n\t}\n\n\t/**\n\t* Enables a debug mode by namespaces. This can include modes\n\t* separated by a colon and wildcards.\n\t*\n\t* @param {String} namespaces\n\t* @api public\n\t*/\n\tfunction enable(namespaces) {\n\t\tcreateDebug.save(namespaces);\n\t\tcreateDebug.namespaces = namespaces;\n\n\t\tcreateDebug.names = [];\n\t\tcreateDebug.skips = [];\n\n\t\tconst split = (typeof namespaces === 'string' ? namespaces : '')\n\t\t\t.trim()\n\t\t\t.replace(/\\s+/g, ',')\n\t\t\t.split(',')\n\t\t\t.filter(Boolean);\n\n\t\tfor (const ns of split) {\n\t\t\tif (ns[0] === '-') {\n\t\t\t\tcreateDebug.skips.push(ns.slice(1));\n\t\t\t} else {\n\t\t\t\tcreateDebug.names.push(ns);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Checks if the given string matches a namespace template, honoring\n\t * asterisks as wildcards.\n\t *\n\t * @param {String} search\n\t * @param {String} template\n\t * @return {Boolean}\n\t */\n\tfunction matchesTemplate(search, template) {\n\t\tlet searchIndex = 0;\n\t\tlet templateIndex = 0;\n\t\tlet starIndex = -1;\n\t\tlet matchIndex = 0;\n\n\t\twhile (searchIndex < search.length) {\n\t\t\tif (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === '*')) {\n\t\t\t\t// Match character or proceed with wildcard\n\t\t\t\tif (template[templateIndex] === '*') {\n\t\t\t\t\tstarIndex = templateIndex;\n\t\t\t\t\tmatchIndex = searchIndex;\n\t\t\t\t\ttemplateIndex++; // Skip the '*'\n\t\t\t\t} else {\n\t\t\t\t\tsearchIndex++;\n\t\t\t\t\ttemplateIndex++;\n\t\t\t\t}\n\t\t\t} else if (starIndex !== -1) { // eslint-disable-line no-negated-condition\n\t\t\t\t// Backtrack to the last '*' and try to match more characters\n\t\t\t\ttemplateIndex = starIndex + 1;\n\t\t\t\tmatchIndex++;\n\t\t\t\tsearchIndex = matchIndex;\n\t\t\t} else {\n\t\t\t\treturn false; // No match\n\t\t\t}\n\t\t}\n\n\t\t// Handle trailing '*' in template\n\t\twhile (templateIndex < template.length && template[templateIndex] === '*') {\n\t\t\ttemplateIndex++;\n\t\t}\n\n\t\treturn templateIndex === template.length;\n\t}\n\n\t/**\n\t* Disable debug output.\n\t*\n\t* @return {String} namespaces\n\t* @api public\n\t*/\n\tfunction disable() {\n\t\tconst namespaces = [\n\t\t\t...createDebug.names,\n\t\t\t...createDebug.skips.map(namespace => '-' + namespace)\n\t\t].join(',');\n\t\tcreateDebug.enable('');\n\t\treturn namespaces;\n\t}\n\n\t/**\n\t* Returns true if the given mode name is enabled, false otherwise.\n\t*\n\t* @param {String} name\n\t* @return {Boolean}\n\t* @api public\n\t*/\n\tfunction enabled(name) {\n\t\tfor (const skip of createDebug.skips) {\n\t\t\tif (matchesTemplate(name, skip)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tfor (const ns of createDebug.names) {\n\t\t\tif (matchesTemplate(name, ns)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t* Coerce `val`.\n\t*\n\t* @param {Mixed} val\n\t* @return {Mixed}\n\t* @api private\n\t*/\n\tfunction coerce(val) {\n\t\tif (val instanceof Error) {\n\t\t\treturn val.stack || val.message;\n\t\t}\n\t\treturn val;\n\t}\n\n\t/**\n\t* XXX DO NOT USE. This is a temporary stub function.\n\t* XXX It WILL be removed in the next major release.\n\t*/\n\tfunction destroy() {\n\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t}\n\n\tcreateDebug.enable(createDebug.load());\n\n\treturn createDebug;\n}\n\nmodule.exports = setup;\n","/* eslint-env browser */\n\n/**\n * This is the web browser implementation of `debug()`.\n */\n\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = localstorage();\nexports.destroy = (() => {\n\tlet warned = false;\n\n\treturn () => {\n\t\tif (!warned) {\n\t\t\twarned = true;\n\t\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t\t}\n\t};\n})();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n\t'#0000CC',\n\t'#0000FF',\n\t'#0033CC',\n\t'#0033FF',\n\t'#0066CC',\n\t'#0066FF',\n\t'#0099CC',\n\t'#0099FF',\n\t'#00CC00',\n\t'#00CC33',\n\t'#00CC66',\n\t'#00CC99',\n\t'#00CCCC',\n\t'#00CCFF',\n\t'#3300CC',\n\t'#3300FF',\n\t'#3333CC',\n\t'#3333FF',\n\t'#3366CC',\n\t'#3366FF',\n\t'#3399CC',\n\t'#3399FF',\n\t'#33CC00',\n\t'#33CC33',\n\t'#33CC66',\n\t'#33CC99',\n\t'#33CCCC',\n\t'#33CCFF',\n\t'#6600CC',\n\t'#6600FF',\n\t'#6633CC',\n\t'#6633FF',\n\t'#66CC00',\n\t'#66CC33',\n\t'#9900CC',\n\t'#9900FF',\n\t'#9933CC',\n\t'#9933FF',\n\t'#99CC00',\n\t'#99CC33',\n\t'#CC0000',\n\t'#CC0033',\n\t'#CC0066',\n\t'#CC0099',\n\t'#CC00CC',\n\t'#CC00FF',\n\t'#CC3300',\n\t'#CC3333',\n\t'#CC3366',\n\t'#CC3399',\n\t'#CC33CC',\n\t'#CC33FF',\n\t'#CC6600',\n\t'#CC6633',\n\t'#CC9900',\n\t'#CC9933',\n\t'#CCCC00',\n\t'#CCCC33',\n\t'#FF0000',\n\t'#FF0033',\n\t'#FF0066',\n\t'#FF0099',\n\t'#FF00CC',\n\t'#FF00FF',\n\t'#FF3300',\n\t'#FF3333',\n\t'#FF3366',\n\t'#FF3399',\n\t'#FF33CC',\n\t'#FF33FF',\n\t'#FF6600',\n\t'#FF6633',\n\t'#FF9900',\n\t'#FF9933',\n\t'#FFCC00',\n\t'#FFCC33'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\n// eslint-disable-next-line complexity\nfunction useColors() {\n\t// NB: In an Electron preload script, document will be defined but not fully\n\t// initialized. Since we know we're in Chrome, we'll just detect this case\n\t// explicitly\n\tif (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {\n\t\treturn true;\n\t}\n\n\t// Internet Explorer and Edge do not support colors.\n\tif (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n\t\treturn false;\n\t}\n\n\tlet m;\n\n\t// Is webkit? http://stackoverflow.com/a/16459606/376773\n\t// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\t// eslint-disable-next-line no-return-assign\n\treturn (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n\t\t// Is firebug? http://stackoverflow.com/a/398120/376773\n\t\t(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n\t\t// Is firefox >= v31?\n\t\t// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/)) && parseInt(m[1], 10) >= 31) ||\n\t\t// Double check webkit in userAgent just in case we are in a worker\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\targs[0] = (this.useColors ? '%c' : '') +\n\t\tthis.namespace +\n\t\t(this.useColors ? ' %c' : ' ') +\n\t\targs[0] +\n\t\t(this.useColors ? '%c ' : ' ') +\n\t\t'+' + module.exports.humanize(this.diff);\n\n\tif (!this.useColors) {\n\t\treturn;\n\t}\n\n\tconst c = 'color: ' + this.color;\n\targs.splice(1, 0, c, 'color: inherit');\n\n\t// The final \"%c\" is somewhat tricky, because there could be other\n\t// arguments passed either before or after the %c, so we need to\n\t// figure out the correct index to insert the CSS into\n\tlet index = 0;\n\tlet lastC = 0;\n\targs[0].replace(/%[a-zA-Z%]/g, match => {\n\t\tif (match === '%%') {\n\t\t\treturn;\n\t\t}\n\t\tindex++;\n\t\tif (match === '%c') {\n\t\t\t// We only are interested in the *last* %c\n\t\t\t// (the user may have provided their own)\n\t\t\tlastC = index;\n\t\t}\n\t});\n\n\targs.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.debug()` when available.\n * No-op when `console.debug` is not a \"function\".\n * If `console.debug` is not available, falls back\n * to `console.log`.\n *\n * @api public\n */\nexports.log = console.debug || console.log || (() => {});\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\ttry {\n\t\tif (namespaces) {\n\t\t\texports.storage.setItem('debug', namespaces);\n\t\t} else {\n\t\t\texports.storage.removeItem('debug');\n\t\t}\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\nfunction load() {\n\tlet r;\n\ttry {\n\t\tr = exports.storage.getItem('debug') || exports.storage.getItem('DEBUG') ;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n\n\t// If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\tif (!r && typeof process !== 'undefined' && 'env' in process) {\n\t\tr = process.env.DEBUG;\n\t}\n\n\treturn r;\n}\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n\ttry {\n\t\t// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context\n\t\t// The Browser also has localStorage in the global context.\n\t\treturn localStorage;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nformatters.j = function (v) {\n\ttry {\n\t\treturn JSON.stringify(v);\n\t} catch (error) {\n\t\treturn '[UnexpectedJSONParseError]: ' + error.message;\n\t}\n};\n","let fn: typeof fetch;\nexport const fetch = async function fetch(\n ...args: Parameters<typeof window.fetch>\n): ReturnType<typeof window.fetch> {\n if (!fn) {\n if (typeof window !== 'undefined' && typeof document !== 'undefined') {\n fn = window.fetch.bind(window);\n } else {\n const fr = await import('fetch-retry');\n const fetchWithRetry = fr.default(globalThis.fetch);\n fn = fetchWithRetry;\n }\n }\n return fn.apply(null, args);\n};\n","import { fetch } from './fetch.js';\n\nexport async function importHttpRuntime<TModule = any>(runtime: string): Promise<TModule> {\n // if browser, use dynamic import\n if (typeof window !== 'undefined' && typeof document !== 'undefined') {\n const module = await import(/* @vite-ignore */ runtime);\n return module as TModule;\n } else {\n const { nodeImportHttpRuntime } = await import('./ImportHttpRuntime.node.js');\n return nodeImportHttpRuntime<TModule>(runtime, { fetchImpl: fetch });\n }\n}\n","// resolveHttpRefToString.ts\n// Follows $ref chains until finding a value without $ref.\n//\n// Rules:\n// - If value is an object with {$ref: string} -> follow it (fetch if http/https URL)\n// - Otherwise -> return the value as-is\n//\n// Browser: tries `import(url, { with: { type: 'json' } })` first, falls back to fetch.\n// Node: uses fetch (Node 18+ has global fetch).\n\nimport debug from 'debug';\nimport { fetch } from './fetch.js';\n\nconst log = debug('efp:loader:resolve');\n\nexport type ResolveOptions = {\n maxHops?: number;\n signal?: AbortSignal;\n // Hook if you want to observe each hop (debug/log/preload metrics)\n onHop?: (info: { hop: number; ref: string; via: 'import' | 'fetch' }) => void;\n fetchCallback?: (ref: string) => void;\n};\n\nexport async function resolve<T>(input: unknown, options: ResolveOptions = {}): Promise<T> {\n const maxHops = options.maxHops ?? 32;\n const seen = new Set<string>();\n\n let cur: unknown = input;\n\n for (let hop = 0; hop < maxHops; hop++) {\n // If it's an object with $ref, follow it\n if (cur && typeof cur === 'object' && '$ref' in cur) {\n const obj = cur as any;\n const ref = obj.$ref;\n\n if (typeof ref !== 'string') {\n throw new Error(`$ref must be a string, got: ${typeof ref}`);\n }\n\n // If it's an http/https URL, fetch it\n if (isHttpUrl(ref)) {\n if (seen.has(ref)) {\n throw new Error(`Circular $ref detected at: ${ref}`);\n }\n seen.add(ref);\n log('Loading JSON ref:', ref);\n options.fetchCallback?.(ref);\n const json = await loadJson(ref, options.signal);\n options.onHop?.({ hop, ref, via: json.__via });\n cur = json.value;\n continue;\n }\n\n // Non-http $ref (e.g., relative, custom schema) - return the object as-is\n // (caller is responsible for handling these)\n return cur as T;\n }\n\n // No $ref found - return current value\n return cur as T;\n }\n\n throw new Error(`Too many ref hops (>${maxHops}). Possible loop or unexpectedly deep chain.`);\n}\n\nfunction isHttpUrl(s: string): boolean {\n return s.startsWith('http://') || s.startsWith('https://');\n}\n\nasync function loadJson(\n url: string,\n signal?: AbortSignal\n): Promise<{ value: unknown; __via: 'import' | 'fetch' }> {\n // Try import() JSON first (browser-friendly; depends on runtime/bundler support + CORS)\n const imported = await tryImportJson(url);\n if (imported.ok) return { value: imported.value, __via: 'import' };\n\n // Fallback to fetch\n const res = await fetch(url, {\n method: 'GET',\n signal,\n headers: {\n // Helps some CDNs/content negotiation setups\n Accept: 'application/json, text/plain;q=0.9, */*;q=0.1',\n },\n });\n\n if (!res.ok) {\n throw new Error(`Failed to fetch JSON ref: ${url} (${res.status} ${res.statusText})`);\n }\n\n // Prefer JSON; if server mislabels, fallback to text->JSON parse.\n const ct = res.headers.get('content-type') || '';\n if (ct.includes('application/json') || ct.includes('+json')) {\n return { value: await res.json(), __via: 'fetch' };\n }\n\n const text = await res.text();\n try {\n return { value: JSON.parse(text), __via: 'fetch' };\n } catch {\n // If the endpoint literally returns a plain string (not JSON), accept it.\n return { value: text, __via: 'fetch' };\n }\n}\n\nasync function tryImportJson(\n url: string\n): Promise<{ ok: true; value: unknown } | { ok: false; error: unknown }> {\n // `with: { type: 'json' }` is the modern import assertion form.\n // Some environments still only accept `assert: { type: 'json' }`.\n try {\n //// @ts-expect-error - TS lib definitions differ across versions\n const mod = await import(/* @vite-ignore */ url, { with: { type: 'json' } });\n log('Imported JSON via import():', url);\n return { ok: true, value: mod?.default ?? mod };\n } catch (e1) {\n try {\n //// @ts-expect-error - fallback for older assertion syntax\n const mod = await import(/* @vite-ignore */ url, { assert: { type: 'json' } });\n return { ok: true, value: mod?.default ?? mod };\n } catch (e2) {\n return { ok: false, error: e2 ?? e1 };\n }\n }\n}\n","import debug from 'debug';\nimport { importHttpRuntime } from './importHttpRuntime.js';\nimport { resolve } from './resolve.js';\nimport type { LoaderApi, Manifest, Ref } from './types.js';\n\nconst log = debug('efp:loader');\n\ndeclare global {\n const __efpLoaderBuildInfo: [version: string, builtAt: string] | undefined;\n}\n\nif (typeof __efpLoaderBuildInfo !== 'undefined') {\n log('Initialized', { version: __efpLoaderBuildInfo[0], builtAt: __efpLoaderBuildInfo[1] });\n} else {\n log('Initialized');\n}\n\nexport async function loadApi(\n /**\n * \"url\" or { $ref: \"url\" }, or { runtimeUrl: \"url\" | { $ref: \"url\" } }\n */\n runtimeUrlOrManifest: string | Ref | Manifest,\n options?: {\n fetchCallback?: (ref: string) => void;\n }\n): Promise<LoaderApi> {\n let resolvedRoot = await resolve<string>(runtimeUrlOrManifest, {\n fetchCallback: options?.fetchCallback,\n });\n let runtimeUrl: string | undefined = undefined;\n if (typeof resolvedRoot === 'string') {\n runtimeUrl = resolvedRoot;\n } else if (typeof resolvedRoot === 'object' && 'runtimeUrl' in resolvedRoot) {\n const manifest = resolvedRoot as Manifest;\n runtimeUrl = await resolve<string>(manifest.runtimeUrl, {\n fetchCallback: options?.fetchCallback,\n });\n }\n\n if (runtimeUrl === undefined) {\n throw new Error(\n 'Could not determine runtime URL. It must be resolvable to a string or to a manifest with a runtimeUrl property.'\n );\n }\n\n log('Loading runtime:', runtimeUrl);\n // if (typeof manifest === 'string') {\n // manifest = { $ref: manifest };\n // }\n // manifest = await resolve<Manifest>(manifest, { fetchCallback: options?.fetchCallback });\n // const runtime = await resolve<string>(manifest.runtime, {\n // fetchCallback: options?.fetchCallback,\n // });\n\n // log('Resolved runtime URL:', runtime);\n if (typeof runtimeUrl !== 'string') {\n throw new Error('Runtime URL must be a string');\n }\n\n const api = { ...(await importHttpRuntime(runtimeUrl)), meta: { runtimeUrl } };\n return api; //{ ...api, runtime } as LoaderApi;\n}\n\n// allow calling api functions directly from here\nconst api: LoaderApi = new Proxy(\n {},\n {\n get: (_, prop: string) => {\n return async (...args: any[]) => {\n const param0 = args[0];\n if (param0 == null || typeof param0 !== 'object') {\n throw new Error(`First argument must be a manifest object, got: ${typeof param0}`);\n }\n // const manifest = await resolve<Manifest>(param0);\n // const runtimeUrl = await resolve<string>(manifest.runtimeUrl);\n // if (typeof runtimeUrl !== 'string') {\n // throw new Error('Resolved runtime URL must be a string');\n // }\n\n const runtimeApi = await loadApi(param0);\n const fn = runtimeApi[prop];\n if (typeof fn !== 'function') {\n throw new Error(`API has no function named '${prop}'`);\n }\n return fn.apply(runtimeApi, args as any);\n };\n },\n }\n);\n\nexport async function load(manifest: Manifest | Ref, ...args: unknown[]) {\n return api.load!(manifest, ...args);\n}\n\n// export { resolve } from './resolve';\n\nexport default api;\n"],"names":["hasRequiredMs","m","h","d","w","ms","val","options","type","parse","fmtLong","fmtShort","str","match","y","msAbs","plural","name","isPlural","hasRequiredCommon","setup","env","createDebug","coerce","disable","enable","enabled","requireMs","key","selectColor","namespace","i","hash","prevTime","enableOverride","namespacesCache","debug","args","curr","self","index","format","formatter","enabledCache","v","delimiter","newDebug","namespaces","split","ns","matchesTemplate","search","template","searchIndex","templateIndex","starIndex","matchIndex","skip","destroy","module","exports","formatArgs","save","load","localstorage","warned","useColors","c","lastC","r","formatters","error","fn","fetch","n","importHttpRuntime","runtime","nodeImportHttpRuntime","log$1","resolve","maxHops","_a","seen","cur","input","hop","ref","log","_b","json","loadJson","_c","isHttpUrl","signal","imported","url","res","ct","text","tryImportJson","mod","e1","e2","__efpLoaderBuildInfo","loadApi","resolvedRoot","runtimeUrlOrManifest","runtimeUrl","api","_","prop","param0","runtimeApi","manifest"],"mappings":";;;;;;;AAIA,EAAAA,IAAY;AACZ,MAAI,IAAI,KACJC,IAAI,IAAI,IACRC,IAAID,IAAI,IACRE,IAAID,IAAI,IACRE,IAAID,IAAI;AAiBZ,EAAAE,IAAE,SAAUC,GAAOC,GAAM;AACvB,IAAAA,IAAQA,KAAa,CAAA;AACrB,QAAIC,IAAI,OAAKF;AACf,QAAIE,MAAO,YAAUF,EAAA,SAAA;AAClB,aAAMG,EAAQH,CAAA;AACb,QAAOE,MAAQ,YAAe,SAAOF,CAAA;AACzC,aAAAC,EAAA,OAAAG,EAAAJ,CAAA,IAAAK,EAAAL,CAAA;AAEA,UAAI,IAAA;AAAA,MACJ,0DACG,KAAA,UAAAA,CAAA;AAAA,IACF;AAAA;AAWD,WAAQG,EAAOG,GAAI;QACjBA,IAAI,OAAIA,CAAM,GACZ,EAAAA,EAAA,SAAA;UAGAC,IAAA,mIAAA;AAAA,QACDD;AAAA,MACD;UACEC,GAGF;AAAA,YAAI,IAAI,WAAWA,EAAK,CAAA,CAAA,QACZA,EAAA,CAAA,KAAA,MAAA,YAAA;AACd,g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,EAAA,aAAA;AAWE,eAAIiB;AAA2D,MAC7DC,IAAe,MAAA1B,EAAS2B,GAAA;AAAA,IACzB,eAAAnG,KAAA,gBAAAA,EAAA;AAAA,EACD,CAAA,GACIoG;AAUF,MATA,OAAAF,KAAa,WACfE,IAAWF,IACH,OAAAA,KAAW,YAAA,gBAAAA,MACuCE,IACtD,MAAe5B,EADJ0B,EACa,YAAA;AAAA,IACzB,eAAAlG,KAAA,gBAAAA,EAAA;AAAA,EACH,CAAA,IAGEoG,MAAU;AAAA,UACR,IAAA;AAAA,MACF;AAAA,IACF;AAaE,MADFpB,EAAI,qBAAsB,GACxB,OAAMoB;AACR,UAAA,IAAA,MAAA,8BAAA;AAIF,SADSC,EAAAA,GAAAA,MAAAA,EAAAA,CAAAA,GAAAA,MAAAA,EAAAA,YAAAA,EAAAA,EAAAA;AAIT;AAA2B,MACxBA,IAAA,IAAA;AAAA,EACD,CAAA;AAAA,EAAA;AAAA,IAEI,KAAA,CAAAC,GAAOC,gBACUzE,MAAM;AACrB,gBAAcA;AACZ,UAAA0E,KAAU,QAAM,OAAAA,KAAA;AAClB,cAAA,IAAA,MAAA,kDAAA,OAAAA,CAAA,EAAA;AAQA,YAAMC,IAAK,QAAeD,CAAA,GACtBvC,IAAOwC;AACT,UAAA,OAAMxC,KAAU;AAClB,cAAA,IAAA,MAAA,8BAAAsC,CAAA,GAAA;AAEF,aAAAtC,EAAA,MAAAwC,GAAA3E,CAAA;AAAA,IACF;AAAA,EAEJ;AAEA;AACE,eAAW0B,EAAMkD,MAAa5E,GAAI;AACpC,SAAAuE,EAAA,KAAAK,GAAA,GAAA5E,CAAA;;","x_google_ignoreList":[0,1,2]}
@@ -1,4 +1,4 @@
1
- import { fetch } from './fetch';
1
+ import { fetch } from './fetch.js';
2
2
  export async function importHttpRuntime(runtime) {
3
3
  // if browser, use dynamic import
4
4
  if (typeof window !== 'undefined' && typeof document !== 'undefined') {
@@ -6,7 +6,7 @@ export async function importHttpRuntime(runtime) {
6
6
  return module;
7
7
  }
8
8
  else {
9
- const { nodeImportHttpRuntime } = await import('./ImportHttpRuntime.node');
9
+ const { nodeImportHttpRuntime } = await import('./ImportHttpRuntime.node.js');
10
10
  return nodeImportHttpRuntime(runtime, { fetchImpl: fetch });
11
11
  }
12
12
  }
@@ -1,4 +1,4 @@
1
- import type { LoaderApi, Manifest, Ref } from './types';
1
+ import type { LoaderApi, Manifest, Ref } from './types.js';
2
2
  declare global {
3
3
  const __efpLoaderBuildInfo: [version: string, builtAt: string] | undefined;
4
4
  }
package/dist/esm/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import debug from 'debug';
2
- import { importHttpRuntime } from './importHttpRuntime';
3
- import { resolve } from './resolve';
2
+ import { importHttpRuntime } from './importHttpRuntime.js';
3
+ import { resolve } from './resolve.js';
4
4
  const log = debug('efp:loader');
5
5
  if (typeof __efpLoaderBuildInfo !== 'undefined') {
6
6
  log('Initialized', { version: __efpLoaderBuildInfo[0], builtAt: __efpLoaderBuildInfo[1] });
@@ -13,14 +13,18 @@ export async function loadApi(
13
13
  * "url" or { $ref: "url" }, or { runtimeUrl: "url" | { $ref: "url" } }
14
14
  */
15
15
  runtimeUrlOrManifest, options) {
16
- let resolvedRoot = await resolve(runtimeUrlOrManifest, { fetchCallback: options?.fetchCallback, });
16
+ let resolvedRoot = await resolve(runtimeUrlOrManifest, {
17
+ fetchCallback: options?.fetchCallback,
18
+ });
17
19
  let runtimeUrl = undefined;
18
20
  if (typeof resolvedRoot === 'string') {
19
21
  runtimeUrl = resolvedRoot;
20
22
  }
21
23
  else if (typeof resolvedRoot === 'object' && 'runtimeUrl' in resolvedRoot) {
22
24
  const manifest = resolvedRoot;
23
- runtimeUrl = await resolve(manifest.runtimeUrl, { fetchCallback: options?.fetchCallback });
25
+ runtimeUrl = await resolve(manifest.runtimeUrl, {
26
+ fetchCallback: options?.fetchCallback,
27
+ });
24
28
  }
25
29
  if (runtimeUrl === undefined) {
26
30
  throw new Error('Could not determine runtime URL. It must be resolvable to a string or to a manifest with a runtimeUrl property.');
@@ -37,8 +41,7 @@ runtimeUrlOrManifest, options) {
37
41
  if (typeof runtimeUrl !== 'string') {
38
42
  throw new Error('Runtime URL must be a string');
39
43
  }
40
- const api = await importHttpRuntime(runtimeUrl);
41
- api.meta = { runtimeUrl };
44
+ const api = { ...(await importHttpRuntime(runtimeUrl)), meta: { runtimeUrl } };
42
45
  return api; //{ ...api, runtime } as LoaderApi;
43
46
  }
44
47
  // allow calling api functions directly from here
@@ -8,7 +8,7 @@
8
8
  // Browser: tries `import(url, { with: { type: 'json' } })` first, falls back to fetch.
9
9
  // Node: uses fetch (Node 18+ has global fetch).
10
10
  import debug from 'debug';
11
- import { fetch } from './fetch';
11
+ import { fetch } from './fetch.js';
12
12
  const log = debug('efp:loader:resolve');
13
13
  export async function resolve(input, options = {}) {
14
14
  const maxHops = options.maxHops ?? 32;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@expofp/loader",
3
- "version": "1.0.95",
3
+ "version": "1.0.98",
4
4
  "description": "ExpoFP JavaScript loader library",
5
5
  "license": "MIT",
6
6
  "homepage": "https://expofp.com",
@@ -1 +0,0 @@
1
- export declare function resolveRuntimeUrl(manifest: any): Promise<string>;
@@ -1,10 +0,0 @@
1
- // import $RefParser from '@apidevtools/json-schema-ref-parser';
2
- // import { log } from 'debug';
3
- import { resolve } from './resolve';
4
- export async function resolveRuntimeUrl(manifest) {
5
- manifest = await resolve(manifest);
6
- if (!manifest.runtime) {
7
- throw new Error('Manifest is missing runtime');
8
- }
9
- return await resolve(manifest.runtime);
10
- }