@basthon/browser-bundle 0.61.1 → 0.61.3

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.
Files changed (45) hide show
  1. package/lib/{0.61.1 → 0.61.3}/python3/basthon.tar +0 -0
  2. package/lib/{0.61.1/python3-old → 0.61.3/python3}/modules/IPython-0.0.1-py3-none-any.whl +0 -0
  3. package/lib/{0.61.1 → 0.61.3}/python3/modules/graphviz-0.0.1-py3-none-any.whl +0 -0
  4. package/lib/{0.61.1 → 0.61.3}/python3/modules/p5-0.0.1-py3-none-any.whl +0 -0
  5. package/lib/{0.61.1/python3-old → 0.61.3/python3}/modules/proj4py-0.0.1-py3-none-any.whl +0 -0
  6. package/lib/{0.61.1 → 0.61.3}/python3/modules/rcviz-0.0.1-py3-none-any.whl +0 -0
  7. package/lib/{0.61.1 → 0.61.3}/python3/modules/requests-0.0.1-py3-none-any.whl +0 -0
  8. package/lib/{0.61.1/python3-old → 0.61.3/python3}/modules/turtle-0.0.1-py3-none-any.whl +0 -0
  9. package/lib/{0.61.1 → 0.61.3}/python3/modules/tutor-0.0.1-py3-none-any.whl +0 -0
  10. package/lib/{0.61.1 → 0.61.3}/python3/repodata.json +1 -1
  11. package/lib/0.61.3/python3-old/basthon.data +0 -0
  12. package/lib/{0.61.1 → 0.61.3}/python3-old/basthon.js +1 -1
  13. package/lib/{0.61.1/python3 → 0.61.3/python3-old}/modules/IPython-0.0.1-py3-none-any.whl +0 -0
  14. package/lib/{0.61.1 → 0.61.3}/python3-old/modules/graphviz-0.0.1-py3-none-any.whl +0 -0
  15. package/lib/{0.61.1 → 0.61.3}/python3-old/modules/ipythonblocks-0.0.1-py3-none-any.whl +0 -0
  16. package/lib/{0.61.1 → 0.61.3}/python3-old/modules/ivp-0.0.1-py3-none-any.whl +0 -0
  17. package/lib/{0.61.1 → 0.61.3}/python3-old/modules/lolviz-0.0.1-py3-none-any.whl +0 -0
  18. package/lib/{0.61.1 → 0.61.3}/python3-old/modules/p5-0.0.1-py3-none-any.whl +0 -0
  19. package/lib/{0.61.1/python3 → 0.61.3/python3-old}/modules/proj4py-0.0.1-py3-none-any.whl +0 -0
  20. package/lib/{0.61.1 → 0.61.3}/python3-old/modules/rcviz-0.0.1-py3-none-any.whl +0 -0
  21. package/lib/{0.61.1 → 0.61.3}/python3-old/modules/requests-0.0.1-py3-none-any.whl +0 -0
  22. package/lib/{0.61.1/python3 → 0.61.3/python3-old}/modules/turtle-0.0.1-py3-none-any.whl +0 -0
  23. package/lib/{0.61.1 → 0.61.3}/python3-old/modules/tutor-0.0.1-py3-none-any.whl +0 -0
  24. package/lib/595817d88d82727f463b.wasm +0 -0
  25. package/lib/kernel-base_lib_index_js.js +1 -1
  26. package/lib/kernel-base_lib_index_js.js.map +1 -1
  27. package/lib/kernel-javascript_lib_index_js-node_modules_babel_runtime_helpers_esm_defineProperty_js-node_-82f1e0.js +1 -1
  28. package/lib/kernel-javascript_lib_index_js-node_modules_babel_runtime_helpers_esm_defineProperty_js-node_-82f1e0.js.map +1 -1
  29. package/lib/kernel-ocaml_lib_index_js-node_modules_babel_runtime_helpers_esm_defineProperty_js-node_modul-226bf5.js +1 -1
  30. package/lib/kernel-ocaml_lib_index_js-node_modules_babel_runtime_helpers_esm_defineProperty_js-node_modul-226bf5.js.map +1 -1
  31. package/lib/kernel-python3-old_lib_index_js-node_modules_babel_runtime_helpers_esm_defineProperty_js-node-f36a96.js +1 -1
  32. package/lib/kernel-python3-old_lib_index_js-node_modules_babel_runtime_helpers_esm_defineProperty_js-node-f36a96.js.map +1 -1
  33. package/lib/kernel-python3_lib_index_js-node_modules_babel_runtime_helpers_esm_defineProperty_js-node_mod-1ab697.js +1 -1
  34. package/lib/kernel-python3_lib_index_js-node_modules_babel_runtime_helpers_esm_defineProperty_js-node_mod-1ab697.js.map +1 -1
  35. package/lib/vendors-node_modules_sql_js_dist_sql-wasm_js-node_modules_sql_js_dist_sql-wasm_wasm_asset-url-ea4ee4.js +1 -1
  36. package/lib/vendors-node_modules_sql_js_dist_sql-wasm_js-node_modules_sql_js_dist_sql-wasm_wasm_asset-url-ea4ee4.js.map +1 -1
  37. package/package.json +3 -3
  38. package/lib/0.61.1/python3-old/basthon.data +0 -0
  39. package/lib/057823fecaede6350cf9.wasm +0 -0
  40. /package/lib/{0.61.1 → 0.61.3}/python3/modules/extern/pytutor-main.min.css +0 -0
  41. /package/lib/{0.61.1 → 0.61.3}/python3/modules/extern/pytutor-main.min.js +0 -0
  42. /package/lib/{0.61.1 → 0.61.3}/python3/modules/extern/pytutor-main.min.js.map +0 -0
  43. /package/lib/{0.61.1 → 0.61.3}/python3-old/modules/extern/pytutor-main.min.css +0 -0
  44. /package/lib/{0.61.1 → 0.61.3}/python3-old/modules/extern/pytutor-main.min.js +0 -0
  45. /package/lib/{0.61.1 → 0.61.3}/python3-old/modules/extern/pytutor-main.min.js.map +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"kernel-python3-old_lib_index_js-node_modules_babel_runtime_helpers_esm_defineProperty_js-node-f36a96.js","mappings":"ozDACA,IAIaA,EAAgB,SAAAC,IAAAC,EAAAA,EAAAA,GAAAF,EAAAC,GAAA,IAwHzBE,EANAC,EAvBAC,EAxCAC,EApBAC,EA/ByBC,EAAAC,EAAAT,GACzB,SAAAA,EAAYU,GAAS,IAAAC,EACbC,EAYgJ,OAbnIC,EAAAA,EAAAA,GAAA,KAAAb,IAEjBW,EAAAH,EAAAM,KAAA,KAAMJ,IAIDK,aAAe,CAAC,uEAGrBJ,EAAKK,WAAa,KAClBL,EAAKM,cAAgB,GAErBN,EAAKI,aAAaG,QAAQ,GAADC,OAAIR,EAAKS,cAAa,wBAC/CT,EAAKI,aAAgG,QAAhFH,EAAKF,aAAyC,EAASA,EAAQW,mBAAgC,IAAPT,EAAgBA,EAAKD,EAAKI,aAAaJ,CACxJ,CAuKC,OAtKDW,EAAAA,EAAAA,GAAAtB,EAAA,EAAAuB,IAAA,qBAAAC,MAGA,WAAqC,IAAl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G,MAAM,KAAMrB,UAChC,CEZe,SAASmI,EAAiBX,GACvC,IAAIY,EAAwB,mBAARC,IAAqB,IAAIA,SAAQnI,EAuBrD,OAtBAiI,EAAmB,SAA0BX,GAC3C,GAAc,OAAVA,ICPkCc,EDOEd,GCNsB,IAAzDU,SAASK,SAASnJ,KAAKkJ,GAAIE,QAAQ,kBDMQ,OAAOhB,ECP5C,IAA2Bc,EDQtC,GAAqB,mBAAVd,EACT,MAAM,IAAIV,UAAU,sDAEtB,QAAsB,IAAXsB,EAAwB,CACjC,GAAIA,EAAOK,IAAIjB,GAAQ,OAAOY,EAAO9E,IAAIkE,GACzCY,EAAOM,IAAIlB,EAAOmB,EACpB,CACA,SAASA,IACP,OAAO,EAAUnB,EAAOxH,WAAW,EAAA0G,EAAA,GAAevG,MAAM8G,YAC1D,CASA,OARA0B,EAAQ5B,UAAYb,OAAOc,OAAOQ,EAAMT,UAAW,CACjDE,YAAa,CACXnH,MAAO6I,EACPvC,YAAY,EACZE,UAAU,EACVD,cAAc,MAGX,EAAAI,EAAA,GAAekC,EAASnB,EACjC,EACOW,EAAiBX,EAC1B,C","sources":["webpack://@basthon/browser-bundle/../kernel-python3-old/lib/kernel.js","webpack://@basthon/browser-bundle/../../node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js","webpack://@basthon/browser-bundle/../../node_modules/@babel/runtime/helpers/esm/defineProperty.js","webpack://@basthon/browser-bundle/../../node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js","webpack://@basthon/browser-bundle/../../node_modules/@babel/runtime/helpers/esm/inherits.js","webpack://@basthon/browser-bundle/../../node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js","webpack://@basthon/browser-bundle/../../node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@basthon/browser-bundle/../../node_modules/@babel/runtime/helpers/esm/construct.js","webpack://@basthon/browser-bundle/../../node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js","webpack://@basthon/browser-bundle/../../node_modules/@babel/runtime/helpers/esm/wrapNativeSuper.js","webpack://@basthon/browser-bundle/../../node_modules/@babel/runtime/helpers/esm/isNativeFunction.js"],"sourcesContent":["import { KernelBase } from \"@basthon/kernel-base\";\nconst PYODIDE_VERSION = \"0.16.1\";\n/**\n * A Python kernel that satisfies Basthon's API.\n */\nexport class KernelPython3Old extends KernelBase {\n constructor(options) {\n var _a;\n super(options);\n /**\n * Where to find pyodide.js (private).\n */\n this._pyodideURLs = [\n `https://cdn.jsdelivr.net/pyodide/v{PYODIDE_VERSION}/full/pyodide.js`,\n ];\n this.__kernel__ = null;\n this.pythonVersion = \"\";\n // for locally installed Pyodide\n this._pyodideURLs.unshift(`${this.basthonRoot()}/pyodide/pyodide.js`);\n this._pyodideURLs = (_a = options === null || options === void 0 ? void 0 : options.pyodideURLs) !== null && _a !== void 0 ? _a : this._pyodideURLs;\n }\n /**\n * Get the URL of Basthon modules dir.\n */\n basthonModulesRoot(absolute = false) {\n return this.basthonRoot(absolute) + \"/modules\";\n }\n language() {\n return \"python3-old\";\n }\n languageName() {\n return \"Python 3 Old\";\n }\n moduleExts() {\n return [\"py\"];\n }\n /**\n * What to do when loaded (private).\n */\n async _onload() {\n const pyodide = window.pyodide;\n // get the version of Python from Python\n this.pythonVersion = pyodide.runPython(\"import platform ; platform.python_version()\");\n // this is for avoiding \"Unknown package 'basthon'\" error\n // but can be removed with 0.17.0 since it is fixed upstream\n const consoleErrorBck = console.error;\n console.error = () => { };\n await pyodide.loadPackage(this.basthonRoot(true) + \"/basthon.js\");\n console.error = consoleErrorBck;\n // importing basthon to get it's kernel\n await pyodide.runPythonAsync(\"import basthon as __basthon__\");\n // kernel lookup\n this.__kernel__ = pyodide.globals.__basthon__.__kernel__;\n // removing basthon from global namespace\n await pyodide.runPythonAsync(\"del __basthon__\");\n }\n /**\n * Start the Basthon kernel asynchronously.\n */\n async launch() {\n let pyodideURL = this._pyodideURLs[0];\n for (let url of this._pyodideURLs) {\n url = url.replace(\"{PYODIDE_VERSION}\", PYODIDE_VERSION);\n try {\n const response = await fetch(url, { method: \"HEAD\" });\n if (response.ok) {\n pyodideURL = url;\n break;\n }\n }\n catch (e) { }\n }\n // forcing Pyodide to look at the right location for other files\n window.languagePluginUrl =\n pyodideURL.substr(0, pyodideURL.lastIndexOf(\"/\")) + \"/\";\n try {\n await KernelPython3Old.loadScript(pyodideURL);\n }\n catch (error) {\n console.log(error);\n console.error(\"Can't load pyodide.js\");\n throw error;\n }\n if (window.languagePluginLoader == null) {\n throw new Error(\"Can't load pyodide.js\");\n }\n await window.languagePluginLoader.then(this._onload.bind(this), function () {\n throw new Error(\"Can't load Python from Pyodide\");\n });\n }\n /**\n * Execution count getter overload.\n */\n get execution_count() {\n return this.__kernel__.execution_count();\n }\n /**\n * Basthon async code evaluation function.\n */\n async evalAsync(code, outCallback, errCallback, data = null) {\n if (typeof outCallback === \"undefined\") {\n outCallback = function (text) {\n console.log(text);\n };\n }\n if (typeof errCallback === \"undefined\") {\n errCallback = function (text) {\n console.error(text);\n };\n }\n // loading dependencies are loaded by eval\n return await this.__kernel__.eval(code, outCallback, errCallback, data);\n }\n /**\n * Restart the kernel.\n */\n restart() {\n return this.__kernel__.restart();\n }\n /**\n * Put a file on the local (emulated) filesystem.\n */\n async putFile(filename, content) {\n this.__kernel__.put_file(filename, content);\n }\n /**\n * Put an importable module on the local (emulated) filesystem\n * and load dependencies.\n */\n async putModule(filename, content) {\n return this.__kernel__.put_module(filename, content);\n }\n /**\n * List modules launched via putModule.\n */\n userModules() {\n return this.__kernel__.user_modules();\n }\n /**\n * Get a file content from the VFS.\n */\n getFile(path) {\n return this.__kernel__.get_file(path);\n }\n /**\n * Get a user module file content.\n */\n getUserModuleFile(filename) {\n return this.__kernel__.get_user_module_file(filename);\n }\n /**\n * Is the source ready to be evaluated or want we more?\n * Usefull to set ps1/ps2 for teminal prompt.\n */\n more(source) {\n return this.__kernel__.more(source);\n }\n /**\n * Mimic the CPython's REPL banner.\n */\n banner() {\n /* We don't return this.__kernel__.banner();\n * since the banner should be available ASAP.\n * In tests, we check this.banner() === this.__kernel__.banner().\n */\n return `Python 3.8.2 (default, Dec 25 2020 21:20:57) on WebAssembly VM\\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.`;\n }\n /**\n * Complete a code at the end (usefull for tab completion).\n *\n * Returns an array of two elements: the list of completions\n * and the start index.\n */\n complete(code) {\n return this.__kernel__.complete(code);\n }\n /**\n * Change current directory (Python's virtual FS).\n */\n chdir(path) {\n window.pyodide._module.FS.chdir(path);\n }\n /**\n * Create directory (Python's virtual FS).\n */\n mkdir(path) {\n window.pyodide._module.FS.mkdir(path);\n }\n}\n","export default function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n return self;\n}","import toPropertyKey from \"./toPropertyKey.js\";\nexport default function _defineProperty(obj, key, value) {\n key = toPropertyKey(key);\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}","export default function _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n Object.defineProperty(subClass, \"prototype\", {\n writable: false\n });\n if (superClass) setPrototypeOf(subClass, superClass);\n}","import _typeof from \"./typeof.js\";\nimport assertThisInitialized from \"./assertThisInitialized.js\";\nexport default function _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n } else if (call !== void 0) {\n throw new TypeError(\"Derived constructors may only return object or undefined\");\n }\n return assertThisInitialized(self);\n}","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n return _setPrototypeOf(o, p);\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nimport isNativeReflectConstruct from \"./isNativeReflectConstruct.js\";\nexport default function _construct(Parent, args, Class) {\n if (isNativeReflectConstruct()) {\n _construct = Reflect.construct.bind();\n } else {\n _construct = function _construct(Parent, args, Class) {\n var a = [null];\n a.push.apply(a, args);\n var Constructor = Function.bind.apply(Parent, a);\n var instance = new Constructor();\n if (Class) setPrototypeOf(instance, Class.prototype);\n return instance;\n };\n }\n return _construct.apply(null, arguments);\n}","export default function _isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n try {\n Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\n}","import getPrototypeOf from \"./getPrototypeOf.js\";\nimport setPrototypeOf from \"./setPrototypeOf.js\";\nimport isNativeFunction from \"./isNativeFunction.js\";\nimport construct from \"./construct.js\";\nexport default function _wrapNativeSuper(Class) {\n var _cache = typeof Map === \"function\" ? new Map() : undefined;\n _wrapNativeSuper = function _wrapNativeSuper(Class) {\n if (Class === null || !isNativeFunction(Class)) return Class;\n if (typeof Class !== \"function\") {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n if (typeof _cache !== \"undefined\") {\n if (_cache.has(Class)) return _cache.get(Class);\n _cache.set(Class, Wrapper);\n }\n function Wrapper() {\n return construct(Class, arguments, getPrototypeOf(this).constructor);\n }\n Wrapper.prototype = Object.create(Class.prototype, {\n constructor: {\n value: Wrapper,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n return setPrototypeOf(Wrapper, Class);\n };\n return _wrapNativeSuper(Class);\n}","export default function _isNativeFunction(fn) {\n return Function.toString.call(fn).indexOf(\"[native code]\") !== -1;\n}"],"names":["KernelPython3Old","_KernelBase","_inherits","_putModule","_putFile","_evalAsync","_launch","_onload2","_super","_createSuper","options","_this","_a","_classCallCheck","call","_pyodideURLs","__kernel__","pythonVersion","unshift","concat","basthonRoot","pyodideURLs","_createClass","key","value","absolute","arguments","length","undefined","this","_asyncToGenerator","_regeneratorRuntime","_callee","pyodide","consoleErrorBck","_context","prev","next","window","runPython","console","error","loadPackage","runPythonAsync","globals","__basthon__","stop","apply","_callee2","pyodideURL","_iterator","_step","url","_context2","_createForOfIteratorHelper","s","n","done","replace","fetch","method","sent","ok","abrupt","t0","t1","e","f","finish","languagePluginUrl","substr","lastIndexOf","loadScript","t2","log","languagePluginLoader","Error","then","_onload","bind","get","execution_count","_callee3","code","outCallback","errCallback","data","_args3","_context3","text","eval","_x","_x2","_x3","restart","_callee4","filename","content","_context4","put_file","_x4","_x5","_callee5","_context5","put_module","_x6","_x7","user_modules","path","get_file","get_user_module_file","source","more","complete","_module","FS","chdir","mkdir","KernelBase","_assertThisInitialized","self","ReferenceError","_defineProperty","obj","Object","defineProperty","enumerable","configurable","writable","_getPrototypeOf","o","setPrototypeOf","getPrototypeOf","__proto__","subClass","superClass","TypeError","prototype","create","constructor","_possibleConstructorReturn","_setPrototypeOf","p","_construct","Parent","args","Class","Reflect","construct","sham","Proxy","Boolean","valueOf","a","push","instance","Function","_wrapNativeSuper","_cache","Map","fn","toString","indexOf","has","set","Wrapper"],"sourceRoot":""}
1
+ {"version":3,"file":"kernel-python3-old_lib_index_js-node_modules_babel_runtime_helpers_esm_defineProperty_js-node-f36a96.js","mappings":"ozDACA,IAIaA,EAAgB,SAAAC,IAAAC,EAAAA,EAAAA,GAAAF,EAAAC,GAAA,IAwHzBE,EANAC,EAvBAC,EAxCAC,EApBAC,EA/ByBC,EAAAC,EAAAT,GACzB,SAAAA,EAAYU,GAAS,IAAAC,EACbC,EAYgJ,OA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,EACxC,IAEE,OADAC,QAAQd,UAAUe,QAAQ1I,KAAKqI,QAAQC,UAAUG,QAAS,IAAI,WAAa,MACpE,CACT,CAAE,MAAOrF,GACP,OAAO,CACT,CACF,CDPM,GACWiF,QAAQC,UAAUrE,OAElB,SAAoBiE,EAAQC,EAAMC,GAC7C,IAAIO,EAAI,CAAC,MACTA,EAAEC,KAAK3G,MAAM0G,EAAGR,GAChB,IACIU,EAAW,IADGC,SAAS7E,KAAKhC,MAAMiG,EAAQS,IAG9C,OADIP,IAAO,EAAAf,EAAA,GAAewB,EAAUT,EAAMT,WACnCkB,CACT,EAEKZ,EAAWhG,MAAM,KAAMrB,UAChC,CEZe,SAASmI,EAAiBX,GACvC,IAAIY,EAAwB,mBAARC,IAAqB,IAAIA,SAAQnI,EAuBrD,OAtBAiI,EAAmB,SAA0BX,GAC3C,GAAc,OAAVA,ICPO,SAA2Bc,GACxC,IACE,OAAgE,IAAzDJ,SAASK,SAASnJ,KAAKkJ,GAAIE,QAAQ,gBAC5C,CAAE,MAAOhG,GACP,MAAqB,mBAAP8F,CAChB,CACF,CDC2B,CAAiBd,GAAQ,OAAOA,EACvD,GAAqB,mBAAVA,EACT,MAAM,IAAIV,UAAU,sDAEtB,QAAsB,IAAXsB,EAAwB,CACjC,GAAIA,EAAOK,IAAIjB,GAAQ,OAAOY,EAAO9E,IAAIkE,GACzCY,EAAOM,IAAIlB,EAAOmB,EACpB,CACA,SAASA,IACP,OAAO,EAAUnB,EAAOxH,WAAW,EAAA0G,EAAA,GAAevG,MAAM8G,YAC1D,CASA,OARA0B,EAAQ5B,UAAYb,OAAOc,OAAOQ,EAAMT,UAAW,CACjDE,YAAa,CACXnH,MAAO6I,EACPvC,YAAY,EACZE,UAAU,EACVD,cAAc,MAGX,EAAAI,EAAA,GAAekC,EAASnB,EACjC,EACOW,EAAiBX,EAC1B,C","sources":["webpack://@basthon/browser-bundle/../kernel-python3-old/lib/kernel.js","webpack://@basthon/browser-bundle/../../node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js","webpack://@basthon/browser-bundle/../../node_modules/@babel/runtime/helpers/esm/defineProperty.js","webpack://@basthon/browser-bundle/../../node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js","webpack://@basthon/browser-bundle/../../node_modules/@babel/runtime/helpers/esm/inherits.js","webpack://@basthon/browser-bundle/../../node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js","webpack://@basthon/browser-bundle/../../node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@basthon/browser-bundle/../../node_modules/@babel/runtime/helpers/esm/construct.js","webpack://@basthon/browser-bundle/../../node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js","webpack://@basthon/browser-bundle/../../node_modules/@babel/runtime/helpers/esm/wrapNativeSuper.js","webpack://@basthon/browser-bundle/../../node_modules/@babel/runtime/helpers/esm/isNativeFunction.js"],"sourcesContent":["import { KernelBase } from \"@basthon/kernel-base\";\nconst PYODIDE_VERSION = \"0.16.1\";\n/**\n * A Python kernel that satisfies Basthon's API.\n */\nexport class KernelPython3Old extends KernelBase {\n constructor(options) {\n var _a;\n super(options);\n /**\n * Where to find pyodide.js (private).\n */\n this._pyodideURLs = [\n `https://cdn.jsdelivr.net/pyodide/v{PYODIDE_VERSION}/full/pyodide.js`,\n ];\n this.__kernel__ = null;\n this.pythonVersion = \"\";\n // for locally installed Pyodide\n this._pyodideURLs.unshift(`${this.basthonRoot()}/pyodide/pyodide.js`);\n this._pyodideURLs = (_a = options === null || options === void 0 ? void 0 : options.pyodideURLs) !== null && _a !== void 0 ? _a : this._pyodideURLs;\n }\n /**\n * Get the URL of Basthon modules dir.\n */\n basthonModulesRoot(absolute = false) {\n return this.basthonRoot(absolute) + \"/modules\";\n }\n language() {\n return \"python3-old\";\n }\n languageName() {\n return \"Python 3 Old\";\n }\n moduleExts() {\n return [\"py\"];\n }\n /**\n * What to do when loaded (private).\n */\n async _onload() {\n const pyodide = window.pyodide;\n // get the version of Python from Python\n this.pythonVersion = pyodide.runPython(\"import platform ; platform.python_version()\");\n // this is for avoiding \"Unknown package 'basthon'\" error\n // but can be removed with 0.17.0 since it is fixed upstream\n const consoleErrorBck = console.error;\n console.error = () => { };\n await pyodide.loadPackage(this.basthonRoot(true) + \"/basthon.js\");\n console.error = consoleErrorBck;\n // importing basthon to get it's kernel\n await pyodide.runPythonAsync(\"import basthon as __basthon__\");\n // kernel lookup\n this.__kernel__ = pyodide.globals.__basthon__.__kernel__;\n // removing basthon from global namespace\n await pyodide.runPythonAsync(\"del __basthon__\");\n }\n /**\n * Start the Basthon kernel asynchronously.\n */\n async launch() {\n let pyodideURL = this._pyodideURLs[0];\n for (let url of this._pyodideURLs) {\n url = url.replace(\"{PYODIDE_VERSION}\", PYODIDE_VERSION);\n try {\n const response = await fetch(url, { method: \"HEAD\" });\n if (response.ok) {\n pyodideURL = url;\n break;\n }\n }\n catch (e) { }\n }\n // forcing Pyodide to look at the right location for other files\n window.languagePluginUrl =\n pyodideURL.substr(0, pyodideURL.lastIndexOf(\"/\")) + \"/\";\n try {\n await KernelPython3Old.loadScript(pyodideURL);\n }\n catch (error) {\n console.log(error);\n console.error(\"Can't load pyodide.js\");\n throw error;\n }\n if (window.languagePluginLoader == null) {\n throw new Error(\"Can't load pyodide.js\");\n }\n await window.languagePluginLoader.then(this._onload.bind(this), function () {\n throw new Error(\"Can't load Python from Pyodide\");\n });\n }\n /**\n * Execution count getter overload.\n */\n get execution_count() {\n return this.__kernel__.execution_count();\n }\n /**\n * Basthon async code evaluation function.\n */\n async evalAsync(code, outCallback, errCallback, data = null) {\n if (typeof outCallback === \"undefined\") {\n outCallback = function (text) {\n console.log(text);\n };\n }\n if (typeof errCallback === \"undefined\") {\n errCallback = function (text) {\n console.error(text);\n };\n }\n // loading dependencies are loaded by eval\n return await this.__kernel__.eval(code, outCallback, errCallback, data);\n }\n /**\n * Restart the kernel.\n */\n restart() {\n return this.__kernel__.restart();\n }\n /**\n * Put a file on the local (emulated) filesystem.\n */\n async putFile(filename, content) {\n this.__kernel__.put_file(filename, content);\n }\n /**\n * Put an importable module on the local (emulated) filesystem\n * and load dependencies.\n */\n async putModule(filename, content) {\n return this.__kernel__.put_module(filename, content);\n }\n /**\n * List modules launched via putModule.\n */\n userModules() {\n return this.__kernel__.user_modules();\n }\n /**\n * Get a file content from the VFS.\n */\n getFile(path) {\n return this.__kernel__.get_file(path);\n }\n /**\n * Get a user module file content.\n */\n getUserModuleFile(filename) {\n return this.__kernel__.get_user_module_file(filename);\n }\n /**\n * Is the source ready to be evaluated or want we more?\n * Usefull to set ps1/ps2 for teminal prompt.\n */\n more(source) {\n return this.__kernel__.more(source);\n }\n /**\n * Mimic the CPython's REPL banner.\n */\n banner() {\n /* We don't return this.__kernel__.banner();\n * since the banner should be available ASAP.\n * In tests, we check this.banner() === this.__kernel__.banner().\n */\n return `Python 3.8.2 (default, Dec 25 2020 21:20:57) on WebAssembly VM\\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.`;\n }\n /**\n * Complete a code at the end (usefull for tab completion).\n *\n * Returns an array of two elements: the list of completions\n * and the start index.\n */\n complete(code) {\n return this.__kernel__.complete(code);\n }\n /**\n * Change current directory (Python's virtual FS).\n */\n chdir(path) {\n window.pyodide._module.FS.chdir(path);\n }\n /**\n * Create directory (Python's virtual FS).\n */\n mkdir(path) {\n window.pyodide._module.FS.mkdir(path);\n }\n}\n","export default function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n return self;\n}","import toPropertyKey from \"./toPropertyKey.js\";\nexport default function _defineProperty(obj, key, value) {\n key = toPropertyKey(key);\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}","export default function _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n Object.defineProperty(subClass, \"prototype\", {\n writable: false\n });\n if (superClass) setPrototypeOf(subClass, superClass);\n}","import _typeof from \"./typeof.js\";\nimport assertThisInitialized from \"./assertThisInitialized.js\";\nexport default function _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n } else if (call !== void 0) {\n throw new TypeError(\"Derived constructors may only return object or undefined\");\n }\n return assertThisInitialized(self);\n}","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n return _setPrototypeOf(o, p);\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nimport isNativeReflectConstruct from \"./isNativeReflectConstruct.js\";\nexport default function _construct(Parent, args, Class) {\n if (isNativeReflectConstruct()) {\n _construct = Reflect.construct.bind();\n } else {\n _construct = function _construct(Parent, args, Class) {\n var a = [null];\n a.push.apply(a, args);\n var Constructor = Function.bind.apply(Parent, a);\n var instance = new Constructor();\n if (Class) setPrototypeOf(instance, Class.prototype);\n return instance;\n };\n }\n return _construct.apply(null, arguments);\n}","export default function _isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n try {\n Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\n}","import getPrototypeOf from \"./getPrototypeOf.js\";\nimport setPrototypeOf from \"./setPrototypeOf.js\";\nimport isNativeFunction from \"./isNativeFunction.js\";\nimport construct from \"./construct.js\";\nexport default function _wrapNativeSuper(Class) {\n var _cache = typeof Map === \"function\" ? new Map() : undefined;\n _wrapNativeSuper = function _wrapNativeSuper(Class) {\n if (Class === null || !isNativeFunction(Class)) return Class;\n if (typeof Class !== \"function\") {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n if (typeof _cache !== \"undefined\") {\n if (_cache.has(Class)) return _cache.get(Class);\n _cache.set(Class, Wrapper);\n }\n function Wrapper() {\n return construct(Class, arguments, getPrototypeOf(this).constructor);\n }\n Wrapper.prototype = Object.create(Class.prototype, {\n constructor: {\n value: Wrapper,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n return setPrototypeOf(Wrapper, Class);\n };\n return _wrapNativeSuper(Class);\n}","export default function _isNativeFunction(fn) {\n try {\n return Function.toString.call(fn).indexOf(\"[native code]\") !== -1;\n } catch (e) {\n return typeof fn === \"function\";\n }\n}"],"names":["KernelPython3Old","_KernelBase","_inherits","_putModule","_putFile","_evalAsync","_launch","_onload2","_super","_createSuper","options","_this","_a","_classCallCheck","call","_pyodideURLs","__kernel__","pythonVersion","unshift","concat","basthonRoot","pyodideURLs","_createClass","key","value","absolute","arguments","length","undefined","this","_asyncToGenerator","_regeneratorRuntime","_callee","pyodide","consoleErrorBck","_context","prev","next","window","runPython","console","error","loadPackage","runPythonAsync","globals","__basthon__","stop","apply","_callee2","pyodideURL","_iterator","_step","url","_context2","_createForOfIteratorHelper","s","n","done","replace","fetch","method","sent","ok","abrupt","t0","t1","e","f","finish","languagePluginUrl","substr","lastIndexOf","loadScript","t2","log","languagePluginLoader","Error","then","_onload","bind","get","execution_count","_callee3","code","outCallback","errCallback","data","_args3","_context3","text","eval","_x","_x2","_x3","restart","_callee4","filename","content","_context4","put_file","_x4","_x5","_callee5","_context5","put_module","_x6","_x7","user_modules","path","get_file","get_user_module_file","source","more","complete","_module","FS","chdir","mkdir","KernelBase","_assertThisInitialized","self","ReferenceError","_defineProperty","obj","Object","defineProperty","enumerable","configurable","writable","_getPrototypeOf","o","setPrototypeOf","getPrototypeOf","__proto__","subClass","superClass","TypeError","prototype","create","constructor","_possibleConstructorReturn","_setPrototypeOf","p","_construct","Parent","args","Class","Reflect","construct","sham","Proxy","Boolean","valueOf","a","push","instance","Function","_wrapNativeSuper","_cache","Map","fn","toString","indexOf","has","set","Wrapper"],"sourceRoot":""}
@@ -1,2 +1,2 @@
1
- "use strict";(self.webpackChunk_basthon_browser_bundle=self.webpackChunk_basthon_browser_bundle||[]).push([["kernel-python3_lib_index_js-node_modules_babel_runtime_helpers_esm_defineProperty_js-node_mod-1ab697"],{5144:(e,t,n)=>{n.r(t),n.d(t,{KernelPython3:()=>h});var r=n(4795),o=n(9249),i=n(7371),u=n(5754),a=n(1987),c=n(5058),s=n(2841),l=n.n(s),f=n(6806);function p(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return d(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return d(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,u=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return u=e.done,e},e:function(e){a=!0,i=e},f:function(){try{u||null==n.return||n.return()}finally{if(a)throw i}}}}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function y(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,c.Z)(e);if(t){var o=(0,c.Z)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,a.Z)(this,n)}}var h=function(e){(0,u.Z)(d,e);var t,n,a,c,s,f=y(d);function d(e){var t,n;return(0,o.Z)(this,d),(t=f.call(this,e))._pyodideURLs=["https://cdn.jsdelivr.net/pyodide/v{PYODIDE_VERSION}/full/pyodide.js"],t.__kernel__=null,t.pythonVersion="",t._pyodideURLs.unshift("".concat(t.basthonRoot(),"/pyodide/pyodide.js")),t._pyodideURLs=null!==(n=null==e?void 0:e.pyodideURLs)&&void 0!==n?n:t._pyodideURLs,t}return(0,i.Z)(d,[{key:"basthonModulesRoot",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.basthonRoot(e)+"/modules"}},{key:"language",value:function(){return"python3"}},{key:"languageName",value:function(){return"Python 3"}},{key:"moduleExts",value:function(){return["py"]}},{key:"_onload",value:(s=(0,r.Z)(l().mark((function e(){var t,n,r,o,i,u;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(t=window.pyodide,n=t._api.repodata_packages,r=0,o=Object.keys(n);r<o.length;r++)i=o[r],(u=n[i]).file_name=u.file_name.replace("{basthonRoot}",this.basthonRoot(!0));return this.pythonVersion=t.runPython("import platform ; platform.python_version()"),e.next=6,t.loadPackage("basthon");case 6:this.__kernel__=t.pyimport("basthon").__kernel__;case 7:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"launch",value:(c=(0,r.Z)(l().mark((function e(){var t,n,r,o;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=this._pyodideURLs[0],n=p(this._pyodideURLs),e.prev=2,n.s();case 4:if((r=n.n()).done){e.next=20;break}return o=(o=r.value).replace("{PYODIDE_VERSION}","0.23.2"),e.prev=7,e.next=10,fetch(o,{method:"HEAD"});case 10:if(!e.sent.ok){e.next=14;break}return t=o,e.abrupt("break",20);case 14:e.next=18;break;case 16:e.prev=16,e.t0=e.catch(7);case 18:e.next=4;break;case 20:e.next=25;break;case 22:e.prev=22,e.t1=e.catch(2),n.e(e.t1);case 25:return e.prev=25,n.f(),e.finish(25);case 28:return e.prev=28,e.next=31,d.loadScript(t);case 31:e.next=38;break;case 33:throw e.prev=33,e.t2=e.catch(28),console.log(e.t2),console.error("Can't load pyodide.js"),e.t2;case 38:if(null!=window.loadPyodide){e.next=41;break}throw console.log("window.loadPyodide is null!"),new Error("Can't load pyodide.js");case 41:return e.prev=41,e.next=44,window.loadPyodide({lockFileURL:this.basthonRoot()+"/repodata.json"});case 44:window.pyodide=e.sent,e.next=52;break;case 47:throw e.prev=47,e.t3=e.catch(41),console.log(e.t3),console.error("Can't load Python from Pyodide"),e.t3;case 52:return e.next=54,this._onload();case 54:case"end":return e.stop()}}),e,this,[[2,22,25,28],[7,16],[28,33],[41,47]])}))),function(){return c.apply(this,arguments)})},{key:"execution_count",get:function(){return this.__kernel__.execution_count()}},{key:"evalAsync",value:(a=(0,r.Z)(l().mark((function e(t,n,r){var o,i,u,a=arguments;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=a.length>3&&void 0!==a[3]?a[3]:null,void 0===n&&(n=function(e){console.log(e)}),void 0===r&&(r=function(e){console.error(e)}),e.next=5,this.__kernel__.eval(t,n,r,o);case 5:if(i=e.sent,window.pyodide.isPyProxy(i)){e.next=8;break}throw i;case 8:return u=i.toJs({create_proxies:!1,dict_converter:Object.fromEntries}),i.destroy(),e.abrupt("return",u);case 11:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return a.apply(this,arguments)})},{key:"restart",value:function(){return this.__kernel__.restart()}},{key:"putFile",value:(n=(0,r.Z)(l().mark((function e(t,n){return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.__kernel__.put_file(t,n);case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"putModule",value:(t=(0,r.Z)(l().mark((function e(t,n){return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.__kernel__.put_module(t,n);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)}))),function(e,n){return t.apply(this,arguments)})},{key:"userModules",value:function(){var e=this.__kernel__.user_modules();if(!window.pyodide.isPyProxy(e))return e;var t=e.toJs();return e.destroy(),t}},{key:"getFile",value:function(e){return this.__kernel__.get_file(e).toJs()}},{key:"getUserModuleFile",value:function(e){return this.__kernel__.get_user_module_file(e).toJs()}},{key:"more",value:function(e){return this.__kernel__.more(e)}},{key:"banner",value:function(){return'Python 3.11.2 (main, May 3 2023 04:00:05) on WebAssembly/Emscripten\nType "help", "copyright", "credits" or "license" for more information.'}},{key:"complete",value:function(e){var t=this.__kernel__.complete(e);if(!window.pyodide.isPyProxy(t))return t;var n=t.toJs();return t.destroy(),n}},{key:"chdir",value:function(e){window.pyodide._module.FS.chdir(e)}},{key:"mkdir",value:function(e){window.pyodide._module.FS.mkdir(e)}}]),d}(f.H)},753:(e,t,n)=>{function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(t,{Z:()=>r})},6666:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(5850);function o(e,t,n){return(t=(0,r.Z)(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},5058:(e,t,n)=>{function r(e){return r=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},r(e)}n.d(t,{Z:()=>r})},5754:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(8960);function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&(0,r.Z)(e,t)}},1987:(e,t,n)=>{n.d(t,{Z:()=>i});var r=n(6522),o=n(753);function i(e,t){if(t&&("object"===(0,r.Z)(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return(0,o.Z)(e)}},8960:(e,t,n)=>{function r(e,t){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},r(e,t)}n.d(t,{Z:()=>r})},8501:(e,t,n)=>{n.d(t,{Z:()=>u});var r=n(5058),o=n(8960);function i(e,t,n){return i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}()?Reflect.construct.bind():function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&(0,o.Z)(i,n.prototype),i},i.apply(null,arguments)}function u(e){var t="function"==typeof Map?new Map:void 0;return u=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,u)}function u(){return i(e,arguments,(0,r.Z)(this).constructor)}return u.prototype=Object.create(e.prototype,{constructor:{value:u,enumerable:!1,writable:!0,configurable:!0}}),(0,o.Z)(u,e)},u(e)}}}]);
1
+ "use strict";(self.webpackChunk_basthon_browser_bundle=self.webpackChunk_basthon_browser_bundle||[]).push([["kernel-python3_lib_index_js-node_modules_babel_runtime_helpers_esm_defineProperty_js-node_mod-1ab697"],{5144:(e,t,n)=>{n.r(t),n.d(t,{KernelPython3:()=>h});var r=n(4795),o=n(9249),i=n(7371),u=n(5754),a=n(1987),c=n(5058),s=n(2841),l=n.n(s),f=n(6806);function p(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return d(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return d(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,u=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return u=e.done,e},e:function(e){a=!0,i=e},f:function(){try{u||null==n.return||n.return()}finally{if(a)throw i}}}}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function y(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,c.Z)(e);if(t){var o=(0,c.Z)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,a.Z)(this,n)}}var h=function(e){(0,u.Z)(d,e);var t,n,a,c,s,f=y(d);function d(e){var t,n;return(0,o.Z)(this,d),(t=f.call(this,e))._pyodideURLs=["https://cdn.jsdelivr.net/pyodide/v{PYODIDE_VERSION}/full/pyodide.js"],t.__kernel__=null,t.pythonVersion="",t._pyodideURLs.unshift("".concat(t.basthonRoot(),"/pyodide/pyodide.js")),t._pyodideURLs=null!==(n=null==e?void 0:e.pyodideURLs)&&void 0!==n?n:t._pyodideURLs,t}return(0,i.Z)(d,[{key:"basthonModulesRoot",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.basthonRoot(e)+"/modules"}},{key:"language",value:function(){return"python3"}},{key:"languageName",value:function(){return"Python 3"}},{key:"moduleExts",value:function(){return["py"]}},{key:"_onload",value:(s=(0,r.Z)(l().mark((function e(){var t,n,r,o,i,u;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(t=window.pyodide,n=t._api.repodata_packages,r=0,o=Object.keys(n);r<o.length;r++)i=o[r],(u=n[i]).file_name=u.file_name.replace("{basthonRoot}",this.basthonRoot(!0));return this.pythonVersion=t.runPython("import platform ; platform.python_version()"),e.next=6,t.loadPackage("basthon");case 6:this.__kernel__=t.pyimport("basthon").__kernel__;case 7:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"launch",value:(c=(0,r.Z)(l().mark((function e(){var t,n,r,o;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=this._pyodideURLs[0],n=p(this._pyodideURLs),e.prev=2,n.s();case 4:if((r=n.n()).done){e.next=20;break}return o=(o=r.value).replace("{PYODIDE_VERSION}","0.23.2"),e.prev=7,e.next=10,fetch(o,{method:"HEAD"});case 10:if(!e.sent.ok){e.next=14;break}return t=o,e.abrupt("break",20);case 14:e.next=18;break;case 16:e.prev=16,e.t0=e.catch(7);case 18:e.next=4;break;case 20:e.next=25;break;case 22:e.prev=22,e.t1=e.catch(2),n.e(e.t1);case 25:return e.prev=25,n.f(),e.finish(25);case 28:return e.prev=28,e.next=31,d.loadScript(t);case 31:e.next=38;break;case 33:throw e.prev=33,e.t2=e.catch(28),console.log(e.t2),console.error("Can't load pyodide.js"),e.t2;case 38:if(null!=window.loadPyodide){e.next=41;break}throw console.log("window.loadPyodide is null!"),new Error("Can't load pyodide.js");case 41:return e.prev=41,e.next=44,window.loadPyodide({lockFileURL:this.basthonRoot()+"/repodata.json"});case 44:window.pyodide=e.sent,e.next=52;break;case 47:throw e.prev=47,e.t3=e.catch(41),console.log(e.t3),console.error("Can't load Python from Pyodide"),e.t3;case 52:return e.next=54,this._onload();case 54:case"end":return e.stop()}}),e,this,[[2,22,25,28],[7,16],[28,33],[41,47]])}))),function(){return c.apply(this,arguments)})},{key:"execution_count",get:function(){return this.__kernel__.execution_count()}},{key:"evalAsync",value:(a=(0,r.Z)(l().mark((function e(t,n,r){var o,i,u,a=arguments;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=a.length>3&&void 0!==a[3]?a[3]:null,void 0===n&&(n=function(e){console.log(e)}),void 0===r&&(r=function(e){console.error(e)}),e.next=5,this.__kernel__.eval(t,n,r,o);case 5:if((i=e.sent)instanceof window.pyodide.ffi.PyProxy){e.next=8;break}throw i;case 8:return u=i.toJs({create_proxies:!1,dict_converter:Object.fromEntries}),i.destroy(),e.abrupt("return",u);case 11:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return a.apply(this,arguments)})},{key:"restart",value:function(){return this.__kernel__.restart()}},{key:"putFile",value:(n=(0,r.Z)(l().mark((function e(t,n){return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.__kernel__.put_file(t,n);case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"putModule",value:(t=(0,r.Z)(l().mark((function e(t,n){return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.__kernel__.put_module(t,n);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)}))),function(e,n){return t.apply(this,arguments)})},{key:"userModules",value:function(){var e=this.__kernel__.user_modules();if(!(e instanceof window.pyodide.ffi.PyProxy))return e;var t=e.toJs();return e.destroy(),t}},{key:"getFile",value:function(e){return this.__kernel__.get_file(e).toJs()}},{key:"getUserModuleFile",value:function(e){return this.__kernel__.get_user_module_file(e).toJs()}},{key:"more",value:function(e){return this.__kernel__.more(e)}},{key:"banner",value:function(){return'Python 3.11.2 (main, May 3 2023 04:00:05) on WebAssembly/Emscripten\nType "help", "copyright", "credits" or "license" for more information.'}},{key:"complete",value:function(e){var t=this.__kernel__.complete(e);if(!(t instanceof window.pyodide.ffi.PyProxy))return t;var n=t.toJs();return t.destroy(),n}},{key:"chdir",value:function(e){window.pyodide._module.FS.chdir(e)}},{key:"mkdir",value:function(e){window.pyodide._module.FS.mkdir(e)}}]),d}(f.H)},753:(e,t,n)=>{function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(t,{Z:()=>r})},6666:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(5850);function o(e,t,n){return(t=(0,r.Z)(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},5058:(e,t,n)=>{function r(e){return r=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},r(e)}n.d(t,{Z:()=>r})},5754:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(8960);function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&(0,r.Z)(e,t)}},1987:(e,t,n)=>{n.d(t,{Z:()=>i});var r=n(6522),o=n(753);function i(e,t){if(t&&("object"===(0,r.Z)(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return(0,o.Z)(e)}},8960:(e,t,n)=>{function r(e,t){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},r(e,t)}n.d(t,{Z:()=>r})},8501:(e,t,n)=>{n.d(t,{Z:()=>u});var r=n(5058),o=n(8960);function i(e,t,n){return i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}()?Reflect.construct.bind():function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&(0,o.Z)(i,n.prototype),i},i.apply(null,arguments)}function u(e){var t="function"==typeof Map?new Map:void 0;return u=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return i(e,arguments,(0,r.Z)(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),(0,o.Z)(n,e)},u(e)}}}]);
2
2
  //# sourceMappingURL=kernel-python3_lib_index_js-node_modules_babel_runtime_helpers_esm_defineProperty_js-node_mod-1ab697.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"kernel-python3_lib_index_js-node_modules_babel_runtime_helpers_esm_defineProperty_js-node_mod-1ab697.js","mappings":"izDACA,IAIaA,EAAa,SAAAC,IAAAC,EAAAA,EAAAA,GAAAF,EAAAC,GAAA,IAqItBE,EANAC,EAhCAC,EA/CAC,EAjBAC,EA/BsBC,EAAAC,EAAAT,GACtB,SAAAA,EAAYU,GAAS,IAAAC,EACbC,EAYgJ,OAbnIC,EAAAA,EAAAA,GAAA,KAAAb,IAEjBW,EAAAH,EAAAM,KAAA,KAAMJ,IAIDK,aAAe,CAAC,uEAGrBJ,EAAKK,WAAa,KAClBL,EAAKM,cAAgB,GAErBN,EAAKI,aAAaG,QAAQ,GAADC,OAAIR,EAAKS,cAAa,wBAC/CT,EAAKI,aAAgG,QAAhFH,EAAKF,aAAyC,EAASA,EAAQW,mBAAgC,IAAPT,EAAgBA,EAAKD,EAAKI,aAAaJ,CACxJ,CA8LC,OA7LDW,EAAAA,EAAAA,GAAAtB,EAAA,EAAAuB,IAAA,qBAAAC,MAGA,WAAqC,IAAlBC,EAAQC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,IAAAA,UAAA,GACvB,OAAOG,KAAKT,YAAYK,GAAY,UACxC,GAAC,CAAAF,IAAA,WAAAC,MACD,WACI,MAAO,SACX,GAAC,CAAAD,IAAA,eAAAC,MAC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iBX,EAC1B,C","sources":["webpack://@basthon/browser-bundle/../kernel-python3/lib/kernel.js","webpack://@basthon/browser-bundle/../../node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js","webpack://@basthon/browser-bundle/../../node_modules/@babel/runtime/helpers/esm/defineProperty.js","webpack://@basthon/browser-bundle/../../node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js","webpack://@basthon/browser-bundle/../../node_modules/@babel/runtime/helpers/esm/inherits.js","webpack://@basthon/browser-bundle/../../node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js","webpack://@basthon/browser-bundle/../../node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@basthon/browser-bundle/../../node_modules/@babel/runtime/helpers/esm/construct.js","webpack://@basthon/browser-bundle/../../node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js","webpack://@basthon/browser-bundle/../../node_modules/@babel/runtime/helpers/esm/wrapNativeSuper.js","webpack://@basthon/browser-bundle/../../node_modules/@babel/runtime/helpers/esm/isNativeFunction.js"],"sourcesContent":["import { KernelBase } from \"@basthon/kernel-base\";\nconst PYODIDE_VERSION = \"0.23.2\";\n/**\n * A Python kernel that satisfies Basthon's API.\n */\nexport class KernelPython3 extends KernelBase {\n constructor(options) {\n var _a;\n super(options);\n /**\n * Where to find pyodide.js (private).\n */\n this._pyodideURLs = [\n `https://cdn.jsdelivr.net/pyodide/v{PYODIDE_VERSION}/full/pyodide.js`,\n ];\n this.__kernel__ = null;\n this.pythonVersion = \"\";\n // for locally installed Pyodide\n this._pyodideURLs.unshift(`${this.basthonRoot()}/pyodide/pyodide.js`);\n this._pyodideURLs = (_a = options === null || options === void 0 ? void 0 : options.pyodideURLs) !== null && _a !== void 0 ? _a : this._pyodideURLs;\n }\n /**\n * Get the URL of Basthon modules dir.\n */\n basthonModulesRoot(absolute = false) {\n return this.basthonRoot(absolute) + \"/modules\";\n }\n language() {\n return \"python3\";\n }\n languageName() {\n return \"Python 3\";\n }\n moduleExts() {\n return [\"py\"];\n }\n /**\n * What to do when loaded (private).\n */\n async _onload() {\n const pyodide = window.pyodide;\n // reformat repodata\n const packages = pyodide._api.repodata_packages;\n for (let p of Object.keys(packages)) {\n const item = packages[p];\n item.file_name = item.file_name.replace(\"{basthonRoot}\", this.basthonRoot(true));\n }\n // get the version of Python from Python\n this.pythonVersion = pyodide.runPython(\"import platform ; platform.python_version()\");\n // load basthon and get kernel\n await pyodide.loadPackage(\"basthon\");\n this.__kernel__ = pyodide.pyimport(\"basthon\").__kernel__;\n }\n /**\n * Start the Basthon kernel asynchronously.\n */\n async launch() {\n let pyodideURL = this._pyodideURLs[0];\n for (let url of this._pyodideURLs) {\n url = url.replace(\"{PYODIDE_VERSION}\", PYODIDE_VERSION);\n try {\n const response = await fetch(url, { method: \"HEAD\" });\n if (response.ok) {\n pyodideURL = url;\n break;\n }\n }\n catch (e) { }\n }\n try {\n await KernelPython3.loadScript(pyodideURL);\n }\n catch (error) {\n console.log(error);\n console.error(\"Can't load pyodide.js\");\n throw error;\n }\n if (window.loadPyodide == null) {\n console.log(\"window.loadPyodide is null!\");\n throw new Error(\"Can't load pyodide.js\");\n }\n try {\n // loading with custom repodata.json\n window.pyodide = await window.loadPyodide({\n lockFileURL: this.basthonRoot() + \"/repodata.json\",\n });\n }\n catch (error) {\n console.log(error);\n console.error(\"Can't load Python from Pyodide\");\n throw error;\n }\n await this._onload();\n }\n /**\n * Execution count getter overload.\n */\n get execution_count() {\n return this.__kernel__.execution_count();\n }\n /**\n * Basthon async code evaluation function.\n */\n async evalAsync(code, outCallback, errCallback, data = null) {\n if (typeof outCallback === \"undefined\") {\n outCallback = function (text) {\n console.log(text);\n };\n }\n if (typeof errCallback === \"undefined\") {\n errCallback = function (text) {\n console.error(text);\n };\n }\n // dependencies are loaded by eval\n const proxy = await this.__kernel__.eval(code, outCallback, errCallback, data);\n // when an error occures, proxy should be the error message\n if (!window.pyodide.isPyProxy(proxy))\n throw proxy;\n const res = proxy.toJs({\n create_proxies: false,\n dict_converter: Object.fromEntries,\n });\n proxy.destroy();\n return res;\n }\n /**\n * Restart the kernel.\n */\n restart() {\n return this.__kernel__.restart();\n }\n /**\n * Put a file on the local (emulated) filesystem.\n */\n async putFile(filename, content) {\n this.__kernel__.put_file(filename, content);\n }\n /**\n * Put an importable module on the local (emulated) filesystem\n * and load dependencies.\n */\n async putModule(filename, content) {\n return await this.__kernel__.put_module(filename, content);\n }\n /**\n * List modules launched via putModule.\n */\n userModules() {\n const proxy = this.__kernel__.user_modules();\n if (!window.pyodide.isPyProxy(proxy))\n return proxy;\n const res = proxy.toJs();\n proxy.destroy();\n return res;\n }\n /**\n * Get a file content from the VFS.\n */\n getFile(path) {\n return this.__kernel__.get_file(path).toJs();\n }\n /**\n * Get a user module file content.\n */\n getUserModuleFile(filename) {\n return this.__kernel__.get_user_module_file(filename).toJs();\n }\n /**\n * Is the source ready to be evaluated or want we more?\n * Usefull to set ps1/ps2 for teminal prompt.\n */\n more(source) {\n return this.__kernel__.more(source);\n }\n /**\n * Mimic the CPython's REPL banner.\n */\n banner() {\n /* We don't return this.__kernel__.banner();\n * since the banner should be available ASAP.\n * In tests, we check this.banner() === this.__kernel__.banner().\n */\n return `Python 3.11.2 (main, May 3 2023 04:00:05) on WebAssembly/Emscripten\\nType \\\"help\\\", \\\"copyright\\\", \\\"credits\\\" or \\\"license\\\" for more information.`;\n }\n /**\n * Complete a code at the end (usefull for tab completion).\n *\n * Returns an array of two elements: the list of completions\n * and the start index.\n */\n complete(code) {\n const proxy = this.__kernel__.complete(code);\n if (!window.pyodide.isPyProxy(proxy))\n return proxy;\n const res = proxy.toJs();\n proxy.destroy();\n return res;\n }\n /**\n * Change current directory (Python's virtual FS).\n */\n chdir(path) {\n window.pyodide._module.FS.chdir(path);\n }\n /**\n * Create directory (Python's virtual FS).\n */\n mkdir(path) {\n window.pyodide._module.FS.mkdir(path);\n }\n}\n","export default function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n return self;\n}","import toPropertyKey from \"./toPropertyKey.js\";\nexport default function _defineProperty(obj, key, value) {\n key = toPropertyKey(key);\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}","export default function _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n Object.defineProperty(subClass, \"prototype\", {\n writable: false\n });\n if (superClass) setPrototypeOf(subClass, superClass);\n}","import _typeof from \"./typeof.js\";\nimport assertThisInitialized from \"./assertThisInitialized.js\";\nexport default function _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n } else if (call !== void 0) {\n throw new TypeError(\"Derived constructors may only return object or undefined\");\n }\n return assertThisInitialized(self);\n}","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n return _setPrototypeOf(o, p);\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nimport isNativeReflectConstruct from \"./isNativeReflectConstruct.js\";\nexport default function _construct(Parent, args, Class) {\n if (isNativeReflectConstruct()) {\n _construct = Reflect.construct.bind();\n } else {\n _construct = function _construct(Parent, args, Class) {\n var a = [null];\n a.push.apply(a, args);\n var Constructor = Function.bind.apply(Parent, a);\n var instance = new Constructor();\n if (Class) setPrototypeOf(instance, Class.prototype);\n return instance;\n };\n }\n return _construct.apply(null, arguments);\n}","export default function _isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n try {\n Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\n}","import getPrototypeOf from \"./getPrototypeOf.js\";\nimport setPrototypeOf from \"./setPrototypeOf.js\";\nimport isNativeFunction from \"./isNativeFunction.js\";\nimport construct from \"./construct.js\";\nexport default function _wrapNativeSuper(Class) {\n var _cache = typeof Map === \"function\" ? new Map() : undefined;\n _wrapNativeSuper = function _wrapNativeSuper(Class) {\n if (Class === null || !isNativeFunction(Class)) return Class;\n if (typeof Class !== \"function\") {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n if (typeof _cache !== \"undefined\") {\n if (_cache.has(Class)) return _cache.get(Class);\n _cache.set(Class, Wrapper);\n }\n function Wrapper() {\n return construct(Class, arguments, getPrototypeOf(this).constructor);\n }\n Wrapper.prototype = Object.create(Class.prototype, {\n constructor: {\n value: Wrapper,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n return setPrototypeOf(Wrapper, Class);\n };\n return _wrapNativeSuper(Class);\n}","export default function _isNativeFunction(fn) {\n return Function.toString.call(fn).indexOf(\"[native code]\") !== -1;\n}"],"names":["KernelPython3","_KernelBase","_inherits","_putModule","_putFile","_evalAsync","_launch","_onload2","_super","_createSuper","options","_this","_a","_classCallCheck","call","_pyodideURLs","__kernel__","pythonVersion","unshift","concat","basthonRoot","pyodideURLs","_createClass","key","value","absolute","arguments","length","undefined","this","_asyncToGenerator","_regeneratorRuntime","_callee","pyodide","packages","_i","_Object$keys","p","item","_context","prev","next","window","_api","repodata_packages","Object","keys","file_name","replace","runPython","loadPackage","pyimport","stop","apply","_callee2","pyodideURL","_iterator","_step","url","_context2","_createForOfIteratorHelper","s","n","done","fetch","method","sent","ok","abrupt","t0","t1","e","f","finish","loadScript","t2","console","log","error","loadPyodide","Error","lockFileURL","t3","_onload","get","execution_count","_callee3","code","outCallback","errCallback","data","proxy","res","_args3","_context3","text","eval","isPyProxy","toJs","create_proxies","dict_converter","fromEntries","destroy","_x","_x2","_x3","restart","_callee4","filename","content","_context4","put_file","_x4","_x5","_callee5","_context5","put_module","_x6","_x7","user_modules","path","get_file","get_user_module_file","source","more","complete","_module","FS","chdir","mkdir","KernelBase","_assertThisInitialized","self","ReferenceError","_defineProperty","obj","defineProperty","enumerable","configurable","writable","_getPrototypeOf","o","setPrototypeOf","getPrototypeOf","bind","__proto__","subClass","superClass","TypeError","prototype","create","constructor","_possibleConstructorReturn","_setPrototypeOf","_construct","Parent","args","Class","Reflect","construct","sham","Proxy","Boolean","valueOf","a","push","instance","Function","_wrapNativeSuper","_cache","Map","fn","toString","indexOf","has","set","Wrapper"],"sourceRoot":""}
1
+ {"version":3,"file":"kernel-python3_lib_index_js-node_modules_babel_runtime_helpers_esm_defineProperty_js-node_mod-1ab697.js","mappings":"izDACA,IAIaA,EAAa,SAAAC,IAAAC,EAAAA,EAAAA,GAAAF,EAAAC,GAAA,IAqItBE,EANAC,EAhCAC,EA/CAC,EAjBAC,EA/BsBC,EAAAC,EAAAT,GACtB,SAAAA,EAAYU,GAAS,IAAAC,EACbC,EAYgJ,OAbnIC,EAAAA,EAAAA,GAAA,KAAAb,IAEjBW,EAAAH,EAAAM,KAAA,KAAMJ,IAIDK,aAAe,CAAC,uEAGrBJ,EAAKK,WAAa,KAClBL,EAAKM,cAAgB,GAErBN,EAAKI,aAAaG,QAAQ,GAADC,OAAIR,EAAKS,cAAa,wBAC/CT,EAAKI,aAAgG,QAAhFH,EAAKF,aAAyC,EAASA,EAAQW,mBAAgC,IAAPT,EAAgBA,EAAKD,EAAKI,aAAaJ,CACxJ,CA8LC,OA7LDW,EAAAA,EAAAA,GAAAtB,EAAA,EAAAuB,IAAA,qBAAAC,MAGA,WAAqC,IAAlBC,EAAQC,UAAAC,OAAA,QAAAC,IAAAF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AAW,EAAAsH,EAAA,GAAenH,MAAM2H,YAC1D,CASA,OARAyB,EAAQ3B,UAAYzG,OAAO0G,OAAOO,EAAMR,UAAW,CACjDE,YAAa,CACXhI,MAAOyJ,EACPvC,YAAY,EACZE,UAAU,EACVD,cAAc,MAGX,EAAAI,EAAA,GAAekC,EAASnB,EACjC,EACOW,EAAiBX,EAC1B,C","sources":["webpack://@basthon/browser-bundle/../kernel-python3/lib/kernel.js","webpack://@basthon/browser-bundle/../../node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js","webpack://@basthon/browser-bundle/../../node_modules/@babel/runtime/helpers/esm/defineProperty.js","webpack://@basthon/browser-bundle/../../node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js","webpack://@basthon/browser-bundle/../../node_modules/@babel/runtime/helpers/esm/inherits.js","webpack://@basthon/browser-bundle/../../node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js","webpack://@basthon/browser-bundle/../../node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@basthon/browser-bundle/../../node_modules/@babel/runtime/helpers/esm/construct.js","webpack://@basthon/browser-bundle/../../node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js","webpack://@basthon/browser-bundle/../../node_modules/@babel/runtime/helpers/esm/wrapNativeSuper.js","webpack://@basthon/browser-bundle/../../node_modules/@babel/runtime/helpers/esm/isNativeFunction.js"],"sourcesContent":["import { KernelBase } from \"@basthon/kernel-base\";\nconst PYODIDE_VERSION = \"0.23.2\";\n/**\n * A Python kernel that satisfies Basthon's API.\n */\nexport class KernelPython3 extends KernelBase {\n constructor(options) {\n var _a;\n super(options);\n /**\n * Where to find pyodide.js (private).\n */\n this._pyodideURLs = [\n `https://cdn.jsdelivr.net/pyodide/v{PYODIDE_VERSION}/full/pyodide.js`,\n ];\n this.__kernel__ = null;\n this.pythonVersion = \"\";\n // for locally installed Pyodide\n this._pyodideURLs.unshift(`${this.basthonRoot()}/pyodide/pyodide.js`);\n this._pyodideURLs = (_a = options === null || options === void 0 ? void 0 : options.pyodideURLs) !== null && _a !== void 0 ? _a : this._pyodideURLs;\n }\n /**\n * Get the URL of Basthon modules dir.\n */\n basthonModulesRoot(absolute = false) {\n return this.basthonRoot(absolute) + \"/modules\";\n }\n language() {\n return \"python3\";\n }\n languageName() {\n return \"Python 3\";\n }\n moduleExts() {\n return [\"py\"];\n }\n /**\n * What to do when loaded (private).\n */\n async _onload() {\n const pyodide = window.pyodide;\n // reformat repodata\n const packages = pyodide._api.repodata_packages;\n for (let p of Object.keys(packages)) {\n const item = packages[p];\n item.file_name = item.file_name.replace(\"{basthonRoot}\", this.basthonRoot(true));\n }\n // get the version of Python from Python\n this.pythonVersion = pyodide.runPython(\"import platform ; platform.python_version()\");\n // load basthon and get kernel\n await pyodide.loadPackage(\"basthon\");\n this.__kernel__ = pyodide.pyimport(\"basthon\").__kernel__;\n }\n /**\n * Start the Basthon kernel asynchronously.\n */\n async launch() {\n let pyodideURL = this._pyodideURLs[0];\n for (let url of this._pyodideURLs) {\n url = url.replace(\"{PYODIDE_VERSION}\", PYODIDE_VERSION);\n try {\n const response = await fetch(url, { method: \"HEAD\" });\n if (response.ok) {\n pyodideURL = url;\n break;\n }\n }\n catch (e) { }\n }\n try {\n await KernelPython3.loadScript(pyodideURL);\n }\n catch (error) {\n console.log(error);\n console.error(\"Can't load pyodide.js\");\n throw error;\n }\n if (window.loadPyodide == null) {\n console.log(\"window.loadPyodide is null!\");\n throw new Error(\"Can't load pyodide.js\");\n }\n try {\n // loading with custom repodata.json\n window.pyodide = await window.loadPyodide({\n lockFileURL: this.basthonRoot() + \"/repodata.json\",\n });\n }\n catch (error) {\n console.log(error);\n console.error(\"Can't load Python from Pyodide\");\n throw error;\n }\n await this._onload();\n }\n /**\n * Execution count getter overload.\n */\n get execution_count() {\n return this.__kernel__.execution_count();\n }\n /**\n * Basthon async code evaluation function.\n */\n async evalAsync(code, outCallback, errCallback, data = null) {\n if (typeof outCallback === \"undefined\") {\n outCallback = function (text) {\n console.log(text);\n };\n }\n if (typeof errCallback === \"undefined\") {\n errCallback = function (text) {\n console.error(text);\n };\n }\n // dependencies are loaded by eval\n const proxy = await this.__kernel__.eval(code, outCallback, errCallback, data);\n // when an error occures, proxy should be the error message\n if (!(proxy instanceof window.pyodide.ffi.PyProxy))\n throw proxy;\n const res = proxy.toJs({\n create_proxies: false,\n dict_converter: Object.fromEntries,\n });\n proxy.destroy();\n return res;\n }\n /**\n * Restart the kernel.\n */\n restart() {\n return this.__kernel__.restart();\n }\n /**\n * Put a file on the local (emulated) filesystem.\n */\n async putFile(filename, content) {\n this.__kernel__.put_file(filename, content);\n }\n /**\n * Put an importable module on the local (emulated) filesystem\n * and load dependencies.\n */\n async putModule(filename, content) {\n return await this.__kernel__.put_module(filename, content);\n }\n /**\n * List modules launched via putModule.\n */\n userModules() {\n const proxy = this.__kernel__.user_modules();\n if (!(proxy instanceof window.pyodide.ffi.PyProxy))\n return proxy;\n const res = proxy.toJs();\n proxy.destroy();\n return res;\n }\n /**\n * Get a file content from the VFS.\n */\n getFile(path) {\n return this.__kernel__.get_file(path).toJs();\n }\n /**\n * Get a user module file content.\n */\n getUserModuleFile(filename) {\n return this.__kernel__.get_user_module_file(filename).toJs();\n }\n /**\n * Is the source ready to be evaluated or want we more?\n * Usefull to set ps1/ps2 for teminal prompt.\n */\n more(source) {\n return this.__kernel__.more(source);\n }\n /**\n * Mimic the CPython's REPL banner.\n */\n banner() {\n /* We don't return this.__kernel__.banner();\n * since the banner should be available ASAP.\n * In tests, we check this.banner() === this.__kernel__.banner().\n */\n return `Python 3.11.2 (main, May 3 2023 04:00:05) on WebAssembly/Emscripten\\nType \\\"help\\\", \\\"copyright\\\", \\\"credits\\\" or \\\"license\\\" for more information.`;\n }\n /**\n * Complete a code at the end (usefull for tab completion).\n *\n * Returns an array of two elements: the list of completions\n * and the start index.\n */\n complete(code) {\n const proxy = this.__kernel__.complete(code);\n if (!(proxy instanceof window.pyodide.ffi.PyProxy))\n return proxy;\n const res = proxy.toJs();\n proxy.destroy();\n return res;\n }\n /**\n * Change current directory (Python's virtual FS).\n */\n chdir(path) {\n window.pyodide._module.FS.chdir(path);\n }\n /**\n * Create directory (Python's virtual FS).\n */\n mkdir(path) {\n window.pyodide._module.FS.mkdir(path);\n }\n}\n","export default function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n return self;\n}","import toPropertyKey from \"./toPropertyKey.js\";\nexport default function _defineProperty(obj, key, value) {\n key = toPropertyKey(key);\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}","export default function _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n Object.defineProperty(subClass, \"prototype\", {\n writable: false\n });\n if (superClass) setPrototypeOf(subClass, superClass);\n}","import _typeof from \"./typeof.js\";\nimport assertThisInitialized from \"./assertThisInitialized.js\";\nexport default function _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n } else if (call !== void 0) {\n throw new TypeError(\"Derived constructors may only return object or undefined\");\n }\n return assertThisInitialized(self);\n}","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n return _setPrototypeOf(o, p);\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nimport isNativeReflectConstruct from \"./isNativeReflectConstruct.js\";\nexport default function _construct(Parent, args, Class) {\n if (isNativeReflectConstruct()) {\n _construct = Reflect.construct.bind();\n } else {\n _construct = function _construct(Parent, args, Class) {\n var a = [null];\n a.push.apply(a, args);\n var Constructor = Function.bind.apply(Parent, a);\n var instance = new Constructor();\n if (Class) setPrototypeOf(instance, Class.prototype);\n return instance;\n };\n }\n return _construct.apply(null, arguments);\n}","export default function _isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n try {\n Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\n}","import getPrototypeOf from \"./getPrototypeOf.js\";\nimport setPrototypeOf from \"./setPrototypeOf.js\";\nimport isNativeFunction from \"./isNativeFunction.js\";\nimport construct from \"./construct.js\";\nexport default function _wrapNativeSuper(Class) {\n var _cache = typeof Map === \"function\" ? new Map() : undefined;\n _wrapNativeSuper = function _wrapNativeSuper(Class) {\n if (Class === null || !isNativeFunction(Class)) return Class;\n if (typeof Class !== \"function\") {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n if (typeof _cache !== \"undefined\") {\n if (_cache.has(Class)) return _cache.get(Class);\n _cache.set(Class, Wrapper);\n }\n function Wrapper() {\n return construct(Class, arguments, getPrototypeOf(this).constructor);\n }\n Wrapper.prototype = Object.create(Class.prototype, {\n constructor: {\n value: Wrapper,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n return setPrototypeOf(Wrapper, Class);\n };\n return _wrapNativeSuper(Class);\n}","export default function _isNativeFunction(fn) {\n try {\n return Function.toString.call(fn).indexOf(\"[native code]\") !== -1;\n } catch (e) {\n return typeof fn === \"function\";\n }\n}"],"names":["KernelPython3","_KernelBase","_inherits","_putModule","_putFile","_evalAsync","_launch","_onload2","_super","_createSuper","options","_this","_a","_classCallCheck","call","_pyodideURLs","__kernel__","pythonVersion","unshift","concat","basthonRoot","pyodideURLs","_createClass","key","value","absolute","arguments","length","undefined","this","_asyncToGenerator","_regeneratorRuntime","_callee","pyodide","packages","_i","_Object$keys","p","item","_context","prev","next","window","_api","repodata_packages","Object","keys","file_name","replace","runPython","loadPackage","pyimport","stop","apply","_callee2","pyodideURL","_iterator","_step","url","_context2","_createForOfIteratorHelper","s","n","done","fetch","method","sent","ok","abrupt","t0","t1","e","f","finish","loadScript","t2","console","log","error","loadPyodide","Error","lockFileURL","t3","_onload","get","execution_count","_callee3","code","outCallback","errCallback","data","proxy","res","_args3","_context3","text","eval","ffi","PyProxy","toJs","create_proxies","dict_converter","fromEntries","destroy","_x","_x2","_x3","restart","_callee4","filename","content","_context4","put_file","_x4","_x5","_callee5","_context5","put_module","_x6","_x7","user_modules","path","get_file","get_user_module_file","source","more","complete","_module","FS","chdir","mkdir","KernelBase","_assertThisInitialized","self","ReferenceError","_defineProperty","obj","defineProperty","enumerable","configurable","writable","_getPrototypeOf","o","setPrototypeOf","getPrototypeOf","bind","__proto__","subClass","superClass","TypeError","prototype","create","constructor","_possibleConstructorReturn","_setPrototypeOf","_construct","Parent","args","Class","Reflect","construct","sham","Proxy","Boolean","valueOf","a","push","instance","Function","_wrapNativeSuper","_cache","Map","fn","toString","indexOf","has","set","Wrapper"],"sourceRoot":""}