@basthon/browser-bundle 0.40.8 → 0.40.9

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 (25) hide show
  1. package/lib/{0.40.8 → 0.40.9}/basthon.data +0 -0
  2. package/lib/{0.40.8 → 0.40.9}/basthon.js +1 -1
  3. package/lib/{0.40.8 → 0.40.9}/modules/IPython-0.0.1-py3-none-any.whl +0 -0
  4. package/lib/{0.40.8 → 0.40.9}/modules/extern/pytutor-main.min.css +0 -0
  5. package/lib/{0.40.8 → 0.40.9}/modules/extern/pytutor-main.min.js +0 -0
  6. package/lib/{0.40.8 → 0.40.9}/modules/extern/pytutor-main.min.js.map +0 -0
  7. package/lib/{0.40.8 → 0.40.9}/modules/graphviz-0.0.1-py3-none-any.whl +0 -0
  8. package/lib/{0.40.8 → 0.40.9}/modules/ipythonblocks-0.0.1-py3-none-any.whl +0 -0
  9. package/lib/{0.40.8 → 0.40.9}/modules/ivp-0.0.1-py3-none-any.whl +0 -0
  10. package/lib/{0.40.8 → 0.40.9}/modules/lolviz-0.0.1-py3-none-any.whl +0 -0
  11. package/lib/{0.40.8 → 0.40.9}/modules/p5-0.0.1-py3-none-any.whl +0 -0
  12. package/lib/{0.40.8 → 0.40.9}/modules/proj4py-0.0.1-py3-none-any.whl +0 -0
  13. package/lib/{0.40.8 → 0.40.9}/modules/rcviz-0.0.1-py3-none-any.whl +0 -0
  14. package/lib/{0.40.8 → 0.40.9}/modules/requests-0.0.1-py3-none-any.whl +0 -0
  15. package/lib/{0.40.8 → 0.40.9}/modules/turtle-0.0.1-py3-none-any.whl +0 -0
  16. package/lib/{0.40.8 → 0.40.9}/modules/tutor-0.0.1-py3-none-any.whl +0 -0
  17. package/lib/kernel-javascript_lib_index_js.js +1 -1
  18. package/lib/kernel-javascript_lib_index_js.js.map +1 -1
  19. package/lib/kernel-ocaml_lib_index_js.js +1 -1
  20. package/lib/kernel-ocaml_lib_index_js.js.map +1 -1
  21. package/lib/kernel-python3_lib_index_js.js +1 -1
  22. package/lib/kernel-python3_lib_index_js.js.map +1 -1
  23. package/lib/kernel-sql_lib_index_js.js +1 -1
  24. package/lib/kernel-sql_lib_index_js.js.map +1 -1
  25. package/package.json +3 -3
File without changes
@@ -1 +1 @@
1
- var Module=void 0!==pyodide._module?pyodide._module:{};Module.expectedDataFileDownloads||(Module.expectedDataFileDownloads=0,Module.finishedDataFileDownloads=0),Module.expectedDataFileDownloads++,function(e){if("object"==typeof window)window.encodeURIComponent(window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/");else{if("undefined"==typeof location)throw"using preloaded data can only be done on a web page or in a web worker";encodeURIComponent(location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/")}var a="basthon.data";"function"!=typeof Module.locateFilePackage||Module.locateFile||(Module.locateFile=Module.locateFilePackage,err("warning: you defined Module.locateFilePackage, that has been renamed to Module.locateFile (using your locateFilePackage for now)"));var o=Module.locateFile?Module.locateFile(a,""):a,t=e.remote_package_size;e.package_uuid;var l,d,n,s,i=null,u=Module.getPreloadedPackage?Module.getPreloadedPackage(o,t):null;function r(){function a(e,a){if(!e)throw a+(new Error).stack}function o(o){Module.finishedDataFileDownloads++,a(o,"Loading data file failed."),a(o instanceof ArrayBuffer,"bad input to processPackageData");var t=new Uint8Array(o),l={data:null,cachedOffset:34207,cachedIndexes:[-1,-1],cachedChunks:[null,null],offsets:[0,1043,2149,3376,4529,5745,6965,8359,9696,10918,12213,13380,14573,15776,17109,18584,19812,21029,22182,23529,24898,26296,27527,28761,29863,31117,31969,33106],sizes:[1043,1106,1227,1153,1216,1220,1394,1337,1222,1295,1167,1193,1203,1333,1475,1228,1217,1153,1347,1369,1398,1231,1234,1102,1254,852,1137,1101],successes:[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]};l.data=t,LZ4=Module.LZ4,a("object"==typeof LZ4,"LZ4 not present - was your app build with -s LZ4=1 ?"),LZ4.loadPackage({metadata:e,compressedData:l}),Module.removeRunDependency("datafile_lib/dist//basthon.data")}Module.FS_createPath("/","lib",!0,!0),Module.FS_createPath("/lib","python3.8",!0,!0),Module.FS_createPath("/lib/python3.8","site-packages",!0,!0),Module.FS_createPath("/lib/python3.8/site-packages","basthon",!0,!0),Module.addRunDependency("datafile_lib/dist//basthon.data"),Module.preloadResults||(Module.preloadResults={}),Module.preloadResults["lib/dist//basthon.data"]={fromCache:!1},u?(o(u),u=null):i=o}u||(l=o,d=t,n=function(e){i?(i(e),i=null):u=e},(s=new XMLHttpRequest).open("GET",l,!0),s.responseType="arraybuffer",s.onprogress=function(e){var a=l,o=d;if(e.total&&(o=e.total),e.loaded){s.addedTotal?Module.dataFileDownloads[a].loaded=e.loaded:(s.addedTotal=!0,Module.dataFileDownloads||(Module.dataFileDownloads={}),Module.dataFileDownloads[a]={loaded:e.loaded,total:o});var t=0,n=0,i=0;for(var u in Module.dataFileDownloads){var r=Module.dataFileDownloads[u];t+=r.total,n+=r.loaded,i++}t=Math.ceil(t*Module.expectedDataFileDownloads/i),Module.setStatus&&Module.setStatus("Downloading data... ("+n+"/"+t+")")}else Module.dataFileDownloads||Module.setStatus&&Module.setStatus("Downloading data...")},s.onerror=function(e){throw new Error("NetworkError for: "+l)},s.onload=function(e){if(!(200==s.status||304==s.status||206==s.status||0==s.status&&s.response))throw new Error(s.statusText+" : "+s.responseURL);var a=s.response;n(a)},s.send(null)),Module.calledRun?r():(Module.preRun||(Module.preRun=[]),Module.preRun.push(r))}({files:[{filename:"/lib/python3.8/site-packages/basthon/utils.py",start:0,end:2379,audio:0},{filename:"/lib/python3.8/site-packages/basthon/_patch_modules.py",start:2379,end:14111,audio:0},{filename:"/lib/python3.8/site-packages/basthon/_pyodide_base.py",start:14111,end:27245,audio:0},{filename:"/lib/python3.8/site-packages/basthon/_patch_builtins.py",start:27245,end:29523,audio:0},{filename:"/lib/python3.8/site-packages/basthon/_pyodide_console.py",start:29523,end:41118,audio:0},{filename:"/lib/python3.8/site-packages/basthon/kernel.py",start:41118,end:45592,audio:0},{filename:"/lib/python3.8/site-packages/basthon/_console.py",start:45592,end:50508,audio:0},{filename:"/lib/python3.8/site-packages/basthon/packages.py",start:50508,end:56744,audio:0},{filename:"/lib/python3.8/site-packages/basthon/__init__.py",start:56744,end:57082,audio:0}],remote_package_size:38303,package_uuid:"1612812e-23e0-4ed5-91a0-de25b96ac00e"});
1
+ var Module=void 0!==pyodide._module?pyodide._module:{};Module.expectedDataFileDownloads||(Module.expectedDataFileDownloads=0,Module.finishedDataFileDownloads=0),Module.expectedDataFileDownloads++,function(e){if("object"==typeof window)window.encodeURIComponent(window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/");else{if("undefined"==typeof location)throw"using preloaded data can only be done on a web page or in a web worker";encodeURIComponent(location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/")}var a="basthon.data";"function"!=typeof Module.locateFilePackage||Module.locateFile||(Module.locateFile=Module.locateFilePackage,err("warning: you defined Module.locateFilePackage, that has been renamed to Module.locateFile (using your locateFilePackage for now)"));var o=Module.locateFile?Module.locateFile(a,""):a,t=e.remote_package_size;e.package_uuid;var l,d,n,s,i=null,u=Module.getPreloadedPackage?Module.getPreloadedPackage(o,t):null;function r(){function a(e,a){if(!e)throw a+(new Error).stack}function o(o){Module.finishedDataFileDownloads++,a(o,"Loading data file failed."),a(o instanceof ArrayBuffer,"bad input to processPackageData");var t=new Uint8Array(o),l={data:null,cachedOffset:34207,cachedIndexes:[-1,-1],cachedChunks:[null,null],offsets:[0,1043,2149,3376,4529,5745,6965,8359,9696,10918,12213,13380,14573,15776,17109,18584,19812,21029,22182,23529,24898,26296,27527,28761,29863,31117,31969,33106],sizes:[1043,1106,1227,1153,1216,1220,1394,1337,1222,1295,1167,1193,1203,1333,1475,1228,1217,1153,1347,1369,1398,1231,1234,1102,1254,852,1137,1101],successes:[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]};l.data=t,LZ4=Module.LZ4,a("object"==typeof LZ4,"LZ4 not present - was your app build with -s LZ4=1 ?"),LZ4.loadPackage({metadata:e,compressedData:l}),Module.removeRunDependency("datafile_lib/dist//basthon.data")}Module.FS_createPath("/","lib",!0,!0),Module.FS_createPath("/lib","python3.8",!0,!0),Module.FS_createPath("/lib/python3.8","site-packages",!0,!0),Module.FS_createPath("/lib/python3.8/site-packages","basthon",!0,!0),Module.addRunDependency("datafile_lib/dist//basthon.data"),Module.preloadResults||(Module.preloadResults={}),Module.preloadResults["lib/dist//basthon.data"]={fromCache:!1},u?(o(u),u=null):i=o}u||(l=o,d=t,n=function(e){i?(i(e),i=null):u=e},(s=new XMLHttpRequest).open("GET",l,!0),s.responseType="arraybuffer",s.onprogress=function(e){var a=l,o=d;if(e.total&&(o=e.total),e.loaded){s.addedTotal?Module.dataFileDownloads[a].loaded=e.loaded:(s.addedTotal=!0,Module.dataFileDownloads||(Module.dataFileDownloads={}),Module.dataFileDownloads[a]={loaded:e.loaded,total:o});var t=0,n=0,i=0;for(var u in Module.dataFileDownloads){var r=Module.dataFileDownloads[u];t+=r.total,n+=r.loaded,i++}t=Math.ceil(t*Module.expectedDataFileDownloads/i),Module.setStatus&&Module.setStatus("Downloading data... ("+n+"/"+t+")")}else Module.dataFileDownloads||Module.setStatus&&Module.setStatus("Downloading data...")},s.onerror=function(e){throw new Error("NetworkError for: "+l)},s.onload=function(e){if(!(200==s.status||304==s.status||206==s.status||0==s.status&&s.response))throw new Error(s.statusText+" : "+s.responseURL);var a=s.response;n(a)},s.send(null)),Module.calledRun?r():(Module.preRun||(Module.preRun=[]),Module.preRun.push(r))}({files:[{filename:"/lib/python3.8/site-packages/basthon/utils.py",start:0,end:2379,audio:0},{filename:"/lib/python3.8/site-packages/basthon/_patch_modules.py",start:2379,end:14111,audio:0},{filename:"/lib/python3.8/site-packages/basthon/_pyodide_base.py",start:14111,end:27245,audio:0},{filename:"/lib/python3.8/site-packages/basthon/_patch_builtins.py",start:27245,end:29523,audio:0},{filename:"/lib/python3.8/site-packages/basthon/_pyodide_console.py",start:29523,end:41118,audio:0},{filename:"/lib/python3.8/site-packages/basthon/kernel.py",start:41118,end:45592,audio:0},{filename:"/lib/python3.8/site-packages/basthon/_console.py",start:45592,end:50508,audio:0},{filename:"/lib/python3.8/site-packages/basthon/packages.py",start:50508,end:56744,audio:0},{filename:"/lib/python3.8/site-packages/basthon/__init__.py",start:56744,end:57082,audio:0}],remote_package_size:38303,package_uuid:"c2634eb2-6527-48bd-a818-092b4b7599c9"});
@@ -1,2 +1,2 @@
1
- "use strict";(self.webpackChunk_basthon_browser_bundle=self.webpackChunk_basthon_browser_bundle||[]).push([["kernel-javascript_lib_index_js"],{305:(e,t,n)=>{n.d(t,{H:()=>b});var r=n(522),o=n(795),u=n(371),c=n(249),i=n(754),a=n(987),s=n(58),l=n(960);function f(){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}}function p(e,t,n){return p=f()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&(0,l.Z)(o,n.prototype),o},p.apply(null,arguments)}function h(e){var t="function"==typeof Map?new Map:void 0;return h=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,r)}function r(){return p(e,arguments,(0,s.Z)(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),(0,l.Z)(r,e)},h(e)}var v=n(162),d=n.n(v),y=n(490);function w(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,s.Z)(e);if(t){var o=(0,s.Z)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,a.Z)(this,n)}}var m=function(e){(0,i.Z)(n,e);var t=w(n);function n(e){var r;return(0,c.Z)(this,n),(r=t.call(this,"Function ".concat(e," not implemented!"))).name="NotImplementedError",r}return(0,u.Z)(n)}(h(Error)),k=function(e){(0,i.Z)(n,e);var t=w(n);function n(e,r){var o;return(0,c.Z)(this,n),(o=t.call(this,e)).detail=r,o}return(0,u.Z)(n)}(h(Event)),b=function(){function e(t){(0,c.Z)(this,e),this._ready=!1,this._loaded=new y.I,this.execution_count=0,this._rootPath=t}var t,n,i,a;return(0,u.Z)(e,[{key:"version",value:function(){return"0.40.8"}},{key:"language",value:function(){throw new m("language")}},{key:"languageName",value:function(){throw new m("languageName")}},{key:"moduleExts",value:function(){throw new m("moduleExts")}},{key:"launch",value:(a=(0,o.Z)(d().mark((function e(){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new m("launch");case 1:case"end":return e.stop()}}),e)}))),function(){return a.apply(this,arguments)})},{key:"evalAsync",value:function(e,t,n){throw new m("evalAsync")}},{key:"restart",value:function(){throw new m("restart")}},{key:"putFile",value:function(e,t){throw new m("putFile")}},{key:"putModule",value:function(e,t){throw new m("putModule")}},{key:"userModules",value:function(){return[]}},{key:"getFile",value:function(e){throw new m("getFile")}},{key:"getUserModuleFile",value:function(e){throw new m("getUserModuleFile")}},{key:"more",value:function(e){throw new m("more")}},{key:"complete",value:function(e){return[]}},{key:"banner",value:function(){return"Welcome to the ".concat(this.languageName()," REPL!")}},{key:"ps1",value:function(){return">>> "}},{key:"ps2",value:function(){return"... "}},{key:"init",value:(i=(0,o.Z)(d().mark((function e(){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.launch();case 3:e.next=9;break;case 5:return e.prev=5,e.t0=e.catch(0),this._loaded.reject(e.t0),e.abrupt("return");case 9:this.addEventListener("eval.request",this.evalFromEvent.bind(this)),this._ready=!0,this._loaded.resolve();case 12:case"end":return e.stop()}}),e,this,[[0,5]])}))),function(){return i.apply(this,arguments)})},{key:"ready",get:function(){return this._ready}},{key:"loaded",value:(n=(0,o.Z)(d().mark((function e(){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._loaded.promise;case 2:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"basthonRoot",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this._rootPath+"/"+this.version();if(e&&!t.startsWith("http")){var n=window.location.origin+window.location.pathname;t=n.substring(0,n.lastIndexOf("/"))+"/"+t}return t}},{key:"download",value:function(e,t){var n=new Blob([e],{type:"application/octet-stream"}),r=document.createElement("a");r.download=t,r.href=window.URL.createObjectURL(n),r.target="_blank",r.style.display="none",document.body.appendChild(r),r.click(),document.body.removeChild(r)}},{key:"dispatchEvent",value:function(e,t){document.dispatchEvent(new k("basthon.".concat(e),t))}},{key:"addEventListener",value:function(e,t){document.addEventListener("basthon.".concat(e),(function(e){t(e.detail)}))}},{key:"clone",value:function(e){return JSON.parse(JSON.stringify(e))}},{key:"putRessource",value:function(e,t){var n,r=null!==(n=e.split(".").pop())&&void 0!==n?n:"";return this.moduleExts().includes(r)?this.putModule(e,t):this.putFile(e,t)}},{key:"evalFromEvent",value:(t=(0,o.Z)(d().mark((function e(t){var n,r,o,u,c,i,a,s,l=this;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=function(e){return function(n){var r=l.clone(t);r.stream=e,r.content=n,l.dispatchEvent("eval.output",r)}},r=n("stdout"),o=n("stderr"),e.prev=3,e.next=6,this.evalAsync(t.code,r,o,t);case 6:u=e.sent,e.next=17;break;case 9:return e.prev=9,e.t0=e.catch(3),o(e.t0.toString()),(c=this.clone(t)).error=e.t0,c.execution_count=this.execution_count,this.dispatchEvent("eval.error",c),e.abrupt("return");case 17:if(null!=u){e.next=19;break}return e.abrupt("return");case 19:i=u[0],a=u[1],(s=this.clone(t)).execution_count=a,null!=i&&(s.result=i),this.dispatchEvent("eval.finished",s);case 25:case"end":return e.stop()}}),e,this,[[3,9]])}))),function(e){return t.apply(this,arguments)})}],[{key:"loadScript",value:function(e){return new Promise((function(t,n){var r=document.createElement("script");r.onload=t,r.onerror=n,r.src=e,document.head.appendChild(r)}))}},{key:"xhr",value:function(e){var t=new XMLHttpRequest;t.open(e.method,e.url,!0),null!=e.responseType&&(t.responseType=e.responseType);var n=new Promise((function(e,n){t.onload=function(){t.status>=200&&t.status<300?e(t.response):n(t)},t.onerror=function(){n(t)}}));e.headers&&Object.keys(e.headers).forEach((function(n){t.setRequestHeader(n,e.headers[n])}));var o=e.data;return o&&"object"===(0,r.Z)(o)&&(o=JSON.stringify(o)),t.send(o),n}}]),e}()},655:(e,t,n)=>{n.r(t),n.d(t,{KernelJavaScript:()=>p});var r=n(795),o=n(249),u=n(371),c=n(754),i=n(987),a=n(58),s=n(162),l=n.n(s);function f(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,a.Z)(e);if(t){var o=(0,a.Z)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,i.Z)(this,n)}}var p=function(e){(0,c.Z)(a,e);var t,n,i=f(a);function a(e){var t;return(0,o.Z)(this,a),(t=i.call(this,e))._context={Basthon:void 0,Jupyter:void 0,window:void 0},t.execution_count=0,t}return(0,u.Z)(a,[{key:"language",value:function(){return"javascript"}},{key:"languageName",value:function(){return"Javascript"}},{key:"moduleExts",value:function(){return["js"]}},{key:"launch",value:(n=(0,r.Z)(l().mark((function e(){return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)}))),function(){return n.apply(this,arguments)})},{key:"eval",value:function(e){try{return window.eval("with(Basthon._context) { ".concat(e," }"))}catch(t){if(t instanceof SyntaxError)return new Function("with(this) { ".concat(e," }")).call(this._context);throw t}}},{key:"evalAsync",value:(t=(0,r.Z)(l().mark((function e(t,n,r){var o,u,c,i=arguments;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:(i.length>3&&void 0!==i[3]?i[3]:null).interactive=!0,o=console.log,u=console.error,console.log=n,console.error=r,this.execution_count++,c=void 0;try{c=this.eval(t)}catch(e){console.error("Uncaught ".concat(e.name||"",": ").concat(null==e?void 0:e.message))}return console.log=o,console.error=u,void 0!==c&&(c={"text/plain":JSON.stringify(c)}),e.abrupt("return",[c,this.execution_count]);case 13:case"end":return e.stop()}}),e,this)}))),function(e,n,r){return t.apply(this,arguments)})},{key:"ps1",value:function(){return" js> "}},{key:"ps2",value:function(){return"...> "}},{key:"restart",value:function(){}},{key:"more",value:function(e){return!1}},{key:"complete",value:function(e){return[]}},{key:"putFile",value:function(e,t){console.error("Fichier ".concat(e," not added since putFile has no mean in the JS context."))}},{key:"putModule",value:function(e,t){if(t=new Uint8Array(t),"js"!==e.split(".").pop())throw{message:"Only '.js' files supported."};var n=new TextDecoder("utf-8").decode(t);this.eval(n)}}]),a}(n(305).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})},58:(e,t,n)=>{function r(e){return r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},r(e)}n.d(t,{Z:()=>r})},754:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(960);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)}},987:(e,t,n)=>{n.d(t,{Z:()=>u});var r=n(522),o=n(753);function u(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)}},960:(e,t,n)=>{function r(e,t){return r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},r(e,t)}n.d(t,{Z:()=>r})},522:(e,t,n)=>{function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n.d(t,{Z:()=>r})}}]);
1
+ "use strict";(self.webpackChunk_basthon_browser_bundle=self.webpackChunk_basthon_browser_bundle||[]).push([["kernel-javascript_lib_index_js"],{305:(e,t,n)=>{n.d(t,{H:()=>b});var r=n(522),o=n(795),u=n(371),c=n(249),i=n(754),a=n(987),s=n(58),l=n(960);function f(){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}}function p(e,t,n){return p=f()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&(0,l.Z)(o,n.prototype),o},p.apply(null,arguments)}function h(e){var t="function"==typeof Map?new Map:void 0;return h=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,r)}function r(){return p(e,arguments,(0,s.Z)(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),(0,l.Z)(r,e)},h(e)}var v=n(162),d=n.n(v),y=n(490);function w(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,s.Z)(e);if(t){var o=(0,s.Z)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,a.Z)(this,n)}}var m=function(e){(0,i.Z)(n,e);var t=w(n);function n(e){var r;return(0,c.Z)(this,n),(r=t.call(this,"Function ".concat(e," not implemented!"))).name="NotImplementedError",r}return(0,u.Z)(n)}(h(Error)),k=function(e){(0,i.Z)(n,e);var t=w(n);function n(e,r){var o;return(0,c.Z)(this,n),(o=t.call(this,e)).detail=r,o}return(0,u.Z)(n)}(h(Event)),b=function(){function e(t){(0,c.Z)(this,e),this._ready=!1,this._loaded=new y.I,this.execution_count=0,this._rootPath=t}var t,n,i,a;return(0,u.Z)(e,[{key:"version",value:function(){return"0.40.9"}},{key:"language",value:function(){throw new m("language")}},{key:"languageName",value:function(){throw new m("languageName")}},{key:"moduleExts",value:function(){throw new m("moduleExts")}},{key:"launch",value:(a=(0,o.Z)(d().mark((function e(){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new m("launch");case 1:case"end":return e.stop()}}),e)}))),function(){return a.apply(this,arguments)})},{key:"evalAsync",value:function(e,t,n){throw new m("evalAsync")}},{key:"restart",value:function(){throw new m("restart")}},{key:"putFile",value:function(e,t){throw new m("putFile")}},{key:"putModule",value:function(e,t){throw new m("putModule")}},{key:"userModules",value:function(){return[]}},{key:"getFile",value:function(e){throw new m("getFile")}},{key:"getUserModuleFile",value:function(e){throw new m("getUserModuleFile")}},{key:"more",value:function(e){throw new m("more")}},{key:"complete",value:function(e){return[]}},{key:"banner",value:function(){return"Welcome to the ".concat(this.languageName()," REPL!")}},{key:"ps1",value:function(){return">>> "}},{key:"ps2",value:function(){return"... "}},{key:"init",value:(i=(0,o.Z)(d().mark((function e(){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.launch();case 3:e.next=9;break;case 5:return e.prev=5,e.t0=e.catch(0),this._loaded.reject(e.t0),e.abrupt("return");case 9:this.addEventListener("eval.request",this.evalFromEvent.bind(this)),this._ready=!0,this._loaded.resolve();case 12:case"end":return e.stop()}}),e,this,[[0,5]])}))),function(){return i.apply(this,arguments)})},{key:"ready",get:function(){return this._ready}},{key:"loaded",value:(n=(0,o.Z)(d().mark((function e(){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._loaded.promise;case 2:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"basthonRoot",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this._rootPath+"/"+this.version();if(e&&!t.startsWith("http")){var n=window.location.origin+window.location.pathname;t=n.substring(0,n.lastIndexOf("/"))+"/"+t}return t}},{key:"download",value:function(e,t){var n=new Blob([e],{type:"application/octet-stream"}),r=document.createElement("a");r.download=t,r.href=window.URL.createObjectURL(n),r.target="_blank",r.style.display="none",document.body.appendChild(r),r.click(),document.body.removeChild(r)}},{key:"dispatchEvent",value:function(e,t){document.dispatchEvent(new k("basthon.".concat(e),t))}},{key:"addEventListener",value:function(e,t){document.addEventListener("basthon.".concat(e),(function(e){t(e.detail)}))}},{key:"clone",value:function(e){return JSON.parse(JSON.stringify(e))}},{key:"putRessource",value:function(e,t){var n,r=null!==(n=e.split(".").pop())&&void 0!==n?n:"";return this.moduleExts().includes(r)?this.putModule(e,t):this.putFile(e,t)}},{key:"evalFromEvent",value:(t=(0,o.Z)(d().mark((function e(t){var n,r,o,u,c,i,a,s,l=this;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=function(e){return function(n){var r=l.clone(t);r.stream=e,r.content=n,l.dispatchEvent("eval.output",r)}},r=n("stdout"),o=n("stderr"),e.prev=3,e.next=6,this.evalAsync(t.code,r,o,t);case 6:u=e.sent,e.next=17;break;case 9:return e.prev=9,e.t0=e.catch(3),o(e.t0.toString()),(c=this.clone(t)).error=e.t0,c.execution_count=this.execution_count,this.dispatchEvent("eval.error",c),e.abrupt("return");case 17:if(null!=u){e.next=19;break}return e.abrupt("return");case 19:i=u[0],a=u[1],(s=this.clone(t)).execution_count=a,null!=i&&(s.result=i),this.dispatchEvent("eval.finished",s);case 25:case"end":return e.stop()}}),e,this,[[3,9]])}))),function(e){return t.apply(this,arguments)})}],[{key:"loadScript",value:function(e){return new Promise((function(t,n){var r=document.createElement("script");r.onload=t,r.onerror=n,r.src=e,document.head.appendChild(r)}))}},{key:"xhr",value:function(e){var t=new XMLHttpRequest;t.open(e.method,e.url,!0),null!=e.responseType&&(t.responseType=e.responseType);var n=new Promise((function(e,n){t.onload=function(){t.status>=200&&t.status<300?e(t.response):n(t)},t.onerror=function(){n(t)}}));e.headers&&Object.keys(e.headers).forEach((function(n){t.setRequestHeader(n,e.headers[n])}));var o=e.data;return o&&"object"===(0,r.Z)(o)&&(o=JSON.stringify(o)),t.send(o),n}}]),e}()},655:(e,t,n)=>{n.r(t),n.d(t,{KernelJavaScript:()=>p});var r=n(795),o=n(249),u=n(371),c=n(754),i=n(987),a=n(58),s=n(162),l=n.n(s);function f(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,a.Z)(e);if(t){var o=(0,a.Z)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,i.Z)(this,n)}}var p=function(e){(0,c.Z)(a,e);var t,n,i=f(a);function a(e){var t;return(0,o.Z)(this,a),(t=i.call(this,e))._context={Basthon:void 0,Jupyter:void 0,window:void 0},t.execution_count=0,t}return(0,u.Z)(a,[{key:"language",value:function(){return"javascript"}},{key:"languageName",value:function(){return"Javascript"}},{key:"moduleExts",value:function(){return["js"]}},{key:"launch",value:(n=(0,r.Z)(l().mark((function e(){return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)}))),function(){return n.apply(this,arguments)})},{key:"eval",value:function(e){try{return window.eval("with(Basthon._context) { ".concat(e," }"))}catch(t){if(t instanceof SyntaxError)return new Function("with(this) { ".concat(e," }")).call(this._context);throw t}}},{key:"evalAsync",value:(t=(0,r.Z)(l().mark((function e(t,n,r){var o,u,c,i=arguments;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:(i.length>3&&void 0!==i[3]?i[3]:null).interactive=!0,o=console.log,u=console.error,console.log=n,console.error=r,this.execution_count++,c=void 0;try{c=this.eval(t)}catch(e){console.error("Uncaught ".concat(e.name||"",": ").concat(null==e?void 0:e.message))}return console.log=o,console.error=u,void 0!==c&&(c={"text/plain":JSON.stringify(c)}),e.abrupt("return",[c,this.execution_count]);case 13:case"end":return e.stop()}}),e,this)}))),function(e,n,r){return t.apply(this,arguments)})},{key:"ps1",value:function(){return" js> "}},{key:"ps2",value:function(){return"...> "}},{key:"restart",value:function(){}},{key:"more",value:function(e){return!1}},{key:"complete",value:function(e){return[]}},{key:"putFile",value:function(e,t){console.error("Fichier ".concat(e," not added since putFile has no mean in the JS context."))}},{key:"putModule",value:function(e,t){if(t=new Uint8Array(t),"js"!==e.split(".").pop())throw{message:"Only '.js' files supported."};var n=new TextDecoder("utf-8").decode(t);this.eval(n)}}]),a}(n(305).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})},58:(e,t,n)=>{function r(e){return r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},r(e)}n.d(t,{Z:()=>r})},754:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(960);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)}},987:(e,t,n)=>{n.d(t,{Z:()=>u});var r=n(522),o=n(753);function u(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)}},960:(e,t,n)=>{function r(e,t){return r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},r(e,t)}n.d(t,{Z:()=>r})},522:(e,t,n)=>{function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n.d(t,{Z:()=>r})}}]);
2
2
  //# sourceMappingURL=kernel-javascript_lib_index_js.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"kernel-javascript_lib_index_js.js","mappings":"yPAAe,SAASA,IACtB,GAAuB,oBAAZC,UAA4BA,QAAQC,UAAW,OAAO,EACjE,GAAID,QAAQC,UAAUC,KAAM,OAAO,EACnC,GAAqB,mBAAVC,MAAsB,OAAO,EAExC,IAEE,OADAC,QAAQC,UAAUC,QAAQC,KAAKP,QAAQC,UAAUG,QAAS,IAAI,iBACvD,EACP,MAAOI,GACP,OAAO,GCPI,SAASC,EAAWC,EAAQC,EAAMC,GAc/C,OAZEH,EADE,IACWT,QAAQC,UAER,SAAoBS,EAAQC,EAAMC,GAC7C,IAAIC,EAAI,CAAC,MACTA,EAAEC,KAAKC,MAAMF,EAAGF,GAChB,IACIK,EAAW,IADGC,SAASC,KAAKH,MAAML,EAAQG,IAG9C,OADID,IAAO,EAAAO,EAAA,GAAeH,EAAUJ,EAAMP,WACnCW,GAIJP,EAAWM,MAAM,KAAMK,WCZjB,SAASC,EAAiBT,GACvC,IAAIU,EAAwB,mBAARC,IAAqB,IAAIA,SAAQC,EA8BrD,OA5BAH,EAAmB,SAA0BT,GAC3C,GAAc,OAAVA,ICRkCa,EDQEb,GCPsB,IAAzDK,SAASS,SA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,UAAY+B,OAAOC,OAAOqI,GAAcA,EAAWrK,UAAW,CACrE8B,YAAa,CACXG,MAAOmI,EACPjI,UAAU,EACVC,cAAc,KAGlBL,OAAOuI,eAAeF,EAAU,YAAa,CAC3CjI,UAAU,IAERkI,IAAY,OAAeD,EAAUC,K,qDCd5B,SAASE,EAA2BT,EAAM5J,GACvD,GAAIA,IAA2B,YAAlB,OAAQA,IAAsC,mBAATA,GAChD,OAAOA,EACF,QAAa,IAATA,EACT,MAAM,IAAIqB,UAAU,4DAGtB,OAAO,OAAsBuI,K,cCThB,SAASU,EAAgBP,EAAGQ,GAMzC,OALAD,EAAkBzI,OAAOjB,gBAAkB,SAAyBmJ,EAAGQ,GAErE,OADAR,EAAEC,UAAYO,EACPR,GAGFO,EAAgBP,EAAGQ,G,gCCNb,SAASC,EAAQvE,GAG9B,OAAOuE,EAAU,mBAAqBC,QAAU,iBAAmBA,OAAOC,SAAW,SAAUzE,GAC7F,cAAcA,GACZ,SAAUA,GACZ,OAAOA,GAAO,mBAAqBwE,QAAUxE,EAAIrE,cAAgB6I,QAAUxE,IAAQwE,OAAO3K,UAAY,gBAAkBmG,GACvHuE,EAAQvE,G","sources":["webpack://@basthon/browser-bundle/../../node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js","webpack://@basthon/browser-bundle/../../node_modules/@babel/runtime/helpers/esm/construct.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","webpack://@basthon/browser-bundle/../kernel-base/lib/kernel.js","webpack://@basthon/browser-bundle/../kernel-base/lib/version.js","webpack://@basthon/browser-bundle/../kernel-javascript/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/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/typeof.js"],"sourcesContent":["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\n try {\n Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\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;\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\n return _construct.apply(null, arguments);\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\n _wrapNativeSuper = function _wrapNativeSuper(Class) {\n if (Class === null || !isNativeFunction(Class)) return Class;\n\n if (typeof Class !== \"function\") {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n if (typeof _cache !== \"undefined\") {\n if (_cache.has(Class)) return _cache.get(Class);\n\n _cache.set(Class, Wrapper);\n }\n\n function Wrapper() {\n return construct(Class, arguments, getPrototypeOf(this).constructor);\n }\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\n return _wrapNativeSuper(Class);\n}","export default function _isNativeFunction(fn) {\n return Function.toString.call(fn).indexOf(\"[native code]\") !== -1;\n}","import { PromiseDelegate } from \"promise-delegate\";\nimport { VERSION } from './version';\n/**\n * An error thrown by not implemented API functions.\n */\nclass NotImplementedError extends Error {\n constructor(funcName) {\n super(`Function ${funcName} not implemented!`);\n this.name = \"NotImplementedError\";\n }\n}\n/**\n * Event for Basthon's dispatch/listen.\n */\nclass BasthonEvent extends Event {\n constructor(id, data) {\n super(id);\n this.detail = data;\n }\n}\n/**\n * API that any Basthon kernel should fill to be supported\n * in console/notebook.\n */\nexport class KernelBase {\n constructor(rootPath) {\n this._ready = false;\n this._loaded = new PromiseDelegate();\n this.execution_count = 0;\n // root path where kernel is installed\n this._rootPath = rootPath;\n }\n /**\n * Kernel version number (string).\n */\n version() { return VERSION; }\n ;\n /**\n * Language implemented in the kernel (string).\n * Generally lower case.\n */\n language() { throw new NotImplementedError(\"language\"); }\n ;\n /**\n * Language name implemented in the kernel (string).\n * As it should be displayed in text.\n */\n languageName() { throw new NotImplementedError(\"languageName\"); }\n ;\n /**\n * Script (module) file extensions\n */\n moduleExts() {\n throw new NotImplementedError(\"moduleExts\");\n }\n ;\n /**\n * Launch the kernel.\n */\n async launch() { throw new NotImplementedError(\"launch\"); }\n ;\n /**\n * Async code evaluation that resolves with the result.\n */\n evalAsync(code, outCallback, errCallback, data = null) {\n throw new NotImplementedError(\"evalAsync\");\n }\n ;\n restart() { throw new NotImplementedError(\"restart\"); }\n ;\n putFile(filename, content) {\n throw new NotImplementedError(\"putFile\");\n }\n ;\n putModule(filename, content) {\n throw new NotImplementedError(\"putModule\");\n }\n ;\n userModules() { return []; }\n ;\n getFile(path) { throw new NotImplementedError(\"getFile\"); }\n ;\n getUserModuleFile(filename) {\n throw new NotImplementedError(\"getUserModuleFile\");\n }\n ;\n more(source) { throw new NotImplementedError(\"more\"); }\n ;\n complete(code) { return []; }\n ;\n banner() { return `Welcome to the ${this.languageName()} REPL!`; }\n ;\n ps1() { return \">>> \"; }\n ;\n ps2() { return \"... \"; }\n ;\n /**\n * Initialize the kernel.\n */\n async init() {\n try {\n await this.launch();\n }\n catch (error) {\n this._loaded.reject(error);\n return;\n }\n // connecting eval to basthon.eval.request event.\n this.addEventListener(\"eval.request\", this.evalFromEvent.bind(this));\n this._ready = true;\n this._loaded.resolve();\n }\n /**\n * Is the kernel ready?\n */\n get ready() { return this._ready; }\n /**\n * Promise that resolve when the kernel is loaded.\n */\n async loaded() { await this._loaded.promise; }\n /**\n * Root for kernel files. This is always the versnion number\n * directory inside the kernel directory.\n */\n basthonRoot(absolute = false) {\n let url = this._rootPath + \"/\" + this.version();\n if (absolute && !url.startsWith(\"http\")) {\n const base = window.location.origin + window.location.pathname;\n url = base.substring(0, base.lastIndexOf('/')) + \"/\" + url;\n }\n return url;\n }\n /**\n * Downloading data (bytes array) as filename\n * (opening browser dialog).\n */\n download(data, filename) {\n let blob = new Blob([data], { type: \"application/octet-stream\" });\n let anchor = document.createElement(\"a\");\n anchor.download = filename;\n anchor.href = window.URL.createObjectURL(blob);\n anchor.target = \"_blank\";\n anchor.style.display = \"none\"; // just to be safe!\n document.body.appendChild(anchor);\n anchor.click();\n document.body.removeChild(anchor);\n }\n ;\n /**\n * Dynamically load a script asynchronously.\n */\n static loadScript(url) {\n return new Promise(function (resolve, reject) {\n let script = document.createElement('script');\n script.onload = resolve;\n script.onerror = reject;\n script.src = url;\n document.head.appendChild(script);\n });\n }\n ;\n /**\n * Wraper around XMLHttpRequest.\n */\n static xhr(params) {\n const xhr = new XMLHttpRequest();\n xhr.open(params.method, params.url, true);\n if (params.responseType != null)\n xhr.responseType = params.responseType;\n const promise = new Promise(function (resolve, reject) {\n xhr.onload = function () {\n if (xhr.status >= 200 && xhr.status < 300) {\n resolve(xhr.response);\n }\n else {\n reject(xhr);\n }\n };\n xhr.onerror = function () { reject(xhr); };\n });\n // headers\n if (params.headers) {\n Object.keys(params.headers).forEach(function (key) {\n xhr.setRequestHeader(key, params.headers[key]);\n });\n }\n // data\n let data = params.data;\n if (data && typeof data === 'object') {\n data = JSON.stringify(data);\n }\n xhr.send(data);\n return promise;\n }\n ;\n /**\n * Wrapper around document.dispatchEvent.\n * It adds the 'basthon.' prefix to each event name and\n * manage the event lookup to retreive relevent data.\n */\n dispatchEvent(eventName, data) {\n document.dispatchEvent(new BasthonEvent(`basthon.${eventName}`, data));\n }\n ;\n /**\n * Wrapper around document.addEventListener.\n * It manages the 'basthon.' prefix to each event name and\n * manage the event lookup to retreive relevent data.\n */\n addEventListener(eventName, callback) {\n document.addEventListener(`basthon.${eventName}`, function (event) { callback(event.detail); });\n }\n ;\n /**\n * Simple clone via JSON copy.\n */\n clone(obj) {\n // simple trick that is enough for our purpose.\n return JSON.parse(JSON.stringify(obj));\n }\n ;\n /**\n * Put a ressource (file or module).\n * Detection is based on extension.\n */\n putRessource(filename, content) {\n var _a;\n const ext = (_a = filename.split('.').pop()) !== null && _a !== void 0 ? _a : \"\";\n if (this.moduleExts().includes(ext)) {\n return this.putModule(filename, content);\n }\n else {\n return this.putFile(filename, content);\n }\n }\n ;\n /**\n * Internal. Code evaluation after an eval.request event.\n */\n async evalFromEvent(data) {\n const stdCallback = (std) => (text) => {\n let dataEvent = this.clone(data);\n dataEvent.stream = std;\n dataEvent.content = text;\n this.dispatchEvent(\"eval.output\", dataEvent);\n };\n const outCallback = stdCallback(\"stdout\");\n const errCallback = stdCallback(\"stderr\");\n let args;\n try {\n args = await this.evalAsync(data.code, outCallback, errCallback, data);\n }\n catch (error) {\n errCallback(error.toString());\n const dataEvent = this.clone(data);\n dataEvent.error = error;\n dataEvent.execution_count = this.execution_count;\n this.dispatchEvent(\"eval.error\", dataEvent);\n return;\n }\n if (args == null)\n return; // this should not happend\n const result = args[0];\n const executionCount = args[1];\n let dataEvent = this.clone(data);\n dataEvent.execution_count = executionCount;\n if (result != null)\n dataEvent.result = result;\n this.dispatchEvent(\"eval.finished\", dataEvent);\n }\n}\n","export const VERSION = \"0.40.8\";\n","import { KernelBase } from '@basthon/kernel-base';\nexport class KernelJavaScript extends KernelBase {\n constructor(rootPath) {\n super(rootPath);\n this._context = {\n Basthon: undefined,\n Jupyter: undefined,\n window: undefined,\n };\n this.execution_count = 0;\n }\n ;\n ;\n language() { return \"javascript\"; }\n ;\n languageName() { return \"Javascript\"; }\n ;\n moduleExts() { return ['js']; }\n ;\n async launch() { }\n ;\n eval(code) {\n try {\n // using context to hide several global variables\n return window.eval(`with(Basthon._context) { ${code} }`);\n }\n catch (e) {\n if (e instanceof SyntaxError)\n return (new Function(`with(this) { ${code} }`)).call(this._context);\n throw e;\n }\n }\n ;\n async evalAsync(code, outCallback, errCallback, data = null) {\n // force interactivity in all modes\n data.interactive = true;\n // backup\n const console_log = console.log;\n const console_error = console.error;\n console.log = outCallback;\n console.error = errCallback;\n this.execution_count++;\n // evaluation\n let result = undefined;\n try {\n result = this.eval(code);\n }\n catch (e) {\n console.error(`Uncaught ${e.name || \"\"}: ${e === null || e === void 0 ? void 0 : e.message}`);\n }\n // restoration\n console.log = console_log;\n console.error = console_error;\n // return result\n if (typeof result !== 'undefined')\n result = { 'text/plain': JSON.stringify(result) };\n return [result, this.execution_count];\n }\n ;\n ps1() { return \" js> \"; }\n ;\n ps2() { return \"...> \"; }\n ;\n restart() { }\n ;\n more(source) { return false; }\n ;\n complete(code) { return []; }\n ;\n putFile(filename, content) {\n console.error(`Fichier ${filename} not added since putFile has no mean in the JS context.`);\n }\n ;\n putModule(filename, content) {\n content = new Uint8Array(content);\n const ext = filename.split('.').pop();\n switch (ext) {\n case 'js':\n let decoder = new TextDecoder(\"utf-8\");\n const _content = decoder.decode(content);\n this.eval(_content);\n break;\n default:\n throw { message: \"Only '.js' files supported.\" };\n }\n }\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\n return self;\n}","export default function _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : 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\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\n return assertThisInitialized(self);\n}","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}","export default function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, _typeof(obj);\n}"],"names":["_isNativeReflectConstruct","Reflect","construct","sham","Proxy","Boolean","prototype","valueOf","call","e","_construct","Parent","args","Class","a","push","apply","instance","Function","bind","setPrototypeOf","arguments","_wrapNativeSuper","_cache","Map","undefined","fn","toString","indexOf","TypeError","has","get","set","Wrapper","getPrototypeOf","this","constructor","Object","create","value","enumerable","writable","configurable","NotImplementedError","funcName","name","Error","BasthonEvent","id","data","detail","Event","KernelBase","rootPath","_ready","_loaded","PromiseDelegate","execution_count","_rootPath","code","outCallback","errCallback","filename","content","path","source","languageName","launch","reject","addEventListener","evalFromEvent","resolve","promise","absolute","url","version","startsWith","base","window","location","origin","pathname","substring","lastIndexOf","blob","Blob","type","anchor","document","createElement","download","href","URL","createObjectURL","target","style","display","body","appendChild","click","removeChild","eventName","dispatchEvent","callback","event","obj","JSON","parse","stringify","_a","ext","split","pop","moduleExts","includes","putModule","putFile","stdCallback","std","text","dataEvent","clone","stream","evalAsync","error","result","executionCount","Promise","script","onload","onerror","src","head","params","xhr","XMLHttpRequest","open","method","responseType","status","response","headers","keys","forEach","key","setRequestHeader","send","KernelJavaScript","_context","Basthon","Jupyter","eval","SyntaxError","interactive","console_log","console","log","console_error","message","Uint8Array","_content","TextDecoder","decode","_assertThisInitialized","self","ReferenceError","_getPrototypeOf","o","__proto__","_inherits","subClass","superClass","defineProperty","_possibleConstructorReturn","_setPrototypeOf","p","_typeof","Symbol","iterator"],"sourceRoot":""}
1
+ {"version":3,"file":"kernel-javascript_lib_index_js.js","mappings":"yPAAe,SAASA,IACtB,GAAuB,oBAAZC,UAA4BA,QAAQC,UAAW,OAAO,EACjE,GAAID,QAAQC,UAAUC,KAAM,OAAO,EACnC,GAAqB,mBAAVC,MAAsB,OAAO,EAExC,IAEE,OADAC,QAAQC,UAAUC,QAAQC,KAAKP,QAAQC,UAAUG,QAAS,IAAI,iBACvD,EACP,MAAOI,GACP,OAAO,GCPI,SAASC,EAAWC,EAAQC,EAAMC,GAc/C,OAZEH,EADE,IACWT,QAAQC,UAER,SAAoBS,EAAQC,EAAMC,GAC7C,IAAIC,EAAI,CAAC,MACTA,EAAEC,KAAKC,MAAMF,EAAGF,GAChB,IACIK,EAAW,IADGC,SAASC,KAAKH,MAAML,EAAQG,IAG9C,OADID,IAAO,EAAAO,EAAA,GAAeH,EAAUJ,EAAMP,WACnCW,GAIJP,EAAWM,MAAM,KAAMK,WCZjB,SAASC,EAAiBT,GACvC,IAAIU,EAAwB,mBAARC,IAAqB,IAAIA,SAAQC,EA8BrD,OA5B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AC1C,GAA0B,mBAAfA,GAA4C,OAAfA,EACtC,MAAM,IAAI9I,UAAU,sDAGtB6I,EAASpK,UAAY+B,OAAOC,OAAOqI,GAAcA,EAAWrK,UAAW,CACrE8B,YAAa,CACXG,MAAOmI,EACPjI,UAAU,EACVC,cAAc,KAGlBL,OAAOuI,eAAeF,EAAU,YAAa,CAC3CjI,UAAU,IAERkI,IAAY,OAAeD,EAAUC,K,qDCd5B,SAASE,EAA2BT,EAAM5J,GACvD,GAAIA,IAA2B,YAAlB,OAAQA,IAAsC,mBAATA,GAChD,OAAOA,EACF,QAAa,IAATA,EACT,MAAM,IAAIqB,UAAU,4DAGtB,OAAO,OAAsBuI,K,cCThB,SAASU,EAAgBP,EAAGQ,GAMzC,OALAD,EAAkBzI,OAAOjB,gBAAkB,SAAyBmJ,EAAGQ,GAErE,OADAR,EAAEC,UAAYO,EACPR,GAGFO,EAAgBP,EAAGQ,G,gCCNb,SAASC,EAAQvE,GAG9B,OAAOuE,EAAU,mBAAqBC,QAAU,iBAAmBA,OAAOC,SAAW,SAAUzE,GAC7F,cAAcA,GACZ,SAAUA,GACZ,OAAOA,GAAO,mBAAqBwE,QAAUxE,EAAIrE,cAAgB6I,QAAUxE,IAAQwE,OAAO3K,UAAY,gBAAkBmG,GACvHuE,EAAQvE,G","sources":["webpack://@basthon/browser-bundle/../../node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js","webpack://@basthon/browser-bundle/../../node_modules/@babel/runtime/helpers/esm/construct.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","webpack://@basthon/browser-bundle/../kernel-base/lib/kernel.js","webpack://@basthon/browser-bundle/../kernel-base/lib/version.js","webpack://@basthon/browser-bundle/../kernel-javascript/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/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/typeof.js"],"sourcesContent":["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\n try {\n Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\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;\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\n return _construct.apply(null, arguments);\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\n _wrapNativeSuper = function _wrapNativeSuper(Class) {\n if (Class === null || !isNativeFunction(Class)) return Class;\n\n if (typeof Class !== \"function\") {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n if (typeof _cache !== \"undefined\") {\n if (_cache.has(Class)) return _cache.get(Class);\n\n _cache.set(Class, Wrapper);\n }\n\n function Wrapper() {\n return construct(Class, arguments, getPrototypeOf(this).constructor);\n }\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\n return _wrapNativeSuper(Class);\n}","export default function _isNativeFunction(fn) {\n return Function.toString.call(fn).indexOf(\"[native code]\") !== -1;\n}","import { PromiseDelegate } from \"promise-delegate\";\nimport { VERSION } from './version';\n/**\n * An error thrown by not implemented API functions.\n */\nclass NotImplementedError extends Error {\n constructor(funcName) {\n super(`Function ${funcName} not implemented!`);\n this.name = \"NotImplementedError\";\n }\n}\n/**\n * Event for Basthon's dispatch/listen.\n */\nclass BasthonEvent extends Event {\n constructor(id, data) {\n super(id);\n this.detail = data;\n }\n}\n/**\n * API that any Basthon kernel should fill to be supported\n * in console/notebook.\n */\nexport class KernelBase {\n constructor(rootPath) {\n this._ready = false;\n this._loaded = new PromiseDelegate();\n this.execution_count = 0;\n // root path where kernel is installed\n this._rootPath = rootPath;\n }\n /**\n * Kernel version number (string).\n */\n version() { return VERSION; }\n ;\n /**\n * Language implemented in the kernel (string).\n * Generally lower case.\n */\n language() { throw new NotImplementedError(\"language\"); }\n ;\n /**\n * Language name implemented in the kernel (string).\n * As it should be displayed in text.\n */\n languageName() { throw new NotImplementedError(\"languageName\"); }\n ;\n /**\n * Script (module) file extensions\n */\n moduleExts() {\n throw new NotImplementedError(\"moduleExts\");\n }\n ;\n /**\n * Launch the kernel.\n */\n async launch() { throw new NotImplementedError(\"launch\"); }\n ;\n /**\n * Async code evaluation that resolves with the result.\n */\n evalAsync(code, outCallback, errCallback, data = null) {\n throw new NotImplementedError(\"evalAsync\");\n }\n ;\n restart() { throw new NotImplementedError(\"restart\"); }\n ;\n putFile(filename, content) {\n throw new NotImplementedError(\"putFile\");\n }\n ;\n putModule(filename, content) {\n throw new NotImplementedError(\"putModule\");\n }\n ;\n userModules() { return []; }\n ;\n getFile(path) { throw new NotImplementedError(\"getFile\"); }\n ;\n getUserModuleFile(filename) {\n throw new NotImplementedError(\"getUserModuleFile\");\n }\n ;\n more(source) { throw new NotImplementedError(\"more\"); }\n ;\n complete(code) { return []; }\n ;\n banner() { return `Welcome to the ${this.languageName()} REPL!`; }\n ;\n ps1() { return \">>> \"; }\n ;\n ps2() { return \"... \"; }\n ;\n /**\n * Initialize the kernel.\n */\n async init() {\n try {\n await this.launch();\n }\n catch (error) {\n this._loaded.reject(error);\n return;\n }\n // connecting eval to basthon.eval.request event.\n this.addEventListener(\"eval.request\", this.evalFromEvent.bind(this));\n this._ready = true;\n this._loaded.resolve();\n }\n /**\n * Is the kernel ready?\n */\n get ready() { return this._ready; }\n /**\n * Promise that resolve when the kernel is loaded.\n */\n async loaded() { await this._loaded.promise; }\n /**\n * Root for kernel files. This is always the versnion number\n * directory inside the kernel directory.\n */\n basthonRoot(absolute = false) {\n let url = this._rootPath + \"/\" + this.version();\n if (absolute && !url.startsWith(\"http\")) {\n const base = window.location.origin + window.location.pathname;\n url = base.substring(0, base.lastIndexOf('/')) + \"/\" + url;\n }\n return url;\n }\n /**\n * Downloading data (bytes array) as filename\n * (opening browser dialog).\n */\n download(data, filename) {\n let blob = new Blob([data], { type: \"application/octet-stream\" });\n let anchor = document.createElement(\"a\");\n anchor.download = filename;\n anchor.href = window.URL.createObjectURL(blob);\n anchor.target = \"_blank\";\n anchor.style.display = \"none\"; // just to be safe!\n document.body.appendChild(anchor);\n anchor.click();\n document.body.removeChild(anchor);\n }\n ;\n /**\n * Dynamically load a script asynchronously.\n */\n static loadScript(url) {\n return new Promise(function (resolve, reject) {\n let script = document.createElement('script');\n script.onload = resolve;\n script.onerror = reject;\n script.src = url;\n document.head.appendChild(script);\n });\n }\n ;\n /**\n * Wraper around XMLHttpRequest.\n */\n static xhr(params) {\n const xhr = new XMLHttpRequest();\n xhr.open(params.method, params.url, true);\n if (params.responseType != null)\n xhr.responseType = params.responseType;\n const promise = new Promise(function (resolve, reject) {\n xhr.onload = function () {\n if (xhr.status >= 200 && xhr.status < 300) {\n resolve(xhr.response);\n }\n else {\n reject(xhr);\n }\n };\n xhr.onerror = function () { reject(xhr); };\n });\n // headers\n if (params.headers) {\n Object.keys(params.headers).forEach(function (key) {\n xhr.setRequestHeader(key, params.headers[key]);\n });\n }\n // data\n let data = params.data;\n if (data && typeof data === 'object') {\n data = JSON.stringify(data);\n }\n xhr.send(data);\n return promise;\n }\n ;\n /**\n * Wrapper around document.dispatchEvent.\n * It adds the 'basthon.' prefix to each event name and\n * manage the event lookup to retreive relevent data.\n */\n dispatchEvent(eventName, data) {\n document.dispatchEvent(new BasthonEvent(`basthon.${eventName}`, data));\n }\n ;\n /**\n * Wrapper around document.addEventListener.\n * It manages the 'basthon.' prefix to each event name and\n * manage the event lookup to retreive relevent data.\n */\n addEventListener(eventName, callback) {\n document.addEventListener(`basthon.${eventName}`, function (event) { callback(event.detail); });\n }\n ;\n /**\n * Simple clone via JSON copy.\n */\n clone(obj) {\n // simple trick that is enough for our purpose.\n return JSON.parse(JSON.stringify(obj));\n }\n ;\n /**\n * Put a ressource (file or module).\n * Detection is based on extension.\n */\n putRessource(filename, content) {\n var _a;\n const ext = (_a = filename.split('.').pop()) !== null && _a !== void 0 ? _a : \"\";\n if (this.moduleExts().includes(ext)) {\n return this.putModule(filename, content);\n }\n else {\n return this.putFile(filename, content);\n }\n }\n ;\n /**\n * Internal. Code evaluation after an eval.request event.\n */\n async evalFromEvent(data) {\n const stdCallback = (std) => (text) => {\n let dataEvent = this.clone(data);\n dataEvent.stream = std;\n dataEvent.content = text;\n this.dispatchEvent(\"eval.output\", dataEvent);\n };\n const outCallback = stdCallback(\"stdout\");\n const errCallback = stdCallback(\"stderr\");\n let args;\n try {\n args = await this.evalAsync(data.code, outCallback, errCallback, data);\n }\n catch (error) {\n errCallback(error.toString());\n const dataEvent = this.clone(data);\n dataEvent.error = error;\n dataEvent.execution_count = this.execution_count;\n this.dispatchEvent(\"eval.error\", dataEvent);\n return;\n }\n if (args == null)\n return; // this should not happend\n const result = args[0];\n const executionCount = args[1];\n let dataEvent = this.clone(data);\n dataEvent.execution_count = executionCount;\n if (result != null)\n dataEvent.result = result;\n this.dispatchEvent(\"eval.finished\", dataEvent);\n }\n}\n","export const VERSION = \"0.40.9\";\n","import { KernelBase } from '@basthon/kernel-base';\nexport class KernelJavaScript extends KernelBase {\n constructor(rootPath) {\n super(rootPath);\n this._context = {\n Basthon: undefined,\n Jupyter: undefined,\n window: undefined,\n };\n this.execution_count = 0;\n }\n ;\n ;\n language() { return \"javascript\"; }\n ;\n languageName() { return \"Javascript\"; }\n ;\n moduleExts() { return ['js']; }\n ;\n async launch() { }\n ;\n eval(code) {\n try {\n // using context to hide several global variables\n return window.eval(`with(Basthon._context) { ${code} }`);\n }\n catch (e) {\n if (e instanceof SyntaxError)\n return (new Function(`with(this) { ${code} }`)).call(this._context);\n throw e;\n }\n }\n ;\n async evalAsync(code, outCallback, errCallback, data = null) {\n // force interactivity in all modes\n data.interactive = true;\n // backup\n const console_log = console.log;\n const console_error = console.error;\n console.log = outCallback;\n console.error = errCallback;\n this.execution_count++;\n // evaluation\n let result = undefined;\n try {\n result = this.eval(code);\n }\n catch (e) {\n console.error(`Uncaught ${e.name || \"\"}: ${e === null || e === void 0 ? void 0 : e.message}`);\n }\n // restoration\n console.log = console_log;\n console.error = console_error;\n // return result\n if (typeof result !== 'undefined')\n result = { 'text/plain': JSON.stringify(result) };\n return [result, this.execution_count];\n }\n ;\n ps1() { return \" js> \"; }\n ;\n ps2() { return \"...> \"; }\n ;\n restart() { }\n ;\n more(source) { return false; }\n ;\n complete(code) { return []; }\n ;\n putFile(filename, content) {\n console.error(`Fichier ${filename} not added since putFile has no mean in the JS context.`);\n }\n ;\n putModule(filename, content) {\n content = new Uint8Array(content);\n const ext = filename.split('.').pop();\n switch (ext) {\n case 'js':\n let decoder = new TextDecoder(\"utf-8\");\n const _content = decoder.decode(content);\n this.eval(_content);\n break;\n default:\n throw { message: \"Only '.js' files supported.\" };\n }\n }\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\n return self;\n}","export default function _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : 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\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\n return assertThisInitialized(self);\n}","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}","export default function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, _typeof(obj);\n}"],"names":["_isNativeReflectConstruct","Reflect","construct","sham","Proxy","Boolean","prototype","valueOf","call","e","_construct","Parent","args","Class","a","push","apply","instance","Function","bind","setPrototypeOf","arguments","_wrapNativeSuper","_cache","Map","undefined","fn","toString","indexOf","TypeError","has","get","set","Wrapper","getPrototypeOf","this","constructor","Object","create","value","enumerable","writable","configurable","NotImplementedError","funcName","name","Error","BasthonEvent","id","data","detail","Event","KernelBase","rootPath","_ready","_loaded","PromiseDelegate","execution_count","_rootPath","code","outCallback","errCallback","filename","content","path","source","languageName","launch","reject","addEventListener","evalFromEvent","resolve","promise","absolute","url","version","startsWith","base","window","location","origin","pathname","substring","lastIndexOf","blob","Blob","type","anchor","document","createElement","download","href","URL","createObjectURL","target","style","display","body","appendChild","click","removeChild","eventName","dispatchEvent","callback","event","obj","JSON","parse","stringify","_a","ext","split","pop","moduleExts","includes","putModule","putFile","stdCallback","std","text","dataEvent","clone","stream","evalAsync","error","result","executionCount","Promise","script","onload","onerror","src","head","params","xhr","XMLHttpRequest","open","method","responseType","status","response","headers","keys","forEach","key","setRequestHeader","send","KernelJavaScript","_context","Basthon","Jupyter","eval","SyntaxError","interactive","console_log","console","log","console_error","message","Uint8Array","_content","TextDecoder","decode","_assertThisInitialized","self","ReferenceError","_getPrototypeOf","o","__proto__","_inherits","subClass","superClass","defineProperty","_possibleConstructorReturn","_setPrototypeOf","p","_typeof","Symbol","iterator"],"sourceRoot":""}
@@ -1,2 +1,2 @@
1
- "use strict";(self.webpackChunk_basthon_browser_bundle=self.webpackChunk_basthon_browser_bundle||[]).push([["kernel-ocaml_lib_index_js"],{305:(e,t,n)=>{n.d(t,{H:()=>m});var r=n(522),o=n(795),u=n(371),i=n(249),c=n(754),a=n(987),l=n(58),s=n(960);function f(){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}}function p(e,t,n){return p=f()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&(0,s.Z)(o,n.prototype),o},p.apply(null,arguments)}function h(e){var t="function"==typeof Map?new Map:void 0;return h=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,r)}function r(){return p(e,arguments,(0,l.Z)(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),(0,s.Z)(r,e)},h(e)}var v=n(162),d=n.n(v),y=n(490);function _(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,l.Z)(e);if(t){var o=(0,l.Z)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,a.Z)(this,n)}}var k=function(e){(0,c.Z)(n,e);var t=_(n);function n(e){var r;return(0,i.Z)(this,n),(r=t.call(this,"Function ".concat(e," not implemented!"))).name="NotImplementedError",r}return(0,u.Z)(n)}(h(Error)),w=function(e){(0,c.Z)(n,e);var t=_(n);function n(e,r){var o;return(0,i.Z)(this,n),(o=t.call(this,e)).detail=r,o}return(0,u.Z)(n)}(h(Event)),m=function(){function e(t){(0,i.Z)(this,e),this._ready=!1,this._loaded=new y.I,this.execution_count=0,this._rootPath=t}var t,n,c,a;return(0,u.Z)(e,[{key:"version",value:function(){return"0.40.8"}},{key:"language",value:function(){throw new k("language")}},{key:"languageName",value:function(){throw new k("languageName")}},{key:"moduleExts",value:function(){throw new k("moduleExts")}},{key:"launch",value:(a=(0,o.Z)(d().mark((function e(){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new k("launch");case 1:case"end":return e.stop()}}),e)}))),function(){return a.apply(this,arguments)})},{key:"evalAsync",value:function(e,t,n){throw new k("evalAsync")}},{key:"restart",value:function(){throw new k("restart")}},{key:"putFile",value:function(e,t){throw new k("putFile")}},{key:"putModule",value:function(e,t){throw new k("putModule")}},{key:"userModules",value:function(){return[]}},{key:"getFile",value:function(e){throw new k("getFile")}},{key:"getUserModuleFile",value:function(e){throw new k("getUserModuleFile")}},{key:"more",value:function(e){throw new k("more")}},{key:"complete",value:function(e){return[]}},{key:"banner",value:function(){return"Welcome to the ".concat(this.languageName()," REPL!")}},{key:"ps1",value:function(){return">>> "}},{key:"ps2",value:function(){return"... "}},{key:"init",value:(c=(0,o.Z)(d().mark((function e(){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.launch();case 3:e.next=9;break;case 5:return e.prev=5,e.t0=e.catch(0),this._loaded.reject(e.t0),e.abrupt("return");case 9:this.addEventListener("eval.request",this.evalFromEvent.bind(this)),this._ready=!0,this._loaded.resolve();case 12:case"end":return e.stop()}}),e,this,[[0,5]])}))),function(){return c.apply(this,arguments)})},{key:"ready",get:function(){return this._ready}},{key:"loaded",value:(n=(0,o.Z)(d().mark((function e(){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._loaded.promise;case 2:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"basthonRoot",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this._rootPath+"/"+this.version();if(e&&!t.startsWith("http")){var n=window.location.origin+window.location.pathname;t=n.substring(0,n.lastIndexOf("/"))+"/"+t}return t}},{key:"download",value:function(e,t){var n=new Blob([e],{type:"application/octet-stream"}),r=document.createElement("a");r.download=t,r.href=window.URL.createObjectURL(n),r.target="_blank",r.style.display="none",document.body.appendChild(r),r.click(),document.body.removeChild(r)}},{key:"dispatchEvent",value:function(e,t){document.dispatchEvent(new w("basthon.".concat(e),t))}},{key:"addEventListener",value:function(e,t){document.addEventListener("basthon.".concat(e),(function(e){t(e.detail)}))}},{key:"clone",value:function(e){return JSON.parse(JSON.stringify(e))}},{key:"putRessource",value:function(e,t){var n,r=null!==(n=e.split(".").pop())&&void 0!==n?n:"";return this.moduleExts().includes(r)?this.putModule(e,t):this.putFile(e,t)}},{key:"evalFromEvent",value:(t=(0,o.Z)(d().mark((function e(t){var n,r,o,u,i,c,a,l,s=this;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=function(e){return function(n){var r=s.clone(t);r.stream=e,r.content=n,s.dispatchEvent("eval.output",r)}},r=n("stdout"),o=n("stderr"),e.prev=3,e.next=6,this.evalAsync(t.code,r,o,t);case 6:u=e.sent,e.next=17;break;case 9:return e.prev=9,e.t0=e.catch(3),o(e.t0.toString()),(i=this.clone(t)).error=e.t0,i.execution_count=this.execution_count,this.dispatchEvent("eval.error",i),e.abrupt("return");case 17:if(null!=u){e.next=19;break}return e.abrupt("return");case 19:c=u[0],a=u[1],(l=this.clone(t)).execution_count=a,null!=c&&(l.result=c),this.dispatchEvent("eval.finished",l);case 25:case"end":return e.stop()}}),e,this,[[3,9]])}))),function(e){return t.apply(this,arguments)})}],[{key:"loadScript",value:function(e){return new Promise((function(t,n){var r=document.createElement("script");r.onload=t,r.onerror=n,r.src=e,document.head.appendChild(r)}))}},{key:"xhr",value:function(e){var t=new XMLHttpRequest;t.open(e.method,e.url,!0),null!=e.responseType&&(t.responseType=e.responseType);var n=new Promise((function(e,n){t.onload=function(){t.status>=200&&t.status<300?e(t.response):n(t)},t.onerror=function(){n(t)}}));e.headers&&Object.keys(e.headers).forEach((function(n){t.setRequestHeader(n,e.headers[n])}));var o=e.data;return o&&"object"===(0,r.Z)(o)&&(o=JSON.stringify(o)),t.send(o),n}}]),e}()},761:(e,t,n)=>{n.r(t),n.d(t,{KernelOCaml:()=>p});var r=n(795),o=n(249),u=n(371),i=n(754),c=n(987),a=n(58),l=n(162),s=n.n(l);function f(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,a.Z)(e);if(t){var o=(0,a.Z)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,c.Z)(this,n)}}var p=function(e){(0,i.Z)(l,e);var t,c,a=f(l);function l(e){return(0,o.Z)(this,l),a.call(this,e)}return(0,u.Z)(l,[{key:"language",value:function(){return"ocaml"}},{key:"languageName",value:function(){return"OCaml"}},{key:"moduleExts",value:function(){return["ml"]}},{key:"launch",value:(c=(0,r.Z)(s().mark((function e(){var t,r;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.e("kernel-ocaml_lib___kernel___js").then(n.t.bind(n,409,23));case 2:t=e.sent,r=t.__kernel__,this.__kernel__=r,this.restart();case 6:case"end":return e.stop()}}),e,this)}))),function(){return c.apply(this,arguments)})},{key:"evalAsync",value:(t=(0,r.Z)(s().mark((function e(t,n,r){var o,u,i,c=arguments;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=c.length>3&&void 0!==c[3]?c[3]:null,null!=this.__kernel__){e.next=3;break}return e.abrupt("return");case 3:return o.interactive=!0,this.__kernel__.io.stdout=n,this.__kernel__.io.stderr=r,this.execution_count++,i=null===(u=this.__kernel__)||void 0===u?void 0:u.exec(t),this.__kernel__.io.stdout=console.log,this.__kernel__.io.stderr=console.error,i="string"==typeof i&&i.length>0?{"text/plain":i.replace(/\n$/,"")}:void 0,e.abrupt("return",[i,this.execution_count]);case 12:case"end":return e.stop()}}),e,this)}))),function(e,n,r){return t.apply(this,arguments)})},{key:"restart",value:function(){var e;if(0!==(null===(e=this.__kernel__)||void 0===e?void 0:e.init()))throw new Error("Can't start OCaml kernel!");this.execution_count=0}},{key:"ocamlDownload",value:function(e,t){this.download(e.c,t)}},{key:"putFile",value:function(e,t){null!=this.__kernel__&&this.__kernel__.createfile(e,t)}},{key:"putModule",value:function(e,t){var n;this.putFile(e,t),null===(n=this.__kernel__)||void 0===n||n.loadmodule(e)}},{key:"userModules",value:function(){return[]}},{key:"getFile",value:function(e){}},{key:"getUserModuleFile",value:function(e){}},{key:"more",value:function(e){return!1}},{key:"banner",value:function(){return" OCaml version 4.11.1\n"}},{key:"ps1",value:function(){return"# "}},{key:"ps2",value:function(){return" "}},{key:"complete",value:function(e){return[]}}]),l}(n(305).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})},58:(e,t,n)=>{function r(e){return r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},r(e)}n.d(t,{Z:()=>r})},754:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(960);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)}},987:(e,t,n)=>{n.d(t,{Z:()=>u});var r=n(522),o=n(753);function u(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)}},960:(e,t,n)=>{function r(e,t){return r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},r(e,t)}n.d(t,{Z:()=>r})},522:(e,t,n)=>{function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n.d(t,{Z:()=>r})}}]);
1
+ "use strict";(self.webpackChunk_basthon_browser_bundle=self.webpackChunk_basthon_browser_bundle||[]).push([["kernel-ocaml_lib_index_js"],{305:(e,t,n)=>{n.d(t,{H:()=>m});var r=n(522),o=n(795),u=n(371),i=n(249),c=n(754),a=n(987),l=n(58),s=n(960);function f(){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}}function p(e,t,n){return p=f()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&(0,s.Z)(o,n.prototype),o},p.apply(null,arguments)}function h(e){var t="function"==typeof Map?new Map:void 0;return h=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,r)}function r(){return p(e,arguments,(0,l.Z)(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),(0,s.Z)(r,e)},h(e)}var v=n(162),d=n.n(v),y=n(490);function _(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,l.Z)(e);if(t){var o=(0,l.Z)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,a.Z)(this,n)}}var k=function(e){(0,c.Z)(n,e);var t=_(n);function n(e){var r;return(0,i.Z)(this,n),(r=t.call(this,"Function ".concat(e," not implemented!"))).name="NotImplementedError",r}return(0,u.Z)(n)}(h(Error)),w=function(e){(0,c.Z)(n,e);var t=_(n);function n(e,r){var o;return(0,i.Z)(this,n),(o=t.call(this,e)).detail=r,o}return(0,u.Z)(n)}(h(Event)),m=function(){function e(t){(0,i.Z)(this,e),this._ready=!1,this._loaded=new y.I,this.execution_count=0,this._rootPath=t}var t,n,c,a;return(0,u.Z)(e,[{key:"version",value:function(){return"0.40.9"}},{key:"language",value:function(){throw new k("language")}},{key:"languageName",value:function(){throw new k("languageName")}},{key:"moduleExts",value:function(){throw new k("moduleExts")}},{key:"launch",value:(a=(0,o.Z)(d().mark((function e(){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new k("launch");case 1:case"end":return e.stop()}}),e)}))),function(){return a.apply(this,arguments)})},{key:"evalAsync",value:function(e,t,n){throw new k("evalAsync")}},{key:"restart",value:function(){throw new k("restart")}},{key:"putFile",value:function(e,t){throw new k("putFile")}},{key:"putModule",value:function(e,t){throw new k("putModule")}},{key:"userModules",value:function(){return[]}},{key:"getFile",value:function(e){throw new k("getFile")}},{key:"getUserModuleFile",value:function(e){throw new k("getUserModuleFile")}},{key:"more",value:function(e){throw new k("more")}},{key:"complete",value:function(e){return[]}},{key:"banner",value:function(){return"Welcome to the ".concat(this.languageName()," REPL!")}},{key:"ps1",value:function(){return">>> "}},{key:"ps2",value:function(){return"... "}},{key:"init",value:(c=(0,o.Z)(d().mark((function e(){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.launch();case 3:e.next=9;break;case 5:return e.prev=5,e.t0=e.catch(0),this._loaded.reject(e.t0),e.abrupt("return");case 9:this.addEventListener("eval.request",this.evalFromEvent.bind(this)),this._ready=!0,this._loaded.resolve();case 12:case"end":return e.stop()}}),e,this,[[0,5]])}))),function(){return c.apply(this,arguments)})},{key:"ready",get:function(){return this._ready}},{key:"loaded",value:(n=(0,o.Z)(d().mark((function e(){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._loaded.promise;case 2:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"basthonRoot",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this._rootPath+"/"+this.version();if(e&&!t.startsWith("http")){var n=window.location.origin+window.location.pathname;t=n.substring(0,n.lastIndexOf("/"))+"/"+t}return t}},{key:"download",value:function(e,t){var n=new Blob([e],{type:"application/octet-stream"}),r=document.createElement("a");r.download=t,r.href=window.URL.createObjectURL(n),r.target="_blank",r.style.display="none",document.body.appendChild(r),r.click(),document.body.removeChild(r)}},{key:"dispatchEvent",value:function(e,t){document.dispatchEvent(new w("basthon.".concat(e),t))}},{key:"addEventListener",value:function(e,t){document.addEventListener("basthon.".concat(e),(function(e){t(e.detail)}))}},{key:"clone",value:function(e){return JSON.parse(JSON.stringify(e))}},{key:"putRessource",value:function(e,t){var n,r=null!==(n=e.split(".").pop())&&void 0!==n?n:"";return this.moduleExts().includes(r)?this.putModule(e,t):this.putFile(e,t)}},{key:"evalFromEvent",value:(t=(0,o.Z)(d().mark((function e(t){var n,r,o,u,i,c,a,l,s=this;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=function(e){return function(n){var r=s.clone(t);r.stream=e,r.content=n,s.dispatchEvent("eval.output",r)}},r=n("stdout"),o=n("stderr"),e.prev=3,e.next=6,this.evalAsync(t.code,r,o,t);case 6:u=e.sent,e.next=17;break;case 9:return e.prev=9,e.t0=e.catch(3),o(e.t0.toString()),(i=this.clone(t)).error=e.t0,i.execution_count=this.execution_count,this.dispatchEvent("eval.error",i),e.abrupt("return");case 17:if(null!=u){e.next=19;break}return e.abrupt("return");case 19:c=u[0],a=u[1],(l=this.clone(t)).execution_count=a,null!=c&&(l.result=c),this.dispatchEvent("eval.finished",l);case 25:case"end":return e.stop()}}),e,this,[[3,9]])}))),function(e){return t.apply(this,arguments)})}],[{key:"loadScript",value:function(e){return new Promise((function(t,n){var r=document.createElement("script");r.onload=t,r.onerror=n,r.src=e,document.head.appendChild(r)}))}},{key:"xhr",value:function(e){var t=new XMLHttpRequest;t.open(e.method,e.url,!0),null!=e.responseType&&(t.responseType=e.responseType);var n=new Promise((function(e,n){t.onload=function(){t.status>=200&&t.status<300?e(t.response):n(t)},t.onerror=function(){n(t)}}));e.headers&&Object.keys(e.headers).forEach((function(n){t.setRequestHeader(n,e.headers[n])}));var o=e.data;return o&&"object"===(0,r.Z)(o)&&(o=JSON.stringify(o)),t.send(o),n}}]),e}()},761:(e,t,n)=>{n.r(t),n.d(t,{KernelOCaml:()=>p});var r=n(795),o=n(249),u=n(371),i=n(754),c=n(987),a=n(58),l=n(162),s=n.n(l);function f(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,a.Z)(e);if(t){var o=(0,a.Z)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,c.Z)(this,n)}}var p=function(e){(0,i.Z)(l,e);var t,c,a=f(l);function l(e){return(0,o.Z)(this,l),a.call(this,e)}return(0,u.Z)(l,[{key:"language",value:function(){return"ocaml"}},{key:"languageName",value:function(){return"OCaml"}},{key:"moduleExts",value:function(){return["ml"]}},{key:"launch",value:(c=(0,r.Z)(s().mark((function e(){var t,r;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.e("kernel-ocaml_lib___kernel___js").then(n.t.bind(n,409,23));case 2:t=e.sent,r=t.__kernel__,this.__kernel__=r,this.restart();case 6:case"end":return e.stop()}}),e,this)}))),function(){return c.apply(this,arguments)})},{key:"evalAsync",value:(t=(0,r.Z)(s().mark((function e(t,n,r){var o,u,i,c=arguments;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=c.length>3&&void 0!==c[3]?c[3]:null,null!=this.__kernel__){e.next=3;break}return e.abrupt("return");case 3:return o.interactive=!0,this.__kernel__.io.stdout=n,this.__kernel__.io.stderr=r,this.execution_count++,i=null===(u=this.__kernel__)||void 0===u?void 0:u.exec(t),this.__kernel__.io.stdout=console.log,this.__kernel__.io.stderr=console.error,i="string"==typeof i&&i.length>0?{"text/plain":i.replace(/\n$/,"")}:void 0,e.abrupt("return",[i,this.execution_count]);case 12:case"end":return e.stop()}}),e,this)}))),function(e,n,r){return t.apply(this,arguments)})},{key:"restart",value:function(){var e;if(0!==(null===(e=this.__kernel__)||void 0===e?void 0:e.init()))throw new Error("Can't start OCaml kernel!");this.execution_count=0}},{key:"ocamlDownload",value:function(e,t){var n=window.jsoo_runtime.caml_convert_bytes_to_array(e);this.download(n,t)}},{key:"putFile",value:function(e,t){null!=this.__kernel__&&this.__kernel__.createfile(e,t)}},{key:"putModule",value:function(e,t){var n;this.putFile(e,t),null===(n=this.__kernel__)||void 0===n||n.loadmodule(e)}},{key:"userModules",value:function(){return[]}},{key:"getFile",value:function(e){}},{key:"getUserModuleFile",value:function(e){}},{key:"more",value:function(e){return!1}},{key:"banner",value:function(){return" OCaml version 4.11.1\n"}},{key:"ps1",value:function(){return"# "}},{key:"ps2",value:function(){return" "}},{key:"complete",value:function(e){return[]}}]),l}(n(305).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})},58:(e,t,n)=>{function r(e){return r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},r(e)}n.d(t,{Z:()=>r})},754:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(960);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)}},987:(e,t,n)=>{n.d(t,{Z:()=>u});var r=n(522),o=n(753);function u(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)}},960:(e,t,n)=>{function r(e,t){return r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},r(e,t)}n.d(t,{Z:()=>r})},522:(e,t,n)=>{function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n.d(t,{Z:()=>r})}}]);
2
2
  //# sourceMappingURL=kernel-ocaml_lib_index_js.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"kernel-ocaml_lib_index_js.js","mappings":"oPAAe,SAAS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Q,GAErE,OADAR,EAAEC,UAAYO,EACPR,GAGFO,EAAgBP,EAAGQ,G,gCCNb,SAASC,EAAQvE,GAG9B,OAAOuE,EAAU,mBAAqBC,QAAU,iBAAmBA,OAAOC,SAAW,SAAUzE,GAC7F,cAAcA,GACZ,SAAUA,GACZ,OAAOA,GAAO,mBAAqBwE,QAAUxE,EAAIrE,cAAgB6I,QAAUxE,IAAQwE,OAAO3K,UAAY,gBAAkBmG,GACvHuE,EAAQvE,G","sources":["webpack://@basthon/browser-bundle/../../node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js","webpack://@basthon/browser-bundle/../../node_modules/@babel/runtime/helpers/esm/construct.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","webpack://@basthon/browser-bundle/../kernel-base/lib/kernel.js","webpack://@basthon/browser-bundle/../kernel-base/lib/version.js","webpack://@basthon/browser-bundle/../kernel-ocaml/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/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/typeof.js"],"sourcesContent":["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\n try {\n Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\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;\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\n return _construct.apply(null, arguments);\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\n _wrapNativeSuper = function _wrapNativeSuper(Class) {\n if (Class === null || !isNativeFunction(Class)) return Class;\n\n if (typeof Class !== \"function\") {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n if (typeof _cache !== \"undefined\") {\n if (_cache.has(Class)) return _cache.get(Class);\n\n _cache.set(Class, Wrapper);\n }\n\n function Wrapper() {\n return construct(Class, arguments, getPrototypeOf(this).constructor);\n }\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\n return _wrapNativeSuper(Class);\n}","export default function _isNativeFunction(fn) {\n return Function.toString.call(fn).indexOf(\"[native code]\") !== -1;\n}","import { PromiseDelegate } from \"promise-delegate\";\nimport { VERSION } from './version';\n/**\n * An error thrown by not implemented API functions.\n */\nclass NotImplementedError extends Error {\n constructor(funcName) {\n super(`Function ${funcName} not implemented!`);\n this.name = \"NotImplementedError\";\n }\n}\n/**\n * Event for Basthon's dispatch/listen.\n */\nclass BasthonEvent extends Event {\n constructor(id, data) {\n super(id);\n this.detail = data;\n }\n}\n/**\n * API that any Basthon kernel should fill to be supported\n * in console/notebook.\n */\nexport class KernelBase {\n constructor(rootPath) {\n this._ready = false;\n this._loaded = new PromiseDelegate();\n this.execution_count = 0;\n // root path where kernel is installed\n this._rootPath = rootPath;\n }\n /**\n * Kernel version number (string).\n */\n version() { return VERSION; }\n ;\n /**\n * Language implemented in the kernel (string).\n * Generally lower case.\n */\n language() { throw new NotImplementedError(\"language\"); }\n ;\n /**\n * Language name implemented in the kernel (string).\n * As it should be displayed in text.\n */\n languageName() { throw new NotImplementedError(\"languageName\"); }\n ;\n /**\n * Script (module) file extensions\n */\n moduleExts() {\n throw new NotImplementedError(\"moduleExts\");\n }\n ;\n /**\n * Launch the kernel.\n */\n async launch() { throw new NotImplementedError(\"launch\"); }\n ;\n /**\n * Async code evaluation that resolves with the result.\n */\n evalAsync(code, outCallback, errCallback, data = null) {\n throw new NotImplementedError(\"evalAsync\");\n }\n ;\n restart() { throw new NotImplementedError(\"restart\"); }\n ;\n putFile(filename, content) {\n throw new NotImplementedError(\"putFile\");\n }\n ;\n putModule(filename, content) {\n throw new NotImplementedError(\"putModule\");\n }\n ;\n userModules() { return []; }\n ;\n getFile(path) { throw new NotImplementedError(\"getFile\"); }\n ;\n getUserModuleFile(filename) {\n throw new NotImplementedError(\"getUserModuleFile\");\n }\n ;\n more(source) { throw new NotImplementedError(\"more\"); }\n ;\n complete(code) { return []; }\n ;\n banner() { return `Welcome to the ${this.languageName()} REPL!`; }\n ;\n ps1() { return \">>> \"; }\n ;\n ps2() { return \"... \"; }\n ;\n /**\n * Initialize the kernel.\n */\n async init() {\n try {\n await this.launch();\n }\n catch (error) {\n this._loaded.reject(error);\n return;\n }\n // connecting eval to basthon.eval.request event.\n this.addEventListener(\"eval.request\", this.evalFromEvent.bind(this));\n this._ready = true;\n this._loaded.resolve();\n }\n /**\n * Is the kernel ready?\n */\n get ready() { return this._ready; }\n /**\n * Promise that resolve when the kernel is loaded.\n */\n async loaded() { await this._loaded.promise; }\n /**\n * Root for kernel files. This is always the versnion number\n * directory inside the kernel directory.\n */\n basthonRoot(absolute = false) {\n let url = this._rootPath + \"/\" + this.version();\n if (absolute && !url.startsWith(\"http\")) {\n const base = window.location.origin + window.location.pathname;\n url = base.substring(0, base.lastIndexOf('/')) + \"/\" + url;\n }\n return url;\n }\n /**\n * Downloading data (bytes array) as filename\n * (opening browser dialog).\n */\n download(data, filename) {\n let blob = new Blob([data], { type: \"application/octet-stream\" });\n let anchor = document.createElement(\"a\");\n anchor.download = filename;\n anchor.href = window.URL.createObjectURL(blob);\n anchor.target = \"_blank\";\n anchor.style.display = \"none\"; // just to be safe!\n document.body.appendChild(anchor);\n anchor.click();\n document.body.removeChild(anchor);\n }\n ;\n /**\n * Dynamically load a script asynchronously.\n */\n static loadScript(url) {\n return new Promise(function (resolve, reject) {\n let script = document.createElement('script');\n script.onload = resolve;\n script.onerror = reject;\n script.src = url;\n document.head.appendChild(script);\n });\n }\n ;\n /**\n * Wraper around XMLHttpRequest.\n */\n static xhr(params) {\n const xhr = new XMLHttpRequest();\n xhr.open(params.method, params.url, true);\n if (params.responseType != null)\n xhr.responseType = params.responseType;\n const promise = new Promise(function (resolve, reject) {\n xhr.onload = function () {\n if (xhr.status >= 200 && xhr.status < 300) {\n resolve(xhr.response);\n }\n else {\n reject(xhr);\n }\n };\n xhr.onerror = function () { reject(xhr); };\n });\n // headers\n if (params.headers) {\n Object.keys(params.headers).forEach(function (key) {\n xhr.setRequestHeader(key, params.headers[key]);\n });\n }\n // data\n let data = params.data;\n if (data && typeof data === 'object') {\n data = JSON.stringify(data);\n }\n xhr.send(data);\n return promise;\n }\n ;\n /**\n * Wrapper around document.dispatchEvent.\n * It adds the 'basthon.' prefix to each event name and\n * manage the event lookup to retreive relevent data.\n */\n dispatchEvent(eventName, data) {\n document.dispatchEvent(new BasthonEvent(`basthon.${eventName}`, data));\n }\n ;\n /**\n * Wrapper around document.addEventListener.\n * It manages the 'basthon.' prefix to each event name and\n * manage the event lookup to retreive relevent data.\n */\n addEventListener(eventName, callback) {\n document.addEventListener(`basthon.${eventName}`, function (event) { callback(event.detail); });\n }\n ;\n /**\n * Simple clone via JSON copy.\n */\n clone(obj) {\n // simple trick that is enough for our purpose.\n return JSON.parse(JSON.stringify(obj));\n }\n ;\n /**\n * Put a ressource (file or module).\n * Detection is based on extension.\n */\n putRessource(filename, content) {\n var _a;\n const ext = (_a = filename.split('.').pop()) !== null && _a !== void 0 ? _a : \"\";\n if (this.moduleExts().includes(ext)) {\n return this.putModule(filename, content);\n }\n else {\n return this.putFile(filename, content);\n }\n }\n ;\n /**\n * Internal. Code evaluation after an eval.request event.\n */\n async evalFromEvent(data) {\n const stdCallback = (std) => (text) => {\n let dataEvent = this.clone(data);\n dataEvent.stream = std;\n dataEvent.content = text;\n this.dispatchEvent(\"eval.output\", dataEvent);\n };\n const outCallback = stdCallback(\"stdout\");\n const errCallback = stdCallback(\"stderr\");\n let args;\n try {\n args = await this.evalAsync(data.code, outCallback, errCallback, data);\n }\n catch (error) {\n errCallback(error.toString());\n const dataEvent = this.clone(data);\n dataEvent.error = error;\n dataEvent.execution_count = this.execution_count;\n this.dispatchEvent(\"eval.error\", dataEvent);\n return;\n }\n if (args == null)\n return; // this should not happend\n const result = args[0];\n const executionCount = args[1];\n let dataEvent = this.clone(data);\n dataEvent.execution_count = executionCount;\n if (result != null)\n dataEvent.result = result;\n this.dispatchEvent(\"eval.finished\", dataEvent);\n }\n}\n","export const VERSION = \"0.40.8\";\n","import { KernelBase } from '@basthon/kernel-base';\n/**\n * An OCaml kernel that satisfies Basthon's API.\n */\nexport class KernelOCaml extends KernelBase {\n constructor(rootPath) { super(rootPath); }\n language() { return \"ocaml\"; }\n languageName() { return \"OCaml\"; }\n moduleExts() { return ['ml']; }\n /**\n * Start the Basthon kernel asynchronously.\n */\n async launch() {\n const { __kernel__ } = await import(\"./__kernel__\");\n this.__kernel__ = __kernel__;\n this.restart();\n }\n /**\n * Basthon async code evaluation function.\n */\n async evalAsync(code, outCallback, errCallback, data = null) {\n var _a;\n // force interactivity in all modes\n if (this.__kernel__ == null)\n return;\n data.interactive = true;\n // set stream callbacks\n this.__kernel__.io.stdout = outCallback;\n this.__kernel__.io.stderr = errCallback;\n this.execution_count++;\n let result = (_a = this.__kernel__) === null || _a === void 0 ? void 0 : _a.exec(code);\n // restoration\n this.__kernel__.io.stdout = console.log;\n this.__kernel__.io.stderr = console.error;\n // return result\n if (typeof result === 'string' && result.length > 0)\n result = { 'text/plain': result.replace(/\\n$/, \"\") };\n else\n result = undefined;\n return [result, this.execution_count];\n }\n /**\n * Restart the kernel.\n */\n restart() {\n var _a;\n if (((_a = this.__kernel__) === null || _a === void 0 ? void 0 : _a.init()) !== 0)\n throw new Error(\"Can't start OCaml kernel!\");\n this.execution_count = 0;\n }\n /**\n * OCaml wrapper arround Kernel.download (to be called by __kernel__.ml).\n */\n ocamlDownload(content, filename) {\n // const array = window.jsoo_runtime.caml_array_of_bytes(content);\n this.download(content.c, filename);\n }\n /**\n * Put a file on the local (emulated) filesystem.\n */\n putFile(filename, content) {\n if (this.__kernel__ == null)\n return;\n this.__kernel__.createfile(filename, content);\n }\n /**\n * Put an importable module on the local (emulated) filesystem\n * and load dependencies.\n */\n putModule(filename, content) {\n var _a;\n this.putFile(filename, content);\n /* why is this needed?\n * even if path is already added using the #directory directive,\n * one should recall the directive each time the folder is modified...\n */\n (_a = this.__kernel__) === null || _a === void 0 ? void 0 : _a.loadmodule(filename);\n }\n /**\n * List modules launched via putModule.\n */\n userModules() {\n return [];\n }\n /**\n * Download a file from the VFS.\n */\n getFile(path) {\n }\n /**\n * Download a user module file.\n */\n getUserModuleFile(filename) {\n }\n /**\n * Is the source ready to be evaluated or want we more?\n * Usefull to set ps1/ps2 in teminal prompt.\n */\n more(source) {\n return false;\n }\n /**\n * Mimic the OCaml's REPL banner.\n */\n banner() {\n return \" OCaml version 4.11.1\\n\";\n }\n ps1() { return \"# \"; }\n ;\n ps2() { return \" \"; }\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 [];\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\n return self;\n}","export default function _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : 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\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\n return assertThisInitialized(self);\n}","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}","export default function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, _typeof(obj);\n}"],"names":["_isNativeReflectConstruct","Reflect","construct","sham","Proxy","Boolean","prototype","valueOf","call","e","_construct","Parent","args","Class","a","push","apply","instance","Function","bind","setPrototypeOf","arguments","_wrapNativeSuper","_cache","Map","undefined","fn","toString","indexOf","TypeError","has","get","set","Wrapper","getPrototypeOf","this","constructor","Object","create","value","enumerable","writable","configurable","NotImplementedError","funcName","name","Error","BasthonEvent","id","data","detail","Event","KernelBase","rootPath","_ready","_loaded","PromiseDelegate","execution_count","_rootPath","code","outCallback","errCallback","filename","content","path","source","languageName","launch","reject","addEventListener","evalFromEvent","resolve","promise","absolute","url","version","startsWith","base","window","location","origin","pathname","substring","lastIndexOf","blob","Blob","type","anchor","document","createElement","download","href","URL","createObjectURL","target","style","display","body","appendChild","click","removeChild","eventName","dispatchEvent","callback","event","obj","JSON","parse","stringify","_a","ext","split","pop","moduleExts","includes","putModule","putFile","stdCallback","std","text","dataEvent","clone","stream","evalAsync","error","result","executionCount","Promise","script","onload","onerror","src","head","params","xhr","XMLHttpRequest","open","method","responseType","status","response","headers","keys","forEach","key","setRequestHeader","send","KernelOCaml","__kernel__","restart","interactive","io","stdout","stderr","exec","console","log","length","replace","init","c","createfile","loadmodule","_assertThisInitialized","self","ReferenceError","_getPrototypeOf","o","__proto__","_inherits","subClass","superClass","defineProperty","_possibleConstructorReturn","_setPrototypeOf","p","_typeof","Symbol","iterator"],"sourceRoot":""}
1
+ {"version":3,"file":"kernel-ocaml_lib_index_js.js","mappings":"oPAAe,SAASA,IACtB,GAAuB,oBAAZC,UAA4BA,QAAQC,UAAW,OAAO,EACjE,GAAID,QAAQC,UAAUC,KAAM,OAAO,EACnC,GAAqB,mBAAVC,MAAsB,OAAO,EAExC,IAEE,OADAC,QAAQC,UAAUC,QAAQC,KAAKP,QAAQC,UAAUG,QAAS,IAAI,iBACvD,EACP,MAAOI,GACP,OAAO,GCPI,SAASC,EAAWC,EAAQC,EAAMC,GAc/C,OAZEH,EADE,IACWT,QAAQC,UAER,SAAoBS,EAAQC,EAAMC,GAC7C,IAAIC,EAAI,CAAC,MACTA,EAAEC,KAAKC,MAAMF,EAAGF,GAChB,IACIK,EAAW,IADGC,SAASC,KAAKH,MAAML,EAAQG,IAG9C,OADID,IAAO,EAAAO,EAAA,GAAeH,EAAUJ,EAAMP,WACnCW,GAIJP,E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B,SAASiH,EAAuBC,GAC7C,QAAa,IAATA,EACF,MAAM,IAAIC,eAAe,6DAG3B,OAAOD,E,+BCLM,SAASE,EAAgBC,GAItC,OAHAD,EAAkBnI,OAAOjB,eAAiBiB,OAAOH,eAAiB,SAAyBuI,GACzF,OAAOA,EAAEC,WAAarI,OAAOH,eAAeuI,IAEvCD,EAAgBC,G,8DCHV,SAASE,EAAUC,EAAUC,GAC1C,GAA0B,mBAAfA,GAA4C,OAAfA,EACtC,MAAM,IAAIhJ,UAAU,sDAGtB+I,EAAStK,UAAY+B,OAAOC,OAAOuI,GAAcA,EAAWvK,UAAW,CACrE8B,YAAa,CACXG,MAAOqI,EACPnI,UAAU,EACVC,cAAc,KAGlBL,OAAOyI,eAAeF,EAAU,YAAa,CAC3CnI,UAAU,IAERoI,IAAY,OAAeD,EAAUC,K,qDCd5B,SAASE,EAA2BT,EAAM9J,GACvD,GAAIA,IAA2B,YAAlB,OAAQA,IAAsC,mBAATA,GAChD,OAAOA,EACF,QAAa,IAATA,EACT,MAAM,IAAIqB,UAAU,4DAGtB,OAAO,OAAsByI,K,cCThB,SAASU,EAAgBP,EAAGQ,GAMzC,OALAD,EAAkB3I,OAAOjB,gBAAkB,SAAyBqJ,EAAGQ,GAErE,OADAR,EAAEC,UAAYO,EACPR,GAGFO,EAAgBP,EAAGQ,G,gCCNb,SAASC,EAAQzE,GAG9B,OAAOyE,EAAU,mBAAqBC,QAAU,iBAAmBA,OAAOC,SAAW,SAAU3E,GAC7F,cAAcA,GACZ,SAAUA,GACZ,OAAOA,GAAO,mBAAqB0E,QAAU1E,EAAIrE,cAAgB+I,QAAU1E,IAAQ0E,OAAO7K,UAAY,gBAAkBmG,GACvHyE,EAAQzE,G","sources":["webpack://@basthon/browser-bundle/../../node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js","webpack://@basthon/browser-bundle/../../node_modules/@babel/runtime/helpers/esm/construct.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","webpack://@basthon/browser-bundle/../kernel-base/lib/kernel.js","webpack://@basthon/browser-bundle/../kernel-base/lib/version.js","webpack://@basthon/browser-bundle/../kernel-ocaml/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/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/typeof.js"],"sourcesContent":["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\n try {\n Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\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;\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\n return _construct.apply(null, arguments);\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\n _wrapNativeSuper = function _wrapNativeSuper(Class) {\n if (Class === null || !isNativeFunction(Class)) return Class;\n\n if (typeof Class !== \"function\") {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n if (typeof _cache !== \"undefined\") {\n if (_cache.has(Class)) return _cache.get(Class);\n\n _cache.set(Class, Wrapper);\n }\n\n function Wrapper() {\n return construct(Class, arguments, getPrototypeOf(this).constructor);\n }\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\n return _wrapNativeSuper(Class);\n}","export default function _isNativeFunction(fn) {\n return Function.toString.call(fn).indexOf(\"[native code]\") !== -1;\n}","import { PromiseDelegate } from \"promise-delegate\";\nimport { VERSION } from './version';\n/**\n * An error thrown by not implemented API functions.\n */\nclass NotImplementedError extends Error {\n constructor(funcName) {\n super(`Function ${funcName} not implemented!`);\n this.name = \"NotImplementedError\";\n }\n}\n/**\n * Event for Basthon's dispatch/listen.\n */\nclass BasthonEvent extends Event {\n constructor(id, data) {\n super(id);\n this.detail = data;\n }\n}\n/**\n * API that any Basthon kernel should fill to be supported\n * in console/notebook.\n */\nexport class KernelBase {\n constructor(rootPath) {\n this._ready = false;\n this._loaded = new PromiseDelegate();\n this.execution_count = 0;\n // root path where kernel is installed\n this._rootPath = rootPath;\n }\n /**\n * Kernel version number (string).\n */\n version() { return VERSION; }\n ;\n /**\n * Language implemented in the kernel (string).\n * Generally lower case.\n */\n language() { throw new NotImplementedError(\"language\"); }\n ;\n /**\n * Language name implemented in the kernel (string).\n * As it should be displayed in text.\n */\n languageName() { throw new NotImplementedError(\"languageName\"); }\n ;\n /**\n * Script (module) file extensions\n */\n moduleExts() {\n throw new NotImplementedError(\"moduleExts\");\n }\n ;\n /**\n * Launch the kernel.\n */\n async launch() { throw new NotImplementedError(\"launch\"); }\n ;\n /**\n * Async code evaluation that resolves with the result.\n */\n evalAsync(code, outCallback, errCallback, data = null) {\n throw new NotImplementedError(\"evalAsync\");\n }\n ;\n restart() { throw new NotImplementedError(\"restart\"); }\n ;\n putFile(filename, content) {\n throw new NotImplementedError(\"putFile\");\n }\n ;\n putModule(filename, content) {\n throw new NotImplementedError(\"putModule\");\n }\n ;\n userModules() { return []; }\n ;\n getFile(path) { throw new NotImplementedError(\"getFile\"); }\n ;\n getUserModuleFile(filename) {\n throw new NotImplementedError(\"getUserModuleFile\");\n }\n ;\n more(source) { throw new NotImplementedError(\"more\"); }\n ;\n complete(code) { return []; }\n ;\n banner() { return `Welcome to the ${this.languageName()} REPL!`; }\n ;\n ps1() { return \">>> \"; }\n ;\n ps2() { return \"... \"; }\n ;\n /**\n * Initialize the kernel.\n */\n async init() {\n try {\n await this.launch();\n }\n catch (error) {\n this._loaded.reject(error);\n return;\n }\n // connecting eval to basthon.eval.request event.\n this.addEventListener(\"eval.request\", this.evalFromEvent.bind(this));\n this._ready = true;\n this._loaded.resolve();\n }\n /**\n * Is the kernel ready?\n */\n get ready() { return this._ready; }\n /**\n * Promise that resolve when the kernel is loaded.\n */\n async loaded() { await this._loaded.promise; }\n /**\n * Root for kernel files. This is always the versnion number\n * directory inside the kernel directory.\n */\n basthonRoot(absolute = false) {\n let url = this._rootPath + \"/\" + this.version();\n if (absolute && !url.startsWith(\"http\")) {\n const base = window.location.origin + window.location.pathname;\n url = base.substring(0, base.lastIndexOf('/')) + \"/\" + url;\n }\n return url;\n }\n /**\n * Downloading data (bytes array) as filename\n * (opening browser dialog).\n */\n download(data, filename) {\n let blob = new Blob([data], { type: \"application/octet-stream\" });\n let anchor = document.createElement(\"a\");\n anchor.download = filename;\n anchor.href = window.URL.createObjectURL(blob);\n anchor.target = \"_blank\";\n anchor.style.display = \"none\"; // just to be safe!\n document.body.appendChild(anchor);\n anchor.click();\n document.body.removeChild(anchor);\n }\n ;\n /**\n * Dynamically load a script asynchronously.\n */\n static loadScript(url) {\n return new Promise(function (resolve, reject) {\n let script = document.createElement('script');\n script.onload = resolve;\n script.onerror = reject;\n script.src = url;\n document.head.appendChild(script);\n });\n }\n ;\n /**\n * Wraper around XMLHttpRequest.\n */\n static xhr(params) {\n const xhr = new XMLHttpRequest();\n xhr.open(params.method, params.url, true);\n if (params.responseType != null)\n xhr.responseType = params.responseType;\n const promise = new Promise(function (resolve, reject) {\n xhr.onload = function () {\n if (xhr.status >= 200 && xhr.status < 300) {\n resolve(xhr.response);\n }\n else {\n reject(xhr);\n }\n };\n xhr.onerror = function () { reject(xhr); };\n });\n // headers\n if (params.headers) {\n Object.keys(params.headers).forEach(function (key) {\n xhr.setRequestHeader(key, params.headers[key]);\n });\n }\n // data\n let data = params.data;\n if (data && typeof data === 'object') {\n data = JSON.stringify(data);\n }\n xhr.send(data);\n return promise;\n }\n ;\n /**\n * Wrapper around document.dispatchEvent.\n * It adds the 'basthon.' prefix to each event name and\n * manage the event lookup to retreive relevent data.\n */\n dispatchEvent(eventName, data) {\n document.dispatchEvent(new BasthonEvent(`basthon.${eventName}`, data));\n }\n ;\n /**\n * Wrapper around document.addEventListener.\n * It manages the 'basthon.' prefix to each event name and\n * manage the event lookup to retreive relevent data.\n */\n addEventListener(eventName, callback) {\n document.addEventListener(`basthon.${eventName}`, function (event) { callback(event.detail); });\n }\n ;\n /**\n * Simple clone via JSON copy.\n */\n clone(obj) {\n // simple trick that is enough for our purpose.\n return JSON.parse(JSON.stringify(obj));\n }\n ;\n /**\n * Put a ressource (file or module).\n * Detection is based on extension.\n */\n putRessource(filename, content) {\n var _a;\n const ext = (_a = filename.split('.').pop()) !== null && _a !== void 0 ? _a : \"\";\n if (this.moduleExts().includes(ext)) {\n return this.putModule(filename, content);\n }\n else {\n return this.putFile(filename, content);\n }\n }\n ;\n /**\n * Internal. Code evaluation after an eval.request event.\n */\n async evalFromEvent(data) {\n const stdCallback = (std) => (text) => {\n let dataEvent = this.clone(data);\n dataEvent.stream = std;\n dataEvent.content = text;\n this.dispatchEvent(\"eval.output\", dataEvent);\n };\n const outCallback = stdCallback(\"stdout\");\n const errCallback = stdCallback(\"stderr\");\n let args;\n try {\n args = await this.evalAsync(data.code, outCallback, errCallback, data);\n }\n catch (error) {\n errCallback(error.toString());\n const dataEvent = this.clone(data);\n dataEvent.error = error;\n dataEvent.execution_count = this.execution_count;\n this.dispatchEvent(\"eval.error\", dataEvent);\n return;\n }\n if (args == null)\n return; // this should not happend\n const result = args[0];\n const executionCount = args[1];\n let dataEvent = this.clone(data);\n dataEvent.execution_count = executionCount;\n if (result != null)\n dataEvent.result = result;\n this.dispatchEvent(\"eval.finished\", dataEvent);\n }\n}\n","export const VERSION = \"0.40.9\";\n","import { KernelBase } from '@basthon/kernel-base';\n/**\n * An OCaml kernel that satisfies Basthon's API.\n */\nexport class KernelOCaml extends KernelBase {\n constructor(rootPath) { super(rootPath); }\n language() { return \"ocaml\"; }\n languageName() { return \"OCaml\"; }\n moduleExts() { return ['ml']; }\n /**\n * Start the Basthon kernel asynchronously.\n */\n async launch() {\n const { __kernel__ } = await import(\"./__kernel__\");\n this.__kernel__ = __kernel__;\n this.restart();\n }\n /**\n * Basthon async code evaluation function.\n */\n async evalAsync(code, outCallback, errCallback, data = null) {\n var _a;\n // force interactivity in all modes\n if (this.__kernel__ == null)\n return;\n data.interactive = true;\n // set stream callbacks\n this.__kernel__.io.stdout = outCallback;\n this.__kernel__.io.stderr = errCallback;\n this.execution_count++;\n let result = (_a = this.__kernel__) === null || _a === void 0 ? void 0 : _a.exec(code);\n // restoration\n this.__kernel__.io.stdout = console.log;\n this.__kernel__.io.stderr = console.error;\n // return result\n if (typeof result === 'string' && result.length > 0)\n result = { 'text/plain': result.replace(/\\n$/, \"\") };\n else\n result = undefined;\n return [result, this.execution_count];\n }\n /**\n * Restart the kernel.\n */\n restart() {\n var _a;\n if (((_a = this.__kernel__) === null || _a === void 0 ? void 0 : _a.init()) !== 0)\n throw new Error(\"Can't start OCaml kernel!\");\n this.execution_count = 0;\n }\n /**\n * OCaml wrapper arround Kernel.download (to be called by __kernel__.ml).\n */\n ocamlDownload(content, filename) {\n const array = window.jsoo_runtime.caml_convert_bytes_to_array(content);\n this.download(array, filename);\n }\n /**\n * Put a file on the local (emulated) filesystem.\n */\n putFile(filename, content) {\n if (this.__kernel__ == null)\n return;\n this.__kernel__.createfile(filename, content);\n }\n /**\n * Put an importable module on the local (emulated) filesystem\n * and load dependencies.\n */\n putModule(filename, content) {\n var _a;\n this.putFile(filename, content);\n /* why is this needed?\n * even if path is already added using the #directory directive,\n * one should recall the directive each time the folder is modified...\n */\n (_a = this.__kernel__) === null || _a === void 0 ? void 0 : _a.loadmodule(filename);\n }\n /**\n * List modules launched via putModule.\n */\n userModules() {\n return [];\n }\n /**\n * Download a file from the VFS.\n */\n getFile(path) {\n }\n /**\n * Download a user module file.\n */\n getUserModuleFile(filename) {\n }\n /**\n * Is the source ready to be evaluated or want we more?\n * Usefull to set ps1/ps2 in teminal prompt.\n */\n more(source) {\n return false;\n }\n /**\n * Mimic the OCaml's REPL banner.\n */\n banner() {\n return \" OCaml version 4.11.1\\n\";\n }\n ps1() { return \"# \"; }\n ;\n ps2() { return \" \"; }\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 [];\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\n return self;\n}","export default function _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : 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\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\n return assertThisInitialized(self);\n}","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}","export default function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, _typeof(obj);\n}"],"names":["_isNativeReflectConstruct","Reflect","construct","sham","Proxy","Boolean","prototype","valueOf","call","e","_construct","Parent","args","Class","a","push","apply","instance","Function","bind","setPrototypeOf","arguments","_wrapNativeSuper","_cache","Map","undefined","fn","toString","indexOf","TypeError","has","get","set","Wrapper","getPrototypeOf","this","constructor","Object","create","value","enumerable","writable","configurable","NotImplementedError","funcName","name","Error","BasthonEvent","id","data","detail","Event","KernelBase","rootPath","_ready","_loaded","PromiseDelegate","execution_count","_rootPath","code","outCallback","errCallback","filename","content","path","source","languageName","launch","reject","addEventListener","evalFromEvent","resolve","promise","absolute","url","version","startsWith","base","window","location","origin","pathname","substring","lastIndexOf","blob","Blob","type","anchor","document","createElement","download","href","URL","createObjectURL","target","style","display","body","appendChild","click","removeChild","eventName","dispatchEvent","callback","event","obj","JSON","parse","stringify","_a","ext","split","pop","moduleExts","includes","putModule","putFile","stdCallback","std","text","dataEvent","clone","stream","evalAsync","error","result","executionCount","Promise","script","onload","onerror","src","head","params","xhr","XMLHttpRequest","open","method","responseType","status","response","headers","keys","forEach","key","setRequestHeader","send","KernelOCaml","__kernel__","restart","interactive","io","stdout","stderr","exec","console","log","length","replace","init","array","jsoo_runtime","caml_convert_bytes_to_array","createfile","loadmodule","_assertThisInitialized","self","ReferenceError","_getPrototypeOf","o","__proto__","_inherits","subClass","superClass","defineProperty","_possibleConstructorReturn","_setPrototypeOf","p","_typeof","Symbol","iterator"],"sourceRoot":""}
@@ -1,2 +1,2 @@
1
- "use strict";(self.webpackChunk_basthon_browser_bundle=self.webpackChunk_basthon_browser_bundle||[]).push([["kernel-python3_lib_index_js"],{305:(e,t,n)=>{n.d(t,{H:()=>m});var r=n(522),o=n(795),u=n(371),i=n(249),a=n(754),c=n(987),l=n(58),s=n(960);function f(){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}}function p(e,t,n){return p=f()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&(0,s.Z)(o,n.prototype),o},p.apply(null,arguments)}function d(e){var t="function"==typeof Map?new Map:void 0;return d=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,r)}function r(){return p(e,arguments,(0,l.Z)(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),(0,s.Z)(r,e)},d(e)}var h=n(162),y=n.n(h),v=n(490);function _(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,l.Z)(e);if(t){var o=(0,l.Z)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,c.Z)(this,n)}}var w=function(e){(0,a.Z)(n,e);var t=_(n);function n(e){var r;return(0,i.Z)(this,n),(r=t.call(this,"Function ".concat(e," not implemented!"))).name="NotImplementedError",r}return(0,u.Z)(n)}(d(Error)),k=function(e){(0,a.Z)(n,e);var t=_(n);function n(e,r){var o;return(0,i.Z)(this,n),(o=t.call(this,e)).detail=r,o}return(0,u.Z)(n)}(d(Event)),m=function(){function e(t){(0,i.Z)(this,e),this._ready=!1,this._loaded=new v.I,this.execution_count=0,this._rootPath=t}var t,n,a,c;return(0,u.Z)(e,[{key:"version",value:function(){return"0.40.8"}},{key:"language",value:function(){throw new w("language")}},{key:"languageName",value:function(){throw new w("languageName")}},{key:"moduleExts",value:function(){throw new w("moduleExts")}},{key:"launch",value:(c=(0,o.Z)(y().mark((function e(){return y().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new w("launch");case 1:case"end":return e.stop()}}),e)}))),function(){return c.apply(this,arguments)})},{key:"evalAsync",value:function(e,t,n){throw new w("evalAsync")}},{key:"restart",value:function(){throw new w("restart")}},{key:"putFile",value:function(e,t){throw new w("putFile")}},{key:"putModule",value:function(e,t){throw new w("putModule")}},{key:"userModules",value:function(){return[]}},{key:"getFile",value:function(e){throw new w("getFile")}},{key:"getUserModuleFile",value:function(e){throw new w("getUserModuleFile")}},{key:"more",value:function(e){throw new w("more")}},{key:"complete",value:function(e){return[]}},{key:"banner",value:function(){return"Welcome to the ".concat(this.languageName()," REPL!")}},{key:"ps1",value:function(){return">>> "}},{key:"ps2",value:function(){return"... "}},{key:"init",value:(a=(0,o.Z)(y().mark((function e(){return y().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.launch();case 3:e.next=9;break;case 5:return e.prev=5,e.t0=e.catch(0),this._loaded.reject(e.t0),e.abrupt("return");case 9:this.addEventListener("eval.request",this.evalFromEvent.bind(this)),this._ready=!0,this._loaded.resolve();case 12:case"end":return e.stop()}}),e,this,[[0,5]])}))),function(){return a.apply(this,arguments)})},{key:"ready",get:function(){return this._ready}},{key:"loaded",value:(n=(0,o.Z)(y().mark((function e(){return y().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._loaded.promise;case 2:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"basthonRoot",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this._rootPath+"/"+this.version();if(e&&!t.startsWith("http")){var n=window.location.origin+window.location.pathname;t=n.substring(0,n.lastIndexOf("/"))+"/"+t}return t}},{key:"download",value:function(e,t){var n=new Blob([e],{type:"application/octet-stream"}),r=document.createElement("a");r.download=t,r.href=window.URL.createObjectURL(n),r.target="_blank",r.style.display="none",document.body.appendChild(r),r.click(),document.body.removeChild(r)}},{key:"dispatchEvent",value:function(e,t){document.dispatchEvent(new k("basthon.".concat(e),t))}},{key:"addEventListener",value:function(e,t){document.addEventListener("basthon.".concat(e),(function(e){t(e.detail)}))}},{key:"clone",value:function(e){return JSON.parse(JSON.stringify(e))}},{key:"putRessource",value:function(e,t){var n,r=null!==(n=e.split(".").pop())&&void 0!==n?n:"";return this.moduleExts().includes(r)?this.putModule(e,t):this.putFile(e,t)}},{key:"evalFromEvent",value:(t=(0,o.Z)(y().mark((function e(t){var n,r,o,u,i,a,c,l,s=this;return y().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=function(e){return function(n){var r=s.clone(t);r.stream=e,r.content=n,s.dispatchEvent("eval.output",r)}},r=n("stdout"),o=n("stderr"),e.prev=3,e.next=6,this.evalAsync(t.code,r,o,t);case 6:u=e.sent,e.next=17;break;case 9:return e.prev=9,e.t0=e.catch(3),o(e.t0.toString()),(i=this.clone(t)).error=e.t0,i.execution_count=this.execution_count,this.dispatchEvent("eval.error",i),e.abrupt("return");case 17:if(null!=u){e.next=19;break}return e.abrupt("return");case 19:a=u[0],c=u[1],(l=this.clone(t)).execution_count=c,null!=a&&(l.result=a),this.dispatchEvent("eval.finished",l);case 25:case"end":return e.stop()}}),e,this,[[3,9]])}))),function(e){return t.apply(this,arguments)})}],[{key:"loadScript",value:function(e){return new Promise((function(t,n){var r=document.createElement("script");r.onload=t,r.onerror=n,r.src=e,document.head.appendChild(r)}))}},{key:"xhr",value:function(e){var t=new XMLHttpRequest;t.open(e.method,e.url,!0),null!=e.responseType&&(t.responseType=e.responseType);var n=new Promise((function(e,n){t.onload=function(){t.status>=200&&t.status<300?e(t.response):n(t)},t.onerror=function(){n(t)}}));e.headers&&Object.keys(e.headers).forEach((function(n){t.setRequestHeader(n,e.headers[n])}));var o=e.data;return o&&"object"===(0,r.Z)(o)&&(o=JSON.stringify(o)),t.send(o),n}}]),e}()},146:(e,t,n)=>{n.r(t),n.d(t,{KernelPython3:()=>p});var r=n(795),o=n(249),u=n(371),i=n(754),a=n(987),c=n(58),l=n(162),s=n.n(l);function f(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 p=function(e){(0,i.Z)(l,e);var t,n,a,c=f(l);function l(e){var t;return(0,o.Z)(this,l),(t=c.call(this,e))._pyodideUrl="https://cdn.jsdelivr.net/pyodide/v0.16.1/full/pyodide.js",t.__kernel__=null,t.pythonVersion="",t}return(0,u.Z)(l,[{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:(a=(0,r.Z)(s().mark((function e(){var t,n;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=window.pyodide,this.pythonVersion=t.runPython("import platform ; platform.python_version()"),n=console.error,console.error=function(){},e.next=6,t.loadPackage(this.basthonRoot(!0)+"/basthon.js");case 6:return console.error=n,e.next=9,t.runPythonAsync("import basthon as __basthon__");case 9:return this.__kernel__=t.globals.__basthon__.__kernel__,e.next=12,t.runPythonAsync("del __basthon__");case 12:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"launch",value:(n=(0,r.Z)(s().mark((function e(){var t;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,t=this.basthonRoot()+"/pyodide/pyodide.js",e.next=4,l.xhr({method:"HEAD",url:t});case 4:this._pyodideUrl=t,e.next=9;break;case 7:e.prev=7,e.t0=e.catch(0);case 9:return window.languagePluginUrl=this._pyodideUrl.substr(0,this._pyodideUrl.lastIndexOf("/"))+"/",e.prev=10,e.next=13,l.loadScript(this._pyodideUrl);case 13:e.next=20;break;case 15:throw e.prev=15,e.t1=e.catch(10),console.log(e.t1),console.error("Can't load pyodide.js"),e.t1;case 20:if(null!=window.languagePluginLoader){e.next=22;break}throw new Error("Can't load pyodide.js");case 22:return e.next=24,window.languagePluginLoader.then(this._onload.bind(this),(function(){throw new Error("Can't load Python from Pyodide")}));case 24:case"end":return e.stop()}}),e,this,[[0,7],[10,15]])}))),function(){return n.apply(this,arguments)})},{key:"evalAsync",value:(t=(0,r.Z)(s().mark((function e(t,n,r){var o,u=arguments;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=u.length>3&&void 0!==u[3]?u[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:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,n,r){return t.apply(this,arguments)})},{key:"restart",value:function(){return this.__kernel__.restart()}},{key:"putFile",value:function(e,t){this.__kernel__.put_file(e,t)}},{key:"putModule",value:function(e,t){return this.__kernel__.put_module(e,t)}},{key:"userModules",value:function(){return this.__kernel__.user_modules()}},{key:"getFile",value:function(e){return this.__kernel__.get_file(e)}},{key:"getUserModuleFile",value:function(e){return this.__kernel__.get_user_module_file(e)}},{key:"more",value:function(e){return this.__kernel__.more(e)}},{key:"banner",value:function(){return'Python 3.8.2 (default, Dec 25 2020 21:20:57) on WebAssembly VM\nType "help", "copyright", "credits" or "license" for more information.'}},{key:"complete",value:function(e){return this.__kernel__.complete(e)}},{key:"chdir",value:function(e){window.pyodide._module.FS.chdir(e)}},{key:"mkdir",value:function(e){window.pyodide._module.FS.mkdir(e)}}]),l}(n(305).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})},58:(e,t,n)=>{function r(e){return r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},r(e)}n.d(t,{Z:()=>r})},754:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(960);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)}},987:(e,t,n)=>{n.d(t,{Z:()=>u});var r=n(522),o=n(753);function u(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)}},960:(e,t,n)=>{function r(e,t){return r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},r(e,t)}n.d(t,{Z:()=>r})},522:(e,t,n)=>{function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n.d(t,{Z:()=>r})}}]);
1
+ "use strict";(self.webpackChunk_basthon_browser_bundle=self.webpackChunk_basthon_browser_bundle||[]).push([["kernel-python3_lib_index_js"],{305:(e,t,n)=>{n.d(t,{H:()=>m});var r=n(522),o=n(795),u=n(371),i=n(249),a=n(754),c=n(987),l=n(58),s=n(960);function f(){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}}function p(e,t,n){return p=f()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&(0,s.Z)(o,n.prototype),o},p.apply(null,arguments)}function d(e){var t="function"==typeof Map?new Map:void 0;return d=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,r)}function r(){return p(e,arguments,(0,l.Z)(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),(0,s.Z)(r,e)},d(e)}var h=n(162),y=n.n(h),v=n(490);function _(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,l.Z)(e);if(t){var o=(0,l.Z)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,c.Z)(this,n)}}var w=function(e){(0,a.Z)(n,e);var t=_(n);function n(e){var r;return(0,i.Z)(this,n),(r=t.call(this,"Function ".concat(e," not implemented!"))).name="NotImplementedError",r}return(0,u.Z)(n)}(d(Error)),k=function(e){(0,a.Z)(n,e);var t=_(n);function n(e,r){var o;return(0,i.Z)(this,n),(o=t.call(this,e)).detail=r,o}return(0,u.Z)(n)}(d(Event)),m=function(){function e(t){(0,i.Z)(this,e),this._ready=!1,this._loaded=new v.I,this.execution_count=0,this._rootPath=t}var t,n,a,c;return(0,u.Z)(e,[{key:"version",value:function(){return"0.40.9"}},{key:"language",value:function(){throw new w("language")}},{key:"languageName",value:function(){throw new w("languageName")}},{key:"moduleExts",value:function(){throw new w("moduleExts")}},{key:"launch",value:(c=(0,o.Z)(y().mark((function e(){return y().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new w("launch");case 1:case"end":return e.stop()}}),e)}))),function(){return c.apply(this,arguments)})},{key:"evalAsync",value:function(e,t,n){throw new w("evalAsync")}},{key:"restart",value:function(){throw new w("restart")}},{key:"putFile",value:function(e,t){throw new w("putFile")}},{key:"putModule",value:function(e,t){throw new w("putModule")}},{key:"userModules",value:function(){return[]}},{key:"getFile",value:function(e){throw new w("getFile")}},{key:"getUserModuleFile",value:function(e){throw new w("getUserModuleFile")}},{key:"more",value:function(e){throw new w("more")}},{key:"complete",value:function(e){return[]}},{key:"banner",value:function(){return"Welcome to the ".concat(this.languageName()," REPL!")}},{key:"ps1",value:function(){return">>> "}},{key:"ps2",value:function(){return"... "}},{key:"init",value:(a=(0,o.Z)(y().mark((function e(){return y().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.launch();case 3:e.next=9;break;case 5:return e.prev=5,e.t0=e.catch(0),this._loaded.reject(e.t0),e.abrupt("return");case 9:this.addEventListener("eval.request",this.evalFromEvent.bind(this)),this._ready=!0,this._loaded.resolve();case 12:case"end":return e.stop()}}),e,this,[[0,5]])}))),function(){return a.apply(this,arguments)})},{key:"ready",get:function(){return this._ready}},{key:"loaded",value:(n=(0,o.Z)(y().mark((function e(){return y().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._loaded.promise;case 2:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"basthonRoot",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this._rootPath+"/"+this.version();if(e&&!t.startsWith("http")){var n=window.location.origin+window.location.pathname;t=n.substring(0,n.lastIndexOf("/"))+"/"+t}return t}},{key:"download",value:function(e,t){var n=new Blob([e],{type:"application/octet-stream"}),r=document.createElement("a");r.download=t,r.href=window.URL.createObjectURL(n),r.target="_blank",r.style.display="none",document.body.appendChild(r),r.click(),document.body.removeChild(r)}},{key:"dispatchEvent",value:function(e,t){document.dispatchEvent(new k("basthon.".concat(e),t))}},{key:"addEventListener",value:function(e,t){document.addEventListener("basthon.".concat(e),(function(e){t(e.detail)}))}},{key:"clone",value:function(e){return JSON.parse(JSON.stringify(e))}},{key:"putRessource",value:function(e,t){var n,r=null!==(n=e.split(".").pop())&&void 0!==n?n:"";return this.moduleExts().includes(r)?this.putModule(e,t):this.putFile(e,t)}},{key:"evalFromEvent",value:(t=(0,o.Z)(y().mark((function e(t){var n,r,o,u,i,a,c,l,s=this;return y().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=function(e){return function(n){var r=s.clone(t);r.stream=e,r.content=n,s.dispatchEvent("eval.output",r)}},r=n("stdout"),o=n("stderr"),e.prev=3,e.next=6,this.evalAsync(t.code,r,o,t);case 6:u=e.sent,e.next=17;break;case 9:return e.prev=9,e.t0=e.catch(3),o(e.t0.toString()),(i=this.clone(t)).error=e.t0,i.execution_count=this.execution_count,this.dispatchEvent("eval.error",i),e.abrupt("return");case 17:if(null!=u){e.next=19;break}return e.abrupt("return");case 19:a=u[0],c=u[1],(l=this.clone(t)).execution_count=c,null!=a&&(l.result=a),this.dispatchEvent("eval.finished",l);case 25:case"end":return e.stop()}}),e,this,[[3,9]])}))),function(e){return t.apply(this,arguments)})}],[{key:"loadScript",value:function(e){return new Promise((function(t,n){var r=document.createElement("script");r.onload=t,r.onerror=n,r.src=e,document.head.appendChild(r)}))}},{key:"xhr",value:function(e){var t=new XMLHttpRequest;t.open(e.method,e.url,!0),null!=e.responseType&&(t.responseType=e.responseType);var n=new Promise((function(e,n){t.onload=function(){t.status>=200&&t.status<300?e(t.response):n(t)},t.onerror=function(){n(t)}}));e.headers&&Object.keys(e.headers).forEach((function(n){t.setRequestHeader(n,e.headers[n])}));var o=e.data;return o&&"object"===(0,r.Z)(o)&&(o=JSON.stringify(o)),t.send(o),n}}]),e}()},146:(e,t,n)=>{n.r(t),n.d(t,{KernelPython3:()=>p});var r=n(795),o=n(249),u=n(371),i=n(754),a=n(987),c=n(58),l=n(162),s=n.n(l);function f(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 p=function(e){(0,i.Z)(l,e);var t,n,a,c=f(l);function l(e){var t;return(0,o.Z)(this,l),(t=c.call(this,e))._pyodideUrl="https://cdn.jsdelivr.net/pyodide/v0.16.1/full/pyodide.js",t.__kernel__=null,t.pythonVersion="",t}return(0,u.Z)(l,[{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:(a=(0,r.Z)(s().mark((function e(){var t,n;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=window.pyodide,this.pythonVersion=t.runPython("import platform ; platform.python_version()"),n=console.error,console.error=function(){},e.next=6,t.loadPackage(this.basthonRoot(!0)+"/basthon.js");case 6:return console.error=n,e.next=9,t.runPythonAsync("import basthon as __basthon__");case 9:return this.__kernel__=t.globals.__basthon__.__kernel__,e.next=12,t.runPythonAsync("del __basthon__");case 12:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"launch",value:(n=(0,r.Z)(s().mark((function e(){var t;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,t=this.basthonRoot()+"/pyodide/pyodide.js",e.next=4,l.xhr({method:"HEAD",url:t});case 4:this._pyodideUrl=t,e.next=9;break;case 7:e.prev=7,e.t0=e.catch(0);case 9:return window.languagePluginUrl=this._pyodideUrl.substr(0,this._pyodideUrl.lastIndexOf("/"))+"/",e.prev=10,e.next=13,l.loadScript(this._pyodideUrl);case 13:e.next=20;break;case 15:throw e.prev=15,e.t1=e.catch(10),console.log(e.t1),console.error("Can't load pyodide.js"),e.t1;case 20:if(null!=window.languagePluginLoader){e.next=22;break}throw new Error("Can't load pyodide.js");case 22:return e.next=24,window.languagePluginLoader.then(this._onload.bind(this),(function(){throw new Error("Can't load Python from Pyodide")}));case 24:case"end":return e.stop()}}),e,this,[[0,7],[10,15]])}))),function(){return n.apply(this,arguments)})},{key:"evalAsync",value:(t=(0,r.Z)(s().mark((function e(t,n,r){var o,u=arguments;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=u.length>3&&void 0!==u[3]?u[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:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e,n,r){return t.apply(this,arguments)})},{key:"restart",value:function(){return this.__kernel__.restart()}},{key:"putFile",value:function(e,t){this.__kernel__.put_file(e,t)}},{key:"putModule",value:function(e,t){return this.__kernel__.put_module(e,t)}},{key:"userModules",value:function(){return this.__kernel__.user_modules()}},{key:"getFile",value:function(e){return this.__kernel__.get_file(e)}},{key:"getUserModuleFile",value:function(e){return this.__kernel__.get_user_module_file(e)}},{key:"more",value:function(e){return this.__kernel__.more(e)}},{key:"banner",value:function(){return'Python 3.8.2 (default, Dec 25 2020 21:20:57) on WebAssembly VM\nType "help", "copyright", "credits" or "license" for more information.'}},{key:"complete",value:function(e){return this.__kernel__.complete(e)}},{key:"chdir",value:function(e){window.pyodide._module.FS.chdir(e)}},{key:"mkdir",value:function(e){window.pyodide._module.FS.mkdir(e)}}]),l}(n(305).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})},58:(e,t,n)=>{function r(e){return r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},r(e)}n.d(t,{Z:()=>r})},754:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(960);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)}},987:(e,t,n)=>{n.d(t,{Z:()=>u});var r=n(522),o=n(753);function u(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)}},960:(e,t,n)=>{function r(e,t){return r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},r(e,t)}n.d(t,{Z:()=>r})},522:(e,t,n)=>{function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n.d(t,{Z:()=>r})}}]);
2
2
  //# sourceMappingURL=kernel-python3_lib_index_js.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"kernel-python3_lib_index_js.js","mappings":"sPAAe,SAASA,IACtB,GAAuB,oBAAZC,UAA4BA,QAAQC,UAAW,OAAO,EACjE,GAAID,QAAQC,UAAUC,KAAM,OAAO,EACnC,GAAqB,mBAAVC,MAAsB,OAAO,EAExC,IAEE,OADAC,QAAQC,UAAUC,QAAQC,KAAKP,QAAQC,UAAUG,QAAS,IAAI,iBACvD,EACP,MAAOI,GACP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,cAAc,KAGlBL,OAAOwJ,eAAeF,EAAU,YAAa,CAC3ClJ,UAAU,IAERmJ,IAAY,OAAeD,EAAUC,K,qDCd5B,SAASE,EAA2BT,EAAM7K,GACvD,GAAIA,IAA2B,YAAlB,OAAQA,IAAsC,mBAATA,GAChD,OAAOA,EACF,QAAa,IAATA,EACT,MAAM,IAAIqB,UAAU,4DAGtB,OAAO,OAAsBwJ,K,cCThB,SAASU,EAAgBP,EAAGQ,GAMzC,OALAD,EAAkB1J,OAAOjB,gBAAkB,SAAyBoK,EAAGQ,GAErE,OADAR,EAAEC,UAAYO,EACPR,GAGFO,EAAgBP,EAAGQ,G,gCCNb,SAASC,EAAQxF,GAG9B,OAAOwF,EAAU,mBAAqBC,QAAU,iBAAmBA,OAAOC,SAAW,SAAU1F,GAC7F,cAAcA,GACZ,SAAUA,GACZ,OAAOA,GAAO,mBAAqByF,QAAUzF,EAAIrE,cAAgB8J,QAAUzF,IAAQyF,OAAO5L,UAAY,gBAAkBmG,GACvHwF,EAAQxF,G","sources":["webpack://@basthon/browser-bundle/../../node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js","webpack://@basthon/browser-bundle/../../node_modules/@babel/runtime/helpers/esm/construct.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","webpack://@basthon/browser-bundle/../kernel-base/lib/kernel.js","webpack://@basthon/browser-bundle/../kernel-base/lib/version.js","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/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/typeof.js"],"sourcesContent":["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\n try {\n Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\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;\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\n return _construct.apply(null, arguments);\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\n _wrapNativeSuper = function _wrapNativeSuper(Class) {\n if (Class === null || !isNativeFunction(Class)) return Class;\n\n if (typeof Class !== \"function\") {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n if (typeof _cache !== \"undefined\") {\n if (_cache.has(Class)) return _cache.get(Class);\n\n _cache.set(Class, Wrapper);\n }\n\n function Wrapper() {\n return construct(Class, arguments, getPrototypeOf(this).constructor);\n }\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\n return _wrapNativeSuper(Class);\n}","export default function _isNativeFunction(fn) {\n return Function.toString.call(fn).indexOf(\"[native code]\") !== -1;\n}","import { PromiseDelegate } from \"promise-delegate\";\nimport { VERSION } from './version';\n/**\n * An error thrown by not implemented API functions.\n */\nclass NotImplementedError extends Error {\n constructor(funcName) {\n super(`Function ${funcName} not implemented!`);\n this.name = \"NotImplementedError\";\n }\n}\n/**\n * Event for Basthon's dispatch/listen.\n */\nclass BasthonEvent extends Event {\n constructor(id, data) {\n super(id);\n this.detail = data;\n }\n}\n/**\n * API that any Basthon kernel should fill to be supported\n * in console/notebook.\n */\nexport class KernelBase {\n constructor(rootPath) {\n this._ready = false;\n this._loaded = new PromiseDelegate();\n this.execution_count = 0;\n // root path where kernel is installed\n this._rootPath = rootPath;\n }\n /**\n * Kernel version number (string).\n */\n version() { return VERSION; }\n ;\n /**\n * Language implemented in the kernel (string).\n * Generally lower case.\n */\n language() { throw new NotImplementedError(\"language\"); }\n ;\n /**\n * Language name implemented in the kernel (string).\n * As it should be displayed in text.\n */\n languageName() { throw new NotImplementedError(\"languageName\"); }\n ;\n /**\n * Script (module) file extensions\n */\n moduleExts() {\n throw new NotImplementedError(\"moduleExts\");\n }\n ;\n /**\n * Launch the kernel.\n */\n async launch() { throw new NotImplementedError(\"launch\"); }\n ;\n /**\n * Async code evaluation that resolves with the result.\n */\n evalAsync(code, outCallback, errCallback, data = null) {\n throw new NotImplementedError(\"evalAsync\");\n }\n ;\n restart() { throw new NotImplementedError(\"restart\"); }\n ;\n putFile(filename, content) {\n throw new NotImplementedError(\"putFile\");\n }\n ;\n putModule(filename, content) {\n throw new NotImplementedError(\"putModule\");\n }\n ;\n userModules() { return []; }\n ;\n getFile(path) { throw new NotImplementedError(\"getFile\"); }\n ;\n getUserModuleFile(filename) {\n throw new NotImplementedError(\"getUserModuleFile\");\n }\n ;\n more(source) { throw new NotImplementedError(\"more\"); }\n ;\n complete(code) { return []; }\n ;\n banner() { return `Welcome to the ${this.languageName()} REPL!`; }\n ;\n ps1() { return \">>> \"; }\n ;\n ps2() { return \"... \"; }\n ;\n /**\n * Initialize the kernel.\n */\n async init() {\n try {\n await this.launch();\n }\n catch (error) {\n this._loaded.reject(error);\n return;\n }\n // connecting eval to basthon.eval.request event.\n this.addEventListener(\"eval.request\", this.evalFromEvent.bind(this));\n this._ready = true;\n this._loaded.resolve();\n }\n /**\n * Is the kernel ready?\n */\n get ready() { return this._ready; }\n /**\n * Promise that resolve when the kernel is loaded.\n */\n async loaded() { await this._loaded.promise; }\n /**\n * Root for kernel files. This is always the versnion number\n * directory inside the kernel directory.\n */\n basthonRoot(absolute = false) {\n let url = this._rootPath + \"/\" + this.version();\n if (absolute && !url.startsWith(\"http\")) {\n const base = window.location.origin + window.location.pathname;\n url = base.substring(0, base.lastIndexOf('/')) + \"/\" + url;\n }\n return url;\n }\n /**\n * Downloading data (bytes array) as filename\n * (opening browser dialog).\n */\n download(data, filename) {\n let blob = new Blob([data], { type: \"application/octet-stream\" });\n let anchor = document.createElement(\"a\");\n anchor.download = filename;\n anchor.href = window.URL.createObjectURL(blob);\n anchor.target = \"_blank\";\n anchor.style.display = \"none\"; // just to be safe!\n document.body.appendChild(anchor);\n anchor.click();\n document.body.removeChild(anchor);\n }\n ;\n /**\n * Dynamically load a script asynchronously.\n */\n static loadScript(url) {\n return new Promise(function (resolve, reject) {\n let script = document.createElement('script');\n script.onload = resolve;\n script.onerror = reject;\n script.src = url;\n document.head.appendChild(script);\n });\n }\n ;\n /**\n * Wraper around XMLHttpRequest.\n */\n static xhr(params) {\n const xhr = new XMLHttpRequest();\n xhr.open(params.method, params.url, true);\n if (params.responseType != null)\n xhr.responseType = params.responseType;\n const promise = new Promise(function (resolve, reject) {\n xhr.onload = function () {\n if (xhr.status >= 200 && xhr.status < 300) {\n resolve(xhr.response);\n }\n else {\n reject(xhr);\n }\n };\n xhr.onerror = function () { reject(xhr); };\n });\n // headers\n if (params.headers) {\n Object.keys(params.headers).forEach(function (key) {\n xhr.setRequestHeader(key, params.headers[key]);\n });\n }\n // data\n let data = params.data;\n if (data && typeof data === 'object') {\n data = JSON.stringify(data);\n }\n xhr.send(data);\n return promise;\n }\n ;\n /**\n * Wrapper around document.dispatchEvent.\n * It adds the 'basthon.' prefix to each event name and\n * manage the event lookup to retreive relevent data.\n */\n dispatchEvent(eventName, data) {\n document.dispatchEvent(new BasthonEvent(`basthon.${eventName}`, data));\n }\n ;\n /**\n * Wrapper around document.addEventListener.\n * It manages the 'basthon.' prefix to each event name and\n * manage the event lookup to retreive relevent data.\n */\n addEventListener(eventName, callback) {\n document.addEventListener(`basthon.${eventName}`, function (event) { callback(event.detail); });\n }\n ;\n /**\n * Simple clone via JSON copy.\n */\n clone(obj) {\n // simple trick that is enough for our purpose.\n return JSON.parse(JSON.stringify(obj));\n }\n ;\n /**\n * Put a ressource (file or module).\n * Detection is based on extension.\n */\n putRessource(filename, content) {\n var _a;\n const ext = (_a = filename.split('.').pop()) !== null && _a !== void 0 ? _a : \"\";\n if (this.moduleExts().includes(ext)) {\n return this.putModule(filename, content);\n }\n else {\n return this.putFile(filename, content);\n }\n }\n ;\n /**\n * Internal. Code evaluation after an eval.request event.\n */\n async evalFromEvent(data) {\n const stdCallback = (std) => (text) => {\n let dataEvent = this.clone(data);\n dataEvent.stream = std;\n dataEvent.content = text;\n this.dispatchEvent(\"eval.output\", dataEvent);\n };\n const outCallback = stdCallback(\"stdout\");\n const errCallback = stdCallback(\"stderr\");\n let args;\n try {\n args = await this.evalAsync(data.code, outCallback, errCallback, data);\n }\n catch (error) {\n errCallback(error.toString());\n const dataEvent = this.clone(data);\n dataEvent.error = error;\n dataEvent.execution_count = this.execution_count;\n this.dispatchEvent(\"eval.error\", dataEvent);\n return;\n }\n if (args == null)\n return; // this should not happend\n const result = args[0];\n const executionCount = args[1];\n let dataEvent = this.clone(data);\n dataEvent.execution_count = executionCount;\n if (result != null)\n dataEvent.result = result;\n this.dispatchEvent(\"eval.finished\", dataEvent);\n }\n}\n","export const VERSION = \"0.40.8\";\n","import { KernelBase } from '@basthon/kernel-base';\n/**\n * A Python kernel that satisfies Basthon's API.\n */\nexport class KernelPython3 extends KernelBase {\n constructor(rootPath) {\n super(rootPath);\n /**\n * Where to find pyodide.js (private).\n */\n this._pyodideUrl = \"https://cdn.jsdelivr.net/pyodide/v0.16.1/full/pyodide.js\";\n this.__kernel__ = null;\n this.pythonVersion = \"\";\n }\n /**\n * Get the URL of Basthon modules dir.\n */\n basthonModulesRoot(absolute = false) {\n return this.basthonRoot(absolute) + \"/modules\";\n }\n language() { return \"python3\"; }\n languageName() { return \"Python 3\"; }\n moduleExts() { return ['py']; }\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 /* testing if Pyodide is installed locally */\n try {\n const url = this.basthonRoot() + \"/pyodide/pyodide.js\";\n await KernelPython3.xhr({ method: \"HEAD\", url: url });\n this._pyodideUrl = url;\n }\n catch (e) { }\n // forcing Pyodide to look at the right location for other files\n window.languagePluginUrl = this._pyodideUrl.substr(0, this._pyodideUrl.lastIndexOf('/')) + '/';\n try {\n await KernelPython3.loadScript(this._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 () { throw new Error(\"Can't load Python from Pyodide\"); });\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) { console.log(text); };\n }\n if (typeof errCallback === 'undefined') {\n errCallback = function (text) { console.error(text); };\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 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 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 * Download a file from the VFS.\n */\n getFile(path) {\n return this.__kernel__.get_file(path);\n }\n /**\n * Download a user module file.\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\n return self;\n}","export default function _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : 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\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\n return assertThisInitialized(self);\n}","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}","export default function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, _typeof(obj);\n}"],"names":["_isNativeReflectConstruct","Reflect","construct","sham","Proxy","Boolean","prototype","valueOf","call","e","_construct","Parent","args","Class","a","push","apply","instance","Function","bind","setPrototypeOf","arguments","_wrapNativeSuper","_cache","Map","undefined","fn","toString","indexOf","TypeError","has","get","set","Wrapper","getPrototypeOf","this","constructor","Object","create","value","enumerable","writable","configurable","NotImplementedError","funcName","name","Error","BasthonEvent","id","data","detail","Event","KernelBase","rootPath","_ready","_loaded","PromiseDelegate","execution_count","_rootPath","code","outCallback","errCallback","filename","content","path","source","languageName","launch","reject","addEventListener","evalFromEvent","resolve","promise","absolute","url","version","startsWith","base","window","location","origin","pathname","substring","lastIndexOf","blob","Blob","type","anchor","document","createElement","download","href","URL","createObjectURL","target","style","display","body","appendChild","click","removeChild","eventName","dispatchEvent","callback","event","obj","JSON","parse","stringify","_a","ext","split","pop","moduleExts","includes","putModule","putFile","stdCallback","std","text","dataEvent","clone","stream","evalAsync","error","result","executionCount","Promise","script","onload","onerror","src","head","params","xhr","XMLHttpRequest","open","method","responseType","status","response","headers","keys","forEach","key","setRequestHeader","send","KernelPython3","_pyodideUrl","__kernel__","pythonVersion","basthonRoot","pyodide","runPython","consoleErrorBck","console","loadPackage","runPythonAsync","globals","__basthon__","languagePluginUrl","substr","loadScript","log","languagePluginLoader","then","_onload","eval","restart","put_file","put_module","user_modules","get_file","get_user_module_file","more","complete","_module","FS","chdir","mkdir","_assertThisInitialized","self","ReferenceError","_getPrototypeOf","o","__proto__","_inherits","subClass","superClass","defineProperty","_possibleConstructorReturn","_setPrototypeOf","p","_typeof","Symbol","iterator"],"sourceRoot":""}
1
+ {"version":3,"file":"kernel-python3_lib_index_js.js","mappings":"sPAAe,SAASA,IACtB,GAAuB,oBAAZC,UAA4BA,QAAQC,UAAW,OAAO,EACjE,GAAID,QAAQC,UAAUC,KAAM,OAAO,EACnC,GAAqB,mBAAVC,MAAsB,OAAO,EAExC,IAEE,OADAC,QAAQC,UAAUC,QAAQC,KAAKP,QAAQC,UAAUG,QAAS,IAAI,iBACvD,EACP,MAAOI,GACP,OAAO,GCPI,SAASC,EAAWC,EAAQC,EAAMC,GAc/C,OAZEH,EADE,IACWT,QAAQC,UAER,SAAoBS,EAAQC,EAAMC,GAC7C,IAAIC,EAAI,CAAC,MACTA,EAAEC,KAAKC,MAAMF,EAAGF,GAChB,IACIK,EAAW,IADGC,SAASC,KAAKH,MAAML,EAAQG,IAG9C,OADID,IAAO,EAAAO,EAAA,GAAeH,EAAUJ,EAAMP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U,EAAgBP,EAAGQ,GAMzC,OALAD,EAAkB1J,OAAOjB,gBAAkB,SAAyBoK,EAAGQ,GAErE,OADAR,EAAEC,UAAYO,EACPR,GAGFO,EAAgBP,EAAGQ,G,gCCNb,SAASC,EAAQxF,GAG9B,OAAOwF,EAAU,mBAAqBC,QAAU,iBAAmBA,OAAOC,SAAW,SAAU1F,GAC7F,cAAcA,GACZ,SAAUA,GACZ,OAAOA,GAAO,mBAAqByF,QAAUzF,EAAIrE,cAAgB8J,QAAUzF,IAAQyF,OAAO5L,UAAY,gBAAkBmG,GACvHwF,EAAQxF,G","sources":["webpack://@basthon/browser-bundle/../../node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js","webpack://@basthon/browser-bundle/../../node_modules/@babel/runtime/helpers/esm/construct.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","webpack://@basthon/browser-bundle/../kernel-base/lib/kernel.js","webpack://@basthon/browser-bundle/../kernel-base/lib/version.js","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/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/typeof.js"],"sourcesContent":["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\n try {\n Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\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;\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\n return _construct.apply(null, arguments);\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\n _wrapNativeSuper = function _wrapNativeSuper(Class) {\n if (Class === null || !isNativeFunction(Class)) return Class;\n\n if (typeof Class !== \"function\") {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n if (typeof _cache !== \"undefined\") {\n if (_cache.has(Class)) return _cache.get(Class);\n\n _cache.set(Class, Wrapper);\n }\n\n function Wrapper() {\n return construct(Class, arguments, getPrototypeOf(this).constructor);\n }\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\n return _wrapNativeSuper(Class);\n}","export default function _isNativeFunction(fn) {\n return Function.toString.call(fn).indexOf(\"[native code]\") !== -1;\n}","import { PromiseDelegate } from \"promise-delegate\";\nimport { VERSION } from './version';\n/**\n * An error thrown by not implemented API functions.\n */\nclass NotImplementedError extends Error {\n constructor(funcName) {\n super(`Function ${funcName} not implemented!`);\n this.name = \"NotImplementedError\";\n }\n}\n/**\n * Event for Basthon's dispatch/listen.\n */\nclass BasthonEvent extends Event {\n constructor(id, data) {\n super(id);\n this.detail = data;\n }\n}\n/**\n * API that any Basthon kernel should fill to be supported\n * in console/notebook.\n */\nexport class KernelBase {\n constructor(rootPath) {\n this._ready = false;\n this._loaded = new PromiseDelegate();\n this.execution_count = 0;\n // root path where kernel is installed\n this._rootPath = rootPath;\n }\n /**\n * Kernel version number (string).\n */\n version() { return VERSION; }\n ;\n /**\n * Language implemented in the kernel (string).\n * Generally lower case.\n */\n language() { throw new NotImplementedError(\"language\"); }\n ;\n /**\n * Language name implemented in the kernel (string).\n * As it should be displayed in text.\n */\n languageName() { throw new NotImplementedError(\"languageName\"); }\n ;\n /**\n * Script (module) file extensions\n */\n moduleExts() {\n throw new NotImplementedError(\"moduleExts\");\n }\n ;\n /**\n * Launch the kernel.\n */\n async launch() { throw new NotImplementedError(\"launch\"); }\n ;\n /**\n * Async code evaluation that resolves with the result.\n */\n evalAsync(code, outCallback, errCallback, data = null) {\n throw new NotImplementedError(\"evalAsync\");\n }\n ;\n restart() { throw new NotImplementedError(\"restart\"); }\n ;\n putFile(filename, content) {\n throw new NotImplementedError(\"putFile\");\n }\n ;\n putModule(filename, content) {\n throw new NotImplementedError(\"putModule\");\n }\n ;\n userModules() { return []; }\n ;\n getFile(path) { throw new NotImplementedError(\"getFile\"); }\n ;\n getUserModuleFile(filename) {\n throw new NotImplementedError(\"getUserModuleFile\");\n }\n ;\n more(source) { throw new NotImplementedError(\"more\"); }\n ;\n complete(code) { return []; }\n ;\n banner() { return `Welcome to the ${this.languageName()} REPL!`; }\n ;\n ps1() { return \">>> \"; }\n ;\n ps2() { return \"... \"; }\n ;\n /**\n * Initialize the kernel.\n */\n async init() {\n try {\n await this.launch();\n }\n catch (error) {\n this._loaded.reject(error);\n return;\n }\n // connecting eval to basthon.eval.request event.\n this.addEventListener(\"eval.request\", this.evalFromEvent.bind(this));\n this._ready = true;\n this._loaded.resolve();\n }\n /**\n * Is the kernel ready?\n */\n get ready() { return this._ready; }\n /**\n * Promise that resolve when the kernel is loaded.\n */\n async loaded() { await this._loaded.promise; }\n /**\n * Root for kernel files. This is always the versnion number\n * directory inside the kernel directory.\n */\n basthonRoot(absolute = false) {\n let url = this._rootPath + \"/\" + this.version();\n if (absolute && !url.startsWith(\"http\")) {\n const base = window.location.origin + window.location.pathname;\n url = base.substring(0, base.lastIndexOf('/')) + \"/\" + url;\n }\n return url;\n }\n /**\n * Downloading data (bytes array) as filename\n * (opening browser dialog).\n */\n download(data, filename) {\n let blob = new Blob([data], { type: \"application/octet-stream\" });\n let anchor = document.createElement(\"a\");\n anchor.download = filename;\n anchor.href = window.URL.createObjectURL(blob);\n anchor.target = \"_blank\";\n anchor.style.display = \"none\"; // just to be safe!\n document.body.appendChild(anchor);\n anchor.click();\n document.body.removeChild(anchor);\n }\n ;\n /**\n * Dynamically load a script asynchronously.\n */\n static loadScript(url) {\n return new Promise(function (resolve, reject) {\n let script = document.createElement('script');\n script.onload = resolve;\n script.onerror = reject;\n script.src = url;\n document.head.appendChild(script);\n });\n }\n ;\n /**\n * Wraper around XMLHttpRequest.\n */\n static xhr(params) {\n const xhr = new XMLHttpRequest();\n xhr.open(params.method, params.url, true);\n if (params.responseType != null)\n xhr.responseType = params.responseType;\n const promise = new Promise(function (resolve, reject) {\n xhr.onload = function () {\n if (xhr.status >= 200 && xhr.status < 300) {\n resolve(xhr.response);\n }\n else {\n reject(xhr);\n }\n };\n xhr.onerror = function () { reject(xhr); };\n });\n // headers\n if (params.headers) {\n Object.keys(params.headers).forEach(function (key) {\n xhr.setRequestHeader(key, params.headers[key]);\n });\n }\n // data\n let data = params.data;\n if (data && typeof data === 'object') {\n data = JSON.stringify(data);\n }\n xhr.send(data);\n return promise;\n }\n ;\n /**\n * Wrapper around document.dispatchEvent.\n * It adds the 'basthon.' prefix to each event name and\n * manage the event lookup to retreive relevent data.\n */\n dispatchEvent(eventName, data) {\n document.dispatchEvent(new BasthonEvent(`basthon.${eventName}`, data));\n }\n ;\n /**\n * Wrapper around document.addEventListener.\n * It manages the 'basthon.' prefix to each event name and\n * manage the event lookup to retreive relevent data.\n */\n addEventListener(eventName, callback) {\n document.addEventListener(`basthon.${eventName}`, function (event) { callback(event.detail); });\n }\n ;\n /**\n * Simple clone via JSON copy.\n */\n clone(obj) {\n // simple trick that is enough for our purpose.\n return JSON.parse(JSON.stringify(obj));\n }\n ;\n /**\n * Put a ressource (file or module).\n * Detection is based on extension.\n */\n putRessource(filename, content) {\n var _a;\n const ext = (_a = filename.split('.').pop()) !== null && _a !== void 0 ? _a : \"\";\n if (this.moduleExts().includes(ext)) {\n return this.putModule(filename, content);\n }\n else {\n return this.putFile(filename, content);\n }\n }\n ;\n /**\n * Internal. Code evaluation after an eval.request event.\n */\n async evalFromEvent(data) {\n const stdCallback = (std) => (text) => {\n let dataEvent = this.clone(data);\n dataEvent.stream = std;\n dataEvent.content = text;\n this.dispatchEvent(\"eval.output\", dataEvent);\n };\n const outCallback = stdCallback(\"stdout\");\n const errCallback = stdCallback(\"stderr\");\n let args;\n try {\n args = await this.evalAsync(data.code, outCallback, errCallback, data);\n }\n catch (error) {\n errCallback(error.toString());\n const dataEvent = this.clone(data);\n dataEvent.error = error;\n dataEvent.execution_count = this.execution_count;\n this.dispatchEvent(\"eval.error\", dataEvent);\n return;\n }\n if (args == null)\n return; // this should not happend\n const result = args[0];\n const executionCount = args[1];\n let dataEvent = this.clone(data);\n dataEvent.execution_count = executionCount;\n if (result != null)\n dataEvent.result = result;\n this.dispatchEvent(\"eval.finished\", dataEvent);\n }\n}\n","export const VERSION = \"0.40.9\";\n","import { KernelBase } from '@basthon/kernel-base';\n/**\n * A Python kernel that satisfies Basthon's API.\n */\nexport class KernelPython3 extends KernelBase {\n constructor(rootPath) {\n super(rootPath);\n /**\n * Where to find pyodide.js (private).\n */\n this._pyodideUrl = \"https://cdn.jsdelivr.net/pyodide/v0.16.1/full/pyodide.js\";\n this.__kernel__ = null;\n this.pythonVersion = \"\";\n }\n /**\n * Get the URL of Basthon modules dir.\n */\n basthonModulesRoot(absolute = false) {\n return this.basthonRoot(absolute) + \"/modules\";\n }\n language() { return \"python3\"; }\n languageName() { return \"Python 3\"; }\n moduleExts() { return ['py']; }\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 /* testing if Pyodide is installed locally */\n try {\n const url = this.basthonRoot() + \"/pyodide/pyodide.js\";\n await KernelPython3.xhr({ method: \"HEAD\", url: url });\n this._pyodideUrl = url;\n }\n catch (e) { }\n // forcing Pyodide to look at the right location for other files\n window.languagePluginUrl = this._pyodideUrl.substr(0, this._pyodideUrl.lastIndexOf('/')) + '/';\n try {\n await KernelPython3.loadScript(this._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 () { throw new Error(\"Can't load Python from Pyodide\"); });\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) { console.log(text); };\n }\n if (typeof errCallback === 'undefined') {\n errCallback = function (text) { console.error(text); };\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 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 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 * Download a file from the VFS.\n */\n getFile(path) {\n return this.__kernel__.get_file(path);\n }\n /**\n * Download a user module file.\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\n return self;\n}","export default function _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : 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\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\n return assertThisInitialized(self);\n}","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}","export default function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, _typeof(obj);\n}"],"names":["_isNativeReflectConstruct","Reflect","construct","sham","Proxy","Boolean","prototype","valueOf","call","e","_construct","Parent","args","Class","a","push","apply","instance","Function","bind","setPrototypeOf","arguments","_wrapNativeSuper","_cache","Map","undefined","fn","toString","indexOf","TypeError","has","get","set","Wrapper","getPrototypeOf","this","constructor","Object","create","value","enumerable","writable","configurable","NotImplementedError","funcName","name","Error","BasthonEvent","id","data","detail","Event","KernelBase","rootPath","_ready","_loaded","PromiseDelegate","execution_count","_rootPath","code","outCallback","errCallback","filename","content","path","source","languageName","launch","reject","addEventListener","evalFromEvent","resolve","promise","absolute","url","version","startsWith","base","window","location","origin","pathname","substring","lastIndexOf","blob","Blob","type","anchor","document","createElement","download","href","URL","createObjectURL","target","style","display","body","appendChild","click","removeChild","eventName","dispatchEvent","callback","event","obj","JSON","parse","stringify","_a","ext","split","pop","moduleExts","includes","putModule","putFile","stdCallback","std","text","dataEvent","clone","stream","evalAsync","error","result","executionCount","Promise","script","onload","onerror","src","head","params","xhr","XMLHttpRequest","open","method","responseType","status","response","headers","keys","forEach","key","setRequestHeader","send","KernelPython3","_pyodideUrl","__kernel__","pythonVersion","basthonRoot","pyodide","runPython","consoleErrorBck","console","loadPackage","runPythonAsync","globals","__basthon__","languagePluginUrl","substr","loadScript","log","languagePluginLoader","then","_onload","eval","restart","put_file","put_module","user_modules","get_file","get_user_module_file","more","complete","_module","FS","chdir","mkdir","_assertThisInitialized","self","ReferenceError","_getPrototypeOf","o","__proto__","_inherits","subClass","superClass","defineProperty","_possibleConstructorReturn","_setPrototypeOf","p","_typeof","Symbol","iterator"],"sourceRoot":""}
@@ -1,2 +1,2 @@
1
- "use strict";(self.webpackChunk_basthon_browser_bundle=self.webpackChunk_basthon_browser_bundle||[]).push([["kernel-sql_lib_index_js"],{305:(t,e,n)=>{n.d(e,{H:()=>w});var r=n(522),o=n(795),u=n(371),a=n(249),c=n(754),i=n(987),s=n(58),l=n(960);function f(){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(t){return!1}}function h(t,e,n){return h=f()?Reflect.construct:function(t,e,n){var r=[null];r.push.apply(r,e);var o=new(Function.bind.apply(t,r));return n&&(0,l.Z)(o,n.prototype),o},h.apply(null,arguments)}function p(t){var e="function"==typeof Map?new Map:void 0;return p=function(t){if(null===t||(n=t,-1===Function.toString.call(n).indexOf("[native code]")))return t;var n;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return h(t,arguments,(0,s.Z)(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),(0,l.Z)(r,t)},p(t)}var d=n(162),v=n.n(d),y=n(490);function b(t){var e=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(t){return!1}}();return function(){var n,r=(0,s.Z)(t);if(e){var o=(0,s.Z)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,i.Z)(this,n)}}var m=function(t){(0,c.Z)(n,t);var e=b(n);function n(t){var r;return(0,a.Z)(this,n),(r=e.call(this,"Function ".concat(t," not implemented!"))).name="NotImplementedError",r}return(0,u.Z)(n)}(p(Error)),k=function(t){(0,c.Z)(n,t);var e=b(n);function n(t,r){var o;return(0,a.Z)(this,n),(o=e.call(this,t)).detail=r,o}return(0,u.Z)(n)}(p(Event)),w=function(){function t(e){(0,a.Z)(this,t),this._ready=!1,this._loaded=new y.I,this.execution_count=0,this._rootPath=e}var e,n,c,i;return(0,u.Z)(t,[{key:"version",value:function(){return"0.40.8"}},{key:"language",value:function(){throw new m("language")}},{key:"languageName",value:function(){throw new m("languageName")}},{key:"moduleExts",value:function(){throw new m("moduleExts")}},{key:"launch",value:(i=(0,o.Z)(v().mark((function t(){return v().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:throw new m("launch");case 1:case"end":return t.stop()}}),t)}))),function(){return i.apply(this,arguments)})},{key:"evalAsync",value:function(t,e,n){throw new m("evalAsync")}},{key:"restart",value:function(){throw new m("restart")}},{key:"putFile",value:function(t,e){throw new m("putFile")}},{key:"putModule",value:function(t,e){throw new m("putModule")}},{key:"userModules",value:function(){return[]}},{key:"getFile",value:function(t){throw new m("getFile")}},{key:"getUserModuleFile",value:function(t){throw new m("getUserModuleFile")}},{key:"more",value:function(t){throw new m("more")}},{key:"complete",value:function(t){return[]}},{key:"banner",value:function(){return"Welcome to the ".concat(this.languageName()," REPL!")}},{key:"ps1",value:function(){return">>> "}},{key:"ps2",value:function(){return"... "}},{key:"init",value:(c=(0,o.Z)(v().mark((function t(){return v().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.launch();case 3:t.next=9;break;case 5:return t.prev=5,t.t0=t.catch(0),this._loaded.reject(t.t0),t.abrupt("return");case 9:this.addEventListener("eval.request",this.evalFromEvent.bind(this)),this._ready=!0,this._loaded.resolve();case 12:case"end":return t.stop()}}),t,this,[[0,5]])}))),function(){return c.apply(this,arguments)})},{key:"ready",get:function(){return this._ready}},{key:"loaded",value:(n=(0,o.Z)(v().mark((function t(){return v().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._loaded.promise;case 2:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"basthonRoot",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this._rootPath+"/"+this.version();if(t&&!e.startsWith("http")){var n=window.location.origin+window.location.pathname;e=n.substring(0,n.lastIndexOf("/"))+"/"+e}return e}},{key:"download",value:function(t,e){var n=new Blob([t],{type:"application/octet-stream"}),r=document.createElement("a");r.download=e,r.href=window.URL.createObjectURL(n),r.target="_blank",r.style.display="none",document.body.appendChild(r),r.click(),document.body.removeChild(r)}},{key:"dispatchEvent",value:function(t,e){document.dispatchEvent(new k("basthon.".concat(t),e))}},{key:"addEventListener",value:function(t,e){document.addEventListener("basthon.".concat(t),(function(t){e(t.detail)}))}},{key:"clone",value:function(t){return JSON.parse(JSON.stringify(t))}},{key:"putRessource",value:function(t,e){var n,r=null!==(n=t.split(".").pop())&&void 0!==n?n:"";return this.moduleExts().includes(r)?this.putModule(t,e):this.putFile(t,e)}},{key:"evalFromEvent",value:(e=(0,o.Z)(v().mark((function t(e){var n,r,o,u,a,c,i,s,l=this;return v().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=function(t){return function(n){var r=l.clone(e);r.stream=t,r.content=n,l.dispatchEvent("eval.output",r)}},r=n("stdout"),o=n("stderr"),t.prev=3,t.next=6,this.evalAsync(e.code,r,o,e);case 6:u=t.sent,t.next=17;break;case 9:return t.prev=9,t.t0=t.catch(3),o(t.t0.toString()),(a=this.clone(e)).error=t.t0,a.execution_count=this.execution_count,this.dispatchEvent("eval.error",a),t.abrupt("return");case 17:if(null!=u){t.next=19;break}return t.abrupt("return");case 19:c=u[0],i=u[1],(s=this.clone(e)).execution_count=i,null!=c&&(s.result=c),this.dispatchEvent("eval.finished",s);case 25:case"end":return t.stop()}}),t,this,[[3,9]])}))),function(t){return e.apply(this,arguments)})}],[{key:"loadScript",value:function(t){return new Promise((function(e,n){var r=document.createElement("script");r.onload=e,r.onerror=n,r.src=t,document.head.appendChild(r)}))}},{key:"xhr",value:function(t){var e=new XMLHttpRequest;e.open(t.method,t.url,!0),null!=t.responseType&&(e.responseType=t.responseType);var n=new Promise((function(t,n){e.onload=function(){e.status>=200&&e.status<300?t(e.response):n(e)},e.onerror=function(){n(e)}}));t.headers&&Object.keys(t.headers).forEach((function(n){e.setRequestHeader(n,t.headers[n])}));var o=t.data;return o&&"object"===(0,r.Z)(o)&&(o=JSON.stringify(o)),e.send(o),n}}]),t}()},39:(t,e,n)=>{n.r(e),n.d(e,{KernelSQL:()=>v});var r=n(249),o=n(371),u=n(753),a=n(754),c=n(987),i=n(58),s=n(795),l=n(162),f=n.n(l);function h(t){var e=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(t){return!1}}();return function(){var n,r=(0,i.Z)(t);if(e){var o=(0,i.Z)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,c.Z)(this,n)}}function p(t){return d.apply(this,arguments)}function d(){return(d=(0,s.Z)(f().mark((function t(e){var n,r,o;return f().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,fetch(e("sql-wasm.min.js"));case 2:return n=t.sent,t.next=5,n.text();case 5:return r=t.sent,new Function("exports",r)(o={}),t.abrupt("return",o.Module({locateFile:e}));case 10:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var v=function(t){(0,a.Z)(i,t);var e,n,c=h(i);function i(t){var e;return(0,r.Z)(this,i),(e=c.call(this,t)).execution_count=0,e._sqlJsBase="https://cdnjs.cloudflare.com/ajax/libs/sql.js/1.5.0/",e._dbInit=void 0,e._sqlsInit=[],e._dots={".backup":{callback:e._export.bind((0,u.Z)(e)),help:"Download as binary file"},".dump":{callback:e._dump.bind((0,u.Z)(e)),help:"Download as SQL file"},".export":{callback:e._export.bind((0,u.Z)(e)),help:"See .backup"},".help":{callback:e._help.bind((0,u.Z)(e)),help:"Show this help"},".save":{callback:e._export.bind((0,u.Z)(e)),help:"See .backup"},".schema":{callback:e._schema.bind((0,u.Z)(e)),help:"Show the CREATE statements"},".tables":{callback:e._tables.bind((0,u.Z)(e)),help:"List names of tables"}},e}return(0,o.Z)(i,[{key:"language",value:function(){return"sql"}},{key:"languageName",value:function(){return"SQL"}},{key:"moduleExts",value:function(){return["sql","db","sqlite"]}},{key:"launch",value:(n=(0,s.Z)(f().mark((function t(){var e=this;return f().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,p((function(t){return"".concat(e._sqlJsBase).concat(t)}));case 2:this.SQL=t.sent,this.restart();case 4:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"formatResult",value:function(t){var e=void 0;return null!=t&&t.length>0&&(e={"text/plain":i.text_table(t[0]),"text/html":i.html_table(t[0])}),e}},{key:"evalAsync",value:(e=(0,s.Z)(f().mark((function t(e,n,r){var o,u,a,c=arguments;return f().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return(c.length>3&&void 0!==c[3]?c[3]:null).interactive=!0,this.execution_count++,o=void 0,(u=e.replace(/^[; \t\n]+|[; \t\n]+$/g,""))in this._dots?(a=this._dots[u].callback,o=a()):o=this.formatResult(this.db.exec(e)),t.abrupt("return",[o,this.execution_count]);case 7:case"end":return t.stop()}}),t,this)}))),function(t,n,r){return e.apply(this,arguments)})},{key:"ps1",value:function(){return"sql> "}},{key:"ps2",value:function(){return"...> "}},{key:"restart",value:function(){var t=this;this.db&&this.db.close(),this.execution_count=0,this.db=new this.SQL.Database(this._dbInit),this.db.run("PRAGMA foreign_keys = ON;"),this._sqlsInit.forEach((function(e){t.db.run(e)}))}},{key:"more",value:function(t){return!1}},{key:"complete",value:function(t){return[]}},{key:"putFile",value:function(t,e){}},{key:"putModule",value:function(t,e){switch(e=new Uint8Array(e),t.split(".").pop()){case"sql":var n=new TextDecoder("utf-8").decode(e);this.db.run(n),this._sqlsInit.push(n);break;case"sqlite":case"db":this.db&&this.db.close(),this.db=new this.SQL.Database(e),this._dbInit=e;break;default:throw{message:"Only '.sql', '.db' and '.sqlite' files supported."}}}},{key:"_help",value:function(){var t=this;return{"text/plain":Object.keys(this._dots).map((function(e){return"".concat(e,"\t\t").concat(t._dots[e].help)})).join("\n")}}},{key:"_export",value:function(){this.download(this.db.export(),"database.db")}},{key:"dump",value:function(){var t,e,n=this,r=null===(t=this.tables(!1)[0])||void 0===t?void 0:t.values,o=null===(e=this.schema(!1)[0])||void 0===e?void 0:e.values,u=r.map((function(t){var e,r=(null===(e=n.db.exec("SELECT * FROM ".concat(t))[0])||void 0===e?void 0:e.values).map((function(t){return"(".concat(t.map(JSON.stringify).join(", "),")")}));return"INSERT INTO ".concat(t," VALUES ").concat(r.join(",\n"),";")}));return"".concat(o.join(";\n"),";\n").concat(u.join("\n"))}},{key:"_dump",value:function(){var t=(new TextEncoder).encode(this.dump());this.download(t,"database.sql")}},{key:"schema",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=t?"ORDER BY tbl_name, type DESC, name":"";return this.db.exec("SELECT sql FROM sqlite_schema ".concat(e,";"))}},{key:"_schema",value:function(){return this.formatResult(this.schema())}},{key:"tables",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=t?"ORDER BY 1":"";return this.db.exec("SELECT name FROM sqlite_schema\nWHERE type IN ('table','view') AND name NOT LIKE 'sqlite_%'\n".concat(e,";"))}},{key:"_tables",value:function(){return this.formatResult(this.tables())}}],[{key:"troncate_table",value:function(t){if(t.values.length>=150){var e=Math.floor(50),n=t.values.slice(0,e),r=t.values.slice(-e);t.values=n.concat([t.columns.map((function(){return"⋮ "}))],r)}}},{key:"html_table",value:function(t){this.troncate_table(t);var e=t.columns.map((function(t){return"<th>".concat(t,"</th>")})).join(""),n='<thead><tr style="text-align: right;">'.concat(e,"</tr></thead>"),r=t.values.map((function(t){return"<tr>"+t.map((function(t){return"<td>".concat(t,"</td>")})).join("")+"</tr>"})).join(""),o="<tbody>".concat(r,"</tbody>");return'<table class="dataframe" border="1">'.concat(n).concat(o,"</table>")}},{key:"text_table",value:function(t){i.troncate_table(t);var e=t.columns.join("\t"),n=t.values.map((function(t){return t.join("\t")})).join("\n");return"".concat(e,"\n").concat(n)}}]),i}(n(305).H)},753:(t,e,n)=>{function r(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}n.d(e,{Z:()=>r})},58:(t,e,n)=>{function r(t){return r=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},r(t)}n.d(e,{Z:()=>r})},754:(t,e,n)=>{n.d(e,{Z:()=>o});var r=n(960);function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&(0,r.Z)(t,e)}},987:(t,e,n)=>{n.d(e,{Z:()=>u});var r=n(522),o=n(753);function u(t,e){if(e&&("object"===(0,r.Z)(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return(0,o.Z)(t)}},960:(t,e,n)=>{function r(t,e){return r=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},r(t,e)}n.d(e,{Z:()=>r})},522:(t,e,n)=>{function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}n.d(e,{Z:()=>r})}}]);
1
+ "use strict";(self.webpackChunk_basthon_browser_bundle=self.webpackChunk_basthon_browser_bundle||[]).push([["kernel-sql_lib_index_js"],{305:(t,e,n)=>{n.d(e,{H:()=>w});var r=n(522),o=n(795),u=n(371),a=n(249),c=n(754),i=n(987),s=n(58),l=n(960);function f(){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(t){return!1}}function h(t,e,n){return h=f()?Reflect.construct:function(t,e,n){var r=[null];r.push.apply(r,e);var o=new(Function.bind.apply(t,r));return n&&(0,l.Z)(o,n.prototype),o},h.apply(null,arguments)}function p(t){var e="function"==typeof Map?new Map:void 0;return p=function(t){if(null===t||(n=t,-1===Function.toString.call(n).indexOf("[native code]")))return t;var n;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return h(t,arguments,(0,s.Z)(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),(0,l.Z)(r,t)},p(t)}var d=n(162),v=n.n(d),y=n(490);function b(t){var e=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(t){return!1}}();return function(){var n,r=(0,s.Z)(t);if(e){var o=(0,s.Z)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,i.Z)(this,n)}}var m=function(t){(0,c.Z)(n,t);var e=b(n);function n(t){var r;return(0,a.Z)(this,n),(r=e.call(this,"Function ".concat(t," not implemented!"))).name="NotImplementedError",r}return(0,u.Z)(n)}(p(Error)),k=function(t){(0,c.Z)(n,t);var e=b(n);function n(t,r){var o;return(0,a.Z)(this,n),(o=e.call(this,t)).detail=r,o}return(0,u.Z)(n)}(p(Event)),w=function(){function t(e){(0,a.Z)(this,t),this._ready=!1,this._loaded=new y.I,this.execution_count=0,this._rootPath=e}var e,n,c,i;return(0,u.Z)(t,[{key:"version",value:function(){return"0.40.9"}},{key:"language",value:function(){throw new m("language")}},{key:"languageName",value:function(){throw new m("languageName")}},{key:"moduleExts",value:function(){throw new m("moduleExts")}},{key:"launch",value:(i=(0,o.Z)(v().mark((function t(){return v().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:throw new m("launch");case 1:case"end":return t.stop()}}),t)}))),function(){return i.apply(this,arguments)})},{key:"evalAsync",value:function(t,e,n){throw new m("evalAsync")}},{key:"restart",value:function(){throw new m("restart")}},{key:"putFile",value:function(t,e){throw new m("putFile")}},{key:"putModule",value:function(t,e){throw new m("putModule")}},{key:"userModules",value:function(){return[]}},{key:"getFile",value:function(t){throw new m("getFile")}},{key:"getUserModuleFile",value:function(t){throw new m("getUserModuleFile")}},{key:"more",value:function(t){throw new m("more")}},{key:"complete",value:function(t){return[]}},{key:"banner",value:function(){return"Welcome to the ".concat(this.languageName()," REPL!")}},{key:"ps1",value:function(){return">>> "}},{key:"ps2",value:function(){return"... "}},{key:"init",value:(c=(0,o.Z)(v().mark((function t(){return v().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.launch();case 3:t.next=9;break;case 5:return t.prev=5,t.t0=t.catch(0),this._loaded.reject(t.t0),t.abrupt("return");case 9:this.addEventListener("eval.request",this.evalFromEvent.bind(this)),this._ready=!0,this._loaded.resolve();case 12:case"end":return t.stop()}}),t,this,[[0,5]])}))),function(){return c.apply(this,arguments)})},{key:"ready",get:function(){return this._ready}},{key:"loaded",value:(n=(0,o.Z)(v().mark((function t(){return v().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._loaded.promise;case 2:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"basthonRoot",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this._rootPath+"/"+this.version();if(t&&!e.startsWith("http")){var n=window.location.origin+window.location.pathname;e=n.substring(0,n.lastIndexOf("/"))+"/"+e}return e}},{key:"download",value:function(t,e){var n=new Blob([t],{type:"application/octet-stream"}),r=document.createElement("a");r.download=e,r.href=window.URL.createObjectURL(n),r.target="_blank",r.style.display="none",document.body.appendChild(r),r.click(),document.body.removeChild(r)}},{key:"dispatchEvent",value:function(t,e){document.dispatchEvent(new k("basthon.".concat(t),e))}},{key:"addEventListener",value:function(t,e){document.addEventListener("basthon.".concat(t),(function(t){e(t.detail)}))}},{key:"clone",value:function(t){return JSON.parse(JSON.stringify(t))}},{key:"putRessource",value:function(t,e){var n,r=null!==(n=t.split(".").pop())&&void 0!==n?n:"";return this.moduleExts().includes(r)?this.putModule(t,e):this.putFile(t,e)}},{key:"evalFromEvent",value:(e=(0,o.Z)(v().mark((function t(e){var n,r,o,u,a,c,i,s,l=this;return v().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=function(t){return function(n){var r=l.clone(e);r.stream=t,r.content=n,l.dispatchEvent("eval.output",r)}},r=n("stdout"),o=n("stderr"),t.prev=3,t.next=6,this.evalAsync(e.code,r,o,e);case 6:u=t.sent,t.next=17;break;case 9:return t.prev=9,t.t0=t.catch(3),o(t.t0.toString()),(a=this.clone(e)).error=t.t0,a.execution_count=this.execution_count,this.dispatchEvent("eval.error",a),t.abrupt("return");case 17:if(null!=u){t.next=19;break}return t.abrupt("return");case 19:c=u[0],i=u[1],(s=this.clone(e)).execution_count=i,null!=c&&(s.result=c),this.dispatchEvent("eval.finished",s);case 25:case"end":return t.stop()}}),t,this,[[3,9]])}))),function(t){return e.apply(this,arguments)})}],[{key:"loadScript",value:function(t){return new Promise((function(e,n){var r=document.createElement("script");r.onload=e,r.onerror=n,r.src=t,document.head.appendChild(r)}))}},{key:"xhr",value:function(t){var e=new XMLHttpRequest;e.open(t.method,t.url,!0),null!=t.responseType&&(e.responseType=t.responseType);var n=new Promise((function(t,n){e.onload=function(){e.status>=200&&e.status<300?t(e.response):n(e)},e.onerror=function(){n(e)}}));t.headers&&Object.keys(t.headers).forEach((function(n){e.setRequestHeader(n,t.headers[n])}));var o=t.data;return o&&"object"===(0,r.Z)(o)&&(o=JSON.stringify(o)),e.send(o),n}}]),t}()},39:(t,e,n)=>{n.r(e),n.d(e,{KernelSQL:()=>v});var r=n(249),o=n(371),u=n(753),a=n(754),c=n(987),i=n(58),s=n(795),l=n(162),f=n.n(l);function h(t){var e=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(t){return!1}}();return function(){var n,r=(0,i.Z)(t);if(e){var o=(0,i.Z)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,c.Z)(this,n)}}function p(t){return d.apply(this,arguments)}function d(){return(d=(0,s.Z)(f().mark((function t(e){var n,r,o;return f().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,fetch(e("sql-wasm.min.js"));case 2:return n=t.sent,t.next=5,n.text();case 5:return r=t.sent,new Function("exports",r)(o={}),t.abrupt("return",o.Module({locateFile:e}));case 10:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var v=function(t){(0,a.Z)(i,t);var e,n,c=h(i);function i(t){var e;return(0,r.Z)(this,i),(e=c.call(this,t)).execution_count=0,e._sqlJsBase="https://cdnjs.cloudflare.com/ajax/libs/sql.js/1.5.0/",e._dbInit=void 0,e._sqlsInit=[],e._dots={".backup":{callback:e._export.bind((0,u.Z)(e)),help:"Download as binary file"},".dump":{callback:e._dump.bind((0,u.Z)(e)),help:"Download as SQL file"},".export":{callback:e._export.bind((0,u.Z)(e)),help:"See .backup"},".help":{callback:e._help.bind((0,u.Z)(e)),help:"Show this help"},".save":{callback:e._export.bind((0,u.Z)(e)),help:"See .backup"},".schema":{callback:e._schema.bind((0,u.Z)(e)),help:"Show the CREATE statements"},".tables":{callback:e._tables.bind((0,u.Z)(e)),help:"List names of tables"}},e}return(0,o.Z)(i,[{key:"language",value:function(){return"sql"}},{key:"languageName",value:function(){return"SQL"}},{key:"moduleExts",value:function(){return["sql","db","sqlite"]}},{key:"launch",value:(n=(0,s.Z)(f().mark((function t(){var e=this;return f().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,p((function(t){return"".concat(e._sqlJsBase).concat(t)}));case 2:this.SQL=t.sent,this.restart();case 4:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"formatResult",value:function(t){var e=void 0;return null!=t&&t.length>0&&(e={"text/plain":i.text_table(t[0]),"text/html":i.html_table(t[0])}),e}},{key:"evalAsync",value:(e=(0,s.Z)(f().mark((function t(e,n,r){var o,u,a,c=arguments;return f().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return(c.length>3&&void 0!==c[3]?c[3]:null).interactive=!0,this.execution_count++,o=void 0,(u=e.replace(/^[; \t\n]+|[; \t\n]+$/g,""))in this._dots?(a=this._dots[u].callback,o=a()):o=this.formatResult(this.db.exec(e)),t.abrupt("return",[o,this.execution_count]);case 7:case"end":return t.stop()}}),t,this)}))),function(t,n,r){return e.apply(this,arguments)})},{key:"ps1",value:function(){return"sql> "}},{key:"ps2",value:function(){return"...> "}},{key:"restart",value:function(){var t=this;this.db&&this.db.close(),this.execution_count=0,this.db=new this.SQL.Database(this._dbInit),this.db.run("PRAGMA foreign_keys = ON;"),this._sqlsInit.forEach((function(e){t.db.run(e)}))}},{key:"more",value:function(t){return!1}},{key:"complete",value:function(t){return[]}},{key:"putFile",value:function(t,e){}},{key:"putModule",value:function(t,e){switch(e=new Uint8Array(e),t.split(".").pop()){case"sql":var n=new TextDecoder("utf-8").decode(e);this.db.run(n),this._sqlsInit.push(n);break;case"sqlite":case"db":this.db&&this.db.close(),this.db=new this.SQL.Database(e),this._dbInit=e;break;default:throw{message:"Only '.sql', '.db' and '.sqlite' files supported."}}}},{key:"_help",value:function(){var t=this;return{"text/plain":Object.keys(this._dots).map((function(e){return"".concat(e,"\t\t").concat(t._dots[e].help)})).join("\n")}}},{key:"_export",value:function(){this.download(this.db.export(),"database.db")}},{key:"dump",value:function(){var t,e,n=this,r=null===(t=this.tables(!1)[0])||void 0===t?void 0:t.values,o=null===(e=this.schema(!1)[0])||void 0===e?void 0:e.values,u=r.map((function(t){var e,r=(null===(e=n.db.exec("SELECT * FROM ".concat(t))[0])||void 0===e?void 0:e.values).map((function(t){return"(".concat(t.map(JSON.stringify).join(", "),")")}));return"INSERT INTO ".concat(t," VALUES ").concat(r.join(",\n"),";")}));return"".concat(o.join(";\n"),";\n").concat(u.join("\n"))}},{key:"_dump",value:function(){var t=(new TextEncoder).encode(this.dump());this.download(t,"database.sql")}},{key:"schema",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=t?"ORDER BY tbl_name, type DESC, name":"";return this.db.exec("SELECT sql FROM sqlite_schema ".concat(e,";"))}},{key:"_schema",value:function(){return this.formatResult(this.schema())}},{key:"tables",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=t?"ORDER BY 1":"";return this.db.exec("SELECT name FROM sqlite_schema\nWHERE type IN ('table','view') AND name NOT LIKE 'sqlite_%'\n".concat(e,";"))}},{key:"_tables",value:function(){return this.formatResult(this.tables())}}],[{key:"troncate_table",value:function(t){if(t.values.length>=150){var e=Math.floor(50),n=t.values.slice(0,e),r=t.values.slice(-e);t.values=n.concat([t.columns.map((function(){return"⋮ "}))],r)}}},{key:"html_table",value:function(t){this.troncate_table(t);var e=t.columns.map((function(t){return"<th>".concat(t,"</th>")})).join(""),n='<thead><tr style="text-align: right;">'.concat(e,"</tr></thead>"),r=t.values.map((function(t){return"<tr>"+t.map((function(t){return"<td>".concat(t,"</td>")})).join("")+"</tr>"})).join(""),o="<tbody>".concat(r,"</tbody>");return'<table class="dataframe" border="1">'.concat(n).concat(o,"</table>")}},{key:"text_table",value:function(t){i.troncate_table(t);var e=t.columns.join("\t"),n=t.values.map((function(t){return t.join("\t")})).join("\n");return"".concat(e,"\n").concat(n)}}]),i}(n(305).H)},753:(t,e,n)=>{function r(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}n.d(e,{Z:()=>r})},58:(t,e,n)=>{function r(t){return r=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},r(t)}n.d(e,{Z:()=>r})},754:(t,e,n)=>{n.d(e,{Z:()=>o});var r=n(960);function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&(0,r.Z)(t,e)}},987:(t,e,n)=>{n.d(e,{Z:()=>u});var r=n(522),o=n(753);function u(t,e){if(e&&("object"===(0,r.Z)(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return(0,o.Z)(t)}},960:(t,e,n)=>{function r(t,e){return r=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},r(t,e)}n.d(e,{Z:()=>r})},522:(t,e,n)=>{function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}n.d(e,{Z:()=>r})}}]);
2
2
  //# sourceMappingURL=kernel-sql_lib_index_js.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"kernel-sql_lib_index_js.js","mappings":"kPAAe,SAASA,IACtB,GAAuB,oBAAZC,UAA4BA,QAAQC,UAAW,OAAO,EACjE,GAAID,QAAQC,UAAUC,K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+B,OAAOC,OAAOwL,GAAcA,EAAWxN,UAAW,CACrE8B,YAAa,CACXG,MAAOsL,EACPpL,UAAU,EACVC,cAAc,KAGlBL,OAAO0L,eAAeF,EAAU,YAAa,CAC3CpL,UAAU,IAERqL,IAAY,OAAeD,EAAUC,K,qDCd5B,SAASE,EAA2BT,EAAM/M,GACvD,GAAIA,IAA2B,YAAlB,OAAQA,IAAsC,mBAATA,GAChD,OAAOA,EACF,QAAa,IAATA,EACT,MAAM,IAAIqB,UAAU,4DAGtB,OAAO,OAAsB0L,K,cCThB,SAASU,EAAgBP,EAAGQ,GAMzC,OALAD,EAAkB5L,OAAOjB,gBAAkB,SAAyBsM,EAAGQ,GAErE,OADAR,EAAEC,UAAYO,EACPR,GAGFO,EAAgBP,EAAGQ,G,gCCNb,SAASC,EAAQ1H,GAG9B,OAAO0H,EAAU,mBAAqBC,QAAU,iBAAmBA,OAAOC,SAAW,SAAU5H,GAC7F,cAAcA,GACZ,SAAUA,GACZ,OAAOA,GAAO,mBAAqB2H,QAAU3H,EAAIrE,cAAgBgM,QAAU3H,IAAQ2H,OAAO9N,UAAY,gBAAkBmG,GACvH0H,EAAQ1H,G","sources":["webpack://@basthon/browser-bundle/../../node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js","webpack://@basthon/browser-bundle/../../node_modules/@babel/runtime/helpers/esm/construct.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","webpack://@basthon/browser-bundle/../kernel-base/lib/kernel.js","webpack://@basthon/browser-bundle/../kernel-base/lib/version.js","webpack://@basthon/browser-bundle/../kernel-sql/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/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/typeof.js"],"sourcesContent":["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\n try {\n Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\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;\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\n return _construct.apply(null, arguments);\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\n _wrapNativeSuper = function _wrapNativeSuper(Class) {\n if (Class === null || !isNativeFunction(Class)) return Class;\n\n if (typeof Class !== \"function\") {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n if (typeof _cache !== \"undefined\") {\n if (_cache.has(Class)) return _cache.get(Class);\n\n _cache.set(Class, Wrapper);\n }\n\n function Wrapper() {\n return construct(Class, arguments, getPrototypeOf(this).constructor);\n }\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\n return _wrapNativeSuper(Class);\n}","export default function _isNativeFunction(fn) {\n return Function.toString.call(fn).indexOf(\"[native code]\") !== -1;\n}","import { PromiseDelegate } from \"promise-delegate\";\nimport { VERSION } from './version';\n/**\n * An error thrown by not implemented API functions.\n */\nclass NotImplementedError extends Error {\n constructor(funcName) {\n super(`Function ${funcName} not implemented!`);\n this.name = \"NotImplementedError\";\n }\n}\n/**\n * Event for Basthon's dispatch/listen.\n */\nclass BasthonEvent extends Event {\n constructor(id, data) {\n super(id);\n this.detail = data;\n }\n}\n/**\n * API that any Basthon kernel should fill to be supported\n * in console/notebook.\n */\nexport class KernelBase {\n constructor(rootPath) {\n this._ready = false;\n this._loaded = new PromiseDelegate();\n this.execution_count = 0;\n // root path where kernel is installed\n this._rootPath = rootPath;\n }\n /**\n * Kernel version number (string).\n */\n version() { return VERSION; }\n ;\n /**\n * Language implemented in the kernel (string).\n * Generally lower case.\n */\n language() { throw new NotImplementedError(\"language\"); }\n ;\n /**\n * Language name implemented in the kernel (string).\n * As it should be displayed in text.\n */\n languageName() { throw new NotImplementedError(\"languageName\"); }\n ;\n /**\n * Script (module) file extensions\n */\n moduleExts() {\n throw new NotImplementedError(\"moduleExts\");\n }\n ;\n /**\n * Launch the kernel.\n */\n async launch() { throw new NotImplementedError(\"launch\"); }\n ;\n /**\n * Async code evaluation that resolves with the result.\n */\n evalAsync(code, outCallback, errCallback, data = null) {\n throw new NotImplementedError(\"evalAsync\");\n }\n ;\n restart() { throw new NotImplementedError(\"restart\"); }\n ;\n putFile(filename, content) {\n throw new NotImplementedError(\"putFile\");\n }\n ;\n putModule(filename, content) {\n throw new NotImplementedError(\"putModule\");\n }\n ;\n userModules() { return []; }\n ;\n getFile(path) { throw new NotImplementedError(\"getFile\"); }\n ;\n getUserModuleFile(filename) {\n throw new NotImplementedError(\"getUserModuleFile\");\n }\n ;\n more(source) { throw new NotImplementedError(\"more\"); }\n ;\n complete(code) { return []; }\n ;\n banner() { return `Welcome to the ${this.languageName()} REPL!`; }\n ;\n ps1() { return \">>> \"; }\n ;\n ps2() { return \"... \"; }\n ;\n /**\n * Initialize the kernel.\n */\n async init() {\n try {\n await this.launch();\n }\n catch (error) {\n this._loaded.reject(error);\n return;\n }\n // connecting eval to basthon.eval.request event.\n this.addEventListener(\"eval.request\", this.evalFromEvent.bind(this));\n this._ready = true;\n this._loaded.resolve();\n }\n /**\n * Is the kernel ready?\n */\n get ready() { return this._ready; }\n /**\n * Promise that resolve when the kernel is loaded.\n */\n async loaded() { await this._loaded.promise; }\n /**\n * Root for kernel files. This is always the versnion number\n * directory inside the kernel directory.\n */\n basthonRoot(absolute = false) {\n let url = this._rootPath + \"/\" + this.version();\n if (absolute && !url.startsWith(\"http\")) {\n const base = window.location.origin + window.location.pathname;\n url = base.substring(0, base.lastIndexOf('/')) + \"/\" + url;\n }\n return url;\n }\n /**\n * Downloading data (bytes array) as filename\n * (opening browser dialog).\n */\n download(data, filename) {\n let blob = new Blob([data], { type: \"application/octet-stream\" });\n let anchor = document.createElement(\"a\");\n anchor.download = filename;\n anchor.href = window.URL.createObjectURL(blob);\n anchor.target = \"_blank\";\n anchor.style.display = \"none\"; // just to be safe!\n document.body.appendChild(anchor);\n anchor.click();\n document.body.removeChild(anchor);\n }\n ;\n /**\n * Dynamically load a script asynchronously.\n */\n static loadScript(url) {\n return new Promise(function (resolve, reject) {\n let script = document.createElement('script');\n script.onload = resolve;\n script.onerror = reject;\n script.src = url;\n document.head.appendChild(script);\n });\n }\n ;\n /**\n * Wraper around XMLHttpRequest.\n */\n static xhr(params) {\n const xhr = new XMLHttpRequest();\n xhr.open(params.method, params.url, true);\n if (params.responseType != null)\n xhr.responseType = params.responseType;\n const promise = new Promise(function (resolve, reject) {\n xhr.onload = function () {\n if (xhr.status >= 200 && xhr.status < 300) {\n resolve(xhr.response);\n }\n else {\n reject(xhr);\n }\n };\n xhr.onerror = function () { reject(xhr); };\n });\n // headers\n if (params.headers) {\n Object.keys(params.headers).forEach(function (key) {\n xhr.setRequestHeader(key, params.headers[key]);\n });\n }\n // data\n let data = params.data;\n if (data && typeof data === 'object') {\n data = JSON.stringify(data);\n }\n xhr.send(data);\n return promise;\n }\n ;\n /**\n * Wrapper around document.dispatchEvent.\n * It adds the 'basthon.' prefix to each event name and\n * manage the event lookup to retreive relevent data.\n */\n dispatchEvent(eventName, data) {\n document.dispatchEvent(new BasthonEvent(`basthon.${eventName}`, data));\n }\n ;\n /**\n * Wrapper around document.addEventListener.\n * It manages the 'basthon.' prefix to each event name and\n * manage the event lookup to retreive relevent data.\n */\n addEventListener(eventName, callback) {\n document.addEventListener(`basthon.${eventName}`, function (event) { callback(event.detail); });\n }\n ;\n /**\n * Simple clone via JSON copy.\n */\n clone(obj) {\n // simple trick that is enough for our purpose.\n return JSON.parse(JSON.stringify(obj));\n }\n ;\n /**\n * Put a ressource (file or module).\n * Detection is based on extension.\n */\n putRessource(filename, content) {\n var _a;\n const ext = (_a = filename.split('.').pop()) !== null && _a !== void 0 ? _a : \"\";\n if (this.moduleExts().includes(ext)) {\n return this.putModule(filename, content);\n }\n else {\n return this.putFile(filename, content);\n }\n }\n ;\n /**\n * Internal. Code evaluation after an eval.request event.\n */\n async evalFromEvent(data) {\n const stdCallback = (std) => (text) => {\n let dataEvent = this.clone(data);\n dataEvent.stream = std;\n dataEvent.content = text;\n this.dispatchEvent(\"eval.output\", dataEvent);\n };\n const outCallback = stdCallback(\"stdout\");\n const errCallback = stdCallback(\"stderr\");\n let args;\n try {\n args = await this.evalAsync(data.code, outCallback, errCallback, data);\n }\n catch (error) {\n errCallback(error.toString());\n const dataEvent = this.clone(data);\n dataEvent.error = error;\n dataEvent.execution_count = this.execution_count;\n this.dispatchEvent(\"eval.error\", dataEvent);\n return;\n }\n if (args == null)\n return; // this should not happend\n const result = args[0];\n const executionCount = args[1];\n let dataEvent = this.clone(data);\n dataEvent.execution_count = executionCount;\n if (result != null)\n dataEvent.result = result;\n this.dispatchEvent(\"eval.finished\", dataEvent);\n }\n}\n","export const VERSION = \"0.40.8\";\n","import { KernelBase } from '@basthon/kernel-base';\n/**\n * Workaround lack of ES6 support in SQL.js.\n *\n * https://github.com/sql-js/sql.js/issues/284\n *\n * Sample usage:\n * ```\n * import { initSqlJs } from './SqlJs';\n *\n * initSqlJs(file => `path/to/dist/${file}`).then(SQL => {\n * const db = new SQL.Database();\n * });\n * ```\n * @param {function(string): string} fileMap\n */\nasync function initSqlJs(fileMap) {\n // Get the SqlJs code as a string.\n const response = await fetch(fileMap('sql-wasm.min.js'));\n const code = await response.text();\n // Instantiate the code and access its exports.\n const f = new Function('exports', code);\n const exports = {};\n f(exports);\n // Call the real initSqlJs().\n return exports.Module({ locateFile: fileMap });\n}\nexport class KernelSQL extends KernelBase {\n constructor(rootPath) {\n super(rootPath);\n this.execution_count = 0;\n this._sqlJsBase = \"https://cdnjs.cloudflare.com/ajax/libs/sql.js/1.5.0/\";\n // initial db file (used to restart SQLite)\n this._dbInit = undefined;\n // initial SQL strings (used to restart SQLite)\n this._sqlsInit = [];\n // dot commands\n this._dots = {\n '.backup': {\n 'callback': this._export.bind(this),\n 'help': \"Download as binary file\",\n },\n '.dump': {\n 'callback': this._dump.bind(this),\n 'help': \"Download as SQL file\",\n },\n '.export': {\n 'callback': this._export.bind(this),\n 'help': \"See .backup\",\n },\n '.help': {\n 'callback': this._help.bind(this),\n 'help': \"Show this help\",\n },\n '.save': {\n 'callback': this._export.bind(this),\n 'help': \"See .backup\",\n },\n '.schema': {\n 'callback': this._schema.bind(this),\n 'help': \"Show the CREATE statements\",\n },\n '.tables': {\n 'callback': this._tables.bind(this),\n 'help': \"List names of tables\",\n },\n };\n }\n ;\n language() { return \"sql\"; }\n ;\n languageName() { return \"SQL\"; }\n ;\n moduleExts() { return ['sql', 'db', 'sqlite']; }\n ;\n async launch() {\n this.SQL = await initSqlJs((file) => `${this._sqlJsBase}${file}`);\n this.restart();\n }\n ;\n /**\n * Troncate json table to 150 items.\n */\n static troncate_table(json) {\n const max_size = 150;\n if (json.values.length >= max_size) {\n const half_length = Math.floor(max_size / 3);\n const head = json.values.slice(0, half_length);\n const tail = json.values.slice(-half_length);\n json.values = head.concat([json.columns.map(() => '⋮ ')], tail);\n }\n }\n ;\n /**\n * HTML version of a table (useful in notebook).\n */\n static html_table(json) {\n this.troncate_table(json);\n const columns = json.columns.map((c) => `<th>${c}</th>`).join('');\n const head = `<thead><tr style=\"text-align: right;\">${columns}</tr></thead>`;\n const values = json.values.map((r) => '<tr>' + r.map((v) => `<td>${v}</td>`).join('') + '</tr>').join('');\n const body = `<tbody>${values}</tbody>`;\n return `<table class=\"dataframe\" border=\"1\">${head}${body}</table>`;\n }\n ;\n /**\n * Text version of a table.\n */\n static text_table(json) {\n KernelSQL.troncate_table(json);\n const head = json.columns.join('\\t');\n const values = json.values.map((r) => r.join('\\t')).join('\\n');\n return `${head}\\n${values}`;\n }\n ;\n /**\n * Format the result to fit Kernel API.\n */\n formatResult(output) {\n let result = undefined;\n if (output != null && output.length > 0)\n result = {\n 'text/plain': KernelSQL.text_table(output[0]),\n 'text/html': KernelSQL.html_table(output[0])\n };\n return result;\n }\n async evalAsync(code, outCallback, errCallback, data = null) {\n // force interactivity in all modes\n data.interactive = true;\n this.execution_count++;\n let result = undefined;\n const dotCommand = code.replace(/^[; \\t\\n]+|[; \\t\\n]+$/g, '');\n if (dotCommand in this._dots) {\n const callback = this._dots[dotCommand].callback;\n result = callback();\n }\n else\n result = this.formatResult(this.db.exec(code));\n return [result, this.execution_count];\n }\n ;\n ps1() { return \"sql> \"; }\n ;\n ps2() { return \"...> \"; }\n ;\n restart() {\n // warning: we should probably reload module files...\n if (this.db)\n this.db.close();\n this.execution_count = 0;\n // reloading .db file\n this.db = new this.SQL.Database(this._dbInit);\n // foreign keys are activated by default\n // see: https://www.sqlite.org/foreignkeys.html#fk_enable\n this.db.run(\"PRAGMA foreign_keys = ON;\");\n // reloading SQL modules files\n this._sqlsInit.forEach(c => { this.db.run(c); });\n }\n ;\n more(source) { return false; }\n ;\n complete(code) { return []; }\n ;\n putFile(filename, content) {\n // just ignoring this since we don't have a filesystem.\n }\n ;\n putModule(filename, content) {\n content = new Uint8Array(content);\n const ext = filename.split('.').pop();\n switch (ext) {\n case 'sql':\n let decoder = new TextDecoder(\"utf-8\");\n const _content = decoder.decode(content);\n this.db.run(_content);\n // SQL strings are concatenated\n this._sqlsInit.push(_content);\n break;\n case 'sqlite':\n case 'db':\n if (this.db)\n this.db.close();\n this.db = new this.SQL.Database(content);\n // initial db file is replaced\n this._dbInit = content;\n break;\n default:\n throw { message: \"Only '.sql', '.db' and '.sqlite' files supported.\" };\n }\n }\n /**\n * Display help.\n */\n _help() {\n const helpMessage = Object.keys(this._dots).map((key) => `${key}\\t\\t${this._dots[key].help}`).join(\"\\n\");\n return { \"text/plain\": helpMessage };\n }\n /**\n * Export (download) the database in binary format.\n */\n _export() {\n this.download(this.db.export(), \"database.db\");\n }\n /**\n * Return the SQL commands to build the DB in a string.\n */\n dump() {\n var _a, _b;\n // order is creation order (order=false)\n const tables = (_a = this.tables(false)[0]) === null || _a === void 0 ? void 0 : _a.values;\n const schema = (_b = this.schema(false)[0]) === null || _b === void 0 ? void 0 : _b.values;\n const inserts = tables.map((table) => {\n var _a;\n const values = (_a = this.db.exec(`SELECT * FROM ${table}`)[0]) === null || _a === void 0 ? void 0 : _a.values;\n const strValues = values.map((value) => `(${value.map(JSON.stringify).join(', ')})`);\n return `INSERT INTO ${table} VALUES ${strValues.join(',\\n')};`;\n });\n return `${schema.join(';\\n')};\\n${inserts.join('\\n')}`;\n }\n /**\n * Dump (download) the database in SQL format (dot command version).\n */\n _dump() {\n const encoder = new TextEncoder();\n const view = encoder.encode(this.dump());\n this.download(view, \"database.sql\");\n }\n /**\n * Return the DB schema.\n */\n schema(order = true) {\n const orderCMD = order ? \"ORDER BY tbl_name, type DESC, name\" : \"\";\n return this.db.exec(`SELECT sql FROM sqlite_schema ${orderCMD};`);\n }\n /**\n * Return the DB schema (dot command version).\n */\n _schema() {\n return this.formatResult(this.schema());\n }\n /**\n * Return the table of tables.\n */\n tables(order = true) {\n const orderCMD = order ? \"ORDER BY 1\" : \"\";\n return this.db.exec(`SELECT name FROM sqlite_schema\nWHERE type IN ('table','view') AND name NOT LIKE 'sqlite_%'\n${orderCMD};`);\n }\n /**\n * Return the table of tables (dot command version).\n */\n _tables() {\n return this.formatResult(this.tables());\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\n return self;\n}","export default function _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : 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\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\n return assertThisInitialized(self);\n}","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}","export default function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, _typeof(obj);\n}"],"names":["_isNativeReflectConstruct","Reflect","construct","sham","Proxy","Boolean","prototype","valueOf","call","e","_construct","Parent","args","Class","a","push","apply","instance","Function","bind","setPrototypeOf","arguments","_wrapNativeSuper","_cache","Map","undefined","fn","toString","indexOf","TypeError","has","get","set","Wrapper","getPrototypeOf","this","constructor","Object","create","value","enumerable","writable","configurable","NotImplementedError","funcName","name","Error","BasthonEvent","id","data","detail","Event","KernelBase","rootPath","_ready","_loaded","PromiseDelegate","execution_count","_rootPath","code","outCallback","errCallback","filename","content","path","source","languageName","launch","reject","addEventListener","evalFromEvent","resolve","promise","absolute","url","version","startsWith","base","window","location","origin","pathname","substring","lastIndexOf","blob","Blob","type","anchor","document","createElement","download","href","URL","createObjectURL","target","style","display","body","appendChild","click","removeChild","eventName","dispatchEvent","callback","event","obj","JSON","parse","stringify","_a","ext","split","pop","moduleExts","includes","putModule","putFile","stdCallback","std","text","dataEvent","clone","stream","evalAsync","error","result","executionCount","Promise","script","onload","onerror","src","head","params","xhr","XMLHttpRequest","open","method","responseType","status","response","headers","keys","forEach","key","setRequestHeader","send","initSqlJs","fileMap","fetch","f","exports","Module","locateFile","KernelSQL","_sqlJsBase","_dbInit","_sqlsInit","_dots","_export","_dump","_help","_schema","_tables","file","SQL","restart","output","length","text_table","html_table","interactive","dotCommand","replace","formatResult","db","exec","close","Database","run","c","Uint8Array","_content","TextDecoder","decode","message","map","help","join","_b","tables","values","schema","inserts","table","strValues","view","TextEncoder","encode","dump","order","orderCMD","json","half_length","Math","floor","max_size","slice","tail","concat","columns","troncate_table","r","v","_assertThisInitialized","self","ReferenceError","_getPrototypeOf","o","__proto__","_inherits","subClass","superClass","defineProperty","_possibleConstructorReturn","_setPrototypeOf","p","_typeof","Symbol","iterator"],"sourceRoot":""}
1
+ {"version":3,"file":"kernel-sql_lib_index_js.js","mappings":"kPAAe,SAASA,IACtB,GAAuB,oBAAZC,UAA4BA,QAAQC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AM,IAAIjM,UAAU,sDAGtBgM,EAASvN,UAAY+B,OAAOC,OAAOwL,GAAcA,EAAWxN,UAAW,CACrE8B,YAAa,CACXG,MAAOsL,EACPpL,UAAU,EACVC,cAAc,KAGlBL,OAAO0L,eAAeF,EAAU,YAAa,CAC3CpL,UAAU,IAERqL,IAAY,OAAeD,EAAUC,K,qDCd5B,SAASE,EAA2BT,EAAM/M,GACvD,GAAIA,IAA2B,YAAlB,OAAQA,IAAsC,mBAATA,GAChD,OAAOA,EACF,QAAa,IAATA,EACT,MAAM,IAAIqB,UAAU,4DAGtB,OAAO,OAAsB0L,K,cCThB,SAASU,EAAgBP,EAAGQ,GAMzC,OALAD,EAAkB5L,OAAOjB,gBAAkB,SAAyBsM,EAAGQ,GAErE,OADAR,EAAEC,UAAYO,EACPR,GAGFO,EAAgBP,EAAGQ,G,gCCNb,SAASC,EAAQ1H,GAG9B,OAAO0H,EAAU,mBAAqBC,QAAU,iBAAmBA,OAAOC,SAAW,SAAU5H,GAC7F,cAAcA,GACZ,SAAUA,GACZ,OAAOA,GAAO,mBAAqB2H,QAAU3H,EAAIrE,cAAgBgM,QAAU3H,IAAQ2H,OAAO9N,UAAY,gBAAkBmG,GACvH0H,EAAQ1H,G","sources":["webpack://@basthon/browser-bundle/../../node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js","webpack://@basthon/browser-bundle/../../node_modules/@babel/runtime/helpers/esm/construct.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","webpack://@basthon/browser-bundle/../kernel-base/lib/kernel.js","webpack://@basthon/browser-bundle/../kernel-base/lib/version.js","webpack://@basthon/browser-bundle/../kernel-sql/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/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/typeof.js"],"sourcesContent":["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\n try {\n Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\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;\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\n return _construct.apply(null, arguments);\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\n _wrapNativeSuper = function _wrapNativeSuper(Class) {\n if (Class === null || !isNativeFunction(Class)) return Class;\n\n if (typeof Class !== \"function\") {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n if (typeof _cache !== \"undefined\") {\n if (_cache.has(Class)) return _cache.get(Class);\n\n _cache.set(Class, Wrapper);\n }\n\n function Wrapper() {\n return construct(Class, arguments, getPrototypeOf(this).constructor);\n }\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\n return _wrapNativeSuper(Class);\n}","export default function _isNativeFunction(fn) {\n return Function.toString.call(fn).indexOf(\"[native code]\") !== -1;\n}","import { PromiseDelegate } from \"promise-delegate\";\nimport { VERSION } from './version';\n/**\n * An error thrown by not implemented API functions.\n */\nclass NotImplementedError extends Error {\n constructor(funcName) {\n super(`Function ${funcName} not implemented!`);\n this.name = \"NotImplementedError\";\n }\n}\n/**\n * Event for Basthon's dispatch/listen.\n */\nclass BasthonEvent extends Event {\n constructor(id, data) {\n super(id);\n this.detail = data;\n }\n}\n/**\n * API that any Basthon kernel should fill to be supported\n * in console/notebook.\n */\nexport class KernelBase {\n constructor(rootPath) {\n this._ready = false;\n this._loaded = new PromiseDelegate();\n this.execution_count = 0;\n // root path where kernel is installed\n this._rootPath = rootPath;\n }\n /**\n * Kernel version number (string).\n */\n version() { return VERSION; }\n ;\n /**\n * Language implemented in the kernel (string).\n * Generally lower case.\n */\n language() { throw new NotImplementedError(\"language\"); }\n ;\n /**\n * Language name implemented in the kernel (string).\n * As it should be displayed in text.\n */\n languageName() { throw new NotImplementedError(\"languageName\"); }\n ;\n /**\n * Script (module) file extensions\n */\n moduleExts() {\n throw new NotImplementedError(\"moduleExts\");\n }\n ;\n /**\n * Launch the kernel.\n */\n async launch() { throw new NotImplementedError(\"launch\"); }\n ;\n /**\n * Async code evaluation that resolves with the result.\n */\n evalAsync(code, outCallback, errCallback, data = null) {\n throw new NotImplementedError(\"evalAsync\");\n }\n ;\n restart() { throw new NotImplementedError(\"restart\"); }\n ;\n putFile(filename, content) {\n throw new NotImplementedError(\"putFile\");\n }\n ;\n putModule(filename, content) {\n throw new NotImplementedError(\"putModule\");\n }\n ;\n userModules() { return []; }\n ;\n getFile(path) { throw new NotImplementedError(\"getFile\"); }\n ;\n getUserModuleFile(filename) {\n throw new NotImplementedError(\"getUserModuleFile\");\n }\n ;\n more(source) { throw new NotImplementedError(\"more\"); }\n ;\n complete(code) { return []; }\n ;\n banner() { return `Welcome to the ${this.languageName()} REPL!`; }\n ;\n ps1() { return \">>> \"; }\n ;\n ps2() { return \"... \"; }\n ;\n /**\n * Initialize the kernel.\n */\n async init() {\n try {\n await this.launch();\n }\n catch (error) {\n this._loaded.reject(error);\n return;\n }\n // connecting eval to basthon.eval.request event.\n this.addEventListener(\"eval.request\", this.evalFromEvent.bind(this));\n this._ready = true;\n this._loaded.resolve();\n }\n /**\n * Is the kernel ready?\n */\n get ready() { return this._ready; }\n /**\n * Promise that resolve when the kernel is loaded.\n */\n async loaded() { await this._loaded.promise; }\n /**\n * Root for kernel files. This is always the versnion number\n * directory inside the kernel directory.\n */\n basthonRoot(absolute = false) {\n let url = this._rootPath + \"/\" + this.version();\n if (absolute && !url.startsWith(\"http\")) {\n const base = window.location.origin + window.location.pathname;\n url = base.substring(0, base.lastIndexOf('/')) + \"/\" + url;\n }\n return url;\n }\n /**\n * Downloading data (bytes array) as filename\n * (opening browser dialog).\n */\n download(data, filename) {\n let blob = new Blob([data], { type: \"application/octet-stream\" });\n let anchor = document.createElement(\"a\");\n anchor.download = filename;\n anchor.href = window.URL.createObjectURL(blob);\n anchor.target = \"_blank\";\n anchor.style.display = \"none\"; // just to be safe!\n document.body.appendChild(anchor);\n anchor.click();\n document.body.removeChild(anchor);\n }\n ;\n /**\n * Dynamically load a script asynchronously.\n */\n static loadScript(url) {\n return new Promise(function (resolve, reject) {\n let script = document.createElement('script');\n script.onload = resolve;\n script.onerror = reject;\n script.src = url;\n document.head.appendChild(script);\n });\n }\n ;\n /**\n * Wraper around XMLHttpRequest.\n */\n static xhr(params) {\n const xhr = new XMLHttpRequest();\n xhr.open(params.method, params.url, true);\n if (params.responseType != null)\n xhr.responseType = params.responseType;\n const promise = new Promise(function (resolve, reject) {\n xhr.onload = function () {\n if (xhr.status >= 200 && xhr.status < 300) {\n resolve(xhr.response);\n }\n else {\n reject(xhr);\n }\n };\n xhr.onerror = function () { reject(xhr); };\n });\n // headers\n if (params.headers) {\n Object.keys(params.headers).forEach(function (key) {\n xhr.setRequestHeader(key, params.headers[key]);\n });\n }\n // data\n let data = params.data;\n if (data && typeof data === 'object') {\n data = JSON.stringify(data);\n }\n xhr.send(data);\n return promise;\n }\n ;\n /**\n * Wrapper around document.dispatchEvent.\n * It adds the 'basthon.' prefix to each event name and\n * manage the event lookup to retreive relevent data.\n */\n dispatchEvent(eventName, data) {\n document.dispatchEvent(new BasthonEvent(`basthon.${eventName}`, data));\n }\n ;\n /**\n * Wrapper around document.addEventListener.\n * It manages the 'basthon.' prefix to each event name and\n * manage the event lookup to retreive relevent data.\n */\n addEventListener(eventName, callback) {\n document.addEventListener(`basthon.${eventName}`, function (event) { callback(event.detail); });\n }\n ;\n /**\n * Simple clone via JSON copy.\n */\n clone(obj) {\n // simple trick that is enough for our purpose.\n return JSON.parse(JSON.stringify(obj));\n }\n ;\n /**\n * Put a ressource (file or module).\n * Detection is based on extension.\n */\n putRessource(filename, content) {\n var _a;\n const ext = (_a = filename.split('.').pop()) !== null && _a !== void 0 ? _a : \"\";\n if (this.moduleExts().includes(ext)) {\n return this.putModule(filename, content);\n }\n else {\n return this.putFile(filename, content);\n }\n }\n ;\n /**\n * Internal. Code evaluation after an eval.request event.\n */\n async evalFromEvent(data) {\n const stdCallback = (std) => (text) => {\n let dataEvent = this.clone(data);\n dataEvent.stream = std;\n dataEvent.content = text;\n this.dispatchEvent(\"eval.output\", dataEvent);\n };\n const outCallback = stdCallback(\"stdout\");\n const errCallback = stdCallback(\"stderr\");\n let args;\n try {\n args = await this.evalAsync(data.code, outCallback, errCallback, data);\n }\n catch (error) {\n errCallback(error.toString());\n const dataEvent = this.clone(data);\n dataEvent.error = error;\n dataEvent.execution_count = this.execution_count;\n this.dispatchEvent(\"eval.error\", dataEvent);\n return;\n }\n if (args == null)\n return; // this should not happend\n const result = args[0];\n const executionCount = args[1];\n let dataEvent = this.clone(data);\n dataEvent.execution_count = executionCount;\n if (result != null)\n dataEvent.result = result;\n this.dispatchEvent(\"eval.finished\", dataEvent);\n }\n}\n","export const VERSION = \"0.40.9\";\n","import { KernelBase } from '@basthon/kernel-base';\n/**\n * Workaround lack of ES6 support in SQL.js.\n *\n * https://github.com/sql-js/sql.js/issues/284\n *\n * Sample usage:\n * ```\n * import { initSqlJs } from './SqlJs';\n *\n * initSqlJs(file => `path/to/dist/${file}`).then(SQL => {\n * const db = new SQL.Database();\n * });\n * ```\n * @param {function(string): string} fileMap\n */\nasync function initSqlJs(fileMap) {\n // Get the SqlJs code as a string.\n const response = await fetch(fileMap('sql-wasm.min.js'));\n const code = await response.text();\n // Instantiate the code and access its exports.\n const f = new Function('exports', code);\n const exports = {};\n f(exports);\n // Call the real initSqlJs().\n return exports.Module({ locateFile: fileMap });\n}\nexport class KernelSQL extends KernelBase {\n constructor(rootPath) {\n super(rootPath);\n this.execution_count = 0;\n this._sqlJsBase = \"https://cdnjs.cloudflare.com/ajax/libs/sql.js/1.5.0/\";\n // initial db file (used to restart SQLite)\n this._dbInit = undefined;\n // initial SQL strings (used to restart SQLite)\n this._sqlsInit = [];\n // dot commands\n this._dots = {\n '.backup': {\n 'callback': this._export.bind(this),\n 'help': \"Download as binary file\",\n },\n '.dump': {\n 'callback': this._dump.bind(this),\n 'help': \"Download as SQL file\",\n },\n '.export': {\n 'callback': this._export.bind(this),\n 'help': \"See .backup\",\n },\n '.help': {\n 'callback': this._help.bind(this),\n 'help': \"Show this help\",\n },\n '.save': {\n 'callback': this._export.bind(this),\n 'help': \"See .backup\",\n },\n '.schema': {\n 'callback': this._schema.bind(this),\n 'help': \"Show the CREATE statements\",\n },\n '.tables': {\n 'callback': this._tables.bind(this),\n 'help': \"List names of tables\",\n },\n };\n }\n ;\n language() { return \"sql\"; }\n ;\n languageName() { return \"SQL\"; }\n ;\n moduleExts() { return ['sql', 'db', 'sqlite']; }\n ;\n async launch() {\n this.SQL = await initSqlJs((file) => `${this._sqlJsBase}${file}`);\n this.restart();\n }\n ;\n /**\n * Troncate json table to 150 items.\n */\n static troncate_table(json) {\n const max_size = 150;\n if (json.values.length >= max_size) {\n const half_length = Math.floor(max_size / 3);\n const head = json.values.slice(0, half_length);\n const tail = json.values.slice(-half_length);\n json.values = head.concat([json.columns.map(() => '⋮ ')], tail);\n }\n }\n ;\n /**\n * HTML version of a table (useful in notebook).\n */\n static html_table(json) {\n this.troncate_table(json);\n const columns = json.columns.map((c) => `<th>${c}</th>`).join('');\n const head = `<thead><tr style=\"text-align: right;\">${columns}</tr></thead>`;\n const values = json.values.map((r) => '<tr>' + r.map((v) => `<td>${v}</td>`).join('') + '</tr>').join('');\n const body = `<tbody>${values}</tbody>`;\n return `<table class=\"dataframe\" border=\"1\">${head}${body}</table>`;\n }\n ;\n /**\n * Text version of a table.\n */\n static text_table(json) {\n KernelSQL.troncate_table(json);\n const head = json.columns.join('\\t');\n const values = json.values.map((r) => r.join('\\t')).join('\\n');\n return `${head}\\n${values}`;\n }\n ;\n /**\n * Format the result to fit Kernel API.\n */\n formatResult(output) {\n let result = undefined;\n if (output != null && output.length > 0)\n result = {\n 'text/plain': KernelSQL.text_table(output[0]),\n 'text/html': KernelSQL.html_table(output[0])\n };\n return result;\n }\n async evalAsync(code, outCallback, errCallback, data = null) {\n // force interactivity in all modes\n data.interactive = true;\n this.execution_count++;\n let result = undefined;\n const dotCommand = code.replace(/^[; \\t\\n]+|[; \\t\\n]+$/g, '');\n if (dotCommand in this._dots) {\n const callback = this._dots[dotCommand].callback;\n result = callback();\n }\n else\n result = this.formatResult(this.db.exec(code));\n return [result, this.execution_count];\n }\n ;\n ps1() { return \"sql> \"; }\n ;\n ps2() { return \"...> \"; }\n ;\n restart() {\n // warning: we should probably reload module files...\n if (this.db)\n this.db.close();\n this.execution_count = 0;\n // reloading .db file\n this.db = new this.SQL.Database(this._dbInit);\n // foreign keys are activated by default\n // see: https://www.sqlite.org/foreignkeys.html#fk_enable\n this.db.run(\"PRAGMA foreign_keys = ON;\");\n // reloading SQL modules files\n this._sqlsInit.forEach(c => { this.db.run(c); });\n }\n ;\n more(source) { return false; }\n ;\n complete(code) { return []; }\n ;\n putFile(filename, content) {\n // just ignoring this since we don't have a filesystem.\n }\n ;\n putModule(filename, content) {\n content = new Uint8Array(content);\n const ext = filename.split('.').pop();\n switch (ext) {\n case 'sql':\n let decoder = new TextDecoder(\"utf-8\");\n const _content = decoder.decode(content);\n this.db.run(_content);\n // SQL strings are concatenated\n this._sqlsInit.push(_content);\n break;\n case 'sqlite':\n case 'db':\n if (this.db)\n this.db.close();\n this.db = new this.SQL.Database(content);\n // initial db file is replaced\n this._dbInit = content;\n break;\n default:\n throw { message: \"Only '.sql', '.db' and '.sqlite' files supported.\" };\n }\n }\n /**\n * Display help.\n */\n _help() {\n const helpMessage = Object.keys(this._dots).map((key) => `${key}\\t\\t${this._dots[key].help}`).join(\"\\n\");\n return { \"text/plain\": helpMessage };\n }\n /**\n * Export (download) the database in binary format.\n */\n _export() {\n this.download(this.db.export(), \"database.db\");\n }\n /**\n * Return the SQL commands to build the DB in a string.\n */\n dump() {\n var _a, _b;\n // order is creation order (order=false)\n const tables = (_a = this.tables(false)[0]) === null || _a === void 0 ? void 0 : _a.values;\n const schema = (_b = this.schema(false)[0]) === null || _b === void 0 ? void 0 : _b.values;\n const inserts = tables.map((table) => {\n var _a;\n const values = (_a = this.db.exec(`SELECT * FROM ${table}`)[0]) === null || _a === void 0 ? void 0 : _a.values;\n const strValues = values.map((value) => `(${value.map(JSON.stringify).join(', ')})`);\n return `INSERT INTO ${table} VALUES ${strValues.join(',\\n')};`;\n });\n return `${schema.join(';\\n')};\\n${inserts.join('\\n')}`;\n }\n /**\n * Dump (download) the database in SQL format (dot command version).\n */\n _dump() {\n const encoder = new TextEncoder();\n const view = encoder.encode(this.dump());\n this.download(view, \"database.sql\");\n }\n /**\n * Return the DB schema.\n */\n schema(order = true) {\n const orderCMD = order ? \"ORDER BY tbl_name, type DESC, name\" : \"\";\n return this.db.exec(`SELECT sql FROM sqlite_schema ${orderCMD};`);\n }\n /**\n * Return the DB schema (dot command version).\n */\n _schema() {\n return this.formatResult(this.schema());\n }\n /**\n * Return the table of tables.\n */\n tables(order = true) {\n const orderCMD = order ? \"ORDER BY 1\" : \"\";\n return this.db.exec(`SELECT name FROM sqlite_schema\nWHERE type IN ('table','view') AND name NOT LIKE 'sqlite_%'\n${orderCMD};`);\n }\n /**\n * Return the table of tables (dot command version).\n */\n _tables() {\n return this.formatResult(this.tables());\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\n return self;\n}","export default function _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : 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\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\n return assertThisInitialized(self);\n}","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}","export default function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, _typeof(obj);\n}"],"names":["_isNativeReflectConstruct","Reflect","construct","sham","Proxy","Boolean","prototype","valueOf","call","e","_construct","Parent","args","Class","a","push","apply","instance","Function","bind","setPrototypeOf","arguments","_wrapNativeSuper","_cache","Map","undefined","fn","toString","indexOf","TypeError","has","get","set","Wrapper","getPrototypeOf","this","constructor","Object","create","value","enumerable","writable","configurable","NotImplementedError","funcName","name","Error","BasthonEvent","id","data","detail","Event","KernelBase","rootPath","_ready","_loaded","PromiseDelegate","execution_count","_rootPath","code","outCallback","errCallback","filename","content","path","source","languageName","launch","reject","addEventListener","evalFromEvent","resolve","promise","absolute","url","version","startsWith","base","window","location","origin","pathname","substring","lastIndexOf","blob","Blob","type","anchor","document","createElement","download","href","URL","createObjectURL","target","style","display","body","appendChild","click","removeChild","eventName","dispatchEvent","callback","event","obj","JSON","parse","stringify","_a","ext","split","pop","moduleExts","includes","putModule","putFile","stdCallback","std","text","dataEvent","clone","stream","evalAsync","error","result","executionCount","Promise","script","onload","onerror","src","head","params","xhr","XMLHttpRequest","open","method","responseType","status","response","headers","keys","forEach","key","setRequestHeader","send","initSqlJs","fileMap","fetch","f","exports","Module","locateFile","KernelSQL","_sqlJsBase","_dbInit","_sqlsInit","_dots","_export","_dump","_help","_schema","_tables","file","SQL","restart","output","length","text_table","html_table","interactive","dotCommand","replace","formatResult","db","exec","close","Database","run","c","Uint8Array","_content","TextDecoder","decode","message","map","help","join","_b","tables","values","schema","inserts","table","strValues","view","TextEncoder","encode","dump","order","orderCMD","json","half_length","Math","floor","max_size","slice","tail","concat","columns","troncate_table","r","v","_assertThisInitialized","self","ReferenceError","_getPrototypeOf","o","__proto__","_inherits","subClass","superClass","defineProperty","_possibleConstructorReturn","_setPrototypeOf","p","_typeof","Symbol","iterator"],"sourceRoot":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@basthon/browser-bundle",
3
- "version": "0.40.8",
3
+ "version": "0.40.9",
4
4
  "description": "Basthon - Browser bundle",
5
5
  "homepage": "https://basthon.fr",
6
6
  "bugs": {
@@ -21,7 +21,7 @@
21
21
  "lib"
22
22
  ],
23
23
  "dependencies": {
24
- "@basthon/kernel-loader": "^0.40.8"
24
+ "@basthon/kernel-loader": "^0.40.9"
25
25
  },
26
26
  "devDependencies": {
27
27
  "@babel/core": "^7.16.4",
@@ -49,5 +49,5 @@
49
49
  "build:prod": "webpack --config webpack.prod.config.js",
50
50
  "clean": "rm -rf lib/"
51
51
  },
52
- "gitHead": "6bcfcc37743982cd7ed31d94d35ec2df2588ac0b"
52
+ "gitHead": "ad86873a88ccb7b78511de3798bd9a87027de9d7"
53
53
  }