billboard.js 3.17.1 → 3.17.3

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 (50) hide show
  1. package/dist/billboard.css +1 -1
  2. package/dist/billboard.js +33 -20
  3. package/dist/billboard.min.css +1 -1
  4. package/dist/billboard.min.js +12 -12
  5. package/dist/billboard.pkgd.js +2135 -1615
  6. package/dist/billboard.pkgd.min.js +21 -19
  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 -5
  10. package/dist/plugin/billboardjs-plugin-sparkline.min.js +4 -4
  11. package/dist/plugin/billboardjs-plugin-stanford.js +23 -5
  12. package/dist/plugin/billboardjs-plugin-stanford.min.js +4 -4
  13. package/dist/plugin/billboardjs-plugin-tableview.js +25 -9
  14. package/dist/plugin/billboardjs-plugin-tableview.min.js +4 -4
  15. package/dist/plugin/billboardjs-plugin-textoverlap.js +23 -5
  16. package/dist/plugin/billboardjs-plugin-textoverlap.min.js +4 -4
  17. package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.js +2168 -1661
  18. package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.min.js +8 -6
  19. package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.js +2170 -1645
  20. package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.min.js +10 -8
  21. package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.js +2171 -1646
  22. package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.min.js +12 -10
  23. package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.js +2174 -1651
  24. package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.min.js +11 -9
  25. package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.js +2173 -1648
  26. package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.min.js +10 -8
  27. package/dist/theme/dark.css +1 -1
  28. package/dist/theme/dark.min.css +1 -1
  29. package/dist/theme/datalab.css +1 -1
  30. package/dist/theme/datalab.min.css +1 -1
  31. package/dist/theme/graph.css +1 -1
  32. package/dist/theme/graph.min.css +1 -1
  33. package/dist/theme/insight.css +1 -1
  34. package/dist/theme/insight.min.css +1 -1
  35. package/dist/theme/modern.css +1 -1
  36. package/dist/theme/modern.min.css +1 -1
  37. package/dist-esm/billboard.js +35 -18
  38. package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +2 -2
  39. package/dist-esm/plugin/billboardjs-plugin-sparkline.js +2 -2
  40. package/dist-esm/plugin/billboardjs-plugin-stanford.js +9 -3
  41. package/dist-esm/plugin/billboardjs-plugin-tableview.js +27 -6
  42. package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +2 -2
  43. package/package.json +3 -3
  44. package/src/ChartInternal/data/convert.ts +10 -2
  45. package/src/ChartInternal/internals/color.ts +4 -6
  46. package/src/ChartInternal/internals/legend.ts +2 -1
  47. package/src/ChartInternal/internals/tooltip.ts +2 -2
  48. package/src/ChartInternal/shape/point.common.ts +4 -4
  49. package/src/Plugin/tableview/index.ts +2 -5
  50. package/src/module/util.ts +32 -7
@@ -5,7 +5,7 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.17.1
8
+ * @version 3.17.3
9
9
  * @requires billboard.js
10
10
  * @summary billboard.js plugin
11
11
  */
@@ -171,7 +171,13 @@ const ceil10 = (v) => Math.ceil(v / 10) * 10;
171
171
  const asHalfPixel = (n) => Math.ceil(n) + 0.5;
172
172
  const diffDomain = (d) => d[1] - d[0];
173
173
  const isObjectType = (v) => typeof v === "object";
174
- const isEmpty = (o) => isUndefined(o) || o === null || isString(o) && o.length === 0 || isObjectType(o) && !(o instanceof Date) && Object.keys(o).length === 0 || isNumber(o) && isNaN(o);
174
+ const isEmptyObject = (obj) => {
175
+ for (const x in obj) {
176
+ return false;
177
+ }
178
+ return true;
179
+ };
180
+ const isEmpty = (o) => isUndefined(o) || o === null || isString(o) && o.length === 0 || isObjectType(o) && !(o instanceof Date) && isEmptyObject(o) || isNumber(o) && isNaN(o);
175
181
  const notEmpty = (o) => !isEmpty(o);
176
182
  const isArray = (arr) => Array.isArray(arr);
177
183
  const isObject = (obj) => obj && !(obj == null ? void 0 : obj.nodeType) && isObjectType(obj) && !isArray(obj);
@@ -200,8 +206,20 @@ function endall(transition, cb) {
200
206
  transition.call(end);
201
207
  }
202
208
  }
209
+ const dangerousTags = "script|iframe|object|embed|form|input|button|textarea|select|style|link|meta|base|svg|math";
210
+ const sanitizeRx = {
211
+ tags: new RegExp(
212
+ `<(${dangerousTags})[\\s\\S]*?>[\\s\\S]*?<\\/\\1>|<(${dangerousTags})[^>]*\\/?>`,
213
+ "gi"
214
+ ),
215
+ eventHandlers: /\s*on\w+\s*=\s*["'][^"']*["']|\s*on\w+\s*=\s*[^\s>]+/gi,
216
+ dangerousUrls: /(href|src|action|formaction|xlink:href)\s*=\s*["']?\s*(javascript|data|vbscript):[^"'\s>]*/gi
217
+ };
203
218
  function sanitize(str) {
204
- return isString(str) ? str.replace(/<(script|img)?/ig, "&lt;").replace(/(script)?>/ig, "&gt;") : str;
219
+ if (!isString(str) || !str || str.indexOf("<") === -1) {
220
+ return str;
221
+ }
222
+ return str.replace(sanitizeRx.tags, "").replace(sanitizeRx.eventHandlers, "").replace(sanitizeRx.dangerousUrls, '$1=""');
205
223
  }
206
224
  function setTextValue(node, text, dy = [-1, 1], toMiddle = false) {
207
225
  if (!node || !isString(text)) {
@@ -513,7 +531,7 @@ function tplProcess(tpl, data) {
513
531
  for (const x in data) {
514
532
  res = res.replace(new RegExp(`{=${x}}`, "g"), data[x]);
515
533
  }
516
- return res;
534
+ return sanitize(res);
517
535
  }
518
536
  function parseDate(date) {
519
537
  var _a;
@@ -673,7 +691,7 @@ class Plugin {
673
691
  });
674
692
  }
675
693
  }
676
- __publicField(Plugin, "version", "3.17.1");
694
+ __publicField(Plugin, "version", "3.17.3");
677
695
 
678
696
  ;// ./src/Plugin/textoverlap/Options.ts
679
697
  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.17.1
8
+ * @version 3.17.3
9
9
  * @requires billboard.js
10
10
  * @summary billboard.js plugin
11
- */(function(l,u){typeof exports=="object"&&typeof module=="object"?module.exports=u(require("d3-delaunay"),require("d3-polygon"),require("d3-brush"),require("d3-selection")):typeof define=="function"&&define.amd?define("bb",["d3-delaunay","d3-polygon","d3-brush","d3-selection"],u):typeof exports=="object"?exports.bb=u(require("d3-delaunay"),require("d3-polygon"),require("d3-brush"),require("d3-selection")):(l.bb=l.bb||{},l.bb.plugin=l.bb.plugin||{},l.bb.plugin.textoverlap=u(l.d3,l.d3,l.d3,l.d3))})(this,function(w,l,u,q){return(function(){"use strict";var R={263:(function(e){e.exports=l}),348:(function(e){e.exports=w}),747:(function(e){e.exports=q}),853:(function(e){e.exports=u})},O={};function a(e){var t=O[e];if(t!==void 0)return t.exports;var n=O[e]={exports:{}};return R[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 b={};a.d(b,{default:function(){return ie}});var S=a(348),P=a(263),pe=a(853),he=a(747);function B(){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 F(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 m=B(),I=m==null?void 0:m.document,[be,me,_e,ge]=F(m);var N=Object.defineProperty,E=Object.getOwnPropertySymbols,V=Object.prototype.hasOwnProperty,U=Object.prototype.propertyIsEnumerable,j=(e,t,n)=>t in e?N(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,M=(e,t)=>{for(var n in t||(t={}))V.call(t,n)&&j(e,n,t[n]);if(E)for(var n of E(t))U.call(t,n)&&j(e,n,t[n]);return e};const ye=e=>e||e===0,X=e=>typeof e=="function",f=e=>typeof e=="string",_=e=>typeof e=="number",Y=e=>typeof e=="undefined",T=e=>typeof e!="undefined",xe=e=>typeof e=="boolean",ve=e=>Math.ceil(e/10)*10,we=e=>Math.ceil(e)+.5,Oe=e=>e[1]-e[0],g=e=>typeof e=="object",L=e=>Y(e)||e===null||f(e)&&e.length===0||g(e)&&!(e instanceof Date)&&Object.keys(e).length===0||_(e)&&isNaN(e),z=e=>!L(e),y=e=>Array.isArray(e),p=e=>e&&!(e!=null&&e.nodeType)&&g(e)&&!y(e);function Pe(e,t,n){return T(e[t])?e[t]:n}function Ee(e,t){let n=!1;return Object.keys(e).forEach(o=>e[o]===t&&(n=!0)),n}function je(e,t,...n){const o=X(e);return o&&e.call(t,...n),o}function Me(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 Te(e){return f(e)?e.replace(/<(script|img)?/ig,"&lt;").replace(/(script)?>/ig,"&gt;"):e}function $e(e,t,n=[-1,1],o=!1){if(!(!e||!f(t)))if(t.indexOf(`
12
- `)===-1)e.text(t);else{const r=[e.text(),t].map(i=>i.replace(/[\s\n]/g,""));if(r[0]!==r[1]){const i=t.split(`
13
- `),s=o?i.length-1:1;e.html(""),i.forEach((c,d)=>{e.append("tspan").attr("x",0).attr("dy",`${d===0?n[0]*s:n[1]}em`).text(c)})}}}function k(e){const{x:t,y:n,width:o,height:r}=e.getBBox();return[{x:t,y:n+r},{x:t,y:n},{x:t+o,y:n},{x:t+o,y:n+r}]}function Ae(e){const{width:t,height:n}=A(e),o=k(e),r=o[0].x,i=Math.min(o[0].y,o[1].y);return{x:r,y:i,width:t,height:n}}function Ce(e,t){var n;const o=e&&((n=e.touches||e.sourceEvent&&e.sourceEvent.touches)==null?void 0:n[0]);let r=[0,0];try{r=d3Pointer(o||e,t)}catch(i){}return r.map(i=>isNaN(i)?0:i)}function G(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 $(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 A(e,t=!1){return $(!0,e,t)}function De(e,t=!1){return $(!1,e,t)}function qe(e=!0,t=0,n=1e4){const o=window.crypto||window.msCrypto,r=o?t+o.getRandomValues(new Uint32Array(1))[0]%(n-t+1):Math.floor(Math.random()*(n-t)+t);return e?String(r):r}function C(e,t,n,o,r){if(n>o)return-1;const i=Math.floor((n+o)/2);let{x:s,w:c=0}=e[i];return r&&(s=e[i].y,c=e[i].h),t>=s&&t<=s+c?i:t<s?C(e,t,n,i-1,r):C(e,t,i+1,o,r)}function Re(e){const t=G(e);return t?t[0]===t[1]:!0}function Se(...e){const t=n=>{if(p(n)&&n.constructor){const o=new n.constructor;for(const r in n)o[r]=t(n[r]);return o}return n};return e.map(n=>t(n)).reduce((n,o)=>M(M({},n),o))}function H(e={},t){y(t)&&t.forEach(n=>H(e,n));for(const n in t)/^\d+$/.test(n)||n in e||(e[n]=t[n]);return e}const Be=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 K=e=>[].slice.call(e);function Ie(e,t,n){const{rootSelector:o="",sheet:r}=e,s=`${o} ${(c=>c.replace(/\s?(bb-)/g,".$1").replace(/\.+/g,"."))(t)} {${n.join(";")}}`;return r[r.insertRule?"insertRule":"addRule"](s,r.cssRules.length)}function Ne(e){let t=[];return e.forEach(n=>{var o;try{n.cssRules&&n.cssRules.length&&(t=t.concat(K(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 Ue(e,t=0,n=0,o=!0){const r=new DOMPoint(t,n),i=e.getScreenCTM(),s=r.matrixTransform(o?i==null?void 0:i.inverse():i);if(o===!1){const c=A(e);s.x-=c.x,s.y-=c.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 Le(e){return e&&e.length?e.reduce((t,n)=>t.concat(n)):[]}function x(e,...t){if(!t.length||t.length===1&&!t[0])return e;const n=t.shift();return p(e)&&p(n)&&Object.keys(n).forEach(o=>{if(!/^(__proto__|constructor|prototype)$/i.test(o)){const r=n[o];p(r)?(!e[o]&&(e[o]={}),e[o]=x(e[o],r)):e[o]=y(r)?r.concat():r}}),x(e,...t)}function W(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 ze(e,t){let n=t.filter(o=>z(o));return n.length?_(n[0])?n=Math[e](...n):n[0]instanceof Date&&(n=W(n,e==="min")[0]):n=void 0,n}const ke=(e,t,n=1)=>{const o=[],r=Math.max(0,Math.ceil((t-e)/n))|0;for(let i=e;i<r;i++)o.push(e+i*n);return o},Ge={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=I.createEvent("MouseEvent");i.initMouseEvent(o,r.bubbles,r.cancelable,m,0,r.screenX,r.screenY,r.clientX,r.clientY,!1,!1,!1,!1,0,null),n.dispatchEvent(i)}}})(),touch:(e,t,n)=>{const o=new Touch(x({identifier:Date.now(),target:e,radiusX:2.5,radiusY:2.5,rotationAngle:10,force:.5},n));e.dispatchEvent(new TouchEvent(t,{cancelable:!0,bubbles:!0,shiftKey:!0,touches:[o],targetTouches:[],changedTouches:[o]}))}};function He(e,t){let n=e;for(const o in t)n=n.replace(new RegExp(`{=${o}}`,"g"),t[o]);return n}function Ke(e){var t;let n;if(e instanceof Date)n=e;else if(f(e)){const{config:o,format:r}=this;n=(t=r.dataTime(o.data_xFormat)(e))!=null?t:new Date(e)}else _(e)&&!isNaN(e)&&(n=new Date(+e));return(!n||isNaN(+n))&&console&&console.error&&console.error(`Failed to parse x '${e}' to Date object`),n}function We(e){const t=e.attr("viewBox");return t?/(\d+(\.\d+)?){3}/.test(t):!1}function Je(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 Qe(){var e,t;return((e=document)==null?void 0:e.hidden)===!1||((t=document)==null?void 0:t.visibilityState)==="visible"}function Ze(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 J(e,t){t()===!1?requestAnimationFrame(()=>J(e,t)):e()}function et(e){if(p(e)&&!f(e)){const s=e;return{top:s.top||0,right:s.right||0,bottom:s.bottom||0,left:s.left||0}}const t=(f(e)?e.trim().split(/\s+/):[e]).map(s=>+s||0),[n,o=n,r=n,i=o]=t;return{top:n,right:o,bottom:r,left:i}}function Q(e){const t=this.config;let n,o,r;const i=()=>{const s=o.shift();if(s&&n&&g(n)&&s in n)return n=n[s],i();if(!s)return n};Object.keys(t).forEach(s=>{n=e,o=s.split("_"),r=i(),T(r)&&(t[s]=r)}),this.api&&(this.state.orgConfig=e)}var Z=Object.defineProperty,ee=(e,t,n)=>t in e?Z(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,v=(e,t,n)=>ee(e,typeof t!="symbol"?t+"":t,n);class D{constructor(t={}){v(this,"$$"),v(this,"options"),this.options=t}$beforeInit(){}$init(){}$afterInit(){}$redraw(){}$willDestroy(){Object.keys(this).forEach(t=>{this[t]=null,delete this[t]})}}v(D,"version","3.17.1");class te{constructor(){return{selector:void 0,extent:1,area:0}}}var ne=Object.defineProperty,oe=(e,t,n)=>t in e?ne(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,re=(e,t,n)=>oe(e,typeof t!="symbol"?t+"":t,n);class ie extends D{constructor(t){return super(t),re(this,"config"),this.config=new te,this}$init(){Q.call(this,this.options)}$redraw(){const{$$:{$el:t},config:{selector:n}}=this,o=n?t.main.selectAll(n):t.text;!o.empty()&&this.preventLabelOverlap(o)}generateVoronoi(t){const{$$:n}=this,{scale:o}=n,[r,i]=["x","y"].map(s=>o[s].domain());return[r[1],i[0]]=[i[0],r[1]],S.Delaunay.from(t).voronoi([...r,...i])}preventLabelOverlap(t){const{extent:n,area:o}=this.config,r=t.data().map(c=>[c.index,c.value]),i=this.generateVoronoi(r);let s=0;t.each(function(){const c=i.cellPolygon(s);if(c&&this){const[d,se]=r[s],[ce,le]=(0,P.polygonCentroid)(c),ae=Math.abs((0,P.polygonArea)(c)),h=Math.round(Math.atan2(le-se,ce-d)/Math.PI*2),ue=n*(h===0?1:-1),fe=h===-1?-n:n+5,de=Math.abs(h)===1?"middle":h===0?"start":"end";this.style.display=ae<o?"none":"",this.setAttribute("text-anchor",de),this.setAttribute("dy",`0.${h===1?71:35}em`),this.setAttribute("transform",`translate(${ue}, ${fe})`)}s++})}}return b=b.default,b})()});
11
+ */(function(l,u){typeof exports=="object"&&typeof module=="object"?module.exports=u(require("d3-delaunay"),require("d3-polygon"),require("d3-brush"),require("d3-selection")):typeof define=="function"&&define.amd?define("bb",["d3-delaunay","d3-polygon","d3-brush","d3-selection"],u):typeof exports=="object"?exports.bb=u(require("d3-delaunay"),require("d3-polygon"),require("d3-brush"),require("d3-selection")):(l.bb=l.bb||{},l.bb.plugin=l.bb.plugin||{},l.bb.plugin.textoverlap=u(l.d3,l.d3,l.d3,l.d3))})(this,function(O,l,u,q){return(function(){"use strict";var B={263:(function(e){e.exports=l}),348:(function(e){e.exports=O}),747:(function(e){e.exports=q}),853:(function(e){e.exports=u})},P={};function a(e){var t=P[e];if(t!==void 0)return t.exports;var n=P[e]={exports:{}};return B[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 b={};a.d(b,{default:function(){return ae}});var F=a(348),E=a(263),ge=a(853),_e=a(747);function I(){return typeof globalThis=="object"&&globalThis!==null&&globalThis.Object===Object&&globalThis||typeof global=="object"&&global!==null&&global.Object===Object&&global||typeof self=="object"&&self!==null&&self.Object===Object&&self||Function("return this")()}function N(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 m=I(),V=m==null?void 0:m.document,[ye,xe,ve,we]=N(m);var U=Object.defineProperty,$=Object.getOwnPropertySymbols,X=Object.prototype.hasOwnProperty,Y=Object.prototype.propertyIsEnumerable,j=(e,t,n)=>t in e?U(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,T=(e,t)=>{for(var n in t||(t={}))X.call(t,n)&&j(e,n,t[n]);if($)for(var n of $(t))Y.call(t,n)&&j(e,n,t[n]);return e};const Oe=e=>e||e===0,L=e=>typeof e=="function",f=e=>typeof e=="string",g=e=>typeof e=="number",z=e=>typeof e=="undefined",M=e=>typeof e!="undefined",Pe=e=>typeof e=="boolean",Ee=e=>Math.ceil(e/10)*10,$e=e=>Math.ceil(e)+.5,je=e=>e[1]-e[0],_=e=>typeof e=="object",H=e=>{for(const t in e)return!1;return!0},k=e=>z(e)||e===null||f(e)&&e.length===0||_(e)&&!(e instanceof Date)&&H(e)||g(e)&&isNaN(e),G=e=>!k(e),y=e=>Array.isArray(e),p=e=>e&&!(e!=null&&e.nodeType)&&_(e)&&!y(e);function Te(e,t,n){return M(e[t])?e[t]:n}function Me(e,t){let n=!1;return Object.keys(e).forEach(o=>e[o]===t&&(n=!0)),n}function Ae(e,t,...n){const o=L(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))}const A="script|iframe|object|embed|form|input|button|textarea|select|style|link|meta|base|svg|math",x={tags:new RegExp(`<(${A})[\\s\\S]*?>[\\s\\S]*?<\\/\\1>|<(${A})[^>]*\\/?>`,"gi"),eventHandlers:/\s*on\w+\s*=\s*["'][^"']*["']|\s*on\w+\s*=\s*[^\s>]+/gi,dangerousUrls:/(href|src|action|formaction|xlink:href)\s*=\s*["']?\s*(javascript|data|vbscript):[^"'\s>]*/gi};function K(e){return!f(e)||!e||e.indexOf("<")===-1?e:e.replace(x.tags,"").replace(x.eventHandlers,"").replace(x.dangerousUrls,'$1=""')}function De(e,t,n=[-1,1],o=!1){if(!(!e||!f(t)))if(t.indexOf(`
12
+ `)===-1)e.text(t);else{const r=[e.text(),t].map(s=>s.replace(/[\s\n]/g,""));if(r[0]!==r[1]){const s=t.split(`
13
+ `),i=o?s.length-1:1;e.html(""),s.forEach((c,d)=>{e.append("tspan").attr("x",0).attr("dy",`${d===0?n[0]*i:n[1]}em`).text(c)})}}}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 Re(e){const{width:t,height:n}=D(e),o=W(e),r=o[0].x,s=Math.min(o[0].y,o[1].y);return{x:r,y:s,width:t,height:n}}function Se(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 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 C(e,t,n=!1){const o=r=>r[e?"getBoundingClientRect":"getBBox"]();return n?o(t):!("rect"in t)||"rect"in t&&t.hasAttribute("width")&&t.rect.width!==+(t.getAttribute("width")||0)?t.rect=o(t):t.rect}function D(e,t=!1){return C(!0,e,t)}function qe(e,t=!1){return C(!1,e,t)}function Be(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 R(e,t,n,o,r){if(n>o)return-1;const s=Math.floor((n+o)/2);let{x:i,w:c=0}=e[s];return r&&(i=e[s].y,c=e[s].h),t>=i&&t<=i+c?s:t<i?R(e,t,n,s-1,r):R(e,t,s+1,o,r)}function Fe(e){const t=J(e);return t?t[0]===t[1]:!0}function Ie(...e){const t=n=>{if(p(n)&&n.constructor){const o=new n.constructor;for(const r in n)o[r]=t(n[r]);return o}return n};return e.map(n=>t(n)).reduce((n,o)=>T(T({},n),o))}function Q(e={},t){y(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 Ne=e=>e.charAt(0).toUpperCase()+e.slice(1);function Ve(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 Ue(e,t,n){const{rootSelector:o="",sheet:r}=e,i=`${o} ${(c=>c.replace(/\s?(bb-)/g,".$1").replace(/\.+/g,"."))(t)} {${n.join(";")}}`;return r[r.insertRule?"insertRule":"addRule"](i,r.cssRules.length)}function Xe(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 Ye(e){var t,n,o,r,s,i;return{x:((n=(t=window.pageXOffset)!=null?t:window.scrollX)!=null?n:0)+((o=e.scrollLeft)!=null?o:0),y:((s=(r=window.pageYOffset)!=null?r:window.scrollY)!=null?s:0)+((i=e.scrollTop)!=null?i:0)}}function Le(e,t=0,n=0,o=!0){const r=new DOMPoint(t,n),s=e.getScreenCTM(),i=r.matrixTransform(o?s==null?void 0:s.inverse():s);if(o===!1){const c=D(e);i.x-=c.x,i.y-=c.y}return i}function ze(e){const t=e?e.transform:null,n=t&&t.baseVal;return n&&n.numberOfItems?n.getItem(0).matrix:{a:0,b:0,c:0,d:0,e:0,f:0}}function He(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 ke(e){return e&&e.length?e.reduce((t,n)=>t.concat(n)):[]}function v(e,...t){if(!t.length||t.length===1&&!t[0])return e;const n=t.shift();return p(e)&&p(n)&&Object.keys(n).forEach(o=>{if(!/^(__proto__|constructor|prototype)$/i.test(o)){const r=n[o];p(r)?(!e[o]&&(e[o]={}),e[o]=v(e[o],r)):e[o]=y(r)?r.concat():r}}),v(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 Ge(e,t){let n=t.filter(o=>G(o));return n.length?g(n[0])?n=Math[e](...n):n[0]instanceof Date&&(n=ee(n,e==="min")[0]):n=void 0,n}const Ke=(e,t,n=1)=>{const o=[],r=Math.max(0,Math.ceil((t-e)/n))|0;for(let s=e;s<r;s++)o.push(e+s*n);return o},We={mouse:(()=>{const e=()=>({bubbles:!1,cancelable:!1,screenX:0,screenY:0,clientX:0,clientY:0});try{return new MouseEvent("t"),(t,n,o=e())=>{t.dispatchEvent(new MouseEvent(n,o))}}catch(t){return(n,o,r=e())=>{const s=V.createEvent("MouseEvent");s.initMouseEvent(o,r.bubbles,r.cancelable,m,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(v({identifier:Date.now(),target:e,radiusX:2.5,radiusY:2.5,rotationAngle:10,force:.5},n));e.dispatchEvent(new TouchEvent(t,{cancelable:!0,bubbles:!0,shiftKey:!0,touches:[o],targetTouches:[],changedTouches:[o]}))}};function Je(e,t){let n=e;for(const o in t)n=n.replace(new RegExp(`{=${o}}`,"g"),t[o]);return K(n)}function Qe(e){var t;let n;if(e instanceof Date)n=e;else if(f(e)){const{config:o,format:r}=this;n=(t=r.dataTime(o.data_xFormat)(e))!=null?t:new Date(e)}else g(e)&&!isNaN(e)&&(n=new Date(+e));return(!n||isNaN(+n))&&console&&console.error&&console.error(`Failed to parse x '${e}' to Date object`),n}function Ze(e){const t=e.attr("viewBox");return t?/(\d+(\.\d+)?){3}/.test(t):!1}function et(e,t,n=!1){const o=!!e.node;let r=!1;for(const[s,i]of Object.entries(t))if(r=o?e.style(s)===i:e.style[s]===i,n===!1&&r)break;return r}function tt(){var e,t;return((e=document)==null?void 0:e.hidden)===!1||((t=document)==null?void 0:t.visibilityState)==="visible"}function nt(e,t){const{DocumentTouch:n,matchMedia:o,navigator:r}=window,s=o==null?void 0:o("(pointer:coarse)").matches;let i=!1;if(t)if(r&&"maxTouchPoints"in r)i=r.maxTouchPoints>0;else if("ontouchmove"in window||n&&document instanceof n)i=!0;else if(s)i=!0;else{const d=r.userAgent;i=/\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"||i&&"touch"||"mouse"}function te(e,t){t()===!1?requestAnimationFrame(()=>te(e,t)):e()}function ot(e){if(p(e)&&!f(e)){const i=e;return{top:i.top||0,right:i.right||0,bottom:i.bottom||0,left:i.left||0}}const t=(f(e)?e.trim().split(/\s+/):[e]).map(i=>+i||0),[n,o=n,r=n,s=o]=t;return{top:n,right:o,bottom:r,left:s}}function ne(e){const t=this.config;let n,o,r;const s=()=>{const i=o.shift();if(i&&n&&_(n)&&i in n)return n=n[i],s();if(!i)return n};Object.keys(t).forEach(i=>{n=e,o=i.split("_"),r=s(),M(r)&&(t[i]=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,w=(e,t,n)=>re(e,typeof t!="symbol"?t+"":t,n);class S{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(S,"version","3.17.3");class se{constructor(){return{selector:void 0,extent:1,area:0}}}var ie=Object.defineProperty,ce=(e,t,n)=>t in e?ie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,le=(e,t,n)=>ce(e,typeof t!="symbol"?t+"":t,n);class ae extends S{constructor(t){return super(t),le(this,"config"),this.config=new se,this}$init(){ne.call(this,this.options)}$redraw(){const{$$:{$el:t},config:{selector:n}}=this,o=n?t.main.selectAll(n):t.text;!o.empty()&&this.preventLabelOverlap(o)}generateVoronoi(t){const{$$:n}=this,{scale:o}=n,[r,s]=["x","y"].map(i=>o[i].domain());return[r[1],s[0]]=[s[0],r[1]],F.Delaunay.from(t).voronoi([...r,...s])}preventLabelOverlap(t){const{extent:n,area:o}=this.config,r=t.data().map(c=>[c.index,c.value]),s=this.generateVoronoi(r);let i=0;t.each(function(){const c=s.cellPolygon(i);if(c&&this){const[d,ue]=r[i],[fe,de]=(0,E.polygonCentroid)(c),pe=Math.abs((0,E.polygonArea)(c)),h=Math.round(Math.atan2(de-ue,fe-d)/Math.PI*2),he=n*(h===0?1:-1),be=h===-1?-n:n+5,me=Math.abs(h)===1?"middle":h===0?"start":"end";this.style.display=pe<o?"none":"",this.setAttribute("text-anchor",me),this.setAttribute("dy",`0.${h===1?71:35}em`),this.setAttribute("transform",`translate(${he}, ${be})`)}i++})}}return b=b.default,b})()});