keycloakify 10.0.0-rc.73 → 10.0.0-rc.75
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -3
- package/bin/266.index.js +806 -0
- package/bin/{772.index.js → 304.index.js} +262 -678
- package/bin/{363.index.js → 440.index.js} +24 -74
- package/bin/720.index.js +243 -0
- package/bin/877.index.js +275 -0
- package/bin/main.js +455 -330
- package/package.json +7 -9
- package/src/bin/keycloakify/generateFtl/generateFtl.ts +3 -20
- package/src/bin/keycloakify/generateResources/generateResourcesForMainTheme.ts +11 -16
- package/src/bin/keycloakify/replacers/replaceImportsInCssCode.ts +30 -62
- package/bin/246.index.js +0 -466
- package/bin/420.index.js +0 -508
- package/bin/509.index.js +0 -438
- package/src/bin/keycloakify/replacers/replaceImportsInInlineCssCode.ts +0 -28
package/bin/420.index.js
DELETED
@@ -1,508 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
exports.id = 420;
|
3
|
-
exports.ids = [420];
|
4
|
-
exports.modules = {
|
5
|
-
|
6
|
-
/***/ 32420:
|
7
|
-
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
8
|
-
|
9
|
-
__webpack_require__.r(__webpack_exports__);
|
10
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
11
|
-
/* harmony export */ "default": () => (/* binding */ cliTruncate)
|
12
|
-
/* harmony export */ });
|
13
|
-
/* harmony import */ var slice_ansi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(32470);
|
14
|
-
/* harmony import */ var string_width__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(10509);
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
function getIndexOfNearestSpace(string, wantedIndex, shouldSearchRight) {
|
19
|
-
if (string.charAt(wantedIndex) === ' ') {
|
20
|
-
return wantedIndex;
|
21
|
-
}
|
22
|
-
|
23
|
-
for (let index = 1; index <= 3; index++) {
|
24
|
-
if (shouldSearchRight) {
|
25
|
-
if (string.charAt(wantedIndex + index) === ' ') {
|
26
|
-
return wantedIndex + index;
|
27
|
-
}
|
28
|
-
} else if (string.charAt(wantedIndex - index) === ' ') {
|
29
|
-
return wantedIndex - index;
|
30
|
-
}
|
31
|
-
}
|
32
|
-
|
33
|
-
return wantedIndex;
|
34
|
-
}
|
35
|
-
|
36
|
-
function cliTruncate(text, columns, options) {
|
37
|
-
options = {
|
38
|
-
position: 'end',
|
39
|
-
preferTruncationOnSpace: false,
|
40
|
-
truncationCharacter: '…',
|
41
|
-
...options,
|
42
|
-
};
|
43
|
-
|
44
|
-
const {position, space, preferTruncationOnSpace} = options;
|
45
|
-
let {truncationCharacter} = options;
|
46
|
-
|
47
|
-
if (typeof text !== 'string') {
|
48
|
-
throw new TypeError(`Expected \`input\` to be a string, got ${typeof text}`);
|
49
|
-
}
|
50
|
-
|
51
|
-
if (typeof columns !== 'number') {
|
52
|
-
throw new TypeError(`Expected \`columns\` to be a number, got ${typeof columns}`);
|
53
|
-
}
|
54
|
-
|
55
|
-
if (columns < 1) {
|
56
|
-
return '';
|
57
|
-
}
|
58
|
-
|
59
|
-
if (columns === 1) {
|
60
|
-
return truncationCharacter;
|
61
|
-
}
|
62
|
-
|
63
|
-
const length = (0,string_width__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z)(text);
|
64
|
-
|
65
|
-
if (length <= columns) {
|
66
|
-
return text;
|
67
|
-
}
|
68
|
-
|
69
|
-
if (position === 'start') {
|
70
|
-
if (preferTruncationOnSpace) {
|
71
|
-
const nearestSpace = getIndexOfNearestSpace(text, length - columns + 1, true);
|
72
|
-
return truncationCharacter + (0,slice_ansi__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(text, nearestSpace, length).trim();
|
73
|
-
}
|
74
|
-
|
75
|
-
if (space === true) {
|
76
|
-
truncationCharacter += ' ';
|
77
|
-
}
|
78
|
-
|
79
|
-
return truncationCharacter + (0,slice_ansi__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(text, length - columns + (0,string_width__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z)(truncationCharacter), length);
|
80
|
-
}
|
81
|
-
|
82
|
-
if (position === 'middle') {
|
83
|
-
if (space === true) {
|
84
|
-
truncationCharacter = ` ${truncationCharacter} `;
|
85
|
-
}
|
86
|
-
|
87
|
-
const half = Math.floor(columns / 2);
|
88
|
-
|
89
|
-
if (preferTruncationOnSpace) {
|
90
|
-
const spaceNearFirstBreakPoint = getIndexOfNearestSpace(text, half);
|
91
|
-
const spaceNearSecondBreakPoint = getIndexOfNearestSpace(text, length - (columns - half) + 1, true);
|
92
|
-
return (0,slice_ansi__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(text, 0, spaceNearFirstBreakPoint) + truncationCharacter + (0,slice_ansi__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(text, spaceNearSecondBreakPoint, length).trim();
|
93
|
-
}
|
94
|
-
|
95
|
-
return (
|
96
|
-
(0,slice_ansi__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(text, 0, half)
|
97
|
-
+ truncationCharacter
|
98
|
-
+ (0,slice_ansi__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(text, length - (columns - half) + (0,string_width__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z)(truncationCharacter), length)
|
99
|
-
);
|
100
|
-
}
|
101
|
-
|
102
|
-
if (position === 'end') {
|
103
|
-
if (preferTruncationOnSpace) {
|
104
|
-
const nearestSpace = getIndexOfNearestSpace(text, columns - 1);
|
105
|
-
return (0,slice_ansi__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(text, 0, nearestSpace) + truncationCharacter;
|
106
|
-
}
|
107
|
-
|
108
|
-
if (space === true) {
|
109
|
-
truncationCharacter = ` ${truncationCharacter}`;
|
110
|
-
}
|
111
|
-
|
112
|
-
return (0,slice_ansi__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(text, 0, columns - (0,string_width__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z)(truncationCharacter)) + truncationCharacter;
|
113
|
-
}
|
114
|
-
|
115
|
-
throw new Error(`Expected \`options.position\` to be either \`start\`, \`middle\` or \`end\`, got ${position}`);
|
116
|
-
}
|
117
|
-
|
118
|
-
|
119
|
-
/***/ }),
|
120
|
-
|
121
|
-
/***/ 32470:
|
122
|
-
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
123
|
-
|
124
|
-
|
125
|
-
// EXPORTS
|
126
|
-
__webpack_require__.d(__webpack_exports__, {
|
127
|
-
"Z": () => (/* binding */ sliceAnsi)
|
128
|
-
});
|
129
|
-
|
130
|
-
;// CONCATENATED MODULE: ./node_modules/slice-ansi/node_modules/is-fullwidth-code-point/index.js
|
131
|
-
/* eslint-disable yoda */
|
132
|
-
|
133
|
-
function isFullwidthCodePoint(codePoint) {
|
134
|
-
if (!Number.isInteger(codePoint)) {
|
135
|
-
return false;
|
136
|
-
}
|
137
|
-
|
138
|
-
// Code points are derived from:
|
139
|
-
// https://unicode.org/Public/UNIDATA/EastAsianWidth.txt
|
140
|
-
return codePoint >= 0x1100 && (
|
141
|
-
codePoint <= 0x115F || // Hangul Jamo
|
142
|
-
codePoint === 0x2329 || // LEFT-POINTING ANGLE BRACKET
|
143
|
-
codePoint === 0x232A || // RIGHT-POINTING ANGLE BRACKET
|
144
|
-
// CJK Radicals Supplement .. Enclosed CJK Letters and Months
|
145
|
-
(0x2E80 <= codePoint && codePoint <= 0x3247 && codePoint !== 0x303F) ||
|
146
|
-
// Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A
|
147
|
-
(0x3250 <= codePoint && codePoint <= 0x4DBF) ||
|
148
|
-
// CJK Unified Ideographs .. Yi Radicals
|
149
|
-
(0x4E00 <= codePoint && codePoint <= 0xA4C6) ||
|
150
|
-
// Hangul Jamo Extended-A
|
151
|
-
(0xA960 <= codePoint && codePoint <= 0xA97C) ||
|
152
|
-
// Hangul Syllables
|
153
|
-
(0xAC00 <= codePoint && codePoint <= 0xD7A3) ||
|
154
|
-
// CJK Compatibility Ideographs
|
155
|
-
(0xF900 <= codePoint && codePoint <= 0xFAFF) ||
|
156
|
-
// Vertical Forms
|
157
|
-
(0xFE10 <= codePoint && codePoint <= 0xFE19) ||
|
158
|
-
// CJK Compatibility Forms .. Small Form Variants
|
159
|
-
(0xFE30 <= codePoint && codePoint <= 0xFE6B) ||
|
160
|
-
// Halfwidth and Fullwidth Forms
|
161
|
-
(0xFF01 <= codePoint && codePoint <= 0xFF60) ||
|
162
|
-
(0xFFE0 <= codePoint && codePoint <= 0xFFE6) ||
|
163
|
-
// Kana Supplement
|
164
|
-
(0x1B000 <= codePoint && codePoint <= 0x1B001) ||
|
165
|
-
// Enclosed Ideographic Supplement
|
166
|
-
(0x1F200 <= codePoint && codePoint <= 0x1F251) ||
|
167
|
-
// CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane
|
168
|
-
(0x20000 <= codePoint && codePoint <= 0x3FFFD)
|
169
|
-
);
|
170
|
-
}
|
171
|
-
|
172
|
-
;// CONCATENATED MODULE: ./node_modules/slice-ansi/node_modules/ansi-styles/index.js
|
173
|
-
const ANSI_BACKGROUND_OFFSET = 10;
|
174
|
-
|
175
|
-
const wrapAnsi16 = (offset = 0) => code => `\u001B[${code + offset}m`;
|
176
|
-
|
177
|
-
const wrapAnsi256 = (offset = 0) => code => `\u001B[${38 + offset};5;${code}m`;
|
178
|
-
|
179
|
-
const wrapAnsi16m = (offset = 0) => (red, green, blue) => `\u001B[${38 + offset};2;${red};${green};${blue}m`;
|
180
|
-
|
181
|
-
const styles = {
|
182
|
-
modifier: {
|
183
|
-
reset: [0, 0],
|
184
|
-
// 21 isn't widely supported and 22 does the same thing
|
185
|
-
bold: [1, 22],
|
186
|
-
dim: [2, 22],
|
187
|
-
italic: [3, 23],
|
188
|
-
underline: [4, 24],
|
189
|
-
overline: [53, 55],
|
190
|
-
inverse: [7, 27],
|
191
|
-
hidden: [8, 28],
|
192
|
-
strikethrough: [9, 29],
|
193
|
-
},
|
194
|
-
color: {
|
195
|
-
black: [30, 39],
|
196
|
-
red: [31, 39],
|
197
|
-
green: [32, 39],
|
198
|
-
yellow: [33, 39],
|
199
|
-
blue: [34, 39],
|
200
|
-
magenta: [35, 39],
|
201
|
-
cyan: [36, 39],
|
202
|
-
white: [37, 39],
|
203
|
-
|
204
|
-
// Bright color
|
205
|
-
blackBright: [90, 39],
|
206
|
-
gray: [90, 39], // Alias of `blackBright`
|
207
|
-
grey: [90, 39], // Alias of `blackBright`
|
208
|
-
redBright: [91, 39],
|
209
|
-
greenBright: [92, 39],
|
210
|
-
yellowBright: [93, 39],
|
211
|
-
blueBright: [94, 39],
|
212
|
-
magentaBright: [95, 39],
|
213
|
-
cyanBright: [96, 39],
|
214
|
-
whiteBright: [97, 39],
|
215
|
-
},
|
216
|
-
bgColor: {
|
217
|
-
bgBlack: [40, 49],
|
218
|
-
bgRed: [41, 49],
|
219
|
-
bgGreen: [42, 49],
|
220
|
-
bgYellow: [43, 49],
|
221
|
-
bgBlue: [44, 49],
|
222
|
-
bgMagenta: [45, 49],
|
223
|
-
bgCyan: [46, 49],
|
224
|
-
bgWhite: [47, 49],
|
225
|
-
|
226
|
-
// Bright color
|
227
|
-
bgBlackBright: [100, 49],
|
228
|
-
bgGray: [100, 49], // Alias of `bgBlackBright`
|
229
|
-
bgGrey: [100, 49], // Alias of `bgBlackBright`
|
230
|
-
bgRedBright: [101, 49],
|
231
|
-
bgGreenBright: [102, 49],
|
232
|
-
bgYellowBright: [103, 49],
|
233
|
-
bgBlueBright: [104, 49],
|
234
|
-
bgMagentaBright: [105, 49],
|
235
|
-
bgCyanBright: [106, 49],
|
236
|
-
bgWhiteBright: [107, 49],
|
237
|
-
},
|
238
|
-
};
|
239
|
-
|
240
|
-
const modifierNames = Object.keys(styles.modifier);
|
241
|
-
const foregroundColorNames = Object.keys(styles.color);
|
242
|
-
const backgroundColorNames = Object.keys(styles.bgColor);
|
243
|
-
const colorNames = [...foregroundColorNames, ...backgroundColorNames];
|
244
|
-
|
245
|
-
function assembleStyles() {
|
246
|
-
const codes = new Map();
|
247
|
-
|
248
|
-
for (const [groupName, group] of Object.entries(styles)) {
|
249
|
-
for (const [styleName, style] of Object.entries(group)) {
|
250
|
-
styles[styleName] = {
|
251
|
-
open: `\u001B[${style[0]}m`,
|
252
|
-
close: `\u001B[${style[1]}m`,
|
253
|
-
};
|
254
|
-
|
255
|
-
group[styleName] = styles[styleName];
|
256
|
-
|
257
|
-
codes.set(style[0], style[1]);
|
258
|
-
}
|
259
|
-
|
260
|
-
Object.defineProperty(styles, groupName, {
|
261
|
-
value: group,
|
262
|
-
enumerable: false,
|
263
|
-
});
|
264
|
-
}
|
265
|
-
|
266
|
-
Object.defineProperty(styles, 'codes', {
|
267
|
-
value: codes,
|
268
|
-
enumerable: false,
|
269
|
-
});
|
270
|
-
|
271
|
-
styles.color.close = '\u001B[39m';
|
272
|
-
styles.bgColor.close = '\u001B[49m';
|
273
|
-
|
274
|
-
styles.color.ansi = wrapAnsi16();
|
275
|
-
styles.color.ansi256 = wrapAnsi256();
|
276
|
-
styles.color.ansi16m = wrapAnsi16m();
|
277
|
-
styles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
|
278
|
-
styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
|
279
|
-
styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
|
280
|
-
|
281
|
-
// From https://github.com/Qix-/color-convert/blob/3f0e0d4e92e235796ccb17f6e85c72094a651f49/conversions.js
|
282
|
-
Object.defineProperties(styles, {
|
283
|
-
rgbToAnsi256: {
|
284
|
-
value: (red, green, blue) => {
|
285
|
-
// We use the extended greyscale palette here, with the exception of
|
286
|
-
// black and white. normal palette only has 4 greyscale shades.
|
287
|
-
if (red === green && green === blue) {
|
288
|
-
if (red < 8) {
|
289
|
-
return 16;
|
290
|
-
}
|
291
|
-
|
292
|
-
if (red > 248) {
|
293
|
-
return 231;
|
294
|
-
}
|
295
|
-
|
296
|
-
return Math.round(((red - 8) / 247) * 24) + 232;
|
297
|
-
}
|
298
|
-
|
299
|
-
return 16
|
300
|
-
+ (36 * Math.round(red / 255 * 5))
|
301
|
-
+ (6 * Math.round(green / 255 * 5))
|
302
|
-
+ Math.round(blue / 255 * 5);
|
303
|
-
},
|
304
|
-
enumerable: false,
|
305
|
-
},
|
306
|
-
hexToRgb: {
|
307
|
-
value: hex => {
|
308
|
-
const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
|
309
|
-
if (!matches) {
|
310
|
-
return [0, 0, 0];
|
311
|
-
}
|
312
|
-
|
313
|
-
let [colorString] = matches;
|
314
|
-
|
315
|
-
if (colorString.length === 3) {
|
316
|
-
colorString = [...colorString].map(character => character + character).join('');
|
317
|
-
}
|
318
|
-
|
319
|
-
const integer = Number.parseInt(colorString, 16);
|
320
|
-
|
321
|
-
return [
|
322
|
-
/* eslint-disable no-bitwise */
|
323
|
-
(integer >> 16) & 0xFF,
|
324
|
-
(integer >> 8) & 0xFF,
|
325
|
-
integer & 0xFF,
|
326
|
-
/* eslint-enable no-bitwise */
|
327
|
-
];
|
328
|
-
},
|
329
|
-
enumerable: false,
|
330
|
-
},
|
331
|
-
hexToAnsi256: {
|
332
|
-
value: hex => styles.rgbToAnsi256(...styles.hexToRgb(hex)),
|
333
|
-
enumerable: false,
|
334
|
-
},
|
335
|
-
ansi256ToAnsi: {
|
336
|
-
value: code => {
|
337
|
-
if (code < 8) {
|
338
|
-
return 30 + code;
|
339
|
-
}
|
340
|
-
|
341
|
-
if (code < 16) {
|
342
|
-
return 90 + (code - 8);
|
343
|
-
}
|
344
|
-
|
345
|
-
let red;
|
346
|
-
let green;
|
347
|
-
let blue;
|
348
|
-
|
349
|
-
if (code >= 232) {
|
350
|
-
red = (((code - 232) * 10) + 8) / 255;
|
351
|
-
green = red;
|
352
|
-
blue = red;
|
353
|
-
} else {
|
354
|
-
code -= 16;
|
355
|
-
|
356
|
-
const remainder = code % 36;
|
357
|
-
|
358
|
-
red = Math.floor(code / 36) / 5;
|
359
|
-
green = Math.floor(remainder / 6) / 5;
|
360
|
-
blue = (remainder % 6) / 5;
|
361
|
-
}
|
362
|
-
|
363
|
-
const value = Math.max(red, green, blue) * 2;
|
364
|
-
|
365
|
-
if (value === 0) {
|
366
|
-
return 30;
|
367
|
-
}
|
368
|
-
|
369
|
-
// eslint-disable-next-line no-bitwise
|
370
|
-
let result = 30 + ((Math.round(blue) << 2) | (Math.round(green) << 1) | Math.round(red));
|
371
|
-
|
372
|
-
if (value === 2) {
|
373
|
-
result += 60;
|
374
|
-
}
|
375
|
-
|
376
|
-
return result;
|
377
|
-
},
|
378
|
-
enumerable: false,
|
379
|
-
},
|
380
|
-
rgbToAnsi: {
|
381
|
-
value: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)),
|
382
|
-
enumerable: false,
|
383
|
-
},
|
384
|
-
hexToAnsi: {
|
385
|
-
value: hex => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),
|
386
|
-
enumerable: false,
|
387
|
-
},
|
388
|
-
});
|
389
|
-
|
390
|
-
return styles;
|
391
|
-
}
|
392
|
-
|
393
|
-
const ansiStyles = assembleStyles();
|
394
|
-
|
395
|
-
/* harmony default export */ const ansi_styles = (ansiStyles);
|
396
|
-
|
397
|
-
;// CONCATENATED MODULE: ./node_modules/slice-ansi/index.js
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
const astralRegex = /^[\uD800-\uDBFF][\uDC00-\uDFFF]$/;
|
402
|
-
|
403
|
-
const ESCAPES = [
|
404
|
-
'\u001B',
|
405
|
-
'\u009B'
|
406
|
-
];
|
407
|
-
|
408
|
-
const wrapAnsi = code => `${ESCAPES[0]}[${code}m`;
|
409
|
-
|
410
|
-
const checkAnsi = (ansiCodes, isEscapes, endAnsiCode) => {
|
411
|
-
let output = [];
|
412
|
-
ansiCodes = [...ansiCodes];
|
413
|
-
|
414
|
-
for (let ansiCode of ansiCodes) {
|
415
|
-
const ansiCodeOrigin = ansiCode;
|
416
|
-
if (ansiCode.includes(';')) {
|
417
|
-
ansiCode = ansiCode.split(';')[0][0] + '0';
|
418
|
-
}
|
419
|
-
|
420
|
-
const item = ansi_styles.codes.get(Number.parseInt(ansiCode, 10));
|
421
|
-
if (item) {
|
422
|
-
const indexEscape = ansiCodes.indexOf(item.toString());
|
423
|
-
if (indexEscape === -1) {
|
424
|
-
output.push(wrapAnsi(isEscapes ? item : ansiCodeOrigin));
|
425
|
-
} else {
|
426
|
-
ansiCodes.splice(indexEscape, 1);
|
427
|
-
}
|
428
|
-
} else if (isEscapes) {
|
429
|
-
output.push(wrapAnsi(0));
|
430
|
-
break;
|
431
|
-
} else {
|
432
|
-
output.push(wrapAnsi(ansiCodeOrigin));
|
433
|
-
}
|
434
|
-
}
|
435
|
-
|
436
|
-
if (isEscapes) {
|
437
|
-
output = output.filter((element, index) => output.indexOf(element) === index);
|
438
|
-
|
439
|
-
if (endAnsiCode !== undefined) {
|
440
|
-
const fistEscapeCode = wrapAnsi(ansi_styles.codes.get(Number.parseInt(endAnsiCode, 10)));
|
441
|
-
// TODO: Remove the use of `.reduce` here.
|
442
|
-
// eslint-disable-next-line unicorn/no-array-reduce
|
443
|
-
output = output.reduce((current, next) => next === fistEscapeCode ? [next, ...current] : [...current, next], []);
|
444
|
-
}
|
445
|
-
}
|
446
|
-
|
447
|
-
return output.join('');
|
448
|
-
};
|
449
|
-
|
450
|
-
function sliceAnsi(string, begin, end) {
|
451
|
-
const characters = [...string];
|
452
|
-
const ansiCodes = [];
|
453
|
-
|
454
|
-
let stringEnd = typeof end === 'number' ? end : characters.length;
|
455
|
-
let isInsideEscape = false;
|
456
|
-
let ansiCode;
|
457
|
-
let visible = 0;
|
458
|
-
let output = '';
|
459
|
-
|
460
|
-
for (const [index, character] of characters.entries()) {
|
461
|
-
let leftEscape = false;
|
462
|
-
|
463
|
-
if (ESCAPES.includes(character)) {
|
464
|
-
const code = /\d[^m]*/.exec(string.slice(index, index + 18));
|
465
|
-
ansiCode = code && code.length > 0 ? code[0] : undefined;
|
466
|
-
|
467
|
-
if (visible < stringEnd) {
|
468
|
-
isInsideEscape = true;
|
469
|
-
|
470
|
-
if (ansiCode !== undefined) {
|
471
|
-
ansiCodes.push(ansiCode);
|
472
|
-
}
|
473
|
-
}
|
474
|
-
} else if (isInsideEscape && character === 'm') {
|
475
|
-
isInsideEscape = false;
|
476
|
-
leftEscape = true;
|
477
|
-
}
|
478
|
-
|
479
|
-
if (!isInsideEscape && !leftEscape) {
|
480
|
-
visible++;
|
481
|
-
}
|
482
|
-
|
483
|
-
if (!astralRegex.test(character) && isFullwidthCodePoint(character.codePointAt())) {
|
484
|
-
visible++;
|
485
|
-
|
486
|
-
if (typeof end !== 'number') {
|
487
|
-
stringEnd++;
|
488
|
-
}
|
489
|
-
}
|
490
|
-
|
491
|
-
if (visible > begin && visible <= stringEnd) {
|
492
|
-
output += character;
|
493
|
-
} else if (visible === begin && !isInsideEscape && ansiCode !== undefined) {
|
494
|
-
output = checkAnsi(ansiCodes);
|
495
|
-
} else if (visible >= stringEnd) {
|
496
|
-
output += checkAnsi(ansiCodes, true, ansiCode);
|
497
|
-
break;
|
498
|
-
}
|
499
|
-
}
|
500
|
-
|
501
|
-
return output;
|
502
|
-
}
|
503
|
-
|
504
|
-
|
505
|
-
/***/ })
|
506
|
-
|
507
|
-
};
|
508
|
-
;
|