@nebula.js/sn-funnel-chart 1.18.0 → 1.19.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,11 +1,11 @@
1
1
  /*
2
- * @nebula.js/sn-funnel-chart v1.18.0
2
+ * @nebula.js/sn-funnel-chart v1.19.0
3
3
  * Copyright (c) 2026 QlikTech International AB
4
4
  * Released under the MIT license.
5
5
  */
6
6
 
7
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
- 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){
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.19.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){
10
10
  /*! javascript-number-formatter - v1.1.11 - http://mottie.github.com/javascript-number-formatter/ * © ecava */
11
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})}}}});