billboard.js 3.18.0-next.2 → 3.18.0

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 (51) hide show
  1. package/dist/billboard.css +1 -1
  2. package/dist/billboard.js +319 -100
  3. package/dist/billboard.min.css +1 -1
  4. package/dist/billboard.min.js +10 -9
  5. package/dist/billboard.pkgd.js +2059 -1625
  6. package/dist/billboard.pkgd.min.js +23 -22
  7. package/dist/plugin/billboardjs-plugin-bubblecompare.js +2 -2
  8. package/dist/plugin/billboardjs-plugin-bubblecompare.min.js +2 -2
  9. package/dist/plugin/billboardjs-plugin-sparkline.js +305 -79
  10. package/dist/plugin/billboardjs-plugin-sparkline.min.js +4 -4
  11. package/dist/plugin/billboardjs-plugin-stanford.js +305 -79
  12. package/dist/plugin/billboardjs-plugin-stanford.min.js +11 -11
  13. package/dist/plugin/billboardjs-plugin-tableview.js +305 -79
  14. package/dist/plugin/billboardjs-plugin-tableview.min.js +6 -5
  15. package/dist/plugin/billboardjs-plugin-textoverlap.js +305 -79
  16. package/dist/plugin/billboardjs-plugin-textoverlap.min.js +4 -4
  17. package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.js +1743 -1528
  18. package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.min.js +8 -8
  19. package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.js +2047 -1606
  20. package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.min.js +10 -10
  21. package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.js +2048 -1607
  22. package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.min.js +17 -17
  23. package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.js +2049 -1608
  24. package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.min.js +13 -12
  25. package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.js +2050 -1609
  26. package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.min.js +10 -10
  27. package/dist/theme/dark.css +1 -1
  28. package/dist/theme/dark.min.css +1 -1
  29. package/dist/theme/datalab.css +1 -1
  30. package/dist/theme/datalab.min.css +1 -1
  31. package/dist/theme/graph.css +1 -1
  32. package/dist/theme/graph.min.css +1 -1
  33. package/dist/theme/insight.css +1 -1
  34. package/dist/theme/insight.min.css +1 -1
  35. package/dist/theme/modern.css +1 -1
  36. package/dist/theme/modern.min.css +1 -1
  37. package/dist-esm/billboard.js +441 -135
  38. package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +2 -2
  39. package/dist-esm/plugin/billboardjs-plugin-sparkline.js +2 -2
  40. package/dist-esm/plugin/billboardjs-plugin-stanford.js +2 -2
  41. package/dist-esm/plugin/billboardjs-plugin-tableview.js +416 -102
  42. package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +2 -2
  43. package/package.json +1 -1
  44. package/src/ChartInternal/ChartInternal.ts +1 -1
  45. package/src/ChartInternal/internals/tooltip.ts +11 -9
  46. package/src/config/Options/axis/y2.ts +0 -13
  47. package/src/config/Options/common/legend.ts +1 -0
  48. package/src/config/Options/common/point.ts +1 -1
  49. package/src/config/Options/common/tooltip.ts +3 -1
  50. package/src/module/sanitize.ts +471 -0
  51. package/src/module/util.ts +1 -131
@@ -5,7 +5,7 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.18.0-next.2
8
+ * @version 3.18.0
9
9
  * @requires billboard.js
10
10
  * @summary billboard.js plugin
11
11
  */
@@ -139,6 +139,308 @@ const [
139
139
  ] = getFallback(win);
140
140
 
141
141
 
142
+ ;// ./src/module/sanitize.ts
143
+ const ALLOWED_TAGS = /* @__PURE__ */ new Set([
144
+ // HTML tags for tooltip/legend templates
145
+ "span",
146
+ "div",
147
+ "p",
148
+ "br",
149
+ "b",
150
+ "i",
151
+ "em",
152
+ "strong",
153
+ "u",
154
+ "s",
155
+ "sub",
156
+ "sup",
157
+ "ul",
158
+ "ol",
159
+ "li",
160
+ "dl",
161
+ "dt",
162
+ "dd",
163
+ "table",
164
+ "thead",
165
+ "tbody",
166
+ "tfoot",
167
+ "tr",
168
+ "th",
169
+ "td",
170
+ "caption",
171
+ "colgroup",
172
+ "col",
173
+ "hr",
174
+ "pre",
175
+ "code",
176
+ "blockquote",
177
+ "a",
178
+ "img",
179
+ // SVG tags for point patterns
180
+ "svg",
181
+ "g",
182
+ "path",
183
+ "circle",
184
+ "ellipse",
185
+ "rect",
186
+ "line",
187
+ "polyline",
188
+ "polygon",
189
+ "text",
190
+ "tspan",
191
+ "textPath",
192
+ "use",
193
+ "defs",
194
+ "symbol",
195
+ "clipPath",
196
+ "mask",
197
+ "linearGradient",
198
+ "radialGradient",
199
+ "stop",
200
+ "pattern",
201
+ "marker",
202
+ "title",
203
+ "desc"
204
+ ]);
205
+ const ALLOWED_ATTRS = /* @__PURE__ */ new Set([
206
+ // Common attributes
207
+ "class",
208
+ "id",
209
+ "style",
210
+ "title",
211
+ "lang",
212
+ "dir",
213
+ // HTML specific
214
+ "href",
215
+ "src",
216
+ "alt",
217
+ "width",
218
+ "height",
219
+ "colspan",
220
+ "rowspan",
221
+ "scope",
222
+ "headers",
223
+ // SVG presentation attributes
224
+ "d",
225
+ "points",
226
+ "x",
227
+ "y",
228
+ "x1",
229
+ "x2",
230
+ "y1",
231
+ "y2",
232
+ "cx",
233
+ "cy",
234
+ "r",
235
+ "rx",
236
+ "ry",
237
+ "dx",
238
+ "dy",
239
+ "viewBox",
240
+ "preserveAspectRatio",
241
+ "transform",
242
+ "fill",
243
+ "fill-opacity",
244
+ "fill-rule",
245
+ "stroke",
246
+ "stroke-width",
247
+ "stroke-opacity",
248
+ "stroke-linecap",
249
+ "stroke-linejoin",
250
+ "stroke-dasharray",
251
+ "stroke-dashoffset",
252
+ "opacity",
253
+ "clip-path",
254
+ "clip-rule",
255
+ "mask",
256
+ "font-family",
257
+ "font-size",
258
+ "font-weight",
259
+ "font-style",
260
+ "text-anchor",
261
+ "dominant-baseline",
262
+ "offset",
263
+ "stop-color",
264
+ "stop-opacity",
265
+ "gradientUnits",
266
+ "gradientTransform",
267
+ "spreadMethod",
268
+ "patternUnits",
269
+ "patternTransform",
270
+ "marker-start",
271
+ "marker-mid",
272
+ "marker-end",
273
+ "markerWidth",
274
+ "markerHeight",
275
+ "refX",
276
+ "refY",
277
+ "xlink:href"
278
+ ]);
279
+ const ALLOWED_URI_PROTOCOLS = /* @__PURE__ */ new Set([
280
+ "http:",
281
+ "https:",
282
+ "mailto:"
283
+ ]);
284
+ const URI_ATTRS = /* @__PURE__ */ new Set(["href", "src", "xlink:href"]);
285
+ const TAG_NAME_REGEX = /^<\/?([a-zA-Z][a-zA-Z0-9]*)/;
286
+ const CLOSING_TAG_REGEX = /^<\/([a-zA-Z][a-zA-Z0-9]*)\s*>$/;
287
+ const OPENING_TAG_REGEX = /^<([a-zA-Z][a-zA-Z0-9]*)([\s\S]*?)(\/?)>$/;
288
+ const ATTR_REGEX = /([a-zA-Z][\w:-]*)\s*(?:=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+)))?/g;
289
+ const URL_IN_STYLE_REGEX = /url\s*\(\s*["']?([^"')]+)["']?\s*\)/gi;
290
+ const DANGEROUS_CSS_PATTERNS = [
291
+ "expression(",
292
+ "behavior:",
293
+ "binding:",
294
+ "@import",
295
+ "@charset",
296
+ "-moz-binding:"
297
+ ];
298
+ function decodeHTMLEntities(str) {
299
+ return str.replace(/&colon;/gi, ":").replace(/&newline;/gi, "\n").replace(/&tab;/gi, " ").replace(/&nbsp;/gi, " ").replace(/&lt;/gi, "<").replace(/&gt;/gi, ">").replace(/&amp;/gi, "&").replace(/&quot;/gi, '"').replace(/&apos;/gi, "'").replace(/&#(\d+);/gi, (_, code) => String.fromCharCode(parseInt(code, 10))).replace(/&#x([0-9a-f]+);/gi, (_, code) => String.fromCharCode(parseInt(code, 16)));
300
+ }
301
+ function isSafeURI(uri) {
302
+ const decoded = decodeHTMLEntities(uri).trim();
303
+ const normalized = decoded.replace(/[\s\u0000-\u001f]/g, "").toLowerCase();
304
+ if (!normalized || normalized.startsWith("#")) {
305
+ return true;
306
+ }
307
+ if (normalized.startsWith("/") || normalized.startsWith("./") || normalized.startsWith("../") || !normalized.includes(":")) {
308
+ return true;
309
+ }
310
+ const colonIndex = normalized.indexOf(":");
311
+ if (colonIndex > 0) {
312
+ const protocol = normalized.substring(0, colonIndex + 1);
313
+ return ALLOWED_URI_PROTOCOLS.has(protocol);
314
+ }
315
+ return false;
316
+ }
317
+ function sanitizeStyleValue(style) {
318
+ const decoded = decodeHTMLEntities(style);
319
+ const cleaned = decoded.replace(/[\u0000-\u001f]/g, "");
320
+ URL_IN_STYLE_REGEX.lastIndex = 0;
321
+ let match;
322
+ while ((match = URL_IN_STYLE_REGEX.exec(cleaned)) !== null) {
323
+ if (!isSafeURI(match[1])) {
324
+ return null;
325
+ }
326
+ }
327
+ const normalizedLower = cleaned.toLowerCase().replace(/\s/g, "");
328
+ for (const pattern of DANGEROUS_CSS_PATTERNS) {
329
+ if (normalizedLower.includes(pattern)) {
330
+ return null;
331
+ }
332
+ }
333
+ return style;
334
+ }
335
+ const ATTR_ENCODE_MAP = {
336
+ '"': "&quot;",
337
+ "'": "&#39;",
338
+ "`": "&#96;"
339
+ };
340
+ const ATTR_ENCODE_REGEX = /["'`]/g;
341
+ function encodeAttrValue(value) {
342
+ return value.replace(ATTR_ENCODE_REGEX, (char) => ATTR_ENCODE_MAP[char]);
343
+ }
344
+ function sanitizeAttrValue(name, value, wasUnquoted = false) {
345
+ if (URI_ATTRS.has(name)) {
346
+ if (!isSafeURI(value)) {
347
+ return null;
348
+ }
349
+ return wasUnquoted ? encodeAttrValue(value) : value;
350
+ }
351
+ if (name === "style") {
352
+ const sanitizedStyle = sanitizeStyleValue(value);
353
+ if (sanitizedStyle === null) {
354
+ return null;
355
+ }
356
+ return wasUnquoted ? encodeAttrValue(sanitizedStyle) : sanitizedStyle;
357
+ }
358
+ const decoded = decodeHTMLEntities(value).toLowerCase().replace(/\s/g, "");
359
+ if (/\bon\w+=/.test(decoded)) {
360
+ return null;
361
+ }
362
+ return wasUnquoted ? encodeAttrValue(value) : value;
363
+ }
364
+ function extractTagName(tag) {
365
+ const match = tag.match(TAG_NAME_REGEX);
366
+ return match ? match[1].toLowerCase() : null;
367
+ }
368
+ function isAllowedTag(tag) {
369
+ const tagName = extractTagName(tag);
370
+ return tagName !== null && ALLOWED_TAGS.has(tagName);
371
+ }
372
+ function sanitizeTag(fullTag) {
373
+ const closingMatch = fullTag.match(CLOSING_TAG_REGEX);
374
+ if (closingMatch) {
375
+ return `</${closingMatch[1].toLowerCase()}>`;
376
+ }
377
+ const openingMatch = fullTag.match(OPENING_TAG_REGEX);
378
+ if (!openingMatch) {
379
+ return "";
380
+ }
381
+ const [, tagName, attrString, selfClose] = openingMatch;
382
+ const lowerTagName = tagName.toLowerCase();
383
+ const allowedAttrs = [];
384
+ ATTR_REGEX.lastIndex = 0;
385
+ let attrMatch;
386
+ while ((attrMatch = ATTR_REGEX.exec(attrString)) !== null) {
387
+ const attrName = attrMatch[1].toLowerCase();
388
+ const doubleQuotedValue = attrMatch[2];
389
+ const singleQuotedValue = attrMatch[3];
390
+ const unquotedValue = attrMatch[4];
391
+ if (attrName.startsWith("on")) {
392
+ continue;
393
+ }
394
+ let attrValue;
395
+ let quoteChar;
396
+ if (doubleQuotedValue !== void 0) {
397
+ attrValue = doubleQuotedValue;
398
+ quoteChar = '"';
399
+ } else if (singleQuotedValue !== void 0) {
400
+ attrValue = singleQuotedValue;
401
+ quoteChar = "'";
402
+ } else if (unquotedValue !== void 0) {
403
+ attrValue = unquotedValue;
404
+ quoteChar = '"';
405
+ } else {
406
+ if (ALLOWED_ATTRS.has(attrName)) {
407
+ allowedAttrs.push(attrName);
408
+ }
409
+ continue;
410
+ }
411
+ if (ALLOWED_ATTRS.has(attrName)) {
412
+ const wasUnquoted = unquotedValue !== void 0;
413
+ const sanitizedValue = sanitizeAttrValue(attrName, attrValue, wasUnquoted);
414
+ if (sanitizedValue !== null) {
415
+ allowedAttrs.push(`${attrName}=${quoteChar}${sanitizedValue}${quoteChar}`);
416
+ }
417
+ }
418
+ }
419
+ const attrsStr = allowedAttrs.length > 0 ? ` ${allowedAttrs.join(" ")}` : "";
420
+ const selfCloseStr = selfClose ? "/>" : ">";
421
+ return `<${lowerTagName}${attrsStr}${selfCloseStr}`;
422
+ }
423
+ function sanitize(str) {
424
+ if (typeof str !== "string" || !str || str.indexOf("<") === -1) {
425
+ return str;
426
+ }
427
+ return str.replace(
428
+ /<\/?[^>]*>|[^<>\s]+>/g,
429
+ (match) => {
430
+ if (match.startsWith("<!--")) {
431
+ return "";
432
+ }
433
+ if (!match.startsWith("<")) {
434
+ return match.slice(0, -1) + "&gt;";
435
+ }
436
+ if (isAllowedTag(match)) {
437
+ return sanitizeTag(match);
438
+ }
439
+ return match.replace(/</g, "&lt;");
440
+ }
441
+ );
442
+ }
443
+
142
444
  ;// ./src/module/util.ts
143
445
  var __defProp = Object.defineProperty;
144
446
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
@@ -159,6 +461,7 @@ var __spreadValues = (a, b) => {
159
461
 
160
462
 
161
463
 
464
+
162
465
  function _getRect(relativeViewport, node, forceEval = false) {
163
466
  const _ = (n) => n[relativeViewport ? "getBoundingClientRect" : "getBBox"]();
164
467
  if (forceEval) {
@@ -176,66 +479,6 @@ function _forEachValidItem(items, callback) {
176
479
  }
177
480
  }
178
481
  }
179
- const _sanitize = (() => {
180
- const DANGEROUS_TAGS = "script|iframe|object|embed|form|input|button|textarea|select|style|link|meta|base|math|isindex";
181
- const ENTITY_MAP = {
182
- quot: 34,
183
- amp: 38,
184
- apos: 39,
185
- lt: 60,
186
- gt: 62,
187
- nbsp: 160,
188
- iexcl: 161,
189
- cent: 162,
190
- pound: 163,
191
- curren: 164,
192
- yen: 165
193
- };
194
- const LT_CODE = 60;
195
- const GT_CODE = 62;
196
- const MAX_ITERATIONS = 10;
197
- const rx = {
198
- tags: new RegExp(
199
- `<(${DANGEROUS_TAGS})\\b[\\s\\S]*?>([\\s\\S]*?<\\/(${DANGEROUS_TAGS})\\s*>)?`,
200
- "gi"
201
- ),
202
- htmlEntity: /&#x([0-9a-f]+);?|&#([0-9]+);?|&([a-z]+);/gi,
203
- // eslint-disable-next-line no-control-regex
204
- controlChar: /[\x00-\x1F\x7F]/g,
205
- eventHandler: /\s+on\w+\s*=\s*(?:"[^"]*"|'[^']*'|`[^`]*`|[^\s>]*)|on\w+\s*=\s*(?:"[^"]*"|'[^']*'|`[^`]*`|[^\s>]*)/gi,
206
- dangerousUri: /(href|src|action|xlink:href)\s*=\s*(['"`]?)([^'"`>\s]*)\2/gi,
207
- dangerousProtocol: /^(javascript|data|vbscript):/
208
- };
209
- return {
210
- ENTITY_MAP,
211
- LT_CODE,
212
- GT_CODE,
213
- MAX_ITERATIONS,
214
- rx,
215
- /**
216
- * Decode HTML entities to prevent bypass attacks
217
- * @param {string} str String with potential HTML entities
218
- * @returns {string} Decoded string
219
- */
220
- decodeEntities(str) {
221
- return str.replace(rx.htmlEntity, (match, hex, dec, named) => {
222
- const code = hex ? parseInt(hex, 16) : dec ? parseInt(dec, 10) : named ? ENTITY_MAP[named.toLowerCase()] || 0 : 0;
223
- return code && code !== LT_CODE && code !== GT_CODE ? String.fromCharCode(code) : match;
224
- });
225
- },
226
- /**
227
- * Remove dangerous URI protocols from attribute values
228
- * @param {string} str String to sanitize
229
- * @returns {string} Sanitized string
230
- */
231
- removeDangerousUris(str) {
232
- return str.replace(rx.dangerousUri, (match, attr, quote, value) => {
233
- const normalized = value.toLowerCase().replace(/\s/g, "");
234
- return rx.dangerousProtocol.test(normalized) ? `${attr}=${quote}${quote}` : match;
235
- });
236
- }
237
- };
238
- })();
239
482
  const isValue = (v) => v || v === 0;
240
483
  const isFunction = (v) => typeof v === "function";
241
484
  const isString = (v) => typeof v === "string";
@@ -282,23 +525,6 @@ function endall(transition, cb) {
282
525
  transition.call(end);
283
526
  }
284
527
  }
285
- function sanitize(str) {
286
- if (!isString(str) || !str || str.indexOf("<") === -1) {
287
- return str;
288
- }
289
- let result = str;
290
- let prev;
291
- let iterations = 0;
292
- do {
293
- prev = result;
294
- result = _sanitize.decodeEntities(result).replace(_sanitize.rx.controlChar, "").replace(_sanitize.rx.tags, "").replace(_sanitize.rx.eventHandler, "");
295
- result = _sanitize.removeDangerousUris(result);
296
- if (++iterations >= _sanitize.MAX_ITERATIONS) {
297
- break;
298
- }
299
- } while (result !== prev);
300
- return result;
301
- }
302
528
  function setTextValue(node, text, dy = [-1, 1], toMiddle = false) {
303
529
  if (!node || !isString(text)) {
304
530
  return;
@@ -789,7 +1015,7 @@ class Plugin {
789
1015
  });
790
1016
  }
791
1017
  }
792
- __publicField(Plugin, "version", "3.18.0-next.2");
1018
+ __publicField(Plugin, "version", "3.18.0");
793
1019
 
794
1020
  ;// ./src/Plugin/textoverlap/Options.ts
795
1021
  class Options {
@@ -5,9 +5,9 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.18.0-next.2
8
+ * @version 3.18.0
9
9
  * @requires billboard.js
10
10
  * @summary billboard.js plugin
11
- */(function(l,p){typeof exports=="object"&&typeof module=="object"?module.exports=p(require("d3-delaunay"),require("d3-polygon"),require("d3-brush"),require("d3-selection")):typeof define=="function"&&define.amd?define("bb",["d3-delaunay","d3-polygon","d3-brush","d3-selection"],p):typeof exports=="object"?exports.bb=p(require("d3-delaunay"),require("d3-polygon"),require("d3-brush"),require("d3-selection")):(l.bb=l.bb||{},l.bb.plugin=l.bb.plugin||{},l.bb.plugin.textoverlap=p(l.d3,l.d3,l.d3,l.d3))})(this,function(P,l,p,B){return(function(){"use strict";var N={263:(function(e){e.exports=l}),348:(function(e){e.exports=P}),747:(function(e){e.exports=B}),853:(function(e){e.exports=p})},T={};function u(e){var t=T[e];if(t!==void 0)return t.exports;var n=T[e]={exports:{}};return N[e](n,n.exports,u),n.exports}(function(){u.d=function(e,t){for(var n in t)u.o(t,n)&&!u.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}})(),(function(){u.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}})();var y={};u.d(y,{default:function(){return de}});var U=u(348),M=u(263),ge=u(853),_e=u(747);function V(){return typeof globalThis=="object"&&globalThis!==null&&globalThis.Object===Object&&globalThis||typeof global=="object"&&global!==null&&global.Object===Object&&global||typeof self=="object"&&self!==null&&self.Object===Object&&self||Function("return this")()}function L(e){const t=typeof(e==null?void 0:e.requestAnimationFrame)=="function"&&typeof(e==null?void 0:e.cancelAnimationFrame)=="function",n=typeof(e==null?void 0:e.requestIdleCallback)=="function"&&typeof(e==null?void 0:e.cancelIdleCallback)=="function",o=s=>setTimeout(s,1),r=s=>clearTimeout(s);return[t?e.requestAnimationFrame:o,t?e.cancelAnimationFrame:r,n?e.requestIdleCallback:o,n?e.cancelIdleCallback:r]}const x=V(),X=x==null?void 0:x.document,[ye,xe,ve,we]=L(x);var Y=Object.defineProperty,$=Object.getOwnPropertySymbols,z=Object.prototype.hasOwnProperty,G=Object.prototype.propertyIsEnumerable,j=(e,t,n)=>t in e?Y(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,C=(e,t)=>{for(var n in t||(t={}))z.call(t,n)&&j(e,n,t[n]);if($)for(var n of $(t))G.call(t,n)&&j(e,n,t[n]);return e};function R(e,t,n=!1){const o=r=>r[e?"getBoundingClientRect":"getBBox"]();return n?o(t):!("rect"in t)||"rect"in t&&t.hasAttribute("width")&&t.rect.width!==+(t.getAttribute("width")||0)?t.rect=o(t):t.rect}function D(e,t){for(let n=0;n<e.length;n++){const o=e[n];o&&t(o,n)}}const h=(()=>{const e="script|iframe|object|embed|form|input|button|textarea|select|style|link|meta|base|math|isindex",t={quot:34,amp:38,apos:39,lt:60,gt:62,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165},n=60,o=62,r=10,s={tags:new RegExp(`<(${e})\\b[\\s\\S]*?>([\\s\\S]*?<\\/(${e})\\s*>)?`,"gi"),htmlEntity:/&#x([0-9a-f]+);?|&#([0-9]+);?|&([a-z]+);/gi,controlChar:/[\x00-\x1F\x7F]/g,eventHandler:/\s+on\w+\s*=\s*(?:"[^"]*"|'[^']*'|`[^`]*`|[^\s>]*)|on\w+\s*=\s*(?:"[^"]*"|'[^']*'|`[^`]*`|[^\s>]*)/gi,dangerousUri:/(href|src|action|xlink:href)\s*=\s*(['"`]?)([^'"`>\s]*)\2/gi,dangerousProtocol:/^(javascript|data|vbscript):/};return{ENTITY_MAP:t,LT_CODE:n,GT_CODE:o,MAX_ITERATIONS:r,rx:s,decodeEntities(i){return i.replace(s.htmlEntity,(c,a,d,b)=>{const f=a?parseInt(a,16):d?parseInt(d,10):b&&t[b.toLowerCase()]||0;return f&&f!==n&&f!==o?String.fromCharCode(f):c})},removeDangerousUris(i){return i.replace(s.dangerousUri,(c,a,d,b)=>{const f=b.toLowerCase().replace(/\s/g,"");return s.dangerousProtocol.test(f)?`${a}=${d}${d}`:c})}}})(),Oe=e=>e||e===0,H=e=>typeof e=="function",m=e=>typeof e=="string",v=e=>typeof e=="number",k=e=>typeof e=="undefined",I=e=>typeof e!="undefined",Ee=e=>typeof e=="boolean",Ae=e=>Math.ceil(e/10)*10,Pe=e=>Math.ceil(e)+.5,Te=e=>e[1]-e[0],w=e=>typeof e=="object",K=e=>{for(const t in e)return!1;return!0},W=e=>k(e)||e===null||m(e)&&e.length===0||w(e)&&!(e instanceof Date)&&K(e)||v(e)&&isNaN(e),J=e=>!W(e),O=e=>Array.isArray(e),g=e=>e&&!(e!=null&&e.nodeType)&&w(e)&&!O(e);function Me(e,t,n){return I(e[t])?e[t]:n}function $e(e,t){let n=!1;return Object.keys(e).forEach(o=>e[o]===t&&(n=!0)),n}function je(e,t,...n){const o=H(e);return o&&e.call(t,...n),o}function Ce(e,t){let n=0;const o=function(...r){!--n&&t.apply(this,...r)};"duration"in e?e.each(()=>++n).on("end",o):(++n,e.call(o))}function Q(e){if(!m(e)||!e||e.indexOf("<")===-1)return e;let t=e,n,o=0;do if(n=t,t=h.decodeEntities(t).replace(h.rx.controlChar,"").replace(h.rx.tags,"").replace(h.rx.eventHandler,""),t=h.removeDangerousUris(t),++o>=h.MAX_ITERATIONS)break;while(t!==n);return t}function Re(e,t,n=[-1,1],o=!1){if(!(!e||!m(t)))if(t.indexOf(`
12
- `)===-1)e.text(t);else{const r=[e.text(),t].map(s=>s.replace(/[\s\n]/g,""));if(r[0]!==r[1]){const s=t.split(`
13
- `),i=o?s.length-1:1;e.html(""),s.forEach((c,a)=>{e.append("tspan").attr("x",0).attr("dy",`${a===0?n[0]*i:n[1]}em`).text(c)})}}}function Z(e){const{x:t,y:n,width:o,height:r}=e.getBBox();return[{x:t,y:n+r},{x:t,y:n},{x:t+o,y:n},{x:t+o,y:n+r}]}function De(e){const{width:t,height:n}=F(e),o=Z(e),r=o[0].x,s=Math.min(o[0].y,o[1].y);return{x:r,y:s,width:t,height:n}}function Ie(e,t){var n;const o=e&&((n=e.touches||e.sourceEvent&&e.sourceEvent.touches)==null?void 0:n[0]);let r=[0,0];try{r=d3Pointer(o||e,t)}catch(s){}return r.map(s=>isNaN(s)?0:s)}function ee(e){const{event:t,$el:n}=e,o=n.subchart.main||n.main;let r;return t&&t.type==="brush"?r=t.selection:o&&(r=o.select(".bb-brush").node())&&(r=d3BrushSelection(r)),r}function F(e,t=!1){return R(!0,e,t)}function Fe(e,t=!1){return R(!1,e,t)}function Se(e=!0,t=0,n=1e4){const o=window.crypto||window.msCrypto,r=o?t+o.getRandomValues(new Uint32Array(1))[0]%(n-t+1):Math.floor(Math.random()*(n-t)+t);return e?String(r):r}function S(e,t,n,o,r){if(n>o)return-1;const s=Math.floor((n+o)/2);let{x:i,w:c=0}=e[s];return r&&(i=e[s].y,c=e[s].h),t>=i&&t<=i+c?s:t<i?S(e,t,n,s-1,r):S(e,t,s+1,o,r)}function qe(e){const t=ee(e);return t?t[0]===t[1]:!0}function Be(...e){const t=n=>{if(g(n)&&n.constructor){const o=new n.constructor;for(const r in n)o[r]=t(n[r]);return o}return n};return e.map(n=>t(n)).reduce((n,o)=>C(C({},n),o))}function te(e={},t){O(t)&&t.forEach(n=>te(e,n));for(const n in t)/^\d+$/.test(n)||n in e||(e[n]=t[n]);return e}const Ne=e=>e.charAt(0).toUpperCase()+e.slice(1);function Ue(e,t="-"){return e.split(t).map((n,o)=>o?n.charAt(0).toUpperCase()+n.slice(1).toLowerCase():n.toLowerCase()).join("")}const ne=e=>[].slice.call(e);function Ve(e,t,n){const{rootSelector:o="",sheet:r}=e,i=`${o} ${(c=>c.replace(/\s?(bb-)/g,".$1").replace(/\.+/g,"."))(t)} {${n.join(";")}}`;return r[r.insertRule?"insertRule":"addRule"](i,r.cssRules.length)}function Le(e){let t=[];return e.forEach(n=>{var o;try{n.cssRules&&n.cssRules.length&&(t=t.concat(ne(n.cssRules)))}catch(r){(o=window.console)==null||o.warn(`Error while reading rules from ${n.href}: ${r.toString()}`)}}),t}function Xe(e){var t,n,o,r,s,i;return{x:((n=(t=window.pageXOffset)!=null?t:window.scrollX)!=null?n:0)+((o=e.scrollLeft)!=null?o:0),y:((s=(r=window.pageYOffset)!=null?r:window.scrollY)!=null?s:0)+((i=e.scrollTop)!=null?i:0)}}function Ye(e,t=0,n=0,o=!0){const r=new DOMPoint(t,n),s=e.getScreenCTM(),i=r.matrixTransform(o?s==null?void 0:s.inverse():s);if(o===!1){const c=F(e);i.x-=c.x,i.y-=c.y}return i}function ze(e){const t=e?e.transform:null,n=t&&t.baseVal;return n&&n.numberOfItems?n.getItem(0).matrix:{a:0,b:0,c:0,d:0,e:0,f:0}}function Ge(e){const t=e[0]instanceof Date,n=(t?e.map(Number):e).filter((o,r,s)=>s.indexOf(o)===r);return t?n.map(o=>new Date(o)):n}function He(e){return e&&e.length?e.reduce((t,n)=>t.concat(n)):[]}function E(e,...t){if(!t.length||t.length===1&&!t[0])return e;const n=t.shift();return g(e)&&g(n)&&Object.keys(n).forEach(o=>{if(!/^(__proto__|constructor|prototype)$/i.test(o)){const r=n[o];g(r)?(!e[o]&&(e[o]={}),e[o]=E(e[o],r)):e[o]=O(r)?r.concat():r}}),E(e,...t)}function oe(e,t=!0){let n;return e[0]instanceof Date?n=t?(o,r)=>o-r:(o,r)=>r-o:t&&!e.every(isNaN)?n=(o,r)=>o-r:t||(n=(o,r)=>o>r&&-1||o<r&&1||o===r&&0),e.concat().sort(n)}function ke(e,t){let n=t.filter(o=>J(o));return n.length?v(n[0])?n=Math[e](...n):n[0]instanceof Date&&(n=oe(n,e==="min")[0]):n=void 0,n}const Ke=(e,t,n=1)=>{const o=[],r=Math.max(0,Math.ceil((t-e)/n))|0;for(let s=e;s<r;s++)o.push(e+s*n);return o},We={mouse:(()=>{const e=()=>({bubbles:!1,cancelable:!1,screenX:0,screenY:0,clientX:0,clientY:0});try{return new MouseEvent("t"),(t,n,o=e())=>{t.dispatchEvent(new MouseEvent(n,o))}}catch(t){return(n,o,r=e())=>{const s=X.createEvent("MouseEvent");s.initMouseEvent(o,r.bubbles,r.cancelable,x,0,r.screenX,r.screenY,r.clientX,r.clientY,!1,!1,!1,!1,0,null),n.dispatchEvent(s)}}})(),touch:(e,t,n)=>{const o=new Touch(E({identifier:Date.now(),target:e,radiusX:2.5,radiusY:2.5,rotationAngle:10,force:.5},n));e.dispatchEvent(new TouchEvent(t,{cancelable:!0,bubbles:!0,shiftKey:!0,touches:[o],targetTouches:[],changedTouches:[o]}))}};function Je(e,t){let n=e;for(const o in t)n=n.replace(new RegExp(`{=${o}}`,"g"),t[o]);return Q(n)}function Qe(e){var t;let n;if(e instanceof Date)n=e;else if(m(e)){const{config:o,format:r}=this;n=(t=r.dataTime(o.data_xFormat)(e))!=null?t:new Date(e)}else v(e)&&!isNaN(e)&&(n=new Date(+e));return(!n||isNaN(+n))&&console&&console.error&&console.error(`Failed to parse x '${e}' to Date object`),n}function Ze(e){const t=e.attr("viewBox");return t?/(\d+(\.\d+)?){3}/.test(t):!1}function et(e,t,n=!1){const o=!!e.node;let r=!1;for(const[s,i]of Object.entries(t))if(r=o?e.style(s)===i:e.style[s]===i,n===!1&&r)break;return r}function tt(){var e,t;return((e=document)==null?void 0:e.hidden)===!1||((t=document)==null?void 0:t.visibilityState)==="visible"}function nt(e,t){const{DocumentTouch:n,matchMedia:o,navigator:r}=window,s=o==null?void 0:o("(pointer:coarse)").matches;let i=!1;if(t)if(r&&"maxTouchPoints"in r)i=r.maxTouchPoints>0;else if("ontouchmove"in window||n&&document instanceof n)i=!0;else if(s)i=!0;else{const a=r.userAgent;i=/\b(BlackBerry|webOS|iPhone|IEMobile)\b/i.test(a)||/\b(Android|Windows Phone|iPad|iPod)\b/i.test(a)}return e&&!s&&(o==null?void 0:o("(pointer:fine)").matches)&&"mouse"||i&&"touch"||"mouse"}function re(e,t){t()===!1?requestAnimationFrame(()=>re(e,t)):e()}function ot(e){if(g(e)&&!m(e)){const i=e;return{top:i.top||0,right:i.right||0,bottom:i.bottom||0,left:i.left||0}}const t=(m(e)?e.trim().split(/\s+/):[e]).map(i=>+i||0),[n,o=n,r=n,s=o]=t;return{top:n,right:o,bottom:r,left:s}}function rt(e,t){e.pendingRaf!==null?(window.cancelAnimationFrame(e.pendingRaf),e.pendingRaf=window.requestAnimationFrame(()=>{e.pendingRaf=null,t()})):(e.pendingRaf=window.requestAnimationFrame(()=>{e.pendingRaf=null}),t())}function st(e,t=(n=>n)){const n=new Set;return D(e,(o,r)=>{n.add(t(o,r))}),n}function it(e,t,n=(o=>o)){const o=new Map;return D(e,(r,s)=>{o.set(t(r,s),n(r,s))}),o}function se(e){const t=this.config;let n,o,r;const s=()=>{const i=o.shift();if(i&&n&&w(n)&&i in n)return n=n[i],s();if(!i)return n};Object.keys(t).forEach(i=>{n=e,o=i.split("_"),r=s(),I(r)&&(t[i]=r)}),this.api&&(this.state.orgConfig=e)}var ie=Object.defineProperty,ce=(e,t,n)=>t in e?ie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,A=(e,t,n)=>ce(e,typeof t!="symbol"?t+"":t,n);class q{constructor(t={}){A(this,"$$"),A(this,"options"),this.options=t}$beforeInit(){}$init(){}$afterInit(){}$redraw(){}$willDestroy(){Object.keys(this).forEach(t=>{this[t]=null,delete this[t]})}}A(q,"version","3.18.0-next.2");class le{constructor(){return{selector:void 0,extent:1,area:0}}}var ae=Object.defineProperty,ue=(e,t,n)=>t in e?ae(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,fe=(e,t,n)=>ue(e,typeof t!="symbol"?t+"":t,n);class de extends q{constructor(t){return super(t),fe(this,"config"),this.config=new le,this}$init(){se.call(this,this.options)}$redraw(){const{$$:{$el:t},config:{selector:n}}=this,o=n?t.main.selectAll(n):t.text;!o.empty()&&this.preventLabelOverlap(o)}generateVoronoi(t){const{$$:n}=this,{scale:o}=n,[r,s]=["x","y"].map(i=>o[i].domain());return[r[1],s[0]]=[s[0],r[1]],U.Delaunay.from(t).voronoi([...r,...s])}preventLabelOverlap(t){const{extent:n,area:o}=this.config,r=t.data().map(c=>[c.index,c.value]),s=this.generateVoronoi(r);let i=0;t.each(function(){const c=s.cellPolygon(i);if(c&&this){const[a,d]=r[i],[b,f]=(0,M.polygonCentroid)(c),pe=Math.abs((0,M.polygonArea)(c)),_=Math.round(Math.atan2(f-d,b-a)/Math.PI*2),he=n*(_===0?1:-1),me=_===-1?-n:n+5,be=Math.abs(_)===1?"middle":_===0?"start":"end";this.style.display=pe<o?"none":"",this.setAttribute("text-anchor",be),this.setAttribute("dy",`0.${_===1?71:35}em`),this.setAttribute("transform",`translate(${he}, ${me})`)}i++})}}return y=y.default,y})()});
11
+ */(function(l,u){typeof exports=="object"&&typeof module=="object"?module.exports=u(require("d3-delaunay"),require("d3-polygon"),require("d3-brush"),require("d3-selection")):typeof define=="function"&&define.amd?define("bb",["d3-delaunay","d3-polygon","d3-brush","d3-selection"],u):typeof exports=="object"?exports.bb=u(require("d3-delaunay"),require("d3-polygon"),require("d3-brush"),require("d3-selection")):(l.bb=l.bb||{},l.bb.plugin=l.bb.plugin||{},l.bb.plugin.textoverlap=u(l.d3,l.d3,l.d3,l.d3))})(this,function(v,l,u,q){return(function(){"use strict";var F={263:(function(e){e.exports=l}),348:(function(e){e.exports=v}),747:(function(e){e.exports=q}),853:(function(e){e.exports=u})},O={};function a(e){var t=O[e];if(t!==void 0)return t.exports;var n=O[e]={exports:{}};return F[e](n,n.exports,a),n.exports}(function(){a.d=function(e,t){for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}})(),(function(){a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}})();var m={};a.d(m,{default:function(){return ce}});var B=a(348),P=a(263),me=a(853),be=a(747);function I(){return typeof globalThis=="object"&&globalThis!==null&&globalThis.Object===Object&&globalThis||typeof global=="object"&&global!==null&&global.Object===Object&&global||typeof self=="object"&&self!==null&&self.Object===Object&&self||Function("return this")()}function S(e){const t=typeof(e==null?void 0:e.requestAnimationFrame)=="function"&&typeof(e==null?void 0:e.cancelAnimationFrame)=="function",n=typeof(e==null?void 0:e.requestIdleCallback)=="function"&&typeof(e==null?void 0:e.cancelIdleCallback)=="function",o=i=>setTimeout(i,1),r=i=>clearTimeout(i);return[t?e.requestAnimationFrame:o,t?e.cancelAnimationFrame:r,n?e.requestIdleCallback:o,n?e.cancelIdleCallback:r]}const b=I(),V=b==null?void 0:b.document,[_e,ge,ye,xe]=S(b);var N=Object.defineProperty,E=Object.getOwnPropertySymbols,U=Object.prototype.hasOwnProperty,X=Object.prototype.propertyIsEnumerable,A=(e,t,n)=>t in e?N(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,M=(e,t)=>{for(var n in t||(t={}))U.call(t,n)&&A(e,n,t[n]);if(E)for(var n of E(t))X.call(t,n)&&A(e,n,t[n]);return e};function j(e,t,n=!1){const o=r=>r[e?"getBoundingClientRect":"getBBox"]();return n?o(t):!("rect"in t)||"rect"in t&&t.hasAttribute("width")&&t.rect.width!==+(t.getAttribute("width")||0)?t.rect=o(t):t.rect}function T(e,t){for(let n=0;n<e.length;n++){const o=e[n];o&&t(o,n)}}const we=e=>e||e===0,Y=e=>typeof e=="function",d=e=>typeof e=="string",_=e=>typeof e=="number",L=e=>typeof e=="undefined",$=e=>typeof e!="undefined",ve=e=>typeof e=="boolean",Oe=e=>Math.ceil(e/10)*10,Pe=e=>Math.ceil(e)+.5,Ee=e=>e[1]-e[0],g=e=>typeof e=="object",z=e=>{for(const t in e)return!1;return!0},G=e=>L(e)||e===null||d(e)&&e.length===0||g(e)&&!(e instanceof Date)&&z(e)||_(e)&&isNaN(e),H=e=>!G(e),y=e=>Array.isArray(e),p=e=>e&&!(e!=null&&e.nodeType)&&g(e)&&!y(e);function Ae(e,t,n){return $(e[t])?e[t]:n}function Me(e,t){let n=!1;return Object.keys(e).forEach(o=>e[o]===t&&(n=!0)),n}function je(e,t,...n){const o=Y(e);return o&&e.call(t,...n),o}function Te(e,t){let n=0;const o=function(...r){!--n&&t.apply(this,...r)};"duration"in e?e.each(()=>++n).on("end",o):(++n,e.call(o))}function $e(e,t,n=[-1,1],o=!1){if(!(!e||!d(t)))if(t.indexOf(`
12
+ `)===-1)e.text(t);else{const r=[e.text(),t].map(i=>i.replace(/[\s\n]/g,""));if(r[0]!==r[1]){const i=t.split(`
13
+ `),s=o?i.length-1:1;e.html(""),i.forEach((c,f)=>{e.append("tspan").attr("x",0).attr("dy",`${f===0?n[0]*s:n[1]}em`).text(c)})}}}function K(e){const{x:t,y:n,width:o,height:r}=e.getBBox();return[{x:t,y:n+r},{x:t,y:n},{x:t+o,y:n},{x:t+o,y:n+r}]}function Re(e){const{width:t,height:n}=R(e),o=K(e),r=o[0].x,i=Math.min(o[0].y,o[1].y);return{x:r,y:i,width:t,height:n}}function Ce(e,t){var n;const o=e&&((n=e.touches||e.sourceEvent&&e.sourceEvent.touches)==null?void 0:n[0]);let r=[0,0];try{r=d3Pointer(o||e,t)}catch(i){}return r.map(i=>isNaN(i)?0:i)}function W(e){const{event:t,$el:n}=e,o=n.subchart.main||n.main;let r;return t&&t.type==="brush"?r=t.selection:o&&(r=o.select(".bb-brush").node())&&(r=d3BrushSelection(r)),r}function R(e,t=!1){return j(!0,e,t)}function De(e,t=!1){return j(!1,e,t)}function qe(e=!0,t=0,n=1e4){const o=window.crypto||window.msCrypto,r=o?t+o.getRandomValues(new Uint32Array(1))[0]%(n-t+1):Math.floor(Math.random()*(n-t)+t);return e?String(r):r}function C(e,t,n,o,r){if(n>o)return-1;const i=Math.floor((n+o)/2);let{x:s,w:c=0}=e[i];return r&&(s=e[i].y,c=e[i].h),t>=s&&t<=s+c?i:t<s?C(e,t,n,i-1,r):C(e,t,i+1,o,r)}function Fe(e){const t=W(e);return t?t[0]===t[1]:!0}function Be(...e){const t=n=>{if(p(n)&&n.constructor){const o=new n.constructor;for(const r in n)o[r]=t(n[r]);return o}return n};return e.map(n=>t(n)).reduce((n,o)=>M(M({},n),o))}function J(e={},t){y(t)&&t.forEach(n=>J(e,n));for(const n in t)/^\d+$/.test(n)||n in e||(e[n]=t[n]);return e}const Ie=e=>e.charAt(0).toUpperCase()+e.slice(1);function Se(e,t="-"){return e.split(t).map((n,o)=>o?n.charAt(0).toUpperCase()+n.slice(1).toLowerCase():n.toLowerCase()).join("")}const Q=e=>[].slice.call(e);function Ve(e,t,n){const{rootSelector:o="",sheet:r}=e,s=`${o} ${(c=>c.replace(/\s?(bb-)/g,".$1").replace(/\.+/g,"."))(t)} {${n.join(";")}}`;return r[r.insertRule?"insertRule":"addRule"](s,r.cssRules.length)}function Ne(e){let t=[];return e.forEach(n=>{var o;try{n.cssRules&&n.cssRules.length&&(t=t.concat(Q(n.cssRules)))}catch(r){(o=window.console)==null||o.warn(`Error while reading rules from ${n.href}: ${r.toString()}`)}}),t}function Ue(e){var t,n,o,r,i,s;return{x:((n=(t=window.pageXOffset)!=null?t:window.scrollX)!=null?n:0)+((o=e.scrollLeft)!=null?o:0),y:((i=(r=window.pageYOffset)!=null?r:window.scrollY)!=null?i:0)+((s=e.scrollTop)!=null?s:0)}}function Xe(e,t=0,n=0,o=!0){const r=new DOMPoint(t,n),i=e.getScreenCTM(),s=r.matrixTransform(o?i==null?void 0:i.inverse():i);if(o===!1){const c=R(e);s.x-=c.x,s.y-=c.y}return s}function Ye(e){const t=e?e.transform:null,n=t&&t.baseVal;return n&&n.numberOfItems?n.getItem(0).matrix:{a:0,b:0,c:0,d:0,e:0,f:0}}function Le(e){const t=e[0]instanceof Date,n=(t?e.map(Number):e).filter((o,r,i)=>i.indexOf(o)===r);return t?n.map(o=>new Date(o)):n}function ze(e){return e&&e.length?e.reduce((t,n)=>t.concat(n)):[]}function x(e,...t){if(!t.length||t.length===1&&!t[0])return e;const n=t.shift();return p(e)&&p(n)&&Object.keys(n).forEach(o=>{if(!/^(__proto__|constructor|prototype)$/i.test(o)){const r=n[o];p(r)?(!e[o]&&(e[o]={}),e[o]=x(e[o],r)):e[o]=y(r)?r.concat():r}}),x(e,...t)}function Z(e,t=!0){let n;return e[0]instanceof Date?n=t?(o,r)=>o-r:(o,r)=>r-o:t&&!e.every(isNaN)?n=(o,r)=>o-r:t||(n=(o,r)=>o>r&&-1||o<r&&1||o===r&&0),e.concat().sort(n)}function Ge(e,t){let n=t.filter(o=>H(o));return n.length?_(n[0])?n=Math[e](...n):n[0]instanceof Date&&(n=Z(n,e==="min")[0]):n=void 0,n}const He=(e,t,n=1)=>{const o=[],r=Math.max(0,Math.ceil((t-e)/n))|0;for(let i=e;i<r;i++)o.push(e+i*n);return o},Ke={mouse:(()=>{const e=()=>({bubbles:!1,cancelable:!1,screenX:0,screenY:0,clientX:0,clientY:0});try{return new MouseEvent("t"),(t,n,o=e())=>{t.dispatchEvent(new MouseEvent(n,o))}}catch(t){return(n,o,r=e())=>{const i=V.createEvent("MouseEvent");i.initMouseEvent(o,r.bubbles,r.cancelable,b,0,r.screenX,r.screenY,r.clientX,r.clientY,!1,!1,!1,!1,0,null),n.dispatchEvent(i)}}})(),touch:(e,t,n)=>{const o=new Touch(x({identifier:Date.now(),target:e,radiusX:2.5,radiusY:2.5,rotationAngle:10,force:.5},n));e.dispatchEvent(new TouchEvent(t,{cancelable:!0,bubbles:!0,shiftKey:!0,touches:[o],targetTouches:[],changedTouches:[o]}))}};function We(e,t){let n=e;for(const o in t)n=n.replace(new RegExp(`{=${o}}`,"g"),t[o]);return sanitize(n)}function Je(e){var t;let n;if(e instanceof Date)n=e;else if(d(e)){const{config:o,format:r}=this;n=(t=r.dataTime(o.data_xFormat)(e))!=null?t:new Date(e)}else _(e)&&!isNaN(e)&&(n=new Date(+e));return(!n||isNaN(+n))&&console&&console.error&&console.error(`Failed to parse x '${e}' to Date object`),n}function Qe(e){const t=e.attr("viewBox");return t?/(\d+(\.\d+)?){3}/.test(t):!1}function Ze(e,t,n=!1){const o=!!e.node;let r=!1;for(const[i,s]of Object.entries(t))if(r=o?e.style(i)===s:e.style[i]===s,n===!1&&r)break;return r}function ke(){var e,t;return((e=document)==null?void 0:e.hidden)===!1||((t=document)==null?void 0:t.visibilityState)==="visible"}function et(e,t){const{DocumentTouch:n,matchMedia:o,navigator:r}=window,i=o==null?void 0:o("(pointer:coarse)").matches;let s=!1;if(t)if(r&&"maxTouchPoints"in r)s=r.maxTouchPoints>0;else if("ontouchmove"in window||n&&document instanceof n)s=!0;else if(i)s=!0;else{const f=r.userAgent;s=/\b(BlackBerry|webOS|iPhone|IEMobile)\b/i.test(f)||/\b(Android|Windows Phone|iPad|iPod)\b/i.test(f)}return e&&!i&&(o==null?void 0:o("(pointer:fine)").matches)&&"mouse"||s&&"touch"||"mouse"}function k(e,t){t()===!1?requestAnimationFrame(()=>k(e,t)):e()}function tt(e){if(p(e)&&!d(e)){const s=e;return{top:s.top||0,right:s.right||0,bottom:s.bottom||0,left:s.left||0}}const t=(d(e)?e.trim().split(/\s+/):[e]).map(s=>+s||0),[n,o=n,r=n,i=o]=t;return{top:n,right:o,bottom:r,left:i}}function nt(e,t){e.pendingRaf!==null?(window.cancelAnimationFrame(e.pendingRaf),e.pendingRaf=window.requestAnimationFrame(()=>{e.pendingRaf=null,t()})):(e.pendingRaf=window.requestAnimationFrame(()=>{e.pendingRaf=null}),t())}function ot(e,t=(n=>n)){const n=new Set;return T(e,(o,r)=>{n.add(t(o,r))}),n}function rt(e,t,n=(o=>o)){const o=new Map;return T(e,(r,i)=>{o.set(t(r,i),n(r,i))}),o}function ee(e){const t=this.config;let n,o,r;const i=()=>{const s=o.shift();if(s&&n&&g(n)&&s in n)return n=n[s],i();if(!s)return n};Object.keys(t).forEach(s=>{n=e,o=s.split("_"),r=i(),$(r)&&(t[s]=r)}),this.api&&(this.state.orgConfig=e)}var te=Object.defineProperty,ne=(e,t,n)=>t in e?te(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,w=(e,t,n)=>ne(e,typeof t!="symbol"?t+"":t,n);class D{constructor(t={}){w(this,"$$"),w(this,"options"),this.options=t}$beforeInit(){}$init(){}$afterInit(){}$redraw(){}$willDestroy(){Object.keys(this).forEach(t=>{this[t]=null,delete this[t]})}}w(D,"version","3.18.0");class oe{constructor(){return{selector:void 0,extent:1,area:0}}}var re=Object.defineProperty,ie=(e,t,n)=>t in e?re(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,se=(e,t,n)=>ie(e,typeof t!="symbol"?t+"":t,n);class ce extends D{constructor(t){return super(t),se(this,"config"),this.config=new oe,this}$init(){ee.call(this,this.options)}$redraw(){const{$$:{$el:t},config:{selector:n}}=this,o=n?t.main.selectAll(n):t.text;!o.empty()&&this.preventLabelOverlap(o)}generateVoronoi(t){const{$$:n}=this,{scale:o}=n,[r,i]=["x","y"].map(s=>o[s].domain());return[r[1],i[0]]=[i[0],r[1]],B.Delaunay.from(t).voronoi([...r,...i])}preventLabelOverlap(t){const{extent:n,area:o}=this.config,r=t.data().map(c=>[c.index,c.value]),i=this.generateVoronoi(r);let s=0;t.each(function(){const c=i.cellPolygon(s);if(c&&this){const[f,le]=r[s],[ae,ue]=(0,P.polygonCentroid)(c),fe=Math.abs((0,P.polygonArea)(c)),h=Math.round(Math.atan2(ue-le,ae-f)/Math.PI*2),de=n*(h===0?1:-1),pe=h===-1?-n:n+5,he=Math.abs(h)===1?"middle":h===0?"start":"end";this.style.display=fe<o?"none":"",this.setAttribute("text-anchor",he),this.setAttribute("dy",`0.${h===1?71:35}em`),this.setAttribute("transform",`translate(${de}, ${pe})`)}s++})}}return m=m.default,m})()});