From b47544b55aecfd5a57d02cfe65ad0c08ec7e7de1 Mon Sep 17 00:00:00 2001 From: hengsin Date: Thu, 13 Jul 2023 20:34:06 +0800 Subject: [PATCH] IDEMPIERE-5797 Zk: Upgrade Billboard chart to 3.9.0 (#1930) * IDEMPIERE-5797 Zk: Upgrade Billboard chart to 3.9.0 * IDEMPIERE-5797 Zk: Upgrade Billboard chart to 3.9.0 - Add basic localization support * IDEMPIERE-5797 Zk: Upgrade Billboard chart to 3.9.0 - update Readme * IDEMPIERE-5797 Zk: Upgrade Billboard chart to 3.9.0 - Fix intermittent sizing and rendering issue --- .../WEB-INF/src/metainfo/zk/lang-addon.xml | 2 +- .../apps/graph/WPerformanceIndicator.java | 2 +- .../webui/dashboard/DPPerformance.java | 27 + .../webui/desktop/DashboardController.java | 14 + .../webui/desktop/DefaultDesktop.java | 23 + .../theme/default/css/fragment/gadget.css.dsp | 2 +- .../zk/billboard/chart/ChartBuilder.java | 1 + .../chart/PerformanceGraphBuilder.java | 7 +- org.idempiere.zk.billboard/README.md | 18 +- .../src/metainfo/zk/lang-addon.xml | 8 +- .../org/idempiere/zk/billboard/Billboard.java | 17 +- .../org/idempiere/zk/billboard/Version.java | 6 +- .../src/web/js/zul/billboard/Billboard.js | 47 +- .../web/js/zul/billboard/css/billboard.css | 23 +- .../js/zul/billboard/ext/billboard.area.js | 2 +- .../web/js/zul/billboard/ext/billboard.bar.js | 2 +- .../js/zul/billboard/ext/billboard.donut.js | 1 - .../js/zul/billboard/ext/billboard.gauge.js | 124 +- .../src/web/js/zul/billboard/ext/billboard.js | 10 + .../js/zul/billboard/ext/billboard.line.js | 2 +- .../js/zul/billboard/ext/billboard.pkgd.js | 25 - .../zul/billboard/ext/billboard.pkgd.src.js | 53016 ---------------- .../web/js/zul/billboard/ext/billboard.src.js | 25251 ++++++++ .../zul/billboard/ext/billboard.waterfall.js | 2 +- .../src/web/js/zul/billboard/ext/d3.v6.js | 2 + .../src/web/js/zul/billboard/ext/d3.v6.src.js | 19708 ++++++ .../src/web/js/zul/billboard/zk.wpd | 3 +- 27 files changed, 45221 insertions(+), 53124 deletions(-) create mode 100644 org.idempiere.zk.billboard/src/web/js/zul/billboard/ext/billboard.js delete mode 100644 org.idempiere.zk.billboard/src/web/js/zul/billboard/ext/billboard.pkgd.js delete mode 100644 org.idempiere.zk.billboard/src/web/js/zul/billboard/ext/billboard.pkgd.src.js create mode 100644 org.idempiere.zk.billboard/src/web/js/zul/billboard/ext/billboard.src.js create mode 100644 org.idempiere.zk.billboard/src/web/js/zul/billboard/ext/d3.v6.js create mode 100644 org.idempiere.zk.billboard/src/web/js/zul/billboard/ext/d3.v6.src.js diff --git a/org.adempiere.ui.zk/WEB-INF/src/metainfo/zk/lang-addon.xml b/org.adempiere.ui.zk/WEB-INF/src/metainfo/zk/lang-addon.xml index c050e146ba..55a19eeb98 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/metainfo/zk/lang-addon.xml +++ b/org.adempiere.ui.zk/WEB-INF/src/metainfo/zk/lang-addon.xml @@ -57,6 +57,6 @@ Copyright (C) 2007 Ashley G Ramdass (ADempiere WebUI). - + diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/graph/WPerformanceIndicator.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/graph/WPerformanceIndicator.java index bb696bf6dd..78425093d9 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/graph/WPerformanceIndicator.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/graph/WPerformanceIndicator.java @@ -196,7 +196,7 @@ public class WPerformanceIndicator extends Panel implements EventListener } this.getChildren().clear(); renderChart(width, height); - Events.sendEvent(this, new Event(ON_AFTER_RENDER_CHART_EVENT)); + Events.sendEvent(this, new Event(ON_AFTER_RENDER_CHART_EVENT, this)); } /** diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/dashboard/DPPerformance.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/dashboard/DPPerformance.java index 977fbf5c1e..59748a5de1 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/dashboard/DPPerformance.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/dashboard/DPPerformance.java @@ -21,6 +21,9 @@ import org.compiere.model.MGoal; import org.zkoss.zk.au.out.AuScript; import org.zkoss.zk.ui.Component; import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Events; +import org.zkoss.zk.ui.event.MaximizeEvent; +import org.zkoss.zk.ui.event.OpenEvent; import org.zkoss.zk.ui.util.Clients; /** @@ -49,6 +52,30 @@ public class DPPerformance extends DashboardPanel { paPanel = new WPAPanel(); appendChild(paPanel); paPanel.addEventListener(WPerformanceIndicator.ON_AFTER_RENDER_CHART_EVENT, e -> onPostRender()); + this.addEventListener(Events.ON_OPEN, (OpenEvent e) -> { + if (e.isOpen()) + onPostRestore(); + }); + this.addEventListener(Events.ON_MAXIMIZE, (MaximizeEvent e) -> { + if (!e.isMaximized()) + onPostRestore(); + }); + } + + /** + * After state of dashboard panel change from collapse to open or from maximize to normal. + */ + private void onPostRestore() { + if (this.getFirstChild() != null && this.getParent() != null) { + Component grid = this.getFirstChild().getFirstChild(); + String script = "setTimeout(function() { let grid = jq('#" + grid.getUuid() + "');"; + script = script + "let pa = jq('#" + this.getFirstChild().getUuid() + "');"; + script = script + "let pc = jq('#" + this.getParent().getUuid() + "');"; + script = script + "pa.height(grid.css('height'));"; + script = script + "pc.height(grid.css('height'));}, 10);"; + if (Executions.getCurrent() != null) + Clients.response(new AuScript(script)); + } } @Override diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/desktop/DashboardController.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/desktop/DashboardController.java index 5837a94492..bbc323ee4e 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/desktop/DashboardController.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/desktop/DashboardController.java @@ -1142,6 +1142,13 @@ public class DashboardController implements EventListener { //following 2 line needed for restore to size the panel correctly ZKUpdateUtil.setHflex(panel, (String)panel.getAttribute(FLEX_GROW_ATTRIBUTE)); ZKUpdateUtil.setHeight(panel, "100%"); + + //notify panel content component + if (panel.getPanelchildren() != null) { + panel.getPanelchildren().getChildren().forEach(child -> { + Executions.schedule(dashboardLayout.getDesktop(), e -> Events.postEvent(child, event), new Event("onPostRestore")); + }); + } } } else if(eventName.equals(Events.ON_CLICK)) @@ -1252,6 +1259,13 @@ public class DashboardController implements EventListener { PO.clearCrossTenantSafe(); } } + + //notify panel content component + if (panel.getPanelchildren() != null) { + for(Component c : panel.getPanelchildren().getChildren()) { + Events.postEvent(c, event); + } + } } } } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/desktop/DefaultDesktop.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/desktop/DefaultDesktop.java index 3f33121c16..9e3e52f77c 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/desktop/DefaultDesktop.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/desktop/DefaultDesktop.java @@ -42,6 +42,7 @@ import org.adempiere.webui.component.Tabpanel; import org.adempiere.webui.component.ToolBar; import org.adempiere.webui.component.ToolBarButton; import org.adempiere.webui.component.Window; +import org.adempiere.webui.dashboard.DashboardPanel; import org.adempiere.webui.event.MenuListener; import org.adempiere.webui.event.ZKBroadCastManager; import org.adempiere.webui.panel.ADForm; @@ -49,6 +50,7 @@ import org.adempiere.webui.panel.BroadcastMessageWindow; import org.adempiere.webui.panel.HeaderPanel; import org.adempiere.webui.panel.HelpController; import org.adempiere.webui.panel.TimeoutPanel; +import org.adempiere.webui.part.ITabOnSelectHandler; import org.adempiere.webui.session.SessionManager; import org.adempiere.webui.theme.ThemeManager; import org.adempiere.webui.util.UserPreference; @@ -604,6 +606,13 @@ public class DefaultDesktop extends TabbedDesktop implements MenuListener, Seria dashboardController.render(homeTab, this, true); + if (homeTab.getFirstChild() != null) { + ITabOnSelectHandler handler = () -> { + invalidateDashboardPanel(homeTab.getFirstChild().getChildren()); + }; + homeTab.getFirstChild().setAttribute(ITabOnSelectHandler.ATTRIBUTE_KEY, handler); + } + homeTab.setAttribute(HOME_TAB_RENDER_ATTR, Boolean.TRUE); West w = layout.getWest(); @@ -656,6 +665,20 @@ public class DefaultDesktop extends TabbedDesktop implements MenuListener, Seria homeTab.invalidate(); } + /** + * Redraw dashboard panel after switching back to home tab + * @param childrens + */ + private void invalidateDashboardPanel(List childrens) { + for (Component children : childrens) { + if (children instanceof DashboardPanel) { + children.invalidate(); + } else { + invalidateDashboardPanel(children.getChildren()); + } + } + } + /** * Set width of popup for side panel * @param popup diff --git a/org.adempiere.ui.zk/WEB-INF/src/web/theme/default/css/fragment/gadget.css.dsp b/org.adempiere.ui.zk/WEB-INF/src/web/theme/default/css/fragment/gadget.css.dsp index 7ed7391113..3b4e976737 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/web/theme/default/css/fragment/gadget.css.dsp +++ b/org.adempiere.ui.zk/WEB-INF/src/web/theme/default/css/fragment/gadget.css.dsp @@ -212,7 +212,7 @@ .performance-indicator-box { background-color: #eee; border: 1px solid #d8d8d8; - border-radius: 11px; + border-radius: 5px; cursor: pointer; } .performance-indicator-title { diff --git a/org.idempiere.zk.billboard.chart/src/org/idempiere/zk/billboard/chart/ChartBuilder.java b/org.idempiere.zk.billboard.chart/src/org/idempiere/zk/billboard/chart/ChartBuilder.java index 9a6da42e9f..e3226b6329 100644 --- a/org.idempiere.zk.billboard.chart/src/org/idempiere/zk/billboard/chart/ChartBuilder.java +++ b/org.idempiere.zk.billboard.chart/src/org/idempiere/zk/billboard/chart/ChartBuilder.java @@ -458,6 +458,7 @@ public class ChartBuilder { billboard.setValueAxisLabel(mChart.get_Translation(MChart.COLUMNNAME_RangeLabel)); billboard.setTitle(mChart.get_Translation(MChart.COLUMNNAME_Name)); billboard.setType(type); + billboard.setLocale(Env.getContext(Env.getCtx(), Env.LOCALE)); return billboard; } diff --git a/org.idempiere.zk.billboard.chart/src/org/idempiere/zk/billboard/chart/PerformanceGraphBuilder.java b/org.idempiere.zk.billboard.chart/src/org/idempiere/zk/billboard/chart/PerformanceGraphBuilder.java index edf715c897..37a17156d3 100644 --- a/org.idempiere.zk.billboard.chart/src/org/idempiere/zk/billboard/chart/PerformanceGraphBuilder.java +++ b/org.idempiere.zk.billboard.chart/src/org/idempiere/zk/billboard/chart/PerformanceGraphBuilder.java @@ -68,8 +68,6 @@ public class PerformanceGraphBuilder { private void buildDialRendererOptions(Billboard billboard, DialModel dialModel) { DialModelScale dialScale = dialModel.getScale(0); - billboard.addRendererOptions("min", 0); - billboard.addRendererOptions("max", dialScale.getScaleUpperBound()); List intervals = new ArrayList(); List intervalColors = new ArrayList(); for(int i = 0; i < dialScale.rangeSize(); i++) { @@ -78,13 +76,10 @@ public class PerformanceGraphBuilder { intervals.add(upperBound); intervalColors.add(dialRange.getRangeColor()); } - List ticks = new ArrayList(intervals); - ticks.add(0, 0d); - billboard.addRendererOptions("ticks", ticks.toArray(new Double[0])); billboard.addRendererOptions("intervals", intervals.toArray(new Double[0])); billboard.addRendererOptions("intervalColors", intervalColors.toArray(new String[0])); - billboard.addRendererOptions("tickColor", dialScale.getTickColor()); billboard.addRendererOptions("background", dialModel.getFrameBgColor()); + billboard.addRendererOptions("showNeedle", Boolean.TRUE); } private DialModel createDialModel(IndicatorModel model) diff --git a/org.idempiere.zk.billboard/README.md b/org.idempiere.zk.billboard/README.md index 7e9d713702..2370715ba1 100644 --- a/org.idempiere.zk.billboard/README.md +++ b/org.idempiere.zk.billboard/README.md @@ -2,6 +2,20 @@ 1. Wrap https://github.com/naver/billboard.js as zk component. -2. To update, replace billboard.pkgd.js and billboard.pkgd.src.js with latest billboard.pkgd.js and billboard.pkgd.min.js from https://github.com/naver/billboard.js (Note that due to naming convention of zk, billboard.pkgd.js=billboard.pkgd.min.js and billboard.pkgd.src.js=billboard.pkgd.js ). +2. Get latest billboard.min.js and billboard.js from https://github.com/naver/billboard.js. Following Zk naming convention, rename billboard.min.js to billboard.js and rename billboard.js to billboard.src.js. -3. To update, replace billboard.css with latest billboard.css from https://github.com/naver/billboard.js. Add !important to padding and text-align of .bb-tooltip th and padding of .bb-tooltip td to fix conflict with zk css +3. Get d3 from https://d3js.org/. The current version use by billboard is v6 so the corresponding link is https://d3js.org/d3.v6.js and https://d3js.org/d3.v6.min.js. Again, following Zk naming conversion, we need to rename d3.v6.js to d3.v6.src.js and rename d3.v6.min.js to d3.v6.js. + +4. Replace billboard.css with latest billboard.css from https://github.com/naver/billboard.js. +* Add !important to padding and text-align of .bb-tooltip th and padding of .bb-tooltip td to fix conflict with zk css +* Change font-size of text.bb-chart-arcs-gauge-title from 2.7em to 1.5em. + * Original: text.bb-chart-arcs-gauge-title { + dominant-baseline: middle; + font-size: 2.7em; } + * Updated: text.bb-chart-arcs-gauge-title { + dominant-baseline: middle; + font-size: 1.5em; } + +5. Update version-uid in metainfo.zk/lang-addon.xml and org.idempiere.zk.billboard.Version.UID (both value must match). + +6. Update version of "zul.billboard" and "zul.billboard.css" javascript-module in metainfo.zk/lang-addon.xml. diff --git a/org.idempiere.zk.billboard/src/metainfo/zk/lang-addon.xml b/org.idempiere.zk.billboard/src/metainfo/zk/lang-addon.xml index 25668565a0..cf12293a4e 100644 --- a/org.idempiere.zk.billboard/src/metainfo/zk/lang-addon.xml +++ b/org.idempiere.zk.billboard/src/metainfo/zk/lang-addon.xml @@ -6,7 +6,7 @@ xul/html org.idempiere.zk.billboard.Version - 3.5.1.20220908 + 3.9.0.20230713 billboard @@ -19,7 +19,7 @@ - + - - \ No newline at end of file + + diff --git a/org.idempiere.zk.billboard/src/org/idempiere/zk/billboard/Billboard.java b/org.idempiere.zk.billboard/src/org/idempiere/zk/billboard/Billboard.java index 45cbb65f0e..b2ded1f7d1 100644 --- a/org.idempiere.zk.billboard/src/org/idempiere/zk/billboard/Billboard.java +++ b/org.idempiere.zk.billboard/src/org/idempiere/zk/billboard/Billboard.java @@ -53,7 +53,7 @@ public class Billboard extends XulElement { /** * generated serial id */ - private static final long serialVersionUID = -3888636406033151303L; + private static final long serialVersionUID = -2164790050418874185L; // Must private ChartModel _model; @@ -73,6 +73,7 @@ public class Billboard extends XulElement { private String valueAxisLabel = null; private String[] seriesColors = null; private int xAxisAngle = 0; + private String locale = null; public static final String ON_DATA_CLICK_EVENT = "onDataClick"; @@ -95,6 +96,7 @@ public class Billboard extends XulElement { render(renderer, "orient", _orient); render(renderer, "timeSeries", timeSeries); render(renderer, "xAxisAngle", xAxisAngle); + render(renderer, "locale", toD3Locale(locale)); if (timeSeries) { if (timeSeriesInterval != null) render(renderer, "timeSeriesInterval", timeSeriesInterval); @@ -139,6 +141,15 @@ public class Billboard extends XulElement { */ } + private String toD3Locale(String locale) { + if (locale == null) + return null; + if ("es_CO".equals(locale)) + return "es-ES"; + else + return locale.replaceFirst("[_]", "-"); + } + private JSONObject mapToJSON(Map map) { JSONObject jData = new JSONObject(); for(String key : map.keySet()) { @@ -466,4 +477,8 @@ public class Billboard extends XulElement { public void setXAxisAngle(int xAxisAngle) { this.xAxisAngle = xAxisAngle; } + + public void setLocale(String locale) { + this.locale = locale; + } } diff --git a/org.idempiere.zk.billboard/src/org/idempiere/zk/billboard/Version.java b/org.idempiere.zk.billboard/src/org/idempiere/zk/billboard/Version.java index ca4eca2cfb..688386d15a 100644 --- a/org.idempiere.zk.billboard/src/org/idempiere/zk/billboard/Version.java +++ b/org.idempiere.zk.billboard/src/org/idempiere/zk/billboard/Version.java @@ -30,7 +30,9 @@ package org.idempiere.zk.billboard; * */ public class Version { - /** Returns the version UID. + /** + * Returns the version UID.
+ * Must match with version-uid value in lang-addon.xml */ - public static final String UID = "3.5.1.20220908"; + public static final String UID = "3.9.0.20230713"; } diff --git a/org.idempiere.zk.billboard/src/web/js/zul/billboard/Billboard.js b/org.idempiere.zk.billboard/src/web/js/zul/billboard/Billboard.js index a0f925bd38..2bce879269 100644 --- a/org.idempiere.zk.billboard/src/web/js/zul/billboard/Billboard.js +++ b/org.idempiere.zk.billboard/src/web/js/zul/billboard/Billboard.js @@ -1,5 +1,8 @@ (function() { + const __d3_formatLocaleCache = new Map(); + const __d3_timeFormatLocaleCache = new Map(); + var Billboard = zul.billboard.Billboard = zk.$extends(zk.Widget, { @@ -10,6 +13,7 @@ _cursor : false, _highlighter : true, _dataClickTS : 0, + _locale: null, $define : { title: null, @@ -35,10 +39,51 @@ timeSeriesInterval: null, timeSeriesFormat: null, xAxisAngle: null, - chart: null + chart: null, + locale: null + }, + + _loadFormatLocale: async function(url) { + try { + const definition = await d3.json(url); + d3.formatDefaultLocale(definition); + __d3_formatLocaleCache.set(url, definition); + } catch (error) { + __d3_formatLocaleCache.set(url, null); + } + }, + + _loadTimeFormatLocale: async function(url) { + try { + const definition = await d3.json(url); + d3.timeFormatDefaultLocale(definition); + __d3_timeFormatLocaleCache.set(url, definition); + } catch (error) { + __d3_timeFormatLocaleCache.set(url, null); + } }, _dataPrepare : function() { + //load locale + if (this.getLocale() != null) { + const formatURL = "https://unpkg.com/d3-format@3.1.0/locale/"+this.getLocale()+".json"; + if (__d3_formatLocaleCache.has(formatURL)) { + const definition = __d3_formatLocaleCache.get(formatURL); + if (definition != null) + d3.formatDefaultLocale(definition); + } else { + this._loadFormatLocale(formatURL); + } + const timeFormatURL = "https://unpkg.com/d3-time-format@4.1.0/locale/"+this.getLocale()+".json"; + if (__d3_timeFormatLocaleCache.has(timeFormatURL)) { + const definition = __d3_timeFormatLocaleCache.get(timeFormatURL); + if (definition != null) + d3.timeFormatDefaultLocale(definition); + } else { + this._loadTimeFormatLocale(timeFormatURL); + } + } + var dataModel = this.getModel(); var data = []; try { diff --git a/org.idempiere.zk.billboard/src/web/js/zul/billboard/css/billboard.css b/org.idempiere.zk.billboard/src/web/js/zul/billboard/css/billboard.css index a786873a00..0c3b816352 100644 --- a/org.idempiere.zk.billboard/src/web/js/zul/billboard/css/billboard.css +++ b/org.idempiere.zk.billboard/src/web/js/zul/billboard/css/billboard.css @@ -5,7 +5,7 @@ * billboard.js, JavaScript chart library * https://naver.github.io/billboard.js/ * - * @version 3.5.1 + * @version 3.9.0 */ /*-- Chart --*/ .bb svg { @@ -24,11 +24,12 @@ .bb-legend-item-tile, .bb-xgrid-focus, .bb-ygrid-focus, -.bb-ygrid, -.bb-event-rect, -.bb-bars path { +.bb-ygrid { shape-rendering: crispEdges; } +.bb-chart-arcs .bb-needle { + fill: #000; } + .bb-chart-arc .bb-gauge-value { fill: #000; } @@ -131,6 +132,11 @@ .bb-title { font: 14px sans-serif; } +/*-- Treemap --*/ +.bb-chart-treemaps rect { + stroke: #fff; + stroke-width: 1px; } + /*-- Tooltip --*/ .bb-tooltip-container { z-index: 10; @@ -142,9 +148,8 @@ background-color: #fff; empty-cells: show; opacity: 0.9; - -webkit-box-shadow: 7px 7px 12px -9px #777777; - -moz-box-shadow: 7px 7px 12px -9px #777777; - box-shadow: 7px 7px 12px -9px #777777; } + box-shadow: 7px 7px 12px -9px #777777; + white-space: nowrap; } .bb-tooltip tr { border: 1px solid #CCC; } .bb-tooltip th { @@ -164,7 +169,7 @@ height: 10px; margin-right: 6px; } .bb-tooltip.value { - text-align: right; } + text-align: right !important; } /*-- Area --*/ .bb-area { @@ -178,7 +183,7 @@ text.bb-chart-arcs-gauge-title { dominant-baseline: middle; - font-size: 2.7em; } + font-size: 1.5em; } .bb-chart-arcs { /*-- Polar --*/ } diff --git a/org.idempiere.zk.billboard/src/web/js/zul/billboard/ext/billboard.area.js b/org.idempiere.zk.billboard/src/web/js/zul/billboard/ext/billboard.area.js index 13066e9576..25aadf7064 100644 --- a/org.idempiere.zk.billboard/src/web/js/zul/billboard/ext/billboard.area.js +++ b/org.idempiere.zk.billboard/src/web/js/zul/billboard/ext/billboard.area.js @@ -105,7 +105,7 @@ billboard.AreaRenderer.prototype.render = function(wgt) { var h = '
'; h = h + defaultTitleFormat(c.x); h = h + '
'; - h = h + c.value + '
'; + h = h + d3.format('.2f')(c.value) + ''; return h; } }, diff --git a/org.idempiere.zk.billboard/src/web/js/zul/billboard/ext/billboard.bar.js b/org.idempiere.zk.billboard/src/web/js/zul/billboard/ext/billboard.bar.js index 6be7db5ceb..9eb09bc25f 100644 --- a/org.idempiere.zk.billboard/src/web/js/zul/billboard/ext/billboard.bar.js +++ b/org.idempiere.zk.billboard/src/web/js/zul/billboard/ext/billboard.bar.js @@ -105,7 +105,7 @@ billboard.BarRenderer.prototype.render = function(wgt) { var h = '
'; h = h + defaultTitleFormat(c.x); h = h + '
'; - h = h + c.value + '
'; + h = h + d3.format('.2f')(c.value) + ''; return h; } }, diff --git a/org.idempiere.zk.billboard/src/web/js/zul/billboard/ext/billboard.donut.js b/org.idempiere.zk.billboard/src/web/js/zul/billboard/ext/billboard.donut.js index 2603ad35ab..27d195db4c 100644 --- a/org.idempiere.zk.billboard/src/web/js/zul/billboard/ext/billboard.donut.js +++ b/org.idempiere.zk.billboard/src/web/js/zul/billboard/ext/billboard.donut.js @@ -54,7 +54,6 @@ billboard.DonutRenderer.prototype.render = function(wgt) { }; if (wgt.getTitle()) model["donut"]["title"] = wgt.getTitle(); - //model["title"] = {text: wgt.getTitle()}; return model; }; diff --git a/org.idempiere.zk.billboard/src/web/js/zul/billboard/ext/billboard.gauge.js b/org.idempiere.zk.billboard/src/web/js/zul/billboard/ext/billboard.gauge.js index 18ee8299b3..1e31e4e53f 100644 --- a/org.idempiere.zk.billboard/src/web/js/zul/billboard/ext/billboard.gauge.js +++ b/org.idempiere.zk.billboard/src/web/js/zul/billboard/ext/billboard.gauge.js @@ -1,56 +1,82 @@ var billboard = billboard || {}; -billboard.GaugeRenderer = function() {}; +billboard.GaugeRenderer = class { + constructor() { } + render(wgt) { + var columns = [wgt.getSeriesData()[0], wgt.getSeriesData()[1]]; + var color = {}; + var gauge = { + units: "" + }; + let showNeedle = false; + var rendererOptions = wgt._rendererOptions ? jq.evalJSON(wgt._rendererOptions) : null; + if (rendererOptions) { + if (rendererOptions["showNeedle"] && rendererOptions["showNeedle"] == true) { + showNeedle = true; + gauge.title = "\n{=NEEDLE_VALUE}%"; + gauge.width = 20; + gauge.label = { + format: function(_value, _ratio, id) { return id; } + }; + } + if (rendererOptions["intervalColors"]) { + color["pattern"] = new Array(); + rendererOptions["intervalColors"].forEach((x, _i) => color["pattern"].push(x)); + } + if (rendererOptions["intervals"]) { + if (!showNeedle) { + color["threshold"] = {values: []}; + rendererOptions["intervals"].forEach((x, _i) => color["threshold"]["values"].push(x)); + } else { + columns = []; + let prev = 0; + rendererOptions["intervals"].forEach((x, _i) => { + let step = x - prev; + prev = x; + columns.push([x + "%", step]); + }); + } + } -billboard.GaugeRenderer.prototype.render = function(wgt) { - var columns = [wgt.getSeriesData()[0], wgt.getSeriesData()[1]]; - var color = {}; - var gauge = {units: ""}; - var rendererOptions = wgt._rendererOptions ? jq.evalJSON(wgt._rendererOptions) : null; - if (rendererOptions) { - if (rendererOptions["intervalColors"]) { - color["pattern"] = new Array(); - rendererOptions["intervalColors"].forEach((x, i) => color["pattern"].push(x)); - } - if (rendererOptions["intervals"]) { - color["threshold"] = {values: []}; - rendererOptions["intervals"].forEach((x, i) => color["threshold"]["values"].push(x)); - } - - /* - if (rendererOptions["min"]) { - gauge["min"] = rendererOptions["min"]; - } - if (rendererOptions["max"]) { - gauge["max"] = rendererOptions["max"]; - } - */ - if (rendererOptions["background"]) { - gauge["background"] = rendererOptions["background"]; - } - } - var model = { - bindto: "#"+wgt.$n().id, - data: { - columns: [columns], - type: wgt._type - }, - color: color, - gauge: gauge, - tooltip: { - show: true, - doNotHide: false, - grouped: false, - format: { - title: function(x) { return ""; }, - name: function(name, ratio, id, index) { return ""; }, - value: function(value, ratio, id, index) { return value; } - } - }, - legend: {show: false} - }; - return model; + if (rendererOptions["background"]) { + gauge["background"] = rendererOptions["background"]; + } + } + var model = { + bindto: "#" + wgt.$n().id, + data: { + columns: showNeedle ? columns : [columns], + type: wgt._type + }, + color: color, + gauge: gauge, + tooltip: { + show: true, + doNotHide: false, + grouped: false, + format: { + title: function(_x) { return ""; }, + name: function(_name, _ratio, _id, _index) { return ""; }, + value: function(value, _ratio, _id, _index) { return value; } + } + }, + legend: { show: false } + }; + if (showNeedle) { + model.arc = { + needle: { + show: true, + value: wgt.getSeriesData()[1][0] + } + }; + model.interaction = { + enabled: false + }; + } + return model; + } }; + zul.billboard.Billboard._renderers["gauge"] = new billboard.GaugeRenderer(); \ No newline at end of file diff --git a/org.idempiere.zk.billboard/src/web/js/zul/billboard/ext/billboard.js b/org.idempiere.zk.billboard/src/web/js/zul/billboard/ext/billboard.js new file mode 100644 index 0000000000..c6bf10ff7b --- /dev/null +++ b/org.idempiere.zk.billboard/src/web/js/zul/billboard/ext/billboard.js @@ -0,0 +1,10 @@ +/*! + * Copyright (c) 2017 ~ present NAVER Corp. + * billboard.js project is licensed under the MIT license + * + * billboard.js, JavaScript chart library + * https://naver.github.io/billboard.js/ + * + * @version 3.9.0 + */ +!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e(require("d3-axis"),require("d3-brush"),require("d3-drag"),require("d3-dsv"),require("d3-ease"),require("d3-hierarchy"),require("d3-interpolate"),require("d3-scale"),require("d3-selection"),require("d3-shape"),require("d3-time-format"),require("d3-transition"),require("d3-zoom"));else if("function"==typeof define&&define.amd)define(["d3-axis","d3-brush","d3-drag","d3-dsv","d3-ease","d3-hierarchy","d3-interpolate","d3-scale","d3-selection","d3-shape","d3-time-format","d3-transition","d3-zoom"],e);else{var i="object"==typeof exports?e(require("d3-axis"),require("d3-brush"),require("d3-drag"),require("d3-dsv"),require("d3-ease"),require("d3-hierarchy"),require("d3-interpolate"),require("d3-scale"),require("d3-selection"),require("d3-shape"),require("d3-time-format"),require("d3-transition"),require("d3-zoom")):e(t.d3,t.d3,t.d3,t.d3,t.d3,t.d3,t.d3,t.d3,t.d3,t.d3,t.d3,t.d3,t.d3);for(var n in i)("object"==typeof exports?exports:t)[n]=i[n]}}(this,(function(t,e,i,n,a,r,s,o,l,c,d,u,h){return function(){"use strict";var g=[,,function(t){t.exports=l},function(t){t.exports=e},function(t){t.exports=d},function(t){t.exports=n},function(t){t.exports=o},function(t){t.exports=i},function(t){t.exports=u},function(t){t.exports=c},function(e){e.exports=t},function(t){t.exports=a},function(t){t.exports=s},function(t){t.exports=r},function(t){t.exports=h}],f={};function p(t){var e=f[t];if(void 0!==e)return e.exports;var i=f[t]={exports:{}};return g[t](i,i.exports,p),i.exports}p.d=function(t,e){for(var i in e)p.o(e,i)&&!p.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},p.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},p.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var v={};return function(){p.r(v),p.d(v,{bb:function(){return Xa},default:function(){return Xa}});var t={};p.r(t),p.d(t,{area:function(){return Qn},areaLineRange:function(){return ta},areaSpline:function(){return ea},areaSplineRange:function(){return ia},areaStep:function(){return na},bar:function(){return ha},bubble:function(){return ga},candlestick:function(){return fa},donut:function(){return oa},gauge:function(){return la},line:function(){return aa},pie:function(){return ca},polar:function(){return da},radar:function(){return ua},scatter:function(){return pa},spline:function(){return ra},step:function(){return sa},treemap:function(){return va}});var e={};function i(t,e){if(t!==e)throw new TypeError("Cannot instantiate an arrow function")}p.r(e),p.d(e,{selection:function(){return Da},subchart:function(){return za},zoom:function(){return Ma}});var n=p(4),a=p(2),r=void 0,s=function(){return i(this,r),"object"==typeof globalThis&&null!==globalThis&&globalThis.Object===Object&&globalThis||"object"==typeof global&&null!==global&&global.Object===Object&&global||"object"==typeof self&&null!==self&&self.Object===Object&&self||Function("return this")()}.bind(void 0)(),o="function"==typeof s.requestAnimationFrame,l="function"==typeof s.requestIdleCallback,c=o?s.requestAnimationFrame:function(t){return i(this,r),setTimeout(t,1)}.bind(void 0),d=o?s.cancelAnimationFrame:function(t){return i(this,r),clearTimeout(t)}.bind(void 0),u=l?s.requestIdleCallback:c,h=(l&&s.cancelIdleCallback,null==s?void 0:s.document),g={AREA:"area",AREA_LINE_RANGE:"area-line-range",AREA_SPLINE:"area-spline",AREA_SPLINE_RANGE:"area-spline-range",AREA_STEP:"area-step",BAR:"bar",BUBBLE:"bubble",CANDLESTICK:"candlestick",DONUT:"donut",GAUGE:"gauge",LINE:"line",PIE:"pie",POLAR:"polar",RADAR:"radar",SCATTER:"scatter",SPLINE:"spline",STEP:"step",TREEMAP:"treemap"},f={AREA:"initArea",AREA_LINE_RANGE:"initArea",AREA_SPLINE:"initArea",AREA_SPLINE_RANGE:"initArea",AREA_STEP:"initArea",BAR:"initBar",BUBBLE:"initCircle",CANDLESTICK:"initCandlestick",DONUT:"initArc",GAUGE:"initArc",LINE:"initLine",PIE:"initArc",POLAR:"initPolar",RADAR:"initCircle",SCATTER:"initCircle",SPLINE:"initLine",STEP:"initLine",TREEMAP:"initTreemap"},x={Area:[g.AREA,g.AREA_SPLINE,g.AREA_SPLINE_RANGE,g.AREA_LINE_RANGE,g.AREA_STEP],AreaRange:[g.AREA_SPLINE_RANGE,g.AREA_LINE_RANGE],Arc:[g.PIE,g.DONUT,g.GAUGE,g.POLAR,g.RADAR],Line:[g.LINE,g.SPLINE,g.AREA,g.AREA_SPLINE,g.AREA_SPLINE_RANGE,g.AREA_LINE_RANGE,g.STEP,g.AREA_STEP],Step:[g.STEP,g.AREA_STEP],Spline:[g.SPLINE,g.AREA_SPLINE,g.AREA_SPLINE_RANGE]};function b(t){return b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},b(t)}function _(t){var e=function(t,e){if("object"!==b(t)||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,e||"default");if("object"!==b(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===b(e)?e:String(e)}function m(t,e,i){return(e=_(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}var y=p(3),T=void 0;function w(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function A(t){for(var e,i=1;i2?n-2:0),r=2;r/g,">"):t}function V(t,e,n,a){var r=this;if(void 0===n&&(n=[-1,1]),void 0===a&&(a=!1),t&&C(e))if(-1===e.indexOf("\n"))t.text(e);else{var s=[t.text(),e].map(function(t){return i(this,r),t.replace(/[\s\n]/g,"")}.bind(this));if(s[0]!==s[1]){var o=e.split("\n"),l=a?o.length-1:1;t.html(""),o.forEach(function(e,a){i(this,r),t.append("tspan").attr("x",0).attr("dy",(0===a?n[0]*l:n[1])+"em").text(e)}.bind(this))}}}function Y(t){var e=t.getBBox(),i=e.x,n=e.y,a=e.width,r=e.height;return[{x:i,y:n+r},{x:i,y:n},{x:i+a,y:n},{x:i+a,y:n+r}]}function H(t,e){var n,r=t&&(null==(n=t.touches||t.sourceEvent&&t.sourceEvent.touches)?void 0:n[0]),s=(0,a.pointer)(r||t,e),o=this;return s.map(function(t){return i(this,o),isNaN(t)?0:t}.bind(this))}function W(t){var e,i=t.event,n=t.$el,a=n.subchart.main||n.main;return i&&"brush"===i.type?e=i.selection:a&&(e=a.select(".bb-brush").node())&&(e=(0,y.brushSelection)(e)),e}function U(t){return!("rect"in t)||"rect"in t&&t.hasAttribute("width")&&t.rect.width!==+t.getAttribute("width")?t.rect=t.getBoundingClientRect():t.rect}function Z(t,e,i){void 0===t&&(t=!0),void 0===e&&(e=0),void 0===i&&(i=1e4);var n=s.crypto||s.msCrypto,a=n?e+n.getRandomValues(new Uint32Array(1))[0]%(i-e+1):Math.floor(Math.random()*(i-e)+e);return t?a+"":a}function q(t,e,i,n,a){if(i>n)return-1;var r=Math.floor((i+n)/2),s=t[r],o=s.x,l=s.w,c=void 0===l?0:l;return a&&(o=t[r].y,c=t[r].h),e>=o&&e<=o+c?r:e1?n-1:0),r=1;re?-1:t{=TITLE}",legend_equally:!1,legend_hide:!1,legend_inset_anchor:"top-left",legend_inset_x:10,legend_inset_y:0,legend_inset_step:void 0,legend_item_interaction:!0,legend_item_dblclick:!1,legend_item_onclick:void 0,legend_item_onover:void 0,legend_item_onout:void 0,legend_item_tile_width:10,legend_item_tile_height:10,legend_item_tile_r:5,legend_item_tile_type:"rectangle",legend_padding:0,legend_position:"bottom",legend_show:!0,legend_usePoint:!1},Jt={title_text:void 0,title_padding:{top:0,right:0,bottom:0,left:0},title_position:"center"},Qt=void 0,te={tooltip_show:!0,tooltip_doNotHide:!1,tooltip_grouped:!0,tooltip_format_title:void 0,tooltip_format_name:void 0,tooltip_format_value:void 0,tooltip_position:void 0,tooltip_contents:{},tooltip_init_show:!1,tooltip_init_x:0,tooltip_init_position:{top:"0px",left:"50px"},tooltip_linked:!1,tooltip_linked_name:"",tooltip_onshow:function(){i(this,Qt)}.bind(void 0),tooltip_onhide:function(){i(this,Qt)}.bind(void 0),tooltip_onshown:function(){i(this,Qt)}.bind(void 0),tooltip_onhidden:function(){i(this,Qt)}.bind(void 0),tooltip_order:null};function ee(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function ie(t){for(var e,i=1;i0){if(void 0===e[a-1]&&(e[a-1]={}),void 0===t)throw new Error("Source data is missing a component at ("+i+", "+a+")!");e[a-1][n]=t}}))})),e}function Te(t){var e=t[0],i=[];return t.forEach((function(t,n){if(n>0){var a={};t.forEach((function(t,i){if(void 0===t)throw new Error("Source data is missing a component at ("+n+", "+i+")!");a[e[i]]=t})),i.push(a)}})),i}function we(t,e){var i,n,a=[];if(Array.isArray(t)){i=e.x?e.value.concat(e.x):e.value,a.push(i),t.forEach((function(t){var e=i.map((function(e){var i=function(t,e){if(void 0!==t[e])return t[e];var i=e.replace(/\[(\w+)\]/g,".$1").replace(/^\./,"").split("."),n=t;return i.some((function(t){return!(n=n&&t in n?n[t]:void 0)})),n}(t,e);return void 0===i&&(i=null),i}));a.push(e)})),n=Te(a)}else Object.keys(t).forEach((function(e){var i=t[e].concat();null==i.unshift||i.unshift(e),a.push(i)})),n=ye(a);return n}function Ae(t,e){var n,a=this,r=t.rows(e);return 1===r.length?(n=[{}],r[0].forEach(function(t){i(this,a),n[0][t]=null}.bind(this))):n=t.parse(e),n}function Se(t){return Ae({rows:me.csvParseRows,parse:me.csvParse},t)}function ke(t){return Ae({rows:me.tsvParseRows,parse:me.tsvParse},t)}function Ce(t,e){var i=t||(null==e?void 0:e.data_keys);return null!=i&&i.x&&(e.data_x=i.x),i}var Re={convertData:function(t,e){var n=this,a=this.config,r=a.boost_useWorker,s=t;if(t.bindto&&(s={},["url","mimeType","headers","keys","json","keys","rows","columns"].forEach(function(e){i(this,n);var a="data_"+e;a in t&&(s[e]=t[a])}.bind(this))),s.url&&e)!function(t,e,i,n,a){void 0===e&&(e="csv");var r=new XMLHttpRequest,s={csv:Se,tsv:ke,json:we};r.open("GET",t),i&&Object.keys(i).forEach((function(t){r.setRequestHeader(t,i[t])})),r.onreadystatechange=function(){if(4===r.readyState){if(200!==r.status)throw new Error(t+": Something went wrong loading!");var i=r.responseText;i&&a.call(this,s[e]("json"===e?JSON.parse(i):i,n))}},r.send()}(s.url,s.mimeType,s.headers,Ce(s.keys,a),e);else if(s.json)_e(r,we,e,[ye,Te])(s.json,Ce(s.keys,a));else if(s.rows)_e(r,Te,e)(s.rows);else if(s.columns)_e(r,ye,e)(s.columns);else if(t.bindto)throw Error("url or json or rows or columns is required.")},convertDataToTargets:function(t,e){var n=this,a=this,r=a.axis,s=a.config,o=a.state,l=s.data_type,c=!1,d=!1,u=!1;r&&(c=r.isCategorized(),d=r.isTimeSeries(),u=r.isCustomX());var h,g=Object.keys(t[0]||{}),f=g.length?g.filter(a.isNotX,a):[],p=g.length?g.filter(a.isX,a):[];f.forEach(function(r){var o=this;i(this,n);var l=this.getXKey(r);u||d?p.indexOf(l)>=0?h=(e&&a.data.xs[r]||[]).concat(t.map(function(t){return i(this,o),t[l]}.bind(this)).filter(S).map(function(t,e){return i(this,o),a.generateTargetX(t,r,e)}.bind(this))):s.data_x?h=this.getOtherTargetXs():$(s.data_xs)&&(h=a.getXValuesOfXKey(l,a.data.targets)):h=t.map(function(t,e){return i(this,o),e}.bind(this)),h&&(this.data.xs[r]=h)}.bind(this)),f.forEach(function(t){if(i(this,n),!this.data.xs[t])throw new Error('x is not defined for id = "'+t+'".')}.bind(this));var v=f.map(function(e,r){var l=this;i(this,n);var d=s.data_idConverter.bind(a.api)(e),h=a.getXKey(e),g=u&&c,f=g&&t.map(function(t){return i(this,l),t.x}.bind(this)).every(function(t){return i(this,l),s.axis_x_categories.indexOf(t)>-1}.bind(this)),p=t.__append__,v=null===h&&p?a.api.data.values(e).length:0;return{id:d,id_org:e,values:t.map(function(t,n){i(this,l);var c,u=t[h],x=t[e];return x=null===x||isNaN(x)||F(x)?X(x)||F(x)?x:null:+x,!g&&!o.hasRadar||0!==r||E(u)?c=a.generateTargetX(u,e,v+n):(f||0!==r||0!==n||p||(s.axis_x_categories=[]),-1===(c=s.axis_x_categories.indexOf(u))&&(c=s.axis_x_categories.length,s.axis_x_categories.push(u))),(E(x)||a.data.xs[e].length<=n)&&(c=void 0),{x:c,value:x,id:d,index:-1}}.bind(this)).filter(function(t){return i(this,l),L(t.x)}.bind(this))}}.bind(this));if(v.forEach(function(t){var e,r=this;i(this,n),s.data_xSort&&(t.values=t.values.sort(function(t,e){return i(this,r),(t.x||0===t.x?t.x:1/0)-(e.x||0===e.x?e.x:1/0)}.bind(this))),t.values.forEach(function(t,e){return i(this,r),t.index=e}.bind(this)),null==(e=a.data.xs[t.id])||e.sort(function(t,e){return i(this,r),t-e}.bind(this))}.bind(this)),o.hasNegativeValue=a.hasNegativeValueInTargets(v),o.hasPositiveValue=a.hasPositiveValueInTargets(v),l&&a.isValidChartType(l)){var x=a.mapToIds(v).filter(function(t){return i(this,n),!(t in s.data_types)||!a.isValidChartType(s.data_types[t])}.bind(this));a.setTargetType(x,l)}return v.forEach(function(t){return i(this,n),a.cache.add(t.id_org,t,!0)}.bind(this)),v}},Ee={isX:function(t){var e=this.config,n=e.data_x&&t===e.data_x,a=$(e.data_xs)&&function(t,e){var n=this,a=!1;return Object.keys(t).forEach(function(r){return i(this,n),t[r]===e&&(a=!0)}.bind(this)),a}(e.data_xs,t);return n||a},isNotX:function(t){return!this.isX(t)},isStackNormalized:function(){var t=this.config;return!(!t.data_stack_normalize||!t.data_groups.length)},isGrouped:function(t){var e=this,n=this.config.data_groups;return t?n.some(function(n){return i(this,e),n.indexOf(t)>=0&&n.length>1}.bind(this)):n.length>0},getXKey:function(t){var e=this.config;return e.data_x?e.data_x:$(e.data_xs)?e.data_xs[t]:null},getXValuesOfXKey:function(t,e){var n,a=this,r=this;return(e&&$(e)?r.mapToIds(e):[]).forEach(function(e){i(this,a),r.getXKey(e)===t&&(n=r.data.xs[e])}.bind(this)),n},getIndexByX:function(t,e){return e?e.indexOf(C(t)?t:+t):(this.filterByX(this.data.targets,t)[0]||{index:null}).index},getXValue:function(t,e){var i=this;return t in i.data.xs&&i.data.xs[t]&&S(i.data.xs[t][e])?i.data.xs[t][e]:e},getOtherTargetXs:function(){var t=Object.keys(this.data.xs);return t.length?this.data.xs[t[0]]:null},getOtherTargetX:function(t){var e=this.getOtherTargetXs();return e&&t1?e=rt(it(e=e.map(function(e){return i(this,t),e.values}.bind(this)).reduce(function(e,n){return i(this,t),e.concat(n)}.bind(this)).map(function(e){return i(this,t),e.x}.bind(this)))).map(function(e,n,r){return i(this,t),{x:e,index:a?r.length-n-1:n}}.bind(this)):n&&(e=e[0].values.concat()),e},mapToIds:function(t){var e=this;return t.map(function(t){return i(this,e),t.id}.bind(this))},mapToTargetIds:function(t){return t?X(t)?t.concat():[t]:this.mapToIds(this.data.targets)},hasTarget:function(t,e){for(var i,n=this.mapToIds(t),a=0;i=n[a];a++)if(i===e)return!0;return!1},isTargetToShow:function(t){return this.state.hiddenTargetIds.indexOf(t)<0},isLegendToShow:function(t){return this.state.hiddenLegendIds.indexOf(t)<0},filterTargetsToShow:function(t){var e=this,n=this;return(t||n.data.targets).filter(function(t){return i(this,e),n.isTargetToShow(t.id)}.bind(this))},mapTargetsToUniqueXs:function(t){var e=this,n=this.axis,a=[];return null!=t&&t.length&&(a=it(nt(t.map(function(t){var n=this;return i(this,e),t.values.map(function(t){return i(this,n),+t.x}.bind(this))}.bind(this)))),a=null!=n&&n.isTimeSeries()?a.map(function(t){return i(this,e),new Date(+t)}.bind(this)):a.map(Number)),rt(a)},addTargetIds:function(t,e){var n=this,a=this.state;(X(e)?e:[e]).forEach(function(e){i(this,n),a[t].indexOf(e)<0&&a[t].push(e)}.bind(this))},removeTargetIds:function(t,e){var n=this,a=this.state;(X(e)?e:[e]).forEach(function(e){i(this,n);var r=a[t].indexOf(e);r>=0&&a[t].splice(r,1)}.bind(this))},addHiddenTargetIds:function(t){this.addTargetIds("hiddenTargetIds",t)},removeHiddenTargetIds:function(t){this.removeTargetIds("hiddenTargetIds",t)},addHiddenLegendIds:function(t){this.addTargetIds("hiddenLegendIds",t)},removeHiddenLegendIds:function(t){this.removeTargetIds("hiddenLegendIds",t)},getValuesAsIdKeyed:function(t){var e=this,n=this,a=n.state.hasAxis,r={},s=n.isMultipleX(),o=s?n.mapTargetsToUniqueXs(t).map(function(t){return i(this,e),C(t)?t:+t}.bind(this)):null;return t.forEach(function(t){var l=this;i(this,e);var c=[];t.values.filter(function(t){var e=t.value;return i(this,l),S(e)||null===e}.bind(this)).forEach(function(t){i(this,l);var e=t.value;null!==e&&n.isCandlestickType(t)&&(e=X(e)?e.slice(0,4):[e.open,e.high,e.low,e.close]),X(e)?c.push.apply(c,e):F(e)&&"high"in e?c.push.apply(c,Object.values(e)):n.isBubbleZType(t)?c.push(a&&n.getBubbleZData(e,"y")):s?c[n.getIndexByX(t.x,o)]=e:c.push(e)}.bind(this)),r[t.id]=c}.bind(this)),r},checkValueInTargets:function(t,e){for(var i,n=Object.keys(t),a=0;a1},hasNegativeValueInTargets:function(t){var e=this;return this.checkValueInTargets(t,function(t){return i(this,e),t<0}.bind(this))},hasPositiveValueInTargets:function(t){var e=this;return this.checkValueInTargets(t,function(t){return i(this,e),t>0}.bind(this))},orderTargets:function(t){var e=[].concat(t),i=this.getSortCompareFn();return i&&e.sort(i),e},getSortCompareFn:function(t){var e=this;void 0===t&&(t=!1);var n,a=this.config.data_order,r=/asc/i.test(a),s=/desc/i.test(a);if(r||s){var o=function(t,n){return i(this,e),t+Math.abs(n.value)}.bind(this);n=function(n,a){i(this,e);var s="values"in n?n.values.reduce(o,0):n.value,l="values"in a?a.values.reduce(o,0):a.value;return t?r?s-l:l-s:r?l-s:s-l}.bind(this)}else k(a)&&(n=a.bind(this.api));return n||null},filterByX:function(t,e){var n=this;return nt(t.map(function(t){return i(this,n),t.values}.bind(this))).filter(function(t){return i(this,n),t.x-e==0}.bind(this))},filterRemoveNull:function(t){var e=this;return t.filter(function(t){return i(this,e),S(this.getBaseValue(t))}.bind(this))},filterByXDomain:function(t,e){var n=this;return t.map(function(t){var a=this;return i(this,n),{id:t.id,id_org:t.id_org,values:t.values.filter(function(t){return i(this,a),e[0]<=t.x&&t.x<=e[1]}.bind(this))}}.bind(this))},hasDataLabel:function(){var t=this.config.data_labels;return O(t)&&t||z(t)&&$(t)},getDataIndexFromEvent:function(t){var e=this.config,i=this.state,n=i.inputType,a=i.eventReceiver,r=a.coords,s=a.rect,o=e.axis_rotated,l="touch"===n&&t.changedTouches?t.changedTouches[0]:t;return q(r,o?l.clientY-s.top:l.clientX-s.left,0,r.length-1,o)},getDataLabelLength:function(t,e,n){var a=this,r=this,s=[0,0];return r.$el.chart.select("svg").selectAll(".dummy").data([t,e]).enter().append("text").text(function(t){return i(this,a),r.dataLabelFormat(t.id)(t)}.bind(this)).each((function(t,e){s[e]=1.3*this.getBoundingClientRect()[n]})).remove(),s},isNoneArc:function(t){return this.hasTarget(this.data.targets,t.id)},isArc:function(t){return"data"in t&&this.hasTarget(this.data.targets,t.data.id)},findSameXOfValues:function(t,e){var i,n=t[e].x,a=[];for(i=e-1;i>=0&&n===t[i].x;i--)a.push(t[i]);for(i=e;i=0&&n?n[a]:void 0}return n?n[e]:n},setRatioForGroupedData:function(t){var e=this,n=this;if(n.config.data_groups.length&&t.some(function(t){return i(this,e),n.isGrouped(t.id)}.bind(this))){var a=function(t){return i(this,e),n.getRatio("index",t,!0)}.bind(this);t.forEach(function(t){i(this,e),"values"in t?t.values.forEach(a):a(t)}.bind(this))}},getRatio:function(t,e,n){var a=this;void 0===n&&(n=!1);var r=this,s=r.config,o=r.state,l=r.api,c=0;if(e&&l.data.shown().length)if(c=e.ratio||e.value,"arc"===t)if(r.pie.padAngle()())c=e.value/r.getTotalDataSum(!0);else{var d=s.gauge_fullCircle?r.getArcLength():-2*r.getGaugeStartAngle(),u=r.hasType("gauge")?d:2*Math.PI;c=(e.endAngle-e.startAngle)/u}else if("index"===t){var h=l.data.values.bind(l),g=this.getTotalPerIndex();if(o.hiddenTargetIds.length){var f=h(o.hiddenTargetIds,!1);f.length&&(f=f.reduce(function(t,e){var n=this;return i(this,a),t.map(function(t,a){return i(this,n),(R(t)?t:0)+e[a]}.bind(this))}.bind(this)),g=g.map(function(t,e){return i(this,a),t-f[e]}.bind(this)))}var p=g[e.index];e.ratio=R(e.value)&&g&&p?e.value/p:0,c=e.ratio}else if("radar"===t)c=parseFloat(Math.max(e.value,0)+"")/o.current.dataMax*s.radar_size_ratio;else if("bar"===t){var v=r.getYScaleById.bind(r)(e.id).domain().reduce(function(t,e){return i(this,a),e-t}.bind(this));c=0===v?0:Math.abs(e.value)/v}else"treemap"===t&&(c/=r.getTotalDataSum(!0));return n&&c?100*c:c},updateDataIndexByX:function(t){var e=this,n=t.reduce(function(t,n,a){return i(this,e),t[+n.x]=a,t}.bind(this),{});this.data.targets.forEach(function(t){var a=this;i(this,e),t.values.forEach(function(t,e){i(this,a);var r=n[+t.x];void 0===r&&(r=e),t.index=r}.bind(this))}.bind(this))},isBubbleZType:function(t){return this.isBubbleType(t)&&(F(t.value)&&("z"in t.value||"y"in t.value)||X(t.value)&&t.value.length>=2)},isBarRangeType:function(t){var e=this,n=t.value;return this.isBarType(t)&&X(n)&&n.length>=2&&n.every(function(t){return i(this,e),R(t)}.bind(this))},getDataById:function(t){var e,i=this.cache.get(t)||this.api.data(t);return null!=(e=null==i?void 0:i[0])?e:i}};function Le(t,e){void 0===e&&(e=!1);var i=this.api;e&&this.api.flush(!0),null==t||t.call(i)}var Oe={load:function(t,e){var n=this,a=this,r=a.data,s=e.append,o=t;o&&(e.filter&&(o=o.filter(e.filter)),(e.type||e.types)&&o.forEach(function(t){var r;i(this,n);var s=(null==(r=e.types)?void 0:r[t.id])||e.type;a.setTargetType(t.id,s)}.bind(this)),r.targets.forEach(function(t){i(this,n);for(var e=0;e=0?Gt.focused:"")},classDefocused:function(t){return" "+(this.state.defocusedTargetIds.indexOf(t.id)>=0?Gt.defocused:"")},getTargetSelectorSuffix:function(t){return(t||0===t?"-"+t:"").replace(/([\s?!@#$%^&*()_=+,.<>'":;\[\]\/|~`{}\\])/g,"-")},selectorTarget:function(t,e,i){void 0===e&&(e=""),void 0===i&&(i="");var n=this.getTargetSelectorSuffix(t);return e+"."+(Gt.target+n)+" "+i+", "+e+"."+(Gt.circles+n)+" "+i},selectorTargets:function(t,e){var n=this,a=t||[];return a.length?a.map(function(t){return i(this,n),this.selectorTarget(t,e)}.bind(this)):null},selectorLegend:function(t){return"."+(Gt.legendItem+this.getTargetSelectorSuffix(t))},selectorLegends:function(t){var e=this;return null!=t&&t.length?t.map(function(t){return i(this,e),this.selectorLegend(t)}.bind(this)):null}},ze=p(6),Me=function(t,e,n){i(this,undefined);var r=(0,a.select)(t.cloneNode(!0));return r.attr("id",n).insert("rect",":first-child").attr("width",r.attr("width")).attr("height",r.attr("height")).style("fill",e),{id:n,node:r.node()}}.bind(void 0);var $e=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],Xe={generateColor:function(){var t=this,e=this,n=e.$el,a=e.config,r=a.data_colors,s=a.data_color,o=[],l=$(a.color_pattern)?a.color_pattern:(0,ze.scaleOrdinal)(function(t){var e=this,n=re,a=h.body,r=a[n];if(!r){var s=t.classed(wt.colorPattern,!0).style("background-image");t.classed(wt.colorPattern,!1),s.indexOf(";")>-1&&(r=s.replace(/url[^#]*|["'()]|(\s|%20)/g,"").split(";").map(function(t){return i(this,e),t.trim().replace(/[\"'\s]/g,"")}.bind(this)).filter(Boolean),a[n]=r)}return r}(n.chart)||$e).range(),c=l;if(k(a.color_tiles)){var d=a.color_tiles.bind(e.api)(),u=l.map(function(n,a){i(this,t);var r=n.replace(/[#\(\)\s,]/g,""),s=e.state.datetimeId+"-pattern-"+r+"-"+a;return Me(d[a%d.length],n,s)}.bind(this));l=u.map(function(e){return i(this,t),"url(#"+e.id+")"}.bind(this)),e.patterns=u}return function(t){var i,n,d=t.id||(null==(i=t.data)?void 0:i.id)||t,u=e.isTypeOf(d,["line","spline","step"])||!a.data_types[d];return k(r[d])?n=r[d].bind(e.api)(t):r[d]?n=r[d]:(o.indexOf(d)<0&&o.push(d),n=u?c[o.indexOf(d)%c.length]:l[o.indexOf(d)%l.length],r[d]=n),k(s)?s.bind(e.api)(n,t):n}},generateLevelColor:function(){var t=this.config,e=t.color_pattern,i=t.color_threshold,n="value"===i.unit,a=i.max||100,r=i.values&&i.values.length?i.values:[];return $(i)?function(t){for(var i=n?t:100*t/a,s=e[e.length-1],o=0,l=r.length;o')}.bind(this))}},getGradienColortUrl:function(t){return"url(#"+this.state.datetimeId+"-gradient"+this.getTargetSelectorSuffix(t)+")"},updateLinearGradient:function(){var t=this,e=this,n=e.config,a=e.data.targets,r=e.state.datetimeId,s=e.$el.defs;a.forEach(function(a){var o=this;i(this,t);var l=r+"-gradient"+e.getTargetSelectorSuffix(a.id),c=e.isAreaType(a)?"area":e.isBarType(a)&&"bar",d=n.axis_rotated;if(c&&s.select("#"+l).empty()){var u=e.color(a),h=n[c+"_linearGradient"],g=h.x,f=void 0===g?d?[1,0]:[0,0]:g,p=h.y,v=void 0===p?d?[0,0]:[0,1]:p,x=h.stops,b=void 0===x?[[0,u,1],[1,u,0]]:x,_=s.append("linearGradient").attr("id",""+l).attr("x1",f[0]).attr("x2",f[1]).attr("y1",v[0]).attr("y2",v[1]);b.forEach(function(t){i(this,o);var n=k(t[1])?t[1].bind(e.api)(a.id):t[1];_.append("stop").attr("offset",t[0]).attr("stop-color",n||u).attr("stop-opacity",t[2])}.bind(this))}}.bind(this))},setOverColor:function(t,e){var n=this,a=this,r=a.config,s=a.$el.main,o=r.color_onover,l=t?o:a.color;F(l)?l=function(t){var e=t.id;return i(this,n),e in o?o[e]:a.color(e)}.bind(this):C(l)?l=function(){return i(this,n),o}.bind(this):k(o)&&(l=l.bind(a.api)),s.selectAll(F(e)?"."+xt.arc+a.getTargetSelectorSuffix(e.id):"."+Mt.shape+"-"+e).style("fill",l)}},Fe={getYDomainMinMax:function(t,e){var n=this,a=this,r=a.axis,s=a.config,o="min"===e,l=s.data_groups,c=a.mapToIds(t),d=a.getValuesAsIdKeyed(t);if(l.length>0){var u=a["has"+(o?"Negative":"Positive")+"ValueInTargets"](t);l.forEach(function(t){var e=this;i(this,n);var a=t.filter(function(t){return i(this,e),c.indexOf(t)>=0}.bind(this));if(a.length){var s=a[0],l=r.getId(s);u&&d[s]&&(d[s]=d[s].map(function(t){return i(this,e),(o?t<0:t>0)?t:0}.bind(this))),a.filter(function(t,n){return i(this,e),n>0}.bind(this)).forEach(function(t){var n=this;if(i(this,e),d[t]){var a=r.getId(t);d[t].forEach(function(t,e){i(this,n);var r=+t;a!==l||u&&(o?r>0:r<0)||(d[s][e]+=r)}.bind(this))}}.bind(this))}}.bind(this))}return st(e,Object.keys(d).map(function(t){return i(this,n),st(e,d[t])}.bind(this)))},isHiddenTargetWithYDomain:function(t){var e=this,n=this;return n.state.hiddenTargetIds.some(function(a){return i(this,e),n.axis.getId(a)===t}.bind(this))},getYDomain:function(t,e,n){var a=this,r=this,s=r.axis,o=r.config,l=r.scale,c="axis_"+e;if(r.isStackNormalized())return[0,100];var d=(null==l?void 0:l[e])&&"log"===l[e].type,u=t.filter(function(t){return i(this,a),s.getId(t.id)===e}.bind(this)),h=n?r.filterByXDomain(u,n):u;if(0===h.length)return r.isHiddenTargetWithYDomain(e)?l[e].domain():"y2"===e?l.y.domain():r.getYDomain(t,"y2",n);var f=o[c+"_min"],p=o[c+"_max"],v=o[c+"_center"],b=o[c+"_inverted"],_=r.hasDataLabel()&&o.axis_rotated,m=r.hasDataLabel()&&!o.axis_rotated,y=r.getYDomainMinMax(h,"min"),T=r.getYDomainMinMax(h,"max"),w=[g.BAR,g.BUBBLE,g.SCATTER].concat(x.Line).some(function(t){i(this,a);var e=t.indexOf("area")>-1?"area":t;return r.hasType(t,h,!0)&&o[e+"_zerobased"]}.bind(this));y=S(f)?f:S(p)?y<=p?y:p-10:y,T=S(p)?p:S(f)?f<=T?T:f+10:T,isNaN(y)&&(y=0),isNaN(T)&&(T=y),y===T&&(y<0?T=0:y=0);var A=y>=0&&T>=0,k=y<=0&&T<=0;(S(f)&&A||S(p)&&k)&&(w=!1),w&&(A&&(y=0),k&&(T=0));var C=Math.abs(T-y),R={top:.1*C,bottom:.1*C};if(L(v)){var E=Math.max(Math.abs(y),Math.abs(T));T=v+E,y=v-E}if(_){var O=D(l.y.range()),P=r.getDataLabelLength(y,T,"width").map(function(t){return i(this,a),t/O}.bind(this));["bottom","top"].forEach(function(t,e){i(this,a),R[t]+=C*(P[e]/(1-P[0]-P[1]))}.bind(this))}else if(m){var I=r.getDataLabelLength(y,T,"height");["bottom","top"].forEach(function(t,e){i(this,a),R[t]+=r.convertPixelToScale("y",I[e],C)}.bind(this))}R=r.getResettedPadding(R);var z=o[c+"_padding"];$(z)&&["bottom","top"].forEach(function(t){i(this,a),R[t]=s.getPadding(z,t,R[t],C)}.bind(this)),w&&(A&&(R.bottom=y),k&&(R.top=-T));var M=d?[y,T].map(function(t){return i(this,a),t<0?0:t}.bind(this)):[y-R.bottom,T+R.top];return b?M.reverse():M},getXDomainMinMax:function(t,e){var n,a=this,r=this.config["axis_x_"+e],s=st(e,t.map(function(t){var n=this;return i(this,a),st(e,t.values.map(function(t){return i(this,n),t.x}.bind(this)))}.bind(this))),o=F(r)?r.value:r;return o=L(o)&&null!=(n=this.axis)&&n.isTimeSeries()?dt.bind(this)(o):o,F(r)&&r.fit&&("min"===e&&os)&&(o=void 0),L(o)?o:s},getXDomainPadding:function(t,e){var i,n=this,a=n.axis,r=n.config.axis_x_padding,s=a.isTimeSeries()&&e,o=D(t);if(a.isCategorized()||s)i=0;else if(n.hasType("bar")){var l=n.getMaxDataCount();i=l>1?o/(l-1)/2:.5}else i=n.getResettedPadding(.01*o);var c=R(r)?{left:r,right:r}:r,d=c.left,u=void 0===d?i:d,h=c.right,g=void 0===h?i:h;if("px"===r.unit){var f=Math.abs(o+.2*o);u=a.getPadding(r,"left",i,f),g=a.getPadding(r,"right",i,f)}else{var p=o+u+g;if(s&&p){var v=o/e/p;u=u/p/v,g=g/p/v}}return{left:u,right:g}},getXDomain:function(t){var e=this,i=e.axis,n=e.config,a=e.scale.x,r=n.axis_x_inverted,s=[e.getXDomainMinMax(t,"min"),e.getXDomainMinMax(t,"max")],o=s[0],l=void 0===o?0:o,c=s[1],d=void 0===c?0:c;if("log"!==a.type){var u=i.isCategorized(),h=i.isTimeSeries(),g=e.getXDomainPadding(s),f=s[0],p=s[1];f-p!=0||u||(h?(f=new Date(.5*f.getTime()),p=new Date(1.5*p.getTime())):(f=0===f?1:.5*f,p=0===p?-1:1.5*p)),(f||0===f)&&(l=h?new Date(f.getTime()-g.left):f-g.left),(p||0===p)&&(d=h?new Date(p.getTime()+g.right):p+g.right)}return r?[d,l]:[l,d]},updateXDomain:function(t,e,i,n,a){var r,s=this,o=s.config,l=s.org,c=s.scale,d=c.x,u=c.subX,h=o.zoom_enabled;i&&(d.domain(a||rt(s.getXDomain(t),!o.axis_x_inverted)),l.xDomain=d.domain(),h&&s.zoom.updateScaleExtent(),u.domain(d.domain()),null==(r=s.brush)||r.scale(u));if(e){var g=a||!s.brush||K(s)?l.xDomain:W(s).map(u.invert);d.domain(g),h&&s.zoom.updateScaleExtent()}return n&&d.domain(s.trimXDomain(d.orgDomain())),d.domain()},trimXDomain:function(t){var e=this.config.axis_x_inverted,i=this.getZoomDomain(),n=i[0],a=i[1];return(e?t[0]>=n:t[0]<=n)&&(t[0]=n,t[1]=+t[1]+(n-t[0])),(e?t[1]<=a:t[1]>=a)&&(t[0]=+t[0]-(t[1]-a),t[1]=a),t},getZoomDomain:function(){var t=this.config,e=this.org.xDomain,i=e[0],n=e[1];return L(t.zoom_x_min)&&(i=st("min",[i,t.zoom_x_min])),L(t.zoom_x_max)&&(n=st("max",[n,t.zoom_x_max])),[i,n]},convertPixelToScale:function(t,e,i){var n=this.config,a=this.state,r=n.axis_rotated;return i*(e/a["x"===t?r?"height":"width":r?"width":"height"])}};function Be(t,e,i){var n=t.config,a="axis_"+e+"_tick_format";return(n[a]?n[a]:t.defaultValueFormat).call(t.api,i)}var Ne={yFormat:function(t){return Be(this,"y",t)},y2Format:function(t){return Be(this,"y2",t)},getDefaultValueFormat:function(){var t=this,e=t.defaultArcValueFormat,i=t.yFormat,n=t.y2Format,a=t.hasArcType(null,["gauge","polar","radar"]);return function(r,s,o){return(a?e:t.axis&&"y2"===t.axis.getId(o)?n:i).call(t,r,s)}},defaultValueFormat:function(t){return S(t)?+t:""},defaultArcValueFormat:function(t,e){return(100*e).toFixed(1)+"%"},defaultPolarValueFormat:function(t){return""+t},dataLabelFormat:function(t){var e=this,n=this.config.data_labels,a=function(t){return i(this,e),S(t)?+t:""}.bind(this),r=a;return k(n.format)?r=n.format:z(n.format)&&(r=n.format[t]?!0===n.format[t]?a:n.format[t]:function(){return i(this,e),""}.bind(this)),r.bind(this.api)}};function Ge(t){var e=this,i=e.getDataById(t);return e.levelColor?e.levelColor(i.values[0].value):e.color(i)}var je={initLegend:function(){var t=this,e=t.config,i=t.$el;t.legendItemTextBox={},t.state.legendHasRendered=!1,e.legend_show?(e.legend_contents_bindto||(i.legend=t.$el.svg.append("g").classed(kt.legend,!0).attr("transform",t.getTranslate("legend"))),t.updateLegend()):t.state.hiddenLegendIds=t.mapToIds(t.data.targets)},updateLegend:function(t,e,i){var n,a=this,r=a.config,s=a.state,o=a.scale,l=a.$el,c=e||{withTransform:!1,withTransitionForTransform:!1,withTransition:!1};c.withTransition=B(c,"withTransition",!0),c.withTransitionForTransform=B(c,"withTransitionForTransform",!0),r.legend_contents_bindto&&r.legend_contents_template?a.updateLegendTemplate():s.hasTreemap||a.updateLegendElement(t||a.mapToIds(a.data.targets),c,i),null==(n=l.legend)||n.selectAll("."+kt.legendItem).classed(kt.legendItemHidden,(function(t){var e=!a.isTargetToShow(t);return e&&(this.style.opacity=null),e})),a.updateScales(!1,!o.zoom),a.updateSvgSize(),a.transformAll(c.withTransitionForTransform,i),s.legendHasRendered=!0},updateLegendTemplate:function(){var t=this,e=this,n=e.config,r=e.$el,s=(0,a.select)(n.legend_contents_bindto),o=n.legend_contents_template;if(!s.empty()){var l=e.mapToIds(e.data.targets),c=[],d="";l.forEach(function(n){i(this,t);var a=k(o)?o.bind(e.api)(n,e.color(n),e.api.data(n)[0].values):ct(o,{COLOR:e.color(n),TITLE:n});a&&(c.push(n),d+=a)}.bind(this));var u=s.html(d).selectAll((function(){return this.childNodes})).data(c);e.setLegendItem(u),r.legend=s}},updateSizeForLegend:function(t){var e=this,i=e.config,n=e.state,a=n.isLegendTop,r=n.isLegendLeft,s=n.isLegendRight,o=n.isLegendInset,l=n.current,c=t.width,d=t.height,u={top:a?e.getCurrentPaddingTop()+i.legend_inset_y+5.5:l.height-d-e.getCurrentPaddingBottom()-i.legend_inset_y,left:r?e.getCurrentPaddingLeft()+i.legend_inset_x+.5:l.width-c-e.getCurrentPaddingRight()-i.legend_inset_x+.5};e.state.margin3={top:s?0:o?u.top:l.height-d,right:NaN,bottom:0,left:s?l.width-c:o?u.left:0}},transformLegend:function(t){var e=this,i=e.$el.legend;(0,e.$T)(i,t).attr("transform",e.getTranslate("legend"))},updateLegendStep:function(t){this.state.legendStep=t},updateLegendItemWidth:function(t){this.state.legendItemWidth=t},updateLegendItemHeight:function(t){this.state.legendItemHeight=t},updateLegendItemColor:function(t,e){var i=this.$el.legend;i&&i.select("."+kt.legendItem+"-"+t+" line").style("stroke",e)},getLegendWidth:function(){var t=this.state,e=t.current.width,i=t.isLegendRight,n=t.isLegendInset,a=t.legendItemWidth,r=t.legendStep;return this.config.legend_show?i||n?a*(r+1):e:0},getLegendHeight:function(){var t,e=this,i=e.state,n=i.current,a=i.isLegendRight,r=i.legendItemHeight,s=i.legendStep,o="fit"===(null==(t=e.config.padding)?void 0:t.mode);return e.config.legend_show?a?n.height:(o?10:Math.max(20,r))*(s+1):0},opacityForUnfocusedLegend:function(t){return t.classed(kt.legendItemHidden)?null:"0.3"},toggleFocusLegend:function(t,e){var n=this,r=this,s=r.$el.legend,o=r.$T,l=r.mapToTargetIds(t);s&&o(s.selectAll("."+kt.legendItem).filter(function(t){return i(this,n),l.indexOf(t)>=0}.bind(this)).classed(Et.legendItemFocused,e)).style("opacity",(function(){return e?null:r.opacityForUnfocusedLegend.call(r,(0,a.select)(this))}))},revertLegend:function(){var t=this.$el.legend,e=this.$T;t&&e(t.selectAll("."+kt.legendItem).classed(Et.legendItemFocused,!1)).style("opacity",null)},showLegend:function(t){var e=this,i=e.config,n=e.$el,a=e.$T;i.legend_show||(i.legend_show=!0,n.legend?n.legend.style("visibility",null):e.initLegend(),e.state.legendHasRendered||e.updateLegend()),e.removeHiddenLegendIds(t),a(n.legend.selectAll(e.selectorLegends(t)).style("visibility",null)).style("opacity",null)},hideLegend:function(t){var e=this,i=e.config,n=e.$el.legend;i.legend_show&&M(t)&&(i.legend_show=!1,n.style("visibility","hidden")),e.addHiddenLegendIds(t),n.selectAll(e.selectorLegends(t)).style("opacity","0").style("visibility","hidden")},getLegendItemTextBox:function(t,e){var i,n=this,a=n.cache,r=n.state,s=ce;return t&&((i=!r.redrawing&&a.get(s)||{})[t]||(i[t]=n.getTextRect(e,kt.legendItem),a.add(s,i)),i=i[t]),i},setLegendItem:function(t){var e=this,n=this,r=n.$el,s=n.api,o=n.config,l=n.state,c="touch"===l.inputType,d=n.hasType("gauge"),u=o.boost_useCssRule,h=o.legend_item_interaction;t.attr("class",(function(t){var e=(0,a.select)(this);return(!e.empty()&&e.attr("class")||"")+n.generateClass(kt.legendItem,t)})).style("visibility",function(t){return i(this,e),n.isLegendToShow(t)?null:"hidden"}.bind(this)),o.interaction_enabled&&(u&&[["."+kt.legendItem,"cursor:pointer"],["."+kt.legendItem+" text","pointer-events:none"],["."+kt.legendItemPoint+" text","pointer-events:none"],["."+kt.legendItemTile,"pointer-events:none"],["."+kt.legendItemEvent,"fill-opacity:0"]].forEach(function(t){i(this,e);var a=t[0],s=t[1];n.setCssRule(!1,a,[s])(r.legend)}.bind(this)),t.on(h.dblclick?"dblclick":"click",h||k(o.legend_item_onclick)?function(t,e){if(!N(o.legend_item_onclick,s,e)){var i=t.altKey,r=t.target;"dblclick"===t.type||i?l.hiddenTargetIds.length&&-1===r.parentNode.getAttribute("class").indexOf(kt.legendItemHidden)?s.show():(s.hide(),s.show(e)):(s.toggle(e),(0,a.select)(this).classed(Et.legendItemFocused,!1))}c&&n.hideTooltip()}:null),c||t.on("mouseout",h||k(o.legend_item_onout)?function(t,e){N(o.legend_item_onout,s,e)||((0,a.select)(this).classed(Et.legendItemFocused,!1),d&&n.undoMarkOverlapped(n,"."+St.gaugeValue),n.api.revert())}:null).on("mouseover",h||k(o.legend_item_onover)?function(t,e){N(o.legend_item_onover,s,e)||((0,a.select)(this).classed(Et.legendItemFocused,!0),d&&n.markOverlapped(e,n,"."+St.gaugeValue),!l.transiting&&n.isTargetToShow(e)&&s.focus(e))}:null),!t.empty()&&t.on("click mouseout mouseover")&&t.style("cursor",n.getStylePropValue("pointer")))},updateLegendElement:function(t,e){var n,a,r,s=this,o=this,l=o.config,c=o.state,d=o.$el.legend,u=o.$T,h="circle"!==l.legend_item_tile_type,g=l.legend_item_tile_r,f={width:h?l.legend_item_tile_width:2*g,height:h?l.legend_item_tile_height:2*g},p={padding:{top:4,right:10},max:{width:0,height:0},posMin:10,step:0,tileWidth:f.width+5,totalLength:0},v={offsets:{},widths:{},heights:{},margins:[0],steps:{}},x=t.filter(function(t){return i(this,s),!L(l.data_names[t])||null!==l.data_names[t]}.bind(this)),b=e.withTransition,_=o.getUpdateLegendPositions(x,p,v);c.isLegendInset&&(p.step=l.legend_inset_step?l.legend_inset_step:x.length,o.updateLegendStep(p.step)),c.isLegendRight?(n=function(t){return i(this,s),p.max.width*v.steps[t]}.bind(this),a=function(t){return i(this,s),v.margins[v.steps[t]]+v.offsets[t]}.bind(this)):c.isLegendInset?(n=function(t){return i(this,s),p.max.width*v.steps[t]+10}.bind(this),a=function(t){return i(this,s),v.margins[v.steps[t]]+v.offsets[t]}.bind(this)):(n=function(t){return i(this,s),v.margins[v.steps[t]]+v.offsets[t]}.bind(this),a=function(t){return i(this,s),p.max.height*v.steps[t]}.bind(this));var m={xText:function(t,e){return i(this,s),n(t,e)+4+f.width}.bind(this),xRect:function(t,e){return i(this,s),n(t,e)}.bind(this),x1Tile:function(t,e){return i(this,s),n(t,e)-2}.bind(this),x2Tile:function(t,e){return i(this,s),n(t,e)-2+f.width}.bind(this),yText:function(t,e){return i(this,s),a(t,e)+9}.bind(this),yRect:function(t,e){return i(this,s),a(t,e)-5}.bind(this),yTile:function(t,e){return i(this,s),a(t,e)+4}.bind(this)};o.generateLegendItem(x,f,_,m),r=d.select("."+kt.legendBackground+" rect"),c.isLegendInset&&p.max.width>0&&0===r.size()&&(r=d.insert("g","."+kt.legendItem).attr("class",kt.legendBackground).append("rect")),u(d.selectAll("text").data(x).text(function(t){return i(this,s),L(l.data_names[t])?l.data_names[t]:t}.bind(this)).each((function(t,e){_(this,t,e)})),b).attr("x",m.xText).attr("y",m.yText),u(d.selectAll("rect."+kt.legendItemEvent).data(x),b).attr("width",function(t){return i(this,s),v.widths[t]}.bind(this)).attr("height",function(t){return i(this,s),v.heights[t]}.bind(this)).attr("x",m.xRect).attr("y",m.yRect),o.updateLegendItemPos(x,b,m),r&&u(r,b).attr("height",o.getLegendHeight()-12).attr("width",p.max.width*(p.step+1)+10),o.updateLegendItemWidth(p.max.width),o.updateLegendItemHeight(p.max.height),o.updateLegendStep(p.step)},getUpdateLegendPositions:function(t,e,n){var a=this,r=a.config,s=a.state,o=s.isLegendRight||s.isLegendInset;return function(l,c,d){var u,h=this,g=d===t.length-1,f=a.getLegendItemTextBox(c,l),p=f.width+e.tileWidth+(g&&!o?0:e.padding.right)+r.legend_padding,v=f.height+e.padding.top,x=o?v:p,b=o?a.getLegendHeight():a.getLegendWidth(),_=function(t,i){i||(u=(b-e.totalLength-x)/2)=e.max.width)&&(e.max.width=p),(!e.max.height||v>=e.max.height)&&(e.max.height=v);var m=o?e.max.height:e.max.width;r.legend_equally?(Object.keys(n.widths).forEach(function(t){return i(this,h),n.widths[t]=e.max.width}.bind(this)),Object.keys(n.heights).forEach(function(t){return i(this,h),n.heights[t]=e.max.height}.bind(this)),(u=(b-m*t.length)/2)1&&d&&(o&&(f+=d*o),g>2?f-=(g-1)*d/2:2===g&&(f-=d/2)),f}.bind(this)},getShapeY:function(t){var e=this,n=this,a=n.isStackNormalized();return function(r){i(this,e);var s=r.value;return R(r)?s=r:a?s=n.getRatio("index",r,!0):n.isBubbleZType(r)?s=n.getBubbleZData(r.value,"y"):n.isBarRangeType(r)&&(s=s[1]),n.getYScaleById(r.id,t)(s)}.bind(this)},getShapeYMin:function(t){var e=this,i=e.axis.getId(t),n=e.scale[i].domain()[0],a=e.config["axis_"+i+"_inverted"];return!e.isGrouped(t)&&!a&&n>0?n:0},getShapeOffsetData:function(t){var e=this,n=this,a=n.orderTargets(n.filterTargetsToShow(n.data.targets.filter(t,n))),r=n.isStackNormalized(),s=a.map(function(t){var a=this;i(this,e);var s=t.values,o={};n.isStepType(t)&&(s=n.convertValuesToStep(s));var l=s.reduce(function(t,e){i(this,a);var s=+e.x;return t[s]=e,o[s]=r?n.getRatio("index",e,!0):e.value,t}.bind(this),{});return{id:t.id,rowValues:s,rowValueMapByXValue:l,values:o}}.bind(this));return{indexMapByTargetId:a.reduce(function(t,n,a){var r=n.id;return i(this,e),t[r]=a,t}.bind(this),{}),shapeOffsetTargets:s}},getShapeOffset:function(t,e,n){var a=this,r=this,s=r.getShapeOffsetData(t),o=s.shapeOffsetTargets,l=s.indexMapByTargetId,c=r.config.data_groupsZeroAs;return function(t,s){var d=this;i(this,a);var u=t.id,h=t.value,g=t.x,f=r.getIndices(e,t),p=r.getYScaleById(u,n);if(r.isBarRangeType(t))return p(h[0]);var v=+g,x=p("zero"===c?0:r.getShapeYMin(u)),b=x;return o.filter(function(t){return i(this,d),t.id!==u&&f[t.id]===f[u]}.bind(this)).forEach(function(t){i(this,d);var e=t.id,n=t.rowValueMapByXValue,a=t.rowValues,r=t.values;if(l[e]=0&&R(g))(0!==h||("positive"===c&&g>0||"negative"===c&&g<0))&&(b+=p(g)-x)}}.bind(this)),b}.bind(this)},getBarW:function(t,e,n){var a=this,r=this,s=r.config,o=r.org,l=r.scale,c=r.getMaxDataCount(),d="bar"===t&&s.data_groups.length,u=t+"_width",h=l.zoom&&!r.axis.isCategorized()?o.xDomain.map(function(t){return i(this,a),l.zoom(t)}.bind(this)).reduce(function(t,e){return i(this,a),Math.abs(t)+e}.bind(this))/c:e.tickInterval(c),g=function(t){i(this,a);var e=t?s[u][t]:s[u],r=t?e.ratio:s[u+"_ratio"],o=t?e.max:s[u+"_max"],l=R(e)?e:n?h*r/n:0;return o&&l>o?o:l}.bind(this),f=g();return!d&&z(s[u])&&(f={_$width:f,_$total:[]},r.filterTargetsToShow(r.data.targets).forEach(function(t){i(this,a),s[u][t.id]&&(f[t.id]=g(t.id),f._$total.push(f[t.id]||f._$width))}.bind(this))),f},getShapeByIndex:function(t,e,n){var a=this,r=this.$el,s=S(e)?"-"+e:"",o=r[t];return o=o&&!o.empty()?o.filter(function(t){return i(this,a),!n||t.id===n}.bind(this)).filter(function(t){return i(this,a),!S(e)||t.index===e}.bind(this)):(n?r.main.selectAll("."+Gt[t+"s"]+this.getTargetSelectorSuffix(n)):r.main).selectAll("."+Gt[t]+s)},isWithinShape:function(t,e){var i,n=this,r=(0,a.select)(t);return n.isTargetToShow(e.id)?null!=n.hasValidPointType&&n.hasValidPointType(t.nodeName)?i=n.isStepType(e)?n.isWithinStep(t,n.getYScaleById(e.id)(e.value)):n.isWithinCircle(t,n.isBubbleType(e)?1.5*n.pointSelectR(e):0):"path"===t.nodeName&&(i=!r.classed(Gt.bar)||n.isWithinBar(t)):i=!1,i},getInterpolate:function(t){var e=this.getInterpolateType(t);return{basis:Ue.curveBasis,"basis-closed":Ue.curveBasisClosed,"basis-open":Ue.curveBasisOpen,bundle:Ue.curveBundle,cardinal:Ue.curveCardinal,"cardinal-closed":Ue.curveCardinalClosed,"cardinal-open":Ue.curveCardinalOpen,"catmull-rom":Ue.curveCatmullRom,"catmull-rom-closed":Ue.curveCatmullRomClosed,"catmull-rom-open":Ue.curveCatmullRomOpen,"monotone-x":Ue.curveMonotoneX,"monotone-y":Ue.curveMonotoneY,natural:Ue.curveNatural,"linear-closed":Ue.curveLinearClosed,linear:Ue.curveLinear,step:Ue.curveStep,"step-after":Ue.curveStepAfter,"step-before":Ue.curveStepBefore}[e]},getInterpolateType:function(t){var e=this,i=e.config,n=i.spline_interpolation_type,a=e.isInterpolationType(n)?n:"cardinal";return e.isSplineType(t)?a:e.isStepType(t)?i.line_step_type:"linear"},isWithinBar:function(t){var e=H(this.state.event,t),i=Y(t),n=i[0],a=i[1],r=Math.min(n.x,a.x),s=Math.min(n.y,a.y),o=this.config.bar_sensitivity,l=t.getBBox(),c=l.width,d=l.height;return r-o0?i:320/(t.hasType("gauge")&&!e.gauge_fullCircle?2:1)},getCurrentPaddingTop:function(){var t=this,e=t.config,i=t.state.hasAxis,n=t.$el,a=i?e.axis_y2_axes.length:0,r=S(e.padding_top)?e.padding_top:0;return n.title&&n.title.node()&&(r+=t.getTitlePadding()),a&&e.axis_rotated&&(r+=t.getHorizontalAxisHeight("y2")*a),r},getCurrentPaddingBottom:function(){var t=this,e=t.config,i=t.state.hasAxis,n=e.axis_rotated?"y":"x",a=i?e["axis_"+n+"_axes"].length:0;return(S(e.padding_bottom)?e.padding_bottom:0)+(a?t.getHorizontalAxisHeight(n)*a:0)},getCurrentPaddingLeft:function(t){var e,i=this,n=i.config,a=i.state.hasAxis,r=n.axis_rotated,s="fit"===(null==(e=n.padding)?void 0:e.mode),o=r?"x":"y",l=a?n["axis_"+o+"_axes"].length:0,c=a?i.getAxisWidthByAxisId(o,t):0;s||(c=P(c));var d=n["axis_"+o+"_inner"]||!n["axis_"+o+"_show"]?0:c;return S(n.padding_left)?d=n.padding_left+(s&&r?c:0):a&&r&&(d=n.axis_x_show?s?c:Math.max(c,40):1),a&&(s||n["axis_"+o+"_inner"])&&n["axis_"+o+"_label"].text&&(d+=i.axis.getAxisLabelPosition("y").isOuter?20:0),d+c*l},getCurrentPaddingRight:function(t){var e,i;void 0===t&&(t=!1);var n=this,a=n.config,r=n.state.hasAxis,s=a.axis_rotated,o="fit"===(null==(e=a.padding)?void 0:e.mode),l=o?2:10,c=n.state.isLegendRight?n.getLegendWidth()+20:0,d=r?a.axis_y2_axes.length:0,u=null!=(i=n.axis)&&i.getAxisLabelPosition("y2").isOuter?20:0,h=t?n.axis.getXAxisTickTextY2Overflow(l):0,g=r&&!a.axis_y2_inner?n.getAxisWidthByAxisId("y2"):1;o||(g=P(g));var f=s?0:Math.max(g+c,h);return S(a.padding_right)?f=a.padding_right+(o&&(s||!a.axis_y2_show?l:f))+(r&&!o?1:0):n.axis&&s?f=l+c:!n.axis||a.axis_y2_show&&!a.axis_y2_inner||(f=Math.max((o&&!a.axis_y2_show?2:1)+c+u,h)),r&&!s&&o&&a.axis_y2_show&&!a.axis_y2_inner&&a.axis_y2_label.text&&(f+=u),f+g*d},getParentRectValue:function(t){for(var e="offset"+Q(t),i=this.$el.chart.node(),n=0;n<30&&i&&"BODY"!==i.tagName;){try{n=i.getBoundingClientRect()[t]}catch(t){e in i&&(n=i[e])}i=i.parentNode}var a=h.body[e];return n>a&&(n=a),n},getParentWidth:function(){return this.getParentRectValue("width")},getParentHeight:function(){var t=this.$el.chart.style("height"),e=0;return t&&(e=/px$/.test(t)?parseInt(t,10):this.getParentRectValue("height")),e},getSvgLeft:function(t){var e=this,i=e.config,n=e.$el,a=i.axis_rotated||!i.axis_rotated&&!i.axis_y_inner,r=i.axis_rotated?_t.axisX:_t.axisY,s=n.main.select("."+r).node(),o=s&&a?s.getBoundingClientRect():{right:0},l=n.chart.node().getBoundingClientRect(),c=e.hasArcType(),d=o.right-l.left-(c?0:e.getCurrentPaddingLeft(t));return d>0?d:0},updateDimension:function(t){var e,i=this,n=i.config,a=i.state.hasAxis,r=i.$el;a&&!t&&i.axis.x&&n.axis_rotated&&(null==(e=i.axis.subX)||e.create(r.axis.subX));i.updateScales(t),i.updateSvgSize(),i.transformAll(!1)},updateSvgSize:function(){var t=this,e=t.state,i=e.clip,n=e.current,a=e.hasAxis,r=e.width,s=e.height,o=t.$el.svg;if(o.attr("width",n.width).attr("height",n.height),a){var l=o.select("."+$t.brush+" .overlay"),c={width:0,height:0};l.size()&&(c.width=+l.attr("width"),c.height=+l.attr("height")),o.selectAll(["#"+i.id,"#"+i.idGrid]).select("rect").attr("width",r).attr("height",s),o.select("#"+i.idXAxis).select("rect").call(t.setXAxisClipPath.bind(t)),o.select("#"+i.idYAxis).select("rect").call(t.setYAxisClipPath.bind(t)),i.idSubchart&&o.select("#"+i.idSubchart).select("rect").attr("width",r).attr("height",c.height)}},getCurrentPadding:function(){var t=this;return{top:t.getCurrentPaddingTop(),bottom:t.getCurrentPaddingBottom(),left:t.getCurrentPaddingLeft(),right:t.getCurrentPaddingRight()}},getResettedPadding:function(t){var e=this,n=this.config,a=R(t),r=a?0:{};return!1===n.padding?a||Object.keys(t).forEach(function(a){i(this,e),r[a]=M(n.data_labels)||!1===n.data_labels||"top"!==a?0:t[a]}.bind(this)):r=t,r},updateSizes:function(t){var e,i=this,n=i.config,a=i.state,r=i.$el.legend,s=n.axis_rotated,o=i.hasArcType()||a.hasTreemap,l="fit"===(null==(e=n.padding)?void 0:e.mode);t||i.setContainerSize();var c={width:r?i.getLegendWidth():0,height:r?i.getLegendHeight():0};!o&&n.axis_x_show&&n.axis_x_tick_autorotate&&i.updateXAxisTickClip();var d=a.isLegendRight||a.isLegendInset?0:c.height,u=s||o?0:i.getHorizontalAxisHeight("x"),h=n.subchart_axis_x_show&&n.subchart_axis_x_tick_text_show?u:30,g=n.subchart_show&&!o?n.subchart_size_height+h:0,f=i.hasType("gauge")&&n.arc_needle_show&&!n.gauge_fullCircle&&!n.gauge_label_show?10:0,p=i.getCurrentPadding();if(a.margin=!o&&s?{top:i.getHorizontalAxisHeight("y2")+p.top,right:o?0:i.getCurrentPaddingRight(!0),bottom:i.getHorizontalAxisHeight("y")+d+p.bottom,left:g+(o?0:p.left)}:{top:(l?0:4)+p.top,right:o?0:i.getCurrentPaddingRight(!0),bottom:f+u+g+d+p.bottom,left:o?0:p.left},a.margin=i.getResettedPadding(a.margin),a.margin2=s?{top:a.margin.top,right:NaN,bottom:20+d,left:i.state.rotatedPadding.left}:{top:a.current.height-g-d,right:NaN,bottom:h+d,left:a.margin.left},a.margin3={top:0,right:NaN,bottom:0,left:0},null==i.updateSizeForLegend||i.updateSizeForLegend(c),a.width=a.current.width-a.margin.left-a.margin.right,a.height=a.current.height-a.margin.top-a.margin.bottom,a.width<0&&(a.width=0),a.height<0&&(a.height=0),a.width2=s?a.margin.left-a.rotatedPadding.left-a.rotatedPadding.right:a.width,a.height2=s?a.height:a.current.height-a.margin2.top-a.margin2.bottom,a.width2<0&&(a.width2=0),a.height2<0&&(a.height2=0),i.hasArcType()){var v=i.hasType("gauge"),x=n.legend_show&&a.isLegendRight;a.arcWidth=a.width-(x?c.width+10:0),a.arcHeight=a.height-(x&&!v?0:10),v&&!n.gauge_fullCircle&&(a.arcHeight+=a.height-i.getPaddingBottomForGauge()),null==i.updateRadius||i.updateRadius()}a.isLegendRight&&o&&(a.margin3.left=a.arcWidth/2+1.1*a.radiusExpanded)}},Ke={setCssRule:function(t,e,n,a){var r=this,s=this,o=s.config,l=s.state,c=l.cssRule,d=l.style;return o.boost_useCssRule?function(o){var l=this;i(this,r),o.each(function(r){var o=this;i(this,l);var u=a&&(null==a?void 0:a.call(s,r)),h=(t?"."+(Mt.shapes+s.getTargetSelectorSuffix(r.id)):"")+e;e in c&&d.sheet.deleteRule(c[h]),s.state.cssRule[h]=function(t,e,n){var a=this,r=t.rootSelctor,s=t.sheet,o=r+" "+function(t){return i(this,a),t.replace(/\s?(bb-)/g,".$1").replace(/\.+/g,".")}.bind(this)(e)+" {"+n.join(";")+"}";return s[s.insertRule?"insertRule":"addRule"](o,s.cssRules.length)}(d,h,n.filter(Boolean).map(function(t){return i(this,o),C(u)&&-1===t.indexOf(":")?t+": "+u:t||""}.bind(this)))}.bind(this))}.bind(this):function(){i(this,r)}.bind(this)},getStylePropValue:function(t){return this.config.boost_useCssRule?null:k(t)?t.bind(this):t}};function Je(t,e,i,n,a){var r,s=t.value,o=this.isCandlestickType(t),l=R(s)&&s<0||o&&!(null!=(r=this.getCandlestickData(t))&&r._isUp),c=e.x,d=e.y;return n?"start"===i?(c+=l?0:8,d+=4):"middle"===i?(c+=8,d-=8):"end"===i&&(l&&(c-=8),d+=4):("start"===i?(c+=4,l&&(d+=16)):"middle"===i?d-=8:"end"===i&&(c-=4,l&&(d+=16)),a&&(d+=l?-17:o?13:7)),{x:c,y:d}}function Qe(t,e){var i,n=this.config.data_labels_position,a=t.id,r=t.index,s=t.value;return null!=(i=k(n)?n.bind(this.api)(e,s,a,r,this.$el.text):(a in n?n[a]:n)[e])?i:0}var ti={opacityForText:function(t){var e=this;return e.isBarType(t)&&!e.meetsLabelThreshold(Math.abs(e.getRatio("bar",t)),"bar")?"0":e.hasDataLabel?null:"0"},initText:function(){var t=this.$el;t.main.select("."+vt.chart).append("g").attr("class",Xt.chartTexts).style("pointer-events",t.treemap?"none":null)},updateTargetsForText:function(t){var e=this,n=this,a=n.getChartClass("Text"),r=n.getClass("texts","id"),s=n.classFocus.bind(n);n.$el.main.select("."+Xt.chartTexts).selectAll("."+Xt.chartText).data(t).attr("class",function(t){return i(this,e),(""+a(t)+s(t)).trim()}.bind(this)).enter().append("g").style("opacity","0").attr("class",a).call(n.setCssRule(!0," ."+Xt.text,["fill","pointer-events:none"],n.updateTextColor)).append("g").attr("class",r)},updateText:function(){var t=this,e=this,n=e.$el,r=e.$T,s=e.config,o=e.axis,l=e.getClass("text","index"),c=s.data_labels.centered,d=n.main.selectAll("."+Xt.texts).selectAll("."+Xt.text).data(e.labelishData.bind(e));r(d.exit()).style("fill-opacity","0").remove(),n.text=d.enter().append("text").merge(d).attr("class",l).attr("text-anchor",function(n){i(this,t);var a=s["axis_"+(null==o?void 0:o.getId(n.id))+"_inverted"]?n.value>0:n.value<0;if(e.isCandlestickType(n)){var r=e.getCandlestickData(n);a=!(null!=r&&r._isUp)}else if(e.isTreemapType(n))return c?"middle":"start";return s.axis_rotated?a?"end":"start":"middle"}.bind(this)).style("fill",e.getStylePropValue(e.updateTextColor)).style("fill-opacity","0").each((function(t,i,n){var r=(0,a.select)(this),s=t.value;if(e.isBubbleZType(t))s=e.getBubbleZData(s,"z");else if(e.isCandlestickType(t)){var o=e.getCandlestickData(t);o&&(s=o.close)}s=e.isTreemapType(t)?e.treemapDataLabelFormat(t)(r):e.dataLabelFormat(t.id)(s,t.id,i,n),R(s)?this.textContent=s:V(r,s)}))},updateTextColor:function(t){var e,i=this,n=i.config,a=n.data_labels_colors,r=i.isArcType(t)&&!i.isRadarType(t)||i.isTreemapType(t)?null:i.color(t);if(C(a))e=a;else if(F(a)){e=a[(t.data||t).id]}else k(a)&&(e=a.bind(i.api)(r,t));if(i.isCandlestickType(t)&&!k(a)){var s=i.getCandlestickData(t);if(null==s||!s._isUp){var o=n.candlestick_color_down;e=F(o)?o[t.id]:o}}return e||r},updateTextBacgroundColor:function(t){var e=this,i=e.$el,n=e.config.data_labels_backgroundColors,a="";if(C(n)||F(n)){var r=C(n)?"":e.getTargetSelectorSuffix("id"in t?t.id:t.data.id),s=i.defs.select(["filter[id*='labels-bg","']"].join(r));s.size()&&(a="url(#"+s.attr("id")+")")}return a||null},redrawText:function(t,e,i,n){var a=this,r=a.$T,s=a.axis,o=a.config,l=a.state.hasTreemap,c=Z(!0),d=o.axis_rotated,u=o.data_labels.rotate,h=function(t){var e="middle";return t>0&&t<=170?e="end":t>190&&t<=360&&(e="start"),e}(u),g=u?"rotate("+u+")":"";return a.$el.text.style("fill",a.getStylePropValue(a.updateTextColor)).attr("filter",a.updateTextBacgroundColor.bind(a)).style("fill-opacity",i?0:a.opacityForText.bind(a)).each((function(i,f){var p=r(l&&this.childElementCount?this.parentNode:this,!(!n||!this.getAttribute("x")),c),v=o["axis_"+(null==s?void 0:s.getId(i.id))+"_inverted"],x={x:t.bind(this)(i,f),y:e.bind(this)(i,f)};u&&(x=Je.bind(a)(i,x,h,d,v),p.attr("text-anchor",h)),this.childElementCount||u?p.attr("transform","translate("+x.x+" "+x.y+") "+g):p.attr("x",x.x).attr("y",x.y)})),!0},getTextRect:function(t,e){var n=this,r=this,s=t.node?t.node():t;/text/i.test(s.tagName)||(s=s.querySelector("text"));var o=s.textContent,l=ge+"-"+o.replace(/\W/g,"_"),c=r.cache.get(l);return c||(r.$el.svg.append("text").style("visibility","hidden").style("font",(0,a.select)(s).style("font")).classed(e,!0).text(o).call(function(t){i(this,n),c=U(t.node())}.bind(this)).remove(),r.cache.add(l,c)),c},generateXYForText:function(t,e){var n=this,a=this,r=a.state,s=r.hasRadar,o=r.hasTreemap,l=Object.keys(t),c={},d=e?a.getXForText:a.getYForText;return s&&l.push("radar"),o&&l.push("treemap"),l.forEach(function(e){i(this,n),c[e]=a["generateGet"+Q(e)+"Points"](t[e],!1)}.bind(this)),function(t,e){var i=(a.isAreaType(t)?"area":a.isBarType(t)&&"bar")||a.isCandlestickType(t)&&"candlestick"||a.isRadarType(t)&&"radar"||a.isTreemapType(t)&&"treemap"||"line";return d.call(a,c[i](t,e),t,this)}},getCenteredTextPos:function(t,e,i,n){var a=this,r=a.config,s=r.axis_rotated,o=a.isBarType(t),l=a.isTreemapType(t);if(r.data_labels.centered&&(o||l)){var c=U(i);if(o){var d=t.value>=0;if(s){var u=(d?e[1][1]-e[0][1]:e[0][1]-e[1][1])/2+c.width/2;return d?-u-3:u+2}var h=(d?e[0][1]-e[1][1]:e[1][1]-e[0][1])/2+c.height/2;return d?h:-h-2}if(l)return"x"===n?(e[1][0]-e[0][0])/2:(e[1][1]-e[0][1])/2+c.height/2}return 0},getXForText:function(t,e,i){var n,a=this,r=a.config,s=a.state,o=r.axis_rotated,l=a.isTreemapType(e),c=t[0][0];if(a.isCandlestickType(e))o?c=null!=(n=a.getCandlestickData(e))&&n._isUp?t[2][2]+4:t[2][1]-4:c+=(t[1][0]-c)/2;else if(l)c+=r.data_labels.centered?0:5;else if(o){var d=r["axis_"+a.axis.getId(e.id)+"_inverted"],u=a.isBarType(e)?4:6,h=e.value;c=t[2][1],d?c-=u*(h>0?1:-1):c+=u*(h<0?-1:1)}else c=a.hasType("bar")?(t[2][0]+t[0][0])/2:c;if(null===e.value)if(c>s.width){var g=U(i).width;c=s.width-g}else c<0&&(c=4);return(o||l)&&(c+=a.getCenteredTextPos(e,t,i,"x")),c+Qe.call(this,e,"x")},getYForText:function(t,e,i){var n,a=this,r=a.axis,s=a.config,o=a.state,l=s.axis_rotated,c=s["axis_"+(null==r?void 0:r.getId(e.id))+"_inverted"],d=a.isBarType(e),u=a.isTreemapType(e),h=s.point_r,g=U(i),f=e.value,p=3;if(a.isCandlestickType(e))f=a.getCandlestickData(e),l?(n=t[0][0],n+=(t[1][0]-n)/2+p):(n=f&&f._isUp?t[2][2]-p:t[2][1]+4*p,c&&(n+=15*(f._isUp?1:-1)));else if(u)n=t[0][1]+(s.data_labels.centered?0:g.height+5);else if(l)n=(t[0][0]+t[2][0]+.6*g.height)/2;else if(n=t[2][1],R(h)&&h>5&&(a.isLineType(e)||a.isScatterType(e))&&(p+=s.point_r/2.3),f<0||0===f&&!o.hasPositiveValue&&o.hasNegativeValue)n+=c?d?-3:-5:g.height+(d?-p:p);else{var v=2*-p;d?v=-p:a.isBubbleType(e)&&(v=p),c&&(v=d?10:15),n+=v}if(null===e.value&&!l){var x=g.height;no.height&&(n=o.height-4)}return l&&!u||(n+=a.getCenteredTextPos(e,t,i,"y")),n+Qe.call(this,e,"y")},markOverlapped:function(t,e,n){var r=this,s=e.$el.arcs.selectAll(n),o=s.filter(function(e){return i(this,r),e.data.id!==t}.bind(this)),l=s.filter(function(e){return i(this,r),e.data.id===t}.bind(this)),c=et(l.node()),d=function(t,e){return i(this,r),Math.sqrt(Math.pow(t,2)+Math.pow(e,2))}.bind(this);l.node()&&o.each((function(){var t=et(this),e=(0,a.select)(this),i=d(c.e,c.f)>d(t.e,t.f)?l:e,n=Math.ceil(Math.abs(c.e-t.e))=(this.config[e+"_label_threshold"]||0)}};function ei(t,e){void 0===t&&(t="left");var i=R(e);return t.indexOf("center")>-1?i?e/2:"middle":t.indexOf("right")>-1?i?e:"end":i?0:"start"}var ii={initTitle:function(){var t=this.config,e=this.$el;t.title_text&&(e.title=e.svg.append("g"),V(e.title.append("text").style("text-anchor",ei(t.title_position)).attr("class",Xt.title),t.title_text,[.3,1.5]))},redrawTitle:function(){var t=this,e=t.config,i=t.state.current,n=t.$el.title;if(n){var a=t.yForTitle.call(t);/g/i.test(n.node().tagName)?n.attr("transform","translate("+ei(e.title_position,i.width)+", "+a+")"):n.attr("x",t.xForTitle.call(t)).attr("y",a)}},xForTitle:function(){var t,e=this,i=e.config,n=e.state.current,a=i.title_position||"left",r=e.getTextRect(e.$el.title,Xt.title).width;return/(right|center)/.test(a)?(t=n.width-r,a.indexOf("right")>=0?t=n.width-r-i.title_padding.right:a.indexOf("center")>=0&&(t=(n.width-r)/2)):t=i.title_padding.left||0,t},yForTitle:function(){var t=this;return(t.config.title_padding.top||0)+t.getTextRect(t.$el.title,Xt.title).height},getTitlePadding:function(){return this.yForTitle()+(this.config.title_padding.bottom||0)}},ni={initTooltip:function(){var t=this,e=t.config,i=t.$el;i.tooltip=(0,a.select)(e.tooltip_contents.bindto),i.tooltip.empty()&&(i.tooltip=i.chart.append("div").attr("class",Ft.tooltipContainer).style("position","absolute").style("pointer-events","none").style("display","none")),t.bindTooltipResizePos()},initShowTooltip:function(){var t=this,e=this,n=e.config,a=e.$el,r=e.state,s=r.hasAxis,o=r.hasRadar;if(n.tooltip_init_show){var l,c,d=!(s&&o);if(null!=(l=e.axis)&&l.isTimeSeries()&&C(n.tooltip_init_x)){var u,h,g=e.data.targets[0];for(n.tooltip_init_x=dt.call(e,n.tooltip_init_x),u=0;(h=g.values[u])&&h.x-n.tooltip_init_x!=0;u++);n.tooltip_init_x=u}var f=e.data.targets.map(function(a){i(this,t);var r=d?0:n.tooltip_init_x;return e.addName(a.values[r])}.bind(this));d&&(f=[f[n.tooltip_init_x]]),a.tooltip.html(e.getTooltipHTML(f,null==(c=e.axis)?void 0:c.getXAxisTickFormat(),e.getDefaultValueFormat(),e.color)),n.tooltip_contents.bindto||a.tooltip.style("top",n.tooltip_init_position.top).style("left",n.tooltip_init_position.left).style("display",null)}},getTooltipHTML:function(){var t=this,e=t.api,i=t.config;return k(i.tooltip_contents)?i.tooltip_contents.bind(e).apply(void 0,arguments):t.getTooltipContent.apply(t,arguments)},getTooltipContent:function(t,e,n,a){var r=this,s=this,o=s.api,l=s.config,c=s.state,d=s.$el,u=["title","name","value"].map(function(t){i(this,r);var e=l["tooltip_format_"+t];return k(e)?e.bind(o):e}.bind(this)),h=u[0],g=u[1],f=u[2];h=h||e,g=g||function(t){return i(this,r),t}.bind(this),f=f||(c.hasTreemap||s.isStackNormalized()?function(t,e){return i(this,r),(100*e).toFixed(2)+"%"}.bind(this):n);var p=l.tooltip_order,v=function(t){return i(this,r),s.axis&&s.isBubbleZType(t)?s.getBubbleZData(t.value,"z"):s.getBaseValue(t)}.bind(this),x=s.levelColor?function(t){return i(this,r),s.levelColor(t.value)}.bind(this):function(t){return i(this,r),a(t)}.bind(this),b=l.tooltip_contents,_=b.template,m=s.mapToTargetIds();if(null===p&&l.data_groups.length){var y=s.orderTargets(s.data.targets).map(function(t){return i(this,r),t.id}.bind(this)).reverse();t.sort(function(t,e){i(this,r);var n=t?t.value:null,a=e?e.value:null;return n>0&&a>0&&(n=t.id?y.indexOf(t.id):null,a=e.id?y.indexOf(e.id):null),n-a}.bind(this))}else/^(asc|desc)$/.test(p)?t.sort(function(t,e){i(this,r);var n=t?v(t):null,a=e?v(e):null;return"asc"===p?n-a:a-n}.bind(this)):k(p)&&t.sort(p.bind(o));var T,w,A,C,R,L=s.getTooltipContentTemplate(_),O=t.length,P=function(){var e=this;if(!(w=t[R])||!v(w)&&0!==v(w))return"continue";if(E(T)){var n=(c.hasAxis||c.hasRadar)&&j(h?h(w.x):w.x);T=ct(L[0],{CLASS_TOOLTIP:Ft.tooltip,TITLE:S(n)?_?n:''+n+"":""})}if(!w.ratio&&d.arcs&&(A=["arc",s.$el.arcs.select("path."+xt.arc+"-"+w.id).data()[0]],w.ratio=s.getRatio.apply(s,A)),A=[w.ratio,w.id,w.index,t],C=j(f.apply(void 0,[v(w)].concat(A))),s.isAreaRangeType(w)){var a=["high","low"].map(function(t){return i(this,e),j(f.apply(void 0,[s.getRangedData(w,t)].concat(A)))}.bind(this)),r=a[0],o=a[1];C="Mid: "+C+" High: "+r+" Low: "+o}else if(s.isCandlestickType(w)){var l=["open","high","low","close","volume"].map(function(t){return i(this,e),j(f.apply(void 0,[s.getRangedData(w,t,"candlestick")].concat(A)))}.bind(this)),u=l[0],p=l[1],y=l[2],k=l[3],O=l[4];C="Open: "+u+" High: "+p+" Low: "+y+" Close: "+k+(O?" Volume: "+O:"")}else if(s.isBarRangeType(w)){var P=w.value,I=P[0],D=P[1];C=f(I)+" ~ "+f(D)}if(void 0!==C){if(null===w.name)return"continue";var z=j(g.apply(void 0,[w.name].concat(A))),M=x(w),$={CLASS_TOOLTIP_NAME:Ft.tooltipName+s.getTargetSelectorSuffix(w.id),COLOR:_||!s.patterns?M:'',NAME:z,VALUE:C};if(_&&F(b.text)){var X=m.indexOf(w.id);Object.keys(b.text).forEach(function(t){i(this,e),$[t]=b.text[t][X]}.bind(this))}T+=ct(L[1],$)}};for(R=0;R"},getTooltipContentTemplate:function(t){return(t||'\n\t\t\t\t{=TITLE}\n\t\t\t\t{{\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}}\n\t\t\t
'+(this.patterns?"{=COLOR}":'')+'{=NAME}{=VALUE}
').replace(/(\r?\n|\t)/g,"").split(/{{(.*)}}/)},tooltipPosition:function(t,e,n,a){var r=this,s=this,o=s.config,l=s.scale,c=s.state,d=c,u=d.width,h=d.height,g=d.current,f=d.isLegendRight,p=d.inputType,v=d.event,x=s.hasType("gauge")&&!o.gauge_fullCircle,b=c.hasTreemap,_=o.axis_rotated,m=s.getSvgLeft(!0),y=m+g.width-s.getCurrentPaddingRight(),T=s.getCurrentPaddingLeft(!0),w=H(v,a),A=w[0],S=w[1];if(s.hasArcType())"touch"===p||s.hasType("radar")||(S+=x?h:h/2,A+=(u-(f?s.getLegendWidth():0))/2);else if(!b){var k=l.x(t[0].x);_?(S=k+20,A+=m,y-=m):(S-=5,A=m+T+20+(l.zoom?A:k))}(A+e+15>y&&(A-=_?e-T:e+(b?0:T)),S+n>g.height)&&(S-=x?3*n:n+(b?0:30));var C={top:S,left:A};return Object.keys(C).forEach(function(t){i(this,r),C[t]<0&&(C[t]=0)}.bind(this)),C},showTooltip:function(t,e){var n=this,a=this,r=a.config,s=a.scale,o=a.state,l=a.$el.tooltip,c=r.tooltip_contents.bindto,d=t.filter(function(t){return i(this,n),t&&S(a.getBaseValue(t))}.bind(this));if(l&&0!==d.length&&r.tooltip_show){var u=l.datum(),h=u||{},g=h.width,f=void 0===g?0:g,p=h.height,v=void 0===p?0:p,x=JSON.stringify(t);if(!u||u.current!==x){var b=t.concat().sort()[0].index;N(r.tooltip_onshow,a.api,t),l.html(a.getTooltipHTML(t,a.axis?a.axis.getXAxisTickFormat():a.categoryName.bind(a),a.getDefaultValueFormat(),a.color)).style("display",null).style("visibility",null).datum(u={index:b,current:x,width:f=l.property("offsetWidth"),height:v=l.property("offsetHeight")}),N(r.tooltip_onshown,a.api,t),a._handleLinkedCharts(!0,b)}if(!c){var _,m,y=(null==(_=r.tooltip_position)?void 0:_.bind(a.api))||a.tooltipPosition.bind(a),T=H(o.event,e),w={x:T[0],y:T[1]},A=null==(m=t.filter(Boolean))?void 0:m.shift();s.x&&A&&"x"in A&&(w.xAxis=s.x(A.x));var k=y(d,f,v,e,w);["top","left"].forEach(function(t){i(this,n);var e=k[t];l.style(t,e+"px"),"left"!==t||u.xPosInPercent||(u.xPosInPercent=e/o.current.width*100)}.bind(this))}}},bindTooltipResizePos:function(){var t=this,e=this,n=e.resizeFunction,a=e.state,r=e.$el.tooltip;n.add(function(){if(i(this,t),"block"===r.style("display")){var e=a.current,n=r.datum(),s=n.width,o=n.xPosInPercent,l=e.width/100*o,c=e.width-(l+s);c<0&&(l+=c),r.style("left",l+"px")}}.bind(this))},hideTooltip:function(t){var e=this,i=e.api,n=e.config,a=e.$el.tooltip;if(a&&"none"!==a.style("display")&&(!n.tooltip_doNotHide||t)){var r=JSON.parse(a.datum().current);N(n.tooltip_onhide,i,r),a.style("display","none").style("visibility","hidden").datum(null),N(n.tooltip_onhidden,i,r)}},_handleLinkedCharts:function(t,e){var n=this,a=this,r=a.charts,s=a.config,o=a.state.event;if(null!=o&&o.isTrusted&&s.tooltip_linked&&r.length>1){var l=s.tooltip_linked_name;r.filter(function(t){return i(this,n),t!==a.api}.bind(this)).forEach(function(a){i(this,n);var r=a.internal,s=r.config,o=r.$el,c=s.tooltip_linked,d=s.tooltip_linked_name,u=h.body.contains(o.chart.node());if(c&&l===d&&u){var g=o.tooltip.data()[0],f=e!==(null==g?void 0:g.index);try{a.tooltip[t&&f?"show":"hide"]({index:e})}catch(t){}}}.bind(this))}}},ai={getTranslate:function(t,e){void 0===e&&(e=0);var i,n,a=this,r=a.config,s=a.state,o=r.axis_rotated,l=0;if(e&&/^(x|y2?)$/.test(t)&&(l=a.getAxisSize(t)*e),"main"===t)i=I(s.margin.left),n=I(s.margin.top);else if("context"===t)i=I(s.margin2.left),n=I(s.margin2.top);else if("legend"===t)i=s.margin3.left,n=s.margin3.top;else if("x"===t)i=o?-l:0,n=o?0:s.height+l;else if("y"===t)i=o?0:-l,n=o?s.height+l:0;else if("y2"===t)i=o?0:s.width+l,n=o&&l?1-l:0;else if("subX"===t)i=0,n=o?0:s.height2;else if("arc"===t)i=s.arcWidth/2,n=s.arcHeight/2;else if("polar"===t)i=s.arcWidth/2,n=s.arcHeight/2;else if("radar"===t){var c=a.getRadarSize()[0];i=s.width/2-c,n=I(s.margin.top)}return"translate("+i+", "+n+")"},transformMain:function(t,e){var i=this,n=i.$el.main,a=i.$T,r=null!=e&&e.axisX?e.axisX:a(n.select("."+_t.axisX),t),s=null!=e&&e.axisY?e.axisY:a(n.select("."+_t.axisY),t),o=null!=e&&e.axisY2?e.axisY2:a(n.select("."+_t.axisY2),t);a(n,t).attr("transform",i.getTranslate("main")),r.attr("transform",i.getTranslate("x")),s.attr("transform",i.getTranslate("y")),o.attr("transform",i.getTranslate("y2")),n.select("."+xt.chartArcs).attr("transform",i.getTranslate("arc"))},transformAll:function(t,e){var i=this,n=i.config,a=i.state,r=a.hasAxis,s=a.hasTreemap,o=i.$el;s||i.transformMain(t,e),r&&n.subchart_show&&i.transformContext(t,e),o.legend&&i.transformLegend(t)}},ri={isValidChartType:function(t){return!!(t&&Object.values(g).indexOf(t)>-1)},setTargetType:function(t,e){var n=this,a=this,r=a.config,s=a.state.withoutFadeIn;a.mapToTargetIds(t).forEach(function(t){i(this,n),s[t]=e===r.data_types[t],r.data_types[t]=e}.bind(this)),t||(r.data_type=e)},updateTypesElements:function(){var t=this,e=this,n=e.state.current;Object.keys(g).forEach(function(a){i(this,t);var r=g[a],s=e.hasType(r,null,!0),o=n.types.indexOf(r);-1===o&&s?n.types.push(r):o>-1&&!s&&n.types.splice(o,1)}.bind(this)),e.setChartElements()},hasType:function(t,e,n){var a,r=this;void 0===n&&(n=!1);var s=this,o=s.config,l=s.state.current,c=o.data_types,d=e||s.data.targets,u=!1;return!n&&(null==(a=l.types)?void 0:a.indexOf(t))>-1?u=!0:null!=d&&d.length?d.forEach(function(e){i(this,r);var n=c[e.id];(n===t||!n&&"line"===t)&&(u=!0)}.bind(this)):Object.keys(c).length?Object.keys(c).forEach(function(e){i(this,r),c[e]===t&&(u=!0)}.bind(this)):u=o.data_type===t,u},hasTypeOf:function(t,e,n){var a=this;return void 0===n&&(n=[]),t in x&&!x[t].filter(function(t){return i(this,a),-1===n.indexOf(t)}.bind(this)).every(function(t){return i(this,a),!this.hasType(t,e)}.bind(this))},isTypeOf:function(t,e){var i=C(t)?t:t.id,n=this.config.data_types[i]||this.config.data_type;return X(e)?e.indexOf(n)>=0:n===e},hasPointType:function(){var t=this;return t.hasTypeOf("Line")||t.hasType("bubble")||t.hasType("scatter")},hasArcType:function(t,e){return this.hasTypeOf("Arc",t,e)},hasMultiArcGauge:function(){return this.hasType("gauge")&&"multi"===this.config.gauge_type},isLineType:function(t){var e=C(t)?t:t.id;return!this.config.data_types[e]||this.isTypeOf(e,x.Line)},isStepType:function(t){return this.isTypeOf(t,x.Step)},isSplineType:function(t){return this.isTypeOf(t,x.Spline)},isAreaType:function(t){return this.isTypeOf(t,x.Area)},isAreaRangeType:function(t){return this.isTypeOf(t,x.AreaRange)},isBarType:function(t){return this.isTypeOf(t,"bar")},isBubbleType:function(t){return this.isTypeOf(t,"bubble")},isCandlestickType:function(t){return this.isTypeOf(t,"candlestick")},isScatterType:function(t){return this.isTypeOf(t,"scatter")},isTreemapType:function(t){return this.isTypeOf(t,"treemap")},isPieType:function(t){return this.isTypeOf(t,"pie")},isGaugeType:function(t){return this.isTypeOf(t,"gauge")},isDonutType:function(t){return this.isTypeOf(t,"donut")},isPolarType:function(t){return this.isTypeOf(t,"polar")},isRadarType:function(t){return this.isTypeOf(t,"radar")},isArcType:function(t){return this.isPieType(t)||this.isDonutType(t)||this.isGaugeType(t)||this.isPolarType(t)||this.isRadarType(t)},isCirclePoint:function(t){var e=this.config,i=e.point_pattern;return"circle"===(null==t?void 0:t.tagName)||"circle"===e.point_type&&(!i||X(i)&&0===i.length)},lineData:function(t){return this.isLineType(t)?[t]:[]},arcData:function(t){return this.isArcType(t.data)?[t]:[]},labelishData:function(t){var e=this;return this.isBarType(t)||this.isLineType(t)||this.isScatterType(t)||this.isBubbleType(t)||this.isCandlestickType(t)||this.isRadarType(t)||this.isTreemapType(t)?t.values.filter(function(t){return i(this,e),R(t.value)||!!t.value}.bind(this)):[]},barLineBubbleData:function(t){return this.isBarType(t)||this.isLineType(t)||this.isBubbleType(t)?t.values:[]},isInterpolationType:function(t){return["basis","basis-closed","basis-open","bundle","cardinal","cardinal-closed","cardinal-open","catmull-rom","catmull-rom-closed","catmull-rom-open","linear","linear-closed","monotone-x","monotone-y","natural"].indexOf(t)>=0}},si=function(){function t(t){this.api=void 0,this.config=void 0,this.cache=void 0,this.$el=void 0,this.state=void 0,this.charts=void 0,this.data={xs:{},targets:[]},this.axis=void 0,this.scale={x:null,y:null,y2:null,subX:null,subY:null,subY2:null,zoom:null},this.org={xScale:null,xDomain:null},this.color=void 0,this.patterns=void 0,this.levelColor=void 0,this.point=void 0,this.brush=void 0,this.format={extraLineClasses:null,xAxisTick:null,dataTime:null,defaultAxisTime:null,axisTime:null};var e=this;e.api=t,e.config=new ne,e.cache=new fe;var i=new Vt;e.$el=i.getStore("element"),e.state=i.getStore("state"),e.$T=e.$T.bind(e)}var e=t.prototype;return e.$T=function(t,e,i){var n=this.config,r=this.state,s=n.transition_duration,o=n.subchart_show,l=t;l&&("tagName"in l&&(l=(0,a.select)(l)),l=(!1!==e&&s||e)&&(!r.zooming||r.dragging)&&!r.resizing&&r.rendered&&!o?l.transition(i).duration(s):l);return l},e.beforeInit=function(){var t=this;t.callPluginHook("$beforeInit"),N(t.config.onbeforeinit,t.api)},e.afterInit=function(){var t=this;t.callPluginHook("$afterInit"),N(t.config.onafterinit,t.api)},e.init=function(){var t=this,e=t.config,i=t.state,n=t.$el,r=e.boost_useCssRule;if(gt(t),i.hasRadar=!i.hasAxis&&t.hasType("radar"),i.hasTreemap=!i.hasAxis&&t.hasType("treemap"),i.hasAxis=!t.hasArcType()&&!i.hasTreemap,i.datetimeId="bb-"+ +new Date*Z(),r){var s=h.createElement("style");s.type="text/css",h.head.appendChild(s),i.style={rootSelctor:"."+i.datetimeId,sheet:s.sheet},n.style=s}var o={element:e.bindto,classname:"bb"};F(e.bindto)&&(o.element=e.bindto.element||"#chart",o.classname=e.bindto.classname||o.classname),n.chart=k(o.element.node)?e.bindto.element:(0,a.select)(o.element||[]),n.chart.empty()&&(n.chart=(0,a.select)(h.body.appendChild(h.createElement("div")))),n.chart.html("").classed(o.classname,!0).classed(i.datetimeId,r).style("position","relative"),t.initParams(),t.initToRender()},e.initToRender=function(t){var e=this,n=this,a=n.config,r=n.state,o=n.$el.chart,l=function(){return i(this,e),"none"===o.style("display")||"hidden"===o.style("visibility")}.bind(this),c=a.render.lazy||l(),d=s.MutationObserver;c&&d&&!1!==a.render.observe&&!t&&new d(function(t,a){i(this,e),l()||(a.disconnect(),r.rendered||n.initToRender(!0))}.bind(this)).observe(o.node(),{attributes:!0,attributeFilter:["class","style"]}),c&&!t||n.convertData(a,function(t){i(this,e),n.initWithData(t),n.afterInit()}.bind(this))},e.initParams=function(){var t=this,e=this,a=e.config,r=e.format,o=e.state,l=a.axis_rotated;if(e.color=e.generateColor(),e.levelColor=e.generateLevelColor(),!1===a.padding&&(a.axis_x_show=!1,a.axis_y_show=!1,a.axis_y2_show=!1,a.subchart_show=!1),e.hasPointType()&&(e.point=e.generatePoint()),o.hasAxis){e.initClip(),r.extraLineClasses=e.generateExtraLineClass(),r.dataTime=a.data_xLocaltime?n.timeParse:n.utcParse,r.axisTime=a.axis_x_localtime?n.timeFormat:n.utcFormat;var c=e.config.zoom_enabled&&"drag"===e.config.zoom_type;r.defaultAxisTime=function(n){i(this,t);var a=e.scale,s=a.x,o=a.zoom,l=c?o:o&&s.orgDomain().toString()!==o.domain().toString(),d=(n.getMilliseconds()?".%L":n.getSeconds()&&".:%S")||n.getMinutes()&&"%I:%M"||n.getHours()&&"%I %p"||1!==n.getDate()&&"%b %d"||l&&1===n.getDate()&&"%b'%y"||n.getMonth()&&"%-m/%-d"||"%Y";return r.axisTime(d)(n)}.bind(this)}o.isLegendRight="right"===a.legend_position,o.isLegendInset="inset"===a.legend_position,o.isLegendTop="top-left"===a.legend_inset_anchor||"top-right"===a.legend_inset_anchor,o.isLegendLeft="top-left"===a.legend_inset_anchor||"bottom-left"===a.legend_inset_anchor,o.rotatedPadding.top=e.getResettedPadding(o.rotatedPadding.top),o.rotatedPadding.right=l&&!a.axis_x_show?0:30,o.inputType=function(t,e){var n=this,a=s.DocumentTouch,r=s.matchMedia,o=s.navigator,l=!1;if(e)if(o&&"maxTouchPoints"in o)l=o.maxTouchPoints>0;else if("ontouchmove"in s||a&&h instanceof a)l=!0;else if(null!=r&&r("(pointer:coarse)").matches)l=!0;else{var c=o.userAgent;l=/\b(BlackBerry|webOS|iPhone|IEMobile)\b/i.test(c)||/\b(Android|Windows Phone|iPad|iPod)\b/i.test(c)}return(t&&["any-hover:hover","any-pointer:fine"].some(function(t){return i(this,n),null==r?void 0:r("("+t+")").matches}.bind(this))?"mouse":l&&"touch")||"mouse"}(a.interaction_inputType_mouse,a.interaction_inputType_touch)},e.initWithData=function(t){var e=this,n=this,a=n.config,r=n.scale,s=n.state,o=n.$el,l=n.org,c=s,d=c.hasAxis,u=c.hasTreemap,h=a.interaction_enabled,g=n.hasType("polar");if(d&&(n.axis=n.getAxisInstance(),a.zoom_enabled&&n.initZoom()),n.data.xs={},n.data.targets=n.convertDataToTargets(t),a.data_filter&&(n.data.targets=n.data.targets.filter(a.data_filter.bind(n.api))),a.data_hide&&n.addHiddenTargetIds(!0===a.data_hide?n.mapToIds(n.data.targets):a.data_hide),a.legend_hide&&n.addHiddenLegendIds(!0===a.legend_hide?n.mapToIds(n.data.targets):a.legend_hide),n.updateSizes(),n.updateScales(!0),d){var f=r.x,p=r.y,v=r.y2,x=r.subX,b=r.subY,_=r.subY2;f&&(f.domain(rt(n.getXDomain(n.data.targets),!a.axis_x_inverted)),x.domain(f.domain()),l.xDomain=f.domain()),p&&(p.domain(n.getYDomain(n.data.targets,"y")),b.domain(p.domain())),v&&(v.domain(n.getYDomain(n.data.targets,"y2")),_&&_.domain(v.domain()))}if(o.svg=o.chart.append("svg").style("overflow","hidden").style("display","block"),h&&s.inputType){var m="touch"===s.inputType,y=a.onclick,T=a.onover,w=a.onout;o.svg.on("click",(null==y?void 0:y.bind(n.api))||null).on(m?"touchstart":"mouseenter",(null==T?void 0:T.bind(n.api))||null).on(m?"touchend":"mouseleave",(null==w?void 0:w.bind(n.api))||null)}a.svg_classname&&o.svg.attr("class",a.svg_classname);var A=k(a.color_tiles)&&n.patterns;(d||A||g||u||a.data_labels_backgroundColors)&&(o.defs=o.svg.append("defs"),d&&["id","idXAxis","idYAxis","idGrid"].forEach(function(t){i(this,e),n.appendClip(o.defs,s.clip[t])}.bind(this)),n.generateDataLabelBackgroundColorFilter(),A&&n.patterns.forEach(function(t){var n=this;return i(this,e),o.defs.append(function(){return i(this,n),t.node}.bind(this))}.bind(this))),n.updateSvgSize(),n.bindResize();var S,C=o.svg.append("g").classed(vt.main,!0).attr("transform",u?null:n.getTranslate("main"));(o.main=C,a.subchart_show&&n.initSubchart(),a.tooltip_show&&n.initTooltip(),a.title_text&&n.initTitle(),!u&&a.legend_show&&n.initLegend(),a.data_empty_label_text&&C.append("text").attr("class",Xt.text+" "+vt.empty).attr("text-anchor","middle").attr("dominant-baseline","middle"),d&&(a.regions.length&&n.initRegion(),a.clipPath||n.axis.init()),C.append("g").classed(vt.chart,!0).attr("clip-path",d?s.clip.path:null),n.callPluginHook("$init"),n.initChartElements(),d)&&(h&&(null==n.initEventRect||n.initEventRect()),n.initGrid(),a.clipPath&&(null==(S=n.axis)||S.init()));if(n.updateTargets(n.data.targets),n.updateDimension(),N(a.oninit,n.api),n.setBackground(),n.redraw({withTransition:!1,withTransform:!0,withUpdateXDomain:!0,withUpdateOrgXDomain:!0,withTransitionForAxis:!1,initializing:!0}),a.data_onmin||a.data_onmax){var R=n.getMinMaxData();N(a.data_onmin,n.api,R.min),N(a.data_onmax,n.api,R.max)}a.tooltip_show&&n.initShowTooltip(),s.rendered=!0},e.initChartElements=function(){var t=this,e=this,n=e.state,a=n.hasAxis,r=n.hasRadar,s=n.hasTreemap,o=[];if(a){var l=["bar","bubble","candlestick","line"];e.config.bar_front&&l.push(l.shift()),l.forEach(function(n){i(this,t);var a=Q(n);("line"===n&&e.hasTypeOf(a)||e.hasType(n))&&o.push(a)}.bind(this))}else if(s)o.push("Treemap");else{var c=e.hasType("polar");r||o.push("Arc","Pie"),e.hasType("gauge")?o.push("Gauge"):r?o.push("Radar"):c&&o.push("Polar")}o.forEach(function(n){i(this,t),e["init"+n]()}.bind(this)),$(e.config.data_labels)&&!e.hasArcType(null,["radar"])&&e.initText()},e.setChartElements=function(){var t=this.$el,e=t.chart,i=t.svg,n=t.defs,a=t.main,r=t.tooltip,s=t.legend,o=t.title,l=t.grid,c=t.needle,d=t.arcs,u=t.circle,h=t.bar,g=t.candlestick,f=t.line,p=t.area,v=t.text;this.api.$={chart:e,svg:i,defs:n,main:a,tooltip:r,legend:s,title:o,grid:l,arc:d,circles:u,bar:{bars:h},candlestick:g,line:{lines:f,areas:p},needle:c,text:{texts:v}}},e.setBackground=function(){var t=this,e=t.config.background,i=t.state,n=t.$el.svg;if($(e)){var a=n.select("g").insert(e.imgUrl?"image":"rect",":first-child");e.imgUrl?a.attr("href",e.imgUrl):e.color&&a.style("fill",e.color).attr("clip-path",i.clip.path),a.attr("class",e.class||null).attr("width","100%").attr("height","100%")}},e.updateTargets=function(t){var e=this,n=this,a=n.state,r=a.hasAxis,s=a.hasRadar,o=a.hasTreemap,l=function(a){return i(this,e),n["updateTargetsFor"+a](t.filter(n["is"+a+"Type"].bind(n)))}.bind(this);if(n.updateTargetsForText(t),r)["bar","candlestick","line"].forEach(function(t){i(this,e);var a=Q(t);("line"===t&&n.hasTypeOf(a)||n.hasType(t))&&l(a)}.bind(this)),n.updateTargetsForSubchart&&n.updateTargetsForSubchart(t);else if(n.hasArcType(t)){var c="Arc";s?c="Radar":n.hasType("polar")&&(c="Polar"),l(c)}else o&&l("Treemap");var d=n.hasType("bubble")||n.hasType("scatter");d&&(null==n.updateTargetForCircle||n.updateTargetForCircle()),n.filterTargetsToShowAtInit(d)},e.filterTargetsToShowAtInit=function(t){var e=this;void 0===t&&(t=!1);var n=this,a=n.$el.svg,r=n.$T,s="."+vt.target;t&&(s+=", ."+Tt.chartCircles+" > ."+Tt.circles),r(a.selectAll(s).filter(function(t){return i(this,e),n.isTargetToShow(t.id)}.bind(this))).style("opacity",null)},e.getWithOption=function(t){var e=this,n={Dimension:!0,EventRect:!0,Legend:!1,Subchart:!0,Transform:!1,Transition:!0,TrimXDomain:!0,UpdateXAxis:"UpdateXDomain",UpdateXDomain:!1,UpdateOrgXDomain:!1,TransitionForExit:"Transition",TransitionForAxis:"Transition",Y:!0};return Object.keys(n).forEach(function(a){i(this,e);var r=n[a];C(r)&&(r=n[r]),n[a]=B(t,"with"+a,r)}.bind(this)),n},e.initialOpacity=function(t){var e=this.state.withoutFadeIn;return null!==this.getBaseValue(t)&&e[t.id]?null:"0"},e.bindResize=function(){var t=this,e=this,n=e.config,a=e.state,r=function(t){var e,n=this,a=[],r=function(){var n=this;r.clear(),!1===t?u(function(){var t=this;i(this,n),a.forEach(function(e){return i(this,t),e()}.bind(this))}.bind(this),{timeout:200}):e=pe(function(){var t=this;i(this,n),a.forEach(function(e){return i(this,t),e()}.bind(this))}.bind(this),R(t)?t:200)};return r.clear=function(){i(this,n),e&&(ve(e),e=null)}.bind(this),r.add=function(t){return i(this,n),a.push(t)}.bind(this),r.remove=function(t){return i(this,n),a.splice(a.indexOf(t),1)}.bind(this),r}(n.resize_timer),o=[];o.push(function(){return i(this,t),N(n.onresize,e.api)}.bind(this)),n.resize_auto&&o.push(function(){i(this,t),a.resizing=!0,n.legend_show&&(e.updateSizes(),e.updateLegend()),e.api.flush(!1)}.bind(this)),o.push(function(){i(this,t),N(n.onresized,e.api),a.resizing=!1}.bind(this)),o.forEach(function(e){return i(this,t),r.add(e)}.bind(this)),e.resizeFunction=r,s.addEventListener("resize",e.resizeFunction=r)},e.callPluginHook=function(t){for(var e=this,n=arguments.length,a=Array(n>1?n-1:0),r=1;r\n\t\t\t\n\t\t\t\t'+v+"\n\t\t\t\t"+f.replace(/(url\()[^#]+/g,"$1")+"\n\t\t\t").replace("/\n/g","%0A");return"data:image/svg+xml;base64,"+ui(x)}function gi(t){var e=this,n=t.getBoundingClientRect(),a=n.left,r=n.top,o=function(t){return i(this,e),t.textContent||t.childElementCount}.bind(this),l=[];return tt(t.querySelectorAll("text")).filter(o).forEach(function(t){var n=this;i(this,e);var c=function(t){var e;i(this,n);var o=s.getComputedStyle(t),l=o.fill,c=o.fontFamily,d=o.fontSize,u=o.textAnchor,h=o.transform,g=function(t,e){var i=e.top,n=e.left,a=t.getBBox(),r=a.x,s=a.y,o=t.getScreenCTM(),l=o.a,c=o.b,d=o.c,u=o.d,h=o.e,g=o.f,f=t.getBoundingClientRect(),p=f.width,v=f.height;return{x:l*r+d*s+h-n,y:c*r+u*s+g-i+(v-Math.round(v/4)),width:p,height:v}}(t,{left:a,top:r}),f=g.x,p=g.y,v=g.width,x=g.height;return(e={})[t.textContent]={x:f,y:p,width:v,height:x,fill:l,fontFamily:c,fontSize:d,textAnchor:u,transform:h},e}.bind(this);if(t.childElementCount>1)return tt(t.querySelectorAll("tspan")).filter(o).forEach(function(t){i(this,n),l.push(c(t))}.bind(this)),[];l.push(c(t))}.bind(this)),l}var fi={export:function(t,e){var n=this,a=this.internal,r=a.state,s=a.$el,o=s.chart,l=s.svg,c=r.current,d=c.width,u=c.height,g=at({width:d,height:u,preserveAspectRatio:!0,preserveFontStyle:!1,mimeType:"image/png"},t),f=hi(o.node(),g,{width:d,height:u}),p=g.preserveFontStyle?gi(l.node()):[];if(e&&k(e)){var v=new Image;v.crossOrigin="Anonymous",v.onload=function(){i(this,n);var t=h.createElement("canvas"),a=t.getContext("2d");t.width=g.width||d,t.height=g.height||u,a.drawImage(v,0,0),p.length&&(!function(t,e){var n=this;e.forEach(function(e){var a=this;i(this,n),Object.keys(e).forEach(function(n){var r=this;i(this,a);var s=e[n],o=s.x,l=s.y,c=s.width,d=s.height,u=s.fill,h=s.fontFamily,g=s.fontSize,f=s.transform;if(t.save(),t.font=g+" "+h,t.fillStyle=u,"none"===f)t.fillText(n,o,l);else{var p=f.replace(/(matrix|\(|\))/g,"").split(",");p.splice(4).every(function(t){return i(this,r),0==+t}.bind(this))?(p.push(o+c-c/4),p.push(l-d+d/3)):(p.push(o),p.push(l)),t.transform.apply(t,p),t.fillText(n,0,0)}t.restore()}.bind(this))}.bind(this))}(a,p),p.length=0),e.bind(this)(t.toDataURL(g.mimeType))}.bind(this),v.src=f}return f}},pi={focus:function(t){var e=this,n=this.internal,a=n.state,r=n.mapToTargetIds(t),s=n.$el.svg.selectAll(n.selectorTargets(r.filter(n.isTargetToShow,n)));this.revert(),this.defocus(),s.classed(Et.focused,!0).classed(Et.defocused,!1),n.hasArcType()&&!a.hasRadar&&(n.expandArc(r),n.hasType("gauge")&&n.markOverlapped(t,n,"."+St.gaugeValue)),n.toggleFocusLegend(r,!0),a.focusedTargetIds=r,a.defocusedTargetIds=a.defocusedTargetIds.filter(function(t){return i(this,e),r.indexOf(t)<0}.bind(this))},defocus:function(t){var e=this,n=this.internal,a=n.state,r=n.mapToTargetIds(t);n.$el.svg.selectAll(n.selectorTargets(r.filter(n.isTargetToShow,n))).classed(Et.focused,!1).classed(Et.defocused,!0),n.hasArcType(null,["polar"])&&(n.unexpandArc(r),n.hasType("gauge")&&n.undoMarkOverlapped(n,"."+St.gaugeValue)),n.toggleFocusLegend(r,!1),a.focusedTargetIds=a.focusedTargetIds.filter(function(t){return i(this,e),r.indexOf(t)<0}.bind(this)),a.defocusedTargetIds=r},revert:function(t){var e=this.internal,i=e.config,n=e.state,r=e.$el,s=e.mapToTargetIds(t);r.svg.selectAll(e.selectorTargets(s)).classed(Et.focused,!1).classed(Et.defocused,!1),e.hasArcType(null,["polar"])&&e.unexpandArc(s),i.legend_show&&(e.showLegend(s.filter(e.isLegendToShow.bind(e))),r.legend.selectAll(e.selectorLegends(s)).filter((function(){return(0,a.select)(this).classed(Et.legendItemFocused)})).classed(Et.legendItemFocused,!1)),n.focusedTargetIds=[],n.defocusedTargetIds=[]}},vi={legend:{show:function(t){var e=this.internal;e.showLegend(e.mapToTargetIds(t)),e.updateAndRedraw({withLegend:!0})},hide:function(t){var e=this.internal;e.hideLegend(e.mapToTargetIds(t)),e.updateAndRedraw({withLegend:!0})}}},xi={load:function(t){var e=this,n=this.internal,a=n.config;t.xs&&n.addXs(t.xs),"names"in t&&this.data.names(t.names),"classes"in t&&Object.keys(t.classes).forEach(function(n){i(this,e),a.data_classes[n]=t.classes[n]}.bind(this)),"categories"in t&&n.axis.isCategorized()&&(a.axis_x_categories=t.categories),"axes"in t&&Object.keys(t.axes).forEach(function(n){i(this,e),a.data_axes[n]=t.axes[n]}.bind(this)),"colors"in t&&Object.keys(t.colors).forEach(function(n){i(this,e),a.data_colors[n]=t.colors[n]}.bind(this)),"unload"in t&&!1!==t.unload?n.unload(n.mapToTargetIds(!0===t.unload?null:t.unload),function(){var a=this;i(this,e),u(function(){return i(this,a),n.loadFromArgs(t)}.bind(this))}.bind(this)):(n.api.tooltip.hide(),n.loadFromArgs(t))},unload:function(t){var e=this,n=this.internal,a=t||{};X(a)?a={ids:a}:C(a)&&(a={ids:[a]});var r=n.mapToTargetIds(a.ids);n.unload(r,function(){i(this,e),n.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0}),n.cache.remove(r),Le.call(n,a.done,a.resizeAfter)}.bind(this))}};function bi(t,e,n){var a=this,r=this.internal,s=r.mapToTargetIds(e),o=r.state.hiddenTargetIds.map(function(t){return i(this,a),s.indexOf(t)>-1&&t}.bind(this)).filter(Boolean);r.state.toggling=!0,r[(t?"remove":"add")+"HiddenTargetIds"](s);var l=r.$el.svg.selectAll(r.selectorTargets(s)),c=t?null:"0";t&&o.length&&(l.style("display",null),N(r.config.data_onshown,this,o)),r.$T(l).style("opacity",c,"important").call(G,function(){i(this,a),t||0!==o.length||(l.style("display","none"),N(r.config.data_onhidden,this,s)),l.style("opacity",c)}.bind(this)),n.withLegend&&r[(t?"show":"hide")+"Legend"](s),r.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0}),r.state.toggling=!1}var _i={show:function(t,e){void 0===e&&(e={}),bi.call(this,!0,t,e)},hide:function(t,e){void 0===e&&(e={}),bi.call(this,!1,t,e)},toggle:function(t,e){var n=this;void 0===e&&(e={});var a=this.internal,r={show:[],hide:[]};a.mapToTargetIds(t).forEach(function(t){return i(this,n),r[a.isTargetToShow(t)?"hide":"show"].push(t)}.bind(this)),r.show.length&&this.show(r.show,e),r.hide.length&&setTimeout(function(){return i(this,n),this.hide(r.hide,e)}.bind(this),0)}},mi={show:function(t){var e,n,a=this,r=this.internal,s=r.$el,o=r.config,l=r.state,c=l.eventReceiver,d=l.hasTreemap,u=l.inputType;if(t.mouse&&(n=t.mouse),t.data){var h=t.data,g=r.getYScaleById(h.id)(h.value);d&&h.id?c.rect=s.main.select(""+r.selectorTarget(h.id,void 0,"rect")):r.isMultipleX()?n=[r.xx(h),g]:(o.tooltip_grouped||(n=[0,g]),e=S(h.index)?h.index:r.getIndexByX(h.x))}else L(t.x)?e=r.getIndexByX(t.x):L(t.index)&&(e=t.index);("mouse"===u?["mouseover","mousemove"]:["touchstart"]).forEach(function(t){i(this,a),r.dispatchEvent(t,e,n)}.bind(this))},hide:function(){var t=this,e=this.internal,n=e.state.inputType,a=e.$el.tooltip,r=null==a?void 0:a.datum();if(r){var s=JSON.parse(r.current)[0].index;("mouse"===n?["mouseout"]:["touchend"]).forEach(function(n){i(this,t),e.dispatchEvent(n,s)}.bind(this))}"touch"===n&&e.callOverOutForTouch(),e.hideTooltip(!0),null==e.hideGridFocus||e.hideGridFocus(),null==e.unexpandCircles||e.unexpandCircles(),null==e.expandBarTypeShapes||e.expandBarTypeShapes(!1)}},yi={tooltip:mi},Ti=function t(e){this.plugins=[],this.internal=void 0;var n=new si(this);this.internal=n,function t(e,n,a){var r=this;Object.keys(e).forEach(function(s){i(this,r);var o=k(e[s]),l=n!==a,c=$(e[s]),d=c&&Object.keys(e[s]).length>0;n[s]=o&&(!l&&d||l)?e[s].bind(a):c&&!o?{}:e[s],d&&t(e[s],n[s],a)}.bind(this))}(t.prototype,this,this),oi.call(n,e),n.beforeInit(),n.init()};function wi(t,e,n){var a=this,r=t.config,s=function(t,n){i(this,a);var s=R(n)?n:!1===n?void 0:null;null!==s&&(r["axis_"+t+"_"+e]=s)}.bind(this);L(n)&&(z(n)?Object.keys(n).forEach(function(t){i(this,a),s(t,n[t])}.bind(this)):(R(n)||!1===n)&&["y","y2"].forEach(function(t){i(this,a),s(t,n)}.bind(this)),t.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0}))}function Ai(t,e){var i=t.config;return{x:i["axis_x_"+e],y:i["axis_y_"+e],y2:i["axis_y2_"+e]}}J(Ti.prototype,[li,{color:function(t){return this.internal.color(t)}},di,fi,pi,vi,xi,_i,yi]);var Si={labels:function(t){var e,n=this,a=this.internal;return t&&(Object.keys(t).forEach(function(e){i(this,n),a.axis.setLabelText(e,t[e])}.bind(this)),a.axis.updateLabels()),["x","y","y2"].forEach(function(t){i(this,n);var r=a.axis.getLabelText(t);r&&(e||(e={}),e[t]=r)}.bind(this)),e},min:function(t){var e=this.internal;return S(t)||!1===t?wi(e,"min",t):Ai(e,"min")},max:function(t){var e=this.internal;return S(t)||!1===t?wi(e,"max",t):Ai(e,"max")},range:function(t){var e=this.axis;if(!arguments.length)return{max:e.max(),min:e.min()};var i=t.min,n=t.max;L(n)&&e.max(n),L(i)&&e.min(i)}},ki={axis:Si};function Ci(t,e){var i=this.internal,n=i.config,a=n.transition_duration&&ut(),r="grid_"+e+"_lines";return t?(n[r]=t,i.updateGrid(),i.redrawGrid(a),n[r]):n[r]}function Ri(t,e){return Ci.bind(this)(this.internal.config["grid_"+e+"_lines"].concat(t||[]),e)}function Ei(t,e){this.internal.removeGridLines(t,e)}var Li=function(t){return Ci.bind(this)(t,"x")};J(Li,{add:function(t){return Ri.bind(this)(t,"x")},remove:function(t){return Ei.bind(this)(t,!0)}});var Oi=function(t){return Ci.bind(this)(t,"y")};J(Oi,{add:function(t){return Ri.bind(this)(t,"y")},remove:function(t){return Ei.bind(this)(t,!1)}});var Pi={xgrids:Li,ygrids:Oi},Ii={groups:function(t){var e=this.internal,i=e.config;return E(t)||(i.data_groups=t,e.redraw()),i.data_groups}};function Di(t,e){void 0===e&&(e=!1);var i=this.internal,n=i.config,a=n.transition_duration&&ut();return t?(n.regions=e?n.regions.concat(t):t,i.updateRegion(),i.redrawRegion(a),e?n.regions:t):n.regions}var zi=function(t){return Di.bind(this)(t)};J(zi,{add:function(t){return Di.bind(this)(t,!0)},remove:function(t){var e=this,n=this.internal,a=n.config,r=n.$T,s=t||{},o=B(s,"classes",[Dt.region]),l=n.$el.main.select("."+Dt.regions).selectAll(o.map(function(t){return i(this,e),"."+t}.bind(this)));return r(l).style("opacity","0").remove(),l=a.regions,Object.keys(s).length?(l=l.filter(function(t){var n=this;i(this,e);var a=!1;return!t.class||(t.class.split(" ").forEach(function(t){i(this,n),o.indexOf(t)>=0&&(a=!0)}.bind(this)),!a)}.bind(this)),a.regions=l):a.regions=[],l}});var Mi={regions:zi},$i={x:function(t){var e=this.internal,i=e.axis,n=e.data,a=i.isCustomX()&&i.isCategorized();return X(t)&&(a?this.categories(t):(e.updateTargetX(n.targets,t),e.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0}))),a?this.categories():n.xs},xs:function(t){var e=this.internal;return F(t)&&(e.updateTargetXs(e.data.targets,t),e.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})),e.data.xs}},Xi={flow:function(t){var e,n=this,a=this.internal;(t.json||t.rows||t.columns)&&a.convertData(t,function(r){i(this,n),e=r,function(){var n,r,s,o=this,l=0,c=0;if(a.state.redrawing||!e||!ut())return;var d=[],u=a.getMaxDataCount(),h=a.convertDataToTargets(e,!0),g=a.axis.isTimeSeries();a.data.targets.forEach(function(t){i(this,o);for(var e=!1,n=0;n1?f.values[f.values.length-1].x-p.x:p.x-a.getXDomain(a.data.targets)[0]:1,n=[p.x-r,p.x]);n&&a.updateXDomain(null,!0,!0,!1,n),a.updateTargets(a.data.targets),a.redraw({flow:{index:p.index,length:l,duration:S(t.duration)?t.duration:a.config.transition_duration,done:t.done,orgDataCount:u},withLegend:!0,withTransition:u>1,withTrimXDomain:!1,withUpdateXAxis:!0})}()}.bind(this))}},Fi=p(10),Bi=function(){function t(t){this.owner=void 0,this.config=void 0,this.scale=void 0;var e=He(),i=t.config,n=t.params;this.owner=t,this.config=i,this.scale=e,!i.noTransition&&n.config.transition_duration||(i.withoutTransition=!0),i.range=this.scaleExtent((n.orgXScale||e).range())}t.getSizeFor1Char=function(t){var e=this,n={w:5.5,h:11.5};return t.empty()||t.select("text").text("0").call(function(t){i(this,e);try{var a=t.node().getBBox(),r=a.width,s=a.height;r&&s&&(n.w=r,n.h=s)}catch(t){}finally{t.text("")}}.bind(this)),this.getSizeFor1Char=function(){return i(this,e),n}.bind(this),n};var e=t.prototype;return e.getTickTransformSetter=function(t){var e=this,n=this.config,a="x"===t?function(t){return i(this,e),"translate("+(t+n.tickOffset)+",0)"}.bind(this):function(t){return i(this,e),"translate(0,"+t+")"}.bind(this);return function(t,n){var r=this;i(this,e),t.attr("transform",function(t){return i(this,r),S(t)?a(Math.ceil(n(t))):null}.bind(this))}.bind(this)},e.scaleExtent=function(t){var e=t[0],i=t[t.length-1];return e0?s:1,o]).range(t.range());l=u.ticks();for(var h=o.toFixed().length;l.length>15;h--)l=u.ticks(h);l.splice(0,1,s),l.splice(l.length-1,1,o)}l=l.map(function(t){return i(this,n),C(t)&&R(t)&&!isNaN(t)&&Math.round(10*t)/10||t}.bind(this))}else{for(var g=Math.ceil(s);g0&&l[0]>0&&l.unshift(l[0]-(l[1]-l[0]))}return l},e.copyScale=function(){var t=this.scale.copy();return t.domain().length||t.domain(this.scale.domain()),t.type=this.scale.type,t},e.textFormatted=function(t){var e=this.config.tickFormat,i=/\d+\.\d+0{5,}\d$/.test(t)?+(t+"").replace(/0+\d$/,""):t,n=e?e(i):i;return L(n)?n:""},e.transitionise=function(t){var e=this.config,i=t;if(e.withoutTransition)i=t.interrupt();else if(e.transition||!this.owner.params.noTransition)try{i=t.transition(e.transition)}catch(t){}return i},t}(),Ni=function(){function t(t){void 0===t&&(t={}),this.helper=void 0,this.config=void 0,this.params=void 0,this.g=void 0,this.generatedTicks=void 0;var e={innerTickSize:6,outerTickSize:t.outerTick?6:0,orient:"bottom",range:[],tickArguments:null,tickCentered:null,tickCulling:!0,tickFormat:null,tickLength:9,tickOffset:0,tickPadding:3,tickValues:null,transition:null,noTransition:t.noTransition};e.tickLength=Math.max(e.innerTickSize,0)+e.tickPadding,this.config=e,this.params=t,this.helper=new Bi(this)}var e=t.prototype;return e.create=function(t){var e=this,n=e.config,r=e.helper,s=e.params,o=r.scale,l=n.orient,c=this.splitTickText.bind(e),d=/^(left|right)$/.test(l),u=/^(top|bottom)$/.test(l),h=r.getTickTransformSetter(u?"x":"y"),g=h===r.axisX?"y":"x",f=/^(top|left)$/.test(l)?-1:1,p=s.tickTextRotate;this.config.range=o.rangeExtent?o.rangeExtent():r.scaleExtent((s.orgXScale||o).range());var v,x=n.innerTickSize,b=n.tickLength,_=n.range,m=s.id,y=m&&/^(x|y|y2)$/.test(m)?s.config["axis_"+m+"_tick_text_position"]:{x:0,y:0},T="subX"===m?"subchart_axis_x":"axis_"+m,w=s.config[T+"_show"],A=!!w&&s.config[T+"_tick_show"],S=!!w&&s.config[T+"_tick_text_show"];t.each((function(){var t=this,m=(0,a.select)(this),T=this.__chart__||o,w=r.copyScale();v=m,this.__chart__=w,n.tickOffset=s.isCategory?Math.ceil((w(1)-w(0))/2):0;var k=m.selectAll(".domain").data([0]);if(k.enter().append("path").attr("class","domain").merge(k).attr("d",function(){i(this,t);var e=n.outerTickSize*f;return u?"M"+_[0]+","+e+"V0H"+_[1]+"V"+e:"M"+e+","+_[0]+"H0V"+_[1]+"H"+e}.bind(this)),A||S){var C=n.tickValues||r.generateTicks(w,d);e.generatedTicks=C;var E=m.selectAll(".tick").data(C,w),L=E.enter().insert("g",".domain").attr("class","tick"),O=E.exit().remove();E=L.merge(E),A&&L.append("line"),S&&L.append("text");var P=Bi.getSizeFor1Char(E),I=[],D=E.select("text").selectAll("tspan").data(function(e,n){var a=this;i(this,t);var o=s.tickMultiline?c(e,w,C,d,P.w):X(r.textFormatted(e))?r.textFormatted(e).concat():[r.textFormatted(e)];return I[n]=o.length,o.map(function(t){return i(this,a),{index:n,splitted:t}}.bind(this))}.bind(this));D.exit().remove(),(D=D.enter().append("tspan").merge(D).text(function(e){return i(this,t),e.splitted}.bind(this))).attr("x",u?0:b*f).attr("dx",function(){i(this,t);var e=0;return/(top|bottom)/.test(l)&&p&&(e=8*Math.sin(Math.PI*(p/180))*("top"===l?-1:1)),e+(y.x||0)}.bind(this)()).attr("dy",function(e,n){i(this,t);var a=0;return"top"!==l&&(a=P.h,0===n&&(a=d?-((I[e.index]-1)*(P.h/2)-3):0===y.y?".71em":0)),R(a)&&y.y?a+y.y:a||".71em"}.bind(this));var z=E.select("line"),M=E.select("text");if(L.select("line").attr(g+"2",x*f),L.select("text").attr(g,b*f),e.setTickLineTextPosition(z,M),s.tickTitle){var $=M.select("title");($.empty()?M.append("title"):$).text(function(e){return i(this,t),s.tickTitle[e]}.bind(this))}if(w.bandwidth){var F=w,B=F.bandwidth()/2;T=function(e){return i(this,t),F(e)+B}.bind(this),w=T}else T.bandwidth?T=w:h(O,w);E=s.owner.state.flowing?r.transitionise(E):s.owner.$T(E),h(L,T),h(E.style("opacity",null),w)}})),this.g=v},e.getGeneratedTicks=function(t){var e,n=this,a=(null==(e=this.generatedTicks)?void 0:e.length)-1,r=this.generatedTicks;if(a>t){var s=Math.round(a/t+.1);r=this.generatedTicks.map(function(t,e){return i(this,n),e%s==0?t:null}.bind(this)).filter(function(t){return i(this,n),null!==t}.bind(this)).splice(0,t)}return r},e.getTickXY=function(){var t=this.config,e={x:0,y:0};return this.params.isCategory&&(e.x=t.tickCentered?0:t.tickOffset,e.y=t.tickCentered?t.tickOffset:0),e},e.getTickSize=function(t){var e=this.helper.scale,i=this.config,n=i,a=n.innerTickSize,r=n.range,s=e(t)+(i.tickCentered?0:i.tickOffset);return r[0]0?0:1]:"middle"}.bind(this),h=function(t){return i(this,n),t?"rotate("+t+")":null}.bind(this),g=function(t){return i(this,n),t?11.5-2.5*(t/("bottom"===o?15:23))*(t>0?1:-1):l}.bind(this);switch(o){case"bottom":t.attr("x1",a.x).attr("x2",a.x).attr("y2",this.getTickSize.bind(this)),e.attr("x",0).attr("y",g(d)).style("text-anchor",u(d)).attr("transform",h(d));break;case"top":t.attr("x2",0).attr("y2",-s),e.attr("x",0).attr("y",2*-g(d)).style("text-anchor",u(d)).attr("transform",h(d));break;case"left":t.attr("x2",-s).attr("y1",a.y).attr("y2",a.y),e.attr("x",-l).attr("y",c).style("text-anchor","end");break;case"right":t.attr("x2",s).attr("y2",0),e.attr("x",l).attr("y",0).style("text-anchor","start")}},e.splitTickText=function(t,e,i,n,a){var r=this.params,s=this.helper.textFormatted(t),o=C(s)&&s.indexOf("\n")>-1?s.split("\n"):[];if(o.length)return o;if(X(s))return s;var l=r.tickWidth;return(!l||l<=0)&&(l=n?95:r.isCategory?Math.ceil(r.isInverted?e(i[0])-e(i[1]):e(i[1])-e(i[0]))-12:110),function t(e,i){for(var n,r,s,o=1;o=0||i.hasRadar},e.isCustomX=function(){var t=this.owner.config;return!this.isTimeSeries()&&(t.data_x||$(t.data_xs))},e.isTimeSeries=function(t){return void 0===t&&(t="x"),"timeseries"===this.owner.config["axis_"+t+"_type"]},e.isLog=function(t){return void 0===t&&(t="x"),"log"===this.owner.config["axis_"+t+"_type"]},e.isTimeSeriesY=function(){return this.isTimeSeries("y")},e.getAxisType=function(t){void 0===t&&(t="x");var e="linear";return this.isTimeSeries(t)?e=this.owner.config.axis_x_localtime?"time":"utc":this.isLog(t)&&(e="log"),e},e.init=function(){var t=this,e=this.owner,n=e.config,a=e.$el,r=a.main,s=a.axis,o=e.state.clip,l=n.axis_rotated,c=["x","y"];n.axis_y2_show&&c.push("y2"),c.forEach(function(a){var c=this;i(this,t);var d=this.getAxisClassName(a),u=_t["axis"+a.toUpperCase()+"Label"];s[a]=r.append("g").attr("class",d).attr("clip-path",function(){i(this,c);var t=null;return"x"===a?t=o.pathXAxis:"y"===a&&(t=o.pathYAxis),t}.bind(this)).attr("transform",e.getTranslate(a)).style("visibility",n["axis_"+a+"_show"]?null:"hidden"),s[a].append("text").attr("class",u).attr("transform",["rotate(-90)",null]["x"===a?+!l:+l]).style("text-anchor",function(){return i(this,c),this.textAnchorForAxisLabel(a)}.bind(this)),this.generateAxes(a)}.bind(this))},e.setOrient=function(){var t=this.owner.config,e=t.axis_rotated,i=t.axis_y_inner,n=t.axis_y2_inner;this.orient={x:e?"left":"bottom",y:e?i?"top":"bottom":i?"right":"left",y2:e?n?"bottom":"top":n?"left":"right",subX:e?"left":"bottom"}},e.generateAxes=function(t){var e,n=this,a=this.owner,r=a.config,s=[],o=r["axis_"+t+"_axes"],l=r.axis_rotated;"x"===t?e=l?Fi.axisLeft:Fi.axisBottom:"y"===t?e=l?Fi.axisBottom:Fi.axisLeft:"y2"===t&&(e=l?Fi.axisTop:Fi.axisRight),o.length&&o.forEach(function(r){var o=this;i(this,n);var l=r.tick||{},c=a.scale[t].copy();r.domain&&c.domain(r.domain),s.push(e(c).ticks(l.count).tickFormat(k(l.format)?l.format.bind(a.api):function(t){return i(this,o),t}.bind(this)).tickValues(l.values).tickSizeOuter(!1===l.outer?0:6))}.bind(this)),this.axesList[t]=s},e.updateAxes=function(){var t=this,e=this.owner,n=e.config,a=e.$el.main,r=e.$T;Object.keys(this.axesList).forEach(function(s){var o=this;i(this,t);var l=n["axis_"+s+"_axes"],c=e.scale[s].copy(),d=c.range();this.axesList[s].forEach(function(t,u){var h=this;i(this,o);var g=t.scale().range();d.every(function(t,e){return i(this,h),t===g[e]}.bind(this))||t.scale().range(d);var f=this.getAxisClassName(s)+"-"+(u+1),p=a.select("."+f.replace(/\s/,"."));p.empty()?p=a.append("g").attr("class",f).style("visibility",n["axis_"+s+"_show"]?null:"hidden").call(t):(l[u].domain&&c.domain(l[u].domain),r(p).call(t.scale(c))),p.attr("transform",e.getTranslate(s,u+1))}.bind(this))}.bind(this))},e.setAxis=function(t,e,i,n){var a=this.owner;"subX"!==t&&(this.tick[t]=this.getTickValues(t)),this[t]=this.getAxis(t,e,i,!("x"!==t||!(a.scale.zoom||a.config.subchart_show||a.state.resizing))||n)},e.getAxis=function(t,e,n,a,r){var s,o=this,l=this.owner,c=l.config,d=/^(x|subX)$/.test(t),u=d?"x":t,h=d&&this.isCategorized(),g=this.orient[t],f=r?0:l.getAxisTickRotate(u);if(d)s="subX"===t?l.format.subXAxisTick:l.format.xAxisTick;else{var p=c["axis_"+t+"_tick_format"];k(p)&&(s=p.bind(l.api))}var v=this.tick[u],x=at({outerTick:n,noTransition:a,config:c,id:t,tickTextRotate:f,owner:l},d&&{isCategory:h,isInverted:c.axis_x_inverted,tickMultiline:c.axis_x_tick_multiline,tickWidth:c.axis_x_tick_width,tickTitle:h&&c.axis_x_tick_tooltip&&l.api.categories(),orgXScale:l.scale.x});d||(x.tickStepSize=c["axis_"+u+"_tick_stepSize"]);var b=new Ni(x).scale(d&&l.scale.zoom||e).orient(g);if(d&&this.isTimeSeries()&&v&&!k(v)){var _=dt.bind(l);v=v.map(function(t){return i(this,o),_(t)}.bind(this))}else!d&&this.isTimeSeriesY()&&(b.ticks(c.axis_y_tick_time_value),v=null);v&&b.tickValues(v),b.tickFormat(s||!d&&l.isStackNormalized()&&function(t){return i(this,o),t+"%"}.bind(this)),h&&(b.tickCentered(c.axis_x_tick_centered),M(c.axis_x_tick_culling)&&(c.axis_x_tick_culling=!1));var m=c["axis_"+u+"_tick_count"];return m&&b.ticks(m),b},e.updateXAxisTickValues=function(t,e){var i,n=this.owner,a=n.config,r=a.axis_x_tick_fit,s=a.axis_x_tick_count;if((r||s&&r)&&(i=n.mapTargetsToUniqueXs(t),this.isCategorized()&&s>i.length&&(s=i.length),i=this.generateTickValues(i,s,this.isTimeSeries())),e)e.tickValues(i);else if(this.x){var o;this.x.tickValues(i),null==(o=this.subX)||o.tickValues(i)}return i},e.getId=function(t){var e=this.owner,i=e.config,n=e.scale,a=i.data_axes[t];return a&&n[a]||(a="y"),a},e.getXAxisTickFormat=function(t){var e,n=this,a=this.owner,r=a.config,s=a.format,o=t&&r.subchart_axis_x_tick_format||r.axis_x_tick_format,l=this.isTimeSeries(),c=this.isCategorized();return o?k(o)?e=o.bind(a.api):l&&(e=function(t){return i(this,n),t?s.axisTime(o)(t):""}.bind(this)):e=l?s.defaultAxisTime:c?a.categoryName:function(t){return i(this,n),t<0?t.toFixed(0):t}.bind(this),k(e)?function(t){return i(this,n),e.apply(a,c?[t,a.categoryName(t)]:[t])}.bind(this):e},e.getTickValues=function(t){var e=this.owner,i=e.config["axis_"+t+"_tick_values"],n=e[t+"Axis"];return(k(i)?i.call(e.api):i)||(n?n.tickValues():void 0)},e.getLabelOptionByAxisId=function(t){return this.owner.config["axis_"+t+"_label"]},e.getLabelText=function(t){var e=this.getLabelOptionByAxisId(t);return C(e)?e:e?e.text:null},e.setLabelText=function(t,e){var i=this.owner.config,n=this.getLabelOptionByAxisId(t);C(n)?i["axis_"+t+"_label"]=e:n&&(n.text=e)},e.getLabelPosition=function(t,e){var n=this,a=this.owner.config.axis_rotated,r=this.getLabelOptionByAxisId(t),s=z(r)&&r.position?r.position:e[+!a],o=function(t){return i(this,n),!!~s.indexOf(t)}.bind(this);return{isInner:o("inner"),isOuter:o("outer"),isLeft:o("left"),isCenter:o("center"),isRight:o("right"),isTop:o("top"),isMiddle:o("middle"),isBottom:o("bottom")}},e.getAxisLabelPosition=function(t){return this.getLabelPosition(t,"x"===t?["inner-top","inner-right"]:["inner-right","inner-top"])},e.getLabelPositionById=function(t){return this.getAxisLabelPosition(t)},e.xForAxisLabel=function(t){var e=this.owner,i=e.state,n=i.width,a=i.height,r=this.getAxisLabelPosition(t),s=r.isMiddle?-a/2:0;return this.isHorizontal(e,"x"!==t)?s=r.isLeft?0:r.isCenter?n/2:n:r.isBottom&&(s=-a),s},e.dxForAxisLabel=function(t){var e=this.owner,i=this.getAxisLabelPosition(t),n=i.isBottom?"0.5em":"0";return this.isHorizontal(e,"x"!==t)?n=i.isLeft?"0.5em":i.isRight?"-0.5em":"0":i.isTop&&(n="-0.5em"),n},e.textAnchorForAxisLabel=function(t){var e=this.owner,i=this.getAxisLabelPosition(t),n=i.isMiddle?"middle":"end";return this.isHorizontal(e,"x"!==t)?n=i.isLeft?"start":i.isCenter?"middle":"end":i.isBottom&&(n="start"),n},e.dyForAxisLabel=function(t){var e,i=this.owner,n=i.config,a=n.axis_rotated,r=this.getAxisLabelPosition(t).isInner,s=n["axis_"+t+"_tick_rotate"]?i.getHorizontalAxisHeight(t):0,o=this.getMaxTickWidth(t);if("x"===t){var l=n.axis_x_height;e=a?r?"1.2em":-25-o:r?"-0.5em":l?l-10:s?s-10:"3em"}else e={y:["-0.5em",10,"3em","1.2em",10],y2:["1.2em",-20,"-2.2em","-0.5em",15]}[t],e=a?r?e[0]:s?s*("y2"===t?-1:1)-e[1]:e[2]:r?e[3]:(e[4]+(n["axis_"+t+"_inner"]?0:o+e[4]))*("y"===t?-1:1);return e},e.getMaxTickWidth=function(t,e){var n=this,a=this.owner,r=a.config,s=a.state.current,o=a.$el,l=o.svg,c=o.chart,d=s.maxTickWidths[t],u=0;if(e||!r["axis_"+t+"_show"]||d.size>0&&0===a.filterTargetsToShow().length)return d.size;if(l){var h=/^y2?$/.test(t),g=a.filterTargetsToShow(a.data.targets),f=a.scale[t].copy().domain(a["get"+(h?"Y":"X")+"Domain"](g,t)),p=f.domain(),v=p[0]===p[1]&&p.every(function(t){return i(this,n),t>0}.bind(this)),x=X(d.domain)&&d.domain[0]===d.domain[1]&&d.domain.every(function(t){return i(this,n),t>0}.bind(this));if(v||x)return d.size;d.domain=p,h||d.ticks.splice(0);var b=this.getAxis(t,f,!1,!1,!0),_=r["axis_"+t+"_tick_count"];!r["axis_"+t+"_tick_values"]&&_&&b.tickValues(this.generateTickValues(p,_,h?this.isTimeSeriesY():this.isTimeSeries())),h||this.updateXAxisTickValues(g,b);var m=c.append("svg").style("visibility","hidden").style("position","fixed").style("top","0").style("left","0");b.create(m),m.selectAll("text").each((function(t,e){var i=this.getBoundingClientRect().width;u=Math.max(u,i),h||(d.ticks[e]=i)})),m.remove()}return u>0&&(d.size=u),d.size},e.getXAxisTickTextY2Overflow=function(t){var e=this.owner,i=e.axis,n=e.config,a=e.state,r=e.getAxisTickRotate("x");if((i.isCategorized()||i.isTimeSeries())&&n.axis_x_tick_fit&&!n.axis_x_tick_culling&&!n.axis_x_tick_multiline&&r>0&&r<90){var s=a.current.width-e.getCurrentPaddingLeft(),o=this.getXAxisTickMaxOverflow(r,s-t),l=Math.max(0,o)+t;return Math.min(l,s/2)}return 0},e.getXAxisTickMaxOverflow=function(t,e){for(var i=this.owner,n=i.axis,a=i.config,r=i.state,s=n.isTimeSeries(),o=r.current.maxTickWidths.x.ticks,l=o.length,c=r.axis.x.padding,d=c.left,u=c.right,h=0,g=l-(s&&a.axis_x_tick_fit?.5:0),f=0;f2){var o,l=this.isCategorized(),c=s-2,d=t[0],u=t[t.length-1];r=[d];for(var h=0;h=f)&&(e=!0,t.preventDefault())}.bind(this);l.on("touchstart",function(t){i(this,n),s.event=t,a.updateEventRect()}.bind(this)).on("touchstart.eventRect touchmove.eventRect",function(t){if(i(this,n),s.event=t,!l.empty()&&l.classed(Rt.eventRect)){if(s.dragging||s.flowing||a.hasArcType()||t.touches.length>1)return;p(t),d(l.node())}else u()}.bind(this),!0).on("touchend.eventRect",function(t){i(this,n),s.event=t,!l.empty()&&l.classed(Rt.eventRect)&&(a.hasArcType()||!a.toggleShape||s.cancelClick)&&s.cancelClick&&(s.cancelClick=!1)}.bind(this),!0),c.on("touchstart",function(t){i(this,n),s.event=t;var e=t.target;e&&e!==l.node()&&u()}.bind(this))},updateEventRect:function(t,e){var n=this;void 0===e&&(e=!1);var a=this.state,r=this.$el,s=a,o=s.eventReceiver,l=s.width,c=s.height,d=s.rendered,u=s.resizing,h=t||r.eventRect,g=function(){i(this,n),o&&(o.rect=h.node().getBoundingClientRect())}.bind(this);(!d||u||e)&&(h.attr("x",0).attr("y",0).attr("width",l).attr("height",c),d&&!e||h.classed(Rt.eventRect,!0)),g()},updateEventRectData:function(){var t,e,n,a,r=this,s=this,o=s.config,l=s.scale,c=s.state,d=l.zoom||l.x,u=o.axis_rotated;if(s.isMultipleX())t=0,e=0,n=c.width,a=c.height;else{var h,g;if(s.axis.isCategorized())h=s.getEventRectWidth(),g=function(t){return i(this,r),d(t.x)-h/2}.bind(this);else{var f=function(t){var e=t.index;return i(this,r),{prev:s.getPrevX(e),next:s.getNextX(e)}}.bind(this);h=function(t){var e=this;i(this,r);var n,a=f(t),s=d.domain();return null===a.prev&&null===a.next?n=u?c.height:c.width:null===a.prev?n=(d(a.next)+d(t.x))/2:null===a.next?n=d(s[1])-(d(a.prev)+d(t.x))/2:(Object.keys(a).forEach(function(t,n){var r;i(this,e),a[t]=null!=(r=a[t])?r:s[n]}.bind(this)),n=Math.max(0,(d(a.next)-d(a.prev))/2)),n}.bind(this),g=function(t){i(this,r);var e=f(t);return null===e.prev&&null===e.next?0:null===e.prev?d(d.domain()[0]):(d(t.x)+d(e.prev))/2}.bind(this)}t=u?0:g,e=u?g:0,n=u?c.width:h,a=u?h:c.height}var p=c.eventReceiver,v=function(t,e){return i(this,r),k(t)?t(e):t}.bind(this);p.coords.splice(p.data.length),p.data.forEach(function(s,o){i(this,r),p.coords[o]={x:v(t,s),y:v(e,s),w:v(n,s),h:v(a,s)}}.bind(this))},selectRectForMultipleXs:function(t){var e=this,n=this,a=n.config,r=n.state,s=n.filterTargetsToShow(n.data.targets);if(!r.dragging&&!n.hasArcType(s)){var o=H(r.event,t),l=n.findClosestFromTargets(s,o);if(!r.mouseover||l&&l.id===r.mouseover.id||(a.data_onout.call(n.api,r.mouseover),r.mouseover=void 0),l){var c=(n.isBubbleType(l)||n.isScatterType(l)||!a.tooltip_grouped?[l]:n.filterByX(s,l.x)).map(function(t){return i(this,e),n.addName(t)}.bind(this));n.showTooltip(c,t),n.setExpand(l.index,l.id,!0),n.showGridFocus(c),(n.isBarType(l.id)||n.dist(l,o)-1?s.data[a]:null}.bind(this);o.on("mouseover",function(t){i(this,e),r.event=t,n.updateEventRect()}.bind(this)).on("mousemove",(function(t){var e=l(t);if(r.event=t,e){var i=e.index,c=a.line_step_type;if(a.line_step_tooltipMatch&&n.hasType("step")&&/^step\-(before|after)$/.test(c)){var d=n.scale.zoom||n.scale.x,u=n.axis.xs[i],h=d.invert(H(t,this)[0]);"step-after"===c&&hu&&(i+=1)}r.dragging||r.flowing||n.hasArcType()||a.tooltip_grouped&&i===s.currentIdx||(i!==s.currentIdx&&(n.setOverOut(!1,s.currentIdx),s.currentIdx=i),-1===i?n.unselectRect():n.selectRectForSingle(this,o,i),n.setOverOut(-1!==i,i))}})).on("mouseout",function(t){i(this,e),r.event=t,a&&!n.hasArcType()&&-1!==s.currentIdx&&(n.unselectRect(),n.setOverOut(!1,s.currentIdx),s.currentIdx=-1)}.bind(this))}return o},clickHandlerForSingleX:function(t,e){var i=e,n=i.config,a=i.state,r=i.$el.main;if(!t||i.hasArcType()||a.cancelClick)a.cancelClick&&(a.cancelClick=!1);else{var s=t.index;r.selectAll("."+Mt.shape+"-"+s).each((function(t){(n.data_selection_grouped||i.isWithinShape(this,t))&&(null==i.toggleShape||i.toggleShape(this,t,s),n.data_onclick.bind(i.api)(t,this))}))}},generateEventRectsForMultipleXs:function(t){var e=this,n=this,a=n.state;t.on("click",(function(t){a.event=t,n.clickHandlerForMultipleXS.bind(this)(n)})),"mouse"===a.inputType&&t.on("mouseover mousemove",(function(t){a.event=t,n.selectRectForMultipleXs(this)})).on("mouseout",function(t){i(this,e),a.event=t,n.config&&!n.hasArcType()&&n.unselectRect()}.bind(this))},clickHandlerForMultipleXS:function(t){var e=t,i=e.config,n=e.state,a=e.filterTargetsToShow(e.data.targets);if(!e.hasArcType(a)){var r=H(n.event,this),s=e.findClosestFromTargets(a,r);s&&(e.isBarType(s.id)||e.dist(s,r)1&&(a=a[n[1]]),null!=(e=a)&&e.size()&&(l[t]=a)}.bind(this)),e.hideGridFocus(),e.setFlowList(l,t)}},setFlowList:function(t,e){var n,a=this,r=this,s=e.flow,o=e.targets,l=s,c=l.duration,d=void 0===c?e.duration:c,u=l.index,h=l.length,g=l.orgDataCount,f=r.getFlowTransform(o,g,u,h),p=xe();p.add(Object.keys(t).map(function(e){var s=this;return i(this,a),n=t[e].transition().ease(Yi.easeLinear).duration(d),n="axis.x"===e?n.call(function(t){i(this,s),r.axis.x.setTransition(t).create(t)}.bind(this)):"region.list"===e?n.filter(r.isRegionOnX).attr("transform",f):n.attr("transform",f)}.bind(this))),n.call(p,function(){i(this,a),r.cleanUpFlow(t,e)}.bind(this))},cleanUpFlow:function(t,e){var n=this,a=this,r=a.config,s=a.state,o=a.$el.svg,l=r.axis_rotated,c=e.flow,d=e.shape,u=e.xv,h=d.pos,g=h.cx,f=h.cy,p=h.xForText,v=h.yForText,x=c,b=x.done,_=void 0===b?function(){i(this,n)}.bind(this):b,m=x.length;m&&(["circle","text","shape","eventRect"].forEach(function(t){i(this,n);for(var e=[],a=0;a=0?"":h.URL.split("#")[0])+"#"+t+")"},appendClip:function(t,e){e&&t.append("clipPath").attr("id",e).append("rect")},setXAxisClipPath:function(t){var e=this.config,i=this.state,n=i.margin,a=i.width,r=i.height,s=e.axis_rotated,o=Math.max(30,n.left)-(s?0:20),l=s?-(1+o):-(o-1),c=-Math.max(15,n.top),d=s?n.left+20:a+10+o,u=(s?n.top+r+10:n.bottom)+20;t.attr("x",l).attr("y",c).attr("width",d).attr("height",u)},setYAxisClipPath:function(t){var e,i=this.config,n=this.state,a=n.margin,r=n.width,s=n.height,o=i.axis_rotated,l=Math.max(30,a.left)-(o?20:0),c=i.axis_y_inner,d=c&&!o?i.axis_y_label.text?-20:-1:o?-(1+l):-(l-1),u=-(o?20:a.top),h=(o?r+15+l:a.left+20)+(c?20:0),g=(o?a.bottom+("fit"===(null==(e=i.padding)?void 0:e.mode)?10:0):a.top+s)+10;t.attr("x",d).attr("y",u).attr("width",h).attr("height",g)},updateXAxisTickClip:function(){var t=this,e=t.config,i=t.state,n=i.clip,a=i.xAxisHeight,r=t.$el.defs,s=t.getHorizontalAxisHeight("x");if(r&&!n.idXAxisTickTexts){var o=n.id+"-xaxisticktexts";t.appendClip(r,o),n.pathXAxisTickTexts=t.getClipPath(n.idXAxisTickTexts),n.idXAxisTickTexts=o}!e.axis_x_tick_multiline&&t.getAxisTickRotate("x")&&s!==a&&(t.setXAxisTickClipWidth(),t.setXAxisTickTextClipPathWidth()),t.state.xAxisHeight=s},setXAxisTickClipWidth:function(){var t=this,e=t.config,i=t.state.current.maxTickWidths,n=t.getAxisTickRotate("x");if(!e.axis_x_tick_multiline&&n){var a=Math.sin(Math.PI/180*Math.abs(n));i.x.clipPath=(t.getHorizontalAxisHeight("x")-20)/a}else i.x.clipPath=null},setXAxisTickTextClipPathWidth:function(){var t=this.state,e=t.clip,i=t.current,n=this.$el.svg;n&&n.select("#"+e.idXAxisTickTexts+" rect").attr("width",i.maxTickWidths.x.clipPath).attr("height",30)}},Ui=void 0,Zi=function(t){return i(this,Ui),S(t.position)||"end"}.bind(void 0),qi=function(t){return i(this,Ui),"start"===t.position?4:"middle"===t.position?0:-4}.bind(void 0);function Ki(t,e,n){var a=this;return function(r){i(this,a);var s=t?0:e;return"start"===r.position?s=t?-n:0:"middle"===r.position&&(s=(t?-n:e)/2),s}.bind(this)}function Ji(t,e){"grid"===e&&t.each((function(){var t=this,e=(0,a.select)(this);["x1","x2","y1","y2"].forEach(function(n){return i(this,t),e.attr(n,Math.ceil(+e.attr(n)))}.bind(this))}))}var Qi={hasGrid:function(){var t=this,e=this.config;return["x","y"].some(function(n){return i(this,t),e["grid_"+n+"_show"]||e["grid_"+n+"_lines"].length}.bind(this))},initGrid:function(){var t=this;t.hasGrid()&&t.initGridLines(),t.initFocusGrid()},initGridLines:function(){var t=this,e=t.config,i=t.state.clip,n=t.$el;(e.grid_x_lines.length||e.grid_y_lines.length)&&(n.gridLines.main=n.main.insert("g","."+vt.chart+(e.grid_lines_front?" + *":"")).attr("clip-path",i.pathGrid).attr("class",Lt.grid+" "+Lt.gridLines),n.gridLines.main.append("g").attr("class",Lt.xgridLines),n.gridLines.main.append("g").attr("class",Lt.ygridLines),n.gridLines.x=(0,a.selectAll)([]))},updateXGrid:function(t){var e=this,n=this,r=n.config,s=n.scale,o=n.state,l=n.$el,c=l.main,d=l.grid,u=r.axis_rotated,h=n.generateGridData(r.grid_x_type,s.x),g=n.axis.isCategorized()?n.axis.x.tickOffset():0,f=function(t){return i(this,e),(s.zoom||s.x)(t)+g*(u?-1:1)}.bind(this);o.xgridAttr=u?{x1:0,x2:o.width,y1:f,y2:f}:{x1:f,x2:f,y1:0,y2:o.height},d.x=c.select("."+Lt.xgrids).selectAll("."+Lt.xgrid).data(h),d.x.exit().remove(),d.x=d.x.enter().append("line").attr("class",Lt.xgrid).merge(d.x),t||d.x.each((function(){var t=this,e=(0,a.select)(this);Object.keys(o.xgridAttr).forEach(function(n){var a=this;i(this,t),e.attr(n,o.xgridAttr[n]).style("opacity",function(){return i(this,a),e.attr(u?"y1":"x1")===(u?o.height:0)?"0":null}.bind(this))}.bind(this))}))},updateYGrid:function(){var t=this,e=this,n=e.axis,a=e.config,r=e.scale,s=e.state,o=e.$el,l=o.grid,c=o.main,d=a.axis_rotated,u=function(e){return i(this,t),Math.ceil(r.y(e))}.bind(this),h=n.y.getGeneratedTicks(a.grid_y_ticks)||e.scale.y.ticks(a.grid_y_ticks);l.y=c.select("."+Lt.ygrids).selectAll("."+Lt.ygrid).data(h),l.y.exit().remove(),l.y=l.y.enter().append("line").attr("class",Lt.ygrid).merge(l.y),l.y.attr("x1",d?u:0).attr("x2",d?u:s.width).attr("y1",d?0:u).attr("y2",d?s.height:u),Ji(l.y,"grid")},updateGrid:function(){var t=this,e=t.$el,i=e.grid;e.gridLines.main||t.initGridLines(),i.main.style("visibility",t.hasArcType()?"hidden":null),t.hideGridFocus(),t.updateXGridLines(),t.updateYGridLines()},updateXGridLines:function(){var t=this,e=this,n=e.config,a=e.$el,r=a.gridLines,s=a.main,o=e.$T,l=n.axis_rotated;n.grid_x_show&&e.updateXGrid();var c=s.select("."+Lt.xgridLines).selectAll("."+Lt.xgridLine).data(n.grid_x_lines);o(c.exit()).style("opacity","0").remove();var d=c.enter().append("g");d.append("line").style("opacity","0"),d.append("text").attr("transform",l?null:"rotate(-90)").attr("dy",-5).style("opacity","0"),o((c=d.merge(c)).attr("class",function(e){return i(this,t),(Lt.xgridLine+" "+(e.class||"")).trim()}.bind(this)).select("text").attr("text-anchor",Zi).attr("dx",qi)).text(function(e){return i(this,t),e.text}.bind(this)).style("opacity",null),r.x=c},updateYGridLines:function(){var t=this,e=this,n=e.config,a=e.state,r=a.width,s=a.height,o=e.$el,l=e.$T,c=n.axis_rotated;n.grid_y_show&&e.updateYGrid();var d=o.main.select("."+Lt.ygridLines).selectAll("."+Lt.ygridLine).data(n.grid_y_lines);l(d.exit()).style("opacity","0").remove();var u=d.enter().append("g");u.append("line").style("opacity","0"),u.append("text").attr("transform",c?"rotate(-90)":"").style("opacity","0"),d=u.merge(d);var h=e.yv.bind(e);l(d.attr("class",function(e){return i(this,t),(Lt.ygridLine+" "+(e.class||"")).trim()}.bind(this)).select("line")).attr("x1",c?h:0).attr("x2",c?h:r).attr("y1",c?0:h).attr("y2",c?s:h).style("opacity",null),l(d.select("text").attr("text-anchor",Zi).attr("dx",qi)).attr("dy",-5).attr("x",Ki(c,r,s)).attr("y",h).text(function(e){return i(this,t),e.text}.bind(this)).style("opacity",null),o.gridLines.y=d},redrawGrid:function(t){var e=this,n=this,a=n.config.axis_rotated,r=n.state,s=r.width,o=r.height,l=n.$el.gridLines,c=n.$T,d=n.xv.bind(n),u=l.x.select("line"),h=l.x.select("text");return u=c(u,t).attr("x1",a?0:d).attr("x2",a?s:d).attr("y1",a?d:0).attr("y2",a?d:o),h=c(h,t).attr("x",Ki(!a,s,o)).attr("y",d).text(function(t){return i(this,e),t.text}.bind(this)),[u.style("opacity",null),h.style("opacity",null)]},initFocusGrid:function(){var t=this,e=t.config,i=t.state.clip,n=t.$el,a=e.grid_front,r="."+(a&&n.gridLines.main?Lt.gridLines:vt.chart)+(a?" + *":""),s=n.main.insert("g",r).attr("clip-path",i.pathGrid).attr("class",Lt.grid);n.grid.main=s,e.grid_x_show&&s.append("g").attr("class",Lt.xgrids),e.grid_y_show&&s.append("g").attr("class",Lt.ygrids),e.interaction_enabled&&e.grid_focus_show&&(s.append("g").attr("class",Et.xgridFocus).append("line").attr("class",Et.xgridFocus),e.grid_focus_y&&!e.tooltip_grouped&&s.append("g").attr("class",Et.ygridFocus).append("line").attr("class",Et.ygridFocus))},showGridFocus:function(t){var e=this,n=this,r=n.config,s=n.state,o=s.width,l=s.height,c=r.axis_rotated,d=n.$el.main.selectAll("line."+Et.xgridFocus+", line."+Et.ygridFocus),u=(t||[d.datum()]).filter(function(t){return i(this,e),t&&S(n.getBaseValue(t))}.bind(this));if(r.tooltip_show&&0!==u.length&&!n.hasType("bubble")&&!n.hasArcType()){var h=r.grid_focus_edge&&!r.tooltip_grouped,g=n.xx.bind(n);d.style("visibility",null).data(u.concat(u)).each((function(t){var e,r=this,s=(0,a.select)(this),d={x:g(t),y:n.getYScaleById(t.id)(t.value)};if(s.classed(Et.xgridFocus))e=c?[null,d.x,h?d.y:o,d.x]:[d.x,h?d.y:null,d.x,l];else{var u="y2"===n.axis.getId(t.id);e=c?[d.y,h&&!u?d.x:null,d.y,h&&u?d.x:l]:[h&&u?d.x:null,d.y,h&&!u?d.x:o,d.y]}["x1","y1","x2","y2"].forEach(function(t,n){return i(this,r),s.attr(t,e[n])}.bind(this))})),Ji(d,"grid"),null==n.showCircleFocus||n.showCircleFocus(t)}},hideGridFocus:function(){var t=this,e=t.state,i=e.inputType,n=e.resizing,a=t.$el.main;"mouse"!==i&&n||(a.selectAll("line."+Et.xgridFocus+", line."+Et.ygridFocus).style("visibility","hidden"),null==t.hideCircleFocus||t.hideCircleFocus())},updateGridFocus:function(){var t=this,e=t.state,i=e.inputType,n=e.width,a=e.height,r=e.resizing,s=t.$el.grid.main.select("line."+Et.xgridFocus);if("touch"===i)s.empty()?r&&(null==t.showCircleFocus||t.showCircleFocus()):t.showGridFocus();else{var o=t.config.axis_rotated;s.attr("x1",o?0:-10).attr("x2",o?n:-10).attr("y1",o?-10:0).attr("y2",o?-10:a)}return!0},generateGridData:function(t,e){var n=this,a=this.$el.main.select("."+_t.axisX).selectAll(".tick").size(),r=[];if("year"===t)for(var s=this.getXDomain().map(function(t){return i(this,n),t.getFullYear()}.bind(this)),o=s[0],l=s[1],c=o;c<=l;c++)r.push(new Date(c+"-01-01 00:00:00"));else(r=e.ticks(10)).length>a&&(r=r.filter(function(t){return i(this,n),(t+"").indexOf(".")<0}.bind(this)));return r},getGridFilterToRemove:function(t){var e=this;return t?function(n){var a=this;i(this,e);var r=!1;return(X(t)?t.concat():[t]).forEach(function(t){i(this,a),("value"in t&&n.value===t.value||"class"in t&&n.class===t.class)&&(r=!0)}.bind(this)),r}.bind(this):function(){return i(this,e),!0}.bind(this)},removeGridLines:function(t,e){var n=this,a=this,r=a.config,s=a.$T,o=a.getGridFilterToRemove(t),l=function(t){return i(this,n),!o(t)}.bind(this),c=e?Lt.xgridLines:Lt.ygridLines,d=e?Lt.xgridLine:Lt.ygridLine;s(a.$el.main.select("."+c).selectAll("."+d).filter(o)).style("opacity","0").remove();var u="grid_"+(e?"x":"y")+"_lines";r[u]=r[u].filter(l)}},tn={initRegion:function(){var t=this.$el;t.region.main=t.main.insert("g",":first-child").attr("clip-path",this.state.clip.path).attr("class",Dt.regions)},updateRegion:function(){var t=this,e=t.config,i=t.$el.region,n=t.$T;i.main||t.initRegion(),i.main.style("visibility",t.hasArcType()?"hidden":null);var a=i.main.selectAll("."+Dt.region).data(e.regions);n(a.exit()).style("opacity","0").remove();var r=a.enter().append("g");r.append("rect").style("fill-opacity","0"),i.list=r.merge(a).attr("class",t.classRegion.bind(t))},redrawRegion:function(t){var e=this,n=this,r=n.$el.region,s=n.$T,o=r.list.select("rect");return[(o=s(o,t).attr("x",n.regionX.bind(n)).attr("y",n.regionY.bind(n)).attr("width",n.regionWidth.bind(n)).attr("height",n.regionHeight.bind(n))).style("fill-opacity",function(t){return i(this,e),S(t.opacity)?t.opacity:null}.bind(this)).on("end",(function(){(0,a.select)(this.parentNode).selectAll("rect:not([x])").remove()}))]},getRegionXY:function(t,e){var i=this,n=i.config,a=i.scale,r=n.axis_rotated,s="x"===t,o="start",l=0;return"y"===e.axis||"y2"===e.axis?(s||(o="end"),(s?r:!r)&&o in e&&(l=(0,a[e.axis])(e[o]))):(s?!r:r)&&o in e&&(l=(a.zoom||a.x)(i.axis.isTimeSeries()?dt.call(i,e[o]):e[o])),l},regionX:function(t){return this.getRegionXY("x",t)},regionY:function(t){return this.getRegionXY("y",t)},getRegionSize:function(t,e){var i=this,n=i.config,a=i.scale,r=i.state,s=n.axis_rotated,o="width"===t,l=i[o?"regionX":"regionY"](e),c="end",d=r[t];return"y"===e.axis||"y2"===e.axis?(o||(c="start"),(o?s:!s)&&c in e&&(d=(0,a[e.axis])(e[c]))):(o?!s:s)&&c in e&&(d=(a.zoom||a.x)(i.axis.isTimeSeries()?dt.call(i,e[c]):e[c])),ds.height/2&&(f=s.height/2)),f+(n.axis.getLabelPositionById(t).isInner?0:10)+("y2"!==t||d?0:-10)},getEventRectWidth:function(){var t=this.config,e=this.axis,i=t.axis_x_inverted,n=e.x.tickInterval();return Math.max(0,i?Math.abs(n):n)},getAxisTickRotate:function(t){var e=this,i=e.axis,n=e.config,a=e.state,r=e.$el,s=n["axis_"+t+"_tick_rotate"];if("x"===t){var o=i.isCategorized()||i.isTimeSeries();if(n.axis_x_tick_fit&&o){var l=n.axis_x_tick_count,c=a.current.maxTickWidths.x.ticks.length,d=0;if(l?d=l>c?c:l:c&&(d=c),d!==a.axis.x.tickCount){var u=e.data.targets;a.axis.x.padding=e.getXDomainPadding([e.getXDomainMinMax(u,"min"),e.getXDomainMinMax(u,"max")],d)}a.axis.x.tickCount=d}r.svg&&n.axis_x_tick_fit&&!n.axis_x_tick_multiline&&!n.axis_x_tick_culling&&n.axis_x_tick_autorotate&&o&&(s=e.needToRotateXAxisTickTexts()?n.axis_x_tick_rotate:0)}return s},needToRotateXAxisTickTexts:function(){var t=this,e=t.state,i=e.axis,n=e.current.width-t.getCurrentPaddingLeft(!1)-t.getCurrentPaddingRight(),a=i.x.tickCount+i.x.padding.left+i.x.padding.right;return t.axis.getMaxTickWidth("x")>(a?n/a:0)}},nn={axis_y_clipPath:!0,axis_y_show:!0,axis_y_type:"indexed",axis_y_max:void 0,axis_y_min:void 0,axis_y_inverted:!1,axis_y_center:void 0,axis_y_inner:!1,axis_y_label:{},axis_y_tick_format:void 0,axis_y_tick_culling:!1,axis_y_tick_culling_max:5,axis_y_tick_culling_lines:!0,axis_y_tick_outer:!0,axis_y_tick_values:null,axis_y_tick_rotate:0,axis_y_tick_count:void 0,axis_y_tick_show:!0,axis_y_tick_stepSize:null,axis_y_tick_text_show:!0,axis_y_tick_text_position:{x:0,y:0},axis_y_tick_time_value:void 0,axis_y_padding:{},axis_y_default:void 0,axis_y_axes:[]},an={axis_y2_show:!1,axis_y2_type:"indexed",axis_y2_max:void 0,axis_y2_min:void 0,axis_y2_inverted:!1,axis_y2_center:void 0,axis_y2_inner:!1,axis_y2_label:{},axis_y2_tick_format:void 0,axis_y2_tick_culling:!1,axis_y2_tick_culling_max:5,axis_y2_tick_culling_lines:!0,axis_y2_tick_outer:!0,axis_y2_tick_values:null,axis_y2_tick_rotate:0,axis_y2_tick_count:void 0,axis_y2_tick_show:!0,axis_y2_tick_stepSize:null,axis_y2_tick_text_show:!0,axis_y2_tick_text_position:{x:0,y:0},axis_y2_padding:{},axis_y2_default:void 0,axis_y2_axes:[]};function rn(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function sn(t){for(var e,i=1;i1&&(n.axis_x_categories[t]=e,i.redraw()),n.axis_x_categories[t]},categories:function(t){var e=this.internal,i=e.config;return arguments.length?(i.axis_x_categories=t,e.redraw(),i.axis_x_categories):i.axis_x_categories}},Xi,Pi,Ii,Mi,$i],cn=[Gi,Wi,Vi,Hi,Qi,tn,en],dn=[{data_xs:{},data_xFormat:"%Y-%m-%d",data_xLocaltime:!0,data_xSort:!0,data_axes:{},data_regions:{},data_stack_normalize:!1},on,{grid_x_show:!1,grid_x_type:"tick",grid_x_lines:[],grid_y_show:!1,grid_y_lines:[],grid_y_ticks:void 0,grid_focus_edge:!1,grid_focus_show:!0,grid_focus_y:!1,grid_front:!1,grid_lines_front:!0}],un=p(12);function hn(t){void 0===t&&(t=0);var e=this,i=e.config,n=e.state,a=e.hasMultiArcGauge(),r=n.gaugeArcWidth/e.filterTargetsToShow(e.data.targets).length,s=t?Math.min(n.radiusExpanded*t-n.radius,.8*r-100*(1-t)):0;return{inner:function(t){var i=e.getRadius(t).innerRadius;return a?n.radius-r*(t.index+1):R(i)?i:0},outer:function(i){var o,l=e.getRadius(i).outerRadius;if(a)o=n.radius-r*i.index+s;else if(e.hasType("polar")&&!t)o=e.getPolarOuterRadius(i,l);else if(o=l,t){var c=n.radiusExpanded;n.radius!==l&&(c-=Math.abs(n.radius-l)),o=c*t}return o},corner:function(t,n){var a=i.arc_cornerRadius_ratio,r=void 0===a?0:a,s=i.arc_cornerRadius,o=void 0===s?0:s,l=t.data.id,c=t.value;return r?r*n:R(o)?o:o.call(e.api,l,c,n)}}}function gn(t){return function(e){var i=(0,un.interpolate)(this._current,e);return this._current=e,function(e){var n=i(e);return t(n)}}}var fn={initPie:function(){var t=this,e=this,n=e.config,a=n.data_type,r=n[a+"_padding"],s=n[a+"_startingAngle"]||0,o=(r?.01*r:n[a+"_padAngle"])||0;e.pie=(0,Ue.pie)().startAngle(s).endAngle(s+2*Math.PI).padAngle(o).value(function(e){var n=this;return i(this,t),e.values.reduce(function(t,e){return i(this,n),t+e.value}.bind(this),0)}.bind(this)).sort(e.getSortCompareFn.bind(e)(!0))},updateRadius:function(){var t=this,e=t.config,i=t.state,n=e[e.data_type+"_padding"],a=e.gauge_width||e.donut_width,r=t.filterTargetsToShow(t.data.targets).length*e.gauge_arcs_minWidth;i.radiusExpanded=Math.min(i.arcWidth,i.arcHeight)/2*(t.hasMultiArcGauge()&&e.gauge_label_show?.85:1),i.radius=.95*i.radiusExpanded,i.innerRadiusRatio=a?(i.radius-a)/i.radius:.6,i.gaugeArcWidth=a||(r<=i.radius-i.innerRadius?i.radius-i.innerRadius:r<=i.radius?r:i.radius);var s=e.pie_innerRadius||(n?n*(i.innerRadiusRatio+.1):0);i.outerRadius=e.pie_outerRadius,i.innerRadius=t.hasType("donut")||t.hasType("gauge")?i.radius*i.innerRadiusRatio:s},getRadius:function(t){var e=null==t?void 0:t.data,i=this.state,n=i.innerRadius,a=i.outerRadius;return!R(n)&&e&&(n=n[e.id]||0),F(a)&&e&&e.id in a?a=a[e.id]:R(a)||(a=this.state.radius),{innerRadius:n,outerRadius:a}},updateArc:function(){var t=this;t.updateRadius(),t.svgArc=t.getSvgArc(),t.svgArcExpanded=t.getSvgArcExpanded()},getArcLength:function(){var t=3.6*this.config.gauge_arcLength,e=t/360*2;return t<-360?e=-2:t>360&&(e=2),e*Math.PI},getGaugeStartAngle:function(){var t=this.config,e=t.gauge_fullCircle,i=-1*Math.PI/2,n=Math.PI/2,a=t.gauge_startingAngle;return!e&&a<=i?a=i:!e&&a>=n?a=n:(a>Math.PI||a<-1*Math.PI)&&(a=Math.PI),a},updateAngle:function(t){var e=this,n=this,a=n.config,r=n.state,s=n.pie,o=t,l=!1;if(!a)return null;var c=n.getGaugeStartAngle(),d=a.gauge_fullCircle?n.getArcLength():-2*c;if(o.data&&n.isGaugeType(o.data)&&!n.hasMultiArcGauge()){var u=a.gauge_min,h=a.gauge_max,g=n.getTotalDataSum(r.rendered);s=s.startAngle(c).endAngle(d*((g-u)/(h-u))+c)}if(s(n.filterTargetsToShow()).forEach(function(t,n){var a;i(this,e),l||t.data.id!==(null==(a=o.data)?void 0:a.id)||(l=!0,(o=t).index=n)}.bind(this)),isNaN(o.startAngle)&&(o.startAngle=0),isNaN(o.endAngle)&&(o.endAngle=o.startAngle),o.data&&n.hasMultiArcGauge()){var f=a.gauge_min,p=a.gauge_max,v=o.value1){var c,d=n.getRadius(t).outerRadius;n.hasType("polar")&&(d=n.getPolarOuterRadius(t,d));var u=this.svgArc.centroid(s).map(function(t){return i(this,e),isNaN(t)?0:t}.bind(this)),h=u[0],g=u[1],f=Math.sqrt(h*h+g*g),p=null==(c=["donut","pie","polar"].filter(n.hasType.bind(n)).map(function(t){return i(this,e),a[t+"_label_ratio"]}.bind(this)))?void 0:c[0];o="translate("+h*(p=p?k(p)?p.bind(n.api)(t,d,f):p:d&&(f?(36/d>.375?1.175-36/d:.8)*d/f:0))+","+g*p+")"}return o},convertToArcData:function(t){return this.addName({id:"data"in t?t.data.id:t.id,value:t.value,ratio:this.getRatio("arc",t),index:t.index})},textForArcLabel:function(t){var e=this,i=e.hasType("gauge");e.shouldShowArcLabel()&&t.style("fill",e.updateTextColor.bind(e)).attr("filter",e.updateTextBacgroundColor.bind(e)).each((function(t){var n,r=(0,a.select)(this),s=e.updateAngle(t),o=e.getRatio("arc",s);if(e.meetsLabelThreshold(o,null==(n=["donut","gauge","pie","polar"].filter(e.hasType.bind(e)))?void 0:n[0])){var l=(s||t).value;V(r,(e.getArcLabelFormat()||e.defaultArcValueFormat)(l,o,t.data.id).toString(),[-1,1],i)}else r.text("")}))},expandArc:function(t){var e=this,n=this,r=n.state.transiting,s=n.$el;if(r)var o=setInterval(function(){i(this,e),r||(clearInterval(o),s.legend.selectAll("."+Et.legendItemFocused).size()>0&&n.expandArc(t))}.bind(this),10);else{var l=n.mapToTargetIds(t);s.svg.selectAll(n.selectorTargets(l,"."+xt.chartArc)).each((function(t){if(n.shouldExpand(t.data.id)){var e=n.getExpandConfig(t.data.id,"duration"),i=n.getSvgArcExpanded(n.getExpandConfig(t.data.id,"rate"));(0,a.select)(this).selectAll("path").transition().duration(e).attrTween("d",gn(n.svgArcExpanded.bind(n))).transition().duration(2*e).attrTween("d",gn(i.bind(n)))}}))}},unexpandArc:function(t){var e=this,n=this,a=n.state.transiting,r=n.$el.svg;if(!a){var s=n.mapToTargetIds(t);r.selectAll(n.selectorTargets(s,"."+xt.chartArc)).selectAll("path").transition().duration(function(t){return i(this,e),n.getExpandConfig(t.data.id,"duration")}.bind(this)).attrTween("d",gn(n.svgArc.bind(n))),r.selectAll(""+xt.arc).style("opacity",null)}},getExpandConfig:function(t,e){var i,n=this,a=n.config;return n.isDonutType(t)?i="donut":n.isGaugeType(t)?i="gauge":n.isPieType(t)&&(i="pie"),i?a[i+"_expand_"+e]:{duration:50,rate:.98}[e]},shouldExpand:function(t){var e=this,i=e.config;return e.isDonutType(t)&&i.donut_expand||e.isGaugeType(t)&&i.gauge_expand||e.isPieType(t)&&i.pie_expand},shouldShowArcLabel:function(){var t=this,e=this,n=e.config;return["donut","gauge","pie","polar"].some(function(a){return i(this,t),e.hasType(a)&&n[a+"_label_show"]}.bind(this))},getArcLabelFormat:function(){var t=this,e=this,n=e.config,a=function(e){return i(this,t),e}.bind(this);return["donut","gauge","pie","polar"].filter(e.hasType.bind(e)).forEach(function(e){i(this,t),a=n[e+"_label_format"]}.bind(this)),k(a)?a.bind(e.api):a},updateTargetsForArc:function(t){var e=this,n=this,a=n.$el,r=n.hasType("gauge"),s=n.getChartClass("Arc"),o=n.getClass("arcs",!0),l=n.classFocus.bind(n),c=a.main.select("."+xt.chartArcs),d=c.selectAll("."+xt.chartArc).data(n.pie(t)).attr("class",function(t){return i(this,e),s(t)+l(t.data)}.bind(this)),u=d.enter().append("g").attr("class",s).call(this.setCssRule(!1,"."+xt.chartArcs+" text",["pointer-events:none","text-anchor:middle"]));u.append("g").attr("class",o).merge(d),u.append("text").attr("dy",r&&!n.hasMultiTargets()?"-.1em":".35em").style("opacity","0").style("text-anchor",n.getStylePropValue("middle")).style("pointer-events",n.getStylePropValue("none")),a.text=c.selectAll("."+vt.target+" text")},initArc:function(){var t=this,e=t.$el;e.arcs=e.main.select("."+vt.chart).append("g").attr("class",xt.chartArcs).attr("transform",t.getTranslate("arc")),t.setArcTitle()},setArcTitle:function(t){var e=this,i=t||e.getArcTitle(),n=e.hasType("gauge");if(i){var a=n?St.chartArcsGaugeTitle:xt.chartArcsTitle,r=e.$el.arcs.select("."+a);r.empty()&&(r=e.$el.arcs.append("text").attr("class",a).style("text-anchor","middle")),n&&r.attr("dy","-0.3em"),V(r,i,n?void 0:[-.6,1.35],!0)}},getArcTitle:function(){var t=this,e=t.hasType("donut")?"donut":t.hasType("gauge")&&"gauge";return e?t.config[e+"_title"]:""},getArcTitleWithNeedleValue:function(){var t=this,e=t.config,i=t.state,n=t.getArcTitle();if(n&&t.config.arc_needle_show&&/{=[A-Z_]+}/.test(n)){var a=i.current.needle;return R(a)||(a=e.arc_needle_value),ct(n,{NEEDLE_VALUE:R(a)?a:0})}return!1},redrawArc:function(t,e,n){var r=this,s=this,o=s.config,l=s.state,c=s.$el.main,d=o.interaction_enabled,u=d&&o.data_selection_isselectable,h=c.selectAll("."+xt.arcs).selectAll("."+xt.arc).data(s.arcData.bind(s));h.exit().transition().duration(e).style("opacity","0").remove(),h=h.enter().append("path").attr("class",s.getClass("arc",!0)).style("fill",function(t){return i(this,r),s.color(t.data)}.bind(this)).style("cursor",function(t){return i(this,r),null!=u&&null!=u.bind&&u.bind(s.api)(t)?"pointer":null}.bind(this)).style("opacity","0").each((function(t){s.isGaugeType(t.data)&&(t.startAngle=o.gauge_startingAngle,t.endAngle=o.gauge_startingAngle),this._current=t})).merge(h),s.hasType("gauge")&&(s.updateGaugeMax(),s.hasMultiArcGauge()&&s.redrawMultiArcGauge()),h.attr("transform",function(t){return i(this,r),!s.isGaugeType(t.data)&&n?"scale(0)":""}.bind(this)).style("opacity",(function(t){return t===this._current?"0":null})).each(function(){i(this,r),l.transiting=!0}.bind(this)).transition().duration(t).attrTween("d",(function(t){var e=this,n=s.updateAngle(t);if(!n)return function(){return i(this,e),"M 0 0"}.bind(this);isNaN(this._current.startAngle)&&(this._current.startAngle=0),isNaN(this._current.endAngle)&&(this._current.endAngle=this._current.startAngle);var a=(0,un.interpolate)(this._current,n);return this._current=a(0),function(e){var i=a(e);return i.data=t.data,s.getArc(i,!0)}})).attr("transform",n?"scale(1)":"").style("fill",function(t){var e;return i(this,r),s.levelColor?(e=s.levelColor(t.data.values[0].value),o.data_colors[t.data.id]=e):e=s.color(t.data),e}.bind(this)).style("opacity",null).call(G,(function(){if(s.levelColor){var t=(0,a.select)(this),e=t.datum();s.updateLegendItemColor(e.data.id,t.style("fill"))}l.transiting=!1,N(o.onrendered,s.api)})),d&&s.bindArcEvent(h),s.hasType("polar")&&s.redrawPolar(),s.hasType("gauge")&&s.redrawBackgroundArcs(),o.arc_needle_show&&s.redrawNeedle(),s.redrawArcText(t)},redrawNeedle:function(){var t=this,e=this,n=e.$el,a=e.config,r=e.state,s=r.hiddenTargetIds,o=(r.radius-1)/100*a.arc_needle_length,l=s.length!==e.data.targets.length,c=e.$el.arcs.select("."+xt.needle),d=a.arc_needle_path,u=a.arc_needle_bottom_width/2,h=a.arc_needle_top_width/2,g=a.arc_needle_top_rx,f=a.arc_needle_top_ry,p=a.arc_needle_bottom_len,v=a.arc_needle_bottom_rx,x=a.arc_needle_bottom_ry,b=e.getNeedleAngle(),_=function(){i(this,t);var n=e.getArcTitleWithNeedleValue();n&&e.setArcTitle(n)}.bind(this);if(_(),c.empty()&&(c=n.arcs.append("path").classed(xt.needle,!0),n.needle=c,n.needle.updateHelper=function(r,s){var o=this;void 0===s&&(s=!1),i(this,t),"none"!==n.needle.style("display")&&e.$T(n.needle).style("transform","rotate("+e.getNeedleAngle(r)+"deg)").call(G,function(){i(this,o),s&&(a.arc_needle_value=r),_()}.bind(this))}.bind(this)),l){var m=k(d)?d.call(e,o):"M-"+u+" "+p+" A"+v+" "+x+" 0 0 0 "+u+" "+p+" L"+h+" -"+o+" A"+g+" "+f+" 0 0 0 -"+h+" -"+o+" L-"+u+" "+p+" Z";e.$T(c).attr("d",m).style("fill",a.arc_needle_color).style("display",null).style("transform","rotate("+b+"deg)")}else c.style("display","none")},getNeedleAngle:function(t){var e=this,i=e.config,n=e.state,a=e.getArcLength(),r=e.hasType("gauge"),s=e.getTotalDataSum(!0),o=L(t)?t:i.arc_needle_value,l=i[i.data_type+"_startingAngle"]||0,c=0;if(R(o)||(o=r&&1===e.data.targets.length?s:0),n.current.needle=o,r){l=e.getGaugeStartAngle();var d=i.gauge_fullCircle?a:-2*l,u=i.gauge_min;c=d*((o-u)/(i.gauge_max-u))}else c=a*(o/s);return(l+c)*(180/Math.PI)},redrawBackgroundArcs:function(){var t=this,e=this,n=e.config,a=e.state,r=e.hasMultiArcGauge(),s=n.gauge_fullCircle,o=0===e.filterTargetsToShow(e.data.targets).length&&!!n.data_empty_label_text,l=e.getGaugeStartAngle(),c=s?l+e.getArcLength():-1*l,d=e.$el.arcs.select((r?"g":"")+"."+xt.chartArcsBackground);if(r){var u=0;(d=d.selectAll("path."+xt.chartArcsBackground).data(e.data.targets)).enter().append("path").attr("class",function(e,n){return i(this,t),xt.chartArcsBackground+" "+xt.chartArcsBackground+"-"+n}.bind(this)).merge(d).style("fill",n.gauge_background||null).attr("d",function(r){var s=r.id;if(i(this,t),o||a.hiddenTargetIds.indexOf(s)>=0)return"M 0 0";var d={data:[{value:n.gauge_max}],startAngle:l,endAngle:c,index:u++};return e.getArc(d,!0,!0)}.bind(this)),d.exit().remove()}else d.attr("d",o?"M 0 0":function(){i(this,t);var a={data:[{value:n.gauge_max}],startAngle:l,endAngle:c};return e.getArc(a,!0,!0)}.bind(this))},bindArcEvent:function(t){var e=this,n=this,r=n.config,s=n.state,o="touch"===s.inputType,l="mouse"===s.inputType;function c(t,e,i){n.expandArc(i),n.api.focus(i),n.toggleFocusLegend(i,!0),n.showTooltip([e],t)}function d(t){var e=(null==t?void 0:t.id)||void 0;n.unexpandArc(e),n.api.revert(),n.revertLegend(),n.hideTooltip()}if(t.on("click",(function(t,e,i){var a,s=n.updateAngle(e);s&&(a=n.convertToArcData(s),null==n.toggleShape||n.toggleShape(this,a,i),r.data_onclick.bind(n.api)(a,this))})),l&&t.on("mouseover",(function(t,e){var i;if(!s.transiting){s.event=t;var a=n.updateAngle(e),r=a?n.convertToArcData(a):null;c(this,r,(null==(i=r)?void 0:i.id)||void 0),n.setOverOut(!0,r)}})).on("mouseout",function(t,a){if(i(this,e),!s.transiting){s.event=t;var r=n.updateAngle(a),o=r?n.convertToArcData(r):null;d(),n.setOverOut(!1,o)}}.bind(this)).on("mousemove",(function(t,e){var i=n.updateAngle(e),a=i?n.convertToArcData(i):null;s.event=t,n.showTooltip([a],this)})),o&&n.hasArcType()&&!n.radars){var u=function(t){i(this,e);var n=t.changedTouches[0];return(0,a.select)(h.elementFromPoint(n.clientX,n.clientY))}.bind(this);n.$el.svg.on("touchstart touchmove",(function(t){var e,i;if(!s.transiting){s.event=t;var a=u(t).datum(),r=null!=(e=a)&&e.data&&a.data.id?n.updateAngle(a):null,o=r?n.convertToArcData(r):null,l=(null==(i=o)?void 0:i.id)||void 0;n.callOverOutForTouch(o),E(l)?d():c(this,o,l)}}))}},redrawArcText:function(t){var e,n=this,a=this,r=a.config,s=a.state,o=a.$el,l=o.main,c=o.arcs,d=a.hasType("gauge"),u=a.hasMultiArcGauge();if(d&&1===a.data.targets.length&&r.gauge_title||(e=l.selectAll("."+xt.chartArc).select("text").style("opacity","0").attr("class",function(t){return i(this,n),a.isGaugeType(t.data)?St.gaugeValue:null}.bind(this)).call(a.textForArcLabel.bind(a)).attr("transform",a.transformForArcLabel.bind(a)).style("font-size",function(t){return i(this,n),a.isGaugeType(t.data)&&1===a.data.targets.length&&!u?Math.round(s.radius/5)+"px":null}.bind(this)).transition().duration(t).style("opacity",function(t){return i(this,n),a.isTargetToShow(t.data.id)&&a.isArcType(t.data)?null:"0"}.bind(this)),u&&e.attr("dy","-.1em")),l.select("."+xt.chartArcsTitle).style("opacity",a.hasType("donut")||d?null:"0"),d){var h,g=r.gauge_fullCircle;g&&(null==(h=e)||h.attr("dy",""+(u?0:Math.round(s.radius/14)))),r.gauge_label_show&&(c.select("."+St.chartArcsGaugeUnit).attr("dy",(g?1.5:.75)+"em").text(r.gauge_units),c.select("."+St.chartArcsGaugeMin).attr("dx",-1*(s.innerRadius+(s.radius-s.innerRadius)/(g?1:2))+"px").attr("dy","1.2em").text(a.textForGaugeMinMax(r.gauge_min,!1)),g||c.select("."+St.chartArcsGaugeMax).attr("dx",s.innerRadius+(s.radius-s.innerRadius)/2+"px").attr("dy","1.2em").text(a.textForGaugeMinMax(r.gauge_max,!0)))}}},pn={initArea:function(t){var e=this.config;t.insert("g","."+(e.area_front?Tt.circles:Ct.lines)).attr("class",this.getClass("areas",!0))},updateAreaColor:function(t){var e=this;return e.config.area_linearGradient?e.getGradienColortUrl(t.id):e.color(t)},updateArea:function(t,e){void 0===e&&(e=!1);var i=this,n=i.config,r=i.state,s=i.$el,o=i.$T,l=e?s.subchart:s;n.area_linearGradient&&i.updateLinearGradient();var c=l.main.selectAll("."+bt.areas).selectAll("."+bt.area).data(i.lineData.bind(i));o(c.exit(),t).style("opacity","0").remove(),l.area=c.enter().append("path").attr("class",i.getClass("area",!0)).style("fill",i.updateAreaColor.bind(i)).style("opacity",(function(){return r.orgAreaOpacity=(0,a.select)(this).style("opacity"),"0"})).merge(c),c.style("opacity",r.orgAreaOpacity),i.setRatioForGroupedData(l.area.data())},redrawArea:function(t,e,n){var a=this;void 0===n&&(n=!1);var r=this,s=(n?this.$el.subchart:this.$el).area,o=r.state.orgAreaOpacity;return[r.$T(s,e,Z()).attr("d",t).style("fill",r.updateAreaColor.bind(r)).style("opacity",function(t){return i(this,a),(r.isAreaRangeType(t)?o/1.75:o)+""}.bind(this))]},generateDrawArea:function(t,e){var n=this,a=this,r=a.config,s=r.line_connectNull,o=r.axis_rotated,l=a.generateGetAreaPoints(t,e),c=a.getYScaleById.bind(a),d=function(t){return i(this,n),(e?a.subxx:a.xx).call(a,t)}.bind(this),u=function(t,r){return i(this,n),a.isGrouped(t.id)?l(t,r)[0][1]:c(t.id,e)(a.isAreaRangeType(t)?a.getRangedData(t,"high"):a.getShapeYMin(t.id))}.bind(this),h=function(t,r){return i(this,n),a.isGrouped(t.id)?l(t,r)[1][1]:c(t.id,e)(a.isAreaRangeType(t)?a.getRangedData(t,"low"):t.value)}.bind(this);return function(t){var e=this;i(this,n);var l,c=s?a.filterRemoveNull(t.values):t.values,g=0,f=0;if(a.isAreaType(t)){var p=(0,Ue.area)();p=o?p.y(d).x0(u).x1(h):p.x(d).y0(r.area_above?0:r.area_below?a.state.height:u).y1(h),s||(p=p.defined(function(t){return i(this,e),null!==a.getBaseValue(t)}.bind(this))),a.isStepType(t)&&(c=a.convertValuesToStep(c)),l=p.curve(a.getCurve(t))(c)}else c[0]&&(g=a.scale.x(c[0].x),f=a.getYScaleById(t.id)(c[0].value)),l=o?"M "+f+" "+g:"M "+g+" "+f;return l||"M 0 0"}.bind(this)},generateGetAreaPoints:function(t,e){var i=this,n=i.config,a=i.getShapeX(0,t,e),r=i.getShapeY(!!e),s=i.getShapeOffset(i.isAreaType,t,e),o=i.getYScaleById.bind(i);return function(t,l){var c=o.call(i,t.id,e)(i.getShapeYMin(t.id)),d=s(t,l)||c,u=a(t),h=t.value,g=r(t);return n.axis_rotated&&(h>0&&g0?function(){return i(this,n),l}.bind(this):R(c)?function(t){return i(this,n),t*c}.bind(this):null;return function(t,e){i(this,n);var l=s(t,e),c=+o,u=+!c,h=t.value<0,g=r["axis_"+a.axis.getId(t.id)+"_inverted"],f=!g&&h||g&&!h,p=["",""],v=0,x=a.isGrouped(t.id),b=!(!d||!x)&&a.isStackingRadiusData(t);if(d){var _=o?u:c,m=l[2][_]-l[0][_],y="a"+(v=!x||b?d(m):0)+","+v+" "+(f?"1 0 0":"0 0 1")+" ";p[+!o]=""+y+v+","+v,p[+o]=""+y+[-v,v][o?"sort":"reverse"](),f&&p.reverse()}var T=o?"H"+(l[1][c]+(f?v:-v))+" "+p[0]+"V"+(l[2][u]-v)+" "+p[1]+"H"+l[3][c]:"V"+(l[1][u]+(f?-v:v))+" "+p[0]+"H"+(l[2][c]-v)+" "+p[1]+"V"+l[3][u];return"M"+l[0][c]+","+l[0][u]+T+"z"}.bind(this)},isStackingRadiusData:function(t){var e=this,n=this,a=n.$el,r=n.config,s=n.data,o=n.state,l=t.id,c=t.index,d=t.value;if(o.hiddenTargetIds.indexOf(l)>-1){var u=a.bar.filter(function(t){return i(this,e),t.id===l&&t.value===d}.bind(this));return!u.empty()&&/a\d+/i.test(u.attr("d"))}var h=r.data_groups.find(function(t){return i(this,e),t.indexOf(l)>-1}.bind(this)),g=n.orderTargets(n.filterTargetsToShow(s.targets.filter(n.isBarType,n))).filter(function(t){return i(this,e),h.indexOf(t.id)>-1}.bind(this)).map(function(t){var n=this;return i(this,e),t.values.filter(function(t){return i(this,n),t.index===c&&(R(d)&&d>0?t.value>0:t.value<0)}.bind(this))[0]}.bind(this)).filter(Boolean).map(function(t){return i(this,e),t.id}.bind(this));return 0!==d&&g.indexOf(l)===g.length-1},generateGetBarPoints:function(t,e){var n=this,a=this,r=a.config,s=e?a.axis.subX:a.axis.x,o=a.getIndicesMax(t)+1,l=a.getBarW("bar",s,o),c=a.getShapeX(l,t,!!e),d=a.getShapeY(!!e),u=a.getShapeOffset(a.isBarType,t,!!e),h=a.getYScaleById.bind(a);return function(t,s){i(this,n);var o=t.id,g=h.call(a,o,e)(a.getShapeYMin(o)),f=u(t,s)||g,p=R(l)?l:l[t.id]||l._$width,v=r["axis_"+a.axis.getId(o)+"_inverted"],x=t.value,b=c(t),_=d(t);r.axis_rotated&&!v&&(x>0&&_0&&b.start=e.open),e||null}},_n={initGauge:function(){var t=this,e=this,n=e.config,a=e.$el.arcs,r=function(e){i(this,t),a.append("text").attr("class",e).style("text-anchor","middle").style("pointer-events","none")}.bind(this);if(e.hasType("gauge")){var s=e.hasMultiArcGauge();a.append(s?"g":"path").attr("class",xt.chartArcsBackground).style("fill",!s&&n.gauge_background||null),n.gauge_units&&r(St.chartArcsGaugeUnit),n.gauge_label_show&&(r(St.chartArcsGaugeMin),n.gauge_fullCircle||r(St.chartArcsGaugeMax))}},updateGaugeMax:function(){var t=this,e=t.config,i=t.state,n=t.hasMultiArcGauge()?t.getMinMaxData().max[0].value:t.getTotalDataSum(i.rendered);n+e.gauge_min*(e.gauge_min>0?-1:1)>e.gauge_max&&(e.gauge_max=n-e.gauge_min)},redrawMultiArcGauge:function(){var t=this,e=this,n=e.config,r=e.state,s=e.$el,o=e.state.hiddenTargetIds,l=s.main.selectAll("."+xt.arcs).selectAll("."+xt.arcLabelLine).data(e.arcData.bind(e));l.enter().append("rect").attr("class",function(e){return i(this,t),xt.arcLabelLine+" "+vt.target+" "+vt.target+"-"+e.data.id}.bind(this)).merge(l).style("fill",function(n){return i(this,t),e.levelColor?e.levelColor(n.data.values[0].value):e.color(n.data)}.bind(this)).style("display",n.gauge_label_show?null:"none").each((function(t){var i=0,n=0,s=0,l="";if(o.indexOf(t.data.id)<0){var c=e.updateAngle(t),d=r.gaugeArcWidth/e.filterTargetsToShow(e.data.targets).length*(c.index+1),u=c.endAngle-Math.PI/2,h=r.radius-d,g=u-(0===h?0:1/h);i=r.radiusExpanded-r.radius+d,n=Math.cos(g)*h,s=Math.sin(g)*h,l="rotate("+180*u/Math.PI+", "+n+", "+s+")"}(0,a.select)(this).attr("x",n).attr("y",s).attr("width",i).attr("height",2).attr("transform",l).style("stroke-dasharray","0, "+(i+2)+", 0")}))},textForGaugeMinMax:function(t,e){var i=this.config.gauge_label_extents;return k(i)?i.bind(this.api)(t,e):t},getGaugeLabelHeight:function(){var t=this.config;return this.config.gauge_label_show&&!t.gauge_fullCircle?20:0},getPaddingBottomForGauge:function(){return this.getGaugeLabelHeight()*(this.config.gauge_label_show?2:2.5)}},mn={initBubble:function(){var t=this.config;this.hasType("bubble")&&(t.point_show=!0,t.point_type="circle")},getBaseLength:function(){var t=this,e=t.state,i=e.width,n=e.height,a=ae,r=t.cache.get(a);return r||t.cache.add(a,r=st("min",[i,n])),r},getBubbleR:function(t){var e=this,n=this,a=n.config.bubble_maxR;k(a)?a=a.bind(n.api)(t):R(a)||(a=n.getBaseLength()/(2*n.getMaxDataCount())+12);var r=st("max",n.getMinMaxData().max.map(function(t){return i(this,e),n.isBubbleZType(t)?n.getBubbleZData(t.value,"y"):F(t.value)?t.value.mid:t.value}.bind(this))),s=a*a*Math.PI,o=(n.isBubbleZType(t)?n.getBubbleZData(t.value,"z"):t.value)*(s/r);return Math.sqrt(o/Math.PI)},getBubbleZData:function(t,e){return F(t)?t[e]:t["y"===e?0:1]}},yn={initLine:function(){var t=this.$el;t.line=t.main.select("."+vt.chart).append("g").attr("class",Ct.chartLines).call(this.setCssRule(!1,"."+Ct.chartLines,["pointer-events:none"]))},updateTargetsForLine:function(t){var e=this,n=this,a=n.$el,r=a.area,s=a.line,o=a.main,l=n.getChartClass("Line"),c=n.getClass("lines",!0),d=n.classFocus.bind(n);s||n.initLine();var u=t.filter(function(t){return i(this,e),!(n.isScatterType(t)||n.isBubbleType(t))}.bind(this)),h=o.select("."+Ct.chartLines).selectAll("."+Ct.chartLine).data(u).attr("class",function(t){return i(this,e),l(t)+d(t)}.bind(this)),g=h.enter().append("g").attr("class",l).style("opacity","0").style("pointer-events",n.getStylePropValue("none"));if(g.append("g").attr("class",c),n.hasTypeOf("Area")){var f=(!r&&g.empty()?h:g).filter(n.isAreaType.bind(n));n.initArea(f)}n.updateTargetForCircle(u,g)},updateLine:function(t,e){var n=this;void 0===e&&(e=!1);var a=this,r=a.format.extraLineClasses,s=a.$el,o=a.$T,l=e?s.subchart:s,c=l.main.selectAll("."+Ct.lines).selectAll("."+Ct.line).data(a.lineData.bind(a));o(c.exit(),t).style("opacity","0").remove(),l.line=c.enter().append("path").attr("class",function(t){return i(this,n),a.getClass("line",!0)(t)+" "+(r(t)||"")}.bind(this)).style("stroke",a.color).merge(c).style("opacity",a.initialOpacity.bind(a)).style("shape-rendering",function(t){return i(this,n),a.isStepType(t)?"crispEdges":""}.bind(this)).attr("transform",null)},redrawLine:function(t,e,i){void 0===i&&(i=!1);var n=this.$el;return[(0,this.$T)((i?n.subchart:n).line,e,Z()).attr("d",t).style("stroke",this.color).style("opacity",null)]},getCurve:function(t){var e=this,n=this;return n.config.axis_rotated&&n.isStepType(t)?function(a){i(this,e);var r=n.getInterpolate(t)(a);return r.orgPoint=r.point,r.pointRotated=function(t,e){1===this._point&&(this._point=2);var i=this._y*(1-this._t)+e*this._t;this._context.lineTo(this._x,i),this._context.lineTo(t,i),this._x=t,this._y=e},r.point=function(t,e){0===this._point?this.orgPoint(t,e):this.pointRotated(t,e)},r}.bind(this):n.getInterpolate(t)},generateDrawLine:function(t,e){var n=this,a=this,r=a.config,s=a.scale,o=r.line_connectNull,l=r.axis_rotated,c=a.generateGetLinePoints(t,e),d=a.getYScaleById.bind(a),u=function(t){return i(this,n),(e?a.subxx:a.xx).call(a,t)}.bind(this),h=function(t,r){return i(this,n),a.isGrouped(t.id)?c(t,r)[0][1]:d(t.id,e)(a.getBaseValue(t))}.bind(this),g=(0,Ue.line)();g=l?g.x(h).y(u):g.x(u).y(h),o||(g=g.defined(function(t){return i(this,n),null!==a.getBaseValue(t)}.bind(this)));var f=e?s.subX:s.x;return function(t){i(this,n);var c,u=d(t.id,e),h=o?a.filterRemoveNull(t.values):t.values,p=0,v=0;if(a.isLineType(t)){var x=r.data_regions[t.id];x?c=a.lineWithRegions(h,s.zoom||f,u,x):(a.isStepType(t)&&(h=a.convertValuesToStep(h)),c=g.curve(a.getCurve(t))(h))}else h[0]&&(p=f(h[0].x),v=u(h[0].value)),c=l?"M "+v+" "+p:"M "+p+" "+v;return c||"M 0 0"}.bind(this)},lineWithRegions:function(t,e,n,a){var r,s,o,l,c=this,d=this,u=d.config.axis_rotated,h=d.axis.isTimeSeries(),g=[];if(L(a))for(var f,p=function(t,e){return i(this,c),E(t)?e:h?dt.call(d,t):t}.bind(this),v=0;f=a[v];v++){var x=p(f.start,t[0].x),b=p(f.end,t[t.length-1].x),_=f.style||{dasharray:"2 2"};g[v]={start:x,end:b,style:_}}for(var m,y=u?function(t){return i(this,c),n(t.value)}.bind(this):function(t){return i(this,c),e(t.x)}.bind(this),T=u?function(t){return i(this,c),e(t.x)}.bind(this):function(t){return i(this,c),n(t.value)}.bind(this),w=function(t){return i(this,c),"M"+t[0][0]+","+t[0][1]+"L"+t[1][0]+","+t[1][1]}.bind(this),A=h?function(t,a,r,l){i(this,c);var d=t.x.getTime(),h=a.x-t.x,g=new Date(d+h*r),f=new Date(d+h*(r+l)),p=u?[[n(s(r)),e(g)],[n(s(r+o)),e(f)]]:[[e(g),n(s(r))],[e(f),n(s(r+o))]];return w(p)}.bind(this):function(t,a,o,l){i(this,c);var d=u?[[n(s(o),!0),e(r(o))],[n(s(o+l),!0),e(r(o+l))]]:[[e(r(o),!0),n(s(o))],[e(r(o+l),!0),n(s(o+l))]];return w(d)}.bind(this),k={x:d.axis.getAxisType("x"),y:d.axis.getAxisType("y")},C="",R=0;m=t[R];R++){var O=t[R-1],P=O&&S(O.value);_=d.isWithinRegions(m.x,g);if(S(m.value))if(!E(g)&&_&&P){if(P){try{_=_.dasharray.split(" ")}catch(t){_="2 2".split(" ")}r=He(k.x,O.x,m.x),s=He(k.y,O.value,m.value);var I=e(m.x)-e(O.x),D=n(m.value)-n(O.value),z=Math.sqrt(Math.pow(I,2)+Math.pow(D,2));l=(o=_[0]/z)*_[1];for(var M=o;M<=1;M+=l)C+=A(O,m,M,o),M+l>=1&&(C+=A(O,m,1,0))}}else C+=(R&&P?"L":"M")+y(m)+","+T(m)}return C},isWithinRegions:function(t,e){for(var i,n=0;i=e[n];n++)if(i.start-1?"0":null})),c&&h.forEach(function(t){var e=this;i(this,n),l.main.selectAll("."+zt.selectedCircles+r.getTargetSelectorSuffix(t.id)).selectAll(""+zt.selectedCircle).each(function(n){i(this,e),n.value=t.values[n.index].value}.bind(this))}.bind(this))}},updateCircle:function(t){var e=this;void 0===t&&(t=!1);var n=this,a=n.config,r=n.state,s=n.$el,o=a.point_focus_only,l=t?s.subchart:s;if(a.point_show&&!r.toggling){var c=l.main.selectAll("."+Tt.circles).selectAll("."+Tt.circle).data(function(t){return i(this,e),n.isLineType(t)&&n.shouldDrawPointsForLine(t)||n.isBubbleType(t)||n.isRadarType(t)||n.isScatterType(t)?o?[t.values[0]]:t.values:[]}.bind(this));c.exit().remove(),c.enter().filter(Boolean).append(n.point("create",this,n.pointR.bind(n),n.getStylePropValue(n.color))),l.circle=l.main.selectAll("."+Tt.circles+" ."+Tt.circle).style("stroke",n.getStylePropValue(n.color)).style("opacity",n.initialOpacityForCircle.bind(n))}},redrawCircle:function(t,e,i,n,a){void 0===a&&(a=!1);var r=this,s=r.state.rendered,o=r.$el,l=r.$T,c=a?o.subchart:o,d=c.main.selectAll("."+zt.selectedCircle);if(!r.config.point_show)return[];var u=r.point("update",r,t,e,r.getStylePropValue(r.color),i,n,d),h=r.isCirclePoint()?"c":"",g=Z(),f=r.opacityForCircle.bind(r),p=[];return c.circle.each((function(t){var e=u.bind(this)(t);e=l(e,i||!s,g).style("opacity",f),p.push(e)})),[p,l(d,i).attr(h+"x",t).attr(h+"y",e)]},showCircleFocus:function(t){var e=this,n=e.config,r=e.state,s=r.hasRadar,o=r.resizing,l=r.toggling,c=r.transiting,d=e.$el.circle;if(!1===c&&n.point_focus_only&&d){var u=(s?e.radarCircleX:e.circleX).bind(e),h=(s?e.radarCircleY:e.circleY).bind(e),g=l||E(t),f=e.point("update",e,u,h,e.getStylePropValue(e.color),!o&&g);t&&(d=d.filter((function(e){var n=this,r=null==t.filter?void 0:t.filter(function(t){return i(this,n),t.id===e.id}.bind(this));return!!r.length&&(0,a.select)(this).datum(r[0])}))),d.attr("class",this.updatePointClass.bind(this)).style("opacity",null).each((function(t){var i=t.id,n=t.index,a=t.value,r="hidden";S(a)&&(f.bind(this)(t),e.expandCircles(n,i),r=""),this.style.visibility=r}))}},hideCircleFocus:function(){var t=this,e=t.config,i=t.$el.circle;e.point_focus_only&&i&&(t.unexpandCircles(),i.style("visibility","hidden"))},circleX:function(t){return this.xx(t)},updateCircleY:function(t){var e=this;void 0===t&&(t=!1);var n=this,a=n.generateGetLinePoints(n.getShapeIndices(n.isLineType),t);return function(r,s){i(this,e);var o=r.id;return n.isGrouped(o)?a(r,s)[0][1]:n.getYScaleById(o,t)(n.getBaseValue(r))}.bind(this)},expandCircles:function(t,e,i){var n=this,r=n.pointExpandedR.bind(n);i&&n.unexpandCircles();var s=n.getShapeByIndex("circle",t,e).classed(vt.EXPANDED,!0),o=r(s)/n.config.point_r,l=1-o;n.isCirclePoint()?s.attr("r",r):s.each((function(){var t=(0,a.select)(this);if("circle"===this.tagName)t.attr("r",r);else{var e=this.getBBox(),i=e.width,n=e.height,s=l*(+t.attr("x")+i/2),c=l*(+t.attr("y")+n/2);t.attr("transform","translate("+s+" "+c+") scale("+o+")")}}))},unexpandCircles:function(t){var e=this,i=e.pointR.bind(e),n=e.getShapeByIndex("circle",t).filter((function(){return(0,a.select)(this).classed(vt.EXPANDED)})).classed(vt.EXPANDED,!1);if(n.attr("r",i),!e.isCirclePoint()){var r=i(n)/e.config.point_r;n.attr("transform",1!==r?"scale("+r+")":null)}},pointR:function(t){var e=this,i=e.config.point_r,n=i;return e.isBubbleType(t)?n=e.getBubbleR(t):k(i)&&(n=i.bind(e.api)(t)),t.r=n,n},pointExpandedR:function(t){var e=this,i=e.config,n=e.isBubbleType(t)?1.15:1.75;return i.point_focus_expand_enabled?i.point_focus_expand_r||e.pointR(t)*n:e.pointR(t)},pointSelectR:function(t){var e=this.config.point_select_r;return k(e)?e(t):e||4*this.pointR(t)},isWithinCircle:function(t,e){var i=H(this.state.event,t),n=(0,a.select)(t),r=this.isCirclePoint(t)?"c":"",s=+n.attr(r+"x"),o=+n.attr(r+"y");if(!s&&!o&&1===t.nodeType){var l=U(t);s=l.x,o=l.y}return Math.sqrt(Math.pow(s-i[0],2)+Math.pow(o-i[1],2))<(e||this.config.point_sensitivity)},insertPointInfoDefs:function(t,e){var n,r=this,s=function(t,e){i(this,r);for(var n,a=t.attributes,s=0;n=a[s];s++)n=n.name,e.setAttribute(n,t.getAttribute(n))}.bind(this),o=(new DOMParser).parseFromString(t,"image/svg+xml").documentElement,l=h.createElementNS(a.namespaces.svg,o.nodeName.toLowerCase());if(l.id=e,l.style.fill="inherit",l.style.stroke="inherit",s(o,l),null!=(n=o.childNodes)&&n.length){var c=(0,a.select)(l);"innerHTML"in l?c.html(o.innerHTML):tt(o.childNodes).forEach(function(t){i(this,r),s(t,c.append(t.tagName).node())}.bind(this))}this.$el.defs.node().appendChild(l)},pointFromDefs:function(t){return this.$el.defs.select("#"+t)},updatePointClass:function(t){var e=this,i=e.$el.circle,n=!1;return(F(t)||i)&&(n=!0===t?i.each((function(t){var i=e.getClass("circle",!0)(t);this.getAttribute("class").indexOf(vt.EXPANDED)>-1&&(i+=" "+vt.EXPANDED),this.setAttribute("class",i)})):e.getClass("circle",!0)(t)),n},generateGetLinePoints:function(t,e){var n=this,a=this,r=a.config,s=a.getShapeX(0,t,e),o=a.getShapeY(e),l=a.getShapeOffset(a.isLineType,t,e),c=a.getYScaleById.bind(a);return function(t,d){i(this,n);var u=c.call(a,t.id,e)(a.getShapeYMin(t.id)),h=l(t,d)||u,g=s(t),f=o(t);r.axis_rotated&&(t.value>0&&f2?o-2:0),c=2;ci&&(i=e),i}var Sn={initPolar:function(){var t=this,e=t.$el.arcs,i=t.config,n=i.polar_level_text_show,a=i.polar_level_text_backgroundColor;e.levels=e.append("g").attr("class",Pt),n&&a&&t.generateDataLabelBackgroundColorFilter(a)},getPolarOuterRadius:function(t,e){var i,n=An(this);return(null!=(i=null==t?void 0:t.data.values[0].value)?i:0)/n*e},updateTargetsForPolar:function(t){this.updateTargetsForArc(t)},redrawPolar:function(){this.config.polar_level_show&&this.updatePolarLevel()},updatePolarLevel:function(){var t=this,e=this,n=e.config,a=e.state,r=e.$el.arcs.levels,s=n.polar_level_depth,o=An(e),l=ot(0,s),c=a.radius,d=l.map(function(e){return i(this,t),c*((e+1)/s)}.bind(this)),u=(n.polar_level_text_format||function(){}).bind(e.api),h=r.selectAll("."+Ot).data(l);h.exit().remove();var g=h.enter().append("g").attr("class",function(e,n){return i(this,t),Ot+" "+Ot+"-"+n}.bind(this));if(g.append("circle"),g.merge(h).selectAll("circle").style("visibility",n.polar_level_show?null:"hidden").attr("cx",0).attr("cy",0).attr("r",function(e){return i(this,t),d[e]}.bind(this)),n.polar_level_text_show){var f=n.polar_level_text_backgroundColor,p="#"+a.datetimeId+"-labels-bg"+e.getTargetSelectorSuffix(f);g.append("text").style("text-anchor","middle"),g.merge(h).selectAll("text").attr("dy",function(e){return i(this,t),5-d[e]}.bind(this)).attr("filter",f?"url("+p+")":null).text(function(e){return i(this,t),u(o/l.length*(e+1))}.bind(this))}}};var kn=de,Cn={initRadar:function(){var t=this,e=t.config,i=t.state.current,n=t.$el;t.hasType("radar")&&(n.radar=n.main.select("."+vt.chart).append("g").attr("class",It.chartRadars),n.radar.levels=n.radar.append("g").attr("class",Pt),n.radar.axes=n.radar.append("g").attr("class",_t.axis),n.radar.shapes=n.radar.append("g").attr("class",Mt.shapes),i.dataMax=e.radar_axis_max||t.getMinMaxData().max[0].value)},getRadarSize:function(){var t=this.config,e=this.state,i=e.arcWidth,n=e.arcHeight,a=t.axis_x_categories.length<4?-20:10,r=(Math.min(i,n)-a)/2;return[r,r]},updateTargetsForRadar:function(t){var e=this,n=this.config;M(n.axis_x_categories)&&(n.axis_x_categories=ot(0,st("max",t.map(function(t){return i(this,e),t.values.length}.bind(this))))),this.generateRadarPoints()},getRadarPosition:function(t,e,n,a){var r=this,s=this.config,o=this.getRadarSize(),l=o[0],c=o[1],d=s.axis_x_categories.length,u=s.radar_direction_clockwise,h=tt(t).map(function(o){return i(this,r),function(t,e,i,n,a,r){var s=t&&n>0?i-n:n,o=2*Math.PI;return a*(1-r*("x"===e?Math.sin:Math.cos)(s*o/i))}(u,o,d,e,L(n)?n:"x"===t?l:c,R(a)?a:s.radar_size_ratio)}.bind(this));return 1===h.length?h[0]:h},generateRadarPoints:function(){var t=this,e=this,n=e.data.targets,a=e.getRadarSize(),r=a[0],s=a[1],o=e.cache.get(kn)||{},l=o._size;(!l||l.width!==r&&l.height!==s)&&(n.forEach(function(n){var a=this;i(this,t),o[n.id]=n.values.map(function(t,n){return i(this,a),e.getRadarPosition(["x","y"],n,void 0,e.getRatio("radar",t))}.bind(this))}.bind(this)),o._size={width:r,height:s},e.cache.add(kn,o))},redrawRadar:function(){var t=this,e=t.$el,i=e.radar,n=e.main,a=t.getTranslate("radar");a&&(i.attr("transform",a),n.select("."+Xt.chartTexts).attr("transform",a),t.generateRadarPoints(),t.updateRadarLevel(),t.updateRadarAxes(),t.updateRadarShape())},generateGetRadarPoints:function(){var t=this,e=this.cache.get(kn);return function(n,a){i(this,t);var r=e[n.id][a];return[r,r,r,r]}.bind(this)},updateRadarLevel:function(){var t=this,e=this,n=e.config,a=e.state,r=e.$el.radar,s=e.getRadarSize(),o=s[0],l=s[1],c=n.radar_level_depth,d=n.axis_x_categories.length,u=n.radar_level_text_show,h=r.levels,g=ot(0,c),f=n.radar_size_ratio*Math.min(o,l),p=g.map(function(e){return i(this,t),f*((e+1)/c)}.bind(this)),v=(n.radar_level_text_format||function(){}).bind(e.api),x=g.map(function(n){var a=this;i(this,t);var r=p[n];return ot(0,d).map(function(t){return i(this,a),e.getRadarPosition(["x","y"],t,r,1).join(",")}.bind(this)).join(" ")}.bind(this)),b=h.selectAll("."+Ot).data(g);b.exit().remove();var _=b.enter().append("g").attr("class",function(e,n){return i(this,t),Ot+" "+Ot+"-"+n}.bind(this));_.append("polygon").style("visibility",n.radar_level_show?null:"hidden"),u&&(h.select("text").empty()&&h.append("text").attr("dx","-.5em").attr("dy","-.7em").style("text-anchor","end").text(function(){return i(this,t),v(0)}.bind(this)),_.append("text").attr("dx","-.5em").style("text-anchor","end").text(function(e){return i(this,t),v(a.current.dataMax/g.length*(e+1))}.bind(this))),_.merge(b).attr("transform",function(e){return i(this,t),"translate("+(o-p[e])+", "+(l-p[e])+")"}.bind(this)).selectAll("polygon").attr("points",function(e){return i(this,t),x[e]}.bind(this)),u&&h.selectAll("text").attr("x",function(e){return i(this,t),E(e)?o:x[e].split(",")[0]}.bind(this)).attr("y",function(e){return i(this,t),E(e)?l:0}.bind(this))},updateRadarAxes:function(){var t=this,e=this,n=e.config,r=e.$el.radar,s=e.getRadarSize(),o=s[0],l=s[1],c=n.axis_x_categories,d=r.axes.selectAll("g").data(c);d.exit().remove();var u=d.enter().append("g").attr("class",function(e,n){return i(this,t),_t.axis+"-"+n}.bind(this));if(n.radar_axis_line_show&&u.append("line"),n.radar_axis_text_show&&u.append("text"),d=u.merge(d),n.radar_axis_line_show&&d.select("line").attr("x1",o).attr("y1",l).attr("x2",function(n,a){return i(this,t),e.getRadarPosition("x",a)}.bind(this)).attr("y2",function(n,a){return i(this,t),e.getRadarPosition("y",a)}.bind(this)),n.radar_axis_text_show){var h=n.radar_axis_text_position,g=h.x,f=void 0===g?0:g,p=h.y,v=void 0===p?0:p;d.select("text").style("text-anchor","middle").attr("dy",".5em").call(function(e){i(this,t),e.each((function(t){V((0,a.select)(this),t+"",[-.6,1.2])}))}.bind(this)).datum(function(e,n){return i(this,t),{index:n}}.bind(this)).attr("transform",(function(t){E(this.width)&&(this.width=this.getBoundingClientRect().width/2);var i=e.getRadarPosition("x",t.index,void 0,1),n=Math.round(e.getRadarPosition("y",t.index,void 0,1));return i>o?i+=this.width+f:Math.round(i)l?(n/2===l&&"tspan"===this.firstChild.tagName&&this.firstChild.setAttribute("dy","0em"),n+=v):n=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Ln(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i=0,p=!i||i.indexOf(h)>=0,v=o.classed(zt.SELECTED);o.classed(Ct.line)||o.classed(bt.area)||(t?f&&p&&c(s)&&!v?g(!0,o.classed(zt.SELECTED,!0),s,h):L(n)&&n&&v&&g(!1,o.classed(zt.SELECTED,!1),s,h):f&&p&&c(s)&&v&&g(!1,o.classed(zt.SELECTED,!1),s,h))}))}var ba={selected:function(t){var e=this,n=this.internal,r=[];return n.$el.main.selectAll("."+(Mt.shapes+n.getTargetSelectorSuffix(t))).selectAll("."+Mt.shape).filter((function(){return(0,a.select)(this).classed(zt.SELECTED)})).each(function(t){return i(this,e),r.push(t)}.bind(this)),r},select:function(t,e,i){var n=this.internal;xa.bind(n)(!0,t,e,i)},unselect:function(t,e){var i=this.internal;xa.bind(i)(!1,t,e)}},_a={subchart:{show:function(){var t=this.internal,e=t.$el.subchart,i=t.config,n=i.subchart_show;if(!n){var a,r;t.unbindZoomEvent(),i.subchart_show=!n,e.main||t.initSubchart();var s,o=e.main.selectAll("."+vt.target);if(t.data.targets.length!==o.size())t.updateSizes(),t.updateTargetsForSubchart(t.data.targets),o=null==(s=e.main)?void 0:s.selectAll("."+vt.target);null==(a=o)||a.style("opacity",null),null==(r=e.main)||r.style("display",null),this.resize()}},hide:function(){var t=this.internal,e=t.$el.subchart.main,i=t.config;i.subchart_show&&"none"!==(null==e?void 0:e.style("display"))&&(i.subchart_show=!1,e.style("display","none"),this.resize())},toggle:function(){var t=this.internal.config;this.subchart[t.subchart_show?"hide":"show"]()}}},ma=p(14);var ya=function(t){var e=this,n=this.internal,a=n.$el,r=n.axis,s=n.config,o=n.org,l=n.scale,c=s.axis_rotated,d=s.axis_x_inverted,u=r.isCategorized(),h=t;if(s.zoom_enabled&&h){r.isTimeSeries()&&(h=h.map(function(t){return i(this,e),dt.bind(n)(t)}.bind(this)));var g=function(t,e,n,a){var r=this;void 0===a&&(a=!1);var s=n[0],o=n[1];return t.every(function(n,l){var c=this;return i(this,r),(0===l?a?+n<=s:+n>=s:a?+n>=o:+n<=o)&&!t.every(function(t,n){return i(this,c),t===e[n]}.bind(this))}.bind(this))}(h,n.getZoomDomain(!0),n.getZoomDomain(),d);if(g){if(u&&(h=h.map(function(t,n){return i(this,e),+t+(0===n?0:1)}.bind(this))),n.api.tooltip.hide(),s.subchart_show){var f=l.zoom||l.x;n.brush.getSelection().call(n.brush.move,h.map(f))}else{var p,v=u?l.x.orgScale():o.xScale||l.x,x=[-v(h[0]),0],b=(p=ma.zoomIdentity.scale(v.range()[1]/(v(h[1])-v(h[0])))).translate.apply(p,c?x.reverse():x);a.eventRect.call(n.zoom.transform,b)}n.setZoomResetButton()}}else h=l.zoom?l.zoom.domain():l.x.orgDomain();return h};J(ya,{enable:function(t){var e=this.internal,i=e.config;/^(drag|wheel)$/.test(t)&&(i.zoom_type=t),i.zoom_enabled=!!t,e.zoom?!1===t&&e.bindZoomEvent(!1):(e.initZoom(),e.bindZoomEvent()),e.updateAndRedraw()},max:function(t){var e=this.internal,i=e.config,n=e.org.xDomain;return(0===t||t)&&(i.zoom_x_max=st("max",[n[1],t])),i.zoom_x_max},min:function(t){var e=this.internal,i=e.config,n=e.org.xDomain;return(0===t||t)&&(i.zoom_x_min=st("min",[n[0],t])),i.zoom_x_min},range:function(t){var e=this.zoom;if(F(t)){var i=t.min,n=t.max;L(i)&&e.min(i),L(n)&&e.max(n)}return{min:e.min(),max:e.max()}}});var Ta={zoom:ya,unzoom:function(){var t=this.internal,e=t.config,i=t.$el,n=i.eventRect,a=i.zoomResetBtn;t.scale.zoom&&(e.subchart_show?t.brush.getSelection().call(t.brush.move,null):t.zoom.updateTransformScale(ma.zoomIdentity),t.updateZoom(!0),null==a||a.style("display","none"),(0,ma.zoomTransform)(n.node())!==ma.zoomIdentity&&t.zoom.transform(n,ma.zoomIdentity))}},wa={drag:function(t){var e=this,n=this,r=n.config,s=n.state,o=n.$el.main,l=r.data_selection_grouped,c=r.interaction_enabled&&r.data_selection_isselectable;if(!n.hasArcType()&&r.data_selection_enabled&&(!r.zoom_enabled||n.zoom.altDomain)&&r.data_selection_multiple){var d=s.dragStart||[0,0],u=d[0],h=d[1],g=t[0],f=t[1],p=Math.min(u,g),v=Math.max(u,g),x=l?s.margin.top:Math.min(h,f),b=l?s.height:Math.max(h,f);o.select("."+At.dragarea).attr("x",p).attr("y",x).attr("width",v-p).attr("height",b-x),o.selectAll("."+Mt.shapes).selectAll("."+Mt.shape).filter(function(t){return i(this,e),null==c?void 0:c.bind(n.api)(t)}.bind(this)).each((function(t,e){var i,r=(0,a.select)(this),s=r.classed(zt.SELECTED),o=r.classed(At.INCLUDED),l=!1;if(r.classed(Tt.circle)){var c=1*+r.attr("cx"),d=1*+r.attr("cy");i=n.togglePoint,l=p0?n:a]}.bind(this))),c&&a[1].reverse(),this.extent(a),this.update()},r.brush.getSelection=function(){return i(this,n),l.main?l.main.select("."+Gt.brush):(0,a.select)([])}.bind(this)},initSubchart:function(){var t=this,e=this,n=e.config,a=e.state,r=a.clip,s=a.hasAxis,o=e.$el,l=o.defs,c=o.svg,d=o.subchart,u=o.axis;if(s){var h=n.subchart_show?null:"hidden",g=r.id+"-subchart",f=e.getClipPath(g);r.idSubchart=g,e.appendClip(l,g),e.initBrush(),d.main=c.append("g").classed(Gt.subchart,!0).attr("transform",e.getTranslate("context"));var p=d.main;p.style("visibility",h),p.append("g").attr("clip-path",f).attr("class",Gt.chart),["bar","line","bubble","candlestick","scatter"].forEach(function(n){i(this,t);var a=Q(/^(bubble|scatter)$/.test(n)?"circle":n);if(e.hasType(n)||e.hasTypeOf(a)){var r=p.select("."+Gt.chart),s=Gt["chart"+a+"s"];r.select("."+s).empty()&&r.append("g").attr("class",s)}}.bind(this));var v=p.append("g").attr("clip-path",f).attr("class",Gt.brush).call(e.brush);n.subchart_showHandle&&e.addBrushHandle(v),u.subX=p.append("g").attr("class",Gt.axisX).attr("transform",e.getTranslate("subX")).attr("clip-path",n.axis_rotated?"":r.pathXAxis).style("visibility",n.subchart_axis_x_show?h:"hidden")}},addBrushHandle:function(t){var e=this,n=this.config,a=n.axis_rotated,r=n.subchart_init_range,s=a?["M 5.2491724,29.749209 a 6,6 0 0 0 -5.50000003,-6.5 H -5.7508276 a 6,6 0 0 0 -6.0000004,6.5 z m -5.00000003,-2 H -6.7508276 m 6.99999997,-2 H -6.7508276Z","M 5.2491724,23.249172 a 6,-6 0 0 1 -5.50000003,6.5 H -5.7508276 a 6,-6 0 0 1 -6.0000004,-6.5 z m -5.00000003,2 H -6.7508276 m 6.99999997,2 H -6.7508276Z"]:["M 0 18 A 6 6 0 0 0 -6.5 23.5 V 29 A 6 6 0 0 0 0 35 Z M -2 23 V 30 M -4 23 V 30Z","M 0 18 A 6 6 0 0 1 6.5 23.5 V 29 A 6 6 0 0 1 0 35 Z M 2 23 V 30 M 4 23 V 30Z"];this.brush.handle=t.selectAll(".handle--custom").data(a?[{type:"n"},{type:"s"}]:[{type:"w"},{type:"e"}]).enter().append("path").attr("class","handle--custom").attr("cursor",(a?"ns":"ew")+"-resize").attr("d",function(t){return i(this,e),s[+/[se]/.test(t.type)]}.bind(this)).attr("display",r?null:"none")},updateTargetsForSubchart:function(t){var e=this,n=this,a=n.config,r=n.state,s=n.$el.subchart.main;a.subchart_show&&(["bar","line","bubble","candlestick","scatter"].filter(function(t){return i(this,e),n.hasType(t)||n.hasTypeOf(Q(t))}.bind(this)).forEach(function(a){i(this,e);var r=/^(bubble|scatter)$/.test(a),o=Q(r?"circle":a),l=n.getChartClass(o,!0),c=n.getClass(r?"circles":a+"s",!0),d=s.select("."+Gt["chart"+o+"s"]);if(r){var u=d.selectAll("."+Gt.circles).data(t.filter(n["is"+Q(a)+"Type"].bind(n))).attr("class",c);u.exit().remove(),u.enter().append("g").attr("class",c)}else{var h=d.selectAll("."+Gt["chart"+o]).attr("class",l).data(t.filter(n["is"+o+"Type"].bind(n))),g=h.enter().append("g").style("opacity","0").attr("class",l).append("g").attr("class",c);h.exit().remove(),"line"===a&&n.hasTypeOf("Area")&&g.append("g").attr("class",n.getClass("areas",!0))}}.bind(this)),s.selectAll("."+Gt.brush+" rect").attr(a.axis_rotated?"width":"height",a.axis_rotated?r.width2:r.height2))},redrawSubchart:function(t,e,n){var a,r=this,s=this,o=s.config,l=s.$el.subchart.main,c=s.state,d=!!e;if((l.style("visibility",o.subchart_show?null:"hidden"),o.subchart_show)&&("zoom"===(null==(a=c.event)?void 0:a.type)&&s.brush.update(),t)){var u=o.subchart_init_range;if(K(s)||s.brush.update(),Object.keys(n.type).forEach(function(t){i(this,r);var e=Q(t),a=s["generateDraw"+e](n.indices[t],!0);s["update"+e](d,!0),s["redraw"+e](a,d,!0)}.bind(this)),s.hasType("bubble")||s.hasType("scatter")){var h=n.pos.cx,g=s.updateCircleY(!0);s.updateCircle(!0),s.redrawCircle(h,g,d,void 0,!0)}!c.rendered&&u&&s.brush.move(s.brush.getSelection(),u.map(s.scale.x))}},redrawForBrush:function(){var t=this,e=t.config,i=e.subchart_onbrush,n=e.zoom_rescale,a=t.scale;t.redraw({withTransition:!1,withY:n,withSubchart:!1,withUpdateXDomain:!0,withDimension:!1}),i.bind(t.api)(a.x.orgDomain())},transformContext:function(t,e){var i=this,n=i.$el.subchart,a=i.$T,r=null!=e&&e.axisSubX?e.axisSubX:a(n.main.select("."+Gt.axisX),t);n.main.attr("transform",i.getTranslate("context")),r.attr("transform",i.getTranslate("subX"))},getExtent:function(){var t=this,e=this,n=e.config,a=e.scale,r=n.axis_x_extent;if(r)if(k(r))r=r.bind(e.api)(e.getXDomain(e.data.targets),a.subX);else if(e.axis.isTimeSeries()&&r.every(isNaN)){var s=dt.bind(e);r=r.map(function(e){return i(this,t),a.subX(s(e))}.bind(this))}return r}},Ra={initZoom:function(){var t=this;t.scale.zoom=null,t.generateZoom(),t.initZoomBehaviour()},bindZoomEvent:function(t){void 0===t&&(t=!0);var e=this,i=e.config;i.zoom_enabled&&t?i.subchart_show||e.bindZoomOnEventRect():!1===t&&(e.api.unzoom(),e.unbindZoomEvent())},generateZoom:function(){var t=this,e=this,n=e.config,a=e.org,r=e.scale,s=(0,ma.zoom)().duration(0).on("start",e.onZoomStart.bind(e)).on("zoom",e.onZoom.bind(e)).on("end",e.onZoomEnd.bind(e));s.orgScaleExtent=function(){i(this,t);var a=n.zoom_extent||[1,10];return[a[0],Math.max(e.getMaxDataCount()/a[1],a[1])]}.bind(this),s.updateScaleExtent=function(){var t=D(e.scale.x.orgDomain())/D(e.getZoomDomain()),i=this.orgScaleExtent();return this.scaleExtent([i[0]*t,i[1]*t]),this},s.updateTransformScale=function(s,o){var l;i(this,t);var c=n.axis_rotated;null==(l=a.xScale)||l.range(r.x.range());var d=s[c?"rescaleY":"rescaleX"](a.xScale||r.x),u=e.trimXDomain(d.domain()),h=n.zoom_rescale;if(d.domain(u,a.xDomain),o){var g=d(r.x.domain()[0]),f=c?s.x:g,p=c?g:s.y;e.$el.eventRect.property("__zoom",ma.zoomIdentity.translate(f,p).scale(s.k))}e.state.xTickOffset||(e.state.xTickOffset=e.axis.x.tickOffset()),r.zoom=e.getCustomizedXScale(d),e.axis.x.scale(r.zoom),h&&(a.xScale||(a.xScale=r.x.copy()),r.x.domain(u))}.bind(this),s.getDomain=function(){i(this,t);var n=r[r.zoom?"zoom":"subX"].domain();return e.axis.isCategorized()&&(n[1]-=2),n}.bind(this),e.zoom=s},onZoomStart:function(t){var e=this,i=t.sourceEvent;i&&(e.zoom.startEvent=i,e.state.zooming=!0,N(e.config.zoom_onzoomstart,e.api,t))},onZoom:function(t){var e=this,n=this,a=n.config,r=n.scale,s=n.state,o=n.org,l=t.sourceEvent,c=(null==t?void 0:t.transform)===ma.zoomIdentity;if(!(!a.zoom_enabled||0===n.filterTargetsToShow(n.data.targets).length||!r.zoom&&(null==l?void 0:l.type.indexOf("touch"))>-1&&1===(null==l?void 0:l.touches.length))){t.sourceEvent&&(s.zooming=!0);var d="mousemove"===(null==l?void 0:l.type),u=(null==l?void 0:l.wheelDelta)<0,h=t.transform;!d&&u&&r.x.domain().every(function(t,n){return i(this,e),t!==o.xDomain[n]}.bind(this))&&r.x.domain(o.xDomain),n.zoom.updateTransformScale(h,"wheel"===a.zoom_type&&l);var g=a.transition_duration>0&&!a.subchart_show&&(s.dragging||c||!t.sourceEvent);n.redraw({withTransition:g,withY:a.zoom_rescale,withSubchart:!1,withEventRect:!1,withDimension:!1}),n.state.cancelClick=d,c||N(a.zoom_onzoom,n.api,n.zoom.getDomain())}},onZoomEnd:function(t){var e,i,n,a=this,r=a.config,s=a.state,o=a.zoom.startEvent,l=null==t?void 0:t.sourceEvent,c=(null==t?void 0:t.transform)===ma.zoomIdentity;(null==(e=o)?void 0:e.type.indexOf("touch"))>-1&&(o=o.changedTouches[0],l=null==(i=l)||null==(n=i.changedTouches)?void 0:n[0]);"drag"===r.zoom_type&&l&&o.clientX===l.clientX&&o.clientY===l.clientY||(a.redrawEventRect(),a.updateZoom(),s.zooming=!1,!c&&(l||s.dragging)&&N(r.zoom_onzoomend,a.api,a.zoom.getDomain()))},updateZoom:function(t){var e=this,i=e.scale,n=i.subX,a=i.x,r=i.zoom;if(r){var s=r.domain(),o=n.domain(),l=.015,c=e.config.axis_x_inverted?(s[0]>=o[0]||s[0]+l>=o[0])&&(o[1]>=s[1]||o[1]>=s[1]+l):(s[0]<=o[0]||s[0]-l<=o[0])&&(o[1]<=s[1]||o[1]<=s[1]-l);(t||c)&&(e.axis.x.scale(n),a.domain(n.orgDomain()),e.scale.zoom=null)}},bindZoomOnEventRect:function(){var t=this,e=this,n=e.config,a=e.$el.eventRect,r="drag"===n.zoom_type?e.zoomBehaviour:e.zoom;e.$el.svg.on("wheel",function(){i(this,t)}.bind(this)),a.call(r).on("dblclick.zoom",null)},initZoomBehaviour:function(){var t,e=this,n=this,a=n.config,r=n.state,s=a.axis_rotated,o=0,l=0,c={axis:s?"y":"x",attr:s?"height":"width",index:s?1:0};n.zoomBehaviour=(0,Pe.drag)().clickDistance(4).on("start",(function(e){r.event=e,n.setDragStatus(!0),n.unselectRect(),t||(t=n.$el.main.append("rect").attr("clip-path",r.clip.path).attr("class",Nt.zoomBrush).attr("width",s?r.width:0).attr("height",s?0:r.height)),o=H(e,this)[c.index],l=o,t.attr(c.axis,o).attr(c.attr,0),n.onZoomStart(e)})).on("drag",(function(e){l=H(e,this)[c.index],t.attr(c.axis,Math.min(o,l)).attr(c.attr,Math.abs(l-o))})).on("end",function(a){var s=this;i(this,e);var d=n.scale.zoom||n.scale.x;if(r.event=a,t.attr(c.axis,0).attr(c.attr,0),o>l){var u=[l,o];o=u[0],l=u[1]}o<0&&(l+=Math.abs(o),o=0),o!==l&&n.api.zoom([o,l].map(function(t){return i(this,s),d.invert(t)}.bind(this))),n.setDragStatus(!1)}.bind(this))},setZoomResetButton:function(){var t=this,e=t.config,i=t.$el,n=e.zoom_resetButton;n&&"drag"===e.zoom_type&&(i.zoomResetBtn?i.zoomResetBtn.style("display",null):i.zoomResetBtn=t.$el.chart.append("div").classed(vt.button,!0).append("span").on("click",(function(){k(n.onclick)&&n.onclick.bind(t.api)(this),t.api.unzoom()})).classed(Nt.buttonZoomReset,!0).text(n.text||"Reset Zoom"))}},Ea=void 0,La={data_selection_enabled:!1,data_selection_grouped:!1,data_selection_isselectable:function(){return i(this,Ea),!0}.bind(void 0),data_selection_multiple:!0,data_selection_draggable:!1,data_onselected:function(){i(this,Ea)}.bind(void 0),data_onunselected:function(){i(this,Ea)}.bind(void 0)},Oa={subchart_show:!1,subchart_showHandle:!1,subchart_size_height:60,subchart_axis_x_show:!0,subchart_axis_x_tick_show:!0,subchart_axis_x_tick_format:void 0,subchart_axis_x_tick_text_show:!0,subchart_init_range:void 0,subchart_onbrush:function(){i(this,undefined)}.bind(void 0)},Pa={zoom_enabled:!1,zoom_type:"wheel",zoom_extent:void 0,zoom_privileged:!1,zoom_rescale:!1,zoom_onzoom:void 0,zoom_onzoomstart:void 0,zoom_onzoomend:void 0,zoom_resetButton:!0,zoom_x_min:void 0,zoom_x_max:void 0},Ia=void 0,Da=function(){var t=this;return i(this,Ia),J(si.prototype,ka),J(Ti.prototype,ba),ne.setOptions([La]),(Da=function(){return i(this,t),!0}.bind(this))()}.bind(void 0),za=function(){var t=this;return i(this,Ia),J(si.prototype,Ca),J(Ti.prototype,_a),ne.setOptions([Oa]),(za=function(){return i(this,t),!0}.bind(this))()}.bind(void 0),Ma=function(){var t=this;return i(this,Ia),J(si.prototype,Ra),J(Ti.prototype,Ta),ne.setOptions([Pa]),(Ma=function(){return i(this,t),!0}.bind(this))()}.bind(void 0),$a={},Xa={version:"3.9.0",generate:function(t){var e=at({},$a,t),i=new Ti(e);return i.internal.charts=this.instance,this.instance.push(i),i},defaults:function(t){return F(t)&&($a=t),$a},instance:[],plugin:{}},Fa=void 0;Object.keys(t).forEach(function(e){return i(this,Fa),t[e]()}.bind(void 0)),Object.keys(e).forEach(function(t){return i(this,Fa),e[t]()}.bind(void 0))}(),v}()})); \ No newline at end of file diff --git a/org.idempiere.zk.billboard/src/web/js/zul/billboard/ext/billboard.line.js b/org.idempiere.zk.billboard/src/web/js/zul/billboard/ext/billboard.line.js index 03dfc74754..e5c10906f0 100644 --- a/org.idempiere.zk.billboard/src/web/js/zul/billboard/ext/billboard.line.js +++ b/org.idempiere.zk.billboard/src/web/js/zul/billboard/ext/billboard.line.js @@ -105,7 +105,7 @@ billboard.LineRenderer.prototype.render = function(wgt) { var h = '
'; h = h + defaultTitleFormat(c.x); h = h + '
'; - h = h + c.value + '
'; + h = h + d3.format('.2f')(c.value) + ''; return h; } }, diff --git a/org.idempiere.zk.billboard/src/web/js/zul/billboard/ext/billboard.pkgd.js b/org.idempiere.zk.billboard/src/web/js/zul/billboard/ext/billboard.pkgd.js deleted file mode 100644 index 59a8e32902..0000000000 --- a/org.idempiere.zk.billboard/src/web/js/zul/billboard/ext/billboard.pkgd.js +++ /dev/null @@ -1,25 +0,0 @@ -/*! - * Copyright (c) 2017 ~ present NAVER Corp. - * billboard.js project is licensed under the MIT license - * - * billboard.js, JavaScript chart library - * https://naver.github.io/billboard.js/ - * - * @version 3.5.1 - * - * All-in-one packaged file for ease use of 'billboard.js' with dependant d3.js modules & polyfills. - * - d3-axis ^3.0.0 - * - d3-brush ^3.0.0 - * - d3-drag ^3.0.0 - * - d3-dsv ^3.0.1 - * - d3-ease ^3.0.1 - * - d3-interpolate ^3.0.1 - * - d3-scale ^4.0.2 - * - d3-selection ^3.0.0 - * - d3-shape ^3.1.0 - * - d3-time-format ^4.1.0 - * - d3-transition ^3.0.1 - * - d3-zoom ^3.0.0 - */ -!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var i in n)("object"==typeof exports?exports:t)[i]=n[i]}}(this,(function(){return function(){var t=[function(t,e,n){n(1),n(95),n(96),n(97),n(98),n(99),n(100),n(101),n(102),n(103),n(104),n(105),n(106),n(107),n(108),n(109),n(119),n(121),n(131),n(132),n(134),n(137),n(140),n(142),n(144),n(145),n(146),n(147),n(149),n(150),n(152),n(153),n(155),n(159),n(160),n(161),n(162),n(166),n(167),n(169),n(170),n(171),n(172),n(175),n(176),n(177),n(178),n(179),n(184),n(186),n(187),n(188),n(189),n(190),n(197),n(199),n(202),n(204),n(205),n(206),n(207),n(208),n(212),n(213),n(215),n(216),n(217),n(219),n(220),n(221),n(91),n(222),n(223),n(231),n(233),n(234),n(235),n(237),n(238),n(240),n(241),n(243),n(244),n(245),n(247),n(248),n(249),n(250),n(251),n(252),n(253),n(254),n(258),n(259),n(261),n(263),n(264),n(265),n(266),n(267),n(269),n(271),n(272),n(273),n(274),n(276),n(277),n(279),n(280),n(281),n(282),n(284),n(285),n(286),n(287),n(288),n(289),n(290),n(291),n(293),n(294),n(295),n(296),n(297),n(298),n(299),n(300),n(301),n(302),n(304),n(305),n(306),n(307),n(329),n(330),n(331),n(332),n(333),n(334),n(335),n(336),n(338),n(339),n(340),n(341),n(342),n(343),n(344),n(345),n(346),n(347),n(354),n(356),n(358),n(359),n(360),n(361),n(362),n(364),n(365),n(367),n(370),n(371),n(372),n(373),n(377),n(378),n(380),n(381),n(382),n(383),n(385),n(386),n(387),n(388),n(389),n(390),n(392),n(395),n(398),n(401),n(402),n(403),n(404),n(405),n(406),n(407),n(408),n(409),n(410),n(411),n(412),n(413),n(419),n(420),n(421),n(422),n(423),n(424),n(425),n(426),n(427),n(428),n(429),n(430),n(432),n(436),n(437),n(438),n(439),n(440),n(441),n(442),n(443),n(444),n(445),n(446),n(447),n(448),n(449),n(450),n(451),n(452),n(453),n(454),n(455),n(456),n(457),n(458),n(459),n(460),n(463),n(465),n(467),n(468),n(471),n(472),n(475),n(476),n(477),n(480),n(481),n(483),n(487),n(492),n(493),n(79)},function(t,e,n){n(2),n(88),n(90),n(91),n(94)},function(t,e,n){"use strict";var i=n(3),r=n(4),a=n(8),o=n(14),s=n(34),u=n(6),c=n(25),l=n(7),h=n(37),f=n(23),d=n(45),g=n(12),p=n(17),v=n(67),y=n(11),x=n(70),b=n(72),_=n(56),m=n(74),w=n(65),T=n(5),A=n(43),S=n(71),E=n(10),k=n(46),M=n(33),O=n(52),R=n(53),C=n(39),I=n(32),L=n(77),P=n(78),D=n(80),N=n(81),z=n(50),F=n(82).forEach,j=O("hidden"),B="Symbol",X=z.set,$=z.getterFor(B),U=Object.prototype,Y=r.Symbol,V=Y&&Y.prototype,G=r.TypeError,H=r.QObject,W=T.f,q=A.f,Z=m.f,K=E.f,J=o([].push),Q=M("symbols"),tt=M("op-symbols"),et=M("wks"),nt=!H||!H.prototype||!H.prototype.findChild,it=u&&l((function(){return 7!=x(q({},"a",{get:function(){return q(this,"a",{value:7}).a}})).a}))?function(t,e,n){var i=W(U,e);i&&delete U[e],q(t,e,n),i&&t!==U&&q(U,e,i)}:q,rt=function(t,e){var n=Q[t]=x(V);return X(n,{type:B,tag:t,description:e}),u||(n.description=e),n},at=function(t,e,n){t===U&&at(tt,e,n),d(t);var i=p(e);return d(n),h(Q,i)?(n.enumerable?(h(t,j)&&t[j][i]&&(t[j][i]=!1),n=x(n,{enumerable:y(0,!1)})):(h(t,j)||q(t,j,y(1,{})),t[j][i]=!0),it(t,i,n)):q(t,i,n)},ot=function(t,e){d(t);var n=g(e),i=b(n).concat(lt(n));return F(i,(function(e){u&&!a(st,n,e)||at(t,e,n[e])})),t},st=function(t){var e=p(t),n=a(K,this,e);return!(this===U&&h(Q,e)&&!h(tt,e))&&(!(n||!h(this,e)||!h(Q,e)||h(this,j)&&this[j][e])||n)},ut=function(t,e){var n=g(t),i=p(e);if(n!==U||!h(Q,i)||h(tt,i)){var r=W(n,i);return!r||!h(Q,i)||h(n,j)&&n[j][i]||(r.enumerable=!0),r}},ct=function(t){var e=Z(g(t)),n=[];return F(e,(function(t){h(Q,t)||h(R,t)||J(n,t)})),n},lt=function(t){var e=t===U,n=Z(e?tt:g(t)),i=[];return F(n,(function(t){!h(Q,t)||e&&!h(U,t)||J(i,Q[t])})),i};c||(Y=function(){if(f(V,this))throw G("Symbol is not a constructor");var t=arguments.length&&void 0!==arguments[0]?v(arguments[0]):void 0,e=C(t),n=function(t){this===U&&a(n,tt,t),h(this,j)&&h(this[j],e)&&(this[j][e]=!1),it(this,e,y(1,t))};return u&&nt&&it(U,e,{configurable:!0,set:n}),rt(e,t)},k(V=Y.prototype,"toString",(function(){return $(this).tag})),k(Y,"withoutSetter",(function(t){return rt(C(t),t)})),E.f=st,A.f=at,S.f=ot,T.f=ut,_.f=m.f=ct,w.f=lt,L.f=function(t){return rt(I(t),t)},u&&(q(V,"description",{configurable:!0,get:function(){return $(this).description}}),s||k(U,"propertyIsEnumerable",st,{unsafe:!0}))),i({global:!0,constructor:!0,wrap:!0,forced:!c,sham:!c},{Symbol:Y}),F(b(et),(function(t){P(t)})),i({target:B,stat:!0,forced:!c},{useSetter:function(){nt=!0},useSimple:function(){nt=!1}}),i({target:"Object",stat:!0,forced:!c,sham:!u},{create:function(t,e){return void 0===e?x(t):ot(x(t),e)},defineProperty:at,defineProperties:ot,getOwnPropertyDescriptor:ut}),i({target:"Object",stat:!0,forced:!c},{getOwnPropertyNames:ct}),D(),N(Y,B),R[j]=!0},function(t,e,n){var i=n(4),r=n(5).f,a=n(42),o=n(46),s=n(36),u=n(54),c=n(66);t.exports=function(t,e){var n,l,h,f,d,g=t.target,p=t.global,v=t.stat;if(n=p?i:v?i[g]||s(g,{}):(i[g]||{}).prototype)for(l in e){if(f=e[l],h=t.dontCallGetSet?(d=r(n,l))&&d.value:n[l],!c(p?l:g+(v?".":"#")+l,t.forced)&&void 0!==h){if(typeof f==typeof h)continue;u(f,h)}(t.sham||h&&h.sham)&&a(f,"sham",!0),o(n,l,f,t)}}},function(t){var e=function(t){return t&&t.Math==Math&&t};t.exports=e("object"==typeof globalThis&&globalThis)||e("object"==typeof window&&window)||e("object"==typeof self&&self)||e("object"==typeof global&&global)||function(){return this}()||Function("return this")()},function(t,e,n){var i=n(6),r=n(8),a=n(10),o=n(11),s=n(12),u=n(17),c=n(37),l=n(40),h=Object.getOwnPropertyDescriptor;e.f=i?h:function(t,e){if(t=s(t),e=u(e),l)try{return h(t,e)}catch(t){}if(c(t,e))return o(!r(a.f,t,e),t[e])}},function(t,e,n){var i=n(7);t.exports=!i((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},function(t){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e,n){var i=n(9),r=Function.prototype.call;t.exports=i?r.bind(r):function(){return r.apply(r,arguments)}},function(t,e,n){var i=n(7);t.exports=!i((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},function(t,e){"use strict";var n={}.propertyIsEnumerable,i=Object.getOwnPropertyDescriptor,r=i&&!n.call({1:2},1);e.f=r?function(t){var e=i(this,t);return!!e&&e.enumerable}:n},function(t){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,n){var i=n(13),r=n(16);t.exports=function(t){return i(r(t))}},function(t,e,n){var i=n(14),r=n(7),a=n(15),o=Object,s=i("".split);t.exports=r((function(){return!o("z").propertyIsEnumerable(0)}))?function(t){return"String"==a(t)?s(t,""):o(t)}:o},function(t,e,n){var i=n(9),r=Function.prototype,a=r.bind,o=r.call,s=i&&a.bind(o,o);t.exports=i?function(t){return t&&s(t)}:function(t){return t&&function(){return o.apply(t,arguments)}}},function(t,e,n){var i=n(14),r=i({}.toString),a=i("".slice);t.exports=function(t){return a(r(t),8,-1)}},function(t){var e=TypeError;t.exports=function(t){if(null==t)throw e("Can't call method on "+t);return t}},function(t,e,n){var i=n(18),r=n(21);t.exports=function(t){var e=i(t,"string");return r(e)?e:e+""}},function(t,e,n){var i=n(8),r=n(19),a=n(21),o=n(28),s=n(31),u=n(32),c=TypeError,l=u("toPrimitive");t.exports=function(t,e){if(!r(t)||a(t))return t;var n,u=o(t,l);if(u){if(void 0===e&&(e="default"),n=i(u,t,e),!r(n)||a(n))return n;throw c("Can't convert object to primitive value")}return void 0===e&&(e="number"),s(t,e)}},function(t,e,n){var i=n(20);t.exports=function(t){return"object"==typeof t?null!==t:i(t)}},function(t){t.exports=function(t){return"function"==typeof t}},function(t,e,n){var i=n(22),r=n(20),a=n(23),o=n(24),s=Object;t.exports=o?function(t){return"symbol"==typeof t}:function(t){var e=i("Symbol");return r(e)&&a(e.prototype,s(t))}},function(t,e,n){var i=n(4),r=n(20),a=function(t){return r(t)?t:void 0};t.exports=function(t,e){return arguments.length<2?a(i[t]):i[t]&&i[t][e]}},function(t,e,n){var i=n(14);t.exports=i({}.isPrototypeOf)},function(t,e,n){var i=n(25);t.exports=i&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},function(t,e,n){var i=n(26),r=n(7);t.exports=!!Object.getOwnPropertySymbols&&!r((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&i&&i<41}))},function(t,e,n){var i,r,a=n(4),o=n(27),s=a.process,u=a.Deno,c=s&&s.versions||u&&u.version,l=c&&c.v8;l&&(r=(i=l.split("."))[0]>0&&i[0]<4?1:+(i[0]+i[1])),!r&&o&&(!(i=o.match(/Edge\/(\d+)/))||i[1]>=74)&&(i=o.match(/Chrome\/(\d+)/))&&(r=+i[1]),t.exports=r},function(t,e,n){var i=n(22);t.exports=i("navigator","userAgent")||""},function(t,e,n){var i=n(29);t.exports=function(t,e){var n=t[e];return null==n?void 0:i(n)}},function(t,e,n){var i=n(20),r=n(30),a=TypeError;t.exports=function(t){if(i(t))return t;throw a(r(t)+" is not a function")}},function(t){var e=String;t.exports=function(t){try{return e(t)}catch(t){return"Object"}}},function(t,e,n){var i=n(8),r=n(20),a=n(19),o=TypeError;t.exports=function(t,e){var n,s;if("string"===e&&r(n=t.toString)&&!a(s=i(n,t)))return s;if(r(n=t.valueOf)&&!a(s=i(n,t)))return s;if("string"!==e&&r(n=t.toString)&&!a(s=i(n,t)))return s;throw o("Can't convert object to primitive value")}},function(t,e,n){var i=n(4),r=n(33),a=n(37),o=n(39),s=n(25),u=n(24),c=r("wks"),l=i.Symbol,h=l&&l.for,f=u?l:l&&l.withoutSetter||o;t.exports=function(t){if(!a(c,t)||!s&&"string"!=typeof c[t]){var e="Symbol."+t;s&&a(l,t)?c[t]=l[t]:c[t]=u&&h?h(e):f(e)}return c[t]}},function(t,e,n){var i=n(34),r=n(35);(t.exports=function(t,e){return r[t]||(r[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.23.4",mode:i?"pure":"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.23.4/LICENSE",source:"https://github.com/zloirock/core-js"})},function(t){t.exports=!1},function(t,e,n){var i=n(4),r=n(36),a="__core-js_shared__",o=i[a]||r(a,{});t.exports=o},function(t,e,n){var i=n(4),r=Object.defineProperty;t.exports=function(t,e){try{r(i,t,{value:e,configurable:!0,writable:!0})}catch(n){i[t]=e}return e}},function(t,e,n){var i=n(14),r=n(38),a=i({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,e){return a(r(t),e)}},function(t,e,n){var i=n(16),r=Object;t.exports=function(t){return r(i(t))}},function(t,e,n){var i=n(14),r=0,a=Math.random(),o=i(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+o(++r+a,36)}},function(t,e,n){var i=n(6),r=n(7),a=n(41);t.exports=!i&&!r((function(){return 7!=Object.defineProperty(a("div"),"a",{get:function(){return 7}}).a}))},function(t,e,n){var i=n(4),r=n(19),a=i.document,o=r(a)&&r(a.createElement);t.exports=function(t){return o?a.createElement(t):{}}},function(t,e,n){var i=n(6),r=n(43),a=n(11);t.exports=i?function(t,e,n){return r.f(t,e,a(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){var i=n(6),r=n(40),a=n(44),o=n(45),s=n(17),u=TypeError,c=Object.defineProperty,l=Object.getOwnPropertyDescriptor,h="enumerable",f="configurable",d="writable";e.f=i?a?function(t,e,n){if(o(t),e=s(e),o(n),"function"==typeof t&&"prototype"===e&&"value"in n&&d in n&&!n.writable){var i=l(t,e);i&&i.writable&&(t[e]=n.value,n={configurable:f in n?n.configurable:i.configurable,enumerable:h in n?n.enumerable:i.enumerable,writable:!1})}return c(t,e,n)}:c:function(t,e,n){if(o(t),e=s(e),o(n),r)try{return c(t,e,n)}catch(t){}if("get"in n||"set"in n)throw u("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},function(t,e,n){var i=n(6),r=n(7);t.exports=i&&r((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},function(t,e,n){var i=n(19),r=String,a=TypeError;t.exports=function(t){if(i(t))return t;throw a(r(t)+" is not an object")}},function(t,e,n){var i=n(20),r=n(43),a=n(47),o=n(36);t.exports=function(t,e,n,s){s||(s={});var u=s.enumerable,c=void 0!==s.name?s.name:e;if(i(n)&&a(n,c,s),s.global)u?t[e]=n:o(e,n);else{try{s.unsafe?t[e]&&(u=!0):delete t[e]}catch(t){}u?t[e]=n:r.f(t,e,{value:n,enumerable:!1,configurable:!s.nonConfigurable,writable:!s.nonWritable})}return t}},function(t,e,n){var i=n(7),r=n(20),a=n(37),o=n(6),s=n(48).CONFIGURABLE,u=n(49),c=n(50),l=c.enforce,h=c.get,f=Object.defineProperty,d=o&&!i((function(){return 8!==f((function(){}),"length",{value:8}).length})),g=String(String).split("String"),p=t.exports=function(t,e,n){"Symbol("===String(e).slice(0,7)&&(e="["+String(e).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),n&&n.getter&&(e="get "+e),n&&n.setter&&(e="set "+e),(!a(t,"name")||s&&t.name!==e)&&(o?f(t,"name",{value:e,configurable:!0}):t.name=e),d&&n&&a(n,"arity")&&t.length!==n.arity&&f(t,"length",{value:n.arity});try{n&&a(n,"constructor")&&n.constructor?o&&f(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var i=l(t);return a(i,"source")||(i.source=g.join("string"==typeof e?e:"")),t};Function.prototype.toString=p((function(){return r(this)&&h(this).source||u(this)}),"toString")},function(t,e,n){var i=n(6),r=n(37),a=Function.prototype,o=i&&Object.getOwnPropertyDescriptor,s=r(a,"name"),u=s&&"something"===function(){}.name,c=s&&(!i||i&&o(a,"name").configurable);t.exports={EXISTS:s,PROPER:u,CONFIGURABLE:c}},function(t,e,n){var i=n(14),r=n(20),a=n(35),o=i(Function.toString);r(a.inspectSource)||(a.inspectSource=function(t){return o(t)}),t.exports=a.inspectSource},function(t,e,n){var i,r,a,o=n(51),s=n(4),u=n(14),c=n(19),l=n(42),h=n(37),f=n(35),d=n(52),g=n(53),p="Object already initialized",v=s.TypeError,y=s.WeakMap;if(o||f.state){var x=f.state||(f.state=new y),b=u(x.get),_=u(x.has),m=u(x.set);i=function(t,e){if(_(x,t))throw new v(p);return e.facade=t,m(x,t,e),e},r=function(t){return b(x,t)||{}},a=function(t){return _(x,t)}}else{var w=d("state");g[w]=!0,i=function(t,e){if(h(t,w))throw new v(p);return e.facade=t,l(t,w,e),e},r=function(t){return h(t,w)?t[w]:{}},a=function(t){return h(t,w)}}t.exports={set:i,get:r,has:a,enforce:function(t){return a(t)?r(t):i(t,{})},getterFor:function(t){return function(e){var n;if(!c(e)||(n=r(e)).type!==t)throw v("Incompatible receiver, "+t+" required");return n}}}},function(t,e,n){var i=n(4),r=n(20),a=n(49),o=i.WeakMap;t.exports=r(o)&&/native code/.test(a(o))},function(t,e,n){var i=n(33),r=n(39),a=i("keys");t.exports=function(t){return a[t]||(a[t]=r(t))}},function(t){t.exports={}},function(t,e,n){var i=n(37),r=n(55),a=n(5),o=n(43);t.exports=function(t,e,n){for(var s=r(e),u=o.f,c=a.f,l=0;lc;)r(i,n=e[c++])&&(~o(l,n)||u(l,n));return l}},function(t,e,n){var i=n(12),r=n(59),a=n(62),o=function(t){return function(e,n,o){var s,u=i(e),c=a(u),l=r(o,c);if(t&&n!=n){for(;c>l;)if((s=u[l++])!=s)return!0}else for(;c>l;l++)if((t||l in u)&&u[l]===n)return t||l||0;return!t&&-1}};t.exports={includes:o(!0),indexOf:o(!1)}},function(t,e,n){var i=n(60),r=Math.max,a=Math.min;t.exports=function(t,e){var n=i(t);return n<0?r(n+e,0):a(n,e)}},function(t,e,n){var i=n(61);t.exports=function(t){var e=+t;return e!=e||0===e?0:i(e)}},function(t){var e=Math.ceil,n=Math.floor;t.exports=Math.trunc||function(t){var i=+t;return(i>0?n:e)(i)}},function(t,e,n){var i=n(63);t.exports=function(t){return i(t.length)}},function(t,e,n){var i=n(60),r=Math.min;t.exports=function(t){return t>0?r(i(t),9007199254740991):0}},function(t){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e,n){var i=n(7),r=n(20),a=/#|\.prototype\./,o=function(t,e){var n=u[s(t)];return n==l||n!=c&&(r(e)?i(e):!!e)},s=o.normalize=function(t){return String(t).replace(a,".").toLowerCase()},u=o.data={},c=o.NATIVE="N",l=o.POLYFILL="P";t.exports=o},function(t,e,n){var i=n(68),r=String;t.exports=function(t){if("Symbol"===i(t))throw TypeError("Cannot convert a Symbol value to a string");return r(t)}},function(t,e,n){var i=n(69),r=n(20),a=n(15),o=n(32)("toStringTag"),s=Object,u="Arguments"==a(function(){return arguments}());t.exports=i?a:function(t){var e,n,i;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=s(t),o))?n:u?a(e):"Object"==(i=a(e))&&r(e.callee)?"Arguments":i}},function(t,e,n){var i={};i[n(32)("toStringTag")]="z",t.exports="[object z]"===String(i)},function(t,e,n){var i,r=n(45),a=n(71),o=n(64),s=n(53),u=n(73),c=n(41),l=n(52),h=l("IE_PROTO"),f=function(){},d=function(t){return"