billboard.js 3.16.0-next.1 → 3.16.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 (72) hide show
  1. package/dist/billboard.css +2 -1
  2. package/dist/billboard.js +215 -165
  3. package/dist/billboard.min.css +2 -2
  4. package/dist/billboard.min.js +9 -9
  5. package/dist/billboard.pkgd.js +215 -165
  6. package/dist/billboard.pkgd.min.js +17 -17
  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 +23 -9
  10. package/dist/plugin/billboardjs-plugin-sparkline.min.js +3 -3
  11. package/dist/plugin/billboardjs-plugin-stanford.js +23 -9
  12. package/dist/plugin/billboardjs-plugin-stanford.min.js +5 -5
  13. package/dist/plugin/billboardjs-plugin-tableview.js +18 -7
  14. package/dist/plugin/billboardjs-plugin-tableview.min.js +4 -4
  15. package/dist/plugin/billboardjs-plugin-textoverlap.js +18 -7
  16. package/dist/plugin/billboardjs-plugin-textoverlap.min.js +4 -4
  17. package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.js +2 -2
  18. package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.min.js +2 -2
  19. package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.js +23 -9
  20. package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.min.js +3 -3
  21. package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.js +23 -9
  22. package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.min.js +4 -4
  23. package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.js +18 -7
  24. package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.min.js +4 -4
  25. package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.js +18 -7
  26. package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.min.js +5 -5
  27. package/dist/theme/dark.css +2 -1
  28. package/dist/theme/dark.min.css +2 -2
  29. package/dist/theme/datalab.css +2 -1
  30. package/dist/theme/datalab.min.css +2 -2
  31. package/dist/theme/graph.css +2 -1
  32. package/dist/theme/graph.min.css +2 -2
  33. package/dist/theme/insight.css +2 -1
  34. package/dist/theme/insight.min.css +2 -2
  35. package/dist/theme/modern.css +2 -1
  36. package/dist/theme/modern.min.css +2 -2
  37. package/dist-esm/billboard.js +293 -208
  38. package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +2 -2
  39. package/dist-esm/plugin/billboardjs-plugin-sparkline.js +7 -4
  40. package/dist-esm/plugin/billboardjs-plugin-stanford.js +7 -4
  41. package/dist-esm/plugin/billboardjs-plugin-tableview.js +2 -2
  42. package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +2 -2
  43. package/package.json +11 -11
  44. package/src/Chart/api/export.ts +11 -4
  45. package/src/ChartInternal/Axis/Axis.ts +18 -5
  46. package/src/ChartInternal/Axis/AxisRenderer.ts +15 -3
  47. package/src/ChartInternal/Axis/AxisRendererHelper.ts +2 -2
  48. package/src/ChartInternal/ChartInternal.ts +51 -60
  49. package/src/ChartInternal/data/convert.ts +87 -48
  50. package/src/ChartInternal/data/data.ts +17 -38
  51. package/src/ChartInternal/interactions/eventrect.ts +8 -3
  52. package/src/ChartInternal/interactions/interaction.ts +2 -1
  53. package/src/ChartInternal/internals/domain.ts +1 -1
  54. package/src/ChartInternal/internals/grid.ts +1 -1
  55. package/src/ChartInternal/internals/size.ts +16 -5
  56. package/src/ChartInternal/internals/text.ts +30 -17
  57. package/src/ChartInternal/internals/tooltip.ts +2 -1
  58. package/src/ChartInternal/shape/arc.ts +2 -4
  59. package/src/ChartInternal/shape/point.ts +3 -2
  60. package/src/ChartInternal/shape/radar.ts +2 -1
  61. package/src/ChartInternal/shape/shape.ts +2 -1
  62. package/src/config/Options/axis/axis.ts +19 -5
  63. package/src/config/Options/axis/y2.ts +0 -13
  64. package/src/config/Options/common/main.ts +1 -1
  65. package/src/config/classes.ts +5 -2
  66. package/src/module/util.ts +45 -20
  67. package/src/scss/billboard.scss +1 -0
  68. package/src/scss/theme/dark.scss +1 -0
  69. package/src/scss/theme/datalab.scss +1 -0
  70. package/src/scss/theme/graph.scss +1 -0
  71. package/src/scss/theme/insight.scss +1 -0
  72. package/src/scss/theme/modern.scss +1 -0
@@ -5,7 +5,7 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.16.0-next.1
8
+ * @version 3.16.0
9
9
  * @requires billboard.js
10
10
  * @summary billboard.js plugin
11
11
  */
@@ -135,7 +135,7 @@ class Plugin {
135
135
  });
136
136
  }
137
137
  }
138
- __publicField(Plugin, "version", "3.16.0-next.1");
138
+ __publicField(Plugin, "version", "3.16.0");
139
139
 
140
140
  ;// ./src/Plugin/bubblecompare/index.ts
141
141
  var bubblecompare_defProp = Object.defineProperty;
@@ -5,7 +5,7 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.16.0-next.1
8
+ * @version 3.16.0
9
9
  * @requires billboard.js
10
10
  * @summary billboard.js plugin
11
- */(function(n,i){typeof exports=="object"&&typeof module=="object"?module.exports=i(require("d3-selection")):typeof define=="function"&&define.amd?define("bb",["d3-selection"],i):typeof exports=="object"?exports.bb=i(require("d3-selection")):(n.bb=n.bb||{},n.bb.plugin=n.bb.plugin||{},n.bb.plugin.bubblecompare=i(n.d3))})(this,function(p){return function(){"use strict";var n={747:function(r){r.exports=p}},i={};function s(r){var e=i[r];if(e!==void 0)return e.exports;var t=i[r]={exports:{}};return n[r](t,t.exports,s),t.exports}(function(){s.d=function(r,e){for(var t in e)s.o(e,t)&&!s.o(r,t)&&Object.defineProperty(r,t,{enumerable:!0,get:e[t]})}})(),function(){s.o=function(r,e){return Object.prototype.hasOwnProperty.call(r,e)}}();var b={};s.d(b,{default:function(){return R}});var $=s(747),g=Object.defineProperty,x=(r,e,t)=>e in r?g(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,l=(r,e,t)=>x(r,typeof e!="symbol"?e+"":e,t);class d{constructor(e={}){l(this,"$$"),l(this,"options"),this.options=e}$beforeInit(){}$init(){}$afterInit(){}$redraw(){}$willDestroy(){Object.keys(this).forEach(e=>{this[e]=null,delete this[e]})}}l(d,"version","3.16.0-next.1");var v=Object.defineProperty,B=(r,e,t)=>e in r?v(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,_=(r,e,t)=>B(r,typeof e!="symbol"?e+"":e,t);const f=class m extends d{constructor(e){return super(e),_(this,"$$"),this}$init(){const{$$:e}=this;e.findClosest=this.findClosest.bind(this),e.getBubbleR=this.getBubbleR.bind(this),e.pointExpandedR=this.pointExpandedR.bind(this)}pointExpandedR(e){const t=this.getBubbleR(e),{expandScale:a=1}=this.options;return m.raiseFocusedBubbleLayer(e),this.changeCursorPoint(),t*a}static raiseFocusedBubbleLayer(e){e.raise&&(0,$.select)(e.node().parentNode.parentNode).raise()}changeCursorPoint(){this.$$.$el.eventRect.style("cursor","pointer")}findClosest(e,t){const{$$:a}=this;return e.filter(o=>o&&!a.isBarType(o.id)).reduce((o,u)=>a.dist(u,t)<this.getBubbleR(u)?u:o,0)}getBubbleR(e){const{minR:t,maxR:a}=this.options,o=this.getZData(e);if(!o)return t;const[u,c]=this.$$.data.targets.reduce(([w,C],j)=>{const h=this.getZData(j.values[0]);return[Math.min(w,h),Math.max(C,h)]},[1e4,0]),P=u>0&&c===u?0:o/c;return Math.abs(P)*(a-t)+t}getZData(e){return this.$$.isBubbleZType(e)?this.$$.getBubbleZData(e.value,"z"):e.value}};_(f,"version","0.0.1");let R=f;return b=b.default,b}()});
11
+ */(function(n,i){typeof exports=="object"&&typeof module=="object"?module.exports=i(require("d3-selection")):typeof define=="function"&&define.amd?define("bb",["d3-selection"],i):typeof exports=="object"?exports.bb=i(require("d3-selection")):(n.bb=n.bb||{},n.bb.plugin=n.bb.plugin||{},n.bb.plugin.bubblecompare=i(n.d3))})(this,function(p){return function(){"use strict";var n={747:function(r){r.exports=p}},i={};function s(r){var e=i[r];if(e!==void 0)return e.exports;var t=i[r]={exports:{}};return n[r](t,t.exports,s),t.exports}(function(){s.d=function(r,e){for(var t in e)s.o(e,t)&&!s.o(r,t)&&Object.defineProperty(r,t,{enumerable:!0,get:e[t]})}})(),function(){s.o=function(r,e){return Object.prototype.hasOwnProperty.call(r,e)}}();var b={};s.d(b,{default:function(){return R}});var $=s(747),g=Object.defineProperty,v=(r,e,t)=>e in r?g(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,l=(r,e,t)=>v(r,typeof e!="symbol"?e+"":e,t);class d{constructor(e={}){l(this,"$$"),l(this,"options"),this.options=e}$beforeInit(){}$init(){}$afterInit(){}$redraw(){}$willDestroy(){Object.keys(this).forEach(e=>{this[e]=null,delete this[e]})}}l(d,"version","3.16.0");var x=Object.defineProperty,B=(r,e,t)=>e in r?x(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,_=(r,e,t)=>B(r,typeof e!="symbol"?e+"":e,t);const f=class m extends d{constructor(e){return super(e),_(this,"$$"),this}$init(){const{$$:e}=this;e.findClosest=this.findClosest.bind(this),e.getBubbleR=this.getBubbleR.bind(this),e.pointExpandedR=this.pointExpandedR.bind(this)}pointExpandedR(e){const t=this.getBubbleR(e),{expandScale:a=1}=this.options;return m.raiseFocusedBubbleLayer(e),this.changeCursorPoint(),t*a}static raiseFocusedBubbleLayer(e){e.raise&&(0,$.select)(e.node().parentNode.parentNode).raise()}changeCursorPoint(){this.$$.$el.eventRect.style("cursor","pointer")}findClosest(e,t){const{$$:a}=this;return e.filter(o=>o&&!a.isBarType(o.id)).reduce((o,u)=>a.dist(u,t)<this.getBubbleR(u)?u:o,0)}getBubbleR(e){const{minR:t,maxR:a}=this.options,o=this.getZData(e);if(!o)return t;const[u,c]=this.$$.data.targets.reduce(([w,C],j)=>{const h=this.getZData(j.values[0]);return[Math.min(w,h),Math.max(C,h)]},[1e4,0]),P=u>0&&c===u?0:o/c;return Math.abs(P)*(a-t)+t}getZData(e){return this.$$.isBubbleZType(e)?this.$$.getBubbleZData(e.value,"z"):e.value}};_(f,"version","0.0.1");let R=f;return b=b.default,b}()});
@@ -5,7 +5,7 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.16.0-next.1
8
+ * @version 3.16.0
9
9
  * @requires billboard.js
10
10
  * @summary billboard.js plugin
11
11
  */
@@ -113,7 +113,8 @@ const $COMMON = {
113
113
  empty: "bb-empty",
114
114
  main: "bb-main",
115
115
  target: "bb-target",
116
- EXPANDED: "_expanded_"
116
+ EXPANDED: "_expanded_",
117
+ dummy: "_dummy_"
117
118
  };
118
119
  const $ARC = {
119
120
  arc: "bb-arc",
@@ -140,7 +141,9 @@ const $AXIS = {
140
141
  axisYLabel: "bb-axis-y-label",
141
142
  axisXTooltip: "bb-axis-x-tooltip",
142
143
  axisYTooltip: "bb-axis-y-tooltip",
143
- axisY2Tooltip: "bb-axis-y2-tooltip"
144
+ axisY2Tooltip: "bb-axis-y2-tooltip",
145
+ axisTooltipX: "bb-axis-tooltip-x",
146
+ axisTooltipY: "bb-axis-tooltip-y"
144
147
  };
145
148
  const $BAR = {
146
149
  bar: "bb-bar",
@@ -398,7 +401,7 @@ function getRectSegList(path) {
398
401
  ];
399
402
  }
400
403
  function getPathBox(path) {
401
- const { width, height } = path.getBoundingClientRect();
404
+ const { width, height } = getBoundingRect(path);
402
405
  const items = getRectSegList(path);
403
406
  const x = items[0].x;
404
407
  const y = Math.min(items[0].y, items[1].y);
@@ -430,9 +433,20 @@ function getBrushSelection(ctx) {
430
433
  }
431
434
  return selection;
432
435
  }
433
- function getBoundingRect(node) {
434
- const needEvaluate = !("rect" in node) || "rect" in node && node.hasAttribute("width") && node.rect.width !== +node.getAttribute("width");
435
- return needEvaluate ? node.rect = node.getBoundingClientRect() : node.rect;
436
+ function getRect(relativeViewport, node, forceEval = false) {
437
+ const _ = (n) => n[relativeViewport ? "getBoundingClientRect" : "getBBox"]();
438
+ if (forceEval) {
439
+ return _(node);
440
+ } else {
441
+ const needEvaluate = !("rect" in node) || "rect" in node && node.hasAttribute("width") && node.rect.width !== +(node.getAttribute("width") || 0);
442
+ return needEvaluate ? node.rect = _(node) : node.rect;
443
+ }
444
+ }
445
+ function getBoundingRect(node, forceEval = false) {
446
+ return getRect(true, node, forceEval);
447
+ }
448
+ function getBBox(node, forceEval = false) {
449
+ return getRect(false, node, forceEval);
436
450
  }
437
451
  function getRandom(asStr = true, min = 0, max = 1e4) {
438
452
  const crpt = win.crypto || win.msCrypto;
@@ -528,7 +542,7 @@ function getTransformCTM(node, x = 0, y = 0, inverse = true) {
528
542
  inverse ? screen == null ? void 0 : screen.inverse() : screen
529
543
  );
530
544
  if (inverse === false) {
531
- const rect = node.getBoundingClientRect();
545
+ const rect = getBoundingRect(node);
532
546
  res.x -= rect.x;
533
547
  res.y -= rect.y;
534
548
  }
@@ -811,7 +825,7 @@ class Plugin {
811
825
  });
812
826
  }
813
827
  }
814
- __publicField(Plugin, "version", "3.16.0-next.1");
828
+ __publicField(Plugin, "version", "3.16.0");
815
829
 
816
830
  ;// ./src/Plugin/sparkline/Options.ts
817
831
  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.16.0-next.1
8
+ * @version 3.16.0
9
9
  * @requires billboard.js
10
10
  * @summary billboard.js plugin
11
- */(function(b,f){typeof exports=="object"&&typeof module=="object"?module.exports=f(require("d3-brush"),require("d3-selection")):typeof define=="function"&&define.amd?define("bb",["d3-brush","d3-selection"],f):typeof exports=="object"?exports.bb=f(require("d3-brush"),require("d3-selection")):(b.bb=b.bb||{},b.bb.plugin=b.bb.plugin||{},b.bb.plugin.sparkline=f(b.d3,b.d3))})(this,function(T,b){return function(){"use strict";var f={747:function(e){e.exports=b},853:function(e){e.exports=T}},C={};function d(e){var t=C[e];if(t!==void 0)return t.exports;var n=C[e]={exports:{}};return f[e](n,n.exports,d),n.exports}(function(){d.d=function(e,t){for(var n in t)d.o(t,n)&&!d.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}})(),function(){d.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}}();var p={};d.d(p,{default:function(){return j}});var N=Object.defineProperty,P=Object.getOwnPropertySymbols,B=Object.prototype.hasOwnProperty,q=Object.prototype.propertyIsEnumerable,A=(e,t,n)=>t in e?N(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,c=(e,t)=>{for(var n in t||(t={}))B.call(t,n)&&A(e,n,t[n]);if(P)for(var n of P(t))q.call(t,n)&&A(e,n,t[n]);return e};const R={button:"bb-button",chart:"bb-chart",empty:"bb-empty",main:"bb-main",target:"bb-target",EXPANDED:"_expanded_"},k={arc:"bb-arc",arcLabelLine:"bb-arc-label-line",arcRange:"bb-arc-range",arcs:"bb-arcs",chartArc:"bb-chart-arc",chartArcs:"bb-chart-arcs",chartArcsBackground:"bb-chart-arcs-background",chartArcsTitle:"bb-chart-arcs-title",needle:"bb-needle"},H={area:"bb-area",areas:"bb-areas"},U={axis:"bb-axis",axisX:"bb-axis-x",axisXLabel:"bb-axis-x-label",axisY:"bb-axis-y",axisY2:"bb-axis-y2",axisY2Label:"bb-axis-y2-label",axisYLabel:"bb-axis-y-label",axisXTooltip:"bb-axis-x-tooltip",axisYTooltip:"bb-axis-y-tooltip",axisY2Tooltip:"bb-axis-y2-tooltip"},X={bar:"bb-bar",bars:"bb-bars",chartBar:"bb-chart-bar",chartBars:"bb-chart-bars",barConnectLine:"bb-bar-connectLine"},V={candlestick:"bb-candlestick",candlesticks:"bb-candlesticks",chartCandlestick:"bb-chart-candlestick",chartCandlesticks:"bb-chart-candlesticks",valueDown:"bb-value-down",valueUp:"bb-value-up"},Y={chartCircles:"bb-chart-circles",circle:"bb-circle",circles:"bb-circles"},G={colorPattern:"bb-color-pattern",colorScale:"bb-colorscale"},z={dragarea:"bb-dragarea",INCLUDED:"_included_"},W={funnel:"bb-funnel",chartFunnel:"bb-chart-funnel",chartFunnels:"bb-chart-funnels",funnelBackground:"bb-funnel-background"},K={chartArcsGaugeMax:"bb-chart-arcs-gauge-max",chartArcsGaugeMin:"bb-chart-arcs-gauge-min",chartArcsGaugeUnit:"bb-chart-arcs-gauge-unit",chartArcsGaugeTitle:"bb-chart-arcs-gauge-title",gaugeValue:"bb-gauge-value"},Z={legend:"bb-legend",legendBackground:"bb-legend-background",legendItem:"bb-legend-item",legendItemEvent:"bb-legend-item-event",legendItemHidden:"bb-legend-item-hidden",legendItemPoint:"bb-legend-item-point",legendItemTile:"bb-legend-item-tile"},J={chartLine:"bb-chart-line",chartLines:"bb-chart-lines",line:"bb-line",lines:"bb-lines"},Q={eventRect:"bb-event-rect",eventRects:"bb-event-rects",eventRectsMultiple:"bb-event-rects-multiple",eventRectsSingle:"bb-event-rects-single"},ee={focused:"bb-focused",defocused:"bb-defocused",legendItemFocused:"bb-legend-item-focused",xgridFocus:"bb-xgrid-focus",ygridFocus:"bb-ygrid-focus"},te={grid:"bb-grid",gridLines:"bb-grid-lines",xgrid:"bb-xgrid",xgridLine:"bb-xgrid-line",xgridLines:"bb-xgrid-lines",xgrids:"bb-xgrids",ygrid:"bb-ygrid",ygridLine:"bb-ygrid-line",ygridLines:"bb-ygrid-lines",ygrids:"bb-ygrids"},Le={level:"bb-level",levels:"bb-levels"},ne={chartRadar:"bb-chart-radar",chartRadars:"bb-chart-radars"},re={region:"bb-region",regions:"bb-regions"},ie={selectedCircle:"bb-selected-circle",selectedCircles:"bb-selected-circles",SELECTED:"_selected_"},se={shape:"bb-shape",shapes:"bb-shapes"},oe={brush:"bb-brush",subchart:"bb-subchart"},ce={chartText:"bb-chart-text",chartTexts:"bb-chart-texts",text:"bb-text",texts:"bb-texts",title:"bb-title",TextOverlapping:"text-overlapping"},le={tooltip:"bb-tooltip",tooltipContainer:"bb-tooltip-container",tooltipName:"bb-tooltip-name"},ae={treemap:"bb-treemap",chartTreemap:"bb-chart-treemap",chartTreemaps:"bb-chart-treemaps"},ue={buttonZoomReset:"bb-zoom-reset",zoomBrush:"bb-zoom-brush"};var Me=c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c({},R),k),H),U),X),V),Y),G),z),K),Z),J),Q),ee),W),te),ne),re),ie),se),oe),ce),le),ae),ue),De=d(853),Fe=d(747);function be(){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 de(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",r=s=>setTimeout(s,1),i=s=>clearTimeout(s);return[t?e.requestAnimationFrame:r,t?e.cancelAnimationFrame:i,n?e.requestIdleCallback:r,n?e.cancelIdleCallback:i]}const g=be(),fe=g==null?void 0:g.document,[je,Ne,Be,qe]=de(g);var he=Object.defineProperty,S=Object.getOwnPropertySymbols,pe=Object.prototype.hasOwnProperty,ge=Object.prototype.propertyIsEnumerable,I=(e,t,n)=>t in e?he(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,L=(e,t)=>{for(var n in t||(t={}))pe.call(t,n)&&I(e,n,t[n]);if(S)for(var n of S(t))ge.call(t,n)&&I(e,n,t[n]);return e};const ke=e=>e||e===0,me=e=>typeof e=="function",m=e=>typeof e=="string",_=e=>typeof e=="number",ve=e=>typeof e=="undefined",M=e=>typeof e!="undefined",He=e=>typeof e=="boolean",Ue=e=>Math.ceil(e/10)*10,Xe=e=>Math.ceil(e)+.5,Ve=e=>e[1]-e[0],y=e=>typeof e=="object",_e=e=>ve(e)||e===null||m(e)&&e.length===0||y(e)&&!(e instanceof Date)&&Object.keys(e).length===0||_(e)&&isNaN(e),ye=e=>!_e(e),x=e=>Array.isArray(e),v=e=>e&&!(e!=null&&e.nodeType)&&y(e)&&!x(e);function Ye(e,t,n){return M(e[t])?e[t]:n}function Ge(e,t){let n=!1;return Object.keys(e).forEach(r=>e[r]===t&&(n=!0)),n}function ze(e,t,...n){const r=me(e);return r&&e.call(t,...n),r}function We(e,t){let n=0;const r=function(...i){!--n&&t.apply(this,...i)};"duration"in e?e.each(()=>++n).on("end",r):(++n,e.call(r))}function Ke(e){return m(e)?e.replace(/<(script|img)?/ig,"&lt;").replace(/(script)?>/ig,"&gt;"):e}function Ze(e,t,n=[-1,1],r=!1){if(!(!e||!m(t)))if(t.indexOf(`
11
+ */(function(b,f){typeof exports=="object"&&typeof module=="object"?module.exports=f(require("d3-brush"),require("d3-selection")):typeof define=="function"&&define.amd?define("bb",["d3-brush","d3-selection"],f):typeof exports=="object"?exports.bb=f(require("d3-brush"),require("d3-selection")):(b.bb=b.bb||{},b.bb.plugin=b.bb.plugin||{},b.bb.plugin.sparkline=f(b.d3,b.d3))})(this,function(T,b){return function(){"use strict";var f={747:function(e){e.exports=b},853:function(e){e.exports=T}},C={};function d(e){var t=C[e];if(t!==void 0)return t.exports;var n=C[e]={exports:{}};return f[e](n,n.exports,d),n.exports}(function(){d.d=function(e,t){for(var n in t)d.o(t,n)&&!d.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}})(),function(){d.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}}();var p={};d.d(p,{default:function(){return N}});var q=Object.defineProperty,P=Object.getOwnPropertySymbols,k=Object.prototype.hasOwnProperty,H=Object.prototype.propertyIsEnumerable,A=(e,t,n)=>t in e?q(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,c=(e,t)=>{for(var n in t||(t={}))k.call(t,n)&&A(e,n,t[n]);if(P)for(var n of P(t))H.call(t,n)&&A(e,n,t[n]);return e};const R={button:"bb-button",chart:"bb-chart",empty:"bb-empty",main:"bb-main",target:"bb-target",EXPANDED:"_expanded_",dummy:"_dummy_"},X={arc:"bb-arc",arcLabelLine:"bb-arc-label-line",arcRange:"bb-arc-range",arcs:"bb-arcs",chartArc:"bb-chart-arc",chartArcs:"bb-chart-arcs",chartArcsBackground:"bb-chart-arcs-background",chartArcsTitle:"bb-chart-arcs-title",needle:"bb-needle"},U={area:"bb-area",areas:"bb-areas"},Y={axis:"bb-axis",axisX:"bb-axis-x",axisXLabel:"bb-axis-x-label",axisY:"bb-axis-y",axisY2:"bb-axis-y2",axisY2Label:"bb-axis-y2-label",axisYLabel:"bb-axis-y-label",axisXTooltip:"bb-axis-x-tooltip",axisYTooltip:"bb-axis-y-tooltip",axisY2Tooltip:"bb-axis-y2-tooltip",axisTooltipX:"bb-axis-tooltip-x",axisTooltipY:"bb-axis-tooltip-y"},V={bar:"bb-bar",bars:"bb-bars",chartBar:"bb-chart-bar",chartBars:"bb-chart-bars",barConnectLine:"bb-bar-connectLine"},G={candlestick:"bb-candlestick",candlesticks:"bb-candlesticks",chartCandlestick:"bb-chart-candlestick",chartCandlesticks:"bb-chart-candlesticks",valueDown:"bb-value-down",valueUp:"bb-value-up"},z={chartCircles:"bb-chart-circles",circle:"bb-circle",circles:"bb-circles"},W={colorPattern:"bb-color-pattern",colorScale:"bb-colorscale"},K={dragarea:"bb-dragarea",INCLUDED:"_included_"},Z={funnel:"bb-funnel",chartFunnel:"bb-chart-funnel",chartFunnels:"bb-chart-funnels",funnelBackground:"bb-funnel-background"},J={chartArcsGaugeMax:"bb-chart-arcs-gauge-max",chartArcsGaugeMin:"bb-chart-arcs-gauge-min",chartArcsGaugeUnit:"bb-chart-arcs-gauge-unit",chartArcsGaugeTitle:"bb-chart-arcs-gauge-title",gaugeValue:"bb-gauge-value"},Q={legend:"bb-legend",legendBackground:"bb-legend-background",legendItem:"bb-legend-item",legendItemEvent:"bb-legend-item-event",legendItemHidden:"bb-legend-item-hidden",legendItemPoint:"bb-legend-item-point",legendItemTile:"bb-legend-item-tile"},ee={chartLine:"bb-chart-line",chartLines:"bb-chart-lines",line:"bb-line",lines:"bb-lines"},te={eventRect:"bb-event-rect",eventRects:"bb-event-rects",eventRectsMultiple:"bb-event-rects-multiple",eventRectsSingle:"bb-event-rects-single"},ne={focused:"bb-focused",defocused:"bb-defocused",legendItemFocused:"bb-legend-item-focused",xgridFocus:"bb-xgrid-focus",ygridFocus:"bb-ygrid-focus"},re={grid:"bb-grid",gridLines:"bb-grid-lines",xgrid:"bb-xgrid",xgridLine:"bb-xgrid-line",xgridLines:"bb-xgrid-lines",xgrids:"bb-xgrids",ygrid:"bb-ygrid",ygridLine:"bb-ygrid-line",ygridLines:"bb-ygrid-lines",ygrids:"bb-ygrids"},De={level:"bb-level",levels:"bb-levels"},ie={chartRadar:"bb-chart-radar",chartRadars:"bb-chart-radars"},se={region:"bb-region",regions:"bb-regions"},oe={selectedCircle:"bb-selected-circle",selectedCircles:"bb-selected-circles",SELECTED:"_selected_"},ce={shape:"bb-shape",shapes:"bb-shapes"},le={brush:"bb-brush",subchart:"bb-subchart"},ae={chartText:"bb-chart-text",chartTexts:"bb-chart-texts",text:"bb-text",texts:"bb-texts",title:"bb-title",TextOverlapping:"text-overlapping"},ue={tooltip:"bb-tooltip",tooltipContainer:"bb-tooltip-container",tooltipName:"bb-tooltip-name"},be={treemap:"bb-treemap",chartTreemap:"bb-chart-treemap",chartTreemaps:"bb-chart-treemaps"},de={buttonZoomReset:"bb-zoom-reset",zoomBrush:"bb-zoom-brush"};var Be=c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c({},R),X),U),Y),V),G),z),W),K),J),Q),ee),te),ne),Z),re),ie),se),oe),ce),le),ae),ue),be),de),Fe=d(853),je=d(747);function fe(){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 he(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",r=s=>setTimeout(s,1),i=s=>clearTimeout(s);return[t?e.requestAnimationFrame:r,t?e.cancelAnimationFrame:i,n?e.requestIdleCallback:r,n?e.cancelIdleCallback:i]}const g=fe(),pe=g==null?void 0:g.document,[Ne,qe,ke,He]=he(g);var ge=Object.defineProperty,S=Object.getOwnPropertySymbols,me=Object.prototype.hasOwnProperty,ve=Object.prototype.propertyIsEnumerable,I=(e,t,n)=>t in e?ge(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,L=(e,t)=>{for(var n in t||(t={}))me.call(t,n)&&I(e,n,t[n]);if(S)for(var n of S(t))ve.call(t,n)&&I(e,n,t[n]);return e};const Xe=e=>e||e===0,_e=e=>typeof e=="function",m=e=>typeof e=="string",_=e=>typeof e=="number",ye=e=>typeof e=="undefined",M=e=>typeof e!="undefined",Ue=e=>typeof e=="boolean",Ye=e=>Math.ceil(e/10)*10,Ve=e=>Math.ceil(e)+.5,Ge=e=>e[1]-e[0],y=e=>typeof e=="object",xe=e=>ye(e)||e===null||m(e)&&e.length===0||y(e)&&!(e instanceof Date)&&Object.keys(e).length===0||_(e)&&isNaN(e),$e=e=>!xe(e),x=e=>Array.isArray(e),v=e=>e&&!(e!=null&&e.nodeType)&&y(e)&&!x(e);function ze(e,t,n){return M(e[t])?e[t]:n}function We(e,t){let n=!1;return Object.keys(e).forEach(r=>e[r]===t&&(n=!0)),n}function Ke(e,t,...n){const r=_e(e);return r&&e.call(t,...n),r}function Ze(e,t){let n=0;const r=function(...i){!--n&&t.apply(this,...i)};"duration"in e?e.each(()=>++n).on("end",r):(++n,e.call(r))}function Je(e){return m(e)?e.replace(/<(script|img)?/ig,"&lt;").replace(/(script)?>/ig,"&gt;"):e}function Qe(e,t,n=[-1,1],r=!1){if(!(!e||!m(t)))if(t.indexOf(`
12
12
  `)===-1)e.text(t);else{const i=[e.text(),t].map(s=>s.replace(/[\s\n]/g,""));if(i[0]!==i[1]){const s=t.split(`
13
- `),o=r?s.length-1:1;e.html(""),s.forEach((l,a)=>{e.append("tspan").attr("x",0).attr("dy",`${a===0?n[0]*o:n[1]}em`).text(l)})}}}function xe(e){const{x:t,y:n,width:r,height:i}=e.getBBox();return[{x:t,y:n+i},{x:t,y:n},{x:t+r,y:n},{x:t+r,y:n+i}]}function Je(e){const{width:t,height:n}=e.getBoundingClientRect(),r=xe(e),i=r[0].x,s=Math.min(r[0].y,r[1].y);return{x:i,y:s,width:t,height:n}}function Qe(e,t){var n;const r=e&&((n=e.touches||e.sourceEvent&&e.sourceEvent.touches)==null?void 0:n[0]);let i=[0,0];try{i=d3Pointer(r||e,t)}catch(s){}return i.map(s=>isNaN(s)?0:s)}function $e(e){const{event:t,$el:n}=e,r=n.subchart.main||n.main;let i;return t&&t.type==="brush"?i=t.selection:r&&(i=r.select(".bb-brush").node())&&(i=d3BrushSelection(i)),i}function et(e){return!("rect"in e)||"rect"in e&&e.hasAttribute("width")&&e.rect.width!==+e.getAttribute("width")?e.rect=e.getBoundingClientRect():e.rect}function tt(e=!0,t=0,n=1e4){const r=window.crypto||window.msCrypto,i=r?t+r.getRandomValues(new Uint32Array(1))[0]%(n-t+1):Math.floor(Math.random()*(n-t)+t);return e?String(i):i}function D(e,t,n,r,i){if(n>r)return-1;const s=Math.floor((n+r)/2);let{x:o,w:l=0}=e[s];return i&&(o=e[s].y,l=e[s].h),t>=o&&t<=o+l?s:t<o?D(e,t,n,s-1,i):D(e,t,s+1,r,i)}function nt(e){const t=$e(e);return t?t[0]===t[1]:!0}function rt(...e){const t=n=>{if(v(n)&&n.constructor){const r=new n.constructor;for(const i in n)r[i]=t(n[i]);return r}return n};return e.map(n=>t(n)).reduce((n,r)=>L(L({},n),r))}function we(e={},t){x(t)&&t.forEach(n=>we(e,n));for(const n in t)/^\d+$/.test(n)||n in e||(e[n]=t[n]);return e}const it=e=>e.charAt(0).toUpperCase()+e.slice(1);function st(e,t="-"){return e.split(t).map((n,r)=>r?n.charAt(0).toUpperCase()+n.slice(1).toLowerCase():n.toLowerCase()).join("")}const Ee=e=>[].slice.call(e);function ot(e,t,n){const{rootSelector:r="",sheet:i}=e,o=`${r} ${(l=>l.replace(/\s?(bb-)/g,".$1").replace(/\.+/g,"."))(t)} {${n.join(";")}}`;return i[i.insertRule?"insertRule":"addRule"](o,i.cssRules.length)}function ct(e){let t=[];return e.forEach(n=>{var r;try{n.cssRules&&n.cssRules.length&&(t=t.concat(Ee(n.cssRules)))}catch(i){(r=window.console)==null||r.warn(`Error while reading rules from ${n.href}: ${i.toString()}`)}}),t}function lt(e){var t,n,r,i,s,o;return{x:((n=(t=window.pageXOffset)!=null?t:window.scrollX)!=null?n:0)+((r=e.scrollLeft)!=null?r:0),y:((s=(i=window.pageYOffset)!=null?i:window.scrollY)!=null?s:0)+((o=e.scrollTop)!=null?o:0)}}function at(e,t=0,n=0,r=!0){const i=new DOMPoint(t,n),s=e.getScreenCTM(),o=i.matrixTransform(r?s==null?void 0:s.inverse():s);if(r===!1){const l=e.getBoundingClientRect();o.x-=l.x,o.y-=l.y}return o}function ut(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 bt(e){const t=e[0]instanceof Date,n=(t?e.map(Number):e).filter((r,i,s)=>s.indexOf(r)===i);return t?n.map(r=>new Date(r)):n}function dt(e){return e&&e.length?e.reduce((t,n)=>t.concat(n)):[]}function $(e,...t){if(!t.length||t.length===1&&!t[0])return e;const n=t.shift();return v(e)&&v(n)&&Object.keys(n).forEach(r=>{if(!/^(__proto__|constructor|prototype)$/i.test(r)){const i=n[r];v(i)?(!e[r]&&(e[r]={}),e[r]=$(e[r],i)):e[r]=x(i)?i.concat():i}}),$(e,...t)}function Oe(e,t=!0){let n;return e[0]instanceof Date?n=t?(r,i)=>r-i:(r,i)=>i-r:t&&!e.every(isNaN)?n=(r,i)=>r-i:t||(n=(r,i)=>r>i&&-1||r<i&&1||r===i&&0),e.concat().sort(n)}function ft(e,t){let n=t.filter(r=>ye(r));return n.length?_(n[0])?n=Math[e](...n):n[0]instanceof Date&&(n=Oe(n,e==="min")[0]):n=void 0,n}const ht=(e,t,n=1)=>{const r=[],i=Math.max(0,Math.ceil((t-e)/n))|0;for(let s=e;s<i;s++)r.push(e+s*n);return r},pt={mouse:(()=>{const e=()=>({bubbles:!1,cancelable:!1,screenX:0,screenY:0,clientX:0,clientY:0});try{return new MouseEvent("t"),(t,n,r=e())=>{t.dispatchEvent(new MouseEvent(n,r))}}catch(t){return(n,r,i=e())=>{const s=fe.createEvent("MouseEvent");s.initMouseEvent(r,i.bubbles,i.cancelable,g,0,i.screenX,i.screenY,i.clientX,i.clientY,!1,!1,!1,!1,0,null),n.dispatchEvent(s)}}})(),touch:(e,t,n)=>{const r=new Touch($({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:[r],targetTouches:[],changedTouches:[r]}))}};function gt(e,t){let n=e;for(const r in t)n=n.replace(new RegExp(`{=${r}}`,"g"),t[r]);return n}function mt(e){var t;let n;if(e instanceof Date)n=e;else if(m(e)){const{config:r,format:i}=this;n=(t=i.dataTime(r.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 vt(e){const t=e.attr("viewBox");return t?/(\d+(\.\d+)?){3}/.test(t):!1}function _t(e,t,n=!1){const r=!!e.node;let i=!1;for(const[s,o]of Object.entries(t))if(i=r?e.style(s)===o:e.style[s]===o,n===!1&&i)break;return i}function yt(){var e,t;return((e=document)==null?void 0:e.hidden)===!1||((t=document)==null?void 0:t.visibilityState)==="visible"}function xt(e,t){const{DocumentTouch:n,matchMedia:r,navigator:i}=window,s=r==null?void 0:r("(pointer:coarse)").matches;let o=!1;if(t)if(i&&"maxTouchPoints"in i)o=i.maxTouchPoints>0;else if("ontouchmove"in window||n&&document instanceof n)o=!0;else if(s)o=!0;else{const a=i.userAgent;o=/\b(BlackBerry|webOS|iPhone|IEMobile)\b/i.test(a)||/\b(Android|Windows Phone|iPad|iPod)\b/i.test(a)}return e&&!s&&(r==null?void 0:r("(pointer:fine)").matches)&&"mouse"||o&&"touch"||"mouse"}function Te(e,t){t()===!1?requestAnimationFrame(()=>Te(e,t)):e()}function Ce(e){const t=this.config;let n,r,i;const s=()=>{const o=r.shift();if(o&&n&&y(n)&&o in n)return n=n[o],s();if(!o)return n};Object.keys(t).forEach(o=>{n=e,r=o.split("_"),i=s(),M(i)&&(t[o]=i)}),this.api&&(this.state.orgConfig=e)}var Pe=Object.defineProperty,Ae=(e,t,n)=>t in e?Pe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,w=(e,t,n)=>Ae(e,typeof t!="symbol"?t+"":t,n);class F{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(F,"version","3.16.0-next.1");class Re{constructor(){return{selector:void 0}}}var Se=Object.defineProperty,Ie=(e,t,n)=>t in e?Se(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,E=(e,t,n)=>Ie(e,typeof t!="symbol"?t+"":t,n);class j extends F{constructor(t){return super(t),E(this,"config"),E(this,"element"),this.config=new Re,this}$beforeInit(){Ce.call(this,this.options),this.validate(),this.element=[].slice.call(document.querySelectorAll(this.config.selector)),this.overrideInternals(),this.overrideOptions(),this.overHandler=this.overHandler.bind(this),this.moveHandler=this.moveHandler.bind(this),this.outHandler=this.outHandler.bind(this)}validate(){const{$$:t,config:n}=this;let r="";if((!n.selector||!document.querySelector(n.selector))&&(r="No holder elements found from given selector option."),(t.hasType("bubble")||t.hasType("scatter")||t.hasArcType(t.data.targets))&&(r="Contains non supported chart types."),r)throw new Error(`[Sparkline plugin] ${r}`)}overrideInternals(){const{$$:t}=this,{getBarW:n,getIndices:r}=t;t.getIndices=function(i,s,o){return o==="getShapeX"?{}:r.call(this,i,s)},t.getBarW=function(i,s){return n.call(this,i,s,1)}}overrideOptions(){const{config:t}=this.$$;if(t.legend_show=!1,t.resize_auto=!1,t.axis_x_show=!1,t.padding!==!1){const n=r=>Object.keys(r||{}).length>0;n(t.axis_x_padding)&&(t.axis_x_padding={left:15,right:15,unit:"px"}),n(t.axis_y_padding)&&(t.axis_y_padding=5)}t.axis_y_show=!1,t.tooltip_position||(t.tooltip_position=function(n,r,i){const{internal:{state:{event:s}}}=this;let o=s.pageY-i*1.35,l=s.pageX-r/2;return o<0&&(o=0),l<0&&(l=0),{top:o,left:l}})}$init(){var t;const{$$:{$el:n}}=this;n.chart.style("width","0").style("height","0").style("pointer-events","none"),(t=n.tooltip)!=null&&t.node()&&document.body.appendChild(n.tooltip.node())}$afterInit(){const{$$:t}=this;t.$el.svg.attr("style",null).style("width","0").style("height","0"),this.bindEvents(!0)}bindEvents(t=!0){const{$$:{config:n}}=this;if(n.interaction_enabled&&n.tooltip_show){const r=`${t?"add":"remove"}EventListener`;this.element.forEach(i=>{const s=i.querySelector("svg");s[r]("mouseover",this.overHandler),s[r]("mousemove",this.moveHandler),s[r]("mouseout",this.outHandler)})}}overHandler(t){const{$$:n}=this,{state:{eventReceiver:r}}=n;r.rect=t.target.getBoundingClientRect()}moveHandler(t){var n,r,i,s;const{$$:o}=this,l=o.getDataIndexFromEvent(t),a=(n=o.api.data(t.target.__id))==null?void 0:n[0],u=(r=a==null?void 0:a.values)==null?void 0:r[l];u&&!u.name&&(u.name=u.id),o.state.event=t,(i=o.isPointFocusOnly)!=null&&i.call(o)&&u&&((s=o.showCircleFocus)==null||s.call(o,[u])),o.setExpand(l,a.id,!0),o.showTooltip([u],t.target)}outHandler(t){const{$$:n}=this;n.state.event=t,n.isPointFocusOnly()?n.hideCircleFocus():n.unexpandCircles(),n.hideTooltip()}$redraw(){var t;const{$$:n}=this,{$el:r}=n;let i=this.element;const s=n.api.data(),o=(t=r.chart.html().match(/<svg[^>]*>/))==null?void 0:t[0];if(i.length<s.length){const l=r.chart.node();for(let a=s.length-i.length;a>0;a--)l.parentNode.insertBefore(i[0].cloneNode(),l.nextSibling);this.element=document.querySelectorAll(this.config.selector),i=this.element}s.map(l=>l.id).forEach((l,a)=>{const u=`.${R.target}-${l}`,O=r.main.selectAll(u);let h=i[a].querySelector("svg");h||(i[a].innerHTML=`${o}</svg>`,h=i[a].querySelector("svg"),h.__id=l),h.querySelector(u)||O.style("opacity",null),O.style("fill","none").style("opacity",null),h.innerHTML="",h.appendChild(O.node())})}$willDestroy(){this.bindEvents(!1),this.element.forEach(t=>{t.innerHTML=""})}}return E(j,"version","0.0.1"),p=p.default,p}()});
13
+ `),o=r?s.length-1:1;e.html(""),s.forEach((l,a)=>{e.append("tspan").attr("x",0).attr("dy",`${a===0?n[0]*o:n[1]}em`).text(l)})}}}function we(e){const{x:t,y:n,width:r,height:i}=e.getBBox();return[{x:t,y:n+i},{x:t,y:n},{x:t+r,y:n},{x:t+r,y:n+i}]}function et(e){const{width:t,height:n}=B(e),r=we(e),i=r[0].x,s=Math.min(r[0].y,r[1].y);return{x:i,y:s,width:t,height:n}}function tt(e,t){var n;const r=e&&((n=e.touches||e.sourceEvent&&e.sourceEvent.touches)==null?void 0:n[0]);let i=[0,0];try{i=d3Pointer(r||e,t)}catch(s){}return i.map(s=>isNaN(s)?0:s)}function Ee(e){const{event:t,$el:n}=e,r=n.subchart.main||n.main;let i;return t&&t.type==="brush"?i=t.selection:r&&(i=r.select(".bb-brush").node())&&(i=d3BrushSelection(i)),i}function D(e,t,n=!1){const r=i=>i[e?"getBoundingClientRect":"getBBox"]();return n?r(t):!("rect"in t)||"rect"in t&&t.hasAttribute("width")&&t.rect.width!==+(t.getAttribute("width")||0)?t.rect=r(t):t.rect}function B(e,t=!1){return D(!0,e,t)}function nt(e,t=!1){return D(!1,e,t)}function rt(e=!0,t=0,n=1e4){const r=window.crypto||window.msCrypto,i=r?t+r.getRandomValues(new Uint32Array(1))[0]%(n-t+1):Math.floor(Math.random()*(n-t)+t);return e?String(i):i}function F(e,t,n,r,i){if(n>r)return-1;const s=Math.floor((n+r)/2);let{x:o,w:l=0}=e[s];return i&&(o=e[s].y,l=e[s].h),t>=o&&t<=o+l?s:t<o?F(e,t,n,s-1,i):F(e,t,s+1,r,i)}function it(e){const t=Ee(e);return t?t[0]===t[1]:!0}function st(...e){const t=n=>{if(v(n)&&n.constructor){const r=new n.constructor;for(const i in n)r[i]=t(n[i]);return r}return n};return e.map(n=>t(n)).reduce((n,r)=>L(L({},n),r))}function Oe(e={},t){x(t)&&t.forEach(n=>Oe(e,n));for(const n in t)/^\d+$/.test(n)||n in e||(e[n]=t[n]);return e}const ot=e=>e.charAt(0).toUpperCase()+e.slice(1);function ct(e,t="-"){return e.split(t).map((n,r)=>r?n.charAt(0).toUpperCase()+n.slice(1).toLowerCase():n.toLowerCase()).join("")}const Te=e=>[].slice.call(e);function lt(e,t,n){const{rootSelector:r="",sheet:i}=e,o=`${r} ${(l=>l.replace(/\s?(bb-)/g,".$1").replace(/\.+/g,"."))(t)} {${n.join(";")}}`;return i[i.insertRule?"insertRule":"addRule"](o,i.cssRules.length)}function at(e){let t=[];return e.forEach(n=>{var r;try{n.cssRules&&n.cssRules.length&&(t=t.concat(Te(n.cssRules)))}catch(i){(r=window.console)==null||r.warn(`Error while reading rules from ${n.href}: ${i.toString()}`)}}),t}function ut(e){var t,n,r,i,s,o;return{x:((n=(t=window.pageXOffset)!=null?t:window.scrollX)!=null?n:0)+((r=e.scrollLeft)!=null?r:0),y:((s=(i=window.pageYOffset)!=null?i:window.scrollY)!=null?s:0)+((o=e.scrollTop)!=null?o:0)}}function bt(e,t=0,n=0,r=!0){const i=new DOMPoint(t,n),s=e.getScreenCTM(),o=i.matrixTransform(r?s==null?void 0:s.inverse():s);if(r===!1){const l=B(e);o.x-=l.x,o.y-=l.y}return o}function dt(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 ft(e){const t=e[0]instanceof Date,n=(t?e.map(Number):e).filter((r,i,s)=>s.indexOf(r)===i);return t?n.map(r=>new Date(r)):n}function ht(e){return e&&e.length?e.reduce((t,n)=>t.concat(n)):[]}function $(e,...t){if(!t.length||t.length===1&&!t[0])return e;const n=t.shift();return v(e)&&v(n)&&Object.keys(n).forEach(r=>{if(!/^(__proto__|constructor|prototype)$/i.test(r)){const i=n[r];v(i)?(!e[r]&&(e[r]={}),e[r]=$(e[r],i)):e[r]=x(i)?i.concat():i}}),$(e,...t)}function Ce(e,t=!0){let n;return e[0]instanceof Date?n=t?(r,i)=>r-i:(r,i)=>i-r:t&&!e.every(isNaN)?n=(r,i)=>r-i:t||(n=(r,i)=>r>i&&-1||r<i&&1||r===i&&0),e.concat().sort(n)}function pt(e,t){let n=t.filter(r=>$e(r));return n.length?_(n[0])?n=Math[e](...n):n[0]instanceof Date&&(n=Ce(n,e==="min")[0]):n=void 0,n}const gt=(e,t,n=1)=>{const r=[],i=Math.max(0,Math.ceil((t-e)/n))|0;for(let s=e;s<i;s++)r.push(e+s*n);return r},mt={mouse:(()=>{const e=()=>({bubbles:!1,cancelable:!1,screenX:0,screenY:0,clientX:0,clientY:0});try{return new MouseEvent("t"),(t,n,r=e())=>{t.dispatchEvent(new MouseEvent(n,r))}}catch(t){return(n,r,i=e())=>{const s=pe.createEvent("MouseEvent");s.initMouseEvent(r,i.bubbles,i.cancelable,g,0,i.screenX,i.screenY,i.clientX,i.clientY,!1,!1,!1,!1,0,null),n.dispatchEvent(s)}}})(),touch:(e,t,n)=>{const r=new Touch($({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:[r],targetTouches:[],changedTouches:[r]}))}};function vt(e,t){let n=e;for(const r in t)n=n.replace(new RegExp(`{=${r}}`,"g"),t[r]);return n}function _t(e){var t;let n;if(e instanceof Date)n=e;else if(m(e)){const{config:r,format:i}=this;n=(t=i.dataTime(r.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 yt(e){const t=e.attr("viewBox");return t?/(\d+(\.\d+)?){3}/.test(t):!1}function xt(e,t,n=!1){const r=!!e.node;let i=!1;for(const[s,o]of Object.entries(t))if(i=r?e.style(s)===o:e.style[s]===o,n===!1&&i)break;return i}function $t(){var e,t;return((e=document)==null?void 0:e.hidden)===!1||((t=document)==null?void 0:t.visibilityState)==="visible"}function wt(e,t){const{DocumentTouch:n,matchMedia:r,navigator:i}=window,s=r==null?void 0:r("(pointer:coarse)").matches;let o=!1;if(t)if(i&&"maxTouchPoints"in i)o=i.maxTouchPoints>0;else if("ontouchmove"in window||n&&document instanceof n)o=!0;else if(s)o=!0;else{const a=i.userAgent;o=/\b(BlackBerry|webOS|iPhone|IEMobile)\b/i.test(a)||/\b(Android|Windows Phone|iPad|iPod)\b/i.test(a)}return e&&!s&&(r==null?void 0:r("(pointer:fine)").matches)&&"mouse"||o&&"touch"||"mouse"}function Pe(e,t){t()===!1?requestAnimationFrame(()=>Pe(e,t)):e()}function Ae(e){const t=this.config;let n,r,i;const s=()=>{const o=r.shift();if(o&&n&&y(n)&&o in n)return n=n[o],s();if(!o)return n};Object.keys(t).forEach(o=>{n=e,r=o.split("_"),i=s(),M(i)&&(t[o]=i)}),this.api&&(this.state.orgConfig=e)}var Re=Object.defineProperty,Se=(e,t,n)=>t in e?Re(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,w=(e,t,n)=>Se(e,typeof t!="symbol"?t+"":t,n);class j{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(j,"version","3.16.0");class Ie{constructor(){return{selector:void 0}}}var Le=Object.defineProperty,Me=(e,t,n)=>t in e?Le(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,E=(e,t,n)=>Me(e,typeof t!="symbol"?t+"":t,n);class N extends j{constructor(t){return super(t),E(this,"config"),E(this,"element"),this.config=new Ie,this}$beforeInit(){Ae.call(this,this.options),this.validate(),this.element=[].slice.call(document.querySelectorAll(this.config.selector)),this.overrideInternals(),this.overrideOptions(),this.overHandler=this.overHandler.bind(this),this.moveHandler=this.moveHandler.bind(this),this.outHandler=this.outHandler.bind(this)}validate(){const{$$:t,config:n}=this;let r="";if((!n.selector||!document.querySelector(n.selector))&&(r="No holder elements found from given selector option."),(t.hasType("bubble")||t.hasType("scatter")||t.hasArcType(t.data.targets))&&(r="Contains non supported chart types."),r)throw new Error(`[Sparkline plugin] ${r}`)}overrideInternals(){const{$$:t}=this,{getBarW:n,getIndices:r}=t;t.getIndices=function(i,s,o){return o==="getShapeX"?{}:r.call(this,i,s)},t.getBarW=function(i,s){return n.call(this,i,s,1)}}overrideOptions(){const{config:t}=this.$$;if(t.legend_show=!1,t.resize_auto=!1,t.axis_x_show=!1,t.padding!==!1){const n=r=>Object.keys(r||{}).length>0;n(t.axis_x_padding)&&(t.axis_x_padding={left:15,right:15,unit:"px"}),n(t.axis_y_padding)&&(t.axis_y_padding=5)}t.axis_y_show=!1,t.tooltip_position||(t.tooltip_position=function(n,r,i){const{internal:{state:{event:s}}}=this;let o=s.pageY-i*1.35,l=s.pageX-r/2;return o<0&&(o=0),l<0&&(l=0),{top:o,left:l}})}$init(){var t;const{$$:{$el:n}}=this;n.chart.style("width","0").style("height","0").style("pointer-events","none"),(t=n.tooltip)!=null&&t.node()&&document.body.appendChild(n.tooltip.node())}$afterInit(){const{$$:t}=this;t.$el.svg.attr("style",null).style("width","0").style("height","0"),this.bindEvents(!0)}bindEvents(t=!0){const{$$:{config:n}}=this;if(n.interaction_enabled&&n.tooltip_show){const r=`${t?"add":"remove"}EventListener`;this.element.forEach(i=>{const s=i.querySelector("svg");s[r]("mouseover",this.overHandler),s[r]("mousemove",this.moveHandler),s[r]("mouseout",this.outHandler)})}}overHandler(t){const{$$:n}=this,{state:{eventReceiver:r}}=n;r.rect=t.target.getBoundingClientRect()}moveHandler(t){var n,r,i,s;const{$$:o}=this,l=o.getDataIndexFromEvent(t),a=(n=o.api.data(t.target.__id))==null?void 0:n[0],u=(r=a==null?void 0:a.values)==null?void 0:r[l];u&&!u.name&&(u.name=u.id),o.state.event=t,(i=o.isPointFocusOnly)!=null&&i.call(o)&&u&&((s=o.showCircleFocus)==null||s.call(o,[u])),o.setExpand(l,a.id,!0),o.showTooltip([u],t.target)}outHandler(t){const{$$:n}=this;n.state.event=t,n.isPointFocusOnly()?n.hideCircleFocus():n.unexpandCircles(),n.hideTooltip()}$redraw(){var t;const{$$:n}=this,{$el:r}=n;let i=this.element;const s=n.api.data(),o=(t=r.chart.html().match(/<svg[^>]*>/))==null?void 0:t[0];if(i.length<s.length){const l=r.chart.node();for(let a=s.length-i.length;a>0;a--)l.parentNode.insertBefore(i[0].cloneNode(),l.nextSibling);this.element=document.querySelectorAll(this.config.selector),i=this.element}s.map(l=>l.id).forEach((l,a)=>{const u=`.${R.target}-${l}`,O=r.main.selectAll(u);let h=i[a].querySelector("svg");h||(i[a].innerHTML=`${o}</svg>`,h=i[a].querySelector("svg"),h.__id=l),h.querySelector(u)||O.style("opacity",null),O.style("fill","none").style("opacity",null),h.innerHTML="",h.appendChild(O.node())})}$willDestroy(){this.bindEvents(!1),this.element.forEach(t=>{t.innerHTML=""})}}return E(N,"version","0.0.1"),p=p.default,p}()});
@@ -5,7 +5,7 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.16.0-next.1
8
+ * @version 3.16.0
9
9
  * @requires billboard.js
10
10
  * @summary billboard.js plugin
11
11
  */
@@ -150,7 +150,8 @@ const $COMMON = {
150
150
  empty: "bb-empty",
151
151
  main: "bb-main",
152
152
  target: "bb-target",
153
- EXPANDED: "_expanded_"
153
+ EXPANDED: "_expanded_",
154
+ dummy: "_dummy_"
154
155
  };
155
156
  const $ARC = {
156
157
  arc: "bb-arc",
@@ -177,7 +178,9 @@ const $AXIS = {
177
178
  axisYLabel: "bb-axis-y-label",
178
179
  axisXTooltip: "bb-axis-x-tooltip",
179
180
  axisYTooltip: "bb-axis-y-tooltip",
180
- axisY2Tooltip: "bb-axis-y2-tooltip"
181
+ axisY2Tooltip: "bb-axis-y2-tooltip",
182
+ axisTooltipX: "bb-axis-tooltip-x",
183
+ axisTooltipY: "bb-axis-tooltip-y"
181
184
  };
182
185
  const $BAR = {
183
186
  bar: "bb-bar",
@@ -435,7 +438,7 @@ function getRectSegList(path) {
435
438
  ];
436
439
  }
437
440
  function getPathBox(path) {
438
- const { width, height } = path.getBoundingClientRect();
441
+ const { width, height } = getBoundingRect(path);
439
442
  const items = getRectSegList(path);
440
443
  const x = items[0].x;
441
444
  const y = Math.min(items[0].y, items[1].y);
@@ -467,9 +470,20 @@ function getBrushSelection(ctx) {
467
470
  }
468
471
  return selection;
469
472
  }
470
- function getBoundingRect(node) {
471
- const needEvaluate = !("rect" in node) || "rect" in node && node.hasAttribute("width") && node.rect.width !== +node.getAttribute("width");
472
- return needEvaluate ? node.rect = node.getBoundingClientRect() : node.rect;
473
+ function getRect(relativeViewport, node, forceEval = false) {
474
+ const _ = (n) => n[relativeViewport ? "getBoundingClientRect" : "getBBox"]();
475
+ if (forceEval) {
476
+ return _(node);
477
+ } else {
478
+ const needEvaluate = !("rect" in node) || "rect" in node && node.hasAttribute("width") && node.rect.width !== +(node.getAttribute("width") || 0);
479
+ return needEvaluate ? node.rect = _(node) : node.rect;
480
+ }
481
+ }
482
+ function getBoundingRect(node, forceEval = false) {
483
+ return getRect(true, node, forceEval);
484
+ }
485
+ function getBBox(node, forceEval = false) {
486
+ return getRect(false, node, forceEval);
473
487
  }
474
488
  function getRandom(asStr = true, min = 0, max = 1e4) {
475
489
  const crpt = win.crypto || win.msCrypto;
@@ -565,7 +579,7 @@ function getTransformCTM(node, x = 0, y = 0, inverse = true) {
565
579
  inverse ? screen == null ? void 0 : screen.inverse() : screen
566
580
  );
567
581
  if (inverse === false) {
568
- const rect = node.getBoundingClientRect();
582
+ const rect = getBoundingRect(node);
569
583
  res.x -= rect.x;
570
584
  res.y -= rect.y;
571
585
  }
@@ -848,7 +862,7 @@ class Plugin {
848
862
  });
849
863
  }
850
864
  }
851
- __publicField(Plugin, "version", "3.16.0-next.1");
865
+ __publicField(Plugin, "version", "3.16.0");
852
866
 
853
867
  // EXTERNAL MODULE: external {"commonjs":"d3-axis","commonjs2":"d3-axis","amd":"d3-axis","root":"d3"}
854
868
  var external_commonjs_d3_axis_commonjs2_d3_axis_amd_d3_axis_root_d3_ = __webpack_require__(8);
@@ -5,12 +5,12 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.16.0-next.1
8
+ * @version 3.16.0
9
9
  * @requires billboard.js
10
10
  * @summary billboard.js plugin
11
- */(function(f,_){typeof exports=="object"&&typeof module=="object"?module.exports=_(require("d3-color"),require("d3-interpolate"),require("d3-scale"),require("d3-brush"),require("d3-selection"),require("d3-axis"),require("d3-format")):typeof define=="function"&&define.amd?define("bb",["d3-color","d3-interpolate","d3-scale","d3-brush","d3-selection","d3-axis","d3-format"],_):typeof exports=="object"?exports.bb=_(require("d3-color"),require("d3-interpolate"),require("d3-scale"),require("d3-brush"),require("d3-selection"),require("d3-axis"),require("d3-format")):(f.bb=f.bb||{},f.bb.plugin=f.bb.plugin||{},f.bb.plugin.stanford=_(f.d3,f.d3,f.d3,f.d3,f.d3,f.d3,f.d3))})(this,function(j,f,_,z,H,K,W){return function(){"use strict";var Z={218:function(e){e.exports=j},390:function(e){e.exports=W},455:function(e){e.exports=_},747:function(e){e.exports=H},798:function(e){e.exports=f},853:function(e){e.exports=z},996:function(e){e.exports=K}},M={};function h(e){var t=M[e];if(t!==void 0)return t.exports;var n=M[e]={exports:{}};return Z[e](n,n.exports,h),n.exports}(function(){h.d=function(e,t){for(var n in t)h.o(t,n)&&!h.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}})(),function(){h.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}}();var y={};h.d(y,{default:function(){return st}});var D=h(218),J=h(798),E=h(455),Q=Object.defineProperty,I=Object.getOwnPropertySymbols,ee=Object.prototype.hasOwnProperty,te=Object.prototype.propertyIsEnumerable,N=(e,t,n)=>t in e?Q(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,u=(e,t)=>{for(var n in t||(t={}))ee.call(t,n)&&N(e,n,t[n]);if(I)for(var n of I(t))te.call(t,n)&&N(e,n,t[n]);return e};const ne={button:"bb-button",chart:"bb-chart",empty:"bb-empty",main:"bb-main",target:"bb-target",EXPANDED:"_expanded_"},oe={arc:"bb-arc",arcLabelLine:"bb-arc-label-line",arcRange:"bb-arc-range",arcs:"bb-arcs",chartArc:"bb-chart-arc",chartArcs:"bb-chart-arcs",chartArcsBackground:"bb-chart-arcs-background",chartArcsTitle:"bb-chart-arcs-title",needle:"bb-needle"},re={area:"bb-area",areas:"bb-areas"},se={axis:"bb-axis",axisX:"bb-axis-x",axisXLabel:"bb-axis-x-label",axisY:"bb-axis-y",axisY2:"bb-axis-y2",axisY2Label:"bb-axis-y2-label",axisYLabel:"bb-axis-y-label",axisXTooltip:"bb-axis-x-tooltip",axisYTooltip:"bb-axis-y-tooltip",axisY2Tooltip:"bb-axis-y2-tooltip"},ae={bar:"bb-bar",bars:"bb-bars",chartBar:"bb-chart-bar",chartBars:"bb-chart-bars",barConnectLine:"bb-bar-connectLine"},ie={candlestick:"bb-candlestick",candlesticks:"bb-candlesticks",chartCandlestick:"bb-chart-candlestick",chartCandlesticks:"bb-chart-candlesticks",valueDown:"bb-value-down",valueUp:"bb-value-up"},ce={chartCircles:"bb-chart-circles",circle:"bb-circle",circles:"bb-circles"},le={colorPattern:"bb-color-pattern",colorScale:"bb-colorscale"},ue={dragarea:"bb-dragarea",INCLUDED:"_included_"},de={funnel:"bb-funnel",chartFunnel:"bb-chart-funnel",chartFunnels:"bb-chart-funnels",funnelBackground:"bb-funnel-background"},be={chartArcsGaugeMax:"bb-chart-arcs-gauge-max",chartArcsGaugeMin:"bb-chart-arcs-gauge-min",chartArcsGaugeUnit:"bb-chart-arcs-gauge-unit",chartArcsGaugeTitle:"bb-chart-arcs-gauge-title",gaugeValue:"bb-gauge-value"},fe={legend:"bb-legend",legendBackground:"bb-legend-background",legendItem:"bb-legend-item",legendItemEvent:"bb-legend-item-event",legendItemHidden:"bb-legend-item-hidden",legendItemPoint:"bb-legend-item-point",legendItemTile:"bb-legend-item-tile"},he={chartLine:"bb-chart-line",chartLines:"bb-chart-lines",line:"bb-line",lines:"bb-lines"},pe={eventRect:"bb-event-rect",eventRects:"bb-event-rects",eventRectsMultiple:"bb-event-rects-multiple",eventRectsSingle:"bb-event-rects-single"},ge={focused:"bb-focused",defocused:"bb-defocused",legendItemFocused:"bb-legend-item-focused",xgridFocus:"bb-xgrid-focus",ygridFocus:"bb-ygrid-focus"},me={grid:"bb-grid",gridLines:"bb-grid-lines",xgrid:"bb-xgrid",xgridLine:"bb-xgrid-line",xgridLines:"bb-xgrid-lines",xgrids:"bb-xgrids",ygrid:"bb-ygrid",ygridLine:"bb-ygrid-line",ygridLines:"bb-ygrid-lines",ygrids:"bb-ygrids"},it={level:"bb-level",levels:"bb-levels"},_e={chartRadar:"bb-chart-radar",chartRadars:"bb-chart-radars"},xe={region:"bb-region",regions:"bb-regions"},ye={selectedCircle:"bb-selected-circle",selectedCircles:"bb-selected-circles",SELECTED:"_selected_"},ve={shape:"bb-shape",shapes:"bb-shapes"},$e={brush:"bb-brush",subchart:"bb-subchart"},we={chartText:"bb-chart-text",chartTexts:"bb-chart-texts",text:"bb-text",texts:"bb-texts",title:"bb-title",TextOverlapping:"text-overlapping"},S={tooltip:"bb-tooltip",tooltipContainer:"bb-tooltip-container",tooltipName:"bb-tooltip-name"},Ee={treemap:"bb-treemap",chartTreemap:"bb-chart-treemap",chartTreemaps:"bb-chart-treemaps"},Se={buttonZoomReset:"bb-zoom-reset",zoomBrush:"bb-zoom-brush"};var ct=u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u({},ne),oe),re),se),ae),ie),ce),le),ue),be),fe),he),pe),ge),de),me),_e),xe),ye),ve),$e),we),S),Ee),Se),lt=h(853),ut=h(747);function Ce(){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 Oe(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 v=Ce(),Pe=v==null?void 0:v.document,[dt,bt,ft,ht]=Oe(v);var Re=Object.defineProperty,F=Object.getOwnPropertySymbols,Te=Object.prototype.hasOwnProperty,Ae=Object.prototype.propertyIsEnumerable,q=(e,t,n)=>t in e?Re(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,B=(e,t)=>{for(var n in t||(t={}))Te.call(t,n)&&q(e,n,t[n]);if(F)for(var n of F(t))Ae.call(t,n)&&q(e,n,t[n]);return e};const pt=e=>e||e===0,C=e=>typeof e=="function",x=e=>typeof e=="string",O=e=>typeof e=="number",Le=e=>typeof e=="undefined",U=e=>typeof e!="undefined",gt=e=>typeof e=="boolean",mt=e=>Math.ceil(e/10)*10,_t=e=>Math.ceil(e)+.5,xt=e=>e[1]-e[0],P=e=>typeof e=="object",X=e=>Le(e)||e===null||x(e)&&e.length===0||P(e)&&!(e instanceof Date)&&Object.keys(e).length===0||O(e)&&isNaN(e),je=e=>!X(e),R=e=>Array.isArray(e),$=e=>e&&!(e!=null&&e.nodeType)&&P(e)&&!R(e);function yt(e,t,n){return U(e[t])?e[t]:n}function vt(e,t){let n=!1;return Object.keys(e).forEach(o=>e[o]===t&&(n=!0)),n}function $t(e,t,...n){const o=C(e);return o&&e.call(t,...n),o}function wt(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 Et(e){return x(e)?e.replace(/<(script|img)?/ig,"&lt;").replace(/(script)?>/ig,"&gt;"):e}function St(e,t,n=[-1,1],o=!1){if(!(!e||!x(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
- `),a=o?s.length-1:1;e.html(""),s.forEach((i,d)=>{e.append("tspan").attr("x",0).attr("dy",`${d===0?n[0]*a:n[1]}em`).text(i)})}}}function Me(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 Ct(e){const{width:t,height:n}=e.getBoundingClientRect(),o=Me(e),r=o[0].x,s=Math.min(o[0].y,o[1].y);return{x:r,y:s,width:t,height:n}}function Ot(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 De(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 Pt(e){return!("rect"in e)||"rect"in e&&e.hasAttribute("width")&&e.rect.width!==+e.getAttribute("width")?e.rect=e.getBoundingClientRect():e.rect}function Rt(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 V(e,t,n,o,r){if(n>o)return-1;const s=Math.floor((n+o)/2);let{x:a,w:i=0}=e[s];return r&&(a=e[s].y,i=e[s].h),t>=a&&t<=a+i?s:t<a?V(e,t,n,s-1,r):V(e,t,s+1,o,r)}function Tt(e){const t=De(e);return t?t[0]===t[1]:!0}function At(...e){const t=n=>{if($(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)=>B(B({},n),o))}function Ie(e={},t){R(t)&&t.forEach(n=>Ie(e,n));for(const n in t)/^\d+$/.test(n)||n in e||(e[n]=t[n]);return e}const Lt=e=>e.charAt(0).toUpperCase()+e.slice(1);function jt(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 Mt(e,t,n){const{rootSelector:o="",sheet:r}=e,a=`${o} ${(i=>i.replace(/\s?(bb-)/g,".$1").replace(/\.+/g,"."))(t)} {${n.join(";")}}`;return r[r.insertRule?"insertRule":"addRule"](a,r.cssRules.length)}function Dt(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 It(e){var t,n,o,r,s,a;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)+((a=e.scrollTop)!=null?a:0)}}function Nt(e,t=0,n=0,o=!0){const r=new DOMPoint(t,n),s=e.getScreenCTM(),a=r.matrixTransform(o?s==null?void 0:s.inverse():s);if(o===!1){const i=e.getBoundingClientRect();a.x-=i.x,a.y-=i.y}return a}function Ft(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 qt(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 Bt(e){return e&&e.length?e.reduce((t,n)=>t.concat(n)):[]}function T(e,...t){if(!t.length||t.length===1&&!t[0])return e;const n=t.shift();return $(e)&&$(n)&&Object.keys(n).forEach(o=>{if(!/^(__proto__|constructor|prototype)$/i.test(o)){const r=n[o];$(r)?(!e[o]&&(e[o]={}),e[o]=T(e[o],r)):e[o]=R(r)?r.concat():r}}),T(e,...t)}function Fe(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 Ut(e,t){let n=t.filter(o=>je(o));return n.length?O(n[0])?n=Math[e](...n):n[0]instanceof Date&&(n=Fe(n,e==="min")[0]):n=void 0,n}const qe=(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},Xt={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=Pe.createEvent("MouseEvent");s.initMouseEvent(o,r.bubbles,r.cancelable,v,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(T({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 Vt(e,t){let n=e;for(const o in t)n=n.replace(new RegExp(`{=${o}}`,"g"),t[o]);return n}function Be(e){var t;let n;if(e instanceof Date)n=e;else if(x(e)){const{config:o,format:r}=this;n=(t=r.dataTime(o.data_xFormat)(e))!=null?t:new Date(e)}else O(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 Yt(e){const t=e.attr("viewBox");return t?/(\d+(\.\d+)?){3}/.test(t):!1}function Gt(e,t,n=!1){const o=!!e.node;let r=!1;for(const[s,a]of Object.entries(t))if(r=o?e.style(s)===a:e.style[s]===a,n===!1&&r)break;return r}function kt(){var e,t;return((e=document)==null?void 0:e.hidden)===!1||((t=document)==null?void 0:t.visibilityState)==="visible"}function zt(e,t){const{DocumentTouch:n,matchMedia:o,navigator:r}=window,s=o==null?void 0:o("(pointer:coarse)").matches;let a=!1;if(t)if(r&&"maxTouchPoints"in r)a=r.maxTouchPoints>0;else if("ontouchmove"in window||n&&document instanceof n)a=!0;else if(s)a=!0;else{const d=r.userAgent;a=/\b(BlackBerry|webOS|iPhone|IEMobile)\b/i.test(d)||/\b(Android|Windows Phone|iPad|iPod)\b/i.test(d)}return e&&!s&&(o==null?void 0:o("(pointer:fine)").matches)&&"mouse"||a&&"touch"||"mouse"}function Ue(e,t){t()===!1?requestAnimationFrame(()=>Ue(e,t)):e()}function Xe(e){const t=this.config;let n,o,r;const s=()=>{const a=o.shift();if(a&&n&&P(n)&&a in n)return n=n[a],s();if(!a)return n};Object.keys(t).forEach(a=>{n=e,o=a.split("_"),r=s(),U(r)&&(t[a]=r)}),this.api&&(this.state.orgConfig=e)}var Ve=Object.defineProperty,Ye=(e,t,n)=>t in e?Ve(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,A=(e,t,n)=>Ye(e,typeof t!="symbol"?t+"":t,n);class Y{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(Y,"version","3.16.0-next.1");var Ge=h(996),ke=h(390),p={colorScale:"bb-colorscale",stanfordElements:"bb-stanford-elements",stanfordLine:"bb-stanford-line",stanfordLines:"bb-stanford-lines",stanfordRegion:"bb-stanford-region",stanfordRegions:"bb-stanford-regions"},ze=Object.defineProperty,He=(e,t,n)=>t in e?ze(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,G=(e,t,n)=>He(e,typeof t!="symbol"?t+"":t,n);class Ke{constructor(t){G(this,"owner"),G(this,"colorScale"),this.owner=t}drawColorScale(){const{$$:t,config:n}=this.owner,o=t.data.targets[0],r=t.state.height-n.padding_bottom-n.padding_top,s=n.scale_width,a=5,i=qe(n.padding_bottom,r,a),d=(0,E.scaleSequential)(o.colors).domain([i[i.length-1],i[0]]);this.colorScale&&this.colorScale.remove(),this.colorScale=t.$el.svg.append("g").attr("width",50).attr("height",r).attr("class",p.colorScale),this.colorScale.append("g").attr("transform",`translate(0, ${n.padding_top})`).selectAll("bars").data(i).enter().append("rect").attr("y",(m,at)=>at*a).attr("x",0).attr("width",s).attr("height",a).attr("fill",m=>d(m));const b=(0,E.scaleSymlog)().domain([o.minEpochs,o.maxEpochs]).range([i[0]+n.padding_top+i[i.length-1]+a-1,i[0]+n.padding_top]),c=(0,Ge.axisRight)(b),l=n.scale_format;l==="pow10"?c.tickValues([1,10,100,1e3,1e4,1e5,1e6,1e7]):C(l)?c.tickFormat(l):c.tickFormat((0,ke.format)("d"));const g=this.colorScale.append("g").attr("class","legend axis").attr("transform",`translate(${s},0)`).call(c);l==="pow10"&&g.selectAll(".tick text").text(null).filter(m=>m/Math.pow(10,Math.ceil(Math.log(m)/Math.LN10-1e-12))===1).text(10).append("tspan").attr("dy","-.7em").text(m=>Math.round(Math.log(m)/Math.LN10)),this.colorScale.attr("transform",`translate(${t.state.current.width-this.xForColorScale()}, 0)`)}xForColorScale(){return this.owner.config.padding_right+this.colorScale.node().getBBox().width}getColorScalePadding(){return this.xForColorScale()+this.owner.config.padding_left+20}}function We(e,t){const n=e.x,o=e.value;let r=!1;for(let s=0,a=t.length-1;s<t.length;a=s++){const i=t[s].x,d=t[s].y,b=t[a].x,c=t[a].y;d>o!=c>o&&n<(b-i)*(o-d)/(c-d)+i&&(r=!r)}return r}function Ze(e,t){return e.epochs<t.epochs?-1:e.epochs>t.epochs?1:0}function Je(e){let t=0,n,o;for(let r=0,s=e.length,a=s-1;r<s;a=r,r++)n=e[r],o=e[a],t+=n.x*o.y,t-=n.y*o.x;return t/=2,t}function w(e){const t=Je(e);let n=0,o=0,r;for(let s=0,a=e.length,i=a-1;s<a;i=s,s++){const d=e[s],b=e[i];r=d.x*b.y-b.x*d.y,n+=(d.x+b.x)*r,o+=(d.y+b.y)*r}return r=t*6,{x:n/r,y:o/r}}var Qe=Object.defineProperty,et=(e,t,n)=>t in e?Qe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,tt=(e,t,n)=>et(e,typeof t!="symbol"?t+"":t,n);class nt{constructor(t){tt(this,"owner"),this.owner=t;const n=t.$$.$el.main.select(".bb-chart").append("g").attr("class",p.stanfordElements);n.append("g").attr("class",p.stanfordLines),n.append("g").attr("class",p.stanfordRegions)}updateStanfordLines(t){const{$$:n}=this.owner,{config:o,$el:{main:r}}=n,s=o.axis_rotated,a=this.xvCustom.bind(n),i=this.yvCustom.bind(n),d=r.select(`.${p.stanfordLines}`).style("shape-rendering","geometricprecision").selectAll(`.${p.stanfordLine}`).data(this.owner.config.lines);d.exit().transition().duration(t).style("opacity","0").remove();const b=d.enter().append("g");b.append("line").style("opacity","0"),b.merge(d).attr("class",c=>p.stanfordLine+(c.class?` ${c.class}`:"")).select("line").transition().duration(t).attr("x1",c=>s?i(c,"y1"):a(c,"x1")).attr("x2",c=>s?i(c,"y2"):a(c,"x2")).attr("y1",c=>s?a(c,"x1"):i(c,"y1")).attr("y2",c=>s?a(c,"x2"):i(c,"y2")).transition().style("opacity",null)}updateStanfordRegions(t){const{$$:n}=this.owner,{config:o,$el:{main:r}}=n,s=o.axis_rotated,a=this.xvCustom.bind(n),i=this.yvCustom.bind(n),d=this.owner.countEpochsInRegion.bind(n);let b=r.select(`.${p.stanfordRegions}`).selectAll(`.${p.stanfordRegion}`).data(this.owner.config.regions);b.exit().transition().duration(t).style("opacity","0").remove();const c=b.enter().append("g");c.append("polygon").style("opacity","0"),c.append("text").attr("transform",s?"rotate(-90)":"").style("opacity","0"),b=c.merge(b),b.attr("class",l=>p.stanfordRegion+(l.class?` ${l.class}`:"")).select("polygon").transition().duration(t).attr("points",l=>l.points.map(g=>[s?i(g,"y"):a(g,"x"),s?a(g,"x"):i(g,"y")].join(",")).join(" ")).transition().style("opacity",l=>String(l.opacity?l.opacity:.2)),b.select("text").transition().duration(t).attr("x",l=>s?i(w(l.points),"y"):a(w(l.points),"x")).attr("y",l=>s?a(w(l.points),"x"):i(w(l.points),"y")).text(l=>{if(l.text){const{value:g,percentage:m}=d(l.points);return l.text(g,m)}return""}).attr("text-anchor","middle").attr("dominant-baseline","middle").transition().style("opacity",null)}updateStanfordElements(t=0){this.updateStanfordLines(t),this.updateStanfordRegions(t)}xvCustom(t,n){const o=this,{axis:r,config:s}=o;let a=n?t[n]:o.getBaseValue(t);return r.isTimeSeries()?a=Be.call(o,a):r.isCategorized()&&x(a)&&(a=s.axis_x_categories.indexOf(t.value)),o.scale.x(a)}yvCustom(t,n){const o=this,r=t.axis&&t.axis==="y2"?o.scale.y2:o.scale.y,s=n?t[n]:o.getBaseValue(t);return r(s)}}class k{constructor(){return{colors:void 0,epochs:[],lines:[],scale_min:void 0,scale_max:void 0,scale_width:20,scale_format:void 0,padding_top:0,padding_right:0,padding_bottom:0,padding_left:0,regions:[]}}}var ot=Object.defineProperty,rt=(e,t,n)=>t in e?ot(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,L=(e,t,n)=>rt(e,typeof t!="symbol"?t+"":t,n);class st extends Y{constructor(t){return super(t),L(this,"config"),L(this,"colorScale"),L(this,"elements"),this.config=new k,this}$beforeInit(){const{$$:t}=this;t.config.data_xSort=!1,t.isMultipleX=()=>!0,t.showGridFocus=()=>{},t.labelishData=o=>o.values,t.opacityForCircle=()=>1;const n=t.getCurrentPadding.bind(t);t.getCurrentPadding=()=>{const o=n();return o.right+=this.colorScale?this.colorScale.getColorScalePadding():0,o}}$init(){const{$$:t}=this;Xe.call(this,this.options),t.color=this.getStanfordPointColor.bind(t),this.colorScale=new Ke(this),this.elements=new nt(this),this.convertData(),this.initStanfordData(),this.setStanfordTooltip(),this.colorScale.drawColorScale(),t.right+=this.colorScale?this.colorScale.getColorScalePadding():0,this.$redraw()}$redraw(t){var n,o;(n=this.colorScale)==null||n.drawColorScale(),(o=this.elements)==null||o.updateStanfordElements(t)}getOptions(){return new k}convertData(){const t=this.$$.data.targets,n=this.options.epochs;t.forEach(o=>{o.values.forEach((r,s)=>{r.epochs=n[s]}),o.minEpochs=void 0,o.maxEpochs=void 0,o.colors=void 0,o.colorscale=void 0})}initStanfordData(){const{config:t}=this,n=this.$$.data.targets[0];n.values.sort(Ze);const o=n.values.map(r=>r.epochs);n.minEpochs=isNaN(t.scale_min)?Math.min(...o):t.scale_min,n.maxEpochs=isNaN(t.scale_max)?Math.max(...o):t.scale_max,n.colors=C(t.colors)?t.colors:(0,J.interpolateHslLong)((0,D.hsl)(250,1,.5),(0,D.hsl)(0,1,.5)),n.colorscale=(0,E.scaleSequentialLog)(n.colors).domain([n.minEpochs,n.maxEpochs])}getStanfordPointColor(t){return this.data.targets[0].colorscale(t.epochs)}setStanfordTooltip(){const{config:t}=this.$$;X(t.tooltip_contents)&&(t.tooltip_contents=function(n,o,r,s){const{data_x:a}=t;let i=`<table class="${S.tooltip}"><tbody>`;return n.forEach(d=>{const{id:b="",value:c=0,epochs:l=0,x:g=""}=d;i+=`<tr>
11
+ */(function(f,_){typeof exports=="object"&&typeof module=="object"?module.exports=_(require("d3-color"),require("d3-interpolate"),require("d3-scale"),require("d3-brush"),require("d3-selection"),require("d3-axis"),require("d3-format")):typeof define=="function"&&define.amd?define("bb",["d3-color","d3-interpolate","d3-scale","d3-brush","d3-selection","d3-axis","d3-format"],_):typeof exports=="object"?exports.bb=_(require("d3-color"),require("d3-interpolate"),require("d3-scale"),require("d3-brush"),require("d3-selection"),require("d3-axis"),require("d3-format")):(f.bb=f.bb||{},f.bb.plugin=f.bb.plugin||{},f.bb.plugin.stanford=_(f.d3,f.d3,f.d3,f.d3,f.d3,f.d3,f.d3))})(this,function(j,f,_,K,W,Z,J){return function(){"use strict";var Q={218:function(t){t.exports=j},390:function(t){t.exports=J},455:function(t){t.exports=_},747:function(t){t.exports=W},798:function(t){t.exports=f},853:function(t){t.exports=K},996:function(t){t.exports=Z}},M={};function h(t){var e=M[t];if(e!==void 0)return e.exports;var n=M[t]={exports:{}};return Q[t](n,n.exports,h),n.exports}(function(){h.d=function(t,e){for(var n in e)h.o(e,n)&&!h.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})}})(),function(){h.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)}}();var y={};h.d(y,{default:function(){return ie}});var D=h(218),tt=h(798),E=h(455),et=Object.defineProperty,I=Object.getOwnPropertySymbols,nt=Object.prototype.hasOwnProperty,ot=Object.prototype.propertyIsEnumerable,N=(t,e,n)=>e in t?et(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,u=(t,e)=>{for(var n in e||(e={}))nt.call(e,n)&&N(t,n,e[n]);if(I)for(var n of I(e))ot.call(e,n)&&N(t,n,e[n]);return t};const rt={button:"bb-button",chart:"bb-chart",empty:"bb-empty",main:"bb-main",target:"bb-target",EXPANDED:"_expanded_",dummy:"_dummy_"},st={arc:"bb-arc",arcLabelLine:"bb-arc-label-line",arcRange:"bb-arc-range",arcs:"bb-arcs",chartArc:"bb-chart-arc",chartArcs:"bb-chart-arcs",chartArcsBackground:"bb-chart-arcs-background",chartArcsTitle:"bb-chart-arcs-title",needle:"bb-needle"},at={area:"bb-area",areas:"bb-areas"},it={axis:"bb-axis",axisX:"bb-axis-x",axisXLabel:"bb-axis-x-label",axisY:"bb-axis-y",axisY2:"bb-axis-y2",axisY2Label:"bb-axis-y2-label",axisYLabel:"bb-axis-y-label",axisXTooltip:"bb-axis-x-tooltip",axisYTooltip:"bb-axis-y-tooltip",axisY2Tooltip:"bb-axis-y2-tooltip",axisTooltipX:"bb-axis-tooltip-x",axisTooltipY:"bb-axis-tooltip-y"},ct={bar:"bb-bar",bars:"bb-bars",chartBar:"bb-chart-bar",chartBars:"bb-chart-bars",barConnectLine:"bb-bar-connectLine"},lt={candlestick:"bb-candlestick",candlesticks:"bb-candlesticks",chartCandlestick:"bb-chart-candlestick",chartCandlesticks:"bb-chart-candlesticks",valueDown:"bb-value-down",valueUp:"bb-value-up"},ut={chartCircles:"bb-chart-circles",circle:"bb-circle",circles:"bb-circles"},dt={colorPattern:"bb-color-pattern",colorScale:"bb-colorscale"},bt={dragarea:"bb-dragarea",INCLUDED:"_included_"},ft={funnel:"bb-funnel",chartFunnel:"bb-chart-funnel",chartFunnels:"bb-chart-funnels",funnelBackground:"bb-funnel-background"},ht={chartArcsGaugeMax:"bb-chart-arcs-gauge-max",chartArcsGaugeMin:"bb-chart-arcs-gauge-min",chartArcsGaugeUnit:"bb-chart-arcs-gauge-unit",chartArcsGaugeTitle:"bb-chart-arcs-gauge-title",gaugeValue:"bb-gauge-value"},pt={legend:"bb-legend",legendBackground:"bb-legend-background",legendItem:"bb-legend-item",legendItemEvent:"bb-legend-item-event",legendItemHidden:"bb-legend-item-hidden",legendItemPoint:"bb-legend-item-point",legendItemTile:"bb-legend-item-tile"},gt={chartLine:"bb-chart-line",chartLines:"bb-chart-lines",line:"bb-line",lines:"bb-lines"},mt={eventRect:"bb-event-rect",eventRects:"bb-event-rects",eventRectsMultiple:"bb-event-rects-multiple",eventRectsSingle:"bb-event-rects-single"},_t={focused:"bb-focused",defocused:"bb-defocused",legendItemFocused:"bb-legend-item-focused",xgridFocus:"bb-xgrid-focus",ygridFocus:"bb-ygrid-focus"},xt={grid:"bb-grid",gridLines:"bb-grid-lines",xgrid:"bb-xgrid",xgridLine:"bb-xgrid-line",xgridLines:"bb-xgrid-lines",xgrids:"bb-xgrids",ygrid:"bb-ygrid",ygridLine:"bb-ygrid-line",ygridLines:"bb-ygrid-lines",ygrids:"bb-ygrids"},le={level:"bb-level",levels:"bb-levels"},yt={chartRadar:"bb-chart-radar",chartRadars:"bb-chart-radars"},vt={region:"bb-region",regions:"bb-regions"},$t={selectedCircle:"bb-selected-circle",selectedCircles:"bb-selected-circles",SELECTED:"_selected_"},wt={shape:"bb-shape",shapes:"bb-shapes"},Et={brush:"bb-brush",subchart:"bb-subchart"},St={chartText:"bb-chart-text",chartTexts:"bb-chart-texts",text:"bb-text",texts:"bb-texts",title:"bb-title",TextOverlapping:"text-overlapping"},S={tooltip:"bb-tooltip",tooltipContainer:"bb-tooltip-container",tooltipName:"bb-tooltip-name"},Ct={treemap:"bb-treemap",chartTreemap:"bb-chart-treemap",chartTreemaps:"bb-chart-treemaps"},Ot={buttonZoomReset:"bb-zoom-reset",zoomBrush:"bb-zoom-brush"};var ue=u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u({},rt),st),at),it),ct),lt),ut),dt),bt),ht),pt),gt),mt),_t),ft),xt),yt),vt),$t),wt),Et),St),S),Ct),Ot),de=h(853),be=h(747);function Pt(){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 Rt(t){const e=typeof(t==null?void 0:t.requestAnimationFrame)=="function"&&typeof(t==null?void 0:t.cancelAnimationFrame)=="function",n=typeof(t==null?void 0:t.requestIdleCallback)=="function"&&typeof(t==null?void 0:t.cancelIdleCallback)=="function",o=s=>setTimeout(s,1),r=s=>clearTimeout(s);return[e?t.requestAnimationFrame:o,e?t.cancelAnimationFrame:r,n?t.requestIdleCallback:o,n?t.cancelIdleCallback:r]}const v=Pt(),Tt=v==null?void 0:v.document,[fe,he,pe,ge]=Rt(v);var At=Object.defineProperty,F=Object.getOwnPropertySymbols,Lt=Object.prototype.hasOwnProperty,jt=Object.prototype.propertyIsEnumerable,B=(t,e,n)=>e in t?At(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,q=(t,e)=>{for(var n in e||(e={}))Lt.call(e,n)&&B(t,n,e[n]);if(F)for(var n of F(e))jt.call(e,n)&&B(t,n,e[n]);return t};const me=t=>t||t===0,C=t=>typeof t=="function",x=t=>typeof t=="string",O=t=>typeof t=="number",Mt=t=>typeof t=="undefined",U=t=>typeof t!="undefined",_e=t=>typeof t=="boolean",xe=t=>Math.ceil(t/10)*10,ye=t=>Math.ceil(t)+.5,ve=t=>t[1]-t[0],P=t=>typeof t=="object",X=t=>Mt(t)||t===null||x(t)&&t.length===0||P(t)&&!(t instanceof Date)&&Object.keys(t).length===0||O(t)&&isNaN(t),Dt=t=>!X(t),R=t=>Array.isArray(t),$=t=>t&&!(t!=null&&t.nodeType)&&P(t)&&!R(t);function $e(t,e,n){return U(t[e])?t[e]:n}function we(t,e){let n=!1;return Object.keys(t).forEach(o=>t[o]===e&&(n=!0)),n}function Ee(t,e,...n){const o=C(t);return o&&t.call(e,...n),o}function Se(t,e){let n=0;const o=function(...r){!--n&&e.apply(this,...r)};"duration"in t?t.each(()=>++n).on("end",o):(++n,t.call(o))}function Ce(t){return x(t)?t.replace(/<(script|img)?/ig,"&lt;").replace(/(script)?>/ig,"&gt;"):t}function Oe(t,e,n=[-1,1],o=!1){if(!(!t||!x(e)))if(e.indexOf(`
12
+ `)===-1)t.text(e);else{const r=[t.text(),e].map(s=>s.replace(/[\s\n]/g,""));if(r[0]!==r[1]){const s=e.split(`
13
+ `),a=o?s.length-1:1;t.html(""),s.forEach((i,d)=>{t.append("tspan").attr("x",0).attr("dy",`${d===0?n[0]*a:n[1]}em`).text(i)})}}}function It(t){const{x:e,y:n,width:o,height:r}=t.getBBox();return[{x:e,y:n+r},{x:e,y:n},{x:e+o,y:n},{x:e+o,y:n+r}]}function Pe(t){const{width:e,height:n}=V(t),o=It(t),r=o[0].x,s=Math.min(o[0].y,o[1].y);return{x:r,y:s,width:e,height:n}}function Re(t,e){var n;const o=t&&((n=t.touches||t.sourceEvent&&t.sourceEvent.touches)==null?void 0:n[0]);let r=[0,0];try{r=d3Pointer(o||t,e)}catch(s){}return r.map(s=>isNaN(s)?0:s)}function Nt(t){const{event:e,$el:n}=t,o=n.subchart.main||n.main;let r;return e&&e.type==="brush"?r=e.selection:o&&(r=o.select(".bb-brush").node())&&(r=d3BrushSelection(r)),r}function Y(t,e,n=!1){const o=r=>r[t?"getBoundingClientRect":"getBBox"]();return n?o(e):!("rect"in e)||"rect"in e&&e.hasAttribute("width")&&e.rect.width!==+(e.getAttribute("width")||0)?e.rect=o(e):e.rect}function V(t,e=!1){return Y(!0,t,e)}function Te(t,e=!1){return Y(!1,t,e)}function Ae(t=!0,e=0,n=1e4){const o=window.crypto||window.msCrypto,r=o?e+o.getRandomValues(new Uint32Array(1))[0]%(n-e+1):Math.floor(Math.random()*(n-e)+e);return t?String(r):r}function G(t,e,n,o,r){if(n>o)return-1;const s=Math.floor((n+o)/2);let{x:a,w:i=0}=t[s];return r&&(a=t[s].y,i=t[s].h),e>=a&&e<=a+i?s:e<a?G(t,e,n,s-1,r):G(t,e,s+1,o,r)}function Le(t){const e=Nt(t);return e?e[0]===e[1]:!0}function je(...t){const e=n=>{if($(n)&&n.constructor){const o=new n.constructor;for(const r in n)o[r]=e(n[r]);return o}return n};return t.map(n=>e(n)).reduce((n,o)=>q(q({},n),o))}function Ft(t={},e){R(e)&&e.forEach(n=>Ft(t,n));for(const n in e)/^\d+$/.test(n)||n in t||(t[n]=e[n]);return t}const Me=t=>t.charAt(0).toUpperCase()+t.slice(1);function De(t,e="-"){return t.split(e).map((n,o)=>o?n.charAt(0).toUpperCase()+n.slice(1).toLowerCase():n.toLowerCase()).join("")}const Bt=t=>[].slice.call(t);function Ie(t,e,n){const{rootSelector:o="",sheet:r}=t,a=`${o} ${(i=>i.replace(/\s?(bb-)/g,".$1").replace(/\.+/g,"."))(e)} {${n.join(";")}}`;return r[r.insertRule?"insertRule":"addRule"](a,r.cssRules.length)}function Ne(t){let e=[];return t.forEach(n=>{var o;try{n.cssRules&&n.cssRules.length&&(e=e.concat(Bt(n.cssRules)))}catch(r){(o=window.console)==null||o.warn(`Error while reading rules from ${n.href}: ${r.toString()}`)}}),e}function Fe(t){var e,n,o,r,s,a;return{x:((n=(e=window.pageXOffset)!=null?e:window.scrollX)!=null?n:0)+((o=t.scrollLeft)!=null?o:0),y:((s=(r=window.pageYOffset)!=null?r:window.scrollY)!=null?s:0)+((a=t.scrollTop)!=null?a:0)}}function Be(t,e=0,n=0,o=!0){const r=new DOMPoint(e,n),s=t.getScreenCTM(),a=r.matrixTransform(o?s==null?void 0:s.inverse():s);if(o===!1){const i=V(t);a.x-=i.x,a.y-=i.y}return a}function qe(t){const e=t?t.transform:null,n=e&&e.baseVal;return n&&n.numberOfItems?n.getItem(0).matrix:{a:0,b:0,c:0,d:0,e:0,f:0}}function Ue(t){const e=t[0]instanceof Date,n=(e?t.map(Number):t).filter((o,r,s)=>s.indexOf(o)===r);return e?n.map(o=>new Date(o)):n}function Xe(t){return t&&t.length?t.reduce((e,n)=>e.concat(n)):[]}function T(t,...e){if(!e.length||e.length===1&&!e[0])return t;const n=e.shift();return $(t)&&$(n)&&Object.keys(n).forEach(o=>{if(!/^(__proto__|constructor|prototype)$/i.test(o)){const r=n[o];$(r)?(!t[o]&&(t[o]={}),t[o]=T(t[o],r)):t[o]=R(r)?r.concat():r}}),T(t,...e)}function qt(t,e=!0){let n;return t[0]instanceof Date?n=e?(o,r)=>o-r:(o,r)=>r-o:e&&!t.every(isNaN)?n=(o,r)=>o-r:e||(n=(o,r)=>o>r&&-1||o<r&&1||o===r&&0),t.concat().sort(n)}function Ye(t,e){let n=e.filter(o=>Dt(o));return n.length?O(n[0])?n=Math[t](...n):n[0]instanceof Date&&(n=qt(n,t==="min")[0]):n=void 0,n}const Ut=(t,e,n=1)=>{const o=[],r=Math.max(0,Math.ceil((e-t)/n))|0;for(let s=t;s<r;s++)o.push(t+s*n);return o},Ve={mouse:(()=>{const t=()=>({bubbles:!1,cancelable:!1,screenX:0,screenY:0,clientX:0,clientY:0});try{return new MouseEvent("t"),(e,n,o=t())=>{e.dispatchEvent(new MouseEvent(n,o))}}catch(e){return(n,o,r=t())=>{const s=Tt.createEvent("MouseEvent");s.initMouseEvent(o,r.bubbles,r.cancelable,v,0,r.screenX,r.screenY,r.clientX,r.clientY,!1,!1,!1,!1,0,null),n.dispatchEvent(s)}}})(),touch:(t,e,n)=>{const o=new Touch(T({identifier:Date.now(),target:t,radiusX:2.5,radiusY:2.5,rotationAngle:10,force:.5},n));t.dispatchEvent(new TouchEvent(e,{cancelable:!0,bubbles:!0,shiftKey:!0,touches:[o],targetTouches:[],changedTouches:[o]}))}};function Ge(t,e){let n=t;for(const o in e)n=n.replace(new RegExp(`{=${o}}`,"g"),e[o]);return n}function Xt(t){var e;let n;if(t instanceof Date)n=t;else if(x(t)){const{config:o,format:r}=this;n=(e=r.dataTime(o.data_xFormat)(t))!=null?e:new Date(t)}else O(t)&&!isNaN(t)&&(n=new Date(+t));return(!n||isNaN(+n))&&console&&console.error&&console.error(`Failed to parse x '${t}' to Date object`),n}function ke(t){const e=t.attr("viewBox");return e?/(\d+(\.\d+)?){3}/.test(e):!1}function ze(t,e,n=!1){const o=!!t.node;let r=!1;for(const[s,a]of Object.entries(e))if(r=o?t.style(s)===a:t.style[s]===a,n===!1&&r)break;return r}function He(){var t,e;return((t=document)==null?void 0:t.hidden)===!1||((e=document)==null?void 0:e.visibilityState)==="visible"}function Ke(t,e){const{DocumentTouch:n,matchMedia:o,navigator:r}=window,s=o==null?void 0:o("(pointer:coarse)").matches;let a=!1;if(e)if(r&&"maxTouchPoints"in r)a=r.maxTouchPoints>0;else if("ontouchmove"in window||n&&document instanceof n)a=!0;else if(s)a=!0;else{const d=r.userAgent;a=/\b(BlackBerry|webOS|iPhone|IEMobile)\b/i.test(d)||/\b(Android|Windows Phone|iPad|iPod)\b/i.test(d)}return t&&!s&&(o==null?void 0:o("(pointer:fine)").matches)&&"mouse"||a&&"touch"||"mouse"}function Yt(t,e){e()===!1?requestAnimationFrame(()=>Yt(t,e)):t()}function Vt(t){const e=this.config;let n,o,r;const s=()=>{const a=o.shift();if(a&&n&&P(n)&&a in n)return n=n[a],s();if(!a)return n};Object.keys(e).forEach(a=>{n=t,o=a.split("_"),r=s(),U(r)&&(e[a]=r)}),this.api&&(this.state.orgConfig=t)}var Gt=Object.defineProperty,kt=(t,e,n)=>e in t?Gt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,A=(t,e,n)=>kt(t,typeof e!="symbol"?e+"":e,n);class k{constructor(e={}){A(this,"$$"),A(this,"options"),this.options=e}$beforeInit(){}$init(){}$afterInit(){}$redraw(){}$willDestroy(){Object.keys(this).forEach(e=>{this[e]=null,delete this[e]})}}A(k,"version","3.16.0");var zt=h(996),Ht=h(390),p={colorScale:"bb-colorscale",stanfordElements:"bb-stanford-elements",stanfordLine:"bb-stanford-line",stanfordLines:"bb-stanford-lines",stanfordRegion:"bb-stanford-region",stanfordRegions:"bb-stanford-regions"},Kt=Object.defineProperty,Wt=(t,e,n)=>e in t?Kt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,z=(t,e,n)=>Wt(t,typeof e!="symbol"?e+"":e,n);class Zt{constructor(e){z(this,"owner"),z(this,"colorScale"),this.owner=e}drawColorScale(){const{$$:e,config:n}=this.owner,o=e.data.targets[0],r=e.state.height-n.padding_bottom-n.padding_top,s=n.scale_width,a=5,i=Ut(n.padding_bottom,r,a),d=(0,E.scaleSequential)(o.colors).domain([i[i.length-1],i[0]]);this.colorScale&&this.colorScale.remove(),this.colorScale=e.$el.svg.append("g").attr("width",50).attr("height",r).attr("class",p.colorScale),this.colorScale.append("g").attr("transform",`translate(0, ${n.padding_top})`).selectAll("bars").data(i).enter().append("rect").attr("y",(m,ce)=>ce*a).attr("x",0).attr("width",s).attr("height",a).attr("fill",m=>d(m));const b=(0,E.scaleSymlog)().domain([o.minEpochs,o.maxEpochs]).range([i[0]+n.padding_top+i[i.length-1]+a-1,i[0]+n.padding_top]),c=(0,zt.axisRight)(b),l=n.scale_format;l==="pow10"?c.tickValues([1,10,100,1e3,1e4,1e5,1e6,1e7]):C(l)?c.tickFormat(l):c.tickFormat((0,Ht.format)("d"));const g=this.colorScale.append("g").attr("class","legend axis").attr("transform",`translate(${s},0)`).call(c);l==="pow10"&&g.selectAll(".tick text").text(null).filter(m=>m/Math.pow(10,Math.ceil(Math.log(m)/Math.LN10-1e-12))===1).text(10).append("tspan").attr("dy","-.7em").text(m=>Math.round(Math.log(m)/Math.LN10)),this.colorScale.attr("transform",`translate(${e.state.current.width-this.xForColorScale()}, 0)`)}xForColorScale(){return this.owner.config.padding_right+this.colorScale.node().getBBox().width}getColorScalePadding(){return this.xForColorScale()+this.owner.config.padding_left+20}}function Jt(t,e){const n=t.x,o=t.value;let r=!1;for(let s=0,a=e.length-1;s<e.length;a=s++){const i=e[s].x,d=e[s].y,b=e[a].x,c=e[a].y;d>o!=c>o&&n<(b-i)*(o-d)/(c-d)+i&&(r=!r)}return r}function Qt(t,e){return t.epochs<e.epochs?-1:t.epochs>e.epochs?1:0}function te(t){let e=0,n,o;for(let r=0,s=t.length,a=s-1;r<s;a=r,r++)n=t[r],o=t[a],e+=n.x*o.y,e-=n.y*o.x;return e/=2,e}function w(t){const e=te(t);let n=0,o=0,r;for(let s=0,a=t.length,i=a-1;s<a;i=s,s++){const d=t[s],b=t[i];r=d.x*b.y-b.x*d.y,n+=(d.x+b.x)*r,o+=(d.y+b.y)*r}return r=e*6,{x:n/r,y:o/r}}var ee=Object.defineProperty,ne=(t,e,n)=>e in t?ee(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,oe=(t,e,n)=>ne(t,typeof e!="symbol"?e+"":e,n);class re{constructor(e){oe(this,"owner"),this.owner=e;const n=e.$$.$el.main.select(".bb-chart").append("g").attr("class",p.stanfordElements);n.append("g").attr("class",p.stanfordLines),n.append("g").attr("class",p.stanfordRegions)}updateStanfordLines(e){const{$$:n}=this.owner,{config:o,$el:{main:r}}=n,s=o.axis_rotated,a=this.xvCustom.bind(n),i=this.yvCustom.bind(n),d=r.select(`.${p.stanfordLines}`).style("shape-rendering","geometricprecision").selectAll(`.${p.stanfordLine}`).data(this.owner.config.lines);d.exit().transition().duration(e).style("opacity","0").remove();const b=d.enter().append("g");b.append("line").style("opacity","0"),b.merge(d).attr("class",c=>p.stanfordLine+(c.class?` ${c.class}`:"")).select("line").transition().duration(e).attr("x1",c=>s?i(c,"y1"):a(c,"x1")).attr("x2",c=>s?i(c,"y2"):a(c,"x2")).attr("y1",c=>s?a(c,"x1"):i(c,"y1")).attr("y2",c=>s?a(c,"x2"):i(c,"y2")).transition().style("opacity",null)}updateStanfordRegions(e){const{$$:n}=this.owner,{config:o,$el:{main:r}}=n,s=o.axis_rotated,a=this.xvCustom.bind(n),i=this.yvCustom.bind(n),d=this.owner.countEpochsInRegion.bind(n);let b=r.select(`.${p.stanfordRegions}`).selectAll(`.${p.stanfordRegion}`).data(this.owner.config.regions);b.exit().transition().duration(e).style("opacity","0").remove();const c=b.enter().append("g");c.append("polygon").style("opacity","0"),c.append("text").attr("transform",s?"rotate(-90)":"").style("opacity","0"),b=c.merge(b),b.attr("class",l=>p.stanfordRegion+(l.class?` ${l.class}`:"")).select("polygon").transition().duration(e).attr("points",l=>l.points.map(g=>[s?i(g,"y"):a(g,"x"),s?a(g,"x"):i(g,"y")].join(",")).join(" ")).transition().style("opacity",l=>String(l.opacity?l.opacity:.2)),b.select("text").transition().duration(e).attr("x",l=>s?i(w(l.points),"y"):a(w(l.points),"x")).attr("y",l=>s?a(w(l.points),"x"):i(w(l.points),"y")).text(l=>{if(l.text){const{value:g,percentage:m}=d(l.points);return l.text(g,m)}return""}).attr("text-anchor","middle").attr("dominant-baseline","middle").transition().style("opacity",null)}updateStanfordElements(e=0){this.updateStanfordLines(e),this.updateStanfordRegions(e)}xvCustom(e,n){const o=this,{axis:r,config:s}=o;let a=n?e[n]:o.getBaseValue(e);return r.isTimeSeries()?a=Xt.call(o,a):r.isCategorized()&&x(a)&&(a=s.axis_x_categories.indexOf(e.value)),o.scale.x(a)}yvCustom(e,n){const o=this,r=e.axis&&e.axis==="y2"?o.scale.y2:o.scale.y,s=n?e[n]:o.getBaseValue(e);return r(s)}}class H{constructor(){return{colors:void 0,epochs:[],lines:[],scale_min:void 0,scale_max:void 0,scale_width:20,scale_format:void 0,padding_top:0,padding_right:0,padding_bottom:0,padding_left:0,regions:[]}}}var se=Object.defineProperty,ae=(t,e,n)=>e in t?se(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,L=(t,e,n)=>ae(t,typeof e!="symbol"?e+"":e,n);class ie extends k{constructor(e){return super(e),L(this,"config"),L(this,"colorScale"),L(this,"elements"),this.config=new H,this}$beforeInit(){const{$$:e}=this;e.config.data_xSort=!1,e.isMultipleX=()=>!0,e.showGridFocus=()=>{},e.labelishData=o=>o.values,e.opacityForCircle=()=>1;const n=e.getCurrentPadding.bind(e);e.getCurrentPadding=()=>{const o=n();return o.right+=this.colorScale?this.colorScale.getColorScalePadding():0,o}}$init(){const{$$:e}=this;Vt.call(this,this.options),e.color=this.getStanfordPointColor.bind(e),this.colorScale=new Zt(this),this.elements=new re(this),this.convertData(),this.initStanfordData(),this.setStanfordTooltip(),this.colorScale.drawColorScale(),e.right+=this.colorScale?this.colorScale.getColorScalePadding():0,this.$redraw()}$redraw(e){var n,o;(n=this.colorScale)==null||n.drawColorScale(),(o=this.elements)==null||o.updateStanfordElements(e)}getOptions(){return new H}convertData(){const e=this.$$.data.targets,n=this.options.epochs;e.forEach(o=>{o.values.forEach((r,s)=>{r.epochs=n[s]}),o.minEpochs=void 0,o.maxEpochs=void 0,o.colors=void 0,o.colorscale=void 0})}initStanfordData(){const{config:e}=this,n=this.$$.data.targets[0];n.values.sort(Qt);const o=n.values.map(r=>r.epochs);n.minEpochs=isNaN(e.scale_min)?Math.min(...o):e.scale_min,n.maxEpochs=isNaN(e.scale_max)?Math.max(...o):e.scale_max,n.colors=C(e.colors)?e.colors:(0,tt.interpolateHslLong)((0,D.hsl)(250,1,.5),(0,D.hsl)(0,1,.5)),n.colorscale=(0,E.scaleSequentialLog)(n.colors).domain([n.minEpochs,n.maxEpochs])}getStanfordPointColor(e){return this.data.targets[0].colorscale(e.epochs)}setStanfordTooltip(){const{config:e}=this.$$;X(e.tooltip_contents)&&(e.tooltip_contents=function(n,o,r,s){const{data_x:a}=e;let i=`<table class="${S.tooltip}"><tbody>`;return n.forEach(d=>{const{id:b="",value:c=0,epochs:l=0,x:g=""}=d;i+=`<tr>
14
14
  <th>${a||""}</th>
15
15
  <th class="value">${o(g)}</th>
16
16
  </tr>
@@ -21,4 +21,4 @@
21
21
  <tr class="${S.tooltipName}-${b}">
22
22
  <td class="name"><span style="background-color:${s(d)}"></span>Epochs</td>
23
23
  <td class="value">${r(l)}</td>
24
- </tr>`}),`${i}</tbody></table>`})}countEpochsInRegion(t){const o=this.data.targets[0],r=o.values.reduce((a,i)=>a+Number(i.epochs),0),s=o.values.reduce((a,i)=>We(i,t)?a+Number(i.epochs):a,0);return{value:s,percentage:s!==0?+(s/r*100).toFixed(1):0}}}return y=y.default,y}()});
24
+ </tr>`}),`${i}</tbody></table>`})}countEpochsInRegion(e){const o=this.data.targets[0],r=o.values.reduce((a,i)=>a+Number(i.epochs),0),s=o.values.reduce((a,i)=>Jt(i,e)?a+Number(i.epochs):a,0);return{value:s,percentage:s!==0?+(s/r*100).toFixed(1):0}}}return y=y.default,y}()});
@@ -5,7 +5,7 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.16.0-next.1
8
+ * @version 3.16.0
9
9
  * @requires billboard.js
10
10
  * @summary billboard.js plugin
11
11
  */
@@ -216,7 +216,7 @@ function getRectSegList(path) {
216
216
  ];
217
217
  }
218
218
  function getPathBox(path) {
219
- const { width, height } = path.getBoundingClientRect();
219
+ const { width, height } = getBoundingRect(path);
220
220
  const items = getRectSegList(path);
221
221
  const x = items[0].x;
222
222
  const y = Math.min(items[0].y, items[1].y);
@@ -248,9 +248,20 @@ function getBrushSelection(ctx) {
248
248
  }
249
249
  return selection;
250
250
  }
251
- function getBoundingRect(node) {
252
- const needEvaluate = !("rect" in node) || "rect" in node && node.hasAttribute("width") && node.rect.width !== +node.getAttribute("width");
253
- return needEvaluate ? node.rect = node.getBoundingClientRect() : node.rect;
251
+ function getRect(relativeViewport, node, forceEval = false) {
252
+ const _ = (n) => n[relativeViewport ? "getBoundingClientRect" : "getBBox"]();
253
+ if (forceEval) {
254
+ return _(node);
255
+ } else {
256
+ const needEvaluate = !("rect" in node) || "rect" in node && node.hasAttribute("width") && node.rect.width !== +(node.getAttribute("width") || 0);
257
+ return needEvaluate ? node.rect = _(node) : node.rect;
258
+ }
259
+ }
260
+ function getBoundingRect(node, forceEval = false) {
261
+ return getRect(true, node, forceEval);
262
+ }
263
+ function getBBox(node, forceEval = false) {
264
+ return getRect(false, node, forceEval);
254
265
  }
255
266
  function getRandom(asStr = true, min = 0, max = 1e4) {
256
267
  const crpt = win.crypto || win.msCrypto;
@@ -346,7 +357,7 @@ function getTransformCTM(node, x = 0, y = 0, inverse = true) {
346
357
  inverse ? screen == null ? void 0 : screen.inverse() : screen
347
358
  );
348
359
  if (inverse === false) {
349
- const rect = node.getBoundingClientRect();
360
+ const rect = getBoundingRect(node);
350
361
  res.x -= rect.x;
351
362
  res.y -= rect.y;
352
363
  }
@@ -629,7 +640,7 @@ class Plugin {
629
640
  });
630
641
  }
631
642
  }
632
- __publicField(Plugin, "version", "3.16.0-next.1");
643
+ __publicField(Plugin, "version", "3.16.0");
633
644
 
634
645
  ;// ./src/Plugin/tableview/const.ts
635
646
 
@@ -5,12 +5,12 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.16.0-next.1
8
+ * @version 3.16.0
9
9
  * @requires billboard.js
10
10
  * @summary billboard.js plugin
11
- */(function(c,u){typeof exports=="object"&&typeof module=="object"?module.exports=u(require("d3-brush"),require("d3-selection")):typeof define=="function"&&define.amd?define("bb",["d3-brush","d3-selection"],u):typeof exports=="object"?exports.bb=u(require("d3-brush"),require("d3-selection")):(c.bb=c.bb||{},c.bb.plugin=c.bb.plugin||{},c.bb.plugin.tableview=u(c.d3,c.d3))})(this,function(j,c){return function(){"use strict";var u={747:function(e){e.exports=c},853:function(e){e.exports=j}},C={};function a(e){var t=C[e];if(t!==void 0)return t.exports;var n=C[e]={exports:{}};return u[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 fe}});var be=a(853),he=a(747);function R(){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 q(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 g=R(),V=g==null?void 0:g.document,[pe,me,ge,_e]=q(g);var L=Object.defineProperty,S=Object.getOwnPropertySymbols,U=Object.prototype.hasOwnProperty,z=Object.prototype.propertyIsEnumerable,M=(e,t,n)=>t in e?L(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,D=(e,t)=>{for(var n in t||(t={}))U.call(t,n)&&M(e,n,t[n]);if(S)for(var n of S(t))z.call(t,n)&&M(e,n,t[n]);return e};const ye=e=>e||e===0,X=e=>typeof e=="function",_=e=>typeof e=="string",y=e=>typeof e=="number",Y=e=>typeof e=="undefined",A=e=>typeof e!="undefined",ve=e=>typeof e=="boolean",we=e=>Math.ceil(e/10)*10,xe=e=>Math.ceil(e)+.5,Oe=e=>e[1]-e[0],O=e=>typeof e=="object",H=e=>Y(e)||e===null||_(e)&&e.length===0||O(e)&&!(e instanceof Date)&&Object.keys(e).length===0||y(e)&&isNaN(e),k=e=>!H(e),E=e=>Array.isArray(e),v=e=>e&&!(e!=null&&e.nodeType)&&O(e)&&!E(e);function Ee(e,t,n){return A(e[t])?e[t]:n}function Pe(e,t){let n=!1;return Object.keys(e).forEach(o=>e[o]===t&&(n=!0)),n}function Te(e,t,...n){const o=X(e);return o&&e.call(t,...n),o}function $e(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 je(e){return _(e)?e.replace(/<(script|img)?/ig,"&lt;").replace(/(script)?>/ig,"&gt;"):e}function Ce(e,t,n=[-1,1],o=!1){if(!(!e||!_(t)))if(t.indexOf(`
11
+ */(function(c,u){typeof exports=="object"&&typeof module=="object"?module.exports=u(require("d3-brush"),require("d3-selection")):typeof define=="function"&&define.amd?define("bb",["d3-brush","d3-selection"],u):typeof exports=="object"?exports.bb=u(require("d3-brush"),require("d3-selection")):(c.bb=c.bb||{},c.bb.plugin=c.bb.plugin||{},c.bb.plugin.tableview=u(c.d3,c.d3))})(this,function(j,c){return function(){"use strict";var u={747:function(e){e.exports=c},853:function(e){e.exports=j}},C={};function a(e){var t=C[e];if(t!==void 0)return t.exports;var n=C[e]={exports:{}};return u[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 be}});var pe=a(853),me=a(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=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 g=V(),U=g==null?void 0:g.document,[ge,_e,ye,ve]=L(g);var z=Object.defineProperty,S=Object.getOwnPropertySymbols,X=Object.prototype.hasOwnProperty,Y=Object.prototype.propertyIsEnumerable,M=(e,t,n)=>t in e?z(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,D=(e,t)=>{for(var n in t||(t={}))X.call(t,n)&&M(e,n,t[n]);if(S)for(var n of S(t))Y.call(t,n)&&M(e,n,t[n]);return e};const we=e=>e||e===0,H=e=>typeof e=="function",_=e=>typeof e=="string",y=e=>typeof e=="number",k=e=>typeof e=="undefined",B=e=>typeof e!="undefined",xe=e=>typeof e=="boolean",Oe=e=>Math.ceil(e/10)*10,Ee=e=>Math.ceil(e)+.5,Pe=e=>e[1]-e[0],O=e=>typeof e=="object",G=e=>k(e)||e===null||_(e)&&e.length===0||O(e)&&!(e instanceof Date)&&Object.keys(e).length===0||y(e)&&isNaN(e),K=e=>!G(e),E=e=>Array.isArray(e),v=e=>e&&!(e!=null&&e.nodeType)&&O(e)&&!E(e);function Te(e,t,n){return B(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 Se(e){return _(e)?e.replace(/<(script|img)?/ig,"&lt;").replace(/(script)?>/ig,"&gt;"):e}function Me(e,t,n=[-1,1],o=!1){if(!(!e||!_(t)))if(t.indexOf(`
12
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((l,d)=>{e.append("tspan").attr("x",0).attr("dy",`${d===0?n[0]*s:n[1]}em`).text(l)})}}}function G(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 Se(e){const{width:t,height:n}=e.getBoundingClientRect(),o=G(e),r=o[0].x,i=Math.min(o[0].y,o[1].y);return{x:r,y:i,width:t,height:n}}function Me(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 K(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 De(e){return!("rect"in e)||"rect"in e&&e.hasAttribute("width")&&e.rect.width!==+e.getAttribute("width")?e.rect=e.getBoundingClientRect():e.rect}function Ae(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 N(e,t,n,o,r){if(n>o)return-1;const i=Math.floor((n+o)/2);let{x:s,w:l=0}=e[i];return r&&(s=e[i].y,l=e[i].h),t>=s&&t<=s+l?i:t<s?N(e,t,n,i-1,r):N(e,t,i+1,o,r)}function Ne(e){const t=K(e);return t?t[0]===t[1]:!0}function Be(...e){const t=n=>{if(v(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)=>D(D({},n),o))}function W(e={},t){E(t)&&t.forEach(n=>W(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 Fe(e,t="-"){return e.split(t).map((n,o)=>o?n.charAt(0).toUpperCase()+n.slice(1).toLowerCase():n.toLowerCase()).join("")}const J=e=>[].slice.call(e);function Re(e,t,n){const{rootSelector:o="",sheet:r}=e,s=`${o} ${(l=>l.replace(/\s?(bb-)/g,".$1").replace(/\.+/g,"."))(t)} {${n.join(";")}}`;return r[r.insertRule?"insertRule":"addRule"](s,r.cssRules.length)}function qe(e){let t=[];return e.forEach(n=>{var o;try{n.cssRules&&n.cssRules.length&&(t=t.concat(J(n.cssRules)))}catch(r){(o=window.console)==null||o.warn(`Error while reading rules from ${n.href}: ${r.toString()}`)}}),t}function Ve(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 Le(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 l=e.getBoundingClientRect();s.x-=l.x,s.y-=l.y}return s}function Ue(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 ze(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 Xe(e){return e&&e.length?e.reduce((t,n)=>t.concat(n)):[]}function P(e,...t){if(!t.length||t.length===1&&!t[0])return e;const n=t.shift();return v(e)&&v(n)&&Object.keys(n).forEach(o=>{if(!/^(__proto__|constructor|prototype)$/i.test(o)){const r=n[o];v(r)?(!e[o]&&(e[o]={}),e[o]=P(e[o],r)):e[o]=E(r)?r.concat():r}}),P(e,...t)}function Q(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 Ye(e,t){let n=t.filter(o=>k(o));return n.length?y(n[0])?n=Math[e](...n):n[0]instanceof Date&&(n=Q(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,g,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(P({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 w(e,t){let n=e;for(const o in t)n=n.replace(new RegExp(`{=${o}}`,"g"),t[o]);return n}function Ge(e){var t;let n;if(e instanceof Date)n=e;else if(_(e)){const{config:o,format:r}=this;n=(t=r.dataTime(o.data_xFormat)(e))!=null?t:new Date(e)}else y(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 Ke(e){const t=e.attr("viewBox");return t?/(\d+(\.\d+)?){3}/.test(t):!1}function We(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 Je(){var e,t;return((e=document)==null?void 0:e.hidden)===!1||((t=document)==null?void 0:t.visibilityState)==="visible"}function Qe(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 d=r.userAgent;s=/\b(BlackBerry|webOS|iPhone|IEMobile)\b/i.test(d)||/\b(Android|Windows Phone|iPad|iPod)\b/i.test(d)}return e&&!i&&(o==null?void 0:o("(pointer:fine)").matches)&&"mouse"||s&&"touch"||"mouse"}function Z(e,t){t()===!1?requestAnimationFrame(()=>Z(e,t)):e()}function ee(e){const t=this.config;let n,o,r;const i=()=>{const s=o.shift();if(s&&n&&O(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(),A(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,T=(e,t,n)=>ne(e,typeof t!="symbol"?t+"":t,n);class B{constructor(t={}){T(this,"$$"),T(this,"options"),this.options=t}$beforeInit(){}$init(){}$afterInit(){}$redraw(){}$willDestroy(){Object.keys(this).forEach(t=>{this[t]=null,delete this[t]})}}T(B,"version","3.16.0-next.1");const f={id:"__tableview-style__",class:"bb-tableview",rule:`.bb-tableview {
13
+ `),s=o?i.length-1:1;e.html(""),i.forEach((l,d)=>{e.append("tspan").attr("x",0).attr("dy",`${d===0?n[0]*s:n[1]}em`).text(l)})}}}function W(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}=N(e),o=W(e),r=o[0].x,i=Math.min(o[0].y,o[1].y);return{x:r,y:i,width:t,height:n}}function Be(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 J(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 A(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 N(e,t=!1){return A(!0,e,t)}function Ae(e,t=!1){return A(!1,e,t)}function Ne(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 I(e,t,n,o,r){if(n>o)return-1;const i=Math.floor((n+o)/2);let{x:s,w:l=0}=e[i];return r&&(s=e[i].y,l=e[i].h),t>=s&&t<=s+l?i:t<s?I(e,t,n,i-1,r):I(e,t,i+1,o,r)}function Ie(e){const t=J(e);return t?t[0]===t[1]:!0}function Fe(...e){const t=n=>{if(v(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)=>D(D({},n),o))}function Q(e={},t){E(t)&&t.forEach(n=>Q(e,n));for(const n in t)/^\d+$/.test(n)||n in e||(e[n]=t[n]);return e}const Re=e=>e.charAt(0).toUpperCase()+e.slice(1);function qe(e,t="-"){return e.split(t).map((n,o)=>o?n.charAt(0).toUpperCase()+n.slice(1).toLowerCase():n.toLowerCase()).join("")}const Z=e=>[].slice.call(e);function Ve(e,t,n){const{rootSelector:o="",sheet:r}=e,s=`${o} ${(l=>l.replace(/\s?(bb-)/g,".$1").replace(/\.+/g,"."))(t)} {${n.join(";")}}`;return r[r.insertRule?"insertRule":"addRule"](s,r.cssRules.length)}function Le(e){let t=[];return e.forEach(n=>{var o;try{n.cssRules&&n.cssRules.length&&(t=t.concat(Z(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 ze(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 l=N(e);s.x-=l.x,s.y-=l.y}return s}function Xe(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 Ye(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 He(e){return e&&e.length?e.reduce((t,n)=>t.concat(n)):[]}function P(e,...t){if(!t.length||t.length===1&&!t[0])return e;const n=t.shift();return v(e)&&v(n)&&Object.keys(n).forEach(o=>{if(!/^(__proto__|constructor|prototype)$/i.test(o)){const r=n[o];v(r)?(!e[o]&&(e[o]={}),e[o]=P(e[o],r)):e[o]=E(r)?r.concat():r}}),P(e,...t)}function ee(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=>K(o));return n.length?y(n[0])?n=Math[e](...n):n[0]instanceof Date&&(n=ee(n,e==="min")[0]):n=void 0,n}const Ge=(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=U.createEvent("MouseEvent");i.initMouseEvent(o,r.bubbles,r.cancelable,g,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(P({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 w(e,t){let n=e;for(const o in t)n=n.replace(new RegExp(`{=${o}}`,"g"),t[o]);return n}function We(e){var t;let n;if(e instanceof Date)n=e;else if(_(e)){const{config:o,format:r}=this;n=(t=r.dataTime(o.data_xFormat)(e))!=null?t:new Date(e)}else y(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 Je(e){const t=e.attr("viewBox");return t?/(\d+(\.\d+)?){3}/.test(t):!1}function Qe(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 Ze(){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 d=r.userAgent;s=/\b(BlackBerry|webOS|iPhone|IEMobile)\b/i.test(d)||/\b(Android|Windows Phone|iPad|iPod)\b/i.test(d)}return e&&!i&&(o==null?void 0:o("(pointer:fine)").matches)&&"mouse"||s&&"touch"||"mouse"}function te(e,t){t()===!1?requestAnimationFrame(()=>te(e,t)):e()}function ne(e){const t=this.config;let n,o,r;const i=()=>{const s=o.shift();if(s&&n&&O(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(),B(r)&&(t[s]=r)}),this.api&&(this.state.orgConfig=e)}var oe=Object.defineProperty,re=(e,t,n)=>t in e?oe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,T=(e,t,n)=>re(e,typeof t!="symbol"?t+"":t,n);class F{constructor(t={}){T(this,"$$"),T(this,"options"),this.options=t}$beforeInit(){}$init(){}$afterInit(){}$redraw(){}$willDestroy(){Object.keys(this).forEach(t=>{this[t]=null,delete this[t]})}}T(F,"version","3.16.0");const f={id:"__tableview-style__",class:"bb-tableview",rule:`.bb-tableview {
14
14
  border-collapse:collapse;
15
15
  border-spacing:0;
16
16
  background:#fff;
@@ -36,4 +36,4 @@
36
36
  margin-bottom: -1px;
37
37
  }`},p={body:`<caption>{=title}</caption>
38
38
  <thead><tr>{=thead}</tr></thead>
39
- <tbody>{=tbody}</tbody>`,thead:'<th scope="col">{=title}</th>',tbodyHeader:'<th scope="row">{=value}</th>',tbody:"<td>{=value}</td>"};class oe{constructor(){return{selector:void 0,categoryTitle:"Category",categoryFormat:function(t){let n=t;return this.$$.axis.isCategorized()?n=this.$$.categoryName(t):this.$$.axis.isTimeSeries()&&(n=t.toLocaleDateString()),n},class:void 0,style:!0,title:void 0,updateOnToggle:!0,nullString:"-"}}}var re=Object.defineProperty,ie=Object.defineProperties,se=Object.getOwnPropertyDescriptors,I=Object.getOwnPropertySymbols,le=Object.prototype.hasOwnProperty,ce=Object.prototype.propertyIsEnumerable,$=(e,t,n)=>t in e?re(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ae=(e,t)=>{for(var n in t||(t={}))le.call(t,n)&&$(e,n,t[n]);if(I)for(var n of I(t))ce.call(t,n)&&$(e,n,t[n]);return e},ue=(e,t)=>ie(e,se(t)),F=(e,t,n)=>$(e,typeof t!="symbol"?t+"":t,n);class fe extends B{constructor(t){return super(t),F(this,"config"),F(this,"element"),this.config=new oe,this}$beforeInit(){ee.call(this,this.options)}$init(){const{class:t,selector:n,style:o}=this.config;let r=document.querySelector(n||`.${t||f.class}`);if(!r){const i=this.$$.$el.chart.node();r=document.createElement("table"),i.parentNode.insertBefore(r,i.nextSibling)}if(r.tagName!=="TABLE"){const i=document.createElement("table");r.appendChild(i),r=i}if(o&&!document.getElementById(f.id)){const i=document.createElement("style");i.id=f.id,i.innerHTML=f.rule,(document.head||document.getElementsByTagName("head")[0]).appendChild(i)}r.classList.add(...[o&&f.class,t].filter(Boolean)),this.element=r}generateTable(){const{$$:t,config:n,element:o}=this,r=t.filterTargetsToShow(t.data.targets);let i=w(p.thead,{title:r.length?this.config.categoryTitle:""}),s="";const l=[];r.forEach(x=>{i+=w(p.thead,{title:x.id}),x.values.forEach((b,h)=>{l[h]||(l[h]=[b.x]),l[h].push(b.value)})}),l.forEach(x=>{s+=`<tr>${x.map((b,h)=>w(h?p.tbody:p.tbodyHeader,{value:h===0?n.categoryFormat.bind(this)(b):y(b)?b.toLocaleString():n.nullString})).join("")}</tr>`});const d=/(<\/?(script|img)[^>]*>|<[^>]+><\/[^>]+>)/ig,de=w(p.body,ue(ae({},n),{title:n.title||t.config.title_text||"",thead:i,tbody:s})).replace(d,"");o.innerHTML=de}$redraw(){const{state:t}=this.$$;!(t.resizing||!this.config.updateOnToggle&&t.toggling)&&this.generateTable()}$willDestroy(){var t,n;if((t=this.element.parentNode)==null||t.removeChild(this.element),this.$$.charts.length===1){const o=document.getElementById(f.id);(n=o==null?void 0:o.parentNode)==null||n.removeChild(o)}}}return m=m.default,m}()});
39
+ <tbody>{=tbody}</tbody>`,thead:'<th scope="col">{=title}</th>',tbodyHeader:'<th scope="row">{=value}</th>',tbody:"<td>{=value}</td>"};class ie{constructor(){return{selector:void 0,categoryTitle:"Category",categoryFormat:function(t){let n=t;return this.$$.axis.isCategorized()?n=this.$$.categoryName(t):this.$$.axis.isTimeSeries()&&(n=t.toLocaleDateString()),n},class:void 0,style:!0,title:void 0,updateOnToggle:!0,nullString:"-"}}}var se=Object.defineProperty,le=Object.defineProperties,ce=Object.getOwnPropertyDescriptors,R=Object.getOwnPropertySymbols,ae=Object.prototype.hasOwnProperty,ue=Object.prototype.propertyIsEnumerable,$=(e,t,n)=>t in e?se(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,fe=(e,t)=>{for(var n in t||(t={}))ae.call(t,n)&&$(e,n,t[n]);if(R)for(var n of R(t))ue.call(t,n)&&$(e,n,t[n]);return e},de=(e,t)=>le(e,ce(t)),q=(e,t,n)=>$(e,typeof t!="symbol"?t+"":t,n);class be extends F{constructor(t){return super(t),q(this,"config"),q(this,"element"),this.config=new ie,this}$beforeInit(){ne.call(this,this.options)}$init(){const{class:t,selector:n,style:o}=this.config;let r=document.querySelector(n||`.${t||f.class}`);if(!r){const i=this.$$.$el.chart.node();r=document.createElement("table"),i.parentNode.insertBefore(r,i.nextSibling)}if(r.tagName!=="TABLE"){const i=document.createElement("table");r.appendChild(i),r=i}if(o&&!document.getElementById(f.id)){const i=document.createElement("style");i.id=f.id,i.innerHTML=f.rule,(document.head||document.getElementsByTagName("head")[0]).appendChild(i)}r.classList.add(...[o&&f.class,t].filter(Boolean)),this.element=r}generateTable(){const{$$:t,config:n,element:o}=this,r=t.filterTargetsToShow(t.data.targets);let i=w(p.thead,{title:r.length?this.config.categoryTitle:""}),s="";const l=[];r.forEach(x=>{i+=w(p.thead,{title:x.id}),x.values.forEach((b,h)=>{l[h]||(l[h]=[b.x]),l[h].push(b.value)})}),l.forEach(x=>{s+=`<tr>${x.map((b,h)=>w(h?p.tbody:p.tbodyHeader,{value:h===0?n.categoryFormat.bind(this)(b):y(b)?b.toLocaleString():n.nullString})).join("")}</tr>`});const d=/(<\/?(script|img)[^>]*>|<[^>]+><\/[^>]+>)/ig,he=w(p.body,de(fe({},n),{title:n.title||t.config.title_text||"",thead:i,tbody:s})).replace(d,"");o.innerHTML=he}$redraw(){const{state:t}=this.$$;!(t.resizing||!this.config.updateOnToggle&&t.toggling)&&this.generateTable()}$willDestroy(){var t,n;if((t=this.element.parentNode)==null||t.removeChild(this.element),this.$$.charts.length===1){const o=document.getElementById(f.id);(n=o==null?void 0:o.parentNode)==null||n.removeChild(o)}}}return m=m.default,m}()});