@keycloakify/svelte 0.2.7 → 0.2.8

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.
Files changed (127) hide show
  1. package/keycloakify-svelte/account/DefaultPage.svelte +1 -1
  2. package/keycloakify-svelte/account/Template.svelte +14 -7
  3. package/keycloakify-svelte/account/pages/Account.svelte +10 -8
  4. package/keycloakify-svelte/account/pages/Applications.svelte +8 -6
  5. package/keycloakify-svelte/account/pages/FederatedIdentity.svelte +2 -2
  6. package/keycloakify-svelte/account/pages/Log.svelte +8 -6
  7. package/keycloakify-svelte/account/pages/Password.svelte +10 -8
  8. package/keycloakify-svelte/account/pages/Sessions.svelte +8 -6
  9. package/keycloakify-svelte/account/pages/Totp.svelte +8 -6
  10. package/keycloakify-svelte/bin/200.index.js +27 -28
  11. package/keycloakify-svelte/bin/266.index.js +47 -49
  12. package/keycloakify-svelte/bin/{343.index.js → 545.index.js} +4079 -2565
  13. package/keycloakify-svelte/bin/709.index.js +40 -41
  14. package/keycloakify-svelte/bin/818.index.js +57 -59
  15. package/keycloakify-svelte/bin/index.js +626 -1903
  16. package/keycloakify-svelte/login/DefaultPage.svelte +1 -1
  17. package/keycloakify-svelte/login/Template.svelte +14 -8
  18. package/keycloakify-svelte/login/components/AddRemoveButtonsMultiValuedAttribute.svelte +6 -4
  19. package/keycloakify-svelte/login/components/AddRemoveButtonsMultiValuedAttribute.svelte.d.ts +1 -1
  20. package/keycloakify-svelte/login/components/GroupLabel.svelte +11 -9
  21. package/keycloakify-svelte/login/components/InputFieldByType.svelte +2 -2
  22. package/keycloakify-svelte/login/components/InputTag.svelte +5 -5
  23. package/keycloakify-svelte/login/components/InputTagSelects.svelte +51 -47
  24. package/keycloakify-svelte/login/components/LogoutOtherSessions.svelte +1 -1
  25. package/keycloakify-svelte/login/components/PasswordWrapper.svelte +2 -2
  26. package/keycloakify-svelte/login/components/SelectTag.svelte +21 -19
  27. package/keycloakify-svelte/login/components/TermsAcceptance.svelte +1 -1
  28. package/keycloakify-svelte/login/components/TextareaTag.svelte +6 -3
  29. package/keycloakify-svelte/login/components/UserProfileFormFields.svelte +6 -6
  30. package/keycloakify-svelte/login/pages/Code.svelte +9 -7
  31. package/keycloakify-svelte/login/pages/DeleteAccountConfirm.svelte +8 -6
  32. package/keycloakify-svelte/login/pages/DeleteCredential.svelte +8 -6
  33. package/keycloakify-svelte/login/pages/Error.svelte +2 -2
  34. package/keycloakify-svelte/login/pages/FrontchannelLogout.svelte +2 -2
  35. package/keycloakify-svelte/login/pages/IdpReviewUserProfile.svelte +8 -6
  36. package/keycloakify-svelte/login/pages/Info.svelte +2 -2
  37. package/keycloakify-svelte/login/pages/Login.svelte +10 -7
  38. package/keycloakify-svelte/login/pages/LoginConfigTotp.svelte +8 -6
  39. package/keycloakify-svelte/login/pages/LoginIdpLinkConfirm.svelte +8 -6
  40. package/keycloakify-svelte/login/pages/LoginIdpLinkConfirmOverride.svelte +8 -6
  41. package/keycloakify-svelte/login/pages/LoginIdpLinkEmail.svelte +2 -2
  42. package/keycloakify-svelte/login/pages/LoginOauth2DeviceVerifyUserCode.svelte +8 -6
  43. package/keycloakify-svelte/login/pages/LoginOauthGrant.svelte +8 -6
  44. package/keycloakify-svelte/login/pages/LoginOtp.svelte +8 -6
  45. package/keycloakify-svelte/login/pages/LoginPageExpired.svelte +2 -2
  46. package/keycloakify-svelte/login/pages/LoginPasskeysConditionalAuthenticate.svelte +14 -7
  47. package/keycloakify-svelte/login/pages/LoginPassword.svelte +8 -6
  48. package/keycloakify-svelte/login/pages/LoginRecoveryAuthnCodeConfig.svelte +10 -7
  49. package/keycloakify-svelte/login/pages/LoginRecoveryAuthnCodeInput.svelte +8 -6
  50. package/keycloakify-svelte/login/pages/LoginResetOtp.svelte +8 -6
  51. package/keycloakify-svelte/login/pages/LoginResetPassword.svelte +8 -6
  52. package/keycloakify-svelte/login/pages/LoginUpdatePassword.svelte +8 -6
  53. package/keycloakify-svelte/login/pages/LoginUpdateProfile.svelte +8 -6
  54. package/keycloakify-svelte/login/pages/LoginUsername.svelte +9 -7
  55. package/keycloakify-svelte/login/pages/LoginVerifyEmail.svelte +2 -2
  56. package/keycloakify-svelte/login/pages/LoginX509Info.svelte +8 -6
  57. package/keycloakify-svelte/login/pages/LogoutConfirm.svelte +8 -6
  58. package/keycloakify-svelte/login/pages/Register.svelte +9 -7
  59. package/keycloakify-svelte/login/pages/SamlPostForm.svelte +2 -2
  60. package/keycloakify-svelte/login/pages/SelectAuthenticator.svelte +3 -3
  61. package/keycloakify-svelte/login/pages/Terms.svelte +8 -6
  62. package/keycloakify-svelte/login/pages/UpdateEmail.svelte +8 -6
  63. package/keycloakify-svelte/login/pages/WebauthnAuthenticate.svelte +6 -5
  64. package/keycloakify-svelte/login/pages/WebauthnError.svelte +8 -6
  65. package/keycloakify-svelte/login/pages/WebauthnRegister.svelte +6 -5
  66. package/package.json +22 -20
  67. package/src/account/DefaultPage.svelte +1 -1
  68. package/src/account/Template.svelte +14 -7
  69. package/src/account/pages/Account.svelte +10 -8
  70. package/src/account/pages/Applications.svelte +8 -6
  71. package/src/account/pages/FederatedIdentity.svelte +2 -2
  72. package/src/account/pages/Log.svelte +8 -6
  73. package/src/account/pages/Password.svelte +10 -8
  74. package/src/account/pages/Sessions.svelte +8 -6
  75. package/src/account/pages/Totp.svelte +8 -6
  76. package/src/bin/initialize-account-theme/boilerplate/KcPage.svelte +3 -3
  77. package/src/bin/initialize-account-theme/boilerplate/KcPageStory.svelte +1 -1
  78. package/src/bin/initialize-account-theme/initialize-account-theme.ts +2 -1
  79. package/src/login/DefaultPage.svelte +1 -1
  80. package/src/login/Template.svelte +14 -8
  81. package/src/login/components/AddRemoveButtonsMultiValuedAttribute.svelte +6 -4
  82. package/src/login/components/GroupLabel.svelte +11 -9
  83. package/src/login/components/InputFieldByType.svelte +2 -2
  84. package/src/login/components/InputTag.svelte +5 -5
  85. package/src/login/components/InputTagSelects.svelte +51 -47
  86. package/src/login/components/LogoutOtherSessions.svelte +1 -1
  87. package/src/login/components/PasswordWrapper.svelte +2 -2
  88. package/src/login/components/SelectTag.svelte +21 -19
  89. package/src/login/components/TermsAcceptance.svelte +1 -1
  90. package/src/login/components/TextareaTag.svelte +6 -3
  91. package/src/login/components/UserProfileFormFields.svelte +6 -6
  92. package/src/login/pages/Code.svelte +9 -7
  93. package/src/login/pages/DeleteAccountConfirm.svelte +8 -6
  94. package/src/login/pages/DeleteCredential.svelte +8 -6
  95. package/src/login/pages/Error.svelte +2 -2
  96. package/src/login/pages/FrontchannelLogout.svelte +2 -2
  97. package/src/login/pages/IdpReviewUserProfile.svelte +8 -6
  98. package/src/login/pages/Info.svelte +2 -2
  99. package/src/login/pages/Login.svelte +10 -7
  100. package/src/login/pages/LoginConfigTotp.svelte +8 -6
  101. package/src/login/pages/LoginIdpLinkConfirm.svelte +8 -6
  102. package/src/login/pages/LoginIdpLinkConfirmOverride.svelte +8 -6
  103. package/src/login/pages/LoginIdpLinkEmail.svelte +2 -2
  104. package/src/login/pages/LoginOauth2DeviceVerifyUserCode.svelte +8 -6
  105. package/src/login/pages/LoginOauthGrant.svelte +8 -6
  106. package/src/login/pages/LoginOtp.svelte +8 -6
  107. package/src/login/pages/LoginPageExpired.svelte +2 -2
  108. package/src/login/pages/LoginPasskeysConditionalAuthenticate.svelte +14 -7
  109. package/src/login/pages/LoginPassword.svelte +8 -6
  110. package/src/login/pages/LoginRecoveryAuthnCodeConfig.svelte +10 -7
  111. package/src/login/pages/LoginRecoveryAuthnCodeInput.svelte +8 -6
  112. package/src/login/pages/LoginResetOtp.svelte +8 -6
  113. package/src/login/pages/LoginResetPassword.svelte +8 -6
  114. package/src/login/pages/LoginUpdatePassword.svelte +8 -6
  115. package/src/login/pages/LoginUpdateProfile.svelte +8 -6
  116. package/src/login/pages/LoginUsername.svelte +9 -7
  117. package/src/login/pages/LoginVerifyEmail.svelte +2 -2
  118. package/src/login/pages/LoginX509Info.svelte +8 -6
  119. package/src/login/pages/LogoutConfirm.svelte +8 -6
  120. package/src/login/pages/Register.svelte +9 -7
  121. package/src/login/pages/SamlPostForm.svelte +2 -2
  122. package/src/login/pages/SelectAuthenticator.svelte +3 -3
  123. package/src/login/pages/Terms.svelte +8 -6
  124. package/src/login/pages/UpdateEmail.svelte +8 -6
  125. package/src/login/pages/WebauthnAuthenticate.svelte +6 -5
  126. package/src/login/pages/WebauthnError.svelte +8 -6
  127. package/src/login/pages/WebauthnRegister.svelte +6 -5
@@ -2,1812 +2,6 @@
2
2
  import { createRequire as __WEBPACK_EXTERNAL_createRequire } from "module";
3
3
  /******/ var __webpack_modules__ = ({
4
4
 
5
- /***/ 412:
6
- /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
7
-
8
- /* module decorator */ module = __nccwpck_require__.nmd(module);
9
-
10
-
11
- const wrapAnsi16 = (fn, offset) => (...args) => {
12
- const code = fn(...args);
13
- return `\u001B[${code + offset}m`;
14
- };
15
-
16
- const wrapAnsi256 = (fn, offset) => (...args) => {
17
- const code = fn(...args);
18
- return `\u001B[${38 + offset};5;${code}m`;
19
- };
20
-
21
- const wrapAnsi16m = (fn, offset) => (...args) => {
22
- const rgb = fn(...args);
23
- return `\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`;
24
- };
25
-
26
- const ansi2ansi = n => n;
27
- const rgb2rgb = (r, g, b) => [r, g, b];
28
-
29
- const setLazyProperty = (object, property, get) => {
30
- Object.defineProperty(object, property, {
31
- get: () => {
32
- const value = get();
33
-
34
- Object.defineProperty(object, property, {
35
- value,
36
- enumerable: true,
37
- configurable: true
38
- });
39
-
40
- return value;
41
- },
42
- enumerable: true,
43
- configurable: true
44
- });
45
- };
46
-
47
- /** @type {typeof import('color-convert')} */
48
- let colorConvert;
49
- const makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => {
50
- if (colorConvert === undefined) {
51
- colorConvert = __nccwpck_require__(185);
52
- }
53
-
54
- const offset = isBackground ? 10 : 0;
55
- const styles = {};
56
-
57
- for (const [sourceSpace, suite] of Object.entries(colorConvert)) {
58
- const name = sourceSpace === 'ansi16' ? 'ansi' : sourceSpace;
59
- if (sourceSpace === targetSpace) {
60
- styles[name] = wrap(identity, offset);
61
- } else if (typeof suite === 'object') {
62
- styles[name] = wrap(suite[targetSpace], offset);
63
- }
64
- }
65
-
66
- return styles;
67
- };
68
-
69
- function assembleStyles() {
70
- const codes = new Map();
71
- const styles = {
72
- modifier: {
73
- reset: [0, 0],
74
- // 21 isn't widely supported and 22 does the same thing
75
- bold: [1, 22],
76
- dim: [2, 22],
77
- italic: [3, 23],
78
- underline: [4, 24],
79
- inverse: [7, 27],
80
- hidden: [8, 28],
81
- strikethrough: [9, 29]
82
- },
83
- color: {
84
- black: [30, 39],
85
- red: [31, 39],
86
- green: [32, 39],
87
- yellow: [33, 39],
88
- blue: [34, 39],
89
- magenta: [35, 39],
90
- cyan: [36, 39],
91
- white: [37, 39],
92
-
93
- // Bright color
94
- blackBright: [90, 39],
95
- redBright: [91, 39],
96
- greenBright: [92, 39],
97
- yellowBright: [93, 39],
98
- blueBright: [94, 39],
99
- magentaBright: [95, 39],
100
- cyanBright: [96, 39],
101
- whiteBright: [97, 39]
102
- },
103
- bgColor: {
104
- bgBlack: [40, 49],
105
- bgRed: [41, 49],
106
- bgGreen: [42, 49],
107
- bgYellow: [43, 49],
108
- bgBlue: [44, 49],
109
- bgMagenta: [45, 49],
110
- bgCyan: [46, 49],
111
- bgWhite: [47, 49],
112
-
113
- // Bright color
114
- bgBlackBright: [100, 49],
115
- bgRedBright: [101, 49],
116
- bgGreenBright: [102, 49],
117
- bgYellowBright: [103, 49],
118
- bgBlueBright: [104, 49],
119
- bgMagentaBright: [105, 49],
120
- bgCyanBright: [106, 49],
121
- bgWhiteBright: [107, 49]
122
- }
123
- };
124
-
125
- // Alias bright black as gray (and grey)
126
- styles.color.gray = styles.color.blackBright;
127
- styles.bgColor.bgGray = styles.bgColor.bgBlackBright;
128
- styles.color.grey = styles.color.blackBright;
129
- styles.bgColor.bgGrey = styles.bgColor.bgBlackBright;
130
-
131
- for (const [groupName, group] of Object.entries(styles)) {
132
- for (const [styleName, style] of Object.entries(group)) {
133
- styles[styleName] = {
134
- open: `\u001B[${style[0]}m`,
135
- close: `\u001B[${style[1]}m`
136
- };
137
-
138
- group[styleName] = styles[styleName];
139
-
140
- codes.set(style[0], style[1]);
141
- }
142
-
143
- Object.defineProperty(styles, groupName, {
144
- value: group,
145
- enumerable: false
146
- });
147
- }
148
-
149
- Object.defineProperty(styles, 'codes', {
150
- value: codes,
151
- enumerable: false
152
- });
153
-
154
- styles.color.close = '\u001B[39m';
155
- styles.bgColor.close = '\u001B[49m';
156
-
157
- setLazyProperty(styles.color, 'ansi', () => makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, false));
158
- setLazyProperty(styles.color, 'ansi256', () => makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, false));
159
- setLazyProperty(styles.color, 'ansi16m', () => makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, false));
160
- setLazyProperty(styles.bgColor, 'ansi', () => makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, true));
161
- setLazyProperty(styles.bgColor, 'ansi256', () => makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, true));
162
- setLazyProperty(styles.bgColor, 'ansi16m', () => makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, true));
163
-
164
- return styles;
165
- }
166
-
167
- // Make the export immutable
168
- Object.defineProperty(module, 'exports', {
169
- enumerable: true,
170
- get: assembleStyles
171
- });
172
-
173
-
174
- /***/ }),
175
-
176
- /***/ 465:
177
- /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
178
-
179
-
180
- const ansiStyles = __nccwpck_require__(412);
181
- const {stdout: stdoutColor, stderr: stderrColor} = __nccwpck_require__(450);
182
- const {
183
- stringReplaceAll,
184
- stringEncaseCRLFWithFirstIndex
185
- } = __nccwpck_require__(809);
186
-
187
- const {isArray} = Array;
188
-
189
- // `supportsColor.level` → `ansiStyles.color[name]` mapping
190
- const levelMapping = [
191
- 'ansi',
192
- 'ansi',
193
- 'ansi256',
194
- 'ansi16m'
195
- ];
196
-
197
- const styles = Object.create(null);
198
-
199
- const applyOptions = (object, options = {}) => {
200
- if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
201
- throw new Error('The `level` option should be an integer from 0 to 3');
202
- }
203
-
204
- // Detect level if not set manually
205
- const colorLevel = stdoutColor ? stdoutColor.level : 0;
206
- object.level = options.level === undefined ? colorLevel : options.level;
207
- };
208
-
209
- class ChalkClass {
210
- constructor(options) {
211
- // eslint-disable-next-line no-constructor-return
212
- return chalkFactory(options);
213
- }
214
- }
215
-
216
- const chalkFactory = options => {
217
- const chalk = {};
218
- applyOptions(chalk, options);
219
-
220
- chalk.template = (...arguments_) => chalkTag(chalk.template, ...arguments_);
221
-
222
- Object.setPrototypeOf(chalk, Chalk.prototype);
223
- Object.setPrototypeOf(chalk.template, chalk);
224
-
225
- chalk.template.constructor = () => {
226
- throw new Error('`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.');
227
- };
228
-
229
- chalk.template.Instance = ChalkClass;
230
-
231
- return chalk.template;
232
- };
233
-
234
- function Chalk(options) {
235
- return chalkFactory(options);
236
- }
237
-
238
- for (const [styleName, style] of Object.entries(ansiStyles)) {
239
- styles[styleName] = {
240
- get() {
241
- const builder = createBuilder(this, createStyler(style.open, style.close, this._styler), this._isEmpty);
242
- Object.defineProperty(this, styleName, {value: builder});
243
- return builder;
244
- }
245
- };
246
- }
247
-
248
- styles.visible = {
249
- get() {
250
- const builder = createBuilder(this, this._styler, true);
251
- Object.defineProperty(this, 'visible', {value: builder});
252
- return builder;
253
- }
254
- };
255
-
256
- const usedModels = ['rgb', 'hex', 'keyword', 'hsl', 'hsv', 'hwb', 'ansi', 'ansi256'];
257
-
258
- for (const model of usedModels) {
259
- styles[model] = {
260
- get() {
261
- const {level} = this;
262
- return function (...arguments_) {
263
- const styler = createStyler(ansiStyles.color[levelMapping[level]][model](...arguments_), ansiStyles.color.close, this._styler);
264
- return createBuilder(this, styler, this._isEmpty);
265
- };
266
- }
267
- };
268
- }
269
-
270
- for (const model of usedModels) {
271
- const bgModel = 'bg' + model[0].toUpperCase() + model.slice(1);
272
- styles[bgModel] = {
273
- get() {
274
- const {level} = this;
275
- return function (...arguments_) {
276
- const styler = createStyler(ansiStyles.bgColor[levelMapping[level]][model](...arguments_), ansiStyles.bgColor.close, this._styler);
277
- return createBuilder(this, styler, this._isEmpty);
278
- };
279
- }
280
- };
281
- }
282
-
283
- const proto = Object.defineProperties(() => {}, {
284
- ...styles,
285
- level: {
286
- enumerable: true,
287
- get() {
288
- return this._generator.level;
289
- },
290
- set(level) {
291
- this._generator.level = level;
292
- }
293
- }
294
- });
295
-
296
- const createStyler = (open, close, parent) => {
297
- let openAll;
298
- let closeAll;
299
- if (parent === undefined) {
300
- openAll = open;
301
- closeAll = close;
302
- } else {
303
- openAll = parent.openAll + open;
304
- closeAll = close + parent.closeAll;
305
- }
306
-
307
- return {
308
- open,
309
- close,
310
- openAll,
311
- closeAll,
312
- parent
313
- };
314
- };
315
-
316
- const createBuilder = (self, _styler, _isEmpty) => {
317
- const builder = (...arguments_) => {
318
- if (isArray(arguments_[0]) && isArray(arguments_[0].raw)) {
319
- // Called as a template literal, for example: chalk.red`2 + 3 = {bold ${2+3}}`
320
- return applyStyle(builder, chalkTag(builder, ...arguments_));
321
- }
322
-
323
- // Single argument is hot path, implicit coercion is faster than anything
324
- // eslint-disable-next-line no-implicit-coercion
325
- return applyStyle(builder, (arguments_.length === 1) ? ('' + arguments_[0]) : arguments_.join(' '));
326
- };
327
-
328
- // We alter the prototype because we must return a function, but there is
329
- // no way to create a function with a different prototype
330
- Object.setPrototypeOf(builder, proto);
331
-
332
- builder._generator = self;
333
- builder._styler = _styler;
334
- builder._isEmpty = _isEmpty;
335
-
336
- return builder;
337
- };
338
-
339
- const applyStyle = (self, string) => {
340
- if (self.level <= 0 || !string) {
341
- return self._isEmpty ? '' : string;
342
- }
343
-
344
- let styler = self._styler;
345
-
346
- if (styler === undefined) {
347
- return string;
348
- }
349
-
350
- const {openAll, closeAll} = styler;
351
- if (string.indexOf('\u001B') !== -1) {
352
- while (styler !== undefined) {
353
- // Replace any instances already present with a re-opening code
354
- // otherwise only the part of the string until said closing code
355
- // will be colored, and the rest will simply be 'plain'.
356
- string = stringReplaceAll(string, styler.close, styler.open);
357
-
358
- styler = styler.parent;
359
- }
360
- }
361
-
362
- // We can move both next actions out of loop, because remaining actions in loop won't have
363
- // any/visible effect on parts we add here. Close the styling before a linebreak and reopen
364
- // after next line to fix a bleed issue on macOS: https://github.com/chalk/chalk/pull/92
365
- const lfIndex = string.indexOf('\n');
366
- if (lfIndex !== -1) {
367
- string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
368
- }
369
-
370
- return openAll + string + closeAll;
371
- };
372
-
373
- let template;
374
- const chalkTag = (chalk, ...strings) => {
375
- const [firstString] = strings;
376
-
377
- if (!isArray(firstString) || !isArray(firstString.raw)) {
378
- // If chalk() was called by itself or with a string,
379
- // return the string itself as a string.
380
- return strings.join(' ');
381
- }
382
-
383
- const arguments_ = strings.slice(1);
384
- const parts = [firstString.raw[0]];
385
-
386
- for (let i = 1; i < firstString.length; i++) {
387
- parts.push(
388
- String(arguments_[i - 1]).replace(/[{}\\]/g, '\\$&'),
389
- String(firstString.raw[i])
390
- );
391
- }
392
-
393
- if (template === undefined) {
394
- template = __nccwpck_require__(670);
395
- }
396
-
397
- return template(chalk, parts.join(''));
398
- };
399
-
400
- Object.defineProperties(Chalk.prototype, styles);
401
-
402
- const chalk = Chalk(); // eslint-disable-line new-cap
403
- chalk.supportsColor = stdoutColor;
404
- chalk.stderr = Chalk({level: stderrColor ? stderrColor.level : 0}); // eslint-disable-line new-cap
405
- chalk.stderr.supportsColor = stderrColor;
406
-
407
- module.exports = chalk;
408
-
409
-
410
- /***/ }),
411
-
412
- /***/ 670:
413
- /***/ ((module) => {
414
-
415
-
416
- const TEMPLATE_REGEX = /(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi;
417
- const STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
418
- const STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;
419
- const ESCAPE_REGEX = /\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi;
420
-
421
- const ESCAPES = new Map([
422
- ['n', '\n'],
423
- ['r', '\r'],
424
- ['t', '\t'],
425
- ['b', '\b'],
426
- ['f', '\f'],
427
- ['v', '\v'],
428
- ['0', '\0'],
429
- ['\\', '\\'],
430
- ['e', '\u001B'],
431
- ['a', '\u0007']
432
- ]);
433
-
434
- function unescape(c) {
435
- const u = c[0] === 'u';
436
- const bracket = c[1] === '{';
437
-
438
- if ((u && !bracket && c.length === 5) || (c[0] === 'x' && c.length === 3)) {
439
- return String.fromCharCode(parseInt(c.slice(1), 16));
440
- }
441
-
442
- if (u && bracket) {
443
- return String.fromCodePoint(parseInt(c.slice(2, -1), 16));
444
- }
445
-
446
- return ESCAPES.get(c) || c;
447
- }
448
-
449
- function parseArguments(name, arguments_) {
450
- const results = [];
451
- const chunks = arguments_.trim().split(/\s*,\s*/g);
452
- let matches;
453
-
454
- for (const chunk of chunks) {
455
- const number = Number(chunk);
456
- if (!Number.isNaN(number)) {
457
- results.push(number);
458
- } else if ((matches = chunk.match(STRING_REGEX))) {
459
- results.push(matches[2].replace(ESCAPE_REGEX, (m, escape, character) => escape ? unescape(escape) : character));
460
- } else {
461
- throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`);
462
- }
463
- }
464
-
465
- return results;
466
- }
467
-
468
- function parseStyle(style) {
469
- STYLE_REGEX.lastIndex = 0;
470
-
471
- const results = [];
472
- let matches;
473
-
474
- while ((matches = STYLE_REGEX.exec(style)) !== null) {
475
- const name = matches[1];
476
-
477
- if (matches[2]) {
478
- const args = parseArguments(name, matches[2]);
479
- results.push([name].concat(args));
480
- } else {
481
- results.push([name]);
482
- }
483
- }
484
-
485
- return results;
486
- }
487
-
488
- function buildStyle(chalk, styles) {
489
- const enabled = {};
490
-
491
- for (const layer of styles) {
492
- for (const style of layer.styles) {
493
- enabled[style[0]] = layer.inverse ? null : style.slice(1);
494
- }
495
- }
496
-
497
- let current = chalk;
498
- for (const [styleName, styles] of Object.entries(enabled)) {
499
- if (!Array.isArray(styles)) {
500
- continue;
501
- }
502
-
503
- if (!(styleName in current)) {
504
- throw new Error(`Unknown Chalk style: ${styleName}`);
505
- }
506
-
507
- current = styles.length > 0 ? current[styleName](...styles) : current[styleName];
508
- }
509
-
510
- return current;
511
- }
512
-
513
- module.exports = (chalk, temporary) => {
514
- const styles = [];
515
- const chunks = [];
516
- let chunk = [];
517
-
518
- // eslint-disable-next-line max-params
519
- temporary.replace(TEMPLATE_REGEX, (m, escapeCharacter, inverse, style, close, character) => {
520
- if (escapeCharacter) {
521
- chunk.push(unescape(escapeCharacter));
522
- } else if (style) {
523
- const string = chunk.join('');
524
- chunk = [];
525
- chunks.push(styles.length === 0 ? string : buildStyle(chalk, styles)(string));
526
- styles.push({inverse, styles: parseStyle(style)});
527
- } else if (close) {
528
- if (styles.length === 0) {
529
- throw new Error('Found extraneous } in Chalk template literal');
530
- }
531
-
532
- chunks.push(buildStyle(chalk, styles)(chunk.join('')));
533
- chunk = [];
534
- styles.pop();
535
- } else {
536
- chunk.push(character);
537
- }
538
- });
539
-
540
- chunks.push(chunk.join(''));
541
-
542
- if (styles.length > 0) {
543
- const errMessage = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? '' : 's'} (\`}\`)`;
544
- throw new Error(errMessage);
545
- }
546
-
547
- return chunks.join('');
548
- };
549
-
550
-
551
- /***/ }),
552
-
553
- /***/ 809:
554
- /***/ ((module) => {
555
-
556
-
557
-
558
- const stringReplaceAll = (string, substring, replacer) => {
559
- let index = string.indexOf(substring);
560
- if (index === -1) {
561
- return string;
562
- }
563
-
564
- const substringLength = substring.length;
565
- let endIndex = 0;
566
- let returnValue = '';
567
- do {
568
- returnValue += string.substr(endIndex, index - endIndex) + substring + replacer;
569
- endIndex = index + substringLength;
570
- index = string.indexOf(substring, endIndex);
571
- } while (index !== -1);
572
-
573
- returnValue += string.substr(endIndex);
574
- return returnValue;
575
- };
576
-
577
- const stringEncaseCRLFWithFirstIndex = (string, prefix, postfix, index) => {
578
- let endIndex = 0;
579
- let returnValue = '';
580
- do {
581
- const gotCR = string[index - 1] === '\r';
582
- returnValue += string.substr(endIndex, (gotCR ? index - 1 : index) - endIndex) + prefix + (gotCR ? '\r\n' : '\n') + postfix;
583
- endIndex = index + 1;
584
- index = string.indexOf('\n', endIndex);
585
- } while (index !== -1);
586
-
587
- returnValue += string.substr(endIndex);
588
- return returnValue;
589
- };
590
-
591
- module.exports = {
592
- stringReplaceAll,
593
- stringEncaseCRLFWithFirstIndex
594
- };
595
-
596
-
597
- /***/ }),
598
-
599
- /***/ 872:
600
- /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
601
-
602
- /* MIT license */
603
- /* eslint-disable no-mixed-operators */
604
- const cssKeywords = __nccwpck_require__(953);
605
-
606
- // NOTE: conversions should only return primitive values (i.e. arrays, or
607
- // values that give correct `typeof` results).
608
- // do not use box values types (i.e. Number(), String(), etc.)
609
-
610
- const reverseKeywords = {};
611
- for (const key of Object.keys(cssKeywords)) {
612
- reverseKeywords[cssKeywords[key]] = key;
613
- }
614
-
615
- const convert = {
616
- rgb: {channels: 3, labels: 'rgb'},
617
- hsl: {channels: 3, labels: 'hsl'},
618
- hsv: {channels: 3, labels: 'hsv'},
619
- hwb: {channels: 3, labels: 'hwb'},
620
- cmyk: {channels: 4, labels: 'cmyk'},
621
- xyz: {channels: 3, labels: 'xyz'},
622
- lab: {channels: 3, labels: 'lab'},
623
- lch: {channels: 3, labels: 'lch'},
624
- hex: {channels: 1, labels: ['hex']},
625
- keyword: {channels: 1, labels: ['keyword']},
626
- ansi16: {channels: 1, labels: ['ansi16']},
627
- ansi256: {channels: 1, labels: ['ansi256']},
628
- hcg: {channels: 3, labels: ['h', 'c', 'g']},
629
- apple: {channels: 3, labels: ['r16', 'g16', 'b16']},
630
- gray: {channels: 1, labels: ['gray']}
631
- };
632
-
633
- module.exports = convert;
634
-
635
- // Hide .channels and .labels properties
636
- for (const model of Object.keys(convert)) {
637
- if (!('channels' in convert[model])) {
638
- throw new Error('missing channels property: ' + model);
639
- }
640
-
641
- if (!('labels' in convert[model])) {
642
- throw new Error('missing channel labels property: ' + model);
643
- }
644
-
645
- if (convert[model].labels.length !== convert[model].channels) {
646
- throw new Error('channel and label counts mismatch: ' + model);
647
- }
648
-
649
- const {channels, labels} = convert[model];
650
- delete convert[model].channels;
651
- delete convert[model].labels;
652
- Object.defineProperty(convert[model], 'channels', {value: channels});
653
- Object.defineProperty(convert[model], 'labels', {value: labels});
654
- }
655
-
656
- convert.rgb.hsl = function (rgb) {
657
- const r = rgb[0] / 255;
658
- const g = rgb[1] / 255;
659
- const b = rgb[2] / 255;
660
- const min = Math.min(r, g, b);
661
- const max = Math.max(r, g, b);
662
- const delta = max - min;
663
- let h;
664
- let s;
665
-
666
- if (max === min) {
667
- h = 0;
668
- } else if (r === max) {
669
- h = (g - b) / delta;
670
- } else if (g === max) {
671
- h = 2 + (b - r) / delta;
672
- } else if (b === max) {
673
- h = 4 + (r - g) / delta;
674
- }
675
-
676
- h = Math.min(h * 60, 360);
677
-
678
- if (h < 0) {
679
- h += 360;
680
- }
681
-
682
- const l = (min + max) / 2;
683
-
684
- if (max === min) {
685
- s = 0;
686
- } else if (l <= 0.5) {
687
- s = delta / (max + min);
688
- } else {
689
- s = delta / (2 - max - min);
690
- }
691
-
692
- return [h, s * 100, l * 100];
693
- };
694
-
695
- convert.rgb.hsv = function (rgb) {
696
- let rdif;
697
- let gdif;
698
- let bdif;
699
- let h;
700
- let s;
701
-
702
- const r = rgb[0] / 255;
703
- const g = rgb[1] / 255;
704
- const b = rgb[2] / 255;
705
- const v = Math.max(r, g, b);
706
- const diff = v - Math.min(r, g, b);
707
- const diffc = function (c) {
708
- return (v - c) / 6 / diff + 1 / 2;
709
- };
710
-
711
- if (diff === 0) {
712
- h = 0;
713
- s = 0;
714
- } else {
715
- s = diff / v;
716
- rdif = diffc(r);
717
- gdif = diffc(g);
718
- bdif = diffc(b);
719
-
720
- if (r === v) {
721
- h = bdif - gdif;
722
- } else if (g === v) {
723
- h = (1 / 3) + rdif - bdif;
724
- } else if (b === v) {
725
- h = (2 / 3) + gdif - rdif;
726
- }
727
-
728
- if (h < 0) {
729
- h += 1;
730
- } else if (h > 1) {
731
- h -= 1;
732
- }
733
- }
734
-
735
- return [
736
- h * 360,
737
- s * 100,
738
- v * 100
739
- ];
740
- };
741
-
742
- convert.rgb.hwb = function (rgb) {
743
- const r = rgb[0];
744
- const g = rgb[1];
745
- let b = rgb[2];
746
- const h = convert.rgb.hsl(rgb)[0];
747
- const w = 1 / 255 * Math.min(r, Math.min(g, b));
748
-
749
- b = 1 - 1 / 255 * Math.max(r, Math.max(g, b));
750
-
751
- return [h, w * 100, b * 100];
752
- };
753
-
754
- convert.rgb.cmyk = function (rgb) {
755
- const r = rgb[0] / 255;
756
- const g = rgb[1] / 255;
757
- const b = rgb[2] / 255;
758
-
759
- const k = Math.min(1 - r, 1 - g, 1 - b);
760
- const c = (1 - r - k) / (1 - k) || 0;
761
- const m = (1 - g - k) / (1 - k) || 0;
762
- const y = (1 - b - k) / (1 - k) || 0;
763
-
764
- return [c * 100, m * 100, y * 100, k * 100];
765
- };
766
-
767
- function comparativeDistance(x, y) {
768
- /*
769
- See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance
770
- */
771
- return (
772
- ((x[0] - y[0]) ** 2) +
773
- ((x[1] - y[1]) ** 2) +
774
- ((x[2] - y[2]) ** 2)
775
- );
776
- }
777
-
778
- convert.rgb.keyword = function (rgb) {
779
- const reversed = reverseKeywords[rgb];
780
- if (reversed) {
781
- return reversed;
782
- }
783
-
784
- let currentClosestDistance = Infinity;
785
- let currentClosestKeyword;
786
-
787
- for (const keyword of Object.keys(cssKeywords)) {
788
- const value = cssKeywords[keyword];
789
-
790
- // Compute comparative distance
791
- const distance = comparativeDistance(rgb, value);
792
-
793
- // Check if its less, if so set as closest
794
- if (distance < currentClosestDistance) {
795
- currentClosestDistance = distance;
796
- currentClosestKeyword = keyword;
797
- }
798
- }
799
-
800
- return currentClosestKeyword;
801
- };
802
-
803
- convert.keyword.rgb = function (keyword) {
804
- return cssKeywords[keyword];
805
- };
806
-
807
- convert.rgb.xyz = function (rgb) {
808
- let r = rgb[0] / 255;
809
- let g = rgb[1] / 255;
810
- let b = rgb[2] / 255;
811
-
812
- // Assume sRGB
813
- r = r > 0.04045 ? (((r + 0.055) / 1.055) ** 2.4) : (r / 12.92);
814
- g = g > 0.04045 ? (((g + 0.055) / 1.055) ** 2.4) : (g / 12.92);
815
- b = b > 0.04045 ? (((b + 0.055) / 1.055) ** 2.4) : (b / 12.92);
816
-
817
- const x = (r * 0.4124) + (g * 0.3576) + (b * 0.1805);
818
- const y = (r * 0.2126) + (g * 0.7152) + (b * 0.0722);
819
- const z = (r * 0.0193) + (g * 0.1192) + (b * 0.9505);
820
-
821
- return [x * 100, y * 100, z * 100];
822
- };
823
-
824
- convert.rgb.lab = function (rgb) {
825
- const xyz = convert.rgb.xyz(rgb);
826
- let x = xyz[0];
827
- let y = xyz[1];
828
- let z = xyz[2];
829
-
830
- x /= 95.047;
831
- y /= 100;
832
- z /= 108.883;
833
-
834
- x = x > 0.008856 ? (x ** (1 / 3)) : (7.787 * x) + (16 / 116);
835
- y = y > 0.008856 ? (y ** (1 / 3)) : (7.787 * y) + (16 / 116);
836
- z = z > 0.008856 ? (z ** (1 / 3)) : (7.787 * z) + (16 / 116);
837
-
838
- const l = (116 * y) - 16;
839
- const a = 500 * (x - y);
840
- const b = 200 * (y - z);
841
-
842
- return [l, a, b];
843
- };
844
-
845
- convert.hsl.rgb = function (hsl) {
846
- const h = hsl[0] / 360;
847
- const s = hsl[1] / 100;
848
- const l = hsl[2] / 100;
849
- let t2;
850
- let t3;
851
- let val;
852
-
853
- if (s === 0) {
854
- val = l * 255;
855
- return [val, val, val];
856
- }
857
-
858
- if (l < 0.5) {
859
- t2 = l * (1 + s);
860
- } else {
861
- t2 = l + s - l * s;
862
- }
863
-
864
- const t1 = 2 * l - t2;
865
-
866
- const rgb = [0, 0, 0];
867
- for (let i = 0; i < 3; i++) {
868
- t3 = h + 1 / 3 * -(i - 1);
869
- if (t3 < 0) {
870
- t3++;
871
- }
872
-
873
- if (t3 > 1) {
874
- t3--;
875
- }
876
-
877
- if (6 * t3 < 1) {
878
- val = t1 + (t2 - t1) * 6 * t3;
879
- } else if (2 * t3 < 1) {
880
- val = t2;
881
- } else if (3 * t3 < 2) {
882
- val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
883
- } else {
884
- val = t1;
885
- }
886
-
887
- rgb[i] = val * 255;
888
- }
889
-
890
- return rgb;
891
- };
892
-
893
- convert.hsl.hsv = function (hsl) {
894
- const h = hsl[0];
895
- let s = hsl[1] / 100;
896
- let l = hsl[2] / 100;
897
- let smin = s;
898
- const lmin = Math.max(l, 0.01);
899
-
900
- l *= 2;
901
- s *= (l <= 1) ? l : 2 - l;
902
- smin *= lmin <= 1 ? lmin : 2 - lmin;
903
- const v = (l + s) / 2;
904
- const sv = l === 0 ? (2 * smin) / (lmin + smin) : (2 * s) / (l + s);
905
-
906
- return [h, sv * 100, v * 100];
907
- };
908
-
909
- convert.hsv.rgb = function (hsv) {
910
- const h = hsv[0] / 60;
911
- const s = hsv[1] / 100;
912
- let v = hsv[2] / 100;
913
- const hi = Math.floor(h) % 6;
914
-
915
- const f = h - Math.floor(h);
916
- const p = 255 * v * (1 - s);
917
- const q = 255 * v * (1 - (s * f));
918
- const t = 255 * v * (1 - (s * (1 - f)));
919
- v *= 255;
920
-
921
- switch (hi) {
922
- case 0:
923
- return [v, t, p];
924
- case 1:
925
- return [q, v, p];
926
- case 2:
927
- return [p, v, t];
928
- case 3:
929
- return [p, q, v];
930
- case 4:
931
- return [t, p, v];
932
- case 5:
933
- return [v, p, q];
934
- }
935
- };
936
-
937
- convert.hsv.hsl = function (hsv) {
938
- const h = hsv[0];
939
- const s = hsv[1] / 100;
940
- const v = hsv[2] / 100;
941
- const vmin = Math.max(v, 0.01);
942
- let sl;
943
- let l;
944
-
945
- l = (2 - s) * v;
946
- const lmin = (2 - s) * vmin;
947
- sl = s * vmin;
948
- sl /= (lmin <= 1) ? lmin : 2 - lmin;
949
- sl = sl || 0;
950
- l /= 2;
951
-
952
- return [h, sl * 100, l * 100];
953
- };
954
-
955
- // http://dev.w3.org/csswg/css-color/#hwb-to-rgb
956
- convert.hwb.rgb = function (hwb) {
957
- const h = hwb[0] / 360;
958
- let wh = hwb[1] / 100;
959
- let bl = hwb[2] / 100;
960
- const ratio = wh + bl;
961
- let f;
962
-
963
- // Wh + bl cant be > 1
964
- if (ratio > 1) {
965
- wh /= ratio;
966
- bl /= ratio;
967
- }
968
-
969
- const i = Math.floor(6 * h);
970
- const v = 1 - bl;
971
- f = 6 * h - i;
972
-
973
- if ((i & 0x01) !== 0) {
974
- f = 1 - f;
975
- }
976
-
977
- const n = wh + f * (v - wh); // Linear interpolation
978
-
979
- let r;
980
- let g;
981
- let b;
982
- /* eslint-disable max-statements-per-line,no-multi-spaces */
983
- switch (i) {
984
- default:
985
- case 6:
986
- case 0: r = v; g = n; b = wh; break;
987
- case 1: r = n; g = v; b = wh; break;
988
- case 2: r = wh; g = v; b = n; break;
989
- case 3: r = wh; g = n; b = v; break;
990
- case 4: r = n; g = wh; b = v; break;
991
- case 5: r = v; g = wh; b = n; break;
992
- }
993
- /* eslint-enable max-statements-per-line,no-multi-spaces */
994
-
995
- return [r * 255, g * 255, b * 255];
996
- };
997
-
998
- convert.cmyk.rgb = function (cmyk) {
999
- const c = cmyk[0] / 100;
1000
- const m = cmyk[1] / 100;
1001
- const y = cmyk[2] / 100;
1002
- const k = cmyk[3] / 100;
1003
-
1004
- const r = 1 - Math.min(1, c * (1 - k) + k);
1005
- const g = 1 - Math.min(1, m * (1 - k) + k);
1006
- const b = 1 - Math.min(1, y * (1 - k) + k);
1007
-
1008
- return [r * 255, g * 255, b * 255];
1009
- };
1010
-
1011
- convert.xyz.rgb = function (xyz) {
1012
- const x = xyz[0] / 100;
1013
- const y = xyz[1] / 100;
1014
- const z = xyz[2] / 100;
1015
- let r;
1016
- let g;
1017
- let b;
1018
-
1019
- r = (x * 3.2406) + (y * -1.5372) + (z * -0.4986);
1020
- g = (x * -0.9689) + (y * 1.8758) + (z * 0.0415);
1021
- b = (x * 0.0557) + (y * -0.2040) + (z * 1.0570);
1022
-
1023
- // Assume sRGB
1024
- r = r > 0.0031308
1025
- ? ((1.055 * (r ** (1.0 / 2.4))) - 0.055)
1026
- : r * 12.92;
1027
-
1028
- g = g > 0.0031308
1029
- ? ((1.055 * (g ** (1.0 / 2.4))) - 0.055)
1030
- : g * 12.92;
1031
-
1032
- b = b > 0.0031308
1033
- ? ((1.055 * (b ** (1.0 / 2.4))) - 0.055)
1034
- : b * 12.92;
1035
-
1036
- r = Math.min(Math.max(0, r), 1);
1037
- g = Math.min(Math.max(0, g), 1);
1038
- b = Math.min(Math.max(0, b), 1);
1039
-
1040
- return [r * 255, g * 255, b * 255];
1041
- };
1042
-
1043
- convert.xyz.lab = function (xyz) {
1044
- let x = xyz[0];
1045
- let y = xyz[1];
1046
- let z = xyz[2];
1047
-
1048
- x /= 95.047;
1049
- y /= 100;
1050
- z /= 108.883;
1051
-
1052
- x = x > 0.008856 ? (x ** (1 / 3)) : (7.787 * x) + (16 / 116);
1053
- y = y > 0.008856 ? (y ** (1 / 3)) : (7.787 * y) + (16 / 116);
1054
- z = z > 0.008856 ? (z ** (1 / 3)) : (7.787 * z) + (16 / 116);
1055
-
1056
- const l = (116 * y) - 16;
1057
- const a = 500 * (x - y);
1058
- const b = 200 * (y - z);
1059
-
1060
- return [l, a, b];
1061
- };
1062
-
1063
- convert.lab.xyz = function (lab) {
1064
- const l = lab[0];
1065
- const a = lab[1];
1066
- const b = lab[2];
1067
- let x;
1068
- let y;
1069
- let z;
1070
-
1071
- y = (l + 16) / 116;
1072
- x = a / 500 + y;
1073
- z = y - b / 200;
1074
-
1075
- const y2 = y ** 3;
1076
- const x2 = x ** 3;
1077
- const z2 = z ** 3;
1078
- y = y2 > 0.008856 ? y2 : (y - 16 / 116) / 7.787;
1079
- x = x2 > 0.008856 ? x2 : (x - 16 / 116) / 7.787;
1080
- z = z2 > 0.008856 ? z2 : (z - 16 / 116) / 7.787;
1081
-
1082
- x *= 95.047;
1083
- y *= 100;
1084
- z *= 108.883;
1085
-
1086
- return [x, y, z];
1087
- };
1088
-
1089
- convert.lab.lch = function (lab) {
1090
- const l = lab[0];
1091
- const a = lab[1];
1092
- const b = lab[2];
1093
- let h;
1094
-
1095
- const hr = Math.atan2(b, a);
1096
- h = hr * 360 / 2 / Math.PI;
1097
-
1098
- if (h < 0) {
1099
- h += 360;
1100
- }
1101
-
1102
- const c = Math.sqrt(a * a + b * b);
1103
-
1104
- return [l, c, h];
1105
- };
1106
-
1107
- convert.lch.lab = function (lch) {
1108
- const l = lch[0];
1109
- const c = lch[1];
1110
- const h = lch[2];
1111
-
1112
- const hr = h / 360 * 2 * Math.PI;
1113
- const a = c * Math.cos(hr);
1114
- const b = c * Math.sin(hr);
1115
-
1116
- return [l, a, b];
1117
- };
1118
-
1119
- convert.rgb.ansi16 = function (args, saturation = null) {
1120
- const [r, g, b] = args;
1121
- let value = saturation === null ? convert.rgb.hsv(args)[2] : saturation; // Hsv -> ansi16 optimization
1122
-
1123
- value = Math.round(value / 50);
1124
-
1125
- if (value === 0) {
1126
- return 30;
1127
- }
1128
-
1129
- let ansi = 30
1130
- + ((Math.round(b / 255) << 2)
1131
- | (Math.round(g / 255) << 1)
1132
- | Math.round(r / 255));
1133
-
1134
- if (value === 2) {
1135
- ansi += 60;
1136
- }
1137
-
1138
- return ansi;
1139
- };
1140
-
1141
- convert.hsv.ansi16 = function (args) {
1142
- // Optimization here; we already know the value and don't need to get
1143
- // it converted for us.
1144
- return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);
1145
- };
1146
-
1147
- convert.rgb.ansi256 = function (args) {
1148
- const r = args[0];
1149
- const g = args[1];
1150
- const b = args[2];
1151
-
1152
- // We use the extended greyscale palette here, with the exception of
1153
- // black and white. normal palette only has 4 greyscale shades.
1154
- if (r === g && g === b) {
1155
- if (r < 8) {
1156
- return 16;
1157
- }
1158
-
1159
- if (r > 248) {
1160
- return 231;
1161
- }
1162
-
1163
- return Math.round(((r - 8) / 247) * 24) + 232;
1164
- }
1165
-
1166
- const ansi = 16
1167
- + (36 * Math.round(r / 255 * 5))
1168
- + (6 * Math.round(g / 255 * 5))
1169
- + Math.round(b / 255 * 5);
1170
-
1171
- return ansi;
1172
- };
1173
-
1174
- convert.ansi16.rgb = function (args) {
1175
- let color = args % 10;
1176
-
1177
- // Handle greyscale
1178
- if (color === 0 || color === 7) {
1179
- if (args > 50) {
1180
- color += 3.5;
1181
- }
1182
-
1183
- color = color / 10.5 * 255;
1184
-
1185
- return [color, color, color];
1186
- }
1187
-
1188
- const mult = (~~(args > 50) + 1) * 0.5;
1189
- const r = ((color & 1) * mult) * 255;
1190
- const g = (((color >> 1) & 1) * mult) * 255;
1191
- const b = (((color >> 2) & 1) * mult) * 255;
1192
-
1193
- return [r, g, b];
1194
- };
1195
-
1196
- convert.ansi256.rgb = function (args) {
1197
- // Handle greyscale
1198
- if (args >= 232) {
1199
- const c = (args - 232) * 10 + 8;
1200
- return [c, c, c];
1201
- }
1202
-
1203
- args -= 16;
1204
-
1205
- let rem;
1206
- const r = Math.floor(args / 36) / 5 * 255;
1207
- const g = Math.floor((rem = args % 36) / 6) / 5 * 255;
1208
- const b = (rem % 6) / 5 * 255;
1209
-
1210
- return [r, g, b];
1211
- };
1212
-
1213
- convert.rgb.hex = function (args) {
1214
- const integer = ((Math.round(args[0]) & 0xFF) << 16)
1215
- + ((Math.round(args[1]) & 0xFF) << 8)
1216
- + (Math.round(args[2]) & 0xFF);
1217
-
1218
- const string = integer.toString(16).toUpperCase();
1219
- return '000000'.substring(string.length) + string;
1220
- };
1221
-
1222
- convert.hex.rgb = function (args) {
1223
- const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
1224
- if (!match) {
1225
- return [0, 0, 0];
1226
- }
1227
-
1228
- let colorString = match[0];
1229
-
1230
- if (match[0].length === 3) {
1231
- colorString = colorString.split('').map(char => {
1232
- return char + char;
1233
- }).join('');
1234
- }
1235
-
1236
- const integer = parseInt(colorString, 16);
1237
- const r = (integer >> 16) & 0xFF;
1238
- const g = (integer >> 8) & 0xFF;
1239
- const b = integer & 0xFF;
1240
-
1241
- return [r, g, b];
1242
- };
1243
-
1244
- convert.rgb.hcg = function (rgb) {
1245
- const r = rgb[0] / 255;
1246
- const g = rgb[1] / 255;
1247
- const b = rgb[2] / 255;
1248
- const max = Math.max(Math.max(r, g), b);
1249
- const min = Math.min(Math.min(r, g), b);
1250
- const chroma = (max - min);
1251
- let grayscale;
1252
- let hue;
1253
-
1254
- if (chroma < 1) {
1255
- grayscale = min / (1 - chroma);
1256
- } else {
1257
- grayscale = 0;
1258
- }
1259
-
1260
- if (chroma <= 0) {
1261
- hue = 0;
1262
- } else
1263
- if (max === r) {
1264
- hue = ((g - b) / chroma) % 6;
1265
- } else
1266
- if (max === g) {
1267
- hue = 2 + (b - r) / chroma;
1268
- } else {
1269
- hue = 4 + (r - g) / chroma;
1270
- }
1271
-
1272
- hue /= 6;
1273
- hue %= 1;
1274
-
1275
- return [hue * 360, chroma * 100, grayscale * 100];
1276
- };
1277
-
1278
- convert.hsl.hcg = function (hsl) {
1279
- const s = hsl[1] / 100;
1280
- const l = hsl[2] / 100;
1281
-
1282
- const c = l < 0.5 ? (2.0 * s * l) : (2.0 * s * (1.0 - l));
1283
-
1284
- let f = 0;
1285
- if (c < 1.0) {
1286
- f = (l - 0.5 * c) / (1.0 - c);
1287
- }
1288
-
1289
- return [hsl[0], c * 100, f * 100];
1290
- };
1291
-
1292
- convert.hsv.hcg = function (hsv) {
1293
- const s = hsv[1] / 100;
1294
- const v = hsv[2] / 100;
1295
-
1296
- const c = s * v;
1297
- let f = 0;
1298
-
1299
- if (c < 1.0) {
1300
- f = (v - c) / (1 - c);
1301
- }
1302
-
1303
- return [hsv[0], c * 100, f * 100];
1304
- };
1305
-
1306
- convert.hcg.rgb = function (hcg) {
1307
- const h = hcg[0] / 360;
1308
- const c = hcg[1] / 100;
1309
- const g = hcg[2] / 100;
1310
-
1311
- if (c === 0.0) {
1312
- return [g * 255, g * 255, g * 255];
1313
- }
1314
-
1315
- const pure = [0, 0, 0];
1316
- const hi = (h % 1) * 6;
1317
- const v = hi % 1;
1318
- const w = 1 - v;
1319
- let mg = 0;
1320
-
1321
- /* eslint-disable max-statements-per-line */
1322
- switch (Math.floor(hi)) {
1323
- case 0:
1324
- pure[0] = 1; pure[1] = v; pure[2] = 0; break;
1325
- case 1:
1326
- pure[0] = w; pure[1] = 1; pure[2] = 0; break;
1327
- case 2:
1328
- pure[0] = 0; pure[1] = 1; pure[2] = v; break;
1329
- case 3:
1330
- pure[0] = 0; pure[1] = w; pure[2] = 1; break;
1331
- case 4:
1332
- pure[0] = v; pure[1] = 0; pure[2] = 1; break;
1333
- default:
1334
- pure[0] = 1; pure[1] = 0; pure[2] = w;
1335
- }
1336
- /* eslint-enable max-statements-per-line */
1337
-
1338
- mg = (1.0 - c) * g;
1339
-
1340
- return [
1341
- (c * pure[0] + mg) * 255,
1342
- (c * pure[1] + mg) * 255,
1343
- (c * pure[2] + mg) * 255
1344
- ];
1345
- };
1346
-
1347
- convert.hcg.hsv = function (hcg) {
1348
- const c = hcg[1] / 100;
1349
- const g = hcg[2] / 100;
1350
-
1351
- const v = c + g * (1.0 - c);
1352
- let f = 0;
1353
-
1354
- if (v > 0.0) {
1355
- f = c / v;
1356
- }
1357
-
1358
- return [hcg[0], f * 100, v * 100];
1359
- };
1360
-
1361
- convert.hcg.hsl = function (hcg) {
1362
- const c = hcg[1] / 100;
1363
- const g = hcg[2] / 100;
1364
-
1365
- const l = g * (1.0 - c) + 0.5 * c;
1366
- let s = 0;
1367
-
1368
- if (l > 0.0 && l < 0.5) {
1369
- s = c / (2 * l);
1370
- } else
1371
- if (l >= 0.5 && l < 1.0) {
1372
- s = c / (2 * (1 - l));
1373
- }
1374
-
1375
- return [hcg[0], s * 100, l * 100];
1376
- };
1377
-
1378
- convert.hcg.hwb = function (hcg) {
1379
- const c = hcg[1] / 100;
1380
- const g = hcg[2] / 100;
1381
- const v = c + g * (1.0 - c);
1382
- return [hcg[0], (v - c) * 100, (1 - v) * 100];
1383
- };
1384
-
1385
- convert.hwb.hcg = function (hwb) {
1386
- const w = hwb[1] / 100;
1387
- const b = hwb[2] / 100;
1388
- const v = 1 - b;
1389
- const c = v - w;
1390
- let g = 0;
1391
-
1392
- if (c < 1) {
1393
- g = (v - c) / (1 - c);
1394
- }
1395
-
1396
- return [hwb[0], c * 100, g * 100];
1397
- };
1398
-
1399
- convert.apple.rgb = function (apple) {
1400
- return [(apple[0] / 65535) * 255, (apple[1] / 65535) * 255, (apple[2] / 65535) * 255];
1401
- };
1402
-
1403
- convert.rgb.apple = function (rgb) {
1404
- return [(rgb[0] / 255) * 65535, (rgb[1] / 255) * 65535, (rgb[2] / 255) * 65535];
1405
- };
1406
-
1407
- convert.gray.rgb = function (args) {
1408
- return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];
1409
- };
1410
-
1411
- convert.gray.hsl = function (args) {
1412
- return [0, 0, args[0]];
1413
- };
1414
-
1415
- convert.gray.hsv = convert.gray.hsl;
1416
-
1417
- convert.gray.hwb = function (gray) {
1418
- return [0, 100, gray[0]];
1419
- };
1420
-
1421
- convert.gray.cmyk = function (gray) {
1422
- return [0, 0, 0, gray[0]];
1423
- };
1424
-
1425
- convert.gray.lab = function (gray) {
1426
- return [gray[0], 0, 0];
1427
- };
1428
-
1429
- convert.gray.hex = function (gray) {
1430
- const val = Math.round(gray[0] / 100 * 255) & 0xFF;
1431
- const integer = (val << 16) + (val << 8) + val;
1432
-
1433
- const string = integer.toString(16).toUpperCase();
1434
- return '000000'.substring(string.length) + string;
1435
- };
1436
-
1437
- convert.rgb.gray = function (rgb) {
1438
- const val = (rgb[0] + rgb[1] + rgb[2]) / 3;
1439
- return [val / 255 * 100];
1440
- };
1441
-
1442
-
1443
- /***/ }),
1444
-
1445
- /***/ 185:
1446
- /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
1447
-
1448
- const conversions = __nccwpck_require__(872);
1449
- const route = __nccwpck_require__(200);
1450
-
1451
- const convert = {};
1452
-
1453
- const models = Object.keys(conversions);
1454
-
1455
- function wrapRaw(fn) {
1456
- const wrappedFn = function (...args) {
1457
- const arg0 = args[0];
1458
- if (arg0 === undefined || arg0 === null) {
1459
- return arg0;
1460
- }
1461
-
1462
- if (arg0.length > 1) {
1463
- args = arg0;
1464
- }
1465
-
1466
- return fn(args);
1467
- };
1468
-
1469
- // Preserve .conversion property if there is one
1470
- if ('conversion' in fn) {
1471
- wrappedFn.conversion = fn.conversion;
1472
- }
1473
-
1474
- return wrappedFn;
1475
- }
1476
-
1477
- function wrapRounded(fn) {
1478
- const wrappedFn = function (...args) {
1479
- const arg0 = args[0];
1480
-
1481
- if (arg0 === undefined || arg0 === null) {
1482
- return arg0;
1483
- }
1484
-
1485
- if (arg0.length > 1) {
1486
- args = arg0;
1487
- }
1488
-
1489
- const result = fn(args);
1490
-
1491
- // We're assuming the result is an array here.
1492
- // see notice in conversions.js; don't use box types
1493
- // in conversion functions.
1494
- if (typeof result === 'object') {
1495
- for (let len = result.length, i = 0; i < len; i++) {
1496
- result[i] = Math.round(result[i]);
1497
- }
1498
- }
1499
-
1500
- return result;
1501
- };
1502
-
1503
- // Preserve .conversion property if there is one
1504
- if ('conversion' in fn) {
1505
- wrappedFn.conversion = fn.conversion;
1506
- }
1507
-
1508
- return wrappedFn;
1509
- }
1510
-
1511
- models.forEach(fromModel => {
1512
- convert[fromModel] = {};
1513
-
1514
- Object.defineProperty(convert[fromModel], 'channels', {value: conversions[fromModel].channels});
1515
- Object.defineProperty(convert[fromModel], 'labels', {value: conversions[fromModel].labels});
1516
-
1517
- const routes = route(fromModel);
1518
- const routeModels = Object.keys(routes);
1519
-
1520
- routeModels.forEach(toModel => {
1521
- const fn = routes[toModel];
1522
-
1523
- convert[fromModel][toModel] = wrapRounded(fn);
1524
- convert[fromModel][toModel].raw = wrapRaw(fn);
1525
- });
1526
- });
1527
-
1528
- module.exports = convert;
1529
-
1530
-
1531
- /***/ }),
1532
-
1533
- /***/ 200:
1534
- /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
1535
-
1536
- const conversions = __nccwpck_require__(872);
1537
-
1538
- /*
1539
- This function routes a model to all other models.
1540
-
1541
- all functions that are routed have a property `.conversion` attached
1542
- to the returned synthetic function. This property is an array
1543
- of strings, each with the steps in between the 'from' and 'to'
1544
- color models (inclusive).
1545
-
1546
- conversions that are not possible simply are not included.
1547
- */
1548
-
1549
- function buildGraph() {
1550
- const graph = {};
1551
- // https://jsperf.com/object-keys-vs-for-in-with-closure/3
1552
- const models = Object.keys(conversions);
1553
-
1554
- for (let len = models.length, i = 0; i < len; i++) {
1555
- graph[models[i]] = {
1556
- // http://jsperf.com/1-vs-infinity
1557
- // micro-opt, but this is simple.
1558
- distance: -1,
1559
- parent: null
1560
- };
1561
- }
1562
-
1563
- return graph;
1564
- }
1565
-
1566
- // https://en.wikipedia.org/wiki/Breadth-first_search
1567
- function deriveBFS(fromModel) {
1568
- const graph = buildGraph();
1569
- const queue = [fromModel]; // Unshift -> queue -> pop
1570
-
1571
- graph[fromModel].distance = 0;
1572
-
1573
- while (queue.length) {
1574
- const current = queue.pop();
1575
- const adjacents = Object.keys(conversions[current]);
1576
-
1577
- for (let len = adjacents.length, i = 0; i < len; i++) {
1578
- const adjacent = adjacents[i];
1579
- const node = graph[adjacent];
1580
-
1581
- if (node.distance === -1) {
1582
- node.distance = graph[current].distance + 1;
1583
- node.parent = current;
1584
- queue.unshift(adjacent);
1585
- }
1586
- }
1587
- }
1588
-
1589
- return graph;
1590
- }
1591
-
1592
- function link(from, to) {
1593
- return function (args) {
1594
- return to(from(args));
1595
- };
1596
- }
1597
-
1598
- function wrapConversion(toModel, graph) {
1599
- const path = [graph[toModel].parent, toModel];
1600
- let fn = conversions[graph[toModel].parent][toModel];
1601
-
1602
- let cur = graph[toModel].parent;
1603
- while (graph[cur].parent) {
1604
- path.unshift(graph[cur].parent);
1605
- fn = link(conversions[graph[cur].parent][cur], fn);
1606
- cur = graph[cur].parent;
1607
- }
1608
-
1609
- fn.conversion = path;
1610
- return fn;
1611
- }
1612
-
1613
- module.exports = function (fromModel) {
1614
- const graph = deriveBFS(fromModel);
1615
- const conversion = {};
1616
-
1617
- const models = Object.keys(graph);
1618
- for (let len = models.length, i = 0; i < len; i++) {
1619
- const toModel = models[i];
1620
- const node = graph[toModel];
1621
-
1622
- if (node.parent === null) {
1623
- // No possible conversion, or this node is the source model.
1624
- continue;
1625
- }
1626
-
1627
- conversion[toModel] = wrapConversion(toModel, graph);
1628
- }
1629
-
1630
- return conversion;
1631
- };
1632
-
1633
-
1634
-
1635
- /***/ }),
1636
-
1637
- /***/ 953:
1638
- /***/ ((module) => {
1639
-
1640
-
1641
-
1642
- module.exports = {
1643
- "aliceblue": [240, 248, 255],
1644
- "antiquewhite": [250, 235, 215],
1645
- "aqua": [0, 255, 255],
1646
- "aquamarine": [127, 255, 212],
1647
- "azure": [240, 255, 255],
1648
- "beige": [245, 245, 220],
1649
- "bisque": [255, 228, 196],
1650
- "black": [0, 0, 0],
1651
- "blanchedalmond": [255, 235, 205],
1652
- "blue": [0, 0, 255],
1653
- "blueviolet": [138, 43, 226],
1654
- "brown": [165, 42, 42],
1655
- "burlywood": [222, 184, 135],
1656
- "cadetblue": [95, 158, 160],
1657
- "chartreuse": [127, 255, 0],
1658
- "chocolate": [210, 105, 30],
1659
- "coral": [255, 127, 80],
1660
- "cornflowerblue": [100, 149, 237],
1661
- "cornsilk": [255, 248, 220],
1662
- "crimson": [220, 20, 60],
1663
- "cyan": [0, 255, 255],
1664
- "darkblue": [0, 0, 139],
1665
- "darkcyan": [0, 139, 139],
1666
- "darkgoldenrod": [184, 134, 11],
1667
- "darkgray": [169, 169, 169],
1668
- "darkgreen": [0, 100, 0],
1669
- "darkgrey": [169, 169, 169],
1670
- "darkkhaki": [189, 183, 107],
1671
- "darkmagenta": [139, 0, 139],
1672
- "darkolivegreen": [85, 107, 47],
1673
- "darkorange": [255, 140, 0],
1674
- "darkorchid": [153, 50, 204],
1675
- "darkred": [139, 0, 0],
1676
- "darksalmon": [233, 150, 122],
1677
- "darkseagreen": [143, 188, 143],
1678
- "darkslateblue": [72, 61, 139],
1679
- "darkslategray": [47, 79, 79],
1680
- "darkslategrey": [47, 79, 79],
1681
- "darkturquoise": [0, 206, 209],
1682
- "darkviolet": [148, 0, 211],
1683
- "deeppink": [255, 20, 147],
1684
- "deepskyblue": [0, 191, 255],
1685
- "dimgray": [105, 105, 105],
1686
- "dimgrey": [105, 105, 105],
1687
- "dodgerblue": [30, 144, 255],
1688
- "firebrick": [178, 34, 34],
1689
- "floralwhite": [255, 250, 240],
1690
- "forestgreen": [34, 139, 34],
1691
- "fuchsia": [255, 0, 255],
1692
- "gainsboro": [220, 220, 220],
1693
- "ghostwhite": [248, 248, 255],
1694
- "gold": [255, 215, 0],
1695
- "goldenrod": [218, 165, 32],
1696
- "gray": [128, 128, 128],
1697
- "green": [0, 128, 0],
1698
- "greenyellow": [173, 255, 47],
1699
- "grey": [128, 128, 128],
1700
- "honeydew": [240, 255, 240],
1701
- "hotpink": [255, 105, 180],
1702
- "indianred": [205, 92, 92],
1703
- "indigo": [75, 0, 130],
1704
- "ivory": [255, 255, 240],
1705
- "khaki": [240, 230, 140],
1706
- "lavender": [230, 230, 250],
1707
- "lavenderblush": [255, 240, 245],
1708
- "lawngreen": [124, 252, 0],
1709
- "lemonchiffon": [255, 250, 205],
1710
- "lightblue": [173, 216, 230],
1711
- "lightcoral": [240, 128, 128],
1712
- "lightcyan": [224, 255, 255],
1713
- "lightgoldenrodyellow": [250, 250, 210],
1714
- "lightgray": [211, 211, 211],
1715
- "lightgreen": [144, 238, 144],
1716
- "lightgrey": [211, 211, 211],
1717
- "lightpink": [255, 182, 193],
1718
- "lightsalmon": [255, 160, 122],
1719
- "lightseagreen": [32, 178, 170],
1720
- "lightskyblue": [135, 206, 250],
1721
- "lightslategray": [119, 136, 153],
1722
- "lightslategrey": [119, 136, 153],
1723
- "lightsteelblue": [176, 196, 222],
1724
- "lightyellow": [255, 255, 224],
1725
- "lime": [0, 255, 0],
1726
- "limegreen": [50, 205, 50],
1727
- "linen": [250, 240, 230],
1728
- "magenta": [255, 0, 255],
1729
- "maroon": [128, 0, 0],
1730
- "mediumaquamarine": [102, 205, 170],
1731
- "mediumblue": [0, 0, 205],
1732
- "mediumorchid": [186, 85, 211],
1733
- "mediumpurple": [147, 112, 219],
1734
- "mediumseagreen": [60, 179, 113],
1735
- "mediumslateblue": [123, 104, 238],
1736
- "mediumspringgreen": [0, 250, 154],
1737
- "mediumturquoise": [72, 209, 204],
1738
- "mediumvioletred": [199, 21, 133],
1739
- "midnightblue": [25, 25, 112],
1740
- "mintcream": [245, 255, 250],
1741
- "mistyrose": [255, 228, 225],
1742
- "moccasin": [255, 228, 181],
1743
- "navajowhite": [255, 222, 173],
1744
- "navy": [0, 0, 128],
1745
- "oldlace": [253, 245, 230],
1746
- "olive": [128, 128, 0],
1747
- "olivedrab": [107, 142, 35],
1748
- "orange": [255, 165, 0],
1749
- "orangered": [255, 69, 0],
1750
- "orchid": [218, 112, 214],
1751
- "palegoldenrod": [238, 232, 170],
1752
- "palegreen": [152, 251, 152],
1753
- "paleturquoise": [175, 238, 238],
1754
- "palevioletred": [219, 112, 147],
1755
- "papayawhip": [255, 239, 213],
1756
- "peachpuff": [255, 218, 185],
1757
- "peru": [205, 133, 63],
1758
- "pink": [255, 192, 203],
1759
- "plum": [221, 160, 221],
1760
- "powderblue": [176, 224, 230],
1761
- "purple": [128, 0, 128],
1762
- "rebeccapurple": [102, 51, 153],
1763
- "red": [255, 0, 0],
1764
- "rosybrown": [188, 143, 143],
1765
- "royalblue": [65, 105, 225],
1766
- "saddlebrown": [139, 69, 19],
1767
- "salmon": [250, 128, 114],
1768
- "sandybrown": [244, 164, 96],
1769
- "seagreen": [46, 139, 87],
1770
- "seashell": [255, 245, 238],
1771
- "sienna": [160, 82, 45],
1772
- "silver": [192, 192, 192],
1773
- "skyblue": [135, 206, 235],
1774
- "slateblue": [106, 90, 205],
1775
- "slategray": [112, 128, 144],
1776
- "slategrey": [112, 128, 144],
1777
- "snow": [255, 250, 250],
1778
- "springgreen": [0, 255, 127],
1779
- "steelblue": [70, 130, 180],
1780
- "tan": [210, 180, 140],
1781
- "teal": [0, 128, 128],
1782
- "thistle": [216, 191, 216],
1783
- "tomato": [255, 99, 71],
1784
- "turquoise": [64, 224, 208],
1785
- "violet": [238, 130, 238],
1786
- "wheat": [245, 222, 179],
1787
- "white": [255, 255, 255],
1788
- "whitesmoke": [245, 245, 245],
1789
- "yellow": [255, 255, 0],
1790
- "yellowgreen": [154, 205, 50]
1791
- };
1792
-
1793
-
1794
- /***/ }),
1795
-
1796
- /***/ 813:
1797
- /***/ ((module) => {
1798
-
1799
-
1800
-
1801
- module.exports = (flag, argv = process.argv) => {
1802
- const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');
1803
- const position = argv.indexOf(prefix + flag);
1804
- const terminatorPosition = argv.indexOf('--');
1805
- return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
1806
- };
1807
-
1808
-
1809
- /***/ }),
1810
-
1811
5
  /***/ 316:
1812
6
  /***/ ((__unused_webpack_module, __webpack_exports__, __nccwpck_require__) => {
1813
7
 
@@ -1817,7 +11,7 @@ module.exports = (flag, argv = process.argv) => {
1817
11
  /* harmony export */ qA: () => (/* binding */ THEME_TYPES),
1818
12
  /* harmony export */ yp: () => (/* binding */ CUSTOM_HANDLER_ENV_NAMES)
1819
13
  /* harmony export */ });
1820
- /* unused harmony exports WELL_KNOWN_DIRECTORY_BASE_NAME, VITE_PLUGIN_SUB_SCRIPTS_ENV_NAMES, BUILD_FOR_KEYCLOAK_MAJOR_VERSION_ENV_NAME, CONTAINER_NAME, FALLBACK_LANGUAGE_TAG, KEYCLOAK_THEME, KEYCLOAKIFY_SPA_DEV_SERVER_PORT, KEYCLOAKIFY_LOGGING_VERSION, KEYCLOAKIFY_LOGIN_JAR_BASENAME, TEST_APP_URL */
14
+ /* unused harmony exports WELL_KNOWN_DIRECTORY_BASE_NAME, VITE_PLUGIN_SUB_SCRIPTS_ENV_NAMES, BUILD_FOR_KEYCLOAK_MAJOR_VERSION_ENV_NAME, CONTAINER_NAME, FALLBACK_LANGUAGE_TAG, KEYCLOAK_THEME, KEYCLOAKIFY_SPA_DEV_SERVER_PORT, KEYCLOAKIFY_LOGGING_VERSION, KEYCLOAKIFY_LOGGING_JAR_BASENAME, TEST_APP_URL, EARLY_COLOR_SCHEME_SCRIPT_BASENAME */
1821
15
  const WELL_KNOWN_DIRECTORY_BASE_NAME = {
1822
16
  KEYCLOAKIFY_DEV_RESOURCES: "keycloakify-dev-resources",
1823
17
  RESOURCES_COMMON: "resources-common",
@@ -1847,6 +41,7 @@ const LOGIN_THEME_PAGE_IDS = [
1847
41
  "login-otp.ftl",
1848
42
  "login-update-profile.ftl",
1849
43
  "login-update-password.ftl",
44
+ "link-idp-action.ftl",
1850
45
  "login-idp-link-confirm.ftl",
1851
46
  "login-idp-link-email.ftl",
1852
47
  "login-page-expired.ftl",
@@ -1887,42 +82,348 @@ const CUSTOM_HANDLER_ENV_NAMES = {
1887
82
  const KEYCLOAK_THEME = "keycloak-theme";
1888
83
  const KEYCLOAKIFY_SPA_DEV_SERVER_PORT = "KEYCLOAKIFY_SPA_DEV_SERVER_PORT";
1889
84
  const KEYCLOAKIFY_LOGGING_VERSION = "1.0.3";
1890
- const KEYCLOAKIFY_LOGIN_JAR_BASENAME = (/* unused pure expression or super */ null && (`keycloakify-logging-${KEYCLOAKIFY_LOGGING_VERSION}.jar`));
85
+ const KEYCLOAKIFY_LOGGING_JAR_BASENAME = (/* unused pure expression or super */ null && (`keycloakify-logging-${KEYCLOAKIFY_LOGGING_VERSION}.jar`));
1891
86
  const TEST_APP_URL = "https://my-theme.keycloakify.dev";
87
+ const EARLY_COLOR_SCHEME_SCRIPT_BASENAME = "early-color-scheme.js";
1892
88
  //# sourceMappingURL=constants.js.map
1893
89
 
1894
- /***/ }),
90
+ /***/ }),
91
+
92
+ /***/ 317:
93
+ /***/ ((module) => {
94
+
95
+ module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("child_process");
96
+
97
+ /***/ }),
98
+
99
+ /***/ 982:
100
+ /***/ ((module) => {
101
+
102
+ module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("crypto");
103
+
104
+ /***/ }),
105
+
106
+ /***/ 896:
107
+ /***/ ((module) => {
108
+
109
+ module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("fs");
110
+
111
+ /***/ }),
112
+
113
+ /***/ 943:
114
+ /***/ ((module) => {
115
+
116
+ module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("fs/promises");
117
+
118
+ /***/ }),
119
+
120
+ /***/ 928:
121
+ /***/ ((module) => {
122
+
123
+ module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("path");
124
+
125
+ /***/ }),
126
+
127
+ /***/ 785:
128
+ /***/ ((module) => {
129
+
130
+ module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("readline");
131
+
132
+ /***/ }),
133
+
134
+ /***/ 16:
135
+ /***/ ((module) => {
136
+
137
+ module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("url");
138
+
139
+ /***/ }),
140
+
141
+ /***/ 276:
142
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __nccwpck_require__) => {
143
+
144
+
145
+ // EXPORTS
146
+ __nccwpck_require__.d(__webpack_exports__, {
147
+ Ay: () => (/* binding */ source)
148
+ });
149
+
150
+ // UNUSED EXPORTS: Chalk, backgroundColorNames, backgroundColors, chalkStderr, colorNames, colors, foregroundColorNames, foregroundColors, modifierNames, modifiers, supportsColor, supportsColorStderr
151
+
152
+ ;// CONCATENATED MODULE: ./node_modules/chalk/source/vendor/ansi-styles/index.js
153
+ const ANSI_BACKGROUND_OFFSET = 10;
154
+
155
+ const wrapAnsi16 = (offset = 0) => code => `\u001B[${code + offset}m`;
156
+
157
+ const wrapAnsi256 = (offset = 0) => code => `\u001B[${38 + offset};5;${code}m`;
158
+
159
+ const wrapAnsi16m = (offset = 0) => (red, green, blue) => `\u001B[${38 + offset};2;${red};${green};${blue}m`;
160
+
161
+ const styles = {
162
+ modifier: {
163
+ reset: [0, 0],
164
+ // 21 isn't widely supported and 22 does the same thing
165
+ bold: [1, 22],
166
+ dim: [2, 22],
167
+ italic: [3, 23],
168
+ underline: [4, 24],
169
+ overline: [53, 55],
170
+ inverse: [7, 27],
171
+ hidden: [8, 28],
172
+ strikethrough: [9, 29],
173
+ },
174
+ color: {
175
+ black: [30, 39],
176
+ red: [31, 39],
177
+ green: [32, 39],
178
+ yellow: [33, 39],
179
+ blue: [34, 39],
180
+ magenta: [35, 39],
181
+ cyan: [36, 39],
182
+ white: [37, 39],
183
+
184
+ // Bright color
185
+ blackBright: [90, 39],
186
+ gray: [90, 39], // Alias of `blackBright`
187
+ grey: [90, 39], // Alias of `blackBright`
188
+ redBright: [91, 39],
189
+ greenBright: [92, 39],
190
+ yellowBright: [93, 39],
191
+ blueBright: [94, 39],
192
+ magentaBright: [95, 39],
193
+ cyanBright: [96, 39],
194
+ whiteBright: [97, 39],
195
+ },
196
+ bgColor: {
197
+ bgBlack: [40, 49],
198
+ bgRed: [41, 49],
199
+ bgGreen: [42, 49],
200
+ bgYellow: [43, 49],
201
+ bgBlue: [44, 49],
202
+ bgMagenta: [45, 49],
203
+ bgCyan: [46, 49],
204
+ bgWhite: [47, 49],
205
+
206
+ // Bright color
207
+ bgBlackBright: [100, 49],
208
+ bgGray: [100, 49], // Alias of `bgBlackBright`
209
+ bgGrey: [100, 49], // Alias of `bgBlackBright`
210
+ bgRedBright: [101, 49],
211
+ bgGreenBright: [102, 49],
212
+ bgYellowBright: [103, 49],
213
+ bgBlueBright: [104, 49],
214
+ bgMagentaBright: [105, 49],
215
+ bgCyanBright: [106, 49],
216
+ bgWhiteBright: [107, 49],
217
+ },
218
+ };
219
+
220
+ const modifierNames = Object.keys(styles.modifier);
221
+ const foregroundColorNames = Object.keys(styles.color);
222
+ const backgroundColorNames = Object.keys(styles.bgColor);
223
+ const colorNames = [...foregroundColorNames, ...backgroundColorNames];
224
+
225
+ function assembleStyles() {
226
+ const codes = new Map();
227
+
228
+ for (const [groupName, group] of Object.entries(styles)) {
229
+ for (const [styleName, style] of Object.entries(group)) {
230
+ styles[styleName] = {
231
+ open: `\u001B[${style[0]}m`,
232
+ close: `\u001B[${style[1]}m`,
233
+ };
234
+
235
+ group[styleName] = styles[styleName];
236
+
237
+ codes.set(style[0], style[1]);
238
+ }
239
+
240
+ Object.defineProperty(styles, groupName, {
241
+ value: group,
242
+ enumerable: false,
243
+ });
244
+ }
245
+
246
+ Object.defineProperty(styles, 'codes', {
247
+ value: codes,
248
+ enumerable: false,
249
+ });
250
+
251
+ styles.color.close = '\u001B[39m';
252
+ styles.bgColor.close = '\u001B[49m';
253
+
254
+ styles.color.ansi = wrapAnsi16();
255
+ styles.color.ansi256 = wrapAnsi256();
256
+ styles.color.ansi16m = wrapAnsi16m();
257
+ styles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
258
+ styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
259
+ styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
260
+
261
+ // From https://github.com/Qix-/color-convert/blob/3f0e0d4e92e235796ccb17f6e85c72094a651f49/conversions.js
262
+ Object.defineProperties(styles, {
263
+ rgbToAnsi256: {
264
+ value(red, green, blue) {
265
+ // We use the extended greyscale palette here, with the exception of
266
+ // black and white. normal palette only has 4 greyscale shades.
267
+ if (red === green && green === blue) {
268
+ if (red < 8) {
269
+ return 16;
270
+ }
271
+
272
+ if (red > 248) {
273
+ return 231;
274
+ }
275
+
276
+ return Math.round(((red - 8) / 247) * 24) + 232;
277
+ }
278
+
279
+ return 16
280
+ + (36 * Math.round(red / 255 * 5))
281
+ + (6 * Math.round(green / 255 * 5))
282
+ + Math.round(blue / 255 * 5);
283
+ },
284
+ enumerable: false,
285
+ },
286
+ hexToRgb: {
287
+ value(hex) {
288
+ const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
289
+ if (!matches) {
290
+ return [0, 0, 0];
291
+ }
292
+
293
+ let [colorString] = matches;
294
+
295
+ if (colorString.length === 3) {
296
+ colorString = [...colorString].map(character => character + character).join('');
297
+ }
298
+
299
+ const integer = Number.parseInt(colorString, 16);
300
+
301
+ return [
302
+ /* eslint-disable no-bitwise */
303
+ (integer >> 16) & 0xFF,
304
+ (integer >> 8) & 0xFF,
305
+ integer & 0xFF,
306
+ /* eslint-enable no-bitwise */
307
+ ];
308
+ },
309
+ enumerable: false,
310
+ },
311
+ hexToAnsi256: {
312
+ value: hex => styles.rgbToAnsi256(...styles.hexToRgb(hex)),
313
+ enumerable: false,
314
+ },
315
+ ansi256ToAnsi: {
316
+ value(code) {
317
+ if (code < 8) {
318
+ return 30 + code;
319
+ }
320
+
321
+ if (code < 16) {
322
+ return 90 + (code - 8);
323
+ }
324
+
325
+ let red;
326
+ let green;
327
+ let blue;
328
+
329
+ if (code >= 232) {
330
+ red = (((code - 232) * 10) + 8) / 255;
331
+ green = red;
332
+ blue = red;
333
+ } else {
334
+ code -= 16;
335
+
336
+ const remainder = code % 36;
337
+
338
+ red = Math.floor(code / 36) / 5;
339
+ green = Math.floor(remainder / 6) / 5;
340
+ blue = (remainder % 6) / 5;
341
+ }
342
+
343
+ const value = Math.max(red, green, blue) * 2;
344
+
345
+ if (value === 0) {
346
+ return 30;
347
+ }
348
+
349
+ // eslint-disable-next-line no-bitwise
350
+ let result = 30 + ((Math.round(blue) << 2) | (Math.round(green) << 1) | Math.round(red));
351
+
352
+ if (value === 2) {
353
+ result += 60;
354
+ }
355
+
356
+ return result;
357
+ },
358
+ enumerable: false,
359
+ },
360
+ rgbToAnsi: {
361
+ value: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)),
362
+ enumerable: false,
363
+ },
364
+ hexToAnsi: {
365
+ value: hex => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),
366
+ enumerable: false,
367
+ },
368
+ });
369
+
370
+ return styles;
371
+ }
372
+
373
+ const ansiStyles = assembleStyles();
1895
374
 
1896
- /***/ 450:
1897
- /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
375
+ /* harmony default export */ const ansi_styles = (ansiStyles);
1898
376
 
377
+ ;// CONCATENATED MODULE: external "node:process"
378
+ const external_node_process_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:process");
379
+ ;// CONCATENATED MODULE: external "node:os"
380
+ const external_node_os_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:os");
381
+ ;// CONCATENATED MODULE: external "node:tty"
382
+ const external_node_tty_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:tty");
383
+ ;// CONCATENATED MODULE: ./node_modules/chalk/source/vendor/supports-color/index.js
1899
384
 
1900
- const os = __nccwpck_require__(857);
1901
- const tty = __nccwpck_require__(18);
1902
- const hasFlag = __nccwpck_require__(813);
1903
385
 
1904
- const {env} = process;
1905
386
 
1906
- let forceColor;
1907
- if (hasFlag('no-color') ||
1908
- hasFlag('no-colors') ||
1909
- hasFlag('color=false') ||
1910
- hasFlag('color=never')) {
1911
- forceColor = 0;
1912
- } else if (hasFlag('color') ||
1913
- hasFlag('colors') ||
1914
- hasFlag('color=true') ||
1915
- hasFlag('color=always')) {
1916
- forceColor = 1;
387
+
388
+ // From: https://github.com/sindresorhus/has-flag/blob/main/index.js
389
+ /// function hasFlag(flag, argv = globalThis.Deno?.args ?? process.argv) {
390
+ function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : external_node_process_namespaceObject.argv) {
391
+ const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');
392
+ const position = argv.indexOf(prefix + flag);
393
+ const terminatorPosition = argv.indexOf('--');
394
+ return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
1917
395
  }
1918
396
 
1919
- if ('FORCE_COLOR' in env) {
1920
- if (env.FORCE_COLOR === 'true') {
1921
- forceColor = 1;
1922
- } else if (env.FORCE_COLOR === 'false') {
1923
- forceColor = 0;
1924
- } else {
1925
- forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);
397
+ const {env} = external_node_process_namespaceObject;
398
+
399
+ let flagForceColor;
400
+ if (
401
+ hasFlag('no-color')
402
+ || hasFlag('no-colors')
403
+ || hasFlag('color=false')
404
+ || hasFlag('color=never')
405
+ ) {
406
+ flagForceColor = 0;
407
+ } else if (
408
+ hasFlag('color')
409
+ || hasFlag('colors')
410
+ || hasFlag('color=true')
411
+ || hasFlag('color=always')
412
+ ) {
413
+ flagForceColor = 1;
414
+ }
415
+
416
+ function envForceColor() {
417
+ if ('FORCE_COLOR' in env) {
418
+ if (env.FORCE_COLOR === 'true') {
419
+ return 1;
420
+ }
421
+
422
+ if (env.FORCE_COLOR === 'false') {
423
+ return 0;
424
+ }
425
+
426
+ return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
1926
427
  }
1927
428
  }
1928
429
 
@@ -1935,23 +436,38 @@ function translateLevel(level) {
1935
436
  level,
1936
437
  hasBasic: true,
1937
438
  has256: level >= 2,
1938
- has16m: level >= 3
439
+ has16m: level >= 3,
1939
440
  };
1940
441
  }
1941
442
 
1942
- function supportsColor(haveStream, streamIsTTY) {
443
+ function _supportsColor(haveStream, {streamIsTTY, sniffFlags = true} = {}) {
444
+ const noFlagForceColor = envForceColor();
445
+ if (noFlagForceColor !== undefined) {
446
+ flagForceColor = noFlagForceColor;
447
+ }
448
+
449
+ const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
450
+
1943
451
  if (forceColor === 0) {
1944
452
  return 0;
1945
453
  }
1946
454
 
1947
- if (hasFlag('color=16m') ||
1948
- hasFlag('color=full') ||
1949
- hasFlag('color=truecolor')) {
1950
- return 3;
455
+ if (sniffFlags) {
456
+ if (hasFlag('color=16m')
457
+ || hasFlag('color=full')
458
+ || hasFlag('color=truecolor')) {
459
+ return 3;
460
+ }
461
+
462
+ if (hasFlag('color=256')) {
463
+ return 2;
464
+ }
1951
465
  }
1952
466
 
1953
- if (hasFlag('color=256')) {
1954
- return 2;
467
+ // Check for Azure DevOps pipelines.
468
+ // Has to be above the `!streamIsTTY` check.
469
+ if ('TF_BUILD' in env && 'AGENT_NAME' in env) {
470
+ return 1;
1955
471
  }
1956
472
 
1957
473
  if (haveStream && !streamIsTTY && forceColor === undefined) {
@@ -1964,22 +480,26 @@ function supportsColor(haveStream, streamIsTTY) {
1964
480
  return min;
1965
481
  }
1966
482
 
1967
- if (process.platform === 'win32') {
483
+ if (external_node_process_namespaceObject.platform === 'win32') {
1968
484
  // Windows 10 build 10586 is the first Windows release that supports 256 colors.
1969
485
  // Windows 10 build 14931 is the first release that supports 16m/TrueColor.
1970
- const osRelease = os.release().split('.');
486
+ const osRelease = external_node_os_namespaceObject.release().split('.');
1971
487
  if (
1972
- Number(osRelease[0]) >= 10 &&
1973
- Number(osRelease[2]) >= 10586
488
+ Number(osRelease[0]) >= 10
489
+ && Number(osRelease[2]) >= 10_586
1974
490
  ) {
1975
- return Number(osRelease[2]) >= 14931 ? 3 : 2;
491
+ return Number(osRelease[2]) >= 14_931 ? 3 : 2;
1976
492
  }
1977
493
 
1978
494
  return 1;
1979
495
  }
1980
496
 
1981
497
  if ('CI' in env) {
1982
- if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI', 'GITHUB_ACTIONS', 'BUILDKITE'].some(sign => sign in env) || env.CI_NAME === 'codeship') {
498
+ if (['GITHUB_ACTIONS', 'GITEA_ACTIONS', 'CIRCLECI'].some(key => key in env)) {
499
+ return 3;
500
+ }
501
+
502
+ if (['TRAVIS', 'APPVEYOR', 'GITLAB_CI', 'BUILDKITE', 'DRONE'].some(sign => sign in env) || env.CI_NAME === 'codeship') {
1983
503
  return 1;
1984
504
  }
1985
505
 
@@ -1994,14 +514,29 @@ function supportsColor(haveStream, streamIsTTY) {
1994
514
  return 3;
1995
515
  }
1996
516
 
517
+ if (env.TERM === 'xterm-kitty') {
518
+ return 3;
519
+ }
520
+
521
+ if (env.TERM === 'xterm-ghostty') {
522
+ return 3;
523
+ }
524
+
525
+ if (env.TERM === 'wezterm') {
526
+ return 3;
527
+ }
528
+
1997
529
  if ('TERM_PROGRAM' in env) {
1998
- const version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
530
+ const version = Number.parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
1999
531
 
2000
532
  switch (env.TERM_PROGRAM) {
2001
- case 'iTerm.app':
533
+ case 'iTerm.app': {
2002
534
  return version >= 3 ? 3 : 2;
2003
- case 'Apple_Terminal':
535
+ }
536
+
537
+ case 'Apple_Terminal': {
2004
538
  return 2;
539
+ }
2005
540
  // No default
2006
541
  }
2007
542
  }
@@ -2021,80 +556,267 @@ function supportsColor(haveStream, streamIsTTY) {
2021
556
  return min;
2022
557
  }
2023
558
 
2024
- function getSupportLevel(stream) {
2025
- const level = supportsColor(stream, stream && stream.isTTY);
559
+ function createSupportsColor(stream, options = {}) {
560
+ const level = _supportsColor(stream, {
561
+ streamIsTTY: stream && stream.isTTY,
562
+ ...options,
563
+ });
564
+
2026
565
  return translateLevel(level);
2027
566
  }
2028
567
 
2029
- module.exports = {
2030
- supportsColor: getSupportLevel,
2031
- stdout: translateLevel(supportsColor(true, tty.isatty(1))),
2032
- stderr: translateLevel(supportsColor(true, tty.isatty(2)))
568
+ const supportsColor = {
569
+ stdout: createSupportsColor({isTTY: external_node_tty_namespaceObject.isatty(1)}),
570
+ stderr: createSupportsColor({isTTY: external_node_tty_namespaceObject.isatty(2)}),
2033
571
  };
2034
572
 
573
+ /* harmony default export */ const supports_color = (supportsColor);
2035
574
 
2036
- /***/ }),
575
+ ;// CONCATENATED MODULE: ./node_modules/chalk/source/utilities.js
576
+ // TODO: When targeting Node.js 16, use `String.prototype.replaceAll`.
577
+ function stringReplaceAll(string, substring, replacer) {
578
+ let index = string.indexOf(substring);
579
+ if (index === -1) {
580
+ return string;
581
+ }
2037
582
 
2038
- /***/ 317:
2039
- /***/ ((module) => {
583
+ const substringLength = substring.length;
584
+ let endIndex = 0;
585
+ let returnValue = '';
586
+ do {
587
+ returnValue += string.slice(endIndex, index) + substring + replacer;
588
+ endIndex = index + substringLength;
589
+ index = string.indexOf(substring, endIndex);
590
+ } while (index !== -1);
2040
591
 
2041
- module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("child_process");
592
+ returnValue += string.slice(endIndex);
593
+ return returnValue;
594
+ }
2042
595
 
2043
- /***/ }),
596
+ function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {
597
+ let endIndex = 0;
598
+ let returnValue = '';
599
+ do {
600
+ const gotCR = string[index - 1] === '\r';
601
+ returnValue += string.slice(endIndex, (gotCR ? index - 1 : index)) + prefix + (gotCR ? '\r\n' : '\n') + postfix;
602
+ endIndex = index + 1;
603
+ index = string.indexOf('\n', endIndex);
604
+ } while (index !== -1);
2044
605
 
2045
- /***/ 982:
2046
- /***/ ((module) => {
606
+ returnValue += string.slice(endIndex);
607
+ return returnValue;
608
+ }
2047
609
 
2048
- module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("crypto");
610
+ ;// CONCATENATED MODULE: ./node_modules/chalk/source/index.js
2049
611
 
2050
- /***/ }),
2051
612
 
2052
- /***/ 896:
2053
- /***/ ((module) => {
2054
613
 
2055
- module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("fs");
2056
614
 
2057
- /***/ }),
615
+ const {stdout: stdoutColor, stderr: stderrColor} = supports_color;
2058
616
 
2059
- /***/ 943:
2060
- /***/ ((module) => {
617
+ const GENERATOR = Symbol('GENERATOR');
618
+ const STYLER = Symbol('STYLER');
619
+ const IS_EMPTY = Symbol('IS_EMPTY');
2061
620
 
2062
- module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("fs/promises");
621
+ // `supportsColor.level` `ansiStyles.color[name]` mapping
622
+ const levelMapping = [
623
+ 'ansi',
624
+ 'ansi',
625
+ 'ansi256',
626
+ 'ansi16m',
627
+ ];
2063
628
 
2064
- /***/ }),
629
+ const source_styles = Object.create(null);
2065
630
 
2066
- /***/ 857:
2067
- /***/ ((module) => {
631
+ const applyOptions = (object, options = {}) => {
632
+ if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
633
+ throw new Error('The `level` option should be an integer from 0 to 3');
634
+ }
2068
635
 
2069
- module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("os");
636
+ // Detect level if not set manually
637
+ const colorLevel = stdoutColor ? stdoutColor.level : 0;
638
+ object.level = options.level === undefined ? colorLevel : options.level;
639
+ };
2070
640
 
2071
- /***/ }),
641
+ class Chalk {
642
+ constructor(options) {
643
+ // eslint-disable-next-line no-constructor-return
644
+ return chalkFactory(options);
645
+ }
646
+ }
2072
647
 
2073
- /***/ 928:
2074
- /***/ ((module) => {
648
+ const chalkFactory = options => {
649
+ const chalk = (...strings) => strings.join(' ');
650
+ applyOptions(chalk, options);
2075
651
 
2076
- module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("path");
652
+ Object.setPrototypeOf(chalk, createChalk.prototype);
2077
653
 
2078
- /***/ }),
654
+ return chalk;
655
+ };
2079
656
 
2080
- /***/ 785:
2081
- /***/ ((module) => {
657
+ function createChalk(options) {
658
+ return chalkFactory(options);
659
+ }
2082
660
 
2083
- module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("readline");
661
+ Object.setPrototypeOf(createChalk.prototype, Function.prototype);
2084
662
 
2085
- /***/ }),
663
+ for (const [styleName, style] of Object.entries(ansi_styles)) {
664
+ source_styles[styleName] = {
665
+ get() {
666
+ const builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);
667
+ Object.defineProperty(this, styleName, {value: builder});
668
+ return builder;
669
+ },
670
+ };
671
+ }
2086
672
 
2087
- /***/ 18:
2088
- /***/ ((module) => {
673
+ source_styles.visible = {
674
+ get() {
675
+ const builder = createBuilder(this, this[STYLER], true);
676
+ Object.defineProperty(this, 'visible', {value: builder});
677
+ return builder;
678
+ },
679
+ };
2089
680
 
2090
- module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("tty");
681
+ const getModelAnsi = (model, level, type, ...arguments_) => {
682
+ if (model === 'rgb') {
683
+ if (level === 'ansi16m') {
684
+ return ansi_styles[type].ansi16m(...arguments_);
685
+ }
2091
686
 
2092
- /***/ }),
687
+ if (level === 'ansi256') {
688
+ return ansi_styles[type].ansi256(ansi_styles.rgbToAnsi256(...arguments_));
689
+ }
2093
690
 
2094
- /***/ 16:
2095
- /***/ ((module) => {
691
+ return ansi_styles[type].ansi(ansi_styles.rgbToAnsi(...arguments_));
692
+ }
693
+
694
+ if (model === 'hex') {
695
+ return getModelAnsi('rgb', level, type, ...ansi_styles.hexToRgb(...arguments_));
696
+ }
697
+
698
+ return ansi_styles[type][model](...arguments_);
699
+ };
700
+
701
+ const usedModels = ['rgb', 'hex', 'ansi256'];
702
+
703
+ for (const model of usedModels) {
704
+ source_styles[model] = {
705
+ get() {
706
+ const {level} = this;
707
+ return function (...arguments_) {
708
+ const styler = createStyler(getModelAnsi(model, levelMapping[level], 'color', ...arguments_), ansi_styles.color.close, this[STYLER]);
709
+ return createBuilder(this, styler, this[IS_EMPTY]);
710
+ };
711
+ },
712
+ };
713
+
714
+ const bgModel = 'bg' + model[0].toUpperCase() + model.slice(1);
715
+ source_styles[bgModel] = {
716
+ get() {
717
+ const {level} = this;
718
+ return function (...arguments_) {
719
+ const styler = createStyler(getModelAnsi(model, levelMapping[level], 'bgColor', ...arguments_), ansi_styles.bgColor.close, this[STYLER]);
720
+ return createBuilder(this, styler, this[IS_EMPTY]);
721
+ };
722
+ },
723
+ };
724
+ }
725
+
726
+ const proto = Object.defineProperties(() => {}, {
727
+ ...source_styles,
728
+ level: {
729
+ enumerable: true,
730
+ get() {
731
+ return this[GENERATOR].level;
732
+ },
733
+ set(level) {
734
+ this[GENERATOR].level = level;
735
+ },
736
+ },
737
+ });
738
+
739
+ const createStyler = (open, close, parent) => {
740
+ let openAll;
741
+ let closeAll;
742
+ if (parent === undefined) {
743
+ openAll = open;
744
+ closeAll = close;
745
+ } else {
746
+ openAll = parent.openAll + open;
747
+ closeAll = close + parent.closeAll;
748
+ }
749
+
750
+ return {
751
+ open,
752
+ close,
753
+ openAll,
754
+ closeAll,
755
+ parent,
756
+ };
757
+ };
758
+
759
+ const createBuilder = (self, _styler, _isEmpty) => {
760
+ // Single argument is hot path, implicit coercion is faster than anything
761
+ // eslint-disable-next-line no-implicit-coercion
762
+ const builder = (...arguments_) => applyStyle(builder, (arguments_.length === 1) ? ('' + arguments_[0]) : arguments_.join(' '));
763
+
764
+ // We alter the prototype because we must return a function, but there is
765
+ // no way to create a function with a different prototype
766
+ Object.setPrototypeOf(builder, proto);
767
+
768
+ builder[GENERATOR] = self;
769
+ builder[STYLER] = _styler;
770
+ builder[IS_EMPTY] = _isEmpty;
771
+
772
+ return builder;
773
+ };
774
+
775
+ const applyStyle = (self, string) => {
776
+ if (self.level <= 0 || !string) {
777
+ return self[IS_EMPTY] ? '' : string;
778
+ }
779
+
780
+ let styler = self[STYLER];
781
+
782
+ if (styler === undefined) {
783
+ return string;
784
+ }
785
+
786
+ const {openAll, closeAll} = styler;
787
+ if (string.includes('\u001B')) {
788
+ while (styler !== undefined) {
789
+ // Replace any instances already present with a re-opening code
790
+ // otherwise only the part of the string until said closing code
791
+ // will be colored, and the rest will simply be 'plain'.
792
+ string = stringReplaceAll(string, styler.close, styler.open);
793
+
794
+ styler = styler.parent;
795
+ }
796
+ }
797
+
798
+ // We can move both next actions out of loop, because remaining actions in loop won't have
799
+ // any/visible effect on parts we add here. Close the styling before a linebreak and reopen
800
+ // after next line to fix a bleed issue on macOS: https://github.com/chalk/chalk/pull/92
801
+ const lfIndex = string.indexOf('\n');
802
+ if (lfIndex !== -1) {
803
+ string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
804
+ }
805
+
806
+ return openAll + string + closeAll;
807
+ };
808
+
809
+ Object.defineProperties(createChalk.prototype, source_styles);
810
+
811
+ const chalk = createChalk();
812
+ const chalkStderr = createChalk({level: stderrColor ? stderrColor.level : 0});
813
+
814
+
815
+
816
+
817
+
818
+ /* harmony default export */ const source = (chalk);
2096
819
 
2097
- module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("url");
2098
820
 
2099
821
  /***/ }),
2100
822
 
@@ -2306,12 +1028,14 @@ function is(value) {
2306
1028
  /******/ __nccwpck_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
2307
1029
  /******/ })();
2308
1030
  /******/
2309
- /******/ /* webpack/runtime/node module decorator */
1031
+ /******/ /* webpack/runtime/make namespace object */
2310
1032
  /******/ (() => {
2311
- /******/ __nccwpck_require__.nmd = (module) => {
2312
- /******/ module.paths = [];
2313
- /******/ if (!module.children) module.children = [];
2314
- /******/ return module;
1033
+ /******/ // define __esModule on exports
1034
+ /******/ __nccwpck_require__.r = (exports) => {
1035
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
1036
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
1037
+ /******/ }
1038
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
2315
1039
  /******/ };
2316
1040
  /******/ })();
2317
1041
  /******/
@@ -2385,9 +1109,8 @@ function is(value) {
2385
1109
  /************************************************************************/
2386
1110
  var __webpack_exports__ = {};
2387
1111
 
2388
- // EXTERNAL MODULE: ./node_modules/chalk/source/index.js
2389
- var source = __nccwpck_require__(465);
2390
- var source_default = /*#__PURE__*/__nccwpck_require__.n(source);
1112
+ // EXTERNAL MODULE: ./node_modules/chalk/source/index.js + 6 modules
1113
+ var source = __nccwpck_require__(276);
2391
1114
  // EXTERNAL MODULE: ./node_modules/tsafe/esm/assert.mjs + 1 modules
2392
1115
  var assert = __nccwpck_require__(966);
2393
1116
  // EXTERNAL MODULE: ./node_modules/keycloakify/bin/shared/constants.js
@@ -2433,19 +1156,19 @@ const { buildContext, commandName } = readParams({ apiVersion: 'v1' });
2433
1156
  return;
2434
1157
  case 'update-kc-gen':
2435
1158
  {
2436
- const { command } = await __nccwpck_require__.e(/* import() */ 200).then(__nccwpck_require__.bind(__nccwpck_require__, 819));
1159
+ const { command } = await __nccwpck_require__.e(/* import() */ 200).then(__nccwpck_require__.bind(__nccwpck_require__, 200));
2437
1160
  command({ buildContext });
2438
1161
  }
2439
1162
  return;
2440
1163
  case 'initialize-account-theme':
2441
1164
  {
2442
- const { command } = await Promise.all(/* import() */[__nccwpck_require__.e(343), __nccwpck_require__.e(709)]).then(__nccwpck_require__.bind(__nccwpck_require__, 709));
1165
+ const { command } = await Promise.all(/* import() */[__nccwpck_require__.e(545), __nccwpck_require__.e(709)]).then(__nccwpck_require__.bind(__nccwpck_require__, 709));
2443
1166
  command({ buildContext });
2444
1167
  }
2445
1168
  return;
2446
1169
  case 'initialize-admin-theme':
2447
1170
  {
2448
- console.log(source_default().red('Cannot create an admin theme when using Svelte.'));
1171
+ console.log(source/* default */.Ay.red('Cannot create an admin theme when using Svelte.'));
2449
1172
  process.exit(1);
2450
1173
  }
2451
1174
  return;