compressed-script-loader 1.4.29 → 1.4.34
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/bin/cslpack.js +1 -1
- package/bin/cslpack.js.LICENSE.txt +0 -8
- package/index.d.ts +1 -1
- package/package.json +1 -1
- package/umd/index.js +1 -1
- package/webpack/index.js +1 -1
- package/webpack-esm/index.mjs +1 -1
package/bin/cslpack.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/*! For license information please see cslpack.js.LICENSE.txt */
|
|
3
|
-
(()=>{var
|
|
3
|
+
(()=>{{let o=Object;var _dp0=o.defineProperty,_k1=o.keys,_p2=o.prototype,_v3=o.values}var _wm_=[,,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 r=(e=e||{}).prefix||"-",s=r.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(r)){const n=t.slice(s),[,a=n,c]=/^([^:=]+)(?:[:=](.+))?$/.exec(n)||[];let l;c?l=parseValue(c):(l=o[e],void 0===l||l.startsWith(r)?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__wm_,_we_,_wr_)=>{"use strict";_wr_.d(_we_,{n:()=>ModuleCouldNotResolveError,t:()=>ModuleResolver});var fs0__=_wr_(2),path1__=_wr_(4);class ModuleCouldNotResolveError extends Error{}function caseTsConfig(startDir,map){let tsconfig,prevDir,found=!1;do{if(tsconfig=path1__.resolve(startDir,"tsconfig.json"),fs0__.existsSync(tsconfig)){console.log("okay, tsconfig.json found!"),found=!0;break}prevDir=startDir,startDir=path1__.parse(startDir).dir}while(startDir!==prevDir);if(!found)return void console.log("huh, tsconfig.json not found!");const src=fs0__.readFileSync(tsconfig,"utf8"),cfg=eval("("+src+")"),co=cfg.compilerOptions;let pathskeys;return co.paths&&(pathskeys=_k1(co.paths)).length?(pathskeys.forEach(e=>{const t=[];map[e]=t;const o=co.paths[e];for(let e=0;e<o.length;){const r=path1__.resolve(startDir,co.baseUrl,o[e++]).toUnixPath();t.push(r)}}),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[r,s]of Object.entries(t))if(r=o(r),e.startsWith(r))for(let t of s){t=o(t);const s=e.replace(r,t);if(fs0__.existsSync(s))return s.toUnixPath()}return""}const ModuleResolver={foundConfig:!1,virtualPaths:{},resolve(e,t,o){const r=path1__.parse(e),s=path1__.resolve(r.dir,t).toUnixPath();if(fs0__.existsSync(s))return s;if(!this.foundConfig){if(!caseTsConfig(r.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}}}],_wmc_={};function _wr_(e){var t=_wmc_[e];if(void 0!==t)return t.exports;var o=_wmc_[e]={exports:{}};return _wm_[e](o,o.exports,_wr_),o.exports}_wr_.d=(e,t)=>{for(var o in t)_wr_.o(t,o)&&!_wr_.o(e,o)&&_dp0(e,o,{enumerable:!0,get:t[o]})},_wr_.o=(e,t)=>_p2.hasOwnProperty.call(e,t);(()=>{"use strict";var e=_wr_(2),t=_wr_(7),o=_wr_(4);const r=require("fflate"),s=require("crypto"),n=/(?<!\\)\#\s*.*$|\s+/gm;require("colors");var i=_wr_(10);String.prototype.toUnixPath="\\"===o.sep?function(){return this.replace(/\\/g,"/")}:function(){return this};class a extends Error{}function c(){return(()=>{const{pattern:e,flags:t}=(e=>{const t=(e=>e.replace(n,"").replace(/\\#/g,"#"))(e);if("/"!==t[0])throw new Error("Expected regex literal to start with '/'");const o=t.lastIndexOf("/");if(o<=0)throw new Error("Invalid regex literal: missing trailing '/'");return{pattern:t.slice(1,o),flags:t.slice(o+1)}})("/\n(?:\n (?:^\\s*?\\/\\*+?[\\s\\S]*?\\*\\/)|\n (?<!\\s*\\/\\/+.*?)(?:(?<!@)import|export)\n \\s*\n (?:\n # 2025/12/22 14:57:44 - support quote character detection [\"']\n # global import, import \"./\"; import './global.mjs';\n (?<qcGlobal>[\"'])(?!https?:)(?=(?:\\.\\.?\\/)+)(?:\n (?<globalName>(?:(?:\\.\\.?\\/)+)?[^'\"]+?)(?:\\.(?<globalExt>(?:c|m)?jsx?))?\n )\\k<qcGlobal>|\n # dynamic import, import(\"...\") import('...')\n \\(\\s*\n (?<qcDynamic>[\"'])(?!https?:)(?=(?:\\.\\.?\\/)+)(?<dynamicName>(?:(?:\\.\\.?\\/)+)?[^'\"]+?)(?:\\.(?<dynamicExt>(?:c|m)?jsx?))?\\k<qcDynamic>\n \\s*\\)|\n # esm import/export\n (?:(?<clause>.+?|(?:\\w+\\s*,)?\\s*\\{[^}]+})\\s*from)\\s*\n (?<qcEsm>[\"'])(?!https?:)(?=(?:\\.\\.?\\/)+)\n (?:\n (?<moduleName>(?:(?:\\.\\.?\\/)+)?[^'\"]+?)(?:\\.(?<moduleExt>(?:c|m)?jsx?))?\n )\\k<qcEsm>\n )\n (?=\\s*;)?\n)/gm\n");return new RegExp(e,t)})()}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:r,dynamicExt:s,moduleName:n,moduleExt:i}=e;return t?`${t}.${o}`:r?`${r}.${s}`:n?`${n}.${i}`:null},g=(e,t)=>{const o=c(),r=e.code;let s;for(;s=o.exec(r);){const o=s[0];if(/\s*?\/\*/.test(o))continue;const r=m(s.groups);if(!r)throw new a("Sorry, failed to detect module id");if(e.modIdDetails.push({moduleId:r,statement:o,referrer:e.canonicalPath}),!d.has(r)){const o=i.t.resolve(e.canonicalPath,r,u);if(!o)throw new i.n(`moduleId: "${r}" cannot be resolved, stop processing`);d.set(r,o),t[o]?u(`source: "${o}" is already scanned`,"info"):g(t[o]=f(o),t)}}},v=new TextEncoder,w=console.log;let E="./dist/bundle.zip",b=t();w("Running cslpack - ".blue+"v1.4.34".yellow+"\n",b);let x=b.args;x||(w(`\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 k=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 r=o.resolve(e).toUnixPath();if(!t[r])return t[r]=f(r);u(`source: "${r}" is already scanned`,"info")})(e,this.prefetchSources);t&&this.cslImportMap&&g(t,this.prefetchSources)}async emit(t,n){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],r=0;for(;r<t.length&&t[r]===o[r];)r++;return t.slice(0,r-1)}(_v3(e).map(e=>e.canonicalPath));if(!t)throw new ReferenceError("No common parts detected among the paths.");const o=/\\|\//.exec(t)||["/"],r=t.lastIndexOf(o[0])+1;0!==r&&_v3(e).forEach(e=>{e.homogenized=e.canonicalPath.slice(r)})})(p),(t=>{const o=(()=>{if(i.t.foundConfig)return{extras:{comment:"module resolve from tsconfig.json",config:i.t.virtualPaths}}})(),r=JSON.stringify({...t,...o},(e,t)=>"code"===e?{length:t.length}:t,2);e.writeFile("./cslpack-info.json",r,"binary",()=>{console.log()})})(p);let u=this.list,h=this.cslImportMap;await((e,t,r,n)=>{const i=c(),_=r?.map.imports,p=[],u=(...t)=>{const[o,,,,,,,,,,,,,r]=t;if(/\s*?\/\*/.test(o))return o;const s=m(r);if(!s)throw new a("Sorry, failed to detect module id");const n=d.get(s);if(!n)throw new Error("process homogenizeModuleIds failed!");const i=e[n].homogenized;return _[i]="",o.replace(s,i)};return/256|384|512/.test(n)||(n="384"),_v3(e).forEach(e=>{let a=e.code;_&&(i.lastIndex=0,a=a.replace(i,u)),o.parse(e.canonicalPath).base===r?.main&&(r.main=e.homogenized);const c=`[hash(sha${n})::${e.homogenized}]`;console.time(c),p.push(new Promise(o=>{t[e.homogenized]=[l.encode(a),{level:7,comment:s.createHash(`sha${n}`).update(a).digest("base64")}],console.timeEnd(c),o()}))}),Promise.all(p)})(p,u,h,n),h&&(u["$importmap.dat"]=[v.encode(JSON.stringify(h,null,2)),{level:7}]);const f=`[fflate.zip:${t}]`;console.time(f),r.zip(u,(r,s)=>{if(console.timeEnd(f),r)throw r;(t=>{const r=o.dirname(t);e.existsSync(r)||e.mkdirSync(r,{recursive:!0})})(t),e.writeFile(t,s,"binary",()=>{_(h),this.reset()})})}reset(){this.list={},this.prefetchSources={},this.cslImportMap=void 0,h(!0)}}(b.m);let y=b.sha;/256|384|512/.test(y)||(y="384");for(const t of x)e.statSync(t).isFile()&&k.add(t);k.emit(b.d||b.dest||E,y).then(()=>{w("cslpack done!")})})()})();
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
3
|
-
Copyright (C) 2022 jeffy-g <hirotom1107@gmail.com>
|
|
4
|
-
Released under the MIT license
|
|
5
|
-
https://opensource.org/licenses/mit-license.php
|
|
6
|
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
1
|
/*!
|
|
10
2
|
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
11
3
|
Copyright (C) 2023 jeffy-g <hirotom1107@gmail.com>
|
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.34";
|
|
38
38
|
/**
|
|
39
39
|
* `importmap` zip entry name
|
|
40
40
|
*/
|
package/package.json
CHANGED
package/umd/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see index.js.LICENSE.txt */
|
|
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.
|
|
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.34";const b="$importmap.dat";e.IM_MAP_ID=b})(),r})());
|
package/webpack/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see index.js.LICENSE.txt */
|
|
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.
|
|
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.34";const b="$importmap.dat";e.IM_MAP_ID=b})(),module.exports=r})();
|
package/webpack-esm/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see index.mjs.LICENSE.txt */
|
|
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.
|
|
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.34";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};
|