@nebula.js/sn-funnel-chart 1.16.0 → 1.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,13 +1,11 @@
1
1
  /*
2
- * @nebula.js/sn-funnel-chart v1.16.0
2
+ * @nebula.js/sn-funnel-chart v1.18.0
3
3
  * Copyright (c) 2026 QlikTech International AB
4
4
  * Released under the MIT license.
5
5
  */
6
6
 
7
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("@nebula.js/stardust")):"function"==typeof define&&define.amd?define(["@nebula.js/stardust"],e):(t="undefined"!=typeof globalThis?globalThis:t||self)["sn-funnel-chart"]=e(t.stardust)}(this,function(t){"use strict";var e={Common_Measures:{id:"Common.Measures",locale:{"de-DE":"Kennzahlen","en-US":"Measures","es-ES":"Medidas","fr-FR":"Mesures","it-IT":"Misure","ja-JP":"メジャー","ko-KR":"측정값","nl-NL":"Metingen","pl-PL":"Miary","pt-BR":"Medidas","ru-RU":"Меры","sv-SE":"Mått","tr-TR":"Hesaplamalar","zh-CN":"度量","zh-TW":"量值"}},Object_ChartTooltip_ColorExpression:{id:"Object.ChartTooltip.ColorExpression",locale:{"de-DE":"Farbformel","en-US":"Color expression","es-ES":"Expresión de color","fr-FR":"Expression de couleur","it-IT":"Espressione colore","ja-JP":"カラー表現","ko-KR":"색상 표현식","nl-NL":"Kleuruitdrukking","pl-PL":"Wyrażenie koloru","pt-BR":"Expressão de cor","ru-RU":"Выражение для цвета","sv-SE":"Färguttryck","tr-TR":"Renk ifadesi","zh-CN":"颜色表达式","zh-TW":"色彩運算式"}},Object_ChartTooltip_NMore:{id:"Object.ChartTooltip.NMore",locale:{"de-DE":"+{0} mehr","en-US":"+{0} more","es-ES":"+{0} más","fr-FR":"+{0} plus","it-IT":"+{0} altre","ja-JP":"さらに +{0}","ko-KR":"{0} 이상","nl-NL":"+{0} meer","pl-PL":"Jeszcze {0}","pt-BR":"+{0} mais","ru-RU":"Еще +{0}","sv-SE":"Fler än {0} ytterligare","tr-TR":"+{0} daha","zh-CN":"+{0} 以上","zh-TW":"其他 +{0} 個"}},Object_ChartTooltip_sumOfNegatives:{id:"Object.ChartTooltip.sumOfNegatives",locale:{"de-DE":"Summe negativer Werte","en-US":"Sum of negatives","es-ES":"Suma de negativos","fr-FR":"Somme des valeurs négatives","it-IT":"Somma valori negativi","ja-JP":"負の合計","ko-KR":"음수 합계","nl-NL":"Som negatieven","pl-PL":"Suma ujemnych","pt-BR":"Soma de negativos","ru-RU":"Сумма отрицательных значений","sv-SE":"Summan av negativa","tr-TR":"Negatif değerlerin toplamı","zh-CN":"负值总和","zh-TW":"負數總和"}},Object_ChartTooltip_sumOfPositives:{id:"Object.ChartTooltip.sumOfPositives",locale:{"de-DE":"Summe positiver Werte","en-US":"Sum of positives","es-ES":"Suma de positivos","fr-FR":"Sommes des valeurs positives","it-IT":"Somma valori positivi","ja-JP":"正の合計","ko-KR":"양수 합계","nl-NL":"Som positieven","pl-PL":"Suma dodatnich","pt-BR":"Soma de positivos","ru-RU":"Сумма положительных значений","sv-SE":"Summan av positiva","tr-TR":"Pozitif değerlerin toplamı","zh-CN":"正值总和","zh-TW":"正數總和"}},Object_Disclaimer_DataRangeIncludingZero:{id:"Object.Disclaimer.DataRangeIncludingZero",locale:{"de-DE":"Die logarithmische Skala wurde durch die lineare Skala ersetzt, weil der Datenbereich NULL enthält.","en-US":"The logarithmic scale has been replaced by a linear scale because the data range includes zero.","es-ES":"La escala logarítmica ha sido reemplazada por una escala lineal porque el rango de datos incluye cero.","fr-FR":"L'échelle logarithmique a été remplacée par une échelle linéaire, car la plage de données comprend la valeur zéro.","it-IT":"La scala logaritmica è stata sostituita da una scala lineare perché l'intervallo di dati include zero.","ja-JP":"データ範囲にゼロが含まれるため、Log スケールは Linear スケールで置換されています。","ko-KR":"데이터 범위에 0이 포함되어 있으므로 로그 눈금이 선형 눈금으로 바뀌었습니다.","nl-NL":"De logaritmische schaal is vervangen door een lineaire schaal omdat het gegevensbereik nullen bevat.","pl-PL":"Skala logarytmiczna została zastąpiona liniową, ponieważ zakres danych zawiera zero.","pt-BR":"A escala logarítmica foi substituída por uma escala linear, pois o intervalo de dados inclui zero.","ru-RU":"Логарифмический масштаб заменен линейным масштабом, поскольку диапазон данных включает ноль.","sv-SE":"Den logaritmiska skalan har ersatts av en linjär skala eftersom dataintervallet innehåller värdet noll.","tr-TR":"Veri aralığı sıfır değerini içerdiğinden, logaritmik ölçek yerine doğrusal ölçek kullanıldı.","zh-CN":"对数刻度已替换为线性刻度,因为该数据范围包括零。","zh-TW":"對數刻度已遭線性刻度取代,因為資料範圍包含零。"}},Object_Disclaimer_LimitedData:{id:"Object.Disclaimer.LimitedData",locale:{"de-DE":"Zurzeit wird nur ein beschränkter Datensatz angezeigt.","en-US":"Currently showing a limited data set.","es-ES":"Mostrando actualmente un conjunto limitado de datos.","fr-FR":"Affichage d'un ensemble de données limité pour l'instant.","it-IT":"Attualmente viene visualizzata una serie di dati limitata.","ja-JP":"現在、限定的なデータ セットを表示しています。","ko-KR":"현재 제한된 데이터 집합을 표시하고 있습니다.","nl-NL":"Momenteel wordt een beperkte gegevensverzameling getoond.","pl-PL":"Aktualnie przedstawiany jest ograniczony zestaw danych.","pt-BR":"Mostrando um conjunto de dados limitado.","ru-RU":"В настоящее время отображается ограниченный набор данных.","sv-SE":"Just nu visas en begränsad datauppsättning.","tr-TR":"Şu anda sınırlı bir veri kümesi gösteriliyor.","zh-CN":"当前正显示有限的数据集。","zh-TW":"目前顯示的是有限的資料集。"}},Object_Disclaimer_NegativeOrZeroValues:{id:"Object.Disclaimer.NegativeOrZeroValues",locale:{"de-DE":"Die in den Datensätzen enthaltenen negativen oder 0-Werte können nicht in diesem Diagramm dargestellt werden.","en-US":"The data set contains negative or zero values that cannot be shown in this chart.","es-ES":"El conjunto de datos contiene valores cero o negativos que no se pueden mostrar en este gráfico.","fr-FR":"L'ensemble de données contient des valeurs négatives ou égales à zéro impossibles à afficher dans ce graphique.","it-IT":"La serie di dati contiene valori negativi o uguali a zero che non possono essere visualizzati in questo grafico.","ja-JP":"データ セットには、本チャートに表示できない負の値またはゼロ値が含まれています。","ko-KR":"데이터 집합에 해당 차트에 표시할 수 없는 음수 값 또는 zero 값이 포함되어 있습니다.","nl-NL":"De gegevensverzameling bevat negatieve waarden of nulwaarden die niet kunnen worden weergegeven in deze diagram.","pl-PL":"Zestaw danych zawiera wartości ujemne lub zerowe, których nie można przedstawić w tym wykresie.","pt-BR":"O conjunto de dados contém valores negativos ou iguais a zero que não podem ser mostrados neste gráfico.","ru-RU":"Набор данных содержит отрицательные или нулевые значения, которые невозможно показать в этой диаграмме.","sv-SE":"Datauppsättningen innehåller negativa värden eller nollvärden som inte kan visas i detta diagram.","tr-TR":"Veri kümesi, bu grafikte gösterilemeyen negatif veya sıfır değerlerini içeriyor.","zh-CN":"数据集中包含无法在此图表中显示的负值或零值。","zh-TW":"資料集包含無法在此圖表中顯示的負值或零值。"}},Object_Disclaimer_NegativeValues:{id:"Object.Disclaimer.NegativeValues",locale:{"de-DE":"Die in den Datensätzen enthaltenen negativen Werte können nicht in diesem Diagramm dargestellt werden.","en-US":"The data set contains negative values that cannot be shown in this chart.","es-ES":"El conjunto de datos contiene valores negativos que no se pueden mostrar en este gráfico.","fr-FR":"Le jeu de données contient des valeurs négatives impossibles à afficher dans ce graphique.","it-IT":"Il set di dati contiene valori negativi che non possono essere visualizzati in questo grafico.","ja-JP":"このチャートには表示できない負の値がデータ セットに含まれています。","ko-KR":"데이터 집합에 해당 차트에 표시할 수 없는 음수 값이 포함되어 있습니다.","nl-NL":"De gegevensverzameling bevat negatieve waarden die niet kunnen worden weergegeven in dit diagram.","pl-PL":"Zestaw danych zawiera wartości ujemne, których nie można przedstawić na tym wykresie.","pt-BR":"O conjunto de dados contém valores negativos que não podem ser mostrados neste gráfico.","ru-RU":"Набор данных содержит отрицательные значения, которые нельзя отобразить на этой диаграмме.","sv-SE":"Datauppsättningen innehåller negativa värden som inte kan visas i det här diagrammet.","tr-TR":"Veri kümesi, bu grafikte gösterilemeyen negatif değerleri içeriyor.","zh-CN":"数据集包含无法在此图表中显示的负值。","zh-TW":"資料集包含無法在此圖表中顯示的負值。"}},Object_Disclaimer_NoDataExist:{id:"Object.Disclaimer.NoDataExist",locale:{"de-DE":"Die Auswahlen haben für dieses Diagramm keine Daten generiert.","en-US":"The selections generated no data for this chart.","es-ES":"Las selecciones no han generado datos para este gráfico.","fr-FR":"Les sélections n'ont pas généré de données pour ce graphique.","it-IT":"Le selezioni non hanno generato dati per questo grafico.","ja-JP":"このチャートには選択からデータが生成されませんでした。","ko-KR":"선택 내용으로 이 차트에 대한 데이터가 생성되지 않았습니다.","nl-NL":"De selecties hebben geen gegevens voor de diagram gegenereerd.","pl-PL":"Wymiary nie spowodowały wygenerowania danych dla tego wykresu.","pt-BR":"As seleções não geraram dados para este gráfico.","ru-RU":"В результате выборок данные для этой диаграммы не созданы.","sv-SE":"Urvalen genererade inga data för detta diagram.","tr-TR":"Seçimler bu grafik için hiç veri oluşturmadı.","zh-CN":"选择未生成此图表的数据。","zh-TW":"此選項無法產生任何適用於此圖表的資料。"}},Object_Disclaimer_OnlyNanColor:{id:"Object.Disclaimer.OnlyNanColor",locale:{"de-DE":"Die verwendeten Daten für die Farbgebung dieser Visualisierung enthalten undefinierte Werte.","en-US":"The data used to color this visualization only contains undefined values.","es-ES":"Los datos utilizados para colorear esta visualización solo contienen valores indefinidos.","fr-FR":"Les données utilisées pour colorer cette visualisation ne comportent que des valeurs non définies.","it-IT":"I dati utilizzati per colorare questa visualizzazione contengono solo valori non definiti.","ja-JP":"このビジュアライゼーションの色の割り当てに使用したデータには、未定義の値が含まれています。","ko-KR":"이 시각화에 색을 지정하는 데 사용된 데이터에는 정의되지 않은 값만 포함되어 있습니다.","nl-NL":"De gegevens die worden gebruikt om deze visualisatie kleur te geven bevatten uitsluitend ongedefinieerde waarden.","pl-PL":"Dane używane do kolorowania tej wizualizacji zawierają wyłącznie niezdefiniowane wartości.","pt-BR":"Os dados usados para colorir esse visualização contém somente valores indefinidos.","ru-RU":"Данные, используемые для выбора цвета визуализации, содержат только неопределенные значения.","sv-SE":"Data som används för att färgsätta denna visualisering innehåller enbart odefinierade värden.","tr-TR":"Bu görselleştirmeyi renklendirmek için kullanılan veriler yalnızca tanımlanmamış değerler içeriyor.","zh-CN":"用于将该可视化着色的数据仅包含未定义的值。","zh-TW":"用以定義此視覺化的色彩的資料只包含未定義的值。"}},Object_Disclaimer_OnlyNanData:{id:"Object.Disclaimer.OnlyNanData",locale:{"de-DE":"Das Diagramm wird nicht angezeigt, da es nur nicht definierte Werte enthält.","en-US":"The chart is not displayed because it contains only undefined values.","es-ES":"El gráfico no se muestra porque solo contiene valores indefinidos.","fr-FR":"Le graphique n'est pas affiché, car il contient uniquement des valeurs non définies.","it-IT":"Il grafico non è visualizzato poiché contiene solo valori non definiti.","ja-JP":"未定義の値しか含まれていないため、チャートは表示されていません。","ko-KR":"정의되지 않은 값만 포함되어 있으므로 차트가 표시되지 않습니다.","nl-NL":"De diagram wordt niet weergegeven omdat deze alleen ongedefinieerde waarden bevat.","pl-PL":"Wykres nie jest wyświetlany, ponieważ zawiera wyłącznie wartości niezdefiniowane.","pt-BR":"O gráfico não foi exibido, porque contém apenas valores não definidos.","ru-RU":"Диаграмма не отображается, поскольку она содержит только неопределенные значения.","sv-SE":"Diagrammet visas inte eftersom det enbart innehåller odefinierade värden.","tr-TR":"Yalnızca tanımsız değerleri içermesi nedeniyle grafik görüntülenmiyor.","zh-CN":"未显示图表,因为它仅包含未定义的值。","zh-TW":"系統不會顯示圖表,因為該圖表僅包含未定義的值。"}},Object_Disclaimer_OnlyNegativeOrZeroValues:{id:"Object.Disclaimer.OnlyNegativeOrZeroValues",locale:{"de-DE":"Das Diagramm wird nicht angezeigt, da es nur negative oder 0-Werte enthält.","en-US":"The chart is not displayed because it contains only negative or zero values.","es-ES":"El gráfico no se muestra porque solo contiene valores negativos o valores cero.","fr-FR":"Le graphique n'est pas affiché, car il contient uniquement des valeurs négatives ou égales à zéro.","it-IT":"Il grafico non viene visualizzato poiché contiene solo valori negativi o uguali a zero.","ja-JP":"チャートは負の値またはゼロ値しか含まれていないため、表示されていません。","ko-KR":"음수 또는 zero 값만 포함되어 있으므로 차트가 표시되지 않습니다.","nl-NL":"De diagram wordt niet weergegeven omdat deze alleen negatieve waarden of nulwaarden bevat.","pl-PL":"Wykres nie jest wyświetlany, ponieważ zawiera wyłącznie wartości ujemne lub zerowe.","pt-BR":"O gráfico não foi exibido, porque contém apenas valores negativos ou zero.","ru-RU":"Диаграмма не отображается, поскольку она содержит только отрицательные или нулевые значения.","sv-SE":"Diagrammet visas inte eftersom det enbart innehåller negativa värden eller nollvärden","tr-TR":"Yalnızca negatif veya sıfır değerlerini içermesi nedeniyle grafik görüntülenmiyor.","zh-CN":"未显示图表,因为它仅包含负值或零值。","zh-TW":"系統不會顯示圖表,因為該圖表僅包含負值或零值。"}},Object_Disclaimer_OnlyNegativeValues:{id:"Object.Disclaimer.OnlyNegativeValues",locale:{"de-DE":"Das Diagramm wird nicht angezeigt, da es nur negative oder Werte enthält.","en-US":"The chart is not displayed because it contains only negative values.","es-ES":"El gráfico no se muestra porque solo contiene valores negativos.","fr-FR":"Le graphique n'est pas affiché, car il contient uniquement des valeurs négatives.","it-IT":"Il grafico non viene visualizzato poiché contiene solo valori negativi.","ja-JP":"負の値しか含まれていないため、チャートは表示されていません。","ko-KR":"음수 값만 포함되어 있으므로 차트가 표시되지 않습니다.","nl-NL":"Het diagram wordt niet weergegeven omdat deze alleen negatieve waarden bevat.","pl-PL":"Wykres nie jest wyświetlany, ponieważ zawiera wyłącznie wartości ujemne.","pt-BR":"O gráfico não é exibido porque contém apenas valores negativos.","ru-RU":"Диаграмма не отображается, поскольку она содержит только отрицательные значения.","sv-SE":"Diagrammet visas inte eftersom det endast innehåller negativa värden.","tr-TR":"Yalnızca negatif değerleri içermesi nedeniyle grafik görüntülenmiyor.","zh-CN":"未显示图表,因为它仅包含负值。","zh-TW":"系統不會顯示圖表,因為該圖表僅包含負值。"}},Object_ErrorMessage_MissingDimension:{id:"Object.ErrorMessage.MissingDimension",locale:{"de-DE":"Dimension nicht gefunden","en-US":"Dimension not found","es-ES":"No se ha encontrado la dimensión","fr-FR":"Dimension introuvable","it-IT":"Dimensione non trovata","ja-JP":"軸が見つかりません","ko-KR":"차원을 찾지 못했습니다.","nl-NL":"Dimensie niet gevonden","pl-PL":"Wymiar nie został znaleziony","pt-BR":"Dimensão não encontrada","ru-RU":"Измерение не найдено","sv-SE":"Dimensionen hittades inte","tr-TR":"Boyut bulunamadı","zh-CN":"未找到维度","zh-TW":"找不到維度"}},Object_ErrorMessage_MissingMeasure:{id:"Object.ErrorMessage.MissingMeasure",locale:{"de-DE":"Kennzahl nicht gefunden","en-US":"Measure not found","es-ES":"No se ha encontrado la medida","fr-FR":"Mesure introuvable","it-IT":"Misura non trovata","ja-JP":"メジャーが見つかりません","ko-KR":"측정값을 찾지 못했습니다.","nl-NL":"Meting niet gevonden","pl-PL":"Miara nie została znaleziona","pt-BR":"Medida não encontrada","ru-RU":"Мера не найдена","sv-SE":"Måttet hittades inte","tr-TR":"Hesaplama bulunamadı","zh-CN":"未找到度量","zh-TW":"找不到量值"}},Tooltip_ToggleOffLassoSelection:{id:"Tooltip.ToggleOffLassoSelection",locale:{"de-DE":"Lasso-Auswahl deaktivieren","en-US":"Turn off lasso selection","es-ES":"Desactivar la selección de contorno","fr-FR":"Désactiver la sélection au lasso","it-IT":"Disattiva selezione lazo","ja-JP":"囲み選択をオフにする","ko-KR":"올가미 선택 끄기","nl-NL":"Lassoselectie uitschakelen","pl-PL":"Wyłącz zaznaczenie lasso","pt-BR":"Desativar seleção de laço","ru-RU":"Выключить выбор лассо","sv-SE":"Stäng av lassourval","tr-TR":"Serbest seçimi kapat","zh-CN":"关闭套索选择方法","zh-TW":"關閉套索選取"}},Tooltip_ToggleOnLassoSelection:{id:"Tooltip.ToggleOnLassoSelection",locale:{"de-DE":"Lasso-Auswahl aktivieren","en-US":"Turn on lasso selection","es-ES":"Activar la selección de contorno","fr-FR":"Activer la sélection au lasso","it-IT":"Attiva selezione lazo","ja-JP":"囲み選択をオンにする","ko-KR":"올가미 선택 켜기","nl-NL":"Lassoselectie inschakelen","pl-PL":"Włącz zaznaczenie lasso","pt-BR":"Ativar seleção de laço","ru-RU":"Включить выбор лассо","sv-SE":"Slå på lassourval","tr-TR":"Serbest seçimi aç","zh-CN":"开启套索选择方法","zh-TW":"開啟套索選取"}},Tooltip_dimensions_cyclic:{id:"Tooltip.dimensions.cyclic",locale:{"de-DE":"Zyklische Dimension","en-US":"Cyclic dimension","es-ES":"Dimensión cíclica","fr-FR":"Dimension cyclique","it-IT":"Dimensione ciclica","ja-JP":"サイクリック軸","ko-KR":"순환 차원","nl-NL":"Cyclische dimensie","pl-PL":"Wymiar cykliczny","pt-BR":"Dimensão cíclica","ru-RU":"Циклическое измерение","sv-SE":"Cyklisk dimension","tr-TR":"Döngüsel boyut","zh-CN":"循环维度","zh-TW":"循環維度"}},Tooltip_dimensions_drilldown:{id:"Tooltip.dimensions.drilldown",locale:{"de-DE":"Drilldown-Dimension","en-US":"Drill-down dimension","es-ES":"Dimensión jerárquica","fr-FR":"Descendre dans la hiérarchie de la dimension","it-IT":"Dimensione di drill-down","ja-JP":"軸のドリルダウン","ko-KR":"드릴다운 차원","nl-NL":"Drill-downdimensie","pl-PL":"Wymiar hierarchiczny","pt-BR":"Dimensão da hierarquia","ru-RU":"Детализированное измерение","sv-SE":"Hierarkisk dimension","tr-TR":"Detaya inme boyutu","zh-CN":"下钻维度","zh-TW":"向下探查維度"}},Tooltip_selections_locked:{id:"Tooltip.selections.locked",locale:{"de-DE":"Auswahlen sind für diese Dimension gesperrt","en-US":"Selections on this dimension are locked","es-ES":"Las selecciones de esta dimensión están bloqueadas.","fr-FR":"Sélections verrouillées pour cette dimension","it-IT":"Le selezioni in questa dimensione sono bloccate","ja-JP":"この軸での選択はロックされています","ko-KR":"이 차원의 선택은 잠겨 있습니다.","nl-NL":"Selecties voor deze dimensie zijn vergrendeld","pl-PL":"Wybory dotyczące tego wymiaru są zablokowane","pt-BR":"Seleções estão bloqueadas nesta dimensão","ru-RU":"Выборки для данного измерения заблокированы","sv-SE":"Urval i den här dimensionen är låsta","tr-TR":"Bu boyuttaki seçimler kilitli","zh-CN":"相关维度的选择已锁定","zh-TW":"已鎖定此維度上的選項"}},Visualizations_Descriptions_Bars:{id:"Visualizations.Descriptions.Bars",locale:{"de-DE":"Balken","en-US":"Bars","es-ES":"Barras","fr-FR":"Barres","it-IT":"Barre","ja-JP":"棒","ko-KR":"막대","nl-NL":"Staven","pl-PL":"Słupki","pt-BR":"Barras","ru-RU":"Полосы","sv-SE":"Staplar","tr-TR":"Çubuklar","zh-CN":"条形","zh-TW":"長條"}},Visualizations_Descriptions_Group:{id:"Visualizations.Descriptions.Group",locale:{"de-DE":"Gruppe","en-US":"Group","es-ES":"Grupo","fr-FR":"Groupe","it-IT":"Gruppo","ja-JP":"グループ","ko-KR":"그룹","nl-NL":"Groep","pl-PL":"Grupa","pt-BR":"Grupo","ru-RU":"Группа","sv-SE":"Grupp","tr-TR":"Grup","zh-CN":"组","zh-TW":"群組"}},Visualizations_Descriptions_HeightLine:{id:"Visualizations.Descriptions.HeightLine",locale:{"de-DE":"Linienhöhe","en-US":"Height of line","es-ES":"Altura de línea","fr-FR":"Hauteur de ligne","it-IT":"Altezza della linea","ja-JP":"線の高さ","ko-KR":"선 높이","nl-NL":"Hoogte van lijn","pl-PL":"Wysokość linii","pt-BR":"Altura da linha","ru-RU":"Высота линии","sv-SE":"Linjens höjd","tr-TR":"Çizgi yüksekliği","zh-CN":"线高度","zh-TW":"折線高度"}},Visualizations_Descriptions_LengthBars:{id:"Visualizations.Descriptions.LengthBars",locale:{"de-DE":"Balkenlänge","en-US":"Length of bars","es-ES":"Longitud de barras","fr-FR":"Longueur des barres","it-IT":"Lunghezza delle barre","ja-JP":"棒の長さ","ko-KR":"막대 길이","nl-NL":"Lengte van staven","pl-PL":"Długość słupków","pt-BR":"Comprimento das barras","ru-RU":"Длина полос","sv-SE":"Staplarnas längd","tr-TR":"Çubuk uzunluğu","zh-CN":"条形长度","zh-TW":"長條長度"}},properties_dataPoints_labelmode_share:{id:"properties.dataPoints.labelmode.share",locale:{"de-DE":"Freigeben","en-US":"Share","es-ES":"Compartir","fr-FR":"Partage","it-IT":"Condividi","ja-JP":"共有","ko-KR":"공유","nl-NL":"Delen","pl-PL":"Udostępnij","pt-BR":"Compartilhar","ru-RU":"Совместное использование","sv-SE":"Dela","tr-TR":"Paylaş","zh-CN":"共享","zh-TW":"共用"}},properties_trendlines_types_average:{id:"properties.trendlines.types.average",locale:{"de-DE":"Durchschnitt","en-US":"Average","es-ES":"Media","fr-FR":"Moyenne","it-IT":"Media","ja-JP":"平均値","ko-KR":"평균","nl-NL":"Gemiddelde","pl-PL":"Średnia","pt-BR":"Média","ru-RU":"Среднее","sv-SE":"Medel","tr-TR":"Ortalama","zh-CN":"平均值","zh-TW":"平均值"}},properties_trendlines_types_exponential:{id:"properties.trendlines.types.exponential",locale:{"de-DE":"Exponentiell","en-US":"Exponential","es-ES":"Exponencial","fr-FR":"Exponentiel","it-IT":"Esponenziale","ja-JP":"指数","ko-KR":"지수","nl-NL":"Exponentieel","pl-PL":"Wykładnicze","pt-BR":"Exponencial","ru-RU":"Экспоненциальный","sv-SE":"Exponentiell","tr-TR":"Üstel","zh-CN":"指数","zh-TW":"指數"}},properties_trendlines_types_linear:{id:"properties.trendlines.types.linear",locale:{"de-DE":"Linear","en-US":"Linear","es-ES":"Lineal","fr-FR":"Linéaire","it-IT":"Lineare","ja-JP":"線形","ko-KR":"선형","nl-NL":"Lineair","pl-PL":"Liniowe","pt-BR":"Linear","ru-RU":"Линейный","sv-SE":"Linjär","tr-TR":"Doğrusal","zh-CN":"线性","zh-TW":"線性"}},properties_trendlines_types_logarithmic:{id:"properties.trendlines.types.logarithmic",locale:{"de-DE":"Logarithmisch","en-US":"Logarithmic","es-ES":"Logarítmica","fr-FR":"Logarithmique","it-IT":"Logaritmica","ja-JP":"対数","ko-KR":"로그","nl-NL":"Logaritmisch","pl-PL":"Logarytmiczne","pt-BR":"Logarítmico","ru-RU":"Логарифмический","sv-SE":"Logaritmisk","tr-TR":"Logaritmik","zh-CN":"对数","zh-TW":"對數"}},properties_trendlines_types_polynomial2:{id:"properties.trendlines.types.polynomial2",locale:{"de-DE":"Polynom zweiten Grades","en-US":"Second degree polynomial","es-ES":"Polinómica de segundo grado","fr-FR":"Polynomial du 2ème degré","it-IT":"Polinomio di secondo grado","ja-JP":"2 番目の角度の多項式近似","ko-KR":"2차 다항식","nl-NL":"Tweedegraadspolynoom","pl-PL":"Wielomianowe drugiego stopnia","pt-BR":"Polinômio de segundo grau","ru-RU":"Полиномиальный второй степени","sv-SE":"Polynomial, andra graden","tr-TR":"İkinci derece polinom","zh-CN":"二次多项式","zh-TW":"第二度多項式"}},properties_trendlines_types_polynomial3:{id:"properties.trendlines.types.polynomial3",locale:{"de-DE":"Polynom dritten Grades","en-US":"Third degree polynomial","es-ES":"Polinómica de tercer grado","fr-FR":"Polynomial du 3ème degré","it-IT":"Polinomio di terzo grado","ja-JP":"3 番目の角度の多項式近似","ko-KR":"3차 다항식","nl-NL":"Derdegraadspolynoom","pl-PL":"Wielomianowe trzeciego stopnia","pt-BR":"Polinômio de terceiro grau","ru-RU":"Полиномиальный третьей степени","sv-SE":"Polynomial, tredje graden","tr-TR":"Üçüncü derece polinom","zh-CN":"三次多项式","zh-TW":"第三度多項式"}},properties_trendlines_types_polynomial4:{id:"properties.trendlines.types.polynomial4",locale:{"de-DE":"Polynom vierten Grades","en-US":"Fourth degree polynomial","es-ES":"Polinómica de cuarto grado","fr-FR":"Polynomial du 4ème degré","it-IT":"Polinomio di quarto grado","ja-JP":"4 番目の角度の多項式近似","ko-KR":"4차 다항식","nl-NL":"Vierdegraadspolynoom","pl-PL":"Wielomianowe czwartego stopnia","pt-BR":"Polinômio de quarto grau","ru-RU":"Полиномиальный четвертой степени","sv-SE":"Polynomial, fjärde graden","tr-TR":"Dördüncü derece polinom","zh-CN":"四次多项式","zh-TW":"第四度多項式"}},properties_trendlines_types_power:{id:"properties.trendlines.types.power",locale:{"de-DE":"Potenz","en-US":"Power","es-ES":"Potencia","fr-FR":"Puissance","it-IT":"Potenza","ja-JP":"累乗","ko-KR":"거듭제곱","nl-NL":"Macht","pl-PL":"Potęgowe","pt-BR":"Potência","ru-RU":"Степенной","sv-SE":"Potens","tr-TR":"Üs","zh-CN":"幂","zh-TW":"乘冪"}}};var n=Object.prototype.hasOwnProperty,i=Object.prototype.toString,r=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=function(t){return"function"==typeof Array.isArray?Array.isArray(t):"[object Array]"===i.call(t)},s=function(t){if(!t||"[object Object]"!==i.call(t))return!1;var e,r=n.call(t,"constructor"),o=t.constructor&&t.constructor.prototype&&n.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!r&&!o)return!1;for(e in t);return void 0===e||n.call(t,e)},l=function(t,e){r&&"__proto__"===e.name?r(t,e.name,{enumerable:!0,configurable:!0,value:e.newValue,writable:!0}):t[e.name]=e.newValue},c=function(t,e){if("__proto__"===e){if(!n.call(t,e))return;if(o)return o(t,e).value}return t[e]},u=function t(){var e,n,i,r,o,u,h=arguments[0],d=1,f=arguments.length,p=!1;for("boolean"==typeof h&&(p=h,h=arguments[1]||{},d=2),(null==h||"object"!=typeof h&&"function"!=typeof h)&&(h={});d<f;++d)if(null!=(e=arguments[d]))for(n in e)i=c(h,n),h!==(r=c(e,n))&&(p&&r&&(s(r)||(o=a(r)))?(o?(o=!1,u=i&&a(i)?i:[]):u=i&&s(i)?i:{},l(h,{name:n,newValue:t(p,u,r)})):void 0!==r&&l(h,{name:n,newValue:r}));return h},h="2.11.5";function d(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}function f(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e);if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function p(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,i)}return n}function g(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?p(Object(n),!0).forEach(function(e){f(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function m(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var i,r,o,a,s=[],l=!0,c=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(i=o.call(n)).done)&&(s.push(i.value),s.length!==e);l=!0);}catch(t){c=!0,r=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return d(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?d(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(t){return!!t.changedTouches}function v(t){return"number"==typeof t&&!isNaN(t)}function x(t){return"number"!=typeof t||isNaN(t)}function b(t){const e=t.length;let n=NaN,i=NaN,r=NaN,o=NaN;for(let a=0;a<e;a++)n=isNaN(n)?t[a].x:Math.min(n,t[a].x),i=isNaN(i)?t[a].x:Math.max(i,t[a].x),r=isNaN(r)?t[a].y:Math.min(r,t[a].y),o=isNaN(o)?t[a].y:Math.max(o,t[a].y);return[n,r,i,o]}function w(t){return[{x:t.x1||0,y:t.y1||0},{x:t.x2||0,y:t.y2||0}]}function k(t){return[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}]}function _(t){const e=m(b(t),4),n=e[0],i=e[1];return{x:n,y:i,width:e[2]-n,height:e[3]-i}}function M(t){return{x1:t[0].x,y1:t[0].y,x2:t[1].x,y2:t[1].y}}function S(t){const e=t||{},n=e.x,i=e.y,r=e.width,o=e.height,a=e.x1,s=e.x2,l=e.y1,c=e.y2,u=e.cx,h=e.cy,d=e.r,f=e.vertices;return v(u)&&v(h)&&v(d)?"circle":v(a)&&v(s)&&v(l)&&v(c)?"line":v(n)&&v(i)&&v(r)&&v(o)?"rect":v(n)&&v(i)?"point":Array.isArray(f)?f.every(t=>Array.isArray(t))?"geopolygon":"polygon":null}function R(t,e){return{x:e.x-t,y:e.y-t,width:e.width+t,height:e.height+t}}function C(t){return function(){return t}}const N=Math.abs,D=Math.atan2,q=Math.cos,E=Math.max,O=Math.min,A=Math.sin,z=Math.sqrt,T=1e-12,I=Math.PI,j=I/2,P=2*I;function F(t){return t>=1?j:t<=-1?-j:Math.asin(t)}const L=Math.PI,$=2*L,B=1e-6,H=$-B;function W(t){this._+=t[0];for(let e=1,n=t.length;e<n;++e)this._+=arguments[e]+t[e]}class V{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==t?W:function(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return W;const n=10**e;return function(t){this._+=t[0];for(let e=1,i=t.length;e<i;++e)this._+=Math.round(arguments[e]*n)/n+t[e]}}(t)}moveTo(t,e){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,e){this._append`L${this._x1=+t},${this._y1=+e}`}quadraticCurveTo(t,e,n,i){this._append`Q${+t},${+e},${this._x1=+n},${this._y1=+i}`}bezierCurveTo(t,e,n,i,r,o){this._append`C${+t},${+e},${+n},${+i},${this._x1=+r},${this._y1=+o}`}arcTo(t,e,n,i,r){if(t=+t,e=+e,n=+n,i=+i,(r=+r)<0)throw new Error(`negative radius: ${r}`);let o=this._x1,a=this._y1,s=n-t,l=i-e,c=o-t,u=a-e,h=c*c+u*u;if(null===this._x1)this._append`M${this._x1=t},${this._y1=e}`;else if(h>B)if(Math.abs(u*s-l*c)>B&&r){let d=n-o,f=i-a,p=s*s+l*l,g=d*d+f*f,m=Math.sqrt(p),y=Math.sqrt(h),v=r*Math.tan((L-Math.acos((p+h-g)/(2*m*y)))/2),x=v/y,b=v/m;Math.abs(x-1)>B&&this._append`L${t+x*c},${e+x*u}`,this._append`A${r},${r},0,0,${+(u*d>c*f)},${this._x1=t+b*s},${this._y1=e+b*l}`}else this._append`L${this._x1=t},${this._y1=e}`;else;}arc(t,e,n,i,r,o){if(t=+t,e=+e,o=!!o,(n=+n)<0)throw new Error(`negative radius: ${n}`);let a=n*Math.cos(i),s=n*Math.sin(i),l=t+a,c=e+s,u=1^o,h=o?i-r:r-i;null===this._x1?this._append`M${l},${c}`:(Math.abs(this._x1-l)>B||Math.abs(this._y1-c)>B)&&this._append`L${l},${c}`,n&&(h<0&&(h=h%$+$),h>H?this._append`A${n},${n},0,1,${u},${t-a},${e-s}A${n},${n},0,1,${u},${this._x1=l},${this._y1=c}`:h>B&&this._append`A${n},${n},0,${+(h>=L)},${u},${this._x1=t+n*Math.cos(r)},${this._y1=e+n*Math.sin(r)}`)}rect(t,e,n,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}}function U(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(null==n)e=null;else{const t=Math.floor(n);if(!(t>=0))throw new RangeError(`invalid digits: ${n}`);e=t}return t},()=>new V(e)}function Y(t){return t.innerRadius}function K(t){return t.outerRadius}function G(t){return t.startAngle}function X(t){return t.endAngle}function J(t){return t&&t.padAngle}function Z(t,e,n,i,r,o,a){var s=t-n,l=e-i,c=(a?o:-o)/z(s*s+l*l),u=c*l,h=-c*s,d=t+u,f=e+h,p=n+u,g=i+h,m=(d+p)/2,y=(f+g)/2,v=p-d,x=g-f,b=v*v+x*x,w=r-o,k=d*g-p*f,_=(x<0?-1:1)*z(E(0,w*w*b-k*k)),M=(k*x-v*_)/b,S=(-k*v-x*_)/b,R=(k*x+v*_)/b,C=(-k*v+x*_)/b,N=M-m,D=S-y,q=R-m,O=C-y;return N*N+D*D>q*q+O*O&&(M=R,S=C),{cx:M,cy:S,x01:-u,y01:-h,x11:M*(r/w-1),y11:S*(r/w-1)}}function Q(){var t=Y,e=K,n=C(0),i=null,r=G,o=X,a=J,s=null,l=U(c);function c(){var c,u,h=+t.apply(this,arguments),d=+e.apply(this,arguments),f=r.apply(this,arguments)-j,p=o.apply(this,arguments)-j,g=N(p-f),m=p>f;if(s||(s=c=l()),d<h&&(u=d,d=h,h=u),d>T)if(g>P-T)s.moveTo(d*q(f),d*A(f)),s.arc(0,0,d,f,p,!m),h>T&&(s.moveTo(h*q(p),h*A(p)),s.arc(0,0,h,p,f,m));else{var y,v,x=f,b=p,w=f,k=p,_=g,M=g,S=a.apply(this,arguments)/2,R=S>T&&(i?+i.apply(this,arguments):z(h*h+d*d)),C=O(N(d-h)/2,+n.apply(this,arguments)),E=C,L=C;if(R>T){var $=F(R/h*A(S)),B=F(R/d*A(S));(_-=2*$)>T?(w+=$*=m?1:-1,k-=$):(_=0,w=k=(f+p)/2),(M-=2*B)>T?(x+=B*=m?1:-1,b-=B):(M=0,x=b=(f+p)/2)}var H=d*q(x),W=d*A(x),V=h*q(k),U=h*A(k);if(C>T){var Y,K=d*q(b),G=d*A(b),X=h*q(w),J=h*A(w);if(g<I)if(Y=function(t,e,n,i,r,o,a,s){var l=n-t,c=i-e,u=a-r,h=s-o,d=h*l-u*c;if(!(d*d<T))return[t+(d=(u*(e-o)-h*(t-r))/d)*l,e+d*c]}(H,W,X,J,K,G,V,U)){var Q=H-Y[0],tt=W-Y[1],et=K-Y[0],nt=G-Y[1],it=1/A(function(t){return t>1?0:t<-1?I:Math.acos(t)}((Q*et+tt*nt)/(z(Q*Q+tt*tt)*z(et*et+nt*nt)))/2),rt=z(Y[0]*Y[0]+Y[1]*Y[1]);E=O(C,(h-rt)/(it-1)),L=O(C,(d-rt)/(it+1))}else E=L=0}M>T?L>T?(y=Z(X,J,H,W,d,L,m),v=Z(K,G,V,U,d,L,m),s.moveTo(y.cx+y.x01,y.cy+y.y01),L<C?s.arc(y.cx,y.cy,L,D(y.y01,y.x01),D(v.y01,v.x01),!m):(s.arc(y.cx,y.cy,L,D(y.y01,y.x01),D(y.y11,y.x11),!m),s.arc(0,0,d,D(y.cy+y.y11,y.cx+y.x11),D(v.cy+v.y11,v.cx+v.x11),!m),s.arc(v.cx,v.cy,L,D(v.y11,v.x11),D(v.y01,v.x01),!m))):(s.moveTo(H,W),s.arc(0,0,d,x,b,!m)):s.moveTo(H,W),h>T&&_>T?E>T?(y=Z(V,U,K,G,h,-E,m),v=Z(H,W,X,J,h,-E,m),s.lineTo(y.cx+y.x01,y.cy+y.y01),E<C?s.arc(y.cx,y.cy,E,D(y.y01,y.x01),D(v.y01,v.x01),!m):(s.arc(y.cx,y.cy,E,D(y.y01,y.x01),D(y.y11,y.x11),!m),s.arc(0,0,h,D(y.cy+y.y11,y.cx+y.x11),D(v.cy+v.y11,v.cx+v.x11),m),s.arc(v.cx,v.cy,E,D(v.y11,v.x11),D(v.y01,v.x01),!m))):s.arc(0,0,h,k,w,m):s.lineTo(V,U)}else s.moveTo(0,0);if(s.closePath(),c)return s=null,c+""||null}return c.centroid=function(){var n=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,i=(+r.apply(this,arguments)+ +o.apply(this,arguments))/2-I/2;return[q(i)*n,A(i)*n]},c.innerRadius=function(e){return arguments.length?(t="function"==typeof e?e:C(+e),c):t},c.outerRadius=function(t){return arguments.length?(e="function"==typeof t?t:C(+t),c):e},c.cornerRadius=function(t){return arguments.length?(n="function"==typeof t?t:C(+t),c):n},c.padRadius=function(t){return arguments.length?(i=null==t?null:"function"==typeof t?t:C(+t),c):i},c.startAngle=function(t){return arguments.length?(r="function"==typeof t?t:C(+t),c):r},c.endAngle=function(t){return arguments.length?(o="function"==typeof t?t:C(+t),c):o},c.padAngle=function(t){return arguments.length?(a="function"==typeof t?t:C(+t),c):a},c.context=function(t){return arguments.length?(s=null==t?null:t,c):s},c}function tt(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function et(t){this._context=t}function nt(t){return new et(t)}function it(t){return t[0]}function rt(t){return t[1]}function ot(t,e,n){var i=null,r=C(!0),o=null,a=nt,s=null,l=U(c);function c(c){var u,h,d,f,p,g=(c=tt(c)).length,m=!1,y=new Array(g),v=new Array(g);for(null==o&&(s=a(p=l())),u=0;u<=g;++u){if(!(u<g&&r(f=c[u],u,c))===m)if(m=!m)h=u,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),d=u-1;d>=h;--d)s.point(y[d],v[d]);s.lineEnd(),s.areaEnd()}m&&(y[u]=+t(f,u,c),v[u]=+e(f,u,c),s.point(i?+i(f,u,c):y[u],n?+n(f,u,c):v[u]))}if(p)return s=null,p+""||null}function u(){return function(t,e){var n=C(!0),i=null,r=nt,o=null,a=U(s);function s(s){var l,c,u,h=(s=tt(s)).length,d=!1;for(null==i&&(o=r(u=a())),l=0;l<=h;++l)!(l<h&&n(c=s[l],l,s))===d&&((d=!d)?o.lineStart():o.lineEnd()),d&&o.point(+t(c,l,s),+e(c,l,s));if(u)return o=null,u+""||null}return t="function"==typeof t?t:void 0===t?it:C(t),e="function"==typeof e?e:void 0===e?rt:C(e),s.x=function(e){return arguments.length?(t="function"==typeof e?e:C(+e),s):t},s.y=function(t){return arguments.length?(e="function"==typeof t?t:C(+t),s):e},s.defined=function(t){return arguments.length?(n="function"==typeof t?t:C(!!t),s):n},s.curve=function(t){return arguments.length?(r=t,null!=i&&(o=r(i)),s):r},s.context=function(t){return arguments.length?(null==t?i=o=null:o=r(i=t),s):i},s}().defined(r).curve(a).context(o)}return t="function"==typeof t?t:void 0===t?it:C(+t),e="function"==typeof e?e:C(void 0===e?0:+e),n="function"==typeof n?n:void 0===n?rt:C(+n),c.x=function(e){return arguments.length?(t="function"==typeof e?e:C(+e),i=null,c):t},c.x0=function(e){return arguments.length?(t="function"==typeof e?e:C(+e),c):t},c.x1=function(t){return arguments.length?(i=null==t?null:"function"==typeof t?t:C(+t),c):i},c.y=function(t){return arguments.length?(e="function"==typeof t?t:C(+t),n=null,c):e},c.y0=function(t){return arguments.length?(e="function"==typeof t?t:C(+t),c):e},c.y1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:C(+t),c):n},c.lineX0=c.lineY0=function(){return u().x(t).y(e)},c.lineY1=function(){return u().x(t).y(n)},c.lineX1=function(){return u().x(i).y(e)},c.defined=function(t){return arguments.length?(r="function"==typeof t?t:C(!!t),c):r},c.curve=function(t){return arguments.length?(a=t,null!=o&&(s=a(o)),c):a},c.context=function(t){return arguments.length?(null==t?o=s=null:s=a(o=t),c):o},c}function at(t,e){return e<t?-1:e>t?1:e>=t?0:NaN}function st(t){return t}function lt(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function ct(t){this._context=t}function ut(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function ht(t,e){this._context=t,this._k=(1-e)/6}et.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}},ct.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:lt(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:lt(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},ht.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:ut(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:ut(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var dt=function t(e){function n(t){return new ht(t,e)}return n.tension=function(e){return t(+e)},n}(0);function ft(t,e){this._context=t,this._alpha=e}ft.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:!function(t,e,n){var i=t._x1,r=t._y1,o=t._x2,a=t._y2;if(t._l01_a>T){var s=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,l=3*t._l01_a*(t._l01_a+t._l12_a);i=(i*s-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,r=(r*s-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>T){var c=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,u=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*c+t._x1*t._l23_2a-e*t._l12_2a)/u,a=(a*c+t._y1*t._l23_2a-n*t._l12_2a)/u}t._context.bezierCurveTo(i,r,o,a,t._x2,t._y2)}(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var pt=function t(e){function n(t){return e?new ft(t,e):new ht(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function gt(t){return t<0?-1:1}function mt(t,e,n){var i=t._x1-t._x0,r=e-t._x1,o=(t._y1-t._y0)/(i||r<0&&-0),a=(n-t._y1)/(r||i<0&&-0),s=(o*r+a*i)/(i+r);return(gt(o)+gt(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function yt(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function vt(t,e,n){var i=t._x0,r=t._y0,o=t._x1,a=t._y1,s=(o-i)/3;t._context.bezierCurveTo(i+s,r+s*e,o-s,a-s*n,o,a)}function xt(t){this._context=t}function bt(t){this._context=new wt(t)}function wt(t){this._context=t}function kt(t){this._context=t}function _t(t){var e,n,i=t.length-1,r=new Array(i),o=new Array(i),a=new Array(i);for(r[0]=0,o[0]=2,a[0]=t[0]+2*t[1],e=1;e<i-1;++e)r[e]=1,o[e]=4,a[e]=4*t[e]+2*t[e+1];for(r[i-1]=2,o[i-1]=7,a[i-1]=8*t[i-1]+t[i],e=1;e<i;++e)n=r[e]/o[e-1],o[e]-=n,a[e]-=n*a[e-1];for(r[i-1]=a[i-1]/o[i-1],e=i-2;e>=0;--e)r[e]=(a[e]-r[e+1])/o[e];for(o[i-1]=(t[i]+r[i-1])/2,e=0;e<i-1;++e)o[e]=2*t[e+1]-r[e+1];return[r,o]}function Mt(t,e){this._context=t,this._t=e}function St(t,e){if((r=t.length)>1)for(var n,i,r,o=1,a=t[e[0]],s=a.length;o<r;++o)for(i=a,a=t[e[o]],n=0;n<s;++n)a[n][1]+=a[n][0]=isNaN(i[n][1])?i[n][0]:i[n][1]}function Rt(t){for(var e=t.length,n=new Array(e);--e>=0;)n[e]=e;return n}function Ct(t,e){return t[e]}function Nt(t){const e=[];return e.key=t,e}function Dt(t){for(var e,n=-1,i=0,r=t.length,o=-1/0;++n<r;)(e=+t[n][1])>o&&(o=e,i=n);return i}function qt(t){for(var e,n=0,i=-1,r=t.length;++i<r;)(e=+t[i][1])&&(n+=e);return n}function Et(t){let e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"unspecified",i=arguments.length>2?arguments[2]:void 0;const r={},o=t||{get:()=>{},has:()=>!1,default:()=>{}};function a(t,e){if(!t||"string"!=typeof t)throw new TypeError("Invalid argument: key must be a non-empty string");return!(t in r)&&(r[t]=e,!0)}function s(t){return r[t]||o.get(t)}function l(t,r){if(void 0!==r)return a(t,r);const o=s(t);return i&&void 0===o&&i.warn("".concat(t," does not exist in ").concat(n," registry")),o||s(e)}return e=o.default(),l.add=a,l.get=s,l.has=function(t){return!!r[t]||o.has(t)},l.remove=function(t){const e=r[t];return delete r[t],e},l.getKeys=function(){return Object.keys(r)},l.getValues=function(){return Object.keys(r).map(t=>r[t])},l.default=function(t){return void 0!==t&&(e=t),e},l.register=a,l}function Ot(t,e){if(!isFinite(t)||0===t)return null;var n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"),i=t.slice(0,n);return[i.length>1?i[0]+i.slice(2):i,+t.slice(n+1)]}function At(t){return(t=Ot(Math.abs(t)))?t[1]:NaN}xt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:vt(this,this._t0,yt(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(e=+e,(t=+t)!==this._x1||e!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,vt(this,yt(this,n=mt(this,t,e)),n);break;default:vt(this,this._t0,n=mt(this,t,e))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}},(bt.prototype=Object.create(xt.prototype)).point=function(t,e){xt.prototype.point.call(this,e,t)},wt.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,i,r,o){this._context.bezierCurveTo(e,t,i,n,o,r)}},kt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,n=t.length;if(n)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),2===n)this._context.lineTo(t[1],e[1]);else for(var i=_t(t),r=_t(e),o=0,a=1;a<n;++o,++a)this._context.bezierCurveTo(i[0][o],r[0][o],i[1][o],r[1][o],t[a],e[a]);(this._line||0!==this._line&&1===n)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,e){this._x.push(+t),this._y.push(+e)}},Mt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}}this._x=t,this._y=e}};var zt,Tt=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function It(t){if(!(e=Tt.exec(t)))throw new Error("invalid format: "+t);var e;return new jt({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function jt(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function Pt(t,e){var n=Ot(t,e);if(!n)return t+"";var i=n[0],r=n[1];return r<0?"0."+new Array(-r).join("0")+i:i.length>r+1?i.slice(0,r+1)+"."+i.slice(r+1):i+new Array(r-i.length+2).join("0")}It.prototype=jt.prototype,jt.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var Ft={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>Pt(100*t,e),r:Pt,s:function(t,e){var n=Ot(t,e);if(!n)return zt=void 0,t.toPrecision(e);var i=n[0],r=n[1],o=r-(zt=3*Math.max(-8,Math.min(8,Math.floor(r/3))))+1,a=i.length;return o===a?i:o>a?i+new Array(o-a+1).join("0"):o>0?i.slice(0,o)+"."+i.slice(o):"0."+new Array(1-o).join("0")+Ot(t,Math.max(0,e+o-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function Lt(t){return t}var $t,Bt,Ht,Wt=Array.prototype.map,Vt=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Ut(t){var e,n,i=void 0===t.grouping||void 0===t.thousands?Lt:(e=Wt.call(t.grouping,Number),n=t.thousands+"",function(t,i){for(var r=t.length,o=[],a=0,s=e[0],l=0;r>0&&s>0&&(l+s+1>i&&(s=Math.max(1,i-l)),o.push(t.substring(r-=s,r+s)),!((l+=s+1)>i));)s=e[a=(a+1)%e.length];return o.reverse().join(n)}),r=void 0===t.currency?"":t.currency[0]+"",o=void 0===t.currency?"":t.currency[1]+"",a=void 0===t.decimal?".":t.decimal+"",s=void 0===t.numerals?Lt:function(t){return function(e){return e.replace(/[0-9]/g,function(e){return t[+e]})}}(Wt.call(t.numerals,String)),l=void 0===t.percent?"%":t.percent+"",c=void 0===t.minus?"−":t.minus+"",u=void 0===t.nan?"NaN":t.nan+"";function h(t,e){var n=(t=It(t)).fill,h=t.align,d=t.sign,f=t.symbol,p=t.zero,g=t.width,m=t.comma,y=t.precision,v=t.trim,x=t.type;"n"===x?(m=!0,x="g"):Ft[x]||(void 0===y&&(y=12),v=!0,x="g"),(p||"0"===n&&"="===h)&&(p=!0,n="0",h="=");var b=(e&&void 0!==e.prefix?e.prefix:"")+("$"===f?r:"#"===f&&/[boxX]/.test(x)?"0"+x.toLowerCase():""),w=("$"===f?o:/[%p]/.test(x)?l:"")+(e&&void 0!==e.suffix?e.suffix:""),k=Ft[x],_=/[defgprs%]/.test(x);function M(t){var e,r,o,l=b,f=w;if("c"===x)f=k(t)+f,t="";else{var M=(t=+t)<0||1/t<0;if(t=isNaN(t)?u:k(Math.abs(t),y),v&&(t=function(t){t:for(var e,n=t.length,i=1,r=-1;i<n;++i)switch(t[i]){case".":r=e=i;break;case"0":0===r&&(r=i),e=i;break;default:if(!+t[i])break t;r>0&&(r=0)}return r>0?t.slice(0,r)+t.slice(e+1):t}(t)),M&&0===+t&&"+"!==d&&(M=!1),l=(M?"("===d?d:c:"-"===d||"("===d?"":d)+l,f=("s"!==x||isNaN(t)||void 0===zt?"":Vt[8+zt/3])+f+(M&&"("===d?")":""),_)for(e=-1,r=t.length;++e<r;)if(48>(o=t.charCodeAt(e))||o>57){f=(46===o?a+t.slice(e+1):t.slice(e))+f,t=t.slice(0,e);break}}m&&!p&&(t=i(t,1/0));var S=l.length+t.length+f.length,R=S<g?new Array(g-S+1).join(n):"";switch(m&&p&&(t=i(R+t,R.length?g-f.length:1/0),R=""),h){case"<":t=l+t+f+R;break;case"=":t=l+R+t+f;break;case"^":t=R.slice(0,S=R.length>>1)+l+t+f+R.slice(S);break;default:t=R+l+t+f}return s(t)}return y=void 0===y?6:/[gprs]/.test(x)?Math.max(1,Math.min(21,y)):Math.max(0,Math.min(20,y)),M.toString=function(){return t+""},M}return{format:h,formatPrefix:function(t,e){var n=3*Math.max(-8,Math.min(8,Math.floor(At(e)/3))),i=Math.pow(10,-n),r=h(((t=It(t)).type="f",t),{suffix:Vt[8+n/3]});return function(t){return r(i*t)}}}}!function(t){$t=Ut(t),Bt=$t.format,Ht=$t.formatPrefix}({thousands:",",grouping:[3],currency:["$",""]});const Yt=new Date,Kt=new Date;function Gt(t,e,n,i){function r(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return r.floor=e=>(t(e=new Date(+e)),e),r.ceil=n=>(t(n=new Date(n-1)),e(n,1),t(n),n),r.round=t=>{const e=r(t),n=r.ceil(t);return t-e<n-t?e:n},r.offset=(t,n)=>(e(t=new Date(+t),null==n?1:Math.floor(n)),t),r.range=(n,i,o)=>{const a=[];if(n=r.ceil(n),o=null==o?1:Math.floor(o),!(n<i&&o>0))return a;let s;do{a.push(s=new Date(+n)),e(n,o),t(n)}while(s<n&&n<i);return a},r.filter=n=>Gt(e=>{if(e>=e)for(;t(e),!n(e);)e.setTime(e-1)},(t,i)=>{if(t>=t)if(i<0)for(;++i<=0;)for(;e(t,-1),!n(t););else for(;--i>=0;)for(;e(t,1),!n(t););}),n&&(r.count=(e,i)=>(Yt.setTime(+e),Kt.setTime(+i),t(Yt),t(Kt),Math.floor(n(Yt,Kt))),r.every=t=>(t=Math.floor(t),isFinite(t)&&t>0?t>1?r.filter(i?e=>i(e)%t===0:e=>r.count(0,e)%t===0):r:null)),r}const Xt=6e4,Jt=864e5,Zt=6048e5,Qt=Gt(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*Xt)/Jt,t=>t.getDate()-1);Qt.range;const te=Gt(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/Jt,t=>t.getUTCDate()-1);te.range;const ee=Gt(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/Jt,t=>Math.floor(t/Jt));function ne(t){return Gt(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(t,e)=>{t.setDate(t.getDate()+7*e)},(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*Xt)/Zt)}ee.range;const ie=ne(0),re=ne(1),oe=ne(2),ae=ne(3),se=ne(4),le=ne(5),ce=ne(6);function ue(t){return Gt(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+7*e)},(t,e)=>(e-t)/Zt)}ie.range,re.range,oe.range,ae.range,se.range,le.range,ce.range;const he=ue(0),de=ue(1),fe=ue(2),pe=ue(3),ge=ue(4),me=ue(5),ye=ue(6);he.range,de.range,fe.range,pe.range,ge.range,me.range,ye.range;const ve=Gt(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());ve.every=t=>isFinite(t=Math.floor(t))&&t>0?Gt(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n*t)}):null,ve.range;const xe=Gt(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());function be(t,e){return null==t||null==e?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function we(t,e){return null==t||null==e?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function ke(t){let e,n,i;function r(t,i,r=0,o=t.length){if(r<o){if(0!==e(i,i))return o;do{const e=r+o>>>1;n(t[e],i)<0?r=e+1:o=e}while(r<o)}return r}return 2!==t.length?(e=be,n=(e,n)=>be(t(e),n),i=(e,n)=>t(e)-n):(e=t===be||t===we?t:_e,n=t,i=t),{left:r,center:function(t,e,n=0,o=t.length){const a=r(t,e,n,o-1);return a>n&&i(t[a-1],e)>-i(t[a],e)?a-1:a},right:function(t,i,r=0,o=t.length){if(r<o){if(0!==e(i,i))return o;do{const e=r+o>>>1;n(t[e],i)<=0?r=e+1:o=e}while(r<o)}return r}}}function _e(){return 0}xe.every=t=>isFinite(t=Math.floor(t))&&t>0?Gt(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)}):null,xe.range;const Me=ke(be).right;ke(function(t){return null===t?NaN:+t}).center;var Se=Me;class Re extends Map{constructor(t,e=Ne){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),null!=t)for(const[e,n]of t)this.set(e,n)}get(t){return super.get(Ce(this,t))}has(t){return super.has(Ce(this,t))}set(t,e){return super.set(function({_intern:t,_key:e},n){const i=e(n);return t.has(i)?t.get(i):(t.set(i,n),n)}(this,t),e)}delete(t){return super.delete(function({_intern:t,_key:e},n){const i=e(n);t.has(i)&&(n=t.get(i),t.delete(i));return n}(this,t))}}function Ce({_intern:t,_key:e},n){const i=e(n);return t.has(i)?t.get(i):n}function Ne(t){return null!==t&&"object"==typeof t?t.valueOf():t}const De=Math.sqrt(50),qe=Math.sqrt(10),Ee=Math.sqrt(2);function Oe(t,e,n){const i=(e-t)/Math.max(0,n),r=Math.floor(Math.log10(i)),o=i/Math.pow(10,r),a=o>=De?10:o>=qe?5:o>=Ee?2:1;let s,l,c;return r<0?(c=Math.pow(10,-r)/a,s=Math.round(t*c),l=Math.round(e*c),s/c<t&&++s,l/c>e&&--l,c=-c):(c=Math.pow(10,r)*a,s=Math.round(t/c),l=Math.round(e/c),s*c<t&&++s,l*c>e&&--l),l<s&&.5<=n&&n<2?Oe(t,e,2*n):[s,l,c]}function Ae(t,e,n){return Oe(t=+t,e=+e,n=+n)[2]}function ze(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function Te(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function Ie(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}function je(t){var e=t.dateTime,n=t.date,i=t.time,r=t.periods,o=t.days,a=t.shortDays,s=t.months,l=t.shortMonths,c=We(r),u=Ve(r),h=We(o),d=Ve(o),f=We(a),p=Ve(a),g=We(s),m=Ve(s),y=We(l),v=Ve(l),x={a:function(t){return a[t.getDay()]},A:function(t){return o[t.getDay()]},b:function(t){return l[t.getMonth()]},B:function(t){return s[t.getMonth()]},c:null,d:fn,e:fn,f:vn,g:Dn,G:En,H:pn,I:gn,j:mn,L:yn,m:xn,M:bn,p:function(t){return r[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:ti,s:ei,S:wn,u:kn,U:_n,V:Sn,w:Rn,W:Cn,x:null,X:null,y:Nn,Y:qn,Z:On,"%":Qn},b={a:function(t){return a[t.getUTCDay()]},A:function(t){return o[t.getUTCDay()]},b:function(t){return l[t.getUTCMonth()]},B:function(t){return s[t.getUTCMonth()]},c:null,d:An,e:An,f:Pn,g:Gn,G:Jn,H:zn,I:Tn,j:In,L:jn,m:Fn,M:Ln,p:function(t){return r[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:ti,s:ei,S:$n,u:Bn,U:Hn,V:Vn,w:Un,W:Yn,x:null,X:null,y:Kn,Y:Xn,Z:Zn,"%":Qn},w={a:function(t,e,n){var i=f.exec(e.slice(n));return i?(t.w=p.get(i[0].toLowerCase()),n+i[0].length):-1},A:function(t,e,n){var i=h.exec(e.slice(n));return i?(t.w=d.get(i[0].toLowerCase()),n+i[0].length):-1},b:function(t,e,n){var i=y.exec(e.slice(n));return i?(t.m=v.get(i[0].toLowerCase()),n+i[0].length):-1},B:function(t,e,n){var i=g.exec(e.slice(n));return i?(t.m=m.get(i[0].toLowerCase()),n+i[0].length):-1},c:function(t,n,i){return M(t,e,n,i)},d:nn,e:nn,f:cn,g:Ze,G:Je,H:on,I:on,j:rn,L:ln,m:en,M:an,p:function(t,e,n){var i=c.exec(e.slice(n));return i?(t.p=u.get(i[0].toLowerCase()),n+i[0].length):-1},q:tn,Q:hn,s:dn,S:sn,u:Ye,U:Ke,V:Ge,w:Ue,W:Xe,x:function(t,e,i){return M(t,n,e,i)},X:function(t,e,n){return M(t,i,e,n)},y:Ze,Y:Je,Z:Qe,"%":un};function k(t,e){return function(n){var i,r,o,a=[],s=-1,l=0,c=t.length;for(n instanceof Date||(n=new Date(+n));++s<c;)37===t.charCodeAt(s)&&(a.push(t.slice(l,s)),null!=(r=Pe[i=t.charAt(++s)])?i=t.charAt(++s):r="e"===i?" ":"0",(o=e[i])&&(i=o(n,r)),a.push(i),l=s+1);return a.push(t.slice(l,s)),a.join("")}}function _(t,e){return function(n){var i,r,o=Ie(1900,void 0,1);if(M(o,t,n+="",0)!=n.length)return null;if("Q"in o)return new Date(o.Q);if("s"in o)return new Date(1e3*o.s+("L"in o?o.L:0));if(e&&!("Z"in o)&&(o.Z=0),"p"in o&&(o.H=o.H%12+12*o.p),void 0===o.m&&(o.m="q"in o?o.q:0),"V"in o){if(o.V<1||o.V>53)return null;"w"in o||(o.w=1),"Z"in o?(r=(i=Te(Ie(o.y,0,1))).getUTCDay(),i=r>4||0===r?de.ceil(i):de(i),i=te.offset(i,7*(o.V-1)),o.y=i.getUTCFullYear(),o.m=i.getUTCMonth(),o.d=i.getUTCDate()+(o.w+6)%7):(r=(i=ze(Ie(o.y,0,1))).getDay(),i=r>4||0===r?re.ceil(i):re(i),i=Qt.offset(i,7*(o.V-1)),o.y=i.getFullYear(),o.m=i.getMonth(),o.d=i.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),r="Z"in o?Te(Ie(o.y,0,1)).getUTCDay():ze(Ie(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(r+5)%7:o.w+7*o.U-(r+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,Te(o)):ze(o)}}function M(t,e,n,i){for(var r,o,a=0,s=e.length,l=n.length;a<s;){if(i>=l)return-1;if(37===(r=e.charCodeAt(a++))){if(r=e.charAt(a++),!(o=w[r in Pe?e.charAt(a++):r])||(i=o(t,n,i))<0)return-1}else if(r!=n.charCodeAt(i++))return-1}return i}return x.x=k(n,x),x.X=k(i,x),x.c=k(e,x),b.x=k(n,b),b.X=k(i,b),b.c=k(e,b),{format:function(t){var e=k(t+="",x);return e.toString=function(){return t},e},parse:function(t){var e=_(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=k(t+="",b);return e.toString=function(){return t},e},utcParse:function(t){var e=_(t+="",!0);return e.toString=function(){return t},e}}}var Pe={"-":"",_:" ",0:"0"},Fe=/^\s*\d+/,Le=/^%/,$e=/[\\^$*+?|[\]().{}]/g;function Be(t,e,n){var i=t<0?"-":"",r=(i?-t:t)+"",o=r.length;return i+(o<n?new Array(n-o+1).join(e)+r:r)}function He(t){return t.replace($e,"\\$&")}function We(t){return new RegExp("^(?:"+t.map(He).join("|")+")","i")}function Ve(t){return new Map(t.map((t,e)=>[t.toLowerCase(),e]))}function Ue(t,e,n){var i=Fe.exec(e.slice(n,n+1));return i?(t.w=+i[0],n+i[0].length):-1}function Ye(t,e,n){var i=Fe.exec(e.slice(n,n+1));return i?(t.u=+i[0],n+i[0].length):-1}function Ke(t,e,n){var i=Fe.exec(e.slice(n,n+2));return i?(t.U=+i[0],n+i[0].length):-1}function Ge(t,e,n){var i=Fe.exec(e.slice(n,n+2));return i?(t.V=+i[0],n+i[0].length):-1}function Xe(t,e,n){var i=Fe.exec(e.slice(n,n+2));return i?(t.W=+i[0],n+i[0].length):-1}function Je(t,e,n){var i=Fe.exec(e.slice(n,n+4));return i?(t.y=+i[0],n+i[0].length):-1}function Ze(t,e,n){var i=Fe.exec(e.slice(n,n+2));return i?(t.y=+i[0]+(+i[0]>68?1900:2e3),n+i[0].length):-1}function Qe(t,e,n){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return i?(t.Z=i[1]?0:-(i[2]+(i[3]||"00")),n+i[0].length):-1}function tn(t,e,n){var i=Fe.exec(e.slice(n,n+1));return i?(t.q=3*i[0]-3,n+i[0].length):-1}function en(t,e,n){var i=Fe.exec(e.slice(n,n+2));return i?(t.m=i[0]-1,n+i[0].length):-1}function nn(t,e,n){var i=Fe.exec(e.slice(n,n+2));return i?(t.d=+i[0],n+i[0].length):-1}function rn(t,e,n){var i=Fe.exec(e.slice(n,n+3));return i?(t.m=0,t.d=+i[0],n+i[0].length):-1}function on(t,e,n){var i=Fe.exec(e.slice(n,n+2));return i?(t.H=+i[0],n+i[0].length):-1}function an(t,e,n){var i=Fe.exec(e.slice(n,n+2));return i?(t.M=+i[0],n+i[0].length):-1}function sn(t,e,n){var i=Fe.exec(e.slice(n,n+2));return i?(t.S=+i[0],n+i[0].length):-1}function ln(t,e,n){var i=Fe.exec(e.slice(n,n+3));return i?(t.L=+i[0],n+i[0].length):-1}function cn(t,e,n){var i=Fe.exec(e.slice(n,n+6));return i?(t.L=Math.floor(i[0]/1e3),n+i[0].length):-1}function un(t,e,n){var i=Le.exec(e.slice(n,n+1));return i?n+i[0].length:-1}function hn(t,e,n){var i=Fe.exec(e.slice(n));return i?(t.Q=+i[0],n+i[0].length):-1}function dn(t,e,n){var i=Fe.exec(e.slice(n));return i?(t.s=+i[0],n+i[0].length):-1}function fn(t,e){return Be(t.getDate(),e,2)}function pn(t,e){return Be(t.getHours(),e,2)}function gn(t,e){return Be(t.getHours()%12||12,e,2)}function mn(t,e){return Be(1+Qt.count(ve(t),t),e,3)}function yn(t,e){return Be(t.getMilliseconds(),e,3)}function vn(t,e){return yn(t,e)+"000"}function xn(t,e){return Be(t.getMonth()+1,e,2)}function bn(t,e){return Be(t.getMinutes(),e,2)}function wn(t,e){return Be(t.getSeconds(),e,2)}function kn(t){var e=t.getDay();return 0===e?7:e}function _n(t,e){return Be(ie.count(ve(t)-1,t),e,2)}function Mn(t){var e=t.getDay();return e>=4||0===e?se(t):se.ceil(t)}function Sn(t,e){return t=Mn(t),Be(se.count(ve(t),t)+(4===ve(t).getDay()),e,2)}function Rn(t){return t.getDay()}function Cn(t,e){return Be(re.count(ve(t)-1,t),e,2)}function Nn(t,e){return Be(t.getFullYear()%100,e,2)}function Dn(t,e){return Be((t=Mn(t)).getFullYear()%100,e,2)}function qn(t,e){return Be(t.getFullYear()%1e4,e,4)}function En(t,e){var n=t.getDay();return Be((t=n>=4||0===n?se(t):se.ceil(t)).getFullYear()%1e4,e,4)}function On(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+Be(e/60|0,"0",2)+Be(e%60,"0",2)}function An(t,e){return Be(t.getUTCDate(),e,2)}function zn(t,e){return Be(t.getUTCHours(),e,2)}function Tn(t,e){return Be(t.getUTCHours()%12||12,e,2)}function In(t,e){return Be(1+te.count(xe(t),t),e,3)}function jn(t,e){return Be(t.getUTCMilliseconds(),e,3)}function Pn(t,e){return jn(t,e)+"000"}function Fn(t,e){return Be(t.getUTCMonth()+1,e,2)}function Ln(t,e){return Be(t.getUTCMinutes(),e,2)}function $n(t,e){return Be(t.getUTCSeconds(),e,2)}function Bn(t){var e=t.getUTCDay();return 0===e?7:e}function Hn(t,e){return Be(he.count(xe(t)-1,t),e,2)}function Wn(t){var e=t.getUTCDay();return e>=4||0===e?ge(t):ge.ceil(t)}function Vn(t,e){return t=Wn(t),Be(ge.count(xe(t),t)+(4===xe(t).getUTCDay()),e,2)}function Un(t){return t.getUTCDay()}function Yn(t,e){return Be(de.count(xe(t)-1,t),e,2)}function Kn(t,e){return Be(t.getUTCFullYear()%100,e,2)}function Gn(t,e){return Be((t=Wn(t)).getUTCFullYear()%100,e,2)}function Xn(t,e){return Be(t.getUTCFullYear()%1e4,e,4)}function Jn(t,e){var n=t.getUTCDay();return Be((t=n>=4||0===n?ge(t):ge.ceil(t)).getUTCFullYear()%1e4,e,4)}function Zn(){return"+0000"}function Qn(){return"%"}function ti(t){return+t}function ei(t){return Math.floor(+t/1e3)}const ni=Et();ni("d3-number",function(t,e,n){let i,r;function o(t){return r(t)}function a(){o.locale({decimal:n||".",thousands:e||",",grouping:[3],currency:["$",""]})}return o.locale=function(e){return i=Ut(e),r=i.format(t),this},a(),o.format=function(t,r,o,s){return(o||s)&&(e=o,n=s,a()),i.format(t)(r)},o.pattern=function(e){return e&&(t=e,r=i.format(e)),t},o}),ni("d3-time",function(t){let e=je({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}),n=e.format(t);function i(t){return n(t)}return i.format=function(t,n){return e.format(t)(n)},i.locale=function(){return e=je(...arguments),n=e.format(t),this},i.parse=function(t,n){return e.parse(t)(n)},i.parsePattern=function(t){return e.parse(t)},i});const ii={id:t=>"".concat(t.source,"/").concat(t.key||t.title),key:t=>String(t.key||t.title),tags:t=>t.tags,min:t=>t.min,max:t=>t.max,type:t=>t.type,title:t=>String(t.title),values:t=>t.values,value:t=>t,label:t=>t,formatter:t=>(t=>{if("function"==typeof t.formatter)return t.formatter();const e=t.formatter||{};return ni(e.type||"d3-number")(e.format||"")})(t)};function ri(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.id,i=void 0===n?ii.id:n,r=e.key,o=void 0===r?ii.key:r,a=e.min,s=void 0===a?ii.min:a,l=e.max,c=void 0===l?ii.max:l,u=e.type,h=void 0===u?ii.type:u,d=e.tags,f=void 0===d?ii.tags:d,p=e.title,g=void 0===p?ii.title:p,m=e.values,y=void 0===m?ii.values:m,v=e.value,x=void 0===v?ii.value:v,b=e.label,w=void 0===b?ii.label:b,k=e.formatter,_=void 0===k?ii.formatter:k;return{id:()=>i(t),key:()=>o(t),raw:()=>t,tags:()=>f(t),type:()=>h(t),min:()=>s(t),max:()=>c(t),title:()=>g(t),items:()=>y(t),formatter:()=>_(t),value:x,label:w}}const oi=t=>t.filter(t=>"number"==typeof t&&!isNaN(t)),ai=t=>t.reduce((t,e)=>t+e,0),si={first:t=>t[0],last:t=>t[t.length-1],min:t=>{const e=oi(t);return e.length?Math.min.apply(null,e):NaN},max:t=>{const e=oi(t);return e.length?Math.max.apply(null,e):NaN},sum:t=>{const e=oi(t);return e.length?e.reduce((t,e)=>t+e,0):NaN},avg:t=>{const e=oi(t),n=e.length;return n?ai(e)/n:NaN}};function li(t,e,n,i){const r={},o=i.field||(void 0!==t.field?e.field(t.field):null);return Object.keys(n).forEach(a=>{const s=n[a],l=r[a]={};-1!==["number","string","boolean"].indexOf(typeof s)?(l.type="primitive",l.value=s):"function"==typeof s?(l.type="function",l.value=s,l.label=s,l.field=o):"object"==typeof s&&(s.fields?l.fields=s.fields.map(n=>li(t,e,{main:n},i).main):void 0!==s.field?(l.type="field",l.field=e.field(s.field),l.value=l.field.value,l.label=l.field.label):o&&(l.value=o.value,l.label=o.label,l.field=o),"function"==typeof s.filter&&(l.filter=s.filter),void 0!==s.value&&(l.value=s.value),void 0!==s.label&&(l.label=s.label),"function"==typeof s.reduce?l.reduce=s.reduce:s.reduce?l.reduce=si[s.reduce]:l.field&&l.field.reduce&&(l.reduce="string"==typeof l.field.reduce?si[l.field.reduce]:l.field.reduce),"function"==typeof s.reduceLabel?l.reduceLabel=s.reduceLabel:s.reduceLabel?l.reduceLabel=si[s.reduceLabel]:l.field&&l.field.reduceLabel&&(l.reduceLabel="string"==typeof l.field.reduceLabel?si[l.field.reduceLabel]:l.field.reduceLabel))}),r}function ci(t,e){const n=li(t,e,{main:{value:t.value,label:t.label,reduce:t.reduce,filter:t.filter}},{}).main;return{props:li(t,e,t.props||{},n),main:n}}function ui(t,e,n,i){const r=Array(t.length),o=Array(t.length);let a;for(let e=0;e<t.length;e++)a=i?t[e][i]:t[e],r[e]=a.value,o[e]=a.label;const s=e.reduce,l=e.reduceLabel,c=s?s(r):r,u={value:c,label:l?l(o,c):n?n(c):String(c)};return i&&t[0][i].source?(u.source=t[0][i].source,u):!i&&t[0].source?(u.source=t[0].source,u):u}function hi(t,e){let n=e.main,i=e.propsArr,r=e.props,o=[];const a=n.field.formatter(),s={};return i.forEach(t=>{s[t]=r[t].field?r[t].field.formatter():t=>t}),o.push(...t.map(t=>{const e=ui(t.items,n,a);return i.forEach(n=>{e[n]=ui(t.items,r[n],s[n],n)}),e})),o}function di(t){let e=t.cfg,n=t.itemData,i=t.obj,r=t.target,o=t.tracker;const a="function"===t.trackType?e.trackBy(n):n[e.trackBy];let s=o[a];s||(s=o[a]={items:[],id:a},r.push(s)),s.items.push(i)}function fi(t){if(t.length<1e4)return Math.max(...t);let e=-1/0;const n=t.length;for(let i=0;i<n;i++)e<t[i]&&(e=t[i]);return e}function pi(t){if(t.length<1e4)return Math.min(...t);let e=1/0;const n=t.length;for(let i=0;i<n;i++)e>t[i]&&(e=t[i]);return e}const gi={diverging:function(t,e){const n=t.length;if(n<=0)return;const i=t[e[0]].length;for(let r=0;r<i;++r){let i=0,o=0;for(let a=0;a<n;++a){const n=t[e[a]][r],s=n[1]-n[0];s>=0?(n[0]=i,i+=s,n[1]=i):s<0?(n[1]=o,o+=s,n[0]=o):n[0]=i}}},none:St,silhouette:function(t,e){if((n=t.length)>0){for(var n,i=0,r=t[e[0]],o=r.length;i<o;++i){for(var a=0,s=0;a<n;++a)s+=t[a][i][1]||0;r[i][1]+=r[i][0]=-s/2}St(t,e)}},expand:function(t,e){if((i=t.length)>0){for(var n,i,r,o=0,a=t[0].length;o<a;++o){for(r=n=0;n<i;++n)r+=t[n][o][1]||0;if(r)for(n=0;n<i;++n)t[n][o][1]/=r}St(t,e)}},wiggle:function(t,e){if((r=t.length)>0&&(i=(n=t[e[0]]).length)>0){for(var n,i,r,o=0,a=1;a<i;++a){for(var s=0,l=0,c=0;s<r;++s){for(var u=t[e[s]],h=u[a][1]||0,d=(h-(u[a-1][1]||0))/2,f=0;f<s;++f){var p=t[e[f]];d+=(p[a][1]||0)-(p[a-1][1]||0)}l+=h,c+=d*h}n[a-1][1]+=n[a-1][0]=o,l&&(o-=c/l)}n[a-1][1]+=n[a-1][0]=o,St(t,e)}}},mi={ascending:function(t){var e=t.map(qt);return Rt(t).sort(function(t,n){return e[t]-e[n]})},insideout:function(t){var e,n,i=t.length,r=t.map(qt),o=function(t){var e=t.map(Dt);return Rt(t).sort(function(t,n){return e[t]-e[n]})}(t),a=0,s=0,l=[],c=[];for(e=0;e<i;++e)n=o[e],a<s?(a+=r[n],l.push(n)):(s+=r[n],c.push(n));return c.reverse().concat(l)},none:Rt,reverse:function(t){return Rt(t).reverse()}};function yi(t,e,n,i){const r=i||t.items,o={},a=e.stackKey,s=e.value,l=e.startProp||"start",c=e.endProp||"end",u=e.offset||"none",h=e.order||"none",d=e.valueRef||"";let f=0,p={};for(let t=0;t<r.length;t++){let e=r[t],n=d?e[d]:null;if(n&&n.source){let t="".concat(n.source.key||"","/").concat(n.source.field);p[t]||(p[t]=n.source)}let i=a(e);o[i]=o[i]||{items:[]},o[i].items.push(e),f=Math.max(f,o[i].items.length)}const g=Array.apply(null,{length:f}).map(Number.call,Number),m=Object.keys(o).map(t=>o[t].items),y=function(){var t=C([]),e=Rt,n=St,i=Ct;function r(r){var o,a,s=Array.from(t.apply(this,arguments),Nt),l=s.length,c=-1;for(const t of r)for(o=0,++c;o<l;++o)(s[o][c]=[0,+i(t,s[o].key,c,r)]).data=t;for(o=0,a=tt(e(s));o<l;++o)s[a[o]].index=o;return n(s,a),s}return r.keys=function(e){return arguments.length?(t="function"==typeof e?e:C(Array.from(e)),r):t},r.value=function(t){return arguments.length?(i="function"==typeof t?t:C(+t),r):i},r.order=function(t){return arguments.length?(e=null==t?Rt:"function"==typeof t?t:C(Array.from(t)),r):e},r.offset=function(t){return arguments.length?(n=null==t?St:t,r):n},r}().keys(g).value((t,e)=>t[e]?s(t[e]):0).order(mi[h]).offset(gi[u]);let v=y(m),x=[];for(let t=0;t<v.length;t++){let e=v[t];for(let t=0;t<e.length;t++){let n=e[t],i=e[t].data[e.key];i&&(i[l]={value:n[0]},i[c]={value:n[1]},x.push(n[0],n[1]))}}let b=Object.keys(p).map(t=>{let e=n(p[t].key);return e?e.field(p[t].field):null}).filter(t=>!!t);const w=ri({title:b.map(t=>t.title()).join(", "),min:pi(x),max:fi(x),type:"measure",formatter:b[0]?b[0].formatter:void 0});t.fields.push(w)}function vi(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={};const i=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).logger;if(Array.isArray(t))n.items=t.map(t=>({value:t,label:String(t)}));else if(t){if("collection"in t)n=g({},e.collection(t.collection));else{const r=e.dataset?e.dataset(t.source):null;let o=t.value||(t=>t),a=t.label||(t=>t);if(t.groupBy||t.mapTo)i.warn('Deprecated "data" configuration',t),n.items=[];else if(t.hierarchy)n.root=r.hierarchy?r.hierarchy(t.hierarchy):null,n.fields=r.fields();else if(t.items)n.items=t.skipNormalize?t.items:t.items.map(t=>({value:o(t),label:String(a(t))}));else if(t.extract){const i=Array.isArray(t.extract)?t.extract:[t.extract];n.items=[];const o=[];i.forEach(t=>{const i=t.source?e.dataset(t.source):r;i&&(n.items=[...n.items,...i.extract(t)],void 0!==t.field&&o.push(i.field(t.field)))}),o.length&&(n.fields=o),t.amend&&Array.isArray(t.amend)&&(n.items=[...n.items,...t.amend])}else if(void 0!==t.field&&r){const e=r.field(t.field);e&&(n.fields||(n.fields=[]),n.fields.push(e),"value"in t||(o=e.value||(t=>t),a=e.label||(t=>t),n.value=o),n.items=e.items().map(e=>({value:o(e),label:String(a(e)),source:{field:t.field}})))}else t.fields&&t.fields.forEach(t=>{const i="object"==typeof t&&t.source?e.dataset(t.source):r;if(!i)return;let o;o="object"==typeof t&&void 0!==t.field?i.field(t.field):i.field(t),o&&(n.fields||(n.fields=[]),n.fields.push(o))});n.items&&t.map&&(n.items=n.items.map(t.map))}t&&t.stack&&(Array.isArray(t.stack.stackByKey)?t.stack.stackByKey.forEach(i=>{const r=n.items.filter(t=>{var e;return(null===(e=t.key)||void 0===e?void 0:e.value)&&t.key.value===i});yi(n,t.stack,e.dataset,r)}):yi(n,t.stack,e.dataset,n.items))}return t&&!Array.isArray(t)&&"function"==typeof t.filter&&n.items&&(n.items=n.items.filter(t.filter)),t&&!Array.isArray(t)&&"function"==typeof t.sort&&n.items&&(n.items=n.items.sort(t.sort)),n}function xi(t,e,n){let i,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:vi;if(t.data){const i=r(t.data,e,n);if(i&&i.fields&&i.fields[0])return i.fields[0].formatter()}if(i=t.formatter?"".concat(t.formatter,"-").concat(t.type||"number"):t.type||"d3-number",n.formatter.has(i)){return n.formatter.get(i)(t.format||"")}throw new Error("Formatter of type '".concat(i,"' was not found"))}function bi(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}const wi=Symbol("implicit");function ki(){var t=new Re,e=[],n=[],i=wi;function r(r){let o=t.get(r);if(void 0===o){if(i!==wi)return i;t.set(r,o=e.push(r)-1)}return n[o%n.length]}return r.domain=function(n){if(!arguments.length)return e.slice();e=[],t=new Re;for(const i of n)t.has(i)||t.set(i,e.push(i)-1);return r},r.range=function(t){return arguments.length?(n=Array.from(t),r):n.slice()},r.unknown=function(t){return arguments.length?(i=t,r):i},r.copy=function(){return ki(e,n).unknown(i)},bi.apply(r,arguments),r}function _i(){var t,e,n=ki().unknown(void 0),i=n.domain,r=n.range,o=0,a=1,s=!1,l=0,c=0,u=.5;function h(){var n=i().length,h=a<o,d=h?a:o,f=h?o:a;t=(f-d)/Math.max(1,n-l+2*c),s&&(t=Math.floor(t)),d+=(f-d-t*(n-l))*u,e=t*(1-l),s&&(d=Math.round(d),e=Math.round(e));var p=function(t,e,n){t=+t,e=+e,n=(r=arguments.length)<2?(e=t,t=0,1):r<3?1:+n;for(var i=-1,r=0|Math.max(0,Math.ceil((e-t)/n)),o=new Array(r);++i<r;)o[i]=t+i*n;return o}(n).map(function(e){return d+t*e});return r(h?p.reverse():p)}return delete n.unknown,n.domain=function(t){return arguments.length?(i(t),h()):i()},n.range=function(t){return arguments.length?([o,a]=t,o=+o,a=+a,h()):[o,a]},n.rangeRound=function(t){return[o,a]=t,o=+o,a=+a,s=!0,h()},n.bandwidth=function(){return e},n.step=function(){return t},n.round=function(t){return arguments.length?(s=!!t,h()):s},n.padding=function(t){return arguments.length?(l=Math.min(1,c=+t),h()):l},n.paddingInner=function(t){return arguments.length?(l=Math.min(1,t),h()):l},n.paddingOuter=function(t){return arguments.length?(c=+t,h()):c},n.align=function(t){return arguments.length?(u=Math.max(0,Math.min(1,t)),h()):u},n.copy=function(){return _i(i(),[o,a]).round(s).paddingInner(l).paddingOuter(c).align(u)},bi.apply(h(),arguments)}function Mi(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Si(t,e){var n=Object.create(t.prototype);for(var i in e)n[i]=e[i];return n}function Ri(){}var Ci=.7,Ni=1/Ci,Di="\\s*([+-]?\\d+)\\s*",qi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ei="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Oi=/^#([0-9a-f]{3,8})$/,Ai=new RegExp(`^rgb\\(${Di},${Di},${Di}\\)$`),zi=new RegExp(`^rgb\\(${Ei},${Ei},${Ei}\\)$`),Ti=new RegExp(`^rgba\\(${Di},${Di},${Di},${qi}\\)$`),Ii=new RegExp(`^rgba\\(${Ei},${Ei},${Ei},${qi}\\)$`),ji=new RegExp(`^hsl\\(${qi},${Ei},${Ei}\\)$`),Pi=new RegExp(`^hsla\\(${qi},${Ei},${Ei},${qi}\\)$`),Fi={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function Li(){return this.rgb().formatHex()}function $i(){return this.rgb().formatRgb()}function Bi(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Oi.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?Hi(e):3===n?new Ui(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?Wi(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?Wi(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=Ai.exec(t))?new Ui(e[1],e[2],e[3],1):(e=zi.exec(t))?new Ui(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=Ti.exec(t))?Wi(e[1],e[2],e[3],e[4]):(e=Ii.exec(t))?Wi(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=ji.exec(t))?Zi(e[1],e[2]/100,e[3]/100,1):(e=Pi.exec(t))?Zi(e[1],e[2]/100,e[3]/100,e[4]):Fi.hasOwnProperty(t)?Hi(Fi[t]):"transparent"===t?new Ui(NaN,NaN,NaN,0):null}function Hi(t){return new Ui(t>>16&255,t>>8&255,255&t,1)}function Wi(t,e,n,i){return i<=0&&(t=e=n=NaN),new Ui(t,e,n,i)}function Vi(t,e,n,i){return 1===arguments.length?function(t){return t instanceof Ri||(t=Bi(t)),t?new Ui((t=t.rgb()).r,t.g,t.b,t.opacity):new Ui}(t):new Ui(t,e,n,null==i?1:i)}function Ui(t,e,n,i){this.r=+t,this.g=+e,this.b=+n,this.opacity=+i}function Yi(){return`#${Ji(this.r)}${Ji(this.g)}${Ji(this.b)}`}function Ki(){const t=Gi(this.opacity);return`${1===t?"rgb(":"rgba("}${Xi(this.r)}, ${Xi(this.g)}, ${Xi(this.b)}${1===t?")":`, ${t})`}`}function Gi(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Xi(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Ji(t){return((t=Xi(t))<16?"0":"")+t.toString(16)}function Zi(t,e,n,i){return i<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new tr(t,e,n,i)}function Qi(t){if(t instanceof tr)return new tr(t.h,t.s,t.l,t.opacity);if(t instanceof Ri||(t=Bi(t)),!t)return new tr;if(t instanceof tr)return t;var e=(t=t.rgb()).r/255,n=t.g/255,i=t.b/255,r=Math.min(e,n,i),o=Math.max(e,n,i),a=NaN,s=o-r,l=(o+r)/2;return s?(a=e===o?(n-i)/s+6*(n<i):n===o?(i-e)/s+2:(e-n)/s+4,s/=l<.5?o+r:2-o-r,a*=60):s=l>0&&l<1?0:a,new tr(a,s,l,t.opacity)}function tr(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}function er(t){return(t=(t||0)%360)<0?t+360:t}function nr(t){return Math.max(0,Math.min(1,t||0))}function ir(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}Mi(Ri,Bi,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Li,formatHex:Li,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Qi(this).formatHsl()},formatRgb:$i,toString:$i}),Mi(Ui,Vi,Si(Ri,{brighter(t){return t=null==t?Ni:Math.pow(Ni,t),new Ui(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?Ci:Math.pow(Ci,t),new Ui(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Ui(Xi(this.r),Xi(this.g),Xi(this.b),Gi(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Yi,formatHex:Yi,formatHex8:function(){return`#${Ji(this.r)}${Ji(this.g)}${Ji(this.b)}${Ji(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Ki,toString:Ki})),Mi(tr,function(t,e,n,i){return 1===arguments.length?Qi(t):new tr(t,e,n,null==i?1:i)},Si(Ri,{brighter(t){return t=null==t?Ni:Math.pow(Ni,t),new tr(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?Ci:Math.pow(Ci,t),new tr(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*e,r=2*n-i;return new Ui(ir(t>=240?t-240:t+120,r,i),ir(t,r,i),ir(t<120?t+240:t-120,r,i),this.opacity)},clamp(){return new tr(er(this.h),nr(this.s),nr(this.l),Gi(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=Gi(this.opacity);return`${1===t?"hsl(":"hsla("}${er(this.h)}, ${100*nr(this.s)}%, ${100*nr(this.l)}%${1===t?")":`, ${t})`}`}}));var rr=t=>()=>t;function or(t){return 1===(t=+t)?ar:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(i){return Math.pow(t+i*e,n)}}(e,n,t):rr(isNaN(e)?n:e)}}function ar(t,e){var n=e-t;return n?function(t,e){return function(n){return t+n*e}}(t,n):rr(isNaN(t)?e:t)}var sr=function t(e){var n=or(e);function i(t,e){var i=n((t=Vi(t)).r,(e=Vi(e)).r),r=n(t.g,e.g),o=n(t.b,e.b),a=ar(t.opacity,e.opacity);return function(e){return t.r=i(e),t.g=r(e),t.b=o(e),t.opacity=a(e),t+""}}return i.gamma=t,i}(1);function lr(t,e){e||(e=[]);var n,i=t?Math.min(e.length,t.length):0,r=e.slice();return function(o){for(n=0;n<i;++n)r[n]=t[n]*(1-o)+e[n]*o;return r}}function cr(t,e){var n,i=e?e.length:0,r=t?Math.min(i,t.length):0,o=new Array(r),a=new Array(i);for(n=0;n<r;++n)o[n]=mr(t[n],e[n]);for(;n<i;++n)a[n]=e[n];return function(t){for(n=0;n<r;++n)a[n]=o[n](t);return a}}function ur(t,e){var n=new Date;return t=+t,e=+e,function(i){return n.setTime(t*(1-i)+e*i),n}}function hr(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function dr(t,e){var n,i={},r={};for(n in null!==t&&"object"==typeof t||(t={}),null!==e&&"object"==typeof e||(e={}),e)n in t?i[n]=mr(t[n],e[n]):r[n]=e[n];return function(t){for(n in i)r[n]=i[n](t);return r}}var fr=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,pr=new RegExp(fr.source,"g");function gr(t,e){var n,i,r,o=fr.lastIndex=pr.lastIndex=0,a=-1,s=[],l=[];for(t+="",e+="";(n=fr.exec(t))&&(i=pr.exec(e));)(r=i.index)>o&&(r=e.slice(o,r),s[a]?s[a]+=r:s[++a]=r),(n=n[0])===(i=i[0])?s[a]?s[a]+=i:s[++a]=i:(s[++a]=null,l.push({i:a,x:hr(n,i)})),o=pr.lastIndex;return o<e.length&&(r=e.slice(o),s[a]?s[a]+=r:s[++a]=r),s.length<2?l[0]?function(t){return function(e){return t(e)+""}}(l[0].x):function(t){return function(){return t}}(e):(e=l.length,function(t){for(var n,i=0;i<e;++i)s[(n=l[i]).i]=n.x(t);return s.join("")})}function mr(t,e){var n,i=typeof e;return null==e||"boolean"===i?rr(e):("number"===i?hr:"string"===i?(n=Bi(e))?(e=n,sr):gr:e instanceof Bi?sr:e instanceof Date?ur:function(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}(e)?lr:Array.isArray(e)?cr:"function"!=typeof e.valueOf&&"function"!=typeof e.toString||isNaN(e)?dr:hr)(t,e)}function yr(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}function vr(t){return+t}var xr=[0,1];function br(t){return t}function wr(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:function(t){return function(){return t}}(isNaN(e)?NaN:.5)}function kr(t,e,n){var i=t[0],r=t[1],o=e[0],a=e[1];return r<i?(i=wr(r,i),o=n(a,o)):(i=wr(i,r),o=n(o,a)),function(t){return o(i(t))}}function _r(t,e,n){var i=Math.min(t.length,e.length)-1,r=new Array(i),o=new Array(i),a=-1;for(t[i]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++a<i;)r[a]=wr(t[a],t[a+1]),o[a]=n(e[a],e[a+1]);return function(e){var n=Se(t,e,1,i)-1;return o[n](r[n](e))}}function Mr(){var t,e,n,i,r,o,a=xr,s=xr,l=mr,c=br;function u(){var t=Math.min(a.length,s.length);return c!==br&&(c=function(t,e){var n;return t>e&&(n=t,t=e,e=n),function(n){return Math.max(t,Math.min(e,n))}}(a[0],a[t-1])),i=t>2?_r:kr,r=o=null,h}function h(e){return null==e||isNaN(e=+e)?n:(r||(r=i(a.map(t),s,l)))(t(c(e)))}return h.invert=function(n){return c(e((o||(o=i(s,a.map(t),hr)))(n)))},h.domain=function(t){return arguments.length?(a=Array.from(t,vr),u()):a.slice()},h.range=function(t){return arguments.length?(s=Array.from(t),u()):s.slice()},h.rangeRound=function(t){return s=Array.from(t),l=yr,u()},h.clamp=function(t){return arguments.length?(c=!!t||br,u()):c!==br},h.interpolate=function(t){return arguments.length?(l=t,u()):l},h.unknown=function(t){return arguments.length?(n=t,h):n},function(n,i){return t=n,e=i,u()}}function Sr(t,e,n,i){var r,o=function(t,e,n){n=+n;const i=(e=+e)<(t=+t),r=i?Ae(e,t,n):Ae(t,e,n);return(i?-1:1)*(r<0?1/-r:r)}(t,e,n);switch((i=It(null==i?",f":i)).type){case"s":var a=Math.max(Math.abs(t),Math.abs(e));return null!=i.precision||isNaN(r=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(At(e)/3)))-At(Math.abs(t)))}(o,a))||(i.precision=r),Ht(i,a);case"":case"e":case"g":case"p":case"r":null!=i.precision||isNaN(r=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,At(e)-At(t))+1}(o,Math.max(Math.abs(t),Math.abs(e))))||(i.precision=r-("e"===i.type));break;case"f":case"%":null!=i.precision||isNaN(r=function(t){return Math.max(0,-At(Math.abs(t)))}(o))||(i.precision=r-2*("%"===i.type))}return Bt(i)}function Rr(t){var e=t.domain;return t.ticks=function(t){var n=e();return function(t,e,n){if(!((n=+n)>0))return[];if((t=+t)===(e=+e))return[t];const i=e<t,[r,o,a]=i?Oe(e,t,n):Oe(t,e,n);if(!(o>=r))return[];const s=o-r+1,l=new Array(s);if(i)if(a<0)for(let t=0;t<s;++t)l[t]=(o-t)/-a;else for(let t=0;t<s;++t)l[t]=(o-t)*a;else if(a<0)for(let t=0;t<s;++t)l[t]=(r+t)/-a;else for(let t=0;t<s;++t)l[t]=(r+t)*a;return l}(n[0],n[n.length-1],null==t?10:t)},t.tickFormat=function(t,n){var i=e();return Sr(i[0],i[i.length-1],null==t?10:t,n)},t.nice=function(n){null==n&&(n=10);var i,r,o=e(),a=0,s=o.length-1,l=o[a],c=o[s],u=10;for(c<l&&(r=l,l=c,c=r,r=a,a=s,s=r);u-- >0;){if((r=Ae(l,c,n))===i)return o[a]=l,o[s]=c,e(o);if(r>0)l=Math.floor(l/r)*r,c=Math.ceil(c/r)*r;else{if(!(r<0))break;l=Math.ceil(l*r)/r,c=Math.floor(c*r)/r}i=r}return t},t}function Cr(){var t=Mr()(br,br);return t.copy=function(){return e=t,Cr().domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown());var e},bi.apply(t,arguments),Rr(t)}function Nr(){var t,e=[.5],n=[0,1],i=1;function r(r){return null!=r&&r<=r?n[Se(e,r,0,i)]:t}return r.domain=function(t){return arguments.length?(e=Array.from(t),i=Math.min(e.length,n.length-1),r):e.slice()},r.range=function(t){return arguments.length?(n=Array.from(t),i=Math.min(e.length,n.length-1),r):n.slice()},r.invertExtent=function(t){var i=n.indexOf(t);return[e[i-1],e[i]]},r.unknown=function(e){return arguments.length?(t=e,r):t},r.copy=function(){return Nr().domain(e).range(n).unknown(t)},bi.apply(r,arguments)}function Dr(t){return void 0===t?t=>t:e=>t(e)}function qr(t){return Math.max(0,Math.min(1,t))}function Er(t){return"object"==typeof t}function Or(t,e,n){const i=Math.abs(e-n)/(t+1),r=[];for(let o=1;o<=t;o++){const t=o*i;r.push(e<n?e+t:e-t)}return r}function Ar(t,e,n){if(1===t.length)return t;const i=t.concat([]);for(let r=0;r<t.length;r++){let o=t[r],a=t[r+1];0===r&&o!==n.start()?(i.push(...Or(e,o,a)),o-=a-o,a=t[r],i.push(...Or(e,o,a))):r===t.length-1&&a!==n.end()?(a=o+(o-t[r-1]),i.push(...Or(e,o,a))):i.push(...Or(e,o,a))}return i.filter(t=>t>=n.min()&&t<=n.max())}function zr(t){let e=t.distance,n=t.scale,i=t.minorCount,r=void 0===i?0:i,o=t.unitDivider,a=void 0===o?100:o,s=t.formatter,l=void 0===s?void 0:s;const c=x(a)||x(e)?2:Math.max(e/a,2),u=Math.min(1e3,Math.round(c));let h=n.ticks(u);h.length<=1&&(h=n.ticks(u+1));const d=r>0?Ar(h,r,n):h;d.sort((t,e)=>t-e);const f=d.map(Dr(l));return d.map((t,e)=>{const i=n(t);return{position:i,start:i,end:i,label:f[e],value:t,isMinor:-1===h.indexOf(t)}})}function Tr(t){let e=t.distance,n=t.scale,i=t.minorCount,r=void 0===i?0:i,o=t.unitDivider,a=void 0===o?100:o,s=t.formatter,l=void 0===s?void 0:s;const c=x(a)||x(e)?2:Math.max(e/a,2),u=Math.min(1e3,Math.round(c)),h=u>10?10:u;n.nice(h);const d=n.ticks(u),f=r>0?Ar(d,r,n):d;f.sort((t,e)=>t-e);const p=f.map(Dr(l));return f.map((t,e)=>{const i=n(t);return{position:i,start:i,end:i,label:p[e],value:t,isMinor:-1===d.indexOf(t)}})}function Ir(t){let e,n=t.settings,i=t.scale,r=t.distance,o=t.formatter,a=void 0===o?t=>t:o;const s=n.minorTicks&&!x(n.minorTicks.count)?Math.min(100,n.minorTicks.count):0;if(Array.isArray(n.ticks.values)){const t=n.ticks.values.filter(t=>"object"==typeof t?!x(t.value):!x(t));e=function(t){let e=t.values,n=t.scale,i=t.formatter,r=void 0===i?t=>t:i;return e.sort((t,e)=>(Er(t)?t.value:t)-(Er(e)?e.value:e)).filter((t,e,i)=>{const r=Er(t)?t.value:t;return r<=n.max()&&r>=n.min()&&i.indexOf(t)===e}).map(t=>{const e=Er(t),i=e?t.value:t,o=n(i);return{position:o,value:i,label:e&&void 0!==t.label?t.label:r(i),isMinor:!!e&&!!t.isMinor,start:e&&!isNaN(t.start)?qr(n(t.start)):o,end:e&&!isNaN(t.end)?qr(n(t.end)):o}})}({values:t,scale:i.copy(),formatter:a})}else if(x(n.ticks.count)){e=(n.ticks.tight?Tr:zr)({distance:r,minorCount:s,unitDivider:n.ticks.distance,scale:i,formatter:a}),n.ticks.forceBounds&&function(t,e,n){const i=t.map(t=>t.position),r=e.range();-1===i.indexOf(r[0])?t.splice(0,0,{position:r[0],start:r[0],end:r[0],label:n(e.start()),isMinor:!1,value:e.start()}):t[0]&&t[0].isMinor&&(t[0].isMinor=!1);const o=t[t.length-1];-1===i.indexOf(r[1])?t.push({position:r[1],start:r[1],end:r[1],label:n(e.end()),isMinor:!1,value:e.end()}):o&&o.isMinor&&(o.isMinor=!1)}(e,i,a)}else{e=function(t){let e=t.count,n=t.minorCount,i=t.scale,r=t.formatter;return i.ticks((e-1)*n+e).map((t,e)=>{const o=i(t);return{position:o,start:o,end:o,label:r(t),isMinor:e%(n+1)!==0,value:t}})}({count:Math.min(1e3,n.ticks.count),minorCount:s,scale:i.copy(),formatter:a})}return e}function jr(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i={};return Object.keys(e).forEach(r=>{const o=typeof t[r];i[r]="function"===o?t[r](n):"undefined"===o?e[r]:t[r]}),i}const Pr={min:NaN,max:NaN,expand:NaN,include:[],invert:!1},Fr={tight:!1,forceBounds:!1,values:void 0,count:NaN,distance:100},Lr={count:NaN};function $r(t,e){t.instance||(t.instance=e.copy(),t.instance.domain([e.start(),e.end()]),t.instance.clamp(!0),t.instance.range(t.invert?[1,0]:[0,1]))}function Br(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=Cr(),r={instance:null,invert:!1},o={data:e,resources:n},a=jr(t,Pr,o);let s;function l(t){return x(t)?NaN:i(t)}a.ticks=jr(t.ticks,Fr,o),a.minorTicks=jr(t.minorTicks,Lr,o),l.data=()=>e,l.invert=function(t){return i.invert(t)},l.rangeRound=function(t){return i.rangeRound(t),l},l.clamp=function(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return i.clamp(t),l},l.cachedTicks=function(){return s},l.clearTicksCache=function(){return s=void 0,this},l.ticks=function(t){return null!==t&&"object"==typeof t?(t.settings=t.settings||{},t.settings=u(!0,{},a,t.settings),t.scale=l,s=Ir(t),s):(s=i.ticks(t),s)},l.nice=function(t){return i.nice(t),l},l.tickFormat=function(t,e){return i.tickFormat(t,e)},l.interpolate=function(t){return i.interpolate(t),l},l.domain=function(t){return arguments.length?(i.domain(t),r.instance&&r.instance.domain([l.start(),l.end()]),l):i.domain()},l.range=function(t){return arguments.length?(i.range(t),l):i.range()},l.start=function(){return l.domain()[0]},l.end=function(){return l.domain()[this.domain().length-1]},l.min=function(){return Math.min(this.start(),this.end())},l.max=function(){return Math.max(this.start(),this.end())},l.classify=function(t){let e=(l.start()-l.end())/t,n=[l.end()],i=[],r=e/2;for(let o=0;o<t;o++){let t=n[n.length-1]||0,o=t+e,a=l(t+r);n.push(o,o),i.push(a,a)}return n.pop(),l.domain(n),l.range(i),l},l.copy=function(){const r=Br(t,e,n);return r.domain(l.domain()),r.range(l.range()),r.clamp(i.clamp()),r},l.norm=function(t){return $r(r,l),r.instance(t)},l.normInvert=function(t){return $r(r,l),r.instance.invert(t)};const c=function(t,e){const n=+t.min,i=+t.max;let r=0,o=1;if(e&&e[0]){const n=e.map(t=>t.min()).filter(t=>!isNaN(t)),i=e.map(t=>t.max()).filter(t=>!isNaN(t));if(r=n.length?Math.min(...n):Number.NaN,o=i.length?Math.max(...i):Number.NaN,isNaN(r)||isNaN(o))r=-1,o=1;else if(r===o&&0===r)r=-1,o=1;else if(r===o&&r)r-=Math.abs(.1*r),o+=Math.abs(.1*o);else if(!isNaN(t.expand)){const e=o-r;r-=e*t.expand,o+=e*t.expand}if(Array.isArray(t.include)){const e=t.include.filter(t=>!isNaN(t));r=Math.min(...e,r),o=Math.max(...e,o)}}return{mini:isNaN(n)?r:n,maxi:isNaN(i)?o:i}}(a,e?e.fields:[]),h=c.mini,d=c.maxi;return l.domain([h,d]),l.range(a.invert?[1,0]:[0,1]),r.invert=a.invert,l}const Hr={padding:0,paddingInner:NaN,paddingOuter:NaN,align:.5,invert:!1,maxPxStep:NaN,range:[0,1]};function Wr(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n={data:e,resources:arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}},i=jr(t,Hr,n),r=e.items||[],o={},a=[],s=[];function l(t,n){t.data=()=>e,t.datum=t=>r[o[t]],t.start=function(){return t.domain()[0]},t.end=function(){return t.domain()[t.domain().length-1]},t.labels=()=>s,t.ticks=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.scale=t,function(t){let e=t.scale;const n=e.domain(),i=e.data().items,r=e.labels?e.labels():n,o=e.bandwidth();return n.map((t,n)=>{const a=e(t);return{position:a+o/2,label:"".concat(r[n]),data:i?i[n]:void 0,start:a,end:a+o}})}(e,n.trackBy)}}const c=_i();l(c,t),c.pxScale=function(e){const n=i.maxPxStep;if(isNaN(n))return c;const r=c.domain().length,o=Math.max(1,r-c.paddingInner()+2*c.paddingOuter());if(o*n>=e)return c;const a=c.copy();a.type=c.type,l(a,t);const s=o*n/e,u=(1-s)*c.align();return a.range(i.invert?[s+u,u]:[u,s+u]),a};const h="function"==typeof t.value?t.value:t=>t.datum.value,d="function"==typeof t.label?t.label:t=>t.datum.label;for(let t=0;t<r.length;t++){const e=u({datum:r[t]},n),i=h(e,t);-1===a.indexOf(i)&&(a.push(i),s.push(d(e,t)),o[i]=t)}return c.domain(a),c.range(i.invert?i.range.slice().reverse():i.range),c.padding(isNaN(i.padding)?0:i.padding),isNaN(i.paddingInner)||c.paddingInner(i.paddingInner),isNaN(i.paddingOuter)||c.paddingOuter(i.paddingOuter),c.align(isNaN(i.align)?.5:i.align),c}const Vr={depth:0};function Ur(t,e,n){return t.ancestors().map(t=>e(u({datum:t.data},n))).reverse().slice(1).toString()}const Yr=t=>t.min(),Kr=t=>t.max();function Gr(t,e){const n=t&&!isNaN(t.min),i=t&&!isNaN(t.max);let r=n?+t.min:0,o=i?+t.max:1;if(e&&e.length){if(!n){const t=e.map(Yr).filter(v);r=t.length?Math.min(...t):r}if(!i){const t=e.map(Kr).filter(v);o=t.length?Math.max(...t):o}}return[r,o]}const Xr={domain:[],range:[],invert:!1,min:NaN,max:NaN};function Jr(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=Br(t,e,n).clamp(!0).interpolate(sr),r=jr(t,Xr,{data:e,resources:n}),o=Array.isArray(r.domain)&&r.domain.length,a=Array.isArray(r.range)&&r.range.length,s=i;u(!0,s,i);const l=m(Gr(r,e?e.fields:[]),2),c=l[0],h=l[1],d=o?r.domain.length:-1,f=n.theme?n.theme.palette("sequential",d>0?d:2):[],p=a?r.range:f;return s.range(r.invert?p.slice().reverse():p.slice()),s.domain(o?r.domain:function(t,e,n){const i=t.length;if(2===i)return[e,n];const r=[],o=(n-e)/(i-1);r.push(e);for(let t=1;t<i-1;t++)r.push(e+o*t);return r.push(n),r}(s.range(),c,h)),s}const Zr={domain:[],range:[],invert:!1,min:NaN,max:NaN,nice:!1};function Qr(t){const e=[];for(let n=0;n<t.length-1;n++)e.push((t[n]+t[n+1])/2);return e}const to={domain:[],range:[]};const eo={domain:[],range:[],unknown:void 0},no={domain:[],range:[],override:!1};const io=Et();function ro(t,e,n){let i=t.data;t.source&&(n.logger.warn("Deprecated: Scale data source configuration"),i={extract:[]},(Array.isArray(t.source)?t.source:[t.source]).forEach(t=>{i.extract.push({field:t})}));const r=vi(i,e,n);let o,a=t.type||function(t){return t.root?"h-band":t.fields&&t.fields[0]?function(t){const e=t.map(t=>"dimension"===t.type()?"band":"linear");return-1!==e.indexOf("linear")?"linear":"band"}(t.fields):"linear"}(r);return"color"===a&&(a=r.fields&&r.fields[0]&&"dimension"===r.fields[0].type()?"categorical-color":"sequential-color"),n.scale.has(a)&&(o=n.scale.get(a),o=o(t,r,{theme:n.theme,logger:n.logger}),o.type=a),o}io("linear",Br),io("band",Wr),io("h-band",function t(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r={data:n,resources:i},o=jr(e,Hr,r);o.ticks=jr(e.ticks,Vr,r),o.value="function"==typeof e.value?e.value:t=>t.datum.value,o.label="function"==typeof e.label?e.label:t=>t.datum.value;let a=Wr(o);const s=function(t,e,n){const i=e.ticks.depth,r=e.value,o=e.label,a=[],s=[],l={},c=[];let h=0;if(!t)return{values:a,labels:s,items:l,ticks:c};t.eachAfter(t=>{if(t.depth>0){const e=Ur(t,r,n),d=t.leaves()||[t],f=r(u({datum:t.data},n)),p=o(u({datum:t.data},n)),g=Array.isArray(t.children),m={key:e,count:d.length,value:f,label:p,leftEdge:Ur(d[0],r,n),rightEdge:Ur(d[Math.max(d.length-1,0)],r,n),node:t};g?(a.push("SPACER_".concat(h,"_SPACER")),h++):(a.push(e),s.push(p)),(i<=0&&!g||t.depth===i)&&c.push(m),l[e]=m}});const d=t.height-1;return d>0&&a.splice(-d),{values:a,labels:s,items:l,ticks:c}}(n.root,o,r),l=s.values,c=s.labels,h=s.items,d=s.ticks,f=function(t){const e=String(t),n=h[e];return a(n?o.invert?n.rightEdge:n.leftEdge:e)};u(!0,f,a),f.bandwidth=function(t){const e=h[String(t)],n=a.bandwidth();if(e&&!e.isLeaf){const t=f(e.leftEdge),i=f(e.rightEdge);return Math.abs(t-i)+n}return n},f.step=function(t){const e=h[String(t)],n=e?e.count:1;let i=a.step();return i*=n,i},f.data=()=>n,f.datum=t=>{const e=h[String(t)];return e?e.node.data:null},f.copy=()=>t(e,n,i),f.labels=()=>c,f.ticks=()=>d.map(t=>{const e=f(t.key),n=f.bandwidth(t.key);return{position:e+n/2,label:t.label,data:t.node.data,start:e,end:e+n}});const p=a.pxScale;return f.pxScale=function(t){return a=p(t),f},f.domain(l),f}),io("sequential-color",Jr),io("threshold-color",function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=Nr(),r=jr(t,Zr,{data:e,resources:n}),o=Array.isArray(r.domain)&&r.domain.length,a=Array.isArray(r.range)&&r.range.length;function s(t){return x(t)?NaN:i(t)}Object.keys(i).forEach(t=>s[t]=i[t]);const l=m(Gr(r,e.fields),2),c=l[0],u=l[1],h=o?r.domain.length:-1,d=n.theme?n.theme.palette("sequential",h>0?h:2):[];let f=a?r.range:d,p=[];return p=o?r.domain:r.nice?function(t,e,n){const i=2===t.length?10:Math.max(1,t.length),r=Cr().domain([e,n]).nice(i).ticks(i);if(!t||!t.length)return r;const o=Math.max(0,t.length-1);for(;r.length>o;)r[0]-e<=n-r[r.length-1]?r.shift():r.pop();return r}(f,c,u):[c+(u-c)/2],f.length>p.length+1?p=function(t,e,n){const i=t.length;if(2===i)return[e+(n-e)/2];const r=[],o=(n-e)/i;for(let t=1;t<i;t++)r.push(e+o*t);return r}(f,c,u):f.length<p.length+1&&(f=function(t,e,n,i){n=t[0],i=t&&t.length>=2?t[t.length-1]:i;const r=Jr().domain([n,i]).range(e);return[n,...Qr(t),i].map(t=>r(t))}(p,f,c,u)),s.data=()=>e,s.range(r.invert?f.slice().reverse():f),s.domain(p),s}),io("categorical-color",function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=ki(),r={data:e,resources:n},o=jr(t,to,r),a="function"==typeof t.value?t.value:t=>t.datum.value,s="function"==typeof t.label?t.label:t=>t.datum.label,l=e.items||[],c={},h=[],d=[];for(let t=0;t<l.length;t++){const e=u({datum:l[t]},r),n=a(e,t);-1===h.indexOf(n)&&(h.push(n),d.push(s(e,t)),c[n]=t)}return i.data=()=>e,i.labels=()=>d,i.label=t=>d[h.indexOf(t)],i.datum=t=>l[c[t]],i.range(o.range),Array.isArray(o.domain)&&o.domain.length?i.domain(o.domain):i.domain(h),i}(t,e,n),r=n.theme,o=jr(t,eo,{data:e,resources:n});let a;if(o.explicit=jr(t.explicit,no,{data:e,resources:n}),a=Array.isArray(o.range)&&0!==o.range.length?o.range.slice():r?r.palette("categorical",i.domain().length).slice():[],o.unknown)i.unknown(o.unknown);else if(r&&r.palette("unknown")){let t=r.palette("unknown");i.unknown(t[0])}if(Array.isArray(o.explicit.domain)&&o.explicit.domain.length){const t=i.domain().slice(),e=o.explicit.domain,n=Array.isArray(o.explicit.range)?o.explicit.range:[],r=Math.floor(t.length/a.length);for(let t=1;t<r+1;t*=2)a=a.concat(a);if(o.explicit.override)for(let i=0;i<e.length;i++){const r=t.indexOf(e[i]);r>-1&&(a[r]=n[i])}else{const i=e.map((e,i)=>[t.indexOf(e),e,n[i]]).sort((t,e)=>t[0]-e[0]);i.forEach(e=>{const n=t.indexOf(e[1]);-1!==n&&a.splice(n,0,e[2])})}a.length=t.length}return i.range(a),i});var oo={};function ao(){ao.init.call(this)}oo.isObject=function(t){return"object"==typeof t&&null!==t},oo.isNumber=function(t){return"number"==typeof t},oo.isUndefined=function(t){return void 0===t},oo.isFunction=function(t){return"function"==typeof t};var so=ao;ao.EventEmitter=ao,ao.prototype._events=void 0,ao.prototype._maxListeners=void 0,ao.defaultMaxListeners=10,ao.init=function(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0},ao.prototype.setMaxListeners=function(t){if(!oo.isNumber(t)||t<0||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},ao.prototype.emit=function(t){var e,n,i,r,o,a;if(this._events||(this._events={}),"error"===t&&!this._events.error)throw(e=arguments[1])instanceof Error?e:Error('Uncaught, unspecified "error" event.');if(n=this._events[t],oo.isUndefined(n))return!1;if(oo.isFunction(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:for(i=arguments.length,r=new Array(i-1),o=1;o<i;o++)r[o-1]=arguments[o];n.apply(this,r)}else if(oo.isObject(n)){for(i=arguments.length,r=new Array(i-1),o=1;o<i;o++)r[o-1]=arguments[o];for(i=(a=n.slice()).length,o=0;o<i;o++)a[o].apply(this,r)}return!0},ao.prototype.addListener=function(t,e){var n;if(!oo.isFunction(e))throw TypeError("listener must be a function");(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",t,oo.isFunction(e.listener)?e.listener:e),this._events[t]?oo.isObject(this._events[t])?this._events[t].push(e):this._events[t]=[this._events[t],e]:this._events[t]=e,oo.isObject(this._events[t])&&!this._events[t].warned)&&((n=oo.isUndefined(this._maxListeners)?ao.defaultMaxListeners:this._maxListeners)&&n>0&&this._events[t].length>n&&(this._events[t].warned=!0,oo.isFunction(console.error)&&console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),oo.isFunction(console.trace)&&console.trace()));return this},ao.prototype.on=ao.prototype.addListener,ao.prototype.once=function(t,e){if(!oo.isFunction(e))throw TypeError("listener must be a function");var n=!1;function i(){this.removeListener(t,i),n||(n=!0,e.apply(this,arguments))}return i.listener=e,this.on(t,i),this},ao.prototype.removeListener=function(t,e){var n,i,r,o;if(!oo.isFunction(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(r=(n=this._events[t]).length,i=-1,n===e||oo.isFunction(n.listener)&&n.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(oo.isObject(n)){for(o=r;o-- >0;)if(n[o]===e||n[o].listener&&n[o].listener===e){i=o;break}if(i<0)return this;1===n.length?(n.length=0,delete this._events[t]):n.splice(i,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},ao.prototype.removeAllListeners=function(t){var e,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[t],oo.isFunction(n))this.removeListener(t,n);else if(Array.isArray(n))for(;n.length;)this.removeListener(t,n[n.length-1]);return delete this._events[t],this},ao.prototype.listeners=function(t){return this._events&&this._events[t]?oo.isFunction(this._events[t])?[this._events[t]]:this._events[t].slice():[]},ao.listenerCount=function(t,e){return t._events&&t._events[e]?oo.isFunction(t._events[e])?1:t._events[e].length:0};var lo={mixin:t=>(Object.keys(so.prototype).forEach(e=>{t[e]=so.prototype[e]}),so.init(t),t)};function co(){let t=0,e=0,n=0,i=0;n=n||t;const r={move(t){this.moveTo(n+t)},moveTo(o){const a=Math.max(t,Math.min(e-i,o));n!==a&&(n=a,r.emit("update"))},update(o){let a=!1;var s=o.min;t=void 0===s?t:s;var l=o.max;e=void 0===l?e:l,void 0!==o.viewSize&&o.viewSize!==i&&(i=o.viewSize,a=!0);const c=Math.max(t,Math.min(e-i,n));n!==c&&(n=c,a=!0),a&&r.emit("update")},getState:()=>({min:t,max:e,start:n,viewSize:i})};return lo.mixin(r),r}function uo(t,e){const n=t.min||0,i=t.max||0,r=t.viewSize||0,o=e||co();return o.update({min:n,max:i,viewSize:r}),o}function ho(t,e){return t<=e}function fo(t,e){return t<e}function po(t,e,n){let i=0;for(;i<t.length&&e>t[i];)++i;return t[i]===e&&n&&++i,i}function go(){let t,e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=[];function r(){}return r.configure=function(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const i=n.includeMax,r=void 0===i||i,o=n.includeMin;t=r?ho:fo,e=void 0===o||o?ho:fo},r.add=t=>{let e=t.min,n=t.max;const r=po(i,e),o=po(i,n,!0),a=[r,o-r];r%2==0&&a.push(e),o%2==0&&a.push(n);const s=i.join(",");i.splice(...a);return s!==i.join(",")},r.remove=t=>{let e=t.min,n=t.max;const r=po(i,e),o=po(i,n,!0),a=[r,o-r];r%2==1&&a.push(e),o%2==1&&a.push(n);const s=i.join(",");i.splice(...a);return s!==i.join(",")},r.set=t=>{const e=i.join(",");i=[],Array.isArray(t)?t.forEach(r.add):r.add(t);return e!==i.join(",")},r.clear=()=>{const t=i.length>0;return i=[],t},r.containsValue=n=>function(t,e,n,i){const r=t.length;for(let o=1;o<r;o+=2)if(n(t[o-1],e)&&i(e,t[o]))return!0;return!1}(i,n,e,t),r.containsRange=t=>{let e=t.min,n=t.max;const r=po(i,e,!0),o=po(i,n);return r===o&&o%2==1},r.toggle=t=>r.containsRange(t)?r.remove(t):r.add(t),r.ranges=()=>{const t=[];for(let e=1;e<i.length;e+=2)t.push({min:i[e-1],max:i[e]});return t},r.configure(n),r}function mo(){let t=[];function e(){}return e.add=e=>-1===t.indexOf(e)&&(t.push(e),!0),e.remove=e=>{const n=t.indexOf(e);return-1!==n&&(t.splice(n,1),!0)},e.contains=e=>-1!==t.indexOf(e),e.values=()=>t.slice(),e.clear=()=>t=[],e.toString=()=>t.join(";"),e}const yo={key:void 0,includeMin:!0,includeMax:!0};function vo(t){let e=t.items,n=t.collection,i=t.vc;const r={},o=[];let a,s;for(let t=0,o=e.length;t<o;t++){a=e[t].key,n[a]||(n[a]=i()),s=e[t].values||[e[t].value];for(let t=0;t<s.length;t++)n[a].add(s[t])&&(r[a]=r[a]||[],r[a].push(s[t]))}const l=Object.keys(r);for(let t=0,e=l.length;t<e;t++)a=l[t],o.push({id:a,values:r[a]});return o}function xo(t){let e=t.items,n=t.collection;const i={},r=[];let o,a;for(let t=0,r=e.length;t<r;t++)if(o=e[t].key,n[o]){a=e[t].values||[e[t].value];for(let t=0;t<a.length;t++)n[o].remove(a[t])&&(i[o]=i[o]||[],i[o].push(a[t]))}const s=Object.keys(i);for(let t=0,e=s.length;t<e;t++)o=s[t],r.push({id:o,values:i[o]});return r}function bo(t){const e={};let n,i;for(let r=0,o=t.length;r<o;r++){n=t[r].key,i=t[r].values||[t[r].value],e[n]||(e[n]=[]);for(let t=0;t<i.length;t++){-1===e[n].indexOf(i[t])&&e[n].push(i[t])}}return e}function wo(t){let e=t.key,n=t.collection,i=t.obj,r=t.fn,o=t.value;n[e]||(n[e]=r()),i[e]=i[e]||[],i[e].push(o),n[e].add(o)}function ko(t,e){const n=[],i=Object.keys(t);let r,o;const a=t=>-1===e[r].indexOf(t);for(let s=0,l=i.length;s<l;s++)r=i[s],e[r]?(o=t[r].filter(a),o.length&&n.push({id:r,values:o})):n.push({id:r,values:t[r]});return n}function _o(t,e,n){const i=function(t,e){if(!Object.keys(e).length)return t;const n=t.length,i=Array(n);for(let r=0;r<n;r++)i[r]=t[r].key in e?u({},t[r],{key:e[t[r].key]}):t[r];return i}(e,n);return t&&t.length?t.reduce((t,e)=>e(t),i):i}function Mo(t){return t.replace(/(-[a-z])/g,t=>t.toUpperCase().replace("-",""))}function So(t){return t.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase()))}function Ro(t,e,n){let i=n.ranges,r=n.interceptors,o=n.rc,a=n.aliases,s=n.rangeConfig;const l=_o(r["".concat(e,"Ranges")],t,a);let c=!1;return l.forEach(t=>{const n=t.key;if(i[n]||(i[n]=o(s.sources[n]||s.default)),"set"===e)c=i[n][e](t.ranges||t.range)||c;else{const r=t.ranges||[t.range];for(let t=0;t<r.length;t++)c=i[n][e](r[t])||c}}),c}function Co(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.vc,n=void 0===e?mo:e,i=t.rc,r=void 0===i?go:i,o=!1,a={},s={},l={},c={sources:{},default:u({},yo)};const h={addValues:[],removeValues:[],toggleValues:[],setValues:[],addRanges:[],setRanges:[],removeRanges:[],toggleRanges:[]},d=()=>{const t={values:{},ranges:{}};return Object.keys(s).forEach(e=>{t.values[e]=s[e].values()}),Object.keys(a).forEach(e=>{t.ranges[e]=a[e].ranges()}),t},f={ls:[],clear(){this.ls.forEach(t=>t.clear())},start(){this.ls.forEach(t=>t.start())},end(){this.ls.forEach(t=>t.end())},update(){const t=d();this.ls.forEach(e=>e._state(t))},updateValues(){const t=d();this.ls.forEach(e=>e._state({values:t.values}))},updateRanges(){const t=d();this.ls.forEach(e=>e._state({ranges:t.ranges}))}},p={configure:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Array.isArray(t.ranges)&&t.ranges.length&&(c={sources:{},default:u({},yo)},t.ranges.forEach(t=>{const e={};Object.keys(yo).filter(t=>"key"!==t).forEach(n=>{e[n]=void 0!==t[n]?t[n]:yo[n]}),void 0!==t.key?c.sources[t.key]=e:c.default=e}),Object.keys(a).forEach(t=>a[t].configure(c.sources[t]||c.default)),p.emit("update",[],[]))},link:t=>{if(p===t)throw new Error("Can't link to self");f.ls.push(t),t._state(d())},_state:t=>{if(!t)return d();if(t.values){const e=[];Object.keys(t.values).forEach(n=>{s[n]&&t.values[n].join(";")===s[n].toString()||e.push({key:n,values:t.values[n]})}),Object.keys(s).forEach(n=>{t.values[n]||e.push({key:n,values:[]})}),e.length&&p.setValues(e)}if(t.ranges){const e=[];Object.keys(t.ranges).forEach(n=>{a[n]&&t.ranges[n].join(";")===a[n].toString()||e.push({key:n,ranges:t.ranges[n]})}),Object.keys(a).forEach(n=>{t.ranges[n]||e.push({key:n,ranges:[]})}),e.length&&p.setRanges(e)}},start:function(){if(!o){o=!0;for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];p.emit("start",...e),f.start()}},end:function(){if(o){o=!1,a={},s={};for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];p.emit("end",...e),f.end()}},isActive:()=>o,clear:()=>{const t=p.brushes().filter(t=>"value"===t.type&&t.brush.values().length).map(t=>({id:t.id,values:t.brush.values()})),e=Object.keys(a).length>0||t.length;a={},s={},e&&(p.emit("update",[],t),f.clear())},brushes:()=>{let t=[];return t=t.concat(Object.keys(a).map(t=>({type:"range",id:t,brush:a[t]}))),t=t.concat(Object.keys(s).map(t=>({type:"value",id:t,brush:s[t]}))),t},addValue:(t,e)=>{p.addValues([{key:t,value:e}])},addValues:t=>{const e=_o(h.addValues,t,l),i=vo({vc:n,collection:s,items:e});p.emit("add-values",e),i.length&&(o||(o=!0,p.emit("start")),p.emit("update",i,[]),f.updateValues())}};return p.setValues=t=>{const e=_o(h.setValues,t,l),i=function(t){let e=t.items,n=t.vCollection,i=t.vc;const r={},o=bo(e);let a,s=[],l=[];const c={},u=Object.keys(n);for(let t=0,e=u.length;t<e;t++)a=u[t],c[a]=n[a].values().slice(),delete n[a];const h=t=>{n[a]&&n[a].contains(t)||wo({key:a,value:t,collection:n,obj:r,fn:i})},d=Object.keys(o);for(let t=0,e=d.length;t<e;t++)a=d[t],o[a].forEach(h);return l=ko(c,r),s=ko(r,c),[s,l]}({items:e,vCollection:s,vc:n});p.emit("set-values",e),(i[0].length>0||i[1].length>0)&&(o||(o=!0,p.emit("start")),p.emit("update",i[0],i[1]),f.updateValues())},p.removeValue=(t,e)=>{p.removeValues([{key:t,value:e}])},p.removeValues=t=>{const e=_o(h.removeValues,t,l),n=xo({collection:s,items:e});p.emit("remove-values",e),n.length&&(p.emit("update",[],n),f.updateValues())},p.addAndRemoveValues=(t,e)=>{const i=_o(h.addValues,t,l),r=_o(h.removeValues,e,l),a=vo({vc:n,collection:s,items:i}),c=xo({collection:s,items:r});p.emit("add-values",i),p.emit("remove-values",r),(a.length||c.length)&&(o||(o=!0,p.emit("start")),p.emit("update",a,c),f.updateValues())},p.toggleValue=(t,e)=>{p.toggleValues([{key:t,value:e}])},p.toggleValues=t=>{const e=_o(h.toggleValues,t,l),i=function(t){let e=t.items,n=t.values,i=t.vc;const r={},o={},a=[],s=[],l=bo(e);let c,u,h;const d=Object.keys(l);for(let t=0,e=d.length;t<e;t++){c=d[t],h=l[c];for(let t=0,e=h.length;t<e;t++)u=h[t],n[c]&&n[c].contains(u)?n[c]&&n[c].contains(u)&&(o[c]=o[c]||[],o[c].push(u),n[c].remove(u)):wo({key:c,value:u,collection:n,obj:r,fn:i})}const f=Object.keys(r);for(let t=0,e=f.length;t<e;t++)c=f[t],a.push({id:c,values:r[c]});const p=Object.keys(o);for(let t=0,e=p.length;t<e;t++)c=p[t],s.push({id:c,values:o[c]});return[a,s]}({items:e,values:s,vc:n});p.emit("toggle-values",e),(i[0].length>0||i[1].length>0)&&(o||(o=!0,p.emit("start")),p.emit("update",i[0],i[1]),f.updateValues())},p.containsValue=(t,e)=>{let n=l[t]||t;return!!s[n]&&s[n].contains(e)},p.addRange=(t,e)=>{p.addRanges([{key:t,range:e}])},p.addRanges=t=>{Ro(t,"add",{ranges:a,rc:r,interceptors:h,aliases:l,rangeConfig:c})&&(o||(o=!0,p.emit("start")),p.emit("update",[],[]),f.updateRanges())},p.removeRange=(t,e)=>{p.removeRanges([{key:t,range:e}])},p.removeRanges=t=>{Ro(t,"remove",{ranges:a,rc:r,interceptors:h,aliases:l,rangeConfig:c})&&(o||(o=!0,p.emit("start")),p.emit("update",[],[]),f.updateRanges())},p.setRange=(t,e)=>{p.setRanges([{key:t,range:e}])},p.setRanges=t=>{Ro(t,"set",{ranges:a,rc:r,interceptors:h,aliases:l,rangeConfig:c})&&(o||(o=!0,p.emit("start")),p.emit("update",[],[]),f.updateRanges())},p.toggleRange=(t,e)=>{p.toggleRanges([{key:t,range:e}])},p.toggleRanges=t=>{Ro(t,"toggle",{ranges:a,rc:r,interceptors:h,aliases:l,rangeConfig:c})&&(o||(o=!0,p.emit("start")),p.emit("update",[],[]),f.updateRanges())},p.containsRangeValue=(t,e)=>{let n=l[t]||t;return!!a[n]&&a[n].containsValue(e)},p.containsRange=(t,e)=>{let n=l[t]||t;return!!a[n]&&a[n].containsRange(e)},p.containsMappedData=(t,e,n)=>{let i=[];const r=Object.keys(t);let o,c,u,h;for(let e=0,n=r.length;e<n;e++){if(o=r[e],"value"===o)c=t,i[e]={key:"",i:e,bool:!1};else{if("source"===o)continue;c=t[o],i[e]={key:o,i:e,bool:!1}}u=c.source&&c.source.field,void 0!==u&&(void 0!==c.source.key&&(u="".concat(c.source.key,"/").concat(u)),u in l&&(u=l[u]),h=c.value,a[u]?i[e].bool=Array.isArray(h)?a[u].containsRange({min:h[0],max:h[1]}):a[u].containsValue(h):s[u]&&s[u].contains(h)&&(i[e].bool=!0))}return e?(i=i.filter(t=>-1!==e.indexOf(t.key)),"and"===n?!!i.length&&!i.some(t=>!1===t.bool):"xor"===n?!!i.length&&i.some(t=>t.bool)&&i.some(t=>!1===t.bool):i.some(t=>t.bool)):i.some(t=>t.bool)},p.intercept=(t,e)=>{const n=Mo(t);h[n]&&h[n].push(e)},p.removeInterceptor=(t,e)=>{const n=Mo(t);if(!h[n])return;const i=h[n].indexOf(e);-1!==i&&h[n].splice(i,1)},p.removeAllInterceptors=t=>{const e=[];if(t){const n=Mo(t);h[n]&&h[n].length&&e.push({name:t,handlers:h[n]})}else Object.keys(h).forEach(t=>{h[t].length&&e.push({name:So(t),handlers:h[t]})});e.forEach(t=>{t.handlers.slice().forEach(e=>p.removeInterceptor(t.name,e))})},p.addKeyAlias=(t,e)=>{l[t]=e},p.removeKeyAlias=t=>{delete l[t]},lo.mixin(p),p}function No(t){return t*t*t}function Do(t){return--t*t*t+1}function qo(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}Et();const Eo=["stroke","fill","color","backgroundColor","thumbColor"];function Oo(t,e){const n=e?e.length:0,i=t?Math.min(n,t.length):0,r=new Array(i),o=new Array(n);let a;for(a=0;a<i;++a)r[a]=Ao(t[a],e[a]);for(;a<n;++a)o[a]=e[a];return function(t){for(a=0;a<i;++a)o[a]=r[a](t);return o}}function Ao(t,e,n){const i=typeof e;let r;return null==e||"boolean"===i?function(t){return()=>t}(e):("number"===i?hr:"string"===i?(r=Bi(e))&&Eo.includes(n)?(e=r,sr):gr:e instanceof Bi?sr:e instanceof Date?ur:function(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}(e)?lr:Array.isArray(e)?Oo:"function"!=typeof e.valueOf&&"function"!=typeof e.toString||isNaN(e)?zo:hr)(t,e)}function zo(t,e){const n={},i={};let r;for(r in null!==t&&"object"==typeof t||(t={}),null!==e&&"object"==typeof e||(e={}),e)r in t?n[r]=Ao(t[r],e[r],r):i[r]=e[r];return function(t){for(r in n)i[r]=n[r](t);return i}}function To(t,e){return t.data?t.data.value:"text"===t.type?t.text:e}const Io={fontFamily:"Arial",fontSize:"13px",color:"#595959",backgroundColor:"#ffffff",stroke:"#000000",strokeWidth:0,$fill:"#333333"},jo=/^\$/;function Po(t){const e=typeof t;return"object"!==e&&"function"!==e&&"undefined"!==e}function Fo(t,e,n){const i=t[e];i&&i.scale&&i.scale.pxScale?i.scale=i.scale.pxScale(n):i&&i.pxScale&&(t[e]=i.pxScale(n))}function Lo(t,e){return t.pxScale?t.pxScale(e):t}const $o={normalizeSettings:function(t,e,n){const i=u({},t),r=u({},e);return Object.keys(i).forEach(t=>{r[t]={};const o=i[t],a=typeof o;if("function"==typeof o)r[t].fn=o;else if(Po(o)){let n=e[t];"string"==typeof n&&jo.test(n)&&(n=Io[n]);const i=typeof n;r[t]="undefined"===i||i===a?o:n}else o&&"object"==typeof o&&("function"==typeof o.fn&&(r[t].fn=o.fn),void 0!==o.scale&&(r[t].scale=n.scale(o.scale)),"string"==typeof o.ref&&(r[t].ref=o.ref))}),Object.keys(e).forEach(t=>{if(t in i)return;const n=e[t];"string"===typeof n&&jo.test(n)?r[t]=Io[n]:r[t]=n}),r},resolveForItem:function(t,e,n){const i={},r=Object.keys(e),o=r.length,a=t.datum,s=t.datum;for(let l=0;l<o;l++){const o=r[l],c=e[o],u="object"==typeof s&&void 0!==c,h=u&&"string"==typeof c.ref,d=u&&o in s,f=h?s[c.ref]:d?s[o]:a;Po(c)?i[o]=c:u&&c.fn?(c.scale&&(t.scale=c.scale),i[o]=c.fn.call(null,t,n)):u&&c.scale&&f?(i[o]=c.scale(f.value),c.scale.bandwidth&&(i[o]+=c.scale.bandwidth()/2)):h&&f?i[o]=f.value:c.fn?i[o]=c.fn.call(null,t,n):i[o]=c}return i},updateScaleSize:Fo};function Bo(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).reduce((t,e)=>Array.isArray(e.children)?(t.push(...Bo(e.children)),t):(t.push(e),t),[])}function Ho(t,e){let n=e.context,i=e.data,r=e.style,o=e.filter,a=e.mode;const s=t.chart.brush(n),l=i,c=r.active||{},h=r.inactive||{},d=[];Object.keys(c).forEach(t=>{d.push(t)}),Object.keys(h).forEach(t=>{-1===d.indexOf(t)&&d.push(t)});const f=[];let p=!1;const g=()=>{let e=Bo(t.nodes);return"function"==typeof o&&(e=e.filter(o)),e},m=()=>{const t=g(),e=t.length;let n,i=!1;const r="function"==typeof l?l({brush:s}):l;for(let i=0;i<e;i++){if(n=t[i].data,!n)continue;t[i].__style||(t[i].__style={},d.forEach(e=>{t[i].__style[e]=t[i][e]}));const e=s.containsMappedData(n,r,a),o=f.indexOf(t[i]);let l=!1;e&&-1===o?(f.push(t[i]),l=!0):e||-1===o||(f.splice(o,1),l=!0),t[i].needToUpdate=l||p,t[i].isActive=e}for(let r=0;r<e;r++)if(n=t[r].data,n){if(t[r].needToUpdate){const e=u({},t[r],t[r].__style),n=t[r].isActive;d.forEach(i=>{t[r][i]=n&&i in c?"function"==typeof c[i]?c[i].call(null,e,f):c[i]:!n&&i in h?"function"==typeof h[i]?h[i].call(null,e,f):h[i]:t[r].__style[i]}),i=!0}delete t[r].needToUpdate}return p=!1,i},y=function(){const e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{suppressRender:!1}).suppressRender,n=g(),i=n.length;for(let t=0;t<i;t++)n[t].data&&(n[t].__style=n[t].__style||{},d.forEach(e=>{n[t].__style[e]=n[t][e],e in h&&(n[t][e]="function"==typeof h[e]?h[e].call(null,n[t]):h[e])}));p=!0,f.length=0,e||t.renderer.render(t.nodes)},v=function(){const e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{suppressRender:!1}).suppressRender,n=g(),i=n.length;for(let t=0;t<i;t++)n[t].__style&&(Object.keys(n[t].__style).forEach(e=>{n[t][e]=n[t].__style[e]}),n[t].__style=void 0);f.length=0,e||t.renderer.render(t.nodes)},x=()=>{if(m()){const e="function"==typeof t.config.sortNodes?t.config.sortNodes(t):t.nodes;"function"==typeof t.config.customRender?t.config.customRender({render:t.renderer.render,nodes:e}):t.renderer.render(e)}};return s.on("start",y),s.on("end",v),s.on("update",x),{isActive:()=>s.isActive(),update:()=>{f.length=0,p=!0,m()},cleanUp:function(){s.removeListener("start",y),s.removeListener("end",v),s.removeListener("update",x)}}}function Wo(t){let e=t.nodes,n=t.action,i=t.chart,r=t.trigger;const o=[];for(let t=0;t<e.length;t++){let n=e[t].data;null!==n&&o.push(n)}!function(t){let e=t.dataPoints,n=t.action,i=t.chart,r=t.trigger;if(!r)return;const o=r.data||[""];let a={items:[],actionFn:"toggleRanges"},s={items:[],actionFn:"toggleValues"};-1!==["add","remove","set","toggle"].indexOf(n)&&(a.actionFn="".concat(n,"Ranges"),s.actionFn="".concat(n,"Values"));for(let t=0;t<e.length;t++){const n=e[t];n&&o.forEach(t=>{let e=n&&!t?n:n[t];if(e){let t={key:e.source.field};void 0!==e.source.key&&(t.key="".concat(e.source.key,"/").concat(e.source.field)),Array.isArray(e.value)?(t.range={min:e.value[0],max:e.value[1]},a.items.push(t)):(t.value=e.value,s.items.push(t))}})}r.contexts.forEach(t=>{a.items.length?i.brush(t)[a.actionFn](a.items):i.brush(t)[s.actionFn](s.items)})}({dataPoints:o,action:n,chart:i,trigger:r})}function Vo(t){let e=t.collisions,n=t.t,i=t.config,r=t.action,o=[],a=!1;e.length>0&&(o=e,a=!0,"stop"===n.propagation&&(o=[e[e.length-1]]));const s=o.map(t=>t.node);return Wo({nodes:s,action:r,chart:i.chart,data:i.data,trigger:n}),a}function Uo(t,e,n){const i=n.element().getBoundingClientRect();let r=y(t)?function(t,e){return 1!==t.changedTouches.length?null:{x:t.changedTouches[0].clientX-e.left,y:t.changedTouches[0].clientY-e.top}}(t,i):function(t,e){return{x:t.clientX-e.left,y:t.clientY-e.top}}(t,i);return null===r||r.x<0||r.y<0||r.x>i.width||r.y>i.height?[]:(e.touchRadius>0&&y(t)?r={cx:r.x,cy:r.y,r:e.touchRadius}:e.mouseRadius>0&&!y(t)&&(r={cx:r.x,cy:r.y,r:e.mouseRadius}),n.itemsAt(r))}function Yo(t,e,n){return t?"function"==typeof t?t(e):t:n}const Ko={fill:"fill",stroke:"stroke",opacity:"opacity",strokeWidth:"stroke-width",strokeLinejoin:"stroke-linejoin",fontFamily:"font-family",fontSize:"font-size",fontStyle:"font-style",textDecoration:"text-decoration",fontWeight:"font-weight",baseline:"dominant-baseline",dominantBaseline:"dominant-baseline",anchor:"text-anchor",textAnchor:"text-anchor",maxWidth:"maxWidth",transform:"transform",strokeDasharray:"stroke-dasharray",id:"id"};function Go(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n="";for(let e=0;e<t.length;e++){const i=t[e];n+=0===e?"M".concat(i.x," ").concat(i.y):"L".concat(i.x," ").concat(i.y),n+=" "}return e&&(n+="Z"),n}function Xo(t,e,n,i){const r=n/2,o=t-i/2,a=e-i/2,s=t-r,l=e-r;return[{x:o,y:a},{x:o,y:l},{x:o+i,y:l},{x:o+i,y:a},{x:s+n,y:a},{x:s+n,y:a+i},{x:o+i,y:a+i},{x:o+i,y:l+n},{x:o,y:l+n},{x:o,y:a+i},{x:s,y:a+i},{x:s,y:a}]}function Jo(t){return-t/180*Math.PI}function Zo(t){return function(t){let e=(.5*(Math.floor(t/Math.PI*2)+2)+.25)*Math.PI,n=Math.cos(Math.abs(e-t))*Math.sqrt(2),i=n*Math.cos(t),r=n*Math.sin(t);return{x1:i<0?1:0,y1:r<0?1:0,x2:i>=0?i:i+1,y2:r>=0?r:r+1}}(Jo(t))}function Qo(t,e){return{x:t.x+e.x,y:t.y+e.y}}function ta(t,e){return{x:t.x-e.x,y:t.y-e.y}}function ea(t,e){return{x:t.x*e,y:t.y*e}}function na(t,e){return t.x-e.x}function ia(t,e){return t.y-e.y}function ra(t,e){return na(t,e)**2+ia(t,e)**2}function oa(t,e){return Math.sqrt(ra(t,e))}function aa(t,e){return t.x*e.x+t.y*e.y}function sa(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{x:0,y:0};const i=Math.cos(e),r=Math.sin(e),o=ta(t,n);return Qo({x:i*o.x-r*o.y,y:r*o.x+i*o.y},n)}const la={up:0,down:180,left:90,right:-90};function ca(t){let e=t.x,n=t.y,i=t.size;const r=i/2;return{type:"rect",x:e-r,y:n-r,width:i,height:i}}const ua=Et();ua.add("circle",function(t){return{type:"circle",fill:"black",cx:t.x,cy:t.y,r:t.size/2}}),ua.add("diamond",function(t){const e=t.size,n=t.x-e/2,i=t.y-e/2;return{type:"path",fill:"black",d:Go([{x:n,y:i+e/2},{x:n+e/2,y:i},{x:n+e,y:i+e/2},{x:n+e/2,y:i+e},{x:n,y:i+e/2}])}}),ua.add("saltire",function(t){const e=Jo(45),n=t.size/2,i=isNaN(t.width)?n/2:t.width,r=Math.min(i,n);let o=t.size;const a=Math.sin(Math.asin(-e))*(r/2);o+=2*(n/Math.sin(-e)-n),o-=2*a;const s={x:t.x,y:t.y},l=Xo(t.x,t.y,o,r).map(t=>sa(t,e,s));return{type:"path",fill:"black",d:Go(l)}}),ua.add("square",function(t){const e=t.size;return{type:"rect",fill:"black",x:t.x-e/2,y:t.y-e/2,width:e,height:e}}),ua.add("triangle",function(t){const e=t.size,n={x:t.x,y:t.y},i=la[t.direction]||0,r=e/2,o=t.x-r,a=t.y-r;let s=[{x:o,y:a+e},{x:o+r,y:a},{x:o+e,y:a+e},{x:o,y:a+e}];const l=Jo(i);return s=s.map(t=>sa(t,l,n)),{type:"path",fill:"black",d:Go(s)}}),ua.add("line",function(t){const e="vertical"===t.direction,n=t.size/2,i=t.x,r=t.y;return{type:"line",stroke:"black",strokeWidth:1,x1:i-(e?0:n),y1:r-(e?n:0),x2:i+(e?0:n),y2:r+(e?n:0),collider:ca(t)}}),ua.add("star",function(t){const e=t.size,n=[],i=e/2,r=t.points||5,o=Math.min(t.innerRadius||e/2,e)/2,a=isNaN(t.startAngle)?90:t.startAngle,s=360/r;for(let e=1;e<=r;e++){const r=s*e+a,l=Jo(r),c=Jo(r+s/2),u=Math.sin(l),h=Math.cos(l),d=Math.sin(c),f=Math.cos(c);n.push({x:t.x+h*i,y:t.y+u*i}),n.push({x:t.x+f*o,y:t.y+d*o})}return{type:"path",fill:"black",d:Go(n)}}),ua.add("n-polygon",function(t){const e=[],n=t.size/2,i=Math.max(isNaN(t.sides)?6:t.sides,3),r=360/i,o=isNaN(t.startAngle)?0:t.startAngle;for(let a=1;a<=i;a++){const i=Jo(r*a+o),s=Math.sin(i),l=Math.cos(i);e.push({x:t.x+l*n,y:t.y+s*n})}return{type:"path",fill:"black",d:Go(e)}}),ua.add("cross",function(t){const e=t.x,n=t.y,i=t.size/2,r=isNaN(t.width)?i/2:t.width,o=Math.min(r,i);return{type:"path",fill:"black",d:Go(Xo(e,n,t.size,o))}}),ua.add("bar",function(t){const e={x:t.x,y:t.y},n="vertical"===t.direction,i=t.size/2,r=i/2/2;let o=[{x:e.x-i,y:e.y+r},{x:e.x-i,y:e.y-r},{x:e.x+i,y:e.y-r},{x:e.x+i,y:e.y+r}];if(n){const t=Jo(90);o=o.map(n=>sa(n,t,e))}const a=_(o);return a.type="rect",a.fill="black",a}),ua.add("rect",function(t){const e=t.x,n=t.y,i=t.size,r=void 0===t.width?i:t.width,o=void 0===t.height?i:t.height;return{type:"rect",fill:"black",x:e-r/2,y:n-o/2,width:r,height:o}}),ua.add("image",function(t){const e=t.x,n=t.y,i=t.imageSettings||{},r=i.width,o=i.height,a=i.imageSrc,s=i.position;return{type:"image",x:e,y:n,width:r,height:o,src:a,symbol:i.symbol,r:10,cx:0,cy:0,imageScalingFactor:i.imageScalingFactor,imagePosition:s}});const ha=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ua;return function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const n=t.get(e.type);if(n){const t=n(e);return function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object.keys(e).forEach(n=>{void 0!==Ko[n]&&"transform"!==n&&(t[n]=e[n])})}(t,e),void 0!==e.data&&(t.data=e.data),t}return n}};function da(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.dock,i=void 0===n?"center":n,r=t.displayOrder,o=void 0===r?0:r,a=t.prioOrder,s=void 0===a?0:a,l=t.preferredSize,c=void 0===l?0:l,u=t.minimumLayoutMode,h=t.show,d=void 0===h||h;i=i||"center";return{computePreferredSize(t){let n=t.inner,i=t.outer,r=t.children;return"function"==typeof c?c({inner:n,outer:i,children:r,dock:this.dock()},e):c},dock(t){return void 0!==t?(i=t,this):"function"==typeof i?i(e):i},displayOrder(t){return void 0!==t?(o=t,this):"function"==typeof o?o(e):o},prioOrder(t){return void 0!==t?(s=t,this):"function"==typeof s?s(e):s},minimumLayoutMode(t){return void 0!==t?(u=t,this):"function"==typeof u?u(e):u},show(t){return void 0!==t?(d=t,this):"function"==typeof d?d(e):d}}}function fa(t,e,n){const i=e.require,r=void 0===i?[]:i,o=e.mediator||{},a=n.settings,s=n.formatter,l=n.scale,c=n.data,u=n.renderer,h=n.chart,d=n.dockConfig,f=n.mediator,p=n.instance,g=n.rect,m=n.style,y=n.registries,v=n.resolver,x=n.update,b=n._DO_NOT_USE_getInfo,w=n.symbol,k=n.isVisible;t.emit=()=>{},k&&(t.isVisible=k),Object.defineProperty(t,"settings",{get:a}),Object.defineProperty(t,"data",{get:c}),Object.defineProperty(t,"formatter",{get:s}),Object.defineProperty(t,"scale",{get:l}),Object.defineProperty(t,"mediator",{get:f}),Object.defineProperty(t,"style",{get:m}),Object.defineProperty(t,"registries",{get:y}),g&&Object.defineProperty(t,"rect",{get:g}),b&&(t._DO_NOT_USE_getInfo=b),Object.keys(e).forEach(n=>{var i;i=n,["on","preferredSize","created","beforeMount","mounted","resize","beforeUpdate","updated","beforeRender","render","beforeUnmount","beforeDestroy","destroyed","defaultSettings","data","settings","formatter","scale","chart","dockConfig","mediator","style","resolver","registries","_DO_NOT_USE_getInfo","symbol","isVisible"].some(t=>t===i)||("function"==typeof e[n]?t[n]=e[n].bind(t):t[n]=e[n])}),r.forEach(e=>{"renderer"===e?Object.defineProperty(t,"renderer",{get:u}):"chart"===e?Object.defineProperty(t,"chart",{get:h}):"dockConfig"===e?Object.defineProperty(t,"dockConfig",{get:d}):"instance"===e?Object.defineProperty(t,"instance",{get:p}):"update"===e&&x?Object.defineProperty(t,"update",{get:x}):"resolver"===e?Object.defineProperty(t,"resolver",{get:v}):"symbol"===e&&Object.defineProperty(t,"symbol",{get:w})}),Object.keys(o).forEach(e=>{t.mediator.on(e,o[e].bind(t))})}function pa(t,e,n){const i=e=>t[e]?(n.warn("Deprecation Warning the ".concat(e," property should be moved into layout: {} property")),t[e]):t.layout?t.layout[e]:void 0,r={};return r.displayOrder=i("displayOrder"),r.dock=i("dock"),r.prioOrder=i("prioOrder"),r.minimumLayoutMode=i("minimumLayoutMode"),t.layout=t.layout||{},t.layout.displayOrder=void 0!==r.displayOrder?r.displayOrder:t.layout.displayOrder,t.layout.prioOrder=void 0!==r.prioOrder?r.prioOrder:t.layout.prioOrder,t.layout.dock=r.dock||t.layout.dock,t.layout.minimumLayoutMode=r.minimumLayoutMode||t.layout.minimumLayoutMode,r.show=t.show,r.preferredSize=e,r}function ga(t,e,n){Object.keys(n.on||{}).forEach(i=>{t.eventListeners=t.eventListeners||[];const r=n.on[i].bind(t);t.eventListeners.push({event:i,listener:r}),e.on(i,r)}),t.emit=function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return e.emit(t,...i)}}function ma(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=t.defaultSettings,i=void 0===n?{}:n,r=t._DO_NOT_USE_getInfo,o=void 0===r?()=>({}):r,a=e.chart,s=e.container,l=e.mediator,c=e.registries,h=e.theme,d=e.renderer,f=lo.mixin({});let p,m,y,v,x,b=e.settings||{},w=u(!0,{},i,b),k=[],_=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:$o,n={};return{resolve:function(i){let r=i.data,o=i.settings,a=i.defaults,s=void 0===a?{}:a,l=i.scaled;const c=n.norm=e.normalizeSettings(o,s,t.chart),u={scale:t.chart.scale,formatter:t.chart.formatter};l&&Object.keys(l).forEach(t=>{c[t]&&e.updateScaleSize(c,t,l[t])});const h=[];if(!r||!Array.isArray(r.items)){const t={data:r,resources:u};let i=e.resolveForItem(t,n.norm,-1);return{settings:n.norm,item:i}}{let t;for(let i=0,o=r.items.length;i<o;i++){t={datum:r.items[i],data:r,resources:u};let o=e.resolveForItem(t,n.norm,i);o.data=r.items[i],h.push(o)}}return{settings:n.norm,items:h}}}}({chart:a}),M=!1;const S={nodes:[],chart:a,config:w.brush||{},renderer:null},R={tap:[],over:[]},C=[],N={},D=u({},b);function q(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{},i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(){const r=void 0!==t[e],o=void 0!==b[e];let a;for(var s=arguments.length,l=new Array(s),c=0;c<s;c++)l[c]=arguments[c];return r&&("function"==typeof t[e]?a=t[e].call(N,...l):i&&(a=t[e])),o&&("function"==typeof b[e]?a=b[e].call(D,...l):i&&(a=b[e])),r||o||(a=n.call(N,...l)),a}}const E=q("preferredSize",()=>0,!0),O=q("resize",t=>t.inner),A=q("created"),z=q("beforeMount"),T=q("mounted"),I=q("beforeUnmount"),j=q("beforeUpdate"),P=q("updated"),F=q("beforeRender"),L=q("beforeDestroy"),$=q("destroyed"),B=t.render,H=()=>{w.brush&&(w.brush.consume||[]).forEach(t=>{t.context&&t.style&&C.push(Ho(S,t))})},W=()=>{w.brush&&(w.brush.trigger||[]).forEach(t=>{"over"===t.on?R.over.push(t):R.tap.push(t)})};Object.defineProperty(S,"data",{get:()=>k});const V=w.renderer||t.renderer,U=V?d||c.renderer(V)():d||c.renderer()();"function"==typeof U.settings&&U.settings(w.rendererSettings),S.renderer=U;const Y={resources:a.logger?{logger:a.logger()}:{}};let K=da(pa(w,E,a.logger()),Y);const G=t=>{t.key=w.key,t.element=U.element()},X=()=>{};X.dockConfig=()=>K,X.set=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(t.settings&&(b=t.settings,w=u(!0,{},i,t.settings),K=da(pa(w,E,a.logger()),Y),S.config=w.brush||{}),w.scale&&(p=a.scale(w.scale)),w.data){const t=w.rendererSettings,e="function"==typeof(null==t?void 0:t.progressive)&&t.progressive(),n=vi(w.data,{dataset:a.dataset,collection:a.dataCollection},{logger:a.logger()},a.dataCollection);e?e.isFirst?(k=n,k.items&&(k.items=[...n.items])):k.items&&(k.items=[...k.items,...n.items||[]]):k=n}else k=p?p.data():[];"string"==typeof w.formatter||"object"==typeof w.formatter?m=a.formatter(w.formatter):p&&p.data().fields&&(m=p.data().fields[0].formatter()),x=h.style(w.style||{})},X.resize=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=O({inner:t,outer:e});v=n?U.size(n):U.size(t),D.rect=u(!0,{computedPhysical:v.computedPhysical,computedOuter:e.computed||e,computedInner:t.computed||t},t),v=u(!0,{computedOuter:e.computed||e,computedInner:t.computed||t},v)},X.getRect=()=>D.rect;const J=()=>{const t=U.renderArgs?U.renderArgs.slice(0):[],e=w.rendererSettings;let n=k;const i="function"==typeof(null==e?void 0:e.progressive)&&e.progressive();return k.items&&i&&(n=g(g({},k),{},{items:k.items.slice(i.start,i.end)})),t.push({data:n}),t};let Z,Q,tt;function et(t){const e=w.rendererSettings,n="function"==typeof(null==e?void 0:e.progressive)&&e.progressive();n?n.isFirst?S.nodes=[...t||[]]:S.nodes&&(S.nodes=[...S.nodes,...t||[]]):S.nodes=t}X.beforeMount=z,X.beforeRender=()=>{F({size:v})},X.render=()=>{const t=B.call(N,...J());et(t),U.render(t),Z=t,Q=D.rect.computed},X.hide=()=>{X.unmount(),U.size({x:0,y:0,width:0,height:0}),U.clear()},X.beforeUpdate=()=>{j({settings:w,data:k})},X.update=()=>{tt&&tt.stop();const t=w,e=t.rendererSettings,n=t.brush,i=t.animations;if("function"==typeof(null==e?void 0:e.transform)&&e.transform())return U.render(),void(Z=null);const r=B.call(N,...J());et(r),C.forEach(t=>t.cleanUp()),C.length=0,R.tap=[],R.over=[],n&&(H(),W()),C.forEach(t=>{t.isActive()&&t.update()}),Z&&i&&("function"==typeof i.enabled?i.enabled():i.enabled)?(i.compensateForLayoutChanges&&i.compensateForLayoutChanges({currentNodes:Z,currentRect:D.rect.computed,previousRect:Q}),tt=function(t,e,n,i){let r,o=t.old,a=t.current,s=e.renderer,l=[],c={nodes:[],ips:[]},h={nodes:[],ips:[]},d={nodes:[],ips:[]},f=[],p=null;const g=n.trackBy||To,m={start(){let t={};if(o.forEach((e,n)=>{let i=g(e,n);t[i]=e}),a.forEach((e,n)=>{let i=g(e,n);if(t[i]){if("path"===e.type&&e.points&&e.points.length>0&&"trend"!==e.data.source.key){const n=function(t,e){const n=t.points.filter(t=>!t.dummy),i=e.points.filter(t=>!t.dummy),r=i.map(t=>t.data.major.value),o=n.filter(t=>r.includes(t.data.major.value)).map(t=>t.data.major.value),a=n.filter(t=>o.includes(t.data.major.value)),s=i.filter(t=>o.includes(t.data.major.value));return{old:a,current:s}}(t[i],e);d.ips.push(zo(u({},t[i],{points:n.old}),u({},e,{points:n.current}))),l.push(u({},t[i],{commonPoints:n.old}))}else d.ips.push(zo(t[i],e)),l.push(t[i]);d.nodes.push(e),t[i]=!1}else c.nodes.push(e),c.ips.push(zo(u({},e,{r:.001,opacity:0}),e))}),Object.keys(t).forEach(e=>{t[e]&&(h.nodes.push(t[e]),h.ips.push(zo(t[e],u({},t[e],{r:1e-4,opacity:0}))))}),f.push({name:"exiting",easing:No,duration:200,tweens:h.ips,nodes:[...l]}),f.push({name:"updating",easing:qo,duration:400,tweens:d.ips,nodes:[]}),f.push({name:"entering",easing:Do,duration:200,tweens:c.ips,nodes:[...d.nodes]}),n.isMainComponent){var e;const t=null===(e=n.isMainComponent)||void 0===e?void 0:e.filterFn,r=t?l.filter(t).length:l.length,o=i.getValue("animations.updatingStageMeta"),a=o.isInit,s=o.shouldBeRemoved;!1===a?(i.setValue("animations.updatingStageMeta.shouldBeRemoved",0===r),i.setValue("animations.updatingStageMeta.isInit",!0)):i.setValue("animations.updatingStageMeta.shouldBeRemoved",s&&0===r)}f.length&&(p=s.getScene(a),f[0].started=Date.now(),"undefined"!=typeof window&&(r=window.requestAnimationFrame(m.tick)))},tick(){let t=f[0];t||m.stop(),t.started||(t.started=Date.now());let e=(Date.now()-t.started)/t.duration,o=[],a=t.tweens.map(n=>n(t.easing(Math.min(1,e))));const l=n.adjustTweenedNodes;if(l&&l(a),o.push(...a),o.push(...t.nodes),s.render(o),e>=1){f.shift();const t=i.getValue("animations.updatingStageMeta"),e=t.isInit,n=t.shouldBeRemoved;f.length?"updating"===f[0].name&&n&&f.shift():(!0===e&&i.setValue("animations.updatingStageMeta.isInit",!1),m.stop())}r&&(r=window.requestAnimationFrame(m.tick))},stop(){r&&(window.cancelAnimationFrame(r),r=!1)},inProgress:()=>!!r,get targetScene(){return p}};return m}({old:Z,current:r},{renderer:U},i,a.storage),tt.start()):U.render(r),Z=r,Q=D.rect.computed,U.setKey&&"string"==typeof b.key&&U.setKey(b.key)},X.updated=P,X.destroy=()=>{X.unmount(),L(y),U.destroy(),$(),y=null};const nt=t=>{S.nodes=t,C.forEach(t=>{t.isActive()&&t.update()}),U.render(t)};return fa(N,t,{settings:()=>w,data:()=>k,scale:()=>p,formatter:()=>m,renderer:()=>U,chart:()=>a,dockConfig:()=>K,mediator:()=>l,instance:()=>D,rect:()=>D.rect,style:()=>x,update:()=>nt,registries:()=>c,resolver:()=>_,symbol:()=>ha(c.symbol)}),fa(D,b,{settings:()=>w,data:()=>k,scale:()=>p,formatter:()=>m,renderer:()=>U,chart:()=>a,dockConfig:()=>K,mediator:()=>l,style:()=>x,_DO_NOT_USE_getInfo:o.bind(N),isVisible:()=>M}),X.getBrushedShapes=function(t,e,n){const i=[];if(w.brush&&w.brush.consume){const r=a.brush(t),o=U.findShapes("*");w.brush.consume.filter(e=>e.context===t).forEach(t=>{for(let a=0;a<o.length;a++){const s=o[a];s.data&&r.containsMappedData(s.data,n||t.data,e)&&(G(s),i.push(s),o.splice(a,1),a--)}})}return i},X.findShapes=t=>{var e;const n=(null!==(e=tt)&&void 0!==e&&e.inProgress()?tt.targetScene:U).findShapes(t);for(let t=0,e=n.length;t<e;t++)G(n[t]);return n},X.shapesAt=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=U.itemsAt(t);let i;i=e&&"stop"===e.propagation&&n.length>0?[n.pop().node]:n.map(t=>t.node);for(let t=0,e=i.length;t<e;t++)G(i[t]);return i},X.brushFromShapes=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.contexts=Array.isArray(e.contexts)?e.contexts:[];Wo({nodes:t,action:e.action||"toggle",trigger:e,chart:a,data:S.data})},X.mount=()=>{y=U.element&&U.element()?y:U.appendTo(s),U.setKey&&"string"==typeof b.key&&U.setKey(b.key),w.brush&&(H(),W()),ga(D,f,b),ga(N,f,t),M=!0},X.mounted=()=>T(y),X.unmount=()=>{[D,N].forEach(t=>{!function(t,e){t.eventListeners&&(t.eventListeners.forEach(t=>{let n=t.event,i=t.listener;e.removeListener(n,i)}),t.eventListeners.length=0),t.emit=()=>{}}(t,f)}),R.tap=[],R.over=[],C.forEach(t=>{t.cleanUp()}),C.length=0,I(),M=!1},X.onBrushTap=t=>{R.tap.forEach(e=>{(function(t){let e=t.e,n=t.t,i=t.config;return Vo({collisions:Uo(e,n,i.renderer),t:n,config:i,action:Yo(n.action,e,"toggle")})})({e:t,t:e,config:S})&&"stop"===e.globalPropagation&&a.toggleBrushing(!0)})},X.onBrushOver=t=>{R.over.forEach(e=>{(function(t){let e=t.e,n=t.t,i=t.config;return Vo({collisions:Uo(e,n,i.renderer),t:n,config:i,action:Yo(n.action,e,"set")})})({e:t,t:e,config:S})&&"stop"===e.globalPropagation&&a.toggleBrushing(!0)})},X.def=N,X.ctx=D,X.renderer=()=>U,X.set({settings:b}),A(),X}function ya(t){const e=u(!0,{},t),n={getAll:()=>e,getValue:(t,n)=>function(t,e,n){if(void 0===t||void 0===e)return n;const i=e.split(".");let r=t;for(let t=0;t<i.length;++t){const e=i[t];if(void 0===r[e])return n;r=r[e]}return r}(e,t,n),setValue:(t,n)=>function(t,e,n){if(void 0===t||void 0===e)return;const i=e.split("."),r=i[i.length-1];let o=t;for(let t=0;t<i.length-1;++t){const e=i[t];void 0===o[e]&&(o[e]=Number.isNaN(+i[t+1])?{}:[]),o=o[e]}void 0!==n?o[r]=n:delete o[r]}(e,t,n)};return n}function va(t,e,n){const i=Qo(function(t,e){const n=aa(t,e)/aa(e,e)||1;return{x:e.x*n,y:e.y*n}}(ta(n,t),ta(e,t)),t);return i}function xa(t,e,n){return oa(t,n)+oa(e,n)-oa(t,e)<1e-12}function ba(t,e){return t.x>=e.x&&t.x+t.width<=e.x+e.width&&t.y>=e.y&&t.y+t.height<=e.y+e.height}function wa(t){return t.x1===t.x2&&t.y1===t.y2}function ka(t){return t.width<=0||t.height<=0}function _a(t){return t.r<=0}function Ma(t){return t.edges.length<=2}function Sa(t,e){let n=!1;for(let i=0,r=e.edges.length;i<r;i++)if(n=Oa(t,M(e.edges[i])),!0===n)return!0;return!1}function Ra(t,e){let n=!1;const i=e.numPolygons,r=e.polygons;for(let e=0;e<i;e++){if(n=$a(t,r[e]),!0===n)return!0}return!1}function Ca(t,e){if(_a(t))return!1;return ra({x:t.cx,y:t.cy},e)<=t.r**2}function Na(t,e){if(ka(e)||_a(t))return!1;const n=e.width/2,i=e.height/2,r=e.x+n,o=e.y+i,a=t.r,s=t.cx,l=t.cy,c=Math.abs(s-r),u=Math.abs(l-o);if(c>n+a||u>i+a)return!1;if(c<=n||u<=i)return!0;return(c-n)**2+(u-i)**2<=a**2}function Da(t,e){if(_a(t)||wa(e))return!1;const n=m(w(e),2),i=n[0],r=n[1];if(Ca(t,i)||Ca(t,r))return!0;const o={x:t.cx,y:t.cy},a=va(i,r,o);return ra(a,o)<=t.r**2&&xa(i,r,a)}function qa(t,e){if(Ma(e)||_a(t))return!1;if(Ea(e,{x:t.cx,y:t.cy}))return!0;const n=e.edges.length;for(let i=0;i<n;i++){if(Da(t,M(e.edges[i])))return!0}return!1}function Ea(t,e){if(Ma(t)||!Ia(t.boundingRect(),e))return!1;const n=e.x,i=e.y,r=t.vertices;let o,a,s,l,c;for(o=!1,l=-1,a=r.length,s=a-1;++l<a;s=l){if(r[l].x===n&&r[l].y===i)return!0;if(r[l].y===r[s].y&&r[l].y===i&&(n-r[l].x)*(n-r[s].x)<=0)return!0;if(r[l].y<i&&i<=r[s].y||r[s].y<i&&i<=r[l].y){if(c=(r[s].x-r[l].x)*(i-r[l].y)/(r[s].y-r[l].y)+r[l].x,n===c)return!0;n<c&&(o=!o)}}return o}function Oa(t,e){if(Ma(t))return!1;for(let n=0,i=t.edges.length;n<i;n++){if(Pa(e,M(t.edges[n])))return!0}const n=m(w(e),2),i=n[0],r=n[1];return Ea(t,i)||Ea(t,r)}function Aa(t,e){if(Ma(t))return!1;for(let n=0,i=t.edges.length;n<i;n++){if(ja(e,M(t.edges[n])))return!0}const n=m(k(e),4),i=n[0],r=n[1],o=n[2],a=n[3];return Ea(t,i)||Ea(t,r)||Ea(t,o)||Ea(t,a)}function za(t,e){return!ka(t)&&!ka(e)&&(t.x<=e.x+e.width&&e.x<=t.x+t.width&&t.y<=e.y+e.height&&e.y<=t.y+t.height)}function Ta(t,e){if(ka(t)||ka(e))return!1;return[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}].every(e=>Ia(t,e))}function Ia(t,e){return!ka(t)&&(e.x>=t.x&&e.x<=t.x+t.width&&e.y>=t.y&&e.y<=t.y+t.height)}function ja(t,e){if(wa(e)||ka(t))return!1;const n=m(w(e),2),i=n[0],r=n[1];if(Ia(t,i)||Ia(t,r))return!0;const o=k(t);let a=o.length;for(let t=0;t<a;t++){if(Pa(M([o[t],o[3!==t?t+1:0]]),e))return!0}return!1}function Pa(t,e){const n=m(w(t),2),i=n[0],r=n[1],o=m(w(e),2),a=o[0],s=o[1],l=na(r,i),c=ia(r,i),u=na(s,a),h=ia(s,a),d=na(i,a),f=ia(i,a);let p=h*l-u*c;const g=u*f-h*d,y=l*f-c*d;let v,x;if(0===l&&0===c)return!1;if(0===u&&0===h)return!1;if(0===p){if(0===g&&0===y){if(0===l){if(0===c)return i.x===r.x&&i.y===r.y;v=ia(a,i)/c,x=ia(s,i)/c}else v=(a.x-i.x)/l,x=(s.x-i.x)/l;return!(v<0&&x<0||v>1&&x>1)}return!1}const b=g/p;return p=y/p,b>=0&&b<=1&&p>=0&&p<=1}function Fa(t,e){if(wa(t))return!1;const n=m(w(t),2);return xa(n[0],n[1],e)}function La(t,e){const n=t.boundingRect(),i=e.boundingRect();return!!za(n,i)&&(Ta(n,i)?Sa(t,e):Sa(e,t))}function $a(t,e){const n=t.boundingRect(),i=e.boundingRect();return!!za(n,i)&&(Ta(i,n)?function(t,e){let n=!1;const i=t.numPolygons,r=t.polygons;for(let t=0;t<i;t++)if(n=La(e,r[t]),!0===n)return!0;return!1}(t,e):function(t,e){let n=!1;for(let i=0,r=e.edges.length;i<r;i++)if(n=Wa(t,M(e.edges[i])),!0===n)return!0;return!1}(t,e))}function Ba(t,e){if(_a(t))return!1;if(Ha(e,{x:t.cx,y:t.cy}))return!0;const n=e.numPolygons,i=e.polygons;for(let e=0;e<n;e++){const n=i[e],r=n.edges.length;for(let e=0;e<r;e++){if(Da(t,M(n.edges[e])))return!0}}return!1}function Ha(t,e){if(!Ia(t.boundingRect(),e))return!1;const n=e.x,i=e.y,r=t.numPolygons;let o,a,s,l,c,u,h=!1;for(a=0;a<r;a++)for(o=t.vertices[a],c=-1,s=o.length,l=s-1;++c<s;l=c){if(o[c].x===n&&o[c].y===i)return!0;if(o[c].y===o[l].y&&o[c].y===i&&(n-o[c].x)*(n-o[l].x)<=0)return!0;if(o[c].y<i&&i<=o[l].y||o[l].y<i&&i<=o[c].y){if(u=(o[l].x-o[c].x)*(i-o[c].y)/(o[l].y-o[c].y)+o[c].x,n===u)return!0;n<u&&(h=!h)}}return h}function Wa(t,e){const n=m(w(e),2),i=n[0],r=n[1];if(Ha(t,i)||Ha(t,r))return!0;const o=t.numPolygons,a=t.polygons;for(let t=0;t<o;t++){const n=a[t];for(let t=0,i=n.edges.length;t<i;t++){if(Pa(e,M(n.edges[t])))return!0}}return!1}function Va(t,e){const n=m(k(e),4),i=n[0],r=n[1],o=n[2],a=n[3];if(Ha(t,i)||Ha(t,r)||Ha(t,o)||Ha(t,a))return!0;const s=t.numPolygons,l=t.polygons;for(let t=0;t<s;t++){const n=l[t];for(let t=0,i=n.edges.length;t<i;t++){if(ja(e,M(n.edges[t])))return!0}}return!1}const Ua=/^\$/,Ya="@extend";function Ka(t){throw new Error('Cyclical reference for "'.concat(t,'"'))}function Ga(t,e,n){if("string"==typeof t){let i=e[t];return-1!==n.indexOf(t)&&Ka(t),Ua.test(i)?(n.push(t),Ga(i,e,n)):i}let i=t;const r=u(!0,{},e,t),o={};if(t[Ya]){const o=t[Ya];-1!==n.indexOf(o)&&Ka(o);let a=n.slice();a.push(o),i=u(!0,{},Ga(r[o],e,a),t)}return Object.keys(i).forEach(t=>{let e=n.slice();if(t===Ya||Ua.test(t))return;o[t]=i[t];let a=o[t];Ua.test(a)&&a in r?(-1!==n.indexOf(a)&&Ka(a),e.push(a),a=r[a],"object"==typeof a||Ua.test(a)&&a in r?o[t]=Ga(a,r,e):o[t]=a):"object"==typeof a&&(o[t]=Ga(a,r,e))}),o}function Xa(t,e){return Ga(t,e,[])}function Ja(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e={},n=t;const i=t=>{t.forEach(t=>{const n=Array.isArray(t.colors[0])?t.colors:[t.colors];e[t.key]={colors:n,sizes:n.map(t=>t?t.length:0)}})},r={palette:(t,n)=>((t,n)=>{const i=e[t];if(!i)return[];const r=i.sizes;for(let t=0;t<r.length;t++)if(n<=r[t])return i.colors[t];return i.colors[r.length-1]})(t,n),setPalettes:i,style:t=>Xa(t,n),setStyle:e=>{n=u({},t,e)}};return i(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]),r}function Za(t){t.x=Math.floor(t.x),t.y=Math.floor(t.y),t.width=Math.floor(t.width),t.height=Math.floor(t.height)}function Qa(t){const e={center:{minWidthRatio:.5,minHeightRatio:.5,minWidth:0,minHeight:0}};return u(!0,e,t),e.center.minWidthRatio=Math.min(Math.max(e.center.minWidthRatio,0),1),e.center.minHeightRatio=Math.min(Math.max(e.center.minHeightRatio,0),1),e.center.minWidth=Math.max(e.center.minWidth,0),e.center.minHeight=Math.max(e.center.minHeight,0),e}function ts(t,e,n,i,r){return{x:isNaN(t)?0:t,y:isNaN(t)?0:e,width:isNaN(t)?0:n,height:isNaN(t)?0:i,margin:isNaN(r)?0:r}}function es(t,e,n){if(void 0===t.cachedSize){const i=t.config.dock();let r,o=t.comp.preferredSize({inner:e,outer:n,dock:i});isNaN(o)?o&&!isNaN(o.size)&&(o.width=o.size,o.height=o.size):o={width:o,height:o},r="top"===i||"bottom"===i?o.height:"right"===i||"left"===i?o.width:Math.max(o.width,o.height),t.cachedSize=Math.ceil(r),t.edgeBleed=o.edgeBleed||0}return t.cachedSize}function ns(t,e){switch(e.config.dock()){case"top":t.y+=e.cachedSize,t.height-=e.cachedSize;break;case"bottom":t.height-=e.cachedSize;break;case"left":t.x+=e.cachedSize,t.width-=e.cachedSize;break;case"right":t.width-=e.cachedSize}}function is(t,e){const n=e.edgeBleed;n&&(t.left=Math.max(t.left,n.left||0),t.right=Math.max(t.right,n.right||0),t.top=Math.max(t.top,n.top||0),t.bottom=Math.max(t.bottom,n.bottom||0))}function rs(t,e,n){e.x<n.left&&(e.width-=n.left-e.x,e.x=n.left);const i=t.width-(e.x+e.width);i<n.right&&(e.width-=n.right-i),e.y<n.top&&(e.height-=n.top-e.y,e.y=n.top);const r=t.height-(e.y+e.height);r<n.bottom&&(e.height-=n.bottom-r)}function os(t,e,n,i,r){const o=u({},e),a=u({},n);ns(o,i),is(a,i),rs(t,o,a);const s=function(t,e,n){const i=Math.min(n.center.minWidth,t.width)||Math.max(t.width*n.center.minWidthRatio,1),r=Math.min(n.center.minHeight,t.height)||Math.max(t.height*n.center.minHeightRatio,1);return e.width>=i&&e.height>=r}(t,o,r);return!!s&&(ns(e,i),is(n,i),!0)}function as(t){return{x:t.margin.left+t.x*t.scaleRatio.x,y:t.margin.top+t.y*t.scaleRatio.y,width:t.width*t.scaleRatio.x,height:t.height*t.scaleRatio.y}}function ss(t){return _([].concat(...t.map(k)))}function ls(t){let e=t.visible,n=t.layoutRect,i=t.reducedRect,r=t.containerRect,o=t.translation;const a=ts(i.x,i.y,i.width,i.height),s=ts(i.x,i.y,i.width,i.height),l={},c=e.slice(),u=c.slice().sort((t,e)=>t.config.displayOrder()-e.config.displayOrder());return e.sort((t,e)=>{if(t.referencedDocks.length>0&&e.referencedDocks.length>0)return 0;if(e.referencedDocks.length>0)return-1;if(t.referencedDocks.length>0)return 1;const n=t.config.displayOrder()-e.config.displayOrder();return 0===n?c.indexOf(t)-c.indexOf(e):n}).forEach(t=>{let e={},c={};switch(t.config.dock()){case"top":e.height=c.height=t.cachedSize,e.width=n.width,c.width=a.width,e.x=n.x,c.x=a.x,e.y=c.y=a.y-t.cachedSize,a.y-=t.cachedSize,a.height+=t.cachedSize;break;case"bottom":e.x=n.x,c.x=a.x,e.y=c.y=a.y+a.height,e.width=n.width,c.width=a.width,e.height=c.height=t.cachedSize,a.height+=t.cachedSize;break;case"left":e.x=c.x=s.x-t.cachedSize,e.y=n.y,c.y=s.y,e.width=c.width=t.cachedSize,e.height=n.height,c.height=s.height,s.x-=t.cachedSize,s.width+=t.cachedSize;break;case"right":e.x=c.x=s.x+s.width,e.y=n.y,c.y=s.y,e.width=c.width=t.cachedSize,e.height=n.height,c.height=s.height,s.width+=t.cachedSize;break;case"center":e.x=c.x=i.x,e.y=c.y=i.y,e.width=c.width=i.width,e.height=c.height=i.height;break;default:if(t.referencedDocks.length>0){const n=t.referencedDocks.map(t=>l[t]).filter(t=>!!t);n.length>0&&(e=ss(n.map(t=>t.outerRect)),c=ss(n.map(t=>t.r)))}}t.key&&(l[t.key]={r:c,outerRect:e}),function(t,e,n,i){const r={x:i.width/n.width,y:i.height/n.height},o={left:0,top:0};if(n.preserveAspectRatio){const t=r.x<r.y,e=Math.min(r.x,r.y);r.x=e,r.y=e;const a=t?"height":"width",s=(i[a]-n[a]*r.x)*n.align;o.left=t?0:s,o.top=t?s:0}t.scaleRatio=r,t.margin=o,e.scaleRatio=r,e.margin=o,n.scaleRatio=r,n.margin=o}(c,e,n,r),c.edgeBleed=t.edgeBleed,c.computed=as(c),e.edgeBleed=t.edgeBleed,e.computed=as(e),c.x+=o.x,c.y+=o.y,e.x+=o.x,e.y+=o.y,t.comp.resize(c,e),t.cachedSize=void 0,t.edgeBleed=void 0}),u}function cs(t,e,n){const i=t.layoutModes||{},r=e.minimumLayoutMode();let o=e.show();return o&&"object"==typeof r?o=i[r.width]&&i[r.height]&&n.width>=i[r.width].width&&n.height>=i[r.height].height:o&&void 0!==r&&(o=i[r]&&n.width>=i[r].width&&n.height>=i[r].height),o}function us(t){if(!t.resize||"function"!=typeof t.resize)throw new Error("Component is missing resize function");if(!t.dockConfig&&!t.preferredSize)throw new Error("Component is missing preferredSize function")}function hs(t){let e=Qa(t);const n={};return n.layout=function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(!t||isNaN(t.x)||isNaN(t.y)||isNaN(t.width)||isNaN(t.height))throw new Error("Invalid rect");if(!n.length)return{visible:[],hidden:[],ordered:[]};const i=function(t,e){const n={x:0,y:0,width:0,height:0},i={x:0,y:0,width:0,height:0};return n.width=t.width||0,n.height=t.height||0,void 0!==e.size&&(n.width=isNaN(e.size.width)?n.width:e.size.width,n.height=isNaN(e.size.height)?n.height:e.size.height),void 0!==e.logicalSize?(i.width=isNaN(e.logicalSize.width)?n.width:e.logicalSize.width,i.height=isNaN(e.logicalSize.height)?n.height:e.logicalSize.height,i.align=isNaN(e.logicalSize.align)?.5:Math.min(Math.max(e.logicalSize.align,0),1),i.preserveAspectRatio=e.logicalSize.preserveAspectRatio):(i.width=n.width,i.height=n.height,i.preserveAspectRatio=!1),Za(i),Za(n),{logicalContainerRect:i,containerRect:n}}(t,e),r=i.logicalContainerRect,o=i.containerRect,a=function(t,e,n){const i=[],r=[];for(let o=0;o<t.length;++o){const a=t[o];us(a);let s=a.dockConfig;const l=a.key,c=s.dock(),u=/@/.test(c)?c.split(",").map(t=>t.replace(/^\s*@/,"")):[];cs(e,s,n)?i.push({comp:a,key:l,config:s,referencedDocks:u}):r.push({comp:a,key:l,config:s,referencedDocks:u})}return[i,r]}(n,e,r),s=m(a,2),l=s[0],c=s[1],u=function(t){let e=t.layoutRect,n=t.visible,i=t.hidden,r=t.settings;const o=ts(e.x,e.y,e.width,e.height),a={left:0,right:0,top:0,bottom:0},s=n.slice();s.sort((t,e)=>t.config.prioOrder()-e.config.prioOrder());for(let t=0;t<s.length;++t){const n=s[t];es(n,o,e),os(e,o,a,n,r)||(i.push(s.splice(t,1)[0]),--t)}!function(t,e){if(0!==e.length)for(let n=0;n<t.length;++n){let i=t[n];if(i.referencedDocks.length){const r=i.referencedDocks.every(t=>e.some(e=>e.key===t));r&&e.push(t.splice(n,1)[0])}}}(n,i);const l=n.filter(t=>-1!==s.indexOf(t));return n.length=0,n.push(...l),rs(e,o,a),o}({layoutRect:r,visible:l,hidden:c,settings:e}),h=ls({visible:l,layoutRect:r,reducedRect:u,containerRect:o,translation:{x:t.x,y:t.y}});return c.forEach(t=>{t.comp.visible=!1;const e=ts();t.comp.resize(e,e)}),{visible:l.map(t=>t.comp),hidden:c.map(t=>t.comp),ordered:h.map(t=>t.comp)}},n.settings=function(t){e=Qa(t)},n}const ds=(t,e)=>{for(let n=0;n<t.length;n++){const i=t[n];if(i.hasKey&&i.key===e)return t[n]}return null},fs=t=>null==t?void 0:t.map(t=>{const e=t.instance.dockConfig();return{preferredSize:n=>e.computePreferredSize(g(g({},n),{},{children:fs(t.children)}))}}),ps=(t,e)=>({visible:[],hidden:e,ordered:[]}),gs=t=>(e,n)=>{var i;const r=n.map((t,e)=>{const n=t.instance.dockConfig();return{index:e,key:t.key,dockConfig:n,resize:t.instance.resize,preferredSize:e=>n.computePreferredSize(g(g({},e),{},{children:fs(t.children)}))}}),o=t=>n[t.index],a=null!==(i=t(e,r))&&void 0!==i?i:{},s=a.visible,l=void 0===s?r:s,c=a.hidden,u=void 0===c?[]:c,h=a.ordered,d=void 0===h?l:h;return{visible:l.map(o),hidden:u.map(o),ordered:d.map(o)}},ms=t=>"function"==typeof t?gs(t):(t=>{const e=hs(t);return gs((t,n)=>e.layout(t,n))})(t);function ys(t,e,n){const i=e.left-n.left,r=e.top-n.top,o=S(t),a=u(!0,{},t);switch(o){case"circle":a.cx+=i,a.cy+=r;break;case"polygon":for(let t=0,e=a.vertices.length;t<e;t++){const e=a.vertices[t];e.x+=i,e.y+=r}break;case"geopolygon":for(let t=0;t<a.vertices.length;t++){const e=a.vertices[t];for(let t=0,n=e.length;t<n;t++){const n=e[t];n.x+=i,n.y+=r}}break;case"line":a.x1+=i,a.y1+=r,a.x2+=i,a.y2+=r;break;case"point":case"rect":a.x+=i,a.y+=r}return a}function vs(t,e){const n=[];let i=0;e.forEach(t=>{n.push(i),i++;const e=t.instance.def.additionalElements&&t.instance.def.additionalElements();e&&(i+=e.length)}),e.forEach((e,i)=>((t,e,n)=>{const i=e.instance.renderer().element();if(isNaN(n)||!i||!t||!t.children)return;const r=t.children[Math.max(0,n)];if(i===r)return;const o=e.instance.def.additionalElements&&e.instance.def.additionalElements().filter(Boolean);t.insertBefore&&void 0!==r?(t.insertBefore(i,r),o&&o.forEach(e=>{t.insertBefore(e,i)})):(o&&o.forEach(e=>{t.appendChild(e,i)}),t.appendChild(i))})(t,e,n[i]))}function xs(t,e){let n=t.element,i=t.data,r=void 0===i?[]:i,o=t.settings,a=void 0===o?{}:o,s=t.on,l=void 0===s?{}:s;const c=e.registries,h=e.logger,d=Ja(e.style,e.palettes),f=[],p=u({},t),m=function(){const t={};return lo.mixin(t),t}();let v=[],x=null,b=null,w=null,k=[],_=()=>{},M=()=>{};const S={};let R=!1;const C=function(t){let e=t.createComponent;const n={};let i=[],r=[];const o=t=>{const n=e(t);return n&&(i.push(n),t.components&&(n.children=t.components.map(t=>o(t)).filter(t=>!!t))),n},a=t=>{const e=i.indexOf(t);-1!==e&&i.splice(e,1)},s=(t,e)=>{for(let n=t.length-1;n>=0;n--){const i=t[n],r=e.find(t=>i.hasKey&&i.key===t.key);r?i.children&&r.components&&s(i.children,r.components):(t.splice(n,1),a(i),i.children&&s(i.children,[]),i.instance.destroy())}},l=t=>{let e=t.compList,n=t.data,i=t.excludeFromUpdate,r=t.formatters,a=t.scales;return t.settingsList.map(t=>{const s=ds(e,t.key);return i.indexOf(t.key)>-1?(delete s.updateWith,s):s?(t.rendererSettings&&"function"==typeof s.instance.renderer().settings&&s.instance.renderer().settings(t.rendererSettings),t.rendererSettings&&"function"==typeof t.rendererSettings.transform&&t.rendererSettings.transform()?(s.applyTransform=!0,s):(s.updateWith={formatters:r,scales:a,data:n,settings:t},t.components&&(s.children=l({compList:s.children||[],data:n,excludeFromUpdate:i,formatters:r,scales:a,settingsList:t.components})),s)):o(t)}).filter(t=>!!t)},c=t=>{let e=t.components,n=t.hidden,i=t.layoutFn,r=t.ordered,o=t.rect,a=t.visible;const s=i(o,e),l=s.visible,u=s.hidden,h=s.ordered;a.push(...l),n.push(...u),r.push(...h),l.forEach(t=>{if(t.children){var e,i;const o=ms(null!==(e=null===(i=t.settings)||void 0===i?void 0:i.strategy)&&void 0!==e?e:{});c({components:t.children,hidden:n,layoutFn:o,ordered:r,rect:t.instance.getRect(),visible:a})}}),u.forEach(t=>{t.children&&c({components:t.children,hidden:n,layoutFn:ps,ordered:r,rect:null,visible:a})})};return n.destroy=()=>{i.forEach(t=>t.instance.destroy()),i=[],r=[]},n.findComponentByKey=t=>ds(i,t),n.forEach=t=>{i.forEach(t)},n.layout=t=>{let e=t.layoutSettings,n=t.rect;const i=[],o=[],a=[],s=ms(e);return c({components:r,hidden:o,layoutFn:s,ordered:a,rect:n,visible:i}),{visible:i,hidden:o,ordered:a}},n.set=t=>{let e=t.components;r=e.map(t=>o(t)).filter(t=>!!t)},n.update=t=>{let e=t.components,n=t.data,i=t.excludeFromUpdate,o=t.formatters,a=t.scales;s(r,e),r=l({compList:r,data:n,excludeFromUpdate:i,formatters:o,scales:a,settingsList:e})},n}({createComponent:t=>{if(!c.component.has(t.type))return h.warn("Unknown component: ".concat(t.type)),!1;return{instance:ma(c.component(t.type),{settings:t,chart:p,mediator:m,registries:c,theme:d,container:n}),settings:u(!0,{},t),key:t.key,hasKey:void 0!==t.key}}});function N(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{};return function(){const i="function"==typeof t[e];let r;for(var o=arguments.length,a=new Array(o),s=0;s<o;s++)a[s]=arguments[s];return r=i?t[e].call(p,...a):n.call(p,...a),r}}const D=()=>{let t;a.dockLayout?(h.warn('Deprecation Warning: "dockLayout" property should be renamed to "strategy"'),t=a.dockLayout):t=a.strategy;const e=function(t){if("function"==typeof t.getBoundingClientRect){const e=t.getBoundingClientRect();return{x:0,y:0,width:e.width,height:e.height}}return{x:0,y:0,width:0,height:0}}(n);return C.layout({layoutSettings:t,rect:e})},q=N("created"),E=N("beforeMount"),O=N("mounted"),A=N("beforeUpdate"),z=N("updated"),T=N("beforeRender"),I=N("beforeDestroy"),j=N("destroyed"),P=function(t,e){let n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).partialData;const i=e.formatters,r=void 0===i?{}:i,o=e.scales,a=void 0===o?{}:o,s=e.scroll,l=void 0===s?{}:s;_=function(t,e){let n=e.types,i=e.logger;const r={},o=[];return Array.isArray(t)?o.push(...t):(i.warn('Deprecated: "data-source" configuration"'),o.push(t)),o.forEach((t,e)=>{let o=n(t.type);if(o){let n=t.key;void 0===t.key&&(i.warn("Missing key for dataset. Using index '".concat(e,"' as key.")),n=e);let a=o({key:n,data:t.data,config:t.config});r[n]=a}}),t=>t?r[t]:r[Object.keys(r)[0]]}(t,{logger:h,types:c.data}),n||Object.keys(S).forEach(t=>S[t].clear()),e.palettes&&d.setPalettes(e.palettes),e.style&&d.setStyle(e.style),M=function(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:vi;const r={};return(t||[]).forEach(t=>{if(!t.key)throw new Error('Data collection is missing "key" property');if("object"==typeof t.data&&"collection"in t.data)throw new Error("Data config for collections may not reference other collections");r[t.key]=()=>i(t.data,e,n)}),t=>{let e,n;if("string"==typeof t?e=t:"object"==typeof t&&(e=t.key,n=t),!(e in r))throw new Error("Unknown data collection: ".concat(e));"function"==typeof r[e]&&(r[e]=r[e]());let i=r[e];if(n&&n.fields&&n.fields.filter){let t=i.fields.filter(n.fields.filter);i.fields.length!==t.length&&(i=u(i,{fields:t}))}return i}}(e.collections,{dataset:_},{logger:h});const f={theme:d,logger:h};x=function(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:ro;const r={};return{get(o){let a;return"string"==typeof o&&t[o]?a=o:"object"==typeof o&&"scale"in o&&t[o.scale]&&(a=o.scale),a?(r[a]=r[a]||i(t[a],e,n),r[a]):i(o,e,n)},all(){return Object.keys(t).forEach(this.get),r}}}(a,{dataset:_,collection:M},g(g({},f),{},{scale:c.scale})),b=function(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:xi;const r={};return{get(o){let a;return"string"==typeof o&&t[o]?a=o:"object"==typeof o&&"formatter"in o&&t[o.formatter]?a=o.formatter:"object"==typeof o&&"type"in o&&t[o.type]&&(a=o.type),a?(r[a]=r[a]||i(t[a],e,n),r[a]):i(o||{},e,n)},all(){return Object.keys(t).forEach(this.get),r}}}(r,{dataset:_,collection:M},g(g({},f),{},{formatter:c.formatter})),w=function(t,e){const n={};for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=uo(t[i],e?e[i]:null));return n}(l,w)};function F(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const e={},i=t.filter(t=>!!t.key).map(t=>t.key);k.forEach(t=>{t.key&&-1!==i.indexOf(t.key)?e[t.key]=t:t.destroy()}),k=t.map(t=>{const i=t.key&&e[t.key]?e[t.key]:c.interaction(t.type)(p,m,n);return i.set(t),i})}const L=t=>{const e=n.getBoundingClientRect(),i="clientX"in t?t.clientX:t.x,r="clientY"in t?t.clientY:t.y,o={x:i-e.left,y:r-e.top},a=[];return v.forEach(t=>{const e=t.instance.getRect();Ia(e.computedPhysical?e.computedPhysical:{x:e.margin.left+e.x*e.scaleRatio.x,y:e.margin.top+e.y*e.scaleRatio.y,width:e.width*e.scaleRatio.x,height:e.height*e.scaleRatio.y},o)&&a.push(t)}),a},$=()=>{if(f.length||!n)return;Object.keys(l).forEach(t=>{const e=l[t].bind(p);n.addEventListener(t,e),f.push({key:t,listener:e})});const t={},e=e=>{e.touches?(t.x=e.touches[0].clientX,t.y=e.touches[0].clientY,t.multiTouch=e.touches.length>1):(t.x=e.clientX,t.y=e.clientY,t.multiTouch=!1),t.time=Date.now(),t.comps=L(t)},i=e=>{const n=t.comps||L(e);if(!n.every(t=>t.instance.def.disableTriggers)&&("touchend"===e.type&&e.preventDefault(),function(t,e){const n=y(t),i=n?t.changedTouches[0]:t,r=Date.now()-e.time,o=isNaN(e.x)?0:Math.abs(i.clientX-e.x),a=isNaN(e.y)?0:Math.abs(i.clientY-e.y);return(0===t.button||n)&&!e.multiTouch&&o<=12&&a<=12&&r<=300}(e,t)))for(let t=n.length-1;t>=0;t--){if(n[t].instance.onBrushTap(e),R){R=!1;break}}},r=[];var o;r.push({key:"mousedown",listener:e}),r.push({key:"mouseup",listener:i}),("ontouchstart"in(o=n)&&"ontouchend"in o||navigator.maxTouchPoints>1)&&(r.push({key:"touchstart",listener:e}),r.push({key:"touchend",listener:i})),r.push({key:"mousemove",listener:t=>{const e=L(t);for(let n=e.length-1;n>=0;n--){if(e[n].instance.onBrushOver(t),R){R=!1;break}}}}),r.forEach(t=>{n.addEventListener(t.key,t.listener),f.push(t)})},B=()=>{f.forEach(t=>{let e=t.key,i=t.listener;return n.removeEventListener(e,i)}),f.length=0},H=()=>{n.innerHTML="",(()=>{const t=a.components,e=void 0===t?[]:t;T(),P(r,a),C.set({components:e});const i=D(),o=i.visible,s=i.hidden,l=i.ordered;v=o,s.forEach(t=>{t.instance.hide(),t.visible=!1}),o.forEach(t=>t.instance.beforeMount()),o.forEach(t=>t.instance.mount()),o.forEach(t=>t.instance.beforeRender()),o.forEach(t=>t.instance.render()),o.forEach(t=>t.instance.mounted()),o.forEach(t=>{t.visible=!0}),vs(n,l)})(),$(),F(a.interactions)};return p.layoutComponents=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=t.excludeFromUpdate,n=void 0===e?[]:e;t.data&&(r=t.data),t.settings&&(a=t.settings,F(t.settings.interactions)),A(),P(r,a);const i=a,o=i.formatters,s=i.scales,l=i.components,c=void 0===l?[]:l;C.update({components:c,data:r,excludeFromUpdate:n,formatters:o,scales:s}),C.forEach(t=>{t.updateWith&&t.instance.set(t.updateWith)}),C.forEach(t=>{t.updateWith&&t.instance.beforeUpdate()}),D()},p.update=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=t.partialData,i=t.excludeFromUpdate,o=void 0===i?[]:i;let s;t.data&&(r=t.data),t.settings&&(a=t.settings,F(t.settings.interactions)),A(),P(r,a,{partialData:e});const l=a,c=l.formatters,u=l.scales,h=l.components,d=void 0===h?[]:h;C.update({components:d,data:r,excludeFromUpdate:o,formatters:c,scales:u}),C.forEach(t=>{t.updateWith&&t.instance.set(t.updateWith)}),C.forEach(t=>{t.updateWith&&t.instance.beforeUpdate()});const f=[],p=[];let g;if(e)C.forEach(t=>{(t.updateWith||t.applyTransform)&&t.visible&&f.push(t)}),g=f;else{const t=D(),e=t.visible,n=t.hidden,i=t.ordered;v=e,g=e,s=i,e.forEach(t=>{t.updateWith&&t.visible?f.push(t):p.push(t)}),n.forEach(t=>{t.instance.hide(),t.visible=!1,delete t.updateWith,t.applyTransform=!1})}p.forEach(t=>t.instance.beforeMount()),p.forEach(t=>t.instance.mount()),g.forEach(t=>t.instance.beforeRender()),g.forEach(t=>{(t.updateWith||t.applyTransform)&&t.visible?t.instance.update():t.instance.render()}),e||vs(n,s),p.forEach(t=>t.instance.mounted()),f.forEach(t=>t.instance.updated()),v.forEach(t=>{delete t.updateWith,t.visible=!0,t.applyTransform=!1}),z()},p.destroy=()=>{I(),C.destroy(),B(),F(),delete p.update,delete p.destroy,j()},p.getAffectedShapes=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"and",n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,r=[];return v.filter(t=>null==i||t.key===i).forEach(i=>{const o=i.instance.getBrushedShapes(t,e,n);r=[...r,...o]}),r},p.findShapes=t=>{let e=[];return v.forEach(n=>{const i=n.instance.findShapes(t);e=[...e,...i]}),e},p.componentsFromPoint=t=>L(t).map(t=>t.instance.ctx),p.shapesAt=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=[];const r=n.getBoundingClientRect();let o=v;if(Array.isArray(e.components)&&e.components.length>0){const t=e.components.map(t=>t.key);o=v.filter(e=>-1!==t.indexOf(e.key)).map(n=>({instance:n.instance,opts:e.components[t.indexOf(n.key)]}))}for(let n=o.length-1;n>=0;n--){const a=o[n],s=ys(t,r,a.instance.renderer().element().getBoundingClientRect()),l=a.instance.shapesAt(s,a.opts),c=l.length>0&&"stop"===e.propagation;if(i=[...i,...l],i.length>0&&c)return i}return i},p.brushFromShapes=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{components:[]};for(let n=0;n<e.components.length;n++){const i=e.components[n].key;v.filter(t=>i===t.key).forEach(i=>{let r=t.filter(t=>t.key===i.key);i.instance.brushFromShapes(r,e.components[n])})}},p.scroll=function(){return function(t,e){return e[t]||(e[t]=co()),e[t]}(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",w)},p.dataset=t=>_(t),p.dataCollection=t=>M(t),p.scales=function(){return x.all()},p.formatters=function(){return b.all()},p.brush=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return S[t]||(S[t]=Co()),S[t]},p.scale=function(t){return x.get(t)},p.formatter=function(t){return b.get(t)},p.toggleBrushing=function(t){R=void 0!==t?t:!R},p.component=t=>{const e=C.findComponentByKey(t);return null==e?void 0:e.instance.ctx},p.logger=()=>h,p.theme=()=>d,p.storage=ya({animations:{updatingStageMeta:{isInit:!1,shouldBeRemoved:!1}}}),Object.defineProperty(p,"interactions",{get:()=>({instances:k,on(){$(),k.forEach(t=>t.on())},off(){B(),k.forEach(t=>t.off())}})}),q(),n&&(E(),H(),O(n),p.element=n),p}const bs=t=>{let e=Et(t);return e.prio=t=>t?e.default(t[0]):[e.default()],e.types=()=>e.getKeys(),e};var ws=Et();function ks(t,e,n){let i=n.key;const r={value:"function"==typeof t.value?t.value(e):void 0!==t.value?t.value:e};return r.label="function"==typeof t.label?t.label(e):void 0!==t.label?String(t.label):String(r.value),t.field&&(r.source={key:i,field:t.field.key()}),r}const _s=t=>t.filter(t=>"number"==typeof t&&!isNaN(t));const Ms=t=>{let e=t.key,n=t.data,i=t.cache,r=t.config;if(!n)return;let o=n;"string"==typeof o&&(o=(t=>{let e=t.data,n=t.config;const i=e.split("\n"),r=i[0],o=i[1];let a=",";if(n&&n.parse&&n.parse.delimiter)a=n.parse.delimiter;else if(r){const t=[/,/,/\t/,/;/];for(let e=0;e<t.length;e++){const n=t[e];if(r&&o){if(n.test(r)&&n.test(o)&&r.split(n).length===o.split(n).length){a=n;break}}else n.test(r)&&(a=n)}}return i.map(t=>t.split(a))})({data:n,config:r})),Array.isArray(o)&&function(t){let e,n=t.source,i=t.data,r=t.cache,o=t.config,a=i;const s=o&&o.parse;Array.isArray(i[0])?s&&!1===s.headers?e=i[0].map((t,e)=>e):(e=i[0],a=i.slice(1)):e=Object.keys(i[0]);const l=!!s&&"function"==typeof s.row&&s.row;let c,h=e;h=s&&"function"==typeof s.fields?s.fields(h.slice()):e.map(t=>({key:t,title:t})),Array.isArray(i[0])?c=h.map(()=>[]):(c={},h.forEach(t=>{c[t.key]=[]}));for(let t=0;t<a.length;t++){const e=l?l(a[t],t,h):a[t];if(e)if(Array.isArray(e))for(let t=0;t<h.length;t++)c[t].push(e[t]);else for(let t=0;t<h.length;t++)c[h[t].key].push(e[h[t].key])}const d=Array.isArray(c)?t=>c[t]:t=>c[h[t].key];for(let t=0;t<h.length;t++){const e=d(t),i=_s(e),o=i.length>0,a=o?"measure":"dimension",s=o?Math.min(...i):NaN,l=o?Math.max(...i):NaN;r.fields.push(ri(u({source:n,key:t,title:h[t].title,values:e,min:s,max:l,type:a},h[t]),{value:h[t].value,label:h[t].label}))}}({data:o,cache:i,source:e,config:r})};function Ss(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.key,n=t.data,i=t.config;const r={fields:[]},o={key:()=>e,raw:()=>n,field:t=>function(t,e){let n=e.cache;if("number"==typeof t)return n.fields[t];for(let e=0;e<n.fields.length;e++)if(n.fields[e].key()===t)return n.fields[e];for(let e=0;e<n.fields.length;e++)if(n.fields[e].title()===t)return n.fields[e];return null}(t,{cache:r}),fields:()=>r.fields.slice(),extract:t=>function(t,e){const n=Array.isArray(t)?t:[t];let i=[];return n.forEach(t=>{if(void 0!==t.field){const n=e.field(t.field),r=e.key();if(!n)throw Error("Field '".concat(t.field,"' not found"));const o=ci(t,e),a=o.props,s=o.main,l=Object.keys(a),c=!!t.trackBy,u=typeof t.trackBy,h={},d=[],f=n.items(),p=[];for(let e=0;e<f.length;e++){const n=f[e];if(s.filter&&!s.filter(n))continue;const i=ks(s,n,{key:r});l.forEach(t=>{const o=a[t];let s=o.field?o.field.items()[e]:n;i[t]=ks(o,s,{key:r})}),c&&di({cfg:t,itemData:n,obj:i,target:d,tracker:h,trackType:u}),p.push(i)}i=c?[...i,...hi(d,{main:s,propsArr:l,props:a})]:[...i,...p]}}),i}(t,o),hierarchy:()=>null};return Ms({key:e,data:n,config:i,cache:r}),o}Ss.util={normalizeConfig:ci,collect:hi,track:di};const Rs=Et();Rs.default("matrix"),Rs("matrix",Ss),Rs("default",Ss);const Cs=Et();function Ns(t,e,n){return Math.max(t,Math.min(e,n))}function Ds(t){let e=t.item,n=t.value,i=t.boxCenter,r=t.rendWidth,o=t.rendHeight,a="x",s="y",l=r,c=o,h=n<.5?90:-90;return t.flipXY&&(a="y",s="x",l=o,c=r,h=n<.5?180:0),(0,t.symbol)(u({},e.oob,{[a]:i*l,[s]:Math.max(e.oob.size/2,Math.min(n*c,c-e.oob.size/2)),startAngle:h}))}function qs(t){let e=t.item,n=t.boxWidth,i=t.boxPadding,r=t.rendWidth,o=t.rendHeight,a="x",s="y",l="width",c="height",h=r,d=o;t.flipXY&&(a="y",s="x",l="height",c="width",h=o,d=r);const f=function(t){let e=t.start,n=t.end,i=t.minPx,r=void 0===i?.1:i,o=t.maxPx,a=void 0===o?1:o;const s=Math.max(e,n),l=Math.min(e,n),c=Ns(-.1,1.2,s),u=Ns(-.1,1.2,l),h=c*a-u*a,d=Math.max(r,h),f=(d-h)/2;return{actualDiff:d,startModifier:f,actualLow:u*a-f}}({start:e.start,end:e.end,minPx:e.box.minHeightPx,maxPx:d}),p=f.actualDiff,g=f.actualLow;return u({},e.box,{type:"rect",[a]:(i+e.major)*h,[s]:g,[c]:p,[l]:n*h,data:e.data||{},collider:{type:null}})}function Es(t){let e=t.item,n=t.from,i=t.to,r=t.boxCenter,o=t.rendWidth,a=t.rendHeight,s="x1",l="y1",c="x2",h="y2",d=o,f=a;return t.flipXY&&(s="y1",l="x1",c="y2",h="x2",d=a,f=o),u({},e.line,{type:"line",[h]:Math.floor(n*f),[s]:r*d,[l]:Math.floor(i*f),[c]:r*d,data:e.data||{},collider:{type:null}})}function Os(t){let e=t.item,n=t.key,i=t.position,r=t.width,o=t.boxCenter,a=t.rendWidth,s=t.rendHeight,l="x1",c="y1",h="x2",d="y2",f=a,p=s;t.flipXY&&(l="y1",c="x1",h="y2",d="x2",f=s,p=a);const g=r/2;return u({type:"line"},e[n],{[c]:Math.floor(i*p),[l]:(o-g)*f,[d]:Math.floor(i*p),[h]:(o+g)*f,r:g*f,cx:o*f,cy:i*p,width:r*f,data:e.data||{},collider:{type:null}})}function As(t,e,n){const i=e.box,r=i.width,o=i.maxWidthPx,a=i.minWidthPx,s=t>=0?1:-1;let l=Math.min(s*t*r,isNaN(o)?n:o/n);return l=isNaN(a)?l:Math.max(a/n,l),l*s}Cs("native",function(t,e,n){let i,r,o={chart:t,mediator:e,element:n},a=[],s=!0;function l(){"function"==typeof i.enable&&(i.enable=i.enable.bind(o)()),i.enable&&Object.keys(i.events).forEach(t=>{const e=i.events[t].bind(o);n.addEventListener(t,e),a.push({key:t,listener:e})})}function c(){a.forEach(t=>{let e=t.key,i=t.listener;n.removeEventListener(e,i)}),a=[]}return{get key(){return r},set(t){!function(t){r=t.key,i=t,i.events=i.events||[],void 0===i.enable&&(i.enable=!0)}(t),c(),s&&l()},off(){s=!1,c()},on(){s=!0,0===a.length&&l()},destroy(){c(),o=null,i=null}}});const zs={oob:{show:!0,type:"n-polygon",fill:"#999",stroke:"#000",strokeWidth:0,size:10,sides:3,startAngle:-90},box:{show:!0,fill:"#fff",stroke:"#000",strokeWidth:1,strokeLinejoin:"miter",width:1,maxWidthPx:void 0,minWidthPx:1,minHeightPx:1},line:{show:!0,stroke:"#000",strokeWidth:1},median:{show:!0,stroke:"#000",strokeWidth:1},whisker:{show:!0,stroke:"#000",strokeWidth:1,fill:"",type:"line",width:1}},Ts=Object.keys(zs),Is={require:["chart","resolver","symbol"],defaultSettings:{settings:{},data:{},style:{box:"$shape",line:"$shape-guide",whisker:"$shape-guide",median:"$shape-guide--inverted"}},created(){this.state={}},render(t){let e=t.data;const n=this.rect,i=n.width,r=n.height,o="horizontal"===this.settings.settings.orientation,a=this.style,s=this.resolver,l=this.symbol,c=Ts.filter(t=>!this.settings.settings[t]||!1!==this.settings.settings[t].show),h={};c.forEach(t=>h[t]=zs[t]);const d=function(t){let e=t.keys,n=t.data,i=t.defaultSettings,r=t.style,o=t.settings,a=t.width,s=t.height,l=t.resolver;const c=u(!0,{},i||{},r||{}),h={major:"horizontal"===o.orientation?s:a,minor:"horizontal"===o.orientation?a:s},d=o.major;let f;f="object"==typeof d&&"object"==typeof d.ref&&void 0!==d.ref.start&&void 0!==d.ref.end?l.resolve({data:n,defaults:{start:0,end:1},scaled:h,settings:u(!0,{},{binStart:{scale:o.major.scale,ref:o.major.ref.start},binEnd:{scale:o.major.scale,ref:o.major.ref.end}})}):"object"==typeof d&&void 0!==d.binStart&&void 0!==d.binEnd?l.resolve({data:n,defaults:{start:0,end:1},scaled:h,settings:u(!0,{},{binStart:{scale:o.major.scale,ref:"binStart"},binEnd:{scale:o.major.scale,ref:"binEnd"}},o.major)}):l.resolve({data:n,scaled:h,defaults:{major:.5},settings:{major:o.major}});const p=o.minor||{},g={};["start","end","min","max","med"].forEach(t=>{(p[t]||n.items&&n.items.length&&n.items[0][t])&&(g[t]={scale:p.scale,ref:t})});let m,y={major:f,minor:l.resolve({data:n,defaults:{start:0,end:1},scaled:h,settings:u(!0,{},g,p)})};for(let t=0,i=e.length;t<i;t++)o[m]&&!1===o[m].show||(m=e[t],y[m]=l.resolve({data:n,defaults:c[m],settings:o[m],scaled:h}));return y}({keys:c,data:e,defaultSettings:h,style:a,settings:this.settings.settings,width:i,height:r,resolver:s});d.settings,d.items;const f=function(t){let e=t.width,n=t.height,i=t.flipXY,r=t.resolved,o=t.keys,a=t.symbol;const s=[],l=r.major.items;if(!l.length)return s;const c=e,h=n,d=i?n:e,f=r.major.settings,p=["start","end","min","max","med"].filter(t=>void 0!==r.minor.settings[t]),g=p.length,m=o.filter(t=>"oob"!==t);let y,x,b,w,k,_,M,S,R;const C=o?o.length:0,N=m?m.length:0;function D(){M?y.push(Ds({item:b,value:0,boxCenter:_,rendWidth:c,rendHeight:h,flipXY:i,symbol:a})):S&&y.push(Ds({item:b,value:1,boxCenter:_,rendWidth:c,rendHeight:h,flipXY:i,symbol:a}))}const q={box:function(){b.box&&v(b.start)&&v(b.end)&&y.push(qs({item:b,boxWidth:w,boxPadding:k,rendWidth:c,rendHeight:h,flipXY:i}))},line:function(){v(b.min)&&v(b.start)&&y.push(Es({item:b,from:b.min,to:b.start,boxCenter:_,rendWidth:c,rendHeight:h,flipXY:i})),v(b.max)&&v(b.end)&&y.push(Es({item:b,from:b.max,to:b.end,boxCenter:_,rendWidth:c,rendHeight:h,flipXY:i}))},median:function(){b.median&&v(b.med)&&y.push(Os({item:b,key:"median",position:b.med,width:w,boxCenter:_,rendWidth:c,rendHeight:h,flipXY:i}))},whisker:function(){if(b.whisker){const t=w*b.whisker.width;v(b.min)&&y.push(Os({item:b,key:"whisker",position:b.min,width:t,boxCenter:_,rendWidth:c,rendHeight:h,flipXY:i})),v(b.max)&&y.push(Os({item:b,key:"whisker",position:b.max,width:t,boxCenter:_,rendWidth:c,rendHeight:h,flipXY:i}))}}};function E(){let t,e=-Number.MAX_VALUE,n=Number.MAX_VALUE;for(let i=0;i<g;i++)t=b[p[i]],v(t)&&(e<t&&(e=t),n>t&&(n=t));M=e<0&&e!==-Number.MAX_VALUE,S=n>1&&n!==Number.MAX_VALUE,R=M||S}for(let t=0,e=l.length;t<e;t++){y=[],x=null;const e=l[t],n=e.data;let i=null,a=null;void 0!==f.binStart?(i=e.binStart,a=e.binEnd,x=f.binStart.scale):(x=f.major.scale,i=x?e.major:0);let c=0;x?x.bandwidth?(c=x.bandwidth(),i-=c/2):c=a-i:c=1,b=u({},{major:i,majorEnd:a},r.minor.items[t]);for(let e=0;e<C;e++)b[o[e]]=r[o[e]].items[t];if(w=As(c,b,d),k=(c-w)/2,_=k+b.major+w/2,E(),R)b.oob&&D();else for(let t=0;t<N;t++)b[m[t]]&&!1===b[m[t]].show||q[m[t]]();const h={type:"container",data:n,collider:{type:"bounds"},children:y};s.push(h)}return s}({width:i,height:r,flipXY:o,resolved:d,keys:c,symbol:l});return f}};const js={shape:"saltire",width:2,size:.5,fill:"#333",stroke:"#333",strokeWidth:0},Ps=/px$/,Fs={shape:"circle",label:"",fill:"#333",stroke:"#ccc",strokeDasharray:"",strokeWidth:0,strokeLinejoin:"miter",opacity:1,x:.5,y:.5,size:1,show:!0},Ls={imageSrc:void 0,imageScalingFactor:void 0,position:"center-center",symbol:"rectangle",width:void 0,height:void 0},$s={maxPx:1e4,minPx:1,maxRelExtent:.1,minRelExtent:.01,maxRelDiscrete:1,minRelDiscrete:.1};function Bs(t,e){return t&&"function"==typeof t.bandwidth?{isBandwidth:!0,value:Math.max(1,t.bandwidth()*e)}:{isBandwidth:!1,value:Math.max(1,e)}}function Hs(t,e,n,i){let r=e.width,o=e.height;return t.filter(t=>!1!==t.show&&!isNaN(t.x+t.y)).map(t=>{let e=t,a=Ps.test(t.size)?parseInt(t.size,10):n.min+e.size*(n.max-n.min);x(a)&&(e=js,a=n.min+e.size*(n.max-n.min));const s=function(t){let e=Fs.shape,n={};return"object"==typeof t.shape&&"string"==typeof t.shape.type?(e=t.shape.type,n=t.shape):"string"==typeof t.shape&&(e=t.shape),[e,n]}(e),l=m(s,2),c=l[0],u=g(g({},l[1]),{},{type:c,label:t.label,x:t.x*r,y:t.y*o,fill:e.fill,size:Math.min(n.maxGlobal,Math.max(n.minGlobal,a)),stroke:e.stroke,strokeWidth:e.strokeWidth,strokeDasharray:e.strokeDasharray,opacity:e.opacity,imageSettings:e.imageSettings});e===t.errorShape&&(u.width=e.width);const h=i(u);return h.data=t.data,h})}const Ws={require:["chart","resolver","symbol"],defaultSettings:{settings:{},data:{},animations:{enabled:!1,trackBy:t=>t.data.value},style:{item:"$shape"}},render(t){let e=t.data;const n=this.resolver.resolve({data:e,defaults:u({},Fs,this.style.item),settings:this.settings.settings,scaled:{x:this.rect.width,y:this.rect.height}}),i=this.rect,r=i.width,o=i.height,a=u({},$s,this.settings.settings.sizeLimits),s=n.items;s.length>0&&"image"===s[0].shape&&e.items.forEach((t,e)=>{s[e].imageSettings=u({},Ls,this.settings.settings.imageSettings)});const l=function(t,e,n,i,r){const o=Bs(t?t.scale:void 0,n),a=Bs(e?e.scale:void 0,i);let s=Math.min(o.value*r[o.isBandwidth?"maxRelDiscrete":"maxRelExtent"],a.value*r[a.isBandwidth?"maxRelDiscrete":"maxRelExtent"]),l=Math.min(o.value*r[o.isBandwidth?"minRelDiscrete":"minRelExtent"],a.value*r[a.isBandwidth?"minRelDiscrete":"minRelExtent"]);return{min:Math.max(1,Math.floor(l)),max:Math.max(1,Math.floor(s)),maxGlobal:r.maxPx,minGlobal:r.minPx}}(n.settings.x,n.settings.y,r,o,a);return Hs(s,this.rect,l,this.settings.shapeFn||this.symbol)}};const Vs={label:"",arc:1,show:!0,fill:"#333",stroke:"#ccc",strokeWidth:1,strokeLinejoin:"round",opacity:1,innerRadius:0,outerRadius:.8,cornerRadius:0,offset:0};function Us(t,e,n,i){let r=e.x,o=e.y,a=e.width,s=e.height;const l=Q(),c={x:r+a/2,y:o+s/2},u=Math.min(a,s)/2,h=Math.min(a,s)/2,d=h/100;return t.map((t,e)=>{const r=n[e];r.type="path";const o=h*r.outerRadius,a=u*r.innerRadius,s=d*r.cornerRadius;l.innerRadius(a),l.outerRadius(o),l.cornerRadius(s),r.arcDatum=t;const f=l.centroid(t),p=r.offset?function(t,e,n,i){let r=m(t,2),o=r[0],a=r[1];const s=Math.sqrt(o*o+a*a);o/=s,a/=s;const l=n-i;return{x:o*e*l,y:a*e*l}}(f,r.offset,o,a):{x:0,y:0};return r.transform="translate(".concat(p.x,", ").concat(p.y,") translate(").concat(c.x,", ").concat(c.y,")"),r.desc={share:t.value/i,slice:{start:t.startAngle,end:t.endAngle,innerRadius:a,outerRadius:o,cornerRadius:s,offset:{x:c.x+p.x,y:c.y+p.y}}},r})}function Ys(t,e){return t.slice&&"arc"in t.slice?e.arc:e.data.value}const Ks={require:["chart","resolver"],defaultSettings:{settings:{startAngle:0,endAngle:2*Math.PI,padAngle:0,slice:{}},style:{slice:"$shape"},data:{}},render(t){let e=t.data;const n=[],i=[],r=this.settings.settings,o=this.resolver.resolve({data:e,defaults:u({},Vs,this.style.slice),settings:r.slice}).items;let a=0;for(let t=0,e=o.length;t<e;t++){const e=Ys(r,o[t]);e>0&&o[t].outerRadius>=o[t].innerRadius&&(n.push(e),i.push(o[t]),a+=e)}const s=function(){var t=st,e=at,n=null,i=C(0),r=C(P),o=C(0);function a(a){var s,l,c,u,h,d=(a=tt(a)).length,f=0,p=new Array(d),g=new Array(d),m=+i.apply(this,arguments),y=Math.min(P,Math.max(-P,r.apply(this,arguments)-m)),v=Math.min(Math.abs(y)/d,o.apply(this,arguments)),x=v*(y<0?-1:1);for(s=0;s<d;++s)(h=g[p[s]=s]=+t(a[s],s,a))>0&&(f+=h);for(null!=e?p.sort(function(t,n){return e(g[t],g[n])}):null!=n&&p.sort(function(t,e){return n(a[t],a[e])}),s=0,c=f?(y-d*x)/f:0;s<d;++s,m=u)l=p[s],u=m+((h=g[l])>0?h*c:0)+x,g[l]={data:a[l],index:s,value:h,startAngle:m,endAngle:u,padAngle:v};return g}return a.value=function(e){return arguments.length?(t="function"==typeof e?e:C(+e),a):t},a.sortValues=function(t){return arguments.length?(e=t,n=null,a):e},a.sort=function(t){return arguments.length?(n=t,e=null,a):n},a.startAngle=function(t){return arguments.length?(i="function"==typeof t?t:C(+t),a):i},a.endAngle=function(t){return arguments.length?(r="function"==typeof t?t:C(+t),a):r},a.padAngle=function(t){return arguments.length?(o="function"==typeof t?t:C(+t),a):o},a}().sortValues(null);s.startAngle(r.startAngle),s.endAngle(r.endAngle),s.padAngle(r.padAngle);return Us(s(n),u({},this.rect,{x:0,y:0}),i,a)}};const Gs=function(t){function e(e){if(t[e.type]&&t[e.type].condition(e)){const n=t[e.type],i=void 0===n.conditionAppend||n.conditionAppend(e);n.items.forEach(t=>{const n=Math.round(e[t.key]),r=e[t.key]-n;e[t.key]=n,i&&"append"===t.type&&(r>0?e[t.key]+=.5:e[t.key]-=.5)})}}return void 0===t&&((t={}).line={append:["x1","x2","y1","y2"],round:[],condition:t=>t.x1===t.x2||t.y1===t.y2,conditionAppend:t=>t.strokeWidth%2!=0},t.rect={append:["x","y"],round:["width","height"],condition:()=>!0,conditionAppend:t=>t.strokeWidth%2!=0}),Object.keys(t).forEach(e=>{const n=t[e];n.items=[],n.append.forEach(t=>{n.items.push({key:t,type:"append"})}),n.round.forEach(t=>{n.items.push({key:t,type:"round"})})}),e.multiple=t=>t.forEach(t=>e(t)),e}();class Xs{constructor(){this.reset(),this.push(...arguments)}static evaluateKey(t,e){if(e){const e=t.substring(0,1),n=t.substring(1);if("x"===e)return"y".concat(n);if("y"===e)return"x".concat(n);if("cx"===t)return"cy";if("cy"===t)return"cx";if("width"===t)return"height";if("height"===t)return"width"}return t}transposeCoordinate(t,e,n){if("number"==typeof e&&isFinite(e)){const i=t.substring(0,1);if("x"===i||"cx"===t)return e*this.width;if("width"===t)return e*this.width;if("r"===t)return e*(n?this.height:this.width);if("y"===i||"cy"===t)return e*this.height;if("height"===t)return e*this.height}return e}push(){return this.storage.push(...arguments),this}processItem(t){let e={};const n=void 0!==t.flipXY?t.flipXY:this.flipXY,i=void 0!==t.crisp?t.crisp:this.crisp;if(t.fn&&"function"==typeof t.fn){let i=n?this.height:this.width,r=n?this.width:this.height;t=t.fn({width:i,height:r,flipXY:n});const o=Object.keys(t);for(let i=0,r=o.length;i<r;i++){let r=o[i];e[Xs.evaluateKey(r,n)]=t[r]}}else{const i=Object.keys(t);for(let r=0,o=i.length;r<o;r++){let o=i[r];const a=Xs.evaluateKey(o,n),s=this.transposeCoordinate(a,t[o],n);e[a]=s}}return i&&Gs(e),e}output(){let t=[];for(let e=0,n=this.storage.length;e<n;e++){let n=this.processItem(this.storage[e]);t.push(n)}return t}reset(){this.storage=[],this.flipXY=!1,this.crisp=!1,this.width=0,this.height=0}}function Js(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return new Xs(...e)}function Zs(t,e){return t&&e?t.cachedTicks&&t.cachedTicks()||t.ticks({distance:e}):[]}const Qs={created(){},require:["chart","renderer","resolver"],defaultSettings:{layout:{displayOrder:0},style:{ticks:"$guide-line",minorTicks:"$guide-line--minor"}},beforeRender(){this.blueprint=Js(),this.blueprint.width=this.rect.width,this.blueprint.height=this.rect.height,this.blueprint.x=this.rect.x,this.blueprint.y=this.rect.y,this.blueprint.crisp=!0},render(){if(this.x=this.settings.x?this.chart.scale(this.settings.x):null,this.y=this.settings.y?this.chart.scale(this.settings.y):null,Fo(this,"x",this.rect.width),Fo(this,"y",this.rect.height),!this.x&&!this.y)return[];this.settings.ticks=u({show:!0},this.style.ticks,this.settings.ticks||{}),this.settings.minorTicks=u({show:!1},this.style.minorTicks,this.settings.minorTicks||{}),this.lines={x:[],y:[]},this.lines.x=Zs(this.x,this.rect.width),this.lines.y=Zs(this.y,this.rect.height),this.lines.y=this.lines.y.map(t=>u(t,{flipXY:!0}));let t=t=>{let e=t.dir,n=t.isMinor,i=this.lines[e].filter(t=>!!t.isMinor===n),r=n?this.settings.minorTicks:this.settings.ticks;this.resolver.resolve({settings:r,data:{items:i,dir:e}}).items.forEach(t=>{let n=t.data;var i,r;t.show&&this.blueprint.push({type:"line",x1:n.position,y1:0,x2:n.position,y2:1,stroke:t.stroke||"black",strokeWidth:void 0!==t.strokeWidth?t.strokeWidth:1,strokeDasharray:void 0!==t.strokeDasharray?t.strokeDasharray:void 0,flipXY:n.flipXY||!1,value:null!==(i=n.value)&&void 0!==i?i:null===(r=n.data)||void 0===r?void 0:r.value,dir:e})})};return t({dir:"x",isMinor:!1}),t({dir:"x",isMinor:!0}),t({dir:"y",isMinor:!1}),t({dir:"y",isMinor:!0}),this.blueprint.output()}};function tl(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"bottom";if(n*=.8,"left"===i||"right"===i){let r="right"===i;return"\n M ".concat(t," ").concat(e-n,"\n A ").concat(1.25*n," ").concat(1.25*n,", 0, 1, ").concat(r?0:1,", ").concat(t," ").concat(e+n,"\n L ").concat(r?t+n:t-n," ").concat(e," Z\n ")}let r="bottom"===i;return"\n M ".concat(t-n," ").concat(e,"\n A ").concat(1.25*n," ").concat(1.25*n,", 0, 1, ").concat(r?1:0,", ").concat(t+n," ").concat(e,"\n L ").concat(t," ").concat(r?e+n:e-n," Z\n ")}function el(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"bottom";if(n*=.75,"left"===i||"right"===i){let r="right"===i;return"\n M ".concat(t+=r?1.5*n:-1.5*n," ").concat(e-n,"\n L ").concat(t," ").concat(e+n,"\n L ").concat(r?t+n:t-n," ").concat(e," Z\n ")}let r="bottom"===i;return e+=r?1.5*n:-1.5*n,"\n M ".concat(t-n," ").concat(e,"\n L ").concat(t+n," ").concat(e,"\n L ").concat(t," ").concat(r?e+n:e-n," Z\n ")}function nl(t,e,n){return t<e||t>n}function il(t,e){if("string"==typeof t.formatter)return e.formatter(t.formatter);if("object"==typeof t.formatter)return e.formatter(t.formatter);if(void 0!==t.scale&&t.scale.data){const e=t.scale.data()&&t.scale.data().fields;return e&&e[0]?e[0].formatter():null}return null}function rl(t){if(void 0===t)return 0;if("number"==typeof t&&isFinite(t))return t;if("string"==typeof t)switch(t){case"center":case"middle":return.5;case"bottom":case"right":return 1;default:return 0}return 0}function ol(t){var e,n;let i=t.chart,r=t.blueprint,o=t.renderer,a=t.p,s=t.settings,l=t.items,c=t.slopeLine,h=!0,d=!1,f=!1,p=!1,g=!1,m=u(!0,{},s.style.line,a.line||{}),y=u(!0,{fill:"#000",fontFamily:"Arial",fontSize:"12px",opacity:1,maxWidth:1,maxWidthPx:9999,padding:5,background:{fill:"#fff",stroke:"transparent",strokeWidth:0,opacity:.5}},s.style.label||{},{fill:m.stroke});if(d=c?r.processItem({type:"line",x1:c.x1,y1:c.y1,x2:c.x2,y2:c.y2,stroke:m.stroke||"black",strokeWidth:m.strokeWidth||1,strokeDasharray:m.strokeDasharray,flipXY:!1,value:a.valueInfo?a.valueInfo.id:a.value}):r.processItem({type:"line",x1:a.position,y1:0,x2:a.position,y2:1,stroke:m.stroke||"black",strokeWidth:m.strokeWidth||1,strokeDasharray:m.strokeDasharray,flipXY:a.flipXY||!1,value:a.valueInfo?a.valueInfo.id:a.value}),a.label&&!1!==a.label.show&&(null==c||!c.slope||0===c.slope)){const t=u(!0,{fill:"#000",fontFamily:"Arial",fontSize:"12px",opacity:1,maxWidth:1,maxWidthPx:9999,padding:5,background:{fill:"#fff",stroke:"transparent",strokeWidth:0,opacity:.5}},s.style.label||{},{fill:m.stroke},a.label);let e,n={width:0,height:0},c="";e=il(a,i),!1!==a.label.showValue&&(e?c=" (".concat(e(a.value),")"):a.scale&&(c=" (".concat(a.value,")"))),c&&(n=o.measureText({text:c,fontFamily:t.fontFamily,fontSize:t.fontSize}));let d=o.measureText({text:t.text||"",fontFamily:t.fontFamily,fontSize:t.fontSize}),y={width:d.width+n.width,height:Math.max(d.height,n.height)},v=t.padding,x=rl(a.flipXY?t.vAlign:t.align),b=rl(a.flipXY?t.align:t.vAlign),w=Math.min(1+y.width+2*v,t.maxWidth*r.width,t.maxWidthPx),k=y.height+2*v,_=a.flipXY?k:w,M=a.flipXY?w:k;if(f=r.processItem({fn:e=>{let n=e.width,i=e.height,o=a.position*n-(a.flipXY?k:w)*(1-x);o=a.flipXY?o:Math.max(o,0);return{type:"rect",x:o,y:Math.max(Math.abs(b*i-M*b),0),width:a.flipXY?_:Math.min(_,r.width-o),height:M,stroke:t.background.stroke,strokeWidth:t.background.strokeWidth,fill:t.background.fill,opacity:t.background.opacity}},flipXY:a.flipXY||!1}),f.x<-1||f.x+f.width>r.width+1||f.y<-1||f.y+f.height>r.height+1)f=void 0;else{p={type:"text",text:t.text||"",fill:t.fill,opacity:t.opacity,fontFamily:t.fontFamily,fontSize:t.fontSize,x:f.x+v,y:f.y+f.height/2+y.height/3,maxWidth:f.width-2*v-n.width,anchor:"start"},c&&(g={type:"text",text:c||"",fill:t.fill,opacity:t.opacity,fontFamily:t.fontFamily,fontSize:t.fontSize,x:p.x+3+(f.width-(n.width+2*v)),y:p.y});for(let t=0,e=l.length;t<e;t++){let e=l[t];"rect"===e.type?za(f,e)&&(h=!1):"line"===e.type&&a.flipXY===e.flipXY&&ja(f,e)&&(h=!1)}}}if(d&&l.push(d),c&&0!==c.slope&&(!1!==(null===(e=c.label)||void 0===e?void 0:e.show)||!1!==(null===(n=c.label)||void 0===n?void 0:n.showValue))){var v,x,b;let t,e;const n=120;let s=!1!==(null===(v=c.label)||void 0===v?void 0:v.show)?null===(x=c.label)||void 0===x?void 0:x.text:"";if(!1!==(null===(b=c.label)||void 0===b?void 0:b.showValue)){var w;const e=il(a,i),n=e?e(c.value):c.value;t="(".concat(c.slope,"x + ").concat(n,")"),s+=null!==(w=c.label)&&void 0!==w&&w.text?" ".concat(t):t}if(s.length>1){var k,_,M;const t=o.measureText({text:s,fontFamily:y.fontFamily,fontSize:y.fontSize});t.width=t.width>n?n:t.width;const a=function(t,e,n){const i=t.scale({scale:"x"}),r=t.scale({scale:"y"});if(e>0){if(i.max()*e+n>=r.max())return!0}else if(e<0&&i.min()*e+n>=r.max())return!0;return!1}(i,c.slope,c.value)?function(t,e,n){const i=t.scale({scale:"x"}),r=t.scale({scale:"y"});return i((r.max()-n)/e)}(i,c.slope,c.value):void 0,u=void 0===a||c.isRtl?y.padding:3*y.padding,h=void 0!==a||c.slope>0?3*y.padding:y.padding,f=function(t,e,n,i,r,o){let a=0;if(void 0!==n){if(n<.8)return a=t.slope<0||t.isRtl?3*o.padding:2*o.padding,t.isRtl,n*r.width+a;if(1===n)return t.isRtl?n*r.width-(i.width+3*o.padding):n*r.width-(i.width+6*o.padding);if(n>.8)return t.isRtl?n*r.width-(i.width+3*o.padding):n*r.width-(i.width+6*o.padding)}else if(t.slope>0)return e.x2-(i.width+2*o.padding);return t.isRtl?e.x1-(i.width+2*o.padding):e.x1}(c,d,a,t,r,y),p=Math.min(d.y1,d.y2);null!==(k=c.label)&&void 0!==k&&k.stroke&&(e={type:"rect",x:c.isRtl?Math.max(f,u)-2:Math.max(f,u)+2,y:Math.abs(Math.max(p,h)-t.height),rx:3,ry:3,width:t.width+y.padding,height:t.height-2,stroke:m.stroke,fill:m.stroke});const g={type:"text",text:s,fill:null!==(_=null===(M=c.label)||void 0===M?void 0:M.stroke)&&void 0!==_?_:m.stroke,opacity:y.opacity,fontFamily:y.fontFamily,fontSize:y.fontSize,x:e?e.x+2:Math.max(f,u)+2,y:e?e.y+t.height-y.padding:Math.abs(Math.max(p,h)-y.padding/2),anchor:"start",title:s,maxWidth:n,width:t.width};(function(t,e,n,i,r){for(let o=0,a=t.length;o<a;o++){const a=t[o];if("text"===(null==a?void 0:a.type)&&Math.abs(a.x-e.x)<Math.max(a.width+i,e.width+i)&&Math.abs(a.y-e.y)<n.height+r)return!0}return!1})(l,g,t,u,h)||(e&&l.push(e),l.push(g))}}h&&f&&p&&(l.push(f,p),g&&l.push(g))}function al(t){const e={value:t.value};return t.label&&(e.label=t.label.text),e}function sl(t){return void 0!==("function"==typeof t.value?t.value():t.value)}function ll(t,e){const n=t.min();if(n===t.max()){const i=function(t){const e=t.range();return 2===(null==e?void 0:e.length)&&e[0]>e[1]}(t);if(e<n)return i?2:-1;if(e>n)return i?-1:2}return t(e)}function cl(t,e){return t&&e&&Math.abs(t.x-e.x)<1e-15&&Math.abs(t.y-e.y)<1e-15}const ul={require:["chart","renderer"],defaultSettings:{layout:{displayOrder:0},style:{oob:{show:!0,width:10,fill:"#1A1A1A",stroke:"transparent",strokeWidth:0,opacity:1,text:{fontFamily:"Arial",stroke:"transparent",fill:"#fff",strokeWidth:0,opacity:1},triangle:{fill:"#4D4D4D",stroke:"transparent",strokeWidth:0,opacity:1},padding:{x:28,y:5}},line:{stroke:"#000"},label:{strokeWidth:0}}},preferredSize:()=>30,beforeRender(){this.blueprint=Js(),this.blueprint.width=this.rect.width,this.blueprint.height=this.rect.height,this.blueprint.x=this.rect.x,this.blueprint.y=this.rect.y,this.blueprint.crisp=!0},render(){let t=this.settings;if(this.lines={x:[],y:[]},this.lines.x=t.lines&&t.lines.x||[],this.lines.y=t.lines&&t.lines.y||[],0===this.lines.x.length&&0===this.lines.y.length)return[];const e={x0:[],x1:[],y0:[],y1:[]};this.lines.x=this.lines.x.filter(sl).map(t=>{if("function"==typeof t.value&&(t.value=t.value()),t.scale){let e=this.chart.scale(t.scale);const n=ll(e,t.value);return u(t,{scale:e,position:n})}return u(t,{position:t.value})}),this.lines.y=this.lines.y.filter(sl).map(t=>{if("function"==typeof t.value&&(t.value=t.value()),t.scale){let e=this.chart.scale(t.scale);const n=ll(e,t.value);return u(t,{scale:e,position:n,flipXY:!0})}return u(t,{position:t.value,flipXY:!0})}),this.lines.x=this.lines.x.filter(t=>!(t.position<0||t.position>1)||(e["x".concat(t.position>1?1:0)].push(al(t)),!1)),this.lines.y=this.lines.y.filter(t=>!(!t.slope||0===t.slope)||(!(t.position<0||t.position>1)||(e["y".concat(t.position>1?1:0)].push(al(t)),!1)));let n=[];return[...this.lines.x,...this.lines.y].forEach(i=>{if(!0===i.show||void 0===i.show){let r;if(i.slope&&0!==i.slope){const t=this.chart.scale({scale:"x"}),n=this.chart.scale({scale:"y"}),o=t.min(),a=t.max(),s=n.min(),l=n.max();r=g(g({},i),{},{x1:void 0,y1:void 0,x2:void 0,y2:void 0});const c=o*i.slope+i.value,u=a*i.slope+i.value,h=(s-i.value)/i.slope,d=(l-i.value)/i.slope;let f=[];nl(c,s,l)||(f[0]={x:ll(t,o),y:ll(n,c)}),nl(h,o,a)||(f[1]={x:ll(t,h),y:1}),nl(u,s,l)||(f[2]={x:ll(t,a),y:ll(n,u)}),nl(d,o,a)||(f[3]={x:ll(t,d),y:0});if(f.filter(t=>!!t).length>2&&function(t){cl(t[0],t[1])&&(t[1]=void 0),cl(t[1],t[2])&&(t[2]=void 0),cl(t[2],t[3])&&(t[3]=void 0),cl(t[3],t[0])&&(t[3]=void 0)}(f),f=f.filter(t=>!!t),f.length<2)return void e["y".concat(c>l?0:1)].push(al(i));r.x1=f[0].x,r.y1=f[0].y,r.x2=f[1].x,r.y2=f[1].y}else r=void 0;ol({chart:this.chart,blueprint:this.blueprint,renderer:this.renderer,p:i,settings:t,items:n,slopeLine:r})}}),t.style.oob.show&&function(t){let e=t.blueprint,n=t.oob,i=t.settings,r=t.items;const o=Object.keys(n);let a=i.style.oob||{};for(let t=0,i=o.length;t<i;t++){const i=o[t],s=n[i];if(s.length>0){let t=i.charAt(1),n="y"===i.charAt(0),o=a.padding.x+a.width,l=a.padding.y+a.width,c="bottom";c=n?"1"===t?"bottom":"top":"1"===t?"right":"left";let u=e.processItem({fn:e=>{let i=e.width,r=e.height,u=t*i+("1"===t?-o:o),h=n?l:r-l;return"arc"===a.type?{type:"path",d:tl(n?h:u,n?u:h,a.width,c),x:u,y:h,stroke:a.stroke,fill:a.fill,strokeWidth:a.strokeWidth||0}:{type:"circle",cx:u,cy:h,r:a.width,stroke:a.stroke,fill:a.fill,strokeWidth:a.strokeWidth||0,opacity:a.opacity,data:s}},flipXY:n}),h=u.cx||u.x,d=u.cy||u.y;const f=s.map(t=>t.label?"".concat(t.label," (").concat(t.value,")"):"(".concat(t.value,")")),p=f.reduce((t,e,n)=>0===n?e:"".concat(t,"\n\n").concat(e),"");let g={type:"text",text:s.length||"",title:p,x:h-.4*a.width,y:d+.4*a.width,fontFamily:a.text.fontFamily,fontSize:"".concat(1.3*a.width,"px"),stroke:a.text.stroke,fill:a.text.fill,strokeWidth:a.text.strokeWidth||0,opacity:a.text.opacity},m={type:"path",d:el(h,d,a.width,c),x:h,y:d,stroke:a.triangle.stroke,fill:a.triangle.fill,strokeWidth:a.triangle.strokeWidth||0,opacity:a.triangle.opacity};r.push(u,g,m)}}}({blueprint:this.blueprint,oob:e,settings:t,items:n}),n}};function hl(t){const e={type:"line",x1:0,x2:0,y1:0,y2:0,collider:{type:null}};return"top"===t.align||"bottom"===t.align?(e.x1=t.innerRect.x-t.outerRect.x,e.x2=e.x1+t.innerRect.width,e.y1=e.y2="top"===t.align?t.innerRect.height-t.padding:t.padding):(e.x1=e.x2="left"===t.align?t.innerRect.width-t.padding:t.padding,e.y1=t.innerRect.y-t.outerRect.y,e.y2=e.y1+t.innerRect.height),function(t,e){u(t,e.style)}(e,t),e}function dl(t){return"string"==typeof t||"number"==typeof t?t:"-"}function fl(t,e,n){n.layered||!n.stepSize?function(t,e){e.collider={type:"polygon",vertices:[{x:e.boundingRect.x,y:e.boundingRect.y},{x:e.boundingRect.x+e.boundingRect.width,y:e.boundingRect.y},{x:e.boundingRect.x+e.boundingRect.width,y:e.boundingRect.y+e.boundingRect.height},{x:e.boundingRect.x,y:e.boundingRect.y+e.boundingRect.height}]}}(0,e):n.tilted?function(t,e,n){const i=n.angle*(Math.PI/180),r=Math.max(n.stepSize/2,e.boundingRect.height/2),o="start"===e.anchor,a="end"===e.anchor&&i<0,s="start"===e.anchor&&i>=0,l=e.boundingRect.y+(s||a?e.boundingRect.height:0),c=[{x:e.x-r,y:l},{x:e.x+r,y:l}].map(t=>sa(t,i,{x:e.x,y:e.y})),u={x:o?e.boundingRect.x+e.boundingRect.width+10:e.boundingRect.x-10,y:e.boundingRect.y+e.boundingRect.height},h={x:o?e.boundingRect.x+e.boundingRect.width+10:e.boundingRect.x-10,y:e.boundingRect.y},d=i>=0?[u,h]:[h,u];c.push(...d),e.collider={type:"polygon",vertices:c}}(0,e,n):function(t,e,n){if("bottom"===n.align||"top"===n.align){const i=t.position*n.innerRect.width+(n.innerRect.x-n.outerRect.x-n.stepSize/2);e.collider={type:"rect",x:i,y:0,width:i<0?n.stepSize+i:n.stepSize,height:n.innerRect.height}}else{const i=t.position*n.innerRect.height+(n.innerRect.y-n.outerRect.y-n.stepSize/2);e.collider={type:"rect",x:0,y:i,width:n.innerRect.width,height:i<0?n.stepSize+i:n.stepSize}}const i=e.collider;i.x=Math.max(i.x,0),i.y=Math.max(i.y,0);const r=i.x+i.width-(n.outerRect.x+n.outerRect.width);i.width=r>0?i.width-r:i.width;const o=i.y+i.height-(n.outerRect.y+n.outerRect.height);i.height=o>0?i.height-o:i.height}(t,e,n)}function pl(t,e){const n=isNaN(t.style.align)?.5:Math.min(Math.max(t.style.align,0),1);let i=0;if(t.tilted)i=t.stepSize*n;else{const r=e?t.textRect.height:t.textRect.width;i=Math.max(0,t.stepSize-r)*n}return i}function gl(t,e){var n,i;const r={type:"text",text:dl(t.label),x:0,y:0,maxWidth:e.maxWidth,maxHeight:e.maxHeight,tickValue:null!==(n=t.value)&&void 0!==n?n:null===(i=t.data)||void 0===i?void 0:i.value};return"top"===e.align||"bottom"===e.align?(r.x=t.start*e.innerRect.width+(e.innerRect.x-e.outerRect.x)+pl(e,!1),r.y="top"===e.align?e.innerRect.height:0,r.anchor=e.stepSize?"start":"middle",r.x+=isNaN(e.style.offset)?0:+e.style.offset):(r.y=t.start*e.innerRect.height+(e.innerRect.y-e.outerRect.y)+pl(e,!0),r.x="left"===e.align?e.innerRect.width:0,r.anchor="left"===e.align?"end":"start",r.baseline=e.stepSize?"text-before-edge":"central",r.y+=isNaN(e.style.offset)?0:+e.style.offset),function(t,e){["fill","fontSize","fontFamily"].forEach(n=>{t[n]=e.style[n]})}(r,e),function(t,e){if(!e.tilted&&!e.stepSize)if("top"===e.align||"bottom"===e.align){const n=0,i=e.outerRect.width,r=Math.min(e.maxWidth/2,e.textRect.width/2),o=t.x-r,a=t.x+r;o<n?(t.anchor="start",t.x=e.innerRect.x-e.outerRect.x):a>i&&(t.anchor="end",t.x=e.innerRect.width+e.innerRect.x)}else{const n=0,i=e.outerRect.height,r=e.maxHeight/2,o=t.y-r,a=t.y+r;o<n?(t.y=e.innerRect.y-e.outerRect.y,t.baseline="text-before-edge"):a>i&&(t.y=e.innerRect.height+(e.innerRect.y-e.outerRect.y),t.baseline="text-after-edge")}}(r,e),function(t,e){"top"===e.align?t.y-=e.padding:"bottom"===e.align?t.y+=e.padding+e.maxHeight:"left"===e.align?t.x-=e.padding:"right"===e.align&&(t.x+=e.padding)}(r,e),function(t,e){if(e.tilted){const n=-e.angle,i=n*(Math.PI/180);"bottom"===e.align?(t.x-=e.maxHeight*Math.sin(i)/2,t.y-=e.maxHeight,t.y+=e.maxHeight*Math.cos(i)/2):t.x-=e.maxHeight*Math.sin(i)/3,t.transform="rotate(".concat(n,", ").concat(t.x,", ").concat(t.y,")"),t.anchor="bottom"===e.align==e.angle<0?"start":"end";const r=Math.cos(i)*e.maxWidth;if("bottom"===e.align==e.angle<0){const n=e.outerRect.width-e.paddingEnd;t.x+r>n&&(t.maxWidth=(n-t.x-10)/Math.cos(i))}else{const n=e.paddingEnd;t.x-r<n&&(t.maxWidth=(t.x-n-10)/Math.cos(i))}}}(r,e),function(t,e){t.boundingRect=e.textBounds(t)}(r,e),fl(t,r,e),r}function ml(t,e){const n={type:"line",x1:0,x2:0,y1:0,y2:0,collider:{type:null},tickValue:t.value};return"top"===e.align||"bottom"===e.align?(n.x1=n.x2=t.position*e.innerRect.width+(e.innerRect.x-e.outerRect.x),n.y1="top"===e.align?e.innerRect.height:0,n.y2="top"===e.align?n.y1-e.tickSize:n.y1+e.tickSize):(n.y1=n.y2=t.position*e.innerRect.height+(e.innerRect.y-e.outerRect.y),n.x1="left"===e.align?e.innerRect.width:0,n.x2="left"===e.align?n.x1-e.tickSize:n.x1+e.tickSize),function(t,e){u(t,e.style)}(n,e),function(t,e){"top"===e.align?(t.y1-=e.padding,t.y2-=e.padding):"bottom"===e.align?(t.y1+=e.padding,t.y2+=e.padding):"left"===e.align?(t.x1-=e.padding,t.x2-=e.padding):"right"===e.align&&(t.x1+=e.padding,t.x2+=e.padding)}(n,e),function(t,e){const n=t.strokeWidth/2;t.x1===e.innerRect.width?(t.x1-=n,t.x2-=n):0===t.x1?(t.x1+=n,t.x2+=n):t.y1===e.innerRect.height?(t.y1-=n,t.y2-=n):0===t.y1&&(t.y1+=n,t.y2+=n)}(n,e),n}function yl(t){return!t.isMinor&&t.position>=0&&t.position<=1}function vl(t){let e=t.rect,n=t.state,i=t.majorTicks,r=t.measure;return t.horizontal?function(t){let e=t.majorTicks,n=t.measureText,i=t.rect;const r="layered"===t.state.labels.activeMode?2:1,o=i.width,a=e.map(t=>t.label).map(t=>"".concat(t.slice(0,1)).concat(t.length>1?"…":"")).map(n).map(t=>t.width);for(let t=0;t<e.length;++t){const n=e[t];if(r*o*Math.abs(n.start-n.end)<a[t])return!0}return!1}({majorTicks:i,measureText:r,rect:e,state:n}):function(t){let e=t.majorTicks,n=t.measureText;const i=t.rect.height,r=n("M").height;return!(e.length<2)&&i*Math.abs(e[0].position-e[1].position)<r}({majorTicks:i,measureText:r,rect:e})}function xl(t){let e=t.value,n=t.maxValue,i=t.minValue,r=t.range,o=t.modifier;return isNaN(r)||isNaN(o)||(e=r*o),e>n&&(e=n),e<i&&(e=i),e}function bl(t){let e=t.isDiscrete,n=t.rect,i=t.formatter,r=t.measureText,o=t.scale,a=t.settings,s=t.state,l=0;const c={left:0,top:0,right:0,bottom:0},u=a.labels,h=u.maxLengthPx,d=u.minLengthPx;if(a.labels.show){const t=a.align,u="top"===t||"bottom"===t,f=u?n.inner.width:n.inner.height,p=o.ticks({settings:a,distance:f,formatter:i}).filter(yl),g=t=>{const e=r({text:t,fontSize:a.labels.fontSize,fontFamily:a.labels.fontFamily});return e.width=xl({value:e.width,maxValue:h,minValue:d}),e};if(e&&u&&"auto"===a.labels.mode&&(!function(t){let e=t.majorTicks,n=t.measure,i=t.rect,r=t.state,o=t.settings;const a=o.labels.maxGlyphCount,s="layered"===r.labels.activeMode?2:1,l=o.labels.tiltThreshold?o.labels.tiltThreshold:.7,c=n("…").width,u=i.width;let h=0,d=0;if(isNaN(a))for(let t=0;t<e.length;t++){const i=e[t],r=i.label,o=n(r).width*(r.length>1?l:1);if(d=s*u*Math.abs(i.start-i.end),o+c>d)return!0}else if(d=s*u*e.reduce((t,e)=>Math.min(Math.abs(e.start-e.end),t),1/0),h=n("M").width*l*a,h+c>d)return!0;return!1}({majorTicks:p,measure:g,rect:n.inner,state:s,settings:a})?s.labels.activeMode="horizontal":s.labels.activeMode="tilted"),!a.labels.filterOverlapping&&"tilted"!==s.labels.activeMode&&vl({rect:n.inner,state:s,majorTicks:p,measure:g,horizontal:u})){return{size:Math.max(n.outer.width,n.outer.height),isToLarge:!0}}let m,y;if("tilted"===s.labels.activeMode){const t=Math.abs(a.labels.tiltAngle)*(Math.PI/180);m=e=>xl({value:e.width,maxValue:h,minValue:d})*Math.sin(t)+e.height*Math.cos(t)}else m=u?t=>t.height:t=>xl({value:t.width,maxValue:h,minValue:d});if(u&&"tilted"!==s.labels.activeMode)y=["M"];else if(isNaN(a.labels.maxGlyphCount))y=p.map(t=>t.label);else{let t="";for(let e=0;e<a.labels.maxGlyphCount;e++)t+="M";y=[t]}const v=y.map(g),x=v.map(m),b=Math.max(...x,0);if(l+=b,l+=a.labels.margin,"layered"===s.labels.activeMode&&(l*=2),"tilted"===s.labels.activeMode){const t="bottom"===a.align==a.labels.tiltAngle>=0,e=Math.abs(a.labels.tiltAngle)*(Math.PI/180),i=(b-g("M").height*Math.cos(e))/Math.sin(e),r=t=>Math.min(i,t.width)*Math.cos(e)+t.height,o=(e,i)=>{const r=p[i]?p[i].position:0;return t?e-r*n.inner.width:e-(1-r)*n.inner.width},s=Math.min(a.labels.maxEdgeBleed,Math.max(...v.map(r).map(o),0))+a.paddingEnd;if(c[t?"left":"right"]=s,!a.labels.filterOverlapping&&function(t){let e=t.majorTicks,n=t.measureText,i=t.rect,r=t.bleedSize,o=t.angle;if(e.length<2)return!1;if(0===o)return!0;const a=Math.abs(o),s=1/(Math.min(i.outer.width-r,i.inner.width)*Math.abs(e[0].position-e[1].position));return n("M").height>Math.sin(a*(Math.PI/180))/s}({majorTicks:p,measureText:g,rect:n,bleedSize:s,angle:a.labels.tiltAngle})){return{size:Math.max(n.outer.width,n.outer.height),isToLarge:!0}}}}return{size:l,edgeBleed:c}}const wl=(t,e,n)=>t.width*Math.abs(e.position-n.position);function kl(t){let e=t.layered,n=t.major,i=t.innerRect,r=t.outerRect,o=t.tick,a=t.index;const s=e?2:1,l=n[a-s],c=n[a+s],u=l?wl(i,o,l)/2-2:1/0,h=c?wl(i,o,c)/2-2:1/0;return n.length<2?i.width:l?c?2*Math.min(u,h):(t=>{let e=t.innerRect,n=t.outerRect,i=t.tick,r=t.prevWidth;const o=e.x-n.x,a=n.width-e.width-o,s=e.width-e.width*i.position+a,l=2*Math.min(r,s),c=1===i.position?e.width/2-2:0;return Math.max(r,l,c)})({innerRect:i,outerRect:r,tick:o,prevWidth:u}):(t=>{let e=t.innerRect,n=t.outerRect,i=t.tick,r=t.nextWidth;const o=e.x-n.x,a=e.width*i.position+o,s=2*Math.min(r,a),l=0===i.position?e.width/2-2:0;return Math.max(r,s,l)})({innerRect:i,outerRect:r,tick:o,nextWidth:h})}function _l(t){const e=t.innerRect,n={cx:e.width/2,cy:e.height/2},i=Math.min(e.height,e.width)/2*t.radius,r=i+t.style.strokeWidth,o={visible:!0,type:"path",arcDatum:{startAngle:t.startAngle,endAngle:t.endAngle},transform:"translate(0, 0) translate(".concat(n.cx,", ").concat(n.cy,")"),desc:{share:1,slice:{cornerRadius:0,innerRadius:i,outerRadius:r}},ticks:[]};return function(t,e){u(t,e.style)}(o,t),o}function Ml(t,e,n,i){return{x:t+n*Math.cos(i),y:e+n*Math.sin(i)}}function Sl(t,e){const n=e.innerRect,i={cx:n.width/2,cy:n.height/2},r=Math.min(n.height,n.width)/2*e.radius+e.padding,o=e.startAngle,a=e.endAngle,s=e.tickSize,l=a-o;let c=a-t.position*l;c-=Math.PI/2;const h=Ml(i.cx,i.cy,r+s,c),d=Ml(i.cx,i.cy,r,c),f={type:"line",x1:h.x,y1:h.y,x2:d.x,y2:d.y,value:t.value};return function(t,e){const n=g({},e.style);u(t,n)}(f,e),f}function Rl(t){return"string"==typeof t||"number"==typeof t?t:"-"}function Cl(t,e,n){let i;return i="left"===e?n.x:"right"===e?t.outerRect.width-n.x:Math.max(n.x,t.outerRect.width-n.x),i}function Nl(t,e){const n=e.innerRect,i={cx:n.width/2,cy:n.height/2},r=Math.min(n.height,n.width)/2*e.radius+e.padding,o=e.startAngle,a=e.endAngle,s=e.tickSize,l=a-o,c=.2;let u,h;u="top"===e.align||"bottom"===e.align?a-t.position*l:o+t.position*l,h=u<-.2&&u>-Math.PI+c?"left":u>.2&&u<Math.PI-c?"right":"center",u-=Math.PI/2;const d=function(t,e,n,i){return{x:t+n*Math.cos(i),y:e+n*Math.sin(i)}}(i.cx,i.cy,r+s+6,u);let f;f="left"===h?"end":"right"===h?"start":"middle";const p={type:"text",text:Rl(t.label),align:h,x:d.x,y:d.y,maxHeight:e.maxHeight,maxWidth:Cl(e,h,d),anchor:f,baseline:"middle"};return function(t,e){["fill","fontSize","fontFamily"].forEach(n=>{t[n]=e.style[n]})}(p,e),function(t,e){t.boundingRect=e.textBounds(t)}(p,e),function(t,e,n){let i,r;const o=parseFloat(n.fontSize)||0;i=e.y-o/2,r=t.innerRect.height-(e.y+o/2),(i<0||r<0)&&(n.text="")}(e,d,p),p}function Dl(t){let e=0;return e+=t.paddingStart,e+=t.line.show?t.line.strokeWidth/2:0,e+=t.ticks.show?t.ticks.margin:0,e}function ql(t){let e=0;return e+=t.line.show?t.line.strokeWidth/2:0,e+=t.ticks.show?t.ticks.margin:0,e}function El(t){let e=0;return e+=t.ticks.show?t.ticks.tickSize:0,e+=Dl(t)+t.labels.margin,e}function Ol(t,e){return t.map(t=>ml(t,e))}function Al(t,e){return e?Math.abs(e.end-e.start):t.bandwidth()}function zl(t){let e=t.textMetrics,n=t.settings,i=t.innerRect,r=t.scale,o=t.tilted,a=t.layered,s=t.tick;const l=e.height,c=Al(r,s),u={width:0,height:l};if("left"===n.align||"right"===n.align)u.width=i.width-El(n)-n.paddingEnd;else if(a)u.width=c*i.width*2;else if(o){const t=Math.abs(n.labels.tiltAngle)*(Math.PI/180);u.width=(i.height-El(n)-n.paddingEnd-l*Math.cos(t))/Math.sin(t)}else u.width=c*i.width;return u.width=xl({value:u.width,maxValue:n.labels.maxLengthPx,minValue:n.labels.minLengthPx}),u}function Tl(t){let e=t.textMetrics,n=t.settings,i=t.innerRect,r=t.outerRect,o=t.tilted,a=t.layered,s=t.tick,l=t.index,c=t.major;const u=e.height,h={width:0,height:u};if("left"===n.align||"right"===n.align)h.width=i.width-El(n)-n.paddingEnd;else if(o){const t=Math.abs(n.labels.tiltAngle)*(Math.PI/180);h.width=(i.height-El(n)-n.paddingEnd-u*Math.cos(t))/Math.sin(t)}else h.width=kl({layered:a,major:c,innerRect:i,outerRect:r,tick:s,index:l});return h.width=xl({value:h.width,maxValue:n.labels.maxLengthPx,minValue:n.labels.minLengthPx}),h}function Il(t){let e;function n(){return e=Tl,n}function i(){return e=zl,i}function r(t){let n=t.settings,i=t.scale,r=t.innerRect,o=t.outerRect,a=t.measureText,s=t.ticks,l=t.state,c=t.textBounds;const u=[],h=function(t){return t.filter(t=>!t.isMinor)}(s),d=function(t){return t.filter(t=>t.isMinor)}(s),f={innerRect:r,align:n.align,outerRect:o},p="tilted"===l.labels.activeMode,g="layered"===l.labels.activeMode;let m;if(n.arc&&(f.startAngle=n.arc.startAngle,f.endAngle=n.arc.endAngle,f.radius=n.arc.radius),n.line.show&&(f.style=n.line,f.padding=n.paddingStart,n.arc?u.push(_l(f)):u.push(hl(f))),n.ticks.show&&(f.style=n.ticks,f.tickSize=n.ticks.tickSize,f.padding=Dl(n),n.arc?(f.padding=ql(n),m=function(t,e){return t.map(t=>Sl(t,e))}(h,f)):m=Ol(h,f)),n.labels.show){const t=El(n);f.style=n.labels,f.padding=t,f.tilted=p,f.layered=g,f.angle=n.labels.tiltAngle,f.paddingEnd=n.paddingEnd,f.textBounds=c;const s=(t,s)=>{f.textRect=function(t){let e=t.style;return(0,t.measureText)({text:t.tick.label,fontSize:e.fontSize,fontFamily:e.fontFamily})}({tick:t,measureText:a,style:f.style});const l=e({textMetrics:f.textRect,settings:n,innerRect:r,outerRect:o,scale:i,tilted:p,layered:g,tick:t,major:h,index:s});f.maxWidth=l.width,f.maxHeight=l.height,f.stepSize=function(t){let e=t.innerRect,n=t.scale,i=t.settings,r=t.tick;return("top"===i.align||"bottom"===i.align?e.width:e.height)*Al(n,r)}({innerRect:r,scale:i,settings:n,tick:t})};let l=[];n.arc?(f.padding=function(t){let e=0;return e+=t.ticks.show?t.ticks.tickSize:0,e+=ql(t)+t.labels.margin,e}(n),l=function(t,e,n){return t.map((t,i)=>{n(t,i);const r=Nl(t,e);return r.data=t.data,r})}(h,f,s)):l=!g||"top"!==n.align&&"bottom"!==n.align?function(t,e,n){return t.map((t,i)=>{n(t,i);const r=gl(t,e);return r.data=t.data,r})}(h,f,s):function(t,e,n,i){const r=e.padding,o=El(n);return t.map((t,a)=>{i(t,a);const s=o+e.maxHeight+n.labels.margin;e.layer=a%2,e.padding=a%2==0?r:s;const l=gl(t,e);return l.data=t.data,l})}(h,f,n,s),n.labels.filterOverlapping&&function(t,e,n){let i=(e,n)=>za(R(1,t[e].boundingRect),R(1,t[n].boundingRect));if(n&&n.tilted){const e=Math.abs(n.angle);i=(n,i)=>{const r=1/Math.abs(t[n].x-t[i].x),o=Math.sin(e*(Math.PI/180))/r;return t[n].boundingRect.height>o}}for(let n=0;n<=t.length-1;n++)for(let r=n+1;r<=Math.min(n+5,n+(t.length-1));r++)t[n]&&t[r]&&i(n,r)&&(r===t.length-1?(t.splice(n,1),e&&e.splice(n,1)):(t.splice(r,1),e&&e.splice(r,1)),r--,n--)}(l,m,f),u.push(...l)}return n.minorTicks&&n.minorTicks.show&&d.length>0&&(f.style=n.minorTicks,f.tickSize=n.minorTicks.tickSize,f.padding=function(t){return t.line.strokeWidth+t.minorTicks.margin}(n),u.push(...Ol(d,f))),m&&u.push(...m),u}return n.build=r,i.build=r,t?i():n()}const jl={labels:{show:!0,tiltAngle:40,tiltThreshold:.7,maxEdgeBleed:1/0,margin:4,maxLengthPx:150,minLengthPx:0,mode:"auto",maxGlyphCount:NaN,align:.5,offset:0,filterOverlapping:!1},ticks:{show:!1,margin:0,tickSize:4},line:{show:!1},paddingStart:0,paddingEnd:10,align:"auto"},Pl={labels:{show:!0,margin:4,maxLengthPx:150,minLengthPx:0,align:.5,offset:0,filterOverlapping:!0,centerEndLabels:!1},ticks:{show:!0,margin:0,tickSize:8},minorTicks:{show:!1,tickSize:3,margin:0},line:{show:!0},paddingStart:0,paddingEnd:10,align:"auto"};const Fl={require:["chart","renderer","dockConfig"],defaultSettings:{layout:{displayOrder:0,prioOrder:0},settings:{},style:{labels:"$label",ticks:"$guide-line",minorTicks:"$guide-line--minor",line:"$guide-line"}},created(){this.state={isDiscrete:!!this.scale.bandwidth,isHorizontal:!1,labels:{activeMode:"horizontal"},ticks:[],innerRect:{width:0,height:0,x:0,y:0},outerRect:{width:0,height:0,x:0,y:0},defaultDock:void 0,concreteNodeBuilder:void 0,settings:void 0},this.state.isDiscrete?this.state.defaultDock="bottom":this.state.defaultDock="left",this.setState(this.settings)},setState(){this.state.isDiscrete=!!this.scale.bandwidth,this.state.settings=function(t){let e=t.state,n=t.style,i=t.settings;const r=u(!0,{},e.isDiscrete?jl:Pl,n),o=u(!0,{},r,i.settings),a=i.layout.dock||e.defaultDock;o.dock=a,o.align=function(t,e){const n=["top","bottom"],i=["left","right"];return-1!==n.indexOf(t)&&-1===i.indexOf(e)||-1!==i.indexOf(t)&&-1===n.indexOf(e)?t:e}(i.settings.align,a),o.labels.tiltAngle=Math.max(-90,Math.min(o.labels.tiltAngle,90));const s=o.paddingStart,l=o.paddingEnd;return o.paddingStart="function"==typeof s?s.call(null):s,o.paddingEnd="function"==typeof l?l.call(null):l,o}(this),this.state.concreteNodeBuilder=Il(this.state.isDiscrete),this.dockConfig.dock(this.state.settings.dock),this.state.isHorizontal="top"===this.state.settings.align||"bottom"===this.state.settings.align,this.state.labels.activeMode=function(t,e,n){const i=e.labels.mode;return n&&t.isHorizontal?"auto"===i?t.labels.activeMode:-1!==["layered","tilted"].indexOf(e.labels.mode)&&-1!==["top","bottom"].indexOf(e.dock)?i:"horizontal":"horizontal"}(this.state,this.state.settings,this.state.isDiscrete)},preferredSize(t){const e=this.formatter,n=this.state,i=this.scale,r=this.state.isHorizontal?t.inner.width:t.inner.height;this.state.pxScale=Lo(i,r);const o=function(t){let e=t.isDiscrete,n=t.rect,i=t.formatter,r=t.measureText,o=t.scale,a=t.settings,s=0;const l=bl({isDiscrete:e,rect:n,formatter:i,measureText:r,scale:o,settings:a,state:t.state}),c=l.size,u=l.edgeBleed;if(s+=c,l.isToLarge)return{size:s};if(a.ticks.show&&(s+=a.ticks.margin,s+=a.ticks.tickSize),a.minorTicks&&a.minorTicks.show){const t=a.minorTicks.margin+a.minorTicks.tickSize;t>s&&(s=t)}if(a.line.show){const t=a.line.strokeWidth/2;s+=t,u[function(t){switch(t){case"top":return"bottom";case"bottom":return"top";case"left":return"right";case"right":return"left";default:return t}}(a.align)]=Math.ceil(t)}return s+=a.paddingStart,s+=a.paddingEnd,{size:s,edgeBleed:u}}({isDiscrete:this.state.isDiscrete,rect:{inner:t.inner,outer:t.outer},formatter:e,measureText:this.renderer.measureText,scale:this.state.pxScale,settings:this.state.settings,state:n});return o},beforeUpdate(){const t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).settings;this.setState(t)},resize(t){const e=t.inner,n=t.outer,i=u({},e,function(t){let e=t.align,n=t.inner;return"left"===e?{x:n.width+n.x}:"right"===e||"bottom"===e?n:{y:n.y+n.height}}({align:this.state.settings.align,inner:e})),r=n||i;return u(this.state.innerRect,i),u(this.state.outerRect,r),n},beforeRender(){const t=this.scale,e=this.formatter,n=this.state.isHorizontal?this.state.innerRect.width:this.state.innerRect.height;this.state.pxScale=Lo(t,n),this.state.ticks=this.state.pxScale.ticks({distance:n,formatter:e}).filter(t=>t.position>=0&&t.position<=1)},render(){const t=this.state,e=[];return e.push(...this.state.concreteNodeBuilder.build({settings:this.state.settings,scale:this.state.pxScale,innerRect:this.state.innerRect,outerRect:this.state.outerRect,measureText:this.renderer.measureText,textBounds:this.renderer.textBounds,ticks:this.state.ticks,state:t})),Gs.multiple(e),e}};const Ll={render:()=>[]};function $l(t,e,n){let i="";if("function"==typeof t)i=t();else if("string"==typeof t)i=t;else if(n){const t=(n.data().fields||[]).map(t=>t.title());i=t.join(e)}return i}function Bl(t,e){let n="middle";return"left"===t?"top"===e?n="end":"bottom"===e&&(n="start"):"right"===t?"top"===e?n="start":"bottom"===e&&(n="end"):"left"===e?n="start":"right"===e&&(n="end"),n}const Hl={require:["renderer","chart"],defaultSettings:{layout:{dock:"bottom",displayOrder:0,prioOrder:0},settings:{paddingStart:5,paddingEnd:5,paddingLeft:0,paddingRight:0,anchor:"center",join:", ",maxLengthPx:NaN},style:{text:"$title"}},created(){this.definitionSettings=this.settings.settings;const t=this.settings.text,e=this.definitionSettings.join;this.title=$l(t,e,this.scale)},preferredSize(){return this.renderer.measureText({text:this.title,fontSize:this.style.text.fontSize,fontFamily:this.style.text.fontFamily}).height+this.definitionSettings.paddingStart+this.definitionSettings.paddingEnd},render(){const t=this.title,e=this.definitionSettings,n=this.rect,i=[];return i.push(function(t){let e=t.title,n=t.definitionSettings,i=t.dock,r=t.rect,o=t.measureText,a=t.style;const s={type:"text",text:e,x:0,y:0,dx:0,dy:0,anchor:Bl(i,n.anchor),baseline:"alphabetical",stroke:"transparent",strokeWidth:0,fontWeight:"normal"};u(s,a.text);const l=o(s);if("top"===i||"bottom"===i){let t=r.width/2;"left"===n.anchor?t=n.paddingLeft||0:"right"===n.anchor&&(t=r.width-(n.paddingRight||0)),s.x=t,s.y="top"===i?r.height-n.paddingStart:n.paddingStart+l.height,s.dy="top"===i?-l.height/6:-l.height/3,s.maxWidth=.8*r.width}else{let t=r.height/2;"top"===n.anchor?t=n.paddingStart:"bottom"===n.anchor&&(t=r.height-n.paddingStart),s.y=t,s.x="left"===i?r.width-n.paddingStart:n.paddingStart,s.dx="left"===i?-l.height/3:l.height/3;const e="left"===i?270:90;s.transform="rotate(".concat(e,", ").concat(s.x+s.dx,", ").concat(s.y+s.dy,")"),s.maxWidth=.8*r.height}return isNaN(n.maxLengthPx)||(s.maxWidth=Math.min(s.maxWidth,n.maxLengthPx)),s}({title:t,dock:this.settings.layout.dock,definitionSettings:e,rect:n,measureText:this.renderer.measureText,style:this.style})),i},beforeUpdate(t){t.settings&&(u(this.settings,t.settings),this.definitionSettings=t.settings.settings);const e=this.settings.text,n=this.definitionSettings.join;this.title=$l(e,n,this.scale)}};function Wl(t,e){const n=t.settings.layout.dock,i=t.settings.settings.invert,r="top"===n||"bottom"===n,o=r?"width":"height",a=t.rect[o],s=t.chart.scroll(t.settings.scroll);let l;{let t=e[r?"x":"y"];i&&(t=a-t);const n=s.getState();l={startOffset:t,startScroll:n.start,swipe:!1};const o=t/a*(n.max-n.min)+n.min;o<n.start?l.startScroll=o:o>n.start+n.viewSize&&(l.startScroll=o-n.viewSize)}return{update:t=>{let e=t[r?"x":"y"];if(i&&(e=a-e),!l.swipe){if(Math.abs(l.startOffset-e)<=1)return;l.swipe=!0}const n=s.getState(),o=(e-l.startOffset)/a*(n.max-n.min),c=l.startScroll+o;s.moveTo(c)},end:t=>{let e=t[r?"x":"y"];i&&(e=a-e);const n=s.getState();if(l.swipe){const t=(e-l.startOffset)/a*(n.max-n.min),i=l.startScroll+t;s.moveTo(i)}else{const t=e/a*(n.max-n.min)+n.min-n.viewSize/2;s.moveTo(t)}}}}function Vl(t,e){const n=e.element().getBoundingClientRect();return{x:t.center.x-n.left,y:t.center.y-n.top}}const Ul={require:["chart","renderer"],on:{panStart(t){const e=Vl(t,this.renderer),n={x:e.x-t.deltaX,y:e.y-t.deltaY};this.currentMove=Wl(this,n),this.currentMove.update(e)},panMove(t){if(!this.currentMove)return;const e=Vl(t,this.renderer);this.currentMove.update(e)},panEnd(t){if(!this.currentMove)return;const e=Vl(t,this.renderer);this.currentMove.end(e),this.currentMove=null},panCancel(){this.currentMove=null},tap(t){const e=Vl(t,this.renderer);Wl(this,e).end(e)}},defaultSettings:{settings:{backgroundColor:"#eee",thumbColor:"#ccc",width:16}},preferredSize:function(t){const e=this.chart.scroll(this.settings.scroll).getState();if(e.viewSize>=e.max-e.min){return Math.max(t.width,t.height)}return this.settings.settings.width},render:function(t){const e=this.settings.layout.dock,n=this.settings.settings.invert,i="top"===e||"bottom"===e,r=i?"width":"height",o=this.rect[r],a=this.chart.scroll(this.settings.scroll).getState();let s=o*(a.start-a.min)/(a.max-a.min);const l=o*a.viewSize/(a.max-a.min);return n&&(s=o-s-l),t("div",{style:{position:"relative",width:"100%",height:"100%",background:this.settings.settings.backgroundColor,pointerEvents:"auto"}},[].concat(t("div",{class:"scroller",style:{position:"absolute",[i?"left":"top"]:"".concat(s,"px"),[i?"top":"left"]:"25%",[i?"height":"width"]:"50%",[r]:"".concat(Math.max(1,l),"px"),background:this.settings.settings.thumbColor}})))},renderer:"dom"};function Yl(t){let e=t.h,n=t.isVertical,i=t.value,r=t.pos,o=t.align,a=t.borderHit,s=t.state,l=t.idx;const c="end"!==o,h=c?{left:"0",top:"0"}:{right:"0",bottom:"0"};let d=0,f="100%",p="100%";return s.targetRect&&"start"===s.settings.bubbles.align?(f="".concat(s.targetRect.x+s.targetRect.width,"px"),p="".concat(s.targetRect.y+s.targetRect.height,"px")):s.targetRect&&"end"===s.settings.bubbles.align&&(d=n?s.targetRect.x:s.targetRect.y,f="".concat(s.rect.width-d,"px"),p="".concat(s.rect.height-d,"px")),c||(r-=a),e("div",{onmouseover(t){t.srcElement.children[0].style.backgroundColor="#000",t.srcElement.children[0].style[n?"height":"width"]="2px"},onmouseout(t){t.srcElement.children[0].style.backgroundColor=s.style.line.stroke,t.srcElement.children[0].style[n?"height":"width"]="1px"},"data-value":i,"data-key":[s.key,"edge",l].join("-"),style:{cursor:n?"ns-resize":"ew-resize",position:"absolute",left:"".concat(n?d:r,"px"),top:"".concat(n?r:d,"px"),height:n?"".concat(a,"px"):p,width:n?f:"".concat(a,"px"),pointerEvents:"auto"}},[e("div",{style:u({backgroundColor:s.style.line.stroke,position:"absolute",height:n?"".concat(1,"px"):"100%",width:n?"100%":"".concat(1,"px"),pointerEvents:"none"},h)})])}function Kl(t){let e=t.h,n=t.isVertical,i=t.label,r=t.otherValue,o=t.rangeIdx,a=t.idx,s=t.pos,l=t.align,c=t.state,u=t.value;const h="end"!==l,d="outside"===c.settings.bubbles.placement;let f,p="none";n?(f=h?"left":"right",d&&(p=h?"translate(-100%, 0px)":"translate(100%, 0px)")):(f=h?"top":"bottom",d&&(p=h?"translate(0px, -100%)":"translate(0px, 100%)"));let m=c.edit&&c.edit.rangeIdx===o&&c.edit.bubbleIdx===a;const y={position:"relative",borderRadius:"".concat(c.style.bubble.borderRadius,"px"),border:"".concat(c.style.bubble.strokeWidth,"px solid ").concat(c.style.bubble.stroke),backgroundColor:c.style.bubble.fill,color:c.style.bubble.color,fontFamily:c.style.bubble.fontFamily,fontSize:c.style.bubble.fontSize,padding:"4px 8px",textAlign:"center",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"150px",minWidth:"50px",minHeight:"1em",pointerEvents:"auto",transform:n?"translate(0,-50%)":"translate(-50%,0)",cursor:n?"ns-resize":"ew-resize"};let v=c.style.bubble.stroke;const x=m?e("input",{type:"text",value:u,style:g(g({},y),{},{textAlign:"start",textOverflow:"",fontSize:"13px"}),onkeyup(t){if("Enter"===t.key){t.preventDefault(),t.stopPropagation();const e=parseFloat(t.target.value);isNaN(e)?(v="rgba(230, 78, 78, 0.6)",t.target.style.border="".concat(c.style.bubble.strokeWidth,"px solid ").concat(v)):c.onEditConfirmed(o,e,r)}else"Escape"===t.key&&(t.preventDefault(),t.stopPropagation(),c.onEditCanceled())}}):e("div",{"data-key":[c.key,"bubble",o,a].join("-"),"data-other-value":r,"data-idx":o,"data-bidx":a,style:y},[i]);return e("div",{style:{position:"absolute",[f]:"0",[n?"top":"left"]:"".concat(s,"px"),transform:p}},[x])}function Gl(t){let e=t.h,n=t.isVertical,i=t.top,r=t.height,o=t.color,a=t.on,s=t.opacity;return e("div",u({style:{backgroundColor:o,opacity:s,position:"absolute",left:n?0:"".concat(i,"px"),top:n?"".concat(i,"px"):0,height:n?"".concat(r,"px"):"100%",width:n?"100%":"".concat(r,"px"),pointerEvents:"auto"}},a),[])}function Xl(t){let e=t.borderHit,n=t.els,i=t.isVertical,r=t.state,o=t.vStart,a=t.vEnd,s=t.idx,l=0;r.targetRect&&(l=i?r.targetRect.y:r.targetRect.x);const c=!!r.scale,u=c?r.scale.norm(o)*r.size:o,h=c?r.scale.norm(a)*r.size:a,d=Math.abs(u-h),f=Math.min(u,h)+l,p=f+d;if(r.targetRect){const t=r.targetFillRect||r.targetRect,e=i?t.height:t.width,s=c?r.scale.norm(o)*e:o,l=c?r.scale.norm(a)*e:a,u=Math.abs(s-l),h=Math.min(s,l),d={h:r.h,isVertical:i,top:h,height:u,color:r.style.target.fill,opacity:r.style.target.opacity};r.style.target.opacity<.8&&(d.on={onmouseover(t){t.srcElement.style.opacity=r.style.target.opacity+.1},onmouseout(t){t.srcElement.style.opacity=r.style.target.opacity}}),n.push(r.h("div",{style:{position:"absolute",left:"".concat(t.x,"px"),top:"".concat(t.y,"px"),height:"".concat(t.height,"px"),width:"".concat(t.width,"px")}},[Gl(d)]))}const g=u<h?o:a,y=u<h?a:o,v=m(c?r.scale.domain():[Math.min(o,a),Math.max(o,a)],2),x=v[0],b=v[1],w=g+1e-5>=x&&g-1e-5<=b,k=y-1e-5<=b&&y+1e-5>=x;w&&n.push(Yl({h:r.h,isVertical:i,borderHit:e,value:g,pos:f,align:"start",state:r,idx:s})),k&&n.push(Yl({h:r.h,isVertical:i,borderHit:e,value:y,pos:p,align:"end",state:r,idx:s}));const _=r.settings.bubbles;if(_&&_.show){_.fontSize,_.fontFamily,_.fill;const t=[o,a];w&&n.push(Kl({h:r.h,isVertical:i,align:_.align,rangeIdx:s,idx:0,otherValue:y,value:g,label:"".concat(r.format(g,t)),pos:f,state:r})),k&&n.push(Kl({h:r.h,isVertical:i,align:_.align,rangeIdx:s,idx:1,otherValue:g,value:y,label:"".concat(r.format(y,t)),pos:p,state:r}))}}function Jl(t){const e=t.active.limitHigh-t.active.end,n=t.active.limitLow-t.active.start;let i=t.current-t.start;return i=i<0?Math.max(i,n):Math.min(i,e),i}function Zl(t){let e=[];const n=0===t.direction;if(Array.isArray(t.ranges)&&t.ranges.forEach((i,r)=>{t.active&&r===t.active.idx||Xl({borderHit:5,els:e,isVertical:n,state:t,vStart:Math.min(i.min,i.max),vEnd:Math.max(i.min,i.max),idx:r})}),t.active){let i=t.start,r=t.current;if(-1!==t.active.idx)if("foo"===t.active.mode)i=Math.min(t.active.start,t.active.end),r=Math.max(t.active.start,t.active.end);else if("modify"===t.active.mode)i=Math.min(t.start,t.current),r=Math.max(t.start,t.current);else{const e=Jl(t);i=t.active.start+e,r=t.active.end+e}Xl({borderHit:5,els:e,isVertical:n,state:t,vStart:i,vEnd:r,idx:t.active.idx})}return e}function Ql(t){return{min:t.scale.min(),max:t.scale.max()}}function tc(t){return{min:0,max:t.direction?t.rect.width:t.rect.height}}function ec(t,e,n){let i,r,o=t.ranges,a=-1;for(i=0;i<o.length;i++){if(o[i].min<=e&&e<=o[i].max){a=i,n.min=i?o[i-1].max:n.min,n.max=i+1<o.length?o[i+1].min:n.max;break}if(e<o[i].min){n.max=o[i].min,n.min=i?o[i-1].max:n.min;break}}-1===a&&o.length&&i>=o.length&&(n.min=o[o.length-1].max),-1!==a&&(r={idx:a,start:o[a].min,end:o[a].max,limitLow:n.min,limitHigh:n.max,mode:"foo"}),t.active=r}function nc(t){t.renderer.render(Zl(t))}function ic(t,e){if(!e||!e.isActive())return[];const n=t.scale.data(),i=(n&&n.fields||[]).map(t=>t.id()),r=e.brushes().filter(t=>"range"===t.type&&-1!==i.indexOf(t.id))[0];return r?r.brush.ranges():[]}function rc(t,e){let n,i=1/0;const r=e.domain(),o=e.bandwidth()/2;for(let a=0;a<r.length;++a){const s=Math.abs(t-o-e(r[a]));s<i&&(i=s,n=r[a])}return n}function oc(t,e){return Math.min(...t)<=Math.max(...e)&&Math.max(...t)>=Math.min(...e)}function ac(t){return _(t.reduce((t,e)=>(t.push(...k(e.bounds)),t),[]))}const sc={require:["chart","settings","renderer"],defaultSettings:{settings:{bubbles:{show:!0,align:"start"}},style:{bubble:"$label-overlay",line:"$shape-guide--inverted",target:"$selection-area-target"}},renderer:"dom",on:{rangeStart(t){this.start(t)},rangeMove(t){this.move(t)},rangeEnd(t){this.end(t)},rangeClear(t){this.clear(t)},bubbleStart(t){this.bubbleStart(t)}},created(){this.state={key:this.settings.key||"brush-range"}},beforeRender(t){this.state.rect=t.size.computedInner},renderRanges(){this.state.started||(this.state.ranges=ic(this.state,this.state.brushInstance),this.state.active=null,nc(this.state))},render(t){const e=this.settings.settings;this.state.direction="vertical"===e.direction?0:1;const n=this.renderer.element().getBoundingClientRect(),i=this.state.rect[0===this.state.direction?"height":"width"];let r=Lo(this.chart.scale(e.scale),i);const o=function(t){const e={targetRect:null,targetFillRect:null,scale:null,size:null},n=t.settings.settings,i=n.target&&(n.target.components||(n.target.component?[n.target.component]:[])).map(e=>t.chart.component(e)).filter(t=>!!t&&!!t.rect),r=n.target&&n.target.selector?t.chart.findShapes(n.target.selector):[],o=n.target&&n.target.fillSelector?t.chart.findShapes(n.target.fillSelector):[];if(r.length>0){const i=ac(r);if(e.size=i[0===t.state.direction?"height":"width"],e.scale=Lo(t.chart.scale(n.scale),e.size),e.targetRect=i,o.length>0){const t=ac(o);e.targetFillRect=t}}else if(i&&i.length>0){const n=i.slice(1).reduce((t,e)=>({x0:Math.min(t.x0,e.rect.computedInner.x),y0:Math.min(t.y0,e.rect.computedInner.y),x1:Math.max(t.x1,e.rect.computedInner.x+e.rect.computedInner.width),y1:Math.max(t.y1,e.rect.computedInner.y+e.rect.computedInner.height)}),{x0:i[0].rect.computedInner.x,y0:i[0].rect.computedInner.y,x1:i[0].rect.computedInner.x+i[0].rect.computedInner.width,y1:i[0].rect.computedInner.y+i[0].rect.computedInner.height});e.targetRect={x:n.x0-t.state.rect.x,y:n.y0-t.state.rect.y,width:n.x1-n.x0,height:n.y1-n.y0}}return e}(this);if(r=o.scale?o.scale:r,this.state.targetRect=o.targetRect,this.state.targetFillRect=o.targetFillRect,this.state.size=null===o.size?i:o.size,this.state.settings=e,this.state.style=this.style,this.state.offset=n,this.state.brush="object"==typeof e.brush?e.brush.context:e.brush,this.state.brushInstance=this.chart.brush(this.state.brush),this.state.renderer=this.renderer,this.state.multi=!!e.multiple,this.state.h=t,this.state.onEditConfirmed=(t,e,n)=>{this.state.edit=null,function(t,e,n,i){let r=t.ranges.map(t=>({min:t.min,max:t.max}));const o=t.scale.min(),a=t.scale.max();r[e]={min:Math.max(o,Math.min(n,i)),max:Math.min(a,Math.max(n,i))},t.ranges[e]=g({},r[e]);const s=t.scale.data();s&&s.fields&&s.fields.forEach(e=>{t.fauxBrushInstance||t.brushInstance.setRange(e.id(),r)})}(this.state,t,e,n),this.emit("bubbleEnd"),nc(this.state)},this.state.onEditCanceled=()=>{this.state.edit=null,nc(this.state)},this.state.cssCoord={offset:0===this.state.direction?"top":"left",coord:0===this.state.direction?"y":"x",pos:0===this.state.direction?"deltaY":"deltaX"},this.state.format="function"==typeof e.bubbles.label&&((t,n)=>e.bubbles.label.call(void 0,{datum:t,data:n,scale:r,resources:{scale:this.chart.scale,formatter:this.chart.formatter}})),{}.hasOwnProperty.call(r,"norm")){this.state.editable=!0,this.state.observeBrush="object"==typeof e.brush&&e.brush.observe,this.state.fauxBrushInstance=null,this.state.findValues=null,this.state.scale=r;const t=this.state.scale.data();!this.state.format&&t&&t.fields&&t.fields[0]&&(this.state.format=t.fields[0].formatter())}else this.state.editable=!1,this.state.scale=Br(),this.state.scale.data=r.data,this.state.format||(this.state.format=(t,e)=>oc(r.range(),e)?function(t,e){const n=e.ticks(),i=e.domain().indexOf(rc(t,e));return-1!==i?n[i].label:"-"}(t,r):"-"),this.state.fauxBrushInstance=Co(),this.state.findValues=t=>function(t,e){const n=e.domain(),i=e.range(),r=[];return t.forEach(t=>{if(!oc(i,[t.min,t.max]))return;const o=n.indexOf(rc(t.min,e)),a=n.indexOf(rc(t.max,e));r.push.apply(r,n.slice(Math.min(o,a),Math.max(o,a)+1))}),r}(t,r);return this.state.ranges=ic(this.state,this.state.brushInstance),this.state.observeBrush||this.state.sourcedFromThisComponent?[Zl(this.state)]:[]},mounted(){this.state.observeBrush&&this.state.brushInstance&&this.state.brushInstance.on("update",this.renderRanges)},beforeDestroy(){this.state.observeBrush&&this.state.brushInstance&&this.state.brushInstance.removeListener("update",this.renderRanges)},start(t){!function(t){let e=t.state,n=t.e,i=t.renderer,r=t.ranges,o=t.targetSize;if(e.started)return;e.edit=null;const a=n.center.x-n.deltaX,s=n.center.y-n.deltaY;let l=document.elementFromPoint(a,s);i.element().contains(l)||(l=null);const c={started:!0};e.offset=u({},i.element().getBoundingClientRect());const h=a-e.offset.left,d=s-e.offset.top;e.offset.left+=e.targetRect?e.targetRect.x:0,e.offset.top+=e.targetRect?e.targetRect.y:0,e.ranges=r(e,e.fauxBrushInstance||e.brushInstance);const f=n.center[e.cssCoord.coord]-n[e.cssCoord.pos]-e.offset[e.cssCoord.offset],p=n.center[e.cssCoord.coord]-e.offset[e.cssCoord.offset];c.current=e.scale.normInvert(p/e.size),c.start=e.scale.normInvert(f/e.size);let g=e.ranges;const m=Ql(e);let y,v,x=-1;if(l&&l.hasAttribute("data-idx"))x=parseInt(l.getAttribute("data-idx"),10),m.min=x>0?g[x-1].max:m.min,m.max=x+1<g.length?g[x+1].min:m.max;else{for(y=0;y<g.length;y++){if(g[y].min<=c.start&&c.start<=g[y].max){x=y,m.min=y?g[y-1].max:m.min,m.max=y+1<g.length?g[y+1].min:m.max;break}if(c.start<g[y].min){m.max=g[y].min,m.min=y?g[y-1].max:m.min;break}}-1===x&&g.length&&y>=g.length&&(m.min=g[g.length-1].max)}if(-1!==x||e.multi||(c.ranges=[],m.min=e.scale.min(),m.max=e.scale.max()),-1!==x)if(v={idx:x,start:g[x].min,end:g[x].max,limitLow:m.min,limitHigh:m.max,mode:"move"},l&&l.hasAttribute("data-other-value"))c.start=parseFloat(l.getAttribute("data-other-value")),v.mode="modify";else{let t=e.scale.norm(v.start)*e.size,n=e.scale.norm(v.end)*e.size;Math.abs(f-t)<=o?(c.start=v.end,v.mode="modify"):Math.abs(f-n)<=o&&(c.start=v.start,v.mode="modify")}else v={idx:-1,start:c.start,end:c.current,limitLow:m.min,limitHigh:m.max,mode:"current"};c.active=v,"modify"!==v.mode&&e.targetRect&&!Ia(e.targetRect,{x:h,y:d})||Object.keys(c).forEach(t=>e[t]=c[t])}({e:t,state:this.state,renderer:this.renderer,ranges:ic,targetSize:5})},end(){this.state.started&&(!function(t,e){t.started=!1,t.ranges=e(t,t.fauxBrushInstance||t.brushInstance);const n=Ql(t);ec(t,t.current,n)}(this.state,ic),nc(this.state),this.state.sourcedFromThisComponent=!0,this.state.active=null)},move(t){this.state.started&&(!function(t,e){const n=(e.center[t.cssCoord.coord]-t.offset[t.cssCoord.offset])/t.size,i=t.scale.normInvert(n);t.current=Math.max(Math.min(i,t.active.limitHigh),t.active.limitLow)}(this.state,t),function(t){let e=t.ranges.map(t=>({min:t.min,max:t.max}));if(-1!==t.active.idx)if("modify"===t.active.mode)e[t.active.idx].min=Math.min(t.start,t.current),e[t.active.idx].max=Math.max(t.start,t.current);else{const n=Jl(t);e[t.active.idx].min+=n,e[t.active.idx].max+=n}else e.push({min:Math.min(t.start,t.current),max:Math.max(t.start,t.current)});const n=t.scale.data();n&&n.fields&&n.fields.forEach(n=>{if(t.fauxBrushInstance){let i=ic(t,t.fauxBrushInstance),r=t.findValues(i),o=t.findValues(e),a=o.filter(t=>-1===r.indexOf(t)),s=r.filter(t=>-1===o.indexOf(t)),l=a.map(t=>({key:n.id(),value:t})),c=s.map(t=>({key:n.id(),value:t}));t.brushInstance.addAndRemoveValues(l,c),t.fauxBrushInstance.setRange(n.id(),e)}else t.brushInstance.setRange(n.id(),e)})}(this.state),nc(this.state))},clear(){this.state.fauxBrushInstance&&this.state.fauxBrushInstance.clear(),this.state.renderer.render([]),this.state.started=!1,this.state.active=null,this.state.sourcedFromThisComponent=!1},bubbleStart(t){if(!this.state.editable)return;const e=t.srcEvent||t,n=e.target,i={rangeIdx:parseInt(n.getAttribute("data-idx"),10),bubbleIdx:parseInt(n.getAttribute("data-bidx"),10)};if(isNaN(i.rangeIdx)||JSON.stringify(i)===JSON.stringify(this.state.edit))return;this.state.edit=i,e.stopPropagation(),e.stopImmediatePropagation(),e.preventDefault();const r=n.parentNode;nc(this.state);const o=r.querySelector("input");o.focus(),o.select()}};function lc(t){t.renderer.render(Zl(t))}function cc(t){return t.rc.ranges()}function uc(t,e){const n={x:t.direction?e.min+t.rect.x:t.rect.x,y:t.direction?t.rect.y:e.min+t.rect.y,width:t.direction?e.max-e.min:t.rect.width+t.rect.x,height:t.direction?t.rect.height+t.rect.y:e.max-e.min};return t.chart.shapesAt(n,t.settings.brush)}const hc={require:["chart","settings","renderer"],defaultSettings:{settings:{bubbles:{show:!0,align:"start"}},style:{bubble:"$label-overlay",line:"$shape-guide--inverted",target:"$selection-area-target"}},renderer:"dom",on:{areaStart(t){this.start(t)},areaMove(t){this.move(t)},areaEnd(t){this.end(t)},areaClear(t){this.clear(t)}},created(){this.state={key:this.settings.key||"brush-area-dir"}},render(t){this.state.rect=this.rect;const e=this.settings.settings,n="vertical"===e.direction?0:1,i=this.state.rect[0===n?"height":"width"],r=this.renderer.element().getBoundingClientRect(),o=(e.target?e.target.components||[e.target.component]:[]).map(t=>this.chart.component(t)).filter(t=>!!t&&!!t.rect),a=o[0]?o.slice(1).reduce((t,e)=>({x0:Math.min(t.x0,e.rect.x),y0:Math.min(t.y0,e.rect.y),x1:Math.max(t.x1,e.rect.x+e.rect.width),y1:Math.max(t.y1,e.rect.y+e.rect.height)}),{x0:o[0].rect.x,y0:o[0].rect.y,x1:o[0].rect.x+o[0].rect.width,y1:o[0].rect.y+o[0].rect.height}):null;return this.state.targetRect=a?{x:a.x0-this.rect.x,y:a.y0-this.rect.y,width:a.x1-a.x0,height:a.y1-a.y0}:null,this.state.style=this.style,this.state.chart=this.chart,this.state.direction=n,this.state.settings=e,this.state.offset=r,this.state.rc=go(),this.state.renderer=this.renderer,this.state.multi=!!e.multiple,this.state.h=t,this.state.size=i,this.state.cssCoord={offset:0===this.state.direction?"top":"left",coord:0===this.state.direction?"y":"x",pos:0===this.state.direction?"deltaY":"deltaX",area:0===this.state.direction?"height":"width"},this.state.format=function(t,e){return function(t,e,n){const i=Math.min(...n),r=Math.max(...n),o={x:t.direction?i+t.rect.x:t.rect.x,y:t.direction?t.rect.y:i+t.rect.y,width:t.direction?r-i:t.rect.width+t.rect.x,height:t.direction?t.rect.height+t.rect.y:r-i},a=t.chart.shapesAt(o,t.settings.brush);if(0===a.length)return"-";const s=a.reduce((n,r)=>{const o=n.bounds,a=r.bounds;return e===i?o[t.cssCoord.coord]<=a[t.cssCoord.coord]?n:r:o[t.cssCoord.coord]+o[t.cssCoord.area]>=a[t.cssCoord.coord]+a[t.cssCoord.area]?n:r}),l=t.settings.brush.components.reduce((t,e)=>t.key===s.key?t:e);return"function"==typeof t.settings.bubbles.label?t.settings.bubbles.label(s.data):Array.isArray(l.data)&&l.data.length?s.data[l.data[0]].label:s.data&&s.data.label?s.data.label:"-"}(this,t,e)},[]},start(t){!function(t){let e=t.state,n=t.e,i=t.renderer,r=t.ranges,o=t.targetSize;if(e.started)return;const a=n.center.x-n.deltaX,s=n.center.y-n.deltaY;let l=document.elementFromPoint(a,s);i.element().contains(l)||(l=null);const c={started:!0};e.offset=i.element().getBoundingClientRect(),e.ranges=r(e);const u=a-e.offset.left,h=s-e.offset.top,d=n.center[e.cssCoord.coord]-n[e.cssCoord.pos]-e.offset[e.cssCoord.offset],f=n.center[e.cssCoord.coord]-e.offset[e.cssCoord.offset];let p=f,g=d;c.start=d,c.current=f;let m=e.ranges;const y=tc(e);let v,x,b=-1;if(l&&l.hasAttribute("data-idx"))b=parseInt(l.getAttribute("data-idx"),10),y.min=b>0?m[b-1].max:y.min,y.max=b+1<m.length?m[b+1].min:y.max;else{for(v=0;v<m.length;v++){if(m[v].min<=g&&g<=m[v].max){b=v,y.min=v?m[v-1].max:y.min,y.max=v+1<m.length?m[v+1].min:y.max;break}if(g<m[v].min){y.max=m[v].min,y.min=v?m[v-1].max:y.min;break}}-1===b&&m.length&&v>=m.length&&(y.min=m[m.length-1].max)}if(-1!==b||e.multi||(c.ranges=[],y.min=0,y.max=e.direction?e.rect.width:e.rect.height),-1!==b)if(x={idx:b,start:m[b].min,end:m[b].max,limitLow:y.min,limitHigh:y.max,mode:"move"},l&&l.hasAttribute("data-other-value"))c.start=parseFloat(l.getAttribute("data-other-value")),x.mode="modify";else{let t=x.start,e=x.end;Math.abs(d-t)<=o?(c.start=x.end,x.mode="modify"):Math.abs(d-e)<=o&&(c.start=x.start,x.mode="modify")}else x={idx:-1,start:g,end:p,limitLow:y.min,limitHigh:y.max,mode:"current"};c.active=x,"modify"!==x.mode&&e.targetRect&&!Ia(e.targetRect,{x:u,y:h})||Object.keys(c).forEach(t=>e[t]=c[t])}({e:t,state:this.state,renderer:this.renderer,ranges:cc,targetSize:5})},end(){this.state.started&&(!function(t,e){t.started=!1,t.ranges=e(t);const n=tc(t);ec(t,t.current,n)}(this.state,cc),lc(this.state))},move(t){this.state.started&&(!function(t,e){const n=e.center[t.cssCoord.coord]-t.offset[t.cssCoord.offset];t.current=Math.max(Math.min(n,t.active.limitHigh),t.active.limitLow)}(this.state,t),function(t){const e=t.ranges.map(t=>({min:t.min,max:t.max}));if(-1!==t.active.idx)if("modify"===t.active.mode)e[t.active.idx].min=Math.min(t.start,t.current),e[t.active.idx].max=Math.max(t.start,t.current);else{const n=Jl(t);e[t.active.idx].min=t.active.start+n,e[t.active.idx].max=t.active.end+n}else e.push({min:Math.min(t.start,t.current),max:Math.max(t.start,t.current)});t.rc.set(e);let n=[];e.forEach(e=>{n=[...n,...uc(t,e)]}),function(t,e){t.chart.brushFromShapes(e,t.settings.brush)}(t,n)}(this.state),lc(this.state))},clear(){this.state.rc&&this.state.rc.clear(),this.state.renderer.render([])}};function dc(t){const e="vertical"===t.direction,n=t.rect[e?"height":"width"],i=t.rect[e?"width":"height"];return function(t){const e=t.brush;if(!e||!e.isActive())return[];const n=t.scale.data(),i=(n&&n.fields||[]).map(t=>t.id()),r=e.brushes().filter(t=>"range"===t.type&&-1!==i.indexOf(t.id))[0];return r?r.brush.ranges():[]}(t).map(r=>{const o=t.scale(r.min)*n,a=t.scale(r.max)*n,s=Math.min(o,a),l=Math.abs(o-a);return{type:"rect",fill:t.fill,opacity:t.opacity,x:e?0:s,width:e?i:l,y:e?s:0,height:e?l:i}})}function fc(t,e,n,i){function r(){!function(t){t.renderer.render(dc(t))}(t)}function o(){!function(t){t.renderer.render(dc(t))}(t)}function a(){!function(t){t.renderer.render(dc(t))}(t)}t.brush=e,e&&(e.on("start",r),e.on("update",o),e.on("end",a),t.start=r,t.update=o,t.end=a,t.brush=e,t.scale=n,t.renderer=i)}function pc(t){t.brush&&(t.brush.removeListener("start",t.start),t.brush.removeListener("update",t.update),t.brush.removeListener("end",t.end)),t.start=void 0,t.update=void 0,t.end=void 0,t.brush=void 0,t.scale=void 0,t.renderer=void 0}const gc={require:["chart","settings","renderer"],defaultSettings:{settings:{}},preferredSize:()=>50,created(){this.state={}},render(){const t=this.settings.settings,e=this.chart.brush(t.brush),n=t.direction||"horizontal",i="horizontal"===n?this.rect.width:this.rect.height,r=Lo(this.chart.scale(t.scale),i);return pc(this.state),fc(this.state,e,r,this.renderer),this.state.rect=this.rect,this.state.fill=t.fill||"#ccc",this.state.opacity=void 0!==t.opacity?t.opacity:1,this.state.direction=n,dc(this.state)},beforeDestroy(){pc(this.state)}};function mc(t,e){const n=e.center.x,i=e.center.y;return{x:n-t.left,y:i-t.top}}function yc(t,e,n){return ra(t,e.points[0])<n.settings.snapIndicator.threshold**2}function vc(t,e){null==t.path.d?t.path.d="M".concat(e.x," ").concat(e.y," "):t.path.d+="L".concat(e.x," ").concat(e.y," "),t.points.push(e)}function xc(t){let e=t.state,n=t.start,i=void 0===n?null:n,r=t.end,o=void 0===r?null:r;null!==i&&(e.snapIndicator.x1=i.x,e.snapIndicator.y1=i.y),null!==o&&(e.snapIndicator.x2=o.x,e.snapIndicator.y2=o.y)}function bc(t,e){t.snapIndicator.visible=e}const wc={require:["chart","renderer","settings"],defaultSettings:{layout:{displayOrder:0},settings:{brush:{components:[]},snapIndicator:{threshold:75,strokeDasharray:"5, 5",stroke:"black",strokeWidth:2,opacity:.5},lasso:{fill:"transparent",stroke:"black",strokeWidth:2,opacity:.7,strokeDasharray:"20, 10"},startPoint:{r:10,fill:"green",stroke:"black",strokeWidth:1,opacity:1}}},on:{lassoStart(t){this.start(t)},lassoEnd(t){this.end(t)},lassoMove(t){this.move(t)},lassoCancel(){this.cancel()}},created(){this.state={points:[],active:!1,path:null,snapIndicator:null,startPoint:null,rendererBounds:null,componentDelta:null,brushConfig:null,lineBrushShape:{x1:0,y1:0,x2:0,y2:0}}},start(t){var e;this.state.active=!0,this.state.path={visible:!0,type:"path",d:null,fill:(e=this.settings.settings.lasso).fill,stroke:e.stroke,strokeWidth:e.strokeWidth,opacity:e.opacity,strokeDasharray:e.strokeDasharray,collider:{type:null}},this.state.snapIndicator=function(t){return{visible:!1,type:"line",x1:0,y1:0,x2:0,y2:0,strokeDasharray:t.strokeDasharray,stroke:t.stroke,strokeWidth:t.strokeWidth,opacity:t.opacity,collider:{type:null}}}(this.settings.settings.snapIndicator),this.state.startPoint=function(t){return{visible:!0,type:"circle",cx:0,cy:0,r:t.r,fill:t.fill,opacity:t.opacity,stroke:t.stroke,strokeWidth:t.strokeWidth,collider:{type:null}}}(this.settings.settings.startPoint),this.state.rendererBounds=this.renderer.element().getBoundingClientRect(),this.state.componentDelta=function(t,e){const n=t.element.getBoundingClientRect();return{x:e.left-n.left,y:e.top-n.top}}(this.chart,this.state.rendererBounds),this.state.brushConfig=this.settings.settings.brush.components.map(t=>({key:t.key,contexts:t.contexts||["lassoBrush"],data:t.data||[""],action:t.action||"add"}));const n=mc(this.state.rendererBounds,t);vc(this.state,n),xc({state:this.state,start:n}),function(t,e){t.startPoint.cx=e.x,t.startPoint.cy=e.y}(this.state,n)},move(t){if(!this.state.active)return;const e=mc(this.state.rendererBounds,t);yc(e,this.state,this.settings)?bc(this.state,!0):bc(this.state,!1),vc(this.state,e),xc({state:this.state,end:e}),function(t,e){const n=[t.startPoint,t.path,t.snapIndicator].filter(t=>t.visible);e.render(n)}(this.state,this.renderer),function(t,e){if(t.active){const n=t.points[t.points.length-2],i=t.points[t.points.length-1];t.lineBrushShape.x1=n.x+t.componentDelta.x,t.lineBrushShape.y1=n.y+t.componentDelta.y,t.lineBrushShape.x2=i.x+t.componentDelta.x,t.lineBrushShape.y2=i.y+t.componentDelta.y;const r=e.shapesAt(t.lineBrushShape,{components:t.brushConfig});e.brushFromShapes(r,{components:t.brushConfig})}}(this.state,this.chart)},end(t){if(!this.state.active)return;bc(this.state,!1);yc(mc(this.state.rendererBounds,t),this.state,this.settings)&&function(t,e){if(t.active){const n=t.componentDelta.x,i=t.componentDelta.y,r=t.points.map(t=>({x:t.x+n,y:t.y+i})),o=e.shapesAt({vertices:r},{components:t.brushConfig});e.brushFromShapes(o,{components:t.brushConfig})}}(this.state,this.chart),this.state={points:[],active:!1,path:null,snapIndicator:null,startPoint:null,rendererBounds:null,componentDelta:null,brushConfig:null,lineBrushShape:{x1:0,y1:0,x2:0,y2:0}},this.renderer.render([])},cancel(){var t,e;this.state.active&&(t=this.state,e=this.chart,t.brushConfig.forEach(t=>{t.contexts.forEach(t=>{e.brush(t).end()})}),this.state={points:[],active:!1,path:null,snapIndicator:null,startPoint:null,rendererBounds:null,componentDelta:null,brushConfig:null,lineBrushShape:{x1:0,y1:0,x2:0,y2:0}},this.renderer.render([]))},render(){}};function kc(t,e,n,i,r){let o,a=0,s=e.length-1;for(;a<s;){let l=Math.floor((a+s)/2);o=r(e[l]),o[n]+o[i]<t[n]?a=l+1:s=l}return a}function _c(t){let e=t.orientation,n=t.targetNodes,i=t.labels,r=t.container,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:kc;const a=[],s="v"===e?"x":"y",l="v"===e?"width":"height",c=t=>t.textBounds,u=t=>t.node.localBounds;return(t,e)=>{const h=i[e],d=h.textBounds,f=h.node;if(d[s]<r[s]||d[s]+d[l]>r[s]+r[l])return!1;for(let t=o(d,a,s,l,c);t<a.length;t++)if(za(d,a[t].textBounds))return!1;const p=o(d,n,s,l,u),g=d[s]+d[l];for(let t=p;t<n.length;t++){const e=n[t].node;if(g<e.localBounds[s])break;if(za(d,e.localBounds)&&f!==e)return!1}return a.push(i[e]),!0}}function Mc(t,e){return{node:t,data:t.data,scale:e.scale,formatter:e.formatter,dataset:e.dataset}}function Sc(t){const e=typeof t;return("string"===e||"number"===e)&&""!==t}function Rc(t){return g(g({type:"rect",rx:2,ry:2,fill:t.backgroundColor},t.backgroundBounds),{},{data:"".concat(t.data," ").concat(t.text),rotation:t.transform&&t.transform.match(/rotate/gi)?"rotated":"horizontal"})}function Cc(t,e,n){return n?t.width>=e.height:t.width>=e.width}function Nc(t,e,n){return n?t.height>=e.width:t.height>=e.height}function Dc(t,e,n,i,r){let o,a;return"v"===t?(o=i||r||Cc(e,n,!0),a=Nc(e,n,!i)):(o=Cc(e,n),a=r||Nc(e,n,!1)),o&&a}function qc(t,e,n,i){return t+.5*e+(i-.5)*(e-n)-.5*n}function Ec(t,e,n){const i={type:"text",text:e,maxWidth:n.rotate?t.height:t.width,x:0,y:t.y,dx:0,dy:0,fill:n.fill,anchor:n.rotate?"end":"start",baseline:"central",fontSize:"".concat(n.fontSize,"px"),fontFamily:n.fontFamily},r=n.textMetrics;if(!n.overflow&&!function(t,e,n){return Cc(t,e,n.rotate)&&Nc(t,e,n.rotate)}(t,r,n))return!1;const o=.5*r.height;return n.rotate?(i.x=qc(t.x,t.width,r.height,n.align)+o,i.y=qc(t.y,t.height,r.width,n.justify),"right"===n.dock?i.transform="rotate(90, ".concat(i.x+i.dx,", ").concat(i.y+i.dy,") translate(").concat(r.width,", 0)"):i.transform="rotate(-90, ".concat(i.x+i.dx,", ").concat(i.y+i.dy,")")):(i.x=qc(t.x,t.width,r.width,n.align),i.y=qc(t.y,t.height,r.height,n.justify)+o),i}function Oc(t){let e=t.bar,n=t.view,i=t.direction,r=t.position,o=t.padding,a=void 0===o?4:o,s=t.measured;const l={};if(u(l,e),r&&"inside"!==r)if("up"===i||"down"===i){const t=Math.max(0,Math.min(e.y,n.height)),o=Math.max(0,Math.min(e.y+e.height,n.height));"outside"===r&&"up"===i||"opposite"===r&&"down"===i?(l.y=0,l.height=t):("outside"===r&&"down"===i||"opposite"===r&&"up"===i)&&(l.y=o,l.height=n.height-o)}else{const t=Math.max(0,Math.min(e.x,n.width)),o=Math.max(0,Math.min(e.x+e.width,n.width));"outside"===r&&"left"===i||"opposite"===r&&"right"===i?(l.x=0,l.width=t):("outside"===r&&"right"===i||"opposite"===r&&"left"===i)&&(l.x=o,l.width=n.width-o)}else;return function(t,e){const n=Math.max(0,Math.min(t.y,e.height)),i=Math.max(0,Math.min(t.y+t.height,e.height)),r=Math.max(0,Math.min(t.x,e.width)),o=Math.max(0,Math.min(t.x+t.width,e.width));t.x=r,t.width=o-r,t.y=n,t.height=i-n}(l,n),function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=n.top,r=void 0===i?4:i,o=n.bottom,a=void 0===o?4:o,s=n.left,l=void 0===s?4:s,c=n.right,u=void 0===c?4:c,h="function"==typeof l?l(e):l,d="function"==typeof u?u(e):u,f="function"==typeof r?r(e):r,p="function"==typeof a?a(e):a;t.x+=h,t.width-=h+d,t.y+=f,t.height-=f+p}(l,s,a),l}function Ac(t){let e,n,i,r,o,a=t.direction,s=t.fitsHorizontally,l=t.measured,c=t.node,u=t.orientation,h=t.placementSettings,d=t.rect,f=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Oc;const p=[],g="h"===u?"width":"height";for(o=0;o<h.length;o++)if(i=h[o],r=f({bar:c.localBounds,view:d,direction:a,position:i.position,padding:i.padding,measured:l}),p.push(r),e=!o||r[g]>e[g]?r:e,Dc(u,r,l,s,i.overflow)){n=r;break}return n||(n=e,o=p.indexOf(n)),i=h[o],{bounds:n,placement:i}}function zc(t,e,n,i){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};const o=r.top,a=void 0===o?4:o,s=r.bottom,l=void 0===s?4:s,c=r.left,u=void 0===c?4:c,h=r.right,d=void 0===h?4:h,f="function"==typeof u?u(e):u,p="function"==typeof d?d(e):d,g="function"==typeof a?a(e):a,m="function"==typeof l?l(e):l,y=t.x+t.dx,v=t.y+t.dy,x=n?Math.min(e.width,i.height):Math.min(e.height,i.width),b=n?Math.min(e.height,i.height):Math.min(e.width,i.width),w=.5*e.height,k=1e-9;return{x:(n?y-w:y)-f-k,y:(n?v:v-w)-g-k,width:b+(f+p)-k,height:x+(g+m)-k}}function Tc(t){let e=t.chart,n=t.targetNodes,i=t.rect,r=t.fitsHorizontally,o=t.collectiveOrientation,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ac,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Ec,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:_c;const c=[],u={container:i,targetNodes:n,labels:[],orientation:o};let h,d,f,p,m,y,v,x,b,w,k,_,M,S;for(let t=0,l=n.length;t<l;t++){y=null,d=n[t],f=d.node,M=Mc(f,e),b=d.direction,S="left"===b||"right"===b?"h":"v";for(let e=0;e<d.texts.length;e++){if(p=d.texts[e],!Sc(p))continue;w=d.labelSettings[e],x=d.measurements[e],_=w.placements;const n=a({direction:b,fitsHorizontally:r,lblStngs:w,measured:x,node:f,orientation:S,placements:_,placementSettings:d.placementSettings[e],rect:i});if(y=n.bounds,k=n.placement,y&&k){var R;m=k.justify;const e="function"==typeof w.linkData?w.linkData(M,t):void 0,n="function"==typeof k.overflow?k.overflow(M,t):k.overflow;"up"===b&&(m=1-m),"opposite"===k.position&&(m=1-m),"left"===b&&(m=1-m);const i=!("h"===o||r);if(h=s(y,p,{justify:"h"===S?k.align:m,align:"h"===S?m:k.align,fontSize:w.fontSize,fontFamily:w.fontFamily,textMetrics:x,rotate:i,overflow:!!n,dock:null!==(R=w.dock)&&void 0!==R?R:"left"}),h){const n=zc(h,x,i,y,k.padding);v="function"==typeof k.fill?k.fill(g(g({},M),{},{textBounds:n}),t):k.fill,h.fill=v,void 0!==e&&(h.data=e),"object"==typeof k.background&&(h.backgroundColor="function"==typeof k.background.fill?k.background.fill(g(g({},M),{},{textBounds:n}),t):k.background.fill,void 0!==h.backgroundColor&&(h.backgroundBounds=zc(h,x,i,y,k.background.padding))),c.push(h),u.labels.push({node:f,textBounds:n})}}}}const C=c.filter(l(u));return[...C.filter(t=>void 0!==t.backgroundBounds).map(Rc),...C]}function Ic(t){const e=2*Math.PI;return(t%e+e)%e}function jc(t,e){t.x+=e,t.width-=2*e,t.y+=e,t.height-=2*e}function Pc(t){return{x:t.x,y:t.y-t.height/2,width:t.width,height:t.height}}function Fc(t,e,n){let i=e.x,r=e.y;if(i*i+r*r>t*t)return null;let o=Math.sin(n),a=Math.cos(n),s=i*a-r*o,l=t*t-s*s;if(l<0)return null;let c=Math.sqrt(l);return{x:s*a+o*c,y:-s*o+a*c}}function Lc(t){let e,n,i=t.radius,r=t.size,o=t.angle,a=r.width,s=r.height,l={x:a/2,y:s/2};switch(Math.floor(o/(Math.PI/2))){case 0:if(e=Fc(i,l,o),!e)return null;e.y*=-1,n={x:-a,y:0};break;case 1:if(e=Fc(i,l,Math.PI-o),!e)return null;n={x:-a,y:-s};break;case 2:if(e=Fc(i,l,o-Math.PI),!e)return null;e.x*=-1,n={x:0,y:-s};break;case 3:if(e=Fc(i,l,2*Math.PI-o),!e)return null;e.x*=-1,e.y*=-1,n={x:0,y:0};break;default:throw new Error("invalid angle")}return{x:e.x+n.x,y:e.y+n.y,width:a,height:s}}function $c(t){let e=t.slice,n=t.measured,i=t.padding,r=e.start,o=e.end,a=e.innerRadius,s=e.outerRadius,l=s-a-2*i,c=o-r;if(c<Math.PI){let t=(n.height/2+i)/Math.tan(c/2);t>a&&(l=s-t-2*i)}if(l<0||l<n.minReqWidth)return null;const u=Ic((r+o)/2);let h=s-i,d={x:Math.sin(u)*h,y:-Math.cos(u)*h,width:l,height:n.height};return u<Math.PI?(d.angle=u-Math.PI/2,d.anchor="end"):(d.angle=u+Math.PI/2,d.anchor="start"),d}function Bc(t){let e=t.context,n=t.node,i=t.bounds;let r=n.desc.slice;const o=Ic((r.start+r.end)/2);switch(Math.floor(o/(Math.PI/2))){case 0:e.q1maxY=i.y-2,void 0===e.q2minY&&(e.q2minY=i.y+i.height+2);break;case 1:e.q2minY=i.y+i.height+2;break;case 2:e.q3minY=i.y+i.height+2;break;case 3:e.q4maxY=i.y-2,void 0===e.q3minY&&(e.q3minY=i.y+i.height+2)}}function Hc(t,e){return{node:t,data:t.data,scale:e.scale,formatter:e.formatter,dataset:e.dataset}}function Wc(t,e,n){const i={type:"text",text:e,maxWidth:t.width,x:t.x,y:t.y+("top"===t.baseline?t.height/2:0),fill:n.fill,anchor:t.anchor||"start",baseline:"middle",fontSize:"".concat(n.fontSize,"px"),fontFamily:n.fontFamily};if(!isNaN(t.angle)){let e=t.angle*(360/(2*Math.PI));i.transform="rotate(".concat(e,", ").concat(i.x,", ").concat(i.y,")")}return i}function Vc(t){let e,n,i=t.slice,r=t.direction,o=t.position,a=t.padding,s=t.measured,l=t.view,c=t.context,u=t.store,h=i.start,d=i.end,f=i.innerRadius,p=i.offset;switch(o){case"into":e="rotate"===r?$c({slice:i,measured:s,padding:a}):function(t){let e=t.slice,n=t.padding,i=t.measured,r=e.start,o=e.end,a=e.innerRadius,s=e.outerRadius;const l=Ic((r+o)/2);let c=Lc({radius:s,size:{width:i.width+2*n+1,height:i.height+2*n},angle:l});return c?(c.baseline="top",ja(c,{x1:0,y1:0,x2:Math.sin(r)*s,y2:-Math.cos(r)*s})||ja(c,{x1:0,y1:0,x2:Math.sin(o)*s,y2:-Math.cos(o)*s})||Na({cx:0,cy:0,r:a},c)?null:(jc(c,n),c)):null}({slice:i,measured:s,padding:a});break;case"inside":n={start:h,end:d,innerRadius:0,outerRadius:f},e="rotate"===r?$c({slice:n,measured:s,padding:a}):function(t){let e=t.slice,n=t.padding,i=t.measured,r=t.store;const o=e.start,a=e.end,s=e.outerRadius,l=Ic((o+a)/2);let c=Lc({radius:s,size:{width:i.width+2*n+1,height:i.height+2*n},angle:l});return c?(c.baseline="top",jc(c,n),r.insideLabelBounds.some(t=>za(t,c))?null:(r.insideLabelBounds.push({x:c.x-4,y:c.y,width:c.width+8,height:c.height}),c)):null}({slice:n,measured:s,padding:a,store:u});break;case"outside":e="rotate"===r?function(t){let e=t.slice,n=t.measured,i=t.padding,r=t.view,o=e.start,a=e.end,s=e.outerRadius,l=e.offset,c=s+i,u=a-o;if(u<Math.PI&&(n.height/2+i)/Math.tan(u/2)>c)return null;const h=Ic((o+a)/2);let d=Math.sin(h)*c,f=-Math.cos(h)*c,p=n.width+1,g=h%Math.PI;if(g>Math.PI/2&&(g=Math.PI-g),Math.cos(g)>.001){let t=f<0?r.y:r.y+r.height,e=Math.abs(t-l.y)/Math.cos(g)-Math.tan(g)*(n.height/2)-2*i-s;e<p&&(p=e)}if(Math.sin(g)>.001){let t=d<0?r.x:r.x+r.width,e=Math.abs(t-l.x)/Math.sin(g)-n.height/2/Math.tan(g)-2*i-s;e<p&&(p=e)}if(p<=0||p<n.minReqWidth)return null;let m={x:d,y:f,width:p,height:n.height};return h<Math.PI?(m.angle=h-Math.PI/2,m.anchor="start"):(m.angle=h+Math.PI/2,m.anchor="end"),m}({slice:i,measured:s,padding:a,view:l}):function(t){let e=t.slice,n=t.measured,i=t.padding,r=t.view,o=t.context,a=e.start,s=e.end,l=e.outerRadius,c=e.offset;const u=Ic((a+s)/2);if(function(t,e,n){switch(e){case 0:return t.q1maxY<0;case 1:return t.q2minY>n.height;case 2:return t.q3minY>n.height;case 3:return t.q4maxY<0;default:return!0}}(o,Math.floor(u/(Math.PI/2)),r))return null;let h=l+i+n.height/2,d=Math.sin(u)*h,f=-Math.cos(u)*h,p=n.width+1;if(u<Math.PI){let t=Math.abs(r.x+r.width-(d+c.x));t<p&&(p=t)}else{let t=Math.abs(r.x-(d+c.x));t<p&&(p=t)}if(p<n.minReqWidth)return null;let g={x:d,y:f,width:p,height:n.height};return u<Math.PI?g.anchor="start":g.anchor="end",g}({slice:i,measured:s,padding:a,view:l,context:c});break;default:throw new Error("not implemented")}return e&&(e.x+=p.x,e.y+=p.y,"outside"===o&&"rotate"!==r&&function(t,e,n){const i=n.start,r=n.end,o=n.offset,a=n.outerRadius,s=Ic((i+r)/2);switch(Math.floor(s/(Math.PI/2))){case 0:if(void 0!==e.q1maxY){let n=Math.min(t.y,e.q1maxY-t.height),i=t.y-n;if(t.y=n,i>1){let e=a+2;t.line={type:"line",x1:t.x-2,y1:t.y+2,x2:o.x+Math.sin(s)*e,y2:o.y-Math.cos(s)*e,strokeWidth:1}}}break;case 1:if(void 0!==e.q2minY){let n=Math.max(t.y,e.q2minY),i=n-t.y;if(t.y=n,i>1){let e=a+2;t.line={type:"line",x1:t.x-2,y1:t.y-2,x2:o.x+Math.sin(s)*e,y2:o.y-Math.cos(s)*e,strokeWidth:1}}}break;case 2:if(void 0!==e.q3minY){let n=Math.max(t.y,e.q3minY),i=n-t.y;if(t.y=n,i>1){let e=a+2;t.line={type:"line",x1:t.x+2,y1:t.y-2,x2:o.x+Math.sin(s)*e,y2:o.y-Math.cos(s)*e,strokeWidth:1}}}break;case 3:if(void 0!==e.q4maxY){let n=Math.min(t.y,e.q4maxY-t.height),i=t.y-n;if(t.y=n,i>1){let e=a+2;t.line={type:"line",x1:t.x+2,y1:t.y+2,x2:o.x+Math.sin(s)*e,y2:o.y-Math.cos(s)*e,strokeWidth:1}}}}}(e,c,i)),e}function Uc(t){let e=t.context,n=t.direction,i=t.measured,r=t.node,o=t.placementSettings,a=t.rect,s=t.store,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Vc;for(let t=0;t<o.length;t++){let c=o[t],u=l({context:e,slice:r.desc.slice,view:a,direction:n,position:c.position,measured:i,padding:c.padding,store:s});if(u)return{bounds:u,placement:c}}return{bounds:null,placement:null}}function Yc(t,e,n){const i=e.fontFamily,r="".concat(e.fontSize,"px"),o=n.measureText({text:t,fontFamily:i,fontSize:r});return o.minReqWidth=Math.min(o.width,n.measureText({text:"".concat(t[0],"…"),fontFamily:i,fontSize:r}).width),o}const Kc=/\n+|\r+|\r\n/,Gc=/\s/,Xc=/[a-zA-Z\u00C0-\u00F6\u00F8-\u00FF\u00AD]/;function Jc(t){return"string"==typeof t?-1!==t.search(Kc):-1!==String(t).search(Kc)}function Zc(t){return-1!==t.search(Gc)}function Qc(t){return-1!==t.search(Xc)}function tu(t,e,n){return Math.max(e,Math.min(n,t))}function eu(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.string,n=t.separator,i=void 0===n?"":n,r=t.reverse,o=void 0!==r&&r,a=t.measureText,s=void 0===a?t=>({width:t.length,height:1}):a,l=t.mandatoryBreakIdentifiers,c=void 0===l?[Jc]:l,u=t.noBreakAllowedIdentifiers,h=void 0===u?[]:u,d=t.suppressIdentifier,f=void 0===d?[Zc,Jc,t=>""===t]:d,p=t.hyphenationIdentifiers,g=void 0===p?[Qc]:p;const m=String(e).split(i);!function(t){""===t[0]&&t.shift(),""===t[t.length-1]&&t.pop()}(m);const y=m.length,v=o?t=>t>=0:t=>t<y;let x=o?y:-1;function b(t){const e=tu(t,0,y-1),n=m[e],i=s(n),r=function(t,e,n,i,r){return i.some(i=>i(t,e,n))?1:r.some(i=>i(t,e,n))?0:2}(n,e,m,c,h);return{index:e,value:n,breakOpportunity:r,suppress:f.some(t=>t(n,e,m)),hyphenation:g.some(t=>t(n,e,m)),width:i.width,height:i.height,done:!1}}return{next:function(t){return isNaN(t)?o?x--:x++:x=tu(t,0,y-1),v(x)?b(x):{done:!0}},peek:b,length:y}}const nu="…",iu=/^\s*\d+(\.\d+)?px\s*$/i;function ru(t){return"string"===typeof t&&iu.test(t)}function ou(t){const e=t["font-size"]||t.fontSize;return ru(e)?parseFloat(e)*Math.max(isNaN(t.lineHeight)?1.2:t.lineHeight,0):19.2}function au(t){const e=t.maxHeight,n=Math.max(t.maxLines,1)||1/0;if(isNaN(e))return n;const i=ou(t);return Math.max(1,Math.min(Math.floor(e/i),n))}function su(t,e){return{lines:[],line:"",width:0,maxLines:au(t),maxWidth:t.maxWidth,hyphens:{enabled:"auto"===t.hyphens,char:"‐",metrics:e("‐")}}}function lu(t){t.lines.push(t.line),t.line="",t.width=0}function cu(t,e){t.line+=e.value,t.width+=e.width}function uu(t,e,n){if(e.width>t.maxWidth)return e;const i=e.index;for(let r=1;r<5;r++){const o=n.peek(e.index-1);if(!e.hyphenation||!o.hyphenation||0===e.index)return e;if(t.width+t.hyphens.metrics.width<=t.maxWidth)return t.line+=t.hyphens.char,e;if(1===t.line.length)return e;e=n.next(i-r),t.line=t.line.slice(0,-1),t.width-=e.width}return e}function hu(t,e,n){const i=eu({string:e.value,measureText:n});for(;t.lines.length<t.maxLines;){let e=i.next();if(e.done)break;t.width+e.width>t.maxWidth&&2===e.breakOpportunity&&t.line.length>0?(e=t.hyphens.enabled?uu(t,e,i):e,lu(t),cu(t,e)):cu(t,e)}}function du(t,e){const n=eu({string:t.text,separator:"",measureText:e,noBreakAllowedIdentifiers:[(t,e)=>0===e]}),i=su(t,e);let r=!0;for(;i.lines.length<i.maxLines;){let t=n.next();if(t.done){lu(i),r=!1;break}1===t.breakOpportunity?lu(i):i.width+t.width>i.maxWidth&&2===t.breakOpportunity?t.suppress?i.width+=t.width:(t=i.hyphens.enabled?uu(i,t,n):t,lu(i),cu(i,t)):cu(i,t)}return{lines:i.lines,reduced:r}}function fu(t,e){const n=eu({string:t.text,separator:/(\s|-|\u2010)/,measureText:e}),i=su(t,e);let r=!0;for(;i.lines.length<i.maxLines;){let t=n.next();if(t.done){lu(i),r=!1;break}1===t.breakOpportunity?lu(i):i.width+t.width>i.maxWidth&&2===t.breakOpportunity?t.suppress?lu(i):t.width>i.maxWidth?hu(i,t,e):(lu(i),cu(i,t)):cu(i,t)}return{lines:i.lines,reduced:r}}function pu(t){return{"break-all":du,"break-word":fu}[t.wordBreak]}function gu(t){return e=>{const n=e.node;if(function(t){return"text"===t.type&&!t._lineBreak}(n)){const i=pu(n);if(!i)return;const r=t(n);if(r.width>n.maxWidth||Jc(n.text)){const o=(ou(n)-r.height)/2,a=i(n,function(t,e){return n=>e({text:n,fontSize:t.fontSize,fontFamily:t.fontFamily})}(n,t));e.node=function(t,e,n,i){const r={type:"container",children:[]};void 0!==e.id&&(r.id=e.id);let o=0;return t.lines.forEach((a,s)=>{const l=u({},e);l.text=a,l._lineBreak=!0,o+=n,t.reduced&&s===t.lines.length-1?l.text+=nu:delete l.maxWidth,l.dy=isNaN(l.dy)?o:l.dy+o,o+=i,o+=n,r.children.push(l)}),r}(a,n,o,r.height)}}}}function mu(t,e){const n=t["font-family"]||t.fontFamily,i=t["font-size"]||t.fontSize,r="string"==typeof t.text?t.text:"".concat(t.text),o=t.maxWidth;if(void 0===o)return r;let a=e({text:r,fontSize:i,fontFamily:n}).width;if(a<=o)return r;let s=0,l=r.length-1;for(;s<=l;){let t=Math.floor((s+l)/2);a=e({text:r.substr(0,t)+nu,fontSize:i,fontFamily:n}).width,a<=o?s=t+1:l=t-1}return r.substr(0,l)+nu}function yu(t){const e=t.baseline||t["dominant-baseline"];let n=0;const i=parseInt(t.fontSize||t["font-size"],10)||0;switch(e){case"hanging":n=.75*i;break;case"text-before-edge":n=.85*i;break;case"middle":n=.25*i;break;case"central":n=.35*i;break;case"mathemetical":n=i/2;break;case"text-after-edge":case"ideographic":n=.2*-i;break;default:n=0}return n}const vu={},xu={},bu={fontSize:void 0,fontFamily:void 0};let wu;function ku(t,e){return!t&&!e||t===e}function _u(t){let e=t.text,n=t.fontWeight,i=t.fontSize,r=t.fontFamily;const o="".concat(e," ").concat(n," ").concat(i," ").concat(r);return"number"!=typeof xu[o]&&(wu=wu||document.createElement("canvas").getContext("2d"),function(t){let e=t.fontWeight,n=t.fontSize,i=t.fontFamily;ku(bu.fontWeight,e)&&ku(bu.fontSize,n)&&ku(bu.fontFamily,i)||(wu.font=[e,n,i].filter(t=>!!t).join(" "),bu.fontWeight=e,bu.fontSize=n,bu.fontFamily=i)}({fontWeight:n,fontSize:i,fontFamily:r}),xu[o]=wu.measureText(e).width),xu[o]}function Mu(t){return"number"!=typeof vu[t]&&(vu[t]=function(t){if(ru(t)){const e=parseFloat(t);return e+4*Math.ceil((e+1e-12)/24)}return 16}(t)),vu[t]}function Su(t){let e=t.text,n=t.fontWeight,i=t.fontSize;return{width:_u({text:e,fontWeight:n,fontSize:i,fontFamily:t.fontFamily}),height:Mu(i)}}function Ru(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Su;const n=t["font-size"]||t.fontSize,i=t["font-family"]||t.fontFamily,r=e({text:t.text,fontFamily:i,fontSize:n}),o=Math.min(t.maxWidth||r.width,r.width),a=t.x||0,s=t.y||0,l=t.dx||0,c={x:0,y:s+((t.dy||0)+yu(t))-.75*r.height,width:o,height:r.height},u=t["text-anchor"]||t.anchor;return c.x="middle"===u?a+l-o/2:"end"===u?a+l-o:a+l,c}function Cu(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Su;const n=pu(t),i=t["font-size"]||t.fontSize,r=t["font-family"]||t.fontFamily,o=e({text:t.text,fontFamily:r,fontSize:i});if(n&&(o.width>t.maxWidth||Jc(t.text))){const o=n(t,t=>e({text:t,fontFamily:r,fontSize:i})),a=u({},t);let s=0,l="";for(let t=0,n=o.lines.length;t<n;t++){let a=o.lines[t];a+=t===n-1&&o.reduced?nu:"";const c=e({text:a,fontSize:i,fontFamily:r}).width;c>=s&&(s=c,l=a)}a.text=l;const c=Ru(a,e);return c.height=ou(t)*o.lines.length,c}return Ru(t,e)}function Nu(t,e){return{node:t,data:t.data,scale:e.scale,formatter:e.formatter,dataset:e.dataset}}function Du(t,e,n){const i={type:"text",text:e,maxWidth:t.width,x:0,y:t.y,dx:0,dy:0,fill:n.fill,anchor:"start",baseline:"alphabetical",fontSize:"".concat(n.fontSize,"px"),fontFamily:n.fontFamily},r=n.textMetrics;if(t.width<n.fontSize)return!1;const o=Math.max(0,t.width-r.width);return i.x=t.x+n.align*o,i.y=t.y+r.height/1.2,i}function qu(t){return{type:"circle",bounds:{cx:t.cx,cy:t.cy,r:t.r}}}function Eu(t){return t.desc&&t.desc.slice?function(t){let e=t.start,n=t.end,i=t.innerRadius,r=t.outerRadius,o=t.offset;if(Math.abs(e+2*Math.PI-n)>1e-12)return{type:null,bounds:null};let a=0!==i?i:r;return qu({cx:o.x,cy:o.y,r:a})}(t.desc.slice):"circle"===t.type?qu(t.attrs):"rect"===t.type?{type:"rect",bounds:t.bounds}:{type:null,bounds:null}}var Ou={bar:function(t){let e=t.settings,n=t.chart,i=t.nodes,r=t.rect,o=t.renderer,a=t.style,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Tc;const l=u({fontSize:12,fontFamily:"Arial",align:.5,justify:0,fill:"#333"},a.label);l.fontSize=parseInt(l.fontSize,10);const c=e.labels.map(t=>u({},l,e,t)),h=e.labels.map(t=>t.placements.map(n=>u({},l,e,t,n))),d=function(t){let e=t.nodes,n=t.rect,i=t.chart,r=t.labelSettings,o=t.placementSettings,a=t.settings,s=t.renderer;const l={},c=[];let u,h,d,f,p,g,m,y=!0,v=!1;for(let t=0;t<e.length;t++){if(h=e[t],f=h.localBounds,!za(f,n))continue;let x=Mc(h,i);u={node:h,texts:[],measurements:[],labelSettings:[],placementSettings:[]};for(let e=0;e<r.length;e++)g=r[e],d="function"==typeof g.label?g.label(x,t):void 0,Sc(d)&&(m="function"==typeof a.direction?a.direction(x,t):a.direction||"up",v=v||"left"===m||"right"===m,l.fontFamily=g.fontFamily,l.fontSize="".concat(g.fontSize,"px"),l.text=d,p=s.measureText(l),u.measurements.push(p),u.texts.push(d),u.labelSettings.push(g),u.placementSettings.push(o[e]),u.direction=m,y=y&&p.width<=f.width-8);c.push(u)}return{targetNodes:c,fitsHorizontally:y,hasHorizontalDirection:v}}({nodes:i,chart:n,renderer:o,settings:e,rect:r,labelSettings:c,placementSettings:h}),f=d.fitsHorizontally,p=d.hasHorizontalDirection,g=d.targetNodes,m=function(t){let e=t.orientation,n=void 0===e?"auto":e,i=t.defaultOrientation,r=void 0===i?"h":i;switch(n.toLocaleLowerCase()){case"vertical":return"v";case"horizontal":return"h";default:return r}}({orientation:e.orientation,defaultOrientation:p?"h":"v"}),y="h"===m?"y":"x",v="h"===m?"height":"width";return g.sort((t,e)=>t.node.localBounds[y]+t.node.localBounds[v]-(e.node.localBounds[y]+e.node.localBounds[v])),s({chart:n,targetNodes:g,stngs:e,rect:r,fitsHorizontally:f,collectiveOrientation:m})},slice:function(t){let e=t.settings,n=t.chart,i=t.nodes,r=t.rect,o=t.renderer,a=t.style,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Uc,l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Wc;const c=u({fontSize:12,fontFamily:"Arial",fill:"#333",padding:4,position:"into"},a.label);c.fontSize=parseInt(c.fontSize,10);const h=e.labels.map(t=>u({},c,e,t)),d=e.labels.map(t=>t.placements.map(n=>u({},c,e,t,n))),f=[],p={insideLabelBounds:[]};i=function(t){const e=[],n=[],i=[],r=[];for(let o=0;o<t.length;++o){const a=t[o].desc.slice,s=Ic((a.start+a.end)/2);switch(Math.floor(s/(Math.PI/2))){case 0:e.push(t[o]);break;case 1:n.push(t[o]);break;case 2:i.push(t[o]);break;case 3:r.push(t[o])}}const o=(t,e)=>Ic((t.desc.slice.start+t.desc.slice.end)/2)-Ic((e.desc.slice.start+e.desc.slice.end)/2),a=(t,e)=>o(e,t);return e.sort(a),n.sort(o),i.sort(a),r.sort(o),e.concat(n,r,i)}(i);const g={};for(let t=0,e=i.length;t<e;t++){const e=i[t],a=Hc(e,n);for(let n=0;n<h.length;n++){const i=h[n],c="function"==typeof i.label?i.label(a,t):"";if(!c)continue;const u="function"==typeof i.direction?i.direction(a,t):i.direction||"horizontal",m="function"==typeof i.linkData?i.linkData(a,t):void 0,y=Yc(c,i,o),v=s({context:g,direction:u,lblStngs:i,measured:y,node:e,placementSettings:d[n],rect:r,store:p}),x=v.bounds,b=v.placement;if(x&&b){if("outside"===b.position&&"rotate"!==u){Bc({context:g,node:e,bounds:x});if(!ba(Pc(x),r))continue}const n="function"==typeof b.fill?b.fill(a,t):b.fill,o=l(x,c,{fill:n,fontSize:i.fontSize,fontFamily:i.fontFamily,textMetrics:y});o&&(void 0!==m&&(o.data=m),f.push(o),x.line&&(x.line.stroke=n,f.push(x.line)))}}}return f},rows:function(t){let e=t.settings,n=t.chart,i=t.nodes,r=t.renderer,o=t.style,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Du;const s=u({fontSize:12,fontFamily:"Arial",fill:"#333",padding:4,align:.5,justify:.5},o.label);s.fontSize=parseInt(s.fontSize,10);const l=u({},s,e),c=e.labels.map(t=>u({},l,t)),h={},d=[];for(let t=0,e=i.length;t<e;t++){let e=i[t],o=Nu(e,n),s=Eu(e),u=s.type,f=s.bounds;if(!f)continue;let p,g=0,m=[],y=[],v="circle"===u?2*f.r*.9:f.height;for(g+=l.padding,p=0;p<c.length;p++){let e=c[p],n="function"==typeof e.label?e.label(o,t):"";h.fontFamily=e.fontFamily,h.fontSize="".concat(e.fontSize,"px"),h.text=n;let i=r.measureText(h);if(g+=i.height+e.padding,g>v)break;y.push(n),m.push(i)}const x=p,b=Math.max(0,v-g);let w;for(w="circle"===u?f.cy-.9*f.r:f.y,w+=l.justify*b+l.padding,p=0;p<x;p++){let e,n=c[p];if("circle"===u){let t=Math.max(Math.abs(w-f.cy),Math.abs(w+m[p].height-f.cy)),n=Math.sqrt(f.r*f.r-t*t);e={x:f.cx-n+l.padding,y:w,width:2*n-2*l.padding,height:m[p].height}}else e={x:f.x+l.padding,y:w,width:f.width-2*l.padding,height:m[p].height};w+=m[p].height+l.padding;let i="function"==typeof n.fill?n.fill(o,t):n.fill;const s="function"==typeof n.linkData?n.linkData(o,t):void 0;let h=a(e,y[p],{fill:i,align:n.align,fontSize:n.fontSize,fontFamily:n.fontFamily,textMetrics:m[p]});if(h){if(h.text&&h.text!==nu){const t=mu(h,r.measureText);if(nu===t)continue;h.ellipsed=t}void 0!==s&&(h.data=s),d.push(h)}}}return d}};const Au={require:["chart","renderer","settings"],defaultSettings:{settings:{},style:{label:"$label"}},render(){const t=this.settings.settings,e=[];return(t.sources||[]).forEach(t=>{t.strategy&&Ou[t.strategy.type]&&t.component&&e.push(...function(t,e){let n=t.chart,i=t.source,r=t.rect,o=t.renderer,a=t.style;if(!n.component(i.component))return[];const s=n.findShapes(i.selector).filter(t=>t.key===i.component);return e({chart:n,settings:i.strategy.settings,nodes:s,rect:{x:0,y:0,width:r.width,height:r.height},renderer:o,style:a})}({chart:this.chart,rect:this.rect,renderer:this.renderer,source:t,style:this.style},Ou[t.strategy.type]))}),e}};const zu={layout:{size:1,direction:"ltr",scrollOffset:0},item:{show:!0,label:{fontSize:"12px",fontFamily:"Arial",fill:"#595959",wordBreak:"none",maxLines:2,maxWidth:136,lineHeight:1.2},shape:{type:"square",size:12}},title:{show:!0,text:void 0,anchor:"start",fontSize:"16px",fontFamily:"Arial",fill:"#595959",wordBreak:"none",maxLines:2,maxWidth:156,lineHeight:1.25}};function Tu(t){let e=t.x,n=void 0===e?0:e,i=t.y,r=t.item,o=t.globalMetrics,a=t.createSymbol,s=t.direction,l=void 0===s?"ltr":s,c=r.label.displayObject,h=r.label.bounds,d=r.symbol.meta;const f="rtl"===l;let p={x:f?n+o.maxLabelBounds.width:n+o.maxSymbolSize+o.spacing,y:i,width:o.maxLabelBounds.width,height:Math.max(o.maxSymbolSize,o.maxLabelBounds.height)},g=function(t,e,n){const i=Math.max(0,t.width-e),r=Math.max(0,t.height-e);return{x:t.x+e/2+n.align*i,y:t.y+e/2+n.justify*r}}({x:f?n+o.maxLabelBounds.width+o.spacing:n,y:i,width:o.maxSymbolSize,height:p.height},d.size,{align:void 0===d.align?.5:d.align,justify:void 0===d.justify?.5:d.justify});const m=a(u({},d,g));return delete m.collider,c.anchor=f?"end":"start",function(t,e,n){const i=n.textMetrics;if(t.height<i.height)return!1;const r=Math.max(0,t.width-i.width);e.baseline="text-before-edge";const o=Math.max(0,t.height-i.height);e.x=t.x+n.align*r,e.y=t.y+n.justify*o+.175*parseInt(e.fontSize,10)}(p,c,{textMetrics:h,fontSize:parseInt(c.fontSize,10),align:0,justify:.5}),{item:{type:"container",data:r.label.displayObject.data,children:[m,c],collider:{type:"rect",x:n,y:i,width:o.maxItemBounds.width,height:o.maxItemBounds.height}},metrics:p}}function Iu(t,e){const n=t.items.length,i=Math.ceil(n/e),r="horizontal"===t.layout.orientation?"width":"height",o="width"===r?"horizontal":"vertical";return t.globalMetrics.maxItemBounds[r]*i+(i-1)*t.layout.margin[o]}function ju(t,e){let n,i,r,o,a=e.onScroll,s=void 0===a?()=>{}:a,l=null,c=0;const h={itemize:e=>{n=function(t,e){let n,i,r=t.resolved,o=t.dock,a=[],s=r.items.items,l=r.symbols.items,c=r.labels.items,h=0,d=0,f=0;for(let t=0;t<s.length;t++){if(!1===s[t].show)continue;const r=void 0!==c[t].text?c[t].text:c[t].data.label||"";n=u({},c[t],{type:"text",fontSize:"".concat(parseInt(c[t].fontSize,10),"px"),text:r,title:r}),i={symbol:{meta:l[t]},label:{displayObject:n,bounds:e.textBounds(n)}},a.push(i),h=Math.max(l[t].size,h),d=Math.max(i.label.bounds.width,d),f=Math.max(i.label.bounds.height,f)}return{items:a,globalMetrics:{spacing:8,maxSymbolSize:h,maxItemBounds:{height:Math.max(h,f),width:h+8+d},maxLabelBounds:{width:d,height:f}},layout:{margin:{vertical:void 0!==r.layout.item.vertical?r.layout.item.vertical:4,horizontal:void 0!==r.layout.item.horizontal?r.layout.item.horizontal:4},mode:r.layout.item.mode,size:r.layout.item.size,orientation:"top"===o||"bottom"===o?"horizontal":"vertical",direction:r.layout.item.direction,scrollOffset:r.layout.item.scrollOffset}}}(e,t.renderer),l=isNaN(n.layout.scrollOffset)?l:n.layout.scrollOffset},getItemsToRender:e=>{r=e.viewRect,c=h.getContentOverflow(r);const a=h.extent();l=Math.max(0,Math.min(l,c)),o=u({},r);const s="horizontal"===h.orientation()?"x":"y";return o[s]-=l,o["x"===s?"width":"height"]=a,function(t,e,n){let i=t.viewRect,r=n.itemized,o=n.create,a=void 0===o?Tu:o,s=n.parallels,l=n.createSymbol;const c=r.layout.direction,u=r.globalMetrics,h=r.items,d="horizontal"===r.layout.orientation;let f=0;const p=[],g=u.maxItemBounds.height,m=u.maxItemBounds.width,y=r.layout.margin.vertical+g,v=r.layout.margin.horizontal+m;let x=e.x,b=e.y,w=i.x-e.x;for(let t=0;t<h.length;t++){let n=a({y:b,x:"rtl"===c?i.x+w+i.width-m-(x-e.x):x,item:h[t],globalMetrics:u,direction:c,createSymbol:l});if((d&&x>=i.x-m||!d&&b>=i.y-g)&&p.push(n.item),f++,f>=s?(f=0,d?(x+=v,b=e.y):(b+=y,x=e.x)):d?b+=y:x+=v,!d&&b>i.y+i.height)break;if(d&&x>i.x+i.width)break}return p}(e,o,{itemized:n,parallels:i,createSymbol:t.symbol})},parallelize:(t,e)=>(i=function(t,e,n){const i=n.items.length,r="horizontal"===n.layout.orientation?"width":"height",o="width"===r?"horizontal":"vertical",a=n.globalMetrics.maxItemBounds[r]*i+(i-1)*n.layout.margin[o];let s=Math.ceil(a/t);if(null!=e){const t="horizontal"===n.layout.orientation?"height":"width",i="width"===t?"horizontal":"vertical",r=n.layout.margin[i]||4,o=Math.floor((e+r)/(r+n.globalMetrics.maxItemBounds[t]));s=Math.min(s,o)}const l=isNaN(n.layout.size)?1:n.layout.size;return Math.max(1,Math.min(s,l))}(t,e,n),i),hasContentOverflow:()=>{const t="horizontal"===n.layout.orientation?"width":"height";return Iu(n,i)>r[t]},getContentOverflow:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r;const e="horizontal"===n.layout.orientation?"width":"height";return Math.max(0,Iu(n,i)-t[e])},getNextSize:()=>{const t="horizontal"===n.layout.orientation?"width":"height",e="width"===t?"horizontal":"vertical";return n.globalMetrics.maxItemBounds[t]+n.layout.margin[e]},getPrevSize:()=>{const t="horizontal"===n.layout.orientation?"width":"height",e="width"===t?"horizontal":"vertical";return n.globalMetrics.maxItemBounds[t]+n.layout.margin[e]},hasNext:()=>"horizontal"===h.orientation()?r.x+r.width<o.x+o.width:r.y+r.height<o.y+o.height,hasPrev:()=>"horizontal"===h.orientation()?o.x<r.x:o.y<r.y,next:()=>{h.scroll(-h.getNextSize())},prev:()=>{h.scroll(h.getPrevSize())},scroll:t=>{const e=Math.max(0,Math.min(c,l-t));e!==l&&(l=e,s())},offset:()=>l,orientation:()=>n.layout.orientation,direction:()=>n.layout.direction,extent:()=>Iu(n,i),spread:()=>function(t,e){const n=e,i="horizontal"===t.layout.orientation?"height":"width",r="width"===i?"horizontal":"vertical";return t.globalMetrics.maxItemBounds[i]*n+(n-1)*t.layout.margin[r]}(n,i)};return h}function Pu(t){return Object.keys(t).filter(e=>t[e]).join(" ")}const Fu={up:"▲",right:"▶",down:"▼",left:"◀"};function Lu(t,e){let n=e.size,i=e.isActive,r=e.direction,o=e.nav,a={},s="";const l=e.attrs;o&&o.button&&("function"==typeof o.button.class?a=o.button.class({direction:r}):o.button.class&&(a=o.button.class),"function"==typeof o.button.content&&(s=o.button.content(t,{direction:r})),void 0!==o.button.tabIndex&&(l.tabindex=o.button.tabIndex));const c={width:"".concat(n,"px"),minWidth:"".concat(n,"px"),height:"".concat(n,"px")};return Object.keys(a).length||(c.border="0",c.background="none"),(!i||o&&o.disabled)&&(l.disabled="disabled"),t("button",u({class:Pu(a),style:c},l),[s||t("span",{style:{pointerEvents:"none"}},[Fu[r]])])}function $u(t){let e;const n={itemize:t=>{e=function(t){let e=t.dock;return{layout:{orientation:"top"===e||"bottom"===e?"vertical":"horizontal"},navigation:t.navigation}}(t)},render:i=>function(t,e,n,i){let r=e.rect,o=e.itemRenderer;if(!t||!t.renderArgs)return;t.size(r);const a=t.renderArgs[0],s="vertical"===n.layout.orientation,l="rtl"===o.direction(),c=o.hasNext(),u=o.hasPrev();if(!u&&!c)return void t.render([]);const h=s?["right","left"]:["down","up"];l&&s&&h.reverse();const d=[a("div",{style:{position:"relative",display:"flex","flex-direction":s?"column":"row","justify-content":"center",height:"100%",pointerEvents:"auto"},dir:l&&!s?"rtl":"ltr"},[Lu(a,{size:32,isActive:c,direction:h[0],attrs:{"data-action":"next","data-component-key":i.settings.key},nav:n.navigation}),Lu(a,{size:32,isActive:u,direction:h[1],attrs:{"data-action":"prev","data-component-key":i.settings.key},nav:n.navigation})])];t.render(d)}(n.renderer,i,e,t),extent:()=>32,spread:()=>64};return n}function Bu(t){let e;const n={itemize:n=>{e=function(t,e){let n=t.resolved;if(!1===n.title.item.show)return null;const i=u({},n.title.item,{type:"text"});if("rtl"===n.layout.item.direction&&(i.anchor&&"start"!==i.anchor?"end"===i.anchor&&(i.anchor="start"):i.anchor="end"),void 0===n.title.settings.text){const t=e.scale.data().fields;i.text=t&&t[0]?t[0].title():""}return{displayObject:i,bounds:e.renderer.textBounds(i)}}(n,t)},render:t=>{!function(t,e,n){let i=t.rect;if(!e)return;const r=[];if(e.size(i),n){const t={start:0,end:i.width,middle:i.width/2};r.push(u({},n.displayObject,{x:t[n.displayObject.anchor]||0,y:0,baseline:"text-before-edge",title:n.displayObject.text}))}e.render(r)}(t,n.renderer,e)},spread:()=>e?e.bounds.height:0,extent:()=>e?e.bounds.width:0};return n}function Hu(t,e,n,i){let r,o,a,s=i.itemRenderer,l=i.navigationRenderer,c=i.titleRenderer,h=i.isPreliminary,d=void 0!==h&&h,f=0;const p={x:e.spacing,y:e.spacing,width:t.width-2*e.spacing,height:t.height-2*e.spacing};if(r={x:p.x,y:p.y,width:p.width,height:c.spread()},"horizontal"===n){r={x:p.x,y:p.y,width:c.extent(),height:c.spread()};const t=p.width-r.width-(r.width?e.spacing:0),n=p.height;s.parallelize(t,d?void 0:n);const i=s.extent()>t?l.extent():0,u=s.spread(),h=i?l.spread():0;o={x:r.x+r.width+(r.width?e.spacing:0),y:p.y+Math.max(0,(h-u)/2),width:p.width-i-r.width-(i?e.spacing:0)-(r.width?e.spacing:0),height:n},a={x:o.x+o.width+(i?e.spacing:0),y:p.y,width:i,height:p.height},r.y=o.y;"rtl"===s.direction()&&(a.x=p.x,o.x=a.x+a.width+(a.width?e.spacing:0),r.x=o.x+o.width+(r.width?e.spacing:0)),f=Math.max(r.height,h,s.spread())}else{const t=p.height-r.height-(r.height?e.spacing:0),n=p.width;s.parallelize(t,d?void 0:n);const i=s.extent()>t?l.extent():0;a={x:p.x,y:p.y+p.height-i,width:p.width,height:i},o={x:p.x,y:r.y+r.height+(r.height?e.spacing:0),width:p.width,height:p.height-r.height-(r.height?e.spacing:0)-a.height-(a.height?e.spacing:0)},f=Math.max(c.extent(),i?l.spread():0,s.spread())}return o=u({},t,{x:t.x+o.x,y:t.y+o.y,width:o.width,height:o.height}),a.x+=t.x,a.y+=t.y,r.x+=t.x,r.y+=t.y,{title:u({},t,r),content:u({},t,o),navigation:u({},t,a),orientation:n,preferredSize:f}}function Wu(t){t.state.resolved=function(t){const e=t.scale.domain();let n={items:[]};const i=t.settings.layout.dock;if("threshold-color"===t.scale.type){const r=t.scale.data().fields[0];let o=t=>String(t);t.settings.formatter?o=t.chart.formatter(t.settings.formatter):r&&(o=r.formatter());for(let t=0;t<e.length-1;t++){const i={value:e[t],label:"".concat(o(e[t])," - < ").concat(o(e[t+1]))};r&&(i.source={field:r.id()}),n.items.push(i)}"vertical"==("top"===i||"bottom"===i?"horizontal":"vertical")&&n.items.reverse()}else{const i=t.scale.labels?t.scale.labels():null;n.items=e.map((e,n)=>{const r=t.scale.datum?u({},t.scale.datum(e)):{value:e};return r.value=e,t.scale.label?r.label=t.scale.label(e):i&&(r.label=i[n]),r})}const r=t.resolver.resolve({data:{fields:t.scale.data().fields},defaults:u(!0,{},zu.title,t.style.title),settings:t.settings.settings.title}),o=t.resolver.resolve({data:{fields:t.scale.data().fields},defaults:zu.layout,settings:t.settings.settings.layout}),a=t.resolver.resolve({data:n,defaults:u(!0,{},zu.item.label,t.style.item.label),settings:(t.settings.settings.item||{}).label}),s=u(!0,{},(t.settings.settings.item||{}).shape);void 0===s.fill&&t.settings.scale&&(s.fill={scale:t.settings.scale});const l=t.resolver.resolve({data:n,defaults:u(!0,{},zu.item.shape,t.style.item.shape),settings:s}),c=t.resolver.resolve({data:n,defaults:u(!0,{},{show:zu.item.show}),settings:{show:(t.settings.settings.item||{}).show}});function h(t,n){let i=t.data.value,r=e[n+1];t.data.value=[i,r]}"threshold-color"===t.scale.type&&("vertical"==("top"===i||"bottom"===i?"horizontal":"vertical")?(c.items.reverse().forEach(h),c.items.reverse()):c.items.forEach(h));return{title:r,labels:a,symbols:l,items:c,layout:o}}(t),t.titleRenderer.itemize({resolved:t.state.resolved,dock:t.settings.layout.dock||"center"}),t.itemRenderer.itemize({resolved:t.state.resolved,dock:t.settings.layout.dock||"center"}),t.navigationRenderer.itemize({resolved:t.state.resolved,dock:t.settings.layout.dock||"center",navigation:t.settings.settings.navigation}),t.state.display={spacing:8}}function Vu(t){const e=t.rect,n=t.settings,i=t.state,r=t.itemRenderer,o=t.navigationRenderer,a=t.titleRenderer,s=n.layout.dock,l="top"===s||"bottom"===s?"horizontal":"vertical",c=Hu(e,i.display,l,{itemRenderer:r,navigationRenderer:o,titleRenderer:a});t.renderer.size(c.content);let h=r.getItemsToRender({viewRect:u({},c.content,{x:0,y:0})});return o.render({rect:c.navigation,itemRenderer:r}),a.render({rect:c.title}),t.state.views={layout:c},h}const Uu={require:["chart","settings","renderer","update","resolver","registries","symbol"],defaultSettings:{settings:{},style:{item:{label:"$label",shape:"$shape"},title:"$title"}},mounted(t){t&&t.parentNode&&(this.navigationRenderer.renderer.appendTo(t.parentNode),this.titleRenderer.renderer.appendTo(t.parentNode),t.parentNode.insertBefore(this.navigationRenderer.renderer.element(),t),t.parentNode.insertBefore(this.titleRenderer.renderer.element(),t)),this.navigationRenderer.render({rect:this.state.views.layout.navigation,itemRenderer:this.itemRenderer}),this.titleRenderer.render({rect:this.state.views.layout.title})},beforeUnmount(){this.navigationRenderer.renderer.clear(),this.titleRenderer.renderer.clear()},on:{panstart(){if(this.state.interaction.started)return;this.itemRenderer.getContentOverflow()&&(this.state.interaction.started=!0,this.state.interaction.delta=0)},panmove(t){if(!this.state.interaction.started)return;const e="horizontal"===this.itemRenderer.orientation()?("rtl"===this.itemRenderer.direction()?-1:1)*t.deltaX:t.deltaY;this.itemRenderer.scroll(e-this.state.interaction.delta),this.state.interaction.delta=e},panend(){this.state.interaction.started=!1},scroll(t){this.itemRenderer.scroll(-t)},next(){this.itemRenderer.next()},prev(){this.itemRenderer.prev()}},created(){this.state={interaction:{}},this.onScroll=()=>{const t=Vu(this);this.update(t)},this.itemRenderer=ju(this,{onScroll:this.onScroll}),this.navigationRenderer=$u(this),this.titleRenderer=Bu(this),this.navigationRenderer.renderer=this.registries.renderer("dom")(),this.titleRenderer.renderer=this.registries.renderer(this.settings.renderer)(),Wu(this)},preferredSize(t){return function(t,e){let n=0;const i=t.settings.layout.dock||"center",r="top"===i||"bottom"===i?"horizontal":"vertical",o=t.state.display,a=Hu(e.inner,o,r,{itemRenderer:t.itemRenderer,navigationRenderer:t.navigationRenderer,titleRenderer:t.titleRenderer,isPreliminary:!0});return n+=o.spacing,n+=a.preferredSize,n+=o.spacing,n}(this,t)},beforeUpdate(){Wu(this)},render(){return Vu(this)},beforeDestroy(){this.navigationRenderer.renderer.destroy(),this.titleRenderer.renderer.destroy()},additionalElements(){return[this.titleRenderer.renderer.element(),this.navigationRenderer.renderer.element()]},_DO_NOT_USE_getInfo(){return{offset:this.itemRenderer.offset()}}};function Yu(t,e){let n=0;const i=t.state.isVertical?"justify":"align",r=t.state.isVertical?"y":"x",o=t.state.isVertical?"height":"width",a=t.state.isVertical?"requiredHeight":"requiredWidth";n=t.state.rect[o]-t.state.legend.length()-t.state.title[a](),n*=Math.min(1,Math.max(t.stgns[i],0)),e[r]+=n}function Ku(t,e,n){const i=n[t];return"object"==typeof i?-1!==i.valid.indexOf(e)?e:i.default:n.default}function Gu(t){return Ku(t.layout.dock,t.settings.title.anchor,{left:{valid:["top"],default:"top"},right:{valid:["top"],default:"top"},top:{valid:["left","right"],default:"left"},bottom:{valid:["left","right"],default:"left"},default:"top"})}function Xu(t,e){const n={x:0,y:0,width:0,height:0},i=t.stgns.padding;return n.x=i.left,n.y=i.top,n.width=e.width-i.left-i.right,n.height=e.height-i.top-i.bottom,n}function Ju(t){const e="top"!==t.settings.layout.dock&&"bottom"!==t.settings.layout.dock,n=t.stgns.title,i=t.chart.scale(t.stgns.fill),r=t.chart.scale(t.stgns.major),o=function(t,e){const n=e.domain();let i=n,r=t.stgns.tick.label;!r&&t.formatter?r=t.formatter:!r&&e.data().fields&&(r=e.data().fields[0].formatter()),"function"==typeof r&&(i=n.map(r).map(String));const o=n.map((n,r)=>{const o=i[r];return{value:n,label:o,pos:e.norm(parseFloat(n,10)),textMetrics:t.renderer.measureText({text:o,fontSize:t.stgns.tick.fontSize,fontFamily:t.stgns.tick.fontFamily})}});return o}(t,r),a=Ku((s=t.settings).layout.dock,s.settings.tick.anchor,{left:{valid:["left","right"],default:"left"},right:{valid:["left","right"],default:"right"},top:{valid:["top","bottom"],default:"top"},bottom:{valid:["top","bottom"],default:"bottom"},default:"right"});var s;if(void 0===n.text){const t=r.data().fields;n.text=t&&t[0]?t[0].title():""}const l=t.renderer.measureText({text:n.text,fontSize:n.fontSize,fontFamily:n.fontFamily}),c=t.renderer.textBounds({text:n.text,fontSize:n.fontSize,fontFamily:n.fontFamily,maxLines:n.maxLines,maxWidth:n.maxLengthPx,wordBreak:n.wordBreak,hyphens:n.hyphens,lineHeight:n.lineHeight}),u={isVertical:e,nodes:[],title:{anchor:Gu(t.settings),textMetrics:l,textBounds:c,requiredWidth:()=>{if(!n.show)return 0;let t=c.width,i=n.maxLengthPx;return e||(t+=n.padding,i+=n.padding),Math.min(t,i,u.rect.width)},requiredHeight:()=>{if(!n.show)return 0;let t=c.height;return e&&(t+=n.padding),Math.min(t,u.rect.height)}},ticks:{values:o,anchor:a,length:Math.min(Math.max(...o.map(t=>t.textMetrics.width)),t.stgns.tick.maxLengthPx),requiredHeight:()=>"top"===a?Math.max(...u.ticks.values.map(t=>t.textMetrics.height))+t.stgns.tick.padding:0,height:Math.max(...o.map(t=>t.textMetrics.height))},legend:{fillScale:i,majorScale:r,length:()=>{const n=e?"height":"width",i=e?"requiredHeight":"requiredWidth",r=Math.min(u.rect[n],u.rect[n]*t.stgns.length)-u.title[i]();return Math.max(0,Math.min(r,t.stgns.maxLengthPx))}}};return u}const Zu={require:["chart","settings","renderer"],defaultSettings:{layout:{displayOrder:0,dock:"right"},settings:{size:15,length:.5,maxLengthPx:250,align:.5,justify:0,padding:{left:5,right:5,top:5,bottom:5},tick:{label:null,fill:"#595959",fontSize:"12px",fontFamily:"Arial",maxLengthPx:100,anchor:null,padding:5},title:{show:!0,text:void 0,fill:"#595959",fontSize:"12px",fontFamily:"Arial",maxLengthPx:100,padding:5,maxLines:2,wordBreak:"none",lineHeight:1.2,hyphens:"auto",anchor:null}}},preferredSize(t){const e=this.state;e.rect=Xu(this,t.inner);let n=this.stgns.size;const i=e.isVertical?this.stgns.padding.left+this.stgns.padding.right:this.stgns.padding.top+this.stgns.padding.bottom;n+=i;const r=Math.max(t.inner.width,t.inner.height);if("left"===e.ticks.anchor||"right"===e.ticks.anchor){const t=e.ticks.values.reduce((t,e)=>t+e.textMetrics.height,0);if(t>this.state.legend.length())return r;n+=e.ticks.length}else{if(e.ticks.length>this.state.legend.length())return r;n+=Math.max(...e.ticks.values.map(t=>t.textMetrics.height))}return n+=this.stgns.tick.padding,this.stgns.title.show&&(n="left"===e.title.anchor||"right"===e.title.anchor?Math.max(e.title.textBounds.height+i,n):Math.max(n,e.title.requiredWidth()+i)),this.state.preferredSize=n,n},created(){this.stgns=this.settings.settings,this.state=Ju(this)},beforeUpdate(t){this.stgns=t.settings.settings,this.state=Ju(this)},beforeRender(t){if(this.state.nodes=[],this.state.rect=Xu(this,t.size),this.stgns.title.show){const t=function(t){const e=t.state,n=t.stgns,i="left"===e.ticks.anchor,r="top"===e.ticks.anchor;let o=e.rect.x,a=e.rect.y,s="start";"left"===e.title.anchor?(o+=e.title.requiredWidth()-n.title.padding,a+=e.title.textMetrics.height,a+=r?e.rect.height-e.title.textBounds.height:0,s="end"):"right"===e.title.anchor?(o+=e.legend.length(),o+=n.title.padding,a+=e.title.textMetrics.height,a+=r?e.rect.height-e.title.textBounds.height:0):"top"===e.title.anchor&&(o+=i?e.rect.width:0,a+=e.title.textMetrics.height,s=i?"end":"start");const l={tag:"legend-title",type:"text",x:o,y:Math.min(a,e.rect.y+e.rect.height),text:n.title.text,fill:n.title.fill,fontSize:n.title.fontSize,fontFamily:n.title.fontFamily,maxWidth:n.title.maxLengthPx,maxLines:n.title.maxLines,wordBreak:n.title.wordBreak,hyphens:n.title.hyphens,lineHeight:n.title.lineHeight,anchor:s,title:n.title.text};return Yu(t,l),l}(this);this.state.nodes.push(t)}const e=function(t){const e=t.state.legend.fillScale,n=t.state.legend.majorScale;return e.domain().map(t=>({type:"stop",color:e(t),offset:Math.min(1,Math.max(0,n.norm(t)))})).sort((t,e)=>t.offset-e.offset)}(this),n=function(t,e){const n=t.state,i=t.stgns,r=n.rect;let o=r.x,a=r.y,s=n.isVertical?i.size:n.legend.length(),l=n.isVertical?n.legend.length():i.size;"left"===n.ticks.anchor?o+=n.rect.width-i.size:"top"===n.ticks.anchor&&(a+=n.rect.height-i.size),"top"===n.title.anchor?a+=n.title.requiredHeight():"left"===n.title.anchor&&(o+=n.title.requiredWidth());const c={type:"rect",x:o,y:a,width:s,height:l,fill:{type:"gradient",stops:e,degree:n.isVertical?90:180}};return Yu(t,c),c}(this,e),i=function(t,e){const n=t.state,i=t.stgns;let r="start";const o={type:"rect",x:e.x,y:e.y,width:n.isVertical?0:e.width,height:n.isVertical?e.height:0,fill:"transparent"},a=n.ticks.values.map(a=>{let s=0,l=0,c=0,u="alphabetical";return n.isVertical?(l=e.y+e.height*a.pos,u=0===a.pos?"text-before-edge":"text-after-edge"):s=e.x+e.width*a.pos,"right"===n.ticks.anchor?(s=e.x+i.size+i.tick.padding,o.x=e.x+e.width):"left"===n.ticks.anchor?(s=e.x-i.tick.padding,r="end"):"top"===n.ticks.anchor?(l=e.y-i.tick.padding,c-=.25*a.textMetrics.height,r=0===a.pos?"start":"end"):"bottom"===n.ticks.anchor&&(l=e.y+e.height+i.tick.padding,c=.8*a.textMetrics.height,r=0===a.pos?"start":"end",o.y=e.y+e.height),{type:"text",x:s,y:l,dx:0,dy:c,text:a.label,fontSize:i.tick.fontSize,fontFamily:i.tick.fontFamily,fill:i.tick.fill,maxWidth:n.isVertical?i.tick.maxLengthPx:Math.min(i.tick.maxLengthPx,n.legend.length()/2),anchor:r,textBoundsFn:t.renderer.textBounds,title:a.label,baseline:u}});return{type:"container",id:"legend-seq-ticks",children:[...a,o]}}(this,n),r={id:"legend-seq-target",type:"container",children:[n,i]};this.state.nodes.push(r)},render(){return this.state.nodes}};const Qu={coordinates:{minor:.5,major:.5,layerId:0,defined:!0},layers:{curve:"linear",show:!0,line:{stroke:"#ccc",strokeWidth:1,strokeLinejoin:"miter",strokeDasharray:void 0,opacity:1,show:!0,showMinor0:!0},area:{fill:"#ccc",opacity:.8,show:!0}}};function th(t,e){let n=e.generatorType,i=e.item,r=e.data,o=e.major,a=e.minor,s=e.layerObj,l=e.stngs,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const u={type:"path",points:t,generatorType:n,major:o,minor:a,layerObj:s,stngs:l,opacity:i.opacity,stroke:i.stroke,strokeWidth:i.strokeWidth,strokeLinejoin:i.strokeLinejoin,fill:c||i.fill,data:r};return i.strokeDasharray&&(u.strokeDasharray=i.strokeDasharray),u}function eh(t){const e=function(t){let e=t.data,n=t.stngs,i=t.rect,r=t.resolver,o=t.style,a=t.domain;const s=i.width,l=i.height,c=r.resolve({data:e,defaults:Qu.coordinates,settings:n.coordinates||{},scaled:{major:"vertical"===n.orientation?l:s,minor:"vertical"===n.orientation?s:l}}),h=!n.connect&&a.length>2&&("function"==typeof n.coordinates.layerId||"object"==typeof n.coordinates.layerId),d={};let f=0;for(let t=0;t<c.items.length;t++){let e=c.items[t],n=e.layerId;if(h){const t=d[n]?d[n].items[d[n].items.length-1]:null,i=t?a.indexOf(t.data.major?t.data.major.value:t.data.value):null;t&&a.indexOf(e.data.major?e.data.major.value:e.data.value)-1!==i&&d[n].items.push({dummy:!0})}d[n]=d[n]||{order:f++,id:n,items:[],dataItems:[],consumableData:{}},d[n].dataItems.push(e.data),d[n].items.push(e)}const p=Object.keys(d).map(t=>(d[t].consumableData=g({points:d[t].dataItems},d[t].dataItems[0]),d[t])),m={items:p.map(t=>t.consumableData)},y=n.layers||{};return{coordinates:c,metaLayers:p,layers:r.resolve({data:m,defaults:{curve:Qu.layers.curve,show:Qu.layers.show},settings:{curve:y.curve,show:y.show}}),lines:r.resolve({data:m,defaults:u({},Qu.layers.line,o.line),settings:y.line}),areas:r.resolve({data:m,defaults:u({},Qu.layers.area,o.area),settings:y.area})}}(t),n=e.metaLayers,i=e.coordinates,r=e.layers,o=e.lines,a=e.areas,s=[];return n.forEach((e,n)=>{const l=r.items[n];if(!1===l.show)return;l.datum=l.data,l.data=[],l.id=e.id;const c=[],u=[];let h,d;for(let n=0;n<e.items.length;n++){if(h=e.items[n],d=h.data,!h.dummy){if(isNaN(h.major))continue;t.missingMinor0&&(h.minor0=i.settings.minor.scale?i.settings.minor.scale(d.minor0?d.minor0.value:0):0),isNaN(h.minor)||c.push(h.minor),l.data.push(h.data)}u.push(h)}const f=c.sort((t,e)=>t-e)[Math.floor((c.length-1)/2)];s.push({layerObj:l,lineObj:o.items[n],areaObj:a.items[n],median:f,points:u,consumableData:e.consumableData})}),s}const nh={require:["chart","resolver"],defaultSettings:{style:{area:"$shape",line:"$shape-outline"}},created(){},render(t){let e=t.data;const n=this.rect,i=n.width,r=n.height;this.stngs=this.settings.settings||{};const o=!this.stngs.coordinates||void 0===this.stngs.coordinates.minor0,a=eh({data:e,stngs:this.stngs,rect:this.rect,resolver:this.resolver,style:this.style,missingMinor0:o,domain:this.stngs.coordinates&&this.stngs.coordinates.major&&this.stngs.coordinates.major.scale?this.chart.scale(this.stngs.coordinates.major.scale).domain():[]});if(this.stngs.layers&&this.stngs.layers.sort){const t=a.map(t=>({id:t.layerObj.id,data:t.layerObj.data})).sort(this.stngs.layers.sort).map(t=>t.id);a.sort((e,n)=>t.indexOf(e.layerObj.id)-t.indexOf(n.layerObj.id))}else a.sort((t,e)=>t.median-e.median);return function(t,e){let n=e.width,i=e.height,r=e.missingMinor0,o=e.stngs;const a=[],s=o.layers||{};return t.forEach(t=>{const e=t.lineObj,l=t.layerObj,c=t.areaObj,h=t.points;let d={size:i,p:"y"},f={size:n,p:"x"};if("vertical"===o.orientation){const t=u(!0,{},f);f=u(!0,{},d),d=u(!0,{},t)}s.area&&!1!==c.show&&a.push(th(h,{data:t.consumableData,item:c,generatorType:"area",major:f,minor:d,layerObj:l,stngs:o})),e&&!1!==e.show&&(a.push(th(h,{data:t.consumableData,item:e,generatorType:"line".concat(d.p.toUpperCase(),"1"),major:f,minor:d,layerObj:l,stngs:o},"none")),!r&&s.area&&!1!==c.show&&!1!==e.showMinor0&&a.push(th(h,{data:t.consumableData,item:e,generatorType:"line".concat(d.p.toUpperCase(),"0"),major:f,minor:d,layerObj:l,stngs:o},"none")))}),a}(a,{width:i,height:r,missingMinor0:o,stngs:this.stngs})}};function ih(t,e){let n,i,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];"object"==typeof e.center?(n=e.center.x,i=e.center.y):(n=e.clientX,i=e.clientY);const o=n-t.state.boundingRect.left,a=i-t.state.boundingRect.top;return{x:r?Math.max(0,Math.min(o,t.rect.width)):o,y:r?Math.max(0,Math.min(a,t.rect.height)):a}}function rh(t,e){return{x:e.x+t.rect.x,y:e.y+t.rect.y}}function oh(t,e){const n=Math.min(t.x,e.x),i=Math.min(t.y,e.y);return{x:n,y:i,width:Math.max(t.x,e.x)-n,height:Math.max(t.y,e.y)-i}}const ah={require:["chart","renderer"],defaultSettings:{layout:{displayOrder:99},settings:{brush:{components:[]}},style:{area:"$selection-area-target"}},on:{areaStart(t){this.start(t)},areaMove(t){this.move(t)},areaEnd(t){this.end(t)},areaCancel(){this.cancel()}},created(){this.state={start:{x:0,y:0},end:{x:0,y:0},active:!1}},preferredSize:()=>0,render(){},start(t){this.state.boundingRect=this.renderer.element().getBoundingClientRect();const e=ih(this,t,!1);Ia({x:0,y:0,width:this.rect.width,height:this.rect.height},e)&&(this.state.brushConfig=this.settings.settings.brush.components.map(t=>({key:t.key,contexts:t.contexts,data:t.data,action:t.action||"set"})),this.state.start=ih(this,t),this.state.active=!0)},move(t){var e;this.state.active&&(this.state.end=ih(this,t),function(t){if(t.state.active){const e=rh(t,t.state.start),n=rh(t,t.state.end),i=t.chart.shapesAt(oh(e,n),{components:t.state.brushConfig});t.chart.brushFromShapes(i,{components:t.state.brushConfig})}}(this),(e=this).renderer.render([u({type:"rect"},oh(e.state.start,e.state.end),e.style.area)]))},end(){this.state.active&&(this.state={start:{x:0,y:0},end:{x:0,y:0},active:!1},this.renderer.render([]))},cancel(){var t,e;this.state.active&&(t=this.state,e=this.chart,t.brushConfig.forEach(t=>{Array.isArray(t.contexts)&&t.contexts.forEach(t=>{e.brush(t).end()})}),this.state={start:{x:0,y:0},end:{x:0,y:0},active:!1},this.renderer.render([]))}};function sh(t,e,n){let i=n.renderer,r=n.style,o=n.props,a=n.h;const s=function(t,e){return{tooltip:"function"==typeof t.tooltipClass?t.tooltipClass({dock:e.dock}):t.tooltipClass,content:"function"==typeof t.contentClass?t.contentClass({dock:e.dock}):t.contentClass,arrow:"function"==typeof t.arrowClass?t.arrowClass({dock:e.dock}):t.arrowClass}}(o,e),l=function(t,e,n,i){return i.content({h:t,style:n,data:e})}(a,t,r,o),c=a("div",{dir:o.direction,class:Pu(u({"pic-tooltip":!0},s.tooltip)),style:u({position:"relative",display:"inline-block"},e.computedTooltipStyle)},a("div",{style:r.content,class:Pu(u({"pic-tooltip-content":!0},s.content))},l),a("div",{class:Pu(u({"pic-tooltip-arrow":!0},s.arrow)),style:u({},r.arrow,r["arrow-".concat(e.dock)],e.computedArrowStyle)}));return i.render(c),i.element().children[0]}function lh(t){let e=t.defaultDuration,n=t.defaultDelay,i=null,r=null,o=!1;const a=function(){const t=function(){},e={pending:[],debounced:[],active:[],cancelled:[],rejected:[],fulfilled:[]};let n;return t.set=t=>{n=t,e[n].forEach(e=>e(t))},t.on=(t,n)=>{Array.isArray(t)?t.forEach(t=>e[t].push(n)):e[t].push(n)},t.destroy=()=>{Object.keys(e).forEach(t=>{e[t].length=0})},t}(),s=function(){},l=()=>{i=null,r=null,o=!1,a.set("fulfilled")};return s.invoke=function(t){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n;i&&(clearTimeout(i),a.set("debounced")),a.set("pending"),i=setTimeout(()=>{t(),o=!0,i=null,a.set("active")},c),s>0&&(r&&clearTimeout(r),r=setTimeout(l,s+Math.max(c,0)))},s.clear=()=>{o?a.set("cancelled"):i&&(clearTimeout(i),a.set("rejected")),r&&clearTimeout(r),i=null,r=null,o=!1},s.on=(t,e)=>{a.on(t,e)},s.destroy=()=>{s.clear(),a.destroy()},s}function ch(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return{left:"translate(-100%,-50%) translateX(".concat(-t,"px)"),right:"translate(".concat(t,"px, -50%)"),top:"translate(-50%, -100%) translateY(".concat(-t,"px)"),bottom:"translate(-50%, ".concat(t,"px)"),inside:"translate(-50%, -50%)"}}function uh(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return{left:{x:-t-n,y:-e/2},right:{x:n,y:-e/2},top:{x:-t/2,y:-e-n},bottom:{x:-t/2,y:n},inside:{x:-t/2,y:-e/2}}}function hh(t,e){const n=t>0?"-":"+";return t=Math.abs(t),void 0===e&&(e=t),{left:{left:"100%",top:"calc(50% ".concat(n," ").concat(t,"px)"),borderWidth:"".concat(e,"px")},right:{left:"".concat(2*-t,"px"),top:"calc(50% ".concat(n," ").concat(t,"px)"),borderWidth:"".concat(e,"px")},top:{left:"calc(50% ".concat(n," ").concat(t,"px)"),top:"100%",borderWidth:"".concat(e,"px")},bottom:{left:"calc(50% ".concat(n," ").concat(t,"px)"),top:"".concat(2*-t,"px"),borderWidth:"".concat(e,"px")},inside:{left:"0px",top:"0px",borderWidth:"0px"}}}function dh(t,e,n,i,r,o){const a=e+o.x,s=n+o.y,l=r;return!(a<0||s<0)&&!(a+i>t.width||s+l>t.height)}function fh(t){let e=t.area,n=t.vx,i=t.vy,r=t.width,o=t.height,a=t.offset;const s=n+a.x,l=i+a.y,c=r,u=o;let h=s<0?-s:0,d=l<0?-l:0;return h+=s+c>e.width?-(s+c-e.width):0,d+=l+u>e.height?-(l+u-e.height):0,{x:h,y:d}}function ph(t){let e=t.options,n=t.pointer,i=t.width,r=t.height,o=t.dockOrder,a=t.x,s=t.y;const l=n.targetBounds,c=ch(e.offset),u=c[e.dock];if(u)return{computedTooltipStyle:{left:"".concat(a,"px"),top:"".concat(s,"px"),transform:u},computedArrowStyle:hh(e.offset)[e.dock],dock:e.dock};const h={width:"target"===e.area?l.width:window.innerWidth,height:"target"===e.area?l.height:window.innerHeight},d=uh(i,r,e.offset),f=[],p="target"===e.area?a:l.left+a,g="target"===e.area?s:l.top+s;for(let t=0;t<o.length;t+=1){const n=o[t],l=fh({area:h,vx:p,vy:g,width:i,height:r,offset:d[n]}),u={left:"".concat(a,"px"),top:"".concat(s,"px"),transform:c[n]},m=hh(e.offset)[n];0!==l.x&&(u.width="".concat(i-20-Math.abs(l.x),"px"),"top"!==n&&"bottom"!==n||(u.left="".concat(a+l.x,"px"),m.left="calc(50% ".concat(l.x>0?"-":"+"," ").concat(Math.abs(l.x),"px)")));const y={computedTooltipStyle:u,computedArrowStyle:m,dock:n,rect:{width:i,height:r}};if(0===l.x&&0===l.y)return y;y.offset=l,f.push(y)}return f.sort((t,e)=>Math.abs(t.offset.x)-Math.abs(e.offset.x)),f[0]}function gh(t,e,n){const i=t.key?n.component(t.key):n.componentsFromPoint({x:e.clientX,y:e.clientY})[0];if(!i)return{x:0,y:0,width:0,height:0,scaleRatio:{x:1,y:1}};const r=i.rect;return u({scaleRatio:r.scaleRatio},r.computedInner)}const mh={bounds:function(t){let e=t.resources,n=t.nodes,i=t.pointer,r=t.width,o=t.height,a=t.options;const s=i.targetBounds,l=e.getNodeBoundsRelativeToTarget(n[0]),c=l.x,u=l.y,h=l.width,d=l.height,f={left:{x:c,y:u+d/2},right:{x:c+h,y:u+d/2},top:{x:c+h/2,y:u},bottom:{x:c+h/2,y:u+d},inside:{x:c+h/2,y:u+d/2}},p=ch(a.offset),g=p[a.dock];if(g)return{computedTooltipStyle:{left:"".concat(f[a.dock].x,"px"),top:"".concat(f[a.dock].y,"px"),transform:g},computedArrowStyle:hh(a.offset)[a.dock],dock:a.dock};const m={width:"target"===a.area?s.width:window.innerWidth,height:"target"===a.area?s.height:window.innerHeight},y=uh(r,o,a.offset),v=["top","left","right","bottom","inside"];for(let t=0;t<v.length;t+=1){const e=v[t];if(dh(m,"target"===a.area?f[e].x:s.left+f[e].x,"target"===a.area?f[e].y:s.top+f[e].y,r,o,y[e]))return{computedTooltipStyle:{left:"".concat(f[e].x,"px"),top:"".concat(f[e].y,"px"),transform:p[e]},computedArrowStyle:hh(a.offset)[e],dock:e}}const x=function(t){let e=t.options,n=t.docks,i=t.dockOffsets,r=t.targetBounds,o=t.area,a=t.width;const s="top",l="target"===e.area?n[s].x:r.left+n[s].x,c=("target"===e.area?n[s].y:(r.top,n[s].y),i[s]),u=l+c.x,h=(c.y,a);let d=n.top.x;return u<0&&u+h>o.width||(u<0?d-=u:u+h>o.width&&(d-=u+h-o.width)),d}({options:a,docks:f,dockOffsets:y,targetBounds:s,area:m,width:r});return{computedTooltipStyle:{left:"".concat(x,"px"),top:"".concat(f.top.y,"px"),transform:p.top},computedArrowStyle:hh(a.offset+x-f.top.x,a.offset).top,dock:"top"}},pointer:function(t){let e=t.options,n=t.pointer,i=t.width,r=t.height;return ph({x:n.x,y:n.y,pointer:n,width:i,height:r,options:e,dockOrder:["top","left","right","bottom"]})},slice:function(t){let e=t.options,n=t.pointer,i=t.width,r=t.height,o=t.nodes,a=t.resources;const s=o[0],l=n.dx,c=n.dy,u=a.getComponentBoundsFromNode(s),h=l+u.x+u.width/2,d=c+u.y+u.height/2,f=s.desc.slice,p=f.start,g=f.end,m=f.outerRadius,y=(p+g)/2-Math.PI/2,v=2*Math.PI,x=(y%v+v)%v;let b=["top","left","right","bottom"];return"auto"===e.dock&&(b=x<=Math.PI/4||x>=7*Math.PI/4?["right","top","bottom","left"]:x<=3*Math.PI/4?["bottom","left","right","top"]:x<=5*Math.PI/4?["left","top","bottom","right"]:["top","left","right","bottom"]),ph({x:h+m*u.scaleRatio.x*Math.cos(x),y:d+m*u.scaleRatio.y*Math.sin(x),pointer:n,width:i,height:r,options:e,dockOrder:b})}};function yh(t,e){let n=t.width,i=t.height,r=e.chart,o=e.state,a=e.props;const s={resources:{formatter:r.formatter,scale:r.scale,component:r.component,getComponentBoundsFromNode:t=>gh(t,o.pointer,r),getNodeBoundsRelativeToTarget:t=>function(t,e,n){const i=gh(t,e,n),r=t.bounds;return{x:i.x+e.dx+r.x,y:i.y+e.dy+r.y,width:r.width,height:r.height}}(t,o.pointer,r)},nodes:o.activeNodes,pointer:o.pointer,width:n,height:i},l=typeof a.placement;if("object"===l&&"function"==typeof a.placement.fn)return a.placement.fn(s);let c={type:"pointer",offset:8,dock:"auto",area:"viewport"};"function"===l&&(c=u(c,a.placement(s))),"object"===l&&mh[a.placement.type]?c=u(c,a.placement):"string"===l&&mh[a.placement]&&(c=u(c,{type:a.placement})),s.options=c;const h=mh[c.type](s);let d=s.resources.getComponentBoundsFromNode(s.nodes[0]),f=d.x,p=d.y,g=d.width,m=d.height;return f+=s.pointer.dx,g+=f,p+=s.pointer.dy,m+=p,h.computedTooltipStyle.left="".concat(Math.min(Math.max(0,f,parseFloat(h.computedTooltipStyle.left)),g),"px"),h.computedTooltipStyle.top="".concat(Math.min(Math.max(0,p,parseFloat(h.computedTooltipStyle.top)),m),"px"),h}let vh;function xh(){vh=null}const bh={duration:8e3,delay:500,filter:t=>t.filter(t=>t.data&&void 0!==t.data.value),extract:t=>t.node.data.value,content:t=>{let e=t.h;return t.data.map(t=>e("div",{},t))},isEqual:(t,e)=>t.length&&t.length===e.length&&t.every((t,n)=>e[n]&&JSON.stringify(t.data)===JSON.stringify(e[n].data)),placement:{type:"pointer",dock:"auto",offset:8,area:"viewport"},tooltipClass:{},contentClass:{},arrowClass:{},direction:"ltr",appendTo:void 0,beforeShow:void 0,afterShow:void 0,beforeHide:void 0,onHide:void 0,afterHide:void 0};const wh={require:["chart","renderer"],defaultSettings:{settings:bh,style:{tooltip:{},content:{backgroundColor:"$gray-25",color:"$font-color--inverted",fontFamily:"$font-family",fontSize:"$font-size",lineHeight:"$line-height",borderRadius:"4px",padding:"8px",opacity:.9},arrow:{position:"absolute",width:"0px",height:"0px",borderStyle:"solid",color:"$gray-25",opacity:.9},"arrow-bottom":{borderTopColor:"transparent",borderLeftColor:"transparent",borderRightColor:"transparent"},"arrow-top":{borderBottomColor:"transparent",borderLeftColor:"transparent",borderRightColor:"transparent"},"arrow-right":{borderTopColor:"transparent",borderLeftColor:"transparent",borderBottomColor:"transparent"},"arrow-left":{borderTopColor:"transparent",borderBottomColor:"transparent",borderRightColor:"transparent"}}},renderer:"dom",on:{hide(){this.hide()},show(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.show(t,e)},prevent(t){this.prevent(t)}},hide(){this.dispatcher.clear(),this.state.activeNodes=[],this.state.pointer={}},show(t){let e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.nodes,r=n.duration,o=n.delay;!this.state.prevent&&this.state.targetElement&&(this.state.pointer=function(t,e){let n=e.chart,i=e.state,r=0,o=0;t.center?(r+=t.center.x,o+=t.center.y):(r+=t.clientX,o+=t.clientY);const a=n.element.getBoundingClientRect(),s=i.targetElement.getBoundingClientRect(),l=r,c=o,u=a.left-s.left,h=a.top-s.top,d=r-a.left,f=o-a.top;return r-=s.left,o-=s.top,{x:r,y:o,dx:u,dy:h,cx:d,cy:f,clientX:l,clientY:c,targetBounds:s,chartBounds:a}}(t,this),e=Array.isArray(i)?this.props.filter(i):this.props.filter(this.chart.shapesAt({x:this.state.pointer.cx,y:this.state.pointer.cy})),this.props.isEqual(this.state.activeNodes,e)||(this.dispatcher.clear(),this.state.activeNodes=e,this.state.activeNodes.length&&this.dispatcher.invoke(()=>this.invokeRenderer(this.state.activeNodes),r,o)))},prevent(t){this.state.prevent=!!t},init(t){this.state={activeNodes:[],pointer:{},targetElement:null,prevent:!1},this.props=t.settings,this.dispatcher=lh({defaultDuration:this.props.duration,defaultDelay:this.props.delay});const e=this.dispatcher.clear;this.dispatcher.on("pending",()=>{!function(t){vh&&vh!==t&&vh()}(e),vh=e,"function"==typeof this.props.beforeShow&&this.props.beforeShow.call(void 0,{resources:{formatter:this.chart.formatter,scale:this.chart.scale}})}),this.dispatcher.on(["cancelled","fulfilled"],()=>{const t={resources:{formatter:this.chart.formatter,scale:this.chart.scale}};"function"==typeof this.props.beforeHide&&this.props.beforeHide.call(void 0,u({element:this.state.tooltipElm},t)),"function"==typeof this.props.onHide?this.props.onHide.call(void 0,u({element:this.state.tooltipElm},t)):this.renderer.clear([]),"function"==typeof this.props.afterHide&&this.props.afterHide.call(void 0,t),vh===e&&(vh=null),this.state.tooltipElm=void 0}),this.dispatcher.on("active",()=>{"function"==typeof this.props.afterShow&&this.props.afterShow.call(void 0,{element:this.state.tooltipElm,resources:{formatter:this.chart.formatter,scale:this.chart.scale}})})},created(){this.init(this.settings)},beforeUpdate(t){let e=t.settings;this.dispatcher&&(this.dispatcher.destroy(),xh()),this.init(e)},render(t){return this.h=t,[]},beforeDestroy(){this.dispatcher.destroy(),xh()},appendTo(){if(this.props.appendTo){this.state.targetElement="function"==typeof this.props.appendTo?this.props.appendTo({resources:{formatter:this.chart.formatter,scale:this.chart.scale}}):this.props.appendTo;const t=this.state.targetElement.getBoundingClientRect(),e=t.width,n=t.height;this.renderer.destroy(),this.renderer.size({width:e,height:n}),this.renderer.appendTo(this.state.targetElement)}else this.state.targetElement=this.renderer.element()},mounted(){this.appendTo()},updated(){this.appendTo()},invokeRenderer(t){const e=function(t,e){let n=e.chart,i=e.scale,r=e.props,o=e.h;const a={resources:{dataset:n.dataset,scale:n.scale,formatter:n.formatter},scale:i,h:o},s=[];return t.forEach(t=>{if("function"==typeof r.extract){const e=u({node:t},a);s.push(r.extract(e))}}),s}(t,this),n=yh(sh(e,{},this).getBoundingClientRect(),this);this.state.tooltipElm=sh(e,n,this)}};const kh={require:["renderer","chart"],defaultSettings:{settings:{target:"",selector:"*",fill:"rgba(0, 255, 0, 0.1)",stroke:"lime",opacity:1,useOuterRect:!1}},on:{update(){this.draw()}},draw(){const t=this.chart.findShapes(this.props.selector).filter(t=>t.key===this.props.target),e=t.filter(t=>t.collider).map(t=>t.collider);e.forEach(t=>{t.fill=this.props.fill,t.stroke=this.props.stroke,t.opacity=this.props.opacity,t.collider={type:null}}),this.renderer.render(e)},created(){this.props=this.settings.settings},resize(t){let e=t.outer,n=t.inner;return this.props.useOuterRect?e:n},render(){},mounted(){this.draw()},updated(){this.props=this.settings.settings,this.draw()}};var _h={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},Mh=/([astvzqmhlc])([^astvzqmhlc]*)/gi,Sh=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;function Rh(t){const e=[],n=String(t).trim();return"M"!==n[0]&&"m"!==n[0]||n.replace(Mh,(t,n,i)=>{const r=function(t){const e=t.match(Sh);return e?e.map(Number):[]}(i);let o=n.toLowerCase(),a=n;if("m"===o&&r.length>2&&(e.push([a,...r.splice(0,2)]),o="l",a="m"===a?"l":"L"),r.length<_h[o])return"";for(e.push([a,...r.splice(0,_h[o])]);r.length>=_h[o]&&r.length&&_h[o];)e.push([a,...r.splice(0,_h[o])]);return""}),e}const Ch=2*Math.PI;function Nh(t,e){return{x:.5*(t.x+e.x),y:.5*(t.y+e.y)}}function Dh(t,e,n,i,r){const o=1-t;return o**3*e+3*o**2*t*n+3*o*t**2*i+t**3*r}function qh(t,e,n,i){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:8;if(o<1||function(t,e,n,i){return Math.abs(t.x+n.x-(e.x+e.x))+Math.abs(t.y+n.y-(e.y+e.y))+Math.abs(e.x+i.x-(n.x+n.x))+Math.abs(e.y+i.y-(n.y+n.y))}(t,e,n,i)<=10)return r[r.length-1]!==t&&r.push(t),r.push(i),r;const a=Nh(t,e),s=Nh(e,n),l=Nh(n,i),c={x:Dh(.5,t.x,e.x,n.x,i.x),y:Dh(.5,t.y,e.y,n.y,i.y)},u=Nh(a,s),h=Nh(s,l);return qh(t,a,u,c,r,o-1),qh(c,h,l,i,r,o-1),r}function Eh(t,e,n){const i=function(t,e,n){return{cp1:{x:t.x+2/3*(e.x-t.x),y:t.y+2/3*(e.y-t.y)},cp2:{x:n.x+2/3*(e.x-n.x),y:n.y+2/3*(e.y-n.y)}}}(t,e,n);return qh(t,i.cp1,i.cp2,n)}function Oh(t,e,n){const i=[],r=!!t[4],o=!!t[5],a=t[3];let s,l,c,u,h=t[6],d=t[7],f=t[1],p=t[2];if("a"===t[0]&&(h+=e,d+=n),e===d&&n===d)return i;if(!f||!p)return i.push({x:h,y:d}),i;var g=function(t,e,n,i,r,o,a,s,l){let c,u,h,d,f,p;const g=Jo(n%360),m=Math.cos(g),y=Math.sin(g),v=(s-o)/2,x=(l-a)/2,b=m*v+y*x,w=m*x-y*v;p=b**2/(t=Math.abs(t))**2+w**2/(e=Math.abs(e))**2,p>1&&(p=Math.sqrt(p),t*=p,e*=p);const k=t*w,_=e*b,M=k**2+_**2,S=(t*e)**2-M;let R=Math.sqrt(Math.max(S/M,0));i===r&&(R=-R);const C=R*(k/e),N=R*(-_/t);d=m*C-y*N+(s+o)/2,f=y*C+m*N+(l+a)/2;const D=(b-C)/t,q=(w-N)/e,E=(-b-C)/t,O=(-w-N)/e;return c=Math.atan2(q,D),c+=c<0?Ch:0,u=Math.atan2(O,E),u+=u<0?Ch:0,h=u-c,!r&&c<u?h-=Ch:r&&u<c&&(h+=Ch),h%=Ch,{startAngle:c,sweepAngle:h,cx:d,cy:f,rx:t,ry:e}}(f,p,a,r,o,h,d,e,n);s=g.cx,l=g.cy,f=g.rx,p=g.ry,c=g.sweepAngle,u=g.startAngle;const m=Math.abs(c*Math.sqrt((f**2+p**2)/2)),y=Math.ceil(m/10),v=c/y;for(let t=1;t<=y;t++){const e=(u+v*t)%Ch,n=Math.cos(e),r=Math.sin(e);i.push({x:s+n*f+-r*n,y:l+r*p+n*r})}return i}function Ah(t){const e=Rh(t),n=[],i=[];let r=0,o=0,a=null,s=null,l=null,c=null;for(let t=0;t<e.length;++t){const u=e[t],h=u[0];switch("S"!==h&&"s"!==h&&"C"!==h&&"c"!==h&&(a=null,s=null),"T"!==h&&"t"!==h&&"Q"!==h&&"q"!==h&&(l=null,c=null),h){case"m":i.length&&n.push(i.splice(0));case"l":r+=u[1],o+=u[2],i.push({x:r,y:o});break;case"M":i.length&&n.push(i.splice(0));case"L":r=u[1],o=u[2],i.push({x:r,y:o});break;case"H":r=u[1],i.push({x:r,y:o});break;case"h":r+=u[1],i.push({x:r,y:o});break;case"V":o=u[1],i.push({x:r,y:o});break;case"v":o+=u[1],i.push({x:r,y:o});break;case"a":i.push(...Oh(u,r,o)),r+=u[6],o+=u[7];break;case"A":i.push(...Oh(u,r,o)),r=u[6],o=u[7];break;case"c":i.push(...qh({x:r,y:o},{x:u[1]+r,y:u[2]+o},{x:u[3]+r,y:u[4]+o},{x:u[5]+r,y:u[6]+o})),a=u[3]+r,s=u[4]+o,r+=u[5],o+=u[6];break;case"C":i.push(...qh({x:r,y:o},{x:u[1],y:u[2]},{x:u[3],y:u[4]},{x:u[5],y:u[6]})),a=u[3],s=u[4],r=u[5],o=u[6];break;case"s":null!==a&&null!==a||(a=r,s=o),i.push(...qh({x:r,y:o},{x:2*r-a,y:2*o-s},{x:u[1]+r,y:u[2]+o},{x:u[3]+r,y:u[4]+o})),a=u[1]+r,s=u[2]+o,r+=u[3],o+=u[4];break;case"S":null!==a&&null!==a||(a=r,s=o),i.push(...qh({x:r,y:o},{x:2*r-a,y:2*o-s},{x:u[1],y:u[2]},{x:u[3],y:u[4]})),a=u[1],s=u[2],r=u[3],o=u[4];break;case"Q":i.push(...Eh({x:r,y:o},{x:u[1],y:u[2]},{x:u[3],y:u[4]})),l=u[1],c=u[2],r=u[3],o=u[4];break;case"q":i.push(...Eh({x:r,y:o},{x:u[1]+r,y:u[2]+o},{x:u[3]+r,y:u[4]+o})),l=u[1]+r,c=u[2]+o,r+=u[3],o+=u[4];break;case"T":null!==l&&null!==l||(l=r,c=o),l=2*r-l,c=2*o-c,i.push(...Eh({x:r,y:o},{x:l,y:c},{x:u[1],y:u[2]})),r=u[1],o=u[2];break;case"t":null!==l&&null!==l||(l=r,c=o),l=2*r-l,c=2*o-c,i.push(...Eh({x:r,y:o},{x:l,y:c},{x:u[1]+r,y:u[2]+o})),r+=u[1],o+=u[2];break;case"z":case"Z":i.length&&i.push({x:i[0].x,y:i[0].y})}}return function(t){for(let e=0;e<t.length-1;e++){const n=t[e],i=t[e+1];Math.abs(n.x-i.x)<1e-12&&Math.abs(n.y-i.y)<1e-12&&(t.splice(e,1),e--)}}(i),n.push(i.splice(0)),n}const zh={require:["renderer","chart"],defaultSettings:{settings:{target:"",fill:"transparent",stroke:"lime",opacity:1,radius:2,useOuterRect:!1}},on:{update(){this.draw()}},draw(){const t=this.chart.findShapes("path").filter(t=>t.key===this.props.target),e=[];t.forEach(t=>{Ah(t.attrs.d).forEach(t=>{t.forEach(t=>{e.push({type:"circle",cx:t.x,cy:t.y,r:this.props.radius,fill:this.props.fill,stroke:this.props.stroke,opacity:this.props.opacity,collider:{type:null}})})})}),this.renderer.render(e)},created(){this.props=this.settings.settings},resize(t){let e=t.outer,n=t.inner;return this.props.useOuterRect?e:n},render(){},mounted(){this.draw()},updated(){this.props=this.settings.settings,this.draw()}};var Th=[function(t){t.component("box",Is),t.component("box-marker",Is)},function(t){t.component("point",Ws),t.component("point-marker",Ws)},function(t){t.component("pie",Ks)},function(t){t.component("grid-line",Qs)},function(t){t.component("ref-line",ul)},function(t){t.component("axis",Fl)},function(t){t.component("container",Ll)},function(t){t.component("text",Hl)},function(t){t.component("scrollbar",Ul)},function(t){t.component("brush-range",sc),t.component("brush-area-dir",hc)},function(t){t.component("range",gc)},function(t){t.component("brush-lasso",wc)},function(t){t.component("labels",Au)},function(t){t.component("legend-cat",Uu)},function(t){t.component("legend-seq",Zu)},function(t){t.component("line",nh)},function(t){t.component("brush-area",ah)},function(t){t.component("tooltip",wh)},function(t){t.component("debug-collider",kh)},function(t){t.component("debug-path-to-points",zh)}];let Ih=class{constructor(t){this._parent=null,this._children=[],this._ancestors=null,this.type=t,this.data=null}detach(){return this._parent&&this._parent.removeChild(this),this}get parent(){return this._parent}get isBranch(){return this._children&&this._children.length}get children(){return this._children}get ancestors(){return this._ancestors||(this._ancestors=[],this.parent&&this._ancestors.push(this.parent,...this.parent.ancestors)),this._ancestors}get descendants(){let t=[];const e=this.children.length;let n,i;for(n=0;n<e;n++)i=this.children[n],t.push(i),i.children.length&&(t=[...t,...i.descendants]);return t}equals(t){const e=this.children,n=t.children;if(e.length!==n.length)return!1;for(let t=0;t<e.length;t++)if(!e[t].equals(n[t]))return!1;return!0}toJSON(){return{type:this.type,children:this.children.map(t=>t.toJSON())}}};class jh{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.x,n=void 0===e?0:e,i=t.y,r=void 0===i?0:i,o=t.width,a=void 0===o?0:o,s=t.height,l=void 0===s?0:s,c=t.minWidth,u=void 0===c?0:c,h=t.minHeight,d=void 0===h?0:h;this.set({x:n,y:r,width:a,height:l,minWidth:u,minHeight:d})}set(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.x,n=void 0===e?0:e,i=t.y,r=void 0===i?0:i,o=t.width,a=void 0===o?0:o,s=t.height,l=void 0===s?0:s,c=t.minWidth,u=void 0===c?0:c,h=t.minHeight,d=void 0===h?0:h;this.type="rect",a>=0?(this.x=n,this.width=Math.max(a,u)):(this.x=n+Math.min(a,-u),this.width=-Math.min(a,-u)),l>=0?(this.y=r,this.height=Math.max(l,d)):(this.y=r+Math.min(l,-d),this.height=-Math.min(l,-d))}containsPoint(t){return Ia(this,t)}intersectsLine(t){return ja(this,M(t))}intersectsRect(t){return za(this,_(t))}intersectsCircle(t){return Na(t,this)}intersectsPolygon(t){return Aa(t,this)}intersectsGeoPolygon(t){return Va(t,this)}points(){return[{x:this.x,y:this.y},{x:this.x+this.width,y:this.y},{x:this.x+this.width,y:this.y+this.height},{x:this.x,y:this.y+this.height}]}}class Ph{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.cx,n=void 0===e?0:e,i=t.cy,r=void 0===i?0:i,o=t.r,a=void 0===o?0:o,s=t.minRadius,l=void 0===s?0:s;this.set({cx:n,cy:r,r:a,minRadius:l})}set(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.cx,n=void 0===e?0:e,i=t.cy,r=void 0===i?0:i,o=t.r,a=void 0===o?0:o,s=t.minRadius,l=void 0===s?0:s;this.type="circle",this.cx=n,this.cy=r,this.r=Math.max(a,l),this.vector={x:this.cx,y:this.cy}}containsPoint(t){return Ca(this,t)}intersectsLine(t){return Da(this,M(t))}intersectsRect(t){return Na(this,_(t))}intersectsCircle(t){return n=t,!_a(e=this)&&!_a(n)&&(e.cx-n.cx)**2+(e.cy-n.cy)**2<=(e.r+n.r)**2;var e,n}intersectsPolygon(t){return qa(this,t)}intersectsGeoPolygon(t){return Ba(this,t)}points(){return[{x:this.cx,y:this.cy}]}}class Fh{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.x1,n=void 0===e?0:e,i=t.y1,r=void 0===i?0:i,o=t.x2,a=void 0===o?0:o,s=t.y2,l=void 0===s?0:s,c=t.tolerance,u=void 0===c?0:c;this.set({x1:n,y1:r,x2:a,y2:l,tolerance:u})}set(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.x1,n=void 0===e?0:e,i=t.y1,r=void 0===i?0:i,o=t.x2,a=void 0===o?0:o,s=t.y2,l=void 0===s?0:s,c=t.tolerance,u=void 0===c?0:c;this.type="line",this.x1=n,this.y1=r,this.x2=a,this.y2=l,this.tolerance=Math.max(0,Math.round(u)),this.vectors=this.points(),this.zeroSize=n===a&&r===l}containsPoint(t){if(this.tolerance>0){return Da({cx:t.x,cy:t.y,r:this.tolerance},this)}return Fa(this,t)}intersectsLine(t){return Pa(this,M(t))}intersectsRect(t){return ja(_(t),this)}intersectsCircle(t){return Da(t,this)}intersectsPolygon(t){return Oa(t,this)}intersectsGeoPolygon(t){return Wa(t,this)}points(){return[{x:this.x1,y:this.y1},{x:this.x2,y:this.y2}]}}class Lh{constructor(){let t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).vertices,e=void 0===t?[]:t;this.set({vertices:e})}set(){let t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).vertices,e=void 0===t?[]:t;if(this.type="polygon",this.vertices=e.slice(),this.edges=[],function(t){for(let e=0;e<t.length-1;e++){const n=t[e],i=t[e+1];n.x===i.x&&n.y===i.y&&(t.splice(e,1),e--)}}(this.vertices),!(this.vertices.length<=2)){!function(t){const e=t[0],n=t[t.length-1];e.x===n.x&&e.y===n.y||t.push(e)}(this.vertices),this.xMin=NaN,this.yMin=NaN,this.xMax=NaN,this.yMax=NaN;for(let t=0;t<this.vertices.length;t++)t<this.vertices.length-1&&this.edges.push([this.vertices[t],this.vertices[t+1]]),this.xMin=isNaN(this.xMin)?this.vertices[t].x:Math.min(this.xMin,this.vertices[t].x),this.xMax=isNaN(this.xMax)?this.vertices[t].x:Math.max(this.xMax,this.vertices[t].x),this.yMin=isNaN(this.yMin)?this.vertices[t].y:Math.min(this.yMin,this.vertices[t].y),this.yMax=isNaN(this.yMax)?this.vertices[t].y:Math.max(this.yMax,this.vertices[t].y);this._bounds=null,this._boundingRect=null}}containsPoint(t){return Ea(this,t)}intersectsCircle(t){return qa(t,this)}intersectsLine(t){return Oa(this,M(t))}intersectsRect(t){return Aa(this,_(t))}intersectsPolygon(t){return La(this,t)}intersectsGeoPolygon(t){return $a(t,this)}points(){return this.vertices}bounds(){return this._bounds||(this._bounds=[{x:this.xMin,y:this.yMin},{x:this.xMax,y:this.yMin},{x:this.xMax,y:this.yMax},{x:this.xMin,y:this.yMax}]),this._bounds}boundingRect(){return this._boundingRect||(this._boundingRect={x:this.xMin,y:this.yMin,width:this.xMax-this.xMin,height:this.yMax-this.yMin}),this._boundingRect}}function $h(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return new Lh(...e)}function Bh(t){const e=t[0],n=t[t.length-1];e.x===n.x&&e.y===n.y||t.push(e)}function Hh(t){for(let e=0;e<t.length-1;e++){const n=t[e],i=t[e+1];n.x===i.x&&n.y===i.y&&(t.splice(e,1),e--)}}class Wh{constructor(){let t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).vertices,e=void 0===t?[[]]:t;this.set({vertices:e})}set(){let t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).vertices,e=void 0===t?[]:t;this.type="geopolygon",this.vertices=e.slice(),this.numPolygons=this.vertices.length,this.polygons=[],this.xMin=NaN,this.yMin=NaN,this.xMax=NaN,this.yMax=NaN;for(let t=0;t<this.numPolygons;t++)Hh(this.vertices[t]),this.vertices[t].length>2&&Bh(this.vertices[t]),this.polygons[t]=$h({vertices:this.vertices[t]}),this.xMin=isNaN(this.xMin)?this.polygons[t].xMin:Math.min(this.xMin,this.polygons[t].xMin),this.xMax=isNaN(this.xMax)?this.polygons[t].xMax:Math.max(this.xMax,this.polygons[t].xMax),this.yMin=isNaN(this.yMin)?this.polygons[t].yMin:Math.min(this.yMin,this.polygons[t].yMin),this.yMax=isNaN(this.yMax)?this.polygons[t].yMax:Math.max(this.yMax,this.polygons[t].yMax);this._bounds=null,this._boundingRect=null}containsPoint(t){return Ha(this,t)}intersectsCircle(t){return Ba(t,this)}intersectsLine(t){return Wa(this,M(t))}intersectsRect(t){return Va(this,_(t))}intersectsPolygon(t){return $a(this,t)}intersectsGeoPolygon(t){return function(t,e){const n=t.boundingRect(),i=e.boundingRect();return!!za(n,i)&&(Ta(i,n)?Ra(e,t):Ra(t,e))}(this,t)}points(){return this.vertices}bounds(){return this._bounds||(this._bounds=[{x:this.xMin,y:this.yMin},{x:this.xMax,y:this.yMin},{x:this.xMax,y:this.yMax},{x:this.xMin,y:this.yMax}]),this._bounds}boundingRect(){return this._boundingRect||(this._boundingRect={x:this.xMin,y:this.yMin,width:this.xMax-this.xMin,height:this.yMax-this.yMin}),this._boundingRect}}function Vh(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return new Wh(...e)}function Uh(t,e){return t.x!==e.x||t.y!==e.y}class Yh{constructor(){let t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).points,e=void 0===t?[]:t;this.set({points:e})}set(){let t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).points,e=void 0===t?[]:t;if(this.type="polyline",this.segments=[],this._points=e.slice(),this._points.length>1)for(let t=0,e=this._points.length-1;t<e;t++)Uh(this._points[t],this._points[t+1])&&this.segments.push({x1:this._points[t].x,y1:this._points[t].y,x2:this._points[t+1].x,y2:this._points[t+1].y})}containsPoint(t){return this.segments.some(e=>Fa(e,t))}intersectsCircle(t){return this.segments.some(e=>Da(t,e))}intersectsLine(t){const e=M(t);return this.segments.some(t=>Pa(t,e))}intersectsRect(t){const e=_(t);return this.segments.some(t=>ja(e,t))}intersectsPolygon(t){return this.segments.some(e=>Oa(t,e))}intersectsGeoPolygon(t){return this.segments.some(e=>Wa(t,e))}points(){return this._points}}const Kh=Et();function Gh(t,e){return Kh.get(t)(e)}Kh.add("rect",function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return new jh(...e)}),Kh.add("circle",function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return new Ph(...e)}),Kh.add("line",function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return new Fh(...e)}),Kh.add("polygon",$h),Kh.add("geopolygon",Vh),Kh.add("polyline",function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return new Yh(...e)});class Xh{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.set(t)}set(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.geometries=[],t.forEach(t=>{const e=Gh(t.type,t);e&&this.geometries.push(e)})}containsPoint(t){return this.geometries.some(e=>e.containsPoint(t))}intersectsLine(t){return this.geometries.some(e=>e.intersectsLine(t))}intersectsRect(t){return this.geometries.some(e=>e.intersectsRect(t))}intersectsCircle(t){return this.geometries.some(e=>e.intersectsCircle(t))}intersectsPolygon(t){return this.geometries.some(e=>e.intersectsPolygon(t))}intersectsGeoPolygon(t){return this.geometries.some(e=>e.intersectsGeoPolygon(t))}}class Jh{constructor(){this._elements=[[1,0,0],[0,1,0],[0,0,1]],this._stack=[]}clone(){return(new Jh).multiply(this)}set(t){return this._elements=t,this}save(){return this._stack.push(this.elements),this}restore(){return this._stack.length&&(this._elements=this._stack.pop()),this}add(t){let e,n;for(e=0;e<this._elements.length;e++)for(n=0;n<this._elements[e].length;n++)this._elements[e][n]+=t;return this}translate(t,e){return this.multiply([[1,0,t],[0,1,e],[0,0,1]]),this}rotate(t){let e=Math.cos(-t),n=Math.sin(-t);return this.multiply([[e,n,0],[-n,e,0],[0,0,1]]),this}multiply(t){let e,n,i,r;if(t instanceof Jh&&(t=t._elements),Array.isArray(t)){for(i=[[0,0,0],[0,0,0],[0,0,0]],e=0;e<this._elements.length;e++)for(n=0;n<this._elements[e].length;n++)for(r=0;r<3;r++)i[e][n]+=this._elements[e][r]*t[r][n];this._elements=i}else for(e=0;e<this._elements.length;e++)for(n=0;n<this._elements[e].length;n++)this._elements[e][n]*=t;return this}scale(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;return this.multiply([[t,0,0],[0,e,0],[0,0,1]]),this}transform(t,e,n,i,r,o){return this.multiply([[t,n,r],[e,i,o],[0,0,1]]),this}determinant(){let t=this._elements[0][0],e=this._elements[0][1],n=this._elements[0][2],i=this._elements[1][0],r=this._elements[1][1],o=this._elements[1][2],a=this._elements[2][0],s=this._elements[2][1],l=this._elements[2][2],c=0;return c=t*r*l+e*o*a+n*i*s-n*r*a-e*i*l-t*o*s,c}invert(){let t=this.determinant(),e=this._elements[0][0],n=this._elements[0][1],i=this._elements[0][2],r=this._elements[1][0],o=this._elements[1][1],a=this._elements[1][2],s=this._elements[2][0],l=this._elements[2][1],c=this._elements[2][2];return this._elements=[[o*c-a*l,i*l-n*c,n*a-i*o],[a*s-r*c,e*c-i*s,i*r-e*a],[r*l-o*s,s*n-e*l,e*o-n*r]],this.multiply(1/t),this}transpose(){const t=Object.create(this._elements);return this._elements=[[t[0][0],t[1][0],t[2][0]],[t[0][1],t[1][1],t[2][1]],[t[0][2],t[1][2],t[2][2]]],this}identity(){return this._elements=[[1,0,0],[0,1,0],[0,0,1]],this}toString(){return"".concat(this._elements.map(t=>t.join("\t")).join("\n"))}isIdentity(){const t=this._elements;return 1===t[0][0]&&0===t[0][1]&&0===t[0][2]&&0===t[1][0]&&1===t[1][1]&&0===t[1][2]&&0===t[2][0]&&0===t[2][1]&&1===t[2][2]}transformPoint(t){let e,n,i=[t.x,t.y,1],r=this._elements,o=[0,0,0];for(e=0;e<this._elements.length;e++)for(n=0;n<this._elements[e].length;n++)o[e]+=i[n]*r[e][n];return{x:o[0],y:o[1]}}transformPoints(t){let e,n,i,r,o,a=this._elements,s=[];for(r=0;r<t.length;r++){for(e=[t[r].x,t[r].y,1],o=[0,0,0],n=0;n<this._elements.length;n++)for(i=0;i<this._elements[n].length;i++)o[n]+=e[i]*a[n][i];s.push({x:o[0],y:o[1]})}return s}get elements(){const t=this._elements;return[[t[0][0],t[0][1],t[0][2]],[t[1][0],t[1][1],t[1][2]],[t[2][0],t[2][1],t[2][2]]]}}const Zh=/(translate|scale|rotate|matrix)\(([0-9,.eE+-\s]+)(?:,|\s?)+\)/g;function Qh(t,e){const n=e.args[0]*(Math.PI/180);if(e.args.length>2){const i=e.args[1],r=e.args[2];t.translate(i,r),t.rotate(n),t.translate(-i,-r)}else 1===e.args.length&&t.rotate(n)}function td(t,e){const n=e.args[0],i=isNaN(e.args[1])?e.args[0]:e.args[1];t.scale(n,i)}function ed(t,e){const n=e.args[0],i=isNaN(e.args[1])?0:e.args[1];t.translate(n,i)}function nd(t,e){e.args.length>=6&&t.transform(...e.args)}function id(t,e){const n=function(t){let e,n=[];for(;null!==(e=Zh.exec(t));){const t=e[2].trim(),i=-1===t.indexOf(",")?t.split(" "):t.split(",");n.push({cmd:e[1],args:i.filter(t=>t.trim().length>0).map(t=>Number(t))})}return n}(t);let i;for(let t=0,r=n.length;t<r;t++)i=n[t],"rotate"===i.cmd?Qh(e,i):"scale"===i.cmd?td(e,i):"matrix"===i.cmd?nd(e,i):"translate"===i.cmd&&ed(e,i)}const rd={type:/^\w[\w-]+/,attr:/^\[\w(?:[\w\._-]+)?(?:[!]?=['\"][\w\s*#_-]*['\"])?\]/,universal:/^(\*)/,tag:/^\.(\w+)/},od={type:(t,e)=>e.filter(e=>{const n=e.type;return!!n&&n.toLowerCase()===t.toLowerCase()}),attr:(t,e,n,i)=>i.filter(i=>{const r=i.attrs[t];if(!e)return void 0!==r;if(void 0===r)return!1;switch(e){case"=":return n===String(r);case"!=":return n!==String(r);default:return!1}}),universal:t=>t,tag:(t,e)=>e.filter(e=>{const n=e.tag;return!!n&&-1!==n.trim().split(/\s+/).indexOf(t.replace(".",""))})};function ad(t,e){if(!e||!e.length||!t||"function"!=typeof od[t.type])return[];switch(t.type){case"type":case"tag":return od[t.type](t.value,e);case"attr":return od[t.type](t.attribute,t.operator,t.attributeValue,e);case"universal":return od[t.type](e);default:return[]}}var sd={find:function(t,e){const n=[],i=[];let r,o;if(e.isBranch){let a;r=function(t){const e=[];let n,i,r,o;return t.split(/\s*,\s*/).forEach(t=>{t=t.trim(),n=[];const a=e=>{r=t.match(rd[e]),r&&(o=!0,t=t.slice(r[0].length),i={type:e,value:r[0]},"attr"===e&&(r=r[0].match(/\[(\w[\w\._-]+)?(?:([!]?=)['\"]([\w\s#_-]*)['\"])?\]/),i.attribute=r[1],i.operator=r[2],i.attributeValue=r[3]),n.push(i))};for(;t&&(o=!1,r=t.match(/^\s*([>+~]|\s)\s*/),r&&(o=!0,n.push({type:" ",value:r[0]}),t=t.slice(r[0].length)),Object.keys(rd).forEach(a),n&&n.length&&e.indexOf(n)<0&&e.push(n),o););}),e}(t),o=e.descendants;for(let t=0,e=r.length;t<e;t++){a=r[t];const e=[];let n=o.slice(),s=!1;a.reverse().forEach(t=>{if(" "===t.type)return e.push(n),n=o.slice(),void(s=!1);n=ad(t,n),s=!0}),s&&e.push(n);const l=e[0].filter(t=>{let n,i=t.parent;for(let t=1;t<e.length;t++){for(n=e[t].indexOf(i);i&&n<0;)i=i.parent,n=e[t].indexOf(i);if(n<0)return!1}return!0});i.push(l)}for(let t=0,e=i.length;t<e;t++)for(let e=0,r=i[t].length;e<r;e++)n.indexOf(i[t][e])<0&&n.push(i[t][e])}return n||[]}};function ld(t,e,n){const i=t.type;let r=t.points();n&&(r=r.every(t=>Array.isArray(t))?r.map(t=>n.transformPoints(t)):n.transformPoints(r)),function(t,e){for(let n=0,i=t.length;n<i;n++)t[n].x/=e,t[n].y/=e}(r,e);let o=null;if("rect"===i||"bounds"===i)o=_(r),o.type=i;else if("circle"===i)o=function(t,e){return{cx:t[0].x,cy:t[0].y,r:e}}(r,t.r),o.type=i;else if("line"===i)o=M(r),o.type=i;else if("polygon"===i||"polyline"===i){o={type:"path",d:Go(r,"polygon"===i)}}else if("geopolygon"===i){let t="";for(let e=0;e<r.length;e++)t+=Go(r[e],!0);o={type:"path",d:t}}return o}class cd{constructor(t){this._bounds=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const n=t.boundingRect?t.boundingRect(e):{x:0,y:0,width:0,height:0};return{x:n.x,y:n.y,width:n.width,height:n.height}},this._attrs=t.attrs,this._type=t.type,this._data=t.data,this._dpi=t.stage?t.stage.dpi:1,this._collider=()=>function(t,e){if(t.collider){const n=t.modelViewMatrix;return"collection"===t.colliderType?{type:"container",children:t.collider.geometries.map(t=>ld(t,e,n))}:ld(t.collider,e,n)}return null}(t,this._dpi),this._desc=t.desc,this._tag=t.tag,this._children=()=>t.children.map(t=>new cd(t)),this._parent=()=>t.parent?new cd(t.parent):null,this._cache={elementBoundingRect:null},this._getElementBoundingRect=()=>(!this._cache.elementBoundingRect&&this.element&&(this._cache.elementBoundingRect=this.element.getBoundingClientRect()),this._cache.elementBoundingRect||{left:0,top:0})}get children(){return this._children()}get parent(){return this._parent()}get type(){return this._type}get data(){return this._data}get attrs(){return this._attrs}set element(t){this._cache.elementBoundingRect=null,this._element=t}get element(){return this._element}set key(t){this._key=t}get key(){return this._key}get bounds(){const t=this._bounds();return t.x/=this._dpi,t.y/=this._dpi,t.width/=this._dpi,t.height/=this._dpi,t}get localBounds(){return this._bounds(!1)}boundsRelativeTo(t){const e=typeof t,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1]?this.bounds:this.localBounds,i=this._getElementBoundingRect();let r=i.left,o=i.top;if("object"===e&&null!==t&&"function"==typeof t.getBoundingClientRect){const e=t.getBoundingClientRect(),n=e.left,i=void 0===n?0:n,a=e.top;r-=i,o-=void 0===a?0:a}return n.x+=r,n.y+=o,n}get collider(){return this._collider()}get desc(){return this._desc}get tag(){return this._tag}}function ud(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return new cd(...e)}class hd{constructor(t){this._node=ud(t),this._parent=null,this._input=null}get node(){return this._node}set parent(t){this._parent=t}get parent(){return this._parent}set input(t){this._input=t}get input(){return this._input}}function dd(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return new hd(...e)}function fd(t,e){const n=t.parent;if(n&&"stage"!==n.type){e.parent=dd(n);const t=n.parent;t&&"stage"!==t.type&&fd(t,e.parent)}}function pd(t,e,n){if(null===t.colliderType)return null;const i=function(t,e){let n={};if(t.modelViewMatrix)if(Array.isArray(e))n=t.inverseModelViewMatrix.transformPoints(e);else if(isNaN(e.r))Array.isArray(e.vertices)?n.vertices=t.inverseModelViewMatrix.transformPoints(e.vertices):n=t.inverseModelViewMatrix.transformPoint(e);else{const r={x:e.cx,y:e.cy};var i=t.inverseModelViewMatrix.transformPoint(r);n.cx=i.x,n.cy=i.y,n.r=e.r}else n=e;return Array.isArray(n.vertices)&&(n=n.vertices.every(t=>Array.isArray(t))?Vh(n):$h(n)),n}(t,n);return"frontChild"===t.colliderType?function(t,e,n){for(let i=t.descendants.length-1;i>=0;i--){const r=t.descendants[i];if(null!==r.collider&&r.collider[e](n)){const t=dd(r);return fd(r,t),t}}return null}(t,e,i):function(t,e,n){if(t.collider[e](n)){const e=dd(t);return fd(t,e),e}return null}(t,e,i)}function gd(t,e,n,i){const r=t.length;for(let o=0;o<r;o++){const r=t[o],a=pd(r,e,i);a&&n.push(a),!r.children||a||r.collider||gd(r.children,e,n,i)}}function md(t,e,n){const i=t.length;for(let r=0;r<i;r++){const i=t[r];if(null!==pd(i,e,n))return!0;if(i.children&&!i.collider)return md(i.children,e,n)}return!1}function yd(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;let n={};switch(S(t)){case"circle":return n.cx=t.cx*e,n.cy=t.cy*e,n.r=t.r,["intersectsCircle",n];case"rect":return n=k(t).map(t=>ea(t,e)),["intersectsRect",n];case"line":return n=w(t).map(t=>ea(t,e)),["intersectsLine",n];case"point":return n=ea(t,e),["containsPoint",n];case"polygon":return n.vertices=t.vertices.map(t=>ea(t,e)),["intersectsPolygon",n];case"geopolygon":return n.vertices=t.vertices.map(t=>t.map(t=>ea(t,e))),["intersectsGeoPolygon",n];default:return[]}}function vd(t,e){const n=m(yd(e,t.dpi),2),i=n[0],r=n[1],o=[];return i&&(gd([t],i,o,r),function(t,e){for(let n=0,i=e.length;n<i;n++)e[n].input=t}(e,o)),o}function xd(t,e){const n=m(yd(e,t.dpi),2);return md([t],n[0],n[1])}class bd extends Ih{constructor(t){super(t),this._stage=null,this._collider={type:null,definition:null,fn:null},this._attrs={},this._node=null}set(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.node=t;const e=t.data,n=t.desc,i=t.tag,r=t.strokeReference,o=t.fillReference;var a,s;a=this.attrs,s=t,Object.keys(Ko).forEach(t=>{const e=s[t];void 0!==e&&(a[Ko[t]]=e)}),void 0!==e&&(this.data=e),"object"==typeof n&&(this.desc=u(!0,{},n)),"string"==typeof i&&(this.tag=i),"string"==typeof r&&(this.strokeReference=r),"string"==typeof o&&(this.fillReference=o)}findShapes(t){return sd.find(t,this).map(t=>ud(t))}getItemsFrom(t){return vd(this,t)}containsPoint(t){return xd(this,t)}intersectsLine(t){return xd(this,t)}intersectsRect(t){return xd(this,t)}intersectsCircle(t){return xd(this,t)}intersectsPolygon(t){return xd(this,t)}intersectsGeoPolygon(t){return xd(this,t)}resolveLocalTransform(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Jh;void 0!==this.attrs.transform&&id(this.attrs.transform,t),this.modelViewMatrix=t.clone()}resolveGlobalTransform(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Jh;const e=this.ancestors;if(e.length>0)for(let n=e.length-1;n>=0;n--)e[n].resolveLocalTransform(t),t=e[n].modelViewMatrix;this.resolveLocalTransform(t)}attr(t){return this.attrs[t]}equals(t){const e=this.attrs,n=Object.keys(e),i=t.attrs,r=Object.keys(i);if(n.length!==r.length)return!1;for(let t=0;t<n.length;t++){const r=n[t];if(!Object.hasOwnProperty.call(i,r))return!1;if(e[r]!==i[r])return!1}return super.equals(t)}toJSON(){const t=super.toJSON();return t.attrs=this.attrs,t}get attrs(){return this._attrs}get stage(){return this._parent&&!this._stage?this._stage=this._parent.stage:this._parent||this._stage===this||(this._stage=null),this._stage}set modelViewMatrix(t){this._mvm=t,this._imvm=null}get modelViewMatrix(){return this._mvm}get inverseModelViewMatrix(){return this._imvm=this._imvm?this._imvm:this._mvm.clone().invert(),this._imvm}set node(t){this._node=t}get node(){return this._node}set collider(t){const e=Array.isArray(t)?"collection":t&&t.type;return"string"!=typeof e?(this._collider.type=null,this._collider.definition=null,void(this._collider.fn=null)):null!==this._collider&&this._collider.type===e&&null!==this._collider.fn?(this._collider.fn.set(t),void(this._collider.definition=t)):(this._collider.type=e,void(this._collider.definition=t))}get collider(){if(null!==this._collider.fn)return this._collider.fn;switch(this._collider.type){case"collection":this._collider.fn=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return new Xh(...e)}(this._collider.definition);break;case"frontChild":return!0;case"bounds":this._collider.fn=Gh("rect",this.boundingRect());break;case"line":case"rect":case"circle":case"polygon":case"geopolygon":case"polyline":this._collider.fn=Gh(this._collider.type,this._collider.definition);break;default:return null}return this._collider.fn}get colliderType(){return this._collider.type}}class wd extends Ih{addChild(t){if(!(t&&t instanceof Ih))throw new TypeError("Expecting a Node as argument, but got ".concat(t));if(t===this)throw new Error("Can not add itself as child!");if(t._children&&t._children.length&&this.ancestors.indexOf(t)>=0)throw new Error("Can not add an ancestor as child!");return t._parent&&t._parent!==this&&t._parent.removeChild(t),this._children.push(t),t._parent=this,t._ancestors=null,this}addChildren(t){let e,n=t?t.length:0;for(e=0;e<n;e++)this.addChild(t[e]);return this}removeChild(t){const e=this._children.indexOf(t);return e>=0&&(this._children.splice(e,1),t._parent=null,t._ancestors=null),this}removeChildren(t){let e,n;if(!this._children)return this;if(t)for(n=t.length,e=0;e<n;e++)this.removeChild(t[e]);else for(;this._children.length;)this.removeChild(this._children[0]);return this}}const kd=wd.prototype;class _d extends bd{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=t.type;super(void 0===e?"container":e),this.set(t)}set(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super.set(t);const e=t.collider,n=u({type:null},e);this.collider=n,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}appendChildRect(t,e){if(void 0!==t.bounds){const n=this.__boundingRect[e]||{},i=m(t.bounds(e),3),r=i[0],o=i[2],a=r.x,s=r.y,l=o.x,c=o.y,u=isNaN(n.width)?l:Math.max(l,n.width+n.x),h=isNaN(n.height)?c:Math.max(c,n.height+n.y);n.x=isNaN(n.x)?a:Math.min(a,n.x),n.y=isNaN(n.y)?s:Math.min(s,n.y),n.width=u-n.x,n.height=h-n.y,this.__boundingRect[e]=n}}boundingRect(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[t])return this.__boundingRect[t];const e=this.children.length;for(let n=0;n<e;n++)this.appendChildRect(this.children[n],t);return this.__boundingRect[t]=u({x:0,y:0,width:0,height:0},this.__boundingRect[t]),this.__boundingRect[t]}bounds(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[t])return this.__bounds[t];const e=this.boundingRect(t);return this.__bounds[t]=[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}],this.__bounds[t]}addChild(t){const e=kd.addChild.call(this,t);if(this._collider&&"bounds"===this._collider.type){this.appendChildRect(t,!0);const e=u({type:"bounds",x:0,y:0,width:0,height:0},this.__boundingRect.true);this.collider=e}return e}addChildren(t){const e=kd.addChildren.call(this,t),n=t.length;if(this._collider&&"bounds"===this._collider.type&&n>0){for(let e=0;e<n;e++)this.appendChildRect(t[e],!0);const e=u({type:"bounds",x:0,y:0,width:0,height:0},this.__boundingRect.true);this.collider=e}return e}removeChild(t){t._stage=null;let e,n=t.descendants,i=n?n.length:0;for(e=0;e<i;e++)n[e]._stage=null;if(kd.removeChild.call(this,t),this._collider&&"bounds"===this._collider.type){this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null};const t=u(this.boundingRect(!0),{type:"bounds"});this.collider=t}return this}removeChildren(t){if(kd.removeChildren.call(this,t),this._collider&&"bounds"===this._collider.type){this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null};const t=u(this.boundingRect(!0),{type:"bounds"});this.collider=t}return this}}function Md(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return new _d(...e)}class Sd extends _d{constructor(t){super("stage"),this._stage=this,this._dpiRatio=t||1}get dpi(){return this._dpiRatio}}const Rd=wd.prototype,Cd=["x1","x2","y1","y2","id","offset","style"];class Nd extends bd{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=t.type;super(void 0===e?"container":e),this.set(t),this._boundingRect={}}set(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super.set(t);const e=this.attrs;let n="";for(let i=0,r=Cd.length;i!==r;i++)n=Cd[i],void 0!==t[n]&&(e[n]=t[n])}addChild(t){return Rd.addChild.call(this,t)}addChildren(t){return Rd.addChildren.call(this,t)}removeChild(t){t._stage=null;let e,n=t.descendants,i=n?n.length:0;for(e=0;e<i;e++)n[e]._stage=null;return Rd.removeChild.call(this,t),this}removeChildren(t){return Rd.removeChildren.call(this,t),this}}function Dd(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return new Nd(...e)}const qd=wd.prototype,Ed=["patternUnits","x","y","width","height","id"];class Od extends bd{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=t.type;super(void 0===e?"container":e),this.set(t),this._boundingRect={}}set(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super.set(t);const e=this.attrs;let n="";for(let i=0,r=Ed.length;i!==r;i++)n=Ed[i],void 0!==t[n]&&(e[n]=t[n])}addChild(t){return qd.addChild.call(this,t)}addChildren(t){return qd.addChildren.call(this,t)}removeChild(t){t._stage=null;let e,n=t.descendants,i=n?n.length:0;for(e=0;e<i;e++)n[e]._stage=null;return qd.removeChild.call(this,t),this}removeChildren(t){return qd.removeChildren.call(this,t),this}}class Ad extends bd{constructor(){super("rect"),this.set(...arguments)}set(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=t.x,n=void 0===e?0:e,i=t.y,r=void 0===i?0:i,o=t.width,a=void 0===o?0:o,s=t.height,l=void 0===s?0:s,c=t.rx,h=void 0===c?0:c,d=t.ry,f=void 0===d?0:d,p=t.collider,g=u({type:"rect",x:n,y:r,width:a,height:l},p);super.set(t),a>=0?(this.attrs.x=n,this.attrs.width=a):(this.attrs.x=n+a,this.attrs.width=-a),l>=0?(this.attrs.y=r,this.attrs.height=l):(this.attrs.y=r+l,this.attrs.height=-l),h>0&&(this.attrs.rx=h),f>0&&(this.attrs.ry=f),this.collider=g,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[t])return this.__boundingRect[t];const e=k(this.attrs),n=m(b(t&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(e):e),4),i=n[0],r=n[1],o=n[2],a=n[3];return this.__boundingRect[t]={x:i,y:r,width:o-i,height:a-r},this.__boundingRect[t]}bounds(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[t])return this.__bounds[t];const e=this.boundingRect(t);return this.__bounds[t]=[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}],this.__bounds[t]}}class zd extends bd{constructor(){super("circle"),this.set(...arguments)}set(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=t.cx,n=void 0===e?0:e,i=t.cy,r=void 0===i?0:i,o=t.r,a=void 0===o?0:o,s=t.collider,l=u({type:"circle",cx:n,cy:r,r:a},s);super.set(t),this.attrs.cx=n,this.attrs.cy=r,this.attrs.r=a,this.collider=l,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[t])return this.__boundingRect[t];const e=this.bounds(t);return this.__boundingRect[t]={x:e[0].x,y:e[0].y,width:e[2].x-e[0].x,height:e[2].y-e[0].y},this.__boundingRect[t]}bounds(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[t])return this.__bounds[t];const e=this.attrs,n=e.cx,i=e.cy,r=e.r,o=e.r,a=n-r,s=i-o;let l=2*r,c=2*o,u=[{x:a,y:s},{x:a+l,y:s},{x:a+l,y:s+c},{x:a,y:s+c}];if(t&&this.modelViewMatrix){u=this.modelViewMatrix.transformPoints(u);const e=m(b(u),4),n=e[0],i=e[1];l=e[2]-n,c=e[3]-i,this.__bounds[t]=[{x:n,y:i},{x:n+l,y:i},{x:n+l,y:i+c},{x:n,y:i+c}]}else this.__bounds[t]=u;return this.__bounds[t]}}class Td extends bd{constructor(){super("line"),this.set(...arguments)}set(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=t.x1,n=void 0===e?0:e,i=t.y1,r=void 0===i?0:i,o=t.x2,a=void 0===o?0:o,s=t.y2,l=void 0===s?0:s,c=t.collider;super.set(t),this.attrs.x1=n,this.attrs.y1=r,this.attrs.x2=a,this.attrs.y2=l;const h={type:"line",x1:n,y1:r,x2:a,y2:l};this.collider=u(h,c),this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[t])return this.__boundingRect[t];let e=w(this.attrs);t&&this.modelViewMatrix&&(e=this.modelViewMatrix.transformPoints(e));const n=m(b(e),4),i=n[0],r=n[1],o=n[2],a=n[3],s=i!==o||r!==a;return this.__boundingRect[t]={x:i,y:r,width:s?Math.max(1,o-i):0,height:s?Math.max(1,a-r):0},this.__boundingRect[t]}bounds(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[t])return this.__bounds[t];const e=this.boundingRect(t);return this.__bounds[t]=[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}],this.__bounds[t]}}const Id=Math.PI/2;function jd(t,e){const n=Math.atan2(e.y-t.y,e.x-t.x);return n<0?n+2*Math.PI:n}function Pd(t,e,n){return{x:t.x+Math.cos(e)*n,y:t.y+Math.sin(e)*n}}const Fd={step:function(t){return new Mt(t,.5)},stepAfter:function(t){return new Mt(t,1)},stepBefore:function(t){return new Mt(t,0)},linear:nt,basis:function(t){return new ct(t)},cardinal:dt.tension(0),catmullRom:pt,monotonex:function(t){return new xt(t)},monotoney:function(t){return new bt(t)},natural:function(t){return new kt(t)}};function Ld(t){if(t.length<2)return!1;const e=t[0],n=t[t.length-1];return Math.abs(e.x-n.x)<1e-12&&Math.abs(e.y-n.y)<1e-12}class $d extends bd{constructor(){super("path"),this.set(...arguments)}set(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(super.set(t),this.segments=[],this.points=[],t.arcDatum){const e=Q();e.innerRadius(t.desc.slice.innerRadius),e.outerRadius(t.desc.slice.outerRadius),e.cornerRadius(t.desc.slice.cornerRadius);const n=e(t.arcDatum);this.attrs.d=n}else if(t.points){const e=t.major,n=t.minor,i=t.layerObj,r=t.points,o=t.stngs,a=t.generatorType,s=ot(),l=o.coordinates?o.coordinates.defined:null;s[e.p](t=>t.major*e.size)["".concat(n.p,"1")](t=>t.minor*n.size)["".concat(n.p,"0")](t=>t.minor0*n.size).curve(Fd["monotone"===i.curve?"monotone".concat(e.p):i.curve]),l?s.defined(t=>!t.dummy&&"number"==typeof t.minor&&!isNaN(t.minor)&&t.defined):s.defined(t=>!t.dummy&&"number"==typeof t.minor&&!isNaN(t.minor));const c=o.connect?r.filter(s.defined()):r,u=("area"===a?s:s[a]())(c);this.attrs.d=u}else t.d&&(this.attrs.d=t.d);if(this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null},Array.isArray(t.collider)||"object"==typeof t.collider&&void 0!==t.collider.type)this.collider=t.collider;else if(this.attrs.d){if(this.segments=Ah(this.attrs.d),this.segments.length>1&&this.segments.every(t=>Ld(t)))return void(this.collider=u({type:"geopolygon",vertices:this.segments},t.collider));this.segments.forEach(e=>{if(e.length<=1);else if(Ld(e))this.collider=u({type:"polygon",vertices:e},t.collider);else if("object"==typeof t.collider&&t.collider.visual){const n=this.attrs["stroke-width"]/2;this.collider=function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=[],r=[];if("h"===n.forceOrientation){const e=t[0].x<t[1].x?-1:1,n=t[t.length-1].x>t[t.length-2].x?1:-1;t.unshift({x:t[0].x+e,y:t[0].y}),t.push({x:t[t.length-1].x+n,y:t[t.length-1].y})}else if("v"===n.forceOrientation){const e=t[0].y<t[1].y?-1:1,n=t[t.length-1].y>t[t.length-2].y?1:-1;t.unshift({x:t[0].x,y:t[0].y+e}),t.push({x:t[t.length-1].x,y:t[t.length-1].y+n})}const o=t.length-1;for(let n=1;n<o;n++){const a=t[n-1],s=t[n],l=t[n+1],c=jd(s,a),u=jd(s,l),h=(c+u)/2,d=h+Math.PI,f=Math.max(h,d),p=Math.min(h,d),g=c>u;if(1===n){const t=jd(a,s);i.push(Pd(a,t-Id,e)),r.unshift(Pd(a,t+Id,e))}const m=g?f:p,y=g?p:f;if(i.push(Pd(s,m,e)),r.unshift(Pd(s,y,e)),n===o-1){const t=jd(l,s);i.push(Pd(l,t+Id,e)),r.unshift(Pd(l,t-Id,e))}}return{type:"polygon",vertices:[...i,...r]}}(e,n,t.collider)}else this.collider=u({type:"polyline",points:e},t.collider)})}}boundingRect(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[t])return this.__boundingRect[t];this.points.length||(this.segments=this.segments.length?this.segments:Ah(this.attrs.d),this.points=function(t){const e=[];let n,i=t.length;for(let r=0;r<i;r++){n=t[r];for(let t=0;t<n.length;t++)e.push(n[t])}return e}(this.segments));const e=m(b(t&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(this.points):this.points),4),n=e[0],i=e[1],r=e[2],o=e[3];return this.__boundingRect[t]={x:n||0,y:i||0,width:r-n||0,height:o-i||0},this.__boundingRect[t]}bounds(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[t])return this.__bounds[t];const e=this.boundingRect(t);return this.__bounds[t]=[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}],this.__bounds[t]}}function Bd(t){let e=t.data,n=t._boundingRect,i=t._textBoundsFn;return null!=e&&(n||i)}class Hd extends bd{constructor(){super("text"),this.set(...arguments)}set(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=t.x,n=void 0===e?0:e,i=t.y,r=void 0===i?0:i,o=t.dx,a=void 0===o?0:o,s=t.dy,l=void 0===s?0:s,c=t.textBoundsFn,h=t.text,d=t.title,f=t.collider,p=t.boundingRect,g=t.ellipsed;super.set(t),this.attrs.x=n,this.attrs.y=r,this.attrs.dx=a,this.attrs.dy=l,this.attrs.text=h,void 0!==d&&(this.attrs.title=String(d)),"object"==typeof p?this._textBoundsFn=()=>p:"function"==typeof c&&(this._textBoundsFn=c),"string"==typeof g&&(this.ellipsed=g),this.collider=u({type:Bd(this)?"bounds":null},f),this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let t,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];if("function"!=typeof this._textBoundsFn)return{x:0,y:0,width:0,height:0};t=this._textBoundsFn(this.attrs);const n=k(t),i=m(b(e&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(n):n),4),r=i[0],o=i[1],a=i[2],s=i[3];return this.__boundingRect[e]={x:r,y:o,width:a-r,height:s-o},this.__boundingRect[e]}bounds(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[t])return this.__bounds[t];const e=this.boundingRect(t);return this.__bounds[t]=[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}],this.__bounds[t]}}class Wd extends bd{constructor(){super("image"),this.set(...arguments)}set(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=t.x,n=void 0===e?0:e,i=t.y,r=void 0===i?0:i,o=t.width,a=void 0===o?0:o,s=t.height,l=void 0===s?0:s,c=t.rx,h=void 0===c?0:c,d=t.ry,f=void 0===d?0:d,p=t.src,g=t.collider,m=t.cx,y=void 0===m?0:m,v=t.cy,x=void 0===v?0:v,b=t.r,w=void 0===b?0:b,k=t.opacity,_=t.imageScalingFactor,M=t.imagePosition,S=t.symbol;let R;R="circle"===t.symbol?u({type:"circle",cx:y,cy:x,r:w},g):u({type:"bounds",x:n,y:r,width:a,height:l},g),super.set(t),a>=0?(this.attrs.x=n,this.attrs.width=a):(this.attrs.x=n+a,this.attrs.width=-a),l>=0?(this.attrs.y=r,this.attrs.height=l):(this.attrs.y=r+l,this.attrs.height=-l),h>0&&(this.attrs.rx=h),f>0&&(this.attrs.ry=f),p&&(this.attrs.src=p),this.attrs.r=w,this.attrs.cx=y,this.attrs.cy=x,this.attrs.opacity=void 0!==k?k:1,this.attrs.imageScalingFactor=void 0!==_?_:1,this.attrs.imagePosition=M||"center-center",this.attrs.symbol=S||"rectangle",this.collider=R,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null},t.collider||(this.attrs.updateCollider=this.updateCollider.bind(this))}updateCollider(t){let e;e="circle"===t.symbol?u(this.collider,{type:"circle",cx:t.cx,cy:t.cy,r:t.r}):u(this.collider,{type:"bounds",x:t.x,y:t.y,width:t.width,height:t.height}),this.collider=e}boundingRect(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[t])return this.__boundingRect[t];const e=k(this.attrs),n=m(b(t&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(e):e),4),i=n[0],r=n[1],o=n[2],a=n[3];return this.__boundingRect[t]={x:i,y:r,width:o-i,height:a-r},this.__boundingRect[t]}bounds(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[t])return this.__bounds[t];if("circle"===this._node.symbol){const e=this.boundingRect(t),n=Math.min(e.width,e.height)/2,i=e.x-n,r=e.y-n;let o=2*n,a=2*n,s=[{x:i,y:r},{x:i+o,y:r},{x:i+o,y:r+a},{x:i,y:r+a}];if(t&&this.modelViewMatrix){s=this.modelViewMatrix.transformPoints(s);const e=m(b(s),4),n=e[0],i=e[1];o=e[2]-n,a=e[3]-i,this.__bounds[t]=[{x:n,y:i},{x:n+o,y:i},{x:n+o,y:i+a},{x:n,y:i+a}]}else this.__bounds[t]=s;return this.__bounds[t]}const e=this.boundingRect(t);return this.__bounds[t]=[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}],this.__bounds[t]}}const Vd=Et();function Ud(t,e){return Vd.get(t)(e)}Vd.add("rect",function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return new Ad(...e)}),Vd.add("circle",function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return new zd(...e)}),Vd.add("text",function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return new Hd(...e)}),Vd.add("line",function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return new Td(...e)}),Vd.add("path",function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return new $d(...e)}),Vd.add("stage",function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return new Sd(...e)}),Vd.add("container",Md),Vd.add("defs",Md),Vd.add("linearGradient",Dd),Vd.add("radialGradient",Dd),Vd.add("conicGradient",Dd),Vd.add("stop",Dd),Vd.add("pattern",function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return new Od(...e)}),Vd.add("image",function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return new Wd(...e)});const Yd=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const e=[{}];function n(){return e[e.length-1]}return n.save=function(){let i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r=n(),o={};let a="";for(let e=0;e<t.length;e++)a=t[e],void 0!==r[a]&&(o[a]=r[a]);return u(o,i),e.push(o),n()},n.restore=function(){e.splice(e.length-1,1)},n}(["stroke","fill","strokeWidth","opacity","fontFamily","fontSize","baseline"]);function Kd(t,e){if(Array.isArray(e))for(let n=0,i=e.length;n<i;n++)e[n](t)}function Gd(t,e,n){t.node=n[e],t.index=e}function Xd(t,e,n,i){let r=!1;const o={siblings:t,node:null,index:0};for(let a=0,s=t.length;a<s;a++){if(Gd(o,a,t),Kd(o,i.create),r="function"==typeof o.node.disabled?o.node.disabled():o.node.disabled,r)continue;o.node=Yd.save(o.node);const s=Ud(o.node.type,o.node);s&&(o.node.transform&&(n.save(),id(o.node.transform,n)),n.isIdentity()||(s.modelViewMatrix=n.clone()),e.addChild(s),o.node.children&&Xd(o.node.children,s,n,i),o.node.transform&&n.restore()),Yd.restore()}}function Jd(t){let e=t.items,n=t.stage,i=t.dpi,r=t.on,o=void 0===r?{}:r;return n||(n=Ud("stage",i)),Xd(e,n,new Jh,o),n}function Zd(t,e,n){const i=n.orientation,r=n.degree,o=n.stops,a=void 0===o?[]:o;let s=null;if("radial"===i){const n=e.boundingRect();s=t.createRadialGradient(n.x+n.width/2,n.y+n.height/2,1e-5,n.x+n.width/2,n.y+n.height/2,Math.max(n.width,n.height)/2)}else if("conic"===i){const e=n.startAngle||0,i=n.x||0,r=n.y||0;s=t.createConicGradient(e,i,r)}else{const i=Zo(r);["x1","x2","y1","y2"].forEach(t=>{t in n&&(i[t]=n[t])});const o=e.boundingRect();s=t.createLinearGradient(o.x+i.x1*o.width,o.y+i.y1*o.height,o.x+i.x2*o.width,o.y+i.y2*o.height)}for(let t=0,e=a.length;t<e;t++){let e=a[t];s.addColorStop(e.offset,e.color)}return s}function Qd(t,e,n){return e.width=t.width,e.height=t.height,n.save(),n.fillStyle=t.fill,t.shapes.forEach(t=>{if("rect"===t.type)n.rect(t.x,t.y,t.width,t.height)}),n.fill(),n.restore(),n.createPattern(e,"repeat")}function tf(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.x,n=t.y,i=t.width,r=t.height,o=t.scaleRatio,a=t.margin,s=t.edgeBleed;const l={x:0,y:0,width:0,height:0,scaleRatio:{x:1,y:1},margin:{left:0,top:0},edgeBleed:{left:0,right:0,top:0,bottom:0,bool:!1}};return l.x=isNaN(e)?l.x:e,l.y=isNaN(n)?l.y:n,l.width=isNaN(i)?l.width:i,l.height=isNaN(r)?l.height:r,void 0!==o&&(l.scaleRatio.x=isNaN(o.x)?l.scaleRatio.x:o.x,l.scaleRatio.y=isNaN(o.y)?l.scaleRatio.y:o.y),void 0!==a&&(l.margin.left=isNaN(a.left)?0:a.left,l.margin.top=isNaN(a.top)?0:a.top),"object"==typeof s&&["left","right","top","bottom"].forEach(t=>{!isNaN(s[t])&&s[t]>0&&(l.edgeBleed[t]=s[t],l.edgeBleed.bool=!0)}),l.computedPhysical={x:Math.round(l.margin.left+(l.x-l.edgeBleed.left)*l.scaleRatio.x),y:Math.round(l.margin.top+(l.y-l.edgeBleed.top)*l.scaleRatio.y),width:Math.round((l.width+l.edgeBleed.left+l.edgeBleed.right)*l.scaleRatio.x),height:Math.round((l.height+l.edgeBleed.top+l.edgeBleed.bottom)*l.scaleRatio.y)},l}function ef(){const t={element:()=>{},root:()=>{},settings:()=>{},appendTo:()=>{},getScene:()=>[],render:()=>!1,itemsAt:()=>[],findShapes:()=>[],clear:()=>{},destory:()=>{},size:()=>{},measureText:Su,textBounds:Cu,setKey:e=>{t.element().setAttribute("data-key",e)}};return t}function nf(t){return e=>{let n=e.node;"text"===n.type&&function(t){return null!=t}(n.data)&&!n.textBoundsFn&&(n.textBoundsFn=t.textBounds)}}const rf=200,of=200;class af{constructor(t){this.targetCanvas=t,this.bufferCanvas=t.cloneNode()}updateSize(t){let e,n=t.rect,i=t.dpiRatio,r=t.canvasBufferSize;e=r?"function"==typeof r?r(n):r:{width:n.computedPhysical.width+2*rf,height:n.computedPhysical.height+2*of},this.bufferCanvas.style.width="".concat(e.width,"px"),this.bufferCanvas.style.height="".concat(e.height,"px"),this.bufferCanvas.width=Math.round(e.width*i),this.bufferCanvas.height=Math.round(e.height*i)}apply(){this.targetCanvas.getContext("2d").drawImage(this.bufferCanvas,0,0)}clear(){this.bufferCanvas.width=this.bufferCanvas.width}getContext(){return this.bufferCanvas.getContext("2d")}}const sf=Et();function lf(t){return Array.isArray(t)?t:"string"==typeof t?-1!==t.indexOf(",")?t.split(","):t.split(" "):[]}function cf(t){return("undefined"==typeof window?1:window.devicePixelRatio||1)/(t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1)}function uf(t,e){e.setTransform(t[0][0],t[1][0],t[0][1],t[1][1],t[0][2],t[1][2])}function hf(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const r=Object.keys(i);for(let r=0,o=n.length;r<o;r++){let o=n[r];const a=o[0],s=o[1],l=o[2];if(a in e.attrs&&!(s in i)&&t[s]!==e.attrs[a]){const n=l?l(e.attrs[a]):e.attrs[a];"function"==typeof t[s]?t[s](n):t[s]=n}}for(let e=0,n=r.length;e<n;e++){const n=r[e];t[n]=i[n]}}function df(t,e,n,i){for(let r=0,o=t.length;r<o;r++){let o=t[r],a={};e.save(),o.attrs&&(o.attrs.fill||o.attrs.stroke)&&(o.attrs.fill&&"object"==typeof o.attrs.fill&&"gradient"===o.attrs.fill.type?a.fillStyle=Zd(e,o,o.attrs.fill):o.attrs.fill&&"object"==typeof o.attrs.fill&&"pattern"===o.attrs.fill.type&&(a.fillStyle=i.patterns.create(o.attrs.fill)),o.attrs.stroke&&"object"==typeof o.attrs.stroke&&"gradient"===o.attrs.stroke.type?a.strokeStyle=Zd(e,o,o.attrs.stroke):o.attrs.stroke&&"object"==typeof o.attrs.stroke&&"pattern"===o.attrs.stroke.type&&(a.strokeStyle=i.patterns.create(o.attrs.stroke))),hf(e,o,n,a),o.modelViewMatrix&&uf(o.modelViewMatrix.elements,e),sf.has(o.type)&&sf.get(o.type)(o.attrs,{g:e,doFill:"fill"in o.attrs&&"none"!==o.attrs.fill,doStroke:"stroke"in o.attrs&&0!==o.attrs["stroke-width"],ellipsed:o.ellipsed}),o.children&&df(o.children,e,n,i),e.restore()}}function ff(){let t,e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Jd;const i={transform:void 0,canvasBufferSize:void 0,progressive:void 0};let r,o=!1,a=tf();const s=[["fill","fillStyle"],["stroke","strokeStyle"],["opacity","globalAlpha"],["globalAlpha","globalAlpha"],["stroke-width","lineWidth"],["stroke-linejoin","lineJoin"],["stroke-dasharray","setLineDash",lf]];let l;const c=ef();return c.element=()=>t,c.root=()=>t,c.settings=t=>(t&&Object.keys(i).forEach(e=>{void 0!==t[e]&&(i[e]=t[e])}),i),c.appendTo=n=>(t||(t=n.ownerDocument.createElement("canvas"),t.style.position="absolute",t.style["-webkit-font-smoothing"]="antialiased",t.style["-moz-osx-font-smoothing"]="antialiased",t.style.pointerEvents="none"),"function"!=typeof i.transform||e||(e=new af(t)),n.appendChild(t),t),c.getScene=i=>{const r=cf(e&&e.getContext()||t.getContext("2d")),o=a.scaleRatio.x,s=a.scaleRatio.y,l={type:"container",children:i,transform:a.edgeBleed.bool?"translate(".concat(a.edgeBleed.left*r*o,", ").concat(a.edgeBleed.top*r*s,")"):""};return 1===r&&1===o&&1===s||(l.transform+="scale(".concat(r*o,", ").concat(r*s,")")),n({items:[l],dpi:r,on:{create:[gu(c.measureText),nf(c)]}})},c.render=n=>{if(!t)return!1;l||(l=function(t){const e=t.createElement("canvas"),n=e.getContext("2d");let i={};return{create(t){const r=t.key;return r?(i[r]=i[r]||Qd(t,e,n),i[r]):Qd(t,e,n)},clear(){i={}}}}(t.ownerDocument));const u=e&&e.getContext()||t.getContext("2d"),h=cf(u),d=e&&i.transform();if(d)return t.width=t.width,function(t){let e=t.el,n=t.dpiRatio,i=t.transform;if("object"==typeof i){const t=[i.horizontalScaling,i.horizontalSkewing,i.verticalSkewing,i.verticalScaling,i.horizontalMoving*n,i.verticalMoving*n];e.getContext("2d").setTransform(...t)}}({el:t,dpiRatio:h,transform:d}),e.apply(),!0;o&&(t.style.left="".concat(a.computedPhysical.x,"px"),t.style.top="".concat(a.computedPhysical.y,"px"),t.style.width="".concat(a.computedPhysical.width,"px"),t.style.height="".concat(a.computedPhysical.height,"px"),t.width=Math.round(a.computedPhysical.width*h),t.height=Math.round(a.computedPhysical.height*h),e&&e.updateSize({rect:a,dpiRatio:h,canvasBufferSize:i.canvasBufferSize}));const f=c.getScene(n),p=!r||!f.equals(r);l.clear();const g=o||p,m="function"==typeof i.progressive&&i.progressive();return g&&(m&&!m.isFirst||c.clear(),df(f.children,u,s,{patterns:l})),e&&(t.width=t.width,e.apply()),o=!1,m&&!m.isFirst&&f.children.unshift(...r.children),r=f,g},c.itemsAt=t=>r?r.getItemsFrom(t):[],c.findShapes=t=>r?r.findShapes(t):[],c.clear=()=>(t&&(t.width=t.width),e&&e.clear(),r=null,c),c.size=t=>{if(t){const e=tf(t);JSON.stringify(a)!==JSON.stringify(e)&&(o=!0,a=e)}return a},c.destroy=()=>{t&&(t.parentElement&&t.parentElement.removeChild(t),t=null),e&&(e=null),r=null},c}function pf(t,e){sf.add(t,e)}function gf(t,e){return Math.max(0,Math.min(t,e))}const mf=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼ‎ⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),yf=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞‏יִײַ-ﬨשׁ-ﭏ]"),vf=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]");function xf(t){return mf.test(t)}function bf(t){return yf.test(t)||vf.test(t)}function wf(t){let e,n,i=t?t.length:0;for(e=0;e<i;e++){if(n=t[e],xf(n))return"ltr";if(bf(n))return"rtl"}return"ltr"}const kf={start:"end",end:"start",center:"center",middle:"middle"};function _f(t,e){return"rtl"===e?kf[t]:t}function Mf(t,e){if(Mf.cache[t])return void e(Mf.cache[t]);const n=new Image;n.src=t,n.onload=()=>{Mf.cache[t]=n,e(n)},n.onerror=t=>{console.error("Image load error",t)}}function Sf(t,e){const n=[];let i;const r=[],o=[],a=[];let s,l;const c=t=>t.id,u=(t,e)=>{let n;return n="object"==typeof t?"id"in t?t.id:e:t,{content:t,id:"".concat(n,"__").concat(t.type||"")}};t.isTree||(t=t.map(u)),e=e.map(u),s=t.map(c),l=e.map(c);for(let t=0,i=e.length;t<i;t++){-1===s.indexOf(e[t].id)?n.push(e[t]):o.push(e[t])}for(let e=0,n=t.length;e<n;e++){-1===l.indexOf(t[e].id)?r.push(t[e]):a.push(t[e])}for(let t=0,e=n.length;t<e;t++)n[t].content.children&&(n[t].diff=Sf([],n[t].content.children),n[t].children=n[t].diff.updatedNew.concat(n[t].diff.added),n[t].children.isTree=!0);for(let t=0,e=o.length;t<e;t++)o[t].diff=Sf(a[t].children||[],o[t].content.children||[]),o[t].object=a[t].object,o[t].children=o[t].diff.items;return i=o.concat(n),n.isTree=!0,r.isTree=!0,o.isTree=!0,a.isTree=!0,i.isTree=!0,{added:n,updatedNew:o,updatedOld:a,removed:r,items:i}}function Rf(t,e,n){for(let i=0,r=t.length;i<r;i++)t[i].object=n(t[i].content.type,e)}function Cf(t,e){for(let n=0,i=t.length;n<i;n++)null!==t[n].object&&void 0!==t[n].object&&(e(t[n].object),t[n].object=null)}function Nf(t,e,n,i){let r;for(let o=0,a=t.length;o<a;o++)r=t[o],null!==r.object&&void 0!==r.object&&(n(r.object,r.content),r.diff&&(Rf(r.diff.added,r.object,e),Cf(r.diff.removed,i),Nf(r.diff.items,e,n,i)))}function Df(t,e,n,i,r,o){const a=Sf(t,e);return Rf(a.added,n,i),Cf(a.removed,o),Nf(a.items,i,r,o),a.items}Mf.cache={},pf("rect",function(t,e){let n=e.g,i=e.doFill,r=e.doStroke;n.beginPath(),t.rx>0||t.ry>0?function(t,e,n,i,r,o,a){o=gf(i/2,o>0?o:a),a=gf(r/2,a>0?a:o),t.moveTo(e,n+a),t.lineTo(e,n+r-a),t.quadraticCurveTo(e,n+r,e+o,n+r),t.lineTo(e+i-o,n+r),t.quadraticCurveTo(e+i,n+r,e+i,n+r-a),t.lineTo(e+i,n+a),t.quadraticCurveTo(e+i,n,e+i-o,n),t.lineTo(e+o,n),t.quadraticCurveTo(e,n,e,n+a)}(n,t.x,t.y,t.width,t.height,t.rx,t.ry):n.rect(t.x,t.y,t.width,t.height),i&&n.fill(),r&&n.stroke()}),pf("circle",function(t,e){let n=e.g,i=e.doFill,r=e.doStroke;n.beginPath(),n.moveTo(t.cx+t.r,t.cy),n.arc(t.cx,t.cy,t.r,0,2*Math.PI,!1),i&&n.fill(),r&&n.stroke()}),pf("line",function(t,e){let n=e.g,i=e.doStroke;n.beginPath(),n.moveTo(t.x1,t.y1),n.lineTo(t.x2,t.y2),i&&n.stroke()}),pf("path",function(t,e){let n=e.g,i=e.doStroke,r=e.doFill;const o=new Path2D(t.d);r&&n.fill(o),i&&n.stroke(o)}),pf("text",function(t,e){let n=e.g,i=e.ellipsed,r=e.doStroke;const o=i||mu(t,Su);n.font=[t["font-style"],t["font-weight"],t["font-size"],t["font-family"]].filter(t=>!!t).join(" ");const a=wf(t.text);n.canvas.dir!==a&&(n.canvas.dir=a);const s=_f("middle"===t["text-anchor"]?"center":t["text-anchor"],n.canvas.dir);s&&n.textAlign!==s&&(n.textAlign=s);const l=yu(t);n.fillText(o,t.x+t.dx,t.y+t.dy+l),r&&n.strokeText(o,t.x+t.dx,t.y+t.dy+l)}),pf("image",function(t,e){let n=e.g;const i=n.canvas,r=n.getTransform(),o=window.devicePixelRatio||1,a=i.clientWidth*o,s=i.clientHeight*o;i.width===a&&i.height===s||(i.width=a,i.height=s),Mf(t.src,e=>{if(n.setTransform(1,0,0,1,0,0),n.clearRect(0,0,i.width,i.height),n.setTransform(r),n.globalAlpha=t.opacity,t.width||t.height||(t.width=e.naturalWidth*t.imageScalingFactor,t.height=e.naturalHeight*t.imageScalingFactor),function(t){const e=t.imagePosition||"center-center";let n=t.width,i=t.height;if("circle"===t.symbol){const e=Math.min(t.width,t.height)/2;n=2*e,i=2*e}switch(e){case"top-center":t.y-=i/2;break;case"center-left":t.x-=n/2;break;case"center-right":t.x+=n/2;break;case"top-left":t.x-=n/2,t.y-=i/2;break;case"top-right":t.x+=n/2,t.y-=i/2;break;case"bottom-left":t.x-=n/2,t.y+=i/2;break;case"bottom-right":t.x+=n/2,t.y+=i/2;break;case"bottom-center":t.y+=i/2}}(t),"circle"===t.symbol){const i=t.x,r=t.y;t.r=Math.min(t.width,t.height)/2;const o=i-t.width/2,a=r-t.height/2;n.save(),n.beginPath(),n.arc(i,r,t.r,0,2*Math.PI),n.clip(),n.drawImage(e,o,a,t.width,t.height),n.restore()}else t.x-=t.width/2,t.y-=t.height/2,n.drawImage(e,t.x,t.y,t.width,t.height);n.globalAlpha=1,t.updateCollider&&t.updateCollider(t)})});const qf="http://www.w3.org/2000/svg",Ef=(t,e)=>{if(!t||"string"!=typeof t)throw new Error("Invalid type: ".concat(t));const n=e.ownerDocument.createElementNS(qf,"container"===t?"g":t);return e.appendChild(n),n},Of=t=>{t.parentNode&&t.parentNode.removeChild(t)};function Af(t){let e=t.element,n=t.attrs;return function(){const t=n.width,i=n.height,r=n.imagePosition,o=n.imageScalingFactor,a=n.symbol;let s=n.x,l=void 0===s?0:s,c=n.y,u=void 0===c?0:c,h=t>0?t:this.naturalWidth,d=i>0?i:this.naturalHeight;switch(o&&(h*=o,d*=o),r){case"top-center":u-=d/2;break;case"center-left":l-=h/2;break;case"center-right":l+=h/2;break;case"top-left":l-=h/2,u-=d/2;break;case"top-right":l+=h/2,u-=d/2;break;case"bottom-left":l-=h/2,u+=d/2;break;case"bottom-right":l+=h/2,u+=d/2;break;case"bottom-center":u+=d/2}if(e.setAttribute("width",h),e.setAttribute("height",d),e.setAttribute("x",l-h/2),e.setAttribute("y",u-d/2),e.setAttribute("preserveAspectRatio","none"),"circle"===a){const t=e.ownerSVGElement;if(!t)return;const n="clip-".concat(Math.random().toString(36).substr(2,9));if(!t.querySelector("#".concat(n))){const e=t.querySelector("defs")||t.insertBefore(document.createElementNS(qf,"defs"),t.firstChild),i=document.createElementNS(qf,"clipPath");i.setAttribute("id",n);const r=document.createElementNS(qf,"circle");r.setAttribute("cx",l),r.setAttribute("cy",u),r.setAttribute("r",Math.min(h,d)/2),i.appendChild(r),e.appendChild(i)}e.setAttribute("clip-path","url(#".concat(n,")"))}}}const zf=(t,e)=>{if((t=>{switch(t.type){case"circle":return!isNaN(t.attrs.cx)&&!isNaN(t.attrs.cy)&&!isNaN(t.attrs.r);case"line":return!(isNaN(t.attrs.x1)||isNaN(t.attrs.y1)||isNaN(t.attrs.x2)||isNaN(t.attrs.y2));case"rect":return!(isNaN(t.attrs.x)||isNaN(t.attrs.y)||isNaN(t.attrs.width)||isNaN(t.attrs.height));case"text":case"image":return!isNaN(t.attrs.x)&&!isNaN(t.attrs.y);default:return!0}})(e)){for(const n in e.attrs)if("stroke"===n&&e.strokeReference)t.setAttribute("stroke",e.strokeReference);else if("fill"===n&&e.fillReference)t.setAttribute("fill",e.fillReference);else if("text"===n){t.setAttribute("style","white-space: pre"),t.textContent=e.ellipsed||mu(e.attrs,Su);const n=wf(e.attrs.text);"rtl"===n&&(t.setAttribute("direction","rtl"),t.setAttribute("dir","rtl"),t.setAttribute("text-anchor",_f(t.getAttribute("text-anchor"),n)))}else if("text"!==e.type||"dy"!==n&&"dominant-baseline"!==n)if("text"===e.type&&"title"===n&&e.attrs.title){const n=t.ownerDocument.createElementNS(qf,"title");n.textContent=e.attrs.title,t.appendChild(n)}else if("image"===e.type&&"src"===n){t.setAttributeNS("http://www.w3.org/1999/xlink","href",e.attrs.src);let n=new Image;n.src=e.attrs.src,n.onload=Af({element:t,attrs:e.attrs})}else t.setAttribute(n,e.attrs[n]);else{const i=+t.getAttribute(n)||0;let r=0;r="dominant-baseline"===n?yu(e.attrs):e.attrs[n],t.setAttribute("dy",r+i)}if("string"==typeof e.data||"number"==typeof e.data||"boolean"==typeof e.data)t.setAttribute("data",e.data);else if("object"==typeof e.data&&null!==e.data)for(const n in e.data)"string"!=typeof e.data[n]&&"number"!=typeof e.data[n]&&"boolean"!=typeof e.data[n]||t.setAttribute("data-".concat(n),e.data[n])}};class Tf{constructor(t,e,n,i){this.create=t,this.nodeCreator=e,this.nodeMaintainer=n,this.nodeDestroyer=i}render(t,e){return this.create([],t,e,this.nodeCreator,this.nodeMaintainer,this.nodeDestroyer)}}function If(){return new Tf(Df,Ef,zf,Of)}function jf(t){let e,n,i,r=0;if(0===(t=JSON.stringify(t)).length)return r;for(e=0,i=t.length;e<i;e++)n=t.charCodeAt(e),r=(r<<5)-r+n,r&=r;return r}function Pf(){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:qf,e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Jd;const n=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:If)();let i,r,o,a=!1,s=tf();const l={transform:void 0,disableScreenReader:!1},c=ef(),u={type:"defs",children:[]},h=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:jf,n={},i=Date.now();const r={onCreate(r){let o={};r.node&&"object"==typeof r.node.fill&&"pattern"===r.node.fill.type&&r.node.fill.shapes&&(o.fill=r.node.fill),r.node&&"object"==typeof r.node.stroke&&"pattern"===r.node.stroke.type&&r.node.stroke.shapes&&(o.stroke=r.node.stroke),Object.keys(o).forEach(a=>{let s="";const l=o[a],c=e(l),u="picasso-pattern-".concat(i,"-").concat(c);if("undefined"!=typeof window&&(s=window.location.href.split("#")[0]),!n[c]){const e={patternUnits:"userSpaceOnUse",x:0,y:0,width:l.width,height:l.height,type:"pattern",id:u,children:[],fill:l.fill};l.shapes.forEach(t=>{e.children.push(t)}),t.push(e),n[c]=!0}r.node["".concat(a,"Reference")]="url('".concat(s,"#").concat(u,"')")})},clear(){n={}}};return r}(u.children),d=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:jf,n={},i=Date.now();const r={getOrCreateGradient(){let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"fill",a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",s=e(r[o]),l="picasso-gradient-".concat(i,"-").concat(s);if(!n[s]){let e=r[o],i=e.orientation,a=e.degree,c=e.stops,u=void 0===c?[]:c,h={};void 0===a&&(a=90),"radial"===i?h.type="radialGradient":(h=Zo(a),["x1","x2","y1","y2"].forEach(t=>{t in r[o]&&(h[t]=r[o][t])}),h.type="linearGradient"),h.id=l,h.children=u.map(t=>{let e=t.offset,n=t.color,i=t.opacity;return{type:"stop",offset:"".concat(100*e,"%"),style:"stop-color:".concat(n,";stop-opacity:").concat(void 0!==i?i:1)}}),t.push(h),n[s]=l}return"url('".concat(a,"#").concat(l,"')")},onCreate(t){let e="";"undefined"!=typeof window&&(e=window.location.href.split("#")[0]);const n=t.node;n.fill&&"object"==typeof n.fill&&"gradient"===n.fill.type&&(n.fillReference=r.getOrCreateGradient(n,"fill",e)),n.stroke&&"object"==typeof n.stroke&&"gradient"===n.stroke.type&&(n.strokeReference=r.getOrCreateGradient(n,"stroke",e))},clear(){n={}}};return r}(u.children);return c.element=()=>i,c.root=()=>r,c.settings=t=>(t&&Object.keys(l).forEach(e=>{void 0!==t[e]&&(l[e]=t[e])}),l),c.appendTo=e=>(i||(i=e.ownerDocument.createElementNS(t,"svg"),i.style.position="absolute",i.style["-webkit-font-smoothing"]="antialiased",i.style["-moz-osx-font-smoothing"]="antialiased",i.style.pointerEvents="none",i.setAttribute("xmlns",t),r=e.ownerDocument.createElementNS(t,"g"),r.style.pointerEvents="auto",i.appendChild(r)),e.appendChild(i),i),c.getScene=t=>{const n=s.scaleRatio.x,i=s.scaleRatio.y,r={type:"container",children:Array.isArray(t)?[...t,u]:t,transform:s.edgeBleed.bool?"translate(".concat(s.edgeBleed.left*n,", ").concat(s.edgeBleed.top*i,")"):""};return 1===n&&1===i||(r.transform+="scale(".concat(n,", ").concat(i,")")),e({items:[r],on:{create:[t=>{t.node.fillReference=void 0,t.node.strokeReference=void 0},d.onCreate,h.onCreate,gu(c.measureText),nf(c)]}})},c.render=t=>{if(!i)return!1;const e="function"==typeof l.transform&&l.transform();if(e){const t=e.horizontalScaling,n=e.horizontalSkewing,i=e.verticalSkewing,o=e.verticalScaling,a=e.horizontalMoving,s=e.verticalMoving;return r.style.transform="matrix(".concat(t,", ").concat(n,", ").concat(i,", ").concat(o,", ").concat(a,", ").concat(s,")"),!0}r.style.transform="";l.disableScreenReader&&i.setAttribute("aria-hidden",!0),a&&(i.style.left="".concat(s.computedPhysical.x,"px"),i.style.top="".concat(s.computedPhysical.y,"px"),i.setAttribute("width",s.computedPhysical.width),i.setAttribute("height",s.computedPhysical.height)),d.clear(),h.clear(),u.children.length=0;const f=c.getScene(t),p=!o||!f.equals(o),g=a||p;return g&&(c.clear(),n.render(f.children,r)),a=!1,o=f,g},c.itemsAt=t=>o?o.getItemsFrom(t):[],c.findShapes=t=>o?o.findShapes(t):[],c.clear=()=>{if(!r)return c;o=null;const t=r.cloneNode(!1);return i.replaceChild(t,r),r=t,c},c.destroy=()=>{i&&i.parentNode&&i.parentNode.removeChild(i),i=null,r=null},c.size=t=>{if(t){const e=tf(t);JSON.stringify(s)!==JSON.stringify(e)&&(a=!0,s=e)}return s},c}var Ff,Lf,$f,Bf,Hf,Wf,Vf,Uf={},Yf=[],Kf=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function Gf(t,e){for(var n in e)t[n]=e[n];return t}function Xf(t){var e=t.parentNode;e&&e.removeChild(t)}function Jf(t,e,n){var i,r,o,a={};for(o in e)"key"==o?i=e[o]:"ref"==o?r=e[o]:a[o]=e[o];if(arguments.length>2&&(a.children=arguments.length>3?Ff.call(arguments,2):n),"function"==typeof t&&null!=t.defaultProps)for(o in t.defaultProps)void 0===a[o]&&(a[o]=t.defaultProps[o]);return Zf(t,a,i,r,null)}function Zf(t,e,n,i,r){var o={type:t,props:e,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==r?++$f:r};return null==r&&null!=Lf.vnode&&Lf.vnode(o),o}function Qf(t){return t.children}function tp(t,e){this.props=t,this.context=e}function ep(t,e){if(null==e)return t.__?ep(t.__,t.__.__k.indexOf(t)+1):null;for(var n;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e)return n.__e;return"function"==typeof t.type?ep(t):null}function np(t){var e,n;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e){t.__e=t.__c.base=n.__e;break}return np(t)}}function ip(t){(!t.__d&&(t.__d=!0)&&Bf.push(t)&&!rp.__r++||Hf!==Lf.debounceRendering)&&((Hf=Lf.debounceRendering)||Wf)(rp)}function rp(){var t,e,n,i,r,o,a,s;for(Bf.sort(Vf);t=Bf.shift();)t.__d&&(e=Bf.length,i=void 0,r=void 0,a=(o=(n=t).__v).__e,(s=n.__P)&&(i=[],(r=Gf({},o)).__v=o.__v+1,fp(s,o,r,n.__n,void 0!==s.ownerSVGElement,null!=o.__h?[a]:null,i,null==a?ep(o):a,o.__h),pp(i,o),o.__e!=a&&np(o)),Bf.length>e&&Bf.sort(Vf));rp.__r=0}function op(t,e,n,i,r,o,a,s,l,c){var u,h,d,f,p,g,m,y=i&&i.__k||Yf,v=y.length;for(n.__k=[],u=0;u<e.length;u++)if(null!=(f=n.__k[u]=null==(f=e[u])||"boolean"==typeof f||"function"==typeof f?null:"string"==typeof f||"number"==typeof f||"bigint"==typeof f?Zf(null,f,null,null,f):Array.isArray(f)?Zf(Qf,{children:f},null,null,null):f.__b>0?Zf(f.type,f.props,f.key,f.ref?f.ref:null,f.__v):f)){if(f.__=n,f.__b=n.__b+1,null===(d=y[u])||d&&f.key==d.key&&f.type===d.type)y[u]=void 0;else for(h=0;h<v;h++){if((d=y[h])&&f.key==d.key&&f.type===d.type){y[h]=void 0;break}d=null}fp(t,f,d=d||Uf,r,o,a,s,l,c),p=f.__e,(h=f.ref)&&d.ref!=h&&(m||(m=[]),d.ref&&m.push(d.ref,null,f),m.push(h,f.__c||p,f)),null!=p?(null==g&&(g=p),"function"==typeof f.type&&f.__k===d.__k?f.__d=l=ap(f,l,t):l=sp(t,f,d,y,p,l),"function"==typeof n.type&&(n.__d=l)):l&&d.__e==l&&l.parentNode!=t&&(l=ep(d))}for(n.__e=g,u=v;u--;)null!=y[u]&&("function"==typeof n.type&&null!=y[u].__e&&y[u].__e==n.__d&&(n.__d=lp(i).nextSibling),yp(y[u],y[u]));if(m)for(u=0;u<m.length;u++)mp(m[u],m[++u],m[++u])}function ap(t,e,n){for(var i,r=t.__k,o=0;r&&o<r.length;o++)(i=r[o])&&(i.__=t,e="function"==typeof i.type?ap(i,e,n):sp(n,i,i,r,i.__e,e));return e}function sp(t,e,n,i,r,o){var a,s,l;if(void 0!==e.__d)a=e.__d,e.__d=void 0;else if(null==n||r!=o||null==r.parentNode)t:if(null==o||o.parentNode!==t)t.appendChild(r),a=null;else{for(s=o,l=0;(s=s.nextSibling)&&l<i.length;l+=1)if(s==r)break t;t.insertBefore(r,o),a=o}return void 0!==a?a:r.nextSibling}function lp(t){var e,n,i;if(null==t.type||"string"==typeof t.type)return t.__e;if(t.__k)for(e=t.__k.length-1;e>=0;e--)if((n=t.__k[e])&&(i=lp(n)))return i;return null}function cp(t,e,n){"-"===e[0]?t.setProperty(e,null==n?"":n):t[e]=null==n?"":"number"!=typeof n||Kf.test(e)?n:n+"px"}function up(t,e,n,i,r){var o;t:if("style"===e)if("string"==typeof n)t.style.cssText=n;else{if("string"==typeof i&&(t.style.cssText=i=""),i)for(e in i)n&&e in n||cp(t.style,e,"");if(n)for(e in n)i&&n[e]===i[e]||cp(t.style,e,n[e])}else if("o"===e[0]&&"n"===e[1])o=e!==(e=e.replace(/Capture$/,"")),e=e.toLowerCase()in t?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+o]=n,n?i||t.addEventListener(e,o?dp:hp,o):t.removeEventListener(e,o?dp:hp,o);else if("dangerouslySetInnerHTML"!==e){if(r)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==e&&"height"!==e&&"href"!==e&&"list"!==e&&"form"!==e&&"tabIndex"!==e&&"download"!==e&&e in t)try{t[e]=null==n?"":n;break t}catch(t){}"function"==typeof n||(null==n||!1===n&&"-"!==e[4]?t.removeAttribute(e):t.setAttribute(e,n))}}function hp(t){return this.l[t.type+!1](Lf.event?Lf.event(t):t)}function dp(t){return this.l[t.type+!0](Lf.event?Lf.event(t):t)}function fp(t,e,n,i,r,o,a,s,l){var c,u,h,d,f,p,g,m,y,v,x,b,w,k,_,M=e.type;if(void 0!==e.constructor)return null;null!=n.__h&&(l=n.__h,s=e.__e=n.__e,e.__h=null,o=[s]),(c=Lf.__b)&&c(e);try{t:if("function"==typeof M){if(m=e.props,y=(c=M.contextType)&&i[c.__c],v=c?y?y.props.value:c.__:i,n.__c?g=(u=e.__c=n.__c).__=u.__E:("prototype"in M&&M.prototype.render?e.__c=u=new M(m,v):(e.__c=u=new tp(m,v),u.constructor=M,u.render=vp),y&&y.sub(u),u.props=m,u.state||(u.state={}),u.context=v,u.__n=i,h=u.__d=!0,u.__h=[],u._sb=[]),null==u.__s&&(u.__s=u.state),null!=M.getDerivedStateFromProps&&(u.__s==u.state&&(u.__s=Gf({},u.__s)),Gf(u.__s,M.getDerivedStateFromProps(m,u.__s))),d=u.props,f=u.state,u.__v=e,h)null==M.getDerivedStateFromProps&&null!=u.componentWillMount&&u.componentWillMount(),null!=u.componentDidMount&&u.__h.push(u.componentDidMount);else{if(null==M.getDerivedStateFromProps&&m!==d&&null!=u.componentWillReceiveProps&&u.componentWillReceiveProps(m,v),!u.__e&&null!=u.shouldComponentUpdate&&!1===u.shouldComponentUpdate(m,u.__s,v)||e.__v===n.__v){for(e.__v!==n.__v&&(u.props=m,u.state=u.__s,u.__d=!1),u.__e=!1,e.__e=n.__e,e.__k=n.__k,e.__k.forEach(function(t){t&&(t.__=e)}),x=0;x<u._sb.length;x++)u.__h.push(u._sb[x]);u._sb=[],u.__h.length&&a.push(u);break t}null!=u.componentWillUpdate&&u.componentWillUpdate(m,u.__s,v),null!=u.componentDidUpdate&&u.__h.push(function(){u.componentDidUpdate(d,f,p)})}if(u.context=v,u.props=m,u.__P=t,b=Lf.__r,w=0,"prototype"in M&&M.prototype.render){for(u.state=u.__s,u.__d=!1,b&&b(e),c=u.render(u.props,u.state,u.context),k=0;k<u._sb.length;k++)u.__h.push(u._sb[k]);u._sb=[]}else do{u.__d=!1,b&&b(e),c=u.render(u.props,u.state,u.context),u.state=u.__s}while(u.__d&&++w<25);u.state=u.__s,null!=u.getChildContext&&(i=Gf(Gf({},i),u.getChildContext())),h||null==u.getSnapshotBeforeUpdate||(p=u.getSnapshotBeforeUpdate(d,f)),_=null!=c&&c.type===Qf&&null==c.key?c.props.children:c,op(t,Array.isArray(_)?_:[_],e,n,i,r,o,a,s,l),u.base=e.__e,e.__h=null,u.__h.length&&a.push(u),g&&(u.__E=u.__=null),u.__e=!1}else null==o&&e.__v===n.__v?(e.__k=n.__k,e.__e=n.__e):e.__e=gp(n.__e,e,n,i,r,o,a,l);(c=Lf.diffed)&&c(e)}catch(t){e.__v=null,(l||null!=o)&&(e.__e=s,e.__h=!!l,o[o.indexOf(s)]=null),Lf.__e(t,e,n)}}function pp(t,e){Lf.__c&&Lf.__c(e,t),t.some(function(e){try{t=e.__h,e.__h=[],t.some(function(t){t.call(e)})}catch(t){Lf.__e(t,e.__v)}})}function gp(t,e,n,i,r,o,a,s){var l,c,u,h=n.props,d=e.props,f=e.type,p=0;if("svg"===f&&(r=!0),null!=o)for(;p<o.length;p++)if((l=o[p])&&"setAttribute"in l==!!f&&(f?l.localName===f:3===l.nodeType)){t=l,o[p]=null;break}if(null==t){if(null===f)return document.createTextNode(d);t=r?document.createElementNS("http://www.w3.org/2000/svg",f):document.createElement(f,d.is&&d),o=null,s=!1}if(null===f)h===d||s&&t.data===d||(t.data=d);else{if(o=o&&Ff.call(t.childNodes),c=(h=n.props||Uf).dangerouslySetInnerHTML,u=d.dangerouslySetInnerHTML,!s){if(null!=o)for(h={},p=0;p<t.attributes.length;p++)h[t.attributes[p].name]=t.attributes[p].value;(u||c)&&(u&&(c&&u.__html==c.__html||u.__html===t.innerHTML)||(t.innerHTML=u&&u.__html||""))}if(function(t,e,n,i,r){var o;for(o in n)"children"===o||"key"===o||o in e||up(t,o,null,n[o],i);for(o in e)r&&"function"!=typeof e[o]||"children"===o||"key"===o||"value"===o||"checked"===o||n[o]===e[o]||up(t,o,e[o],n[o],i)}(t,d,h,r,s),u)e.__k=[];else if(p=e.props.children,op(t,Array.isArray(p)?p:[p],e,n,i,r&&"foreignObject"!==f,o,a,o?o[0]:n.__k&&ep(n,0),s),null!=o)for(p=o.length;p--;)null!=o[p]&&Xf(o[p]);s||("value"in d&&void 0!==(p=d.value)&&(p!==t.value||"progress"===f&&!p||"option"===f&&p!==h.value)&&up(t,"value",p,h.value,!1),"checked"in d&&void 0!==(p=d.checked)&&p!==t.checked&&up(t,"checked",p,h.checked,!1))}return t}function mp(t,e,n){try{"function"==typeof t?t(e):t.current=e}catch(t){Lf.__e(t,n)}}function yp(t,e,n){var i,r;if(Lf.unmount&&Lf.unmount(t),(i=t.ref)&&(i.current&&i.current!==t.__e||mp(i,null,e)),null!=(i=t.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(t){Lf.__e(t,e)}i.base=i.__P=null,t.__c=void 0}if(i=t.__k)for(r=0;r<i.length;r++)i[r]&&yp(i[r],e,n||"function"!=typeof t.type);n||null==t.__e||Xf(t.__e),t.__=t.__e=t.__d=void 0}function vp(t,e,n){return this.constructor(t,n)}function xp(){const t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).createElement,e=void 0===t?document.createElement.bind(document):t;let n,i,r=tf();const o={transform:void 0,disableScreenReader:!1},a=ef();return a.element=()=>n,a.root=()=>n,a.settings=t=>(t&&Object.keys(o).forEach(e=>{void 0!==t[e]&&(o[e]=t[e])}),o),a.appendTo=t=>(n||(n=e("div"),n.style.position="absolute",n.style["-webkit-font-smoothing"]="antialiased",n.style["-moz-osx-font-smoothing"]="antialiased",n.style.pointerEvents="none"),t.appendChild(n),n),a.render=t=>{if(!n)return!1;const e="function"==typeof o.transform&&o.transform();if(e){const t=e.horizontalScaling,i=e.horizontalSkewing,r=e.verticalSkewing,o=e.verticalScaling,a=e.horizontalMoving,s=e.verticalMoving;return n.style.transform="matrix(".concat(t,", ").concat(i,", ").concat(r,", ").concat(o,", ").concat(a,", ").concat(s,")"),!0}n.style.transform="";let a;return o.disableScreenReader&&n.setAttribute("aria-hidden",!0),n.style.left="".concat(r.computedPhysical.x,"px"),n.style.top="".concat(r.computedPhysical.y,"px"),n.style.width="".concat(r.computedPhysical.width,"px"),n.style.height="".concat(r.computedPhysical.height,"px"),a=Array.isArray(t)?Jf("div",null,t):t,i=function(t,e,n){var i,r,o;Lf.__&&Lf.__(t,e),r=(i="function"==typeof n)?null:n&&n.__k||e.__k,o=[],fp(e,t=(!i&&n||e).__k=Jf(Qf,null,[t]),r||Uf,Uf,void 0!==e.ownerSVGElement,!i&&n?[n]:r?null:e.firstChild?Ff.call(e.childNodes):null,o,!i&&n?n:r?r.__e:e.firstChild,i),pp(o,t)}(a,n,i),!0},a.renderArgs=[Jf],a.clear=()=>{if(n){let t=n.firstChild;for(;t;)n.removeChild(t),t=n.firstChild;i=null}return a},a.destroy=()=>{n&&n.parentElement&&n.parentElement.removeChild(n),n=null,i=null},a.size=t=>(t&&(r=tf(t)),r),a}Ff=Yf.slice,Lf={__e:function(t,e,n,i){for(var r,o,a;e=e.__;)if((r=e.__c)&&!r.__)try{if((o=r.constructor)&&null!=o.getDerivedStateFromError&&(r.setState(o.getDerivedStateFromError(t)),a=r.__d),null!=r.componentDidCatch&&(r.componentDidCatch(t,i||{}),a=r.__d),a)return r.__E=r}catch(e){t=e}throw t}},$f=0,tp.prototype.setState=function(t,e){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=Gf({},this.state),"function"==typeof t&&(t=t(Gf({},n),this.props)),t&&Gf(n,t),null!=t&&this.__v&&(e&&this._sb.push(e),ip(this))},tp.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),ip(this))},tp.prototype.render=Qf,Bf=[],Wf="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Vf=function(t,e){return t.__v.__b-e.__v.__b},rp.__r=0;var bp=[function(t){t.renderer("svg",Pf)},function(t){t.renderer("canvas",ff)},function(t){t.renderer("dom",xp)}];const wp={OFF:0,ERROR:1,WARN:2,INFO:3,DEBUG:4};const kp=function t(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.level,n=void 0===e?wp.OFF:e,i=t.pipe,r=void 0===i?console:i,o=n;const a={[wp.OFF]:()=>{},[wp.ERROR]:function(){return r.error(...arguments)},[wp.WARN]:function(){return r.warn(...arguments)},[wp.INFO]:function(){return r.info(...arguments)},[wp.DEBUG]:function(){return r.log(...arguments)}},s=function(t){if(t&&!(o<t)){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];(a[t]||a[wp.DEBUG])(...n)}};return{log:s,error:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return s(wp.ERROR,...e)},warn:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return s(wp.WARN,...e)},info:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return s(wp.INFO,...e)},debug:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return s(wp.DEBUG,...e)},level:t=>("number"==typeof t&&(o=t),o),LOG_LEVEL:wp}}(e.logger),r={component:Et(n.component,"component",i),data:Et(n.data,"data",i),formatter:Et(n.formatter,"formatter",i),interaction:Et(n.interaction,"interaction",i),renderer:bs(n.renderer),scale:Et(n.scale,"scale",i),symbol:Et(n.symbol,"symbol",i),logger:i};function o(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t({palettes:e.palettes.concat(n.palettes||[]),style:u({},e.style,n.style),logger:n.logger||e.logger,renderer:n.renderer||e.renderer},r)}return e.renderer&&e.renderer.prio&&r.renderer.default(e.renderer.prio[0]),o.use=function(t){return function(t){t(arguments.length>2?arguments[2]:void 0,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})}(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r)},o.chart=t=>xs(t,{registries:r,logger:i,style:e.style,palettes:e.palettes}),o.config=()=>e,Object.keys(r).forEach(t=>{o[t]=r[t]}),o.version=h,o}({renderer:{prio:["svg","canvas"]},logger:{level:0},style:{"$font-family":"'Source Sans Pro', Arial, sans-serif","$font-size":"12px","$line-height":"16px","$font-size--l":"16px","$font-weight":"normal","$gray-100":"#ffffff","$gray-98":"#f9f9f9","$gray-95":"#f2f2f2","$gray-90":"#e6e6e6","$gray-35":"#595959","$gray-30":"#4d4d4d","$gray-25":"#404040","$gray-20":"#333333","$border-95":"rgba(255, 255, 255, 0.05)","$border-90":"rgba(255, 255, 255, 0.1)","$border-80":"rgba(255, 255, 255, 0.2)","$border-20":"rgba(0, 0, 0, 0.2)","$border-10":"rgba(0, 0, 0, 0.1)","$border-5":"rgba(0, 0, 0, 0.05)","$primary-blue":"#3F8AB3","$primary-green":"#6CB33F","$primary-red":"#DC423F","$primary-orange":"#EF960F","$spacing--s":4,$spacing:8,"$spacing--l":12,"$font-color":"$gray-35","$font-color--inverted":"$gray-90","$guide-color":"$gray-90","$guide-color--inverted":"$gray-35",$border:"$border-80","$border--inverted":"$border-10",$shape:{fill:"$primary-blue",strokeWidth:1,stroke:"$border"},"$shape-outline":{stroke:"$primary-blue",strokeWidth:2},"$shape-guide":{stroke:"$guide-color",strokeWidth:1},"$shape-guide--inverted":{"@extend":"$shape-guide",stroke:"$guide-color--inverted"},$label:{fontSize:"$font-size",fontFamily:"$font-family",fill:"$font-color"},"$label--inverted":{$extend:"$label",fill:"$font-color--inverted"},"$label-overlay":{fontSize:"$font-size--l",fontFamily:"$font-family",fill:"$gray-100",color:"$font-color",stroke:"$guide-color--inverted",strokeWidth:1,borderRadius:4},$title:{"@extend":"$label",fontSize:"$font-size--l",fontWeight:"$font-weight",stroke:"$guide-color--inverted",strokeWidth:0},"$guide-line":{strokeWidth:1,stroke:"$guide-color"},"$guide-line--minor":{strokeWidth:1,stroke:"$gray-95"},"$padding--s":{left:"$spacing--s",right:"$spacing--s",top:"$spacing--s",bottom:"$spacing--s"},$padding:{left:"$spacing",right:"$spacing",top:"$spacing",bottom:"$spacing"},"$selection-area-target":{fill:"$primary-green",strokeWidth:0,opacity:.2}},palettes:[{key:"categorical",colors:[["#a54343","#d76c6c","#ec983d","#ecc43d","#f9ec86","#cbe989","#70ba6e","#578b60","#79d69f","#26a0a7","#138185","#65d3da"]]},{key:"diverging",colors:[["#3d52a1","#3a89c9","#77b7e5","#b4ddf7","#e6f5fe","#ffe3aa","#f9bd7e","#ed875e","#d24d3e","#ae1c3e"]]},{key:"sequential",colors:[["rgb(180,221,212)","rgb(34, 83, 90)"]]}]},{component:ws,data:Rs,formatter:ni,interaction:Cs,renderer:bs(),scale:io,symbol:ua});function _p(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}function Mp(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e);if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Sp(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,i)}return n}function Rp(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Sp(Object(n),!0).forEach(function(e){Mp(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Sp(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function Cp(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var i,r,o,a,s=[],l=!0,c=!1;try{if(o=(n=n.call(t)).next,0===e);else for(;!(l=(i=o.call(n)).done)&&(s.push(i.value),s.length!==e);l=!0);}catch(t){c=!0,r=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return _p(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_p(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}Th.forEach(kp.use),bp.forEach(kp.use),[].forEach(kp.use);var Np=Object.prototype.hasOwnProperty,Dp=Object.prototype.toString,qp=Object.defineProperty,Ep=Object.getOwnPropertyDescriptor,Op=function(t){return"function"==typeof Array.isArray?Array.isArray(t):"[object Array]"===Dp.call(t)},Ap=function(t){if(!t||"[object Object]"!==Dp.call(t))return!1;var e,n=Np.call(t,"constructor"),i=t.constructor&&t.constructor.prototype&&Np.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!i)return!1;for(e in t);return void 0===e||Np.call(t,e)},zp=function(t,e){qp&&"__proto__"===e.name?qp(t,e.name,{enumerable:!0,configurable:!0,value:e.newValue,writable:!0}):t[e.name]=e.newValue},Tp=function(t,e){if("__proto__"===e){if(!Np.call(t,e))return;if(Ep)return Ep(t,e).value}return t[e]},Ip=function t(){var e,n,i,r,o,a,s=arguments[0],l=1,c=arguments.length,u=!1;for("boolean"==typeof s&&(u=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l<c;++l)if(null!=(e=arguments[l]))for(n in e)i=Tp(s,n),s!==(r=Tp(e,n))&&(u&&r&&(Ap(r)||(o=Op(r)))?(o?(o=!1,a=i&&Op(i)?i:[]):a=i&&Ap(i)?i:{},zp(s,{name:n,newValue:t(u,a,r)})):void 0!==r&&zp(s,{name:n,newValue:r}));return s};function jp(t,e,n,i){if(!t)return-1;const r=n.cache,o=t.origin?t.origin():null;o&&(t=o);let a=r.fields.indexOf(t),s=-1,l=-1;if(-1===a)for(let e=0;e<r.wrappedFields.length;e++)if(l=r.wrappedFields[e].attrDims.map(t=>t.instance).indexOf(t),s=r.wrappedFields[e].attrExps.map(t=>t.instance).indexOf(t),-1!==l||-1!==s){a=e;break}if(Array.isArray(i)&&i.some((t,e)=>t!==e)){const t=i.indexOf(a);-1!==t&&(a=t)}return a-=e.qArea.qLeft,a<0||a>=e.qArea.qWidth?-1:l>=0?t=>t[a].qAttrDims.qValues[l]:s>=0?t=>t[a].qAttrExps.qValues[s]:t=>t[a]}function Pp(t,e,n){let i=n.key;const r={value:"function"==typeof t.value?t.value(e):void 0!==t.value?t.value:e};return r.label="function"==typeof t.label?t.label(e):void 0!==t.label?String(t.label):String(r.value),t.field&&(r.source={key:i,field:t.field.key()}),r}function Fp(t){let e=t.cache,n=t.f,i=t.mainCell,r=t.p,o=t.page,a=t.rowIdx,s=t.row,l=t.sourceKey,c=t.target,u=t.targetProp,h=t.columnOrder,d=i;if(r.field&&r.field!==n){const t=jp(r.field,o,{cache:e},h);if(-1===t)return;d=Ip({qRow:a},t(s))}c[u]=Pp(r,d,{key:l})}function Lp(t,e,n,i){const r=Array.isArray(t)?t:[t];let o=[];for(let t=0;t<r.length;t++)if(void 0!==r[t].field){const a=e.raw(),s=e.key(),l="object"==typeof r[t].field?r[t].field:e.field(r[t].field),c=i.normalizeConfig(r[t],e),u=c.props,h=c.main,d=Object.keys(u),f=!!r[t].trackBy,p=typeof r[t].trackBy,g={},m=[],y=[];for(let e=0;e<a.qDataPages.length;e++){const o=jp(l,a.qDataPages[e],{cache:n},a.qColumnOrder);if(-1!==o)for(let c=0;c<a.qDataPages[e].qMatrix.length;c++){const v=a.qDataPages[e].qArea.qTop+c,x=Ip({qRow:v},o(a.qDataPages[e].qMatrix[c])),b=Pp(h,x,{key:s});if(!(h.filter&&!h.filter(x))){for(let t=0;t<d.length;t++){const i=u[d[t]];let r=i.fields||[i];i.fields&&(b[d[t]]=[]);for(let o=0;o<r.length;o++)Fp({cache:n,f:l,mainCell:x,p:r[o],prop:d[t],page:a.qDataPages[e],rowIdx:v,row:a.qDataPages[e].qMatrix[c],sourceKey:s,target:i.fields?b[d[t]]:b,targetProp:i.fields?o:d[t],columnOrder:a.qColumnOrder});if(i.fields){const e=b[d[t]].map(t=>t.value),n=b[d[t]].map(t=>t.label);b[d[t]]={value:"function"==typeof i.value?i.value(e):void 0!==i.value?i.value:e,label:"function"==typeof i.label?i.label(n):void 0!==i.label?String(i.label):String(b[d[t]].value)}}}f&&i.track({cfg:r[t],itemData:x,obj:b,target:m,tracker:g,trackType:p}),y.push(b)}}}const v=f?i.collect(m,{main:h,propsArr:d,props:u}):y;o=[...o,...v]}return o}function $p(t){var e=0,n=t.children,i=n&&n.length;if(i)for(;--i>=0;)e+=n[i].value;else e=1;t.value=e}function Bp(t,e){t instanceof Map?(t=[void 0,t],void 0===e&&(e=Wp)):void 0===e&&(e=Hp);for(var n,i,r,o,a,s=new Yp(t),l=[s];n=l.pop();)if((r=e(n.data))&&(a=(r=Array.from(r)).length))for(n.children=r,o=a-1;o>=0;--o)l.push(i=r[o]=new Yp(r[o])),i.parent=n,i.depth=n.depth+1;return s.eachBefore(Up)}function Hp(t){return t.children}function Wp(t){return Array.isArray(t)?t[1]:null}function Vp(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function Up(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function Yp(t){this.data=t,this.depth=this.height=0,this.parent=null}function Kp(t){return null==t?null:function(t){if("function"!=typeof t)throw new Error;return t}(t)}Yp.prototype=Bp.prototype={constructor:Yp,count:function(){return this.eachAfter($p)},each:function(t,e){let n=-1;for(const i of this)t.call(e,i,++n,this);return this},eachAfter:function(t,e){for(var n,i,r,o=this,a=[o],s=[],l=-1;o=a.pop();)if(s.push(o),n=o.children)for(i=0,r=n.length;i<r;++i)a.push(n[i]);for(;o=s.pop();)t.call(e,o,++l,this);return this},eachBefore:function(t,e){for(var n,i,r=this,o=[r],a=-1;r=o.pop();)if(t.call(e,r,++a,this),n=r.children)for(i=n.length-1;i>=0;--i)o.push(n[i]);return this},find:function(t,e){let n=-1;for(const i of this)if(t.call(e,i,++n,this))return i},sum:function(t){return this.eachAfter(function(e){for(var n=+t(e.data)||0,i=e.children,r=i&&i.length;--r>=0;)n+=i[r].value;e.value=n})},sort:function(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})},path:function(t){for(var e=this,n=function(t,e){if(t===e)return t;var n=t.ancestors(),i=e.ancestors(),r=null;t=n.pop(),e=i.pop();for(;t===e;)r=t,t=n.pop(),e=i.pop();return r}(e,t),i=[e];e!==n;)e=e.parent,i.push(e);for(var r=i.length;t!==n;)i.splice(r,0,t),t=t.parent;return i},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){return Array.from(this)},leaves:function(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t},links:function(){var t=this,e=[];return t.each(function(n){n!==t&&e.push({source:n.parent,target:n})}),e},copy:function(){return Bp(this).eachBefore(Vp)},[Symbol.iterator]:function*(){var t,e,n,i,r=this,o=[r];do{for(t=o.reverse(),o=[];r=t.pop();)if(yield r,e=r.children)for(n=0,i=e.length;n<i;++n)o.push(e[n])}while(o.length)}};var Gp={depth:-1},Xp={},Jp={};function Zp(t){return t.id}function Qp(t){return t.parentId}function tg(){var t,e=Zp,n=Qp;function i(i){var r,o,a,s,l,c,u,h,d=Array.from(i),f=e,p=n,g=new Map;if(null!=t){const e=d.map((e,n)=>function(t){t=`${t}`;let e=t.length;ng(t,e-1)&&!ng(t,e-2)&&(t=t.slice(0,-1));return"/"===t[0]?t:`/${t}`}(t(e,n,i))),n=e.map(eg),r=new Set(e).add("");for(const t of n)r.has(t)||(r.add(t),e.push(t),n.push(eg(t)),d.push(Jp));f=(t,n)=>e[n],p=(t,e)=>n[e]}for(a=0,r=d.length;a<r;++a)o=d[a],c=d[a]=new Yp(o),null!=(u=f(o,a,i))&&(u+="")&&(h=c.id=u,g.set(h,g.has(h)?Xp:c)),null!=(u=p(o,a,i))&&(u+="")&&(c.parent=u);for(a=0;a<r;++a)if(u=(c=d[a]).parent){if(!(l=g.get(u)))throw new Error("missing: "+u);if(l===Xp)throw new Error("ambiguous: "+u);l.children?l.children.push(c):l.children=[c],c.parent=l}else{if(s)throw new Error("multiple roots");s=c}if(!s)throw new Error("no root");if(null!=t){for(;s.data===Jp&&1===s.children.length;)s=s.children[0],--r;for(let t=d.length-1;t>=0&&(c=d[t]).data===Jp;--t)c.data=null}if(s.parent=Gp,s.eachBefore(function(t){t.depth=t.parent.depth+1,--r}).eachBefore(Up),s.parent=null,r>0)throw new Error("cycle");return s}return i.id=function(t){return arguments.length?(e=Kp(t),i):e},i.parentId=function(t){return arguments.length?(n=Kp(t),i):n},i.path=function(e){return arguments.length?(t=Kp(e),i):t},i}function eg(t){let e=t.length;if(e<2)return"";for(;--e>1&&!ng(t,e););return t.slice(0,e)}function ng(t,e){if("/"===t[e]){let n=0;for(;e>0&&"\\"===t[--e];)++n;if(!(1&n))return!0}return!1}function ig(t,e){"/"===t.charAt(0)&&(t=t.substring(1));const n=t.split("/");let i,r=e;for(let t=0;t<n.length;t++){if("*"===n[t]&&Array.isArray(r)){const e=[];i=n.slice(t+1).join("/");for(let t=0;t<r.length;t++){let n=ig(i,r[t]);Array.isArray(n)?e.push(...n):e.push(n)}return e}if(!n[t]&&Array.isArray(r)){const e=new Array(r.length);i=n.slice(t+1).join("/");for(let t=0;t<r.length;t++)e[t]=ig(i,r[t]);return e}n[t]in r&&(r=r[n[t]])}return r}function rg(t,e,n){let i=[];if(!t||!t.length)return i;if(e<=0){const e=n>=0?[t[n]]:t;i=[...i,...e]}else for(let r=0;r<t.length;r++)t[r].children&&t[r].children.length&&(i=[...i,...rg(t[r].children,e-1,n)]);return i}function og(t,e,n){if(t===e)return t=>t;if(t>e){const n=Math.max(0,Math.min(100,t-e));return t=>{let e=t;for(let t=0;t<n;++t)e=e.parent;return e}}if(e>t){const i=Math.max(0,Math.min(100,e-t));return t=>rg(t.children,i-1,n)}return!1}const ag=/^qDimensionInfo(?:\/(\d+))?/,sg=/^\/?qMeasureInfo\/(\d+)/,lg=/\/qAttrExprInfo\/(\d+)/,cg=/\/qAttrDimInfo\/(\d+)/;function ug(t){const e=t.qColumnOrder&&t.qColumnOrder.length?t.qColumnOrder:t.qDimensionInfo.map((t,e)=>e);return e.filter(e=>e<t.qDimensionInfo.length)}function hg(t,e){let n=e.cube;if(!t)return-1;let i=t.origin&&t.origin()?t.origin().key():t.key(),r=!1,o=-1,a=-1,s=-1,l=-1,c=-1,u=-1,h=i;const d=n.qEffectiveInterColumnSortOrder,f=ug(n);return ag.test(h)&&(r=!0,o=+ag.exec(h)[1],h=i.replace(ag,"")),sg.test(h)&&("K"===n.qMode?c=+sg.exec(h)[1]:d&&-1!==d.indexOf(-1)?(c=+sg.exec(h)[1],u=0):u=+sg.exec(h)[1],h=h.replace(sg,"")),h&&(cg.exec(h)?s=+cg.exec(h)[1]:lg.exec(h)&&(a=+lg.exec(h)[1])),l=r?"S"===n.qMode?f[o]:d?d.indexOf(o):o:d&&-1!==d.indexOf(-1)?d.indexOf(-1):n.qDimensionInfo.length-("K"===n.qMode?0:1),{fieldDepth:l+1,pseudoMeasureIndex:c,measureIdx:u,attrDimIdx:s,attrIdx:a}}function dg(t,e){let n,i,r=og(t.fieldDepth,e.fieldDepth,e.pseudoMeasureIndex);return n=e.measureIdx>=0?t=>t.data.qValues[e.measureIdx]:t=>t.data,e.attrDimIdx>=0?i=t=>{var n;return null==t||null===(n=t.qAttrDims)||void 0===n?void 0:n.qValues[e.attrDimIdx]}:e.attrIdx>=0&&(i=t=>{var n;return null==t||null===(n=t.qAttrExps)||void 0===n?void 0:n.qValues[e.attrIdx]}),{nodeFn:r,attrFn:i,valueFn:n}}function fg(t,e,n){let i=n.key;const r={value:"function"==typeof t.value?t.value(e):void 0!==t.value?t.value:e};return r.label="function"==typeof t.label?t.label(e):void 0!==t.label?String(t.label):String(r.value),t.field&&(r.source={key:i,field:t.field.key()}),r}function pg(t){let e=t.propsArr,n=t.props,i=t.item,r=t.itemData,o=t.ret,a=t.sourceKey;for(let t=0;t<e.length;t++){const s=n[e[t]],l=s.fields||[s];let c,u;s.fields&&(c=[],u=[]);for(let n=0;n<l.length;n++){const h=l[n];let d,f,p,g,m,y;if("primitive"===h.type?(p=h.value,y=String(h.value)):("function"==typeof h.value&&(d=t=>h.value(t,i)),"function"==typeof h.label&&(f=t=>h.label(t,i)),h.accessor?(g=h.accessor(i),Array.isArray(g)?(m=g.map(h.valueAccessor),h.attrAccessor&&(m=m.map(h.attrAccessor)),d&&(p=m.map(d),d=null),f&&(y=m.map(f),f=null),p=h.reduce?h.reduce(p):p,y=h.reduceLabel?h.reduceLabel(y,p):String(p)):(p=h.attrAccessor?h.attrAccessor(h.valueAccessor(g)):h.valueAccessor(g),y=p)):(p=r,y=r)),s.fields){const t=d?d(p):p;c.push(t),u.push(f&&null!=y?f(y):null!=y?y:String(t))}else{const n=d?d(p):p;o[e[t]]={value:n,label:f?f(y):null!=y?y:String(n)},h.field&&(o[e[t]].source={field:h.field.key(),key:a})}}c&&(o[e[t]]={value:"function"==typeof s.value?s.value(c,i):c,label:"function"==typeof s.label?s.label(u,i):u})}}const gg=(t,e,n)=>{const i="K"===t.qMode?"/qStackedDataPages/*/qData":"/qTreeDataPages/*",r="K"===t.qMode?"qSubNodes":"qNodes",o=ig(i,t);return o&&o[0]?(e.tree=Bp(o[0],n.children||(t=>t[r])),e.tree):null};const mg=t=>{let e=t.propsArr,n=t.props,i=t.cube;t.cache;let r=t.itemDepthObject,o=t.f;for(let t=0;t<e.length;t++){const a=n[e[t]],s=a.fields?a.fields:[a];for(let t=0;t<s.length;t++){const e=s[t];if(e.field!==o){const t=dg(r,hg(e.field,{cube:i}));e.accessor=t.nodeFn,e.valueAccessor=t.valueFn,e.attrAccessor=t.attrFn}}}};function yg(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;const r=e.raw(),o=e.key(),a="S"===r.qMode?function(t){const e=t.raw().qDataPages.length?t.raw().qDataPages[0].qMatrix:[],n=function(t){const e=t.raw().qColumnOrder,n=t.fields();return e&&e.length===n.length?e:n.map((t,e)=>e)}(t),i=t.fields(),r=t.fields().filter(t=>"dimension"===t.type()).map(t=>n.indexOf(i.indexOf(t))),o=t.fields().filter(t=>"measure"===t.type()).map(t=>n.indexOf(i.indexOf(t))),a={__root:{__id:"__root",qValues:[]}};for(let t=0;t<e.length;t++){const n=e[t];let i="__root",l=!1;for(let t=0;t<r.length;t++){var s;const e=n[r[t]],o="".concat(i,"__").concat(null!==(s=e.qElemNumber)&&void 0!==s?s:e.qElemNo);a[o]||(a[o]=Rp({__id:o,__parent:i,qValues:[]},e),l=!0),i=o}if(l)for(let t=0;t<o.length;t++){const e=n[o[t]];a[i].qValues.push(e)}}const l=Object.keys(a).map(t=>a[t]);return tg().id(t=>t.__id).parentId(t=>t.__parent)(l)}(e):gg(r,n,t);if(!a)return null;const s=a.height,l=[];for(let o=0;o<=s;o++){let a=null;if(o>0)if("S"===r.qMode){let t=ug(r)[o-1];a=n.fields[t]}else{let t=r.qEffectiveInterColumnSortOrder[o-1];o>r.qEffectiveInterColumnSortOrder.length&&(t=r.qDimensionInfo.length),a=n.fields[t]}const s=i.normalizeConfig(Rp(Rp({},t),{},{field:a?a.key():void 0}),e),c=s.props,u=s.main,h=Object.keys(c);l[o]={propsArr:h,props:c,main:u};const d=a?hg(a,{cube:r}):{fieldDepth:0};mg({propsArr:h,props:c,cube:r,cache:n,itemDepthObject:d,f:a})}const c=a.copy().descendants(),u=a.descendants();for(let t=0;t<u.length;t++){const e=l[u[t].depth].propsArr,n=l[u[t].depth].props,i=l[u[t].depth].main,r=c[t],a=r.data,s=fg(i,a,{key:o});pg({propsArr:e,props:n,item:r,itemData:a,ret:s,sourceKey:o}),u[t].data=s}return a}function vg(t,e,n,i){const r=Array.isArray(t)?t:[t];let o=[];for(let a=0;a<r.length;a++)if(void 0!==r[a].field){const s=e.raw(),l=e.key();if(!gg(s,n,t))continue;const c="object"==typeof r[a].field?r[a].field:e.field(r[a].field),u=i.normalizeConfig(r[a],e),h=u.props,d=u.main,f=Object.keys(h),p=hg(c,{cube:s}),g=dg({fieldDepth:0},p),m=g.nodeFn,y=g.attrFn,v=g.valueFn;mg({propsArr:f,props:h,cube:s,cache:n,itemDepthObject:p,f:c});const x=!!r[a].trackBy,b=typeof r[a].trackBy,w={},k=[],_=m(n.tree),M=[];for(let t=0;t<_.length;t++){const e=_[t],n=y?y(v(e)):v(e);if(d.filter&&!d.filter(n))continue;const o=fg(d,n,{key:l});pg({propsArr:f,props:h,item:e,itemData:n,ret:o,sourceKey:l}),x&&i.track({cfg:r[a],itemData:n,obj:o,target:k,tracker:w,trackType:b}),M.push(o)}const S=x?i.collect(k,{main:d,propsArr:f,props:h}):M;o=[...o,...S]}return o}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var xg=function(t,e){return t(e={exports:{}},e.exports),e.exports}(function(t){
7
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("@nebula.js/stardust")):"function"==typeof define&&define.amd?define(["@nebula.js/stardust"],t):(e="undefined"!=typeof globalThis?globalThis:e||self)["sn-funnel-chart"]=t(e.stardust)}(this,function(e){"use strict";var t={Common_Measures:{id:"Common.Measures",locale:{"de-DE":"Kennzahlen","en-US":"Measures","es-ES":"Medidas","fr-FR":"Mesures","it-IT":"Misure","ja-JP":"メジャー","ko-KR":"측정값","nl-NL":"Metingen","pl-PL":"Miary","pt-BR":"Medidas","ru-RU":"Меры","sv-SE":"Mått","tr-TR":"Hesaplamalar","zh-CN":"度量","zh-TW":"量值"}},Object_ChartTooltip_ColorExpression:{id:"Object.ChartTooltip.ColorExpression",locale:{"de-DE":"Farbformel","en-US":"Color expression","es-ES":"Expresión de color","fr-FR":"Expression de couleur","it-IT":"Espressione colore","ja-JP":"カラー表現","ko-KR":"색상 표현식","nl-NL":"Kleuruitdrukking","pl-PL":"Wyrażenie koloru","pt-BR":"Expressão de cor","ru-RU":"Выражение для цвета","sv-SE":"Färguttryck","tr-TR":"Renk ifadesi","zh-CN":"颜色表达式","zh-TW":"色彩運算式"}},Object_ChartTooltip_NMore:{id:"Object.ChartTooltip.NMore",locale:{"de-DE":"+{0} mehr","en-US":"+{0} more","es-ES":"+{0} más","fr-FR":"+{0} plus","it-IT":"+{0} altre","ja-JP":"さらに +{0}","ko-KR":"{0} 이상","nl-NL":"+{0} meer","pl-PL":"Jeszcze {0}","pt-BR":"+{0} mais","ru-RU":"Еще +{0}","sv-SE":"Fler än {0} ytterligare","tr-TR":"+{0} daha","zh-CN":"+{0} 以上","zh-TW":"其他 +{0} 個"}},Object_ChartTooltip_sumOfNegatives:{id:"Object.ChartTooltip.sumOfNegatives",locale:{"de-DE":"Summe negativer Werte","en-US":"Sum of negatives","es-ES":"Suma de negativos","fr-FR":"Somme des valeurs négatives","it-IT":"Somma valori negativi","ja-JP":"負の合計","ko-KR":"음수 합계","nl-NL":"Som negatieven","pl-PL":"Suma ujemnych","pt-BR":"Soma de negativos","ru-RU":"Сумма отрицательных значений","sv-SE":"Summan av negativa","tr-TR":"Negatif değerlerin toplamı","zh-CN":"负值总和","zh-TW":"負數總和"}},Object_ChartTooltip_sumOfPositives:{id:"Object.ChartTooltip.sumOfPositives",locale:{"de-DE":"Summe positiver Werte","en-US":"Sum of positives","es-ES":"Suma de positivos","fr-FR":"Sommes des valeurs positives","it-IT":"Somma valori positivi","ja-JP":"正の合計","ko-KR":"양수 합계","nl-NL":"Som positieven","pl-PL":"Suma dodatnich","pt-BR":"Soma de positivos","ru-RU":"Сумма положительных значений","sv-SE":"Summan av positiva","tr-TR":"Pozitif değerlerin toplamı","zh-CN":"正值总和","zh-TW":"正數總和"}},Object_Disclaimer_DataRangeIncludingZero:{id:"Object.Disclaimer.DataRangeIncludingZero",locale:{"de-DE":"Die logarithmische Skala wurde durch die lineare Skala ersetzt, weil der Datenbereich NULL enthält.","en-US":"The logarithmic scale has been replaced by a linear scale because the data range includes zero.","es-ES":"La escala logarítmica ha sido reemplazada por una escala lineal porque el rango de datos incluye cero.","fr-FR":"L'échelle logarithmique a été remplacée par une échelle linéaire, car la plage de données comprend la valeur zéro.","it-IT":"La scala logaritmica è stata sostituita da una scala lineare perché l'intervallo di dati include zero.","ja-JP":"データ範囲にゼロが含まれるため、Log スケールは Linear スケールで置換されています。","ko-KR":"데이터 범위에 0이 포함되어 있으므로 로그 눈금이 선형 눈금으로 바뀌었습니다.","nl-NL":"De logaritmische schaal is vervangen door een lineaire schaal omdat het gegevensbereik nullen bevat.","pl-PL":"Skala logarytmiczna została zastąpiona liniową, ponieważ zakres danych zawiera zero.","pt-BR":"A escala logarítmica foi substituída por uma escala linear, pois o intervalo de dados inclui zero.","ru-RU":"Логарифмический масштаб заменен линейным масштабом, поскольку диапазон данных включает ноль.","sv-SE":"Den logaritmiska skalan har ersatts av en linjär skala eftersom dataintervallet innehåller värdet noll.","tr-TR":"Veri aralığı sıfır değerini içerdiğinden, logaritmik ölçek yerine doğrusal ölçek kullanıldı.","zh-CN":"对数刻度已替换为线性刻度,因为该数据范围包括零。","zh-TW":"對數刻度已遭線性刻度取代,因為資料範圍包含零。"}},Object_Disclaimer_LimitedData:{id:"Object.Disclaimer.LimitedData",locale:{"de-DE":"Zurzeit wird nur ein beschränkter Datensatz angezeigt.","en-US":"Currently showing a limited data set.","es-ES":"Mostrando actualmente un conjunto limitado de datos.","fr-FR":"Affichage d'un ensemble de données limité pour l'instant.","it-IT":"Attualmente viene visualizzata una serie di dati limitata.","ja-JP":"現在、限定的なデータ セットを表示しています。","ko-KR":"현재 제한된 데이터 집합을 표시하고 있습니다.","nl-NL":"Momenteel wordt een beperkte gegevensverzameling getoond.","pl-PL":"Aktualnie przedstawiany jest ograniczony zestaw danych.","pt-BR":"Mostrando um conjunto de dados limitado.","ru-RU":"В настоящее время отображается ограниченный набор данных.","sv-SE":"Just nu visas en begränsad datauppsättning.","tr-TR":"Şu anda sınırlı bir veri kümesi gösteriliyor.","zh-CN":"当前正显示有限的数据集。","zh-TW":"目前顯示的是有限的資料集。"}},Object_Disclaimer_NegativeOrZeroValues:{id:"Object.Disclaimer.NegativeOrZeroValues",locale:{"de-DE":"Die in den Datensätzen enthaltenen negativen oder 0-Werte können nicht in diesem Diagramm dargestellt werden.","en-US":"The data set contains negative or zero values that cannot be shown in this chart.","es-ES":"El conjunto de datos contiene valores cero o negativos que no se pueden mostrar en este gráfico.","fr-FR":"L'ensemble de données contient des valeurs négatives ou égales à zéro impossibles à afficher dans ce graphique.","it-IT":"La serie di dati contiene valori negativi o uguali a zero che non possono essere visualizzati in questo grafico.","ja-JP":"データ セットには、本チャートに表示できない負の値またはゼロ値が含まれています。","ko-KR":"데이터 집합에 해당 차트에 표시할 수 없는 음수 값 또는 zero 값이 포함되어 있습니다.","nl-NL":"De gegevensverzameling bevat negatieve waarden of nulwaarden die niet kunnen worden weergegeven in deze diagram.","pl-PL":"Zestaw danych zawiera wartości ujemne lub zerowe, których nie można przedstawić w tym wykresie.","pt-BR":"O conjunto de dados contém valores negativos ou iguais a zero que não podem ser mostrados neste gráfico.","ru-RU":"Набор данных содержит отрицательные или нулевые значения, которые невозможно показать в этой диаграмме.","sv-SE":"Datauppsättningen innehåller negativa värden eller nollvärden som inte kan visas i detta diagram.","tr-TR":"Veri kümesi, bu grafikte gösterilemeyen negatif veya sıfır değerlerini içeriyor.","zh-CN":"数据集中包含无法在此图表中显示的负值或零值。","zh-TW":"資料集包含無法在此圖表中顯示的負值或零值。"}},Object_Disclaimer_NegativeValues:{id:"Object.Disclaimer.NegativeValues",locale:{"de-DE":"Die in den Datensätzen enthaltenen negativen Werte können nicht in diesem Diagramm dargestellt werden.","en-US":"The data set contains negative values that cannot be shown in this chart.","es-ES":"El conjunto de datos contiene valores negativos que no se pueden mostrar en este gráfico.","fr-FR":"Le jeu de données contient des valeurs négatives impossibles à afficher dans ce graphique.","it-IT":"Il set di dati contiene valori negativi che non possono essere visualizzati in questo grafico.","ja-JP":"このチャートには表示できない負の値がデータ セットに含まれています。","ko-KR":"데이터 집합에 해당 차트에 표시할 수 없는 음수 값이 포함되어 있습니다.","nl-NL":"De gegevensverzameling bevat negatieve waarden die niet kunnen worden weergegeven in dit diagram.","pl-PL":"Zestaw danych zawiera wartości ujemne, których nie można przedstawić na tym wykresie.","pt-BR":"O conjunto de dados contém valores negativos que não podem ser mostrados neste gráfico.","ru-RU":"Набор данных содержит отрицательные значения, которые нельзя отобразить на этой диаграмме.","sv-SE":"Datauppsättningen innehåller negativa värden som inte kan visas i det här diagrammet.","tr-TR":"Veri kümesi, bu grafikte gösterilemeyen negatif değerleri içeriyor.","zh-CN":"数据集包含无法在此图表中显示的负值。","zh-TW":"資料集包含無法在此圖表中顯示的負值。"}},Object_Disclaimer_NoDataExist:{id:"Object.Disclaimer.NoDataExist",locale:{"de-DE":"Die Auswahlen haben für dieses Diagramm keine Daten generiert.","en-US":"The selections generated no data for this chart.","es-ES":"Las selecciones no han generado datos para este gráfico.","fr-FR":"Les sélections n'ont pas généré de données pour ce graphique.","it-IT":"Le selezioni non hanno generato dati per questo grafico.","ja-JP":"このチャートには選択からデータが生成されませんでした。","ko-KR":"선택 내용으로 이 차트에 대한 데이터가 생성되지 않았습니다.","nl-NL":"De selecties hebben geen gegevens voor de diagram gegenereerd.","pl-PL":"Wymiary nie spowodowały wygenerowania danych dla tego wykresu.","pt-BR":"As seleções não geraram dados para este gráfico.","ru-RU":"В результате выборок данные для этой диаграммы не созданы.","sv-SE":"Urvalen genererade inga data för detta diagram.","tr-TR":"Seçimler bu grafik için hiç veri oluşturmadı.","zh-CN":"选择未生成此图表的数据。","zh-TW":"此選項無法產生任何適用於此圖表的資料。"}},Object_Disclaimer_OnlyNanColor:{id:"Object.Disclaimer.OnlyNanColor",locale:{"de-DE":"Die verwendeten Daten für die Farbgebung dieser Visualisierung enthalten undefinierte Werte.","en-US":"The data used to color this visualization only contains undefined values.","es-ES":"Los datos utilizados para colorear esta visualización solo contienen valores indefinidos.","fr-FR":"Les données utilisées pour colorer cette visualisation ne comportent que des valeurs non définies.","it-IT":"I dati utilizzati per colorare questa visualizzazione contengono solo valori non definiti.","ja-JP":"このビジュアライゼーションの色の割り当てに使用したデータには、未定義の値が含まれています。","ko-KR":"이 시각화에 색을 지정하는 데 사용된 데이터에는 정의되지 않은 값만 포함되어 있습니다.","nl-NL":"De gegevens die worden gebruikt om deze visualisatie kleur te geven bevatten uitsluitend ongedefinieerde waarden.","pl-PL":"Dane używane do kolorowania tej wizualizacji zawierają wyłącznie niezdefiniowane wartości.","pt-BR":"Os dados usados para colorir esse visualização contém somente valores indefinidos.","ru-RU":"Данные, используемые для выбора цвета визуализации, содержат только неопределенные значения.","sv-SE":"Data som används för att färgsätta denna visualisering innehåller enbart odefinierade värden.","tr-TR":"Bu görselleştirmeyi renklendirmek için kullanılan veriler yalnızca tanımlanmamış değerler içeriyor.","zh-CN":"用于将该可视化着色的数据仅包含未定义的值。","zh-TW":"用以定義此視覺化的色彩的資料只包含未定義的值。"}},Object_Disclaimer_OnlyNanData:{id:"Object.Disclaimer.OnlyNanData",locale:{"de-DE":"Das Diagramm wird nicht angezeigt, da es nur nicht definierte Werte enthält.","en-US":"The chart is not displayed because it contains only undefined values.","es-ES":"El gráfico no se muestra porque solo contiene valores indefinidos.","fr-FR":"Le graphique n'est pas affiché, car il contient uniquement des valeurs non définies.","it-IT":"Il grafico non è visualizzato poiché contiene solo valori non definiti.","ja-JP":"未定義の値しか含まれていないため、チャートは表示されていません。","ko-KR":"정의되지 않은 값만 포함되어 있으므로 차트가 표시되지 않습니다.","nl-NL":"De diagram wordt niet weergegeven omdat deze alleen ongedefinieerde waarden bevat.","pl-PL":"Wykres nie jest wyświetlany, ponieważ zawiera wyłącznie wartości niezdefiniowane.","pt-BR":"O gráfico não foi exibido, porque contém apenas valores não definidos.","ru-RU":"Диаграмма не отображается, поскольку она содержит только неопределенные значения.","sv-SE":"Diagrammet visas inte eftersom det enbart innehåller odefinierade värden.","tr-TR":"Yalnızca tanımsız değerleri içermesi nedeniyle grafik görüntülenmiyor.","zh-CN":"未显示图表,因为它仅包含未定义的值。","zh-TW":"系統不會顯示圖表,因為該圖表僅包含未定義的值。"}},Object_Disclaimer_OnlyNegativeOrZeroValues:{id:"Object.Disclaimer.OnlyNegativeOrZeroValues",locale:{"de-DE":"Das Diagramm wird nicht angezeigt, da es nur negative oder 0-Werte enthält.","en-US":"The chart is not displayed because it contains only negative or zero values.","es-ES":"El gráfico no se muestra porque solo contiene valores negativos o valores cero.","fr-FR":"Le graphique n'est pas affiché, car il contient uniquement des valeurs négatives ou égales à zéro.","it-IT":"Il grafico non viene visualizzato poiché contiene solo valori negativi o uguali a zero.","ja-JP":"チャートは負の値またはゼロ値しか含まれていないため、表示されていません。","ko-KR":"음수 또는 zero 값만 포함되어 있으므로 차트가 표시되지 않습니다.","nl-NL":"De diagram wordt niet weergegeven omdat deze alleen negatieve waarden of nulwaarden bevat.","pl-PL":"Wykres nie jest wyświetlany, ponieważ zawiera wyłącznie wartości ujemne lub zerowe.","pt-BR":"O gráfico não foi exibido, porque contém apenas valores negativos ou zero.","ru-RU":"Диаграмма не отображается, поскольку она содержит только отрицательные или нулевые значения.","sv-SE":"Diagrammet visas inte eftersom det enbart innehåller negativa värden eller nollvärden","tr-TR":"Yalnızca negatif veya sıfır değerlerini içermesi nedeniyle grafik görüntülenmiyor.","zh-CN":"未显示图表,因为它仅包含负值或零值。","zh-TW":"系統不會顯示圖表,因為該圖表僅包含負值或零值。"}},Object_Disclaimer_OnlyNegativeValues:{id:"Object.Disclaimer.OnlyNegativeValues",locale:{"de-DE":"Das Diagramm wird nicht angezeigt, da es nur negative oder Werte enthält.","en-US":"The chart is not displayed because it contains only negative values.","es-ES":"El gráfico no se muestra porque solo contiene valores negativos.","fr-FR":"Le graphique n'est pas affiché, car il contient uniquement des valeurs négatives.","it-IT":"Il grafico non viene visualizzato poiché contiene solo valori negativi.","ja-JP":"負の値しか含まれていないため、チャートは表示されていません。","ko-KR":"음수 값만 포함되어 있으므로 차트가 표시되지 않습니다.","nl-NL":"Het diagram wordt niet weergegeven omdat deze alleen negatieve waarden bevat.","pl-PL":"Wykres nie jest wyświetlany, ponieważ zawiera wyłącznie wartości ujemne.","pt-BR":"O gráfico não é exibido porque contém apenas valores negativos.","ru-RU":"Диаграмма не отображается, поскольку она содержит только отрицательные значения.","sv-SE":"Diagrammet visas inte eftersom det endast innehåller negativa värden.","tr-TR":"Yalnızca negatif değerleri içermesi nedeniyle grafik görüntülenmiyor.","zh-CN":"未显示图表,因为它仅包含负值。","zh-TW":"系統不會顯示圖表,因為該圖表僅包含負值。"}},Object_ErrorMessage_MissingDimension:{id:"Object.ErrorMessage.MissingDimension",locale:{"de-DE":"Dimension nicht gefunden","en-US":"Dimension not found","es-ES":"No se ha encontrado la dimensión","fr-FR":"Dimension introuvable","it-IT":"Dimensione non trovata","ja-JP":"軸が見つかりません","ko-KR":"차원을 찾지 못했습니다.","nl-NL":"Dimensie niet gevonden","pl-PL":"Wymiar nie został znaleziony","pt-BR":"Dimensão não encontrada","ru-RU":"Измерение не найдено","sv-SE":"Dimensionen hittades inte","tr-TR":"Boyut bulunamadı","zh-CN":"未找到维度","zh-TW":"找不到維度"}},Object_ErrorMessage_MissingMeasure:{id:"Object.ErrorMessage.MissingMeasure",locale:{"de-DE":"Kennzahl nicht gefunden","en-US":"Measure not found","es-ES":"No se ha encontrado la medida","fr-FR":"Mesure introuvable","it-IT":"Misura non trovata","ja-JP":"メジャーが見つかりません","ko-KR":"측정값을 찾지 못했습니다.","nl-NL":"Meting niet gevonden","pl-PL":"Miara nie została znaleziona","pt-BR":"Medida não encontrada","ru-RU":"Мера не найдена","sv-SE":"Måttet hittades inte","tr-TR":"Hesaplama bulunamadı","zh-CN":"未找到度量","zh-TW":"找不到量值"}},Tooltip_ToggleOffLassoSelection:{id:"Tooltip.ToggleOffLassoSelection",locale:{"de-DE":"Lasso-Auswahl deaktivieren","en-US":"Turn off lasso selection","es-ES":"Desactivar la selección de contorno","fr-FR":"Désactiver la sélection au lasso","it-IT":"Disattiva selezione lazo","ja-JP":"囲み選択をオフにする","ko-KR":"올가미 선택 끄기","nl-NL":"Lassoselectie uitschakelen","pl-PL":"Wyłącz zaznaczenie lasso","pt-BR":"Desativar seleção de laço","ru-RU":"Выключить выбор лассо","sv-SE":"Stäng av lassourval","tr-TR":"Serbest seçimi kapat","zh-CN":"关闭套索选择方法","zh-TW":"關閉套索選取"}},Tooltip_ToggleOnLassoSelection:{id:"Tooltip.ToggleOnLassoSelection",locale:{"de-DE":"Lasso-Auswahl aktivieren","en-US":"Turn on lasso selection","es-ES":"Activar la selección de contorno","fr-FR":"Activer la sélection au lasso","it-IT":"Attiva selezione lazo","ja-JP":"囲み選択をオンにする","ko-KR":"올가미 선택 켜기","nl-NL":"Lassoselectie inschakelen","pl-PL":"Włącz zaznaczenie lasso","pt-BR":"Ativar seleção de laço","ru-RU":"Включить выбор лассо","sv-SE":"Slå på lassourval","tr-TR":"Serbest seçimi aç","zh-CN":"开启套索选择方法","zh-TW":"開啟套索選取"}},Tooltip_dimensions_cyclic:{id:"Tooltip.dimensions.cyclic",locale:{"de-DE":"Zyklische Dimension","en-US":"Cyclic dimension","es-ES":"Dimensión cíclica","fr-FR":"Dimension cyclique","it-IT":"Dimensione ciclica","ja-JP":"サイクリック軸","ko-KR":"순환 차원","nl-NL":"Cyclische dimensie","pl-PL":"Wymiar cykliczny","pt-BR":"Dimensão cíclica","ru-RU":"Циклическое измерение","sv-SE":"Cyklisk dimension","tr-TR":"Döngüsel boyut","zh-CN":"循环维度","zh-TW":"循環維度"}},Tooltip_dimensions_drilldown:{id:"Tooltip.dimensions.drilldown",locale:{"de-DE":"Drilldown-Dimension","en-US":"Drill-down dimension","es-ES":"Dimensión jerárquica","fr-FR":"Descendre dans la hiérarchie de la dimension","it-IT":"Dimensione di drill-down","ja-JP":"軸のドリルダウン","ko-KR":"드릴다운 차원","nl-NL":"Drill-downdimensie","pl-PL":"Wymiar hierarchiczny","pt-BR":"Dimensão da hierarquia","ru-RU":"Детализированное измерение","sv-SE":"Hierarkisk dimension","tr-TR":"Detaya inme boyutu","zh-CN":"下钻维度","zh-TW":"向下探查維度"}},Tooltip_selections_locked:{id:"Tooltip.selections.locked",locale:{"de-DE":"Auswahlen sind für diese Dimension gesperrt","en-US":"Selections on this dimension are locked","es-ES":"Las selecciones de esta dimensión están bloqueadas.","fr-FR":"Sélections verrouillées pour cette dimension","it-IT":"Le selezioni in questa dimensione sono bloccate","ja-JP":"この軸での選択はロックされています","ko-KR":"이 차원의 선택은 잠겨 있습니다.","nl-NL":"Selecties voor deze dimensie zijn vergrendeld","pl-PL":"Wybory dotyczące tego wymiaru są zablokowane","pt-BR":"Seleções estão bloqueadas nesta dimensão","ru-RU":"Выборки для данного измерения заблокированы","sv-SE":"Urval i den här dimensionen är låsta","tr-TR":"Bu boyuttaki seçimler kilitli","zh-CN":"相关维度的选择已锁定","zh-TW":"已鎖定此維度上的選項"}},Visualizations_Descriptions_Bars:{id:"Visualizations.Descriptions.Bars",locale:{"de-DE":"Balken","en-US":"Bars","es-ES":"Barras","fr-FR":"Barres","it-IT":"Barre","ja-JP":"棒","ko-KR":"막대","nl-NL":"Staven","pl-PL":"Słupki","pt-BR":"Barras","ru-RU":"Полосы","sv-SE":"Staplar","tr-TR":"Çubuklar","zh-CN":"条形","zh-TW":"長條"}},Visualizations_Descriptions_Group:{id:"Visualizations.Descriptions.Group",locale:{"de-DE":"Gruppe","en-US":"Group","es-ES":"Grupo","fr-FR":"Groupe","it-IT":"Gruppo","ja-JP":"グループ","ko-KR":"그룹","nl-NL":"Groep","pl-PL":"Grupa","pt-BR":"Grupo","ru-RU":"Группа","sv-SE":"Grupp","tr-TR":"Grup","zh-CN":"组","zh-TW":"群組"}},Visualizations_Descriptions_HeightLine:{id:"Visualizations.Descriptions.HeightLine",locale:{"de-DE":"Linienhöhe","en-US":"Height of line","es-ES":"Altura de línea","fr-FR":"Hauteur de ligne","it-IT":"Altezza della linea","ja-JP":"線の高さ","ko-KR":"선 높이","nl-NL":"Hoogte van lijn","pl-PL":"Wysokość linii","pt-BR":"Altura da linha","ru-RU":"Высота линии","sv-SE":"Linjens höjd","tr-TR":"Çizgi yüksekliği","zh-CN":"线高度","zh-TW":"折線高度"}},Visualizations_Descriptions_LengthBars:{id:"Visualizations.Descriptions.LengthBars",locale:{"de-DE":"Balkenlänge","en-US":"Length of bars","es-ES":"Longitud de barras","fr-FR":"Longueur des barres","it-IT":"Lunghezza delle barre","ja-JP":"棒の長さ","ko-KR":"막대 길이","nl-NL":"Lengte van staven","pl-PL":"Długość słupków","pt-BR":"Comprimento das barras","ru-RU":"Длина полос","sv-SE":"Staplarnas längd","tr-TR":"Çubuk uzunluğu","zh-CN":"条形长度","zh-TW":"長條長度"}},properties_dataPoints_labelmode_share:{id:"properties.dataPoints.labelmode.share",locale:{"de-DE":"Freigeben","en-US":"Share","es-ES":"Compartir","fr-FR":"Partage","it-IT":"Condividi","ja-JP":"共有","ko-KR":"공유","nl-NL":"Delen","pl-PL":"Udostępnij","pt-BR":"Compartilhar","ru-RU":"Совместное использование","sv-SE":"Dela","tr-TR":"Paylaş","zh-CN":"共享","zh-TW":"共用"}},properties_trendlines_types_average:{id:"properties.trendlines.types.average",locale:{"de-DE":"Durchschnitt","en-US":"Average","es-ES":"Media","fr-FR":"Moyenne","it-IT":"Media","ja-JP":"平均値","ko-KR":"평균","nl-NL":"Gemiddelde","pl-PL":"Średnia","pt-BR":"Média","ru-RU":"Среднее","sv-SE":"Medel","tr-TR":"Ortalama","zh-CN":"平均值","zh-TW":"平均值"}},properties_trendlines_types_exponential:{id:"properties.trendlines.types.exponential",locale:{"de-DE":"Exponentiell","en-US":"Exponential","es-ES":"Exponencial","fr-FR":"Exponentiel","it-IT":"Esponenziale","ja-JP":"指数","ko-KR":"지수","nl-NL":"Exponentieel","pl-PL":"Wykładnicze","pt-BR":"Exponencial","ru-RU":"Экспоненциальный","sv-SE":"Exponentiell","tr-TR":"Üstel","zh-CN":"指数","zh-TW":"指數"}},properties_trendlines_types_linear:{id:"properties.trendlines.types.linear",locale:{"de-DE":"Linear","en-US":"Linear","es-ES":"Lineal","fr-FR":"Linéaire","it-IT":"Lineare","ja-JP":"線形","ko-KR":"선형","nl-NL":"Lineair","pl-PL":"Liniowe","pt-BR":"Linear","ru-RU":"Линейный","sv-SE":"Linjär","tr-TR":"Doğrusal","zh-CN":"线性","zh-TW":"線性"}},properties_trendlines_types_logarithmic:{id:"properties.trendlines.types.logarithmic",locale:{"de-DE":"Logarithmisch","en-US":"Logarithmic","es-ES":"Logarítmica","fr-FR":"Logarithmique","it-IT":"Logaritmica","ja-JP":"対数","ko-KR":"로그","nl-NL":"Logaritmisch","pl-PL":"Logarytmiczne","pt-BR":"Logarítmico","ru-RU":"Логарифмический","sv-SE":"Logaritmisk","tr-TR":"Logaritmik","zh-CN":"对数","zh-TW":"對數"}},properties_trendlines_types_polynomial2:{id:"properties.trendlines.types.polynomial2",locale:{"de-DE":"Polynom zweiten Grades","en-US":"Second degree polynomial","es-ES":"Polinómica de segundo grado","fr-FR":"Polynomial du 2ème degré","it-IT":"Polinomio di secondo grado","ja-JP":"2 番目の角度の多項式近似","ko-KR":"2차 다항식","nl-NL":"Tweedegraadspolynoom","pl-PL":"Wielomianowe drugiego stopnia","pt-BR":"Polinômio de segundo grau","ru-RU":"Полиномиальный второй степени","sv-SE":"Polynomial, andra graden","tr-TR":"İkinci derece polinom","zh-CN":"二次多项式","zh-TW":"第二度多項式"}},properties_trendlines_types_polynomial3:{id:"properties.trendlines.types.polynomial3",locale:{"de-DE":"Polynom dritten Grades","en-US":"Third degree polynomial","es-ES":"Polinómica de tercer grado","fr-FR":"Polynomial du 3ème degré","it-IT":"Polinomio di terzo grado","ja-JP":"3 番目の角度の多項式近似","ko-KR":"3차 다항식","nl-NL":"Derdegraadspolynoom","pl-PL":"Wielomianowe trzeciego stopnia","pt-BR":"Polinômio de terceiro grau","ru-RU":"Полиномиальный третьей степени","sv-SE":"Polynomial, tredje graden","tr-TR":"Üçüncü derece polinom","zh-CN":"三次多项式","zh-TW":"第三度多項式"}},properties_trendlines_types_polynomial4:{id:"properties.trendlines.types.polynomial4",locale:{"de-DE":"Polynom vierten Grades","en-US":"Fourth degree polynomial","es-ES":"Polinómica de cuarto grado","fr-FR":"Polynomial du 4ème degré","it-IT":"Polinomio di quarto grado","ja-JP":"4 番目の角度の多項式近似","ko-KR":"4차 다항식","nl-NL":"Vierdegraadspolynoom","pl-PL":"Wielomianowe czwartego stopnia","pt-BR":"Polinômio de quarto grau","ru-RU":"Полиномиальный четвертой степени","sv-SE":"Polynomial, fjärde graden","tr-TR":"Dördüncü derece polinom","zh-CN":"四次多项式","zh-TW":"第四度多項式"}},properties_trendlines_types_power:{id:"properties.trendlines.types.power",locale:{"de-DE":"Potenz","en-US":"Power","es-ES":"Potencia","fr-FR":"Puissance","it-IT":"Potenza","ja-JP":"累乗","ko-KR":"거듭제곱","nl-NL":"Macht","pl-PL":"Potęgowe","pt-BR":"Potência","ru-RU":"Степенной","sv-SE":"Potens","tr-TR":"Üs","zh-CN":"幂","zh-TW":"乘冪"}}};var n=Object.prototype.hasOwnProperty,i=Object.prototype.toString,r=Object.defineProperty,o=Object.getOwnPropertyDescriptor,s=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===i.call(e)},a=function(e){if(!e||"[object Object]"!==i.call(e))return!1;var t,r=n.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!r&&!o)return!1;for(t in e);return void 0===t||n.call(e,t)},l=function(e,t){r&&"__proto__"===t.name?r(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},c=function(e,t){if("__proto__"===t){if(!n.call(e,t))return;if(o)return o(e,t).value}return e[t]},u=function e(){var t,n,i,r,o,u,h=arguments[0],d=1,f=arguments.length,p=!1;for("boolean"==typeof h&&(p=h,h=arguments[1]||{},d=2),(null==h||"object"!=typeof h&&"function"!=typeof h)&&(h={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)i=c(h,n),h!==(r=c(t,n))&&(p&&r&&(a(r)||(o=s(r)))?(o?(o=!1,u=i&&s(i)?i:[]):u=i&&a(i)?i:{},l(h,{name:n,newValue:e(p,u,r)})):void 0!==r&&l(h,{name:n,newValue:r}));return h},h="2.11.5";function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function f(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t);if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(Object(n),!0).forEach(function(t){f(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function m(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i,r,o,s,a=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(i=o.call(n)).done)&&(a.push(i.value),a.length!==t);l=!0);}catch(e){c=!0,r=e}finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw r}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return d(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?d(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(e){return!!e.changedTouches}function x(e){return"number"==typeof e&&!isNaN(e)}function v(e){return"number"!=typeof e||isNaN(e)}function b(e){const t=e.length;let n=NaN,i=NaN,r=NaN,o=NaN;for(let s=0;s<t;s++)n=isNaN(n)?e[s].x:Math.min(n,e[s].x),i=isNaN(i)?e[s].x:Math.max(i,e[s].x),r=isNaN(r)?e[s].y:Math.min(r,e[s].y),o=isNaN(o)?e[s].y:Math.max(o,e[s].y);return[n,r,i,o]}function w(e){return[{x:e.x1||0,y:e.y1||0},{x:e.x2||0,y:e.y2||0}]}function k(e){return[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}]}function _(e){const t=m(b(e),4),n=t[0],i=t[1];return{x:n,y:i,width:t[2]-n,height:t[3]-i}}function M(e){return{x1:e[0].x,y1:e[0].y,x2:e[1].x,y2:e[1].y}}function S(e){const t=e||{},n=t.x,i=t.y,r=t.width,o=t.height,s=t.x1,a=t.x2,l=t.y1,c=t.y2,u=t.cx,h=t.cy,d=t.r,f=t.vertices;return x(u)&&x(h)&&x(d)?"circle":x(s)&&x(a)&&x(l)&&x(c)?"line":x(n)&&x(i)&&x(r)&&x(o)?"rect":x(n)&&x(i)?"point":Array.isArray(f)?f.every(e=>Array.isArray(e))?"geopolygon":"polygon":null}function R(e,t){return{x:t.x-e,y:t.y-e,width:t.width+e,height:t.height+e}}function C(e){return function(){return e}}const N=Math.abs,D=Math.atan2,q=Math.cos,E=Math.max,z=Math.min,A=Math.sin,O=Math.sqrt,T=1e-12,I=Math.PI,j=I/2,P=2*I;function F(e){return e>=1?j:e<=-1?-j:Math.asin(e)}const L=Math.PI,$=2*L,B=1e-6,H=$-B;function W(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}class V{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==e?W:function(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return W;const n=10**t;return function(e){this._+=e[0];for(let t=1,i=e.length;t<i;++t)this._+=Math.round(arguments[t]*n)/n+e[t]}}(e)}moveTo(e,t){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,t){this._append`L${this._x1=+e},${this._y1=+t}`}quadraticCurveTo(e,t,n,i){this._append`Q${+e},${+t},${this._x1=+n},${this._y1=+i}`}bezierCurveTo(e,t,n,i,r,o){this._append`C${+e},${+t},${+n},${+i},${this._x1=+r},${this._y1=+o}`}arcTo(e,t,n,i,r){if(e=+e,t=+t,n=+n,i=+i,(r=+r)<0)throw new Error(`negative radius: ${r}`);let o=this._x1,s=this._y1,a=n-e,l=i-t,c=o-e,u=s-t,h=c*c+u*u;if(null===this._x1)this._append`M${this._x1=e},${this._y1=t}`;else if(h>B)if(Math.abs(u*a-l*c)>B&&r){let d=n-o,f=i-s,p=a*a+l*l,g=d*d+f*f,m=Math.sqrt(p),y=Math.sqrt(h),x=r*Math.tan((L-Math.acos((p+h-g)/(2*m*y)))/2),v=x/y,b=x/m;Math.abs(v-1)>B&&this._append`L${e+v*c},${t+v*u}`,this._append`A${r},${r},0,0,${+(u*d>c*f)},${this._x1=e+b*a},${this._y1=t+b*l}`}else this._append`L${this._x1=e},${this._y1=t}`;else;}arc(e,t,n,i,r,o){if(e=+e,t=+t,o=!!o,(n=+n)<0)throw new Error(`negative radius: ${n}`);let s=n*Math.cos(i),a=n*Math.sin(i),l=e+s,c=t+a,u=1^o,h=o?i-r:r-i;null===this._x1?this._append`M${l},${c}`:(Math.abs(this._x1-l)>B||Math.abs(this._y1-c)>B)&&this._append`L${l},${c}`,n&&(h<0&&(h=h%$+$),h>H?this._append`A${n},${n},0,1,${u},${e-s},${t-a}A${n},${n},0,1,${u},${this._x1=l},${this._y1=c}`:h>B&&this._append`A${n},${n},0,${+(h>=L)},${u},${this._x1=e+n*Math.cos(r)},${this._y1=t+n*Math.sin(r)}`)}rect(e,t,n,i){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}}function U(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(null==n)t=null;else{const e=Math.floor(n);if(!(e>=0))throw new RangeError(`invalid digits: ${n}`);t=e}return e},()=>new V(t)}function Y(e){return e.innerRadius}function K(e){return e.outerRadius}function X(e){return e.startAngle}function G(e){return e.endAngle}function J(e){return e&&e.padAngle}function Z(e,t,n,i,r,o,s){var a=e-n,l=t-i,c=(s?o:-o)/O(a*a+l*l),u=c*l,h=-c*a,d=e+u,f=t+h,p=n+u,g=i+h,m=(d+p)/2,y=(f+g)/2,x=p-d,v=g-f,b=x*x+v*v,w=r-o,k=d*g-p*f,_=(v<0?-1:1)*O(E(0,w*w*b-k*k)),M=(k*v-x*_)/b,S=(-k*x-v*_)/b,R=(k*v+x*_)/b,C=(-k*x+v*_)/b,N=M-m,D=S-y,q=R-m,z=C-y;return N*N+D*D>q*q+z*z&&(M=R,S=C),{cx:M,cy:S,x01:-u,y01:-h,x11:M*(r/w-1),y11:S*(r/w-1)}}function Q(){var e=Y,t=K,n=C(0),i=null,r=X,o=G,s=J,a=null,l=U(c);function c(){var c,u,h=+e.apply(this,arguments),d=+t.apply(this,arguments),f=r.apply(this,arguments)-j,p=o.apply(this,arguments)-j,g=N(p-f),m=p>f;if(a||(a=c=l()),d<h&&(u=d,d=h,h=u),d>T)if(g>P-T)a.moveTo(d*q(f),d*A(f)),a.arc(0,0,d,f,p,!m),h>T&&(a.moveTo(h*q(p),h*A(p)),a.arc(0,0,h,p,f,m));else{var y,x,v=f,b=p,w=f,k=p,_=g,M=g,S=s.apply(this,arguments)/2,R=S>T&&(i?+i.apply(this,arguments):O(h*h+d*d)),C=z(N(d-h)/2,+n.apply(this,arguments)),E=C,L=C;if(R>T){var $=F(R/h*A(S)),B=F(R/d*A(S));(_-=2*$)>T?(w+=$*=m?1:-1,k-=$):(_=0,w=k=(f+p)/2),(M-=2*B)>T?(v+=B*=m?1:-1,b-=B):(M=0,v=b=(f+p)/2)}var H=d*q(v),W=d*A(v),V=h*q(k),U=h*A(k);if(C>T){var Y,K=d*q(b),X=d*A(b),G=h*q(w),J=h*A(w);if(g<I)if(Y=function(e,t,n,i,r,o,s,a){var l=n-e,c=i-t,u=s-r,h=a-o,d=h*l-u*c;if(!(d*d<T))return[e+(d=(u*(t-o)-h*(e-r))/d)*l,t+d*c]}(H,W,G,J,K,X,V,U)){var Q=H-Y[0],ee=W-Y[1],te=K-Y[0],ne=X-Y[1],ie=1/A(function(e){return e>1?0:e<-1?I:Math.acos(e)}((Q*te+ee*ne)/(O(Q*Q+ee*ee)*O(te*te+ne*ne)))/2),re=O(Y[0]*Y[0]+Y[1]*Y[1]);E=z(C,(h-re)/(ie-1)),L=z(C,(d-re)/(ie+1))}else E=L=0}M>T?L>T?(y=Z(G,J,H,W,d,L,m),x=Z(K,X,V,U,d,L,m),a.moveTo(y.cx+y.x01,y.cy+y.y01),L<C?a.arc(y.cx,y.cy,L,D(y.y01,y.x01),D(x.y01,x.x01),!m):(a.arc(y.cx,y.cy,L,D(y.y01,y.x01),D(y.y11,y.x11),!m),a.arc(0,0,d,D(y.cy+y.y11,y.cx+y.x11),D(x.cy+x.y11,x.cx+x.x11),!m),a.arc(x.cx,x.cy,L,D(x.y11,x.x11),D(x.y01,x.x01),!m))):(a.moveTo(H,W),a.arc(0,0,d,v,b,!m)):a.moveTo(H,W),h>T&&_>T?E>T?(y=Z(V,U,K,X,h,-E,m),x=Z(H,W,G,J,h,-E,m),a.lineTo(y.cx+y.x01,y.cy+y.y01),E<C?a.arc(y.cx,y.cy,E,D(y.y01,y.x01),D(x.y01,x.x01),!m):(a.arc(y.cx,y.cy,E,D(y.y01,y.x01),D(y.y11,y.x11),!m),a.arc(0,0,h,D(y.cy+y.y11,y.cx+y.x11),D(x.cy+x.y11,x.cx+x.x11),m),a.arc(x.cx,x.cy,E,D(x.y11,x.x11),D(x.y01,x.x01),!m))):a.arc(0,0,h,k,w,m):a.lineTo(V,U)}else a.moveTo(0,0);if(a.closePath(),c)return a=null,c+""||null}return c.centroid=function(){var n=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,i=(+r.apply(this,arguments)+ +o.apply(this,arguments))/2-I/2;return[q(i)*n,A(i)*n]},c.innerRadius=function(t){return arguments.length?(e="function"==typeof t?t:C(+t),c):e},c.outerRadius=function(e){return arguments.length?(t="function"==typeof e?e:C(+e),c):t},c.cornerRadius=function(e){return arguments.length?(n="function"==typeof e?e:C(+e),c):n},c.padRadius=function(e){return arguments.length?(i=null==e?null:"function"==typeof e?e:C(+e),c):i},c.startAngle=function(e){return arguments.length?(r="function"==typeof e?e:C(+e),c):r},c.endAngle=function(e){return arguments.length?(o="function"==typeof e?e:C(+e),c):o},c.padAngle=function(e){return arguments.length?(s="function"==typeof e?e:C(+e),c):s},c.context=function(e){return arguments.length?(a=null==e?null:e,c):a},c}function ee(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}function te(e){this._context=e}function ne(e){return new te(e)}function ie(e){return e[0]}function re(e){return e[1]}function oe(e,t,n){var i=null,r=C(!0),o=null,s=ne,a=null,l=U(c);function c(c){var u,h,d,f,p,g=(c=ee(c)).length,m=!1,y=new Array(g),x=new Array(g);for(null==o&&(a=s(p=l())),u=0;u<=g;++u){if(!(u<g&&r(f=c[u],u,c))===m)if(m=!m)h=u,a.areaStart(),a.lineStart();else{for(a.lineEnd(),a.lineStart(),d=u-1;d>=h;--d)a.point(y[d],x[d]);a.lineEnd(),a.areaEnd()}m&&(y[u]=+e(f,u,c),x[u]=+t(f,u,c),a.point(i?+i(f,u,c):y[u],n?+n(f,u,c):x[u]))}if(p)return a=null,p+""||null}function u(){return function(e,t){var n=C(!0),i=null,r=ne,o=null,s=U(a);function a(a){var l,c,u,h=(a=ee(a)).length,d=!1;for(null==i&&(o=r(u=s())),l=0;l<=h;++l)!(l<h&&n(c=a[l],l,a))===d&&((d=!d)?o.lineStart():o.lineEnd()),d&&o.point(+e(c,l,a),+t(c,l,a));if(u)return o=null,u+""||null}return e="function"==typeof e?e:void 0===e?ie:C(e),t="function"==typeof t?t:void 0===t?re:C(t),a.x=function(t){return arguments.length?(e="function"==typeof t?t:C(+t),a):e},a.y=function(e){return arguments.length?(t="function"==typeof e?e:C(+e),a):t},a.defined=function(e){return arguments.length?(n="function"==typeof e?e:C(!!e),a):n},a.curve=function(e){return arguments.length?(r=e,null!=i&&(o=r(i)),a):r},a.context=function(e){return arguments.length?(null==e?i=o=null:o=r(i=e),a):i},a}().defined(r).curve(s).context(o)}return e="function"==typeof e?e:void 0===e?ie:C(+e),t="function"==typeof t?t:C(void 0===t?0:+t),n="function"==typeof n?n:void 0===n?re:C(+n),c.x=function(t){return arguments.length?(e="function"==typeof t?t:C(+t),i=null,c):e},c.x0=function(t){return arguments.length?(e="function"==typeof t?t:C(+t),c):e},c.x1=function(e){return arguments.length?(i=null==e?null:"function"==typeof e?e:C(+e),c):i},c.y=function(e){return arguments.length?(t="function"==typeof e?e:C(+e),n=null,c):t},c.y0=function(e){return arguments.length?(t="function"==typeof e?e:C(+e),c):t},c.y1=function(e){return arguments.length?(n=null==e?null:"function"==typeof e?e:C(+e),c):n},c.lineX0=c.lineY0=function(){return u().x(e).y(t)},c.lineY1=function(){return u().x(e).y(n)},c.lineX1=function(){return u().x(i).y(t)},c.defined=function(e){return arguments.length?(r="function"==typeof e?e:C(!!e),c):r},c.curve=function(e){return arguments.length?(s=e,null!=o&&(a=s(o)),c):s},c.context=function(e){return arguments.length?(null==e?o=a=null:a=s(o=e),c):o},c}function se(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function ae(e){return e}function le(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function ce(e){this._context=e}function ue(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function he(e,t){this._context=e,this._k=(1-t)/6}te.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}},ce.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:le(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:le(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},he.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:ue(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:ue(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var de=function e(t){function n(e){return new he(e,t)}return n.tension=function(t){return e(+t)},n}(0);function fe(e,t){this._context=e,this._alpha=t}fe.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:!function(e,t,n){var i=e._x1,r=e._y1,o=e._x2,s=e._y2;if(e._l01_a>T){var a=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);i=(i*a-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,r=(r*a-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>T){var c=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,u=3*e._l23_a*(e._l23_a+e._l12_a);o=(o*c+e._x1*e._l23_2a-t*e._l12_2a)/u,s=(s*c+e._y1*e._l23_2a-n*e._l12_2a)/u}e._context.bezierCurveTo(i,r,o,s,e._x2,e._y2)}(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var pe=function e(t){function n(e){return t?new fe(e,t):new he(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function ge(e){return e<0?-1:1}function me(e,t,n){var i=e._x1-e._x0,r=t-e._x1,o=(e._y1-e._y0)/(i||r<0&&-0),s=(n-e._y1)/(r||i<0&&-0),a=(o*r+s*i)/(i+r);return(ge(o)+ge(s))*Math.min(Math.abs(o),Math.abs(s),.5*Math.abs(a))||0}function ye(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function xe(e,t,n){var i=e._x0,r=e._y0,o=e._x1,s=e._y1,a=(o-i)/3;e._context.bezierCurveTo(i+a,r+a*t,o-a,s-a*n,o,s)}function ve(e){this._context=e}function be(e){this._context=new we(e)}function we(e){this._context=e}function ke(e){this._context=e}function _e(e){var t,n,i=e.length-1,r=new Array(i),o=new Array(i),s=new Array(i);for(r[0]=0,o[0]=2,s[0]=e[0]+2*e[1],t=1;t<i-1;++t)r[t]=1,o[t]=4,s[t]=4*e[t]+2*e[t+1];for(r[i-1]=2,o[i-1]=7,s[i-1]=8*e[i-1]+e[i],t=1;t<i;++t)n=r[t]/o[t-1],o[t]-=n,s[t]-=n*s[t-1];for(r[i-1]=s[i-1]/o[i-1],t=i-2;t>=0;--t)r[t]=(s[t]-r[t+1])/o[t];for(o[i-1]=(e[i]+r[i-1])/2,t=0;t<i-1;++t)o[t]=2*e[t+1]-r[t+1];return[r,o]}function Me(e,t){this._context=e,this._t=t}function Se(e,t){if((r=e.length)>1)for(var n,i,r,o=1,s=e[t[0]],a=s.length;o<r;++o)for(i=s,s=e[t[o]],n=0;n<a;++n)s[n][1]+=s[n][0]=isNaN(i[n][1])?i[n][0]:i[n][1]}function Re(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function Ce(e,t){return e[t]}function Ne(e){const t=[];return t.key=e,t}function De(e){for(var t,n=-1,i=0,r=e.length,o=-1/0;++n<r;)(t=+e[n][1])>o&&(o=t,i=n);return i}function qe(e){for(var t,n=0,i=-1,r=e.length;++i<r;)(t=+e[i][1])&&(n+=t);return n}function Ee(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"unspecified",i=arguments.length>2?arguments[2]:void 0;const r={},o=e||{get:()=>{},has:()=>!1,default:()=>{}};function s(e,t){if(!e||"string"!=typeof e)throw new TypeError("Invalid argument: key must be a non-empty string");return!(e in r)&&(r[e]=t,!0)}function a(e){return r[e]||o.get(e)}function l(e,r){if(void 0!==r)return s(e,r);const o=a(e);return i&&void 0===o&&i.warn("".concat(e," does not exist in ").concat(n," registry")),o||a(t)}return t=o.default(),l.add=s,l.get=a,l.has=function(e){return!!r[e]||o.has(e)},l.remove=function(e){const t=r[e];return delete r[e],t},l.getKeys=function(){return Object.keys(r)},l.getValues=function(){return Object.keys(r).map(e=>r[e])},l.default=function(e){return void 0!==e&&(t=e),t},l.register=s,l}function ze(e,t){if(!isFinite(e)||0===e)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),i=e.slice(0,n);return[i.length>1?i[0]+i.slice(2):i,+e.slice(n+1)]}function Ae(e){return(e=ze(Math.abs(e)))?e[1]:NaN}ve.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:xe(this,this._t0,ye(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(t=+t,(e=+e)!==this._x1||t!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,xe(this,ye(this,n=me(this,e,t)),n);break;default:xe(this,this._t0,n=me(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}},(be.prototype=Object.create(ve.prototype)).point=function(e,t){ve.prototype.point.call(this,t,e)},we.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,i,r,o){this._context.bezierCurveTo(t,e,i,n,o,r)}},ke.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),2===n)this._context.lineTo(e[1],t[1]);else for(var i=_e(e),r=_e(t),o=0,s=1;s<n;++o,++s)this._context.bezierCurveTo(i[0][o],r[0][o],i[1][o],r[1][o],e[s],t[s]);(this._line||0!==this._line&&1===n)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}},Me.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}}this._x=e,this._y=t}};var Oe,Te=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Ie(e){if(!(t=Te.exec(e)))throw new Error("invalid format: "+e);var t;return new je({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function je(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function Pe(e,t){var n=ze(e,t);if(!n)return e+"";var i=n[0],r=n[1];return r<0?"0."+new Array(-r).join("0")+i:i.length>r+1?i.slice(0,r+1)+"."+i.slice(r+1):i+new Array(r-i.length+2).join("0")}Ie.prototype=je.prototype,je.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var Fe={"%":(e,t)=>(100*e).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>Pe(100*e,t),r:Pe,s:function(e,t){var n=ze(e,t);if(!n)return Oe=void 0,e.toPrecision(t);var i=n[0],r=n[1],o=r-(Oe=3*Math.max(-8,Math.min(8,Math.floor(r/3))))+1,s=i.length;return o===s?i:o>s?i+new Array(o-s+1).join("0"):o>0?i.slice(0,o)+"."+i.slice(o):"0."+new Array(1-o).join("0")+ze(e,Math.max(0,t+o-1))[0]},X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Le(e){return e}var $e,Be,He,We=Array.prototype.map,Ve=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Ue(e){var t,n,i=void 0===e.grouping||void 0===e.thousands?Le:(t=We.call(e.grouping,Number),n=e.thousands+"",function(e,i){for(var r=e.length,o=[],s=0,a=t[0],l=0;r>0&&a>0&&(l+a+1>i&&(a=Math.max(1,i-l)),o.push(e.substring(r-=a,r+a)),!((l+=a+1)>i));)a=t[s=(s+1)%t.length];return o.reverse().join(n)}),r=void 0===e.currency?"":e.currency[0]+"",o=void 0===e.currency?"":e.currency[1]+"",s=void 0===e.decimal?".":e.decimal+"",a=void 0===e.numerals?Le:function(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}(We.call(e.numerals,String)),l=void 0===e.percent?"%":e.percent+"",c=void 0===e.minus?"−":e.minus+"",u=void 0===e.nan?"NaN":e.nan+"";function h(e,t){var n=(e=Ie(e)).fill,h=e.align,d=e.sign,f=e.symbol,p=e.zero,g=e.width,m=e.comma,y=e.precision,x=e.trim,v=e.type;"n"===v?(m=!0,v="g"):Fe[v]||(void 0===y&&(y=12),x=!0,v="g"),(p||"0"===n&&"="===h)&&(p=!0,n="0",h="=");var b=(t&&void 0!==t.prefix?t.prefix:"")+("$"===f?r:"#"===f&&/[boxX]/.test(v)?"0"+v.toLowerCase():""),w=("$"===f?o:/[%p]/.test(v)?l:"")+(t&&void 0!==t.suffix?t.suffix:""),k=Fe[v],_=/[defgprs%]/.test(v);function M(e){var t,r,o,l=b,f=w;if("c"===v)f=k(e)+f,e="";else{var M=(e=+e)<0||1/e<0;if(e=isNaN(e)?u:k(Math.abs(e),y),x&&(e=function(e){e:for(var t,n=e.length,i=1,r=-1;i<n;++i)switch(e[i]){case".":r=t=i;break;case"0":0===r&&(r=i),t=i;break;default:if(!+e[i])break e;r>0&&(r=0)}return r>0?e.slice(0,r)+e.slice(t+1):e}(e)),M&&0===+e&&"+"!==d&&(M=!1),l=(M?"("===d?d:c:"-"===d||"("===d?"":d)+l,f=("s"!==v||isNaN(e)||void 0===Oe?"":Ve[8+Oe/3])+f+(M&&"("===d?")":""),_)for(t=-1,r=e.length;++t<r;)if(48>(o=e.charCodeAt(t))||o>57){f=(46===o?s+e.slice(t+1):e.slice(t))+f,e=e.slice(0,t);break}}m&&!p&&(e=i(e,1/0));var S=l.length+e.length+f.length,R=S<g?new Array(g-S+1).join(n):"";switch(m&&p&&(e=i(R+e,R.length?g-f.length:1/0),R=""),h){case"<":e=l+e+f+R;break;case"=":e=l+R+e+f;break;case"^":e=R.slice(0,S=R.length>>1)+l+e+f+R.slice(S);break;default:e=R+l+e+f}return a(e)}return y=void 0===y?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,y)):Math.max(0,Math.min(20,y)),M.toString=function(){return e+""},M}return{format:h,formatPrefix:function(e,t){var n=3*Math.max(-8,Math.min(8,Math.floor(Ae(t)/3))),i=Math.pow(10,-n),r=h(((e=Ie(e)).type="f",e),{suffix:Ve[8+n/3]});return function(e){return r(i*e)}}}}!function(e){$e=Ue(e),Be=$e.format,He=$e.formatPrefix}({thousands:",",grouping:[3],currency:["$",""]});const Ye=new Date,Ke=new Date;function Xe(e,t,n,i){function r(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return r.floor=t=>(e(t=new Date(+t)),t),r.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n),r.round=e=>{const t=r(e),n=r.ceil(e);return e-t<n-e?t:n},r.offset=(e,n)=>(t(e=new Date(+e),null==n?1:Math.floor(n)),e),r.range=(n,i,o)=>{const s=[];if(n=r.ceil(n),o=null==o?1:Math.floor(o),!(n<i&&o>0))return s;let a;do{s.push(a=new Date(+n)),t(n,o),e(n)}while(a<n&&n<i);return s},r.filter=n=>Xe(t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)},(e,i)=>{if(e>=e)if(i<0)for(;++i<=0;)for(;t(e,-1),!n(e););else for(;--i>=0;)for(;t(e,1),!n(e););}),n&&(r.count=(t,i)=>(Ye.setTime(+t),Ke.setTime(+i),e(Ye),e(Ke),Math.floor(n(Ye,Ke))),r.every=e=>(e=Math.floor(e),isFinite(e)&&e>0?e>1?r.filter(i?t=>i(t)%e===0:t=>r.count(0,t)%e===0):r:null)),r}const Ge=6e4,Je=864e5,Ze=6048e5,Qe=Xe(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Ge)/Je,e=>e.getDate()-1);Qe.range;const et=Xe(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Je,e=>e.getUTCDate()-1);et.range;const tt=Xe(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Je,e=>Math.floor(e/Je));function nt(e){return Xe(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(e,t)=>{e.setDate(e.getDate()+7*t)},(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Ge)/Ze)}tt.range;const it=nt(0),rt=nt(1),ot=nt(2),st=nt(3),at=nt(4),lt=nt(5),ct=nt(6);function ut(e){return Xe(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+7*t)},(e,t)=>(t-e)/Ze)}it.range,rt.range,ot.range,st.range,at.range,lt.range,ct.range;const ht=ut(0),dt=ut(1),ft=ut(2),pt=ut(3),gt=ut(4),mt=ut(5),yt=ut(6);ht.range,dt.range,ft.range,pt.range,gt.range,mt.range,yt.range;const xt=Xe(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());xt.every=e=>isFinite(e=Math.floor(e))&&e>0?Xe(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)}):null,xt.range;const vt=Xe(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());function bt(e,t){return null==e||null==t?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function wt(e,t){return null==e||null==t?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function kt(e){let t,n,i;function r(e,i,r=0,o=e.length){if(r<o){if(0!==t(i,i))return o;do{const t=r+o>>>1;n(e[t],i)<0?r=t+1:o=t}while(r<o)}return r}return 2!==e.length?(t=bt,n=(t,n)=>bt(e(t),n),i=(t,n)=>e(t)-n):(t=e===bt||e===wt?e:_t,n=e,i=e),{left:r,center:function(e,t,n=0,o=e.length){const s=r(e,t,n,o-1);return s>n&&i(e[s-1],t)>-i(e[s],t)?s-1:s},right:function(e,i,r=0,o=e.length){if(r<o){if(0!==t(i,i))return o;do{const t=r+o>>>1;n(e[t],i)<=0?r=t+1:o=t}while(r<o)}return r}}}function _t(){return 0}vt.every=e=>isFinite(e=Math.floor(e))&&e>0?Xe(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)}):null,vt.range;const Mt=kt(bt).right;kt(function(e){return null===e?NaN:+e}).center;var St=Mt;class Rt extends Map{constructor(e,t=Nt){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),null!=e)for(const[t,n]of e)this.set(t,n)}get(e){return super.get(Ct(this,e))}has(e){return super.has(Ct(this,e))}set(e,t){return super.set(function({_intern:e,_key:t},n){const i=t(n);return e.has(i)?e.get(i):(e.set(i,n),n)}(this,e),t)}delete(e){return super.delete(function({_intern:e,_key:t},n){const i=t(n);e.has(i)&&(n=e.get(i),e.delete(i));return n}(this,e))}}function Ct({_intern:e,_key:t},n){const i=t(n);return e.has(i)?e.get(i):n}function Nt(e){return null!==e&&"object"==typeof e?e.valueOf():e}const Dt=Math.sqrt(50),qt=Math.sqrt(10),Et=Math.sqrt(2);function zt(e,t,n){const i=(t-e)/Math.max(0,n),r=Math.floor(Math.log10(i)),o=i/Math.pow(10,r),s=o>=Dt?10:o>=qt?5:o>=Et?2:1;let a,l,c;return r<0?(c=Math.pow(10,-r)/s,a=Math.round(e*c),l=Math.round(t*c),a/c<e&&++a,l/c>t&&--l,c=-c):(c=Math.pow(10,r)*s,a=Math.round(e/c),l=Math.round(t/c),a*c<e&&++a,l*c>t&&--l),l<a&&.5<=n&&n<2?zt(e,t,2*n):[a,l,c]}function At(e,t,n){return zt(e=+e,t=+t,n=+n)[2]}function Ot(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function Tt(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function It(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function jt(e){var t=e.dateTime,n=e.date,i=e.time,r=e.periods,o=e.days,s=e.shortDays,a=e.months,l=e.shortMonths,c=Wt(r),u=Vt(r),h=Wt(o),d=Vt(o),f=Wt(s),p=Vt(s),g=Wt(a),m=Vt(a),y=Wt(l),x=Vt(l),v={a:function(e){return s[e.getDay()]},A:function(e){return o[e.getDay()]},b:function(e){return l[e.getMonth()]},B:function(e){return a[e.getMonth()]},c:null,d:fn,e:fn,f:xn,g:Dn,G:En,H:pn,I:gn,j:mn,L:yn,m:vn,M:bn,p:function(e){return r[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:ei,s:ti,S:wn,u:kn,U:_n,V:Sn,w:Rn,W:Cn,x:null,X:null,y:Nn,Y:qn,Z:zn,"%":Qn},b={a:function(e){return s[e.getUTCDay()]},A:function(e){return o[e.getUTCDay()]},b:function(e){return l[e.getUTCMonth()]},B:function(e){return a[e.getUTCMonth()]},c:null,d:An,e:An,f:Pn,g:Xn,G:Jn,H:On,I:Tn,j:In,L:jn,m:Fn,M:Ln,p:function(e){return r[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:ei,s:ti,S:$n,u:Bn,U:Hn,V:Vn,w:Un,W:Yn,x:null,X:null,y:Kn,Y:Gn,Z:Zn,"%":Qn},w={a:function(e,t,n){var i=f.exec(t.slice(n));return i?(e.w=p.get(i[0].toLowerCase()),n+i[0].length):-1},A:function(e,t,n){var i=h.exec(t.slice(n));return i?(e.w=d.get(i[0].toLowerCase()),n+i[0].length):-1},b:function(e,t,n){var i=y.exec(t.slice(n));return i?(e.m=x.get(i[0].toLowerCase()),n+i[0].length):-1},B:function(e,t,n){var i=g.exec(t.slice(n));return i?(e.m=m.get(i[0].toLowerCase()),n+i[0].length):-1},c:function(e,n,i){return M(e,t,n,i)},d:nn,e:nn,f:cn,g:Zt,G:Jt,H:on,I:on,j:rn,L:ln,m:tn,M:sn,p:function(e,t,n){var i=c.exec(t.slice(n));return i?(e.p=u.get(i[0].toLowerCase()),n+i[0].length):-1},q:en,Q:hn,s:dn,S:an,u:Yt,U:Kt,V:Xt,w:Ut,W:Gt,x:function(e,t,i){return M(e,n,t,i)},X:function(e,t,n){return M(e,i,t,n)},y:Zt,Y:Jt,Z:Qt,"%":un};function k(e,t){return function(n){var i,r,o,s=[],a=-1,l=0,c=e.length;for(n instanceof Date||(n=new Date(+n));++a<c;)37===e.charCodeAt(a)&&(s.push(e.slice(l,a)),null!=(r=Pt[i=e.charAt(++a)])?i=e.charAt(++a):r="e"===i?" ":"0",(o=t[i])&&(i=o(n,r)),s.push(i),l=a+1);return s.push(e.slice(l,a)),s.join("")}}function _(e,t){return function(n){var i,r,o=It(1900,void 0,1);if(M(o,e,n+="",0)!=n.length)return null;if("Q"in o)return new Date(o.Q);if("s"in o)return new Date(1e3*o.s+("L"in o?o.L:0));if(t&&!("Z"in o)&&(o.Z=0),"p"in o&&(o.H=o.H%12+12*o.p),void 0===o.m&&(o.m="q"in o?o.q:0),"V"in o){if(o.V<1||o.V>53)return null;"w"in o||(o.w=1),"Z"in o?(r=(i=Tt(It(o.y,0,1))).getUTCDay(),i=r>4||0===r?dt.ceil(i):dt(i),i=et.offset(i,7*(o.V-1)),o.y=i.getUTCFullYear(),o.m=i.getUTCMonth(),o.d=i.getUTCDate()+(o.w+6)%7):(r=(i=Ot(It(o.y,0,1))).getDay(),i=r>4||0===r?rt.ceil(i):rt(i),i=Qe.offset(i,7*(o.V-1)),o.y=i.getFullYear(),o.m=i.getMonth(),o.d=i.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),r="Z"in o?Tt(It(o.y,0,1)).getUTCDay():Ot(It(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(r+5)%7:o.w+7*o.U-(r+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,Tt(o)):Ot(o)}}function M(e,t,n,i){for(var r,o,s=0,a=t.length,l=n.length;s<a;){if(i>=l)return-1;if(37===(r=t.charCodeAt(s++))){if(r=t.charAt(s++),!(o=w[r in Pt?t.charAt(s++):r])||(i=o(e,n,i))<0)return-1}else if(r!=n.charCodeAt(i++))return-1}return i}return v.x=k(n,v),v.X=k(i,v),v.c=k(t,v),b.x=k(n,b),b.X=k(i,b),b.c=k(t,b),{format:function(e){var t=k(e+="",v);return t.toString=function(){return e},t},parse:function(e){var t=_(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=k(e+="",b);return t.toString=function(){return e},t},utcParse:function(e){var t=_(e+="",!0);return t.toString=function(){return e},t}}}var Pt={"-":"",_:" ",0:"0"},Ft=/^\s*\d+/,Lt=/^%/,$t=/[\\^$*+?|[\]().{}]/g;function Bt(e,t,n){var i=e<0?"-":"",r=(i?-e:e)+"",o=r.length;return i+(o<n?new Array(n-o+1).join(t)+r:r)}function Ht(e){return e.replace($t,"\\$&")}function Wt(e){return new RegExp("^(?:"+e.map(Ht).join("|")+")","i")}function Vt(e){return new Map(e.map((e,t)=>[e.toLowerCase(),t]))}function Ut(e,t,n){var i=Ft.exec(t.slice(n,n+1));return i?(e.w=+i[0],n+i[0].length):-1}function Yt(e,t,n){var i=Ft.exec(t.slice(n,n+1));return i?(e.u=+i[0],n+i[0].length):-1}function Kt(e,t,n){var i=Ft.exec(t.slice(n,n+2));return i?(e.U=+i[0],n+i[0].length):-1}function Xt(e,t,n){var i=Ft.exec(t.slice(n,n+2));return i?(e.V=+i[0],n+i[0].length):-1}function Gt(e,t,n){var i=Ft.exec(t.slice(n,n+2));return i?(e.W=+i[0],n+i[0].length):-1}function Jt(e,t,n){var i=Ft.exec(t.slice(n,n+4));return i?(e.y=+i[0],n+i[0].length):-1}function Zt(e,t,n){var i=Ft.exec(t.slice(n,n+2));return i?(e.y=+i[0]+(+i[0]>68?1900:2e3),n+i[0].length):-1}function Qt(e,t,n){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return i?(e.Z=i[1]?0:-(i[2]+(i[3]||"00")),n+i[0].length):-1}function en(e,t,n){var i=Ft.exec(t.slice(n,n+1));return i?(e.q=3*i[0]-3,n+i[0].length):-1}function tn(e,t,n){var i=Ft.exec(t.slice(n,n+2));return i?(e.m=i[0]-1,n+i[0].length):-1}function nn(e,t,n){var i=Ft.exec(t.slice(n,n+2));return i?(e.d=+i[0],n+i[0].length):-1}function rn(e,t,n){var i=Ft.exec(t.slice(n,n+3));return i?(e.m=0,e.d=+i[0],n+i[0].length):-1}function on(e,t,n){var i=Ft.exec(t.slice(n,n+2));return i?(e.H=+i[0],n+i[0].length):-1}function sn(e,t,n){var i=Ft.exec(t.slice(n,n+2));return i?(e.M=+i[0],n+i[0].length):-1}function an(e,t,n){var i=Ft.exec(t.slice(n,n+2));return i?(e.S=+i[0],n+i[0].length):-1}function ln(e,t,n){var i=Ft.exec(t.slice(n,n+3));return i?(e.L=+i[0],n+i[0].length):-1}function cn(e,t,n){var i=Ft.exec(t.slice(n,n+6));return i?(e.L=Math.floor(i[0]/1e3),n+i[0].length):-1}function un(e,t,n){var i=Lt.exec(t.slice(n,n+1));return i?n+i[0].length:-1}function hn(e,t,n){var i=Ft.exec(t.slice(n));return i?(e.Q=+i[0],n+i[0].length):-1}function dn(e,t,n){var i=Ft.exec(t.slice(n));return i?(e.s=+i[0],n+i[0].length):-1}function fn(e,t){return Bt(e.getDate(),t,2)}function pn(e,t){return Bt(e.getHours(),t,2)}function gn(e,t){return Bt(e.getHours()%12||12,t,2)}function mn(e,t){return Bt(1+Qe.count(xt(e),e),t,3)}function yn(e,t){return Bt(e.getMilliseconds(),t,3)}function xn(e,t){return yn(e,t)+"000"}function vn(e,t){return Bt(e.getMonth()+1,t,2)}function bn(e,t){return Bt(e.getMinutes(),t,2)}function wn(e,t){return Bt(e.getSeconds(),t,2)}function kn(e){var t=e.getDay();return 0===t?7:t}function _n(e,t){return Bt(it.count(xt(e)-1,e),t,2)}function Mn(e){var t=e.getDay();return t>=4||0===t?at(e):at.ceil(e)}function Sn(e,t){return e=Mn(e),Bt(at.count(xt(e),e)+(4===xt(e).getDay()),t,2)}function Rn(e){return e.getDay()}function Cn(e,t){return Bt(rt.count(xt(e)-1,e),t,2)}function Nn(e,t){return Bt(e.getFullYear()%100,t,2)}function Dn(e,t){return Bt((e=Mn(e)).getFullYear()%100,t,2)}function qn(e,t){return Bt(e.getFullYear()%1e4,t,4)}function En(e,t){var n=e.getDay();return Bt((e=n>=4||0===n?at(e):at.ceil(e)).getFullYear()%1e4,t,4)}function zn(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Bt(t/60|0,"0",2)+Bt(t%60,"0",2)}function An(e,t){return Bt(e.getUTCDate(),t,2)}function On(e,t){return Bt(e.getUTCHours(),t,2)}function Tn(e,t){return Bt(e.getUTCHours()%12||12,t,2)}function In(e,t){return Bt(1+et.count(vt(e),e),t,3)}function jn(e,t){return Bt(e.getUTCMilliseconds(),t,3)}function Pn(e,t){return jn(e,t)+"000"}function Fn(e,t){return Bt(e.getUTCMonth()+1,t,2)}function Ln(e,t){return Bt(e.getUTCMinutes(),t,2)}function $n(e,t){return Bt(e.getUTCSeconds(),t,2)}function Bn(e){var t=e.getUTCDay();return 0===t?7:t}function Hn(e,t){return Bt(ht.count(vt(e)-1,e),t,2)}function Wn(e){var t=e.getUTCDay();return t>=4||0===t?gt(e):gt.ceil(e)}function Vn(e,t){return e=Wn(e),Bt(gt.count(vt(e),e)+(4===vt(e).getUTCDay()),t,2)}function Un(e){return e.getUTCDay()}function Yn(e,t){return Bt(dt.count(vt(e)-1,e),t,2)}function Kn(e,t){return Bt(e.getUTCFullYear()%100,t,2)}function Xn(e,t){return Bt((e=Wn(e)).getUTCFullYear()%100,t,2)}function Gn(e,t){return Bt(e.getUTCFullYear()%1e4,t,4)}function Jn(e,t){var n=e.getUTCDay();return Bt((e=n>=4||0===n?gt(e):gt.ceil(e)).getUTCFullYear()%1e4,t,4)}function Zn(){return"+0000"}function Qn(){return"%"}function ei(e){return+e}function ti(e){return Math.floor(+e/1e3)}const ni=Ee();ni("d3-number",function(e,t,n){let i,r;function o(e){return r(e)}function s(){o.locale({decimal:n||".",thousands:t||",",grouping:[3],currency:["$",""]})}return o.locale=function(t){return i=Ue(t),r=i.format(e),this},s(),o.format=function(e,r,o,a){return(o||a)&&(t=o,n=a,s()),i.format(e)(r)},o.pattern=function(t){return t&&(e=t,r=i.format(t)),e},o}),ni("d3-time",function(e){let t=jt({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}),n=t.format(e);function i(e){return n(e)}return i.format=function(e,n){return t.format(e)(n)},i.locale=function(){return t=jt(...arguments),n=t.format(e),this},i.parse=function(e,n){return t.parse(e)(n)},i.parsePattern=function(e){return t.parse(e)},i});const ii={id:e=>"".concat(e.source,"/").concat(e.key||e.title),key:e=>String(e.key||e.title),tags:e=>e.tags,min:e=>e.min,max:e=>e.max,type:e=>e.type,title:e=>String(e.title),values:e=>e.values,value:e=>e,label:e=>e,formatter:e=>(e=>{if("function"==typeof e.formatter)return e.formatter();const t=e.formatter||{};return ni(t.type||"d3-number")(t.format||"")})(e)};function ri(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.id,i=void 0===n?ii.id:n,r=t.key,o=void 0===r?ii.key:r,s=t.min,a=void 0===s?ii.min:s,l=t.max,c=void 0===l?ii.max:l,u=t.type,h=void 0===u?ii.type:u,d=t.tags,f=void 0===d?ii.tags:d,p=t.title,g=void 0===p?ii.title:p,m=t.values,y=void 0===m?ii.values:m,x=t.value,v=void 0===x?ii.value:x,b=t.label,w=void 0===b?ii.label:b,k=t.formatter,_=void 0===k?ii.formatter:k;return{id:()=>i(e),key:()=>o(e),raw:()=>e,tags:()=>f(e),type:()=>h(e),min:()=>a(e),max:()=>c(e),title:()=>g(e),items:()=>y(e),formatter:()=>_(e),value:v,label:w}}const oi=e=>e.filter(e=>"number"==typeof e&&!isNaN(e)),si=e=>e.reduce((e,t)=>e+t,0),ai={first:e=>e[0],last:e=>e[e.length-1],min:e=>{const t=oi(e);return t.length?Math.min.apply(null,t):NaN},max:e=>{const t=oi(e);return t.length?Math.max.apply(null,t):NaN},sum:e=>{const t=oi(e);return t.length?t.reduce((e,t)=>e+t,0):NaN},avg:e=>{const t=oi(e),n=t.length;return n?si(t)/n:NaN}};function li(e,t,n,i){const r={},o=i.field||(void 0!==e.field?t.field(e.field):null);return Object.keys(n).forEach(s=>{const a=n[s],l=r[s]={};-1!==["number","string","boolean"].indexOf(typeof a)?(l.type="primitive",l.value=a):"function"==typeof a?(l.type="function",l.value=a,l.label=a,l.field=o):"object"==typeof a&&(a.fields?l.fields=a.fields.map(n=>li(e,t,{main:n},i).main):void 0!==a.field?(l.type="field",l.field=t.field(a.field),l.value=l.field.value,l.label=l.field.label):o&&(l.value=o.value,l.label=o.label,l.field=o),"function"==typeof a.filter&&(l.filter=a.filter),void 0!==a.value&&(l.value=a.value),void 0!==a.label&&(l.label=a.label),"function"==typeof a.reduce?l.reduce=a.reduce:a.reduce?l.reduce=ai[a.reduce]:l.field&&l.field.reduce&&(l.reduce="string"==typeof l.field.reduce?ai[l.field.reduce]:l.field.reduce),"function"==typeof a.reduceLabel?l.reduceLabel=a.reduceLabel:a.reduceLabel?l.reduceLabel=ai[a.reduceLabel]:l.field&&l.field.reduceLabel&&(l.reduceLabel="string"==typeof l.field.reduceLabel?ai[l.field.reduceLabel]:l.field.reduceLabel))}),r}function ci(e,t){const n=li(e,t,{main:{value:e.value,label:e.label,reduce:e.reduce,filter:e.filter}},{}).main;return{props:li(e,t,e.props||{},n),main:n}}function ui(e,t,n,i){const r=Array(e.length),o=Array(e.length);let s;for(let t=0;t<e.length;t++)s=i?e[t][i]:e[t],r[t]=s.value,o[t]=s.label;const a=t.reduce,l=t.reduceLabel,c=a?a(r):r,u={value:c,label:l?l(o,c):n?n(c):String(c)};return i&&e[0][i].source?(u.source=e[0][i].source,u):!i&&e[0].source?(u.source=e[0].source,u):u}function hi(e,t){let n=t.main,i=t.propsArr,r=t.props,o=[];const s=n.field.formatter(),a={};return i.forEach(e=>{a[e]=r[e].field?r[e].field.formatter():e=>e}),o.push(...e.map(e=>{const t=ui(e.items,n,s);return i.forEach(n=>{t[n]=ui(e.items,r[n],a[n],n)}),t})),o}function di(e){let t=e.cfg,n=e.itemData,i=e.obj,r=e.target,o=e.tracker;const s="function"===e.trackType?t.trackBy(n):n[t.trackBy];let a=o[s];a||(a=o[s]={items:[],id:s},r.push(a)),a.items.push(i)}function fi(e){if(e.length<1e4)return Math.max(...e);let t=-1/0;const n=e.length;for(let i=0;i<n;i++)t<e[i]&&(t=e[i]);return t}function pi(e){if(e.length<1e4)return Math.min(...e);let t=1/0;const n=e.length;for(let i=0;i<n;i++)t>e[i]&&(t=e[i]);return t}const gi={diverging:function(e,t){const n=e.length;if(n<=0)return;const i=e[t[0]].length;for(let r=0;r<i;++r){let i=0,o=0;for(let s=0;s<n;++s){const n=e[t[s]][r],a=n[1]-n[0];a>=0?(n[0]=i,i+=a,n[1]=i):a<0?(n[1]=o,o+=a,n[0]=o):n[0]=i}}},none:Se,silhouette:function(e,t){if((n=e.length)>0){for(var n,i=0,r=e[t[0]],o=r.length;i<o;++i){for(var s=0,a=0;s<n;++s)a+=e[s][i][1]||0;r[i][1]+=r[i][0]=-a/2}Se(e,t)}},expand:function(e,t){if((i=e.length)>0){for(var n,i,r,o=0,s=e[0].length;o<s;++o){for(r=n=0;n<i;++n)r+=e[n][o][1]||0;if(r)for(n=0;n<i;++n)e[n][o][1]/=r}Se(e,t)}},wiggle:function(e,t){if((r=e.length)>0&&(i=(n=e[t[0]]).length)>0){for(var n,i,r,o=0,s=1;s<i;++s){for(var a=0,l=0,c=0;a<r;++a){for(var u=e[t[a]],h=u[s][1]||0,d=(h-(u[s-1][1]||0))/2,f=0;f<a;++f){var p=e[t[f]];d+=(p[s][1]||0)-(p[s-1][1]||0)}l+=h,c+=d*h}n[s-1][1]+=n[s-1][0]=o,l&&(o-=c/l)}n[s-1][1]+=n[s-1][0]=o,Se(e,t)}}},mi={ascending:function(e){var t=e.map(qe);return Re(e).sort(function(e,n){return t[e]-t[n]})},insideout:function(e){var t,n,i=e.length,r=e.map(qe),o=function(e){var t=e.map(De);return Re(e).sort(function(e,n){return t[e]-t[n]})}(e),s=0,a=0,l=[],c=[];for(t=0;t<i;++t)n=o[t],s<a?(s+=r[n],l.push(n)):(a+=r[n],c.push(n));return c.reverse().concat(l)},none:Re,reverse:function(e){return Re(e).reverse()}};function yi(e,t,n,i){const r=i||e.items,o={},s=t.stackKey,a=t.value,l=t.startProp||"start",c=t.endProp||"end",u=t.offset||"none",h=t.order||"none",d=t.valueRef||"";let f=0,p={};for(let e=0;e<r.length;e++){let t=r[e],n=d?t[d]:null;if(n&&n.source){let e="".concat(n.source.key||"","/").concat(n.source.field);p[e]||(p[e]=n.source)}let i=s(t);o[i]=o[i]||{items:[]},o[i].items.push(t),f=Math.max(f,o[i].items.length)}const g=Array.apply(null,{length:f}).map(Number.call,Number),m=Object.keys(o).map(e=>o[e].items),y=function(){var e=C([]),t=Re,n=Se,i=Ce;function r(r){var o,s,a=Array.from(e.apply(this,arguments),Ne),l=a.length,c=-1;for(const e of r)for(o=0,++c;o<l;++o)(a[o][c]=[0,+i(e,a[o].key,c,r)]).data=e;for(o=0,s=ee(t(a));o<l;++o)a[s[o]].index=o;return n(a,s),a}return r.keys=function(t){return arguments.length?(e="function"==typeof t?t:C(Array.from(t)),r):e},r.value=function(e){return arguments.length?(i="function"==typeof e?e:C(+e),r):i},r.order=function(e){return arguments.length?(t=null==e?Re:"function"==typeof e?e:C(Array.from(e)),r):t},r.offset=function(e){return arguments.length?(n=null==e?Se:e,r):n},r}().keys(g).value((e,t)=>e[t]?a(e[t]):0).order(mi[h]).offset(gi[u]);let x=y(m),v=[];for(let e=0;e<x.length;e++){let t=x[e];for(let e=0;e<t.length;e++){let n=t[e],i=t[e].data[t.key];i&&(i[l]={value:n[0]},i[c]={value:n[1]},v.push(n[0],n[1]))}}let b=Object.keys(p).map(e=>{let t=n(p[e].key);return t?t.field(p[e].field):null}).filter(e=>!!e);const w=ri({title:b.map(e=>e.title()).join(", "),min:pi(v),max:fi(v),type:"measure",formatter:b[0]?b[0].formatter:void 0});e.fields.push(w)}function xi(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={};const i=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).logger;if(Array.isArray(e))n.items=e.map(e=>({value:e,label:String(e)}));else if(e){if("collection"in e)n=g({},t.collection(e.collection));else{const r=t.dataset?t.dataset(e.source):null;let o=e.value||(e=>e),s=e.label||(e=>e);if(e.groupBy||e.mapTo)i.warn('Deprecated "data" configuration',e),n.items=[];else if(e.hierarchy)n.root=r.hierarchy?r.hierarchy(e.hierarchy):null,n.fields=r.fields();else if(e.items)n.items=e.skipNormalize?e.items:e.items.map(e=>({value:o(e),label:String(s(e))}));else if(e.extract){const i=Array.isArray(e.extract)?e.extract:[e.extract];n.items=[];const o=[];i.forEach(e=>{const i=e.source?t.dataset(e.source):r;i&&(n.items=[...n.items,...i.extract(e)],void 0!==e.field&&o.push(i.field(e.field)))}),o.length&&(n.fields=o),e.amend&&Array.isArray(e.amend)&&(n.items=[...n.items,...e.amend])}else if(void 0!==e.field&&r){const t=r.field(e.field);t&&(n.fields||(n.fields=[]),n.fields.push(t),"value"in e||(o=t.value||(e=>e),s=t.label||(e=>e),n.value=o),n.items=t.items().map(t=>({value:o(t),label:String(s(t)),source:{field:e.field}})))}else e.fields&&e.fields.forEach(e=>{const i="object"==typeof e&&e.source?t.dataset(e.source):r;if(!i)return;let o;o="object"==typeof e&&void 0!==e.field?i.field(e.field):i.field(e),o&&(n.fields||(n.fields=[]),n.fields.push(o))});n.items&&e.map&&(n.items=n.items.map(e.map))}e&&e.stack&&(Array.isArray(e.stack.stackByKey)?e.stack.stackByKey.forEach(i=>{const r=n.items.filter(e=>{var t;return(null===(t=e.key)||void 0===t?void 0:t.value)&&e.key.value===i});yi(n,e.stack,t.dataset,r)}):yi(n,e.stack,t.dataset,n.items))}return e&&!Array.isArray(e)&&"function"==typeof e.filter&&n.items&&(n.items=n.items.filter(e.filter)),e&&!Array.isArray(e)&&"function"==typeof e.sort&&n.items&&(n.items=n.items.sort(e.sort)),n}function vi(e,t,n){let i,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:xi;if(e.data){const i=r(e.data,t,n);if(i&&i.fields&&i.fields[0])return i.fields[0].formatter()}if(i=e.formatter?"".concat(e.formatter,"-").concat(e.type||"number"):e.type||"d3-number",n.formatter.has(i)){return n.formatter.get(i)(e.format||"")}throw new Error("Formatter of type '".concat(i,"' was not found"))}function bi(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}const wi=Symbol("implicit");function ki(){var e=new Rt,t=[],n=[],i=wi;function r(r){let o=e.get(r);if(void 0===o){if(i!==wi)return i;e.set(r,o=t.push(r)-1)}return n[o%n.length]}return r.domain=function(n){if(!arguments.length)return t.slice();t=[],e=new Rt;for(const i of n)e.has(i)||e.set(i,t.push(i)-1);return r},r.range=function(e){return arguments.length?(n=Array.from(e),r):n.slice()},r.unknown=function(e){return arguments.length?(i=e,r):i},r.copy=function(){return ki(t,n).unknown(i)},bi.apply(r,arguments),r}function _i(){var e,t,n=ki().unknown(void 0),i=n.domain,r=n.range,o=0,s=1,a=!1,l=0,c=0,u=.5;function h(){var n=i().length,h=s<o,d=h?s:o,f=h?o:s;e=(f-d)/Math.max(1,n-l+2*c),a&&(e=Math.floor(e)),d+=(f-d-e*(n-l))*u,t=e*(1-l),a&&(d=Math.round(d),t=Math.round(t));var p=function(e,t,n){e=+e,t=+t,n=(r=arguments.length)<2?(t=e,e=0,1):r<3?1:+n;for(var i=-1,r=0|Math.max(0,Math.ceil((t-e)/n)),o=new Array(r);++i<r;)o[i]=e+i*n;return o}(n).map(function(t){return d+e*t});return r(h?p.reverse():p)}return delete n.unknown,n.domain=function(e){return arguments.length?(i(e),h()):i()},n.range=function(e){return arguments.length?([o,s]=e,o=+o,s=+s,h()):[o,s]},n.rangeRound=function(e){return[o,s]=e,o=+o,s=+s,a=!0,h()},n.bandwidth=function(){return t},n.step=function(){return e},n.round=function(e){return arguments.length?(a=!!e,h()):a},n.padding=function(e){return arguments.length?(l=Math.min(1,c=+e),h()):l},n.paddingInner=function(e){return arguments.length?(l=Math.min(1,e),h()):l},n.paddingOuter=function(e){return arguments.length?(c=+e,h()):c},n.align=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),h()):u},n.copy=function(){return _i(i(),[o,s]).round(a).paddingInner(l).paddingOuter(c).align(u)},bi.apply(h(),arguments)}function Mi(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Si(e,t){var n=Object.create(e.prototype);for(var i in t)n[i]=t[i];return n}function Ri(){}var Ci=.7,Ni=1/Ci,Di="\\s*([+-]?\\d+)\\s*",qi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ei="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",zi=/^#([0-9a-f]{3,8})$/,Ai=new RegExp(`^rgb\\(${Di},${Di},${Di}\\)$`),Oi=new RegExp(`^rgb\\(${Ei},${Ei},${Ei}\\)$`),Ti=new RegExp(`^rgba\\(${Di},${Di},${Di},${qi}\\)$`),Ii=new RegExp(`^rgba\\(${Ei},${Ei},${Ei},${qi}\\)$`),ji=new RegExp(`^hsl\\(${qi},${Ei},${Ei}\\)$`),Pi=new RegExp(`^hsla\\(${qi},${Ei},${Ei},${qi}\\)$`),Fi={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function Li(){return this.rgb().formatHex()}function $i(){return this.rgb().formatRgb()}function Bi(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=zi.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?Hi(t):3===n?new Ui(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?Wi(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?Wi(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=Ai.exec(e))?new Ui(t[1],t[2],t[3],1):(t=Oi.exec(e))?new Ui(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Ti.exec(e))?Wi(t[1],t[2],t[3],t[4]):(t=Ii.exec(e))?Wi(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=ji.exec(e))?Zi(t[1],t[2]/100,t[3]/100,1):(t=Pi.exec(e))?Zi(t[1],t[2]/100,t[3]/100,t[4]):Fi.hasOwnProperty(e)?Hi(Fi[e]):"transparent"===e?new Ui(NaN,NaN,NaN,0):null}function Hi(e){return new Ui(e>>16&255,e>>8&255,255&e,1)}function Wi(e,t,n,i){return i<=0&&(e=t=n=NaN),new Ui(e,t,n,i)}function Vi(e,t,n,i){return 1===arguments.length?function(e){return e instanceof Ri||(e=Bi(e)),e?new Ui((e=e.rgb()).r,e.g,e.b,e.opacity):new Ui}(e):new Ui(e,t,n,null==i?1:i)}function Ui(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}function Yi(){return`#${Ji(this.r)}${Ji(this.g)}${Ji(this.b)}`}function Ki(){const e=Xi(this.opacity);return`${1===e?"rgb(":"rgba("}${Gi(this.r)}, ${Gi(this.g)}, ${Gi(this.b)}${1===e?")":`, ${e})`}`}function Xi(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Gi(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ji(e){return((e=Gi(e))<16?"0":"")+e.toString(16)}function Zi(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new er(e,t,n,i)}function Qi(e){if(e instanceof er)return new er(e.h,e.s,e.l,e.opacity);if(e instanceof Ri||(e=Bi(e)),!e)return new er;if(e instanceof er)return e;var t=(e=e.rgb()).r/255,n=e.g/255,i=e.b/255,r=Math.min(t,n,i),o=Math.max(t,n,i),s=NaN,a=o-r,l=(o+r)/2;return a?(s=t===o?(n-i)/a+6*(n<i):n===o?(i-t)/a+2:(t-n)/a+4,a/=l<.5?o+r:2-o-r,s*=60):a=l>0&&l<1?0:s,new er(s,a,l,e.opacity)}function er(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}function tr(e){return(e=(e||0)%360)<0?e+360:e}function nr(e){return Math.max(0,Math.min(1,e||0))}function ir(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}Mi(Ri,Bi,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Li,formatHex:Li,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Qi(this).formatHsl()},formatRgb:$i,toString:$i}),Mi(Ui,Vi,Si(Ri,{brighter(e){return e=null==e?Ni:Math.pow(Ni,e),new Ui(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?Ci:Math.pow(Ci,e),new Ui(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Ui(Gi(this.r),Gi(this.g),Gi(this.b),Xi(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Yi,formatHex:Yi,formatHex8:function(){return`#${Ji(this.r)}${Ji(this.g)}${Ji(this.b)}${Ji(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Ki,toString:Ki})),Mi(er,function(e,t,n,i){return 1===arguments.length?Qi(e):new er(e,t,n,null==i?1:i)},Si(Ri,{brighter(e){return e=null==e?Ni:Math.pow(Ni,e),new er(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?Ci:Math.pow(Ci,e),new er(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*t,r=2*n-i;return new Ui(ir(e>=240?e-240:e+120,r,i),ir(e,r,i),ir(e<120?e+240:e-120,r,i),this.opacity)},clamp(){return new er(tr(this.h),nr(this.s),nr(this.l),Xi(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Xi(this.opacity);return`${1===e?"hsl(":"hsla("}${tr(this.h)}, ${100*nr(this.s)}%, ${100*nr(this.l)}%${1===e?")":`, ${e})`}`}}));var rr=e=>()=>e;function or(e){return 1===(e=+e)?sr:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(i){return Math.pow(e+i*t,n)}}(t,n,e):rr(isNaN(t)?n:t)}}function sr(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):rr(isNaN(e)?t:e)}var ar=function e(t){var n=or(t);function i(e,t){var i=n((e=Vi(e)).r,(t=Vi(t)).r),r=n(e.g,t.g),o=n(e.b,t.b),s=sr(e.opacity,t.opacity);return function(t){return e.r=i(t),e.g=r(t),e.b=o(t),e.opacity=s(t),e+""}}return i.gamma=e,i}(1);function lr(e,t){t||(t=[]);var n,i=e?Math.min(t.length,e.length):0,r=t.slice();return function(o){for(n=0;n<i;++n)r[n]=e[n]*(1-o)+t[n]*o;return r}}function cr(e,t){var n,i=t?t.length:0,r=e?Math.min(i,e.length):0,o=new Array(r),s=new Array(i);for(n=0;n<r;++n)o[n]=mr(e[n],t[n]);for(;n<i;++n)s[n]=t[n];return function(e){for(n=0;n<r;++n)s[n]=o[n](e);return s}}function ur(e,t){var n=new Date;return e=+e,t=+t,function(i){return n.setTime(e*(1-i)+t*i),n}}function hr(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function dr(e,t){var n,i={},r={};for(n in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)n in e?i[n]=mr(e[n],t[n]):r[n]=t[n];return function(e){for(n in i)r[n]=i[n](e);return r}}var fr=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,pr=new RegExp(fr.source,"g");function gr(e,t){var n,i,r,o=fr.lastIndex=pr.lastIndex=0,s=-1,a=[],l=[];for(e+="",t+="";(n=fr.exec(e))&&(i=pr.exec(t));)(r=i.index)>o&&(r=t.slice(o,r),a[s]?a[s]+=r:a[++s]=r),(n=n[0])===(i=i[0])?a[s]?a[s]+=i:a[++s]=i:(a[++s]=null,l.push({i:s,x:hr(n,i)})),o=pr.lastIndex;return o<t.length&&(r=t.slice(o),a[s]?a[s]+=r:a[++s]=r),a.length<2?l[0]?function(e){return function(t){return e(t)+""}}(l[0].x):function(e){return function(){return e}}(t):(t=l.length,function(e){for(var n,i=0;i<t;++i)a[(n=l[i]).i]=n.x(e);return a.join("")})}function mr(e,t){var n,i=typeof t;return null==t||"boolean"===i?rr(t):("number"===i?hr:"string"===i?(n=Bi(t))?(t=n,ar):gr:t instanceof Bi?ar:t instanceof Date?ur:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}(t)?lr:Array.isArray(t)?cr:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?dr:hr)(e,t)}function yr(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function xr(e){return+e}var vr=[0,1];function br(e){return e}function wr(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:function(e){return function(){return e}}(isNaN(t)?NaN:.5)}function kr(e,t,n){var i=e[0],r=e[1],o=t[0],s=t[1];return r<i?(i=wr(r,i),o=n(s,o)):(i=wr(i,r),o=n(o,s)),function(e){return o(i(e))}}function _r(e,t,n){var i=Math.min(e.length,t.length)-1,r=new Array(i),o=new Array(i),s=-1;for(e[i]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++s<i;)r[s]=wr(e[s],e[s+1]),o[s]=n(t[s],t[s+1]);return function(t){var n=St(e,t,1,i)-1;return o[n](r[n](t))}}function Mr(){var e,t,n,i,r,o,s=vr,a=vr,l=mr,c=br;function u(){var e=Math.min(s.length,a.length);return c!==br&&(c=function(e,t){var n;return e>t&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}(s[0],s[e-1])),i=e>2?_r:kr,r=o=null,h}function h(t){return null==t||isNaN(t=+t)?n:(r||(r=i(s.map(e),a,l)))(e(c(t)))}return h.invert=function(n){return c(t((o||(o=i(a,s.map(e),hr)))(n)))},h.domain=function(e){return arguments.length?(s=Array.from(e,xr),u()):s.slice()},h.range=function(e){return arguments.length?(a=Array.from(e),u()):a.slice()},h.rangeRound=function(e){return a=Array.from(e),l=yr,u()},h.clamp=function(e){return arguments.length?(c=!!e||br,u()):c!==br},h.interpolate=function(e){return arguments.length?(l=e,u()):l},h.unknown=function(e){return arguments.length?(n=e,h):n},function(n,i){return e=n,t=i,u()}}function Sr(e,t,n,i){var r,o=function(e,t,n){n=+n;const i=(t=+t)<(e=+e),r=i?At(t,e,n):At(e,t,n);return(i?-1:1)*(r<0?1/-r:r)}(e,t,n);switch((i=Ie(null==i?",f":i)).type){case"s":var s=Math.max(Math.abs(e),Math.abs(t));return null!=i.precision||isNaN(r=function(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Ae(t)/3)))-Ae(Math.abs(e)))}(o,s))||(i.precision=r),He(i,s);case"":case"e":case"g":case"p":case"r":null!=i.precision||isNaN(r=function(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Ae(t)-Ae(e))+1}(o,Math.max(Math.abs(e),Math.abs(t))))||(i.precision=r-("e"===i.type));break;case"f":case"%":null!=i.precision||isNaN(r=function(e){return Math.max(0,-Ae(Math.abs(e)))}(o))||(i.precision=r-2*("%"===i.type))}return Be(i)}function Rr(e){var t=e.domain;return e.ticks=function(e){var n=t();return function(e,t,n){if(!((n=+n)>0))return[];if((e=+e)===(t=+t))return[e];const i=t<e,[r,o,s]=i?zt(t,e,n):zt(e,t,n);if(!(o>=r))return[];const a=o-r+1,l=new Array(a);if(i)if(s<0)for(let e=0;e<a;++e)l[e]=(o-e)/-s;else for(let e=0;e<a;++e)l[e]=(o-e)*s;else if(s<0)for(let e=0;e<a;++e)l[e]=(r+e)/-s;else for(let e=0;e<a;++e)l[e]=(r+e)*s;return l}(n[0],n[n.length-1],null==e?10:e)},e.tickFormat=function(e,n){var i=t();return Sr(i[0],i[i.length-1],null==e?10:e,n)},e.nice=function(n){null==n&&(n=10);var i,r,o=t(),s=0,a=o.length-1,l=o[s],c=o[a],u=10;for(c<l&&(r=l,l=c,c=r,r=s,s=a,a=r);u-- >0;){if((r=At(l,c,n))===i)return o[s]=l,o[a]=c,t(o);if(r>0)l=Math.floor(l/r)*r,c=Math.ceil(c/r)*r;else{if(!(r<0))break;l=Math.ceil(l*r)/r,c=Math.floor(c*r)/r}i=r}return e},e}function Cr(){var e=Mr()(br,br);return e.copy=function(){return t=e,Cr().domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown());var t},bi.apply(e,arguments),Rr(e)}function Nr(){var e,t=[.5],n=[0,1],i=1;function r(r){return null!=r&&r<=r?n[St(t,r,0,i)]:e}return r.domain=function(e){return arguments.length?(t=Array.from(e),i=Math.min(t.length,n.length-1),r):t.slice()},r.range=function(e){return arguments.length?(n=Array.from(e),i=Math.min(t.length,n.length-1),r):n.slice()},r.invertExtent=function(e){var i=n.indexOf(e);return[t[i-1],t[i]]},r.unknown=function(t){return arguments.length?(e=t,r):e},r.copy=function(){return Nr().domain(t).range(n).unknown(e)},bi.apply(r,arguments)}function Dr(e){return void 0===e?e=>e:t=>e(t)}function qr(e){return Math.max(0,Math.min(1,e))}function Er(e){return"object"==typeof e}function zr(e,t,n){const i=Math.abs(t-n)/(e+1),r=[];for(let o=1;o<=e;o++){const e=o*i;r.push(t<n?t+e:t-e)}return r}function Ar(e,t,n){if(1===e.length)return e;const i=e.concat([]);for(let r=0;r<e.length;r++){let o=e[r],s=e[r+1];0===r&&o!==n.start()?(i.push(...zr(t,o,s)),o-=s-o,s=e[r],i.push(...zr(t,o,s))):r===e.length-1&&s!==n.end()?(s=o+(o-e[r-1]),i.push(...zr(t,o,s))):i.push(...zr(t,o,s))}return i.filter(e=>e>=n.min()&&e<=n.max())}function Or(e){let t=e.distance,n=e.scale,i=e.minorCount,r=void 0===i?0:i,o=e.unitDivider,s=void 0===o?100:o,a=e.formatter,l=void 0===a?void 0:a;const c=v(s)||v(t)?2:Math.max(t/s,2),u=Math.min(1e3,Math.round(c));let h=n.ticks(u);h.length<=1&&(h=n.ticks(u+1));const d=r>0?Ar(h,r,n):h;d.sort((e,t)=>e-t);const f=d.map(Dr(l));return d.map((e,t)=>{const i=n(e);return{position:i,start:i,end:i,label:f[t],value:e,isMinor:-1===h.indexOf(e)}})}function Tr(e){let t=e.distance,n=e.scale,i=e.minorCount,r=void 0===i?0:i,o=e.unitDivider,s=void 0===o?100:o,a=e.formatter,l=void 0===a?void 0:a;const c=v(s)||v(t)?2:Math.max(t/s,2),u=Math.min(1e3,Math.round(c)),h=u>10?10:u;n.nice(h);const d=n.ticks(u),f=r>0?Ar(d,r,n):d;f.sort((e,t)=>e-t);const p=f.map(Dr(l));return f.map((e,t)=>{const i=n(e);return{position:i,start:i,end:i,label:p[t],value:e,isMinor:-1===d.indexOf(e)}})}function Ir(e){let t,n=e.settings,i=e.scale,r=e.distance,o=e.formatter,s=void 0===o?e=>e:o;const a=n.minorTicks&&!v(n.minorTicks.count)?Math.min(100,n.minorTicks.count):0;if(Array.isArray(n.ticks.values)){const e=n.ticks.values.filter(e=>"object"==typeof e?!v(e.value):!v(e));t=function(e){let t=e.values,n=e.scale,i=e.formatter,r=void 0===i?e=>e:i;return t.sort((e,t)=>(Er(e)?e.value:e)-(Er(t)?t.value:t)).filter((e,t,i)=>{const r=Er(e)?e.value:e;return r<=n.max()&&r>=n.min()&&i.indexOf(e)===t}).map(e=>{const t=Er(e),i=t?e.value:e,o=n(i);return{position:o,value:i,label:t&&void 0!==e.label?e.label:r(i),isMinor:!!t&&!!e.isMinor,start:t&&!isNaN(e.start)?qr(n(e.start)):o,end:t&&!isNaN(e.end)?qr(n(e.end)):o}})}({values:e,scale:i.copy(),formatter:s})}else if(v(n.ticks.count)){t=(n.ticks.tight?Tr:Or)({distance:r,minorCount:a,unitDivider:n.ticks.distance,scale:i,formatter:s}),n.ticks.forceBounds&&function(e,t,n){const i=e.map(e=>e.position),r=t.range();-1===i.indexOf(r[0])?e.splice(0,0,{position:r[0],start:r[0],end:r[0],label:n(t.start()),isMinor:!1,value:t.start()}):e[0]&&e[0].isMinor&&(e[0].isMinor=!1);const o=e[e.length-1];-1===i.indexOf(r[1])?e.push({position:r[1],start:r[1],end:r[1],label:n(t.end()),isMinor:!1,value:t.end()}):o&&o.isMinor&&(o.isMinor=!1)}(t,i,s)}else{t=function(e){let t=e.count,n=e.minorCount,i=e.scale,r=e.formatter;return i.ticks((t-1)*n+t).map((e,t)=>{const o=i(e);return{position:o,start:o,end:o,label:r(e),isMinor:t%(n+1)!==0,value:e}})}({count:Math.min(1e3,n.ticks.count),minorCount:a,scale:i.copy(),formatter:s})}return t}function jr(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i={};return Object.keys(t).forEach(r=>{const o=typeof e[r];i[r]="function"===o?e[r](n):"undefined"===o?t[r]:e[r]}),i}const Pr={min:NaN,max:NaN,expand:NaN,include:[],invert:!1},Fr={tight:!1,forceBounds:!1,values:void 0,count:NaN,distance:100},Lr={count:NaN};function $r(e,t){e.instance||(e.instance=t.copy(),e.instance.domain([t.start(),t.end()]),e.instance.clamp(!0),e.instance.range(e.invert?[1,0]:[0,1]))}function Br(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=Cr(),r={instance:null,invert:!1},o={data:t,resources:n},s=jr(e,Pr,o);let a;function l(e){return v(e)?NaN:i(e)}s.ticks=jr(e.ticks,Fr,o),s.minorTicks=jr(e.minorTicks,Lr,o),l.data=()=>t,l.invert=function(e){return i.invert(e)},l.rangeRound=function(e){return i.rangeRound(e),l},l.clamp=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return i.clamp(e),l},l.cachedTicks=function(){return a},l.clearTicksCache=function(){return a=void 0,this},l.ticks=function(e){return null!==e&&"object"==typeof e?(e.settings=e.settings||{},e.settings=u(!0,{},s,e.settings),e.scale=l,a=Ir(e),a):(a=i.ticks(e),a)},l.nice=function(e){return i.nice(e),l},l.tickFormat=function(e,t){return i.tickFormat(e,t)},l.interpolate=function(e){return i.interpolate(e),l},l.domain=function(e){return arguments.length?(i.domain(e),r.instance&&r.instance.domain([l.start(),l.end()]),l):i.domain()},l.range=function(e){return arguments.length?(i.range(e),l):i.range()},l.start=function(){return l.domain()[0]},l.end=function(){return l.domain()[this.domain().length-1]},l.min=function(){return Math.min(this.start(),this.end())},l.max=function(){return Math.max(this.start(),this.end())},l.classify=function(e){let t=(l.start()-l.end())/e,n=[l.end()],i=[],r=t/2;for(let o=0;o<e;o++){let e=n[n.length-1]||0,o=e+t,s=l(e+r);n.push(o,o),i.push(s,s)}return n.pop(),l.domain(n),l.range(i),l},l.copy=function(){const r=Br(e,t,n);return r.domain(l.domain()),r.range(l.range()),r.clamp(i.clamp()),r},l.norm=function(e){return $r(r,l),r.instance(e)},l.normInvert=function(e){return $r(r,l),r.instance.invert(e)};const c=function(e,t){const n=+e.min,i=+e.max;let r=0,o=1;if(t&&t[0]){const n=t.map(e=>e.min()).filter(e=>!isNaN(e)),i=t.map(e=>e.max()).filter(e=>!isNaN(e));if(r=n.length?Math.min(...n):Number.NaN,o=i.length?Math.max(...i):Number.NaN,isNaN(r)||isNaN(o))r=-1,o=1;else if(r===o&&0===r)r=-1,o=1;else if(r===o&&r)r-=Math.abs(.1*r),o+=Math.abs(.1*o);else if(!isNaN(e.expand)){const t=o-r;r-=t*e.expand,o+=t*e.expand}if(Array.isArray(e.include)){const t=e.include.filter(e=>!isNaN(e));r=Math.min(...t,r),o=Math.max(...t,o)}}return{mini:isNaN(n)?r:n,maxi:isNaN(i)?o:i}}(s,t?t.fields:[]),h=c.mini,d=c.maxi;return l.domain([h,d]),l.range(s.invert?[1,0]:[0,1]),r.invert=s.invert,l}const Hr={padding:0,paddingInner:NaN,paddingOuter:NaN,align:.5,invert:!1,maxPxStep:NaN,range:[0,1]};function Wr(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n={data:t,resources:arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}},i=jr(e,Hr,n),r=t.items||[],o={},s=[],a=[];function l(e,n){e.data=()=>t,e.datum=e=>r[o[e]],e.start=function(){return e.domain()[0]},e.end=function(){return e.domain()[e.domain().length-1]},e.labels=()=>a,e.ticks=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t.scale=e,function(e){let t=e.scale;const n=t.domain(),i=t.data().items,r=t.labels?t.labels():n,o=t.bandwidth();return n.map((e,n)=>{const s=t(e);return{position:s+o/2,label:"".concat(r[n]),data:i?i[n]:void 0,start:s,end:s+o}})}(t,n.trackBy)}}const c=_i();l(c,e),c.pxScale=function(t){const n=i.maxPxStep;if(isNaN(n))return c;const r=c.domain().length,o=Math.max(1,r-c.paddingInner()+2*c.paddingOuter());if(o*n>=t)return c;const s=c.copy();s.type=c.type,l(s,e);const a=o*n/t,u=(1-a)*c.align();return s.range(i.invert?[a+u,u]:[u,a+u]),s};const h="function"==typeof e.value?e.value:e=>e.datum.value,d="function"==typeof e.label?e.label:e=>e.datum.label;for(let e=0;e<r.length;e++){const t=u({datum:r[e]},n),i=h(t,e);-1===s.indexOf(i)&&(s.push(i),a.push(d(t,e)),o[i]=e)}return c.domain(s),c.range(i.invert?i.range.slice().reverse():i.range),c.padding(isNaN(i.padding)?0:i.padding),isNaN(i.paddingInner)||c.paddingInner(i.paddingInner),isNaN(i.paddingOuter)||c.paddingOuter(i.paddingOuter),c.align(isNaN(i.align)?.5:i.align),c}const Vr={depth:0};function Ur(e,t,n){return e.ancestors().map(e=>t(u({datum:e.data},n))).reverse().slice(1).toString()}const Yr=e=>e.min(),Kr=e=>e.max();function Xr(e,t){const n=e&&!isNaN(e.min),i=e&&!isNaN(e.max);let r=n?+e.min:0,o=i?+e.max:1;if(t&&t.length){if(!n){const e=t.map(Yr).filter(x);r=e.length?Math.min(...e):r}if(!i){const e=t.map(Kr).filter(x);o=e.length?Math.max(...e):o}}return[r,o]}const Gr={domain:[],range:[],invert:!1,min:NaN,max:NaN};function Jr(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=Br(e,t,n).clamp(!0).interpolate(ar),r=jr(e,Gr,{data:t,resources:n}),o=Array.isArray(r.domain)&&r.domain.length,s=Array.isArray(r.range)&&r.range.length,a=i;u(!0,a,i);const l=m(Xr(r,t?t.fields:[]),2),c=l[0],h=l[1],d=o?r.domain.length:-1,f=n.theme?n.theme.palette("sequential",d>0?d:2):[],p=s?r.range:f;return a.range(r.invert?p.slice().reverse():p.slice()),a.domain(o?r.domain:function(e,t,n){const i=e.length;if(2===i)return[t,n];const r=[],o=(n-t)/(i-1);r.push(t);for(let e=1;e<i-1;e++)r.push(t+o*e);return r.push(n),r}(a.range(),c,h)),a}const Zr={domain:[],range:[],invert:!1,min:NaN,max:NaN,nice:!1};function Qr(e){const t=[];for(let n=0;n<e.length-1;n++)t.push((e[n]+e[n+1])/2);return t}const eo={domain:[],range:[]};const to={domain:[],range:[],unknown:void 0},no={domain:[],range:[],override:!1};const io=Ee();function ro(e,t,n){let i=e.data;e.source&&(n.logger.warn("Deprecated: Scale data source configuration"),i={extract:[]},(Array.isArray(e.source)?e.source:[e.source]).forEach(e=>{i.extract.push({field:e})}));const r=xi(i,t,n);let o,s=e.type||function(e){return e.root?"h-band":e.fields&&e.fields[0]?function(e){const t=e.map(e=>"dimension"===e.type()?"band":"linear");return-1!==t.indexOf("linear")?"linear":"band"}(e.fields):"linear"}(r);return"color"===s&&(s=r.fields&&r.fields[0]&&"dimension"===r.fields[0].type()?"categorical-color":"sequential-color"),n.scale.has(s)&&(o=n.scale.get(s),o=o(e,r,{theme:n.theme,logger:n.logger}),o.type=s),o}io("linear",Br),io("band",Wr),io("h-band",function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r={data:n,resources:i},o=jr(t,Hr,r);o.ticks=jr(t.ticks,Vr,r),o.value="function"==typeof t.value?t.value:e=>e.datum.value,o.label="function"==typeof t.label?t.label:e=>e.datum.value;let s=Wr(o);const a=function(e,t,n){const i=t.ticks.depth,r=t.value,o=t.label,s=[],a=[],l={},c=[];let h=0;if(!e)return{values:s,labels:a,items:l,ticks:c};e.eachAfter(e=>{if(e.depth>0){const t=Ur(e,r,n),d=e.leaves()||[e],f=r(u({datum:e.data},n)),p=o(u({datum:e.data},n)),g=Array.isArray(e.children),m={key:t,count:d.length,value:f,label:p,leftEdge:Ur(d[0],r,n),rightEdge:Ur(d[Math.max(d.length-1,0)],r,n),node:e};g?(s.push("SPACER_".concat(h,"_SPACER")),h++):(s.push(t),a.push(p)),(i<=0&&!g||e.depth===i)&&c.push(m),l[t]=m}});const d=e.height-1;return d>0&&s.splice(-d),{values:s,labels:a,items:l,ticks:c}}(n.root,o,r),l=a.values,c=a.labels,h=a.items,d=a.ticks,f=function(e){const t=String(e),n=h[t];return s(n?o.invert?n.rightEdge:n.leftEdge:t)};u(!0,f,s),f.bandwidth=function(e){const t=h[String(e)],n=s.bandwidth();if(t&&!t.isLeaf){const e=f(t.leftEdge),i=f(t.rightEdge);return Math.abs(e-i)+n}return n},f.step=function(e){const t=h[String(e)],n=t?t.count:1;let i=s.step();return i*=n,i},f.data=()=>n,f.datum=e=>{const t=h[String(e)];return t?t.node.data:null},f.copy=()=>e(t,n,i),f.labels=()=>c,f.ticks=()=>d.map(e=>{const t=f(e.key),n=f.bandwidth(e.key);return{position:t+n/2,label:e.label,data:e.node.data,start:t,end:t+n}});const p=s.pxScale;return f.pxScale=function(e){return s=p(e),f},f.domain(l),f}),io("sequential-color",Jr),io("threshold-color",function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=Nr(),r=jr(e,Zr,{data:t,resources:n}),o=Array.isArray(r.domain)&&r.domain.length,s=Array.isArray(r.range)&&r.range.length;function a(e){return v(e)?NaN:i(e)}Object.keys(i).forEach(e=>a[e]=i[e]);const l=m(Xr(r,t.fields),2),c=l[0],u=l[1],h=o?r.domain.length:-1,d=n.theme?n.theme.palette("sequential",h>0?h:2):[];let f=s?r.range:d,p=[];return p=o?r.domain:r.nice?function(e,t,n){const i=2===e.length?10:Math.max(1,e.length),r=Cr().domain([t,n]).nice(i).ticks(i);if(!e||!e.length)return r;const o=Math.max(0,e.length-1);for(;r.length>o;)r[0]-t<=n-r[r.length-1]?r.shift():r.pop();return r}(f,c,u):[c+(u-c)/2],f.length>p.length+1?p=function(e,t,n){const i=e.length;if(2===i)return[t+(n-t)/2];const r=[],o=(n-t)/i;for(let e=1;e<i;e++)r.push(t+o*e);return r}(f,c,u):f.length<p.length+1&&(f=function(e,t,n,i){n=e[0],i=e&&e.length>=2?e[e.length-1]:i;const r=Jr().domain([n,i]).range(t);return[n,...Qr(e),i].map(e=>r(e))}(p,f,c,u)),a.data=()=>t,a.range(r.invert?f.slice().reverse():f),a.domain(p),a}),io("categorical-color",function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=ki(),r={data:t,resources:n},o=jr(e,eo,r),s="function"==typeof e.value?e.value:e=>e.datum.value,a="function"==typeof e.label?e.label:e=>e.datum.label,l=t.items||[],c={},h=[],d=[];for(let e=0;e<l.length;e++){const t=u({datum:l[e]},r),n=s(t,e);-1===h.indexOf(n)&&(h.push(n),d.push(a(t,e)),c[n]=e)}return i.data=()=>t,i.labels=()=>d,i.label=e=>d[h.indexOf(e)],i.datum=e=>l[c[e]],i.range(o.range),Array.isArray(o.domain)&&o.domain.length?i.domain(o.domain):i.domain(h),i}(e,t,n),r=n.theme,o=jr(e,to,{data:t,resources:n});let s;if(o.explicit=jr(e.explicit,no,{data:t,resources:n}),s=Array.isArray(o.range)&&0!==o.range.length?o.range.slice():r?r.palette("categorical",i.domain().length).slice():[],o.unknown)i.unknown(o.unknown);else if(r&&r.palette("unknown")){let e=r.palette("unknown");i.unknown(e[0])}if(Array.isArray(o.explicit.domain)&&o.explicit.domain.length){const e=i.domain().slice(),t=o.explicit.domain,n=Array.isArray(o.explicit.range)?o.explicit.range:[],r=Math.floor(e.length/s.length);for(let e=1;e<r+1;e*=2)s=s.concat(s);if(o.explicit.override)for(let i=0;i<t.length;i++){const r=e.indexOf(t[i]);r>-1&&(s[r]=n[i])}else{const i=t.map((t,i)=>[e.indexOf(t),t,n[i]]).sort((e,t)=>e[0]-t[0]);i.forEach(t=>{const n=e.indexOf(t[1]);-1!==n&&s.splice(n,0,t[2])})}s.length=e.length}return i.range(s),i});var oo={};function so(){so.init.call(this)}oo.isObject=function(e){return"object"==typeof e&&null!==e},oo.isNumber=function(e){return"number"==typeof e},oo.isUndefined=function(e){return void 0===e},oo.isFunction=function(e){return"function"==typeof e};var ao=so;so.EventEmitter=so,so.prototype._events=void 0,so.prototype._maxListeners=void 0,so.defaultMaxListeners=10,so.init=function(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0},so.prototype.setMaxListeners=function(e){if(!oo.isNumber(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},so.prototype.emit=function(e){var t,n,i,r,o,s;if(this._events||(this._events={}),"error"===e&&!this._events.error)throw(t=arguments[1])instanceof Error?t:Error('Uncaught, unspecified "error" event.');if(n=this._events[e],oo.isUndefined(n))return!1;if(oo.isFunction(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:for(i=arguments.length,r=new Array(i-1),o=1;o<i;o++)r[o-1]=arguments[o];n.apply(this,r)}else if(oo.isObject(n)){for(i=arguments.length,r=new Array(i-1),o=1;o<i;o++)r[o-1]=arguments[o];for(i=(s=n.slice()).length,o=0;o<i;o++)s[o].apply(this,r)}return!0},so.prototype.addListener=function(e,t){var n;if(!oo.isFunction(t))throw TypeError("listener must be a function");(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,oo.isFunction(t.listener)?t.listener:t),this._events[e]?oo.isObject(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,oo.isObject(this._events[e])&&!this._events[e].warned)&&((n=oo.isUndefined(this._maxListeners)?so.defaultMaxListeners:this._maxListeners)&&n>0&&this._events[e].length>n&&(this._events[e].warned=!0,oo.isFunction(console.error)&&console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),oo.isFunction(console.trace)&&console.trace()));return this},so.prototype.on=so.prototype.addListener,so.prototype.once=function(e,t){if(!oo.isFunction(t))throw TypeError("listener must be a function");var n=!1;function i(){this.removeListener(e,i),n||(n=!0,t.apply(this,arguments))}return i.listener=t,this.on(e,i),this},so.prototype.removeListener=function(e,t){var n,i,r,o;if(!oo.isFunction(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(r=(n=this._events[e]).length,i=-1,n===t||oo.isFunction(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(oo.isObject(n)){for(o=r;o-- >0;)if(n[o]===t||n[o].listener&&n[o].listener===t){i=o;break}if(i<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(i,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},so.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[e],oo.isFunction(n))this.removeListener(e,n);else if(Array.isArray(n))for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},so.prototype.listeners=function(e){return this._events&&this._events[e]?oo.isFunction(this._events[e])?[this._events[e]]:this._events[e].slice():[]},so.listenerCount=function(e,t){return e._events&&e._events[t]?oo.isFunction(e._events[t])?1:e._events[t].length:0};var lo={mixin:e=>(Object.keys(ao.prototype).forEach(t=>{e[t]=ao.prototype[t]}),ao.init(e),e)};function co(){let e=0,t=0,n=0,i=0;n=n||e;const r={move(e){this.moveTo(n+e)},moveTo(o){const s=Math.max(e,Math.min(t-i,o));n!==s&&(n=s,r.emit("update"))},update(o){let s=!1;var a=o.min;e=void 0===a?e:a;var l=o.max;t=void 0===l?t:l,void 0!==o.viewSize&&o.viewSize!==i&&(i=o.viewSize,s=!0);const c=Math.max(e,Math.min(t-i,n));n!==c&&(n=c,s=!0),s&&r.emit("update")},getState:()=>({min:e,max:t,start:n,viewSize:i})};return lo.mixin(r),r}function uo(e,t){const n=e.min||0,i=e.max||0,r=e.viewSize||0,o=t||co();return o.update({min:n,max:i,viewSize:r}),o}function ho(e,t){return e<=t}function fo(e,t){return e<t}function po(e,t,n){let i=0;for(;i<e.length&&t>e[i];)++i;return e[i]===t&&n&&++i,i}function go(){let e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=[];function r(){}return r.configure=function(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const i=n.includeMax,r=void 0===i||i,o=n.includeMin;e=r?ho:fo,t=void 0===o||o?ho:fo},r.add=e=>{let t=e.min,n=e.max;const r=po(i,t),o=po(i,n,!0),s=[r,o-r];r%2==0&&s.push(t),o%2==0&&s.push(n);const a=i.join(",");i.splice(...s);return a!==i.join(",")},r.remove=e=>{let t=e.min,n=e.max;const r=po(i,t),o=po(i,n,!0),s=[r,o-r];r%2==1&&s.push(t),o%2==1&&s.push(n);const a=i.join(",");i.splice(...s);return a!==i.join(",")},r.set=e=>{const t=i.join(",");i=[],Array.isArray(e)?e.forEach(r.add):r.add(e);return t!==i.join(",")},r.clear=()=>{const e=i.length>0;return i=[],e},r.containsValue=n=>function(e,t,n,i){const r=e.length;for(let o=1;o<r;o+=2)if(n(e[o-1],t)&&i(t,e[o]))return!0;return!1}(i,n,t,e),r.containsRange=e=>{let t=e.min,n=e.max;const r=po(i,t,!0),o=po(i,n);return r===o&&o%2==1},r.toggle=e=>r.containsRange(e)?r.remove(e):r.add(e),r.ranges=()=>{const e=[];for(let t=1;t<i.length;t+=2)e.push({min:i[t-1],max:i[t]});return e},r.configure(n),r}function mo(){let e=[];function t(){}return t.add=t=>-1===e.indexOf(t)&&(e.push(t),!0),t.remove=t=>{const n=e.indexOf(t);return-1!==n&&(e.splice(n,1),!0)},t.contains=t=>-1!==e.indexOf(t),t.values=()=>e.slice(),t.clear=()=>e=[],t.toString=()=>e.join(";"),t}const yo={key:void 0,includeMin:!0,includeMax:!0};function xo(e){let t=e.items,n=e.collection,i=e.vc;const r={},o=[];let s,a;for(let e=0,o=t.length;e<o;e++){s=t[e].key,n[s]||(n[s]=i()),a=t[e].values||[t[e].value];for(let e=0;e<a.length;e++)n[s].add(a[e])&&(r[s]=r[s]||[],r[s].push(a[e]))}const l=Object.keys(r);for(let e=0,t=l.length;e<t;e++)s=l[e],o.push({id:s,values:r[s]});return o}function vo(e){let t=e.items,n=e.collection;const i={},r=[];let o,s;for(let e=0,r=t.length;e<r;e++)if(o=t[e].key,n[o]){s=t[e].values||[t[e].value];for(let e=0;e<s.length;e++)n[o].remove(s[e])&&(i[o]=i[o]||[],i[o].push(s[e]))}const a=Object.keys(i);for(let e=0,t=a.length;e<t;e++)o=a[e],r.push({id:o,values:i[o]});return r}function bo(e){const t={};let n,i;for(let r=0,o=e.length;r<o;r++){n=e[r].key,i=e[r].values||[e[r].value],t[n]||(t[n]=[]);for(let e=0;e<i.length;e++){-1===t[n].indexOf(i[e])&&t[n].push(i[e])}}return t}function wo(e){let t=e.key,n=e.collection,i=e.obj,r=e.fn,o=e.value;n[t]||(n[t]=r()),i[t]=i[t]||[],i[t].push(o),n[t].add(o)}function ko(e,t){const n=[],i=Object.keys(e);let r,o;const s=e=>-1===t[r].indexOf(e);for(let a=0,l=i.length;a<l;a++)r=i[a],t[r]?(o=e[r].filter(s),o.length&&n.push({id:r,values:o})):n.push({id:r,values:e[r]});return n}function _o(e,t,n){const i=function(e,t){if(!Object.keys(t).length)return e;const n=e.length,i=Array(n);for(let r=0;r<n;r++)i[r]=e[r].key in t?u({},e[r],{key:t[e[r].key]}):e[r];return i}(t,n);return e&&e.length?e.reduce((e,t)=>t(e),i):i}function Mo(e){return e.replace(/(-[a-z])/g,e=>e.toUpperCase().replace("-",""))}function So(e){return e.replace(/([A-Z])/g,e=>"-".concat(e.toLowerCase()))}function Ro(e,t,n){let i=n.ranges,r=n.interceptors,o=n.rc,s=n.aliases,a=n.rangeConfig;const l=_o(r["".concat(t,"Ranges")],e,s);let c=!1;return l.forEach(e=>{const n=e.key;if(i[n]||(i[n]=o(a.sources[n]||a.default)),"set"===t)c=i[n][t](e.ranges||e.range)||c;else{const r=e.ranges||[e.range];for(let e=0;e<r.length;e++)c=i[n][t](r[e])||c}}),c}function Co(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.vc,n=void 0===t?mo:t,i=e.rc,r=void 0===i?go:i,o=!1,s={},a={},l={},c={sources:{},default:u({},yo)};const h={addValues:[],removeValues:[],toggleValues:[],setValues:[],addRanges:[],setRanges:[],removeRanges:[],toggleRanges:[]},d=()=>{const e={values:{},ranges:{}};return Object.keys(a).forEach(t=>{e.values[t]=a[t].values()}),Object.keys(s).forEach(t=>{e.ranges[t]=s[t].ranges()}),e},f={ls:[],clear(){this.ls.forEach(e=>e.clear())},start(){this.ls.forEach(e=>e.start())},end(){this.ls.forEach(e=>e.end())},update(){const e=d();this.ls.forEach(t=>t._state(e))},updateValues(){const e=d();this.ls.forEach(t=>t._state({values:e.values}))},updateRanges(){const e=d();this.ls.forEach(t=>t._state({ranges:e.ranges}))}},p={configure:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Array.isArray(e.ranges)&&e.ranges.length&&(c={sources:{},default:u({},yo)},e.ranges.forEach(e=>{const t={};Object.keys(yo).filter(e=>"key"!==e).forEach(n=>{t[n]=void 0!==e[n]?e[n]:yo[n]}),void 0!==e.key?c.sources[e.key]=t:c.default=t}),Object.keys(s).forEach(e=>s[e].configure(c.sources[e]||c.default)),p.emit("update",[],[]))},link:e=>{if(p===e)throw new Error("Can't link to self");f.ls.push(e),e._state(d())},_state:e=>{if(!e)return d();if(e.values){const t=[];Object.keys(e.values).forEach(n=>{a[n]&&e.values[n].join(";")===a[n].toString()||t.push({key:n,values:e.values[n]})}),Object.keys(a).forEach(n=>{e.values[n]||t.push({key:n,values:[]})}),t.length&&p.setValues(t)}if(e.ranges){const t=[];Object.keys(e.ranges).forEach(n=>{s[n]&&e.ranges[n].join(";")===s[n].toString()||t.push({key:n,ranges:e.ranges[n]})}),Object.keys(s).forEach(n=>{e.ranges[n]||t.push({key:n,ranges:[]})}),t.length&&p.setRanges(t)}},start:function(){if(!o){o=!0;for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];p.emit("start",...t),f.start()}},end:function(){if(o){o=!1,s={},a={};for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];p.emit("end",...t),f.end()}},isActive:()=>o,clear:()=>{const e=p.brushes().filter(e=>"value"===e.type&&e.brush.values().length).map(e=>({id:e.id,values:e.brush.values()})),t=Object.keys(s).length>0||e.length;s={},a={},t&&(p.emit("update",[],e),f.clear())},brushes:()=>{let e=[];return e=e.concat(Object.keys(s).map(e=>({type:"range",id:e,brush:s[e]}))),e=e.concat(Object.keys(a).map(e=>({type:"value",id:e,brush:a[e]}))),e},addValue:(e,t)=>{p.addValues([{key:e,value:t}])},addValues:e=>{const t=_o(h.addValues,e,l),i=xo({vc:n,collection:a,items:t});p.emit("add-values",t),i.length&&(o||(o=!0,p.emit("start")),p.emit("update",i,[]),f.updateValues())}};return p.setValues=e=>{const t=_o(h.setValues,e,l),i=function(e){let t=e.items,n=e.vCollection,i=e.vc;const r={},o=bo(t);let s,a=[],l=[];const c={},u=Object.keys(n);for(let e=0,t=u.length;e<t;e++)s=u[e],c[s]=n[s].values().slice(),delete n[s];const h=e=>{n[s]&&n[s].contains(e)||wo({key:s,value:e,collection:n,obj:r,fn:i})},d=Object.keys(o);for(let e=0,t=d.length;e<t;e++)s=d[e],o[s].forEach(h);return l=ko(c,r),a=ko(r,c),[a,l]}({items:t,vCollection:a,vc:n});p.emit("set-values",t),(i[0].length>0||i[1].length>0)&&(o||(o=!0,p.emit("start")),p.emit("update",i[0],i[1]),f.updateValues())},p.removeValue=(e,t)=>{p.removeValues([{key:e,value:t}])},p.removeValues=e=>{const t=_o(h.removeValues,e,l),n=vo({collection:a,items:t});p.emit("remove-values",t),n.length&&(p.emit("update",[],n),f.updateValues())},p.addAndRemoveValues=(e,t)=>{const i=_o(h.addValues,e,l),r=_o(h.removeValues,t,l),s=xo({vc:n,collection:a,items:i}),c=vo({collection:a,items:r});p.emit("add-values",i),p.emit("remove-values",r),(s.length||c.length)&&(o||(o=!0,p.emit("start")),p.emit("update",s,c),f.updateValues())},p.toggleValue=(e,t)=>{p.toggleValues([{key:e,value:t}])},p.toggleValues=e=>{const t=_o(h.toggleValues,e,l),i=function(e){let t=e.items,n=e.values,i=e.vc;const r={},o={},s=[],a=[],l=bo(t);let c,u,h;const d=Object.keys(l);for(let e=0,t=d.length;e<t;e++){c=d[e],h=l[c];for(let e=0,t=h.length;e<t;e++)u=h[e],n[c]&&n[c].contains(u)?n[c]&&n[c].contains(u)&&(o[c]=o[c]||[],o[c].push(u),n[c].remove(u)):wo({key:c,value:u,collection:n,obj:r,fn:i})}const f=Object.keys(r);for(let e=0,t=f.length;e<t;e++)c=f[e],s.push({id:c,values:r[c]});const p=Object.keys(o);for(let e=0,t=p.length;e<t;e++)c=p[e],a.push({id:c,values:o[c]});return[s,a]}({items:t,values:a,vc:n});p.emit("toggle-values",t),(i[0].length>0||i[1].length>0)&&(o||(o=!0,p.emit("start")),p.emit("update",i[0],i[1]),f.updateValues())},p.containsValue=(e,t)=>{let n=l[e]||e;return!!a[n]&&a[n].contains(t)},p.addRange=(e,t)=>{p.addRanges([{key:e,range:t}])},p.addRanges=e=>{Ro(e,"add",{ranges:s,rc:r,interceptors:h,aliases:l,rangeConfig:c})&&(o||(o=!0,p.emit("start")),p.emit("update",[],[]),f.updateRanges())},p.removeRange=(e,t)=>{p.removeRanges([{key:e,range:t}])},p.removeRanges=e=>{Ro(e,"remove",{ranges:s,rc:r,interceptors:h,aliases:l,rangeConfig:c})&&(o||(o=!0,p.emit("start")),p.emit("update",[],[]),f.updateRanges())},p.setRange=(e,t)=>{p.setRanges([{key:e,range:t}])},p.setRanges=e=>{Ro(e,"set",{ranges:s,rc:r,interceptors:h,aliases:l,rangeConfig:c})&&(o||(o=!0,p.emit("start")),p.emit("update",[],[]),f.updateRanges())},p.toggleRange=(e,t)=>{p.toggleRanges([{key:e,range:t}])},p.toggleRanges=e=>{Ro(e,"toggle",{ranges:s,rc:r,interceptors:h,aliases:l,rangeConfig:c})&&(o||(o=!0,p.emit("start")),p.emit("update",[],[]),f.updateRanges())},p.containsRangeValue=(e,t)=>{let n=l[e]||e;return!!s[n]&&s[n].containsValue(t)},p.containsRange=(e,t)=>{let n=l[e]||e;return!!s[n]&&s[n].containsRange(t)},p.containsMappedData=(e,t,n)=>{let i=[];const r=Object.keys(e);let o,c,u,h;for(let t=0,n=r.length;t<n;t++){if(o=r[t],"value"===o)c=e,i[t]={key:"",i:t,bool:!1};else{if("source"===o)continue;c=e[o],i[t]={key:o,i:t,bool:!1}}u=c.source&&c.source.field,void 0!==u&&(void 0!==c.source.key&&(u="".concat(c.source.key,"/").concat(u)),u in l&&(u=l[u]),h=c.value,s[u]?i[t].bool=Array.isArray(h)?s[u].containsRange({min:h[0],max:h[1]}):s[u].containsValue(h):a[u]&&a[u].contains(h)&&(i[t].bool=!0))}return t?(i=i.filter(e=>-1!==t.indexOf(e.key)),"and"===n?!!i.length&&!i.some(e=>!1===e.bool):"xor"===n?!!i.length&&i.some(e=>e.bool)&&i.some(e=>!1===e.bool):i.some(e=>e.bool)):i.some(e=>e.bool)},p.intercept=(e,t)=>{const n=Mo(e);h[n]&&h[n].push(t)},p.removeInterceptor=(e,t)=>{const n=Mo(e);if(!h[n])return;const i=h[n].indexOf(t);-1!==i&&h[n].splice(i,1)},p.removeAllInterceptors=e=>{const t=[];if(e){const n=Mo(e);h[n]&&h[n].length&&t.push({name:e,handlers:h[n]})}else Object.keys(h).forEach(e=>{h[e].length&&t.push({name:So(e),handlers:h[e]})});t.forEach(e=>{e.handlers.slice().forEach(t=>p.removeInterceptor(e.name,t))})},p.addKeyAlias=(e,t)=>{l[e]=t},p.removeKeyAlias=e=>{delete l[e]},lo.mixin(p),p}function No(e){return e*e*e}function Do(e){return--e*e*e+1}function qo(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}Ee();const Eo=["stroke","fill","color","backgroundColor","thumbColor"];function zo(e,t){const n=t?t.length:0,i=e?Math.min(n,e.length):0,r=new Array(i),o=new Array(n);let s;for(s=0;s<i;++s)r[s]=Ao(e[s],t[s]);for(;s<n;++s)o[s]=t[s];return function(e){for(s=0;s<i;++s)o[s]=r[s](e);return o}}function Ao(e,t,n){const i=typeof t;let r;return null==t||"boolean"===i?function(e){return()=>e}(t):("number"===i?hr:"string"===i?(r=Bi(t))&&Eo.includes(n)?(t=r,ar):gr:t instanceof Bi?ar:t instanceof Date?ur:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}(t)?lr:Array.isArray(t)?zo:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?Oo:hr)(e,t)}function Oo(e,t){const n={},i={};let r;for(r in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)r in e?n[r]=Ao(e[r],t[r],r):i[r]=t[r];return function(e){for(r in n)i[r]=n[r](e);return i}}function To(e,t){return e.data?e.data.value:"text"===e.type?e.text:t}const Io={fontFamily:"Arial",fontSize:"13px",color:"#595959",backgroundColor:"#ffffff",stroke:"#000000",strokeWidth:0,$fill:"#333333"},jo=/^\$/;function Po(e){const t=typeof e;return"object"!==t&&"function"!==t&&"undefined"!==t}function Fo(e,t,n){const i=e[t];i&&i.scale&&i.scale.pxScale?i.scale=i.scale.pxScale(n):i&&i.pxScale&&(e[t]=i.pxScale(n))}function Lo(e,t){return e.pxScale?e.pxScale(t):e}const $o={normalizeSettings:function(e,t,n){const i=u({},e),r=u({},t);return Object.keys(i).forEach(e=>{r[e]={};const o=i[e],s=typeof o;if("function"==typeof o)r[e].fn=o;else if(Po(o)){let n=t[e];"string"==typeof n&&jo.test(n)&&(n=Io[n]);const i=typeof n;r[e]="undefined"===i||i===s?o:n}else o&&"object"==typeof o&&("function"==typeof o.fn&&(r[e].fn=o.fn),void 0!==o.scale&&(r[e].scale=n.scale(o.scale)),"string"==typeof o.ref&&(r[e].ref=o.ref))}),Object.keys(t).forEach(e=>{if(e in i)return;const n=t[e];"string"===typeof n&&jo.test(n)?r[e]=Io[n]:r[e]=n}),r},resolveForItem:function(e,t,n){const i={},r=Object.keys(t),o=r.length,s=e.datum,a=e.datum;for(let l=0;l<o;l++){const o=r[l],c=t[o],u="object"==typeof a&&void 0!==c,h=u&&"string"==typeof c.ref,d=u&&o in a,f=h?a[c.ref]:d?a[o]:s;Po(c)?i[o]=c:u&&c.fn?(c.scale&&(e.scale=c.scale),i[o]=c.fn.call(null,e,n)):u&&c.scale&&f?(i[o]=c.scale(f.value),c.scale.bandwidth&&(i[o]+=c.scale.bandwidth()/2)):h&&f?i[o]=f.value:c.fn?i[o]=c.fn.call(null,e,n):i[o]=c}return i},updateScaleSize:Fo};function Bo(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).reduce((e,t)=>Array.isArray(t.children)?(e.push(...Bo(t.children)),e):(e.push(t),e),[])}function Ho(e,t){let n=t.context,i=t.data,r=t.style,o=t.filter,s=t.mode;const a=e.chart.brush(n),l=i,c=r.active||{},h=r.inactive||{},d=[];Object.keys(c).forEach(e=>{d.push(e)}),Object.keys(h).forEach(e=>{-1===d.indexOf(e)&&d.push(e)});const f=[];let p=!1;const g=()=>{let t=Bo(e.nodes);return"function"==typeof o&&(t=t.filter(o)),t},m=()=>{const e=g(),t=e.length;let n,i=!1;const r="function"==typeof l?l({brush:a}):l;for(let i=0;i<t;i++){if(n=e[i].data,!n)continue;e[i].__style||(e[i].__style={},d.forEach(t=>{e[i].__style[t]=e[i][t]}));const t=a.containsMappedData(n,r,s),o=f.indexOf(e[i]);let l=!1;t&&-1===o?(f.push(e[i]),l=!0):t||-1===o||(f.splice(o,1),l=!0),e[i].needToUpdate=l||p,e[i].isActive=t}for(let r=0;r<t;r++)if(n=e[r].data,n){if(e[r].needToUpdate){const t=u({},e[r],e[r].__style),n=e[r].isActive;d.forEach(i=>{e[r][i]=n&&i in c?"function"==typeof c[i]?c[i].call(null,t,f):c[i]:!n&&i in h?"function"==typeof h[i]?h[i].call(null,t,f):h[i]:e[r].__style[i]}),i=!0}delete e[r].needToUpdate}return p=!1,i},y=function(){const t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{suppressRender:!1}).suppressRender,n=g(),i=n.length;for(let e=0;e<i;e++)n[e].data&&(n[e].__style=n[e].__style||{},d.forEach(t=>{n[e].__style[t]=n[e][t],t in h&&(n[e][t]="function"==typeof h[t]?h[t].call(null,n[e]):h[t])}));p=!0,f.length=0,t||e.renderer.render(e.nodes)},x=function(){const t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{suppressRender:!1}).suppressRender,n=g(),i=n.length;for(let e=0;e<i;e++)n[e].__style&&(Object.keys(n[e].__style).forEach(t=>{n[e][t]=n[e].__style[t]}),n[e].__style=void 0);f.length=0,t||e.renderer.render(e.nodes)},v=()=>{if(m()){const t="function"==typeof e.config.sortNodes?e.config.sortNodes(e):e.nodes;"function"==typeof e.config.customRender?e.config.customRender({render:e.renderer.render,nodes:t}):e.renderer.render(t)}};return a.on("start",y),a.on("end",x),a.on("update",v),{isActive:()=>a.isActive(),update:()=>{f.length=0,p=!0,m()},cleanUp:function(){a.removeListener("start",y),a.removeListener("end",x),a.removeListener("update",v)}}}function Wo(e){let t=e.nodes,n=e.action,i=e.chart,r=e.trigger;const o=[];for(let e=0;e<t.length;e++){let n=t[e].data;null!==n&&o.push(n)}!function(e){let t=e.dataPoints,n=e.action,i=e.chart,r=e.trigger;if(!r)return;const o=r.data||[""];let s={items:[],actionFn:"toggleRanges"},a={items:[],actionFn:"toggleValues"};-1!==["add","remove","set","toggle"].indexOf(n)&&(s.actionFn="".concat(n,"Ranges"),a.actionFn="".concat(n,"Values"));for(let e=0;e<t.length;e++){const n=t[e];n&&o.forEach(e=>{let t=n&&!e?n:n[e];if(t){let e={key:t.source.field};void 0!==t.source.key&&(e.key="".concat(t.source.key,"/").concat(t.source.field)),Array.isArray(t.value)?(e.range={min:t.value[0],max:t.value[1]},s.items.push(e)):(e.value=t.value,a.items.push(e))}})}r.contexts.forEach(e=>{s.items.length?i.brush(e)[s.actionFn](s.items):i.brush(e)[a.actionFn](a.items)})}({dataPoints:o,action:n,chart:i,trigger:r})}function Vo(e){let t=e.collisions,n=e.t,i=e.config,r=e.action,o=[],s=!1;t.length>0&&(o=t,s=!0,"stop"===n.propagation&&(o=[t[t.length-1]]));const a=o.map(e=>e.node);return Wo({nodes:a,action:r,chart:i.chart,data:i.data,trigger:n}),s}function Uo(e,t,n){const i=n.element().getBoundingClientRect();let r=y(e)?function(e,t){return 1!==e.changedTouches.length?null:{x:e.changedTouches[0].clientX-t.left,y:e.changedTouches[0].clientY-t.top}}(e,i):function(e,t){return{x:e.clientX-t.left,y:e.clientY-t.top}}(e,i);return null===r||r.x<0||r.y<0||r.x>i.width||r.y>i.height?[]:(t.touchRadius>0&&y(e)?r={cx:r.x,cy:r.y,r:t.touchRadius}:t.mouseRadius>0&&!y(e)&&(r={cx:r.x,cy:r.y,r:t.mouseRadius}),n.itemsAt(r))}function Yo(e,t,n){return e?"function"==typeof e?e(t):e:n}const Ko={fill:"fill",stroke:"stroke",opacity:"opacity",strokeWidth:"stroke-width",strokeLinejoin:"stroke-linejoin",fontFamily:"font-family",fontSize:"font-size",fontStyle:"font-style",textDecoration:"text-decoration",fontWeight:"font-weight",baseline:"dominant-baseline",dominantBaseline:"dominant-baseline",anchor:"text-anchor",textAnchor:"text-anchor",maxWidth:"maxWidth",transform:"transform",strokeDasharray:"stroke-dasharray",id:"id"};function Xo(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n="";for(let t=0;t<e.length;t++){const i=e[t];n+=0===t?"M".concat(i.x," ").concat(i.y):"L".concat(i.x," ").concat(i.y),n+=" "}return t&&(n+="Z"),n}function Go(e,t,n,i){const r=n/2,o=e-i/2,s=t-i/2,a=e-r,l=t-r;return[{x:o,y:s},{x:o,y:l},{x:o+i,y:l},{x:o+i,y:s},{x:a+n,y:s},{x:a+n,y:s+i},{x:o+i,y:s+i},{x:o+i,y:l+n},{x:o,y:l+n},{x:o,y:s+i},{x:a,y:s+i},{x:a,y:s}]}function Jo(e){return-e/180*Math.PI}function Zo(e){return function(e){let t=(.5*(Math.floor(e/Math.PI*2)+2)+.25)*Math.PI,n=Math.cos(Math.abs(t-e))*Math.sqrt(2),i=n*Math.cos(e),r=n*Math.sin(e);return{x1:i<0?1:0,y1:r<0?1:0,x2:i>=0?i:i+1,y2:r>=0?r:r+1}}(Jo(e))}function Qo(e,t){return{x:e.x+t.x,y:e.y+t.y}}function es(e,t){return{x:e.x-t.x,y:e.y-t.y}}function ts(e,t){return{x:e.x*t,y:e.y*t}}function ns(e,t){return e.x-t.x}function is(e,t){return e.y-t.y}function rs(e,t){return ns(e,t)**2+is(e,t)**2}function os(e,t){return Math.sqrt(rs(e,t))}function ss(e,t){return e.x*t.x+e.y*t.y}function as(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{x:0,y:0};const i=Math.cos(t),r=Math.sin(t),o=es(e,n);return Qo({x:i*o.x-r*o.y,y:r*o.x+i*o.y},n)}const ls={up:0,down:180,left:90,right:-90};function cs(e){let t=e.x,n=e.y,i=e.size;const r=i/2;return{type:"rect",x:t-r,y:n-r,width:i,height:i}}const us=Ee();us.add("circle",function(e){return{type:"circle",fill:"black",cx:e.x,cy:e.y,r:e.size/2}}),us.add("diamond",function(e){const t=e.size,n=e.x-t/2,i=e.y-t/2;return{type:"path",fill:"black",d:Xo([{x:n,y:i+t/2},{x:n+t/2,y:i},{x:n+t,y:i+t/2},{x:n+t/2,y:i+t},{x:n,y:i+t/2}])}}),us.add("saltire",function(e){const t=Jo(45),n=e.size/2,i=isNaN(e.width)?n/2:e.width,r=Math.min(i,n);let o=e.size;const s=Math.sin(Math.asin(-t))*(r/2);o+=2*(n/Math.sin(-t)-n),o-=2*s;const a={x:e.x,y:e.y},l=Go(e.x,e.y,o,r).map(e=>as(e,t,a));return{type:"path",fill:"black",d:Xo(l)}}),us.add("square",function(e){const t=e.size;return{type:"rect",fill:"black",x:e.x-t/2,y:e.y-t/2,width:t,height:t}}),us.add("triangle",function(e){const t=e.size,n={x:e.x,y:e.y},i=ls[e.direction]||0,r=t/2,o=e.x-r,s=e.y-r;let a=[{x:o,y:s+t},{x:o+r,y:s},{x:o+t,y:s+t},{x:o,y:s+t}];const l=Jo(i);return a=a.map(e=>as(e,l,n)),{type:"path",fill:"black",d:Xo(a)}}),us.add("line",function(e){const t="vertical"===e.direction,n=e.size/2,i=e.x,r=e.y;return{type:"line",stroke:"black",strokeWidth:1,x1:i-(t?0:n),y1:r-(t?n:0),x2:i+(t?0:n),y2:r+(t?n:0),collider:cs(e)}}),us.add("star",function(e){const t=e.size,n=[],i=t/2,r=e.points||5,o=Math.min(e.innerRadius||t/2,t)/2,s=isNaN(e.startAngle)?90:e.startAngle,a=360/r;for(let t=1;t<=r;t++){const r=a*t+s,l=Jo(r),c=Jo(r+a/2),u=Math.sin(l),h=Math.cos(l),d=Math.sin(c),f=Math.cos(c);n.push({x:e.x+h*i,y:e.y+u*i}),n.push({x:e.x+f*o,y:e.y+d*o})}return{type:"path",fill:"black",d:Xo(n)}}),us.add("n-polygon",function(e){const t=[],n=e.size/2,i=Math.max(isNaN(e.sides)?6:e.sides,3),r=360/i,o=isNaN(e.startAngle)?0:e.startAngle;for(let s=1;s<=i;s++){const i=Jo(r*s+o),a=Math.sin(i),l=Math.cos(i);t.push({x:e.x+l*n,y:e.y+a*n})}return{type:"path",fill:"black",d:Xo(t)}}),us.add("cross",function(e){const t=e.x,n=e.y,i=e.size/2,r=isNaN(e.width)?i/2:e.width,o=Math.min(r,i);return{type:"path",fill:"black",d:Xo(Go(t,n,e.size,o))}}),us.add("bar",function(e){const t={x:e.x,y:e.y},n="vertical"===e.direction,i=e.size/2,r=i/2/2;let o=[{x:t.x-i,y:t.y+r},{x:t.x-i,y:t.y-r},{x:t.x+i,y:t.y-r},{x:t.x+i,y:t.y+r}];if(n){const e=Jo(90);o=o.map(n=>as(n,e,t))}const s=_(o);return s.type="rect",s.fill="black",s}),us.add("rect",function(e){const t=e.x,n=e.y,i=e.size,r=void 0===e.width?i:e.width,o=void 0===e.height?i:e.height;return{type:"rect",fill:"black",x:t-r/2,y:n-o/2,width:r,height:o}}),us.add("image",function(e){const t=e.x,n=e.y,i=e.imageSettings||{},r=i.width,o=i.height,s=i.imageSrc,a=i.position;return{type:"image",x:t,y:n,width:r,height:o,src:s,symbol:i.symbol,r:10,cx:0,cy:0,imageScalingFactor:i.imageScalingFactor,imagePosition:a}});const hs=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:us;return function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const n=e.get(t.type);if(n){const e=n(t);return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object.keys(t).forEach(n=>{void 0!==Ko[n]&&"transform"!==n&&(e[n]=t[n])})}(e,t),void 0!==t.data&&(e.data=t.data),e}return n}};function ds(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.dock,i=void 0===n?"center":n,r=e.displayOrder,o=void 0===r?0:r,s=e.prioOrder,a=void 0===s?0:s,l=e.preferredSize,c=void 0===l?0:l,u=e.minimumLayoutMode,h=e.show,d=void 0===h||h;i=i||"center";return{computePreferredSize(e){let n=e.inner,i=e.outer,r=e.children;return"function"==typeof c?c({inner:n,outer:i,children:r,dock:this.dock()},t):c},dock(e){return void 0!==e?(i=e,this):"function"==typeof i?i(t):i},displayOrder(e){return void 0!==e?(o=e,this):"function"==typeof o?o(t):o},prioOrder(e){return void 0!==e?(a=e,this):"function"==typeof a?a(t):a},minimumLayoutMode(e){return void 0!==e?(u=e,this):"function"==typeof u?u(t):u},show(e){return void 0!==e?(d=e,this):"function"==typeof d?d(t):d}}}function fs(e,t,n){const i=t.require,r=void 0===i?[]:i,o=t.mediator||{},s=n.settings,a=n.formatter,l=n.scale,c=n.data,u=n.renderer,h=n.chart,d=n.dockConfig,f=n.mediator,p=n.instance,g=n.rect,m=n.style,y=n.registries,x=n.resolver,v=n.update,b=n._DO_NOT_USE_getInfo,w=n.symbol,k=n.isVisible;e.emit=()=>{},k&&(e.isVisible=k),Object.defineProperty(e,"settings",{get:s}),Object.defineProperty(e,"data",{get:c}),Object.defineProperty(e,"formatter",{get:a}),Object.defineProperty(e,"scale",{get:l}),Object.defineProperty(e,"mediator",{get:f}),Object.defineProperty(e,"style",{get:m}),Object.defineProperty(e,"registries",{get:y}),g&&Object.defineProperty(e,"rect",{get:g}),b&&(e._DO_NOT_USE_getInfo=b),Object.keys(t).forEach(n=>{var i;i=n,["on","preferredSize","created","beforeMount","mounted","resize","beforeUpdate","updated","beforeRender","render","beforeUnmount","beforeDestroy","destroyed","defaultSettings","data","settings","formatter","scale","chart","dockConfig","mediator","style","resolver","registries","_DO_NOT_USE_getInfo","symbol","isVisible"].some(e=>e===i)||("function"==typeof t[n]?e[n]=t[n].bind(e):e[n]=t[n])}),r.forEach(t=>{"renderer"===t?Object.defineProperty(e,"renderer",{get:u}):"chart"===t?Object.defineProperty(e,"chart",{get:h}):"dockConfig"===t?Object.defineProperty(e,"dockConfig",{get:d}):"instance"===t?Object.defineProperty(e,"instance",{get:p}):"update"===t&&v?Object.defineProperty(e,"update",{get:v}):"resolver"===t?Object.defineProperty(e,"resolver",{get:x}):"symbol"===t&&Object.defineProperty(e,"symbol",{get:w})}),Object.keys(o).forEach(t=>{e.mediator.on(t,o[t].bind(e))})}function ps(e,t,n){const i=t=>e[t]?(n.warn("Deprecation Warning the ".concat(t," property should be moved into layout: {} property")),e[t]):e.layout?e.layout[t]:void 0,r={};return r.displayOrder=i("displayOrder"),r.dock=i("dock"),r.prioOrder=i("prioOrder"),r.minimumLayoutMode=i("minimumLayoutMode"),e.layout=e.layout||{},e.layout.displayOrder=void 0!==r.displayOrder?r.displayOrder:e.layout.displayOrder,e.layout.prioOrder=void 0!==r.prioOrder?r.prioOrder:e.layout.prioOrder,e.layout.dock=r.dock||e.layout.dock,e.layout.minimumLayoutMode=r.minimumLayoutMode||e.layout.minimumLayoutMode,r.show=e.show,r.preferredSize=t,r}function gs(e,t,n){Object.keys(n.on||{}).forEach(i=>{e.eventListeners=e.eventListeners||[];const r=n.on[i].bind(e);e.eventListeners.push({event:i,listener:r}),t.on(i,r)}),e.emit=function(e){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return t.emit(e,...i)}}function ms(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=e.defaultSettings,i=void 0===n?{}:n,r=e._DO_NOT_USE_getInfo,o=void 0===r?()=>({}):r,s=t.chart,a=t.container,l=t.mediator,c=t.registries,h=t.theme,d=t.renderer,f=lo.mixin({});let p,m,y,x,v,b=t.settings||{},w=u(!0,{},i,b),k=[],_=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:$o,n={};return{resolve:function(i){let r=i.data,o=i.settings,s=i.defaults,a=void 0===s?{}:s,l=i.scaled;const c=n.norm=t.normalizeSettings(o,a,e.chart),u={scale:e.chart.scale,formatter:e.chart.formatter};l&&Object.keys(l).forEach(e=>{c[e]&&t.updateScaleSize(c,e,l[e])});const h=[];if(!r||!Array.isArray(r.items)){const e={data:r,resources:u};let i=t.resolveForItem(e,n.norm,-1);return{settings:n.norm,item:i}}{let e;for(let i=0,o=r.items.length;i<o;i++){e={datum:r.items[i],data:r,resources:u};let o=t.resolveForItem(e,n.norm,i);o.data=r.items[i],h.push(o)}}return{settings:n.norm,items:h}}}}({chart:s}),M=!1;const S={nodes:[],chart:s,config:w.brush||{},renderer:null},R={tap:[],over:[]},C=[],N={},D=u({},b);function q(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{},i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(){const r=void 0!==e[t],o=void 0!==b[t];let s;for(var a=arguments.length,l=new Array(a),c=0;c<a;c++)l[c]=arguments[c];return r&&("function"==typeof e[t]?s=e[t].call(N,...l):i&&(s=e[t])),o&&("function"==typeof b[t]?s=b[t].call(D,...l):i&&(s=b[t])),r||o||(s=n.call(N,...l)),s}}const E=q("preferredSize",()=>0,!0),z=q("resize",e=>e.inner),A=q("created"),O=q("beforeMount"),T=q("mounted"),I=q("beforeUnmount"),j=q("beforeUpdate"),P=q("updated"),F=q("beforeRender"),L=q("beforeDestroy"),$=q("destroyed"),B=e.render,H=()=>{w.brush&&(w.brush.consume||[]).forEach(e=>{e.context&&e.style&&C.push(Ho(S,e))})},W=()=>{w.brush&&(w.brush.trigger||[]).forEach(e=>{"over"===e.on?R.over.push(e):R.tap.push(e)})};Object.defineProperty(S,"data",{get:()=>k});const V=w.renderer||e.renderer,U=V?d||c.renderer(V)():d||c.renderer()();"function"==typeof U.settings&&U.settings(w.rendererSettings),S.renderer=U;const Y={resources:s.logger?{logger:s.logger()}:{}};let K=ds(ps(w,E,s.logger()),Y);const X=e=>{e.key=w.key,e.element=U.element()},G=()=>{};G.dockConfig=()=>K,G.set=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(e.settings&&(b=e.settings,w=u(!0,{},i,e.settings),K=ds(ps(w,E,s.logger()),Y),S.config=w.brush||{}),w.scale&&(p=s.scale(w.scale)),w.data){const e=w.rendererSettings,t="function"==typeof(null==e?void 0:e.progressive)&&e.progressive(),n=xi(w.data,{dataset:s.dataset,collection:s.dataCollection},{logger:s.logger()},s.dataCollection);t?t.isFirst?(k=n,k.items&&(k.items=[...n.items])):k.items&&(k.items=[...k.items,...n.items||[]]):k=n}else k=p?p.data():[];"string"==typeof w.formatter||"object"==typeof w.formatter?m=s.formatter(w.formatter):p&&p.data().fields&&(m=p.data().fields[0].formatter()),v=h.style(w.style||{})},G.resize=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=z({inner:e,outer:t});x=n?U.size(n):U.size(e),D.rect=u(!0,{computedPhysical:x.computedPhysical,computedOuter:t.computed||t,computedInner:e.computed||e},e),x=u(!0,{computedOuter:t.computed||t,computedInner:e.computed||e},x)},G.getRect=()=>D.rect;const J=()=>{const e=U.renderArgs?U.renderArgs.slice(0):[],t=w.rendererSettings;let n=k;const i="function"==typeof(null==t?void 0:t.progressive)&&t.progressive();return k.items&&i&&(n=g(g({},k),{},{items:k.items.slice(i.start,i.end)})),e.push({data:n}),e};let Z,Q,ee;function te(e){const t=w.rendererSettings,n="function"==typeof(null==t?void 0:t.progressive)&&t.progressive();n?n.isFirst?S.nodes=[...e||[]]:S.nodes&&(S.nodes=[...S.nodes,...e||[]]):S.nodes=e}G.beforeMount=O,G.beforeRender=()=>{F({size:x})},G.render=()=>{const e=B.call(N,...J());te(e),U.render(e),Z=e,Q=D.rect.computed},G.hide=()=>{G.unmount(),U.size({x:0,y:0,width:0,height:0}),U.clear()},G.beforeUpdate=()=>{j({settings:w,data:k})},G.update=()=>{ee&&ee.stop();const e=w,t=e.rendererSettings,n=e.brush,i=e.animations;if("function"==typeof(null==t?void 0:t.transform)&&t.transform())return U.render(),void(Z=null);const r=B.call(N,...J());te(r),C.forEach(e=>e.cleanUp()),C.length=0,R.tap=[],R.over=[],n&&(H(),W()),C.forEach(e=>{e.isActive()&&e.update()}),Z&&i&&("function"==typeof i.enabled?i.enabled():i.enabled)?(i.compensateForLayoutChanges&&i.compensateForLayoutChanges({currentNodes:Z,currentRect:D.rect.computed,previousRect:Q}),ee=function(e,t,n,i){let r,o=e.old,s=e.current,a=t.renderer,l=[],c={nodes:[],ips:[]},h={nodes:[],ips:[]},d={nodes:[],ips:[]},f=[],p=null;const g=n.trackBy||To,m={start(){let e={};if(o.forEach((t,n)=>{let i=g(t,n);e[i]=t}),s.forEach((t,n)=>{let i=g(t,n);if(e[i]){if("path"===t.type&&t.points&&t.points.length>0&&"trend"!==t.data.source.key){const n=function(e,t){const n=e.points.filter(e=>!e.dummy),i=t.points.filter(e=>!e.dummy),r=i.map(e=>e.data.major.value),o=n.filter(e=>r.includes(e.data.major.value)).map(e=>e.data.major.value),s=n.filter(e=>o.includes(e.data.major.value)),a=i.filter(e=>o.includes(e.data.major.value));return{old:s,current:a}}(e[i],t);d.ips.push(Oo(u({},e[i],{points:n.old}),u({},t,{points:n.current}))),l.push(u({},e[i],{commonPoints:n.old}))}else d.ips.push(Oo(e[i],t)),l.push(e[i]);d.nodes.push(t),e[i]=!1}else c.nodes.push(t),c.ips.push(Oo(u({},t,{r:.001,opacity:0}),t))}),Object.keys(e).forEach(t=>{e[t]&&(h.nodes.push(e[t]),h.ips.push(Oo(e[t],u({},e[t],{r:1e-4,opacity:0}))))}),f.push({name:"exiting",easing:No,duration:200,tweens:h.ips,nodes:[...l]}),f.push({name:"updating",easing:qo,duration:400,tweens:d.ips,nodes:[]}),f.push({name:"entering",easing:Do,duration:200,tweens:c.ips,nodes:[...d.nodes]}),n.isMainComponent){var t;const e=null===(t=n.isMainComponent)||void 0===t?void 0:t.filterFn,r=e?l.filter(e).length:l.length,o=i.getValue("animations.updatingStageMeta"),s=o.isInit,a=o.shouldBeRemoved;!1===s?(i.setValue("animations.updatingStageMeta.shouldBeRemoved",0===r),i.setValue("animations.updatingStageMeta.isInit",!0)):i.setValue("animations.updatingStageMeta.shouldBeRemoved",a&&0===r)}f.length&&(p=a.getScene(s),f[0].started=Date.now(),"undefined"!=typeof window&&(r=window.requestAnimationFrame(m.tick)))},tick(){let e=f[0];e||m.stop(),e.started||(e.started=Date.now());let t=(Date.now()-e.started)/e.duration,o=[],s=e.tweens.map(n=>n(e.easing(Math.min(1,t))));const l=n.adjustTweenedNodes;if(l&&l(s),o.push(...s),o.push(...e.nodes),a.render(o),t>=1){f.shift();const e=i.getValue("animations.updatingStageMeta"),t=e.isInit,n=e.shouldBeRemoved;f.length?"updating"===f[0].name&&n&&f.shift():(!0===t&&i.setValue("animations.updatingStageMeta.isInit",!1),m.stop())}r&&(r=window.requestAnimationFrame(m.tick))},stop(){r&&(window.cancelAnimationFrame(r),r=!1)},inProgress:()=>!!r,get targetScene(){return p}};return m}({old:Z,current:r},{renderer:U},i,s.storage),ee.start()):U.render(r),Z=r,Q=D.rect.computed,U.setKey&&"string"==typeof b.key&&U.setKey(b.key)},G.updated=P,G.destroy=()=>{G.unmount(),L(y),U.destroy(),$(),y=null};const ne=e=>{S.nodes=e,C.forEach(e=>{e.isActive()&&e.update()}),U.render(e)};return fs(N,e,{settings:()=>w,data:()=>k,scale:()=>p,formatter:()=>m,renderer:()=>U,chart:()=>s,dockConfig:()=>K,mediator:()=>l,instance:()=>D,rect:()=>D.rect,style:()=>v,update:()=>ne,registries:()=>c,resolver:()=>_,symbol:()=>hs(c.symbol)}),fs(D,b,{settings:()=>w,data:()=>k,scale:()=>p,formatter:()=>m,renderer:()=>U,chart:()=>s,dockConfig:()=>K,mediator:()=>l,style:()=>v,_DO_NOT_USE_getInfo:o.bind(N),isVisible:()=>M}),G.getBrushedShapes=function(e,t,n){const i=[];if(w.brush&&w.brush.consume){const r=s.brush(e),o=U.findShapes("*");w.brush.consume.filter(t=>t.context===e).forEach(e=>{for(let s=0;s<o.length;s++){const a=o[s];a.data&&r.containsMappedData(a.data,n||e.data,t)&&(X(a),i.push(a),o.splice(s,1),s--)}})}return i},G.findShapes=e=>{var t;const n=(null!==(t=ee)&&void 0!==t&&t.inProgress()?ee.targetScene:U).findShapes(e);for(let e=0,t=n.length;e<t;e++)X(n[e]);return n},G.shapesAt=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=U.itemsAt(e);let i;i=t&&"stop"===t.propagation&&n.length>0?[n.pop().node]:n.map(e=>e.node);for(let e=0,t=i.length;e<t;e++)X(i[e]);return i},G.brushFromShapes=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.contexts=Array.isArray(t.contexts)?t.contexts:[];Wo({nodes:e,action:t.action||"toggle",trigger:t,chart:s,data:S.data})},G.mount=()=>{y=U.element&&U.element()?y:U.appendTo(a),U.setKey&&"string"==typeof b.key&&U.setKey(b.key),w.brush&&(H(),W()),gs(D,f,b),gs(N,f,e),M=!0},G.mounted=()=>T(y),G.unmount=()=>{[D,N].forEach(e=>{!function(e,t){e.eventListeners&&(e.eventListeners.forEach(e=>{let n=e.event,i=e.listener;t.removeListener(n,i)}),e.eventListeners.length=0),e.emit=()=>{}}(e,f)}),R.tap=[],R.over=[],C.forEach(e=>{e.cleanUp()}),C.length=0,I(),M=!1},G.onBrushTap=e=>{R.tap.forEach(t=>{(function(e){let t=e.e,n=e.t,i=e.config;return Vo({collisions:Uo(t,n,i.renderer),t:n,config:i,action:Yo(n.action,t,"toggle")})})({e:e,t:t,config:S})&&"stop"===t.globalPropagation&&s.toggleBrushing(!0)})},G.onBrushOver=e=>{R.over.forEach(t=>{(function(e){let t=e.e,n=e.t,i=e.config;return Vo({collisions:Uo(t,n,i.renderer),t:n,config:i,action:Yo(n.action,t,"set")})})({e:e,t:t,config:S})&&"stop"===t.globalPropagation&&s.toggleBrushing(!0)})},G.def=N,G.ctx=D,G.renderer=()=>U,G.set({settings:b}),A(),G}function ys(e){const t=u(!0,{},e),n={getAll:()=>t,getValue:(e,n)=>function(e,t,n){if(void 0===e||void 0===t)return n;const i=t.split(".");let r=e;for(let e=0;e<i.length;++e){const t=i[e];if(void 0===r[t])return n;r=r[t]}return r}(t,e,n),setValue:(e,n)=>function(e,t,n){if(void 0===e||void 0===t)return;const i=t.split("."),r=i[i.length-1];let o=e;for(let e=0;e<i.length-1;++e){const t=i[e];void 0===o[t]&&(o[t]=Number.isNaN(+i[e+1])?{}:[]),o=o[t]}void 0!==n?o[r]=n:delete o[r]}(t,e,n)};return n}function xs(e,t,n){const i=Qo(function(e,t){const n=ss(e,t)/ss(t,t)||1;return{x:t.x*n,y:t.y*n}}(es(n,e),es(t,e)),e);return i}function vs(e,t,n){return os(e,n)+os(t,n)-os(e,t)<1e-12}function bs(e,t){return e.x>=t.x&&e.x+e.width<=t.x+t.width&&e.y>=t.y&&e.y+e.height<=t.y+t.height}function ws(e){return e.x1===e.x2&&e.y1===e.y2}function ks(e){return e.width<=0||e.height<=0}function _s(e){return e.r<=0}function Ms(e){return e.edges.length<=2}function Ss(e,t){let n=!1;for(let i=0,r=t.edges.length;i<r;i++)if(n=zs(e,M(t.edges[i])),!0===n)return!0;return!1}function Rs(e,t){let n=!1;const i=t.numPolygons,r=t.polygons;for(let t=0;t<i;t++){if(n=$s(e,r[t]),!0===n)return!0}return!1}function Cs(e,t){if(_s(e))return!1;return rs({x:e.cx,y:e.cy},t)<=e.r**2}function Ns(e,t){if(ks(t)||_s(e))return!1;const n=t.width/2,i=t.height/2,r=t.x+n,o=t.y+i,s=e.r,a=e.cx,l=e.cy,c=Math.abs(a-r),u=Math.abs(l-o);if(c>n+s||u>i+s)return!1;if(c<=n||u<=i)return!0;return(c-n)**2+(u-i)**2<=s**2}function Ds(e,t){if(_s(e)||ws(t))return!1;const n=m(w(t),2),i=n[0],r=n[1];if(Cs(e,i)||Cs(e,r))return!0;const o={x:e.cx,y:e.cy},s=xs(i,r,o);return rs(s,o)<=e.r**2&&vs(i,r,s)}function qs(e,t){if(Ms(t)||_s(e))return!1;if(Es(t,{x:e.cx,y:e.cy}))return!0;const n=t.edges.length;for(let i=0;i<n;i++){if(Ds(e,M(t.edges[i])))return!0}return!1}function Es(e,t){if(Ms(e)||!Is(e.boundingRect(),t))return!1;const n=t.x,i=t.y,r=e.vertices;let o,s,a,l,c;for(o=!1,l=-1,s=r.length,a=s-1;++l<s;a=l){if(r[l].x===n&&r[l].y===i)return!0;if(r[l].y===r[a].y&&r[l].y===i&&(n-r[l].x)*(n-r[a].x)<=0)return!0;if(r[l].y<i&&i<=r[a].y||r[a].y<i&&i<=r[l].y){if(c=(r[a].x-r[l].x)*(i-r[l].y)/(r[a].y-r[l].y)+r[l].x,n===c)return!0;n<c&&(o=!o)}}return o}function zs(e,t){if(Ms(e))return!1;for(let n=0,i=e.edges.length;n<i;n++){if(Ps(t,M(e.edges[n])))return!0}const n=m(w(t),2),i=n[0],r=n[1];return Es(e,i)||Es(e,r)}function As(e,t){if(Ms(e))return!1;for(let n=0,i=e.edges.length;n<i;n++){if(js(t,M(e.edges[n])))return!0}const n=m(k(t),4),i=n[0],r=n[1],o=n[2],s=n[3];return Es(e,i)||Es(e,r)||Es(e,o)||Es(e,s)}function Os(e,t){return!ks(e)&&!ks(t)&&(e.x<=t.x+t.width&&t.x<=e.x+e.width&&e.y<=t.y+t.height&&t.y<=e.y+e.height)}function Ts(e,t){if(ks(e)||ks(t))return!1;return[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}].every(t=>Is(e,t))}function Is(e,t){return!ks(e)&&(t.x>=e.x&&t.x<=e.x+e.width&&t.y>=e.y&&t.y<=e.y+e.height)}function js(e,t){if(ws(t)||ks(e))return!1;const n=m(w(t),2),i=n[0],r=n[1];if(Is(e,i)||Is(e,r))return!0;const o=k(e);let s=o.length;for(let e=0;e<s;e++){if(Ps(M([o[e],o[3!==e?e+1:0]]),t))return!0}return!1}function Ps(e,t){const n=m(w(e),2),i=n[0],r=n[1],o=m(w(t),2),s=o[0],a=o[1],l=ns(r,i),c=is(r,i),u=ns(a,s),h=is(a,s),d=ns(i,s),f=is(i,s);let p=h*l-u*c;const g=u*f-h*d,y=l*f-c*d;let x,v;if(0===l&&0===c)return!1;if(0===u&&0===h)return!1;if(0===p){if(0===g&&0===y){if(0===l){if(0===c)return i.x===r.x&&i.y===r.y;x=is(s,i)/c,v=is(a,i)/c}else x=(s.x-i.x)/l,v=(a.x-i.x)/l;return!(x<0&&v<0||x>1&&v>1)}return!1}const b=g/p;return p=y/p,b>=0&&b<=1&&p>=0&&p<=1}function Fs(e,t){if(ws(e))return!1;const n=m(w(e),2);return vs(n[0],n[1],t)}function Ls(e,t){const n=e.boundingRect(),i=t.boundingRect();return!!Os(n,i)&&(Ts(n,i)?Ss(e,t):Ss(t,e))}function $s(e,t){const n=e.boundingRect(),i=t.boundingRect();return!!Os(n,i)&&(Ts(i,n)?function(e,t){let n=!1;const i=e.numPolygons,r=e.polygons;for(let e=0;e<i;e++)if(n=Ls(t,r[e]),!0===n)return!0;return!1}(e,t):function(e,t){let n=!1;for(let i=0,r=t.edges.length;i<r;i++)if(n=Ws(e,M(t.edges[i])),!0===n)return!0;return!1}(e,t))}function Bs(e,t){if(_s(e))return!1;if(Hs(t,{x:e.cx,y:e.cy}))return!0;const n=t.numPolygons,i=t.polygons;for(let t=0;t<n;t++){const n=i[t],r=n.edges.length;for(let t=0;t<r;t++){if(Ds(e,M(n.edges[t])))return!0}}return!1}function Hs(e,t){if(!Is(e.boundingRect(),t))return!1;const n=t.x,i=t.y,r=e.numPolygons;let o,s,a,l,c,u,h=!1;for(s=0;s<r;s++)for(o=e.vertices[s],c=-1,a=o.length,l=a-1;++c<a;l=c){if(o[c].x===n&&o[c].y===i)return!0;if(o[c].y===o[l].y&&o[c].y===i&&(n-o[c].x)*(n-o[l].x)<=0)return!0;if(o[c].y<i&&i<=o[l].y||o[l].y<i&&i<=o[c].y){if(u=(o[l].x-o[c].x)*(i-o[c].y)/(o[l].y-o[c].y)+o[c].x,n===u)return!0;n<u&&(h=!h)}}return h}function Ws(e,t){const n=m(w(t),2),i=n[0],r=n[1];if(Hs(e,i)||Hs(e,r))return!0;const o=e.numPolygons,s=e.polygons;for(let e=0;e<o;e++){const n=s[e];for(let e=0,i=n.edges.length;e<i;e++){if(Ps(t,M(n.edges[e])))return!0}}return!1}function Vs(e,t){const n=m(k(t),4),i=n[0],r=n[1],o=n[2],s=n[3];if(Hs(e,i)||Hs(e,r)||Hs(e,o)||Hs(e,s))return!0;const a=e.numPolygons,l=e.polygons;for(let e=0;e<a;e++){const n=l[e];for(let e=0,i=n.edges.length;e<i;e++){if(js(t,M(n.edges[e])))return!0}}return!1}const Us=/^\$/,Ys="@extend";function Ks(e){throw new Error('Cyclical reference for "'.concat(e,'"'))}function Xs(e,t,n){if("string"==typeof e){let i=t[e];return-1!==n.indexOf(e)&&Ks(e),Us.test(i)?(n.push(e),Xs(i,t,n)):i}let i=e;const r=u(!0,{},t,e),o={};if(e[Ys]){const o=e[Ys];-1!==n.indexOf(o)&&Ks(o);let s=n.slice();s.push(o),i=u(!0,{},Xs(r[o],t,s),e)}return Object.keys(i).forEach(e=>{let t=n.slice();if(e===Ys||Us.test(e))return;o[e]=i[e];let s=o[e];Us.test(s)&&s in r?(-1!==n.indexOf(s)&&Ks(s),t.push(s),s=r[s],"object"==typeof s||Us.test(s)&&s in r?o[e]=Xs(s,r,t):o[e]=s):"object"==typeof s&&(o[e]=Xs(s,r,t))}),o}function Gs(e,t){return Xs(e,t,[])}function Js(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={},n=e;const i=e=>{e.forEach(e=>{const n=Array.isArray(e.colors[0])?e.colors:[e.colors];t[e.key]={colors:n,sizes:n.map(e=>e?e.length:0)}})},r={palette:(e,n)=>((e,n)=>{const i=t[e];if(!i)return[];const r=i.sizes;for(let e=0;e<r.length;e++)if(n<=r[e])return i.colors[e];return i.colors[r.length-1]})(e,n),setPalettes:i,style:e=>Gs(e,n),setStyle:t=>{n=u({},e,t)}};return i(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]),r}function Zs(e){e.x=Math.floor(e.x),e.y=Math.floor(e.y),e.width=Math.floor(e.width),e.height=Math.floor(e.height)}function Qs(e){const t={center:{minWidthRatio:.5,minHeightRatio:.5,minWidth:0,minHeight:0}};return u(!0,t,e),t.center.minWidthRatio=Math.min(Math.max(t.center.minWidthRatio,0),1),t.center.minHeightRatio=Math.min(Math.max(t.center.minHeightRatio,0),1),t.center.minWidth=Math.max(t.center.minWidth,0),t.center.minHeight=Math.max(t.center.minHeight,0),t}function ea(e,t,n,i,r){return{x:isNaN(e)?0:e,y:isNaN(e)?0:t,width:isNaN(e)?0:n,height:isNaN(e)?0:i,margin:isNaN(r)?0:r}}function ta(e,t,n){if(void 0===e.cachedSize){const i=e.config.dock();let r,o=e.comp.preferredSize({inner:t,outer:n,dock:i});isNaN(o)?o&&!isNaN(o.size)&&(o.width=o.size,o.height=o.size):o={width:o,height:o},r="top"===i||"bottom"===i?o.height:"right"===i||"left"===i?o.width:Math.max(o.width,o.height),e.cachedSize=Math.ceil(r),e.edgeBleed=o.edgeBleed||0}return e.cachedSize}function na(e,t){switch(t.config.dock()){case"top":e.y+=t.cachedSize,e.height-=t.cachedSize;break;case"bottom":e.height-=t.cachedSize;break;case"left":e.x+=t.cachedSize,e.width-=t.cachedSize;break;case"right":e.width-=t.cachedSize}}function ia(e,t){const n=t.edgeBleed;n&&(e.left=Math.max(e.left,n.left||0),e.right=Math.max(e.right,n.right||0),e.top=Math.max(e.top,n.top||0),e.bottom=Math.max(e.bottom,n.bottom||0))}function ra(e,t,n){t.x<n.left&&(t.width-=n.left-t.x,t.x=n.left);const i=e.width-(t.x+t.width);i<n.right&&(t.width-=n.right-i),t.y<n.top&&(t.height-=n.top-t.y,t.y=n.top);const r=e.height-(t.y+t.height);r<n.bottom&&(t.height-=n.bottom-r)}function oa(e,t,n,i,r){const o=u({},t),s=u({},n);na(o,i),ia(s,i),ra(e,o,s);const a=function(e,t,n){const i=Math.min(n.center.minWidth,e.width)||Math.max(e.width*n.center.minWidthRatio,1),r=Math.min(n.center.minHeight,e.height)||Math.max(e.height*n.center.minHeightRatio,1);return t.width>=i&&t.height>=r}(e,o,r);return!!a&&(na(t,i),ia(n,i),!0)}function sa(e){return{x:e.margin.left+e.x*e.scaleRatio.x,y:e.margin.top+e.y*e.scaleRatio.y,width:e.width*e.scaleRatio.x,height:e.height*e.scaleRatio.y}}function aa(e){return _([].concat(...e.map(k)))}function la(e){let t=e.visible,n=e.layoutRect,i=e.reducedRect,r=e.containerRect,o=e.translation;const s=ea(i.x,i.y,i.width,i.height),a=ea(i.x,i.y,i.width,i.height),l={},c=t.slice(),u=c.slice().sort((e,t)=>e.config.displayOrder()-t.config.displayOrder());return t.sort((e,t)=>{if(e.referencedDocks.length>0&&t.referencedDocks.length>0)return 0;if(t.referencedDocks.length>0)return-1;if(e.referencedDocks.length>0)return 1;const n=e.config.displayOrder()-t.config.displayOrder();return 0===n?c.indexOf(e)-c.indexOf(t):n}).forEach(e=>{let t={},c={};switch(e.config.dock()){case"top":t.height=c.height=e.cachedSize,t.width=n.width,c.width=s.width,t.x=n.x,c.x=s.x,t.y=c.y=s.y-e.cachedSize,s.y-=e.cachedSize,s.height+=e.cachedSize;break;case"bottom":t.x=n.x,c.x=s.x,t.y=c.y=s.y+s.height,t.width=n.width,c.width=s.width,t.height=c.height=e.cachedSize,s.height+=e.cachedSize;break;case"left":t.x=c.x=a.x-e.cachedSize,t.y=n.y,c.y=a.y,t.width=c.width=e.cachedSize,t.height=n.height,c.height=a.height,a.x-=e.cachedSize,a.width+=e.cachedSize;break;case"right":t.x=c.x=a.x+a.width,t.y=n.y,c.y=a.y,t.width=c.width=e.cachedSize,t.height=n.height,c.height=a.height,a.width+=e.cachedSize;break;case"center":t.x=c.x=i.x,t.y=c.y=i.y,t.width=c.width=i.width,t.height=c.height=i.height;break;default:if(e.referencedDocks.length>0){const n=e.referencedDocks.map(e=>l[e]).filter(e=>!!e);n.length>0&&(t=aa(n.map(e=>e.outerRect)),c=aa(n.map(e=>e.r)))}}e.key&&(l[e.key]={r:c,outerRect:t}),function(e,t,n,i){const r={x:i.width/n.width,y:i.height/n.height},o={left:0,top:0};if(n.preserveAspectRatio){const e=r.x<r.y,t=Math.min(r.x,r.y);r.x=t,r.y=t;const s=e?"height":"width",a=(i[s]-n[s]*r.x)*n.align;o.left=e?0:a,o.top=e?a:0}e.scaleRatio=r,e.margin=o,t.scaleRatio=r,t.margin=o,n.scaleRatio=r,n.margin=o}(c,t,n,r),c.edgeBleed=e.edgeBleed,c.computed=sa(c),t.edgeBleed=e.edgeBleed,t.computed=sa(t),c.x+=o.x,c.y+=o.y,t.x+=o.x,t.y+=o.y,e.comp.resize(c,t),e.cachedSize=void 0,e.edgeBleed=void 0}),u}function ca(e,t,n){const i=e.layoutModes||{},r=t.minimumLayoutMode();let o=t.show();return o&&"object"==typeof r?o=i[r.width]&&i[r.height]&&n.width>=i[r.width].width&&n.height>=i[r.height].height:o&&void 0!==r&&(o=i[r]&&n.width>=i[r].width&&n.height>=i[r].height),o}function ua(e){if(!e.resize||"function"!=typeof e.resize)throw new Error("Component is missing resize function");if(!e.dockConfig&&!e.preferredSize)throw new Error("Component is missing preferredSize function")}function ha(e){let t=Qs(e);const n={};return n.layout=function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(!e||isNaN(e.x)||isNaN(e.y)||isNaN(e.width)||isNaN(e.height))throw new Error("Invalid rect");if(!n.length)return{visible:[],hidden:[],ordered:[]};const i=function(e,t){const n={x:0,y:0,width:0,height:0},i={x:0,y:0,width:0,height:0};return n.width=e.width||0,n.height=e.height||0,void 0!==t.size&&(n.width=isNaN(t.size.width)?n.width:t.size.width,n.height=isNaN(t.size.height)?n.height:t.size.height),void 0!==t.logicalSize?(i.width=isNaN(t.logicalSize.width)?n.width:t.logicalSize.width,i.height=isNaN(t.logicalSize.height)?n.height:t.logicalSize.height,i.align=isNaN(t.logicalSize.align)?.5:Math.min(Math.max(t.logicalSize.align,0),1),i.preserveAspectRatio=t.logicalSize.preserveAspectRatio):(i.width=n.width,i.height=n.height,i.preserveAspectRatio=!1),Zs(i),Zs(n),{logicalContainerRect:i,containerRect:n}}(e,t),r=i.logicalContainerRect,o=i.containerRect,s=function(e,t,n){const i=[],r=[];for(let o=0;o<e.length;++o){const s=e[o];ua(s);let a=s.dockConfig;const l=s.key,c=a.dock(),u=/@/.test(c)?c.split(",").map(e=>e.replace(/^\s*@/,"")):[];ca(t,a,n)?i.push({comp:s,key:l,config:a,referencedDocks:u}):r.push({comp:s,key:l,config:a,referencedDocks:u})}return[i,r]}(n,t,r),a=m(s,2),l=a[0],c=a[1],u=function(e){let t=e.layoutRect,n=e.visible,i=e.hidden,r=e.settings;const o=ea(t.x,t.y,t.width,t.height),s={left:0,right:0,top:0,bottom:0},a=n.slice();a.sort((e,t)=>e.config.prioOrder()-t.config.prioOrder());for(let e=0;e<a.length;++e){const n=a[e];ta(n,o,t),oa(t,o,s,n,r)||(i.push(a.splice(e,1)[0]),--e)}!function(e,t){if(0!==t.length)for(let n=0;n<e.length;++n){let i=e[n];if(i.referencedDocks.length){const r=i.referencedDocks.every(e=>t.some(t=>t.key===e));r&&t.push(e.splice(n,1)[0])}}}(n,i);const l=n.filter(e=>-1!==a.indexOf(e));return n.length=0,n.push(...l),ra(t,o,s),o}({layoutRect:r,visible:l,hidden:c,settings:t}),h=la({visible:l,layoutRect:r,reducedRect:u,containerRect:o,translation:{x:e.x,y:e.y}});return c.forEach(e=>{e.comp.visible=!1;const t=ea();e.comp.resize(t,t)}),{visible:l.map(e=>e.comp),hidden:c.map(e=>e.comp),ordered:h.map(e=>e.comp)}},n.settings=function(e){t=Qs(e)},n}const da=(e,t)=>{for(let n=0;n<e.length;n++){const i=e[n];if(i.hasKey&&i.key===t)return e[n]}return null},fa=e=>null==e?void 0:e.map(e=>{const t=e.instance.dockConfig();return{preferredSize:n=>t.computePreferredSize(g(g({},n),{},{children:fa(e.children)}))}}),pa=(e,t)=>({visible:[],hidden:t,ordered:[]}),ga=e=>(t,n)=>{var i;const r=n.map((e,t)=>{const n=e.instance.dockConfig();return{index:t,key:e.key,dockConfig:n,resize:e.instance.resize,preferredSize:t=>n.computePreferredSize(g(g({},t),{},{children:fa(e.children)}))}}),o=e=>n[e.index],s=null!==(i=e(t,r))&&void 0!==i?i:{},a=s.visible,l=void 0===a?r:a,c=s.hidden,u=void 0===c?[]:c,h=s.ordered,d=void 0===h?l:h;return{visible:l.map(o),hidden:u.map(o),ordered:d.map(o)}},ma=e=>"function"==typeof e?ga(e):(e=>{const t=ha(e);return ga((e,n)=>t.layout(e,n))})(e);function ya(e,t,n){const i=t.left-n.left,r=t.top-n.top,o=S(e),s=u(!0,{},e);switch(o){case"circle":s.cx+=i,s.cy+=r;break;case"polygon":for(let e=0,t=s.vertices.length;e<t;e++){const t=s.vertices[e];t.x+=i,t.y+=r}break;case"geopolygon":for(let e=0;e<s.vertices.length;e++){const t=s.vertices[e];for(let e=0,n=t.length;e<n;e++){const n=t[e];n.x+=i,n.y+=r}}break;case"line":s.x1+=i,s.y1+=r,s.x2+=i,s.y2+=r;break;case"point":case"rect":s.x+=i,s.y+=r}return s}function xa(e,t){const n=[];let i=0;t.forEach(e=>{n.push(i),i++;const t=e.instance.def.additionalElements&&e.instance.def.additionalElements();t&&(i+=t.length)}),t.forEach((t,i)=>((e,t,n)=>{const i=t.instance.renderer().element();if(isNaN(n)||!i||!e||!e.children)return;const r=e.children[Math.max(0,n)];if(i===r)return;const o=t.instance.def.additionalElements&&t.instance.def.additionalElements().filter(Boolean);e.insertBefore&&void 0!==r?(e.insertBefore(i,r),o&&o.forEach(t=>{e.insertBefore(t,i)})):(o&&o.forEach(t=>{e.appendChild(t,i)}),e.appendChild(i))})(e,t,n[i]))}function va(e,t){let n=e.element,i=e.data,r=void 0===i?[]:i,o=e.settings,s=void 0===o?{}:o,a=e.on,l=void 0===a?{}:a;const c=t.registries,h=t.logger,d=Js(t.style,t.palettes),f=[],p=u({},e),m=function(){const e={};return lo.mixin(e),e}();let x=[],v=null,b=null,w=null,k=[],_=()=>{},M=()=>{};const S={};let R=!1;const C=function(e){let t=e.createComponent;const n={};let i=[],r=[];const o=e=>{const n=t(e);return n&&(i.push(n),e.components&&(n.children=e.components.map(e=>o(e)).filter(e=>!!e))),n},s=e=>{const t=i.indexOf(e);-1!==t&&i.splice(t,1)},a=(e,t)=>{for(let n=e.length-1;n>=0;n--){const i=e[n],r=t.find(e=>i.hasKey&&i.key===e.key);r?i.children&&r.components&&a(i.children,r.components):(e.splice(n,1),s(i),i.children&&a(i.children,[]),i.instance.destroy())}},l=e=>{let t=e.compList,n=e.data,i=e.excludeFromUpdate,r=e.formatters,s=e.scales;return e.settingsList.map(e=>{const a=da(t,e.key);return i.indexOf(e.key)>-1?(delete a.updateWith,a):a?(e.rendererSettings&&"function"==typeof a.instance.renderer().settings&&a.instance.renderer().settings(e.rendererSettings),e.rendererSettings&&"function"==typeof e.rendererSettings.transform&&e.rendererSettings.transform()?(a.applyTransform=!0,a):(a.updateWith={formatters:r,scales:s,data:n,settings:e},e.components&&(a.children=l({compList:a.children||[],data:n,excludeFromUpdate:i,formatters:r,scales:s,settingsList:e.components})),a)):o(e)}).filter(e=>!!e)},c=e=>{let t=e.components,n=e.hidden,i=e.layoutFn,r=e.ordered,o=e.rect,s=e.visible;const a=i(o,t),l=a.visible,u=a.hidden,h=a.ordered;s.push(...l),n.push(...u),r.push(...h),l.forEach(e=>{if(e.children){var t,i;const o=ma(null!==(t=null===(i=e.settings)||void 0===i?void 0:i.strategy)&&void 0!==t?t:{});c({components:e.children,hidden:n,layoutFn:o,ordered:r,rect:e.instance.getRect(),visible:s})}}),u.forEach(e=>{e.children&&c({components:e.children,hidden:n,layoutFn:pa,ordered:r,rect:null,visible:s})})};return n.destroy=()=>{i.forEach(e=>e.instance.destroy()),i=[],r=[]},n.findComponentByKey=e=>da(i,e),n.forEach=e=>{i.forEach(e)},n.layout=e=>{let t=e.layoutSettings,n=e.rect;const i=[],o=[],s=[],a=ma(t);return c({components:r,hidden:o,layoutFn:a,ordered:s,rect:n,visible:i}),{visible:i,hidden:o,ordered:s}},n.set=e=>{let t=e.components;r=t.map(e=>o(e)).filter(e=>!!e)},n.update=e=>{let t=e.components,n=e.data,i=e.excludeFromUpdate,o=e.formatters,s=e.scales;a(r,t),r=l({compList:r,data:n,excludeFromUpdate:i,formatters:o,scales:s,settingsList:t})},n}({createComponent:e=>{if(!c.component.has(e.type))return h.warn("Unknown component: ".concat(e.type)),!1;return{instance:ms(c.component(e.type),{settings:e,chart:p,mediator:m,registries:c,theme:d,container:n}),settings:u(!0,{},e),key:e.key,hasKey:void 0!==e.key}}});function N(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{};return function(){const i="function"==typeof e[t];let r;for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];return r=i?e[t].call(p,...s):n.call(p,...s),r}}const D=()=>{let e;s.dockLayout?(h.warn('Deprecation Warning: "dockLayout" property should be renamed to "strategy"'),e=s.dockLayout):e=s.strategy;const t=function(e){if("function"==typeof e.getBoundingClientRect){const t=e.getBoundingClientRect();return{x:0,y:0,width:t.width,height:t.height}}return{x:0,y:0,width:0,height:0}}(n);return C.layout({layoutSettings:e,rect:t})},q=N("created"),E=N("beforeMount"),z=N("mounted"),A=N("beforeUpdate"),O=N("updated"),T=N("beforeRender"),I=N("beforeDestroy"),j=N("destroyed"),P=function(e,t){let n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).partialData;const i=t.formatters,r=void 0===i?{}:i,o=t.scales,s=void 0===o?{}:o,a=t.scroll,l=void 0===a?{}:a;_=function(e,t){let n=t.types,i=t.logger;const r={},o=[];return Array.isArray(e)?o.push(...e):(i.warn('Deprecated: "data-source" configuration"'),o.push(e)),o.forEach((e,t)=>{let o=n(e.type);if(o){let n=e.key;void 0===e.key&&(i.warn("Missing key for dataset. Using index '".concat(t,"' as key.")),n=t);let s=o({key:n,data:e.data,config:e.config});r[n]=s}}),e=>e?r[e]:r[Object.keys(r)[0]]}(e,{logger:h,types:c.data}),n||Object.keys(S).forEach(e=>S[e].clear()),t.palettes&&d.setPalettes(t.palettes),t.style&&d.setStyle(t.style),M=function(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:xi;const r={};return(e||[]).forEach(e=>{if(!e.key)throw new Error('Data collection is missing "key" property');if("object"==typeof e.data&&"collection"in e.data)throw new Error("Data config for collections may not reference other collections");r[e.key]=()=>i(e.data,t,n)}),e=>{let t,n;if("string"==typeof e?t=e:"object"==typeof e&&(t=e.key,n=e),!(t in r))throw new Error("Unknown data collection: ".concat(t));"function"==typeof r[t]&&(r[t]=r[t]());let i=r[t];if(n&&n.fields&&n.fields.filter){let e=i.fields.filter(n.fields.filter);i.fields.length!==e.length&&(i=u(i,{fields:e}))}return i}}(t.collections,{dataset:_},{logger:h});const f={theme:d,logger:h};v=function(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:ro;const r={};return{get(o){let s;return"string"==typeof o&&e[o]?s=o:"object"==typeof o&&"scale"in o&&e[o.scale]&&(s=o.scale),s?(r[s]=r[s]||i(e[s],t,n),r[s]):i(o,t,n)},all(){return Object.keys(e).forEach(this.get),r}}}(s,{dataset:_,collection:M},g(g({},f),{},{scale:c.scale})),b=function(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:vi;const r={};return{get(o){let s;return"string"==typeof o&&e[o]?s=o:"object"==typeof o&&"formatter"in o&&e[o.formatter]?s=o.formatter:"object"==typeof o&&"type"in o&&e[o.type]&&(s=o.type),s?(r[s]=r[s]||i(e[s],t,n),r[s]):i(o||{},t,n)},all(){return Object.keys(e).forEach(this.get),r}}}(r,{dataset:_,collection:M},g(g({},f),{},{formatter:c.formatter})),w=function(e,t){const n={};for(const i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=uo(e[i],t?t[i]:null));return n}(l,w)};function F(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={},i=e.filter(e=>!!e.key).map(e=>e.key);k.forEach(e=>{e.key&&-1!==i.indexOf(e.key)?t[e.key]=e:e.destroy()}),k=e.map(e=>{const i=e.key&&t[e.key]?t[e.key]:c.interaction(e.type)(p,m,n);return i.set(e),i})}const L=e=>{const t=n.getBoundingClientRect(),i="clientX"in e?e.clientX:e.x,r="clientY"in e?e.clientY:e.y,o={x:i-t.left,y:r-t.top},s=[];return x.forEach(e=>{const t=e.instance.getRect();Is(t.computedPhysical?t.computedPhysical:{x:t.margin.left+t.x*t.scaleRatio.x,y:t.margin.top+t.y*t.scaleRatio.y,width:t.width*t.scaleRatio.x,height:t.height*t.scaleRatio.y},o)&&s.push(e)}),s},$=()=>{if(f.length||!n)return;Object.keys(l).forEach(e=>{const t=l[e].bind(p);n.addEventListener(e,t),f.push({key:e,listener:t})});const e={},t=t=>{t.touches?(e.x=t.touches[0].clientX,e.y=t.touches[0].clientY,e.multiTouch=t.touches.length>1):(e.x=t.clientX,e.y=t.clientY,e.multiTouch=!1),e.time=Date.now(),e.comps=L(e)},i=t=>{const n=e.comps||L(t);if(!n.every(e=>e.instance.def.disableTriggers)&&("touchend"===t.type&&t.preventDefault(),function(e,t){const n=y(e),i=n?e.changedTouches[0]:e,r=Date.now()-t.time,o=isNaN(t.x)?0:Math.abs(i.clientX-t.x),s=isNaN(t.y)?0:Math.abs(i.clientY-t.y);return(0===e.button||n)&&!t.multiTouch&&o<=12&&s<=12&&r<=300}(t,e)))for(let e=n.length-1;e>=0;e--){if(n[e].instance.onBrushTap(t),R){R=!1;break}}},r=[];var o;r.push({key:"mousedown",listener:t}),r.push({key:"mouseup",listener:i}),("ontouchstart"in(o=n)&&"ontouchend"in o||navigator.maxTouchPoints>1)&&(r.push({key:"touchstart",listener:t}),r.push({key:"touchend",listener:i})),r.push({key:"mousemove",listener:e=>{const t=L(e);for(let n=t.length-1;n>=0;n--){if(t[n].instance.onBrushOver(e),R){R=!1;break}}}}),r.forEach(e=>{n.addEventListener(e.key,e.listener),f.push(e)})},B=()=>{f.forEach(e=>{let t=e.key,i=e.listener;return n.removeEventListener(t,i)}),f.length=0},H=()=>{n.innerHTML="",(()=>{const e=s.components,t=void 0===e?[]:e;T(),P(r,s),C.set({components:t});const i=D(),o=i.visible,a=i.hidden,l=i.ordered;x=o,a.forEach(e=>{e.instance.hide(),e.visible=!1}),o.forEach(e=>e.instance.beforeMount()),o.forEach(e=>e.instance.mount()),o.forEach(e=>e.instance.beforeRender()),o.forEach(e=>e.instance.render()),o.forEach(e=>e.instance.mounted()),o.forEach(e=>{e.visible=!0}),xa(n,l)})(),$(),F(s.interactions)};return p.layoutComponents=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.excludeFromUpdate,n=void 0===t?[]:t;e.data&&(r=e.data),e.settings&&(s=e.settings,F(e.settings.interactions)),A(),P(r,s);const i=s,o=i.formatters,a=i.scales,l=i.components,c=void 0===l?[]:l;C.update({components:c,data:r,excludeFromUpdate:n,formatters:o,scales:a}),C.forEach(e=>{e.updateWith&&e.instance.set(e.updateWith)}),C.forEach(e=>{e.updateWith&&e.instance.beforeUpdate()}),D()},p.update=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.partialData,i=e.excludeFromUpdate,o=void 0===i?[]:i;let a;e.data&&(r=e.data),e.settings&&(s=e.settings,F(e.settings.interactions)),A(),P(r,s,{partialData:t});const l=s,c=l.formatters,u=l.scales,h=l.components,d=void 0===h?[]:h;C.update({components:d,data:r,excludeFromUpdate:o,formatters:c,scales:u}),C.forEach(e=>{e.updateWith&&e.instance.set(e.updateWith)}),C.forEach(e=>{e.updateWith&&e.instance.beforeUpdate()});const f=[],p=[];let g;if(t)C.forEach(e=>{(e.updateWith||e.applyTransform)&&e.visible&&f.push(e)}),g=f;else{const e=D(),t=e.visible,n=e.hidden,i=e.ordered;x=t,g=t,a=i,t.forEach(e=>{e.updateWith&&e.visible?f.push(e):p.push(e)}),n.forEach(e=>{e.instance.hide(),e.visible=!1,delete e.updateWith,e.applyTransform=!1})}p.forEach(e=>e.instance.beforeMount()),p.forEach(e=>e.instance.mount()),g.forEach(e=>e.instance.beforeRender()),g.forEach(e=>{(e.updateWith||e.applyTransform)&&e.visible?e.instance.update():e.instance.render()}),t||xa(n,a),p.forEach(e=>e.instance.mounted()),f.forEach(e=>e.instance.updated()),x.forEach(e=>{delete e.updateWith,e.visible=!0,e.applyTransform=!1}),O()},p.destroy=()=>{I(),C.destroy(),B(),F(),delete p.update,delete p.destroy,j()},p.getAffectedShapes=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"and",n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,r=[];return x.filter(e=>null==i||e.key===i).forEach(i=>{const o=i.instance.getBrushedShapes(e,t,n);r=[...r,...o]}),r},p.findShapes=e=>{let t=[];return x.forEach(n=>{const i=n.instance.findShapes(e);t=[...t,...i]}),t},p.componentsFromPoint=e=>L(e).map(e=>e.instance.ctx),p.shapesAt=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=[];const r=n.getBoundingClientRect();let o=x;if(Array.isArray(t.components)&&t.components.length>0){const e=t.components.map(e=>e.key);o=x.filter(t=>-1!==e.indexOf(t.key)).map(n=>({instance:n.instance,opts:t.components[e.indexOf(n.key)]}))}for(let n=o.length-1;n>=0;n--){const s=o[n],a=ya(e,r,s.instance.renderer().element().getBoundingClientRect()),l=s.instance.shapesAt(a,s.opts),c=l.length>0&&"stop"===t.propagation;if(i=[...i,...l],i.length>0&&c)return i}return i},p.brushFromShapes=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{components:[]};for(let n=0;n<t.components.length;n++){const i=t.components[n].key;x.filter(e=>i===e.key).forEach(i=>{let r=e.filter(e=>e.key===i.key);i.instance.brushFromShapes(r,t.components[n])})}},p.scroll=function(){return function(e,t){return t[e]||(t[e]=co()),t[e]}(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",w)},p.dataset=e=>_(e),p.dataCollection=e=>M(e),p.scales=function(){return v.all()},p.formatters=function(){return b.all()},p.brush=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return S[e]||(S[e]=Co()),S[e]},p.scale=function(e){return v.get(e)},p.formatter=function(e){return b.get(e)},p.toggleBrushing=function(e){R=void 0!==e?e:!R},p.component=e=>{const t=C.findComponentByKey(e);return null==t?void 0:t.instance.ctx},p.logger=()=>h,p.theme=()=>d,p.storage=ys({animations:{updatingStageMeta:{isInit:!1,shouldBeRemoved:!1}}}),Object.defineProperty(p,"interactions",{get:()=>({instances:k,on(){$(),k.forEach(e=>e.on())},off(){B(),k.forEach(e=>e.off())}})}),q(),n&&(E(),H(),z(n),p.element=n),p}const ba=e=>{let t=Ee(e);return t.prio=e=>e?t.default(e[0]):[t.default()],t.types=()=>t.getKeys(),t};var wa=Ee();function ka(e,t,n){let i=n.key;const r={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return r.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(r.value),e.field&&(r.source={key:i,field:e.field.key()}),r}const _a=e=>e.filter(e=>"number"==typeof e&&!isNaN(e));const Ma=e=>{let t=e.key,n=e.data,i=e.cache,r=e.config;if(!n)return;let o=n;"string"==typeof o&&(o=(e=>{let t=e.data,n=e.config;const i=t.split("\n"),r=i[0],o=i[1];let s=",";if(n&&n.parse&&n.parse.delimiter)s=n.parse.delimiter;else if(r){const e=[/,/,/\t/,/;/];for(let t=0;t<e.length;t++){const n=e[t];if(r&&o){if(n.test(r)&&n.test(o)&&r.split(n).length===o.split(n).length){s=n;break}}else n.test(r)&&(s=n)}}return i.map(e=>e.split(s))})({data:n,config:r})),Array.isArray(o)&&function(e){let t,n=e.source,i=e.data,r=e.cache,o=e.config,s=i;const a=o&&o.parse;Array.isArray(i[0])?a&&!1===a.headers?t=i[0].map((e,t)=>t):(t=i[0],s=i.slice(1)):t=Object.keys(i[0]);const l=!!a&&"function"==typeof a.row&&a.row;let c,h=t;h=a&&"function"==typeof a.fields?a.fields(h.slice()):t.map(e=>({key:e,title:e})),Array.isArray(i[0])?c=h.map(()=>[]):(c={},h.forEach(e=>{c[e.key]=[]}));for(let e=0;e<s.length;e++){const t=l?l(s[e],e,h):s[e];if(t)if(Array.isArray(t))for(let e=0;e<h.length;e++)c[e].push(t[e]);else for(let e=0;e<h.length;e++)c[h[e].key].push(t[h[e].key])}const d=Array.isArray(c)?e=>c[e]:e=>c[h[e].key];for(let e=0;e<h.length;e++){const t=d(e),i=_a(t),o=i.length>0,s=o?"measure":"dimension",a=o?Math.min(...i):NaN,l=o?Math.max(...i):NaN;r.fields.push(ri(u({source:n,key:e,title:h[e].title,values:t,min:a,max:l,type:s},h[e]),{value:h[e].value,label:h[e].label}))}}({data:o,cache:i,source:t,config:r})};function Sa(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.key,n=e.data,i=e.config;const r={fields:[]},o={key:()=>t,raw:()=>n,field:e=>function(e,t){let n=t.cache;if("number"==typeof e)return n.fields[e];for(let t=0;t<n.fields.length;t++)if(n.fields[t].key()===e)return n.fields[t];for(let t=0;t<n.fields.length;t++)if(n.fields[t].title()===e)return n.fields[t];return null}(e,{cache:r}),fields:()=>r.fields.slice(),extract:e=>function(e,t){const n=Array.isArray(e)?e:[e];let i=[];return n.forEach(e=>{if(void 0!==e.field){const n=t.field(e.field),r=t.key();if(!n)throw Error("Field '".concat(e.field,"' not found"));const o=ci(e,t),s=o.props,a=o.main,l=Object.keys(s),c=!!e.trackBy,u=typeof e.trackBy,h={},d=[],f=n.items(),p=[];for(let t=0;t<f.length;t++){const n=f[t];if(a.filter&&!a.filter(n))continue;const i=ka(a,n,{key:r});l.forEach(e=>{const o=s[e];let a=o.field?o.field.items()[t]:n;i[e]=ka(o,a,{key:r})}),c&&di({cfg:e,itemData:n,obj:i,target:d,tracker:h,trackType:u}),p.push(i)}i=c?[...i,...hi(d,{main:a,propsArr:l,props:s})]:[...i,...p]}}),i}(e,o),hierarchy:()=>null};return Ma({key:t,data:n,config:i,cache:r}),o}Sa.util={normalizeConfig:ci,collect:hi,track:di};const Ra=Ee();Ra.default("matrix"),Ra("matrix",Sa),Ra("default",Sa);const Ca=Ee();function Na(e,t,n){return Math.max(e,Math.min(t,n))}function Da(e){let t=e.item,n=e.value,i=e.boxCenter,r=e.rendWidth,o=e.rendHeight,s="x",a="y",l=r,c=o,h=n<.5?90:-90;return e.flipXY&&(s="y",a="x",l=o,c=r,h=n<.5?180:0),(0,e.symbol)(u({},t.oob,{[s]:i*l,[a]:Math.max(t.oob.size/2,Math.min(n*c,c-t.oob.size/2)),startAngle:h}))}function qa(e){let t=e.item,n=e.boxWidth,i=e.boxPadding,r=e.rendWidth,o=e.rendHeight,s="x",a="y",l="width",c="height",h=r,d=o;e.flipXY&&(s="y",a="x",l="height",c="width",h=o,d=r);const f=function(e){let t=e.start,n=e.end,i=e.minPx,r=void 0===i?.1:i,o=e.maxPx,s=void 0===o?1:o;const a=Math.max(t,n),l=Math.min(t,n),c=Na(-.1,1.2,a),u=Na(-.1,1.2,l),h=c*s-u*s,d=Math.max(r,h),f=(d-h)/2;return{actualDiff:d,startModifier:f,actualLow:u*s-f}}({start:t.start,end:t.end,minPx:t.box.minHeightPx,maxPx:d}),p=f.actualDiff,g=f.actualLow;return u({},t.box,{type:"rect",[s]:(i+t.major)*h,[a]:g,[c]:p,[l]:n*h,data:t.data||{},collider:{type:null}})}function Ea(e){let t=e.item,n=e.from,i=e.to,r=e.boxCenter,o=e.rendWidth,s=e.rendHeight,a="x1",l="y1",c="x2",h="y2",d=o,f=s;return e.flipXY&&(a="y1",l="x1",c="y2",h="x2",d=s,f=o),u({},t.line,{type:"line",[h]:Math.floor(n*f),[a]:r*d,[l]:Math.floor(i*f),[c]:r*d,data:t.data||{},collider:{type:null}})}function za(e){let t=e.item,n=e.key,i=e.position,r=e.width,o=e.boxCenter,s=e.rendWidth,a=e.rendHeight,l="x1",c="y1",h="x2",d="y2",f=s,p=a;e.flipXY&&(l="y1",c="x1",h="y2",d="x2",f=a,p=s);const g=r/2;return u({type:"line"},t[n],{[c]:Math.floor(i*p),[l]:(o-g)*f,[d]:Math.floor(i*p),[h]:(o+g)*f,r:g*f,cx:o*f,cy:i*p,width:r*f,data:t.data||{},collider:{type:null}})}function Aa(e,t,n){const i=t.box,r=i.width,o=i.maxWidthPx,s=i.minWidthPx,a=e>=0?1:-1;let l=Math.min(a*e*r,isNaN(o)?n:o/n);return l=isNaN(s)?l:Math.max(s/n,l),l*a}Ca("native",function(e,t,n){let i,r,o={chart:e,mediator:t,element:n},s=[],a=!0;function l(){"function"==typeof i.enable&&(i.enable=i.enable.bind(o)()),i.enable&&Object.keys(i.events).forEach(e=>{const t=i.events[e].bind(o);n.addEventListener(e,t),s.push({key:e,listener:t})})}function c(){s.forEach(e=>{let t=e.key,i=e.listener;n.removeEventListener(t,i)}),s=[]}return{get key(){return r},set(e){!function(e){r=e.key,i=e,i.events=i.events||[],void 0===i.enable&&(i.enable=!0)}(e),c(),a&&l()},off(){a=!1,c()},on(){a=!0,0===s.length&&l()},destroy(){c(),o=null,i=null}}});const Oa={oob:{show:!0,type:"n-polygon",fill:"#999",stroke:"#000",strokeWidth:0,size:10,sides:3,startAngle:-90},box:{show:!0,fill:"#fff",stroke:"#000",strokeWidth:1,strokeLinejoin:"miter",width:1,maxWidthPx:void 0,minWidthPx:1,minHeightPx:1},line:{show:!0,stroke:"#000",strokeWidth:1},median:{show:!0,stroke:"#000",strokeWidth:1},whisker:{show:!0,stroke:"#000",strokeWidth:1,fill:"",type:"line",width:1}},Ta=Object.keys(Oa),Ia={require:["chart","resolver","symbol"],defaultSettings:{settings:{},data:{},style:{box:"$shape",line:"$shape-guide",whisker:"$shape-guide",median:"$shape-guide--inverted"}},created(){this.state={}},render(e){let t=e.data;const n=this.rect,i=n.width,r=n.height,o="horizontal"===this.settings.settings.orientation,s=this.style,a=this.resolver,l=this.symbol,c=Ta.filter(e=>!this.settings.settings[e]||!1!==this.settings.settings[e].show),h={};c.forEach(e=>h[e]=Oa[e]);const d=function(e){let t=e.keys,n=e.data,i=e.defaultSettings,r=e.style,o=e.settings,s=e.width,a=e.height,l=e.resolver;const c=u(!0,{},i||{},r||{}),h={major:"horizontal"===o.orientation?a:s,minor:"horizontal"===o.orientation?s:a},d=o.major;let f;f="object"==typeof d&&"object"==typeof d.ref&&void 0!==d.ref.start&&void 0!==d.ref.end?l.resolve({data:n,defaults:{start:0,end:1},scaled:h,settings:u(!0,{},{binStart:{scale:o.major.scale,ref:o.major.ref.start},binEnd:{scale:o.major.scale,ref:o.major.ref.end}})}):"object"==typeof d&&void 0!==d.binStart&&void 0!==d.binEnd?l.resolve({data:n,defaults:{start:0,end:1},scaled:h,settings:u(!0,{},{binStart:{scale:o.major.scale,ref:"binStart"},binEnd:{scale:o.major.scale,ref:"binEnd"}},o.major)}):l.resolve({data:n,scaled:h,defaults:{major:.5},settings:{major:o.major}});const p=o.minor||{},g={};["start","end","min","max","med"].forEach(e=>{(p[e]||n.items&&n.items.length&&n.items[0][e])&&(g[e]={scale:p.scale,ref:e})});let m,y={major:f,minor:l.resolve({data:n,defaults:{start:0,end:1},scaled:h,settings:u(!0,{},g,p)})};for(let e=0,i=t.length;e<i;e++)o[m]&&!1===o[m].show||(m=t[e],y[m]=l.resolve({data:n,defaults:c[m],settings:o[m],scaled:h}));return y}({keys:c,data:t,defaultSettings:h,style:s,settings:this.settings.settings,width:i,height:r,resolver:a});d.settings,d.items;const f=function(e){let t=e.width,n=e.height,i=e.flipXY,r=e.resolved,o=e.keys,s=e.symbol;const a=[],l=r.major.items;if(!l.length)return a;const c=t,h=n,d=i?n:t,f=r.major.settings,p=["start","end","min","max","med"].filter(e=>void 0!==r.minor.settings[e]),g=p.length,m=o.filter(e=>"oob"!==e);let y,v,b,w,k,_,M,S,R;const C=o?o.length:0,N=m?m.length:0;function D(){M?y.push(Da({item:b,value:0,boxCenter:_,rendWidth:c,rendHeight:h,flipXY:i,symbol:s})):S&&y.push(Da({item:b,value:1,boxCenter:_,rendWidth:c,rendHeight:h,flipXY:i,symbol:s}))}const q={box:function(){b.box&&x(b.start)&&x(b.end)&&y.push(qa({item:b,boxWidth:w,boxPadding:k,rendWidth:c,rendHeight:h,flipXY:i}))},line:function(){x(b.min)&&x(b.start)&&y.push(Ea({item:b,from:b.min,to:b.start,boxCenter:_,rendWidth:c,rendHeight:h,flipXY:i})),x(b.max)&&x(b.end)&&y.push(Ea({item:b,from:b.max,to:b.end,boxCenter:_,rendWidth:c,rendHeight:h,flipXY:i}))},median:function(){b.median&&x(b.med)&&y.push(za({item:b,key:"median",position:b.med,width:w,boxCenter:_,rendWidth:c,rendHeight:h,flipXY:i}))},whisker:function(){if(b.whisker){const e=w*b.whisker.width;x(b.min)&&y.push(za({item:b,key:"whisker",position:b.min,width:e,boxCenter:_,rendWidth:c,rendHeight:h,flipXY:i})),x(b.max)&&y.push(za({item:b,key:"whisker",position:b.max,width:e,boxCenter:_,rendWidth:c,rendHeight:h,flipXY:i}))}}};function E(){let e,t=-Number.MAX_VALUE,n=Number.MAX_VALUE;for(let i=0;i<g;i++)e=b[p[i]],x(e)&&(t<e&&(t=e),n>e&&(n=e));M=t<0&&t!==-Number.MAX_VALUE,S=n>1&&n!==Number.MAX_VALUE,R=M||S}for(let e=0,t=l.length;e<t;e++){y=[],v=null;const t=l[e],n=t.data;let i=null,s=null;void 0!==f.binStart?(i=t.binStart,s=t.binEnd,v=f.binStart.scale):(v=f.major.scale,i=v?t.major:0);let c=0;v?v.bandwidth?(c=v.bandwidth(),i-=c/2):c=s-i:c=1,b=u({},{major:i,majorEnd:s},r.minor.items[e]);for(let t=0;t<C;t++)b[o[t]]=r[o[t]].items[e];if(w=Aa(c,b,d),k=(c-w)/2,_=k+b.major+w/2,E(),R)b.oob&&D();else for(let e=0;e<N;e++)b[m[e]]&&!1===b[m[e]].show||q[m[e]]();const h={type:"container",data:n,collider:{type:"bounds"},children:y};a.push(h)}return a}({width:i,height:r,flipXY:o,resolved:d,keys:c,symbol:l});return f}};const ja={shape:"saltire",width:2,size:.5,fill:"#333",stroke:"#333",strokeWidth:0},Pa=/px$/,Fa={shape:"circle",label:"",fill:"#333",stroke:"#ccc",strokeDasharray:"",strokeWidth:0,strokeLinejoin:"miter",opacity:1,x:.5,y:.5,size:1,show:!0},La={imageSrc:void 0,imageScalingFactor:void 0,position:"center-center",symbol:"rectangle",width:void 0,height:void 0},$a={maxPx:1e4,minPx:1,maxRelExtent:.1,minRelExtent:.01,maxRelDiscrete:1,minRelDiscrete:.1};function Ba(e,t){return e&&"function"==typeof e.bandwidth?{isBandwidth:!0,value:Math.max(1,e.bandwidth()*t)}:{isBandwidth:!1,value:Math.max(1,t)}}function Ha(e,t,n,i){let r=t.width,o=t.height;return e.filter(e=>!1!==e.show&&!isNaN(e.x+e.y)).map(e=>{let t=e,s=Pa.test(e.size)?parseInt(e.size,10):n.min+t.size*(n.max-n.min);v(s)&&(t=ja,s=n.min+t.size*(n.max-n.min));const a=function(e){let t=Fa.shape,n={};return"object"==typeof e.shape&&"string"==typeof e.shape.type?(t=e.shape.type,n=e.shape):"string"==typeof e.shape&&(t=e.shape),[t,n]}(t),l=m(a,2),c=l[0],u=g(g({},l[1]),{},{type:c,label:e.label,x:e.x*r,y:e.y*o,fill:t.fill,size:Math.min(n.maxGlobal,Math.max(n.minGlobal,s)),stroke:t.stroke,strokeWidth:t.strokeWidth,strokeDasharray:t.strokeDasharray,opacity:t.opacity,imageSettings:t.imageSettings});t===e.errorShape&&(u.width=t.width);const h=i(u);return h.data=e.data,h})}const Wa={require:["chart","resolver","symbol"],defaultSettings:{settings:{},data:{},animations:{enabled:!1,trackBy:e=>e.data.value},style:{item:"$shape"}},render(e){let t=e.data;const n=this.resolver.resolve({data:t,defaults:u({},Fa,this.style.item),settings:this.settings.settings,scaled:{x:this.rect.width,y:this.rect.height}}),i=this.rect,r=i.width,o=i.height,s=u({},$a,this.settings.settings.sizeLimits),a=n.items;a.length>0&&"image"===a[0].shape&&t.items.forEach((e,t)=>{a[t].imageSettings=u({},La,this.settings.settings.imageSettings)});const l=function(e,t,n,i,r){const o=Ba(e?e.scale:void 0,n),s=Ba(t?t.scale:void 0,i);let a=Math.min(o.value*r[o.isBandwidth?"maxRelDiscrete":"maxRelExtent"],s.value*r[s.isBandwidth?"maxRelDiscrete":"maxRelExtent"]),l=Math.min(o.value*r[o.isBandwidth?"minRelDiscrete":"minRelExtent"],s.value*r[s.isBandwidth?"minRelDiscrete":"minRelExtent"]);return{min:Math.max(1,Math.floor(l)),max:Math.max(1,Math.floor(a)),maxGlobal:r.maxPx,minGlobal:r.minPx}}(n.settings.x,n.settings.y,r,o,s);return Ha(a,this.rect,l,this.settings.shapeFn||this.symbol)}};const Va={label:"",arc:1,show:!0,fill:"#333",stroke:"#ccc",strokeWidth:1,strokeLinejoin:"round",opacity:1,innerRadius:0,outerRadius:.8,cornerRadius:0,offset:0};function Ua(e,t,n,i){let r=t.x,o=t.y,s=t.width,a=t.height;const l=Q(),c={x:r+s/2,y:o+a/2},u=Math.min(s,a)/2,h=Math.min(s,a)/2,d=h/100;return e.map((e,t)=>{const r=n[t];r.type="path";const o=h*r.outerRadius,s=u*r.innerRadius,a=d*r.cornerRadius;l.innerRadius(s),l.outerRadius(o),l.cornerRadius(a),r.arcDatum=e;const f=l.centroid(e),p=r.offset?function(e,t,n,i){let r=m(e,2),o=r[0],s=r[1];const a=Math.sqrt(o*o+s*s);o/=a,s/=a;const l=n-i;return{x:o*t*l,y:s*t*l}}(f,r.offset,o,s):{x:0,y:0};return r.transform="translate(".concat(p.x,", ").concat(p.y,") translate(").concat(c.x,", ").concat(c.y,")"),r.desc={share:e.value/i,slice:{start:e.startAngle,end:e.endAngle,innerRadius:s,outerRadius:o,cornerRadius:a,offset:{x:c.x+p.x,y:c.y+p.y}}},r})}function Ya(e,t){return e.slice&&"arc"in e.slice?t.arc:t.data.value}const Ka={require:["chart","resolver"],defaultSettings:{settings:{startAngle:0,endAngle:2*Math.PI,padAngle:0,slice:{}},style:{slice:"$shape"},data:{}},render(e){let t=e.data;const n=[],i=[],r=this.settings.settings,o=this.resolver.resolve({data:t,defaults:u({},Va,this.style.slice),settings:r.slice}).items;let s=0;for(let e=0,t=o.length;e<t;e++){const t=Ya(r,o[e]);t>0&&o[e].outerRadius>=o[e].innerRadius&&(n.push(t),i.push(o[e]),s+=t)}const a=function(){var e=ae,t=se,n=null,i=C(0),r=C(P),o=C(0);function s(s){var a,l,c,u,h,d=(s=ee(s)).length,f=0,p=new Array(d),g=new Array(d),m=+i.apply(this,arguments),y=Math.min(P,Math.max(-P,r.apply(this,arguments)-m)),x=Math.min(Math.abs(y)/d,o.apply(this,arguments)),v=x*(y<0?-1:1);for(a=0;a<d;++a)(h=g[p[a]=a]=+e(s[a],a,s))>0&&(f+=h);for(null!=t?p.sort(function(e,n){return t(g[e],g[n])}):null!=n&&p.sort(function(e,t){return n(s[e],s[t])}),a=0,c=f?(y-d*v)/f:0;a<d;++a,m=u)l=p[a],u=m+((h=g[l])>0?h*c:0)+v,g[l]={data:s[l],index:a,value:h,startAngle:m,endAngle:u,padAngle:x};return g}return s.value=function(t){return arguments.length?(e="function"==typeof t?t:C(+t),s):e},s.sortValues=function(e){return arguments.length?(t=e,n=null,s):t},s.sort=function(e){return arguments.length?(n=e,t=null,s):n},s.startAngle=function(e){return arguments.length?(i="function"==typeof e?e:C(+e),s):i},s.endAngle=function(e){return arguments.length?(r="function"==typeof e?e:C(+e),s):r},s.padAngle=function(e){return arguments.length?(o="function"==typeof e?e:C(+e),s):o},s}().sortValues(null);a.startAngle(r.startAngle),a.endAngle(r.endAngle),a.padAngle(r.padAngle);return Ua(a(n),u({},this.rect,{x:0,y:0}),i,s)}};const Xa=function(e){function t(t){if(e[t.type]&&e[t.type].condition(t)){const n=e[t.type],i=void 0===n.conditionAppend||n.conditionAppend(t);n.items.forEach(e=>{const n=Math.round(t[e.key]),r=t[e.key]-n;t[e.key]=n,i&&"append"===e.type&&(r>0?t[e.key]+=.5:t[e.key]-=.5)})}}return void 0===e&&((e={}).line={append:["x1","x2","y1","y2"],round:[],condition:e=>e.x1===e.x2||e.y1===e.y2,conditionAppend:e=>e.strokeWidth%2!=0},e.rect={append:["x","y"],round:["width","height"],condition:()=>!0,conditionAppend:e=>e.strokeWidth%2!=0}),Object.keys(e).forEach(t=>{const n=e[t];n.items=[],n.append.forEach(e=>{n.items.push({key:e,type:"append"})}),n.round.forEach(e=>{n.items.push({key:e,type:"round"})})}),t.multiple=e=>e.forEach(e=>t(e)),t}();class Ga{constructor(){this.reset(),this.push(...arguments)}static evaluateKey(e,t){if(t){const t=e.substring(0,1),n=e.substring(1);if("x"===t)return"y".concat(n);if("y"===t)return"x".concat(n);if("cx"===e)return"cy";if("cy"===e)return"cx";if("width"===e)return"height";if("height"===e)return"width"}return e}transposeCoordinate(e,t,n){if("number"==typeof t&&isFinite(t)){const i=e.substring(0,1);if("x"===i||"cx"===e)return t*this.width;if("width"===e)return t*this.width;if("r"===e)return t*(n?this.height:this.width);if("y"===i||"cy"===e)return t*this.height;if("height"===e)return t*this.height}return t}push(){return this.storage.push(...arguments),this}processItem(e){let t={};const n=void 0!==e.flipXY?e.flipXY:this.flipXY,i=void 0!==e.crisp?e.crisp:this.crisp;if(e.fn&&"function"==typeof e.fn){let i=n?this.height:this.width,r=n?this.width:this.height;e=e.fn({width:i,height:r,flipXY:n});const o=Object.keys(e);for(let i=0,r=o.length;i<r;i++){let r=o[i];t[Ga.evaluateKey(r,n)]=e[r]}}else{const i=Object.keys(e);for(let r=0,o=i.length;r<o;r++){let o=i[r];const s=Ga.evaluateKey(o,n),a=this.transposeCoordinate(s,e[o],n);t[s]=a}}return i&&Xa(t),t}output(){let e=[];for(let t=0,n=this.storage.length;t<n;t++){let n=this.processItem(this.storage[t]);e.push(n)}return e}reset(){this.storage=[],this.flipXY=!1,this.crisp=!1,this.width=0,this.height=0}}function Ja(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Ga(...t)}function Za(e,t){return e&&t?e.cachedTicks&&e.cachedTicks()||e.ticks({distance:t}):[]}const Qa={created(){},require:["chart","renderer","resolver"],defaultSettings:{layout:{displayOrder:0},style:{ticks:"$guide-line",minorTicks:"$guide-line--minor"}},beforeRender(){this.blueprint=Ja(),this.blueprint.width=this.rect.width,this.blueprint.height=this.rect.height,this.blueprint.x=this.rect.x,this.blueprint.y=this.rect.y,this.blueprint.crisp=!0},render(){if(this.x=this.settings.x?this.chart.scale(this.settings.x):null,this.y=this.settings.y?this.chart.scale(this.settings.y):null,Fo(this,"x",this.rect.width),Fo(this,"y",this.rect.height),!this.x&&!this.y)return[];this.settings.ticks=u({show:!0},this.style.ticks,this.settings.ticks||{}),this.settings.minorTicks=u({show:!1},this.style.minorTicks,this.settings.minorTicks||{}),this.lines={x:[],y:[]},this.lines.x=Za(this.x,this.rect.width),this.lines.y=Za(this.y,this.rect.height),this.lines.y=this.lines.y.map(e=>u(e,{flipXY:!0}));let e=e=>{let t=e.dir,n=e.isMinor,i=this.lines[t].filter(e=>!!e.isMinor===n),r=n?this.settings.minorTicks:this.settings.ticks;this.resolver.resolve({settings:r,data:{items:i,dir:t}}).items.forEach(e=>{let n=e.data;var i,r;e.show&&this.blueprint.push({type:"line",x1:n.position,y1:0,x2:n.position,y2:1,stroke:e.stroke||"black",strokeWidth:void 0!==e.strokeWidth?e.strokeWidth:1,strokeDasharray:void 0!==e.strokeDasharray?e.strokeDasharray:void 0,flipXY:n.flipXY||!1,value:null!==(i=n.value)&&void 0!==i?i:null===(r=n.data)||void 0===r?void 0:r.value,dir:t})})};return e({dir:"x",isMinor:!1}),e({dir:"x",isMinor:!0}),e({dir:"y",isMinor:!1}),e({dir:"y",isMinor:!0}),this.blueprint.output()}};function el(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"bottom";if(n*=.8,"left"===i||"right"===i){let r="right"===i;return"\n M ".concat(e," ").concat(t-n,"\n A ").concat(1.25*n," ").concat(1.25*n,", 0, 1, ").concat(r?0:1,", ").concat(e," ").concat(t+n,"\n L ").concat(r?e+n:e-n," ").concat(t," Z\n ")}let r="bottom"===i;return"\n M ".concat(e-n," ").concat(t,"\n A ").concat(1.25*n," ").concat(1.25*n,", 0, 1, ").concat(r?1:0,", ").concat(e+n," ").concat(t,"\n L ").concat(e," ").concat(r?t+n:t-n," Z\n ")}function tl(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"bottom";if(n*=.75,"left"===i||"right"===i){let r="right"===i;return"\n M ".concat(e+=r?1.5*n:-1.5*n," ").concat(t-n,"\n L ").concat(e," ").concat(t+n,"\n L ").concat(r?e+n:e-n," ").concat(t," Z\n ")}let r="bottom"===i;return t+=r?1.5*n:-1.5*n,"\n M ".concat(e-n," ").concat(t,"\n L ").concat(e+n," ").concat(t,"\n L ").concat(e," ").concat(r?t+n:t-n," Z\n ")}function nl(e,t,n){return e<t||e>n}function il(e,t){if("string"==typeof e.formatter)return t.formatter(e.formatter);if("object"==typeof e.formatter)return t.formatter(e.formatter);if(void 0!==e.scale&&e.scale.data){const t=e.scale.data()&&e.scale.data().fields;return t&&t[0]?t[0].formatter():null}return null}function rl(e){if(void 0===e)return 0;if("number"==typeof e&&isFinite(e))return e;if("string"==typeof e)switch(e){case"center":case"middle":return.5;case"bottom":case"right":return 1;default:return 0}return 0}function ol(e){var t,n;let i=e.chart,r=e.blueprint,o=e.renderer,s=e.p,a=e.settings,l=e.items,c=e.slopeLine,h=!0,d=!1,f=!1,p=!1,g=!1,m=u(!0,{},a.style.line,s.line||{}),y=u(!0,{fill:"#000",fontFamily:"Arial",fontSize:"12px",opacity:1,maxWidth:1,maxWidthPx:9999,padding:5,background:{fill:"#fff",stroke:"transparent",strokeWidth:0,opacity:.5}},a.style.label||{},{fill:m.stroke});if(d=c?r.processItem({type:"line",x1:c.x1,y1:c.y1,x2:c.x2,y2:c.y2,stroke:m.stroke||"black",strokeWidth:m.strokeWidth||1,strokeDasharray:m.strokeDasharray,flipXY:!1,value:s.valueInfo?s.valueInfo.id:s.value}):r.processItem({type:"line",x1:s.position,y1:0,x2:s.position,y2:1,stroke:m.stroke||"black",strokeWidth:m.strokeWidth||1,strokeDasharray:m.strokeDasharray,flipXY:s.flipXY||!1,value:s.valueInfo?s.valueInfo.id:s.value}),s.label&&!1!==s.label.show&&(null==c||!c.slope||0===c.slope)){const e=u(!0,{fill:"#000",fontFamily:"Arial",fontSize:"12px",opacity:1,maxWidth:1,maxWidthPx:9999,padding:5,background:{fill:"#fff",stroke:"transparent",strokeWidth:0,opacity:.5}},a.style.label||{},{fill:m.stroke},s.label);let t,n={width:0,height:0},c="";t=il(s,i),!1!==s.label.showValue&&(t?c=" (".concat(t(s.value),")"):s.scale&&(c=" (".concat(s.value,")"))),c&&(n=o.measureText({text:c,fontFamily:e.fontFamily,fontSize:e.fontSize}));let d=o.measureText({text:e.text||"",fontFamily:e.fontFamily,fontSize:e.fontSize}),y={width:d.width+n.width,height:Math.max(d.height,n.height)},x=e.padding,v=rl(s.flipXY?e.vAlign:e.align),b=rl(s.flipXY?e.align:e.vAlign),w=Math.min(1+y.width+2*x,e.maxWidth*r.width,e.maxWidthPx),k=y.height+2*x,_=s.flipXY?k:w,M=s.flipXY?w:k;if(f=r.processItem({fn:t=>{let n=t.width,i=t.height,o=s.position*n-(s.flipXY?k:w)*(1-v);o=s.flipXY?o:Math.max(o,0);return{type:"rect",x:o,y:Math.max(Math.abs(b*i-M*b),0),width:s.flipXY?_:Math.min(_,r.width-o),height:M,stroke:e.background.stroke,strokeWidth:e.background.strokeWidth,fill:e.background.fill,opacity:e.background.opacity}},flipXY:s.flipXY||!1}),f.x<-1||f.x+f.width>r.width+1||f.y<-1||f.y+f.height>r.height+1)f=void 0;else{p={type:"text",text:e.text||"",fill:e.fill,opacity:e.opacity,fontFamily:e.fontFamily,fontSize:e.fontSize,x:f.x+x,y:f.y+f.height/2+y.height/3,maxWidth:f.width-2*x-n.width,anchor:"start"},c&&(g={type:"text",text:c||"",fill:e.fill,opacity:e.opacity,fontFamily:e.fontFamily,fontSize:e.fontSize,x:p.x+3+(f.width-(n.width+2*x)),y:p.y});for(let e=0,t=l.length;e<t;e++){let t=l[e];"rect"===t.type?Os(f,t)&&(h=!1):"line"===t.type&&s.flipXY===t.flipXY&&js(f,t)&&(h=!1)}}}if(d&&l.push(d),c&&0!==c.slope&&(!1!==(null===(t=c.label)||void 0===t?void 0:t.show)||!1!==(null===(n=c.label)||void 0===n?void 0:n.showValue))){var x,v,b;let e,t;const n=120;let a=!1!==(null===(x=c.label)||void 0===x?void 0:x.show)?null===(v=c.label)||void 0===v?void 0:v.text:"";if(!1!==(null===(b=c.label)||void 0===b?void 0:b.showValue)){var w;const t=il(s,i),n=t?t(c.value):c.value;e="(".concat(c.slope,"x + ").concat(n,")"),a+=null!==(w=c.label)&&void 0!==w&&w.text?" ".concat(e):e}if(a.length>1){var k,_,M;const e=o.measureText({text:a,fontFamily:y.fontFamily,fontSize:y.fontSize});e.width=e.width>n?n:e.width;const s=function(e,t,n){const i=e.scale({scale:"x"}),r=e.scale({scale:"y"});if(t>0){if(i.max()*t+n>=r.max())return!0}else if(t<0&&i.min()*t+n>=r.max())return!0;return!1}(i,c.slope,c.value)?function(e,t,n){const i=e.scale({scale:"x"}),r=e.scale({scale:"y"});return i((r.max()-n)/t)}(i,c.slope,c.value):void 0,u=void 0===s||c.isRtl?y.padding:3*y.padding,h=void 0!==s||c.slope>0?3*y.padding:y.padding,f=function(e,t,n,i,r,o){let s=0;if(void 0!==n){if(n<.8)return s=e.slope<0||e.isRtl?3*o.padding:2*o.padding,e.isRtl,n*r.width+s;if(1===n)return e.isRtl?n*r.width-(i.width+3*o.padding):n*r.width-(i.width+6*o.padding);if(n>.8)return e.isRtl?n*r.width-(i.width+3*o.padding):n*r.width-(i.width+6*o.padding)}else if(e.slope>0)return t.x2-(i.width+2*o.padding);return e.isRtl?t.x1-(i.width+2*o.padding):t.x1}(c,d,s,e,r,y),p=Math.min(d.y1,d.y2);null!==(k=c.label)&&void 0!==k&&k.stroke&&(t={type:"rect",x:c.isRtl?Math.max(f,u)-2:Math.max(f,u)+2,y:Math.abs(Math.max(p,h)-e.height),rx:3,ry:3,width:e.width+y.padding,height:e.height-2,stroke:m.stroke,fill:m.stroke});const g={type:"text",text:a,fill:null!==(_=null===(M=c.label)||void 0===M?void 0:M.stroke)&&void 0!==_?_:m.stroke,opacity:y.opacity,fontFamily:y.fontFamily,fontSize:y.fontSize,x:t?t.x+2:Math.max(f,u)+2,y:t?t.y+e.height-y.padding:Math.abs(Math.max(p,h)-y.padding/2),anchor:"start",title:a,maxWidth:n,width:e.width};(function(e,t,n,i,r){for(let o=0,s=e.length;o<s;o++){const s=e[o];if("text"===(null==s?void 0:s.type)&&Math.abs(s.x-t.x)<Math.max(s.width+i,t.width+i)&&Math.abs(s.y-t.y)<n.height+r)return!0}return!1})(l,g,e,u,h)||(t&&l.push(t),l.push(g))}}h&&f&&p&&(l.push(f,p),g&&l.push(g))}function sl(e){const t={value:e.value};return e.label&&(t.label=e.label.text),t}function al(e){return void 0!==("function"==typeof e.value?e.value():e.value)}function ll(e,t){const n=e.min();if(n===e.max()){const i=function(e){const t=e.range();return 2===(null==t?void 0:t.length)&&t[0]>t[1]}(e);if(t<n)return i?2:-1;if(t>n)return i?-1:2}return e(t)}function cl(e,t){return e&&t&&Math.abs(e.x-t.x)<1e-15&&Math.abs(e.y-t.y)<1e-15}const ul={require:["chart","renderer"],defaultSettings:{layout:{displayOrder:0},style:{oob:{show:!0,width:10,fill:"#1A1A1A",stroke:"transparent",strokeWidth:0,opacity:1,text:{fontFamily:"Arial",stroke:"transparent",fill:"#fff",strokeWidth:0,opacity:1},triangle:{fill:"#4D4D4D",stroke:"transparent",strokeWidth:0,opacity:1},padding:{x:28,y:5}},line:{stroke:"#000"},label:{strokeWidth:0}}},preferredSize:()=>30,beforeRender(){this.blueprint=Ja(),this.blueprint.width=this.rect.width,this.blueprint.height=this.rect.height,this.blueprint.x=this.rect.x,this.blueprint.y=this.rect.y,this.blueprint.crisp=!0},render(){let e=this.settings;if(this.lines={x:[],y:[]},this.lines.x=e.lines&&e.lines.x||[],this.lines.y=e.lines&&e.lines.y||[],0===this.lines.x.length&&0===this.lines.y.length)return[];const t={x0:[],x1:[],y0:[],y1:[]};this.lines.x=this.lines.x.filter(al).map(e=>{if("function"==typeof e.value&&(e.value=e.value()),e.scale){let t=this.chart.scale(e.scale);const n=ll(t,e.value);return u(e,{scale:t,position:n})}return u(e,{position:e.value})}),this.lines.y=this.lines.y.filter(al).map(e=>{if("function"==typeof e.value&&(e.value=e.value()),e.scale){let t=this.chart.scale(e.scale);const n=ll(t,e.value);return u(e,{scale:t,position:n,flipXY:!0})}return u(e,{position:e.value,flipXY:!0})}),this.lines.x=this.lines.x.filter(e=>!(e.position<0||e.position>1)||(t["x".concat(e.position>1?1:0)].push(sl(e)),!1)),this.lines.y=this.lines.y.filter(e=>!(!e.slope||0===e.slope)||(!(e.position<0||e.position>1)||(t["y".concat(e.position>1?1:0)].push(sl(e)),!1)));let n=[];return[...this.lines.x,...this.lines.y].forEach(i=>{if(!0===i.show||void 0===i.show){let r;if(i.slope&&0!==i.slope){const e=this.chart.scale({scale:"x"}),n=this.chart.scale({scale:"y"}),o=e.min(),s=e.max(),a=n.min(),l=n.max();r=g(g({},i),{},{x1:void 0,y1:void 0,x2:void 0,y2:void 0});const c=o*i.slope+i.value,u=s*i.slope+i.value,h=(a-i.value)/i.slope,d=(l-i.value)/i.slope;let f=[];nl(c,a,l)||(f[0]={x:ll(e,o),y:ll(n,c)}),nl(h,o,s)||(f[1]={x:ll(e,h),y:1}),nl(u,a,l)||(f[2]={x:ll(e,s),y:ll(n,u)}),nl(d,o,s)||(f[3]={x:ll(e,d),y:0});if(f.filter(e=>!!e).length>2&&function(e){cl(e[0],e[1])&&(e[1]=void 0),cl(e[1],e[2])&&(e[2]=void 0),cl(e[2],e[3])&&(e[3]=void 0),cl(e[3],e[0])&&(e[3]=void 0)}(f),f=f.filter(e=>!!e),f.length<2)return void t["y".concat(c>l?0:1)].push(sl(i));r.x1=f[0].x,r.y1=f[0].y,r.x2=f[1].x,r.y2=f[1].y}else r=void 0;ol({chart:this.chart,blueprint:this.blueprint,renderer:this.renderer,p:i,settings:e,items:n,slopeLine:r})}}),e.style.oob.show&&function(e){let t=e.blueprint,n=e.oob,i=e.settings,r=e.items;const o=Object.keys(n);let s=i.style.oob||{};for(let e=0,i=o.length;e<i;e++){const i=o[e],a=n[i];if(a.length>0){let e=i.charAt(1),n="y"===i.charAt(0),o=s.padding.x+s.width,l=s.padding.y+s.width,c="bottom";c=n?"1"===e?"bottom":"top":"1"===e?"right":"left";let u=t.processItem({fn:t=>{let i=t.width,r=t.height,u=e*i+("1"===e?-o:o),h=n?l:r-l;return"arc"===s.type?{type:"path",d:el(n?h:u,n?u:h,s.width,c),x:u,y:h,stroke:s.stroke,fill:s.fill,strokeWidth:s.strokeWidth||0}:{type:"circle",cx:u,cy:h,r:s.width,stroke:s.stroke,fill:s.fill,strokeWidth:s.strokeWidth||0,opacity:s.opacity,data:a}},flipXY:n}),h=u.cx||u.x,d=u.cy||u.y;const f=a.map(e=>e.label?"".concat(e.label," (").concat(e.value,")"):"(".concat(e.value,")")),p=f.reduce((e,t,n)=>0===n?t:"".concat(e,"\n\n").concat(t),"");let g={type:"text",text:a.length||"",title:p,x:h-.4*s.width,y:d+.4*s.width,fontFamily:s.text.fontFamily,fontSize:"".concat(1.3*s.width,"px"),stroke:s.text.stroke,fill:s.text.fill,strokeWidth:s.text.strokeWidth||0,opacity:s.text.opacity},m={type:"path",d:tl(h,d,s.width,c),x:h,y:d,stroke:s.triangle.stroke,fill:s.triangle.fill,strokeWidth:s.triangle.strokeWidth||0,opacity:s.triangle.opacity};r.push(u,g,m)}}}({blueprint:this.blueprint,oob:t,settings:e,items:n}),n}};function hl(e){const t={type:"line",x1:0,x2:0,y1:0,y2:0,collider:{type:null}};return"top"===e.align||"bottom"===e.align?(t.x1=e.innerRect.x-e.outerRect.x,t.x2=t.x1+e.innerRect.width,t.y1=t.y2="top"===e.align?e.innerRect.height-e.padding:e.padding):(t.x1=t.x2="left"===e.align?e.innerRect.width-e.padding:e.padding,t.y1=e.innerRect.y-e.outerRect.y,t.y2=t.y1+e.innerRect.height),function(e,t){u(e,t.style)}(t,e),t}function dl(e){return"string"==typeof e||"number"==typeof e?e:"-"}function fl(e,t,n){n.layered||!n.stepSize?function(e,t){t.collider={type:"polygon",vertices:[{x:t.boundingRect.x,y:t.boundingRect.y},{x:t.boundingRect.x+t.boundingRect.width,y:t.boundingRect.y},{x:t.boundingRect.x+t.boundingRect.width,y:t.boundingRect.y+t.boundingRect.height},{x:t.boundingRect.x,y:t.boundingRect.y+t.boundingRect.height}]}}(0,t):n.tilted?function(e,t,n){const i=n.angle*(Math.PI/180),r=Math.max(n.stepSize/2,t.boundingRect.height/2),o="start"===t.anchor,s="end"===t.anchor&&i<0,a="start"===t.anchor&&i>=0,l=t.boundingRect.y+(a||s?t.boundingRect.height:0),c=[{x:t.x-r,y:l},{x:t.x+r,y:l}].map(e=>as(e,i,{x:t.x,y:t.y})),u={x:o?t.boundingRect.x+t.boundingRect.width+10:t.boundingRect.x-10,y:t.boundingRect.y+t.boundingRect.height},h={x:o?t.boundingRect.x+t.boundingRect.width+10:t.boundingRect.x-10,y:t.boundingRect.y},d=i>=0?[u,h]:[h,u];c.push(...d),t.collider={type:"polygon",vertices:c}}(0,t,n):function(e,t,n){if("bottom"===n.align||"top"===n.align){const i=e.position*n.innerRect.width+(n.innerRect.x-n.outerRect.x-n.stepSize/2);t.collider={type:"rect",x:i,y:0,width:i<0?n.stepSize+i:n.stepSize,height:n.innerRect.height}}else{const i=e.position*n.innerRect.height+(n.innerRect.y-n.outerRect.y-n.stepSize/2);t.collider={type:"rect",x:0,y:i,width:n.innerRect.width,height:i<0?n.stepSize+i:n.stepSize}}const i=t.collider;i.x=Math.max(i.x,0),i.y=Math.max(i.y,0);const r=i.x+i.width-(n.outerRect.x+n.outerRect.width);i.width=r>0?i.width-r:i.width;const o=i.y+i.height-(n.outerRect.y+n.outerRect.height);i.height=o>0?i.height-o:i.height}(e,t,n)}function pl(e,t){const n=isNaN(e.style.align)?.5:Math.min(Math.max(e.style.align,0),1);let i=0;if(e.tilted)i=e.stepSize*n;else{const r=t?e.textRect.height:e.textRect.width;i=Math.max(0,e.stepSize-r)*n}return i}function gl(e,t){var n,i;const r={type:"text",text:dl(e.label),x:0,y:0,maxWidth:t.maxWidth,maxHeight:t.maxHeight,tickValue:null!==(n=e.value)&&void 0!==n?n:null===(i=e.data)||void 0===i?void 0:i.value};return"top"===t.align||"bottom"===t.align?(r.x=e.start*t.innerRect.width+(t.innerRect.x-t.outerRect.x)+pl(t,!1),r.y="top"===t.align?t.innerRect.height:0,r.anchor=t.stepSize?"start":"middle",r.x+=isNaN(t.style.offset)?0:+t.style.offset):(r.y=e.start*t.innerRect.height+(t.innerRect.y-t.outerRect.y)+pl(t,!0),r.x="left"===t.align?t.innerRect.width:0,r.anchor="left"===t.align?"end":"start",r.baseline=t.stepSize?"text-before-edge":"central",r.y+=isNaN(t.style.offset)?0:+t.style.offset),function(e,t){["fill","fontSize","fontFamily"].forEach(n=>{e[n]=t.style[n]})}(r,t),function(e,t){if(!t.tilted&&!t.stepSize)if("top"===t.align||"bottom"===t.align){const n=0,i=t.outerRect.width,r=Math.min(t.maxWidth/2,t.textRect.width/2),o=e.x-r,s=e.x+r;o<n?(e.anchor="start",e.x=t.innerRect.x-t.outerRect.x):s>i&&(e.anchor="end",e.x=t.innerRect.width+t.innerRect.x)}else{const n=0,i=t.outerRect.height,r=t.maxHeight/2,o=e.y-r,s=e.y+r;o<n?(e.y=t.innerRect.y-t.outerRect.y,e.baseline="text-before-edge"):s>i&&(e.y=t.innerRect.height+(t.innerRect.y-t.outerRect.y),e.baseline="text-after-edge")}}(r,t),function(e,t){"top"===t.align?e.y-=t.padding:"bottom"===t.align?e.y+=t.padding+t.maxHeight:"left"===t.align?e.x-=t.padding:"right"===t.align&&(e.x+=t.padding)}(r,t),function(e,t){if(t.tilted){const n=-t.angle,i=n*(Math.PI/180);"bottom"===t.align?(e.x-=t.maxHeight*Math.sin(i)/2,e.y-=t.maxHeight,e.y+=t.maxHeight*Math.cos(i)/2):e.x-=t.maxHeight*Math.sin(i)/3,e.transform="rotate(".concat(n,", ").concat(e.x,", ").concat(e.y,")"),e.anchor="bottom"===t.align==t.angle<0?"start":"end";const r=Math.cos(i)*t.maxWidth;if("bottom"===t.align==t.angle<0){const n=t.outerRect.width-t.paddingEnd;e.x+r>n&&(e.maxWidth=(n-e.x-10)/Math.cos(i))}else{const n=t.paddingEnd;e.x-r<n&&(e.maxWidth=(e.x-n-10)/Math.cos(i))}}}(r,t),function(e,t){e.boundingRect=t.textBounds(e)}(r,t),fl(e,r,t),r}function ml(e,t){const n={type:"line",x1:0,x2:0,y1:0,y2:0,collider:{type:null},tickValue:e.value};return"top"===t.align||"bottom"===t.align?(n.x1=n.x2=e.position*t.innerRect.width+(t.innerRect.x-t.outerRect.x),n.y1="top"===t.align?t.innerRect.height:0,n.y2="top"===t.align?n.y1-t.tickSize:n.y1+t.tickSize):(n.y1=n.y2=e.position*t.innerRect.height+(t.innerRect.y-t.outerRect.y),n.x1="left"===t.align?t.innerRect.width:0,n.x2="left"===t.align?n.x1-t.tickSize:n.x1+t.tickSize),function(e,t){u(e,t.style)}(n,t),function(e,t){"top"===t.align?(e.y1-=t.padding,e.y2-=t.padding):"bottom"===t.align?(e.y1+=t.padding,e.y2+=t.padding):"left"===t.align?(e.x1-=t.padding,e.x2-=t.padding):"right"===t.align&&(e.x1+=t.padding,e.x2+=t.padding)}(n,t),function(e,t){const n=e.strokeWidth/2;e.x1===t.innerRect.width?(e.x1-=n,e.x2-=n):0===e.x1?(e.x1+=n,e.x2+=n):e.y1===t.innerRect.height?(e.y1-=n,e.y2-=n):0===e.y1&&(e.y1+=n,e.y2+=n)}(n,t),n}function yl(e){return!e.isMinor&&e.position>=0&&e.position<=1}function xl(e){let t=e.rect,n=e.state,i=e.majorTicks,r=e.measure;return e.horizontal?function(e){let t=e.majorTicks,n=e.measureText,i=e.rect;const r="layered"===e.state.labels.activeMode?2:1,o=i.width,s=t.map(e=>e.label).map(e=>"".concat(e.slice(0,1)).concat(e.length>1?"…":"")).map(n).map(e=>e.width);for(let e=0;e<t.length;++e){const n=t[e];if(r*o*Math.abs(n.start-n.end)<s[e])return!0}return!1}({majorTicks:i,measureText:r,rect:t,state:n}):function(e){let t=e.majorTicks,n=e.measureText;const i=e.rect.height,r=n("M").height;return!(t.length<2)&&i*Math.abs(t[0].position-t[1].position)<r}({majorTicks:i,measureText:r,rect:t})}function vl(e){let t=e.value,n=e.maxValue,i=e.minValue,r=e.range,o=e.modifier;return isNaN(r)||isNaN(o)||(t=r*o),t>n&&(t=n),t<i&&(t=i),t}function bl(e){let t=e.isDiscrete,n=e.rect,i=e.formatter,r=e.measureText,o=e.scale,s=e.settings,a=e.state,l=0;const c={left:0,top:0,right:0,bottom:0},u=s.labels,h=u.maxLengthPx,d=u.minLengthPx;if(s.labels.show){const e=s.align,u="top"===e||"bottom"===e,f=u?n.inner.width:n.inner.height,p=o.ticks({settings:s,distance:f,formatter:i}).filter(yl),g=e=>{const t=r({text:e,fontSize:s.labels.fontSize,fontFamily:s.labels.fontFamily});return t.width=vl({value:t.width,maxValue:h,minValue:d}),t};if(t&&u&&"auto"===s.labels.mode&&(!function(e){let t=e.majorTicks,n=e.measure,i=e.rect,r=e.state,o=e.settings;const s=o.labels.maxGlyphCount,a="layered"===r.labels.activeMode?2:1,l=o.labels.tiltThreshold?o.labels.tiltThreshold:.7,c=n("…").width,u=i.width;let h=0,d=0;if(isNaN(s))for(let e=0;e<t.length;e++){const i=t[e],r=i.label,o=n(r).width*(r.length>1?l:1);if(d=a*u*Math.abs(i.start-i.end),o+c>d)return!0}else if(d=a*u*t.reduce((e,t)=>Math.min(Math.abs(t.start-t.end),e),1/0),h=n("M").width*l*s,h+c>d)return!0;return!1}({majorTicks:p,measure:g,rect:n.inner,state:a,settings:s})?a.labels.activeMode="horizontal":a.labels.activeMode="tilted"),!s.labels.filterOverlapping&&"tilted"!==a.labels.activeMode&&xl({rect:n.inner,state:a,majorTicks:p,measure:g,horizontal:u})){return{size:Math.max(n.outer.width,n.outer.height),isToLarge:!0}}let m,y;if("tilted"===a.labels.activeMode){const e=Math.abs(s.labels.tiltAngle)*(Math.PI/180);m=t=>vl({value:t.width,maxValue:h,minValue:d})*Math.sin(e)+t.height*Math.cos(e)}else m=u?e=>e.height:e=>vl({value:e.width,maxValue:h,minValue:d});if(u&&"tilted"!==a.labels.activeMode)y=["M"];else if(isNaN(s.labels.maxGlyphCount))y=p.map(e=>e.label);else{let e="";for(let t=0;t<s.labels.maxGlyphCount;t++)e+="M";y=[e]}const x=y.map(g),v=x.map(m),b=Math.max(...v,0);if(l+=b,l+=s.labels.margin,"layered"===a.labels.activeMode&&(l*=2),"tilted"===a.labels.activeMode){const e="bottom"===s.align==s.labels.tiltAngle>=0,t=Math.abs(s.labels.tiltAngle)*(Math.PI/180),i=(b-g("M").height*Math.cos(t))/Math.sin(t),r=e=>Math.min(i,e.width)*Math.cos(t)+e.height,o=(t,i)=>{const r=p[i]?p[i].position:0;return e?t-r*n.inner.width:t-(1-r)*n.inner.width},a=Math.min(s.labels.maxEdgeBleed,Math.max(...x.map(r).map(o),0))+s.paddingEnd;if(c[e?"left":"right"]=a,!s.labels.filterOverlapping&&function(e){let t=e.majorTicks,n=e.measureText,i=e.rect,r=e.bleedSize,o=e.angle;if(t.length<2)return!1;if(0===o)return!0;const s=Math.abs(o),a=1/(Math.min(i.outer.width-r,i.inner.width)*Math.abs(t[0].position-t[1].position));return n("M").height>Math.sin(s*(Math.PI/180))/a}({majorTicks:p,measureText:g,rect:n,bleedSize:a,angle:s.labels.tiltAngle})){return{size:Math.max(n.outer.width,n.outer.height),isToLarge:!0}}}}return{size:l,edgeBleed:c}}const wl=(e,t,n)=>e.width*Math.abs(t.position-n.position);function kl(e){let t=e.layered,n=e.major,i=e.innerRect,r=e.outerRect,o=e.tick,s=e.index;const a=t?2:1,l=n[s-a],c=n[s+a],u=l?wl(i,o,l)/2-2:1/0,h=c?wl(i,o,c)/2-2:1/0;return n.length<2?i.width:l?c?2*Math.min(u,h):(e=>{let t=e.innerRect,n=e.outerRect,i=e.tick,r=e.prevWidth;const o=t.x-n.x,s=n.width-t.width-o,a=t.width-t.width*i.position+s,l=2*Math.min(r,a),c=1===i.position?t.width/2-2:0;return Math.max(r,l,c)})({innerRect:i,outerRect:r,tick:o,prevWidth:u}):(e=>{let t=e.innerRect,n=e.outerRect,i=e.tick,r=e.nextWidth;const o=t.x-n.x,s=t.width*i.position+o,a=2*Math.min(r,s),l=0===i.position?t.width/2-2:0;return Math.max(r,a,l)})({innerRect:i,outerRect:r,tick:o,nextWidth:h})}function _l(e){const t=e.innerRect,n={cx:t.width/2,cy:t.height/2},i=Math.min(t.height,t.width)/2*e.radius,r=i+e.style.strokeWidth,o={visible:!0,type:"path",arcDatum:{startAngle:e.startAngle,endAngle:e.endAngle},transform:"translate(0, 0) translate(".concat(n.cx,", ").concat(n.cy,")"),desc:{share:1,slice:{cornerRadius:0,innerRadius:i,outerRadius:r}},ticks:[]};return function(e,t){u(e,t.style)}(o,e),o}function Ml(e,t,n,i){return{x:e+n*Math.cos(i),y:t+n*Math.sin(i)}}function Sl(e,t){const n=t.innerRect,i={cx:n.width/2,cy:n.height/2},r=Math.min(n.height,n.width)/2*t.radius+t.padding,o=t.startAngle,s=t.endAngle,a=t.tickSize,l=s-o;let c=s-e.position*l;c-=Math.PI/2;const h=Ml(i.cx,i.cy,r+a,c),d=Ml(i.cx,i.cy,r,c),f={type:"line",x1:h.x,y1:h.y,x2:d.x,y2:d.y,value:e.value};return function(e,t){const n=g({},t.style);u(e,n)}(f,t),f}function Rl(e){return"string"==typeof e||"number"==typeof e?e:"-"}function Cl(e,t,n){let i;return i="left"===t?n.x:"right"===t?e.outerRect.width-n.x:Math.max(n.x,e.outerRect.width-n.x),i}function Nl(e,t){const n=t.innerRect,i={cx:n.width/2,cy:n.height/2},r=Math.min(n.height,n.width)/2*t.radius+t.padding,o=t.startAngle,s=t.endAngle,a=t.tickSize,l=s-o,c=.2;let u,h;u="top"===t.align||"bottom"===t.align?s-e.position*l:o+e.position*l,h=u<-.2&&u>-Math.PI+c?"left":u>.2&&u<Math.PI-c?"right":"center",u-=Math.PI/2;const d=function(e,t,n,i){return{x:e+n*Math.cos(i),y:t+n*Math.sin(i)}}(i.cx,i.cy,r+a+6,u);let f;f="left"===h?"end":"right"===h?"start":"middle";const p={type:"text",text:Rl(e.label),align:h,x:d.x,y:d.y,maxHeight:t.maxHeight,maxWidth:Cl(t,h,d),anchor:f,baseline:"middle"};return function(e,t){["fill","fontSize","fontFamily"].forEach(n=>{e[n]=t.style[n]})}(p,t),function(e,t){e.boundingRect=t.textBounds(e)}(p,t),function(e,t,n){let i,r;const o=parseFloat(n.fontSize)||0;i=t.y-o/2,r=e.innerRect.height-(t.y+o/2),(i<0||r<0)&&(n.text="")}(t,d,p),p}function Dl(e){let t=0;return t+=e.paddingStart,t+=e.line.show?e.line.strokeWidth/2:0,t+=e.ticks.show?e.ticks.margin:0,t}function ql(e){let t=0;return t+=e.line.show?e.line.strokeWidth/2:0,t+=e.ticks.show?e.ticks.margin:0,t}function El(e){let t=0;return t+=e.ticks.show?e.ticks.tickSize:0,t+=Dl(e)+e.labels.margin,t}function zl(e,t){return e.map(e=>ml(e,t))}function Al(e,t){return t?Math.abs(t.end-t.start):e.bandwidth()}function Ol(e){let t=e.textMetrics,n=e.settings,i=e.innerRect,r=e.scale,o=e.tilted,s=e.layered,a=e.tick;const l=t.height,c=Al(r,a),u={width:0,height:l};if("left"===n.align||"right"===n.align)u.width=i.width-El(n)-n.paddingEnd;else if(s)u.width=c*i.width*2;else if(o){const e=Math.abs(n.labels.tiltAngle)*(Math.PI/180);u.width=(i.height-El(n)-n.paddingEnd-l*Math.cos(e))/Math.sin(e)}else u.width=c*i.width;return u.width=vl({value:u.width,maxValue:n.labels.maxLengthPx,minValue:n.labels.minLengthPx}),u}function Tl(e){let t=e.textMetrics,n=e.settings,i=e.innerRect,r=e.outerRect,o=e.tilted,s=e.layered,a=e.tick,l=e.index,c=e.major;const u=t.height,h={width:0,height:u};if("left"===n.align||"right"===n.align)h.width=i.width-El(n)-n.paddingEnd;else if(o){const e=Math.abs(n.labels.tiltAngle)*(Math.PI/180);h.width=(i.height-El(n)-n.paddingEnd-u*Math.cos(e))/Math.sin(e)}else h.width=kl({layered:s,major:c,innerRect:i,outerRect:r,tick:a,index:l});return h.width=vl({value:h.width,maxValue:n.labels.maxLengthPx,minValue:n.labels.minLengthPx}),h}function Il(e){let t;function n(){return t=Tl,n}function i(){return t=Ol,i}function r(e){let n=e.settings,i=e.scale,r=e.innerRect,o=e.outerRect,s=e.measureText,a=e.ticks,l=e.state,c=e.textBounds;const u=[],h=function(e){return e.filter(e=>!e.isMinor)}(a),d=function(e){return e.filter(e=>e.isMinor)}(a),f={innerRect:r,align:n.align,outerRect:o},p="tilted"===l.labels.activeMode,g="layered"===l.labels.activeMode;let m;if(n.arc&&(f.startAngle=n.arc.startAngle,f.endAngle=n.arc.endAngle,f.radius=n.arc.radius),n.line.show&&(f.style=n.line,f.padding=n.paddingStart,n.arc?u.push(_l(f)):u.push(hl(f))),n.ticks.show&&(f.style=n.ticks,f.tickSize=n.ticks.tickSize,f.padding=Dl(n),n.arc?(f.padding=ql(n),m=function(e,t){return e.map(e=>Sl(e,t))}(h,f)):m=zl(h,f)),n.labels.show){const e=El(n);f.style=n.labels,f.padding=e,f.tilted=p,f.layered=g,f.angle=n.labels.tiltAngle,f.paddingEnd=n.paddingEnd,f.textBounds=c;const a=(e,a)=>{f.textRect=function(e){let t=e.style;return(0,e.measureText)({text:e.tick.label,fontSize:t.fontSize,fontFamily:t.fontFamily})}({tick:e,measureText:s,style:f.style});const l=t({textMetrics:f.textRect,settings:n,innerRect:r,outerRect:o,scale:i,tilted:p,layered:g,tick:e,major:h,index:a});f.maxWidth=l.width,f.maxHeight=l.height,f.stepSize=function(e){let t=e.innerRect,n=e.scale,i=e.settings,r=e.tick;return("top"===i.align||"bottom"===i.align?t.width:t.height)*Al(n,r)}({innerRect:r,scale:i,settings:n,tick:e})};let l=[];n.arc?(f.padding=function(e){let t=0;return t+=e.ticks.show?e.ticks.tickSize:0,t+=ql(e)+e.labels.margin,t}(n),l=function(e,t,n){return e.map((e,i)=>{n(e,i);const r=Nl(e,t);return r.data=e.data,r})}(h,f,a)):l=!g||"top"!==n.align&&"bottom"!==n.align?function(e,t,n){return e.map((e,i)=>{n(e,i);const r=gl(e,t);return r.data=e.data,r})}(h,f,a):function(e,t,n,i){const r=t.padding,o=El(n);return e.map((e,s)=>{i(e,s);const a=o+t.maxHeight+n.labels.margin;t.layer=s%2,t.padding=s%2==0?r:a;const l=gl(e,t);return l.data=e.data,l})}(h,f,n,a),n.labels.filterOverlapping&&function(e,t,n){let i=(t,n)=>Os(R(1,e[t].boundingRect),R(1,e[n].boundingRect));if(n&&n.tilted){const t=Math.abs(n.angle);i=(n,i)=>{const r=1/Math.abs(e[n].x-e[i].x),o=Math.sin(t*(Math.PI/180))/r;return e[n].boundingRect.height>o}}for(let n=0;n<=e.length-1;n++)for(let r=n+1;r<=Math.min(n+5,n+(e.length-1));r++)e[n]&&e[r]&&i(n,r)&&(r===e.length-1?(e.splice(n,1),t&&t.splice(n,1)):(e.splice(r,1),t&&t.splice(r,1)),r--,n--)}(l,m,f),u.push(...l)}return n.minorTicks&&n.minorTicks.show&&d.length>0&&(f.style=n.minorTicks,f.tickSize=n.minorTicks.tickSize,f.padding=function(e){return e.line.strokeWidth+e.minorTicks.margin}(n),u.push(...zl(d,f))),m&&u.push(...m),u}return n.build=r,i.build=r,e?i():n()}const jl={labels:{show:!0,tiltAngle:40,tiltThreshold:.7,maxEdgeBleed:1/0,margin:4,maxLengthPx:150,minLengthPx:0,mode:"auto",maxGlyphCount:NaN,align:.5,offset:0,filterOverlapping:!1},ticks:{show:!1,margin:0,tickSize:4},line:{show:!1},paddingStart:0,paddingEnd:10,align:"auto"},Pl={labels:{show:!0,margin:4,maxLengthPx:150,minLengthPx:0,align:.5,offset:0,filterOverlapping:!0,centerEndLabels:!1},ticks:{show:!0,margin:0,tickSize:8},minorTicks:{show:!1,tickSize:3,margin:0},line:{show:!0},paddingStart:0,paddingEnd:10,align:"auto"};const Fl={require:["chart","renderer","dockConfig"],defaultSettings:{layout:{displayOrder:0,prioOrder:0},settings:{},style:{labels:"$label",ticks:"$guide-line",minorTicks:"$guide-line--minor",line:"$guide-line"}},created(){this.state={isDiscrete:!!this.scale.bandwidth,isHorizontal:!1,labels:{activeMode:"horizontal"},ticks:[],innerRect:{width:0,height:0,x:0,y:0},outerRect:{width:0,height:0,x:0,y:0},defaultDock:void 0,concreteNodeBuilder:void 0,settings:void 0},this.state.isDiscrete?this.state.defaultDock="bottom":this.state.defaultDock="left",this.setState(this.settings)},setState(){this.state.isDiscrete=!!this.scale.bandwidth,this.state.settings=function(e){let t=e.state,n=e.style,i=e.settings;const r=u(!0,{},t.isDiscrete?jl:Pl,n),o=u(!0,{},r,i.settings),s=i.layout.dock||t.defaultDock;o.dock=s,o.align=function(e,t){const n=["top","bottom"],i=["left","right"];return-1!==n.indexOf(e)&&-1===i.indexOf(t)||-1!==i.indexOf(e)&&-1===n.indexOf(t)?e:t}(i.settings.align,s),o.labels.tiltAngle=Math.max(-90,Math.min(o.labels.tiltAngle,90));const a=o.paddingStart,l=o.paddingEnd;return o.paddingStart="function"==typeof a?a.call(null):a,o.paddingEnd="function"==typeof l?l.call(null):l,o}(this),this.state.concreteNodeBuilder=Il(this.state.isDiscrete),this.dockConfig.dock(this.state.settings.dock),this.state.isHorizontal="top"===this.state.settings.align||"bottom"===this.state.settings.align,this.state.labels.activeMode=function(e,t,n){const i=t.labels.mode;return n&&e.isHorizontal?"auto"===i?e.labels.activeMode:-1!==["layered","tilted"].indexOf(t.labels.mode)&&-1!==["top","bottom"].indexOf(t.dock)?i:"horizontal":"horizontal"}(this.state,this.state.settings,this.state.isDiscrete)},preferredSize(e){const t=this.formatter,n=this.state,i=this.scale,r=this.state.isHorizontal?e.inner.width:e.inner.height;this.state.pxScale=Lo(i,r);const o=function(e){let t=e.isDiscrete,n=e.rect,i=e.formatter,r=e.measureText,o=e.scale,s=e.settings,a=0;const l=bl({isDiscrete:t,rect:n,formatter:i,measureText:r,scale:o,settings:s,state:e.state}),c=l.size,u=l.edgeBleed;if(a+=c,l.isToLarge)return{size:a};if(s.ticks.show&&(a+=s.ticks.margin,a+=s.ticks.tickSize),s.minorTicks&&s.minorTicks.show){const e=s.minorTicks.margin+s.minorTicks.tickSize;e>a&&(a=e)}if(s.line.show){const e=s.line.strokeWidth/2;a+=e,u[function(e){switch(e){case"top":return"bottom";case"bottom":return"top";case"left":return"right";case"right":return"left";default:return e}}(s.align)]=Math.ceil(e)}return a+=s.paddingStart,a+=s.paddingEnd,{size:a,edgeBleed:u}}({isDiscrete:this.state.isDiscrete,rect:{inner:e.inner,outer:e.outer},formatter:t,measureText:this.renderer.measureText,scale:this.state.pxScale,settings:this.state.settings,state:n});return o},beforeUpdate(){const e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).settings;this.setState(e)},resize(e){const t=e.inner,n=e.outer,i=u({},t,function(e){let t=e.align,n=e.inner;return"left"===t?{x:n.width+n.x}:"right"===t||"bottom"===t?n:{y:n.y+n.height}}({align:this.state.settings.align,inner:t})),r=n||i;return u(this.state.innerRect,i),u(this.state.outerRect,r),n},beforeRender(){const e=this.scale,t=this.formatter,n=this.state.isHorizontal?this.state.innerRect.width:this.state.innerRect.height;this.state.pxScale=Lo(e,n),this.state.ticks=this.state.pxScale.ticks({distance:n,formatter:t}).filter(e=>e.position>=0&&e.position<=1)},render(){const e=this.state,t=[];return t.push(...this.state.concreteNodeBuilder.build({settings:this.state.settings,scale:this.state.pxScale,innerRect:this.state.innerRect,outerRect:this.state.outerRect,measureText:this.renderer.measureText,textBounds:this.renderer.textBounds,ticks:this.state.ticks,state:e})),Xa.multiple(t),t}};const Ll={render:()=>[]};function $l(e,t,n){let i="";if("function"==typeof e)i=e();else if("string"==typeof e)i=e;else if(n){const e=(n.data().fields||[]).map(e=>e.title());i=e.join(t)}return i}function Bl(e,t){let n="middle";return"left"===e?"top"===t?n="end":"bottom"===t&&(n="start"):"right"===e?"top"===t?n="start":"bottom"===t&&(n="end"):"left"===t?n="start":"right"===t&&(n="end"),n}const Hl={require:["renderer","chart"],defaultSettings:{layout:{dock:"bottom",displayOrder:0,prioOrder:0},settings:{paddingStart:5,paddingEnd:5,paddingLeft:0,paddingRight:0,anchor:"center",join:", ",maxLengthPx:NaN},style:{text:"$title"}},created(){this.definitionSettings=this.settings.settings;const e=this.settings.text,t=this.definitionSettings.join;this.title=$l(e,t,this.scale)},preferredSize(){return this.renderer.measureText({text:this.title,fontSize:this.style.text.fontSize,fontFamily:this.style.text.fontFamily}).height+this.definitionSettings.paddingStart+this.definitionSettings.paddingEnd},render(){const e=this.title,t=this.definitionSettings,n=this.rect,i=[];return i.push(function(e){let t=e.title,n=e.definitionSettings,i=e.dock,r=e.rect,o=e.measureText,s=e.style;const a={type:"text",text:t,x:0,y:0,dx:0,dy:0,anchor:Bl(i,n.anchor),baseline:"alphabetical",stroke:"transparent",strokeWidth:0,fontWeight:"normal"};u(a,s.text);const l=o(a);if("top"===i||"bottom"===i){let e=r.width/2;"left"===n.anchor?e=n.paddingLeft||0:"right"===n.anchor&&(e=r.width-(n.paddingRight||0)),a.x=e,a.y="top"===i?r.height-n.paddingStart:n.paddingStart+l.height,a.dy="top"===i?-l.height/6:-l.height/3,a.maxWidth=.8*r.width}else{let e=r.height/2;"top"===n.anchor?e=n.paddingStart:"bottom"===n.anchor&&(e=r.height-n.paddingStart),a.y=e,a.x="left"===i?r.width-n.paddingStart:n.paddingStart,a.dx="left"===i?-l.height/3:l.height/3;const t="left"===i?270:90;a.transform="rotate(".concat(t,", ").concat(a.x+a.dx,", ").concat(a.y+a.dy,")"),a.maxWidth=.8*r.height}return isNaN(n.maxLengthPx)||(a.maxWidth=Math.min(a.maxWidth,n.maxLengthPx)),a}({title:e,dock:this.settings.layout.dock,definitionSettings:t,rect:n,measureText:this.renderer.measureText,style:this.style})),i},beforeUpdate(e){e.settings&&(u(this.settings,e.settings),this.definitionSettings=e.settings.settings);const t=this.settings.text,n=this.definitionSettings.join;this.title=$l(t,n,this.scale)}};function Wl(e,t){const n=e.settings.layout.dock,i=e.settings.settings.invert,r="top"===n||"bottom"===n,o=r?"width":"height",s=e.rect[o],a=e.chart.scroll(e.settings.scroll);let l;{let e=t[r?"x":"y"];i&&(e=s-e);const n=a.getState();l={startOffset:e,startScroll:n.start,swipe:!1};const o=e/s*(n.max-n.min)+n.min;o<n.start?l.startScroll=o:o>n.start+n.viewSize&&(l.startScroll=o-n.viewSize)}return{update:e=>{let t=e[r?"x":"y"];if(i&&(t=s-t),!l.swipe){if(Math.abs(l.startOffset-t)<=1)return;l.swipe=!0}const n=a.getState(),o=(t-l.startOffset)/s*(n.max-n.min),c=l.startScroll+o;a.moveTo(c)},end:e=>{let t=e[r?"x":"y"];i&&(t=s-t);const n=a.getState();if(l.swipe){const e=(t-l.startOffset)/s*(n.max-n.min),i=l.startScroll+e;a.moveTo(i)}else{const e=t/s*(n.max-n.min)+n.min-n.viewSize/2;a.moveTo(e)}}}}function Vl(e,t){const n=t.element().getBoundingClientRect();return{x:e.center.x-n.left,y:e.center.y-n.top}}const Ul={require:["chart","renderer"],on:{panStart(e){const t=Vl(e,this.renderer),n={x:t.x-e.deltaX,y:t.y-e.deltaY};this.currentMove=Wl(this,n),this.currentMove.update(t)},panMove(e){if(!this.currentMove)return;const t=Vl(e,this.renderer);this.currentMove.update(t)},panEnd(e){if(!this.currentMove)return;const t=Vl(e,this.renderer);this.currentMove.end(t),this.currentMove=null},panCancel(){this.currentMove=null},tap(e){const t=Vl(e,this.renderer);Wl(this,t).end(t)}},defaultSettings:{settings:{backgroundColor:"#eee",thumbColor:"#ccc",width:16}},preferredSize:function(e){const t=this.chart.scroll(this.settings.scroll).getState();if(t.viewSize>=t.max-t.min){return Math.max(e.width,e.height)}return this.settings.settings.width},render:function(e){const t=this.settings.layout.dock,n=this.settings.settings.invert,i="top"===t||"bottom"===t,r=i?"width":"height",o=this.rect[r],s=this.chart.scroll(this.settings.scroll).getState();let a=o*(s.start-s.min)/(s.max-s.min);const l=o*s.viewSize/(s.max-s.min);return n&&(a=o-a-l),e("div",{style:{position:"relative",width:"100%",height:"100%",background:this.settings.settings.backgroundColor,pointerEvents:"auto"}},[].concat(e("div",{class:"scroller",style:{position:"absolute",[i?"left":"top"]:"".concat(a,"px"),[i?"top":"left"]:"25%",[i?"height":"width"]:"50%",[r]:"".concat(Math.max(1,l),"px"),background:this.settings.settings.thumbColor}})))},renderer:"dom"};function Yl(e){let t=e.h,n=e.isVertical,i=e.value,r=e.pos,o=e.align,s=e.borderHit,a=e.state,l=e.idx;const c="end"!==o,h=c?{left:"0",top:"0"}:{right:"0",bottom:"0"};let d=0,f="100%",p="100%";return a.targetRect&&"start"===a.settings.bubbles.align?(f="".concat(a.targetRect.x+a.targetRect.width,"px"),p="".concat(a.targetRect.y+a.targetRect.height,"px")):a.targetRect&&"end"===a.settings.bubbles.align&&(d=n?a.targetRect.x:a.targetRect.y,f="".concat(a.rect.width-d,"px"),p="".concat(a.rect.height-d,"px")),c||(r-=s),t("div",{onmouseover(e){e.srcElement.children[0].style.backgroundColor="#000",e.srcElement.children[0].style[n?"height":"width"]="2px"},onmouseout(e){e.srcElement.children[0].style.backgroundColor=a.style.line.stroke,e.srcElement.children[0].style[n?"height":"width"]="1px"},"data-value":i,"data-key":[a.key,"edge",l].join("-"),style:{cursor:n?"ns-resize":"ew-resize",position:"absolute",left:"".concat(n?d:r,"px"),top:"".concat(n?r:d,"px"),height:n?"".concat(s,"px"):p,width:n?f:"".concat(s,"px"),pointerEvents:"auto"}},[t("div",{style:u({backgroundColor:a.style.line.stroke,position:"absolute",height:n?"".concat(1,"px"):"100%",width:n?"100%":"".concat(1,"px"),pointerEvents:"none"},h)})])}function Kl(e){let t=e.h,n=e.isVertical,i=e.label,r=e.otherValue,o=e.rangeIdx,s=e.idx,a=e.pos,l=e.align,c=e.state,u=e.value;const h="end"!==l,d="outside"===c.settings.bubbles.placement;let f,p="none";n?(f=h?"left":"right",d&&(p=h?"translate(-100%, 0px)":"translate(100%, 0px)")):(f=h?"top":"bottom",d&&(p=h?"translate(0px, -100%)":"translate(0px, 100%)"));let m=c.edit&&c.edit.rangeIdx===o&&c.edit.bubbleIdx===s;const y={position:"relative",borderRadius:"".concat(c.style.bubble.borderRadius,"px"),border:"".concat(c.style.bubble.strokeWidth,"px solid ").concat(c.style.bubble.stroke),backgroundColor:c.style.bubble.fill,color:c.style.bubble.color,fontFamily:c.style.bubble.fontFamily,fontSize:c.style.bubble.fontSize,padding:"4px 8px",textAlign:"center",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"150px",minWidth:"50px",minHeight:"1em",pointerEvents:"auto",transform:n?"translate(0,-50%)":"translate(-50%,0)",cursor:n?"ns-resize":"ew-resize"};let x=c.style.bubble.stroke;const v=m?t("input",{type:"text",value:u,style:g(g({},y),{},{textAlign:"start",textOverflow:"",fontSize:"13px"}),onkeyup(e){if("Enter"===e.key){e.preventDefault(),e.stopPropagation();const t=parseFloat(e.target.value);isNaN(t)?(x="rgba(230, 78, 78, 0.6)",e.target.style.border="".concat(c.style.bubble.strokeWidth,"px solid ").concat(x)):c.onEditConfirmed(o,t,r)}else"Escape"===e.key&&(e.preventDefault(),e.stopPropagation(),c.onEditCanceled())}}):t("div",{"data-key":[c.key,"bubble",o,s].join("-"),"data-other-value":r,"data-idx":o,"data-bidx":s,style:y},[i]);return t("div",{style:{position:"absolute",[f]:"0",[n?"top":"left"]:"".concat(a,"px"),transform:p}},[v])}function Xl(e){let t=e.h,n=e.isVertical,i=e.top,r=e.height,o=e.color,s=e.on,a=e.opacity;return t("div",u({style:{backgroundColor:o,opacity:a,position:"absolute",left:n?0:"".concat(i,"px"),top:n?"".concat(i,"px"):0,height:n?"".concat(r,"px"):"100%",width:n?"100%":"".concat(r,"px"),pointerEvents:"auto"}},s),[])}function Gl(e){let t=e.borderHit,n=e.els,i=e.isVertical,r=e.state,o=e.vStart,s=e.vEnd,a=e.idx,l=0;r.targetRect&&(l=i?r.targetRect.y:r.targetRect.x);const c=!!r.scale,u=c?r.scale.norm(o)*r.size:o,h=c?r.scale.norm(s)*r.size:s,d=Math.abs(u-h),f=Math.min(u,h)+l,p=f+d;if(r.targetRect){const e=r.targetFillRect||r.targetRect,t=i?e.height:e.width,a=c?r.scale.norm(o)*t:o,l=c?r.scale.norm(s)*t:s,u=Math.abs(a-l),h=Math.min(a,l),d={h:r.h,isVertical:i,top:h,height:u,color:r.style.target.fill,opacity:r.style.target.opacity};r.style.target.opacity<.8&&(d.on={onmouseover(e){e.srcElement.style.opacity=r.style.target.opacity+.1},onmouseout(e){e.srcElement.style.opacity=r.style.target.opacity}}),n.push(r.h("div",{style:{position:"absolute",left:"".concat(e.x,"px"),top:"".concat(e.y,"px"),height:"".concat(e.height,"px"),width:"".concat(e.width,"px")}},[Xl(d)]))}const g=u<h?o:s,y=u<h?s:o,x=m(c?r.scale.domain():[Math.min(o,s),Math.max(o,s)],2),v=x[0],b=x[1],w=g+1e-5>=v&&g-1e-5<=b,k=y-1e-5<=b&&y+1e-5>=v;w&&n.push(Yl({h:r.h,isVertical:i,borderHit:t,value:g,pos:f,align:"start",state:r,idx:a})),k&&n.push(Yl({h:r.h,isVertical:i,borderHit:t,value:y,pos:p,align:"end",state:r,idx:a}));const _=r.settings.bubbles;if(_&&_.show){_.fontSize,_.fontFamily,_.fill;const e=[o,s];w&&n.push(Kl({h:r.h,isVertical:i,align:_.align,rangeIdx:a,idx:0,otherValue:y,value:g,label:"".concat(r.format(g,e)),pos:f,state:r})),k&&n.push(Kl({h:r.h,isVertical:i,align:_.align,rangeIdx:a,idx:1,otherValue:g,value:y,label:"".concat(r.format(y,e)),pos:p,state:r}))}}function Jl(e){const t=e.active.limitHigh-e.active.end,n=e.active.limitLow-e.active.start;let i=e.current-e.start;return i=i<0?Math.max(i,n):Math.min(i,t),i}function Zl(e){let t=[];const n=0===e.direction;if(Array.isArray(e.ranges)&&e.ranges.forEach((i,r)=>{e.active&&r===e.active.idx||Gl({borderHit:5,els:t,isVertical:n,state:e,vStart:Math.min(i.min,i.max),vEnd:Math.max(i.min,i.max),idx:r})}),e.active){let i=e.start,r=e.current;if(-1!==e.active.idx)if("foo"===e.active.mode)i=Math.min(e.active.start,e.active.end),r=Math.max(e.active.start,e.active.end);else if("modify"===e.active.mode)i=Math.min(e.start,e.current),r=Math.max(e.start,e.current);else{const t=Jl(e);i=e.active.start+t,r=e.active.end+t}Gl({borderHit:5,els:t,isVertical:n,state:e,vStart:i,vEnd:r,idx:e.active.idx})}return t}function Ql(e){return{min:e.scale.min(),max:e.scale.max()}}function ec(e){return{min:0,max:e.direction?e.rect.width:e.rect.height}}function tc(e,t,n){let i,r,o=e.ranges,s=-1;for(i=0;i<o.length;i++){if(o[i].min<=t&&t<=o[i].max){s=i,n.min=i?o[i-1].max:n.min,n.max=i+1<o.length?o[i+1].min:n.max;break}if(t<o[i].min){n.max=o[i].min,n.min=i?o[i-1].max:n.min;break}}-1===s&&o.length&&i>=o.length&&(n.min=o[o.length-1].max),-1!==s&&(r={idx:s,start:o[s].min,end:o[s].max,limitLow:n.min,limitHigh:n.max,mode:"foo"}),e.active=r}function nc(e){e.renderer.render(Zl(e))}function ic(e,t){if(!t||!t.isActive())return[];const n=e.scale.data(),i=(n&&n.fields||[]).map(e=>e.id()),r=t.brushes().filter(e=>"range"===e.type&&-1!==i.indexOf(e.id))[0];return r?r.brush.ranges():[]}function rc(e,t){let n,i=1/0;const r=t.domain(),o=t.bandwidth()/2;for(let s=0;s<r.length;++s){const a=Math.abs(e-o-t(r[s]));a<i&&(i=a,n=r[s])}return n}function oc(e,t){return Math.min(...e)<=Math.max(...t)&&Math.max(...e)>=Math.min(...t)}function sc(e){return _(e.reduce((e,t)=>(e.push(...k(t.bounds)),e),[]))}const ac={require:["chart","settings","renderer"],defaultSettings:{settings:{bubbles:{show:!0,align:"start"}},style:{bubble:"$label-overlay",line:"$shape-guide--inverted",target:"$selection-area-target"}},renderer:"dom",on:{rangeStart(e){this.start(e)},rangeMove(e){this.move(e)},rangeEnd(e){this.end(e)},rangeClear(e){this.clear(e)},bubbleStart(e){this.bubbleStart(e)}},created(){this.state={key:this.settings.key||"brush-range"}},beforeRender(e){this.state.rect=e.size.computedInner},renderRanges(){this.state.started||(this.state.ranges=ic(this.state,this.state.brushInstance),this.state.active=null,nc(this.state))},render(e){const t=this.settings.settings;this.state.direction="vertical"===t.direction?0:1;const n=this.renderer.element().getBoundingClientRect(),i=this.state.rect[0===this.state.direction?"height":"width"];let r=Lo(this.chart.scale(t.scale),i);const o=function(e){const t={targetRect:null,targetFillRect:null,scale:null,size:null},n=e.settings.settings,i=n.target&&(n.target.components||(n.target.component?[n.target.component]:[])).map(t=>e.chart.component(t)).filter(e=>!!e&&!!e.rect),r=n.target&&n.target.selector?e.chart.findShapes(n.target.selector):[],o=n.target&&n.target.fillSelector?e.chart.findShapes(n.target.fillSelector):[];if(r.length>0){const i=sc(r);if(t.size=i[0===e.state.direction?"height":"width"],t.scale=Lo(e.chart.scale(n.scale),t.size),t.targetRect=i,o.length>0){const e=sc(o);t.targetFillRect=e}}else if(i&&i.length>0){const n=i.slice(1).reduce((e,t)=>({x0:Math.min(e.x0,t.rect.computedInner.x),y0:Math.min(e.y0,t.rect.computedInner.y),x1:Math.max(e.x1,t.rect.computedInner.x+t.rect.computedInner.width),y1:Math.max(e.y1,t.rect.computedInner.y+t.rect.computedInner.height)}),{x0:i[0].rect.computedInner.x,y0:i[0].rect.computedInner.y,x1:i[0].rect.computedInner.x+i[0].rect.computedInner.width,y1:i[0].rect.computedInner.y+i[0].rect.computedInner.height});t.targetRect={x:n.x0-e.state.rect.x,y:n.y0-e.state.rect.y,width:n.x1-n.x0,height:n.y1-n.y0}}return t}(this);if(r=o.scale?o.scale:r,this.state.targetRect=o.targetRect,this.state.targetFillRect=o.targetFillRect,this.state.size=null===o.size?i:o.size,this.state.settings=t,this.state.style=this.style,this.state.offset=n,this.state.brush="object"==typeof t.brush?t.brush.context:t.brush,this.state.brushInstance=this.chart.brush(this.state.brush),this.state.renderer=this.renderer,this.state.multi=!!t.multiple,this.state.h=e,this.state.onEditConfirmed=(e,t,n)=>{this.state.edit=null,function(e,t,n,i){let r=e.ranges.map(e=>({min:e.min,max:e.max}));const o=e.scale.min(),s=e.scale.max();r[t]={min:Math.max(o,Math.min(n,i)),max:Math.min(s,Math.max(n,i))},e.ranges[t]=g({},r[t]);const a=e.scale.data();a&&a.fields&&a.fields.forEach(t=>{e.fauxBrushInstance||e.brushInstance.setRange(t.id(),r)})}(this.state,e,t,n),this.emit("bubbleEnd"),nc(this.state)},this.state.onEditCanceled=()=>{this.state.edit=null,nc(this.state)},this.state.cssCoord={offset:0===this.state.direction?"top":"left",coord:0===this.state.direction?"y":"x",pos:0===this.state.direction?"deltaY":"deltaX"},this.state.format="function"==typeof t.bubbles.label&&((e,n)=>t.bubbles.label.call(void 0,{datum:e,data:n,scale:r,resources:{scale:this.chart.scale,formatter:this.chart.formatter}})),{}.hasOwnProperty.call(r,"norm")){this.state.editable=!0,this.state.observeBrush="object"==typeof t.brush&&t.brush.observe,this.state.fauxBrushInstance=null,this.state.findValues=null,this.state.scale=r;const e=this.state.scale.data();!this.state.format&&e&&e.fields&&e.fields[0]&&(this.state.format=e.fields[0].formatter())}else this.state.editable=!1,this.state.scale=Br(),this.state.scale.data=r.data,this.state.format||(this.state.format=(e,t)=>oc(r.range(),t)?function(e,t){const n=t.ticks(),i=t.domain().indexOf(rc(e,t));return-1!==i?n[i].label:"-"}(e,r):"-"),this.state.fauxBrushInstance=Co(),this.state.findValues=e=>function(e,t){const n=t.domain(),i=t.range(),r=[];return e.forEach(e=>{if(!oc(i,[e.min,e.max]))return;const o=n.indexOf(rc(e.min,t)),s=n.indexOf(rc(e.max,t));r.push.apply(r,n.slice(Math.min(o,s),Math.max(o,s)+1))}),r}(e,r);return this.state.ranges=ic(this.state,this.state.brushInstance),this.state.observeBrush||this.state.sourcedFromThisComponent?[Zl(this.state)]:[]},mounted(){this.state.observeBrush&&this.state.brushInstance&&this.state.brushInstance.on("update",this.renderRanges)},beforeDestroy(){this.state.observeBrush&&this.state.brushInstance&&this.state.brushInstance.removeListener("update",this.renderRanges)},start(e){!function(e){let t=e.state,n=e.e,i=e.renderer,r=e.ranges,o=e.targetSize;if(t.started)return;t.edit=null;const s=n.center.x-n.deltaX,a=n.center.y-n.deltaY;let l=document.elementFromPoint(s,a);i.element().contains(l)||(l=null);const c={started:!0};t.offset=u({},i.element().getBoundingClientRect());const h=s-t.offset.left,d=a-t.offset.top;t.offset.left+=t.targetRect?t.targetRect.x:0,t.offset.top+=t.targetRect?t.targetRect.y:0,t.ranges=r(t,t.fauxBrushInstance||t.brushInstance);const f=n.center[t.cssCoord.coord]-n[t.cssCoord.pos]-t.offset[t.cssCoord.offset],p=n.center[t.cssCoord.coord]-t.offset[t.cssCoord.offset];c.current=t.scale.normInvert(p/t.size),c.start=t.scale.normInvert(f/t.size);let g=t.ranges;const m=Ql(t);let y,x,v=-1;if(l&&l.hasAttribute("data-idx"))v=parseInt(l.getAttribute("data-idx"),10),m.min=v>0?g[v-1].max:m.min,m.max=v+1<g.length?g[v+1].min:m.max;else{for(y=0;y<g.length;y++){if(g[y].min<=c.start&&c.start<=g[y].max){v=y,m.min=y?g[y-1].max:m.min,m.max=y+1<g.length?g[y+1].min:m.max;break}if(c.start<g[y].min){m.max=g[y].min,m.min=y?g[y-1].max:m.min;break}}-1===v&&g.length&&y>=g.length&&(m.min=g[g.length-1].max)}if(-1!==v||t.multi||(c.ranges=[],m.min=t.scale.min(),m.max=t.scale.max()),-1!==v)if(x={idx:v,start:g[v].min,end:g[v].max,limitLow:m.min,limitHigh:m.max,mode:"move"},l&&l.hasAttribute("data-other-value"))c.start=parseFloat(l.getAttribute("data-other-value")),x.mode="modify";else{let e=t.scale.norm(x.start)*t.size,n=t.scale.norm(x.end)*t.size;Math.abs(f-e)<=o?(c.start=x.end,x.mode="modify"):Math.abs(f-n)<=o&&(c.start=x.start,x.mode="modify")}else x={idx:-1,start:c.start,end:c.current,limitLow:m.min,limitHigh:m.max,mode:"current"};c.active=x,"modify"!==x.mode&&t.targetRect&&!Is(t.targetRect,{x:h,y:d})||Object.keys(c).forEach(e=>t[e]=c[e])}({e:e,state:this.state,renderer:this.renderer,ranges:ic,targetSize:5})},end(){this.state.started&&(!function(e,t){e.started=!1,e.ranges=t(e,e.fauxBrushInstance||e.brushInstance);const n=Ql(e);tc(e,e.current,n)}(this.state,ic),nc(this.state),this.state.sourcedFromThisComponent=!0,this.state.active=null)},move(e){this.state.started&&(!function(e,t){const n=(t.center[e.cssCoord.coord]-e.offset[e.cssCoord.offset])/e.size,i=e.scale.normInvert(n);e.current=Math.max(Math.min(i,e.active.limitHigh),e.active.limitLow)}(this.state,e),function(e){let t=e.ranges.map(e=>({min:e.min,max:e.max}));if(-1!==e.active.idx)if("modify"===e.active.mode)t[e.active.idx].min=Math.min(e.start,e.current),t[e.active.idx].max=Math.max(e.start,e.current);else{const n=Jl(e);t[e.active.idx].min+=n,t[e.active.idx].max+=n}else t.push({min:Math.min(e.start,e.current),max:Math.max(e.start,e.current)});const n=e.scale.data();n&&n.fields&&n.fields.forEach(n=>{if(e.fauxBrushInstance){let i=ic(e,e.fauxBrushInstance),r=e.findValues(i),o=e.findValues(t),s=o.filter(e=>-1===r.indexOf(e)),a=r.filter(e=>-1===o.indexOf(e)),l=s.map(e=>({key:n.id(),value:e})),c=a.map(e=>({key:n.id(),value:e}));e.brushInstance.addAndRemoveValues(l,c),e.fauxBrushInstance.setRange(n.id(),t)}else e.brushInstance.setRange(n.id(),t)})}(this.state),nc(this.state))},clear(){this.state.fauxBrushInstance&&this.state.fauxBrushInstance.clear(),this.state.renderer.render([]),this.state.started=!1,this.state.active=null,this.state.sourcedFromThisComponent=!1},bubbleStart(e){if(!this.state.editable)return;const t=e.srcEvent||e,n=t.target,i={rangeIdx:parseInt(n.getAttribute("data-idx"),10),bubbleIdx:parseInt(n.getAttribute("data-bidx"),10)};if(isNaN(i.rangeIdx)||JSON.stringify(i)===JSON.stringify(this.state.edit))return;this.state.edit=i,t.stopPropagation(),t.stopImmediatePropagation(),t.preventDefault();const r=n.parentNode;nc(this.state);const o=r.querySelector("input");o.focus(),o.select()}};function lc(e){e.renderer.render(Zl(e))}function cc(e){return e.rc.ranges()}function uc(e,t){const n={x:e.direction?t.min+e.rect.x:e.rect.x,y:e.direction?e.rect.y:t.min+e.rect.y,width:e.direction?t.max-t.min:e.rect.width+e.rect.x,height:e.direction?e.rect.height+e.rect.y:t.max-t.min};return e.chart.shapesAt(n,e.settings.brush)}const hc={require:["chart","settings","renderer"],defaultSettings:{settings:{bubbles:{show:!0,align:"start"}},style:{bubble:"$label-overlay",line:"$shape-guide--inverted",target:"$selection-area-target"}},renderer:"dom",on:{areaStart(e){this.start(e)},areaMove(e){this.move(e)},areaEnd(e){this.end(e)},areaClear(e){this.clear(e)}},created(){this.state={key:this.settings.key||"brush-area-dir"}},render(e){this.state.rect=this.rect;const t=this.settings.settings,n="vertical"===t.direction?0:1,i=this.state.rect[0===n?"height":"width"],r=this.renderer.element().getBoundingClientRect(),o=(t.target?t.target.components||[t.target.component]:[]).map(e=>this.chart.component(e)).filter(e=>!!e&&!!e.rect),s=o[0]?o.slice(1).reduce((e,t)=>({x0:Math.min(e.x0,t.rect.x),y0:Math.min(e.y0,t.rect.y),x1:Math.max(e.x1,t.rect.x+t.rect.width),y1:Math.max(e.y1,t.rect.y+t.rect.height)}),{x0:o[0].rect.x,y0:o[0].rect.y,x1:o[0].rect.x+o[0].rect.width,y1:o[0].rect.y+o[0].rect.height}):null;return this.state.targetRect=s?{x:s.x0-this.rect.x,y:s.y0-this.rect.y,width:s.x1-s.x0,height:s.y1-s.y0}:null,this.state.style=this.style,this.state.chart=this.chart,this.state.direction=n,this.state.settings=t,this.state.offset=r,this.state.rc=go(),this.state.renderer=this.renderer,this.state.multi=!!t.multiple,this.state.h=e,this.state.size=i,this.state.cssCoord={offset:0===this.state.direction?"top":"left",coord:0===this.state.direction?"y":"x",pos:0===this.state.direction?"deltaY":"deltaX",area:0===this.state.direction?"height":"width"},this.state.format=function(e,t){return function(e,t,n){const i=Math.min(...n),r=Math.max(...n),o={x:e.direction?i+e.rect.x:e.rect.x,y:e.direction?e.rect.y:i+e.rect.y,width:e.direction?r-i:e.rect.width+e.rect.x,height:e.direction?e.rect.height+e.rect.y:r-i},s=e.chart.shapesAt(o,e.settings.brush);if(0===s.length)return"-";const a=s.reduce((n,r)=>{const o=n.bounds,s=r.bounds;return t===i?o[e.cssCoord.coord]<=s[e.cssCoord.coord]?n:r:o[e.cssCoord.coord]+o[e.cssCoord.area]>=s[e.cssCoord.coord]+s[e.cssCoord.area]?n:r}),l=e.settings.brush.components.reduce((e,t)=>e.key===a.key?e:t);return"function"==typeof e.settings.bubbles.label?e.settings.bubbles.label(a.data):Array.isArray(l.data)&&l.data.length?a.data[l.data[0]].label:a.data&&a.data.label?a.data.label:"-"}(this,e,t)},[]},start(e){!function(e){let t=e.state,n=e.e,i=e.renderer,r=e.ranges,o=e.targetSize;if(t.started)return;const s=n.center.x-n.deltaX,a=n.center.y-n.deltaY;let l=document.elementFromPoint(s,a);i.element().contains(l)||(l=null);const c={started:!0};t.offset=i.element().getBoundingClientRect(),t.ranges=r(t);const u=s-t.offset.left,h=a-t.offset.top,d=n.center[t.cssCoord.coord]-n[t.cssCoord.pos]-t.offset[t.cssCoord.offset],f=n.center[t.cssCoord.coord]-t.offset[t.cssCoord.offset];let p=f,g=d;c.start=d,c.current=f;let m=t.ranges;const y=ec(t);let x,v,b=-1;if(l&&l.hasAttribute("data-idx"))b=parseInt(l.getAttribute("data-idx"),10),y.min=b>0?m[b-1].max:y.min,y.max=b+1<m.length?m[b+1].min:y.max;else{for(x=0;x<m.length;x++){if(m[x].min<=g&&g<=m[x].max){b=x,y.min=x?m[x-1].max:y.min,y.max=x+1<m.length?m[x+1].min:y.max;break}if(g<m[x].min){y.max=m[x].min,y.min=x?m[x-1].max:y.min;break}}-1===b&&m.length&&x>=m.length&&(y.min=m[m.length-1].max)}if(-1!==b||t.multi||(c.ranges=[],y.min=0,y.max=t.direction?t.rect.width:t.rect.height),-1!==b)if(v={idx:b,start:m[b].min,end:m[b].max,limitLow:y.min,limitHigh:y.max,mode:"move"},l&&l.hasAttribute("data-other-value"))c.start=parseFloat(l.getAttribute("data-other-value")),v.mode="modify";else{let e=v.start,t=v.end;Math.abs(d-e)<=o?(c.start=v.end,v.mode="modify"):Math.abs(d-t)<=o&&(c.start=v.start,v.mode="modify")}else v={idx:-1,start:g,end:p,limitLow:y.min,limitHigh:y.max,mode:"current"};c.active=v,"modify"!==v.mode&&t.targetRect&&!Is(t.targetRect,{x:u,y:h})||Object.keys(c).forEach(e=>t[e]=c[e])}({e:e,state:this.state,renderer:this.renderer,ranges:cc,targetSize:5})},end(){this.state.started&&(!function(e,t){e.started=!1,e.ranges=t(e);const n=ec(e);tc(e,e.current,n)}(this.state,cc),lc(this.state))},move(e){this.state.started&&(!function(e,t){const n=t.center[e.cssCoord.coord]-e.offset[e.cssCoord.offset];e.current=Math.max(Math.min(n,e.active.limitHigh),e.active.limitLow)}(this.state,e),function(e){const t=e.ranges.map(e=>({min:e.min,max:e.max}));if(-1!==e.active.idx)if("modify"===e.active.mode)t[e.active.idx].min=Math.min(e.start,e.current),t[e.active.idx].max=Math.max(e.start,e.current);else{const n=Jl(e);t[e.active.idx].min=e.active.start+n,t[e.active.idx].max=e.active.end+n}else t.push({min:Math.min(e.start,e.current),max:Math.max(e.start,e.current)});e.rc.set(t);let n=[];t.forEach(t=>{n=[...n,...uc(e,t)]}),function(e,t){e.chart.brushFromShapes(t,e.settings.brush)}(e,n)}(this.state),lc(this.state))},clear(){this.state.rc&&this.state.rc.clear(),this.state.renderer.render([])}};function dc(e){const t="vertical"===e.direction,n=e.rect[t?"height":"width"],i=e.rect[t?"width":"height"];return function(e){const t=e.brush;if(!t||!t.isActive())return[];const n=e.scale.data(),i=(n&&n.fields||[]).map(e=>e.id()),r=t.brushes().filter(e=>"range"===e.type&&-1!==i.indexOf(e.id))[0];return r?r.brush.ranges():[]}(e).map(r=>{const o=e.scale(r.min)*n,s=e.scale(r.max)*n,a=Math.min(o,s),l=Math.abs(o-s);return{type:"rect",fill:e.fill,opacity:e.opacity,x:t?0:a,width:t?i:l,y:t?a:0,height:t?l:i}})}function fc(e,t,n,i){function r(){!function(e){e.renderer.render(dc(e))}(e)}function o(){!function(e){e.renderer.render(dc(e))}(e)}function s(){!function(e){e.renderer.render(dc(e))}(e)}e.brush=t,t&&(t.on("start",r),t.on("update",o),t.on("end",s),e.start=r,e.update=o,e.end=s,e.brush=t,e.scale=n,e.renderer=i)}function pc(e){e.brush&&(e.brush.removeListener("start",e.start),e.brush.removeListener("update",e.update),e.brush.removeListener("end",e.end)),e.start=void 0,e.update=void 0,e.end=void 0,e.brush=void 0,e.scale=void 0,e.renderer=void 0}const gc={require:["chart","settings","renderer"],defaultSettings:{settings:{}},preferredSize:()=>50,created(){this.state={}},render(){const e=this.settings.settings,t=this.chart.brush(e.brush),n=e.direction||"horizontal",i="horizontal"===n?this.rect.width:this.rect.height,r=Lo(this.chart.scale(e.scale),i);return pc(this.state),fc(this.state,t,r,this.renderer),this.state.rect=this.rect,this.state.fill=e.fill||"#ccc",this.state.opacity=void 0!==e.opacity?e.opacity:1,this.state.direction=n,dc(this.state)},beforeDestroy(){pc(this.state)}};function mc(e,t){const n=t.center.x,i=t.center.y;return{x:n-e.left,y:i-e.top}}function yc(e,t,n){return rs(e,t.points[0])<n.settings.snapIndicator.threshold**2}function xc(e,t){null==e.path.d?e.path.d="M".concat(t.x," ").concat(t.y," "):e.path.d+="L".concat(t.x," ").concat(t.y," "),e.points.push(t)}function vc(e){let t=e.state,n=e.start,i=void 0===n?null:n,r=e.end,o=void 0===r?null:r;null!==i&&(t.snapIndicator.x1=i.x,t.snapIndicator.y1=i.y),null!==o&&(t.snapIndicator.x2=o.x,t.snapIndicator.y2=o.y)}function bc(e,t){e.snapIndicator.visible=t}const wc={require:["chart","renderer","settings"],defaultSettings:{layout:{displayOrder:0},settings:{brush:{components:[]},snapIndicator:{threshold:75,strokeDasharray:"5, 5",stroke:"black",strokeWidth:2,opacity:.5},lasso:{fill:"transparent",stroke:"black",strokeWidth:2,opacity:.7,strokeDasharray:"20, 10"},startPoint:{r:10,fill:"green",stroke:"black",strokeWidth:1,opacity:1}}},on:{lassoStart(e){this.start(e)},lassoEnd(e){this.end(e)},lassoMove(e){this.move(e)},lassoCancel(){this.cancel()}},created(){this.state={points:[],active:!1,path:null,snapIndicator:null,startPoint:null,rendererBounds:null,componentDelta:null,brushConfig:null,lineBrushShape:{x1:0,y1:0,x2:0,y2:0}}},start(e){var t;this.state.active=!0,this.state.path={visible:!0,type:"path",d:null,fill:(t=this.settings.settings.lasso).fill,stroke:t.stroke,strokeWidth:t.strokeWidth,opacity:t.opacity,strokeDasharray:t.strokeDasharray,collider:{type:null}},this.state.snapIndicator=function(e){return{visible:!1,type:"line",x1:0,y1:0,x2:0,y2:0,strokeDasharray:e.strokeDasharray,stroke:e.stroke,strokeWidth:e.strokeWidth,opacity:e.opacity,collider:{type:null}}}(this.settings.settings.snapIndicator),this.state.startPoint=function(e){return{visible:!0,type:"circle",cx:0,cy:0,r:e.r,fill:e.fill,opacity:e.opacity,stroke:e.stroke,strokeWidth:e.strokeWidth,collider:{type:null}}}(this.settings.settings.startPoint),this.state.rendererBounds=this.renderer.element().getBoundingClientRect(),this.state.componentDelta=function(e,t){const n=e.element.getBoundingClientRect();return{x:t.left-n.left,y:t.top-n.top}}(this.chart,this.state.rendererBounds),this.state.brushConfig=this.settings.settings.brush.components.map(e=>({key:e.key,contexts:e.contexts||["lassoBrush"],data:e.data||[""],action:e.action||"add"}));const n=mc(this.state.rendererBounds,e);xc(this.state,n),vc({state:this.state,start:n}),function(e,t){e.startPoint.cx=t.x,e.startPoint.cy=t.y}(this.state,n)},move(e){if(!this.state.active)return;const t=mc(this.state.rendererBounds,e);yc(t,this.state,this.settings)?bc(this.state,!0):bc(this.state,!1),xc(this.state,t),vc({state:this.state,end:t}),function(e,t){const n=[e.startPoint,e.path,e.snapIndicator].filter(e=>e.visible);t.render(n)}(this.state,this.renderer),function(e,t){if(e.active){const n=e.points[e.points.length-2],i=e.points[e.points.length-1];e.lineBrushShape.x1=n.x+e.componentDelta.x,e.lineBrushShape.y1=n.y+e.componentDelta.y,e.lineBrushShape.x2=i.x+e.componentDelta.x,e.lineBrushShape.y2=i.y+e.componentDelta.y;const r=t.shapesAt(e.lineBrushShape,{components:e.brushConfig});t.brushFromShapes(r,{components:e.brushConfig})}}(this.state,this.chart)},end(e){if(!this.state.active)return;bc(this.state,!1);yc(mc(this.state.rendererBounds,e),this.state,this.settings)&&function(e,t){if(e.active){const n=e.componentDelta.x,i=e.componentDelta.y,r=e.points.map(e=>({x:e.x+n,y:e.y+i})),o=t.shapesAt({vertices:r},{components:e.brushConfig});t.brushFromShapes(o,{components:e.brushConfig})}}(this.state,this.chart),this.state={points:[],active:!1,path:null,snapIndicator:null,startPoint:null,rendererBounds:null,componentDelta:null,brushConfig:null,lineBrushShape:{x1:0,y1:0,x2:0,y2:0}},this.renderer.render([])},cancel(){var e,t;this.state.active&&(e=this.state,t=this.chart,e.brushConfig.forEach(e=>{e.contexts.forEach(e=>{t.brush(e).end()})}),this.state={points:[],active:!1,path:null,snapIndicator:null,startPoint:null,rendererBounds:null,componentDelta:null,brushConfig:null,lineBrushShape:{x1:0,y1:0,x2:0,y2:0}},this.renderer.render([]))},render(){}};function kc(e,t,n,i,r){let o,s=0,a=t.length-1;for(;s<a;){let l=Math.floor((s+a)/2);o=r(t[l]),o[n]+o[i]<e[n]?s=l+1:a=l}return s}function _c(e){let t=e.orientation,n=e.targetNodes,i=e.labels,r=e.container,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:kc;const s=[],a="v"===t?"x":"y",l="v"===t?"width":"height",c=e=>e.textBounds,u=e=>e.node.localBounds;return(e,t)=>{const h=i[t],d=h.textBounds,f=h.node;if(d[a]<r[a]||d[a]+d[l]>r[a]+r[l])return!1;for(let e=o(d,s,a,l,c);e<s.length;e++)if(Os(d,s[e].textBounds))return!1;const p=o(d,n,a,l,u),g=d[a]+d[l];for(let e=p;e<n.length;e++){const t=n[e].node;if(g<t.localBounds[a])break;if(Os(d,t.localBounds)&&f!==t)return!1}return s.push(i[t]),!0}}function Mc(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function Sc(e){const t=typeof e;return("string"===t||"number"===t)&&""!==e}function Rc(e){return g(g({type:"rect",rx:2,ry:2,fill:e.backgroundColor},e.backgroundBounds),{},{data:"".concat(e.data," ").concat(e.text),rotation:e.transform&&e.transform.match(/rotate/gi)?"rotated":"horizontal"})}function Cc(e,t,n){return n?e.width>=t.height:e.width>=t.width}function Nc(e,t,n){return n?e.height>=t.width:e.height>=t.height}function Dc(e,t,n,i,r){let o,s;return"v"===e?(o=i||r||Cc(t,n,!0),s=Nc(t,n,!i)):(o=Cc(t,n),s=r||Nc(t,n,!1)),o&&s}function qc(e,t,n,i){return e+.5*t+(i-.5)*(t-n)-.5*n}function Ec(e,t,n){const i={type:"text",text:t,maxWidth:n.rotate?e.height:e.width,x:0,y:e.y,dx:0,dy:0,fill:n.fill,anchor:n.rotate?"end":"start",baseline:"central",fontSize:"".concat(n.fontSize,"px"),fontFamily:n.fontFamily},r=n.textMetrics;if(!n.overflow&&!function(e,t,n){return Cc(e,t,n.rotate)&&Nc(e,t,n.rotate)}(e,r,n))return!1;const o=.5*r.height;return n.rotate?(i.x=qc(e.x,e.width,r.height,n.align)+o,i.y=qc(e.y,e.height,r.width,n.justify),"right"===n.dock?i.transform="rotate(90, ".concat(i.x+i.dx,", ").concat(i.y+i.dy,") translate(").concat(r.width,", 0)"):i.transform="rotate(-90, ".concat(i.x+i.dx,", ").concat(i.y+i.dy,")")):(i.x=qc(e.x,e.width,r.width,n.align),i.y=qc(e.y,e.height,r.height,n.justify)+o),i}function zc(e){let t=e.bar,n=e.view,i=e.direction,r=e.position,o=e.padding,s=void 0===o?4:o,a=e.measured;const l={};if(u(l,t),r&&"inside"!==r)if("up"===i||"down"===i){const e=Math.max(0,Math.min(t.y,n.height)),o=Math.max(0,Math.min(t.y+t.height,n.height));"outside"===r&&"up"===i||"opposite"===r&&"down"===i?(l.y=0,l.height=e):("outside"===r&&"down"===i||"opposite"===r&&"up"===i)&&(l.y=o,l.height=n.height-o)}else{const e=Math.max(0,Math.min(t.x,n.width)),o=Math.max(0,Math.min(t.x+t.width,n.width));"outside"===r&&"left"===i||"opposite"===r&&"right"===i?(l.x=0,l.width=e):("outside"===r&&"right"===i||"opposite"===r&&"left"===i)&&(l.x=o,l.width=n.width-o)}else;return function(e,t){const n=Math.max(0,Math.min(e.y,t.height)),i=Math.max(0,Math.min(e.y+e.height,t.height)),r=Math.max(0,Math.min(e.x,t.width)),o=Math.max(0,Math.min(e.x+e.width,t.width));e.x=r,e.width=o-r,e.y=n,e.height=i-n}(l,n),function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=n.top,r=void 0===i?4:i,o=n.bottom,s=void 0===o?4:o,a=n.left,l=void 0===a?4:a,c=n.right,u=void 0===c?4:c,h="function"==typeof l?l(t):l,d="function"==typeof u?u(t):u,f="function"==typeof r?r(t):r,p="function"==typeof s?s(t):s;e.x+=h,e.width-=h+d,e.y+=f,e.height-=f+p}(l,a,s),l}function Ac(e){let t,n,i,r,o,s=e.direction,a=e.fitsHorizontally,l=e.measured,c=e.node,u=e.orientation,h=e.placementSettings,d=e.rect,f=arguments.length>1&&void 0!==arguments[1]?arguments[1]:zc;const p=[],g="h"===u?"width":"height";for(o=0;o<h.length;o++)if(i=h[o],r=f({bar:c.localBounds,view:d,direction:s,position:i.position,padding:i.padding,measured:l}),p.push(r),t=!o||r[g]>t[g]?r:t,Dc(u,r,l,a,i.overflow)){n=r;break}return n||(n=t,o=p.indexOf(n)),i=h[o],{bounds:n,placement:i}}function Oc(e,t,n,i){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};const o=r.top,s=void 0===o?4:o,a=r.bottom,l=void 0===a?4:a,c=r.left,u=void 0===c?4:c,h=r.right,d=void 0===h?4:h,f="function"==typeof u?u(t):u,p="function"==typeof d?d(t):d,g="function"==typeof s?s(t):s,m="function"==typeof l?l(t):l,y=e.x+e.dx,x=e.y+e.dy,v=n?Math.min(t.width,i.height):Math.min(t.height,i.width),b=n?Math.min(t.height,i.height):Math.min(t.width,i.width),w=.5*t.height,k=1e-9;return{x:(n?y-w:y)-f-k,y:(n?x:x-w)-g-k,width:b+(f+p)-k,height:v+(g+m)-k}}function Tc(e){let t=e.chart,n=e.targetNodes,i=e.rect,r=e.fitsHorizontally,o=e.collectiveOrientation,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ac,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Ec,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:_c;const c=[],u={container:i,targetNodes:n,labels:[],orientation:o};let h,d,f,p,m,y,x,v,b,w,k,_,M,S;for(let e=0,l=n.length;e<l;e++){y=null,d=n[e],f=d.node,M=Mc(f,t),b=d.direction,S="left"===b||"right"===b?"h":"v";for(let t=0;t<d.texts.length;t++){if(p=d.texts[t],!Sc(p))continue;w=d.labelSettings[t],v=d.measurements[t],_=w.placements;const n=s({direction:b,fitsHorizontally:r,lblStngs:w,measured:v,node:f,orientation:S,placements:_,placementSettings:d.placementSettings[t],rect:i});if(y=n.bounds,k=n.placement,y&&k){var R;m=k.justify;const t="function"==typeof w.linkData?w.linkData(M,e):void 0,n="function"==typeof k.overflow?k.overflow(M,e):k.overflow;"up"===b&&(m=1-m),"opposite"===k.position&&(m=1-m),"left"===b&&(m=1-m);const i=!("h"===o||r);if(h=a(y,p,{justify:"h"===S?k.align:m,align:"h"===S?m:k.align,fontSize:w.fontSize,fontFamily:w.fontFamily,textMetrics:v,rotate:i,overflow:!!n,dock:null!==(R=w.dock)&&void 0!==R?R:"left"}),h){const n=Oc(h,v,i,y,k.padding);x="function"==typeof k.fill?k.fill(g(g({},M),{},{textBounds:n}),e):k.fill,h.fill=x,void 0!==t&&(h.data=t),"object"==typeof k.background&&(h.backgroundColor="function"==typeof k.background.fill?k.background.fill(g(g({},M),{},{textBounds:n}),e):k.background.fill,void 0!==h.backgroundColor&&(h.backgroundBounds=Oc(h,v,i,y,k.background.padding))),c.push(h),u.labels.push({node:f,textBounds:n})}}}}const C=c.filter(l(u));return[...C.filter(e=>void 0!==e.backgroundBounds).map(Rc),...C]}function Ic(e){const t=2*Math.PI;return(e%t+t)%t}function jc(e,t){e.x+=t,e.width-=2*t,e.y+=t,e.height-=2*t}function Pc(e){return{x:e.x,y:e.y-e.height/2,width:e.width,height:e.height}}function Fc(e,t,n){let i=t.x,r=t.y;if(i*i+r*r>e*e)return null;let o=Math.sin(n),s=Math.cos(n),a=i*s-r*o,l=e*e-a*a;if(l<0)return null;let c=Math.sqrt(l);return{x:a*s+o*c,y:-a*o+s*c}}function Lc(e){let t,n,i=e.radius,r=e.size,o=e.angle,s=r.width,a=r.height,l={x:s/2,y:a/2};switch(Math.floor(o/(Math.PI/2))){case 0:if(t=Fc(i,l,o),!t)return null;t.y*=-1,n={x:-s,y:0};break;case 1:if(t=Fc(i,l,Math.PI-o),!t)return null;n={x:-s,y:-a};break;case 2:if(t=Fc(i,l,o-Math.PI),!t)return null;t.x*=-1,n={x:0,y:-a};break;case 3:if(t=Fc(i,l,2*Math.PI-o),!t)return null;t.x*=-1,t.y*=-1,n={x:0,y:0};break;default:throw new Error("invalid angle")}return{x:t.x+n.x,y:t.y+n.y,width:s,height:a}}function $c(e){let t=e.slice,n=e.measured,i=e.padding,r=t.start,o=t.end,s=t.innerRadius,a=t.outerRadius,l=a-s-2*i,c=o-r;if(c<Math.PI){let e=(n.height/2+i)/Math.tan(c/2);e>s&&(l=a-e-2*i)}if(l<0||l<n.minReqWidth)return null;const u=Ic((r+o)/2);let h=a-i,d={x:Math.sin(u)*h,y:-Math.cos(u)*h,width:l,height:n.height};return u<Math.PI?(d.angle=u-Math.PI/2,d.anchor="end"):(d.angle=u+Math.PI/2,d.anchor="start"),d}function Bc(e){let t=e.context,n=e.node,i=e.bounds;let r=n.desc.slice;const o=Ic((r.start+r.end)/2);switch(Math.floor(o/(Math.PI/2))){case 0:t.q1maxY=i.y-2,void 0===t.q2minY&&(t.q2minY=i.y+i.height+2);break;case 1:t.q2minY=i.y+i.height+2;break;case 2:t.q3minY=i.y+i.height+2;break;case 3:t.q4maxY=i.y-2,void 0===t.q3minY&&(t.q3minY=i.y+i.height+2)}}function Hc(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function Wc(e,t,n){const i={type:"text",text:t,maxWidth:e.width,x:e.x,y:e.y+("top"===e.baseline?e.height/2:0),fill:n.fill,anchor:e.anchor||"start",baseline:"middle",fontSize:"".concat(n.fontSize,"px"),fontFamily:n.fontFamily};if(!isNaN(e.angle)){let t=e.angle*(360/(2*Math.PI));i.transform="rotate(".concat(t,", ").concat(i.x,", ").concat(i.y,")")}return i}function Vc(e){let t,n,i=e.slice,r=e.direction,o=e.position,s=e.padding,a=e.measured,l=e.view,c=e.context,u=e.store,h=i.start,d=i.end,f=i.innerRadius,p=i.offset;switch(o){case"into":t="rotate"===r?$c({slice:i,measured:a,padding:s}):function(e){let t=e.slice,n=e.padding,i=e.measured,r=t.start,o=t.end,s=t.innerRadius,a=t.outerRadius;const l=Ic((r+o)/2);let c=Lc({radius:a,size:{width:i.width+2*n+1,height:i.height+2*n},angle:l});return c?(c.baseline="top",js(c,{x1:0,y1:0,x2:Math.sin(r)*a,y2:-Math.cos(r)*a})||js(c,{x1:0,y1:0,x2:Math.sin(o)*a,y2:-Math.cos(o)*a})||Ns({cx:0,cy:0,r:s},c)?null:(jc(c,n),c)):null}({slice:i,measured:a,padding:s});break;case"inside":n={start:h,end:d,innerRadius:0,outerRadius:f},t="rotate"===r?$c({slice:n,measured:a,padding:s}):function(e){let t=e.slice,n=e.padding,i=e.measured,r=e.store;const o=t.start,s=t.end,a=t.outerRadius,l=Ic((o+s)/2);let c=Lc({radius:a,size:{width:i.width+2*n+1,height:i.height+2*n},angle:l});return c?(c.baseline="top",jc(c,n),r.insideLabelBounds.some(e=>Os(e,c))?null:(r.insideLabelBounds.push({x:c.x-4,y:c.y,width:c.width+8,height:c.height}),c)):null}({slice:n,measured:a,padding:s,store:u});break;case"outside":t="rotate"===r?function(e){let t=e.slice,n=e.measured,i=e.padding,r=e.view,o=t.start,s=t.end,a=t.outerRadius,l=t.offset,c=a+i,u=s-o;if(u<Math.PI&&(n.height/2+i)/Math.tan(u/2)>c)return null;const h=Ic((o+s)/2);let d=Math.sin(h)*c,f=-Math.cos(h)*c,p=n.width+1,g=h%Math.PI;if(g>Math.PI/2&&(g=Math.PI-g),Math.cos(g)>.001){let e=f<0?r.y:r.y+r.height,t=Math.abs(e-l.y)/Math.cos(g)-Math.tan(g)*(n.height/2)-2*i-a;t<p&&(p=t)}if(Math.sin(g)>.001){let e=d<0?r.x:r.x+r.width,t=Math.abs(e-l.x)/Math.sin(g)-n.height/2/Math.tan(g)-2*i-a;t<p&&(p=t)}if(p<=0||p<n.minReqWidth)return null;let m={x:d,y:f,width:p,height:n.height};return h<Math.PI?(m.angle=h-Math.PI/2,m.anchor="start"):(m.angle=h+Math.PI/2,m.anchor="end"),m}({slice:i,measured:a,padding:s,view:l}):function(e){let t=e.slice,n=e.measured,i=e.padding,r=e.view,o=e.context,s=t.start,a=t.end,l=t.outerRadius,c=t.offset;const u=Ic((s+a)/2);if(function(e,t,n){switch(t){case 0:return e.q1maxY<0;case 1:return e.q2minY>n.height;case 2:return e.q3minY>n.height;case 3:return e.q4maxY<0;default:return!0}}(o,Math.floor(u/(Math.PI/2)),r))return null;let h=l+i+n.height/2,d=Math.sin(u)*h,f=-Math.cos(u)*h,p=n.width+1;if(u<Math.PI){let e=Math.abs(r.x+r.width-(d+c.x));e<p&&(p=e)}else{let e=Math.abs(r.x-(d+c.x));e<p&&(p=e)}if(p<n.minReqWidth)return null;let g={x:d,y:f,width:p,height:n.height};return u<Math.PI?g.anchor="start":g.anchor="end",g}({slice:i,measured:a,padding:s,view:l,context:c});break;default:throw new Error("not implemented")}return t&&(t.x+=p.x,t.y+=p.y,"outside"===o&&"rotate"!==r&&function(e,t,n){const i=n.start,r=n.end,o=n.offset,s=n.outerRadius,a=Ic((i+r)/2);switch(Math.floor(a/(Math.PI/2))){case 0:if(void 0!==t.q1maxY){let n=Math.min(e.y,t.q1maxY-e.height),i=e.y-n;if(e.y=n,i>1){let t=s+2;e.line={type:"line",x1:e.x-2,y1:e.y+2,x2:o.x+Math.sin(a)*t,y2:o.y-Math.cos(a)*t,strokeWidth:1}}}break;case 1:if(void 0!==t.q2minY){let n=Math.max(e.y,t.q2minY),i=n-e.y;if(e.y=n,i>1){let t=s+2;e.line={type:"line",x1:e.x-2,y1:e.y-2,x2:o.x+Math.sin(a)*t,y2:o.y-Math.cos(a)*t,strokeWidth:1}}}break;case 2:if(void 0!==t.q3minY){let n=Math.max(e.y,t.q3minY),i=n-e.y;if(e.y=n,i>1){let t=s+2;e.line={type:"line",x1:e.x+2,y1:e.y-2,x2:o.x+Math.sin(a)*t,y2:o.y-Math.cos(a)*t,strokeWidth:1}}}break;case 3:if(void 0!==t.q4maxY){let n=Math.min(e.y,t.q4maxY-e.height),i=e.y-n;if(e.y=n,i>1){let t=s+2;e.line={type:"line",x1:e.x+2,y1:e.y+2,x2:o.x+Math.sin(a)*t,y2:o.y-Math.cos(a)*t,strokeWidth:1}}}}}(t,c,i)),t}function Uc(e){let t=e.context,n=e.direction,i=e.measured,r=e.node,o=e.placementSettings,s=e.rect,a=e.store,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Vc;for(let e=0;e<o.length;e++){let c=o[e],u=l({context:t,slice:r.desc.slice,view:s,direction:n,position:c.position,measured:i,padding:c.padding,store:a});if(u)return{bounds:u,placement:c}}return{bounds:null,placement:null}}function Yc(e,t,n){const i=t.fontFamily,r="".concat(t.fontSize,"px"),o=n.measureText({text:e,fontFamily:i,fontSize:r});return o.minReqWidth=Math.min(o.width,n.measureText({text:"".concat(e[0],"…"),fontFamily:i,fontSize:r}).width),o}const Kc=/\n+|\r+|\r\n/,Xc=/\s/,Gc=/[a-zA-Z\u00C0-\u00F6\u00F8-\u00FF\u00AD]/;function Jc(e){return"string"==typeof e?-1!==e.search(Kc):-1!==String(e).search(Kc)}function Zc(e){return-1!==e.search(Xc)}function Qc(e){return-1!==e.search(Gc)}function eu(e,t,n){return Math.max(t,Math.min(n,e))}function tu(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.string,n=e.separator,i=void 0===n?"":n,r=e.reverse,o=void 0!==r&&r,s=e.measureText,a=void 0===s?e=>({width:e.length,height:1}):s,l=e.mandatoryBreakIdentifiers,c=void 0===l?[Jc]:l,u=e.noBreakAllowedIdentifiers,h=void 0===u?[]:u,d=e.suppressIdentifier,f=void 0===d?[Zc,Jc,e=>""===e]:d,p=e.hyphenationIdentifiers,g=void 0===p?[Qc]:p;const m=String(t).split(i);!function(e){""===e[0]&&e.shift(),""===e[e.length-1]&&e.pop()}(m);const y=m.length,x=o?e=>e>=0:e=>e<y;let v=o?y:-1;function b(e){const t=eu(e,0,y-1),n=m[t],i=a(n),r=function(e,t,n,i,r){return i.some(i=>i(e,t,n))?1:r.some(i=>i(e,t,n))?0:2}(n,t,m,c,h);return{index:t,value:n,breakOpportunity:r,suppress:f.some(e=>e(n,t,m)),hyphenation:g.some(e=>e(n,t,m)),width:i.width,height:i.height,done:!1}}return{next:function(e){return isNaN(e)?o?v--:v++:v=eu(e,0,y-1),x(v)?b(v):{done:!0}},peek:b,length:y}}const nu="…",iu=/^\s*\d+(\.\d+)?px\s*$/i;function ru(e){return"string"===typeof e&&iu.test(e)}function ou(e){const t=e["font-size"]||e.fontSize;return ru(t)?parseFloat(t)*Math.max(isNaN(e.lineHeight)?1.2:e.lineHeight,0):19.2}function su(e){const t=e.maxHeight,n=Math.max(e.maxLines,1)||1/0;if(isNaN(t))return n;const i=ou(e);return Math.max(1,Math.min(Math.floor(t/i),n))}function au(e,t){return{lines:[],line:"",width:0,maxLines:su(e),maxWidth:e.maxWidth,hyphens:{enabled:"auto"===e.hyphens,char:"‐",metrics:t("‐")}}}function lu(e){e.lines.push(e.line),e.line="",e.width=0}function cu(e,t){e.line+=t.value,e.width+=t.width}function uu(e,t,n){if(t.width>e.maxWidth)return t;const i=t.index;for(let r=1;r<5;r++){const o=n.peek(t.index-1);if(!t.hyphenation||!o.hyphenation||0===t.index)return t;if(e.width+e.hyphens.metrics.width<=e.maxWidth)return e.line+=e.hyphens.char,t;if(1===e.line.length)return t;t=n.next(i-r),e.line=e.line.slice(0,-1),e.width-=t.width}return t}function hu(e,t,n){const i=tu({string:t.value,measureText:n});for(;e.lines.length<e.maxLines;){let t=i.next();if(t.done)break;e.width+t.width>e.maxWidth&&2===t.breakOpportunity&&e.line.length>0?(t=e.hyphens.enabled?uu(e,t,i):t,lu(e),cu(e,t)):cu(e,t)}}function du(e,t){const n=tu({string:e.text,separator:"",measureText:t,noBreakAllowedIdentifiers:[(e,t)=>0===t]}),i=au(e,t);let r=!0;for(;i.lines.length<i.maxLines;){let e=n.next();if(e.done){lu(i),r=!1;break}1===e.breakOpportunity?lu(i):i.width+e.width>i.maxWidth&&2===e.breakOpportunity?e.suppress?i.width+=e.width:(e=i.hyphens.enabled?uu(i,e,n):e,lu(i),cu(i,e)):cu(i,e)}return{lines:i.lines,reduced:r}}function fu(e,t){const n=tu({string:e.text,separator:/(\s|-|\u2010)/,measureText:t}),i=au(e,t);let r=!0;for(;i.lines.length<i.maxLines;){let e=n.next();if(e.done){lu(i),r=!1;break}1===e.breakOpportunity?lu(i):i.width+e.width>i.maxWidth&&2===e.breakOpportunity?e.suppress?lu(i):e.width>i.maxWidth?hu(i,e,t):(lu(i),cu(i,e)):cu(i,e)}return{lines:i.lines,reduced:r}}function pu(e){return{"break-all":du,"break-word":fu}[e.wordBreak]}function gu(e){return t=>{const n=t.node;if(function(e){return"text"===e.type&&!e._lineBreak}(n)){const i=pu(n);if(!i)return;const r=e(n);if(r.width>n.maxWidth||Jc(n.text)){const o=(ou(n)-r.height)/2,s=i(n,function(e,t){return n=>t({text:n,fontSize:e.fontSize,fontFamily:e.fontFamily})}(n,e));t.node=function(e,t,n,i){const r={type:"container",children:[]};void 0!==t.id&&(r.id=t.id);let o=0;return e.lines.forEach((s,a)=>{const l=u({},t);l.text=s,l._lineBreak=!0,o+=n,e.reduced&&a===e.lines.length-1?l.text+=nu:delete l.maxWidth,l.dy=isNaN(l.dy)?o:l.dy+o,o+=i,o+=n,r.children.push(l)}),r}(s,n,o,r.height)}}}}function mu(e,t){const n=e["font-family"]||e.fontFamily,i=e["font-size"]||e.fontSize,r="string"==typeof e.text?e.text:"".concat(e.text),o=e.maxWidth;if(void 0===o)return r;let s=t({text:r,fontSize:i,fontFamily:n}).width;if(s<=o)return r;let a=0,l=r.length-1;for(;a<=l;){let e=Math.floor((a+l)/2);s=t({text:r.substr(0,e)+nu,fontSize:i,fontFamily:n}).width,s<=o?a=e+1:l=e-1}return r.substr(0,l)+nu}function yu(e){const t=e.baseline||e["dominant-baseline"];let n=0;const i=parseInt(e.fontSize||e["font-size"],10)||0;switch(t){case"hanging":n=.75*i;break;case"text-before-edge":n=.85*i;break;case"middle":n=.25*i;break;case"central":n=.35*i;break;case"mathemetical":n=i/2;break;case"text-after-edge":case"ideographic":n=.2*-i;break;default:n=0}return n}const xu={},vu={},bu={fontSize:void 0,fontFamily:void 0};let wu;function ku(e,t){return!e&&!t||e===t}function _u(e){let t=e.text,n=e.fontWeight,i=e.fontSize,r=e.fontFamily;const o="".concat(t," ").concat(n," ").concat(i," ").concat(r);return"number"!=typeof vu[o]&&(wu=wu||document.createElement("canvas").getContext("2d"),function(e){let t=e.fontWeight,n=e.fontSize,i=e.fontFamily;ku(bu.fontWeight,t)&&ku(bu.fontSize,n)&&ku(bu.fontFamily,i)||(wu.font=[t,n,i].filter(e=>!!e).join(" "),bu.fontWeight=t,bu.fontSize=n,bu.fontFamily=i)}({fontWeight:n,fontSize:i,fontFamily:r}),vu[o]=wu.measureText(t).width),vu[o]}function Mu(e){return"number"!=typeof xu[e]&&(xu[e]=function(e){if(ru(e)){const t=parseFloat(e);return t+4*Math.ceil((t+1e-12)/24)}return 16}(e)),xu[e]}function Su(e){let t=e.text,n=e.fontWeight,i=e.fontSize;return{width:_u({text:t,fontWeight:n,fontSize:i,fontFamily:e.fontFamily}),height:Mu(i)}}function Ru(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Su;const n=e["font-size"]||e.fontSize,i=e["font-family"]||e.fontFamily,r=t({text:e.text,fontFamily:i,fontSize:n}),o=Math.min(e.maxWidth||r.width,r.width),s=e.x||0,a=e.y||0,l=e.dx||0,c={x:0,y:a+((e.dy||0)+yu(e))-.75*r.height,width:o,height:r.height},u=e["text-anchor"]||e.anchor;return c.x="middle"===u?s+l-o/2:"end"===u?s+l-o:s+l,c}function Cu(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Su;const n=pu(e),i=e["font-size"]||e.fontSize,r=e["font-family"]||e.fontFamily,o=t({text:e.text,fontFamily:r,fontSize:i});if(n&&(o.width>e.maxWidth||Jc(e.text))){const o=n(e,e=>t({text:e,fontFamily:r,fontSize:i})),s=u({},e);let a=0,l="";for(let e=0,n=o.lines.length;e<n;e++){let s=o.lines[e];s+=e===n-1&&o.reduced?nu:"";const c=t({text:s,fontSize:i,fontFamily:r}).width;c>=a&&(a=c,l=s)}s.text=l;const c=Ru(s,t);return c.height=ou(e)*o.lines.length,c}return Ru(e,t)}function Nu(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function Du(e,t,n){const i={type:"text",text:t,maxWidth:e.width,x:0,y:e.y,dx:0,dy:0,fill:n.fill,anchor:"start",baseline:"alphabetical",fontSize:"".concat(n.fontSize,"px"),fontFamily:n.fontFamily},r=n.textMetrics;if(e.width<n.fontSize)return!1;const o=Math.max(0,e.width-r.width);return i.x=e.x+n.align*o,i.y=e.y+r.height/1.2,i}function qu(e){return{type:"circle",bounds:{cx:e.cx,cy:e.cy,r:e.r}}}function Eu(e){return e.desc&&e.desc.slice?function(e){let t=e.start,n=e.end,i=e.innerRadius,r=e.outerRadius,o=e.offset;if(Math.abs(t+2*Math.PI-n)>1e-12)return{type:null,bounds:null};let s=0!==i?i:r;return qu({cx:o.x,cy:o.y,r:s})}(e.desc.slice):"circle"===e.type?qu(e.attrs):"rect"===e.type?{type:"rect",bounds:e.bounds}:{type:null,bounds:null}}var zu={bar:function(e){let t=e.settings,n=e.chart,i=e.nodes,r=e.rect,o=e.renderer,s=e.style,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Tc;const l=u({fontSize:12,fontFamily:"Arial",align:.5,justify:0,fill:"#333"},s.label);l.fontSize=parseInt(l.fontSize,10);const c=t.labels.map(e=>u({},l,t,e)),h=t.labels.map(e=>e.placements.map(n=>u({},l,t,e,n))),d=function(e){let t=e.nodes,n=e.rect,i=e.chart,r=e.labelSettings,o=e.placementSettings,s=e.settings,a=e.renderer;const l={},c=[];let u,h,d,f,p,g,m,y=!0,x=!1;for(let e=0;e<t.length;e++){if(h=t[e],f=h.localBounds,!Os(f,n))continue;let v=Mc(h,i);u={node:h,texts:[],measurements:[],labelSettings:[],placementSettings:[]};for(let t=0;t<r.length;t++)g=r[t],d="function"==typeof g.label?g.label(v,e):void 0,Sc(d)&&(m="function"==typeof s.direction?s.direction(v,e):s.direction||"up",x=x||"left"===m||"right"===m,l.fontFamily=g.fontFamily,l.fontSize="".concat(g.fontSize,"px"),l.text=d,p=a.measureText(l),u.measurements.push(p),u.texts.push(d),u.labelSettings.push(g),u.placementSettings.push(o[t]),u.direction=m,y=y&&p.width<=f.width-8);c.push(u)}return{targetNodes:c,fitsHorizontally:y,hasHorizontalDirection:x}}({nodes:i,chart:n,renderer:o,settings:t,rect:r,labelSettings:c,placementSettings:h}),f=d.fitsHorizontally,p=d.hasHorizontalDirection,g=d.targetNodes,m=function(e){let t=e.orientation,n=void 0===t?"auto":t,i=e.defaultOrientation,r=void 0===i?"h":i;switch(n.toLocaleLowerCase()){case"vertical":return"v";case"horizontal":return"h";default:return r}}({orientation:t.orientation,defaultOrientation:p?"h":"v"}),y="h"===m?"y":"x",x="h"===m?"height":"width";return g.sort((e,t)=>e.node.localBounds[y]+e.node.localBounds[x]-(t.node.localBounds[y]+t.node.localBounds[x])),a({chart:n,targetNodes:g,stngs:t,rect:r,fitsHorizontally:f,collectiveOrientation:m})},slice:function(e){let t=e.settings,n=e.chart,i=e.nodes,r=e.rect,o=e.renderer,s=e.style,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Uc,l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Wc;const c=u({fontSize:12,fontFamily:"Arial",fill:"#333",padding:4,position:"into"},s.label);c.fontSize=parseInt(c.fontSize,10);const h=t.labels.map(e=>u({},c,t,e)),d=t.labels.map(e=>e.placements.map(n=>u({},c,t,e,n))),f=[],p={insideLabelBounds:[]};i=function(e){const t=[],n=[],i=[],r=[];for(let o=0;o<e.length;++o){const s=e[o].desc.slice,a=Ic((s.start+s.end)/2);switch(Math.floor(a/(Math.PI/2))){case 0:t.push(e[o]);break;case 1:n.push(e[o]);break;case 2:i.push(e[o]);break;case 3:r.push(e[o])}}const o=(e,t)=>Ic((e.desc.slice.start+e.desc.slice.end)/2)-Ic((t.desc.slice.start+t.desc.slice.end)/2),s=(e,t)=>o(t,e);return t.sort(s),n.sort(o),i.sort(s),r.sort(o),t.concat(n,r,i)}(i);const g={};for(let e=0,t=i.length;e<t;e++){const t=i[e],s=Hc(t,n);for(let n=0;n<h.length;n++){const i=h[n],c="function"==typeof i.label?i.label(s,e):"";if(!c)continue;const u="function"==typeof i.direction?i.direction(s,e):i.direction||"horizontal",m="function"==typeof i.linkData?i.linkData(s,e):void 0,y=Yc(c,i,o),x=a({context:g,direction:u,lblStngs:i,measured:y,node:t,placementSettings:d[n],rect:r,store:p}),v=x.bounds,b=x.placement;if(v&&b){if("outside"===b.position&&"rotate"!==u){Bc({context:g,node:t,bounds:v});if(!bs(Pc(v),r))continue}const n="function"==typeof b.fill?b.fill(s,e):b.fill,o=l(v,c,{fill:n,fontSize:i.fontSize,fontFamily:i.fontFamily,textMetrics:y});o&&(void 0!==m&&(o.data=m),f.push(o),v.line&&(v.line.stroke=n,f.push(v.line)))}}}return f},rows:function(e){let t=e.settings,n=e.chart,i=e.nodes,r=e.renderer,o=e.style,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Du;const a=u({fontSize:12,fontFamily:"Arial",fill:"#333",padding:4,align:.5,justify:.5},o.label);a.fontSize=parseInt(a.fontSize,10);const l=u({},a,t),c=t.labels.map(e=>u({},l,e)),h={},d=[];for(let e=0,t=i.length;e<t;e++){let t=i[e],o=Nu(t,n),a=Eu(t),u=a.type,f=a.bounds;if(!f)continue;let p,g=0,m=[],y=[],x="circle"===u?2*f.r*.9:f.height;for(g+=l.padding,p=0;p<c.length;p++){let t=c[p],n="function"==typeof t.label?t.label(o,e):"";h.fontFamily=t.fontFamily,h.fontSize="".concat(t.fontSize,"px"),h.text=n;let i=r.measureText(h);if(g+=i.height+t.padding,g>x)break;y.push(n),m.push(i)}const v=p,b=Math.max(0,x-g);let w;for(w="circle"===u?f.cy-.9*f.r:f.y,w+=l.justify*b+l.padding,p=0;p<v;p++){let t,n=c[p];if("circle"===u){let e=Math.max(Math.abs(w-f.cy),Math.abs(w+m[p].height-f.cy)),n=Math.sqrt(f.r*f.r-e*e);t={x:f.cx-n+l.padding,y:w,width:2*n-2*l.padding,height:m[p].height}}else t={x:f.x+l.padding,y:w,width:f.width-2*l.padding,height:m[p].height};w+=m[p].height+l.padding;let i="function"==typeof n.fill?n.fill(o,e):n.fill;const a="function"==typeof n.linkData?n.linkData(o,e):void 0;let h=s(t,y[p],{fill:i,align:n.align,fontSize:n.fontSize,fontFamily:n.fontFamily,textMetrics:m[p]});if(h){if(h.text&&h.text!==nu){const e=mu(h,r.measureText);if(nu===e)continue;h.ellipsed=e}void 0!==a&&(h.data=a),d.push(h)}}}return d}};const Au={require:["chart","renderer","settings"],defaultSettings:{settings:{},style:{label:"$label"}},render(){const e=this.settings.settings,t=[];return(e.sources||[]).forEach(e=>{e.strategy&&zu[e.strategy.type]&&e.component&&t.push(...function(e,t){let n=e.chart,i=e.source,r=e.rect,o=e.renderer,s=e.style;if(!n.component(i.component))return[];const a=n.findShapes(i.selector).filter(e=>e.key===i.component);return t({chart:n,settings:i.strategy.settings,nodes:a,rect:{x:0,y:0,width:r.width,height:r.height},renderer:o,style:s})}({chart:this.chart,rect:this.rect,renderer:this.renderer,source:e,style:this.style},zu[e.strategy.type]))}),t}};const Ou={layout:{size:1,direction:"ltr",scrollOffset:0},item:{show:!0,label:{fontSize:"12px",fontFamily:"Arial",fill:"#595959",wordBreak:"none",maxLines:2,maxWidth:136,lineHeight:1.2},shape:{type:"square",size:12}},title:{show:!0,text:void 0,anchor:"start",fontSize:"16px",fontFamily:"Arial",fill:"#595959",wordBreak:"none",maxLines:2,maxWidth:156,lineHeight:1.25}};function Tu(e){let t=e.x,n=void 0===t?0:t,i=e.y,r=e.item,o=e.globalMetrics,s=e.createSymbol,a=e.direction,l=void 0===a?"ltr":a,c=r.label.displayObject,h=r.label.bounds,d=r.symbol.meta;const f="rtl"===l;let p={x:f?n+o.maxLabelBounds.width:n+o.maxSymbolSize+o.spacing,y:i,width:o.maxLabelBounds.width,height:Math.max(o.maxSymbolSize,o.maxLabelBounds.height)},g=function(e,t,n){const i=Math.max(0,e.width-t),r=Math.max(0,e.height-t);return{x:e.x+t/2+n.align*i,y:e.y+t/2+n.justify*r}}({x:f?n+o.maxLabelBounds.width+o.spacing:n,y:i,width:o.maxSymbolSize,height:p.height},d.size,{align:void 0===d.align?.5:d.align,justify:void 0===d.justify?.5:d.justify});const m=s(u({},d,g));return delete m.collider,c.anchor=f?"end":"start",function(e,t,n){const i=n.textMetrics;if(e.height<i.height)return!1;const r=Math.max(0,e.width-i.width);t.baseline="text-before-edge";const o=Math.max(0,e.height-i.height);t.x=e.x+n.align*r,t.y=e.y+n.justify*o+.175*parseInt(t.fontSize,10)}(p,c,{textMetrics:h,fontSize:parseInt(c.fontSize,10),align:0,justify:.5}),{item:{type:"container",data:r.label.displayObject.data,children:[m,c],collider:{type:"rect",x:n,y:i,width:o.maxItemBounds.width,height:o.maxItemBounds.height}},metrics:p}}function Iu(e,t){const n=e.items.length,i=Math.ceil(n/t),r="horizontal"===e.layout.orientation?"width":"height",o="width"===r?"horizontal":"vertical";return e.globalMetrics.maxItemBounds[r]*i+(i-1)*e.layout.margin[o]}function ju(e,t){let n,i,r,o,s=t.onScroll,a=void 0===s?()=>{}:s,l=null,c=0;const h={itemize:t=>{n=function(e,t){let n,i,r=e.resolved,o=e.dock,s=[],a=r.items.items,l=r.symbols.items,c=r.labels.items,h=0,d=0,f=0;for(let e=0;e<a.length;e++){if(!1===a[e].show)continue;const r=void 0!==c[e].text?c[e].text:c[e].data.label||"";n=u({},c[e],{type:"text",fontSize:"".concat(parseInt(c[e].fontSize,10),"px"),text:r,title:r}),i={symbol:{meta:l[e]},label:{displayObject:n,bounds:t.textBounds(n)}},s.push(i),h=Math.max(l[e].size,h),d=Math.max(i.label.bounds.width,d),f=Math.max(i.label.bounds.height,f)}return{items:s,globalMetrics:{spacing:8,maxSymbolSize:h,maxItemBounds:{height:Math.max(h,f),width:h+8+d},maxLabelBounds:{width:d,height:f}},layout:{margin:{vertical:void 0!==r.layout.item.vertical?r.layout.item.vertical:4,horizontal:void 0!==r.layout.item.horizontal?r.layout.item.horizontal:4},mode:r.layout.item.mode,size:r.layout.item.size,orientation:"top"===o||"bottom"===o?"horizontal":"vertical",direction:r.layout.item.direction,scrollOffset:r.layout.item.scrollOffset}}}(t,e.renderer),l=isNaN(n.layout.scrollOffset)?l:n.layout.scrollOffset},getItemsToRender:t=>{r=t.viewRect,c=h.getContentOverflow(r);const s=h.extent();l=Math.max(0,Math.min(l,c)),o=u({},r);const a="horizontal"===h.orientation()?"x":"y";return o[a]-=l,o["x"===a?"width":"height"]=s,function(e,t,n){let i=e.viewRect,r=n.itemized,o=n.create,s=void 0===o?Tu:o,a=n.parallels,l=n.createSymbol;const c=r.layout.direction,u=r.globalMetrics,h=r.items,d="horizontal"===r.layout.orientation;let f=0;const p=[],g=u.maxItemBounds.height,m=u.maxItemBounds.width,y=r.layout.margin.vertical+g,x=r.layout.margin.horizontal+m;let v=t.x,b=t.y,w=i.x-t.x;for(let e=0;e<h.length;e++){let n=s({y:b,x:"rtl"===c?i.x+w+i.width-m-(v-t.x):v,item:h[e],globalMetrics:u,direction:c,createSymbol:l});if((d&&v>=i.x-m||!d&&b>=i.y-g)&&p.push(n.item),f++,f>=a?(f=0,d?(v+=x,b=t.y):(b+=y,v=t.x)):d?b+=y:v+=x,!d&&b>i.y+i.height)break;if(d&&v>i.x+i.width)break}return p}(t,o,{itemized:n,parallels:i,createSymbol:e.symbol})},parallelize:(e,t)=>(i=function(e,t,n){const i=n.items.length,r="horizontal"===n.layout.orientation?"width":"height",o="width"===r?"horizontal":"vertical",s=n.globalMetrics.maxItemBounds[r]*i+(i-1)*n.layout.margin[o];let a=Math.ceil(s/e);if(null!=t){const e="horizontal"===n.layout.orientation?"height":"width",i="width"===e?"horizontal":"vertical",r=n.layout.margin[i]||4,o=Math.floor((t+r)/(r+n.globalMetrics.maxItemBounds[e]));a=Math.min(a,o)}const l=isNaN(n.layout.size)?1:n.layout.size;return Math.max(1,Math.min(a,l))}(e,t,n),i),hasContentOverflow:()=>{const e="horizontal"===n.layout.orientation?"width":"height";return Iu(n,i)>r[e]},getContentOverflow:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r;const t="horizontal"===n.layout.orientation?"width":"height";return Math.max(0,Iu(n,i)-e[t])},getNextSize:()=>{const e="horizontal"===n.layout.orientation?"width":"height",t="width"===e?"horizontal":"vertical";return n.globalMetrics.maxItemBounds[e]+n.layout.margin[t]},getPrevSize:()=>{const e="horizontal"===n.layout.orientation?"width":"height",t="width"===e?"horizontal":"vertical";return n.globalMetrics.maxItemBounds[e]+n.layout.margin[t]},hasNext:()=>"horizontal"===h.orientation()?r.x+r.width<o.x+o.width:r.y+r.height<o.y+o.height,hasPrev:()=>"horizontal"===h.orientation()?o.x<r.x:o.y<r.y,next:()=>{h.scroll(-h.getNextSize())},prev:()=>{h.scroll(h.getPrevSize())},scroll:e=>{const t=Math.max(0,Math.min(c,l-e));t!==l&&(l=t,a())},offset:()=>l,orientation:()=>n.layout.orientation,direction:()=>n.layout.direction,extent:()=>Iu(n,i),spread:()=>function(e,t){const n=t,i="horizontal"===e.layout.orientation?"height":"width",r="width"===i?"horizontal":"vertical";return e.globalMetrics.maxItemBounds[i]*n+(n-1)*e.layout.margin[r]}(n,i)};return h}function Pu(e){return Object.keys(e).filter(t=>e[t]).join(" ")}const Fu={up:"▲",right:"▶",down:"▼",left:"◀"};function Lu(e,t){let n=t.size,i=t.isActive,r=t.direction,o=t.nav,s={},a="";const l=t.attrs;o&&o.button&&("function"==typeof o.button.class?s=o.button.class({direction:r}):o.button.class&&(s=o.button.class),"function"==typeof o.button.content&&(a=o.button.content(e,{direction:r})),void 0!==o.button.tabIndex&&(l.tabindex=o.button.tabIndex));const c={width:"".concat(n,"px"),minWidth:"".concat(n,"px"),height:"".concat(n,"px")};return Object.keys(s).length||(c.border="0",c.background="none"),(!i||o&&o.disabled)&&(l.disabled="disabled"),e("button",u({class:Pu(s),style:c},l),[a||e("span",{style:{pointerEvents:"none"}},[Fu[r]])])}function $u(e){let t;const n={itemize:e=>{t=function(e){let t=e.dock;return{layout:{orientation:"top"===t||"bottom"===t?"vertical":"horizontal"},navigation:e.navigation}}(e)},render:i=>function(e,t,n,i){let r=t.rect,o=t.itemRenderer;if(!e||!e.renderArgs)return;e.size(r);const s=e.renderArgs[0],a="vertical"===n.layout.orientation,l="rtl"===o.direction(),c=o.hasNext(),u=o.hasPrev();if(!u&&!c)return void e.render([]);const h=a?["right","left"]:["down","up"];l&&a&&h.reverse();const d=[s("div",{style:{position:"relative",display:"flex","flex-direction":a?"column":"row","justify-content":"center",height:"100%",pointerEvents:"auto"},dir:l&&!a?"rtl":"ltr"},[Lu(s,{size:32,isActive:c,direction:h[0],attrs:{"data-action":"next","data-component-key":i.settings.key},nav:n.navigation}),Lu(s,{size:32,isActive:u,direction:h[1],attrs:{"data-action":"prev","data-component-key":i.settings.key},nav:n.navigation})])];e.render(d)}(n.renderer,i,t,e),extent:()=>32,spread:()=>64};return n}function Bu(e){let t;const n={itemize:n=>{t=function(e,t){let n=e.resolved;if(!1===n.title.item.show)return null;const i=u({},n.title.item,{type:"text"});if("rtl"===n.layout.item.direction&&(i.anchor&&"start"!==i.anchor?"end"===i.anchor&&(i.anchor="start"):i.anchor="end"),void 0===n.title.settings.text){const e=t.scale.data().fields;i.text=e&&e[0]?e[0].title():""}return{displayObject:i,bounds:t.renderer.textBounds(i)}}(n,e)},render:e=>{!function(e,t,n){let i=e.rect;if(!t)return;const r=[];if(t.size(i),n){const e={start:0,end:i.width,middle:i.width/2};r.push(u({},n.displayObject,{x:e[n.displayObject.anchor]||0,y:0,baseline:"text-before-edge",title:n.displayObject.text}))}t.render(r)}(e,n.renderer,t)},spread:()=>t?t.bounds.height:0,extent:()=>t?t.bounds.width:0};return n}function Hu(e,t,n,i){let r,o,s,a=i.itemRenderer,l=i.navigationRenderer,c=i.titleRenderer,h=i.isPreliminary,d=void 0!==h&&h,f=0;const p={x:t.spacing,y:t.spacing,width:e.width-2*t.spacing,height:e.height-2*t.spacing};if(r={x:p.x,y:p.y,width:p.width,height:c.spread()},"horizontal"===n){r={x:p.x,y:p.y,width:c.extent(),height:c.spread()};const e=p.width-r.width-(r.width?t.spacing:0),n=p.height;a.parallelize(e,d?void 0:n);const i=a.extent()>e?l.extent():0,u=a.spread(),h=i?l.spread():0;o={x:r.x+r.width+(r.width?t.spacing:0),y:p.y+Math.max(0,(h-u)/2),width:p.width-i-r.width-(i?t.spacing:0)-(r.width?t.spacing:0),height:n},s={x:o.x+o.width+(i?t.spacing:0),y:p.y,width:i,height:p.height},r.y=o.y;"rtl"===a.direction()&&(s.x=p.x,o.x=s.x+s.width+(s.width?t.spacing:0),r.x=o.x+o.width+(r.width?t.spacing:0)),f=Math.max(r.height,h,a.spread())}else{const e=p.height-r.height-(r.height?t.spacing:0),n=p.width;a.parallelize(e,d?void 0:n);const i=a.extent()>e?l.extent():0;s={x:p.x,y:p.y+p.height-i,width:p.width,height:i},o={x:p.x,y:r.y+r.height+(r.height?t.spacing:0),width:p.width,height:p.height-r.height-(r.height?t.spacing:0)-s.height-(s.height?t.spacing:0)},f=Math.max(c.extent(),i?l.spread():0,a.spread())}return o=u({},e,{x:e.x+o.x,y:e.y+o.y,width:o.width,height:o.height}),s.x+=e.x,s.y+=e.y,r.x+=e.x,r.y+=e.y,{title:u({},e,r),content:u({},e,o),navigation:u({},e,s),orientation:n,preferredSize:f}}function Wu(e){e.state.resolved=function(e){const t=e.scale.domain();let n={items:[]};const i=e.settings.layout.dock;if("threshold-color"===e.scale.type){const r=e.scale.data().fields[0];let o=e=>String(e);e.settings.formatter?o=e.chart.formatter(e.settings.formatter):r&&(o=r.formatter());for(let e=0;e<t.length-1;e++){const i={value:t[e],label:"".concat(o(t[e])," - < ").concat(o(t[e+1]))};r&&(i.source={field:r.id()}),n.items.push(i)}"vertical"==("top"===i||"bottom"===i?"horizontal":"vertical")&&n.items.reverse()}else{const i=e.scale.labels?e.scale.labels():null;n.items=t.map((t,n)=>{const r=e.scale.datum?u({},e.scale.datum(t)):{value:t};return r.value=t,e.scale.label?r.label=e.scale.label(t):i&&(r.label=i[n]),r})}const r=e.resolver.resolve({data:{fields:e.scale.data().fields},defaults:u(!0,{},Ou.title,e.style.title),settings:e.settings.settings.title}),o=e.resolver.resolve({data:{fields:e.scale.data().fields},defaults:Ou.layout,settings:e.settings.settings.layout}),s=e.resolver.resolve({data:n,defaults:u(!0,{},Ou.item.label,e.style.item.label),settings:(e.settings.settings.item||{}).label}),a=u(!0,{},(e.settings.settings.item||{}).shape);void 0===a.fill&&e.settings.scale&&(a.fill={scale:e.settings.scale});const l=e.resolver.resolve({data:n,defaults:u(!0,{},Ou.item.shape,e.style.item.shape),settings:a}),c=e.resolver.resolve({data:n,defaults:u(!0,{},{show:Ou.item.show}),settings:{show:(e.settings.settings.item||{}).show}});function h(e,n){let i=e.data.value,r=t[n+1];e.data.value=[i,r]}"threshold-color"===e.scale.type&&("vertical"==("top"===i||"bottom"===i?"horizontal":"vertical")?(c.items.reverse().forEach(h),c.items.reverse()):c.items.forEach(h));return{title:r,labels:s,symbols:l,items:c,layout:o}}(e),e.titleRenderer.itemize({resolved:e.state.resolved,dock:e.settings.layout.dock||"center"}),e.itemRenderer.itemize({resolved:e.state.resolved,dock:e.settings.layout.dock||"center"}),e.navigationRenderer.itemize({resolved:e.state.resolved,dock:e.settings.layout.dock||"center",navigation:e.settings.settings.navigation}),e.state.display={spacing:8}}function Vu(e){const t=e.rect,n=e.settings,i=e.state,r=e.itemRenderer,o=e.navigationRenderer,s=e.titleRenderer,a=n.layout.dock,l="top"===a||"bottom"===a?"horizontal":"vertical",c=Hu(t,i.display,l,{itemRenderer:r,navigationRenderer:o,titleRenderer:s});e.renderer.size(c.content);let h=r.getItemsToRender({viewRect:u({},c.content,{x:0,y:0})});return o.render({rect:c.navigation,itemRenderer:r}),s.render({rect:c.title}),e.state.views={layout:c},h}const Uu={require:["chart","settings","renderer","update","resolver","registries","symbol"],defaultSettings:{settings:{},style:{item:{label:"$label",shape:"$shape"},title:"$title"}},mounted(e){e&&e.parentNode&&(this.navigationRenderer.renderer.appendTo(e.parentNode),this.titleRenderer.renderer.appendTo(e.parentNode),e.parentNode.insertBefore(this.navigationRenderer.renderer.element(),e),e.parentNode.insertBefore(this.titleRenderer.renderer.element(),e)),this.navigationRenderer.render({rect:this.state.views.layout.navigation,itemRenderer:this.itemRenderer}),this.titleRenderer.render({rect:this.state.views.layout.title})},beforeUnmount(){this.navigationRenderer.renderer.clear(),this.titleRenderer.renderer.clear()},on:{panstart(){if(this.state.interaction.started)return;this.itemRenderer.getContentOverflow()&&(this.state.interaction.started=!0,this.state.interaction.delta=0)},panmove(e){if(!this.state.interaction.started)return;const t="horizontal"===this.itemRenderer.orientation()?("rtl"===this.itemRenderer.direction()?-1:1)*e.deltaX:e.deltaY;this.itemRenderer.scroll(t-this.state.interaction.delta),this.state.interaction.delta=t},panend(){this.state.interaction.started=!1},scroll(e){this.itemRenderer.scroll(-e)},next(){this.itemRenderer.next()},prev(){this.itemRenderer.prev()}},created(){this.state={interaction:{}},this.onScroll=()=>{const e=Vu(this);this.update(e)},this.itemRenderer=ju(this,{onScroll:this.onScroll}),this.navigationRenderer=$u(this),this.titleRenderer=Bu(this),this.navigationRenderer.renderer=this.registries.renderer("dom")(),this.titleRenderer.renderer=this.registries.renderer(this.settings.renderer)(),Wu(this)},preferredSize(e){return function(e,t){let n=0;const i=e.settings.layout.dock||"center",r="top"===i||"bottom"===i?"horizontal":"vertical",o=e.state.display,s=Hu(t.inner,o,r,{itemRenderer:e.itemRenderer,navigationRenderer:e.navigationRenderer,titleRenderer:e.titleRenderer,isPreliminary:!0});return n+=o.spacing,n+=s.preferredSize,n+=o.spacing,n}(this,e)},beforeUpdate(){Wu(this)},render(){return Vu(this)},beforeDestroy(){this.navigationRenderer.renderer.destroy(),this.titleRenderer.renderer.destroy()},additionalElements(){return[this.titleRenderer.renderer.element(),this.navigationRenderer.renderer.element()]},_DO_NOT_USE_getInfo(){return{offset:this.itemRenderer.offset()}}};function Yu(e,t){let n=0;const i=e.state.isVertical?"justify":"align",r=e.state.isVertical?"y":"x",o=e.state.isVertical?"height":"width",s=e.state.isVertical?"requiredHeight":"requiredWidth";n=e.state.rect[o]-e.state.legend.length()-e.state.title[s](),n*=Math.min(1,Math.max(e.stgns[i],0)),t[r]+=n}function Ku(e,t,n){const i=n[e];return"object"==typeof i?-1!==i.valid.indexOf(t)?t:i.default:n.default}function Xu(e){return Ku(e.layout.dock,e.settings.title.anchor,{left:{valid:["top"],default:"top"},right:{valid:["top"],default:"top"},top:{valid:["left","right"],default:"left"},bottom:{valid:["left","right"],default:"left"},default:"top"})}function Gu(e,t){const n={x:0,y:0,width:0,height:0},i=e.stgns.padding;return n.x=i.left,n.y=i.top,n.width=t.width-i.left-i.right,n.height=t.height-i.top-i.bottom,n}function Ju(e){const t="top"!==e.settings.layout.dock&&"bottom"!==e.settings.layout.dock,n=e.stgns.title,i=e.chart.scale(e.stgns.fill),r=e.chart.scale(e.stgns.major),o=function(e,t){const n=t.domain();let i=n,r=e.stgns.tick.label;!r&&e.formatter?r=e.formatter:!r&&t.data().fields&&(r=t.data().fields[0].formatter()),"function"==typeof r&&(i=n.map(r).map(String));const o=n.map((n,r)=>{const o=i[r];return{value:n,label:o,pos:t.norm(parseFloat(n,10)),textMetrics:e.renderer.measureText({text:o,fontSize:e.stgns.tick.fontSize,fontFamily:e.stgns.tick.fontFamily})}});return o}(e,r),s=Ku((a=e.settings).layout.dock,a.settings.tick.anchor,{left:{valid:["left","right"],default:"left"},right:{valid:["left","right"],default:"right"},top:{valid:["top","bottom"],default:"top"},bottom:{valid:["top","bottom"],default:"bottom"},default:"right"});var a;if(void 0===n.text){const e=r.data().fields;n.text=e&&e[0]?e[0].title():""}const l=e.renderer.measureText({text:n.text,fontSize:n.fontSize,fontFamily:n.fontFamily}),c=e.renderer.textBounds({text:n.text,fontSize:n.fontSize,fontFamily:n.fontFamily,maxLines:n.maxLines,maxWidth:n.maxLengthPx,wordBreak:n.wordBreak,hyphens:n.hyphens,lineHeight:n.lineHeight}),u={isVertical:t,nodes:[],title:{anchor:Xu(e.settings),textMetrics:l,textBounds:c,requiredWidth:()=>{if(!n.show)return 0;let e=c.width,i=n.maxLengthPx;return t||(e+=n.padding,i+=n.padding),Math.min(e,i,u.rect.width)},requiredHeight:()=>{if(!n.show)return 0;let e=c.height;return t&&(e+=n.padding),Math.min(e,u.rect.height)}},ticks:{values:o,anchor:s,length:Math.min(Math.max(...o.map(e=>e.textMetrics.width)),e.stgns.tick.maxLengthPx),requiredHeight:()=>"top"===s?Math.max(...u.ticks.values.map(e=>e.textMetrics.height))+e.stgns.tick.padding:0,height:Math.max(...o.map(e=>e.textMetrics.height))},legend:{fillScale:i,majorScale:r,length:()=>{const n=t?"height":"width",i=t?"requiredHeight":"requiredWidth",r=Math.min(u.rect[n],u.rect[n]*e.stgns.length)-u.title[i]();return Math.max(0,Math.min(r,e.stgns.maxLengthPx))}}};return u}const Zu={require:["chart","settings","renderer"],defaultSettings:{layout:{displayOrder:0,dock:"right"},settings:{size:15,length:.5,maxLengthPx:250,align:.5,justify:0,padding:{left:5,right:5,top:5,bottom:5},tick:{label:null,fill:"#595959",fontSize:"12px",fontFamily:"Arial",maxLengthPx:100,anchor:null,padding:5},title:{show:!0,text:void 0,fill:"#595959",fontSize:"12px",fontFamily:"Arial",maxLengthPx:100,padding:5,maxLines:2,wordBreak:"none",lineHeight:1.2,hyphens:"auto",anchor:null}}},preferredSize(e){const t=this.state;t.rect=Gu(this,e.inner);let n=this.stgns.size;const i=t.isVertical?this.stgns.padding.left+this.stgns.padding.right:this.stgns.padding.top+this.stgns.padding.bottom;n+=i;const r=Math.max(e.inner.width,e.inner.height);if("left"===t.ticks.anchor||"right"===t.ticks.anchor){const e=t.ticks.values.reduce((e,t)=>e+t.textMetrics.height,0);if(e>this.state.legend.length())return r;n+=t.ticks.length}else{if(t.ticks.length>this.state.legend.length())return r;n+=Math.max(...t.ticks.values.map(e=>e.textMetrics.height))}return n+=this.stgns.tick.padding,this.stgns.title.show&&(n="left"===t.title.anchor||"right"===t.title.anchor?Math.max(t.title.textBounds.height+i,n):Math.max(n,t.title.requiredWidth()+i)),this.state.preferredSize=n,n},created(){this.stgns=this.settings.settings,this.state=Ju(this)},beforeUpdate(e){this.stgns=e.settings.settings,this.state=Ju(this)},beforeRender(e){if(this.state.nodes=[],this.state.rect=Gu(this,e.size),this.stgns.title.show){const e=function(e){const t=e.state,n=e.stgns,i="left"===t.ticks.anchor,r="top"===t.ticks.anchor;let o=t.rect.x,s=t.rect.y,a="start";"left"===t.title.anchor?(o+=t.title.requiredWidth()-n.title.padding,s+=t.title.textMetrics.height,s+=r?t.rect.height-t.title.textBounds.height:0,a="end"):"right"===t.title.anchor?(o+=t.legend.length(),o+=n.title.padding,s+=t.title.textMetrics.height,s+=r?t.rect.height-t.title.textBounds.height:0):"top"===t.title.anchor&&(o+=i?t.rect.width:0,s+=t.title.textMetrics.height,a=i?"end":"start");const l={tag:"legend-title",type:"text",x:o,y:Math.min(s,t.rect.y+t.rect.height),text:n.title.text,fill:n.title.fill,fontSize:n.title.fontSize,fontFamily:n.title.fontFamily,maxWidth:n.title.maxLengthPx,maxLines:n.title.maxLines,wordBreak:n.title.wordBreak,hyphens:n.title.hyphens,lineHeight:n.title.lineHeight,anchor:a,title:n.title.text};return Yu(e,l),l}(this);this.state.nodes.push(e)}const t=function(e){const t=e.state.legend.fillScale,n=e.state.legend.majorScale;return t.domain().map(e=>({type:"stop",color:t(e),offset:Math.min(1,Math.max(0,n.norm(e)))})).sort((e,t)=>e.offset-t.offset)}(this),n=function(e,t){const n=e.state,i=e.stgns,r=n.rect;let o=r.x,s=r.y,a=n.isVertical?i.size:n.legend.length(),l=n.isVertical?n.legend.length():i.size;"left"===n.ticks.anchor?o+=n.rect.width-i.size:"top"===n.ticks.anchor&&(s+=n.rect.height-i.size),"top"===n.title.anchor?s+=n.title.requiredHeight():"left"===n.title.anchor&&(o+=n.title.requiredWidth());const c={type:"rect",x:o,y:s,width:a,height:l,fill:{type:"gradient",stops:t,degree:n.isVertical?90:180}};return Yu(e,c),c}(this,t),i=function(e,t){const n=e.state,i=e.stgns;let r="start";const o={type:"rect",x:t.x,y:t.y,width:n.isVertical?0:t.width,height:n.isVertical?t.height:0,fill:"transparent"},s=n.ticks.values.map(s=>{let a=0,l=0,c=0,u="alphabetical";return n.isVertical?(l=t.y+t.height*s.pos,u=0===s.pos?"text-before-edge":"text-after-edge"):a=t.x+t.width*s.pos,"right"===n.ticks.anchor?(a=t.x+i.size+i.tick.padding,o.x=t.x+t.width):"left"===n.ticks.anchor?(a=t.x-i.tick.padding,r="end"):"top"===n.ticks.anchor?(l=t.y-i.tick.padding,c-=.25*s.textMetrics.height,r=0===s.pos?"start":"end"):"bottom"===n.ticks.anchor&&(l=t.y+t.height+i.tick.padding,c=.8*s.textMetrics.height,r=0===s.pos?"start":"end",o.y=t.y+t.height),{type:"text",x:a,y:l,dx:0,dy:c,text:s.label,fontSize:i.tick.fontSize,fontFamily:i.tick.fontFamily,fill:i.tick.fill,maxWidth:n.isVertical?i.tick.maxLengthPx:Math.min(i.tick.maxLengthPx,n.legend.length()/2),anchor:r,textBoundsFn:e.renderer.textBounds,title:s.label,baseline:u}});return{type:"container",id:"legend-seq-ticks",children:[...s,o]}}(this,n),r={id:"legend-seq-target",type:"container",children:[n,i]};this.state.nodes.push(r)},render(){return this.state.nodes}};const Qu={coordinates:{minor:.5,major:.5,layerId:0,defined:!0},layers:{curve:"linear",show:!0,line:{stroke:"#ccc",strokeWidth:1,strokeLinejoin:"miter",strokeDasharray:void 0,opacity:1,show:!0,showMinor0:!0},area:{fill:"#ccc",opacity:.8,show:!0}}};function eh(e,t){let n=t.generatorType,i=t.item,r=t.data,o=t.major,s=t.minor,a=t.layerObj,l=t.stngs,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const u={type:"path",points:e,generatorType:n,major:o,minor:s,layerObj:a,stngs:l,opacity:i.opacity,stroke:i.stroke,strokeWidth:i.strokeWidth,strokeLinejoin:i.strokeLinejoin,fill:c||i.fill,data:r};return i.strokeDasharray&&(u.strokeDasharray=i.strokeDasharray),u}function th(e){const t=function(e){let t=e.data,n=e.stngs,i=e.rect,r=e.resolver,o=e.style,s=e.domain;const a=i.width,l=i.height,c=r.resolve({data:t,defaults:Qu.coordinates,settings:n.coordinates||{},scaled:{major:"vertical"===n.orientation?l:a,minor:"vertical"===n.orientation?a:l}}),h=!n.connect&&s.length>2&&("function"==typeof n.coordinates.layerId||"object"==typeof n.coordinates.layerId),d={};let f=0;for(let e=0;e<c.items.length;e++){let t=c.items[e],n=t.layerId;if(h){const e=d[n]?d[n].items[d[n].items.length-1]:null,i=e?s.indexOf(e.data.major?e.data.major.value:e.data.value):null;e&&s.indexOf(t.data.major?t.data.major.value:t.data.value)-1!==i&&d[n].items.push({dummy:!0})}d[n]=d[n]||{order:f++,id:n,items:[],dataItems:[],consumableData:{}},d[n].dataItems.push(t.data),d[n].items.push(t)}const p=Object.keys(d).map(e=>(d[e].consumableData=g({points:d[e].dataItems},d[e].dataItems[0]),d[e])),m={items:p.map(e=>e.consumableData)},y=n.layers||{};return{coordinates:c,metaLayers:p,layers:r.resolve({data:m,defaults:{curve:Qu.layers.curve,show:Qu.layers.show},settings:{curve:y.curve,show:y.show}}),lines:r.resolve({data:m,defaults:u({},Qu.layers.line,o.line),settings:y.line}),areas:r.resolve({data:m,defaults:u({},Qu.layers.area,o.area),settings:y.area})}}(e),n=t.metaLayers,i=t.coordinates,r=t.layers,o=t.lines,s=t.areas,a=[];return n.forEach((t,n)=>{const l=r.items[n];if(!1===l.show)return;l.datum=l.data,l.data=[],l.id=t.id;const c=[],u=[];let h,d;for(let n=0;n<t.items.length;n++){if(h=t.items[n],d=h.data,!h.dummy){if(isNaN(h.major))continue;e.missingMinor0&&(h.minor0=i.settings.minor.scale?i.settings.minor.scale(d.minor0?d.minor0.value:0):0),isNaN(h.minor)||c.push(h.minor),l.data.push(h.data)}u.push(h)}const f=c.sort((e,t)=>e-t)[Math.floor((c.length-1)/2)];a.push({layerObj:l,lineObj:o.items[n],areaObj:s.items[n],median:f,points:u,consumableData:t.consumableData})}),a}const nh={require:["chart","resolver"],defaultSettings:{style:{area:"$shape",line:"$shape-outline"}},created(){},render(e){let t=e.data;const n=this.rect,i=n.width,r=n.height;this.stngs=this.settings.settings||{};const o=!this.stngs.coordinates||void 0===this.stngs.coordinates.minor0,s=th({data:t,stngs:this.stngs,rect:this.rect,resolver:this.resolver,style:this.style,missingMinor0:o,domain:this.stngs.coordinates&&this.stngs.coordinates.major&&this.stngs.coordinates.major.scale?this.chart.scale(this.stngs.coordinates.major.scale).domain():[]});if(this.stngs.layers&&this.stngs.layers.sort){const e=s.map(e=>({id:e.layerObj.id,data:e.layerObj.data})).sort(this.stngs.layers.sort).map(e=>e.id);s.sort((t,n)=>e.indexOf(t.layerObj.id)-e.indexOf(n.layerObj.id))}else s.sort((e,t)=>e.median-t.median);return function(e,t){let n=t.width,i=t.height,r=t.missingMinor0,o=t.stngs;const s=[],a=o.layers||{};return e.forEach(e=>{const t=e.lineObj,l=e.layerObj,c=e.areaObj,h=e.points;let d={size:i,p:"y"},f={size:n,p:"x"};if("vertical"===o.orientation){const e=u(!0,{},f);f=u(!0,{},d),d=u(!0,{},e)}a.area&&!1!==c.show&&s.push(eh(h,{data:e.consumableData,item:c,generatorType:"area",major:f,minor:d,layerObj:l,stngs:o})),t&&!1!==t.show&&(s.push(eh(h,{data:e.consumableData,item:t,generatorType:"line".concat(d.p.toUpperCase(),"1"),major:f,minor:d,layerObj:l,stngs:o},"none")),!r&&a.area&&!1!==c.show&&!1!==t.showMinor0&&s.push(eh(h,{data:e.consumableData,item:t,generatorType:"line".concat(d.p.toUpperCase(),"0"),major:f,minor:d,layerObj:l,stngs:o},"none")))}),s}(s,{width:i,height:r,missingMinor0:o,stngs:this.stngs})}};function ih(e,t){let n,i,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];"object"==typeof t.center?(n=t.center.x,i=t.center.y):(n=t.clientX,i=t.clientY);const o=n-e.state.boundingRect.left,s=i-e.state.boundingRect.top;return{x:r?Math.max(0,Math.min(o,e.rect.width)):o,y:r?Math.max(0,Math.min(s,e.rect.height)):s}}function rh(e,t){return{x:t.x+e.rect.x,y:t.y+e.rect.y}}function oh(e,t){const n=Math.min(e.x,t.x),i=Math.min(e.y,t.y);return{x:n,y:i,width:Math.max(e.x,t.x)-n,height:Math.max(e.y,t.y)-i}}const sh={require:["chart","renderer"],defaultSettings:{layout:{displayOrder:99},settings:{brush:{components:[]}},style:{area:"$selection-area-target"}},on:{areaStart(e){this.start(e)},areaMove(e){this.move(e)},areaEnd(e){this.end(e)},areaCancel(){this.cancel()}},created(){this.state={start:{x:0,y:0},end:{x:0,y:0},active:!1}},preferredSize:()=>0,render(){},start(e){this.state.boundingRect=this.renderer.element().getBoundingClientRect();const t=ih(this,e,!1);Is({x:0,y:0,width:this.rect.width,height:this.rect.height},t)&&(this.state.brushConfig=this.settings.settings.brush.components.map(e=>({key:e.key,contexts:e.contexts,data:e.data,action:e.action||"set"})),this.state.start=ih(this,e),this.state.active=!0)},move(e){var t;this.state.active&&(this.state.end=ih(this,e),function(e){if(e.state.active){const t=rh(e,e.state.start),n=rh(e,e.state.end),i=e.chart.shapesAt(oh(t,n),{components:e.state.brushConfig});e.chart.brushFromShapes(i,{components:e.state.brushConfig})}}(this),(t=this).renderer.render([u({type:"rect"},oh(t.state.start,t.state.end),t.style.area)]))},end(){this.state.active&&(this.state={start:{x:0,y:0},end:{x:0,y:0},active:!1},this.renderer.render([]))},cancel(){var e,t;this.state.active&&(e=this.state,t=this.chart,e.brushConfig.forEach(e=>{Array.isArray(e.contexts)&&e.contexts.forEach(e=>{t.brush(e).end()})}),this.state={start:{x:0,y:0},end:{x:0,y:0},active:!1},this.renderer.render([]))}};function ah(e,t,n){let i=n.renderer,r=n.style,o=n.props,s=n.h;const a=function(e,t){return{tooltip:"function"==typeof e.tooltipClass?e.tooltipClass({dock:t.dock}):e.tooltipClass,content:"function"==typeof e.contentClass?e.contentClass({dock:t.dock}):e.contentClass,arrow:"function"==typeof e.arrowClass?e.arrowClass({dock:t.dock}):e.arrowClass}}(o,t),l=function(e,t,n,i){return i.content({h:e,style:n,data:t})}(s,e,r,o),c=s("div",{dir:o.direction,class:Pu(u({"pic-tooltip":!0},a.tooltip)),style:u({position:"relative",display:"inline-block"},t.computedTooltipStyle)},s("div",{style:r.content,class:Pu(u({"pic-tooltip-content":!0},a.content))},l),s("div",{class:Pu(u({"pic-tooltip-arrow":!0},a.arrow)),style:u({},r.arrow,r["arrow-".concat(t.dock)],t.computedArrowStyle)}));return i.render(c),i.element().children[0]}function lh(e){let t=e.defaultDuration,n=e.defaultDelay,i=null,r=null,o=!1;const s=function(){const e=function(){},t={pending:[],debounced:[],active:[],cancelled:[],rejected:[],fulfilled:[]};let n;return e.set=e=>{n=e,t[n].forEach(t=>t(e))},e.on=(e,n)=>{Array.isArray(e)?e.forEach(e=>t[e].push(n)):t[e].push(n)},e.destroy=()=>{Object.keys(t).forEach(e=>{t[e].length=0})},e}(),a=function(){},l=()=>{i=null,r=null,o=!1,s.set("fulfilled")};return a.invoke=function(e){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n;i&&(clearTimeout(i),s.set("debounced")),s.set("pending"),i=setTimeout(()=>{e(),o=!0,i=null,s.set("active")},c),a>0&&(r&&clearTimeout(r),r=setTimeout(l,a+Math.max(c,0)))},a.clear=()=>{o?s.set("cancelled"):i&&(clearTimeout(i),s.set("rejected")),r&&clearTimeout(r),i=null,r=null,o=!1},a.on=(e,t)=>{s.on(e,t)},a.destroy=()=>{a.clear(),s.destroy()},a}function ch(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return{left:"translate(-100%,-50%) translateX(".concat(-e,"px)"),right:"translate(".concat(e,"px, -50%)"),top:"translate(-50%, -100%) translateY(".concat(-e,"px)"),bottom:"translate(-50%, ".concat(e,"px)"),inside:"translate(-50%, -50%)"}}function uh(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return{left:{x:-e-n,y:-t/2},right:{x:n,y:-t/2},top:{x:-e/2,y:-t-n},bottom:{x:-e/2,y:n},inside:{x:-e/2,y:-t/2}}}function hh(e,t){const n=e>0?"-":"+";return e=Math.abs(e),void 0===t&&(t=e),{left:{left:"100%",top:"calc(50% ".concat(n," ").concat(e,"px)"),borderWidth:"".concat(t,"px")},right:{left:"".concat(2*-e,"px"),top:"calc(50% ".concat(n," ").concat(e,"px)"),borderWidth:"".concat(t,"px")},top:{left:"calc(50% ".concat(n," ").concat(e,"px)"),top:"100%",borderWidth:"".concat(t,"px")},bottom:{left:"calc(50% ".concat(n," ").concat(e,"px)"),top:"".concat(2*-e,"px"),borderWidth:"".concat(t,"px")},inside:{left:"0px",top:"0px",borderWidth:"0px"}}}function dh(e,t,n,i,r,o){const s=t+o.x,a=n+o.y,l=r;return!(s<0||a<0)&&!(s+i>e.width||a+l>e.height)}function fh(e){let t=e.area,n=e.vx,i=e.vy,r=e.width,o=e.height,s=e.offset;const a=n+s.x,l=i+s.y,c=r,u=o;let h=a<0?-a:0,d=l<0?-l:0;return h+=a+c>t.width?-(a+c-t.width):0,d+=l+u>t.height?-(l+u-t.height):0,{x:h,y:d}}function ph(e){let t=e.options,n=e.pointer,i=e.width,r=e.height,o=e.dockOrder,s=e.x,a=e.y;const l=n.targetBounds,c=ch(t.offset),u=c[t.dock];if(u)return{computedTooltipStyle:{left:"".concat(s,"px"),top:"".concat(a,"px"),transform:u},computedArrowStyle:hh(t.offset)[t.dock],dock:t.dock};const h={width:"target"===t.area?l.width:window.innerWidth,height:"target"===t.area?l.height:window.innerHeight},d=uh(i,r,t.offset),f=[],p="target"===t.area?s:l.left+s,g="target"===t.area?a:l.top+a;for(let e=0;e<o.length;e+=1){const n=o[e],l=fh({area:h,vx:p,vy:g,width:i,height:r,offset:d[n]}),u={left:"".concat(s,"px"),top:"".concat(a,"px"),transform:c[n]},m=hh(t.offset)[n];0!==l.x&&(u.width="".concat(i-20-Math.abs(l.x),"px"),"top"!==n&&"bottom"!==n||(u.left="".concat(s+l.x,"px"),m.left="calc(50% ".concat(l.x>0?"-":"+"," ").concat(Math.abs(l.x),"px)")));const y={computedTooltipStyle:u,computedArrowStyle:m,dock:n,rect:{width:i,height:r}};if(0===l.x&&0===l.y)return y;y.offset=l,f.push(y)}return f.sort((e,t)=>Math.abs(e.offset.x)-Math.abs(t.offset.x)),f[0]}function gh(e,t,n){const i=e.key?n.component(e.key):n.componentsFromPoint({x:t.clientX,y:t.clientY})[0];if(!i)return{x:0,y:0,width:0,height:0,scaleRatio:{x:1,y:1}};const r=i.rect;return u({scaleRatio:r.scaleRatio},r.computedInner)}const mh={bounds:function(e){let t=e.resources,n=e.nodes,i=e.pointer,r=e.width,o=e.height,s=e.options;const a=i.targetBounds,l=t.getNodeBoundsRelativeToTarget(n[0]),c=l.x,u=l.y,h=l.width,d=l.height,f={left:{x:c,y:u+d/2},right:{x:c+h,y:u+d/2},top:{x:c+h/2,y:u},bottom:{x:c+h/2,y:u+d},inside:{x:c+h/2,y:u+d/2}},p=ch(s.offset),g=p[s.dock];if(g)return{computedTooltipStyle:{left:"".concat(f[s.dock].x,"px"),top:"".concat(f[s.dock].y,"px"),transform:g},computedArrowStyle:hh(s.offset)[s.dock],dock:s.dock};const m={width:"target"===s.area?a.width:window.innerWidth,height:"target"===s.area?a.height:window.innerHeight},y=uh(r,o,s.offset),x=["top","left","right","bottom","inside"];for(let e=0;e<x.length;e+=1){const t=x[e];if(dh(m,"target"===s.area?f[t].x:a.left+f[t].x,"target"===s.area?f[t].y:a.top+f[t].y,r,o,y[t]))return{computedTooltipStyle:{left:"".concat(f[t].x,"px"),top:"".concat(f[t].y,"px"),transform:p[t]},computedArrowStyle:hh(s.offset)[t],dock:t}}const v=function(e){let t=e.options,n=e.docks,i=e.dockOffsets,r=e.targetBounds,o=e.area,s=e.width;const a="top",l="target"===t.area?n[a].x:r.left+n[a].x,c=("target"===t.area?n[a].y:(r.top,n[a].y),i[a]),u=l+c.x,h=(c.y,s);let d=n.top.x;return u<0&&u+h>o.width||(u<0?d-=u:u+h>o.width&&(d-=u+h-o.width)),d}({options:s,docks:f,dockOffsets:y,targetBounds:a,area:m,width:r});return{computedTooltipStyle:{left:"".concat(v,"px"),top:"".concat(f.top.y,"px"),transform:p.top},computedArrowStyle:hh(s.offset+v-f.top.x,s.offset).top,dock:"top"}},pointer:function(e){let t=e.options,n=e.pointer,i=e.width,r=e.height;return ph({x:n.x,y:n.y,pointer:n,width:i,height:r,options:t,dockOrder:["top","left","right","bottom"]})},slice:function(e){let t=e.options,n=e.pointer,i=e.width,r=e.height,o=e.nodes,s=e.resources;const a=o[0],l=n.dx,c=n.dy,u=s.getComponentBoundsFromNode(a),h=l+u.x+u.width/2,d=c+u.y+u.height/2,f=a.desc.slice,p=f.start,g=f.end,m=f.outerRadius,y=(p+g)/2-Math.PI/2,x=2*Math.PI,v=(y%x+x)%x;let b=["top","left","right","bottom"];return"auto"===t.dock&&(b=v<=Math.PI/4||v>=7*Math.PI/4?["right","top","bottom","left"]:v<=3*Math.PI/4?["bottom","left","right","top"]:v<=5*Math.PI/4?["left","top","bottom","right"]:["top","left","right","bottom"]),ph({x:h+m*u.scaleRatio.x*Math.cos(v),y:d+m*u.scaleRatio.y*Math.sin(v),pointer:n,width:i,height:r,options:t,dockOrder:b})}};function yh(e,t){let n=e.width,i=e.height,r=t.chart,o=t.state,s=t.props;const a={resources:{formatter:r.formatter,scale:r.scale,component:r.component,getComponentBoundsFromNode:e=>gh(e,o.pointer,r),getNodeBoundsRelativeToTarget:e=>function(e,t,n){const i=gh(e,t,n),r=e.bounds;return{x:i.x+t.dx+r.x,y:i.y+t.dy+r.y,width:r.width,height:r.height}}(e,o.pointer,r)},nodes:o.activeNodes,pointer:o.pointer,width:n,height:i},l=typeof s.placement;if("object"===l&&"function"==typeof s.placement.fn)return s.placement.fn(a);let c={type:"pointer",offset:8,dock:"auto",area:"viewport"};"function"===l&&(c=u(c,s.placement(a))),"object"===l&&mh[s.placement.type]?c=u(c,s.placement):"string"===l&&mh[s.placement]&&(c=u(c,{type:s.placement})),a.options=c;const h=mh[c.type](a);let d=a.resources.getComponentBoundsFromNode(a.nodes[0]),f=d.x,p=d.y,g=d.width,m=d.height;return f+=a.pointer.dx,g+=f,p+=a.pointer.dy,m+=p,h.computedTooltipStyle.left="".concat(Math.min(Math.max(0,f,parseFloat(h.computedTooltipStyle.left)),g),"px"),h.computedTooltipStyle.top="".concat(Math.min(Math.max(0,p,parseFloat(h.computedTooltipStyle.top)),m),"px"),h}let xh;function vh(){xh=null}const bh={duration:8e3,delay:500,filter:e=>e.filter(e=>e.data&&void 0!==e.data.value),extract:e=>e.node.data.value,content:e=>{let t=e.h;return e.data.map(e=>t("div",{},e))},isEqual:(e,t)=>e.length&&e.length===t.length&&e.every((e,n)=>t[n]&&JSON.stringify(e.data)===JSON.stringify(t[n].data)),placement:{type:"pointer",dock:"auto",offset:8,area:"viewport"},tooltipClass:{},contentClass:{},arrowClass:{},direction:"ltr",appendTo:void 0,beforeShow:void 0,afterShow:void 0,beforeHide:void 0,onHide:void 0,afterHide:void 0};const wh={require:["chart","renderer"],defaultSettings:{settings:bh,style:{tooltip:{},content:{backgroundColor:"$gray-25",color:"$font-color--inverted",fontFamily:"$font-family",fontSize:"$font-size",lineHeight:"$line-height",borderRadius:"4px",padding:"8px",opacity:.9},arrow:{position:"absolute",width:"0px",height:"0px",borderStyle:"solid",color:"$gray-25",opacity:.9},"arrow-bottom":{borderTopColor:"transparent",borderLeftColor:"transparent",borderRightColor:"transparent"},"arrow-top":{borderBottomColor:"transparent",borderLeftColor:"transparent",borderRightColor:"transparent"},"arrow-right":{borderTopColor:"transparent",borderLeftColor:"transparent",borderBottomColor:"transparent"},"arrow-left":{borderTopColor:"transparent",borderBottomColor:"transparent",borderRightColor:"transparent"}}},renderer:"dom",on:{hide(){this.hide()},show(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.show(e,t)},prevent(e){this.prevent(e)}},hide(){this.dispatcher.clear(),this.state.activeNodes=[],this.state.pointer={}},show(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.nodes,r=n.duration,o=n.delay;!this.state.prevent&&this.state.targetElement&&(this.state.pointer=function(e,t){let n=t.chart,i=t.state,r=0,o=0;e.center?(r+=e.center.x,o+=e.center.y):(r+=e.clientX,o+=e.clientY);const s=n.element.getBoundingClientRect(),a=i.targetElement.getBoundingClientRect(),l=r,c=o,u=s.left-a.left,h=s.top-a.top,d=r-s.left,f=o-s.top;return r-=a.left,o-=a.top,{x:r,y:o,dx:u,dy:h,cx:d,cy:f,clientX:l,clientY:c,targetBounds:a,chartBounds:s}}(e,this),t=Array.isArray(i)?this.props.filter(i):this.props.filter(this.chart.shapesAt({x:this.state.pointer.cx,y:this.state.pointer.cy})),this.props.isEqual(this.state.activeNodes,t)||(this.dispatcher.clear(),this.state.activeNodes=t,this.state.activeNodes.length&&this.dispatcher.invoke(()=>this.invokeRenderer(this.state.activeNodes),r,o)))},prevent(e){this.state.prevent=!!e},init(e){this.state={activeNodes:[],pointer:{},targetElement:null,prevent:!1},this.props=e.settings,this.dispatcher=lh({defaultDuration:this.props.duration,defaultDelay:this.props.delay});const t=this.dispatcher.clear;this.dispatcher.on("pending",()=>{!function(e){xh&&xh!==e&&xh()}(t),xh=t,"function"==typeof this.props.beforeShow&&this.props.beforeShow.call(void 0,{resources:{formatter:this.chart.formatter,scale:this.chart.scale}})}),this.dispatcher.on(["cancelled","fulfilled"],()=>{const e={resources:{formatter:this.chart.formatter,scale:this.chart.scale}};"function"==typeof this.props.beforeHide&&this.props.beforeHide.call(void 0,u({element:this.state.tooltipElm},e)),"function"==typeof this.props.onHide?this.props.onHide.call(void 0,u({element:this.state.tooltipElm},e)):this.renderer.clear([]),"function"==typeof this.props.afterHide&&this.props.afterHide.call(void 0,e),xh===t&&(xh=null),this.state.tooltipElm=void 0}),this.dispatcher.on("active",()=>{"function"==typeof this.props.afterShow&&this.props.afterShow.call(void 0,{element:this.state.tooltipElm,resources:{formatter:this.chart.formatter,scale:this.chart.scale}})})},created(){this.init(this.settings)},beforeUpdate(e){let t=e.settings;this.dispatcher&&(this.dispatcher.destroy(),vh()),this.init(t)},render(e){return this.h=e,[]},beforeDestroy(){this.dispatcher.destroy(),vh()},appendTo(){if(this.props.appendTo){this.state.targetElement="function"==typeof this.props.appendTo?this.props.appendTo({resources:{formatter:this.chart.formatter,scale:this.chart.scale}}):this.props.appendTo;const e=this.state.targetElement.getBoundingClientRect(),t=e.width,n=e.height;this.renderer.destroy(),this.renderer.size({width:t,height:n}),this.renderer.appendTo(this.state.targetElement)}else this.state.targetElement=this.renderer.element()},mounted(){this.appendTo()},updated(){this.appendTo()},invokeRenderer(e){const t=function(e,t){let n=t.chart,i=t.scale,r=t.props,o=t.h;const s={resources:{dataset:n.dataset,scale:n.scale,formatter:n.formatter},scale:i,h:o},a=[];return e.forEach(e=>{if("function"==typeof r.extract){const t=u({node:e},s);a.push(r.extract(t))}}),a}(e,this),n=yh(ah(t,{},this).getBoundingClientRect(),this);this.state.tooltipElm=ah(t,n,this)}};const kh={require:["renderer","chart"],defaultSettings:{settings:{target:"",selector:"*",fill:"rgba(0, 255, 0, 0.1)",stroke:"lime",opacity:1,useOuterRect:!1}},on:{update(){this.draw()}},draw(){const e=this.chart.findShapes(this.props.selector).filter(e=>e.key===this.props.target),t=e.filter(e=>e.collider).map(e=>e.collider);t.forEach(e=>{e.fill=this.props.fill,e.stroke=this.props.stroke,e.opacity=this.props.opacity,e.collider={type:null}}),this.renderer.render(t)},created(){this.props=this.settings.settings},resize(e){let t=e.outer,n=e.inner;return this.props.useOuterRect?t:n},render(){},mounted(){this.draw()},updated(){this.props=this.settings.settings,this.draw()}};var _h={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},Mh=/([astvzqmhlc])([^astvzqmhlc]*)/gi,Sh=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;function Rh(e){const t=[],n=String(e).trim();return"M"!==n[0]&&"m"!==n[0]||n.replace(Mh,(e,n,i)=>{const r=function(e){const t=e.match(Sh);return t?t.map(Number):[]}(i);let o=n.toLowerCase(),s=n;if("m"===o&&r.length>2&&(t.push([s,...r.splice(0,2)]),o="l",s="m"===s?"l":"L"),r.length<_h[o])return"";for(t.push([s,...r.splice(0,_h[o])]);r.length>=_h[o]&&r.length&&_h[o];)t.push([s,...r.splice(0,_h[o])]);return""}),t}const Ch=2*Math.PI;function Nh(e,t){return{x:.5*(e.x+t.x),y:.5*(e.y+t.y)}}function Dh(e,t,n,i,r){const o=1-e;return o**3*t+3*o**2*e*n+3*o*e**2*i+e**3*r}function qh(e,t,n,i){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:8;if(o<1||function(e,t,n,i){return Math.abs(e.x+n.x-(t.x+t.x))+Math.abs(e.y+n.y-(t.y+t.y))+Math.abs(t.x+i.x-(n.x+n.x))+Math.abs(t.y+i.y-(n.y+n.y))}(e,t,n,i)<=10)return r[r.length-1]!==e&&r.push(e),r.push(i),r;const s=Nh(e,t),a=Nh(t,n),l=Nh(n,i),c={x:Dh(.5,e.x,t.x,n.x,i.x),y:Dh(.5,e.y,t.y,n.y,i.y)},u=Nh(s,a),h=Nh(a,l);return qh(e,s,u,c,r,o-1),qh(c,h,l,i,r,o-1),r}function Eh(e,t,n){const i=function(e,t,n){return{cp1:{x:e.x+2/3*(t.x-e.x),y:e.y+2/3*(t.y-e.y)},cp2:{x:n.x+2/3*(t.x-n.x),y:n.y+2/3*(t.y-n.y)}}}(e,t,n);return qh(e,i.cp1,i.cp2,n)}function zh(e,t,n){const i=[],r=!!e[4],o=!!e[5],s=e[3];let a,l,c,u,h=e[6],d=e[7],f=e[1],p=e[2];if("a"===e[0]&&(h+=t,d+=n),t===d&&n===d)return i;if(!f||!p)return i.push({x:h,y:d}),i;var g=function(e,t,n,i,r,o,s,a,l){let c,u,h,d,f,p;const g=Jo(n%360),m=Math.cos(g),y=Math.sin(g),x=(a-o)/2,v=(l-s)/2,b=m*x+y*v,w=m*v-y*x;p=b**2/(e=Math.abs(e))**2+w**2/(t=Math.abs(t))**2,p>1&&(p=Math.sqrt(p),e*=p,t*=p);const k=e*w,_=t*b,M=k**2+_**2,S=(e*t)**2-M;let R=Math.sqrt(Math.max(S/M,0));i===r&&(R=-R);const C=R*(k/t),N=R*(-_/e);d=m*C-y*N+(a+o)/2,f=y*C+m*N+(l+s)/2;const D=(b-C)/e,q=(w-N)/t,E=(-b-C)/e,z=(-w-N)/t;return c=Math.atan2(q,D),c+=c<0?Ch:0,u=Math.atan2(z,E),u+=u<0?Ch:0,h=u-c,!r&&c<u?h-=Ch:r&&u<c&&(h+=Ch),h%=Ch,{startAngle:c,sweepAngle:h,cx:d,cy:f,rx:e,ry:t}}(f,p,s,r,o,h,d,t,n);a=g.cx,l=g.cy,f=g.rx,p=g.ry,c=g.sweepAngle,u=g.startAngle;const m=Math.abs(c*Math.sqrt((f**2+p**2)/2)),y=Math.ceil(m/10),x=c/y;for(let e=1;e<=y;e++){const t=(u+x*e)%Ch,n=Math.cos(t),r=Math.sin(t);i.push({x:a+n*f+-r*n,y:l+r*p+n*r})}return i}function Ah(e){const t=Rh(e),n=[],i=[];let r=0,o=0,s=null,a=null,l=null,c=null;for(let e=0;e<t.length;++e){const u=t[e],h=u[0];switch("S"!==h&&"s"!==h&&"C"!==h&&"c"!==h&&(s=null,a=null),"T"!==h&&"t"!==h&&"Q"!==h&&"q"!==h&&(l=null,c=null),h){case"m":i.length&&n.push(i.splice(0));case"l":r+=u[1],o+=u[2],i.push({x:r,y:o});break;case"M":i.length&&n.push(i.splice(0));case"L":r=u[1],o=u[2],i.push({x:r,y:o});break;case"H":r=u[1],i.push({x:r,y:o});break;case"h":r+=u[1],i.push({x:r,y:o});break;case"V":o=u[1],i.push({x:r,y:o});break;case"v":o+=u[1],i.push({x:r,y:o});break;case"a":i.push(...zh(u,r,o)),r+=u[6],o+=u[7];break;case"A":i.push(...zh(u,r,o)),r=u[6],o=u[7];break;case"c":i.push(...qh({x:r,y:o},{x:u[1]+r,y:u[2]+o},{x:u[3]+r,y:u[4]+o},{x:u[5]+r,y:u[6]+o})),s=u[3]+r,a=u[4]+o,r+=u[5],o+=u[6];break;case"C":i.push(...qh({x:r,y:o},{x:u[1],y:u[2]},{x:u[3],y:u[4]},{x:u[5],y:u[6]})),s=u[3],a=u[4],r=u[5],o=u[6];break;case"s":null!==s&&null!==s||(s=r,a=o),i.push(...qh({x:r,y:o},{x:2*r-s,y:2*o-a},{x:u[1]+r,y:u[2]+o},{x:u[3]+r,y:u[4]+o})),s=u[1]+r,a=u[2]+o,r+=u[3],o+=u[4];break;case"S":null!==s&&null!==s||(s=r,a=o),i.push(...qh({x:r,y:o},{x:2*r-s,y:2*o-a},{x:u[1],y:u[2]},{x:u[3],y:u[4]})),s=u[1],a=u[2],r=u[3],o=u[4];break;case"Q":i.push(...Eh({x:r,y:o},{x:u[1],y:u[2]},{x:u[3],y:u[4]})),l=u[1],c=u[2],r=u[3],o=u[4];break;case"q":i.push(...Eh({x:r,y:o},{x:u[1]+r,y:u[2]+o},{x:u[3]+r,y:u[4]+o})),l=u[1]+r,c=u[2]+o,r+=u[3],o+=u[4];break;case"T":null!==l&&null!==l||(l=r,c=o),l=2*r-l,c=2*o-c,i.push(...Eh({x:r,y:o},{x:l,y:c},{x:u[1],y:u[2]})),r=u[1],o=u[2];break;case"t":null!==l&&null!==l||(l=r,c=o),l=2*r-l,c=2*o-c,i.push(...Eh({x:r,y:o},{x:l,y:c},{x:u[1]+r,y:u[2]+o})),r+=u[1],o+=u[2];break;case"z":case"Z":i.length&&i.push({x:i[0].x,y:i[0].y})}}return function(e){for(let t=0;t<e.length-1;t++){const n=e[t],i=e[t+1];Math.abs(n.x-i.x)<1e-12&&Math.abs(n.y-i.y)<1e-12&&(e.splice(t,1),t--)}}(i),n.push(i.splice(0)),n}const Oh={require:["renderer","chart"],defaultSettings:{settings:{target:"",fill:"transparent",stroke:"lime",opacity:1,radius:2,useOuterRect:!1}},on:{update(){this.draw()}},draw(){const e=this.chart.findShapes("path").filter(e=>e.key===this.props.target),t=[];e.forEach(e=>{Ah(e.attrs.d).forEach(e=>{e.forEach(e=>{t.push({type:"circle",cx:e.x,cy:e.y,r:this.props.radius,fill:this.props.fill,stroke:this.props.stroke,opacity:this.props.opacity,collider:{type:null}})})})}),this.renderer.render(t)},created(){this.props=this.settings.settings},resize(e){let t=e.outer,n=e.inner;return this.props.useOuterRect?t:n},render(){},mounted(){this.draw()},updated(){this.props=this.settings.settings,this.draw()}};var Th=[function(e){e.component("box",Ia),e.component("box-marker",Ia)},function(e){e.component("point",Wa),e.component("point-marker",Wa)},function(e){e.component("pie",Ka)},function(e){e.component("grid-line",Qa)},function(e){e.component("ref-line",ul)},function(e){e.component("axis",Fl)},function(e){e.component("container",Ll)},function(e){e.component("text",Hl)},function(e){e.component("scrollbar",Ul)},function(e){e.component("brush-range",ac),e.component("brush-area-dir",hc)},function(e){e.component("range",gc)},function(e){e.component("brush-lasso",wc)},function(e){e.component("labels",Au)},function(e){e.component("legend-cat",Uu)},function(e){e.component("legend-seq",Zu)},function(e){e.component("line",nh)},function(e){e.component("brush-area",sh)},function(e){e.component("tooltip",wh)},function(e){e.component("debug-collider",kh)},function(e){e.component("debug-path-to-points",Oh)}];let Ih=class{constructor(e){this._parent=null,this._children=[],this._ancestors=null,this.type=e,this.data=null}detach(){return this._parent&&this._parent.removeChild(this),this}get parent(){return this._parent}get isBranch(){return this._children&&this._children.length}get children(){return this._children}get ancestors(){return this._ancestors||(this._ancestors=[],this.parent&&this._ancestors.push(this.parent,...this.parent.ancestors)),this._ancestors}get descendants(){let e=[];const t=this.children.length;let n,i;for(n=0;n<t;n++)i=this.children[n],e.push(i),i.children.length&&(e=[...e,...i.descendants]);return e}equals(e){const t=this.children,n=e.children;if(t.length!==n.length)return!1;for(let e=0;e<t.length;e++)if(!t[e].equals(n[e]))return!1;return!0}toJSON(){return{type:this.type,children:this.children.map(e=>e.toJSON())}}};class jh{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.x,n=void 0===t?0:t,i=e.y,r=void 0===i?0:i,o=e.width,s=void 0===o?0:o,a=e.height,l=void 0===a?0:a,c=e.minWidth,u=void 0===c?0:c,h=e.minHeight,d=void 0===h?0:h;this.set({x:n,y:r,width:s,height:l,minWidth:u,minHeight:d})}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.x,n=void 0===t?0:t,i=e.y,r=void 0===i?0:i,o=e.width,s=void 0===o?0:o,a=e.height,l=void 0===a?0:a,c=e.minWidth,u=void 0===c?0:c,h=e.minHeight,d=void 0===h?0:h;this.type="rect",s>=0?(this.x=n,this.width=Math.max(s,u)):(this.x=n+Math.min(s,-u),this.width=-Math.min(s,-u)),l>=0?(this.y=r,this.height=Math.max(l,d)):(this.y=r+Math.min(l,-d),this.height=-Math.min(l,-d))}containsPoint(e){return Is(this,e)}intersectsLine(e){return js(this,M(e))}intersectsRect(e){return Os(this,_(e))}intersectsCircle(e){return Ns(e,this)}intersectsPolygon(e){return As(e,this)}intersectsGeoPolygon(e){return Vs(e,this)}points(){return[{x:this.x,y:this.y},{x:this.x+this.width,y:this.y},{x:this.x+this.width,y:this.y+this.height},{x:this.x,y:this.y+this.height}]}}class Ph{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.cx,n=void 0===t?0:t,i=e.cy,r=void 0===i?0:i,o=e.r,s=void 0===o?0:o,a=e.minRadius,l=void 0===a?0:a;this.set({cx:n,cy:r,r:s,minRadius:l})}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.cx,n=void 0===t?0:t,i=e.cy,r=void 0===i?0:i,o=e.r,s=void 0===o?0:o,a=e.minRadius,l=void 0===a?0:a;this.type="circle",this.cx=n,this.cy=r,this.r=Math.max(s,l),this.vector={x:this.cx,y:this.cy}}containsPoint(e){return Cs(this,e)}intersectsLine(e){return Ds(this,M(e))}intersectsRect(e){return Ns(this,_(e))}intersectsCircle(e){return n=e,!_s(t=this)&&!_s(n)&&(t.cx-n.cx)**2+(t.cy-n.cy)**2<=(t.r+n.r)**2;var t,n}intersectsPolygon(e){return qs(this,e)}intersectsGeoPolygon(e){return Bs(this,e)}points(){return[{x:this.cx,y:this.cy}]}}class Fh{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.x1,n=void 0===t?0:t,i=e.y1,r=void 0===i?0:i,o=e.x2,s=void 0===o?0:o,a=e.y2,l=void 0===a?0:a,c=e.tolerance,u=void 0===c?0:c;this.set({x1:n,y1:r,x2:s,y2:l,tolerance:u})}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.x1,n=void 0===t?0:t,i=e.y1,r=void 0===i?0:i,o=e.x2,s=void 0===o?0:o,a=e.y2,l=void 0===a?0:a,c=e.tolerance,u=void 0===c?0:c;this.type="line",this.x1=n,this.y1=r,this.x2=s,this.y2=l,this.tolerance=Math.max(0,Math.round(u)),this.vectors=this.points(),this.zeroSize=n===s&&r===l}containsPoint(e){if(this.tolerance>0){return Ds({cx:e.x,cy:e.y,r:this.tolerance},this)}return Fs(this,e)}intersectsLine(e){return Ps(this,M(e))}intersectsRect(e){return js(_(e),this)}intersectsCircle(e){return Ds(e,this)}intersectsPolygon(e){return zs(e,this)}intersectsGeoPolygon(e){return Ws(e,this)}points(){return[{x:this.x1,y:this.y1},{x:this.x2,y:this.y2}]}}class Lh{constructor(){let e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).vertices,t=void 0===e?[]:e;this.set({vertices:t})}set(){let e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).vertices,t=void 0===e?[]:e;if(this.type="polygon",this.vertices=t.slice(),this.edges=[],function(e){for(let t=0;t<e.length-1;t++){const n=e[t],i=e[t+1];n.x===i.x&&n.y===i.y&&(e.splice(t,1),t--)}}(this.vertices),!(this.vertices.length<=2)){!function(e){const t=e[0],n=e[e.length-1];t.x===n.x&&t.y===n.y||e.push(t)}(this.vertices),this.xMin=NaN,this.yMin=NaN,this.xMax=NaN,this.yMax=NaN;for(let e=0;e<this.vertices.length;e++)e<this.vertices.length-1&&this.edges.push([this.vertices[e],this.vertices[e+1]]),this.xMin=isNaN(this.xMin)?this.vertices[e].x:Math.min(this.xMin,this.vertices[e].x),this.xMax=isNaN(this.xMax)?this.vertices[e].x:Math.max(this.xMax,this.vertices[e].x),this.yMin=isNaN(this.yMin)?this.vertices[e].y:Math.min(this.yMin,this.vertices[e].y),this.yMax=isNaN(this.yMax)?this.vertices[e].y:Math.max(this.yMax,this.vertices[e].y);this._bounds=null,this._boundingRect=null}}containsPoint(e){return Es(this,e)}intersectsCircle(e){return qs(e,this)}intersectsLine(e){return zs(this,M(e))}intersectsRect(e){return As(this,_(e))}intersectsPolygon(e){return Ls(this,e)}intersectsGeoPolygon(e){return $s(e,this)}points(){return this.vertices}bounds(){return this._bounds||(this._bounds=[{x:this.xMin,y:this.yMin},{x:this.xMax,y:this.yMin},{x:this.xMax,y:this.yMax},{x:this.xMin,y:this.yMax}]),this._bounds}boundingRect(){return this._boundingRect||(this._boundingRect={x:this.xMin,y:this.yMin,width:this.xMax-this.xMin,height:this.yMax-this.yMin}),this._boundingRect}}function $h(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Lh(...t)}function Bh(e){const t=e[0],n=e[e.length-1];t.x===n.x&&t.y===n.y||e.push(t)}function Hh(e){for(let t=0;t<e.length-1;t++){const n=e[t],i=e[t+1];n.x===i.x&&n.y===i.y&&(e.splice(t,1),t--)}}class Wh{constructor(){let e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).vertices,t=void 0===e?[[]]:e;this.set({vertices:t})}set(){let e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).vertices,t=void 0===e?[]:e;this.type="geopolygon",this.vertices=t.slice(),this.numPolygons=this.vertices.length,this.polygons=[],this.xMin=NaN,this.yMin=NaN,this.xMax=NaN,this.yMax=NaN;for(let e=0;e<this.numPolygons;e++)Hh(this.vertices[e]),this.vertices[e].length>2&&Bh(this.vertices[e]),this.polygons[e]=$h({vertices:this.vertices[e]}),this.xMin=isNaN(this.xMin)?this.polygons[e].xMin:Math.min(this.xMin,this.polygons[e].xMin),this.xMax=isNaN(this.xMax)?this.polygons[e].xMax:Math.max(this.xMax,this.polygons[e].xMax),this.yMin=isNaN(this.yMin)?this.polygons[e].yMin:Math.min(this.yMin,this.polygons[e].yMin),this.yMax=isNaN(this.yMax)?this.polygons[e].yMax:Math.max(this.yMax,this.polygons[e].yMax);this._bounds=null,this._boundingRect=null}containsPoint(e){return Hs(this,e)}intersectsCircle(e){return Bs(e,this)}intersectsLine(e){return Ws(this,M(e))}intersectsRect(e){return Vs(this,_(e))}intersectsPolygon(e){return $s(this,e)}intersectsGeoPolygon(e){return function(e,t){const n=e.boundingRect(),i=t.boundingRect();return!!Os(n,i)&&(Ts(i,n)?Rs(t,e):Rs(e,t))}(this,e)}points(){return this.vertices}bounds(){return this._bounds||(this._bounds=[{x:this.xMin,y:this.yMin},{x:this.xMax,y:this.yMin},{x:this.xMax,y:this.yMax},{x:this.xMin,y:this.yMax}]),this._bounds}boundingRect(){return this._boundingRect||(this._boundingRect={x:this.xMin,y:this.yMin,width:this.xMax-this.xMin,height:this.yMax-this.yMin}),this._boundingRect}}function Vh(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Wh(...t)}function Uh(e,t){return e.x!==t.x||e.y!==t.y}class Yh{constructor(){let e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).points,t=void 0===e?[]:e;this.set({points:t})}set(){let e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).points,t=void 0===e?[]:e;if(this.type="polyline",this.segments=[],this._points=t.slice(),this._points.length>1)for(let e=0,t=this._points.length-1;e<t;e++)Uh(this._points[e],this._points[e+1])&&this.segments.push({x1:this._points[e].x,y1:this._points[e].y,x2:this._points[e+1].x,y2:this._points[e+1].y})}containsPoint(e){return this.segments.some(t=>Fs(t,e))}intersectsCircle(e){return this.segments.some(t=>Ds(e,t))}intersectsLine(e){const t=M(e);return this.segments.some(e=>Ps(e,t))}intersectsRect(e){const t=_(e);return this.segments.some(e=>js(t,e))}intersectsPolygon(e){return this.segments.some(t=>zs(e,t))}intersectsGeoPolygon(e){return this.segments.some(t=>Ws(e,t))}points(){return this._points}}const Kh=Ee();function Xh(e,t){return Kh.get(e)(t)}Kh.add("rect",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new jh(...t)}),Kh.add("circle",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Ph(...t)}),Kh.add("line",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Fh(...t)}),Kh.add("polygon",$h),Kh.add("geopolygon",Vh),Kh.add("polyline",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Yh(...t)});class Gh{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.set(e)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.geometries=[],e.forEach(e=>{const t=Xh(e.type,e);t&&this.geometries.push(t)})}containsPoint(e){return this.geometries.some(t=>t.containsPoint(e))}intersectsLine(e){return this.geometries.some(t=>t.intersectsLine(e))}intersectsRect(e){return this.geometries.some(t=>t.intersectsRect(e))}intersectsCircle(e){return this.geometries.some(t=>t.intersectsCircle(e))}intersectsPolygon(e){return this.geometries.some(t=>t.intersectsPolygon(e))}intersectsGeoPolygon(e){return this.geometries.some(t=>t.intersectsGeoPolygon(e))}}class Jh{constructor(){this._elements=[[1,0,0],[0,1,0],[0,0,1]],this._stack=[]}clone(){return(new Jh).multiply(this)}set(e){return this._elements=e,this}save(){return this._stack.push(this.elements),this}restore(){return this._stack.length&&(this._elements=this._stack.pop()),this}add(e){let t,n;for(t=0;t<this._elements.length;t++)for(n=0;n<this._elements[t].length;n++)this._elements[t][n]+=e;return this}translate(e,t){return this.multiply([[1,0,e],[0,1,t],[0,0,1]]),this}rotate(e){let t=Math.cos(-e),n=Math.sin(-e);return this.multiply([[t,n,0],[-n,t,0],[0,0,1]]),this}multiply(e){let t,n,i,r;if(e instanceof Jh&&(e=e._elements),Array.isArray(e)){for(i=[[0,0,0],[0,0,0],[0,0,0]],t=0;t<this._elements.length;t++)for(n=0;n<this._elements[t].length;n++)for(r=0;r<3;r++)i[t][n]+=this._elements[t][r]*e[r][n];this._elements=i}else for(t=0;t<this._elements.length;t++)for(n=0;n<this._elements[t].length;n++)this._elements[t][n]*=e;return this}scale(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return this.multiply([[e,0,0],[0,t,0],[0,0,1]]),this}transform(e,t,n,i,r,o){return this.multiply([[e,n,r],[t,i,o],[0,0,1]]),this}determinant(){let e=this._elements[0][0],t=this._elements[0][1],n=this._elements[0][2],i=this._elements[1][0],r=this._elements[1][1],o=this._elements[1][2],s=this._elements[2][0],a=this._elements[2][1],l=this._elements[2][2],c=0;return c=e*r*l+t*o*s+n*i*a-n*r*s-t*i*l-e*o*a,c}invert(){let e=this.determinant(),t=this._elements[0][0],n=this._elements[0][1],i=this._elements[0][2],r=this._elements[1][0],o=this._elements[1][1],s=this._elements[1][2],a=this._elements[2][0],l=this._elements[2][1],c=this._elements[2][2];return this._elements=[[o*c-s*l,i*l-n*c,n*s-i*o],[s*a-r*c,t*c-i*a,i*r-t*s],[r*l-o*a,a*n-t*l,t*o-n*r]],this.multiply(1/e),this}transpose(){const e=Object.create(this._elements);return this._elements=[[e[0][0],e[1][0],e[2][0]],[e[0][1],e[1][1],e[2][1]],[e[0][2],e[1][2],e[2][2]]],this}identity(){return this._elements=[[1,0,0],[0,1,0],[0,0,1]],this}toString(){return"".concat(this._elements.map(e=>e.join("\t")).join("\n"))}isIdentity(){const e=this._elements;return 1===e[0][0]&&0===e[0][1]&&0===e[0][2]&&0===e[1][0]&&1===e[1][1]&&0===e[1][2]&&0===e[2][0]&&0===e[2][1]&&1===e[2][2]}transformPoint(e){let t,n,i=[e.x,e.y,1],r=this._elements,o=[0,0,0];for(t=0;t<this._elements.length;t++)for(n=0;n<this._elements[t].length;n++)o[t]+=i[n]*r[t][n];return{x:o[0],y:o[1]}}transformPoints(e){let t,n,i,r,o,s=this._elements,a=[];for(r=0;r<e.length;r++){for(t=[e[r].x,e[r].y,1],o=[0,0,0],n=0;n<this._elements.length;n++)for(i=0;i<this._elements[n].length;i++)o[n]+=t[i]*s[n][i];a.push({x:o[0],y:o[1]})}return a}get elements(){const e=this._elements;return[[e[0][0],e[0][1],e[0][2]],[e[1][0],e[1][1],e[1][2]],[e[2][0],e[2][1],e[2][2]]]}}const Zh=/(translate|scale|rotate|matrix)\(([0-9,.eE+-\s]+)(?:,|\s?)+\)/g;function Qh(e,t){const n=t.args[0]*(Math.PI/180);if(t.args.length>2){const i=t.args[1],r=t.args[2];e.translate(i,r),e.rotate(n),e.translate(-i,-r)}else 1===t.args.length&&e.rotate(n)}function ed(e,t){const n=t.args[0],i=isNaN(t.args[1])?t.args[0]:t.args[1];e.scale(n,i)}function td(e,t){const n=t.args[0],i=isNaN(t.args[1])?0:t.args[1];e.translate(n,i)}function nd(e,t){t.args.length>=6&&e.transform(...t.args)}function id(e,t){const n=function(e){let t,n=[];for(;null!==(t=Zh.exec(e));){const e=t[2].trim(),i=-1===e.indexOf(",")?e.split(" "):e.split(",");n.push({cmd:t[1],args:i.filter(e=>e.trim().length>0).map(e=>Number(e))})}return n}(e);let i;for(let e=0,r=n.length;e<r;e++)i=n[e],"rotate"===i.cmd?Qh(t,i):"scale"===i.cmd?ed(t,i):"matrix"===i.cmd?nd(t,i):"translate"===i.cmd&&td(t,i)}const rd={type:/^\w[\w-]+/,attr:/^\[\w(?:[\w\._-]+)?(?:[!]?=['\"][\w\s*#_-]*['\"])?\]/,universal:/^(\*)/,tag:/^\.(\w+)/},od={type:(e,t)=>t.filter(t=>{const n=t.type;return!!n&&n.toLowerCase()===e.toLowerCase()}),attr:(e,t,n,i)=>i.filter(i=>{const r=i.attrs[e];if(!t)return void 0!==r;if(void 0===r)return!1;switch(t){case"=":return n===String(r);case"!=":return n!==String(r);default:return!1}}),universal:e=>e,tag:(e,t)=>t.filter(t=>{const n=t.tag;return!!n&&-1!==n.trim().split(/\s+/).indexOf(e.replace(".",""))})};function sd(e,t){if(!t||!t.length||!e||"function"!=typeof od[e.type])return[];switch(e.type){case"type":case"tag":return od[e.type](e.value,t);case"attr":return od[e.type](e.attribute,e.operator,e.attributeValue,t);case"universal":return od[e.type](t);default:return[]}}var ad={find:function(e,t){const n=[],i=[];let r,o;if(t.isBranch){let s;r=function(e){const t=[];let n,i,r,o;return e.split(/\s*,\s*/).forEach(e=>{e=e.trim(),n=[];const s=t=>{r=e.match(rd[t]),r&&(o=!0,e=e.slice(r[0].length),i={type:t,value:r[0]},"attr"===t&&(r=r[0].match(/\[(\w[\w\._-]+)?(?:([!]?=)['\"]([\w\s#_-]*)['\"])?\]/),i.attribute=r[1],i.operator=r[2],i.attributeValue=r[3]),n.push(i))};for(;e&&(o=!1,r=e.match(/^\s*([>+~]|\s)\s*/),r&&(o=!0,n.push({type:" ",value:r[0]}),e=e.slice(r[0].length)),Object.keys(rd).forEach(s),n&&n.length&&t.indexOf(n)<0&&t.push(n),o););}),t}(e),o=t.descendants;for(let e=0,t=r.length;e<t;e++){s=r[e];const t=[];let n=o.slice(),a=!1;s.reverse().forEach(e=>{if(" "===e.type)return t.push(n),n=o.slice(),void(a=!1);n=sd(e,n),a=!0}),a&&t.push(n);const l=t[0].filter(e=>{let n,i=e.parent;for(let e=1;e<t.length;e++){for(n=t[e].indexOf(i);i&&n<0;)i=i.parent,n=t[e].indexOf(i);if(n<0)return!1}return!0});i.push(l)}for(let e=0,t=i.length;e<t;e++)for(let t=0,r=i[e].length;t<r;t++)n.indexOf(i[e][t])<0&&n.push(i[e][t])}return n||[]}};function ld(e,t,n){const i=e.type;let r=e.points();n&&(r=r.every(e=>Array.isArray(e))?r.map(e=>n.transformPoints(e)):n.transformPoints(r)),function(e,t){for(let n=0,i=e.length;n<i;n++)e[n].x/=t,e[n].y/=t}(r,t);let o=null;if("rect"===i||"bounds"===i)o=_(r),o.type=i;else if("circle"===i)o=function(e,t){return{cx:e[0].x,cy:e[0].y,r:t}}(r,e.r),o.type=i;else if("line"===i)o=M(r),o.type=i;else if("polygon"===i||"polyline"===i){o={type:"path",d:Xo(r,"polygon"===i)}}else if("geopolygon"===i){let e="";for(let t=0;t<r.length;t++)e+=Xo(r[t],!0);o={type:"path",d:e}}return o}class cd{constructor(e){this._bounds=function(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const n=e.boundingRect?e.boundingRect(t):{x:0,y:0,width:0,height:0};return{x:n.x,y:n.y,width:n.width,height:n.height}},this._attrs=e.attrs,this._type=e.type,this._data=e.data,this._dpi=e.stage?e.stage.dpi:1,this._collider=()=>function(e,t){if(e.collider){const n=e.modelViewMatrix;return"collection"===e.colliderType?{type:"container",children:e.collider.geometries.map(e=>ld(e,t,n))}:ld(e.collider,t,n)}return null}(e,this._dpi),this._desc=e.desc,this._tag=e.tag,this._children=()=>e.children.map(e=>new cd(e)),this._parent=()=>e.parent?new cd(e.parent):null,this._cache={elementBoundingRect:null},this._getElementBoundingRect=()=>(!this._cache.elementBoundingRect&&this.element&&(this._cache.elementBoundingRect=this.element.getBoundingClientRect()),this._cache.elementBoundingRect||{left:0,top:0})}get children(){return this._children()}get parent(){return this._parent()}get type(){return this._type}get data(){return this._data}get attrs(){return this._attrs}set element(e){this._cache.elementBoundingRect=null,this._element=e}get element(){return this._element}set key(e){this._key=e}get key(){return this._key}get bounds(){const e=this._bounds();return e.x/=this._dpi,e.y/=this._dpi,e.width/=this._dpi,e.height/=this._dpi,e}get localBounds(){return this._bounds(!1)}boundsRelativeTo(e){const t=typeof e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1]?this.bounds:this.localBounds,i=this._getElementBoundingRect();let r=i.left,o=i.top;if("object"===t&&null!==e&&"function"==typeof e.getBoundingClientRect){const t=e.getBoundingClientRect(),n=t.left,i=void 0===n?0:n,s=t.top;r-=i,o-=void 0===s?0:s}return n.x+=r,n.y+=o,n}get collider(){return this._collider()}get desc(){return this._desc}get tag(){return this._tag}}function ud(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new cd(...t)}class hd{constructor(e){this._node=ud(e),this._parent=null,this._input=null}get node(){return this._node}set parent(e){this._parent=e}get parent(){return this._parent}set input(e){this._input=e}get input(){return this._input}}function dd(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new hd(...t)}function fd(e,t){const n=e.parent;if(n&&"stage"!==n.type){t.parent=dd(n);const e=n.parent;e&&"stage"!==e.type&&fd(e,t.parent)}}function pd(e,t,n){if(null===e.colliderType)return null;const i=function(e,t){let n={};if(e.modelViewMatrix)if(Array.isArray(t))n=e.inverseModelViewMatrix.transformPoints(t);else if(isNaN(t.r))Array.isArray(t.vertices)?n.vertices=e.inverseModelViewMatrix.transformPoints(t.vertices):n=e.inverseModelViewMatrix.transformPoint(t);else{const r={x:t.cx,y:t.cy};var i=e.inverseModelViewMatrix.transformPoint(r);n.cx=i.x,n.cy=i.y,n.r=t.r}else n=t;return Array.isArray(n.vertices)&&(n=n.vertices.every(e=>Array.isArray(e))?Vh(n):$h(n)),n}(e,n);return"frontChild"===e.colliderType?function(e,t,n){for(let i=e.descendants.length-1;i>=0;i--){const r=e.descendants[i];if(null!==r.collider&&r.collider[t](n)){const e=dd(r);return fd(r,e),e}}return null}(e,t,i):function(e,t,n){if(e.collider[t](n)){const t=dd(e);return fd(e,t),t}return null}(e,t,i)}function gd(e,t,n,i){const r=e.length;for(let o=0;o<r;o++){const r=e[o],s=pd(r,t,i);s&&n.push(s),!r.children||s||r.collider||gd(r.children,t,n,i)}}function md(e,t,n){const i=e.length;for(let r=0;r<i;r++){const i=e[r];if(null!==pd(i,t,n))return!0;if(i.children&&!i.collider)return md(i.children,t,n)}return!1}function yd(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;let n={};switch(S(e)){case"circle":return n.cx=e.cx*t,n.cy=e.cy*t,n.r=e.r,["intersectsCircle",n];case"rect":return n=k(e).map(e=>ts(e,t)),["intersectsRect",n];case"line":return n=w(e).map(e=>ts(e,t)),["intersectsLine",n];case"point":return n=ts(e,t),["containsPoint",n];case"polygon":return n.vertices=e.vertices.map(e=>ts(e,t)),["intersectsPolygon",n];case"geopolygon":return n.vertices=e.vertices.map(e=>e.map(e=>ts(e,t))),["intersectsGeoPolygon",n];default:return[]}}function xd(e,t){const n=m(yd(t,e.dpi),2),i=n[0],r=n[1],o=[];return i&&(gd([e],i,o,r),function(e,t){for(let n=0,i=t.length;n<i;n++)t[n].input=e}(t,o)),o}function vd(e,t){const n=m(yd(t,e.dpi),2);return md([e],n[0],n[1])}class bd extends Ih{constructor(e){super(e),this._stage=null,this._collider={type:null,definition:null,fn:null},this._attrs={},this._node=null}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.node=e;const t=e.data,n=e.desc,i=e.tag,r=e.strokeReference,o=e.fillReference;var s,a;s=this.attrs,a=e,Object.keys(Ko).forEach(e=>{const t=a[e];void 0!==t&&(s[Ko[e]]=t)}),void 0!==t&&(this.data=t),"object"==typeof n&&(this.desc=u(!0,{},n)),"string"==typeof i&&(this.tag=i),"string"==typeof r&&(this.strokeReference=r),"string"==typeof o&&(this.fillReference=o)}findShapes(e){return ad.find(e,this).map(e=>ud(e))}getItemsFrom(e){return xd(this,e)}containsPoint(e){return vd(this,e)}intersectsLine(e){return vd(this,e)}intersectsRect(e){return vd(this,e)}intersectsCircle(e){return vd(this,e)}intersectsPolygon(e){return vd(this,e)}intersectsGeoPolygon(e){return vd(this,e)}resolveLocalTransform(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Jh;void 0!==this.attrs.transform&&id(this.attrs.transform,e),this.modelViewMatrix=e.clone()}resolveGlobalTransform(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Jh;const t=this.ancestors;if(t.length>0)for(let n=t.length-1;n>=0;n--)t[n].resolveLocalTransform(e),e=t[n].modelViewMatrix;this.resolveLocalTransform(e)}attr(e){return this.attrs[e]}equals(e){const t=this.attrs,n=Object.keys(t),i=e.attrs,r=Object.keys(i);if(n.length!==r.length)return!1;for(let e=0;e<n.length;e++){const r=n[e];if(!Object.hasOwnProperty.call(i,r))return!1;if(t[r]!==i[r])return!1}return super.equals(e)}toJSON(){const e=super.toJSON();return e.attrs=this.attrs,e}get attrs(){return this._attrs}get stage(){return this._parent&&!this._stage?this._stage=this._parent.stage:this._parent||this._stage===this||(this._stage=null),this._stage}set modelViewMatrix(e){this._mvm=e,this._imvm=null}get modelViewMatrix(){return this._mvm}get inverseModelViewMatrix(){return this._imvm=this._imvm?this._imvm:this._mvm.clone().invert(),this._imvm}set node(e){this._node=e}get node(){return this._node}set collider(e){const t=Array.isArray(e)?"collection":e&&e.type;return"string"!=typeof t?(this._collider.type=null,this._collider.definition=null,void(this._collider.fn=null)):null!==this._collider&&this._collider.type===t&&null!==this._collider.fn?(this._collider.fn.set(e),void(this._collider.definition=e)):(this._collider.type=t,void(this._collider.definition=e))}get collider(){if(null!==this._collider.fn)return this._collider.fn;switch(this._collider.type){case"collection":this._collider.fn=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Gh(...t)}(this._collider.definition);break;case"frontChild":return!0;case"bounds":this._collider.fn=Xh("rect",this.boundingRect());break;case"line":case"rect":case"circle":case"polygon":case"geopolygon":case"polyline":this._collider.fn=Xh(this._collider.type,this._collider.definition);break;default:return null}return this._collider.fn}get colliderType(){return this._collider.type}}class wd extends Ih{addChild(e){if(!(e&&e instanceof Ih))throw new TypeError("Expecting a Node as argument, but got ".concat(e));if(e===this)throw new Error("Can not add itself as child!");if(e._children&&e._children.length&&this.ancestors.indexOf(e)>=0)throw new Error("Can not add an ancestor as child!");return e._parent&&e._parent!==this&&e._parent.removeChild(e),this._children.push(e),e._parent=this,e._ancestors=null,this}addChildren(e){let t,n=e?e.length:0;for(t=0;t<n;t++)this.addChild(e[t]);return this}removeChild(e){const t=this._children.indexOf(e);return t>=0&&(this._children.splice(t,1),e._parent=null,e._ancestors=null),this}removeChildren(e){let t,n;if(!this._children)return this;if(e)for(n=e.length,t=0;t<n;t++)this.removeChild(e[t]);else for(;this._children.length;)this.removeChild(this._children[0]);return this}}const kd=wd.prototype;class _d extends bd{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.type;super(void 0===t?"container":t),this.set(e)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super.set(e);const t=e.collider,n=u({type:null},t);this.collider=n,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}appendChildRect(e,t){if(void 0!==e.bounds){const n=this.__boundingRect[t]||{},i=m(e.bounds(t),3),r=i[0],o=i[2],s=r.x,a=r.y,l=o.x,c=o.y,u=isNaN(n.width)?l:Math.max(l,n.width+n.x),h=isNaN(n.height)?c:Math.max(c,n.height+n.y);n.x=isNaN(n.x)?s:Math.min(s,n.x),n.y=isNaN(n.y)?a:Math.min(a,n.y),n.width=u-n.x,n.height=h-n.y,this.__boundingRect[t]=n}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];const t=this.children.length;for(let n=0;n<t;n++)this.appendChildRect(this.children[n],e);return this.__boundingRect[e]=u({x:0,y:0,width:0,height:0},this.__boundingRect[e]),this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}addChild(e){const t=kd.addChild.call(this,e);if(this._collider&&"bounds"===this._collider.type){this.appendChildRect(e,!0);const t=u({type:"bounds",x:0,y:0,width:0,height:0},this.__boundingRect.true);this.collider=t}return t}addChildren(e){const t=kd.addChildren.call(this,e),n=e.length;if(this._collider&&"bounds"===this._collider.type&&n>0){for(let t=0;t<n;t++)this.appendChildRect(e[t],!0);const t=u({type:"bounds",x:0,y:0,width:0,height:0},this.__boundingRect.true);this.collider=t}return t}removeChild(e){e._stage=null;let t,n=e.descendants,i=n?n.length:0;for(t=0;t<i;t++)n[t]._stage=null;if(kd.removeChild.call(this,e),this._collider&&"bounds"===this._collider.type){this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null};const e=u(this.boundingRect(!0),{type:"bounds"});this.collider=e}return this}removeChildren(e){if(kd.removeChildren.call(this,e),this._collider&&"bounds"===this._collider.type){this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null};const e=u(this.boundingRect(!0),{type:"bounds"});this.collider=e}return this}}function Md(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new _d(...t)}class Sd extends _d{constructor(e){super("stage"),this._stage=this,this._dpiRatio=e||1}get dpi(){return this._dpiRatio}}const Rd=wd.prototype,Cd=["x1","x2","y1","y2","id","offset","style"];class Nd extends bd{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.type;super(void 0===t?"container":t),this.set(e),this._boundingRect={}}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super.set(e);const t=this.attrs;let n="";for(let i=0,r=Cd.length;i!==r;i++)n=Cd[i],void 0!==e[n]&&(t[n]=e[n])}addChild(e){return Rd.addChild.call(this,e)}addChildren(e){return Rd.addChildren.call(this,e)}removeChild(e){e._stage=null;let t,n=e.descendants,i=n?n.length:0;for(t=0;t<i;t++)n[t]._stage=null;return Rd.removeChild.call(this,e),this}removeChildren(e){return Rd.removeChildren.call(this,e),this}}function Dd(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Nd(...t)}const qd=wd.prototype,Ed=["patternUnits","x","y","width","height","id"];class zd extends bd{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.type;super(void 0===t?"container":t),this.set(e),this._boundingRect={}}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super.set(e);const t=this.attrs;let n="";for(let i=0,r=Ed.length;i!==r;i++)n=Ed[i],void 0!==e[n]&&(t[n]=e[n])}addChild(e){return qd.addChild.call(this,e)}addChildren(e){return qd.addChildren.call(this,e)}removeChild(e){e._stage=null;let t,n=e.descendants,i=n?n.length:0;for(t=0;t<i;t++)n[t]._stage=null;return qd.removeChild.call(this,e),this}removeChildren(e){return qd.removeChildren.call(this,e),this}}class Ad extends bd{constructor(){super("rect"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.x,n=void 0===t?0:t,i=e.y,r=void 0===i?0:i,o=e.width,s=void 0===o?0:o,a=e.height,l=void 0===a?0:a,c=e.rx,h=void 0===c?0:c,d=e.ry,f=void 0===d?0:d,p=e.collider,g=u({type:"rect",x:n,y:r,width:s,height:l},p);super.set(e),s>=0?(this.attrs.x=n,this.attrs.width=s):(this.attrs.x=n+s,this.attrs.width=-s),l>=0?(this.attrs.y=r,this.attrs.height=l):(this.attrs.y=r+l,this.attrs.height=-l),h>0&&(this.attrs.rx=h),f>0&&(this.attrs.ry=f),this.collider=g,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];const t=k(this.attrs),n=m(b(e&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(t):t),4),i=n[0],r=n[1],o=n[2],s=n[3];return this.__boundingRect[e]={x:i,y:r,width:o-i,height:s-r},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}}class Od extends bd{constructor(){super("circle"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.cx,n=void 0===t?0:t,i=e.cy,r=void 0===i?0:i,o=e.r,s=void 0===o?0:o,a=e.collider,l=u({type:"circle",cx:n,cy:r,r:s},a);super.set(e),this.attrs.cx=n,this.attrs.cy=r,this.attrs.r=s,this.collider=l,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];const t=this.bounds(e);return this.__boundingRect[e]={x:t[0].x,y:t[0].y,width:t[2].x-t[0].x,height:t[2].y-t[0].y},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.attrs,n=t.cx,i=t.cy,r=t.r,o=t.r,s=n-r,a=i-o;let l=2*r,c=2*o,u=[{x:s,y:a},{x:s+l,y:a},{x:s+l,y:a+c},{x:s,y:a+c}];if(e&&this.modelViewMatrix){u=this.modelViewMatrix.transformPoints(u);const t=m(b(u),4),n=t[0],i=t[1];l=t[2]-n,c=t[3]-i,this.__bounds[e]=[{x:n,y:i},{x:n+l,y:i},{x:n+l,y:i+c},{x:n,y:i+c}]}else this.__bounds[e]=u;return this.__bounds[e]}}class Td extends bd{constructor(){super("line"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.x1,n=void 0===t?0:t,i=e.y1,r=void 0===i?0:i,o=e.x2,s=void 0===o?0:o,a=e.y2,l=void 0===a?0:a,c=e.collider;super.set(e),this.attrs.x1=n,this.attrs.y1=r,this.attrs.x2=s,this.attrs.y2=l;const h={type:"line",x1:n,y1:r,x2:s,y2:l};this.collider=u(h,c),this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];let t=w(this.attrs);e&&this.modelViewMatrix&&(t=this.modelViewMatrix.transformPoints(t));const n=m(b(t),4),i=n[0],r=n[1],o=n[2],s=n[3],a=i!==o||r!==s;return this.__boundingRect[e]={x:i,y:r,width:a?Math.max(1,o-i):0,height:a?Math.max(1,s-r):0},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}}const Id=Math.PI/2;function jd(e,t){const n=Math.atan2(t.y-e.y,t.x-e.x);return n<0?n+2*Math.PI:n}function Pd(e,t,n){return{x:e.x+Math.cos(t)*n,y:e.y+Math.sin(t)*n}}const Fd={step:function(e){return new Me(e,.5)},stepAfter:function(e){return new Me(e,1)},stepBefore:function(e){return new Me(e,0)},linear:ne,basis:function(e){return new ce(e)},cardinal:de.tension(0),catmullRom:pe,monotonex:function(e){return new ve(e)},monotoney:function(e){return new be(e)},natural:function(e){return new ke(e)}};function Ld(e){if(e.length<2)return!1;const t=e[0],n=e[e.length-1];return Math.abs(t.x-n.x)<1e-12&&Math.abs(t.y-n.y)<1e-12}class $d extends bd{constructor(){super("path"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(super.set(e),this.segments=[],this.points=[],e.arcDatum){const t=Q();t.innerRadius(e.desc.slice.innerRadius),t.outerRadius(e.desc.slice.outerRadius),t.cornerRadius(e.desc.slice.cornerRadius);const n=t(e.arcDatum);this.attrs.d=n}else if(e.points){const t=e.major,n=e.minor,i=e.layerObj,r=e.points,o=e.stngs,s=e.generatorType,a=oe(),l=o.coordinates?o.coordinates.defined:null;a[t.p](e=>e.major*t.size)["".concat(n.p,"1")](e=>e.minor*n.size)["".concat(n.p,"0")](e=>e.minor0*n.size).curve(Fd["monotone"===i.curve?"monotone".concat(t.p):i.curve]),l?a.defined(e=>!e.dummy&&"number"==typeof e.minor&&!isNaN(e.minor)&&e.defined):a.defined(e=>!e.dummy&&"number"==typeof e.minor&&!isNaN(e.minor));const c=o.connect?r.filter(a.defined()):r,u=("area"===s?a:a[s]())(c);this.attrs.d=u}else e.d&&(this.attrs.d=e.d);if(this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null},Array.isArray(e.collider)||"object"==typeof e.collider&&void 0!==e.collider.type)this.collider=e.collider;else if(this.attrs.d){if(this.segments=Ah(this.attrs.d),this.segments.length>1&&this.segments.every(e=>Ld(e)))return void(this.collider=u({type:"geopolygon",vertices:this.segments},e.collider));this.segments.forEach(t=>{if(t.length<=1);else if(Ld(t))this.collider=u({type:"polygon",vertices:t},e.collider);else if("object"==typeof e.collider&&e.collider.visual){const n=this.attrs["stroke-width"]/2;this.collider=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=[],r=[];if("h"===n.forceOrientation){const t=e[0].x<e[1].x?-1:1,n=e[e.length-1].x>e[e.length-2].x?1:-1;e.unshift({x:e[0].x+t,y:e[0].y}),e.push({x:e[e.length-1].x+n,y:e[e.length-1].y})}else if("v"===n.forceOrientation){const t=e[0].y<e[1].y?-1:1,n=e[e.length-1].y>e[e.length-2].y?1:-1;e.unshift({x:e[0].x,y:e[0].y+t}),e.push({x:e[e.length-1].x,y:e[e.length-1].y+n})}const o=e.length-1;for(let n=1;n<o;n++){const s=e[n-1],a=e[n],l=e[n+1],c=jd(a,s),u=jd(a,l),h=(c+u)/2,d=h+Math.PI,f=Math.max(h,d),p=Math.min(h,d),g=c>u;if(1===n){const e=jd(s,a);i.push(Pd(s,e-Id,t)),r.unshift(Pd(s,e+Id,t))}const m=g?f:p,y=g?p:f;if(i.push(Pd(a,m,t)),r.unshift(Pd(a,y,t)),n===o-1){const e=jd(l,a);i.push(Pd(l,e+Id,t)),r.unshift(Pd(l,e-Id,t))}}return{type:"polygon",vertices:[...i,...r]}}(t,n,e.collider)}else this.collider=u({type:"polyline",points:t},e.collider)})}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];this.points.length||(this.segments=this.segments.length?this.segments:Ah(this.attrs.d),this.points=function(e){const t=[];let n,i=e.length;for(let r=0;r<i;r++){n=e[r];for(let e=0;e<n.length;e++)t.push(n[e])}return t}(this.segments));const t=m(b(e&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(this.points):this.points),4),n=t[0],i=t[1],r=t[2],o=t[3];return this.__boundingRect[e]={x:n||0,y:i||0,width:r-n||0,height:o-i||0},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}}function Bd(e){let t=e.data,n=e._boundingRect,i=e._textBoundsFn;return null!=t&&(n||i)}class Hd extends bd{constructor(){super("text"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.x,n=void 0===t?0:t,i=e.y,r=void 0===i?0:i,o=e.dx,s=void 0===o?0:o,a=e.dy,l=void 0===a?0:a,c=e.textBoundsFn,h=e.text,d=e.title,f=e.collider,p=e.boundingRect,g=e.ellipsed;super.set(e),this.attrs.x=n,this.attrs.y=r,this.attrs.dx=s,this.attrs.dy=l,this.attrs.text=h,void 0!==d&&(this.attrs.title=String(d)),"object"==typeof p?this._textBoundsFn=()=>p:"function"==typeof c&&(this._textBoundsFn=c),"string"==typeof g&&(this.ellipsed=g),this.collider=u({type:Bd(this)?"bounds":null},f),this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[t])return this.__boundingRect[t];if("function"!=typeof this._textBoundsFn)return{x:0,y:0,width:0,height:0};e=this._textBoundsFn(this.attrs);const n=k(e),i=m(b(t&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(n):n),4),r=i[0],o=i[1],s=i[2],a=i[3];return this.__boundingRect[t]={x:r,y:o,width:s-r,height:a-o},this.__boundingRect[t]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}}class Wd extends bd{constructor(){super("image"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.x,n=void 0===t?0:t,i=e.y,r=void 0===i?0:i,o=e.width,s=void 0===o?0:o,a=e.height,l=void 0===a?0:a,c=e.rx,h=void 0===c?0:c,d=e.ry,f=void 0===d?0:d,p=e.src,g=e.collider,m=e.cx,y=void 0===m?0:m,x=e.cy,v=void 0===x?0:x,b=e.r,w=void 0===b?0:b,k=e.opacity,_=e.imageScalingFactor,M=e.imagePosition,S=e.symbol;let R;R="circle"===e.symbol?u({type:"circle",cx:y,cy:v,r:w},g):u({type:"bounds",x:n,y:r,width:s,height:l},g),super.set(e),s>=0?(this.attrs.x=n,this.attrs.width=s):(this.attrs.x=n+s,this.attrs.width=-s),l>=0?(this.attrs.y=r,this.attrs.height=l):(this.attrs.y=r+l,this.attrs.height=-l),h>0&&(this.attrs.rx=h),f>0&&(this.attrs.ry=f),p&&(this.attrs.src=p),this.attrs.r=w,this.attrs.cx=y,this.attrs.cy=v,this.attrs.opacity=void 0!==k?k:1,this.attrs.imageScalingFactor=void 0!==_?_:1,this.attrs.imagePosition=M||"center-center",this.attrs.symbol=S||"rectangle",this.collider=R,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null},e.collider||(this.attrs.updateCollider=this.updateCollider.bind(this))}updateCollider(e){let t;t="circle"===e.symbol?u(this.collider,{type:"circle",cx:e.cx,cy:e.cy,r:e.r}):u(this.collider,{type:"bounds",x:e.x,y:e.y,width:e.width,height:e.height}),this.collider=t}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];const t=k(this.attrs),n=m(b(e&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(t):t),4),i=n[0],r=n[1],o=n[2],s=n[3];return this.__boundingRect[e]={x:i,y:r,width:o-i,height:s-r},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];if("circle"===this._node.symbol){const t=this.boundingRect(e),n=Math.min(t.width,t.height)/2,i=t.x-n,r=t.y-n;let o=2*n,s=2*n,a=[{x:i,y:r},{x:i+o,y:r},{x:i+o,y:r+s},{x:i,y:r+s}];if(e&&this.modelViewMatrix){a=this.modelViewMatrix.transformPoints(a);const t=m(b(a),4),n=t[0],i=t[1];o=t[2]-n,s=t[3]-i,this.__bounds[e]=[{x:n,y:i},{x:n+o,y:i},{x:n+o,y:i+s},{x:n,y:i+s}]}else this.__bounds[e]=a;return this.__bounds[e]}const t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}}const Vd=Ee();function Ud(e,t){return Vd.get(e)(t)}Vd.add("rect",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Ad(...t)}),Vd.add("circle",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Od(...t)}),Vd.add("text",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Hd(...t)}),Vd.add("line",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Td(...t)}),Vd.add("path",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new $d(...t)}),Vd.add("stage",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Sd(...t)}),Vd.add("container",Md),Vd.add("defs",Md),Vd.add("linearGradient",Dd),Vd.add("radialGradient",Dd),Vd.add("conicGradient",Dd),Vd.add("stop",Dd),Vd.add("pattern",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new zd(...t)}),Vd.add("image",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Wd(...t)});const Yd=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=[{}];function n(){return t[t.length-1]}return n.save=function(){let i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r=n(),o={};let s="";for(let t=0;t<e.length;t++)s=e[t],void 0!==r[s]&&(o[s]=r[s]);return u(o,i),t.push(o),n()},n.restore=function(){t.splice(t.length-1,1)},n}(["stroke","fill","strokeWidth","opacity","fontFamily","fontSize","baseline"]);function Kd(e,t){if(Array.isArray(t))for(let n=0,i=t.length;n<i;n++)t[n](e)}function Xd(e,t,n){e.node=n[t],e.index=t}function Gd(e,t,n,i){let r=!1;const o={siblings:e,node:null,index:0};for(let s=0,a=e.length;s<a;s++){if(Xd(o,s,e),Kd(o,i.create),r="function"==typeof o.node.disabled?o.node.disabled():o.node.disabled,r)continue;o.node=Yd.save(o.node);const a=Ud(o.node.type,o.node);a&&(o.node.transform&&(n.save(),id(o.node.transform,n)),n.isIdentity()||(a.modelViewMatrix=n.clone()),t.addChild(a),o.node.children&&Gd(o.node.children,a,n,i),o.node.transform&&n.restore()),Yd.restore()}}function Jd(e){let t=e.items,n=e.stage,i=e.dpi,r=e.on,o=void 0===r?{}:r;return n||(n=Ud("stage",i)),Gd(t,n,new Jh,o),n}function Zd(e,t,n){const i=n.orientation,r=n.degree,o=n.stops,s=void 0===o?[]:o;let a=null;if("radial"===i){const n=t.boundingRect();a=e.createRadialGradient(n.x+n.width/2,n.y+n.height/2,1e-5,n.x+n.width/2,n.y+n.height/2,Math.max(n.width,n.height)/2)}else if("conic"===i){const t=n.startAngle||0,i=n.x||0,r=n.y||0;a=e.createConicGradient(t,i,r)}else{const i=Zo(r);["x1","x2","y1","y2"].forEach(e=>{e in n&&(i[e]=n[e])});const o=t.boundingRect();a=e.createLinearGradient(o.x+i.x1*o.width,o.y+i.y1*o.height,o.x+i.x2*o.width,o.y+i.y2*o.height)}for(let e=0,t=s.length;e<t;e++){let t=s[e];a.addColorStop(t.offset,t.color)}return a}function Qd(e,t,n){return t.width=e.width,t.height=e.height,n.save(),n.fillStyle=e.fill,e.shapes.forEach(e=>{if("rect"===e.type)n.rect(e.x,e.y,e.width,e.height)}),n.fill(),n.restore(),n.createPattern(t,"repeat")}function ef(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.x,n=e.y,i=e.width,r=e.height,o=e.scaleRatio,s=e.margin,a=e.edgeBleed;const l={x:0,y:0,width:0,height:0,scaleRatio:{x:1,y:1},margin:{left:0,top:0},edgeBleed:{left:0,right:0,top:0,bottom:0,bool:!1}};return l.x=isNaN(t)?l.x:t,l.y=isNaN(n)?l.y:n,l.width=isNaN(i)?l.width:i,l.height=isNaN(r)?l.height:r,void 0!==o&&(l.scaleRatio.x=isNaN(o.x)?l.scaleRatio.x:o.x,l.scaleRatio.y=isNaN(o.y)?l.scaleRatio.y:o.y),void 0!==s&&(l.margin.left=isNaN(s.left)?0:s.left,l.margin.top=isNaN(s.top)?0:s.top),"object"==typeof a&&["left","right","top","bottom"].forEach(e=>{!isNaN(a[e])&&a[e]>0&&(l.edgeBleed[e]=a[e],l.edgeBleed.bool=!0)}),l.computedPhysical={x:Math.round(l.margin.left+(l.x-l.edgeBleed.left)*l.scaleRatio.x),y:Math.round(l.margin.top+(l.y-l.edgeBleed.top)*l.scaleRatio.y),width:Math.round((l.width+l.edgeBleed.left+l.edgeBleed.right)*l.scaleRatio.x),height:Math.round((l.height+l.edgeBleed.top+l.edgeBleed.bottom)*l.scaleRatio.y)},l}function tf(){const e={element:()=>{},root:()=>{},settings:()=>{},appendTo:()=>{},getScene:()=>[],render:()=>!1,itemsAt:()=>[],findShapes:()=>[],clear:()=>{},destory:()=>{},size:()=>{},measureText:Su,textBounds:Cu,setKey:t=>{e.element().setAttribute("data-key",t)}};return e}function nf(e){return t=>{let n=t.node;"text"===n.type&&function(e){return null!=e}(n.data)&&!n.textBoundsFn&&(n.textBoundsFn=e.textBounds)}}const rf=200,of=200;class sf{constructor(e){this.targetCanvas=e,this.bufferCanvas=e.cloneNode()}updateSize(e){let t,n=e.rect,i=e.dpiRatio,r=e.canvasBufferSize;t=r?"function"==typeof r?r(n):r:{width:n.computedPhysical.width+2*rf,height:n.computedPhysical.height+2*of},this.bufferCanvas.style.width="".concat(t.width,"px"),this.bufferCanvas.style.height="".concat(t.height,"px"),this.bufferCanvas.width=Math.round(t.width*i),this.bufferCanvas.height=Math.round(t.height*i)}apply(){this.targetCanvas.getContext("2d").drawImage(this.bufferCanvas,0,0)}clear(){this.bufferCanvas.width=this.bufferCanvas.width}getContext(){return this.bufferCanvas.getContext("2d")}}const af=Ee();function lf(e){return Array.isArray(e)?e:"string"==typeof e?-1!==e.indexOf(",")?e.split(","):e.split(" "):[]}function cf(e){return("undefined"==typeof window?1:window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1)}function uf(e,t){t.setTransform(e[0][0],e[1][0],e[0][1],e[1][1],e[0][2],e[1][2])}function hf(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const r=Object.keys(i);for(let r=0,o=n.length;r<o;r++){let o=n[r];const s=o[0],a=o[1],l=o[2];if(s in t.attrs&&!(a in i)&&e[a]!==t.attrs[s]){const n=l?l(t.attrs[s]):t.attrs[s];"function"==typeof e[a]?e[a](n):e[a]=n}}for(let t=0,n=r.length;t<n;t++){const n=r[t];e[n]=i[n]}}function df(e,t,n,i){for(let r=0,o=e.length;r<o;r++){let o=e[r],s={};t.save(),o.attrs&&(o.attrs.fill||o.attrs.stroke)&&(o.attrs.fill&&"object"==typeof o.attrs.fill&&"gradient"===o.attrs.fill.type?s.fillStyle=Zd(t,o,o.attrs.fill):o.attrs.fill&&"object"==typeof o.attrs.fill&&"pattern"===o.attrs.fill.type&&(s.fillStyle=i.patterns.create(o.attrs.fill)),o.attrs.stroke&&"object"==typeof o.attrs.stroke&&"gradient"===o.attrs.stroke.type?s.strokeStyle=Zd(t,o,o.attrs.stroke):o.attrs.stroke&&"object"==typeof o.attrs.stroke&&"pattern"===o.attrs.stroke.type&&(s.strokeStyle=i.patterns.create(o.attrs.stroke))),hf(t,o,n,s),o.modelViewMatrix&&uf(o.modelViewMatrix.elements,t),af.has(o.type)&&af.get(o.type)(o.attrs,{g:t,doFill:"fill"in o.attrs&&"none"!==o.attrs.fill,doStroke:"stroke"in o.attrs&&0!==o.attrs["stroke-width"],ellipsed:o.ellipsed}),o.children&&df(o.children,t,n,i),t.restore()}}function ff(){let e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Jd;const i={transform:void 0,canvasBufferSize:void 0,progressive:void 0};let r,o=!1,s=ef();const a=[["fill","fillStyle"],["stroke","strokeStyle"],["opacity","globalAlpha"],["globalAlpha","globalAlpha"],["stroke-width","lineWidth"],["stroke-linejoin","lineJoin"],["stroke-dasharray","setLineDash",lf]];let l;const c=tf();return c.element=()=>e,c.root=()=>e,c.settings=e=>(e&&Object.keys(i).forEach(t=>{void 0!==e[t]&&(i[t]=e[t])}),i),c.appendTo=n=>(e||(e=n.ownerDocument.createElement("canvas"),e.style.position="absolute",e.style["-webkit-font-smoothing"]="antialiased",e.style["-moz-osx-font-smoothing"]="antialiased",e.style.pointerEvents="none"),"function"!=typeof i.transform||t||(t=new sf(e)),n.appendChild(e),e),c.getScene=i=>{const r=cf(t&&t.getContext()||e.getContext("2d")),o=s.scaleRatio.x,a=s.scaleRatio.y,l={type:"container",children:i,transform:s.edgeBleed.bool?"translate(".concat(s.edgeBleed.left*r*o,", ").concat(s.edgeBleed.top*r*a,")"):""};return 1===r&&1===o&&1===a||(l.transform+="scale(".concat(r*o,", ").concat(r*a,")")),n({items:[l],dpi:r,on:{create:[gu(c.measureText),nf(c)]}})},c.render=n=>{if(!e)return!1;l||(l=function(e){const t=e.createElement("canvas"),n=t.getContext("2d");let i={};return{create(e){const r=e.key;return r?(i[r]=i[r]||Qd(e,t,n),i[r]):Qd(e,t,n)},clear(){i={}}}}(e.ownerDocument));const u=t&&t.getContext()||e.getContext("2d"),h=cf(u),d=t&&i.transform();if(d)return e.width=e.width,function(e){let t=e.el,n=e.dpiRatio,i=e.transform;if("object"==typeof i){const e=[i.horizontalScaling,i.horizontalSkewing,i.verticalSkewing,i.verticalScaling,i.horizontalMoving*n,i.verticalMoving*n];t.getContext("2d").setTransform(...e)}}({el:e,dpiRatio:h,transform:d}),t.apply(),!0;o&&(e.style.left="".concat(s.computedPhysical.x,"px"),e.style.top="".concat(s.computedPhysical.y,"px"),e.style.width="".concat(s.computedPhysical.width,"px"),e.style.height="".concat(s.computedPhysical.height,"px"),e.width=Math.round(s.computedPhysical.width*h),e.height=Math.round(s.computedPhysical.height*h),t&&t.updateSize({rect:s,dpiRatio:h,canvasBufferSize:i.canvasBufferSize}));const f=c.getScene(n),p=!r||!f.equals(r);l.clear();const g=o||p,m="function"==typeof i.progressive&&i.progressive();return g&&(m&&!m.isFirst||c.clear(),df(f.children,u,a,{patterns:l})),t&&(e.width=e.width,t.apply()),o=!1,m&&!m.isFirst&&f.children.unshift(...r.children),r=f,g},c.itemsAt=e=>r?r.getItemsFrom(e):[],c.findShapes=e=>r?r.findShapes(e):[],c.clear=()=>(e&&(e.width=e.width),t&&t.clear(),r=null,c),c.size=e=>{if(e){const t=ef(e);JSON.stringify(s)!==JSON.stringify(t)&&(o=!0,s=t)}return s},c.destroy=()=>{e&&(e.parentElement&&e.parentElement.removeChild(e),e=null),t&&(t=null),r=null},c}function pf(e,t){af.add(e,t)}function gf(e,t){return Math.max(0,Math.min(e,t))}const mf=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼ‎ⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),yf=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞‏יִײַ-ﬨשׁ-ﭏ]"),xf=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]");function vf(e){return mf.test(e)}function bf(e){return yf.test(e)||xf.test(e)}function wf(e){let t,n,i=e?e.length:0;for(t=0;t<i;t++){if(n=e[t],vf(n))return"ltr";if(bf(n))return"rtl"}return"ltr"}const kf={start:"end",end:"start",center:"center",middle:"middle"};function _f(e,t){return"rtl"===t?kf[e]:e}function Mf(e,t){if(Mf.cache[e])return void t(Mf.cache[e]);const n=new Image;n.src=e,n.onload=()=>{Mf.cache[e]=n,t(n)},n.onerror=e=>{console.error("Image load error",e)}}function Sf(e,t){const n=[];let i;const r=[],o=[],s=[];let a,l;const c=e=>e.id,u=(e,t)=>{let n;return n="object"==typeof e?"id"in e?e.id:t:e,{content:e,id:"".concat(n,"__").concat(e.type||"")}};e.isTree||(e=e.map(u)),t=t.map(u),a=e.map(c),l=t.map(c);for(let e=0,i=t.length;e<i;e++){-1===a.indexOf(t[e].id)?n.push(t[e]):o.push(t[e])}for(let t=0,n=e.length;t<n;t++){-1===l.indexOf(e[t].id)?r.push(e[t]):s.push(e[t])}for(let e=0,t=n.length;e<t;e++)n[e].content.children&&(n[e].diff=Sf([],n[e].content.children),n[e].children=n[e].diff.updatedNew.concat(n[e].diff.added),n[e].children.isTree=!0);for(let e=0,t=o.length;e<t;e++)o[e].diff=Sf(s[e].children||[],o[e].content.children||[]),o[e].object=s[e].object,o[e].children=o[e].diff.items;return i=o.concat(n),n.isTree=!0,r.isTree=!0,o.isTree=!0,s.isTree=!0,i.isTree=!0,{added:n,updatedNew:o,updatedOld:s,removed:r,items:i}}function Rf(e,t,n){for(let i=0,r=e.length;i<r;i++)e[i].object=n(e[i].content.type,t)}function Cf(e,t){for(let n=0,i=e.length;n<i;n++)null!==e[n].object&&void 0!==e[n].object&&(t(e[n].object),e[n].object=null)}function Nf(e,t,n,i){let r;for(let o=0,s=e.length;o<s;o++)r=e[o],null!==r.object&&void 0!==r.object&&(n(r.object,r.content),r.diff&&(Rf(r.diff.added,r.object,t),Cf(r.diff.removed,i),Nf(r.diff.items,t,n,i)))}function Df(e,t,n,i,r,o){const s=Sf(e,t);return Rf(s.added,n,i),Cf(s.removed,o),Nf(s.items,i,r,o),s.items}Mf.cache={},pf("rect",function(e,t){let n=t.g,i=t.doFill,r=t.doStroke;n.beginPath(),e.rx>0||e.ry>0?function(e,t,n,i,r,o,s){o=gf(i/2,o>0?o:s),s=gf(r/2,s>0?s:o),e.moveTo(t,n+s),e.lineTo(t,n+r-s),e.quadraticCurveTo(t,n+r,t+o,n+r),e.lineTo(t+i-o,n+r),e.quadraticCurveTo(t+i,n+r,t+i,n+r-s),e.lineTo(t+i,n+s),e.quadraticCurveTo(t+i,n,t+i-o,n),e.lineTo(t+o,n),e.quadraticCurveTo(t,n,t,n+s)}(n,e.x,e.y,e.width,e.height,e.rx,e.ry):n.rect(e.x,e.y,e.width,e.height),i&&n.fill(),r&&n.stroke()}),pf("circle",function(e,t){let n=t.g,i=t.doFill,r=t.doStroke;n.beginPath(),n.moveTo(e.cx+e.r,e.cy),n.arc(e.cx,e.cy,e.r,0,2*Math.PI,!1),i&&n.fill(),r&&n.stroke()}),pf("line",function(e,t){let n=t.g,i=t.doStroke;n.beginPath(),n.moveTo(e.x1,e.y1),n.lineTo(e.x2,e.y2),i&&n.stroke()}),pf("path",function(e,t){let n=t.g,i=t.doStroke,r=t.doFill;const o=new Path2D(e.d);r&&n.fill(o),i&&n.stroke(o)}),pf("text",function(e,t){let n=t.g,i=t.ellipsed,r=t.doStroke;const o=i||mu(e,Su);n.font=[e["font-style"],e["font-weight"],e["font-size"],e["font-family"]].filter(e=>!!e).join(" ");const s=wf(e.text);n.canvas.dir!==s&&(n.canvas.dir=s);const a=_f("middle"===e["text-anchor"]?"center":e["text-anchor"],n.canvas.dir);a&&n.textAlign!==a&&(n.textAlign=a);const l=yu(e);n.fillText(o,e.x+e.dx,e.y+e.dy+l),r&&n.strokeText(o,e.x+e.dx,e.y+e.dy+l)}),pf("image",function(e,t){let n=t.g;const i=n.canvas,r=n.getTransform(),o=window.devicePixelRatio||1,s=i.clientWidth*o,a=i.clientHeight*o;i.width===s&&i.height===a||(i.width=s,i.height=a),Mf(e.src,t=>{if(n.setTransform(1,0,0,1,0,0),n.clearRect(0,0,i.width,i.height),n.setTransform(r),n.globalAlpha=e.opacity,e.width||e.height||(e.width=t.naturalWidth*e.imageScalingFactor,e.height=t.naturalHeight*e.imageScalingFactor),function(e){const t=e.imagePosition||"center-center";let n=e.width,i=e.height;if("circle"===e.symbol){const t=Math.min(e.width,e.height)/2;n=2*t,i=2*t}switch(t){case"top-center":e.y-=i/2;break;case"center-left":e.x-=n/2;break;case"center-right":e.x+=n/2;break;case"top-left":e.x-=n/2,e.y-=i/2;break;case"top-right":e.x+=n/2,e.y-=i/2;break;case"bottom-left":e.x-=n/2,e.y+=i/2;break;case"bottom-right":e.x+=n/2,e.y+=i/2;break;case"bottom-center":e.y+=i/2}}(e),"circle"===e.symbol){const i=e.x,r=e.y;e.r=Math.min(e.width,e.height)/2;const o=i-e.width/2,s=r-e.height/2;n.save(),n.beginPath(),n.arc(i,r,e.r,0,2*Math.PI),n.clip(),n.drawImage(t,o,s,e.width,e.height),n.restore()}else e.x-=e.width/2,e.y-=e.height/2,n.drawImage(t,e.x,e.y,e.width,e.height);n.globalAlpha=1,e.updateCollider&&e.updateCollider(e)})});const qf="http://www.w3.org/2000/svg",Ef=(e,t)=>{if(!e||"string"!=typeof e)throw new Error("Invalid type: ".concat(e));const n=t.ownerDocument.createElementNS(qf,"container"===e?"g":e);return t.appendChild(n),n},zf=e=>{e.parentNode&&e.parentNode.removeChild(e)};function Af(e){let t=e.element,n=e.attrs;return function(){const e=n.width,i=n.height,r=n.imagePosition,o=n.imageScalingFactor,s=n.symbol;let a=n.x,l=void 0===a?0:a,c=n.y,u=void 0===c?0:c,h=e>0?e:this.naturalWidth,d=i>0?i:this.naturalHeight;switch(o&&(h*=o,d*=o),r){case"top-center":u-=d/2;break;case"center-left":l-=h/2;break;case"center-right":l+=h/2;break;case"top-left":l-=h/2,u-=d/2;break;case"top-right":l+=h/2,u-=d/2;break;case"bottom-left":l-=h/2,u+=d/2;break;case"bottom-right":l+=h/2,u+=d/2;break;case"bottom-center":u+=d/2}if(t.setAttribute("width",h),t.setAttribute("height",d),t.setAttribute("x",l-h/2),t.setAttribute("y",u-d/2),t.setAttribute("preserveAspectRatio","none"),"circle"===s){const e=t.ownerSVGElement;if(!e)return;const n="clip-".concat(Math.random().toString(36).substr(2,9));if(!e.querySelector("#".concat(n))){const t=e.querySelector("defs")||e.insertBefore(document.createElementNS(qf,"defs"),e.firstChild),i=document.createElementNS(qf,"clipPath");i.setAttribute("id",n);const r=document.createElementNS(qf,"circle");r.setAttribute("cx",l),r.setAttribute("cy",u),r.setAttribute("r",Math.min(h,d)/2),i.appendChild(r),t.appendChild(i)}t.setAttribute("clip-path","url(#".concat(n,")"))}}}const Of=(e,t)=>{if((e=>{switch(e.type){case"circle":return!isNaN(e.attrs.cx)&&!isNaN(e.attrs.cy)&&!isNaN(e.attrs.r);case"line":return!(isNaN(e.attrs.x1)||isNaN(e.attrs.y1)||isNaN(e.attrs.x2)||isNaN(e.attrs.y2));case"rect":return!(isNaN(e.attrs.x)||isNaN(e.attrs.y)||isNaN(e.attrs.width)||isNaN(e.attrs.height));case"text":case"image":return!isNaN(e.attrs.x)&&!isNaN(e.attrs.y);default:return!0}})(t)){for(const n in t.attrs)if("stroke"===n&&t.strokeReference)e.setAttribute("stroke",t.strokeReference);else if("fill"===n&&t.fillReference)e.setAttribute("fill",t.fillReference);else if("text"===n){e.setAttribute("style","white-space: pre"),e.textContent=t.ellipsed||mu(t.attrs,Su);const n=wf(t.attrs.text);"rtl"===n&&(e.setAttribute("direction","rtl"),e.setAttribute("dir","rtl"),e.setAttribute("text-anchor",_f(e.getAttribute("text-anchor"),n)))}else if("text"!==t.type||"dy"!==n&&"dominant-baseline"!==n)if("text"===t.type&&"title"===n&&t.attrs.title){const n=e.ownerDocument.createElementNS(qf,"title");n.textContent=t.attrs.title,e.appendChild(n)}else if("image"===t.type&&"src"===n){e.setAttributeNS("http://www.w3.org/1999/xlink","href",t.attrs.src);let n=new Image;n.src=t.attrs.src,n.onload=Af({element:e,attrs:t.attrs})}else e.setAttribute(n,t.attrs[n]);else{const i=+e.getAttribute(n)||0;let r=0;r="dominant-baseline"===n?yu(t.attrs):t.attrs[n],e.setAttribute("dy",r+i)}if("string"==typeof t.data||"number"==typeof t.data||"boolean"==typeof t.data)e.setAttribute("data",t.data);else if("object"==typeof t.data&&null!==t.data)for(const n in t.data)"string"!=typeof t.data[n]&&"number"!=typeof t.data[n]&&"boolean"!=typeof t.data[n]||e.setAttribute("data-".concat(n),t.data[n])}};class Tf{constructor(e,t,n,i){this.create=e,this.nodeCreator=t,this.nodeMaintainer=n,this.nodeDestroyer=i}render(e,t){return this.create([],e,t,this.nodeCreator,this.nodeMaintainer,this.nodeDestroyer)}}function If(){return new Tf(Df,Ef,Of,zf)}function jf(e){let t,n,i,r=0;if(0===(e=JSON.stringify(e)).length)return r;for(t=0,i=e.length;t<i;t++)n=e.charCodeAt(t),r=(r<<5)-r+n,r&=r;return r}function Pf(){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:qf,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Jd;const n=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:If)();let i,r,o,s=!1,a=ef();const l={transform:void 0,disableScreenReader:!1},c=tf(),u={type:"defs",children:[]},h=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:jf,n={},i=Date.now();const r={onCreate(r){let o={};r.node&&"object"==typeof r.node.fill&&"pattern"===r.node.fill.type&&r.node.fill.shapes&&(o.fill=r.node.fill),r.node&&"object"==typeof r.node.stroke&&"pattern"===r.node.stroke.type&&r.node.stroke.shapes&&(o.stroke=r.node.stroke),Object.keys(o).forEach(s=>{let a="";const l=o[s],c=t(l),u="picasso-pattern-".concat(i,"-").concat(c);if("undefined"!=typeof window&&(a=window.location.href.split("#")[0]),!n[c]){const t={patternUnits:"userSpaceOnUse",x:0,y:0,width:l.width,height:l.height,type:"pattern",id:u,children:[],fill:l.fill};l.shapes.forEach(e=>{t.children.push(e)}),e.push(t),n[c]=!0}r.node["".concat(s,"Reference")]="url('".concat(a,"#").concat(u,"')")})},clear(){n={}}};return r}(u.children),d=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:jf,n={},i=Date.now();const r={getOrCreateGradient(){let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"fill",s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",a=t(r[o]),l="picasso-gradient-".concat(i,"-").concat(a);if(!n[a]){let t=r[o],i=t.orientation,s=t.degree,c=t.stops,u=void 0===c?[]:c,h={};void 0===s&&(s=90),"radial"===i?h.type="radialGradient":(h=Zo(s),["x1","x2","y1","y2"].forEach(e=>{e in r[o]&&(h[e]=r[o][e])}),h.type="linearGradient"),h.id=l,h.children=u.map(e=>{let t=e.offset,n=e.color,i=e.opacity;return{type:"stop",offset:"".concat(100*t,"%"),style:"stop-color:".concat(n,";stop-opacity:").concat(void 0!==i?i:1)}}),e.push(h),n[a]=l}return"url('".concat(s,"#").concat(l,"')")},onCreate(e){let t="";"undefined"!=typeof window&&(t=window.location.href.split("#")[0]);const n=e.node;n.fill&&"object"==typeof n.fill&&"gradient"===n.fill.type&&(n.fillReference=r.getOrCreateGradient(n,"fill",t)),n.stroke&&"object"==typeof n.stroke&&"gradient"===n.stroke.type&&(n.strokeReference=r.getOrCreateGradient(n,"stroke",t))},clear(){n={}}};return r}(u.children);return c.element=()=>i,c.root=()=>r,c.settings=e=>(e&&Object.keys(l).forEach(t=>{void 0!==e[t]&&(l[t]=e[t])}),l),c.appendTo=t=>(i||(i=t.ownerDocument.createElementNS(e,"svg"),i.style.position="absolute",i.style["-webkit-font-smoothing"]="antialiased",i.style["-moz-osx-font-smoothing"]="antialiased",i.style.pointerEvents="none",i.setAttribute("xmlns",e),r=t.ownerDocument.createElementNS(e,"g"),r.style.pointerEvents="auto",i.appendChild(r)),t.appendChild(i),i),c.getScene=e=>{const n=a.scaleRatio.x,i=a.scaleRatio.y,r={type:"container",children:Array.isArray(e)?[...e,u]:e,transform:a.edgeBleed.bool?"translate(".concat(a.edgeBleed.left*n,", ").concat(a.edgeBleed.top*i,")"):""};return 1===n&&1===i||(r.transform+="scale(".concat(n,", ").concat(i,")")),t({items:[r],on:{create:[e=>{e.node.fillReference=void 0,e.node.strokeReference=void 0},d.onCreate,h.onCreate,gu(c.measureText),nf(c)]}})},c.render=e=>{if(!i)return!1;const t="function"==typeof l.transform&&l.transform();if(t){const e=t.horizontalScaling,n=t.horizontalSkewing,i=t.verticalSkewing,o=t.verticalScaling,s=t.horizontalMoving,a=t.verticalMoving;return r.style.transform="matrix(".concat(e,", ").concat(n,", ").concat(i,", ").concat(o,", ").concat(s,", ").concat(a,")"),!0}r.style.transform="";l.disableScreenReader&&i.setAttribute("aria-hidden",!0),s&&(i.style.left="".concat(a.computedPhysical.x,"px"),i.style.top="".concat(a.computedPhysical.y,"px"),i.setAttribute("width",a.computedPhysical.width),i.setAttribute("height",a.computedPhysical.height)),d.clear(),h.clear(),u.children.length=0;const f=c.getScene(e),p=!o||!f.equals(o),g=s||p;return g&&(c.clear(),n.render(f.children,r)),s=!1,o=f,g},c.itemsAt=e=>o?o.getItemsFrom(e):[],c.findShapes=e=>o?o.findShapes(e):[],c.clear=()=>{if(!r)return c;o=null;const e=r.cloneNode(!1);return i.replaceChild(e,r),r=e,c},c.destroy=()=>{i&&i.parentNode&&i.parentNode.removeChild(i),i=null,r=null},c.size=e=>{if(e){const t=ef(e);JSON.stringify(a)!==JSON.stringify(t)&&(s=!0,a=t)}return a},c}var Ff,Lf,$f,Bf,Hf,Wf,Vf,Uf={},Yf=[],Kf=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function Xf(e,t){for(var n in t)e[n]=t[n];return e}function Gf(e){var t=e.parentNode;t&&t.removeChild(e)}function Jf(e,t,n){var i,r,o,s={};for(o in t)"key"==o?i=t[o]:"ref"==o?r=t[o]:s[o]=t[o];if(arguments.length>2&&(s.children=arguments.length>3?Ff.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===s[o]&&(s[o]=e.defaultProps[o]);return Zf(e,s,i,r,null)}function Zf(e,t,n,i,r){var o={type:e,props:t,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==r?++$f:r};return null==r&&null!=Lf.vnode&&Lf.vnode(o),o}function Qf(e){return e.children}function ep(e,t){this.props=e,this.context=t}function tp(e,t){if(null==t)return e.__?tp(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?tp(e):null}function np(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return np(e)}}function ip(e){(!e.__d&&(e.__d=!0)&&Bf.push(e)&&!rp.__r++||Hf!==Lf.debounceRendering)&&((Hf=Lf.debounceRendering)||Wf)(rp)}function rp(){var e,t,n,i,r,o,s,a;for(Bf.sort(Vf);e=Bf.shift();)e.__d&&(t=Bf.length,i=void 0,r=void 0,s=(o=(n=e).__v).__e,(a=n.__P)&&(i=[],(r=Xf({},o)).__v=o.__v+1,fp(a,o,r,n.__n,void 0!==a.ownerSVGElement,null!=o.__h?[s]:null,i,null==s?tp(o):s,o.__h),pp(i,o),o.__e!=s&&np(o)),Bf.length>t&&Bf.sort(Vf));rp.__r=0}function op(e,t,n,i,r,o,s,a,l,c){var u,h,d,f,p,g,m,y=i&&i.__k||Yf,x=y.length;for(n.__k=[],u=0;u<t.length;u++)if(null!=(f=n.__k[u]=null==(f=t[u])||"boolean"==typeof f||"function"==typeof f?null:"string"==typeof f||"number"==typeof f||"bigint"==typeof f?Zf(null,f,null,null,f):Array.isArray(f)?Zf(Qf,{children:f},null,null,null):f.__b>0?Zf(f.type,f.props,f.key,f.ref?f.ref:null,f.__v):f)){if(f.__=n,f.__b=n.__b+1,null===(d=y[u])||d&&f.key==d.key&&f.type===d.type)y[u]=void 0;else for(h=0;h<x;h++){if((d=y[h])&&f.key==d.key&&f.type===d.type){y[h]=void 0;break}d=null}fp(e,f,d=d||Uf,r,o,s,a,l,c),p=f.__e,(h=f.ref)&&d.ref!=h&&(m||(m=[]),d.ref&&m.push(d.ref,null,f),m.push(h,f.__c||p,f)),null!=p?(null==g&&(g=p),"function"==typeof f.type&&f.__k===d.__k?f.__d=l=sp(f,l,e):l=ap(e,f,d,y,p,l),"function"==typeof n.type&&(n.__d=l)):l&&d.__e==l&&l.parentNode!=e&&(l=tp(d))}for(n.__e=g,u=x;u--;)null!=y[u]&&("function"==typeof n.type&&null!=y[u].__e&&y[u].__e==n.__d&&(n.__d=lp(i).nextSibling),yp(y[u],y[u]));if(m)for(u=0;u<m.length;u++)mp(m[u],m[++u],m[++u])}function sp(e,t,n){for(var i,r=e.__k,o=0;r&&o<r.length;o++)(i=r[o])&&(i.__=e,t="function"==typeof i.type?sp(i,t,n):ap(n,i,i,r,i.__e,t));return t}function ap(e,t,n,i,r,o){var s,a,l;if(void 0!==t.__d)s=t.__d,t.__d=void 0;else if(null==n||r!=o||null==r.parentNode)e:if(null==o||o.parentNode!==e)e.appendChild(r),s=null;else{for(a=o,l=0;(a=a.nextSibling)&&l<i.length;l+=1)if(a==r)break e;e.insertBefore(r,o),s=o}return void 0!==s?s:r.nextSibling}function lp(e){var t,n,i;if(null==e.type||"string"==typeof e.type)return e.__e;if(e.__k)for(t=e.__k.length-1;t>=0;t--)if((n=e.__k[t])&&(i=lp(n)))return i;return null}function cp(e,t,n){"-"===t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||Kf.test(t)?n:n+"px"}function up(e,t,n,i,r){var o;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof i&&(e.style.cssText=i=""),i)for(t in i)n&&t in n||cp(e.style,t,"");if(n)for(t in n)i&&n[t]===i[t]||cp(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])o=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?i||e.addEventListener(t,o?dp:hp,o):e.removeEventListener(t,o?dp:hp,o);else if("dangerouslySetInnerHTML"!==t){if(r)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==t&&"height"!==t&&"href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,n))}}function hp(e){return this.l[e.type+!1](Lf.event?Lf.event(e):e)}function dp(e){return this.l[e.type+!0](Lf.event?Lf.event(e):e)}function fp(e,t,n,i,r,o,s,a,l){var c,u,h,d,f,p,g,m,y,x,v,b,w,k,_,M=t.type;if(void 0!==t.constructor)return null;null!=n.__h&&(l=n.__h,a=t.__e=n.__e,t.__h=null,o=[a]),(c=Lf.__b)&&c(t);try{e:if("function"==typeof M){if(m=t.props,y=(c=M.contextType)&&i[c.__c],x=c?y?y.props.value:c.__:i,n.__c?g=(u=t.__c=n.__c).__=u.__E:("prototype"in M&&M.prototype.render?t.__c=u=new M(m,x):(t.__c=u=new ep(m,x),u.constructor=M,u.render=xp),y&&y.sub(u),u.props=m,u.state||(u.state={}),u.context=x,u.__n=i,h=u.__d=!0,u.__h=[],u._sb=[]),null==u.__s&&(u.__s=u.state),null!=M.getDerivedStateFromProps&&(u.__s==u.state&&(u.__s=Xf({},u.__s)),Xf(u.__s,M.getDerivedStateFromProps(m,u.__s))),d=u.props,f=u.state,u.__v=t,h)null==M.getDerivedStateFromProps&&null!=u.componentWillMount&&u.componentWillMount(),null!=u.componentDidMount&&u.__h.push(u.componentDidMount);else{if(null==M.getDerivedStateFromProps&&m!==d&&null!=u.componentWillReceiveProps&&u.componentWillReceiveProps(m,x),!u.__e&&null!=u.shouldComponentUpdate&&!1===u.shouldComponentUpdate(m,u.__s,x)||t.__v===n.__v){for(t.__v!==n.__v&&(u.props=m,u.state=u.__s,u.__d=!1),u.__e=!1,t.__e=n.__e,t.__k=n.__k,t.__k.forEach(function(e){e&&(e.__=t)}),v=0;v<u._sb.length;v++)u.__h.push(u._sb[v]);u._sb=[],u.__h.length&&s.push(u);break e}null!=u.componentWillUpdate&&u.componentWillUpdate(m,u.__s,x),null!=u.componentDidUpdate&&u.__h.push(function(){u.componentDidUpdate(d,f,p)})}if(u.context=x,u.props=m,u.__P=e,b=Lf.__r,w=0,"prototype"in M&&M.prototype.render){for(u.state=u.__s,u.__d=!1,b&&b(t),c=u.render(u.props,u.state,u.context),k=0;k<u._sb.length;k++)u.__h.push(u._sb[k]);u._sb=[]}else do{u.__d=!1,b&&b(t),c=u.render(u.props,u.state,u.context),u.state=u.__s}while(u.__d&&++w<25);u.state=u.__s,null!=u.getChildContext&&(i=Xf(Xf({},i),u.getChildContext())),h||null==u.getSnapshotBeforeUpdate||(p=u.getSnapshotBeforeUpdate(d,f)),_=null!=c&&c.type===Qf&&null==c.key?c.props.children:c,op(e,Array.isArray(_)?_:[_],t,n,i,r,o,s,a,l),u.base=t.__e,t.__h=null,u.__h.length&&s.push(u),g&&(u.__E=u.__=null),u.__e=!1}else null==o&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=gp(n.__e,t,n,i,r,o,s,l);(c=Lf.diffed)&&c(t)}catch(e){t.__v=null,(l||null!=o)&&(t.__e=a,t.__h=!!l,o[o.indexOf(a)]=null),Lf.__e(e,t,n)}}function pp(e,t){Lf.__c&&Lf.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){Lf.__e(e,t.__v)}})}function gp(e,t,n,i,r,o,s,a){var l,c,u,h=n.props,d=t.props,f=t.type,p=0;if("svg"===f&&(r=!0),null!=o)for(;p<o.length;p++)if((l=o[p])&&"setAttribute"in l==!!f&&(f?l.localName===f:3===l.nodeType)){e=l,o[p]=null;break}if(null==e){if(null===f)return document.createTextNode(d);e=r?document.createElementNS("http://www.w3.org/2000/svg",f):document.createElement(f,d.is&&d),o=null,a=!1}if(null===f)h===d||a&&e.data===d||(e.data=d);else{if(o=o&&Ff.call(e.childNodes),c=(h=n.props||Uf).dangerouslySetInnerHTML,u=d.dangerouslySetInnerHTML,!a){if(null!=o)for(h={},p=0;p<e.attributes.length;p++)h[e.attributes[p].name]=e.attributes[p].value;(u||c)&&(u&&(c&&u.__html==c.__html||u.__html===e.innerHTML)||(e.innerHTML=u&&u.__html||""))}if(function(e,t,n,i,r){var o;for(o in n)"children"===o||"key"===o||o in t||up(e,o,null,n[o],i);for(o in t)r&&"function"!=typeof t[o]||"children"===o||"key"===o||"value"===o||"checked"===o||n[o]===t[o]||up(e,o,t[o],n[o],i)}(e,d,h,r,a),u)t.__k=[];else if(p=t.props.children,op(e,Array.isArray(p)?p:[p],t,n,i,r&&"foreignObject"!==f,o,s,o?o[0]:n.__k&&tp(n,0),a),null!=o)for(p=o.length;p--;)null!=o[p]&&Gf(o[p]);a||("value"in d&&void 0!==(p=d.value)&&(p!==e.value||"progress"===f&&!p||"option"===f&&p!==h.value)&&up(e,"value",p,h.value,!1),"checked"in d&&void 0!==(p=d.checked)&&p!==e.checked&&up(e,"checked",p,h.checked,!1))}return e}function mp(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){Lf.__e(e,n)}}function yp(e,t,n){var i,r;if(Lf.unmount&&Lf.unmount(e),(i=e.ref)&&(i.current&&i.current!==e.__e||mp(i,null,t)),null!=(i=e.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){Lf.__e(e,t)}i.base=i.__P=null,e.__c=void 0}if(i=e.__k)for(r=0;r<i.length;r++)i[r]&&yp(i[r],t,n||"function"!=typeof e.type);n||null==e.__e||Gf(e.__e),e.__=e.__e=e.__d=void 0}function xp(e,t,n){return this.constructor(e,n)}function vp(){const e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).createElement,t=void 0===e?document.createElement.bind(document):e;let n,i,r=ef();const o={transform:void 0,disableScreenReader:!1},s=tf();return s.element=()=>n,s.root=()=>n,s.settings=e=>(e&&Object.keys(o).forEach(t=>{void 0!==e[t]&&(o[t]=e[t])}),o),s.appendTo=e=>(n||(n=t("div"),n.style.position="absolute",n.style["-webkit-font-smoothing"]="antialiased",n.style["-moz-osx-font-smoothing"]="antialiased",n.style.pointerEvents="none"),e.appendChild(n),n),s.render=e=>{if(!n)return!1;const t="function"==typeof o.transform&&o.transform();if(t){const e=t.horizontalScaling,i=t.horizontalSkewing,r=t.verticalSkewing,o=t.verticalScaling,s=t.horizontalMoving,a=t.verticalMoving;return n.style.transform="matrix(".concat(e,", ").concat(i,", ").concat(r,", ").concat(o,", ").concat(s,", ").concat(a,")"),!0}n.style.transform="";let s;return o.disableScreenReader&&n.setAttribute("aria-hidden",!0),n.style.left="".concat(r.computedPhysical.x,"px"),n.style.top="".concat(r.computedPhysical.y,"px"),n.style.width="".concat(r.computedPhysical.width,"px"),n.style.height="".concat(r.computedPhysical.height,"px"),s=Array.isArray(e)?Jf("div",null,e):e,i=function(e,t,n){var i,r,o;Lf.__&&Lf.__(e,t),r=(i="function"==typeof n)?null:n&&n.__k||t.__k,o=[],fp(t,e=(!i&&n||t).__k=Jf(Qf,null,[e]),r||Uf,Uf,void 0!==t.ownerSVGElement,!i&&n?[n]:r?null:t.firstChild?Ff.call(t.childNodes):null,o,!i&&n?n:r?r.__e:t.firstChild,i),pp(o,e)}(s,n,i),!0},s.renderArgs=[Jf],s.clear=()=>{if(n){let e=n.firstChild;for(;e;)n.removeChild(e),e=n.firstChild;i=null}return s},s.destroy=()=>{n&&n.parentElement&&n.parentElement.removeChild(n),n=null,i=null},s.size=e=>(e&&(r=ef(e)),r),s}Ff=Yf.slice,Lf={__e:function(e,t,n,i){for(var r,o,s;t=t.__;)if((r=t.__c)&&!r.__)try{if((o=r.constructor)&&null!=o.getDerivedStateFromError&&(r.setState(o.getDerivedStateFromError(e)),s=r.__d),null!=r.componentDidCatch&&(r.componentDidCatch(e,i||{}),s=r.__d),s)return r.__E=r}catch(t){e=t}throw e}},$f=0,ep.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=Xf({},this.state),"function"==typeof e&&(e=e(Xf({},n),this.props)),e&&Xf(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),ip(this))},ep.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),ip(this))},ep.prototype.render=Qf,Bf=[],Wf="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Vf=function(e,t){return e.__v.__b-t.__v.__b},rp.__r=0;var bp=[function(e){e.renderer("svg",Pf)},function(e){e.renderer("canvas",ff)},function(e){e.renderer("dom",vp)}];const wp={OFF:0,ERROR:1,WARN:2,INFO:3,DEBUG:4};const kp=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.level,n=void 0===t?wp.OFF:t,i=e.pipe,r=void 0===i?console:i,o=n;const s={[wp.OFF]:()=>{},[wp.ERROR]:function(){return r.error(...arguments)},[wp.WARN]:function(){return r.warn(...arguments)},[wp.INFO]:function(){return r.info(...arguments)},[wp.DEBUG]:function(){return r.log(...arguments)}},a=function(e){if(e&&!(o<e)){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];(s[e]||s[wp.DEBUG])(...n)}};return{log:a,error:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return a(wp.ERROR,...t)},warn:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return a(wp.WARN,...t)},info:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return a(wp.INFO,...t)},debug:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return a(wp.DEBUG,...t)},level:e=>("number"==typeof e&&(o=e),o),LOG_LEVEL:wp}}(t.logger),r={component:Ee(n.component,"component",i),data:Ee(n.data,"data",i),formatter:Ee(n.formatter,"formatter",i),interaction:Ee(n.interaction,"interaction",i),renderer:ba(n.renderer),scale:Ee(n.scale,"scale",i),symbol:Ee(n.symbol,"symbol",i),logger:i};function o(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e({palettes:t.palettes.concat(n.palettes||[]),style:u({},t.style,n.style),logger:n.logger||t.logger,renderer:n.renderer||t.renderer},r)}return t.renderer&&t.renderer.prio&&r.renderer.default(t.renderer.prio[0]),o.use=function(e){return function(e){e(arguments.length>2?arguments[2]:void 0,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})}(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r)},o.chart=e=>va(e,{registries:r,logger:i,style:t.style,palettes:t.palettes}),o.config=()=>t,Object.keys(r).forEach(e=>{o[e]=r[e]}),o.version=h,o}({renderer:{prio:["svg","canvas"]},logger:{level:0},style:{"$font-family":"'Source Sans Pro', Arial, sans-serif","$font-size":"12px","$line-height":"16px","$font-size--l":"16px","$font-weight":"normal","$gray-100":"#ffffff","$gray-98":"#f9f9f9","$gray-95":"#f2f2f2","$gray-90":"#e6e6e6","$gray-35":"#595959","$gray-30":"#4d4d4d","$gray-25":"#404040","$gray-20":"#333333","$border-95":"rgba(255, 255, 255, 0.05)","$border-90":"rgba(255, 255, 255, 0.1)","$border-80":"rgba(255, 255, 255, 0.2)","$border-20":"rgba(0, 0, 0, 0.2)","$border-10":"rgba(0, 0, 0, 0.1)","$border-5":"rgba(0, 0, 0, 0.05)","$primary-blue":"#3F8AB3","$primary-green":"#6CB33F","$primary-red":"#DC423F","$primary-orange":"#EF960F","$spacing--s":4,$spacing:8,"$spacing--l":12,"$font-color":"$gray-35","$font-color--inverted":"$gray-90","$guide-color":"$gray-90","$guide-color--inverted":"$gray-35",$border:"$border-80","$border--inverted":"$border-10",$shape:{fill:"$primary-blue",strokeWidth:1,stroke:"$border"},"$shape-outline":{stroke:"$primary-blue",strokeWidth:2},"$shape-guide":{stroke:"$guide-color",strokeWidth:1},"$shape-guide--inverted":{"@extend":"$shape-guide",stroke:"$guide-color--inverted"},$label:{fontSize:"$font-size",fontFamily:"$font-family",fill:"$font-color"},"$label--inverted":{$extend:"$label",fill:"$font-color--inverted"},"$label-overlay":{fontSize:"$font-size--l",fontFamily:"$font-family",fill:"$gray-100",color:"$font-color",stroke:"$guide-color--inverted",strokeWidth:1,borderRadius:4},$title:{"@extend":"$label",fontSize:"$font-size--l",fontWeight:"$font-weight",stroke:"$guide-color--inverted",strokeWidth:0},"$guide-line":{strokeWidth:1,stroke:"$guide-color"},"$guide-line--minor":{strokeWidth:1,stroke:"$gray-95"},"$padding--s":{left:"$spacing--s",right:"$spacing--s",top:"$spacing--s",bottom:"$spacing--s"},$padding:{left:"$spacing",right:"$spacing",top:"$spacing",bottom:"$spacing"},"$selection-area-target":{fill:"$primary-green",strokeWidth:0,opacity:.2}},palettes:[{key:"categorical",colors:[["#a54343","#d76c6c","#ec983d","#ecc43d","#f9ec86","#cbe989","#70ba6e","#578b60","#79d69f","#26a0a7","#138185","#65d3da"]]},{key:"diverging",colors:[["#3d52a1","#3a89c9","#77b7e5","#b4ddf7","#e6f5fe","#ffe3aa","#f9bd7e","#ed875e","#d24d3e","#ae1c3e"]]},{key:"sequential",colors:[["rgb(180,221,212)","rgb(34, 83, 90)"]]}]},{component:wa,data:Ra,formatter:ni,interaction:Ca,renderer:ba(),scale:io,symbol:us});function _p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function Mp(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t);if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Sp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function Rp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Sp(Object(n),!0).forEach(function(t){Mp(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Sp(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Cp(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i,r,o,s,a=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t);else for(;!(l=(i=o.call(n)).done)&&(a.push(i.value),a.length!==t);l=!0);}catch(e){c=!0,r=e}finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw r}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return _p(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_p(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}Th.forEach(kp.use),bp.forEach(kp.use),[].forEach(kp.use);var Np=Object.prototype.hasOwnProperty,Dp=Object.prototype.toString,qp=Object.defineProperty,Ep=Object.getOwnPropertyDescriptor,zp=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===Dp.call(e)},Ap=function(e){if(!e||"[object Object]"!==Dp.call(e))return!1;var t,n=Np.call(e,"constructor"),i=e.constructor&&e.constructor.prototype&&Np.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!i)return!1;for(t in e);return void 0===t||Np.call(e,t)},Op=function(e,t){qp&&"__proto__"===t.name?qp(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},Tp=function(e,t){if("__proto__"===t){if(!Np.call(e,t))return;if(Ep)return Ep(e,t).value}return e[t]},Ip=function e(){var t,n,i,r,o,s,a=arguments[0],l=1,c=arguments.length,u=!1;for("boolean"==typeof a&&(u=a,a=arguments[1]||{},l=2),(null==a||"object"!=typeof a&&"function"!=typeof a)&&(a={});l<c;++l)if(null!=(t=arguments[l]))for(n in t)i=Tp(a,n),a!==(r=Tp(t,n))&&(u&&r&&(Ap(r)||(o=zp(r)))?(o?(o=!1,s=i&&zp(i)?i:[]):s=i&&Ap(i)?i:{},Op(a,{name:n,newValue:e(u,s,r)})):void 0!==r&&Op(a,{name:n,newValue:r}));return a};function jp(e,t,n,i){if(!e)return-1;const r=n.cache,o=e.origin?e.origin():null;o&&(e=o);let s=r.fields.indexOf(e),a=-1,l=-1;if(-1===s)for(let t=0;t<r.wrappedFields.length;t++)if(l=r.wrappedFields[t].attrDims.map(e=>e.instance).indexOf(e),a=r.wrappedFields[t].attrExps.map(e=>e.instance).indexOf(e),-1!==l||-1!==a){s=t;break}if(Array.isArray(i)&&i.some((e,t)=>e!==t)){const e=i.indexOf(s);-1!==e&&(s=e)}return s-=t.qArea.qLeft,s<0||s>=t.qArea.qWidth?-1:l>=0?e=>e[s].qAttrDims.qValues[l]:a>=0?e=>e[s].qAttrExps.qValues[a]:e=>e[s]}function Pp(e,t,n){let i=n.key;const r={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return r.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(r.value),e.field&&(r.source={key:i,field:e.field.key()}),r}function Fp(e){let t=e.cache,n=e.f,i=e.mainCell,r=e.p,o=e.page,s=e.rowIdx,a=e.row,l=e.sourceKey,c=e.target,u=e.targetProp,h=e.columnOrder,d=i;if(r.field&&r.field!==n){const e=jp(r.field,o,{cache:t},h);if(-1===e)return;d=Ip({qRow:s},e(a))}c[u]=Pp(r,d,{key:l})}function Lp(e,t,n,i){const r=Array.isArray(e)?e:[e];let o=[];for(let e=0;e<r.length;e++)if(void 0!==r[e].field){const s=t.raw(),a=t.key(),l="object"==typeof r[e].field?r[e].field:t.field(r[e].field),c=i.normalizeConfig(r[e],t),u=c.props,h=c.main,d=Object.keys(u),f=!!r[e].trackBy,p=typeof r[e].trackBy,g={},m=[],y=[];for(let t=0;t<s.qDataPages.length;t++){const o=jp(l,s.qDataPages[t],{cache:n},s.qColumnOrder);if(-1!==o)for(let c=0;c<s.qDataPages[t].qMatrix.length;c++){const x=s.qDataPages[t].qArea.qTop+c,v=Ip({qRow:x},o(s.qDataPages[t].qMatrix[c])),b=Pp(h,v,{key:a});if(!(h.filter&&!h.filter(v))){for(let e=0;e<d.length;e++){const i=u[d[e]];let r=i.fields||[i];i.fields&&(b[d[e]]=[]);for(let o=0;o<r.length;o++)Fp({cache:n,f:l,mainCell:v,p:r[o],prop:d[e],page:s.qDataPages[t],rowIdx:x,row:s.qDataPages[t].qMatrix[c],sourceKey:a,target:i.fields?b[d[e]]:b,targetProp:i.fields?o:d[e],columnOrder:s.qColumnOrder});if(i.fields){const t=b[d[e]].map(e=>e.value),n=b[d[e]].map(e=>e.label);b[d[e]]={value:"function"==typeof i.value?i.value(t):void 0!==i.value?i.value:t,label:"function"==typeof i.label?i.label(n):void 0!==i.label?String(i.label):String(b[d[e]].value)}}}f&&i.track({cfg:r[e],itemData:v,obj:b,target:m,tracker:g,trackType:p}),y.push(b)}}}const x=f?i.collect(m,{main:h,propsArr:d,props:u}):y;o=[...o,...x]}return o}function $p(e){var t=0,n=e.children,i=n&&n.length;if(i)for(;--i>=0;)t+=n[i].value;else t=1;e.value=t}function Bp(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=Wp)):void 0===t&&(t=Hp);for(var n,i,r,o,s,a=new Yp(e),l=[a];n=l.pop();)if((r=t(n.data))&&(s=(r=Array.from(r)).length))for(n.children=r,o=s-1;o>=0;--o)l.push(i=r[o]=new Yp(r[o])),i.parent=n,i.depth=n.depth+1;return a.eachBefore(Up)}function Hp(e){return e.children}function Wp(e){return Array.isArray(e)?e[1]:null}function Vp(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function Up(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function Yp(e){this.data=e,this.depth=this.height=0,this.parent=null}function Kp(e){return null==e?null:function(e){if("function"!=typeof e)throw new Error;return e}(e)}Yp.prototype=Bp.prototype={constructor:Yp,count:function(){return this.eachAfter($p)},each:function(e,t){let n=-1;for(const i of this)e.call(t,i,++n,this);return this},eachAfter:function(e,t){for(var n,i,r,o=this,s=[o],a=[],l=-1;o=s.pop();)if(a.push(o),n=o.children)for(i=0,r=n.length;i<r;++i)s.push(n[i]);for(;o=a.pop();)e.call(t,o,++l,this);return this},eachBefore:function(e,t){for(var n,i,r=this,o=[r],s=-1;r=o.pop();)if(e.call(t,r,++s,this),n=r.children)for(i=n.length-1;i>=0;--i)o.push(n[i]);return this},find:function(e,t){let n=-1;for(const i of this)if(e.call(t,i,++n,this))return i},sum:function(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,i=t.children,r=i&&i.length;--r>=0;)n+=i[r].value;t.value=n})},sort:function(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})},path:function(e){for(var t=this,n=function(e,t){if(e===t)return e;var n=e.ancestors(),i=t.ancestors(),r=null;e=n.pop(),t=i.pop();for(;e===t;)r=e,e=n.pop(),t=i.pop();return r}(t,e),i=[t];t!==n;)t=t.parent,i.push(t);for(var r=i.length;e!==n;)i.splice(r,0,e),e=e.parent;return i},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){return Array.from(this)},leaves:function(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e},links:function(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t},copy:function(){return Bp(this).eachBefore(Vp)},[Symbol.iterator]:function*(){var e,t,n,i,r=this,o=[r];do{for(e=o.reverse(),o=[];r=e.pop();)if(yield r,t=r.children)for(n=0,i=t.length;n<i;++n)o.push(t[n])}while(o.length)}};var Xp={depth:-1},Gp={},Jp={};function Zp(e){return e.id}function Qp(e){return e.parentId}function eg(){var e,t=Zp,n=Qp;function i(i){var r,o,s,a,l,c,u,h,d=Array.from(i),f=t,p=n,g=new Map;if(null!=e){const t=d.map((t,n)=>function(e){e=`${e}`;let t=e.length;ng(e,t-1)&&!ng(e,t-2)&&(e=e.slice(0,-1));return"/"===e[0]?e:`/${e}`}(e(t,n,i))),n=t.map(tg),r=new Set(t).add("");for(const e of n)r.has(e)||(r.add(e),t.push(e),n.push(tg(e)),d.push(Jp));f=(e,n)=>t[n],p=(e,t)=>n[t]}for(s=0,r=d.length;s<r;++s)o=d[s],c=d[s]=new Yp(o),null!=(u=f(o,s,i))&&(u+="")&&(h=c.id=u,g.set(h,g.has(h)?Gp:c)),null!=(u=p(o,s,i))&&(u+="")&&(c.parent=u);for(s=0;s<r;++s)if(u=(c=d[s]).parent){if(!(l=g.get(u)))throw new Error("missing: "+u);if(l===Gp)throw new Error("ambiguous: "+u);l.children?l.children.push(c):l.children=[c],c.parent=l}else{if(a)throw new Error("multiple roots");a=c}if(!a)throw new Error("no root");if(null!=e){for(;a.data===Jp&&1===a.children.length;)a=a.children[0],--r;for(let e=d.length-1;e>=0&&(c=d[e]).data===Jp;--e)c.data=null}if(a.parent=Xp,a.eachBefore(function(e){e.depth=e.parent.depth+1,--r}).eachBefore(Up),a.parent=null,r>0)throw new Error("cycle");return a}return i.id=function(e){return arguments.length?(t=Kp(e),i):t},i.parentId=function(e){return arguments.length?(n=Kp(e),i):n},i.path=function(t){return arguments.length?(e=Kp(t),i):e},i}function tg(e){let t=e.length;if(t<2)return"";for(;--t>1&&!ng(e,t););return e.slice(0,t)}function ng(e,t){if("/"===e[t]){let n=0;for(;t>0&&"\\"===e[--t];)++n;if(!(1&n))return!0}return!1}function ig(e,t){"/"===e.charAt(0)&&(e=e.substring(1));const n=e.split("/");let i,r=t;for(let e=0;e<n.length;e++){if("*"===n[e]&&Array.isArray(r)){const t=[];i=n.slice(e+1).join("/");for(let e=0;e<r.length;e++){let n=ig(i,r[e]);Array.isArray(n)?t.push(...n):t.push(n)}return t}if(!n[e]&&Array.isArray(r)){const t=new Array(r.length);i=n.slice(e+1).join("/");for(let e=0;e<r.length;e++)t[e]=ig(i,r[e]);return t}n[e]in r&&(r=r[n[e]])}return r}function rg(e,t,n){let i=[];if(!e||!e.length)return i;if(t<=0){const t=n>=0?[e[n]]:e;i=[...i,...t]}else for(let r=0;r<e.length;r++)e[r].children&&e[r].children.length&&(i=[...i,...rg(e[r].children,t-1,n)]);return i}function og(e,t,n){if(e===t)return e=>e;if(e>t){const n=Math.max(0,Math.min(100,e-t));return e=>{let t=e;for(let e=0;e<n;++e)t=t.parent;return t}}if(t>e){const i=Math.max(0,Math.min(100,t-e));return e=>rg(e.children,i-1,n)}return!1}const sg=/^qDimensionInfo(?:\/(\d+))?/,ag=/^\/?qMeasureInfo\/(\d+)/,lg=/\/qAttrExprInfo\/(\d+)/,cg=/\/qAttrDimInfo\/(\d+)/;function ug(e){const t=e.qColumnOrder&&e.qColumnOrder.length?e.qColumnOrder:e.qDimensionInfo.map((e,t)=>t);return t.filter(t=>t<e.qDimensionInfo.length)}function hg(e,t){let n=t.cube;if(!e)return-1;let i=e.origin&&e.origin()?e.origin().key():e.key(),r=!1,o=-1,s=-1,a=-1,l=-1,c=-1,u=-1,h=i;const d=n.qEffectiveInterColumnSortOrder,f=ug(n);return sg.test(h)&&(r=!0,o=+sg.exec(h)[1],h=i.replace(sg,"")),ag.test(h)&&("K"===n.qMode?c=+ag.exec(h)[1]:d&&-1!==d.indexOf(-1)?(c=+ag.exec(h)[1],u=0):u=+ag.exec(h)[1],h=h.replace(ag,"")),h&&(cg.exec(h)?a=+cg.exec(h)[1]:lg.exec(h)&&(s=+lg.exec(h)[1])),l=r?"S"===n.qMode?f[o]:d?d.indexOf(o):o:d&&-1!==d.indexOf(-1)?d.indexOf(-1):n.qDimensionInfo.length-("K"===n.qMode?0:1),{fieldDepth:l+1,pseudoMeasureIndex:c,measureIdx:u,attrDimIdx:a,attrIdx:s}}function dg(e,t){let n,i,r=og(e.fieldDepth,t.fieldDepth,t.pseudoMeasureIndex);return n=t.measureIdx>=0?e=>e.data.qValues[t.measureIdx]:e=>e.data,t.attrDimIdx>=0?i=e=>{var n;return null==e||null===(n=e.qAttrDims)||void 0===n?void 0:n.qValues[t.attrDimIdx]}:t.attrIdx>=0&&(i=e=>{var n;return null==e||null===(n=e.qAttrExps)||void 0===n?void 0:n.qValues[t.attrIdx]}),{nodeFn:r,attrFn:i,valueFn:n}}function fg(e,t,n){let i=n.key;const r={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return r.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(r.value),e.field&&(r.source={key:i,field:e.field.key()}),r}function pg(e){let t=e.propsArr,n=e.props,i=e.item,r=e.itemData,o=e.ret,s=e.sourceKey;for(let e=0;e<t.length;e++){const a=n[t[e]],l=a.fields||[a];let c,u;a.fields&&(c=[],u=[]);for(let n=0;n<l.length;n++){const h=l[n];let d,f,p,g,m,y;if("primitive"===h.type?(p=h.value,y=String(h.value)):("function"==typeof h.value&&(d=e=>h.value(e,i)),"function"==typeof h.label&&(f=e=>h.label(e,i)),h.accessor?(g=h.accessor(i),Array.isArray(g)?(m=g.map(h.valueAccessor),h.attrAccessor&&(m=m.map(h.attrAccessor)),d&&(p=m.map(d),d=null),f&&(y=m.map(f),f=null),p=h.reduce?h.reduce(p):p,y=h.reduceLabel?h.reduceLabel(y,p):String(p)):(p=h.attrAccessor?h.attrAccessor(h.valueAccessor(g)):h.valueAccessor(g),y=p)):(p=r,y=r)),a.fields){const e=d?d(p):p;c.push(e),u.push(f&&null!=y?f(y):null!=y?y:String(e))}else{const n=d?d(p):p;o[t[e]]={value:n,label:f?f(y):null!=y?y:String(n)},h.field&&(o[t[e]].source={field:h.field.key(),key:s})}}c&&(o[t[e]]={value:"function"==typeof a.value?a.value(c,i):c,label:"function"==typeof a.label?a.label(u,i):u})}}const gg=(e,t,n)=>{const i="K"===e.qMode?"/qStackedDataPages/*/qData":"/qTreeDataPages/*",r="K"===e.qMode?"qSubNodes":"qNodes",o=ig(i,e);return o&&o[0]?(t.tree=Bp(o[0],n.children||(e=>e[r])),t.tree):null};const mg=e=>{let t=e.propsArr,n=e.props,i=e.cube;e.cache;let r=e.itemDepthObject,o=e.f;for(let e=0;e<t.length;e++){const s=n[t[e]],a=s.fields?s.fields:[s];for(let e=0;e<a.length;e++){const t=a[e];if(t.field!==o){const e=dg(r,hg(t.field,{cube:i}));t.accessor=e.nodeFn,t.valueAccessor=e.valueFn,t.attrAccessor=e.attrFn}}}};function yg(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;const r=t.raw(),o=t.key(),s="S"===r.qMode?function(e){const t=e.raw().qDataPages.length?e.raw().qDataPages[0].qMatrix:[],n=function(e){const t=e.raw().qColumnOrder,n=e.fields();return t&&t.length===n.length?t:n.map((e,t)=>t)}(e),i=e.fields(),r=e.fields().filter(e=>"dimension"===e.type()).map(e=>n.indexOf(i.indexOf(e))),o=e.fields().filter(e=>"measure"===e.type()).map(e=>n.indexOf(i.indexOf(e))),s={__root:{__id:"__root",qValues:[]}};for(let e=0;e<t.length;e++){const n=t[e];let i="__root",l=!1;for(let e=0;e<r.length;e++){var a;const t=n[r[e]],o="".concat(i,"__").concat(null!==(a=t.qElemNumber)&&void 0!==a?a:t.qElemNo);s[o]||(s[o]=Rp({__id:o,__parent:i,qValues:[]},t),l=!0),i=o}if(l)for(let e=0;e<o.length;e++){const t=n[o[e]];s[i].qValues.push(t)}}const l=Object.keys(s).map(e=>s[e]);return eg().id(e=>e.__id).parentId(e=>e.__parent)(l)}(t):gg(r,n,e);if(!s)return null;const a=s.height,l=[];for(let o=0;o<=a;o++){let s=null;if(o>0)if("S"===r.qMode){let e=ug(r)[o-1];s=n.fields[e]}else{let e=r.qEffectiveInterColumnSortOrder[o-1];o>r.qEffectiveInterColumnSortOrder.length&&(e=r.qDimensionInfo.length),s=n.fields[e]}const a=i.normalizeConfig(Rp(Rp({},e),{},{field:s?s.key():void 0}),t),c=a.props,u=a.main,h=Object.keys(c);l[o]={propsArr:h,props:c,main:u};const d=s?hg(s,{cube:r}):{fieldDepth:0};mg({propsArr:h,props:c,cube:r,cache:n,itemDepthObject:d,f:s})}const c=s.copy().descendants(),u=s.descendants();for(let e=0;e<u.length;e++){const t=l[u[e].depth].propsArr,n=l[u[e].depth].props,i=l[u[e].depth].main,r=c[e],s=r.data,a=fg(i,s,{key:o});pg({propsArr:t,props:n,item:r,itemData:s,ret:a,sourceKey:o}),u[e].data=a}return s}function xg(e,t,n,i){const r=Array.isArray(e)?e:[e];let o=[];for(let s=0;s<r.length;s++)if(void 0!==r[s].field){const a=t.raw(),l=t.key();if(!gg(a,n,e))continue;const c="object"==typeof r[s].field?r[s].field:t.field(r[s].field),u=i.normalizeConfig(r[s],t),h=u.props,d=u.main,f=Object.keys(h),p=hg(c,{cube:a}),g=dg({fieldDepth:0},p),m=g.nodeFn,y=g.attrFn,x=g.valueFn;mg({propsArr:f,props:h,cube:a,cache:n,itemDepthObject:p,f:c});const v=!!r[s].trackBy,b=typeof r[s].trackBy,w={},k=[],_=m(n.tree),M=[];for(let e=0;e<_.length;e++){const t=_[e],n=y?y(x(t)):x(t);if(d.filter&&!d.filter(n))continue;const o=fg(d,n,{key:l});pg({propsArr:f,props:h,item:t,itemData:n,ret:o,sourceKey:l}),v&&i.track({cfg:r[s],itemData:n,obj:o,target:k,tracker:w,trackType:b}),M.push(o)}const S=v?i.collect(k,{main:d,propsArr:f,props:h}):M;o=[...o,...S]}return o}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var vg=function(e,t){return e(t={exports:{}},t.exports),t.exports}(function(e){
8
8
  /*! javascript-number-formatter - v1.1.11 - http://mottie.github.com/javascript-number-formatter/ * © ecava */
9
- t.exports=function(t,e){if(!t||isNaN(+e))return e;var n,i,r,o,a,s,l,c,u,h,d=t.length,f=t.search(/[0-9\-\+#]/),p=f>0?t.substring(0,f):"",g=t.split("").reverse().join(""),m=g.search(/[0-9\-\+#]/),y=d-m,v=t.substring(y,y+1),x=y+("."===v||","===v?1:0),b=m>0?t.substring(x,d):"";if(n=(e="-"===(t=t.substring(f,x)).charAt(0)?-e:+e)<0?e=-e:0,r=(i=t.match(/[^\d\-\+#]/g))&&i[i.length-1]||".",o=i&&i[1]&&i[0]||",",t=t.split(r),e=+(e=e.toFixed(t[1]&&t[1].length))+"",s=t[1]&&t[1].lastIndexOf("0"),(!(c=e.split("."))[1]||c[1]&&c[1].length<=s)&&(e=(+e).toFixed(s+1)),u=t[0].split(o),t[0]=u.join(""),(a=t[0]&&t[0].indexOf("0"))>-1)for(;c[0].length<t[0].length-a;)c[0]="0"+c[0];else 0===+c[0]&&(c[0]="");if((e=e.split("."))[0]=c[0],l=u[1]&&u[u.length-1].length){for(g="",y=(h=e[0]).length%l,d=h.length,x=0;x<d;x++)g+=h.charAt(x),!((x-y+1)%l)&&x<d-l&&(g+=o);e[0]=g}return e[1]=t[1]&&e[1]?r+e[1]:"","0"!==(i=e.join(""))&&""!==i||(n=!1),p+(n?"-":"")+i+b}});function bg(t){return t.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}const wg={3:"k",6:"M",9:"G",12:"T",15:"P",18:"E",21:"Z",24:"Y","-3":"m","-6":"μ","-9":"n","-12":"p","-15":"f","-18":"a","-21":"z","-24":"y"},kg=/%\)?$/,_g=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,Mg=/^\(oct\)/i,Sg=/^\(dec\)/i,Rg=/^\(hex\)/i,Cg=/^\(bin\)/i,Ng=/^\(rom\)/i,Dg=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,qg=/#|0/g;function Eg(t,e,n,i){return t=t.toString(e),n[1]===n[1].toUpperCase()&&(t=t.toUpperCase()),t.length-t.indexOf(".")>10&&(t=t.slice(0,t.indexOf(".")+11)),t.replace(".",i||".")}function Og(t,e,n){let i;return _g.test(e)?t=Eg(t,Number(/\d{2}/.exec(e)[0]),e,n):Mg.test(e)?t=Eg(t,8,e,n):Sg.test(e)?t=Eg(t,10,e,n):Rg.test(e)?t=Eg(t,16,e,n):Cg.test(e)?t=Eg(t,2,e,n):Ng.test(e)&&(i="",t<0&&(i="-",t=-t),0===(t=Math.floor(t))?t="0":t<=5e5?(t=function(t,e){let n,i="",r=Number(String(t).slice(-3)),o=(t-r)/1e3,a=[0,1,4,5,9,10,40,50,90,100,400,500,900].reverse(),s=["0","I","IV","V","IX","X","XL","L","XC","C","CD","D","CM"].reverse();for(;r>0;)for(n=0;n<a.length;n++)if(a[n]<=r){i+=s[n],r-=a[n];break}for(n=0;n<o;n++)i="M".concat(i);return e[1]!==e[1].toUpperCase()&&(i=i.toLowerCase()),i}(t,e),t=i+t):t=e+i+t.toExponential(0)),t}function Ag(t,e,n){const i=bg(t);return n?i:new RegExp(i||"",e)}function zg(t,e,n,i){let r,o,a,s,l,c,u,h,d,f=t.pattern;var p,g;i&&(t.abbreviate=!0),p=e,(g=n)&&(g=bg(g)),p&&(p=bg(p)),d=new RegExp("(?:[#0]+".concat(p,")?[#0]+(?:").concat(g,"[#0]+)?")),a=f.match(d),a=a?a[0]:"",s=a?f.substr(0,f.indexOf(a)):f,l=a?f.substring(f.indexOf(a)+a.length):"",a||(a=f?"#":"##########"),e&&e===n&&(r=a.split(n),o=r.pop(),a=r.join("")+n+o,e=""),c=e,e=/,/.test(n)?"¤":",",c&&(a=a.replace(Ag(c,"g"),e)),u=n,n=".",u&&(a=a.replace(Ag(u,"g"),n)),h=a.match(/#/g),h=h?h.length:0;const m=f.split(u);let y;m[1]&&(y=m[1].match(qg)),t.prefix=s||"",t.postfix=l||"",t.pattern=f,t.maxPrecision=y?y.length:2,t.percentage=kg.test(f),t.numericPattern=a||"",t.numericRegex=new RegExp("".concat(Ag(e,null,!0),"|").concat(Ag(n,null,!0)),"g"),t.groupTemp=c,t.decTemp=u,t.t=e,t.d=n,t.temp=h}class Tg{constructor(t,e,n,i,r){this.localeInfo=t,this.pattern=e,this.thousandDelimiter=n||",",this.decimalDelimiter=i||".",this.type=r||"numeric",this.patternSeparator=";",this.abbreviations=function(t,e){if(!t||!t.qNumericalAbbreviation)return wg;const n={};return t.qNumericalAbbreviation.split(e).forEach(t=>{let e=t.split(":");2===e.length&&(n[e[0]]=e[1])}),n}(t,this.patternSeparator),this.prepare()}clone(){const t=new Tg(this.localeInfo,this.pattern,this.thousandDelimiter,this.decimalDelimiter,this.type);return t.subtype=this.subtype,t}format(t,e,n,i){return this.prepare(e,n,i),this.formatValue(t)}prepare(t,e,n){let i;if(void 0===t&&(t=this.pattern),void 0===e&&(e=this.thousandDelimiter),void 0===n&&(n=this.decimalDelimiter),!t)return void(this._prepared={pattern:!1});this._prepared={positive:{d:n,t:e,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},negative:{d:n,t:e,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},zero:{d:n,t:e,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""}},i=this._prepared,t=t.split(this.patternSeparator),i.positive.pattern=t[0],i.negative.pattern=t[1],i.zero.pattern=t[2],Dg.test(t[0])&&(i.positive.isFunctional=!0),t[1]?Dg.test(t[1])&&(i.negative.isFunctional=!0):i.negative=!1,t[2]?Dg.test(t[2])&&(i.zero.isFunctional=!0):i.zero=!1;const r="U"===this.type;i.positive.isFunctional||zg(i.positive,e,n,r),i.negative&&!i.negative.isFunctional&&zg(i.negative,e,n,r),i.zero&&!i.zero.isFunctional&&zg(i.zero,e,n,r)}formatValue(t){let e,n,i,r,o,a,s,l,c,u=this._prepared,h="",d="",f=t;if(isNaN(t))return"".concat(f);if(t=+t,!1===u.pattern)return t.toString();if(0===t&&u.zero)return u=u.zero,u.pattern;if(t<0&&u.negative?(u=u.negative,t=-t):u=u.positive,o=u.d,a=u.t,u.isFunctional)t=Og(t,u.pattern,o);else{if(u.percentage&&(t*=100),u.abbreviate){const e=Object.keys(this.abbreviations).map(t=>parseInt(t,10)).sort((t,e)=>t-e);let i,r,o=e[0];for(s=0,n=Number(Number(t).toExponential().split("e")[1]);o<=n&&s<e.length;)s++,o=e[s];s>0&&(i=e[s-1]),i&&n>0&&i>0?r=i:(n<0&&i<0||!i)&&(o<0&&o-n<=u.maxPrecision?r=o:i<=n&&!(o>0&&-n<=u.maxPrecision)&&(r=i)),r&&(h=this.abbreviations[r],t/=10**r)}if(i=Math.abs(t),e=u.temp,l=u.numericPattern,c=l.split(o)[1],"I"===this.type&&(t=Math.round(t)),r=t,c||"#"!==l.slice(-1)[0])if(i>=1e15||i>0&&i<=1e-14)t=i?i.toExponential(15).replace(/\.?0+(?=e)/,""):"0";else{const e=Number((t+1e-15*(t<0?-1:1)).toFixed(Math.min(20,c?c.length:0)).split(".")[0]);let n=l.split(o)[0];if(n+=o,t=xg(n,e)||"0",c){const e=Math.max(0,Math.min(14,c.length)),n=c.replace(/#+$/,"").length;let r=("I"===this.type?0:i%1+1e-15).toFixed(e).slice(2).replace(/0+$/,"");for(s=r.length;s<n;s++)r+="0";r&&(t+=o+r)}else 0===e&&(r=0)}else if(i>=10**e||i<1||i<1e-4)0===t?t="0":i<1e-4||i>=1e20?(t=(t=r.toExponential(Math.max(1,Math.min(14,e))-1)).replace(/\.?0+(?=e)/,""),d=""):(t=t.toPrecision(Math.max(1,Math.min(14,e)))).indexOf(".")>=0&&(t=(t=t.replace(t.indexOf("e")<0?/0+$/:/\.?0+(?=e)/,"")).replace(".",o));else{for(l+=o,e=Math.max(0,Math.min(20,e-Math.ceil(Math.log(i)/Math.log(10)))),s=0;s<e;s++)l+="#";t=xg(l,t)}t=t.replace(u.numericRegex,t=>t===a?u.groupTemp:t===o?u.decTemp:""),r<0&&!/^-/.test(t)&&(t="-".concat(t))}return u.prefix+t+d+h+u.postfix}static getStaticFormatter(){return{prepare(){},formatValue:t=>"".concat(t)}}}function Ig(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=e.size,i=void 0===n?5e3:n,r=e.multipleArguments,o=void 0!==r&&r,a=e.toKey,s=void 0===a?t=>t:a;let l,c,u=Object.create(null),h=Object.create(null),d=0,f=0;return l=o?function(){return c=s(...arguments),l.has(c)?l.get(c):l.set(c,t(...arguments))}:e=>(c=s(e),l.has(c)?l.get(c):l.set(c,t(e))),l.set=(t,e)=>(d>=i&&(delete u[h[f]],delete h[f],d--,f++),u[t]=e,h[d]=t,d++,e),l.get=t=>u[t],l.has=t=>t in u,l.clear=()=>{u=Object.create(null),h=Object.create(null),d=0,f=0},l.size=()=>d,l}function jg(t,e,n,i,r){const o=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return new Tg(...e)}(r,t,e,n,i),a=Ig(o.formatValue.bind(o),{toKey:t=>isNaN(t)?t:+t});function s(t){return a(t)}return s.format=function(t,e,n,i){return a.clear(),o.format(e,t,n,i)},s.pattern=function(t){return t&&(a.clear(),o.pattern=t,o.prepare()),o.pattern},s}const Pg="D",Fg="T",Lg="TS",$g="IV",Bg=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Hg=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Wg=["January","February","March","April","May","June","July","August","September","October","November","December"],Vg=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Ug(t,e){for(let n=t.length;n<e;n++)t="0".concat(t);return t}function Yg(t){let e=t.toString().split(".");return e[1]?(e=Number("0.".concat(e[1])),e):0}function Kg(t,e){let n,i=function(t){const e=t,n=24*Yg(e),i=60*Yg(n),r=60*Yg(i),o=1e3*Yg(r);return{d:Math.floor(e),h:Math.floor(n),m:Math.floor(i),s:Math.floor(r),f:Math.round(o)}}(t),r=i.d,o=i.h,a=i.m,s=i.s,l=i.f,c=0;/w+|t+/gi.test(e)&&(n=new Date(Date.UTC(1899,11,30+Math.floor(t),0,0,Math.round(86400*(t-Math.floor(t))))),isNaN(n.getTime())&&(n=null)),/D+/gi.test(e)||(o+=24*r),/h+/gi.test(e)||(a+=60*o),/m+/gi.test(e)||(s+=60*a),/w+/gi.test(e)&&(c=n?n.getDay()-1:0,c<0&&(c=6));let u="";return n&&(u=n.getUTCHours()>=12?"pm":"am"),{year:0,month:0,day:c,date:r,h:o,m:a,s:s,f:l,t:u}}class Gg{constructor(t,e,n){const i=t||{};if(i.qCalendarStrings||(i.qCalendarStrings={qLongDayNames:Bg,qDayNames:Hg,qLongMonthNames:Wg,qMonthNames:Vg}),this.localeInfo=i,this.locale_days=i.qCalendarStrings.qLongDayNames.slice(),this.locale_days_abbr=i.qCalendarStrings.qDayNames.slice(),this.locale_months=i.qCalendarStrings.qLongMonthNames.slice(),this.locale_months_abbr=i.qCalendarStrings.qMonthNames.slice(),!e){e={[Fg]:i.qTimeFmt||"hh:mm:ss",[Pg]:i.qDateFmt||"YYYY-MM-DD",[Lg]:i.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"}[n]}this.pattern=e}clone(){const t=new Gg(this.localeInfo,this.pattern);return t.subtype=this.subtype,t}format(t,e){e||(e=this.pattern?this.pattern:"YYYY-MM-DD hh:mm:ss"),e=e.replace(/\[.+]|\[|]/g,"");const n=/t+/gi.test(e);let i;t instanceof Date?i=function(t,e){let n=t.getUTCHours(),i=t.getUTCDay()-1;return e&&(n%=12,n||(n=12)),i<0&&(i=6),{year:t.getUTCFullYear(),month:t.getUTCMonth(),day:i,date:t.getUTCDate(),h:n,m:t.getUTCMinutes(),s:t.getUTCSeconds(),f:t.getUTCMilliseconds(),t:t.getUTCHours()>=12?"pm":"am"}}(t,n):(t<0&&(t=-t,e="-".concat(e)),i=Kg(t,e));const r=(o=this,a=i,{"Y+|y+":{Y:"".concat(Number("".concat(a.year).slice(-2))),YY:Ug("".concat(a.year).slice(-2),2),YYY:Ug("".concat(a.year).slice(-3),3),def:t=>Ug("".concat(a.year),t.length)},"M+":{M:a.month+1,MM:Ug("".concat(a.month+1),2),MMM:o.locale_months_abbr[a.month],def:o.locale_months[a.month]},"W+|w+":{W:a.day,WW:Ug("".concat(a.day),2),WWW:o.locale_days_abbr[a.day],def:o.locale_days[a.day]},"D+|d+":{D:a.date,def:t=>Ug("".concat(a.date),t.length)},"h+|H+":{h:a.h,def:t=>Ug("".concat(a.h),t.length)},"m+":{m:a.m,def:t=>Ug("".concat(a.m),t.length)},"s+|S+":{s:a.s,def:t=>Ug("".concat(a.s),t.length)},"f+|F+":{def(t){let e="".concat(a.f),n=t.length-e.length;if(n>0)for(let t=0;t<n;t++)e+="0";else n<0&&(e=e.slice(0,t.length));return e}},"t{1,2}|T{1,2}":{def(t){let e=a.t;return t[0].toUpperCase()===t[0]&&(e=e.toUpperCase()),e=e.slice(0,t.length),e}}});var o,a;const s=[];for(const t in r)Object.prototype.hasOwnProperty.call(r,t)&&s.push(t);const l=new RegExp(s.join("|"),"g"),c=e.replace(l,t=>{let e,n,i;for(n in r)if(Object.prototype.hasOwnProperty.call(r,n)&&(e=new RegExp(n),e.test(t)))break;if(!e)return"";for(const e in r[n])if(e===t||e.toLowerCase()===t){i=r[n][e],void 0===i&&(i=r[n][e.toLowerCase()]);break}return void 0===i&&(i=r[n].def),"function"==typeof i&&(i=i(t)),i});return c}}function Xg(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return new Gg(...e)}function Jg(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"TS",n=Xg(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,t,e),i=Ig(n.format.bind(n),{toKey:t=>"object"==typeof t&&"function"==typeof t.getTime?t.getTime():t});function r(t){return e!==$g?function(t){return new Date(Date.UTC(1899,11,30+Math.floor(t),0,0,0,Math.round(864e5*(t-Math.floor(t)))))}(t):t}function o(t){return t=r(t),i(t)}return o.format=function(t,e){return i.clear(),e=r(e),n.format(e,t)},o.locale=function(r){return n=Xg(r,t,e),i=Ig(n.format.bind(n),{toKey:t=>"object"==typeof t?t.getTime():t}),this},o.qtype=function(t){return void 0!==t&&(e=t,i.clear()),e},o}function Zg(t,e){if(t&&t.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(t.qNumFormat.qType))return Jg(t.qNumFormat.qFmt,t.qNumFormat.qType,e);let n="#",i=e&&void 0!==e.qThousandSep?e.qThousandSep:",",r=e&&void 0!==e.qDecimalSep?e.qDecimalSep:".",o="U",a=t&&!!t.qIsAutoFormat;return t&&t.qNumFormat?(n=t.qNumFormat.qFmt||n,i=t.qNumFormat.qThou||i,r=t.qNumFormat.qDec||r,o=t.qNumFormat.qType||o,a=a&&-1===["M"].indexOf(t.qNumFormat.qType)):a=!0,(a||"U"===o)&&(n="#".concat(r,"##"),o="U"),jg(n,i,r,o,e)}function Qg(){let t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.meta,i=e.id,r=e.key,o=e.localeInfo,a=e.fieldExtractor,s=e.value,l=e.type,c=e.sourceField;const u=s||("dimension"===l?t=>null==t?void 0:t.qElemNo:t=>null==t?void 0:t.qValue),h="dimension"===l?"first":"avg",d=Zg(n,o),f="dimension"===l?"first":(t,e)=>d(e),p={id:()=>i,key:()=>r,raw:()=>n,title:()=>n.qFallbackTitle||n.label,type:()=>l,origin:()=>c,items:()=>(t||(t=a(p)),t),min:()=>n.qMin,max:()=>n.qMax,value:u,label:t=>(null==t?void 0:t.qText)||"",reduce:h,reduceLabel:f,formatter:()=>d,tags:()=>n.qTags};return p}function tm(t,e,n,i,r){return(e[t]||[]).map((e,o)=>{const a="".concat(i?"".concat(i,"/"):"").concat(t,"/").concat(o),s={instance:Qg(Ip({id:"".concat(n?"".concat(n,"/"):"").concat(a),key:a,meta:e},r))};return s.attrDims=tm("qAttrDimInfo",e,n,a,Ip({},r,{value:t=>null==t?void 0:t.qElemNo,type:"dimension"})),s.attrExps=tm("qAttrExprInfo",e,n,a,Ip({},r,{value:t=>null==t?void 0:t.qNum,type:"measure"})),s.measures=tm("qMeasureInfo",e,n,a,Ip({},r,{value:t=>null==t?void 0:t.qValue,type:"measure"})),s})}function em(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.key,n=t.data,i=t.config,r=void 0===i?{}:i;const o={fields:[],wrappedFields:[],allFields:[],virtualFields:[]},a=n;if(!a)throw new Error('Missing "data" input');if(!a.qDimensionInfo)throw new Error('The "data" input is not recognized as a hypercube');const s=em.util,l={cache:o,cube:a,localeInfo:r.localeInfo,fieldExtractor:null,pages:null,hierarchy:()=>null,virtualFields:r.virtualFields},c={key:()=>e,raw:()=>a,field:t=>function(t,e){let n=e.cache;if("number"==typeof t)return n.fields[t];const i=n.allFields;if("function"==typeof t){for(let e=0;e<i.length;e++)if(t(i[e]))return i[e];return!1}if("string"==typeof t){for(let e=0;e<i.length;e++)if(i[e].key()===t||i[e].title()===t)return i[e]}else if(t&&-1!==i.indexOf(t))return t;throw Error("Field not found: ".concat(t))}(t,l),fields:()=>o.fields.slice(),extract:t=>l.extractor(t,c,o,s),hierarchy:t=>l.hierarchy(t,c,o,s),_cache:()=>o};"K"===a.qMode||"T"===a.qMode||!a.qMode&&a.qNodesOnDim?(l.extractor=vg,l.hierarchy=yg,l.pages="K"===a.qMode?a.qStackedDataPages:a.qTreeDataPages):"S"===a.qMode?(l.extractor=Lp,l.pages=a.qDataPages,l.hierarchy=yg):l.extractor=()=>[],l.fieldExtractor=t=>l.extractor({field:t},c,o,s);const u="S"===a.qMode?t=>t.qElemNumber:void 0,h="S"===a.qMode?t=>t.qNum:void 0;o.wrappedFields.push(...tm("qDimensionInfo",a,e,"",Ip({},l,{value:u,type:"dimension"}))),o.wrappedFields.push(...tm("qMeasureInfo",a,e,"",Ip({},l,{value:h,type:"measure"}))),o.fields=o.wrappedFields.map(t=>t.instance);const d=t=>{t.forEach(t=>{o.allFields.push(t.instance),d(t.measures),d(t.attrDims),d(t.attrExps)})};return d(o.wrappedFields),(r.virtualFields||[]).forEach(t=>{const n=c.field(t.from),i=Qg(Rp({meta:n.raw(),id:"".concat(e,"/").concat(t.key),sourceField:n,fieldExtractor:t=>l.extractor({field:t},c,o,s),key:t.key,type:n.type(),localeInfo:l.localeInfo,value:n.value},t.override||{}));o.virtualFields.push(i)}),o.allFields.push(...o.virtualFields),c}const nm=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],im=/\/qDimensionInfo(?:\/(\d+))?/,rm=/\/qMeasureInfo\/(\d+)/,om=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,am=/\/qAttrExprInfo\/(\d+)/,sm=/\/?qHyperCube/,lm=/\/?qTreeData/,cm=t=>"".concat(t.substr(0,t.indexOf("/qHyperCubeDef")+14)),um=t=>"".concat(t.substr(0,t.indexOf("/qTreeDataDef")+13));function hm(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const i=e.byCells,r=e.primarySource,o=[],a={},s=t.isActive();let l=!1;if(t.brushes().forEach(t=>{const e=function(t,e){let n=t,i=-1,r=-1,o="",a=t=>t;sm.test(t)?(o="".concat(n.substr(0,n.indexOf("qHyperCube")+10)),a=cm):lm.test(t)&&(o="".concat(n.substr(0,n.indexOf("qTreeData")+9)),a=um);let s=!0;if(im.test(t)&&(i=+im.exec(t)[1]),rm.test(t)&&(r=+rm.exec(t)[1]),om.test(t)){r=-1,i=0;const t=+om.exec(n)[2];isNaN(t)||(i=t,n=n.replace(/\/\d+$/,"")),s=!1}if(am.test(t)){const t=r;if(e){r=0;const a=ig(o,e);r+=(a.qMeasureInfo||[]).length,i>-1?(r=a.qDimensionInfo.slice(0,i).reduce((t,e)=>t+e.qAttrExprInfo.length,r),i=-1):(r=a.qDimensionInfo.reduce((t,e)=>t+e.qAttrExprInfo.length,r),r=a.qMeasureInfo.slice(0,t).reduce((t,e)=>t+e.qAttrExprInfo.length,r)),r+=+am.exec(n)[1]}else i>-1?(i=-1,r=+am.exec(n)[1]):r+=+am.exec(n)[1]+1}return nm.forEach(t=>{let e=Cp(t,2),i=e[0],r=e[1];n=n.replace(i,r)}),s&&(n=a(n)),n&&"/"!==n[0]&&(n="/".concat(n)),{measureIdx:r,dimensionIdx:i,path:n}}(t.id,n);if("range"===t.type&&e.measureIdx>-1&&e.dimensionIdx>-1){const n=t.brush.ranges();n.length&&(l=!0,a.multiRangeSelectTreeDataValues||(a.multiRangeSelectTreeDataValues={path:e.path,ranges:[]}),n.forEach(t=>a.multiRangeSelectTreeDataValues.ranges.push({qMeasureIx:e.measureIdx,qDimensionIx:e.dimensionIdx,qRange:{qMin:t.min,qMax:t.max,qMinInclEq:!0,qMaxInclEq:!0}})))}else{if("range"===t.type&&e.measureIdx>-1){const n=t.brush.ranges();n.length&&(l=!0,a.rangeSelectHyperCubeValues||(a.rangeSelectHyperCubeValues={path:e.path,ranges:[]}),n.forEach(t=>a.rangeSelectHyperCubeValues.ranges.push({qMeasureIx:e.measureIdx,qRange:{qMin:t.min,qMax:t.max,qMinInclEq:!0,qMaxInclEq:!0}})))}if("range"===t.type&&e.dimensionIdx>-1){const n=t.brush.ranges();n.length&&(l=!0,a.selectHyperCubeContinuousRange||(a.selectHyperCubeContinuousRange={path:e.path,ranges:[]}),n.forEach(t=>a.selectHyperCubeContinuousRange.ranges.push({qDimIx:e.dimensionIdx,qRange:{qMin:t.min,qMax:t.max,qMinInclEq:!0,qMaxInclEq:!1}})))}if("value"===t.type&&e.dimensionIdx>-1)if(i)if(n&&n.qHyperCube&&("P"===n.qHyperCube.qMode||"T"===n.qHyperCube.qMode||"K"===n.qHyperCube.qMode)){const i=n.qHyperCube,o=i.qNoOfLeftDims,s=i.qEffectiveInterColumnSortOrder.indexOf(e.dimensionIdx);if(a.selectPivotCells||(a.selectPivotCells={path:e.path,cells:[]}),t.id===r||!r){const n=t.brush.values().map(t=>+t).filter(t=>!isNaN(t));(0===o||s>=o)&&o>-1?n.forEach(t=>{a.selectPivotCells.cells.push({qType:"T",qCol:t,qRow:s-o})}):n.forEach(t=>{a.selectPivotCells.cells.push({qType:"L",qCol:e.dimensionIdx,qRow:t})}),l=!!a.selectPivotCells.cells.length}}else a.selectHyperCubeCells||(a.selectHyperCubeCells={path:e.path,cols:[]}),a.selectHyperCubeCells.cols.push(e.dimensionIdx),t.id!==r&&(r||a.selectHyperCubeCells.values)||(a.selectHyperCubeCells.values=t.brush.values().map(t=>+t).filter(t=>!isNaN(t)),l=!!a.selectHyperCubeCells.values.length);else{const n=t.brush.values().map(t=>+t).filter(t=>!isNaN(t));l=!!n.length,o.push({params:[e.path,e.dimensionIdx,n,!1],method:"selectHyperCubeValues"})}}}),!l&&s)return[{method:"resetMadeSelections",params:[]}];var c;a.rangeSelectHyperCubeValues&&o.push({method:"rangeSelectHyperCubeValues",params:[a.rangeSelectHyperCubeValues.path,a.rangeSelectHyperCubeValues.ranges,[],null===(c=e.orMode)||void 0===c||c]});return a.selectHyperCubeContinuousRange&&o.push({method:"selectHyperCubeContinuousRange",params:[a.selectHyperCubeContinuousRange.path,a.selectHyperCubeContinuousRange.ranges]}),a.selectHyperCubeCells&&o.push({method:"selectHyperCubeCells",params:[a.selectHyperCubeCells.path,a.selectHyperCubeCells.values,a.selectHyperCubeCells.cols]}),a.selectPivotCells&&o.push({method:"selectPivotCells",params:[a.selectPivotCells.path,a.selectPivotCells.cells]}),a.multiRangeSelectTreeDataValues&&o.push({method:"multiRangeSelectTreeDataValues",params:[a.multiRangeSelectTreeDataValues.path,a.multiRangeSelectTreeDataValues.ranges]}),o}function dm(t){em.util=t.data("matrix").util,t.data("q",em),t.formatter("q-number",jg),t.formatter("q-time",Jg)}dm.qBrushHelper=hm,dm.selections=hm;const fm={fill:"steelblue",num:1},pm=.9,gm=150,mm=(t,e,n)=>{let i=0,r=0,o=0,a={},s=0;if("labelCenter"===t)i=e.bottomLeft.x,r=e.topRight.y,o=e.bottomRight.x-e.bottomLeft.x,s=e.bottomRight.y-e.topRight.y,a={share:n.share,fill:n.fill};else{const t=180/Math.PI*Math.atan((e.bottomRight.y-e.topRight.y)/(e.topRight.x-e.bottomRight.x));i=t<15&&t>=0?e.topRight.x:t>-15&&t<0?e.bottomRight.x:t<-15?(e.bottomRight.x-e.topRight.x)/2+e.topRight.x+15:(e.topRight.x-e.bottomRight.x)/2+e.bottomRight.x+15,r=e.topRight.y,o=e.width-i,s=e.bottomRight.y-e.topRight.y,a={fill:n.fill}}return{tag:t,type:"rect",x:i,y:r,width:o,height:s,data:n.data,desc:a,fill:"none"}},ym=(t,e)=>{const n=(t=>{const e=(t=>{let e=0;return t.forEach(t=>{t.num>e&&(e=t.num)}),e})(t);let n=0;return t.slice().reverse().map(t=>{const i={datum:t,s:n/e,e:t.num/e};return n=t.num,i}).reverse()})(t),i=e.width*pm,r=e.height*pm,o=(e.width-i)/2,a=(e.height-r)/2,s=i-(i>gm&&r>gm?100:0),l=(r-1*(n.length-1))/n.length,c=[];return n.forEach((t,i)=>{const r=(u=t.e,h=i<n.length-1?t.s:t.e,[.5-.5*u,.5+.5*u,.5+.5*h,.5-.5*h]).map(t=>Math.round(t*s+o));var u,h;const d=l*i+1*i+a,f={bottomRight:{x:r[2],y:Math.round(d+l)},bottomLeft:{x:r[3],y:Math.round(d+l)},topRight:{x:r[1],y:Math.round(d)},topLeft:{x:r[0],y:Math.round(d)},width:e.width},p=`M${f.topLeft.x},${f.topLeft.y} L${f.topRight.x},${f.topRight.y} ${f.bottomRight.x},${f.bottomRight.y} ${f.bottomLeft.x},${f.bottomLeft.y}Z`;c.push({tag:"section",type:"path",d:p,data:t.datum.data,fill:t.datum.fill});const g={share:t.e,fill:t.datum.fill,data:t.datum.data};l>12&&(f.bottomRight.x-f.bottomLeft.x>32&&c.push(mm("labelCenter",f,g)),c.push(mm("labelLeft",f,g)))}),c},vm=(t,e,n,i)=>(i-t)/i*(e-n)+n,xm=(t,e,n)=>{const i=t.filter(t=>"NaN"!==t.num&&t.num>0),r=i.length,o=n.width*pm,a=n.height*pm,s=Math.round((n.width-o)/2),l=Math.round((n.height-a)/2),c=o-(o>gm&&a>gm?100:0),u=a-1*(r-1),h=[],d=i[0].data.num.value;let f=l;return i.forEach((t,i)=>{const r=e[i]*u,o=Math.round(vm(f-l,c,.2*c,a)/2),p=Math.round(vm(f-l+r,c,.2*c,a)/2),g=s+Math.round(c/2),m={bottomRight:{x:g+p,y:Math.round(f+r)},bottomLeft:{x:g-p,y:Math.round(f+r)},topRight:{x:g+o,y:f},topLeft:{x:g-o,y:f},width:n.width},y=`M${m.topLeft.x},${m.topLeft.y} L${m.topRight.x},${m.topRight.y} ${m.bottomRight.x},${m.bottomRight.y} ${m.bottomLeft.x},${m.bottomLeft.y}Z`;h.push({tag:"section",type:"path",d:y,data:t.data,fill:t.fill});const v={share:t.data.num.value/d,fill:t.fill,data:t.data};r>2&&(m.bottomRight.x-m.bottomLeft.x>32&&h.push(mm("labelCenter",m,v)),h.push(mm("labelLeft",m,v))),f+=r+1}),h},bm=(t,e,n)=>{const i=t.filter(t=>"NaN"!==t.num&&t.num>0);if(i&&i.length>0)switch(e){case"WIDTH":default:return ym(i,n);case"ORDER":return xm(i,i.map(()=>1/i.length),n);case"HEIGHT":return xm(i,(t=>{const e=t.reduce((t,e)=>t+e.data.num.value,0);return t.map(t=>t.data.num.value/e)})(i),n);case"AREA":return xm(i,((t,e,n)=>{const i=t.reduce((t,e)=>t+e.data.num.value,0),r=e.width*pm,o=e.height*pm,a=r*n,s=o*(r+a)/2,l=(r-a)/2/o,c=[];let u=0;for(let e=t.length-1;e>=0;e--){const n=t[e].data.num.value/i,r=2*l*u+a,h=-r/(2*l)+Math.sqrt(r*r/(4*l*l)+n*s/l);c[e]=h/o,u+=h}return c})(i,n,.2),n)}return[]};var wm={require:["resolver"],defaultSettings:{settings:{},data:{},style:{item:"$shape"}},render({data:t}){const e=this.resolver.resolve({data:t,defaults:{...fm,...this.style.item},settings:this.settings.settings});return bm(e.items,this.settings.settings.mode,this.rect)}};const km={version:"1.16.0",color:{auto:!0,autoMinMax:!0,byDimDef:void 0,byMeasureDef:void 0,colorExpression:void 0,dimensionScheme:"12",expressionIsColor:!0,expressionLabel:"",measureMin:void 0,measureMax:void 0,measureScheme:"sg",mode:"primary",paletteColor:{index:6},persistent:!1,reverseScheme:!1,singleColor:void 0,useBaseColors:"off",useDimColVal:!0,useMeasureGradient:!0},dataPoint:{auto:!0,labelMode:"share"},footnote:"",funnel:{mode:"WIDTH"},qHyperCubeDef:{qDimensions:[],qMeasures:[],qInterColumnSortOrder:[],qInitialDataFetch:[{qWidth:2,qHeight:5e3}],qSuppressMissing:!0,qSuppressZero:!1},showDimensionTitle:!0,showTitles:!0,subtitle:"",title:""};function _m(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}function Mm(t,e,n,i,r,o,a){try{var s=t[o](a),l=s.value}catch(t){return void n(t)}s.done?e(l):Promise.resolve(l).then(i,r)}function Sm(t){return function(){var e=this,n=arguments;return new Promise(function(i,r){var o=t.apply(e,n);function a(t){Mm(o,i,r,a,s,"next",t)}function s(t){Mm(o,i,r,a,s,"throw",t)}a(void 0)})}}function Rm(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e);if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Cm(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,i)}return n}function Nm(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Cm(Object(n),!0).forEach(function(e){Rm(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Cm(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function Dm(t,e){if(null==t)return{};var n,i,r=function(t,e){if(null==t)return{};var n={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(-1!==e.indexOf(i))continue;n[i]=t[i]}return n}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)n=o[i],-1===e.indexOf(n)&&{}.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function qm(){
10
- /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
11
- var t,e,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",r=n.toStringTag||"@@toStringTag";function o(n,i,r,o){var l=i&&i.prototype instanceof s?i:s,c=Object.create(l.prototype);return Em(c,"_invoke",function(n,i,r){var o,s,l,c=0,u=r||[],h=!1,d={p:0,n:0,v:t,a:f,f:f.bind(t,4),d:function(e,n){return o=e,s=0,l=t,d.n=n,a}};function f(n,i){for(s=n,l=i,e=0;!h&&c&&!r&&e<u.length;e++){var r,o=u[e],f=d.p,p=o[2];n>3?(r=p===i)&&(l=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=t):o[0]<=f&&((r=n<2&&f<o[1])?(s=0,d.v=i,d.n=o[1]):f<p&&(r=n<3||o[0]>i||i>p)&&(o[4]=n,o[5]=i,d.n=p,s=0))}if(r||n>1)return a;throw h=!0,i}return function(r,u,p){if(c>1)throw TypeError("Generator is already running");for(h&&1===u&&f(u,p),s=u,l=p;(e=s<2?t:l)||!h;){o||(s?s<3?(s>1&&(d.n=-1),f(s,l)):d.n=l:d.v=l);try{if(c=2,o){if(s||(r="next"),e=o[r]){if(!(e=e.call(o,l)))throw TypeError("iterator result is not an object");if(!e.done)return e;l=e.value,s<2&&(s=0)}else 1===s&&(e=o.return)&&e.call(o),s<2&&(l=TypeError("The iterator does not provide a '"+r+"' method"),s=1);o=t}else if((e=(h=d.n<0)?l:n.call(i,d))!==a)break}catch(e){o=t,s=1,l=e}finally{c=1}}return{value:e,done:h}}}(n,r,o),!0),c}var a={};function s(){}function l(){}function c(){}e=Object.getPrototypeOf;var u=[][i]?e(e([][i]())):(Em(e={},i,function(){return this}),e),h=c.prototype=s.prototype=Object.create(u);function d(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,c):(t.__proto__=c,Em(t,r,"GeneratorFunction")),t.prototype=Object.create(h),t}return l.prototype=c,Em(h,"constructor",c),Em(c,"constructor",l),l.displayName="GeneratorFunction",Em(c,r,"GeneratorFunction"),Em(h),Em(h,r,"Generator"),Em(h,i,function(){return this}),Em(h,"toString",function(){return"[object Generator]"}),(qm=function(){return{w:o,m:d}})()}function Em(t,e,n,i){var r=Object.defineProperty;try{r({},"",{})}catch(t){r=0}Em=function(t,e,n,i){function o(e,n){Em(t,e,function(t){return this._invoke(e,n,t)})}e?r?r(t,e,{value:n,enumerable:!i,configurable:!i,writable:!i}):t[e]=n:(o("next",0),o("throw",1),o("return",2))},Em(t,e,n,i)}function Om(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var i,r,o,a,s=[],l=!0,c=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(i=o.call(n)).done)&&(s.push(i.value),s.length!==e);l=!0);}catch(t){c=!0,r=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return s}}(t,e)||Tm(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Am(t){return function(t){if(Array.isArray(t))return _m(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Tm(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function zm(t){return zm="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},zm(t)}function Tm(t,e){if(t){if("string"==typeof t)return _m(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_m(t,e):void 0}}var Im,jm="top",Pm="top-right",Fm="right",Lm="bottom-right",$m="bottom",Bm="bottom-left",Hm="left",Wm="top-left";Rm(Rm(Rm(Rm(Rm(Rm(Rm(Rm(Rm(Rm(Im={},"equal-equal",[jm,$m]),"equal-higher",[$m,Lm]),"equal-lower",[jm,Pm]),"equal-void",[jm,$m]),"higher-equal",[Hm,Bm,jm,Pm]),"higher-higher-acute",[$m,Bm,Hm,Pm]),"higher-higher-obtuse",[$m,jm]),"higher-lower-negative",[jm,Pm,Fm]),"higher-lower-positive",[$m,Bm,Hm]),"higher-void",[jm]),Rm(Rm(Rm(Rm(Rm(Rm(Rm(Rm(Rm(Rm(Im,"lower-equal",[jm]),"lower-higher-negative",[jm,Wm]),"lower-higher-positive",[Lm]),"lower-lower-acute",[jm,Wm,Hm,Pm,Fm]),"lower-lower-obtuse",[jm,$m]),"lower-void",[jm]),"void-equal",[jm]),"void-higher",[jm,$m]),"void-lower",[jm,$m,Hm]),"void-void",[jm]),Rm(Im,"unclassified",[jm,$m,Fm,Hm,Pm,Lm,Bm,Wm]);var Vm="object",Um=["Abril Fatface, serif","Bangers, fantasy","Bebas Neue, sans serif","EB Garamond, serif","Fredoka One, fantasy","Graduate, fantasy","Gravitas One, serif","Indie Flower, fantasy","Inter, sans-serif","Lobster, fantasy","Montserrat, sans-serif","Nixie One, sans-serif","Noto Sans, sans-serif","Open Sans, sans-serif","PT Serif, serif","Pacifico, cursive","Permanent Marker, fantasy","QlikView Sans, sans-serif","Raleway, sans-serif","Rammetto One, fantasy","Roboto, sans-serif","Source Sans Pro, sans-serif","Titan One, fantasy","Yanone Kaffeesatz, sans-serif"];var Ym=function(t){return{value:t,label:t.charAt(0).toUpperCase()+t.slice(1),groupHeader:!1,disabled:!1,styles:{fontFamily:t}}};function Km(t){var e=t.theme,n=t.translator,i=t.defaultValue,r=[],o=e.getStyle("","","fontFamilies");return Array.isArray(o)&&o.length?r.push.apply(r,Am(new Set([i].concat(Am(o.map(function(t){return t.split(",").map(function(t){return t.trim()}).map(function(t){return t.replace(/\s+/g," ").trim()}).filter(Boolean).join(", ")})))))):r.push(i),[{value:"ThemeHeader",label:n.get("properties.themeFonts"),metaText:n.get("properties.theme"),groupHeader:!0}].concat(Am(r.map(function(t){return Ym(t)})),[{value:"DefaultHeader",label:n.get("properties.allFonts"),metaText:n.get("properties.default"),groupHeader:!0}],Am(Um.map(function(t){return Ym(t)})))}function Gm(t){var e=t.theme,n=t.translator,i=t.id,r=t.path,o=function(){return e.getStyle(i,r,"fontFamily")};return{getDefaultValue:function(){return o()},getOptions:function(){return Km({theme:e,translator:n,defaultValue:o()})}}}var Xm=["10px","11px","12px","13px","14px","15px","16px","17px","18px","19px","20px","21px","22px","23px","24px"],Jm=function(t){return{value:t,label:t,groupHeader:!1,disabled:!1}};function Zm(t){var e=t.theme,n=t.translator,i=t.id,r=t.path,o=function(){return e.getStyle(i,r,"fontSize")};return{getDefaultValue:function(){return o()},getOptions:function(){return function(t){var e=t.translator,n=t.defaultValue,i=[],r=t.theme.getStyle("","","fontSizes");return Array.isArray(r)&&r.length?i.push.apply(i,Am(new Set([n].concat(Am(r))))):i.push(n),[{value:"ThemeHeader",label:e.get("properties.themeFontSizes"),metaText:e.get("properties.theme"),groupHeader:!0}].concat(Am(i.map(function(t){return Jm(t)})),[{value:"DefaultHeader",label:e.get("properties.allFontSizes"),metaText:e.get("properties.default"),groupHeader:!0}],Am(Xm.map(function(t){return Jm(t)})))}({theme:e,translator:n,defaultValue:o()})}}}function Qm(t){var e=t.theme,n=t.translator,i=t.id,r=t.path;return{fontFamily:Gm({theme:e,translator:n,id:i,path:r}),fontSize:Zm({theme:e,translator:n,id:i,path:r})}}var ty,ey,ny=["__proto__","constructor"],iy=function(t){if(ny.some(function(e){return t.includes(e)}))throw new Error("font-resolver: Forbidden property.")};var ry,oy=function(){if(ey)return ty;ey=1;var t=Object.prototype.hasOwnProperty,e=Object.prototype.toString,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,r=function(t){return"function"==typeof Array.isArray?Array.isArray(t):"[object Array]"===e.call(t)},o=function(n){if(!n||"[object Object]"!==e.call(n))return!1;var i,r=t.call(n,"constructor"),o=n.constructor&&n.constructor.prototype&&t.call(n.constructor.prototype,"isPrototypeOf");if(n.constructor&&!r&&!o)return!1;for(i in n);return void 0===i||t.call(n,i)},a=function(t,e){n&&"__proto__"===e.name?n(t,e.name,{enumerable:!0,configurable:!0,value:e.newValue,writable:!0}):t[e.name]=e.newValue},s=function(e,n){if("__proto__"===n){if(!t.call(e,n))return;if(i)return i(e,n).value}return e[n]};return ty=function t(){var e,n,i,l,c,u,h=arguments[0],d=1,f=arguments.length,p=!1;for("boolean"==typeof h&&(p=h,h=arguments[1]||{},d=2),(null==h||"object"!=typeof h&&"function"!=typeof h)&&(h={});d<f;++d)if(null!=(e=arguments[d]))for(n in e)i=s(h,n),h!==(l=s(e,n))&&(p&&l&&(o(l)||(c=r(l)))?(c?(c=!1,u=i&&r(i)?i:[]):u=i&&o(i)?i:{},a(h,{name:n,newValue:t(p,u,l)})):void 0!==l&&a(h,{name:n,newValue:l}));return h},ty}(),ay=(ry=oy)&&ry.__esModule&&Object.prototype.hasOwnProperty.call(ry,"default")?ry.default:ry;function sy(t,e){return{range:function(t){var n=t.resources,i=t.data,r=n.theme.palette("categorical",0===e?i.items.length:e);return i.items.map(function(t){return r[t.value%r.length]})},valueAccessor:t.value}}function ly(t,e){return{range:function(t){var n=t.resources,i=t.data,r=n.theme.palette("categorical",0===e?i.items.length:e);return i.items.map(function(t){return r[t.row.value%r.length]})},valueAccessor:t.value}}function cy(t,e,n,i,r){var o,a,s=r.byRow,l=r.byElemNo;if(i&&(e.input.persistent||t.hc.qDimensionInfo.length>1||void 0===n.activeDimensionIndex&&t.hc.qSize.qcy>((null===(a=(o=t.hc).qDataPages[0]||o.qStackedDataPages[0])||void 0===a?void 0:a.qArea.qHeight)||0)))return l(i,i.raw().qCardinal);if(i){var c=e.pic.extract({field:i.key(),trackBy:i.value}).length;return s(i,c)}return{}}function uy(t,e){var n=t.hc.qDimensionInfo,i=e.input.byDimDef||{activeDimensionIndex:n.length-1};if(i.activeDimensionIndex>=0){var r=n[i.activeDimensionIndex];i=r.coloring&&r.coloring.colorMapRef?{type:"libraryItem",key:r.coloring.colorMapRef,activeDimensionIndex:i.activeDimensionIndex}:{activeDimensionIndex:i.activeDimensionIndex}}return i}function hy(t,e){var n;return e.activeDimensionIndex>=0?n=t.pic.fields().filter(function(t){return"dimension"===t.type()})[e.activeDimensionIndex]:"libraryItem"===e.type?!1===(n=e.key?t.pic.field(function(t){return t.raw().colorMapRef===e.key}):void 0)&&(n=t.pic.field(function(t){return"colorByAlternative"===t.raw().id})):"expression"===e.type&&(n=t.pic.field(function(t){return"colorByAlternative"===t.raw().id})),n}function dy(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function fy(t,e){var n=Object.create(t.prototype);for(var i in e)n[i]=e[i];return n}function py(){}var gy=.7,my=1/gy,yy="\\s*([+-]?\\d+)\\s*",vy="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",xy="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",by=/^#([0-9a-f]{3,8})$/,wy=new RegExp(`^rgb\\(${yy},${yy},${yy}\\)$`),ky=new RegExp(`^rgb\\(${xy},${xy},${xy}\\)$`),_y=new RegExp(`^rgba\\(${yy},${yy},${yy},${vy}\\)$`),My=new RegExp(`^rgba\\(${xy},${xy},${xy},${vy}\\)$`),Sy=new RegExp(`^hsl\\(${vy},${xy},${xy}\\)$`),Ry=new RegExp(`^hsla\\(${vy},${xy},${xy},${vy}\\)$`),Cy={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function Ny(){return this.rgb().formatHex()}function Dy(){return this.rgb().formatRgb()}function qy(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=by.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?Ey(e):3===n?new Ty(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?Oy(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?Oy(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=wy.exec(t))?new Ty(e[1],e[2],e[3],1):(e=ky.exec(t))?new Ty(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=_y.exec(t))?Oy(e[1],e[2],e[3],e[4]):(e=My.exec(t))?Oy(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=Sy.exec(t))?$y(e[1],e[2]/100,e[3]/100,1):(e=Ry.exec(t))?$y(e[1],e[2]/100,e[3]/100,e[4]):Cy.hasOwnProperty(t)?Ey(Cy[t]):"transparent"===t?new Ty(NaN,NaN,NaN,0):null}function Ey(t){return new Ty(t>>16&255,t>>8&255,255&t,1)}function Oy(t,e,n,i){return i<=0&&(t=e=n=NaN),new Ty(t,e,n,i)}function Ay(t){return t instanceof py||(t=qy(t)),t?new Ty((t=t.rgb()).r,t.g,t.b,t.opacity):new Ty}function zy(t,e,n,i){return 1===arguments.length?Ay(t):new Ty(t,e,n,null==i?1:i)}function Ty(t,e,n,i){this.r=+t,this.g=+e,this.b=+n,this.opacity=+i}function Iy(){return`#${Ly(this.r)}${Ly(this.g)}${Ly(this.b)}`}function jy(){const t=Py(this.opacity);return`${1===t?"rgb(":"rgba("}${Fy(this.r)}, ${Fy(this.g)}, ${Fy(this.b)}${1===t?")":`, ${t})`}`}function Py(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Fy(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Ly(t){return((t=Fy(t))<16?"0":"")+t.toString(16)}function $y(t,e,n,i){return i<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Hy(t,e,n,i)}function By(t){if(t instanceof Hy)return new Hy(t.h,t.s,t.l,t.opacity);if(t instanceof py||(t=qy(t)),!t)return new Hy;if(t instanceof Hy)return t;var e=(t=t.rgb()).r/255,n=t.g/255,i=t.b/255,r=Math.min(e,n,i),o=Math.max(e,n,i),a=NaN,s=o-r,l=(o+r)/2;return s?(a=e===o?(n-i)/s+6*(n<i):n===o?(i-e)/s+2:(e-n)/s+4,s/=l<.5?o+r:2-o-r,a*=60):s=l>0&&l<1?0:a,new Hy(a,s,l,t.opacity)}function Hy(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}function Wy(t){return(t=(t||0)%360)<0?t+360:t}function Vy(t){return Math.max(0,Math.min(1,t||0))}function Uy(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}dy(py,qy,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Ny,formatHex:Ny,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return By(this).formatHsl()},formatRgb:Dy,toString:Dy}),dy(Ty,zy,fy(py,{brighter(t){return t=null==t?my:Math.pow(my,t),new Ty(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?gy:Math.pow(gy,t),new Ty(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Ty(Fy(this.r),Fy(this.g),Fy(this.b),Py(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Iy,formatHex:Iy,formatHex8:function(){return`#${Ly(this.r)}${Ly(this.g)}${Ly(this.b)}${Ly(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:jy,toString:jy})),dy(Hy,function(t,e,n,i){return 1===arguments.length?By(t):new Hy(t,e,n,null==i?1:i)},fy(py,{brighter(t){return t=null==t?my:Math.pow(my,t),new Hy(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?gy:Math.pow(gy,t),new Hy(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*e,r=2*n-i;return new Ty(Uy(t>=240?t-240:t+120,r,i),Uy(t,r,i),Uy(t<120?t+240:t-120,r,i),this.opacity)},clamp(){return new Hy(Wy(this.h),Vy(this.s),Vy(this.l),Py(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=Py(this.opacity);return`${1===t?"hsl(":"hsla("}${Wy(this.h)}, ${100*Vy(this.s)}%, ${100*Vy(this.l)}%${1===t?")":`, ${t})`}`}}));const Yy=Math.PI/180,Ky=180/Math.PI,Gy=.96422,Xy=.82521,Jy=4/29,Zy=6/29,Qy=3*Zy*Zy,tv=Zy*Zy*Zy;function ev(t){if(t instanceof nv)return new nv(t.l,t.a,t.b,t.opacity);if(t instanceof sv)return lv(t);t instanceof Ty||(t=Ay(t));var e,n,i=av(t.r),r=av(t.g),o=av(t.b),a=iv((.2225045*i+.7168786*r+.0606169*o)/1);return i===r&&r===o?e=n=a:(e=iv((.4360747*i+.3850649*r+.1430804*o)/Gy),n=iv((.0139322*i+.0971045*r+.7141733*o)/Xy)),new nv(116*a-16,500*(e-a),200*(a-n),t.opacity)}function nv(t,e,n,i){this.l=+t,this.a=+e,this.b=+n,this.opacity=+i}function iv(t){return t>tv?Math.pow(t,1/3):t/Qy+Jy}function rv(t){return t>Zy?t*t*t:Qy*(t-Jy)}function ov(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function av(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function sv(t,e,n,i){this.h=+t,this.c=+e,this.l=+n,this.opacity=+i}function lv(t){if(isNaN(t.h))return new nv(t.l,0,0,t.opacity);var e=t.h*Yy;return new nv(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}dy(nv,function(t,e,n,i){return 1===arguments.length?ev(t):new nv(t,e,n,null==i?1:i)},fy(py,{brighter(t){return new nv(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker(t){return new nv(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return new Ty(ov(3.1338561*(e=Gy*rv(e))-1.6168667*(t=1*rv(t))-.4906146*(n=Xy*rv(n))),ov(-.9787684*e+1.9161415*t+.033454*n),ov(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}})),dy(sv,function(t,e,n,i){return 1===arguments.length?function(t){if(t instanceof sv)return new sv(t.h,t.c,t.l,t.opacity);if(t instanceof nv||(t=ev(t)),0===t.a&&0===t.b)return new sv(NaN,0<t.l&&t.l<100?0:NaN,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*Ky;return new sv(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}(t):new sv(t,e,n,null==i?1:i)},fy(py,{brighter(t){return new sv(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker(t){return new sv(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb(){return lv(this).rgb()}}));var cv=t=>()=>t;function uv(t,e){var n=e-t;return n?function(t,e){return function(n){return t+n*e}}(t,n):cv(isNaN(t)?e:t)}var hv=function t(e){var n=function(t){return 1===(t=+t)?uv:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(i){return Math.pow(t+i*e,n)}}(e,n,t):cv(isNaN(e)?n:e)}}(e);function i(t,e){var i=n((t=zy(t)).r,(e=zy(e)).r),r=n(t.g,e.g),o=n(t.b,e.b),a=uv(t.opacity,e.opacity);return function(e){return t.r=i(e),t.g=r(e),t.b=o(e),t.opacity=a(e),t+""}}return i.gamma=t,i}(1),dv=/^class(-pyramid)?/,fv=function(t,e,n,i){var r=void 0!==n.min?n.min:i.min(),o=void 0!==n.max?n.max:i.max(),a=r,s=o,l=e.limits,c={},u="percent"===e.limitType?l.map(function(t){return r+(o-r)*t}):l,h=e.colors.map(function(e){return t.resolveUIColor(e)});if(r=Math.min.apply(Math,[r].concat(Am(u))),o=Math.max.apply(Math,[o].concat(Am(u))),c.min=r,c.max=o,e.breakTypes&&-1===e.breakTypes.indexOf(!0))c.type="categorical",Object.assign(c,function(t){var e=t.min,n=t.max,i=t.limits,r=t.range,o=[],a=[];if(i.length)if(i[i.length-1]<e)a.push(e,n),o.push(r[r.length-1],r[r.length-1],r[r.length-1]);else if(i[0]>n)a.push(e,n),o.push(r[0],r[0],r[0]);else{if(i[0]>e)a.push(e),o.push(r[0]);else{a.push(e);for(var s=0;s<i.length;s++)if(e<i[s]){o.push(r[s]);break}}for(var l=0;l<i.length;l++)e<i[l]&&i[l]<n&&(a.push(i[l]),o.push(r[l]));if(i[i.length-1]<n)a.push(n),o.push(r[i.length]),o.push(r[i.length]);else{a.push(n);for(var c=0;c<i.length;c++)if(i[c]>n){o.push(r[c]),o.push(r[c]);break}}}else o.push(r[0]);return{min:e,max:n,range:o,domain:a}}({min:"percent"===e.limitType?r:a,max:"percent"===e.limitType?o:s,range:h,limits:"percent"===e.limitType?u:l}));else if(e.breakTypes){var d=e.breakTypes;c.type="continuous",c.domain=[r],c.range=[h[0]];for(var f=0;f<u.length;f+=1)if(d[f]){var p=h[f],g=h[f+1],m=hv(p,g)(.5);c.range.push(m),c.domain.push(u[f]),f<u.length-1&&d[f+1]&&(c.range.push(h[f+1]),c.domain.push((u[f]+u[f+1])/2))}else c.range.push(h[f]),c.range.push(h[f+1]),c.domain.push(u[f]),c.domain.push(u[f]+Math.min(1e-6,(o-r)/1e6));c.range.push(h[h.length-1]),c.domain.push(o)}else c.domain=u,c.range=h;return c};function pv(t,e,n,i,r){var o,a,s,l=0,c=[],u=(t-e)/(i+1);if(0===u)return 1;for(o=0;o<n.length;o+=1)a=.99*(n[o]-e),s=n[o]>t?Math.floor(t/u):n[o]<e?0:Math.floor(a/u),Number.isNaN(s)||(c[s]?c[s]+=1:c[s]=1);for(o=0;o<c.length;o+=1)c[o]&&(l+=1);return l<=i||l>=r?Math.max(l,i):pv(t,e,n,i+1,r)}var gv=function(t,e,n,i){var r,o,a=e.theme,s=e.hc,l=i.f,c={mode:"field",fieldType:"measure",field:l?l.key():void 0,reverse:n.input.reverseScheme||!1,type:"continuous",range:function(t){return t.resources.theme.palette("quant")}},u=[],h=!0;if(l){if(Number.isNaN(+l.min())||Number.isNaN(+l.max()))return{invalid:!0};(h=!("S"===(r=n.pic.raw()).qMode&&(r.qDataPages[0]&&r.qSize.qcy>r.qDataPages[0].qArea.qHeight||!r.qDataPages.length&&r.qSize.qcy>0)||"K"===r.qMode&&r.qStackedDataPages[0]&&r.qSize.qcy>r.qStackedDataPages[0].qArea.qHeight||"T"===r.qMode&&r.qSize.qcy>r.qTreeDataPages[0].qGroupSize))&&(u=n.pic.extract({field:0,props:{num:{field:l.key()},exclude:{fields:s.qDimensionInfo.map(function(t,e){return{field:"qDimensionInfo/".concat(e)}}),value:function(t){return Math.min.apply(Math,Am(t))<0}}}}).filter(function(t){return t.value>=0&&!t.exclude.value}).map(function(t){return t.num.value}).filter(function(t){return"number"==typeof t}))}if(!1===n.input.autoMinMax){if(c.min=n.input.measureMin,c.max=n.input.measureMax,c.max<c.min)return{invalid:!0}}else if(l&&!h)c.min=l.min(),c.max=l.max();else if(l){if(!u.length)return{invalid:!0};c.min=Math.min.apply(Math,Am(u)),c.max=Math.max.apply(Math,Am(u))}if(n.input.measureScheme&&(c.palettes={quant:n.input.measureScheme}),a){var d=a.getDataColorScales().filter(function(t){return t.key===n.input.measureScheme})[0];c.type=d&&dv.test(d.type)?"categorical":"continuous","categorical"===c.type&&(o=d.colors.some(function(t){return Array.isArray(t)})?Math.max.apply(Math,Am(d.colors.map(function(t){return t?t.length:0}))):d.colors.length)}if("categorical"===c.type){for(var f=h?pv(c.max,c.min,u,1,o):o,p=(c.max-c.min)/f,g=[],m=0;m<f+1;m+=1)g.push(c.min+p*m);c.domain=g,c.range=function(t){for(var e=t.resources.theme.palette("quant",f),n=Math.max(1,Math.floor(e.length/f)),i=[],r=0;r<f;r+=1)i.push(e[r*n]);return[i[0]].concat(i,[i[i.length-1]])}}return c};function mv(t,e){var n;return e.activeMeasureIndex>=0?n=t.pic.fields().filter(function(t){return"measure"===t.type()})[e.activeMeasureIndex]:"libraryItem"===e.type?n=t.pic.field(function(t){return t.raw().colorMapRef===e.key&&void 0!==e.key}):"expression"===e.type&&(n=t.pic.field(function(t){return"colorByAlternative"===t.raw().id})),n||(n=t.pic.field(function(t){return void 0!==t.raw().matchMeasure}))&&(n=t.pic.fields().filter(function(t){return"measure"===t.type()})[n.raw().matchMeasure]),n}function yv(t){t.measureOverrides.every(function(t){return!t})&&(t.measureOverrides=null)}function vv(t,e){for(var n=(null==e?void 0:e.domain)||[],i=(null==e?void 0:e.range)||[],r=[],o=0;o<t.length;++o){var a=t[o];if("constant"===(null==a?void 0:a.mode)){var s=n.indexOf(o);-1===s?(n.push(o),i.push(a.primary)):i[s]=a.primary,t[o]=null}else if(a){r.push(o);var l=n.indexOf(o);-1!==l&&(n.splice(l,1),i.splice(l,1))}}return{domain:n,range:i,exclude:r}}function xv(t,e,n,i){var r,o=function(t,e,n,i){if(e.input&&!e.input.auto){if("byMeasure"===e.input.mode)return function(t,e,n){var i=e.theme,r=e.hc,o=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).getCField,a=void 0===o?mv:o,s=n.input.byMeasureDef||{activeMeasureIndex:0},l=a(n,s),c=gv(0,{theme:i,hc:r},n,{f:l});if(c.invalid)return c;"expression"===s.type&&(s.activeMeasureIndex<0||void 0===s.activeMeasureIndex)&&(c.label=s.label,l&&"color.altLabel"===l.raw().labelExpRef&&(c.label=n.input.altLabel)),!c.label&&l&&(c.label=l.title());var u=s.activeMeasureIndex>=0?l:null;if(!u&&l&&void 0!==l.raw().matchMeasure&&l.raw().matchMeasure>-1&&(u=n.pic.fields().filter(function(t){return"measure"===t.type()})[l.raw().matchMeasure]),n.input.useMeasureGradient&&"libraryItem"===s.type)if(u){var h=u.raw().coloring;h&&h.gradient&&ay(c,fv(t,h.gradient,c,u))}else c.auxiliary=s;return c}(t,n,e);if("byDimension"===e.input.mode)return function(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=i.getCDef,o=void 0===r?uy:r,a=i.getCByField,s=void 0===a?hy:a,l=i.getPersistence,c=void 0===l?cy:l,u=o(e,n),h=s(n,u),d=h?h.raw():{},f=n&&n.pic?n.pic.raw():{};if(d.qError||d.qSize&&0===d.qSize.qcy&&!f.qHasOtherValues)return{invalid:!0};var p={mode:"field",fieldType:"dimension",type:"categorical",field:h?h.key():void 0,isFieldLocked:d.qLocked};return("expression"===u.type||u.activeDimensionIndex<0)&&(p.label=u.label,"color.altLabel"===d.labelExpRef&&(p.label=n.input.altLabel)),!p.label&&h&&(p.label=h.title()),n.input.dimensionScheme&&(p.palettes={categorical:n.input.dimensionScheme}),n.input.useDimColVal&&"libraryItem"===u.type&&(p.auxiliary=u),ay(p,c(e,n,u,h,{byRow:ly,byElemNo:sy})),p}(t,n,e);if("byExpression"===e.input.mode)return function(t,e,n,i){var r=e.hc,o=e.theme,a=e.translator,s=n.pic.field(function(t){return"colorByExpression"===t.raw().id});if(!s||!s.raw().qFallbackTitle&&!n.input.colorExpression||!(Number.isFinite(s.raw().qMin)&&Number.isFinite(s.raw().qMax)||n.input.expressionIsColor))return{mode:"constant",type:"constant",primary:i.nil};if(n.input.expressionIsColor)return{mode:"field",fieldType:"expression",field:s?s.key():void 0,type:"color"};var l=gv(0,{hc:r,theme:o},n,{f:s});return l.invalid||(l.label=n.input.expressionLabel||a.get("Object.ChartTooltip.ColorExpression")),l}(0,n,e,i);if("byMultiple"===e.input.mode||"primary"===e.input.mode)return function(t,e,n,i){var r=e.hc,o=e.theme,a=e.translator,s=n.input.useBaseColors;if(("byMultiple"===n.input.mode||"primary"===n.input.mode&&"measure"===n.input.useBaseColors)&&r.qMeasureInfo.length>1&&(s="measure"),"measure"===s){var l=[],c=[];"measure"===n.input.useBaseColors&&r.qMeasureInfo.forEach(function(e,n){if(e.baseColor||e.coloring&&e.coloring.baseColor){l.push(n);var r=t.resolveUIColor(e.baseColor||e.coloring.baseColor);"none"===r?c.push(i.primary):c.push(r)}});var u=n.input.dimensionScheme?{categorical:n.input.dimensionScheme}:void 0,h=o?o.getDataColorPalettes()[0]:void 0;return"measure"===n.input.useBaseColors&&h&&(u={categorical:h.key}),{mode:"measure",type:"categorical",palettes:u,label:a?a.get("Common.Measures"):void 0,explicit:l.length?{domain:l,range:c}:void 0}}if("dimension"===s){var d=[],f=[];return r.qDimensionInfo.forEach(function(e,n){if(e.baseColor||e.coloring&&e.coloring.baseColor){d.push(n);var r=t.resolveUIColor(e.baseColor||e.coloring.baseColor);"none"===r?f.push(i.primary):f.push(r)}}),{mode:"dimension",type:"categorical",field:d.length?d[0]:void 0,explicit:d.length?{domain:d,range:f}:void 0}}var p=i.primary;if(void 0!==n.input.paletteColor)n.input.paletteColor&&(p=t.resolveUIColor(n.input.paletteColor));else{var g=n.input.singleColor;"number"!=typeof g||Number.isNaN(g)||(p=["#b0afae","#7b7a78","#545352","#4477aa","#7db8da","#b6d7ea","#46c646","#f93f17","#ffcf02","#276e27","#ffffff","#000000"][g])}return{mode:"constant",type:"constant",primary:p}}(t,n,e,i)}return{}}(t,e,n,i);return null!==(r=e.input)&&void 0!==r&&r.measureOverrides?(o.measureOverrides=e.input.measureOverrides.map(function(n,r){return function(t){var e,n=t.cm,i=t.defaults,r=t.index,o=t.input,a=t.pic;if(!o||!o.on)return null;var s=null!==(e=o.mode)&&void 0!==e?e:"primary";return"primary"===s?function(t,e,n){var i=n.primary;return void 0!==e.paletteColor&&e.paletteColor&&(i=t.resolveUIColor(e.paletteColor)),Nm(Nm({},n),{},{mode:"constant",type:"constant",primary:i})}(n,o,i):"byExpression"===s?function(t,e,n){var i="qMeasureInfo/".concat(t,"/"),r=e.field(function(t){return t.id().startsWith(i)&&"colorByMeasureExpression"===t.raw().id}),o=r;return Nm(Nm({},n),{},o?{mode:"field",fieldType:"expression",field:r?r.key():void 0,type:"color"}:{mode:"constant",type:"constant",primary:n.nil})}(r,a,i):null}({cm:t,input:n,defaults:i,index:r,pic:e.pic})}),function(t,e){var n,i,r,o=e.translator;if(yv(t),1===(null===(n=t.measureOverrides)||void 0===n?void 0:n.length))return t.measureOverrides[0];if("measure"===t.mode&&t.measureOverrides&&(t.explicit=vv(t.measureOverrides,t.explicit),yv(t)),null!==(i=t.measureOverrides)&&void 0!==i&&i.every(function(t){return"constant"===(null==t?void 0:t.mode)})){var a={mode:"measure",type:"categorical",label:null==o?void 0:o.get("Common.Measures")};return a.explicit=vv(t.measureOverrides),a}return null!==(r=t.measureOverrides)&&void 0!==r&&r.every(function(t){return t})?{invalid:!0,measureOverrides:t.measureOverrides}:t}(o,n)):o}var bv=function(t,e){var n=t.fieldType,i={};if(e)if("measure"===n){var r=e.coloring;r&&(i.measureGradient=r.gradient)}else if("dimension"===n){var o=e[0],a=e[1];o&&(i.legendDataPage=o),a&&(i.dimValsData=a.colorMap)}return i},wv=function(t){throw t.isHandled=!0,t};function kv(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.auto,n=function(t){var e=Nm({hc:null,colorProps:null,layout:null,theme:null},t),n={},i={auto:function(){return{mode:"primary"}},getDimensionColorMap:function(){return Promise.reject()},getMeasure:function(){return Promise.reject()},getAttributeDimension:function(){return Promise.reject()}},r={auto:function(t){return t?(i.auto=t,r):i.auto},getDimensionColorMap:function(t){return t?(i.getDimensionColorMap=t,r):i.getDimensionColorMap},getAttributeDimension:function(t){return t?(i.getAttributeDimension=t,r):i.getAttributeDimension},getMeasure:function(t){return t?(i.getMeasure=t,r):i.getMeasure},set:function(t){var r;if(!t.colorProps)throw new Error('Missing "colorProps"');if(ay(e,t),(n={pic:e.picasso.data("q")({data:e.hc,config:{localeInfo:e.localeInfo}}),input:e.colorProps}).input.auto){var o=i.auto(t.layout);n.input=ay(!0,{},n.input,o,{auto:!1});var a=e.theme?e.theme.getDataColorPalettes():[];a[0]&&(n.input.dimensionScheme=a[0].key);var s=0;n.input.byDimDef&&+n.input.byDimDef.activeDimensionIndex>=0&&(s=+n.input.byDimDef.activeDimensionIndex),e.hc&&e.hc.qDimensionInfo[s]&&e.hc.qDimensionInfo[s].coloring&&e.hc.qDimensionInfo[s].coloring.colorMapRef&&n.input.byDimDef&&(n.input.byDimDef.type="libraryItem",n.input.byDimDef.key=e.hc.qDimensionInfo[s].coloring.colorMapRef)}null!==(r=n.input.measureOverrides)&&void 0!==r&&r.every(function(t){return!t||!t.on})&&(n.input=ay(!1,{},n.input,{measureOverrides:null}))},palettes:function(){if(!n.palettes){var t=e.theme,i=[];(t&&t.getDataColorPickerPalettes()||[]).forEach(function(t){i.push({key:"ui",colors:t.colors})}),n.palettes=i}return n.palettes},getAuxiliaryData:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/qHyperCubeDef";if(!t.auxiliary&&!/qAttrDimInfo/.test(t.field))return Promise.resolve();var r=(t.auxiliary||{}).key;if("measure"===t.fieldType)return i.getMeasure(r,e).catch(function(){});if("dimension"===t.fieldType){var o="".concat(n,"/").concat(t.field).replace("qDimensionInfo","qDimensions").replace("qAttrDimInfo","qAttributeDimensions");return Promise.all([/qAttrDimInfo/.test(t.field)?i.getAttributeDimension(o,e).catch(function(){}):Promise.resolve(),r?i.getDimensionColorMap(r,e).catch(function(){}):Promise.resolve()])}return Promise.resolve()},getAuxiliarySettings:function(t,i){var r=this;return t.auxiliary||/qAttrDimInfo/.test(t.field)?(this.palettes(),this.getAuxiliaryData(t,i).then(function(i){if(!i)return{};if("measure"===t.fieldType){if(i.coloring&&i.coloring.gradient){var o=n.pic.field(t.field);return fv(r,i.coloring.gradient,t,o)}return{}}if("dimension"===t.fieldType){var a={nil:t.nil,others:t.others},s=i[0],l=i[1]?i[1].colorMap:null;if(s){var c=e.picasso.data("q")({data:{qDimensionInfo:[n.pic.field(t.field).raw(),n.pic.field(t.field).raw()],qMeasureInfo:[],qDataPages:s,qInterColumnSortOrder:[0,1],qMode:"S"}});a.legendDataset=c}return l?function(t,e,n,i){var r=i.external,o=i.field,a=Nm({},t);ay(a,sy(o,o.raw().qCardinal));var s=r.theme?r.theme.getDataColorPalettes()[0]:null;return e.nul&&(a.nil=n.resolveUIColor(e.nul)),e.oth&&(a.others=n.resolveUIColor(e.oth)),e.usePal?(a.palettes={categorical:e.pal},s&&!e.pal&&(a.palettes.categorical=s.key,ay(a,sy(o)))):!1===e.autoFill&&e.single?a.range=[n.resolveUIColor(e.single)]:e.autoFill&&(s&&(a.palettes={categorical:s.key}),ay(a,sy(o))),e.colors&&e.colors.length&&(a.explicit=function(t,e,n){for(var i={},r=0;r<t.length;r+=1)i[t[r].value]=t[r].baseColor;var o=[];return{domain:function(t){var r=t.data,a=[];o=[];for(var s=0;s<r.items.length;s++){var l=r.items[s],c=(l.text||l).label;i[c]&&-1===a.indexOf(l.value)&&(a.push(l.value),o.push(e.resolveUIColor(i[c])))}return a.push(-3,-2),o.push(n.others),o.push(n.nil),a},range:function(){return o}}}(e.colors,n,a)),a}(a,l,r,{external:e,field:n.pic.field(t.field)}):a}return{}})):Promise.resolve()},resolveUIColor:function(t){if(t.index<0||void 0===t.index)return t.color;if(void 0===n.uiPalette&&(n.uiPalette=this.palettes().filter(function(t){return"ui"===t.key})[0]||!1),!n.uiPalette)return t.color;var e="none"===n.uiPalette.colors[0]?t.index:t.index-1;return void 0===n.uiPalette.colors[e]?t.color:n.uiPalette.colors[e]},settings:function(){if(this.palettes(),!n.settings){var t={primary:"steelblue",others:"#aaa",nil:"#ddd"},i=e.theme;i&&(t=Nm(Nm({},t),i.getDataColorSpecials())),n.settings=ay(t,xv(this,n,e,t))}return n.settings}};return r}(t.resources).auto(e||function(){return{mode:"byDimension",persistent:!1,useDimColVal:!0,byDimDef:{activeDimensionIndex:0,type:"expression",label:""}}}).getDimensionColorMap(function(t,e){return function(t,e){var n=e.layout,i=e.app;return n&&n.snapshotData?n.snapshotData.content&&n.snapshotData.content.chartData&&n.snapshotData.content.chartData.dimValsData?Promise.resolve({colorMap:n.snapshotData.content.chartData.dimValsData}):Promise.reject():i&&i.getObject?i.getObject("ColorMapModel_".concat(t)).then(function(t){return t.getLayout()}):Promise.reject()}(t,{layout:e.layout,app:e.app})}).getMeasure(function(t,e){return function(t,e){var n=e.layout,i=e.app;return n&&n.snapshotData?n.snapshotData.content&&n.snapshotData.content.chartData&&n.snapshotData.content.chartData.measureGradient?Promise.resolve({coloring:{gradient:n.snapshotData.content.chartData.measureGradient}}):Promise.reject():i&&i.getMeasure?i.getMeasure(t).then(function(t){return t.getMeasure()}):Promise.reject()}(t,{layout:e.layout,app:e.app})}).getAttributeDimension(function(t,e){return function(t,e){var n=e.layout,i=e.model,r=e.app;return n&&n.snapshotData?n.snapshotData.content&&n.snapshotData.content.chartData&&n.snapshotData.content.chartData.legendDataPage?Promise.resolve(n.snapshotData.content.chartData.legendDataPage):Promise.reject():i&&i.session&&r?i.getHyperCubeData(t,[{qHeight:100,qLeft:0,qTop:0,qWidth:2}]).catch(wv):Promise.reject()}(t,{layout:e.layout,model:e.model,app:e.app})});return n.getSnapshotData=bv,n}function _v(t){return function(e){return"object"===zm(e.datum[t])?e.datum[t].value:void 0}}function Mv(t){return"object"===zm(t.datum.isNull)?t.datum.isNull.value:-2===t.datum.value}function Sv(t){return-3===t.datum.value}var Rv={COLOR:void 0,FONT_SIZE:"16px",FONT_FAMILY:"'Source Sans Pro', 'Arial', 'sans-serif'"},Cv={COLOR:void 0,FONT_SIZE:void 0,FONT_FAMILY:"'Source Sans Pro', 'Arial', 'sans-serif'"},Nv="legend.title",Dv="legend.label";function qv(t){var e=t.theme,n=t.key,i=t.styleOverrides,r={title:{color:Rv.COLOR,fontSize:Rv.FONT_SIZE,fontFamily:Rv.FONT_FAMILY},label:{color:Cv.COLOR,fontSize:Cv.FONT_SIZE,fontFamily:Cv.FONT_FAMILY}};if(!e&&!i)return r;var o=i||{},a=o.title,s=o.label,l=function(t){var e=t.theme,n=t.key;return function(t,i,r,o){return void 0!==t?t:e?e.getStyle(n,i,r):o}}({theme:e,key:n});return r.title.color=l(null==a?void 0:a.color,Nv,"color",Rv.COLOR),r.title.fontSize=l(null==a?void 0:a.fontSize,Nv,"fontSize",Rv.FONT_SIZE),r.title.fontFamily=l(null==a?void 0:a.fontFamily,Nv,"fontFamily",Rv.FONT_FAMILY),r.label.color=l(null==s?void 0:s.color,Dv,"color",Cv.COLOR),r.label.fontSize=l(null==s?void 0:s.fontSize,Dv,"fontSize",Cv.FONT_SIZE),r.label.fontFamily=l(null==s?void 0:s.fontFamily,Dv,"fontFamily",Cv.FONT_FAMILY),r}var Ev=function(t,e,n){var i=t&&t.dock||void 0;if("auto"!==i)return i||"right";if(e){var r=e.element.getBoundingClientRect();if(r.height>r.width)return"bottom"}return n?"left":"right"},Ov=function(t,e,n){return!(n.invalid||"color"===n.type||"measure"===n.mode&&e.qMeasureInfo.length<=1||"dimension"===n.mode)&&("function"==typeof t.show?t.show():!1!==t.show)};function Av(t,e){var n=t.styleReference,i=t.styleOverrides,r=t.chart,o=t.rtl,a=e.legendProps,s=e.coloring,l=e.theme,c=e.hc,u=qv({theme:l,key:n,styleOverrides:i});return{layout:{minimumLayoutMode:"MEDIUM",dock:Ev(a,r,o)},show:"function"==typeof a.show?function(){return Ov(a,c,s)}:Ov(a,c,s),renderer:"svg",mounted:function(t){t.childNodes[0].style.pointerEvents="none",t.style.overflow="hidden"},settings:{title:{show:!1!==a.showTitle,wordBreak:"break-word",maxLines:2,lineHeight:1.2,text:s.label||"",fill:u.title.color,fontSize:u.title.fontSize,fontFamily:u.title.fontFamily}}}}function zv(t,e,n){var i=[],r=[],o=function(t,e,n){return"categorical"===e.coloring.type?function(t,e,n){var i=Av(t,e);if(!i.show)return!1;var r,o=t.key,a=t.styleReference,s=t.styleOverrides,l=t.viewState,c=t.rtl,u=t.settings,h=t.style,d=e.scaleKey,f=e.theme,p=e.scales,g=qv({theme:f,key:a,styleOverrides:s}),m=i.layout.dock,y="left"===m||"right"===m?{maxLines:2,wordBreak:"break-word"}:{},v={up:"M13.6,11 L2.4,11 C2.28954305,11 2.2,10.9104569 2.2,10.8 C2.2,10.756726 2.21403557,10.7146192 2.24,10.68 L7.84,3.21333333 C7.90627417,3.12496777 8.03163444,3.10705916 8.12,3.17333333 C8.13516113,3.18470418 8.14862915,3.1981722 8.16,3.21333333 L13.76,10.68 C13.8262742,10.7683656 13.8083656,10.8937258 13.72,10.96 C13.6853808,10.9859644 13.643274,11 13.6,11 Z",down:"M2.4,4 L13.6,4 C13.7104569,4 13.8,4.08954305 13.8,4.2 C13.8,4.24327404 13.7859644,4.28538077 13.76,4.32 L8.16,11.7866667 C8.09372583,11.8750322 7.96836556,11.8929408 7.88,11.8266667 C7.86483887,11.8152958 7.85137085,11.8018278 7.84,11.7866667 L2.24,4.32 C2.17372583,4.23163444 2.19163444,4.10627417 2.28,4.04 C2.31461923,4.01403557 2.35672596,4 2.4,4 Z",left:"M11,2.4 L11,13.6 C11,13.7104569 10.9104569,13.8 10.8,13.8 C10.756726,13.8 10.7146192,13.7859644 10.68,13.76 L3.21333333,8.16 C3.12496777,8.09372583 3.10705916,7.96836556 3.17333333,7.88 C3.18470418,7.86483887 3.1981722,7.85137085 3.21333333,7.84 L10.68,2.24 C10.7683656,2.17372583 10.8937258,2.19163444 10.96,2.28 C10.9859644,2.31461923 11,2.35672596 11,2.4 Z",right:"M4,13.6 L4,2.4 C4,2.28954305 4.08954305,2.2 4.2,2.2 C4.24327404,2.2 4.28538077,2.21403557 4.32,2.24 L11.7866667,7.84 C11.8750322,7.90627417 11.8929408,8.03163444 11.8266667,8.12 C11.8152958,8.13516113 11.8018278,8.14862915 11.7866667,8.16 L4.32,13.76 C4.23163444,13.8262742 4.10627417,13.8083656 4.04,13.72 C4.01403557,13.6853808 4,13.643274 4,13.6 Z"};"dimension"===e.coloring.fieldType&&(r=function(t){return t.datum.value>=0||-3===t.datum.value});var x="".concat(d,"Legend");return ay(!0,i,{type:"legend-cat",key:"".concat(o,"-cat"),scale:x in p?x:d,settings:{layout:{scrollOffset:function(){return l?l.get("legendScrollOffset"):void 0},size:-1!==["top","bottom"].indexOf(i.layout.dock)?2:1,direction:c?"rtl":"ltr",horizontal:20},item:{show:r,label:Nm({fill:g.label.color,fontSize:g.label.fontSize,fontFamily:g.label.fontFamily},y)},navigation:{disabled:n,button:{content:function(t,e){var n=e.direction;return t("i",{style:{"pointer-events":"none",fontSize:"12px",display:"inline-block",fontStyle:"normal",lineHeight:"0",textAlign:"center",textTransform:"none",verticalAlign:"-0.125em",textRendering:"optimizelegibility",margin:"0px"}},[t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor"},[t("path",{d:v[n]})])])}}}},brush:{consume:[{context:"selection",data:["",o],style:{inactive:{opacity:.3}}}]}},{settings:u,style:h})}(t,e,n):"continuous"===e.coloring.type&&function(t,e){var n,i=t.key,r=t.styleReference,o=t.styleOverrides,a=t.rtl,s=t.settings,l=t.style,c=e.scaleKey,u=e.theme,h="".concat(c,"Range"),d=Av(t,e);if(!d.show)return!1;var f=qv({theme:u,key:r,styleOverrides:o}),p=d.layout.dock,g="right"===p||"left"===p,m=null===(n=e.scales)||void 0===n?void 0:n[h];return g&&m&&(m.invert=!0),ay(!0,d,{type:"legend-seq",key:"".concat(i,"-seq"),settings:{fill:c,major:h,length:1,tick:{fill:f.label.color,fontSize:f.label.fontSize,fontFamily:f.label.fontFamily},title:{anchor:!a||"top"!==d.layout.dock&&"bottom"!==d.layout.dock?void 0:"right",padding:parseFloat(d.settings.title.fontSize)||16}}},{settings:s,style:l})}(t,e)}(t,e,n&&n.navigationDisabled);return i.push(o),o&&"legend-cat"===o.type&&(r.push(function(t){var e=t.key,n=t.requireFailure,i=t.recognizeWith,r=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).actions;return{key:"event:tap-".concat(e),type:"Tap",requireFailure:n,recognizeWith:i,options:{event:"legendtap",interval:10,pointers:1,enable:function(t,n){var i;if(!n)return!0;if(null!=r&&null!==(i=r.interact)&&void 0!==i&&i.enabled&&!r.interact.enabled())return!1;if(!this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).some(function(t){return t.key==="".concat(e,"-cat")}))return!1;var o=n.srcEvent.target;return!!(o&&o.hasAttribute("data-action")&&o.hasAttribute("data-component-key"))||!(!o||!o.childNodes[0]||"BUTTON"!==o.childNodes[0].nodeName)}},events:{legendtap:function(t){t.preventDefault();var e=t.srcEvent.target;e&&e.hasAttribute("data-action")&&e.hasAttribute("data-component-key")&&this.chart.component(e.getAttribute("data-component-key")).emit(e.getAttribute("data-action"))}}}}(t,n)),r.push(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.eventName,n=t.key,i=t.requireFailure,r=t.recognizeWith,o=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).actions;return{key:"event:pan-".concat(n),type:"Pan",requireFailure:i,recognizeWith:r,options:{event:e,pointers:1,threshold:10,enable:function(t,i){var r;return this.started===e||!i||!(null!=o&&null!==(r=o.interact)&&void 0!==r&&r.enabled&&!o.interact.enabled())&&this.chart.componentsFromPoint({x:i.center.x,y:i.center.y}).some(function(t){return t.key==="".concat(n,"-cat")})}},events:Rm(Rm(Rm({},"".concat(e,"start"),function(t){t.preventDefault(),this.started!==e&&(this.started=e,this.chart.component("".concat(n,"-cat")).emit("panstart",t))}),"".concat(e,"move"),function(t){t.preventDefault(),this.chart.component("".concat(n,"-cat")).emit("panmove",t)}),"".concat(e,"end"),function(t){t.preventDefault(),this.chart.component("".concat(n,"-cat")).emit("panend",t),this.started=!1})}}(t,n))),{interactions:r,components:i}}function Tv(t){var e=kv({resources:t}),n={},i={},r=function(t){return i.settings||(t||console.warn("settings() called before auxiliarySettings()"),i.settings=e.settings()),i.settings},o={config:function(r){if(n=Nm({},r),i={},!n.key)throw new Error("Missing key");e.set(Nm(Nm({},t),n))},auto:function(t){return t?(e.auto(t),o):e.auto()},getAuxiliarySettings:function(t){return i.auxiliarySettings?Promise.resolve(i.auxiliarySettings):e.getAuxiliarySettings(r(!0),t).then(function(t){return i.auxiliarySettings=t||{},i.settings=Nm(Nm({},i.settings),i.auxiliarySettings),i.scales=void 0,i.color=void 0,i.auxiliarySettings})},getAuxiliaryData:function(){return e.getAuxiliaryData(r())},getSnapshotData:function(t){var n=r();return e.getAuxiliaryData(n,t).then(function(t){return e.getSnapshotData(n,t)})},resolveUIColor:function(t){return e.resolveUIColor(t)},settings:function(){var t=r();return{mode:t.mode,type:t.type,label:t.label,field:t.field,fieldType:t.fieldType,nil:t.nil,others:t.others,primary:t.primary}},settingsForMeasure:function(t){var e;return(null===(e=r().measureOverrides)||void 0===e?void 0:e[t])||this.settings()},isSelectionLocked:function(t){var e=t.isMeasureSelectionLocked;return function(t,e){var n=e.isMeasureSelectionLocked;return"field"!==t.mode||("dimension"===t.fieldType?t.isFieldLocked:"measure"!==t.fieldType||n)}(r(),{isMeasureSelectionLocked:e})},palettes:function(){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.colorProps,n=t.coloring,i=t.theme,r=[];if(n&&n.palettes&&i){var o=n.palettes.categorical||e.dimensionScheme,a=i.getDataColorPalettes().filter(function(t){return t.key===o})[0]||i.getDataColorPalettes()[0];o&&a&&r.push({key:"categorical",colors:a.colors});var s=n.palettes.metric||e.measureScheme,l=i.getDataColorScales().filter(function(t){return t.key===s})[0]||i.getDataColorScales()[0];if(l){var c=l.colors[0]?l.colors:[[]].concat(Am(l.colors.slice(1)));c=Array.isArray(c[0])?c.map(function(t){return t.slice().reverse()}):c.slice().reverse(),r.push({key:"quant",colors:c})}}return r}({coloring:r(),colorProps:n.colorProps,theme:n.theme})},scales:function(){return i.scales=i.scales||function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.hc,n=t.coloring,i=t.rtl,r=t.key,o=t.source,a=t.picasso,s={},l=r;if(n){var c={override:!0,domain:n.explicit&&"function"==typeof n.explicit.domain?n.explicit.domain:[].concat(Am((n.explicit||{}).domain||[]),[-3,-2]),range:n.explicit&&"function"==typeof n.explicit.range?n.explicit.range:[].concat(Am((n.explicit||{}).range||[]),[n.others,n.nil])};if("field"===n.mode){if("dimension"===n.fieldType){var u,h=function(t){var e=t.hc,n=t.coloring,i={data:{extract:[{source:"dummy",field:0,filter:function(){return i.expando=e.qDataPages[0]?e.qDataPages[0].qArea.qTop:0,!1}},{source:t.source,field:n.field,trackBy:n.valueAccessor,reduce:"first",props:{row:{reduce:function(){return i.expando++}},text:{value:function(t){return t.qText},reduce:"first"}}}]},expando:0};return i}({hc:e,source:o,coloring:n}),d=h.data;if(n.legendDataset){var f=0,p={};a.data("q")({data:e}).extract({field:n.field,trackBy:n.valueAccessor,reduce:function(t){var e=t[0];return p[e]=f++,t[0]}}),u={source:"attrDim",extract:{field:"qDimensionInfo/0",filter:function(t){return t.qElemNumber>=0},props:{row:{value:function(t){return p[t.qElemNumber]}}}}}}var g={data:d,range:n.range,domain:n.domain,explicit:c,type:"categorical-color",label:function(t){return t.datum.text&&t.datum.text.value?t.datum.text.value:t.datum.label}};s[l]=g,u&&(s["".concat(l,"Legend")]=Nm(Nm({},g),{},{data:u})),e&&e.qHasOtherValues&&u&&((u||g.data).amend=[{label:e.qDimensionInfo[0].othersLabel,source:{key:"qHyperCube",field:"qDimensionInfo/0"},row:{value:-3},value:-3}])}else if("measure"===n.fieldType){var m={data:{field:n.field},min:n.min,max:n.max};s[l]=ay({},m,{type:"categorical"===n.type?"threshold-color":"sequential-color",range:n.range,domain:n.domain,invert:n.reverse}),"sequential-color"===s[l].type&&(s["".concat(l,"Range")]=ay({},m,{invert:!!i}))}else if("color"!==n.type)throw new Error("UNUSED FIELD")}else if("dimension"===n.mode){var y={data:e.qDimensionInfo.map(function(t,e){return e}),label:function(t){return e.qDimensionInfo[t.datum.value].qFallbackTitle},explicit:c,type:"categorical-color"};s[l]=y}else if("measure"===n.mode){var v={data:e.qMeasureInfo.map(function(t,e){return e}).filter(function(t){var e;return!(null!==(e=n.explicit)&&void 0!==e&&null!==(e=e.exclude)&&void 0!==e&&e.includes(t))}),label:function(t){return e.qMeasureInfo[t.datum.value].qFallbackTitle},explicit:c,type:"categorical-color"};s[l]=v}}return s}({hc:n.hc,coloring:r(),key:n.key,source:n.source,picasso:t.picasso}),i.scales},color:function(){return i.color=i.color||function(t){var e=t.coloring,n=t.scales,i=t.key,r=_v(i),o=_v("".concat(i,"IsAnOther")),a=function(t,e){var i=t.fieldType,a=t.invalid,s=t.mode,l=t.nil,c=t.others,u=t.primary,h=t.type;return a?function(t){return Sv(t)||o(t)?c:l}:n[e]?function(t){return Sv(t)?c:Mv(t)||-2===r(t)&&"dimension"===i||"NaN"===r(t)?l:o(t)?c:t.resources.scale(e)(r(t))||c}:"constant"===s?function(t){return Sv(t)||o(t)?c:Mv(t)?l:u}:"color"===h?function(t){return Sv(t)||o(t)?c:Mv(t)?l:r(t)||c}:null},s=a(e,i);if(e.measureOverrides){var l=_v("".concat(i,"MeasureIdx")),c=e.measureOverrides.map(function(t){return t&&a(t)});return function(t){var e=l(t);return c[e]?c[e](t):s(t)}}return s}({coloring:r(),scales:this.scales(),key:n.key}),i.color},datumProps:function(t){return function(t){var e,n,i=t.hc,r=t.coloring,o=t.scales,a=t.key,s=t.addMeasureIx,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,c=a,u=r.nil;"field"===r.mode&&r.field?e=r.field:o[a]&&"field"===r.mode&&(e=o[a].data.field||r.field),e?(n={field:e,reduce:"first"},"color"===r.type&&(n.value=function(t){return"NaN"!==t.qNum?(e=t.qNum,"rgba(".concat([(16711680&e)>>16,(65280&e)>>8,255&e,((4278190080&e)>>>24)/255].join(","),")")):t.qText&&qy(t.qText)?t.qText:u;var e})):"dimension"===r.mode?n=void 0!==r.field?r.field:i.qDimensionInfo.length-1:"measure"===r.mode&&(n=l);var h=Rm({},c,n);return i.qDimensionInfo.length>1&&(h["".concat(c,"IsAnOther")]={fields:i.qDimensionInfo.map(function(t,e){return{field:"qDimensionInfo/".concat(e)}}),value:function(t){return-1!==t.indexOf(-3)}}),s&&(h["".concat(c,"MeasureIdx")]=l),h}({coloring:this.settingsForMeasure(t),scales:this.scales(),key:n.key,hc:n.hc,addMeasureIx:r().measureOverrides},t)},data:function(){var t=r(),e={key:"dummy",data:[["field"],["a"]]};return t.legendDataset?[e,{type:"q",key:"attrDim",data:t.legendDataset.raw(),config:{localeInfo:n.localeInfo}}]:[e]},legend:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.eventName,i=t.key,o=t.viewState,a=t.chart,s=t.rtl,l=t.styleReference,c=void 0===l?"object.legend":l,u=t.styleOverrides,h=t.settings,d=void 0===h?{}:h,f=t.style,p=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return zv({eventName:e,key:i,rtl:s,viewState:o,chart:a,styleReference:c,styleOverrides:u,settings:d,style:void 0===f?{}:f},{legendProps:n.legendProps,scaleKey:n.key,coloring:r(),theme:n.theme,hc:n.hc,scales:this.scales()},p)}};return o}var Iv=function(t){return t.baseColor||t.coloring&&t.coloring.baseColor};function jv(t){var e=t.qHyperCube,n=e.qDimensionInfo,i=e.qMeasureInfo,r=n.some(Iv),o=i.some(Iv),a=t.color.useBaseColors;return"measure"===a&&!o||"dimension"===a&&!r?"off":a}var Pv=function(t){return t.baseColor||t.coloring&&t.coloring.baseColor};function Fv(t){var e,n=t.qHyperCube.qDimensionInfo.some(Pv),i=t.qHyperCube.qMeasureInfo.some(Pv),r=n?"dimension":void 0;return{mode:"primary",useBaseColors:null!==(e=null!=r?r:i?"measure":void 0)&&void 0!==e?e:"off",paletteColor:null}}var Lv=function(){};var $v="center",Bv="bottom";function Hv(t,e,n){if(void 0===t||void 0===e)return n;for(var i=e.split("."),r=t,o=0;o<i.length;++o){var a=i[o];if(void 0===r[a])return n;r=r[a]}return r}[{key:"NoDataExist",alignment:$v,condition:function(t){var e=t.layoutService;if(!e)return!1;var n=e.meta.size;return n.x*n.y===0}},{key:"OnlyNanDataMeasure",translationKey:"OnlyNanData",alignment:$v,condition:function(t){var e=t.layoutService;return!!e&&e.getHyperCubeValue("qMeasureInfo").every(function(t){return"NaN"===t.qMin&&"NaN"===t.qMax})}},{key:"OnlyNanDataDimensionContinuous",translationKey:"OnlyNanData",alignment:$v,condition:function(t){var e=t.layoutService;if(!e)return!1;if(!e.meta.isContinuous)return!1;var n=e.getHyperCubeValue("qDimensionInfo.0");return n&&(n.qMax<n.qMin||"NaN"===n.qMax)}},{key:"OnlyNegativeOrZeroValues",alignment:$v},{key:"DataRangeIncludingZero",alignment:Bv},{key:"LimitedData",alignment:Bv},{key:"NegativeOrZeroValues",alignment:Bv}].reduce(function(t,e){return t[e.key]=e,t},{});var Wv=["__proto__","constructor"];function Vv(t,e,n){if(void 0!==t&&void 0!==e){var i=e.split("."),r=i[i.length-1];if(!Wv.some(function(t){return i.includes(t)})){for(var o=t,a=0;a<i.length-1;++a){var s=i[a];void 0===o[s]&&(o[s]=Number.isNaN(+i[a+1])?{}:[]),o=o[s]}void 0!==n?o[r]=n:delete o[r]}}}function Uv(t){var e=t.originalArray,n=t.newArray,i=t.matchKey;return Array.isArray(e)&&e.length?(n.forEach(function(t){var n=-1;e.some(function(e,r){return e[i]&&e[i]===t[i]&&(n=r),n}),n>-1?e[n]=t:e.push(t)}),e):n}function Yv(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}function Kv(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e);if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Gv(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,i)}return n}function Xv(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Gv(Object(n),!0).forEach(function(e){Kv(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Gv(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}var Jv=Object.prototype.hasOwnProperty,Zv=Object.prototype.toString,Qv=Object.defineProperty,tx=Object.getOwnPropertyDescriptor,ex=function(t){return"function"==typeof Array.isArray?Array.isArray(t):"[object Array]"===Zv.call(t)},nx=function(t){if(!t||"[object Object]"!==Zv.call(t))return!1;var e,n=Jv.call(t,"constructor"),i=t.constructor&&t.constructor.prototype&&Jv.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!i)return!1;for(e in t);return void 0===e||Jv.call(t,e)},ix=function(t,e){Qv&&"__proto__"===e.name?Qv(t,e.name,{enumerable:!0,configurable:!0,value:e.newValue,writable:!0}):t[e.name]=e.newValue},rx=function(t,e){if("__proto__"===e){if(!Jv.call(t,e))return;if(tx)return tx(t,e).value}return t[e]},ox=function t(){var e,n,i,r,o,a,s=arguments[0],l=1,c=arguments.length,u=!1;for("boolean"==typeof s&&(u=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l<c;++l)if(null!=(e=arguments[l]))for(n in e)i=rx(s,n),s!==(r=rx(e,n))&&(u&&r&&(nx(r)||(o=ex(r)))?(o?(o=!1,a=i&&ex(i)?i:[]):a=i&&nx(i)?i:{},ix(s,{name:n,newValue:t(u,a,r)})):void 0!==r&&ix(s,{name:n,newValue:r}));return s};function ax(t,e,n,i){if(!t)return-1;const r=n.cache,o=t.origin?t.origin():null;o&&(t=o);let a=r.fields.indexOf(t),s=-1,l=-1;if(-1===a)for(let e=0;e<r.wrappedFields.length;e++)if(l=r.wrappedFields[e].attrDims.map(t=>t.instance).indexOf(t),s=r.wrappedFields[e].attrExps.map(t=>t.instance).indexOf(t),-1!==l||-1!==s){a=e;break}if(Array.isArray(i)&&i.some((t,e)=>t!==e)){const t=i.indexOf(a);-1!==t&&(a=t)}return a-=e.qArea.qLeft,a<0||a>=e.qArea.qWidth?-1:l>=0?t=>t[a].qAttrDims.qValues[l]:s>=0?t=>t[a].qAttrExps.qValues[s]:t=>t[a]}function sx(t,e,n){let i=n.key;const r={value:"function"==typeof t.value?t.value(e):void 0!==t.value?t.value:e};return r.label="function"==typeof t.label?t.label(e):void 0!==t.label?String(t.label):String(r.value),t.field&&(r.source={key:i,field:t.field.key()}),r}function lx(t){let e=t.cache,n=t.f,i=t.mainCell,r=t.p,o=t.page,a=t.rowIdx,s=t.row,l=t.sourceKey,c=t.target,u=t.targetProp,h=t.columnOrder,d=i;if(r.field&&r.field!==n){const t=ax(r.field,o,{cache:e},h);if(-1===t)return;d=ox({qRow:a},t(s))}c[u]=sx(r,d,{key:l})}function cx(t,e,n,i){const r=Array.isArray(t)?t:[t];let o=[];for(let t=0;t<r.length;t++)if(void 0!==r[t].field){const a=e.raw(),s=e.key(),l="object"==typeof r[t].field?r[t].field:e.field(r[t].field),c=i.normalizeConfig(r[t],e),u=c.props,h=c.main,d=Object.keys(u),f=!!r[t].trackBy,p=typeof r[t].trackBy,g={},m=[],y=[];for(let e=0;e<a.qDataPages.length;e++){const o=ax(l,a.qDataPages[e],{cache:n},a.qColumnOrder);if(-1!==o)for(let c=0;c<a.qDataPages[e].qMatrix.length;c++){const v=a.qDataPages[e].qArea.qTop+c,x=ox({qRow:v},o(a.qDataPages[e].qMatrix[c])),b=sx(h,x,{key:s});if(!h.filter||h.filter(x)){for(let t=0;t<d.length;t++){const i=u[d[t]];let r=i.fields||[i];i.fields&&(b[d[t]]=[]);for(let o=0;o<r.length;o++)lx({cache:n,f:l,mainCell:x,p:r[o],prop:d[t],page:a.qDataPages[e],rowIdx:v,row:a.qDataPages[e].qMatrix[c],sourceKey:s,target:i.fields?b[d[t]]:b,targetProp:i.fields?o:d[t],columnOrder:a.qColumnOrder});if(i.fields){const e=b[d[t]].map(t=>t.value),n=b[d[t]].map(t=>t.label);b[d[t]]={value:"function"==typeof i.value?i.value(e):void 0!==i.value?i.value:e,label:"function"==typeof i.label?i.label(n):void 0!==i.label?String(i.label):String(b[d[t]].value)}}}f&&i.track({cfg:r[t],itemData:x,obj:b,target:m,tracker:g,trackType:p}),y.push(b)}}}const v=f?i.collect(m,{main:h,propsArr:d,props:u}):y;o=[...o,...v]}return o}function ux(t){var e=0,n=t.children,i=n&&n.length;if(i)for(;--i>=0;)e+=n[i].value;else e=1;t.value=e}function hx(t,e){t instanceof Map?(t=[void 0,t],void 0===e&&(e=fx)):void 0===e&&(e=dx);for(var n,i,r,o,a,s=new mx(t),l=[s];n=l.pop();)if((r=e(n.data))&&(a=(r=Array.from(r)).length))for(n.children=r,o=a-1;o>=0;--o)l.push(i=r[o]=new mx(r[o])),i.parent=n,i.depth=n.depth+1;return s.eachBefore(gx)}function dx(t){return t.children}function fx(t){return Array.isArray(t)?t[1]:null}function px(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function gx(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function mx(t){this.data=t,this.depth=this.height=0,this.parent=null}function yx(t){return null==t?null:function(t){if("function"!=typeof t)throw new Error;return t}(t)}mx.prototype=hx.prototype={constructor:mx,count:function(){return this.eachAfter(ux)},each:function(t,e){let n=-1;for(const i of this)t.call(e,i,++n,this);return this},eachAfter:function(t,e){for(var n,i,r,o=this,a=[o],s=[],l=-1;o=a.pop();)if(s.push(o),n=o.children)for(i=0,r=n.length;i<r;++i)a.push(n[i]);for(;o=s.pop();)t.call(e,o,++l,this);return this},eachBefore:function(t,e){for(var n,i,r=this,o=[r],a=-1;r=o.pop();)if(t.call(e,r,++a,this),n=r.children)for(i=n.length-1;i>=0;--i)o.push(n[i]);return this},find:function(t,e){let n=-1;for(const i of this)if(t.call(e,i,++n,this))return i},sum:function(t){return this.eachAfter(function(e){for(var n=+t(e.data)||0,i=e.children,r=i&&i.length;--r>=0;)n+=i[r].value;e.value=n})},sort:function(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})},path:function(t){for(var e=this,n=function(t,e){if(t===e)return t;var n=t.ancestors(),i=e.ancestors(),r=null;for(t=n.pop(),e=i.pop();t===e;)r=t,t=n.pop(),e=i.pop();return r}(e,t),i=[e];e!==n;)e=e.parent,i.push(e);for(var r=i.length;t!==n;)i.splice(r,0,t),t=t.parent;return i},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){return Array.from(this)},leaves:function(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t},links:function(){var t=this,e=[];return t.each(function(n){n!==t&&e.push({source:n.parent,target:n})}),e},copy:function(){return hx(this).eachBefore(px)},[Symbol.iterator]:function*(){var t,e,n,i,r=this,o=[r];do{for(t=o.reverse(),o=[];r=t.pop();)if(yield r,e=r.children)for(n=0,i=e.length;n<i;++n)o.push(e[n])}while(o.length)}};var vx={depth:-1},xx={},bx={};function wx(t){return t.id}function kx(t){return t.parentId}function _x(t){let e=t.length;if(e<2)return"";for(;--e>1&&!Mx(t,e););return t.slice(0,e)}function Mx(t,e){if("/"===t[e]){let n=0;for(;e>0&&"\\"===t[--e];)++n;if(!(1&n))return!0}return!1}function Sx(t,e){"/"===t.charAt(0)&&(t=t.substring(1));const n=t.split("/");let i,r=e;for(let t=0;t<n.length;t++){if("*"===n[t]&&Array.isArray(r)){const e=[];i=n.slice(t+1).join("/");for(let t=0;t<r.length;t++){let n=Sx(i,r[t]);Array.isArray(n)?e.push(...n):e.push(n)}return e}if(!n[t]&&Array.isArray(r)){const e=new Array(r.length);i=n.slice(t+1).join("/");for(let t=0;t<r.length;t++)e[t]=Sx(i,r[t]);return e}n[t]in r&&(r=r[n[t]])}return r}function Rx(t,e,n){let i=[];if(!t||!t.length)return i;if(e<=0){const e=n>=0?[t[n]]:t;i=[...i,...e]}else for(let r=0;r<t.length;r++)t[r].children&&t[r].children.length&&(i=[...i,...Rx(t[r].children,e-1,n)]);return i}function Cx(t,e,n){if(t===e)return t=>t;if(t>e){const n=Math.max(0,Math.min(100,t-e));return t=>{let e=t;for(let t=0;t<n;++t)e=e.parent;return e}}if(e>t){const i=Math.max(0,Math.min(100,e-t));return t=>Rx(t.children,i-1,n)}return!1}const Nx=/^qDimensionInfo(?:\/(\d+))?/,Dx=/^\/?qMeasureInfo\/(\d+)/,qx=/\/qAttrExprInfo\/(\d+)/,Ex=/\/qAttrDimInfo\/(\d+)/;function Ox(t){return(t.qColumnOrder&&t.qColumnOrder.length?t.qColumnOrder:t.qDimensionInfo.map((t,e)=>e)).filter(e=>e<t.qDimensionInfo.length)}function Ax(t,e){let n=e.cube;if(!t)return-1;let i=t.origin&&t.origin()?t.origin().key():t.key(),r=!1,o=-1,a=-1,s=-1,l=-1,c=-1,u=-1,h=i;const d=n.qEffectiveInterColumnSortOrder,f=Ox(n);return Nx.test(h)&&(r=!0,o=+Nx.exec(h)[1],h=i.replace(Nx,"")),Dx.test(h)&&("K"===n.qMode?c=+Dx.exec(h)[1]:d&&-1!==d.indexOf(-1)?(c=+Dx.exec(h)[1],u=0):u=+Dx.exec(h)[1],h=h.replace(Dx,"")),h&&(Ex.exec(h)?s=+Ex.exec(h)[1]:qx.exec(h)&&(a=+qx.exec(h)[1])),l=r?"S"===n.qMode?f[o]:d?d.indexOf(o):o:d&&-1!==d.indexOf(-1)?d.indexOf(-1):n.qDimensionInfo.length-("K"===n.qMode?0:1),{fieldDepth:l+1,pseudoMeasureIndex:c,measureIdx:u,attrDimIdx:s,attrIdx:a}}function zx(t,e){let n,i,r=Cx(t.fieldDepth,e.fieldDepth,e.pseudoMeasureIndex);return n=e.measureIdx>=0?t=>t.data.qValues[e.measureIdx]:t=>t.data,e.attrDimIdx>=0?i=t=>{var n;return null==t||null===(n=t.qAttrDims)||void 0===n?void 0:n.qValues[e.attrDimIdx]}:e.attrIdx>=0&&(i=t=>{var n;return null==t||null===(n=t.qAttrExps)||void 0===n?void 0:n.qValues[e.attrIdx]}),{nodeFn:r,attrFn:i,valueFn:n}}function Tx(t,e,n){let i=n.key;const r={value:"function"==typeof t.value?t.value(e):void 0!==t.value?t.value:e};return r.label="function"==typeof t.label?t.label(e):void 0!==t.label?String(t.label):String(r.value),t.field&&(r.source={key:i,field:t.field.key()}),r}function Ix(t){let e=t.propsArr,n=t.props,i=t.item,r=t.itemData,o=t.ret,a=t.sourceKey;for(let t=0;t<e.length;t++){const s=n[e[t]],l=s.fields||[s];let c,u;s.fields&&(c=[],u=[]);for(let n=0;n<l.length;n++){const h=l[n];let d,f,p,g,m,y;if("primitive"===h.type?(p=h.value,y=String(h.value)):("function"==typeof h.value&&(d=t=>h.value(t,i)),"function"==typeof h.label&&(f=t=>h.label(t,i)),h.accessor?(g=h.accessor(i),Array.isArray(g)?(m=g.map(h.valueAccessor),h.attrAccessor&&(m=m.map(h.attrAccessor)),d&&(p=m.map(d),d=null),f&&(y=m.map(f),f=null),p=h.reduce?h.reduce(p):p,y=h.reduceLabel?h.reduceLabel(y,p):String(p)):(p=h.attrAccessor?h.attrAccessor(h.valueAccessor(g)):h.valueAccessor(g),y=p)):(p=r,y=r)),s.fields){const t=d?d(p):p;c.push(t),u.push(f&&null!=y?f(y):null!=y?y:String(t))}else{const n=d?d(p):p;o[e[t]]={value:n,label:f?f(y):null!=y?y:String(n)},h.field&&(o[e[t]].source={field:h.field.key(),key:a})}}c&&(o[e[t]]={value:"function"==typeof s.value?s.value(c,i):c,label:"function"==typeof s.label?s.label(u,i):u})}}const jx=(t,e,n)=>{const i="K"===t.qMode?"/qStackedDataPages/*/qData":"/qTreeDataPages/*",r="K"===t.qMode?"qSubNodes":"qNodes",o=Sx(i,t);return o&&o[0]?(e.tree=hx(o[0],n.children||(t=>t[r])),e.tree):null},Px=t=>{let e=t.propsArr,n=t.props,i=t.cube;t.cache;let r=t.itemDepthObject,o=t.f;for(let t=0;t<e.length;t++){const a=n[e[t]],s=a.fields?a.fields:[a];for(let t=0;t<s.length;t++){const e=s[t];if(e.field!==o){const t=zx(r,Ax(e.field,{cube:i}));e.accessor=t.nodeFn,e.valueAccessor=t.valueFn,e.attrAccessor=t.attrFn}}}};function Fx(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;const r=e.raw(),o=e.key(),a="S"===r.qMode?function(t){const e=t.raw().qDataPages.length?t.raw().qDataPages[0].qMatrix:[],n=function(t){const e=t.raw().qColumnOrder,n=t.fields();return e&&e.length===n.length?e:n.map((t,e)=>e)}(t),i=t.fields(),r=t.fields().filter(t=>"dimension"===t.type()).map(t=>n.indexOf(i.indexOf(t))),o=t.fields().filter(t=>"measure"===t.type()).map(t=>n.indexOf(i.indexOf(t))),a={__root:{__id:"__root",qValues:[]}};for(let t=0;t<e.length;t++){const n=e[t];let i="__root",l=!1;for(let t=0;t<r.length;t++){var s;const e=n[r[t]],o="".concat(i,"__").concat(null!==(s=e.qElemNumber)&&void 0!==s?s:e.qElemNo);a[o]||(a[o]=Xv({__id:o,__parent:i,qValues:[]},e),l=!0),i=o}if(l)for(let t=0;t<o.length;t++){const e=n[o[t]];a[i].qValues.push(e)}}const l=Object.keys(a).map(t=>a[t]);return function(){var t,e=wx,n=kx;function i(i){var r,o,a,s,l,c,u,h,d=Array.from(i),f=e,p=n,g=new Map;if(null!=t){const e=d.map((e,n)=>function(t){let e=(t=`${t}`).length;return Mx(t,e-1)&&!Mx(t,e-2)&&(t=t.slice(0,-1)),"/"===t[0]?t:`/${t}`}(t(e,n,i))),n=e.map(_x),r=new Set(e).add("");for(const t of n)r.has(t)||(r.add(t),e.push(t),n.push(_x(t)),d.push(bx));f=(t,n)=>e[n],p=(t,e)=>n[e]}for(a=0,r=d.length;a<r;++a)o=d[a],c=d[a]=new mx(o),null!=(u=f(o,a,i))&&(u+="")&&(h=c.id=u,g.set(h,g.has(h)?xx:c)),null!=(u=p(o,a,i))&&(u+="")&&(c.parent=u);for(a=0;a<r;++a)if(u=(c=d[a]).parent){if(!(l=g.get(u)))throw new Error("missing: "+u);if(l===xx)throw new Error("ambiguous: "+u);l.children?l.children.push(c):l.children=[c],c.parent=l}else{if(s)throw new Error("multiple roots");s=c}if(!s)throw new Error("no root");if(null!=t){for(;s.data===bx&&1===s.children.length;)s=s.children[0],--r;for(let t=d.length-1;t>=0&&(c=d[t]).data===bx;--t)c.data=null}if(s.parent=vx,s.eachBefore(function(t){t.depth=t.parent.depth+1,--r}).eachBefore(gx),s.parent=null,r>0)throw new Error("cycle");return s}return i.id=function(t){return arguments.length?(e=yx(t),i):e},i.parentId=function(t){return arguments.length?(n=yx(t),i):n},i.path=function(e){return arguments.length?(t=yx(e),i):t},i}().id(t=>t.__id).parentId(t=>t.__parent)(l)}(e):jx(r,n,t);if(!a)return null;const s=a.height,l=[];for(let o=0;o<=s;o++){let a=null;if(o>0)if("S"===r.qMode){let t=Ox(r)[o-1];a=n.fields[t]}else{let t=r.qEffectiveInterColumnSortOrder[o-1];o>r.qEffectiveInterColumnSortOrder.length&&(t=r.qDimensionInfo.length),a=n.fields[t]}const s=i.normalizeConfig(Xv(Xv({},t),{},{field:a?a.key():void 0}),e),c=s.props,u=s.main,h=Object.keys(c);l[o]={propsArr:h,props:c,main:u};const d=a?Ax(a,{cube:r}):{fieldDepth:0};Px({propsArr:h,props:c,cube:r,cache:n,itemDepthObject:d,f:a})}const c=a.copy().descendants(),u=a.descendants();for(let t=0;t<u.length;t++){const e=l[u[t].depth].propsArr,n=l[u[t].depth].props,i=l[u[t].depth].main,r=c[t],a=r.data,s=Tx(i,a,{key:o});Ix({propsArr:e,props:n,item:r,itemData:a,ret:s,sourceKey:o}),u[t].data=s}return a}function Lx(t,e,n,i){const r=Array.isArray(t)?t:[t];let o=[];for(let a=0;a<r.length;a++)if(void 0!==r[a].field){const s=e.raw(),l=e.key();if(!jx(s,n,t))continue;const c="object"==typeof r[a].field?r[a].field:e.field(r[a].field),u=i.normalizeConfig(r[a],e),h=u.props,d=u.main,f=Object.keys(h),p=Ax(c,{cube:s}),g=zx({fieldDepth:0},p),m=g.nodeFn,y=g.attrFn,v=g.valueFn;Px({propsArr:f,props:h,cube:s,cache:n,itemDepthObject:p,f:c});const x=!!r[a].trackBy,b=typeof r[a].trackBy,w={},k=[],_=m(n.tree),M=[];for(let t=0;t<_.length;t++){const e=_[t],n=y?y(v(e)):v(e);if(d.filter&&!d.filter(n))continue;const o=Tx(d,n,{key:l});Ix({propsArr:f,props:h,item:e,itemData:n,ret:o,sourceKey:l}),x&&i.track({cfg:r[a],itemData:n,obj:o,target:k,tracker:w,trackType:b}),M.push(o)}const S=x?i.collect(k,{main:d,propsArr:f,props:h}):M;o=[...o,...S]}return o}var $x,Bx,Hx=($x=function(t){
9
+ e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,i,r,o,s,a,l,c,u,h,d=e.length,f=e.search(/[0-9\-\+#]/),p=f>0?e.substring(0,f):"",g=e.split("").reverse().join(""),m=g.search(/[0-9\-\+#]/),y=d-m,x=e.substring(y,y+1),v=y+("."===x||","===x?1:0),b=m>0?e.substring(v,d):"";if(n=(t="-"===(e=e.substring(f,v)).charAt(0)?-t:+t)<0?t=-t:0,r=(i=e.match(/[^\d\-\+#]/g))&&i[i.length-1]||".",o=i&&i[1]&&i[0]||",",e=e.split(r),t=+(t=t.toFixed(e[1]&&e[1].length))+"",a=e[1]&&e[1].lastIndexOf("0"),(!(c=t.split("."))[1]||c[1]&&c[1].length<=a)&&(t=(+t).toFixed(a+1)),u=e[0].split(o),e[0]=u.join(""),(s=e[0]&&e[0].indexOf("0"))>-1)for(;c[0].length<e[0].length-s;)c[0]="0"+c[0];else 0===+c[0]&&(c[0]="");if((t=t.split("."))[0]=c[0],l=u[1]&&u[u.length-1].length){for(g="",y=(h=t[0]).length%l,d=h.length,v=0;v<d;v++)g+=h.charAt(v),!((v-y+1)%l)&&v<d-l&&(g+=o);t[0]=g}return t[1]=e[1]&&t[1]?r+t[1]:"","0"!==(i=t.join(""))&&""!==i||(n=!1),p+(n?"-":"")+i+b}});function bg(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}const wg={3:"k",6:"M",9:"G",12:"T",15:"P",18:"E",21:"Z",24:"Y","-3":"m","-6":"μ","-9":"n","-12":"p","-15":"f","-18":"a","-21":"z","-24":"y"},kg=/%\)?$/,_g=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,Mg=/^\(oct\)/i,Sg=/^\(dec\)/i,Rg=/^\(hex\)/i,Cg=/^\(bin\)/i,Ng=/^\(rom\)/i,Dg=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,qg=/#|0/g;function Eg(e,t,n,i){return e=e.toString(t),n[1]===n[1].toUpperCase()&&(e=e.toUpperCase()),e.length-e.indexOf(".")>10&&(e=e.slice(0,e.indexOf(".")+11)),e.replace(".",i||".")}function zg(e,t,n){let i;return _g.test(t)?e=Eg(e,Number(/\d{2}/.exec(t)[0]),t,n):Mg.test(t)?e=Eg(e,8,t,n):Sg.test(t)?e=Eg(e,10,t,n):Rg.test(t)?e=Eg(e,16,t,n):Cg.test(t)?e=Eg(e,2,t,n):Ng.test(t)&&(i="",e<0&&(i="-",e=-e),0===(e=Math.floor(e))?e="0":e<=5e5?(e=function(e,t){let n,i="",r=Number(String(e).slice(-3)),o=(e-r)/1e3,s=[0,1,4,5,9,10,40,50,90,100,400,500,900].reverse(),a=["0","I","IV","V","IX","X","XL","L","XC","C","CD","D","CM"].reverse();for(;r>0;)for(n=0;n<s.length;n++)if(s[n]<=r){i+=a[n],r-=s[n];break}for(n=0;n<o;n++)i="M".concat(i);return t[1]!==t[1].toUpperCase()&&(i=i.toLowerCase()),i}(e,t),e=i+e):e=t+i+e.toExponential(0)),e}function Ag(e,t,n){const i=bg(e);return n?i:new RegExp(i||"",t)}function Og(e,t,n,i){let r,o,s,a,l,c,u,h,d,f=e.pattern;var p,g;i&&(e.abbreviate=!0),p=t,(g=n)&&(g=bg(g)),p&&(p=bg(p)),d=new RegExp("(?:[#0]+".concat(p,")?[#0]+(?:").concat(g,"[#0]+)?")),s=f.match(d),s=s?s[0]:"",a=s?f.substr(0,f.indexOf(s)):f,l=s?f.substring(f.indexOf(s)+s.length):"",s||(s=f?"#":"##########"),t&&t===n&&(r=s.split(n),o=r.pop(),s=r.join("")+n+o,t=""),c=t,t=/,/.test(n)?"¤":",",c&&(s=s.replace(Ag(c,"g"),t)),u=n,n=".",u&&(s=s.replace(Ag(u,"g"),n)),h=s.match(/#/g),h=h?h.length:0;const m=f.split(u);let y;m[1]&&(y=m[1].match(qg)),e.prefix=a||"",e.postfix=l||"",e.pattern=f,e.maxPrecision=y?y.length:2,e.percentage=kg.test(f),e.numericPattern=s||"",e.numericRegex=new RegExp("".concat(Ag(t,null,!0),"|").concat(Ag(n,null,!0)),"g"),e.groupTemp=c,e.decTemp=u,e.t=t,e.d=n,e.temp=h}class Tg{constructor(e,t,n,i,r){this.localeInfo=e,this.pattern=t,this.thousandDelimiter=n||",",this.decimalDelimiter=i||".",this.type=r||"numeric",this.patternSeparator=";",this.abbreviations=function(e,t){if(!e||!e.qNumericalAbbreviation)return wg;const n={};return e.qNumericalAbbreviation.split(t).forEach(e=>{let t=e.split(":");2===t.length&&(n[t[0]]=t[1])}),n}(e,this.patternSeparator),this.prepare()}clone(){const e=new Tg(this.localeInfo,this.pattern,this.thousandDelimiter,this.decimalDelimiter,this.type);return e.subtype=this.subtype,e}format(e,t,n,i){return this.prepare(t,n,i),this.formatValue(e)}prepare(e,t,n){let i;if(void 0===e&&(e=this.pattern),void 0===t&&(t=this.thousandDelimiter),void 0===n&&(n=this.decimalDelimiter),!e)return void(this._prepared={pattern:!1});this._prepared={positive:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},negative:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},zero:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""}},i=this._prepared,e=e.split(this.patternSeparator),i.positive.pattern=e[0],i.negative.pattern=e[1],i.zero.pattern=e[2],Dg.test(e[0])&&(i.positive.isFunctional=!0),e[1]?Dg.test(e[1])&&(i.negative.isFunctional=!0):i.negative=!1,e[2]?Dg.test(e[2])&&(i.zero.isFunctional=!0):i.zero=!1;const r="U"===this.type;i.positive.isFunctional||Og(i.positive,t,n,r),i.negative&&!i.negative.isFunctional&&Og(i.negative,t,n,r),i.zero&&!i.zero.isFunctional&&Og(i.zero,t,n,r)}formatValue(e){let t,n,i,r,o,s,a,l,c,u=this._prepared,h="",d="",f=e;if(isNaN(e))return"".concat(f);if(e=+e,!1===u.pattern)return e.toString();if(0===e&&u.zero)return u=u.zero,u.pattern;if(e<0&&u.negative?(u=u.negative,e=-e):u=u.positive,o=u.d,s=u.t,u.isFunctional)e=zg(e,u.pattern,o);else{if(u.percentage&&(e*=100),u.abbreviate){const t=Object.keys(this.abbreviations).map(e=>parseInt(e,10)).sort((e,t)=>e-t);let i,r,o=t[0];for(a=0,n=Number(Number(e).toExponential().split("e")[1]);o<=n&&a<t.length;)a++,o=t[a];a>0&&(i=t[a-1]),i&&n>0&&i>0?r=i:(n<0&&i<0||!i)&&(o<0&&o-n<=u.maxPrecision?r=o:i<=n&&!(o>0&&-n<=u.maxPrecision)&&(r=i)),r&&(h=this.abbreviations[r],e/=10**r)}if(i=Math.abs(e),t=u.temp,l=u.numericPattern,c=l.split(o)[1],"I"===this.type&&(e=Math.round(e)),r=e,c||"#"!==l.slice(-1)[0])if(i>=1e15||i>0&&i<=1e-14)e=i?i.toExponential(15).replace(/\.?0+(?=e)/,""):"0";else{const t=Number((e+1e-15*(e<0?-1:1)).toFixed(Math.min(20,c?c.length:0)).split(".")[0]);let n=l.split(o)[0];if(n+=o,e=vg(n,t)||"0",c){const t=Math.max(0,Math.min(14,c.length)),n=c.replace(/#+$/,"").length;let r=("I"===this.type?0:i%1+1e-15).toFixed(t).slice(2).replace(/0+$/,"");for(a=r.length;a<n;a++)r+="0";r&&(e+=o+r)}else 0===t&&(r=0)}else if(i>=10**t||i<1||i<1e-4)0===e?e="0":i<1e-4||i>=1e20?(e=(e=r.toExponential(Math.max(1,Math.min(14,t))-1)).replace(/\.?0+(?=e)/,""),d=""):(e=e.toPrecision(Math.max(1,Math.min(14,t)))).indexOf(".")>=0&&(e=(e=e.replace(e.indexOf("e")<0?/0+$/:/\.?0+(?=e)/,"")).replace(".",o));else{for(l+=o,t=Math.max(0,Math.min(20,t-Math.ceil(Math.log(i)/Math.log(10)))),a=0;a<t;a++)l+="#";e=vg(l,e)}e=e.replace(u.numericRegex,e=>e===s?u.groupTemp:e===o?u.decTemp:""),r<0&&!/^-/.test(e)&&(e="-".concat(e))}return u.prefix+e+d+h+u.postfix}static getStaticFormatter(){return{prepare(){},formatValue:e=>"".concat(e)}}}function Ig(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=t.size,i=void 0===n?5e3:n,r=t.multipleArguments,o=void 0!==r&&r,s=t.toKey,a=void 0===s?e=>e:s;let l,c,u=Object.create(null),h=Object.create(null),d=0,f=0;return l=o?function(){return c=a(...arguments),l.has(c)?l.get(c):l.set(c,e(...arguments))}:t=>(c=a(t),l.has(c)?l.get(c):l.set(c,e(t))),l.set=(e,t)=>(d>=i&&(delete u[h[f]],delete h[f],d--,f++),u[e]=t,h[d]=e,d++,t),l.get=e=>u[e],l.has=e=>e in u,l.clear=()=>{u=Object.create(null),h=Object.create(null),d=0,f=0},l.size=()=>d,l}function jg(e,t,n,i,r){const o=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Tg(...t)}(r,e,t,n,i),s=Ig(o.formatValue.bind(o),{toKey:e=>isNaN(e)?e:+e});function a(e){return s(e)}return a.format=function(e,t,n,i){return s.clear(),o.format(t,e,n,i)},a.pattern=function(e){return e&&(s.clear(),o.pattern=e,o.prepare()),o.pattern},a}const Pg="D",Fg="T",Lg="TS",$g="IV",Bg=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Hg=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Wg=["January","February","March","April","May","June","July","August","September","October","November","December"],Vg=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Ug(e,t){for(let n=e.length;n<t;n++)e="0".concat(e);return e}function Yg(e){let t=e.toString().split(".");return t[1]?(t=Number("0.".concat(t[1])),t):0}function Kg(e,t){let n,i=function(e){const t=e,n=24*Yg(t),i=60*Yg(n),r=60*Yg(i),o=1e3*Yg(r);return{d:Math.floor(t),h:Math.floor(n),m:Math.floor(i),s:Math.floor(r),f:Math.round(o)}}(e),r=i.d,o=i.h,s=i.m,a=i.s,l=i.f,c=0;/w+|t+/gi.test(t)&&(n=new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,Math.round(86400*(e-Math.floor(e))))),isNaN(n.getTime())&&(n=null)),/D+/gi.test(t)||(o+=24*r),/h+/gi.test(t)||(s+=60*o),/m+/gi.test(t)||(a+=60*s),/w+/gi.test(t)&&(c=n?n.getDay()-1:0,c<0&&(c=6));let u="";return n&&(u=n.getUTCHours()>=12?"pm":"am"),{year:0,month:0,day:c,date:r,h:o,m:s,s:a,f:l,t:u}}class Xg{constructor(e,t,n){const i=e||{};if(i.qCalendarStrings||(i.qCalendarStrings={qLongDayNames:Bg,qDayNames:Hg,qLongMonthNames:Wg,qMonthNames:Vg}),this.localeInfo=i,this.locale_days=i.qCalendarStrings.qLongDayNames.slice(),this.locale_days_abbr=i.qCalendarStrings.qDayNames.slice(),this.locale_months=i.qCalendarStrings.qLongMonthNames.slice(),this.locale_months_abbr=i.qCalendarStrings.qMonthNames.slice(),!t){t={[Fg]:i.qTimeFmt||"hh:mm:ss",[Pg]:i.qDateFmt||"YYYY-MM-DD",[Lg]:i.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"}[n]}this.pattern=t}clone(){const e=new Xg(this.localeInfo,this.pattern);return e.subtype=this.subtype,e}format(e,t){t||(t=this.pattern?this.pattern:"YYYY-MM-DD hh:mm:ss"),t=t.replace(/\[.+]|\[|]/g,"");const n=/t+/gi.test(t);let i;e instanceof Date?i=function(e,t){let n=e.getUTCHours(),i=e.getUTCDay()-1;return t&&(n%=12,n||(n=12)),i<0&&(i=6),{year:e.getUTCFullYear(),month:e.getUTCMonth(),day:i,date:e.getUTCDate(),h:n,m:e.getUTCMinutes(),s:e.getUTCSeconds(),f:e.getUTCMilliseconds(),t:e.getUTCHours()>=12?"pm":"am"}}(e,n):(e<0&&(e=-e,t="-".concat(t)),i=Kg(e,t));const r=(o=this,s=i,{"Y+|y+":{Y:"".concat(Number("".concat(s.year).slice(-2))),YY:Ug("".concat(s.year).slice(-2),2),YYY:Ug("".concat(s.year).slice(-3),3),def:e=>Ug("".concat(s.year),e.length)},"M+":{M:s.month+1,MM:Ug("".concat(s.month+1),2),MMM:o.locale_months_abbr[s.month],def:o.locale_months[s.month]},"W+|w+":{W:s.day,WW:Ug("".concat(s.day),2),WWW:o.locale_days_abbr[s.day],def:o.locale_days[s.day]},"D+|d+":{D:s.date,def:e=>Ug("".concat(s.date),e.length)},"h+|H+":{h:s.h,def:e=>Ug("".concat(s.h),e.length)},"m+":{m:s.m,def:e=>Ug("".concat(s.m),e.length)},"s+|S+":{s:s.s,def:e=>Ug("".concat(s.s),e.length)},"f+|F+":{def(e){let t="".concat(s.f),n=e.length-t.length;if(n>0)for(let e=0;e<n;e++)t+="0";else n<0&&(t=t.slice(0,e.length));return t}},"t{1,2}|T{1,2}":{def(e){let t=s.t;return e[0].toUpperCase()===e[0]&&(t=t.toUpperCase()),t=t.slice(0,e.length),t}}});var o,s;const a=[];for(const e in r)Object.prototype.hasOwnProperty.call(r,e)&&a.push(e);const l=new RegExp(a.join("|"),"g"),c=t.replace(l,e=>{let t,n,i;for(n in r)if(Object.prototype.hasOwnProperty.call(r,n)&&(t=new RegExp(n),t.test(e)))break;if(!t)return"";for(const t in r[n])if(t===e||t.toLowerCase()===e){i=r[n][t],void 0===i&&(i=r[n][t.toLowerCase()]);break}return void 0===i&&(i=r[n].def),"function"==typeof i&&(i=i(e)),i});return c}}function Gg(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Xg(...t)}function Jg(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"TS",n=Gg(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,e,t),i=Ig(n.format.bind(n),{toKey:e=>"object"==typeof e&&"function"==typeof e.getTime?e.getTime():e});function r(e){return t!==$g?function(e){return new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,0,Math.round(864e5*(e-Math.floor(e)))))}(e):e}function o(e){return e=r(e),i(e)}return o.format=function(e,t){return i.clear(),t=r(t),n.format(t,e)},o.locale=function(r){return n=Gg(r,e,t),i=Ig(n.format.bind(n),{toKey:e=>"object"==typeof e?e.getTime():e}),this},o.qtype=function(e){return void 0!==e&&(t=e,i.clear()),t},o}function Zg(e,t){if(e&&e.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(e.qNumFormat.qType))return Jg(e.qNumFormat.qFmt,e.qNumFormat.qType,t);let n="#",i=t&&void 0!==t.qThousandSep?t.qThousandSep:",",r=t&&void 0!==t.qDecimalSep?t.qDecimalSep:".",o="U",s=e&&!!e.qIsAutoFormat;return e&&e.qNumFormat?(n=e.qNumFormat.qFmt||n,i=e.qNumFormat.qThou||i,r=e.qNumFormat.qDec||r,o=e.qNumFormat.qType||o,s=s&&-1===["M"].indexOf(e.qNumFormat.qType)):s=!0,(s||"U"===o)&&(n="#".concat(r,"##"),o="U"),jg(n,i,r,o,t)}function Qg(){let e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.meta,i=t.id,r=t.key,o=t.localeInfo,s=t.fieldExtractor,a=t.value,l=t.type,c=t.sourceField;const u=a||("dimension"===l?e=>null==e?void 0:e.qElemNo:e=>null==e?void 0:e.qValue),h="dimension"===l?"first":"avg",d=Zg(n,o),f="dimension"===l?"first":(e,t)=>d(t),p={id:()=>i,key:()=>r,raw:()=>n,title:()=>n.qFallbackTitle||n.label,type:()=>l,origin:()=>c,items:()=>(e||(e=s(p)),e),min:()=>n.qMin,max:()=>n.qMax,value:u,label:e=>(null==e?void 0:e.qText)||"",reduce:h,reduceLabel:f,formatter:()=>d,tags:()=>n.qTags};return p}function em(e,t,n,i,r){return(t[e]||[]).map((t,o)=>{const s="".concat(i?"".concat(i,"/"):"").concat(e,"/").concat(o),a={instance:Qg(Ip({id:"".concat(n?"".concat(n,"/"):"").concat(s),key:s,meta:t},r))};return a.attrDims=em("qAttrDimInfo",t,n,s,Ip({},r,{value:e=>null==e?void 0:e.qElemNo,type:"dimension"})),a.attrExps=em("qAttrExprInfo",t,n,s,Ip({},r,{value:e=>null==e?void 0:e.qNum,type:"measure"})),a.measures=em("qMeasureInfo",t,n,s,Ip({},r,{value:e=>null==e?void 0:e.qValue,type:"measure"})),a})}function tm(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.key,n=e.data,i=e.config,r=void 0===i?{}:i;const o={fields:[],wrappedFields:[],allFields:[],virtualFields:[]},s=n;if(!s)throw new Error('Missing "data" input');if(!s.qDimensionInfo)throw new Error('The "data" input is not recognized as a hypercube');const a=tm.util,l={cache:o,cube:s,localeInfo:r.localeInfo,fieldExtractor:null,pages:null,hierarchy:()=>null,virtualFields:r.virtualFields},c={key:()=>t,raw:()=>s,field:e=>function(e,t){let n=t.cache;if("number"==typeof e)return n.fields[e];const i=n.allFields;if("function"==typeof e){for(let t=0;t<i.length;t++)if(e(i[t]))return i[t];return!1}if("string"==typeof e){for(let t=0;t<i.length;t++)if(i[t].key()===e||i[t].title()===e)return i[t]}else if(e&&-1!==i.indexOf(e))return e;throw Error("Field not found: ".concat(e))}(e,l),fields:()=>o.fields.slice(),extract:e=>l.extractor(e,c,o,a),hierarchy:e=>l.hierarchy(e,c,o,a),_cache:()=>o};"K"===s.qMode||"T"===s.qMode||!s.qMode&&s.qNodesOnDim?(l.extractor=xg,l.hierarchy=yg,l.pages="K"===s.qMode?s.qStackedDataPages:s.qTreeDataPages):"S"===s.qMode?(l.extractor=Lp,l.pages=s.qDataPages,l.hierarchy=yg):l.extractor=()=>[],l.fieldExtractor=e=>l.extractor({field:e},c,o,a);const u="S"===s.qMode?e=>e.qElemNumber:void 0,h="S"===s.qMode?e=>e.qNum:void 0;o.wrappedFields.push(...em("qDimensionInfo",s,t,"",Ip({},l,{value:u,type:"dimension"}))),o.wrappedFields.push(...em("qMeasureInfo",s,t,"",Ip({},l,{value:h,type:"measure"}))),o.fields=o.wrappedFields.map(e=>e.instance);const d=e=>{e.forEach(e=>{o.allFields.push(e.instance),d(e.measures),d(e.attrDims),d(e.attrExps)})};return d(o.wrappedFields),(r.virtualFields||[]).forEach(e=>{const n=c.field(e.from),i=Qg(Rp({meta:n.raw(),id:"".concat(t,"/").concat(e.key),sourceField:n,fieldExtractor:e=>l.extractor({field:e},c,o,a),key:e.key,type:n.type(),localeInfo:l.localeInfo,value:n.value},e.override||{}));o.virtualFields.push(i)}),o.allFields.push(...o.virtualFields),c}const nm=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],im=/\/qDimensionInfo(?:\/(\d+))?/,rm=/\/qMeasureInfo\/(\d+)/,om=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,sm=/\/qAttrExprInfo\/(\d+)/,am=/\/?qHyperCube/,lm=/\/?qTreeData/,cm=e=>"".concat(e.substr(0,e.indexOf("/qHyperCubeDef")+14)),um=e=>"".concat(e.substr(0,e.indexOf("/qTreeDataDef")+13));function hm(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const i=t.byCells,r=t.primarySource,o=[],s={},a=e.isActive();let l=!1;if(e.brushes().forEach(e=>{const t=function(e,t){let n=e,i=-1,r=-1,o="",s=e=>e;am.test(e)?(o="".concat(n.substr(0,n.indexOf("qHyperCube")+10)),s=cm):lm.test(e)&&(o="".concat(n.substr(0,n.indexOf("qTreeData")+9)),s=um);let a=!0;if(im.test(e)&&(i=+im.exec(e)[1]),rm.test(e)&&(r=+rm.exec(e)[1]),om.test(e)){r=-1,i=0;const e=+om.exec(n)[2];isNaN(e)||(i=e,n=n.replace(/\/\d+$/,"")),a=!1}if(sm.test(e)){const e=r;if(t){r=0;const s=ig(o,t);r+=(s.qMeasureInfo||[]).length,i>-1?(r=s.qDimensionInfo.slice(0,i).reduce((e,t)=>e+t.qAttrExprInfo.length,r),i=-1):(r=s.qDimensionInfo.reduce((e,t)=>e+t.qAttrExprInfo.length,r),r=s.qMeasureInfo.slice(0,e).reduce((e,t)=>e+t.qAttrExprInfo.length,r)),r+=+sm.exec(n)[1]}else i>-1?(i=-1,r=+sm.exec(n)[1]):r+=+sm.exec(n)[1]+1}return nm.forEach(e=>{let t=Cp(e,2),i=t[0],r=t[1];n=n.replace(i,r)}),a&&(n=s(n)),n&&"/"!==n[0]&&(n="/".concat(n)),{measureIdx:r,dimensionIdx:i,path:n}}(e.id,n);if("range"===e.type&&t.measureIdx>-1&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,s.multiRangeSelectTreeDataValues||(s.multiRangeSelectTreeDataValues={path:t.path,ranges:[]}),n.forEach(e=>s.multiRangeSelectTreeDataValues.ranges.push({qMeasureIx:t.measureIdx,qDimensionIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}})))}else{if("range"===e.type&&t.measureIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,s.rangeSelectHyperCubeValues||(s.rangeSelectHyperCubeValues={path:t.path,ranges:[]}),n.forEach(e=>s.rangeSelectHyperCubeValues.ranges.push({qMeasureIx:t.measureIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}})))}if("range"===e.type&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,s.selectHyperCubeContinuousRange||(s.selectHyperCubeContinuousRange={path:t.path,ranges:[]}),n.forEach(e=>s.selectHyperCubeContinuousRange.ranges.push({qDimIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!1}})))}if("value"===e.type&&t.dimensionIdx>-1)if(i)if(n&&n.qHyperCube&&("P"===n.qHyperCube.qMode||"T"===n.qHyperCube.qMode||"K"===n.qHyperCube.qMode)){const i=n.qHyperCube,o=i.qNoOfLeftDims,a=i.qEffectiveInterColumnSortOrder.indexOf(t.dimensionIdx);if(s.selectPivotCells||(s.selectPivotCells={path:t.path,cells:[]}),e.id===r||!r){const n=e.brush.values().map(e=>+e).filter(e=>!isNaN(e));(0===o||a>=o)&&o>-1?n.forEach(e=>{s.selectPivotCells.cells.push({qType:"T",qCol:e,qRow:a-o})}):n.forEach(e=>{s.selectPivotCells.cells.push({qType:"L",qCol:t.dimensionIdx,qRow:e})}),l=!!s.selectPivotCells.cells.length}}else s.selectHyperCubeCells||(s.selectHyperCubeCells={path:t.path,cols:[]}),s.selectHyperCubeCells.cols.push(t.dimensionIdx),e.id!==r&&(r||s.selectHyperCubeCells.values)||(s.selectHyperCubeCells.values=e.brush.values().map(e=>+e).filter(e=>!isNaN(e)),l=!!s.selectHyperCubeCells.values.length);else{const n=e.brush.values().map(e=>+e).filter(e=>!isNaN(e));l=!!n.length,o.push({params:[t.path,t.dimensionIdx,n,!1],method:"selectHyperCubeValues"})}}}),!l&&a)return[{method:"resetMadeSelections",params:[]}];var c;s.rangeSelectHyperCubeValues&&o.push({method:"rangeSelectHyperCubeValues",params:[s.rangeSelectHyperCubeValues.path,s.rangeSelectHyperCubeValues.ranges,[],null===(c=t.orMode)||void 0===c||c]});return s.selectHyperCubeContinuousRange&&o.push({method:"selectHyperCubeContinuousRange",params:[s.selectHyperCubeContinuousRange.path,s.selectHyperCubeContinuousRange.ranges]}),s.selectHyperCubeCells&&o.push({method:"selectHyperCubeCells",params:[s.selectHyperCubeCells.path,s.selectHyperCubeCells.values,s.selectHyperCubeCells.cols]}),s.selectPivotCells&&o.push({method:"selectPivotCells",params:[s.selectPivotCells.path,s.selectPivotCells.cells]}),s.multiRangeSelectTreeDataValues&&o.push({method:"multiRangeSelectTreeDataValues",params:[s.multiRangeSelectTreeDataValues.path,s.multiRangeSelectTreeDataValues.ranges]}),o}function dm(e){tm.util=e.data("matrix").util,e.data("q",tm),e.formatter("q-number",jg),e.formatter("q-time",Jg)}dm.qBrushHelper=hm,dm.selections=hm;const fm={fill:"steelblue",num:1},pm=.9,gm=150,mm=(e,t,n)=>{let i=0,r=0,o=0,s={},a=0;if("labelCenter"===e)i=t.bottomLeft.x,r=t.topRight.y,o=t.bottomRight.x-t.bottomLeft.x,a=t.bottomRight.y-t.topRight.y,s={share:n.share,fill:n.fill};else{const e=180/Math.PI*Math.atan((t.bottomRight.y-t.topRight.y)/(t.topRight.x-t.bottomRight.x));i=e<15&&e>=0?t.topRight.x:e>-15&&e<0?t.bottomRight.x:e<-15?(t.bottomRight.x-t.topRight.x)/2+t.topRight.x+15:(t.topRight.x-t.bottomRight.x)/2+t.bottomRight.x+15,r=t.topRight.y,o=t.width-i,a=t.bottomRight.y-t.topRight.y,s={fill:n.fill}}return{tag:e,type:"rect",x:i,y:r,width:o,height:a,data:n.data,desc:s,fill:"none"}},ym=(e,t)=>{const n=(e=>{const t=(e=>{let t=0;return e.forEach(e=>{e.num>t&&(t=e.num)}),t})(e);let n=0;return e.slice().reverse().map(e=>{const i={datum:e,s:n/t,e:e.num/t};return n=e.num,i}).reverse()})(e),i=t.width*pm,r=t.height*pm,o=(t.width-i)/2,s=(t.height-r)/2,a=i-(i>gm&&r>gm?100:0),l=(r-1*(n.length-1))/n.length,c=[];return n.forEach((e,i)=>{const r=(u=e.e,h=i<n.length-1?e.s:e.e,[.5-.5*u,.5+.5*u,.5+.5*h,.5-.5*h]).map(e=>Math.round(e*a+o));var u,h;const d=l*i+1*i+s,f={bottomRight:{x:r[2],y:Math.round(d+l)},bottomLeft:{x:r[3],y:Math.round(d+l)},topRight:{x:r[1],y:Math.round(d)},topLeft:{x:r[0],y:Math.round(d)},width:t.width},p=`M${f.topLeft.x},${f.topLeft.y} L${f.topRight.x},${f.topRight.y} ${f.bottomRight.x},${f.bottomRight.y} ${f.bottomLeft.x},${f.bottomLeft.y}Z`;c.push({tag:"section",type:"path",d:p,data:e.datum.data,fill:e.datum.fill});const g={share:e.e,fill:e.datum.fill,data:e.datum.data};l>12&&(f.bottomRight.x-f.bottomLeft.x>32&&c.push(mm("labelCenter",f,g)),c.push(mm("labelLeft",f,g)))}),c},xm=(e,t,n,i)=>(i-e)/i*(t-n)+n,vm=(e,t,n)=>{const i=e.filter(e=>"NaN"!==e.num&&e.num>0),r=i.length,o=n.width*pm,s=n.height*pm,a=Math.round((n.width-o)/2),l=Math.round((n.height-s)/2),c=o-(o>gm&&s>gm?100:0),u=s-1*(r-1),h=[],d=i[0].data.num.value;let f=l;return i.forEach((e,i)=>{const r=t[i]*u,o=Math.round(xm(f-l,c,.2*c,s)/2),p=Math.round(xm(f-l+r,c,.2*c,s)/2),g=a+Math.round(c/2),m={bottomRight:{x:g+p,y:Math.round(f+r)},bottomLeft:{x:g-p,y:Math.round(f+r)},topRight:{x:g+o,y:f},topLeft:{x:g-o,y:f},width:n.width},y=`M${m.topLeft.x},${m.topLeft.y} L${m.topRight.x},${m.topRight.y} ${m.bottomRight.x},${m.bottomRight.y} ${m.bottomLeft.x},${m.bottomLeft.y}Z`;h.push({tag:"section",type:"path",d:y,data:e.data,fill:e.fill});const x={share:e.data.num.value/d,fill:e.fill,data:e.data};r>2&&(m.bottomRight.x-m.bottomLeft.x>32&&h.push(mm("labelCenter",m,x)),h.push(mm("labelLeft",m,x))),f+=r+1}),h},bm=(e,t,n)=>{const i=e.filter(e=>"NaN"!==e.num&&e.num>0);if(i&&i.length>0)switch(t){case"WIDTH":default:return ym(i,n);case"ORDER":return vm(i,i.map(()=>1/i.length),n);case"HEIGHT":return vm(i,(e=>{const t=e.reduce((e,t)=>e+t.data.num.value,0);return e.map(e=>e.data.num.value/t)})(i),n);case"AREA":return vm(i,((e,t,n)=>{const i=e.reduce((e,t)=>e+t.data.num.value,0),r=t.width*pm,o=t.height*pm,s=r*n,a=o*(r+s)/2,l=(r-s)/2/o,c=[];let u=0;for(let t=e.length-1;t>=0;t--){const n=e[t].data.num.value/i,r=2*l*u+s,h=-r/(2*l)+Math.sqrt(r*r/(4*l*l)+n*a/l);c[t]=h/o,u+=h}return c})(i,n,.2),n)}return[]};var wm={require:["resolver"],defaultSettings:{settings:{},data:{},style:{item:"$shape"}},render({data:e}){const t=this.resolver.resolve({data:e,defaults:{...fm,...this.style.item},settings:this.settings.settings});return bm(t.items,this.settings.settings.mode,this.rect)}};const km={version:"1.18.0",color:{auto:!0,autoMinMax:!0,byDimDef:void 0,byMeasureDef:void 0,colorExpression:void 0,dimensionScheme:"12",expressionIsColor:!0,expressionLabel:"",measureMin:void 0,measureMax:void 0,measureScheme:"sg",mode:"primary",paletteColor:{index:6},persistent:!1,reverseScheme:!1,singleColor:void 0,useBaseColors:"off",useDimColVal:!0,useMeasureGradient:!0},dataPoint:{auto:!0,labelMode:"share"},footnote:"",funnel:{mode:"WIDTH"},qHyperCubeDef:{qDimensions:[],qMeasures:[],qInterColumnSortOrder:[],qInitialDataFetch:[{qWidth:2,qHeight:5e3}],qSuppressMissing:!0,qSuppressZero:!1},showDimensionTitle:!0,showTitles:!0,subtitle:"",title:""},_m="object",Mm=["Abril Fatface, serif","Bangers, fantasy","Bebas Neue, sans serif","EB Garamond, serif","Fredoka One, fantasy","Graduate, fantasy","Gravitas One, serif","Indie Flower, fantasy","Inter, sans-serif","Lobster, fantasy","Montserrat, sans-serif","Nixie One, sans-serif","Noto Sans, sans-serif","Open Sans, sans-serif","PT Serif, serif","Pacifico, cursive","Permanent Marker, fantasy","QlikView Sans, sans-serif","Raleway, sans-serif","Rammetto One, fantasy","Roboto, sans-serif","Source Sans Pro, sans-serif","Titan One, fantasy","Yanone Kaffeesatz, sans-serif"];const Sm=e=>({value:e,label:e.charAt(0).toUpperCase()+e.slice(1),groupHeader:!1,disabled:!1,styles:{fontFamily:e}});function Rm({theme:e,translator:t,id:n,path:i}){const r=()=>e.getStyle(n,i,"fontFamily");return{getDefaultValue:()=>r(),getOptions:()=>function({theme:e,translator:t,defaultValue:n}){const i=[],r=e.getStyle("","","fontFamilies");return Array.isArray(r)&&r.length?i.push(...new Set([n,...r.map(e=>e.split(",").map(e=>e.trim()).map(e=>e.replace(/\s+/g," ").trim()).filter(Boolean).join(", "))])):i.push(n),[{value:"ThemeHeader",label:t.get("properties.themeFonts"),metaText:t.get("properties.theme"),groupHeader:!0},...i.map(e=>Sm(e)),{value:"DefaultHeader",label:t.get("properties.allFonts"),metaText:t.get("properties.default"),groupHeader:!0},...Mm.map(e=>Sm(e))]}({theme:e,translator:t,defaultValue:r()})}}var Cm=["10px","11px","12px","13px","14px","15px","16px","17px","18px","19px","20px","21px","22px","23px","24px"];const Nm=e=>({value:e,label:e,groupHeader:!1,disabled:!1});function Dm({theme:e,translator:t,id:n,path:i}){const r=()=>e.getStyle(n,i,"fontSize");return{getDefaultValue:()=>r(),getOptions:()=>function({theme:e,translator:t,defaultValue:n}){const i=[],r=e.getStyle("","","fontSizes");return Array.isArray(r)&&r.length?i.push(...new Set([n,...r])):i.push(n),[{value:"ThemeHeader",label:t.get("properties.themeFontSizes"),metaText:t.get("properties.theme"),groupHeader:!0},...i.map(e=>Nm(e)),{value:"DefaultHeader",label:t.get("properties.allFontSizes"),metaText:t.get("properties.default"),groupHeader:!0},...Cm.map(e=>Nm(e))]}({theme:e,translator:t,defaultValue:r()})}}function qm({theme:e,translator:t,id:n,path:i}){return{fontFamily:Rm({theme:e,translator:t,id:n,path:i}),fontSize:Dm({theme:e,translator:t,id:n,path:i})}}const Em=["__proto__","constructor"],zm=e=>{if(Em.some(t=>e.includes(t)))throw new Error("font-resolver: Forbidden property.")};var Am,Om,Tm,Im=function(){if(Om)return Am;Om=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,r=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===t.call(e)},o=function(n){if(!n||"[object Object]"!==t.call(n))return!1;var i,r=e.call(n,"constructor"),o=n.constructor&&n.constructor.prototype&&e.call(n.constructor.prototype,"isPrototypeOf");if(n.constructor&&!r&&!o)return!1;for(i in n);return void 0===i||e.call(n,i)},s=function(e,t){n&&"__proto__"===t.name?n(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},a=function(t,n){if("__proto__"===n){if(!e.call(t,n))return;if(i)return i(t,n).value}return t[n]};return Am=function e(){var t,n,i,l,c,u,h=arguments[0],d=1,f=arguments.length,p=!1;for("boolean"==typeof h&&(p=h,h=arguments[1]||{},d=2),(null==h||"object"!=typeof h&&"function"!=typeof h)&&(h={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)i=a(h,n),h!==(l=a(t,n))&&(p&&l&&(o(l)||(c=r(l)))?(c?(c=!1,u=i&&r(i)?i:[]):u=i&&o(i)?i:{},s(h,{name:n,newValue:e(p,u,l)})):void 0!==l&&s(h,{name:n,newValue:l}));return h},Am}(),jm=(Tm=Im)&&Tm.__esModule&&Object.prototype.hasOwnProperty.call(Tm,"default")?Tm.default:Tm;function Pm(e,t){return{range:({resources:e,data:n})=>{const i=e.theme.palette("categorical",0===t?n.items.length:t);return n.items.map(e=>i[e.value%i.length])},valueAccessor:e.value}}function Fm(e,t){return{range:({resources:e,data:n})=>{const i=e.theme.palette("categorical",0===t?n.items.length:t);return n.items.map(e=>i[e.row.value%i.length])},valueAccessor:e.value}}function Lm(e,t,n,i,{byRow:r,byElemNo:o}){var s;if(i&&(t.input.persistent||e.hc.qDimensionInfo.length>1||void 0===n.activeDimensionIndex&&e.hc.qSize.qcy>(s=e.hc,(s.qDataPages[0]||s.qStackedDataPages[0])?.qArea.qHeight||0)))return o(i,i.raw().qCardinal);if(i){const e=t.pic.extract({field:i.key(),trackBy:i.value}).length;return r(i,e)}return{}}function $m(e,t){const{hc:{qDimensionInfo:n}}=e;let i=t.input.byDimDef||{activeDimensionIndex:n.length-1};if(i.activeDimensionIndex>=0){const e=n[i.activeDimensionIndex];i=e.coloring&&e.coloring.colorMapRef?{type:"libraryItem",key:e.coloring.colorMapRef,activeDimensionIndex:i.activeDimensionIndex}:{activeDimensionIndex:i.activeDimensionIndex}}return i}function Bm(e,t){let n;return t.activeDimensionIndex>=0?n=e.pic.fields().filter(e=>"dimension"===e.type())[t.activeDimensionIndex]:"libraryItem"===t.type?(n=t.key?e.pic.field(e=>e.raw().colorMapRef===t.key):void 0,!1===n&&(n=e.pic.field(e=>"colorByAlternative"===e.raw().id))):"expression"===t.type&&(n=e.pic.field(e=>"colorByAlternative"===e.raw().id)),n}function Hm(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Wm(e,t){var n=Object.create(e.prototype);for(var i in t)n[i]=t[i];return n}function Vm(){}var Um=.7,Ym=1/Um,Km="\\s*([+-]?\\d+)\\s*",Xm="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Gm="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Jm=/^#([0-9a-f]{3,8})$/,Zm=new RegExp(`^rgb\\(${Km},${Km},${Km}\\)$`),Qm=new RegExp(`^rgb\\(${Gm},${Gm},${Gm}\\)$`),ey=new RegExp(`^rgba\\(${Km},${Km},${Km},${Xm}\\)$`),ty=new RegExp(`^rgba\\(${Gm},${Gm},${Gm},${Xm}\\)$`),ny=new RegExp(`^hsl\\(${Xm},${Gm},${Gm}\\)$`),iy=new RegExp(`^hsla\\(${Xm},${Gm},${Gm},${Xm}\\)$`),ry={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function oy(){return this.rgb().formatHex()}function sy(){return this.rgb().formatRgb()}function ay(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Jm.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?ly(t):3===n?new dy(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?cy(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?cy(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=Zm.exec(e))?new dy(t[1],t[2],t[3],1):(t=Qm.exec(e))?new dy(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=ey.exec(e))?cy(t[1],t[2],t[3],t[4]):(t=ty.exec(e))?cy(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=ny.exec(e))?xy(t[1],t[2]/100,t[3]/100,1):(t=iy.exec(e))?xy(t[1],t[2]/100,t[3]/100,t[4]):ry.hasOwnProperty(e)?ly(ry[e]):"transparent"===e?new dy(NaN,NaN,NaN,0):null}function ly(e){return new dy(e>>16&255,e>>8&255,255&e,1)}function cy(e,t,n,i){return i<=0&&(e=t=n=NaN),new dy(e,t,n,i)}function uy(e){return e instanceof Vm||(e=ay(e)),e?new dy((e=e.rgb()).r,e.g,e.b,e.opacity):new dy}function hy(e,t,n,i){return 1===arguments.length?uy(e):new dy(e,t,n,null==i?1:i)}function dy(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}function fy(){return`#${yy(this.r)}${yy(this.g)}${yy(this.b)}`}function py(){const e=gy(this.opacity);return`${1===e?"rgb(":"rgba("}${my(this.r)}, ${my(this.g)}, ${my(this.b)}${1===e?")":`, ${e})`}`}function gy(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function my(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function yy(e){return((e=my(e))<16?"0":"")+e.toString(16)}function xy(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new by(e,t,n,i)}function vy(e){if(e instanceof by)return new by(e.h,e.s,e.l,e.opacity);if(e instanceof Vm||(e=ay(e)),!e)return new by;if(e instanceof by)return e;var t=(e=e.rgb()).r/255,n=e.g/255,i=e.b/255,r=Math.min(t,n,i),o=Math.max(t,n,i),s=NaN,a=o-r,l=(o+r)/2;return a?(s=t===o?(n-i)/a+6*(n<i):n===o?(i-t)/a+2:(t-n)/a+4,a/=l<.5?o+r:2-o-r,s*=60):a=l>0&&l<1?0:s,new by(s,a,l,e.opacity)}function by(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}function wy(e){return(e=(e||0)%360)<0?e+360:e}function ky(e){return Math.max(0,Math.min(1,e||0))}function _y(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}Hm(Vm,ay,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:oy,formatHex:oy,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return vy(this).formatHsl()},formatRgb:sy,toString:sy}),Hm(dy,hy,Wm(Vm,{brighter(e){return e=null==e?Ym:Math.pow(Ym,e),new dy(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?Um:Math.pow(Um,e),new dy(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new dy(my(this.r),my(this.g),my(this.b),gy(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:fy,formatHex:fy,formatHex8:function(){return`#${yy(this.r)}${yy(this.g)}${yy(this.b)}${yy(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:py,toString:py})),Hm(by,function(e,t,n,i){return 1===arguments.length?vy(e):new by(e,t,n,null==i?1:i)},Wm(Vm,{brighter(e){return e=null==e?Ym:Math.pow(Ym,e),new by(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?Um:Math.pow(Um,e),new by(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*t,r=2*n-i;return new dy(_y(e>=240?e-240:e+120,r,i),_y(e,r,i),_y(e<120?e+240:e-120,r,i),this.opacity)},clamp(){return new by(wy(this.h),ky(this.s),ky(this.l),gy(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=gy(this.opacity);return`${1===e?"hsl(":"hsla("}${wy(this.h)}, ${100*ky(this.s)}%, ${100*ky(this.l)}%${1===e?")":`, ${e})`}`}}));const My=Math.PI/180,Sy=180/Math.PI,Ry=.96422,Cy=.82521,Ny=4/29,Dy=6/29,qy=3*Dy*Dy,Ey=Dy*Dy*Dy;function zy(e){if(e instanceof Ay)return new Ay(e.l,e.a,e.b,e.opacity);if(e instanceof Py)return Fy(e);e instanceof dy||(e=uy(e));var t,n,i=jy(e.r),r=jy(e.g),o=jy(e.b),s=Oy((.2225045*i+.7168786*r+.0606169*o)/1);return i===r&&r===o?t=n=s:(t=Oy((.4360747*i+.3850649*r+.1430804*o)/Ry),n=Oy((.0139322*i+.0971045*r+.7141733*o)/Cy)),new Ay(116*s-16,500*(t-s),200*(s-n),e.opacity)}function Ay(e,t,n,i){this.l=+e,this.a=+t,this.b=+n,this.opacity=+i}function Oy(e){return e>Ey?Math.pow(e,1/3):e/qy+Ny}function Ty(e){return e>Dy?e*e*e:qy*(e-Ny)}function Iy(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function jy(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Py(e,t,n,i){this.h=+e,this.c=+t,this.l=+n,this.opacity=+i}function Fy(e){if(isNaN(e.h))return new Ay(e.l,0,0,e.opacity);var t=e.h*My;return new Ay(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}Hm(Ay,function(e,t,n,i){return 1===arguments.length?zy(e):new Ay(e,t,n,null==i?1:i)},Wm(Vm,{brighter(e){return new Ay(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new Ay(this.l-18*(null==e?1:e),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return new dy(Iy(3.1338561*(t=Ry*Ty(t))-1.6168667*(e=1*Ty(e))-.4906146*(n=Cy*Ty(n))),Iy(-.9787684*t+1.9161415*e+.033454*n),Iy(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),Hm(Py,function(e,t,n,i){return 1===arguments.length?function(e){if(e instanceof Py)return new Py(e.h,e.c,e.l,e.opacity);if(e instanceof Ay||(e=zy(e)),0===e.a&&0===e.b)return new Py(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*Sy;return new Py(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new Py(e,t,n,null==i?1:i)},Wm(Vm,{brighter(e){return new Py(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new Py(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return Fy(this).rgb()}}));var Ly=e=>()=>e;function $y(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):Ly(isNaN(e)?t:e)}var By=function e(t){var n=function(e){return 1===(e=+e)?$y:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(i){return Math.pow(e+i*t,n)}}(t,n,e):Ly(isNaN(t)?n:t)}}(t);function i(e,t){var i=n((e=hy(e)).r,(t=hy(t)).r),r=n(e.g,t.g),o=n(e.b,t.b),s=$y(e.opacity,t.opacity);return function(t){return e.r=i(t),e.g=r(t),e.b=o(t),e.opacity=s(t),e+""}}return i.gamma=e,i}(1);const Hy=/^class(-pyramid)?/,Wy=(e,t,n,i)=>{let r=void 0!==n.min?n.min:i.min(),o=void 0!==n.max?n.max:i.max();const s=r,a=o,{limits:l}=t,c={},u="percent"===t.limitType?l.map(e=>r+(o-r)*e):l,h=t.colors.map(t=>e.resolveUIColor(t));if(r=Math.min(r,...u),o=Math.max(o,...u),c.min=r,c.max=o,t.breakTypes&&-1===t.breakTypes.indexOf(!0))c.type="categorical",Object.assign(c,(({min:e,max:t,limits:n,range:i})=>{const r=[],o=[];if(n.length)if(n[n.length-1]<e)o.push(e,t),r.push(i[i.length-1],i[i.length-1],i[i.length-1]);else if(n[0]>t)o.push(e,t),r.push(i[0],i[0],i[0]);else{if(n[0]>e)o.push(e),r.push(i[0]);else{o.push(e);for(let t=0;t<n.length;t++)if(e<n[t]){r.push(i[t]);break}}for(let s=0;s<n.length;s++)e<n[s]&&n[s]<t&&(o.push(n[s]),r.push(i[s]));if(n[n.length-1]<t)o.push(t),r.push(i[n.length]),r.push(i[n.length]);else{o.push(t);for(let e=0;e<n.length;e++)if(n[e]>t){r.push(i[e]),r.push(i[e]);break}}}else r.push(i[0]);return{min:e,max:t,range:r,domain:o}})({min:"percent"===t.limitType?r:s,max:"percent"===t.limitType?o:a,range:h,limits:"percent"===t.limitType?u:l}));else if(t.breakTypes){const e=t.breakTypes;c.type="continuous",c.domain=[r],c.range=[h[0]];for(let t=0;t<u.length;t+=1)if(e[t]){const n=h[t],i=h[t+1],r=By(n,i)(.5);c.range.push(r),c.domain.push(u[t]),t<u.length-1&&e[t+1]&&(c.range.push(h[t+1]),c.domain.push((u[t]+u[t+1])/2))}else c.range.push(h[t]),c.range.push(h[t+1]),c.domain.push(u[t]),c.domain.push(u[t]+Math.min(1e-6,(o-r)/1e6));c.range.push(h[h.length-1]),c.domain.push(o)}else c.domain=u,c.range=h;return c};function Vy(e,t,n,i,r){let o=0;const s=[];let a,l,c;const u=(e-t)/(i+1);if(0===u)return 1;for(a=0;a<n.length;a+=1)l=.99*(n[a]-t),c=n[a]>e?Math.floor(e/u):n[a]<t?0:Math.floor(l/u),Number.isNaN(c)||(s[c]?s[c]+=1:s[c]=1);for(a=0;a<s.length;a+=1)s[a]&&(o+=1);return o<=i||o>=r?Math.max(o,i):Vy(e,t,n,i+1,r)}const Uy=(e,{theme:t,hc:n},i,{f:r})=>{const o={mode:"field",fieldType:"measure",field:r?r.key():void 0,reverse:i.input.reverseScheme||!1,type:"continuous",range:({resources:e})=>e.theme.palette("quant")};let s=[],a=!0;if(r){if(Number.isNaN(+r.min())||Number.isNaN(+r.max()))return{invalid:!0};a=!("S"===(l=i.pic.raw()).qMode&&(l.qDataPages[0]&&l.qSize.qcy>l.qDataPages[0].qArea.qHeight||!l.qDataPages.length&&l.qSize.qcy>0)||"K"===l.qMode&&l.qStackedDataPages[0]&&l.qSize.qcy>l.qStackedDataPages[0].qArea.qHeight||"T"===l.qMode&&l.qSize.qcy>l.qTreeDataPages[0].qGroupSize),a&&(s=i.pic.extract({field:0,props:{num:{field:r.key()},exclude:{fields:n.qDimensionInfo.map((e,t)=>({field:`qDimensionInfo/${t}`})),value:e=>Math.min(...e)<0}}}).filter(e=>e.value>=0&&!e.exclude.value).map(e=>e.num.value).filter(e=>"number"==typeof e))}var l;if(!1===i.input.autoMinMax){if(o.min=i.input.measureMin,o.max=i.input.measureMax,o.max<o.min)return{invalid:!0}}else if(r&&!a)o.min=r.min(),o.max=r.max();else if(r){if(!s.length)return{invalid:!0};o.min=Math.min(...s),o.max=Math.max(...s)}let c;if(i.input.measureScheme&&(o.palettes={quant:i.input.measureScheme}),t){const e=t.getDataColorScales().filter(e=>e.key===i.input.measureScheme)[0];o.type=e&&Hy.test(e.type)?"categorical":"continuous","categorical"===o.type&&(c=e.colors.some(e=>Array.isArray(e))?Math.max(...e.colors.map(e=>e?e.length:0)):e.colors.length)}if("categorical"===o.type){const e=a?Vy(o.max,o.min,s,1,c):c,t=(o.max-o.min)/e,n=[];for(let i=0;i<e+1;i+=1)n.push(o.min+t*i);o.domain=n,o.range=({resources:t})=>{const n=t.theme.palette("quant",e),i=Math.max(1,Math.floor(n.length/e)),r=[];for(let t=0;t<e;t+=1)r.push(n[t*i]);return[r[0],...r,r[r.length-1]]}}return o};function Yy(e,t){let n;return t.activeMeasureIndex>=0?n=e.pic.fields().filter(e=>"measure"===e.type())[t.activeMeasureIndex]:"libraryItem"===t.type?n=e.pic.field(e=>e.raw().colorMapRef===t.key&&void 0!==t.key):"expression"===t.type&&(n=e.pic.field(e=>"colorByAlternative"===e.raw().id)),n||(n=e.pic.field(e=>void 0!==e.raw().matchMeasure),n&&(n=e.pic.fields().filter(e=>"measure"===e.type())[n.raw().matchMeasure])),n}function Ky(e){e.measureOverrides.every(e=>!e)&&(e.measureOverrides=null)}function Xy(e,t){const n=t?.domain||[],i=t?.range||[],r=[];for(let t=0;t<e.length;++t){const o=e[t];if("constant"===o?.mode){const r=n.indexOf(t);-1===r?(n.push(t),i.push(o.primary)):i[r]=o.primary,e[t]=null}else if(o){r.push(t);const e=n.indexOf(t);-1!==e&&(n.splice(e,1),i.splice(e,1))}}return{domain:n,range:i,exclude:r}}function Gy(e,t,n,i){const r=function(e,t,n,i){if(t.input&&!t.input.auto){if("byMeasure"===t.input.mode)return function(e,{theme:t,hc:n},i,{getCField:r=Yy}={}){const o=i.input.byMeasureDef||{activeMeasureIndex:0},s=r(i,o),a=Uy(0,{theme:t,hc:n},i,{f:s});if(a.invalid)return a;"expression"===o.type&&(o.activeMeasureIndex<0||void 0===o.activeMeasureIndex)&&(a.label=o.label,s&&"color.altLabel"===s.raw().labelExpRef&&(a.label=i.input.altLabel)),!a.label&&s&&(a.label=s.title());let l=o.activeMeasureIndex>=0?s:null;if(!l&&s&&void 0!==s.raw().matchMeasure&&s.raw().matchMeasure>-1&&(l=i.pic.fields().filter(e=>"measure"===e.type())[s.raw().matchMeasure]),i.input.useMeasureGradient&&"libraryItem"===o.type)if(l){const t=l.raw().coloring;t&&t.gradient&&jm(a,Wy(e,t.gradient,a,l))}else a.auxiliary=o;return a}(e,n,t);if("byDimension"===t.input.mode)return function(e,t,n,{getCDef:i=$m,getCByField:r=Bm,getPersistence:o=Lm}={}){const s=i(t,n),a=r(n,s),l=a?a.raw():{},c=n&&n.pic?n.pic.raw():{};if(l.qError||l.qSize&&0===l.qSize.qcy&&!c.qHasOtherValues)return{invalid:!0};const u={mode:"field",fieldType:"dimension",type:"categorical",field:a?a.key():void 0,isFieldLocked:l.qLocked};return("expression"===s.type||s.activeDimensionIndex<0)&&(u.label=s.label,"color.altLabel"===l.labelExpRef&&(u.label=n.input.altLabel)),!u.label&&a&&(u.label=a.title()),n.input.dimensionScheme&&(u.palettes={categorical:n.input.dimensionScheme}),n.input.useDimColVal&&"libraryItem"===s.type&&(u.auxiliary=s),jm(u,o(t,n,s,a,{byRow:Fm,byElemNo:Pm})),u}(0,n,t);if("byExpression"===t.input.mode)return function(e,{hc:t,theme:n,translator:i},r,o){const s=r.pic.field(e=>"colorByExpression"===e.raw().id);if(!s||!s.raw().qFallbackTitle&&!r.input.colorExpression||!(Number.isFinite(s.raw().qMin)&&Number.isFinite(s.raw().qMax)||r.input.expressionIsColor))return{mode:"constant",type:"constant",primary:o.nil};if(r.input.expressionIsColor)return{mode:"field",fieldType:"expression",field:s?s.key():void 0,type:"color"};const a=Uy(0,{hc:t,theme:n},r,{f:s});return a.invalid||(a.label=r.input.expressionLabel||i.get("Object.ChartTooltip.ColorExpression")),a}(0,n,t,i);if("byMultiple"===t.input.mode||"primary"===t.input.mode)return function(e,{hc:t,theme:n,translator:i},r,o){let s=r.input.useBaseColors;if(("byMultiple"===r.input.mode||"primary"===r.input.mode&&"measure"===r.input.useBaseColors)&&t.qMeasureInfo.length>1&&(s="measure"),"measure"===s){const s=[],a=[];"measure"===r.input.useBaseColors&&t.qMeasureInfo.forEach((t,n)=>{if(t.baseColor||t.coloring&&t.coloring.baseColor){s.push(n);const i=e.resolveUIColor(t.baseColor||t.coloring.baseColor);"none"===i?a.push(o.primary):a.push(i)}});let l=r.input.dimensionScheme?{categorical:r.input.dimensionScheme}:void 0;const c=n?n.getDataColorPalettes()[0]:void 0;return"measure"===r.input.useBaseColors&&c&&(l={categorical:c.key}),{mode:"measure",type:"categorical",palettes:l,label:i?i.get("Common.Measures"):void 0,explicit:s.length?{domain:s,range:a}:void 0}}if("dimension"===s){const n=[],i=[];return t.qDimensionInfo.forEach((t,r)=>{if(t.baseColor||t.coloring&&t.coloring.baseColor){n.push(r);const s=e.resolveUIColor(t.baseColor||t.coloring.baseColor);"none"===s?i.push(o.primary):i.push(s)}}),{mode:"dimension",type:"categorical",field:n.length?n[0]:void 0,explicit:n.length?{domain:n,range:i}:void 0}}let a=o.primary;if(void 0!==r.input.paletteColor)r.input.paletteColor&&(a=e.resolveUIColor(r.input.paletteColor));else{const{singleColor:e}=r.input;"number"!=typeof e||Number.isNaN(e)||(a=["#b0afae","#7b7a78","#545352","#4477aa","#7db8da","#b6d7ea","#46c646","#f93f17","#ffcf02","#276e27","#ffffff","#000000"][e])}return{mode:"constant",type:"constant",primary:a}}(e,n,t,i)}return{}}(e,t,n,i);return t.input?.measureOverrides?(r.measureOverrides=t.input.measureOverrides.map((n,r)=>function({cm:e,defaults:t,index:n,input:i,pic:r}){if(!i||!i.on)return null;const o=i.mode??"primary";return"primary"===o?function(e,t,n){let{primary:i}=n;return void 0!==t.paletteColor&&t.paletteColor&&(i=e.resolveUIColor(t.paletteColor)),{...n,mode:"constant",type:"constant",primary:i}}(e,i,t):"byExpression"===o?function(e,t,n){const i=`qMeasureInfo/${e}/`,r=t.field(e=>e.id().startsWith(i)&&"colorByMeasureExpression"===e.raw().id);return r?{...n,mode:"field",fieldType:"expression",field:r?r.key():void 0,type:"color"}:{...n,mode:"constant",type:"constant",primary:n.nil}}(n,r,t):null}({cm:e,input:n,defaults:i,index:r,pic:t.pic})),function(e,{translator:t}){if(Ky(e),1===e.measureOverrides?.length)return e.measureOverrides[0];if("measure"===e.mode&&e.measureOverrides&&(e.explicit=Xy(e.measureOverrides,e.explicit),Ky(e)),e.measureOverrides?.every(e=>"constant"===e?.mode)){const n={mode:"measure",type:"categorical",label:t?.get("Common.Measures")};return n.explicit=Xy(e.measureOverrides),n}return e.measureOverrides?.every(e=>e)?{invalid:!0,measureOverrides:e.measureOverrides}:e}(r,n)):r}const Jy=(e,t)=>{const n=e.fieldType,i={};if(t)if("measure"===n){const e=t.coloring;e&&(i.measureGradient=e.gradient)}else if("dimension"===n){const e=t[0],n=t[1];e&&(i.legendDataPage=e),n&&(i.dimValsData=n.colorMap)}return i},Zy=e=>{throw e.isHandled=!0,e};function Qy({auto:e,resources:t}={}){const n=function(e){const t={hc:null,colorProps:null,layout:null,theme:null,...e};let n={};const i={auto:()=>({mode:"primary"}),getDimensionColorMap:()=>Promise.reject(),getMeasure:()=>Promise.reject(),getAttributeDimension:()=>Promise.reject()},r={auto:e=>e?(i.auto=e,r):i.auto,getDimensionColorMap:e=>e?(i.getDimensionColorMap=e,r):i.getDimensionColorMap,getAttributeDimension:e=>e?(i.getAttributeDimension=e,r):i.getAttributeDimension,getMeasure:e=>e?(i.getMeasure=e,r):i.getMeasure,set(e){if(!e.colorProps)throw new Error('Missing "colorProps"');if(jm(t,e),n={pic:t.picasso.data("q")({data:t.hc,config:{localeInfo:t.localeInfo}}),input:t.colorProps},n.input.auto){const r=i.auto(e.layout);n.input=jm(!0,{},n.input,r,{auto:!1});const o=t.theme?t.theme.getDataColorPalettes():[];o[0]&&(n.input.dimensionScheme=o[0].key);let s=0;n.input.byDimDef&&+n.input.byDimDef.activeDimensionIndex>=0&&(s=+n.input.byDimDef.activeDimensionIndex),t.hc&&t.hc.qDimensionInfo[s]&&t.hc.qDimensionInfo[s].coloring&&t.hc.qDimensionInfo[s].coloring.colorMapRef&&n.input.byDimDef&&(n.input.byDimDef.type="libraryItem",n.input.byDimDef.key=t.hc.qDimensionInfo[s].coloring.colorMapRef)}n.input.measureOverrides?.every(e=>!e||!e.on)&&(n.input=jm(!1,{},n.input,{measureOverrides:null}))},palettes(){if(!n.palettes){const{theme:e}=t,i=[];(e&&e.getDataColorPickerPalettes()||[]).forEach(e=>{i.push({key:"ui",colors:e.colors})}),n.palettes=i}return n.palettes},getAuxiliaryData(e,n="/qHyperCubeDef"){if(!e.auxiliary&&!/qAttrDimInfo/.test(e.field))return Promise.resolve();const{key:r}=e.auxiliary||{};if("measure"===e.fieldType)return i.getMeasure(r,t).catch(()=>{});if("dimension"===e.fieldType){const o=`${n}/${e.field}`.replace("qDimensionInfo","qDimensions").replace("qAttrDimInfo","qAttributeDimensions");return Promise.all([/qAttrDimInfo/.test(e.field)?i.getAttributeDimension(o,t).catch(()=>{}):Promise.resolve(),r?i.getDimensionColorMap(r,t).catch(()=>{}):Promise.resolve()])}return Promise.resolve()},getAuxiliarySettings(e,i){return e.auxiliary||/qAttrDimInfo/.test(e.field)?(this.palettes(),this.getAuxiliaryData(e,i).then(i=>{if(!i)return{};if("measure"===e.fieldType){if(i.coloring&&i.coloring.gradient){const t=n.pic.field(e.field);return Wy(this,i.coloring.gradient,e,t)}return{}}if("dimension"===e.fieldType){const r={nil:e.nil,others:e.others},o=i[0],s=i[1]?i[1].colorMap:null;if(o){const i=t.picasso.data("q")({data:{qDimensionInfo:[n.pic.field(e.field).raw(),n.pic.field(e.field).raw()],qMeasureInfo:[],qDataPages:o,qInterColumnSortOrder:[0,1],qMode:"S"}});r.legendDataset=i}return s?((e,t,n,{external:i,field:r})=>{const o={...e};jm(o,Pm(r,r.raw().qCardinal));const s=i.theme?i.theme.getDataColorPalettes()[0]:null;return t.nul&&(o.nil=n.resolveUIColor(t.nul)),t.oth&&(o.others=n.resolveUIColor(t.oth)),t.usePal?(o.palettes={categorical:t.pal},s&&!t.pal&&(o.palettes.categorical=s.key,jm(o,Pm(r)))):!1===t.autoFill&&t.single?o.range=[n.resolveUIColor(t.single)]:t.autoFill&&(s&&(o.palettes={categorical:s.key}),jm(o,Pm(r))),t.colors&&t.colors.length&&(o.explicit=((e,t,n)=>{const i={};for(let t=0;t<e.length;t+=1)i[e[t].value]=e[t].baseColor;let r=[];return{domain({data:e}){const o=[];r=[];for(let n=0;n<e.items.length;n++){const s=e.items[n],a=(s.text||s).label;i[a]&&-1===o.indexOf(s.value)&&(o.push(s.value),r.push(t.resolveUIColor(i[a])))}return o.push(-3,-2),r.push(n.others),r.push(n.nil),o},range:()=>r}})(t.colors,n,o)),o})(r,s,this,{external:t,field:n.pic.field(e.field)}):r}return{}})):Promise.resolve()},resolveUIColor(e){if(e.index<0||void 0===e.index)return e.color;if(void 0===n.uiPalette&&(n.uiPalette=this.palettes().filter(e=>"ui"===e.key)[0]||!1),!n.uiPalette)return e.color;const t="none"===n.uiPalette.colors[0]?e.index:e.index-1;return void 0===n.uiPalette.colors[t]?e.color:n.uiPalette.colors[t]},settings(){if(this.palettes(),!n.settings){let e={primary:"steelblue",others:"#aaa",nil:"#ddd"};const{theme:i}=t;i&&(e={...e,...i.getDataColorSpecials()}),n.settings=jm(e,Gy(this,n,t,e))}return n.settings}};return r}(t).auto(e||(()=>({mode:"byDimension",persistent:!1,useDimColVal:!0,byDimDef:{activeDimensionIndex:0,type:"expression",label:""}}))).getDimensionColorMap((e,{layout:t,app:n})=>((e,{layout:t,app:n})=>t&&t.snapshotData?t.snapshotData.content&&t.snapshotData.content.chartData&&t.snapshotData.content.chartData.dimValsData?Promise.resolve({colorMap:t.snapshotData.content.chartData.dimValsData}):Promise.reject():n&&n.getObject?n.getObject(`ColorMapModel_${e}`).then(e=>e.getLayout()):Promise.reject())(e,{layout:t,app:n})).getMeasure((e,{layout:t,app:n})=>((e,{layout:t,app:n})=>t&&t.snapshotData?t.snapshotData.content&&t.snapshotData.content.chartData&&t.snapshotData.content.chartData.measureGradient?Promise.resolve({coloring:{gradient:t.snapshotData.content.chartData.measureGradient}}):Promise.reject():n&&n.getMeasure?n.getMeasure(e).then(e=>e.getMeasure()):Promise.reject())(e,{layout:t,app:n})).getAttributeDimension((e,{layout:t,model:n,app:i})=>((e,{layout:t,model:n,app:i})=>{if(t&&t.snapshotData)return t.snapshotData.content&&t.snapshotData.content.chartData&&t.snapshotData.content.chartData.legendDataPage?Promise.resolve(t.snapshotData.content.chartData.legendDataPage):Promise.reject();if(n&&n.session&&i){const t=[{qHeight:100,qLeft:0,qTop:0,qWidth:2}];return n.getHyperCubeData(e,t).catch(Zy)}return Promise.reject()})(e,{layout:t,model:n,app:i}));return n.getSnapshotData=Jy,n}function ex(e){return t=>"object"==typeof t.datum[e]?t.datum[e].value:void 0}function tx(e){return"object"==typeof e.datum.isNull?e.datum.isNull.value:-2===e.datum.value}function nx(e){return-3===e.datum.value}const ix={COLOR:void 0,FONT_SIZE:"16px",FONT_FAMILY:"'Source Sans Pro', 'Arial', 'sans-serif'"},rx={COLOR:void 0,FONT_SIZE:void 0,FONT_FAMILY:"'Source Sans Pro', 'Arial', 'sans-serif'"},ox="legend.title",sx="legend.label";function ax({theme:e,key:t,styleOverrides:n}){const i={title:{color:ix.COLOR,fontSize:ix.FONT_SIZE,fontFamily:ix.FONT_FAMILY},label:{color:rx.COLOR,fontSize:rx.FONT_SIZE,fontFamily:rx.FONT_FAMILY}};if(!e&&!n)return i;const{title:r,label:o}=n||{},s=(({theme:e,key:t})=>(n,i,r,o)=>void 0!==n?n:e?e.getStyle(t,i,r):o)({theme:e,key:t});return i.title.color=s(r?.color,ox,"color",ix.COLOR),i.title.fontSize=s(r?.fontSize,ox,"fontSize",ix.FONT_SIZE),i.title.fontFamily=s(r?.fontFamily,ox,"fontFamily",ix.FONT_FAMILY),i.label.color=s(o?.color,sx,"color",rx.COLOR),i.label.fontSize=s(o?.fontSize,sx,"fontSize",rx.FONT_SIZE),i.label.fontFamily=s(o?.fontFamily,sx,"fontFamily",rx.FONT_FAMILY),i}const lx=(e,t,n)=>{const i=e&&e.dock||void 0;if("auto"!==i)return i||"right";if(t){const e=t.element.getBoundingClientRect();if(e.height>e.width)return"bottom"}return n?"left":"right"},cx=(e,t,n)=>!(n.invalid||"color"===n.type||"measure"===n.mode&&t.qMeasureInfo.length<=1||"dimension"===n.mode)&&("function"==typeof e.show?e.show():!1!==e.show);function ux(e,t){const{styleReference:n,styleOverrides:i,chart:r,rtl:o}=e,{legendProps:s,coloring:a,theme:l,hc:c}=t,u=ax({theme:l,key:n,styleOverrides:i});return{layout:{minimumLayoutMode:"MEDIUM",dock:lx(s,r,o)},show:"function"==typeof s.show?()=>cx(s,c,a):cx(s,c,a),renderer:"svg",mounted(e){e.childNodes[0].style.pointerEvents="none",e.style.overflow="hidden"},settings:{title:{show:!1!==s.showTitle,wordBreak:"break-word",maxLines:2,lineHeight:1.2,text:a.label||"",fill:u.title.color,fontSize:u.title.fontSize,fontFamily:u.title.fontFamily}}}}const hx=({eventName:e,key:t,requireFailure:n,recognizeWith:i}={},{actions:r}={})=>({key:`event:pan-${t}`,type:"Pan",requireFailure:n,recognizeWith:i,options:{event:e,pointers:1,threshold:10,enable(n,i){return this.started===e||!i||!(r?.interact?.enabled&&!r.interact.enabled())&&this.chart.componentsFromPoint({x:i.center.x,y:i.center.y}).some(e=>e.key===`${t}-cat`)}},events:{[`${e}start`](n){n.preventDefault(),this.started!==e&&(this.started=e,this.chart.component(`${t}-cat`).emit("panstart",n))},[`${e}move`](e){e.preventDefault(),this.chart.component(`${t}-cat`).emit("panmove",e)},[`${e}end`](e){e.preventDefault(),this.chart.component(`${t}-cat`).emit("panend",e),this.started=!1}}}),dx=({key:e,requireFailure:t,recognizeWith:n},{actions:i}={})=>({key:`event:tap-${e}`,type:"Tap",requireFailure:t,recognizeWith:n,options:{event:"legendtap",interval:10,pointers:1,enable(t,n){if(!n)return!0;if(i?.interact?.enabled&&!i.interact.enabled())return!1;if(!this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).some(t=>t.key===`${e}-cat`))return!1;const{target:r}=n.srcEvent;return!!(r&&r.hasAttribute("data-action")&&r.hasAttribute("data-component-key"))||!(!r||!r.childNodes[0]||"BUTTON"!==r.childNodes[0].nodeName)}},events:{legendtap(e){e.preventDefault();const{target:t}=e.srcEvent;t&&t.hasAttribute("data-action")&&t.hasAttribute("data-component-key")&&this.chart.component(t.getAttribute("data-component-key")).emit(t.getAttribute("data-action"))}}});function fx(e){const t=Qy({resources:e});let n={},i={};const r=e=>(i.settings||(e||console.warn("settings() called before auxiliarySettings()"),i.settings=t.settings()),i.settings),o={config(r){if(n={...r},i={},!n.key)throw new Error("Missing key");t.set({...e,...n})},auto:e=>e?(t.auto(e),o):t.auto(),getAuxiliarySettings:e=>i.auxiliarySettings?Promise.resolve(i.auxiliarySettings):t.getAuxiliarySettings(r(!0),e).then(e=>(i.auxiliarySettings=e||{},i.settings={...i.settings,...i.auxiliarySettings},i.scales=void 0,i.color=void 0,i.auxiliarySettings)),getAuxiliaryData:()=>t.getAuxiliaryData(r()),getSnapshotData(e){const n=r();return t.getAuxiliaryData(n,e).then(e=>t.getSnapshotData(n,e))},resolveUIColor:e=>t.resolveUIColor(e),settings(){const e=r();return{mode:e.mode,type:e.type,label:e.label,field:e.field,fieldType:e.fieldType,nil:e.nil,others:e.others,primary:e.primary}},settingsForMeasure(e){const t=r(),n=t.measureOverrides?.[e];return n||this.settings()},isSelectionLocked:({isMeasureSelectionLocked:e})=>function(e,{isMeasureSelectionLocked:t}){return"field"!==e.mode||("dimension"===e.fieldType?e.isFieldLocked:"measure"!==e.fieldType||t)}(r(),{isMeasureSelectionLocked:e}),palettes:()=>function({colorProps:e,coloring:t,theme:n}={}){const i=[];if(t&&t.palettes&&n){const r=t.palettes.categorical||e.dimensionScheme,o=n.getDataColorPalettes().filter(e=>e.key===r)[0]||n.getDataColorPalettes()[0];r&&o&&i.push({key:"categorical",colors:o.colors});const s=t.palettes.metric||e.measureScheme,a=n.getDataColorScales().filter(e=>e.key===s)[0]||n.getDataColorScales()[0];if(a){let e=a.colors[0]?a.colors:[[],...a.colors.slice(1)];e=Array.isArray(e[0])?e.map(e=>e.slice().reverse()):e.slice().reverse(),i.push({key:"quant",colors:e})}}return i}({coloring:r(),colorProps:n.colorProps,theme:n.theme}),scales:()=>(i.scales=i.scales||function({hc:e,coloring:t,rtl:n,key:i,source:r,picasso:o}={}){const s={},a=i;if(t){const i={override:!0,domain:t.explicit&&"function"==typeof t.explicit.domain?t.explicit.domain:[...(t.explicit||{}).domain||[],-3,-2],range:t.explicit&&"function"==typeof t.explicit.range?t.explicit.range:[...(t.explicit||{}).range||[],t.others,t.nil]};if("field"===t.mode){if("dimension"===t.fieldType){const{data:n}=function({hc:e,source:t,coloring:n}){const i={data:{extract:[{source:"dummy",field:0,filter:()=>(i.expando=e.qDataPages[0]?e.qDataPages[0].qArea.qTop:0,!1)},{source:t,field:n.field,trackBy:n.valueAccessor,reduce:"first",props:{row:{reduce:()=>i.expando++},text:{value:e=>e.qText,reduce:"first"}}}]},expando:0};return i}({hc:e,source:r,coloring:t});let l;if(t.legendDataset){let n=0;const i={};o.data("q")({data:e}).extract({field:t.field,trackBy:t.valueAccessor,reduce:e=>{const t=e[0];return i[t]=n++,e[0]}}),l={source:"attrDim",extract:{field:"qDimensionInfo/0",filter:e=>e.qElemNumber>=0,props:{row:{value:e=>i[e.qElemNumber]}}}}}const c={data:n,range:t.range,domain:t.domain,explicit:i,type:"categorical-color",label:e=>e.datum.text&&e.datum.text.value?e.datum.text.value:e.datum.label};s[a]=c,l&&(s[`${a}Legend`]={...c,data:l}),e&&e.qHasOtherValues&&l&&((l||c.data).amend=[{label:e.qDimensionInfo[0].othersLabel,source:{key:"qHyperCube",field:"qDimensionInfo/0"},row:{value:-3},value:-3}])}else if("measure"===t.fieldType){const e={data:{field:t.field},min:t.min,max:t.max};s[a]=jm({},e,{type:"categorical"===t.type?"threshold-color":"sequential-color",range:t.range,domain:t.domain,invert:t.reverse}),"sequential-color"===s[a].type&&(s[`${a}Range`]=jm({},e,{invert:!!n}))}else if("color"!==t.type)throw new Error("UNUSED FIELD")}else if("dimension"===t.mode){const t={data:e.qDimensionInfo.map((e,t)=>t),label:t=>e.qDimensionInfo[t.datum.value].qFallbackTitle,explicit:i,type:"categorical-color"};s[a]=t}else if("measure"===t.mode){const n={data:e.qMeasureInfo.map((e,t)=>t).filter(e=>!t.explicit?.exclude?.includes(e)),label:t=>e.qMeasureInfo[t.datum.value].qFallbackTitle,explicit:i,type:"categorical-color"};s[a]=n}}return s}({hc:n.hc,coloring:r(),key:n.key,source:n.source,picasso:e.picasso}),i.scales),color(){return i.color=i.color||function({coloring:e,scales:t,key:n}){const i=ex(n),r=ex(`${n}IsAnOther`),o=({fieldType:e,invalid:n,mode:o,nil:s,others:a,primary:l,type:c},u)=>n?e=>nx(e)||r(e)?a:s:t[u]?t=>nx(t)?a:tx(t)||-2===i(t)&&"dimension"===e||"NaN"===i(t)?s:r(t)?a:t.resources.scale(u)(i(t))||a:"constant"===o?e=>nx(e)||r(e)?a:tx(e)?s:l:"color"===c?e=>nx(e)||r(e)?a:tx(e)?s:i(e)||a:null,s=o(e,n);if(e.measureOverrides){const t=ex(`${n}MeasureIdx`),i=e.measureOverrides.map(e=>e&&o(e));return e=>{const n=t(e);return i[n]?i[n](e):s(e)}}return s}({coloring:r(),scales:this.scales(),key:n.key}),i.color},datumProps(e){return function({hc:e,coloring:t,scales:n,key:i,addMeasureIx:r},o=0){let s,a;const l=i,{nil:c}=t;"field"===t.mode&&t.field?s=t.field:n[i]&&"field"===t.mode&&(s=n[i].data.field||t.field),s?(a={field:s,reduce:"first"},"color"===t.type&&(a.value=e=>{return"NaN"!==e.qNum?`rgba(${[(16711680&(t=e.qNum))>>16,(65280&t)>>8,255&t,((4278190080&t)>>>24)/255].join(",")})`:e.qText&&ay(e.qText)?e.qText:c;var t})):"dimension"===t.mode?a=void 0!==t.field?t.field:e.qDimensionInfo.length-1:"measure"===t.mode&&(a=o);const u={[l]:a};return e.qDimensionInfo.length>1&&(u[`${l}IsAnOther`]={fields:e.qDimensionInfo.map((e,t)=>({field:`qDimensionInfo/${t}`})),value:e=>-1!==e.indexOf(-3)}),r&&(u[`${l}MeasureIdx`]=o),u}({coloring:this.settingsForMeasure(e),scales:this.scales(),key:n.key,hc:n.hc,addMeasureIx:r().measureOverrides},e)},data(){const e=r(),t={key:"dummy",data:[["field"],["a"]]};return e.legendDataset?[t,{type:"q",key:"attrDim",data:e.legendDataset.raw(),config:{localeInfo:n.localeInfo}}]:[t]},legend({eventName:e,key:t,viewState:i,chart:o,rtl:s,styleReference:a="object.legend",styleOverrides:l,settings:c={},style:u={}}={},h={}){return function(e,t,n){const i=[],r=[],o=function(e,t,n){return"categorical"===t.coloring.type?function(e,t,n){const i=ux(e,t);if(!i.show)return!1;const{key:r,styleReference:o,styleOverrides:s,viewState:a,rtl:l,settings:c,style:u}=e,{scaleKey:h,theme:d,scales:f}=t,p=ax({theme:d,key:o,styleOverrides:s}),{dock:g}=i.layout,m="left"===g||"right"===g?{maxLines:2,wordBreak:"break-word"}:{},y={up:"M13.6,11 L2.4,11 C2.28954305,11 2.2,10.9104569 2.2,10.8 C2.2,10.756726 2.21403557,10.7146192 2.24,10.68 L7.84,3.21333333 C7.90627417,3.12496777 8.03163444,3.10705916 8.12,3.17333333 C8.13516113,3.18470418 8.14862915,3.1981722 8.16,3.21333333 L13.76,10.68 C13.8262742,10.7683656 13.8083656,10.8937258 13.72,10.96 C13.6853808,10.9859644 13.643274,11 13.6,11 Z",down:"M2.4,4 L13.6,4 C13.7104569,4 13.8,4.08954305 13.8,4.2 C13.8,4.24327404 13.7859644,4.28538077 13.76,4.32 L8.16,11.7866667 C8.09372583,11.8750322 7.96836556,11.8929408 7.88,11.8266667 C7.86483887,11.8152958 7.85137085,11.8018278 7.84,11.7866667 L2.24,4.32 C2.17372583,4.23163444 2.19163444,4.10627417 2.28,4.04 C2.31461923,4.01403557 2.35672596,4 2.4,4 Z",left:"M11,2.4 L11,13.6 C11,13.7104569 10.9104569,13.8 10.8,13.8 C10.756726,13.8 10.7146192,13.7859644 10.68,13.76 L3.21333333,8.16 C3.12496777,8.09372583 3.10705916,7.96836556 3.17333333,7.88 C3.18470418,7.86483887 3.1981722,7.85137085 3.21333333,7.84 L10.68,2.24 C10.7683656,2.17372583 10.8937258,2.19163444 10.96,2.28 C10.9859644,2.31461923 11,2.35672596 11,2.4 Z",right:"M4,13.6 L4,2.4 C4,2.28954305 4.08954305,2.2 4.2,2.2 C4.24327404,2.2 4.28538077,2.21403557 4.32,2.24 L11.7866667,7.84 C11.8750322,7.90627417 11.8929408,8.03163444 11.8266667,8.12 C11.8152958,8.13516113 11.8018278,8.14862915 11.7866667,8.16 L4.32,13.76 C4.23163444,13.8262742 4.10627417,13.8083656 4.04,13.72 C4.01403557,13.6853808 4,13.643274 4,13.6 Z"};let x;"dimension"===t.coloring.fieldType&&(x=e=>e.datum.value>=0||-3===e.datum.value);const v=`${h}Legend`;return jm(!0,i,{type:"legend-cat",key:`${r}-cat`,scale:v in f?v:h,settings:{layout:{scrollOffset:()=>a?a.get("legendScrollOffset"):void 0,size:-1!==["top","bottom"].indexOf(i.layout.dock)?2:1,direction:l?"rtl":"ltr",horizontal:20},item:{show:x,label:{fill:p.label.color,fontSize:p.label.fontSize,fontFamily:p.label.fontFamily,...m}},navigation:{disabled:n,button:{content:(e,{direction:t})=>e("i",{style:{"pointer-events":"none",fontSize:"12px",display:"inline-block",fontStyle:"normal",lineHeight:"0",textAlign:"center",textTransform:"none",verticalAlign:"-0.125em",textRendering:"optimizelegibility",margin:"0px"}},[e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor"},[e("path",{d:y[t]})])])}}},brush:{consume:[{context:"selection",data:["",r],style:{inactive:{opacity:.3}}}]}},{settings:c,style:u})}(e,t,n):"continuous"===t.coloring.type&&function(e,t){const{key:n,styleReference:i,styleOverrides:r,rtl:o,settings:s,style:a}=e,{scaleKey:l,theme:c}=t,u=`${l}Range`,h=ux(e,t);if(!h.show)return!1;const d=ax({theme:c,key:i,styleOverrides:r}),{dock:f}=h.layout,p="right"===f||"left"===f,g=t.scales?.[u];return p&&g&&(g.invert=!0),jm(!0,h,{type:"legend-seq",key:`${n}-seq`,settings:{fill:l,major:u,length:1,tick:{fill:d.label.color,fontSize:d.label.fontSize,fontFamily:d.label.fontFamily},title:{anchor:!o||"top"!==h.layout.dock&&"bottom"!==h.layout.dock?void 0:"right",padding:parseFloat(h.settings.title.fontSize)||16}}},{settings:s,style:a})}(e,t)}(e,t,n&&n.navigationDisabled);return i.push(o),o&&"legend-cat"===o.type&&(r.push(dx(e,n)),r.push(hx(e,n))),{interactions:r,components:i}}({eventName:e,key:t,rtl:s,viewState:i,chart:o,styleReference:a,styleOverrides:l,settings:c,style:u},{legendProps:n.legendProps,scaleKey:n.key,coloring:r(),theme:n.theme,hc:n.hc,scales:this.scales()},h)}};return o}const px=e=>e.baseColor||e.coloring&&e.coloring.baseColor;function gx(e){const{qDimensionInfo:t,qMeasureInfo:n}=e.qHyperCube,i=t.some(px),r=n.some(px),o=e.color.useBaseColors;return"measure"===o&&!r||"dimension"===o&&!i?"off":o}const mx=e=>e.baseColor||e.coloring&&e.coloring.baseColor;function yx(e){const t=e.qHyperCube.qDimensionInfo.some(mx),n=e.qHyperCube.qMeasureInfo.some(mx);return{mode:"primary",useBaseColors:(t?"dimension":void 0)??(n?"measure":void 0)??"off",paletteColor:null}}const xx=()=>{};var vx="center",bx="bottom";function wx(e,t,n){if(void 0===e||void 0===t)return n;const i=t.split(".");let r=e;for(let e=0;e<i.length;++e){const t=i[e];if(void 0===r[t])return n;r=r[t]}return r}[{key:"NoDataExist",alignment:vx,condition:({layoutService:e})=>{if(!e)return!1;const{x:t,y:n}=e.meta.size;return t*n===0}},{key:"OnlyNanDataMeasure",translationKey:"OnlyNanData",alignment:vx,condition:({layoutService:e})=>!!e&&e.getHyperCubeValue("qMeasureInfo").every(e=>"NaN"===e.qMin&&"NaN"===e.qMax)},{key:"OnlyNanDataDimensionContinuous",translationKey:"OnlyNanData",alignment:vx,condition:({layoutService:e})=>{if(!e)return!1;const{isContinuous:t}=e.meta;if(!t)return!1;const n=e.getHyperCubeValue("qDimensionInfo.0");return n&&(n.qMax<n.qMin||"NaN"===n.qMax)}},{key:"OnlyNegativeOrZeroValues",alignment:vx},{key:"DataRangeIncludingZero",alignment:bx},{key:"LimitedData",alignment:bx},{key:"NegativeOrZeroValues",alignment:bx}].reduce((e,t)=>(e[t.key]=t,e),{});const kx=["__proto__","constructor"];function _x(e,t,n){if(void 0===e||void 0===t)return;const i=t.split("."),r=i[i.length-1];if(kx.some(e=>i.includes(e)))return;let o=e;for(let e=0;e<i.length-1;++e){const t=i[e];void 0===o[t]&&(o[t]=Number.isNaN(+i[e+1])?{}:[]),o=o[t]}void 0!==n?o[r]=n:delete o[r]}function Mx({originalArray:e,newArray:t,matchKey:n}){return Array.isArray(e)&&e.length?(t.forEach(t=>{let i=-1;e.some((e,r)=>(e[n]&&e[n]===t[n]&&(i=r),i)),i>-1?e[i]=t:e.push(t)}),e):t}function Sx(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function Rx(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t);if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Cx(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function Nx(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Cx(Object(n),!0).forEach(function(t){Rx(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Cx(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Dx=Object.prototype.hasOwnProperty,qx=Object.prototype.toString,Ex=Object.defineProperty,zx=Object.getOwnPropertyDescriptor,Ax=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===qx.call(e)},Ox=function(e){if(!e||"[object Object]"!==qx.call(e))return!1;var t,n=Dx.call(e,"constructor"),i=e.constructor&&e.constructor.prototype&&Dx.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!i)return!1;for(t in e);return void 0===t||Dx.call(e,t)},Tx=function(e,t){Ex&&"__proto__"===t.name?Ex(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},Ix=function(e,t){if("__proto__"===t){if(!Dx.call(e,t))return;if(zx)return zx(e,t).value}return e[t]},jx=function e(){var t,n,i,r,o,s,a=arguments[0],l=1,c=arguments.length,u=!1;for("boolean"==typeof a&&(u=a,a=arguments[1]||{},l=2),(null==a||"object"!=typeof a&&"function"!=typeof a)&&(a={});l<c;++l)if(null!=(t=arguments[l]))for(n in t)i=Ix(a,n),a!==(r=Ix(t,n))&&(u&&r&&(Ox(r)||(o=Ax(r)))?(o?(o=!1,s=i&&Ax(i)?i:[]):s=i&&Ox(i)?i:{},Tx(a,{name:n,newValue:e(u,s,r)})):void 0!==r&&Tx(a,{name:n,newValue:r}));return a};function Px(e,t,n,i){if(!e)return-1;const r=n.cache,o=e.origin?e.origin():null;o&&(e=o);let s=r.fields.indexOf(e),a=-1,l=-1;if(-1===s)for(let t=0;t<r.wrappedFields.length;t++)if(l=r.wrappedFields[t].attrDims.map(e=>e.instance).indexOf(e),a=r.wrappedFields[t].attrExps.map(e=>e.instance).indexOf(e),-1!==l||-1!==a){s=t;break}if(Array.isArray(i)&&i.some((e,t)=>e!==t)){const e=i.indexOf(s);-1!==e&&(s=e)}return s-=t.qArea.qLeft,s<0||s>=t.qArea.qWidth?-1:l>=0?e=>e[s].qAttrDims.qValues[l]:a>=0?e=>e[s].qAttrExps.qValues[a]:e=>e[s]}function Fx(e,t,n){let i=n.key;const r={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return r.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(r.value),e.field&&(r.source={key:i,field:e.field.key()}),r}function Lx(e){let t=e.cache,n=e.f,i=e.mainCell,r=e.p,o=e.page,s=e.rowIdx,a=e.row,l=e.sourceKey,c=e.target,u=e.targetProp,h=e.columnOrder,d=i;if(r.field&&r.field!==n){const e=Px(r.field,o,{cache:t},h);if(-1===e)return;d=jx({qRow:s},e(a))}c[u]=Fx(r,d,{key:l})}function $x(e,t,n,i){const r=Array.isArray(e)?e:[e];let o=[];for(let e=0;e<r.length;e++)if(void 0!==r[e].field){const s=t.raw(),a=t.key(),l="object"==typeof r[e].field?r[e].field:t.field(r[e].field),c=i.normalizeConfig(r[e],t),u=c.props,h=c.main,d=Object.keys(u),f=!!r[e].trackBy,p=typeof r[e].trackBy,g={},m=[],y=[];for(let t=0;t<s.qDataPages.length;t++){const o=Px(l,s.qDataPages[t],{cache:n},s.qColumnOrder);if(-1!==o)for(let c=0;c<s.qDataPages[t].qMatrix.length;c++){const x=s.qDataPages[t].qArea.qTop+c,v=jx({qRow:x},o(s.qDataPages[t].qMatrix[c])),b=Fx(h,v,{key:a});if(!h.filter||h.filter(v)){for(let e=0;e<d.length;e++){const i=u[d[e]];let r=i.fields||[i];i.fields&&(b[d[e]]=[]);for(let o=0;o<r.length;o++)Lx({cache:n,f:l,mainCell:v,p:r[o],prop:d[e],page:s.qDataPages[t],rowIdx:x,row:s.qDataPages[t].qMatrix[c],sourceKey:a,target:i.fields?b[d[e]]:b,targetProp:i.fields?o:d[e],columnOrder:s.qColumnOrder});if(i.fields){const t=b[d[e]].map(e=>e.value),n=b[d[e]].map(e=>e.label);b[d[e]]={value:"function"==typeof i.value?i.value(t):void 0!==i.value?i.value:t,label:"function"==typeof i.label?i.label(n):void 0!==i.label?String(i.label):String(b[d[e]].value)}}}f&&i.track({cfg:r[e],itemData:v,obj:b,target:m,tracker:g,trackType:p}),y.push(b)}}}const x=f?i.collect(m,{main:h,propsArr:d,props:u}):y;o=[...o,...x]}return o}function Bx(e){var t=0,n=e.children,i=n&&n.length;if(i)for(;--i>=0;)t+=n[i].value;else t=1;e.value=t}function Hx(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=Vx)):void 0===t&&(t=Wx);for(var n,i,r,o,s,a=new Kx(e),l=[a];n=l.pop();)if((r=t(n.data))&&(s=(r=Array.from(r)).length))for(n.children=r,o=s-1;o>=0;--o)l.push(i=r[o]=new Kx(r[o])),i.parent=n,i.depth=n.depth+1;return a.eachBefore(Yx)}function Wx(e){return e.children}function Vx(e){return Array.isArray(e)?e[1]:null}function Ux(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function Yx(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function Kx(e){this.data=e,this.depth=this.height=0,this.parent=null}function Xx(e){return null==e?null:function(e){if("function"!=typeof e)throw new Error;return e}(e)}Kx.prototype=Hx.prototype={constructor:Kx,count:function(){return this.eachAfter(Bx)},each:function(e,t){let n=-1;for(const i of this)e.call(t,i,++n,this);return this},eachAfter:function(e,t){for(var n,i,r,o=this,s=[o],a=[],l=-1;o=s.pop();)if(a.push(o),n=o.children)for(i=0,r=n.length;i<r;++i)s.push(n[i]);for(;o=a.pop();)e.call(t,o,++l,this);return this},eachBefore:function(e,t){for(var n,i,r=this,o=[r],s=-1;r=o.pop();)if(e.call(t,r,++s,this),n=r.children)for(i=n.length-1;i>=0;--i)o.push(n[i]);return this},find:function(e,t){let n=-1;for(const i of this)if(e.call(t,i,++n,this))return i},sum:function(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,i=t.children,r=i&&i.length;--r>=0;)n+=i[r].value;t.value=n})},sort:function(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})},path:function(e){for(var t=this,n=function(e,t){if(e===t)return e;var n=e.ancestors(),i=t.ancestors(),r=null;for(e=n.pop(),t=i.pop();e===t;)r=e,e=n.pop(),t=i.pop();return r}(t,e),i=[t];t!==n;)t=t.parent,i.push(t);for(var r=i.length;e!==n;)i.splice(r,0,e),e=e.parent;return i},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){return Array.from(this)},leaves:function(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e},links:function(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t},copy:function(){return Hx(this).eachBefore(Ux)},[Symbol.iterator]:function*(){var e,t,n,i,r=this,o=[r];do{for(e=o.reverse(),o=[];r=e.pop();)if(yield r,t=r.children)for(n=0,i=t.length;n<i;++n)o.push(t[n])}while(o.length)}};var Gx={depth:-1},Jx={},Zx={};function Qx(e){return e.id}function ev(e){return e.parentId}function tv(e){let t=e.length;if(t<2)return"";for(;--t>1&&!nv(e,t););return e.slice(0,t)}function nv(e,t){if("/"===e[t]){let n=0;for(;t>0&&"\\"===e[--t];)++n;if(!(1&n))return!0}return!1}function iv(e,t){"/"===e.charAt(0)&&(e=e.substring(1));const n=e.split("/");let i,r=t;for(let e=0;e<n.length;e++){if("*"===n[e]&&Array.isArray(r)){const t=[];i=n.slice(e+1).join("/");for(let e=0;e<r.length;e++){let n=iv(i,r[e]);Array.isArray(n)?t.push(...n):t.push(n)}return t}if(!n[e]&&Array.isArray(r)){const t=new Array(r.length);i=n.slice(e+1).join("/");for(let e=0;e<r.length;e++)t[e]=iv(i,r[e]);return t}n[e]in r&&(r=r[n[e]])}return r}function rv(e,t,n){let i=[];if(!e||!e.length)return i;if(t<=0){const t=n>=0?[e[n]]:e;i=[...i,...t]}else for(let r=0;r<e.length;r++)e[r].children&&e[r].children.length&&(i=[...i,...rv(e[r].children,t-1,n)]);return i}function ov(e,t,n){if(e===t)return e=>e;if(e>t){const n=Math.max(0,Math.min(100,e-t));return e=>{let t=e;for(let e=0;e<n;++e)t=t.parent;return t}}if(t>e){const i=Math.max(0,Math.min(100,t-e));return e=>rv(e.children,i-1,n)}return!1}const sv=/^qDimensionInfo(?:\/(\d+))?/,av=/^\/?qMeasureInfo\/(\d+)/,lv=/\/qAttrExprInfo\/(\d+)/,cv=/\/qAttrDimInfo\/(\d+)/;function uv(e){return(e.qColumnOrder&&e.qColumnOrder.length?e.qColumnOrder:e.qDimensionInfo.map((e,t)=>t)).filter(t=>t<e.qDimensionInfo.length)}function hv(e,t){let n=t.cube;if(!e)return-1;let i=e.origin&&e.origin()?e.origin().key():e.key(),r=!1,o=-1,s=-1,a=-1,l=-1,c=-1,u=-1,h=i;const d=n.qEffectiveInterColumnSortOrder,f=uv(n);return sv.test(h)&&(r=!0,o=+sv.exec(h)[1],h=i.replace(sv,"")),av.test(h)&&("K"===n.qMode?c=+av.exec(h)[1]:d&&-1!==d.indexOf(-1)?(c=+av.exec(h)[1],u=0):u=+av.exec(h)[1],h=h.replace(av,"")),h&&(cv.exec(h)?a=+cv.exec(h)[1]:lv.exec(h)&&(s=+lv.exec(h)[1])),l=r?"S"===n.qMode?f[o]:d?d.indexOf(o):o:d&&-1!==d.indexOf(-1)?d.indexOf(-1):n.qDimensionInfo.length-("K"===n.qMode?0:1),{fieldDepth:l+1,pseudoMeasureIndex:c,measureIdx:u,attrDimIdx:a,attrIdx:s}}function dv(e,t){let n,i,r=ov(e.fieldDepth,t.fieldDepth,t.pseudoMeasureIndex);return n=t.measureIdx>=0?e=>e.data.qValues[t.measureIdx]:e=>e.data,t.attrDimIdx>=0?i=e=>{var n;return null==e||null===(n=e.qAttrDims)||void 0===n?void 0:n.qValues[t.attrDimIdx]}:t.attrIdx>=0&&(i=e=>{var n;return null==e||null===(n=e.qAttrExps)||void 0===n?void 0:n.qValues[t.attrIdx]}),{nodeFn:r,attrFn:i,valueFn:n}}function fv(e,t,n){let i=n.key;const r={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return r.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(r.value),e.field&&(r.source={key:i,field:e.field.key()}),r}function pv(e){let t=e.propsArr,n=e.props,i=e.item,r=e.itemData,o=e.ret,s=e.sourceKey;for(let e=0;e<t.length;e++){const a=n[t[e]],l=a.fields||[a];let c,u;a.fields&&(c=[],u=[]);for(let n=0;n<l.length;n++){const h=l[n];let d,f,p,g,m,y;if("primitive"===h.type?(p=h.value,y=String(h.value)):("function"==typeof h.value&&(d=e=>h.value(e,i)),"function"==typeof h.label&&(f=e=>h.label(e,i)),h.accessor?(g=h.accessor(i),Array.isArray(g)?(m=g.map(h.valueAccessor),h.attrAccessor&&(m=m.map(h.attrAccessor)),d&&(p=m.map(d),d=null),f&&(y=m.map(f),f=null),p=h.reduce?h.reduce(p):p,y=h.reduceLabel?h.reduceLabel(y,p):String(p)):(p=h.attrAccessor?h.attrAccessor(h.valueAccessor(g)):h.valueAccessor(g),y=p)):(p=r,y=r)),a.fields){const e=d?d(p):p;c.push(e),u.push(f&&null!=y?f(y):null!=y?y:String(e))}else{const n=d?d(p):p;o[t[e]]={value:n,label:f?f(y):null!=y?y:String(n)},h.field&&(o[t[e]].source={field:h.field.key(),key:s})}}c&&(o[t[e]]={value:"function"==typeof a.value?a.value(c,i):c,label:"function"==typeof a.label?a.label(u,i):u})}}const gv=(e,t,n)=>{const i="K"===e.qMode?"/qStackedDataPages/*/qData":"/qTreeDataPages/*",r="K"===e.qMode?"qSubNodes":"qNodes",o=iv(i,e);return o&&o[0]?(t.tree=Hx(o[0],n.children||(e=>e[r])),t.tree):null},mv=e=>{let t=e.propsArr,n=e.props,i=e.cube;e.cache;let r=e.itemDepthObject,o=e.f;for(let e=0;e<t.length;e++){const s=n[t[e]],a=s.fields?s.fields:[s];for(let e=0;e<a.length;e++){const t=a[e];if(t.field!==o){const e=dv(r,hv(t.field,{cube:i}));t.accessor=e.nodeFn,t.valueAccessor=e.valueFn,t.attrAccessor=e.attrFn}}}};function yv(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;const r=t.raw(),o=t.key(),s="S"===r.qMode?function(e){const t=e.raw().qDataPages.length?e.raw().qDataPages[0].qMatrix:[],n=function(e){const t=e.raw().qColumnOrder,n=e.fields();return t&&t.length===n.length?t:n.map((e,t)=>t)}(e),i=e.fields(),r=e.fields().filter(e=>"dimension"===e.type()).map(e=>n.indexOf(i.indexOf(e))),o=e.fields().filter(e=>"measure"===e.type()).map(e=>n.indexOf(i.indexOf(e))),s={__root:{__id:"__root",qValues:[]}};for(let e=0;e<t.length;e++){const n=t[e];let i="__root",l=!1;for(let e=0;e<r.length;e++){var a;const t=n[r[e]],o="".concat(i,"__").concat(null!==(a=t.qElemNumber)&&void 0!==a?a:t.qElemNo);s[o]||(s[o]=Nx({__id:o,__parent:i,qValues:[]},t),l=!0),i=o}if(l)for(let e=0;e<o.length;e++){const t=n[o[e]];s[i].qValues.push(t)}}const l=Object.keys(s).map(e=>s[e]);return function(){var e,t=Qx,n=ev;function i(i){var r,o,s,a,l,c,u,h,d=Array.from(i),f=t,p=n,g=new Map;if(null!=e){const t=d.map((t,n)=>function(e){let t=(e=`${e}`).length;return nv(e,t-1)&&!nv(e,t-2)&&(e=e.slice(0,-1)),"/"===e[0]?e:`/${e}`}(e(t,n,i))),n=t.map(tv),r=new Set(t).add("");for(const e of n)r.has(e)||(r.add(e),t.push(e),n.push(tv(e)),d.push(Zx));f=(e,n)=>t[n],p=(e,t)=>n[t]}for(s=0,r=d.length;s<r;++s)o=d[s],c=d[s]=new Kx(o),null!=(u=f(o,s,i))&&(u+="")&&(h=c.id=u,g.set(h,g.has(h)?Jx:c)),null!=(u=p(o,s,i))&&(u+="")&&(c.parent=u);for(s=0;s<r;++s)if(u=(c=d[s]).parent){if(!(l=g.get(u)))throw new Error("missing: "+u);if(l===Jx)throw new Error("ambiguous: "+u);l.children?l.children.push(c):l.children=[c],c.parent=l}else{if(a)throw new Error("multiple roots");a=c}if(!a)throw new Error("no root");if(null!=e){for(;a.data===Zx&&1===a.children.length;)a=a.children[0],--r;for(let e=d.length-1;e>=0&&(c=d[e]).data===Zx;--e)c.data=null}if(a.parent=Gx,a.eachBefore(function(e){e.depth=e.parent.depth+1,--r}).eachBefore(Yx),a.parent=null,r>0)throw new Error("cycle");return a}return i.id=function(e){return arguments.length?(t=Xx(e),i):t},i.parentId=function(e){return arguments.length?(n=Xx(e),i):n},i.path=function(t){return arguments.length?(e=Xx(t),i):e},i}().id(e=>e.__id).parentId(e=>e.__parent)(l)}(t):gv(r,n,e);if(!s)return null;const a=s.height,l=[];for(let o=0;o<=a;o++){let s=null;if(o>0)if("S"===r.qMode){let e=uv(r)[o-1];s=n.fields[e]}else{let e=r.qEffectiveInterColumnSortOrder[o-1];o>r.qEffectiveInterColumnSortOrder.length&&(e=r.qDimensionInfo.length),s=n.fields[e]}const a=i.normalizeConfig(Nx(Nx({},e),{},{field:s?s.key():void 0}),t),c=a.props,u=a.main,h=Object.keys(c);l[o]={propsArr:h,props:c,main:u};const d=s?hv(s,{cube:r}):{fieldDepth:0};mv({propsArr:h,props:c,cube:r,cache:n,itemDepthObject:d,f:s})}const c=s.copy().descendants(),u=s.descendants();for(let e=0;e<u.length;e++){const t=l[u[e].depth].propsArr,n=l[u[e].depth].props,i=l[u[e].depth].main,r=c[e],s=r.data,a=fv(i,s,{key:o});pv({propsArr:t,props:n,item:r,itemData:s,ret:a,sourceKey:o}),u[e].data=a}return s}function xv(e,t,n,i){const r=Array.isArray(e)?e:[e];let o=[];for(let s=0;s<r.length;s++)if(void 0!==r[s].field){const a=t.raw(),l=t.key();if(!gv(a,n,e))continue;const c="object"==typeof r[s].field?r[s].field:t.field(r[s].field),u=i.normalizeConfig(r[s],t),h=u.props,d=u.main,f=Object.keys(h),p=hv(c,{cube:a}),g=dv({fieldDepth:0},p),m=g.nodeFn,y=g.attrFn,x=g.valueFn;mv({propsArr:f,props:h,cube:a,cache:n,itemDepthObject:p,f:c});const v=!!r[s].trackBy,b=typeof r[s].trackBy,w={},k=[],_=m(n.tree),M=[];for(let e=0;e<_.length;e++){const t=_[e],n=y?y(x(t)):x(t);if(d.filter&&!d.filter(n))continue;const o=fv(d,n,{key:l});pv({propsArr:f,props:h,item:t,itemData:n,ret:o,sourceKey:l}),v&&i.track({cfg:r[s],itemData:n,obj:o,target:k,tracker:w,trackType:b}),M.push(o)}const S=v?i.collect(k,{main:d,propsArr:f,props:h}):M;o=[...o,...S]}return o}var vv,bv,wv=(vv=function(e){
12
10
  /*! javascript-number-formatter - v1.1.11 - http://mottie.github.com/javascript-number-formatter/ * © ecava */
13
- t.exports=function(t,e){if(!t||isNaN(+e))return e;var n,i,r,o,a,s,l,c,u,h,d=t.length,f=t.search(/[0-9\-\+#]/),p=f>0?t.substring(0,f):"",g=t.split("").reverse().join(""),m=g.search(/[0-9\-\+#]/),y=d-m,v=t.substring(y,y+1),x=y+("."===v||","===v?1:0),b=m>0?t.substring(x,d):"";if(n=(e="-"===(t=t.substring(f,x)).charAt(0)?-e:+e)<0?e=-e:0,r=(i=t.match(/[^\d\-\+#]/g))&&i[i.length-1]||".",o=i&&i[1]&&i[0]||",",t=t.split(r),e=+(e=e.toFixed(t[1]&&t[1].length))+"",s=t[1]&&t[1].lastIndexOf("0"),(!(c=e.split("."))[1]||c[1]&&c[1].length<=s)&&(e=(+e).toFixed(s+1)),u=t[0].split(o),t[0]=u.join(""),(a=t[0]&&t[0].indexOf("0"))>-1)for(;c[0].length<t[0].length-a;)c[0]="0"+c[0];else 0===+c[0]&&(c[0]="");if((e=e.split("."))[0]=c[0],l=u[1]&&u[u.length-1].length){for(g="",y=(h=e[0]).length%l,d=h.length,x=0;x<d;x++)g+=h.charAt(x),!((x-y+1)%l)&&x<d-l&&(g+=o);e[0]=g}return e[1]=t[1]&&e[1]?r+e[1]:"","0"!==(i=e.join(""))&&""!==i||(n=!1),p+(n?"-":"")+i+b}},$x(Bx={exports:{}}),Bx.exports);function Wx(t){return t.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}const Vx={3:"k",6:"M",9:"G",12:"T",15:"P",18:"E",21:"Z",24:"Y","-3":"m","-6":"μ","-9":"n","-12":"p","-15":"f","-18":"a","-21":"z","-24":"y"},Ux=/%\)?$/,Yx=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,Kx=/^\(oct\)/i,Gx=/^\(dec\)/i,Xx=/^\(hex\)/i,Jx=/^\(bin\)/i,Zx=/^\(rom\)/i,Qx=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,tb=/#|0/g;function eb(t,e,n,i){return t=t.toString(e),n[1]===n[1].toUpperCase()&&(t=t.toUpperCase()),t.length-t.indexOf(".")>10&&(t=t.slice(0,t.indexOf(".")+11)),t.replace(".",i||".")}function nb(t,e,n){const i=Wx(t);return n?i:new RegExp(i||"",e)}function ib(t,e,n,i){let r,o,a,s,l,c,u,h,d,f=t.pattern;var p,g;i&&(t.abbreviate=!0),p=e,(g=n)&&(g=Wx(g)),p&&(p=Wx(p)),d=new RegExp("(?:[#0]+".concat(p,")?[#0]+(?:").concat(g,"[#0]+)?")),a=f.match(d),a=a?a[0]:"",s=a?f.substr(0,f.indexOf(a)):f,l=a?f.substring(f.indexOf(a)+a.length):"",a||(a=f?"#":"##########"),e&&e===n&&(r=a.split(n),o=r.pop(),a=r.join("")+n+o,e=""),c=e,e=/,/.test(n)?"¤":",",c&&(a=a.replace(nb(c,"g"),e)),u=n,n=".",u&&(a=a.replace(nb(u,"g"),n)),h=a.match(/#/g),h=h?h.length:0;const m=f.split(u);let y;m[1]&&(y=m[1].match(tb)),t.prefix=s||"",t.postfix=l||"",t.pattern=f,t.maxPrecision=y?y.length:2,t.percentage=Ux.test(f),t.numericPattern=a||"",t.numericRegex=new RegExp("".concat(nb(e,null,!0),"|").concat(nb(n,null,!0)),"g"),t.groupTemp=c,t.decTemp=u,t.t=e,t.d=n,t.temp=h}class rb{constructor(t,e,n,i,r){this.localeInfo=t,this.pattern=e,this.thousandDelimiter=n||",",this.decimalDelimiter=i||".",this.type=r||"numeric",this.patternSeparator=";",this.abbreviations=function(t,e){if(!t||!t.qNumericalAbbreviation)return Vx;const n={};return t.qNumericalAbbreviation.split(e).forEach(t=>{let e=t.split(":");2===e.length&&(n[e[0]]=e[1])}),n}(t,this.patternSeparator),this.prepare()}clone(){const t=new rb(this.localeInfo,this.pattern,this.thousandDelimiter,this.decimalDelimiter,this.type);return t.subtype=this.subtype,t}format(t,e,n,i){return this.prepare(e,n,i),this.formatValue(t)}prepare(t,e,n){let i;if(void 0===t&&(t=this.pattern),void 0===e&&(e=this.thousandDelimiter),void 0===n&&(n=this.decimalDelimiter),!t)return void(this._prepared={pattern:!1});this._prepared={positive:{d:n,t:e,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},negative:{d:n,t:e,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},zero:{d:n,t:e,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""}},i=this._prepared,t=t.split(this.patternSeparator),i.positive.pattern=t[0],i.negative.pattern=t[1],i.zero.pattern=t[2],Qx.test(t[0])&&(i.positive.isFunctional=!0),t[1]?Qx.test(t[1])&&(i.negative.isFunctional=!0):i.negative=!1,t[2]?Qx.test(t[2])&&(i.zero.isFunctional=!0):i.zero=!1;const r="U"===this.type;i.positive.isFunctional||ib(i.positive,e,n,r),i.negative&&!i.negative.isFunctional&&ib(i.negative,e,n,r),i.zero&&!i.zero.isFunctional&&ib(i.zero,e,n,r)}formatValue(t){let e,n,i,r,o,a,s,l,c,u=this._prepared,h="",d="",f=t;if(isNaN(t))return"".concat(f);if(t=+t,!1===u.pattern)return t.toString();if(0===t&&u.zero)return u=u.zero,u.pattern;if(t<0&&u.negative?(u=u.negative,t=-t):u=u.positive,o=u.d,a=u.t,u.isFunctional)t=function(t,e,n){let i;return Yx.test(e)?t=eb(t,Number(/\d{2}/.exec(e)[0]),e,n):Kx.test(e)?t=eb(t,8,e,n):Gx.test(e)?t=eb(t,10,e,n):Xx.test(e)?t=eb(t,16,e,n):Jx.test(e)?t=eb(t,2,e,n):Zx.test(e)&&(i="",t<0&&(i="-",t=-t),0===(t=Math.floor(t))?t="0":t<=5e5?(t=function(t,e){let n,i="",r=Number(String(t).slice(-3)),o=(t-r)/1e3,a=[0,1,4,5,9,10,40,50,90,100,400,500,900].reverse(),s=["0","I","IV","V","IX","X","XL","L","XC","C","CD","D","CM"].reverse();for(;r>0;)for(n=0;n<a.length;n++)if(a[n]<=r){i+=s[n],r-=a[n];break}for(n=0;n<o;n++)i="M".concat(i);return e[1]!==e[1].toUpperCase()&&(i=i.toLowerCase()),i}(t,e),t=i+t):t=e+i+t.toExponential(0)),t}(t,u.pattern,o);else{if(u.percentage&&(t*=100),u.abbreviate){const e=Object.keys(this.abbreviations).map(t=>parseInt(t,10)).sort((t,e)=>t-e);let i,r,o=e[0];for(s=0,n=Number(Number(t).toExponential().split("e")[1]);o<=n&&s<e.length;)s++,o=e[s];s>0&&(i=e[s-1]),i&&n>0&&i>0?r=i:(n<0&&i<0||!i)&&(o<0&&o-n<=u.maxPrecision?r=o:i<=n&&!(o>0&&-n<=u.maxPrecision)&&(r=i)),r&&(h=this.abbreviations[r],t/=10**r)}if(i=Math.abs(t),e=u.temp,l=u.numericPattern,c=l.split(o)[1],"I"===this.type&&(t=Math.round(t)),r=t,c||"#"!==l.slice(-1)[0])if(i>=1e15||i>0&&i<=1e-14)t=i?i.toExponential(15).replace(/\.?0+(?=e)/,""):"0";else{const e=Number((t+1e-15*(t<0?-1:1)).toFixed(Math.min(20,c?c.length:0)).split(".")[0]);let n=l.split(o)[0];if(n+=o,t=Hx(n,e)||"0",c){const e=Math.max(0,Math.min(14,c.length)),n=c.replace(/#+$/,"").length;let r=("I"===this.type?0:i%1+1e-15).toFixed(e).slice(2).replace(/0+$/,"");for(s=r.length;s<n;s++)r+="0";r&&(t+=o+r)}else 0===e&&(r=0)}else if(i>=10**e||i<1||i<1e-4)0===t?t="0":i<1e-4||i>=1e20?(t=(t=r.toExponential(Math.max(1,Math.min(14,e))-1)).replace(/\.?0+(?=e)/,""),d=""):(t=t.toPrecision(Math.max(1,Math.min(14,e)))).indexOf(".")>=0&&(t=(t=t.replace(t.indexOf("e")<0?/0+$/:/\.?0+(?=e)/,"")).replace(".",o));else{for(l+=o,e=Math.max(0,Math.min(20,e-Math.ceil(Math.log(i)/Math.log(10)))),s=0;s<e;s++)l+="#";t=Hx(l,t)}t=t.replace(u.numericRegex,t=>t===a?u.groupTemp:t===o?u.decTemp:""),r<0&&!/^-/.test(t)&&(t="-".concat(t))}return u.prefix+t+d+h+u.postfix}static getStaticFormatter(){return{prepare(){},formatValue:t=>"".concat(t)}}}function ob(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=e.size,i=void 0===n?5e3:n,r=e.multipleArguments,o=void 0!==r&&r,a=e.toKey,s=void 0===a?t=>t:a;let l,c,u=Object.create(null),h=Object.create(null),d=0,f=0;return l=o?function(){return c=s(...arguments),l.has(c)?l.get(c):l.set(c,t(...arguments))}:e=>(c=s(e),l.has(c)?l.get(c):l.set(c,t(e))),l.set=(t,e)=>(d>=i&&(delete u[h[f]],delete h[f],d--,f++),u[t]=e,h[d]=t,d++,e),l.get=t=>u[t],l.has=t=>t in u,l.clear=()=>{u=Object.create(null),h=Object.create(null),d=0,f=0},l.size=()=>d,l}function ab(t,e,n,i,r){const o=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return new rb(...e)}(r,t,e,n,i),a=ob(o.formatValue.bind(o),{toKey:t=>isNaN(t)?t:+t});function s(t){return a(t)}return s.format=function(t,e,n,i){return a.clear(),o.format(e,t,n,i)},s.pattern=function(t){return t&&(a.clear(),o.pattern=t,o.prepare()),o.pattern},s}const sb="D",lb="T",cb="TS",ub=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],hb=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],db=["January","February","March","April","May","June","July","August","September","October","November","December"],fb=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function pb(t,e){for(let n=t.length;n<e;n++)t="0".concat(t);return t}function gb(t){let e=t.toString().split(".");return e[1]?(e=Number("0.".concat(e[1])),e):0}class mb{constructor(t,e,n){const i=t||{};i.qCalendarStrings||(i.qCalendarStrings={qLongDayNames:ub,qDayNames:hb,qLongMonthNames:db,qMonthNames:fb}),this.localeInfo=i,this.locale_days=i.qCalendarStrings.qLongDayNames.slice(),this.locale_days_abbr=i.qCalendarStrings.qDayNames.slice(),this.locale_months=i.qCalendarStrings.qLongMonthNames.slice(),this.locale_months_abbr=i.qCalendarStrings.qMonthNames.slice(),e||(e={[lb]:i.qTimeFmt||"hh:mm:ss",[sb]:i.qDateFmt||"YYYY-MM-DD",[cb]:i.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"}[n]),this.pattern=e}clone(){const t=new mb(this.localeInfo,this.pattern);return t.subtype=this.subtype,t}format(t,e){e||(e=this.pattern?this.pattern:"YYYY-MM-DD hh:mm:ss"),e=e.replace(/\[.+]|\[|]/g,"");const n=/t+/gi.test(e);let i;t instanceof Date?i=function(t,e){let n=t.getUTCHours(),i=t.getUTCDay()-1;return e&&(n%=12,n||(n=12)),i<0&&(i=6),{year:t.getUTCFullYear(),month:t.getUTCMonth(),day:i,date:t.getUTCDate(),h:n,m:t.getUTCMinutes(),s:t.getUTCSeconds(),f:t.getUTCMilliseconds(),t:t.getUTCHours()>=12?"pm":"am"}}(t,n):(t<0&&(t=-t,e="-".concat(e)),i=function(t,e){let n,i=function(t){const e=t,n=24*gb(e),i=60*gb(n),r=60*gb(i),o=1e3*gb(r);return{d:Math.floor(e),h:Math.floor(n),m:Math.floor(i),s:Math.floor(r),f:Math.round(o)}}(t),r=i.d,o=i.h,a=i.m,s=i.s,l=i.f,c=0;/w+|t+/gi.test(e)&&(n=new Date(Date.UTC(1899,11,30+Math.floor(t),0,0,Math.round(86400*(t-Math.floor(t))))),isNaN(n.getTime())&&(n=null)),/D+/gi.test(e)||(o+=24*r),/h+/gi.test(e)||(a+=60*o),/m+/gi.test(e)||(s+=60*a),/w+/gi.test(e)&&(c=n?n.getDay()-1:0,c<0&&(c=6));let u="";return n&&(u=n.getUTCHours()>=12?"pm":"am"),{year:0,month:0,day:c,date:r,h:o,m:a,s:s,f:l,t:u}}(t,e));const r=(o=this,a=i,{"Y+|y+":{Y:"".concat(Number("".concat(a.year).slice(-2))),YY:pb("".concat(a.year).slice(-2),2),YYY:pb("".concat(a.year).slice(-3),3),def:t=>pb("".concat(a.year),t.length)},"M+":{M:a.month+1,MM:pb("".concat(a.month+1),2),MMM:o.locale_months_abbr[a.month],def:o.locale_months[a.month]},"W+|w+":{W:a.day,WW:pb("".concat(a.day),2),WWW:o.locale_days_abbr[a.day],def:o.locale_days[a.day]},"D+|d+":{D:a.date,def:t=>pb("".concat(a.date),t.length)},"h+|H+":{h:a.h,def:t=>pb("".concat(a.h),t.length)},"m+":{m:a.m,def:t=>pb("".concat(a.m),t.length)},"s+|S+":{s:a.s,def:t=>pb("".concat(a.s),t.length)},"f+|F+":{def(t){let e="".concat(a.f),n=t.length-e.length;if(n>0)for(let t=0;t<n;t++)e+="0";else n<0&&(e=e.slice(0,t.length));return e}},"t{1,2}|T{1,2}":{def(t){let e=a.t;return t[0].toUpperCase()===t[0]&&(e=e.toUpperCase()),e=e.slice(0,t.length),e}}});var o,a;const s=[];for(const t in r)Object.prototype.hasOwnProperty.call(r,t)&&s.push(t);const l=new RegExp(s.join("|"),"g");return e.replace(l,t=>{let e,n,i;for(n in r)if(Object.prototype.hasOwnProperty.call(r,n)&&(e=new RegExp(n),e.test(t)))break;if(!e)return"";for(const e in r[n])if(e===t||e.toLowerCase()===t){i=r[n][e],void 0===i&&(i=r[n][e.toLowerCase()]);break}return void 0===i&&(i=r[n].def),"function"==typeof i&&(i=i(t)),i})}}function yb(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return new mb(...e)}function vb(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"TS",n=yb(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,t,e),i=ob(n.format.bind(n),{toKey:t=>"object"==typeof t&&"function"==typeof t.getTime?t.getTime():t});function r(t){return"IV"!==e?function(t){return new Date(Date.UTC(1899,11,30+Math.floor(t),0,0,0,Math.round(864e5*(t-Math.floor(t)))))}(t):t}function o(t){return t=r(t),i(t)}return o.format=function(t,e){return i.clear(),e=r(e),n.format(e,t)},o.locale=function(r){return n=yb(r,t,e),i=ob(n.format.bind(n),{toKey:t=>"object"==typeof t?t.getTime():t}),this},o.qtype=function(t){return void 0!==t&&(e=t,i.clear()),e},o}function xb(){let t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.meta,i=e.id,r=e.key,o=e.localeInfo,a=e.fieldExtractor,s=e.value,l=e.type,c=e.sourceField;const u=s||("dimension"===l?t=>null==t?void 0:t.qElemNo:t=>null==t?void 0:t.qValue),h="dimension"===l?"first":"avg",d=function(t,e){if(t&&t.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(t.qNumFormat.qType))return vb(t.qNumFormat.qFmt,t.qNumFormat.qType,e);let n="#",i=e&&void 0!==e.qThousandSep?e.qThousandSep:",",r=e&&void 0!==e.qDecimalSep?e.qDecimalSep:".",o="U",a=t&&!!t.qIsAutoFormat;return t&&t.qNumFormat?(n=t.qNumFormat.qFmt||n,i=t.qNumFormat.qThou||i,r=t.qNumFormat.qDec||r,o=t.qNumFormat.qType||o,a=a&&-1===["M"].indexOf(t.qNumFormat.qType)):a=!0,(a||"U"===o)&&(n="#".concat(r,"##"),o="U"),ab(n,i,r,o,e)}(n,o),f={id:()=>i,key:()=>r,raw:()=>n,title:()=>n.qFallbackTitle||n.label,type:()=>l,origin:()=>c,items:()=>(t||(t=a(f)),t),min:()=>n.qMin,max:()=>n.qMax,value:u,label:t=>(null==t?void 0:t.qText)||"",reduce:h,reduceLabel:"dimension"===l?"first":(t,e)=>d(e),formatter:()=>d,tags:()=>n.qTags};return f}function bb(t,e,n,i,r){return(e[t]||[]).map((e,o)=>{const a="".concat(i?"".concat(i,"/"):"").concat(t,"/").concat(o),s={instance:xb(ox({id:"".concat(n?"".concat(n,"/"):"").concat(a),key:a,meta:e},r))};return s.attrDims=bb("qAttrDimInfo",e,n,a,ox({},r,{value:t=>null==t?void 0:t.qElemNo,type:"dimension"})),s.attrExps=bb("qAttrExprInfo",e,n,a,ox({},r,{value:t=>null==t?void 0:t.qNum,type:"measure"})),s.measures=bb("qMeasureInfo",e,n,a,ox({},r,{value:t=>null==t?void 0:t.qValue,type:"measure"})),s})}function wb(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.key,n=t.data,i=t.config,r=void 0===i?{}:i;const o={fields:[],wrappedFields:[],allFields:[],virtualFields:[]},a=n;if(!a)throw new Error('Missing "data" input');if(!a.qDimensionInfo)throw new Error('The "data" input is not recognized as a hypercube');const s=wb.util,l={cache:o,cube:a,localeInfo:r.localeInfo,fieldExtractor:null,pages:null,hierarchy:()=>null,virtualFields:r.virtualFields},c={key:()=>e,raw:()=>a,field:t=>function(t,e){let n=e.cache;if("number"==typeof t)return n.fields[t];const i=n.allFields;if("function"==typeof t){for(let e=0;e<i.length;e++)if(t(i[e]))return i[e];return!1}if("string"==typeof t){for(let e=0;e<i.length;e++)if(i[e].key()===t||i[e].title()===t)return i[e]}else if(t&&-1!==i.indexOf(t))return t;throw Error("Field not found: ".concat(t))}(t,l),fields:()=>o.fields.slice(),extract:t=>l.extractor(t,c,o,s),hierarchy:t=>l.hierarchy(t,c,o,s),_cache:()=>o};"K"===a.qMode||"T"===a.qMode||!a.qMode&&a.qNodesOnDim?(l.extractor=Lx,l.hierarchy=Fx,l.pages="K"===a.qMode?a.qStackedDataPages:a.qTreeDataPages):"S"===a.qMode?(l.extractor=cx,l.pages=a.qDataPages,l.hierarchy=Fx):l.extractor=()=>[],l.fieldExtractor=t=>l.extractor({field:t},c,o,s);const u="S"===a.qMode?t=>t.qElemNumber:void 0,h="S"===a.qMode?t=>t.qNum:void 0;o.wrappedFields.push(...bb("qDimensionInfo",a,e,"",ox({},l,{value:u,type:"dimension"}))),o.wrappedFields.push(...bb("qMeasureInfo",a,e,"",ox({},l,{value:h,type:"measure"}))),o.fields=o.wrappedFields.map(t=>t.instance);const d=t=>{t.forEach(t=>{o.allFields.push(t.instance),d(t.measures),d(t.attrDims),d(t.attrExps)})};return d(o.wrappedFields),(r.virtualFields||[]).forEach(t=>{const n=c.field(t.from),i=xb(Xv({meta:n.raw(),id:"".concat(e,"/").concat(t.key),sourceField:n,fieldExtractor:t=>l.extractor({field:t},c,o,s),key:t.key,type:n.type(),localeInfo:l.localeInfo,value:n.value},t.override||{}));o.virtualFields.push(i)}),o.allFields.push(...o.virtualFields),c}const kb=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],_b=/\/qDimensionInfo(?:\/(\d+))?/,Mb=/\/qMeasureInfo\/(\d+)/,Sb=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,Rb=/\/qAttrExprInfo\/(\d+)/,Cb=/\/?qHyperCube/,Nb=/\/?qTreeData/,Db=t=>"".concat(t.substr(0,t.indexOf("/qHyperCubeDef")+14)),qb=t=>"".concat(t.substr(0,t.indexOf("/qTreeDataDef")+13));function Eb(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const i=e.byCells,r=e.primarySource,o=[],a={},s=t.isActive();let l=!1;return t.brushes().forEach(t=>{const e=function(t,e){let n=t,i=-1,r=-1,o="",a=t=>t;Cb.test(t)?(o="".concat(n.substr(0,n.indexOf("qHyperCube")+10)),a=Db):Nb.test(t)&&(o="".concat(n.substr(0,n.indexOf("qTreeData")+9)),a=qb);let s=!0;if(_b.test(t)&&(i=+_b.exec(t)[1]),Mb.test(t)&&(r=+Mb.exec(t)[1]),Sb.test(t)){r=-1,i=0;const t=+Sb.exec(n)[2];isNaN(t)||(i=t,n=n.replace(/\/\d+$/,"")),s=!1}if(Rb.test(t)){const t=r;if(e){r=0;const a=Sx(o,e);r+=(a.qMeasureInfo||[]).length,i>-1?(r=a.qDimensionInfo.slice(0,i).reduce((t,e)=>t+e.qAttrExprInfo.length,r),i=-1):(r=a.qDimensionInfo.reduce((t,e)=>t+e.qAttrExprInfo.length,r),r=a.qMeasureInfo.slice(0,t).reduce((t,e)=>t+e.qAttrExprInfo.length,r)),r+=+Rb.exec(n)[1]}else i>-1?(i=-1,r=+Rb.exec(n)[1]):r+=+Rb.exec(n)[1]+1}return kb.forEach(t=>{let e=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var i,r,o,a,s=[],l=!0,c=!1;try{if(o=(n=n.call(t)).next,0===e);else for(;!(l=(i=o.call(n)).done)&&(s.push(i.value),s.length!==e);l=!0);}catch(t){c=!0,r=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Yv(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Yv(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(t,2),i=e[0],r=e[1];n=n.replace(i,r)}),s&&(n=a(n)),n&&"/"!==n[0]&&(n="/".concat(n)),{measureIdx:r,dimensionIdx:i,path:n}}(t.id,n);if("range"===t.type&&e.measureIdx>-1&&e.dimensionIdx>-1){const n=t.brush.ranges();n.length&&(l=!0,a.multiRangeSelectTreeDataValues||(a.multiRangeSelectTreeDataValues={path:e.path,ranges:[]}),n.forEach(t=>a.multiRangeSelectTreeDataValues.ranges.push({qMeasureIx:e.measureIdx,qDimensionIx:e.dimensionIdx,qRange:{qMin:t.min,qMax:t.max,qMinInclEq:!0,qMaxInclEq:!0}})))}else{if("range"===t.type&&e.measureIdx>-1){const n=t.brush.ranges();n.length&&(l=!0,a.rangeSelectHyperCubeValues||(a.rangeSelectHyperCubeValues={path:e.path,ranges:[]}),n.forEach(t=>a.rangeSelectHyperCubeValues.ranges.push({qMeasureIx:e.measureIdx,qRange:{qMin:t.min,qMax:t.max,qMinInclEq:!0,qMaxInclEq:!0}})))}if("range"===t.type&&e.dimensionIdx>-1){const n=t.brush.ranges();n.length&&(l=!0,a.selectHyperCubeContinuousRange||(a.selectHyperCubeContinuousRange={path:e.path,ranges:[]}),n.forEach(t=>a.selectHyperCubeContinuousRange.ranges.push({qDimIx:e.dimensionIdx,qRange:{qMin:t.min,qMax:t.max,qMinInclEq:!0,qMaxInclEq:!1}})))}if("value"===t.type&&e.dimensionIdx>-1)if(i)if(n&&n.qHyperCube&&("P"===n.qHyperCube.qMode||"T"===n.qHyperCube.qMode||"K"===n.qHyperCube.qMode)){const i=n.qHyperCube,o=i.qNoOfLeftDims,s=i.qEffectiveInterColumnSortOrder.indexOf(e.dimensionIdx);if(a.selectPivotCells||(a.selectPivotCells={path:e.path,cells:[]}),t.id===r||!r){const n=t.brush.values().map(t=>+t).filter(t=>!isNaN(t));(0===o||s>=o)&&o>-1?n.forEach(t=>{a.selectPivotCells.cells.push({qType:"T",qCol:t,qRow:s-o})}):n.forEach(t=>{a.selectPivotCells.cells.push({qType:"L",qCol:e.dimensionIdx,qRow:t})}),l=!!a.selectPivotCells.cells.length}}else a.selectHyperCubeCells||(a.selectHyperCubeCells={path:e.path,cols:[]}),a.selectHyperCubeCells.cols.push(e.dimensionIdx),t.id!==r&&(r||a.selectHyperCubeCells.values)||(a.selectHyperCubeCells.values=t.brush.values().map(t=>+t).filter(t=>!isNaN(t)),l=!!a.selectHyperCubeCells.values.length);else{const n=t.brush.values().map(t=>+t).filter(t=>!isNaN(t));l=!!n.length,o.push({params:[e.path,e.dimensionIdx,n,!1],method:"selectHyperCubeValues"})}}}),!l&&s?[{method:"resetMadeSelections",params:[]}]:(a.rangeSelectHyperCubeValues&&o.push({method:"rangeSelectHyperCubeValues",params:[a.rangeSelectHyperCubeValues.path,a.rangeSelectHyperCubeValues.ranges,[],null===(c=e.orMode)||void 0===c||c]}),a.selectHyperCubeContinuousRange&&o.push({method:"selectHyperCubeContinuousRange",params:[a.selectHyperCubeContinuousRange.path,a.selectHyperCubeContinuousRange.ranges]}),a.selectHyperCubeCells&&o.push({method:"selectHyperCubeCells",params:[a.selectHyperCubeCells.path,a.selectHyperCubeCells.values,a.selectHyperCubeCells.cols]}),a.selectPivotCells&&o.push({method:"selectPivotCells",params:[a.selectPivotCells.path,a.selectPivotCells.cells]}),a.multiRangeSelectTreeDataValues&&o.push({method:"multiRangeSelectTreeDataValues",params:[a.multiRangeSelectTreeDataValues.path,a.multiRangeSelectTreeDataValues.ranges]}),o);var c}function Ob(t){wb.util=t.data("matrix").util,t.data("q",wb),t.formatter("q-number",ab),t.formatter("q-time",vb)}function Ab(t){var e=Hv(t.layout||{},t.path.split("/").join("."));if(!e)return!1;var n=e.qIsOneAndOnlyOne;return void 0!==n&&n}function zb(t){var e=t.brush,n=t.colorField,i=t.legendAlias,r=t.useLegendCube,o=void 0!==r&&r;!n||/qAttrDimInfo/.test(n)?(e.removeKeyAlias("attrDim/qDimensionInfo/0"),i&&e.removeKeyAlias(i),e.addKeyAlias("attrDim/qDimensionInfo/0","qHyperCube/".concat(n))):o&&e.addKeyAlias(i,"qHyperCube/".concat(n))}Ob.qBrushHelper=Eb,Ob.selections=Eb;var Tb="Shift";var Ib=function(t,e){return e[t]?Ib(t+1,e):t},jb=function(t,e){var n=e.reduce(function(t,e){return t[e]=!0,t},{});return t.reduce(function(t,e,i){var r=Ib(i,n);return n[r]=!0,t[i]=r,t},{})};function Pb(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.layout,n=t.filtered,i=void 0===n?{}:n,r=(null==e?void 0:e.qHyperCube)||{},o=r.qDimensionInfo,a=void 0===o?[]:o,s=r.qMeasureInfo,l=void 0===s?[]:s;return{dimensions:jb(a,i.dimensions||[]),measures:jb(l,i.measures||[])}}function Fb(t){var e=t.selection,n=t.fieldMap,i=e.method,r=e.params;if("selectHyperCubeValues"===i){var o=n.dimensions[r[1]];void 0!==o&&(r[1]=o)}return"selectHyperCubeContinuousRange"===i&&r[1].forEach(function(t){var e=n.dimensions[t.qDimIx];void 0!==e&&(t.qDimIx=e)}),e}var Lb=[],$b=0,Bb=function(t){var e=Lb.filter(function(t){var e;return null===(e=t.selections)||void 0===e?void 0:e.isActive()});e.length&&("Enter"===t.key?e.forEach(function(t){return t.selections.confirm()}):"Escape"!==t.key&&"Esc"!==t.key||e.forEach(function(t){return t.selections.cancel()}))};function Hb(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.selections,i=e.brush,r=e.majorScale,o=e.actions,a=e.selectionsFn,s=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).path,l=void 0===s?"/qHyperCubeDef":s;if(!n)return{layout:function(){},filteredFields:function(){},allowSimultaneous:function(){},release:function(){}};var c=++$b,u=null,h={dimensions:[],measures:[]},d=[],f={};n.on=n.on.bind(n),n.isActive=n.isActive.bind(n),n.addListener=n.addListener.bind(n),n.removeListener=n.removeListener.bind(n);var p=function(t){var e=t.brush,n=t.getConfig;return{interceptor:function(t){var i=e.brushes(),r=n(),o=r.allowSimultaneous,a=r.layout,s=void 0===a?{}:a;i.forEach(function(n){var i,r,a;("range"===n.type||null!==(i=t[0])&&void 0!==i&&i.key&&(null===(r=t[0])||void 0===r?void 0:r.key)!==n.id&&0!==o.indexOf(null===(a=t[0])||void 0===a?void 0:a.key))&&e.clear([])});var l=t.filter(function(t){return-2!==t.value});if(l.length>1){var c=function(t){var e=t.layout,n=void 0===e?{}:e,i=t.values,r=void 0===i?[]:i;if(null==r||!r.length)return[];var o=Array.from(new Set(r.map(function(t){return t.key}))),a=[];return o.forEach(function(t){var e=Ab({layout:n,path:t}),i=r.filter(function(e){return e.key===t}),o=e?[i.pop()]:i;a.push.apply(a,Am(o))}),a.filter(Boolean)}({layout:s,values:l});return c}return l},rangeInterceptor:function(t){var i=e.brushes(),r=n().allowSimultaneous;return i.filter(function(t){return"value"===t.type}).length?(e.clear([]),t):(i.forEach(function(n){var i=n.id===t[0].key||r.includes(n.id)&&r.includes(t[0].key);"range"!==n.type||i||e.clear([])}),t)}}}({brush:i,getConfig:function(){return{layout:u,allowSimultaneous:d}}}),g=p.rangeInterceptor,m=p.interceptor;i.intercept("set-ranges",g),i.intercept("toggle-ranges",g),i.intercept("toggle-values",m),i.intercept("set-values",m),i.intercept("add-values",m),i.on("start",function(){return n.begin(l)});var y,v,x={activate:function(){},deactivated:function(){return i.end()},cleared:function(){return i.clear()},canceled:function(){return i.end()}};y=n,v=x,Object.keys(v).forEach(function(t){y.on(t,v[t])});var b=null==r||null===(t=r.max)||void 0===t?void 0:t.call(r);return null!=o&&o.select?(o.select.on("start",function(){var t;i.start(),"function"==typeof o.select.getBrushOptions&&(f=(t=o.select).getBrushOptions.apply(t,arguments))}),o.select.on("end",function(){var t=a(i,f,u),e=Pb({layout:u,filtered:h});t.forEach(function(t){var i=Fb({selection:t,fieldMap:e});!function(t,e,n){if(e&&void 0!==n&&"selectHyperCubeContinuousRange"===t.method){var i=t.params;if(i&&i[1]&&i[1][0]){var r=i[1][0],o=r.qDimIx,a=r.qRange;"undefined"!==o&&a&&!1===a.qMaxInclEq&&a.qMax>=n&&(a.qMaxInclEq=!0)}}}(i,o.select.brushSelectionIncludeMax,b),n.select(i)})})):i.on("update",function(){var t=a(i,f,u),e=Pb({layout:u,filtered:h});t.forEach(function(t){n.select(Fb({selection:t,fieldMap:e}))})}),0===Lb.length&&document.addEventListener("keyup",Bb),Lb.push({key:c,selections:n}),{layout:function(t){u=t},filteredFields:function(t){h=t},allowSimultaneous:function(t){d=t},release:function(){u=null;var t=Lb.indexOf(Lb.filter(function(t){return t.key===c})[0]);-1!==t&&Lb.splice(t,1),Lb.length||document.removeEventListener("keyup",Bb),function(t,e){Object.keys(e).forEach(function(n){t.removeListener(n,e[n])})}(n,x)}}}function Wb(t){var e=t.chart,n=t.document,i=t.selectionInfo,r=t.eventName,o=t.componentName,a=t.brushName,s=void 0===a?"selection":a,l=t.emit,c=void 0===l?"rangeClear":l,u=i.event===r,h=n.querySelector("[data-key='".concat(o,"-edge-0']"));if(u||!h)return!1;var d=e.component(o);return!!d&&(d.emit(c),"string"==typeof s&&e.brush(s).clear(),d)}var Vb=["chart","document","selections","selectionInfo"],Ub=function(t){t.chart,t.document,t.selections,t.selectionInfo;var e=Dm(t,Vb);e.clearDiscrete(),e.clearContinuous(),e.clearMinor(),e.clearRange(),e.clearTap(),e.clearLegend()};function Yb(t){var e,n=t.lasso;null!=n&&null!==(e=n.active)&&void 0!==e&&e.call(n)&&(null==n||n.action(!1))}function Kb(t){var e,n=t.chart,i=t.selectionInfo,r=t.selectionActions,o=t.actions,a=void 0===o?{}:o,s=t.selections,l=t.selectionEvents;if(!1===r||!1===l)return function(){};var c=r.reset,u=void 0===c?Yb:c,h=r.clear,d=!1!==h&&function(t){var e=t.clear,n=void 0===e?Ub:e,i=t.selections,r=t.selectionInfo,o=t.chart;return function(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).cleared,e={selections:i,selectionInfo:r,chart:o,document:document,cleared:t};return n(Nm({clearDiscrete:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(t){var e=t.selectionInfo,n=t.chart,i=t.document,r=t.eventName,o=void 0===r?"discreteRange":r,a=t.componentName,s=void 0===a?"discrete-range-brush":a,l=t.cleared;return Wb({selectionInfo:e,chart:n,document:i,eventName:void 0!==l&&l?void 0:o,componentName:s,emit:"areaClear",brushName:t.brushName})}(Nm(Nm({},e),t))},clearContinuous:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(t){var e=t.selectionInfo,n=t.chart,i=t.document,r=t.eventName,o=void 0===r?"continuousRange":r,a=t.componentName,s=void 0===a?"continuous-range-brush":a,l=t.cleared;return Wb({selectionInfo:e,chart:n,document:i,eventName:void 0!==l&&l?void 0:o,componentName:s,brushName:t.brushName})}(Nm(Nm({},e),t))},clearMinor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(t){var e=t.selectionInfo,n=t.chart,i=t.document,r=t.componentName,o=void 0===r?"minor-range-brush":r,a=t.eventName,s=void 0===a?"minorRange":a,l=t.cleared,c=void 0!==l&&l,u=t.brushName,h=Wb({selectionInfo:e,chart:n,document:i,eventName:c?void 0:s,componentName:o,brushName:void 0!==u&&u});if(h){var d=h.settings.settings,f=d.scale,p=d.brush,g=n.scale(f).data().fields.map(function(t){return t.id()}),m=n.brush(p),y=m.brushes().filter(function(t){return"range"===t.type&&g.some(function(e){return e===t.id})});m&&y.length&&y.forEach(function(t){m.removeRanges(t.brush.ranges().map(function(e){return{key:t.id,range:e}}))})}}(Nm(Nm({},e),t))},clearRange:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(t){var e=t.selectionInfo,n=t.chart,i=t.document,r=t.selections,o=t.eventName,a=void 0===o?"xAxis":o,s=t.cleared;Wb({selectionInfo:e,chart:n,document:i,eventName:void 0!==s&&s?void 0:a,componentName:"".concat(a,"-range-brush"),emit:"areaClear",brushName:!1})&&r.clear()}(Nm(Nm({},e),t))},clearTap:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(t){var e=t.chart,n=t.selectionInfo,i=t.selections,r=t.events,o=void 0===r?["tap"]:r,a=t.brushNames,s=void 0===a?[]:a;if(n&&o.includes(n.event)){var l=n.currentComponent;n.previousComponent!==l&&(i.clear(),s.forEach(function(t){return e.brush(t).end()}))}}(Nm(Nm({},e),t))},clearLegend:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(t){var e=t.selectionInfo,n=t.chart,i=t.document,r=t.selections,o=t.eventName,a=void 0===o?"legendRange":o,s=t.componentName,l=void 0===s?"legend-range-brush":s,c=t.cleared,u=void 0!==c&&c,h=t.brushName;Wb({selectionInfo:e,chart:n,document:i,eventName:u?void 0:a,componentName:l,brushName:void 0!==h&&h})&&r.clear()}(Nm(Nm({},e),t))}},e))}}({clear:h,selections:s,selectionInfo:i,chart:n}),f=function(t){var e=t.chart,n=t.actions,i=t.reset,r=t.clear,o=!1,a={deactivated:function(t){var e=(n||{}).lasso;i({e:t,lasso:void 0!==e&&e})},canceled:function(t){var o=(n||{}).lasso;i({e:t,lasso:void 0!==o&&o}),r({e:t,chart:e,document:document})},cleared:function(t){o||(o=!0,r({e:t,chart:e,document:document,cleared:!0}),o=!1)}};return!1===i&&delete a.deactivated,!1===r&&delete a.cleared,!1===i&&!1===r&&delete a.canceled,a}({chart:n,clear:d,reset:u,actions:a}),p={};Object.entries(f).forEach(function(t){var e=Om(t,2),n=e[0],i=e[1];p[n]=function(t,e){return e?function(n){return e({event:n,defaultFunc:t})}:t}(i,l[n])});var g=function(t){var e=t.selectionEvents,n=t.selections,i=t.selectionInfo,r=t.clear,o=t.chart,a=t.document,s=e.start,l={selections:n,selectionInfo:i,chart:o,document:a},c=function(t){return Object.assign(i,t||{})},u=function(t){var e=t.event,n=t.components;return function(){return function(t){var e=t.selectionInfo,n=t.clear,i=t.event,r=t.components,o=void 0===r?[]:r;(0,t.setSelectionInfo)(Nm(Nm({},void 0===e?{}:e),{},{event:i,components:o.map(function(t){return t.key}).filter(Boolean)})),n()}({event:e,components:n,clear:r,selectionInfo:i,setSelectionInfo:c})}};return"function"==typeof s?function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];s(Nm(Nm({defaultFunc:u({event:t,components:e}),setSelectionInfo:c,clear:r},l),{},{event:t,components:e}))}:function(t){u({event:t,components:arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]})()}}({selectionEvents:l,selections:s,selectionInfo:i,clear:d,chart:n,document:document});return null==a||null===(e=a.select)||void 0===e||e.on("start",g),Object.entries(p).forEach(function(t){var e=Om(t,2),n=e[0],i=e[1];null==s||s.on(n,i)}),function(){var t;null==a||null===(t=a.select)||void 0===t||t.removeListener("start",g),Object.entries(p).forEach(function(t){var e=Om(t,2),n=e[0],i=e[1];null==s||s.removeListener(n,i)})}}var Gb=[{key:"qHyperCube/qDimensionInfo/0:numeric",includeMax:!1}];function Xb(t){var e=t.chart,n=t.actions,i=t.selections,r=t.picassoQ,o=t.config,a=o.allowSimultaneous,s=void 0!==a&&a,l=o.majorScale,c=void 0===l?void 0:l,u=o.selectionActions,h=void 0===u?{}:u,d=h.clear,f=h.reset,p=o.selectionEvents,g=void 0===p?{deactivated:void 0,canceled:void 0,cleared:void 0,start:void 0}:p,m=o.brushEvents,y=void 0===m?{}:m,v=o.brushName,x=void 0===v?"selection":v,b=o.brushMaxListeners,w=void 0===b?20:b,k=o.brushRanges,_=void 0!==k&&k,M=o.interceptors,S=void 0===M?{}:M,R=o.selectionsFn,C=void 0===R?r.selections:R,N=e.brush(x);if("number"==typeof w&&N.setMaxListeners(w),_){var D=!0===_?Gb:_;N.configure({ranges:D})}var q={canSelect:!0,getIsSelectionLocked:!1,isInnerDimensionLocked:!1,lockedDimensions:[],singleSelectIndex:0,selectionInfo:{colorField:void 0,components:[],event:void 0,currentComponent:void 0,previousComponent:void 0}},E=Hb({brush:N,majorScale:c,actions:n,selections:i,picassoQ:r,selectionsFn:C});!function(t){var e=t.brush,n=t.interceptors,i=void 0===n?{}:n;Object.entries(i).forEach(function(t){var n=Om(t,2),i=n[0],r=n[1];(Array.isArray(r)?r:[r]).forEach(function(t){e.intercept(i,t)})})}({brush:N,interceptors:S});var O=function(t){var e=t.chart,n=t.selectionActions,i=t.brush,r=t.actions,o=t.selectionInfo,a=t.selections,s=t.selectionEvents,l=function(t){var e=t.brush,n=t.chart,i=t.selectionInfo,r=t.brushEvents,o=void 0===r?{}:r,a=Object.entries(o).map(function(t){var r=Om(t,2),o=r[0],a=r[1],s=function(){return a({chart:n,selectionInfo:i})};return e.on(o,s),[o,s]});return function(){a.forEach(function(t){var n=Om(t,2),i=n[0],r=n[1];e.removeListener(i,r)})}}({brush:i,chart:e,selectionInfo:o,brushEvents:t.brushEvents}),c=Kb({chart:e,selectionInfo:o,selectionActions:n,actions:r,selections:a,selectionEvents:s}),u=function(t){var e=t.actions;if(null==e||!e.lasso)return function(){};var n=!1,i=function(t){n||t.key!==Tb||(e.lasso.action(!0),n=!0)},r=function(t){t.key===Tb&&(e.lasso.action(!1),n=!1)};return document.addEventListener("keydown",i),document.addEventListener("keyup",r),function(){document.removeEventListener("keydown",i),document.removeEventListener("keyup",r)}}({actions:r});return function(){l(),c(),u()}}({chart:e,brush:N,actions:n,selections:i,selectionInfo:q.selectionInfo,selectionActions:{clear:d,reset:f},selectionEvents:g,brushEvents:y});if(s){var A=!0===s?Am(Array(15)).map(function(t,e){return"qHyperCube/qMeasureInfo/".concat(e)}):s;E.allowSimultaneous(A)}return{unbindEvents:O,state:q,picassoSelections:E,brush:N}}var Jb=["colorField","useLegendCube"];function Zb(t){var e=t.chart,n=t.selections,i=t.actions,r=void 0!==i&&i,o=t.config,a=void 0===o?{}:o,s=Xb({chart:e,actions:r,selections:n,picassoQ:Ob,config:a}),l=s.unbindEvents,c=s.state,u=s.picassoSelections,h=s.brush,d=a.custom,f=void 0===d?{}:d,p=a.legendAlias,g=void 0===p?void 0:p,m=a.setBrushAliases,y=void 0===m?zb:m;return{getIsDimensionLocked:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return c.lockedDimensions[t]},getIsSelectionLocked:function(){var t,e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return null!==(t=null==n||null===(e=n.isLocked)||void 0===e?void 0:e.call(n))&&void 0!==t?t:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return!(null==t||!t.length)&&t.filter(function(t){return"object"===zm(t.data)&&Array.isArray(t.data.fields)}).every(function(t){return t.data.fields.every(function(t){var e=t.raw();return!(!e.qLocked&&e.qCardinal)})})}(i)},getIsSingleSelect:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:c.singleSelectIndex;return c.singleSelectDimensions[t]},getCanSelect:function(){return c.canSelect},getSelectionsObject:function(){return n},getSelectionInfo:function(){return c.selectionInfo},setLayout:function(t){var e=function(t){var e,n,i,r=t.selections,o=t.picassoSelections,a=t.layout,s={lockedDimensions:[],singleSelectDimensions:[]};null!=r&&null!==(e=r.isModal)&&void 0!==e&&e.call(r)&&r.confirm(),o.layout(a);var l=(null!==(n=null==a?void 0:a.qHyperCube)&&void 0!==n?n:{}).qDimensionInfo,c=void 0===l?[]:l;return s.lockedDimensions=c.map(function(t){return!!t.qLocked}),s.singleSelectDimensions=c.map(function(t,e){return Ab({layout:a,path:"qHyperCube/qDimensionInfo/".concat(e)})}),s.singleSelectIndex=function(t){var e,n=((null==t?void 0:t.qHyperCube)||{}).qDimensionInfo,i=void 0===n?[]:n,r=i.map(function(t,e){var n;return!(t.qLocked||(null===(n=t.qCardinalities)||void 0===n?void 0:n.qHypercubeCardinal)<=1)&&e}).filter(function(t){return"number"==typeof t});return null!==(e=r[0])&&void 0!==e?e:Math.max(i.length-1,0)}(a),s.canSelect=0===c.length||c.some(function(t){return!t.qLocked}),s.dimensionLocked=!(null===(i=c[0])||void 0===i||!i.qLocked),s}({selections:n,picassoSelections:u,layout:t});Object.assign(c,e)},setFilteredFields:function(t){u.filteredFields(t)},setBrushAliases:function(t){var e=t.colorField,n=t.useLegendCube,i=void 0!==n&&n,r=Dm(t,Jb),o=Nm({useLegendCube:i,colorField:e,brush:h,legendAlias:g},r);y(Nm(Nm({},o),{},{defaultFunc:function(){return zb(o)}}))},destroy:function(){l(),u.release()},custom:Nm({},f)}}var Qb="'Source Sans Pro', 'Arial', 'sans-serif'",tw="#333333",ew="#595959",nw="#737373",iw="#cccccc",rw="#e6e6e6";function ow(t){var e={};return[].concat(Am(t),Am([["","","color"],["object","","fontFamily"],["object","axis.label.name","color",ew],["object","axis.label.name","fontFamily",Qb],["object","axis.label.name","fontSize","12px"],["object","axis.line.major","color",iw],["object","axis.line.minor","color",rw],["object","axis.title","color"],["object","axis.title","fontFamily",Qb],["object","axis.title","fontSize","13px"],["object","grid.line.highContrast","color",rw],["object","grid.line.major","color",iw],["object","grid.line.minor","color",rw],["object","label.value","color",ew],["object","label.value","fontFamily",Qb],["object","label.value","fontSize","12px"],[!1,"label.value","darkColor",ew],[!1,"label.value","lightColor",rw],["object","outOfRange","color","#999"],["object","legend.title","color",tw],["object","legend.title","fontFamily",Qb],["object","legend.title","fontSize","15px"],["object","legend.label","color",ew],["object","legend.label","fontFamily",Qb],["object","legend.label","fontSize","13px"],["object","referenceLine.label.name","color",tw],["object","referenceLine.label.name","fontFamily",Qb],["object","referenceLine.label.name","fontSize","12px"],["object","referenceLine.outOfBounds","color",rw],["object","referenceLine.outOfBounds","fontFamily",Qb],["object","referenceLine.outOfBounds","fontSize","12px"],["object","referenceLine.outOfBounds","backgroundColor",nw,function(t){return"transparent"===t?nw:t}]])).reduce(function(t,n){var i="".concat(n[0],"-").concat(n[1],"-").concat(n[2],"}");return e[i]||(e[i]=!0,t.push(n)),t},[]).sort(function(t,e){return(t[0].split?t[0].split(".").length:0)-(e[0].split?e[0].split(".").length:0)})}var aw="object",sw=function(t){return t};function lw(t){var e=t.theme,n=t.id,i=t.transform,r=t.extend,o=t.matrix,a={},s=i.reduce(function(t,e){var n=Om(e,2),i=n[0],r=n[1];return t[i]=r,t},{});return o.forEach(function(t){var i=Om(t,5),r=i[0],o=i[1],l=i[2],c=i[3],u=i[4],h=void 0===u?function(t){return t}:u,d=function(t){var e=t.theme,n=t.base,i=t.path,r=t.attribute,o=t.defaultValue,a=void 0===o?void 0:o;if(!e||!1===n)return a;var s=e.getStyle(n,i,r);return void 0===s?a:s}({theme:e,base:r===aw&&n?"".concat(aw,".").concat(n):r,path:o,attribute:l,defaultValue:c}),f=(s["".concat(o,".").concat(l)]||sw)(h(d));Vv(a,[o,l].filter(Boolean).join("."),f)}),r.forEach(function(t){var e=Om(t,2),n=e[0],i=e[1];Vv(a,n,i)}),a}function cw(t,e,n){const i=`${t}.fontFamily`,r=`${t}.fontSize`;return{fontFamilyItem:{component:"dropdown",ref:i,options:()=>e.getOptions(i),defaultValue:()=>e.getDefaultValue(i)},fontWrapperItem:{component:"inline-wrapper",items:{fontSizeItem:{component:"dropdown",ref:r,options:()=>e.getOptions(r),defaultValue:()=>e.getDefaultValue(r)},fontColorItem:{component:"color-picker",width:!1,ref:`${t}.color`,defaultValue:()=>({color:n.getStyle("object.funnelChart",t,"color")})}}}}}function uw(t,e,n){const i=function(t){var e=t.theme,n=t.translator,i=t.config,r=function(t){var e=t.config,n=void 0===e?{}:e,i=n.id,r=n.paths;return{id:void 0===i?Vm:"".concat(Vm,".").concat(i),paths:Array.isArray(r)?r:[]}}({config:void 0===i?{}:i}),o=r.id,a=r.paths,s={};a.forEach(function(t){var i=t.split(".");iy(i);for(var r=s,a=0;a<i.length;a++){var l=i[a];a===i.length-1?r[l]=Qm({theme:e,translator:n,id:o,path:t}):void 0===r[l]&&(r[l]={}),r=r[l]}});var l=function(t){var e=t.split(".");iy(e);for(var n=s,i=0;i<e.length;i++){var r=e[i];if(void 0===n[r])throw new Error("font-resolver: Path '".concat(t,"' could not be resolved."));n=n[r]}return n};return s.getDefaultValue=function(t){return l(t).getDefaultValue()},s.getOptions=function(t){return l(t).getOptions()},s}({theme:t,translator:n,config:{id:"funnelChart",paths:["axis.title","axis.label.name","label.value"]}});return{component:"styling-panel",show:!0,chartType:"funnelchart",translation:"LayerStyleEditor.component.styling",chartTitle:"Object.FunnelChart",subtitle:"LayerStyleEditor.component.styling",useGeneral:!0,useBackground:!0,items:{axisTitleSection:{component:"panel-section",label:"Dimension title",items:{dimensionTitleItems:{component:"items",ref:"components",key:"axis",items:cw("axis.title",i,t)}}},labelNameSection:{component:"panel-section",label:"Dimension value label",items:{dimensionTitleItems:{component:"items",ref:"components",key:"axis",items:cw("axis.label.name",i,t)}}},labelValueSection:{component:"panel-section",label:"Value Label",items:{labelItems:{component:"items",ref:"components",key:"label",items:{...cw("label.value",i,t),contrastColor:{component:"checkbox",type:"boolean",ref:"label.value.useContrastColor",translation:"properties.dataPoints.valuelabel.contrast",defaultValue:!0}}}}}}}}const hw={uses:"sorting"},dw=(t,e,n)=>{const i=n?.sense?.theme;return{uses:"settings",items:{presentation:{type:"items",label:"Presentation",grouped:!0,items:{stylingPanel:uw(i,0,t),funnelmode:{ref:"funnel.mode",label:"Funnel Mode",type:"string",component:"dropdown",options:[{value:"AREA",label:"Area"},{value:"HEIGHT",label:"Height"},{value:"WIDTH",label:"Width"},{value:"ORDER",label:"Ordering"}],defaultValue:"WIDTH"},dimensionTitle:{ref:"showDimensionTitle",type:"boolean",component:"switch",label:"Dimension title",defaultValue:!0,options:[{value:!0,label:"Auto"},{value:!1,label:"Off"}]},valuesAuto:{ref:"dataPoint.auto",type:"boolean",label:"Value labels",component:"switch",defaultValue:!0,options:[{value:!0,label:"Auto"},{value:!1,label:"Custom"}]},labelMode:{ref:"dataPoint.labelMode",type:"string",component:"dropdown",options:[{value:"none",label:"None"},{value:"share",label:"Share"},{value:"value",label:"Values"}],defaultValue:"share",show:t=>!t.dataPoint.auto}}},colorsAndLegend:{uses:"colorsAndLegend",translation:"Colors",items:{colors:{items:{colorByLabel:{show:!1},expressionLabel:{show:!1}}},legend:{show:!1}}}}}},fw={uses:"data",items:{dimensions:{uses:"dimensions",items:{others:{items:{suppressOther:{defaultValue:!0,show:!1}}}},disabledRef:""},measures:{uses:"measures",disabledRef:""}}};function pw({translator:t,flags:e,anything:n}){return{type:"items",component:"accordion",items:{data:fw,sorting:hw,settings:dw(t,0,n)}}}function gw(t){return{definition:pw(t),support:{export:!0,exportData:!0,snapshot:!0,viewData:!1},importProperties:null,exportProperties:null}}const mw=[{path:"/qHyperCubeDef",dimensions:{min:1,max:1,description:()=>"Segments"},measures:{min:1,max:1,description(t){switch(t.funnel.mode){case"WIDTH":return"Width";case"AREA":return"Area";case"HEIGHT":return"Height";case"ORDER":return"Order";default:return""}},added(t,e){2===e.qHyperCubeDef.qInterColumnSortOrder.length&&1!==e.qHyperCubeDef.qInterColumnSortOrder[0]&&(e.qHyperCubeDef.qInterColumnSortOrder=[1,0])}}}];function yw(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var vw,xw;var bw=function(){if(xw)return vw;xw=1;var t=Object.prototype.hasOwnProperty,e=Object.prototype.toString,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,r=function(t){return"function"==typeof Array.isArray?Array.isArray(t):"[object Array]"===e.call(t)},o=function(n){if(!n||"[object Object]"!==e.call(n))return!1;var i,r=t.call(n,"constructor"),o=n.constructor&&n.constructor.prototype&&t.call(n.constructor.prototype,"isPrototypeOf");if(n.constructor&&!r&&!o)return!1;for(i in n);return void 0===i||t.call(n,i)},a=function(t,e){n&&"__proto__"===e.name?n(t,e.name,{enumerable:!0,configurable:!0,value:e.newValue,writable:!0}):t[e.name]=e.newValue},s=function(e,n){if("__proto__"===n){if(!t.call(e,n))return;if(i)return i(e,n).value}return e[n]};return vw=function t(){var e,n,i,l,c,u,h=arguments[0],d=1,f=arguments.length,p=!1;for("boolean"==typeof h&&(p=h,h=arguments[1]||{},d=2),(null==h||"object"!=typeof h&&"function"!=typeof h)&&(h={});d<f;++d)if(null!=(e=arguments[d]))for(n in e)i=s(h,n),h!==(l=s(e,n))&&(p&&l&&(o(l)||(c=r(l)))?(c?(c=!1,u=i&&r(i)?i:[]):u=i&&o(i)?i:{},a(h,{name:n,newValue:t(p,u,l)})):void 0!==l&&a(h,{name:n,newValue:l}));return h},vw}(),ww=yw(bw),kw={dataRelatedPropertiesPaths:["qHyperCube.qGrandTotalRow","qHyperCube.qHasOtherValues","qHyperCube.qSize","qHyperCube.qDimensionInfo[].qAttrDimInfo","qHyperCube.qDimensionInfo[].qAttrExprInfo","qHyperCube.qDimensionInfo[].qCardinalities","qHyperCube.qDimensionInfo[].qMax","qHyperCube.qDimensionInfo[].qMin","qHyperCube.qDimensionInfo[].qStateCounts","qHyperCube.qMeasureInfo[].qApprMaxGlyphCount","qHyperCube.qMeasureInfo[].qAttrExprInfo","qHyperCube.qMeasureInfo[].qMax","qHyperCube.qMeasureInfo[].qMin","qHyperCube.qMeasureInfo[].qTrendLines","qHyperCube.qTreeNodesOnDim","qSelectionInfo","plugins[].validMeasureValue","plugins[].labelBackgroundColor","plugins[].labelColor","plugins[].hasBackground","plugins[].maxLabelWidth","plugins[].points[].validMeasureValue","plugins[].points[].labelBackgroundColor","plugins[].points[].labelColor","plugins[].points[].hasBackground","plugins[].points[].maxLabelWidth"]};function _w(t){const{qHyperCube:e,...n}=t,{qAxisData:i,qDataPages:r,qStackedDataPages:o,qTreeDataPages:a,...s}=e,l=ww(!0,{},{...n,qHyperCube:{...s}}),{dataRelatedPropertiesPaths:c}=kw;function u(t,e){const n=e.indexOf("[]");if(-1===n)return void(void 0!==Hv(t,e)&&Vv(t,e,void 0));const i=e.substring(0,n),r=e.substring(n+2),o=r.startsWith(".")?r.substring(1):r;Hv(t,i,[]).forEach(t=>{o&&u(t,o)})}return c.forEach(t=>{u(l,t)}),l}var Mw={axes:{trackBy:function({isTime:t,isContinuous:e,isMeasure:n,isMajor:i}){return r=>{if(t||e||n){if("line"===r.type)return r.tickValue??"axis";if("text"===r.type)return`${r.tickValue} ${r.text}`;if("container"===r.type){const t=r.children.filter(t=>"text"===t.type).map(t=>t.text);return`${r.data.value} ${t.join("")}`}return Math.random()}if(i){if("line"===r.type&&void 0===r.tickValue)return"axis";const t=r.transform&&r.transform.match(/rotate/gi)?"rotated":"horizontal";return`${r.data.group?`${r.data.group.value} `:""}${r.data.value} ${r.text} ${t}`}return Math.random()}},compensateForLayoutChanges:function({isMeasure:t,isTime:e,isContinuous:n,isHorizontal:i,dock:r}){return({currentNodes:o,currentRect:a,previousRect:s})=>{const l=a.x-s.x,c=a.y-s.y,u=a.width-s.width,h=a.height-s.height;t?("left"===r&&o.forEach(t=>{"line"===t.type?(t.x1+=u,t.x2+=u):"text"===t.type&&(t.x+=u)}),"left"!==r&&"right"!==r||o.forEach(t=>{"line"===t.type&&(t.x1===t.x2?(t.y1=a.y,t.y2=t.y1+a.height):(Math.round(t.y1)<a.y||t.y1>a.y+a.height)&&(t.strokeWidth=0)),"text"===t.type&&(t.y<a.y||t.y>a.y+a.height)&&(t.fontSize="1px","#"===t.fill?.[0]&&(t.fill=`${t.fill.slice(0,1)}00${t.fill.slice(1)}`))}),"top"!==r&&"bottom"!==r||o.forEach(t=>{"line"===t.type&&(t.y1===t.y2?(t.x1=a.x,t.x2=t.x1+a.width):(Math.round(t.x1)<a.x||t.x1>a.x+a.width)&&(t.strokeWidth=0)),"text"===t.type&&(t.x<a.x||t.x>a.x+a.width)&&(t.fontSize="1px","#"===t.fill?.[0]&&(t.fill=`${t.fill.slice(0,1)}00${t.fill.slice(1)}`))})):e?o.forEach(t=>{"line"===t.type?t.y1===t.y2?t.x2+=u:t.x1===t.x2&&(t.x1-=l,t.x2-=l):"text"===t.type&&(t.x-=l)}):n||i?o.forEach(t=>{"line"===t.type&&t.y1===t.y2&&(t.x1+=l,t.x2+=l+u)}):o.forEach(t=>{"line"===t.type&&t.x1===t.x2&&(t.y1+=c,t.y2+=c+h)})}}},bars:{trackBy:function(t){return t.data.typeIndex?`${t.data.value} ${t.data.typeIndex.value}`:t.data.measureIndex?`${t.data.value} ${t.data.measureIndex.value}`:t.data.group?`${t.data.value} ${t.data.group.value}`:t.data.stack?`${t.data.value} ${t.data.stack.value}`:`${t.data.value}`},compensateForLayoutChanges:function({currentNodes:t,currentRect:e,previousRect:n}){const i=e.x-n.x,r=e.y-n.y;0===i&&0===r||t.forEach(t=>{t.children&&t.children.length>0&&t.children.forEach(t=>{void 0!==t.x&&void 0!==t.y?(t.x-=i,t.y-=r):t.transform=`translate(${-i}, ${-r})`})})}},barOobs:{compensateForLayoutChanges:function({currentNodes:t,currentRect:e,previousRect:n}){const i=e.x-n.x;0===e.y-n.y&&0===i||t.forEach(t=>{t.children&&t.children.length>0&&t.children.forEach(t=>{t.opacity=0})})}},labels:{trackBy:function(t){if("rect"===t.type)return"-3"===t.data?Math.random():`${t.type} ${t.data} ${t.rotation}`;const e=t.transform&&t.transform.match(/rotate/gi)?"rotated":"horizontal";return`${t.type} ${t.data} ${t.text} ${e}`},compensateForLayoutChanges:function({currentNodes:t,currentRect:e,previousRect:n}){const i=e.x-n.x,r=e.y-n.y;0===i&&0===r||t.forEach(t=>{t.transform&&t.transform.match(/rotate\(-90/gi)?(t.x+=r,t.y-=i):(t.x-=i,t.y-=r)})},linkData:function(t){return t.data.measureIndex?`${t.data.value} ${t.data.measureIndex.value}`:t.data.group?`${t.data.value} ${t.data.group.value}`:t.data.stack?`${t.data.value} ${t.data.stack.value}`:`${t.data.value}`}},lines:{trackBy:function(t){return"line"===t.type?t.value??Math.random():"path"===t.type?`${t.generatorType} ${t.layerObj.id} ${t.data.source.key}`:Math.random()},compensateForLayoutChanges:function({currentNodes:t,currentRect:e,previousRect:n}){const i=e.x-n.x,r=e.y-n.y;t.forEach(t=>{if(void 0!==t.x1&&void 0!==t.y1)t.y1===t.y2?(t.x2=t.x1+e.width,t.y1-=r,t.y2-=r):t.x1===t.x2&&(t.y2=t.y1+e.height,t.x1-=i,t.x2-=i);else{const e="x"===t.major.p?i/t.major.size:r/t.major.size,n="y"===t.minor.p?r/t.minor.size:i/t.minor.size;t.points.forEach(t=>{t.modified||(t.major-=e,t.minor-=n,t.minor0-=n,t.modified=!0)})}})}},lineOobs:{compensateForLayoutChanges:function({currentNodes:t,currentRect:e,previousRect:n}){const i=e.x-n.x;0===e.y-n.y&&0===i||t.forEach(t=>{t.opacity=0})}},markers:{trackBy:function(t){return t.data.line?`${t.data.line.value} ${t.data.major.value}`:`${t.data.major.value}`},compensateForLayoutChanges:function({currentNodes:t,currentRect:e,previousRect:n}){const i=e.x-n.x,r=e.y-n.y;0===i&&0===r||t.forEach(t=>{switch(t.type){case"circle":t.cx-=i,t.cy-=r;break;case"rect":t.x-=i,t.y-=r;break;case"path":t.transform=`translate(${-i}, ${-r})`}})}},points:{trackBy:function(t){return t.data.line?`${t.data.line.value} ${t.data.major.value}`:`${t.data.major.value}`},compensateForLayoutChanges:function({currentNodes:t,currentRect:e,previousRect:n}){const i=e.x-n.x,r=e.y-n.y;0===i&&0===r||t.forEach(t=>{"image"===t.type?(t.x-=i,t.y-=r):(t.cx-=i,t.cy-=r)})}},refLineLabels:{trackBy:function(t){if(void 0!==t.value){if("rect"===t.type)return`${t.value}`;if("text"===t.type)return`${t.value} ${t.text}`}return Math.random()},compensateForLayoutChanges:function({currentNodes:t,currentRect:e,previousRect:n}){const i=e.x-n.x,r=e.y-n.y,o=e.width-n.width,a=e.height-n.height;let s=-i,l=-r;t.forEach(t=>{switch(t.dock){case"right":i>0&&(s=e.width);break;case"left":o<0&&(s=-n.width);break;case"top":a<0&&(l=-n.height);break;case"bottom":r>0&&(l=e.height)}switch(t.type){case"text":case"rect":t.x+=s,t.y+=l;break;case"circle":t.cx+=s,t.cy+=l;break;case"path":t.transform=`translate(${s}, ${l})`}})}},shadowBars:{trackBy:function(){return Math.random()}},cacheProperties:function({viewCache:t,layout:e}){const n=_w(e);t.set("dataIndependentProperties",JSON.stringify(n))},propertiesHaveChanged:function({viewCache:t,layout:e}){const n=_w(e);return t.get("dataIndependentProperties")!==JSON.stringify(n)},nonUpdatingNode:{trackBy:function(){return Math.random()}}};function Sw(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Rw(t,e){var n=Object.create(t.prototype);for(var i in e)n[i]=e[i];return n}function Cw(){}[["FULL",{width:550,height:450}],["MEDIUM",{width:400,height:220}],["SMALL",{width:300,height:150}],["XSMALL",{width:150,height:75}],["SPARK",{width:0,height:0}]].forEach(([t,{width:e,height:n}])=>{});var Nw=.7,Dw=1/Nw,qw="\\s*([+-]?\\d+)\\s*",Ew="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ow="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Aw=/^#([0-9a-f]{3,8})$/,zw=new RegExp(`^rgb\\(${qw},${qw},${qw}\\)$`),Tw=new RegExp(`^rgb\\(${Ow},${Ow},${Ow}\\)$`),Iw=new RegExp(`^rgba\\(${qw},${qw},${qw},${Ew}\\)$`),jw=new RegExp(`^rgba\\(${Ow},${Ow},${Ow},${Ew}\\)$`),Pw=new RegExp(`^hsl\\(${Ew},${Ow},${Ow}\\)$`),Fw=new RegExp(`^hsla\\(${Ew},${Ow},${Ow},${Ew}\\)$`),Lw={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function $w(){return this.rgb().formatHex()}function Bw(){return this.rgb().formatRgb()}function Hw(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Aw.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?Ww(e):3===n?new Yw(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?Vw(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?Vw(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=zw.exec(t))?new Yw(e[1],e[2],e[3],1):(e=Tw.exec(t))?new Yw(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=Iw.exec(t))?Vw(e[1],e[2],e[3],e[4]):(e=jw.exec(t))?Vw(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=Pw.exec(t))?Qw(e[1],e[2]/100,e[3]/100,1):(e=Fw.exec(t))?Qw(e[1],e[2]/100,e[3]/100,e[4]):Lw.hasOwnProperty(t)?Ww(Lw[t]):"transparent"===t?new Yw(NaN,NaN,NaN,0):null}function Ww(t){return new Yw(t>>16&255,t>>8&255,255&t,1)}function Vw(t,e,n,i){return i<=0&&(t=e=n=NaN),new Yw(t,e,n,i)}function Uw(t){return t instanceof Cw||(t=Hw(t)),t?new Yw((t=t.rgb()).r,t.g,t.b,t.opacity):new Yw}function Yw(t,e,n,i){this.r=+t,this.g=+e,this.b=+n,this.opacity=+i}function Kw(){return`#${Zw(this.r)}${Zw(this.g)}${Zw(this.b)}`}function Gw(){const t=Xw(this.opacity);return`${1===t?"rgb(":"rgba("}${Jw(this.r)}, ${Jw(this.g)}, ${Jw(this.b)}${1===t?")":`, ${t})`}`}function Xw(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Jw(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Zw(t){return((t=Jw(t))<16?"0":"")+t.toString(16)}function Qw(t,e,n,i){return i<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new ek(t,e,n,i)}function tk(t){if(t instanceof ek)return new ek(t.h,t.s,t.l,t.opacity);if(t instanceof Cw||(t=Hw(t)),!t)return new ek;if(t instanceof ek)return t;var e=(t=t.rgb()).r/255,n=t.g/255,i=t.b/255,r=Math.min(e,n,i),o=Math.max(e,n,i),a=NaN,s=o-r,l=(o+r)/2;return s?(a=e===o?(n-i)/s+6*(n<i):n===o?(i-e)/s+2:(e-n)/s+4,s/=l<.5?o+r:2-o-r,a*=60):s=l>0&&l<1?0:a,new ek(a,s,l,t.opacity)}function ek(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}function nk(t){return(t=(t||0)%360)<0?t+360:t}function ik(t){return Math.max(0,Math.min(1,t||0))}function rk(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}Sw(Cw,Hw,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:$w,formatHex:$w,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return tk(this).formatHsl()},formatRgb:Bw,toString:Bw}),Sw(Yw,function(t,e,n,i){return 1===arguments.length?Uw(t):new Yw(t,e,n,null==i?1:i)},Rw(Cw,{brighter(t){return t=null==t?Dw:Math.pow(Dw,t),new Yw(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?Nw:Math.pow(Nw,t),new Yw(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Yw(Jw(this.r),Jw(this.g),Jw(this.b),Xw(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Kw,formatHex:Kw,formatHex8:function(){return`#${Zw(this.r)}${Zw(this.g)}${Zw(this.b)}${Zw(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Gw,toString:Gw})),Sw(ek,function(t,e,n,i){return 1===arguments.length?tk(t):new ek(t,e,n,null==i?1:i)},Rw(Cw,{brighter(t){return t=null==t?Dw:Math.pow(Dw,t),new ek(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?Nw:Math.pow(Nw,t),new ek(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*e,r=2*n-i;return new Yw(rk(t>=240?t-240:t+120,r,i),rk(t,r,i),rk(t<120?t+240:t-120,r,i),this.opacity)},clamp(){return new ek(nk(this.h),ik(this.s),ik(this.l),Xw(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=Xw(this.opacity);return`${1===t?"hsl(":"hsla("}${nk(this.h)}, ${100*ik(this.s)}%, ${100*ik(this.l)}%${1===t?")":`, ${t})`}`}}));const ok=Math.PI/180,ak=180/Math.PI,sk=.96422,lk=.82521,ck=4/29,uk=6/29,hk=3*uk*uk,dk=uk*uk*uk;function fk(t){if(t instanceof pk)return new pk(t.l,t.a,t.b,t.opacity);if(t instanceof bk)return wk(t);t instanceof Yw||(t=Uw(t));var e,n,i=vk(t.r),r=vk(t.g),o=vk(t.b),a=gk((.2225045*i+.7168786*r+.0606169*o)/1);return i===r&&r===o?e=n=a:(e=gk((.4360747*i+.3850649*r+.1430804*o)/sk),n=gk((.0139322*i+.0971045*r+.7141733*o)/lk)),new pk(116*a-16,500*(e-a),200*(a-n),t.opacity)}function pk(t,e,n,i){this.l=+t,this.a=+e,this.b=+n,this.opacity=+i}function gk(t){return t>dk?Math.pow(t,1/3):t/hk+ck}function mk(t){return t>uk?t*t*t:hk*(t-ck)}function yk(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function vk(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function xk(t,e,n,i){return 1===arguments.length?function(t){if(t instanceof bk)return new bk(t.h,t.c,t.l,t.opacity);if(t instanceof pk||(t=fk(t)),0===t.a&&0===t.b)return new bk(NaN,0<t.l&&t.l<100?0:NaN,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*ak;return new bk(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}(t):new bk(t,e,n,null==i?1:i)}function bk(t,e,n,i){this.h=+t,this.c=+e,this.l=+n,this.opacity=+i}function wk(t){if(isNaN(t.h))return new pk(t.l,0,0,t.opacity);var e=t.h*ok;return new pk(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}Sw(pk,function(t,e,n,i){return 1===arguments.length?fk(t):new pk(t,e,n,null==i?1:i)},Rw(Cw,{brighter(t){return new pk(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker(t){return new pk(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return new Yw(yk(3.1338561*(e=sk*mk(e))-1.6168667*(t=1*mk(t))-.4906146*(n=lk*mk(n))),yk(-.9787684*e+1.9161415*t+.033454*n),yk(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}})),Sw(bk,xk,Rw(Cw,{brighter(t){return new bk(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker(t){return new bk(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb(){return wk(this).rgb()}}));var kk,_k={isDark:function(t){return xk(t).l<70}};function Mk(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}1===(kk=Mk).length&&(kk=function(t){return function(e,n){return Mk(t(e),n)}}(kk));var Sk="$";function Rk(){}function Ck(t,e){var n=new Rk;if(t instanceof Rk)t.each(function(t,e){n.set(e,t)});else if(Array.isArray(t)){var i,r=-1,o=t.length;if(null==e)for(;++r<o;)n.set(r,t[r]);else for(;++r<o;)n.set(e(i=t[r],r,t),i)}else if(t)for(var a in t)n.set(a,t[a]);return n}function Nk(){}Rk.prototype=Ck.prototype={constructor:Rk,has:function(t){return Sk+t in this},get:function(t){return this[Sk+t]},set:function(t,e){return this[Sk+t]=e,this},remove:function(t){var e=Sk+t;return e in this&&delete this[e]},clear:function(){for(var t in this)t[0]===Sk&&delete this[t]},keys:function(){var t=[];for(var e in this)e[0]===Sk&&t.push(e.slice(1));return t},values:function(){var t=[];for(var e in this)e[0]===Sk&&t.push(this[e]);return t},entries:function(){var t=[];for(var e in this)e[0]===Sk&&t.push({key:e.slice(1),value:this[e]});return t},size:function(){var t=0;for(var e in this)e[0]===Sk&&++t;return t},empty:function(){for(var t in this)if(t[0]===Sk)return!1;return!0},each:function(t){for(var e in this)e[0]===Sk&&t(this[e],e.slice(1),this)}};var Dk=Ck.prototype;Nk.prototype={constructor:Nk,has:Dk.has,add:function(t){return this[Sk+(t+="")]=t,this},remove:Dk.remove,clear:Dk.clear,values:Dk.keys,size:Dk.size,empty:Dk.empty,each:Dk.each},ww.bind(null,!0);const qk=[[2,4,6],[2,4],[3]],Ek=[,[,,[[1,2]],[[1,2,3],[1,3]],[[1,2,4],[1,4]],[[1,2,4],[1,5]],[[1,2,4,6],[2,4,6],[1,3,6],[1,6]],[[1,2,4,6],[2,4,6],[1,3,6],[1,7]],[[1,2,4,8],[2,4,8],[1,8]],[[1,2,4,8],[2,4,8],[1,3,9],[1,9]],[[1,2,4,6,10],[1,2,4,10],[1,3,10],[3,10],[1,10]]],[,,,[[2,3]],[[2,3,4],[2,4]],[[2,3,4],[2,4],[2,5]],[[2,4,6],[2,6]],[[2,4,6],[2,6],[2,7]],[[2,4,8],[2,8]],[[2,4,8],[2,8],[2,9]],[[2,4,6,10],[2,4,10],[5,10],[3,10]]],[,,,,[[3,4]],[[3,4,5],[3,5]],[[3,4,5,6],[3,6]],[[3,4,5,6],[3,5,7],[3,7]],[[3,4,5,6,8],[3,5,7],[4,8],[3,8]],[[3,4,5,6,8],[3,4,6,9],[3,4,6,8],[3,6,9],[4,8],[3,9]],[[4,6,10],[5,10],[3,10]]],[,,,,,[[4,5]],[[4,5,6],[4,6]],[[4,5,6,7],[4,5,6],[4,6]],[[4,5,6,7,8],[4,5,6,7],[4,6,8],[4,8]],[[4,5,6,7,8],[4,6,9],[4,6,8],[4,8]],[[4,6,10],[5,7,9],[5,10],[4,10]]],[,,,,,,[[5,6]],[[5,6,7],[5,7]],[[5,6,7,8],[5,6,7],[6,8]],[[5,6,7,8,9],[5,6,7,8],[5,7,9],[5,9]],[[6,8,10],[5,10]]],[,,,,,,,[[6,7]],[[6,7,8],[6,8]],[[6,7,8,9],[6,7,8],[6,9]],[[6,7,8,9,10],[6,8,10],[6,10]]],[,,,,,,,,[[7,8]],[[7,8,9],[7,9]],[[7,8,9,10],[8,10],[7,10],[7,9]]],[,,,,,,,,,[[8,9]],[[8,9,10],[8,10]]],[,,,,,,,,,,[[9,10]]]];function Ok(t,e,n){const i=t?t.length:0;let r,o=void 0===e?Number.MAX_VALUE:t[0]/e;for(r=1;r<i;r++)o=Math.min(o,t[r]/t[r-1]);void 0!==n&&(o=Math.min(o,n/t[i-1])),t.splice(0,0,o)}function Ak(t,e,n){let i;const r=t?t.length:0;for(i=0;i<r;i++)Ok(t[i],e,n)}function zk(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?void 0:"svg"}!function(){let t,e;for(Ak(qk,1,10),t=0;t<Ek.length;t++)if(Ek[t])for(e=0;e<Ek[t].length;e++)Array.isArray(Ek[t][e])&&Ak(Ek[t][e])}();var Tk=class t{constructor(t,e){this._key=t,this._value=e}getKey(){return this._key}getValue(){return this._value}equals(e){return e instanceof t&&(this._key===e._key&&this._value===e._value)}static newInstanceIfNeeded(){let e,n,i=arguments[0];return"string"==typeof arguments[1]?(e=arguments[1],n=i.length):(n=arguments[1],e=arguments[2]),e&&i?(i.length>n&&(i=i.substr(0,n)),new t(i,e)):null}},Ik=class t{setValue(t){this._nextMap=null,this._value=t}getNextNode(t){return this._nextMap?this._nextMap[t]:null}put(e,n,i){let r,o;if(e.length===n)return o=this._value,this.setValue(i),o;const a=e.charAt(n);return this._nextMap?(r=this._nextMap[a],r||(r=new t,this._nextMap[a]=r)):(this._nextMap={},r=new t,this._nextMap[a]=r),r.put(e,n+1,i)}get(t,e){if(t.length<=e)return this._value;const n=this.getNextNode(t.charAt(e));return n?n.get(t,e+1):null}getLongestMatch(t,e){if(t.length<=e)return Tk.newInstanceIfNeeded(t,this._value);const n=this.getNextNode(t.charAt(e));if(!n)return Tk.newInstanceIfNeeded(t,e,this._value);const i=n.getLongestMatch(t,e+1);return i||Tk.newInstanceIfNeeded(t,e,this._value)}},jk=class{constructor(){this.clear()}getLongestMatch(t){return this.root&&t?this.root.getLongestMatch(t,0):null}getMaxKeyLength(){return this.maxKeyLen}clear(){this.root=null,this.maxKeyLen=0,this.size=0}put(t,e){this.root||(this.root=new Ik);const n=this.root.put(t,0,e);return n||(t.length>this.maxKeyLen&&(this.maxKeyLen=t.length),this.size++,null)}};(()=>{const t=[],e=[],n=new jk;let i,r,o;for(i in t["&quot"]="34",t["&amp"]="38",t["&lt"]="60",t["&gt"]="62",t["&nbsp"]="160",t["&iexcl"]="161",t["&cent"]="162",t["&pound"]="163",t["&curren"]="164",t["&yen"]="165",t["&brvbar"]="166",t["&sect"]="167",t["&uml"]="168",t["&copy"]="169",t["&ordf"]="170",t["&laquo"]="171",t["&not"]="172",t["&shy"]="173",t["&reg"]="174",t["&macr"]="175",t["&deg"]="176",t["&plusmn"]="177",t["&sup2"]="178",t["&sup3"]="179",t["&acute"]="180",t["&micro"]="181",t["&para"]="182",t["&middot"]="183",t["&cedil"]="184",t["&sup1"]="185",t["&ordm"]="186",t["&raquo"]="187",t["&frac14"]="188",t["&frac12"]="189",t["&frac34"]="190",t["&iquest"]="191",t["&Agrave"]="192",t["&Aacute"]="193",t["&Acirc"]="194",t["&Atilde"]="195",t["&Auml"]="196",t["&Aring"]="197",t["&AElig"]="198",t["&Ccedil"]="199",t["&Egrave"]="200",t["&Eacute"]="201",t["&Ecirc"]="202",t["&Euml"]="203",t["&Igrave"]="204",t["&Iacute"]="205",t["&Icirc"]="206",t["&Iuml"]="207",t["&ETH"]="208",t["&Ntilde"]="209",t["&Ograve"]="210",t["&Oacute"]="211",t["&Ocirc"]="212",t["&Otilde"]="213",t["&Ouml"]="214",t["&times"]="215",t["&Oslash"]="216",t["&Ugrave"]="217",t["&Uacute"]="218",t["&Ucirc"]="219",t["&Uuml"]="220",t["&Yacute"]="221",t["&THORN"]="222",t["&szlig"]="223",t["&agrave"]="224",t["&aacute"]="225",t["&acirc"]="226",t["&atilde"]="227",t["&auml"]="228",t["&aring"]="229",t["&aelig"]="230",t["&ccedil"]="231",t["&egrave"]="232",t["&eacute"]="233",t["&ecirc"]="234",t["&euml"]="235",t["&igrave"]="236",t["&iacute"]="237",t["&icirc"]="238",t["&iuml"]="239",t["&eth"]="240",t["&ntilde"]="241",t["&ograve"]="242",t["&oacute"]="243",t["&ocirc"]="244",t["&otilde"]="245",t["&ouml"]="246",t["&divide"]="247",t["&oslash"]="248",t["&ugrave"]="249",t["&uacute"]="250",t["&ucirc"]="251",t["&uuml"]="252",t["&yacute"]="253",t["&thorn"]="254",t["&yuml"]="255",t["&OElig"]="338",t["&oelig"]="339",t["&Scaron"]="352",t["&scaron"]="353",t["&Yuml"]="376",t["&fnof"]="402",t["&circ"]="710",t["&tilde"]="732",t["&Alpha"]="913",t["&Beta"]="914",t["&Gamma"]="915",t["&Delta"]="916",t["&Epsilon"]="917",t["&Zeta"]="918",t["&Eta"]="919",t["&Theta"]="920",t["&Iota"]="921",t["&Kappa"]="922",t["&Lambda"]="923",t["&Mu"]="924",t["&Nu"]="925",t["&Xi"]="926",t["&Omicron"]="927",t["&Pi"]="928",t["&Rho"]="929",t["&Sigma"]="931",t["&Tau"]="932",t["&Upsilon"]="933",t["&Phi"]="934",t["&Chi"]="935",t["&Psi"]="936",t["&Omega"]="937",t["&alpha"]="945",t["&beta"]="946",t["&gamma"]="947",t["&delta"]="948",t["&epsilon"]="949",t["&zeta"]="950",t["&eta"]="951",t["&theta"]="952",t["&iota"]="953",t["&kappa"]="954",t["&lambda"]="955",t["&mu"]="956",t["&nu"]="957",t["&xi"]="958",t["&omicron"]="959",t["&pi"]="960",t["&rho"]="961",t["&sigmaf"]="962",t["&sigma"]="963",t["&tau"]="964",t["&upsilon"]="965",t["&phi"]="966",t["&chi"]="967",t["&psi"]="968",t["&omega"]="969",t["&thetasym"]="977",t["&upsih"]="978",t["&piv"]="982",t["&ensp"]="8194",t["&emsp"]="8195",t["&thinsp"]="8201",t["&zwnj"]="8204",t["&zwj"]="8205",t["&lrm"]="8206",t["&rlm"]="8207",t["&ndash"]="8211",t["&mdash"]="8212",t["&lsquo"]="8216",t["&rsquo"]="8217",t["&sbquo"]="8218",t["&ldquo"]="8220",t["&rdquo"]="8221",t["&bdquo"]="8222",t["&dagger"]="8224",t["&Dagger"]="8225",t["&bull"]="8226",t["&hellip"]="8230",t["&permil"]="8240",t["&prime"]="8242",t["&Prime"]="8243",t["&lsaquo"]="8249",t["&rsaquo"]="8250",t["&oline"]="8254",t["&frasl"]="8260",t["&euro"]="8364",t["&image"]="8365",t["&weierp"]="8472",t["&real"]="8476",t["&trade"]="8482",t["&alefsym"]="8501",t["&larr"]="8592",t["&uarr"]="8593",t["&rarr"]="8594",t["&darr"]="8595",t["&harr"]="8596",t["&crarr"]="8629",t["&lArr"]="8656",t["&uArr"]="8657",t["&rArr"]="8658",t["&dArr"]="8659",t["&hArr"]="8660",t["&forall"]="8704",t["&part"]="8706",t["&exist"]="8707",t["&empty"]="8709",t["&nabla"]="8711",t["&isin"]="8712",t["&notin"]="8713",t["&ni"]="8715",t["&prod"]="8719",t["&sum"]="8721",t["&minus"]="8722",t["&lowast"]="8727",t["&radic"]="8730",t["&prop"]="8733",t["&infin"]="8734",t["&ang"]="8736",t["&and"]="8743",t["&or"]="8744",t["&cap"]="8745",t["&cup"]="8746",t["&int"]="8747",t["&there4"]="8756",t["&sim"]="8764",t["&cong"]="8773",t["&asymp"]="8776",t["&ne"]="8800",t["&equiv"]="8801",t["&le"]="8804",t["&ge"]="8805",t["&sub"]="8834",t["&sup"]="8835",t["&nsub"]="8836",t["&sube"]="8838",t["&supe"]="8839",t["&oplus"]="8853",t["&otimes"]="8855",t["&perp"]="8869",t["&sdot"]="8901",t["&lceil"]="8968",t["&rceil"]="8969",t["&lfloor"]="8970",t["&rfloor"]="8971",t["&lang"]="9001",t["&rang"]="9002",t["&loz"]="9674",t["&spades"]="9824",t["&clubs"]="9827",t["&hearts"]="9829",t["&diams"]="9830",t)"function"!=typeof t[i]&&t.hasOwnProperty(i)&&(e[t[i]]=i);for(r in e)"function"!=typeof e[r]&&e.hasOwnProperty(r)&&(o=e[r].toLowerCase().substr(1),n.put(o,String.fromCharCode(r)))})(),"undefined"!=typeof document&&document.createElement("div");for(let t=0;t<255;t++)t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122||t.toString(16);function Pk(t){const e=t.node.desc&&t.node.desc.share;return e?t.formatter("share")(e):""}function Fk(t){return t.formatter("num")(t.node.data.num.value)}function Lk({data:t}){return t?t.label:""}function $k(t){if(t.dataPoint.auto)return Pk;switch(t.dataPoint.labelMode){case"share":default:return Pk;case"value":return Fk;case"none":return null}}function Bk(t,e,n,i){const r=i.axis.label.getStyle(),o=i.label.value.getStyle(),a=e.getStyles().label.value;return{type:"labels",key:"funnel-labels",renderer:zk(),layout:{displayOrder:2},settings:{sources:[{component:"fun",selector:".labelLeft",strategy:{type:"rows",settings:{align:0,fill:r.fill,fontSize:parseInt(r.fontSize,10),fontFamily:r.fontFamily,labels:[{label:Lk}],linkData:t=>`${t.data.value} ${Lk(t)}`}}},{component:"fun",selector:".labelCenter",strategy:{type:"rows",settings:{align:.5,fill:o.useContrastColor?({node:t})=>(t=>_k.isDark(t.desc.fill)?a.lightColor:a.darkColor)(t):o.fill,fontSize:parseInt(o.fontSize,10),fontFamily:o.fontFamily,labels:[{label:$k(t)}],linkData:e=>"none"===t.dataPoint.labelMode?Math.random():`${e.data.value} ${$k(t)(e)}`}}}]},animations:{enabled:n,trackBy:t=>t.data}}}function Hk(t,e){if(!t.showDimensionTitle||!t.qHyperCube.qDimensionInfo[0].qFallbackTitle)return!1;const n=t.qHyperCube.qDimensionInfo[0].qFallbackTitle,i=e.axis.title.getStyle();return{type:"text",key:"dimension-title",renderer:zk(),text:n,layout:{dock:"top"},style:{text:{fill:i.fill,fontSize:i.fontSize,fontFamily:i.fontFamily}}}}function Wk({picasso:e}){const n=t.useElement(),i=t.useSelections(),r=t.useModel(),o=t.useApp(),a=t.useTranslator(),s=t.useOptions(),[l,c]=t.useState(),[u,h]=t.useState(),[d,f]=t.useState(),[p,g]=t.useState();return t.useEffect(()=>{const t=function(t){var e,n,i,r,o=t.picasso,a=t.model,s=t.app,l=t.translator,c=t.layoutService,u=void 0===c?void 0:c,h=t.createConfig,d=void 0===h?Lv:h,f=t.config,p=void 0===f?{}:f,g=t.custom,m=void 0===g?{}:g,y=p.localeInfo,v=p.key,x=p.theme,b=void 0===x?void 0:x,w=p.auto,k=void 0===w?void 0:w,_=p.definitionPath,M=null==u||null===(e=u.getLayout)||void 0===e?void 0:e.call(u),S={theme:b,key:v,localeInfo:y,layout:M,hc:null==u||null===(n=u.getHyperCube)||void 0===n?void 0:n.call(u),legendProps:null==u||null===(i=u.getLayoutValue)||void 0===i?void 0:i.call(u,"legend"),colorProps:Nm(Nm({},null==u||null===(r=u.getLayoutValue)||void 0===r?void 0:r.call(u,"color")),{},{useBaseColors:M?jv(M):void 0})},R=Tv({picasso:o,model:a,app:s,translator:l,auto:k});!1!==k&&R.auto(function(t){return k?k({layout:t,defaultAuto:Fv}):Fv(t)});var C=!1,N={getColor:function(){return R.color()},getPaletteColor:function(t){var e=t.index,n=t.color;return R.resolveUIColor({index:e,color:n})},getData:function(){return R.data()},getDatumProps:function(t){return R.datumProps(t)},getSnapshotData:function(){return R.getSnapshotData(_)},getSettingsForMeasure:function(t){return R.settingsForMeasure(t)},getSettings:function(){return R.settings()},getLegend:function(t,e){return R.legend(t,e)},getScales:function(){return R.scales()},getPalettes:function(){return R.palettes()},isSelectionLocked:function(t){var e=t.isMeasureSelectionLocked;return R.isSelectionLocked({isMeasureSelectionLocked:e})},isInitialized:function(){return C},custom:Nm({},m),initialize:function(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).createConfig,e=(void 0===t?d:t)({getUseBaseColors:jv}),n=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Nm(Nm(Nm({},t),e),{},{colorProps:Nm(Nm({},t.colorProps),e.colorProps||{})})}(S,e);return R.config(n),R.getAuxiliarySettings(_).then(function(){C=!0})}};return N}({picasso:e,model:r,app:o,translator:a,config:{auto:!1,key:"fill"}});n.style.overflow="hidden";const l=e({renderer:{prio:[s.renderer||"svg"]}}).chart({element:n,data:[],settings:{}}),u=Zb({chart:l,selections:i,config:{selectionActions:!1}});return f(u),h(t),c(l),g(function(){var t={};return{get:function(e){return t[e]},set:function(e,n){return t[e]=n,n},has:function(e){return e in t},remove:function(e){delete t[e]},empty:function(){t={}}}}()),()=>{u.destroy(),l.destroy()}},[]),[l,u,d,p]}function Vk({picasso:e}){const n=t.useStaleLayout(),i=t.useTheme(),r=t.useConstraints(),o=t.useRect(),a=t.usePlugins(),s=t.useAppLayout().qLocaleInfo,[l,c,u,h]=Wk({picasso:e}),d=t.useOptions(),f=()=>{const t=l.element.clientWidth!==h.get("width")||l.element.clientHeight!==h.get("height");return!1!==d.chartAnimations&&!t&&!Mw.propertiesHaveChanged({viewCache:h,layout:n})},[p]=t.usePromise(()=>{if(!c)return Promise.resolve();const t=function(t){return{layout:t,keys:{SCALE:{FILL:"fill"},COMPONENT:{FUNNEL:"fun",FUNNEL_LABELS:"funnel-labels",DIMENSION_TITLE:"dimension-title"}}}}(n),r=function(t){var e=t.picassoInstance,n=t.plugins,i=t.pluginArgs,r=void 0===i?{}:i,o={initialized:!1,definitions:[]};return{initialize:function(){return Sm(qm().m(function t(){var i,a,s,l;return qm().w(function(t){for(;;)switch(t.n){case 0:if(!o.initialized){t.n=1;break}return t.a(2);case 1:return a=Promise.all(n.filter(function(t){return"custom-component"===t.info.type}).map(function(){var t=Sm(qm().m(function t(n){var i;return qm().w(function(t){for(;;)switch(t.n){case 0:if(n.info.componentName){t.n=1;break}throw new Error("plugin-service: Custom component is missing componentName");case 1:return t.n=2,n.fn(Nm({},r));case 2:if("object"===zm(i=t.v)){t.n=3;break}throw new Error("plugin-service: Custom component needs to be an object");case 3:e.component(n.info.componentName,i);case 4:return t.a(2)}},t)}));return function(e){return t.apply(this,arguments)}}())),s=Promise.all(n.filter(function(t){return"component-definition"===t.info.type}).map(function(t){return t.fn(Nm({},r))})),t.n=2,Promise.all([a,s]);case 2:l=t.v,o.initialized=!0,(i=o.definitions).push.apply(i,Am(l[1]));case 3:return t.a(2)}},t)}))()},extendComponents:function(t){return o.initialized?(o.definitions.filter(Boolean).forEach(function(e){var n=Om(t.filter(function(t){return t.key&&t.key===e.key}),1)[0];if(n){var i=ay(!0,{},n.brush);ay(!0,n,e),e.brush&&(n.brush=function(t,e){return"object"===zm(t)&&Object.keys(t).length?(Array.isArray(e.consume)&&(t.consume=Uv({originalArray:t.consume,newArray:e.consume,matchKey:"context"})),Array.isArray(e.trigger)&&(t.trigger=Uv({originalArray:t.trigger,newArray:e.trigger,matchKey:"on"})),t):e}(i,e.brush))}else t.push(e)}),t):t}}}({picassoInstance:e,plugins:a,pluginArgs:t});return Promise.all([c.initialize({createConfig:({getUseBaseColors:t})=>({theme:i,colorProps:{...n.color,useBaseColors:t(n)},layout:n,hc:n.qHyperCube})}),r.initialize()]).then(()=>r)},[n,c]);t.useEffect(()=>{if(!l||!c||!p)return;const t=[{type:"q",key:"qHyperCube",data:n.qHyperCube,config:{localeInfo:s}},...c.getData()],e=function(t){var e=t.theme,n=t.config,i=void 0===n?{}:n,r=i.id,o=i.resolve,a=void 0===o?[]:o,s=i.transform,l=void 0===s?[]:s,c=i.extend,u=void 0===c?[]:c,h={theme:e,matrix:ow(a),styles:void 0};return h.styles=lw({theme:e,id:r,transform:l,extend:u,matrix:h.matrix}),{getStyles:function(){return h.styles},getTheme:function(){return h.theme},setTheme:function(t){h.theme=t,h.styles=lw({theme:t,id:r,transform:l,extend:u,matrix:h.matrix})}}}({theme:i,config:{id:"funnelChart"}}),o=function({layout:t,themeService:e}){const n=e.getStyles(),i=e=>t.components?.find(t=>t.key===e)??void 0;return{axis:{title:{getStyle:()=>({fontFamily:i("axis")?.axis?.title?.fontFamily??n.axis.title.fontFamily,fontSize:i("axis")?.axis?.title?.fontSize??n.axis.title.fontSize,fill:i("axis")?.axis?.title?.color?.color??n.axis.title.color})},label:{getStyle:()=>({fontSize:i("axis")?.axis?.label?.name?.fontSize??n.axis.label.name.fontSize,fontFamily:i("axis")?.axis?.label?.name?.fontFamily??n.axis.label.name.fontFamily,fill:i("axis")?.axis?.label?.name?.color?.color??n.axis.label.name.color})}},label:{value:{getStyle:()=>({fontSize:i("label")?.label?.value?.fontSize??n.label.value.fontSize,fontFamily:i("label")?.label?.value?.fontFamily??n.label.value.fontFamily,fill:i("label")?.label?.value?.color?.color??n.label.value.color,useContrastColor:i("label")?.label?.value?.useContrastColor??!0})}}}}({layout:n,themeService:e}),a=function({layout:t,constraints:e,colorService:n,themeService:i,styleModel:r,pluginService:o,animationsEnabled:a}){const s=function(t){return{...t.getScales()}}(n),l=n.getPalettes(),c=function({layout:t,constraints:e,colorService:n,animationsEnabled:i}){const r=n.getDatumProps(),o=n.getColor();return{type:"funnel",key:"fun",data:{extract:{field:"qDimensionInfo/0",props:{num:{field:"qMeasureInfo/0"},...r}}},brush:e.select||e.active?{}:{trigger:[{contexts:["selection"],data:[""]}],consume:[{context:"selection",filter:t=>"section"===t.tag,style:{inactive:{opacity:.3}}}]},settings:{num:{ref:"num"},fill:o,mode:t.funnel.mode},animations:{enabled:i,isMainComponent:!0,trackBy:t=>`${t.tag}: ${t.data.value}`}}}({layout:t,constraints:e,colorService:n,animationsEnabled:a}),u=[c,Bk(t,i,a,r),Hk(t,r)];return{palettes:l,scales:s,components:o.extendComponents(u),formatters:{share:{type:"d3-number",format:".1%"},num:{data:{field:"qMeasureInfo/0"}}}}}({layout:n,constraints:r,colorService:c,themeService:e,styleModel:o,pluginService:p,animationsEnabled:f});l.update({data:t,settings:a}),h.set("width",l.element.clientWidth),h.set("height",l.element.clientHeight),Mw.cacheProperties({viewCache:h,layout:n})},[l,c,i.name(),p,r]),t.useEffect(()=>{l&&(l.update(),h.set("width",l.element.clientWidth),h.set("height",l.element.clientHeight))},[o.width,o.height]),t.useEffect(()=>{u&&u.setLayout(n)},[n]),t.onTakeSnapshot(t=>c.getSnapshotData().then(e=>(t.snapshotData=t.snapshotData||{},t.snapshotData.content=t.snapshotData.content||{},t.snapshotData.content.chartData=e,t)).catch(()=>t))}return function(t){!function(t){if(t&&t.get&&t.add){const n="Object.Disclaimer.LimitedData";if(t.get(n)!==n)return;Object.keys(e).forEach(n=>{t.add(e[n])})}}(t.translator);const n=kp();return n.use(dm),n.component("funnel",wm),{ext:gw(t),qae:{properties:{initial:km},data:{targets:mw}},component(){Vk({picasso:n})}}}});
11
+ e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,i,r,o,s,a,l,c,u,h,d=e.length,f=e.search(/[0-9\-\+#]/),p=f>0?e.substring(0,f):"",g=e.split("").reverse().join(""),m=g.search(/[0-9\-\+#]/),y=d-m,x=e.substring(y,y+1),v=y+("."===x||","===x?1:0),b=m>0?e.substring(v,d):"";if(n=(t="-"===(e=e.substring(f,v)).charAt(0)?-t:+t)<0?t=-t:0,r=(i=e.match(/[^\d\-\+#]/g))&&i[i.length-1]||".",o=i&&i[1]&&i[0]||",",e=e.split(r),t=+(t=t.toFixed(e[1]&&e[1].length))+"",a=e[1]&&e[1].lastIndexOf("0"),(!(c=t.split("."))[1]||c[1]&&c[1].length<=a)&&(t=(+t).toFixed(a+1)),u=e[0].split(o),e[0]=u.join(""),(s=e[0]&&e[0].indexOf("0"))>-1)for(;c[0].length<e[0].length-s;)c[0]="0"+c[0];else 0===+c[0]&&(c[0]="");if((t=t.split("."))[0]=c[0],l=u[1]&&u[u.length-1].length){for(g="",y=(h=t[0]).length%l,d=h.length,v=0;v<d;v++)g+=h.charAt(v),!((v-y+1)%l)&&v<d-l&&(g+=o);t[0]=g}return t[1]=e[1]&&t[1]?r+t[1]:"","0"!==(i=t.join(""))&&""!==i||(n=!1),p+(n?"-":"")+i+b}},vv(bv={exports:{}}),bv.exports);function kv(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}const _v={3:"k",6:"M",9:"G",12:"T",15:"P",18:"E",21:"Z",24:"Y","-3":"m","-6":"μ","-9":"n","-12":"p","-15":"f","-18":"a","-21":"z","-24":"y"},Mv=/%\)?$/,Sv=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,Rv=/^\(oct\)/i,Cv=/^\(dec\)/i,Nv=/^\(hex\)/i,Dv=/^\(bin\)/i,qv=/^\(rom\)/i,Ev=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,zv=/#|0/g;function Av(e,t,n,i){return e=e.toString(t),n[1]===n[1].toUpperCase()&&(e=e.toUpperCase()),e.length-e.indexOf(".")>10&&(e=e.slice(0,e.indexOf(".")+11)),e.replace(".",i||".")}function Ov(e,t,n){const i=kv(e);return n?i:new RegExp(i||"",t)}function Tv(e,t,n,i){let r,o,s,a,l,c,u,h,d,f=e.pattern;var p,g;i&&(e.abbreviate=!0),p=t,(g=n)&&(g=kv(g)),p&&(p=kv(p)),d=new RegExp("(?:[#0]+".concat(p,")?[#0]+(?:").concat(g,"[#0]+)?")),s=f.match(d),s=s?s[0]:"",a=s?f.substr(0,f.indexOf(s)):f,l=s?f.substring(f.indexOf(s)+s.length):"",s||(s=f?"#":"##########"),t&&t===n&&(r=s.split(n),o=r.pop(),s=r.join("")+n+o,t=""),c=t,t=/,/.test(n)?"¤":",",c&&(s=s.replace(Ov(c,"g"),t)),u=n,n=".",u&&(s=s.replace(Ov(u,"g"),n)),h=s.match(/#/g),h=h?h.length:0;const m=f.split(u);let y;m[1]&&(y=m[1].match(zv)),e.prefix=a||"",e.postfix=l||"",e.pattern=f,e.maxPrecision=y?y.length:2,e.percentage=Mv.test(f),e.numericPattern=s||"",e.numericRegex=new RegExp("".concat(Ov(t,null,!0),"|").concat(Ov(n,null,!0)),"g"),e.groupTemp=c,e.decTemp=u,e.t=t,e.d=n,e.temp=h}class Iv{constructor(e,t,n,i,r){this.localeInfo=e,this.pattern=t,this.thousandDelimiter=n||",",this.decimalDelimiter=i||".",this.type=r||"numeric",this.patternSeparator=";",this.abbreviations=function(e,t){if(!e||!e.qNumericalAbbreviation)return _v;const n={};return e.qNumericalAbbreviation.split(t).forEach(e=>{let t=e.split(":");2===t.length&&(n[t[0]]=t[1])}),n}(e,this.patternSeparator),this.prepare()}clone(){const e=new Iv(this.localeInfo,this.pattern,this.thousandDelimiter,this.decimalDelimiter,this.type);return e.subtype=this.subtype,e}format(e,t,n,i){return this.prepare(t,n,i),this.formatValue(e)}prepare(e,t,n){let i;if(void 0===e&&(e=this.pattern),void 0===t&&(t=this.thousandDelimiter),void 0===n&&(n=this.decimalDelimiter),!e)return void(this._prepared={pattern:!1});this._prepared={positive:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},negative:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},zero:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""}},i=this._prepared,e=e.split(this.patternSeparator),i.positive.pattern=e[0],i.negative.pattern=e[1],i.zero.pattern=e[2],Ev.test(e[0])&&(i.positive.isFunctional=!0),e[1]?Ev.test(e[1])&&(i.negative.isFunctional=!0):i.negative=!1,e[2]?Ev.test(e[2])&&(i.zero.isFunctional=!0):i.zero=!1;const r="U"===this.type;i.positive.isFunctional||Tv(i.positive,t,n,r),i.negative&&!i.negative.isFunctional&&Tv(i.negative,t,n,r),i.zero&&!i.zero.isFunctional&&Tv(i.zero,t,n,r)}formatValue(e){let t,n,i,r,o,s,a,l,c,u=this._prepared,h="",d="",f=e;if(isNaN(e))return"".concat(f);if(e=+e,!1===u.pattern)return e.toString();if(0===e&&u.zero)return u=u.zero,u.pattern;if(e<0&&u.negative?(u=u.negative,e=-e):u=u.positive,o=u.d,s=u.t,u.isFunctional)e=function(e,t,n){let i;return Sv.test(t)?e=Av(e,Number(/\d{2}/.exec(t)[0]),t,n):Rv.test(t)?e=Av(e,8,t,n):Cv.test(t)?e=Av(e,10,t,n):Nv.test(t)?e=Av(e,16,t,n):Dv.test(t)?e=Av(e,2,t,n):qv.test(t)&&(i="",e<0&&(i="-",e=-e),0===(e=Math.floor(e))?e="0":e<=5e5?(e=function(e,t){let n,i="",r=Number(String(e).slice(-3)),o=(e-r)/1e3,s=[0,1,4,5,9,10,40,50,90,100,400,500,900].reverse(),a=["0","I","IV","V","IX","X","XL","L","XC","C","CD","D","CM"].reverse();for(;r>0;)for(n=0;n<s.length;n++)if(s[n]<=r){i+=a[n],r-=s[n];break}for(n=0;n<o;n++)i="M".concat(i);return t[1]!==t[1].toUpperCase()&&(i=i.toLowerCase()),i}(e,t),e=i+e):e=t+i+e.toExponential(0)),e}(e,u.pattern,o);else{if(u.percentage&&(e*=100),u.abbreviate){const t=Object.keys(this.abbreviations).map(e=>parseInt(e,10)).sort((e,t)=>e-t);let i,r,o=t[0];for(a=0,n=Number(Number(e).toExponential().split("e")[1]);o<=n&&a<t.length;)a++,o=t[a];a>0&&(i=t[a-1]),i&&n>0&&i>0?r=i:(n<0&&i<0||!i)&&(o<0&&o-n<=u.maxPrecision?r=o:i<=n&&!(o>0&&-n<=u.maxPrecision)&&(r=i)),r&&(h=this.abbreviations[r],e/=10**r)}if(i=Math.abs(e),t=u.temp,l=u.numericPattern,c=l.split(o)[1],"I"===this.type&&(e=Math.round(e)),r=e,c||"#"!==l.slice(-1)[0])if(i>=1e15||i>0&&i<=1e-14)e=i?i.toExponential(15).replace(/\.?0+(?=e)/,""):"0";else{const t=Number((e+1e-15*(e<0?-1:1)).toFixed(Math.min(20,c?c.length:0)).split(".")[0]);let n=l.split(o)[0];if(n+=o,e=wv(n,t)||"0",c){const t=Math.max(0,Math.min(14,c.length)),n=c.replace(/#+$/,"").length;let r=("I"===this.type?0:i%1+1e-15).toFixed(t).slice(2).replace(/0+$/,"");for(a=r.length;a<n;a++)r+="0";r&&(e+=o+r)}else 0===t&&(r=0)}else if(i>=10**t||i<1||i<1e-4)0===e?e="0":i<1e-4||i>=1e20?(e=(e=r.toExponential(Math.max(1,Math.min(14,t))-1)).replace(/\.?0+(?=e)/,""),d=""):(e=e.toPrecision(Math.max(1,Math.min(14,t)))).indexOf(".")>=0&&(e=(e=e.replace(e.indexOf("e")<0?/0+$/:/\.?0+(?=e)/,"")).replace(".",o));else{for(l+=o,t=Math.max(0,Math.min(20,t-Math.ceil(Math.log(i)/Math.log(10)))),a=0;a<t;a++)l+="#";e=wv(l,e)}e=e.replace(u.numericRegex,e=>e===s?u.groupTemp:e===o?u.decTemp:""),r<0&&!/^-/.test(e)&&(e="-".concat(e))}return u.prefix+e+d+h+u.postfix}static getStaticFormatter(){return{prepare(){},formatValue:e=>"".concat(e)}}}function jv(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=t.size,i=void 0===n?5e3:n,r=t.multipleArguments,o=void 0!==r&&r,s=t.toKey,a=void 0===s?e=>e:s;let l,c,u=Object.create(null),h=Object.create(null),d=0,f=0;return l=o?function(){return c=a(...arguments),l.has(c)?l.get(c):l.set(c,e(...arguments))}:t=>(c=a(t),l.has(c)?l.get(c):l.set(c,e(t))),l.set=(e,t)=>(d>=i&&(delete u[h[f]],delete h[f],d--,f++),u[e]=t,h[d]=e,d++,t),l.get=e=>u[e],l.has=e=>e in u,l.clear=()=>{u=Object.create(null),h=Object.create(null),d=0,f=0},l.size=()=>d,l}function Pv(e,t,n,i,r){const o=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Iv(...t)}(r,e,t,n,i),s=jv(o.formatValue.bind(o),{toKey:e=>isNaN(e)?e:+e});function a(e){return s(e)}return a.format=function(e,t,n,i){return s.clear(),o.format(t,e,n,i)},a.pattern=function(e){return e&&(s.clear(),o.pattern=e,o.prepare()),o.pattern},a}const Fv="D",Lv="T",$v="TS",Bv=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Hv=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Wv=["January","February","March","April","May","June","July","August","September","October","November","December"],Vv=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Uv(e,t){for(let n=e.length;n<t;n++)e="0".concat(e);return e}function Yv(e){let t=e.toString().split(".");return t[1]?(t=Number("0.".concat(t[1])),t):0}class Kv{constructor(e,t,n){const i=e||{};i.qCalendarStrings||(i.qCalendarStrings={qLongDayNames:Bv,qDayNames:Hv,qLongMonthNames:Wv,qMonthNames:Vv}),this.localeInfo=i,this.locale_days=i.qCalendarStrings.qLongDayNames.slice(),this.locale_days_abbr=i.qCalendarStrings.qDayNames.slice(),this.locale_months=i.qCalendarStrings.qLongMonthNames.slice(),this.locale_months_abbr=i.qCalendarStrings.qMonthNames.slice(),t||(t={[Lv]:i.qTimeFmt||"hh:mm:ss",[Fv]:i.qDateFmt||"YYYY-MM-DD",[$v]:i.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"}[n]),this.pattern=t}clone(){const e=new Kv(this.localeInfo,this.pattern);return e.subtype=this.subtype,e}format(e,t){t||(t=this.pattern?this.pattern:"YYYY-MM-DD hh:mm:ss"),t=t.replace(/\[.+]|\[|]/g,"");const n=/t+/gi.test(t);let i;e instanceof Date?i=function(e,t){let n=e.getUTCHours(),i=e.getUTCDay()-1;return t&&(n%=12,n||(n=12)),i<0&&(i=6),{year:e.getUTCFullYear(),month:e.getUTCMonth(),day:i,date:e.getUTCDate(),h:n,m:e.getUTCMinutes(),s:e.getUTCSeconds(),f:e.getUTCMilliseconds(),t:e.getUTCHours()>=12?"pm":"am"}}(e,n):(e<0&&(e=-e,t="-".concat(t)),i=function(e,t){let n,i=function(e){const t=e,n=24*Yv(t),i=60*Yv(n),r=60*Yv(i),o=1e3*Yv(r);return{d:Math.floor(t),h:Math.floor(n),m:Math.floor(i),s:Math.floor(r),f:Math.round(o)}}(e),r=i.d,o=i.h,s=i.m,a=i.s,l=i.f,c=0;/w+|t+/gi.test(t)&&(n=new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,Math.round(86400*(e-Math.floor(e))))),isNaN(n.getTime())&&(n=null)),/D+/gi.test(t)||(o+=24*r),/h+/gi.test(t)||(s+=60*o),/m+/gi.test(t)||(a+=60*s),/w+/gi.test(t)&&(c=n?n.getDay()-1:0,c<0&&(c=6));let u="";return n&&(u=n.getUTCHours()>=12?"pm":"am"),{year:0,month:0,day:c,date:r,h:o,m:s,s:a,f:l,t:u}}(e,t));const r=(o=this,s=i,{"Y+|y+":{Y:"".concat(Number("".concat(s.year).slice(-2))),YY:Uv("".concat(s.year).slice(-2),2),YYY:Uv("".concat(s.year).slice(-3),3),def:e=>Uv("".concat(s.year),e.length)},"M+":{M:s.month+1,MM:Uv("".concat(s.month+1),2),MMM:o.locale_months_abbr[s.month],def:o.locale_months[s.month]},"W+|w+":{W:s.day,WW:Uv("".concat(s.day),2),WWW:o.locale_days_abbr[s.day],def:o.locale_days[s.day]},"D+|d+":{D:s.date,def:e=>Uv("".concat(s.date),e.length)},"h+|H+":{h:s.h,def:e=>Uv("".concat(s.h),e.length)},"m+":{m:s.m,def:e=>Uv("".concat(s.m),e.length)},"s+|S+":{s:s.s,def:e=>Uv("".concat(s.s),e.length)},"f+|F+":{def(e){let t="".concat(s.f),n=e.length-t.length;if(n>0)for(let e=0;e<n;e++)t+="0";else n<0&&(t=t.slice(0,e.length));return t}},"t{1,2}|T{1,2}":{def(e){let t=s.t;return e[0].toUpperCase()===e[0]&&(t=t.toUpperCase()),t=t.slice(0,e.length),t}}});var o,s;const a=[];for(const e in r)Object.prototype.hasOwnProperty.call(r,e)&&a.push(e);const l=new RegExp(a.join("|"),"g");return t.replace(l,e=>{let t,n,i;for(n in r)if(Object.prototype.hasOwnProperty.call(r,n)&&(t=new RegExp(n),t.test(e)))break;if(!t)return"";for(const t in r[n])if(t===e||t.toLowerCase()===e){i=r[n][t],void 0===i&&(i=r[n][t.toLowerCase()]);break}return void 0===i&&(i=r[n].def),"function"==typeof i&&(i=i(e)),i})}}function Xv(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Kv(...t)}function Gv(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"TS",n=Xv(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,e,t),i=jv(n.format.bind(n),{toKey:e=>"object"==typeof e&&"function"==typeof e.getTime?e.getTime():e});function r(e){return"IV"!==t?function(e){return new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,0,Math.round(864e5*(e-Math.floor(e)))))}(e):e}function o(e){return e=r(e),i(e)}return o.format=function(e,t){return i.clear(),t=r(t),n.format(t,e)},o.locale=function(r){return n=Xv(r,e,t),i=jv(n.format.bind(n),{toKey:e=>"object"==typeof e?e.getTime():e}),this},o.qtype=function(e){return void 0!==e&&(t=e,i.clear()),t},o}function Jv(){let e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.meta,i=t.id,r=t.key,o=t.localeInfo,s=t.fieldExtractor,a=t.value,l=t.type,c=t.sourceField;const u=a||("dimension"===l?e=>null==e?void 0:e.qElemNo:e=>null==e?void 0:e.qValue),h="dimension"===l?"first":"avg",d=function(e,t){if(e&&e.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(e.qNumFormat.qType))return Gv(e.qNumFormat.qFmt,e.qNumFormat.qType,t);let n="#",i=t&&void 0!==t.qThousandSep?t.qThousandSep:",",r=t&&void 0!==t.qDecimalSep?t.qDecimalSep:".",o="U",s=e&&!!e.qIsAutoFormat;return e&&e.qNumFormat?(n=e.qNumFormat.qFmt||n,i=e.qNumFormat.qThou||i,r=e.qNumFormat.qDec||r,o=e.qNumFormat.qType||o,s=s&&-1===["M"].indexOf(e.qNumFormat.qType)):s=!0,(s||"U"===o)&&(n="#".concat(r,"##"),o="U"),Pv(n,i,r,o,t)}(n,o),f={id:()=>i,key:()=>r,raw:()=>n,title:()=>n.qFallbackTitle||n.label,type:()=>l,origin:()=>c,items:()=>(e||(e=s(f)),e),min:()=>n.qMin,max:()=>n.qMax,value:u,label:e=>(null==e?void 0:e.qText)||"",reduce:h,reduceLabel:"dimension"===l?"first":(e,t)=>d(t),formatter:()=>d,tags:()=>n.qTags};return f}function Zv(e,t,n,i,r){return(t[e]||[]).map((t,o)=>{const s="".concat(i?"".concat(i,"/"):"").concat(e,"/").concat(o),a={instance:Jv(jx({id:"".concat(n?"".concat(n,"/"):"").concat(s),key:s,meta:t},r))};return a.attrDims=Zv("qAttrDimInfo",t,n,s,jx({},r,{value:e=>null==e?void 0:e.qElemNo,type:"dimension"})),a.attrExps=Zv("qAttrExprInfo",t,n,s,jx({},r,{value:e=>null==e?void 0:e.qNum,type:"measure"})),a.measures=Zv("qMeasureInfo",t,n,s,jx({},r,{value:e=>null==e?void 0:e.qValue,type:"measure"})),a})}function Qv(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.key,n=e.data,i=e.config,r=void 0===i?{}:i;const o={fields:[],wrappedFields:[],allFields:[],virtualFields:[]},s=n;if(!s)throw new Error('Missing "data" input');if(!s.qDimensionInfo)throw new Error('The "data" input is not recognized as a hypercube');const a=Qv.util,l={cache:o,cube:s,localeInfo:r.localeInfo,fieldExtractor:null,pages:null,hierarchy:()=>null,virtualFields:r.virtualFields},c={key:()=>t,raw:()=>s,field:e=>function(e,t){let n=t.cache;if("number"==typeof e)return n.fields[e];const i=n.allFields;if("function"==typeof e){for(let t=0;t<i.length;t++)if(e(i[t]))return i[t];return!1}if("string"==typeof e){for(let t=0;t<i.length;t++)if(i[t].key()===e||i[t].title()===e)return i[t]}else if(e&&-1!==i.indexOf(e))return e;throw Error("Field not found: ".concat(e))}(e,l),fields:()=>o.fields.slice(),extract:e=>l.extractor(e,c,o,a),hierarchy:e=>l.hierarchy(e,c,o,a),_cache:()=>o};"K"===s.qMode||"T"===s.qMode||!s.qMode&&s.qNodesOnDim?(l.extractor=xv,l.hierarchy=yv,l.pages="K"===s.qMode?s.qStackedDataPages:s.qTreeDataPages):"S"===s.qMode?(l.extractor=$x,l.pages=s.qDataPages,l.hierarchy=yv):l.extractor=()=>[],l.fieldExtractor=e=>l.extractor({field:e},c,o,a);const u="S"===s.qMode?e=>e.qElemNumber:void 0,h="S"===s.qMode?e=>e.qNum:void 0;o.wrappedFields.push(...Zv("qDimensionInfo",s,t,"",jx({},l,{value:u,type:"dimension"}))),o.wrappedFields.push(...Zv("qMeasureInfo",s,t,"",jx({},l,{value:h,type:"measure"}))),o.fields=o.wrappedFields.map(e=>e.instance);const d=e=>{e.forEach(e=>{o.allFields.push(e.instance),d(e.measures),d(e.attrDims),d(e.attrExps)})};return d(o.wrappedFields),(r.virtualFields||[]).forEach(e=>{const n=c.field(e.from),i=Jv(Nx({meta:n.raw(),id:"".concat(t,"/").concat(e.key),sourceField:n,fieldExtractor:e=>l.extractor({field:e},c,o,a),key:e.key,type:n.type(),localeInfo:l.localeInfo,value:n.value},e.override||{}));o.virtualFields.push(i)}),o.allFields.push(...o.virtualFields),c}const eb=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],tb=/\/qDimensionInfo(?:\/(\d+))?/,nb=/\/qMeasureInfo\/(\d+)/,ib=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,rb=/\/qAttrExprInfo\/(\d+)/,ob=/\/?qHyperCube/,sb=/\/?qTreeData/,ab=e=>"".concat(e.substr(0,e.indexOf("/qHyperCubeDef")+14)),lb=e=>"".concat(e.substr(0,e.indexOf("/qTreeDataDef")+13));function cb(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const i=t.byCells,r=t.primarySource,o=[],s={},a=e.isActive();let l=!1;return e.brushes().forEach(e=>{const t=function(e,t){let n=e,i=-1,r=-1,o="",s=e=>e;ob.test(e)?(o="".concat(n.substr(0,n.indexOf("qHyperCube")+10)),s=ab):sb.test(e)&&(o="".concat(n.substr(0,n.indexOf("qTreeData")+9)),s=lb);let a=!0;if(tb.test(e)&&(i=+tb.exec(e)[1]),nb.test(e)&&(r=+nb.exec(e)[1]),ib.test(e)){r=-1,i=0;const e=+ib.exec(n)[2];isNaN(e)||(i=e,n=n.replace(/\/\d+$/,"")),a=!1}if(rb.test(e)){const e=r;if(t){r=0;const s=iv(o,t);r+=(s.qMeasureInfo||[]).length,i>-1?(r=s.qDimensionInfo.slice(0,i).reduce((e,t)=>e+t.qAttrExprInfo.length,r),i=-1):(r=s.qDimensionInfo.reduce((e,t)=>e+t.qAttrExprInfo.length,r),r=s.qMeasureInfo.slice(0,e).reduce((e,t)=>e+t.qAttrExprInfo.length,r)),r+=+rb.exec(n)[1]}else i>-1?(i=-1,r=+rb.exec(n)[1]):r+=+rb.exec(n)[1]+1}return eb.forEach(e=>{let t=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i,r,o,s,a=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t);else for(;!(l=(i=o.call(n)).done)&&(a.push(i.value),a.length!==t);l=!0);}catch(e){c=!0,r=e}finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw r}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Sx(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Sx(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(e,2),i=t[0],r=t[1];n=n.replace(i,r)}),a&&(n=s(n)),n&&"/"!==n[0]&&(n="/".concat(n)),{measureIdx:r,dimensionIdx:i,path:n}}(e.id,n);if("range"===e.type&&t.measureIdx>-1&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,s.multiRangeSelectTreeDataValues||(s.multiRangeSelectTreeDataValues={path:t.path,ranges:[]}),n.forEach(e=>s.multiRangeSelectTreeDataValues.ranges.push({qMeasureIx:t.measureIdx,qDimensionIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}})))}else{if("range"===e.type&&t.measureIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,s.rangeSelectHyperCubeValues||(s.rangeSelectHyperCubeValues={path:t.path,ranges:[]}),n.forEach(e=>s.rangeSelectHyperCubeValues.ranges.push({qMeasureIx:t.measureIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}})))}if("range"===e.type&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,s.selectHyperCubeContinuousRange||(s.selectHyperCubeContinuousRange={path:t.path,ranges:[]}),n.forEach(e=>s.selectHyperCubeContinuousRange.ranges.push({qDimIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!1}})))}if("value"===e.type&&t.dimensionIdx>-1)if(i)if(n&&n.qHyperCube&&("P"===n.qHyperCube.qMode||"T"===n.qHyperCube.qMode||"K"===n.qHyperCube.qMode)){const i=n.qHyperCube,o=i.qNoOfLeftDims,a=i.qEffectiveInterColumnSortOrder.indexOf(t.dimensionIdx);if(s.selectPivotCells||(s.selectPivotCells={path:t.path,cells:[]}),e.id===r||!r){const n=e.brush.values().map(e=>+e).filter(e=>!isNaN(e));(0===o||a>=o)&&o>-1?n.forEach(e=>{s.selectPivotCells.cells.push({qType:"T",qCol:e,qRow:a-o})}):n.forEach(e=>{s.selectPivotCells.cells.push({qType:"L",qCol:t.dimensionIdx,qRow:e})}),l=!!s.selectPivotCells.cells.length}}else s.selectHyperCubeCells||(s.selectHyperCubeCells={path:t.path,cols:[]}),s.selectHyperCubeCells.cols.push(t.dimensionIdx),e.id!==r&&(r||s.selectHyperCubeCells.values)||(s.selectHyperCubeCells.values=e.brush.values().map(e=>+e).filter(e=>!isNaN(e)),l=!!s.selectHyperCubeCells.values.length);else{const n=e.brush.values().map(e=>+e).filter(e=>!isNaN(e));l=!!n.length,o.push({params:[t.path,t.dimensionIdx,n,!1],method:"selectHyperCubeValues"})}}}),!l&&a?[{method:"resetMadeSelections",params:[]}]:(s.rangeSelectHyperCubeValues&&o.push({method:"rangeSelectHyperCubeValues",params:[s.rangeSelectHyperCubeValues.path,s.rangeSelectHyperCubeValues.ranges,[],null===(c=t.orMode)||void 0===c||c]}),s.selectHyperCubeContinuousRange&&o.push({method:"selectHyperCubeContinuousRange",params:[s.selectHyperCubeContinuousRange.path,s.selectHyperCubeContinuousRange.ranges]}),s.selectHyperCubeCells&&o.push({method:"selectHyperCubeCells",params:[s.selectHyperCubeCells.path,s.selectHyperCubeCells.values,s.selectHyperCubeCells.cols]}),s.selectPivotCells&&o.push({method:"selectPivotCells",params:[s.selectPivotCells.path,s.selectPivotCells.cells]}),s.multiRangeSelectTreeDataValues&&o.push({method:"multiRangeSelectTreeDataValues",params:[s.multiRangeSelectTreeDataValues.path,s.multiRangeSelectTreeDataValues.ranges]}),o);var c}function ub(e){Qv.util=e.data("matrix").util,e.data("q",Qv),e.formatter("q-number",Pv),e.formatter("q-time",Gv)}function hb({layout:e,path:t}){const n=wx(e||{},t.split("/").join("."));if(!n)return!1;const{qIsOneAndOnlyOne:i=!1}=n;return i}function db({brush:e,colorField:t,legendAlias:n,useLegendCube:i=!1}){!t||/qAttrDimInfo/.test(t)?(e.removeKeyAlias("attrDim/qDimensionInfo/0"),n&&e.removeKeyAlias(n),e.addKeyAlias("attrDim/qDimensionInfo/0",`qHyperCube/${t}`)):i&&e.addKeyAlias(n,`qHyperCube/${t}`)}ub.qBrushHelper=cb,ub.selections=cb;const fb="Shift";const pb=(e,t)=>t[e]?pb(e+1,t):e,gb=(e,t)=>{const n=t.reduce((e,t)=>(e[t]=!0,e),{});return e.reduce((e,t,i)=>{const r=pb(i,n);return n[r]=!0,e[i]=r,e},{})};function mb({layout:e,filtered:t={}}={}){const{qDimensionInfo:n=[],qMeasureInfo:i=[]}=e?.qHyperCube||{};return{dimensions:gb(n,t.dimensions||[]),measures:gb(i,t.measures||[])}}function yb({selection:e,fieldMap:t}){const{method:n,params:i}=e;if("selectHyperCubeValues"===n){const e=t.dimensions[i[1]];void 0!==e&&(i[1]=e)}return"selectHyperCubeContinuousRange"===n&&i[1].forEach(e=>{const n=t.dimensions[e.qDimIx];void 0!==n&&(e.qDimIx=n)}),e}const xb=[];let vb=0;const bb=e=>{const t=xb.filter(e=>e.selections?.isActive());t.length&&("Enter"===e.key?t.forEach(e=>e.selections.confirm()):"Escape"!==e.key&&"Esc"!==e.key||t.forEach(e=>e.selections.cancel()))};function wb({selections:e,brush:t,majorScale:n,actions:i,selectionsFn:r}={},{path:o="/qHyperCubeDef"}={}){if(!e)return{layout:()=>{},filteredFields:()=>{},allowSimultaneous:()=>{},release:()=>{}};const s=++vb;let a=null,l={dimensions:[],measures:[]},c=[],u={};e.on=e.on.bind(e),e.isActive=e.isActive.bind(e),e.addListener=e.addListener.bind(e),e.removeListener=e.removeListener.bind(e);const{rangeInterceptor:h,interceptor:d}=function({brush:e,getConfig:t}){return{interceptor:n=>{const i=e.brushes(),{allowSimultaneous:r,layout:o={}}=t();i.forEach(t=>{("range"===t.type||n[0]?.key&&n[0]?.key!==t.id&&0!==r.indexOf(n[0]?.key))&&e.clear([])});const s=n.filter(e=>-2!==e.value);if(s.length>1){const e=function({layout:e={},values:t=[]}){if(!t?.length)return[];const n=Array.from(new Set(t.map(e=>e.key))),i=[];return n.forEach(n=>{const r=hb({layout:e,path:n}),o=t.filter(e=>e.key===n),s=r?[o.pop()]:o;i.push(...s)}),i.filter(Boolean)}({layout:o,values:s});return e}return s},rangeInterceptor:n=>{const i=e.brushes(),{allowSimultaneous:r}=t();return i.filter(e=>"value"===e.type).length?(e.clear([]),n):(i.forEach(t=>{const i=t.id===n[0].key||r.includes(t.id)&&r.includes(n[0].key);"range"!==t.type||i||e.clear([])}),n)}}}({brush:t,getConfig:()=>({layout:a,allowSimultaneous:c})});t.intercept("set-ranges",h),t.intercept("toggle-ranges",h),t.intercept("toggle-values",d),t.intercept("set-values",d),t.intercept("add-values",d),t.on("start",()=>e.begin(o));const f={activate:()=>{},deactivated:()=>t.end(),cleared:()=>t.clear(),canceled:()=>t.end()};var p,g;p=e,g=f,Object.keys(g).forEach(e=>{p.on(e,g[e])});const m=n?.max?.();return i?.select?(i.select.on("start",(...e)=>{t.start(),"function"==typeof i.select.getBrushOptions&&(u=i.select.getBrushOptions(...e))}),i.select.on("end",()=>{const n=r(t,u,a),o=mb({layout:a,filtered:l});n.forEach(t=>{const n=yb({selection:t,fieldMap:o});!function(e,t,n){if(!t||void 0===n||"selectHyperCubeContinuousRange"!==e.method)return;const{params:i}=e;if(!i||!i[1]||!i[1][0])return;const{qDimIx:r,qRange:o}=i[1][0];"undefined"!==r&&o&&!1===o.qMaxInclEq&&o.qMax>=n&&(o.qMaxInclEq=!0)}(n,i.select.brushSelectionIncludeMax,m),e.select(n)})})):t.on("update",()=>{const n=r(t,u,a),i=mb({layout:a,filtered:l});n.forEach(t=>{e.select(yb({selection:t,fieldMap:i}))})}),0===xb.length&&document.addEventListener("keyup",bb),xb.push({key:s,selections:e}),{layout:e=>{a=e},filteredFields:e=>{l=e},allowSimultaneous:e=>{c=e},release:()=>{a=null;const t=xb.indexOf(xb.filter(e=>e.key===s)[0]);-1!==t&&xb.splice(t,1),xb.length||document.removeEventListener("keyup",bb),((e,t)=>{Object.keys(t).forEach(n=>{e.removeListener(n,t[n])})})(e,f)}}}function kb({chart:e,document:t,selectionInfo:n,eventName:i,componentName:r,brushName:o="selection",emit:s="rangeClear"}){const a=n.event===i,l=t.querySelector(`[data-key='${r}-edge-0']`);if(a||!l)return!1;const c=e.component(r);return!!c&&(c.emit(s),"string"==typeof o&&e.brush(o).clear(),c)}const _b=({chart:e,document:t,selections:n,selectionInfo:i,...r})=>{r.clearDiscrete(),r.clearContinuous(),r.clearMinor(),r.clearRange(),r.clearTap(),r.clearLegend()};function Mb({lasso:e}){e?.active?.()&&e?.action(!1)}function Sb({chart:e,selectionInfo:t,selectionActions:n,actions:i={},selections:r,selectionEvents:o}){if(!1===n||!1===o)return()=>{};const{reset:s=Mb,clear:a}=n,l=!1!==a&&function({clear:e=_b,selections:t,selectionInfo:n,chart:i}){return({cleared:r}={})=>{const o={selections:t,selectionInfo:n,chart:i,document:document,cleared:r};return e({clearDiscrete:(e={})=>function({selectionInfo:e,chart:t,document:n,eventName:i="discreteRange",componentName:r="discrete-range-brush",cleared:o=!1,brushName:s}){return kb({selectionInfo:e,chart:t,document:n,eventName:o?void 0:i,componentName:r,emit:"areaClear",brushName:s})}({...o,...e}),clearContinuous:(e={})=>function({selectionInfo:e,chart:t,document:n,eventName:i="continuousRange",componentName:r="continuous-range-brush",cleared:o=!1,brushName:s}){return kb({selectionInfo:e,chart:t,document:n,eventName:o?void 0:i,componentName:r,brushName:s})}({...o,...e}),clearMinor:(e={})=>function({selectionInfo:e,chart:t,document:n,componentName:i="minor-range-brush",eventName:r="minorRange",cleared:o=!1,brushName:s=!1}){const a=kb({selectionInfo:e,chart:t,document:n,eventName:o?void 0:r,componentName:i,brushName:s});if(!a)return;const{scale:l,brush:c}=a.settings.settings,u=t.scale(l).data().fields.map(e=>e.id()),h=t.brush(c),d=h.brushes().filter(e=>"range"===e.type&&u.some(t=>t===e.id));h&&d.length&&d.forEach(e=>{h.removeRanges(e.brush.ranges().map(t=>({key:e.id,range:t})))})}({...o,...e}),clearRange:(e={})=>function({selectionInfo:e,chart:t,document:n,selections:i,eventName:r="xAxis",cleared:o=!1}){kb({selectionInfo:e,chart:t,document:n,eventName:o?void 0:r,componentName:`${r}-range-brush`,emit:"areaClear",brushName:!1})&&i.clear()}({...o,...e}),clearTap:(e={})=>function({chart:e,selectionInfo:t,selections:n,events:i=["tap"],brushNames:r=[]}){if(!t||!i.includes(t.event))return;const{currentComponent:o,previousComponent:s}=t;s!==o&&(n.clear(),r.forEach(t=>e.brush(t).end()))}({...o,...e}),clearLegend:(e={})=>function({selectionInfo:e,chart:t,document:n,selections:i,eventName:r="legendRange",componentName:o="legend-range-brush",cleared:s=!1,brushName:a=!1}){kb({selectionInfo:e,chart:t,document:n,eventName:s?void 0:r,componentName:o,brushName:a})&&i.clear()}({...o,...e}),...o})}}({clear:a,selections:r,selectionInfo:t,chart:e}),c=function({chart:e,actions:t,reset:n,clear:i}){let r=!1;const o={deactivated(e){const{lasso:i=!1}=t||{};n({e:e,lasso:i})},canceled(r){const{lasso:o=!1}=t||{};n({e:r,lasso:o}),i({e:r,chart:e,document:document})},cleared(t){r||(r=!0,i({e:t,chart:e,document:document,cleared:!0}),r=!1)}};return!1===n&&delete o.deactivated,!1===i&&delete o.cleared,!1===n&&!1===i&&delete o.canceled,o}({chart:e,clear:l,reset:s,actions:i}),u={};Object.entries(c).forEach(([e,t])=>{u[e]=((e,t)=>t?n=>t({event:n,defaultFunc:e}):e)(t,o[e])});const h=function({selectionEvents:e,selections:t,selectionInfo:n,clear:i,chart:r,document:o}){const{start:s}=e,a={selections:t,selectionInfo:n,chart:r,document:o},l=e=>Object.assign(n,e||{}),c=({event:e,components:t})=>()=>(({selectionInfo:e={},setSelectionInfo:t,clear:n,event:i,components:r=[]})=>{t({...e,event:i,components:r.map(e=>e.key).filter(Boolean)}),n()})({event:e,components:t,clear:i,selectionInfo:n,setSelectionInfo:l});return"function"==typeof s?(e,t=[])=>{s({defaultFunc:c({event:e,components:t}),setSelectionInfo:l,clear:i,...a,event:e,components:t})}:(e,t=[])=>{c({event:e,components:t})()}}({selectionEvents:o,selections:r,selectionInfo:t,clear:l,chart:e,document:document});return i?.select?.on("start",h),Object.entries(u).forEach(([e,t])=>{r?.on(e,t)}),function(){i?.select?.removeListener("start",h),Object.entries(u).forEach(([e,t])=>{r?.removeListener(e,t)})}}const Rb=[{key:"qHyperCube/qDimensionInfo/0:numeric",includeMax:!1}];function Cb({chart:e,actions:t,selections:n,picassoQ:i,config:r}){const{allowSimultaneous:o=!1,majorScale:s,selectionActions:{clear:a,reset:l}={},selectionEvents:c={deactivated:void 0,canceled:void 0,cleared:void 0,start:void 0},brushEvents:u={},brushName:h="selection",brushMaxListeners:d=20,brushRanges:f=!1,interceptors:p={},selectionsFn:g=i.selections}=r,m=e.brush(h);if("number"==typeof d&&m.setMaxListeners(d),f){const e=!0===f?Rb:f;m.configure({ranges:e})}const y={canSelect:!0,getIsSelectionLocked:!1,isInnerDimensionLocked:!1,lockedDimensions:[],singleSelectIndex:0,selectionInfo:{colorField:void 0,components:[],event:void 0,currentComponent:void 0,previousComponent:void 0}},x=wb({brush:m,majorScale:s,actions:t,selections:n,selectionsFn:g});!function({brush:e,interceptors:t={}}){Object.entries(t).forEach(([t,n])=>{(Array.isArray(n)?n:[n]).forEach(n=>{e.intercept(t,n)})})}({brush:m,interceptors:p});const v=function({chart:e,selectionActions:t,brush:n,actions:i,selectionInfo:r,selections:o,selectionEvents:s,brushEvents:a}){const l=function({brush:e,chart:t,selectionInfo:n,brushEvents:i={}}){const r=Object.entries(i).map(([i,r])=>{const o=()=>r({chart:t,selectionInfo:n});return e.on(i,o),[i,o]});return function(){r.forEach(([t,n])=>{e.removeListener(t,n)})}}({brush:n,chart:e,selectionInfo:r,brushEvents:a}),c=Sb({chart:e,selectionInfo:r,selectionActions:t,actions:i,selections:o,selectionEvents:s}),u=function({actions:e}){if(!e?.lasso)return()=>{};let t=!1;const n=n=>{t||n.key!==fb||(e.lasso.action(!0),t=!0)},i=n=>{n.key===fb&&(e.lasso.action(!1),t=!1)};return document.addEventListener("keydown",n),document.addEventListener("keyup",i),function(){document.removeEventListener("keydown",n),document.removeEventListener("keyup",i)}}({actions:i});return function(){l(),c(),u()}}({chart:e,brush:m,actions:t,selections:n,selectionInfo:y.selectionInfo,selectionActions:{clear:a,reset:l},selectionEvents:c,brushEvents:u});if(o){const e=!0===o?[...Array(15)].map((e,t)=>`qHyperCube/qMeasureInfo/${t}`):o;x.allowSimultaneous(e)}return{unbindEvents:v,state:y,picassoSelections:x,brush:m}}function Nb({chart:e,selections:t,actions:n=!1,config:i={}}){const{unbindEvents:r,state:o,picassoSelections:s,brush:a}=Cb({chart:e,actions:n,selections:t,picassoQ:ub,config:i}),{custom:l={},legendAlias:c,setBrushAliases:u=db}=i;return{getIsDimensionLocked:(e=0)=>o.lockedDimensions[e],getIsSelectionLocked:(e=[])=>t?.isLocked?.()??function(e=[]){return!!e?.length&&e.filter(e=>"object"==typeof e.data&&Array.isArray(e.data.fields)).every(e=>e.data.fields.every(e=>{const t=e.raw();return!(!t.qLocked&&t.qCardinal)}))}(e),getIsSingleSelect:(e=o.singleSelectIndex)=>o.singleSelectDimensions[e],getCanSelect:()=>o.canSelect,getSelectionsObject:()=>t,getSelectionInfo:()=>o.selectionInfo,setLayout:e=>{const n=function({selections:e,picassoSelections:t,layout:n}){const i={lockedDimensions:[],singleSelectDimensions:[]};e?.isModal?.()&&e.confirm(),t.layout(n);const{qDimensionInfo:r=[]}=n?.qHyperCube??{};return i.lockedDimensions=r.map(e=>!!e.qLocked),i.singleSelectDimensions=r.map((e,t)=>hb({layout:n,path:`qHyperCube/qDimensionInfo/${t}`})),i.singleSelectIndex=function(e){const{qDimensionInfo:t=[]}=e?.qHyperCube||{},n=t.map((e,t)=>!(e.qLocked||e.qCardinalities?.qHypercubeCardinal<=1)&&t).filter(e=>"number"==typeof e);return n[0]??Math.max(t.length-1,0)}(n),i.canSelect=0===r.length||r.some(e=>!e.qLocked),i.dimensionLocked=!!r[0]?.qLocked,i}({selections:t,picassoSelections:s,layout:e});Object.assign(o,n)},setFilteredFields:e=>{s.filteredFields(e)},setBrushAliases:({colorField:e,useLegendCube:t=!1,...n})=>{const i={useLegendCube:t,colorField:e,brush:a,legendAlias:c,...n};u({...i,defaultFunc:()=>db(i)})},destroy:()=>{r(),s.release()},custom:{...l}}}const Db="'Source Sans Pro', 'Arial', 'sans-serif'",qb="#333333",Eb="#595959",zb="#737373",Ab="#cccccc",Ob="#e6e6e6";function Tb(e){const t={};return[...e,["","","color"],["object","","fontFamily"],["object","axis.label.name","color",Eb],["object","axis.label.name","fontFamily",Db],["object","axis.label.name","fontSize","12px"],["object","axis.line.major","color",Ab],["object","axis.line.minor","color",Ob],["object","axis.title","color"],["object","axis.title","fontFamily",Db],["object","axis.title","fontSize","13px"],["object","grid.line.highContrast","color",Ob],["object","grid.line.major","color",Ab],["object","grid.line.minor","color",Ob],["object","label.value","color",Eb],["object","label.value","fontFamily",Db],["object","label.value","fontSize","12px"],[!1,"label.value","darkColor",Eb],[!1,"label.value","lightColor",Ob],["object","outOfRange","color","#999"],["object","legend.title","color",qb],["object","legend.title","fontFamily",Db],["object","legend.title","fontSize","15px"],["object","legend.label","color",Eb],["object","legend.label","fontFamily",Db],["object","legend.label","fontSize","13px"],["object","referenceLine.label.name","color",qb],["object","referenceLine.label.name","fontFamily",Db],["object","referenceLine.label.name","fontSize","12px"],["object","referenceLine.outOfBounds","color",Ob],["object","referenceLine.outOfBounds","fontFamily",Db],["object","referenceLine.outOfBounds","fontSize","12px"],["object","referenceLine.outOfBounds","backgroundColor",zb,e=>"transparent"===e?zb:e]].reduce((e,n)=>{const i=`${n[0]}-${n[1]}-${n[2]}}`;return t[i]||(t[i]=!0,e.push(n)),e},[]).sort((e,t)=>(e[0].split?e[0].split(".").length:0)-(t[0].split?t[0].split(".").length:0))}const Ib="object",jb=e=>e;function Pb({theme:e,id:t,transform:n,extend:i,matrix:r}){const o={},s=n.reduce((e,t)=>{const[n,i]=t;return e[n]=i,e},{});return r.forEach(n=>{const[i,r,a,l,c=e=>e]=n,u=function({theme:e,base:t,path:n,attribute:i,defaultValue:r}){if(!e||!1===t)return r;const o=e.getStyle(t,n,i);return void 0===o?r:o}({theme:e,base:i===Ib&&t?`${Ib}.${t}`:i,path:r,attribute:a,defaultValue:l}),h=(s[`${r}.${a}`]||jb)(c(u));_x(o,[r,a].filter(Boolean).join("."),h)}),i.forEach(e=>{const[t,n]=e;_x(o,t,n)}),o}function Fb(e,t,n){const i=`${e}.fontFamily`,r=`${e}.fontSize`;return{fontFamilyItem:{component:"dropdown",ref:i,options:()=>t.getOptions(i),defaultValue:()=>t.getDefaultValue(i)},fontWrapperItem:{component:"inline-wrapper",items:{fontSizeItem:{component:"dropdown",ref:r,options:()=>t.getOptions(r),defaultValue:()=>t.getDefaultValue(r)},fontColorItem:{component:"color-picker",width:!1,ref:`${e}.color`,defaultValue:()=>({color:n.getStyle("object.funnelChart",e,"color")})}}}}}function Lb(e,t,n){const i=function({theme:e,translator:t,config:n={}}){const{id:i,paths:r}=function({config:e={}}){const{id:t,paths:n}=e;return{id:void 0===t?_m:`${_m}.${t}`,paths:Array.isArray(n)?n:[]}}({config:n}),o={};r.forEach(n=>{const r=n.split(".");zm(r);let s=o;for(let o=0;o<r.length;o++){const a=r[o];o===r.length-1?s[a]=qm({theme:e,translator:t,id:i,path:n}):void 0===s[a]&&(s[a]={}),s=s[a]}});const s=e=>{const t=e.split(".");zm(t);let n=o;for(let i=0;i<t.length;i++){const r=t[i];if(void 0===n[r])throw new Error(`font-resolver: Path '${e}' could not be resolved.`);n=n[r]}return n};return o.getDefaultValue=e=>s(e).getDefaultValue(),o.getOptions=e=>s(e).getOptions(),o}({theme:e,translator:n,config:{id:"funnelChart",paths:["axis.title","axis.label.name","label.value"]}});return{component:"styling-panel",show:!0,chartType:"funnelchart",translation:"LayerStyleEditor.component.styling",chartTitle:"Object.FunnelChart",subtitle:"LayerStyleEditor.component.styling",useGeneral:!0,useBackground:!0,items:{axisTitleSection:{component:"panel-section",label:"Dimension title",items:{dimensionTitleItems:{component:"items",ref:"components",key:"axis",items:Fb("axis.title",i,e)}}},labelNameSection:{component:"panel-section",label:"Dimension value label",items:{dimensionTitleItems:{component:"items",ref:"components",key:"axis",items:Fb("axis.label.name",i,e)}}},labelValueSection:{component:"panel-section",label:"Value Label",items:{labelItems:{component:"items",ref:"components",key:"label",items:{...Fb("label.value",i,e),contrastColor:{component:"checkbox",type:"boolean",ref:"label.value.useContrastColor",translation:"properties.dataPoints.valuelabel.contrast",defaultValue:!0}}}}}}}}const $b={uses:"sorting"},Bb=(e,t,n)=>{const i=n?.sense?.theme;return{uses:"settings",items:{presentation:{type:"items",label:"Presentation",grouped:!0,items:{stylingPanel:Lb(i,0,e),funnelmode:{ref:"funnel.mode",label:"Funnel Mode",type:"string",component:"dropdown",options:[{value:"AREA",label:"Area"},{value:"HEIGHT",label:"Height"},{value:"WIDTH",label:"Width"},{value:"ORDER",label:"Ordering"}],defaultValue:"WIDTH"},dimensionTitle:{ref:"showDimensionTitle",type:"boolean",component:"switch",label:"Dimension title",defaultValue:!0,options:[{value:!0,label:"Auto"},{value:!1,label:"Off"}]},valuesAuto:{ref:"dataPoint.auto",type:"boolean",label:"Value labels",component:"switch",defaultValue:!0,options:[{value:!0,label:"Auto"},{value:!1,label:"Custom"}]},labelMode:{ref:"dataPoint.labelMode",type:"string",component:"dropdown",options:[{value:"none",label:"None"},{value:"share",label:"Share"},{value:"value",label:"Values"}],defaultValue:"share",show:e=>!e.dataPoint.auto}}},colorsAndLegend:{uses:"colorsAndLegend",translation:"Colors",items:{colors:{items:{colorByLabel:{show:!1},expressionLabel:{show:!1}}},legend:{show:!1}}}}}},Hb={uses:"data",items:{dimensions:{uses:"dimensions",items:{others:{items:{suppressOther:{defaultValue:!0,show:!1}}}},disabledRef:""},measures:{uses:"measures",disabledRef:""}}};function Wb({translator:e,flags:t,anything:n}){return{type:"items",component:"accordion",items:{data:Hb,sorting:$b,settings:Bb(e,0,n)}}}function Vb(e){return{definition:Wb(e),support:{export:!0,exportData:!0,snapshot:!0,viewData:!1},importProperties:null,exportProperties:null}}const Ub=[{path:"/qHyperCubeDef",dimensions:{min:1,max:1,description:()=>"Segments"},measures:{min:1,max:1,description(e){switch(e.funnel.mode){case"WIDTH":return"Width";case"AREA":return"Area";case"HEIGHT":return"Height";case"ORDER":return"Order";default:return""}},added(e,t){2===t.qHyperCubeDef.qInterColumnSortOrder.length&&1!==t.qHyperCubeDef.qInterColumnSortOrder[0]&&(t.qHyperCubeDef.qInterColumnSortOrder=[1,0])}}}];function Yb(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Kb,Xb;var Gb=function(){if(Xb)return Kb;Xb=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,r=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===t.call(e)},o=function(n){if(!n||"[object Object]"!==t.call(n))return!1;var i,r=e.call(n,"constructor"),o=n.constructor&&n.constructor.prototype&&e.call(n.constructor.prototype,"isPrototypeOf");if(n.constructor&&!r&&!o)return!1;for(i in n);return void 0===i||e.call(n,i)},s=function(e,t){n&&"__proto__"===t.name?n(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},a=function(t,n){if("__proto__"===n){if(!e.call(t,n))return;if(i)return i(t,n).value}return t[n]};return Kb=function e(){var t,n,i,l,c,u,h=arguments[0],d=1,f=arguments.length,p=!1;for("boolean"==typeof h&&(p=h,h=arguments[1]||{},d=2),(null==h||"object"!=typeof h&&"function"!=typeof h)&&(h={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)i=a(h,n),h!==(l=a(t,n))&&(p&&l&&(o(l)||(c=r(l)))?(c?(c=!1,u=i&&r(i)?i:[]):u=i&&o(i)?i:{},s(h,{name:n,newValue:e(p,u,l)})):void 0!==l&&s(h,{name:n,newValue:l}));return h},Kb}(),Jb=Yb(Gb),Zb={dataRelatedPropertiesPaths:["qHyperCube.qGrandTotalRow","qHyperCube.qHasOtherValues","qHyperCube.qSize","qHyperCube.qDimensionInfo[].qAttrDimInfo","qHyperCube.qDimensionInfo[].qAttrExprInfo","qHyperCube.qDimensionInfo[].qCardinalities","qHyperCube.qDimensionInfo[].qMax","qHyperCube.qDimensionInfo[].qMin","qHyperCube.qDimensionInfo[].qStateCounts","qHyperCube.qMeasureInfo[].qApprMaxGlyphCount","qHyperCube.qMeasureInfo[].qAttrExprInfo","qHyperCube.qMeasureInfo[].qMax","qHyperCube.qMeasureInfo[].qMin","qHyperCube.qMeasureInfo[].qTrendLines","qHyperCube.qTreeNodesOnDim","qSelectionInfo","plugins[].validMeasureValue","plugins[].labelBackgroundColor","plugins[].labelColor","plugins[].hasBackground","plugins[].maxLabelWidth","plugins[].points[].validMeasureValue","plugins[].points[].labelBackgroundColor","plugins[].points[].labelColor","plugins[].points[].hasBackground","plugins[].points[].maxLabelWidth"]};function Qb(e){const{qHyperCube:t,...n}=e,{qAxisData:i,qDataPages:r,qStackedDataPages:o,qTreeDataPages:s,...a}=t,l=Jb(!0,{},{...n,qHyperCube:{...a}}),{dataRelatedPropertiesPaths:c}=Zb;function u(e,t){const n=t.indexOf("[]");if(-1===n)return void(void 0!==wx(e,t)&&_x(e,t,void 0));const i=t.substring(0,n),r=t.substring(n+2),o=r.startsWith(".")?r.substring(1):r;wx(e,i,[]).forEach(e=>{o&&u(e,o)})}return c.forEach(e=>{u(l,e)}),l}var ew={axes:{trackBy:function({isTime:e,isContinuous:t,isMeasure:n,isMajor:i}){return r=>{if(e||t||n){if("line"===r.type)return r.tickValue??"axis";if("text"===r.type)return`${r.tickValue} ${r.text}`;if("container"===r.type){const e=r.children.filter(e=>"text"===e.type).map(e=>e.text);return`${r.data.value} ${e.join("")}`}return Math.random()}if(i){if("line"===r.type&&void 0===r.tickValue)return"axis";const e=r.transform&&r.transform.match(/rotate/gi)?"rotated":"horizontal";return`${r.data.group?`${r.data.group.value} `:""}${r.data.value} ${r.text} ${e}`}return Math.random()}},compensateForLayoutChanges:function({isMeasure:e,isTime:t,isContinuous:n,isHorizontal:i,dock:r}){return({currentNodes:o,currentRect:s,previousRect:a})=>{const l=s.x-a.x,c=s.y-a.y,u=s.width-a.width,h=s.height-a.height;e?("left"===r&&o.forEach(e=>{"line"===e.type?(e.x1+=u,e.x2+=u):"text"===e.type&&(e.x+=u)}),"left"!==r&&"right"!==r||o.forEach(e=>{"line"===e.type&&(e.x1===e.x2?(e.y1=s.y,e.y2=e.y1+s.height):(Math.round(e.y1)<s.y||e.y1>s.y+s.height)&&(e.strokeWidth=0)),"text"===e.type&&(e.y<s.y||e.y>s.y+s.height)&&(e.fontSize="1px","#"===e.fill?.[0]&&(e.fill=`${e.fill.slice(0,1)}00${e.fill.slice(1)}`))}),"top"!==r&&"bottom"!==r||o.forEach(e=>{"line"===e.type&&(e.y1===e.y2?(e.x1=s.x,e.x2=e.x1+s.width):(Math.round(e.x1)<s.x||e.x1>s.x+s.width)&&(e.strokeWidth=0)),"text"===e.type&&(e.x<s.x||e.x>s.x+s.width)&&(e.fontSize="1px","#"===e.fill?.[0]&&(e.fill=`${e.fill.slice(0,1)}00${e.fill.slice(1)}`))})):t?o.forEach(e=>{"line"===e.type?e.y1===e.y2?e.x2+=u:e.x1===e.x2&&(e.x1-=l,e.x2-=l):"text"===e.type&&(e.x-=l)}):n||i?o.forEach(e=>{"line"===e.type&&e.y1===e.y2&&(e.x1+=l,e.x2+=l+u)}):o.forEach(e=>{"line"===e.type&&e.x1===e.x2&&(e.y1+=c,e.y2+=c+h)})}}},bars:{trackBy:function(e){return e.data.typeIndex?`${e.data.value} ${e.data.typeIndex.value}`:e.data.measureIndex?`${e.data.value} ${e.data.measureIndex.value}`:e.data.group?`${e.data.value} ${e.data.group.value}`:e.data.stack?`${e.data.value} ${e.data.stack.value}`:`${e.data.value}`},compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const i=t.x-n.x,r=t.y-n.y;0===i&&0===r||e.forEach(e=>{e.children&&e.children.length>0&&e.children.forEach(e=>{void 0!==e.x&&void 0!==e.y?(e.x-=i,e.y-=r):e.transform=`translate(${-i}, ${-r})`})})}},barOobs:{compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const i=t.x-n.x;0===t.y-n.y&&0===i||e.forEach(e=>{e.children&&e.children.length>0&&e.children.forEach(e=>{e.opacity=0})})}},labels:{trackBy:function(e){if("rect"===e.type)return"-3"===e.data?Math.random():`${e.type} ${e.data} ${e.rotation}`;const t=e.transform&&e.transform.match(/rotate/gi)?"rotated":"horizontal";return`${e.type} ${e.data} ${e.text} ${t}`},compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const i=t.x-n.x,r=t.y-n.y;0===i&&0===r||e.forEach(e=>{e.transform&&e.transform.match(/rotate\(-90/gi)?(e.x+=r,e.y-=i):(e.x-=i,e.y-=r)})},linkData:function(e){return e.data.measureIndex?`${e.data.value} ${e.data.measureIndex.value}`:e.data.group?`${e.data.value} ${e.data.group.value}`:e.data.stack?`${e.data.value} ${e.data.stack.value}`:`${e.data.value}`}},lines:{trackBy:function(e){return"line"===e.type?e.value??Math.random():"path"===e.type?`${e.generatorType} ${e.layerObj.id} ${e.data.source.key}`:Math.random()},compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const i=t.x-n.x,r=t.y-n.y;e.forEach(e=>{if(void 0!==e.x1&&void 0!==e.y1)e.y1===e.y2?(e.x2=e.x1+t.width,e.y1-=r,e.y2-=r):e.x1===e.x2&&(e.y2=e.y1+t.height,e.x1-=i,e.x2-=i);else{const t="x"===e.major.p?i/e.major.size:r/e.major.size,n="y"===e.minor.p?r/e.minor.size:i/e.minor.size;e.points.forEach(e=>{e.modified||(e.major-=t,e.minor-=n,e.minor0-=n,e.modified=!0)})}})}},lineOobs:{compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const i=t.x-n.x;0===t.y-n.y&&0===i||e.forEach(e=>{e.opacity=0})}},markers:{trackBy:function(e){return e.data.line?`${e.data.line.value} ${e.data.major.value}`:`${e.data.major.value}`},compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const i=t.x-n.x,r=t.y-n.y;0===i&&0===r||e.forEach(e=>{switch(e.type){case"circle":e.cx-=i,e.cy-=r;break;case"rect":e.x-=i,e.y-=r;break;case"path":e.transform=`translate(${-i}, ${-r})`}})}},points:{trackBy:function(e){return e.data.line?`${e.data.line.value} ${e.data.major.value}`:`${e.data.major.value}`},compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const i=t.x-n.x,r=t.y-n.y;0===i&&0===r||e.forEach(e=>{"image"===e.type?(e.x-=i,e.y-=r):(e.cx-=i,e.cy-=r)})}},refLineLabels:{trackBy:function(e){if(void 0!==e.value){if("rect"===e.type)return`${e.value}`;if("text"===e.type)return`${e.value} ${e.text}`}return Math.random()},compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const i=t.x-n.x,r=t.y-n.y,o=t.width-n.width,s=t.height-n.height;let a=-i,l=-r;e.forEach(e=>{switch(e.dock){case"right":i>0&&(a=t.width);break;case"left":o<0&&(a=-n.width);break;case"top":s<0&&(l=-n.height);break;case"bottom":r>0&&(l=t.height)}switch(e.type){case"text":case"rect":e.x+=a,e.y+=l;break;case"circle":e.cx+=a,e.cy+=l;break;case"path":e.transform=`translate(${a}, ${l})`}})}},shadowBars:{trackBy:function(){return Math.random()}},cacheProperties:function({viewCache:e,layout:t}){const n=Qb(t);e.set("dataIndependentProperties",JSON.stringify(n))},propertiesHaveChanged:function({viewCache:e,layout:t}){const n=Qb(t);return e.get("dataIndependentProperties")!==JSON.stringify(n)},nonUpdatingNode:{trackBy:function(){return Math.random()}}};function tw(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function nw(e,t){var n=Object.create(e.prototype);for(var i in t)n[i]=t[i];return n}function iw(){}[["FULL",{width:550,height:450}],["MEDIUM",{width:400,height:220}],["SMALL",{width:300,height:150}],["XSMALL",{width:150,height:75}],["SPARK",{width:0,height:0}]].forEach(([e,{width:t,height:n}])=>{});var rw=.7,ow=1/rw,sw="\\s*([+-]?\\d+)\\s*",aw="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",lw="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",cw=/^#([0-9a-f]{3,8})$/,uw=new RegExp(`^rgb\\(${sw},${sw},${sw}\\)$`),hw=new RegExp(`^rgb\\(${lw},${lw},${lw}\\)$`),dw=new RegExp(`^rgba\\(${sw},${sw},${sw},${aw}\\)$`),fw=new RegExp(`^rgba\\(${lw},${lw},${lw},${aw}\\)$`),pw=new RegExp(`^hsl\\(${aw},${lw},${lw}\\)$`),gw=new RegExp(`^hsla\\(${aw},${lw},${lw},${aw}\\)$`),mw={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function yw(){return this.rgb().formatHex()}function xw(){return this.rgb().formatRgb()}function vw(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=cw.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?bw(t):3===n?new _w(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?ww(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?ww(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=uw.exec(e))?new _w(t[1],t[2],t[3],1):(t=hw.exec(e))?new _w(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=dw.exec(e))?ww(t[1],t[2],t[3],t[4]):(t=fw.exec(e))?ww(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=pw.exec(e))?Dw(t[1],t[2]/100,t[3]/100,1):(t=gw.exec(e))?Dw(t[1],t[2]/100,t[3]/100,t[4]):mw.hasOwnProperty(e)?bw(mw[e]):"transparent"===e?new _w(NaN,NaN,NaN,0):null}function bw(e){return new _w(e>>16&255,e>>8&255,255&e,1)}function ww(e,t,n,i){return i<=0&&(e=t=n=NaN),new _w(e,t,n,i)}function kw(e){return e instanceof iw||(e=vw(e)),e?new _w((e=e.rgb()).r,e.g,e.b,e.opacity):new _w}function _w(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}function Mw(){return`#${Nw(this.r)}${Nw(this.g)}${Nw(this.b)}`}function Sw(){const e=Rw(this.opacity);return`${1===e?"rgb(":"rgba("}${Cw(this.r)}, ${Cw(this.g)}, ${Cw(this.b)}${1===e?")":`, ${e})`}`}function Rw(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Cw(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Nw(e){return((e=Cw(e))<16?"0":"")+e.toString(16)}function Dw(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ew(e,t,n,i)}function qw(e){if(e instanceof Ew)return new Ew(e.h,e.s,e.l,e.opacity);if(e instanceof iw||(e=vw(e)),!e)return new Ew;if(e instanceof Ew)return e;var t=(e=e.rgb()).r/255,n=e.g/255,i=e.b/255,r=Math.min(t,n,i),o=Math.max(t,n,i),s=NaN,a=o-r,l=(o+r)/2;return a?(s=t===o?(n-i)/a+6*(n<i):n===o?(i-t)/a+2:(t-n)/a+4,a/=l<.5?o+r:2-o-r,s*=60):a=l>0&&l<1?0:s,new Ew(s,a,l,e.opacity)}function Ew(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}function zw(e){return(e=(e||0)%360)<0?e+360:e}function Aw(e){return Math.max(0,Math.min(1,e||0))}function Ow(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}tw(iw,vw,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:yw,formatHex:yw,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return qw(this).formatHsl()},formatRgb:xw,toString:xw}),tw(_w,function(e,t,n,i){return 1===arguments.length?kw(e):new _w(e,t,n,null==i?1:i)},nw(iw,{brighter(e){return e=null==e?ow:Math.pow(ow,e),new _w(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?rw:Math.pow(rw,e),new _w(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new _w(Cw(this.r),Cw(this.g),Cw(this.b),Rw(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Mw,formatHex:Mw,formatHex8:function(){return`#${Nw(this.r)}${Nw(this.g)}${Nw(this.b)}${Nw(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Sw,toString:Sw})),tw(Ew,function(e,t,n,i){return 1===arguments.length?qw(e):new Ew(e,t,n,null==i?1:i)},nw(iw,{brighter(e){return e=null==e?ow:Math.pow(ow,e),new Ew(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?rw:Math.pow(rw,e),new Ew(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*t,r=2*n-i;return new _w(Ow(e>=240?e-240:e+120,r,i),Ow(e,r,i),Ow(e<120?e+240:e-120,r,i),this.opacity)},clamp(){return new Ew(zw(this.h),Aw(this.s),Aw(this.l),Rw(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Rw(this.opacity);return`${1===e?"hsl(":"hsla("}${zw(this.h)}, ${100*Aw(this.s)}%, ${100*Aw(this.l)}%${1===e?")":`, ${e})`}`}}));const Tw=Math.PI/180,Iw=180/Math.PI,jw=.96422,Pw=.82521,Fw=4/29,Lw=6/29,$w=3*Lw*Lw,Bw=Lw*Lw*Lw;function Hw(e){if(e instanceof Ww)return new Ww(e.l,e.a,e.b,e.opacity);if(e instanceof Gw)return Jw(e);e instanceof _w||(e=kw(e));var t,n,i=Kw(e.r),r=Kw(e.g),o=Kw(e.b),s=Vw((.2225045*i+.7168786*r+.0606169*o)/1);return i===r&&r===o?t=n=s:(t=Vw((.4360747*i+.3850649*r+.1430804*o)/jw),n=Vw((.0139322*i+.0971045*r+.7141733*o)/Pw)),new Ww(116*s-16,500*(t-s),200*(s-n),e.opacity)}function Ww(e,t,n,i){this.l=+e,this.a=+t,this.b=+n,this.opacity=+i}function Vw(e){return e>Bw?Math.pow(e,1/3):e/$w+Fw}function Uw(e){return e>Lw?e*e*e:$w*(e-Fw)}function Yw(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Kw(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Xw(e,t,n,i){return 1===arguments.length?function(e){if(e instanceof Gw)return new Gw(e.h,e.c,e.l,e.opacity);if(e instanceof Ww||(e=Hw(e)),0===e.a&&0===e.b)return new Gw(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*Iw;return new Gw(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new Gw(e,t,n,null==i?1:i)}function Gw(e,t,n,i){this.h=+e,this.c=+t,this.l=+n,this.opacity=+i}function Jw(e){if(isNaN(e.h))return new Ww(e.l,0,0,e.opacity);var t=e.h*Tw;return new Ww(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}tw(Ww,function(e,t,n,i){return 1===arguments.length?Hw(e):new Ww(e,t,n,null==i?1:i)},nw(iw,{brighter(e){return new Ww(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new Ww(this.l-18*(null==e?1:e),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return new _w(Yw(3.1338561*(t=jw*Uw(t))-1.6168667*(e=1*Uw(e))-.4906146*(n=Pw*Uw(n))),Yw(-.9787684*t+1.9161415*e+.033454*n),Yw(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),tw(Gw,Xw,nw(iw,{brighter(e){return new Gw(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new Gw(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return Jw(this).rgb()}}));var Zw,Qw={isDark:function(e){return Xw(e).l<70}};function ek(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}1===(Zw=ek).length&&(Zw=function(e){return function(t,n){return ek(e(t),n)}}(Zw));var tk="$";function nk(){}function ik(e,t){var n=new nk;if(e instanceof nk)e.each(function(e,t){n.set(t,e)});else if(Array.isArray(e)){var i,r=-1,o=e.length;if(null==t)for(;++r<o;)n.set(r,e[r]);else for(;++r<o;)n.set(t(i=e[r],r,e),i)}else if(e)for(var s in e)n.set(s,e[s]);return n}function rk(){}nk.prototype=ik.prototype={constructor:nk,has:function(e){return tk+e in this},get:function(e){return this[tk+e]},set:function(e,t){return this[tk+e]=t,this},remove:function(e){var t=tk+e;return t in this&&delete this[t]},clear:function(){for(var e in this)e[0]===tk&&delete this[e]},keys:function(){var e=[];for(var t in this)t[0]===tk&&e.push(t.slice(1));return e},values:function(){var e=[];for(var t in this)t[0]===tk&&e.push(this[t]);return e},entries:function(){var e=[];for(var t in this)t[0]===tk&&e.push({key:t.slice(1),value:this[t]});return e},size:function(){var e=0;for(var t in this)t[0]===tk&&++e;return e},empty:function(){for(var e in this)if(e[0]===tk)return!1;return!0},each:function(e){for(var t in this)t[0]===tk&&e(this[t],t.slice(1),this)}};var ok=ik.prototype;rk.prototype={constructor:rk,has:ok.has,add:function(e){return this[tk+(e+="")]=e,this},remove:ok.remove,clear:ok.clear,values:ok.keys,size:ok.size,empty:ok.empty,each:ok.each},Jb.bind(null,!0);const sk=[[2,4,6],[2,4],[3]],ak=[,[,,[[1,2]],[[1,2,3],[1,3]],[[1,2,4],[1,4]],[[1,2,4],[1,5]],[[1,2,4,6],[2,4,6],[1,3,6],[1,6]],[[1,2,4,6],[2,4,6],[1,3,6],[1,7]],[[1,2,4,8],[2,4,8],[1,8]],[[1,2,4,8],[2,4,8],[1,3,9],[1,9]],[[1,2,4,6,10],[1,2,4,10],[1,3,10],[3,10],[1,10]]],[,,,[[2,3]],[[2,3,4],[2,4]],[[2,3,4],[2,4],[2,5]],[[2,4,6],[2,6]],[[2,4,6],[2,6],[2,7]],[[2,4,8],[2,8]],[[2,4,8],[2,8],[2,9]],[[2,4,6,10],[2,4,10],[5,10],[3,10]]],[,,,,[[3,4]],[[3,4,5],[3,5]],[[3,4,5,6],[3,6]],[[3,4,5,6],[3,5,7],[3,7]],[[3,4,5,6,8],[3,5,7],[4,8],[3,8]],[[3,4,5,6,8],[3,4,6,9],[3,4,6,8],[3,6,9],[4,8],[3,9]],[[4,6,10],[5,10],[3,10]]],[,,,,,[[4,5]],[[4,5,6],[4,6]],[[4,5,6,7],[4,5,6],[4,6]],[[4,5,6,7,8],[4,5,6,7],[4,6,8],[4,8]],[[4,5,6,7,8],[4,6,9],[4,6,8],[4,8]],[[4,6,10],[5,7,9],[5,10],[4,10]]],[,,,,,,[[5,6]],[[5,6,7],[5,7]],[[5,6,7,8],[5,6,7],[6,8]],[[5,6,7,8,9],[5,6,7,8],[5,7,9],[5,9]],[[6,8,10],[5,10]]],[,,,,,,,[[6,7]],[[6,7,8],[6,8]],[[6,7,8,9],[6,7,8],[6,9]],[[6,7,8,9,10],[6,8,10],[6,10]]],[,,,,,,,,[[7,8]],[[7,8,9],[7,9]],[[7,8,9,10],[8,10],[7,10],[7,9]]],[,,,,,,,,,[[8,9]],[[8,9,10],[8,10]]],[,,,,,,,,,,[[9,10]]]];function lk(e,t,n){const i=e?e.length:0;let r,o=void 0===t?Number.MAX_VALUE:e[0]/t;for(r=1;r<i;r++)o=Math.min(o,e[r]/e[r-1]);void 0!==n&&(o=Math.min(o,n/e[i-1])),e.splice(0,0,o)}function ck(e,t,n){let i;const r=e?e.length:0;for(i=0;i<r;i++)lk(e[i],t,n)}function uk(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?void 0:"svg"}!function(){let e,t;for(ck(sk,1,10),e=0;e<ak.length;e++)if(ak[e])for(t=0;t<ak[e].length;t++)Array.isArray(ak[e][t])&&ck(ak[e][t])}();var hk=class e{constructor(e,t){this._key=e,this._value=t}getKey(){return this._key}getValue(){return this._value}equals(t){return t instanceof e&&(this._key===t._key&&this._value===t._value)}static newInstanceIfNeeded(){let t,n,i=arguments[0];return"string"==typeof arguments[1]?(t=arguments[1],n=i.length):(n=arguments[1],t=arguments[2]),t&&i?(i.length>n&&(i=i.substr(0,n)),new e(i,t)):null}},dk=class e{setValue(e){this._nextMap=null,this._value=e}getNextNode(e){return this._nextMap?this._nextMap[e]:null}put(t,n,i){let r,o;if(t.length===n)return o=this._value,this.setValue(i),o;const s=t.charAt(n);return this._nextMap?(r=this._nextMap[s],r||(r=new e,this._nextMap[s]=r)):(this._nextMap={},r=new e,this._nextMap[s]=r),r.put(t,n+1,i)}get(e,t){if(e.length<=t)return this._value;const n=this.getNextNode(e.charAt(t));return n?n.get(e,t+1):null}getLongestMatch(e,t){if(e.length<=t)return hk.newInstanceIfNeeded(e,this._value);const n=this.getNextNode(e.charAt(t));if(!n)return hk.newInstanceIfNeeded(e,t,this._value);const i=n.getLongestMatch(e,t+1);return i||hk.newInstanceIfNeeded(e,t,this._value)}},fk=class{constructor(){this.clear()}getLongestMatch(e){return this.root&&e?this.root.getLongestMatch(e,0):null}getMaxKeyLength(){return this.maxKeyLen}clear(){this.root=null,this.maxKeyLen=0,this.size=0}put(e,t){this.root||(this.root=new dk);const n=this.root.put(e,0,t);return n||(e.length>this.maxKeyLen&&(this.maxKeyLen=e.length),this.size++,null)}};(()=>{const e=[],t=[],n=new fk;let i,r,o;for(i in e["&quot"]="34",e["&amp"]="38",e["&lt"]="60",e["&gt"]="62",e["&nbsp"]="160",e["&iexcl"]="161",e["&cent"]="162",e["&pound"]="163",e["&curren"]="164",e["&yen"]="165",e["&brvbar"]="166",e["&sect"]="167",e["&uml"]="168",e["&copy"]="169",e["&ordf"]="170",e["&laquo"]="171",e["&not"]="172",e["&shy"]="173",e["&reg"]="174",e["&macr"]="175",e["&deg"]="176",e["&plusmn"]="177",e["&sup2"]="178",e["&sup3"]="179",e["&acute"]="180",e["&micro"]="181",e["&para"]="182",e["&middot"]="183",e["&cedil"]="184",e["&sup1"]="185",e["&ordm"]="186",e["&raquo"]="187",e["&frac14"]="188",e["&frac12"]="189",e["&frac34"]="190",e["&iquest"]="191",e["&Agrave"]="192",e["&Aacute"]="193",e["&Acirc"]="194",e["&Atilde"]="195",e["&Auml"]="196",e["&Aring"]="197",e["&AElig"]="198",e["&Ccedil"]="199",e["&Egrave"]="200",e["&Eacute"]="201",e["&Ecirc"]="202",e["&Euml"]="203",e["&Igrave"]="204",e["&Iacute"]="205",e["&Icirc"]="206",e["&Iuml"]="207",e["&ETH"]="208",e["&Ntilde"]="209",e["&Ograve"]="210",e["&Oacute"]="211",e["&Ocirc"]="212",e["&Otilde"]="213",e["&Ouml"]="214",e["&times"]="215",e["&Oslash"]="216",e["&Ugrave"]="217",e["&Uacute"]="218",e["&Ucirc"]="219",e["&Uuml"]="220",e["&Yacute"]="221",e["&THORN"]="222",e["&szlig"]="223",e["&agrave"]="224",e["&aacute"]="225",e["&acirc"]="226",e["&atilde"]="227",e["&auml"]="228",e["&aring"]="229",e["&aelig"]="230",e["&ccedil"]="231",e["&egrave"]="232",e["&eacute"]="233",e["&ecirc"]="234",e["&euml"]="235",e["&igrave"]="236",e["&iacute"]="237",e["&icirc"]="238",e["&iuml"]="239",e["&eth"]="240",e["&ntilde"]="241",e["&ograve"]="242",e["&oacute"]="243",e["&ocirc"]="244",e["&otilde"]="245",e["&ouml"]="246",e["&divide"]="247",e["&oslash"]="248",e["&ugrave"]="249",e["&uacute"]="250",e["&ucirc"]="251",e["&uuml"]="252",e["&yacute"]="253",e["&thorn"]="254",e["&yuml"]="255",e["&OElig"]="338",e["&oelig"]="339",e["&Scaron"]="352",e["&scaron"]="353",e["&Yuml"]="376",e["&fnof"]="402",e["&circ"]="710",e["&tilde"]="732",e["&Alpha"]="913",e["&Beta"]="914",e["&Gamma"]="915",e["&Delta"]="916",e["&Epsilon"]="917",e["&Zeta"]="918",e["&Eta"]="919",e["&Theta"]="920",e["&Iota"]="921",e["&Kappa"]="922",e["&Lambda"]="923",e["&Mu"]="924",e["&Nu"]="925",e["&Xi"]="926",e["&Omicron"]="927",e["&Pi"]="928",e["&Rho"]="929",e["&Sigma"]="931",e["&Tau"]="932",e["&Upsilon"]="933",e["&Phi"]="934",e["&Chi"]="935",e["&Psi"]="936",e["&Omega"]="937",e["&alpha"]="945",e["&beta"]="946",e["&gamma"]="947",e["&delta"]="948",e["&epsilon"]="949",e["&zeta"]="950",e["&eta"]="951",e["&theta"]="952",e["&iota"]="953",e["&kappa"]="954",e["&lambda"]="955",e["&mu"]="956",e["&nu"]="957",e["&xi"]="958",e["&omicron"]="959",e["&pi"]="960",e["&rho"]="961",e["&sigmaf"]="962",e["&sigma"]="963",e["&tau"]="964",e["&upsilon"]="965",e["&phi"]="966",e["&chi"]="967",e["&psi"]="968",e["&omega"]="969",e["&thetasym"]="977",e["&upsih"]="978",e["&piv"]="982",e["&ensp"]="8194",e["&emsp"]="8195",e["&thinsp"]="8201",e["&zwnj"]="8204",e["&zwj"]="8205",e["&lrm"]="8206",e["&rlm"]="8207",e["&ndash"]="8211",e["&mdash"]="8212",e["&lsquo"]="8216",e["&rsquo"]="8217",e["&sbquo"]="8218",e["&ldquo"]="8220",e["&rdquo"]="8221",e["&bdquo"]="8222",e["&dagger"]="8224",e["&Dagger"]="8225",e["&bull"]="8226",e["&hellip"]="8230",e["&permil"]="8240",e["&prime"]="8242",e["&Prime"]="8243",e["&lsaquo"]="8249",e["&rsaquo"]="8250",e["&oline"]="8254",e["&frasl"]="8260",e["&euro"]="8364",e["&image"]="8365",e["&weierp"]="8472",e["&real"]="8476",e["&trade"]="8482",e["&alefsym"]="8501",e["&larr"]="8592",e["&uarr"]="8593",e["&rarr"]="8594",e["&darr"]="8595",e["&harr"]="8596",e["&crarr"]="8629",e["&lArr"]="8656",e["&uArr"]="8657",e["&rArr"]="8658",e["&dArr"]="8659",e["&hArr"]="8660",e["&forall"]="8704",e["&part"]="8706",e["&exist"]="8707",e["&empty"]="8709",e["&nabla"]="8711",e["&isin"]="8712",e["&notin"]="8713",e["&ni"]="8715",e["&prod"]="8719",e["&sum"]="8721",e["&minus"]="8722",e["&lowast"]="8727",e["&radic"]="8730",e["&prop"]="8733",e["&infin"]="8734",e["&ang"]="8736",e["&and"]="8743",e["&or"]="8744",e["&cap"]="8745",e["&cup"]="8746",e["&int"]="8747",e["&there4"]="8756",e["&sim"]="8764",e["&cong"]="8773",e["&asymp"]="8776",e["&ne"]="8800",e["&equiv"]="8801",e["&le"]="8804",e["&ge"]="8805",e["&sub"]="8834",e["&sup"]="8835",e["&nsub"]="8836",e["&sube"]="8838",e["&supe"]="8839",e["&oplus"]="8853",e["&otimes"]="8855",e["&perp"]="8869",e["&sdot"]="8901",e["&lceil"]="8968",e["&rceil"]="8969",e["&lfloor"]="8970",e["&rfloor"]="8971",e["&lang"]="9001",e["&rang"]="9002",e["&loz"]="9674",e["&spades"]="9824",e["&clubs"]="9827",e["&hearts"]="9829",e["&diams"]="9830",e)"function"!=typeof e[i]&&e.hasOwnProperty(i)&&(t[e[i]]=i);for(r in t)"function"!=typeof t[r]&&t.hasOwnProperty(r)&&(o=t[r].toLowerCase().substr(1),n.put(o,String.fromCharCode(r)))})(),"undefined"!=typeof document&&document.createElement("div");for(let e=0;e<255;e++)e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||e.toString(16);function pk(e){const t=e.node.desc&&e.node.desc.share;return t?e.formatter("share")(t):""}function gk(e){return e.formatter("num")(e.node.data.num.value)}function mk({data:e}){return e?e.label:""}function yk(e){if(e.dataPoint.auto)return pk;switch(e.dataPoint.labelMode){case"share":default:return pk;case"value":return gk;case"none":return null}}function xk(e,t,n,i){const r=i.axis.label.getStyle(),o=i.label.value.getStyle(),s=t.getStyles().label.value;return{type:"labels",key:"funnel-labels",renderer:uk(),layout:{displayOrder:2},settings:{sources:[{component:"fun",selector:".labelLeft",strategy:{type:"rows",settings:{align:0,fill:r.fill,fontSize:parseInt(r.fontSize,10),fontFamily:r.fontFamily,labels:[{label:mk}],linkData:e=>`${e.data.value} ${mk(e)}`}}},{component:"fun",selector:".labelCenter",strategy:{type:"rows",settings:{align:.5,fill:o.useContrastColor?({node:e})=>(e=>Qw.isDark(e.desc.fill)?s.lightColor:s.darkColor)(e):o.fill,fontSize:parseInt(o.fontSize,10),fontFamily:o.fontFamily,labels:[{label:yk(e)}],linkData:t=>"none"===e.dataPoint.labelMode?Math.random():`${t.data.value} ${yk(e)(t)}`}}}]},animations:{enabled:n,trackBy:e=>e.data}}}function vk(e,t){if(!e.showDimensionTitle||!e.qHyperCube.qDimensionInfo[0].qFallbackTitle)return!1;const n=e.qHyperCube.qDimensionInfo[0].qFallbackTitle,i=t.axis.title.getStyle();return{type:"text",key:"dimension-title",renderer:uk(),text:n,layout:{dock:"top"},style:{text:{fill:i.fill,fontSize:i.fontSize,fontFamily:i.fontFamily}}}}function bk({picasso:t}){const n=e.useElement(),i=e.useSelections(),r=e.useModel(),o=e.useApp(),s=e.useTranslator(),a=e.useOptions(),[l,c]=e.useState(),[u,h]=e.useState(),[d,f]=e.useState(),[p,g]=e.useState();return e.useEffect(()=>{const e=function({picasso:e,model:t,app:n,translator:i,layoutService:r,createConfig:o=xx,config:s={},custom:a={}}){const{localeInfo:l,key:c,theme:u,auto:h,definitionPath:d}=s,f=r?.getLayout?.(),p={theme:u,key:c,localeInfo:l,layout:f,hc:r?.getHyperCube?.(),legendProps:r?.getLayoutValue?.("legend"),colorProps:{...r?.getLayoutValue?.("color"),useBaseColors:f?gx(f):void 0}},g=fx({picasso:e,model:t,app:n,translator:i,auto:h});!1!==h&&g.auto(e=>h?h({layout:e,defaultAuto:yx}):yx(e));let m=!1;const y={getColor:()=>g.color(),getPaletteColor:({index:e,color:t})=>g.resolveUIColor({index:e,color:t}),getData:()=>g.data(),getDatumProps:e=>g.datumProps(e),getSnapshotData:()=>g.getSnapshotData(d),getSettingsForMeasure:e=>g.settingsForMeasure(e),getSettings:()=>g.settings(),getLegend:(e,t)=>g.legend(e,t),getScales:()=>g.scales(),getPalettes:()=>g.palettes(),isSelectionLocked:({isMeasureSelectionLocked:e})=>g.isSelectionLocked({isMeasureSelectionLocked:e}),isInitialized:()=>m,custom:{...a},initialize:({createConfig:e=o}={})=>{const t=e({getUseBaseColors:gx}),n=function(e,t={}){return{...e,...t,colorProps:{...e.colorProps,...t.colorProps||{}}}}(p,t);return g.config(n),g.getAuxiliarySettings(d).then(()=>{m=!0})}};return y}({picasso:t,model:r,app:o,translator:s,config:{auto:!1,key:"fill"}});n.style.overflow="hidden";const l=t({renderer:{prio:[a.renderer||"svg"]}}).chart({element:n,data:[],settings:{}}),u=Nb({chart:l,selections:i,config:{selectionActions:!1}});return f(u),h(e),c(l),g(function(){let e={};return{get:t=>e[t],set:(t,n)=>(e[t]=n,n),has:t=>t in e,remove(t){delete e[t]},empty(){e={}}}}()),()=>{u.destroy(),l.destroy()}},[]),[l,u,d,p]}function wk({picasso:t}){const n=e.useStaleLayout(),i=e.useTheme(),r=e.useConstraints(),o=e.useRect(),s=e.usePlugins(),a=e.useAppLayout().qLocaleInfo,[l,c,u,h]=bk({picasso:t}),d=e.useOptions(),f=()=>{const e=l.element.clientWidth!==h.get("width")||l.element.clientHeight!==h.get("height");return!1!==d.chartAnimations&&!e&&!ew.propertiesHaveChanged({viewCache:h,layout:n})},[p]=e.usePromise(()=>{if(!c)return Promise.resolve();const e=function(e){return{layout:e,keys:{SCALE:{FILL:"fill"},COMPONENT:{FUNNEL:"fun",FUNNEL_LABELS:"funnel-labels",DIMENSION_TITLE:"dimension-title"}}}}(n),r=function({picassoInstance:e,plugins:t,pluginArgs:n={}}){const i={initialized:!1,definitions:[]};return{async initialize(){if(i.initialized)return;const r=Promise.all(t.filter(e=>"custom-component"===e.info.type).map(async t=>{if(!t.info.componentName)throw new Error("plugin-service: Custom component is missing componentName");const i=await t.fn({...n});if("object"!=typeof i)throw new Error("plugin-service: Custom component needs to be an object");e.component(t.info.componentName,i)})),o=Promise.all(t.filter(e=>"component-definition"===e.info.type).map(e=>e.fn({...n}))),s=await Promise.all([r,o]);i.initialized=!0,i.definitions.push(...s[1])},extendComponents:e=>i.initialized?(i.definitions.filter(Boolean).forEach(t=>{const[n]=e.filter(e=>e.key&&e.key===t.key);if(n){const e=jm(!0,{},n.brush);jm(!0,n,t),t.brush&&(n.brush=function(e,t){return"object"==typeof e&&Object.keys(e).length?(Array.isArray(t.consume)&&(e.consume=Mx({originalArray:e.consume,newArray:t.consume,matchKey:"context"})),Array.isArray(t.trigger)&&(e.trigger=Mx({originalArray:e.trigger,newArray:t.trigger,matchKey:"on"})),e):t}(e,t.brush))}else e.push(t)}),e):e}}({picassoInstance:t,plugins:s,pluginArgs:e});return Promise.all([c.initialize({createConfig:({getUseBaseColors:e})=>({theme:i,colorProps:{...n.color,useBaseColors:e(n)},layout:n,hc:n.qHyperCube})}),r.initialize()]).then(()=>r)},[n,c]);e.useEffect(()=>{if(!l||!c||!p)return;const e=[{type:"q",key:"qHyperCube",data:n.qHyperCube,config:{localeInfo:a}},...c.getData()],t=function({theme:e,config:t={}}){const{id:n,resolve:i=[],transform:r=[],extend:o=[]}=t,s={theme:e,matrix:Tb(i),styles:void 0};return s.styles=Pb({theme:e,id:n,transform:r,extend:o,matrix:s.matrix}),{getStyles:()=>s.styles,getTheme:()=>s.theme,setTheme:e=>{s.theme=e,s.styles=Pb({theme:e,id:n,transform:r,extend:o,matrix:s.matrix})}}}({theme:i,config:{id:"funnelChart"}}),o=function({layout:e,themeService:t}){const n=t.getStyles(),i=t=>e.components?.find(e=>e.key===t)??void 0;return{axis:{title:{getStyle:()=>({fontFamily:i("axis")?.axis?.title?.fontFamily??n.axis.title.fontFamily,fontSize:i("axis")?.axis?.title?.fontSize??n.axis.title.fontSize,fill:i("axis")?.axis?.title?.color?.color??n.axis.title.color})},label:{getStyle:()=>({fontSize:i("axis")?.axis?.label?.name?.fontSize??n.axis.label.name.fontSize,fontFamily:i("axis")?.axis?.label?.name?.fontFamily??n.axis.label.name.fontFamily,fill:i("axis")?.axis?.label?.name?.color?.color??n.axis.label.name.color})}},label:{value:{getStyle:()=>({fontSize:i("label")?.label?.value?.fontSize??n.label.value.fontSize,fontFamily:i("label")?.label?.value?.fontFamily??n.label.value.fontFamily,fill:i("label")?.label?.value?.color?.color??n.label.value.color,useContrastColor:i("label")?.label?.value?.useContrastColor??!0})}}}}({layout:n,themeService:t}),s=function({layout:e,constraints:t,colorService:n,themeService:i,styleModel:r,pluginService:o,animationsEnabled:s}){const a=function(e){return{...e.getScales()}}(n),l=n.getPalettes(),c=function({layout:e,constraints:t,colorService:n,animationsEnabled:i}){const r=n.getDatumProps(),o=n.getColor();return{type:"funnel",key:"fun",data:{extract:{field:"qDimensionInfo/0",props:{num:{field:"qMeasureInfo/0"},...r}}},brush:t.select||t.active?{}:{trigger:[{contexts:["selection"],data:[""]}],consume:[{context:"selection",filter:e=>"section"===e.tag,style:{inactive:{opacity:.3}}}]},settings:{num:{ref:"num"},fill:o,mode:e.funnel.mode},animations:{enabled:i,isMainComponent:!0,trackBy:e=>`${e.tag}: ${e.data.value}`}}}({layout:e,constraints:t,colorService:n,animationsEnabled:s}),u=[c,xk(e,i,s,r),vk(e,r)];return{palettes:l,scales:a,components:o.extendComponents(u),formatters:{share:{type:"d3-number",format:".1%"},num:{data:{field:"qMeasureInfo/0"}}}}}({layout:n,constraints:r,colorService:c,themeService:t,styleModel:o,pluginService:p,animationsEnabled:f});l.update({data:e,settings:s}),h.set("width",l.element.clientWidth),h.set("height",l.element.clientHeight),ew.cacheProperties({viewCache:h,layout:n})},[l,c,i.name(),p,r]),e.useEffect(()=>{l&&(l.update(),h.set("width",l.element.clientWidth),h.set("height",l.element.clientHeight))},[o.width,o.height]),e.useEffect(()=>{u&&u.setLayout(n)},[n]),e.onTakeSnapshot(e=>c.getSnapshotData().then(t=>(e.snapshotData=e.snapshotData||{},e.snapshotData.content=e.snapshotData.content||{},e.snapshotData.content.chartData=t,e)).catch(()=>e))}return function(e){!function(e){if(e&&e.get&&e.add){const n="Object.Disclaimer.LimitedData";if(e.get(n)!==n)return;Object.keys(t).forEach(n=>{e.add(t[n])})}}(e.translator);const n=kp();return n.use(dm),n.component("funnel",wm),{ext:Vb(e),qae:{properties:{initial:km},data:{targets:Ub}},component(){wk({picasso:n})}}}});