Comparing version 0.26.0 to 0.26.1
{ | ||
"name": "pyodide", | ||
"version": "0.26.0", | ||
"version": "0.26.1", | ||
"description": "The Pyodide JavaScript package", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -1413,2 +1413,3 @@ // Generated by dts-bundle-generator v8.1.2 | ||
_makeSnapshot: boolean; | ||
enableRunUntilComplete: boolean; | ||
}; | ||
@@ -1532,2 +1533,6 @@ /** | ||
/** | ||
* Make loop.run_until_complete() function correctly using stack switching | ||
*/ | ||
enableRunUntilComplete?: boolean; | ||
/** | ||
* @ignore | ||
@@ -1534,0 +1539,0 @@ */ |
@@ -1,12 +0,12 @@ | ||
"use strict";var loadPyodide=(()=>{var ae=Object.create;var w=Object.defineProperty;var se=Object.getOwnPropertyDescriptor;var ce=Object.getOwnPropertyNames;var le=Object.getPrototypeOf,de=Object.prototype.hasOwnProperty;var f=(t,e)=>w(t,"name",{value:e,configurable:!0}),g=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,o)=>(typeof require<"u"?require:e)[o]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+t+'" is not supported')});var M=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),fe=(t,e)=>{for(var o in e)w(t,o,{get:e[o],enumerable:!0})},U=(t,e,o,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let l of ce(e))!de.call(t,l)&&l!==o&&w(t,l,{get:()=>e[l],enumerable:!(a=se(e,l))||a.enumerable});return t};var h=(t,e,o)=>(o=t!=null?ae(le(t)):{},U(e||!t||!t.__esModule?w(o,"default",{value:t,enumerable:!0}):o,t)),ue=t=>U(w({},"__esModule",{value:!0}),t);var C=M((P,$)=>{(function(t,e){"use strict";typeof define=="function"&&define.amd?define("stackframe",[],e):typeof P=="object"?$.exports=e():t.StackFrame=e()})(P,function(){"use strict";function t(d){return!isNaN(parseFloat(d))&&isFinite(d)}f(t,"_isNumber");function e(d){return d.charAt(0).toUpperCase()+d.substring(1)}f(e,"_capitalize");function o(d){return function(){return this[d]}}f(o,"_getter");var a=["isConstructor","isEval","isNative","isToplevel"],l=["columnNumber","lineNumber"],r=["fileName","functionName","source"],n=["args"],u=["evalOrigin"],i=a.concat(l,r,n,u);function c(d){if(d)for(var y=0;y<i.length;y++)d[i[y]]!==void 0&&this["set"+e(i[y])](d[i[y]])}f(c,"StackFrame"),c.prototype={getArgs:function(){return this.args},setArgs:function(d){if(Object.prototype.toString.call(d)!=="[object Array]")throw new TypeError("Args must be an Array");this.args=d},getEvalOrigin:function(){return this.evalOrigin},setEvalOrigin:function(d){if(d instanceof c)this.evalOrigin=d;else if(d instanceof Object)this.evalOrigin=new c(d);else throw new TypeError("Eval Origin must be an Object or StackFrame")},toString:function(){var d=this.getFileName()||"",y=this.getLineNumber()||"",E=this.getColumnNumber()||"",b=this.getFunctionName()||"";return this.getIsEval()?d?"[eval] ("+d+":"+y+":"+E+")":"[eval]:"+y+":"+E:b?b+" ("+d+":"+y+":"+E+")":d+":"+y+":"+E}},c.fromString=f(function(y){var E=y.indexOf("("),b=y.lastIndexOf(")"),te=y.substring(0,E),re=y.substring(E+1,b).split(","),T=y.substring(b+1);if(T.indexOf("@")===0)var N=/@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(T,""),ne=N[1],ie=N[2],oe=N[3];return new c({functionName:te,args:re||void 0,fileName:ne,lineNumber:ie||void 0,columnNumber:oe||void 0})},"StackFrame$$fromString");for(var s=0;s<a.length;s++)c.prototype["get"+e(a[s])]=o(a[s]),c.prototype["set"+e(a[s])]=function(d){return function(y){this[d]=!!y}}(a[s]);for(var m=0;m<l.length;m++)c.prototype["get"+e(l[m])]=o(l[m]),c.prototype["set"+e(l[m])]=function(d){return function(y){if(!t(y))throw new TypeError(d+" must be a Number");this[d]=Number(y)}}(l[m]);for(var p=0;p<r.length;p++)c.prototype["get"+e(r[p])]=o(r[p]),c.prototype["set"+e(r[p])]=function(d){return function(y){this[d]=String(y)}}(r[p]);return c})});var j=M((x,W)=>{(function(t,e){"use strict";typeof define=="function"&&define.amd?define("error-stack-parser",["stackframe"],e):typeof x=="object"?W.exports=e(C()):t.ErrorStackParser=e(t.StackFrame)})(x,f(function(e){"use strict";var o=/(^|@)\S+:\d+/,a=/^\s*at .*(\S+:\d+|\(native\))/m,l=/^(eval@)?(\[native code])?$/;return{parse:f(function(n){if(typeof n.stacktrace<"u"||typeof n["opera#sourceloc"]<"u")return this.parseOpera(n);if(n.stack&&n.stack.match(a))return this.parseV8OrIE(n);if(n.stack)return this.parseFFOrSafari(n);throw new Error("Cannot parse given Error object")},"ErrorStackParser$$parse"),extractLocation:f(function(n){if(n.indexOf(":")===-1)return[n];var u=/(.+?)(?::(\d+))?(?::(\d+))?$/,i=u.exec(n.replace(/[()]/g,""));return[i[1],i[2]||void 0,i[3]||void 0]},"ErrorStackParser$$extractLocation"),parseV8OrIE:f(function(n){var u=n.stack.split(` | ||
`).filter(function(i){return!!i.match(a)},this);return u.map(function(i){i.indexOf("(eval ")>-1&&(i=i.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(,.*$)/g,""));var c=i.replace(/^\s+/,"").replace(/\(eval code/g,"(").replace(/^.*?\s+/,""),s=c.match(/ (\(.+\)$)/);c=s?c.replace(s[0],""):c;var m=this.extractLocation(s?s[1]:c),p=s&&c||void 0,d=["eval","<anonymous>"].indexOf(m[0])>-1?void 0:m[0];return new e({functionName:p,fileName:d,lineNumber:m[1],columnNumber:m[2],source:i})},this)},"ErrorStackParser$$parseV8OrIE"),parseFFOrSafari:f(function(n){var u=n.stack.split(` | ||
`).filter(function(i){return!i.match(l)},this);return u.map(function(i){if(i.indexOf(" > eval")>-1&&(i=i.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),i.indexOf("@")===-1&&i.indexOf(":")===-1)return new e({functionName:i});var c=/((.*".+"[^@]*)?[^@]*)(?:@)/,s=i.match(c),m=s&&s[1]?s[1]:void 0,p=this.extractLocation(i.replace(c,""));return new e({functionName:m,fileName:p[0],lineNumber:p[1],columnNumber:p[2],source:i})},this)},"ErrorStackParser$$parseFFOrSafari"),parseOpera:f(function(n){return!n.stacktrace||n.message.indexOf(` | ||
`)>-1&&n.message.split(` | ||
`).length>n.stacktrace.split(` | ||
`).length?this.parseOpera9(n):n.stack?this.parseOpera11(n):this.parseOpera10(n)},"ErrorStackParser$$parseOpera"),parseOpera9:f(function(n){for(var u=/Line (\d+).*script (?:in )?(\S+)/i,i=n.message.split(` | ||
`),c=[],s=2,m=i.length;s<m;s+=2){var p=u.exec(i[s]);p&&c.push(new e({fileName:p[2],lineNumber:p[1],source:i[s]}))}return c},"ErrorStackParser$$parseOpera9"),parseOpera10:f(function(n){for(var u=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,i=n.stacktrace.split(` | ||
`),c=[],s=0,m=i.length;s<m;s+=2){var p=u.exec(i[s]);p&&c.push(new e({functionName:p[3]||void 0,fileName:p[2],lineNumber:p[1],source:i[s]}))}return c},"ErrorStackParser$$parseOpera10"),parseOpera11:f(function(n){var u=n.stack.split(` | ||
`).filter(function(i){return!!i.match(o)&&!i.match(/^Error created at/)},this);return u.map(function(i){var c=i.split("@"),s=this.extractLocation(c.pop()),m=c.shift()||"",p=m.replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0,d;m.match(/\(([^)]*)\)/)&&(d=m.replace(/^[^(]+\(([^)]*)\)$/,"$1"));var y=d===void 0||d==="[arguments not available]"?void 0:d.split(",");return new e({functionName:p,args:y,fileName:s[0],lineNumber:s[1],columnNumber:s[2],source:i})},this)},"ErrorStackParser$$parseOpera11")}},"ErrorStackParser"))});var Ne={};fe(Ne,{loadPyodide:()=>D,version:()=>O});var K=h(j());var v=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string"&&typeof process.browser>"u",F=v&&typeof module<"u"&&typeof module.exports<"u"&&typeof g<"u"&&typeof __dirname<"u",B=v&&!F,pe=typeof Deno<"u",H=!v&&!pe,z=H&&typeof window=="object"&&typeof document=="object"&&typeof document.createElement=="function"&&typeof sessionStorage=="object"&&typeof importScripts!="function",q=H&&typeof importScripts=="function"&&typeof self=="object",ke=typeof navigator=="object"&&typeof navigator.userAgent=="string"&&navigator.userAgent.indexOf("Chrome")==-1&&navigator.userAgent.indexOf("Safari")>-1;var J,k,X,V,I;async function A(){if(!v||(J=(await import(/* webpackIgnore */"node:url")).default,V=await import(/* webpackIgnore */"node:fs"),I=await import(/* webpackIgnore */"node:fs/promises"),X=(await import(/* webpackIgnore */"node:vm")).default,k=await import(/* webpackIgnore */"node:path"),L=k.sep,typeof g<"u"))return;let t=V,e=await import(/* webpackIgnore */"node:crypto"),o=await import(/* webpackIgnore */"ws"),a=await import(/* webpackIgnore */"node:child_process"),l={fs:t,crypto:e,ws:o,child_process:a};globalThis.require=function(r){return l[r]}}f(A,"initNodeModules");function me(t,e){return k.resolve(e||".",t)}f(me,"node_resolvePath");function ye(t,e){return e===void 0&&(e=location),new URL(t,e).toString()}f(ye,"browser_resolvePath");var R;v?R=me:R=ye;var L;v||(L="/");function ge(t,e){return t.startsWith("file://")&&(t=t.slice(7)),t.includes("://")?{response:fetch(t)}:{binary:I.readFile(t).then(o=>new Uint8Array(o.buffer,o.byteOffset,o.byteLength))}}f(ge,"node_getBinaryResponse");function he(t,e){let o=new URL(t,location);return{response:fetch(o,e?{integrity:e}:{})}}f(he,"browser_getBinaryResponse");var _;v?_=ge:_=he;async function G(t,e){let{response:o,binary:a}=_(t,e);if(a)return a;let l=await o;if(!l.ok)throw new Error(`Failed to load '${t}': request failed.`);return new Uint8Array(await l.arrayBuffer())}f(G,"loadBinaryFile");var S;if(z)S=f(async t=>await import(/* webpackIgnore */t),"loadScript");else if(q)S=f(async t=>{try{globalThis.importScripts(t)}catch(e){if(e instanceof TypeError)await import(/* webpackIgnore */t);else throw e}},"loadScript");else if(v)S=ve;else throw new Error("Cannot determine runtime environment");async function ve(t){t.startsWith("file://")&&(t=t.slice(7)),t.includes("://")?X.runInThisContext(await(await fetch(t)).text()):await import(/* webpackIgnore */J.pathToFileURL(t).href)}f(ve,"nodeLoadScript");async function Y(t){if(v){await A();let e=await I.readFile(t,{encoding:"utf8"});return JSON.parse(e)}else return await(await fetch(t)).json()}f(Y,"loadLockFile");async function Q(){if(F)return __dirname;let t;try{throw new Error}catch(a){t=a}let e=K.default.parse(t)[0].fileName;if(B){let a=await import(/* webpackIgnore */"node:path");return(await import(/* webpackIgnore */"node:url")).fileURLToPath(a.dirname(e))}let o=e.lastIndexOf(L);if(o===-1)throw new Error("Could not extract indexURL path from pyodide module location");return e.slice(0,o)}f(Q,"calculateDirname");function Z(t){let e=t.FS,o=t.FS.filesystems.MEMFS,a=t.PATH,l={DIR_MODE:16895,FILE_MODE:33279,mount:function(r){if(!r.opts.fileSystemHandle)throw new Error("opts.fileSystemHandle is required");return o.mount.apply(null,arguments)},syncfs:async(r,n,u)=>{try{let i=l.getLocalSet(r),c=await l.getRemoteSet(r),s=n?c:i,m=n?i:c;await l.reconcile(r,s,m),u(null)}catch(i){u(i)}},getLocalSet:r=>{let n=Object.create(null);function u(s){return s!=="."&&s!==".."}f(u,"isRealDir");function i(s){return m=>a.join2(s,m)}f(i,"toAbsolute");let c=e.readdir(r.mountpoint).filter(u).map(i(r.mountpoint));for(;c.length;){let s=c.pop(),m=e.stat(s);e.isDir(m.mode)&&c.push.apply(c,e.readdir(s).filter(u).map(i(s))),n[s]={timestamp:m.mtime,mode:m.mode}}return{type:"local",entries:n}},getRemoteSet:async r=>{let n=Object.create(null),u=await Ee(r.opts.fileSystemHandle);for(let[i,c]of u)i!=="."&&(n[a.join2(r.mountpoint,i)]={timestamp:c.kind==="file"?(await c.getFile()).lastModifiedDate:new Date,mode:c.kind==="file"?l.FILE_MODE:l.DIR_MODE});return{type:"remote",entries:n,handles:u}},loadLocalEntry:r=>{let u=e.lookupPath(r).node,i=e.stat(r);if(e.isDir(i.mode))return{timestamp:i.mtime,mode:i.mode};if(e.isFile(i.mode))return u.contents=o.getFileDataAsTypedArray(u),{timestamp:i.mtime,mode:i.mode,contents:u.contents};throw new Error("node type not supported")},storeLocalEntry:(r,n)=>{if(e.isDir(n.mode))e.mkdirTree(r,n.mode);else if(e.isFile(n.mode))e.writeFile(r,n.contents,{canOwn:!0});else throw new Error("node type not supported");e.chmod(r,n.mode),e.utime(r,n.timestamp,n.timestamp)},removeLocalEntry:r=>{var n=e.stat(r);e.isDir(n.mode)?e.rmdir(r):e.isFile(n.mode)&&e.unlink(r)},loadRemoteEntry:async r=>{if(r.kind==="file"){let n=await r.getFile();return{contents:new Uint8Array(await n.arrayBuffer()),mode:l.FILE_MODE,timestamp:n.lastModifiedDate}}else{if(r.kind==="directory")return{mode:l.DIR_MODE,timestamp:new Date};throw new Error("unknown kind: "+r.kind)}},storeRemoteEntry:async(r,n,u)=>{let i=r.get(a.dirname(n)),c=e.isFile(u.mode)?await i.getFileHandle(a.basename(n),{create:!0}):await i.getDirectoryHandle(a.basename(n),{create:!0});if(c.kind==="file"){let s=await c.createWritable();await s.write(u.contents),await s.close()}r.set(n,c)},removeRemoteEntry:async(r,n)=>{await r.get(a.dirname(n)).removeEntry(a.basename(n)),r.delete(n)},reconcile:async(r,n,u)=>{let i=0,c=[];Object.keys(n.entries).forEach(function(p){let d=n.entries[p],y=u.entries[p];(!y||e.isFile(d.mode)&&d.timestamp.getTime()>y.timestamp.getTime())&&(c.push(p),i++)}),c.sort();let s=[];if(Object.keys(u.entries).forEach(function(p){n.entries[p]||(s.push(p),i++)}),s.sort().reverse(),!i)return;let m=n.type==="remote"?n.handles:u.handles;for(let p of c){let d=a.normalize(p.replace(r.mountpoint,"/")).substring(1);if(u.type==="local"){let y=m.get(d),E=await l.loadRemoteEntry(y);l.storeLocalEntry(p,E)}else{let y=l.loadLocalEntry(p);await l.storeRemoteEntry(m,d,y)}}for(let p of s)if(u.type==="local")l.removeLocalEntry(p);else{let d=a.normalize(p.replace(r.mountpoint,"/")).substring(1);await l.removeRemoteEntry(m,d)}}};t.FS.filesystems.NATIVEFS_ASYNC=l}f(Z,"initializeNativeFS");var Ee=f(async t=>{let e=[];async function o(l){for await(let r of l.values())e.push(r),r.kind==="directory"&&await o(r)}f(o,"collect"),await o(t);let a=new Map;a.set(".",t);for(let l of e){let r=(await t.resolve(l)).join("/");a.set(r,l)}return a},"getFsHandles");function ee(t){let e={noImageDecoding:!0,noAudioDecoding:!0,noWasmDecoding:!1,preRun:Oe(t),quit(o,a){throw e.exited={status:o,toThrow:a},a},print:t.stdout,printErr:t.stderr,arguments:t.args,API:{config:t},locateFile:o=>t.indexURL+o,instantiateWasm:Re(t.indexURL)};return e}f(ee,"createSettings");function be(t){return function(e){let o="/";try{e.FS.mkdirTree(t)}catch(a){console.error(`Error occurred while making a home directory '${t}':`),console.error(a),console.error(`Using '${o}' for a home directory instead`),t=o}e.FS.chdir(t)}}f(be,"createHomeDirectory");function we(t){return function(e){Object.assign(e.ENV,t)}}f(we,"setEnvironment");function Se(t){return e=>{for(let o of t)e.FS.mkdirTree(o),e.FS.mount(e.FS.filesystems.NODEFS,{root:o},o)}}f(Se,"mountLocalDirectories");function _e(t){let e=G(t);return o=>{let a=o._py_version_major(),l=o._py_version_minor();o.FS.mkdirTree("/lib"),o.FS.mkdirTree(`/lib/python${a}.${l}/site-packages`),o.addRunDependency("install-stdlib"),e.then(r=>{o.FS.writeFile(`/lib/python${a}${l}.zip`,r)}).catch(r=>{console.error("Error occurred while installing the standard library:"),console.error(r)}).finally(()=>{o.removeRunDependency("install-stdlib")})}}f(_e,"installStdlib");function Oe(t){let e;return t.stdLibURL!=null?e=t.stdLibURL:e=t.indexURL+"python_stdlib.zip",[_e(e),be(t.env.HOME),we(t.env),Se(t._node_mounts),Z]}f(Oe,"getFileSystemInitializationFuncs");function Re(t){let{binary:e,response:o}=_(t+"pyodide.asm.wasm");return function(a,l){return async function(){try{let r;o?r=await WebAssembly.instantiateStreaming(o,a):r=await WebAssembly.instantiate(await e,a);let{instance:n,module:u}=r;typeof WasmOffsetConverter<"u"&&(wasmOffsetConverter=new WasmOffsetConverter(wasmBinary,u)),l(n,u)}catch(r){console.warn("wasm instantiation failed!"),console.warn(r)}}(),{}}}f(Re,"getInstantiateWasmFunc");var O="0.26.0";async function D(t={}){await A();let e=t.indexURL||await Q();e=R(e),e.endsWith("/")||(e+="/"),t.indexURL=e;let o={fullStdLib:!1,jsglobals:globalThis,stdin:globalThis.prompt?globalThis.prompt:void 0,lockFileURL:e+"pyodide-lock.json",args:[],_node_mounts:[],env:{},packageCacheDir:e,packages:[]},a=Object.assign(o,t);a.env.HOME||(a.env.HOME="/home/pyodide");let l=ee(a),r=l.API;if(r.lockFilePromise=Y(a.lockFileURL),typeof _createPyodideModule!="function"){let s=`${a.indexURL}pyodide.asm.js`;await S(s)}let n;if(t._loadSnapshot){let s=await t._loadSnapshot;ArrayBuffer.isView(s)?n=s:n=new Uint8Array(s),l.noInitialRun=!0,l.INITIAL_MEMORY=n.length}let u=await _createPyodideModule(l);if(l.exited)throw l.exited.toThrow;if(t.pyproxyToStringRepr&&r.setPyProxyToStringMethod(!0),r.version!==O)throw new Error(`Pyodide version does not match: '${O}' <==> '${r.version}'. If you updated the Pyodide version, make sure you also updated the 'indexURL' parameter passed to loadPyodide.`);u.locateFile=s=>{throw new Error("Didn't expect to load any more file_packager files!")};let i;n&&(i=r.restoreSnapshot(n));let c=r.finalizeBootstrap(i);return r.sys.path.insert(0,r.config.env.HOME),c.version.includes("dev")||r.setCdnUrl(`https://cdn.jsdelivr.net/pyodide/v${c.version}/full/`),r._pyodide.set_excepthook(),await r.packageIndexReady,r.initializeStreams(a.stdin,a.stdout,a.stderr),c}f(D,"loadPyodide");globalThis.loadPyodide=D;return ue(Ne);})(); | ||
"use strict";var loadPyodide=(()=>{var ae=Object.create;var w=Object.defineProperty;var se=Object.getOwnPropertyDescriptor;var ce=Object.getOwnPropertyNames;var le=Object.getPrototypeOf,de=Object.prototype.hasOwnProperty;var f=(t,e)=>w(t,"name",{value:e,configurable:!0}),g=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,o)=>(typeof require<"u"?require:e)[o]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+t+'" is not supported')});var U=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),fe=(t,e)=>{for(var o in e)w(t,o,{get:e[o],enumerable:!0})},M=(t,e,o,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let l of ce(e))!de.call(t,l)&&l!==o&&w(t,l,{get:()=>e[l],enumerable:!(a=se(e,l))||a.enumerable});return t};var h=(t,e,o)=>(o=t!=null?ae(le(t)):{},M(e||!t||!t.__esModule?w(o,"default",{value:t,enumerable:!0}):o,t)),ue=t=>M(w({},"__esModule",{value:!0}),t);var C=U((P,$)=>{(function(t,e){"use strict";typeof define=="function"&&define.amd?define("stackframe",[],e):typeof P=="object"?$.exports=e():t.StackFrame=e()})(P,function(){"use strict";function t(d){return!isNaN(parseFloat(d))&&isFinite(d)}f(t,"_isNumber");function e(d){return d.charAt(0).toUpperCase()+d.substring(1)}f(e,"_capitalize");function o(d){return function(){return this[d]}}f(o,"_getter");var a=["isConstructor","isEval","isNative","isToplevel"],l=["columnNumber","lineNumber"],n=["fileName","functionName","source"],r=["args"],u=["evalOrigin"],i=a.concat(l,n,r,u);function c(d){if(d)for(var y=0;y<i.length;y++)d[i[y]]!==void 0&&this["set"+e(i[y])](d[i[y]])}f(c,"StackFrame"),c.prototype={getArgs:function(){return this.args},setArgs:function(d){if(Object.prototype.toString.call(d)!=="[object Array]")throw new TypeError("Args must be an Array");this.args=d},getEvalOrigin:function(){return this.evalOrigin},setEvalOrigin:function(d){if(d instanceof c)this.evalOrigin=d;else if(d instanceof Object)this.evalOrigin=new c(d);else throw new TypeError("Eval Origin must be an Object or StackFrame")},toString:function(){var d=this.getFileName()||"",y=this.getLineNumber()||"",E=this.getColumnNumber()||"",b=this.getFunctionName()||"";return this.getIsEval()?d?"[eval] ("+d+":"+y+":"+E+")":"[eval]:"+y+":"+E:b?b+" ("+d+":"+y+":"+E+")":d+":"+y+":"+E}},c.fromString=f(function(y){var E=y.indexOf("("),b=y.lastIndexOf(")"),te=y.substring(0,E),ne=y.substring(E+1,b).split(","),T=y.substring(b+1);if(T.indexOf("@")===0)var N=/@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(T,""),re=N[1],ie=N[2],oe=N[3];return new c({functionName:te,args:ne||void 0,fileName:re,lineNumber:ie||void 0,columnNumber:oe||void 0})},"StackFrame$$fromString");for(var s=0;s<a.length;s++)c.prototype["get"+e(a[s])]=o(a[s]),c.prototype["set"+e(a[s])]=function(d){return function(y){this[d]=!!y}}(a[s]);for(var m=0;m<l.length;m++)c.prototype["get"+e(l[m])]=o(l[m]),c.prototype["set"+e(l[m])]=function(d){return function(y){if(!t(y))throw new TypeError(d+" must be a Number");this[d]=Number(y)}}(l[m]);for(var p=0;p<n.length;p++)c.prototype["get"+e(n[p])]=o(n[p]),c.prototype["set"+e(n[p])]=function(d){return function(y){this[d]=String(y)}}(n[p]);return c})});var j=U((x,W)=>{(function(t,e){"use strict";typeof define=="function"&&define.amd?define("error-stack-parser",["stackframe"],e):typeof x=="object"?W.exports=e(C()):t.ErrorStackParser=e(t.StackFrame)})(x,f(function(e){"use strict";var o=/(^|@)\S+:\d+/,a=/^\s*at .*(\S+:\d+|\(native\))/m,l=/^(eval@)?(\[native code])?$/;return{parse:f(function(r){if(typeof r.stacktrace<"u"||typeof r["opera#sourceloc"]<"u")return this.parseOpera(r);if(r.stack&&r.stack.match(a))return this.parseV8OrIE(r);if(r.stack)return this.parseFFOrSafari(r);throw new Error("Cannot parse given Error object")},"ErrorStackParser$$parse"),extractLocation:f(function(r){if(r.indexOf(":")===-1)return[r];var u=/(.+?)(?::(\d+))?(?::(\d+))?$/,i=u.exec(r.replace(/[()]/g,""));return[i[1],i[2]||void 0,i[3]||void 0]},"ErrorStackParser$$extractLocation"),parseV8OrIE:f(function(r){var u=r.stack.split(` | ||
`).filter(function(i){return!!i.match(a)},this);return u.map(function(i){i.indexOf("(eval ")>-1&&(i=i.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(,.*$)/g,""));var c=i.replace(/^\s+/,"").replace(/\(eval code/g,"(").replace(/^.*?\s+/,""),s=c.match(/ (\(.+\)$)/);c=s?c.replace(s[0],""):c;var m=this.extractLocation(s?s[1]:c),p=s&&c||void 0,d=["eval","<anonymous>"].indexOf(m[0])>-1?void 0:m[0];return new e({functionName:p,fileName:d,lineNumber:m[1],columnNumber:m[2],source:i})},this)},"ErrorStackParser$$parseV8OrIE"),parseFFOrSafari:f(function(r){var u=r.stack.split(` | ||
`).filter(function(i){return!i.match(l)},this);return u.map(function(i){if(i.indexOf(" > eval")>-1&&(i=i.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),i.indexOf("@")===-1&&i.indexOf(":")===-1)return new e({functionName:i});var c=/((.*".+"[^@]*)?[^@]*)(?:@)/,s=i.match(c),m=s&&s[1]?s[1]:void 0,p=this.extractLocation(i.replace(c,""));return new e({functionName:m,fileName:p[0],lineNumber:p[1],columnNumber:p[2],source:i})},this)},"ErrorStackParser$$parseFFOrSafari"),parseOpera:f(function(r){return!r.stacktrace||r.message.indexOf(` | ||
`)>-1&&r.message.split(` | ||
`).length>r.stacktrace.split(` | ||
`).length?this.parseOpera9(r):r.stack?this.parseOpera11(r):this.parseOpera10(r)},"ErrorStackParser$$parseOpera"),parseOpera9:f(function(r){for(var u=/Line (\d+).*script (?:in )?(\S+)/i,i=r.message.split(` | ||
`),c=[],s=2,m=i.length;s<m;s+=2){var p=u.exec(i[s]);p&&c.push(new e({fileName:p[2],lineNumber:p[1],source:i[s]}))}return c},"ErrorStackParser$$parseOpera9"),parseOpera10:f(function(r){for(var u=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,i=r.stacktrace.split(` | ||
`),c=[],s=0,m=i.length;s<m;s+=2){var p=u.exec(i[s]);p&&c.push(new e({functionName:p[3]||void 0,fileName:p[2],lineNumber:p[1],source:i[s]}))}return c},"ErrorStackParser$$parseOpera10"),parseOpera11:f(function(r){var u=r.stack.split(` | ||
`).filter(function(i){return!!i.match(o)&&!i.match(/^Error created at/)},this);return u.map(function(i){var c=i.split("@"),s=this.extractLocation(c.pop()),m=c.shift()||"",p=m.replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0,d;m.match(/\(([^)]*)\)/)&&(d=m.replace(/^[^(]+\(([^)]*)\)$/,"$1"));var y=d===void 0||d==="[arguments not available]"?void 0:d.split(",");return new e({functionName:p,args:y,fileName:s[0],lineNumber:s[1],columnNumber:s[2],source:i})},this)},"ErrorStackParser$$parseOpera11")}},"ErrorStackParser"))});var Ne={};fe(Ne,{loadPyodide:()=>D,version:()=>R});var K=h(j());var v=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string"&&typeof process.browser>"u",F=v&&typeof module<"u"&&typeof module.exports<"u"&&typeof g<"u"&&typeof __dirname<"u",B=v&&!F,pe=typeof Deno<"u",H=!v&&!pe,z=H&&typeof window=="object"&&typeof document=="object"&&typeof document.createElement=="function"&&typeof sessionStorage=="object"&&typeof importScripts!="function",q=H&&typeof importScripts=="function"&&typeof self=="object",ke=typeof navigator=="object"&&typeof navigator.userAgent=="string"&&navigator.userAgent.indexOf("Chrome")==-1&&navigator.userAgent.indexOf("Safari")>-1;var J,k,X,V,I;async function A(){if(!v||(J=(await import(/* webpackIgnore */"node:url")).default,V=await import(/* webpackIgnore */"node:fs"),I=await import(/* webpackIgnore */"node:fs/promises"),X=(await import(/* webpackIgnore */"node:vm")).default,k=await import(/* webpackIgnore */"node:path"),L=k.sep,typeof g<"u"))return;let t=V,e=await import(/* webpackIgnore */"node:crypto"),o=await import(/* webpackIgnore */"ws"),a=await import(/* webpackIgnore */"node:child_process"),l={fs:t,crypto:e,ws:o,child_process:a};globalThis.require=function(n){return l[n]}}f(A,"initNodeModules");function me(t,e){return k.resolve(e||".",t)}f(me,"node_resolvePath");function ye(t,e){return e===void 0&&(e=location),new URL(t,e).toString()}f(ye,"browser_resolvePath");var O;v?O=me:O=ye;var L;v||(L="/");function ge(t,e){return t.startsWith("file://")&&(t=t.slice(7)),t.includes("://")?{response:fetch(t)}:{binary:I.readFile(t).then(o=>new Uint8Array(o.buffer,o.byteOffset,o.byteLength))}}f(ge,"node_getBinaryResponse");function he(t,e){let o=new URL(t,location);return{response:fetch(o,e?{integrity:e}:{})}}f(he,"browser_getBinaryResponse");var _;v?_=ge:_=he;async function G(t,e){let{response:o,binary:a}=_(t,e);if(a)return a;let l=await o;if(!l.ok)throw new Error(`Failed to load '${t}': request failed.`);return new Uint8Array(await l.arrayBuffer())}f(G,"loadBinaryFile");var S;if(z)S=f(async t=>await import(/* webpackIgnore */t),"loadScript");else if(q)S=f(async t=>{try{globalThis.importScripts(t)}catch(e){if(e instanceof TypeError)await import(/* webpackIgnore */t);else throw e}},"loadScript");else if(v)S=ve;else throw new Error("Cannot determine runtime environment");async function ve(t){t.startsWith("file://")&&(t=t.slice(7)),t.includes("://")?X.runInThisContext(await(await fetch(t)).text()):await import(/* webpackIgnore */J.pathToFileURL(t).href)}f(ve,"nodeLoadScript");async function Y(t){if(v){await A();let e=await I.readFile(t,{encoding:"utf8"});return JSON.parse(e)}else return await(await fetch(t)).json()}f(Y,"loadLockFile");async function Q(){if(F)return __dirname;let t;try{throw new Error}catch(a){t=a}let e=K.default.parse(t)[0].fileName;if(B){let a=await import(/* webpackIgnore */"node:path");return(await import(/* webpackIgnore */"node:url")).fileURLToPath(a.dirname(e))}let o=e.lastIndexOf(L);if(o===-1)throw new Error("Could not extract indexURL path from pyodide module location");return e.slice(0,o)}f(Q,"calculateDirname");function Z(t){let e=t.FS,o=t.FS.filesystems.MEMFS,a=t.PATH,l={DIR_MODE:16895,FILE_MODE:33279,mount:function(n){if(!n.opts.fileSystemHandle)throw new Error("opts.fileSystemHandle is required");return o.mount.apply(null,arguments)},syncfs:async(n,r,u)=>{try{let i=l.getLocalSet(n),c=await l.getRemoteSet(n),s=r?c:i,m=r?i:c;await l.reconcile(n,s,m),u(null)}catch(i){u(i)}},getLocalSet:n=>{let r=Object.create(null);function u(s){return s!=="."&&s!==".."}f(u,"isRealDir");function i(s){return m=>a.join2(s,m)}f(i,"toAbsolute");let c=e.readdir(n.mountpoint).filter(u).map(i(n.mountpoint));for(;c.length;){let s=c.pop(),m=e.stat(s);e.isDir(m.mode)&&c.push.apply(c,e.readdir(s).filter(u).map(i(s))),r[s]={timestamp:m.mtime,mode:m.mode}}return{type:"local",entries:r}},getRemoteSet:async n=>{let r=Object.create(null),u=await Ee(n.opts.fileSystemHandle);for(let[i,c]of u)i!=="."&&(r[a.join2(n.mountpoint,i)]={timestamp:c.kind==="file"?(await c.getFile()).lastModifiedDate:new Date,mode:c.kind==="file"?l.FILE_MODE:l.DIR_MODE});return{type:"remote",entries:r,handles:u}},loadLocalEntry:n=>{let u=e.lookupPath(n).node,i=e.stat(n);if(e.isDir(i.mode))return{timestamp:i.mtime,mode:i.mode};if(e.isFile(i.mode))return u.contents=o.getFileDataAsTypedArray(u),{timestamp:i.mtime,mode:i.mode,contents:u.contents};throw new Error("node type not supported")},storeLocalEntry:(n,r)=>{if(e.isDir(r.mode))e.mkdirTree(n,r.mode);else if(e.isFile(r.mode))e.writeFile(n,r.contents,{canOwn:!0});else throw new Error("node type not supported");e.chmod(n,r.mode),e.utime(n,r.timestamp,r.timestamp)},removeLocalEntry:n=>{var r=e.stat(n);e.isDir(r.mode)?e.rmdir(n):e.isFile(r.mode)&&e.unlink(n)},loadRemoteEntry:async n=>{if(n.kind==="file"){let r=await n.getFile();return{contents:new Uint8Array(await r.arrayBuffer()),mode:l.FILE_MODE,timestamp:r.lastModifiedDate}}else{if(n.kind==="directory")return{mode:l.DIR_MODE,timestamp:new Date};throw new Error("unknown kind: "+n.kind)}},storeRemoteEntry:async(n,r,u)=>{let i=n.get(a.dirname(r)),c=e.isFile(u.mode)?await i.getFileHandle(a.basename(r),{create:!0}):await i.getDirectoryHandle(a.basename(r),{create:!0});if(c.kind==="file"){let s=await c.createWritable();await s.write(u.contents),await s.close()}n.set(r,c)},removeRemoteEntry:async(n,r)=>{await n.get(a.dirname(r)).removeEntry(a.basename(r)),n.delete(r)},reconcile:async(n,r,u)=>{let i=0,c=[];Object.keys(r.entries).forEach(function(p){let d=r.entries[p],y=u.entries[p];(!y||e.isFile(d.mode)&&d.timestamp.getTime()>y.timestamp.getTime())&&(c.push(p),i++)}),c.sort();let s=[];if(Object.keys(u.entries).forEach(function(p){r.entries[p]||(s.push(p),i++)}),s.sort().reverse(),!i)return;let m=r.type==="remote"?r.handles:u.handles;for(let p of c){let d=a.normalize(p.replace(n.mountpoint,"/")).substring(1);if(u.type==="local"){let y=m.get(d),E=await l.loadRemoteEntry(y);l.storeLocalEntry(p,E)}else{let y=l.loadLocalEntry(p);await l.storeRemoteEntry(m,d,y)}}for(let p of s)if(u.type==="local")l.removeLocalEntry(p);else{let d=a.normalize(p.replace(n.mountpoint,"/")).substring(1);await l.removeRemoteEntry(m,d)}}};t.FS.filesystems.NATIVEFS_ASYNC=l}f(Z,"initializeNativeFS");var Ee=f(async t=>{let e=[];async function o(l){for await(let n of l.values())e.push(n),n.kind==="directory"&&await o(n)}f(o,"collect"),await o(t);let a=new Map;a.set(".",t);for(let l of e){let n=(await t.resolve(l)).join("/");a.set(n,l)}return a},"getFsHandles");function ee(t){let e={noImageDecoding:!0,noAudioDecoding:!0,noWasmDecoding:!1,preRun:Re(t),quit(o,a){throw e.exited={status:o,toThrow:a},a},print:t.stdout,printErr:t.stderr,arguments:t.args,API:{config:t},locateFile:o=>t.indexURL+o,instantiateWasm:Oe(t.indexURL)};return e}f(ee,"createSettings");function be(t){return function(e){let o="/";try{e.FS.mkdirTree(t)}catch(a){console.error(`Error occurred while making a home directory '${t}':`),console.error(a),console.error(`Using '${o}' for a home directory instead`),t=o}e.FS.chdir(t)}}f(be,"createHomeDirectory");function we(t){return function(e){Object.assign(e.ENV,t)}}f(we,"setEnvironment");function Se(t){return e=>{for(let o of t)e.FS.mkdirTree(o),e.FS.mount(e.FS.filesystems.NODEFS,{root:o},o)}}f(Se,"mountLocalDirectories");function _e(t){let e=G(t);return o=>{let a=o._py_version_major(),l=o._py_version_minor();o.FS.mkdirTree("/lib"),o.FS.mkdirTree(`/lib/python${a}.${l}/site-packages`),o.addRunDependency("install-stdlib"),e.then(n=>{o.FS.writeFile(`/lib/python${a}${l}.zip`,n)}).catch(n=>{console.error("Error occurred while installing the standard library:"),console.error(n)}).finally(()=>{o.removeRunDependency("install-stdlib")})}}f(_e,"installStdlib");function Re(t){let e;return t.stdLibURL!=null?e=t.stdLibURL:e=t.indexURL+"python_stdlib.zip",[_e(e),be(t.env.HOME),we(t.env),Se(t._node_mounts),Z]}f(Re,"getFileSystemInitializationFuncs");function Oe(t){let{binary:e,response:o}=_(t+"pyodide.asm.wasm");return function(a,l){return async function(){try{let n;o?n=await WebAssembly.instantiateStreaming(o,a):n=await WebAssembly.instantiate(await e,a);let{instance:r,module:u}=n;typeof WasmOffsetConverter<"u"&&(wasmOffsetConverter=new WasmOffsetConverter(wasmBinary,u)),l(r,u)}catch(n){console.warn("wasm instantiation failed!"),console.warn(n)}}(),{}}}f(Oe,"getInstantiateWasmFunc");var R="0.26.1";async function D(t={}){await A();let e=t.indexURL||await Q();e=O(e),e.endsWith("/")||(e+="/"),t.indexURL=e;let o={fullStdLib:!1,jsglobals:globalThis,stdin:globalThis.prompt?globalThis.prompt:void 0,lockFileURL:e+"pyodide-lock.json",args:[],_node_mounts:[],env:{},packageCacheDir:e,packages:[],enableRunUntilComplete:!1},a=Object.assign(o,t);a.env.HOME||(a.env.HOME="/home/pyodide");let l=ee(a),n=l.API;if(n.lockFilePromise=Y(a.lockFileURL),typeof _createPyodideModule!="function"){let s=`${a.indexURL}pyodide.asm.js`;await S(s)}let r;if(t._loadSnapshot){let s=await t._loadSnapshot;ArrayBuffer.isView(s)?r=s:r=new Uint8Array(s),l.noInitialRun=!0,l.INITIAL_MEMORY=r.length}let u=await _createPyodideModule(l);if(l.exited)throw l.exited.toThrow;if(t.pyproxyToStringRepr&&n.setPyProxyToStringMethod(!0),n.version!==R)throw new Error(`Pyodide version does not match: '${R}' <==> '${n.version}'. If you updated the Pyodide version, make sure you also updated the 'indexURL' parameter passed to loadPyodide.`);u.locateFile=s=>{throw new Error("Didn't expect to load any more file_packager files!")};let i;r&&(i=n.restoreSnapshot(r));let c=n.finalizeBootstrap(i);return n.sys.path.insert(0,n.config.env.HOME),c.version.includes("dev")||n.setCdnUrl(`https://cdn.jsdelivr.net/pyodide/v${c.version}/full/`),n._pyodide.set_excepthook(),await n.packageIndexReady,n.initializeStreams(a.stdin,a.stdout,a.stderr),c}f(D,"loadPyodide");globalThis.loadPyodide=D;return ue(Ne);})(); | ||
try{Object.assign(exports,loadPyodide)}catch(_){} | ||
globalThis.loadPyodide=loadPyodide.loadPyodide; | ||
//# sourceMappingURL=pyodide.js.map |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14063547
7565