babel-plugin-react-compiler 0.0.0-experimental-ba7b8e5-20241213 → 0.0.0-experimental-22c6e49-20241217
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +469 -1993
- package/package.json +1 -3
package/dist/index.js
CHANGED
@@ -12895,13 +12895,13 @@ function requireAncestry$1() {
|
|
12895
12895
|
var inference$1 = {};
|
12896
12896
|
var inferers$1 = {};
|
12897
12897
|
var infererReference$1 = {};
|
12898
|
-
var util$
|
12898
|
+
var util$6 = {};
|
12899
12899
|
var hasRequiredUtil$1;
|
12900
12900
|
function requireUtil$1() {
|
12901
|
-
if (hasRequiredUtil$1) return util$
|
12901
|
+
if (hasRequiredUtil$1) return util$6;
|
12902
12902
|
hasRequiredUtil$1 = 1;
|
12903
|
-
Object.defineProperty(util$
|
12904
|
-
util$
|
12903
|
+
Object.defineProperty(util$6, '__esModule', {value: true});
|
12904
|
+
util$6.createUnionType = createUnionType;
|
12905
12905
|
var _t = t$d;
|
12906
12906
|
const {
|
12907
12907
|
createFlowUnionType: createFlowUnionType,
|
@@ -12924,7 +12924,7 @@ function requireUtil$1() {
|
|
12924
12924
|
}
|
12925
12925
|
}
|
12926
12926
|
}
|
12927
|
-
return util$
|
12927
|
+
return util$6;
|
12928
12928
|
}
|
12929
12929
|
var hasRequiredInfererReference$1;
|
12930
12930
|
function requireInfererReference$1() {
|
@@ -50740,7 +50740,7 @@ function requireLib$g() {
|
|
50740
50740
|
})(lib$d);
|
50741
50741
|
return lib$d;
|
50742
50742
|
}
|
50743
|
-
var chalk$
|
50743
|
+
var chalk$1 = {exports: {}};
|
50744
50744
|
var escapeStringRegexp$1;
|
50745
50745
|
var hasRequiredEscapeStringRegexp$1;
|
50746
50746
|
function requireEscapeStringRegexp$1() {
|
@@ -50755,14 +50755,14 @@ function requireEscapeStringRegexp$1() {
|
|
50755
50755
|
};
|
50756
50756
|
return escapeStringRegexp$1;
|
50757
50757
|
}
|
50758
|
-
var ansiStyles$
|
50759
|
-
var conversions$
|
50760
|
-
var colorName$
|
50761
|
-
var hasRequiredColorName
|
50762
|
-
function requireColorName
|
50763
|
-
if (hasRequiredColorName
|
50764
|
-
hasRequiredColorName
|
50765
|
-
colorName$
|
50758
|
+
var ansiStyles$1 = {exports: {}};
|
50759
|
+
var conversions$3 = {exports: {}};
|
50760
|
+
var colorName$1;
|
50761
|
+
var hasRequiredColorName;
|
50762
|
+
function requireColorName() {
|
50763
|
+
if (hasRequiredColorName) return colorName$1;
|
50764
|
+
hasRequiredColorName = 1;
|
50765
|
+
colorName$1 = {
|
50766
50766
|
aliceblue: [240, 248, 255],
|
50767
50767
|
antiquewhite: [250, 235, 215],
|
50768
50768
|
aqua: [0, 255, 255],
|
@@ -50912,20 +50912,20 @@ function requireColorName$1() {
|
|
50912
50912
|
yellow: [255, 255, 0],
|
50913
50913
|
yellowgreen: [154, 205, 50],
|
50914
50914
|
};
|
50915
|
-
return colorName$
|
50915
|
+
return colorName$1;
|
50916
50916
|
}
|
50917
|
-
var hasRequiredConversions
|
50918
|
-
function requireConversions
|
50919
|
-
if (hasRequiredConversions
|
50920
|
-
hasRequiredConversions
|
50921
|
-
var cssKeywords = requireColorName
|
50917
|
+
var hasRequiredConversions;
|
50918
|
+
function requireConversions() {
|
50919
|
+
if (hasRequiredConversions) return conversions$3.exports;
|
50920
|
+
hasRequiredConversions = 1;
|
50921
|
+
var cssKeywords = requireColorName();
|
50922
50922
|
var reverseKeywords = {};
|
50923
50923
|
for (var key in cssKeywords) {
|
50924
50924
|
if (cssKeywords.hasOwnProperty(key)) {
|
50925
50925
|
reverseKeywords[cssKeywords[key]] = key;
|
50926
50926
|
}
|
50927
50927
|
}
|
50928
|
-
var convert = (conversions$
|
50928
|
+
var convert = (conversions$3.exports = {
|
50929
50929
|
rgb: {channels: 3, labels: 'rgb'},
|
50930
50930
|
hsl: {channels: 3, labels: 'hsl'},
|
50931
50931
|
hsv: {channels: 3, labels: 'hsv'},
|
@@ -51647,14 +51647,14 @@ function requireConversions$1() {
|
|
51647
51647
|
var val = (rgb[0] + rgb[1] + rgb[2]) / 3;
|
51648
51648
|
return [(val / 255) * 100];
|
51649
51649
|
};
|
51650
|
-
return conversions$
|
51651
|
-
}
|
51652
|
-
var route$
|
51653
|
-
var hasRequiredRoute
|
51654
|
-
function requireRoute
|
51655
|
-
if (hasRequiredRoute
|
51656
|
-
hasRequiredRoute
|
51657
|
-
var conversions = requireConversions
|
51650
|
+
return conversions$3.exports;
|
51651
|
+
}
|
51652
|
+
var route$2;
|
51653
|
+
var hasRequiredRoute;
|
51654
|
+
function requireRoute() {
|
51655
|
+
if (hasRequiredRoute) return route$2;
|
51656
|
+
hasRequiredRoute = 1;
|
51657
|
+
var conversions = requireConversions();
|
51658
51658
|
function buildGraph() {
|
51659
51659
|
var graph = {};
|
51660
51660
|
var models = Object.keys(conversions);
|
@@ -51699,7 +51699,7 @@ function requireRoute$1() {
|
|
51699
51699
|
fn.conversion = path;
|
51700
51700
|
return fn;
|
51701
51701
|
}
|
51702
|
-
route$
|
51702
|
+
route$2 = function (fromModel) {
|
51703
51703
|
var graph = deriveBFS(fromModel);
|
51704
51704
|
var conversion = {};
|
51705
51705
|
var models = Object.keys(graph);
|
@@ -51713,15 +51713,15 @@ function requireRoute$1() {
|
|
51713
51713
|
}
|
51714
51714
|
return conversion;
|
51715
51715
|
};
|
51716
|
-
return route$
|
51717
|
-
}
|
51718
|
-
var colorConvert$
|
51719
|
-
var hasRequiredColorConvert
|
51720
|
-
function requireColorConvert
|
51721
|
-
if (hasRequiredColorConvert
|
51722
|
-
hasRequiredColorConvert
|
51723
|
-
var conversions = requireConversions
|
51724
|
-
var route = requireRoute
|
51716
|
+
return route$2;
|
51717
|
+
}
|
51718
|
+
var colorConvert$1;
|
51719
|
+
var hasRequiredColorConvert;
|
51720
|
+
function requireColorConvert() {
|
51721
|
+
if (hasRequiredColorConvert) return colorConvert$1;
|
51722
|
+
hasRequiredColorConvert = 1;
|
51723
|
+
var conversions = requireConversions();
|
51724
|
+
var route = requireRoute();
|
51725
51725
|
var convert = {};
|
51726
51726
|
var models = Object.keys(conversions);
|
51727
51727
|
function wrapRaw(fn) {
|
@@ -51776,16 +51776,16 @@ function requireColorConvert$1() {
|
|
51776
51776
|
convert[fromModel][toModel].raw = wrapRaw(fn);
|
51777
51777
|
});
|
51778
51778
|
});
|
51779
|
-
colorConvert$
|
51780
|
-
return colorConvert$
|
51779
|
+
colorConvert$1 = convert;
|
51780
|
+
return colorConvert$1;
|
51781
51781
|
}
|
51782
|
-
ansiStyles$
|
51782
|
+
ansiStyles$1.exports;
|
51783
51783
|
var hasRequiredAnsiStyles;
|
51784
51784
|
function requireAnsiStyles() {
|
51785
|
-
if (hasRequiredAnsiStyles) return ansiStyles$
|
51785
|
+
if (hasRequiredAnsiStyles) return ansiStyles$1.exports;
|
51786
51786
|
hasRequiredAnsiStyles = 1;
|
51787
51787
|
(function (module) {
|
51788
|
-
const colorConvert = requireColorConvert
|
51788
|
+
const colorConvert = requireColorConvert();
|
51789
51789
|
const wrapAnsi16 = (fn, offset) =>
|
51790
51790
|
function () {
|
51791
51791
|
const code = fn.apply(colorConvert, arguments);
|
@@ -51906,27 +51906,27 @@ function requireAnsiStyles() {
|
|
51906
51906
|
enumerable: true,
|
51907
51907
|
get: assembleStyles,
|
51908
51908
|
});
|
51909
|
-
})(ansiStyles$
|
51910
|
-
return ansiStyles$
|
51909
|
+
})(ansiStyles$1);
|
51910
|
+
return ansiStyles$1.exports;
|
51911
51911
|
}
|
51912
|
-
var hasFlag$
|
51912
|
+
var hasFlag$1;
|
51913
51913
|
var hasRequiredHasFlag$1;
|
51914
51914
|
function requireHasFlag$1() {
|
51915
|
-
if (hasRequiredHasFlag$1) return hasFlag$
|
51915
|
+
if (hasRequiredHasFlag$1) return hasFlag$1;
|
51916
51916
|
hasRequiredHasFlag$1 = 1;
|
51917
|
-
hasFlag$
|
51917
|
+
hasFlag$1 = (flag, argv) => {
|
51918
51918
|
argv = argv || process.argv;
|
51919
51919
|
const prefix = flag.startsWith('-') ? '' : flag.length === 1 ? '-' : '--';
|
51920
51920
|
const pos = argv.indexOf(prefix + flag);
|
51921
51921
|
const terminatorPos = argv.indexOf('--');
|
51922
51922
|
return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos);
|
51923
51923
|
};
|
51924
|
-
return hasFlag$
|
51924
|
+
return hasFlag$1;
|
51925
51925
|
}
|
51926
|
-
var supportsColor_1$
|
51926
|
+
var supportsColor_1$1;
|
51927
51927
|
var hasRequiredSupportsColor$1;
|
51928
51928
|
function requireSupportsColor$1() {
|
51929
|
-
if (hasRequiredSupportsColor$1) return supportsColor_1$
|
51929
|
+
if (hasRequiredSupportsColor$1) return supportsColor_1$1;
|
51930
51930
|
hasRequiredSupportsColor$1 = 1;
|
51931
51931
|
const os = require$$0$3;
|
51932
51932
|
const hasFlag = requireHasFlag$1();
|
@@ -52037,18 +52037,18 @@ function requireSupportsColor$1() {
|
|
52037
52037
|
const level = supportsColor(stream);
|
52038
52038
|
return translateLevel(level);
|
52039
52039
|
}
|
52040
|
-
supportsColor_1$
|
52040
|
+
supportsColor_1$1 = {
|
52041
52041
|
supportsColor: getSupportLevel,
|
52042
52042
|
stdout: getSupportLevel(process.stdout),
|
52043
52043
|
stderr: getSupportLevel(process.stderr),
|
52044
52044
|
};
|
52045
|
-
return supportsColor_1$
|
52045
|
+
return supportsColor_1$1;
|
52046
52046
|
}
|
52047
|
-
var templates$
|
52048
|
-
var hasRequiredTemplates$
|
52049
|
-
function requireTemplates$
|
52050
|
-
if (hasRequiredTemplates$
|
52051
|
-
hasRequiredTemplates$
|
52047
|
+
var templates$1;
|
52048
|
+
var hasRequiredTemplates$1;
|
52049
|
+
function requireTemplates$1() {
|
52050
|
+
if (hasRequiredTemplates$1) return templates$1;
|
52051
|
+
hasRequiredTemplates$1 = 1;
|
52052
52052
|
const TEMPLATE_REGEX =
|
52053
52053
|
/(?:\\(u[a-f\d]{4}|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi;
|
52054
52054
|
const STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
|
@@ -52130,7 +52130,7 @@ function requireTemplates$2() {
|
|
52130
52130
|
}
|
52131
52131
|
return current;
|
52132
52132
|
}
|
52133
|
-
templates$
|
52133
|
+
templates$1 = (chalk, tmp) => {
|
52134
52134
|
const styles = [];
|
52135
52135
|
const chunks = [];
|
52136
52136
|
let chunk = [];
|
@@ -52160,17 +52160,17 @@ function requireTemplates$2() {
|
|
52160
52160
|
}
|
52161
52161
|
return chunks.join('');
|
52162
52162
|
};
|
52163
|
-
return templates$
|
52163
|
+
return templates$1;
|
52164
52164
|
}
|
52165
52165
|
var hasRequiredChalk$1;
|
52166
52166
|
function requireChalk$1() {
|
52167
|
-
if (hasRequiredChalk$1) return chalk$
|
52167
|
+
if (hasRequiredChalk$1) return chalk$1.exports;
|
52168
52168
|
hasRequiredChalk$1 = 1;
|
52169
52169
|
(function (module) {
|
52170
52170
|
const escapeStringRegexp = requireEscapeStringRegexp$1();
|
52171
52171
|
const ansiStyles = requireAnsiStyles();
|
52172
52172
|
const stdoutColor = requireSupportsColor$1().stdout;
|
52173
|
-
const template = requireTemplates$
|
52173
|
+
const template = requireTemplates$1();
|
52174
52174
|
const isSimpleWindowsTerm =
|
52175
52175
|
process.platform === 'win32' &&
|
52176
52176
|
!(process.env.TERM || '').toLowerCase().startsWith('xterm');
|
@@ -52358,8 +52358,8 @@ function requireChalk$1() {
|
|
52358
52358
|
module.exports = Chalk();
|
52359
52359
|
module.exports.supportsColor = stdoutColor;
|
52360
52360
|
module.exports.default = module.exports;
|
52361
|
-
})(chalk$
|
52362
|
-
return chalk$
|
52361
|
+
})(chalk$1);
|
52362
|
+
return chalk$1.exports;
|
52363
52363
|
}
|
52364
52364
|
var hasRequiredLib$f;
|
52365
52365
|
function requireLib$f() {
|
@@ -65086,7 +65086,7 @@ function requireLib$9() {
|
|
65086
65086
|
})(lib$7);
|
65087
65087
|
return lib$7;
|
65088
65088
|
}
|
65089
|
-
var chalk
|
65089
|
+
var chalk = {exports: {}};
|
65090
65090
|
var escapeStringRegexp;
|
65091
65091
|
var hasRequiredEscapeStringRegexp;
|
65092
65092
|
function requireEscapeStringRegexp() {
|
@@ -65101,9 +65101,9 @@ function requireEscapeStringRegexp() {
|
|
65101
65101
|
};
|
65102
65102
|
return escapeStringRegexp;
|
65103
65103
|
}
|
65104
|
-
var ansiStyles
|
65105
|
-
var conversions$
|
65106
|
-
var colorName
|
65104
|
+
var ansiStyles = {exports: {}};
|
65105
|
+
var conversions$2 = {exports: {}};
|
65106
|
+
var colorName = {
|
65107
65107
|
aliceblue: [240, 248, 255],
|
65108
65108
|
antiquewhite: [250, 235, 215],
|
65109
65109
|
aqua: [0, 255, 255],
|
@@ -65253,14 +65253,14 @@ var colorName$1 = {
|
|
65253
65253
|
yellow: [255, 255, 0],
|
65254
65254
|
yellowgreen: [154, 205, 50],
|
65255
65255
|
};
|
65256
|
-
var cssKeywords = colorName
|
65256
|
+
var cssKeywords = colorName;
|
65257
65257
|
var reverseKeywords = {};
|
65258
65258
|
for (var key$1 in cssKeywords) {
|
65259
65259
|
if (cssKeywords.hasOwnProperty(key$1)) {
|
65260
65260
|
reverseKeywords[cssKeywords[key$1]] = key$1;
|
65261
65261
|
}
|
65262
65262
|
}
|
65263
|
-
var convert$1 = (conversions$
|
65263
|
+
var convert$1 = (conversions$2.exports = {
|
65264
65264
|
rgb: {channels: 3, labels: 'rgb'},
|
65265
65265
|
hsl: {channels: 3, labels: 'hsl'},
|
65266
65266
|
hsv: {channels: 3, labels: 'hsv'},
|
@@ -65978,11 +65978,11 @@ convert$1.rgb.gray = function (rgb) {
|
|
65978
65978
|
var val = (rgb[0] + rgb[1] + rgb[2]) / 3;
|
65979
65979
|
return [(val / 255) * 100];
|
65980
65980
|
};
|
65981
|
-
var conversionsExports = conversions$
|
65982
|
-
var conversions$
|
65981
|
+
var conversionsExports = conversions$2.exports;
|
65982
|
+
var conversions$1 = conversionsExports;
|
65983
65983
|
function buildGraph() {
|
65984
65984
|
var graph = {};
|
65985
|
-
var models = Object.keys(conversions$
|
65985
|
+
var models = Object.keys(conversions$1);
|
65986
65986
|
for (var len = models.length, i = 0; i < len; i++) {
|
65987
65987
|
graph[models[i]] = {distance: -1, parent: null};
|
65988
65988
|
}
|
@@ -65994,7 +65994,7 @@ function deriveBFS(fromModel) {
|
|
65994
65994
|
graph[fromModel].distance = 0;
|
65995
65995
|
while (queue.length) {
|
65996
65996
|
var current = queue.pop();
|
65997
|
-
var adjacents = Object.keys(conversions$
|
65997
|
+
var adjacents = Object.keys(conversions$1[current]);
|
65998
65998
|
for (var len = adjacents.length, i = 0; i < len; i++) {
|
65999
65999
|
var adjacent = adjacents[i];
|
66000
66000
|
var node = graph[adjacent];
|
@@ -66014,17 +66014,17 @@ function link(from, to) {
|
|
66014
66014
|
}
|
66015
66015
|
function wrapConversion(toModel, graph) {
|
66016
66016
|
var path = [graph[toModel].parent, toModel];
|
66017
|
-
var fn = conversions$
|
66017
|
+
var fn = conversions$1[graph[toModel].parent][toModel];
|
66018
66018
|
var cur = graph[toModel].parent;
|
66019
66019
|
while (graph[cur].parent) {
|
66020
66020
|
path.unshift(graph[cur].parent);
|
66021
|
-
fn = link(conversions$
|
66021
|
+
fn = link(conversions$1[graph[cur].parent][cur], fn);
|
66022
66022
|
cur = graph[cur].parent;
|
66023
66023
|
}
|
66024
66024
|
fn.conversion = path;
|
66025
66025
|
return fn;
|
66026
66026
|
}
|
66027
|
-
var route$
|
66027
|
+
var route$1 = function (fromModel) {
|
66028
66028
|
var graph = deriveBFS(fromModel);
|
66029
66029
|
var conversion = {};
|
66030
66030
|
var models = Object.keys(graph);
|
@@ -66038,10 +66038,10 @@ var route$2 = function (fromModel) {
|
|
66038
66038
|
}
|
66039
66039
|
return conversion;
|
66040
66040
|
};
|
66041
|
-
var conversions
|
66042
|
-
var route
|
66041
|
+
var conversions = conversionsExports;
|
66042
|
+
var route = route$1;
|
66043
66043
|
var convert = {};
|
66044
|
-
var models = Object.keys(conversions
|
66044
|
+
var models = Object.keys(conversions);
|
66045
66045
|
function wrapRaw(fn) {
|
66046
66046
|
var wrappedFn = function (args) {
|
66047
66047
|
if (args === undefined || args === null) {
|
@@ -66081,12 +66081,12 @@ function wrapRounded(fn) {
|
|
66081
66081
|
models.forEach(function (fromModel) {
|
66082
66082
|
convert[fromModel] = {};
|
66083
66083
|
Object.defineProperty(convert[fromModel], 'channels', {
|
66084
|
-
value: conversions
|
66084
|
+
value: conversions[fromModel].channels,
|
66085
66085
|
});
|
66086
66086
|
Object.defineProperty(convert[fromModel], 'labels', {
|
66087
|
-
value: conversions
|
66087
|
+
value: conversions[fromModel].labels,
|
66088
66088
|
});
|
66089
|
-
var routes = route
|
66089
|
+
var routes = route(fromModel);
|
66090
66090
|
var routeModels = Object.keys(routes);
|
66091
66091
|
routeModels.forEach(function (toModel) {
|
66092
66092
|
var fn = routes[toModel];
|
@@ -66094,23 +66094,23 @@ models.forEach(function (fromModel) {
|
|
66094
66094
|
convert[fromModel][toModel].raw = wrapRaw(fn);
|
66095
66095
|
});
|
66096
66096
|
});
|
66097
|
-
var colorConvert
|
66098
|
-
ansiStyles
|
66097
|
+
var colorConvert = convert;
|
66098
|
+
ansiStyles.exports;
|
66099
66099
|
(function (module) {
|
66100
|
-
const colorConvert = colorConvert
|
66100
|
+
const colorConvert$1 = colorConvert;
|
66101
66101
|
const wrapAnsi16 = (fn, offset) =>
|
66102
66102
|
function () {
|
66103
|
-
const code = fn.apply(colorConvert, arguments);
|
66103
|
+
const code = fn.apply(colorConvert$1, arguments);
|
66104
66104
|
return `[${code + offset}m`;
|
66105
66105
|
};
|
66106
66106
|
const wrapAnsi256 = (fn, offset) =>
|
66107
66107
|
function () {
|
66108
|
-
const code = fn.apply(colorConvert, arguments);
|
66108
|
+
const code = fn.apply(colorConvert$1, arguments);
|
66109
66109
|
return `[${38 + offset};5;${code}m`;
|
66110
66110
|
};
|
66111
66111
|
const wrapAnsi16m = (fn, offset) =>
|
66112
66112
|
function () {
|
66113
|
-
const rgb = fn.apply(colorConvert, arguments);
|
66113
|
+
const rgb = fn.apply(colorConvert$1, arguments);
|
66114
66114
|
return `[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`;
|
66115
66115
|
};
|
66116
66116
|
function assembleStyles() {
|
@@ -66188,11 +66188,11 @@ ansiStyles$2.exports;
|
|
66188
66188
|
styles.bgColor.ansi = {ansi: wrapAnsi16(ansi2ansi, 10)};
|
66189
66189
|
styles.bgColor.ansi256 = {ansi256: wrapAnsi256(ansi2ansi, 10)};
|
66190
66190
|
styles.bgColor.ansi16m = {rgb: wrapAnsi16m(rgb2rgb, 10)};
|
66191
|
-
for (let key of Object.keys(colorConvert)) {
|
66192
|
-
if (typeof colorConvert[key] !== 'object') {
|
66191
|
+
for (let key of Object.keys(colorConvert$1)) {
|
66192
|
+
if (typeof colorConvert$1[key] !== 'object') {
|
66193
66193
|
continue;
|
66194
66194
|
}
|
66195
|
-
const suite = colorConvert[key];
|
66195
|
+
const suite = colorConvert$1[key];
|
66196
66196
|
if (key === 'ansi16') {
|
66197
66197
|
key = 'ansi';
|
66198
66198
|
}
|
@@ -66215,26 +66215,26 @@ ansiStyles$2.exports;
|
|
66215
66215
|
enumerable: true,
|
66216
66216
|
get: assembleStyles,
|
66217
66217
|
});
|
66218
|
-
})(ansiStyles
|
66219
|
-
var ansiStylesExports
|
66220
|
-
var hasFlag
|
66218
|
+
})(ansiStyles);
|
66219
|
+
var ansiStylesExports = ansiStyles.exports;
|
66220
|
+
var hasFlag;
|
66221
66221
|
var hasRequiredHasFlag;
|
66222
66222
|
function requireHasFlag() {
|
66223
|
-
if (hasRequiredHasFlag) return hasFlag
|
66223
|
+
if (hasRequiredHasFlag) return hasFlag;
|
66224
66224
|
hasRequiredHasFlag = 1;
|
66225
|
-
hasFlag
|
66225
|
+
hasFlag = (flag, argv) => {
|
66226
66226
|
argv = argv || process.argv;
|
66227
66227
|
const prefix = flag.startsWith('-') ? '' : flag.length === 1 ? '-' : '--';
|
66228
66228
|
const pos = argv.indexOf(prefix + flag);
|
66229
66229
|
const terminatorPos = argv.indexOf('--');
|
66230
66230
|
return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos);
|
66231
66231
|
};
|
66232
|
-
return hasFlag
|
66232
|
+
return hasFlag;
|
66233
66233
|
}
|
66234
|
-
var supportsColor_1
|
66234
|
+
var supportsColor_1;
|
66235
66235
|
var hasRequiredSupportsColor;
|
66236
66236
|
function requireSupportsColor() {
|
66237
|
-
if (hasRequiredSupportsColor) return supportsColor_1
|
66237
|
+
if (hasRequiredSupportsColor) return supportsColor_1;
|
66238
66238
|
hasRequiredSupportsColor = 1;
|
66239
66239
|
const os = require$$0$3;
|
66240
66240
|
const hasFlag = requireHasFlag();
|
@@ -66345,18 +66345,18 @@ function requireSupportsColor() {
|
|
66345
66345
|
const level = supportsColor(stream);
|
66346
66346
|
return translateLevel(level);
|
66347
66347
|
}
|
66348
|
-
supportsColor_1
|
66348
|
+
supportsColor_1 = {
|
66349
66349
|
supportsColor: getSupportLevel,
|
66350
66350
|
stdout: getSupportLevel(process.stdout),
|
66351
66351
|
stderr: getSupportLevel(process.stderr),
|
66352
66352
|
};
|
66353
|
-
return supportsColor_1
|
66353
|
+
return supportsColor_1;
|
66354
66354
|
}
|
66355
|
-
var templates
|
66356
|
-
var hasRequiredTemplates
|
66357
|
-
function requireTemplates
|
66358
|
-
if (hasRequiredTemplates
|
66359
|
-
hasRequiredTemplates
|
66355
|
+
var templates;
|
66356
|
+
var hasRequiredTemplates;
|
66357
|
+
function requireTemplates() {
|
66358
|
+
if (hasRequiredTemplates) return templates;
|
66359
|
+
hasRequiredTemplates = 1;
|
66360
66360
|
const TEMPLATE_REGEX =
|
66361
66361
|
/(?:\\(u[a-f\d]{4}|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi;
|
66362
66362
|
const STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
|
@@ -66438,7 +66438,7 @@ function requireTemplates$1() {
|
|
66438
66438
|
}
|
66439
66439
|
return current;
|
66440
66440
|
}
|
66441
|
-
templates
|
66441
|
+
templates = (chalk, tmp) => {
|
66442
66442
|
const styles = [];
|
66443
66443
|
const chunks = [];
|
66444
66444
|
let chunk = [];
|
@@ -66468,17 +66468,17 @@ function requireTemplates$1() {
|
|
66468
66468
|
}
|
66469
66469
|
return chunks.join('');
|
66470
66470
|
};
|
66471
|
-
return templates
|
66471
|
+
return templates;
|
66472
66472
|
}
|
66473
66473
|
var hasRequiredChalk;
|
66474
66474
|
function requireChalk() {
|
66475
|
-
if (hasRequiredChalk) return chalk
|
66475
|
+
if (hasRequiredChalk) return chalk.exports;
|
66476
66476
|
hasRequiredChalk = 1;
|
66477
66477
|
(function (module) {
|
66478
66478
|
const escapeStringRegexp = requireEscapeStringRegexp();
|
66479
|
-
const ansiStyles = ansiStylesExports
|
66479
|
+
const ansiStyles = ansiStylesExports;
|
66480
66480
|
const stdoutColor = requireSupportsColor().stdout;
|
66481
|
-
const template = requireTemplates
|
66481
|
+
const template = requireTemplates();
|
66482
66482
|
const isSimpleWindowsTerm =
|
66483
66483
|
process.platform === 'win32' &&
|
66484
66484
|
!(process.env.TERM || '').toLowerCase().startsWith('xterm');
|
@@ -66666,8 +66666,8 @@ function requireChalk() {
|
|
66666
66666
|
module.exports = Chalk();
|
66667
66667
|
module.exports.supportsColor = stdoutColor;
|
66668
66668
|
module.exports.default = module.exports;
|
66669
|
-
})(chalk
|
66670
|
-
return chalk
|
66669
|
+
})(chalk);
|
66670
|
+
return chalk.exports;
|
66671
66671
|
}
|
66672
66672
|
var hasRequiredLib$8;
|
66673
66673
|
function requireLib$8() {
|
@@ -107002,10 +107002,10 @@ function requireBase64Vlq() {
|
|
107002
107002
|
};
|
107003
107003
|
return base64Vlq;
|
107004
107004
|
}
|
107005
|
-
var util$
|
107005
|
+
var util$5 = {};
|
107006
107006
|
var hasRequiredUtil;
|
107007
107007
|
function requireUtil() {
|
107008
|
-
if (hasRequiredUtil) return util$
|
107008
|
+
if (hasRequiredUtil) return util$5;
|
107009
107009
|
hasRequiredUtil = 1;
|
107010
107010
|
(function (exports) {
|
107011
107011
|
function getArg(aArgs, aName, aDefaultValue) {
|
@@ -107293,8 +107293,8 @@ function requireUtil() {
|
|
107293
107293
|
}
|
107294
107294
|
exports.compareByGeneratedPositionsInflated =
|
107295
107295
|
compareByGeneratedPositionsInflated;
|
107296
|
-
})(util$
|
107297
|
-
return util$
|
107296
|
+
})(util$5);
|
107297
|
+
return util$5;
|
107298
107298
|
}
|
107299
107299
|
var arraySet = {};
|
107300
107300
|
var hasRequiredArraySet;
|
@@ -113645,7 +113645,7 @@ var unicode = {
|
|
113645
113645
|
ID_Start: ID_Start,
|
113646
113646
|
ID_Continue: ID_Continue,
|
113647
113647
|
};
|
113648
|
-
var util$
|
113648
|
+
var util$4 = {
|
113649
113649
|
isSpaceSeparator(c) {
|
113650
113650
|
return typeof c === 'string' && unicode.Space_Separator.test(c);
|
113651
113651
|
},
|
@@ -113804,7 +113804,7 @@ const lexStates = {
|
|
113804
113804
|
read$1();
|
113805
113805
|
return newToken('eof');
|
113806
113806
|
}
|
113807
|
-
if (util$
|
113807
|
+
if (util$4.isSpaceSeparator(c)) {
|
113808
113808
|
read$1();
|
113809
113809
|
return;
|
113810
113810
|
}
|
@@ -113936,7 +113936,7 @@ const lexStates = {
|
|
113936
113936
|
case '_':
|
113937
113937
|
break;
|
113938
113938
|
default:
|
113939
|
-
if (!util$
|
113939
|
+
if (!util$4.isIdStartChar(u)) {
|
113940
113940
|
throw invalidIdentifier();
|
113941
113941
|
}
|
113942
113942
|
break;
|
@@ -113957,7 +113957,7 @@ const lexStates = {
|
|
113957
113957
|
lexState = 'identifierNameEscape';
|
113958
113958
|
return;
|
113959
113959
|
}
|
113960
|
-
if (util$
|
113960
|
+
if (util$4.isIdContinueChar(c)) {
|
113961
113961
|
buffer$2 += read$1();
|
113962
113962
|
return;
|
113963
113963
|
}
|
@@ -113976,7 +113976,7 @@ const lexStates = {
|
|
113976
113976
|
case '':
|
113977
113977
|
break;
|
113978
113978
|
default:
|
113979
|
-
if (!util$
|
113979
|
+
if (!util$4.isIdContinueChar(u)) {
|
113980
113980
|
throw invalidIdentifier();
|
113981
113981
|
}
|
113982
113982
|
break;
|
@@ -114048,14 +114048,14 @@ const lexStates = {
|
|
114048
114048
|
lexState = 'decimalExponent';
|
114049
114049
|
return;
|
114050
114050
|
}
|
114051
|
-
if (util$
|
114051
|
+
if (util$4.isDigit(c)) {
|
114052
114052
|
buffer$2 += read$1();
|
114053
114053
|
return;
|
114054
114054
|
}
|
114055
114055
|
return newToken('numeric', sign * Number(buffer$2));
|
114056
114056
|
},
|
114057
114057
|
decimalPointLeading() {
|
114058
|
-
if (util$
|
114058
|
+
if (util$4.isDigit(c)) {
|
114059
114059
|
buffer$2 += read$1();
|
114060
114060
|
lexState = 'decimalFraction';
|
114061
114061
|
return;
|
@@ -114070,7 +114070,7 @@ const lexStates = {
|
|
114070
114070
|
lexState = 'decimalExponent';
|
114071
114071
|
return;
|
114072
114072
|
}
|
114073
|
-
if (util$
|
114073
|
+
if (util$4.isDigit(c)) {
|
114074
114074
|
buffer$2 += read$1();
|
114075
114075
|
lexState = 'decimalFraction';
|
114076
114076
|
return;
|
@@ -114085,7 +114085,7 @@ const lexStates = {
|
|
114085
114085
|
lexState = 'decimalExponent';
|
114086
114086
|
return;
|
114087
114087
|
}
|
114088
|
-
if (util$
|
114088
|
+
if (util$4.isDigit(c)) {
|
114089
114089
|
buffer$2 += read$1();
|
114090
114090
|
return;
|
114091
114091
|
}
|
@@ -114099,7 +114099,7 @@ const lexStates = {
|
|
114099
114099
|
lexState = 'decimalExponentSign';
|
114100
114100
|
return;
|
114101
114101
|
}
|
114102
|
-
if (util$
|
114102
|
+
if (util$4.isDigit(c)) {
|
114103
114103
|
buffer$2 += read$1();
|
114104
114104
|
lexState = 'decimalExponentInteger';
|
114105
114105
|
return;
|
@@ -114107,7 +114107,7 @@ const lexStates = {
|
|
114107
114107
|
throw invalidChar(read$1());
|
114108
114108
|
},
|
114109
114109
|
decimalExponentSign() {
|
114110
|
-
if (util$
|
114110
|
+
if (util$4.isDigit(c)) {
|
114111
114111
|
buffer$2 += read$1();
|
114112
114112
|
lexState = 'decimalExponentInteger';
|
114113
114113
|
return;
|
@@ -114115,14 +114115,14 @@ const lexStates = {
|
|
114115
114115
|
throw invalidChar(read$1());
|
114116
114116
|
},
|
114117
114117
|
decimalExponentInteger() {
|
114118
|
-
if (util$
|
114118
|
+
if (util$4.isDigit(c)) {
|
114119
114119
|
buffer$2 += read$1();
|
114120
114120
|
return;
|
114121
114121
|
}
|
114122
114122
|
return newToken('numeric', sign * Number(buffer$2));
|
114123
114123
|
},
|
114124
114124
|
hexadecimal() {
|
114125
|
-
if (util$
|
114125
|
+
if (util$4.isHexDigit(c)) {
|
114126
114126
|
buffer$2 += read$1();
|
114127
114127
|
lexState = 'hexadecimalInteger';
|
114128
114128
|
return;
|
@@ -114130,7 +114130,7 @@ const lexStates = {
|
|
114130
114130
|
throw invalidChar(read$1());
|
114131
114131
|
},
|
114132
114132
|
hexadecimalInteger() {
|
114133
|
-
if (util$
|
114133
|
+
if (util$4.isHexDigit(c)) {
|
114134
114134
|
buffer$2 += read$1();
|
114135
114135
|
return;
|
114136
114136
|
}
|
@@ -114195,7 +114195,7 @@ const lexStates = {
|
|
114195
114195
|
lexState = 'string';
|
114196
114196
|
return;
|
114197
114197
|
}
|
114198
|
-
if (util$
|
114198
|
+
if (util$4.isIdStartChar(c)) {
|
114199
114199
|
buffer$2 += read$1();
|
114200
114200
|
lexState = 'identifierName';
|
114201
114201
|
return;
|
@@ -114272,7 +114272,7 @@ function escape() {
|
|
114272
114272
|
return '\v';
|
114273
114273
|
case '0':
|
114274
114274
|
read$1();
|
114275
|
-
if (util$
|
114275
|
+
if (util$4.isDigit(peek())) {
|
114276
114276
|
throw invalidChar(read$1());
|
114277
114277
|
}
|
114278
114278
|
return '\0';
|
@@ -114311,12 +114311,12 @@ function escape() {
|
|
114311
114311
|
function hexEscape() {
|
114312
114312
|
let buffer = '';
|
114313
114313
|
let c = peek();
|
114314
|
-
if (!util$
|
114314
|
+
if (!util$4.isHexDigit(c)) {
|
114315
114315
|
throw invalidChar(read$1());
|
114316
114316
|
}
|
114317
114317
|
buffer += read$1();
|
114318
114318
|
c = peek();
|
114319
|
-
if (!util$
|
114319
|
+
if (!util$4.isHexDigit(c)) {
|
114320
114320
|
throw invalidChar(read$1());
|
114321
114321
|
}
|
114322
114322
|
buffer += read$1();
|
@@ -114327,7 +114327,7 @@ function unicodeEscape() {
|
|
114327
114327
|
let count = 4;
|
114328
114328
|
while (count-- > 0) {
|
114329
114329
|
const c = peek();
|
114330
|
-
if (!util$
|
114330
|
+
if (!util$4.isHexDigit(c)) {
|
114331
114331
|
throw invalidChar(read$1());
|
114332
114332
|
}
|
114333
114333
|
buffer += read$1();
|
@@ -114635,7 +114635,7 @@ var stringify = function stringify(value, replacer, space) {
|
|
114635
114635
|
product += c;
|
114636
114636
|
continue;
|
114637
114637
|
case '\0':
|
114638
|
-
if (util$
|
114638
|
+
if (util$4.isDigit(value[i + 1])) {
|
114639
114639
|
product += '\\x00';
|
114640
114640
|
continue;
|
114641
114641
|
}
|
@@ -114703,11 +114703,11 @@ var stringify = function stringify(value, replacer, space) {
|
|
114703
114703
|
return quoteString(key);
|
114704
114704
|
}
|
114705
114705
|
const firstChar = String.fromCodePoint(key.codePointAt(0));
|
114706
|
-
if (!util$
|
114706
|
+
if (!util$4.isIdStartChar(firstChar)) {
|
114707
114707
|
return quoteString(key);
|
114708
114708
|
}
|
114709
114709
|
for (let i = firstChar.length; i < key.length; i++) {
|
114710
|
-
if (!util$
|
114710
|
+
if (!util$4.isIdContinueChar(String.fromCodePoint(key.codePointAt(i)))) {
|
114711
114711
|
return quoteString(key);
|
114712
114712
|
}
|
114713
114713
|
}
|
@@ -115014,7 +115014,7 @@ var inspector$1 = '>= 8';
|
|
115014
115014
|
var _linklist$1 = '< 8';
|
115015
115015
|
var module$2 = true;
|
115016
115016
|
var net$1 = true;
|
115017
|
-
var os$
|
115017
|
+
var os$1 = true;
|
115018
115018
|
var path$1 = true;
|
115019
115019
|
var perf_hooks$1 = '>= 8.5';
|
115020
115020
|
var process$3 = '>= 1';
|
@@ -115038,9 +115038,9 @@ var _tls_legacy$1 = '>= 0.11.3 && < 10';
|
|
115038
115038
|
var _tls_wrap$1 = '>= 0.11.3';
|
115039
115039
|
var tls$1 = true;
|
115040
115040
|
var trace_events$1 = '>= 10';
|
115041
|
-
var tty$
|
115041
|
+
var tty$1 = true;
|
115042
115042
|
var url$1 = true;
|
115043
|
-
var util$
|
115043
|
+
var util$3 = true;
|
115044
115044
|
var v8$1 = '>= 1';
|
115045
115045
|
var vm$1 = true;
|
115046
115046
|
var wasi$1 = '>= 13.4 && < 13.5';
|
@@ -115113,7 +115113,7 @@ var require$$1 = {
|
|
115113
115113
|
'node-inspect/lib/_inspect': '>= 7.6 && < 12',
|
115114
115114
|
'node-inspect/lib/internal/inspect_client': '>= 7.6 && < 12',
|
115115
115115
|
'node-inspect/lib/internal/inspect_repl': '>= 7.6 && < 12',
|
115116
|
-
os: os$
|
115116
|
+
os: os$1,
|
115117
115117
|
'node:os': ['>= 14.18 && < 15', '>= 16'],
|
115118
115118
|
path: path$1,
|
115119
115119
|
'node:path': ['>= 14.18 && < 15', '>= 16'],
|
@@ -115174,11 +115174,11 @@ var require$$1 = {
|
|
115174
115174
|
'node:tls': ['>= 14.18 && < 15', '>= 16'],
|
115175
115175
|
trace_events: trace_events$1,
|
115176
115176
|
'node:trace_events': ['>= 14.18 && < 15', '>= 16'],
|
115177
|
-
tty: tty$
|
115177
|
+
tty: tty$1,
|
115178
115178
|
'node:tty': ['>= 14.18 && < 15', '>= 16'],
|
115179
115179
|
url: url$1,
|
115180
115180
|
'node:url': ['>= 14.18 && < 15', '>= 16'],
|
115181
|
-
util: util$
|
115181
|
+
util: util$3,
|
115182
115182
|
'node:util': ['>= 14.18 && < 15', '>= 16'],
|
115183
115183
|
'util/types': '>= 15.3',
|
115184
115184
|
'node:util/types': '>= 16',
|
@@ -115613,7 +115613,7 @@ var inspector = '>= 8';
|
|
115613
115613
|
var _linklist = '< 8';
|
115614
115614
|
var module$1 = true;
|
115615
115615
|
var net = true;
|
115616
|
-
var os
|
115616
|
+
var os = true;
|
115617
115617
|
var path = true;
|
115618
115618
|
var perf_hooks = '>= 8.5';
|
115619
115619
|
var process$2 = '>= 1';
|
@@ -115637,9 +115637,9 @@ var _tls_legacy = '>= 0.11.3 && < 10';
|
|
115637
115637
|
var _tls_wrap = '>= 0.11.3';
|
115638
115638
|
var tls = true;
|
115639
115639
|
var trace_events = '>= 10';
|
115640
|
-
var tty
|
115640
|
+
var tty = true;
|
115641
115641
|
var url = true;
|
115642
|
-
var util$
|
115642
|
+
var util$2 = true;
|
115643
115643
|
var v8 = '>= 1';
|
115644
115644
|
var vm = true;
|
115645
115645
|
var wasi = '>= 13.4 && < 13.5';
|
@@ -115712,7 +115712,7 @@ var require$$0 = {
|
|
115712
115712
|
'node-inspect/lib/_inspect': '>= 7.6 && < 12',
|
115713
115713
|
'node-inspect/lib/internal/inspect_client': '>= 7.6 && < 12',
|
115714
115714
|
'node-inspect/lib/internal/inspect_repl': '>= 7.6 && < 12',
|
115715
|
-
os: os
|
115715
|
+
os: os,
|
115716
115716
|
'node:os': ['>= 14.18 && < 15', '>= 16'],
|
115717
115717
|
path: path,
|
115718
115718
|
'node:path': ['>= 14.18 && < 15', '>= 16'],
|
@@ -115773,11 +115773,11 @@ var require$$0 = {
|
|
115773
115773
|
'node:tls': ['>= 14.18 && < 15', '>= 16'],
|
115774
115774
|
trace_events: trace_events,
|
115775
115775
|
'node:trace_events': ['>= 14.18 && < 15', '>= 16'],
|
115776
|
-
tty: tty
|
115776
|
+
tty: tty,
|
115777
115777
|
'node:tty': ['>= 14.18 && < 15', '>= 16'],
|
115778
115778
|
url: url,
|
115779
115779
|
'node:url': ['>= 14.18 && < 15', '>= 16'],
|
115780
|
-
util: util$
|
115780
|
+
util: util$2,
|
115781
115781
|
'node:util': ['>= 14.18 && < 15', '>= 16'],
|
115782
115782
|
'util/types': '>= 15.3',
|
115783
115783
|
'node:util/types': '>= 16',
|
@@ -117063,9 +117063,9 @@ function requireItem() {
|
|
117063
117063
|
}
|
117064
117064
|
var config = {};
|
117065
117065
|
var full = {};
|
117066
|
-
var util$
|
117067
|
-
Object.defineProperty(util$
|
117068
|
-
util$
|
117066
|
+
var util$1 = {};
|
117067
|
+
Object.defineProperty(util$1, '__esModule', {value: true});
|
117068
|
+
util$1.mergeOptions = mergeOptions;
|
117069
117069
|
function mergeOptions(target, source) {
|
117070
117070
|
for (const k of Object.keys(source)) {
|
117071
117071
|
if (k === 'parserOpts' && source.parserOpts) {
|
@@ -118223,7 +118223,7 @@ function requirePartial() {
|
|
118223
118223
|
return data;
|
118224
118224
|
}
|
118225
118225
|
var _plugin = _interopRequireDefault(plugin$7);
|
118226
|
-
var _util = util$
|
118226
|
+
var _util = util$1;
|
118227
118227
|
var _item = requireItem();
|
118228
118228
|
var _configChain = requireConfigChain();
|
118229
118229
|
var _environment = environment;
|
@@ -118360,7 +118360,7 @@ function requireFull() {
|
|
118360
118360
|
hasRequiredFull = 1;
|
118361
118361
|
Object.defineProperty(full, '__esModule', {value: true});
|
118362
118362
|
full.default = loadFullConfig;
|
118363
|
-
var _util = util$
|
118363
|
+
var _util = util$1;
|
118364
118364
|
var context = _interopRequireWildcard(requireLib());
|
118365
118365
|
var _plugin = _interopRequireDefault(plugin$7);
|
118366
118366
|
var _item = requireItem();
|
@@ -121963,7 +121963,7 @@ function phiTypeEquals(tA, tB) {
|
|
121963
121963
|
}
|
121964
121964
|
return false;
|
121965
121965
|
}
|
121966
|
-
var util
|
121966
|
+
var util;
|
121967
121967
|
(function (util) {
|
121968
121968
|
util.assertEqual = val => val;
|
121969
121969
|
function assertIs(_arg) {}
|
@@ -122028,12 +122028,12 @@ var util$1;
|
|
122028
122028
|
}
|
122029
122029
|
return value;
|
122030
122030
|
};
|
122031
|
-
})(util
|
122031
|
+
})(util || (util = {}));
|
122032
122032
|
var objectUtil;
|
122033
122033
|
(function (objectUtil) {
|
122034
122034
|
objectUtil.mergeShapes = (first, second) => ({...first, ...second});
|
122035
122035
|
})(objectUtil || (objectUtil = {}));
|
122036
|
-
const ZodParsedType = util
|
122036
|
+
const ZodParsedType = util.arrayToEnum([
|
122037
122037
|
'string',
|
122038
122038
|
'nan',
|
122039
122039
|
'number',
|
@@ -122101,7 +122101,7 @@ const getParsedType = data => {
|
|
122101
122101
|
return ZodParsedType.unknown;
|
122102
122102
|
}
|
122103
122103
|
};
|
122104
|
-
const ZodIssueCode = util
|
122104
|
+
const ZodIssueCode = util.arrayToEnum([
|
122105
122105
|
'invalid_type',
|
122106
122106
|
'invalid_literal',
|
122107
122107
|
'custom',
|
@@ -122187,7 +122187,7 @@ class ZodError extends Error {
|
|
122187
122187
|
return this.message;
|
122188
122188
|
}
|
122189
122189
|
get message() {
|
122190
|
-
return JSON.stringify(this.issues, util
|
122190
|
+
return JSON.stringify(this.issues, util.jsonStringifyReplacer, 2);
|
122191
122191
|
}
|
122192
122192
|
get isEmpty() {
|
122193
122193
|
return this.issues.length === 0;
|
@@ -122224,19 +122224,19 @@ const errorMap = (issue, _ctx) => {
|
|
122224
122224
|
}
|
122225
122225
|
break;
|
122226
122226
|
case ZodIssueCode.invalid_literal:
|
122227
|
-
message = `Invalid literal value, expected ${JSON.stringify(issue.expected, util
|
122227
|
+
message = `Invalid literal value, expected ${JSON.stringify(issue.expected, util.jsonStringifyReplacer)}`;
|
122228
122228
|
break;
|
122229
122229
|
case ZodIssueCode.unrecognized_keys:
|
122230
|
-
message = `Unrecognized key(s) in object: ${util
|
122230
|
+
message = `Unrecognized key(s) in object: ${util.joinValues(issue.keys, ', ')}`;
|
122231
122231
|
break;
|
122232
122232
|
case ZodIssueCode.invalid_union:
|
122233
122233
|
message = `Invalid input`;
|
122234
122234
|
break;
|
122235
122235
|
case ZodIssueCode.invalid_union_discriminator:
|
122236
|
-
message = `Invalid discriminator value. Expected ${util
|
122236
|
+
message = `Invalid discriminator value. Expected ${util.joinValues(issue.options)}`;
|
122237
122237
|
break;
|
122238
122238
|
case ZodIssueCode.invalid_enum_value:
|
122239
|
-
message = `Invalid enum value. Expected ${util
|
122239
|
+
message = `Invalid enum value. Expected ${util.joinValues(issue.options)}, received '${issue.received}'`;
|
122240
122240
|
break;
|
122241
122241
|
case ZodIssueCode.invalid_arguments:
|
122242
122242
|
message = `Invalid function arguments`;
|
@@ -122259,7 +122259,7 @@ const errorMap = (issue, _ctx) => {
|
|
122259
122259
|
} else if ('endsWith' in issue.validation) {
|
122260
122260
|
message = `Invalid input: must end with "${issue.validation.endsWith}"`;
|
122261
122261
|
} else {
|
122262
|
-
util
|
122262
|
+
util.assertNever(issue.validation);
|
122263
122263
|
}
|
122264
122264
|
} else if (issue.validation !== 'regex') {
|
122265
122265
|
message = `Invalid ${issue.validation}`;
|
@@ -122305,7 +122305,7 @@ const errorMap = (issue, _ctx) => {
|
|
122305
122305
|
break;
|
122306
122306
|
default:
|
122307
122307
|
message = _ctx.defaultError;
|
122308
|
-
util
|
122308
|
+
util.assertNever(issue);
|
122309
122309
|
}
|
122310
122310
|
return {message: message};
|
122311
122311
|
};
|
@@ -123012,7 +123012,7 @@ class ZodString extends ZodType {
|
|
123012
123012
|
status.dirty();
|
123013
123013
|
}
|
123014
123014
|
} else {
|
123015
|
-
util
|
123015
|
+
util.assertNever(check);
|
123016
123016
|
}
|
123017
123017
|
}
|
123018
123018
|
return {status: status.value, value: input.data};
|
@@ -123248,7 +123248,7 @@ class ZodNumber extends ZodType {
|
|
123248
123248
|
const status = new ParseStatus();
|
123249
123249
|
for (const check of this._def.checks) {
|
123250
123250
|
if (check.kind === 'int') {
|
123251
|
-
if (!util
|
123251
|
+
if (!util.isInteger(input.data)) {
|
123252
123252
|
ctx = this._getOrReturnCtx(input, ctx);
|
123253
123253
|
addIssueToContext(ctx, {
|
123254
123254
|
code: ZodIssueCode.invalid_type,
|
@@ -123310,7 +123310,7 @@ class ZodNumber extends ZodType {
|
|
123310
123310
|
status.dirty();
|
123311
123311
|
}
|
123312
123312
|
} else {
|
123313
|
-
util
|
123313
|
+
util.assertNever(check);
|
123314
123314
|
}
|
123315
123315
|
}
|
123316
123316
|
return {status: status.value, value: input.data};
|
@@ -123427,7 +123427,7 @@ class ZodNumber extends ZodType {
|
|
123427
123427
|
return !!this._def.checks.find(
|
123428
123428
|
ch =>
|
123429
123429
|
ch.kind === 'int' ||
|
123430
|
-
(ch.kind === 'multipleOf' && util
|
123430
|
+
(ch.kind === 'multipleOf' && util.isInteger(ch.value))
|
123431
123431
|
);
|
123432
123432
|
}
|
123433
123433
|
get isFinite() {
|
@@ -123521,7 +123521,7 @@ class ZodBigInt extends ZodType {
|
|
123521
123521
|
status.dirty();
|
123522
123522
|
}
|
123523
123523
|
} else {
|
123524
|
-
util
|
123524
|
+
util.assertNever(check);
|
123525
123525
|
}
|
123526
123526
|
}
|
123527
123527
|
return {status: status.value, value: input.data};
|
@@ -123701,7 +123701,7 @@ class ZodDate extends ZodType {
|
|
123701
123701
|
status.dirty();
|
123702
123702
|
}
|
123703
123703
|
} else {
|
123704
|
-
util
|
123704
|
+
util.assertNever(check);
|
123705
123705
|
}
|
123706
123706
|
}
|
123707
123707
|
return {status: status.value, value: new Date(input.data.getTime())};
|
@@ -124004,7 +124004,7 @@ class ZodObject extends ZodType {
|
|
124004
124004
|
_getCached() {
|
124005
124005
|
if (this._cached !== null) return this._cached;
|
124006
124006
|
const shape = this._def.shape();
|
124007
|
-
const keys = util
|
124007
|
+
const keys = util.objectKeys(shape);
|
124008
124008
|
return (this._cached = {shape: shape, keys: keys});
|
124009
124009
|
}
|
124010
124010
|
_parse(input) {
|
@@ -124160,7 +124160,7 @@ class ZodObject extends ZodType {
|
|
124160
124160
|
}
|
124161
124161
|
pick(mask) {
|
124162
124162
|
const shape = {};
|
124163
|
-
util
|
124163
|
+
util.objectKeys(mask).forEach(key => {
|
124164
124164
|
if (mask[key] && this.shape[key]) {
|
124165
124165
|
shape[key] = this.shape[key];
|
124166
124166
|
}
|
@@ -124169,7 +124169,7 @@ class ZodObject extends ZodType {
|
|
124169
124169
|
}
|
124170
124170
|
omit(mask) {
|
124171
124171
|
const shape = {};
|
124172
|
-
util
|
124172
|
+
util.objectKeys(this.shape).forEach(key => {
|
124173
124173
|
if (!mask[key]) {
|
124174
124174
|
shape[key] = this.shape[key];
|
124175
124175
|
}
|
@@ -124181,7 +124181,7 @@ class ZodObject extends ZodType {
|
|
124181
124181
|
}
|
124182
124182
|
partial(mask) {
|
124183
124183
|
const newShape = {};
|
124184
|
-
util
|
124184
|
+
util.objectKeys(this.shape).forEach(key => {
|
124185
124185
|
const fieldSchema = this.shape[key];
|
124186
124186
|
if (mask && !mask[key]) {
|
124187
124187
|
newShape[key] = fieldSchema;
|
@@ -124193,7 +124193,7 @@ class ZodObject extends ZodType {
|
|
124193
124193
|
}
|
124194
124194
|
required(mask) {
|
124195
124195
|
const newShape = {};
|
124196
|
-
util
|
124196
|
+
util.objectKeys(this.shape).forEach(key => {
|
124197
124197
|
if (mask && !mask[key]) {
|
124198
124198
|
newShape[key] = this.shape[key];
|
124199
124199
|
} else {
|
@@ -124208,7 +124208,7 @@ class ZodObject extends ZodType {
|
|
124208
124208
|
return new ZodObject({...this._def, shape: () => newShape});
|
124209
124209
|
}
|
124210
124210
|
keyof() {
|
124211
|
-
return createZodEnum(util
|
124211
|
+
return createZodEnum(util.objectKeys(this.shape));
|
124212
124212
|
}
|
124213
124213
|
}
|
124214
124214
|
ZodObject.create = (shape, params) =>
|
@@ -124414,8 +124414,8 @@ function mergeValues$1(a, b) {
|
|
124414
124414
|
if (a === b) {
|
124415
124415
|
return {valid: true, data: a};
|
124416
124416
|
} else if (aType === ZodParsedType.object && bType === ZodParsedType.object) {
|
124417
|
-
const bKeys = util
|
124418
|
-
const sharedKeys = util
|
124417
|
+
const bKeys = util.objectKeys(b);
|
124418
|
+
const sharedKeys = util
|
124419
124419
|
.objectKeys(a)
|
124420
124420
|
.filter(key => bKeys.indexOf(key) !== -1);
|
124421
124421
|
const newObj = {...a, ...b};
|
@@ -124945,7 +124945,7 @@ class ZodEnum extends ZodType {
|
|
124945
124945
|
const ctx = this._getOrReturnCtx(input);
|
124946
124946
|
const expectedValues = this._def.values;
|
124947
124947
|
addIssueToContext(ctx, {
|
124948
|
-
expected: util
|
124948
|
+
expected: util.joinValues(expectedValues),
|
124949
124949
|
received: ctx.parsedType,
|
124950
124950
|
code: ZodIssueCode.invalid_type,
|
124951
124951
|
});
|
@@ -124997,22 +124997,22 @@ class ZodEnum extends ZodType {
|
|
124997
124997
|
ZodEnum.create = createZodEnum;
|
124998
124998
|
class ZodNativeEnum extends ZodType {
|
124999
124999
|
_parse(input) {
|
125000
|
-
const nativeEnumValues = util
|
125000
|
+
const nativeEnumValues = util.getValidEnumValues(this._def.values);
|
125001
125001
|
const ctx = this._getOrReturnCtx(input);
|
125002
125002
|
if (
|
125003
125003
|
ctx.parsedType !== ZodParsedType.string &&
|
125004
125004
|
ctx.parsedType !== ZodParsedType.number
|
125005
125005
|
) {
|
125006
|
-
const expectedValues = util
|
125006
|
+
const expectedValues = util.objectValues(nativeEnumValues);
|
125007
125007
|
addIssueToContext(ctx, {
|
125008
|
-
expected: util
|
125008
|
+
expected: util.joinValues(expectedValues),
|
125009
125009
|
received: ctx.parsedType,
|
125010
125010
|
code: ZodIssueCode.invalid_type,
|
125011
125011
|
});
|
125012
125012
|
return INVALID;
|
125013
125013
|
}
|
125014
125014
|
if (nativeEnumValues.indexOf(input.data) === -1) {
|
125015
|
-
const expectedValues = util
|
125015
|
+
const expectedValues = util.objectValues(nativeEnumValues);
|
125016
125016
|
addIssueToContext(ctx, {
|
125017
125017
|
received: ctx.data,
|
125018
125018
|
code: ZodIssueCode.invalid_enum_value,
|
@@ -125178,7 +125178,7 @@ class ZodEffects extends ZodType {
|
|
125178
125178
|
});
|
125179
125179
|
}
|
125180
125180
|
}
|
125181
|
-
util
|
125181
|
+
util.assertNever(effect);
|
125182
125182
|
}
|
125183
125183
|
}
|
125184
125184
|
ZodEffects.create = (schema, effect, params) =>
|
@@ -125531,7 +125531,7 @@ var z = Object.freeze({
|
|
125531
125531
|
isValid: isValid,
|
125532
125532
|
isAsync: isAsync,
|
125533
125533
|
get util() {
|
125534
|
-
return util
|
125534
|
+
return util;
|
125535
125535
|
},
|
125536
125536
|
get objectUtil() {
|
125537
125537
|
return objectUtil;
|
@@ -125850,6 +125850,9 @@ function isPrimitiveType(id) {
|
|
125850
125850
|
function isArrayType(id) {
|
125851
125851
|
return id.type.kind === 'Object' && id.type.shapeId === 'BuiltInArray';
|
125852
125852
|
}
|
125853
|
+
function isPropsType(id) {
|
125854
|
+
return id.type.kind === 'Object' && id.type.shapeId === 'BuiltInProps';
|
125855
|
+
}
|
125853
125856
|
function isRefValueType(id) {
|
125854
125857
|
return id.type.kind === 'Object' && id.type.shapeId === 'BuiltInRefValue';
|
125855
125858
|
}
|
@@ -129291,6 +129294,7 @@ const BuiltInDispatchId = 'BuiltInDispatch';
|
|
129291
129294
|
const BuiltInUseContextHookId = 'BuiltInUseContextHook';
|
129292
129295
|
const BuiltInUseTransitionId = 'BuiltInUseTransition';
|
129293
129296
|
const BuiltInStartTransitionId = 'BuiltInStartTransition';
|
129297
|
+
const BuiltInFireId = 'BuiltInFire';
|
129294
129298
|
const BUILTIN_SHAPES = new Map();
|
129295
129299
|
addObject(BUILTIN_SHAPES, BuiltInPropsId, [
|
129296
129300
|
['ref', {kind: 'Object', shapeId: BuiltInUseRefId}],
|
@@ -134202,7 +134206,7 @@ var ansiRegex = options => {
|
|
134202
134206
|
Object.defineProperty(ConvertAnsi, '__esModule', {value: true});
|
134203
134207
|
ConvertAnsi.default = ConvertAnsi.serialize = ConvertAnsi.test = void 0;
|
134204
134208
|
var _ansiRegex = _interopRequireDefault$2(ansiRegex);
|
134205
|
-
var _ansiStyles$1 = _interopRequireDefault$2(ansiStylesExports
|
134209
|
+
var _ansiStyles$1 = _interopRequireDefault$2(ansiStylesExports);
|
134206
134210
|
function _interopRequireDefault$2(obj) {
|
134207
134211
|
return obj && obj.__esModule ? obj : {default: obj};
|
134208
134212
|
}
|
@@ -135259,7 +135263,7 @@ ReactTestComponent.test = test;
|
|
135259
135263
|
const plugin = {serialize: serialize, test: test};
|
135260
135264
|
var _default = plugin;
|
135261
135265
|
ReactTestComponent.default = _default;
|
135262
|
-
var _ansiStyles = _interopRequireDefault(ansiStylesExports
|
135266
|
+
var _ansiStyles = _interopRequireDefault(ansiStylesExports);
|
135263
135267
|
var _collections = collections;
|
135264
135268
|
var _AsymmetricMatcher = _interopRequireDefault(AsymmetricMatcher);
|
135265
135269
|
var _ConvertAnsi = _interopRequireDefault(ConvertAnsi);
|
@@ -136011,6 +136015,21 @@ const UNTYPED_GLOBALS = new Set([
|
|
136011
136015
|
'decodeURIComponent',
|
136012
136016
|
]);
|
136013
136017
|
const TYPED_GLOBALS = [
|
136018
|
+
[
|
136019
|
+
'Object',
|
136020
|
+
addObject(DEFAULT_SHAPES, 'Object', [
|
136021
|
+
[
|
136022
|
+
'keys',
|
136023
|
+
addFunction(DEFAULT_SHAPES, [], {
|
136024
|
+
positionalParams: [exports.Effect.Read],
|
136025
|
+
restParam: null,
|
136026
|
+
returnType: {kind: 'Object', shapeId: BuiltInArrayId},
|
136027
|
+
calleeEffect: exports.Effect.Read,
|
136028
|
+
returnValueKind: exports.ValueKind.Mutable,
|
136029
|
+
}),
|
136030
|
+
],
|
136031
|
+
]),
|
136032
|
+
],
|
136014
136033
|
[
|
136015
136034
|
'Array',
|
136016
136035
|
addObject(DEFAULT_SHAPES, 'Array', [
|
@@ -136368,6 +136387,21 @@ const REACT_APIS = [
|
|
136368
136387
|
BuiltInUseOperatorId
|
136369
136388
|
),
|
136370
136389
|
],
|
136390
|
+
[
|
136391
|
+
'fire',
|
136392
|
+
addFunction(
|
136393
|
+
DEFAULT_SHAPES,
|
136394
|
+
[],
|
136395
|
+
{
|
136396
|
+
positionalParams: [],
|
136397
|
+
restParam: null,
|
136398
|
+
returnType: {kind: 'Primitive'},
|
136399
|
+
calleeEffect: exports.Effect.Read,
|
136400
|
+
returnValueKind: exports.ValueKind.Frozen,
|
136401
|
+
},
|
136402
|
+
BuiltInFireId
|
136403
|
+
),
|
136404
|
+
],
|
136371
136405
|
];
|
136372
136406
|
TYPED_GLOBALS.push(
|
136373
136407
|
[
|
@@ -136717,7 +136751,7 @@ const EnvironmentConfigSchema = z.object({
|
|
136717
136751
|
customHooks: z.map(z.string(), HookSchema).default(new Map()),
|
136718
136752
|
moduleTypeProvider: z.nullable(z.function().args(z.string())).default(null),
|
136719
136753
|
customMacros: z.nullable(z.array(MacroSchema)).default(null),
|
136720
|
-
enableResetCacheOnSourceFileChanges: z.boolean().default(
|
136754
|
+
enableResetCacheOnSourceFileChanges: z.nullable(z.boolean()).default(null),
|
136721
136755
|
enablePreserveExistingMemoizationGuarantees: z.boolean().default(false),
|
136722
136756
|
validatePreserveExistingMemoizationGuarantees: z.boolean().default(true),
|
136723
136757
|
enablePreserveExistingManualUseMemo: z.boolean().default(false),
|
@@ -136725,6 +136759,7 @@ const EnvironmentConfigSchema = z.object({
|
|
136725
136759
|
enableUseTypeAnnotations: z.boolean().default(false),
|
136726
136760
|
enableFunctionDependencyRewrite: z.boolean().default(true),
|
136727
136761
|
enableOptionalDependencies: z.boolean().default(true),
|
136762
|
+
enableFire: z.boolean().default(false),
|
136728
136763
|
inferEffectDependencies: z
|
136729
136764
|
.nullable(
|
136730
136765
|
z.array(
|
@@ -136845,7 +136880,10 @@ function parseConfigPragmaForTests(pragma) {
|
|
136845
136880
|
}
|
136846
136881
|
continue;
|
136847
136882
|
}
|
136848
|
-
if (
|
136883
|
+
if (
|
136884
|
+
key !== 'enableResetCacheOnSourceFileChanges' &&
|
136885
|
+
typeof defaultConfig[key] !== 'boolean'
|
136886
|
+
) {
|
136849
136887
|
continue;
|
136850
136888
|
}
|
136851
136889
|
if (val === undefined || val === 'true') {
|
@@ -136856,6 +136894,9 @@ function parseConfigPragmaForTests(pragma) {
|
|
136856
136894
|
}
|
136857
136895
|
const config = EnvironmentConfigSchema.safeParse(maybeConfig);
|
136858
136896
|
if (config.success) {
|
136897
|
+
if (config.data.enableResetCacheOnSourceFileChanges == null) {
|
136898
|
+
config.data.enableResetCacheOnSourceFileChanges = false;
|
136899
|
+
}
|
136859
136900
|
return config.data;
|
136860
136901
|
}
|
136861
136902
|
CompilerError.invariant(false, {
|
@@ -137593,1634 +137634,8 @@ class DisjointSet {
|
|
137593
137634
|
}
|
137594
137635
|
}
|
137595
137636
|
_DisjointSet_entries = new WeakMap();
|
137596
|
-
var ansiStyles$1 = {exports: {}};
|
137597
|
-
var colorName;
|
137598
|
-
var hasRequiredColorName;
|
137599
|
-
function requireColorName() {
|
137600
|
-
if (hasRequiredColorName) return colorName;
|
137601
|
-
hasRequiredColorName = 1;
|
137602
|
-
colorName = {
|
137603
|
-
aliceblue: [240, 248, 255],
|
137604
|
-
antiquewhite: [250, 235, 215],
|
137605
|
-
aqua: [0, 255, 255],
|
137606
|
-
aquamarine: [127, 255, 212],
|
137607
|
-
azure: [240, 255, 255],
|
137608
|
-
beige: [245, 245, 220],
|
137609
|
-
bisque: [255, 228, 196],
|
137610
|
-
black: [0, 0, 0],
|
137611
|
-
blanchedalmond: [255, 235, 205],
|
137612
|
-
blue: [0, 0, 255],
|
137613
|
-
blueviolet: [138, 43, 226],
|
137614
|
-
brown: [165, 42, 42],
|
137615
|
-
burlywood: [222, 184, 135],
|
137616
|
-
cadetblue: [95, 158, 160],
|
137617
|
-
chartreuse: [127, 255, 0],
|
137618
|
-
chocolate: [210, 105, 30],
|
137619
|
-
coral: [255, 127, 80],
|
137620
|
-
cornflowerblue: [100, 149, 237],
|
137621
|
-
cornsilk: [255, 248, 220],
|
137622
|
-
crimson: [220, 20, 60],
|
137623
|
-
cyan: [0, 255, 255],
|
137624
|
-
darkblue: [0, 0, 139],
|
137625
|
-
darkcyan: [0, 139, 139],
|
137626
|
-
darkgoldenrod: [184, 134, 11],
|
137627
|
-
darkgray: [169, 169, 169],
|
137628
|
-
darkgreen: [0, 100, 0],
|
137629
|
-
darkgrey: [169, 169, 169],
|
137630
|
-
darkkhaki: [189, 183, 107],
|
137631
|
-
darkmagenta: [139, 0, 139],
|
137632
|
-
darkolivegreen: [85, 107, 47],
|
137633
|
-
darkorange: [255, 140, 0],
|
137634
|
-
darkorchid: [153, 50, 204],
|
137635
|
-
darkred: [139, 0, 0],
|
137636
|
-
darksalmon: [233, 150, 122],
|
137637
|
-
darkseagreen: [143, 188, 143],
|
137638
|
-
darkslateblue: [72, 61, 139],
|
137639
|
-
darkslategray: [47, 79, 79],
|
137640
|
-
darkslategrey: [47, 79, 79],
|
137641
|
-
darkturquoise: [0, 206, 209],
|
137642
|
-
darkviolet: [148, 0, 211],
|
137643
|
-
deeppink: [255, 20, 147],
|
137644
|
-
deepskyblue: [0, 191, 255],
|
137645
|
-
dimgray: [105, 105, 105],
|
137646
|
-
dimgrey: [105, 105, 105],
|
137647
|
-
dodgerblue: [30, 144, 255],
|
137648
|
-
firebrick: [178, 34, 34],
|
137649
|
-
floralwhite: [255, 250, 240],
|
137650
|
-
forestgreen: [34, 139, 34],
|
137651
|
-
fuchsia: [255, 0, 255],
|
137652
|
-
gainsboro: [220, 220, 220],
|
137653
|
-
ghostwhite: [248, 248, 255],
|
137654
|
-
gold: [255, 215, 0],
|
137655
|
-
goldenrod: [218, 165, 32],
|
137656
|
-
gray: [128, 128, 128],
|
137657
|
-
green: [0, 128, 0],
|
137658
|
-
greenyellow: [173, 255, 47],
|
137659
|
-
grey: [128, 128, 128],
|
137660
|
-
honeydew: [240, 255, 240],
|
137661
|
-
hotpink: [255, 105, 180],
|
137662
|
-
indianred: [205, 92, 92],
|
137663
|
-
indigo: [75, 0, 130],
|
137664
|
-
ivory: [255, 255, 240],
|
137665
|
-
khaki: [240, 230, 140],
|
137666
|
-
lavender: [230, 230, 250],
|
137667
|
-
lavenderblush: [255, 240, 245],
|
137668
|
-
lawngreen: [124, 252, 0],
|
137669
|
-
lemonchiffon: [255, 250, 205],
|
137670
|
-
lightblue: [173, 216, 230],
|
137671
|
-
lightcoral: [240, 128, 128],
|
137672
|
-
lightcyan: [224, 255, 255],
|
137673
|
-
lightgoldenrodyellow: [250, 250, 210],
|
137674
|
-
lightgray: [211, 211, 211],
|
137675
|
-
lightgreen: [144, 238, 144],
|
137676
|
-
lightgrey: [211, 211, 211],
|
137677
|
-
lightpink: [255, 182, 193],
|
137678
|
-
lightsalmon: [255, 160, 122],
|
137679
|
-
lightseagreen: [32, 178, 170],
|
137680
|
-
lightskyblue: [135, 206, 250],
|
137681
|
-
lightslategray: [119, 136, 153],
|
137682
|
-
lightslategrey: [119, 136, 153],
|
137683
|
-
lightsteelblue: [176, 196, 222],
|
137684
|
-
lightyellow: [255, 255, 224],
|
137685
|
-
lime: [0, 255, 0],
|
137686
|
-
limegreen: [50, 205, 50],
|
137687
|
-
linen: [250, 240, 230],
|
137688
|
-
magenta: [255, 0, 255],
|
137689
|
-
maroon: [128, 0, 0],
|
137690
|
-
mediumaquamarine: [102, 205, 170],
|
137691
|
-
mediumblue: [0, 0, 205],
|
137692
|
-
mediumorchid: [186, 85, 211],
|
137693
|
-
mediumpurple: [147, 112, 219],
|
137694
|
-
mediumseagreen: [60, 179, 113],
|
137695
|
-
mediumslateblue: [123, 104, 238],
|
137696
|
-
mediumspringgreen: [0, 250, 154],
|
137697
|
-
mediumturquoise: [72, 209, 204],
|
137698
|
-
mediumvioletred: [199, 21, 133],
|
137699
|
-
midnightblue: [25, 25, 112],
|
137700
|
-
mintcream: [245, 255, 250],
|
137701
|
-
mistyrose: [255, 228, 225],
|
137702
|
-
moccasin: [255, 228, 181],
|
137703
|
-
navajowhite: [255, 222, 173],
|
137704
|
-
navy: [0, 0, 128],
|
137705
|
-
oldlace: [253, 245, 230],
|
137706
|
-
olive: [128, 128, 0],
|
137707
|
-
olivedrab: [107, 142, 35],
|
137708
|
-
orange: [255, 165, 0],
|
137709
|
-
orangered: [255, 69, 0],
|
137710
|
-
orchid: [218, 112, 214],
|
137711
|
-
palegoldenrod: [238, 232, 170],
|
137712
|
-
palegreen: [152, 251, 152],
|
137713
|
-
paleturquoise: [175, 238, 238],
|
137714
|
-
palevioletred: [219, 112, 147],
|
137715
|
-
papayawhip: [255, 239, 213],
|
137716
|
-
peachpuff: [255, 218, 185],
|
137717
|
-
peru: [205, 133, 63],
|
137718
|
-
pink: [255, 192, 203],
|
137719
|
-
plum: [221, 160, 221],
|
137720
|
-
powderblue: [176, 224, 230],
|
137721
|
-
purple: [128, 0, 128],
|
137722
|
-
rebeccapurple: [102, 51, 153],
|
137723
|
-
red: [255, 0, 0],
|
137724
|
-
rosybrown: [188, 143, 143],
|
137725
|
-
royalblue: [65, 105, 225],
|
137726
|
-
saddlebrown: [139, 69, 19],
|
137727
|
-
salmon: [250, 128, 114],
|
137728
|
-
sandybrown: [244, 164, 96],
|
137729
|
-
seagreen: [46, 139, 87],
|
137730
|
-
seashell: [255, 245, 238],
|
137731
|
-
sienna: [160, 82, 45],
|
137732
|
-
silver: [192, 192, 192],
|
137733
|
-
skyblue: [135, 206, 235],
|
137734
|
-
slateblue: [106, 90, 205],
|
137735
|
-
slategray: [112, 128, 144],
|
137736
|
-
slategrey: [112, 128, 144],
|
137737
|
-
snow: [255, 250, 250],
|
137738
|
-
springgreen: [0, 255, 127],
|
137739
|
-
steelblue: [70, 130, 180],
|
137740
|
-
tan: [210, 180, 140],
|
137741
|
-
teal: [0, 128, 128],
|
137742
|
-
thistle: [216, 191, 216],
|
137743
|
-
tomato: [255, 99, 71],
|
137744
|
-
turquoise: [64, 224, 208],
|
137745
|
-
violet: [238, 130, 238],
|
137746
|
-
wheat: [245, 222, 179],
|
137747
|
-
white: [255, 255, 255],
|
137748
|
-
whitesmoke: [245, 245, 245],
|
137749
|
-
yellow: [255, 255, 0],
|
137750
|
-
yellowgreen: [154, 205, 50],
|
137751
|
-
};
|
137752
|
-
return colorName;
|
137753
|
-
}
|
137754
|
-
var conversions;
|
137755
|
-
var hasRequiredConversions;
|
137756
|
-
function requireConversions() {
|
137757
|
-
if (hasRequiredConversions) return conversions;
|
137758
|
-
hasRequiredConversions = 1;
|
137759
|
-
const cssKeywords = requireColorName();
|
137760
|
-
const reverseKeywords = {};
|
137761
|
-
for (const key of Object.keys(cssKeywords)) {
|
137762
|
-
reverseKeywords[cssKeywords[key]] = key;
|
137763
|
-
}
|
137764
|
-
const convert = {
|
137765
|
-
rgb: {channels: 3, labels: 'rgb'},
|
137766
|
-
hsl: {channels: 3, labels: 'hsl'},
|
137767
|
-
hsv: {channels: 3, labels: 'hsv'},
|
137768
|
-
hwb: {channels: 3, labels: 'hwb'},
|
137769
|
-
cmyk: {channels: 4, labels: 'cmyk'},
|
137770
|
-
xyz: {channels: 3, labels: 'xyz'},
|
137771
|
-
lab: {channels: 3, labels: 'lab'},
|
137772
|
-
lch: {channels: 3, labels: 'lch'},
|
137773
|
-
hex: {channels: 1, labels: ['hex']},
|
137774
|
-
keyword: {channels: 1, labels: ['keyword']},
|
137775
|
-
ansi16: {channels: 1, labels: ['ansi16']},
|
137776
|
-
ansi256: {channels: 1, labels: ['ansi256']},
|
137777
|
-
hcg: {channels: 3, labels: ['h', 'c', 'g']},
|
137778
|
-
apple: {channels: 3, labels: ['r16', 'g16', 'b16']},
|
137779
|
-
gray: {channels: 1, labels: ['gray']},
|
137780
|
-
};
|
137781
|
-
conversions = convert;
|
137782
|
-
for (const model of Object.keys(convert)) {
|
137783
|
-
if (!('channels' in convert[model])) {
|
137784
|
-
throw new Error('missing channels property: ' + model);
|
137785
|
-
}
|
137786
|
-
if (!('labels' in convert[model])) {
|
137787
|
-
throw new Error('missing channel labels property: ' + model);
|
137788
|
-
}
|
137789
|
-
if (convert[model].labels.length !== convert[model].channels) {
|
137790
|
-
throw new Error('channel and label counts mismatch: ' + model);
|
137791
|
-
}
|
137792
|
-
const {channels: channels, labels: labels} = convert[model];
|
137793
|
-
delete convert[model].channels;
|
137794
|
-
delete convert[model].labels;
|
137795
|
-
Object.defineProperty(convert[model], 'channels', {value: channels});
|
137796
|
-
Object.defineProperty(convert[model], 'labels', {value: labels});
|
137797
|
-
}
|
137798
|
-
convert.rgb.hsl = function (rgb) {
|
137799
|
-
const r = rgb[0] / 255;
|
137800
|
-
const g = rgb[1] / 255;
|
137801
|
-
const b = rgb[2] / 255;
|
137802
|
-
const min = Math.min(r, g, b);
|
137803
|
-
const max = Math.max(r, g, b);
|
137804
|
-
const delta = max - min;
|
137805
|
-
let h;
|
137806
|
-
let s;
|
137807
|
-
if (max === min) {
|
137808
|
-
h = 0;
|
137809
|
-
} else if (r === max) {
|
137810
|
-
h = (g - b) / delta;
|
137811
|
-
} else if (g === max) {
|
137812
|
-
h = 2 + (b - r) / delta;
|
137813
|
-
} else if (b === max) {
|
137814
|
-
h = 4 + (r - g) / delta;
|
137815
|
-
}
|
137816
|
-
h = Math.min(h * 60, 360);
|
137817
|
-
if (h < 0) {
|
137818
|
-
h += 360;
|
137819
|
-
}
|
137820
|
-
const l = (min + max) / 2;
|
137821
|
-
if (max === min) {
|
137822
|
-
s = 0;
|
137823
|
-
} else if (l <= 0.5) {
|
137824
|
-
s = delta / (max + min);
|
137825
|
-
} else {
|
137826
|
-
s = delta / (2 - max - min);
|
137827
|
-
}
|
137828
|
-
return [h, s * 100, l * 100];
|
137829
|
-
};
|
137830
|
-
convert.rgb.hsv = function (rgb) {
|
137831
|
-
let rdif;
|
137832
|
-
let gdif;
|
137833
|
-
let bdif;
|
137834
|
-
let h;
|
137835
|
-
let s;
|
137836
|
-
const r = rgb[0] / 255;
|
137837
|
-
const g = rgb[1] / 255;
|
137838
|
-
const b = rgb[2] / 255;
|
137839
|
-
const v = Math.max(r, g, b);
|
137840
|
-
const diff = v - Math.min(r, g, b);
|
137841
|
-
const diffc = function (c) {
|
137842
|
-
return (v - c) / 6 / diff + 1 / 2;
|
137843
|
-
};
|
137844
|
-
if (diff === 0) {
|
137845
|
-
h = 0;
|
137846
|
-
s = 0;
|
137847
|
-
} else {
|
137848
|
-
s = diff / v;
|
137849
|
-
rdif = diffc(r);
|
137850
|
-
gdif = diffc(g);
|
137851
|
-
bdif = diffc(b);
|
137852
|
-
if (r === v) {
|
137853
|
-
h = bdif - gdif;
|
137854
|
-
} else if (g === v) {
|
137855
|
-
h = 1 / 3 + rdif - bdif;
|
137856
|
-
} else if (b === v) {
|
137857
|
-
h = 2 / 3 + gdif - rdif;
|
137858
|
-
}
|
137859
|
-
if (h < 0) {
|
137860
|
-
h += 1;
|
137861
|
-
} else if (h > 1) {
|
137862
|
-
h -= 1;
|
137863
|
-
}
|
137864
|
-
}
|
137865
|
-
return [h * 360, s * 100, v * 100];
|
137866
|
-
};
|
137867
|
-
convert.rgb.hwb = function (rgb) {
|
137868
|
-
const r = rgb[0];
|
137869
|
-
const g = rgb[1];
|
137870
|
-
let b = rgb[2];
|
137871
|
-
const h = convert.rgb.hsl(rgb)[0];
|
137872
|
-
const w = (1 / 255) * Math.min(r, Math.min(g, b));
|
137873
|
-
b = 1 - (1 / 255) * Math.max(r, Math.max(g, b));
|
137874
|
-
return [h, w * 100, b * 100];
|
137875
|
-
};
|
137876
|
-
convert.rgb.cmyk = function (rgb) {
|
137877
|
-
const r = rgb[0] / 255;
|
137878
|
-
const g = rgb[1] / 255;
|
137879
|
-
const b = rgb[2] / 255;
|
137880
|
-
const k = Math.min(1 - r, 1 - g, 1 - b);
|
137881
|
-
const c = (1 - r - k) / (1 - k) || 0;
|
137882
|
-
const m = (1 - g - k) / (1 - k) || 0;
|
137883
|
-
const y = (1 - b - k) / (1 - k) || 0;
|
137884
|
-
return [c * 100, m * 100, y * 100, k * 100];
|
137885
|
-
};
|
137886
|
-
function comparativeDistance(x, y) {
|
137887
|
-
return (x[0] - y[0]) ** 2 + (x[1] - y[1]) ** 2 + (x[2] - y[2]) ** 2;
|
137888
|
-
}
|
137889
|
-
convert.rgb.keyword = function (rgb) {
|
137890
|
-
const reversed = reverseKeywords[rgb];
|
137891
|
-
if (reversed) {
|
137892
|
-
return reversed;
|
137893
|
-
}
|
137894
|
-
let currentClosestDistance = Infinity;
|
137895
|
-
let currentClosestKeyword;
|
137896
|
-
for (const keyword of Object.keys(cssKeywords)) {
|
137897
|
-
const value = cssKeywords[keyword];
|
137898
|
-
const distance = comparativeDistance(rgb, value);
|
137899
|
-
if (distance < currentClosestDistance) {
|
137900
|
-
currentClosestDistance = distance;
|
137901
|
-
currentClosestKeyword = keyword;
|
137902
|
-
}
|
137903
|
-
}
|
137904
|
-
return currentClosestKeyword;
|
137905
|
-
};
|
137906
|
-
convert.keyword.rgb = function (keyword) {
|
137907
|
-
return cssKeywords[keyword];
|
137908
|
-
};
|
137909
|
-
convert.rgb.xyz = function (rgb) {
|
137910
|
-
let r = rgb[0] / 255;
|
137911
|
-
let g = rgb[1] / 255;
|
137912
|
-
let b = rgb[2] / 255;
|
137913
|
-
r = r > 0.04045 ? ((r + 0.055) / 1.055) ** 2.4 : r / 12.92;
|
137914
|
-
g = g > 0.04045 ? ((g + 0.055) / 1.055) ** 2.4 : g / 12.92;
|
137915
|
-
b = b > 0.04045 ? ((b + 0.055) / 1.055) ** 2.4 : b / 12.92;
|
137916
|
-
const x = r * 0.4124 + g * 0.3576 + b * 0.1805;
|
137917
|
-
const y = r * 0.2126 + g * 0.7152 + b * 0.0722;
|
137918
|
-
const z = r * 0.0193 + g * 0.1192 + b * 0.9505;
|
137919
|
-
return [x * 100, y * 100, z * 100];
|
137920
|
-
};
|
137921
|
-
convert.rgb.lab = function (rgb) {
|
137922
|
-
const xyz = convert.rgb.xyz(rgb);
|
137923
|
-
let x = xyz[0];
|
137924
|
-
let y = xyz[1];
|
137925
|
-
let z = xyz[2];
|
137926
|
-
x /= 95.047;
|
137927
|
-
y /= 100;
|
137928
|
-
z /= 108.883;
|
137929
|
-
x = x > 0.008856 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
|
137930
|
-
y = y > 0.008856 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
|
137931
|
-
z = z > 0.008856 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
|
137932
|
-
const l = 116 * y - 16;
|
137933
|
-
const a = 500 * (x - y);
|
137934
|
-
const b = 200 * (y - z);
|
137935
|
-
return [l, a, b];
|
137936
|
-
};
|
137937
|
-
convert.hsl.rgb = function (hsl) {
|
137938
|
-
const h = hsl[0] / 360;
|
137939
|
-
const s = hsl[1] / 100;
|
137940
|
-
const l = hsl[2] / 100;
|
137941
|
-
let t2;
|
137942
|
-
let t3;
|
137943
|
-
let val;
|
137944
|
-
if (s === 0) {
|
137945
|
-
val = l * 255;
|
137946
|
-
return [val, val, val];
|
137947
|
-
}
|
137948
|
-
if (l < 0.5) {
|
137949
|
-
t2 = l * (1 + s);
|
137950
|
-
} else {
|
137951
|
-
t2 = l + s - l * s;
|
137952
|
-
}
|
137953
|
-
const t1 = 2 * l - t2;
|
137954
|
-
const rgb = [0, 0, 0];
|
137955
|
-
for (let i = 0; i < 3; i++) {
|
137956
|
-
t3 = h + (1 / 3) * -(i - 1);
|
137957
|
-
if (t3 < 0) {
|
137958
|
-
t3++;
|
137959
|
-
}
|
137960
|
-
if (t3 > 1) {
|
137961
|
-
t3--;
|
137962
|
-
}
|
137963
|
-
if (6 * t3 < 1) {
|
137964
|
-
val = t1 + (t2 - t1) * 6 * t3;
|
137965
|
-
} else if (2 * t3 < 1) {
|
137966
|
-
val = t2;
|
137967
|
-
} else if (3 * t3 < 2) {
|
137968
|
-
val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
|
137969
|
-
} else {
|
137970
|
-
val = t1;
|
137971
|
-
}
|
137972
|
-
rgb[i] = val * 255;
|
137973
|
-
}
|
137974
|
-
return rgb;
|
137975
|
-
};
|
137976
|
-
convert.hsl.hsv = function (hsl) {
|
137977
|
-
const h = hsl[0];
|
137978
|
-
let s = hsl[1] / 100;
|
137979
|
-
let l = hsl[2] / 100;
|
137980
|
-
let smin = s;
|
137981
|
-
const lmin = Math.max(l, 0.01);
|
137982
|
-
l *= 2;
|
137983
|
-
s *= l <= 1 ? l : 2 - l;
|
137984
|
-
smin *= lmin <= 1 ? lmin : 2 - lmin;
|
137985
|
-
const v = (l + s) / 2;
|
137986
|
-
const sv = l === 0 ? (2 * smin) / (lmin + smin) : (2 * s) / (l + s);
|
137987
|
-
return [h, sv * 100, v * 100];
|
137988
|
-
};
|
137989
|
-
convert.hsv.rgb = function (hsv) {
|
137990
|
-
const h = hsv[0] / 60;
|
137991
|
-
const s = hsv[1] / 100;
|
137992
|
-
let v = hsv[2] / 100;
|
137993
|
-
const hi = Math.floor(h) % 6;
|
137994
|
-
const f = h - Math.floor(h);
|
137995
|
-
const p = 255 * v * (1 - s);
|
137996
|
-
const q = 255 * v * (1 - s * f);
|
137997
|
-
const t = 255 * v * (1 - s * (1 - f));
|
137998
|
-
v *= 255;
|
137999
|
-
switch (hi) {
|
138000
|
-
case 0:
|
138001
|
-
return [v, t, p];
|
138002
|
-
case 1:
|
138003
|
-
return [q, v, p];
|
138004
|
-
case 2:
|
138005
|
-
return [p, v, t];
|
138006
|
-
case 3:
|
138007
|
-
return [p, q, v];
|
138008
|
-
case 4:
|
138009
|
-
return [t, p, v];
|
138010
|
-
case 5:
|
138011
|
-
return [v, p, q];
|
138012
|
-
}
|
138013
|
-
};
|
138014
|
-
convert.hsv.hsl = function (hsv) {
|
138015
|
-
const h = hsv[0];
|
138016
|
-
const s = hsv[1] / 100;
|
138017
|
-
const v = hsv[2] / 100;
|
138018
|
-
const vmin = Math.max(v, 0.01);
|
138019
|
-
let sl;
|
138020
|
-
let l;
|
138021
|
-
l = (2 - s) * v;
|
138022
|
-
const lmin = (2 - s) * vmin;
|
138023
|
-
sl = s * vmin;
|
138024
|
-
sl /= lmin <= 1 ? lmin : 2 - lmin;
|
138025
|
-
sl = sl || 0;
|
138026
|
-
l /= 2;
|
138027
|
-
return [h, sl * 100, l * 100];
|
138028
|
-
};
|
138029
|
-
convert.hwb.rgb = function (hwb) {
|
138030
|
-
const h = hwb[0] / 360;
|
138031
|
-
let wh = hwb[1] / 100;
|
138032
|
-
let bl = hwb[2] / 100;
|
138033
|
-
const ratio = wh + bl;
|
138034
|
-
let f;
|
138035
|
-
if (ratio > 1) {
|
138036
|
-
wh /= ratio;
|
138037
|
-
bl /= ratio;
|
138038
|
-
}
|
138039
|
-
const i = Math.floor(6 * h);
|
138040
|
-
const v = 1 - bl;
|
138041
|
-
f = 6 * h - i;
|
138042
|
-
if ((i & 1) !== 0) {
|
138043
|
-
f = 1 - f;
|
138044
|
-
}
|
138045
|
-
const n = wh + f * (v - wh);
|
138046
|
-
let r;
|
138047
|
-
let g;
|
138048
|
-
let b;
|
138049
|
-
switch (i) {
|
138050
|
-
default:
|
138051
|
-
case 6:
|
138052
|
-
case 0:
|
138053
|
-
r = v;
|
138054
|
-
g = n;
|
138055
|
-
b = wh;
|
138056
|
-
break;
|
138057
|
-
case 1:
|
138058
|
-
r = n;
|
138059
|
-
g = v;
|
138060
|
-
b = wh;
|
138061
|
-
break;
|
138062
|
-
case 2:
|
138063
|
-
r = wh;
|
138064
|
-
g = v;
|
138065
|
-
b = n;
|
138066
|
-
break;
|
138067
|
-
case 3:
|
138068
|
-
r = wh;
|
138069
|
-
g = n;
|
138070
|
-
b = v;
|
138071
|
-
break;
|
138072
|
-
case 4:
|
138073
|
-
r = n;
|
138074
|
-
g = wh;
|
138075
|
-
b = v;
|
138076
|
-
break;
|
138077
|
-
case 5:
|
138078
|
-
r = v;
|
138079
|
-
g = wh;
|
138080
|
-
b = n;
|
138081
|
-
break;
|
138082
|
-
}
|
138083
|
-
return [r * 255, g * 255, b * 255];
|
138084
|
-
};
|
138085
|
-
convert.cmyk.rgb = function (cmyk) {
|
138086
|
-
const c = cmyk[0] / 100;
|
138087
|
-
const m = cmyk[1] / 100;
|
138088
|
-
const y = cmyk[2] / 100;
|
138089
|
-
const k = cmyk[3] / 100;
|
138090
|
-
const r = 1 - Math.min(1, c * (1 - k) + k);
|
138091
|
-
const g = 1 - Math.min(1, m * (1 - k) + k);
|
138092
|
-
const b = 1 - Math.min(1, y * (1 - k) + k);
|
138093
|
-
return [r * 255, g * 255, b * 255];
|
138094
|
-
};
|
138095
|
-
convert.xyz.rgb = function (xyz) {
|
138096
|
-
const x = xyz[0] / 100;
|
138097
|
-
const y = xyz[1] / 100;
|
138098
|
-
const z = xyz[2] / 100;
|
138099
|
-
let r;
|
138100
|
-
let g;
|
138101
|
-
let b;
|
138102
|
-
r = x * 3.2406 + y * -1.5372 + z * -0.4986;
|
138103
|
-
g = x * -0.9689 + y * 1.8758 + z * 0.0415;
|
138104
|
-
b = x * 0.0557 + y * -0.204 + z * 1.057;
|
138105
|
-
r = r > 0.0031308 ? 1.055 * r ** (1 / 2.4) - 0.055 : r * 12.92;
|
138106
|
-
g = g > 0.0031308 ? 1.055 * g ** (1 / 2.4) - 0.055 : g * 12.92;
|
138107
|
-
b = b > 0.0031308 ? 1.055 * b ** (1 / 2.4) - 0.055 : b * 12.92;
|
138108
|
-
r = Math.min(Math.max(0, r), 1);
|
138109
|
-
g = Math.min(Math.max(0, g), 1);
|
138110
|
-
b = Math.min(Math.max(0, b), 1);
|
138111
|
-
return [r * 255, g * 255, b * 255];
|
138112
|
-
};
|
138113
|
-
convert.xyz.lab = function (xyz) {
|
138114
|
-
let x = xyz[0];
|
138115
|
-
let y = xyz[1];
|
138116
|
-
let z = xyz[2];
|
138117
|
-
x /= 95.047;
|
138118
|
-
y /= 100;
|
138119
|
-
z /= 108.883;
|
138120
|
-
x = x > 0.008856 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
|
138121
|
-
y = y > 0.008856 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
|
138122
|
-
z = z > 0.008856 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
|
138123
|
-
const l = 116 * y - 16;
|
138124
|
-
const a = 500 * (x - y);
|
138125
|
-
const b = 200 * (y - z);
|
138126
|
-
return [l, a, b];
|
138127
|
-
};
|
138128
|
-
convert.lab.xyz = function (lab) {
|
138129
|
-
const l = lab[0];
|
138130
|
-
const a = lab[1];
|
138131
|
-
const b = lab[2];
|
138132
|
-
let x;
|
138133
|
-
let y;
|
138134
|
-
let z;
|
138135
|
-
y = (l + 16) / 116;
|
138136
|
-
x = a / 500 + y;
|
138137
|
-
z = y - b / 200;
|
138138
|
-
const y2 = y ** 3;
|
138139
|
-
const x2 = x ** 3;
|
138140
|
-
const z2 = z ** 3;
|
138141
|
-
y = y2 > 0.008856 ? y2 : (y - 16 / 116) / 7.787;
|
138142
|
-
x = x2 > 0.008856 ? x2 : (x - 16 / 116) / 7.787;
|
138143
|
-
z = z2 > 0.008856 ? z2 : (z - 16 / 116) / 7.787;
|
138144
|
-
x *= 95.047;
|
138145
|
-
y *= 100;
|
138146
|
-
z *= 108.883;
|
138147
|
-
return [x, y, z];
|
138148
|
-
};
|
138149
|
-
convert.lab.lch = function (lab) {
|
138150
|
-
const l = lab[0];
|
138151
|
-
const a = lab[1];
|
138152
|
-
const b = lab[2];
|
138153
|
-
let h;
|
138154
|
-
const hr = Math.atan2(b, a);
|
138155
|
-
h = (hr * 360) / 2 / Math.PI;
|
138156
|
-
if (h < 0) {
|
138157
|
-
h += 360;
|
138158
|
-
}
|
138159
|
-
const c = Math.sqrt(a * a + b * b);
|
138160
|
-
return [l, c, h];
|
138161
|
-
};
|
138162
|
-
convert.lch.lab = function (lch) {
|
138163
|
-
const l = lch[0];
|
138164
|
-
const c = lch[1];
|
138165
|
-
const h = lch[2];
|
138166
|
-
const hr = (h / 360) * 2 * Math.PI;
|
138167
|
-
const a = c * Math.cos(hr);
|
138168
|
-
const b = c * Math.sin(hr);
|
138169
|
-
return [l, a, b];
|
138170
|
-
};
|
138171
|
-
convert.rgb.ansi16 = function (args, saturation = null) {
|
138172
|
-
const [r, g, b] = args;
|
138173
|
-
let value = saturation === null ? convert.rgb.hsv(args)[2] : saturation;
|
138174
|
-
value = Math.round(value / 50);
|
138175
|
-
if (value === 0) {
|
138176
|
-
return 30;
|
138177
|
-
}
|
138178
|
-
let ansi =
|
138179
|
-
30 +
|
138180
|
-
((Math.round(b / 255) << 2) |
|
138181
|
-
(Math.round(g / 255) << 1) |
|
138182
|
-
Math.round(r / 255));
|
138183
|
-
if (value === 2) {
|
138184
|
-
ansi += 60;
|
138185
|
-
}
|
138186
|
-
return ansi;
|
138187
|
-
};
|
138188
|
-
convert.hsv.ansi16 = function (args) {
|
138189
|
-
return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);
|
138190
|
-
};
|
138191
|
-
convert.rgb.ansi256 = function (args) {
|
138192
|
-
const r = args[0];
|
138193
|
-
const g = args[1];
|
138194
|
-
const b = args[2];
|
138195
|
-
if (r === g && g === b) {
|
138196
|
-
if (r < 8) {
|
138197
|
-
return 16;
|
138198
|
-
}
|
138199
|
-
if (r > 248) {
|
138200
|
-
return 231;
|
138201
|
-
}
|
138202
|
-
return Math.round(((r - 8) / 247) * 24) + 232;
|
138203
|
-
}
|
138204
|
-
const ansi =
|
138205
|
-
16 +
|
138206
|
-
36 * Math.round((r / 255) * 5) +
|
138207
|
-
6 * Math.round((g / 255) * 5) +
|
138208
|
-
Math.round((b / 255) * 5);
|
138209
|
-
return ansi;
|
138210
|
-
};
|
138211
|
-
convert.ansi16.rgb = function (args) {
|
138212
|
-
let color = args % 10;
|
138213
|
-
if (color === 0 || color === 7) {
|
138214
|
-
if (args > 50) {
|
138215
|
-
color += 3.5;
|
138216
|
-
}
|
138217
|
-
color = (color / 10.5) * 255;
|
138218
|
-
return [color, color, color];
|
138219
|
-
}
|
138220
|
-
const mult = (~~(args > 50) + 1) * 0.5;
|
138221
|
-
const r = (color & 1) * mult * 255;
|
138222
|
-
const g = ((color >> 1) & 1) * mult * 255;
|
138223
|
-
const b = ((color >> 2) & 1) * mult * 255;
|
138224
|
-
return [r, g, b];
|
138225
|
-
};
|
138226
|
-
convert.ansi256.rgb = function (args) {
|
138227
|
-
if (args >= 232) {
|
138228
|
-
const c = (args - 232) * 10 + 8;
|
138229
|
-
return [c, c, c];
|
138230
|
-
}
|
138231
|
-
args -= 16;
|
138232
|
-
let rem;
|
138233
|
-
const r = (Math.floor(args / 36) / 5) * 255;
|
138234
|
-
const g = (Math.floor((rem = args % 36) / 6) / 5) * 255;
|
138235
|
-
const b = ((rem % 6) / 5) * 255;
|
138236
|
-
return [r, g, b];
|
138237
|
-
};
|
138238
|
-
convert.rgb.hex = function (args) {
|
138239
|
-
const integer =
|
138240
|
-
((Math.round(args[0]) & 255) << 16) +
|
138241
|
-
((Math.round(args[1]) & 255) << 8) +
|
138242
|
-
(Math.round(args[2]) & 255);
|
138243
|
-
const string = integer.toString(16).toUpperCase();
|
138244
|
-
return '000000'.substring(string.length) + string;
|
138245
|
-
};
|
138246
|
-
convert.hex.rgb = function (args) {
|
138247
|
-
const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
|
138248
|
-
if (!match) {
|
138249
|
-
return [0, 0, 0];
|
138250
|
-
}
|
138251
|
-
let colorString = match[0];
|
138252
|
-
if (match[0].length === 3) {
|
138253
|
-
colorString = colorString
|
138254
|
-
.split('')
|
138255
|
-
.map(char => char + char)
|
138256
|
-
.join('');
|
138257
|
-
}
|
138258
|
-
const integer = parseInt(colorString, 16);
|
138259
|
-
const r = (integer >> 16) & 255;
|
138260
|
-
const g = (integer >> 8) & 255;
|
138261
|
-
const b = integer & 255;
|
138262
|
-
return [r, g, b];
|
138263
|
-
};
|
138264
|
-
convert.rgb.hcg = function (rgb) {
|
138265
|
-
const r = rgb[0] / 255;
|
138266
|
-
const g = rgb[1] / 255;
|
138267
|
-
const b = rgb[2] / 255;
|
138268
|
-
const max = Math.max(Math.max(r, g), b);
|
138269
|
-
const min = Math.min(Math.min(r, g), b);
|
138270
|
-
const chroma = max - min;
|
138271
|
-
let grayscale;
|
138272
|
-
let hue;
|
138273
|
-
if (chroma < 1) {
|
138274
|
-
grayscale = min / (1 - chroma);
|
138275
|
-
} else {
|
138276
|
-
grayscale = 0;
|
138277
|
-
}
|
138278
|
-
if (chroma <= 0) {
|
138279
|
-
hue = 0;
|
138280
|
-
} else if (max === r) {
|
138281
|
-
hue = ((g - b) / chroma) % 6;
|
138282
|
-
} else if (max === g) {
|
138283
|
-
hue = 2 + (b - r) / chroma;
|
138284
|
-
} else {
|
138285
|
-
hue = 4 + (r - g) / chroma;
|
138286
|
-
}
|
138287
|
-
hue /= 6;
|
138288
|
-
hue %= 1;
|
138289
|
-
return [hue * 360, chroma * 100, grayscale * 100];
|
138290
|
-
};
|
138291
|
-
convert.hsl.hcg = function (hsl) {
|
138292
|
-
const s = hsl[1] / 100;
|
138293
|
-
const l = hsl[2] / 100;
|
138294
|
-
const c = l < 0.5 ? 2 * s * l : 2 * s * (1 - l);
|
138295
|
-
let f = 0;
|
138296
|
-
if (c < 1) {
|
138297
|
-
f = (l - 0.5 * c) / (1 - c);
|
138298
|
-
}
|
138299
|
-
return [hsl[0], c * 100, f * 100];
|
138300
|
-
};
|
138301
|
-
convert.hsv.hcg = function (hsv) {
|
138302
|
-
const s = hsv[1] / 100;
|
138303
|
-
const v = hsv[2] / 100;
|
138304
|
-
const c = s * v;
|
138305
|
-
let f = 0;
|
138306
|
-
if (c < 1) {
|
138307
|
-
f = (v - c) / (1 - c);
|
138308
|
-
}
|
138309
|
-
return [hsv[0], c * 100, f * 100];
|
138310
|
-
};
|
138311
|
-
convert.hcg.rgb = function (hcg) {
|
138312
|
-
const h = hcg[0] / 360;
|
138313
|
-
const c = hcg[1] / 100;
|
138314
|
-
const g = hcg[2] / 100;
|
138315
|
-
if (c === 0) {
|
138316
|
-
return [g * 255, g * 255, g * 255];
|
138317
|
-
}
|
138318
|
-
const pure = [0, 0, 0];
|
138319
|
-
const hi = (h % 1) * 6;
|
138320
|
-
const v = hi % 1;
|
138321
|
-
const w = 1 - v;
|
138322
|
-
let mg = 0;
|
138323
|
-
switch (Math.floor(hi)) {
|
138324
|
-
case 0:
|
138325
|
-
pure[0] = 1;
|
138326
|
-
pure[1] = v;
|
138327
|
-
pure[2] = 0;
|
138328
|
-
break;
|
138329
|
-
case 1:
|
138330
|
-
pure[0] = w;
|
138331
|
-
pure[1] = 1;
|
138332
|
-
pure[2] = 0;
|
138333
|
-
break;
|
138334
|
-
case 2:
|
138335
|
-
pure[0] = 0;
|
138336
|
-
pure[1] = 1;
|
138337
|
-
pure[2] = v;
|
138338
|
-
break;
|
138339
|
-
case 3:
|
138340
|
-
pure[0] = 0;
|
138341
|
-
pure[1] = w;
|
138342
|
-
pure[2] = 1;
|
138343
|
-
break;
|
138344
|
-
case 4:
|
138345
|
-
pure[0] = v;
|
138346
|
-
pure[1] = 0;
|
138347
|
-
pure[2] = 1;
|
138348
|
-
break;
|
138349
|
-
default:
|
138350
|
-
pure[0] = 1;
|
138351
|
-
pure[1] = 0;
|
138352
|
-
pure[2] = w;
|
138353
|
-
}
|
138354
|
-
mg = (1 - c) * g;
|
138355
|
-
return [
|
138356
|
-
(c * pure[0] + mg) * 255,
|
138357
|
-
(c * pure[1] + mg) * 255,
|
138358
|
-
(c * pure[2] + mg) * 255,
|
138359
|
-
];
|
138360
|
-
};
|
138361
|
-
convert.hcg.hsv = function (hcg) {
|
138362
|
-
const c = hcg[1] / 100;
|
138363
|
-
const g = hcg[2] / 100;
|
138364
|
-
const v = c + g * (1 - c);
|
138365
|
-
let f = 0;
|
138366
|
-
if (v > 0) {
|
138367
|
-
f = c / v;
|
138368
|
-
}
|
138369
|
-
return [hcg[0], f * 100, v * 100];
|
138370
|
-
};
|
138371
|
-
convert.hcg.hsl = function (hcg) {
|
138372
|
-
const c = hcg[1] / 100;
|
138373
|
-
const g = hcg[2] / 100;
|
138374
|
-
const l = g * (1 - c) + 0.5 * c;
|
138375
|
-
let s = 0;
|
138376
|
-
if (l > 0 && l < 0.5) {
|
138377
|
-
s = c / (2 * l);
|
138378
|
-
} else if (l >= 0.5 && l < 1) {
|
138379
|
-
s = c / (2 * (1 - l));
|
138380
|
-
}
|
138381
|
-
return [hcg[0], s * 100, l * 100];
|
138382
|
-
};
|
138383
|
-
convert.hcg.hwb = function (hcg) {
|
138384
|
-
const c = hcg[1] / 100;
|
138385
|
-
const g = hcg[2] / 100;
|
138386
|
-
const v = c + g * (1 - c);
|
138387
|
-
return [hcg[0], (v - c) * 100, (1 - v) * 100];
|
138388
|
-
};
|
138389
|
-
convert.hwb.hcg = function (hwb) {
|
138390
|
-
const w = hwb[1] / 100;
|
138391
|
-
const b = hwb[2] / 100;
|
138392
|
-
const v = 1 - b;
|
138393
|
-
const c = v - w;
|
138394
|
-
let g = 0;
|
138395
|
-
if (c < 1) {
|
138396
|
-
g = (v - c) / (1 - c);
|
138397
|
-
}
|
138398
|
-
return [hwb[0], c * 100, g * 100];
|
138399
|
-
};
|
138400
|
-
convert.apple.rgb = function (apple) {
|
138401
|
-
return [
|
138402
|
-
(apple[0] / 65535) * 255,
|
138403
|
-
(apple[1] / 65535) * 255,
|
138404
|
-
(apple[2] / 65535) * 255,
|
138405
|
-
];
|
138406
|
-
};
|
138407
|
-
convert.rgb.apple = function (rgb) {
|
138408
|
-
return [
|
138409
|
-
(rgb[0] / 255) * 65535,
|
138410
|
-
(rgb[1] / 255) * 65535,
|
138411
|
-
(rgb[2] / 255) * 65535,
|
138412
|
-
];
|
138413
|
-
};
|
138414
|
-
convert.gray.rgb = function (args) {
|
138415
|
-
return [
|
138416
|
-
(args[0] / 100) * 255,
|
138417
|
-
(args[0] / 100) * 255,
|
138418
|
-
(args[0] / 100) * 255,
|
138419
|
-
];
|
138420
|
-
};
|
138421
|
-
convert.gray.hsl = function (args) {
|
138422
|
-
return [0, 0, args[0]];
|
138423
|
-
};
|
138424
|
-
convert.gray.hsv = convert.gray.hsl;
|
138425
|
-
convert.gray.hwb = function (gray) {
|
138426
|
-
return [0, 100, gray[0]];
|
138427
|
-
};
|
138428
|
-
convert.gray.cmyk = function (gray) {
|
138429
|
-
return [0, 0, 0, gray[0]];
|
138430
|
-
};
|
138431
|
-
convert.gray.lab = function (gray) {
|
138432
|
-
return [gray[0], 0, 0];
|
138433
|
-
};
|
138434
|
-
convert.gray.hex = function (gray) {
|
138435
|
-
const val = Math.round((gray[0] / 100) * 255) & 255;
|
138436
|
-
const integer = (val << 16) + (val << 8) + val;
|
138437
|
-
const string = integer.toString(16).toUpperCase();
|
138438
|
-
return '000000'.substring(string.length) + string;
|
138439
|
-
};
|
138440
|
-
convert.rgb.gray = function (rgb) {
|
138441
|
-
const val = (rgb[0] + rgb[1] + rgb[2]) / 3;
|
138442
|
-
return [(val / 255) * 100];
|
138443
|
-
};
|
138444
|
-
return conversions;
|
138445
|
-
}
|
138446
|
-
var route;
|
138447
|
-
var hasRequiredRoute;
|
138448
|
-
function requireRoute() {
|
138449
|
-
if (hasRequiredRoute) return route;
|
138450
|
-
hasRequiredRoute = 1;
|
138451
|
-
const conversions = requireConversions();
|
138452
|
-
function buildGraph() {
|
138453
|
-
const graph = {};
|
138454
|
-
const models = Object.keys(conversions);
|
138455
|
-
for (let len = models.length, i = 0; i < len; i++) {
|
138456
|
-
graph[models[i]] = {distance: -1, parent: null};
|
138457
|
-
}
|
138458
|
-
return graph;
|
138459
|
-
}
|
138460
|
-
function deriveBFS(fromModel) {
|
138461
|
-
const graph = buildGraph();
|
138462
|
-
const queue = [fromModel];
|
138463
|
-
graph[fromModel].distance = 0;
|
138464
|
-
while (queue.length) {
|
138465
|
-
const current = queue.pop();
|
138466
|
-
const adjacents = Object.keys(conversions[current]);
|
138467
|
-
for (let len = adjacents.length, i = 0; i < len; i++) {
|
138468
|
-
const adjacent = adjacents[i];
|
138469
|
-
const node = graph[adjacent];
|
138470
|
-
if (node.distance === -1) {
|
138471
|
-
node.distance = graph[current].distance + 1;
|
138472
|
-
node.parent = current;
|
138473
|
-
queue.unshift(adjacent);
|
138474
|
-
}
|
138475
|
-
}
|
138476
|
-
}
|
138477
|
-
return graph;
|
138478
|
-
}
|
138479
|
-
function link(from, to) {
|
138480
|
-
return function (args) {
|
138481
|
-
return to(from(args));
|
138482
|
-
};
|
138483
|
-
}
|
138484
|
-
function wrapConversion(toModel, graph) {
|
138485
|
-
const path = [graph[toModel].parent, toModel];
|
138486
|
-
let fn = conversions[graph[toModel].parent][toModel];
|
138487
|
-
let cur = graph[toModel].parent;
|
138488
|
-
while (graph[cur].parent) {
|
138489
|
-
path.unshift(graph[cur].parent);
|
138490
|
-
fn = link(conversions[graph[cur].parent][cur], fn);
|
138491
|
-
cur = graph[cur].parent;
|
138492
|
-
}
|
138493
|
-
fn.conversion = path;
|
138494
|
-
return fn;
|
138495
|
-
}
|
138496
|
-
route = function (fromModel) {
|
138497
|
-
const graph = deriveBFS(fromModel);
|
138498
|
-
const conversion = {};
|
138499
|
-
const models = Object.keys(graph);
|
138500
|
-
for (let len = models.length, i = 0; i < len; i++) {
|
138501
|
-
const toModel = models[i];
|
138502
|
-
const node = graph[toModel];
|
138503
|
-
if (node.parent === null) {
|
138504
|
-
continue;
|
138505
|
-
}
|
138506
|
-
conversion[toModel] = wrapConversion(toModel, graph);
|
138507
|
-
}
|
138508
|
-
return conversion;
|
138509
|
-
};
|
138510
|
-
return route;
|
138511
|
-
}
|
138512
|
-
var colorConvert;
|
138513
|
-
var hasRequiredColorConvert;
|
138514
|
-
function requireColorConvert() {
|
138515
|
-
if (hasRequiredColorConvert) return colorConvert;
|
138516
|
-
hasRequiredColorConvert = 1;
|
138517
|
-
const conversions = requireConversions();
|
138518
|
-
const route = requireRoute();
|
138519
|
-
const convert = {};
|
138520
|
-
const models = Object.keys(conversions);
|
138521
|
-
function wrapRaw(fn) {
|
138522
|
-
const wrappedFn = function (...args) {
|
138523
|
-
const arg0 = args[0];
|
138524
|
-
if (arg0 === undefined || arg0 === null) {
|
138525
|
-
return arg0;
|
138526
|
-
}
|
138527
|
-
if (arg0.length > 1) {
|
138528
|
-
args = arg0;
|
138529
|
-
}
|
138530
|
-
return fn(args);
|
138531
|
-
};
|
138532
|
-
if ('conversion' in fn) {
|
138533
|
-
wrappedFn.conversion = fn.conversion;
|
138534
|
-
}
|
138535
|
-
return wrappedFn;
|
138536
|
-
}
|
138537
|
-
function wrapRounded(fn) {
|
138538
|
-
const wrappedFn = function (...args) {
|
138539
|
-
const arg0 = args[0];
|
138540
|
-
if (arg0 === undefined || arg0 === null) {
|
138541
|
-
return arg0;
|
138542
|
-
}
|
138543
|
-
if (arg0.length > 1) {
|
138544
|
-
args = arg0;
|
138545
|
-
}
|
138546
|
-
const result = fn(args);
|
138547
|
-
if (typeof result === 'object') {
|
138548
|
-
for (let len = result.length, i = 0; i < len; i++) {
|
138549
|
-
result[i] = Math.round(result[i]);
|
138550
|
-
}
|
138551
|
-
}
|
138552
|
-
return result;
|
138553
|
-
};
|
138554
|
-
if ('conversion' in fn) {
|
138555
|
-
wrappedFn.conversion = fn.conversion;
|
138556
|
-
}
|
138557
|
-
return wrappedFn;
|
138558
|
-
}
|
138559
|
-
models.forEach(fromModel => {
|
138560
|
-
convert[fromModel] = {};
|
138561
|
-
Object.defineProperty(convert[fromModel], 'channels', {
|
138562
|
-
value: conversions[fromModel].channels,
|
138563
|
-
});
|
138564
|
-
Object.defineProperty(convert[fromModel], 'labels', {
|
138565
|
-
value: conversions[fromModel].labels,
|
138566
|
-
});
|
138567
|
-
const routes = route(fromModel);
|
138568
|
-
const routeModels = Object.keys(routes);
|
138569
|
-
routeModels.forEach(toModel => {
|
138570
|
-
const fn = routes[toModel];
|
138571
|
-
convert[fromModel][toModel] = wrapRounded(fn);
|
138572
|
-
convert[fromModel][toModel].raw = wrapRaw(fn);
|
138573
|
-
});
|
138574
|
-
});
|
138575
|
-
colorConvert = convert;
|
138576
|
-
return colorConvert;
|
138577
|
-
}
|
138578
|
-
ansiStyles$1.exports;
|
138579
|
-
(function (module) {
|
138580
|
-
const wrapAnsi16 =
|
138581
|
-
(fn, offset) =>
|
138582
|
-
(...args) => {
|
138583
|
-
const code = fn(...args);
|
138584
|
-
return `[${code + offset}m`;
|
138585
|
-
};
|
138586
|
-
const wrapAnsi256 =
|
138587
|
-
(fn, offset) =>
|
138588
|
-
(...args) => {
|
138589
|
-
const code = fn(...args);
|
138590
|
-
return `[${38 + offset};5;${code}m`;
|
138591
|
-
};
|
138592
|
-
const wrapAnsi16m =
|
138593
|
-
(fn, offset) =>
|
138594
|
-
(...args) => {
|
138595
|
-
const rgb = fn(...args);
|
138596
|
-
return `[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`;
|
138597
|
-
};
|
138598
|
-
const ansi2ansi = n => n;
|
138599
|
-
const rgb2rgb = (r, g, b) => [r, g, b];
|
138600
|
-
const setLazyProperty = (object, property, get) => {
|
138601
|
-
Object.defineProperty(object, property, {
|
138602
|
-
get: () => {
|
138603
|
-
const value = get();
|
138604
|
-
Object.defineProperty(object, property, {
|
138605
|
-
value: value,
|
138606
|
-
enumerable: true,
|
138607
|
-
configurable: true,
|
138608
|
-
});
|
138609
|
-
return value;
|
138610
|
-
},
|
138611
|
-
enumerable: true,
|
138612
|
-
configurable: true,
|
138613
|
-
});
|
138614
|
-
};
|
138615
|
-
let colorConvert;
|
138616
|
-
const makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => {
|
138617
|
-
if (colorConvert === undefined) {
|
138618
|
-
colorConvert = requireColorConvert();
|
138619
|
-
}
|
138620
|
-
const offset = isBackground ? 10 : 0;
|
138621
|
-
const styles = {};
|
138622
|
-
for (const [sourceSpace, suite] of Object.entries(colorConvert)) {
|
138623
|
-
const name = sourceSpace === 'ansi16' ? 'ansi' : sourceSpace;
|
138624
|
-
if (sourceSpace === targetSpace) {
|
138625
|
-
styles[name] = wrap(identity, offset);
|
138626
|
-
} else if (typeof suite === 'object') {
|
138627
|
-
styles[name] = wrap(suite[targetSpace], offset);
|
138628
|
-
}
|
138629
|
-
}
|
138630
|
-
return styles;
|
138631
|
-
};
|
138632
|
-
function assembleStyles() {
|
138633
|
-
const codes = new Map();
|
138634
|
-
const styles = {
|
138635
|
-
modifier: {
|
138636
|
-
reset: [0, 0],
|
138637
|
-
bold: [1, 22],
|
138638
|
-
dim: [2, 22],
|
138639
|
-
italic: [3, 23],
|
138640
|
-
underline: [4, 24],
|
138641
|
-
inverse: [7, 27],
|
138642
|
-
hidden: [8, 28],
|
138643
|
-
strikethrough: [9, 29],
|
138644
|
-
},
|
138645
|
-
color: {
|
138646
|
-
black: [30, 39],
|
138647
|
-
red: [31, 39],
|
138648
|
-
green: [32, 39],
|
138649
|
-
yellow: [33, 39],
|
138650
|
-
blue: [34, 39],
|
138651
|
-
magenta: [35, 39],
|
138652
|
-
cyan: [36, 39],
|
138653
|
-
white: [37, 39],
|
138654
|
-
blackBright: [90, 39],
|
138655
|
-
redBright: [91, 39],
|
138656
|
-
greenBright: [92, 39],
|
138657
|
-
yellowBright: [93, 39],
|
138658
|
-
blueBright: [94, 39],
|
138659
|
-
magentaBright: [95, 39],
|
138660
|
-
cyanBright: [96, 39],
|
138661
|
-
whiteBright: [97, 39],
|
138662
|
-
},
|
138663
|
-
bgColor: {
|
138664
|
-
bgBlack: [40, 49],
|
138665
|
-
bgRed: [41, 49],
|
138666
|
-
bgGreen: [42, 49],
|
138667
|
-
bgYellow: [43, 49],
|
138668
|
-
bgBlue: [44, 49],
|
138669
|
-
bgMagenta: [45, 49],
|
138670
|
-
bgCyan: [46, 49],
|
138671
|
-
bgWhite: [47, 49],
|
138672
|
-
bgBlackBright: [100, 49],
|
138673
|
-
bgRedBright: [101, 49],
|
138674
|
-
bgGreenBright: [102, 49],
|
138675
|
-
bgYellowBright: [103, 49],
|
138676
|
-
bgBlueBright: [104, 49],
|
138677
|
-
bgMagentaBright: [105, 49],
|
138678
|
-
bgCyanBright: [106, 49],
|
138679
|
-
bgWhiteBright: [107, 49],
|
138680
|
-
},
|
138681
|
-
};
|
138682
|
-
styles.color.gray = styles.color.blackBright;
|
138683
|
-
styles.bgColor.bgGray = styles.bgColor.bgBlackBright;
|
138684
|
-
styles.color.grey = styles.color.blackBright;
|
138685
|
-
styles.bgColor.bgGrey = styles.bgColor.bgBlackBright;
|
138686
|
-
for (const [groupName, group] of Object.entries(styles)) {
|
138687
|
-
for (const [styleName, style] of Object.entries(group)) {
|
138688
|
-
styles[styleName] = {open: `[${style[0]}m`, close: `[${style[1]}m`};
|
138689
|
-
group[styleName] = styles[styleName];
|
138690
|
-
codes.set(style[0], style[1]);
|
138691
|
-
}
|
138692
|
-
Object.defineProperty(styles, groupName, {
|
138693
|
-
value: group,
|
138694
|
-
enumerable: false,
|
138695
|
-
});
|
138696
|
-
}
|
138697
|
-
Object.defineProperty(styles, 'codes', {value: codes, enumerable: false});
|
138698
|
-
styles.color.close = '[39m';
|
138699
|
-
styles.bgColor.close = '[49m';
|
138700
|
-
setLazyProperty(styles.color, 'ansi', () =>
|
138701
|
-
makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, false)
|
138702
|
-
);
|
138703
|
-
setLazyProperty(styles.color, 'ansi256', () =>
|
138704
|
-
makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, false)
|
138705
|
-
);
|
138706
|
-
setLazyProperty(styles.color, 'ansi16m', () =>
|
138707
|
-
makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, false)
|
138708
|
-
);
|
138709
|
-
setLazyProperty(styles.bgColor, 'ansi', () =>
|
138710
|
-
makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, true)
|
138711
|
-
);
|
138712
|
-
setLazyProperty(styles.bgColor, 'ansi256', () =>
|
138713
|
-
makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, true)
|
138714
|
-
);
|
138715
|
-
setLazyProperty(styles.bgColor, 'ansi16m', () =>
|
138716
|
-
makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, true)
|
138717
|
-
);
|
138718
|
-
return styles;
|
138719
|
-
}
|
138720
|
-
Object.defineProperty(module, 'exports', {
|
138721
|
-
enumerable: true,
|
138722
|
-
get: assembleStyles,
|
138723
|
-
});
|
138724
|
-
})(ansiStyles$1);
|
138725
|
-
var ansiStylesExports = ansiStyles$1.exports;
|
138726
|
-
var hasFlag$1 = (flag, argv = process.argv) => {
|
138727
|
-
const prefix = flag.startsWith('-') ? '' : flag.length === 1 ? '-' : '--';
|
138728
|
-
const position = argv.indexOf(prefix + flag);
|
138729
|
-
const terminatorPosition = argv.indexOf('--');
|
138730
|
-
return (
|
138731
|
-
position !== -1 &&
|
138732
|
-
(terminatorPosition === -1 || position < terminatorPosition)
|
138733
|
-
);
|
138734
|
-
};
|
138735
|
-
const os = require$$0$3;
|
138736
|
-
const tty = require$$0$2;
|
138737
|
-
const hasFlag = hasFlag$1;
|
138738
|
-
const {env: env} = process;
|
138739
|
-
let forceColor;
|
138740
|
-
if (
|
138741
|
-
hasFlag('no-color') ||
|
138742
|
-
hasFlag('no-colors') ||
|
138743
|
-
hasFlag('color=false') ||
|
138744
|
-
hasFlag('color=never')
|
138745
|
-
) {
|
138746
|
-
forceColor = 0;
|
138747
|
-
} else if (
|
138748
|
-
hasFlag('color') ||
|
138749
|
-
hasFlag('colors') ||
|
138750
|
-
hasFlag('color=true') ||
|
138751
|
-
hasFlag('color=always')
|
138752
|
-
) {
|
138753
|
-
forceColor = 1;
|
138754
|
-
}
|
138755
|
-
if ('FORCE_COLOR' in env) {
|
138756
|
-
if (env.FORCE_COLOR === 'true') {
|
138757
|
-
forceColor = 1;
|
138758
|
-
} else if (env.FORCE_COLOR === 'false') {
|
138759
|
-
forceColor = 0;
|
138760
|
-
} else {
|
138761
|
-
forceColor =
|
138762
|
-
env.FORCE_COLOR.length === 0
|
138763
|
-
? 1
|
138764
|
-
: Math.min(parseInt(env.FORCE_COLOR, 10), 3);
|
138765
|
-
}
|
138766
|
-
}
|
138767
|
-
function translateLevel(level) {
|
138768
|
-
if (level === 0) {
|
138769
|
-
return false;
|
138770
|
-
}
|
138771
|
-
return {level: level, hasBasic: true, has256: level >= 2, has16m: level >= 3};
|
138772
|
-
}
|
138773
|
-
function supportsColor(haveStream, streamIsTTY) {
|
138774
|
-
if (forceColor === 0) {
|
138775
|
-
return 0;
|
138776
|
-
}
|
138777
|
-
if (
|
138778
|
-
hasFlag('color=16m') ||
|
138779
|
-
hasFlag('color=full') ||
|
138780
|
-
hasFlag('color=truecolor')
|
138781
|
-
) {
|
138782
|
-
return 3;
|
138783
|
-
}
|
138784
|
-
if (hasFlag('color=256')) {
|
138785
|
-
return 2;
|
138786
|
-
}
|
138787
|
-
if (haveStream && !streamIsTTY && forceColor === undefined) {
|
138788
|
-
return 0;
|
138789
|
-
}
|
138790
|
-
const min = forceColor || 0;
|
138791
|
-
if (env.TERM === 'dumb') {
|
138792
|
-
return min;
|
138793
|
-
}
|
138794
|
-
if (process.platform === 'win32') {
|
138795
|
-
const osRelease = os.release().split('.');
|
138796
|
-
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
138797
|
-
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
138798
|
-
}
|
138799
|
-
return 1;
|
138800
|
-
}
|
138801
|
-
if ('CI' in env) {
|
138802
|
-
if (
|
138803
|
-
[
|
138804
|
-
'TRAVIS',
|
138805
|
-
'CIRCLECI',
|
138806
|
-
'APPVEYOR',
|
138807
|
-
'GITLAB_CI',
|
138808
|
-
'GITHUB_ACTIONS',
|
138809
|
-
'BUILDKITE',
|
138810
|
-
].some(sign => sign in env) ||
|
138811
|
-
env.CI_NAME === 'codeship'
|
138812
|
-
) {
|
138813
|
-
return 1;
|
138814
|
-
}
|
138815
|
-
return min;
|
138816
|
-
}
|
138817
|
-
if ('TEAMCITY_VERSION' in env) {
|
138818
|
-
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
138819
|
-
}
|
138820
|
-
if (env.COLORTERM === 'truecolor') {
|
138821
|
-
return 3;
|
138822
|
-
}
|
138823
|
-
if ('TERM_PROGRAM' in env) {
|
138824
|
-
const version = parseInt(
|
138825
|
-
(env.TERM_PROGRAM_VERSION || '').split('.')[0],
|
138826
|
-
10
|
138827
|
-
);
|
138828
|
-
switch (env.TERM_PROGRAM) {
|
138829
|
-
case 'iTerm.app':
|
138830
|
-
return version >= 3 ? 3 : 2;
|
138831
|
-
case 'Apple_Terminal':
|
138832
|
-
return 2;
|
138833
|
-
}
|
138834
|
-
}
|
138835
|
-
if (/-256(color)?$/i.test(env.TERM)) {
|
138836
|
-
return 2;
|
138837
|
-
}
|
138838
|
-
if (
|
138839
|
-
/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)
|
138840
|
-
) {
|
138841
|
-
return 1;
|
138842
|
-
}
|
138843
|
-
if ('COLORTERM' in env) {
|
138844
|
-
return 1;
|
138845
|
-
}
|
138846
|
-
return min;
|
138847
|
-
}
|
138848
|
-
function getSupportLevel(stream) {
|
138849
|
-
const level = supportsColor(stream, stream && stream.isTTY);
|
138850
|
-
return translateLevel(level);
|
138851
|
-
}
|
138852
|
-
var supportsColor_1 = {
|
138853
|
-
supportsColor: getSupportLevel,
|
138854
|
-
stdout: translateLevel(supportsColor(true, tty.isatty(1))),
|
138855
|
-
stderr: translateLevel(supportsColor(true, tty.isatty(2))),
|
138856
|
-
};
|
138857
|
-
const stringReplaceAll$1 = (string, substring, replacer) => {
|
138858
|
-
let index = string.indexOf(substring);
|
138859
|
-
if (index === -1) {
|
138860
|
-
return string;
|
138861
|
-
}
|
138862
|
-
const substringLength = substring.length;
|
138863
|
-
let endIndex = 0;
|
138864
|
-
let returnValue = '';
|
138865
|
-
do {
|
138866
|
-
returnValue +=
|
138867
|
-
string.substr(endIndex, index - endIndex) + substring + replacer;
|
138868
|
-
endIndex = index + substringLength;
|
138869
|
-
index = string.indexOf(substring, endIndex);
|
138870
|
-
} while (index !== -1);
|
138871
|
-
returnValue += string.substr(endIndex);
|
138872
|
-
return returnValue;
|
138873
|
-
};
|
138874
|
-
const stringEncaseCRLFWithFirstIndex$1 = (string, prefix, postfix, index) => {
|
138875
|
-
let endIndex = 0;
|
138876
|
-
let returnValue = '';
|
138877
|
-
do {
|
138878
|
-
const gotCR = string[index - 1] === '\r';
|
138879
|
-
returnValue +=
|
138880
|
-
string.substr(endIndex, (gotCR ? index - 1 : index) - endIndex) +
|
138881
|
-
prefix +
|
138882
|
-
(gotCR ? '\r\n' : '\n') +
|
138883
|
-
postfix;
|
138884
|
-
endIndex = index + 1;
|
138885
|
-
index = string.indexOf('\n', endIndex);
|
138886
|
-
} while (index !== -1);
|
138887
|
-
returnValue += string.substr(endIndex);
|
138888
|
-
return returnValue;
|
138889
|
-
};
|
138890
|
-
var util = {
|
138891
|
-
stringReplaceAll: stringReplaceAll$1,
|
138892
|
-
stringEncaseCRLFWithFirstIndex: stringEncaseCRLFWithFirstIndex$1,
|
138893
|
-
};
|
138894
|
-
var templates;
|
138895
|
-
var hasRequiredTemplates;
|
138896
|
-
function requireTemplates() {
|
138897
|
-
if (hasRequiredTemplates) return templates;
|
138898
|
-
hasRequiredTemplates = 1;
|
138899
|
-
const TEMPLATE_REGEX =
|
138900
|
-
/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi;
|
138901
|
-
const STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
|
138902
|
-
const STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;
|
138903
|
-
const ESCAPE_REGEX =
|
138904
|
-
/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi;
|
138905
|
-
const ESCAPES = new Map([
|
138906
|
-
['n', '\n'],
|
138907
|
-
['r', '\r'],
|
138908
|
-
['t', '\t'],
|
138909
|
-
['b', '\b'],
|
138910
|
-
['f', '\f'],
|
138911
|
-
['v', '\v'],
|
138912
|
-
['0', '\0'],
|
138913
|
-
['\\', '\\'],
|
138914
|
-
['e', ''],
|
138915
|
-
['a', ''],
|
138916
|
-
]);
|
138917
|
-
function unescape(c) {
|
138918
|
-
const u = c[0] === 'u';
|
138919
|
-
const bracket = c[1] === '{';
|
138920
|
-
if ((u && !bracket && c.length === 5) || (c[0] === 'x' && c.length === 3)) {
|
138921
|
-
return String.fromCharCode(parseInt(c.slice(1), 16));
|
138922
|
-
}
|
138923
|
-
if (u && bracket) {
|
138924
|
-
return String.fromCodePoint(parseInt(c.slice(2, -1), 16));
|
138925
|
-
}
|
138926
|
-
return ESCAPES.get(c) || c;
|
138927
|
-
}
|
138928
|
-
function parseArguments(name, arguments_) {
|
138929
|
-
const results = [];
|
138930
|
-
const chunks = arguments_.trim().split(/\s*,\s*/g);
|
138931
|
-
let matches;
|
138932
|
-
for (const chunk of chunks) {
|
138933
|
-
const number = Number(chunk);
|
138934
|
-
if (!Number.isNaN(number)) {
|
138935
|
-
results.push(number);
|
138936
|
-
} else if ((matches = chunk.match(STRING_REGEX))) {
|
138937
|
-
results.push(
|
138938
|
-
matches[2].replace(ESCAPE_REGEX, (m, escape, character) =>
|
138939
|
-
escape ? unescape(escape) : character
|
138940
|
-
)
|
138941
|
-
);
|
138942
|
-
} else {
|
138943
|
-
throw new Error(
|
138944
|
-
`Invalid Chalk template style argument: ${chunk} (in style '${name}')`
|
138945
|
-
);
|
138946
|
-
}
|
138947
|
-
}
|
138948
|
-
return results;
|
138949
|
-
}
|
138950
|
-
function parseStyle(style) {
|
138951
|
-
STYLE_REGEX.lastIndex = 0;
|
138952
|
-
const results = [];
|
138953
|
-
let matches;
|
138954
|
-
while ((matches = STYLE_REGEX.exec(style)) !== null) {
|
138955
|
-
const name = matches[1];
|
138956
|
-
if (matches[2]) {
|
138957
|
-
const args = parseArguments(name, matches[2]);
|
138958
|
-
results.push([name].concat(args));
|
138959
|
-
} else {
|
138960
|
-
results.push([name]);
|
138961
|
-
}
|
138962
|
-
}
|
138963
|
-
return results;
|
138964
|
-
}
|
138965
|
-
function buildStyle(chalk, styles) {
|
138966
|
-
const enabled = {};
|
138967
|
-
for (const layer of styles) {
|
138968
|
-
for (const style of layer.styles) {
|
138969
|
-
enabled[style[0]] = layer.inverse ? null : style.slice(1);
|
138970
|
-
}
|
138971
|
-
}
|
138972
|
-
let current = chalk;
|
138973
|
-
for (const [styleName, styles] of Object.entries(enabled)) {
|
138974
|
-
if (!Array.isArray(styles)) {
|
138975
|
-
continue;
|
138976
|
-
}
|
138977
|
-
if (!(styleName in current)) {
|
138978
|
-
throw new Error(`Unknown Chalk style: ${styleName}`);
|
138979
|
-
}
|
138980
|
-
current =
|
138981
|
-
styles.length > 0 ? current[styleName](...styles) : current[styleName];
|
138982
|
-
}
|
138983
|
-
return current;
|
138984
|
-
}
|
138985
|
-
templates = (chalk, temporary) => {
|
138986
|
-
const styles = [];
|
138987
|
-
const chunks = [];
|
138988
|
-
let chunk = [];
|
138989
|
-
temporary.replace(
|
138990
|
-
TEMPLATE_REGEX,
|
138991
|
-
(m, escapeCharacter, inverse, style, close, character) => {
|
138992
|
-
if (escapeCharacter) {
|
138993
|
-
chunk.push(unescape(escapeCharacter));
|
138994
|
-
} else if (style) {
|
138995
|
-
const string = chunk.join('');
|
138996
|
-
chunk = [];
|
138997
|
-
chunks.push(
|
138998
|
-
styles.length === 0 ? string : buildStyle(chalk, styles)(string)
|
138999
|
-
);
|
139000
|
-
styles.push({inverse: inverse, styles: parseStyle(style)});
|
139001
|
-
} else if (close) {
|
139002
|
-
if (styles.length === 0) {
|
139003
|
-
throw new Error('Found extraneous } in Chalk template literal');
|
139004
|
-
}
|
139005
|
-
chunks.push(buildStyle(chalk, styles)(chunk.join('')));
|
139006
|
-
chunk = [];
|
139007
|
-
styles.pop();
|
139008
|
-
} else {
|
139009
|
-
chunk.push(character);
|
139010
|
-
}
|
139011
|
-
}
|
139012
|
-
);
|
139013
|
-
chunks.push(chunk.join(''));
|
139014
|
-
if (styles.length > 0) {
|
139015
|
-
const errMessage = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? '' : 's'} (\`}\`)`;
|
139016
|
-
throw new Error(errMessage);
|
139017
|
-
}
|
139018
|
-
return chunks.join('');
|
139019
|
-
};
|
139020
|
-
return templates;
|
139021
|
-
}
|
139022
|
-
const ansiStyles = ansiStylesExports;
|
139023
|
-
const {stdout: stdoutColor, stderr: stderrColor} = supportsColor_1;
|
139024
|
-
const {
|
139025
|
-
stringReplaceAll: stringReplaceAll,
|
139026
|
-
stringEncaseCRLFWithFirstIndex: stringEncaseCRLFWithFirstIndex,
|
139027
|
-
} = util;
|
139028
|
-
const {isArray: isArray} = Array;
|
139029
|
-
const levelMapping = ['ansi', 'ansi', 'ansi256', 'ansi16m'];
|
139030
|
-
const styles = Object.create(null);
|
139031
|
-
const applyOptions = (object, options = {}) => {
|
139032
|
-
if (
|
139033
|
-
options.level &&
|
139034
|
-
!(
|
139035
|
-
Number.isInteger(options.level) &&
|
139036
|
-
options.level >= 0 &&
|
139037
|
-
options.level <= 3
|
139038
|
-
)
|
139039
|
-
) {
|
139040
|
-
throw new Error('The `level` option should be an integer from 0 to 3');
|
139041
|
-
}
|
139042
|
-
const colorLevel = stdoutColor ? stdoutColor.level : 0;
|
139043
|
-
object.level = options.level === undefined ? colorLevel : options.level;
|
139044
|
-
};
|
139045
|
-
class ChalkClass {
|
139046
|
-
constructor(options) {
|
139047
|
-
return chalkFactory(options);
|
139048
|
-
}
|
139049
|
-
}
|
139050
|
-
const chalkFactory = options => {
|
139051
|
-
const chalk = {};
|
139052
|
-
applyOptions(chalk, options);
|
139053
|
-
chalk.template = (...arguments_) => chalkTag(chalk.template, ...arguments_);
|
139054
|
-
Object.setPrototypeOf(chalk, Chalk.prototype);
|
139055
|
-
Object.setPrototypeOf(chalk.template, chalk);
|
139056
|
-
chalk.template.constructor = () => {
|
139057
|
-
throw new Error(
|
139058
|
-
'`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.'
|
139059
|
-
);
|
139060
|
-
};
|
139061
|
-
chalk.template.Instance = ChalkClass;
|
139062
|
-
return chalk.template;
|
139063
|
-
};
|
139064
|
-
function Chalk(options) {
|
139065
|
-
return chalkFactory(options);
|
139066
|
-
}
|
139067
|
-
for (const [styleName, style] of Object.entries(ansiStyles)) {
|
139068
|
-
styles[styleName] = {
|
139069
|
-
get() {
|
139070
|
-
const builder = createBuilder(
|
139071
|
-
this,
|
139072
|
-
createStyler(style.open, style.close, this._styler),
|
139073
|
-
this._isEmpty
|
139074
|
-
);
|
139075
|
-
Object.defineProperty(this, styleName, {value: builder});
|
139076
|
-
return builder;
|
139077
|
-
},
|
139078
|
-
};
|
139079
|
-
}
|
139080
|
-
styles.visible = {
|
139081
|
-
get() {
|
139082
|
-
const builder = createBuilder(this, this._styler, true);
|
139083
|
-
Object.defineProperty(this, 'visible', {value: builder});
|
139084
|
-
return builder;
|
139085
|
-
},
|
139086
|
-
};
|
139087
|
-
const usedModels = [
|
139088
|
-
'rgb',
|
139089
|
-
'hex',
|
139090
|
-
'keyword',
|
139091
|
-
'hsl',
|
139092
|
-
'hsv',
|
139093
|
-
'hwb',
|
139094
|
-
'ansi',
|
139095
|
-
'ansi256',
|
139096
|
-
];
|
139097
|
-
for (const model of usedModels) {
|
139098
|
-
styles[model] = {
|
139099
|
-
get() {
|
139100
|
-
const {level: level} = this;
|
139101
|
-
return function (...arguments_) {
|
139102
|
-
const styler = createStyler(
|
139103
|
-
ansiStyles.color[levelMapping[level]][model](...arguments_),
|
139104
|
-
ansiStyles.color.close,
|
139105
|
-
this._styler
|
139106
|
-
);
|
139107
|
-
return createBuilder(this, styler, this._isEmpty);
|
139108
|
-
};
|
139109
|
-
},
|
139110
|
-
};
|
139111
|
-
}
|
139112
|
-
for (const model of usedModels) {
|
139113
|
-
const bgModel = 'bg' + model[0].toUpperCase() + model.slice(1);
|
139114
|
-
styles[bgModel] = {
|
139115
|
-
get() {
|
139116
|
-
const {level: level} = this;
|
139117
|
-
return function (...arguments_) {
|
139118
|
-
const styler = createStyler(
|
139119
|
-
ansiStyles.bgColor[levelMapping[level]][model](...arguments_),
|
139120
|
-
ansiStyles.bgColor.close,
|
139121
|
-
this._styler
|
139122
|
-
);
|
139123
|
-
return createBuilder(this, styler, this._isEmpty);
|
139124
|
-
};
|
139125
|
-
},
|
139126
|
-
};
|
139127
|
-
}
|
139128
|
-
const proto = Object.defineProperties(() => {}, {
|
139129
|
-
...styles,
|
139130
|
-
level: {
|
139131
|
-
enumerable: true,
|
139132
|
-
get() {
|
139133
|
-
return this._generator.level;
|
139134
|
-
},
|
139135
|
-
set(level) {
|
139136
|
-
this._generator.level = level;
|
139137
|
-
},
|
139138
|
-
},
|
139139
|
-
});
|
139140
|
-
const createStyler = (open, close, parent) => {
|
139141
|
-
let openAll;
|
139142
|
-
let closeAll;
|
139143
|
-
if (parent === undefined) {
|
139144
|
-
openAll = open;
|
139145
|
-
closeAll = close;
|
139146
|
-
} else {
|
139147
|
-
openAll = parent.openAll + open;
|
139148
|
-
closeAll = close + parent.closeAll;
|
139149
|
-
}
|
139150
|
-
return {
|
139151
|
-
open: open,
|
139152
|
-
close: close,
|
139153
|
-
openAll: openAll,
|
139154
|
-
closeAll: closeAll,
|
139155
|
-
parent: parent,
|
139156
|
-
};
|
139157
|
-
};
|
139158
|
-
const createBuilder = (self, _styler, _isEmpty) => {
|
139159
|
-
const builder = (...arguments_) => {
|
139160
|
-
if (isArray(arguments_[0]) && isArray(arguments_[0].raw)) {
|
139161
|
-
return applyStyle(builder, chalkTag(builder, ...arguments_));
|
139162
|
-
}
|
139163
|
-
return applyStyle(
|
139164
|
-
builder,
|
139165
|
-
arguments_.length === 1 ? '' + arguments_[0] : arguments_.join(' ')
|
139166
|
-
);
|
139167
|
-
};
|
139168
|
-
Object.setPrototypeOf(builder, proto);
|
139169
|
-
builder._generator = self;
|
139170
|
-
builder._styler = _styler;
|
139171
|
-
builder._isEmpty = _isEmpty;
|
139172
|
-
return builder;
|
139173
|
-
};
|
139174
|
-
const applyStyle = (self, string) => {
|
139175
|
-
if (self.level <= 0 || !string) {
|
139176
|
-
return self._isEmpty ? '' : string;
|
139177
|
-
}
|
139178
|
-
let styler = self._styler;
|
139179
|
-
if (styler === undefined) {
|
139180
|
-
return string;
|
139181
|
-
}
|
139182
|
-
const {openAll: openAll, closeAll: closeAll} = styler;
|
139183
|
-
if (string.indexOf('') !== -1) {
|
139184
|
-
while (styler !== undefined) {
|
139185
|
-
string = stringReplaceAll(string, styler.close, styler.open);
|
139186
|
-
styler = styler.parent;
|
139187
|
-
}
|
139188
|
-
}
|
139189
|
-
const lfIndex = string.indexOf('\n');
|
139190
|
-
if (lfIndex !== -1) {
|
139191
|
-
string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
|
139192
|
-
}
|
139193
|
-
return openAll + string + closeAll;
|
139194
|
-
};
|
139195
|
-
let template;
|
139196
|
-
const chalkTag = (chalk, ...strings) => {
|
139197
|
-
const [firstString] = strings;
|
139198
|
-
if (!isArray(firstString) || !isArray(firstString.raw)) {
|
139199
|
-
return strings.join(' ');
|
139200
|
-
}
|
139201
|
-
const arguments_ = strings.slice(1);
|
139202
|
-
const parts = [firstString.raw[0]];
|
139203
|
-
for (let i = 1; i < firstString.length; i++) {
|
139204
|
-
parts.push(
|
139205
|
-
String(arguments_[i - 1]).replace(/[{}\\]/g, '\\$&'),
|
139206
|
-
String(firstString.raw[i])
|
139207
|
-
);
|
139208
|
-
}
|
139209
|
-
if (template === undefined) {
|
139210
|
-
template = requireTemplates();
|
139211
|
-
}
|
139212
|
-
return template(chalk, parts.join(''));
|
139213
|
-
};
|
139214
|
-
Object.defineProperties(Chalk.prototype, styles);
|
139215
|
-
const chalk = Chalk();
|
139216
|
-
chalk.supportsColor = stdoutColor;
|
139217
|
-
chalk.stderr = Chalk({level: stderrColor ? stderrColor.level : 0});
|
139218
|
-
chalk.stderr.supportsColor = stderrColor;
|
139219
|
-
function logDebug(step, value) {}
|
139220
|
-
function logCodegenFunction(step, fn) {}
|
139221
|
-
function logHIRFunction(step, fn) {}
|
139222
|
-
function logReactiveFunction(step, fn) {}
|
139223
137637
|
function inferReactiveScopeVariables(fn) {
|
137638
|
+
var _a, _b;
|
139224
137639
|
const scopeIdentifiers = findDisjointMutableValues(fn);
|
139225
137640
|
const scopes = new Map();
|
139226
137641
|
scopeIdentifiers.forEach((identifier, groupIdentifier) => {
|
@@ -139269,6 +137684,16 @@ function inferReactiveScopeVariables(fn) {
|
|
139269
137684
|
maxInstruction === 0 ||
|
139270
137685
|
scope.range.end > maxInstruction + 1
|
139271
137686
|
) {
|
137687
|
+
(_b =
|
137688
|
+
(_a = fn.env.logger) === null || _a === void 0
|
137689
|
+
? void 0
|
137690
|
+
: _a.debugLogIRs) === null || _b === void 0
|
137691
|
+
? void 0
|
137692
|
+
: _b.call(_a, {
|
137693
|
+
kind: 'hir',
|
137694
|
+
name: 'InferReactiveScopeVariables (invalid scope)',
|
137695
|
+
value: fn,
|
137696
|
+
});
|
139272
137697
|
CompilerError.invariant(false, {
|
139273
137698
|
reason: `Invalid mutable range for scope`,
|
139274
137699
|
loc: GeneratedSource,
|
@@ -146425,7 +144850,7 @@ function mergeReactiveScopesThatInvalidateTogether(fn) {
|
|
146425
144850
|
visitReactiveFunction(fn, lastUsageVisitor, undefined);
|
146426
144851
|
visitReactiveFunction(fn, new Transform$4(lastUsageVisitor.lastUsage), null);
|
146427
144852
|
}
|
146428
|
-
function log
|
144853
|
+
function log(msg) {}
|
146429
144854
|
class FindLastUsageVisitor extends ReactiveFunctionVisitor {
|
146430
144855
|
constructor() {
|
146431
144856
|
super(...arguments);
|
@@ -146478,7 +144903,7 @@ let Transform$4 = class Transform extends ReactiveFunctionTransform {
|
|
146478
144903
|
switch (instr.kind) {
|
146479
144904
|
case 'terminal': {
|
146480
144905
|
if (current !== null) {
|
146481
|
-
log
|
144906
|
+
log(
|
146482
144907
|
`Reset scope @${current.block.scope.id} from terminal [${instr.terminal.id}]`
|
146483
144908
|
);
|
146484
144909
|
reset();
|
@@ -146487,7 +144912,7 @@ let Transform$4 = class Transform extends ReactiveFunctionTransform {
|
|
146487
144912
|
}
|
146488
144913
|
case 'pruned-scope': {
|
146489
144914
|
if (current !== null) {
|
146490
|
-
log
|
144915
|
+
log(
|
146491
144916
|
`Reset scope @${current.block.scope.id} from pruned scope @${instr.scope.id}`
|
146492
144917
|
);
|
146493
144918
|
reset();
|
@@ -146523,7 +144948,7 @@ let Transform$4 = class Transform extends ReactiveFunctionTransform {
|
|
146523
144948
|
current.lvalues.add(lvalue.identifier.declarationId);
|
146524
144949
|
}
|
146525
144950
|
} else {
|
146526
|
-
log
|
144951
|
+
log(
|
146527
144952
|
`Reset scope @${current.block.scope.id} from StoreLocal in [${instr.instruction.id}]`
|
146528
144953
|
);
|
146529
144954
|
reset();
|
@@ -146533,7 +144958,7 @@ let Transform$4 = class Transform extends ReactiveFunctionTransform {
|
|
146533
144958
|
}
|
146534
144959
|
default: {
|
146535
144960
|
if (current !== null) {
|
146536
|
-
log
|
144961
|
+
log(
|
146537
144962
|
`Reset scope @${current.block.scope.id} from instruction [${instr.instruction.id}]`
|
146538
144963
|
);
|
146539
144964
|
reset();
|
@@ -146552,7 +144977,7 @@ let Transform$4 = class Transform extends ReactiveFunctionTransform {
|
|
146552
144977
|
this.lastUsage
|
146553
144978
|
)
|
146554
144979
|
) {
|
146555
|
-
log
|
144980
|
+
log(
|
146556
144981
|
`Can merge scope @${current.block.scope.id} with @${instr.scope.id}`
|
146557
144982
|
);
|
146558
144983
|
current.block.scope.range.end = makeInstructionId(
|
@@ -146565,14 +144990,14 @@ let Transform$4 = class Transform extends ReactiveFunctionTransform {
|
|
146565
144990
|
current.to = i + 1;
|
146566
144991
|
current.lvalues.clear();
|
146567
144992
|
if (!scopeIsEligibleForMerging(instr)) {
|
146568
|
-
log
|
144993
|
+
log(
|
146569
144994
|
` but scope @${instr.scope.id} doesnt guaranteed invalidate so it cannot merge further`
|
146570
144995
|
);
|
146571
144996
|
reset();
|
146572
144997
|
}
|
146573
144998
|
} else {
|
146574
144999
|
if (current !== null) {
|
146575
|
-
log
|
145000
|
+
log(
|
146576
145001
|
`Reset scope @${current.block.scope.id}, not mergeable with subsequent scope @${instr.scope.id}`
|
146577
145002
|
);
|
146578
145003
|
reset();
|
@@ -146580,7 +145005,7 @@ let Transform$4 = class Transform extends ReactiveFunctionTransform {
|
|
146580
145005
|
if (scopeIsEligibleForMerging(instr)) {
|
146581
145006
|
current = {block: instr, from: i, to: i + 1, lvalues: new Set()};
|
146582
145007
|
} else {
|
146583
|
-
log
|
145008
|
+
log(
|
146584
145009
|
`scope @${instr.scope.id} doesnt guaranteed invalidate so it cannot merge further`
|
146585
145010
|
);
|
146586
145011
|
}
|
@@ -146599,9 +145024,9 @@ let Transform$4 = class Transform extends ReactiveFunctionTransform {
|
|
146599
145024
|
reset();
|
146600
145025
|
}
|
146601
145026
|
if (merged.length) {
|
146602
|
-
log
|
145027
|
+
log(`merged ${merged.length} scopes:`);
|
146603
145028
|
for (const entry of merged) {
|
146604
|
-
log
|
145029
|
+
log(
|
146605
145030
|
printReactiveScopeSummary(entry.block.scope) +
|
146606
145031
|
` from=${entry.from} to=${entry.to}`
|
146607
145032
|
);
|
@@ -146656,7 +145081,7 @@ function areLValuesLastUsedByScope(scope, lvalues, lastUsage) {
|
|
146656
145081
|
for (const lvalue of lvalues) {
|
146657
145082
|
const lastUsedAt = lastUsage.get(lvalue);
|
146658
145083
|
if (lastUsedAt >= scope.range.end) {
|
146659
|
-
log
|
145084
|
+
log(` lvalue ${lvalue} used after scope @${scope.id}, cannot merge`);
|
146660
145085
|
return false;
|
146661
145086
|
}
|
146662
145087
|
}
|
@@ -146697,8 +145122,8 @@ function canMergeScopes(current, next) {
|
|
146697
145122
|
) {
|
146698
145123
|
return true;
|
146699
145124
|
}
|
146700
|
-
log
|
146701
|
-
log
|
145125
|
+
log(` ${printReactiveScopeSummary(current.scope)}`);
|
145126
|
+
log(` ${printReactiveScopeSummary(next.scope)}`);
|
146702
145127
|
return false;
|
146703
145128
|
}
|
146704
145129
|
function isAlwaysInvalidatingType(type) {
|
@@ -150802,6 +149227,7 @@ function analyseFunctions(func) {
|
|
150802
149227
|
}
|
150803
149228
|
}
|
150804
149229
|
function lower(func) {
|
149230
|
+
var _a, _b;
|
150805
149231
|
analyseFunctions(func);
|
150806
149232
|
inferReferenceEffects(func, {isFunctionExpression: true});
|
150807
149233
|
deadCodeElimination(func);
|
@@ -150809,6 +149235,12 @@ function lower(func) {
|
|
150809
149235
|
rewriteInstructionKindsBasedOnReassignment(func);
|
150810
149236
|
inferReactiveScopeVariables(func);
|
150811
149237
|
inferMutableContextVariables(func);
|
149238
|
+
(_b =
|
149239
|
+
(_a = func.env.logger) === null || _a === void 0
|
149240
|
+
? void 0
|
149241
|
+
: _a.debugLogIRs) === null || _b === void 0
|
149242
|
+
? void 0
|
149243
|
+
: _b.call(_a, {kind: 'hir', name: 'AnalyseFunction (inner)', value: func});
|
150812
149244
|
}
|
150813
149245
|
function infer(loweredFunc, state, context) {
|
150814
149246
|
const mutations = new Map();
|
@@ -156368,6 +154800,8 @@ var _Context_instances,
|
|
156368
154800
|
_Context_dependencies,
|
156369
154801
|
_Context_temporaries,
|
156370
154802
|
_Context_temporariesUsedOutsideScope,
|
154803
|
+
_Context_processedInstrsInOptional,
|
154804
|
+
_Context_innerFnContext,
|
156371
154805
|
_Context_checkValidDependency,
|
156372
154806
|
_Context_isScopeActive;
|
156373
154807
|
function propagateScopeDependenciesHIR(fn) {
|
@@ -156477,24 +154911,43 @@ function collectTemporariesSidemap(fn, usedOutsideDeclaringScope) {
|
|
156477
154911
|
fn,
|
156478
154912
|
usedOutsideDeclaringScope,
|
156479
154913
|
temporaries,
|
156480
|
-
|
154914
|
+
null
|
156481
154915
|
);
|
156482
154916
|
return temporaries;
|
156483
154917
|
}
|
154918
|
+
function isLoadContextMutable(instrValue, id) {
|
154919
|
+
if (instrValue.kind === 'LoadContext') {
|
154920
|
+
CompilerError.invariant(instrValue.place.identifier.scope != null, {
|
154921
|
+
reason:
|
154922
|
+
'[PropagateScopeDependencies] Expected all context variables to be assigned a scope',
|
154923
|
+
loc: instrValue.loc,
|
154924
|
+
});
|
154925
|
+
return id >= instrValue.place.identifier.scope.range.end;
|
154926
|
+
}
|
154927
|
+
return false;
|
154928
|
+
}
|
156484
154929
|
function collectTemporariesSidemapImpl(
|
156485
154930
|
fn,
|
156486
154931
|
usedOutsideDeclaringScope,
|
156487
154932
|
temporaries,
|
156488
|
-
|
154933
|
+
innerFnContext
|
156489
154934
|
) {
|
156490
154935
|
for (const [_, block] of fn.body.blocks) {
|
156491
|
-
for (const
|
156492
|
-
|
154936
|
+
for (const {
|
154937
|
+
value: value,
|
154938
|
+
lvalue: lvalue,
|
154939
|
+
id: origInstrId,
|
154940
|
+
} of block.instructions) {
|
154941
|
+
const instrId =
|
154942
|
+
innerFnContext != null ? innerFnContext.instrId : origInstrId;
|
156493
154943
|
const usedOutside = usedOutsideDeclaringScope.has(
|
156494
154944
|
lvalue.identifier.declarationId
|
156495
154945
|
);
|
156496
154946
|
if (value.kind === 'PropertyLoad' && !usedOutside) {
|
156497
|
-
if (
|
154947
|
+
if (
|
154948
|
+
innerFnContext == null ||
|
154949
|
+
temporaries.has(value.object.identifier.id)
|
154950
|
+
) {
|
156498
154951
|
const property = getProperty(
|
156499
154952
|
value.object,
|
156500
154953
|
value.property,
|
@@ -156504,13 +154957,13 @@ function collectTemporariesSidemapImpl(
|
|
156504
154957
|
temporaries.set(lvalue.identifier.id, property);
|
156505
154958
|
}
|
156506
154959
|
} else if (
|
156507
|
-
value.kind === 'LoadLocal' &&
|
154960
|
+
(value.kind === 'LoadLocal' || isLoadContextMutable(value, instrId)) &&
|
156508
154961
|
lvalue.identifier.name == null &&
|
156509
154962
|
value.place.identifier.name !== null &&
|
156510
154963
|
!usedOutside
|
156511
154964
|
) {
|
156512
154965
|
if (
|
156513
|
-
|
154966
|
+
innerFnContext == null ||
|
156514
154967
|
fn.context.some(
|
156515
154968
|
context => context.identifier.id === value.place.identifier.id
|
156516
154969
|
)
|
@@ -156528,7 +154981,9 @@ function collectTemporariesSidemapImpl(
|
|
156528
154981
|
value.loweredFunc.func,
|
156529
154982
|
usedOutsideDeclaringScope,
|
156530
154983
|
temporaries,
|
156531
|
-
|
154984
|
+
innerFnContext !== null && innerFnContext !== void 0
|
154985
|
+
? innerFnContext
|
154986
|
+
: {instrId: instrId}
|
156532
154987
|
);
|
156533
154988
|
}
|
156534
154989
|
}
|
@@ -156554,7 +155009,11 @@ function getProperty(object, propertyName, optional, temporaries) {
|
|
156554
155009
|
return property;
|
156555
155010
|
}
|
156556
155011
|
class Context {
|
156557
|
-
constructor(
|
155012
|
+
constructor(
|
155013
|
+
temporariesUsedOutsideScope,
|
155014
|
+
temporaries,
|
155015
|
+
processedInstrsInOptional
|
155016
|
+
) {
|
156558
155017
|
_Context_instances.add(this);
|
156559
155018
|
_Context_declarations.set(this, new Map());
|
156560
155019
|
_Context_reassignments.set(this, new Map());
|
@@ -156563,7 +155022,8 @@ class Context {
|
|
156563
155022
|
this.deps = new Map();
|
156564
155023
|
_Context_temporaries.set(this, void 0);
|
156565
155024
|
_Context_temporariesUsedOutsideScope.set(this, void 0);
|
156566
|
-
this
|
155025
|
+
_Context_processedInstrsInOptional.set(this, void 0);
|
155026
|
+
_Context_innerFnContext.set(this, null);
|
156567
155027
|
__classPrivateFieldSet(
|
156568
155028
|
this,
|
156569
155029
|
_Context_temporariesUsedOutsideScope,
|
@@ -156571,6 +155031,12 @@ class Context {
|
|
156571
155031
|
'f'
|
156572
155032
|
);
|
156573
155033
|
__classPrivateFieldSet(this, _Context_temporaries, temporaries, 'f');
|
155034
|
+
__classPrivateFieldSet(
|
155035
|
+
this,
|
155036
|
+
_Context_processedInstrsInOptional,
|
155037
|
+
processedInstrsInOptional,
|
155038
|
+
'f'
|
155039
|
+
);
|
156574
155040
|
}
|
156575
155041
|
enterScope(scope) {
|
156576
155042
|
__classPrivateFieldSet(
|
@@ -156639,7 +155105,8 @@ class Context {
|
|
156639
155105
|
).has(place.identifier.declarationId);
|
156640
155106
|
}
|
156641
155107
|
declare(identifier, decl) {
|
156642
|
-
if (this
|
155108
|
+
if (__classPrivateFieldGet(this, _Context_innerFnContext, 'f') != null)
|
155109
|
+
return;
|
156643
155110
|
if (
|
156644
155111
|
!__classPrivateFieldGet(this, _Context_declarations, 'f').has(
|
156645
155112
|
identifier.declarationId
|
@@ -156750,6 +155217,37 @@ class Context {
|
|
156750
155217
|
currentScope.reassignments.add(place.identifier);
|
156751
155218
|
}
|
156752
155219
|
}
|
155220
|
+
enterInnerFn(innerFn, cb) {
|
155221
|
+
var _a;
|
155222
|
+
const prevContext = __classPrivateFieldGet(
|
155223
|
+
this,
|
155224
|
+
_Context_innerFnContext,
|
155225
|
+
'f'
|
155226
|
+
);
|
155227
|
+
__classPrivateFieldSet(
|
155228
|
+
this,
|
155229
|
+
_Context_innerFnContext,
|
155230
|
+
(_a = __classPrivateFieldGet(this, _Context_innerFnContext, 'f')) !==
|
155231
|
+
null && _a !== void 0
|
155232
|
+
? _a
|
155233
|
+
: {outerInstrId: innerFn.id},
|
155234
|
+
'f'
|
155235
|
+
);
|
155236
|
+
const result = cb();
|
155237
|
+
__classPrivateFieldSet(this, _Context_innerFnContext, prevContext, 'f');
|
155238
|
+
return result;
|
155239
|
+
}
|
155240
|
+
isDeferredDependency(instr) {
|
155241
|
+
return (
|
155242
|
+
__classPrivateFieldGet(this, _Context_processedInstrsInOptional, 'f').has(
|
155243
|
+
instr.value
|
155244
|
+
) ||
|
155245
|
+
(instr.kind === HIRValue.Instruction &&
|
155246
|
+
__classPrivateFieldGet(this, _Context_temporaries, 'f').has(
|
155247
|
+
instr.value.lvalue.identifier.id
|
155248
|
+
))
|
155249
|
+
);
|
155250
|
+
}
|
156753
155251
|
}
|
156754
155252
|
(_Context_declarations = new WeakMap()),
|
156755
155253
|
(_Context_reassignments = new WeakMap()),
|
@@ -156757,6 +155255,8 @@ class Context {
|
|
156757
155255
|
(_Context_dependencies = new WeakMap()),
|
156758
155256
|
(_Context_temporaries = new WeakMap()),
|
156759
155257
|
(_Context_temporariesUsedOutsideScope = new WeakMap()),
|
155258
|
+
(_Context_processedInstrsInOptional = new WeakMap()),
|
155259
|
+
(_Context_innerFnContext = new WeakMap()),
|
156760
155260
|
(_Context_instances = new WeakSet()),
|
156761
155261
|
(_Context_checkValidDependency = function _Context_checkValidDependency(
|
156762
155262
|
maybeDependency
|
@@ -156792,20 +155292,21 @@ class Context {
|
|
156792
155292
|
state => state === scope
|
156793
155293
|
);
|
156794
155294
|
});
|
155295
|
+
var HIRValue;
|
155296
|
+
(function (HIRValue) {
|
155297
|
+
HIRValue[(HIRValue['Instruction'] = 1)] = 'Instruction';
|
155298
|
+
HIRValue[(HIRValue['Terminal'] = 2)] = 'Terminal';
|
155299
|
+
})(HIRValue || (HIRValue = {}));
|
156795
155300
|
function handleInstruction(instr, context) {
|
156796
155301
|
const {id: id, value: value, lvalue: lvalue} = instr;
|
156797
|
-
|
156798
|
-
|
156799
|
-
|
156800
|
-
|
156801
|
-
|
156802
|
-
|
156803
|
-
|
156804
|
-
|
156805
|
-
} else if (value.kind === 'PropertyLoad') {
|
156806
|
-
if (context.isUsedOutsideDeclaringScope(lvalue)) {
|
156807
|
-
context.visitProperty(value.object, value.property, false);
|
156808
|
-
}
|
155302
|
+
context.declare(lvalue.identifier, {id: id, scope: context.currentScope});
|
155303
|
+
if (
|
155304
|
+
context.isDeferredDependency({kind: HIRValue.Instruction, value: instr})
|
155305
|
+
) {
|
155306
|
+
return;
|
155307
|
+
}
|
155308
|
+
if (value.kind === 'PropertyLoad') {
|
155309
|
+
context.visitProperty(value.object, value.property, false);
|
156809
155310
|
} else if (value.kind === 'StoreLocal') {
|
156810
155311
|
context.visitOperand(value.value);
|
156811
155312
|
if (value.lvalue.kind === InstructionKind.Reassign) {
|
@@ -156833,7 +155334,6 @@ function handleInstruction(instr, context) {
|
|
156833
155334
|
context.visitOperand(operand);
|
156834
155335
|
}
|
156835
155336
|
}
|
156836
|
-
context.declare(lvalue.identifier, {id: id, scope: context.currentScope});
|
156837
155337
|
}
|
156838
155338
|
function collectDependencies(
|
156839
155339
|
fn,
|
@@ -156841,7 +155341,11 @@ function collectDependencies(
|
|
156841
155341
|
temporaries,
|
156842
155342
|
processedInstrsInOptional
|
156843
155343
|
) {
|
156844
|
-
const context = new Context(
|
155344
|
+
const context = new Context(
|
155345
|
+
usedOutsideDeclaringScope,
|
155346
|
+
temporaries,
|
155347
|
+
processedInstrsInOptional
|
155348
|
+
);
|
156845
155349
|
for (const param of fn.params) {
|
156846
155350
|
if (param.kind === 'Identifier') {
|
156847
155351
|
context.declare(param.identifier, {
|
@@ -156891,15 +155395,20 @@ function collectDependencies(
|
|
156891
155395
|
id: instr.id,
|
156892
155396
|
scope: context.currentScope,
|
156893
155397
|
});
|
156894
|
-
const
|
156895
|
-
context.
|
156896
|
-
|
156897
|
-
|
156898
|
-
} else
|
155398
|
+
const innerFn = instr.value.loweredFunc.func;
|
155399
|
+
context.enterInnerFn(instr, () => {
|
155400
|
+
handleFunction(innerFn);
|
155401
|
+
});
|
155402
|
+
} else {
|
156899
155403
|
handleInstruction(instr, context);
|
156900
155404
|
}
|
156901
155405
|
}
|
156902
|
-
if (
|
155406
|
+
if (
|
155407
|
+
!context.isDeferredDependency({
|
155408
|
+
kind: HIRValue.Terminal,
|
155409
|
+
value: block.terminal,
|
155410
|
+
})
|
155411
|
+
) {
|
156903
155412
|
for (const place of eachTerminalOperand(block.terminal)) {
|
156904
155413
|
context.visitOperand(place);
|
156905
155414
|
}
|
@@ -157269,7 +155778,25 @@ function emitDestructureProps(env, propsObj, oldToNewProps) {
|
|
157269
155778
|
};
|
157270
155779
|
return destructurePropsInstr;
|
157271
155780
|
}
|
157272
|
-
function
|
155781
|
+
function optimizePropsMethodCalls(fn) {
|
155782
|
+
for (const [, block] of fn.body.blocks) {
|
155783
|
+
for (let i = 0; i < block.instructions.length; i++) {
|
155784
|
+
const instr = block.instructions[i];
|
155785
|
+
if (
|
155786
|
+
instr.value.kind === 'MethodCall' &&
|
155787
|
+
isPropsType(instr.value.receiver.identifier)
|
155788
|
+
) {
|
155789
|
+
instr.value = {
|
155790
|
+
kind: 'CallExpression',
|
155791
|
+
callee: instr.value.property,
|
155792
|
+
args: instr.value.args,
|
155793
|
+
loc: instr.value.loc,
|
155794
|
+
};
|
155795
|
+
}
|
155796
|
+
}
|
155797
|
+
}
|
155798
|
+
}
|
155799
|
+
function run(
|
157273
155800
|
func,
|
157274
155801
|
config,
|
157275
155802
|
fnType,
|
@@ -157278,6 +155805,7 @@ function* run(
|
|
157278
155805
|
filename,
|
157279
155806
|
code
|
157280
155807
|
) {
|
155808
|
+
var _a, _b;
|
157281
155809
|
const contextIdentifiers = findContextIdentifiers(func);
|
157282
155810
|
const env = new Environment(
|
157283
155811
|
func.scope,
|
@@ -157289,19 +155817,30 @@ function* run(
|
|
157289
155817
|
code,
|
157290
155818
|
useMemoCacheIdentifier
|
157291
155819
|
);
|
157292
|
-
|
157293
|
-
|
157294
|
-
|
157295
|
-
|
157296
|
-
|
157297
|
-
|
157298
|
-
|
155820
|
+
(_b =
|
155821
|
+
(_a = env.logger) === null || _a === void 0 ? void 0 : _a.debugLogIRs) ===
|
155822
|
+
null || _b === void 0
|
155823
|
+
? void 0
|
155824
|
+
: _b.call(_a, {
|
155825
|
+
kind: 'debug',
|
155826
|
+
name: 'EnvironmentConfig',
|
155827
|
+
value: prettyFormat$1(env.config),
|
155828
|
+
});
|
155829
|
+
return runWithEnvironment(func, env);
|
157299
155830
|
}
|
157300
|
-
function
|
155831
|
+
function runWithEnvironment(func, env) {
|
155832
|
+
const log = value => {
|
155833
|
+
var _a, _b;
|
155834
|
+
(_b =
|
155835
|
+
(_a = env.logger) === null || _a === void 0 ? void 0 : _a.debugLogIRs) ===
|
155836
|
+
null || _b === void 0
|
155837
|
+
? void 0
|
155838
|
+
: _b.call(_a, value);
|
155839
|
+
};
|
157301
155840
|
const hir = lower$1(func, env).unwrap();
|
157302
|
-
|
155841
|
+
log({kind: 'hir', name: 'HIR', value: hir});
|
157303
155842
|
pruneMaybeThrows(hir);
|
157304
|
-
|
155843
|
+
log({kind: 'hir', name: 'PruneMaybeThrows', value: hir});
|
157305
155844
|
validateContextVariableLValues(hir);
|
157306
155845
|
validateUseMemo(hir);
|
157307
155846
|
if (
|
@@ -157310,27 +155849,27 @@ function* runWithEnvironment(func, env) {
|
|
157310
155849
|
!env.config.enableChangeDetectionForDebugging
|
157311
155850
|
) {
|
157312
155851
|
dropManualMemoization(hir);
|
157313
|
-
|
155852
|
+
log({kind: 'hir', name: 'DropManualMemoization', value: hir});
|
157314
155853
|
}
|
157315
155854
|
inlineImmediatelyInvokedFunctionExpressions(hir);
|
157316
|
-
|
155855
|
+
log({
|
157317
155856
|
kind: 'hir',
|
157318
155857
|
name: 'InlineImmediatelyInvokedFunctionExpressions',
|
157319
155858
|
value: hir,
|
157320
155859
|
});
|
157321
155860
|
mergeConsecutiveBlocks(hir);
|
157322
|
-
|
155861
|
+
log({kind: 'hir', name: 'MergeConsecutiveBlocks', value: hir});
|
157323
155862
|
assertConsistentIdentifiers(hir);
|
157324
155863
|
assertTerminalSuccessorsExist(hir);
|
157325
155864
|
enterSSA(hir);
|
157326
|
-
|
155865
|
+
log({kind: 'hir', name: 'SSA', value: hir});
|
157327
155866
|
eliminateRedundantPhi(hir);
|
157328
|
-
|
155867
|
+
log({kind: 'hir', name: 'EliminateRedundantPhi', value: hir});
|
157329
155868
|
assertConsistentIdentifiers(hir);
|
157330
155869
|
constantPropagation(hir);
|
157331
|
-
|
155870
|
+
log({kind: 'hir', name: 'ConstantPropagation', value: hir});
|
157332
155871
|
inferTypes(hir);
|
157333
|
-
|
155872
|
+
log({kind: 'hir', name: 'InferTypes', value: hir});
|
157334
155873
|
if (env.config.validateHooksUsage) {
|
157335
155874
|
validateHooksUsage(hir);
|
157336
155875
|
}
|
@@ -157340,21 +155879,23 @@ function* runWithEnvironment(func, env) {
|
|
157340
155879
|
if (env.config.lowerContextAccess) {
|
157341
155880
|
lowerContextAccess(hir, env.config.lowerContextAccess);
|
157342
155881
|
}
|
155882
|
+
optimizePropsMethodCalls(hir);
|
155883
|
+
log({kind: 'hir', name: 'OptimizePropsMethodCalls', value: hir});
|
157343
155884
|
analyseFunctions(hir);
|
157344
|
-
|
155885
|
+
log({kind: 'hir', name: 'AnalyseFunctions', value: hir});
|
157345
155886
|
inferReferenceEffects(hir);
|
157346
|
-
|
155887
|
+
log({kind: 'hir', name: 'InferReferenceEffects', value: hir});
|
157347
155888
|
validateLocalsNotReassignedAfterRender(hir);
|
157348
155889
|
deadCodeElimination(hir);
|
157349
|
-
|
155890
|
+
log({kind: 'hir', name: 'DeadCodeElimination', value: hir});
|
157350
155891
|
if (env.config.enableInstructionReordering) {
|
157351
155892
|
instructionReordering(hir);
|
157352
|
-
|
155893
|
+
log({kind: 'hir', name: 'InstructionReordering', value: hir});
|
157353
155894
|
}
|
157354
155895
|
pruneMaybeThrows(hir);
|
157355
|
-
|
155896
|
+
log({kind: 'hir', name: 'PruneMaybeThrows', value: hir});
|
157356
155897
|
inferMutableRanges(hir);
|
157357
|
-
|
155898
|
+
log({kind: 'hir', name: 'InferMutableRanges', value: hir});
|
157358
155899
|
if (env.config.assertValidMutableRanges) {
|
157359
155900
|
assertValidMutableRanges(hir);
|
157360
155901
|
}
|
@@ -157371,157 +155912,125 @@ function* runWithEnvironment(func, env) {
|
|
157371
155912
|
validateNoJSXInTryStatement(hir);
|
157372
155913
|
}
|
157373
155914
|
inferReactivePlaces(hir);
|
157374
|
-
|
155915
|
+
log({kind: 'hir', name: 'InferReactivePlaces', value: hir});
|
157375
155916
|
rewriteInstructionKindsBasedOnReassignment(hir);
|
157376
|
-
|
155917
|
+
log({
|
157377
155918
|
kind: 'hir',
|
157378
155919
|
name: 'RewriteInstructionKindsBasedOnReassignment',
|
157379
155920
|
value: hir,
|
157380
155921
|
});
|
157381
155922
|
propagatePhiTypes(hir);
|
157382
|
-
|
155923
|
+
log({kind: 'hir', name: 'PropagatePhiTypes', value: hir});
|
157383
155924
|
inferReactiveScopeVariables(hir);
|
157384
|
-
|
155925
|
+
log({kind: 'hir', name: 'InferReactiveScopeVariables', value: hir});
|
157385
155926
|
const fbtOperands = memoizeFbtAndMacroOperandsInSameScope(hir);
|
157386
|
-
|
157387
|
-
kind: 'hir',
|
157388
|
-
name: 'MemoizeFbtAndMacroOperandsInSameScope',
|
157389
|
-
value: hir,
|
157390
|
-
});
|
155927
|
+
log({kind: 'hir', name: 'MemoizeFbtAndMacroOperandsInSameScope', value: hir});
|
157391
155928
|
if (env.config.enableJsxOutlining) {
|
157392
155929
|
outlineJSX(hir);
|
157393
155930
|
}
|
157394
155931
|
if (env.config.enableFunctionOutlining) {
|
157395
155932
|
outlineFunctions(hir, fbtOperands);
|
157396
|
-
|
155933
|
+
log({kind: 'hir', name: 'OutlineFunctions', value: hir});
|
157397
155934
|
}
|
157398
155935
|
alignMethodCallScopes(hir);
|
157399
|
-
|
155936
|
+
log({kind: 'hir', name: 'AlignMethodCallScopes', value: hir});
|
157400
155937
|
alignObjectMethodScopes(hir);
|
157401
|
-
|
155938
|
+
log({kind: 'hir', name: 'AlignObjectMethodScopes', value: hir});
|
157402
155939
|
pruneUnusedLabelsHIR(hir);
|
157403
|
-
|
155940
|
+
log({kind: 'hir', name: 'PruneUnusedLabelsHIR', value: hir});
|
157404
155941
|
alignReactiveScopesToBlockScopesHIR(hir);
|
157405
|
-
|
157406
|
-
kind: 'hir',
|
157407
|
-
name: 'AlignReactiveScopesToBlockScopesHIR',
|
157408
|
-
value: hir,
|
157409
|
-
});
|
155942
|
+
log({kind: 'hir', name: 'AlignReactiveScopesToBlockScopesHIR', value: hir});
|
157410
155943
|
mergeOverlappingReactiveScopesHIR(hir);
|
157411
|
-
|
157412
|
-
kind: 'hir',
|
157413
|
-
name: 'MergeOverlappingReactiveScopesHIR',
|
157414
|
-
value: hir,
|
157415
|
-
});
|
155944
|
+
log({kind: 'hir', name: 'MergeOverlappingReactiveScopesHIR', value: hir});
|
157416
155945
|
assertValidBlockNesting(hir);
|
157417
155946
|
buildReactiveScopeTerminalsHIR(hir);
|
157418
|
-
|
155947
|
+
log({kind: 'hir', name: 'BuildReactiveScopeTerminalsHIR', value: hir});
|
157419
155948
|
assertValidBlockNesting(hir);
|
157420
155949
|
flattenReactiveLoopsHIR(hir);
|
157421
|
-
|
155950
|
+
log({kind: 'hir', name: 'FlattenReactiveLoopsHIR', value: hir});
|
157422
155951
|
flattenScopesWithHooksOrUseHIR(hir);
|
157423
|
-
|
155952
|
+
log({kind: 'hir', name: 'FlattenScopesWithHooksOrUseHIR', value: hir});
|
157424
155953
|
assertTerminalSuccessorsExist(hir);
|
157425
155954
|
assertTerminalPredsExist(hir);
|
157426
155955
|
propagateScopeDependenciesHIR(hir);
|
157427
|
-
|
155956
|
+
log({kind: 'hir', name: 'PropagateScopeDependenciesHIR', value: hir});
|
157428
155957
|
if (env.config.inferEffectDependencies) {
|
157429
155958
|
inferEffectDependencies(hir);
|
157430
155959
|
}
|
157431
155960
|
if (env.config.inlineJsxTransform) {
|
157432
155961
|
inlineJsxTransform(hir, env.config.inlineJsxTransform);
|
157433
|
-
|
155962
|
+
log({kind: 'hir', name: 'inlineJsxTransform', value: hir});
|
157434
155963
|
}
|
157435
155964
|
const reactiveFunction = buildReactiveFunction(hir);
|
157436
|
-
|
155965
|
+
log({
|
157437
155966
|
kind: 'reactive',
|
157438
155967
|
name: 'BuildReactiveFunction',
|
157439
155968
|
value: reactiveFunction,
|
157440
155969
|
});
|
157441
155970
|
assertWellFormedBreakTargets(reactiveFunction);
|
157442
155971
|
pruneUnusedLabels(reactiveFunction);
|
157443
|
-
|
157444
|
-
kind: 'reactive',
|
157445
|
-
name: 'PruneUnusedLabels',
|
157446
|
-
value: reactiveFunction,
|
157447
|
-
});
|
155972
|
+
log({kind: 'reactive', name: 'PruneUnusedLabels', value: reactiveFunction});
|
157448
155973
|
assertScopeInstructionsWithinScopes(reactiveFunction);
|
157449
155974
|
pruneNonEscapingScopes(reactiveFunction);
|
157450
|
-
|
155975
|
+
log({
|
157451
155976
|
kind: 'reactive',
|
157452
155977
|
name: 'PruneNonEscapingScopes',
|
157453
155978
|
value: reactiveFunction,
|
157454
155979
|
});
|
157455
155980
|
pruneNonReactiveDependencies(reactiveFunction);
|
157456
|
-
|
155981
|
+
log({
|
157457
155982
|
kind: 'reactive',
|
157458
155983
|
name: 'PruneNonReactiveDependencies',
|
157459
155984
|
value: reactiveFunction,
|
157460
155985
|
});
|
157461
155986
|
pruneUnusedScopes(reactiveFunction);
|
157462
|
-
|
157463
|
-
kind: 'reactive',
|
157464
|
-
name: 'PruneUnusedScopes',
|
157465
|
-
value: reactiveFunction,
|
157466
|
-
});
|
155987
|
+
log({kind: 'reactive', name: 'PruneUnusedScopes', value: reactiveFunction});
|
157467
155988
|
mergeReactiveScopesThatInvalidateTogether(reactiveFunction);
|
157468
|
-
|
155989
|
+
log({
|
157469
155990
|
kind: 'reactive',
|
157470
155991
|
name: 'MergeReactiveScopesThatInvalidateTogether',
|
157471
155992
|
value: reactiveFunction,
|
157472
155993
|
});
|
157473
155994
|
pruneAlwaysInvalidatingScopes(reactiveFunction);
|
157474
|
-
|
155995
|
+
log({
|
157475
155996
|
kind: 'reactive',
|
157476
155997
|
name: 'PruneAlwaysInvalidatingScopes',
|
157477
155998
|
value: reactiveFunction,
|
157478
155999
|
});
|
157479
156000
|
if (env.config.enableChangeDetectionForDebugging != null) {
|
157480
156001
|
pruneInitializationDependencies(reactiveFunction);
|
157481
|
-
|
156002
|
+
log({
|
157482
156003
|
kind: 'reactive',
|
157483
156004
|
name: 'PruneInitializationDependencies',
|
157484
156005
|
value: reactiveFunction,
|
157485
156006
|
});
|
157486
156007
|
}
|
157487
156008
|
propagateEarlyReturns(reactiveFunction);
|
157488
|
-
|
156009
|
+
log({
|
157489
156010
|
kind: 'reactive',
|
157490
156011
|
name: 'PropagateEarlyReturns',
|
157491
156012
|
value: reactiveFunction,
|
157492
156013
|
});
|
157493
156014
|
pruneUnusedLValues(reactiveFunction);
|
157494
|
-
|
157495
|
-
kind: 'reactive',
|
157496
|
-
name: 'PruneUnusedLValues',
|
157497
|
-
value: reactiveFunction,
|
157498
|
-
});
|
156015
|
+
log({kind: 'reactive', name: 'PruneUnusedLValues', value: reactiveFunction});
|
157499
156016
|
promoteUsedTemporaries(reactiveFunction);
|
157500
|
-
|
156017
|
+
log({
|
157501
156018
|
kind: 'reactive',
|
157502
156019
|
name: 'PromoteUsedTemporaries',
|
157503
156020
|
value: reactiveFunction,
|
157504
156021
|
});
|
157505
156022
|
extractScopeDeclarationsFromDestructuring(reactiveFunction);
|
157506
|
-
|
156023
|
+
log({
|
157507
156024
|
kind: 'reactive',
|
157508
156025
|
name: 'ExtractScopeDeclarationsFromDestructuring',
|
157509
156026
|
value: reactiveFunction,
|
157510
156027
|
});
|
157511
156028
|
stabilizeBlockIds(reactiveFunction);
|
157512
|
-
|
157513
|
-
kind: 'reactive',
|
157514
|
-
name: 'StabilizeBlockIds',
|
157515
|
-
value: reactiveFunction,
|
157516
|
-
});
|
156029
|
+
log({kind: 'reactive', name: 'StabilizeBlockIds', value: reactiveFunction});
|
157517
156030
|
const uniqueIdentifiers = renameVariables(reactiveFunction);
|
157518
|
-
|
157519
|
-
kind: 'reactive',
|
157520
|
-
name: 'RenameVariables',
|
157521
|
-
value: reactiveFunction,
|
157522
|
-
});
|
156031
|
+
log({kind: 'reactive', name: 'RenameVariables', value: reactiveFunction});
|
157523
156032
|
pruneHoistedContexts(reactiveFunction);
|
157524
|
-
|
156033
|
+
log({
|
157525
156034
|
kind: 'reactive',
|
157526
156035
|
name: 'PruneHoistedContexts',
|
157527
156036
|
value: reactiveFunction,
|
@@ -157539,9 +156048,9 @@ function* runWithEnvironment(func, env) {
|
|
157539
156048
|
uniqueIdentifiers: uniqueIdentifiers,
|
157540
156049
|
fbtOperands: fbtOperands,
|
157541
156050
|
}).unwrap();
|
157542
|
-
|
156051
|
+
log({kind: 'ast', name: 'Codegen', value: ast});
|
157543
156052
|
for (const outlined of ast.outlined) {
|
157544
|
-
|
156053
|
+
log({kind: 'ast', name: 'Codegen (outlined)', value: outlined.fn});
|
157545
156054
|
}
|
157546
156055
|
if (env.config.throwUnknownException__testonly) {
|
157547
156056
|
throw new Error('unexpected error');
|
@@ -157557,7 +156066,7 @@ function compileFn(
|
|
157557
156066
|
filename,
|
157558
156067
|
code
|
157559
156068
|
) {
|
157560
|
-
|
156069
|
+
return run(
|
157561
156070
|
func,
|
157562
156071
|
config,
|
157563
156072
|
fnType,
|
@@ -157566,40 +156075,6 @@ function compileFn(
|
|
157566
156075
|
filename,
|
157567
156076
|
code
|
157568
156077
|
);
|
157569
|
-
while (true) {
|
157570
|
-
const next = generator.next();
|
157571
|
-
if (next.done) {
|
157572
|
-
return next.value;
|
157573
|
-
}
|
157574
|
-
}
|
157575
|
-
}
|
157576
|
-
function log(value) {
|
157577
|
-
switch (value.kind) {
|
157578
|
-
case 'ast': {
|
157579
|
-
logCodegenFunction(value.name, value.value);
|
157580
|
-
break;
|
157581
|
-
}
|
157582
|
-
case 'hir': {
|
157583
|
-
logHIRFunction(value.name, value.value);
|
157584
|
-
break;
|
157585
|
-
}
|
157586
|
-
case 'reactive': {
|
157587
|
-
logReactiveFunction(value.name, value.value);
|
157588
|
-
break;
|
157589
|
-
}
|
157590
|
-
case 'debug': {
|
157591
|
-
logDebug(value.name, value.value);
|
157592
|
-
break;
|
157593
|
-
}
|
157594
|
-
default: {
|
157595
|
-
assertExhaustive(value, 'Unexpected compilation kind');
|
157596
|
-
}
|
157597
|
-
}
|
157598
|
-
return value;
|
157599
|
-
}
|
157600
|
-
function* runPlayground(func, config, fnType) {
|
157601
|
-
const ast = yield* run(func, config, fnType, '_c', null, null, null);
|
157602
|
-
return ast;
|
157603
156078
|
}
|
157604
156079
|
function isComponentDeclaration(node) {
|
157605
156080
|
return Object.prototype.hasOwnProperty.call(node, '__componentDeclaration');
|
@@ -158618,7 +157093,10 @@ function BabelPluginReactCompiler(_babel) {
|
|
158618
157093
|
) {
|
158619
157094
|
opts = injectReanimatedFlag(opts);
|
158620
157095
|
}
|
158621
|
-
if (
|
157096
|
+
if (
|
157097
|
+
opts.environment.enableResetCacheOnSourceFileChanges !== false &&
|
157098
|
+
isDev
|
157099
|
+
) {
|
158622
157100
|
opts = Object.assign(Object.assign({}, opts), {
|
158623
157101
|
environment: Object.assign(Object.assign({}, opts.environment), {
|
158624
157102
|
enableResetCacheOnSourceFileChanges: true,
|
@@ -158681,7 +157159,5 @@ exports.parseConfigPragmaForTests = parseConfigPragmaForTests;
|
|
158681
157159
|
exports.parsePluginOptions = parsePluginOptions;
|
158682
157160
|
exports.printHIR = printHIR;
|
158683
157161
|
exports.printReactiveFunction = printReactiveFunction;
|
158684
|
-
exports.run = run;
|
158685
157162
|
exports.runBabelPluginReactCompiler = runBabelPluginReactCompiler;
|
158686
|
-
exports.runPlayground = runPlayground;
|
158687
157163
|
exports.validateEnvironmentConfig = validateEnvironmentConfig;
|