@kizenapps/cli 0.3.0 → 0.4.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/chunk-4OYGMEFM.js +3675 -0
- package/dist/chunk-4OYGMEFM.js.map +1 -0
- package/dist/chunk-4Z6S6LWP.js +6134 -0
- package/dist/chunk-4Z6S6LWP.js.map +1 -0
- package/dist/chunk-5WPGAZLP.js +6136 -0
- package/dist/chunk-5WPGAZLP.js.map +1 -0
- package/dist/chunk-6XGFZ4W5.js +3673 -0
- package/dist/chunk-6XGFZ4W5.js.map +1 -0
- package/dist/chunk-KMKDY2I6.js +46 -0
- package/dist/chunk-KMKDY2I6.js.map +1 -0
- package/dist/chunk-LSHHXCC6.js +3639 -0
- package/dist/chunk-LSHHXCC6.js.map +1 -0
- package/dist/chunk-NNDSADQG.js +3641 -0
- package/dist/chunk-NNDSADQG.js.map +1 -0
- package/dist/chunk-SEGVTWSK.js +44 -0
- package/dist/chunk-SEGVTWSK.js.map +1 -0
- package/dist/devtools-HNR7DD7Q.js +68 -0
- package/dist/devtools-HNR7DD7Q.js.map +1 -0
- package/dist/devtools-HW3UQAHH.js +69 -0
- package/dist/devtools-HW3UQAHH.js.map +1 -0
- package/dist/devtools-KXIXZGBY.js +64 -0
- package/dist/devtools-KXIXZGBY.js.map +1 -0
- package/dist/devtools-PDXM3L35.js +67 -0
- package/dist/devtools-PDXM3L35.js.map +1 -0
- package/dist/devtools-SDEASRYI.js +66 -0
- package/dist/devtools-SDEASRYI.js.map +1 -0
- package/dist/devtools-XBEEGBQ4.js +66 -0
- package/dist/devtools-XBEEGBQ4.js.map +1 -0
- package/dist/dist-4P5P64FK.js +8474 -0
- package/dist/dist-4P5P64FK.js.map +1 -0
- package/dist/dist-AVHDSU4X.js +137 -0
- package/dist/dist-AVHDSU4X.js.map +1 -0
- package/dist/dist-NUJOSN7W.js +8472 -0
- package/dist/dist-NUJOSN7W.js.map +1 -0
- package/dist/dist-QHDMIBVE.js +135 -0
- package/dist/dist-QHDMIBVE.js.map +1 -0
- package/dist/electron/icon.png +0 -0
- package/dist/electron/main.js +45 -3
- package/dist/electron/main.js.map +1 -1
- package/dist/electron/preload.cjs +5 -0
- package/dist/gzip-size-K37OQCQ2.js +137 -0
- package/dist/gzip-size-K37OQCQ2.js.map +1 -0
- package/dist/gzip-size-SHZBT5GU.js +139 -0
- package/dist/gzip-size-SHZBT5GU.js.map +1 -0
- package/dist/index.js +577 -168
- package/dist/index.js.map +1 -1
- package/dist/viewer/assets/calendarSource.worker-C9iglnKD.js +24 -0
- package/dist/viewer/assets/expression.worker-Cin-WNVB.js +5 -0
- package/dist/viewer/assets/floatingFrame.worker-CWLtchq3.js +23 -0
- package/dist/viewer/assets/generic.worker-DRXu0-5B.js +23 -0
- package/dist/viewer/assets/index-BERinSUs.css +2 -0
- package/dist/viewer/assets/index-BExFCUNb.js +582 -0
- package/dist/viewer/assets/index-BTnaSAbf.js +582 -0
- package/dist/viewer/assets/index-BsYWmcLM.css +2 -0
- package/dist/viewer/assets/index-C9gGMSH0.js +582 -0
- package/dist/viewer/assets/index-CGp_x2sR.js +582 -0
- package/dist/viewer/assets/index-D1lc5mUR.js +582 -0
- package/dist/viewer/assets/index-DBXDPp8Y.css +2 -0
- package/dist/viewer/assets/index-DUFimvi2.js +582 -0
- package/dist/viewer/assets/index-DVM12um9.js +582 -0
- package/dist/viewer/assets/index-DiwdXOw0.css +2 -0
- package/dist/viewer/assets/index-DxGbfW9l.js +582 -0
- package/dist/viewer/assets/index-o7N1iv71.js +582 -0
- package/dist/viewer/assets/index-wLgWfI8W.js +582 -0
- package/dist/viewer/assets/recordDetail.worker-BIHPFt8Y.js +23 -0
- package/dist/viewer/icon.png +0 -0
- package/dist/viewer/index.html +2 -2
- package/package.json +17 -13
- package/dist/viewer/assets/calendarSource.worker-DF0wAwJR.js +0 -24
- package/dist/viewer/assets/expression.worker-_W4VR2xe.js +0 -5
- package/dist/viewer/assets/floatingFrame.worker-DXcDBfqJ.js +0 -23
- package/dist/viewer/assets/generic.worker-CsqlYndL.js +0 -23
- package/dist/viewer/assets/index-CW_UqFf3.css +0 -1
- package/dist/viewer/assets/index-DaB01Qok.js +0 -637
- package/dist/viewer/assets/recordDetail.worker-Ccm59Np6.js +0 -23
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
compressSingleFile,
|
|
4
|
+
getContentFromFilesAsync,
|
|
5
|
+
isImageFile,
|
|
6
|
+
readFileAsync,
|
|
7
|
+
run,
|
|
8
|
+
setFileNameMin,
|
|
9
|
+
setPublicFolder,
|
|
10
|
+
wildcards
|
|
11
|
+
} from "./chunk-4Z6S6LWP.js";
|
|
12
|
+
import "./chunk-SEGVTWSK.js";
|
|
13
|
+
|
|
14
|
+
// node_modules/.pnpm/@node-minify+core@10.5.0/node_modules/@node-minify/core/dist/index.js
|
|
15
|
+
import { mkdir } from "fs/promises";
|
|
16
|
+
import path from "path";
|
|
17
|
+
async function compress(settings) {
|
|
18
|
+
if (Array.isArray(settings.output)) {
|
|
19
|
+
if (!Array.isArray(settings.input)) throw new Error("When output is an array, input must also be an array");
|
|
20
|
+
if (settings.input.length !== settings.output.length) throw new Error(`Input and output arrays must have the same length (input: ${settings.input.length}, output: ${settings.output.length})`);
|
|
21
|
+
}
|
|
22
|
+
if (settings.output) await createDirectory(settings.output);
|
|
23
|
+
if (Array.isArray(settings.output)) return compressArrayOfFiles(settings);
|
|
24
|
+
return compressSingleFile(settings);
|
|
25
|
+
}
|
|
26
|
+
async function compressArrayOfFiles(settings) {
|
|
27
|
+
const inputs = settings.input;
|
|
28
|
+
inputs.forEach((input, index) => {
|
|
29
|
+
if (!input || typeof input !== "string") throw new Error(`Invalid input at index ${index}: expected non-empty string, got ${typeof input === "string" ? "empty string" : typeof input}`);
|
|
30
|
+
});
|
|
31
|
+
const compressionTasks = inputs.map(async (input, index) => {
|
|
32
|
+
return run({
|
|
33
|
+
settings,
|
|
34
|
+
content: isImageFile(input) ? await readFileAsync(input, true) : await getContentFromFilesAsync(input),
|
|
35
|
+
index
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
const results = await Promise.all(compressionTasks);
|
|
39
|
+
return results[results.length - 1] ?? "";
|
|
40
|
+
}
|
|
41
|
+
async function createDirectory(filePath) {
|
|
42
|
+
if (!filePath) return;
|
|
43
|
+
const paths = Array.isArray(filePath) ? filePath : [filePath];
|
|
44
|
+
const uniqueDirs = /* @__PURE__ */ new Set();
|
|
45
|
+
for (const outputPath of paths) {
|
|
46
|
+
if (typeof outputPath !== "string") continue;
|
|
47
|
+
const dirPath = getDirectoryPath(outputPath);
|
|
48
|
+
if (!dirPath) continue;
|
|
49
|
+
uniqueDirs.add(dirPath);
|
|
50
|
+
}
|
|
51
|
+
await Promise.all(Array.from(uniqueDirs).map((dir) => mkdir(dir, { recursive: true })));
|
|
52
|
+
}
|
|
53
|
+
function getDirectoryPath(outputPath) {
|
|
54
|
+
const dirPath = path.dirname(outputPath);
|
|
55
|
+
if (dirPath && dirPath !== ".") return dirPath;
|
|
56
|
+
const windowsDirPath = path.win32.dirname(outputPath);
|
|
57
|
+
if (windowsDirPath && windowsDirPath !== ".") return windowsDirPath;
|
|
58
|
+
return "";
|
|
59
|
+
}
|
|
60
|
+
var defaultSettings = {
|
|
61
|
+
options: {},
|
|
62
|
+
buffer: 1e3 * 1024
|
|
63
|
+
};
|
|
64
|
+
function setup(inputSettings) {
|
|
65
|
+
const settings = {
|
|
66
|
+
...structuredClone(defaultSettings),
|
|
67
|
+
...inputSettings
|
|
68
|
+
};
|
|
69
|
+
if (settings.content !== void 0) {
|
|
70
|
+
validateMandatoryFields(inputSettings, ["compressor"]);
|
|
71
|
+
return settings;
|
|
72
|
+
}
|
|
73
|
+
validateMandatoryFields(inputSettings, [
|
|
74
|
+
"compressor",
|
|
75
|
+
"input",
|
|
76
|
+
"output"
|
|
77
|
+
]);
|
|
78
|
+
if (Array.isArray(settings.input)) settings.input.forEach((input, index) => {
|
|
79
|
+
if (!input || typeof input !== "string") throw new Error(`Invalid input at index ${index}: expected non-empty string, got ${typeof input === "string" ? "empty string" : typeof input}`);
|
|
80
|
+
});
|
|
81
|
+
return enhanceSettings(settings);
|
|
82
|
+
}
|
|
83
|
+
function enhanceSettings(settings) {
|
|
84
|
+
let enhancedSettings = settings;
|
|
85
|
+
if (enhancedSettings.input) enhancedSettings = {
|
|
86
|
+
...enhancedSettings,
|
|
87
|
+
...wildcards(enhancedSettings.input, enhancedSettings.publicFolder)
|
|
88
|
+
};
|
|
89
|
+
const optionsWithFormats = enhancedSettings.options;
|
|
90
|
+
const shouldPreserveBareDollarOneOutput = enhancedSettings.output === "$1" && !enhancedSettings.publicFolder && !enhancedSettings.replaceInPlace && Array.isArray(optionsWithFormats?.formats) && optionsWithFormats.formats.length > 0;
|
|
91
|
+
if (Array.isArray(enhancedSettings.input) && shouldPreserveBareDollarOneOutput) enhancedSettings = {
|
|
92
|
+
...enhancedSettings,
|
|
93
|
+
output: enhancedSettings.input.map((file) => setFileNameMin(file, "$1", void 0, true))
|
|
94
|
+
};
|
|
95
|
+
else if (enhancedSettings.input && enhancedSettings.output && !Array.isArray(enhancedSettings.output) && !shouldPreserveBareDollarOneOutput) enhancedSettings = {
|
|
96
|
+
...enhancedSettings,
|
|
97
|
+
...checkOutput(enhancedSettings.input, enhancedSettings.output, enhancedSettings.publicFolder, enhancedSettings.replaceInPlace)
|
|
98
|
+
};
|
|
99
|
+
if (enhancedSettings.input && enhancedSettings.publicFolder) enhancedSettings = {
|
|
100
|
+
...enhancedSettings,
|
|
101
|
+
...setPublicFolder(enhancedSettings.input, enhancedSettings.publicFolder)
|
|
102
|
+
};
|
|
103
|
+
return enhancedSettings;
|
|
104
|
+
}
|
|
105
|
+
function checkOutput(input, output, publicFolder, replaceInPlace) {
|
|
106
|
+
if (Array.isArray(output)) return;
|
|
107
|
+
if (!/\$1/.test(output)) return;
|
|
108
|
+
const effectivePublicFolder = replaceInPlace ? void 0 : publicFolder;
|
|
109
|
+
if (Array.isArray(input)) return { output: input.map((file) => setFileNameMin(file, output, effectivePublicFolder, replaceInPlace)) };
|
|
110
|
+
return { output: setFileNameMin(input, output, effectivePublicFolder, replaceInPlace) };
|
|
111
|
+
}
|
|
112
|
+
function validateMandatoryFields(settings, fields) {
|
|
113
|
+
for (const field of fields) mandatory(field, settings);
|
|
114
|
+
if (typeof settings.compressor !== "function") throw new Error("compressor should be a function, maybe you forgot to install the compressor");
|
|
115
|
+
}
|
|
116
|
+
function mandatory(setting, settings) {
|
|
117
|
+
if (!settings[setting]) throw new Error(`${setting} is mandatory.`);
|
|
118
|
+
}
|
|
119
|
+
async function minify(settings) {
|
|
120
|
+
const compressorSettings = setup(settings);
|
|
121
|
+
return await (compressorSettings.content !== void 0 ? compressSingleFile : compress)(compressorSettings);
|
|
122
|
+
}
|
|
123
|
+
export {
|
|
124
|
+
minify
|
|
125
|
+
};
|
|
126
|
+
/*! Bundled license information:
|
|
127
|
+
|
|
128
|
+
@node-minify/core/dist/index.js:
|
|
129
|
+
(*!
|
|
130
|
+
* node-minify
|
|
131
|
+
* Copyright (c) 2011-2026 Rodolphe Stoclin
|
|
132
|
+
* MIT Licensed
|
|
133
|
+
*)
|
|
134
|
+
*/
|
|
135
|
+
//# sourceMappingURL=dist-QHDMIBVE.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../node_modules/.pnpm/@node-minify+core@10.5.0/node_modules/@node-minify/core/src/compress.ts","../node_modules/.pnpm/@node-minify+core@10.5.0/node_modules/@node-minify/core/src/setup.ts","../node_modules/.pnpm/@node-minify+core@10.5.0/node_modules/@node-minify/core/src/index.ts"],"sourcesContent":["/*!\n * node-minify\n * Copyright (c) 2011-2026 Rodolphe Stoclin\n * MIT Licensed\n */\n\nimport { mkdir } from \"node:fs/promises\";\nimport path from \"node:path\";\n/**\n * Module dependencies.\n */\nimport type {\n CompressorOptions,\n MinifierOptions,\n Settings,\n} from \"@node-minify/types\";\nimport {\n compressSingleFile,\n getContentFromFilesAsync,\n isImageFile,\n readFileAsync,\n run,\n} from \"@node-minify/utils\";\n\n/**\n * Run the compressor using the provided settings.\n *\n * Validates settings when `output` is an array (requires `input` to be an array with the same length) and ensures target output directories exist before processing. Dispatches either multi-file or single-file compression based on `settings.output`.\n *\n * @param settings - Compression settings including `input`, `output`, and compressor-specific options\n * @returns The resulting compressed output string for a single output, or the last result produced when processing multiple outputs (or an empty string if no results were produced)\n * @throws Error - If `output` is an array but `input` is not, or if `input` and `output` arrays have differing lengths\n */\nexport async function compress<T extends CompressorOptions = CompressorOptions>(\n settings: Settings<T>\n): Promise<string> {\n if (Array.isArray(settings.output)) {\n if (!Array.isArray(settings.input)) {\n throw new Error(\n \"When output is an array, input must also be an array\"\n );\n }\n if (settings.input.length !== settings.output.length) {\n throw new Error(\n `Input and output arrays must have the same length (input: ${settings.input.length}, output: ${settings.output.length})`\n );\n }\n }\n\n if (settings.output) {\n await createDirectory(settings.output);\n }\n\n // Handle array outputs (from user input or created internally by checkOutput when processing $1 pattern)\n if (Array.isArray(settings.output)) {\n return compressArrayOfFiles(settings);\n }\n\n return compressSingleFile(settings as Settings);\n}\n\n/**\n * Compress multiple input files specified in the settings.\n *\n * @param settings - Configuration object where `settings.input` and `settings.output` are arrays of equal length; each `settings.input[i]` is a file path to compress and corresponds to `settings.output[i]`.\n * @returns The result of the last compression task, or an empty string if no tasks ran.\n * @throws Error if any entry in `settings.input` is not a non-empty string.\n */\nasync function compressArrayOfFiles<\n T extends CompressorOptions = CompressorOptions,\n>(settings: Settings<T>): Promise<string> {\n const inputs = settings.input as string[];\n\n inputs.forEach((input, index) => {\n if (!input || typeof input !== \"string\") {\n throw new Error(\n `Invalid input at index ${index}: expected non-empty string, got ${\n typeof input === \"string\" ? \"empty string\" : typeof input\n }`\n );\n }\n });\n\n const compressionTasks = inputs.map(async (input, index) => {\n const content = isImageFile(input)\n ? await readFileAsync(input, true)\n : await getContentFromFilesAsync(input);\n return run({ settings, content, index } as MinifierOptions<T>);\n });\n\n const results = await Promise.all(compressionTasks);\n return results[results.length - 1] ?? \"\";\n}\n\n/**\n * Create folder of the target file.\n * @param filePath Full path of the file (can be string or array when $1 pattern is used)\n */\nasync function createDirectory(filePath: string | string[]) {\n // Early return if no file path provided\n if (!filePath) {\n return;\n }\n\n // Handle array (created internally by checkOutput when processing $1 pattern)\n const paths = Array.isArray(filePath) ? filePath : [filePath];\n const uniqueDirs = new Set<string>();\n\n for (const outputPath of paths) {\n if (typeof outputPath !== \"string\") {\n continue;\n }\n\n // Use platform dirname first, then fallback for Windows-style separators on POSIX.\n const dirPath = getDirectoryPath(outputPath);\n\n // Early return if no directory path\n if (!dirPath) {\n continue;\n }\n\n uniqueDirs.add(dirPath);\n }\n\n // Create directories in parallel\n await Promise.all(\n Array.from(uniqueDirs).map((dir) => mkdir(dir, { recursive: true }))\n );\n}\n\n/**\n * Resolve the directory path from an output file path.\n * @param outputPath Full path to the output file\n * @returns A directory path when resolvable, or an empty string\n */\nfunction getDirectoryPath(outputPath: string): string {\n const dirPath = path.dirname(outputPath);\n if (dirPath && dirPath !== \".\") {\n return dirPath;\n }\n\n const windowsDirPath = path.win32.dirname(outputPath);\n if (windowsDirPath && windowsDirPath !== \".\") {\n return windowsDirPath;\n }\n\n return \"\";\n}\n","/*!\n * node-minify\n * Copyright (c) 2011-2026 Rodolphe Stoclin\n * MIT Licensed\n */\n\n/**\n * Module dependencies.\n */\nimport type { CompressorOptions, Settings } from \"@node-minify/types\";\nimport { setFileNameMin, setPublicFolder, wildcards } from \"@node-minify/utils\";\n\n/**\n * Default settings.\n */\nconst defaultSettings: Partial<Settings> = {\n options: {},\n buffer: 1000 * 1024,\n};\n\n/**\n * Builds and validates the final Settings object by merging defaults with user input.\n *\n * @param inputSettings - User-provided settings that override defaults\n * @returns The validated and enhanced Settings object ready for use\n */\nfunction setup<T extends CompressorOptions = CompressorOptions>(\n inputSettings: Settings<T>\n): Settings<T> {\n const settings: Settings<T> = {\n ...structuredClone(defaultSettings),\n ...inputSettings,\n } as Settings<T>;\n\n // In memory\n if (settings.content !== undefined) {\n validateMandatoryFields(inputSettings, [\"compressor\"]);\n return settings;\n }\n\n validateMandatoryFields(inputSettings, [\"compressor\", \"input\", \"output\"]);\n\n if (Array.isArray(settings.input)) {\n settings.input.forEach((input, index) => {\n if (!input || typeof input !== \"string\") {\n throw new Error(\n `Invalid input at index ${index}: expected non-empty string, got ${\n typeof input === \"string\"\n ? \"empty string\"\n : typeof input\n }`\n );\n }\n });\n }\n\n return enhanceSettings(settings);\n}\n\n/**\n * Augments a Settings object with derived values and normalized path outputs.\n *\n * Enhancements performed when applicable:\n * - Expands input patterns into concrete input entries.\n * - Computes output paths when a single output string contains the `$1` placeholder, producing per-input outputs.\n * - Resolves and attaches public-folder-related values derived from input and publicFolder.\n *\n * @param settings - The initial settings to enhance\n * @returns The enhanced Settings object with derived inputs, outputs, and public-folder values applied\n */\nfunction enhanceSettings<T extends CompressorOptions = CompressorOptions>(\n settings: Settings<T>\n): Settings<T> {\n let enhancedSettings = settings;\n\n if (enhancedSettings.input) {\n enhancedSettings = {\n ...enhancedSettings,\n ...wildcards(enhancedSettings.input, enhancedSettings.publicFolder),\n };\n }\n const optionsWithFormats = enhancedSettings.options as\n | { formats?: unknown[] }\n | undefined;\n const shouldPreserveBareDollarOneOutput =\n enhancedSettings.output === \"$1\" &&\n !enhancedSettings.publicFolder &&\n !enhancedSettings.replaceInPlace &&\n Array.isArray(optionsWithFormats?.formats) &&\n optionsWithFormats.formats.length > 0;\n\n if (\n Array.isArray(enhancedSettings.input) &&\n shouldPreserveBareDollarOneOutput\n ) {\n enhancedSettings = {\n ...enhancedSettings,\n output: enhancedSettings.input.map((file) =>\n setFileNameMin(file, \"$1\", undefined, true)\n ),\n };\n } else if (\n enhancedSettings.input &&\n enhancedSettings.output &&\n !Array.isArray(enhancedSettings.output) &&\n !shouldPreserveBareDollarOneOutput\n ) {\n enhancedSettings = {\n ...enhancedSettings,\n ...checkOutput(\n enhancedSettings.input,\n enhancedSettings.output,\n enhancedSettings.publicFolder,\n enhancedSettings.replaceInPlace\n ),\n };\n }\n if (enhancedSettings.input && enhancedSettings.publicFolder) {\n enhancedSettings = {\n ...enhancedSettings,\n ...setPublicFolder(\n enhancedSettings.input,\n enhancedSettings.publicFolder\n ),\n };\n }\n\n return enhancedSettings;\n}\n\n/**\n * Check the output path, searching for $1\n * if exist, returns the path replacing $1 by file name\n * @param input Path file\n * @param output Path to the output file\n * @param publicFolder Path to the public folder\n * @param replaceInPlace True to replace file in same folder\n * @returns Enhanced settings with processed output, or undefined if no processing needed\n */\nfunction checkOutput(\n input: string | string[],\n output: string | string[],\n publicFolder?: string,\n replaceInPlace?: boolean\n): { output: string | string[] } | undefined {\n // Arrays don't use the $1 placeholder pattern - they're handled directly in compress()\n if (Array.isArray(output)) {\n return undefined;\n }\n\n const PLACEHOLDER_PATTERN = /\\$1/;\n\n if (!PLACEHOLDER_PATTERN.test(output)) {\n return undefined;\n }\n\n const effectivePublicFolder = replaceInPlace ? undefined : publicFolder;\n\n // If array of files\n if (Array.isArray(input)) {\n const outputMin = input.map((file) =>\n setFileNameMin(file, output, effectivePublicFolder, replaceInPlace)\n );\n return { output: outputMin };\n }\n\n // Single file\n return {\n output: setFileNameMin(\n input,\n output,\n effectivePublicFolder,\n replaceInPlace\n ),\n };\n}\n\n/**\n * Ensure required settings are present and that `compressor` is a valid function.\n *\n * @param settings - Settings object to validate\n * @param fields - Names of required fields to check on `settings`\n * @throws Error if a required field is missing\n * @throws Error if `settings.compressor` is not a function\n */\nfunction validateMandatoryFields<\n T extends CompressorOptions = CompressorOptions,\n>(settings: Settings<T>, fields: string[]) {\n for (const field of fields) {\n mandatory(field, settings);\n }\n\n if (typeof settings.compressor !== \"function\") {\n throw new Error(\n \"compressor should be a function, maybe you forgot to install the compressor\"\n );\n }\n}\n\n/**\n * Check if the setting exists.\n * @param setting - Setting key to check\n * @param settings - Settings object\n */\nfunction mandatory(setting: string, settings: Record<string, unknown>) {\n if (!settings[setting]) {\n throw new Error(`${setting} is mandatory.`);\n }\n}\n\nexport { setup };\n","/*!\n * node-minify\n * Copyright (c) 2011-2026 Rodolphe Stoclin\n * MIT Licensed\n */\n\n/**\n * Module dependencies.\n */\nimport type { CompressorOptions, Settings } from \"@node-minify/types\";\nimport { compressSingleFile } from \"@node-minify/utils\";\nimport { compress } from \"./compress.ts\";\nimport { setup } from \"./setup.ts\";\n\n/**\n * Minifies input according to the provided settings.\n *\n * @param settings - User-provided settings that specify the compressor, input/content, output and related options\n * @returns The minified content as a string\n */\nexport async function minify<T extends CompressorOptions = CompressorOptions>(\n settings: Settings<T>\n): Promise<string> {\n const compressorSettings = setup(settings);\n const method =\n compressorSettings.content !== undefined\n ? compressSingleFile\n : compress;\n return await method(compressorSettings);\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAiCA,eAAsB,SAClB,UACe;AACf,MAAI,MAAM,QAAQ,SAAS,MAAA,GAAS;AAChC,QAAI,CAAC,MAAM,QAAQ,SAAS,KAAA,EACxB,OAAM,IAAI,MACN,sDAAA;AAGR,QAAI,SAAS,MAAM,WAAW,SAAS,OAAO,OAC1C,OAAM,IAAI,MACN,6DAA6D,SAAS,MAAM,MAAA,aAAmB,SAAS,OAAO,MAAA,GAAO;;AAKlI,MAAI,SAAS,OACT,OAAM,gBAAgB,SAAS,MAAA;AAInC,MAAI,MAAM,QAAQ,SAAS,MAAA,EACvB,QAAO,qBAAqB,QAAA;AAGhC,SAAO,mBAAmB,QAAA;;AAU9B,eAAe,qBAEb,UAAwC;AACtC,QAAM,SAAS,SAAS;AAExB,SAAO,QAAA,CAAS,OAAO,UAAU;AAC7B,QAAI,CAAC,SAAS,OAAO,UAAU,SAC3B,OAAM,IAAI,MACN,0BAA0B,KAAA,oCACtB,OAAO,UAAU,WAAW,iBAAiB,OAAO,KAAA,EAAA;;AAMpE,QAAM,mBAAmB,OAAO,IAAI,OAAO,OAAO,U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vC,aAAW,SAAS,OAChB,WAAU,OAAO,QAAA;AAGrB,MAAI,OAAO,SAAS,eAAe,WAC/B,OAAM,IAAI,MACN,6EAAA;;AAUZ,SAAS,UAAU,SAAiB,UAAmC;AACnE,MAAI,CAAC,SAAS,OAAA,EACV,OAAM,IAAI,MAAM,GAAG,OAAA,gBAAQ;;AC1LnC,eAAsB,OAClB,UACe;AACf,QAAM,qBAAqB,MAAM,QAAA;AAKjC,SAAO,OAHH,mBAAmB,YAAY,SACzB,qBACA,UACU,kBAAA;;","names":[]}
|
package/dist/electron/icon.png
CHANGED
|
Binary file
|
package/dist/electron/main.js
CHANGED
|
@@ -8,7 +8,7 @@ var userDataDir = args.find((a) => a.startsWith("--user-data-dir="))?.slice(16);
|
|
|
8
8
|
if (userDataDir) {
|
|
9
9
|
app.setPath("userData", userDataDir);
|
|
10
10
|
}
|
|
11
|
-
app.setName("Kizen
|
|
11
|
+
app.setName("Kizen App Builder");
|
|
12
12
|
var CSP_HEADERS = /* @__PURE__ */ new Set([
|
|
13
13
|
"content-security-policy",
|
|
14
14
|
"content-security-policy-report-only",
|
|
@@ -77,12 +77,12 @@ void app.whenReady().then(() => {
|
|
|
77
77
|
const iconPath = join(dirname(fileURLToPath(import.meta.url)), "icon.png");
|
|
78
78
|
const icon = nativeImage.createFromPath(iconPath);
|
|
79
79
|
if (process.platform === "darwin" && !icon.isEmpty()) {
|
|
80
|
-
app.dock
|
|
80
|
+
app.dock?.setIcon(icon);
|
|
81
81
|
}
|
|
82
82
|
const win = new BrowserWindow({
|
|
83
83
|
width: 1920,
|
|
84
84
|
height: 1080,
|
|
85
|
-
title: "Kizen
|
|
85
|
+
title: "Kizen App Builder",
|
|
86
86
|
icon,
|
|
87
87
|
webPreferences: {
|
|
88
88
|
nodeIntegration: false,
|
|
@@ -94,6 +94,48 @@ void app.whenReady().then(() => {
|
|
|
94
94
|
ipcMain.on("open-devtools", () => {
|
|
95
95
|
win.webContents.openDevTools();
|
|
96
96
|
});
|
|
97
|
+
function parseProp(prop) {
|
|
98
|
+
if (prop.type === "number") return Number(prop.value);
|
|
99
|
+
if (prop.type === "boolean") return prop.value === "true";
|
|
100
|
+
if (prop.type === "undefined") return void 0;
|
|
101
|
+
if (prop.type === "object" && prop.value === "null") return null;
|
|
102
|
+
return prop.value ?? `[${prop.type}]`;
|
|
103
|
+
}
|
|
104
|
+
function serializeArg(arg) {
|
|
105
|
+
if (arg.value !== void 0) return arg.value;
|
|
106
|
+
if (arg.preview) {
|
|
107
|
+
const { preview } = arg;
|
|
108
|
+
if (preview.subtype === "array") {
|
|
109
|
+
return preview.properties.filter((p) => /^\d+$/.test(p.name)).sort((a, b) => parseInt(a.name) - parseInt(b.name)).map(parseProp);
|
|
110
|
+
}
|
|
111
|
+
const obj = {};
|
|
112
|
+
for (const prop of preview.properties) obj[prop.name] = parseProp(prop);
|
|
113
|
+
return obj;
|
|
114
|
+
}
|
|
115
|
+
return arg.description ?? `[${arg.type}]`;
|
|
116
|
+
}
|
|
117
|
+
const enableRuntime = (sessionId) => {
|
|
118
|
+
void win.webContents.debugger.sendCommand("Runtime.enable", { generatePreview: true }, sessionId);
|
|
119
|
+
};
|
|
120
|
+
win.webContents.debugger.attach("1.3");
|
|
121
|
+
enableRuntime();
|
|
122
|
+
void win.webContents.debugger.sendCommand("Target.setAutoAttach", {
|
|
123
|
+
autoAttach: true,
|
|
124
|
+
waitForDebuggerOnStart: false,
|
|
125
|
+
flatten: true
|
|
126
|
+
});
|
|
127
|
+
win.webContents.debugger.on("message", (_event, method, params, sessionId) => {
|
|
128
|
+
if (method === "Target.attachedToTarget") {
|
|
129
|
+
const { sessionId: childSessionId } = params;
|
|
130
|
+
enableRuntime(childSessionId);
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
if (method !== "Runtime.consoleAPICalled") return;
|
|
134
|
+
const { type, args: args2 } = params;
|
|
135
|
+
if (args2[0]?.type === "string" && String(args2[0].value).includes("Electron Security Warning")) return;
|
|
136
|
+
const level = type === "warning" ? "warn" : ["log", "warn", "error", "info"].includes(type) ? type : "log";
|
|
137
|
+
win.webContents.send("console-message", { level, args: args2.map(serializeArg) });
|
|
138
|
+
});
|
|
97
139
|
void win.loadURL(`http://localhost:${String(port)}`);
|
|
98
140
|
});
|
|
99
141
|
app.on("window-all-closed", () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/electron/main.ts"],"sourcesContent":["import { app, BrowserWindow, session, nativeImage, Menu, ipcMain } from 'electron';\nimport { join, dirname } from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\nconst args = process.argv.slice(2);\nconst port = parseInt(args.find((a) => a.startsWith('--port='))?.slice(7) ?? '3121', 10);\nconst userDataDir = args.find((a) => a.startsWith('--user-data-dir='))?.slice(16);\n\nif (userDataDir) {\n app.setPath('userData', userDataDir);\n}\n\napp.setName('Kizen Dev');\n\nconst CSP_HEADERS = new Set([\n 'content-security-policy',\n 'content-security-policy-report-only',\n 'x-frame-options',\n]);\n\nconst KIZEN_DOMAINS = ['kizen.dev', 'kizen.com'];\n\nfunction isKizenUrl(url: string): boolean {\n try {\n const { hostname } = new URL(url);\n return KIZEN_DOMAINS.some((d) => hostname === d || hostname.endsWith('.' + d));\n } catch {\n return false;\n }\n}\n\nfunction setupSession(): void {\n // Strip CSP headers and fix SameSite cookies on Kizen responses.\n session.defaultSession.webRequest.onHeadersReceived((details, callback) => {\n const headers: Record<string, string[]> = {};\n\n for (const [key, value] of Object.entries(details.responseHeaders ?? {})) {\n if (!CSP_HEADERS.has(key.toLowerCase())) {\n headers[key] = value;\n }\n }\n\n if (isKizenUrl(details.url) && headers['set-cookie']) {\n headers['set-cookie'] = headers['set-cookie'].map((cookie) => {\n if (!/SameSite=/i.test(cookie)) {\n return cookie + '; SameSite=None; Secure';\n }\n\n return cookie.replace(/SameSite=\\w+/i, 'SameSite=None');\n });\n }\n\n callback({ responseHeaders: headers });\n });\n\n // Periodically re-patch existing Kizen cookies that arrived without SameSite=None.\n // Needed for cookies set before the interceptor was active or via JS document.cookie.\n setInterval(() => {\n void (async () => {\n for (const domain of KIZEN_DOMAINS) {\n try {\n const cookies = await session.defaultSession.cookies.get({ domain });\n for (const cookie of cookies) {\n if (cookie.sameSite !== 'no_restriction') {\n const raw = cookie.domain ?? domain;\n const bare = raw.startsWith('.') ? raw.slice(1) : raw;\n await session.defaultSession.cookies.set({\n url: `https://${bare}`,\n name: cookie.name,\n value: cookie.value,\n domain: raw,\n path: cookie.path ?? '/',\n secure: true,\n ...(cookie.httpOnly !== undefined && { httpOnly: cookie.httpOnly }),\n ...(cookie.expirationDate !== undefined && {\n expirationDate: cookie.expirationDate,\n }),\n sameSite: 'no_restriction',\n });\n }\n }\n } catch {\n /* ignore */\n }\n }\n })();\n }, 2000);\n}\n\nvoid app.whenReady().then(() => {\n Menu.setApplicationMenu(null);\n\n setupSession();\n\n const iconPath = join(dirname(fileURLToPath(import.meta.url)), 'icon.png');\n const icon = nativeImage.createFromPath(iconPath);\n\n if (process.platform === 'darwin' && !icon.isEmpty()) {\n app.dock.setIcon(icon);\n }\n\n const win = new BrowserWindow({\n width: 1920,\n height: 1080,\n title: 'Kizen Dev',\n icon,\n webPreferences: {\n nodeIntegration: false,\n contextIsolation: true,\n sandbox: false,\n preload: join(dirname(fileURLToPath(import.meta.url)), 'preload.cjs'),\n },\n });\n\n ipcMain.on('open-devtools', () => {\n win.webContents.openDevTools();\n });\n\n void win.loadURL(`http://localhost:${String(port)}`);\n});\n\napp.on('window-all-closed', () => {\n app.quit();\n});\n"],"mappings":";AAAA,SAAS,KAAK,eAAe,SAAS,aAAa,MAAM,eAAe;AACxE,SAAS,MAAM,eAAe;AAC9B,SAAS,qBAAqB;AAE9B,IAAM,OAAO,QAAQ,KAAK,MAAM,CAAC;AACjC,IAAM,OAAO,SAAS,KAAK,KAAK,CAAC,MAAM,EAAE,WAAW,SAAS,CAAC,GAAG,MAAM,CAAC,KAAK,QAAQ,EAAE;AACvF,IAAM,cAAc,KAAK,KA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A,EAC/B,CAAC;AAED,OAAK,IAAI,QAAQ,oBAAoB,OAAO,IAAI,CAAC,EAAE;AACrD,CAAC;AAED,IAAI,GAAG,qBAAqB,MAAM;AAChC,MAAI,KAAK;AACX,CAAC;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/electron/main.ts"],"sourcesContent":["import { app, BrowserWindow, session, nativeImage, Menu, ipcMain } from 'electron';\nimport { join, dirname } from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\nconst args = process.argv.slice(2);\nconst port = parseInt(args.find((a) => a.startsWith('--port='))?.slice(7) ?? '3121', 10);\nconst userDataDir = args.find((a) => a.startsWith('--user-data-dir='))?.slice(16);\n\nif (userDataDir) {\n app.setPath('userData', userDataDir);\n}\n\napp.setName('Kizen App Builder');\n\nconst CSP_HEADERS = new Set([\n 'content-security-policy',\n 'content-security-policy-report-only',\n 'x-frame-options',\n]);\n\nconst KIZEN_DOMAINS = ['kizen.dev', 'kizen.com'];\n\nfunction isKizenUrl(url: string): boolean {\n try {\n const { hostname } = new URL(url);\n return KIZEN_DOMAINS.some((d) => hostname === d || hostname.endsWith('.' + d));\n } catch {\n return false;\n }\n}\n\nfunction setupSession(): void {\n // Strip CSP headers and fix SameSite cookies on Kizen responses.\n session.defaultSession.webRequest.onHeadersReceived((details, callback) => {\n const headers: Record<string, string[]> = {};\n\n for (const [key, value] of Object.entries(details.responseHeaders ?? {})) {\n if (!CSP_HEADERS.has(key.toLowerCase())) {\n headers[key] = value;\n }\n }\n\n if (isKizenUrl(details.url) && headers['set-cookie']) {\n headers['set-cookie'] = headers['set-cookie'].map((cookie) => {\n if (!/SameSite=/i.test(cookie)) {\n return cookie + '; SameSite=None; Secure';\n }\n\n return cookie.replace(/SameSite=\\w+/i, 'SameSite=None');\n });\n }\n\n callback({ responseHeaders: headers });\n });\n\n // Periodically re-patch existing Kizen cookies that arrived without SameSite=None.\n // Needed for cookies set before the interceptor was active or via JS document.cookie.\n setInterval(() => {\n void (async () => {\n for (const domain of KIZEN_DOMAINS) {\n try {\n const cookies = await session.defaultSession.cookies.get({ domain });\n for (const cookie of cookies) {\n if (cookie.sameSite !== 'no_restriction') {\n const raw = cookie.domain ?? domain;\n const bare = raw.startsWith('.') ? raw.slice(1) : raw;\n await session.defaultSession.cookies.set({\n url: `https://${bare}`,\n name: cookie.name,\n value: cookie.value,\n domain: raw,\n path: cookie.path ?? '/',\n secure: true,\n ...(cookie.httpOnly !== undefined && { httpOnly: cookie.httpOnly }),\n ...(cookie.expirationDate !== undefined && {\n expirationDate: cookie.expirationDate,\n }),\n sameSite: 'no_restriction',\n });\n }\n }\n } catch {\n /* ignore */\n }\n }\n })();\n }, 2000);\n}\n\nvoid app.whenReady().then(() => {\n Menu.setApplicationMenu(null);\n\n setupSession();\n\n const iconPath = join(dirname(fileURLToPath(import.meta.url)), 'icon.png');\n const icon = nativeImage.createFromPath(iconPath);\n\n if (process.platform === 'darwin' && !icon.isEmpty()) {\n app.dock?.setIcon(icon);\n }\n\n const win = new BrowserWindow({\n width: 1920,\n height: 1080,\n title: 'Kizen App Builder',\n icon,\n webPreferences: {\n nodeIntegration: false,\n contextIsolation: true,\n sandbox: false,\n preload: join(dirname(fileURLToPath(import.meta.url)), 'preload.cjs'),\n },\n });\n\n ipcMain.on('open-devtools', () => {\n win.webContents.openDevTools();\n });\n\n interface PropertyPreview { name: string; type: string; value?: string; subtype?: string }\n interface ObjectPreview { type: string; subtype?: string; overflow: boolean; properties: PropertyPreview[] }\n interface RemoteObject { type: string; subtype?: string; value?: unknown; description?: string; preview?: ObjectPreview }\n interface ConsoleApiCalledParams { type: string; args: RemoteObject[] }\n\n function parseProp(prop: PropertyPreview): unknown {\n if (prop.type === 'number') return Number(prop.value);\n if (prop.type === 'boolean') return prop.value === 'true';\n if (prop.type === 'undefined') return undefined;\n if (prop.type === 'object' && prop.value === 'null') return null;\n return prop.value ?? `[${prop.type}]`;\n }\n\n function serializeArg(arg: RemoteObject): unknown {\n if (arg.value !== undefined) return arg.value;\n if (arg.preview) {\n const { preview } = arg;\n if (preview.subtype === 'array') {\n return preview.properties\n .filter((p) => /^\\d+$/.test(p.name))\n .sort((a, b) => parseInt(a.name) - parseInt(b.name))\n .map(parseProp);\n }\n const obj: Record<string, unknown> = {};\n for (const prop of preview.properties) obj[prop.name] = parseProp(prop);\n return obj;\n }\n return arg.description ?? `[${arg.type}]`;\n }\n\n const enableRuntime = (sessionId?: string): void => {\n void win.webContents.debugger.sendCommand('Runtime.enable', { generatePreview: true }, sessionId);\n };\n\n win.webContents.debugger.attach('1.3');\n enableRuntime();\n void win.webContents.debugger.sendCommand('Target.setAutoAttach', {\n autoAttach: true,\n waitForDebuggerOnStart: false,\n flatten: true,\n });\n\n win.webContents.debugger.on('message', (_event, method, params, sessionId) => {\n if (method === 'Target.attachedToTarget') {\n const { sessionId: childSessionId } = params as { sessionId: string };\n enableRuntime(childSessionId);\n return;\n }\n\n if (method !== 'Runtime.consoleAPICalled') return;\n const { type, args } = params as ConsoleApiCalledParams;\n if (args[0]?.type === 'string' && String(args[0].value).includes('Electron Security Warning')) return;\n const level = type === 'warning' ? 'warn' : (['log', 'warn', 'error', 'info'].includes(type) ? type : 'log');\n win.webContents.send('console-message', { level, args: args.map(serializeArg) });\n });\n\n void win.loadURL(`http://localhost:${String(port)}`);\n});\n\napp.on('window-all-closed', () => {\n app.quit();\n});\n"],"mappings":";AAAA,SAAS,KAAK,eAAe,SAAS,aAAa,MAAM,eAAe;AACxE,SAAS,MAAM,eAAe;AAC9B,SAAS,qBAAqB;AAE9B,IAAM,OAAO,QAAQ,KAAK,MAAM,CAAC;AACjC,IAAM,OAAO,SAAS,KAAK,KAAK,CAAC,MAAM,EAAE,WAAW,SAAS,CAAC,GAAG,MAAM,CAAC,KAAK,QAAQ,EAAE;AACvF,IAAM,cAAc,KAAK,KAAK,CAAC,MAAM,EAAE,WAAW,kBAAkB,CAAC,GAAG,MAAM,EAAE;AAEhF,IAAI,aAAa;AACf,MAAI,QAAQ,YAAY,WAAW;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MAAK,CAAC,GAAG,SAAS,YAAY,OAAOA,MAAK,CAAC,EAAE,KAAK,EAAE,SAAS,2BAA2B,EAAG;AAC/F,UAAM,QAAQ,SAAS,YAAY,SAAU,CAAC,OAAO,QAAQ,SAAS,MAAM,EAAE,SAAS,IAAI,IAAI,OAAO;AACtG,QAAI,YAAY,KAAK,mBAAmB,EAAE,OAAO,MAAMA,MAAK,IAAI,YAAY,EAAE,CAAC;AAAA,EACjF,CAAC;AAED,OAAK,IAAI,QAAQ,oBAAoB,OAAO,IAAI,CAAC,EAAE;AACrD,CAAC;AAED,IAAI,GAAG,qBAAqB,MAAM;AAChC,MAAI,KAAK;AACX,CAAC;","names":["args"]}
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
const { contextBridge, ipcRenderer } = require('electron');
|
|
2
2
|
contextBridge.exposeInMainWorld('electronAPI', {
|
|
3
3
|
openDevTools: () => ipcRenderer.send('open-devtools'),
|
|
4
|
+
onConsoleMessage: (callback) => {
|
|
5
|
+
const handler = (_event, data) => callback(data);
|
|
6
|
+
ipcRenderer.on('console-message', handler);
|
|
7
|
+
return () => ipcRenderer.removeListener('console-message', handler);
|
|
8
|
+
},
|
|
4
9
|
});
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
__commonJS,
|
|
4
|
+
__require,
|
|
5
|
+
__toESM
|
|
6
|
+
} from "./chunk-SEGVTWSK.js";
|
|
7
|
+
|
|
8
|
+
// node_modules/.pnpm/duplexer@0.1.2/node_modules/duplexer/index.js
|
|
9
|
+
var require_duplexer = __commonJS({
|
|
10
|
+
"node_modules/.pnpm/duplexer@0.1.2/node_modules/duplexer/index.js"(exports, module) {
|
|
11
|
+
"use strict";
|
|
12
|
+
var Stream = __require("stream");
|
|
13
|
+
var writeMethods = ["write", "end", "destroy"];
|
|
14
|
+
var readMethods = ["resume", "pause"];
|
|
15
|
+
var readEvents = ["data", "close"];
|
|
16
|
+
var slice = Array.prototype.slice;
|
|
17
|
+
module.exports = duplex;
|
|
18
|
+
function forEach(arr, fn) {
|
|
19
|
+
if (arr.forEach) {
|
|
20
|
+
return arr.forEach(fn);
|
|
21
|
+
}
|
|
22
|
+
for (var i = 0; i < arr.length; i++) {
|
|
23
|
+
fn(arr[i], i);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
function duplex(writer, reader) {
|
|
27
|
+
var stream2 = new Stream();
|
|
28
|
+
var ended = false;
|
|
29
|
+
forEach(writeMethods, proxyWriter);
|
|
30
|
+
forEach(readMethods, proxyReader);
|
|
31
|
+
forEach(readEvents, proxyStream);
|
|
32
|
+
reader.on("end", handleEnd);
|
|
33
|
+
writer.on("drain", function() {
|
|
34
|
+
stream2.emit("drain");
|
|
35
|
+
});
|
|
36
|
+
writer.on("error", reemit);
|
|
37
|
+
reader.on("error", reemit);
|
|
38
|
+
stream2.writable = writer.writable;
|
|
39
|
+
stream2.readable = reader.readable;
|
|
40
|
+
return stream2;
|
|
41
|
+
function proxyWriter(methodName) {
|
|
42
|
+
stream2[methodName] = method;
|
|
43
|
+
function method() {
|
|
44
|
+
return writer[methodName].apply(writer, arguments);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
function proxyReader(methodName) {
|
|
48
|
+
stream2[methodName] = method;
|
|
49
|
+
function method() {
|
|
50
|
+
stream2.emit(methodName);
|
|
51
|
+
var func = reader[methodName];
|
|
52
|
+
if (func) {
|
|
53
|
+
return func.apply(reader, arguments);
|
|
54
|
+
}
|
|
55
|
+
reader.emit(methodName);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
function proxyStream(methodName) {
|
|
59
|
+
reader.on(methodName, reemit2);
|
|
60
|
+
function reemit2() {
|
|
61
|
+
var args = slice.call(arguments);
|
|
62
|
+
args.unshift(methodName);
|
|
63
|
+
stream2.emit.apply(stream2, args);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
function handleEnd() {
|
|
67
|
+
if (ended) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
ended = true;
|
|
71
|
+
var args = slice.call(arguments);
|
|
72
|
+
args.unshift("end");
|
|
73
|
+
stream2.emit.apply(stream2, args);
|
|
74
|
+
}
|
|
75
|
+
function reemit(err) {
|
|
76
|
+
stream2.emit("error", err);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
// node_modules/.pnpm/gzip-size@7.0.0/node_modules/gzip-size/index.js
|
|
83
|
+
var import_duplexer = __toESM(require_duplexer(), 1);
|
|
84
|
+
import fs from "fs";
|
|
85
|
+
import stream from "stream";
|
|
86
|
+
import zlib from "zlib";
|
|
87
|
+
import { promisify } from "util";
|
|
88
|
+
var getOptions = (options) => ({ level: 9, ...options });
|
|
89
|
+
var gzip = promisify(zlib.gzip);
|
|
90
|
+
async function gzipSize(input, options) {
|
|
91
|
+
if (!input) {
|
|
92
|
+
return 0;
|
|
93
|
+
}
|
|
94
|
+
const data = await gzip(input, getOptions(options));
|
|
95
|
+
return data.length;
|
|
96
|
+
}
|
|
97
|
+
function gzipSizeSync(input, options) {
|
|
98
|
+
return zlib.gzipSync(input, getOptions(options)).length;
|
|
99
|
+
}
|
|
100
|
+
function gzipSizeFromFile(path, options) {
|
|
101
|
+
return new Promise((resolve, reject) => {
|
|
102
|
+
const stream2 = fs.createReadStream(path);
|
|
103
|
+
stream2.on("error", reject);
|
|
104
|
+
const gzipStream = stream2.pipe(gzipSizeStream(options));
|
|
105
|
+
gzipStream.on("error", reject);
|
|
106
|
+
gzipStream.on("gzip-size", resolve);
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
function gzipSizeFromFileSync(path, options) {
|
|
110
|
+
return gzipSizeSync(fs.readFileSync(path), options);
|
|
111
|
+
}
|
|
112
|
+
function gzipSizeStream(options) {
|
|
113
|
+
const input = new stream.PassThrough();
|
|
114
|
+
const output = new stream.PassThrough();
|
|
115
|
+
const wrapper = (0, import_duplexer.default)(input, output);
|
|
116
|
+
let gzipSize2 = 0;
|
|
117
|
+
const gzip2 = zlib.createGzip(getOptions(options)).on("data", (buf) => {
|
|
118
|
+
gzipSize2 += buf.length;
|
|
119
|
+
}).on("error", () => {
|
|
120
|
+
wrapper.gzipSize = 0;
|
|
121
|
+
}).on("end", () => {
|
|
122
|
+
wrapper.gzipSize = gzipSize2;
|
|
123
|
+
wrapper.emit("gzip-size", gzipSize2);
|
|
124
|
+
output.end();
|
|
125
|
+
});
|
|
126
|
+
input.pipe(gzip2);
|
|
127
|
+
input.pipe(output, { end: false });
|
|
128
|
+
return wrapper;
|
|
129
|
+
}
|
|
130
|
+
export {
|
|
131
|
+
gzipSize,
|
|
132
|
+
gzipSizeFromFile,
|
|
133
|
+
gzipSizeFromFileSync,
|
|
134
|
+
gzipSizeStream,
|
|
135
|
+
gzipSizeSync
|
|
136
|
+
};
|
|
137
|
+
//# sourceMappingURL=gzip-size-K37OQCQ2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../node_modules/.pnpm/duplexer@0.1.2/node_modules/duplexer/index.js","../node_modules/.pnpm/gzip-size@7.0.0/node_modules/gzip-size/index.js"],"sourcesContent":["var Stream = require(\"stream\")\nvar writeMethods = [\"write\", \"end\", \"destroy\"]\nvar readMethods = [\"resume\", \"pause\"]\nvar readEvents = [\"data\", \"close\"]\nvar slice = Array.prototype.slice\n\nmodule.exports = duplex\n\nfunction forEach (arr, fn) {\n if (arr.forEach) {\n return arr.forEach(fn)\n }\n\n for (var i = 0; i < arr.length; i++) {\n fn(arr[i], i)\n }\n}\n\nfunction duplex(writer, reader) {\n var stream = new Stream()\n var ended = false\n\n forEach(writeMethods, proxyWriter)\n\n forEach(readMethods, proxyReader)\n\n forEach(readEvents, proxyStream)\n\n reader.on(\"end\", handleEnd)\n\n writer.on(\"drain\", function() {\n stream.emit(\"drain\")\n })\n\n writer.on(\"error\", reemit)\n reader.on(\"error\", reemit)\n\n stream.writable = writer.writable\n stream.readable = reader.readable\n\n return stream\n\n function proxyWriter(methodName) {\n stream[methodName] = method\n\n function method() {\n return writer[methodName].apply(writer, arguments)\n }\n }\n\n function proxyReader(methodName) {\n stream[methodName] = method\n\n function method() {\n stream.emit(methodName)\n var func = reader[methodName]\n if (func) {\n return func.apply(reader, arguments)\n }\n reader.emit(methodName)\n }\n }\n\n function proxyStream(methodName) {\n reader.on(methodName, reemit)\n\n function reemit() {\n var args = slice.call(arguments)\n args.unshift(methodName)\n stream.emit.apply(stream, args)\n }\n }\n\n function handleEnd() {\n if (ended) {\n return\n }\n ended = true\n var args = slice.call(arguments)\n args.unshift(\"end\")\n stream.emit.apply(stream, args)\n }\n\n function reemit(err) {\n stream.emit(\"error\", err)\n }\n}\n","import fs from 'node:fs';\nimport stream from 'node:stream';\nimport zlib from 'node:zlib';\nimport {promisify} from 'node:util';\nimport duplexer from 'duplexer';\n\nconst getOptions = options => ({level: 9, ...options});\nconst gzip = promisify(zlib.gzip);\n\nexport async function gzipSize(input, options) {\n\tif (!input) {\n\t\treturn 0;\n\t}\n\n\tconst data = await gzip(input, getOptions(options));\n\treturn data.length;\n}\n\nexport function gzipSizeSync(input, options) {\n\treturn zlib.gzipSync(input, getOptions(options)).length;\n}\n\nexport function gzipSizeFromFile(path, options) {\n\t// TODO: Use `stream.pipeline` here.\n\n\treturn new Promise((resolve, reject) => {\n\t\tconst stream = fs.createReadStream(path);\n\t\tstream.on('error', reject);\n\n\t\tconst gzipStream = stream.pipe(gzipSizeStream(options));\n\t\tgzipStream.on('error', reject);\n\t\tgzipStream.on('gzip-size', resolve);\n\t});\n}\n\nexport function gzipSizeFromFileSync(path, options) {\n\treturn gzipSizeSync(fs.readFileSync(path), options);\n}\n\nexport function gzipSizeStream(options) {\n\t// TODO: Use `stream.pipeline` here.\n\n\tconst input = new stream.PassThrough();\n\tconst output = new stream.PassThrough();\n\tconst wrapper = duplexer(input, output);\n\n\tlet gzipSize = 0;\n\tconst gzip = zlib.createGzip(getOptions(options))\n\t\t.on('data', buf => {\n\t\t\tgzipSize += buf.length;\n\t\t})\n\t\t.on('error', () => {\n\t\t\twrapper.gzipSize = 0;\n\t\t})\n\t\t.on('end', () => {\n\t\t\twrapper.gzipSize = gzipSize;\n\t\t\twrapper.emit('gzip-size', gzipSize);\n\t\t\toutput.end();\n\t\t});\n\n\tinput.pipe(gzip);\n\tinput.pipe(output, {end: false});\n\n\treturn wrapper;\n}\n"],"mappings":";;;;;;;;AAAA;AAAA;AAAA;AAAA,QAAI,SAAS,UAAQ,QAAQ;AAC7B,QAAI,eAAe,CAAC,SAAS,OAAO,SAAS;AAC7C,QAAI,cAAc,CAAC,UAAU,OAAO;AACpC,QAAI,aAAa,CAAC,QAAQ,OAAO;AACjC,QAAI,QAAQ,MAAM,UAAU;AAE5B,WAAO,UAAU;AAEjB,aAAS,QAAS,KAAK,IAAI;AACvB,UAAI,IAAI,SAAS;AACb,eAAO,IAAI,QAAQ,EAAE;AAAA,MACzB;AAEA,eAAS,IAAI,GAAG,IAAI,IAAI,QAAQ,KAAK;AACjC,WAAG,IAAI,CAAC,GAAG,CAAC;AAAA,MAChB;AAAA,IACJ;AAEA,aAAS,OAAO,QAAQ,QAAQ;AAC5B,UAAIA,UAAS,IAAI,OAAO;AACxB,UAAI,QAAQ;AAEZ,cAAQ,cAAc,WAAW;AAEjC,cAAQ,aAAa,WAAW;AAEhC,cAAQ,YAAY,WAAW;AAE/B,aAAO,GAAG,OAAO,SAAS;AAE1B,aAAO,GAAG,SAAS,WAAW;AAC5B,QAAAA,QAAO,KAAK,OAAO;AAAA,MACrB,CAAC;AAED,aAAO,GAAG,SAAS,MAAM;AACzB,aAAO,GAAG,SAAS,MAAM;AAEzB,MAAAA,QAAO,WAAW,OAAO;AACzB,MAAAA,QAAO,WAAW,OAAO;AAEzB,aAAOA;AAEP,eAAS,YAAY,YAAY;AAC7B,QAAAA,QAAO,UAAU,IAAI;AAErB,iBAAS,SAAS;AACd,iBAAO,OAAO,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D;AAEO,SAAS,iBAAiB,MAAM,SAAS;AAG/C,SAAO,IAAI,QAAQ,CAAC,SAAS,WAAW;AACvC,UAAME,UAAS,GAAG,iBAAiB,IAAI;AACvC,IAAAA,QAAO,GAAG,SAAS,MAAM;AAEzB,UAAM,aAAaA,QAAO,KAAK,eAAe,OAAO,CAAC;AACtD,eAAW,GAAG,SAAS,MAAM;AAC7B,eAAW,GAAG,aAAa,OAAO;AAAA,EACnC,CAAC;AACF;AAEO,SAAS,qBAAqB,MAAM,SAAS;AACnD,SAAO,aAAa,GAAG,aAAa,IAAI,GAAG,OAAO;AACnD;AAEO,SAAS,eAAe,SAAS;AAGvC,QAAM,QAAQ,IAAI,OAAO,YAAY;AACrC,QAAM,SAAS,IAAI,OAAO,YAAY;AACtC,QAAM,cAAU,gBAAAC,SAAS,OAAO,MAAM;AAEtC,MAAIC,YAAW;AACf,QAAMC,QAAO,KAAK,WAAW,WAAW,OAAO,CAAC,EAC9C,GAAG,QAAQ,SAAO;AAClB,IAAAD,aAAY,IAAI;AAAA,EACjB,CAAC,EACA,GAAG,SAAS,MAAM;AAClB,YAAQ,WAAW;AAAA,EACpB,CAAC,EACA,GAAG,OAAO,MAAM;AAChB,YAAQ,WAAWA;AACnB,YAAQ,KAAK,aAAaA,SAAQ;AAClC,WAAO,IAAI;AAAA,EACZ,CAAC;AAEF,QAAM,KAAKC,KAAI;AACf,QAAM,KAAK,QAAQ,EAAC,KAAK,MAAK,CAAC;AAE/B,SAAO;AACR;","names":["stream","reemit","stream","duplexer","gzipSize","gzip"]}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire } from 'module';
|
|
3
|
+
const require = createRequire(import.meta.url);
|
|
4
|
+
import {
|
|
5
|
+
__commonJS,
|
|
6
|
+
__require,
|
|
7
|
+
__toESM
|
|
8
|
+
} from "./chunk-KMKDY2I6.js";
|
|
9
|
+
|
|
10
|
+
// node_modules/.pnpm/duplexer@0.1.2/node_modules/duplexer/index.js
|
|
11
|
+
var require_duplexer = __commonJS({
|
|
12
|
+
"node_modules/.pnpm/duplexer@0.1.2/node_modules/duplexer/index.js"(exports, module) {
|
|
13
|
+
"use strict";
|
|
14
|
+
var Stream = __require("stream");
|
|
15
|
+
var writeMethods = ["write", "end", "destroy"];
|
|
16
|
+
var readMethods = ["resume", "pause"];
|
|
17
|
+
var readEvents = ["data", "close"];
|
|
18
|
+
var slice = Array.prototype.slice;
|
|
19
|
+
module.exports = duplex;
|
|
20
|
+
function forEach(arr, fn) {
|
|
21
|
+
if (arr.forEach) {
|
|
22
|
+
return arr.forEach(fn);
|
|
23
|
+
}
|
|
24
|
+
for (var i = 0; i < arr.length; i++) {
|
|
25
|
+
fn(arr[i], i);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
function duplex(writer, reader) {
|
|
29
|
+
var stream2 = new Stream();
|
|
30
|
+
var ended = false;
|
|
31
|
+
forEach(writeMethods, proxyWriter);
|
|
32
|
+
forEach(readMethods, proxyReader);
|
|
33
|
+
forEach(readEvents, proxyStream);
|
|
34
|
+
reader.on("end", handleEnd);
|
|
35
|
+
writer.on("drain", function() {
|
|
36
|
+
stream2.emit("drain");
|
|
37
|
+
});
|
|
38
|
+
writer.on("error", reemit);
|
|
39
|
+
reader.on("error", reemit);
|
|
40
|
+
stream2.writable = writer.writable;
|
|
41
|
+
stream2.readable = reader.readable;
|
|
42
|
+
return stream2;
|
|
43
|
+
function proxyWriter(methodName) {
|
|
44
|
+
stream2[methodName] = method;
|
|
45
|
+
function method() {
|
|
46
|
+
return writer[methodName].apply(writer, arguments);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
function proxyReader(methodName) {
|
|
50
|
+
stream2[methodName] = method;
|
|
51
|
+
function method() {
|
|
52
|
+
stream2.emit(methodName);
|
|
53
|
+
var func = reader[methodName];
|
|
54
|
+
if (func) {
|
|
55
|
+
return func.apply(reader, arguments);
|
|
56
|
+
}
|
|
57
|
+
reader.emit(methodName);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
function proxyStream(methodName) {
|
|
61
|
+
reader.on(methodName, reemit2);
|
|
62
|
+
function reemit2() {
|
|
63
|
+
var args = slice.call(arguments);
|
|
64
|
+
args.unshift(methodName);
|
|
65
|
+
stream2.emit.apply(stream2, args);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
function handleEnd() {
|
|
69
|
+
if (ended) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
ended = true;
|
|
73
|
+
var args = slice.call(arguments);
|
|
74
|
+
args.unshift("end");
|
|
75
|
+
stream2.emit.apply(stream2, args);
|
|
76
|
+
}
|
|
77
|
+
function reemit(err) {
|
|
78
|
+
stream2.emit("error", err);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
// node_modules/.pnpm/gzip-size@7.0.0/node_modules/gzip-size/index.js
|
|
85
|
+
var import_duplexer = __toESM(require_duplexer(), 1);
|
|
86
|
+
import fs from "fs";
|
|
87
|
+
import stream from "stream";
|
|
88
|
+
import zlib from "zlib";
|
|
89
|
+
import { promisify } from "util";
|
|
90
|
+
var getOptions = (options) => ({ level: 9, ...options });
|
|
91
|
+
var gzip = promisify(zlib.gzip);
|
|
92
|
+
async function gzipSize(input, options) {
|
|
93
|
+
if (!input) {
|
|
94
|
+
return 0;
|
|
95
|
+
}
|
|
96
|
+
const data = await gzip(input, getOptions(options));
|
|
97
|
+
return data.length;
|
|
98
|
+
}
|
|
99
|
+
function gzipSizeSync(input, options) {
|
|
100
|
+
return zlib.gzipSync(input, getOptions(options)).length;
|
|
101
|
+
}
|
|
102
|
+
function gzipSizeFromFile(path, options) {
|
|
103
|
+
return new Promise((resolve, reject) => {
|
|
104
|
+
const stream2 = fs.createReadStream(path);
|
|
105
|
+
stream2.on("error", reject);
|
|
106
|
+
const gzipStream = stream2.pipe(gzipSizeStream(options));
|
|
107
|
+
gzipStream.on("error", reject);
|
|
108
|
+
gzipStream.on("gzip-size", resolve);
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
function gzipSizeFromFileSync(path, options) {
|
|
112
|
+
return gzipSizeSync(fs.readFileSync(path), options);
|
|
113
|
+
}
|
|
114
|
+
function gzipSizeStream(options) {
|
|
115
|
+
const input = new stream.PassThrough();
|
|
116
|
+
const output = new stream.PassThrough();
|
|
117
|
+
const wrapper = (0, import_duplexer.default)(input, output);
|
|
118
|
+
let gzipSize2 = 0;
|
|
119
|
+
const gzip2 = zlib.createGzip(getOptions(options)).on("data", (buf) => {
|
|
120
|
+
gzipSize2 += buf.length;
|
|
121
|
+
}).on("error", () => {
|
|
122
|
+
wrapper.gzipSize = 0;
|
|
123
|
+
}).on("end", () => {
|
|
124
|
+
wrapper.gzipSize = gzipSize2;
|
|
125
|
+
wrapper.emit("gzip-size", gzipSize2);
|
|
126
|
+
output.end();
|
|
127
|
+
});
|
|
128
|
+
input.pipe(gzip2);
|
|
129
|
+
input.pipe(output, { end: false });
|
|
130
|
+
return wrapper;
|
|
131
|
+
}
|
|
132
|
+
export {
|
|
133
|
+
gzipSize,
|
|
134
|
+
gzipSizeFromFile,
|
|
135
|
+
gzipSizeFromFileSync,
|
|
136
|
+
gzipSizeStream,
|
|
137
|
+
gzipSizeSync
|
|
138
|
+
};
|
|
139
|
+
//# sourceMappingURL=gzip-size-SHZBT5GU.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../node_modules/.pnpm/duplexer@0.1.2/node_modules/duplexer/index.js","../node_modules/.pnpm/gzip-size@7.0.0/node_modules/gzip-size/index.js"],"sourcesContent":["var Stream = require(\"stream\")\nvar writeMethods = [\"write\", \"end\", \"destroy\"]\nvar readMethods = [\"resume\", \"pause\"]\nvar readEvents = [\"data\", \"close\"]\nvar slice = Array.prototype.slice\n\nmodule.exports = duplex\n\nfunction forEach (arr, fn) {\n if (arr.forEach) {\n return arr.forEach(fn)\n }\n\n for (var i = 0; i < arr.length; i++) {\n fn(arr[i], i)\n }\n}\n\nfunction duplex(writer, reader) {\n var stream = new Stream()\n var ended = false\n\n forEach(writeMethods, proxyWriter)\n\n forEach(readMethods, proxyReader)\n\n forEach(readEvents, proxyStream)\n\n reader.on(\"end\", handleEnd)\n\n writer.on(\"drain\", function() {\n stream.emit(\"drain\")\n })\n\n writer.on(\"error\", reemit)\n reader.on(\"error\", reemit)\n\n stream.writable = writer.writable\n stream.readable = reader.readable\n\n return stream\n\n function proxyWriter(methodName) {\n stream[methodName] = method\n\n function method() {\n return writer[methodName].apply(writer, arguments)\n }\n }\n\n function proxyReader(methodName) {\n stream[methodName] = method\n\n function method() {\n stream.emit(methodName)\n var func = reader[methodName]\n if (func) {\n return func.apply(reader, arguments)\n }\n reader.emit(methodName)\n }\n }\n\n function proxyStream(methodName) {\n reader.on(methodName, reemit)\n\n function reemit() {\n var args = slice.call(arguments)\n args.unshift(methodName)\n stream.emit.apply(stream, args)\n }\n }\n\n function handleEnd() {\n if (ended) {\n return\n }\n ended = true\n var args = slice.call(arguments)\n args.unshift(\"end\")\n stream.emit.apply(stream, args)\n }\n\n function reemit(err) {\n stream.emit(\"error\", err)\n }\n}\n","import fs from 'node:fs';\nimport stream from 'node:stream';\nimport zlib from 'node:zlib';\nimport {promisify} from 'node:util';\nimport duplexer from 'duplexer';\n\nconst getOptions = options => ({level: 9, ...options});\nconst gzip = promisify(zlib.gzip);\n\nexport async function gzipSize(input, options) {\n\tif (!input) {\n\t\treturn 0;\n\t}\n\n\tconst data = await gzip(input, getOptions(options));\n\treturn data.length;\n}\n\nexport function gzipSizeSync(input, options) {\n\treturn zlib.gzipSync(input, getOptions(options)).length;\n}\n\nexport function gzipSizeFromFile(path, options) {\n\t// TODO: Use `stream.pipeline` here.\n\n\treturn new Promise((resolve, reject) => {\n\t\tconst stream = fs.createReadStream(path);\n\t\tstream.on('error', reject);\n\n\t\tconst gzipStream = stream.pipe(gzipSizeStream(options));\n\t\tgzipStream.on('error', reject);\n\t\tgzipStream.on('gzip-size', resolve);\n\t});\n}\n\nexport function gzipSizeFromFileSync(path, options) {\n\treturn gzipSizeSync(fs.readFileSync(path), options);\n}\n\nexport function gzipSizeStream(options) {\n\t// TODO: Use `stream.pipeline` here.\n\n\tconst input = new stream.PassThrough();\n\tconst output = new stream.PassThrough();\n\tconst wrapper = duplexer(input, output);\n\n\tlet gzipSize = 0;\n\tconst gzip = zlib.createGzip(getOptions(options))\n\t\t.on('data', buf => {\n\t\t\tgzipSize += buf.length;\n\t\t})\n\t\t.on('error', () => {\n\t\t\twrapper.gzipSize = 0;\n\t\t})\n\t\t.on('end', () => {\n\t\t\twrapper.gzipSize = gzipSize;\n\t\t\twrapper.emit('gzip-size', gzipSize);\n\t\t\toutput.end();\n\t\t});\n\n\tinput.pipe(gzip);\n\tinput.pipe(output, {end: false});\n\n\treturn wrapper;\n}\n"],"mappings":";;;;;;;;;;AAAA;AAAA;AAAA;AAAA,QAAI,SAAS,UAAQ,QAAQ;AAC7B,QAAI,eAAe,CAAC,SAAS,OAAO,SAAS;AAC7C,QAAI,cAAc,CAAC,UAAU,OAAO;AACpC,QAAI,aAAa,CAAC,QAAQ,OAAO;AACjC,QAAI,QAAQ,MAAM,UAAU;AAE5B,WAAO,UAAU;AAEjB,aAAS,QAAS,KAAK,IAAI;AACvB,UAAI,IAAI,SAAS;AACb,eAAO,IAAI,QAAQ,EAAE;AAAA,MACzB;AAEA,eAAS,IAAI,GAAG,IAAI,IAAI,QAAQ,KAAK;AACjC,WAAG,IAAI,CAAC,GAAG,CAAC;AAAA,MAChB;AAAA,IACJ;AAEA,aAAS,OAAO,QAAQ,QAAQ;AAC5B,UAAIA,UAAS,IAAI,OAAO;AACxB,UAAI,QAAQ;AAEZ,cAAQ,cAAc,WAAW;AAEjC,cAAQ,aAAa,WAAW;AAEhC,cAAQ,YAAY,WAAW;AAE/B,aAAO,GAAG,OAAO,SAAS;AAE1B,aAAO,GAAG,SAAS,WAAW;AAC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