@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,339 @@
1
+ "use strict";
2
+ const index = require("./index-BctLGjTK.cjs");
3
+ const init = require("./init-DevvdK2U.cjs");
4
+ const defaultLocale = require("./defaultLocale-DwYGIg9G.cjs");
5
+ function ascending(a, b) {
6
+ return a == null || b == null ? NaN : a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;
7
+ }
8
+ function descending(a, b) {
9
+ return a == null || b == null ? NaN : b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN;
10
+ }
11
+ function bisector(f) {
12
+ let compare1, compare2, delta;
13
+ if (f.length !== 2) {
14
+ compare1 = ascending;
15
+ compare2 = (d, x) => ascending(f(d), x);
16
+ delta = (d, x) => f(d) - x;
17
+ } else {
18
+ compare1 = f === ascending || f === descending ? f : zero;
19
+ compare2 = f;
20
+ delta = f;
21
+ }
22
+ function left(a, x, lo = 0, hi = a.length) {
23
+ if (lo < hi) {
24
+ if (compare1(x, x) !== 0) return hi;
25
+ do {
26
+ const mid = lo + hi >>> 1;
27
+ if (compare2(a[mid], x) < 0) lo = mid + 1;
28
+ else hi = mid;
29
+ } while (lo < hi);
30
+ }
31
+ return lo;
32
+ }
33
+ function right(a, x, lo = 0, hi = a.length) {
34
+ if (lo < hi) {
35
+ if (compare1(x, x) !== 0) return hi;
36
+ do {
37
+ const mid = lo + hi >>> 1;
38
+ if (compare2(a[mid], x) <= 0) lo = mid + 1;
39
+ else hi = mid;
40
+ } while (lo < hi);
41
+ }
42
+ return lo;
43
+ }
44
+ function center(a, x, lo = 0, hi = a.length) {
45
+ const i = left(a, x, lo, hi - 1);
46
+ return i > lo && delta(a[i - 1], x) > -delta(a[i], x) ? i - 1 : i;
47
+ }
48
+ return { left, center, right };
49
+ }
50
+ function zero() {
51
+ return 0;
52
+ }
53
+ function number$1(x) {
54
+ return x === null ? NaN : +x;
55
+ }
56
+ const ascendingBisect = bisector(ascending);
57
+ const bisectRight = ascendingBisect.right;
58
+ bisector(number$1).center;
59
+ const e10 = Math.sqrt(50), e5 = Math.sqrt(10), e2 = Math.sqrt(2);
60
+ function tickSpec(start, stop, count) {
61
+ const step = (stop - start) / Math.max(0, count), power = Math.floor(Math.log10(step)), error = step / Math.pow(10, power), factor = error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1;
62
+ let i1, i2, inc;
63
+ if (power < 0) {
64
+ inc = Math.pow(10, -power) / factor;
65
+ i1 = Math.round(start * inc);
66
+ i2 = Math.round(stop * inc);
67
+ if (i1 / inc < start) ++i1;
68
+ if (i2 / inc > stop) --i2;
69
+ inc = -inc;
70
+ } else {
71
+ inc = Math.pow(10, power) * factor;
72
+ i1 = Math.round(start / inc);
73
+ i2 = Math.round(stop / inc);
74
+ if (i1 * inc < start) ++i1;
75
+ if (i2 * inc > stop) --i2;
76
+ }
77
+ if (i2 < i1 && 0.5 <= count && count < 2) return tickSpec(start, stop, count * 2);
78
+ return [i1, i2, inc];
79
+ }
80
+ function ticks(start, stop, count) {
81
+ stop = +stop, start = +start, count = +count;
82
+ if (!(count > 0)) return [];
83
+ if (start === stop) return [start];
84
+ const reverse = stop < start, [i1, i2, inc] = reverse ? tickSpec(stop, start, count) : tickSpec(start, stop, count);
85
+ if (!(i2 >= i1)) return [];
86
+ const n = i2 - i1 + 1, ticks2 = new Array(n);
87
+ if (reverse) {
88
+ if (inc < 0) for (let i = 0; i < n; ++i) ticks2[i] = (i2 - i) / -inc;
89
+ else for (let i = 0; i < n; ++i) ticks2[i] = (i2 - i) * inc;
90
+ } else {
91
+ if (inc < 0) for (let i = 0; i < n; ++i) ticks2[i] = (i1 + i) / -inc;
92
+ else for (let i = 0; i < n; ++i) ticks2[i] = (i1 + i) * inc;
93
+ }
94
+ return ticks2;
95
+ }
96
+ function tickIncrement(start, stop, count) {
97
+ stop = +stop, start = +start, count = +count;
98
+ return tickSpec(start, stop, count)[2];
99
+ }
100
+ function tickStep(start, stop, count) {
101
+ stop = +stop, start = +start, count = +count;
102
+ const reverse = stop < start, inc = reverse ? tickIncrement(stop, start, count) : tickIncrement(start, stop, count);
103
+ return (reverse ? -1 : 1) * (inc < 0 ? 1 / -inc : inc);
104
+ }
105
+ function numberArray(a, b) {
106
+ if (!b) b = [];
107
+ var n = a ? Math.min(b.length, a.length) : 0, c = b.slice(), i;
108
+ return function(t) {
109
+ for (i = 0; i < n; ++i) c[i] = a[i] * (1 - t) + b[i] * t;
110
+ return c;
111
+ };
112
+ }
113
+ function isNumberArray(x) {
114
+ return ArrayBuffer.isView(x) && !(x instanceof DataView);
115
+ }
116
+ function genericArray(a, b) {
117
+ var nb = b ? b.length : 0, na = a ? Math.min(nb, a.length) : 0, x = new Array(na), c = new Array(nb), i;
118
+ for (i = 0; i < na; ++i) x[i] = interpolate(a[i], b[i]);
119
+ for (; i < nb; ++i) c[i] = b[i];
120
+ return function(t) {
121
+ for (i = 0; i < na; ++i) c[i] = x[i](t);
122
+ return c;
123
+ };
124
+ }
125
+ function date(a, b) {
126
+ var d = /* @__PURE__ */ new Date();
127
+ return a = +a, b = +b, function(t) {
128
+ return d.setTime(a * (1 - t) + b * t), d;
129
+ };
130
+ }
131
+ function object(a, b) {
132
+ var i = {}, c = {}, k;
133
+ if (a === null || typeof a !== "object") a = {};
134
+ if (b === null || typeof b !== "object") b = {};
135
+ for (k in b) {
136
+ if (k in a) {
137
+ i[k] = interpolate(a[k], b[k]);
138
+ } else {
139
+ c[k] = b[k];
140
+ }
141
+ }
142
+ return function(t) {
143
+ for (k in i) c[k] = i[k](t);
144
+ return c;
145
+ };
146
+ }
147
+ function interpolate(a, b) {
148
+ var t = typeof b, c;
149
+ return b == null || t === "boolean" ? index.constant$1(b) : (t === "number" ? index.interpolateNumber : t === "string" ? (c = index.color(b)) ? (b = c, index.interpolateRgb) : index.interpolateString : b instanceof index.color ? index.interpolateRgb : b instanceof Date ? date : isNumberArray(b) ? numberArray : Array.isArray(b) ? genericArray : typeof b.valueOf !== "function" && typeof b.toString !== "function" || isNaN(b) ? object : index.interpolateNumber)(a, b);
150
+ }
151
+ function interpolateRound(a, b) {
152
+ return a = +a, b = +b, function(t) {
153
+ return Math.round(a * (1 - t) + b * t);
154
+ };
155
+ }
156
+ function precisionFixed(step) {
157
+ return Math.max(0, -defaultLocale.exponent(Math.abs(step)));
158
+ }
159
+ function precisionPrefix(step, value) {
160
+ return Math.max(0, Math.max(-8, Math.min(8, Math.floor(defaultLocale.exponent(value) / 3))) * 3 - defaultLocale.exponent(Math.abs(step)));
161
+ }
162
+ function precisionRound(step, max) {
163
+ step = Math.abs(step), max = Math.abs(max) - step;
164
+ return Math.max(0, defaultLocale.exponent(max) - defaultLocale.exponent(step)) + 1;
165
+ }
166
+ function constants(x) {
167
+ return function() {
168
+ return x;
169
+ };
170
+ }
171
+ function number(x) {
172
+ return +x;
173
+ }
174
+ var unit = [0, 1];
175
+ function identity(x) {
176
+ return x;
177
+ }
178
+ function normalize(a, b) {
179
+ return (b -= a = +a) ? function(x) {
180
+ return (x - a) / b;
181
+ } : constants(isNaN(b) ? NaN : 0.5);
182
+ }
183
+ function clamper(a, b) {
184
+ var t;
185
+ if (a > b) t = a, a = b, b = t;
186
+ return function(x) {
187
+ return Math.max(a, Math.min(b, x));
188
+ };
189
+ }
190
+ function bimap(domain, range, interpolate2) {
191
+ var d0 = domain[0], d1 = domain[1], r0 = range[0], r1 = range[1];
192
+ if (d1 < d0) d0 = normalize(d1, d0), r0 = interpolate2(r1, r0);
193
+ else d0 = normalize(d0, d1), r0 = interpolate2(r0, r1);
194
+ return function(x) {
195
+ return r0(d0(x));
196
+ };
197
+ }
198
+ function polymap(domain, range, interpolate2) {
199
+ var j = Math.min(domain.length, range.length) - 1, d = new Array(j), r = new Array(j), i = -1;
200
+ if (domain[j] < domain[0]) {
201
+ domain = domain.slice().reverse();
202
+ range = range.slice().reverse();
203
+ }
204
+ while (++i < j) {
205
+ d[i] = normalize(domain[i], domain[i + 1]);
206
+ r[i] = interpolate2(range[i], range[i + 1]);
207
+ }
208
+ return function(x) {
209
+ var i2 = bisectRight(domain, x, 1, j) - 1;
210
+ return r[i2](d[i2](x));
211
+ };
212
+ }
213
+ function copy(source, target) {
214
+ return target.domain(source.domain()).range(source.range()).interpolate(source.interpolate()).clamp(source.clamp()).unknown(source.unknown());
215
+ }
216
+ function transformer() {
217
+ var domain = unit, range = unit, interpolate$1 = interpolate, transform, untransform, unknown, clamp = identity, piecewise, output, input;
218
+ function rescale() {
219
+ var n = Math.min(domain.length, range.length);
220
+ if (clamp !== identity) clamp = clamper(domain[0], domain[n - 1]);
221
+ piecewise = n > 2 ? polymap : bimap;
222
+ output = input = null;
223
+ return scale;
224
+ }
225
+ function scale(x) {
226
+ return x == null || isNaN(x = +x) ? unknown : (output || (output = piecewise(domain.map(transform), range, interpolate$1)))(transform(clamp(x)));
227
+ }
228
+ scale.invert = function(y) {
229
+ return clamp(untransform((input || (input = piecewise(range, domain.map(transform), index.interpolateNumber)))(y)));
230
+ };
231
+ scale.domain = function(_) {
232
+ return arguments.length ? (domain = Array.from(_, number), rescale()) : domain.slice();
233
+ };
234
+ scale.range = function(_) {
235
+ return arguments.length ? (range = Array.from(_), rescale()) : range.slice();
236
+ };
237
+ scale.rangeRound = function(_) {
238
+ return range = Array.from(_), interpolate$1 = interpolateRound, rescale();
239
+ };
240
+ scale.clamp = function(_) {
241
+ return arguments.length ? (clamp = _ ? true : identity, rescale()) : clamp !== identity;
242
+ };
243
+ scale.interpolate = function(_) {
244
+ return arguments.length ? (interpolate$1 = _, rescale()) : interpolate$1;
245
+ };
246
+ scale.unknown = function(_) {
247
+ return arguments.length ? (unknown = _, scale) : unknown;
248
+ };
249
+ return function(t, u) {
250
+ transform = t, untransform = u;
251
+ return rescale();
252
+ };
253
+ }
254
+ function continuous() {
255
+ return transformer()(identity, identity);
256
+ }
257
+ function tickFormat(start, stop, count, specifier) {
258
+ var step = tickStep(start, stop, count), precision;
259
+ specifier = defaultLocale.formatSpecifier(specifier == null ? ",f" : specifier);
260
+ switch (specifier.type) {
261
+ case "s": {
262
+ var value = Math.max(Math.abs(start), Math.abs(stop));
263
+ if (specifier.precision == null && !isNaN(precision = precisionPrefix(step, value))) specifier.precision = precision;
264
+ return defaultLocale.formatPrefix(specifier, value);
265
+ }
266
+ case "":
267
+ case "e":
268
+ case "g":
269
+ case "p":
270
+ case "r": {
271
+ if (specifier.precision == null && !isNaN(precision = precisionRound(step, Math.max(Math.abs(start), Math.abs(stop))))) specifier.precision = precision - (specifier.type === "e");
272
+ break;
273
+ }
274
+ case "f":
275
+ case "%": {
276
+ if (specifier.precision == null && !isNaN(precision = precisionFixed(step))) specifier.precision = precision - (specifier.type === "%") * 2;
277
+ break;
278
+ }
279
+ }
280
+ return defaultLocale.format(specifier);
281
+ }
282
+ function linearish(scale) {
283
+ var domain = scale.domain;
284
+ scale.ticks = function(count) {
285
+ var d = domain();
286
+ return ticks(d[0], d[d.length - 1], count == null ? 10 : count);
287
+ };
288
+ scale.tickFormat = function(count, specifier) {
289
+ var d = domain();
290
+ return tickFormat(d[0], d[d.length - 1], count == null ? 10 : count, specifier);
291
+ };
292
+ scale.nice = function(count) {
293
+ if (count == null) count = 10;
294
+ var d = domain();
295
+ var i0 = 0;
296
+ var i1 = d.length - 1;
297
+ var start = d[i0];
298
+ var stop = d[i1];
299
+ var prestep;
300
+ var step;
301
+ var maxIter = 10;
302
+ if (stop < start) {
303
+ step = start, start = stop, stop = step;
304
+ step = i0, i0 = i1, i1 = step;
305
+ }
306
+ while (maxIter-- > 0) {
307
+ step = tickIncrement(start, stop, count);
308
+ if (step === prestep) {
309
+ d[i0] = start;
310
+ d[i1] = stop;
311
+ return domain(d);
312
+ } else if (step > 0) {
313
+ start = Math.floor(start / step) * step;
314
+ stop = Math.ceil(stop / step) * step;
315
+ } else if (step < 0) {
316
+ start = Math.ceil(start * step) / step;
317
+ stop = Math.floor(stop * step) / step;
318
+ } else {
319
+ break;
320
+ }
321
+ prestep = step;
322
+ }
323
+ return scale;
324
+ };
325
+ return scale;
326
+ }
327
+ function linear() {
328
+ var scale = continuous();
329
+ scale.copy = function() {
330
+ return copy(scale, linear());
331
+ };
332
+ init.initRange.apply(scale, arguments);
333
+ return linearish(scale);
334
+ }
335
+ exports.bisector = bisector;
336
+ exports.continuous = continuous;
337
+ exports.copy = copy;
338
+ exports.linear = linear;
339
+ exports.tickStep = tickStep;
@@ -0,0 +1,340 @@
1
+ import { aW as constant, aX as interpolateNumber, aY as interpolateRgb, aZ as interpolateString, a_ as color } from "./index-CjSgoo1P.js";
2
+ import { i as initRange } from "./init-ZxktEp_H.js";
3
+ import { e as exponent, f as formatSpecifier, a as formatPrefix, b as format } from "./defaultLocale-DVr69WTU.js";
4
+ function ascending(a, b) {
5
+ return a == null || b == null ? NaN : a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;
6
+ }
7
+ function descending(a, b) {
8
+ return a == null || b == null ? NaN : b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN;
9
+ }
10
+ function bisector(f) {
11
+ let compare1, compare2, delta;
12
+ if (f.length !== 2) {
13
+ compare1 = ascending;
14
+ compare2 = (d, x) => ascending(f(d), x);
15
+ delta = (d, x) => f(d) - x;
16
+ } else {
17
+ compare1 = f === ascending || f === descending ? f : zero;
18
+ compare2 = f;
19
+ delta = f;
20
+ }
21
+ function left(a, x, lo = 0, hi = a.length) {
22
+ if (lo < hi) {
23
+ if (compare1(x, x) !== 0) return hi;
24
+ do {
25
+ const mid = lo + hi >>> 1;
26
+ if (compare2(a[mid], x) < 0) lo = mid + 1;
27
+ else hi = mid;
28
+ } while (lo < hi);
29
+ }
30
+ return lo;
31
+ }
32
+ function right(a, x, lo = 0, hi = a.length) {
33
+ if (lo < hi) {
34
+ if (compare1(x, x) !== 0) return hi;
35
+ do {
36
+ const mid = lo + hi >>> 1;
37
+ if (compare2(a[mid], x) <= 0) lo = mid + 1;
38
+ else hi = mid;
39
+ } while (lo < hi);
40
+ }
41
+ return lo;
42
+ }
43
+ function center(a, x, lo = 0, hi = a.length) {
44
+ const i = left(a, x, lo, hi - 1);
45
+ return i > lo && delta(a[i - 1], x) > -delta(a[i], x) ? i - 1 : i;
46
+ }
47
+ return { left, center, right };
48
+ }
49
+ function zero() {
50
+ return 0;
51
+ }
52
+ function number$1(x) {
53
+ return x === null ? NaN : +x;
54
+ }
55
+ const ascendingBisect = bisector(ascending);
56
+ const bisectRight = ascendingBisect.right;
57
+ bisector(number$1).center;
58
+ const e10 = Math.sqrt(50), e5 = Math.sqrt(10), e2 = Math.sqrt(2);
59
+ function tickSpec(start, stop, count) {
60
+ const step = (stop - start) / Math.max(0, count), power = Math.floor(Math.log10(step)), error = step / Math.pow(10, power), factor = error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1;
61
+ let i1, i2, inc;
62
+ if (power < 0) {
63
+ inc = Math.pow(10, -power) / factor;
64
+ i1 = Math.round(start * inc);
65
+ i2 = Math.round(stop * inc);
66
+ if (i1 / inc < start) ++i1;
67
+ if (i2 / inc > stop) --i2;
68
+ inc = -inc;
69
+ } else {
70
+ inc = Math.pow(10, power) * factor;
71
+ i1 = Math.round(start / inc);
72
+ i2 = Math.round(stop / inc);
73
+ if (i1 * inc < start) ++i1;
74
+ if (i2 * inc > stop) --i2;
75
+ }
76
+ if (i2 < i1 && 0.5 <= count && count < 2) return tickSpec(start, stop, count * 2);
77
+ return [i1, i2, inc];
78
+ }
79
+ function ticks(start, stop, count) {
80
+ stop = +stop, start = +start, count = +count;
81
+ if (!(count > 0)) return [];
82
+ if (start === stop) return [start];
83
+ const reverse = stop < start, [i1, i2, inc] = reverse ? tickSpec(stop, start, count) : tickSpec(start, stop, count);
84
+ if (!(i2 >= i1)) return [];
85
+ const n = i2 - i1 + 1, ticks2 = new Array(n);
86
+ if (reverse) {
87
+ if (inc < 0) for (let i = 0; i < n; ++i) ticks2[i] = (i2 - i) / -inc;
88
+ else for (let i = 0; i < n; ++i) ticks2[i] = (i2 - i) * inc;
89
+ } else {
90
+ if (inc < 0) for (let i = 0; i < n; ++i) ticks2[i] = (i1 + i) / -inc;
91
+ else for (let i = 0; i < n; ++i) ticks2[i] = (i1 + i) * inc;
92
+ }
93
+ return ticks2;
94
+ }
95
+ function tickIncrement(start, stop, count) {
96
+ stop = +stop, start = +start, count = +count;
97
+ return tickSpec(start, stop, count)[2];
98
+ }
99
+ function tickStep(start, stop, count) {
100
+ stop = +stop, start = +start, count = +count;
101
+ const reverse = stop < start, inc = reverse ? tickIncrement(stop, start, count) : tickIncrement(start, stop, count);
102
+ return (reverse ? -1 : 1) * (inc < 0 ? 1 / -inc : inc);
103
+ }
104
+ function numberArray(a, b) {
105
+ if (!b) b = [];
106
+ var n = a ? Math.min(b.length, a.length) : 0, c = b.slice(), i;
107
+ return function(t) {
108
+ for (i = 0; i < n; ++i) c[i] = a[i] * (1 - t) + b[i] * t;
109
+ return c;
110
+ };
111
+ }
112
+ function isNumberArray(x) {
113
+ return ArrayBuffer.isView(x) && !(x instanceof DataView);
114
+ }
115
+ function genericArray(a, b) {
116
+ var nb = b ? b.length : 0, na = a ? Math.min(nb, a.length) : 0, x = new Array(na), c = new Array(nb), i;
117
+ for (i = 0; i < na; ++i) x[i] = interpolate(a[i], b[i]);
118
+ for (; i < nb; ++i) c[i] = b[i];
119
+ return function(t) {
120
+ for (i = 0; i < na; ++i) c[i] = x[i](t);
121
+ return c;
122
+ };
123
+ }
124
+ function date(a, b) {
125
+ var d = /* @__PURE__ */ new Date();
126
+ return a = +a, b = +b, function(t) {
127
+ return d.setTime(a * (1 - t) + b * t), d;
128
+ };
129
+ }
130
+ function object(a, b) {
131
+ var i = {}, c = {}, k;
132
+ if (a === null || typeof a !== "object") a = {};
133
+ if (b === null || typeof b !== "object") b = {};
134
+ for (k in b) {
135
+ if (k in a) {
136
+ i[k] = interpolate(a[k], b[k]);
137
+ } else {
138
+ c[k] = b[k];
139
+ }
140
+ }
141
+ return function(t) {
142
+ for (k in i) c[k] = i[k](t);
143
+ return c;
144
+ };
145
+ }
146
+ function interpolate(a, b) {
147
+ var t = typeof b, c;
148
+ return b == null || t === "boolean" ? constant(b) : (t === "number" ? interpolateNumber : t === "string" ? (c = color(b)) ? (b = c, interpolateRgb) : interpolateString : b instanceof color ? interpolateRgb : b instanceof Date ? date : isNumberArray(b) ? numberArray : Array.isArray(b) ? genericArray : typeof b.valueOf !== "function" && typeof b.toString !== "function" || isNaN(b) ? object : interpolateNumber)(a, b);
149
+ }
150
+ function interpolateRound(a, b) {
151
+ return a = +a, b = +b, function(t) {
152
+ return Math.round(a * (1 - t) + b * t);
153
+ };
154
+ }
155
+ function precisionFixed(step) {
156
+ return Math.max(0, -exponent(Math.abs(step)));
157
+ }
158
+ function precisionPrefix(step, value) {
159
+ return Math.max(0, Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3 - exponent(Math.abs(step)));
160
+ }
161
+ function precisionRound(step, max) {
162
+ step = Math.abs(step), max = Math.abs(max) - step;
163
+ return Math.max(0, exponent(max) - exponent(step)) + 1;
164
+ }
165
+ function constants(x) {
166
+ return function() {
167
+ return x;
168
+ };
169
+ }
170
+ function number(x) {
171
+ return +x;
172
+ }
173
+ var unit = [0, 1];
174
+ function identity(x) {
175
+ return x;
176
+ }
177
+ function normalize(a, b) {
178
+ return (b -= a = +a) ? function(x) {
179
+ return (x - a) / b;
180
+ } : constants(isNaN(b) ? NaN : 0.5);
181
+ }
182
+ function clamper(a, b) {
183
+ var t;
184
+ if (a > b) t = a, a = b, b = t;
185
+ return function(x) {
186
+ return Math.max(a, Math.min(b, x));
187
+ };
188
+ }
189
+ function bimap(domain, range, interpolate2) {
190
+ var d0 = domain[0], d1 = domain[1], r0 = range[0], r1 = range[1];
191
+ if (d1 < d0) d0 = normalize(d1, d0), r0 = interpolate2(r1, r0);
192
+ else d0 = normalize(d0, d1), r0 = interpolate2(r0, r1);
193
+ return function(x) {
194
+ return r0(d0(x));
195
+ };
196
+ }
197
+ function polymap(domain, range, interpolate2) {
198
+ var j = Math.min(domain.length, range.length) - 1, d = new Array(j), r = new Array(j), i = -1;
199
+ if (domain[j] < domain[0]) {
200
+ domain = domain.slice().reverse();
201
+ range = range.slice().reverse();
202
+ }
203
+ while (++i < j) {
204
+ d[i] = normalize(domain[i], domain[i + 1]);
205
+ r[i] = interpolate2(range[i], range[i + 1]);
206
+ }
207
+ return function(x) {
208
+ var i2 = bisectRight(domain, x, 1, j) - 1;
209
+ return r[i2](d[i2](x));
210
+ };
211
+ }
212
+ function copy(source, target) {
213
+ return target.domain(source.domain()).range(source.range()).interpolate(source.interpolate()).clamp(source.clamp()).unknown(source.unknown());
214
+ }
215
+ function transformer() {
216
+ var domain = unit, range = unit, interpolate$1 = interpolate, transform, untransform, unknown, clamp = identity, piecewise, output, input;
217
+ function rescale() {
218
+ var n = Math.min(domain.length, range.length);
219
+ if (clamp !== identity) clamp = clamper(domain[0], domain[n - 1]);
220
+ piecewise = n > 2 ? polymap : bimap;
221
+ output = input = null;
222
+ return scale;
223
+ }
224
+ function scale(x) {
225
+ return x == null || isNaN(x = +x) ? unknown : (output || (output = piecewise(domain.map(transform), range, interpolate$1)))(transform(clamp(x)));
226
+ }
227
+ scale.invert = function(y) {
228
+ return clamp(untransform((input || (input = piecewise(range, domain.map(transform), interpolateNumber)))(y)));
229
+ };
230
+ scale.domain = function(_) {
231
+ return arguments.length ? (domain = Array.from(_, number), rescale()) : domain.slice();
232
+ };
233
+ scale.range = function(_) {
234
+ return arguments.length ? (range = Array.from(_), rescale()) : range.slice();
235
+ };
236
+ scale.rangeRound = function(_) {
237
+ return range = Array.from(_), interpolate$1 = interpolateRound, rescale();
238
+ };
239
+ scale.clamp = function(_) {
240
+ return arguments.length ? (clamp = _ ? true : identity, rescale()) : clamp !== identity;
241
+ };
242
+ scale.interpolate = function(_) {
243
+ return arguments.length ? (interpolate$1 = _, rescale()) : interpolate$1;
244
+ };
245
+ scale.unknown = function(_) {
246
+ return arguments.length ? (unknown = _, scale) : unknown;
247
+ };
248
+ return function(t, u) {
249
+ transform = t, untransform = u;
250
+ return rescale();
251
+ };
252
+ }
253
+ function continuous() {
254
+ return transformer()(identity, identity);
255
+ }
256
+ function tickFormat(start, stop, count, specifier) {
257
+ var step = tickStep(start, stop, count), precision;
258
+ specifier = formatSpecifier(specifier == null ? ",f" : specifier);
259
+ switch (specifier.type) {
260
+ case "s": {
261
+ var value = Math.max(Math.abs(start), Math.abs(stop));
262
+ if (specifier.precision == null && !isNaN(precision = precisionPrefix(step, value))) specifier.precision = precision;
263
+ return formatPrefix(specifier, value);
264
+ }
265
+ case "":
266
+ case "e":
267
+ case "g":
268
+ case "p":
269
+ case "r": {
270
+ if (specifier.precision == null && !isNaN(precision = precisionRound(step, Math.max(Math.abs(start), Math.abs(stop))))) specifier.precision = precision - (specifier.type === "e");
271
+ break;
272
+ }
273
+ case "f":
274
+ case "%": {
275
+ if (specifier.precision == null && !isNaN(precision = precisionFixed(step))) specifier.precision = precision - (specifier.type === "%") * 2;
276
+ break;
277
+ }
278
+ }
279
+ return format(specifier);
280
+ }
281
+ function linearish(scale) {
282
+ var domain = scale.domain;
283
+ scale.ticks = function(count) {
284
+ var d = domain();
285
+ return ticks(d[0], d[d.length - 1], count == null ? 10 : count);
286
+ };
287
+ scale.tickFormat = function(count, specifier) {
288
+ var d = domain();
289
+ return tickFormat(d[0], d[d.length - 1], count == null ? 10 : count, specifier);
290
+ };
291
+ scale.nice = function(count) {
292
+ if (count == null) count = 10;
293
+ var d = domain();
294
+ var i0 = 0;
295
+ var i1 = d.length - 1;
296
+ var start = d[i0];
297
+ var stop = d[i1];
298
+ var prestep;
299
+ var step;
300
+ var maxIter = 10;
301
+ if (stop < start) {
302
+ step = start, start = stop, stop = step;
303
+ step = i0, i0 = i1, i1 = step;
304
+ }
305
+ while (maxIter-- > 0) {
306
+ step = tickIncrement(start, stop, count);
307
+ if (step === prestep) {
308
+ d[i0] = start;
309
+ d[i1] = stop;
310
+ return domain(d);
311
+ } else if (step > 0) {
312
+ start = Math.floor(start / step) * step;
313
+ stop = Math.ceil(stop / step) * step;
314
+ } else if (step < 0) {
315
+ start = Math.ceil(start * step) / step;
316
+ stop = Math.floor(stop * step) / step;
317
+ } else {
318
+ break;
319
+ }
320
+ prestep = step;
321
+ }
322
+ return scale;
323
+ };
324
+ return scale;
325
+ }
326
+ function linear() {
327
+ var scale = continuous();
328
+ scale.copy = function() {
329
+ return copy(scale, linear());
330
+ };
331
+ initRange.apply(scale, arguments);
332
+ return linearish(scale);
333
+ }
334
+ export {
335
+ copy as a,
336
+ bisector as b,
337
+ continuous as c,
338
+ linear as l,
339
+ tickStep as t
340
+ };