@infinilabs/ai-chat 0.0.0 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (119) hide show
  1. package/README.md +310 -56
  2. package/dist/_baseUniq-BFn6cCm9.js +152 -0
  3. package/dist/_baseUniq-nfJyj2zU.cjs +151 -0
  4. package/dist/arc-BWSMkwk2.cjs +130 -0
  5. package/dist/arc-DODeX7B9.js +131 -0
  6. package/dist/architecture-U656AL7Q-B4C0nw6C.js +5 -0
  7. package/dist/architecture-U656AL7Q-CVURQXwt.cjs +5 -0
  8. package/dist/architectureDiagram-VXUJARFQ-2UbdzpNz.cjs +8681 -0
  9. package/dist/architectureDiagram-VXUJARFQ-NCVmzKuE.js +8681 -0
  10. package/dist/blockDiagram-VD42YOAC-B3yCPK1N.cjs +3606 -0
  11. package/dist/blockDiagram-VD42YOAC-C4FsmQfk.js +3606 -0
  12. package/dist/c4Diagram-YG6GDRKO-ATyoKzFV.js +2481 -0
  13. package/dist/c4Diagram-YG6GDRKO-COwVcHWj.cjs +2481 -0
  14. package/dist/channel-2Y73gsu9.cjs +6 -0
  15. package/dist/channel-oB8MffQV.js +7 -0
  16. package/dist/chunk-4BX2VUAB-C3diNHZw.cjs +15 -0
  17. package/dist/chunk-4BX2VUAB-sd2zFBFz.js +16 -0
  18. package/dist/chunk-55IACEB6-6ohTnYE3.js +13 -0
  19. package/dist/chunk-55IACEB6-T-CzlJke.cjs +12 -0
  20. package/dist/chunk-B4BG7PRW-B1zqG62l.cjs +1825 -0
  21. package/dist/chunk-B4BG7PRW-E1dti26Y.js +1826 -0
  22. package/dist/chunk-DI55MBZ5-Dk0kfYBV.cjs +1914 -0
  23. package/dist/chunk-DI55MBZ5-DpHw-vMw.js +1915 -0
  24. package/dist/chunk-FMBD7UC4-B1vXpasq.js +19 -0
  25. package/dist/chunk-FMBD7UC4-CShN9-qf.cjs +18 -0
  26. package/dist/chunk-QN33PNHL-Cw7FG91D.js +24 -0
  27. package/dist/chunk-QN33PNHL-DJi1fhak.cjs +23 -0
  28. package/dist/chunk-QZHKN3VN-BweiBR9P.js +17 -0
  29. package/dist/chunk-QZHKN3VN-DfUW_gDw.cjs +16 -0
  30. package/dist/chunk-TZMSLE5B-DY2Kbag4.cjs +107 -0
  31. package/dist/chunk-TZMSLE5B-ZQ2Esoix.js +108 -0
  32. package/dist/classDiagram-2ON5EDUG-D2tIbkjc.js +19 -0
  33. package/dist/classDiagram-2ON5EDUG-DRhRmkUb.cjs +19 -0
  34. package/dist/classDiagram-v2-WZHVMYZB-D2tIbkjc.js +19 -0
  35. package/dist/classDiagram-v2-WZHVMYZB-DRhRmkUb.cjs +19 -0
  36. package/dist/clone-BMkj3yun.cjs +7 -0
  37. package/dist/clone-ChHXIoR6.js +8 -0
  38. package/dist/cose-bilkent-S5V4N54A-BXnWH5Od.cjs +4942 -0
  39. package/dist/cose-bilkent-S5V4N54A-D15BmpCb.js +4942 -0
  40. package/dist/cytoscape.esm-BfvZ3QT_.js +30239 -0
  41. package/dist/cytoscape.esm-D8IBYQeQ.cjs +30238 -0
  42. package/dist/dagre-6UL2VRFP-DGQ6TW_g.cjs +693 -0
  43. package/dist/dagre-6UL2VRFP-WmhUYWg8.js +693 -0
  44. package/dist/defaultLocale-DVr69WTU.js +206 -0
  45. package/dist/defaultLocale-DwYGIg9G.cjs +203 -0
  46. package/dist/diagram-PSM6KHXK-DSfHBoUT.js +845 -0
  47. package/dist/diagram-PSM6KHXK-J4qyGeN7.cjs +845 -0
  48. package/dist/diagram-QEK2KX5R-D96wT5cH.cjs +300 -0
  49. package/dist/diagram-QEK2KX5R-I_nyexpY.js +300 -0
  50. package/dist/diagram-S2PKOQOG-BC_WyKEe.cjs +210 -0
  51. package/dist/diagram-S2PKOQOG-aooXSMNo.js +210 -0
  52. package/dist/erDiagram-Q2GNP2WA-DQ8Lquay.cjs +1158 -0
  53. package/dist/erDiagram-Q2GNP2WA-DWF8e6EL.js +1158 -0
  54. package/dist/flowDiagram-NV44I4VS-CM9c4F1o.js +2331 -0
  55. package/dist/flowDiagram-NV44I4VS-DpYNkyM2.cjs +2331 -0
  56. package/dist/ganttDiagram-JELNMOA3-CAsoD6rZ.js +3679 -0
  57. package/dist/ganttDiagram-JELNMOA3-DfKahpj4.cjs +3679 -0
  58. package/dist/gitGraph-F6HP7TQM-BX2fz4_i.js +5 -0
  59. package/dist/gitGraph-F6HP7TQM-DRkGg4T1.cjs +5 -0
  60. package/dist/gitGraphDiagram-NY62KEGX-PXpI94u6.js +1203 -0
  61. package/dist/gitGraphDiagram-NY62KEGX-YhnKpooH.cjs +1203 -0
  62. package/dist/graph-BvxpI7Xc.js +596 -0
  63. package/dist/graph-CI_TWBSn.cjs +595 -0
  64. package/dist/index-BctLGjTK.cjs +120500 -0
  65. package/dist/index-CjSgoo1P.js +120485 -0
  66. package/dist/index.cjs +19 -0
  67. package/dist/index.js +12 -19961
  68. package/dist/info-NVLQJR56-BGbTE7dw.cjs +5 -0
  69. package/dist/info-NVLQJR56-DRxIh-N8.js +5 -0
  70. package/dist/infoDiagram-WHAUD3N6-BB2Bnbnh.cjs +31 -0
  71. package/dist/infoDiagram-WHAUD3N6-D_RrgwxS.js +31 -0
  72. package/dist/init-DevvdK2U.cjs +15 -0
  73. package/dist/init-ZxktEp_H.js +16 -0
  74. package/dist/journeyDiagram-XKPGCS4Q-BJjXlMIj.js +1254 -0
  75. package/dist/journeyDiagram-XKPGCS4Q-BcBLsfI9.cjs +1254 -0
  76. package/dist/kanban-definition-3W4ZIXB7-0wwNBZ93.js +1047 -0
  77. package/dist/kanban-definition-3W4ZIXB7-CaY0q4j9.cjs +1047 -0
  78. package/dist/katex-BhpYeT3b.cjs +14523 -0
  79. package/dist/katex-ei8sH3Uy.js +14524 -0
  80. package/dist/layout-CcghncRv.js +2183 -0
  81. package/dist/layout-CvwzED_C.cjs +2182 -0
  82. package/dist/linear-CYow-mAK.cjs +339 -0
  83. package/dist/linear-D_gKQzVp.js +340 -0
  84. package/dist/mermaid-parser.core-CzmkR-3i.cjs +18703 -0
  85. package/dist/mermaid-parser.core-DCMDT-Cp.js +18704 -0
  86. package/dist/min-BBp7Smma.js +41 -0
  87. package/dist/min-Gu1I_bJ9.cjs +40 -0
  88. package/dist/mindmap-definition-VGOIOE7T-D16Pp1u5.cjs +1126 -0
  89. package/dist/mindmap-definition-VGOIOE7T-PjSLRtz4.js +1126 -0
  90. package/dist/ordinal-CxptdPJm.js +76 -0
  91. package/dist/ordinal-D7sQNqXZ.cjs +75 -0
  92. package/dist/packet-BFZMPI3H-BvdogPiS.js +5 -0
  93. package/dist/packet-BFZMPI3H-C7pOHUWY.cjs +5 -0
  94. package/dist/pie-7BOR55EZ-D-DxSHbP.cjs +5 -0
  95. package/dist/pie-7BOR55EZ-DEWJe4Xn.js +5 -0
  96. package/dist/pieDiagram-ADFJNKIX-CoDddKZl.js +237 -0
  97. package/dist/pieDiagram-ADFJNKIX-DjN4DU9l.cjs +237 -0
  98. package/dist/quadrantDiagram-AYHSOK5B-BZOg0JMm.js +1335 -0
  99. package/dist/quadrantDiagram-AYHSOK5B-DXjTSOL4.cjs +1335 -0
  100. package/dist/radar-NHE76QYJ-BrnDXy9q.cjs +5 -0
  101. package/dist/radar-NHE76QYJ-C2WmPmJ4.js +5 -0
  102. package/dist/requirementDiagram-UZGBJVZJ-CCW1O1xH.js +1161 -0
  103. package/dist/requirementDiagram-UZGBJVZJ-e5F3-dDI.cjs +1161 -0
  104. package/dist/sankeyDiagram-TZEHDZUN-BaGzCxTp.js +1193 -0
  105. package/dist/sankeyDiagram-TZEHDZUN-DtIvOvVI.cjs +1193 -0
  106. package/dist/sequenceDiagram-WL72ISMW-0vFhYnxn.cjs +3874 -0
  107. package/dist/sequenceDiagram-WL72ISMW-DL3B7U56.js +3874 -0
  108. package/dist/stateDiagram-FKZM4ZOC-CXW608BR.cjs +447 -0
  109. package/dist/stateDiagram-FKZM4ZOC-Ddw6HxPD.js +447 -0
  110. package/dist/stateDiagram-v2-4FDKWEC3-DZCkQKmp.js +19 -0
  111. package/dist/stateDiagram-v2-4FDKWEC3-DefWUbvq.cjs +19 -0
  112. package/dist/timeline-definition-IT6M3QCI-C3TfA9lE.cjs +1222 -0
  113. package/dist/timeline-definition-IT6M3QCI-DiS88lUo.js +1222 -0
  114. package/dist/treemap-KMMF4GRG-Bl-H6j2c.cjs +5 -0
  115. package/dist/treemap-KMMF4GRG-DGGr_R9A.js +5 -0
  116. package/dist/xychartDiagram-PRI3JC2R-BrOwRjfF.js +1886 -0
  117. package/dist/xychartDiagram-PRI3JC2R-CM06DttH.cjs +1886 -0
  118. package/package.json +22 -11
  119. package/dist/index.css +0 -1582
@@ -0,0 +1,206 @@
1
+ function formatDecimal(x) {
2
+ return Math.abs(x = Math.round(x)) >= 1e21 ? x.toLocaleString("en").replace(/,/g, "") : x.toString(10);
3
+ }
4
+ function formatDecimalParts(x, p) {
5
+ if ((i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf("e")) < 0) return null;
6
+ var i, coefficient = x.slice(0, i);
7
+ return [
8
+ coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient,
9
+ +x.slice(i + 1)
10
+ ];
11
+ }
12
+ function exponent(x) {
13
+ return x = formatDecimalParts(Math.abs(x)), x ? x[1] : NaN;
14
+ }
15
+ function formatGroup(grouping, thousands) {
16
+ return function(value, width) {
17
+ var i = value.length, t = [], j = 0, g = grouping[0], length = 0;
18
+ while (i > 0 && g > 0) {
19
+ if (length + g + 1 > width) g = Math.max(1, width - length);
20
+ t.push(value.substring(i -= g, i + g));
21
+ if ((length += g + 1) > width) break;
22
+ g = grouping[j = (j + 1) % grouping.length];
23
+ }
24
+ return t.reverse().join(thousands);
25
+ };
26
+ }
27
+ function formatNumerals(numerals) {
28
+ return function(value) {
29
+ return value.replace(/[0-9]/g, function(i) {
30
+ return numerals[+i];
31
+ });
32
+ };
33
+ }
34
+ var re = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;
35
+ function formatSpecifier(specifier) {
36
+ if (!(match = re.exec(specifier))) throw new Error("invalid format: " + specifier);
37
+ var match;
38
+ return new FormatSpecifier({
39
+ fill: match[1],
40
+ align: match[2],
41
+ sign: match[3],
42
+ symbol: match[4],
43
+ zero: match[5],
44
+ width: match[6],
45
+ comma: match[7],
46
+ precision: match[8] && match[8].slice(1),
47
+ trim: match[9],
48
+ type: match[10]
49
+ });
50
+ }
51
+ formatSpecifier.prototype = FormatSpecifier.prototype;
52
+ function FormatSpecifier(specifier) {
53
+ this.fill = specifier.fill === void 0 ? " " : specifier.fill + "";
54
+ this.align = specifier.align === void 0 ? ">" : specifier.align + "";
55
+ this.sign = specifier.sign === void 0 ? "-" : specifier.sign + "";
56
+ this.symbol = specifier.symbol === void 0 ? "" : specifier.symbol + "";
57
+ this.zero = !!specifier.zero;
58
+ this.width = specifier.width === void 0 ? void 0 : +specifier.width;
59
+ this.comma = !!specifier.comma;
60
+ this.precision = specifier.precision === void 0 ? void 0 : +specifier.precision;
61
+ this.trim = !!specifier.trim;
62
+ this.type = specifier.type === void 0 ? "" : specifier.type + "";
63
+ }
64
+ FormatSpecifier.prototype.toString = function() {
65
+ return this.fill + this.align + this.sign + this.symbol + (this.zero ? "0" : "") + (this.width === void 0 ? "" : Math.max(1, this.width | 0)) + (this.comma ? "," : "") + (this.precision === void 0 ? "" : "." + Math.max(0, this.precision | 0)) + (this.trim ? "~" : "") + this.type;
66
+ };
67
+ function formatTrim(s) {
68
+ out: for (var n = s.length, i = 1, i0 = -1, i1; i < n; ++i) {
69
+ switch (s[i]) {
70
+ case ".":
71
+ i0 = i1 = i;
72
+ break;
73
+ case "0":
74
+ if (i0 === 0) i0 = i;
75
+ i1 = i;
76
+ break;
77
+ default:
78
+ if (!+s[i]) break out;
79
+ if (i0 > 0) i0 = 0;
80
+ break;
81
+ }
82
+ }
83
+ return i0 > 0 ? s.slice(0, i0) + s.slice(i1 + 1) : s;
84
+ }
85
+ var prefixExponent;
86
+ function formatPrefixAuto(x, p) {
87
+ var d = formatDecimalParts(x, p);
88
+ if (!d) return x + "";
89
+ var coefficient = d[0], exponent2 = d[1], i = exponent2 - (prefixExponent = Math.max(-8, Math.min(8, Math.floor(exponent2 / 3))) * 3) + 1, n = coefficient.length;
90
+ return i === n ? coefficient : i > n ? coefficient + new Array(i - n + 1).join("0") : i > 0 ? coefficient.slice(0, i) + "." + coefficient.slice(i) : "0." + new Array(1 - i).join("0") + formatDecimalParts(x, Math.max(0, p + i - 1))[0];
91
+ }
92
+ function formatRounded(x, p) {
93
+ var d = formatDecimalParts(x, p);
94
+ if (!d) return x + "";
95
+ var coefficient = d[0], exponent2 = d[1];
96
+ return exponent2 < 0 ? "0." + new Array(-exponent2).join("0") + coefficient : coefficient.length > exponent2 + 1 ? coefficient.slice(0, exponent2 + 1) + "." + coefficient.slice(exponent2 + 1) : coefficient + new Array(exponent2 - coefficient.length + 2).join("0");
97
+ }
98
+ const formatTypes = {
99
+ "%": (x, p) => (x * 100).toFixed(p),
100
+ "b": (x) => Math.round(x).toString(2),
101
+ "c": (x) => x + "",
102
+ "d": formatDecimal,
103
+ "e": (x, p) => x.toExponential(p),
104
+ "f": (x, p) => x.toFixed(p),
105
+ "g": (x, p) => x.toPrecision(p),
106
+ "o": (x) => Math.round(x).toString(8),
107
+ "p": (x, p) => formatRounded(x * 100, p),
108
+ "r": formatRounded,
109
+ "s": formatPrefixAuto,
110
+ "X": (x) => Math.round(x).toString(16).toUpperCase(),
111
+ "x": (x) => Math.round(x).toString(16)
112
+ };
113
+ function identity(x) {
114
+ return x;
115
+ }
116
+ var map = Array.prototype.map, prefixes = ["y", "z", "a", "f", "p", "n", "µ", "m", "", "k", "M", "G", "T", "P", "E", "Z", "Y"];
117
+ function formatLocale(locale2) {
118
+ var group = locale2.grouping === void 0 || locale2.thousands === void 0 ? identity : formatGroup(map.call(locale2.grouping, Number), locale2.thousands + ""), currencyPrefix = locale2.currency === void 0 ? "" : locale2.currency[0] + "", currencySuffix = locale2.currency === void 0 ? "" : locale2.currency[1] + "", decimal = locale2.decimal === void 0 ? "." : locale2.decimal + "", numerals = locale2.numerals === void 0 ? identity : formatNumerals(map.call(locale2.numerals, String)), percent = locale2.percent === void 0 ? "%" : locale2.percent + "", minus = locale2.minus === void 0 ? "−" : locale2.minus + "", nan = locale2.nan === void 0 ? "NaN" : locale2.nan + "";
119
+ function newFormat(specifier) {
120
+ specifier = formatSpecifier(specifier);
121
+ var fill = specifier.fill, align = specifier.align, sign = specifier.sign, symbol = specifier.symbol, zero = specifier.zero, width = specifier.width, comma = specifier.comma, precision = specifier.precision, trim = specifier.trim, type = specifier.type;
122
+ if (type === "n") comma = true, type = "g";
123
+ else if (!formatTypes[type]) precision === void 0 && (precision = 12), trim = true, type = "g";
124
+ if (zero || fill === "0" && align === "=") zero = true, fill = "0", align = "=";
125
+ var prefix = symbol === "$" ? currencyPrefix : symbol === "#" && /[boxX]/.test(type) ? "0" + type.toLowerCase() : "", suffix = symbol === "$" ? currencySuffix : /[%p]/.test(type) ? percent : "";
126
+ var formatType = formatTypes[type], maybeSuffix = /[defgprs%]/.test(type);
127
+ precision = precision === void 0 ? 6 : /[gprs]/.test(type) ? Math.max(1, Math.min(21, precision)) : Math.max(0, Math.min(20, precision));
128
+ function format2(value) {
129
+ var valuePrefix = prefix, valueSuffix = suffix, i, n, c;
130
+ if (type === "c") {
131
+ valueSuffix = formatType(value) + valueSuffix;
132
+ value = "";
133
+ } else {
134
+ value = +value;
135
+ var valueNegative = value < 0 || 1 / value < 0;
136
+ value = isNaN(value) ? nan : formatType(Math.abs(value), precision);
137
+ if (trim) value = formatTrim(value);
138
+ if (valueNegative && +value === 0 && sign !== "+") valueNegative = false;
139
+ valuePrefix = (valueNegative ? sign === "(" ? sign : minus : sign === "-" || sign === "(" ? "" : sign) + valuePrefix;
140
+ valueSuffix = (type === "s" ? prefixes[8 + prefixExponent / 3] : "") + valueSuffix + (valueNegative && sign === "(" ? ")" : "");
141
+ if (maybeSuffix) {
142
+ i = -1, n = value.length;
143
+ while (++i < n) {
144
+ if (c = value.charCodeAt(i), 48 > c || c > 57) {
145
+ valueSuffix = (c === 46 ? decimal + value.slice(i + 1) : value.slice(i)) + valueSuffix;
146
+ value = value.slice(0, i);
147
+ break;
148
+ }
149
+ }
150
+ }
151
+ }
152
+ if (comma && !zero) value = group(value, Infinity);
153
+ var length = valuePrefix.length + value.length + valueSuffix.length, padding = length < width ? new Array(width - length + 1).join(fill) : "";
154
+ if (comma && zero) value = group(padding + value, padding.length ? width - valueSuffix.length : Infinity), padding = "";
155
+ switch (align) {
156
+ case "<":
157
+ value = valuePrefix + value + valueSuffix + padding;
158
+ break;
159
+ case "=":
160
+ value = valuePrefix + padding + value + valueSuffix;
161
+ break;
162
+ case "^":
163
+ value = padding.slice(0, length = padding.length >> 1) + valuePrefix + value + valueSuffix + padding.slice(length);
164
+ break;
165
+ default:
166
+ value = padding + valuePrefix + value + valueSuffix;
167
+ break;
168
+ }
169
+ return numerals(value);
170
+ }
171
+ format2.toString = function() {
172
+ return specifier + "";
173
+ };
174
+ return format2;
175
+ }
176
+ function formatPrefix2(specifier, value) {
177
+ var f = newFormat((specifier = formatSpecifier(specifier), specifier.type = "f", specifier)), e = Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3, k = Math.pow(10, -e), prefix = prefixes[8 + e / 3];
178
+ return function(value2) {
179
+ return f(k * value2) + prefix;
180
+ };
181
+ }
182
+ return {
183
+ format: newFormat,
184
+ formatPrefix: formatPrefix2
185
+ };
186
+ }
187
+ var locale;
188
+ var format;
189
+ var formatPrefix;
190
+ defaultLocale({
191
+ thousands: ",",
192
+ grouping: [3],
193
+ currency: ["$", ""]
194
+ });
195
+ function defaultLocale(definition) {
196
+ locale = formatLocale(definition);
197
+ format = locale.format;
198
+ formatPrefix = locale.formatPrefix;
199
+ return locale;
200
+ }
201
+ export {
202
+ formatPrefix as a,
203
+ format as b,
204
+ exponent as e,
205
+ formatSpecifier as f
206
+ };
@@ -0,0 +1,203 @@
1
+ "use strict";
2
+ function formatDecimal(x) {
3
+ return Math.abs(x = Math.round(x)) >= 1e21 ? x.toLocaleString("en").replace(/,/g, "") : x.toString(10);
4
+ }
5
+ function formatDecimalParts(x, p) {
6
+ if ((i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf("e")) < 0) return null;
7
+ var i, coefficient = x.slice(0, i);
8
+ return [
9
+ coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient,
10
+ +x.slice(i + 1)
11
+ ];
12
+ }
13
+ function exponent(x) {
14
+ return x = formatDecimalParts(Math.abs(x)), x ? x[1] : NaN;
15
+ }
16
+ function formatGroup(grouping, thousands) {
17
+ return function(value, width) {
18
+ var i = value.length, t = [], j = 0, g = grouping[0], length = 0;
19
+ while (i > 0 && g > 0) {
20
+ if (length + g + 1 > width) g = Math.max(1, width - length);
21
+ t.push(value.substring(i -= g, i + g));
22
+ if ((length += g + 1) > width) break;
23
+ g = grouping[j = (j + 1) % grouping.length];
24
+ }
25
+ return t.reverse().join(thousands);
26
+ };
27
+ }
28
+ function formatNumerals(numerals) {
29
+ return function(value) {
30
+ return value.replace(/[0-9]/g, function(i) {
31
+ return numerals[+i];
32
+ });
33
+ };
34
+ }
35
+ var re = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;
36
+ function formatSpecifier(specifier) {
37
+ if (!(match = re.exec(specifier))) throw new Error("invalid format: " + specifier);
38
+ var match;
39
+ return new FormatSpecifier({
40
+ fill: match[1],
41
+ align: match[2],
42
+ sign: match[3],
43
+ symbol: match[4],
44
+ zero: match[5],
45
+ width: match[6],
46
+ comma: match[7],
47
+ precision: match[8] && match[8].slice(1),
48
+ trim: match[9],
49
+ type: match[10]
50
+ });
51
+ }
52
+ formatSpecifier.prototype = FormatSpecifier.prototype;
53
+ function FormatSpecifier(specifier) {
54
+ this.fill = specifier.fill === void 0 ? " " : specifier.fill + "";
55
+ this.align = specifier.align === void 0 ? ">" : specifier.align + "";
56
+ this.sign = specifier.sign === void 0 ? "-" : specifier.sign + "";
57
+ this.symbol = specifier.symbol === void 0 ? "" : specifier.symbol + "";
58
+ this.zero = !!specifier.zero;
59
+ this.width = specifier.width === void 0 ? void 0 : +specifier.width;
60
+ this.comma = !!specifier.comma;
61
+ this.precision = specifier.precision === void 0 ? void 0 : +specifier.precision;
62
+ this.trim = !!specifier.trim;
63
+ this.type = specifier.type === void 0 ? "" : specifier.type + "";
64
+ }
65
+ FormatSpecifier.prototype.toString = function() {
66
+ return this.fill + this.align + this.sign + this.symbol + (this.zero ? "0" : "") + (this.width === void 0 ? "" : Math.max(1, this.width | 0)) + (this.comma ? "," : "") + (this.precision === void 0 ? "" : "." + Math.max(0, this.precision | 0)) + (this.trim ? "~" : "") + this.type;
67
+ };
68
+ function formatTrim(s) {
69
+ out: for (var n = s.length, i = 1, i0 = -1, i1; i < n; ++i) {
70
+ switch (s[i]) {
71
+ case ".":
72
+ i0 = i1 = i;
73
+ break;
74
+ case "0":
75
+ if (i0 === 0) i0 = i;
76
+ i1 = i;
77
+ break;
78
+ default:
79
+ if (!+s[i]) break out;
80
+ if (i0 > 0) i0 = 0;
81
+ break;
82
+ }
83
+ }
84
+ return i0 > 0 ? s.slice(0, i0) + s.slice(i1 + 1) : s;
85
+ }
86
+ var prefixExponent;
87
+ function formatPrefixAuto(x, p) {
88
+ var d = formatDecimalParts(x, p);
89
+ if (!d) return x + "";
90
+ var coefficient = d[0], exponent2 = d[1], i = exponent2 - (prefixExponent = Math.max(-8, Math.min(8, Math.floor(exponent2 / 3))) * 3) + 1, n = coefficient.length;
91
+ return i === n ? coefficient : i > n ? coefficient + new Array(i - n + 1).join("0") : i > 0 ? coefficient.slice(0, i) + "." + coefficient.slice(i) : "0." + new Array(1 - i).join("0") + formatDecimalParts(x, Math.max(0, p + i - 1))[0];
92
+ }
93
+ function formatRounded(x, p) {
94
+ var d = formatDecimalParts(x, p);
95
+ if (!d) return x + "";
96
+ var coefficient = d[0], exponent2 = d[1];
97
+ return exponent2 < 0 ? "0." + new Array(-exponent2).join("0") + coefficient : coefficient.length > exponent2 + 1 ? coefficient.slice(0, exponent2 + 1) + "." + coefficient.slice(exponent2 + 1) : coefficient + new Array(exponent2 - coefficient.length + 2).join("0");
98
+ }
99
+ const formatTypes = {
100
+ "%": (x, p) => (x * 100).toFixed(p),
101
+ "b": (x) => Math.round(x).toString(2),
102
+ "c": (x) => x + "",
103
+ "d": formatDecimal,
104
+ "e": (x, p) => x.toExponential(p),
105
+ "f": (x, p) => x.toFixed(p),
106
+ "g": (x, p) => x.toPrecision(p),
107
+ "o": (x) => Math.round(x).toString(8),
108
+ "p": (x, p) => formatRounded(x * 100, p),
109
+ "r": formatRounded,
110
+ "s": formatPrefixAuto,
111
+ "X": (x) => Math.round(x).toString(16).toUpperCase(),
112
+ "x": (x) => Math.round(x).toString(16)
113
+ };
114
+ function identity(x) {
115
+ return x;
116
+ }
117
+ var map = Array.prototype.map, prefixes = ["y", "z", "a", "f", "p", "n", "µ", "m", "", "k", "M", "G", "T", "P", "E", "Z", "Y"];
118
+ function formatLocale(locale2) {
119
+ var group = locale2.grouping === void 0 || locale2.thousands === void 0 ? identity : formatGroup(map.call(locale2.grouping, Number), locale2.thousands + ""), currencyPrefix = locale2.currency === void 0 ? "" : locale2.currency[0] + "", currencySuffix = locale2.currency === void 0 ? "" : locale2.currency[1] + "", decimal = locale2.decimal === void 0 ? "." : locale2.decimal + "", numerals = locale2.numerals === void 0 ? identity : formatNumerals(map.call(locale2.numerals, String)), percent = locale2.percent === void 0 ? "%" : locale2.percent + "", minus = locale2.minus === void 0 ? "−" : locale2.minus + "", nan = locale2.nan === void 0 ? "NaN" : locale2.nan + "";
120
+ function newFormat(specifier) {
121
+ specifier = formatSpecifier(specifier);
122
+ var fill = specifier.fill, align = specifier.align, sign = specifier.sign, symbol = specifier.symbol, zero = specifier.zero, width = specifier.width, comma = specifier.comma, precision = specifier.precision, trim = specifier.trim, type = specifier.type;
123
+ if (type === "n") comma = true, type = "g";
124
+ else if (!formatTypes[type]) precision === void 0 && (precision = 12), trim = true, type = "g";
125
+ if (zero || fill === "0" && align === "=") zero = true, fill = "0", align = "=";
126
+ var prefix = symbol === "$" ? currencyPrefix : symbol === "#" && /[boxX]/.test(type) ? "0" + type.toLowerCase() : "", suffix = symbol === "$" ? currencySuffix : /[%p]/.test(type) ? percent : "";
127
+ var formatType = formatTypes[type], maybeSuffix = /[defgprs%]/.test(type);
128
+ precision = precision === void 0 ? 6 : /[gprs]/.test(type) ? Math.max(1, Math.min(21, precision)) : Math.max(0, Math.min(20, precision));
129
+ function format(value) {
130
+ var valuePrefix = prefix, valueSuffix = suffix, i, n, c;
131
+ if (type === "c") {
132
+ valueSuffix = formatType(value) + valueSuffix;
133
+ value = "";
134
+ } else {
135
+ value = +value;
136
+ var valueNegative = value < 0 || 1 / value < 0;
137
+ value = isNaN(value) ? nan : formatType(Math.abs(value), precision);
138
+ if (trim) value = formatTrim(value);
139
+ if (valueNegative && +value === 0 && sign !== "+") valueNegative = false;
140
+ valuePrefix = (valueNegative ? sign === "(" ? sign : minus : sign === "-" || sign === "(" ? "" : sign) + valuePrefix;
141
+ valueSuffix = (type === "s" ? prefixes[8 + prefixExponent / 3] : "") + valueSuffix + (valueNegative && sign === "(" ? ")" : "");
142
+ if (maybeSuffix) {
143
+ i = -1, n = value.length;
144
+ while (++i < n) {
145
+ if (c = value.charCodeAt(i), 48 > c || c > 57) {
146
+ valueSuffix = (c === 46 ? decimal + value.slice(i + 1) : value.slice(i)) + valueSuffix;
147
+ value = value.slice(0, i);
148
+ break;
149
+ }
150
+ }
151
+ }
152
+ }
153
+ if (comma && !zero) value = group(value, Infinity);
154
+ var length = valuePrefix.length + value.length + valueSuffix.length, padding = length < width ? new Array(width - length + 1).join(fill) : "";
155
+ if (comma && zero) value = group(padding + value, padding.length ? width - valueSuffix.length : Infinity), padding = "";
156
+ switch (align) {
157
+ case "<":
158
+ value = valuePrefix + value + valueSuffix + padding;
159
+ break;
160
+ case "=":
161
+ value = valuePrefix + padding + value + valueSuffix;
162
+ break;
163
+ case "^":
164
+ value = padding.slice(0, length = padding.length >> 1) + valuePrefix + value + valueSuffix + padding.slice(length);
165
+ break;
166
+ default:
167
+ value = padding + valuePrefix + value + valueSuffix;
168
+ break;
169
+ }
170
+ return numerals(value);
171
+ }
172
+ format.toString = function() {
173
+ return specifier + "";
174
+ };
175
+ return format;
176
+ }
177
+ function formatPrefix(specifier, value) {
178
+ var f = newFormat((specifier = formatSpecifier(specifier), specifier.type = "f", specifier)), e = Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3, k = Math.pow(10, -e), prefix = prefixes[8 + e / 3];
179
+ return function(value2) {
180
+ return f(k * value2) + prefix;
181
+ };
182
+ }
183
+ return {
184
+ format: newFormat,
185
+ formatPrefix
186
+ };
187
+ }
188
+ var locale;
189
+ exports.format = void 0;
190
+ exports.formatPrefix = void 0;
191
+ defaultLocale({
192
+ thousands: ",",
193
+ grouping: [3],
194
+ currency: ["$", ""]
195
+ });
196
+ function defaultLocale(definition) {
197
+ locale = formatLocale(definition);
198
+ exports.format = locale.format;
199
+ exports.formatPrefix = locale.formatPrefix;
200
+ return locale;
201
+ }
202
+ exports.exponent = exponent;
203
+ exports.formatSpecifier = formatSpecifier;