massarg 1.0.7-pre.1 → 2.0.0-pre.10

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/help.d.ts.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"help.d.ts","sourceRoot":"","sources":["../src/help.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAA;AAEnB,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAC1C,OAAO,EAAE,YAAY,EAAgC,MAAM,SAAS,CAAA;AAQpE,eAAO,MAAM,0BAA0B;IACrC,sCAAsC;;IAEtC,0DAA0D;;IAE1D,uCAAuC;;;;;;;;;;;;;;;;;IAEvC,8CAA8C;;;;;;;;;;;;;;;;;IAE9C,2EAA2E;;IAE3E,8EAA8E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAE9E,CAAA;AACF,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAA;AAEnF,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASrC,CAAA;AACD,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAA;AAEjF,eAAO,MAAM,UAAU;IACrB;;;;OAIG;;IAEH;;;;OAIG;;IAGH,6GAA6G;;IAG7G,mDAAmD;;QA5CnD,sCAAsC;;QAEtC,0DAA0D;;QAE1D,uCAAuC;;;;;;;;;;;;;;;;;QAEvC,8CAA8C;;;;;;;;;;;;;;;;;QAE9C,2EAA2E;;QAE3E,8EAA8E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAoC9E,kDAAkD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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QAAQ,GAAG;IACrB,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,WAAW,EAAE,MAAM,CAAA;IACnB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB,CAAA;AAED,qBAAa,aAAa;IACxB,KAAK,EAAE,cAAc,CAAC,GAAG,CAAC,CAAA;IAC1B,MAAM,EAAE,YAAY,CAAC,UAAU,CAAC,CAAA;gBAEpB,KAAK,EAAE,cAAc,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,EAAE,UAAU;IAK3D,QAAQ,IAAI,MAAM;IAuHlB,SAAS,IAAI,IAAI;CAGlB"}
package/help.js ADDED
@@ -0,0 +1,345 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.HelpGenerator = exports.defaultHelpConfig = exports.HelpConfig = exports.GenerateTableOptionConfig = exports.GenerateTableCommandConfig = void 0;
7
+ const zod_1 = __importDefault(require("zod"));
8
+ const style_1 = require("./style");
9
+ const utils_1 = require("./utils");
10
+ const option_1 = require("./option");
11
+ exports.GenerateTableCommandConfig = zod_1.default.object({
12
+ /** Length of each row in the table */
13
+ lineLength: zod_1.default.number().optional(),
14
+ /** When `false`, each row is separated by a blank line */
15
+ compact: zod_1.default.boolean().optional(),
16
+ /** Style of the command/option name */
17
+ nameStyle: style_1.StringStyle.optional(),
18
+ /** Style of the command/option description */
19
+ descriptionStyle: style_1.StringStyle.optional(),
20
+ /** Prefix for the command/option name (default is the command's prefix) */
21
+ namePrefix: zod_1.default.string().optional(),
22
+ /** Prefix for the command/option aliases (default is the command's prefix) */
23
+ aliasPrefix: zod_1.default.string().optional(),
24
+ });
25
+ exports.GenerateTableOptionConfig = exports.GenerateTableCommandConfig.merge(zod_1.default.object({
26
+ /** Prefix for the command/option negations (default is the command's prefix) */
27
+ negatePrefix: zod_1.default.string().optional(),
28
+ /** Prefix for the command/option negation aliases (default is the command's prefix) */
29
+ negateAliasPrefix: zod_1.default.string().optional(),
30
+ /** Whether to display negations with each option name */
31
+ displayNegations: zod_1.default.boolean().optional(),
32
+ }));
33
+ exports.HelpConfig = zod_1.default.object({
34
+ /**
35
+ * Whether to bind the help command to this command
36
+ *
37
+ * Set this to `true` to automatically add a `help` command to this command's subcommands.
38
+ */
39
+ bindCommand: zod_1.default.boolean().optional(),
40
+ /**
41
+ * Whether to bind the help option to this command
42
+ *
43
+ * Set this to `true` to automatically add a `--help` option to this command's options.
44
+ */
45
+ bindOption: zod_1.default.boolean().optional(),
46
+ /** Whether to align all tables to the column widths, or have each table be independent. Default is `true` */
47
+ useGlobalTableColumns: zod_1.default.boolean().default(true).optional(),
48
+ /** Options for generating the table of commands */
49
+ commandOptions: exports.GenerateTableCommandConfig.omit({ lineLength: true }).optional(),
50
+ /** Options for generating the table of options */
51
+ optionOptions: exports.GenerateTableOptionConfig.omit({ lineLength: true }).optional(),
52
+ /** Style of the help title */
53
+ titleStyle: style_1.StringStyle.optional(),
54
+ /** Style of the help description */
55
+ descriptionStyle: style_1.StringStyle.optional(),
56
+ /** Style of the help subtitles for commands, options and examples */
57
+ subtitleStyle: style_1.StringStyle.optional(),
58
+ /** Style of the help usage */
59
+ usageStyle: zod_1.default
60
+ .object({
61
+ /** Style of the help usage title - appears before the usage text (custom or auto) */
62
+ prefix: style_1.StringStyle.optional(),
63
+ /**
64
+ * For custom usage text, this is the primary style used (right after the `prefix` style).
65
+ * For automated usage text, this style is used for the command/binary name
66
+ */
67
+ main: style_1.StringStyle.optional(),
68
+ /** Style of the help usage commands (if any) */
69
+ command: style_1.StringStyle.optional(),
70
+ /** Style of the help usage options (if any) */
71
+ options: style_1.StringStyle.optional(),
72
+ })
73
+ .optional(),
74
+ /** Style of the help header */
75
+ headerStyle: style_1.StringStyle.optional(),
76
+ /** Style of the help footer */
77
+ footerStyle: style_1.StringStyle.optional(),
78
+ /** Maximum length of a row in the help output */
79
+ lineLength: zod_1.default.number().optional(),
80
+ /** Options for examples section */
81
+ exampleOptions: zod_1.default
82
+ .object({
83
+ /** Style of the example description */
84
+ descriptionStyle: style_1.StringStyle.optional(),
85
+ /** Style of the example input */
86
+ inputStyle: style_1.StringStyle.optional(),
87
+ /** Style of the example output */
88
+ outputStyle: style_1.StringStyle.optional(),
89
+ /** Prefix for the example input (default: `$`) */
90
+ inputPrefix: zod_1.default.string().default('$').optional(),
91
+ /** Prefix for the example output (default: `>`) */
92
+ outputPrefix: zod_1.default.string().default('➜').optional(),
93
+ /** Style of the example input/output prefixes */
94
+ prefixStyle: style_1.StringStyle.optional(),
95
+ /** Whether to compact the examples section */
96
+ compact: zod_1.default.boolean().default(true).optional(),
97
+ })
98
+ .optional(),
99
+ /** Text to display at the very top, describing CLI usage */
100
+ usageText: zod_1.default.string().optional(),
101
+ /** Text to display above the description, below the usage */
102
+ headerText: zod_1.default.string().optional(),
103
+ /** Text to display at the very bottom, below the examples */
104
+ footerText: zod_1.default.string().optional(),
105
+ });
106
+ exports.defaultHelpConfig = {
107
+ lineLength: 80,
108
+ useGlobalTableColumns: true,
109
+ commandOptions: {
110
+ nameStyle: {
111
+ color: 'yellow',
112
+ },
113
+ descriptionStyle: {
114
+ color: 'gray',
115
+ },
116
+ },
117
+ optionOptions: {
118
+ namePrefix: option_1.OPT_FULL_PREFIX,
119
+ aliasPrefix: option_1.OPT_SHORT_PREFIX,
120
+ negatePrefix: option_1.NEGATE_FULL_PREFIX,
121
+ negateAliasPrefix: option_1.NEGATE_SHORT_PREFIX,
122
+ displayNegations: false,
123
+ nameStyle: {
124
+ color: 'yellow',
125
+ },
126
+ descriptionStyle: {
127
+ color: 'gray',
128
+ },
129
+ },
130
+ descriptionStyle: {},
131
+ exampleOptions: {
132
+ descriptionStyle: {
133
+ bold: true,
134
+ color: 'brightWhite',
135
+ },
136
+ inputStyle: {
137
+ color: 'yellow',
138
+ },
139
+ outputStyle: {
140
+ color: 'brightWhite',
141
+ },
142
+ inputPrefix: '$',
143
+ outputPrefix: '➜',
144
+ prefixStyle: {
145
+ color: 'gray',
146
+ },
147
+ compact: true,
148
+ },
149
+ bindCommand: false,
150
+ bindOption: false,
151
+ titleStyle: {
152
+ bold: true,
153
+ color: 'yellow',
154
+ },
155
+ usageStyle: {
156
+ prefix: {
157
+ bold: true,
158
+ color: 'brightWhite',
159
+ },
160
+ main: {
161
+ color: 'yellow',
162
+ },
163
+ command: {
164
+ color: 'gray',
165
+ },
166
+ options: {
167
+ color: 'gray',
168
+ },
169
+ },
170
+ subtitleStyle: {
171
+ bold: true,
172
+ color: 'brightWhite',
173
+ underline: true,
174
+ },
175
+ headerText: '',
176
+ footerText: '',
177
+ usageText: '',
178
+ headerStyle: {},
179
+ footerStyle: {},
180
+ };
181
+ class HelpGenerator {
182
+ constructor(entry, config) {
183
+ this.entry = entry;
184
+ this.config = exports.HelpConfig.required().parse((0, utils_1.deepMerge)(entry.helpConfig, config));
185
+ }
186
+ generate() {
187
+ const entry = this.entry;
188
+ const CMD_OPT_INDENT = 4;
189
+ const _wrap = (text, indent = 0) => wrap(text, this.config.lineLength - indent);
190
+ const _subindent = (text, amt) => text.replace(/\n/g, '\n' + ' '.repeat(amt));
191
+ const optionOptions = {
192
+ ...this.config.optionOptions,
193
+ lineLength: this.config.lineLength - CMD_OPT_INDENT,
194
+ };
195
+ const commandOptions = {
196
+ ...this.config.commandOptions,
197
+ displayNegations: false,
198
+ lineLength: this.config.lineLength - CMD_OPT_INDENT,
199
+ };
200
+ const maxNameLength = this.config.useGlobalTableColumns
201
+ ? Math.max(getMaxNameLength(entry.options.map((e) => getItemDetails(e, optionOptions))), getMaxNameLength(entry.commands.map((e) => getItemDetails(e, commandOptions))))
202
+ : undefined;
203
+ const options = generateHelpTable(entry.options, optionOptions, maxNameLength).trimEnd();
204
+ const commands = generateHelpTable(entry.commands, commandOptions, maxNameLength).trimEnd();
205
+ const examples = entry.examples
206
+ .map((example) => {
207
+ const { description, input, output } = example;
208
+ return (0, utils_1.strConcat)(description && [
209
+ _wrap((0, style_1.format)(description, this.config.exampleOptions.descriptionStyle), 4),
210
+ ], ...(description && input && this.config.exampleOptions.compact ? [] : ['']), input &&
211
+ _subindent(_wrap([
212
+ this.config.exampleOptions.inputPrefix &&
213
+ (0, style_1.format)(this.config.exampleOptions.inputPrefix, this.config.exampleOptions.prefixStyle),
214
+ (0, style_1.format)(input, this.config.exampleOptions.inputStyle),
215
+ ]
216
+ .filter(Boolean)
217
+ .join(' '), 4), (this.config.exampleOptions.inputPrefix ?? '').length + 1), output &&
218
+ _subindent(_wrap([
219
+ this.config.exampleOptions.outputPrefix &&
220
+ (0, style_1.format)(this.config.exampleOptions.outputPrefix, this.config.exampleOptions.prefixStyle),
221
+ (0, style_1.format)(output, this.config.exampleOptions.outputStyle),
222
+ ]
223
+ .filter(Boolean)
224
+ .join(' '), 4), (this.config.exampleOptions.outputPrefix ?? '').length + 1), '');
225
+ })
226
+ .join('\n');
227
+ const { headerText, footerText, usageText } = this.config;
228
+ return ((0, utils_1.strConcat)(_wrap(usageText
229
+ ? (0, utils_1.strConcat)((0, style_1.format)('Usage:', this.config.usageStyle.prefix), (0, style_1.format)(usageText, this.config.usageStyle.main))
230
+ : [
231
+ (0, style_1.format)(`Usage:`, this.config.usageStyle.prefix),
232
+ (0, style_1.format)(entry.name, this.config.usageStyle.main),
233
+ commands.length && (0, style_1.format)('[command]', this.config.usageStyle.command),
234
+ options.length && (0, style_1.format)('[options]', this.config.usageStyle.options),
235
+ ]
236
+ .filter(Boolean)
237
+ .join(' ')), headerText.length && ['', (0, style_1.format)(headerText, this.config.descriptionStyle)], entry.description.length && [
238
+ '',
239
+ _wrap((0, style_1.format)(entry.description, this.config.descriptionStyle)),
240
+ ], commands.length &&
241
+ (0, utils_1.indent)([
242
+ '',
243
+ (0, style_1.format)(entry.parent ? `Commands for ${entry.name}:` : 'Commands:', this.config.subtitleStyle),
244
+ '',
245
+ (0, utils_1.indent)(commands),
246
+ ]), options.length &&
247
+ (0, utils_1.indent)([
248
+ '',
249
+ (0, style_1.format)(entry.parent ? `Options for ${entry.name}:` : 'Options:', this.config.subtitleStyle),
250
+ '',
251
+ (0, utils_1.indent)(options),
252
+ ]), examples.length &&
253
+ (0, utils_1.indent)(['', (0, style_1.format)('Examples:', this.config.subtitleStyle), '', (0, utils_1.indent)(examples)]), footerText.length && ['', _wrap((0, style_1.format)(footerText, this.config.descriptionStyle))]) + '\n');
254
+ }
255
+ printHelp() {
256
+ console.log(this.generate());
257
+ }
258
+ }
259
+ exports.HelpGenerator = HelpGenerator;
260
+ function wrap(text, lineLength) {
261
+ const length = (0, style_1.stripStyle)(text).length;
262
+ if (length <= lineLength) {
263
+ return text;
264
+ }
265
+ const subRows = [];
266
+ const words = text.split(' ');
267
+ let currentRow = '';
268
+ for (const word of words) {
269
+ if ((0, style_1.stripStyle)(currentRow).length + (0, style_1.stripStyle)(word).length + 1 > lineLength) {
270
+ subRows.push(currentRow);
271
+ currentRow = '';
272
+ }
273
+ currentRow += `${word} `;
274
+ }
275
+ subRows.push(currentRow);
276
+ return subRows.join('\n');
277
+ }
278
+ const getMaxNameLength = (items) => Math.max(...items.map((o) => o.name.length));
279
+ function getItemDetails(o, options) {
280
+ const { displayNegations = false, namePrefix = '', negatePrefix = '', aliasPrefix = '', negateAliasPrefix = '', } = options ?? {};
281
+ const description = o.description;
282
+ const hidden = o.hidden || false;
283
+ const negatable = (displayNegations && o.negatable) || false;
284
+ const cmdNames = {
285
+ full: `${namePrefix}${o.name}`,
286
+ fullNegated: negatePrefix ? `${negatePrefix}${o.name}` : undefined,
287
+ aliases: o.aliases.map((a) => `${aliasPrefix}${a}`).join(' | '),
288
+ aliasesNegated: negatePrefix
289
+ ? o.aliases.map((a) => `${negateAliasPrefix}${a}`).join(' | ')
290
+ : undefined,
291
+ };
292
+ const name = [
293
+ cmdNames.full,
294
+ cmdNames.aliases,
295
+ negatable && cmdNames.fullNegated,
296
+ negatable && cmdNames.aliasesNegated,
297
+ ]
298
+ .filter(Boolean)
299
+ .join(' | ');
300
+ return { name, description, hidden, negatable };
301
+ }
302
+ function generateHelpTable(items, fullConfig = {}, maxNameLength) {
303
+ const { lineLength = 80, namePrefix = '', aliasPrefix = '', negatePrefix = '', negateAliasPrefix = '', displayNegations = false, compact = false, ...config } = fullConfig;
304
+ const rows = items
305
+ .map((o) => getItemDetails(o, {
306
+ namePrefix,
307
+ aliasPrefix,
308
+ negatePrefix,
309
+ negateAliasPrefix,
310
+ displayNegations,
311
+ }))
312
+ .filter((r) => !r.hidden);
313
+ maxNameLength ??= getMaxNameLength(rows);
314
+ const nameStyle = (name) => (0, style_1.format)(name, config.nameStyle);
315
+ const descStyle = (desc) => (0, style_1.format)(desc, config.descriptionStyle);
316
+ const table = rows.map((row) => {
317
+ const name = nameStyle(row.name.padEnd(maxNameLength + 2));
318
+ const description = descStyle(row.description);
319
+ const length = (0, style_1.stripStyle)(name).length + (0, style_1.stripStyle)(description).length;
320
+ if (length <= lineLength) {
321
+ const line = `${name}${description}`;
322
+ if (!compact) {
323
+ return `${line}\n`;
324
+ }
325
+ return line;
326
+ }
327
+ const subRows = [];
328
+ const words = description.split(' ');
329
+ let currentRow = name;
330
+ for (const word of words) {
331
+ if ((0, style_1.stripStyle)(currentRow).length + (0, style_1.stripStyle)(word).length + 1 > lineLength) {
332
+ subRows.push(currentRow);
333
+ currentRow = ' '.repeat(maxNameLength + 2);
334
+ }
335
+ currentRow += `${word} `;
336
+ }
337
+ subRows.push(currentRow);
338
+ if (!compact) {
339
+ subRows.push('');
340
+ }
341
+ return subRows.join('\n');
342
+ });
343
+ return table.join('\n');
344
+ }
345
+ //# sourceMappingURL=help.js.map
package/help.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"help.js","sourceRoot":"","sources":["../src/help.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAmB;AACnB,mCAAyD;AAEzD,mCA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UAAU,CAAC,CAAA;gBACxB,UAAU,GAAG,GAAG,CAAC,MAAM,CAAC,aAAc,GAAG,CAAC,CAAC,CAAA;aAC5C;YACD,UAAU,IAAI,GAAG,IAAI,GAAG,CAAA;SACzB;QACD,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;QAExB,IAAI,CAAC,OAAO,EAAE;YACZ,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;SACjB;QAED,OAAO,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC3B,CAAC,CAAC,CAAA;IAEF,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACzB,CAAC"}
package/index.d.ts CHANGED
@@ -1,71 +1,2 @@
1
- #!/usr/bin/env node
2
- import { OptionsBase, CommandDef, HelpDef, MainDef, OptionDef, ExampleDef } from "./types";
3
- export declare class Massarg<Options> {
4
- private _main?;
5
- private _options;
6
- private _commands;
7
- private _runCommand?;
8
- private _examples;
9
- private _maxNameLen;
10
- /**
11
- * These are the parsed options passed via args. They will only be available after using `parse()` or `printHelp()`,
12
- * or when returned by `parseArgs()`. */
13
- data: Options & OptionsBase;
14
- private _help;
15
- private _requiredOptions;
16
- constructor();
17
- /** Define the main command to run when no commands are passed. */
18
- main(run: MainDef<Options>): Massarg<Options>;
19
- /** Add option to be parsed */
20
- option<Value>(option: OptionDef<Options, Value>): Massarg<Options>;
21
- /** Add example line to be added to the help text. */
22
- example(example: ExampleDef): Massarg<Options>;
23
- /** Add command to be run */
24
- command(command: CommandDef<Options>): Massarg<Options>;
25
- /** Set options for behavior of the help text print. */
26
- help(help: HelpDef): Massarg<Options>;
27
- /**
28
- * Print the help text without being required to pass option.
29
- *
30
- * @param args If args weren't already parsed, you can add them here
31
- */
32
- printHelp(args?: string[]): void;
33
- /**
34
- * Get the help text as an array of lines. Useful for manipulating the response or querying before displaying
35
- * to the user.
36
- */
37
- getHelpString(args?: string[]): string[];
38
- /**
39
- * Parse the arguments without running the commands related to them. Useful for testing or querying the data from the
40
- * args manually, if it is for some reason not enough to parse it normally through defining commands.
41
- * @param args Arguments to parse. Defaults to `process.argv`
42
- * @returns Parsed options
43
- */
44
- parseArgs(args?: string[]): Options & OptionsBase;
45
- /**
46
- * Parse the given args, running any relevant commands in the process.
47
- *
48
- * @param args args to parse. Defaults to `process.argv`
49
- */
50
- parse(args?: string[]): void;
51
- private _prepareRequired;
52
- private _printExamples;
53
- private _isTruthy;
54
- private _ensureRequired;
55
- private _addOptionToData;
56
- private _pushToArrayData;
57
- private _getWrappedLines;
58
- private _printCommands;
59
- private _printOptions;
60
- private _optionDescription;
61
- private _fullCmdName;
62
- private _fullOptName;
63
- private _commandOptions;
64
- private _optionCommands;
65
- private _globalOptions;
66
- private color;
67
- private colorCount;
68
- }
69
- export declare function massarg<T>(): Massarg<T>;
70
- export default massarg;
1
+ export * from './massarg';
71
2
  //# sourceMappingURL=index.d.ts.map
package/index.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAMA,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAK1F,qBAAa,OAAO,CAAC,OAAO;IAC1B,OAAO,CAAC,KAAK,CAAC,CAAkB;IAChC,OAAO,CAAC,QAAQ,CAAgC;IAChD,OAAO,CAAC,SAAS,CAA4B;IAC7C,OAAO,CAAC,WAAW,CAAC,CAAqB;IACzC,OAAO,CAAC,SAAS,CAAmB;IACpC,OAAO,CAAC,WAAW,CAAI;IACvB;;4CAEwC;IACjC,IAAI,EAAE,OAAO,GAAG,WAAW,CAAmE;IAErG,OAAO,CAAC,KAAK,CAkBZ;IACD,OAAO,CAAC,gBAAgB,CAAsD;;IAW9E,kEAAkE;IAC3D,IAAI,CAAC,GAAG,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,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