mirror of
https://github.com/open-webui/open-webui
synced 2024-11-29 07:21:01 +00:00
8 lines
69 KiB
Plaintext
8 lines
69 KiB
Plaintext
{
|
|
"version": 3,
|
|
"sources": ["../src/js/node_modules/stackframe/stackframe.js", "../src/js/node_modules/error-stack-parser/error-stack-parser.js", "../src/js/pyodide.umd.ts", "../src/js/compat.ts", "../src/js/environments.ts", "../src/js/nativefs.ts", "../src/js/module.ts", "../src/js/version.ts", "../src/js/pyodide.ts"],
|
|
"sourcesContent": ["(function(root, factory) {\n 'use strict';\n // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.\n\n /* istanbul ignore next */\n if (typeof define === 'function' && define.amd) {\n define('stackframe', [], factory);\n } else if (typeof exports === 'object') {\n module.exports = factory();\n } else {\n root.StackFrame = factory();\n }\n}(this, function() {\n 'use strict';\n function _isNumber(n) {\n return !isNaN(parseFloat(n)) && isFinite(n);\n }\n\n function _capitalize(str) {\n return str.charAt(0).toUpperCase() + str.substring(1);\n }\n\n function _getter(p) {\n return function() {\n return this[p];\n };\n }\n\n var booleanProps = ['isConstructor', 'isEval', 'isNative', 'isToplevel'];\n var numericProps = ['columnNumber', 'lineNumber'];\n var stringProps = ['fileName', 'functionName', 'source'];\n var arrayProps = ['args'];\n var objectProps = ['evalOrigin'];\n\n var props = booleanProps.concat(numericProps, stringProps, arrayProps, objectProps);\n\n function StackFrame(obj) {\n if (!obj) return;\n for (var i = 0; i < props.length; i++) {\n if (obj[props[i]] !== undefined) {\n this['set' + _capitalize(props[i])](obj[props[i]]);\n }\n }\n }\n\n StackFrame.prototype = {\n getArgs: function() {\n return this.args;\n },\n setArgs: function(v) {\n if (Object.prototype.toString.call(v) !== '[object Array]') {\n throw new TypeError('Args must be an Array');\n }\n this.args = v;\n },\n\n getEvalOrigin: function() {\n return this.evalOrigin;\n },\n setEvalOrigin: function(v) {\n if (v instanceof StackFrame) {\n this.evalOrigin = v;\n } else if (v instanceof Object) {\n this.evalOrigin = new StackFrame(v);\n } else {\n throw new TypeError('Eval Origin must be an Object or StackFrame');\n }\n },\n\n toString: function() {\n var fileName = this.getFileName() || '';\n var lineNumber = this.getLineNumber() || '';\n var columnNumber = this.getColumnNumber() || '';\n var functionName = this.getFunctionName() || '';\n if (this.getIsEval()) {\n if (fileName) {\n return '[eval] (' + fileName + ':' + lineNumber + ':' + columnNumber + ')';\n }\n return '[eval]:' + lineNumber + ':' + columnNumber;\n }\n if (functionName) {\n return functionName + ' (' + fileName + ':' + lineNumber + ':' + columnNumber + ')';\n }\n return fileName + ':' + lineNumber + ':' + columnNumber;\n }\n };\n\n StackFrame.fromString = function StackFrame$$fromString(str) {\n var argsStartIndex = str.indexOf('(');\n var argsEndIndex = str.lastIndexOf(')');\n\n var functionName = str.substring(0, argsStartIndex);\n var args = str.substring(argsStartIndex + 1, argsEndIndex).split(',');\n var locationString = str.substring(argsEndIndex + 1);\n\n if (locationString.indexOf('@') === 0) {\n var parts = /@(.+?)(?::(\\d+))?(?::(\\d+))?$/.exec(locationString, '');\n var fileName = parts[1];\n var lineNumber = parts[2];\n var columnNumber = parts[3];\n }\n\n return new StackFrame({\n functionName: functionName,\n args: args || undefined,\n fileName: fileName,\n lineNumber: lineNumber || undefined,\n columnNumber: columnNumber || undefined\n });\n };\n\n for (var i = 0; i < booleanProps.length; i++) {\n StackFrame.prototype['get' + _capitalize(booleanProps[i])] = _getter(booleanProps[i]);\n StackFrame.prototype['set' + _capitalize(booleanProps[i])] = (function(p) {\n return function(v) {\n this[p] = Boolean(v);\n };\n })(booleanProps[i]);\n }\n\n for (var j = 0; j < numericProps.length; j++) {\n StackFrame.prototype['get' + _capitalize(numericProps[j])] = _getter(numericProps[j]);\n StackFrame.prototype['set' + _capitalize(numericProps[j])] = (function(p) {\n return function(v) {\n if (!_isNumber(v)) {\n throw new TypeError(p + ' must be a Number');\n }\n this[p] = Number(v);\n };\n })(numericProps[j]);\n }\n\n for (var k = 0; k < stringProps.length; k++) {\n StackFrame.prototype['get' + _capitalize(stringProps[k])] = _getter(stringProps[k]);\n StackFrame.prototype['set' + _capitalize(stringProps[k])] = (function(p) {\n return function(v) {\n this[p] = String(v);\n };\n })(stringProps[k]);\n }\n\n return StackFrame;\n}));\n", "(function(root, factory) {\n 'use strict';\n // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.\n\n /* istanbul ignore next */\n if (typeof define === 'function' && define.amd) {\n define('error-stack-parser', ['stackframe'], factory);\n } else if (typeof exports === 'object') {\n module.exports = factory(require('stackframe'));\n } else {\n root.ErrorStackParser = factory(root.StackFrame);\n }\n}(this, function ErrorStackParser(StackFrame) {\n 'use strict';\n\n var FIREFOX_SAFARI_STACK_REGEXP = /(^|@)\\S+:\\d+/;\n var CHROME_IE_STACK_REGEXP = /^\\s*at .*(\\S+:\\d+|\\(native\\))/m;\n var SAFARI_NATIVE_CODE_REGEXP = /^(eval@)?(\\[native code])?$/;\n\n return {\n /**\n * Given an Error object, extract the most information from it.\n *\n * @param {Error} error object\n * @return {Array} of StackFrames\n */\n parse: function ErrorStackParser$$parse(error) {\n if (typeof error.stacktrace !== 'undefined' || typeof error['opera#sourceloc'] !== 'undefined') {\n return this.parseOpera(error);\n } else if (error.stack && error.stack.match(CHROME_IE_STACK_REGEXP)) {\n return this.parseV8OrIE(error);\n } else if (error.stack) {\n return this.parseFFOrSafari(error);\n } else {\n throw new Error('Cannot parse given Error object');\n }\n },\n\n // Separate line and column numbers from a string of the form: (URI:Line:Column)\n extractLocation: function ErrorStackParser$$extractLocation(urlLike) {\n // Fail-fast but return locations like \"(native)\"\n if (urlLike.indexOf(':') === -1) {\n return [urlLike];\n }\n\n var regExp = /(.+?)(?::(\\d+))?(?::(\\d+))?$/;\n var parts = regExp.exec(urlLike.replace(/[()]/g, ''));\n return [parts[1], parts[2] || undefined, parts[3] || undefined];\n },\n\n parseV8OrIE: function ErrorStackParser$$parseV8OrIE(error) {\n var filtered = error.stack.split('\\n').filter(function(line) {\n return !!line.match(CHROME_IE_STACK_REGEXP);\n }, this);\n\n return filtered.map(function(line) {\n if (line.indexOf('(eval ') > -1) {\n // Throw away eval information until we implement stacktrace.js/stackframe#8\n line = line.replace(/eval code/g, 'eval').replace(/(\\(eval at [^()]*)|(,.*$)/g, '');\n }\n var sanitizedLine = line.replace(/^\\s+/, '').replace(/\\(eval code/g, '(').replace(/^.*?\\s+/, '');\n\n // capture and preseve the parenthesized location \"(/foo/my bar.js:12:87)\" in\n // case it has spaces in it, as the string is split on \\s+ later on\n var location = sanitizedLine.match(/ (\\(.+\\)$)/);\n\n // remove the parenthesized location from the line, if it was matched\n sanitizedLine = location ? sanitizedLine.replace(location[0], '') : sanitizedLine;\n\n // if a location was matched, pass it to extractLocation() otherwise pass all sanitizedLine\n // because this line doesn't have function name\n var locationParts = this.extractLocation(location ? location[1] : sanitizedLine);\n var functionName = location && sanitizedLine || undefined;\n var fileName = ['eval', '<anonymous>'].indexOf(locationParts[0]) > -1 ? undefined : locationParts[0];\n\n return new StackFrame({\n functionName: functionName,\n fileName: fileName,\n lineNumber: locationParts[1],\n columnNumber: locationParts[2],\n source: line\n });\n }, this);\n },\n\n parseFFOrSafari: function ErrorStackParser$$parseFFOrSafari(error) {\n var filtered = error.stack.split('\\n').filter(function(line) {\n return !line.match(SAFARI_NATIVE_CODE_REGEXP);\n }, this);\n\n return filtered.map(function(line) {\n // Throw away eval information until we implement stacktrace.js/stackframe#8\n if (line.indexOf(' > eval') > -1) {\n line = line.replace(/ line (\\d+)(?: > eval line \\d+)* > eval:\\d+:\\d+/g, ':$1');\n }\n\n if (line.indexOf('@') === -1 && line.indexOf(':') === -1) {\n // Safari eval frames only have function names and nothing else\n return new StackFrame({\n functionName: line\n });\n } else {\n var functionNameRegex = /((.*\".+\"[^@]*)?[^@]*)(?:@)/;\n var matches = line.match(functionNameRegex);\n var functionName = matches && matches[1] ? matches[1] : undefined;\n var locationParts = this.extractLocation(line.replace(functionNameRegex, ''));\n\n return new StackFrame({\n functionName: functionName,\n fileName: locationParts[0],\n lineNumber: locationParts[1],\n columnNumber: locationParts[2],\n source: line\n });\n }\n }, this);\n },\n\n parseOpera: function ErrorStackParser$$parseOpera(e) {\n if (!e.stacktrace || (e.message.indexOf('\\n') > -1 &&\n e.message.split('\\n').length > e.stacktrace.split('\\n').length)) {\n return this.parseOpera9(e);\n } else if (!e.stack) {\n return this.parseOpera10(e);\n } else {\n return this.parseOpera11(e);\n }\n },\n\n parseOpera9: function ErrorStackParser$$parseOpera9(e) {\n var lineRE = /Line (\\d+).*script (?:in )?(\\S+)/i;\n var lines = e.message.split('\\n');\n var result = [];\n\n for (var i = 2, len = lines.length; i < len; i += 2) {\n var match = lineRE.exec(lines[i]);\n if (match) {\n result.push(new StackFrame({\n fileName: match[2],\n lineNumber: match[1],\n source: lines[i]\n }));\n }\n }\n\n return result;\n },\n\n parseOpera10: function ErrorStackParser$$parseOpera10(e) {\n var lineRE = /Line (\\d+).*script (?:in )?(\\S+)(?:: In function (\\S+))?$/i;\n var lines = e.stacktrace.split('\\n');\n var result = [];\n\n for (var i = 0, len = lines.length; i < len; i += 2) {\n var match = lineRE.exec(lines[i]);\n if (match) {\n result.push(\n new StackFrame({\n functionName: match[3] || undefined,\n fileName: match[2],\n lineNumber: match[1],\n source: lines[i]\n })\n );\n }\n }\n\n return result;\n },\n\n // Opera 10.65+ Error.stack very similar to FF/Safari\n parseOpera11: function ErrorStackParser$$parseOpera11(error) {\n var filtered = error.stack.split('\\n').filter(function(line) {\n return !!line.match(FIREFOX_SAFARI_STACK_REGEXP) && !line.match(/^Error created at/);\n }, this);\n\n return filtered.map(function(line) {\n var tokens = line.split('@');\n var locationParts = this.extractLocation(tokens.pop());\n var functionCall = (tokens.shift() || '');\n var functionName = functionCall\n .replace(/<anonymous function(: (\\w+))?>/, '$2')\n .replace(/\\([^)]*\\)/g, '') || undefined;\n var argsRaw;\n if (functionCall.match(/\\(([^)]*)\\)/)) {\n argsRaw = functionCall.replace(/^[^(]+\\(([^)]*)\\)$/, '$1');\n }\n var args = (argsRaw === undefined || argsRaw === '[arguments not available]') ?\n undefined : argsRaw.split(',');\n\n return new StackFrame({\n functionName: functionName,\n args: args,\n fileName: locationParts[0],\n lineNumber: locationParts[1],\n columnNumber: locationParts[2],\n source: line\n });\n }, this);\n }\n };\n}));\n", "import { loadPyodide, version } from \"./pyodide\";\nimport { type PackageData } from \"./load-package\";\nexport { loadPyodide, version, type PackageData };\n(globalThis as any).loadPyodide = loadPyodide;\n", "import ErrorStackParser from \"error-stack-parser\";\nimport {\n IN_NODE,\n IN_NODE_ESM,\n IN_BROWSER_MAIN_THREAD,\n IN_BROWSER_WEB_WORKER,\n IN_NODE_COMMONJS,\n} from \"./environments\";\nimport { Lockfile } from \"./types\";\n\nlet nodeUrlMod: typeof import(\"node:url\");\nlet nodePath: typeof import(\"node:path\");\nlet nodeVmMod: typeof import(\"node:vm\");\n/** @private */\nexport let nodeFSMod: typeof import(\"node:fs\");\n/** @private */\nexport let nodeFsPromisesMod: typeof import(\"node:fs/promises\");\n\ndeclare var globalThis: {\n importScripts: (url: string) => void;\n document?: typeof document;\n fetch?: typeof fetch;\n};\n\n/**\n * If we're in node, it's most convenient to import various node modules on\n * initialization. Otherwise, this does nothing.\n * @private\n */\nexport async function initNodeModules() {\n if (!IN_NODE) {\n return;\n }\n // @ts-ignore\n nodeUrlMod = (await import(\"node:url\")).default;\n nodeFSMod = await import(\"node:fs\");\n nodeFsPromisesMod = await import(\"node:fs/promises\");\n\n // @ts-ignore\n nodeVmMod = (await import(\"node:vm\")).default;\n nodePath = await import(\"node:path\");\n pathSep = nodePath.sep;\n\n // Emscripten uses `require`, so if it's missing (because we were imported as\n // an ES6 module) we need to polyfill `require` with `import`. `import` is\n // async and `require` is synchronous, so we import all packages that might be\n // required up front and define require to look them up in this table.\n\n if (typeof require !== \"undefined\") {\n return;\n }\n // These are all the packages required in pyodide.asm.js. You can get this\n // list with:\n // $ grep -o 'require(\"[a-z]*\")' pyodide.asm.js | sort -u\n const fs = nodeFSMod;\n const crypto = await import(\"node:crypto\");\n const ws = await import(\"ws\");\n const child_process = await import(\"node:child_process\");\n const node_modules: { [mode: string]: any } = {\n fs,\n crypto,\n ws,\n child_process,\n };\n // Since we're in an ES6 module, this is only modifying the module namespace,\n // it's still private to Pyodide.\n (globalThis as any).require = function (mod: string): any {\n return node_modules[mod];\n };\n}\n\nfunction node_resolvePath(path: string, base?: string): string {\n return nodePath.resolve(base || \".\", path);\n}\n\nfunction browser_resolvePath(path: string, base?: string): string {\n if (base === undefined) {\n // @ts-ignore\n base = location;\n }\n return new URL(path, base).toString();\n}\n\nexport let resolvePath: (rest: string, base?: string) => string;\nif (IN_NODE) {\n resolvePath = node_resolvePath;\n} else {\n resolvePath = browser_resolvePath;\n}\n\n/**\n * Get the path separator. If we are on Linux or in the browser, it's /.\n * In Windows, it's \\.\n * @private\n */\nexport let pathSep: string;\n\nif (!IN_NODE) {\n pathSep = \"/\";\n}\n\n/**\n * Load a binary file, only for use in Node. If the path explicitly is a URL,\n * then fetch from a URL, else load from the file system.\n * @param indexURL base path to resolve relative paths\n * @param path the path to load\n * @param checksum sha-256 checksum of the package\n * @returns An ArrayBuffer containing the binary data\n * @private\n */\nfunction node_getBinaryResponse(\n path: string,\n _file_sub_resource_hash?: string | undefined, // Ignoring sub resource hash. See issue-2431.\n):\n | { response: Promise<Response>; binary?: undefined }\n | { binary: Promise<Uint8Array> } {\n if (path.startsWith(\"file://\")) {\n // handle file:// with filesystem operations rather than with fetch.\n path = path.slice(\"file://\".length);\n }\n if (path.includes(\"://\")) {\n // If it has a protocol, make a fetch request\n return { response: fetch(path) };\n } else {\n // Otherwise get it from the file system\n return {\n binary: nodeFsPromisesMod\n .readFile(path)\n .then(\n (data: Buffer) =>\n new Uint8Array(data.buffer, data.byteOffset, data.byteLength),\n ),\n };\n }\n}\n\n/**\n * Load a binary file, only for use in browser. Resolves relative paths against\n * indexURL.\n *\n * @param path the path to load\n * @param subResourceHash the sub resource hash for fetch() integrity check\n * @returns A Uint8Array containing the binary data\n * @private\n */\nfunction browser_getBinaryResponse(\n path: string,\n subResourceHash: string | undefined,\n): { response: Promise<Response>; binary?: undefined } {\n const url = new URL(path, location as unknown as URL);\n let options = subResourceHash ? { integrity: subResourceHash } : {};\n return { response: fetch(url, options) };\n}\n\n/** @private */\nexport let getBinaryResponse: (\n path: string,\n file_sub_resource_hash?: string | undefined,\n) =>\n | { response: Promise<Response>; binary?: undefined }\n | { response?: undefined; binary: Promise<Uint8Array> };\nif (IN_NODE) {\n getBinaryResponse = node_getBinaryResponse;\n} else {\n getBinaryResponse = browser_getBinaryResponse;\n}\n\nexport async function loadBinaryFile(\n path: string,\n file_sub_resource_hash?: string | undefined,\n): Promise<Uint8Array> {\n const { response, binary } = getBinaryResponse(path, file_sub_resource_hash);\n if (binary) {\n return binary;\n }\n const r = await response;\n if (!r.ok) {\n throw new Error(`Failed to load '${path}': request failed.`);\n }\n return new Uint8Array(await r.arrayBuffer());\n}\n\n/**\n * Currently loadScript is only used once to load `pyodide.asm.js`.\n * @param url\n * @async\n * @private\n */\nexport let loadScript: (url: string) => Promise<void>;\n\nif (IN_BROWSER_MAIN_THREAD) {\n // browser\n loadScript = async (url) => await import(/* webpackIgnore: true */ url);\n} else if (IN_BROWSER_WEB_WORKER) {\n // webworker\n loadScript = async (url) => {\n try {\n // use importScripts in classic web worker\n globalThis.importScripts(url);\n } catch (e) {\n // importScripts throws TypeError in a module type web worker, use import instead\n if (e instanceof TypeError) {\n await import(/* webpackIgnore: true */ url);\n } else {\n throw e;\n }\n }\n };\n} else if (IN_NODE) {\n loadScript = nodeLoadScript;\n} else {\n throw new Error(\"Cannot determine runtime environment\");\n}\n\n/**\n * Load a text file and executes it as Javascript\n * @param url The path to load. May be a url or a relative file system path.\n * @private\n */\nasync function nodeLoadScript(url: string) {\n if (url.startsWith(\"file://\")) {\n // handle file:// with filesystem operations rather than with fetch.\n url = url.slice(\"file://\".length);\n }\n if (url.includes(\"://\")) {\n // If it's a url, load it with fetch then eval it.\n nodeVmMod.runInThisContext(await (await fetch(url)).text());\n } else {\n // Otherwise, hopefully it is a relative path we can load from the file\n // system.\n await import(/* webpackIgnore: true */ nodeUrlMod.pathToFileURL(url).href);\n }\n}\n\n// consider dropping this this once we drop support for node 14?\nfunction nodeBase16ToBase64(b16: string): string {\n return Buffer.from(b16, \"hex\").toString(\"base64\");\n}\n\nfunction browserBase16ToBase64(b16: string): string {\n return btoa(\n b16\n .match(/\\w{2}/g)!\n .map(function (a) {\n return String.fromCharCode(parseInt(a, 16));\n })\n .join(\"\"),\n );\n}\n\nexport const base16ToBase64 = IN_NODE\n ? nodeBase16ToBase64\n : browserBase16ToBase64;\n\nexport async function loadLockFile(lockFileURL: string): Promise<Lockfile> {\n if (IN_NODE) {\n await initNodeModules();\n const package_string = await nodeFsPromisesMod.readFile(lockFileURL, {\n encoding: \"utf8\",\n });\n return JSON.parse(package_string);\n } else {\n let response = await fetch(lockFileURL);\n return await response.json();\n }\n}\n\n/**\n * Calculate the directory name of the current module.\n * This is used to guess the indexURL when it is not provided.\n */\nexport async function calculateDirname(): Promise<string> {\n if (IN_NODE_COMMONJS) {\n return __dirname;\n }\n\n let err: Error;\n try {\n throw new Error();\n } catch (e) {\n err = e as Error;\n }\n let fileName = ErrorStackParser.parse(err)[0].fileName!;\n\n if (IN_NODE_ESM) {\n const nodePath = await import(\"node:path\");\n const nodeUrl = await import(\"node:url\");\n\n // FIXME: We would like to use import.meta.url here,\n // but mocha seems to mess with compiling typescript files to ES6.\n return nodeUrl.fileURLToPath(nodePath.dirname(fileName));\n }\n\n const indexOfLastSlash = fileName.lastIndexOf(pathSep);\n if (indexOfLastSlash === -1) {\n throw new Error(\n \"Could not extract indexURL path from pyodide module location\",\n );\n }\n return fileName.slice(0, indexOfLastSlash);\n}\n", "// @ts-nocheck\n\n/** @private */\nexport const IN_NODE =\n typeof process === \"object\" &&\n typeof process.versions === \"object\" &&\n typeof process.versions.node === \"string\" &&\n typeof process.browser ===\n \"undefined\"; /* This last condition checks if we run the browser shim of process */\n\n/** @private */\nexport const IN_NODE_COMMONJS =\n IN_NODE &&\n typeof module !== \"undefined\" &&\n typeof module.exports !== \"undefined\" &&\n typeof require !== \"undefined\" &&\n typeof __dirname !== \"undefined\";\n\n/** @private */\nexport const IN_NODE_ESM = IN_NODE && !IN_NODE_COMMONJS;\n\n/** @private */\nexport const IN_DENO = typeof Deno !== \"undefined\"; // just in case...\n\n/** @private */\nexport const IN_BROWSER = !IN_NODE && !IN_DENO;\n\n/** @private */\nexport const IN_BROWSER_MAIN_THREAD =\n IN_BROWSER &&\n typeof window !== \"undefined\" &&\n typeof document !== \"undefined\" &&\n typeof document.createElement !== \"undefined\" &&\n typeof sessionStorage !== \"undefined\" &&\n typeof importScripts === \"undefined\";\n\n/** @private */\nexport const IN_BROWSER_WEB_WORKER =\n IN_BROWSER &&\n typeof importScripts !== \"undefined\" &&\n typeof self !== \"undefined\";\n\n/** @private */\nexport const IN_SAFARI =\n typeof navigator !== \"undefined\" &&\n typeof navigator.userAgent !== \"undefined\" &&\n navigator.userAgent.indexOf(\"Chrome\") == -1 &&\n navigator.userAgent.indexOf(\"Safari\") > -1;\n\n/**\n * Detects the current environment and returns a record with the results.\n * This function is useful for debugging and testing purposes.\n */\nexport function detectEnvironment(): Record<string, boolean> {\n return {\n IN_NODE: IN_NODE,\n IN_NODE_COMMONJS: IN_NODE_COMMONJS,\n IN_NODE_ESM: IN_NODE_ESM,\n IN_DENO: IN_DENO,\n IN_BROWSER: IN_BROWSER,\n IN_BROWSER_MAIN_THREAD: IN_BROWSER_MAIN_THREAD,\n IN_BROWSER_WEB_WORKER: IN_BROWSER_WEB_WORKER,\n IN_SAFARI: IN_SAFARI,\n };\n}\n", "import { Module } from \"./types\";\n\n/**\n * @private\n */\nexport function initializeNativeFS(module: Module) {\n const FS = module.FS;\n const MEMFS = module.FS.filesystems.MEMFS;\n const PATH = module.PATH;\n\n const nativeFSAsync = {\n // DIR_MODE: {{{ cDefine('S_IFDIR') }}} | 511 /* 0777 */,\n // FILE_MODE: {{{ cDefine('S_IFREG') }}} | 511 /* 0777 */,\n DIR_MODE: 16384 | 511,\n FILE_MODE: 32768 | 511,\n mount: function (mount: any) {\n if (!mount.opts.fileSystemHandle) {\n throw new Error(\"opts.fileSystemHandle is required\");\n }\n\n // reuse all of the core MEMFS functionality\n return MEMFS.mount.apply(null, arguments);\n },\n syncfs: async (mount: any, populate: Boolean, callback: Function) => {\n try {\n const local = nativeFSAsync.getLocalSet(mount);\n const remote = await nativeFSAsync.getRemoteSet(mount);\n const src = populate ? remote : local;\n const dst = populate ? local : remote;\n await nativeFSAsync.reconcile(mount, src, dst);\n callback(null);\n } catch (e) {\n callback(e);\n }\n },\n // Returns file set of emscripten's filesystem at the mountpoint.\n getLocalSet: (mount: any) => {\n let entries = Object.create(null);\n\n function isRealDir(p: string) {\n return p !== \".\" && p !== \"..\";\n }\n\n function toAbsolute(root: string) {\n return (p: string) => {\n return PATH.join2(root, p);\n };\n }\n\n let check = FS.readdir(mount.mountpoint)\n .filter(isRealDir)\n .map(toAbsolute(mount.mountpoint));\n\n while (check.length) {\n let path = check.pop();\n let stat = FS.stat(path);\n\n if (FS.isDir(stat.mode)) {\n check.push.apply(\n check,\n FS.readdir(path).filter(isRealDir).map(toAbsolute(path)),\n );\n }\n\n entries[path] = { timestamp: stat.mtime, mode: stat.mode };\n }\n\n return { type: \"local\", entries: entries };\n },\n // Returns file set of the real, on-disk filesystem at the mountpoint.\n getRemoteSet: async (mount: any) => {\n // TODO: this should be a map.\n const entries = Object.create(null);\n\n const handles = await getFsHandles(mount.opts.fileSystemHandle);\n for (const [path, handle] of handles) {\n if (path === \".\") continue;\n\n entries[PATH.join2(mount.mountpoint, path)] = {\n timestamp:\n handle.kind === \"file\"\n ? (await handle.getFile()).lastModifiedDate\n : new Date(),\n mode:\n handle.kind === \"file\"\n ? nativeFSAsync.FILE_MODE\n : nativeFSAsync.DIR_MODE,\n };\n }\n\n return { type: \"remote\", entries, handles };\n },\n loadLocalEntry: (path: string) => {\n const lookup = FS.lookupPath(path);\n const node = lookup.node;\n const stat = FS.stat(path);\n\n if (FS.isDir(stat.mode)) {\n return { timestamp: stat.mtime, mode: stat.mode };\n } else if (FS.isFile(stat.mode)) {\n node.contents = MEMFS.getFileDataAsTypedArray(node);\n return {\n timestamp: stat.mtime,\n mode: stat.mode,\n contents: node.contents,\n };\n } else {\n throw new Error(\"node type not supported\");\n }\n },\n storeLocalEntry: (path: string, entry: any) => {\n if (FS.isDir(entry[\"mode\"])) {\n FS.mkdirTree(path, entry[\"mode\"]);\n } else if (FS.isFile(entry[\"mode\"])) {\n FS.writeFile(path, entry[\"contents\"], { canOwn: true });\n } else {\n throw new Error(\"node type not supported\");\n }\n\n FS.chmod(path, entry[\"mode\"]);\n FS.utime(path, entry[\"timestamp\"], entry[\"timestamp\"]);\n },\n removeLocalEntry: (path: string) => {\n var stat = FS.stat(path);\n\n if (FS.isDir(stat.mode)) {\n FS.rmdir(path);\n } else if (FS.isFile(stat.mode)) {\n FS.unlink(path);\n }\n },\n loadRemoteEntry: async (handle: any) => {\n if (handle.kind === \"file\") {\n const file = await handle.getFile();\n return {\n contents: new Uint8Array(await file.arrayBuffer()),\n mode: nativeFSAsync.FILE_MODE,\n timestamp: file.lastModifiedDate,\n };\n } else if (handle.kind === \"directory\") {\n return {\n mode: nativeFSAsync.DIR_MODE,\n timestamp: new Date(),\n };\n } else {\n throw new Error(\"unknown kind: \" + handle.kind);\n }\n },\n storeRemoteEntry: async (handles: any, path: string, entry: any) => {\n const parentDirHandle = handles.get(PATH.dirname(path));\n const handle = FS.isFile(entry.mode)\n ? await parentDirHandle.getFileHandle(PATH.basename(path), {\n create: true,\n })\n : await parentDirHandle.getDirectoryHandle(PATH.basename(path), {\n create: true,\n });\n if (handle.kind === \"file\") {\n const writable = await handle.createWritable();\n await writable.write(entry.contents);\n await writable.close();\n }\n handles.set(path, handle);\n },\n removeRemoteEntry: async (handles: any, path: string) => {\n const parentDirHandle = handles.get(PATH.dirname(path));\n await parentDirHandle.removeEntry(PATH.basename(path));\n handles.delete(path);\n },\n reconcile: async (mount: any, src: any, dst: any) => {\n let total = 0;\n\n const create: Array<string> = [];\n Object.keys(src.entries).forEach(function (key) {\n const e = src.entries[key];\n const e2 = dst.entries[key];\n if (\n !e2 ||\n (FS.isFile(e.mode) &&\n e[\"timestamp\"].getTime() > e2[\"timestamp\"].getTime())\n ) {\n create.push(key);\n total++;\n }\n });\n // sort paths in ascending order so directory entries are created\n // before the files inside them\n create.sort();\n\n const remove: Array<string> = [];\n Object.keys(dst.entries).forEach(function (key) {\n if (!src.entries[key]) {\n remove.push(key);\n total++;\n }\n });\n // sort paths in descending order so files are deleted before their\n // parent directories\n remove.sort().reverse();\n\n if (!total) {\n return;\n }\n\n const handles = src.type === \"remote\" ? src.handles : dst.handles;\n\n for (const path of create) {\n const relPath = PATH.normalize(\n path.replace(mount.mountpoint, \"/\"),\n ).substring(1);\n if (dst.type === \"local\") {\n const handle = handles.get(relPath);\n const entry = await nativeFSAsync.loadRemoteEntry(handle);\n nativeFSAsync.storeLocalEntry(path, entry);\n } else {\n const entry = nativeFSAsync.loadLocalEntry(path);\n await nativeFSAsync.storeRemoteEntry(handles, relPath, entry);\n }\n }\n\n for (const path of remove) {\n if (dst.type === \"local\") {\n nativeFSAsync.removeLocalEntry(path);\n } else {\n const relPath = PATH.normalize(\n path.replace(mount.mountpoint, \"/\"),\n ).substring(1);\n await nativeFSAsync.removeRemoteEntry(handles, relPath);\n }\n }\n },\n };\n\n module.FS.filesystems.NATIVEFS_ASYNC = nativeFSAsync;\n}\n\nconst getFsHandles = async (dirHandle: any) => {\n const handles: any = [];\n\n async function collect(curDirHandle: any) {\n for await (const entry of curDirHandle.values()) {\n handles.push(entry);\n if (entry.kind === \"directory\") {\n await collect(entry);\n }\n }\n }\n\n await collect(dirHandle);\n\n const result = new Map();\n result.set(\".\", dirHandle);\n for (const handle of handles) {\n const relativePath = (await dirHandle.resolve(handle)).join(\"/\");\n result.set(relativePath, handle);\n }\n return result;\n};\n", "/** @private */\n\nimport { ConfigType } from \"./pyodide\";\nimport { initializeNativeFS } from \"./nativefs\";\nimport { loadBinaryFile, getBinaryResponse } from \"./compat\";\nimport { Module } from \"./types\";\n\n/**\n * The Emscripten Module.\n *\n * @private\n */\nexport function createModule(): Module {\n let Module: any = {};\n Module.noImageDecoding = true;\n Module.noAudioDecoding = true;\n Module.noWasmDecoding = false; // we preload wasm using the built in plugin now\n Module.preRun = [];\n Module.quit = (status: number, toThrow: Error) => {\n Module.exited = { status, toThrow };\n throw toThrow;\n };\n return Module as Module;\n}\n\n/**\n * Make the home directory inside the virtual file system,\n * then change the working directory to it.\n *\n * @param Module The Emscripten Module.\n * @param path The path to the home directory.\n * @private\n */\nfunction createHomeDirectory(Module: Module, path: string) {\n Module.preRun.push(function () {\n const fallbackPath = \"/\";\n try {\n Module.FS.mkdirTree(path);\n } catch (e) {\n console.error(`Error occurred while making a home directory '${path}':`);\n console.error(e);\n console.error(`Using '${fallbackPath}' for a home directory instead`);\n path = fallbackPath;\n }\n Module.FS.chdir(path);\n });\n}\n\nfunction setEnvironment(Module: Module, env: { [key: string]: string }) {\n Module.preRun.push(function () {\n Object.assign(Module.ENV, env);\n });\n}\n\n/**\n * Mount local directories to the virtual file system. Only for Node.js.\n * @param module The Emscripten Module.\n * @param mounts The list of paths to mount.\n */\nfunction mountLocalDirectories(Module: Module, mounts: string[]) {\n Module.preRun.push(() => {\n for (const mount of mounts) {\n Module.FS.mkdirTree(mount);\n Module.FS.mount(Module.FS.filesystems.NODEFS, { root: mount }, mount);\n }\n });\n}\n\n/**\n * Install the Python standard library to the virtual file system.\n *\n * Previously, this was handled by Emscripten's file packager (pyodide.asm.data).\n * However, using the file packager means that we have only one version\n * of the standard library available. We want to be able to use different\n * versions of the standard library, for example:\n *\n * - Use compiled(.pyc) or uncompiled(.py) standard library.\n * - Remove unused modules or add additional modules using bundlers like pyodide-pack.\n *\n * @param Module The Emscripten Module.\n * @param stdlibPromise A promise that resolves to the standard library.\n */\nfunction installStdlib(Module: Module, stdlibURL: string) {\n const stdlibPromise: Promise<Uint8Array> = loadBinaryFile(stdlibURL);\n\n Module.preRun.push(() => {\n /* @ts-ignore */\n const pymajor = Module._py_version_major();\n /* @ts-ignore */\n const pyminor = Module._py_version_minor();\n\n Module.FS.mkdirTree(\"/lib\");\n Module.FS.mkdirTree(`/lib/python${pymajor}.${pyminor}/site-packages`);\n\n Module.addRunDependency(\"install-stdlib\");\n\n stdlibPromise\n .then((stdlib: Uint8Array) => {\n Module.FS.writeFile(`/lib/python${pymajor}${pyminor}.zip`, stdlib);\n })\n .catch((e) => {\n console.error(\"Error occurred while installing the standard library:\");\n console.error(e);\n })\n .finally(() => {\n Module.removeRunDependency(\"install-stdlib\");\n });\n });\n}\n\n/**\n * Initialize the virtual file system, before loading Python interpreter.\n * @private\n */\nexport function initializeFileSystem(Module: Module, config: ConfigType) {\n let stdLibURL;\n if (config.stdLibURL != undefined) {\n stdLibURL = config.stdLibURL;\n } else {\n stdLibURL = config.indexURL + \"python_stdlib.zip\";\n }\n\n installStdlib(Module, stdLibURL);\n createHomeDirectory(Module, config.env.HOME);\n setEnvironment(Module, config.env);\n mountLocalDirectories(Module, config._node_mounts);\n Module.preRun.push(() => initializeNativeFS(Module));\n}\n\nexport function preloadWasm(Module: Module, indexURL: string) {\n if (SOURCEMAP) {\n // According to the docs:\n //\n // \"Sanitizers or source map is currently not supported if overriding\n // WebAssembly instantiation with Module.instantiateWasm.\"\n // https://emscripten.org/docs/api_reference/module.html?highlight=instantiatewasm#Module.instantiateWasm\n return;\n }\n const { binary, response } = getBinaryResponse(indexURL + \"pyodide.asm.wasm\");\n Module.instantiateWasm = function (\n imports: { [key: string]: any },\n successCallback: (\n instance: WebAssembly.Instance,\n module: WebAssembly.Module,\n ) => void,\n ) {\n (async function () {\n try {\n let res: WebAssembly.WebAssemblyInstantiatedSource;\n if (response) {\n res = await WebAssembly.instantiateStreaming(response, imports);\n } else {\n res = await WebAssembly.instantiate(await binary, imports);\n }\n const { instance, module } = res;\n // When overriding instantiateWasm, in asan builds, we also need\n // to take care of creating the WasmOffsetConverter\n // @ts-ignore\n if (typeof WasmOffsetConverter != \"undefined\") {\n // @ts-ignore\n wasmOffsetConverter = new WasmOffsetConverter(wasmBinary, module);\n }\n successCallback(instance, module);\n } catch (e) {\n console.warn(\"wasm instantiation failed!\");\n console.warn(e);\n }\n })();\n\n return {}; // Compiling asynchronously, no exports.\n };\n}\n", "/**\n *\n * The Pyodide version.\n *\n * The version here is a Python version, following :pep:`440`. This is different\n * from the version in ``package.json`` which follows the node package manager\n * version convention.\n */\nexport const version: string = \"0.26.0a4\";\n", "/**\n * The main bootstrap code for loading pyodide.\n */\nimport {\n calculateDirname,\n loadScript,\n initNodeModules,\n resolvePath,\n loadLockFile,\n} from \"./compat\";\n\nimport { createModule, initializeFileSystem, preloadWasm } from \"./module\";\nimport { version } from \"./version\";\n\nimport type { PyodideInterface } from \"./api.js\";\nimport type { TypedArray, API, Module } from \"./types\";\nimport type { PackageData } from \"./load-package\";\nexport type { PyodideInterface, TypedArray };\n\nexport { version, type PackageData };\n\ndeclare function _createPyodideModule(Module: any): Promise<void>;\n\n/**\n * See documentation for loadPyodide.\n * @private\n */\nexport type ConfigType = {\n indexURL: string;\n packageCacheDir: string;\n lockFileURL: string;\n fullStdLib?: boolean;\n stdLibURL?: string;\n stdin?: () => string;\n stdout?: (msg: string) => void;\n stderr?: (msg: string) => void;\n jsglobals?: object;\n args: string[];\n _node_mounts: string[];\n env: { [key: string]: string };\n packages: string[];\n};\n\n/**\n * Load the main Pyodide wasm module and initialize it.\n *\n * @returns The :ref:`js-api-pyodide` module.\n * @memberof globalThis\n * @async\n * @example\n * async function main() {\n * const pyodide = await loadPyodide({\n * fullStdLib: true,\n * stdout: (msg) => console.log(`Pyodide: ${msg}`),\n * });\n * console.log(\"Loaded Pyodide\");\n * }\n * main();\n */\nexport async function loadPyodide(\n options: {\n /**\n * The URL from which Pyodide will load the main Pyodide runtime and\n * packages. It is recommended that you leave this unchanged, providing an\n * incorrect value can cause broken behavior.\n *\n * Default: The url that Pyodide is loaded from with the file name\n * (``pyodide.js`` or ``pyodide.mjs``) removed.\n */\n indexURL?: string;\n\n /**\n * The file path where packages will be cached in node. If a package\n * exists in ``packageCacheDir`` it is loaded from there, otherwise it is\n * downloaded from the JsDelivr CDN and then cached into ``packageCacheDir``.\n * Only applies when running in node; ignored in browsers.\n *\n * Default: same as indexURL\n */\n packageCacheDir?: string;\n\n /**\n * The URL from which Pyodide will load the Pyodide ``pyodide-lock.json`` lock\n * file. You can produce custom lock files with :py:func:`micropip.freeze`.\n * Default: ```${indexURL}/pyodide-lock.json```\n */\n lockFileURL?: string;\n /**\n * Load the full Python standard library. Setting this to false excludes\n * unvendored modules from the standard library.\n * Default: ``false``\n */\n fullStdLib?: boolean;\n /**\n * The URL from which to load the standard library ``python_stdlib.zip``\n * file. This URL includes the most of the Python standard library. Some\n * stdlib modules were unvendored, and can be loaded separately\n * with ``fullStdLib: true`` option or by their package name.\n * Default: ```${indexURL}/python_stdlib.zip```\n */\n stdLibURL?: string;\n /**\n * Override the standard input callback. Should ask the user for one line of\n * input. The :js:func:`pyodide.setStdin` function is more flexible and\n * should be preferred.\n */\n stdin?: () => string;\n /**\n * Override the standard output callback. The :js:func:`pyodide.setStdout`\n * function is more flexible and should be preferred in most cases, but\n * depending on the ``args`` passed to ``loadPyodide``, Pyodide may write to\n * stdout on startup, which can only be controlled by passing a custom\n * ``stdout`` function.\n */\n stdout?: (msg: string) => void;\n /**\n * Override the standard error output callback. The\n * :js:func:`pyodide.setStderr` function is more flexible and should be\n * preferred in most cases, but depending on the ``args`` passed to\n * ``loadPyodide``, Pyodide may write to stdout on startup, which can only\n * be controlled by passing a custom ``stdout`` function.\n */\n stderr?: (msg: string) => void;\n /**\n * The object that Pyodide will use for the ``js`` module.\n * Default: ``globalThis``\n */\n jsglobals?: object;\n /**\n * Command line arguments to pass to Python on startup. See `Python command\n * line interface options\n * <https://docs.python.org/3.10/using/cmdline.html#interface-options>`_ for\n * more details. Default: ``[]``\n */\n args?: string[];\n /**\n * Environment variables to pass to Python. This can be accessed inside of\n * Python at runtime via :py:data:`os.environ`. Certain environment variables change\n * the way that Python loads:\n * https://docs.python.org/3.10/using/cmdline.html#environment-variables\n * Default: ``{}``.\n * If ``env.HOME`` is undefined, it will be set to a default value of\n * ``\"/home/pyodide\"``\n */\n env?: { [key: string]: string };\n /**\n * A list of packages to load as Pyodide is initializing.\n *\n * This is the same as loading the packages with\n * :js:func:`pyodide.loadPackage` after Pyodide is loaded except using the\n * ``packages`` option is more efficient because the packages are downloaded\n * while Pyodide bootstraps itself.\n */\n packages?: string[];\n /**\n * Opt into the old behavior where PyProxy.toString calls `repr` and not\n * `str`.\n * @deprecated\n */\n pyproxyToStringRepr?: boolean;\n /**\n * @ignore\n */\n _node_mounts?: string[];\n } = {},\n): Promise<PyodideInterface> {\n await initNodeModules();\n let indexURL = options.indexURL || (await calculateDirname());\n indexURL = resolvePath(indexURL); // A relative indexURL causes havoc.\n if (!indexURL.endsWith(\"/\")) {\n indexURL += \"/\";\n }\n options.indexURL = indexURL;\n\n const default_config = {\n fullStdLib: false,\n jsglobals: globalThis,\n stdin: globalThis.prompt ? globalThis.prompt : undefined,\n lockFileURL: indexURL + \"pyodide-lock.json\",\n args: [],\n _node_mounts: [],\n env: {},\n packageCacheDir: indexURL,\n packages: [],\n };\n const config = Object.assign(default_config, options) as ConfigType;\n if (!config.env.HOME) {\n config.env.HOME = \"/home/pyodide\";\n }\n\n const Module = createModule();\n Module.print = config.stdout;\n Module.printErr = config.stderr;\n Module.arguments = config.args;\n\n const API = { config } as API;\n Module.API = API;\n API.lockFilePromise = loadLockFile(config.lockFileURL);\n\n preloadWasm(Module, indexURL);\n initializeFileSystem(Module, config);\n\n const moduleLoaded = new Promise((r) => (Module.postRun = r));\n\n // locateFile tells Emscripten where to find the data files that initialize\n // the file system.\n Module.locateFile = (path: string) => config.indexURL + path;\n\n // If the pyodide.asm.js script has been imported, we can skip the dynamic import\n // Users can then do a static import of the script in environments where\n // dynamic importing is not allowed or not desirable, like module-type service workers\n if (typeof _createPyodideModule !== \"function\") {\n const scriptSrc = `${config.indexURL}pyodide.asm.js`;\n await loadScript(scriptSrc);\n }\n\n // _createPyodideModule is specified in the Makefile by the linker flag:\n // `-s EXPORT_NAME=\"'_createPyodideModule'\"`\n await _createPyodideModule(Module);\n\n // There is some work to be done between the module being \"ready\" and postRun\n // being called.\n await moduleLoaded;\n // Handle early exit\n if (Module.exited) {\n throw Module.exited.toThrow;\n }\n if (options.pyproxyToStringRepr) {\n API.setPyProxyToStringMethod(true);\n }\n\n if (API.version !== version) {\n throw new Error(\n `\\\nPyodide version does not match: '${version}' <==> '${API.version}'. \\\nIf you updated the Pyodide version, make sure you also updated the 'indexURL' parameter passed to loadPyodide.\\\n`,\n );\n }\n // Disable further loading of Emscripten file_packager stuff.\n Module.locateFile = (path: string) => {\n throw new Error(\"Didn't expect to load any more file_packager files!\");\n };\n\n const pyodide = API.finalizeBootstrap();\n\n // runPython works starting here.\n if (!pyodide.version.includes(\"dev\")) {\n // Currently only used in Node to download packages the first time they are\n // loaded. But in other cases it's harmless.\n API.setCdnUrl(`https://cdn.jsdelivr.net/pyodide/v${pyodide.version}/full/`);\n }\n await API.packageIndexReady;\n\n API._pyodide.set_excepthook();\n const importhook = API._pyodide._importhook;\n importhook.register_module_not_found_hook(\n API._import_name_to_package_name,\n API.lockfile_unvendored_stdlibs_and_test,\n );\n\n if (API.lockfile_info.version !== version) {\n throw new Error(\n \"Lock file version doesn't match Pyodide version.\\n\" +\n ` lockfile version: ${API.lockfile_info.version}\\n` +\n ` pyodide version: ${version}`,\n );\n }\n API.package_loader.init_loaded_packages();\n if (config.fullStdLib) {\n await pyodide.loadPackage(API.lockfile_unvendored_stdlibs);\n }\n API.initializeStreams(config.stdin, config.stdout, config.stderr);\n return pyodide;\n}\n"],
|
|
"mappings": "k8BAAA,IA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AAcQ,GAAiB,CACpC,MAAM,IAAI,MAAM,qDAAqD,CACvE,EAEA,IAAMI,EAAUV,EAAI,kBAAkB,EAiBtC,GAdKU,EAAQ,QAAQ,SAAS,KAAK,GAGjCV,EAAI,UAAU,qCAAqCU,EAAQ,eAAe,EAE5E,MAAMV,EAAI,kBAEVA,EAAI,SAAS,eAAe,EACTA,EAAI,SAAS,YACrB,+BACTA,EAAI,6BACJA,EAAI,oCACN,EAEIA,EAAI,cAAc,UAAYS,EAChC,MAAM,IAAI,MACR;AAAA,uBAC0BT,EAAI,cAAc;AAAA,uBAClBS,GAC5B,EAEF,OAAAT,EAAI,eAAe,qBAAqB,EACpCH,EAAO,YACT,MAAMa,EAAQ,YAAYV,EAAI,2BAA2B,EAE3DA,EAAI,kBAAkBH,EAAO,MAAOA,EAAO,OAAQA,EAAO,MAAM,EACzDa,CACT,CAvNsBC,EAAArB,EAAA,eNxDrB,WAAmB,YAAcsB",
|
|
"names": ["require_stackframe", "__commonJSMin", "exports", "module", "root", "factory", "_isNumber", "n", "__name", "_capitalize", "str", "_getter", "p", "booleanProps", "numericProps", "stringProps", "arrayProps", "objectProps", "props", "StackFrame", "obj", "i", "v", "fileName", "lineNumber", "columnNumber", "functionName", "argsStartIndex", "argsEndIndex", "args", "locationString", "parts", "j", "k", "require_error_stack_parser", "__commonJSMin", "exports", "module", "root", "factory", "__name", "StackFrame", "FIREFOX_SAFARI_STACK_REGEXP", "CHROME_IE_STACK_REGEXP", "SAFARI_NATIVE_CODE_REGEXP", "error", "urlLike", "regExp", "parts", "filtered", "line", "sanitizedLine", "location", "locationParts", "functionName", "fileName", "functionNameRegex", "matches", "e", "lineRE", "lines", "result", "i", "len", "match", "tokens", "functionCall", "argsRaw", "args", "pyodide_umd_exports", "__export", "loadPyodide", "version", "import_error_stack_parser", "IN_NODE", "IN_NODE_COMMONJS", "__require", "IN_NODE_ESM", "IN_DENO", "IN_BROWSER", "IN_BROWSER_MAIN_THREAD", "IN_BROWSER_WEB_WORKER", "IN_SAFARI", "nodeUrlMod", "nodePath", "nodeVmMod", "nodeFSMod", "nodeFsPromisesMod", "initNodeModules", "IN_NODE", "pathSep", "__require", "fs", "crypto", "ws", "child_process", "node_modules", "mod", "__name", "node_resolvePath", "path", "base", "browser_resolvePath", "resolvePath", "node_getBinaryResponse", "_file_sub_resource_hash", "data", "browser_getBinaryResponse", "subResourceHash", "url", "getBinaryResponse", "loadBinaryFile", "file_sub_resource_hash", "response", "binary", "r", "loadScript", "IN_BROWSER_MAIN_THREAD", "IN_BROWSER_WEB_WORKER", "nodeLoadScript", "loadLockFile", "lockFileURL", "IN_NODE", "initNodeModules", "package_string", "nodeFsPromisesMod", "__name", "calculateDirname", "IN_NODE_COMMONJS", "err", "e", "fileName", "ErrorStackParser", "IN_NODE_ESM", "nodePath", "indexOfLastSlash", "pathSep", "initializeNativeFS", "module", "FS", "MEMFS", "PATH", "nativeFSAsync", "mount", "populate", "callback", "local", "remote", "src", "dst", "e", "entries", "isRealDir", "p", "__name", "toAbsolute", "root", "check", "path", "stat", "handles", "getFsHandles", "handle", "node", "entry", "file", "parentDirHandle", "writable", "total", "create", "key", "e2", "remove", "relPath", "dirHandle", "collect", "curDirHandle", "result", "relativePath", "createModule", "Module", "status", "toThrow", "__name", "createHomeDirectory", "path", "fallbackPath", "e", "setEnvironment", "env", "mountLocalDirectories", "mounts", "mount", "installStdlib", "stdlibURL", "stdlibPromise", "loadBinaryFile", "pymajor", "pyminor", "stdlib", "initializeFileSystem", "config", "stdLibURL", "initializeNativeFS", "preloadWasm", "indexURL", "binary", "response", "getBinaryResponse", "imports", "successCallback", "res", "instance", "module", "version", "loadPyodide", "options", "initNodeModules", "indexURL", "calculateDirname", "resolvePath", "default_config", "config", "Module", "createModule", "API", "loadLockFile", "preloadWasm", "initializeFileSystem", "moduleLoaded", "r", "path", "scriptSrc", "loadScript", "version", "pyodide", "__name", "loadPyodide"]
|
|
}
|