compressed-script-loader 1.4.20 → 1.4.29
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.
- package/README.md +18 -3
- package/bin/cslpack.js +1 -2
- package/index.d.ts +1 -1
- package/package.json +3 -3
- package/umd/index.js +1 -2
- package/webpack/index.js +1 -2
- package/webpack-esm/index.mjs +1 -2
package/README.md
CHANGED
|
@@ -13,8 +13,14 @@ Reduces network traffic for huge source files built by webpack etc.
|
|
|
13
13
|
|
|
14
14
|
## ✨ Motivation
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
Modern web servers often support compression via `content-encoding`.
|
|
17
|
+
However, on servers that do not handle compression transfer, this module can significantly reduce network traffic.
|
|
18
|
+
|
|
19
|
+
## 🔥 Installation
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npm install compressed-script-loader
|
|
23
|
+
```
|
|
18
24
|
|
|
19
25
|
## 📇 Details
|
|
20
26
|
|
|
@@ -22,7 +28,7 @@ but for some servers that do not perform compression transfer, this module can b
|
|
|
22
28
|
|
|
23
29
|
+ **comment** is used to embed [**SRI**][2]. (`script.integrity`)
|
|
24
30
|
If comment is omitted or does not pass to verify process that it is [**SRI**][2],
|
|
25
|
-
the
|
|
31
|
+
the unzipped code will be bound to the `text` property of `script` element.
|
|
26
32
|
You can use `sha256`, `sha384`, and `sha512` in `script.integrity`, and the prefix `sha###-` is omit able because the hash method is automatically detected by the length of the [**SRI**][2].
|
|
27
33
|
+ [SRI online tool](https://www.srihash.org/)
|
|
28
34
|
|
|
@@ -72,6 +78,15 @@ You can use `sha256`, `sha384`, and `sha512` in `script.integrity`, and the pref
|
|
|
72
78
|
2. At a minimum, `compilerOptions.baseUrl` and `compilerOptions.paths` are required.
|
|
73
79
|
3. No matter where "tsconfig.json" is located, if `compilerOptions.baseUrl` is set correctly, there will be no error! (Probably...)
|
|
74
80
|
|
|
81
|
+
- stage 3 (v1.4.28)
|
|
82
|
+
* **Major Leap in Module ID Detection** (commit `ce3c25f`):
|
|
83
|
+
The module ID detection logic has been overhauled with a comprehensive, typed regex (powered by `js-dev-tool/regex`).
|
|
84
|
+
It now robustly handles:
|
|
85
|
+
- **Comments**: Correctly ignores imports within single-line (`//`) and multi-line (`/* ... */`) comments.
|
|
86
|
+
- **Dynamic Imports**: Supports `import("...")` and `import('...')` syntax.
|
|
87
|
+
- **Complex Patterns**: Utilizes named capture groups for precise extraction of global, dynamic, and ESM module IDs.
|
|
88
|
+
This update resolves previous limitations and ensures accurate dependency mapping for `importmap` generation.
|
|
89
|
+
|
|
75
90
|
## 🦯 Use for SPA
|
|
76
91
|
|
|
77
92
|
> #### Load automatically
|
package/bin/cslpack.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/*! For license information please see cslpack.js.LICENSE.txt */
|
|
3
|
-
(()=>{var
|
|
4
|
-
modIdDetails:[]}),h=(e,t)=>{const s=a(),o=e.code;let r;for(;r=s.exec(o);){const s=r[1],o=r[0];if(e.modIdDetails.push({moduleId:s,statement:o,referrer:e.canonicalPath}),!p.has(s)){const o=i.c.resolve(e.canonicalPath,s,l);if(!o)throw new i.U(`moduleId: "${s}" cannot be resolved, stop processing`);p.set(s,o),t[o]?l(`source: "${o}" is already scanned`,"info"):h(t[o]=d(o),t)}}};const f=()=>{if(i.c.foundConfig)return{extras:{comment:"module resolve from tsconfig.json",config:i.c.virtualPaths}}},g=new r.TextEncoder;let m="./dist/bundle.zip",v=t();console.log(v);let b=v.args;b||(console.log(`\n> ERROR: the file to pack is required\n\n$ cslpack [-(d|dest) <output zip path>] [-sha <256|384|512>] [-m <main jsname>] <jspath> <jspath>...\n\n -(d|dest): zip output path. when omited will be output to ${m}\n -sha : [256|384|512] when omited use 384 "sha384"\n -m : When packing the esm module, specify the script name that will be the entry point.\n The "importmap" is automatically generated and packed together.\n\n NOTE: \`cslpack\` doesn't keep directory path\n`),process.exit(1));const w=new class{prefetchSources={};list={};cslImportMap;constructor(e){this.setModuleMain(e)}setModuleMain(e){"string"==typeof e&&e.length?this.cslImportMap={main:e,map:{imports:{}},version:1}:this.cslImportMap=void 0,u()}add(e){const t=((e,t)=>{const o=s.resolve(e).toUnixPath();if(!t[o])return t[o]=d(o);l(`source: "${o}" is already scanned`,"info")})(e,this.prefetchSources);t&&this.cslImportMap&&h(t,this.prefetchSources)}async emit(t,r){const i=this.prefetchSources;(e=>{const t=function(e){if(0===e.length)return"";e.sort();let t=e[0],s=e[e.length-1],o=0;for(;o<t.length&&t[o]===s[o];)o++;return t.substring(0,o-1)}(Object.values(e).map((e=>e.canonicalPath)));if(!t)throw new ReferenceError("No common parts detected among the paths.");const s=/\\|\//.exec(t)||["/"],o=t.lastIndexOf(s[0])+1;0!==o&&Object.values(e).forEach((e=>{e.homogenized=e.canonicalPath.substring(o)}))})(i),(t=>{const s=f(),o=JSON.stringify({...t,...s},((e,t)=>"code"===e?"...":t),2);e.writeFile("./cslpack-info.json",o,"binary",(()=>{console.log()}))})(i);let l=this.list,u=this.cslImportMap;await((e,t,o,r)=>{const i=a(),_=o?.map.imports,l=[];return/256|384|512/.test(r)||(r="384"),Object.values(e).forEach((a=>{let u=a.code;_&&(i.lastIndex=0,u=u.replace(i,((t,s)=>{const o=p.get(s);if(!o)throw new Error("process homogenizeModuleIds failed!");const r=e[o].homogenized;return _[r]="",t.replace(s,r)}))),s.parse(a.canonicalPath).base===o?.main&&(o.main=a.homogenized);const d=`[hash(sha${r})::${a.homogenized}]`;console.time(d),l.push(new Promise((e=>{t[a.homogenized]=[c.encode(u),{level:7,comment:n.createHash(`sha${r}`).update(u).digest("base64")}],console.timeEnd(d),e()})))})),Promise.all(l)})(i,l,u,r),u&&(l["$importmap.dat"]=[g.encode(JSON.stringify(u,null,2)),{level:7}]);const d=`[fflate.zip:${t}]`;console.time(d),o.zip(l,((o,r)=>{if(console.timeEnd(d),o)throw o;(t=>{const o=s.dirname(t);e.existsSync(o)||e.mkdirSync(o,{recursive:!0})})(t),e.writeFile(t,r,"binary",(()=>{_(u),this.reset()}))}))}reset(){this.list={},this.prefetchSources={},this.cslImportMap=void 0,u(!0)}}(v.m);let x=v.sha;/256|384|512/.test(x)||(x="384");for(const t of b){e.statSync(t).isFile()&&w.add(t)}w.emit(v.d||v.dest||m,x).then((()=>{console.log("cslpack done!")}))})(),module.exports=_we_})();
|
|
3
|
+
(()=>{var __webpack_modules__=[,,e=>{"use strict";e.exports=require("fs")},,e=>{"use strict";e.exports=require("path")},,,,module=>{const boolMap={true:!0,false:!1},parseValue=v=>{const bool=boolMap[v];if(void 0!==bool)return bool;if(/^\[.+\]$/.test(v)||/^(?:re|r)?\/[^]+\/[dgimsuy]{0,7}$/.test(v))return/^(?:re|r)\//.test(v)&&(v=v.slice(v.indexOf("/"))),eval(v);if(/\\,/.test(v))return v.replace(/\\,/g,",");if(/,/.test(v))return v.split(",");{const e=+v;return Number.isFinite(e)?e:v}},tinArgs=(e,t=!1)=>{const o=process.argv;t&&console.log("process.argv: ",o);const s=(e=e||{}).prefix||"-",r=s.length,n=e.startIndex||2,i={};if(o.length>n)for(let e=n,t=o.length;e<t;){const t=o[e++];if(t)if(t.startsWith(s)){const n=t.slice(r),[,a=n,c]=/^([^:=]+)(?:[:=](.+))?$/.exec(n)||[];let l;c?l=parseValue(c):(l=o[e],void 0===l||l.startsWith(s)?l=!0:(l=parseValue(l),e++)),i[a]=l}else(i.args||(i.args=[])).push(t)}return i};tinArgs.version="v0.1.1",module.exports=tinArgs},,,(__unused_webpack___webpack_module__,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{n:()=>ModuleCouldNotResolveError,t:()=>ModuleResolver});var fs__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(2),path__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(4);class ModuleCouldNotResolveError extends Error{}function caseTsConfig(startDir,map){let tsconfig,prevDir,found=!1;do{if(tsconfig=path__WEBPACK_IMPORTED_MODULE_1__.resolve(startDir,"tsconfig.json"),fs__WEBPACK_IMPORTED_MODULE_0__.existsSync(tsconfig)){console.log("okay, tsconfig.json found!"),found=!0;break}prevDir=startDir,startDir=path__WEBPACK_IMPORTED_MODULE_1__.parse(startDir).dir}while(startDir!==prevDir);if(!found)return void console.log("huh, tsconfig.json not found!");const src=fs__WEBPACK_IMPORTED_MODULE_0__.readFileSync(tsconfig,"utf8"),cfg=eval("("+src+")"),co=cfg.compilerOptions;let pathskeys;return co.paths&&(pathskeys=Object.keys(co.paths)).length?(pathskeys.forEach(e=>{const t=[];map[e]=t;const o=co.paths[e];for(let e=0;e<o.length;){const s=path__WEBPACK_IMPORTED_MODULE_1__.resolve(startDir,co.baseUrl,o[e++]).toUnixPath();t.push(s)}}),console.log(map),!0):void 0}function resolveFromTsConfigPaths(e,t){const o=e=>{const t=e.length-1;return"*"===e[t]&&(e=e.slice(0,t)),e};for(let[s,r]of Object.entries(t))if(s=o(s),e.startsWith(s))for(let t of r){t=o(t);const r=e.replace(s,t);if(fs__WEBPACK_IMPORTED_MODULE_0__.existsSync(r))return r.toUnixPath()}return""}const ModuleResolver={foundConfig:!1,virtualPaths:{},resolve(e,t,o){const s=path__WEBPACK_IMPORTED_MODULE_1__.parse(e),r=path__WEBPACK_IMPORTED_MODULE_1__.resolve(s.dir,t).toUnixPath();if(fs__WEBPACK_IMPORTED_MODULE_0__.existsSync(r))return r;if(!this.foundConfig){if(!caseTsConfig(s.dir,this.virtualPaths))throw new ModuleCouldNotResolveError("Sorry, this situation currently not supported.");this.foundConfig=!0}const n=resolveFromTsConfigPaths(t,this.virtualPaths);return o(`ModuleResolver::resolve->resolveFromTsConfigPaths: [${n}]`,"lightwarn"),n}}}],__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var o=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e](o,o.exports,__webpack_require__),o.exports}__webpack_require__.d=(e,t)=>{for(var o in t)__webpack_require__.o(t,o)&&!__webpack_require__.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var __webpack_exports__={};(()=>{"use strict";var e=__webpack_require__(2),t=__webpack_require__(8),o=__webpack_require__(4);const s=require("fflate"),r=require("util"),n=require("crypto");require("colors");var i=__webpack_require__(11);String.prototype.toUnixPath="\\"===o.sep?function(){return this.replace(/\\/g,"/")}:function(){return this};class a extends Error{}function c(){return new RegExp("(?:(?:^\\s*?\\/\\*+?[\\s\\S]*?\\*\\/)|(?<!\\s*\\/\\/+.*?)(?:(?<!@)import|export)\\s*(?:(?<qcGlobal>[\"'])(?!https?:)(?=(?:\\.\\.?\\/)+)(?:(?<globalName>(?:(?:\\.\\.?\\/)+)?[^'\"]+?)(?:\\.(?<globalExt>(?:c|m)?jsx?))?)\\k<qcGlobal>|\\(\\s*(?<qcDynamic>[\"'])(?!https?:)(?=(?:\\.\\.?\\/)+)(?<dynamicName>(?:(?:\\.\\.?\\/)+)?[^'\"]+?)(?:\\.(?<dynamicExt>(?:c|m)?jsx?))?\\k<qcDynamic>\\s*\\)|(?:(?<clause>.+?|(?:\\w+\\s*,)?\\s*\\{[^}]+})\\s*from)\\s*(?<qcEsm>[\"'])(?!https?:)(?=(?:\\.\\.?\\/)+)(?:(?<moduleName>(?:(?:\\.\\.?\\/)+)?[^'\"]+?)(?:\\.(?<moduleExt>(?:c|m)?jsx?))?)\\k<qcEsm>)(?=\\s*;)?)","gm")}const l=new TextEncoder,_=process.env.CI?()=>{}:console.log.bind(console,"[cslpack]:".blue),p={info:"gray",warn:"cyan",lightwarn:"green"},u=(e,t)=>{_(e[p[t]])},d=new Map,h=e=>{e&&_(d),d.clear()},f=t=>(_(`createCSLPackEntry actualPath:[${t}]`),{canonicalPath:t,homogenized:"",code:e.readFileSync(t,"utf8"),modIdDetails:[]}),m=e=>{const{globalName:t,globalExt:o,dynamicName:s,dynamicExt:r,moduleName:n,moduleExt:i}=e;return t?`${t}.${o}`:s?`${s}.${r}`:n?`${n}.${i}`:null},g=(e,t)=>{const o=c(),s=e.code;let r;for(;r=o.exec(s);){const o=r[0];if(/\s*?\/\*/.test(o))continue;const s=m(r.groups||{});if(!s)throw new a("Sorry, failed to detect module id");if(e.modIdDetails.push({moduleId:s,statement:o,referrer:e.canonicalPath}),!d.has(s)){const o=i.t.resolve(e.canonicalPath,s,u);if(!o)throw new i.n(`moduleId: "${s}" cannot be resolved, stop processing`);d.set(s,o),t[o]?u(`source: "${o}" is already scanned`,"info"):g(t[o]=f(o),t)}}},v=new r.TextEncoder;let E="./dist/bundle.zip",b=t();console.log(b);let w=b.args;w||(console.log(`\n> ERROR: the file to pack is required\n\n$ cslpack [-(d|dest) <output zip path>] [-sha <256|384|512>] [-m <main jsname>] <jspath> <jspath>...\n\n -(d|dest): zip output path. when omited will be output to ${E}\n -sha : [256|384|512] when omited use 384 "sha384"\n -m : When packing the esm module, specify the script name that will be the entry point.\n The "importmap" is automatically generated and packed together.\n\n NOTE: \`cslpack\` doesn't keep directory path\n`),process.exit(1));const x=new class{prefetchSources={};list={};cslImportMap;constructor(e){this.setModuleMain(e)}setModuleMain(e){"string"==typeof e&&e.length?this.cslImportMap={main:e,map:{imports:{}},version:1}:this.cslImportMap=void 0,h()}add(e){const t=((e,t)=>{const s=o.resolve(e).toUnixPath();if(!t[s])return t[s]=f(s);u(`source: "${s}" is already scanned`,"info")})(e,this.prefetchSources);t&&this.cslImportMap&&g(t,this.prefetchSources)}async emit(t,r){const p=this.prefetchSources;(e=>{const t=function(e){if(0===e.length)return"";e.sort();let t=e[0],o=e[e.length-1],s=0;for(;s<t.length&&t[s]===o[s];)s++;return t.slice(0,s-1)}(Object.values(e).map(e=>e.canonicalPath));if(!t)throw new ReferenceError("No common parts detected among the paths.");const o=/\\|\//.exec(t)||["/"],s=t.lastIndexOf(o[0])+1;0!==s&&Object.values(e).forEach(e=>{e.homogenized=e.canonicalPath.slice(s)})})(p),(t=>{const o=(()=>{if(i.t.foundConfig)return{extras:{comment:"module resolve from tsconfig.json",config:i.t.virtualPaths}}})(),s=JSON.stringify({...t,...o},(e,t)=>"code"===e?"...":t,2);e.writeFile("./cslpack-info.json",s,"binary",()=>{console.log()})})(p);let u=this.list,h=this.cslImportMap;await((e,t,s,r)=>{const i=c(),_=s?.map.imports,p=[],u=(t,o,s,r,n,i,c,l,p,u,h,f,g,v)=>{if(/\s*?\/\*/.test(t))return t;const E=m(v||{});if(!E)throw new a("Sorry, failed to detect module id");const b=d.get(E);if(!b)throw new Error("process homogenizeModuleIds failed!");const w=e[b].homogenized;return _[w]="",t.replace(E,w)};return/256|384|512/.test(r)||(r="384"),Object.values(e).forEach(e=>{let a=e.code;_&&(i.lastIndex=0,a=a.replace(i,u)),o.parse(e.canonicalPath).base===s?.main&&(s.main=e.homogenized);const c=`[hash(sha${r})::${e.homogenized}]`;console.time(c),p.push(new Promise(o=>{t[e.homogenized]=[l.encode(a),{level:7,comment:n.createHash(`sha${r}`).update(a).digest("base64")}],console.timeEnd(c),o()}))}),Promise.all(p)})(p,u,h,r),h&&(u["$importmap.dat"]=[v.encode(JSON.stringify(h,null,2)),{level:7}]);const f=`[fflate.zip:${t}]`;console.time(f),s.zip(u,(s,r)=>{if(console.timeEnd(f),s)throw s;(t=>{const s=o.dirname(t);e.existsSync(s)||e.mkdirSync(s,{recursive:!0})})(t),e.writeFile(t,r,"binary",()=>{_(h),this.reset()})})}reset(){this.list={},this.prefetchSources={},this.cslImportMap=void 0,h(!0)}}(b.m);let P=b.sha;/256|384|512/.test(P)||(P="384");for(const t of w)e.statSync(t).isFile()&&x.add(t);x.emit(b.d||b.dest||E,P).then(()=>{console.log("cslpack done!")})})(),module.exports=__webpack_exports__})();
|
package/index.d.ts
CHANGED
|
@@ -34,7 +34,7 @@ declare let setConfig: (base: string, insertionSelector?: string) => void;
|
|
|
34
34
|
* @param {(msg: string) => void} [log] default: `console.log`
|
|
35
35
|
*/
|
|
36
36
|
declare let loadCompressedScript: (baseName: string, log?: (msg: string) => void) => Promise<void>;
|
|
37
|
-
declare const version = "v1.4.
|
|
37
|
+
declare const version = "v1.4.29";
|
|
38
38
|
/**
|
|
39
39
|
* `importmap` zip entry name
|
|
40
40
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "compressed-script-loader",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.29",
|
|
4
4
|
"description": "Reduces network traffic for huge source files built by webpack etc.",
|
|
5
5
|
"private": false,
|
|
6
6
|
"browser": "./umd/index.js",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"dhtml"
|
|
47
47
|
],
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"
|
|
50
|
-
"
|
|
49
|
+
"colors": "^1.4.0",
|
|
50
|
+
"fflate": "^0.8.2"
|
|
51
51
|
}
|
|
52
52
|
}
|
package/umd/index.js
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
/*! For license information please see index.js.LICENSE.txt */
|
|
2
|
-
(
|
|
3
|
-
t+=n(55296|r>>10,56320|1023&r)):t+=n(1&l?(31&r)<<6|63&e[o++]:(15&r)<<12|(63&e[o++])<<6|63&e[o++]):t+=n(r)}};function R(e,t){if(t){let t="";for(let o=0;o<e.length;o+=16384)t+=n.apply(null,e.subarray(o,o+16384));return t}if(L)return L.decode(e);{const[t,n]=_(e);return n.length&&T(8),t}}let B,D,J=console.log,q=document,F=Object.keys,I=new TextDecoder,Y=function(e,t){const n={};let r=e.length-22;for(;101010256!=A(e,r);--r)(!r||e.length-r>65558)&&T(13);let l=C(e,r+8);if(!l)return{};let i=A(e,r+16);const a=4294967295===i;a&&(r=A(e,r-12),101075792!=A(e,r)&&T(13),l=A(e,r+32),i=A(e,r+48));const s=t&&t.filter;for(let t=0;t<l;++t){const[t,r,l,c,d,f,u]=P(e,i,a),p=z(e,f);if(i=d,!s||s({name:c,size:r,originalSize:l,compression:t,comment:u})){let i;t?8===t?i=j(e.subarray(p,p+r),new o(l)):T(14,"unknown compression type "+t):i=$(e,p,p+r),i&&(n[c]={data:i,comment:u})}}return n},G=()=>{I=void 0,V=Q=X=G=void 0,B=D=void 0,W=K=H=Y=void 0},H=e=>{let t=/^(?:sha\d{3}-)?([a-z0-9+/=]{44,88})$/i.exec(e);if(t){let n=(e=t[1]).length;if(!(88^n&&64^n&&44^n))return`sha${64==n?384:88==n?512:256}-${e}`}},K=(e,t="text/javascript")=>URL.createObjectURL(new Blob([e],{type:t})),Q=(e,t)=>{B=e,D=t||""},V=(e,t,n=(()=>{}),o={})=>{let r=()=>{n(),J(`script ${t} is ready`)},l=D?q.querySelector(D).nextElementSibling:void 0,i=q.head[l?"insertBefore":"appendChild"](q.createElement("script"),l);i.id=t,o.type&&(i.type=o.type);let a=o.integrity;a?(i.integrity=a,i.crossOrigin="",i.onload=r,i.src=o.url||K(e)):(i.text=e,r())},W=e=>{let t,n=F(e);if(n.includes(te)){n=n.filter((e=>e!==te));let o,r=I.decode(e[te].data),l=JSON.parse(r),i=l.map.imports,a=[],s=new Map;const c=F(i);for(let t=0;t<c.length;){const n=c[t++];let r=s.get(n);r||s.set(n,r=K(I.decode(e[n].data))),i[n]=r,n!==l.main||o||(o=r),!a.includes(n)&&a.push(n)}V(JSON.stringify(l.map,null,2),te,void 0,{type:"importmap"}),n=n.filter((e=>!a.includes(e))),t={entryMain:o,imdata:l}}return[n,t]},X=async(e,t=J)=>{let n=e+".zip",o=await fetch(`${B||"."}/${n}`).then((async e=>{let n=!!e.headers.get("content-encoding"),o=e.body.getReader(),r=(l=+e.headers.get("content-length"),n?l<<1|0:l);var l;let i=new Uint8Array(r),a=0;for(;;){let{done:e,value:n}=await o.read();if(e)break;i.set(n,a),a+=n.length,t(`loading zip: ${a.toLocaleString()} bytes(${a/r*100|0}%)`)}return n?i.slice(0,a):i})).catch((e=>{console.error(e)}));if(o&&o.length){t(`loaded ${n}, decompressing binary...`);let e=`unzip: ${n}`;console.time(e);let r=Y(o);return console.timeEnd(e),t(`${n} decompressed 😃`),new Promise((e=>{let[t,{entryMain:n,imdata:o}={}]=W(r),l=t.length,i=o?.main,a=()=>{! --l&&e()};for(let e,o=0;e=t[o++];){let t=r[e],o=e===i;V(I.decode(t.data),e,a,{integrity:H(t.comment),url:o?n:void 0,type:o?"module":void 0})}}))}throw new Error(`Could not load "${n}"`)},Z=async()=>{Z=void 0;let e=q.querySelector("script[data-csl-config]");if(e){let t=e.dataset.cslConfig;if(t){t=JSON.parse(t);let e=t.load?(Q(t.base,t.selector),Array.isArray(t.load)?t.load:[t.load]):Array.isArray(t)?t:"string"==typeof t?[t]:[],n=[];for(let t of e)n.push(X(t).catch((e=>e)));let o=(await Promise.all(n)).filter((e=>e&&e.name));setTimeout((()=>{let e="function"==typeof cslCallback?cslCallback:window[t.callback||"cslCallback"];"function"==typeof e&&e(o.length?o:void 0)}),60),t.cleanup&&G()}}};setTimeout(Z,99);const ee="v1.4.20",te="$importmap.dat";return t})()));
|
|
2
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.NsLoader=t():e.NsLoader=t()}(globalThis,()=>(()=>{"use strict";var e=[,(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.unzipSync=function(e,t){const n={};let o=e.length-22;for(;101010256!=_(e,o);--o)(!o||e.length-o>65558)&&C(13);let l=U(e,o+8);if(!l)return{};let i=_(e,o+16);const a=4294967295===i;a&&(o=_(e,o-12),101075792!=_(e,o)&&C(13),l=_(e,o+32),i=_(e,o+48));const s=t&&t.filter;for(let t=0;t<l;++t){const[t,o,l,c,f,d,u]=j(e,i,a),p=T(e,d);if(i=f,!s||s({name:c,size:o,originalSize:l,compression:t,comment:u})){let i;t?8===t?i=M(e.subarray(p,p+o),new r(l)):C(14,"unknown compression type "+t):i=$(e,p,p+o),i&&(n[c]={data:i,comment:u})}}return n};const n=String.fromCharCode,r=Uint8Array,o=Uint16Array,l=Uint32Array,i=new r([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),a=new r([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),s=new r([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),c=(e,t)=>{const n=new o(31);for(let r=0;r<31;++r)n[r]=t+=1<<e[r-1];const r=new l(n[30]);for(let e=1;e<30;++e)for(let t=n[e];t<n[e+1];++t)r[t]=t-n[e]<<5|e;return[n,r]},[f,d]=c(i,2);f[28]=258,d[258]=28;const[u,p]=c(a,0),y=new o(32768);for(let e=0;e<32768;++e){let t=(43690&e)>>>1|(21845&e)<<1;t=(52428&t)>>>2|(13107&t)<<2,t=(61680&t)>>>4|(3855&t)<<4,y[e]=((65280&t)>>>8|(255&t)<<8)>>>1}const g=(e,t,n)=>{const r=e.length;let l=0;const i=new o(t);for(;l<r;++l)e[l]&&++i[e[l]-1];const a=new o(t);for(l=0;l<t;++l)a[l]=a[l-1]+i[l-1]<<1;let s;if(n){s=new o(1<<t);const n=15-t;for(l=0;l<r;++l)if(e[l]){const r=l<<4|e[l],o=t-e[l];let i=a[e[l]-1]++<<o;for(const e=i|(1<<o)-1;i<=e;++i)s[y[i]>>>n]=r}}else for(s=new o(r),l=0;l<r;++l)e[l]&&(s[l]=y[a[e[l]-1]++]>>>15-e[l]);return s},m=new r(288),h=new r(32);{let e=0;for(;e<144;)m[e++]=8;for(;e<256;)m[e++]=9;for(;e<280;)m[e++]=7;for(;e<288;)m[e++]=8;for(e=0;e<32;)h[e++]=5}const w=g(m,9,1),b=g(h,5,1),v=e=>{let t=e[0];for(let n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},S=(e,t,n)=>{const r=t/8|0;return(e[r]|e[r+1]<<8)>>(7&t)&n},x=(e,t)=>{const n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(7&t)},k=e=>(e+7)/8|0,E=[,r,o,,l],$=(e,t,n)=>{(!t||t<0)&&(t=0),(!n||n>e.length)&&(n=e.length);const r=new E[e.BYTES_PER_ELEMENT](n-t);return r.set(e.subarray(t,n)),r},z=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"];let A=Error.captureStackTrace;const C=(e,t,n)=>{const r=new Error(t||z[e]);if(r.code=e,A&&A(r,C),!n)throw r;return r},M=(e,t,n)=>{const o=e.length;if(!o||n&&n.f&&!n.l)return t||new r(0);const l=!t||!!n,c=!n||n.i;!n&&(n={}),!t&&(t=new r(3*o));const d=e=>{let n=t.length;if(e>n){const o=new r(Math.max(2*n,e));o.set(t),t=o}};let p=n.f||0,y=n.p||0,m=n.b||0,h=n.l,E=n.d,z=n.m,A=n.n;const M=8*o;do{if(!h){p=S(e,y,1);const i=S(e,y+1,3);if(y+=3,!i){const r=k(y)+4,i=e[r-4]|e[r-3]<<8,a=r+i;if(a>o){c&&C(0);break}l&&d(m+i),t.set(e.subarray(r,a),m),n.b=m+=i,n.p=y=8*a,n.f=p;continue}if(1===i)h=w,E=b,z=9,A=5;else if(2===i){const t=S(e,y,31)+257,n=S(e,y+10,15)+4,o=t+S(e,y+5,31)+1;y+=14;const l=new r(o),i=new r(19);for(let t=0;t<n;++t)i[s[t]]=S(e,y+3*t,7);y+=3*n;const a=v(i),c=(1<<a)-1,f=g(i,a,1);for(let t=0;t<o;){const n=f[S(e,y,c)];y+=15&n;const r=n>>>4;if(r<16)l[t++]=r;else{let n=0,o=0;for(16===r?(o=3+S(e,y,3),y+=2,n=l[t-1]):17===r?(o=3+S(e,y,7),y+=3):18===r&&(o=11+S(e,y,127),y+=7);o--;)l[t++]=n}}const d=l.subarray(0,t),u=l.subarray(t);z=v(d),A=v(u),h=g(d,z,1),E=g(u,A,1)}else C(1);if(y>M){c&&C(0);break}}l&&d(m+131072);const $=(1<<z)-1,U=(1<<A)-1;let _=y;for(;;_=y){const n=h[x(e,y)&$],r=n>>>4;if(y+=15&n,y>M){c&&C(0);break}if(n||C(2),r<256)t[m++]=r;else{if(256===r){_=y,h=void 0;break}{let n=r-254;if(r>264){const t=r-257,o=i[t];n=S(e,y,(1<<o)-1)+f[t],y+=o}const o=E[x(e,y)&U],s=o>>>4;o||C(3),y+=15&o;let p=u[s];if(s>3){const t=a[s];p+=x(e,y)&(1<<t)-1,y+=t}if(y>M){c&&C(0);break}l&&d(m+131072);const g=m+n;for(;m<g;m+=4)t[m]=t[m-p],t[m+1]=t[m+1-p],t[m+2]=t[m+2-p],t[m+3]=t[m+3-p];m=g}}}n.l=h,n.p=_,n.b=m,n.f=p,h&&(p=1,n.m=z,n.d=E,n.n=A)}while(!p);return m===t.length?t:$(t,0,m)},U=(e,t)=>e[t]|e[t+1]<<8,_=(e,t)=>(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0,O=(e,t)=>_(e,t)+4294967296*_(e,t+4),T=(e,t)=>t+30+U(e,t+26)+U(e,t+28),j=(e,t,n)=>{const r=!(2048&U(e,t+8)),o=U(e,t+28),l=I(e.subarray(t+46,t+46+o),r),i=t+46+o,a=_(e,t+20),[s,c,f]=n&&4294967295===a?P(e,i):[a,_(e,t+24),_(e,t+42)],d=i+U(e,t+30);return[U(e,t+10),s,c,l,i+U(e,t+30)+U(e,t+32),f,I(e.subarray(d,d+U(e,t+32)),r)]},P=(e,t)=>{for(;1!=U(e,t);t+=4+U(e,t+2));return[O(e,t+12),O(e,t+4),O(e,t+20)]};let L;const N=new r(0);try{const e=new TextDecoder;e.decode(N,{stream:!0}),L=e}catch{}const D=e=>{for(let t="",r=0;;){let o=e[r++];const l=+(o>127)+ +(o>223)+ +(o>239);if(r+l>e.length)return[t,$(e,r-1)];l?3===l?(o=((15&o)<<18|(63&e[r++])<<12|(63&e[r++])<<6|63&e[r++])-65536,t+=n(55296|o>>10,56320|1023&o)):t+=n(1&l?(31&o)<<6|63&e[r++]:(15&o)<<12|(63&e[r++])<<6|63&e[r++]):t+=n(o)}};function I(e,t){if(t){let t="";for(let r=0;r<e.length;r+=16384)t+=n.apply(null,e.subarray(r,r+16384));return t}if(L)return L.decode(e);{const[t,n]=D(e);return n.length&&C(8),t}}}],t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var l=t[r]={exports:{}};return e[r](l,l.exports,n),l.exports}var r={};return(()=>{var e=r;Object.defineProperty(e,"__esModule",{value:!0}),e.IM_MAP_ID=e.version=e.unzipSync=e.cleanUp=e.loadCompressedScript=e.setConfig=void 0;const t=n(1);let o,l,i=console.log,a=document,s=Object.keys,c=new TextDecoder,f=t.unzipSync;e.unzipSync=f;let d=()=>{c=void 0,g=y=h=d=void 0,o=l=void 0,m=p=u=f=void 0};e.cleanUp=d;let u=e=>{let t=/^(?:sha\d{3}-)?([a-z0-9+/=]{44,88})$/i.exec(e);if(t){let n=(e=t[1]).length;if(!(88^n&&64^n&&44^n))return`sha${64==n?384:88==n?512:256}-${e}`}},p=(e,t="text/javascript")=>URL.createObjectURL(new Blob([e],{type:t})),y=(e,t)=>{o=e,l=t||""};e.setConfig=y;let g=(e,t,n=()=>{},r={})=>{let o=()=>{n(),i(`script ${t} is ready`)},s=l?a.querySelector(l).nextElementSibling:void 0,c=a.head[s?"insertBefore":"appendChild"](a.createElement("script"),s);c.id=t,r.type&&(c.type=r.type);let f=r.integrity;f?(c.integrity=f,c.crossOrigin="",c.onload=o,c.src=r.url||p(e)):(c.text=e,o())},m=e=>{let t,n=s(e);if(n.includes(b)){n=n.filter(e=>e!==b);let r,o=c.decode(e[b].data),l=JSON.parse(o),i=l.map.imports,a=new Set,f=new Map;const d=s(i);for(let t,n=0;t=d[n++];){let n=f.get(t);n||f.set(t,n=p(c.decode(e[t].data))),i[t]=n,t!==l.main||r||(r=n),!a.has(t)&&a.add(t)}g(JSON.stringify(l.map,null,2),b,void 0,{type:"importmap"}),n=n.filter(e=>!a.has(e)),t={entryMain:r,imdata:l}}return[n,t]},h=async(e,t=i)=>{let n=e+".zip",r=await fetch(`${o||"."}/${n}`).then(async e=>{let n=!!e.headers.get("content-encoding"),r=e.body.getReader(),o=(l=+e.headers.get("content-length"),n?l<<1:l);var l;o||(o=5e5,n=!0);let i=new Uint8Array(o),a=0;for(;;){let{value:e}=await r.read();if(!e)break;if(o<a+e.length){o=(o<<1)+e.length;let t=new Uint8Array(o);t.set(i),i=t}i.set(e,a),a+=e.length,t(`loading zip: ${a.toLocaleString()} bytes(${a/o*100|0}%)`)}return n?i.slice(0,a):i}).catch(e=>e instanceof Error?e:new Error(String(e)));if("length"in r&&r.length){t(`loaded ${n}, decompressing binary...`);let e=`unzip: ${n}`;console.time(e);let o=f(r);return console.timeEnd(e),t(`${n} decompressed 😃`),new Promise(e=>{let[t,{entryMain:n,imdata:r}={}]=m(o),l=t.length,i=r?.main,a=()=>{! --l&&e()};for(let e,r=0;e=t[r++];){let t=o[e],r=e===i;g(c.decode(t.data),e,a,{integrity:u(t.comment),url:r?n:void 0,type:r?"module":void 0})}})}throw r};e.loadCompressedScript=h;let w=async()=>{w=void 0;let e=a.querySelector("script[data-csl-config]");if(e){let t=e.dataset.cslConfig;if(t){t=JSON.parse(t);let e=t.load?(y(t.base,t.selector),Array.isArray(t.load)?t.load:[t.load]):Array.isArray(t)?t:"string"==typeof t?[t]:[],n=[];for(let t of e)n.push(h(t).catch(e=>e));let r=(await Promise.all(n)).filter(e=>e&&e.name);setTimeout(()=>{let e="function"==typeof cslCallback?cslCallback:window[t.callback||"cslCallback"];"function"==typeof e&&e(r.length?r:void 0)},60),t.cleanup&&d()}}};setTimeout(w,99),e.version="v1.4.29";const b="$importmap.dat";e.IM_MAP_ID=b})(),r})());
|
package/webpack/index.js
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
/*! For license information please see index.js.LICENSE.txt */
|
|
2
|
-
(()=>{"use strict";var e=
|
|
3
|
-
;return n.length&&C(8),t}}let B,D,J=console.log,q=document,F=Object.keys,I=new TextDecoder,Y=function(e,t){const n={};let o=e.length-22;for(;101010256!=M(e,o);--o)(!o||e.length-o>65558)&&C(13);let l=A(e,o+8);if(!l)return{};let i=M(e,o+16);const a=4294967295===i;a&&(o=M(e,o-12),101075792!=M(e,o)&&C(13),l=M(e,o+32),i=M(e,o+48));const s=t&&t.filter;for(let t=0;t<l;++t){const[t,o,l,c,d,f,u]=U(e,i,a),p=P(e,f);if(i=d,!s||s({name:c,size:o,originalSize:l,compression:t,comment:u})){let i;t?8===t?i=T(e.subarray(p,p+o),new r(l)):C(14,"unknown compression type "+t):i=E(e,p,p+o),i&&(n[c]={data:i,comment:u})}}return n},G=()=>{I=void 0,V=Q=X=G=void 0,B=D=void 0,W=K=H=Y=void 0},H=e=>{let t=/^(?:sha\d{3}-)?([a-z0-9+/=]{44,88})$/i.exec(e);if(t){let n=(e=t[1]).length;if(!(88^n&&64^n&&44^n))return`sha${64==n?384:88==n?512:256}-${e}`}},K=(e,t="text/javascript")=>URL.createObjectURL(new Blob([e],{type:t})),Q=(e,t)=>{B=e,D=t||""},V=(e,t,n=(()=>{}),r={})=>{let o=()=>{n(),J(`script ${t} is ready`)},l=D?q.querySelector(D).nextElementSibling:void 0,i=q.head[l?"insertBefore":"appendChild"](q.createElement("script"),l);i.id=t,r.type&&(i.type=r.type);let a=r.integrity;a?(i.integrity=a,i.crossOrigin="",i.onload=o,i.src=r.url||K(e)):(i.text=e,o())},W=e=>{let t,n=F(e);if(n.includes(te)){n=n.filter((e=>e!==te));let r,o=I.decode(e[te].data),l=JSON.parse(o),i=l.map.imports,a=[],s=new Map;const c=F(i);for(let t=0;t<c.length;){const n=c[t++];let o=s.get(n);o||s.set(n,o=K(I.decode(e[n].data))),i[n]=o,n!==l.main||r||(r=o),!a.includes(n)&&a.push(n)}V(JSON.stringify(l.map,null,2),te,void 0,{type:"importmap"}),n=n.filter((e=>!a.includes(e))),t={entryMain:r,imdata:l}}return[n,t]},X=async(e,t=J)=>{let n=e+".zip",r=await fetch(`${B||"."}/${n}`).then((async e=>{let n=!!e.headers.get("content-encoding"),r=e.body.getReader(),o=(l=+e.headers.get("content-length"),n?l<<1|0:l);var l;let i=new Uint8Array(o),a=0;for(;;){let{done:e,value:n}=await r.read();if(e)break;i.set(n,a),a+=n.length,t(`loading zip: ${a.toLocaleString()} bytes(${a/o*100|0}%)`)}return n?i.slice(0,a):i})).catch((e=>{console.error(e)}));if(r&&r.length){t(`loaded ${n}, decompressing binary...`);let e=`unzip: ${n}`;console.time(e);let o=Y(r);return console.timeEnd(e),t(`${n} decompressed 😃`),new Promise((e=>{let[t,{entryMain:n,imdata:r}={}]=W(o),l=t.length,i=r?.main,a=()=>{! --l&&e()};for(let e,r=0;e=t[r++];){let t=o[e],r=e===i;V(I.decode(t.data),e,a,{integrity:H(t.comment),url:r?n:void 0,type:r?"module":void 0})}}))}throw new Error(`Could not load "${n}"`)},Z=async()=>{Z=void 0;let e=q.querySelector("script[data-csl-config]");if(e){let t=e.dataset.cslConfig;if(t){t=JSON.parse(t);let e=t.load?(Q(t.base,t.selector),Array.isArray(t.load)?t.load:[t.load]):Array.isArray(t)?t:"string"==typeof t?[t]:[],n=[];for(let t of e)n.push(X(t).catch((e=>e)));let r=(await Promise.all(n)).filter((e=>e&&e.name));setTimeout((()=>{let e="function"==typeof cslCallback?cslCallback:window[t.callback||"cslCallback"];"function"==typeof e&&e(r.length?r:void 0)}),60),t.cleanup&&G()}}};setTimeout(Z,99);const ee="v1.4.20",te="$importmap.dat";module.exports=t})();
|
|
2
|
+
(()=>{"use strict";var e=[,(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.unzipSync=function(e,t){const n={};let o=e.length-22;for(;101010256!=_(e,o);--o)(!o||e.length-o>65558)&&C(13);let l=U(e,o+8);if(!l)return{};let i=_(e,o+16);const a=4294967295===i;a&&(o=_(e,o-12),101075792!=_(e,o)&&C(13),l=_(e,o+32),i=_(e,o+48));const s=t&&t.filter;for(let t=0;t<l;++t){const[t,o,l,c,f,d,u]=P(e,i,a),p=T(e,d);if(i=f,!s||s({name:c,size:o,originalSize:l,compression:t,comment:u})){let i;t?8===t?i=M(e.subarray(p,p+o),new r(l)):C(14,"unknown compression type "+t):i=$(e,p,p+o),i&&(n[c]={data:i,comment:u})}}return n};const n=String.fromCharCode,r=Uint8Array,o=Uint16Array,l=Uint32Array,i=new r([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),a=new r([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),s=new r([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),c=(e,t)=>{const n=new o(31);for(let r=0;r<31;++r)n[r]=t+=1<<e[r-1];const r=new l(n[30]);for(let e=1;e<30;++e)for(let t=n[e];t<n[e+1];++t)r[t]=t-n[e]<<5|e;return[n,r]},[f,d]=c(i,2);f[28]=258,d[258]=28;const[u,p]=c(a,0),y=new o(32768);for(let e=0;e<32768;++e){let t=(43690&e)>>>1|(21845&e)<<1;t=(52428&t)>>>2|(13107&t)<<2,t=(61680&t)>>>4|(3855&t)<<4,y[e]=((65280&t)>>>8|(255&t)<<8)>>>1}const g=(e,t,n)=>{const r=e.length;let l=0;const i=new o(t);for(;l<r;++l)e[l]&&++i[e[l]-1];const a=new o(t);for(l=0;l<t;++l)a[l]=a[l-1]+i[l-1]<<1;let s;if(n){s=new o(1<<t);const n=15-t;for(l=0;l<r;++l)if(e[l]){const r=l<<4|e[l],o=t-e[l];let i=a[e[l]-1]++<<o;for(const e=i|(1<<o)-1;i<=e;++i)s[y[i]>>>n]=r}}else for(s=new o(r),l=0;l<r;++l)e[l]&&(s[l]=y[a[e[l]-1]++]>>>15-e[l]);return s},m=new r(288),h=new r(32);{let e=0;for(;e<144;)m[e++]=8;for(;e<256;)m[e++]=9;for(;e<280;)m[e++]=7;for(;e<288;)m[e++]=8;for(e=0;e<32;)h[e++]=5}const w=g(m,9,1),b=g(h,5,1),v=e=>{let t=e[0];for(let n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},S=(e,t,n)=>{const r=t/8|0;return(e[r]|e[r+1]<<8)>>(7&t)&n},k=(e,t)=>{const n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(7&t)},x=e=>(e+7)/8|0,E=[,r,o,,l],$=(e,t,n)=>{(!t||t<0)&&(t=0),(!n||n>e.length)&&(n=e.length);const r=new E[e.BYTES_PER_ELEMENT](n-t);return r.set(e.subarray(t,n)),r},z=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"];let A=Error.captureStackTrace;const C=(e,t,n)=>{const r=new Error(t||z[e]);if(r.code=e,A&&A(r,C),!n)throw r;return r},M=(e,t,n)=>{const o=e.length;if(!o||n&&n.f&&!n.l)return t||new r(0);const l=!t||!!n,c=!n||n.i;!n&&(n={}),!t&&(t=new r(3*o));const d=e=>{let n=t.length;if(e>n){const o=new r(Math.max(2*n,e));o.set(t),t=o}};let p=n.f||0,y=n.p||0,m=n.b||0,h=n.l,E=n.d,z=n.m,A=n.n;const M=8*o;do{if(!h){p=S(e,y,1);const i=S(e,y+1,3);if(y+=3,!i){const r=x(y)+4,i=e[r-4]|e[r-3]<<8,a=r+i;if(a>o){c&&C(0);break}l&&d(m+i),t.set(e.subarray(r,a),m),n.b=m+=i,n.p=y=8*a,n.f=p;continue}if(1===i)h=w,E=b,z=9,A=5;else if(2===i){const t=S(e,y,31)+257,n=S(e,y+10,15)+4,o=t+S(e,y+5,31)+1;y+=14;const l=new r(o),i=new r(19);for(let t=0;t<n;++t)i[s[t]]=S(e,y+3*t,7);y+=3*n;const a=v(i),c=(1<<a)-1,f=g(i,a,1);for(let t=0;t<o;){const n=f[S(e,y,c)];y+=15&n;const r=n>>>4;if(r<16)l[t++]=r;else{let n=0,o=0;for(16===r?(o=3+S(e,y,3),y+=2,n=l[t-1]):17===r?(o=3+S(e,y,7),y+=3):18===r&&(o=11+S(e,y,127),y+=7);o--;)l[t++]=n}}const d=l.subarray(0,t),u=l.subarray(t);z=v(d),A=v(u),h=g(d,z,1),E=g(u,A,1)}else C(1);if(y>M){c&&C(0);break}}l&&d(m+131072);const $=(1<<z)-1,U=(1<<A)-1;let _=y;for(;;_=y){const n=h[k(e,y)&$],r=n>>>4;if(y+=15&n,y>M){c&&C(0);break}if(n||C(2),r<256)t[m++]=r;else{if(256===r){_=y,h=void 0;break}{let n=r-254;if(r>264){const t=r-257,o=i[t];n=S(e,y,(1<<o)-1)+f[t],y+=o}const o=E[k(e,y)&U],s=o>>>4;o||C(3),y+=15&o;let p=u[s];if(s>3){const t=a[s];p+=k(e,y)&(1<<t)-1,y+=t}if(y>M){c&&C(0);break}l&&d(m+131072);const g=m+n;for(;m<g;m+=4)t[m]=t[m-p],t[m+1]=t[m+1-p],t[m+2]=t[m+2-p],t[m+3]=t[m+3-p];m=g}}}n.l=h,n.p=_,n.b=m,n.f=p,h&&(p=1,n.m=z,n.d=E,n.n=A)}while(!p);return m===t.length?t:$(t,0,m)},U=(e,t)=>e[t]|e[t+1]<<8,_=(e,t)=>(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0,O=(e,t)=>_(e,t)+4294967296*_(e,t+4),T=(e,t)=>t+30+U(e,t+26)+U(e,t+28),P=(e,t,n)=>{const r=!(2048&U(e,t+8)),o=U(e,t+28),l=N(e.subarray(t+46,t+46+o),r),i=t+46+o,a=_(e,t+20),[s,c,f]=n&&4294967295===a?j(e,i):[a,_(e,t+24),_(e,t+42)],d=i+U(e,t+30);return[U(e,t+10),s,c,l,i+U(e,t+30)+U(e,t+32),f,N(e.subarray(d,d+U(e,t+32)),r)]},j=(e,t)=>{for(;1!=U(e,t);t+=4+U(e,t+2));return[O(e,t+12),O(e,t+4),O(e,t+20)]};let D;const I=new r(0);try{const e=new TextDecoder;e.decode(I,{stream:!0}),D=e}catch{}const L=e=>{for(let t="",r=0;;){let o=e[r++];const l=+(o>127)+ +(o>223)+ +(o>239);if(r+l>e.length)return[t,$(e,r-1)];l?3===l?(o=((15&o)<<18|(63&e[r++])<<12|(63&e[r++])<<6|63&e[r++])-65536,t+=n(55296|o>>10,56320|1023&o)):t+=n(1&l?(31&o)<<6|63&e[r++]:(15&o)<<12|(63&e[r++])<<6|63&e[r++]):t+=n(o)}};function N(e,t){if(t){let t="";for(let r=0;r<e.length;r+=16384)t+=n.apply(null,e.subarray(r,r+16384));return t}if(D)return D.decode(e);{const[t,n]=L(e);return n.length&&C(8),t}}}],t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var l=t[r]={exports:{}};return e[r](l,l.exports,n),l.exports}var r={};(()=>{var e=r;Object.defineProperty(e,"__esModule",{value:!0}),e.IM_MAP_ID=e.version=e.unzipSync=e.cleanUp=e.loadCompressedScript=e.setConfig=void 0;const t=n(1);let o,l,i=console.log,a=document,s=Object.keys,c=new TextDecoder,f=t.unzipSync;e.unzipSync=f;let d=()=>{c=void 0,g=y=h=d=void 0,o=l=void 0,m=p=u=f=void 0};e.cleanUp=d;let u=e=>{let t=/^(?:sha\d{3}-)?([a-z0-9+/=]{44,88})$/i.exec(e);if(t){let n=(e=t[1]).length;if(!(88^n&&64^n&&44^n))return`sha${64==n?384:88==n?512:256}-${e}`}},p=(e,t="text/javascript")=>URL.createObjectURL(new Blob([e],{type:t})),y=(e,t)=>{o=e,l=t||""};e.setConfig=y;let g=(e,t,n=()=>{},r={})=>{let o=()=>{n(),i(`script ${t} is ready`)},s=l?a.querySelector(l).nextElementSibling:void 0,c=a.head[s?"insertBefore":"appendChild"](a.createElement("script"),s);c.id=t,r.type&&(c.type=r.type);let f=r.integrity;f?(c.integrity=f,c.crossOrigin="",c.onload=o,c.src=r.url||p(e)):(c.text=e,o())},m=e=>{let t,n=s(e);if(n.includes(b)){n=n.filter(e=>e!==b);let r,o=c.decode(e[b].data),l=JSON.parse(o),i=l.map.imports,a=new Set,f=new Map;const d=s(i);for(let t,n=0;t=d[n++];){let n=f.get(t);n||f.set(t,n=p(c.decode(e[t].data))),i[t]=n,t!==l.main||r||(r=n),!a.has(t)&&a.add(t)}g(JSON.stringify(l.map,null,2),b,void 0,{type:"importmap"}),n=n.filter(e=>!a.has(e)),t={entryMain:r,imdata:l}}return[n,t]},h=async(e,t=i)=>{let n=e+".zip",r=await fetch(`${o||"."}/${n}`).then(async e=>{let n=!!e.headers.get("content-encoding"),r=e.body.getReader(),o=(l=+e.headers.get("content-length"),n?l<<1:l);var l;o||(o=5e5,n=!0);let i=new Uint8Array(o),a=0;for(;;){let{value:e}=await r.read();if(!e)break;if(o<a+e.length){o=(o<<1)+e.length;let t=new Uint8Array(o);t.set(i),i=t}i.set(e,a),a+=e.length,t(`loading zip: ${a.toLocaleString()} bytes(${a/o*100|0}%)`)}return n?i.slice(0,a):i}).catch(e=>e instanceof Error?e:new Error(String(e)));if("length"in r&&r.length){t(`loaded ${n}, decompressing binary...`);let e=`unzip: ${n}`;console.time(e);let o=f(r);return console.timeEnd(e),t(`${n} decompressed 😃`),new Promise(e=>{let[t,{entryMain:n,imdata:r}={}]=m(o),l=t.length,i=r?.main,a=()=>{! --l&&e()};for(let e,r=0;e=t[r++];){let t=o[e],r=e===i;g(c.decode(t.data),e,a,{integrity:u(t.comment),url:r?n:void 0,type:r?"module":void 0})}})}throw r};e.loadCompressedScript=h;let w=async()=>{w=void 0;let e=a.querySelector("script[data-csl-config]");if(e){let t=e.dataset.cslConfig;if(t){t=JSON.parse(t);let e=t.load?(y(t.base,t.selector),Array.isArray(t.load)?t.load:[t.load]):Array.isArray(t)?t:"string"==typeof t?[t]:[],n=[];for(let t of e)n.push(h(t).catch(e=>e));let r=(await Promise.all(n)).filter(e=>e&&e.name);setTimeout(()=>{let e="function"==typeof cslCallback?cslCallback:window[t.callback||"cslCallback"];"function"==typeof e&&e(r.length?r:void 0)},60),t.cleanup&&d()}}};setTimeout(w,99),e.version="v1.4.29";const b="$importmap.dat";e.IM_MAP_ID=b})(),module.exports=r})();
|
package/webpack-esm/index.mjs
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
/*! For license information please see index.mjs.LICENSE.txt */
|
|
2
|
-
var e={
|
|
3
|
-
;const i=4294967295===a;i&&(o=T(e,o-12),101075792!=T(e,o)&&O(13),l=T(e,o+32),a=T(e,o+48));const s=t&&t.filter;for(let t=0;t<l;++t){const[t,o,l,c,d,f,u]=L(e,a,i),p=M(e,f);if(a=d,!s||s({name:c,size:o,originalSize:l,compression:t,comment:u})){let a;t?8===t?a=A(e.subarray(p,p+o),new r(l)):O(14,"unknown compression type "+t):a=$(e,p,p+o),a&&(n[c]={data:a,comment:u})}}return n},I=()=>{G=void 0,Q=K=W=I=void 0,B=D=void 0,V=Y=Z=H=void 0},Z=e=>{let t=/^(?:sha\d{3}-)?([a-z0-9+/=]{44,88})$/i.exec(e);if(t){let n=(e=t[1]).length;if(!(88^n&&64^n&&44^n))return`sha${64==n?384:88==n?512:256}-${e}`}},Y=(e,t="text/javascript")=>URL.createObjectURL(new Blob([e],{type:t})),K=(e,t)=>{B=e,D=t||""},Q=(e,t,n=(()=>{}),r={})=>{let o=()=>{n(),J(`script ${t} is ready`)},l=D?q.querySelector(D).nextElementSibling:void 0,a=q.head[l?"insertBefore":"appendChild"](q.createElement("script"),l);a.id=t,r.type&&(a.type=r.type);let i=r.integrity;i?(a.integrity=i,a.crossOrigin="",a.onload=o,a.src=r.url||Y(e)):(a.text=e,o())},V=e=>{let t,n=F(e);if(n.includes(te)){n=n.filter((e=>e!==te));let r,o=G.decode(e[te].data),l=JSON.parse(o),a=l.map.imports,i=[],s=new Map;const c=F(a);for(let t=0;t<c.length;){const n=c[t++];let o=s.get(n);o||s.set(n,o=Y(G.decode(e[n].data))),a[n]=o,n!==l.main||r||(r=o),!i.includes(n)&&i.push(n)}Q(JSON.stringify(l.map,null,2),te,void 0,{type:"importmap"}),n=n.filter((e=>!i.includes(e))),t={entryMain:r,imdata:l}}return[n,t]},W=async(e,t=J)=>{let n=e+".zip",r=await fetch(`${B||"."}/${n}`).then((async e=>{let n=!!e.headers.get("content-encoding"),r=e.body.getReader(),o=(l=+e.headers.get("content-length"),n?l<<1|0:l);var l;let a=new Uint8Array(o),i=0;for(;;){let{done:e,value:n}=await r.read();if(e)break;a.set(n,i),i+=n.length,t(`loading zip: ${i.toLocaleString()} bytes(${i/o*100|0}%)`)}return n?a.slice(0,i):a})).catch((e=>{console.error(e)}));if(r&&r.length){t(`loaded ${n}, decompressing binary...`);let e=`unzip: ${n}`;console.time(e);let o=H(r);return console.timeEnd(e),t(`${n} decompressed 😃`),new Promise((e=>{let[t,{entryMain:n,imdata:r}={}]=V(o),l=t.length,a=r?.main,i=()=>{! --l&&e()};for(let e,r=0;e=t[r++];){let t=o[e],r=e===a;Q(G.decode(t.data),e,i,{integrity:Z(t.comment),url:r?n:void 0,type:r?"module":void 0})}}))}throw new Error(`Could not load "${n}"`)},X=async()=>{X=void 0;let e=q.querySelector("script[data-csl-config]");if(e){let t=e.dataset.cslConfig;if(t){t=JSON.parse(t);let e=t.load?(K(t.base,t.selector),Array.isArray(t.load)?t.load:[t.load]):Array.isArray(t)?t:"string"==typeof t?[t]:[],n=[];for(let t of e)n.push(W(t).catch((e=>e)));let r=(await Promise.all(n)).filter((e=>e&&e.name));setTimeout((()=>{let e="function"==typeof cslCallback?cslCallback:window[t.callback||"cslCallback"];"function"==typeof e&&e(r.length?r:void 0)}),60),t.cleanup&&I()}}};setTimeout(X,99);const ee="v1.4.20",te="$importmap.dat";var ne=t.Hx,re=t.Lx,oe=t.aN,le=t.v6,ae=t.GZ,ie=t.i8;export{ne as IM_MAP_ID,re as cleanUp,oe as loadCompressedScript,le as setConfig,ae as unzipSync,ie as version};
|
|
2
|
+
var e=[,(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.unzipSync=function(e,t){const n={};let o=e.length-22;for(;101010256!=$(e,o);--o)(!o||e.length-o>65558)&&A(13);let l=U(e,o+8);if(!l)return{};let i=$(e,o+16);const a=4294967295===i;a&&(o=$(e,o-12),101075792!=$(e,o)&&A(13),l=$(e,o+32),i=$(e,o+48));const s=t&&t.filter;for(let t=0;t<l;++t){const[t,o,l,c,d,f,p]=I(e,i,a),u=P(e,f);if(i=d,!s||s({name:c,size:o,originalSize:l,compression:t,comment:p})){let i;t?8===t?i=E(e.subarray(u,u+o),new r(l)):A(14,"unknown compression type "+t):i=C(e,u,u+o),i&&(n[c]={data:i,comment:p})}}return n};const n=String.fromCharCode,r=Uint8Array,o=Uint16Array,l=Uint32Array,i=new r([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),a=new r([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),s=new r([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),c=(e,t)=>{const n=new o(31);for(let r=0;r<31;++r)n[r]=t+=1<<e[r-1];const r=new l(n[30]);for(let e=1;e<30;++e)for(let t=n[e];t<n[e+1];++t)r[t]=t-n[e]<<5|e;return[n,r]},[d,f]=c(i,2);d[28]=258,f[258]=28;const[p,u]=c(a,0),y=new o(32768);for(let e=0;e<32768;++e){let t=(43690&e)>>>1|(21845&e)<<1;t=(52428&t)>>>2|(13107&t)<<2,t=(61680&t)>>>4|(3855&t)<<4,y[e]=((65280&t)>>>8|(255&t)<<8)>>>1}const g=(e,t,n)=>{const r=e.length;let l=0;const i=new o(t);for(;l<r;++l)e[l]&&++i[e[l]-1];const a=new o(t);for(l=0;l<t;++l)a[l]=a[l-1]+i[l-1]<<1;let s;if(n){s=new o(1<<t);const n=15-t;for(l=0;l<r;++l)if(e[l]){const r=l<<4|e[l],o=t-e[l];let i=a[e[l]-1]++<<o;for(const e=i|(1<<o)-1;i<=e;++i)s[y[i]>>>n]=r}}else for(s=new o(r),l=0;l<r;++l)e[l]&&(s[l]=y[a[e[l]-1]++]>>>15-e[l]);return s},m=new r(288),h=new r(32);{let e=0;for(;e<144;)m[e++]=8;for(;e<256;)m[e++]=9;for(;e<280;)m[e++]=7;for(;e<288;)m[e++]=8;for(e=0;e<32;)h[e++]=5}const w=g(m,9,1),b=g(h,5,1),v=e=>{let t=e[0];for(let n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},S=(e,t,n)=>{const r=t/8|0;return(e[r]|e[r+1]<<8)>>(7&t)&n},_=(e,t)=>{const n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(7&t)},M=e=>(e+7)/8|0,k=[,r,o,,l],C=(e,t,n)=>{(!t||t<0)&&(t=0),(!n||n>e.length)&&(n=e.length);const r=new k[e.BYTES_PER_ELEMENT](n-t);return r.set(e.subarray(t,n)),r},x=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"];let z=Error.captureStackTrace;const A=(e,t,n)=>{const r=new Error(t||x[e]);if(r.code=e,z&&z(r,A),!n)throw r;return r},E=(e,t,n)=>{const o=e.length;if(!o||n&&n.f&&!n.l)return t||new r(0);const l=!t||!!n,c=!n||n.i;!n&&(n={}),!t&&(t=new r(3*o));const f=e=>{let n=t.length;if(e>n){const o=new r(Math.max(2*n,e));o.set(t),t=o}};let u=n.f||0,y=n.p||0,m=n.b||0,h=n.l,k=n.d,x=n.m,z=n.n;const E=8*o;do{if(!h){u=S(e,y,1);const i=S(e,y+1,3);if(y+=3,!i){const r=M(y)+4,i=e[r-4]|e[r-3]<<8,a=r+i;if(a>o){c&&A(0);break}l&&f(m+i),t.set(e.subarray(r,a),m),n.b=m+=i,n.p=y=8*a,n.f=u;continue}if(1===i)h=w,k=b,x=9,z=5;else if(2===i){const t=S(e,y,31)+257,n=S(e,y+10,15)+4,o=t+S(e,y+5,31)+1;y+=14;const l=new r(o),i=new r(19);for(let t=0;t<n;++t)i[s[t]]=S(e,y+3*t,7);y+=3*n;const a=v(i),c=(1<<a)-1,d=g(i,a,1);for(let t=0;t<o;){const n=d[S(e,y,c)];y+=15&n;const r=n>>>4;if(r<16)l[t++]=r;else{let n=0,o=0;for(16===r?(o=3+S(e,y,3),y+=2,n=l[t-1]):17===r?(o=3+S(e,y,7),y+=3):18===r&&(o=11+S(e,y,127),y+=7);o--;)l[t++]=n}}const f=l.subarray(0,t),p=l.subarray(t);x=v(f),z=v(p),h=g(f,x,1),k=g(p,z,1)}else A(1);if(y>E){c&&A(0);break}}l&&f(m+131072);const C=(1<<x)-1,U=(1<<z)-1;let $=y;for(;;$=y){const n=h[_(e,y)&C],r=n>>>4;if(y+=15&n,y>E){c&&A(0);break}if(n||A(2),r<256)t[m++]=r;else{if(256===r){$=y,h=void 0;break}{let n=r-254;if(r>264){const t=r-257,o=i[t];n=S(e,y,(1<<o)-1)+d[t],y+=o}const o=k[_(e,y)&U],s=o>>>4;o||A(3),y+=15&o;let u=p[s];if(s>3){const t=a[s];u+=_(e,y)&(1<<t)-1,y+=t}if(y>E){c&&A(0);break}l&&f(m+131072);const g=m+n;for(;m<g;m+=4)t[m]=t[m-u],t[m+1]=t[m+1-u],t[m+2]=t[m+2-u],t[m+3]=t[m+3-u];m=g}}}n.l=h,n.p=$,n.b=m,n.f=u,h&&(u=1,n.m=x,n.d=k,n.n=z)}while(!u);return m===t.length?t:C(t,0,m)},U=(e,t)=>e[t]|e[t+1]<<8,$=(e,t)=>(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0,O=(e,t)=>$(e,t)+4294967296*$(e,t+4),P=(e,t)=>t+30+U(e,t+26)+U(e,t+28),I=(e,t,n)=>{const r=!(2048&U(e,t+8)),o=U(e,t+28),l=N(e.subarray(t+46,t+46+o),r),i=t+46+o,a=$(e,t+20),[s,c,d]=n&&4294967295===a?T(e,i):[a,$(e,t+24),$(e,t+42)],f=i+U(e,t+30);return[U(e,t+10),s,c,l,i+U(e,t+30)+U(e,t+32),d,N(e.subarray(f,f+U(e,t+32)),r)]},T=(e,t)=>{for(;1!=U(e,t);t+=4+U(e,t+2));return[O(e,t+12),O(e,t+4),O(e,t+20)]};let D;const j=new r(0);try{const e=new TextDecoder;e.decode(j,{stream:!0}),D=e}catch{}const L=e=>{for(let t="",r=0;;){let o=e[r++];const l=+(o>127)+ +(o>223)+ +(o>239);if(r+l>e.length)return[t,C(e,r-1)];l?3===l?(o=((15&o)<<18|(63&e[r++])<<12|(63&e[r++])<<6|63&e[r++])-65536,t+=n(55296|o>>10,56320|1023&o)):t+=n(1&l?(31&o)<<6|63&e[r++]:(15&o)<<12|(63&e[r++])<<6|63&e[r++]):t+=n(o)}};function N(e,t){if(t){let t="";for(let r=0;r<e.length;r+=16384)t+=n.apply(null,e.subarray(r,r+16384));return t}if(D)return D.decode(e);{const[t,n]=L(e);return n.length&&A(8),t}}}],t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var l=t[r]={exports:{}};return e[r](l,l.exports,n),l.exports}var r={};(()=>{var e=r;Object.defineProperty(e,"__esModule",{value:!0}),e.IM_MAP_ID=e.version=e.unzipSync=e.cleanUp=e.loadCompressedScript=e.setConfig=void 0;const t=n(1);let o,l,i=console.log,a=document,s=Object.keys,c=new TextDecoder,d=t.unzipSync;e.unzipSync=d;let f=()=>{c=void 0,g=y=h=f=void 0,o=l=void 0,m=u=p=d=void 0};e.cleanUp=f;let p=e=>{let t=/^(?:sha\d{3}-)?([a-z0-9+/=]{44,88})$/i.exec(e);if(t){let n=(e=t[1]).length;if(!(88^n&&64^n&&44^n))return`sha${64==n?384:88==n?512:256}-${e}`}},u=(e,t="text/javascript")=>URL.createObjectURL(new Blob([e],{type:t})),y=(e,t)=>{o=e,l=t||""};e.setConfig=y;let g=(e,t,n=()=>{},r={})=>{let o=()=>{n(),i(`script ${t} is ready`)},s=l?a.querySelector(l).nextElementSibling:void 0,c=a.head[s?"insertBefore":"appendChild"](a.createElement("script"),s);c.id=t,r.type&&(c.type=r.type);let d=r.integrity;d?(c.integrity=d,c.crossOrigin="",c.onload=o,c.src=r.url||u(e)):(c.text=e,o())},m=e=>{let t,n=s(e);if(n.includes(b)){n=n.filter(e=>e!==b);let r,o=c.decode(e[b].data),l=JSON.parse(o),i=l.map.imports,a=new Set,d=new Map;const f=s(i);for(let t,n=0;t=f[n++];){let n=d.get(t);n||d.set(t,n=u(c.decode(e[t].data))),i[t]=n,t!==l.main||r||(r=n),!a.has(t)&&a.add(t)}g(JSON.stringify(l.map,null,2),b,void 0,{type:"importmap"}),n=n.filter(e=>!a.has(e)),t={entryMain:r,imdata:l}}return[n,t]},h=async(e,t=i)=>{let n=e+".zip",r=await fetch(`${o||"."}/${n}`).then(async e=>{let n=!!e.headers.get("content-encoding"),r=e.body.getReader(),o=(l=+e.headers.get("content-length"),n?l<<1:l);var l;o||(o=5e5,n=!0);let i=new Uint8Array(o),a=0;for(;;){let{value:e}=await r.read();if(!e)break;if(o<a+e.length){o=(o<<1)+e.length;let t=new Uint8Array(o);t.set(i),i=t}i.set(e,a),a+=e.length,t(`loading zip: ${a.toLocaleString()} bytes(${a/o*100|0}%)`)}return n?i.slice(0,a):i}).catch(e=>e instanceof Error?e:new Error(String(e)));if("length"in r&&r.length){t(`loaded ${n}, decompressing binary...`);let e=`unzip: ${n}`;console.time(e);let o=d(r);return console.timeEnd(e),t(`${n} decompressed 😃`),new Promise(e=>{let[t,{entryMain:n,imdata:r}={}]=m(o),l=t.length,i=r?.main,a=()=>{! --l&&e()};for(let e,r=0;e=t[r++];){let t=o[e],r=e===i;g(c.decode(t.data),e,a,{integrity:p(t.comment),url:r?n:void 0,type:r?"module":void 0})}})}throw r};e.loadCompressedScript=h;let w=async()=>{w=void 0;let e=a.querySelector("script[data-csl-config]");if(e){let t=e.dataset.cslConfig;if(t){t=JSON.parse(t);let e=t.load?(y(t.base,t.selector),Array.isArray(t.load)?t.load:[t.load]):Array.isArray(t)?t:"string"==typeof t?[t]:[],n=[];for(let t of e)n.push(h(t).catch(e=>e));let r=(await Promise.all(n)).filter(e=>e&&e.name);setTimeout(()=>{let e="function"==typeof cslCallback?cslCallback:window[t.callback||"cslCallback"];"function"==typeof e&&e(r.length?r:void 0)},60),t.cleanup&&f()}}};setTimeout(w,99),e.version="v1.4.29";const b="$importmap.dat";e.IM_MAP_ID=b})();const o=r.IM_MAP_ID,l=r.__esModule,i=r.cleanUp,a=r.loadCompressedScript,s=r.setConfig,c=r.unzipSync,d=r.version;export{o as IM_MAP_ID,l as __esModule,i as cleanUp,a as loadCompressedScript,s as setConfig,c as unzipSync,d as version,r as default};
|