gemi 0.53.0 → 0.54.0
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/dist/app/index.js +2 -2
- package/dist/app/index.js.map +1 -1
- package/dist/bin/gemi.js +1456 -5
- package/dist/bin/gemi.js.map +9 -5
- package/dist/broadcasting/index.js +1 -1
- package/dist/bun/plugin.js +2 -2
- package/dist/bun/plugin.js.map +1 -1
- package/dist/bun/preload.js +2 -2
- package/dist/bun/preload.js.map +1 -1
- package/dist/{chunk-msz8rngs.js → chunk-004bcmsa.js} +2 -2
- package/dist/chunk-004bcmsa.js.map +10 -0
- package/dist/chunk-07t0dmdg.js +4 -0
- package/dist/{chunk-faa987e4.js.map → chunk-07t0dmdg.js.map} +2 -2
- package/dist/{chunk-cg53h5ht.js → chunk-0weeq0ke.js} +2 -2
- package/dist/{chunk-cg53h5ht.js.map → chunk-0weeq0ke.js.map} +1 -1
- package/dist/chunk-113khwbw.js +5 -0
- package/dist/{chunk-2qn472j4.js.map → chunk-113khwbw.js.map} +1 -1
- package/dist/{chunk-tmk4zfz9.js → chunk-1sh6kqjn.js} +3 -3
- package/dist/{chunk-tmk4zfz9.js.map → chunk-1sh6kqjn.js.map} +1 -1
- package/dist/{chunk-2gw6cyyj.js → chunk-1snh7yc4.js} +2 -2
- package/dist/{chunk-2gw6cyyj.js.map → chunk-1snh7yc4.js.map} +1 -1
- package/dist/chunk-26r8dcxd.js +6 -0
- package/dist/{chunk-ffre1z8s.js.map → chunk-26r8dcxd.js.map} +2 -2
- package/dist/{chunk-ebcgdv00.js → chunk-2pt6kyn9.js} +3 -3
- package/dist/{chunk-ebcgdv00.js.map → chunk-2pt6kyn9.js.map} +1 -1
- package/dist/{chunk-1pqfmw5h.js → chunk-2zmz3pjk.js} +3 -3
- package/dist/{chunk-1pqfmw5h.js.map → chunk-2zmz3pjk.js.map} +1 -1
- package/dist/{chunk-zhsaz9cr.js → chunk-3bw1jk21.js} +1 -1
- package/dist/chunk-4qkzdyj7.js +4 -0
- package/dist/{chunk-0h3jr9d9.js.map → chunk-4qkzdyj7.js.map} +1 -1
- package/dist/{chunk-d1ahbza9.js → chunk-50vm7x98.js} +3 -3
- package/dist/{chunk-d1ahbza9.js.map → chunk-50vm7x98.js.map} +1 -1
- package/dist/{chunk-qyaqg07q.js → chunk-6j1z2cqt.js} +2 -2
- package/dist/{chunk-qyaqg07q.js.map → chunk-6j1z2cqt.js.map} +1 -1
- package/dist/chunk-6rhebm18.js +5 -0
- package/dist/chunk-6rhebm18.js.map +10 -0
- package/dist/{chunk-rq770c71.js → chunk-71m47kad.js} +2 -2
- package/dist/{chunk-rq770c71.js.map → chunk-71m47kad.js.map} +1 -1
- package/dist/{chunk-0h3jr9d9.js → chunk-7f5ad759.js} +2 -2
- package/dist/{chunk-4e61qbp4.js.map → chunk-7f5ad759.js.map} +1 -1
- package/dist/chunk-85av4ncy.js +4 -0
- package/dist/{chunk-3d3nmr5g.js.map → chunk-85av4ncy.js.map} +2 -2
- package/dist/{chunk-23g7qdpg.js → chunk-9taz1h3t.js} +3 -3
- package/dist/{chunk-23g7qdpg.js.map → chunk-9taz1h3t.js.map} +1 -1
- package/dist/{chunk-ppt296ye.js → chunk-agabw2w1.js} +2 -2
- package/dist/{chunk-ppt296ye.js.map → chunk-agabw2w1.js.map} +1 -1
- package/dist/{chunk-092pj2j2.js → chunk-bb3zvxsf.js} +3 -3
- package/dist/{chunk-092pj2j2.js.map → chunk-bb3zvxsf.js.map} +1 -1
- package/dist/{chunk-h7jv3ame.js → chunk-br8ten26.js} +2 -2
- package/dist/{chunk-h7jv3ame.js.map → chunk-br8ten26.js.map} +1 -1
- package/dist/{chunk-4e61qbp4.js → chunk-bzhtymvv.js} +2 -2
- package/dist/{chunk-8p6rqegw.js.map → chunk-bzhtymvv.js.map} +1 -1
- package/dist/{chunk-68w225rv.js → chunk-c0wcsmpj.js} +2 -2
- package/dist/{chunk-68w225rv.js.map → chunk-c0wcsmpj.js.map} +1 -1
- package/dist/{chunk-xsmt86n3.js → chunk-c22vcxty.js} +2 -2
- package/dist/{chunk-xsmt86n3.js.map → chunk-c22vcxty.js.map} +1 -1
- package/dist/{chunk-07jtzbf0.js → chunk-c2pv3ah8.js} +2 -2
- package/dist/{chunk-07jtzbf0.js.map → chunk-c2pv3ah8.js.map} +2 -2
- package/dist/{chunk-q09mmr05.js → chunk-cz3szqhq.js} +2 -2
- package/dist/{chunk-q09mmr05.js.map → chunk-cz3szqhq.js.map} +1 -1
- package/dist/{chunk-69w4egkg.js → chunk-dwx2y7br.js} +4 -4
- package/dist/{chunk-69w4egkg.js.map → chunk-dwx2y7br.js.map} +1 -1
- package/dist/{chunk-2sfz64xh.js → chunk-dxw8k6f1.js} +2 -2
- package/dist/{chunk-2sfz64xh.js.map → chunk-dxw8k6f1.js.map} +1 -1
- package/dist/chunk-e3mggavt.js +5 -0
- package/dist/chunk-e3mggavt.js.map +11 -0
- package/dist/{chunk-j1knf8gv.js → chunk-efsk1wy0.js} +3 -3
- package/dist/{chunk-j1knf8gv.js.map → chunk-efsk1wy0.js.map} +1 -1
- package/dist/{chunk-t4n25km9.js → chunk-f13f68c0.js} +2 -2
- package/dist/{chunk-t4n25km9.js.map → chunk-f13f68c0.js.map} +1 -1
- package/dist/{chunk-vv72kw74.js → chunk-f418jh9k.js} +2 -2
- package/dist/{chunk-vv72kw74.js.map → chunk-f418jh9k.js.map} +1 -1
- package/dist/chunk-f4e7fh95.js +17 -0
- package/dist/chunk-f4e7fh95.js.map +14 -0
- package/dist/{chunk-ewgv1j8q.js → chunk-fcqc3e3r.js} +2 -2
- package/dist/{chunk-ewgv1j8q.js.map → chunk-fcqc3e3r.js.map} +1 -1
- package/dist/{chunk-3y9nf09k.js → chunk-g5tj10p8.js} +2 -2
- package/dist/{chunk-3y9nf09k.js.map → chunk-g5tj10p8.js.map} +1 -1
- package/dist/chunk-gn9zjgep.js +5 -0
- package/dist/chunk-gn9zjgep.js.map +10 -0
- package/dist/{chunk-5s45prj5.js → chunk-h7mcwfg5.js} +4 -4
- package/dist/{chunk-5s45prj5.js.map → chunk-h7mcwfg5.js.map} +1 -1
- package/dist/chunk-hk067634.js +4 -0
- package/dist/{chunk-vnjvd82s.js.map → chunk-hk067634.js.map} +2 -2
- package/dist/{chunk-qx6sahe0.js → chunk-hrrmxreg.js} +2 -2
- package/dist/{chunk-qx6sahe0.js.map → chunk-hrrmxreg.js.map} +1 -1
- package/dist/{chunk-p22rkf1g.js → chunk-jb022m7n.js} +2 -2
- package/dist/{chunk-p22rkf1g.js.map → chunk-jb022m7n.js.map} +1 -1
- package/dist/chunk-jb2nst6v.js +4 -0
- package/dist/{chunk-6scjrbw7.js.map → chunk-jb2nst6v.js.map} +2 -2
- package/dist/{chunk-kxzwem3g.js → chunk-jdgvdddd.js} +2 -2
- package/dist/{chunk-kxzwem3g.js.map → chunk-jdgvdddd.js.map} +1 -1
- package/dist/{chunk-2yth3kk2.js → chunk-jp4pf3yt.js} +4 -4
- package/dist/{chunk-2yth3kk2.js.map → chunk-jp4pf3yt.js.map} +1 -1
- package/dist/chunk-k14dmqwh.js +5 -0
- package/dist/{chunk-92793zh4.js.map → chunk-k14dmqwh.js.map} +4 -3
- package/dist/{chunk-tkv6cw94.js → chunk-k8endm5j.js} +3 -3
- package/dist/{chunk-tkv6cw94.js.map → chunk-k8endm5j.js.map} +1 -1
- package/dist/chunk-kkkqyvwv.js +81 -0
- package/dist/{chunk-ear03axe.js.map → chunk-kkkqyvwv.js.map} +7 -5
- package/dist/{chunk-cmq5t8p9.js → chunk-kv2ep453.js} +3 -3
- package/dist/{chunk-cmq5t8p9.js.map → chunk-kv2ep453.js.map} +1 -1
- package/dist/{chunk-z4q1ty6w.js → chunk-kz39hphm.js} +3 -3
- package/dist/{chunk-z4q1ty6w.js.map → chunk-kz39hphm.js.map} +1 -1
- package/dist/{chunk-kaxvw75w.js → chunk-ms8qd7da.js} +3 -3
- package/dist/{chunk-kaxvw75w.js.map → chunk-ms8qd7da.js.map} +1 -1
- package/dist/{chunk-ttzkn1qd.js → chunk-n1tkn8gv.js} +2 -2
- package/dist/{chunk-ttzkn1qd.js.map → chunk-n1tkn8gv.js.map} +1 -1
- package/dist/chunk-nncwsdzz.js +5 -0
- package/dist/chunk-nncwsdzz.js.map +10 -0
- package/dist/{chunk-7s1g3v1y.js → chunk-pgjk5ft3.js} +3 -3
- package/dist/{chunk-7s1g3v1y.js.map → chunk-pgjk5ft3.js.map} +1 -1
- package/dist/{chunk-tztqkat2.js → chunk-r06rxn19.js} +2 -2
- package/dist/{chunk-tztqkat2.js.map → chunk-r06rxn19.js.map} +1 -1
- package/dist/chunk-r9z5rrk0.js +4 -0
- package/dist/{chunk-1ab1ptq5.js.map → chunk-r9z5rrk0.js.map} +2 -2
- package/dist/{chunk-h5g05qwb.js → chunk-s6e7cvek.js} +2 -2
- package/dist/{chunk-h5g05qwb.js.map → chunk-s6e7cvek.js.map} +1 -1
- package/dist/{chunk-qjnv2rkh.js → chunk-sqp7kn7h.js} +3 -3
- package/dist/{chunk-qjnv2rkh.js.map → chunk-sqp7kn7h.js.map} +1 -1
- package/dist/{chunk-mt2755rs.js → chunk-w6gb9gc5.js} +3 -3
- package/dist/{chunk-mt2755rs.js.map → chunk-w6gb9gc5.js.map} +1 -1
- package/dist/{chunk-ha7n1c94.js → chunk-xxw0gz4q.js} +2 -2
- package/dist/{chunk-ha7n1c94.js.map → chunk-xxw0gz4q.js.map} +1 -1
- package/dist/chunk-ywr2vd5r.js +5 -0
- package/dist/{chunk-9279y4af.js.map → chunk-ywr2vd5r.js.map} +2 -2
- package/dist/{chunk-fbp5vapa.js → chunk-zckj6bs6.js} +3 -3
- package/dist/{chunk-fbp5vapa.js.map → chunk-zckj6bs6.js.map} +2 -2
- package/dist/chunks/{ThemeProvider-CTX9LOFC.js → ThemeProvider-Bk1eZymb.js} +186 -3
- package/dist/chunks/ThemeProvider-Bk1eZymb.js.map +1 -0
- package/dist/client/ComponentContext.d.ts.map +1 -1
- package/dist/client/DictionarySinkContext.d.ts +10 -0
- package/dist/client/DictionarySinkContext.d.ts.map +1 -0
- package/dist/client/createRoot.d.ts.map +1 -1
- package/dist/client/index.d.ts +2 -0
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +187 -8
- package/dist/client/index.js.map +1 -1
- package/dist/client/useDictionary.d.ts +34 -0
- package/dist/client/useDictionary.d.ts.map +1 -0
- package/dist/client/useDictionary.test-d.d.ts +2 -0
- package/dist/client/useDictionary.test-d.d.ts.map +1 -0
- package/dist/client/useTranslator.d.ts +8 -0
- package/dist/client/useTranslator.d.ts.map +1 -1
- package/dist/config/index.js +1 -1
- package/dist/console/run.js +2 -2
- package/dist/console/run.js.map +1 -1
- package/dist/container/index.js +2 -2
- package/dist/container/index.js.map +1 -1
- package/dist/database/index.js +2 -2
- package/dist/database/index.js.map +1 -1
- package/dist/email/index.js +2 -2
- package/dist/email/index.js.map +1 -1
- package/dist/facades/Lang.d.ts.map +1 -1
- package/dist/facades/index.js +2 -2
- package/dist/facades/index.js.map +1 -1
- package/dist/foundation/index.js +2 -2
- package/dist/foundation/index.js.map +1 -1
- package/dist/http/index.js +2 -2
- package/dist/http/index.js.map +1 -1
- package/dist/i18n/Dictionary.d.ts +7 -0
- package/dist/i18n/Dictionary.d.ts.map +1 -1
- package/dist/i18n/Translator.d.ts +12 -0
- package/dist/i18n/Translator.d.ts.map +1 -1
- package/dist/i18n/config.d.ts +6 -0
- package/dist/i18n/config.d.ts.map +1 -1
- package/dist/i18n/defineDictionary.d.ts +65 -0
- package/dist/i18n/defineDictionary.d.ts.map +1 -0
- package/dist/i18n/dictionaryRegistry.d.ts +85 -0
- package/dist/i18n/dictionaryRegistry.d.ts.map +1 -0
- package/dist/i18n/dictionaryRuntime.d.ts +16 -0
- package/dist/i18n/dictionaryRuntime.d.ts.map +1 -0
- package/dist/i18n/dictionaryRuntime.js +4 -0
- package/dist/i18n/dictionaryRuntime.js.map +9 -0
- package/dist/i18n/dictionaryShape.d.ts +66 -0
- package/dist/i18n/dictionaryShape.d.ts.map +1 -0
- package/dist/i18n/dictionarySink.d.ts +31 -0
- package/dist/i18n/dictionarySink.d.ts.map +1 -0
- package/dist/i18n/index.d.ts +3 -0
- package/dist/i18n/index.d.ts.map +1 -1
- package/dist/i18n/index.js +2 -2
- package/dist/i18n/index.js.map +5 -4
- package/dist/i18n/translate.d.ts +21 -0
- package/dist/i18n/translate.d.ts.map +1 -0
- package/dist/internal/gemiExternals.d.ts +1 -1
- package/dist/internal/gemiExternals.d.ts.map +1 -1
- package/dist/kernel/index.js +2 -2
- package/dist/kernel/index.js.map +2 -2
- package/dist/orm/index.js +2 -2
- package/dist/orm/index.js.map +2 -2
- package/dist/server/index.js +2 -2
- package/dist/server/index.js.map +1 -1
- package/dist/services/index.js +4 -4
- package/dist/services/index.js.map +2 -2
- package/dist/services/router/ViewRouteDispatcher.d.ts.map +1 -1
- package/dist/services/router/streamQueryInjection.d.ts +9 -1
- package/dist/services/router/streamQueryInjection.d.ts.map +1 -1
- package/dist/support/index.js +2 -2
- package/dist/support/index.js.map +1 -1
- package/dist/testing/index.js +1 -1
- package/dist/vite/__vite-browser-external-S5EYS4bz.mjs +7 -0
- package/dist/vite/api_vite-DSBC5Nzy.mjs +5 -0
- package/dist/vite/browser-DFEUWTkA.mjs +6086 -0
- package/dist/vite/build-C0lmnz6d.mjs +5326 -0
- package/dist/vite/index.mjs +1349 -1
- package/dist/vite/lib-TT6NqN6b.mjs +363 -0
- package/dist/vite/lib-U4DF62jt.mjs +48846 -0
- package/dist/vite/main-Drp2rSLR.mjs +2123 -0
- package/dist/vite/node-BgyIm-M7.mjs +17799 -0
- package/dist/vite/node-yGkKTK1d.mjs +789 -0
- package/dist/vite/postcss-hCXrlC4m.mjs +3515 -0
- package/dist/vite/postcss-import-rYEe0OKc.mjs +448 -0
- package/dist/vite/prompt--dNycKSZ-BmZ8jzP_.mjs +889 -0
- package/dist/vite/rolldown-runtime-B4lejLz5.mjs +37 -0
- package/package.json +3 -1
- package/dist/chunk-1ab1ptq5.js +0 -4
- package/dist/chunk-2qn472j4.js +0 -5
- package/dist/chunk-3d3nmr5g.js +0 -4
- package/dist/chunk-6scjrbw7.js +0 -4
- package/dist/chunk-88pq4gmf.js +0 -5
- package/dist/chunk-88pq4gmf.js.map +0 -10
- package/dist/chunk-8p6rqegw.js +0 -4
- package/dist/chunk-92793zh4.js +0 -5
- package/dist/chunk-9279y4af.js +0 -5
- package/dist/chunk-bq4w14a6.js +0 -5
- package/dist/chunk-bq4w14a6.js.map +0 -10
- package/dist/chunk-ear03axe.js +0 -81
- package/dist/chunk-faa987e4.js +0 -4
- package/dist/chunk-ffre1z8s.js +0 -6
- package/dist/chunk-msz8rngs.js.map +0 -10
- package/dist/chunk-vnjvd82s.js +0 -4
- package/dist/chunk-xw44bwnh.js +0 -5
- package/dist/chunk-xw44bwnh.js.map +0 -11
- package/dist/chunk-y4djde42.js +0 -5
- package/dist/chunk-y4djde42.js.map +0 -11
- package/dist/chunks/ThemeProvider-CTX9LOFC.js.map +0 -1
- /package/dist/{chunk-zhsaz9cr.js.map → chunk-3bw1jk21.js.map} +0 -0
|
@@ -0,0 +1,789 @@
|
|
|
1
|
+
import { i as __toESM, r as __require, t as __commonJSMin } from "./rolldown-runtime-B4lejLz5.mjs";
|
|
2
|
+
import { t as require___vite_browser_external } from "./__vite-browser-external-S5EYS4bz.mjs";
|
|
3
|
+
//#region ../../node_modules/.bun/detect-libc@2.1.2/node_modules/detect-libc/lib/process.js
|
|
4
|
+
var require_process = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
5
|
+
var isLinux = () => process.platform === "linux";
|
|
6
|
+
var report = null;
|
|
7
|
+
var getReport = () => {
|
|
8
|
+
if (!report)
|
|
9
|
+
/* istanbul ignore next */
|
|
10
|
+
if (isLinux() && process.report) {
|
|
11
|
+
const orig = process.report.excludeNetwork;
|
|
12
|
+
process.report.excludeNetwork = true;
|
|
13
|
+
report = process.report.getReport();
|
|
14
|
+
process.report.excludeNetwork = orig;
|
|
15
|
+
} else report = {};
|
|
16
|
+
return report;
|
|
17
|
+
};
|
|
18
|
+
module.exports = {
|
|
19
|
+
isLinux,
|
|
20
|
+
getReport
|
|
21
|
+
};
|
|
22
|
+
}));
|
|
23
|
+
//#endregion
|
|
24
|
+
//#region ../../node_modules/.bun/detect-libc@2.1.2/node_modules/detect-libc/lib/filesystem.js
|
|
25
|
+
var require_filesystem = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
26
|
+
var fs = require___vite_browser_external();
|
|
27
|
+
var LDD_PATH = "/usr/bin/ldd";
|
|
28
|
+
var SELF_PATH = "/proc/self/exe";
|
|
29
|
+
var MAX_LENGTH = 2048;
|
|
30
|
+
/**
|
|
31
|
+
* Read the content of a file synchronous
|
|
32
|
+
*
|
|
33
|
+
* @param {string} path
|
|
34
|
+
* @returns {Buffer}
|
|
35
|
+
*/
|
|
36
|
+
var readFileSync = (path) => {
|
|
37
|
+
const fd = fs.openSync(path, "r");
|
|
38
|
+
const buffer = Buffer.alloc(MAX_LENGTH);
|
|
39
|
+
const bytesRead = fs.readSync(fd, buffer, 0, MAX_LENGTH, 0);
|
|
40
|
+
fs.close(fd, () => {});
|
|
41
|
+
return buffer.subarray(0, bytesRead);
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Read the content of a file
|
|
45
|
+
*
|
|
46
|
+
* @param {string} path
|
|
47
|
+
* @returns {Promise<Buffer>}
|
|
48
|
+
*/
|
|
49
|
+
var readFile = (path) => new Promise((resolve, reject) => {
|
|
50
|
+
fs.open(path, "r", (err, fd) => {
|
|
51
|
+
if (err) reject(err);
|
|
52
|
+
else {
|
|
53
|
+
const buffer = Buffer.alloc(MAX_LENGTH);
|
|
54
|
+
fs.read(fd, buffer, 0, MAX_LENGTH, 0, (_, bytesRead) => {
|
|
55
|
+
resolve(buffer.subarray(0, bytesRead));
|
|
56
|
+
fs.close(fd, () => {});
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
module.exports = {
|
|
62
|
+
LDD_PATH,
|
|
63
|
+
SELF_PATH,
|
|
64
|
+
readFileSync,
|
|
65
|
+
readFile
|
|
66
|
+
};
|
|
67
|
+
}));
|
|
68
|
+
//#endregion
|
|
69
|
+
//#region ../../node_modules/.bun/detect-libc@2.1.2/node_modules/detect-libc/lib/elf.js
|
|
70
|
+
var require_elf = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
71
|
+
var interpreterPath = (elf) => {
|
|
72
|
+
if (elf.length < 64) return null;
|
|
73
|
+
if (elf.readUInt32BE(0) !== 2135247942) return null;
|
|
74
|
+
if (elf.readUInt8(4) !== 2) return null;
|
|
75
|
+
if (elf.readUInt8(5) !== 1) return null;
|
|
76
|
+
const offset = elf.readUInt32LE(32);
|
|
77
|
+
const size = elf.readUInt16LE(54);
|
|
78
|
+
const count = elf.readUInt16LE(56);
|
|
79
|
+
for (let i = 0; i < count; i++) {
|
|
80
|
+
const headerOffset = offset + i * size;
|
|
81
|
+
if (elf.readUInt32LE(headerOffset) === 3) {
|
|
82
|
+
const fileOffset = elf.readUInt32LE(headerOffset + 8);
|
|
83
|
+
const fileSize = elf.readUInt32LE(headerOffset + 32);
|
|
84
|
+
return elf.subarray(fileOffset, fileOffset + fileSize).toString().replace(/\0.*$/g, "");
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return null;
|
|
88
|
+
};
|
|
89
|
+
module.exports = { interpreterPath };
|
|
90
|
+
}));
|
|
91
|
+
//#endregion
|
|
92
|
+
//#region ../../node_modules/.bun/detect-libc@2.1.2/node_modules/detect-libc/lib/detect-libc.js
|
|
93
|
+
var require_detect_libc = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
94
|
+
var childProcess = require___vite_browser_external();
|
|
95
|
+
var { isLinux, getReport } = require_process();
|
|
96
|
+
var { LDD_PATH, SELF_PATH, readFile, readFileSync } = require_filesystem();
|
|
97
|
+
var { interpreterPath } = require_elf();
|
|
98
|
+
var cachedFamilyInterpreter;
|
|
99
|
+
var cachedFamilyFilesystem;
|
|
100
|
+
var cachedVersionFilesystem;
|
|
101
|
+
var command = "getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true";
|
|
102
|
+
var commandOut = "";
|
|
103
|
+
var safeCommand = () => {
|
|
104
|
+
if (!commandOut) return new Promise((resolve) => {
|
|
105
|
+
childProcess.exec(command, (err, out) => {
|
|
106
|
+
commandOut = err ? " " : out;
|
|
107
|
+
resolve(commandOut);
|
|
108
|
+
});
|
|
109
|
+
});
|
|
110
|
+
return commandOut;
|
|
111
|
+
};
|
|
112
|
+
var safeCommandSync = () => {
|
|
113
|
+
if (!commandOut) try {
|
|
114
|
+
commandOut = childProcess.execSync(command, { encoding: "utf8" });
|
|
115
|
+
} catch (_err) {
|
|
116
|
+
commandOut = " ";
|
|
117
|
+
}
|
|
118
|
+
return commandOut;
|
|
119
|
+
};
|
|
120
|
+
/**
|
|
121
|
+
* A String constant containing the value `glibc`.
|
|
122
|
+
* @type {string}
|
|
123
|
+
* @public
|
|
124
|
+
*/
|
|
125
|
+
var GLIBC = "glibc";
|
|
126
|
+
/**
|
|
127
|
+
* A Regexp constant to get the GLIBC Version.
|
|
128
|
+
* @type {string}
|
|
129
|
+
*/
|
|
130
|
+
var RE_GLIBC_VERSION = /LIBC[a-z0-9 \-).]*?(\d+\.\d+)/i;
|
|
131
|
+
/**
|
|
132
|
+
* A String constant containing the value `musl`.
|
|
133
|
+
* @type {string}
|
|
134
|
+
* @public
|
|
135
|
+
*/
|
|
136
|
+
var MUSL = "musl";
|
|
137
|
+
var isFileMusl = (f) => f.includes("libc.musl-") || f.includes("ld-musl-");
|
|
138
|
+
var familyFromReport = () => {
|
|
139
|
+
const report = getReport();
|
|
140
|
+
if (report.header && report.header.glibcVersionRuntime) return GLIBC;
|
|
141
|
+
if (Array.isArray(report.sharedObjects)) {
|
|
142
|
+
if (report.sharedObjects.some(isFileMusl)) return MUSL;
|
|
143
|
+
}
|
|
144
|
+
return null;
|
|
145
|
+
};
|
|
146
|
+
var familyFromCommand = (out) => {
|
|
147
|
+
const [getconf, ldd1] = out.split(/[\r\n]+/);
|
|
148
|
+
if (getconf && getconf.includes(GLIBC)) return GLIBC;
|
|
149
|
+
if (ldd1 && ldd1.includes(MUSL)) return MUSL;
|
|
150
|
+
return null;
|
|
151
|
+
};
|
|
152
|
+
var familyFromInterpreterPath = (path) => {
|
|
153
|
+
if (path) {
|
|
154
|
+
if (path.includes("/ld-musl-")) return MUSL;
|
|
155
|
+
else if (path.includes("/ld-linux-")) return GLIBC;
|
|
156
|
+
}
|
|
157
|
+
return null;
|
|
158
|
+
};
|
|
159
|
+
var getFamilyFromLddContent = (content) => {
|
|
160
|
+
content = content.toString();
|
|
161
|
+
if (content.includes("musl")) return MUSL;
|
|
162
|
+
if (content.includes("GNU C Library")) return GLIBC;
|
|
163
|
+
return null;
|
|
164
|
+
};
|
|
165
|
+
var familyFromFilesystem = async () => {
|
|
166
|
+
if (cachedFamilyFilesystem !== void 0) return cachedFamilyFilesystem;
|
|
167
|
+
cachedFamilyFilesystem = null;
|
|
168
|
+
try {
|
|
169
|
+
cachedFamilyFilesystem = getFamilyFromLddContent(await readFile(LDD_PATH));
|
|
170
|
+
} catch (e) {}
|
|
171
|
+
return cachedFamilyFilesystem;
|
|
172
|
+
};
|
|
173
|
+
var familyFromFilesystemSync = () => {
|
|
174
|
+
if (cachedFamilyFilesystem !== void 0) return cachedFamilyFilesystem;
|
|
175
|
+
cachedFamilyFilesystem = null;
|
|
176
|
+
try {
|
|
177
|
+
cachedFamilyFilesystem = getFamilyFromLddContent(readFileSync(LDD_PATH));
|
|
178
|
+
} catch (e) {}
|
|
179
|
+
return cachedFamilyFilesystem;
|
|
180
|
+
};
|
|
181
|
+
var familyFromInterpreter = async () => {
|
|
182
|
+
if (cachedFamilyInterpreter !== void 0) return cachedFamilyInterpreter;
|
|
183
|
+
cachedFamilyInterpreter = null;
|
|
184
|
+
try {
|
|
185
|
+
cachedFamilyInterpreter = familyFromInterpreterPath(interpreterPath(await readFile(SELF_PATH)));
|
|
186
|
+
} catch (e) {}
|
|
187
|
+
return cachedFamilyInterpreter;
|
|
188
|
+
};
|
|
189
|
+
var familyFromInterpreterSync = () => {
|
|
190
|
+
if (cachedFamilyInterpreter !== void 0) return cachedFamilyInterpreter;
|
|
191
|
+
cachedFamilyInterpreter = null;
|
|
192
|
+
try {
|
|
193
|
+
cachedFamilyInterpreter = familyFromInterpreterPath(interpreterPath(readFileSync(SELF_PATH)));
|
|
194
|
+
} catch (e) {}
|
|
195
|
+
return cachedFamilyInterpreter;
|
|
196
|
+
};
|
|
197
|
+
/**
|
|
198
|
+
* Resolves with the libc family when it can be determined, `null` otherwise.
|
|
199
|
+
* @returns {Promise<?string>}
|
|
200
|
+
*/
|
|
201
|
+
var family = async () => {
|
|
202
|
+
let family = null;
|
|
203
|
+
if (isLinux()) {
|
|
204
|
+
family = await familyFromInterpreter();
|
|
205
|
+
if (!family) {
|
|
206
|
+
family = await familyFromFilesystem();
|
|
207
|
+
if (!family) family = familyFromReport();
|
|
208
|
+
if (!family) family = familyFromCommand(await safeCommand());
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
return family;
|
|
212
|
+
};
|
|
213
|
+
/**
|
|
214
|
+
* Returns the libc family when it can be determined, `null` otherwise.
|
|
215
|
+
* @returns {?string}
|
|
216
|
+
*/
|
|
217
|
+
var familySync = () => {
|
|
218
|
+
let family = null;
|
|
219
|
+
if (isLinux()) {
|
|
220
|
+
family = familyFromInterpreterSync();
|
|
221
|
+
if (!family) {
|
|
222
|
+
family = familyFromFilesystemSync();
|
|
223
|
+
if (!family) family = familyFromReport();
|
|
224
|
+
if (!family) family = familyFromCommand(safeCommandSync());
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
return family;
|
|
228
|
+
};
|
|
229
|
+
/**
|
|
230
|
+
* Resolves `true` only when the platform is Linux and the libc family is not `glibc`.
|
|
231
|
+
* @returns {Promise<boolean>}
|
|
232
|
+
*/
|
|
233
|
+
var isNonGlibcLinux = async () => isLinux() && await family() !== GLIBC;
|
|
234
|
+
/**
|
|
235
|
+
* Returns `true` only when the platform is Linux and the libc family is not `glibc`.
|
|
236
|
+
* @returns {boolean}
|
|
237
|
+
*/
|
|
238
|
+
var isNonGlibcLinuxSync = () => isLinux() && familySync() !== GLIBC;
|
|
239
|
+
var versionFromFilesystem = async () => {
|
|
240
|
+
if (cachedVersionFilesystem !== void 0) return cachedVersionFilesystem;
|
|
241
|
+
cachedVersionFilesystem = null;
|
|
242
|
+
try {
|
|
243
|
+
const versionMatch = (await readFile(LDD_PATH)).match(RE_GLIBC_VERSION);
|
|
244
|
+
if (versionMatch) cachedVersionFilesystem = versionMatch[1];
|
|
245
|
+
} catch (e) {}
|
|
246
|
+
return cachedVersionFilesystem;
|
|
247
|
+
};
|
|
248
|
+
var versionFromFilesystemSync = () => {
|
|
249
|
+
if (cachedVersionFilesystem !== void 0) return cachedVersionFilesystem;
|
|
250
|
+
cachedVersionFilesystem = null;
|
|
251
|
+
try {
|
|
252
|
+
const versionMatch = readFileSync(LDD_PATH).match(RE_GLIBC_VERSION);
|
|
253
|
+
if (versionMatch) cachedVersionFilesystem = versionMatch[1];
|
|
254
|
+
} catch (e) {}
|
|
255
|
+
return cachedVersionFilesystem;
|
|
256
|
+
};
|
|
257
|
+
var versionFromReport = () => {
|
|
258
|
+
const report = getReport();
|
|
259
|
+
if (report.header && report.header.glibcVersionRuntime) return report.header.glibcVersionRuntime;
|
|
260
|
+
return null;
|
|
261
|
+
};
|
|
262
|
+
var versionSuffix = (s) => s.trim().split(/\s+/)[1];
|
|
263
|
+
var versionFromCommand = (out) => {
|
|
264
|
+
const [getconf, ldd1, ldd2] = out.split(/[\r\n]+/);
|
|
265
|
+
if (getconf && getconf.includes(GLIBC)) return versionSuffix(getconf);
|
|
266
|
+
if (ldd1 && ldd2 && ldd1.includes(MUSL)) return versionSuffix(ldd2);
|
|
267
|
+
return null;
|
|
268
|
+
};
|
|
269
|
+
/**
|
|
270
|
+
* Resolves with the libc version when it can be determined, `null` otherwise.
|
|
271
|
+
* @returns {Promise<?string>}
|
|
272
|
+
*/
|
|
273
|
+
var version = async () => {
|
|
274
|
+
let version = null;
|
|
275
|
+
if (isLinux()) {
|
|
276
|
+
version = await versionFromFilesystem();
|
|
277
|
+
if (!version) version = versionFromReport();
|
|
278
|
+
if (!version) version = versionFromCommand(await safeCommand());
|
|
279
|
+
}
|
|
280
|
+
return version;
|
|
281
|
+
};
|
|
282
|
+
/**
|
|
283
|
+
* Returns the libc version when it can be determined, `null` otherwise.
|
|
284
|
+
* @returns {?string}
|
|
285
|
+
*/
|
|
286
|
+
var versionSync = () => {
|
|
287
|
+
let version = null;
|
|
288
|
+
if (isLinux()) {
|
|
289
|
+
version = versionFromFilesystemSync();
|
|
290
|
+
if (!version) version = versionFromReport();
|
|
291
|
+
if (!version) version = versionFromCommand(safeCommandSync());
|
|
292
|
+
}
|
|
293
|
+
return version;
|
|
294
|
+
};
|
|
295
|
+
module.exports = {
|
|
296
|
+
GLIBC,
|
|
297
|
+
MUSL,
|
|
298
|
+
family,
|
|
299
|
+
familySync,
|
|
300
|
+
isNonGlibcLinux,
|
|
301
|
+
isNonGlibcLinuxSync,
|
|
302
|
+
version,
|
|
303
|
+
versionSync
|
|
304
|
+
};
|
|
305
|
+
}));
|
|
306
|
+
//#endregion
|
|
307
|
+
//#region ../../node_modules/.bun/lightningcss@1.32.0/node_modules/lightningcss/node/browserslistToTargets.js
|
|
308
|
+
var require_browserslistToTargets = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
309
|
+
var BROWSER_MAPPING = {
|
|
310
|
+
and_chr: "chrome",
|
|
311
|
+
and_ff: "firefox",
|
|
312
|
+
ie_mob: "ie",
|
|
313
|
+
op_mob: "opera",
|
|
314
|
+
and_qq: null,
|
|
315
|
+
and_uc: null,
|
|
316
|
+
baidu: null,
|
|
317
|
+
bb: null,
|
|
318
|
+
kaios: null,
|
|
319
|
+
op_mini: null
|
|
320
|
+
};
|
|
321
|
+
function browserslistToTargets(browserslist) {
|
|
322
|
+
let targets = {};
|
|
323
|
+
for (let browser of browserslist) {
|
|
324
|
+
let [name, v] = browser.split(" ");
|
|
325
|
+
if (BROWSER_MAPPING[name] === null) continue;
|
|
326
|
+
let version = parseVersion(v);
|
|
327
|
+
if (version == null) continue;
|
|
328
|
+
if (targets[name] == null || version < targets[name]) targets[name] = version;
|
|
329
|
+
}
|
|
330
|
+
return targets;
|
|
331
|
+
}
|
|
332
|
+
function parseVersion(version) {
|
|
333
|
+
let [major, minor = 0, patch = 0] = version.split("-")[0].split(".").map((v) => parseInt(v, 10));
|
|
334
|
+
if (isNaN(major) || isNaN(minor) || isNaN(patch)) return null;
|
|
335
|
+
return major << 16 | minor << 8 | patch;
|
|
336
|
+
}
|
|
337
|
+
module.exports = browserslistToTargets;
|
|
338
|
+
}));
|
|
339
|
+
//#endregion
|
|
340
|
+
//#region ../../node_modules/.bun/lightningcss@1.32.0/node_modules/lightningcss/node/composeVisitors.js
|
|
341
|
+
var require_composeVisitors = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
342
|
+
/** @typedef {import('./index').Visitor} Visitor */
|
|
343
|
+
/** @typedef {import('./index').VisitorFunction} VisitorFunction */
|
|
344
|
+
/**
|
|
345
|
+
* Composes multiple visitor objects into a single one.
|
|
346
|
+
* @param {(Visitor | VisitorFunction)[]} visitors
|
|
347
|
+
* @return {Visitor | VisitorFunction}
|
|
348
|
+
*/
|
|
349
|
+
function composeVisitors(visitors) {
|
|
350
|
+
if (visitors.length === 1) return visitors[0];
|
|
351
|
+
if (visitors.some((v) => typeof v === "function")) return (opts) => {
|
|
352
|
+
return composeVisitors(visitors.map((v) => typeof v === "function" ? v(opts) : v));
|
|
353
|
+
};
|
|
354
|
+
/** @type Visitor */
|
|
355
|
+
let res = {};
|
|
356
|
+
composeSimpleVisitors(res, visitors, "StyleSheet");
|
|
357
|
+
composeSimpleVisitors(res, visitors, "StyleSheetExit");
|
|
358
|
+
composeObjectVisitors(res, visitors, "Rule", ruleVisitor, wrapCustomAndUnknownAtRule);
|
|
359
|
+
composeObjectVisitors(res, visitors, "RuleExit", ruleVisitor, wrapCustomAndUnknownAtRule);
|
|
360
|
+
composeObjectVisitors(res, visitors, "Declaration", declarationVisitor, wrapCustomProperty);
|
|
361
|
+
composeObjectVisitors(res, visitors, "DeclarationExit", declarationVisitor, wrapCustomProperty);
|
|
362
|
+
composeSimpleVisitors(res, visitors, "Url");
|
|
363
|
+
composeSimpleVisitors(res, visitors, "Color");
|
|
364
|
+
composeSimpleVisitors(res, visitors, "Image");
|
|
365
|
+
composeSimpleVisitors(res, visitors, "ImageExit");
|
|
366
|
+
composeSimpleVisitors(res, visitors, "Length");
|
|
367
|
+
composeSimpleVisitors(res, visitors, "Angle");
|
|
368
|
+
composeSimpleVisitors(res, visitors, "Ratio");
|
|
369
|
+
composeSimpleVisitors(res, visitors, "Resolution");
|
|
370
|
+
composeSimpleVisitors(res, visitors, "Time");
|
|
371
|
+
composeSimpleVisitors(res, visitors, "CustomIdent");
|
|
372
|
+
composeSimpleVisitors(res, visitors, "DashedIdent");
|
|
373
|
+
composeArrayFunctions(res, visitors, "MediaQuery");
|
|
374
|
+
composeArrayFunctions(res, visitors, "MediaQueryExit");
|
|
375
|
+
composeSimpleVisitors(res, visitors, "SupportsCondition");
|
|
376
|
+
composeSimpleVisitors(res, visitors, "SupportsConditionExit");
|
|
377
|
+
composeArrayFunctions(res, visitors, "Selector");
|
|
378
|
+
composeTokenVisitors(res, visitors, "Token", "token", false);
|
|
379
|
+
composeTokenVisitors(res, visitors, "Function", "function", false);
|
|
380
|
+
composeTokenVisitors(res, visitors, "FunctionExit", "function", true);
|
|
381
|
+
composeTokenVisitors(res, visitors, "Variable", "var", false);
|
|
382
|
+
composeTokenVisitors(res, visitors, "VariableExit", "var", true);
|
|
383
|
+
composeTokenVisitors(res, visitors, "EnvironmentVariable", "env", false);
|
|
384
|
+
composeTokenVisitors(res, visitors, "EnvironmentVariableExit", "env", true);
|
|
385
|
+
return res;
|
|
386
|
+
}
|
|
387
|
+
module.exports = composeVisitors;
|
|
388
|
+
function wrapCustomAndUnknownAtRule(k, f) {
|
|
389
|
+
if (k === "unknown") return ((value) => f({
|
|
390
|
+
type: "unknown",
|
|
391
|
+
value
|
|
392
|
+
}));
|
|
393
|
+
if (k === "custom") return ((value) => f({
|
|
394
|
+
type: "custom",
|
|
395
|
+
value
|
|
396
|
+
}));
|
|
397
|
+
return f;
|
|
398
|
+
}
|
|
399
|
+
function wrapCustomProperty(k, f) {
|
|
400
|
+
return k === "custom" ? ((value) => f({
|
|
401
|
+
property: "custom",
|
|
402
|
+
value
|
|
403
|
+
})) : f;
|
|
404
|
+
}
|
|
405
|
+
/**
|
|
406
|
+
* @param {import('./index').Visitor['Rule']} f
|
|
407
|
+
* @param {import('./ast').Rule} item
|
|
408
|
+
*/
|
|
409
|
+
function ruleVisitor(f, item) {
|
|
410
|
+
if (typeof f === "object") {
|
|
411
|
+
if (item.type === "unknown") {
|
|
412
|
+
let v = f.unknown;
|
|
413
|
+
if (typeof v === "object") v = v[item.value.name];
|
|
414
|
+
return v?.(item.value);
|
|
415
|
+
}
|
|
416
|
+
if (item.type === "custom") {
|
|
417
|
+
let v = f.custom;
|
|
418
|
+
if (typeof v === "object") v = v[item.value.name];
|
|
419
|
+
return v?.(item.value);
|
|
420
|
+
}
|
|
421
|
+
return f[item.type]?.(item);
|
|
422
|
+
}
|
|
423
|
+
return f?.(item);
|
|
424
|
+
}
|
|
425
|
+
/**
|
|
426
|
+
* @param {import('./index').Visitor['Declaration']} f
|
|
427
|
+
* @param {import('./ast').Declaration} item
|
|
428
|
+
*/
|
|
429
|
+
function declarationVisitor(f, item) {
|
|
430
|
+
if (typeof f === "object") {
|
|
431
|
+
/** @type {string} */
|
|
432
|
+
let name = item.property;
|
|
433
|
+
if (item.property === "unparsed") name = item.value.propertyId.property;
|
|
434
|
+
else if (item.property === "custom") {
|
|
435
|
+
let v = f.custom;
|
|
436
|
+
if (typeof v === "object") v = v[item.value.name];
|
|
437
|
+
return v?.(item.value);
|
|
438
|
+
}
|
|
439
|
+
return f[name]?.(item);
|
|
440
|
+
}
|
|
441
|
+
return f?.(item);
|
|
442
|
+
}
|
|
443
|
+
/**
|
|
444
|
+
*
|
|
445
|
+
* @param {Visitor[]} visitors
|
|
446
|
+
* @param {string} key
|
|
447
|
+
* @returns {[any[], boolean, Set<string>]}
|
|
448
|
+
*/
|
|
449
|
+
function extractObjectsOrFunctions(visitors, key) {
|
|
450
|
+
let values = [];
|
|
451
|
+
let hasFunction = false;
|
|
452
|
+
let allKeys = /* @__PURE__ */ new Set();
|
|
453
|
+
for (let visitor of visitors) {
|
|
454
|
+
let v = visitor[key];
|
|
455
|
+
if (v) {
|
|
456
|
+
if (typeof v === "function") hasFunction = true;
|
|
457
|
+
else for (let key in v) allKeys.add(key);
|
|
458
|
+
values.push(v);
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
return [
|
|
462
|
+
values,
|
|
463
|
+
hasFunction,
|
|
464
|
+
allKeys
|
|
465
|
+
];
|
|
466
|
+
}
|
|
467
|
+
/**
|
|
468
|
+
* @template {keyof Visitor} K
|
|
469
|
+
* @param {Visitor} res
|
|
470
|
+
* @param {Visitor[]} visitors
|
|
471
|
+
* @param {K} key
|
|
472
|
+
* @param {(visitor: Visitor[K], item: any) => any | any[] | void} apply
|
|
473
|
+
* @param {(k: string, f: any) => any} wrapKey
|
|
474
|
+
*/
|
|
475
|
+
function composeObjectVisitors(res, visitors, key, apply, wrapKey) {
|
|
476
|
+
let [values, hasFunction, allKeys] = extractObjectsOrFunctions(visitors, key);
|
|
477
|
+
if (values.length === 0) return;
|
|
478
|
+
if (values.length === 1) {
|
|
479
|
+
res[key] = values[0];
|
|
480
|
+
return;
|
|
481
|
+
}
|
|
482
|
+
let f = createArrayVisitor(visitors, (visitor, item) => apply(visitor[key], item));
|
|
483
|
+
if (hasFunction) res[key] = f;
|
|
484
|
+
else {
|
|
485
|
+
/** @type {any} */
|
|
486
|
+
let v = {};
|
|
487
|
+
for (let k of allKeys) v[k] = wrapKey(k, f);
|
|
488
|
+
res[key] = v;
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
/**
|
|
492
|
+
* @param {Visitor} res
|
|
493
|
+
* @param {Visitor[]} visitors
|
|
494
|
+
* @param {string} key
|
|
495
|
+
* @param {import('./ast').TokenOrValue['type']} type
|
|
496
|
+
* @param {boolean} isExit
|
|
497
|
+
*/
|
|
498
|
+
function composeTokenVisitors(res, visitors, key, type, isExit) {
|
|
499
|
+
let [values, hasFunction, allKeys] = extractObjectsOrFunctions(visitors, key);
|
|
500
|
+
if (values.length === 0) return;
|
|
501
|
+
if (values.length === 1) {
|
|
502
|
+
res[key] = values[0];
|
|
503
|
+
return;
|
|
504
|
+
}
|
|
505
|
+
let f = createTokenVisitor(visitors, type, isExit);
|
|
506
|
+
if (hasFunction) res[key] = f;
|
|
507
|
+
else {
|
|
508
|
+
let v = {};
|
|
509
|
+
for (let key of allKeys) v[key] = f;
|
|
510
|
+
res[key] = v;
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
/**
|
|
514
|
+
* @param {Visitor[]} visitors
|
|
515
|
+
* @param {import('./ast').TokenOrValue['type']} type
|
|
516
|
+
*/
|
|
517
|
+
function createTokenVisitor(visitors, type, isExit) {
|
|
518
|
+
let v = createArrayVisitor(visitors, (visitor, item) => {
|
|
519
|
+
let f;
|
|
520
|
+
switch (item.type) {
|
|
521
|
+
case "token":
|
|
522
|
+
f = visitor.Token;
|
|
523
|
+
if (typeof f === "object") f = f[item.value.type];
|
|
524
|
+
break;
|
|
525
|
+
case "function":
|
|
526
|
+
f = isExit ? visitor.FunctionExit : visitor.Function;
|
|
527
|
+
if (typeof f === "object") f = f[item.value.name];
|
|
528
|
+
break;
|
|
529
|
+
case "var":
|
|
530
|
+
f = isExit ? visitor.VariableExit : visitor.Variable;
|
|
531
|
+
break;
|
|
532
|
+
case "env":
|
|
533
|
+
f = isExit ? visitor.EnvironmentVariableExit : visitor.EnvironmentVariable;
|
|
534
|
+
if (typeof f === "object") {
|
|
535
|
+
let name;
|
|
536
|
+
switch (item.value.name.type) {
|
|
537
|
+
case "ua":
|
|
538
|
+
case "unknown":
|
|
539
|
+
name = item.value.name.value;
|
|
540
|
+
break;
|
|
541
|
+
case "custom":
|
|
542
|
+
name = item.value.name.ident;
|
|
543
|
+
break;
|
|
544
|
+
}
|
|
545
|
+
f = f[name];
|
|
546
|
+
}
|
|
547
|
+
break;
|
|
548
|
+
case "color":
|
|
549
|
+
f = visitor.Color;
|
|
550
|
+
break;
|
|
551
|
+
case "url":
|
|
552
|
+
f = visitor.Url;
|
|
553
|
+
break;
|
|
554
|
+
case "length":
|
|
555
|
+
f = visitor.Length;
|
|
556
|
+
break;
|
|
557
|
+
case "angle":
|
|
558
|
+
f = visitor.Angle;
|
|
559
|
+
break;
|
|
560
|
+
case "time":
|
|
561
|
+
f = visitor.Time;
|
|
562
|
+
break;
|
|
563
|
+
case "resolution":
|
|
564
|
+
f = visitor.Resolution;
|
|
565
|
+
break;
|
|
566
|
+
case "dashed-ident":
|
|
567
|
+
f = visitor.DashedIdent;
|
|
568
|
+
break;
|
|
569
|
+
}
|
|
570
|
+
if (!f) return;
|
|
571
|
+
let res = f(item.value);
|
|
572
|
+
switch (item.type) {
|
|
573
|
+
case "color":
|
|
574
|
+
case "url":
|
|
575
|
+
case "length":
|
|
576
|
+
case "angle":
|
|
577
|
+
case "time":
|
|
578
|
+
case "resolution":
|
|
579
|
+
case "dashed-ident":
|
|
580
|
+
if (Array.isArray(res)) res = res.map((value) => ({
|
|
581
|
+
type: item.type,
|
|
582
|
+
value
|
|
583
|
+
}));
|
|
584
|
+
else if (res) res = {
|
|
585
|
+
type: item.type,
|
|
586
|
+
value: res
|
|
587
|
+
};
|
|
588
|
+
break;
|
|
589
|
+
}
|
|
590
|
+
return res;
|
|
591
|
+
});
|
|
592
|
+
return (value) => v({
|
|
593
|
+
type,
|
|
594
|
+
value
|
|
595
|
+
});
|
|
596
|
+
}
|
|
597
|
+
/**
|
|
598
|
+
* @param {Visitor[]} visitors
|
|
599
|
+
* @param {string} key
|
|
600
|
+
*/
|
|
601
|
+
function extractFunctions(visitors, key) {
|
|
602
|
+
let functions = [];
|
|
603
|
+
for (let visitor of visitors) {
|
|
604
|
+
let f = visitor[key];
|
|
605
|
+
if (f) functions.push(f);
|
|
606
|
+
}
|
|
607
|
+
return functions;
|
|
608
|
+
}
|
|
609
|
+
/**
|
|
610
|
+
* @param {Visitor} res
|
|
611
|
+
* @param {Visitor[]} visitors
|
|
612
|
+
* @param {string} key
|
|
613
|
+
*/
|
|
614
|
+
function composeSimpleVisitors(res, visitors, key) {
|
|
615
|
+
let functions = extractFunctions(visitors, key);
|
|
616
|
+
if (functions.length === 0) return;
|
|
617
|
+
if (functions.length === 1) {
|
|
618
|
+
res[key] = functions[0];
|
|
619
|
+
return;
|
|
620
|
+
}
|
|
621
|
+
res[key] = (arg) => {
|
|
622
|
+
let mutated = false;
|
|
623
|
+
for (let f of functions) {
|
|
624
|
+
let res = f(arg);
|
|
625
|
+
if (res) {
|
|
626
|
+
arg = res;
|
|
627
|
+
mutated = true;
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
return mutated ? arg : void 0;
|
|
631
|
+
};
|
|
632
|
+
}
|
|
633
|
+
/**
|
|
634
|
+
* @param {Visitor} res
|
|
635
|
+
* @param {Visitor[]} visitors
|
|
636
|
+
* @param {string} key
|
|
637
|
+
*/
|
|
638
|
+
function composeArrayFunctions(res, visitors, key) {
|
|
639
|
+
let functions = extractFunctions(visitors, key);
|
|
640
|
+
if (functions.length === 0) return;
|
|
641
|
+
if (functions.length === 1) {
|
|
642
|
+
res[key] = functions[0];
|
|
643
|
+
return;
|
|
644
|
+
}
|
|
645
|
+
res[key] = createArrayVisitor(functions, (f, item) => f(item));
|
|
646
|
+
}
|
|
647
|
+
/**
|
|
648
|
+
* @template T
|
|
649
|
+
* @template V
|
|
650
|
+
* @param {T[]} visitors
|
|
651
|
+
* @param {(visitor: T, item: V) => V | V[] | void} apply
|
|
652
|
+
* @returns {(item: V) => V | V[] | void}
|
|
653
|
+
*/
|
|
654
|
+
function createArrayVisitor(visitors, apply) {
|
|
655
|
+
let seen = new Bitset(visitors.length);
|
|
656
|
+
return (arg) => {
|
|
657
|
+
let arr = [arg];
|
|
658
|
+
let mutated = false;
|
|
659
|
+
seen.clear();
|
|
660
|
+
for (let i = 0; i < arr.length; i++) for (let v = 0; v < visitors.length && i < arr.length;) {
|
|
661
|
+
if (seen.get(v)) {
|
|
662
|
+
v++;
|
|
663
|
+
continue;
|
|
664
|
+
}
|
|
665
|
+
let item = arr[i];
|
|
666
|
+
let visitor = visitors[v];
|
|
667
|
+
let res = apply(visitor, item);
|
|
668
|
+
if (Array.isArray(res)) {
|
|
669
|
+
if (res.length === 0) arr.splice(i, 1);
|
|
670
|
+
else if (res.length === 1) arr[i] = res[0];
|
|
671
|
+
else arr.splice(i, 1, ...res);
|
|
672
|
+
mutated = true;
|
|
673
|
+
seen.set(v);
|
|
674
|
+
v = 0;
|
|
675
|
+
} else if (res) {
|
|
676
|
+
arr[i] = res;
|
|
677
|
+
mutated = true;
|
|
678
|
+
seen.set(v);
|
|
679
|
+
v = 0;
|
|
680
|
+
} else v++;
|
|
681
|
+
}
|
|
682
|
+
if (!mutated) return;
|
|
683
|
+
return arr.length === 1 ? arr[0] : arr;
|
|
684
|
+
};
|
|
685
|
+
}
|
|
686
|
+
var Bitset = class {
|
|
687
|
+
constructor(maxBits = 32) {
|
|
688
|
+
this.bits = 0;
|
|
689
|
+
this.more = maxBits > 32 ? new Uint32Array(Math.ceil((maxBits - 32) / 32)) : null;
|
|
690
|
+
}
|
|
691
|
+
/** @param {number} bit */
|
|
692
|
+
get(bit) {
|
|
693
|
+
if (bit >= 32 && this.more) {
|
|
694
|
+
let i = Math.floor((bit - 32) / 32);
|
|
695
|
+
let b = bit % 32;
|
|
696
|
+
return Boolean(this.more[i] & 1 << b);
|
|
697
|
+
} else return Boolean(this.bits & 1 << bit);
|
|
698
|
+
}
|
|
699
|
+
/** @param {number} bit */
|
|
700
|
+
set(bit) {
|
|
701
|
+
if (bit >= 32 && this.more) {
|
|
702
|
+
let i = Math.floor((bit - 32) / 32);
|
|
703
|
+
let b = bit % 32;
|
|
704
|
+
this.more[i] |= 1 << b;
|
|
705
|
+
} else this.bits |= 1 << bit;
|
|
706
|
+
}
|
|
707
|
+
clear() {
|
|
708
|
+
this.bits = 0;
|
|
709
|
+
if (this.more) this.more.fill(0);
|
|
710
|
+
}
|
|
711
|
+
};
|
|
712
|
+
}));
|
|
713
|
+
//#endregion
|
|
714
|
+
//#region ../../node_modules/.bun/lightningcss@1.32.0/node_modules/lightningcss/node/flags.js
|
|
715
|
+
var require_flags = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
716
|
+
exports.Features = {
|
|
717
|
+
Nesting: 1,
|
|
718
|
+
NotSelectorList: 2,
|
|
719
|
+
DirSelector: 4,
|
|
720
|
+
LangSelectorList: 8,
|
|
721
|
+
IsSelector: 16,
|
|
722
|
+
TextDecorationThicknessPercent: 32,
|
|
723
|
+
MediaIntervalSyntax: 64,
|
|
724
|
+
MediaRangeSyntax: 128,
|
|
725
|
+
CustomMediaQueries: 256,
|
|
726
|
+
ClampFunction: 512,
|
|
727
|
+
ColorFunction: 1024,
|
|
728
|
+
OklabColors: 2048,
|
|
729
|
+
LabColors: 4096,
|
|
730
|
+
P3Colors: 8192,
|
|
731
|
+
HexAlphaColors: 16384,
|
|
732
|
+
SpaceSeparatedColorNotation: 32768,
|
|
733
|
+
FontFamilySystemUi: 65536,
|
|
734
|
+
DoublePositionGradients: 131072,
|
|
735
|
+
VendorPrefixes: 262144,
|
|
736
|
+
LogicalProperties: 524288,
|
|
737
|
+
LightDark: 1048576,
|
|
738
|
+
Selectors: 31,
|
|
739
|
+
MediaQueries: 448,
|
|
740
|
+
Colors: 1113088
|
|
741
|
+
};
|
|
742
|
+
}));
|
|
743
|
+
var { transform, transformStyleAttribute, bundle, bundleAsync, browserslistToTargets, composeVisitors, Features } = (/* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
744
|
+
var parts = [process.platform, process.arch];
|
|
745
|
+
if (process.platform === "linux") {
|
|
746
|
+
const { MUSL, familySync } = require_detect_libc();
|
|
747
|
+
if (familySync() === MUSL) parts.push("musl");
|
|
748
|
+
else if (process.arch === "arm") parts.push("gnueabihf");
|
|
749
|
+
else parts.push("gnu");
|
|
750
|
+
} else if (process.platform === "win32") parts.push("msvc");
|
|
751
|
+
var native;
|
|
752
|
+
try {
|
|
753
|
+
native = __require(`lightningcss-${parts.join("-")}`);
|
|
754
|
+
} catch (err) {
|
|
755
|
+
native = __require(`../lightningcss.${parts.join("-")}.node`);
|
|
756
|
+
}
|
|
757
|
+
module.exports.transform = wrap(native.transform);
|
|
758
|
+
module.exports.transformStyleAttribute = wrap(native.transformStyleAttribute);
|
|
759
|
+
module.exports.bundle = wrap(native.bundle);
|
|
760
|
+
module.exports.bundleAsync = wrap(native.bundleAsync);
|
|
761
|
+
module.exports.browserslistToTargets = require_browserslistToTargets();
|
|
762
|
+
module.exports.composeVisitors = require_composeVisitors();
|
|
763
|
+
module.exports.Features = require_flags().Features;
|
|
764
|
+
function wrap(call) {
|
|
765
|
+
return (options) => {
|
|
766
|
+
if (typeof options.visitor === "function") {
|
|
767
|
+
let deps = [];
|
|
768
|
+
options.visitor = options.visitor({ addDependency(dep) {
|
|
769
|
+
deps.push(dep);
|
|
770
|
+
} });
|
|
771
|
+
let result = call(options);
|
|
772
|
+
if (result instanceof Promise) result = result.then((res) => {
|
|
773
|
+
if (deps.length) {
|
|
774
|
+
res.dependencies ??= [];
|
|
775
|
+
res.dependencies.push(...deps);
|
|
776
|
+
}
|
|
777
|
+
return res;
|
|
778
|
+
});
|
|
779
|
+
else if (deps.length) {
|
|
780
|
+
result.dependencies ??= [];
|
|
781
|
+
result.dependencies.push(...deps);
|
|
782
|
+
}
|
|
783
|
+
return result;
|
|
784
|
+
} else return call(options);
|
|
785
|
+
};
|
|
786
|
+
}
|
|
787
|
+
})))(), 1)).default;
|
|
788
|
+
//#endregion
|
|
789
|
+
export { Features, browserslistToTargets, bundle, bundleAsync, composeVisitors, transform, transformStyleAttribute };
|