@nebula.js/sn-combo-chart 1.26.0 → 1.26.2

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.
package/core/esm/index.js CHANGED
@@ -1,9 +1,17 @@
1
1
  /*
2
- * @nebula.js/sn-combo-chart v1.26.0
2
+ * @nebula.js/sn-combo-chart v1.26.2
3
3
  * Copyright (c) 2023 QlikTech International AB
4
4
  * Released under the MIT license.
5
5
  */
6
6
 
7
- import{useElement as e,useState as t,useEffect as n,useRect as r,usePromise as i,useStaleLayout as o,useModel as a,useApp as s,useAppLayout as l,usePlugins as u,useEmbed as c,useOptions as d,useTranslator as m,useTheme as f,useDeviceType as p,useConstraints as h,useLayout as y,useAction as g,useSelections as v,onTakeSnapshot as b,useImperativeHandle as x}from"@nebula.js/stardust";import S from"hammerjs";import M from"picasso.js";import E from"picasso-plugin-q";import C from"picasso-plugin-hammer";import q from"react";import{styled as A,ListItem as O,Button as D,Popover as I,List as w,ListItemIcon as T,ListItemText as N}from"@material-ui/core";import L from"react-dom";import{createGenerateClassName as k,StylesProvider as R,ThemeProvider as P}from"@material-ui/styles";var F={properties_dataPoints_labelmode_share:{id:"properties.dataPoints.labelmode.share",locale:{"en-US":"Share","zh-TW":"佔有率","zh-CN":"份额","tr-TR":"Pay","sv-SE":"Andel","it-IT":"Percentuale","es-ES":"Cuota","de-DE":"Anteil","pl-PL":"Udział","nl-NL":"Aandeel","ko-KR":"공유","pt-BR":"Percentual","fr-FR":"Part","ja-JP":"割合","ru-RU":"Доля"}},Tooltip_selections_locked:{id:"Tooltip.selections.locked",locale:{"en-US":"Selections on this dimension are locked","zh-TW":"已鎖定此維度上的選項","zh-CN":"相关维度的选择已锁定","tr-TR":"Bu boyuttaki seçimler kilitli","sv-SE":"Urval i den här dimensionen är låsta","it-IT":"Le selezioni in questa dimensione sono bloccate","es-ES":"Las selecciones de esta dimensión están bloqueadas.","de-DE":"Auswahlen sind für diese Dimension gesperrt","pl-PL":"Selekcje dotyczące tego wymiaru są zablokowane","nl-NL":"Selecties voor deze dimensie zijn vergrendeld","ko-KR":"이 차원의 선택은 잠겨 있습니다.","pt-BR":"Seleções estão bloqueadas nesta dimensão","fr-FR":"Sélections verrouillées pour cette dimension","ja-JP":"この軸での選択はロックされています","ru-RU":"Выборки для данного измерения заблокированы"}},Tooltip_dimensions_drilldown:{id:"Tooltip.dimensions.drilldown",locale:{"en-US":"Drill-down dimension","zh-TW":"向下探查維度","zh-CN":"下钻维度","tr-TR":"Detaya inme boyutu","sv-SE":"Hierarkisk dimension","it-IT":"Dimensione di drill-down","es-ES":"Dimensión jerárquica","de-DE":"Drilldown-Dimension:","pl-PL":"Wymiar hierarchiczny","nl-NL":"Drill-downdimensie","ko-KR":"드릴다운 차원","pt-BR":"Dimensão da hierarquia","fr-FR":"Descendre dans la hiérarchie de la dimension","ja-JP":"軸のドリルダウン","ru-RU":"Измерение с детализацией"}},Object_ErrorMessage_MissingDimension:{id:"Object.ErrorMessage.MissingDimension",locale:{"en-US":"Dimension not found","zh-TW":"找不到維度","zh-CN":"未找到维度","tr-TR":"Boyut bulunamadı","sv-SE":"Dimensionen hittades inte","it-IT":"Dimensione non trovata","es-ES":"No se ha encontrado la dimensión","de-DE":"Dimension nicht gefunden","pl-PL":"Wymiar nie został znaleziony","nl-NL":"Dimensie niet gevonden","ko-KR":"차원을 찾지 못했습니다.","pt-BR":"Dimensão não encontrada","fr-FR":"Dimension introuvable","ja-JP":"軸が見つかりません","ru-RU":"Измерение не найдено"}},Object_ErrorMessage_MissingMeasure:{id:"Object.ErrorMessage.MissingMeasure",locale:{"en-US":"Measure not found","zh-TW":"找不到量值","zh-CN":"未找到度量","tr-TR":"Hesaplama bulunamadı","sv-SE":"Måttet hittades inte","it-IT":"Misura non trovata","es-ES":"No se ha encontrado la medida","de-DE":"Kennzahl nicht gefunden","pl-PL":"Miara nie została znaleziona","nl-NL":"Meting niet gevonden","ko-KR":"측정값을 찾지 못했습니다.","pt-BR":"Medida não encontrada","fr-FR":"Mesure introuvable","ja-JP":"メジャーが見つかりません","ru-RU":"Мера не найдена"}},Object_Disclaimer_LimitedData:{id:"Object.Disclaimer.LimitedData",locale:{"en-US":"Currently showing a limited data set.","zh-TW":"目前顯示的是有限的資料集。","zh-CN":"当前正显示有限的数据集。","tr-TR":"Şu anda sınırlı bir veri kümesi gösteriliyor.","sv-SE":"Just nu visas en begränsad uppsättning data.","it-IT":"Attualmente viene visualizzata una serie di dati limitata.","es-ES":"Mostrando actualmente un conjunto limitado de datos.","de-DE":"Zurzeit wird nur ein beschränkter Datensatz angezeigt.","pl-PL":"Aktualnie przedstawiany jest ograniczony zestaw danych.","nl-NL":"Momenteel wordt een beperkte gegevensverzameling getoond.","ko-KR":"현재 제한된 데이터 집합을 표시하고 있습니다.","pt-BR":"Mostrando um conjunto de dados limitado.","fr-FR":"Affichage d'un ensemble de données limité pour l'instant.","ja-JP":"現在、限定的なデータ セットを表示しています。","ru-RU":"В настоящее время отображается ограниченный набор данных."}},Object_Disclaimer_OnlyNegativeOrZeroValues:{id:"Object.Disclaimer.OnlyNegativeOrZeroValues",locale:{"en-US":"The chart is not displayed because it contains only negative or zero values.","zh-TW":"系統不會顯示圖表,因為該圖表僅包含負值或零值。","zh-CN":"未显示图表,因为它仅包含负值或零值。","tr-TR":"Yalnızca negatif veya sıfır değerlerini içermesi nedeniyle grafik görüntülenmiyor.","sv-SE":"Diagrammet visas inte eftersom det enbart innehåller negativa eller nollvärden","it-IT":"Il grafico non viene visualizzato poiché contiene solo valori negativi o uguali a zero.","es-ES":"El gráfico no se muestra porque sólo contiene valores negativos o valores cero.","de-DE":"Das Diagramm wird nicht angezeigt, da es nur negative oder 0-Werte enthält.","pl-PL":"Wykres nie jest wyświetlany, ponieważ zawiera wartości ujemne lub zerowe.","nl-NL":"De grafiek wordt niet weergegeven omdat het alleen negatieve waarden of nulwaarden bevat.","ko-KR":"음수 또는 zero 값만 포함되어 있으므로 차트가 표시되지 않습니다.","pt-BR":"O gráfico não foi exibido, porque contém apenas valores negativos ou zero.","fr-FR":"Le graphique n'est pas affiché, car il contient uniquement des valeurs négatives ou égales à zéro.","ja-JP":"チャートは負の値またはゼロ値しか含まれていないため、表示されていません。","ru-RU":"Диаграмма не отображается, поскольку она содержит только отрицательные или нулевые значения."}},Object_Disclaimer_NegativeOrZeroValues:{id:"Object.Disclaimer.NegativeOrZeroValues",locale:{"en-US":"The data set contains negative or zero values that cannot be shown in this chart.","zh-TW":"資料集包含無法在此圖表中顯示的負值或零值。","zh-CN":"数据集中包含无法在此图表中显示的负值或零值。","tr-TR":"Veri kümesi, bu grafikte gösterilemeyen negatif veya sıfır değerlerini içeriyor.","sv-SE":"Datauppsättningen innehåller negativa värden eller nollvärden som inte kan visas i detta diagram.","it-IT":"La serie di dati contiene valori negativi o uguali a zero che non possono essere visualizzati in questo grafico.","es-ES":"El conjunto de datos contiene valores negativos o cero que no se pueden mostrar en este gráfico.","de-DE":"Die in den Datensätzen enthaltenen negativen oder 0-Werte können nicht in diesem Diagramm dargestellt werden.","pl-PL":"Zestaw danych zawiera wartości ujemne lub zerowe, których nie można przedstawić w tym wykresie.","nl-NL":"De gegevensverzameling bevat negatieve waarden of nulwaarden die niet kunnen worden weergegeven in deze grafiek.","ko-KR":"데이터 집합에 해당 차트에 표시할 수 없는 음수 값 또는 zero 값이 포함되어 있습니다.","pt-BR":"O conjunto de dados contém valores negativos ou iguais a zero que não podem ser mostrados neste gráfico.","fr-FR":"L'ensemble de données contient des valeurs négatives ou égales à zéro impossibles à afficher dans ce graphique.","ja-JP":"データ セットには、本チャートに表示できない負の値またはゼロ値が含まれています。","ru-RU":"Набор данных содержит отрицательные или нулевые значения, которые невозможно показать в этой диаграмме."}},Object_Disclaimer_DataRangeIncludingZero:{id:"Object.Disclaimer.DataRangeIncludingZero",locale:{"en-US":"The logarithmic scale has been replaced by a linear scale because the data range includes zero.","zh-TW":"對數刻度已遭線性刻度取代,因為資料範圍包含零。","zh-CN":"对数刻度已替换为线性刻度,因为该数据范围包括零。","tr-TR":"Veri aralığı sıfır değerini içerdiğinden, logaritmik ölçek yerine doğrusal ölçek kullanıldı.","sv-SE":"Den logaritmiska skalan har ersatts av en linjär skala eftersom dataintervallet innehåller värdet noll.","it-IT":"La scala logaritmica è stata sostituita da una scala lineare perché l'intervallo di dati include zero.","es-ES":"La escala logarítmica ha sido reemplazada por una escala lineal porque el rango de datos incluye cero.","de-DE":"Die logarithmische Skala wurde durch die lineare Skala ersetzt, weil der Datenbereich NULL enthält.","pl-PL":"Skala logarytmiczna została zastąpiona liniową, ponieważ zakres danych zawiera zero.","nl-NL":"De logaritmische schaal is vervangen door een lineaire schaal omdat het gegevensbereik nullen bevat.","ko-KR":"데이터 범위에 0이 포함되어 있으므로 로그 눈금이 선형 눈금으로 바뀌었습니다.","pt-BR":"A escala logarítmica foi substituída por uma escala linear, pois o intervalo de dados inclui zero.","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.","ja-JP":"データ範囲にゼロが含まれるため、Log スケールは Linear スケールで置換されています。","ru-RU":"Логарифмический масштаб заменен линейным масштабом, поскольку диапазон данных включает ноль."}},Object_Disclaimer_NoDataExist:{id:"Object.Disclaimer.NoDataExist",locale:{"en-US":"The selections generated no data for this chart.","zh-TW":"此選項無法產生任何適用於此圖表的資料。","zh-CN":"选择未生成此图表的数据。","tr-TR":"Seçimler bu grafik için hiç veri oluşturmadı.","sv-SE":"Urvalen genererade inga data för detta diagram.","it-IT":"Le selezioni non hanno generato dati per questo grafico.","es-ES":"Las selecciones no han generado datos para este gráfico.","de-DE":"Die Auswahlen haben für dieses Diagramm keine Daten generiert.","pl-PL":"Selekcje nie spowodowały wygenerowania danych dla tego wykresu.","nl-NL":"De selecties hebben geen gegevens voor de grafiek gegenereerd.","ko-KR":"선택 내용으로 해당 차트에 대한 데이터가 생성되지 않았습니다.","pt-BR":"As seleções não geraram dados para este gráfico.","fr-FR":"Les sélections n'ont pas généré de données pour ce graphique.","ja-JP":"このチャートには選択からデータが生成されませんでした。","ru-RU":"В результате выборок данные для этой диаграммы не созданы."}},Object_Disclaimer_OnlyNanData:{id:"Object.Disclaimer.OnlyNanData",locale:{"en-US":"The chart is not displayed because it contains only undefined values.","zh-TW":"系統不會顯示圖表,因為該圖表僅包含未定義的值。","zh-CN":"未显示图表,因为它仅包含未定义的值。","tr-TR":"Yalnızca tanımsız değerleri içermesi nedeniyle grafik görüntülenmiyor.","sv-SE":"Diagrammet visas inte eftersom det enbart innehåller odefinierade värden.","it-IT":"Il grafico non è visualizzato poiché contiene solo valori non definiti.","es-ES":"El gráfico no se muestra porque solo contiene valores indefinidos.","de-DE":"Das Diagramm wird nicht angezeigt, da es nur nicht definierte Werte enthält.","pl-PL":"Wykres nie jest wyświetlany, ponieważ zawiera wartości niezdefiniowane.","nl-NL":"De grafiek wordt niet weergegeven omdat deze alleen ongedefinieerde waarden bevat.","ko-KR":"정의되지 않은 값만 포함되어 있으므로 차트가 표시되지 않습니다.","pt-BR":"O gráfico não foi exibido, porque contém apenas valores não definidos.","fr-FR":"Le graphique n'est pas affiché, car il contient uniquement des valeurs non définies.","ja-JP":"未定義の値しか含まれていないため、チャートは表示されていません。","ru-RU":"Диаграмма не отображается, поскольку она содержит только неопределенные значения."}},Object_ChartTooltip_NMore:{id:"Object.ChartTooltip.NMore",locale:{"en-US":"+{0} more","zh-TW":"再加 {0} 個","zh-CN":"+{0} 个","tr-TR":"+{0} öğe daha","sv-SE":"+{0} till","it-IT":"Altre +{0}","es-ES":"+{0} más","de-DE":"+{0} mehr","pl-PL":"+ {0} więcej","nl-NL":"+ {0} meer","ko-KR":"+추가 {0}개","pt-BR":"+{0} mais","fr-FR":"+ {0} de plus","ja-JP":"さらに {0}","ru-RU":"+ дополнительно: {0}"}},Object_ChartTooltip_sumOfPositives:{id:"Object.ChartTooltip.sumOfPositives",locale:{"en-US":"Sum of positives","zh-TW":"正數總和","zh-CN":"正值总和","tr-TR":"Pozitif değerlerin toplamı","sv-SE":"Summan av positiva","it-IT":"Somma valori positivi","es-ES":"Suma de positivos","de-DE":"Summe positiver Werte","pl-PL":"Suma dodatnich","nl-NL":"Som positieven","ko-KR":"양수 합계","pt-BR":"Soma de positivos","fr-FR":"Sommes des valeurs positives","ja-JP":"正の合計","ru-RU":"Сумма положительных значений"}},Object_ChartTooltip_sumOfNegatives:{id:"Object.ChartTooltip.sumOfNegatives",locale:{"en-US":"Sum of negatives","zh-TW":"負數總和","zh-CN":"负值总和","tr-TR":"Negatif değerlerin toplamı","sv-SE":"Summan av negativa","it-IT":"Somma valori negativi","es-ES":"Suma de negativos","de-DE":"Summe negativer Werte","pl-PL":"Suma ujemnych","nl-NL":"Som negatieven","ko-KR":"음수 합계","pt-BR":"Soma de negativos","fr-FR":"Somme des valeurs négatives","ja-JP":"負の合計","ru-RU":"Сумма отрицательных значений"}},Object_ChartTooltip_ColorExpression:{id:"Object.ChartTooltip.ColorExpression",locale:{"en-US":"Color expression","zh-TW":"色彩運算式","zh-CN":"颜色表达式","tr-TR":"Renk ifadesi","sv-SE":"Färguttryck","it-IT":"Espressione colore","es-ES":"Expresión de color","de-DE":"Farbformel","pl-PL":"Wyrażenie koloru","nl-NL":"Kleuruitdrukking","ko-KR":"색상 표현식","pt-BR":"Expressão de cor","fr-FR":"Expression de couleur","ja-JP":"カラー表現","ru-RU":"Выражение для цвета"}},Object_Disclaimer_OnlyNanColor:{id:"Object.Disclaimer.OnlyNanColor",locale:{"en-US":"The data used to color this visualization only contains undefined values.","zh-TW":"用以定義此視覺化的色彩的資料只包含未定義的值。","zh-CN":"用于将该可视化着色的数据仅包含未定义的值。","tr-TR":"Bu görselleştirmeyi renklendirmek için kullanılan veriler yalnızca tanımlanmamış değerler içeriyor.","sv-SE":"Data som används för att färgsätta denna visualisering innehåller enbart odefinierade värden.","it-IT":"I dati utilizzati per colorare questa visualizzazione contengono solo valori non definiti.","es-ES":"Los datos utilizados para colorear esta visualización solo contienen valores indefinidos.","de-DE":"Die verwendeten Daten für die Farbgebung dieser Visualisierung enthalten undefinierte Werte.","pl-PL":"Dane używane do kolorowania tej wizualizacji zawierają wyłącznie niezdefiniowane wartości.","nl-NL":"De gegevens die worden gebruikt om deze visualisatie kleur te geven bevatten uitsluitend ongedefinieerde waarden.","ko-KR":"이 시각화에 색을 지정하는 데 사용된 데이터에는 정의되지 않은 값만 포함되어 있습니다.","pt-BR":"Os dados usados para colorir esse visualização contém somente valores indefinidos.","fr-FR":"Les données utilisées pour colorer cette visualisation ne comportent que des valeurs non définies.","ja-JP":"このビジュアライゼーションの色の割り当てに使用したデータには、未定義の値が含まれています。","ru-RU":"Данные, используемые для выбора цвета визуализации, содержат только неопределенные значения."}},properties_trendlines_types_average:{id:"properties.trendlines.types.average",locale:{"en-US":"Average","zh-TW":"平均值","zh-CN":"平均值","tr-TR":"Ortalama","sv-SE":"Medel","it-IT":"Media","es-ES":"Media","de-DE":"Durchschnitt","pl-PL":"Średnia","nl-NL":"Gemiddelde","ko-KR":"평균","pt-BR":"Média","fr-FR":"Moyenne","ja-JP":"平均値","ru-RU":"Среднее"}},properties_trendlines_types_linear:{id:"properties.trendlines.types.linear",locale:{"en-US":"Linear","zh-TW":"線性","zh-CN":"线性","tr-TR":"Doğrusal","sv-SE":"Linjär","it-IT":"Lineare","es-ES":"Lineal","de-DE":"Linear","pl-PL":"Liniowa","nl-NL":"Lineair","ko-KR":"선형","pt-BR":"Linear","fr-FR":"Linéaire","ja-JP":"線形","ru-RU":"Линейный"}},properties_trendlines_types_polynomial2:{id:"properties.trendlines.types.polynomial2",locale:{"en-US":"Second degree polynomial","zh-TW":"第二度多項式","zh-CN":"二次多项式","tr-TR":"İkinci derece polinom","sv-SE":"Polynomial, andra graden","it-IT":"Polinomio di secondo grado","es-ES":"Polinómica de segundo grado","de-DE":"Polynom zweiten Grades","pl-PL":"Wielomianowa drugiego stopnia","nl-NL":"Tweedegraadspolynoom","ko-KR":"2차 다항식","pt-BR":"Polinômio de segundo grau","fr-FR":"Polynomial du 2ème degré","ja-JP":"2 番目の角度の多項式近似","ru-RU":"Полиномиальный второй степени"}},properties_trendlines_types_polynomial3:{id:"properties.trendlines.types.polynomial3",locale:{"en-US":"Third degree polynomial","zh-TW":"第三度多項式","zh-CN":"三次多项式","tr-TR":"Üçüncü derece polinom","sv-SE":"Polynomial, tredje graden","it-IT":"Polinomio di terzo grado","es-ES":"Polinómica de tercer grado","de-DE":"Polynom dritten Grades","pl-PL":"Wielomianowa trzeciego stopnia","nl-NL":"Derdegraadspolynoom","ko-KR":"3차 다항식","pt-BR":"Polinômio de terceiro grau","fr-FR":"Polynomial du 3ème degré","ja-JP":"3 番目の角度の多項式近似","ru-RU":"Полиномиальный третьей степени"}},properties_trendlines_types_polynomial4:{id:"properties.trendlines.types.polynomial4",locale:{"en-US":"Fourth degree polynomial","zh-TW":"第四度多項式","zh-CN":"四次多项式","tr-TR":"Dördüncü derece polinom","sv-SE":"Polynomial, fjärde graden","it-IT":"Polinomio di quarto grado","es-ES":"Polinómica de cuarto grado","de-DE":"Polynom vierten Grades","pl-PL":"Wielomianowa czwartego stopnia","nl-NL":"Vierdegraadspolynoom","ko-KR":"4차 다항식","pt-BR":"Polinômio de quarto grau","fr-FR":"Polynomial du 4ème degré","ja-JP":"4 番目の角度の多項式近似","ru-RU":"Полиномиальный четвертой степени"}},properties_trendlines_types_exponential:{id:"properties.trendlines.types.exponential",locale:{"en-US":"Exponential","zh-TW":"指數","zh-CN":"指数","tr-TR":"Üstel","sv-SE":"Exponentiell","it-IT":"Esponenziale","es-ES":"Exponencial","de-DE":"Exponentiell","pl-PL":"Wykładnicze","nl-NL":"Exponentieel","ko-KR":"지수","pt-BR":"Exponencial","fr-FR":"Exponentiel","ja-JP":"指数","ru-RU":"Экспоненциальный"}},properties_trendlines_types_logarithmic:{id:"properties.trendlines.types.logarithmic",locale:{"en-US":"Logarithmic","zh-TW":"對數","zh-CN":"对数","tr-TR":"Logaritmik","sv-SE":"Logaritmisk","it-IT":"Logaritmica","es-ES":"Logarítmica","de-DE":"Logarithmisch","pl-PL":"Logarytmiczna","nl-NL":"Logaritmisch","ko-KR":"로그","pt-BR":"Logarítmico","fr-FR":"Logarithmique","ja-JP":"対数","ru-RU":"Логарифмический"}},properties_trendlines_types_power:{id:"properties.trendlines.types.power",locale:{"en-US":"Power","zh-TW":"乘冪","zh-CN":"幂","tr-TR":"Üs","sv-SE":"Potens","it-IT":"Potenza","es-ES":"Potencia","de-DE":"Potenz","pl-PL":"Potęgowa","nl-NL":"Macht","ko-KR":"거듭제곱","pt-BR":"Potência","fr-FR":"Puissance","ja-JP":"累乗","ru-RU":"Силовой"}},Common_Measures:{id:"Common.Measures",locale:{"en-US":"Measures","de-DE":"Kennzahlen","fr-FR":"Mesures","it-IT":"Misure","ja-JP":"メジャー","ko-KR":"측정값","es-ES":"Medidas","nl-NL":"Metingen","pl-PL":"Miary","pt-BR":"Medidas","sv-SE":"Mått","tr-TR":"Hesaplamalar","zh-CN":"度量","zh-TW":"量值","ru-RU":"Меры"}},Tooltip_ToggleOnLassoSelection:{id:"Tooltip.ToggleOnLassoSelection",locale:{"en-US":"Turn on lasso selection","de-DE":"Lasso-Auswahl aktivieren","fr-FR":"Activer la sélection au lasso","it-IT":"Attiva selezione lazo","ja-JP":"囲み選択をオンにする","ko-KR":"올가미 선택 켜기","es-ES":"Activar la selección de contorno","nl-NL":"Lassoselectie inschakelen","pl-PL":"Włącz zaznaczenie lasso","pt-BR":"Ativar seleção de laço","sv-SE":"Slå på lassourval","tr-TR":"Serbest seçimi aç","zh-CN":"开启套索选择方法","zh-TW":"開啟套索選取","ru-RU":"Включить выбор лассо"}},Tooltip_ToggleOffLassoSelection:{id:"Tooltip.ToggleOffLassoSelection",locale:{"en-US":"Turn off lasso selection","de-DE":"Lasso-Auswahl deaktivieren","fr-FR":"Désactiver la sélection au lasso","it-IT":"Disattiva selezione lazo","ja-JP":"囲み選択をオフにする","ko-KR":"올가미 선택 끄기","es-ES":"Desactivar la selección de contorno","nl-NL":"Lassoselectie uitschakelen","pl-PL":"Wyłącz zaznaczenie lasso","pt-BR":"Desativar seleção de laço","sv-SE":"Stäng av lassourval","tr-TR":"Serbest seçimi kapat","zh-CN":"关闭套索选择方法","zh-TW":"關閉套索選取","ru-RU":"Выключить выбор лассо"}}};function z(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var _=Object.prototype.hasOwnProperty,$=Object.prototype.toString,H=Object.defineProperty,j=Object.getOwnPropertyDescriptor,V=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===$.call(e)},B=function(e){if(!e||"[object Object]"!==$.call(e))return!1;var t,n=_.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&_.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||_.call(e,t)},U=function(e,t){H&&"__proto__"===t.name?H(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},Y=function(e,t){if("__proto__"===t){if(!_.call(e,t))return;if(j)return j(e,t).value}return e[t]},W=function e(){var t,n,r,i,o,a,s=arguments[0],l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l<u;++l)if(null!=(t=arguments[l]))for(n in t)r=Y(s,n),s!==(i=Y(t,n))&&(c&&i&&(B(i)||(o=V(i)))?(o?(o=!1,a=r&&V(r)?r:[]):a=r&&B(r)?r:{},U(s,{name:n,newValue:e(c,a,i)})):void 0!==i&&U(s,{name:n,newValue:i}));return s},G=z(W);const X="center",K="bottom";var J={NoDataExist:{label:"NoDataExist",alignment:X,default:!0},OnlyNanData:{label:"OnlyNanData",alignment:X,default:!0},OnlyNegativeOrZeroValues:{label:"OnlyNegativeOrZeroValues",alignment:X,default:!1},LimitedData:{label:"LimitedData",alignment:K,default:!1},OnlyNanColor:{label:"OnlyNanColor",alignment:K,default:!1},NegativeOrZeroValues:{label:"NegativeOrZeroValues",alignment:K,default:!1},DataRangeIncludingZero:{label:"DataRangeIncludingZero",alignment:K,default:!1}};const Z=[["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}]],Q={};Z.forEach((([e,{width:t,height:n}])=>{Q[e]={width:t,height:n}}));const ee={getLayoutModes:()=>Q,getLayoutMode(e,t){let n;for(n=0;n<Z.length;++n)if(e>=Z[n][1].width&&t>=Z[n][1].height)return Z[n][0];return"SPARK"}};const te=["$date","$timestamp","$time"],ne=["D","TS","T"],re={hasTimeTag:e=>!!(e&&e.qTags&&e.qTags.some((e=>te.some((t=>t===e))))),hasUnknownFormat:e=>!(!e||!e.qNumFormat||"U"!==e.qNumFormat.qType),hasTimeFormat:e=>!!(e&&e.qNumFormat&&ne.some((t=>t===e.qNumFormat.qType))),isTimeDimension:(e,t)=>!!(e&&t&&(re.hasTimeTag(t)&&re.hasUnknownFormat(t)||re.hasTimeFormat(t))),isTime:(e,t)=>!!(t&&t.qHyperCube.qDimensionInfo&&t.qHyperCube.qDimensionInfo.length)&&(e&&re.isTimeDimension(e,t.qHyperCube.qDimensionInfo.filter((e=>{var t;return 7005!==(null===(t=e.qError)||void 0===t?void 0:t.qErrorCode)}))[0])),canBeContinuousDimension(e){if(!e)return!1;const t=e.qTags||[];return!(!e.qContinuousAxes||!t.some((e=>"$numeric"===e)))},canBeContinuous(e){var t,n,r;const i=null==e||null===(t=e.qHyperCube)||void 0===t||null===(n=t.qDimensionInfo)||void 0===n?void 0:n.filter((e=>{var t;return 7005!==(null===(t=e.qError)||void 0===t?void 0:t.qErrorCode)}));return!((null!==(r=null==i?void 0:i.length)&&void 0!==r?r:0)<1)&&re.canBeContinuousDimension(i[0])},maxNumberOfLines:12},ie=/^[A-Z][A-z0-9_]*$/i,oe={setValue:(e,t,n)=>{if(!t)return!1;const r=t.split("."),i=r[r.length-1];let o,a=e;for(o=0;o<r.length-1;++o)void 0===a[r[o]]&&(a[r[o]]=Number.isNaN(+r[o+1])?{}:[]),a=a[r[o]];if(void 0!==n){const e=a[i];return a[i]=n,{updated:n,previous:e}}return delete a[i],!1},getValue:(e,t,n)=>{const r=t.split(".");let i,o=e;if(void 0===o)return n;for(i=0;i<r.length;++i){if(void 0===o[r[i]])return n;o=o[r[i]]}return o},moveArrayElement:(e,t,n)=>{if(n>=e.length){let t=n-e.length;for(;1+t--;)e.push(void 0)}e.splice(n,0,e.splice(t,1)[0])},escapeField:e=>{let t;return t=!e||"]"===e||ie.test(e)?e:`[${e.replace(/\]/g,"]]")}]`,t},deleteUndefinedProperties:e=>{Object.keys(e).forEach((t=>{void 0===e[t]&&delete e[t]}))},shouldUseFormat:e=>!e.isCustomFormatted&&(e.qIsAutoFormat||"U"===e.qNumFormat.qType)},ae=e=>oe.getValue(e,"qHyperCube.qDimensionInfo",[]),se=e=>oe.getValue(e,"qHyperCube.qMeasureInfo",[]),le=e=>oe.getValue(e,"barGrouping.grouping"),ue={continuous:(e,t=!1)=>!!re.canBeContinuous(e)&&(oe.getValue(e,"dimensionAxis.continuousAuto")?"function"==typeof t?t():t:!!e.preferContinuousAxis),dimensionless:e=>!ae(e).length,grouped(e){return!this.dimensionless(e)&&"grouped"===le(e)&&(ae(e).length>1||se(e).length>1)&&!this.continuous(e)},groupedByDimension(e){return this.grouped(e)&&ae(e).length>1&&1===se(e).length},groupedByMeasure(e){return this.grouped(e)&&1===ae(e).length&&se(e).length>1},stacked(e){return(!this.dimensionless(e)&&"grouped"!==le(e)||this.continuous(e))&&(ae(e).length>1||se(e).length>1)},stackedByDimension(e){return this.stacked(e)&&ae(e).length>1&&1===se(e).length},stackedByMeasure(e){return this.stacked(e)&&1===ae(e).length&&se(e).length>1},simple:e=>0===ae(e).length||1===ae(e).length&&1===se(e).length,snapshot:e=>!!oe.getValue(e,"snapshotData")};function ce(e,t){const n=e.component(t);return n&&n._DO_NOT_USE_getInfo&&n._DO_NOT_USE_getInfo().offset}const de=e=>{throw e.isHandled=!0,e};const me={getDockValue:e=>"near"===e||"left"===e||"top"===e?0:1,getOppositeDock(e){switch(e){case"left":return"right";case"right":return"left";case"top":return"bottom";case"bottom":return"top";case"near":default:return"far";case"far":return"near"}},getHorizontalDock:e=>"near"===e||"left"===e?"left":"right",getVerticalDock:e=>"near"===e||"bottom"===e?"bottom":"top",getDock:(e,t,n)=>"vertical"===e||"y"===e?me.getVerticalDock(t):n?me.getOppositeDock(me.getHorizontalDock(t)):me.getHorizontalDock(t),getInvertedOrientation:e=>"vertical"===e?"horizontal":"vertical",getMinorScaleAxis:e=>"vertical"===e?"y":"x",getMajorScaleAxis:e=>"vertical"===e?"x":"y",getAlignment:(e,t)=>"vertical"===e?"near"===t||"bottom"===t?1:0:"near"===t||"left"===t?0:1,getMeasureScaleInvert:(e,t)=>"vertical"===e||t,getDimensionScaleInvert:(e,t)=>"horizontal"===e&&t,getSize:(e,{width:t,height:n})=>"vertical"===e?t:n},fe={stringWidthOverMWidth:e=>(12*Math.min(e,3)+6.384615384615385*Math.max(e-3,0))/11,getCharacterRatios(e){if(!e)return{latin:0,cjk:0};let t=e.match(/[\u4E00-\u9FFF]/g),n=e.match(/[\u3040-\u309F]/g),r=e.match(/[\u30A0-\u30FF]/g);t=t?t.length:0,n=n?n.length:0,r=r?r.length:0;const i=t+n+r;return{latin:e.length-i,cjk:i}},getTotalCharacterRatios(e,t,n="qText"){if(!e)return{latinRatio:1,cjkRatio:0};const r={latin:0,cjk:0};let i;void 0===t?e.forEach((e=>{i=fe.getCharacterRatios(e[n]),r.latin+=i.latin,r.cjk+=i.cjk})):e.forEach((e=>{i=fe.getCharacterRatios(e[t][n]),r.latin+=i.latin,r.cjk+=i.cjk}));const o=Math.max(1,r.latin+r.cjk);return r.latinRatio=r.latin/o,r.cjkRatio=r.cjk/o,r},getAdjustedMaxGlyphCount(e,t,n,r="qText"){const i=fe.getTotalCharacterRatios(t,n,r),o=i.latinRatio*e,a=i.cjkRatio*e;return Math.ceil(fe.stringWidthOverMWidth(o)+1.0909090909090908*a)}},pe=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼ‎ⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),he=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞‏יִײַ-ﬨשׁ-ﭏ]"),ye=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]"),ge={lrm:String.fromCharCode(8206),rlm:String.fromCharCode(8207),isLtrChar:e=>pe.test(e),isRtlChar:e=>he.test(e)||ye.test(e),detectTextDirection(e){const t=e?e.length:0;let n,r;for(n=0;n<t;n++){if(r=e[n],ge.isLtrChar(r))return"ltr";if(ge.isRtlChar(r))return"rtl"}return"ltr"}},ve={getColorSymbol:(e,t)=>e.h("div",{style:{display:"inline-block",width:"10px",height:"10px","background-color":t.color.fill,margin:"0 8px"}}),getNodeFillColor:e=>e.attrs&&void 0!==e.attrs.fill?e.attrs.fill:e.children&&e.children[0]&&e.children[0].attrs&&void 0!==e.children[0].attrs.fill?e.children[0].attrs.fill:void 0,getColor(e,t,n){const r=t.data,i=e.resources.formatter,o=e.resources.dataset,a={};if(n.coloring.label&&(a.label=`${n.coloring.label}`),"color"!==n.coloring.type&&r.fillTooltip){const e=i("fill"),t="measure"===n.coloring.fieldType;if(a.value=t&&e?e(r.fillTooltip.value):r.fillTooltip.label?r.fillTooltip.label:r.fillTooltip.value,!n.coloring.label){const e=o(r.fillTooltip.source.key).field(r.fillTooltip.source.field).title();a.label=`${e}`}}return a.fill=void 0===r._fillColor?ve.getNodeFillColor(t):r._fillColor,a},getMeasure:(e,t)=>({label:`${e(t.source.key).field(t.source.field).title()}`,value:""===t.label||"NaN"===t.label?"-":t.label,field:t.source.field}),hideColorRow:(e,t)=>void 0===e.color.value||e.measures.some((e=>e.field===t.coloring.field)),getTitleRow(e,t){const n=ge.detectTextDirection(e.title);return[{content:e.title,style:{"font-weight":"bold","text-align":t?"right":"left",direction:n},colspan:2},{}]},getDescriptionRow(e,t){const n=ge.detectTextDirection(e.value);return[{content:e.value,style:{"text-align":t?"right":"left",direction:n},colspan:2},{}]},getNMoreRow(e,t,n){const r=t?t.get("Object.ChartTooltip.NMore",e):`+${e} more`;return[{content:r,style:{"font-weight":"bold","text-align":n?"right":"left",direction:ge.detectTextDirection(r)},colspan:2},{}]},getSeparatorRow:()=>[{content:"",style:{"background-image":"linear-gradient(transparent 8px, rgba(255, 255, 255, 0.4) 8px, rgba(255, 255, 255, 0.4) 9.2px, transparent 9.2px)",height:"17px"},colspan:2},{}],getColorRow(e,t,n){const r=ge.detectTextDirection(t.color.label),i=n?[":",t.color.label]:[t.color.label,":"],o=ge.detectTextDirection(t.color.value);return[{content:i,style:{"text-align":n?"right":"left",direction:r}},{content:n?[t.color.value,ve.getColorSymbol(e,t)]:[ve.getColorSymbol(e,t),t.color.value],style:{"text-align":n?"left":"right",direction:o,"vertical-align":"middle"}}]},getMeasureRow(e,t,n,r,i=!1){const o=ge.detectTextDirection(e.label),a=r?[":",e.label]:[e.label,":"],s=ge.detectTextDirection(e.value);let l;return l=i?r?[e.value,ve.getColorSymbol(t,n)]:[ve.getColorSymbol(t,n),e.value]:[e.value],[{content:a,style:{"text-align":r?"right":"left",direction:o}},{content:l,style:{"text-align":r?"left":"right",direction:s,"vertical-align":"middle"}}]}};function be(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function xe(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Se(){}var Me=.7,Ee=1/Me,Ce="\\s*([+-]?\\d+)\\s*",qe="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ae="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Oe=/^#([0-9a-f]{3,8})$/,De=new RegExp(`^rgb\\(${Ce},${Ce},${Ce}\\)$`),Ie=new RegExp(`^rgb\\(${Ae},${Ae},${Ae}\\)$`),we=new RegExp(`^rgba\\(${Ce},${Ce},${Ce},${qe}\\)$`),Te=new RegExp(`^rgba\\(${Ae},${Ae},${Ae},${qe}\\)$`),Ne=new RegExp(`^hsl\\(${qe},${Ae},${Ae}\\)$`),Le=new RegExp(`^hsla\\(${qe},${Ae},${Ae},${qe}\\)$`),ke={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 Re(){return this.rgb().formatHex()}function Pe(){return this.rgb().formatRgb()}function Fe(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Oe.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?ze(t):3===n?new je(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?_e(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?_e(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=De.exec(e))?new je(t[1],t[2],t[3],1):(t=Ie.exec(e))?new je(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=we.exec(e))?_e(t[1],t[2],t[3],t[4]):(t=Te.exec(e))?_e(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Ne.exec(e))?Ge(t[1],t[2]/100,t[3]/100,1):(t=Le.exec(e))?Ge(t[1],t[2]/100,t[3]/100,t[4]):ke.hasOwnProperty(e)?ze(ke[e]):"transparent"===e?new je(NaN,NaN,NaN,0):null}function ze(e){return new je(e>>16&255,e>>8&255,255&e,1)}function _e(e,t,n,r){return r<=0&&(e=t=n=NaN),new je(e,t,n,r)}function $e(e){return e instanceof Se||(e=Fe(e)),e?new je((e=e.rgb()).r,e.g,e.b,e.opacity):new je}function He(e,t,n,r){return 1===arguments.length?$e(e):new je(e,t,n,null==r?1:r)}function je(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function Ve(){return`#${We(this.r)}${We(this.g)}${We(this.b)}`}function Be(){const e=Ue(this.opacity);return`${1===e?"rgb(":"rgba("}${Ye(this.r)}, ${Ye(this.g)}, ${Ye(this.b)}${1===e?")":`, ${e})`}`}function Ue(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ye(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function We(e){return((e=Ye(e))<16?"0":"")+e.toString(16)}function Ge(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ke(e,t,n,r)}function Xe(e){if(e instanceof Ke)return new Ke(e.h,e.s,e.l,e.opacity);if(e instanceof Se||(e=Fe(e)),!e)return new Ke;if(e instanceof Ke)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,s=o-i,l=(o+i)/2;return s?(a=t===o?(n-r)/s+6*(n<r):n===o?(r-t)/s+2:(t-n)/s+4,s/=l<.5?o+i:2-o-i,a*=60):s=l>0&&l<1?0:a,new Ke(a,s,l,e.opacity)}function Ke(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function Je(e){return(e=(e||0)%360)<0?e+360:e}function Ze(e){return Math.max(0,Math.min(1,e||0))}function Qe(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}be(Se,Fe,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Re,formatHex:Re,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Xe(this).formatHsl()},formatRgb:Pe,toString:Pe}),be(je,He,xe(Se,{brighter(e){return e=null==e?Ee:Math.pow(Ee,e),new je(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?Me:Math.pow(Me,e),new je(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new je(Ye(this.r),Ye(this.g),Ye(this.b),Ue(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:Ve,formatHex:Ve,formatHex8:function(){return`#${We(this.r)}${We(this.g)}${We(this.b)}${We(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Be,toString:Be})),be(Ke,(function(e,t,n,r){return 1===arguments.length?Xe(e):new Ke(e,t,n,null==r?1:r)}),xe(Se,{brighter(e){return e=null==e?Ee:Math.pow(Ee,e),new Ke(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?Me:Math.pow(Me,e),new Ke(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,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new je(Qe(e>=240?e-240:e+120,i,r),Qe(e,i,r),Qe(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Ke(Je(this.h),Ze(this.s),Ze(this.l),Ue(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=Ue(this.opacity);return`${1===e?"hsl(":"hsla("}${Je(this.h)}, ${100*Ze(this.s)}%, ${100*Ze(this.l)}%${1===e?")":`, ${e})`}`}}));const et=Math.PI/180,tt=180/Math.PI,nt=.96422,rt=1,it=.82521,ot=4/29,at=6/29,st=3*at*at,lt=at*at*at;function ut(e){if(e instanceof ct)return new ct(e.l,e.a,e.b,e.opacity);if(e instanceof yt)return gt(e);e instanceof je||(e=$e(e));var t,n,r=pt(e.r),i=pt(e.g),o=pt(e.b),a=dt((.2225045*r+.7168786*i+.0606169*o)/rt);return r===i&&i===o?t=n=a:(t=dt((.4360747*r+.3850649*i+.1430804*o)/nt),n=dt((.0139322*r+.0971045*i+.7141733*o)/it)),new ct(116*a-16,500*(t-a),200*(a-n),e.opacity)}function ct(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function dt(e){return e>lt?Math.pow(e,1/3):e/st+ot}function mt(e){return e>at?e*e*e:st*(e-ot)}function ft(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function pt(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function ht(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof yt)return new yt(e.h,e.c,e.l,e.opacity);if(e instanceof ct||(e=ut(e)),0===e.a&&0===e.b)return new yt(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*tt;return new yt(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new yt(e,t,n,null==r?1:r)}function yt(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function gt(e){if(isNaN(e.h))return new ct(e.l,0,0,e.opacity);var t=e.h*et;return new ct(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}be(ct,(function(e,t,n,r){return 1===arguments.length?ut(e):new ct(e,t,n,null==r?1:r)}),xe(Se,{brighter(e){return new ct(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new ct(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 je(ft(3.1338561*(t=nt*mt(t))-1.6168667*(e=rt*mt(e))-.4906146*(n=it*mt(n))),ft(-.9787684*t+1.9161415*e+.033454*n),ft(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),be(yt,ht,xe(Se,{brighter(e){return new yt(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new yt(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return gt(this).rgb()}}));var vt={isDark:function(e){return ht(e).l<70}};function bt(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function xt(e){return 1===e.length&&(e=function(e){return function(t,n){return bt(e(t),n)}}(e)),{left:function(t,n,r,i){for(null==r&&(r=0),null==i&&(i=t.length);r<i;){var o=r+i>>>1;e(t[o],n)<0?r=o+1:i=o}return r},right:function(t,n,r,i){for(null==r&&(r=0),null==i&&(i=t.length);r<i;){var o=r+i>>>1;e(t[o],n)>0?i=o:r=o+1}return r}}}var St=xt(bt).right,Mt=Math.sqrt(50),Et=Math.sqrt(10),Ct=Math.sqrt(2);function qt(e,t,n){var r=(t-e)/Math.max(0,n),i=Math.floor(Math.log(r)/Math.LN10),o=r/Math.pow(10,i);return i>=0?(o>=Mt?10:o>=Et?5:o>=Ct?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(o>=Mt?10:o>=Et?5:o>=Ct?2:1)}function At(e,t,n){var r=Math.abs(t-e)/Math.max(0,n),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),o=r/i;return o>=Mt?i*=10:o>=Et?i*=5:o>=Ct&&(i*=2),t<e?-i:i}function Ot(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}var Dt="$";function It(){}function wt(e,t){var n=new It;if(e instanceof It)e.each((function(e,t){n.set(t,e)}));else if(Array.isArray(e)){var r,i=-1,o=e.length;if(null==t)for(;++i<o;)n.set(i,e[i]);else for(;++i<o;)n.set(t(r=e[i],i,e),r)}else if(e)for(var a in e)n.set(a,e[a]);return n}function Tt(){}It.prototype=wt.prototype={constructor:It,has:function(e){return Dt+e in this},get:function(e){return this[Dt+e]},set:function(e,t){return this[Dt+e]=t,this},remove:function(e){var t=Dt+e;return t in this&&delete this[t]},clear:function(){for(var e in this)e[0]===Dt&&delete this[e]},keys:function(){var e=[];for(var t in this)t[0]===Dt&&e.push(t.slice(1));return e},values:function(){var e=[];for(var t in this)t[0]===Dt&&e.push(this[t]);return e},entries:function(){var e=[];for(var t in this)t[0]===Dt&&e.push({key:t.slice(1),value:this[t]});return e},size:function(){var e=0;for(var t in this)t[0]===Dt&&++e;return e},empty:function(){for(var e in this)if(e[0]===Dt)return!1;return!0},each:function(e){for(var t in this)t[0]===Dt&&e(this[t],t.slice(1),this)}};var Nt=wt.prototype;Tt.prototype={constructor:Tt,has:Nt.has,add:function(e){return this[Dt+(e+="")]=e,this},remove:Nt.remove,clear:Nt.clear,values:Nt.keys,size:Nt.size,empty:Nt.empty,each:Nt.each};var Lt=Array.prototype,kt=Lt.map,Rt=Lt.slice;function Pt(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Ft(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function zt(){}var _t=.7,$t=1/_t,Ht="\\s*([+-]?\\d+)\\s*",jt="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",Vt="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Bt=/^#([0-9a-f]{3})$/,Ut=/^#([0-9a-f]{6})$/,Yt=new RegExp("^rgb\\("+[Ht,Ht,Ht]+"\\)$"),Wt=new RegExp("^rgb\\("+[Vt,Vt,Vt]+"\\)$"),Gt=new RegExp("^rgba\\("+[Ht,Ht,Ht,jt]+"\\)$"),Xt=new RegExp("^rgba\\("+[Vt,Vt,Vt,jt]+"\\)$"),Kt=new RegExp("^hsl\\("+[jt,Vt,Vt]+"\\)$"),Jt=new RegExp("^hsla\\("+[jt,Vt,Vt,jt]+"\\)$"),Zt={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 Qt(e){var t;return e=(e+"").trim().toLowerCase(),(t=Bt.exec(e))?new on((t=parseInt(t[1],16))>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):(t=Ut.exec(e))?en(parseInt(t[1],16)):(t=Yt.exec(e))?new on(t[1],t[2],t[3],1):(t=Wt.exec(e))?new on(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Gt.exec(e))?tn(t[1],t[2],t[3],t[4]):(t=Xt.exec(e))?tn(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Kt.exec(e))?sn(t[1],t[2]/100,t[3]/100,1):(t=Jt.exec(e))?sn(t[1],t[2]/100,t[3]/100,t[4]):Zt.hasOwnProperty(e)?en(Zt[e]):"transparent"===e?new on(NaN,NaN,NaN,0):null}function en(e){return new on(e>>16&255,e>>8&255,255&e,1)}function tn(e,t,n,r){return r<=0&&(e=t=n=NaN),new on(e,t,n,r)}function nn(e){return e instanceof zt||(e=Qt(e)),e?new on((e=e.rgb()).r,e.g,e.b,e.opacity):new on}function rn(e,t,n,r){return 1===arguments.length?nn(e):new on(e,t,n,null==r?1:r)}function on(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function an(e){return((e=Math.max(0,Math.min(255,Math.round(e)||0)))<16?"0":"")+e.toString(16)}function sn(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ln(e,t,n,r)}function ln(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function un(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}Pt(zt,Qt,{displayable:function(){return this.rgb().displayable()},hex:function(){return this.rgb().hex()},toString:function(){return this.rgb()+""}}),Pt(on,rn,Ft(zt,{brighter:function(e){return e=null==e?$t:Math.pow($t,e),new on(this.r*e,this.g*e,this.b*e,this.opacity)},darker:function(e){return e=null==e?_t:Math.pow(_t,e),new on(this.r*e,this.g*e,this.b*e,this.opacity)},rgb:function(){return this},displayable:function(){return 0<=this.r&&this.r<=255&&0<=this.g&&this.g<=255&&0<=this.b&&this.b<=255&&0<=this.opacity&&this.opacity<=1},hex:function(){return"#"+an(this.r)+an(this.g)+an(this.b)},toString:function(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===e?")":", "+e+")")}})),Pt(ln,(function(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof ln)return new ln(e.h,e.s,e.l,e.opacity);if(e instanceof zt||(e=Qt(e)),!e)return new ln;if(e instanceof ln)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,s=o-i,l=(o+i)/2;return s?(a=t===o?(n-r)/s+6*(n<r):n===o?(r-t)/s+2:(t-n)/s+4,s/=l<.5?o+i:2-o-i,a*=60):s=l>0&&l<1?0:a,new ln(a,s,l,e.opacity)}(e):new ln(e,t,n,null==r?1:r)}),Ft(zt,{brighter:function(e){return e=null==e?$t:Math.pow($t,e),new ln(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=null==e?_t:Math.pow(_t,e),new ln(this.h,this.s,this.l*e,this.opacity)},rgb:function(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new on(un(e>=240?e-240:e+120,i,r),un(e,i,r),un(e<120?e+240:e-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1}}));var cn=Math.PI/180,dn=180/Math.PI,mn=.96422,fn=1,pn=.82521,hn=4/29,yn=6/29,gn=3*yn*yn,vn=yn*yn*yn;function bn(e){if(e instanceof xn)return new xn(e.l,e.a,e.b,e.opacity);if(e instanceof qn){if(isNaN(e.h))return new xn(e.l,0,0,e.opacity);var t=e.h*cn;return new xn(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}e instanceof on||(e=nn(e));var n,r,i=Cn(e.r),o=Cn(e.g),a=Cn(e.b),s=Sn((.2225045*i+.7168786*o+.0606169*a)/fn);return i===o&&o===a?n=r=s:(n=Sn((.4360747*i+.3850649*o+.1430804*a)/mn),r=Sn((.0139322*i+.0971045*o+.7141733*a)/pn)),new xn(116*s-16,500*(n-s),200*(s-r),e.opacity)}function xn(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function Sn(e){return e>vn?Math.pow(e,1/3):e/gn+hn}function Mn(e){return e>yn?e*e*e:gn*(e-hn)}function En(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Cn(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function qn(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}Pt(xn,(function(e,t,n,r){return 1===arguments.length?bn(e):new xn(e,t,n,null==r?1:r)}),Ft(zt,{brighter:function(e){return new xn(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker:function(e){return new xn(this.l-18*(null==e?1:e),this.a,this.b,this.opacity)},rgb:function(){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 on(En(3.1338561*(t=mn*Mn(t))-1.6168667*(e=fn*Mn(e))-.4906146*(n=pn*Mn(n))),En(-.9787684*t+1.9161415*e+.033454*n),En(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),Pt(qn,(function(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof qn)return new qn(e.h,e.c,e.l,e.opacity);if(e instanceof xn||(e=bn(e)),0===e.a&&0===e.b)return new qn(NaN,0,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*dn;return new qn(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new qn(e,t,n,null==r?1:r)}),Ft(zt,{brighter:function(e){return new qn(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker:function(e){return new qn(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb:function(){return bn(this).rgb()}}));var An=-.14861,On=1.78277,Dn=-.29227,In=-.90649,wn=1.97294,Tn=wn*In,Nn=wn*On,Ln=On*Dn-In*An;function kn(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof Rn)return new Rn(e.h,e.s,e.l,e.opacity);e instanceof on||(e=nn(e));var t=e.r/255,n=e.g/255,r=e.b/255,i=(Ln*r+Tn*t-Nn*n)/(Ln+Tn-Nn),o=r-i,a=(wn*(n-i)-Dn*o)/In,s=Math.sqrt(a*a+o*o)/(wn*i*(1-i)),l=s?Math.atan2(a,o)*dn-120:NaN;return new Rn(l<0?l+360:l,s,i,e.opacity)}(e):new Rn(e,t,n,null==r?1:r)}function Rn(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function Pn(e){return function(){return e}}function Fn(e,t){return function(n){return e+n*t}}function zn(e){return 1==(e=+e)?_n: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(r){return Math.pow(e+r*t,n)}}(t,n,e):Pn(isNaN(t)?n:t)}}function _n(e,t){var n=t-e;return n?Fn(e,n):Pn(isNaN(e)?t:e)}Pt(Rn,kn,Ft(zt,{brighter:function(e){return e=null==e?$t:Math.pow($t,e),new Rn(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=null==e?_t:Math.pow(_t,e),new Rn(this.h,this.s,this.l*e,this.opacity)},rgb:function(){var e=isNaN(this.h)?0:(this.h+120)*cn,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),r=Math.cos(e),i=Math.sin(e);return new on(255*(t+n*(An*r+On*i)),255*(t+n*(Dn*r+In*i)),255*(t+n*(wn*r)),this.opacity)}}));var $n=function e(t){var n=zn(t);function r(e,t){var r=n((e=rn(e)).r,(t=rn(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),a=_n(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=o(t),e.opacity=a(t),e+""}}return r.gamma=e,r}(1);function Hn(e,t){var n,r=t?t.length:0,i=e?Math.min(r,e.length):0,o=new Array(i),a=new Array(r);for(n=0;n<i;++n)o[n]=Gn(e[n],t[n]);for(;n<r;++n)a[n]=t[n];return function(e){for(n=0;n<i;++n)a[n]=o[n](e);return a}}function jn(e,t){var n=new Date;return t-=e=+e,function(r){return n.setTime(e+t*r),n}}function Vn(e,t){return t-=e=+e,function(n){return e+t*n}}function Bn(e,t){var n,r={},i={};for(n in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)n in e?r[n]=Gn(e[n],t[n]):i[n]=t[n];return function(e){for(n in r)i[n]=r[n](e);return i}}var Un=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Yn=new RegExp(Un.source,"g");function Wn(e,t){var n,r,i,o=Un.lastIndex=Yn.lastIndex=0,a=-1,s=[],l=[];for(e+="",t+="";(n=Un.exec(e))&&(r=Yn.exec(t));)(i=r.index)>o&&(i=t.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(n=n[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,l.push({i:a,x:Vn(n,r)})),o=Yn.lastIndex;return o<t.length&&(i=t.slice(o),s[a]?s[a]+=i:s[++a]=i),s.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,r=0;r<t;++r)s[(n=l[r]).i]=n.x(e);return s.join("")})}function Gn(e,t){var n,r=typeof t;return null==t||"boolean"===r?Pn(t):("number"===r?Vn:"string"===r?(n=Qt(t))?(t=n,$n):Wn:t instanceof Qt?$n:t instanceof Date?jn:Array.isArray(t)?Hn:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?Bn:Vn)(e,t)}function Xn(e,t){return t-=e=+e,function(n){return Math.round(e+t*n)}}function Kn(e){return function t(n){function r(t,r){var i=e((t=kn(t)).h,(r=kn(r)).h),o=_n(t.s,r.s),a=_n(t.l,r.l),s=_n(t.opacity,r.opacity);return function(e){return t.h=i(e),t.s=o(e),t.l=a(Math.pow(e,n)),t.opacity=s(e),t+""}}return n=+n,r.gamma=t,r}(1)}function Jn(e){return+e}Kn((function(e,t){var n=t-e;return n?Fn(e,n>180||n<-180?n-360*Math.round(n/360):n):Pn(isNaN(e)?t:e)})),Kn(_n);var Zn=[0,1];function Qn(e){return e}function er(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:function(e){return function(){return e}}(isNaN(t)?NaN:.5)}function tr(e){var t,n=e[0],r=e[e.length-1];return n>r&&(t=n,n=r,r=t),function(e){return Math.max(n,Math.min(r,e))}}function nr(e,t,n){var r=e[0],i=e[1],o=t[0],a=t[1];return i<r?(r=er(i,r),o=n(a,o)):(r=er(r,i),o=n(o,a)),function(e){return o(r(e))}}function rr(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),o=new Array(r),a=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++a<r;)i[a]=er(e[a],e[a+1]),o[a]=n(t[a],t[a+1]);return function(t){var n=St(e,t,1,r)-1;return o[n](i[n](t))}}function ir(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function or(e,t){return function(){var e,t,n,r,i,o,a=Zn,s=Zn,l=Gn,u=Qn;function c(){return r=Math.min(a.length,s.length)>2?rr:nr,i=o=null,d}function d(t){return isNaN(t=+t)?n:(i||(i=r(a.map(e),s,l)))(e(u(t)))}return d.invert=function(n){return u(t((o||(o=r(s,a.map(e),Vn)))(n)))},d.domain=function(e){return arguments.length?(a=kt.call(e,Jn),u===Qn||(u=tr(a)),c()):a.slice()},d.range=function(e){return arguments.length?(s=Rt.call(e),c()):s.slice()},d.rangeRound=function(e){return s=Rt.call(e),l=Xn,c()},d.clamp=function(e){return arguments.length?(u=e?tr(a):Qn,d):u!==Qn},d.interpolate=function(e){return arguments.length?(l=e,c()):l},d.unknown=function(e){return arguments.length?(n=e,d):n},function(n,r){return e=n,t=r,c()}}()(e,t)}function ar(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function sr(e){return(e=ar(Math.abs(e)))?e[1]:NaN}var lr,ur=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function cr(e){return new dr(e)}function dr(e){if(!(t=ur.exec(e)))throw new Error("invalid format: "+e);var t;this.fill=t[1]||" ",this.align=t[2]||">",this.sign=t[3]||"-",this.symbol=t[4]||"",this.zero=!!t[5],this.width=t[6]&&+t[6],this.comma=!!t[7],this.precision=t[8]&&+t[8].slice(1),this.trim=!!t[9],this.type=t[10]||""}function mr(e,t){var n=ar(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}cr.prototype=dr.prototype,dr.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(null==this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(null==this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var fr={"%":function(e,t){return(100*e).toFixed(t)},b:function(e){return Math.round(e).toString(2)},c:function(e){return e+""},d:function(e){return Math.round(e).toString(10)},e:function(e,t){return e.toExponential(t)},f:function(e,t){return e.toFixed(t)},g:function(e,t){return e.toPrecision(t)},o:function(e){return Math.round(e).toString(8)},p:function(e,t){return mr(100*e,t)},r:mr,s:function(e,t){var n=ar(e,t);if(!n)return e+"";var r=n[0],i=n[1],o=i-(lr=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+ar(e,Math.max(0,t+o-1))[0]},X:function(e){return Math.round(e).toString(16).toUpperCase()},x:function(e){return Math.round(e).toString(16)}};function pr(e){return e}var hr,yr,gr,vr=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function br(e){var t,n,r=e.grouping&&e.thousands?(t=e.grouping,n=e.thousands,function(e,r){for(var i=e.length,o=[],a=0,s=t[0],l=0;i>0&&s>0&&(l+s+1>r&&(s=Math.max(1,r-l)),o.push(e.substring(i-=s,i+s)),!((l+=s+1)>r));)s=t[a=(a+1)%t.length];return o.reverse().join(n)}):pr,i=e.currency,o=e.decimal,a=e.numerals?function(e){return function(t){return t.replace(/[0-9]/g,(function(t){return e[+t]}))}}(e.numerals):pr,s=e.percent||"%";function l(e){var t=(e=cr(e)).fill,n=e.align,l=e.sign,u=e.symbol,c=e.zero,d=e.width,m=e.comma,f=e.precision,p=e.trim,h=e.type;"n"===h?(m=!0,h="g"):fr[h]||(null==f&&(f=12),p=!0,h="g"),(c||"0"===t&&"="===n)&&(c=!0,t="0",n="=");var y="$"===u?i[0]:"#"===u&&/[boxX]/.test(h)?"0"+h.toLowerCase():"",g="$"===u?i[1]:/[%p]/.test(h)?s:"",v=fr[h],b=/[defgprs%]/.test(h);function x(e){var i,s,u,x=y,S=g;if("c"===h)S=v(e)+S,e="";else{var M=(e=+e)<0;if(e=v(Math.abs(e),f),p&&(e=function(e){e:for(var t,n=e.length,r=1,i=-1;r<n;++r)switch(e[r]){case".":i=t=r;break;case"0":0===i&&(i=r),t=r;break;default:if(i>0){if(!+e[r])break e;i=0}}return i>0?e.slice(0,i)+e.slice(t+1):e}(e)),M&&0==+e&&(M=!1),x=(M?"("===l?l:"-":"-"===l||"("===l?"":l)+x,S=("s"===h?vr[8+lr/3]:"")+S+(M&&"("===l?")":""),b)for(i=-1,s=e.length;++i<s;)if(48>(u=e.charCodeAt(i))||u>57){S=(46===u?o+e.slice(i+1):e.slice(i))+S,e=e.slice(0,i);break}}m&&!c&&(e=r(e,1/0));var E=x.length+e.length+S.length,C=E<d?new Array(d-E+1).join(t):"";switch(m&&c&&(e=r(C+e,C.length?d-S.length:1/0),C=""),n){case"<":e=x+e+S+C;break;case"=":e=x+C+e+S;break;case"^":e=C.slice(0,E=C.length>>1)+x+e+S+C.slice(E);break;default:e=C+x+e+S}return a(e)}return f=null==f?6:/[gprs]/.test(h)?Math.max(1,Math.min(21,f)):Math.max(0,Math.min(20,f)),x.toString=function(){return e+""},x}return{format:l,formatPrefix:function(e,t){var n=l(((e=cr(e)).type="f",e)),r=3*Math.max(-8,Math.min(8,Math.floor(sr(t)/3))),i=Math.pow(10,-r),o=vr[8+r/3];return function(e){return n(i*e)+o}}}}function xr(e,t,n,r){var i,o=At(e,t,n);switch((r=cr(null==r?",f":r)).type){case"s":var a=Math.max(Math.abs(e),Math.abs(t));return null!=r.precision||isNaN(i=function(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(sr(t)/3)))-sr(Math.abs(e)))}(o,a))||(r.precision=i),gr(r,a);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=function(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,sr(t)-sr(e))+1}(o,Math.max(Math.abs(e),Math.abs(t))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=function(e){return Math.max(0,-sr(Math.abs(e)))}(o))||(r.precision=i-2*("%"===r.type))}return yr(r)}function Sr(e){var t=e.domain;return e.ticks=function(e){var n=t();return function(e,t,n){var r,i,o,a,s=-1;if(n=+n,(e=+e)==(t=+t)&&n>0)return[e];if((r=t<e)&&(i=e,e=t,t=i),0===(a=qt(e,t,n))||!isFinite(a))return[];if(a>0)for(e=Math.ceil(e/a),t=Math.floor(t/a),o=new Array(i=Math.ceil(t-e+1));++s<i;)o[s]=(e+s)*a;else for(e=Math.floor(e*a),t=Math.ceil(t*a),o=new Array(i=Math.ceil(e-t+1));++s<i;)o[s]=(e-s)/a;return r&&o.reverse(),o}(n[0],n[n.length-1],null==e?10:e)},e.tickFormat=function(e,n){var r=t();return xr(r[0],r[r.length-1],null==e?10:e,n)},e.nice=function(n){null==n&&(n=10);var r,i=t(),o=0,a=i.length-1,s=i[o],l=i[a];return l<s&&(r=s,s=l,l=r,r=o,o=a,a=r),(r=qt(s,l,n))>0?r=qt(s=Math.floor(s/r)*r,l=Math.ceil(l/r)*r,n):r<0&&(r=qt(s=Math.ceil(s*r)/r,l=Math.floor(l*r)/r,n)),r>0?(i[o]=Math.floor(s/r)*r,i[a]=Math.ceil(l/r)*r,t(i)):r<0&&(i[o]=Math.ceil(s*r)/r,i[a]=Math.floor(l*r)/r,t(i)),e},e}function Mr(){var e=or(Qn,Qn);return e.copy=function(){return ir(e,Mr())},Ot.apply(e,arguments),Sr(e)}hr=br({decimal:".",thousands:",",grouping:[3],currency:["$",""]}),yr=hr.format,gr=hr.formatPrefix;var Er=new Date,Cr=new Date;function qr(e,t,n,r){function i(t){return e(t=new Date(+t)),t}return i.floor=i,i.ceil=function(n){return e(n=new Date(n-1)),t(n,1),e(n),n},i.round=function(e){var t=i(e),n=i.ceil(e);return e-t<n-e?t:n},i.offset=function(e,n){return t(e=new Date(+e),null==n?1:Math.floor(n)),e},i.range=function(n,r,o){var a,s=[];if(n=i.ceil(n),o=null==o?1:Math.floor(o),!(n<r&&o>0))return s;do{s.push(a=new Date(+n)),t(n,o),e(n)}while(a<n&&n<r);return s},i.filter=function(n){return qr((function(t){if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)}),(function(e,r){if(e>=e)if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););}))},n&&(i.count=function(t,r){return Er.setTime(+t),Cr.setTime(+r),e(Er),e(Cr),Math.floor(n(Er,Cr))},i.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?i.filter(r?function(t){return r(t)%e==0}:function(t){return i.count(0,t)%e==0}):i:null}),i}var Ar=qr((function(){}),(function(e,t){e.setTime(+e+t)}),(function(e,t){return t-e}));Ar.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?qr((function(t){t.setTime(Math.floor(t/e)*e)}),(function(t,n){t.setTime(+t+n*e)}),(function(t,n){return(n-t)/e})):Ar:null},Ar.range;var Or=1e3,Dr=6e4,Ir=36e5,wr=864e5,Tr=6048e5,Nr=qr((function(e){e.setTime(Math.floor(e/Or)*Or)}),(function(e,t){e.setTime(+e+t*Or)}),(function(e,t){return(t-e)/Or}),(function(e){return e.getUTCSeconds()}));Nr.range;var Lr=qr((function(e){e.setTime(Math.floor(e/Dr)*Dr)}),(function(e,t){e.setTime(+e+t*Dr)}),(function(e,t){return(t-e)/Dr}),(function(e){return e.getMinutes()}));Lr.range;var kr=qr((function(e){var t=e.getTimezoneOffset()*Dr%Ir;t<0&&(t+=Ir),e.setTime(Math.floor((+e-t)/Ir)*Ir+t)}),(function(e,t){e.setTime(+e+t*Ir)}),(function(e,t){return(t-e)/Ir}),(function(e){return e.getHours()}));kr.range;var Rr=qr((function(e){e.setHours(0,0,0,0)}),(function(e,t){e.setDate(e.getDate()+t)}),(function(e,t){return(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Dr)/wr}),(function(e){return e.getDate()-1}));function Pr(e){return qr((function(t){t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)}),(function(e,t){e.setDate(e.getDate()+7*t)}),(function(e,t){return(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Dr)/Tr}))}Rr.range;var Fr=Pr(0),zr=Pr(1),_r=Pr(2),$r=Pr(3),Hr=Pr(4),jr=Pr(5),Vr=Pr(6);Fr.range,zr.range,_r.range,$r.range,Hr.range,jr.range,Vr.range;var Br=qr((function(e){e.setDate(1),e.setHours(0,0,0,0)}),(function(e,t){e.setMonth(e.getMonth()+t)}),(function(e,t){return t.getMonth()-e.getMonth()+12*(t.getFullYear()-e.getFullYear())}),(function(e){return e.getMonth()}));Br.range;var Ur=qr((function(e){e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,t){e.setFullYear(e.getFullYear()+t)}),(function(e,t){return t.getFullYear()-e.getFullYear()}),(function(e){return e.getFullYear()}));Ur.every=function(e){return isFinite(e=Math.floor(e))&&e>0?qr((function(t){t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,n){t.setFullYear(t.getFullYear()+n*e)})):null},Ur.range;var Yr=qr((function(e){e.setUTCSeconds(0,0)}),(function(e,t){e.setTime(+e+t*Dr)}),(function(e,t){return(t-e)/Dr}),(function(e){return e.getUTCMinutes()}));Yr.range;var Wr=qr((function(e){e.setUTCMinutes(0,0,0)}),(function(e,t){e.setTime(+e+t*Ir)}),(function(e,t){return(t-e)/Ir}),(function(e){return e.getUTCHours()}));Wr.range;var Gr=qr((function(e){e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+t)}),(function(e,t){return(t-e)/wr}),(function(e){return e.getUTCDate()-1}));function Xr(e){return qr((function(t){t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+7*t)}),(function(e,t){return(t-e)/Tr}))}Gr.range;var Kr=Xr(0),Jr=Xr(1),Zr=Xr(2),Qr=Xr(3),ei=Xr(4),ti=Xr(5),ni=Xr(6);Kr.range,Jr.range,Zr.range,Qr.range,ei.range,ti.range,ni.range;var ri=qr((function(e){e.setUTCDate(1),e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCMonth(e.getUTCMonth()+t)}),(function(e,t){return t.getUTCMonth()-e.getUTCMonth()+12*(t.getUTCFullYear()-e.getUTCFullYear())}),(function(e){return e.getUTCMonth()}));ri.range;var ii=qr((function(e){e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCFullYear(e.getUTCFullYear()+t)}),(function(e,t){return t.getUTCFullYear()-e.getUTCFullYear()}),(function(e){return e.getUTCFullYear()}));function oi(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 ai(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 si(e){return{y:e,m:0,d:1,H:0,M:0,S:0,L:0}}ii.every=function(e){return isFinite(e=Math.floor(e))&&e>0?qr((function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n*e)})):null},ii.range;var li,ui,ci,di={"-":"",_:" ",0:"0"},mi=/^\s*\d+/,fi=/^%/,pi=/[\\^$*+?|[\]().{}]/g;function hi(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",o=i.length;return r+(o<n?new Array(n-o+1).join(t)+i:i)}function yi(e){return e.replace(pi,"\\$&")}function gi(e){return new RegExp("^(?:"+e.map(yi).join("|")+")","i")}function vi(e){for(var t={},n=-1,r=e.length;++n<r;)t[e[n].toLowerCase()]=n;return t}function bi(e,t,n){var r=mi.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function xi(e,t,n){var r=mi.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function Si(e,t,n){var r=mi.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function Mi(e,t,n){var r=mi.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function Ei(e,t,n){var r=mi.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function Ci(e,t,n){var r=mi.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function qi(e,t,n){var r=mi.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Ai(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Oi(e,t,n){var r=mi.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function Di(e,t,n){var r=mi.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Ii(e,t,n){var r=mi.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function wi(e,t,n){var r=mi.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Ti(e,t,n){var r=mi.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Ni(e,t,n){var r=mi.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Li(e,t,n){var r=mi.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function ki(e,t,n){var r=mi.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Ri(e,t,n){var r=fi.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Pi(e,t,n){var r=mi.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Fi(e,t,n){var r=mi.exec(t.slice(n));return r?(e.Q=1e3*+r[0],n+r[0].length):-1}function zi(e,t){return hi(e.getDate(),t,2)}function _i(e,t){return hi(e.getHours(),t,2)}function $i(e,t){return hi(e.getHours()%12||12,t,2)}function Hi(e,t){return hi(1+Rr.count(Ur(e),e),t,3)}function ji(e,t){return hi(e.getMilliseconds(),t,3)}function Vi(e,t){return ji(e,t)+"000"}function Bi(e,t){return hi(e.getMonth()+1,t,2)}function Ui(e,t){return hi(e.getMinutes(),t,2)}function Yi(e,t){return hi(e.getSeconds(),t,2)}function Wi(e){var t=e.getDay();return 0===t?7:t}function Gi(e,t){return hi(Fr.count(Ur(e),e),t,2)}function Xi(e,t){var n=e.getDay();return e=n>=4||0===n?Hr(e):Hr.ceil(e),hi(Hr.count(Ur(e),e)+(4===Ur(e).getDay()),t,2)}function Ki(e){return e.getDay()}function Ji(e,t){return hi(zr.count(Ur(e),e),t,2)}function Zi(e,t){return hi(e.getFullYear()%100,t,2)}function Qi(e,t){return hi(e.getFullYear()%1e4,t,4)}function eo(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+hi(t/60|0,"0",2)+hi(t%60,"0",2)}function to(e,t){return hi(e.getUTCDate(),t,2)}function no(e,t){return hi(e.getUTCHours(),t,2)}function ro(e,t){return hi(e.getUTCHours()%12||12,t,2)}function io(e,t){return hi(1+Gr.count(ii(e),e),t,3)}function oo(e,t){return hi(e.getUTCMilliseconds(),t,3)}function ao(e,t){return oo(e,t)+"000"}function so(e,t){return hi(e.getUTCMonth()+1,t,2)}function lo(e,t){return hi(e.getUTCMinutes(),t,2)}function uo(e,t){return hi(e.getUTCSeconds(),t,2)}function co(e){var t=e.getUTCDay();return 0===t?7:t}function mo(e,t){return hi(Kr.count(ii(e),e),t,2)}function fo(e,t){var n=e.getUTCDay();return e=n>=4||0===n?ei(e):ei.ceil(e),hi(ei.count(ii(e),e)+(4===ii(e).getUTCDay()),t,2)}function po(e){return e.getUTCDay()}function ho(e,t){return hi(Jr.count(ii(e),e),t,2)}function yo(e,t){return hi(e.getUTCFullYear()%100,t,2)}function go(e,t){return hi(e.getUTCFullYear()%1e4,t,4)}function vo(){return"+0000"}function bo(){return"%"}function xo(e){return+e}function So(e){return Math.floor(+e/1e3)}!function(e){li=function(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,o=e.days,a=e.shortDays,s=e.months,l=e.shortMonths,u=gi(i),c=vi(i),d=gi(o),m=vi(o),f=gi(a),p=vi(a),h=gi(s),y=vi(s),g=gi(l),v=vi(l),b={a:function(e){return a[e.getDay()]},A:function(e){return o[e.getDay()]},b:function(e){return l[e.getMonth()]},B:function(e){return s[e.getMonth()]},c:null,d:zi,e:zi,f:Vi,H:_i,I:$i,j:Hi,L:ji,m:Bi,M:Ui,p:function(e){return i[+(e.getHours()>=12)]},Q:xo,s:So,S:Yi,u:Wi,U:Gi,V:Xi,w:Ki,W:Ji,x:null,X:null,y:Zi,Y:Qi,Z:eo,"%":bo},x={a:function(e){return a[e.getUTCDay()]},A:function(e){return o[e.getUTCDay()]},b:function(e){return l[e.getUTCMonth()]},B:function(e){return s[e.getUTCMonth()]},c:null,d:to,e:to,f:ao,H:no,I:ro,j:io,L:oo,m:so,M:lo,p:function(e){return i[+(e.getUTCHours()>=12)]},Q:xo,s:So,S:uo,u:co,U:mo,V:fo,w:po,W:ho,x:null,X:null,y:yo,Y:go,Z:vo,"%":bo},S={a:function(e,t,n){var r=f.exec(t.slice(n));return r?(e.w=p[r[0].toLowerCase()],n+r[0].length):-1},A:function(e,t,n){var r=d.exec(t.slice(n));return r?(e.w=m[r[0].toLowerCase()],n+r[0].length):-1},b:function(e,t,n){var r=g.exec(t.slice(n));return r?(e.m=v[r[0].toLowerCase()],n+r[0].length):-1},B:function(e,t,n){var r=h.exec(t.slice(n));return r?(e.m=y[r[0].toLowerCase()],n+r[0].length):-1},c:function(e,n,r){return C(e,t,n,r)},d:Di,e:Di,f:ki,H:wi,I:wi,j:Ii,L:Li,m:Oi,M:Ti,p:function(e,t,n){var r=u.exec(t.slice(n));return r?(e.p=c[r[0].toLowerCase()],n+r[0].length):-1},Q:Pi,s:Fi,S:Ni,u:xi,U:Si,V:Mi,w:bi,W:Ei,x:function(e,t,r){return C(e,n,t,r)},X:function(e,t,n){return C(e,r,t,n)},y:qi,Y:Ci,Z:Ai,"%":Ri};function M(e,t){return function(n){var r,i,o,a=[],s=-1,l=0,u=e.length;for(n instanceof Date||(n=new Date(+n));++s<u;)37===e.charCodeAt(s)&&(a.push(e.slice(l,s)),null!=(i=di[r=e.charAt(++s)])?r=e.charAt(++s):i="e"===r?" ":"0",(o=t[r])&&(r=o(n,i)),a.push(r),l=s+1);return a.push(e.slice(l,s)),a.join("")}}function E(e,t){return function(n){var r,i,o=si(1900);if(C(o,e,n+="",0)!=n.length)return null;if("Q"in o)return new Date(o.Q);if("p"in o&&(o.H=o.H%12+12*o.p),"V"in o){if(o.V<1||o.V>53)return null;"w"in o||(o.w=1),"Z"in o?(i=(r=ai(si(o.y))).getUTCDay(),r=i>4||0===i?Jr.ceil(r):Jr(r),r=Gr.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(i=(r=t(si(o.y))).getDay(),r=i>4||0===i?zr.ceil(r):zr(r),r=Rr.offset(r,7*(o.V-1)),o.y=r.getFullYear(),o.m=r.getMonth(),o.d=r.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),i="Z"in o?ai(si(o.y)).getUTCDay():t(si(o.y)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(i+5)%7:o.w+7*o.U-(i+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,ai(o)):t(o)}}function C(e,t,n,r){for(var i,o,a=0,s=t.length,l=n.length;a<s;){if(r>=l)return-1;if(37===(i=t.charCodeAt(a++))){if(i=t.charAt(a++),!(o=S[i in di?t.charAt(a++):i])||(r=o(e,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return b.x=M(n,b),b.X=M(r,b),b.c=M(t,b),x.x=M(n,x),x.X=M(r,x),x.c=M(t,x),{format:function(e){var t=M(e+="",b);return t.toString=function(){return e},t},parse:function(e){var t=E(e+="",oi);return t.toString=function(){return e},t},utcFormat:function(e){var t=M(e+="",x);return t.toString=function(){return e},t},utcParse:function(e){var t=E(e,ai);return t.toString=function(){return e},t}}}(e),li.format,li.parse,ui=li.utcFormat,ci=li.utcParse}({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"]});var Mo="%Y-%m-%dT%H:%M:%S.%LZ";Date.prototype.toISOString||ui(Mo),+new Date("2000-01-01T00:00:00.000Z")||ci(Mo);var Eo=1e3,Co=60*Eo,qo=60*Co,Ao=24*qo,Oo=7*Ao,Do=30*Ao,Io=365*Ao;function wo(e){return new Date(e)}function To(e){return e instanceof Date?+e:+new Date(+e)}function No(e,t,n,r,i,o,a,s,l){var u=or(Qn,Qn),c=u.invert,d=u.domain,m=l(".%L"),f=l(":%S"),p=l("%I:%M"),h=l("%I %p"),y=l("%a %d"),g=l("%b %d"),v=l("%B"),b=l("%Y"),x=[[a,1,Eo],[a,5,5*Eo],[a,15,15*Eo],[a,30,30*Eo],[o,1,Co],[o,5,5*Co],[o,15,15*Co],[o,30,30*Co],[i,1,qo],[i,3,3*qo],[i,6,6*qo],[i,12,12*qo],[r,1,Ao],[r,2,2*Ao],[n,1,Oo],[t,1,Do],[t,3,3*Do],[e,1,Io]];function S(s){return(a(s)<s?m:o(s)<s?f:i(s)<s?p:r(s)<s?h:t(s)<s?n(s)<s?y:g:e(s)<s?v:b)(s)}function M(t,n,r,i){if(null==t&&(t=10),"number"==typeof t){var o=Math.abs(r-n)/t,a=xt((function(e){return e[2]})).right(x,o);a===x.length?(i=At(n/Io,r/Io,t),t=e):a?(i=(a=x[o/x[a-1][2]<x[a][2]/o?a-1:a])[1],t=a[0]):(i=Math.max(At(n,r,t),1),t=s)}return null==i?t:t.every(i)}return u.invert=function(e){return new Date(c(e))},u.domain=function(e){return arguments.length?d(kt.call(e,To)):d().map(wo)},u.ticks=function(e,t){var n,r=d(),i=r[0],o=r[r.length-1],a=o<i;return a&&(n=i,i=o,o=n),n=(n=M(e,i,o,t))?n.range(i,o+1):[],a?n.reverse():n},u.tickFormat=function(e,t){return null==t?S:l(t)},u.nice=function(e,t){var n=d();return(e=M(e,n[0],n[n.length-1],t))?d(function(e,t){var n,r=0,i=(e=e.slice()).length-1,o=e[r],a=e[i];return a<o&&(n=r,r=i,i=n,n=o,o=a,a=n),e[r]=t.floor(o),e[i]=t.ceil(a),e}(n,e)):u},u.copy=function(){return ir(u,No(e,t,n,r,i,o,a,s,l))},u}function Lo(){return Ot.apply(No(ii,ri,Kr,Gr,Wr,Yr,Nr,Ar,ui).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}const ko={horizontal:{major:"width",minor:"height",start:"left",end:"right",shadow:{startOffset:"12px 0",endOffset:"-12px 0"}},vertical:{major:"height",minor:"width",start:"top",end:"bottom",shadow:{startOffset:"0 12px",endOffset:"0 -12px"}}},Ro=e=>`${e} 12px -12px inset rgba(0, 0, 0, 0.0625)`;var Po={defaultSettings:{settings:{orientation:"horizontal",rtl:!1,range:()=>[0,1]}},renderer:"dom",render(e){const{range:t,orientation:n,rtl:r}=this.settings.settings,[i,o]=t(),a=Math.abs(i)<1e-15,s=Math.abs(o-1)<1e-15,l=(e=>{const t=ko[e];return{base:{position:"absolute",[t.major]:12,[t.minor]:"100%"},towardsStart:{[t.start]:0,[t.end]:"auto",boxShadow:Ro(t.shadow.startOffset)},towardsEnd:{[t.start]:"auto",[t.end]:0,boxShadow:Ro(t.shadow.endOffset)}}})(n),u="horizontal"===n&&r,c=[];return a||c.push(e("div",{style:{...l.base,...u?l.towardsEnd:l.towardsStart},class:"scroll-hint--towards-start"})),s||c.push(e("div",{style:{...l.base,...u?l.towardsStart:l.towardsEnd},class:"scroll-hint--towards-end"})),c}};function Fo({viewState:e,viewCache:t,layoutService:n,dockService:r,rtl:i}){return!n.meta.isSnapshot&&{key:"scroll-hint",type:"scroll-hint",settings:{orientation:r.meta.major.orientation,rtl:i,range:()=>function({layoutService:e,viewState:t,viewCache:n}){return e.meta.isContinuous?function(e,t){const n=e.get("zoom"),r=t.get("continuousMin"),i=t.get("continuousMax");return[(n.min-r)/(i-r),(n.max-r)/(i-r)]}(t,n):function(e){return e.get("viewRange")}(t)}({layoutService:n,viewState:e,viewCache:t})}}}let zo;function _o(){zo=zo||document.createElement("canvas").getContext("2d")}const $o={measureTextWidth(e){_o();const{width:t}=zo.measureText(e);return t},lineWrap(e,t,n,r){let i,o;_o();const a=e?e.split(/\n+|\r+|\r\n/):[],s=[];let l,u,c,d,m=e?e.split(/\s+/):[],f=a[0];if("number"!=typeof t||t<=0)return[e];if("number"==typeof r&&a.length>=r)return a.slice(0,r);for(n&&(zo.font=n),o=0;o<a.length;o++){for(d=a[o]||"",m=d.split(/\s+/),[f]=m,c="",i=1;i<m.length;i++)if(l=`${f} ${m[i]}`,u=$o.measureTextWidth(l),u>t&&("number"!=typeof r||r>s.length)?(s.push(f),f=m[i]):f=l,"number"==typeof r&&s.length>=r){c=m.slice(i+1).join(" ");break}"number"!=typeof r||s.length<r?s.push(f):s[Math.max(0,s.length-1)]=`${s[Math.max(0,s.length-1)]||""} ${f} ${c}`}return s},wordWrap(e,t,n,r,i){if(_o(),!e||!e.length)return[];n&&(zo.font=n);let o=[];const a=e.slice();let s,l,u,c;if(a.filter((e=>!!e)),"number"!=typeof t||t<0)return e.slice();for(c=0;c<a.length;c++)u=a[c],l=null,u&&(u.length<=1||$o.measureTextWidth(u)<=t?o.push(u):(s=$o.splitWord(u,t,void 0,r-o.length),s.length<=1?o.push(s[0]):(l=s.pop(),o=o.concat(s),a[c+1]?$o.measureTextWidth(`${l} ${a[c+1]}`)>t&&o.length+a.length-c<=r?a.splice(c+1,0,l):a[c+1]=`${l} ${a[c+1]}`:a.push(l))));return o.forEach(((e,t,n)=>{n[t]=e?e.trim():e})),o.length>r?(o=o.splice(0,r),o[o.length-1]=$o.truncate(o[o.length-1],t,n,i).text):(u=o[o.length-1],u&&u.length>1&&$o.measureTextWidth(u)>t&&(o[o.length-1]=$o.truncate(u,t,n,i).text)),o},truncate(e,t,n,r="…"){_o();let i,o,a,s,l=e;const u=$o.measureTextWidth("i"),c=Math.ceil(t/u);if(n&&(zo.font=n),e&&t){if($o.measureTextWidth(l)>t){for(i=Math.min(c,l.length);i>0;i--)if(o=l.substring(0,i-1),a=o.trim()+r,$o.measureTextWidth(a)<=t){s=l.substring(i-1),l=a;break}i||(s=l,l="…")}}else s=void 0;return{text:l,rest:s}},isNumber:e=>"number"==typeof e&&Number.isFinite(e),explodeWord(e,t,n,r){let i;_o();let o,a=e,s="",l=[];if($o.isNumber(n)&&n<=1)return[e];const u=Math.ceil(t/r);for(i=Math.min(e.length,u);i>0&&(a=e.substring(0,i),o=e.substring(i-1,i)," "===o?a=e.substring(0,i-1):a+="-",s=e.substring(i),!($o.measureTextWidth(a)<=t));i--);return(!i&&!a||$o.measureTextWidth(a)>t)&&(a=e.substring(0,1),s=e.substring(1)),l.push(a),s?($o.measureTextWidth(s)>t?(s=$o.explodeWord(s,t,n-1,r),l=l.concat(s)):l.push(s),l.filter((e=>""!==e.trim()))):l},splitWord:(e,t,n,r)=>(_o(),e&&t?(n&&(zo.font=n),$o.explodeWord(e,t,r,Math.max(1,$o.measureTextWidth("i")))):[]),wrapText(e,t,n,r,i){let o;return Number.isNaN(t)?[e]:(o=r>1?$o.lineWrap(e,t,n,r):[e],o=$o.wordWrap(o,t,n,r,i),o)},getFontHeight:e=>(_o(),e&&(zo.font=e),1.5*$o.measureTextWidth("m")),tokenize(e,t,n,r,i,o,a=1){_o(),t&&(zo.font=t);const s=$o.getFontHeight(),l=a*s;let u=[],c=0,d=[];if(o<s)return[];const m=o?Math.max(1,Math.floor(o/l)):r||1;return Array.isArray(r)?(r.forEach((e=>{c+=Number.isNaN(e)||e<=0?0:e})),r.forEach((e=>{u.push(Number.isNaN(e)||e<=0?m-c:e)}))):u=[Number.isNaN(r)||r<=0?m:Math.min(m,r)],Array.isArray(e)?e.forEach(((e,n)=>{d.length<m&&(d=d.concat($o.wrapText(e,i,t,u[n])))})):d=$o.wrapText(e,i,t,u[0],n),d}},Ho={getDefaultSettings:({size:e=10,fill:t="#999",alignment:n}={})=>({show:!0,type:"n-polygon",fill:t,stroke:"#000",strokeWidth:0,size:e,sides:3,startAngle:-90,alignment:n}),createOob({oob:e,dockValue:t,boxCenter:n,rendWidth:r,rendHeight:i,flipXY:o,symbol:a}){let s="x",l="y",u=r,c=i,d=t<.5?90:-90;return o&&(s="y",l="x",u=i,c=r,d=t<.5?180:0),a(G({},e,{[s]:n*u,[l]:Math.max(e.size/2,Math.min(t*c,c-e.size/2)),startAngle:d}))}},jo=G.bind(null,!0),Vo={},{isArray:Bo}=Array;function Uo(e){return null!=e&&!Array.isArray(e)&&"object"==typeof e}function Yo(e){return void 0===e}function Wo(e,t){return function(e){return"function"==typeof e}(e[t])||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function Go(e,t){const n=t.substring(1).split("/").slice(0,-1);let r;return n.forEach(((t,i)=>{if(i===n.length)return;r=+t;const o=isNaN(r)?{}:[];e[r||t]=Yo(e[r||t])?o:e[t],e=e[r||t]})),e}function Xo(e,t){let n=!0;if(Uo(e)&&Uo(t))return Object.keys(e).length===Object.keys(t).length&&(Object.keys(e).forEach((r=>{Xo(e[r],t[r])||(n=!1)})),n);if(Bo(e)&&Bo(t)){if(e.length!==t.length)return!1;for(let n=0,r=e.length;n<r;n+=1)if(!Xo(e[n],t[n]))return!1;return!0}return e===t}Vo.generate=function(e,t,n){n=n||"";let r=[];return Object.keys(t).forEach((i=>{const o=function(e){return e?jo({},{val:e}).val:e}(t[i]),a=e[i],s=`${n}/${i}`;Xo(o,a)||Wo(t,i)||(Yo(a)?r.push({op:"add",path:s,value:o}):Uo(o)&&Uo(a)?r=r.concat(Vo.generate(a,o,s)):Bo(o)&&Bo(a)?r=r.concat(function(e,t,n){let r=[];const i=e.slice();let o=-1;function a(e,t,n){if(e[n]&&Yo(e[n].qInfo))return null;if(e[n]&&e[n].qInfo.qId===t)return n;for(let n=0,r=e.length;n<r;n+=1)if(e[n]&&e[n].qInfo.qId===t)return n;return-1}if(Xo(t,i))return r;if(!Yo(t[0])&&Yo(t[0].qInfo)||0===t.length)return r.push({op:"replace",path:n,value:t}),r;for(let e=i.length-1;e>=0;e-=1)o=a(t,i[e].qInfo&&i[e].qInfo.qId,e),-1===o?(r.push({op:"remove",path:`${n}/${e}`}),i.splice(e,1)):r=r.concat(Vo.generate(i[e],t[o],`${n}/${e}`));for(let e=0,s=t.length;e<s;e+=1)o=a(i,t[e].qInfo&&t[e].qInfo.qId),-1===o?(r.push({op:"add",path:`${n}/${e}`,value:t[e]}),i.splice(e,0,t[e])):o!==e&&(r.push({op:"move",path:`${n}/${e}`,from:`${n}/${o}`}),i.splice(e,0,i.splice(o,1)[0]));return r}(a,o,s)):r.push({op:"replace",path:`${n}/${i}`,value:o}))})),Object.keys(e).forEach((i=>{Yo(t[i])&&!Wo(e,i)&&r.push({op:"remove",path:`${n}/${i}`})})),r},Vo.apply=function(e,t){t.forEach((t=>{let n=Go(e,t.path),r=t.path.split("/").splice(-1)[0],i=r&&isNaN(+r)?n[r]:n[+r]||n;const o=t.from?t.from.split("/").splice(-1)[0]:null;if("/"===t.path&&(n=null,i=e),"add"===t.op||"replace"===t.op)if(Bo(n))"-"===r&&(r=n.length),n.splice(+r,"add"===t.op?0:1,t.value);else if(Bo(i)&&Bo(t.value)){const e=t.value.slice();i.length=0,i.push(...e)}else if(Uo(i)&&Uo(t.value))a=i,Object.keys(a).forEach((e=>{Object.getOwnPropertyDescriptor(a,e).configurable&&!Wo(a,e)&&delete a[e]})),jo(i,t.value);else{if(!n)throw new Error("Patchee is not an object we can patch");n[r]=t.value}else if("move"===t.op){const i=Go(e,t.from);Bo(n)?n.splice(+r,0,i.splice(+o,1)[0]):(n[r]=i[o],delete i[o])}else"remove"===t.op&&(Bo(n)?n.splice(+r,1):delete n[r]);var a}))},Vo.clone=function(e){return jo({},e)},Vo.createPatch=function(e,t,n){const r={op:e.toLowerCase(),path:n};return"move"===r.op?r.from=t:void 0!==t&&(r.value=t),r},Vo.updateObject=function(e,t){Object.keys(e).length?Vo.apply(e,Vo.generate(e,t)):jo(e,t)};const Ko=[[2,4,6],[2,4],[3]],Jo=[,[,,[[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 Zo(e,t,n){const r=e?e.length:0;let i,o=void 0===t?Number.MAX_VALUE:e[0]/t;for(i=1;i<r;i++)o=Math.min(o,e[i]/e[i-1]);void 0!==n&&(o=Math.min(o,n/e[r-1])),e.splice(0,0,o)}function Qo(e,t,n){let r;const i=e?e.length:0;for(r=0;r<i;r++)Zo(e[r],t,n)}!function(){let e,t;for(Qo(Ko,1,10),e=0;e<Jo.length;e++)if(Jo[e])for(t=0;t<Jo[e].length;t++)Array.isArray(Jo[e][t])&&Qo(Jo[e][t])}();const ea={isInside(e,t,n,r){if(!r)return!0;const i=e.position-e.radius,o=e.position+e.radius;return i>=t&&o<=n},getCenterDistance:(e,t)=>Math.abs(e.center-t.center),getGap(e,t){const n=e.position<t.position?e:t,r=e.position<t.position?t:e;return r.position-r.radius-(n.position+n.radius)},findSegmentPositionMeetMax(e,t){const n=Math.max(0,e.max-t);return e.center-n},findSegmentPositionMeetMin(e,t){const n=Math.max(0,t-e.min);return e.center+n},findSegmentPositionMeetMinThenMax(e,t,n){const r=ea.findSegmentPositionMeetMin(e,t);return ea.findSegmentPositionMeetMax({center:r,max:r+e.radius},n)},findSegmentPositionMeetMaxThenMin(e,t,n){const r=ea.findSegmentPositionMeetMax(e,n);return ea.findSegmentPositionMeetMin({center:r,min:r-e.radius},t)},layoutPositionFromMin(e,t,n,r=0){const i=e.length-1;let o,a,s=t;for(let t=0;t<i;t++)o=e[t],a=e[t+1],o.position=ea.findSegmentPositionMeetMaxThenMin(o,s,(o.center+a.center-r)/2),s=o.position+o.radius+r/2;a.position=ea.findSegmentPositionMeetMaxThenMin(a,s,n)},adjustPositionFromMax(e,t,n,r=0){const i=e.length-1;let o,a,s;const l=Math.max(0,e[i].position+e[i].radius-n);if(0===l)return;let u,c=0;for(o=i;o>0&&(a=e[o],s=e[o-1],u=Math.max(0,ea.getGap(s,a)-r),u-=Math.max(0,c+u-l),c+=u,a.move=u,!(c>=l));o--);for(c<l&&(u=Math.max(0,s.position-s.radius-t),u-=Math.max(0,c+u-l),c+=u,s.move=u),c=0,o=0;o<=i;o++)a=e[o],c+=a.move||0,a.move=c,a.position-=c},layout(e,t,n,r=0){const i=e.length-1;if(!(i<0))if(0!==i)ea.layoutPositionFromMin(e,t,n,r),ea.adjustPositionFromMax(e,t,n,r);else{const r=e[0];r.position=ea.findSegmentPositionMeetMaxThenMin(r,t,n)}}},ta=(e,t,n,r=1)=>{const i=e.bandwidth();return n?"start"===t?i:"end"===t?i*(1-r):i*(2-r)/2:"start"===t?0:"end"===t?i*r:i*r/2},na=e=>!1!==e.show&&0!==e.show&&"0"!==e.show,ra=e=>e.filter(na),ia=(e,t)=>ra(oe.getValue(e,t,[])),oa=e=>na(e)&&(!1!==e.showValue||!1!==e.showLabel),aa=e=>e.filter(oa),sa=(e,t)=>aa(oe.getValue(e,t,[])),la=({refLineLayout:e,layoutService:t})=>t.meta.canBeContinuous?e.refLineExpr.value:e.refLineExpr.stringValue,ua=(e,t,n)=>{const{dimensionRefLineInfo:r}=t;if(r[e])return r[e][n]},ca=({label:e,dataPages:t})=>{const{qArea:n={}}=t||{},{qTop:r,qHeight:i}=n;return void 0!==r&&void 0!==i&&void 0!==e.valueInfo&&e.valueInfo.maxOrder<r},da=({label:e,dataPages:t})=>{const{qArea:n={}}=t||{},{qTop:r,qHeight:i}=n;return void 0!==r&&void 0!==i&&void 0!==e.valueInfo&&e.valueInfo.minOrder>=r+i},ma=({value:e,qMin:t})=>"NaN"!==t&&e<t,fa=({value:e,qMax:t})=>"NaN"!==t&&e>t,pa={isRefLineVisible:na,getVisibleRefLines:ra,getRefLines:ia,getMeasureRefLines:e=>ia(e,"refLine.refLines"),getDimensionRefLines:(e,t)=>t?[]:ia(e,"refLine.dimRefLines"),isRefLineLabelVisible:oa,getVisibleRefLineLabels:aa,getRefLineLabels:sa,getMeasureRefLineLabels:e=>sa(e,"refLine.refLines"),getDimensionRefLineLabels:(e,t)=>t?[]:sa(e,"refLine.dimRefLines"),getScaledPosition:({scale:e,size:t,value:n,valueInfo:r,align:i,invert:o=!1,layoutService:a,isContinuous:s})=>{if(!s){const s=e.pxScale(t);let l;if(a.meta.isGroupedByMeasure)return l=ta(s,i,o,a.meta.measureCount),s([n,0])+l;if(a.meta.isGroupedByDimension){if(!r)return NaN;const{innerValues:e,numInnerValues:t,minOrder:a}=r;let u;return l=ta(s,i,o,t),e&&e.length&&(u=(({pxScale:e,value:t,innerValues:n,invert:r,minOrder:i})=>{const o=(({pxScale:e,invert:t})=>e.bandwidth()*(t?-1:1))({pxScale:e,invert:r});for(let r=0;r<n.length;r++){const{id:a,order:s}=n[r],l=e([t,a]);if(void 0!==l)return l-o*(s-i)}})({pxScale:s,value:n,innerValues:e,invert:o,minOrder:a})),(void 0===u?s(n):u)+l}return l=ta(s,i,o),s(n)+l}return e(n)},getDimensionValuesInfo:({layout:e,canBeContinuous:t,discreteModel:n,layoutService:r})=>{const{isGroupedByDimension:i}=r.meta,o={},a=oe.getValue(e,"qHyperCube"),s="K"===a.qMode,l=n?n.query.getCurrentDataPage():oe.getValue(a,"S"===a.qMode?"qDataPages.0":"qStackedDataPages.0",[]);const u=s?"qData.0.qSubNodes":"qMatrix",c=oe.getValue(l,u,[]),d=((e,t)=>e?t?"qValue":"qNum":"qText")(t,s),m=(e=>e.qArea.qTop)(l);return s?(()=>{for(let e=0;e<c.length;e++){const t=c[e],n=e+m,r=t[d];o[r]||(o[r]={id:t.qElemNo,qText:t.qText,minOrder:n,maxOrder:n})}})():i?(()=>{let e;for(let t=0;t<c.length;t++){const n=c[t][0],r=c[t][1],i=t+m,a=n[d];o[a]?(o[a].minOrder=Math.min(o[a].minOrder,i),o[a].maxOrder=Math.max(o[a].maxOrder,i),o[a].innerValues[o[a].innerValues.length]={id:r.qElemNumber,order:i}):o[a]={id:n.qElemNumber,qText:n.qText,minOrder:i,maxOrder:i,innerValues:[{id:r.qElemNumber,order:i}]},0===t?0===i&&(o[a].isMinOrderOk=!0):a!==e&&(o[a].isMinOrderOk=!0,o[e].isMaxOrderOk=!0),e=a}})():(()=>{for(let e=0;e<c.length;e++){const t=c[e][0],n=e+m,r=t[d];o[r]||(o[r]={id:t.qElemNumber,qText:t.qText,minOrder:n,maxOrder:n})}})(),o},getInputValue:la,extractInfoFromInputValue:ua,resolveValue:({refLineLayout:e,refLineModel:t,layoutService:n})=>{const r=la({refLineLayout:e,layoutService:n});return ua(r,t,"id")},isDiscreteMinOutOfBounds:ca,isDiscreteMaxOutOfBounds:da,isContinuousMinOutOfBounds:ma,isContinuousMaxOutOfBounds:fa,isOutOfRange:({value:e,qMin:t,qMax:n})=>ma({value:e,qMin:t})||fa({value:e,qMax:n}),isOutOfDataPages:({label:e,dataPages:t})=>e.valueInfo.isMinOrderOk&&da({label:e,dataPages:t})||e.valueInfo.isMaxOrderOk&&ca({label:e,dataPages:t}),getInvert:({orientation:e,rtl:t,isContinuous:n})=>"horizontal"===e?t:n},ha="…";function ya(e,t,n=70){for(let r=0;r<e.length;r++){const i=e[r];i.lines=$o.tokenize(i.title,t,`${ha} ${i.valueString}`,3,n),i.maxNumLines=i.lines.length}}function ga({title:e,font:t,ellipsis:n,maxNumLines:r=5,maxWidth:i=200}){const o=$o.tokenize(e,t,n,r,i),a=o.length;let s="";if(a){[s]=o;for(let e=1;e<a;e++)s=`${s}\n${o[e]}`}return s}function va({oobs:e,font:t,ellipsis:n,maxNumLines:r=5,maxWidth:i=200}){const o=e.map((e=>ga({title:e.title,font:t,ellipsis:`${n} ${e.valueString}`,maxNumLines:r,maxWidth:i}))),a=o.length;let s="";if(a){[s]=o;for(let e=1;e<a;e++)s=`${s}\n\n${o[e]}`}return s}function ba(e,t="value"){e.sort(((e,n)=>e[t]-n[t]))}const xa=3,Sa=2;function Ma({inputValue:e,inputValueLabel:t,localeInfo:n}){if(void 0===e||void 0===t||e.toString()===t)return!1;if(!n)return!0;const r=`+-${n.qDecimalSep||""}${n.qThousandSep||""}`.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&");return t.replace(new RegExp(`[0-9e${r}]`,"g"),"").length>0||function(e){if(e.indexOf("e")>-1)return!1;const t=e.indexOf("-");return-1!==t&&(e.lastIndexOf("-")!==t||0!==t)}(t)}const Ea=({label:e,dataPages:t,qMin:n,qMax:r})=>{if(void 0!==n&&void 0!==r){const{inputValue:t}=e;if(pa.isContinuousMaxOutOfBounds({value:t,qMax:r}))return 1;if(pa.isContinuousMinOutOfBounds({value:t,qMin:n}))return-1}return pa.isDiscreteMaxOutOfBounds({label:e,dataPages:t})?1:pa.isDiscreteMinOutOfBounds({label:e,dataPages:t})?-1:0},Ca={hasEngineFormat:Ma,calculateLabelPositions({labels:e,scale:t,size:n,layoutService:r,orientation:i,rtl:o,isContinuous:a,isDimension:s}){const l=pa.getInvert({orientation:i,rtl:o,isContinuous:a}),u="S"===r.getHyperCubeValue("qMode")?"qDataPages.0":"qStackedDataPages.0",c=r.getHyperCubeValue(u),{canBeContinuous:d}=r.meta;let m,f;if(s&&d){const e=r.getLayoutValue("qHyperCube.qDimensionInfo.0");m=e.qMin,f=e.qMax}for(let i=0;i<e.length;i++){const o=e[i],{value:s,align:u,valueInfo:d}=o,p=Ea({label:o,dataPages:c,qMin:m,qMax:f});o.scaledValue=1===p?l?-.1:1.1:-1===p?l?1.1:-.1:pa.getScaledPosition({scale:t,size:n,value:s,valueInfo:d,align:u,invert:l,layoutService:r,isContinuous:a}),o.center=o.scaledValue*n}},getTitle:e=>!1!==e.showValue?!1!==e.showLabel?`${e.text} ${e.valueString}`:e.valueString:!1!==e.showLabel?e.text:"",addLabelTitles({labels:e,formatter:t,isContinuous:n,canBeContinuous:r,localeInfo:i}){let o;if(n)for(let n=0;n<e.length;n++){const r=e[n],{value:a,inputValue:s,inputValueLabel:l}=r;o=Ma({inputValue:s,inputValueLabel:l,localeInfo:i})?l:t?t(a):a,r.valueString=`${ge.lrm}(${o})${ge.lrm}`,r.title=Ca.getTitle(r)}else if(r)for(let t=0;t<e.length;t++){const n=e[t],{valueText:r,inputValue:a,inputValueLabel:s}=n;o=Ma({inputValue:a,inputValueLabel:s,localeInfo:i})?s:r,n.valueString=`${ge.lrm}(${o})${ge.lrm}`,n.title=Ca.getTitle(n)}else for(let t=0;t<e.length;t++){const n=e[t];o=n.valueText,n.valueString=`${ge.lrm}(${o})${ge.lrm}`,n.title=Ca.getTitle(n)}},measureLabelsWidth(e,t){for(let n=0;n<e.length;n++){const r=e[n];r.totalWidth=t(r.title).width}},measureLabelMaxLineWidth:(e,t)=>Math.max(...e.lines.map((e=>t(e).width))),getMaxTextWidth(e){const t=e.map((e=>e.totalWidth));return Math.max(...t)},addLabelsNeighborInfo(e,t,n,r=0){const i=e.length-1;if(i<0)return;let o,a;if([o]=e,o.cMin=t,0!==i){for(let t=0;t<i;t++)o=e[t],a=e[t+1],o.cMax=(o.center+a.center-r)/2,a.cMin=o.cMax+r;a.cMax=n}else o.cMax=n},getTotalNumLines(e){let t=0;return e.forEach((e=>{t+=e.maxNumLines})),t},reduceLabelsHavingMaxNumLines(e,t,n){const r=t-1,i=e.filter((e=>e.maxNumLines===t)),o=Math.min(n,i.length);for(let e=i.length-1;e>=i.length-o;e--)i[e].maxNumLines=r},reduceTotalMaxNumLines(e,t,n){const r=Math.floor(n/t);let i=3;do{const t=Ca.getTotalNumLines(e)-r;if(t<=0)return;Ca.reduceLabelsHavingMaxNumLines(e,i,t),i--}while(i>1)},reduceMaxNumLines(e,t,n=0){for(let r=0;r<e.length;r++){const i=e[r];i.maxNumLines=Math.max(1,Math.min(i.maxNumLines,Math.floor((Math.max(0,i.cMax-i.cMin)+n)/t)))}},addLabelsSize(e,t,n=15,r){for(let i=0;i<e.length;i++){const o=e[i];o.width=Math.min(t,Ca.measureLabelMaxLineWidth(o,r)),o.height=o.lines.length*n}},addLabelSegments(e,t){for(let n=0;n<e.length;n++){const r=e[n],{center:i}=r,o=r[t],a=o/2;r.segment={center:i,range:o,min:i-a,max:i+a,radius:a}}},addLabelsInfo({labels:e,scale:t,majorSize:n,lowerLimit:r,upperLimit:i,gap:o,font:a,maxLabelWidth:s,lineHeight:l,majorDimension:u,orientation:c,measureText:d,rtl:m,layoutService:f,isContinuous:p,isDimension:h}){const y=e.map((e=>e)),g=n;Ca.calculateLabelPositions({labels:e,scale:t,size:g,layoutService:f,orientation:c,rtl:m,isContinuous:p,isDimension:h}),ba(e,"center"),Ca.addLabelsNeighborInfo(e,r,i,o),ya(e,a,s),Ca.reduceTotalMaxNumLines(y,l,i-(y.length-1)*o),"vertical"===c&&(Ca.reduceMaxNumLines(e,l,.05*o),function(e,t,n=70){for(let r=0;r<e.length;r++){const i=e[r];i.lines.length>i.maxNumLines&&(i.lines=$o.tokenize(i.title,t,`${ha} ${i.valueString}`,i.maxNumLines,n))}}(e,a,s)),Ca.addLabelsSize(e,s,l,d),Ca.addLabelSegments(e,u)},createLabels({labels:e,style:t,maxLabelWidth:n,areaProps:r,area:i,lineHeight:o=15,font:a}){const{majorAxis:s,minorAxis:l,dock:u}=r,{minorCenter:c}=i,{fontSize:d,fontFamily:m,background:f}=t;let p=[];return e.forEach((e=>{const{lines:t}=e,r=t.length,i=t.map(((t,i)=>{const f={type:"text",text:t,title:ga({title:e.title,font:a,ellipsis:`… ${e.valueString}`}),dx:0,dy:0,maxWidth:n,width:n,fontSize:d,fontFamily:m,fill:e.fill,baseline:"central",anchor:"middle",value:e.value,dock:u};return f[l]=c,f[s]=e.segment.position,f.y+=(i-(r-1)/2)*o,f}));e.background&&p.push(function({minorCenter:e,majorAxis:t,minorAxis:n,dock:r,label:i,lineHeight:o,background:a}){const{lines:s}=i,{borderRadius:l=xa,padding:u={}}=a,{top:c=Sa,bottom:d=Sa,left:m=Sa,right:f=Sa}=u,p=s.length,h={type:"rect",rx:l,ry:l,fill:i.background.fill,width:i.width+(m+f),height:i.height+(c+d),value:i.value,dock:r};return h[n]=e,h[t]=i.segment.position,h.x-=i.width/2+m,h.y-=p*o/2+c,h}({minorCenter:c,majorAxis:s,minorAxis:l,dock:u,label:e,lineHeight:o,background:f})),p=p.concat(i)})),p}};function qa(e,t,n){let r;const i=typeof t;if("string"===i||"object"===i)r=e.formatter(t);else if(void 0!==n&&n.data){const e=n.data()&&n.data().fields;r=e&&e[0]?e[0].formatter():null}return r}function Aa(e,t,n){return"top"===e||"bottom"===e?function(e,t){const{font:n,lineHeight:r,top:i,bottom:o,maxLabelWidth:a}=t;let s=1;return Ca.getMaxTextWidth(e)>a&&(ya(e,n,a),s=Math.max(...e.map((e=>e.lines.length)))),s*r+i+o}(t,n):function(e,t){const{left:n,right:r,maxLabelWidth:i}=t;return Math.min(i,Ca.getMaxTextWidth(e))+n+r}(t,n)}function Oa(e,t){return t?e.domain():[0,1]}function Da(e,t,n,r="value"){let i=e.filter((e=>e[r]>=t));i=i.filter((e=>e[r]<=n));const o=e.filter((e=>e[r]<t)),a=e.filter((e=>e[r]>n));return{filteredLabels:i,minOobs:o,maxOobs:a,numMinOobs:o.length,numMaxOobs:a.length}}function Ia(e){let t,n=0;for(let r=1;r<10;r++)t=e(r),n=Math.max(n,Math.sqrt(t.width*t.width+t.height*t.height));return t=e("9+"),[n,Math.max(n,Math.sqrt(t.width*t.width+t.height*t.height))]}function wa(e,t){return e>9?t[1]:t[0]}function Ta({alignment:e,dockValue:t,oobs:n,style:r,rect:i,symbol:o,position:a,areaProps:s,radius:l,font:u}){const c=n?n.length:0;if(c<1)return[];const{flipXY:d,majorAxis:m,minorAxis:f,minorDimension:p,dock:h}=s,y=i[p],g=Ho.createOob({oob:Ho.getDefaultSettings({size:r.size,fill:r.fill,alignment:e}),dockValue:t,boxCenter:.5,rendWidth:i.width,rendHeight:i.height,flipXY:d,symbol:o});g.dock=h;const v=`c${m}`,b=`c${f}`,x={type:"circle",r:l,stroke:"transparent",fill:r.text.background.fill,strokeWidth:0,dock:h};x[b]=y/2,x[v]=a;const S={type:"text",text:c>9?"9+":c,title:va({oobs:n,font:u,ellipsis:"…"}),dx:0,dy:0,maxWidth:y,width:y,fontSize:r.text.fontSize,fontFamily:r.text.fontFamily,fill:r.text.fill,baseline:"central",anchor:"middle",dock:h};return S[f]=y/2,S[m]=a,[g,x,S]}function Na(e){const t=`normal ${e.fontSize} '${e.fontFamily}'`;return{font:t,lineHeight:$o.getFontHeight(t)*(e.lineHeightMultiplicator||1),gap:e.gap||12,maxLabelWidth:e.maxWidth||75,top:e.padding.top||0,bottom:e.padding.bottom||0,left:e.padding.left||0,right:e.padding.right||0}}const La=e=>e.map((e=>({...e,value:"function"==typeof e.value?e.value():e.value,valueText:"function"==typeof e.valueText?e.valueText():e.valueText,valueInfo:"function"==typeof e.valueInfo?e.valueInfo():e.valueInfo})));var ka={require:["renderer","chart","symbol"],defaultSettings:{layout:{displayOrder:0,prioOrder:0}},preferredSize(){const{scale:e}=this,{style:t,layoutService:n,isContinuous:r,localeInfo:i}=this.settings,o=!!r||n.meta.canBeContinuous,a=La(this.settings.labels),s=qa(this.chart,this.settings.formatter,e);Ca.addLabelTitles({labels:a,formatter:s,isContinuous:r,canBeContinuous:o,localeInfo:i});const{numMaxOobs:l,numMinOobs:u,filteredLabels:c}=(({labels:e,scale:t,isContinuous:n,canBeContinuous:r,layoutService:i})=>{if(n){const[r,i]=Oa(t,n);return Da(e,r,i)}if(r){const t=i.getLayoutValue("qHyperCube.qDimensionInfo.0"),{qMin:n,qMax:r}=t;if("NaN"!==n&&"NaN"!==r)return Da(e,n,r,"inputValue")}return{filteredLabels:e}})({labels:a,scale:e,isContinuous:r,canBeContinuous:o,layoutService:n});let d;if(this.measureText=e=>this.renderer.measureText({text:e,fontSize:t.label.fontSize,fontFamily:t.label.fontFamily}),c&&c.length){const e=Na(t.label),{dock:n}=this.settings.layout;return Ca.measureLabelsWidth(c,this.measureText),d=Aa(n,c,e),d}const m=Ia(this.measureText),f=l?wa(l,m):0,p=u?wa(u,m):0;return d=Math.max(f,p),d},render(){const{scale:e}=this;if(!e.domain().length)return;const{symbol:t}=this,{style:n,layoutService:r,theme:i,isContinuous:o,isDimension:a,localeInfo:s}=this.settings,l=!!o||r.meta.canBeContinuous,u=La(this.settings.labels),{dock:c,rtl:d}=this.settings.layout,{padding:m}=n.label,f=function(e){return"left"===e||"right"===e?(e=>({dock:e,orientation:"vertical",majorAxis:"y",minorAxis:"x",majorDimension:"height",minorDimension:"width",flipXY:!1}))(e):(e=>({dock:e,orientation:"horizontal",majorAxis:"x",minorAxis:"y",majorDimension:"width",minorDimension:"height",flipXY:!0}))(e)}(c),p=function(e,t,n){const r=e[t.minorDimension];return{minorSize:r,majorSize:e[t.majorDimension],minorCenter:"vertical"===t.orientation?(r-n.right-n.left)/2+n.left:(r-n.top-n.bottom)/2+n.top}}(this.rect,f,m),{orientation:h,majorDimension:y}=f,{majorSize:g}=p,{font:v,lineHeight:b,gap:x,maxLabelWidth:S}=Na(n.label),M=qa(this.chart,this.settings.formatter,e),E=g;Ca.addLabelTitles({labels:u,formatter:M,isContinuous:o,canBeContinuous:l,localeInfo:s}),Ca.calculateLabelPositions({labels:u,scale:e,size:E,layoutService:r,orientation:h,rtl:d,isContinuous:o,isDimension:a});const[C,q]=Oa(e,o),{filteredLabels:A,lowerOobs:O,upperOobs:D,lowerCircleSize:I,upperCircleSize:w,lowerOobSpace:T,upperOobSpace:N}=function({labels:e,minValue:t,maxValue:n,orientation:r,rtl:i,isContinuous:o,style:a,padding:s,measureText:l,prop:u="value"}){const{maxOobs:c,minOobs:d,filteredLabels:m}=Da(e,t,n,u),f="scaledValue"!==u&&pa.getInvert({orientation:r,rtl:i,isContinuous:o}),p=function(e,t,n){return n?t:e}(d,c,f),h=function(e,t,n){return n?e:t}(d,c,f),y=p.length,g=h.length,v=Ia(l),b=wa(y,v),x=wa(g,v),S=function(e,t,n,r,i){return("vertical"===r?i.top:i.left)+(e>0?t+n:0)}(y,a.oob.size,b,r,s),M=function(e,t,n,r,i){return("vertical"===r?i.bottom:i.right)+(e>0?t+n:0)}(g,a.oob.size,x,r,s);return{filteredLabels:m,lowerOobs:p,upperOobs:h,lowerCircleSize:b,upperCircleSize:x,lowerOobSpace:S,upperOobSpace:M}}({labels:u,minValue:C,maxValue:q,orientation:h,rtl:d,isContinuous:o,style:n,padding:m,measureText:this.measureText,prop:o?"value":"scaledValue"}),L=T,k=g-N;ba(O),ba(D);const R=Ta({alignment:0,dockValue:0,oobs:O,style:n.oob,rect:this.rect,symbol:t,position:n.oob.size+I/2,areaProps:f,radius:I/2,font:v}),P=Ta({alignment:1,dockValue:1,oobs:D,style:n.oob,rect:this.rect,symbol:t,position:g-(n.oob.size+w/2),areaProps:f,radius:w/2,font:v});Ca.addLabelsInfo({labels:A,scale:e,majorSize:g,lowerLimit:L,upperLimit:k,font:v,lineHeight:b,gap:x,maxLabelWidth:S,majorDimension:y,orientation:h,measureText:this.measureText,rtl:d,layoutService:r,isContinuous:o,isDimension:a}),ea.layout(A.map((e=>e.segment)),L,k,n.label.gap);const F=A.filter((e=>ea.isInside(e.segment,L,k,o)));return Ca.createLabels({labels:F,style:n.label,maxLabelWidth:S,areaProps:f,area:p,lineHeight:b,font:v,theme:i}).concat([...R,...P])}};function Ra(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Pa(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ra(Object(n),!0).forEach((function(t){Ha(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ra(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Fa(){Fa=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function u(e,t,n,i){var o=t&&t.prototype instanceof m?t:m,a=Object.create(o.prototype),s=new q(i||[]);return r(a,"_invoke",{value:S(e,n,s)}),a}function c(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var d={};function m(){}function f(){}function p(){}var h={};l(h,o,(function(){return this}));var y=Object.getPrototypeOf,g=y&&y(y(A([])));g&&g!==t&&n.call(g,o)&&(h=g);var v=p.prototype=m.prototype=Object.create(h);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){function i(r,o,a,s){var l=c(e[r],e,o);if("throw"!==l.type){var u=l.arg,d=u.value;return d&&"object"==typeof d&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){i("next",e,a,s)}),(function(e){i("throw",e,a,s)})):t.resolve(d).then((function(e){u.value=e,a(u)}),(function(e){return i("throw",e,a,s)}))}s(l.arg)}var o;r(this,"_invoke",{value:function(e,n){function r(){return new t((function(t,r){i(e,n,t,r)}))}return o=o?o.then(r,r):r()}})}function S(e,t,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return{value:void 0,done:!0}}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=M(a,n);if(s){if(s===d)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=c(e,t,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}function M(e,t){var n=t.method,r=e.iterator[n];if(void 0===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,M(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var i=c(r,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,d;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function q(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function A(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:O}}function O(){return{value:void 0,done:!0}}return f.prototype=p,r(v,"constructor",{value:p,configurable:!0}),r(p,"constructor",{value:f,configurable:!0}),f.displayName=l(p,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,l(e,s,"GeneratorFunction")),e.prototype=Object.create(v),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,a,(function(){return this})),e.AsyncIterator=x,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new x(u(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},b(v),l(v,s,"Generator"),l(v,o,(function(){return this})),l(v,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},e.values=A,q.prototype={constructor:q,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(C),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return a.type="throw",a.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),l=n.call(o,"finallyLoc");if(s&&l){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),C(n),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;C(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:A(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),d}},e}function za(e){return za="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},za(e)}function _a(e,t,n,r,i,o,a){try{var s=e[o](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,i)}function $a(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){_a(o,r,i,a,s,"next",e)}function s(e){_a(o,r,i,a,s,"throw",e)}a(void 0)}))}}function Ha(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ja(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Va(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 r,i,o,a,s=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(e,t)||Ua(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 Ba(e){return function(e){if(Array.isArray(e))return Ya(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Ua(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ua(e,t){if(e){if("string"==typeof e)return Ya(e,t);var n=Object.prototype.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)?Ya(e,t):void 0}}function Ya(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Wa=Object.prototype.hasOwnProperty,Ga=Object.prototype.toString,Xa=Object.defineProperty,Ka=Object.getOwnPropertyDescriptor,Ja=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===Ga.call(e)},Za=function(e){if(!e||"[object Object]"!==Ga.call(e))return!1;var t,n=Wa.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&Wa.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||Wa.call(e,t)},Qa=function(e,t){Xa&&"__proto__"===t.name?Xa(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},es=function(e,t){if("__proto__"===t){if(!Wa.call(e,t))return;if(Ka)return Ka(e,t).value}return e[t]},ts=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}((function e(){var t,n,r,i,o,a,s=arguments[0],l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l<u;++l)if(null!=(t=arguments[l]))for(n in t)r=es(s,n),s!==(i=es(t,n))&&(c&&i&&(Za(i)||(o=Ja(i)))?(o?(o=!1,a=r&&Ja(r)?r:[]):a=r&&Za(r)?r:{},Qa(s,{name:n,newValue:e(c,a,i)})):void 0!==i&&Qa(s,{name:n,newValue:i}));return s}));function ns(e,t){return{range:function(e){var n=e.resources,r=e.data,i=n.theme.palette("categorical",0===t?r.items.length:t);return r.items.map((function(e){return i[e.value%i.length]}))},valueAccessor:e.value}}function rs(e,t){return{range:function(e){var n=e.resources,r=e.data,i=n.theme.palette("categorical",0===t?r.items.length:t);return r.items.map((function(e){return i[e.row.value%i.length]}))},valueAccessor:e.value}}function is(e,t,n,r,i){var o,a,s=i.byRow,l=i.byElemNo;if(r&&(t.input.persistent||e.hc.qDimensionInfo.length>1||void 0===n.activeDimensionIndex&&e.hc.qSize.qcy>((null===(a=(o=e.hc).qDataPages[0]||o.qStackedDataPages[0])||void 0===a?void 0:a.qArea.qHeight)||0)))return l(r,r.raw().qCardinal);if(r){var u=t.pic.extract({field:r.key(),trackBy:r.value}).length;return s(r,u)}return{}}function os(e,t){var n=e.hc.qDimensionInfo,r=t.input.byDimDef||{activeDimensionIndex:n.length-1};if(r.activeDimensionIndex>=0){var i=n[r.activeDimensionIndex];r=i.coloring&&i.coloring.colorMapRef?{type:"libraryItem",key:i.coloring.colorMapRef,activeDimensionIndex:r.activeDimensionIndex}:{activeDimensionIndex:r.activeDimensionIndex}}return r}function as(e,t){var n;return t.activeDimensionIndex>=0?n=e.pic.fields().filter((function(e){return"dimension"===e.type()}))[t.activeDimensionIndex]:"libraryItem"===t.type?!1===(n=t.key?e.pic.field((function(e){return e.raw().colorMapRef===t.key})):void 0)&&(n=e.pic.field((function(e){return"colorByAlternative"===e.raw().id}))):"expression"===t.type&&(n=e.pic.field((function(e){return"colorByAlternative"===e.raw().id}))),n}function ss(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function ls(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function us(){}var cs=1/.7,ds="\\s*([+-]?\\d+)\\s*",ms="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",fs="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",ps=/^#([0-9a-f]{3,8})$/,hs=new RegExp(`^rgb\\(${ds},${ds},${ds}\\)$`),ys=new RegExp(`^rgb\\(${fs},${fs},${fs}\\)$`),gs=new RegExp(`^rgba\\(${ds},${ds},${ds},${ms}\\)$`),vs=new RegExp(`^rgba\\(${fs},${fs},${fs},${ms}\\)$`),bs=new RegExp(`^hsl\\(${ms},${fs},${fs}\\)$`),xs=new RegExp(`^hsla\\(${ms},${fs},${fs},${ms}\\)$`),Ss={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 Ms(){return this.rgb().formatHex()}function Es(){return this.rgb().formatRgb()}function Cs(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=ps.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?qs(t):3===n?new Is(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?As(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?As(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=hs.exec(e))?new Is(t[1],t[2],t[3],1):(t=ys.exec(e))?new Is(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=gs.exec(e))?As(t[1],t[2],t[3],t[4]):(t=vs.exec(e))?As(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=bs.exec(e))?Rs(t[1],t[2]/100,t[3]/100,1):(t=xs.exec(e))?Rs(t[1],t[2]/100,t[3]/100,t[4]):Ss.hasOwnProperty(e)?qs(Ss[e]):"transparent"===e?new Is(NaN,NaN,NaN,0):null}function qs(e){return new Is(e>>16&255,e>>8&255,255&e,1)}function As(e,t,n,r){return r<=0&&(e=t=n=NaN),new Is(e,t,n,r)}function Os(e){return e instanceof us||(e=Cs(e)),e?new Is((e=e.rgb()).r,e.g,e.b,e.opacity):new Is}function Ds(e,t,n,r){return 1===arguments.length?Os(e):new Is(e,t,n,null==r?1:r)}function Is(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function ws(){return`#${ks(this.r)}${ks(this.g)}${ks(this.b)}`}function Ts(){const e=Ns(this.opacity);return`${1===e?"rgb(":"rgba("}${Ls(this.r)}, ${Ls(this.g)}, ${Ls(this.b)}${1===e?")":`, ${e})`}`}function Ns(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ls(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ks(e){return((e=Ls(e))<16?"0":"")+e.toString(16)}function Rs(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Fs(e,t,n,r)}function Ps(e){if(e instanceof Fs)return new Fs(e.h,e.s,e.l,e.opacity);if(e instanceof us||(e=Cs(e)),!e)return new Fs;if(e instanceof Fs)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,s=o-i,l=(o+i)/2;return s?(a=t===o?(n-r)/s+6*(n<r):n===o?(r-t)/s+2:(t-n)/s+4,s/=l<.5?o+i:2-o-i,a*=60):s=l>0&&l<1?0:a,new Fs(a,s,l,e.opacity)}function Fs(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function zs(e){return(e=(e||0)%360)<0?e+360:e}function _s(e){return Math.max(0,Math.min(1,e||0))}function $s(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}ss(us,Cs,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Ms,formatHex:Ms,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Ps(this).formatHsl()},formatRgb:Es,toString:Es}),ss(Is,Ds,ls(us,{brighter(e){return e=null==e?cs:Math.pow(cs,e),new Is(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new Is(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Is(Ls(this.r),Ls(this.g),Ls(this.b),Ns(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:ws,formatHex:ws,formatHex8:function(){return`#${ks(this.r)}${ks(this.g)}${ks(this.b)}${ks(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Ts,toString:Ts})),ss(Fs,(function(e,t,n,r){return 1===arguments.length?Ps(e):new Fs(e,t,n,null==r?1:r)}),ls(us,{brighter(e){return e=null==e?cs:Math.pow(cs,e),new Fs(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new Fs(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,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Is($s(e>=240?e-240:e+120,i,r),$s(e,i,r),$s(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Fs(zs(this.h),_s(this.s),_s(this.l),Ns(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=Ns(this.opacity);return`${1===e?"hsl(":"hsla("}${zs(this.h)}, ${100*_s(this.s)}%, ${100*_s(this.l)}%${1===e?")":`, ${e})`}`}}));const Hs=Math.PI/180,js=180/Math.PI,Vs=4/29,Bs=6/29,Us=3*Bs*Bs;function Ys(e){if(e instanceof Ws)return new Ws(e.l,e.a,e.b,e.opacity);if(e instanceof Zs)return Qs(e);e instanceof Is||(e=Os(e));var t,n,r=Js(e.r),i=Js(e.g),o=Js(e.b),a=Gs((.2225045*r+.7168786*i+.0606169*o)/1);return r===i&&i===o?t=n=a:(t=Gs((.4360747*r+.3850649*i+.1430804*o)/.96422),n=Gs((.0139322*r+.0971045*i+.7141733*o)/.82521)),new Ws(116*a-16,500*(t-a),200*(a-n),e.opacity)}function Ws(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function Gs(e){return e>.008856451679035631?Math.pow(e,1/3):e/Us+Vs}function Xs(e){return e>Bs?e*e*e:Us*(e-Vs)}function Ks(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Js(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Zs(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function Qs(e){if(isNaN(e.h))return new Ws(e.l,0,0,e.opacity);var t=e.h*Hs;return new Ws(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}ss(Ws,(function(e,t,n,r){return 1===arguments.length?Ys(e):new Ws(e,t,n,null==r?1:r)}),ls(us,{brighter(e){return new Ws(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new Ws(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 Is(Ks(3.1338561*(t=.96422*Xs(t))-1.6168667*(e=1*Xs(e))-.4906146*(n=.82521*Xs(n))),Ks(-.9787684*t+1.9161415*e+.033454*n),Ks(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),ss(Zs,(function(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof Zs)return new Zs(e.h,e.c,e.l,e.opacity);if(e instanceof Ws||(e=Ys(e)),0===e.a&&0===e.b)return new Zs(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*js;return new Zs(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new Zs(e,t,n,null==r?1:r)}),ls(us,{brighter(e){return new Zs(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new Zs(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return Qs(this).rgb()}}));var el=e=>()=>e;function tl(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):el(isNaN(e)?t:e)}var nl=function e(t){var n=function(e){return 1==(e=+e)?tl: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(r){return Math.pow(e+r*t,n)}}(t,n,e):el(isNaN(t)?n:t)}}(t);function r(e,t){var r=n((e=Ds(e)).r,(t=Ds(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),a=tl(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=o(t),e.opacity=a(t),e+""}}return r.gamma=e,r}(1),rl=/^class(-pyramid)?/,il=function(e,t,n,r){var i=void 0!==n.min?n.min:r.min(),o=void 0!==n.max?n.max:r.max(),a=i,s=o,l=t.limits,u={},c="percent"===t.limitType?l.map((function(e){return i+(o-i)*e})):l,d=t.colors.map((function(t){return e.resolveUIColor(t)}));if(i=Math.min.apply(Math,[i].concat(Ba(c))),o=Math.max.apply(Math,[o].concat(Ba(c))),u.min=i,u.max=o,t.breakTypes&&-1===t.breakTypes.indexOf(!0))u.type="categorical",Object.assign(u,function(e){var t=e.min,n=e.max,r=e.limits,i=e.range,o=[],a=[];if(r.length)if(r[r.length-1]<t)a.push(t,n),o.push(i[i.length-1],i[i.length-1],i[i.length-1]);else if(r[0]>n)a.push(t,n),o.push(i[0],i[0],i[0]);else{if(r[0]>t)a.push(t),o.push(i[0]);else{a.push(t);for(var s=0;s<r.length;s++)if(t<r[s]){o.push(i[s]);break}}for(var l=0;l<r.length;l++)t<r[l]&&r[l]<n&&(a.push(r[l]),o.push(i[l]));if(r[r.length-1]<n)a.push(n),o.push(i[r.length]),o.push(i[r.length]);else{a.push(n);for(var u=0;u<r.length;u++)if(r[u]>n){o.push(i[u]),o.push(i[u]);break}}}else o.push(i[0]);return{min:t,max:n,range:o,domain:a}}({min:"percent"===t.limitType?i:a,max:"percent"===t.limitType?o:s,range:d,limits:"percent"===t.limitType?c:l}));else if(t.breakTypes){var m=t.breakTypes;u.type="continuous",u.domain=[i],u.range=[d[0]];for(var f=0;f<c.length;f+=1)if(m[f]){var p=d[f],h=d[f+1],y=nl(p,h)(.5);u.range.push(y),u.domain.push(c[f]),f<c.length-1&&m[f+1]&&(u.range.push(d[f+1]),u.domain.push((c[f]+c[f+1])/2))}else u.range.push(d[f]),u.range.push(d[f+1]),u.domain.push(c[f]),u.domain.push(c[f]+Math.min(1e-6,(o-i)/1e6));u.range.push(d[d.length-1]),u.domain.push(o)}else u.domain=c,u.range=d;return u};function ol(e,t,n,r,i){var o,a,s,l=0,u=[],c=(e-t)/(r+1);if(0===c)return 1;for(o=0;o<n.length;o+=1)a=.99*(n[o]-t),s=n[o]>e?Math.floor(e/c):n[o]<t?0:Math.floor(a/c),Number.isNaN(s)||(u[s]?u[s]+=1:u[s]=1);for(o=0;o<u.length;o+=1)u[o]&&(l+=1);return l<=r||l>=i?Math.max(l,r):ol(e,t,n,r+1,i)}var al=function(e,t,n,r){var i,o,a=t.theme,s=t.hc,l=r.f,u={mode:"field",fieldType:"measure",field:l?l.key():void 0,reverse:n.input.reverseScheme||!1,type:"continuous",range:function(e){return e.resources.theme.palette("quant")}},c=[],d=!0;if(l){if(Number.isNaN(+l.min())||Number.isNaN(+l.max()))return{invalid:!0};(d=!("S"===(i=n.pic.raw()).qMode&&(i.qDataPages[0]&&i.qSize.qcy>i.qDataPages[0].qArea.qHeight||!i.qDataPages.length&&i.qSize.qcy>0)||"K"===i.qMode&&i.qStackedDataPages[0]&&i.qSize.qcy>i.qStackedDataPages[0].qArea.qHeight||"T"===i.qMode&&i.qSize.qcy>i.qTreeDataPages[0].qGroupSize))&&(c=n.pic.extract({field:0,props:{num:{field:l.key()},exclude:{fields:s.qDimensionInfo.map((function(e,t){return{field:"qDimensionInfo/".concat(t)}})),value:function(e){return Math.min.apply(Math,Ba(e))<0}}}}).filter((function(e){return e.value>=0&&!e.exclude.value})).map((function(e){return e.num.value})).filter((function(e){return"number"==typeof e})))}if(!1===n.input.autoMinMax){if(u.min=n.input.measureMin,u.max=n.input.measureMax,u.max<u.min)return{invalid:!0}}else if(l&&!d)u.min=l.min(),u.max=l.max();else if(l){if(!c.length)return{invalid:!0};u.min=Math.min.apply(Math,Ba(c)),u.max=Math.max.apply(Math,Ba(c))}if(n.input.measureScheme&&(u.palettes={quant:n.input.measureScheme}),a){var m=a.getDataColorScales().filter((function(e){return e.key===n.input.measureScheme}))[0];u.type=m&&rl.test(m.type)?"categorical":"continuous","categorical"===u.type&&(o=m.colors.some((function(e){return Array.isArray(e)}))?Math.max.apply(Math,Ba(m.colors.map((function(e){return e?e.length:0})))):m.colors.length)}if("categorical"===u.type){for(var f=d?ol(u.max,u.min,c,1,o):o,p=(u.max-u.min)/f,h=[],y=0;y<f+1;y+=1)h.push(u.min+p*y);u.domain=h,u.range=function(e){for(var t=e.resources.theme.palette("quant",f),n=Math.max(1,Math.floor(t.length/f)),r=[],i=0;i<f;i+=1)r.push(t[i*n]);return[r[0]].concat(r,[r[r.length-1]])}}return u};function sl(e,t){var n;return t.activeMeasureIndex>=0?n=e.pic.fields().filter((function(e){return"measure"===e.type()}))[t.activeMeasureIndex]:"libraryItem"===t.type?n=e.pic.field((function(e){return e.raw().colorMapRef===t.key&&void 0!==t.key})):"expression"===t.type&&(n=e.pic.field((function(e){return"colorByAlternative"===e.raw().id}))),n||(n=e.pic.field((function(e){return void 0!==e.raw().matchMeasure})))&&(n=e.pic.fields().filter((function(e){return"measure"===e.type()}))[n.raw().matchMeasure]),n}function ll(e){e.measureOverrides.every((function(e){return!e}))&&(e.measureOverrides=null)}function ul(e,t){for(var n=(null==t?void 0:t.domain)||[],r=(null==t?void 0:t.range)||[],i=[],o=0;o<e.length;++o){var a=e[o];if("constant"===(null==a?void 0:a.mode)){var s=n.indexOf(o);-1===s?(n.push(o),r.push(a.primary)):r[s]=a.primary,e[o]=null}else if(a){i.push(o);var l=n.indexOf(o);-1!==l&&(n.splice(l,1),r.splice(l,1))}}return{domain:n,range:r,exclude:i}}function cl(e,t,n,r){var i,o=function(e,t,n,r){if(t.input&&!t.input.auto){if("byMeasure"===t.input.mode)return function(e,t,n){var r=t.theme,i=t.hc,o=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).getCField,a=void 0===o?sl:o,s=n.input.byMeasureDef||{activeMeasureIndex:0},l=a(n,s),u=al(0,{theme:r,hc:i},n,{f:l});if(u.invalid)return u;"expression"===s.type&&(s.activeMeasureIndex<0||void 0===s.activeMeasureIndex)&&(u.label=s.label,l&&"color.altLabel"===l.raw().labelExpRef&&(u.label=n.input.altLabel)),!u.label&&l&&(u.label=l.title());var c=s.activeMeasureIndex>=0?l:null;if(!c&&l&&void 0!==l.raw().matchMeasure&&l.raw().matchMeasure>-1&&(c=n.pic.fields().filter((function(e){return"measure"===e.type()}))[l.raw().matchMeasure]),n.input.useMeasureGradient&&"libraryItem"===s.type)if(c){var d=c.raw().coloring;d&&d.gradient&&ts(u,il(e,d.gradient,u,c))}else u.auxiliary=s;return u}(e,n,t);if("byDimension"===t.input.mode)return function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=r.getCDef,o=void 0===i?os:i,a=r.getCByField,s=void 0===a?as:a,l=r.getPersistence,u=void 0===l?is:l,c=o(t,n),d=s(n,c),m=d?d.raw():{},f=n&&n.pic?n.pic.raw():{};if(m.qError||m.qSize&&0===m.qSize.qcy&&!f.qHasOtherValues)return{invalid:!0};var p={mode:"field",fieldType:"dimension",type:"categorical",field:d?d.key():void 0,isFieldLocked:m.qLocked};return("expression"===c.type||c.activeDimensionIndex<0)&&(p.label=c.label,"color.altLabel"===m.labelExpRef&&(p.label=n.input.altLabel)),!p.label&&d&&(p.label=d.title()),n.input.dimensionScheme&&(p.palettes={categorical:n.input.dimensionScheme}),n.input.useDimColVal&&"libraryItem"===c.type&&(p.auxiliary=c),ts(p,u(t,n,c,d,{byRow:rs,byElemNo:ns})),p}(e,n,t);if("byExpression"===t.input.mode)return function(e,t,n,r){var i=t.hc,o=t.theme,a=t.translator,s=n.pic.field((function(e){return"colorByExpression"===e.raw().id}));if(!s||!s.raw().qFallbackTitle&&!n.input.colorExpression||!(Number.isFinite(s.raw().qMin)&&Number.isFinite(s.raw().qMax)||n.input.expressionIsColor))return{mode:"constant",type:"constant",primary:r.nil};if(n.input.expressionIsColor)return{mode:"field",fieldType:"expression",field:s?s.key():void 0,type:"color"};var l=al(0,{hc:i,theme:o},n,{f:s});return l.invalid||(l.label=n.input.expressionLabel||a.get("Object.ChartTooltip.ColorExpression")),l}(0,n,t,r);if("byMultiple"===t.input.mode||"primary"===t.input.mode)return function(e,t,n,r){var i=t.hc,o=t.theme,a=t.translator,s=n.input.useBaseColors;if(("byMultiple"===n.input.mode||"primary"===n.input.mode&&"measure"===n.input.useBaseColors)&&i.qMeasureInfo.length>1&&(s="measure"),"measure"===s){var l=[],u=[];"measure"===n.input.useBaseColors&&i.qMeasureInfo.forEach((function(t,n){if(t.baseColor||t.coloring&&t.coloring.baseColor){l.push(n);var i=e.resolveUIColor(t.baseColor||t.coloring.baseColor);"none"===i?u.push(r.primary):u.push(i)}}));var c=n.input.dimensionScheme?{categorical:n.input.dimensionScheme}:void 0,d=o?o.getDataColorPalettes()[0]:void 0;return"measure"===n.input.useBaseColors&&d&&(c={categorical:d.key}),{mode:"measure",type:"categorical",palettes:c,label:a?a.get("Common.Measures"):void 0,explicit:l.length?{domain:l,range:u}:void 0}}if("dimension"===s){var m=[],f=[];return i.qDimensionInfo.forEach((function(t,n){if(t.baseColor||t.coloring&&t.coloring.baseColor){m.push(n);var i=e.resolveUIColor(t.baseColor||t.coloring.baseColor);"none"===i?f.push(r.primary):f.push(i)}})),{mode:"dimension",type:"categorical",field:m.length?m[0]:void 0,explicit:m.length?{domain:m,range:f}:void 0}}var p=r.primary;if(void 0!==n.input.paletteColor)n.input.paletteColor&&(p=e.resolveUIColor(n.input.paletteColor));else{var h=n.input.singleColor;"number"!=typeof h||Number.isNaN(h)||(p=["#b0afae","#7b7a78","#545352","#4477aa","#7db8da","#b6d7ea","#46c646","#f93f17","#ffcf02","#276e27","#ffffff","#000000"][h])}return{mode:"constant",type:"constant",primary:p}}(e,n,t,r)}return{}}(e,t,n,r);return null!==(i=t.input)&&void 0!==i&&i.measureOverrides?(o.measureOverrides=t.input.measureOverrides.map((function(n,i){return function(e){var t,n=e.cm,r=e.defaults,i=e.index,o=e.input,a=e.pic;if(!o||!o.on)return null;var s=null!==(t=o.mode)&&void 0!==t?t:"primary";return"primary"===s?function(e,t,n){var r=n.primary;return void 0!==t.paletteColor&&t.paletteColor&&(r=e.resolveUIColor(t.paletteColor)),Pa(Pa({},n),{},{mode:"constant",type:"constant",primary:r})}(n,o,r):"byExpression"===s?function(e,t,n){var r="qMeasureInfo/".concat(e,"/"),i=t.field((function(e){return e.id().startsWith(r)&&"colorByMeasureExpression"===e.raw().id})),o=i;return Pa(Pa({},n),{},o?{mode:"field",fieldType:"expression",field:i?i.key():void 0,type:"color"}:{mode:"constant",type:"constant",primary:n.nil})}(i,a,r):null}({cm:e,input:n,defaults:r,index:i,pic:t.pic})})),function(e,t){var n,r,i,o=t.translator;if(ll(e),1===(null===(n=e.measureOverrides)||void 0===n?void 0:n.length))return e.measureOverrides[0];if("measure"===e.mode&&e.measureOverrides&&(e.explicit=ul(e.measureOverrides,e.explicit),ll(e)),null!==(r=e.measureOverrides)&&void 0!==r&&r.every((function(e){return"constant"===(null==e?void 0:e.mode)}))){var a={mode:"measure",type:"categorical",label:null==o?void 0:o.get("Common.Measures")};return a.explicit=ul(e.measureOverrides),a}return null!==(i=e.measureOverrides)&&void 0!==i&&i.every((function(e){return e}))?{invalid:!0,measureOverrides:e.measureOverrides}:e}(o,n)):o}var dl=function(e,t){var n=e.fieldType,r={};if(t)if("measure"===n){var i=t.coloring;i&&(r.measureGradient=i.gradient)}else if("dimension"===n){var o=t[0],a=t[1];o&&(r.legendDataPage=o),a&&(r.dimValsData=a.colorMap)}return r},ml=function(e){throw e.isHandled=!0,e},fl=function(e,t){var n=t.layout,r=t.app;return n&&n.snapshotData?n.snapshotData.content&&n.snapshotData.content.chartData&&n.snapshotData.content.chartData.dimValsData?Promise.resolve({colorMap:n.snapshotData.content.chartData.dimValsData}):Promise.reject():r&&r.getObject?r.getObject("ColorMapModel_".concat(e)).then((function(e){return e.getLayout()})):Promise.reject()},pl=function(e,t){var n=t.layout,r=t.app;return n&&n.snapshotData?n.snapshotData.content&&n.snapshotData.content.chartData&&n.snapshotData.content.chartData.measureGradient?Promise.resolve({coloring:{gradient:n.snapshotData.content.chartData.measureGradient}}):Promise.reject():r&&r.getMeasure?r.getMeasure(e).then((function(e){return e.getMeasure()})):Promise.reject()},hl=function(e,t){var n=t.layout,r=t.model,i=t.app;return n&&n.snapshotData?n.snapshotData.content&&n.snapshotData.content.chartData&&n.snapshotData.content.chartData.legendDataPage?Promise.resolve(n.snapshotData.content.chartData.legendDataPage):Promise.reject():r&&r.session&&i?r.getHyperCubeData(e,[{qHeight:100,qLeft:0,qTop:0,qWidth:2}]).catch(ml):Promise.reject()};function yl(e){return function(t){return"object"===za(t.datum[e])?t.datum[e].value:void 0}}function gl(e){return"object"===za(e.datum.isNull)?e.datum.isNull.value:-2===e.datum.value}function vl(e){return-3===e.datum.value}var bl={TITLE:{COLOR:void 0,FONT_SIZE:"16px",FONT_FAMILY:"'Source Sans Pro', 'Arial', 'sans-serif'"},LABEL:{COLOR:void 0,FONT_SIZE:void 0,FONT_FAMILY:"'Source Sans Pro', 'Arial', 'sans-serif'"}};function xl(e){var t=e.theme,n=e.key,r=e.styleOverrides,i={title:{color:bl.TITLE.COLOR,fontSize:bl.TITLE.FONT_SIZE,fontFamily:bl.TITLE.FONT_FAMILY},label:{color:bl.LABEL.COLOR,fontSize:bl.LABEL.FONT_SIZE,fontFamily:bl.LABEL.FONT_FAMILY}};if(!t&&!r)return i;var o=r||{},a=o.title,s=o.label,l=function(e){var t=e.theme,n=e.key;return function(e,r,i,o){return void 0!==e?e:t?t.getStyle(n,r,i):o}}({theme:t,key:n});return i.title.color=l(null==a?void 0:a.color,"legend.title","color",bl.TITLE.COLOR),i.title.fontSize=l(null==a?void 0:a.fontSize,"legend.title","fontSize",bl.TITLE.FONT_SIZE),i.title.fontFamily=l(null==a?void 0:a.fontFamily,"legend.title","fontFamily",bl.TITLE.FONT_FAMILY),i.label.color=l(null==s?void 0:s.color,"legend.label","color",bl.LABEL.COLOR),i.label.fontSize=l(null==s?void 0:s.fontSize,"legend.label","fontSize",bl.LABEL.FONT_SIZE),i.label.fontFamily=l(null==s?void 0:s.fontFamily,"legend.label","fontFamily",bl.LABEL.FONT_FAMILY),i}var Sl=function(e,t,n){var r=e&&e.dock||void 0;if("auto"!==r)return r||"right";if(t){var i=t.element.getBoundingClientRect();if(i.height>i.width)return"bottom"}return n?"left":"right"},Ml=function(e,t,n){return!(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 El(e,t){var n=e.styleReference,r=e.styleOverrides,i=e.chart,o=e.rtl,a=t.legendProps,s=t.coloring,l=t.theme,u=t.hc,c=xl({theme:l,key:n,styleOverrides:r});return{layout:{minimumLayoutMode:"MEDIUM",dock:Sl(a,i,o)},show:"function"==typeof a.show?function(){return Ml(a,u,s)}:Ml(a,u,s),renderer:"svg",mounted:function(e){e.childNodes[0].style.pointerEvents="none",e.style.overflow="hidden"},settings:{title:{show:!1!==a.showTitle,wordBreak:"break-word",maxLines:2,lineHeight:1.2,text:s.label||"",fill:c.title.color,fontSize:c.title.fontSize,fontFamily:c.title.fontFamily}}}}function Cl(e,t,n){var r=[],i=[],o=function(e,t,n){return"categorical"===t.coloring.type?function(e,t,n){var r=El(e,t);if(!r.show)return!1;var i,o=e.key,a=e.styleReference,s=e.styleOverrides,l=e.viewState,u=e.rtl,c=e.settings,d=e.style,m=t.scaleKey,f=t.theme,p=t.scales,h=xl({theme:f,key:a,styleOverrides:s}),y=r.layout.dock,g="left"===y||"right"===y?{maxLines:2,wordBreak:"break-word"}:{},v={up:"M13.6,11 L2.4,11 C2.28954305,11 2.2,10.9104569 2.2,10.8 C2.2,10.756726 2.21403557,10.7146192 2.24,10.68 L7.84,3.21333333 C7.90627417,3.12496777 8.03163444,3.10705916 8.12,3.17333333 C8.13516113,3.18470418 8.14862915,3.1981722 8.16,3.21333333 L13.76,10.68 C13.8262742,10.7683656 13.8083656,10.8937258 13.72,10.96 C13.6853808,10.9859644 13.643274,11 13.6,11 Z",down:"M2.4,4 L13.6,4 C13.7104569,4 13.8,4.08954305 13.8,4.2 C13.8,4.24327404 13.7859644,4.28538077 13.76,4.32 L8.16,11.7866667 C8.09372583,11.8750322 7.96836556,11.8929408 7.88,11.8266667 C7.86483887,11.8152958 7.85137085,11.8018278 7.84,11.7866667 L2.24,4.32 C2.17372583,4.23163444 2.19163444,4.10627417 2.28,4.04 C2.31461923,4.01403557 2.35672596,4 2.4,4 Z",left:"M11,2.4 L11,13.6 C11,13.7104569 10.9104569,13.8 10.8,13.8 C10.756726,13.8 10.7146192,13.7859644 10.68,13.76 L3.21333333,8.16 C3.12496777,8.09372583 3.10705916,7.96836556 3.17333333,7.88 C3.18470418,7.86483887 3.1981722,7.85137085 3.21333333,7.84 L10.68,2.24 C10.7683656,2.17372583 10.8937258,2.19163444 10.96,2.28 C10.9859644,2.31461923 11,2.35672596 11,2.4 Z",right:"M4,13.6 L4,2.4 C4,2.28954305 4.08954305,2.2 4.2,2.2 C4.24327404,2.2 4.28538077,2.21403557 4.32,2.24 L11.7866667,7.84 C11.8750322,7.90627417 11.8929408,8.03163444 11.8266667,8.12 C11.8152958,8.13516113 11.8018278,8.14862915 11.7866667,8.16 L4.32,13.76 C4.23163444,13.8262742 4.10627417,13.8083656 4.04,13.72 C4.01403557,13.6853808 4,13.643274 4,13.6 Z"};"dimension"===t.coloring.fieldType&&(i=function(e){return e.datum.value>=0||-3===e.datum.value});var b="".concat(m,"Legend");return ts(!0,r,{type:"legend-cat",key:"".concat(o,"-cat"),scale:b in p?b:m,settings:{layout:{scrollOffset:function(){return l?l.get("legendScrollOffset"):void 0},size:-1!==["top","bottom"].indexOf(r.layout.dock)?2:1,direction:u?"rtl":"ltr",horizontal:20},item:{show:i,label:Pa({fill:h.label.color,fontSize:h.label.fontSize,fontFamily:h.label.fontFamily},g)},navigation:{disabled:n,button:{content:function(e,t){var n=t.direction;return 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:v[n]})])])}}}},brush:{consume:[{context:"selection",data:["",o],style:{inactive:{opacity:.3}}}]}},{settings:c,style:d})}(e,t,n):"continuous"===t.coloring.type&&function(e,t){var n,r=e.key,i=e.styleReference,o=e.styleOverrides,a=e.rtl,s=e.settings,l=e.style,u=t.scaleKey,c=t.theme,d="".concat(u,"Range"),m=El(e,t);if(!m.show)return!1;var f=xl({theme:c,key:i,styleOverrides:o}),p=m.layout.dock,h="right"===p||"left"===p,y=null===(n=t.scales)||void 0===n?void 0:n[d];return h&&y&&(y.invert=!0),ts(!0,m,{type:"legend-seq",key:"".concat(r,"-seq"),settings:{fill:u,major:d,length:1,tick:{fill:f.label.color,fontSize:f.label.fontSize,fontFamily:f.label.fontFamily},title:{anchor:!a||"top"!==m.layout.dock&&"bottom"!==m.layout.dock?void 0:"right",padding:parseFloat(m.settings.title.fontSize)||16}}},{settings:s,style:l})}(e,t)}(e,t,n&&n.navigationDisabled);return r.push(o),o&&"legend-cat"===o.type&&(i.push(function(e){var t=e.key,n=e.requireFailure,r=e.recognizeWith,i=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).actions;return{key:"event:tap-".concat(t),type:"Tap",requireFailure:n,recognizeWith:r,options:{event:"legendtap",interval:10,pointers:1,enable:function(e,n){var r;if(!n)return!0;if(null!=i&&null!==(r=i.interact)&&void 0!==r&&r.enabled&&!i.interact.enabled())return!1;if(!this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).some((function(e){return e.key==="".concat(t,"-cat")})))return!1;var o=n.srcEvent.target;return!!(o&&o.hasAttribute("data-action")&&o.hasAttribute("data-component-key"))||!(!o||!o.childNodes[0]||"BUTTON"!==o.childNodes[0].nodeName)}},events:{legendtap:function(e){e.preventDefault();var t=e.srcEvent.target;t&&t.hasAttribute("data-action")&&t.hasAttribute("data-component-key")&&this.chart.component(t.getAttribute("data-component-key")).emit(t.getAttribute("data-action"))}}}}(e,n)),i.push(function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.eventName,r=t.key,i=t.requireFailure,o=t.recognizeWith,a=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).actions;return{key:"event:pan-".concat(r),type:"Pan",requireFailure:i,recognizeWith:o,options:{event:n,pointers:1,threshold:10,enable:function(e,t){var i;return this.started===n||!t||!(null!=a&&null!==(i=a.interact)&&void 0!==i&&i.enabled&&!a.interact.enabled())&&this.chart.componentsFromPoint({x:t.center.x,y:t.center.y}).some((function(e){return e.key==="".concat(r,"-cat")}))}},events:(e={},Ha(e,"".concat(n,"start"),(function(e){e.preventDefault(),this.started!==n&&(this.started=n,this.chart.component("".concat(r,"-cat")).emit("panstart",e))})),Ha(e,"".concat(n,"move"),(function(e){e.preventDefault(),this.chart.component("".concat(r,"-cat")).emit("panmove",e)})),Ha(e,"".concat(n,"end"),(function(e){e.preventDefault(),this.chart.component("".concat(r,"-cat")).emit("panend",e),this.started=!1})),e)}}(e,n))),{interactions:i,components:r}}var ql=function(e){return"rgba(".concat([(16711680&e)>>16,(65280&e)>>8,255&e,((4278190080&e)>>>24)/255].join(","),")")};function Al(e){var t=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.auto,n=function(e){var t=Pa({hc:null,colorProps:null,layout:null,theme:null},e),n={},r={auto:function(){return{mode:"primary"}},getDimensionColorMap:function(){return Promise.reject()},getMeasure:function(){return Promise.reject()},getAttributeDimension:function(){return Promise.reject()}},i={auto:function(e){return e?(r.auto=e,i):r.auto},getDimensionColorMap:function(e){return e?(r.getDimensionColorMap=e,i):r.getDimensionColorMap},getAttributeDimension:function(e){return e?(r.getAttributeDimension=e,i):r.getAttributeDimension},getMeasure:function(e){return e?(r.getMeasure=e,i):r.getMeasure},set:function(e){var i;if(!e.colorProps)throw new Error('Missing "colorProps"');if(ts(t,e),(n={pic:t.picasso.data("q")({data:t.hc,config:{localeInfo:t.localeInfo}}),input:t.colorProps}).input.auto){var o=r.auto(e.layout);n.input=ts(!0,{},n.input,o,{auto:!1});var a=t.theme?t.theme.getDataColorPalettes():[];a[0]&&(n.input.dimensionScheme=a[0].key);var s=0;n.input.byDimDef&&+n.input.byDimDef.activeDimensionIndex>=0&&(s=+n.input.byDimDef.activeDimensionIndex),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)}null!==(i=n.input.measureOverrides)&&void 0!==i&&i.every((function(e){return!e||!e.on}))&&(n.input=ts(!1,{},n.input,{measureOverrides:null}))},palettes:function(){if(!n.palettes){var e=t.theme,r=[];(e&&e.getDataColorPickerPalettes()||[]).forEach((function(e){r.push({key:"ui",colors:e.colors})})),n.palettes=r}return n.palettes},getAuxiliaryData:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/qHyperCubeDef";if(!e.auxiliary&&!/qAttrDimInfo/.test(e.field))return Promise.resolve();var i=(e.auxiliary||{}).key;if("measure"===e.fieldType)return r.getMeasure(i,t).catch((function(){}));if("dimension"===e.fieldType){var o="".concat(n,"/").concat(e.field).replace("qDimensionInfo","qDimensions").replace("qAttrDimInfo","qAttributeDimensions");return Promise.all([/qAttrDimInfo/.test(e.field)?r.getAttributeDimension(o,t).catch((function(){})):Promise.resolve(),i?r.getDimensionColorMap(i,t).catch((function(){})):Promise.resolve()])}return Promise.resolve()},getAuxiliarySettings:function(e,r){var i=this;return e.auxiliary||/qAttrDimInfo/.test(e.field)?(this.palettes(),this.getAuxiliaryData(e,r).then((function(r){if(!r)return{};if("measure"===e.fieldType){if(r.coloring&&r.coloring.gradient){var o=n.pic.field(e.field);return il(i,r.coloring.gradient,e,o)}return{}}if("dimension"===e.fieldType){var a={nil:e.nil,others:e.others},s=r[0],l=r[1]?r[1].colorMap:null;if(s){var u=t.picasso.data("q")({data:{qDimensionInfo:[n.pic.field(e.field).raw(),n.pic.field(e.field).raw()],qMeasureInfo:[],qDataPages:s,qInterColumnSortOrder:[0,1],qMode:"S"}});a.legendDataset=u}return l?function(e,t,n,r){var i=r.external,o=r.field,a=Pa({},e);ts(a,ns(o,o.raw().qCardinal));var s=i.theme?i.theme.getDataColorPalettes()[0]:null;return t.nul&&(a.nil=n.resolveUIColor(t.nul)),t.oth&&(a.others=n.resolveUIColor(t.oth)),t.usePal?(a.palettes={categorical:t.pal},s&&!t.pal&&(a.palettes.categorical=s.key,ts(a,ns(o)))):!1===t.autoFill&&t.single?a.range=[n.resolveUIColor(t.single)]:t.autoFill&&(s&&(a.palettes={categorical:s.key}),ts(a,ns(o))),t.colors&&t.colors.length&&(a.explicit=function(e,t,n){for(var r={},i=0;i<e.length;i+=1)r[e[i].value]=e[i].baseColor;var o=[];return{domain:function(e){var i=e.data,a=[];o=[];for(var s=0;s<i.items.length;s++){var l=i.items[s],u=(l.text||l).label;r[u]&&-1===a.indexOf(l.value)&&(a.push(l.value),o.push(t.resolveUIColor(r[u])))}return a.push(-3,-2),o.push(n.others),o.push(n.nil),a},range:function(){return o}}}(t.colors,n,a)),a}(a,l,i,{external:t,field:n.pic.field(e.field)}):a}return{}}))):Promise.resolve()},resolveUIColor:function(e){if(e.index<0||void 0===e.index)return e.color;if(void 0===n.uiPalette&&(n.uiPalette=this.palettes().filter((function(e){return"ui"===e.key}))[0]||!1),!n.uiPalette)return e.color;var 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:function(){if(this.palettes(),!n.settings){var e={primary:"steelblue",others:"#aaa",nil:"#ddd"},r=t.theme;r&&(e=Pa(Pa({},e),r.getDataColorSpecials())),n.settings=ts(e,cl(this,n,t,e))}return n.settings}};return i}(e.resources).auto(t||function(){return{mode:"byDimension",persistent:!1,useDimColVal:!0,byDimDef:{activeDimensionIndex:0,type:"expression",label:""}}}).getDimensionColorMap((function(e,t){var n=t.layout,r=t.app;return fl(e,{layout:n,app:r})})).getMeasure((function(e,t){var n=t.layout,r=t.app;return pl(e,{layout:n,app:r})})).getAttributeDimension((function(e,t){var n=t.layout,r=t.model,i=t.app;return hl(e,{layout:n,model:r,app:i})}));return n.getSnapshotData=dl,n}({resources:e}),n={},r={},i=function(e){return r.settings||(e||console.warn("settings() called before auxiliarySettings()"),r.settings=t.settings()),r.settings},o={config:function(i){if(n=Pa({},i),r={},!n.key)throw new Error("Missing key");t.set(Pa(Pa({},e),n))},auto:function(e){return e?(t.auto(e),o):t.auto()},getAuxiliarySettings:function(e){return r.auxiliarySettings?Promise.resolve(r.auxiliarySettings):t.getAuxiliarySettings(i(!0),e).then((function(e){return r.auxiliarySettings=e||{},r.settings=Pa(Pa({},r.settings),r.auxiliarySettings),r.scales=void 0,r.color=void 0,r.auxiliarySettings}))},getAuxiliaryData:function(){return t.getAuxiliaryData(i())},getSnapshotData:function(e){var n=i();return t.getAuxiliaryData(n,e).then((function(e){return t.getSnapshotData(n,e)}))},resolveUIColor:function(e){return t.resolveUIColor(e)},settings:function(){var e=i();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:function(e){var t;return(null===(t=i().measureOverrides)||void 0===t?void 0:t[e])||this.settings()},isSelectionLocked:function(e){var t=e.isMeasureSelectionLocked;return function(e,t){var n=t.isMeasureSelectionLocked;return"field"!==e.mode||("dimension"===e.fieldType?e.isFieldLocked:"measure"!==e.fieldType||n)}(i(),{isMeasureSelectionLocked:t})},palettes:function(){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.colorProps,n=e.coloring,r=e.theme,i=[];if(n&&n.palettes&&r){var o=n.palettes.categorical||t.dimensionScheme,a=r.getDataColorPalettes().filter((function(e){return e.key===o}))[0]||r.getDataColorPalettes()[0];o&&a&&i.push({key:"categorical",colors:a.colors});var s=n.palettes.metric||t.measureScheme,l=r.getDataColorScales().filter((function(e){return e.key===s}))[0];if(l){var u=l.colors[0]?l.colors:[[]].concat(Ba(l.colors.slice(1)));u=Array.isArray(u[0])?u.map((function(e){return e.slice().reverse()})):u.slice().reverse(),i.push({key:"quant",colors:u})}}return i}({coloring:i(),colorProps:n.colorProps,theme:n.theme})},scales:function(){return r.scales=r.scales||function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.hc,n=e.coloring,r=e.rtl,i=e.key,o=e.source,a=e.picasso,s={},l=i;if(n){var u={override:!0,domain:n.explicit&&"function"==typeof n.explicit.domain?n.explicit.domain:[].concat(Ba((n.explicit||{}).domain||[]),[-3,-2]),range:n.explicit&&"function"==typeof n.explicit.range?n.explicit.range:[].concat(Ba((n.explicit||{}).range||[]),[n.others,n.nil])};if("field"===n.mode){if("dimension"===n.fieldType){var c,d=function(e){var t=e.hc,n=e.source,r=e.coloring,i={data:{extract:[{source:"dummy",field:0,filter:function(){return i.expando=t.qDataPages[0]?t.qDataPages[0].qArea.qTop:0,!1}},{source:n,field:r.field,trackBy:r.valueAccessor,reduce:"first",props:{row:{reduce:function(){return i.expando++}},text:{value:function(e){return e.qText},reduce:"first"}}}]},expando:0};return i}({hc:t,source:o,coloring:n}).data;if(n.legendDataset){var m=0,f={};a.data("q")({data:t}).extract({field:n.field,trackBy:n.valueAccessor,reduce:function(e){var t=e[0];return f[t]=m++,e[0]}}),c={source:"attrDim",extract:{field:"qDimensionInfo/0",filter:function(e){return e.qElemNumber>=0},props:{row:{value:function(e){return f[e.qElemNumber]}}}}}}var p={data:d,range:n.range,domain:n.domain,explicit:u,type:"categorical-color",label:function(e){return e.datum.text&&e.datum.text.value?e.datum.text.value:e.datum.label}};s[l]=p,c&&(s["".concat(l,"Legend")]=Pa(Pa({},p),{},{data:c})),t&&t.qHasOtherValues&&c&&((c||p.data).amend=[{label:t.qDimensionInfo[0].othersLabel,source:{key:"qHyperCube",field:"qDimensionInfo/0"},row:{value:-3},value:-3}])}else if("measure"===n.fieldType){var h={data:{field:n.field},min:n.min,max:n.max};s[l]=ts({},h,{type:"categorical"===n.type?"threshold-color":"sequential-color",range:n.range,domain:n.domain,invert:n.reverse}),"sequential-color"===s[l].type&&(s["".concat(l,"Range")]=ts({},h,{invert:!!r}))}else if("color"!==n.type)throw new Error("UNUSED FIELD")}else if("dimension"===n.mode){var y={data:t.qDimensionInfo.map((function(e,t){return t})),label:function(e){return t.qDimensionInfo[e.datum.value].qFallbackTitle},explicit:u,type:"categorical-color"};s[l]=y}else if("measure"===n.mode){var g={data:t.qMeasureInfo.map((function(e,t){return t})).filter((function(e){var t,r;return!(null!==(t=n.explicit)&&void 0!==t&&null!==(r=t.exclude)&&void 0!==r&&r.includes(e))})),label:function(e){return t.qMeasureInfo[e.datum.value].qFallbackTitle},explicit:u,type:"categorical-color"};s[l]=g}}return s}({hc:n.hc,coloring:i(),key:n.key,source:n.source,picasso:e.picasso}),r.scales},color:function(){return r.color=r.color||function(e){var t=e.coloring,n=e.scales,r=e.key,i=yl(r),o=yl("".concat(r,"IsAnOther")),a=function(e,t){var r=e.fieldType,a=e.invalid,s=e.mode,l=e.nil,u=e.others,c=e.primary,d=e.type;return a?function(e){return vl(e)||o(e)?u:l}:n[t]?function(e){return vl(e)?u:gl(e)||-2===i(e)&&"dimension"===r||"NaN"===i(e)?l:o(e)?u:e.resources.scale(t)(i(e))||u}:"constant"===s?function(e){return vl(e)||o(e)?u:gl(e)?l:c}:"color"===d?function(e){return vl(e)||o(e)?u:gl(e)?l:i(e)||u}:null},s=a(t,r);if(t.measureOverrides){var l=yl("".concat(r,"MeasureIdx")),u=t.measureOverrides.map((function(e){return e&&a(e)}));return function(e){var t=l(e);return u[t]?u[t](e):s(e)}}return s}({coloring:i(),scales:this.scales(),key:n.key}),r.color},datumProps:function(e){return function(e){var t,n,r=e.hc,i=e.coloring,o=e.scales,a=e.key,s=e.addMeasureIx,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,u=a,c=i.nil;"field"===i.mode&&i.field?t=i.field:o[a]&&"field"===i.mode&&(t=o[a].data.field||i.field),t?(n={field:t,reduce:"first"},"color"===i.type&&(n.value=function(e){return"NaN"!==e.qNum?ql(e.qNum):e.qText&&Cs(e.qText)?e.qText:c})):"dimension"===i.mode?n=void 0!==i.field?i.field:r.qDimensionInfo.length-1:"measure"===i.mode&&(n=l);var d=Ha({},u,n);return r.qDimensionInfo.length>1&&(d["".concat(u,"IsAnOther")]={fields:r.qDimensionInfo.map((function(e,t){return{field:"qDimensionInfo/".concat(t)}})),value:function(e){return-1!==e.indexOf(-3)}}),s&&(d["".concat(u,"MeasureIdx")]=l),d}({coloring:this.settingsForMeasure(e),scales:this.scales(),key:n.key,hc:n.hc,addMeasureIx:i().measureOverrides},e)},data:function(){var e=i(),t={key:"dummy",data:[["field"],["a"]]};return e.legendDataset?[t,{type:"q",key:"attrDim",data:e.legendDataset.raw(),config:{localeInfo:n.localeInfo}}]:[t]},legend:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.eventName,r=e.key,o=e.viewState,a=e.chart,s=e.rtl,l=e.styleReference,u=void 0===l?"object.legend":l,c=e.styleOverrides,d=e.settings,m=void 0===d?{}:d,f=e.style,p=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Cl({eventName:t,key:r,rtl:s,viewState:o,chart:a,styleReference:u,styleOverrides:c,settings:m,style:void 0===f?{}:f},{legendProps:n.legendProps,scaleKey:n.key,coloring:i(),theme:n.theme,hc:n.hc,scales:this.scales()},p)}};return o}var Ol=function(e){return e.baseColor||e.coloring&&e.coloring.baseColor};function Dl(e){var t=e.qHyperCube,n=t.qDimensionInfo,r=t.qMeasureInfo,i=n.some(Ol),o=r.some(Ol),a=e.color.useBaseColors;return"measure"===a&&!o||"dimension"===a&&!i?"off":a}var Il=function(e){return e.baseColor||e.coloring&&e.coloring.baseColor};function wl(e){var t,n=e.qHyperCube.qDimensionInfo.some(Il),r=e.qHyperCube.qMeasureInfo.some(Il),i=n?"dimension":void 0;return{mode:"primary",useBaseColors:null!==(t=null!=i?i:r?"measure":void 0)&&void 0!==t?t:"off",paletteColor:null}}var Tl=function(){};function Nl(e){var t,n,r,i,o=e.picasso,a=e.model,s=e.app,l=e.translator,u=e.layoutService,c=void 0===u?void 0:u,d=e.createConfig,m=void 0===d?Tl:d,f=e.config,p=void 0===f?{}:f,h=e.custom,y=void 0===h?{}:h,g=p.localeInfo,v=p.key,b=p.theme,x=void 0===b?void 0:b,S=p.auto,M=void 0===S?void 0:S,E=p.definitionPath,C=null==c||null===(t=c.getLayout)||void 0===t?void 0:t.call(c),q={theme:x,key:v,localeInfo:g,layout:C,hc:null==c||null===(n=c.getHyperCube)||void 0===n?void 0:n.call(c),legendProps:null==c||null===(r=c.getLayoutValue)||void 0===r?void 0:r.call(c,"legend"),colorProps:Pa(Pa({},null==c||null===(i=c.getLayoutValue)||void 0===i?void 0:i.call(c,"color")),{},{useBaseColors:C?Dl(C):void 0})},A=Al({picasso:o,model:a,app:s,translator:l,auto:M});!1!==M&&A.auto((function(e){return M?M({layout:e,defaultAuto:wl}):wl(e)}));var O=!1,D={getColor:function(){return A.color()},getPaletteColor:function(e){var t=e.index,n=e.color;return A.resolveUIColor({index:t,color:n})},getData:function(){return A.data()},getDatumProps:function(e){return A.datumProps(e)},getSnapshotData:function(){return A.getSnapshotData(E)},getSettingsForMeasure:function(e){return A.settingsForMeasure(e)},getSettings:function(){return A.settings()},getLegend:function(e,t){return A.legend(e,t)},getScales:function(){return A.scales()},getPalettes:function(){return A.palettes()},isSelectionLocked:function(e){var t=e.isMeasureSelectionLocked;return A.isSelectionLocked({isMeasureSelectionLocked:t})},isInitialized:function(){return O},custom:Pa({},y),initialize:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).createConfig,t=(void 0===e?m:e)({getUseBaseColors:Dl}),n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Pa(Pa(Pa({},e),t),{},{colorProps:Pa(Pa({},e.colorProps),t.colorProps||{})})}(q,t);return A.config(n),A.getAuxiliarySettings(E).then((function(){O=!0}))}};return D}function Ll(e){var t=e.chart,n=e.logicalSize;if(n)return n;var r=t?t.element.getBoundingClientRect():{};return{width:r.width,height:r.height}}var kl=[{key:"FULL",size:{width:550,height:450}},{key:"MEDIUM",size:{width:400,height:220}},{key:"SMALL",size:{width:300,height:150}},{key:"XSMALL",size:{width:150,height:75}}];function Rl(e){var t=e.width,n=e.height,r=kl.filter((function(e){return t>=e.size.width&&n>=e.size.height})).shift();return r?r.key:"SPARK"}var Pl={left:"right",right:"left",top:"bottom",bottom:"top",near:"far",far:"near"};function Fl(e){var t=e.orientation,n=e.dock,r=e.btt,i=e.rtl,o="horizontal"===t?function(e){return"bottom"===e||"near"===e?"bottom":"top"}(n):function(e,t){var n="left"===e||"near"===e?"left":"right";return t?Pl[n]:n}(n,i),a=function(e,t,n){return"vertical"===e?t?"bottom":"top":n?"right":"left"}(t,r,i);return{current:o,opposite:Pl[o],start:a,end:Pl[a]}}function zl(e){var t=e.chart,n=e.layoutService,r=e.config,i=void 0===r?{}:r,o=i.logicalSize,a=void 0!==o&&o,s=i.rtl,l=void 0!==s&&s,u={chart:{size:void 0,mode:void 0},x:{dock:void 0,opposite:void 0,size:void 0},y:{dock:void 0,opposite:void 0,size:void 0}},c={type:"x-y",config:Pa({},i),meta:u,update:function(e){u.chart.size={width:e.width,height:e.height},u.chart.mode=Rl(e);var t=Fl({orientation:"horizontal",dock:n.getLayoutValue("xAxis.dock"),btt:!1,rtl:l}),r=t.current,i=t.opposite;u.x.dock=r,u.x.opposite=i,u.x.size=e.width;var o=Fl({orientation:"vertical",dock:n.getLayoutValue("yAxis.dock"),btt:!0,rtl:l}),a=o.current,s=o.opposite;u.y.dock=a,u.y.opposite=s,u.y.size=e.height}};return c.update(Ll({chart:t,logicalSize:a})),c}var _l="vertical",$l="horizontal";function Hl(e){var t=e.chart,n=e.layoutService,r=e.config,i=void 0===r?{}:r,o=e.typeConfig,a=void 0===o?{}:o,s=i.logicalSize,l=void 0!==s&&s,u=i.rtl,c=void 0!==u&&u,d=a.fallback===_l?_l:$l,m=!!a.invert,f=a.measureAxes||[{ref:"measureAxis",name:"minor"}],p={chart:{orientation:void 0,size:void 0,mode:void 0},major:{orientation:void 0,dock:void 0,opposite:void 0,size:void 0}},h={type:"major-minor",config:Pa({},i),meta:p,update:function(e){p.chart.orientation=n.getLayoutValue("orientation",d),p.chart.size={width:e.width,height:e.height},p.chart.mode=Rl(e),p.major.orientation=function(e){var t=e.chartOrientation,n=e.invert;return e.layoutService.meta.isContinuous?$l:n?t===_l?$l:_l:t}({layoutService:n,chartOrientation:p.chart.orientation,invert:m});var t=Fl({orientation:p.major.orientation,dock:n.getLayoutValue("dimensionAxis.dock"),btt:!1,rtl:c}),r=t.current,i=t.opposite;p.major.dock=r,p.major.opposite=i,p.major.size=p.major.orientation===_l?e.height:e.width,f.forEach((function(t){var r={};r.orientation=p.major.orientation===_l?$l:_l;var i=Fl({orientation:r.orientation,dock:n.getLayoutValue("".concat(t.ref,".dock")),btt:!0,rtl:c}),o=i.current,a=i.opposite,s=i.start,l=i.end;r.dock=o,r.opposite=a,r.start=s,r.end=l,r.size=r.orientation===_l?e.height:e.width,p[t.name]=r}))}};return h.update(Ll({chart:t,logicalSize:l})),h}function jl(e){var t=e.chart,n=e.layoutService,r=e.config,i=void 0===r?{}:r,o=e.typeConfig,a=void 0===o?{}:o;return("x-y"===a.type?zl:Hl)({chart:t,layoutService:n,config:i,typeConfig:a})}function Vl(e,t,n){if(void 0===e||void 0===t)return n;for(var r=t.split("."),i=e,o=0;o<r.length;++o){var a=r[o];if(void 0===i[a])return n;i=i[a]}return i}var Bl=["__proto__","constructor"];function Ul(e,t,n){if(void 0!==e&&void 0!==t){var r=t.split("."),i=r[r.length-1];if(!Bl.some((function(e){return r.includes(e)}))){for(var o=e,a=0;a<r.length-1;++a){var s=r[a];void 0===o[s]&&(o[s]=Number.isNaN(+r[a+1])?{}:[]),o=o[s]}void 0!==n?o[i]=n:delete o[i]}}}function Yl(){var e={};return{get:function(t){return e[t]},set:function(t,n){return e[t]=n,n},has:function(t){return t in e},remove:function(t){delete e[t]},empty:function(){e={}}}}function Wl(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50;return function(){for(var r=this,i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];clearTimeout(t),t=setTimeout((function(){return e.apply(r,o)}),n)}}function Gl(e){var t,n,r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50,o=0;return function(){t=this;for(var a=arguments.length,s=new Array(a),l=0;l<a;l++)s[l]=arguments[l];n=s;var u=Date.now()-o,c=function(){o=Date.now(),r=0,e.apply(t,n)};r||(u>=i?c():r=setTimeout(c,i-u))}}var Xl={ERROR_CODES:[7005],DIMENSION:"qDimensionInfo",MEASURE:"qMeasureInfo"},Kl=function(e,t){return e[t].reduce((function(e,t,n){var r;return r=t,Xl.ERROR_CODES.some((function(e){var t;return e===(null===(t=r.qError)||void 0===t?void 0:t.qErrorCode)}))?e.filtered.push(n):e.reduced.push(t),e}),{reduced:[],filtered:[]})};function Jl(e){var t;return((null==e||null===(t=e.qHyperCube)||void 0===t?void 0:t.qDimensionInfo)||[]).map((function(e){var t,n=null===(t=e.qCardinalities)||void 0===t?void 0:t.qHypercubeCardinal;if(n)return n;var r=e.qStateCounts||{},i=r.qLocked,o=void 0===i?0:i,a=r.qOption,s=void 0===a?0:a,l=r.qSelected;return o+s+(void 0===l?0:l)}))}function Zl(e){switch(e.qHyperCube.qMode){case"S":return function(e){var t=e.qHyperCube.qSize;return{refs:{dataPages:"qHyperCube.qDataPages"},size:{x:t.qcx,y:t.qcy,dimensions:Jl(e)}}}(e);case"K":return function(e){var t=Jl(e);return{refs:{dataPages:"qHyperCube.qStackedDataPages"},size:{x:e.qHyperCube.qSize.qcx,y:t[0],dimensions:t}}}(e);case"T":return function(e){var t=Jl(e);return{refs:{dataPages:"qHyperCube.qTreeDataPages"},size:{x:e.qHyperCube.qSize.qcx,y:t[0],dimensions:t}}}(e);default:throw new Error("Mode not supported")}}function Ql(e){var t=e.originalArray,n=e.newArray,r=e.matchKey;return Array.isArray(t)&&t.length?(n.forEach((function(e){var n=-1;t.some((function(t,i){return t[r]&&t[r]===e[r]&&(n=i),n})),n>-1?t[n]=e:t.push(e)})),t):n}function eu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function tu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?eu(Object(n),!0).forEach((function(t){nu(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eu(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function nu(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ru=Object.prototype.hasOwnProperty,iu=Object.prototype.toString,ou=Object.defineProperty,au=Object.getOwnPropertyDescriptor,su=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===iu.call(e)},lu=function(e){if(!e||"[object Object]"!==iu.call(e))return!1;var t,n=ru.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&ru.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||ru.call(e,t)},uu=function(e,t){ou&&"__proto__"===t.name?ou(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},cu=function(e,t){if("__proto__"===t){if(!ru.call(e,t))return;if(au)return au(e,t).value}return e[t]},du=function e(){var t,n,r,i,o,a,s=arguments[0],l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l<u;++l)if(null!=(t=arguments[l]))for(n in t)r=cu(s,n),s!==(i=cu(t,n))&&(c&&i&&(lu(i)||(o=su(i)))?(o?(o=!1,a=r&&su(r)?r:[]):a=r&&lu(r)?r:{},uu(s,{name:n,newValue:e(c,a,i)})):void 0!==i&&uu(s,{name:n,newValue:i}));return s};function mu(e,t,n,r){if(!e)return-1;const i=n.cache,o=e.origin?e.origin():null;o&&(e=o);let a=i.fields.indexOf(e),s=-1,l=-1;if(-1===a)for(let t=0;t<i.wrappedFields.length;t++)if(l=i.wrappedFields[t].attrDims.map((e=>e.instance)).indexOf(e),s=i.wrappedFields[t].attrExps.map((e=>e.instance)).indexOf(e),-1!==l||-1!==s){a=t;break}if(Array.isArray(r)&&r.some(((e,t)=>e!==t))){const e=r.indexOf(a);-1!==e&&(a=e)}return a-=t.qArea.qLeft,a<0||a>=t.qArea.qWidth?-1:l>=0?e=>e[a].qAttrDims.qValues[l]:s>=0?e=>e[a].qAttrExps.qValues[s]:e=>e[a]}function fu(e,t,n){let{key:r}=n;const i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:r,field:e.field.key()}),i}function pu(e){let{cache:t,f:n,mainCell:r,p:i,prop:o,page:a,rowIdx:s,row:l,sourceKey:u,target:c,targetProp:d,columnOrder:m}=e,f=r;if(i.field&&i.field!==n){const e=mu(i.field,a,{cache:t},m);if(-1===e)return;f=du({qRow:s},e(l))}c[d]=fu(i,f,{key:u})}function hu(e,t,n,r){const i=Array.isArray(e)?e:[e];let o=[];for(let e=0;e<i.length;e++)if(void 0!==i[e].field){const a=t.raw(),s=t.key(),l="object"==typeof i[e].field?i[e].field:t.field(i[e].field),{props:u,main:c}=r.normalizeConfig(i[e],t),d=Object.keys(u),m=!!i[e].trackBy,f=typeof i[e].trackBy,p={},h=[],y=[];for(let t=0;t<a.qDataPages.length;t++){const o=mu(l,a.qDataPages[t],{cache:n},a.qColumnOrder);if(-1!==o)for(let g=0;g<a.qDataPages[t].qMatrix.length;g++){const v=a.qDataPages[t].qArea.qTop+g,b=du({qRow:v},o(a.qDataPages[t].qMatrix[g])),x=fu(c,b,{key:s});if(!c.filter||c.filter(b)){for(let e=0;e<d.length;e++){const r=u[d[e]];let i=r.fields||[r];r.fields&&(x[d[e]]=[]);for(let o=0;o<i.length;o++)pu({cache:n,f:l,mainCell:b,p:i[o],prop:d[e],props:u,page:a.qDataPages[t],rowIdx:v,row:a.qDataPages[t].qMatrix[g],sourceKey:s,target:r.fields?x[d[e]]:x,targetProp:r.fields?o:d[e],columnOrder:a.qColumnOrder});if(r.fields){const t=x[d[e]].map((e=>e.value)),n=x[d[e]].map((e=>e.label));x[d[e]]={value:"function"==typeof r.value?r.value(t):void 0!==r.value?r.value:t,label:"function"==typeof r.label?r.label(n):void 0!==r.label?String(r.label):String(x[d[e]].value)}}}m&&r.track({cfg:i[e],itemData:b,obj:x,target:h,tracker:p,trackType:f}),y.push(x)}}}const g=m?r.collect(h,{main:c,propsArr:d,props:u}):y;o=[...o,...g]}return o}function yu(e){var t=0,n=e.children,r=n&&n.length;if(r)for(;--r>=0;)t+=n[r].value;else t=1;e.value=t}function gu(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=bu)):void 0===t&&(t=vu);for(var n,r,i,o,a,s=new Mu(e),l=[s];n=l.pop();)if((i=t(n.data))&&(a=(i=Array.from(i)).length))for(n.children=i,o=a-1;o>=0;--o)l.push(r=i[o]=new Mu(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(Su)}function vu(e){return e.children}function bu(e){return Array.isArray(e)?e[1]:null}function xu(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function Su(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function Mu(e){this.data=e,this.depth=this.height=0,this.parent=null}function Eu(e){return null==e?null:function(e){if("function"!=typeof e)throw new Error;return e}(e)}Mu.prototype=gu.prototype={constructor:Mu,count:function(){return this.eachAfter(yu)},each:function(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this},eachAfter:function(e,t){for(var n,r,i,o=this,a=[o],s=[],l=-1;o=a.pop();)if(s.push(o),n=o.children)for(r=0,i=n.length;r<i;++r)a.push(n[r]);for(;o=s.pop();)e.call(t,o,++l,this);return this},eachBefore:function(e,t){for(var n,r,i=this,o=[i],a=-1;i=o.pop();)if(e.call(t,i,++a,this),n=i.children)for(r=n.length-1;r>=0;--r)o.push(n[r]);return this},find:function(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r},sum:function(e){return this.eachAfter((function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].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(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r},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 gu(this).eachBefore(xu)},[Symbol.iterator]:function*(){var e,t,n,r,i=this,o=[i];do{for(e=o.reverse(),o=[];i=e.pop();)if(yield i,t=i.children)for(n=0,r=t.length;n<r;++n)o.push(t[n])}while(o.length)}};var Cu={depth:-1},qu={},Au={};function Ou(e){return e.id}function Du(e){return e.parentId}function Iu(e){let t=e.length;if(t<2)return"";for(;--t>1&&!wu(e,t););return e.slice(0,t)}function wu(e,t){if("/"===e[t]){let n=0;for(;t>0&&"\\"===e[--t];)++n;if(0==(1&n))return!0}return!1}function Tu(e,t){"/"===e.charAt(0)&&(e=e.substring(1));const n=e.split("/");let r,i=t;for(let e=0;e<n.length;e++){if("*"===n[e]&&Array.isArray(i)){const t=[];r=n.slice(e+1).join("/");for(let e=0;e<i.length;e++){let n=Tu(r,i[e]);Array.isArray(n)?t.push(...n):t.push(n)}return t}if(!n[e]&&Array.isArray(i)){const t=new Array(i.length);r=n.slice(e+1).join("/");for(let e=0;e<i.length;e++)t[e]=Tu(r,i[e]);return t}n[e]in i&&(i=i[n[e]])}return i}function Nu(e,t,n){let r=[];if(!e||!e.length)return r;if(t<=0){const t=n>=0?[e[n]]:e;r=[...r,...t]}else for(let i=0;i<e.length;i++)e[i].children&&e[i].children.length&&(r=[...r,...Nu(e[i].children,t-1,n)]);return r}function Lu(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 r=Math.max(0,Math.min(100,t-e));return e=>Nu(e.children,r-1,n)}return!1}const ku=/^qDimensionInfo(?:\/(\d+))?/,Ru=/^\/?qMeasureInfo\/(\d+)/,Pu=/\/qAttrExprInfo\/(\d+)/,Fu=/\/qAttrDimInfo\/(\d+)/;function zu(e){return(e.qColumnOrder&&e.qColumnOrder.length?e.qColumnOrder:e.qDimensionInfo.map(((e,t)=>t))).filter((t=>t<e.qDimensionInfo.length))}function _u(e,t){let{cube:n}=t;if(!e)return-1;let r=e.origin&&e.origin()?e.origin().key():e.key(),i=!1,o=-1,a=-1,s=-1,l=-1,u=-1,c=-1,d=r;const m=n.qEffectiveInterColumnSortOrder,f=zu(n);return ku.test(d)&&(i=!0,o=+ku.exec(d)[1],d=r.replace(ku,"")),Ru.test(d)&&("K"===n.qMode?u=+Ru.exec(d)[1]:m&&-1!==m.indexOf(-1)?(u=+Ru.exec(d)[1],c=0):c=+Ru.exec(d)[1],d=d.replace(Ru,"")),d&&(Fu.exec(d)?s=+Fu.exec(d)[1]:Pu.exec(d)&&(a=+Pu.exec(d)[1])),l=i?"S"===n.qMode?f[o]:m?m.indexOf(o):o:m&&-1!==m.indexOf(-1)?m.indexOf(-1):n.qDimensionInfo.length-("K"===n.qMode?0:1),{fieldDepth:l+1,pseudoMeasureIndex:u,measureIdx:c,attrDimIdx:s,attrIdx:a}}function $u(e,t){let n,r,i=Lu(e.fieldDepth,t.fieldDepth,t.pseudoMeasureIndex);return n=t.measureIdx>=0?e=>e.data.qValues[t.measureIdx]:e=>e.data,t.attrDimIdx>=0?r=e=>{var n;return null==e||null===(n=e.qAttrDims)||void 0===n?void 0:n.qValues[t.attrDimIdx]}:t.attrIdx>=0&&(r=e=>{var n;return null==e||null===(n=e.qAttrExps)||void 0===n?void 0:n.qValues[t.attrIdx]}),{nodeFn:i,attrFn:r,valueFn:n}}function Hu(e,t,n){let{key:r}=n;const i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:r,field:e.field.key()}),i}function ju(e){let{propsArr:t,props:n,item:r,itemData:i,ret:o,sourceKey:a}=e;for(let e=0;e<t.length;e++){const s=n[t[e]],l=s.fields||[s];let u,c;s.fields&&(u=[],c=[]);for(let n=0;n<l.length;n++){const d=l[n];let m,f,p,h,y,g;if("primitive"===d.type?(p=d.value,g=String(d.value)):("function"==typeof d.value&&(m=e=>d.value(e,r)),"function"==typeof d.label&&(f=e=>d.label(e,r)),d.accessor?(h=d.accessor(r),Array.isArray(h)?(y=h.map(d.valueAccessor),d.attrAccessor&&(y=y.map(d.attrAccessor)),m&&(p=y.map(m),m=null),f&&(g=y.map(f),f=null),p=d.reduce?d.reduce(p):p,g=d.reduceLabel?d.reduceLabel(g,p):String(p)):(p=d.attrAccessor?d.attrAccessor(d.valueAccessor(h)):d.valueAccessor(h),g=p)):(p=i,g=i)),s.fields){const e=m?m(p):p;u.push(e),c.push(f&&null!=g?f(g):null!=g?g:String(e))}else{const n=m?m(p):p;o[t[e]]={value:n,label:f?f(g):null!=g?g:String(n)},d.field&&(o[t[e]].source={field:d.field.key(),key:a})}}u&&(o[t[e]]={value:"function"==typeof s.value?s.value(u,r):u,label:"function"==typeof s.label?s.label(c,r):c})}}const Vu=(e,t,n)=>{const r="K"===e.qMode?"/qStackedDataPages/*/qData":"/qTreeDataPages/*",i="K"===e.qMode?"qSubNodes":"qNodes",o=Tu(r,e);return o&&o[0]?(t.tree=gu(o[0],n.children||(e=>e[i])),t.tree):null};function Bu(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),r=e.fields(),i=e.fields().filter((e=>"dimension"===e.type())).map((e=>n.indexOf(r.indexOf(e)))),o=e.fields().filter((e=>"measure"===e.type())).map((e=>n.indexOf(r.indexOf(e)))),a={__root:{__id:"__root",qValues:[]}};for(let e=0;e<t.length;e++){const n=t[e];let r="__root",l=!1;for(let e=0;e<i.length;e++){var s;const t=n[i[e]],o="".concat(r,"__").concat(null!==(s=t.qElemNumber)&&void 0!==s?s:t.qElemNo);a[o]||(a[o]=tu({__id:o,__parent:r,qValues:[]},t),l=!0),r=o}if(l)for(let e=0;e<o.length;e++){const t=n[o[e]];a[r].qValues.push(t)}}const l=Object.keys(a).map((e=>a[e]));return function(){var e,t=Ou,n=Du;function r(r){var i,o,a,s,l,u,c,d,m=Array.from(r),f=t,p=n,h=new Map;if(null!=e){const t=m.map(((t,n)=>function(e){let t=(e=`${e}`).length;return wu(e,t-1)&&!wu(e,t-2)&&(e=e.slice(0,-1)),"/"===e[0]?e:`/${e}`}(e(t,n,r)))),n=t.map(Iu),i=new Set(t).add("");for(const e of n)i.has(e)||(i.add(e),t.push(e),n.push(Iu(e)),m.push(Au));f=(e,n)=>t[n],p=(e,t)=>n[t]}for(a=0,i=m.length;a<i;++a)o=m[a],u=m[a]=new Mu(o),null!=(c=f(o,a,r))&&(c+="")&&(d=u.id=c,h.set(d,h.has(d)?qu:u)),null!=(c=p(o,a,r))&&(c+="")&&(u.parent=c);for(a=0;a<i;++a)if(c=(u=m[a]).parent){if(!(l=h.get(c)))throw new Error("missing: "+c);if(l===qu)throw new Error("ambiguous: "+c);l.children?l.children.push(u):l.children=[u],u.parent=l}else{if(s)throw new Error("multiple roots");s=u}if(!s)throw new Error("no root");if(null!=e){for(;s.data===Au&&1===s.children.length;)s=s.children[0],--i;for(let e=m.length-1;e>=0&&(u=m[e]).data===Au;--e)u.data=null}if(s.parent=Cu,s.eachBefore((function(e){e.depth=e.parent.depth+1,--i})).eachBefore(Su),s.parent=null,i>0)throw new Error("cycle");return s}return r.id=function(e){return arguments.length?(t=Eu(e),r):t},r.parentId=function(e){return arguments.length?(n=Eu(e),r):n},r.path=function(t){return arguments.length?(e=Eu(t),r):e},r}().id((e=>e.__id)).parentId((e=>e.__parent))(l)}const Uu=e=>{let{propsArr:t,props:n,cube:r,cache:i,itemDepthObject:o,f:a}=e;for(let e=0;e<t.length;e++){const s=n[t[e]],l=s.fields?s.fields:[s];for(let e=0;e<l.length;e++){const t=l[e];if(t.field!==a){const e=$u(o,_u(t.field,{cube:r,cache:i}));t.accessor=e.nodeFn,t.valueAccessor=e.valueFn,t.attrAccessor=e.attrFn}}}};function Yu(){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,r=arguments.length>3?arguments[3]:void 0;const i=t.raw(),o=t.key(),a="S"===i.qMode?Bu(t):Vu(i,n,e);if(!a)return null;const s=a.height,l=[];for(let o=0;o<=s;o++){let a=null;if(o>0)if("S"===i.qMode){let e=zu(i)[o-1];a=n.fields[e]}else{let e=i.qEffectiveInterColumnSortOrder[o-1];o>i.qEffectiveInterColumnSortOrder.length&&(e=i.qDimensionInfo.length),a=n.fields[e]}const{props:s,main:u}=r.normalizeConfig(tu(tu({},e),{},{field:a?a.key():void 0}),t),c=Object.keys(s);l[o]={propsArr:c,props:s,main:u};const d=a?_u(a,{cube:i,cache:n}):{fieldDepth:0};Uu({propsArr:c,props:s,cube:i,cache:n,itemDepthObject:d,f:a})}const u=a.copy().descendants(),c=a.descendants();for(let e=0;e<c.length;e++){const t=l[c[e].depth].propsArr,n=l[c[e].depth].props,r=l[c[e].depth].main,i=u[e],a=i.data,s=Hu(r,a,{key:o});ju({propsArr:t,props:n,item:i,itemData:a,ret:s,sourceKey:o,isTree:!0}),c[e].data=s}return a}function Wu(e,t,n,r){const i=Array.isArray(e)?e:[e];let o=[];for(let a=0;a<i.length;a++)if(void 0!==i[a].field){const s=t.raw(),l=t.key();if(!Vu(s,n,e))continue;const u="object"==typeof i[a].field?i[a].field:t.field(i[a].field),{props:c,main:d}=r.normalizeConfig(i[a],t),m=Object.keys(c),f=_u(u,{cube:s,cache:n}),{nodeFn:p,attrFn:h,valueFn:y}=$u({fieldDepth:0},f);Uu({propsArr:m,props:c,cube:s,cache:n,itemDepthObject:f,f:u});const g=!!i[a].trackBy,v=typeof i[a].trackBy,b={},x=[],S=p(n.tree),M=[];for(let e=0;e<S.length;e++){const t=S[e],n=h?h(y(t)):y(t);if(d.filter&&!d.filter(n))continue;const o=Hu(d,n,{key:l});ju({propsArr:m,props:c,item:t,itemData:n,ret:o,sourceKey:l}),g&&r.track({cfg:i[a],itemData:n,obj:o,target:x,tracker:b,trackType:v}),M.push(o)}const E=g?r.collect(x,{main:d,propsArr:m,props:c}):M;o=[...o,...E]}return o}var Gu,Xu,Ku=(Gu=function(e){
7
+ import{useElement as e,useState as t,useEffect as n,useRect as r,usePromise as i,useStaleLayout as o,useModel as a,useApp as s,useAppLayout as l,usePlugins as u,useEmbed as c,useOptions as d,useTranslator as m,useTheme as f,useDeviceType as p,useConstraints as h,useLayout as g,useAction as y,useSelections as v,onTakeSnapshot as b,useImperativeHandle as x}from"@nebula.js/stardust";import M from"hammerjs";import S from"picasso.js";import E from"picasso-plugin-q";import C from"picasso-plugin-hammer";import q from"react";import{styled as w,ListItem as A,Button as O,Popover as D,List as N,ListItemIcon as I,ListItemText as T}from"@material-ui/core";import L from"react-dom";import{createGenerateClassName as k,StylesProvider as R,ThemeProvider as P}from"@material-ui/styles";var $={properties_dataPoints_labelmode_share:{id:"properties.dataPoints.labelmode.share",locale:{"en-US":"Share","zh-TW":"佔有率","zh-CN":"份额","tr-TR":"Pay","sv-SE":"Andel","it-IT":"Percentuale","es-ES":"Cuota","de-DE":"Anteil","pl-PL":"Udział","nl-NL":"Aandeel","ko-KR":"공유","pt-BR":"Percentual","fr-FR":"Part","ja-JP":"割合","ru-RU":"Доля"}},Tooltip_selections_locked:{id:"Tooltip.selections.locked",locale:{"en-US":"Selections on this dimension are locked","zh-TW":"已鎖定此維度上的選項","zh-CN":"相关维度的选择已锁定","tr-TR":"Bu boyuttaki seçimler kilitli","sv-SE":"Urval i den här dimensionen är låsta","it-IT":"Le selezioni in questa dimensione sono bloccate","es-ES":"Las selecciones de esta dimensión están bloqueadas.","de-DE":"Auswahlen sind für diese Dimension gesperrt","pl-PL":"Selekcje dotyczące tego wymiaru są zablokowane","nl-NL":"Selecties voor deze dimensie zijn vergrendeld","ko-KR":"이 차원의 선택은 잠겨 있습니다.","pt-BR":"Seleções estão bloqueadas nesta dimensão","fr-FR":"Sélections verrouillées pour cette dimension","ja-JP":"この軸での選択はロックされています","ru-RU":"Выборки для данного измерения заблокированы"}},Tooltip_dimensions_drilldown:{id:"Tooltip.dimensions.drilldown",locale:{"en-US":"Drill-down dimension","zh-TW":"向下探查維度","zh-CN":"下钻维度","tr-TR":"Detaya inme boyutu","sv-SE":"Hierarkisk dimension","it-IT":"Dimensione di drill-down","es-ES":"Dimensión jerárquica","de-DE":"Drilldown-Dimension:","pl-PL":"Wymiar hierarchiczny","nl-NL":"Drill-downdimensie","ko-KR":"드릴다운 차원","pt-BR":"Dimensão da hierarquia","fr-FR":"Descendre dans la hiérarchie de la dimension","ja-JP":"軸のドリルダウン","ru-RU":"Измерение с детализацией"}},Object_ErrorMessage_MissingDimension:{id:"Object.ErrorMessage.MissingDimension",locale:{"en-US":"Dimension not found","zh-TW":"找不到維度","zh-CN":"未找到维度","tr-TR":"Boyut bulunamadı","sv-SE":"Dimensionen hittades inte","it-IT":"Dimensione non trovata","es-ES":"No se ha encontrado la dimensión","de-DE":"Dimension nicht gefunden","pl-PL":"Wymiar nie został znaleziony","nl-NL":"Dimensie niet gevonden","ko-KR":"차원을 찾지 못했습니다.","pt-BR":"Dimensão não encontrada","fr-FR":"Dimension introuvable","ja-JP":"軸が見つかりません","ru-RU":"Измерение не найдено"}},Object_ErrorMessage_MissingMeasure:{id:"Object.ErrorMessage.MissingMeasure",locale:{"en-US":"Measure not found","zh-TW":"找不到量值","zh-CN":"未找到度量","tr-TR":"Hesaplama bulunamadı","sv-SE":"Måttet hittades inte","it-IT":"Misura non trovata","es-ES":"No se ha encontrado la medida","de-DE":"Kennzahl nicht gefunden","pl-PL":"Miara nie została znaleziona","nl-NL":"Meting niet gevonden","ko-KR":"측정값을 찾지 못했습니다.","pt-BR":"Medida não encontrada","fr-FR":"Mesure introuvable","ja-JP":"メジャーが見つかりません","ru-RU":"Мера не найдена"}},Object_Disclaimer_LimitedData:{id:"Object.Disclaimer.LimitedData",locale:{"en-US":"Currently showing a limited data set.","zh-TW":"目前顯示的是有限的資料集。","zh-CN":"当前正显示有限的数据集。","tr-TR":"Şu anda sınırlı bir veri kümesi gösteriliyor.","sv-SE":"Just nu visas en begränsad uppsättning data.","it-IT":"Attualmente viene visualizzata una serie di dati limitata.","es-ES":"Mostrando actualmente un conjunto limitado de datos.","de-DE":"Zurzeit wird nur ein beschränkter Datensatz angezeigt.","pl-PL":"Aktualnie przedstawiany jest ograniczony zestaw danych.","nl-NL":"Momenteel wordt een beperkte gegevensverzameling getoond.","ko-KR":"현재 제한된 데이터 집합을 표시하고 있습니다.","pt-BR":"Mostrando um conjunto de dados limitado.","fr-FR":"Affichage d'un ensemble de données limité pour l'instant.","ja-JP":"現在、限定的なデータ セットを表示しています。","ru-RU":"В настоящее время отображается ограниченный набор данных."}},Object_Disclaimer_OnlyNegativeOrZeroValues:{id:"Object.Disclaimer.OnlyNegativeOrZeroValues",locale:{"en-US":"The chart is not displayed because it contains only negative or zero values.","zh-TW":"系統不會顯示圖表,因為該圖表僅包含負值或零值。","zh-CN":"未显示图表,因为它仅包含负值或零值。","tr-TR":"Yalnızca negatif veya sıfır değerlerini içermesi nedeniyle grafik görüntülenmiyor.","sv-SE":"Diagrammet visas inte eftersom det enbart innehåller negativa eller nollvärden","it-IT":"Il grafico non viene visualizzato poiché contiene solo valori negativi o uguali a zero.","es-ES":"El gráfico no se muestra porque sólo contiene valores negativos o valores cero.","de-DE":"Das Diagramm wird nicht angezeigt, da es nur negative oder 0-Werte enthält.","pl-PL":"Wykres nie jest wyświetlany, ponieważ zawiera wartości ujemne lub zerowe.","nl-NL":"De grafiek wordt niet weergegeven omdat het alleen negatieve waarden of nulwaarden bevat.","ko-KR":"음수 또는 zero 값만 포함되어 있으므로 차트가 표시되지 않습니다.","pt-BR":"O gráfico não foi exibido, porque contém apenas valores negativos ou zero.","fr-FR":"Le graphique n'est pas affiché, car il contient uniquement des valeurs négatives ou égales à zéro.","ja-JP":"チャートは負の値またはゼロ値しか含まれていないため、表示されていません。","ru-RU":"Диаграмма не отображается, поскольку она содержит только отрицательные или нулевые значения."}},Object_Disclaimer_NegativeOrZeroValues:{id:"Object.Disclaimer.NegativeOrZeroValues",locale:{"en-US":"The data set contains negative or zero values that cannot be shown in this chart.","zh-TW":"資料集包含無法在此圖表中顯示的負值或零值。","zh-CN":"数据集中包含无法在此图表中显示的负值或零值。","tr-TR":"Veri kümesi, bu grafikte gösterilemeyen negatif veya sıfır değerlerini içeriyor.","sv-SE":"Datauppsättningen innehåller negativa värden eller nollvärden som inte kan visas i detta diagram.","it-IT":"La serie di dati contiene valori negativi o uguali a zero che non possono essere visualizzati in questo grafico.","es-ES":"El conjunto de datos contiene valores negativos o cero que no se pueden mostrar en este gráfico.","de-DE":"Die in den Datensätzen enthaltenen negativen oder 0-Werte können nicht in diesem Diagramm dargestellt werden.","pl-PL":"Zestaw danych zawiera wartości ujemne lub zerowe, których nie można przedstawić w tym wykresie.","nl-NL":"De gegevensverzameling bevat negatieve waarden of nulwaarden die niet kunnen worden weergegeven in deze grafiek.","ko-KR":"데이터 집합에 해당 차트에 표시할 수 없는 음수 값 또는 zero 값이 포함되어 있습니다.","pt-BR":"O conjunto de dados contém valores negativos ou iguais a zero que não podem ser mostrados neste gráfico.","fr-FR":"L'ensemble de données contient des valeurs négatives ou égales à zéro impossibles à afficher dans ce graphique.","ja-JP":"データ セットには、本チャートに表示できない負の値またはゼロ値が含まれています。","ru-RU":"Набор данных содержит отрицательные или нулевые значения, которые невозможно показать в этой диаграмме."}},Object_Disclaimer_DataRangeIncludingZero:{id:"Object.Disclaimer.DataRangeIncludingZero",locale:{"en-US":"The logarithmic scale has been replaced by a linear scale because the data range includes zero.","zh-TW":"對數刻度已遭線性刻度取代,因為資料範圍包含零。","zh-CN":"对数刻度已替换为线性刻度,因为该数据范围包括零。","tr-TR":"Veri aralığı sıfır değerini içerdiğinden, logaritmik ölçek yerine doğrusal ölçek kullanıldı.","sv-SE":"Den logaritmiska skalan har ersatts av en linjär skala eftersom dataintervallet innehåller värdet noll.","it-IT":"La scala logaritmica è stata sostituita da una scala lineare perché l'intervallo di dati include zero.","es-ES":"La escala logarítmica ha sido reemplazada por una escala lineal porque el rango de datos incluye cero.","de-DE":"Die logarithmische Skala wurde durch die lineare Skala ersetzt, weil der Datenbereich NULL enthält.","pl-PL":"Skala logarytmiczna została zastąpiona liniową, ponieważ zakres danych zawiera zero.","nl-NL":"De logaritmische schaal is vervangen door een lineaire schaal omdat het gegevensbereik nullen bevat.","ko-KR":"데이터 범위에 0이 포함되어 있으므로 로그 눈금이 선형 눈금으로 바뀌었습니다.","pt-BR":"A escala logarítmica foi substituída por uma escala linear, pois o intervalo de dados inclui zero.","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.","ja-JP":"データ範囲にゼロが含まれるため、Log スケールは Linear スケールで置換されています。","ru-RU":"Логарифмический масштаб заменен линейным масштабом, поскольку диапазон данных включает ноль."}},Object_Disclaimer_NoDataExist:{id:"Object.Disclaimer.NoDataExist",locale:{"en-US":"The selections generated no data for this chart.","zh-TW":"此選項無法產生任何適用於此圖表的資料。","zh-CN":"选择未生成此图表的数据。","tr-TR":"Seçimler bu grafik için hiç veri oluşturmadı.","sv-SE":"Urvalen genererade inga data för detta diagram.","it-IT":"Le selezioni non hanno generato dati per questo grafico.","es-ES":"Las selecciones no han generado datos para este gráfico.","de-DE":"Die Auswahlen haben für dieses Diagramm keine Daten generiert.","pl-PL":"Selekcje nie spowodowały wygenerowania danych dla tego wykresu.","nl-NL":"De selecties hebben geen gegevens voor de grafiek gegenereerd.","ko-KR":"선택 내용으로 해당 차트에 대한 데이터가 생성되지 않았습니다.","pt-BR":"As seleções não geraram dados para este gráfico.","fr-FR":"Les sélections n'ont pas généré de données pour ce graphique.","ja-JP":"このチャートには選択からデータが生成されませんでした。","ru-RU":"В результате выборок данные для этой диаграммы не созданы."}},Object_Disclaimer_OnlyNanData:{id:"Object.Disclaimer.OnlyNanData",locale:{"en-US":"The chart is not displayed because it contains only undefined values.","zh-TW":"系統不會顯示圖表,因為該圖表僅包含未定義的值。","zh-CN":"未显示图表,因为它仅包含未定义的值。","tr-TR":"Yalnızca tanımsız değerleri içermesi nedeniyle grafik görüntülenmiyor.","sv-SE":"Diagrammet visas inte eftersom det enbart innehåller odefinierade värden.","it-IT":"Il grafico non è visualizzato poiché contiene solo valori non definiti.","es-ES":"El gráfico no se muestra porque solo contiene valores indefinidos.","de-DE":"Das Diagramm wird nicht angezeigt, da es nur nicht definierte Werte enthält.","pl-PL":"Wykres nie jest wyświetlany, ponieważ zawiera wartości niezdefiniowane.","nl-NL":"De grafiek wordt niet weergegeven omdat deze alleen ongedefinieerde waarden bevat.","ko-KR":"정의되지 않은 값만 포함되어 있으므로 차트가 표시되지 않습니다.","pt-BR":"O gráfico não foi exibido, porque contém apenas valores não definidos.","fr-FR":"Le graphique n'est pas affiché, car il contient uniquement des valeurs non définies.","ja-JP":"未定義の値しか含まれていないため、チャートは表示されていません。","ru-RU":"Диаграмма не отображается, поскольку она содержит только неопределенные значения."}},Object_ChartTooltip_NMore:{id:"Object.ChartTooltip.NMore",locale:{"en-US":"+{0} more","zh-TW":"再加 {0} 個","zh-CN":"+{0} 个","tr-TR":"+{0} öğe daha","sv-SE":"+{0} till","it-IT":"Altre +{0}","es-ES":"+{0} más","de-DE":"+{0} mehr","pl-PL":"+ {0} więcej","nl-NL":"+ {0} meer","ko-KR":"+추가 {0}개","pt-BR":"+{0} mais","fr-FR":"+ {0} de plus","ja-JP":"さらに {0}","ru-RU":"+ дополнительно: {0}"}},Object_ChartTooltip_sumOfPositives:{id:"Object.ChartTooltip.sumOfPositives",locale:{"en-US":"Sum of positives","zh-TW":"正數總和","zh-CN":"正值总和","tr-TR":"Pozitif değerlerin toplamı","sv-SE":"Summan av positiva","it-IT":"Somma valori positivi","es-ES":"Suma de positivos","de-DE":"Summe positiver Werte","pl-PL":"Suma dodatnich","nl-NL":"Som positieven","ko-KR":"양수 합계","pt-BR":"Soma de positivos","fr-FR":"Sommes des valeurs positives","ja-JP":"正の合計","ru-RU":"Сумма положительных значений"}},Object_ChartTooltip_sumOfNegatives:{id:"Object.ChartTooltip.sumOfNegatives",locale:{"en-US":"Sum of negatives","zh-TW":"負數總和","zh-CN":"负值总和","tr-TR":"Negatif değerlerin toplamı","sv-SE":"Summan av negativa","it-IT":"Somma valori negativi","es-ES":"Suma de negativos","de-DE":"Summe negativer Werte","pl-PL":"Suma ujemnych","nl-NL":"Som negatieven","ko-KR":"음수 합계","pt-BR":"Soma de negativos","fr-FR":"Somme des valeurs négatives","ja-JP":"負の合計","ru-RU":"Сумма отрицательных значений"}},Object_ChartTooltip_ColorExpression:{id:"Object.ChartTooltip.ColorExpression",locale:{"en-US":"Color expression","zh-TW":"色彩運算式","zh-CN":"颜色表达式","tr-TR":"Renk ifadesi","sv-SE":"Färguttryck","it-IT":"Espressione colore","es-ES":"Expresión de color","de-DE":"Farbformel","pl-PL":"Wyrażenie koloru","nl-NL":"Kleuruitdrukking","ko-KR":"색상 표현식","pt-BR":"Expressão de cor","fr-FR":"Expression de couleur","ja-JP":"カラー表現","ru-RU":"Выражение для цвета"}},Object_Disclaimer_OnlyNanColor:{id:"Object.Disclaimer.OnlyNanColor",locale:{"en-US":"The data used to color this visualization only contains undefined values.","zh-TW":"用以定義此視覺化的色彩的資料只包含未定義的值。","zh-CN":"用于将该可视化着色的数据仅包含未定义的值。","tr-TR":"Bu görselleştirmeyi renklendirmek için kullanılan veriler yalnızca tanımlanmamış değerler içeriyor.","sv-SE":"Data som används för att färgsätta denna visualisering innehåller enbart odefinierade värden.","it-IT":"I dati utilizzati per colorare questa visualizzazione contengono solo valori non definiti.","es-ES":"Los datos utilizados para colorear esta visualización solo contienen valores indefinidos.","de-DE":"Die verwendeten Daten für die Farbgebung dieser Visualisierung enthalten undefinierte Werte.","pl-PL":"Dane używane do kolorowania tej wizualizacji zawierają wyłącznie niezdefiniowane wartości.","nl-NL":"De gegevens die worden gebruikt om deze visualisatie kleur te geven bevatten uitsluitend ongedefinieerde waarden.","ko-KR":"이 시각화에 색을 지정하는 데 사용된 데이터에는 정의되지 않은 값만 포함되어 있습니다.","pt-BR":"Os dados usados para colorir esse visualização contém somente valores indefinidos.","fr-FR":"Les données utilisées pour colorer cette visualisation ne comportent que des valeurs non définies.","ja-JP":"このビジュアライゼーションの色の割り当てに使用したデータには、未定義の値が含まれています。","ru-RU":"Данные, используемые для выбора цвета визуализации, содержат только неопределенные значения."}},properties_trendlines_types_average:{id:"properties.trendlines.types.average",locale:{"en-US":"Average","zh-TW":"平均值","zh-CN":"平均值","tr-TR":"Ortalama","sv-SE":"Medel","it-IT":"Media","es-ES":"Media","de-DE":"Durchschnitt","pl-PL":"Średnia","nl-NL":"Gemiddelde","ko-KR":"평균","pt-BR":"Média","fr-FR":"Moyenne","ja-JP":"平均値","ru-RU":"Среднее"}},properties_trendlines_types_linear:{id:"properties.trendlines.types.linear",locale:{"en-US":"Linear","zh-TW":"線性","zh-CN":"线性","tr-TR":"Doğrusal","sv-SE":"Linjär","it-IT":"Lineare","es-ES":"Lineal","de-DE":"Linear","pl-PL":"Liniowa","nl-NL":"Lineair","ko-KR":"선형","pt-BR":"Linear","fr-FR":"Linéaire","ja-JP":"線形","ru-RU":"Линейный"}},properties_trendlines_types_polynomial2:{id:"properties.trendlines.types.polynomial2",locale:{"en-US":"Second degree polynomial","zh-TW":"第二度多項式","zh-CN":"二次多项式","tr-TR":"İkinci derece polinom","sv-SE":"Polynomial, andra graden","it-IT":"Polinomio di secondo grado","es-ES":"Polinómica de segundo grado","de-DE":"Polynom zweiten Grades","pl-PL":"Wielomianowa drugiego stopnia","nl-NL":"Tweedegraadspolynoom","ko-KR":"2차 다항식","pt-BR":"Polinômio de segundo grau","fr-FR":"Polynomial du 2ème degré","ja-JP":"2 番目の角度の多項式近似","ru-RU":"Полиномиальный второй степени"}},properties_trendlines_types_polynomial3:{id:"properties.trendlines.types.polynomial3",locale:{"en-US":"Third degree polynomial","zh-TW":"第三度多項式","zh-CN":"三次多项式","tr-TR":"Üçüncü derece polinom","sv-SE":"Polynomial, tredje graden","it-IT":"Polinomio di terzo grado","es-ES":"Polinómica de tercer grado","de-DE":"Polynom dritten Grades","pl-PL":"Wielomianowa trzeciego stopnia","nl-NL":"Derdegraadspolynoom","ko-KR":"3차 다항식","pt-BR":"Polinômio de terceiro grau","fr-FR":"Polynomial du 3ème degré","ja-JP":"3 番目の角度の多項式近似","ru-RU":"Полиномиальный третьей степени"}},properties_trendlines_types_polynomial4:{id:"properties.trendlines.types.polynomial4",locale:{"en-US":"Fourth degree polynomial","zh-TW":"第四度多項式","zh-CN":"四次多项式","tr-TR":"Dördüncü derece polinom","sv-SE":"Polynomial, fjärde graden","it-IT":"Polinomio di quarto grado","es-ES":"Polinómica de cuarto grado","de-DE":"Polynom vierten Grades","pl-PL":"Wielomianowa czwartego stopnia","nl-NL":"Vierdegraadspolynoom","ko-KR":"4차 다항식","pt-BR":"Polinômio de quarto grau","fr-FR":"Polynomial du 4ème degré","ja-JP":"4 番目の角度の多項式近似","ru-RU":"Полиномиальный четвертой степени"}},properties_trendlines_types_exponential:{id:"properties.trendlines.types.exponential",locale:{"en-US":"Exponential","zh-TW":"指數","zh-CN":"指数","tr-TR":"Üstel","sv-SE":"Exponentiell","it-IT":"Esponenziale","es-ES":"Exponencial","de-DE":"Exponentiell","pl-PL":"Wykładnicze","nl-NL":"Exponentieel","ko-KR":"지수","pt-BR":"Exponencial","fr-FR":"Exponentiel","ja-JP":"指数","ru-RU":"Экспоненциальный"}},properties_trendlines_types_logarithmic:{id:"properties.trendlines.types.logarithmic",locale:{"en-US":"Logarithmic","zh-TW":"對數","zh-CN":"对数","tr-TR":"Logaritmik","sv-SE":"Logaritmisk","it-IT":"Logaritmica","es-ES":"Logarítmica","de-DE":"Logarithmisch","pl-PL":"Logarytmiczna","nl-NL":"Logaritmisch","ko-KR":"로그","pt-BR":"Logarítmico","fr-FR":"Logarithmique","ja-JP":"対数","ru-RU":"Логарифмический"}},properties_trendlines_types_power:{id:"properties.trendlines.types.power",locale:{"en-US":"Power","zh-TW":"乘冪","zh-CN":"幂","tr-TR":"Üs","sv-SE":"Potens","it-IT":"Potenza","es-ES":"Potencia","de-DE":"Potenz","pl-PL":"Potęgowa","nl-NL":"Macht","ko-KR":"거듭제곱","pt-BR":"Potência","fr-FR":"Puissance","ja-JP":"累乗","ru-RU":"Силовой"}},Common_Measures:{id:"Common.Measures",locale:{"en-US":"Measures","de-DE":"Kennzahlen","fr-FR":"Mesures","it-IT":"Misure","ja-JP":"メジャー","ko-KR":"측정값","es-ES":"Medidas","nl-NL":"Metingen","pl-PL":"Miary","pt-BR":"Medidas","sv-SE":"Mått","tr-TR":"Hesaplamalar","zh-CN":"度量","zh-TW":"量值","ru-RU":"Меры"}},Tooltip_ToggleOnLassoSelection:{id:"Tooltip.ToggleOnLassoSelection",locale:{"en-US":"Turn on lasso selection","de-DE":"Lasso-Auswahl aktivieren","fr-FR":"Activer la sélection au lasso","it-IT":"Attiva selezione lazo","ja-JP":"囲み選択をオンにする","ko-KR":"올가미 선택 켜기","es-ES":"Activar la selección de contorno","nl-NL":"Lassoselectie inschakelen","pl-PL":"Włącz zaznaczenie lasso","pt-BR":"Ativar seleção de laço","sv-SE":"Slå på lassourval","tr-TR":"Serbest seçimi aç","zh-CN":"开启套索选择方法","zh-TW":"開啟套索選取","ru-RU":"Включить выбор лассо"}},Tooltip_ToggleOffLassoSelection:{id:"Tooltip.ToggleOffLassoSelection",locale:{"en-US":"Turn off lasso selection","de-DE":"Lasso-Auswahl deaktivieren","fr-FR":"Désactiver la sélection au lasso","it-IT":"Disattiva selezione lazo","ja-JP":"囲み選択をオフにする","ko-KR":"올가미 선택 끄기","es-ES":"Desactivar la selección de contorno","nl-NL":"Lassoselectie uitschakelen","pl-PL":"Wyłącz zaznaczenie lasso","pt-BR":"Desativar seleção de laço","sv-SE":"Stäng av lassourval","tr-TR":"Serbest seçimi kapat","zh-CN":"关闭套索选择方法","zh-TW":"關閉套索選取","ru-RU":"Выключить выбор лассо"}}};function F(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var z=Object.prototype.hasOwnProperty,_=Object.prototype.toString,j=Object.defineProperty,H=Object.getOwnPropertyDescriptor,V=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===_.call(e)},B=function(e){if(!e||"[object Object]"!==_.call(e))return!1;var t,n=z.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&z.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||z.call(e,t)},U=function(e,t){j&&"__proto__"===t.name?j(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},Y=function(e,t){if("__proto__"===t){if(!z.call(e,t))return;if(H)return H(e,t).value}return e[t]},W=function e(){var t,n,r,i,o,a,s=arguments[0],l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l<u;++l)if(null!=(t=arguments[l]))for(n in t)r=Y(s,n),s!==(i=Y(t,n))&&(c&&i&&(B(i)||(o=V(i)))?(o?(o=!1,a=r&&V(r)?r:[]):a=r&&B(r)?r:{},U(s,{name:n,newValue:e(c,a,i)})):void 0!==i&&U(s,{name:n,newValue:i}));return s},G=F(W);const X="center",K="bottom";var J={NoDataExist:{label:"NoDataExist",alignment:X,default:!0},OnlyNanData:{label:"OnlyNanData",alignment:X,default:!0},OnlyNegativeOrZeroValues:{label:"OnlyNegativeOrZeroValues",alignment:X,default:!1},LimitedData:{label:"LimitedData",alignment:K,default:!1},OnlyNanColor:{label:"OnlyNanColor",alignment:K,default:!1},NegativeOrZeroValues:{label:"NegativeOrZeroValues",alignment:K,default:!1},DataRangeIncludingZero:{label:"DataRangeIncludingZero",alignment:K,default:!1}};const Z=[["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}]],Q={};Z.forEach((([e,{width:t,height:n}])=>{Q[e]={width:t,height:n}}));const ee={getLayoutModes:()=>Q,getLayoutMode(e,t){let n;for(n=0;n<Z.length;++n)if(e>=Z[n][1].width&&t>=Z[n][1].height)return Z[n][0];return"SPARK"}};const te=["$date","$timestamp","$time"],ne=["D","TS","T"],re={hasTimeTag:e=>!!(e&&e.qTags&&e.qTags.some((e=>te.some((t=>t===e))))),hasUnknownFormat:e=>!(!e||!e.qNumFormat||"U"!==e.qNumFormat.qType),hasTimeFormat:e=>!!(e&&e.qNumFormat&&ne.some((t=>t===e.qNumFormat.qType))),isTimeDimension:(e,t)=>!!(e&&t&&(re.hasTimeTag(t)&&re.hasUnknownFormat(t)||re.hasTimeFormat(t))),isTime:(e,t)=>!!(t&&t.qHyperCube.qDimensionInfo&&t.qHyperCube.qDimensionInfo.length)&&(e&&re.isTimeDimension(e,t.qHyperCube.qDimensionInfo.filter((e=>{var t;return 7005!==(null===(t=e.qError)||void 0===t?void 0:t.qErrorCode)}))[0])),canBeContinuousDimension(e){if(!e)return!1;const t=e.qTags||[];return!(!e.qContinuousAxes||!t.some((e=>"$numeric"===e)))},canBeContinuous(e){var t,n,r;const i=null==e||null===(t=e.qHyperCube)||void 0===t||null===(n=t.qDimensionInfo)||void 0===n?void 0:n.filter((e=>{var t;return 7005!==(null===(t=e.qError)||void 0===t?void 0:t.qErrorCode)}));return!((null!==(r=null==i?void 0:i.length)&&void 0!==r?r:0)<1)&&re.canBeContinuousDimension(i[0])},maxNumberOfLines:12},ie=/^[A-Z][A-z0-9_]*$/i,oe={setValue:(e,t,n)=>{if(!t)return!1;const r=t.split("."),i=r[r.length-1];let o,a=e;for(o=0;o<r.length-1;++o)void 0===a[r[o]]&&(a[r[o]]=Number.isNaN(+r[o+1])?{}:[]),a=a[r[o]];if(void 0!==n){const e=a[i];return a[i]=n,{updated:n,previous:e}}return delete a[i],!1},getValue:(e,t,n)=>{const r=t.split(".");let i,o=e;if(void 0===o)return n;for(i=0;i<r.length;++i){if(void 0===o[r[i]])return n;o=o[r[i]]}return o},moveArrayElement:(e,t,n)=>{if(n>=e.length){let t=n-e.length;for(;1+t--;)e.push(void 0)}e.splice(n,0,e.splice(t,1)[0])},escapeField:e=>{let t;return t=!e||"]"===e||ie.test(e)?e:`[${e.replace(/\]/g,"]]")}]`,t},deleteUndefinedProperties:e=>{Object.keys(e).forEach((t=>{void 0===e[t]&&delete e[t]}))},shouldUseFormat:e=>!e.isCustomFormatted&&(e.qIsAutoFormat||"U"===e.qNumFormat.qType)},ae=e=>oe.getValue(e,"qHyperCube.qDimensionInfo",[]),se=e=>oe.getValue(e,"qHyperCube.qMeasureInfo",[]),le=e=>oe.getValue(e,"barGrouping.grouping"),ue={continuous:(e,t=!1)=>!!re.canBeContinuous(e)&&(oe.getValue(e,"dimensionAxis.continuousAuto")?"function"==typeof t?t():t:!!e.preferContinuousAxis),dimensionless:e=>!ae(e).length,grouped(e){return!this.dimensionless(e)&&"grouped"===le(e)&&(ae(e).length>1||se(e).length>1)&&!this.continuous(e)},groupedByDimension(e){return this.grouped(e)&&ae(e).length>1&&1===se(e).length},groupedByMeasure(e){return this.grouped(e)&&1===ae(e).length&&se(e).length>1},stacked(e){return(!this.dimensionless(e)&&"grouped"!==le(e)||this.continuous(e))&&(ae(e).length>1||se(e).length>1)},stackedByDimension(e){return this.stacked(e)&&ae(e).length>1&&1===se(e).length},stackedByMeasure(e){return this.stacked(e)&&1===ae(e).length&&se(e).length>1},simple:e=>0===ae(e).length||1===ae(e).length&&1===se(e).length,snapshot:e=>!!oe.getValue(e,"snapshotData")};function ce(e,t){const n=e.component(t);return n&&n._DO_NOT_USE_getInfo&&n._DO_NOT_USE_getInfo().offset}const de=e=>{throw e.isHandled=!0,e};const me={getDockValue:e=>"near"===e||"left"===e||"top"===e?0:1,getOppositeDock(e){switch(e){case"left":return"right";case"right":return"left";case"top":return"bottom";case"bottom":return"top";case"near":default:return"far";case"far":return"near"}},getHorizontalDock:e=>"near"===e||"left"===e?"left":"right",getVerticalDock:e=>"near"===e||"bottom"===e?"bottom":"top",getDock:(e,t,n)=>"vertical"===e||"y"===e?me.getVerticalDock(t):n?me.getOppositeDock(me.getHorizontalDock(t)):me.getHorizontalDock(t),getInvertedOrientation:e=>"vertical"===e?"horizontal":"vertical",getMinorScaleAxis:e=>"vertical"===e?"y":"x",getMajorScaleAxis:e=>"vertical"===e?"x":"y",getAlignment:(e,t)=>"vertical"===e?"near"===t||"bottom"===t?1:0:"near"===t||"left"===t?0:1,getMeasureScaleInvert:(e,t)=>"vertical"===e||t,getDimensionScaleInvert:(e,t)=>"horizontal"===e&&t,getSize:(e,{width:t,height:n})=>"vertical"===e?t:n},fe={stringWidthOverMWidth:e=>(12*Math.min(e,3)+6.384615384615385*Math.max(e-3,0))/11,getCharacterRatios(e){if(!e)return{latin:0,cjk:0};let t=e.match(/[\u4E00-\u9FFF]/g),n=e.match(/[\u3040-\u309F]/g),r=e.match(/[\u30A0-\u30FF]/g);t=t?t.length:0,n=n?n.length:0,r=r?r.length:0;const i=t+n+r;return{latin:e.length-i,cjk:i}},getTotalCharacterRatios(e,t,n="qText"){if(!e)return{latinRatio:1,cjkRatio:0};const r={latin:0,cjk:0};let i;void 0===t?e.forEach((e=>{i=fe.getCharacterRatios(e[n]),r.latin+=i.latin,r.cjk+=i.cjk})):e.forEach((e=>{i=fe.getCharacterRatios(e[t][n]),r.latin+=i.latin,r.cjk+=i.cjk}));const o=Math.max(1,r.latin+r.cjk);return r.latinRatio=r.latin/o,r.cjkRatio=r.cjk/o,r},getAdjustedMaxGlyphCount(e,t,n,r="qText"){const i=fe.getTotalCharacterRatios(t,n,r),o=i.latinRatio*e,a=i.cjkRatio*e;return Math.ceil(fe.stringWidthOverMWidth(o)+1.0909090909090908*a)}},pe=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼ‎ⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),he=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞‏יִײַ-ﬨשׁ-ﭏ]"),ge=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]"),ye={lrm:String.fromCharCode(8206),rlm:String.fromCharCode(8207),isLtrChar:e=>pe.test(e),isRtlChar:e=>he.test(e)||ge.test(e),detectTextDirection(e){const t=e?e.length:0;let n,r;for(n=0;n<t;n++){if(r=e[n],ye.isLtrChar(r))return"ltr";if(ye.isRtlChar(r))return"rtl"}return"ltr"}},ve={getColorSymbol:(e,t)=>e.h("div",{style:{display:"inline-block",width:"10px",height:"10px","background-color":t.color.fill,margin:"0 8px"}}),getNodeFillColor:e=>e.attrs&&void 0!==e.attrs.fill?e.attrs.fill:e.children&&e.children[0]&&e.children[0].attrs&&void 0!==e.children[0].attrs.fill?e.children[0].attrs.fill:void 0,getColor(e,t,n){const r=t.data,i=e.resources.formatter,o=e.resources.dataset,a={};if(n.coloring.label&&(a.label=`${n.coloring.label}`),"color"!==n.coloring.type&&r.fillTooltip){const e=i("fill"),t="measure"===n.coloring.fieldType;if(a.value=t&&e?e(r.fillTooltip.value):r.fillTooltip.label?r.fillTooltip.label:r.fillTooltip.value,!n.coloring.label){const e=o(r.fillTooltip.source.key).field(r.fillTooltip.source.field).title();a.label=`${e}`}}return a.fill=void 0===r._fillColor?ve.getNodeFillColor(t):r._fillColor,a},getMeasure:(e,t)=>({label:`${e(t.source.key).field(t.source.field).title()}`,value:""===t.label||"NaN"===t.label?"-":t.label,field:t.source.field}),hideColorRow:(e,t)=>void 0===e.color.value||e.measures.some((e=>e.field===t.coloring.field)),getTitleRow(e,t){const n=ye.detectTextDirection(e.title);return[{content:e.title,style:{"font-weight":"bold","text-align":t?"right":"left",direction:n},colspan:2},{}]},getDescriptionRow(e,t){const n=ye.detectTextDirection(e.value);return[{content:e.value,style:{"text-align":t?"right":"left",direction:n},colspan:2},{}]},getNMoreRow(e,t,n){const r=t?t.get("Object.ChartTooltip.NMore",e):`+${e} more`;return[{content:r,style:{"font-weight":"bold","text-align":n?"right":"left",direction:ye.detectTextDirection(r)},colspan:2},{}]},getSeparatorRow:()=>[{content:"",style:{"background-image":"linear-gradient(transparent 8px, rgba(255, 255, 255, 0.4) 8px, rgba(255, 255, 255, 0.4) 9.2px, transparent 9.2px)",height:"17px"},colspan:2},{}],getColorRow(e,t,n){const r=ye.detectTextDirection(t.color.label),i=n?[":",t.color.label]:[t.color.label,":"],o=ye.detectTextDirection(t.color.value);return[{content:i,style:{"text-align":n?"right":"left",direction:r}},{content:n?[t.color.value,ve.getColorSymbol(e,t)]:[ve.getColorSymbol(e,t),t.color.value],style:{"text-align":n?"left":"right",direction:o,"vertical-align":"middle"}}]},getMeasureRow(e,t,n,r,i=!1){const o=ye.detectTextDirection(e.label),a=r?[":",e.label]:[e.label,":"],s=ye.detectTextDirection(e.value);let l;return l=i?r?[e.value,ve.getColorSymbol(t,n)]:[ve.getColorSymbol(t,n),e.value]:[e.value],[{content:a,style:{"text-align":r?"right":"left",direction:o}},{content:l,style:{"text-align":r?"left":"right",direction:s,"vertical-align":"middle"}}]}};function be(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function xe(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Me(){}var Se=.7,Ee=1/Se,Ce="\\s*([+-]?\\d+)\\s*",qe="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",we="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ae=/^#([0-9a-f]{3,8})$/,Oe=new RegExp(`^rgb\\(${Ce},${Ce},${Ce}\\)$`),De=new RegExp(`^rgb\\(${we},${we},${we}\\)$`),Ne=new RegExp(`^rgba\\(${Ce},${Ce},${Ce},${qe}\\)$`),Ie=new RegExp(`^rgba\\(${we},${we},${we},${qe}\\)$`),Te=new RegExp(`^hsl\\(${qe},${we},${we}\\)$`),Le=new RegExp(`^hsla\\(${qe},${we},${we},${qe}\\)$`),ke={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 Re(){return this.rgb().formatHex()}function Pe(){return this.rgb().formatRgb()}function $e(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Ae.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?Fe(t):3===n?new He(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?ze(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?ze(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=Oe.exec(e))?new He(t[1],t[2],t[3],1):(t=De.exec(e))?new He(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Ne.exec(e))?ze(t[1],t[2],t[3],t[4]):(t=Ie.exec(e))?ze(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Te.exec(e))?Ge(t[1],t[2]/100,t[3]/100,1):(t=Le.exec(e))?Ge(t[1],t[2]/100,t[3]/100,t[4]):ke.hasOwnProperty(e)?Fe(ke[e]):"transparent"===e?new He(NaN,NaN,NaN,0):null}function Fe(e){return new He(e>>16&255,e>>8&255,255&e,1)}function ze(e,t,n,r){return r<=0&&(e=t=n=NaN),new He(e,t,n,r)}function _e(e){return e instanceof Me||(e=$e(e)),e?new He((e=e.rgb()).r,e.g,e.b,e.opacity):new He}function je(e,t,n,r){return 1===arguments.length?_e(e):new He(e,t,n,null==r?1:r)}function He(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function Ve(){return`#${We(this.r)}${We(this.g)}${We(this.b)}`}function Be(){const e=Ue(this.opacity);return`${1===e?"rgb(":"rgba("}${Ye(this.r)}, ${Ye(this.g)}, ${Ye(this.b)}${1===e?")":`, ${e})`}`}function Ue(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ye(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function We(e){return((e=Ye(e))<16?"0":"")+e.toString(16)}function Ge(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ke(e,t,n,r)}function Xe(e){if(e instanceof Ke)return new Ke(e.h,e.s,e.l,e.opacity);if(e instanceof Me||(e=$e(e)),!e)return new Ke;if(e instanceof Ke)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,s=o-i,l=(o+i)/2;return s?(a=t===o?(n-r)/s+6*(n<r):n===o?(r-t)/s+2:(t-n)/s+4,s/=l<.5?o+i:2-o-i,a*=60):s=l>0&&l<1?0:a,new Ke(a,s,l,e.opacity)}function Ke(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function Je(e){return(e=(e||0)%360)<0?e+360:e}function Ze(e){return Math.max(0,Math.min(1,e||0))}function Qe(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}be(Me,$e,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Re,formatHex:Re,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Xe(this).formatHsl()},formatRgb:Pe,toString:Pe}),be(He,je,xe(Me,{brighter(e){return e=null==e?Ee:Math.pow(Ee,e),new He(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?Se:Math.pow(Se,e),new He(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new He(Ye(this.r),Ye(this.g),Ye(this.b),Ue(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:Ve,formatHex:Ve,formatHex8:function(){return`#${We(this.r)}${We(this.g)}${We(this.b)}${We(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Be,toString:Be})),be(Ke,(function(e,t,n,r){return 1===arguments.length?Xe(e):new Ke(e,t,n,null==r?1:r)}),xe(Me,{brighter(e){return e=null==e?Ee:Math.pow(Ee,e),new Ke(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?Se:Math.pow(Se,e),new Ke(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,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new He(Qe(e>=240?e-240:e+120,i,r),Qe(e,i,r),Qe(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Ke(Je(this.h),Ze(this.s),Ze(this.l),Ue(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=Ue(this.opacity);return`${1===e?"hsl(":"hsla("}${Je(this.h)}, ${100*Ze(this.s)}%, ${100*Ze(this.l)}%${1===e?")":`, ${e})`}`}}));const et=Math.PI/180,tt=180/Math.PI,nt=.96422,rt=1,it=.82521,ot=4/29,at=6/29,st=3*at*at,lt=at*at*at;function ut(e){if(e instanceof ct)return new ct(e.l,e.a,e.b,e.opacity);if(e instanceof gt)return yt(e);e instanceof He||(e=_e(e));var t,n,r=pt(e.r),i=pt(e.g),o=pt(e.b),a=dt((.2225045*r+.7168786*i+.0606169*o)/rt);return r===i&&i===o?t=n=a:(t=dt((.4360747*r+.3850649*i+.1430804*o)/nt),n=dt((.0139322*r+.0971045*i+.7141733*o)/it)),new ct(116*a-16,500*(t-a),200*(a-n),e.opacity)}function ct(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function dt(e){return e>lt?Math.pow(e,1/3):e/st+ot}function mt(e){return e>at?e*e*e:st*(e-ot)}function ft(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function pt(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function ht(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof gt)return new gt(e.h,e.c,e.l,e.opacity);if(e instanceof ct||(e=ut(e)),0===e.a&&0===e.b)return new gt(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*tt;return new gt(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new gt(e,t,n,null==r?1:r)}function gt(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function yt(e){if(isNaN(e.h))return new ct(e.l,0,0,e.opacity);var t=e.h*et;return new ct(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}be(ct,(function(e,t,n,r){return 1===arguments.length?ut(e):new ct(e,t,n,null==r?1:r)}),xe(Me,{brighter(e){return new ct(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new ct(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 He(ft(3.1338561*(t=nt*mt(t))-1.6168667*(e=rt*mt(e))-.4906146*(n=it*mt(n))),ft(-.9787684*t+1.9161415*e+.033454*n),ft(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),be(gt,ht,xe(Me,{brighter(e){return new gt(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new gt(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return yt(this).rgb()}}));var vt={isDark:function(e){return ht(e).l<70}};function bt(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function xt(e){return 1===e.length&&(e=function(e){return function(t,n){return bt(e(t),n)}}(e)),{left:function(t,n,r,i){for(null==r&&(r=0),null==i&&(i=t.length);r<i;){var o=r+i>>>1;e(t[o],n)<0?r=o+1:i=o}return r},right:function(t,n,r,i){for(null==r&&(r=0),null==i&&(i=t.length);r<i;){var o=r+i>>>1;e(t[o],n)>0?i=o:r=o+1}return r}}}var Mt=xt(bt).right,St=Math.sqrt(50),Et=Math.sqrt(10),Ct=Math.sqrt(2);function qt(e,t,n){var r=(t-e)/Math.max(0,n),i=Math.floor(Math.log(r)/Math.LN10),o=r/Math.pow(10,i);return i>=0?(o>=St?10:o>=Et?5:o>=Ct?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(o>=St?10:o>=Et?5:o>=Ct?2:1)}function wt(e,t,n){var r=Math.abs(t-e)/Math.max(0,n),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),o=r/i;return o>=St?i*=10:o>=Et?i*=5:o>=Ct&&(i*=2),t<e?-i:i}function At(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}var Ot="$";function Dt(){}function Nt(e,t){var n=new Dt;if(e instanceof Dt)e.each((function(e,t){n.set(t,e)}));else if(Array.isArray(e)){var r,i=-1,o=e.length;if(null==t)for(;++i<o;)n.set(i,e[i]);else for(;++i<o;)n.set(t(r=e[i],i,e),r)}else if(e)for(var a in e)n.set(a,e[a]);return n}function It(){}Dt.prototype=Nt.prototype={constructor:Dt,has:function(e){return Ot+e in this},get:function(e){return this[Ot+e]},set:function(e,t){return this[Ot+e]=t,this},remove:function(e){var t=Ot+e;return t in this&&delete this[t]},clear:function(){for(var e in this)e[0]===Ot&&delete this[e]},keys:function(){var e=[];for(var t in this)t[0]===Ot&&e.push(t.slice(1));return e},values:function(){var e=[];for(var t in this)t[0]===Ot&&e.push(this[t]);return e},entries:function(){var e=[];for(var t in this)t[0]===Ot&&e.push({key:t.slice(1),value:this[t]});return e},size:function(){var e=0;for(var t in this)t[0]===Ot&&++e;return e},empty:function(){for(var e in this)if(e[0]===Ot)return!1;return!0},each:function(e){for(var t in this)t[0]===Ot&&e(this[t],t.slice(1),this)}};var Tt=Nt.prototype;It.prototype={constructor:It,has:Tt.has,add:function(e){return this[Ot+(e+="")]=e,this},remove:Tt.remove,clear:Tt.clear,values:Tt.keys,size:Tt.size,empty:Tt.empty,each:Tt.each};var Lt=Array.prototype,kt=Lt.map,Rt=Lt.slice;function Pt(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function $t(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Ft(){}var zt=.7,_t=1/zt,jt="\\s*([+-]?\\d+)\\s*",Ht="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",Vt="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Bt=/^#([0-9a-f]{3})$/,Ut=/^#([0-9a-f]{6})$/,Yt=new RegExp("^rgb\\("+[jt,jt,jt]+"\\)$"),Wt=new RegExp("^rgb\\("+[Vt,Vt,Vt]+"\\)$"),Gt=new RegExp("^rgba\\("+[jt,jt,jt,Ht]+"\\)$"),Xt=new RegExp("^rgba\\("+[Vt,Vt,Vt,Ht]+"\\)$"),Kt=new RegExp("^hsl\\("+[Ht,Vt,Vt]+"\\)$"),Jt=new RegExp("^hsla\\("+[Ht,Vt,Vt,Ht]+"\\)$"),Zt={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 Qt(e){var t;return e=(e+"").trim().toLowerCase(),(t=Bt.exec(e))?new on((t=parseInt(t[1],16))>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):(t=Ut.exec(e))?en(parseInt(t[1],16)):(t=Yt.exec(e))?new on(t[1],t[2],t[3],1):(t=Wt.exec(e))?new on(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Gt.exec(e))?tn(t[1],t[2],t[3],t[4]):(t=Xt.exec(e))?tn(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Kt.exec(e))?sn(t[1],t[2]/100,t[3]/100,1):(t=Jt.exec(e))?sn(t[1],t[2]/100,t[3]/100,t[4]):Zt.hasOwnProperty(e)?en(Zt[e]):"transparent"===e?new on(NaN,NaN,NaN,0):null}function en(e){return new on(e>>16&255,e>>8&255,255&e,1)}function tn(e,t,n,r){return r<=0&&(e=t=n=NaN),new on(e,t,n,r)}function nn(e){return e instanceof Ft||(e=Qt(e)),e?new on((e=e.rgb()).r,e.g,e.b,e.opacity):new on}function rn(e,t,n,r){return 1===arguments.length?nn(e):new on(e,t,n,null==r?1:r)}function on(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function an(e){return((e=Math.max(0,Math.min(255,Math.round(e)||0)))<16?"0":"")+e.toString(16)}function sn(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ln(e,t,n,r)}function ln(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function un(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}Pt(Ft,Qt,{displayable:function(){return this.rgb().displayable()},hex:function(){return this.rgb().hex()},toString:function(){return this.rgb()+""}}),Pt(on,rn,$t(Ft,{brighter:function(e){return e=null==e?_t:Math.pow(_t,e),new on(this.r*e,this.g*e,this.b*e,this.opacity)},darker:function(e){return e=null==e?zt:Math.pow(zt,e),new on(this.r*e,this.g*e,this.b*e,this.opacity)},rgb:function(){return this},displayable:function(){return 0<=this.r&&this.r<=255&&0<=this.g&&this.g<=255&&0<=this.b&&this.b<=255&&0<=this.opacity&&this.opacity<=1},hex:function(){return"#"+an(this.r)+an(this.g)+an(this.b)},toString:function(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===e?")":", "+e+")")}})),Pt(ln,(function(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof ln)return new ln(e.h,e.s,e.l,e.opacity);if(e instanceof Ft||(e=Qt(e)),!e)return new ln;if(e instanceof ln)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,s=o-i,l=(o+i)/2;return s?(a=t===o?(n-r)/s+6*(n<r):n===o?(r-t)/s+2:(t-n)/s+4,s/=l<.5?o+i:2-o-i,a*=60):s=l>0&&l<1?0:a,new ln(a,s,l,e.opacity)}(e):new ln(e,t,n,null==r?1:r)}),$t(Ft,{brighter:function(e){return e=null==e?_t:Math.pow(_t,e),new ln(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=null==e?zt:Math.pow(zt,e),new ln(this.h,this.s,this.l*e,this.opacity)},rgb:function(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new on(un(e>=240?e-240:e+120,i,r),un(e,i,r),un(e<120?e+240:e-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1}}));var cn=Math.PI/180,dn=180/Math.PI,mn=.96422,fn=1,pn=.82521,hn=4/29,gn=6/29,yn=3*gn*gn,vn=gn*gn*gn;function bn(e){if(e instanceof xn)return new xn(e.l,e.a,e.b,e.opacity);if(e instanceof qn){if(isNaN(e.h))return new xn(e.l,0,0,e.opacity);var t=e.h*cn;return new xn(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}e instanceof on||(e=nn(e));var n,r,i=Cn(e.r),o=Cn(e.g),a=Cn(e.b),s=Mn((.2225045*i+.7168786*o+.0606169*a)/fn);return i===o&&o===a?n=r=s:(n=Mn((.4360747*i+.3850649*o+.1430804*a)/mn),r=Mn((.0139322*i+.0971045*o+.7141733*a)/pn)),new xn(116*s-16,500*(n-s),200*(s-r),e.opacity)}function xn(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function Mn(e){return e>vn?Math.pow(e,1/3):e/yn+hn}function Sn(e){return e>gn?e*e*e:yn*(e-hn)}function En(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Cn(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function qn(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}Pt(xn,(function(e,t,n,r){return 1===arguments.length?bn(e):new xn(e,t,n,null==r?1:r)}),$t(Ft,{brighter:function(e){return new xn(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker:function(e){return new xn(this.l-18*(null==e?1:e),this.a,this.b,this.opacity)},rgb:function(){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 on(En(3.1338561*(t=mn*Sn(t))-1.6168667*(e=fn*Sn(e))-.4906146*(n=pn*Sn(n))),En(-.9787684*t+1.9161415*e+.033454*n),En(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),Pt(qn,(function(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof qn)return new qn(e.h,e.c,e.l,e.opacity);if(e instanceof xn||(e=bn(e)),0===e.a&&0===e.b)return new qn(NaN,0,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*dn;return new qn(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new qn(e,t,n,null==r?1:r)}),$t(Ft,{brighter:function(e){return new qn(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker:function(e){return new qn(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb:function(){return bn(this).rgb()}}));var wn=-.14861,An=1.78277,On=-.29227,Dn=-.90649,Nn=1.97294,In=Nn*Dn,Tn=Nn*An,Ln=An*On-Dn*wn;function kn(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof Rn)return new Rn(e.h,e.s,e.l,e.opacity);e instanceof on||(e=nn(e));var t=e.r/255,n=e.g/255,r=e.b/255,i=(Ln*r+In*t-Tn*n)/(Ln+In-Tn),o=r-i,a=(Nn*(n-i)-On*o)/Dn,s=Math.sqrt(a*a+o*o)/(Nn*i*(1-i)),l=s?Math.atan2(a,o)*dn-120:NaN;return new Rn(l<0?l+360:l,s,i,e.opacity)}(e):new Rn(e,t,n,null==r?1:r)}function Rn(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function Pn(e){return function(){return e}}function $n(e,t){return function(n){return e+n*t}}function Fn(e){return 1==(e=+e)?zn: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(r){return Math.pow(e+r*t,n)}}(t,n,e):Pn(isNaN(t)?n:t)}}function zn(e,t){var n=t-e;return n?$n(e,n):Pn(isNaN(e)?t:e)}Pt(Rn,kn,$t(Ft,{brighter:function(e){return e=null==e?_t:Math.pow(_t,e),new Rn(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=null==e?zt:Math.pow(zt,e),new Rn(this.h,this.s,this.l*e,this.opacity)},rgb:function(){var e=isNaN(this.h)?0:(this.h+120)*cn,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),r=Math.cos(e),i=Math.sin(e);return new on(255*(t+n*(wn*r+An*i)),255*(t+n*(On*r+Dn*i)),255*(t+n*(Nn*r)),this.opacity)}}));var _n=function e(t){var n=Fn(t);function r(e,t){var r=n((e=rn(e)).r,(t=rn(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),a=zn(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=o(t),e.opacity=a(t),e+""}}return r.gamma=e,r}(1);function jn(e,t){var n,r=t?t.length:0,i=e?Math.min(r,e.length):0,o=new Array(i),a=new Array(r);for(n=0;n<i;++n)o[n]=Gn(e[n],t[n]);for(;n<r;++n)a[n]=t[n];return function(e){for(n=0;n<i;++n)a[n]=o[n](e);return a}}function Hn(e,t){var n=new Date;return t-=e=+e,function(r){return n.setTime(e+t*r),n}}function Vn(e,t){return t-=e=+e,function(n){return e+t*n}}function Bn(e,t){var n,r={},i={};for(n in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)n in e?r[n]=Gn(e[n],t[n]):i[n]=t[n];return function(e){for(n in r)i[n]=r[n](e);return i}}var Un=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Yn=new RegExp(Un.source,"g");function Wn(e,t){var n,r,i,o=Un.lastIndex=Yn.lastIndex=0,a=-1,s=[],l=[];for(e+="",t+="";(n=Un.exec(e))&&(r=Yn.exec(t));)(i=r.index)>o&&(i=t.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(n=n[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,l.push({i:a,x:Vn(n,r)})),o=Yn.lastIndex;return o<t.length&&(i=t.slice(o),s[a]?s[a]+=i:s[++a]=i),s.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,r=0;r<t;++r)s[(n=l[r]).i]=n.x(e);return s.join("")})}function Gn(e,t){var n,r=typeof t;return null==t||"boolean"===r?Pn(t):("number"===r?Vn:"string"===r?(n=Qt(t))?(t=n,_n):Wn:t instanceof Qt?_n:t instanceof Date?Hn:Array.isArray(t)?jn:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?Bn:Vn)(e,t)}function Xn(e,t){return t-=e=+e,function(n){return Math.round(e+t*n)}}function Kn(e){return function t(n){function r(t,r){var i=e((t=kn(t)).h,(r=kn(r)).h),o=zn(t.s,r.s),a=zn(t.l,r.l),s=zn(t.opacity,r.opacity);return function(e){return t.h=i(e),t.s=o(e),t.l=a(Math.pow(e,n)),t.opacity=s(e),t+""}}return n=+n,r.gamma=t,r}(1)}function Jn(e){return+e}Kn((function(e,t){var n=t-e;return n?$n(e,n>180||n<-180?n-360*Math.round(n/360):n):Pn(isNaN(e)?t:e)})),Kn(zn);var Zn=[0,1];function Qn(e){return e}function er(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:function(e){return function(){return e}}(isNaN(t)?NaN:.5)}function tr(e){var t,n=e[0],r=e[e.length-1];return n>r&&(t=n,n=r,r=t),function(e){return Math.max(n,Math.min(r,e))}}function nr(e,t,n){var r=e[0],i=e[1],o=t[0],a=t[1];return i<r?(r=er(i,r),o=n(a,o)):(r=er(r,i),o=n(o,a)),function(e){return o(r(e))}}function rr(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),o=new Array(r),a=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++a<r;)i[a]=er(e[a],e[a+1]),o[a]=n(t[a],t[a+1]);return function(t){var n=Mt(e,t,1,r)-1;return o[n](i[n](t))}}function ir(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function or(e,t){return function(){var e,t,n,r,i,o,a=Zn,s=Zn,l=Gn,u=Qn;function c(){return r=Math.min(a.length,s.length)>2?rr:nr,i=o=null,d}function d(t){return isNaN(t=+t)?n:(i||(i=r(a.map(e),s,l)))(e(u(t)))}return d.invert=function(n){return u(t((o||(o=r(s,a.map(e),Vn)))(n)))},d.domain=function(e){return arguments.length?(a=kt.call(e,Jn),u===Qn||(u=tr(a)),c()):a.slice()},d.range=function(e){return arguments.length?(s=Rt.call(e),c()):s.slice()},d.rangeRound=function(e){return s=Rt.call(e),l=Xn,c()},d.clamp=function(e){return arguments.length?(u=e?tr(a):Qn,d):u!==Qn},d.interpolate=function(e){return arguments.length?(l=e,c()):l},d.unknown=function(e){return arguments.length?(n=e,d):n},function(n,r){return e=n,t=r,c()}}()(e,t)}function ar(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function sr(e){return(e=ar(Math.abs(e)))?e[1]:NaN}var lr,ur=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function cr(e){return new dr(e)}function dr(e){if(!(t=ur.exec(e)))throw new Error("invalid format: "+e);var t;this.fill=t[1]||" ",this.align=t[2]||">",this.sign=t[3]||"-",this.symbol=t[4]||"",this.zero=!!t[5],this.width=t[6]&&+t[6],this.comma=!!t[7],this.precision=t[8]&&+t[8].slice(1),this.trim=!!t[9],this.type=t[10]||""}function mr(e,t){var n=ar(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}cr.prototype=dr.prototype,dr.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(null==this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(null==this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var fr={"%":function(e,t){return(100*e).toFixed(t)},b:function(e){return Math.round(e).toString(2)},c:function(e){return e+""},d:function(e){return Math.round(e).toString(10)},e:function(e,t){return e.toExponential(t)},f:function(e,t){return e.toFixed(t)},g:function(e,t){return e.toPrecision(t)},o:function(e){return Math.round(e).toString(8)},p:function(e,t){return mr(100*e,t)},r:mr,s:function(e,t){var n=ar(e,t);if(!n)return e+"";var r=n[0],i=n[1],o=i-(lr=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+ar(e,Math.max(0,t+o-1))[0]},X:function(e){return Math.round(e).toString(16).toUpperCase()},x:function(e){return Math.round(e).toString(16)}};function pr(e){return e}var hr,gr,yr,vr=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function br(e){var t,n,r=e.grouping&&e.thousands?(t=e.grouping,n=e.thousands,function(e,r){for(var i=e.length,o=[],a=0,s=t[0],l=0;i>0&&s>0&&(l+s+1>r&&(s=Math.max(1,r-l)),o.push(e.substring(i-=s,i+s)),!((l+=s+1)>r));)s=t[a=(a+1)%t.length];return o.reverse().join(n)}):pr,i=e.currency,o=e.decimal,a=e.numerals?function(e){return function(t){return t.replace(/[0-9]/g,(function(t){return e[+t]}))}}(e.numerals):pr,s=e.percent||"%";function l(e){var t=(e=cr(e)).fill,n=e.align,l=e.sign,u=e.symbol,c=e.zero,d=e.width,m=e.comma,f=e.precision,p=e.trim,h=e.type;"n"===h?(m=!0,h="g"):fr[h]||(null==f&&(f=12),p=!0,h="g"),(c||"0"===t&&"="===n)&&(c=!0,t="0",n="=");var g="$"===u?i[0]:"#"===u&&/[boxX]/.test(h)?"0"+h.toLowerCase():"",y="$"===u?i[1]:/[%p]/.test(h)?s:"",v=fr[h],b=/[defgprs%]/.test(h);function x(e){var i,s,u,x=g,M=y;if("c"===h)M=v(e)+M,e="";else{var S=(e=+e)<0;if(e=v(Math.abs(e),f),p&&(e=function(e){e:for(var t,n=e.length,r=1,i=-1;r<n;++r)switch(e[r]){case".":i=t=r;break;case"0":0===i&&(i=r),t=r;break;default:if(i>0){if(!+e[r])break e;i=0}}return i>0?e.slice(0,i)+e.slice(t+1):e}(e)),S&&0==+e&&(S=!1),x=(S?"("===l?l:"-":"-"===l||"("===l?"":l)+x,M=("s"===h?vr[8+lr/3]:"")+M+(S&&"("===l?")":""),b)for(i=-1,s=e.length;++i<s;)if(48>(u=e.charCodeAt(i))||u>57){M=(46===u?o+e.slice(i+1):e.slice(i))+M,e=e.slice(0,i);break}}m&&!c&&(e=r(e,1/0));var E=x.length+e.length+M.length,C=E<d?new Array(d-E+1).join(t):"";switch(m&&c&&(e=r(C+e,C.length?d-M.length:1/0),C=""),n){case"<":e=x+e+M+C;break;case"=":e=x+C+e+M;break;case"^":e=C.slice(0,E=C.length>>1)+x+e+M+C.slice(E);break;default:e=C+x+e+M}return a(e)}return f=null==f?6:/[gprs]/.test(h)?Math.max(1,Math.min(21,f)):Math.max(0,Math.min(20,f)),x.toString=function(){return e+""},x}return{format:l,formatPrefix:function(e,t){var n=l(((e=cr(e)).type="f",e)),r=3*Math.max(-8,Math.min(8,Math.floor(sr(t)/3))),i=Math.pow(10,-r),o=vr[8+r/3];return function(e){return n(i*e)+o}}}}function xr(e,t,n,r){var i,o=wt(e,t,n);switch((r=cr(null==r?",f":r)).type){case"s":var a=Math.max(Math.abs(e),Math.abs(t));return null!=r.precision||isNaN(i=function(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(sr(t)/3)))-sr(Math.abs(e)))}(o,a))||(r.precision=i),yr(r,a);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=function(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,sr(t)-sr(e))+1}(o,Math.max(Math.abs(e),Math.abs(t))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=function(e){return Math.max(0,-sr(Math.abs(e)))}(o))||(r.precision=i-2*("%"===r.type))}return gr(r)}function Mr(e){var t=e.domain;return e.ticks=function(e){var n=t();return function(e,t,n){var r,i,o,a,s=-1;if(n=+n,(e=+e)==(t=+t)&&n>0)return[e];if((r=t<e)&&(i=e,e=t,t=i),0===(a=qt(e,t,n))||!isFinite(a))return[];if(a>0)for(e=Math.ceil(e/a),t=Math.floor(t/a),o=new Array(i=Math.ceil(t-e+1));++s<i;)o[s]=(e+s)*a;else for(e=Math.floor(e*a),t=Math.ceil(t*a),o=new Array(i=Math.ceil(e-t+1));++s<i;)o[s]=(e-s)/a;return r&&o.reverse(),o}(n[0],n[n.length-1],null==e?10:e)},e.tickFormat=function(e,n){var r=t();return xr(r[0],r[r.length-1],null==e?10:e,n)},e.nice=function(n){null==n&&(n=10);var r,i=t(),o=0,a=i.length-1,s=i[o],l=i[a];return l<s&&(r=s,s=l,l=r,r=o,o=a,a=r),(r=qt(s,l,n))>0?r=qt(s=Math.floor(s/r)*r,l=Math.ceil(l/r)*r,n):r<0&&(r=qt(s=Math.ceil(s*r)/r,l=Math.floor(l*r)/r,n)),r>0?(i[o]=Math.floor(s/r)*r,i[a]=Math.ceil(l/r)*r,t(i)):r<0&&(i[o]=Math.ceil(s*r)/r,i[a]=Math.floor(l*r)/r,t(i)),e},e}function Sr(){var e=or(Qn,Qn);return e.copy=function(){return ir(e,Sr())},At.apply(e,arguments),Mr(e)}hr=br({decimal:".",thousands:",",grouping:[3],currency:["$",""]}),gr=hr.format,yr=hr.formatPrefix;var Er=new Date,Cr=new Date;function qr(e,t,n,r){function i(t){return e(t=new Date(+t)),t}return i.floor=i,i.ceil=function(n){return e(n=new Date(n-1)),t(n,1),e(n),n},i.round=function(e){var t=i(e),n=i.ceil(e);return e-t<n-e?t:n},i.offset=function(e,n){return t(e=new Date(+e),null==n?1:Math.floor(n)),e},i.range=function(n,r,o){var a,s=[];if(n=i.ceil(n),o=null==o?1:Math.floor(o),!(n<r&&o>0))return s;do{s.push(a=new Date(+n)),t(n,o),e(n)}while(a<n&&n<r);return s},i.filter=function(n){return qr((function(t){if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)}),(function(e,r){if(e>=e)if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););}))},n&&(i.count=function(t,r){return Er.setTime(+t),Cr.setTime(+r),e(Er),e(Cr),Math.floor(n(Er,Cr))},i.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?i.filter(r?function(t){return r(t)%e==0}:function(t){return i.count(0,t)%e==0}):i:null}),i}var wr=qr((function(){}),(function(e,t){e.setTime(+e+t)}),(function(e,t){return t-e}));wr.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?qr((function(t){t.setTime(Math.floor(t/e)*e)}),(function(t,n){t.setTime(+t+n*e)}),(function(t,n){return(n-t)/e})):wr:null},wr.range;var Ar=1e3,Or=6e4,Dr=36e5,Nr=864e5,Ir=6048e5,Tr=qr((function(e){e.setTime(Math.floor(e/Ar)*Ar)}),(function(e,t){e.setTime(+e+t*Ar)}),(function(e,t){return(t-e)/Ar}),(function(e){return e.getUTCSeconds()}));Tr.range;var Lr=qr((function(e){e.setTime(Math.floor(e/Or)*Or)}),(function(e,t){e.setTime(+e+t*Or)}),(function(e,t){return(t-e)/Or}),(function(e){return e.getMinutes()}));Lr.range;var kr=qr((function(e){var t=e.getTimezoneOffset()*Or%Dr;t<0&&(t+=Dr),e.setTime(Math.floor((+e-t)/Dr)*Dr+t)}),(function(e,t){e.setTime(+e+t*Dr)}),(function(e,t){return(t-e)/Dr}),(function(e){return e.getHours()}));kr.range;var Rr=qr((function(e){e.setHours(0,0,0,0)}),(function(e,t){e.setDate(e.getDate()+t)}),(function(e,t){return(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Or)/Nr}),(function(e){return e.getDate()-1}));function Pr(e){return qr((function(t){t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)}),(function(e,t){e.setDate(e.getDate()+7*t)}),(function(e,t){return(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Or)/Ir}))}Rr.range;var $r=Pr(0),Fr=Pr(1),zr=Pr(2),_r=Pr(3),jr=Pr(4),Hr=Pr(5),Vr=Pr(6);$r.range,Fr.range,zr.range,_r.range,jr.range,Hr.range,Vr.range;var Br=qr((function(e){e.setDate(1),e.setHours(0,0,0,0)}),(function(e,t){e.setMonth(e.getMonth()+t)}),(function(e,t){return t.getMonth()-e.getMonth()+12*(t.getFullYear()-e.getFullYear())}),(function(e){return e.getMonth()}));Br.range;var Ur=qr((function(e){e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,t){e.setFullYear(e.getFullYear()+t)}),(function(e,t){return t.getFullYear()-e.getFullYear()}),(function(e){return e.getFullYear()}));Ur.every=function(e){return isFinite(e=Math.floor(e))&&e>0?qr((function(t){t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,n){t.setFullYear(t.getFullYear()+n*e)})):null},Ur.range;var Yr=qr((function(e){e.setUTCSeconds(0,0)}),(function(e,t){e.setTime(+e+t*Or)}),(function(e,t){return(t-e)/Or}),(function(e){return e.getUTCMinutes()}));Yr.range;var Wr=qr((function(e){e.setUTCMinutes(0,0,0)}),(function(e,t){e.setTime(+e+t*Dr)}),(function(e,t){return(t-e)/Dr}),(function(e){return e.getUTCHours()}));Wr.range;var Gr=qr((function(e){e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+t)}),(function(e,t){return(t-e)/Nr}),(function(e){return e.getUTCDate()-1}));function Xr(e){return qr((function(t){t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+7*t)}),(function(e,t){return(t-e)/Ir}))}Gr.range;var Kr=Xr(0),Jr=Xr(1),Zr=Xr(2),Qr=Xr(3),ei=Xr(4),ti=Xr(5),ni=Xr(6);Kr.range,Jr.range,Zr.range,Qr.range,ei.range,ti.range,ni.range;var ri=qr((function(e){e.setUTCDate(1),e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCMonth(e.getUTCMonth()+t)}),(function(e,t){return t.getUTCMonth()-e.getUTCMonth()+12*(t.getUTCFullYear()-e.getUTCFullYear())}),(function(e){return e.getUTCMonth()}));ri.range;var ii=qr((function(e){e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCFullYear(e.getUTCFullYear()+t)}),(function(e,t){return t.getUTCFullYear()-e.getUTCFullYear()}),(function(e){return e.getUTCFullYear()}));function oi(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 ai(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 si(e){return{y:e,m:0,d:1,H:0,M:0,S:0,L:0}}ii.every=function(e){return isFinite(e=Math.floor(e))&&e>0?qr((function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n*e)})):null},ii.range;var li,ui,ci,di={"-":"",_:" ",0:"0"},mi=/^\s*\d+/,fi=/^%/,pi=/[\\^$*+?|[\]().{}]/g;function hi(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",o=i.length;return r+(o<n?new Array(n-o+1).join(t)+i:i)}function gi(e){return e.replace(pi,"\\$&")}function yi(e){return new RegExp("^(?:"+e.map(gi).join("|")+")","i")}function vi(e){for(var t={},n=-1,r=e.length;++n<r;)t[e[n].toLowerCase()]=n;return t}function bi(e,t,n){var r=mi.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function xi(e,t,n){var r=mi.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function Mi(e,t,n){var r=mi.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function Si(e,t,n){var r=mi.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function Ei(e,t,n){var r=mi.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function Ci(e,t,n){var r=mi.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function qi(e,t,n){var r=mi.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function wi(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Ai(e,t,n){var r=mi.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function Oi(e,t,n){var r=mi.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Di(e,t,n){var r=mi.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function Ni(e,t,n){var r=mi.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Ii(e,t,n){var r=mi.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Ti(e,t,n){var r=mi.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Li(e,t,n){var r=mi.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function ki(e,t,n){var r=mi.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Ri(e,t,n){var r=fi.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Pi(e,t,n){var r=mi.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function $i(e,t,n){var r=mi.exec(t.slice(n));return r?(e.Q=1e3*+r[0],n+r[0].length):-1}function Fi(e,t){return hi(e.getDate(),t,2)}function zi(e,t){return hi(e.getHours(),t,2)}function _i(e,t){return hi(e.getHours()%12||12,t,2)}function ji(e,t){return hi(1+Rr.count(Ur(e),e),t,3)}function Hi(e,t){return hi(e.getMilliseconds(),t,3)}function Vi(e,t){return Hi(e,t)+"000"}function Bi(e,t){return hi(e.getMonth()+1,t,2)}function Ui(e,t){return hi(e.getMinutes(),t,2)}function Yi(e,t){return hi(e.getSeconds(),t,2)}function Wi(e){var t=e.getDay();return 0===t?7:t}function Gi(e,t){return hi($r.count(Ur(e),e),t,2)}function Xi(e,t){var n=e.getDay();return e=n>=4||0===n?jr(e):jr.ceil(e),hi(jr.count(Ur(e),e)+(4===Ur(e).getDay()),t,2)}function Ki(e){return e.getDay()}function Ji(e,t){return hi(Fr.count(Ur(e),e),t,2)}function Zi(e,t){return hi(e.getFullYear()%100,t,2)}function Qi(e,t){return hi(e.getFullYear()%1e4,t,4)}function eo(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+hi(t/60|0,"0",2)+hi(t%60,"0",2)}function to(e,t){return hi(e.getUTCDate(),t,2)}function no(e,t){return hi(e.getUTCHours(),t,2)}function ro(e,t){return hi(e.getUTCHours()%12||12,t,2)}function io(e,t){return hi(1+Gr.count(ii(e),e),t,3)}function oo(e,t){return hi(e.getUTCMilliseconds(),t,3)}function ao(e,t){return oo(e,t)+"000"}function so(e,t){return hi(e.getUTCMonth()+1,t,2)}function lo(e,t){return hi(e.getUTCMinutes(),t,2)}function uo(e,t){return hi(e.getUTCSeconds(),t,2)}function co(e){var t=e.getUTCDay();return 0===t?7:t}function mo(e,t){return hi(Kr.count(ii(e),e),t,2)}function fo(e,t){var n=e.getUTCDay();return e=n>=4||0===n?ei(e):ei.ceil(e),hi(ei.count(ii(e),e)+(4===ii(e).getUTCDay()),t,2)}function po(e){return e.getUTCDay()}function ho(e,t){return hi(Jr.count(ii(e),e),t,2)}function go(e,t){return hi(e.getUTCFullYear()%100,t,2)}function yo(e,t){return hi(e.getUTCFullYear()%1e4,t,4)}function vo(){return"+0000"}function bo(){return"%"}function xo(e){return+e}function Mo(e){return Math.floor(+e/1e3)}!function(e){li=function(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,o=e.days,a=e.shortDays,s=e.months,l=e.shortMonths,u=yi(i),c=vi(i),d=yi(o),m=vi(o),f=yi(a),p=vi(a),h=yi(s),g=vi(s),y=yi(l),v=vi(l),b={a:function(e){return a[e.getDay()]},A:function(e){return o[e.getDay()]},b:function(e){return l[e.getMonth()]},B:function(e){return s[e.getMonth()]},c:null,d:Fi,e:Fi,f:Vi,H:zi,I:_i,j:ji,L:Hi,m:Bi,M:Ui,p:function(e){return i[+(e.getHours()>=12)]},Q:xo,s:Mo,S:Yi,u:Wi,U:Gi,V:Xi,w:Ki,W:Ji,x:null,X:null,y:Zi,Y:Qi,Z:eo,"%":bo},x={a:function(e){return a[e.getUTCDay()]},A:function(e){return o[e.getUTCDay()]},b:function(e){return l[e.getUTCMonth()]},B:function(e){return s[e.getUTCMonth()]},c:null,d:to,e:to,f:ao,H:no,I:ro,j:io,L:oo,m:so,M:lo,p:function(e){return i[+(e.getUTCHours()>=12)]},Q:xo,s:Mo,S:uo,u:co,U:mo,V:fo,w:po,W:ho,x:null,X:null,y:go,Y:yo,Z:vo,"%":bo},M={a:function(e,t,n){var r=f.exec(t.slice(n));return r?(e.w=p[r[0].toLowerCase()],n+r[0].length):-1},A:function(e,t,n){var r=d.exec(t.slice(n));return r?(e.w=m[r[0].toLowerCase()],n+r[0].length):-1},b:function(e,t,n){var r=y.exec(t.slice(n));return r?(e.m=v[r[0].toLowerCase()],n+r[0].length):-1},B:function(e,t,n){var r=h.exec(t.slice(n));return r?(e.m=g[r[0].toLowerCase()],n+r[0].length):-1},c:function(e,n,r){return C(e,t,n,r)},d:Oi,e:Oi,f:ki,H:Ni,I:Ni,j:Di,L:Li,m:Ai,M:Ii,p:function(e,t,n){var r=u.exec(t.slice(n));return r?(e.p=c[r[0].toLowerCase()],n+r[0].length):-1},Q:Pi,s:$i,S:Ti,u:xi,U:Mi,V:Si,w:bi,W:Ei,x:function(e,t,r){return C(e,n,t,r)},X:function(e,t,n){return C(e,r,t,n)},y:qi,Y:Ci,Z:wi,"%":Ri};function S(e,t){return function(n){var r,i,o,a=[],s=-1,l=0,u=e.length;for(n instanceof Date||(n=new Date(+n));++s<u;)37===e.charCodeAt(s)&&(a.push(e.slice(l,s)),null!=(i=di[r=e.charAt(++s)])?r=e.charAt(++s):i="e"===r?" ":"0",(o=t[r])&&(r=o(n,i)),a.push(r),l=s+1);return a.push(e.slice(l,s)),a.join("")}}function E(e,t){return function(n){var r,i,o=si(1900);if(C(o,e,n+="",0)!=n.length)return null;if("Q"in o)return new Date(o.Q);if("p"in o&&(o.H=o.H%12+12*o.p),"V"in o){if(o.V<1||o.V>53)return null;"w"in o||(o.w=1),"Z"in o?(i=(r=ai(si(o.y))).getUTCDay(),r=i>4||0===i?Jr.ceil(r):Jr(r),r=Gr.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(i=(r=t(si(o.y))).getDay(),r=i>4||0===i?Fr.ceil(r):Fr(r),r=Rr.offset(r,7*(o.V-1)),o.y=r.getFullYear(),o.m=r.getMonth(),o.d=r.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),i="Z"in o?ai(si(o.y)).getUTCDay():t(si(o.y)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(i+5)%7:o.w+7*o.U-(i+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,ai(o)):t(o)}}function C(e,t,n,r){for(var i,o,a=0,s=t.length,l=n.length;a<s;){if(r>=l)return-1;if(37===(i=t.charCodeAt(a++))){if(i=t.charAt(a++),!(o=M[i in di?t.charAt(a++):i])||(r=o(e,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return b.x=S(n,b),b.X=S(r,b),b.c=S(t,b),x.x=S(n,x),x.X=S(r,x),x.c=S(t,x),{format:function(e){var t=S(e+="",b);return t.toString=function(){return e},t},parse:function(e){var t=E(e+="",oi);return t.toString=function(){return e},t},utcFormat:function(e){var t=S(e+="",x);return t.toString=function(){return e},t},utcParse:function(e){var t=E(e,ai);return t.toString=function(){return e},t}}}(e),li.format,li.parse,ui=li.utcFormat,ci=li.utcParse}({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"]});var So="%Y-%m-%dT%H:%M:%S.%LZ";Date.prototype.toISOString||ui(So),+new Date("2000-01-01T00:00:00.000Z")||ci(So);var Eo=1e3,Co=60*Eo,qo=60*Co,wo=24*qo,Ao=7*wo,Oo=30*wo,Do=365*wo;function No(e){return new Date(e)}function Io(e){return e instanceof Date?+e:+new Date(+e)}function To(e,t,n,r,i,o,a,s,l){var u=or(Qn,Qn),c=u.invert,d=u.domain,m=l(".%L"),f=l(":%S"),p=l("%I:%M"),h=l("%I %p"),g=l("%a %d"),y=l("%b %d"),v=l("%B"),b=l("%Y"),x=[[a,1,Eo],[a,5,5*Eo],[a,15,15*Eo],[a,30,30*Eo],[o,1,Co],[o,5,5*Co],[o,15,15*Co],[o,30,30*Co],[i,1,qo],[i,3,3*qo],[i,6,6*qo],[i,12,12*qo],[r,1,wo],[r,2,2*wo],[n,1,Ao],[t,1,Oo],[t,3,3*Oo],[e,1,Do]];function M(s){return(a(s)<s?m:o(s)<s?f:i(s)<s?p:r(s)<s?h:t(s)<s?n(s)<s?g:y:e(s)<s?v:b)(s)}function S(t,n,r,i){if(null==t&&(t=10),"number"==typeof t){var o=Math.abs(r-n)/t,a=xt((function(e){return e[2]})).right(x,o);a===x.length?(i=wt(n/Do,r/Do,t),t=e):a?(i=(a=x[o/x[a-1][2]<x[a][2]/o?a-1:a])[1],t=a[0]):(i=Math.max(wt(n,r,t),1),t=s)}return null==i?t:t.every(i)}return u.invert=function(e){return new Date(c(e))},u.domain=function(e){return arguments.length?d(kt.call(e,Io)):d().map(No)},u.ticks=function(e,t){var n,r=d(),i=r[0],o=r[r.length-1],a=o<i;return a&&(n=i,i=o,o=n),n=(n=S(e,i,o,t))?n.range(i,o+1):[],a?n.reverse():n},u.tickFormat=function(e,t){return null==t?M:l(t)},u.nice=function(e,t){var n=d();return(e=S(e,n[0],n[n.length-1],t))?d(function(e,t){var n,r=0,i=(e=e.slice()).length-1,o=e[r],a=e[i];return a<o&&(n=r,r=i,i=n,n=o,o=a,a=n),e[r]=t.floor(o),e[i]=t.ceil(a),e}(n,e)):u},u.copy=function(){return ir(u,To(e,t,n,r,i,o,a,s,l))},u}function Lo(){return At.apply(To(ii,ri,Kr,Gr,Wr,Yr,Tr,wr,ui).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}const ko={horizontal:{major:"width",minor:"height",start:"left",end:"right",shadow:{startOffset:"12px 0",endOffset:"-12px 0"}},vertical:{major:"height",minor:"width",start:"top",end:"bottom",shadow:{startOffset:"0 12px",endOffset:"0 -12px"}}},Ro=e=>`${e} 12px -12px inset rgba(0, 0, 0, 0.0625)`;var Po={defaultSettings:{settings:{orientation:"horizontal",rtl:!1,range:()=>[0,1]}},renderer:"dom",render(e){const{range:t,orientation:n,rtl:r}=this.settings.settings,[i,o]=t(),a=Math.abs(i)<1e-15,s=Math.abs(o-1)<1e-15,l=(e=>{const t=ko[e];return{base:{position:"absolute",[t.major]:12,[t.minor]:"100%"},towardsStart:{[t.start]:0,[t.end]:"auto",boxShadow:Ro(t.shadow.startOffset)},towardsEnd:{[t.start]:"auto",[t.end]:0,boxShadow:Ro(t.shadow.endOffset)}}})(n),u="horizontal"===n&&r,c=[];return a||c.push(e("div",{style:{...l.base,...u?l.towardsEnd:l.towardsStart},class:"scroll-hint--towards-start"})),s||c.push(e("div",{style:{...l.base,...u?l.towardsStart:l.towardsEnd},class:"scroll-hint--towards-end"})),c}};function $o({viewState:e,viewCache:t,layoutService:n,dockService:r,rtl:i}){return!n.meta.isSnapshot&&{key:"scroll-hint",type:"scroll-hint",settings:{orientation:r.meta.major.orientation,rtl:i,range:()=>function({layoutService:e,viewState:t,viewCache:n}){return e.meta.isContinuous?function(e,t){const n=e.get("zoom"),r=t.get("continuousMin"),i=t.get("continuousMax");return[(n.min-r)/(i-r),(n.max-r)/(i-r)]}(t,n):function(e){return e.get("viewRange")}(t)}({layoutService:n,viewState:e,viewCache:t})}}}let Fo;function zo(){Fo=Fo||document.createElement("canvas").getContext("2d")}const _o={measureTextWidth(e){zo();const{width:t}=Fo.measureText(e);return t},lineWrap(e,t,n,r){let i,o;zo();const a=e?e.split(/\n+|\r+|\r\n/):[],s=[];let l,u,c,d,m=e?e.split(/\s+/):[],f=a[0];if("number"!=typeof t||t<=0)return[e];if("number"==typeof r&&a.length>=r)return a.slice(0,r);for(n&&(Fo.font=n),o=0;o<a.length;o++){for(d=a[o]||"",m=d.split(/\s+/),[f]=m,c="",i=1;i<m.length;i++)if(l=`${f} ${m[i]}`,u=_o.measureTextWidth(l),u>t&&("number"!=typeof r||r>s.length)?(s.push(f),f=m[i]):f=l,"number"==typeof r&&s.length>=r){c=m.slice(i+1).join(" ");break}"number"!=typeof r||s.length<r?s.push(f):s[Math.max(0,s.length-1)]=`${s[Math.max(0,s.length-1)]||""} ${f} ${c}`}return s},wordWrap(e,t,n,r,i){if(zo(),!e||!e.length)return[];n&&(Fo.font=n);let o=[];const a=e.slice();let s,l,u,c;if(a.filter((e=>!!e)),"number"!=typeof t||t<0)return e.slice();for(c=0;c<a.length;c++)u=a[c],l=null,u&&(u.length<=1||_o.measureTextWidth(u)<=t?o.push(u):(s=_o.splitWord(u,t,void 0,r-o.length),s.length<=1?o.push(s[0]):(l=s.pop(),o=o.concat(s),a[c+1]?_o.measureTextWidth(`${l} ${a[c+1]}`)>t&&o.length+a.length-c<=r?a.splice(c+1,0,l):a[c+1]=`${l} ${a[c+1]}`:a.push(l))));return o.forEach(((e,t,n)=>{n[t]=e?e.trim():e})),o.length>r?(o=o.splice(0,r),o[o.length-1]=_o.truncate(o[o.length-1],t,n,i).text):(u=o[o.length-1],u&&u.length>1&&_o.measureTextWidth(u)>t&&(o[o.length-1]=_o.truncate(u,t,n,i).text)),o},truncate(e,t,n,r="…"){zo();let i,o,a,s,l=e;const u=_o.measureTextWidth("i"),c=Math.ceil(t/u);if(n&&(Fo.font=n),e&&t){if(_o.measureTextWidth(l)>t){for(i=Math.min(c,l.length);i>0;i--)if(o=l.substring(0,i-1),a=o.trim()+r,_o.measureTextWidth(a)<=t){s=l.substring(i-1),l=a;break}i||(s=l,l="…")}}else s=void 0;return{text:l,rest:s}},isNumber:e=>"number"==typeof e&&Number.isFinite(e),explodeWord(e,t,n,r){let i;zo();let o,a=e,s="",l=[];if(_o.isNumber(n)&&n<=1)return[e];const u=Math.ceil(t/r);for(i=Math.min(e.length,u);i>0&&(a=e.substring(0,i),o=e.substring(i-1,i)," "===o?a=e.substring(0,i-1):a+="-",s=e.substring(i),!(_o.measureTextWidth(a)<=t));i--);return(!i&&!a||_o.measureTextWidth(a)>t)&&(a=e.substring(0,1),s=e.substring(1)),l.push(a),s?(_o.measureTextWidth(s)>t?(s=_o.explodeWord(s,t,n-1,r),l=l.concat(s)):l.push(s),l.filter((e=>""!==e.trim()))):l},splitWord:(e,t,n,r)=>(zo(),e&&t?(n&&(Fo.font=n),_o.explodeWord(e,t,r,Math.max(1,_o.measureTextWidth("i")))):[]),wrapText(e,t,n,r,i){let o;return Number.isNaN(t)?[e]:(o=r>1?_o.lineWrap(e,t,n,r):[e],o=_o.wordWrap(o,t,n,r,i),o)},getFontHeight:e=>(zo(),e&&(Fo.font=e),1.5*_o.measureTextWidth("m")),tokenize(e,t,n,r,i,o,a=1){zo(),t&&(Fo.font=t);const s=_o.getFontHeight(),l=a*s;let u=[],c=0,d=[];if(o<s)return[];const m=o?Math.max(1,Math.floor(o/l)):r||1;return Array.isArray(r)?(r.forEach((e=>{c+=Number.isNaN(e)||e<=0?0:e})),r.forEach((e=>{u.push(Number.isNaN(e)||e<=0?m-c:e)}))):u=[Number.isNaN(r)||r<=0?m:Math.min(m,r)],Array.isArray(e)?e.forEach(((e,n)=>{d.length<m&&(d=d.concat(_o.wrapText(e,i,t,u[n])))})):d=_o.wrapText(e,i,t,u[0],n),d}},jo={getDefaultSettings:({size:e=10,fill:t="#999",alignment:n}={})=>({show:!0,type:"n-polygon",fill:t,stroke:"#000",strokeWidth:0,size:e,sides:3,startAngle:-90,alignment:n}),createOob({oob:e,dockValue:t,boxCenter:n,rendWidth:r,rendHeight:i,flipXY:o,symbol:a}){let s="x",l="y",u=r,c=i,d=t<.5?90:-90;return o&&(s="y",l="x",u=i,c=r,d=t<.5?180:0),a(G({},e,{[s]:n*u,[l]:Math.max(e.size/2,Math.min(t*c,c-e.size/2)),startAngle:d}))}},Ho=G.bind(null,!0),Vo={},{isArray:Bo}=Array;function Uo(e){return null!=e&&!Array.isArray(e)&&"object"==typeof e}function Yo(e){return void 0===e}function Wo(e,t){return function(e){return"function"==typeof e}(e[t])||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function Go(e,t){const n=t.substring(1).split("/").slice(0,-1);let r;return n.forEach(((t,i)=>{if(i===n.length)return;r=+t;const o=isNaN(r)?{}:[];e[r||t]=Yo(e[r||t])?o:e[t],e=e[r||t]})),e}function Xo(e,t){let n=!0;if(Uo(e)&&Uo(t))return Object.keys(e).length===Object.keys(t).length&&(Object.keys(e).forEach((r=>{Xo(e[r],t[r])||(n=!1)})),n);if(Bo(e)&&Bo(t)){if(e.length!==t.length)return!1;for(let n=0,r=e.length;n<r;n+=1)if(!Xo(e[n],t[n]))return!1;return!0}return e===t}Vo.generate=function(e,t,n){n=n||"";let r=[];return Object.keys(t).forEach((i=>{const o=function(e){return e?Ho({},{val:e}).val:e}(t[i]),a=e[i],s=`${n}/${i}`;Xo(o,a)||Wo(t,i)||(Yo(a)?r.push({op:"add",path:s,value:o}):Uo(o)&&Uo(a)?r=r.concat(Vo.generate(a,o,s)):Bo(o)&&Bo(a)?r=r.concat(function(e,t,n){let r=[];const i=e.slice();let o=-1;function a(e,t,n){if(e[n]&&Yo(e[n].qInfo))return null;if(e[n]&&e[n].qInfo.qId===t)return n;for(let n=0,r=e.length;n<r;n+=1)if(e[n]&&e[n].qInfo.qId===t)return n;return-1}if(Xo(t,i))return r;if(!Yo(t[0])&&Yo(t[0].qInfo)||0===t.length)return r.push({op:"replace",path:n,value:t}),r;for(let e=i.length-1;e>=0;e-=1)o=a(t,i[e].qInfo&&i[e].qInfo.qId,e),-1===o?(r.push({op:"remove",path:`${n}/${e}`}),i.splice(e,1)):r=r.concat(Vo.generate(i[e],t[o],`${n}/${e}`));for(let e=0,s=t.length;e<s;e+=1)o=a(i,t[e].qInfo&&t[e].qInfo.qId),-1===o?(r.push({op:"add",path:`${n}/${e}`,value:t[e]}),i.splice(e,0,t[e])):o!==e&&(r.push({op:"move",path:`${n}/${e}`,from:`${n}/${o}`}),i.splice(e,0,i.splice(o,1)[0]));return r}(a,o,s)):r.push({op:"replace",path:`${n}/${i}`,value:o}))})),Object.keys(e).forEach((i=>{Yo(t[i])&&!Wo(e,i)&&r.push({op:"remove",path:`${n}/${i}`})})),r},Vo.apply=function(e,t){t.forEach((t=>{let n=Go(e,t.path),r=t.path.split("/").splice(-1)[0],i=r&&isNaN(+r)?n[r]:n[+r]||n;const o=t.from?t.from.split("/").splice(-1)[0]:null;if("/"===t.path&&(n=null,i=e),"add"===t.op||"replace"===t.op)if(Bo(n))"-"===r&&(r=n.length),n.splice(+r,"add"===t.op?0:1,t.value);else if(Bo(i)&&Bo(t.value)){const e=t.value.slice();i.length=0,i.push(...e)}else if(Uo(i)&&Uo(t.value))a=i,Object.keys(a).forEach((e=>{Object.getOwnPropertyDescriptor(a,e).configurable&&!Wo(a,e)&&delete a[e]})),Ho(i,t.value);else{if(!n)throw new Error("Patchee is not an object we can patch");n[r]=t.value}else if("move"===t.op){const i=Go(e,t.from);Bo(n)?n.splice(+r,0,i.splice(+o,1)[0]):(n[r]=i[o],delete i[o])}else"remove"===t.op&&(Bo(n)?n.splice(+r,1):delete n[r]);var a}))},Vo.clone=function(e){return Ho({},e)},Vo.createPatch=function(e,t,n){const r={op:e.toLowerCase(),path:n};return"move"===r.op?r.from=t:void 0!==t&&(r.value=t),r},Vo.updateObject=function(e,t){Object.keys(e).length?Vo.apply(e,Vo.generate(e,t)):Ho(e,t)};const Ko=[[2,4,6],[2,4],[3]],Jo=[,[,,[[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 Zo(e,t,n){const r=e?e.length:0;let i,o=void 0===t?Number.MAX_VALUE:e[0]/t;for(i=1;i<r;i++)o=Math.min(o,e[i]/e[i-1]);void 0!==n&&(o=Math.min(o,n/e[r-1])),e.splice(0,0,o)}function Qo(e,t,n){let r;const i=e?e.length:0;for(r=0;r<i;r++)Zo(e[r],t,n)}!function(){let e,t;for(Qo(Ko,1,10),e=0;e<Jo.length;e++)if(Jo[e])for(t=0;t<Jo[e].length;t++)Array.isArray(Jo[e][t])&&Qo(Jo[e][t])}();const ea={isInside(e,t,n,r){if(!r)return!0;const i=e.position-e.radius,o=e.position+e.radius;return i>=t&&o<=n},getCenterDistance:(e,t)=>Math.abs(e.center-t.center),getGap(e,t){const n=e.position<t.position?e:t,r=e.position<t.position?t:e;return r.position-r.radius-(n.position+n.radius)},findSegmentPositionMeetMax(e,t){const n=Math.max(0,e.max-t);return e.center-n},findSegmentPositionMeetMin(e,t){const n=Math.max(0,t-e.min);return e.center+n},findSegmentPositionMeetMinThenMax(e,t,n){const r=ea.findSegmentPositionMeetMin(e,t);return ea.findSegmentPositionMeetMax({center:r,max:r+e.radius},n)},findSegmentPositionMeetMaxThenMin(e,t,n){const r=ea.findSegmentPositionMeetMax(e,n);return ea.findSegmentPositionMeetMin({center:r,min:r-e.radius},t)},layoutPositionFromMin(e,t,n,r=0){const i=e.length-1;let o,a,s=t;for(let t=0;t<i;t++)o=e[t],a=e[t+1],o.position=ea.findSegmentPositionMeetMaxThenMin(o,s,(o.center+a.center-r)/2),s=o.position+o.radius+r/2;a.position=ea.findSegmentPositionMeetMaxThenMin(a,s,n)},adjustPositionFromMax(e,t,n,r=0){const i=e.length-1;let o,a,s;const l=Math.max(0,e[i].position+e[i].radius-n);if(0===l)return;let u,c=0;for(o=i;o>0&&(a=e[o],s=e[o-1],u=Math.max(0,ea.getGap(s,a)-r),u-=Math.max(0,c+u-l),c+=u,a.move=u,!(c>=l));o--);for(c<l&&(u=Math.max(0,s.position-s.radius-t),u-=Math.max(0,c+u-l),c+=u,s.move=u),c=0,o=0;o<=i;o++)a=e[o],c+=a.move||0,a.move=c,a.position-=c},layout(e,t,n,r=0){const i=e.length-1;if(!(i<0))if(0!==i)ea.layoutPositionFromMin(e,t,n,r),ea.adjustPositionFromMax(e,t,n,r);else{const r=e[0];r.position=ea.findSegmentPositionMeetMaxThenMin(r,t,n)}}},ta=(e,t,n,r=1)=>{const i=e.bandwidth();return n?"start"===t?i:"end"===t?i*(1-r):i*(2-r)/2:"start"===t?0:"end"===t?i*r:i*r/2},na=e=>!1!==e.show&&0!==e.show&&"0"!==e.show,ra=e=>e.filter(na),ia=(e,t)=>ra(oe.getValue(e,t,[])),oa=e=>na(e)&&(!1!==e.showValue||!1!==e.showLabel),aa=e=>e.filter(oa),sa=(e,t)=>aa(oe.getValue(e,t,[])),la=({refLineLayout:e,layoutService:t})=>t.meta.canBeContinuous?e.refLineExpr.value:e.refLineExpr.stringValue,ua=(e,t,n)=>{const{dimensionRefLineInfo:r}=t;if(r[e])return r[e][n]},ca=({label:e,dataPages:t})=>{const{qArea:n={}}=t||{},{qTop:r,qHeight:i}=n;return void 0!==r&&void 0!==i&&void 0!==e.valueInfo&&e.valueInfo.maxOrder<r},da=({label:e,dataPages:t})=>{const{qArea:n={}}=t||{},{qTop:r,qHeight:i}=n;return void 0!==r&&void 0!==i&&void 0!==e.valueInfo&&e.valueInfo.minOrder>=r+i},ma=({value:e,qMin:t})=>"NaN"!==t&&e<t,fa=({value:e,qMax:t})=>"NaN"!==t&&e>t,pa={isRefLineVisible:na,getVisibleRefLines:ra,getRefLines:ia,getMeasureRefLines:e=>ia(e,"refLine.refLines"),getDimensionRefLines:(e,t)=>t?[]:ia(e,"refLine.dimRefLines"),isRefLineLabelVisible:oa,getVisibleRefLineLabels:aa,getRefLineLabels:sa,getMeasureRefLineLabels:e=>sa(e,"refLine.refLines"),getDimensionRefLineLabels:(e,t)=>t?[]:sa(e,"refLine.dimRefLines"),getScaledPosition:({scale:e,size:t,value:n,valueInfo:r,align:i,invert:o=!1,layoutService:a,isContinuous:s})=>{if(!s){const s=e.pxScale(t);let l;if(a.meta.isGroupedByMeasure)return l=ta(s,i,o,a.meta.measureCount),s([n,0])+l;if(a.meta.isGroupedByDimension){if(!r)return NaN;const{innerValues:e,numInnerValues:t,minOrder:a}=r;let u;return l=ta(s,i,o,t),e&&e.length&&(u=(({pxScale:e,value:t,innerValues:n,invert:r,minOrder:i})=>{const o=(({pxScale:e,invert:t})=>e.bandwidth()*(t?-1:1))({pxScale:e,invert:r});for(let r=0;r<n.length;r++){const{id:a,order:s}=n[r],l=e([t,a]);if(void 0!==l)return l-o*(s-i)}})({pxScale:s,value:n,innerValues:e,invert:o,minOrder:a})),(void 0===u?s(n):u)+l}return l=ta(s,i,o),s(n)+l}return e(n)},getDimensionValuesInfo:({layout:e,canBeContinuous:t,discreteModel:n,layoutService:r})=>{const{isGroupedByDimension:i}=r.meta,o={},a=oe.getValue(e,"qHyperCube"),s="K"===a.qMode,l=n?n.query.getCurrentDataPage():oe.getValue(a,"S"===a.qMode?"qDataPages.0":"qStackedDataPages.0",[]);const u=s?"qData.0.qSubNodes":"qMatrix",c=oe.getValue(l,u,[]),d=((e,t)=>e?t?"qValue":"qNum":"qText")(t,s),m=(e=>e.qArea.qTop)(l);return s?(()=>{for(let e=0;e<c.length;e++){const t=c[e],n=e+m,r=t[d];o[r]||(o[r]={id:t.qElemNo,qText:t.qText,minOrder:n,maxOrder:n})}})():i?(()=>{let e;for(let t=0;t<c.length;t++){const n=c[t][0],r=c[t][1],i=t+m,a=n[d];o[a]?(o[a].minOrder=Math.min(o[a].minOrder,i),o[a].maxOrder=Math.max(o[a].maxOrder,i),o[a].innerValues[o[a].innerValues.length]={id:r.qElemNumber,order:i}):o[a]={id:n.qElemNumber,qText:n.qText,minOrder:i,maxOrder:i,innerValues:[{id:r.qElemNumber,order:i}]},0===t?0===i&&(o[a].isMinOrderOk=!0):a!==e&&(o[a].isMinOrderOk=!0,o[e].isMaxOrderOk=!0),e=a}})():(()=>{for(let e=0;e<c.length;e++){const t=c[e][0],n=e+m,r=t[d];o[r]||(o[r]={id:t.qElemNumber,qText:t.qText,minOrder:n,maxOrder:n})}})(),o},getInputValue:la,extractInfoFromInputValue:ua,resolveValue:({refLineLayout:e,refLineModel:t,layoutService:n})=>{const r=la({refLineLayout:e,layoutService:n});return ua(r,t,"id")},isDiscreteMinOutOfBounds:ca,isDiscreteMaxOutOfBounds:da,isContinuousMinOutOfBounds:ma,isContinuousMaxOutOfBounds:fa,isOutOfRange:({value:e,qMin:t,qMax:n})=>ma({value:e,qMin:t})||fa({value:e,qMax:n}),isOutOfDataPages:({label:e,dataPages:t})=>e.valueInfo.isMinOrderOk&&da({label:e,dataPages:t})||e.valueInfo.isMaxOrderOk&&ca({label:e,dataPages:t}),getInvert:({orientation:e,rtl:t,isContinuous:n})=>"horizontal"===e?t:n},ha="…";function ga(e,t,n=70){for(let r=0;r<e.length;r++){const i=e[r];i.lines=_o.tokenize(i.title,t,`${ha} ${i.valueString}`,3,n),i.maxNumLines=i.lines.length}}function ya({title:e,font:t,ellipsis:n,maxNumLines:r=5,maxWidth:i=200}){const o=_o.tokenize(e,t,n,r,i),a=o.length;let s="";if(a){[s]=o;for(let e=1;e<a;e++)s=`${s}\n${o[e]}`}return s}function va({oobs:e,font:t,ellipsis:n,maxNumLines:r=5,maxWidth:i=200}){const o=e.map((e=>ya({title:e.title,font:t,ellipsis:`${n} ${e.valueString}`,maxNumLines:r,maxWidth:i}))),a=o.length;let s="";if(a){[s]=o;for(let e=1;e<a;e++)s=`${s}\n\n${o[e]}`}return s}function ba(e,t="value"){e.sort(((e,n)=>e[t]-n[t]))}const xa=3,Ma=2;function Sa({inputValue:e,inputValueLabel:t,localeInfo:n}){if(void 0===e||void 0===t||e.toString()===t)return!1;if(!n)return!0;const r=`+-${n.qDecimalSep||""}${n.qThousandSep||""}`.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&");return t.replace(new RegExp(`[0-9e${r}]`,"g"),"").length>0||function(e){if(e.indexOf("e")>-1)return!1;const t=e.indexOf("-");return-1!==t&&(e.lastIndexOf("-")!==t||0!==t)}(t)}const Ea=({label:e,dataPages:t,qMin:n,qMax:r})=>{if(void 0!==n&&void 0!==r){const{inputValue:t}=e;if(pa.isContinuousMaxOutOfBounds({value:t,qMax:r}))return 1;if(pa.isContinuousMinOutOfBounds({value:t,qMin:n}))return-1}return pa.isDiscreteMaxOutOfBounds({label:e,dataPages:t})?1:pa.isDiscreteMinOutOfBounds({label:e,dataPages:t})?-1:0},Ca={hasEngineFormat:Sa,calculateLabelPositions({labels:e,scale:t,size:n,layoutService:r,orientation:i,rtl:o,isContinuous:a,isDimension:s}){const l=pa.getInvert({orientation:i,rtl:o,isContinuous:a}),u="S"===r.getHyperCubeValue("qMode")?"qDataPages.0":"qStackedDataPages.0",c=r.getHyperCubeValue(u),{canBeContinuous:d}=r.meta;let m,f;if(s&&d){const e=r.getLayoutValue("qHyperCube.qDimensionInfo.0");m=e.qMin,f=e.qMax}for(let i=0;i<e.length;i++){const o=e[i],{value:s,align:u,valueInfo:d}=o,p=Ea({label:o,dataPages:c,qMin:m,qMax:f});o.scaledValue=1===p?l?-.1:1.1:-1===p?l?1.1:-.1:pa.getScaledPosition({scale:t,size:n,value:s,valueInfo:d,align:u,invert:l,layoutService:r,isContinuous:a}),o.center=o.scaledValue*n}},getTitle:e=>!1!==e.showValue?!1!==e.showLabel?`${e.text} ${e.valueString}`:e.valueString:!1!==e.showLabel?e.text:"",addLabelTitles({labels:e,formatter:t,isContinuous:n,canBeContinuous:r,localeInfo:i}){let o;if(n)for(let n=0;n<e.length;n++){const r=e[n],{value:a,inputValue:s,inputValueLabel:l}=r;o=Sa({inputValue:s,inputValueLabel:l,localeInfo:i})?l:t?t(a):a,r.valueString=`${ye.lrm}(${o})${ye.lrm}`,r.title=Ca.getTitle(r)}else if(r)for(let t=0;t<e.length;t++){const n=e[t],{valueText:r,inputValue:a,inputValueLabel:s}=n;o=Sa({inputValue:a,inputValueLabel:s,localeInfo:i})?s:r,n.valueString=`${ye.lrm}(${o})${ye.lrm}`,n.title=Ca.getTitle(n)}else for(let t=0;t<e.length;t++){const n=e[t];o=n.valueText,n.valueString=`${ye.lrm}(${o})${ye.lrm}`,n.title=Ca.getTitle(n)}},measureLabelsWidth(e,t){for(let n=0;n<e.length;n++){const r=e[n];r.totalWidth=t(r.title).width}},measureLabelMaxLineWidth:(e,t)=>Math.max(...e.lines.map((e=>t(e).width))),getMaxTextWidth(e){const t=e.map((e=>e.totalWidth));return Math.max(...t)},addLabelsNeighborInfo(e,t,n,r=0){const i=e.length-1;if(i<0)return;let o,a;if([o]=e,o.cMin=t,0!==i){for(let t=0;t<i;t++)o=e[t],a=e[t+1],o.cMax=(o.center+a.center-r)/2,a.cMin=o.cMax+r;a.cMax=n}else o.cMax=n},getTotalNumLines(e){let t=0;return e.forEach((e=>{t+=e.maxNumLines})),t},reduceLabelsHavingMaxNumLines(e,t,n){const r=t-1,i=e.filter((e=>e.maxNumLines===t)),o=Math.min(n,i.length);for(let e=i.length-1;e>=i.length-o;e--)i[e].maxNumLines=r},reduceTotalMaxNumLines(e,t,n){const r=Math.floor(n/t);let i=3;do{const t=Ca.getTotalNumLines(e)-r;if(t<=0)return;Ca.reduceLabelsHavingMaxNumLines(e,i,t),i--}while(i>1)},reduceMaxNumLines(e,t,n=0){for(let r=0;r<e.length;r++){const i=e[r];i.maxNumLines=Math.max(1,Math.min(i.maxNumLines,Math.floor((Math.max(0,i.cMax-i.cMin)+n)/t)))}},addLabelsSize(e,t,n=15,r){for(let i=0;i<e.length;i++){const o=e[i];o.width=Math.min(t,Ca.measureLabelMaxLineWidth(o,r)),o.height=o.lines.length*n}},addLabelSegments(e,t){for(let n=0;n<e.length;n++){const r=e[n],{center:i}=r,o=r[t],a=o/2;r.segment={center:i,range:o,min:i-a,max:i+a,radius:a}}},addLabelsInfo({labels:e,scale:t,majorSize:n,lowerLimit:r,upperLimit:i,gap:o,font:a,maxLabelWidth:s,lineHeight:l,majorDimension:u,orientation:c,measureText:d,rtl:m,layoutService:f,isContinuous:p,isDimension:h}){const g=e.map((e=>e)),y=n;Ca.calculateLabelPositions({labels:e,scale:t,size:y,layoutService:f,orientation:c,rtl:m,isContinuous:p,isDimension:h}),ba(e,"center"),Ca.addLabelsNeighborInfo(e,r,i,o),ga(e,a,s),Ca.reduceTotalMaxNumLines(g,l,i-(g.length-1)*o),"vertical"===c&&(Ca.reduceMaxNumLines(e,l,.05*o),function(e,t,n=70){for(let r=0;r<e.length;r++){const i=e[r];i.lines.length>i.maxNumLines&&(i.lines=_o.tokenize(i.title,t,`${ha} ${i.valueString}`,i.maxNumLines,n))}}(e,a,s)),Ca.addLabelsSize(e,s,l,d),Ca.addLabelSegments(e,u)},createLabels({labels:e,style:t,maxLabelWidth:n,areaProps:r,area:i,lineHeight:o=15,font:a}){const{majorAxis:s,minorAxis:l,dock:u}=r,{minorCenter:c}=i,{fontSize:d,fontFamily:m,background:f}=t;let p=[];return e.forEach((e=>{const{lines:t}=e,r=t.length,i=t.map(((t,i)=>{const f={type:"text",text:t,title:ya({title:e.title,font:a,ellipsis:`… ${e.valueString}`}),dx:0,dy:0,maxWidth:n,width:n,fontSize:d,fontFamily:m,fill:e.fill,baseline:"central",anchor:"middle",value:e.value,dock:u};return f[l]=c,f[s]=e.segment.position,f.y+=(i-(r-1)/2)*o,f}));e.background&&p.push(function({minorCenter:e,majorAxis:t,minorAxis:n,dock:r,label:i,lineHeight:o,background:a}){const{lines:s}=i,{borderRadius:l=xa,padding:u={}}=a,{top:c=Ma,bottom:d=Ma,left:m=Ma,right:f=Ma}=u,p=s.length,h={type:"rect",rx:l,ry:l,fill:i.background.fill,width:i.width+(m+f),height:i.height+(c+d),value:i.value,dock:r};return h[n]=e,h[t]=i.segment.position,h.x-=i.width/2+m,h.y-=p*o/2+c,h}({minorCenter:c,majorAxis:s,minorAxis:l,dock:u,label:e,lineHeight:o,background:f})),p=p.concat(i)})),p}};function qa(e,t,n){let r;const i=typeof t;if("string"===i||"object"===i)r=e.formatter(t);else if(void 0!==n&&n.data){const e=n.data()&&n.data().fields;r=e&&e[0]?e[0].formatter():null}return r}function wa(e,t,n){return"top"===e||"bottom"===e?function(e,t){const{font:n,lineHeight:r,top:i,bottom:o,maxLabelWidth:a}=t;let s=1;return Ca.getMaxTextWidth(e)>a&&(ga(e,n,a),s=Math.max(...e.map((e=>e.lines.length)))),s*r+i+o}(t,n):function(e,t){const{left:n,right:r,maxLabelWidth:i}=t;return Math.min(i,Ca.getMaxTextWidth(e))+n+r}(t,n)}function Aa(e,t){return t?e.domain():[0,1]}function Oa(e,t,n,r="value"){let i=e.filter((e=>e[r]>=t));i=i.filter((e=>e[r]<=n));const o=e.filter((e=>e[r]<t)),a=e.filter((e=>e[r]>n));return{filteredLabels:i,minOobs:o,maxOobs:a,numMinOobs:o.length,numMaxOobs:a.length}}function Da(e){let t,n=0;for(let r=1;r<10;r++)t=e(r),n=Math.max(n,Math.sqrt(t.width*t.width+t.height*t.height));return t=e("9+"),[n,Math.max(n,Math.sqrt(t.width*t.width+t.height*t.height))]}function Na(e,t){return e>9?t[1]:t[0]}function Ia({alignment:e,dockValue:t,oobs:n,style:r,rect:i,symbol:o,position:a,areaProps:s,radius:l,font:u}){const c=n?n.length:0;if(c<1)return[];const{flipXY:d,majorAxis:m,minorAxis:f,minorDimension:p,dock:h}=s,g=i[p],y=jo.createOob({oob:jo.getDefaultSettings({size:r.size,fill:r.fill,alignment:e}),dockValue:t,boxCenter:.5,rendWidth:i.width,rendHeight:i.height,flipXY:d,symbol:o});y.dock=h;const v=`c${m}`,b=`c${f}`,x={type:"circle",r:l,stroke:"transparent",fill:r.text.background.fill,strokeWidth:0,dock:h};x[b]=g/2,x[v]=a;const M={type:"text",text:c>9?"9+":c,title:va({oobs:n,font:u,ellipsis:"…"}),dx:0,dy:0,maxWidth:g,width:g,fontSize:r.text.fontSize,fontFamily:r.text.fontFamily,fill:r.text.fill,baseline:"central",anchor:"middle",dock:h};return M[f]=g/2,M[m]=a,[y,x,M]}function Ta(e){const t=`normal ${e.fontSize} '${e.fontFamily}'`;return{font:t,lineHeight:_o.getFontHeight(t)*(e.lineHeightMultiplicator||1),gap:e.gap||12,maxLabelWidth:e.maxWidth||75,top:e.padding.top||0,bottom:e.padding.bottom||0,left:e.padding.left||0,right:e.padding.right||0}}const La=e=>e.map((e=>({...e,value:"function"==typeof e.value?e.value():e.value,valueText:"function"==typeof e.valueText?e.valueText():e.valueText,valueInfo:"function"==typeof e.valueInfo?e.valueInfo():e.valueInfo})));var ka={require:["renderer","chart","symbol"],defaultSettings:{layout:{displayOrder:0,prioOrder:0}},preferredSize(){const{scale:e}=this,{style:t,layoutService:n,isContinuous:r,localeInfo:i}=this.settings,o=!!r||n.meta.canBeContinuous,a=La(this.settings.labels),s=qa(this.chart,this.settings.formatter,e);Ca.addLabelTitles({labels:a,formatter:s,isContinuous:r,canBeContinuous:o,localeInfo:i});const{numMaxOobs:l,numMinOobs:u,filteredLabels:c}=(({labels:e,scale:t,isContinuous:n,canBeContinuous:r,layoutService:i})=>{if(n){const[r,i]=Aa(t,n);return Oa(e,r,i)}if(r){const t=i.getLayoutValue("qHyperCube.qDimensionInfo.0"),{qMin:n,qMax:r}=t;if("NaN"!==n&&"NaN"!==r)return Oa(e,n,r,"inputValue")}return{filteredLabels:e}})({labels:a,scale:e,isContinuous:r,canBeContinuous:o,layoutService:n});let d;if(this.measureText=e=>this.renderer.measureText({text:e,fontSize:t.label.fontSize,fontFamily:t.label.fontFamily}),c&&c.length){const e=Ta(t.label),{dock:n}=this.settings.layout;return Ca.measureLabelsWidth(c,this.measureText),d=wa(n,c,e),d}const m=Da(this.measureText),f=l?Na(l,m):0,p=u?Na(u,m):0;return d=Math.max(f,p),d},render(){const{scale:e}=this;if(!e.domain().length)return;const{symbol:t}=this,{style:n,layoutService:r,theme:i,isContinuous:o,isDimension:a,localeInfo:s}=this.settings,l=!!o||r.meta.canBeContinuous,u=La(this.settings.labels),{dock:c,rtl:d}=this.settings.layout,{padding:m}=n.label,f=function(e){return"left"===e||"right"===e?(e=>({dock:e,orientation:"vertical",majorAxis:"y",minorAxis:"x",majorDimension:"height",minorDimension:"width",flipXY:!1}))(e):(e=>({dock:e,orientation:"horizontal",majorAxis:"x",minorAxis:"y",majorDimension:"width",minorDimension:"height",flipXY:!0}))(e)}(c),p=function(e,t,n){const r=e[t.minorDimension];return{minorSize:r,majorSize:e[t.majorDimension],minorCenter:"vertical"===t.orientation?(r-n.right-n.left)/2+n.left:(r-n.top-n.bottom)/2+n.top}}(this.rect,f,m),{orientation:h,majorDimension:g}=f,{majorSize:y}=p,{font:v,lineHeight:b,gap:x,maxLabelWidth:M}=Ta(n.label),S=qa(this.chart,this.settings.formatter,e),E=y;Ca.addLabelTitles({labels:u,formatter:S,isContinuous:o,canBeContinuous:l,localeInfo:s}),Ca.calculateLabelPositions({labels:u,scale:e,size:E,layoutService:r,orientation:h,rtl:d,isContinuous:o,isDimension:a});const[C,q]=Aa(e,o),{filteredLabels:w,lowerOobs:A,upperOobs:O,lowerCircleSize:D,upperCircleSize:N,lowerOobSpace:I,upperOobSpace:T}=function({labels:e,minValue:t,maxValue:n,orientation:r,rtl:i,isContinuous:o,style:a,padding:s,measureText:l,prop:u="value"}){const{maxOobs:c,minOobs:d,filteredLabels:m}=Oa(e,t,n,u),f="scaledValue"!==u&&pa.getInvert({orientation:r,rtl:i,isContinuous:o}),p=function(e,t,n){return n?t:e}(d,c,f),h=function(e,t,n){return n?e:t}(d,c,f),g=p.length,y=h.length,v=Da(l),b=Na(g,v),x=Na(y,v),M=function(e,t,n,r,i){return("vertical"===r?i.top:i.left)+(e>0?t+n:0)}(g,a.oob.size,b,r,s),S=function(e,t,n,r,i){return("vertical"===r?i.bottom:i.right)+(e>0?t+n:0)}(y,a.oob.size,x,r,s);return{filteredLabels:m,lowerOobs:p,upperOobs:h,lowerCircleSize:b,upperCircleSize:x,lowerOobSpace:M,upperOobSpace:S}}({labels:u,minValue:C,maxValue:q,orientation:h,rtl:d,isContinuous:o,style:n,padding:m,measureText:this.measureText,prop:o?"value":"scaledValue"}),L=I,k=y-T;ba(A),ba(O);const R=Ia({alignment:0,dockValue:0,oobs:A,style:n.oob,rect:this.rect,symbol:t,position:n.oob.size+D/2,areaProps:f,radius:D/2,font:v}),P=Ia({alignment:1,dockValue:1,oobs:O,style:n.oob,rect:this.rect,symbol:t,position:y-(n.oob.size+N/2),areaProps:f,radius:N/2,font:v});Ca.addLabelsInfo({labels:w,scale:e,majorSize:y,lowerLimit:L,upperLimit:k,font:v,lineHeight:b,gap:x,maxLabelWidth:M,majorDimension:g,orientation:h,measureText:this.measureText,rtl:d,layoutService:r,isContinuous:o,isDimension:a}),ea.layout(w.map((e=>e.segment)),L,k,n.label.gap);const $=w.filter((e=>ea.isInside(e.segment,L,k,o)));return Ca.createLabels({labels:$,style:n.label,maxLabelWidth:M,areaProps:f,area:p,lineHeight:b,font:v,theme:i}).concat([...R,...P])}};var Ra=Object.prototype.hasOwnProperty,Pa=Object.prototype.toString,$a=Object.defineProperty,Fa=Object.getOwnPropertyDescriptor,za=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===Pa.call(e)},_a=function(e){if(!e||"[object Object]"!==Pa.call(e))return!1;var t,n=Ra.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&Ra.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||Ra.call(e,t)},ja=function(e,t){$a&&"__proto__"===t.name?$a(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},Ha=function(e,t){if("__proto__"===t){if(!Ra.call(e,t))return;if(Fa)return Fa(e,t).value}return e[t]};function Va(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Ba(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Ua(){}!function(e){e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")&&e.default}((function e(){var t,n,r,i,o,a,s=arguments[0],l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l<u;++l)if(null!=(t=arguments[l]))for(n in t)r=Ha(s,n),s!==(i=Ha(t,n))&&(c&&i&&(_a(i)||(o=za(i)))?(o?(o=!1,a=r&&za(r)?r:[]):a=r&&_a(r)?r:{},ja(s,{name:n,newValue:e(c,a,i)})):void 0!==i&&ja(s,{name:n,newValue:i}));return s}));var Ya=1/.7,Wa="\\s*([+-]?\\d+)\\s*",Ga="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Xa="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ka=/^#([0-9a-f]{3,8})$/,Ja=new RegExp(`^rgb\\(${Wa},${Wa},${Wa}\\)$`),Za=new RegExp(`^rgb\\(${Xa},${Xa},${Xa}\\)$`),Qa=new RegExp(`^rgba\\(${Wa},${Wa},${Wa},${Ga}\\)$`),es=new RegExp(`^rgba\\(${Xa},${Xa},${Xa},${Ga}\\)$`),ts=new RegExp(`^hsl\\(${Ga},${Xa},${Xa}\\)$`),ns=new RegExp(`^hsla\\(${Ga},${Xa},${Xa},${Ga}\\)$`),rs={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 is(){return this.rgb().formatHex()}function os(){return this.rgb().formatRgb()}function as(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Ka.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?ss(t):3===n?new ds(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?ls(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?ls(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=Ja.exec(e))?new ds(t[1],t[2],t[3],1):(t=Za.exec(e))?new ds(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Qa.exec(e))?ls(t[1],t[2],t[3],t[4]):(t=es.exec(e))?ls(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=ts.exec(e))?ys(t[1],t[2]/100,t[3]/100,1):(t=ns.exec(e))?ys(t[1],t[2]/100,t[3]/100,t[4]):rs.hasOwnProperty(e)?ss(rs[e]):"transparent"===e?new ds(NaN,NaN,NaN,0):null}function ss(e){return new ds(e>>16&255,e>>8&255,255&e,1)}function ls(e,t,n,r){return r<=0&&(e=t=n=NaN),new ds(e,t,n,r)}function us(e){return e instanceof Ua||(e=as(e)),e?new ds((e=e.rgb()).r,e.g,e.b,e.opacity):new ds}function cs(e,t,n,r){return 1===arguments.length?us(e):new ds(e,t,n,null==r?1:r)}function ds(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function ms(){return`#${gs(this.r)}${gs(this.g)}${gs(this.b)}`}function fs(){const e=ps(this.opacity);return`${1===e?"rgb(":"rgba("}${hs(this.r)}, ${hs(this.g)}, ${hs(this.b)}${1===e?")":`, ${e})`}`}function ps(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function hs(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function gs(e){return((e=hs(e))<16?"0":"")+e.toString(16)}function ys(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new bs(e,t,n,r)}function vs(e){if(e instanceof bs)return new bs(e.h,e.s,e.l,e.opacity);if(e instanceof Ua||(e=as(e)),!e)return new bs;if(e instanceof bs)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,s=o-i,l=(o+i)/2;return s?(a=t===o?(n-r)/s+6*(n<r):n===o?(r-t)/s+2:(t-n)/s+4,s/=l<.5?o+i:2-o-i,a*=60):s=l>0&&l<1?0:a,new bs(a,s,l,e.opacity)}function bs(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function xs(e){return(e=(e||0)%360)<0?e+360:e}function Ms(e){return Math.max(0,Math.min(1,e||0))}function Ss(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}Va(Ua,as,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:is,formatHex:is,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return vs(this).formatHsl()},formatRgb:os,toString:os}),Va(ds,cs,Ba(Ua,{brighter(e){return e=null==e?Ya:Math.pow(Ya,e),new ds(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new ds(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ds(hs(this.r),hs(this.g),hs(this.b),ps(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:ms,formatHex:ms,formatHex8:function(){return`#${gs(this.r)}${gs(this.g)}${gs(this.b)}${gs(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:fs,toString:fs})),Va(bs,(function(e,t,n,r){return 1===arguments.length?vs(e):new bs(e,t,n,null==r?1:r)}),Ba(Ua,{brighter(e){return e=null==e?Ya:Math.pow(Ya,e),new bs(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new bs(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,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new ds(Ss(e>=240?e-240:e+120,i,r),Ss(e,i,r),Ss(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new bs(xs(this.h),Ms(this.s),Ms(this.l),ps(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=ps(this.opacity);return`${1===e?"hsl(":"hsla("}${xs(this.h)}, ${100*Ms(this.s)}%, ${100*Ms(this.l)}%${1===e?")":`, ${e})`}`}}));const Es=Math.PI/180,Cs=180/Math.PI,qs=4/29,ws=6/29,As=3*ws*ws;function Os(e){if(e instanceof Ds)return new Ds(e.l,e.a,e.b,e.opacity);if(e instanceof ks)return Rs(e);e instanceof ds||(e=us(e));var t,n,r=Ls(e.r),i=Ls(e.g),o=Ls(e.b),a=Ns((.2225045*r+.7168786*i+.0606169*o)/1);return r===i&&i===o?t=n=a:(t=Ns((.4360747*r+.3850649*i+.1430804*o)/.96422),n=Ns((.0139322*r+.0971045*i+.7141733*o)/.82521)),new Ds(116*a-16,500*(t-a),200*(a-n),e.opacity)}function Ds(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function Ns(e){return e>.008856451679035631?Math.pow(e,1/3):e/As+qs}function Is(e){return e>ws?e*e*e:As*(e-qs)}function Ts(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Ls(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function ks(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function Rs(e){if(isNaN(e.h))return new Ds(e.l,0,0,e.opacity);var t=e.h*Es;return new Ds(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}Va(Ds,(function(e,t,n,r){return 1===arguments.length?Os(e):new Ds(e,t,n,null==r?1:r)}),Ba(Ua,{brighter(e){return new Ds(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new Ds(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 ds(Ts(3.1338561*(t=.96422*Is(t))-1.6168667*(e=1*Is(e))-.4906146*(n=.82521*Is(n))),Ts(-.9787684*t+1.9161415*e+.033454*n),Ts(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),Va(ks,(function(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof ks)return new ks(e.h,e.c,e.l,e.opacity);if(e instanceof Ds||(e=Os(e)),0===e.a&&0===e.b)return new ks(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*Cs;return new ks(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new ks(e,t,n,null==r?1:r)}),Ba(Ua,{brighter(e){return new ks(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new ks(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return Rs(this).rgb()}}));var Ps=e=>()=>e;function $s(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):Ps(isNaN(e)?t:e)}function Fs(e,t,n){if(void 0===e||void 0===t)return n;for(var r=t.split("."),i=e,o=0;o<r.length;++o){var a=r[o];if(void 0===i[a])return n;i=i[a]}return i}!function e(t){var n=function(e){return 1==(e=+e)?$s: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(r){return Math.pow(e+r*t,n)}}(t,n,e):Ps(isNaN(t)?n:t)}}(t);function r(e,t){var r=n((e=cs(e)).r,(t=cs(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),a=$s(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=o(t),e.opacity=a(t),e+""}}return r.gamma=e,r}(1);var zs,_s=["__proto__","constructor"];function js(e,t,n){if(void 0!==e&&void 0!==t){var r=t.split("."),i=r[r.length-1];if(!_s.some((function(e){return r.includes(e)}))){for(var o=e,a=0;a<r.length-1;++a){var s=r[a];void 0===o[s]&&(o[s]=Number.isNaN(+r[a+1])?{}:[]),o=o[s]}void 0!==n?o[i]=n:delete o[i]}}}function Hs(e){var t=0,n=e.children,r=n&&n.length;if(r)for(;--r>=0;)t+=n[r].value;else t=1;e.value=t}function Vs(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=Us)):void 0===t&&(t=Bs);for(var n,r,i,o,a,s=new Gs(e),l=[s];n=l.pop();)if((i=t(n.data))&&(a=(i=Array.from(i)).length))for(n.children=i,o=a-1;o>=0;--o)l.push(r=i[o]=new Gs(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(Ws)}function Bs(e){return e.children}function Us(e){return Array.isArray(e)?e[1]:null}function Ys(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function Ws(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function Gs(e){this.data=e,this.depth=this.height=0,this.parent=null}Gs.prototype=Vs.prototype={constructor:Gs,count:function(){return this.eachAfter(Hs)},each:function(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this},eachAfter:function(e,t){for(var n,r,i,o=this,a=[o],s=[],l=-1;o=a.pop();)if(s.push(o),n=o.children)for(r=0,i=n.length;r<i;++r)a.push(n[r]);for(;o=s.pop();)e.call(t,o,++l,this);return this},eachBefore:function(e,t){for(var n,r,i=this,o=[i],a=-1;i=o.pop();)if(e.call(t,i,++a,this),n=i.children)for(r=n.length-1;r>=0;--r)o.push(n[r]);return this},find:function(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r},sum:function(e){return this.eachAfter((function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].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(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r},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 Vs(this).eachBefore(Ys)},[Symbol.iterator]:function*(){var e,t,n,r,i=this,o=[i];do{for(e=o.reverse(),o=[];i=e.pop();)if(yield i,t=i.children)for(n=0,r=t.length;n<r;++n)o.push(t[n])}while(o.length)}},zs=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,r,i,o,a,s,l,u,c,d,m=e.length,f=e.search(/[0-9\-\+#]/),p=f>0?e.substring(0,f):"",h=e.split("").reverse().join(""),y=h.search(/[0-9\-\+#]/),g=m-y,v=e.substring(g,g+1),b=g+("."===v||","===v?1:0),x=y>0?e.substring(b,m):"";if(n=(t="-"===(e=e.substring(f,b)).charAt(0)?-t:+t)<0?t=-t:0,i=(r=e.match(/[^\d\-\+#]/g))&&r[r.length-1]||".",o=r&&r[1]&&r[0]||",",e=e.split(i),t=+(t=t.toFixed(e[1]&&e[1].length))+"",s=e[1]&&e[1].lastIndexOf("0"),(!(u=t.split("."))[1]||u[1]&&u[1].length<=s)&&(t=(+t).toFixed(s+1)),c=e[0].split(o),e[0]=c.join(""),(a=e[0]&&e[0].indexOf("0"))>-1)for(;u[0].length<e[0].length-a;)u[0]="0"+u[0];else 0==+u[0]&&(u[0]="");if((t=t.split("."))[0]=u[0],l=c[1]&&c[c.length-1].length){for(h="",g=(d=t[0]).length%l,m=d.length,b=0;b<m;b++)h+=d.charAt(b),!((b-g+1)%l)&&b<m-l&&(h+=o);t[0]=h}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),p+(n?"-":"")+r+x}},Gu(Xu={exports:{}}),Xu.exports);function Ju(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}const Zu={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"},Qu=/%\)?$/,ec=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,tc=/^\(oct\)/i,nc=/^\(dec\)/i,rc=/^\(hex\)/i,ic=/^\(bin\)/i,oc=/^\(rom\)/i,ac=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,sc=/#|0/g;function lc(e,t,n,r){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(".",r||".")}function uc(e,t,n){const r=Ju(e);return n?r:new RegExp(r||"",t)}function cc(e,t,n,r){let i,o,a,s,l,u,c,d,m,f=e.pattern;var p,h;r&&(e.abbreviate=!0),p=t,(h=n)&&(h=Ju(h)),p&&(p=Ju(p)),m=new RegExp("(?:[#0]+".concat(p,")?[#0]+(?:").concat(h,"[#0]+)?")),a=f.match(m),a=a?a[0]:"",s=a?f.substr(0,f.indexOf(a)):f,l=a?f.substring(f.indexOf(a)+a.length):"",a||(a=f?"#":"##########"),t&&t===n&&(i=a.split(n),o=i.pop(),a=i.join("")+n+o,t=""),u=t,t=/,/.test(n)?"¤":",",u&&(a=a.replace(uc(u,"g"),t)),c=n,n=".",c&&(a=a.replace(uc(c,"g"),n)),d=a.match(/#/g),d=d?d.length:0;const y=f.split(c);let g;y[1]&&(g=y[1].match(sc)),e.prefix=s||"",e.postfix=l||"",e.pattern=f,e.maxPrecision=g?g.length:2,e.percentage=Qu.test(f),e.numericPattern=a||"",e.numericRegex=new RegExp("".concat(uc(t,null,!0),"|").concat(uc(n,null,!0)),"g"),e.groupTemp=u,e.decTemp=c,e.t=t,e.d=n,e.temp=d}class dc{constructor(e,t,n,r,i){this.localeInfo=e,this.pattern=t,this.thousandDelimiter=n||",",this.decimalDelimiter=r||".",this.type=i||"numeric",this.patternSeparator=";",this.abbreviations=function(e,t){if(!e||!e.qNumericalAbbreviation)return Zu;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 dc(this.localeInfo,this.pattern,this.thousandDelimiter,this.decimalDelimiter,this.type);return e.subtype=this.subtype,e}format(e,t,n,r){return this.prepare(t,n,r),this.formatValue(e)}prepare(e,t,n){let r;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:""}},r=this._prepared,e=e.split(this.patternSeparator),r.positive.pattern=e[0],r.negative.pattern=e[1],r.zero.pattern=e[2],ac.test(e[0])&&(r.positive.isFunctional=!0),e[1]?ac.test(e[1])&&(r.negative.isFunctional=!0):r.negative=!1,e[2]?ac.test(e[2])&&(r.zero.isFunctional=!0):r.zero=!1;const i="U"===this.type;r.positive.isFunctional||cc(r.positive,t,n,i),r.negative&&!r.negative.isFunctional&&cc(r.negative,t,n,i),r.zero&&!r.zero.isFunctional&&cc(r.zero,t,n,i)}formatValue(e){let t,n,r,i,o,a,s,l,u,c=this._prepared,d="",m="",f=e;if(isNaN(e))return"".concat(f);if(e=+e,!1===c.pattern)return e.toString();if(0===e&&c.zero)return c=c.zero,c.pattern;if(e<0&&c.negative?(c=c.negative,e=-e):c=c.positive,o=c.d,a=c.t,c.isFunctional)e=function(e,t,n){let r;return ec.test(t)?e=lc(e,Number(/\d{2}/.exec(t)[0]),t,n):tc.test(t)?e=lc(e,8,t,n):nc.test(t)?e=lc(e,10,t,n):rc.test(t)?e=lc(e,16,t,n):ic.test(t)?e=lc(e,2,t,n):oc.test(t)&&(r="",e<0&&(r="-",e=-e),0===(e=Math.floor(e))?e="0":e<=5e5?(e=function(e,t){let n,r="",i=Number(String(e).slice(-3)),o=(e-i)/1e3,a=[0,1,4,5,9,10,40,50,90,100,400,500,900].reverse(),s=["0","I","IV","V","IX","X","XL","L","XC","C","CD","D","CM"].reverse();for(;i>0;)for(n=0;n<a.length;n++)if(a[n]<=i){r+=s[n],i-=a[n];break}for(n=0;n<o;n++)r="M".concat(r);return t[1]!==t[1].toUpperCase()&&(r=r.toLowerCase()),r}(e,t),e=r+e):e=t+r+e.toExponential(0)),e}(e,c.pattern,o);else{if(c.percentage&&(e*=100),c.abbreviate){const t=Object.keys(this.abbreviations).map((e=>parseInt(e,10))).sort(((e,t)=>e-t));let r,i,o=t[0];for(s=0,n=Number(Number(e).toExponential().split("e")[1]);o<=n&&s<t.length;)s++,o=t[s];s>0&&(r=t[s-1]),r&&n>0&&r>0?i=r:(n<0&&r<0||!r)&&(o<0&&o-n<=c.maxPrecision?i=o:r<=n&&!(o>0&&-n<=c.maxPrecision)&&(i=r)),i&&(d=this.abbreviations[i],e/=10**i)}if(r=Math.abs(e),t=c.temp,l=c.numericPattern,u=l.split(o)[1],"I"===this.type&&(e=Math.round(e)),i=e,u||"#"!==l.slice(-1)[0])if(r>=1e15||r>0&&r<=1e-14)e=r?r.toExponential(15).replace(/\.?0+(?=e)/,""):"0";else{const t=Number(e.toFixed(Math.min(20,u?u.length:0)).split(".")[0]);let n=l.split(o)[0];if(n+=o,e=Ku(n,t)||"0",u){const t=Math.max(0,Math.min(14,u.length)),n=u.replace(/#+$/,"").length;let i=("I"===this.type?0:r%1).toFixed(t).slice(2).replace(/0+$/,"");for(s=i.length;s<n;s++)i+="0";i&&(e+=o+i)}else 0===t&&(i=0)}else if(r>=10**t||r<1||r<1e-4)0===e?e="0":r<1e-4||r>=1e20?(e=(e=i.toExponential(Math.max(1,Math.min(14,t))-1)).replace(/\.?0+(?=e)/,""),m=""):(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(r)/Math.log(10)))),s=0;s<t;s++)l+="#";e=Ku(l,e)}e=e.replace(c.numericRegex,(e=>e===a?c.groupTemp:e===o?c.decTemp:"")),i<0&&!/^-/.test(e)&&(e="-".concat(e))}return c.prefix+e+m+d+c.postfix}static getStaticFormatter(){return{prepare(){},formatValue:e=>"".concat(e)}}}function mc(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{size:n=5e3,multipleArguments:r=!1,toKey:i=(e=>e)}=t;let o,a,s=Object.create(null),l=Object.create(null),u=0,c=0;return o=r?function(){return a=i(...arguments),o.has(a)?o.get(a):o.set(a,e(...arguments))}:t=>(a=i(t),o.has(a)?o.get(a):o.set(a,e(t))),o.set=(e,t)=>(u>=n&&(delete s[l[c]],delete l[c],u--,c++),s[e]=t,l[u]=e,u++,t),o.get=e=>s[e],o.has=e=>e in s,o.clear=()=>{s=Object.create(null),l=Object.create(null),u=0,c=0},o.size=()=>u,o}function fc(e,t,n,r,i){const o=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new dc(...t)}(i,e,t,n,r),a=mc(o.formatValue.bind(o),{toKey:e=>isNaN(e)?e:+e});function s(e){return a(e)}return s.format=function(e,t,n,r){return a.clear(),o.format(t,e,n,r)},s.pattern=function(e){return e&&(a.clear(),o.pattern=e,o.prepare()),o.pattern},s}const pc="IV",hc=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],yc=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],gc=["January","February","March","April","May","June","July","August","September","October","November","December"],vc=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function bc(e,t){for(let n=e.length;n<t;n++)e="0".concat(e);return e}function xc(e){let t=e.toString().split(".");return t[1]?(t=Number("0.".concat(t[1])),t):0}class Sc{constructor(e,t,n){const r=e||{};r.qCalendarStrings||(r.qCalendarStrings={qLongDayNames:hc,qDayNames:yc,qLongMonthNames:gc,qMonthNames:vc}),this.localeInfo=r,this.locale_days=r.qCalendarStrings.qLongDayNames.slice(),this.locale_days_abbr=r.qCalendarStrings.qDayNames.slice(),this.locale_months=r.qCalendarStrings.qLongMonthNames.slice(),this.locale_months_abbr=r.qCalendarStrings.qMonthNames.slice(),t||(t={T:r.qTimeFmt||"hh:mm:ss",D:r.qDateFmt||"YYYY-MM-DD",TS:r.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"}[n]),this.pattern=t}clone(){const e=new Sc(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 r;e instanceof Date?r=function(e,t){let n=e.getUTCHours(),r=e.getUTCDay()-1;return t&&(n%=12,n||(n=12)),r<0&&(r=6),{year:e.getUTCFullYear(),month:e.getUTCMonth(),day:r,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)),r=function(e,t){let n,r=function(e){const t=e,n=24*xc(t),r=60*xc(n),i=60*xc(r),o=1e3*xc(i);return{d:Math.floor(t),h:Math.floor(n),m:Math.floor(r),s:Math.floor(i),f:Math.round(o)}}(e),i=r.d,o=r.h,a=r.m,s=r.s,l=r.f,u=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*i),/h+/gi.test(t)||(a+=60*o),/m+/gi.test(t)||(s+=60*a),/w+/gi.test(t)&&(u=n?n.getDay()-1:0,u<0&&(u=6));let c="";return n&&(c=n.getUTCHours()>=12?"pm":"am"),{year:0,month:0,day:u,date:i,h:o,m:a,s:s,f:l,t:c}}(e,t));const i=(o=this,a=r,{"Y+|y+":{Y:"".concat(Number("".concat(a.year).slice(-2))),YY:bc("".concat(a.year).slice(-2),2),YYY:bc("".concat(a.year).slice(-3),3),def:e=>bc("".concat(a.year),e.length)},"M+":{M:a.month+1,MM:bc("".concat(a.month+1),2),MMM:o.locale_months_abbr[a.month],def:o.locale_months[a.month]},"W+|w+":{W:a.day,WW:bc("".concat(a.day),2),WWW:o.locale_days_abbr[a.day],def:o.locale_days[a.day]},"D+|d+":{D:a.date,def:e=>bc("".concat(a.date),e.length)},"h+|H+":{h:a.h,def:e=>bc("".concat(a.h),e.length)},"m+":{m:a.m,def:e=>bc("".concat(a.m),e.length)},"s+|S+":{s:a.s,def:e=>bc("".concat(a.s),e.length)},"f+|F+":{def(e){let t="".concat(a.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=a.t;return e[0].toUpperCase()===e[0]&&(t=t.toUpperCase()),t=t.slice(0,e.length),t}}});var o,a;const s=[];for(const e in i)Object.prototype.hasOwnProperty.call(i,e)&&s.push(e);const l=new RegExp(s.join("|"),"g");return t.replace(l,(e=>{let t,n,r;for(n in i)if(Object.prototype.hasOwnProperty.call(i,n)&&(t=new RegExp(n),t.test(e)))break;if(!t)return"";for(const t in i[n])if(t===e||t.toLowerCase()===e){r=i[n][t],void 0===r&&(r=i[n][t.toLowerCase()]);break}return void 0===r&&(r=i[n].def),"function"==typeof r&&(r=r(e)),r}))}}function Mc(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Sc(...t)}function Ec(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"TS",n=Mc(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,e,t),r=mc(n.format.bind(n),{toKey:e=>"object"==typeof e&&"function"==typeof e.getTime?e.getTime():e});function i(e){return t!==pc?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=i(e),r(e)}return o.format=function(e,t){return r.clear(),t=i(t),n.format(t,e)},o.locale=function(i){return n=Mc(i,e,t),r=mc(n.format.bind(n),{toKey:e=>"object"==typeof e?e.getTime():e}),this},o.qtype=function(e){return void 0!==e&&(t=e,r.clear()),t},o}function Cc(){let e,{meta:t,id:n,key:r,localeInfo:i,fieldExtractor:o,value:a,type:s,sourceField:l}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const u=a||("dimension"===s?e=>null==e?void 0:e.qElemNo:e=>null==e?void 0:e.qValue),c="dimension"===s?"first":"avg",d=function(e,t){if(e&&e.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(e.qNumFormat.qType))return Ec(e.qNumFormat.qFmt,e.qNumFormat.qType,t);let n="#",r=t&&void 0!==t.qThousandSep?t.qThousandSep:",",i=t&&void 0!==t.qDecimalSep?t.qDecimalSep:".",o="U",a=e&&!!e.qIsAutoFormat;return e&&e.qNumFormat?(n=e.qNumFormat.qFmt||n,r=e.qNumFormat.qThou||r,i=e.qNumFormat.qDec||i,o=e.qNumFormat.qType||o,a=a&&-1===["M"].indexOf(e.qNumFormat.qType)):a=!0,(a||"U"===o)&&(n="#".concat(i,"##"),o="U"),fc(n,r,i,o,t)}(t,i),m="dimension"===s?"first":(e,t)=>d(t),f={id:()=>n,key:()=>r,raw:()=>t,title:()=>t.qFallbackTitle||t.label,type:()=>s,origin:()=>l,items:()=>(e||(e=o(f)),e),min:()=>t.qMin,max:()=>t.qMax,value:u,label:e=>(null==e?void 0:e.qText)||"",reduce:c,reduceLabel:m,formatter:()=>d,tags:()=>t.qTags};return f}function qc(e,t,n,r,i){return(t[e]||[]).map(((t,o)=>{const a="".concat(r?"".concat(r,"/"):"").concat(e,"/").concat(o),s={instance:Cc(du({id:"".concat(n?"".concat(n,"/"):"").concat(a),key:a,meta:t},i))};return s.attrDims=qc("qAttrDimInfo",t,n,a,du({},i,{value:e=>null==e?void 0:e.qElemNo,type:"dimension"})),s.attrExps=qc("qAttrExprInfo",t,n,a,du({},i,{value:e=>null==e?void 0:e.qNum,type:"measure"})),s.measures=qc("qMeasureInfo",t,n,a,du({},i,{value:e=>null==e?void 0:e.qValue,type:"measure"})),s}))}function Ac(){let{key:e,data:t,config:n={}}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r={fields:[],wrappedFields:[],allFields:[],virtualFields:[]},i=t;if(!i)throw new Error('Missing "data" input');if(!i.qDimensionInfo)throw new Error('The "data" input is not recognized as a hypercube');const o=Ac.util,a={cache:r,cube:i,localeInfo:n.localeInfo,fieldExtractor:null,pages:null,hierarchy:()=>null,virtualFields:n.virtualFields},s={key:()=>e,raw:()=>i,field:e=>function(e,t){let{cache:n}=t;if("number"==typeof e)return n.fields[e];const r=n.allFields;if("function"==typeof e){for(let t=0;t<r.length;t++)if(e(r[t]))return r[t];return!1}if("string"==typeof e){for(let t=0;t<r.length;t++)if(r[t].key()===e||r[t].title()===e)return r[t]}else if(e&&-1!==r.indexOf(e))return e;throw Error("Field not found: ".concat(e))}(e,a),fields:()=>r.fields.slice(),extract:e=>a.extractor(e,s,r,o),hierarchy:e=>a.hierarchy(e,s,r,o),_cache:()=>r};"K"===i.qMode||"T"===i.qMode||!i.qMode&&i.qNodesOnDim?(a.extractor=Wu,a.hierarchy=Yu,a.pages="K"===i.qMode?i.qStackedDataPages:i.qTreeDataPages):"S"===i.qMode?(a.extractor=hu,a.pages=i.qDataPages,a.hierarchy=Yu):a.extractor=()=>[],a.fieldExtractor=e=>a.extractor({field:e},s,r,o);const l="S"===i.qMode?e=>e.qElemNumber:void 0,u="S"===i.qMode?e=>e.qNum:void 0;r.wrappedFields.push(...qc("qDimensionInfo",i,e,"",du({},a,{value:l,type:"dimension"}))),r.wrappedFields.push(...qc("qMeasureInfo",i,e,"",du({},a,{value:u,type:"measure"}))),r.fields=r.wrappedFields.map((e=>e.instance));const c=e=>{e.forEach((e=>{r.allFields.push(e.instance),c(e.measures),c(e.attrDims),c(e.attrExps)}))};return c(r.wrappedFields),(n.virtualFields||[]).forEach((t=>{const n=s.field(t.from),i=Cc(tu({meta:n.raw(),id:"".concat(e,"/").concat(t.key),sourceField:n,fieldExtractor:e=>a.extractor({field:e},s,r,o),key:t.key,type:n.type(),localeInfo:a.localeInfo,value:n.value},t.override||{}));r.virtualFields.push(i)})),r.allFields.push(...r.virtualFields),s}const Oc=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],Dc=/\/qDimensionInfo(?:\/(\d+))?/,Ic=/\/qMeasureInfo\/(\d+)/,wc=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,Tc=/\/qAttrExprInfo\/(\d+)/,Nc=/\/?qHyperCube/,Lc=/\/?qTreeData/,kc=e=>"".concat(e.substr(0,e.indexOf("/qHyperCubeDef")+14)),Rc=e=>"".concat(e.substr(0,e.indexOf("/qTreeDataDef")+13));function Pc(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const r=t.byCells,i=t.primarySource,o=[],a={},s=e.isActive();let l=!1;return e.brushes().forEach((e=>{const t=function(e,t){let n=e,r=-1,i=-1,o="",a=e=>e;Nc.test(e)?(o="".concat(n.substr(0,n.indexOf("qHyperCube")+10)),a=kc):Lc.test(e)&&(o="".concat(n.substr(0,n.indexOf("qTreeData")+9)),a=Rc);let s=!0;if(Dc.test(e)&&(r=+Dc.exec(e)[1]),Ic.test(e)&&(i=+Ic.exec(e)[1]),wc.test(e)){i=-1,r=0;const e=+wc.exec(n)[2];isNaN(e)||(r=e,n=n.replace(/\/\d+$/,"")),s=!1}if(Tc.test(e)){const e=i;if(t){i=0;const a=Tu(o,t);i+=(a.qMeasureInfo||[]).length,r>-1?(i=a.qDimensionInfo.slice(0,r).reduce(((e,t)=>e+t.qAttrExprInfo.length),i),r=-1):(i=a.qDimensionInfo.reduce(((e,t)=>e+t.qAttrExprInfo.length),i),i=a.qMeasureInfo.slice(0,e).reduce(((e,t)=>e+t.qAttrExprInfo.length),i)),i+=+Tc.exec(n)[1]}else r>-1?(r=-1,i=+Tc.exec(n)[1]):i+=+Tc.exec(n)[1]+1}return Oc.forEach((e=>{let[t,r]=e;n=n.replace(t,r)})),s&&(n=a(n)),n&&"/"!==n[0]&&(n="/".concat(n)),{measureIdx:i,dimensionIdx:r,path:n}}(e.id,n);if("range"===e.type&&t.measureIdx>-1&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,a.multiRangeSelectTreeDataValues||(a.multiRangeSelectTreeDataValues={path:t.path,ranges:[]}),n.forEach((e=>a.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,a.rangeSelectHyperCubeValues||(a.rangeSelectHyperCubeValues={path:t.path,ranges:[]}),n.forEach((e=>a.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,a.selectHyperCubeContinuousRange||(a.selectHyperCubeContinuousRange={path:t.path,ranges:[]}),n.forEach((e=>a.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(r)if(n&&n.qHyperCube&&("P"===n.qHyperCube.qMode||"T"===n.qHyperCube.qMode||"K"===n.qHyperCube.qMode)){const r=n.qHyperCube,o=r.qNoOfLeftDims,s=r.qEffectiveInterColumnSortOrder.indexOf(t.dimensionIdx);if(a.selectPivotCells||(a.selectPivotCells={path:t.path,cells:[]}),e.id===i||!i){const n=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e)));(0===o||s>=o)&&o>-1?n.forEach((e=>{a.selectPivotCells.cells.push({qType:"T",qCol:e,qRow:s-o})})):n.forEach((e=>{a.selectPivotCells.cells.push({qType:"L",qCol:t.dimensionIdx,qRow:e})})),l=!!a.selectPivotCells.cells.length}}else a.selectHyperCubeCells||(a.selectHyperCubeCells={path:t.path,cols:[]}),a.selectHyperCubeCells.cols.push(t.dimensionIdx),e.id!==i&&(i||a.selectHyperCubeCells.values)||(a.selectHyperCubeCells.values=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e))),l=!!a.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&&s?[{method:"resetMadeSelections",params:[]}]:(a.rangeSelectHyperCubeValues&&o.push({method:"rangeSelectHyperCubeValues",params:[a.rangeSelectHyperCubeValues.path,a.rangeSelectHyperCubeValues.ranges,[],null===(u=t.orMode)||void 0===u||u]}),a.selectHyperCubeContinuousRange&&o.push({method:"selectHyperCubeContinuousRange",params:[a.selectHyperCubeContinuousRange.path,a.selectHyperCubeContinuousRange.ranges]}),a.selectHyperCubeCells&&o.push({method:"selectHyperCubeCells",params:[a.selectHyperCubeCells.path,a.selectHyperCubeCells.values,a.selectHyperCubeCells.cols]}),a.selectPivotCells&&o.push({method:"selectPivotCells",params:[a.selectPivotCells.path,a.selectPivotCells.cells]}),a.multiRangeSelectTreeDataValues&&o.push({method:"multiRangeSelectTreeDataValues",params:[a.multiRangeSelectTreeDataValues.path,a.multiRangeSelectTreeDataValues.ranges]}),o);var u}function Fc(e){Ac.util=e.data("matrix").util,e.data("q",Ac),e.formatter("q-number",fc),e.formatter("q-time",Ec)}function zc(e){var t=Vl(e.layout||{},e.path.split("/").join("."));if(!t)return!1;var n=t.qIsOneAndOnlyOne;return void 0!==n&&n}function _c(e){var t=e.brush,n=e.colorField,r=e.legendAlias,i=e.useLegendCube,o=void 0!==i&&i;!n||/qAttrDimInfo/.test(n)?(t.removeKeyAlias("attrDim/qDimensionInfo/0"),r&&t.removeKeyAlias(r),t.addKeyAlias("attrDim/qDimensionInfo/0","qHyperCube/".concat(n))):o&&t.addKeyAlias(r,"qHyperCube/".concat(n))}Fc.qBrushHelper=Pc,Fc.selections=Pc;var $c="Shift";function Hc(e){var t=e.brush,n=e.getConfig;return{interceptor:function(e){var r=t.brushes(),i=n(),o=i.allowSimultaneous,a=i.layout,s=void 0===a?{}:a;r.forEach((function(n){var r,i,a;("range"===n.type||null!==(r=e[0])&&void 0!==r&&r.key&&(null===(i=e[0])||void 0===i?void 0:i.key)!==n.id&&0!==o.indexOf(null===(a=e[0])||void 0===a?void 0:a.key))&&t.clear([])}));var l=e.filter((function(e){return-2!==e.value}));if(l.length>1){var u=function(e){var t=e.layout,n=void 0===t?{}:t,r=e.values,i=void 0===r?[]:r;if(null==i||!i.length)return[];var o=Array.from(new Set(i.map((function(e){return e.key})))),a=[];return o.forEach((function(e){var t=zc({layout:n,path:e}),r=i.filter((function(t){return t.key===e})),o=t?[r.pop()]:r;a.push.apply(a,Ba(o))})),a.filter(Boolean)}({layout:s,values:l});return u}return l},rangeInterceptor:function(e){var r=t.brushes(),i=n().allowSimultaneous;return r.filter((function(e){return"value"===e.type})).length?(t.clear([]),e):(r.forEach((function(n){var r=n.id===e[0].key||i.includes(n.id)&&i.includes(e[0].key);"range"!==n.type||r||t.clear([])})),e)}}}var jc=function e(t,n){return n[t]?e(t+1,n):t},Vc=function(e,t){var n=t.reduce((function(e,t){return e[t]=!0,e}),{});return e.reduce((function(e,t,r){var i=jc(r,n);return n[i]=!0,e[r]=i,e}),{})};function Bc(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.layout,n=e.filtered,r=void 0===n?{}:n,i=(null==t?void 0:t.qHyperCube)||{},o=i.qDimensionInfo,a=void 0===o?[]:o,s=i.qMeasureInfo,l=void 0===s?[]:s;return{dimensions:Vc(a,r.dimensions||[]),measures:Vc(l,r.measures||[])}}var Uc="selectHyperCubeValues",Yc="selectHyperCubeContinuousRange";function Wc(e){var t=e.selection,n=e.fieldMap,r=t.method,i=t.params;if(r===Uc){var o=n.dimensions[i[1]];void 0!==o&&(i[1]=o)}return r===Yc&&i[1].forEach((function(e){var t=n.dimensions[e.qDimIx];void 0!==t&&(e.qDimIx=t)})),t}var Gc=[],Xc=0,Kc=function(e){var t=Gc.filter((function(e){var t;return null===(t=e.selections)||void 0===t?void 0:t.isActive()}));t.length&&("Enter"===e.key?t.forEach((function(e){return e.selections.confirm()})):"Escape"!==e.key&&"Esc"!==e.key||t.forEach((function(e){return e.selections.cancel()})))},Jc=function(){document.addEventListener("keyup",Kc)},Zc=function(){document.removeEventListener("keyup",Kc)},Qc=function(e,t){Object.keys(t).forEach((function(n){e.on(n,t[n])}))},ed=function(e,t){Object.keys(t).forEach((function(n){e.removeListener(n,t[n])}))};function td(e){var t=e.chart,n=e.document,r=e.selectionInfo,i=e.eventName,o=e.componentName,a=e.brushName,s=void 0===a?"selection":a,l=e.emit,u=void 0===l?"rangeClear":l,c=r.event===i,d=n.querySelector("[data-key='".concat(o,"-edge-0']"));if(c||!d)return!1;var m=t.component(o);return!!m&&(m.emit(u),"string"==typeof s&&t.brush(s).clear(),m)}var nd=["chart","document","selections","selectionInfo"],rd=function(e){e.chart,e.document,e.selections,e.selectionInfo;var t=ja(e,nd);t.clearDiscrete(),t.clearContinuous(),t.clearMinor(),t.clearRange(),t.clearTap(),t.clearLegend()};function id(e){var t,n=e.lasso;null!=n&&null!==(t=n.active)&&void 0!==t&&t.call(n)&&(null==n||n.action(!1))}function od(e){var t,n=e.chart,r=e.selectionInfo,i=e.selectionActions,o=e.actions,a=void 0===o?{}:o,s=e.selections,l=e.selectionEvents;if(!1===i||!1===l)return function(){};var u=i.reset,c=void 0===u?id:u,d=i.clear,m=!1!==d&&function(e){var t=e.clear,n=void 0===t?rd:t,r=e.selections,i=e.selectionInfo,o=e.chart;return function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).cleared,t={selections:r,selectionInfo:i,chart:o,document:document,cleared:e};return n(Pa({clearDiscrete:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e){var t=e.selectionInfo,n=e.chart,r=e.document,i=e.eventName,o=void 0===i?"discreteRange":i,a=e.componentName,s=void 0===a?"discrete-range-brush":a,l=e.cleared;return td({selectionInfo:t,chart:n,document:r,eventName:void 0!==l&&l?void 0:o,componentName:s,emit:"areaClear",brushName:e.brushName})}(Pa(Pa({},t),e))},clearContinuous:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e){var t=e.selectionInfo,n=e.chart,r=e.document,i=e.eventName,o=void 0===i?"continuousRange":i,a=e.componentName,s=void 0===a?"continuous-range-brush":a,l=e.cleared;return td({selectionInfo:t,chart:n,document:r,eventName:void 0!==l&&l?void 0:o,componentName:s,brushName:e.brushName})}(Pa(Pa({},t),e))},clearMinor:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e){var t=e.selectionInfo,n=e.chart,r=e.document,i=e.componentName,o=void 0===i?"minor-range-brush":i,a=e.eventName,s=void 0===a?"minorRange":a,l=e.cleared,u=void 0!==l&&l,c=e.brushName,d=td({selectionInfo:t,chart:n,document:r,eventName:u?void 0:s,componentName:o,brushName:void 0!==c&&c});if(d){var m=d.settings.settings,f=m.scale,p=m.brush,h=n.scale(f).data().fields.map((function(e){return e.id()})),y=n.brush(p),g=y.brushes().filter((function(e){return"range"===e.type&&h.some((function(t){return t===e.id}))}));y&&g.length&&g.forEach((function(e){y.removeRanges(e.brush.ranges().map((function(t){return{key:e.id,range:t}})))}))}}(Pa(Pa({},t),e))},clearRange:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e){var t=e.selectionInfo,n=e.chart,r=e.document,i=e.selections,o=e.eventName,a=void 0===o?"xAxis":o,s=e.cleared;td({selectionInfo:t,chart:n,document:r,eventName:void 0!==s&&s?void 0:a,componentName:"".concat(a,"-range-brush"),emit:"areaClear",brushName:!1})&&i.clear()}(Pa(Pa({},t),e))},clearTap:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e){var t=e.chart,n=e.selectionInfo,r=e.selections,i=e.events,o=void 0===i?["tap"]:i,a=e.brushNames,s=void 0===a?[]:a;if(n&&o.includes(n.event)){var l=n.currentComponent;n.previousComponent!==l&&(r.clear(),s.forEach((function(e){return t.brush(e).end()})))}}(Pa(Pa({},t),e))},clearLegend:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e){var t=e.selectionInfo,n=e.chart,r=e.document,i=e.selections,o=e.eventName,a=void 0===o?"legendRange":o,s=e.componentName,l=void 0===s?"legend-range-brush":s,u=e.cleared,c=void 0!==u&&u,d=e.brushName;td({selectionInfo:t,chart:n,document:r,eventName:c?void 0:a,componentName:l,brushName:void 0!==d&&d})&&i.clear()}(Pa(Pa({},t),e))}},t))}}({clear:d,selections:s,selectionInfo:r,chart:n}),f=function(e){var t=e.chart,n=e.actions,r=e.reset,i=e.clear,o=!1,a={deactivated:function(e){var t=(n||{}).lasso;r({e:e,lasso:void 0!==t&&t})},canceled:function(e){var o=(n||{}).lasso;r({e:e,lasso:void 0!==o&&o}),i({e:e,chart:t,document:document})},cleared:function(e){o||(o=!0,i({e:e,chart:t,document:document,cleared:!0}),o=!1)}};return!1===r&&delete a.deactivated,!1===i&&delete a.cleared,!1===r&&!1===i&&delete a.canceled,a}({chart:n,clear:m,reset:c,actions:a}),p={};Object.entries(f).forEach((function(e){var t=Va(e,2),n=t[0],r=t[1];p[n]=function(e,t){return t?function(n){return t({event:n,defaultFunc:e})}:e}(r,l[n])}));var h=function(e){var t=e.selectionEvents,n=e.selections,r=e.selectionInfo,i=e.clear,o=e.chart,a=e.document,s=t.start,l={selections:n,selectionInfo:r,chart:o,document:a},u=function(e){return Object.assign(r,e||{})},c=function(e){var t=e.event,n=e.components;return function(){return function(e){var t=e.selectionInfo,n=e.clear,r=e.event,i=e.components,o=void 0===i?[]:i;(0,e.setSelectionInfo)(Pa(Pa({},void 0===t?{}:t),{},{event:r,components:o.map((function(e){return e.key})).filter(Boolean)})),n()}({event:t,components:n,clear:i,chart:o,selectionInfo:r,setSelectionInfo:u})}};return"function"==typeof s?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];s(Pa(Pa({defaultFunc:c({event:e,components:t}),setSelectionInfo:u,clear:i},l),{},{event:e,components:t}))}:function(e){c({event:e,components:arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]})()}}({selectionEvents:l,selections:s,selectionInfo:r,clear:m,chart:n,document:document});return null==a||null===(t=a.select)||void 0===t||t.on("start",h),Object.entries(p).forEach((function(e){var t=Va(e,2),n=t[0],r=t[1];null==s||s.on(n,r)})),function(){var e;null==a||null===(e=a.select)||void 0===e||e.removeListener("start",h),Object.entries(p).forEach((function(e){var t=Va(e,2),n=t[0],r=t[1];null==s||s.removeListener(n,r)}))}}var ad=[{key:"qHyperCube/qDimensionInfo/0:numeric",includeMax:!1}];function sd(e){var t=e.chart,n=e.actions,r=e.selections,i=e.picassoQ,o=e.config,a=o.allowSimultaneous,s=void 0!==a&&a,l=o.majorScale,u=void 0===l?void 0:l,c=o.selectionActions,d=void 0===c?{}:c,m=d.clear,f=d.reset,p=o.selectionEvents,h=void 0===p?{deactivated:void 0,canceled:void 0,cleared:void 0,start:void 0}:p,y=o.brushEvents,g=void 0===y?{}:y,v=o.brushName,b=void 0===v?"selection":v,x=o.brushMaxListeners,S=void 0===x?20:x,M=o.brushRanges,E=void 0!==M&&M,C=o.interceptors,q=void 0===C?{}:C,A=o.selectionsFn,O=void 0===A?i.selections:A,D=t.brush(b);if("number"==typeof S&&D.setMaxListeners(S),E){var I=!0===E?ad:E;D.configure({ranges:I})}var w={canSelect:!0,getIsSelectionLocked:!1,isInnerDimensionLocked:!1,lockedDimensions:[],singleSelectIndex:0,selectionInfo:{colorField:void 0,components:[],event:void 0,currentComponent:void 0,previousComponent:void 0}},T=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.selections,r=t.brush,i=t.majorScale,o=t.actions,a=t.selectionsFn,s=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).path,l=void 0===s?"/qHyperCubeDef":s;if(!n)return{layout:function(){},filteredFields:function(){},allowSimultaneous:function(){},release:function(){}};var u=++Xc,c=null,d={dimensions:[],measures:[]},m=[],f={};n.on=n.on.bind(n),n.isActive=n.isActive.bind(n),n.addListener=n.addListener.bind(n),n.removeListener=n.removeListener.bind(n);var p=Hc({brush:r,getConfig:function(){return{layout:c,allowSimultaneous:m}}}),h=p.rangeInterceptor,y=p.interceptor;r.intercept("set-ranges",h),r.intercept("toggle-ranges",h),r.intercept("toggle-values",y),r.intercept("set-values",y),r.intercept("add-values",y),r.on("start",(function(){return n.begin(l)}));var g={activate:function(){},deactivated:function(){return r.end()},cleared:function(){return r.clear()},canceled:function(){return r.end()}};Qc(n,g);var v=null==i||null===(e=i.max)||void 0===e?void 0:e.call(i);return null!=o&&o.select?(o.select.on("start",(function(){var e;r.start(),"function"==typeof o.select.getBrushOptions&&(f=(e=o.select).getBrushOptions.apply(e,arguments))})),o.select.on("end",(function(){var e=a(r,f,c),t=Bc({layout:c,filtered:d});e.forEach((function(e){var r=Wc({selection:e,fieldMap:t});(function(e,t,n){if(t&&void 0!==n&&"selectHyperCubeContinuousRange"===e.method){var r=e.params;if(r&&r[1]&&r[1][0]){var i=r[1][0],o=i.qDimIx,a=i.qRange;"undefined"!==o&&a&&!1===a.qMaxInclEq&&a.qMax>=n&&(a.qMaxInclEq=!0)}}})(r,o.select.brushSelectionIncludeMax,v),n.select(r)}))}))):r.on("update",(function(){var e=a(r,f,c),t=Bc({layout:c,filtered:d});e.forEach((function(e){n.select(Wc({selection:e,fieldMap:t}))}))})),0===Gc.length&&Jc(),Gc.push({key:u,selections:n}),{layout:function(e){c=e},filteredFields:function(e){d=e},allowSimultaneous:function(e){m=e},release:function(){c=null;var e=Gc.indexOf(Gc.filter((function(e){return e.key===u}))[0]);-1!==e&&Gc.splice(e,1),Gc.length||Zc(),ed(n,g)}}}({brush:D,majorScale:u,actions:n,selections:r,picassoQ:i,selectionsFn:O});!function(e){var t=e.brush,n=e.interceptors,r=void 0===n?{}:n;Object.entries(r).forEach((function(e){var n=Va(e,2),r=n[0],i=n[1];(Array.isArray(i)?i:[i]).forEach((function(e){t.intercept(r,e)}))}))}({brush:D,interceptors:q});var N=function(e){var t=e.chart,n=e.selectionActions,r=e.brush,i=e.actions,o=e.selectionInfo,a=e.selections,s=e.selectionEvents,l=function(e){var t=e.brush,n=e.chart,r=e.selectionInfo,i=e.brushEvents,o=void 0===i?{}:i,a=Object.entries(o).map((function(e){var i=Va(e,2),o=i[0],a=i[1],s=function(){return a({chart:n,selectionInfo:r})};return t.on(o,s),[o,s]}));return function(){a.forEach((function(e){var n=Va(e,2),r=n[0],i=n[1];t.removeListener(r,i)}))}}({brush:r,chart:t,selectionInfo:o,brushEvents:e.brushEvents}),u=od({chart:t,selectionInfo:o,selectionActions:n,actions:i,selections:a,selectionEvents:s}),c=function(e){var t=e.actions;if(null==t||!t.lasso)return function(){};var n=!1,r=function(e){n||e.key!==$c||(t.lasso.action(!0),n=!0)},i=function(e){e.key===$c&&(t.lasso.action(!1),n=!1)};return document.addEventListener("keydown",r),document.addEventListener("keyup",i),function(){document.removeEventListener("keydown",r),document.removeEventListener("keyup",i)}}({actions:i});return function(){l(),u(),c()}}({chart:t,brush:D,actions:n,selections:r,selectionInfo:w.selectionInfo,selectionActions:{clear:m,reset:f},selectionEvents:h,brushEvents:g});if(s){var L=!0===s?Ba(Array(15)).map((function(e,t){return"qHyperCube/qMeasureInfo/".concat(t)})):s;T.allowSimultaneous(L)}return{unbindEvents:N,state:w,picassoSelections:T,brush:D}}var ld=["colorField","useLegendCube"];function ud(e){var t=e.chart,n=e.selections,r=e.actions,i=void 0!==r&&r,o=e.config,a=void 0===o?{}:o,s=sd({chart:t,actions:i,selections:n,picassoQ:Fc,config:a}),l=s.unbindEvents,u=s.state,c=s.picassoSelections,d=s.brush,m=a.custom,f=void 0===m?{}:m,p=a.legendAlias,h=void 0===p?void 0:p,y=a.setBrushAliases,g=void 0===y?_c:y;return{getIsDimensionLocked:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return u.lockedDimensions[e]},getIsSelectionLocked:function(){var e,t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return null!==(e=null==n||null===(t=n.isLocked)||void 0===t?void 0:t.call(n))&&void 0!==e?e:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(null==e||!e.length)return!1;var t=e.filter((function(e){return"object"===za(e.data)&&Array.isArray(e.data.fields)})).every((function(e){return e.data.fields.every((function(e){var t=e.raw();return!(!t.qLocked&&t.qCardinal)}))}));return t}(r)},getIsSingleSelect:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u.singleSelectIndex;return u.singleSelectDimensions[e]},getCanSelect:function(){return u.canSelect},getSelectionInfo:function(){return u.selectionInfo},setLayout:function(e){var t=function(e){var t,n,r,i=e.selections,o=e.picassoSelections,a=e.layout,s={lockedDimensions:[],singleSelectDimensions:[]};null!=i&&null!==(t=i.isModal)&&void 0!==t&&t.call(i)&&i.confirm(),o.layout(a);var l=(null!==(n=null==a?void 0:a.qHyperCube)&&void 0!==n?n:{}).qDimensionInfo,u=void 0===l?[]:l;return s.lockedDimensions=u.map((function(e){return!!e.qLocked})),s.singleSelectDimensions=u.map((function(e,t){return zc({layout:a,path:"qHyperCube/qDimensionInfo/".concat(t)})})),s.singleSelectIndex=function(e){var t,n=((null==e?void 0:e.qHyperCube)||{}).qDimensionInfo,r=void 0===n?[]:n;return null!==(t=r.map((function(e,t){var n;return!(e.qLocked||(null===(n=e.qCardinalities)||void 0===n?void 0:n.qHypercubeCardinal)<=1)&&t})).filter((function(e){return"number"==typeof e}))[0])&&void 0!==t?t:Math.max(r.length-1,0)}(a),s.canSelect=0===u.length||u.some((function(e){return!e.qLocked})),s.dimensionLocked=!(null===(r=u[0])||void 0===r||!r.qLocked),s}({selections:n,picassoSelections:c,layout:e});Object.assign(u,t)},setFilteredFields:function(e){c.filteredFields(e)},setBrushAliases:function(e){var t=e.colorField,n=e.useLegendCube,r=void 0!==n&&n,i=ja(e,ld),o=Pa({useLegendCube:r,colorField:t,brush:d,legendAlias:h},i);g(Pa(Pa({},o),{},{defaultFunc:function(){return _c(o)}}))},destroy:function(){l(),c.release()},custom:Pa({},f)}}var cd="'Source Sans Pro', 'Arial', 'sans-serif'",dd="#333333",md="#595959",fd="#737373",pd="#cccccc",hd="#e6e6e6";function yd(e){var t={};return[].concat(Ba(e),Ba([["","","color"],["object","","fontFamily"],["object","axis.label.name","color",md],["object","axis.label.name","fontFamily",cd],["object","axis.label.name","fontSize","12px"],["object","axis.line.major","color",pd],["object","axis.line.minor","color",hd],["object","axis.title","color"],["object","axis.title","fontFamily",cd],["object","axis.title","fontSize","13px"],["object","grid.line.highContrast","color",hd],["object","grid.line.major","color",pd],["object","grid.line.minor","color",hd],["object","label.value","color",md],["object","label.value","fontFamily",cd],["object","label.value","fontSize","12px"],[!1,"label.value","darkColor",md],[!1,"label.value","lightColor",hd],["object","outOfRange","color","#999"],["object","legend.title","color",dd],["object","legend.title","fontFamily",cd],["object","legend.title","fontSize","15px"],["object","legend.label","color",md],["object","legend.label","fontFamily",cd],["object","legend.label","fontSize","13px"],["object","referenceLine.label.name","color",dd],["object","referenceLine.label.name","fontFamily",cd],["object","referenceLine.label.name","fontSize","12px"],["object","referenceLine.outOfBounds","color",hd],["object","referenceLine.outOfBounds","fontFamily",cd],["object","referenceLine.outOfBounds","fontSize","12px"],["object","referenceLine.outOfBounds","backgroundColor",fd,function(e){return"transparent"===e?fd:e}]])).reduce((function(e,n){var r="".concat(n[0],"-").concat(n[1],"-").concat(n[2],"}");return t[r]||(t[r]=!0,e.push(n)),e}),[]).sort((function(e,t){return(e[0].split?e[0].split(".").length:0)-(t[0].split?t[0].split(".").length:0)}))}var gd=function(e){return e};function vd(e){var t=e.theme,n=e.id,r=e.transform,i=e.extend,o=e.matrix,a={},s=r.reduce((function(e,t){var n=Va(t,2),r=n[0],i=n[1];return e[r]=i,e}),{});return o.forEach((function(e){var r=Va(e,5),i=r[0],o=r[1],l=r[2],u=r[3],c=r[4],d=void 0===c?function(e){return e}:c,m=function(e){var t=e.theme,n=e.base,r=e.path,i=e.attribute,o=e.defaultValue,a=void 0===o?void 0:o;if(!t||!1===n)return a;var s=t.getStyle(n,r,i);return void 0===s?a:s}({theme:t,base:"object"===i&&n?"".concat("object",".").concat(n):i,path:o,attribute:l,defaultValue:u}),f=(s["".concat(o,".").concat(l)]||gd)(d(m));Ul(a,[o,l].filter(Boolean).join("."),f)})),i.forEach((function(e){var t=Va(e,2),n=t[0],r=t[1];Ul(a,n,r)})),a}var bd={NOOP:function(){},FALSE:function(){return!1},ARRAY:function(){return[]},OBJECT:function(){return{}}},xd="chart-modules-tooltip",Sd="#".concat(xd);function Md(){if(!document.querySelector(Sd)){var e=document.createElement("div");e.id=xd,e.style.overflow="hidden",e.style.position="fixed",e.style.pointerEvents="none",e.style.left="0px",e.style.top="0px",e.style.width="100%",e.style.height="100%",e.style.zIndex=1020,document.body.appendChild(e)}}function Ed(e){return{show:!0,key:e.key,type:"tooltip",layout:{displayOrder:3},beforeMount:function(){Md()},beforeUpdate:function(){Md()},destroyed:function(){var e;null!=(e=document.querySelector(Sd))&&e.parentElement&&e.childElementCount<1&&e.parentElement.removeChild(e)},settings:{appendTo:function(){return document.querySelector(Sd)},direction:e.rtl?"rtl":"ltr",duration:e.duration},style:{arrow:{color:"#404040"},content:{display:"table","border-spacing":"4px",background:"rgba(64, 64, 64, 0.9)",opacity:"1",fontSize:"13px",fontFamily:"'Source Sans Pro', 'Arial', 'sans-serif'","empty-cells":"show"},cell:{"max-width":"180px","word-break":"break-word","word-wrap":"break-word","overflow-wrap":"break-word",hyphens:"auto"}}}}var Cd="position",qd={bar:"rect",diamond:"path",point:"circle",square:"rect",triangle:"path","n-polygon":"path",slice:"path"},Ad=function(e){return e.data.value},Od=function(e){var t,n=e.data;return null==n||null===(t=n.major)||void 0===t?void 0:t.value};function Dd(e){var t=e.chart,n=e.expando,r=e.nodes,i=e.collectConfig,o=e.collectibles,a=e.meta,s=i.from,l={chart:t,expando:n,nodes:r,collectConfig:i,collectibles:o,meta:a};switch("function"==typeof s?"custom":s){case"single":return function(e){var t=Va(e.nodes,1)[0];return["container"===t.type&&t.children[0]||t]}(l);case"position":return function(e){var t=e.collectibles,n=e.meta;return e.chart.shapesAt(n.position.absolute,{components:t.map((function(e){return{key:e.key}}))})}(l);case"dimension":return function(e){var t=e.chart,n=e.collectConfig,r=e.collectibles,i=Va(e.nodes,1)[0],o=n.filter,a="function"==typeof o?o:function(){return!0},s=n.by,l=void 0===s?Ad:s;return r.reduce((function(e,n){var r=n.major,o=void 0===r?Od:r,a=qd[n.type]||n.type;return e.push.apply(e,Ba(t.findShapes(a).filter((function(e){return e.key===n.key&&e.data&&o({data:e.data})===l({data:i.data})})))),e}),[]).filter(a)}(l);case"radius":return function(e){var t=e.chart,n=e.collectConfig,r=e.collectibles,i=e.meta,o=Va(e.nodes,1)[0].localBounds,a=n.distance,s=n.filter,l="function"==typeof s?s:function(){return!0},u=r.map((function(e){return e.key}));return t.shapesAt({cx:i.position.absolute.x,cy:i.position.absolute.y,r:a||Math.max(o.width,o.height)},{components:u.map((function(e){return{key:e}}))}).filter(l)}(l);case"custom":return function(e){var t=e.chart,n=e.expando,r=e.nodes,i=e.meta;return e.collectConfig.from({chart:t,expando:n,nodes:r,meta:i})}(l);default:return[]}}var Id=Number.MAX_VALUE;function wd(e){var t=e.nodes.reduce((function(e,t){var n=t.bounds;return e.xMin=Math.min(e.xMin,n.x,n.x+n.width),e.yMin=Math.min(e.yMin,n.y,n.y+n.height),e.xMax=Math.max(e.xMax,n.x,n.x+n.width),e.yMax=Math.max(e.yMax,n.y,n.y+n.height),e}),{xMin:Id,xMax:-Id,yMin:Id,yMax:-Id}),n=t.xMin,r=t.xMax,i=t.yMin;return{x:n,y:i,width:r-n,height:t.yMax-i}}function Td(e){var t=e.chart,n=e.config,r=e.expando,i=e.placementConfig,o=e.hovered,a=e.collected,s=e.meta,l=function(e){for(var t=e.chart,n=e.config,r=e.expando,i=e.placementConfig,o=e.hovered,a=e.collected,s=e.meta,l=Va(o,1)[0],u=Array.isArray(i)?i:[i],c={bounds:l.bounds,key:l.key},d=wd({nodes:a}),m=0;m<u.length;m++){var f=u[m];if("function"==typeof f){var p=f({chart:t,expando:r,hovered:o,collected:Ba(a),meta:s,collectedBounds:d,combineBounds:wd});if(p)return p}if("trigger"===f)return c;if("collectible"===f){var h=n.main.placements.collectible;return{bounds:"function"==typeof h?h({collected:Ba(a)}):d,key:a[0].key}}}return c}({chart:t,config:n,expando:r,placementConfig:i,hovered:o,collected:a,meta:s}),u=l.bounds,c=l.key,d=Va(a,1)[0].desc;return[{bounds:u,nodes:a,data:a.map((function(e){return e.data})),key:c,meta:s,desc:d}]}function Nd(e){var t=e.chart,n=e.config,r=e.expando,i=e.internal,o=e.nodes;if(!o.length)return[];var a=Va(o,1)[0].key,s=n.main.collectibles;if(!s.length)return[];var l=n.main.triggers.find((function(e){return-1!==e.keys.indexOf(a)}))||{},u=l.collect,c=l.placement;if(!u||!u.from||!c)return[];var d={triggerer:a,position:i.get(Cd)},m=(Dd({chart:t,expando:r,nodes:o,collectConfig:u,collectibles:s,meta:d})||[]).map((function(e){return e.children.length?e.children[0]:e}));return m.length?Td({chart:t,config:n,expando:r,placementConfig:c,hovered:o,collected:m,meta:d}):[]}var Ld=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼ‎ⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),kd=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞‏יִײַ-ﬨשׁ-ﭏ]"),Rd=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]"),Pd=function(e){return Ld.test(e)},Fd=function(e){return kd.test(e)||Rd.test(e)};function zd(e){for(var t=e?e.length:0,n=0;n<t;n++){var r=e[n];if(Pd(r))return"ltr";if(Fd(r))return"rtl"}return"ltr"}function _d(e){var t=e.config,n=e.h,r=e.context,i=e.nodes,o=e.property,a=e.filter,s=e.visibility,l=e.fillColor,u=t.rtl,c={type:"color",label:void 0,value:void 0,content:[],filter:a,visibility:Pa(Pa({},{count:!0}),s)},d=t.getColorSettings();if("color"===d.type||!d.fieldType)return c;var m=Va(i,1)[0];if(c.value=function(e){var t=e.config,n=e.context,r=e.property,i=e.node,o=i.data[r];if(o){if(-3===i.data.value)return i.data.label;var a=n.resources.dataset(o.source.key).field(o.source.field).formatter(),s=o.value,l=o.label,u=t.getColorSettings();if(a&&"measure"===u.fieldType)return Number.isNaN(+s)?"-":a(o.value);var c=l||s;return void 0===c||Number.isNaN(c)||"NaN"===c?"-":c}}({config:t,context:r,property:o,node:m}),void 0===c.value)return c;c.label=function(e){var t=e.context,n=e.property,r=e.node,i=e.config.getColorSettings();if(i.label)return i.label;var o=r.data[n];if(o&&"color"!==i.type){var a=t.resources.dataset,s=o.source,l=s.key,u=s.field;return a(l).field(u).title()}}({config:t,context:r,property:o,node:m});var f=null!=l?l:function(e){var t=e.node.attrs;return(null==t?void 0:t.fill)||"#ddd"}({node:m}),p=n("div",{style:{display:"inline-block",width:10,height:10,"background-color":f,margin:"0 8px"}});return c.content.push({content:u?[":",c.label]:[c.label,":"],style:{"text-align":u?"right":"left",direction:zd(c.label)}},{content:u?[c.value,p]:[p,c.value],style:{"text-align":u?"left":"right","vertical-align":"middle",direction:zd(c.value)}}),c}function $d(e){var t=e.config,n=e.h,r=e.context,i={section:function(e){return function(e){return{type:"section",content:e.content}}({content:e.content})},text:function(e){var n=e.value,r=e.style,i=e.visibility;return function(e){var t=e.config,n=e.value,r=e.style,i=void 0===r?{}:r,o=i.bold,a=void 0!==o&&o,s=i.italic,l=e.visibility;return{type:"text",content:[{content:n,style:{"font-weight":a?"bold":"normal","font-style":void 0!==s&&s?"italic":"normal","text-align":t.rtl?"right":"left",direction:zd(n)},colspan:2}],visibility:Pa(Pa({},{count:!0}),l)}}({config:t,value:n,style:r,visibility:i})},measure:function(e){var r=e.label,i=e.value,o=e.color,a=e.style,s=e.survive,l=e.visibility;return function(e){var t,n,r,i,o=e.h,a=e.label,s=e.value,l=e.color,u=e.style,c=e.survive,d=e.visibility,m=e.config.rtl,f=o("div",{style:{display:"inline-block",width:10,height:10,"background-color":l,margin:"0 8px"}});return{type:"measure",label:a,value:s,content:[{content:m?[":",a]:[a,":"],style:{"text-align":m?"right":"left","font-weight":null!=u&&null!==(t=u.label)&&void 0!==t&&t.bold?"bold":"normal","font-style":null!=u&&null!==(n=u.label)&&void 0!==n&&n.italic?"italic":"normal",direction:zd(a)}},{content:l?m?[s,f]:[f,s]:s,style:{"text-align":m?"left":"right","vertical-align":"middle","font-weight":null!=u&&null!==(r=u.value)&&void 0!==r&&r.bold?"bold":"normal","font-style":null!=u&&null!==(i=u.value)&&void 0!==i&&i.italic?"italic":"normal",direction:zd(s)}}],survive:Pa(Pa({},{color:!1,duplicate:!1}),c),visibility:Pa(Pa({},{count:!0}),d)}}({config:t,h:n,label:r,value:i,color:o,style:a,survive:s,visibility:l})},divider:function(){return function(e){var t=e.visibility;return{type:"divider",content:[{content:"",style:{"background-image":"linear-gradient(transparent 8px, rgba(255, 255, 255, 0.4) 8px, rgba(255, 255, 255, 0.4) 9.2px, transparent 9.2px)",height:"17px"},colspan:2}],visibility:Pa(Pa({},{count:!1}),t)}}({visibility:(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).visibility})},row:function(e){return function(e){var t=e.visibility;return{type:"row",content:[{content:e.content,style:e.style,colspan:e.colspan}],visibility:Pa(Pa({},{count:!0}),t)}}({content:e.content,style:e.style,colspan:e.colspan,visibility:e.visibility})},raw:function(e){return function(e){var t=e.visibility;return{type:"raw",content:e.value,visibility:Pa(Pa({},{count:!0}),t)}}({value:e.value,visibility:e.visibility})},color:function(e){var i=e.nodes,o=e.property,a=e.filter,s=void 0===a||a,l=e.visibility,u=e.fillColor;return _d({config:t,h:n,context:r,nodes:i,property:o,filter:s,visibility:l,fillColor:u})}};return i}function Hd(e){var t=e.chart,n=e.translator,r=e.config,i=e.expando,o=e.h,a=e.data,s=e.style,l=Va(a,1)[0],u=function(e){var t=e.config,n=e.nodes.reduce((function(e,n){var r=t.main.getGroupByValue({data:n.data});return e[r]||(e[r]={sorting:Object.keys(e).length,items:[]}),e[r].items.push(n),e}),{});return Object.keys(n).map((function(e){return n[e]})).sort((function(e,t){return e.sorting-t.sorting})).map((function(e){return e.items}))}({config:r,nodes:l.node.nodes}),c=function(e){var t=e.chart,n=e.config,r=e.expando,i=e.h,o=e.context,a=e.groups,s=o.node.meta,l=o.resources,u=l.dataset,c=l.formatter,d=$d({config:n,h:i,context:o}),m=function(e){var t=e.dataset;return{dataset:{title:function(e,n){return t(e).field(n).title()}}}}({dataset:u}),f=a.map((function(e){var t=d.section({content:Ba((n.main.section({expando:r,h:i,nodes:e,dataset:u,formatter:c,meta:s,create:d,util:m})||[]).filter((function(e){var t;return null===(t=e.content)||void 0===t?void 0:t.length}))).filter(Boolean)});return t.content=function(e){var t=e.config,n=e.content,r=n.find((function(e){return"color"===e.type&&e.filter})),i=r?n.filter((function(e){return"measure"!==e.type||e.survive.color||e.label!==r.label||e.value!==r.value})):n;return t.main.showDuplicateMeasures?i:i.reduce((function(e,t){var n=t.type,r=t.survive;if("measure"!==n||r.duplicate)return e.filtered.push(t),e;var i="".concat(t.label,"-").concat(t.value);return e.memory[i]||(e.memory[i]=!0,e.filtered.push(t)),e}),{memory:{},filtered:[]}).filtered}({config:n,content:t.content}),t}));return n.main.sections({chart:t,expando:r,h:i,nodes:o.node.nodes,dataset:u,formatter:c,meta:s,create:d,util:m,sections:f}),f.filter(Boolean)}({chart:t,config:r,expando:i,h:o,context:l,groups:u}),d=function(e){var t=e.translator,n=e.config,r=e.context,i=e.templates,o=n.main.layout,a=o.rows,s=o.grouping,l=o.single,u=function(e){var t=e.limit,n=e.grouping,r=e.single,i={count:0,overflow:0,index:{started:void 0,group:void 0}};return{process:function(e){var o=e.visibility,a=e.index;if(r&&0!==a)return n?(i.index.started!==a&&i.index.group!==a&&(i.overflow++,i.index.group=a),!1):(i.overflow++,!1);if(i.count>=t){if(!n)return i.overflow++,!1;if(i.index.started!==a)return i.index.group!==a&&(i.overflow++,i.index.group=a),!1}return o.count&&i.count++,n&&(i.index.started=a),!0},overflow:function(){return i.overflow}}}({limit:a,grouping:s,single:"function"==typeof l?l({meta:r.node.meta,sections:i}):l}),c=i.reduce((function(e,t,n){var r=t.type,o=t.content;"section"===r&&(void 0===o?[]:o).forEach((function(t){u.process({visibility:t.visibility,index:n})&&e.push(t.content)}));var a=n===i.length-1;return"divider"!==r||a||u.process({visibility:t.visibility,index:n})&&e.push(t.content),e}),[]).filter((function(e){return e.length})),d=u.overflow();return d&&c.push(function(e){var t=e.translator,n=e.config,r=e.count,i=t?t.get("Object.ChartTooltip.NMore",r):"+".concat(r," more"),o=zd(i);return[{content:i,style:{"font-weight":"bold","text-align":n.rtl?"right":"left",direction:o},colspan:2}]}({translator:t,config:n,count:d})),c}({translator:n,config:r,h:o,context:l,templates:c});return d.length?function(e){var t=e.h,n=e.style;return e.rows.map((function(e){return t("tr",{},e.map((function(e){var r={style:Pa(Pa({},n.cell||{}),e.style||{}),class:e.class};return e.colspan&&(r.colspan=e.colspan),t("td",r,e.content)})))}))}({h:o,style:s,rows:d}):function(e){var t=e.h;return t("tr",{},t("td",{style:{fontStyle:"italic",opacity:.75}},"Empty"))}({h:o})}function jd(e){var t=e.chart,n=e.translator,r=e.config,i=e.expando,o=e.internal;if(!r.main.key)return!1;var a=Yl(),s=Ed({key:r.main.key,rtl:r.rtl,duration:r.duration}),l=r.main.events.tooltip,u=l.afterShow,c=l.afterHide,d=function(){var e=a.get("collected");return{expando:i,nodes:e.nodes,meta:e.meta}};return ts(!0,s,{settings:{filter:function(e){return Nd({chart:t,config:r,expando:i,internal:o,nodes:e})},extract:function(e){return a.set("collected",e.node),e},content:function(e){var o=e.h,a=e.data,s=e.style;return Hd({chart:t,translator:n,config:r,expando:i,h:o,data:a,style:s})},placement:function(e){var t=e.nodes;return r.main.placement({meta:t[0].meta})},afterShow:function(){return u(d())},afterHide:function(){return c(d())}},style:{arrow:{color:r.style.background},content:r.style}})}function Vd(e){var t=e.config,n=t.legend.keys;if(!n.tooltip||!n.component)return!1;if("categorical"!==t.getColorSettings().type)return!1;var r=Ed({key:n.tooltip,rtl:t.rtl,duration:t.duration});return ts(!0,r,{settings:{filter:function(e){return e.filter((function(e){return e.data&&e.key===n.component}))},extract:function(e){return e},content:function(e){var t=e.h,n=e.data;return[t("tr",{},[t("td",{style:Pa(Pa({},e.style.cell||{}),{"font-weight":"bold","text-align":"left"}),colspan:2},n[0].node.data.label)])]},placement:"pointer"},style:{arrow:{color:t.style.background},content:t.style}})}function Bd(e){var t=e.config.main.triggers.reduce((function(e,t){return t.keys.forEach((function(n){var r=t.distance||0;e.distance[n]=r,e.distances.includes(r)||e.distances.push(r),e.key[n]=!0,e.keys[r]||(e.keys[r]=[]),e.keys[r].push(n)})),e}),{distance:{},distances:[],key:{},keys:{}});return function(e){return e.components.filter((function(e){return t.key[e.key]})).reduce((function(e,n){e.any=!0,e.components.push(n.key);var r=t.distance[n.key];return 0===r?e.position.push(n.key):(e.distances.includes(r)||(e.distances.push(r),e.distanceKeys[r]=[]),e.distanceKeys[r].push(n.key)),e}),{any:!1,components:[],position:[],distances:[],distanceKeys:{}})}}var Ud=function(){return!0};function Yd(e){var t=e.config.main.triggers.reduce((function(e,t){var n=t.filter;return t.keys.forEach((function(t){e[t]="function"==typeof n?n:Ud})),e}),{});return function(e){var n=t[e.key];return!n||n(e)}}function Wd(e){var t=e.chart,n=e.event,r=e.component,i={absolute:{x:0,y:0},relative:{x:0,y:0}},o=t.element.getBoundingClientRect(),a=o.left,s=o.top;i.absolute.x=(void 0===n.clientX?Math.floor(n.srcEvent.clientX):n.clientX)-a,i.absolute.y=(void 0===n.clientY?Math.floor(n.srcEvent.clientY):n.clientY)-s;var l=t.component(r);if(l){var u=l.rect.computedInner;i.relative.x=i.absolute.x-u.x,i.relative.y=i.absolute.y-u.y}return i}function Gd(e){var t=e.chart,n=e.filter,r=e.hits,i=e.position,o=[];if(r.position.length&&o.push.apply(o,Ba(t.shapesAt(i.absolute,{components:r.position.map((function(e){return{key:e}}))}).filter(n))),!o.length&&r.distances.length){var a=[];r.distances.forEach((function(e){a.push.apply(a,Ba(t.shapesAt({cx:i.absolute.x,cy:i.absolute.y,r:e},{components:r.distanceKeys[e].map((function(e){return{key:e}}))}).filter(n)))})),a.length&&o.push(function(e){var t=e.nodes,n=e.origin,r=t.find((function(e){return"path"===e.type}));if(r)return r;var i=function(e){var t=Math.abs(n.x-(e.localBounds.x+e.localBounds.width/2)),r=Math.abs(n.y-(e.localBounds.y+e.localBounds.height/2));return Math.sqrt(t*t+r*r)};return t.slice(1).reduce((function(e,t){var n=i(t);return n<e.distance&&(e.distance=n,e.node=t),e}),{node:t[0],distance:i(t[0])}).node}({nodes:a,origin:i.relative}))}return o}function Xd(e){var t=e.chart,n=e.config,r=e.expando,i=e.internal,o=e.facade,a=n.delay.tap,s=Bd({config:n}),l=Yd({config:n}),u=n.main.triggers.reduce((function(e,t){return e.push.apply(e,Ba(t.keys)),e}),[]);return{key:"event:".concat("tooltipTap"),type:"Tap",options:{event:"tooltipTap",enable:function(e,r){return!r||!!n.enable({event:r})&&t.componentsFromPoint({x:r.center.x,y:r.center.y}).filter((function(e){return-1!==u.indexOf(e.key)})).length>0}},recognizeWith:"tap",events:Ha({},"tooltipTap",(function(e){if(e.preventDefault(),"mouse"!==e.pointerType&&!n.main.suppress({event:e})){var u=t.component(n.main.key);if(u&&u.show){var c=t.componentsFromPoint({x:e.center.x,y:e.center.y}),d=s({components:c});if(d.any){var m=Va(d.components,1)[0],f=Wd({chart:t,event:e,component:m});i.set(Cd,f);var p=Gd({chart:t,filter:l,hits:d,position:f});if(p.length){var h=p[0].key;n.main.events.tooltip.beforeShow({expando:r,event:e,collectNodes:function(){return o.collectNodes({nodes:p})},meta:{triggerer:h,position:f}}).then((function(){u.emit("show",e,{nodes:p,delay:a})})).catch((function(){}))}else u.emit("hide")}else u.emit("hide")}}}))}}function Kd(e){var t=e.chart,n=e.config,r=e.expando,i=e.internal,o=e.facade,a=Bd({config:n}),s=Yd({config:n}),l=function(e){var t=e.config,n=e.expando,r=e.internal,i=e.facade,o=t.main.events.tooltip.beforeShow,a=t.delay.hover,s={ongoing:{},latest:void 0};return function(e){var t=e.event,l=e.tooltip,u=e.nodes,c=function(e){var t=e.nodes;return JSON.stringify(t.map((function(e){var t;return{key:e.key,bounds:e.bounds,value:null===(t=e.data)||void 0===t?void 0:t.value}})))}({nodes:u});if(!s.ongoing[c]){s.ongoing[c]=!0,s.latest=c;var d=u[0].key;o({expando:n,event:t,collectNodes:function(){return i.collectNodes({nodes:u})},meta:{triggerer:d,position:r.get(Cd)}}).then((function(){c===s.latest&&l.emit("show",t,{nodes:u,delay:a})})).catch((function(){l.emit("show")})).finally((function(){delete s.ongoing[c],c===s.latest&&(s.latest=void 0)}))}}}({config:n,expando:r,internal:i,facade:o}),u=[n.main.key,n.legend.keys.tooltip].filter(Boolean),c=function(){u.forEach((function(e){var n=t.component(e);null!=n&&n.show&&n.emit("hide")}))};return{type:"native",events:{mousemove:function(e){if(n.enable({event:e})&&!n.main.suppress({event:e})){var r=t.componentsFromPoint({x:e.clientX,y:e.clientY}),o=t.component(n.main.key);if(o&&o.show){var u=a({components:r});if(u.any){var c=Va(u.components,1)[0],d=Wd({chart:t,event:e,component:c});i.set(Cd,d);var m=Gd({chart:t,filter:s,hits:u,position:d});if(!m.length)return void o.emit("hide");l({event:e,tooltip:o,nodes:m})}else o.emit("hide")}var f=n.legend;if(f.keys.tooltip&&f.keys.component){var p=t.component(f.keys.tooltip);p&&p.show&&(r.some((function(e){return e.key===f.keys.component}))?p.emit("show",e):p.emit("hide"))}}},mouseup:function(e){2===e.button&&c()},mouseleave:function(){n.main.events.interaction.mouseleave({expando:r}),c()},wheel:function(){c()}}}}function Jd(e){var t=e.chart,n=e.translator,r=function(e){var t=e.config;return ts(!0,{},{rtl:!1,enable:bd.FALSE,getColorSettings:bd.OBJECT,style:{fontSize:void 0,fontFamily:void 0,color:void 0,background:void 0},delay:{hover:500,tap:0},duration:8e3,main:{key:void 0,suppress:bd.FALSE,getGroupByValue:bd.NOOP,collectibles:[],triggers:[],placement:function(){return{type:"bounds"}},placements:{collectible:"combine"},showDuplicateMeasures:!1,layout:{rows:7,grouping:!1,single:!1},section:bd.ARRAY,sections:bd.NOOP,events:{tooltip:{beforeShow:function(){return Promise.resolve()},afterShow:bd.NOOP,afterHide:bd.NOOP},interaction:{mouseleave:bd.NOOP}}},legend:{keys:{tooltip:void 0,component:void 0}}},void 0===t?{}:t)}({config:e.config}),i=Yl(),o=Yl(),a={components:void 0,interactions:void 0};return{getComponents:function(){return a.components||(a.components=function(e){var t=e.config;return[jd({chart:e.chart,translator:e.translator,config:t,expando:e.expando,internal:e.internal}),Vd({config:t})].filter(Boolean)}({chart:t,translator:n,config:r,expando:i,internal:o})),a.components},getInteractions:function(){return a.interactions||(a.interactions=function(e){var t=e.chart,n=e.config,r=e.expando,i=e.internal,o=function(e){var t=e.chart,n=e.config,r=e.expando,i=e.internal;return{collectNodes:function(e){var o=e.nodes,a=Va(Nd({chart:t,config:n,expando:r,internal:i,nodes:o}),1)[0];return(void 0===a?{nodes:[]}:a).nodes}}}({chart:t,config:n,expando:r,internal:i});return{gestures:[Xd({chart:t,config:n,expando:r,internal:i,facade:o})],native:Kd({chart:t,config:n,expando:r,internal:i,facade:o})}}({chart:t,config:r,expando:i,internal:o})),a.interactions},expando:i}}var Zd=["American Typewriter, serif","Andalé Mono, monospace","Arial Black, sans-serif","Arial, sans-serif","Bradley Hand, cursive","Brush Script MT, cursive","Comic Sans MS, cursive","Courier, monospace","Didot, serif","Georgia, serif","Impact, sans-serif","Lucida Console, monospace","Luminari, fantasy","Monaco, monospace","QlikView Sans, sans-serif","Source Sans Pro, sans-serif","Tahoma, sans-serif","Times New Roman, serif","Trebuchet MS, sans-serif","Verdana, sans-serif"],Qd=["Abril Fatface, serif","Bangers, fantasy","EB Garamond, serif","Fredoka One, fantasy","Graduate, fantasy","Gravitas One, serif","Nixie One, sans-serif","Noto Sans, sans-serif","PT Serif, serif","Permanent Marker, fantasy","Rammetto One, fantasy","Roboto, sans-serif","QlikView Sans, sans-serif","Source Sans Pro, sans-serif","Titan One, fantasy","Open Sans, sans-serif","Montserrat, sans-serif","Raleway, sans-serif","Bebas Neue, sans serif","Lobster, fantasy","Pacifico, cursive","Inter, sans-serif","Indie Flower, fantasy","Yanone Kaffeesatz, sans-serif"],em=function(e){return{value:e,label:e.charAt(0).toUpperCase()+e.slice(1),groupHeader:!1,disabled:!1}};function tm(e){var t=e.theme,n=e.translator,r=e.id,i=e.path,o=e.flags,a=function(){return t.getStyle(r,i,"fontFamily")};return{getDefaultValue:function(){return a()},getOptions:function(){return function(e){var t=e.theme,n=e.translator,r=e.defaultValue,i=e.flags,o=[],a=t.getStyle("","","fontFamilies");return Array.isArray(a)&&a.length?o.push.apply(o,Ba(new Set([r].concat(Ba(a.map((function(e){return e.split(",").map((function(e){return e.trim()})).map((function(e){return e.replace(/\s+/g," ").trim()})).filter(Boolean).join(", ")}))))))):o.push(r),[{value:"ThemeHeader",label:n.get("properties.themeFonts"),metaText:n.get("properties.theme"),groupHeader:!0}].concat(Ba(o.map((function(e){return em(e)}))),[{value:"DefaultHeader",label:n.get("properties.allFonts"),metaText:n.get("properties.default"),groupHeader:!0}],Ba(function(e){return null!=e&&e.isEnabled("PS_20852_WYSIWYG_FONT_SUPPORT")?Qd:Zd}(i).map((function(e){return em(e)}))))}({theme:t,translator:n,defaultValue:a(),flags:o})}}}var nm=["10px","11px","12px","13px","14px","15px","16px","17px","18px","19px","20px","21px","22px","23px","24px"],rm=function(e){return{value:e,label:e,groupHeader:!1,disabled:!1}};function im(e){var t=e.theme,n=e.translator,r=e.id,i=e.path,o=function(){return t.getStyle(r,i,"fontSize")};return{getDefaultValue:function(){return o()},getOptions:function(){return function(e){var t=e.translator,n=e.defaultValue,r=[],i=e.theme.getStyle("","","fontSizes");return Array.isArray(i)&&i.length?r.push.apply(r,Ba(new Set([n].concat(Ba(i))))):r.push(n),[{value:"ThemeHeader",label:t.get("properties.themeFontSizes"),metaText:t.get("properties.theme"),groupHeader:!0}].concat(Ba(r.map((function(e){return rm(e)}))),[{value:"DefaultHeader",label:t.get("properties.allFontSizes"),metaText:t.get("properties.default"),groupHeader:!0}],Ba(nm.map((function(e){return rm(e)}))))}({theme:t,translator:n,defaultValue:o()})}}}function om(e){var t=e.theme,n=e.translator,r=e.id,i=e.path;return{fontFamily:tm({theme:t,translator:n,id:r,path:i,flags:e.flags}),fontSize:im({theme:t,translator:n,id:r,path:i})}}var am={dataRelatedPropertiesPaths:["qHyperCube.qGrandTotalRow","qHyperCube.qHasOtherValues","qHyperCube.qSize","qHyperCube.qDimensionInfo[].qAttrDimInfo","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"]};function sm(e){const{qHyperCube:t,...n}=e,{qAxisData:r,qDataPages:i,qStackedDataPages:o,qTreeDataPages:a,...s}=t,l=G(!0,{},{...n,qHyperCube:{...s,qAxisData:null,qDataPages:null,qStackedDataPages:null,qTreeDataPages:null}}),{dataRelatedPropertiesPaths:u}=am;return u.forEach((e=>{const t=e.split("[");if(1===t.length)void 0!==Vl(l,e)&&Ul(l,e,null);else{const e=t[0],n=t[1].split("].")[1];Vl(l,e,[]).forEach((e=>{void 0!==Vl(e,n)&&Ul(e,n,null)}))}})),l}var lm={axes:{trackBy:function({isTime:e,isContinuous:t,isMeasure:n,isMajor:r}){return i=>{if(e||t||n){var o;if("line"===i.type)return null!==(o=i.tickValue)&&void 0!==o?o:"axis";if("text"===i.type)return`${i.tickValue} ${i.text}`;if("container"===i.type){const e=i.children.filter((e=>"text"===e.type)).map((e=>e.text));return`${i.data.value} ${e.join("")}`}return Math.random()}if(r){if("line"===i.type&&void 0===i.tickValue)return"axis";const e=i.transform&&i.transform.match(/rotate/gi)?"rotated":"horizontal";return`${i.data.group?`${i.data.group.value} `:""}${i.data.value} ${i.text} ${e}`}return Math.random()}},compensateForLayoutChanges:function({isMeasure:e,isTime:t,isContinuous:n,isHorizontal:r,dock:i}){return({currentNodes:o,currentRect:a,previousRect:s})=>{const l=a.x-s.x,u=a.y-s.y,c=a.width-s.width,d=a.height-s.height;e?("left"===i&&o.forEach((e=>{"line"===e.type?(e.x1+=c,e.x2+=c):"text"===e.type&&(e.x+=c)})),"left"!==i&&"right"!==i||o.forEach((e=>{var t;("line"===e.type&&(e.x1===e.x2?(e.y1=a.y,e.y2=e.y1+a.height):(Math.round(e.y1)<a.y||e.y1>a.y+a.height)&&(e.strokeWidth=0)),"text"===e.type)&&((e.y<a.y||e.y>a.y+a.height)&&(e.fontSize="1px","#"===(null===(t=e.fill)||void 0===t?void 0:t[0])&&(e.fill=`${e.fill.slice(0,1)}00${e.fill.slice(1)}`)))})),"top"!==i&&"bottom"!==i||o.forEach((e=>{var t;("line"===e.type&&(e.y1===e.y2?(e.x1=a.x,e.x2=e.x1+a.width):(Math.round(e.x1)<a.x||e.x1>a.x+a.width)&&(e.strokeWidth=0)),"text"===e.type)&&((e.x<a.x||e.x>a.x+a.width)&&(e.fontSize="1px","#"===(null===(t=e.fill)||void 0===t?void 0:t[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+=c:e.x1===e.x2&&(e.x1-=l,e.x2-=l):"text"===e.type&&(e.x-=l)})):n||r?o.forEach((e=>{"line"===e.type&&e.y1===e.y2&&(e.x1+=l,e.x2+=l+c)})):o.forEach((e=>{"line"===e.type&&e.x1===e.x2&&(e.y1+=u,e.y2+=u+d)}))}}},bars:{trackBy: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}`},compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const r=t.x-n.x,i=t.y-n.y;0===r&&0===i||e.forEach((e=>{e.children&&e.children.length>0&&e.children.forEach((e=>{void 0!==e.x&&void 0!==e.y?(e.x-=r,e.y-=i):e.transform=`translate(${-r}, ${-i})`}))}))}},barOobs:{compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const r=t.x-n.x;0===t.y-n.y&&0===r||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 r=t.x-n.x,i=t.y-n.y;0===r&&0===i||e.forEach((e=>{e.transform&&e.transform.match(/rotate\(-90/gi)?(e.x+=i,e.y-=r):(e.x-=r,e.y-=i)}))},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){var t;return"line"===e.type?null!==(t=e.value)&&void 0!==t?t: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 r=t.x-n.x,i=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-=i,e.y2-=i):e.x1===e.x2&&(e.y2=e.y1+t.height,e.x1-=r,e.x2-=r);else{const t="x"===e.major.p?r/e.major.size:i/e.major.size,n="y"===e.minor.p?i/e.minor.size:r/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 r=t.x-n.x;0===t.y-n.y&&0===r||e.forEach((e=>{e.opacity=0}))}},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 r=t.x-n.x,i=t.y-n.y;0===r&&0===i||e.forEach((e=>{e.cx-=r,e.cy-=i}))}},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 r=t.x-n.x,i=t.y-n.y,o=t.width-n.width,a=t.height-n.height;let s=-r,l=-i;e.forEach((e=>{switch(e.dock){case"right":r>0&&(s=t.width);break;case"left":o<0&&(s=-n.width);break;case"top":a<0&&(l=-n.height);break;case"bottom":i>0&&(l=t.height)}switch(e.type){case"text":case"rect":e.x+=s,e.y+=l;break;case"circle":e.cx+=s,e.cy+=l;break;case"path":e.transform=`translate(${s}, ${l})`}}))}},shadowBars:{trackBy:function(){return Math.random()}},cacheProperties:function({viewCache:e,layout:t}){const n=sm(t);e.set("dataIndependentProperties",JSON.stringify(n))},propertiesHaveChanged:function({viewCache:e,layout:t}){const n=sm(t);return e.get("dataIndependentProperties")!==JSON.stringify(n)},nonUpdatingNode:{trackBy:function(){return Math.random()}}};const{getInputValue:um,extractInfoFromInputValue:cm,resolveValue:dm}=pa;var mm={resolveValue:dm,resolveInnerValues:({refLineLayout:e,refLineModel:t,layoutService:n})=>{if(n.meta.isGroupedByDimension){const r=um({refLineLayout:e,layoutService:n});return cm(r,t,"innerValues")}},resolveNumInnerValues:({refLineLayout:e,refLineModel:t,layoutService:n})=>{if(n.meta.mode.K)return 0;const r=um({refLineLayout:e,layoutService:n});return cm(r,t,"numInnerValues")||0},resolveValueText:({refLineLayout:e,refLineModel:t,layoutService:n})=>{const{dimensionValuesInfo:r}=t,{canBeContinuous:i}=n.meta,o=um({refLineLayout:e,layoutService:n});return r[o]&&i?r[o].qText:o},resolveValueInfo:({refLineLayout:e,refLineModel:t,layoutService:n})=>{const r=um({refLineLayout:e,layoutService:n}),{dimensionRefLineInfo:i}=t;return i[r]}};const fm=({isDimension:e,refLineLayout:t,refLineModel:n,layoutService:r,colorModel:i,dockService:o,chart:a,scale:s,axis:l,invert:u,component:c,isContinuous:d})=>{var m,f;const p={dir:l,line:{strokeWidth:(null==t||null===(m=t.style)||void 0===m?void 0:m.lineThickness)||2,strokeDasharray:null==t||null===(f=t.style)||void 0===f?void 0:f.lineType,stroke:i.resolveUIColor(t.paletteColor||{index:t.color})}};return!e||r.meta.isContinuous?(p.scale=s,p.value=t.refLineExpr.value):(p.valueInfo=mm.resolveValueInfo({refLineLayout:t,refLineModel:n,layoutService:r}),p.value=()=>{var e;const i=pa.getScaledPosition({scale:a.scale(s),value:mm.resolveValue({refLineLayout:t,refLineModel:n,layoutService:r}),valueInfo:p.valueInfo,size:null===(e=a.component(c))||void 0===e?void 0:e.rect["horizontal"===o.meta.major.orientation?"width":"height"],align:t.align,invert:u,layoutService:r,isContinuous:d});return Number.isNaN(i)?void 0:i}),p};function pm({isDimension:e,refLineModel:t={},layoutService:n,colorModel:r,dockService:i,animationsEnabled:o,chart:a,scale:s,axis:l,rtl:u,key:c,mainComponentKey:d,path:m,minimumLayoutMode:f}){const p=e?t.dimensionRefLines:m?t.query.getRefLines(m):t.measureRefLines;if(!p.length)return!1;const h={key:c,type:"ref-line",layout:{minimumLayoutMode:f},lines:{y:[],x:[]},style:{oob:{show:!1}},preferredSize:()=>({size:0,edgeBleed:{left:1,right:1,top:1,bottom:1}}),animations:{enabled:o,trackBy:lm.lines.trackBy,compensateForLayoutChanges:lm.lines.compensateForLayoutChanges}},y=!(!e||"horizontal"!==i.meta.major.orientation||!u),g=!e||n.meta.isContinuous;return p.forEach((o=>{h.lines[l].push(fm({isDimension:e,refLineLayout:o,refLineModel:t,layoutService:n,colorModel:r,dockService:i,chart:a,scale:s,axis:l,invert:y,component:d,isContinuous:g}))})),h}const hm={referenceLine:{label:{name:{fontFamily:"Source Sans Pro, sans-serif",fontSize:"12px"}},outOfBounds:{backgroundColor:"#737373",color:"#e6e6e6",fontFamily:"Source Sans Pro, sans-serif",fontSize:"10px"}}},ym=({isDimension:e,layoutService:t,animationsEnabled:n,style:r,labels:i,scale:o,formatter:a,dock:s,key:l,rtl:u,theme:c,isContinuous:d,localeInfo:m})=>({key:l,type:"reference-line-labels",renderer:"svg",labels:i,formatter:a,scale:o,layoutService:t,layout:{dock:s,rtl:u},theme:c,isContinuous:d,isDimension:e,localeInfo:m,style:{label:{fontFamily:r.referenceLine.label.name.fontFamily,fontSize:r.referenceLine.label.name.fontSize,padding:{top:2,bottom:2,left:u?2:4,right:u?4:2},background:{padding:{top:1,bottom:1,left:2,right:2}},maxWidth:100,gap:"left"===s||"right"===s?10:16},oob:{size:8,fill:r.referenceLine.outOfBounds.backgroundColor,text:{fontFamily:r.referenceLine.outOfBounds.fontFamily,fontSize:r.referenceLine.outOfBounds.fontSize,fill:r.referenceLine.outOfBounds.color,background:{fill:r.referenceLine.outOfBounds.backgroundColor}}}},animations:{enabled:n,trackBy:lm.refLineLabels.trackBy,compensateForLayoutChanges:lm.refLineLabels.compensateForLayoutChanges}}),gm=({refLineLayout:e,refLineModel:t,layoutService:n,colorModel:r,scale:i,theme:o,isContinuous:a})=>{const s=r.resolveUIColor(e.paletteColor||{index:e.color}),l={align:e.align,text:e.label,fill:e.coloredBackground?o.getContrastingColorTo(s):s,showValue:!1!==e.showValue,showLabel:!1!==e.showLabel,inputValue:e.refLineExpr.value,inputValueLabel:e.refLineExpr.label};return e.coloredBackground&&(l.background={fill:s}),a?(l.scale=i,l.value=e.refLineExpr.value):(l.value=()=>mm.resolveValue({refLineLayout:e,refLineModel:t,layoutService:n}),l.valueText=()=>mm.resolveValueText({refLineLayout:e,refLineModel:t,layoutService:n}),l.valueInfo=()=>mm.resolveValueInfo({refLineLayout:e,refLineModel:t,layoutService:n})),l};function vm({isDimension:e,refLineModel:t={},layoutService:n,colorModel:r,animationsEnabled:i,dock:o,scale:a,style:s,formatter:l,theme:u,localeInfo:c,rtl:d,key:m,path:f}){const p=e?t.dimensionRefLineLabels:f?t.query.getRefLineLabels(f):t.measureRefLineLabels;if(!p.length)return[];const h=[],y=!e||n.meta.isContinuous,g=p.map((e=>gm({refLineLayout:e,refLineModel:t,layoutService:n,colorModel:r,scale:a,theme:u,isContinuous:y})));return h.push(ym({isDimension:e,rtl:d,style:G(!0,hm,s),dock:o,key:m,labels:g,scale:a,formatter:l,layoutService:n,animationsEnabled:i,theme:u,isContinuous:y,localeInfo:c})),h}function bm({layoutService:e,discreteModel:t}){const{isContinuous:n,canBeContinuous:r,isGroupedByDimension:i}=e.meta,o=e.getLayout(),a="K"===o.qHyperCube.qMode,s=ue.dimensionless(o),l=pa.getMeasureRefLines(o),u=pa.getDimensionRefLines(o,s),c=pa.getMeasureRefLineLabels(o),d=pa.getDimensionRefLineLabels(o,s);let m={},f={};const p=()=>!(!u||!u.length)&&!u.every((t=>{const o=pa.getInputValue({refLineLayout:t,layoutService:e});return(t=>{if(r){const n=e.getLayoutValue("qHyperCube.qDimensionInfo.0"),{qMin:r,qMax:i}=n;return pa.isOutOfRange({value:t,qMin:r,qMax:i})}return!1})(o)||(t=>{if(!f[t])return!1;if(!n&&i){const n={valueInfo:f[t]},r="S"===e.getHyperCubeValue("qMode")?"qDataPages.0":"qStackedDataPages.0",i=e.getHyperCubeValue(r);return pa.isOutOfDataPages({label:n,dataPages:i})}return!0})(o)})),h={isKMode:a,canBeContinuous:r,measureRefLines:l,dimensionRefLines:u,measureRefLineLabels:c,dimensionRefLineLabels:d,dimensionRefLineInfo:f,dimensionValuesInfo:m,query:{getRefLines:e=>pa.getRefLines(o,e),getRefLineLabels:e=>pa.getRefLineLabels(o,e)},update:()=>{f=h.dimensionRefLineInfo,p()&&(m=pa.getDimensionValuesInfo({layout:o,canBeContinuous:r,discreteModel:t,layoutService:e}),h.dimensionValuesInfo=m,u.forEach((t=>{const n=pa.getInputValue({refLineLayout:t,layoutService:e});m[n]&&(f[n]?(f[n].innerValues=m[n].innerValues,f[n].minOrder=Math.min(f[n].minOrder,m[n].minOrder),f[n].maxOrder=Math.max(f[n].maxOrder,m[n].maxOrder),f[n].isMinOrderOk=f[n].isMinOrderOk||m[n].isMinOrderOk,f[n].isMaxOrderOk=f[n].isMaxOrderOk||m[n].isMaxOrderOk):f[n]={id:m[n].id,qText:m[n].qText,innerValues:m[n].innerValues,minOrder:m[n].minOrder,maxOrder:m[n].maxOrder,isMinOrderOk:m[n].isMinOrderOk,isMaxOrderOk:m[n].isMaxOrderOk},f[n].numInnerValues=(f[n].maxOrder||0)-(f[n].minOrder||0)+1)})))}};return h.update(),h}var xm={DATA:{MAIN:"qHyperCube",REDUCED:"reduced-data"},SCALE:{MAJOR:"main-major",MAJOR_INNER:"major-inner",MINOR:{PRIMARY:"minor-primary",SECONDARY:"minor-secondary",REDUCED_PRIMARY:"reduced-minor-primary",REDUCED_SECONDARY:"reduced-minor-secondary"},COLOR:"color",REDUCED:"reduced-major"},COMPONENT:{BAR:"bar-series",BAR_LABEL:"bar-label",BAR_OOB_LABEL:"bar-oob-label",STACK_BAR:"stack-bar",STACK_BAR_LABEL:"stack-bar-label",AXIS:{MAJOR:"major-axis",MAJOR_CONTINUOUS:"major-axis-continuous",TIME_INNER:"major-axis-time-inner",TIME_OUTER:"major-axis-time-outer",MINOR:{PRIMARY:"minor-primary-axis",SECONDARY:"minor-secondary-axis"}},AXIS_OVERLAY:{TIME_INNER:"axis-overlay-time-inner",TIME_OUTER:"axis-overlay-time-outer",CONTINUOUS:"axis-overlay-continuous"},AXIS_TITLE:{MAJOR:"major-axis-title",MINOR:{PRIMARY:"minor-primary-axis-title",SECONDARY:"minor-secondary-axis-title"}},MARKER:"marker-series",LINE:"line-series",POINT:"point-component",LABEL_SPACE:"label-space-component",POINT_LABEL:"point-label",GRID_LINE:"grid-line",ZERO_LINE:"zero-line",LEGEND:"legend",LEGEND_CATEGORICAL:"legend-cat",LEGEND_TOOLTIP:"legend-tooltip",TOOLTIP:"tooltip-qcm",MINI_CHART:{BAR:"mini-chart-bar-series",LINE:"mini-chart-line-series",MARKER:"mini-chart-marker-series"},BAR_OOB:"bar-oob",GHOST_BAR_OOB:"ghost-bar-oob",SLICED_HAT:"sliced-hat",DATA_OOB_MARKER:"data-out-of-bounds-marker",PRIMARY_MEASURE_AXIS_REF_LINE:"primary-mes-axis-ref-line",SECONDARY_MEASURE_AXIS_REF_LINE:"secondary-mes-axis-ref-line",DIMENSION_REF_LINE:"dim-ref-line",PRIMARY_MEASURE_AXIS_REF_LINE_LABEL:"primary-mes-ref-line-label",SECONDARY_MEASURE_AXIS_REF_LINE_LABEL:"secondary-mes-ref-line-label",DIMENSION_REF_LINE_LABEL:"dim-ref-line-label"},COLLECTION:{PRIMARY:"primary-collection",SECONDARY:"secondary-collection",STACKED_PRIMARY:"stacked-collection-primary",STACKED_SECONDARY:"stacked-collection-secondary",STACKED_TOTAL_PRIMARY:"stacked-total-collection-primary",STACKED_TOTAL_SECONDARY:"stacked-total-collection-secondary",REDUCED:"reduced-collection",REDUCED_PRIMARY:"reduced-collection-primary",REDUCED_SECONDARY:"reduced-collection-secondary",REDUCED_STACKED_PRIMARY:"reduced-collection-stacked-primary",REDUCED_STACKED_SECONDARY:"reduced-collection-stacked-secondary",LINE:"line-collection"},FORMATTER:{PRIMARY:"primary-formatter",SECONDARY:"secondary-formatter"}},Sm={TYPE:{LINE:"line",BAR:"bar",MARKER:"marker"},AXIS:{PRIMARY:0,SECONDARY:1},NOPE_SERIES:{type:"bar",axis:0}};const Mm={CUSTOM:{EXPRESSION:"customTooltipExpression",TITLE:"customTooltipTitle",DESCRIPTION:"customTooltipDescription",QUARANTINE:"customTooltip",IMAGES:"customTooltipImages"},CHART:{CONTAINER_ID:"tooltipContainerId",STATE:"customTooltipSessionState",CHART_OBJECT_ID:"customTooltipSessionObjectId",CHART_PARENT_TYPE:"TooltipChartParent",CHART_CHILD_TYPE:"TooltipChart",STYLE:{small:"140px",medium:"200px",large:"340px"}}};function Em(e){const t=e.split("/");return"qmem:"===t[0]&&""===t[1]}const Cm={getImageSize(e,t){let n;function r(){n&&(clearTimeout(n),n=null)}function i(e){const t=e;t.onload=null,t.onerror=null,r()}const o={small:50,medium:200,large:340,original:340};return new Promise((a=>{const s=new Image;s.referrerPolicy="no-referrer",s.onload=()=>{let e;const{height:n,width:l}=s,u=o[t]*(n>l?1:n/l),c=o[t]*(l>n?1:l/n);!n||!l||0===n&&0===l?(e={height:20,width:20,imageError:!0},i(s)):"original"===t?(e={height:Math.min(u,n),width:Math.min(c,l)},r()):(e={height:u,width:c},r()),a(e)},s.onerror=()=>{i(s),a({height:20,width:20,imageError:!0})},s.src=e,n=setTimeout((()=>{i(s),a({height:20,width:20,imageError:!0})}),3e3)}))}};async function qm(e,t,n){let r=e.ref.qStaticContentUrl.qUrl;const i=function(e){var t,n,r,i,o;let a,s,l,u,c,d;if(e&&(null!==(t=e.session)&&void 0!==t&&t.options||null!==(n=e.enigmaModel)&&void 0!==n&&null!==(r=n.session)&&void 0!==r&&r.sessionConfig||null!==(i=e.session)&&void 0!==i&&null!==(o=i.config)&&void 0!==o&&o.url)){var m;if(a=e.session.options||(null===(m=e.enigmaModel)||void 0===m?void 0:m.session.sessionConfig),!a){var f;a=null===(f=e.session)||void 0===f?void 0:f.config;const t=new URL(a.url);a.host=t.hostname,a.port=t.port,a.isSecure="wss:"===t.protocol}return d=void 0!==a.secure?a.secure:a.isSecure,s=d?"https://":"http://",l=a.host||"localhost",u=a.port?`:${a.port}`:"",c=a.prefix?a.prefix:"/","/"!==c[c.length-1]&&(c=`${c}/`),s+l+u+c}return""}(n);i&&(!function(e,t){const n=e.replace(t,"").replace(/^\.\.\//i,"/");n[0]}(r,i),r=r.replace(/"/g,'\\"'),r=r.replace(/'/g,"\\'"),r=function(e,t){return t+("/"===e[0]?e.substr(1):e)}(r,i));const{height:o,width:a,imageError:s}=await Cm.getImageSize(r,t);return{src:r,size:t,height:o,width:a,imageError:s}}async function Am(e,t,n,r){var i,o,a,s,l,u;const{app:c,flags:d}=t,m=null===(i=e.layout)||void 0===i||null===(o=i.tooltip)||void 0===o?void 0:o.imageComponents;if(!m)return[];const[f]=m,p=f.size||"small",h=f.type||"media";let y=-1;for(let e=0;e<n.length;e++)if(n[e].cId===f.cId){y=e;break}const g=(null===(a=r.data)||void 0===a||null===(s=a.customTooltipAttrExps)||void 0===s?void 0:s.value)||[];let v;if(-1!==y&&g[y]&&(v=g[y]),"media"===h&&null!==(l=f.ref)&&void 0!==l&&null!==(u=l.qStaticContentUrl)&&void 0!==u&&u.qUrl)return qm(f,p,c);if("url"===h)return async function(e,t,n,r,i){let o,a=n.ref;if(i&&i.label&&(a=i.label),t.isEnabled("IMAGE_BUNDLE_LOAD")&&null!=e&&e.getImage&&Em(a))try{const t=`data:image/png;base64, ${await e.getImage(a)}`,{height:n,width:i,imageError:s}=await Cm.getImageSize(t,r);o={src:t,size:r,height:n,width:i,imageError:s}}catch(e){}else{const{height:e,width:t,imageError:n}=await Cm.getImageSize(a,r);o={src:a,size:r,height:e,width:t,imageError:n}}return o}(c,d,f,p,v);if(d.isEnabled("IMAGE_BUNDLE_LOAD")&&"field"===h&&v&&v.label){return async function(e,t,n,r){let i;const o=r.label,a=`qmem://${t.qFallbackTitle}/${o}`;if(Em(a))try{const t=await e.getImage(a);if(t){const e=`data:image/png;base64, ${t}`,{height:r,width:o,imageError:a}=await Cm.getImageSize(e,n);i={src:e,size:n,height:r,width:o,imageError:a}}}catch(e){}return i}(c,n[y],p,v)}return[]}const Om={async addImagesToTheNodes({customTooltipModel:e,nodes:t,attrExps:n,opts:r}){const i=t,o=[];for(let t=0;t<i.length;t++)o.push(Am(e,r,n,i[t]));const a=await Promise.all(o);for(let e=0;e<i.length;e++)i[e].data.customTooltipImages=[a[e]];return i},checkIfPromisesExist({customTooltipModel:e}){var t,n;const r=null===(t=e.layout)||void 0===t||null===(n=t.tooltip)||void 0===n?void 0:n.imageComponents;return!!r&&r.length>0}},Dm={async handlePromises({customTooltipModel:e,nodes:t,attrExps:n,opts:r}){let i=t;return i=await Om.addImagesToTheNodes({customTooltipModel:e,nodes:t,attrExps:n,opts:r}),i},checkIfPromisesExist:({customTooltipModel:e})=>Om.checkIfPromisesExist({customTooltipModel:e})};const Im=(e,t)=>{var n,r,i;const o=null==e||null===(n=e.qHyperCubeDef)||void 0===n?void 0:n.qDimensions,a=null==e||null===(r=e.qHyperCubeDef)||void 0===r?void 0:r.qMeasures,s=null==e||null===(i=e.qHyperCubeDef)||void 0===i?void 0:i.qInterColumnSortOrder,l=t;return{qInfo:{qType:Mm.CHART.CHART_PARENT_TYPE,qId:Mm.CHART.CHART_OBJECT_ID},qHyperCubeDef:{qDimensions:o,qMeasures:a,qInterColumnSortOrder:s,qInitialDataFetch:[{qWidth:0,qHeight:0}]},qStateName:l}},wm=e=>{var t,n,r;const i=null===(t=e.tooltip)||void 0===t||null===(n=t.chart)||void 0===n||null===(r=n.object)||void 0===r?void 0:r.refId;return{qInfo:{qType:Mm.CHART.CHART_CHILD_TYPE},qExtendsId:i}};const Tm={createContainer:({ctx:e,layout:t})=>{var n,r;if(!((null===(n=t.qHyperCube)||void 0===n||null===(r=n.qDimensionInfo)||void 0===r?void 0:r.length)<=0))return function(e,t){var n,r,i,o;const a=null!==(n=null===(r=t.tooltip)||void 0===r||null===(i=r.chart)||void 0===i||null===(o=i.style)||void 0===o?void 0:o.size)&&void 0!==n?n:"medium",s=Mm.CHART.STYLE[a];return[{content:[e.h("div",{style:{display:"flex",width:s,height:s,backgroundColor:"#FFFFFF",borderRadius:"5px",padding:"2px",color:"#595959"},colspan:2,id:Mm.CHART.CONTAINER_ID})],colspan:2,style:{"text-align":e.rtl?"right":"left","max-width":s,width:"100%"}},{}]}(e,t)},show:async({app:e,properties:t,selectedNodes:n,dimIndex:r,customTooltipModel:i,rtl:o})=>{var a,s,l;const u=i,c=null==t||null===(a=t.tooltip)||void 0===a||null===(s=a.chart)||void 0===s||null===(l=s.object)||void 0===l?void 0:l.refId;if(null!=u&&u.embed&&e.removeSessionAlternateState&&e.addSessionAlternateState&&c&&!(t.qHyperCubeDef.qDimensions.length<=0)){await Tm.hide({app:e,customTooltipModel:i});try{await async function({app:e,properties:t,customTooltipModel:n}){const r=n,i=Mm.CHART.STATE,o=t.qStateName;r.miniChartToken.alternateState||(r.miniChartToken.alternateState=i,await e.addSessionAlternateState(i,o),r.miniChartToken.alternateState=i)}({app:e,properties:t,customTooltipModel:i});const a=await async function({app:e,properties:t,customTooltipModel:n}){var r;const i=n;null!==(r=i.miniChartToken.sessionObj)&&void 0!==r&&r.id&&await e.destroySessionObject(i.miniChartToken.sessionObj.id);const o=Mm.CHART.STATE,a=Im(t,o),s=await e.createSessionObject(a),l=wm(t);if(s.id!==Mm.CHART.CHART_OBJECT_ID)return void e.destroySessionObject(s.id);i.miniChartToken.sessionObj=s;const u=await s.createChild(l);if(i.miniChartToken.sessionObj&&i.miniChartToken.sessionObj.id===s.id)return i.miniChartToken.model=u,u;e.destroySessionObject(s.id)}({app:e,properties:t,customTooltipModel:i});if(u.miniChartToken.alternateState&&u.miniChartToken.sessionObj&&a){var d,m,f,p;const e=n.length>0&&void 0!==(null===(d=n[0].data)||void 0===d?void 0:d.value)?[null===(m=n[0].data)||void 0===m?void 0:m.value]:[],a=void 0!==r?r:t.qHyperCubeDef.qDimensions.length-1;if(2===t.qHyperCubeDef.qDimensions.length&&void 0===r&&n.length>0){var h,y;const e=null!==(h=n[0].data.selectionOuterDimension)&&void 0!==h?h:n[0].data.selectionDimension;if(null!=e&&null!==(y=e.source)&&void 0!==y&&y.field){var g;const t=null==e||null===(g=e.source)||void 0===g?void 0:g.field.split("/"),n=t[t.length-1],r=void 0!==e.value?[e.value]:[];r.length>0&&void 0!==n&&u.miniChartToken.sessionObj.selectHyperCubeValues("/qHyperCubeDef",Number(n),r,!1)}}e.length>0&&u.miniChartToken.sessionObj.selectHyperCubeValues("/qHyperCubeDef",a,e,!1);const s=document.getElementById(Mm.CHART.CONTAINER_ID),l={direction:o?"rtl":"ltr",isReadonly:!0,isPopover:!0,navigation:!1,selections:!1};u.miniChartToken.vis=await i.embed.render({element:s,model:u.miniChartToken.model,options:l,id:null===(f=u.miniChartToken.model)||void 0===f?void 0:f.id,type:null===(p=u.miniChartToken.model)||void 0===p?void 0:p.genericType})}}catch(t){await Tm.hide({app:e,customTooltipModel:i})}}},hide:async({app:e,customTooltipModel:t})=>{const n=t;null!=n&&n.embed&&(Tm.destroyVisualization({customTooltipModel:t}),await e.destroySessionObject(Mm.CHART.CHART_OBJECT_ID),n.miniChartToken.sessionObj=void 0,await async function({app:e,customTooltipModel:t}){const n=t,r=Mm.CHART.STATE;n.miniChartToken.alternateState=void 0,await e.removeSessionAlternateState(r)}({app:e,customTooltipModel:t}))},destroyVisualization:({customTooltipModel:e})=>{var t,n;const r=e;"function"==typeof(null===(t=r.miniChartToken)||void 0===t||null===(n=t.vis)||void 0===n?void 0:n.destroy)&&(r.miniChartToken.vis.destroy(),r.miniChartToken.vis=void 0)}};function Nm(e){const t=e.qHyperCubeDef?e.qHyperCubeDef.qDimensions:e.qHyperCube.qDimensionInfo;if(t&&t.length>0)return t}function Lm(){const{EXPRESSION:e,TITLE:t,DESCRIPTION:n,IMAGES:r}=Mm.CUSTOM,i={};return i[e]=!0,i[t]=!0,i[n]=!0,i[r]=!0,i}function km(e){const t=Lm();return e.filter((e=>t[e.id]))}const Rm={getNodes(e,t){const n=function(e,t){let n=0,r=0;e.center?(n+=e.center.x,r+=e.center.y):(n+=e.clientX,r+=e.clientY);const i=t.element.getBoundingClientRect();return{cx:n-i.left,cy:r-i.top}}(e,t);return t.shapesAt({x:n.cx,y:n.cy})},getDataNodes(e,t){let n,r=[];const i={container:{bar:!0,"bullet-axis":!0},circle:{"point-component":!0}};return t.forEach((t=>{var o,a,s,l;const u=null!==(o=null===(a=t.data)||void 0===a?void 0:a.selectionDimension)&&void 0!==o?o:t.data;if(!u||null!==(s=t.data)&&void 0!==s&&s.customTooltipAttrExps||i[t.type]){if(null!==(l=t.data)&&void 0!==l&&l.customTooltipAttrExps&&!t.data.customTooltipImages){const e=t;e.data.customTooltipImages=[],r.push(e)}}else{n||(n=[],Object.keys(i).forEach((t=>{n=n.concat(e.findShapes(t).filter((e=>e.data&&e.data.customTooltipAttrExps&&!e.data.customTooltipImages&&i[t][e.key])))})));const t=n.filter((e=>{var t,n;const r=null!==(t=null!==(n=e.data.stack)&&void 0!==n?n:e.data.selectionOuterDimension)&&void 0!==t?t:e.data.selectionDimension;return r&&r.value===u.value&&r.label===u.label}));t.length>0&&(r=r.concat(t[0]))}})),r},displayTooltip(e,t,{nodes:n,opts:r={},customTooltipModel:i,extractedNodes:o=[],hide:a}){if(i&&!a){const{layout:a,chart:s}=i,{attrExps:l}=Rm.getAttrExprData(a);o.length||n.length?Dm.handlePromises({customTooltipModel:i,nodes:Rm.getDataNodes(s,o.length>0?o:n),attrExps:l,opts:r}).then((()=>{t.emit("show",e,n.length?{nodes:n}:void 0)})):t.emit("show",e,n.length?{nodes:n}:void 0)}else{var s;null!=i&&null!==(s=i.miniChartToken)&&void 0!==s&&s.alternateState&&Tm.hide({app:r.app,customTooltipModel:i}),t.emit("hide")}},checkIfPromisesExist:({customTooltipModel:e})=>Dm.checkIfPromisesExist({customTooltipModel:e}),getAttrExps(e,t){var n;const r=t,i=null!==(n=e.qHyperCubeDef)&&void 0!==n&&n.qDimensions?"qAttributeExpressions":"qAttrExprInfo";return r[i]||(r[i]=[]),r[i]},getAttrExprData(e){var t;let n=[],r="";const i=(null===(t=e.qHyperCube)||void 0===t?void 0:t.qDimensionInfo)||[];if(i.length>0){var o,a,s;const t=i.length-1;n=(null===(o=e.qHyperCube)||void 0===o||null===(a=o.qDimensionInfo)||void 0===a||null===(s=a[t])||void 0===s?void 0:s.qAttrExprInfo)||[],r=`qDimensionInfo/${t}/qAttrExprInfo`}return{attrExps:n,fieldPath:r}},quarantineCustomTooltipAttrs(e,t={}){var n,r;if(!(null===(n=e.qLayoutExclude)||void 0===n||null===(r=n.quarantine)||void 0===r?void 0:r[Mm.CUSTOM.QUARANTINE])){!function(e,t){const n=t;let r=n.qLayoutExclude;r||(n.qLayoutExclude={quarantine:{}},r=n.qLayoutExclude),r.quarantine||(r.quarantine={}),r.quarantine[Mm.CUSTOM.QUARANTINE]=[],e.forEach((e=>{r.quarantine[Mm.CUSTOM.QUARANTINE].push(e)})),n.qLayoutExclude=r}(km(t.qAttributeExpressions||[]),e)}},unquarantineCustomTooltipAttrs(e){var t,n;const r=e;(null===(t=e.qLayoutExclude)||void 0===t||null===(n=t.quarantine)||void 0===n?void 0:n[Mm.CUSTOM.QUARANTINE])&&delete r.qLayoutExclude.quarantine[Mm.CUSTOM.QUARANTINE]},setAttrsFromQuarantine(e,t){const n=Nm(e);if(!n)return;const r=void 0!==t?t:n.length-1;if(!n[r])return;const i=this.getAttrExps(e,n[r]);if(0===km(i).length){var o,a;const t=(null===(o=e.qLayoutExclude)||void 0===o||null===(a=o.quarantine)||void 0===a?void 0:a.customTooltip)||[],n=[...i,...t],s=e;s.qHyperCubeDef?s.qHyperCubeDef.qDimensions[r].qAttributeExpressions=n:s.qHyperCube.qDimensionInfo[r].qAttrExprInfo=n}},moveCustomTooltipAttrs(e,t={},n){let r=[];const i=Nm(e)||[];[...i,t].forEach((e=>{const t=km(e.qAttributeExpressions||[]);t.length>0&&(r=t)}));const o=Lm(),a=i.map((e=>{const t=e,n=e.qAttributeExpressions||[];return t.qAttributeExpressions=n.filter((e=>!o[e.id])),t})),s=void 0!==n?n:a.length-1;a.length>0&&(a[s].qAttributeExpressions=a[s].qAttributeExpressions.concat(r));const l=e;e.qHyperCubeDef?l.qHyperCubeDef.qDimensions=a:l.qHyperCube.qDimensionInfo=a},addCallbackCustomTooltip(e){e.qHyperCubeDef.qDimensions.length>1?this.moveCustomTooltipAttrs(e):(this.setAttrsFromQuarantine(e),this.unquarantineCustomTooltipAttrs(e))},moveCallbackCustomTooltip(e,t){1===e.qHyperCubeDef.qDimensions.length&&(this.setAttrsFromQuarantine(e),this.unquarantineCustomTooltipAttrs(e)),e.qHyperCubeDef.qDimensions.length>1&&this.moveCustomTooltipAttrs(e,t)},removeCallbackCustomTooltip(e,t){e.qHyperCubeDef.qDimensions.length>0?this.moveCustomTooltipAttrs(e,t):this.quarantineCustomTooltipAttrs(e,t)},replaceCallbackCustomTooltip(e,t){e.qHyperCubeDef.qDimensions.length>1?this.moveCustomTooltipAttrs(e,t):(this.quarantineCustomTooltipAttrs(e,t),this.setAttrsFromQuarantine(e),this.unquarantineCustomTooltipAttrs(e))},shouldIgnoreDefaultRows(e){var t;return(null===(t=e.tooltip)||void 0===t?void 0:t.hideBasic)||0},DEBOUNCE_THRESHOLD:50,getFooterRow:(e,t)=>[{content:e,style:{"font-style":"italic","font-size":"12px","line-height":"16px",color:"rgba(255, 255, 255, 0.6)","text-align":t?"right":"left",direction:ge.detectTextDirection(e)},colspan:2},{}],getImageRow(e,t){const n=ge.detectTextDirection(e.src),r=[],i={style:{display:"block","margin-left":"auto","margin-right":"auto",overflow:"hidden",width:e.width,height:e.height}};if("original"===e.size||e.imageError){r.push(t.h("span",{style:{display:"inline-block",height:"100%","vertical-align":"middle"}}));const n=e.imageError?`${e.src}?${Math.random()}`:e.src;r.push(t.h("img",{style:{"max-width":e.width,"max-height":e.height,"vertical-align":"middle"},src:n,referrerpolicy:"no-referrer"})),i.style["text-align"]="center",i.style["white-space"]="nowrap"}else i.style["background-size"]="contain",i.style["background-repeat"]="no-repeat",i.style["background-position"]="center",i.style["background-image"]=`url('${e.src}')`;return[{content:[t.h("div",i,r),""],style:{"text-align":t.rtl?"right":"left",direction:n,"max-width":e.width},colspan:2},{}]}};function Pm(e,t,n,r){var i,o,a;const s=(null===(i=t.qHyperCube)||void 0===i||null===(o=i[n])||void 0===o||null===(a=o[r])||void 0===a?void 0:a.qAttrExprInfo)||[],l=[],u=e.qSubNodes&&e.qSubNodes[r]?e.qSubNodes[r].qAttrExps:e.qAttrExps;return u?(s.forEach(((e,t)=>{const i=u.qValues&&u.qValues[t]?u.qValues[t]:void 0,o=void 0===i?"NaN":function(e,t){let n;switch(e.id){case Mm.CUSTOM.EXPRESSION:n="NaN"===t.qNum||e.isCustomFormatted?void 0===t.qText?"NaN":t.qText:t.qNum;break;case Mm.CUSTOM.TITLE:case Mm.CUSTOM.DESCRIPTION:case Mm.CUSTOM.IMAGES:n=void 0===t.qText?e.qFallbackTitle:t.qText;break;default:n="NaN"}return n}(e,i);l.push({source:{key:"qHyperCube",field:`${n}/${r}/qAttrExprInfo/${t}`},label:o,value:"value"})})),l):l}const Fm={getNode(e,{dimensionCount:t}){if(!t||t<1)return;const n=t-1,r="qDimensionInfo";return{field:`${r}/${n}`,value:t=>Pm(t,e,r,n)}}};const zm={getCustomAttrExps(e,t,n){var r,i;const o={customTooltipAttrExpsArr:[],customTooltipInfoAttrExpsArr:[]},a=(null===(r=t.data)||void 0===r||null===(i=r.customTooltipAttrExps)||void 0===i?void 0:i.value)||[];if(Number.isNaN(a))return o;return function(e,t,n,r){const i={[Mm.CUSTOM.TITLE]:!0,[Mm.CUSTOM.DESCRIPTION]:!0},{attrExps:o,fieldPath:a}=Rm.getAttrExprData(e);return 0===t.length||0===o.length||""===a||o.forEach(((e,o)=>{const s=t[o];if(e.id===Mm.CUSTOM.EXPRESSION&&s){const t=e.qFallbackTitle,i="NaN"===s.value||e.isCustomFormatted?s.value:n("qHyperCube").field(`${a}/${o}`).formatter()(s.value);r.customTooltipAttrExpsArr.push({label:t,value:i})}else if(i[e.id]&&s){const t="-"!==s.value&&"NaN"!==s.value?s.value:s.label;t&&"undefined"!==t&&r.customTooltipInfoAttrExpsArr.push({...e.id===Mm.CUSTOM.TITLE&&{title:t},value:t,id:e.id})}})),r}(n,a.map((t=>ve.getMeasure(e,t))),e,o)}};function _m({nodes:e,layout:t,dataset:n}){const r=function(e,t,n){const r=[];return e.forEach((e=>{r.push(zm.getCustomAttrExps(n,e,t))})),r}(e,t,n);return r.reduce(((e,t)=>({customTooltipAttrExpsArr:e.customTooltipAttrExpsArr.concat(t.customTooltipAttrExpsArr),customTooltipInfoAttrExpsArr:e.customTooltipInfoAttrExpsArr.concat(t.customTooltipInfoAttrExpsArr)})),{customTooltipAttrExpsArr:[],customTooltipInfoAttrExpsArr:[]})}const{CUSTOM:$m}=Mm;function Hm({flags:e,layout:t,app:n,model:r,picasso:i,chart:o,translator:a,localeInfo:s,embed:l,options:u}){const c={properties:void 0},d=function({layout:e,app:t,picasso:n,model:r,chart:i,translator:o,localeInfo:a,embed:s}){return{layout:e,app:t,picasso:n,model:r,chart:i,translator:o,localeInfo:a,useCustomTooltip:e.tooltip&&!e.tooltip.auto,utils:Rm,miniChartToken:{},embed:s}}({layout:t,app:n,model:r,picasso:i,chart:o,translator:a,localeInfo:s,embed:l}),m="rtl"===u.direction,f=()=>{var e,n;const r=!(null===(e=c.properties)||void 0===e||null===(n=e.qHyperCubeDef)||void 0===n||!n.qDimensions.some((e=>{var t,n;return null===(t=e.qCalcCondition)||void 0===t||null===(n=t.qCond)||void 0===n?void 0:n.qv})));return!(!t.tooltip||t.tooltip.auto||r)};return{setProperties:e=>{c.properties=e},isEnabled:()=>f(),hideBasic:()=>f()&&Vl(t,"tooltip.hideBasic",!1),getAttributes:({dataset:e,nodes:n})=>{var r,i;const o=_m({dataset:e,nodes:n,layout:t});return{title:null===(r=o.customTooltipInfoAttrExpsArr.find((e=>e.id===$m.TITLE)))||void 0===r?void 0:r.title,description:null===(i=o.customTooltipInfoAttrExpsArr.find((e=>e.id===$m.DESCRIPTION)))||void 0===i?void 0:i.value,measures:o.customTooltipAttrExpsArr}},hasImages:()=>Rm.checkIfPromisesExist({customTooltipModel:d}),createImageRow:({value:e,h:t})=>Rm.getImageRow(e,{h:t,rtl:m}),addImages:({nodes:r})=>{const i=Rm.getDataNodes(o,r),{attrExps:a}=Rm.getAttrExprData(t);return Dm.handlePromises({customTooltipModel:d,nodes:i,attrExps:a,opts:{flags:e,app:n}})},chart:{isEnabled:()=>{return!!(f()&&null!==(e=t.tooltip)&&void 0!==e&&null!==(n=e.chart)&&void 0!==n&&null!==(i=n.object)&&void 0!==i&&i.refId&&l&&"function"==typeof(null==r?void 0:r.getEffectiveProperties));var e,n,i},hasLimitation:()=>{var e;return!(null==n||null===(e=n.isInModalSelection)||void 0===e||!e.call(n))},createContainer:({h:e})=>Tm.createContainer({layout:t,ctx:{h:e,rtl:m}}),createLimitationRow:()=>Rm.getFooterRow(a.get("properties.tooltip.notselectedmessage"),m),show:({nodes:e,properties:t})=>Tm.show({app:n,properties:t,selectedNodes:e,customTooltipModel:d,rtl:m}),hasAlternateState:()=>{var e;return!(null===(e=d.miniChartToken)||void 0===e||!e.alternateState)},hide:()=>Tm.hide({app:n,customTooltipModel:d}),destroy:()=>Tm.destroyVisualization({customTooltipModel:d})}}}function jm({key:e,source:t,layoutService:n,fieldModel:r,colorService:i,series:o}){const{meta:a}=n;if(a.isBarSeriesStacked){const{major:a,majorNumeric:s}=r.main,l=o.filter((e=>e.type===Sm.TYPE.BAR)),u=n.meta.isContinuous?s:a,c=e=>"NaN"!==e.qNum?e.qNum:0;return[{key:e,data:{extract:l.map((({ref:e,typeIndex:r,refIndex:o})=>({source:t,field:a,value:n.meta.isContinuous?e=>e.qNum:void 0,props:{major:{field:u},selectionDimension:{field:a},segment:{field:e,value:c,reduceLabel:"none"},end:{field:e,value:c,reduceLabel:"none"},null:{fields:l.map((e=>({field:e.ref}))),value:e=>Array.isArray(e)&&e.every((e=>"NaN"===e)),reduceLabel:"none"},typeIndex:r,...i.getDatumProps(o),customTooltipAttrExps:Fm.getNode(n.getLayout(),n.meta),sumOfPositives:{fields:l.map((e=>({field:e.ref}))),value:e=>e.reduce(((e,t)=>t>0?e+t:e),0),reduceLabel:"none"},sumOfNegatives:{fields:l.map((e=>({field:e.ref}))),value:e=>e.reduce(((e,t)=>t<0?e+t:e),0),reduceLabel:"none"}}}))),stack:{stackKey:e=>e.value,value:e=>e.end.value,offset:"diverging"}}}]}return[]}function Vm({key:e,series:t,source:n,fieldModel:r,colorService:i,layoutService:o,forceCreate:a=!1}){if(t.length||a){const{major:a,majorNumeric:s}=r.main,l=e=>"NaN"!==e.qNum?e.qNum:0,u=o.meta.isContinuous?s:a;return[{key:e,data:{extract:t.map((({ref:e,refIndex:t,typeIndex:r,options:s},c)=>({source:n,field:a,value:o.meta.isContinuous?e=>e.qNum:void 0,props:{major:{field:u},selectionDimension:{field:a},end:{field:e,value:s.showAsZeros?l:void 0,reduceLabel:"none"},start:0,line:c,typeIndex:r,null:{field:e,value:e=>"NaN"===e.qNum,reduceLabel:"none"},customTooltipAttrExps:Fm.getNode(o.getLayout(),o.meta),...i.getDatumProps(t)}})))}}]}return[]}function Bm({key:e,layoutService:t,fieldModel:n,series:r}){const{meta:i}=t;if(i.isBarSeriesStacked){const{major:t,majorNumeric:o}=n.main,a=r.filter((e=>e.type===Sm.TYPE.BAR)),s=i.isContinuous?{field:o,value:e=>e.qNum,reduceLabel:"none"}:[];return[{key:e,data:{extract:{field:0,props:{major:{field:i.isContinuous?o:t},null:{fields:a.map((e=>({field:e.ref}))),value:e=>Array.isArray(e)&&e.every((e=>"NaN"===e)),reduceLabel:"none"},sumOfPositives:{fields:a.map((e=>({field:e.ref}))),value:e=>e.reduce(((e,t)=>t>0?e+t:e),0),reduceLabel:"none"},sumOfNegatives:{fields:a.map((e=>({field:e.ref}))),value:e=>e.reduce(((e,t)=>t<0?e+t:e),0),reduceLabel:"none"},timeStart:s,timeEnd:s},value:i.isContinuous?e=>e.qNum:void 0}}}]}return[]}const Um={MINI_CHART:{value:"miniChart",translation:"properties.scrollbar.miniChart"},BAR:{value:"bar",translation:"properties.scrollbar.bar"},NONE:{value:"none",translation:"properties.scrollbar.none"}};var Ym={OPTIONS:Um,DEFAULT:Um.MINI_CHART};function Wm({layoutService:e,discrete:t}){return({h:n,rect:r,orientation:i,minThumbSize:o})=>{const a=t.query.getCurrentDataPage(),s=e.meta.size.y,l="horizontal"===i,u=r[l?"width":"height"];let c=a.qArea.qTop/s*u,d=a.qArea.qHeight/s*u;if(d<o){const e=(o-d)/2;c=c-e+(Math.max(0,0-(c-e))-Math.max(0,c+d+e-u)),d=o}return n("div",{style:{position:"absolute",right:0,bottom:0,background:"red",opacity:.2,...l?{top:0,left:c,width:d}:{top:c,left:0,height:d}}})}}function Gm({layoutService:e,viewState:t,viewCache:n}){return e.meta.isContinuous?function(e,t){const n=e.get("zoom"),r=t.get("continuousMin"),i=t.get("continuousMax");return[(n.min-r)/(i-r),(n.max-r)/(i-r)]}(t,n):function(e){return e.get("viewRange")}(t)}const Xm=e=>({miniChart:e===Ym.OPTIONS.MINI_CHART.value,bar:e===Ym.OPTIONS.BAR.value,none:e===Ym.OPTIONS.NONE.value}),Km=({layoutService:e})=>{const t=e.getLayoutValue("scrollbar");if(t)return Xm(t);const n=e.getLayoutValue("showMiniChartForContinuousAxis");if(void 0===n)return Xm(Ym.DEFAULT.value);const r=e.getLayoutValue("dimensionAxis.continuousAuto"),i=e.getLayoutValue("preferContinuousAxis");return Xm(!n&&(r||!r&&i)?Ym.OPTIONS.NONE.value:Ym.OPTIONS.MINI_CHART.value)};function Jm({layoutService:e,override:t}){const n=Km({layoutService:e});return t&&t.predicate({layoutService:e,scrollbar:n})&&(n.miniChart=t.value===Ym.OPTIONS.MINI_CHART.value,n.bar=t.value===Ym.OPTIONS.BAR.value,n.none=t.value===Ym.OPTIONS.NONE.value),n}function Zm({componentKey:e,chart:t,viewState:n,viewCache:r,layoutService:i,dockService:o,rtl:a}){return s=>{const{x:l,y:u}=s.center,c=t.element.getBoundingClientRect(),d=t.component(e),m="horizontal"===o.meta.major.orientation,f=m?l-c.left-d.rect.computedInner.x:u-c.top-d.rect.computedInner.y,p=m?d.rect.computedInner.width:d.rect.computedInner.height,h=m&&a?p-f:f,y=Math.max(0,Math.min(h/p,1)),[g,v]=Gm({layoutService:i,viewState:n,viewCache:r}),b=y<g,x=y>v,S=!b&&!x;return{pixel:h,relative:y,thumb:S?h-g*p:0,beforeThumb:b,afterThumb:x,onThumb:S}}}function Qm({componentKey:e,chart:t,viewState:n,viewCache:r,layoutService:i,dockService:o}){return()=>{const a=t.component(e),{orientation:s}=o.meta.major,{width:l,height:u}=a.rect.computedInner,c="horizontal"===s?l:u,[d,m]=Gm({layoutService:i,viewState:n,viewCache:r});return{size:c,thumbSize:(m-d)*c}}}function ef({componentKey:e,chart:t,actions:n,viewState:r,viewCache:i,layoutService:o,dockService:a,discrete:s,rtl:l}){const u=Zm({componentKey:e,chart:t,viewState:r,viewCache:i,layoutService:o,dockService:a,rtl:l}),c=Qm({componentKey:e,chart:t,viewState:r,viewCache:i,layoutService:o,dockService:a});return{type:"Tap",options:{event:"scrollbarTap",enable:(r,i)=>!i||!!n.scroll.enabled()&&t.componentsFromPoint({x:i.center.x,y:i.center.y}).some((t=>t.key===e))},events:{scrollbarTap(n){n.preventDefault();const a=u(n);if(o.meta.isContinuous){const e=r.get("zoom"),t=e.max-e.min,n=i.get("continuousMin"),o=i.get("continuousMax"),s=n+(o-n)*a.relative;r.set("zoom",{min:Math.min(s-t/2,o-t),max:Math.max(s+t/2,n+t)})}else{const e=c(),t=a.pixel-e.thumbSize/2,n=Math.max(0,t/e.size);s.command.scrollTo(n)}t.component(e).emit("render")}}}}const tf="data-scrollbar-handle";function nf({e:e}){return(e.srcEvent||e).srcElement.getAttribute(tf)||""}const rf="scrollbarResize",of=e=>{const[t]=e.changedPointers;return t&&("pointerdown"===t.type||"mousedown"===t.type)};function af({componentKey:e,chart:t,actions:n,viewState:r,viewCache:i,layoutService:o,dockService:a,rtl:s}){const l=Zm({componentKey:e,chart:t,viewState:r,viewCache:i,layoutService:o,dockService:a,rtl:s});return{type:"Pan",key:`event:${rf}`,options:{event:rf,threshold:0,enable(e,t){return!(!o.meta.isContinuous||!n.scroll.enabled())&&(!t||(this[rf]=this[rf]||{},of(t)&&nf({e:t})&&(this[rf].panningEvent=t.srcEvent),!!this[rf].panningEvent))}},events:{[`${rf}start`](n){n.preventDefault(),this[rf]=this[rf]||{},this[rf].panningEvent&&t.component(e).emit("dragStart",this[rf].panningEvent)},[`${rf}move`](n){if(n.preventDefault(),this[rf]=this[rf]||{},!this[rf].panningEvent)return;const o=r.get("zoom"),a=i.get("continuousMin"),s=i.get("continuousMax"),u=i.get("minimiumZoomSpan"),c=(s-a)*l(n).relative+a,d=nf({e:this[rf].panningEvent});let m="start"===d?Math.min(c,o.max):o.min,f="end"===d?Math.max(c,o.min):o.max;m===f&&(m-="start"===d?u:0,f+="end"===d?u:0),r.set("zoom",{min:m,max:f}),t.component(e).emit("render")},[`${rf}end`](n){n.preventDefault(),this[rf]=this[rf]||{},delete this[rf].panningEvent,t.component(e).emit("dragEnd")},[`${rf}cancel`](n){n.preventDefault(),this[rf]=this[rf]||{},delete this[rf].panningEvent,t.component(e).emit("dragEnd")}}}}const sf="scrollbarPan";function lf({componentKey:e,chart:t,actions:n,viewState:r,viewCache:i,layoutService:o,dockService:a,discrete:s,rtl:l}){const u=Zm({componentKey:e,chart:t,viewState:r,viewCache:i,layoutService:o,dockService:a,rtl:l}),c=Qm({componentKey:e,chart:t,viewState:r,viewCache:i,layoutService:o,dockService:a});return{type:"Pan",key:`event:${sf}`,options:{event:sf,threshold:0,enable(r,i){return this[sf]=this[sf]||{},!(i&&!this[sf].isPanning)||!!n.scroll.enabled()&&((!i||i.target===t.element)&&t.componentsFromPoint({x:i.center.x,y:i.center.y}).some((t=>t.key===e)))}},events:{[`${sf}start`](n){n.preventDefault();const a=u(n);if(this[sf]=this[sf]||{},this[sf].isPanning=!0,t.component(e).emit("lockState"),o.meta.isContinuous){const e=r.get("zoom"),t=e.max-e.min,n=i.get("continuousMin"),o=i.get("continuousMax"),s=n+(o-n)*a.relative;s<e.min?r.set("zoom",{min:Math.min(s,o-t),max:Math.max(s+t,n+t)}):s>e.max&&r.set("zoom",{min:Math.min(s-t,o-t),max:Math.max(s,n+t)}),this[sf].relative=a.relative,this[sf].zoom=r.get("zoom"),this[sf].zoom.span=this[sf].zoom.max-this[sf].zoom.min,this[sf].zoom.fullSpan=o-n}else if(a.onThumb)this[sf].offset=a.thumb;else{const e=c();this[sf].offset=a.beforeThumb?0:e.thumbSize}},[`${sf}move`](n){n.preventDefault();const a=u(n);if(this[sf]=this[sf]||{},o.meta.isContinuous){const e=a.relative-this[sf].relative,{fullSpan:t,span:n,min:o,max:s}=this[sf].zoom,l=i.get("continuousMin"),u=i.get("continuousMax");r.set("zoom",{min:Math.min(o+e*t,u-n),max:Math.max(s+e*t,l+n)})}else{const e=a.pixel-(this[sf].offset||0),t=c(),n=Math.max(0,e/t.size);s.command.scrollTo(n)}t.component(e).emit("render")},[`${sf}end`](n){n.preventDefault(),this[sf]=this[sf]||{},this[sf].isPanning=!1,t.component(e).emit("unlockState")},[`${sf}cancel`](n){n.preventDefault(),this[sf]=this[sf]||{},this[sf].isPanning=!1,t.component(e).emit("unlockState")}}}}function uf({componentKey:e,chart:t,actions:n,viewState:r,viewCache:i,layoutService:o,dockService:a,discrete:s,rtl:l}){return[ef({componentKey:e,chart:t,actions:n,viewState:r,viewCache:i,layoutService:o,dockService:a,discrete:s,rtl:l}),af({componentKey:e,chart:t,actions:n,viewState:r,viewCache:i,layoutService:o,dockService:a,rtl:l}),lf({componentKey:e,chart:t,actions:n,viewState:r,viewCache:i,layoutService:o,dockService:a,discrete:s,rtl:l})]}function cf({componentKey:e,chart:t,actions:n,layoutService:r}){const i=(i,o)=>{if(!r.meta.isContinuous)return;const a=t.component(e);a&&a.emit&&n.scroll.enabled()&&a.emit(i,o)};return{type:"native",events:{mousemove:e=>i("hover",e),mouseleave:()=>i("leave")}}}const df={background:"rgba(0, 0, 0, 0.1)"},mf={top:-1,bottom:-1,width:6},ff={width:2,background:"#595959"};var pf={before:df,after:df,thumb:{background:"transparent",border:"1px solid rgba(68, 68, 68, 0.4)"},startHandle:mf,endHandle:mf,startHandleBorder:ff,endHandleBorder:ff};const hf={background:"rgba(0, 0, 0, 0.1)"},yf={top:-1,bottom:-1,width:6},gf={width:2,background:"#595959"};var vf={before:hf,after:hf,thumb:{background:"#B0AFAE",border:"transparent"},startHandle:yf,endHandle:yf,startHandleBorder:gf,endHandleBorder:gf};const bf={position:"absolute",top:0,right:0,bottom:0,left:0,boxSizing:"border-box"},xf={pointerEvents:"initial"},Sf={pointerEvents:"none"};const Mf="ew-resize",Ef="default";function Cf(){const{rect:e}=this,{settings:t}=this.settings,n="horizontal"===t.orientation,r=n?e.computedInner.width:e.computedInner.height,i=t.range(),o=n&&t.rtl;return{size:r,start:(o?1-i[1]:i[0])*r,end:(o?1-i[0]:i[1])*r}}function qf(){const e=this.state.hover.start||this.state.hover.end||this.state.drag.start||this.state.drag.end;this.renderer.element().ownerDocument.body.style.cursor=e?Mf:Ef}function Af(e,t,n){const{min:r}=this.settings.settings.size.thumb;if(n-t<r){const i=(r-(n-t))/2,o=Math.max(0,0-(t-i))-Math.max(0,n+i-e);return{size:e,start:t-i+o,end:n+i+o}}return{size:e,start:t,end:n}}function Of(e){const t=(e.srcEvent||e).srcElement;return this.renderer.element().contains(t)}function Df(){const{size:e,start:t,end:n}=Cf.call(this);this.renderer.render(this.elements(this.h,Af.call(this,e,t,n)))}function If(){const{state:e,settings:t,style:n}=this,r=t.settings.style;return e.style[r]||(e.style[r]=function({id:e,style:t}){const n="slim"===e?vf:pf;return{container:{...bf},before:{...bf,...n.before,...t.before},after:{...bf,...n.after,...t.after},thumb:{...bf,...n.thumb,...t.thumb},startHandle:{...bf,...xf,...n.startHandle},endHandle:{...bf,...xf,...n.endHandle},startHandleBorder:{...bf,...Sf,...n.startHandleBorder},endHandleBorder:{...bf,...Sf,...n.endHandleBorder}}}({id:t.settings.style,style:n[r]})),e.style[r]}var wf={require:["renderer"],defaultSettings:{settings:{style:"standard",size:{area:{min:30,max:40,ratio:1/8},thumb:{min:4}},orientation:"horizontal",rtl:!1,isContinuous:!1,range:()=>[0,1],injections:()=>[]},style:{standard:{before:{},thumb:{},after:{}},slim:{before:{},thumb:{},after:{}}}},renderer:"dom",on:{render(){Df.call(this)},lockState(){this.state.locked=!0},unlockState(){this.state.locked=!1},hover(e){if(this.state.locked||this.state.drag.start||this.state.drag.end||!Of.call(this,e)&&this.state.hover.isPristine())return;this.state.hover.reset();const t=nf({e:e});t&&(this.state.hover[t]=!0),qf.call(this),Df.call(this)},leave(){this.state.locked||(this.state.hover.reset(),qf.call(this),Df.call(this))},dragStart(e){if(this.state.locked)return;this.state.drag.reset();const t=nf({e:e});t&&(this.state.drag[t]=!0),qf.call(this)},dragEnd(){this.state.locked||(this.state.drag.reset(),qf.call(this),Df.call(this))}},preferredSize({outer:e}){const{min:t,max:n,ratio:r}=this.settings.settings.size.area,i="horizontal"===this.settings.settings.orientation?"height":"width";return Math.max(t,Math.min(n,e[i]*r))},created(){this.state={style:{},locked:!1,hover:{start:!1,end:!1,reset(){this.start=!1,this.end=!1},isPristine(){return!this.start&&!this.end}},drag:{start:!1,end:!1,reset(){this.start=!1,this.end=!1}}}},render(e){this.h=e;const{size:t,start:n,end:r}=Cf.call(this);return this.elements(e,Af.call(this,t,n,r))},properties(){return"horizontal"===this.settings.settings.orientation?{start:"left",end:"right"}:{start:"top",end:"bottom"}},elements(e,{size:t,start:n,end:r}){const{settings:i}=this.settings,o=i.injections().map((t=>t({h:e,rect:this.rect,orientation:i.orientation,minThumbSize:i.size.thumb.min})));return function({h:e,size:t,start:n,end:r,properties:i,startHandleActive:o,endHandleActive:a,style:s,continuous:l,invert:u,injections:c}){const d={[i.end]:t-n},m={[i.start]:r},f={left:-3},p={left:1},h={right:-3,left:"auto"},y={left:3},g=e("div",{style:{...s.before,...u?m:d},class:"scrollbar--before"}),v=e("div",{style:{...s.after,...u?d:m},class:"scrollbar--after"}),b=[];if(l){const t=e("div",{style:{...s.startHandle,...u?h:f},class:"scrollbar--start-handle",[tf]:"start"},o?e("div",{style:{...s.startHandleBorder,...u?y:p}}):void 0);b.push(t);const n=e("div",{style:{...s.endHandle,...u?f:h},class:"scrollbar--end-handle",[tf]:"end"},a?e("div",{style:{...s.endHandleBorder,...u?p:y}}):void 0);b.push(n)}const x=e("div",{style:{...s.thumb,[i.start]:n,[i.end]:t-r},class:"scrollbar--thumb"},b);return e("div",{style:{...s.container}},[g,x,v,...c])}({h:e,size:t,start:n,end:r,properties:this.properties(),startHandleActive:this.state.hover.start||this.state.drag.start,endHandleActive:this.state.hover.end||this.state.drag.end,style:If.call(this),continuous:i.isContinuous,invert:"horizontal"===i.orientation&&i.rtl,injections:o})}};function Tf({layoutService:e}){return e.meta.isContinuous&&Jm({layoutService:e}).miniChart}function Nf({models:e}){const{layoutService:t,fieldModel:n,seriesModel:r,colorService:i}=e,{primarySeries:o,secondarySeries:a}=r.meta,s=r.query.series(Sm.TYPE.LINE),l=[...Vm({forceCreate:!0,key:xm.COLLECTION.PRIMARY,series:o,fieldModel:n,colorService:i,layoutService:t}),...Vm({key:xm.COLLECTION.SECONDARY,series:a,fieldModel:n,colorService:i,layoutService:t}),...Vm({key:xm.COLLECTION.LINE,series:s,fieldModel:n,colorService:i,layoutService:t}),...jm({key:xm.COLLECTION.STACKED_PRIMARY,layoutService:t,fieldModel:n,colorService:i,series:o}),...jm({key:xm.COLLECTION.STACKED_SECONDARY,layoutService:t,fieldModel:n,colorService:i,series:a}),...Bm({key:xm.COLLECTION.STACKED_TOTAL_PRIMARY,layoutService:t,fieldModel:n,series:o}),...Bm({key:xm.COLLECTION.STACKED_TOTAL_SECONDARY,layoutService:t,fieldModel:n,series:a})];return Tf(e)&&(l.push(...Vm({key:xm.COLLECTION.REDUCED,source:xm.DATA.REDUCED,series:r.query.all(),fieldModel:n,colorService:i,layoutService:t})),l.push(...Vm({key:xm.COLLECTION.REDUCED_PRIMARY,source:xm.DATA.REDUCED,series:o,fieldModel:n,colorService:i,layoutService:t})),l.push(...Vm({key:xm.COLLECTION.REDUCED_SECONDARY,source:xm.DATA.REDUCED,series:a,fieldModel:n,colorService:i,layoutService:t})),l.push(...jm({key:xm.COLLECTION.REDUCED_STACKED_PRIMARY,source:xm.DATA.REDUCED,layoutService:t,fieldModel:n,series:r.meta.primarySeries.filter((e=>e.type===Sm.TYPE.BAR)),colorService:i})),l.push(...jm({key:xm.COLLECTION.REDUCED_STACKED_SECONDARY,source:xm.DATA.REDUCED,layoutService:t,fieldModel:n,series:r.meta.secondarySeries.filter((e=>e.type===Sm.TYPE.BAR)),colorService:i}))),l}const Lf=({layoutService:e,dockService:t})=>"custom"!==e.getLayoutValue("dimensionAxis.axisDisplayMode")?Math.min(200,t.meta.chart.size["horizontal"===t.meta.major.orientation?"height":"width"]/4):void 0;function kf({models:e}){const{dockService:t,seriesModel:n,layoutService:r}=e,i=2===n.meta.measureAxes.length;if(i)return.5;const o=n.meta.measureAxes[0].isPrimary?t.meta.minor.dock:t.meta.minorSecondary.dock;if(!i){const e=n.meta.measureAxes[0].isPrimary?0:1;if("none"===r.getLayoutValue(`measureAxes.${e}.show`))return.5}return"horizontal"===t.meta.minor.orientation?"near"===o||"bottom"===o?1:0:"near"===o||"left"===o?0:1}const Rf=({models:e,environment:t})=>{const{fieldModel:n,discreteModel:r,layoutService:i,dockService:o}=e,{orientation:a}=o.meta.major;return{data:{extract:{field:n.main.major,props:{selectionDimension:{field:n.main.major}}}},maxPxStep:Lf({layoutService:i,dockService:o}),invert:"horizontal"===a&&"rtl"===t.options.direction,range:r.query.getScaleRange,align:kf({models:e})}},Pf=({models:e,environment:t})=>{const{fieldModel:n,discreteModel:r,layoutService:i,dockService:o}=e,{orientation:a}=o.meta.major;return{type:"group-by-measure",data:{extract:{field:n.main.major}},measureCount:i.meta.groupSize,maxPxStep:Lf({layoutService:i,dockService:o}),invert:"horizontal"===a&&"rtl"===t.options.direction,range:r.query.getScaleRange,align:kf({models:e})}};function Ff({viewState:e,models:t,environment:n}){const{fieldModel:r,dockService:i}=t,{orientation:o}=i.meta.major;return{type:"linear",invert:"horizontal"===o&&"rtl"===n.options.direction,data:{extract:{field:r.main.majorNumeric}},ticks:{forceBounds:!0,count:e.get("zoom").min===e.get("zoom").max?1:void 0},minorTicks:{count:1},min:()=>e.get("zoom").min,max:()=>e.get("zoom").max}}function zf({viewCache:e,mainMajor:t}){return G(!0,{},t,{min:()=>e.get("continuousMin"),max:()=>e.get("continuousMax")})}function _f({viewState:e,viewCache:t,layoutService:n}){return t.set("qTimeAxisCache",[]),{get:(e,n=0)=>{const r=t.get("qTimeAxisCache");return r[n]&&r[n][0]===e?r[n][1]:void 0},set:(e,n,r=0)=>{t.get("qTimeAxisCache")[r]=[e,n]},key:({distance:r})=>{const{min:i,max:o}=e.get("zoom"),a=(o-i)/(t.get("continuousMax")-t.get("continuousMin")),s=n.getHyperCubeValue("qAxisData.qAxis",[]).map((e=>e.qName));return[r,Number.parseFloat(a).toFixed(12),...s].toString()}}}function $f({picasso:e,viewState:t,viewCache:n,models:r,environment:i}){const{layoutService:o,fieldModel:a,appLayoutModel:s,themeService:l}=r,{measureText:u}=e.renderer("svg")(),{majorNumeric:c}=a.main,d=l.getStyles(),m={type:"time",data:{field:c},qAxis:()=>o.getHyperCubeValue("qAxisData.qAxis",[]),field:c,min:()=>t.get("zoom").min,max:()=>t.get("zoom").max,invert:"rtl"===i.options.direction,formatter:{fn:e.formatter("q-time"),localeInfo:s.qLocaleInfo,qNumFormat:o.getHyperCubeValue("qDimensionInfo.0",{}).qNumFormat,measureText:e=>u({text:e,fontFamily:d.axis.label.name.fontFamily,fontSize:d.axis.label.name.fontSize})},ticks:{generator:{type:"d3",initialMin:t.get("zoom").min},anchor:"start",clamp:!0},cache:_f({viewState:t,viewCache:n,layoutService:o})};return{[xm.SCALE.MAJOR]:G(!0,{},m,{ticks:{level:"outer"}}),[xm.SCALE.MAJOR_INNER]:G(!0,{},m,{ticks:{level:"inner"}})}}function Hf({picasso:e,models:t,viewState:n,viewCache:r,environment:i}){const{meta:o}=t.layoutService,a=o.isTime?{...$f({picasso:e,viewState:n,viewCache:r,models:t,environment:i})}:o.isContinuous?{[xm.SCALE.MAJOR]:Ff({models:t,viewState:n,environment:i})}:o.isBarSeriesGrouped?{[xm.SCALE.MAJOR]:Pf({models:t,environment:i})}:{[xm.SCALE.MAJOR]:o.isBarSeriesStackedInBothAxis?Pf({models:t,environment:i}):Rf({models:t,environment:i})};return Tf(t)?{...a,[xm.SCALE.REDUCED]:zf({viewCache:r,mainMajor:a[xm.SCALE.MAJOR]})}:a}function jf({fields:e,tickModel:t,dockService:n,environment:r}){const i="rtl"===r.options.direction,{orientation:o}=n.meta.minor;return{data:{source:"qHyperCube",fields:e},invert:"vertical"===o||i,ticks:{values:t.query.getValues},min:t.query.getMin,max:t.query.getMax}}function Vf({layoutService:e,tickModel:t,dockService:n,environment:r}){if(!Tf({layoutService:e}))return;const i="rtl"===r.options.direction,{orientation:o}=n.meta.minor;return{type:"linear",invert:"vertical"===o||i,min:t.query.getMin,max:t.query.getMax}}function Bf({picasso:e,models:t,viewState:n,viewCache:r,environment:i}){const{layoutService:o,fieldModel:a,primaryTickModel:s,secondaryTickModel:l,colorService:u,dockService:c}=t;return{...Hf({picasso:e,models:t,viewState:n,viewCache:r,environment:i}),[xm.SCALE.MINOR.PRIMARY]:jf({fields:a.main.minorsPrimary,tickModel:s,dockService:c,environment:i}),[xm.SCALE.MINOR.SECONDARY]:jf({fields:a.main.minorsSecondary,tickModel:l,dockService:c,environment:i}),[xm.SCALE.MINOR.REDUCED_PRIMARY]:Vf({layoutService:o,tickModel:s,dockService:c,environment:i}),[xm.SCALE.MINOR.REDUCED_SECONDARY]:Vf({layoutService:o,tickModel:l,dockService:c,environment:i}),...u.custom.wrappedScales()}}var Uf={AXIS:{MAJOR:{HORIZONTAL:{width:"XSMALL",height:"SMALL"},VERTICAL:{width:"SMALL",height:"XSMALL"}},MINOR:"XSMALL"},AXIS_TITLE:{MAJOR:{HORIZONTAL:{width:"XSMALL",height:"MEDIUM"},VERTICAL:{width:"MEDIUM",height:"XSMALL"}},MINOR:"SMALL"},GRID_LINE:"XSMALL",VALUE_LABEL:"XSMALL",LABEL_SPACE:"XSMALL",OUT_OF_BOUNDS_MARKER:"XSMALL",REFERENCE_LINE:"SPARK"};const Yf=["all","labels"];function Wf({models:e}){const{layoutService:t,dockService:n,seriesModel:r,themeService:i,styleModel:o}=e,a=t.getLayoutValue("measureAxes");if(!a||!a.length)return[];const s=i.getStyles(),l=o.query.axis.label.getStyle(),{measureAxes:u}=r.meta;return u.filter((e=>{const t=e.isPrimary?0:1;return Yf.some((e=>a[t].show===e))})).map((e=>({type:"axis",key:e.isPrimary?xm.COMPONENT.AXIS.MINOR.PRIMARY:xm.COMPONENT.AXIS.MINOR.SECONDARY,scale:e.scale,layout:{dock:e.isPrimary?n.meta.minor.dock:n.meta.minorSecondary.dock,minimumLayoutMode:Uf.AXIS.MINOR},settings:{labels:{show:!0,fontFamily:l.fontFamily,fontSize:l.fontSize,fill:l.fill},line:{stroke:s.axis.line.major.color},ticks:{stroke:s.axis.line.major.color},minorTicks:{stroke:s.axis.line.minor.color}}})))}var Gf={INACTIVE:.5},Xf={LOWER:3,UPPER:13};const Kf=({layoutService:e})=>{const t=e.getHyperCubeValue("qDimensionInfo.0.qApprMaxGlyphCount"),[n]=e.getDataPages(),r=n?n.qMatrix:[];return fe.getAdjustedMaxGlyphCount(t,r,0,"qText")};function Jf({models:e,environment:t}){const{layoutService:n,dockService:r,styleModel:i}=e,o="rtl"===t.options.direction,a=n.getLayoutValue("dimensionAxis"),s=i.query.axis.label.getStyle(),l=Kf({layoutService:n}),{orientation:u}=r.meta.major,c="horizontal"===u?a.label:"auto";return{type:"axis",key:xm.COMPONENT.AXIS.MAJOR,scale:xm.SCALE.MAJOR,layout:{dock:r.meta.major.dock,minimumLayoutMode:Uf.AXIS.MAJOR[u.toUpperCase()]},settings:{labels:{mode:a.label,tiltAngle:o?-40:40,maxEdgeBleed:50,maxLengthPx:"horizontal"===c?void 0:r.meta.minor.size/4,maxGlyphCount:l,tiltThreshold:l>Xf.LOWER&&l<Xf.UPPER?1:void 0,fontFamily:s.fontFamily,fontSize:s.fontSize,fill:s.fill},line:{show:!1},paddingEnd:4},brush:{consume:[{context:"selection",style:{inactive:{opacity:Gf.INACTIVE}}}]}}}function Zf({models:e}){const{dockService:t,styleModel:n}=e,{orientation:r}=t.meta.major,i=n.query.axis.label.getStyle();return{type:"axis",key:xm.COMPONENT.AXIS.MAJOR_CONTINUOUS,scale:xm.SCALE.MAJOR,layout:{dock:t.meta.major.dock,minimumLayoutMode:Uf.AXIS.MAJOR[r.toUpperCase()]},settings:{labels:{align:0,offset:4,fontFamily:i.fontFamily,fontSize:i.fontSize,fill:i.fill},line:{show:!1}}}}function Qf({models:e,environment:t}){const{layoutService:n}=e,r=n.getLayoutValue("dimensionAxis");if(!r)return[];const{show:i}=r;return"none"===i||"title"===i?[]:n.meta.isTime?function({models:e,environment:t}){const{dockService:n,themeService:r,styleModel:i}=e,o="rtl"===t.options.direction,{orientation:a}=n.meta.major,s="bottom"===n.meta.major.dock?0:1,l=r.getStyles(),u=i.query.axis.label.getStyle(),c=o?1:0,d={type:"time-axis",renderer:"svg",layout:{dock:n.meta.major.dock,minimumLayoutMode:Uf.AXIS.MAJOR[a]},preferredSize:()=>({size:2*parseFloat(u.fontSize),edgeBleed:{left:1,right:1}}),settings:{anchor:o?"end":"start",label:{align:s,justify:c},guideLine:{major:{justify:c},minor:{align:s}},line:{show:!1}},style:{label:{fontFamily:u.fontFamily,fontSize:u.fontSize,fill:u.fill},majorGuideLine:{stroke:l.axis.line.major.color},minorGuideLine:{stroke:l.axis.line.minor.color}}};return[G(!0,{},d,{key:xm.COMPONENT.AXIS.TIME_INNER,scale:xm.SCALE.MAJOR_INNER,settings:{guideLine:{minor:{show:!0}}},style:{majorGuideLine:{stroke:l.axis.line.minor.color},minorGuideLine:{stroke:l.axis.line.major.color}}}),G(!0,{},d,{key:xm.COMPONENT.AXIS.TIME_OUTER,scale:xm.SCALE.MAJOR,settings:{guideLine:{minor:{show:!1}}}})]}({models:e,environment:t}):n.meta.isContinuous?[Zf({models:e})]:[Jf({models:e,environment:t})]}const ep=({layoutService:e,axis:t})=>e.meta.isBarSeriesGrouped?({scale:e,datum:t})=>e([t.value,t.typeIndex.value])+e.bandwidth()/2:e.meta.isBarSeriesStackedInBothAxis?({scale:e,datum:n})=>e([n.value,t])+e.bandwidth()/2:null,tp=({layoutService:e,seriesModel:t,rtl:n,orientation:r})=>e.meta.isContinuous?null:e.meta.isBarSeriesGrouped?({scale:e,datum:i})=>e([i.value,n&&"horizontal"===r?t.meta.barSeriesCount-1:0])+e.bandwidth()*t.meta.barSeriesCount/2:e.meta.isBarSeriesStackedInBothAxis?({scale:e,datum:t})=>e([t.value,n&&"horizontal"===r?1:0])+e.bandwidth():null;function np({layoutService:e,active:t={},inactive:n={}}){return{consume:[{context:"selection",data:["selectionDimension","end","color","major"],style:{active:{strokeWidth:e.meta.isContinuous?0:2,stroke:"#000",opacity:e=>{var t,n;return!0===(null===(t=e.data)||void 0===t||null===(n=t.null)||void 0===n?void 0:n.value)?0:1},...t},inactive:{opacity:e=>{var t,n;return!0===(null===(t=e.data)||void 0===t||null===(n=t.null)||void 0===n?void 0:n.value)?0:Gf.INACTIVE},...n}}}]}}var rp={MAX:"max",MIN:"min"};function ip(e,t){return function(e,t){const{hasExplicitMax:n}=t.meta,{max:r}=t.explicit;return!!n&&e>r}(e,t)||function(e,t){const{hasExplicitMin:n}=t.meta,{min:r}=t.explicit;return!!n&&e<r}(e,t)}const op=(e,t)=>`${e}-${t.id}`,ap=4,sp=12,lp=4;function up({chart:e,layoutService:t,dockService:n,markerKey:r,markerType:i}){if(t.meta.isContinuous)return()=>`${lp}px`;const o={size:void 0},a="horizontal"===n.meta.major.orientation?"width":"height";return t=>{if(!o.size){const n=e.component(r),s=t.resources.scale(xm.SCALE.MAJOR),l=n.rect[a]*s.bandwidth()*.25,u=Math.max(ap,Math.min(sp,l));o.size=`${"bar"===i?2*u:u}px`}return o.size}}const{isDark:cp}=vt;const dp=({chart:e,models:t,series:n,environment:r})=>{const{layoutService:i,seriesModel:o,colorService:a,dockService:s,primaryExtremumModel:l,secondaryExtremumModel:u}=t,c=a.getColor(),{fill:d,marker:m}=n.options,{isContinuous:f}=i.meta,p="rtl"===r.options.direction,{orientation:h}=s.meta.major,y="horizontal"===h,g=(n.isPrimary?l:u).query.getExtrema(),v=({end:e})=>{const{value:t}=e;return ip(t,g)},b=op(xm.COMPONENT.MARKER,n);return{type:"point",key:b,data:{filter:e=>n.ref===e.end.source.field,collection:n.collection},settings:{[y?"x":"y"]:{scale:xm.SCALE.MAJOR,fn:tp({layoutService:i,seriesModel:o,rtl:p,orientation:h}),ref:f?"major":void 0},[y?"y":"x"]:{scale:n.scale,ref:"end",fn:e=>{var t;const n=!0===(null===(t=e.datum.null)||void 0===t?void 0:t.value)?e.scale.min():e.datum.end.value;return function(e){return Math.min(Math.max(0,e),1)}(e.scale(n))}},fill:d||"bar"===m?c:"none",opacity:e=>{var t;return!0===(null===(t=e.datum.null)||void 0===t?void 0:t.value)||v(e.datum)?0:1},stroke:e=>{const t=c(e);return d?cp(t)?function(e){return He(e).brighter(.5).toString()}(t):function(e){return He(e).darker().toString()}(t):t},size:up({chart:e,layoutService:i,dockService:s,markerKey:b,markerType:m}),shape:()=>(({marker:e,horizontal:t,rtl:n})=>{let r;return"triangle"!==e||t||(r=n?"left":"right"),"bar"===e&&(r=t?"horizontal":"vertical"),r?{type:e,direction:r}:{type:e}})({marker:m,horizontal:y,rtl:p})},brush:np({layoutService:i,active:{opacity:e=>{var t;return!0===(null===(t=e.data.null)||void 0===t?void 0:t.value)||v(e.data)?0:1}},inactive:{opacity:e=>{var t;return!0===(null===(t=e.data.null)||void 0===t?void 0:t.value)||v(e.data)?0:Gf.INACTIVE}}})}};function mp({property:e="end",isHorizontal:t,isColor:n,fallback:r,rtl:i}){return function(o){const{datum:a,resources:{scale:s}}=o,l=s(xm.SCALE.MAJOR),u=s(xm.SCALE.COLOR),c=t&&i?[...a.points].reverse():a.points,d=c.reduce(((t,n,r)=>{const i="NaN"===n[e].value||Number.isNaN(n[e].value),o=c[r+1],a=o&&"NaN"!==o[e].value&&!Number.isNaN(o[e].value);return i?t.length&&a&&t.push(n):t.push(n),t}),[]),m="group-by-measure"===l.type?e=>l([e.major.value,e.typeIndex.value]):e=>l(e.major.value),f=d.map(m),p=Math.min(...f),h=Math.max(...f)-p,y=0===h?1:h,g=f.map(((e,t)=>0===t?0:t===f.length-1?1:(e-p)/y)),v=[];for(let t=0;t<d.length;t++){const i=d[t],o=i.color&&i.color.value,a=n?o||r:u(o)||r,s=0===t,l=t===d.length-1,c=g[t];if("NaN"===i[e].value||Number.isNaN(i[e].value))v[t-1].virtual||v.push({virtual:!0});else{const n=d[t-1];n&&"NaN"!==n[e].value&&!Number.isNaN(n[e].value)?v.push({color:a,offset:s?0:Math.max(0,parseFloat((c-(c-g[t-1])/2).toFixed(5)))}):v.push({color:a,offset:c});const r=d[t+1];r&&"NaN"!==r[e].value&&!Number.isNaN(r[e].value)?v.push({color:a,offset:l?1:Math.max(0,parseFloat((c+(g[t+1]-c)/2).toFixed(5)))}):v.push({color:a,offset:c})}}const b=v.reduce(((e,t,n)=>{if(t.virtual){const t=v[n-1],r=v[n+1],i=t.offset+(r.offset-t.offset)/2;e.push({color:t.color,offset:i},{color:r.color,offset:i})}else e.push(t);return e}),[]);return{type:"gradient",x1:0,x2:t?1:0,y1:0,y2:t?0:1,stops:b}}}function fp({environment:e,models:t,measureIndex:n}){const{layoutService:r,colorService:i,dockService:o}=t,a="rtl"===e.options.direction,{hasMultipleMeasures:s}=r.meta,{mode:l,type:u,nil:c}=i.getSettingsForMeasure(n),d="horizontal"===o.meta.major.orientation;if(!l||"constant"===u)return i.getColor();if("measure"===l&&"categorical"===u)return i.getColor();const m=r.getHyperCubeValue(`qMeasureInfo.${n}.color`);if(null!=m&&m.on)return"byExpression"===m.mode?mp({isHorizontal:d,isColor:!0,fallback:c,rtl:a}):i.getColor();const f=r.getLayoutValue("color",{}),p=!f.auto&&"byExpression"===f.mode,h=!!f.colorExpression;if(p&&!h)return c;const y=!f.auto&&"byMeasure"===f.mode&&f.byMeasureDef&&void 0!==f.byMeasureDef.activeMeasureIndex;return s||!y?mp({isHorizontal:d,isColor:"color"===u,fallback:c,rtl:a}):"continuous"===u?function({isHorizontal:e,rtl:t}){return function(n){const{datum:{points:r},resources:{scale:i}}=n,o=i(xm.SCALE.COLOR),a=r.map((e=>e.end.value)).filter((e=>"NaN"!==e&&!Number.isNaN(e))),s=Math.min(...a),l=Math.max(...a),u=l-s,c=0===u?1:u,d=o.domain().map((e=>({color:o(Math.min(l,Math.max(s,e))),offset:Math.min(1,Math.max(0,(e-s)/c))})));return{type:"gradient",x1:!e&&t?1:0,x2:e||t?0:1,y1:e?1:0,y2:0,stops:d}}}({isHorizontal:d,rtl:a}):function({isHorizontal:e,isArea:t,fallback:n,rtl:r}){return function(i){const{datum:{points:o},resources:{scale:a}}=i,s=a(xm.SCALE.COLOR),l=o.map((e=>e.end.value)).filter((e=>"NaN"!==e&&!Number.isNaN(e))),u=Math.min(...l),c=Math.max(...l),d=t?Math.min(0,u):u,m=(t?Math.max(0,c):c)-d,f=0===m?1:m,p=s.domain(),h=[];for(let e=0;e<p.length-1;e++){const t=p[e],r=s(t)||n;h.push({color:r,offset:Math.min(1,Math.max(0,(t-d)/f))});const i=p[e+1];h.push({color:r,offset:Math.min(1,Math.max(0,(i-d)/f))})}return{type:"gradient",x1:!e&&r?1:0,x2:e||r?0:1,y1:e?1:0,y2:0,stops:h}}}({isHorizontal:d,fallback:c,rtl:a})}const pp=({models:e,environment:t,series:n})=>{const{layoutService:r,seriesModel:i,dockService:o,styleModel:a}=e,s="rtl"===t.options.direction,{orientation:l}=o.meta.major,u=tp({layoutService:r,seriesModel:i,rtl:s,orientation:l});return{key:op(xm.COMPONENT.LINE,n),type:"line",data:{filter:e=>n.ref===e.end.source.field,collection:n.collection},settings:{coordinates:{major:{scale:xm.SCALE.MAJOR,fn:u},minor:{scale:n.scale,ref:"end"}},layers:{curve:a.query.line.getCurveFn(),line:{stroke:fp({models:e,environment:t,measureIndex:n.refIndex}),strokeWidth:a.query.line.getStrokeWidthFn(),strokeDasharray:a.query.line.getStrokeDasharrayFn(),strokeLinejoin:"round"}},connect:n.options.showAsConnections,orientation:o.meta.major.orientation},brush:np({layoutService:r,active:{stroke:void 0,strokeWidth:void 0,opacity:Gf.INACTIVE},inactive:{opacity:Gf.INACTIVE}})}};var hp={BAR:{STROKE:{COLOR:"#205891",WIDTH:{NONE:0,SMALL:1,MEDIUM:2,LARGE:4}}},LINE:{CURVE:{LINEAR:"linear",MONOTONE:"monotone",STEP:"step"},WIDTH:{FULL:{DEFAULT:2,ACTIVE:2},LESS:{DEFAULT:1,ACTIVE:1}},TYPE:{SOLID:void 0,DASHED:"5, 5"}},POINT:{SIZE:{DEFAULT:6,ACTIVE:4}}};function yp({series:e,layoutService:t}){const{showAsConnections:n}=e.options,r=function({layoutService:e}){const{isDiscrete:t}=e.meta;return({item:e})=>{if(e.dummy)return t;const{value:n}=e.end;return"NaN"===n||Number.isNaN(n)}}({layoutService:t}),i=n?(e,t)=>0!==e&&t.slice(0,e).reverse().some((e=>!r({item:e}))):(e,t)=>0!==e&&!r({item:t[e-1]}),o=n?(e,t)=>e!==t.length-1&&t.slice(e+1,t.length).some((e=>!r({item:e}))):(e,t)=>e!==t.length-1&&!r({item:t[e+1]});return({index:e,items:t})=>({before:i(e,t),after:o(e,t)})}const gp=3,vp=20;function bp({models:e,series:t,environment:n}){const{layoutService:r,colorService:i,seriesModel:o,dockService:a,styleModel:s,primaryExtremumModel:l,secondaryExtremumModel:u,selectionService:c}=e,d=r.getLayoutValue("dataPoint.show",!1),{orientation:m}=a.meta.major,f="horizontal"===m,p="SPARK"===a.meta.chart.mode,h=i.getColor(),{POINT:y}=hp,g=function({layoutService:e,series:t}){const n={key:void 0,map:void 0},r=yp({series:t,layoutService:e});return({item:e,items:t})=>{n.key!==t&&(n.key=t,n.map=function({items:e}){const t=e.reduce(((e,t)=>{const{value:n}=t.line;return e[n]||(e[n]={items:[],keys:[]}),e[n].items.push(t),e[n].keys.push(`${t.major.value}-${t.line.value}`),e}),{});return t}({items:t}));const{value:i}=e.line,o=n.map[i],a=`${e.major.value}-${i}`,s=o.keys.indexOf(a),{before:l,after:u}=r({index:s,items:o.items});return!l&&!u}}({series:t,layoutService:r}),v="rtl"===n.options.direction,b=(t.isPrimary?l:u).query.getExtrema(),{isContinuous:x}=r.meta,S=({end:e})=>{const{value:t}=e;return ip(t,b)};return{type:"point",key:op(xm.COMPONENT.POINT,t),data:{filter:e=>t.ref===e.end.source.field,collection:t.collection},preferredSize:()=>({edgeBleed:{top:f?y.SIZE.DEFAULT/2:0}}),settings:{[f?"y":"x"]:{scale:t.scale,ref:"end",fn:e=>{var t;const n=!0===(null===(t=e.datum.null)||void 0===t?void 0:t.value)?e.scale.min():e.datum.end.value;return function(e){return Math.min(Math.max(0,e),1)}(e.scale(n))}},[f?"x":"y"]:{scale:xm.SCALE.MAJOR,fn:tp({layoutService:r,seriesModel:o,rtl:v,orientation:m}),ref:"major"},sizeLimits:{minPx:gp,maxPx:vp},size:e=>{const{value:t}=e.datum.line;return`${s.query.point.getSize(t)}px`},fill:h,opacity:({datum:e,data:t})=>{var n;return null!==(n=e.null)&&void 0!==n&&n.value||S(e)?0:p?g({item:e,items:t.items})?1:0:d||g({item:e,items:t.items})?1:0}},brush:np({layoutService:r,active:{r:e=>e.r+hp.POINT.SIZE.ACTIVE/2,strokeWidth:1.5,stroke:"#FFFFFF",opacity:e=>{var t;if(!0===(null===(t=e.data.null)||void 0===t?void 0:t.value)||S(e.data))return 0;if(!x||d)return 1;const{event:n,components:r=[]}=(null==c?void 0:c.getSelectionInfo())||{};if("continuousRange"===n)return 0;if("tap"!==n)return 1;const i=[xm.COMPONENT.AXIS_OVERLAY.CONTINUOUS,xm.COMPONENT.AXIS_OVERLAY.TIME_INNER,xm.COMPONENT.AXIS_OVERLAY.TIME_OUTER].some((e=>r.indexOf(e)>=0));return i?0:1}},inactive:{opacity:e=>1===e.opacity?.5:0}})}}const xp=(e,{dataset:t})=>{var n;if(null!==(n=e.null)&&void 0!==n&&n.value)return"-";const{value:r,label:i,source:o}=e.end,a=t(o.key).field(o.field);return oe.shouldUseFormat(a.raw())?a.formatter()(r):i};function Sp({chart:e,models:t,environment:n,series:r,lineSeries:i}){const{layoutService:o,dockService:a,styleModel:s,primaryExtremumModel:l,secondaryExtremumModel:u}=t,{id:c}=r,d="rtl"===n.options.direction,m=o.getLayoutValue("dataPoint");if(!m)return!1;if(!m.show||!m.showLineLabels)return!1;const f=(r.isPrimary?l:u).query.getExtrema(),p=s.query.point.label.getStyle();return{type:"point-label",key:`${xm.COMPONENT.POINT_LABEL}-${c}`,layout:{displayOrder:2,minimumLayoutMode:Uf.VALUE_LABEL},settings:{orientation:a.meta.major.orientation,rtl:d,connect:r.options.showAsConnections,label:t=>xp(t,e),pointValue:e=>e.end.value,majorValue:e=>e.value,target:{point:`${xm.COMPONENT.POINT}-${c}`,allPoints:i.map((e=>`${xm.COMPONENT.POINT}-${e.id}`))},lineIndex:"typeIndex",showLabel:e=>!(({end:e})=>ip(e.value,f))(e.data),labelSpace:{use:()=>{const t=e.component(xm.COMPONENT.LABEL_SPACE);return!(null==t||!t.preferredSize())},size:10}},style:{fontFamily:p.fontFamily,fontSize:p.fontSize,fill:p.fill}}}const Mp=({chart:e,dock:t})=>{let n=t;const r=e.component(`${xm.COMPONENT.SLICED_HAT}-${rp.MAX}`),i=e.component(`${xm.COMPONENT.SLICED_HAT}-${rp.MAX}-${Sm.AXIS.PRIMARY}`),o=e.component(`${xm.COMPONENT.SLICED_HAT}-${rp.MAX}-${Sm.AXIS.SECONDARY}`);return r?n=`@${xm.COMPONENT.SLICED_HAT}-${rp.MAX}`:i?n=`@${xm.COMPONENT.SLICED_HAT}-${rp.MAX}-${Sm.AXIS.PRIMARY}`:o&&(n=`@${xm.COMPONENT.SLICED_HAT}-${rp.MAX}-${Sm.AXIS.SECONDARY}`),n},Ep=({dockPosition:e,orientation:t,rtl:n})=>{let r=1;return e!==`@${xm.COMPONENT.SLICED_HAT}-${rp.MAX}`&&e!==`@${xm.COMPONENT.SLICED_HAT}-${rp.MAX}-${Sm.AXIS.PRIMARY}`&&e!==`@${xm.COMPONENT.SLICED_HAT}-${rp.MAX}-${Sm.AXIS.SECONDARY}`||!("horizontal"===t||"vertical"===t&&n)||(r=4),e!==`@${xm.COMPONENT.SLICED_HAT}-${rp.MIN}`&&e!==`@${xm.COMPONENT.SLICED_HAT}-${rp.MIN}-${Sm.AXIS.PRIMARY}`&&e!==`@${xm.COMPONENT.SLICED_HAT}-${rp.MIN}-${Sm.AXIS.SECONDARY}`||"vertical"!==t||n||(r=4),r};function Cp({chart:e,models:t,environment:n,lineSeries:r}){const{layoutService:i,dockService:o,primaryExtremumModel:a,secondaryExtremumModel:s}=t,l=i.getLayoutValue("dataPoint",{}),u="rtl"===n.options.direction;if(!r.length)return!1;if(!l.show||!l.showLineLabels)return!1;const c="horizontal"===o.meta.major.orientation,{show:d}=i.getLayoutValue("dimensionAxis",{});if("none"!==d){const{dock:e}=o.meta.major;if(c&&"top"===e)return!1;if(!c&&e===(u?"left":"right"))return!1}const m=u?"left":"right";return{type:"label-space",key:xm.COMPONENT.LABEL_SPACE,layout:{minimumLayoutMode:Uf.LABEL_SPACE,dock:Mp({chart:e,dock:c?"top":m})},settings:{size:10},preferredSize:()=>{const t=e.component(`${xm.COMPONENT.LINE}-${r[0].id}`);if(null==t||!t.rect)return 0;const n=(c?17:34)/t.rect[c?"height":"width"],i=a.query.getExtrema(),o=e.scale(xm.SCALE.MINOR.PRIMARY)(i.implicit.line.max),l=c||u?o:1-o,d=r.filter((e=>e.isPrimary)).length>0,m=s.query.getExtrema(),f=e.scale(xm.SCALE.MINOR.SECONDARY)(m.implicit.line.max),p=c||u?f:1-f,h=r.filter((e=>!e.isPrimary)).length>0;return d&&l<n||h&&p<n?10:0}}}const qp={min:"Min",max:"Max"};function Ap(e,t,n){const{hasExplicitMax:r}=n.meta,{max:i}=n.explicit;return!!r&&Math.max(e,t)>i&&i<=Math.min(e,t)}function Op(e,t,n){const{hasExplicitMin:r}=n.meta,{min:i}=n.explicit;return!!r&&Math.min(e,t)<i&&i>=Math.max(e,t)}function Dp(e,t,n){return Ap(e,t,n)||Op(e,t,n)}function Ip(e,t){const{hasExplicitMax:n}=t.meta,{max:r}=t.explicit;return!!n&&e>r&&r<=0}function wp(e,t){const{hasExplicitMin:n}=t.meta,{min:r}=t.explicit;return!!n&&e<r&&r>=0}function Tp(e,t){return Ip(e,t)||wp(e,t)}function Np({extrema:e,type:t}){return!(function({extrema:e,type:t}){return!e.meta[`hasExplicit${qp[t]}`]}({extrema:e,type:t})||function({extrema:e,type:t}){const n=t===rp.MAX?e.implicit.bar.max:e.implicit.bar.min,r=Number(n.toFixed(13));return t===rp.MAX?!Ip(r,e):!wp(r,e)}({extrema:e,type:t}))}var Lp=Object.freeze({__proto__:null,isMaxOutOfBounds:Ip,isMinOutOfBounds:wp,isOutOfBounds:Tp,isSegmentMaxOutOfBounds:Ap,isSegmentMinOutOfBounds:Op,isSegmentOutOfBounds:Dp,shouldShowOob:Np});const kp={min:"Min",max:"Max"},Rp=({chart:e,models:t,markerSeries:n,lineSeries:r,barSeries:i,environment:o,type:a})=>{const{dockService:s,primaryExtremumModel:l,secondaryExtremumModel:u,primaryTickModel:c,secondaryTickModel:d,layoutService:m,seriesModel:f,themeService:p,fieldModel:h}=t,y="rtl"===o.options.direction,{dock:g,opposite:v,orientation:b}=s.meta.major,x=l.query.getExtrema(),S=u.query.getExtrema(),M=a===rp.MAX,{isBarSeriesGrouped:E}=m.meta,C=(({chart:e,type:t,opposite:n,dock:r})=>{let i=t===rp.MAX?n:r;const o=e.component(`${xm.COMPONENT.SLICED_HAT}-${t}`),a=e.component(`${xm.COMPONENT.SLICED_HAT}-${t}-${Sm.AXIS.PRIMARY}`),s=e.component(`${xm.COMPONENT.SLICED_HAT}-${t}-${Sm.AXIS.SECONDARY}`),l=e.component(xm.COMPONENT.LABEL_SPACE),u=e.component(`${xm.COMPONENT.BAR_OOB}-${t}`),c=e.component(`${xm.COMPONENT.BAR_OOB}-${t}-${Sm.AXIS.PRIMARY}`),d=e.component(`${xm.COMPONENT.BAR_OOB}-${t}-${Sm.AXIS.SECONDARY}`);return o?i=`@${xm.COMPONENT.SLICED_HAT}-${t}`:a?i=`@${xm.COMPONENT.SLICED_HAT}-${t}-${Sm.AXIS.PRIMARY}`:s?i=`@${xm.COMPONENT.SLICED_HAT}-${t}-${Sm.AXIS.SECONDARY}`:u||c||d?l&&t===rp.MAX?i=`@${xm.COMPONENT.LABEL_SPACE}`:u?i=`@${xm.COMPONENT.BAR_OOB}-${t}`:c?i=`@${xm.COMPONENT.BAR_OOB}-${t}-${Sm.AXIS.PRIMARY}`:d&&(i=`@${xm.COMPONENT.BAR_OOB}-${t}-${Sm.AXIS.SECONDARY}`):l&&t===rp.MAX&&(i=`@${xm.COMPONENT.LABEL_SPACE}`),i})({chart:e,type:a,opposite:v,dock:g}),q=tp({layoutService:m,seriesModel:f,rtl:y,orientation:b}),A=r.concat(n);if(!A.length)return!1;const O=M?x.implicit.bar.max:x.implicit.bar.min,D=Number(O.toFixed(13));if(!E&&i.length&&Lp[`is${kp[a]}OutOfBounds`](D,x))return!1;if(!x.meta.hasExplicit&&!S.meta.hasExplicit)return!1;const I=M?"max":"min",w=Math[I](Number(x.implicit.line[I].toFixed(13)),Number(x.implicit.marker[I].toFixed(13))),T=Math[I](Number(S.implicit.line[I].toFixed(13)),Number(S.implicit.marker[I].toFixed(13))),N=A.filter((e=>e.isPrimary)),L=A.filter((e=>!e.isPrimary)),k=N.length>0,R=L.length>0,{major:P,majorNumeric:F}=h.main,z=e=>"NaN"!==e.qNum?e.qNum:0,_=m.meta.isContinuous?F:P;return{type:"data-out-of-bounds-marker",key:`${xm.COMPONENT.DATA_OOB_MARKER}-${a}`,layout:{dock:C,minimumLayoutMode:Uf.OUT_OF_BOUNDS_MARKER},data:{extract:A.map((({ref:e,typeIndex:t,options:n})=>({field:P,value:m.meta.isContinuous?e=>e.qNum:void 0,props:{major:{field:_},end:{field:e,value:n.showAsZeros?z:void 0},typeIndex:t,null:{field:e,value:e=>"NaN"===e.qNum}}})))},settings:{type:a,primaryExtremum:M?()=>c.query.getMax():()=>c.query.getMin(),secondaryExtremum:M?()=>d.query.getMax():()=>d.query.getMin(),primarySeries:N,secondarySeries:L,orientation:b,rtl:y,major:{scale:xm.SCALE.MAJOR,fn:q},markerOffset:Ep({dockPosition:C,orientation:b,rtl:y})},brush:np({layoutService:m}),show:()=>{if(M){if(k&&w>c.query.getMax())return!0;if(R&&T>d.query.getMax())return!0}if(!M){if(k&&w<c.query.getMin())return!0;if(R&&T<d.query.getMin())return!0}return!1},style:{fill:p.getStyles().outOfRange.color}}},Pp={FULL:16,MEDIUM:14,SMALL:12,XSMALL:8,SPARK:4};function Fp({chart:e,models:t,viewState:n,viewCache:r,axis:i}){const o=Yl(),{dockService:a}=t;return({data:t})=>(({items:t})=>{const{rect:n}=e.component(`${xm.COMPONENT.BAR}-${i}`)||{};return(!t.length||!n)&&2})(t)||(()=>{const{min:e,max:t}=n.get("zoom");return o.get([e,t])||o.empty()&&!1})()||(()=>{const e=Pp[a.meta.chart.mode];return 0===Math.abs(r.get("continuousMax")-r.get("continuousMin"))&&e})()||(()=>{const{min:e,max:t}=n.get("zoom"),i=Math.abs(r.get("continuousMax")-r.get("continuousMin")),s=Math.abs(t-e),l=Pp[a.meta.chart.mode],u=function(e,t,n){return e*(1-n)+t*n}(2,l,1-Math.min(s/i/.2,1));return o.set([e,t],Math.max(2,Math.min(l,u)))})()}const zp=({isContinuous:e,isBarSeriesGrouped:t,styleModel:n,discreteModel:r,isBarSeriesStackedInBothAxis:i})=>e?1:n.query.bar.getHasStyling()?n.query.bar.getHasStrokeWidth()?function(){const e=n.query.bar.getStrokeWidth()/r.query.getItemSize(),t=n.query.bar.getWidthFn()(),i=t+e;return i>1?t-(i-1):t}:n.query.bar.getWidthFn():t||i?.9:.7;function _p(e){return Math.min(Math.max(0,e),1)}const $p=({chart:e,models:t,viewState:n,viewCache:r,isPrimary:i})=>{const{layoutService:o,dockService:a,colorService:s,seriesModel:l,styleModel:u,discreteModel:c,primaryExtremumModel:d,secondaryExtremumModel:m}=t,{isContinuous:f,isBarSeriesStacked:p,isBarSeriesGrouped:h,isBarSeriesStackedInBothAxis:y}=o.meta,g=e=>e.datum.start?e.datum.start.value:e.scale.min(),v=i?Sm.AXIS.PRIMARY:Sm.AXIS.SECONDARY,b=i?xm.SCALE.MINOR.PRIMARY:xm.SCALE.MINOR.SECONDARY;if(!(i?l.meta.primaryBarSeriesCount:l.meta.secondaryBarSeriesCount))return!1;const x=p?{scale:b,start:{ref:"start",fn:e=>{const t=g(e);return _p(e.scale(t))}},end:{ref:"end",fn:e=>{const t=(e=>e.datum.end?e.datum.end.value:g(e))(e);return _p(e.scale(t))}}}:{scale:b,start:{ref:"start",fn:e=>{const t=g(e);return _p(e.scale(t))}},end:{ref:"end",fn:e=>{var t;const n=!0===(null===(t=e.datum.null)||void 0===t?void 0:t.value)?g(e):e.datum.end.value;return _p(e.scale(n))}}},S=(i?d:m).query.getExtrema(),M=p?({start:e,end:t})=>Dp(e.value,t.value,S):({end:e})=>Tp(e.value,S);return{type:"box",key:`${xm.COMPONENT.BAR}-${v}`,data:{filter:(()=>{if(p)return;const e=l.query.series(Sm.TYPE.BAR).filter((e=>e.isPrimary===i)).map((e=>e.ref));return t=>e.some((e=>e===t.end.source.field))})(),collection:p?i?xm.COLLECTION.STACKED_PRIMARY:xm.COLLECTION.STACKED_SECONDARY:i?xm.COLLECTION.PRIMARY:xm.COLLECTION.SECONDARY},preferredSize:f?()=>({size:0,edgeBleed:{left:1,right:1}}):void 0,settings:{orientation:a.meta.minor.orientation,major:{scale:xm.SCALE.MAJOR,fn:ep({layoutService:o,axis:v}),ref:f?{start:"major",end:"major"}:void 0},minor:x,box:{width:zp({isContinuous:f,isBarSeriesGrouped:h,styleModel:u,discreteModel:c,isBarSeriesStackedInBothAxis:y}),minWidthPx:f?Fp({chart:e,models:t,viewState:n,viewCache:r,axis:v}):void 0,fill:s.getColor(),strokeWidth:u.query.bar.getStrokeWidth(),stroke:u.query.bar.getStrokeColor(),minHeightPx:.3,opacity:e=>{var t,n;return!0===(null===(t=e.datum)||void 0===t||null===(n=t.null)||void 0===n?void 0:n.value)||M(e.datum)?0:1}},oob:{show:!1},whisker:{show:!1},median:{show:!1},line:{show:!1}},brush:np({layoutService:o,active:{opacity:e=>{var t;return!0===(null===(t=e.data.null)||void 0===t?void 0:t.value)||M(e.data)?0:1}},inactive:{opacity:e=>{var t;return!0===(null===(t=e.data.null)||void 0===t?void 0:t.value)||M(e.data)?0:Gf.INACTIVE}}})}},Hp=({chart:e,models:t,viewState:n,viewCache:r,isPrimary:i})=>{const{layoutService:o,dockService:a,colorService:s,seriesModel:l,styleModel:u,discreteModel:c}=t,{isBarSeriesStacked:d,isContinuous:m,isBarSeriesGrouped:f,isBarSeriesStackedInBothAxis:p}=o.meta,h=i?Sm.AXIS.PRIMARY:Sm.AXIS.SECONDARY,y=i?l.meta.primaryBarSeriesCount:l.meta.secondaryBarSeriesCount;if(!d||0===y)return!1;return{key:`${xm.COMPONENT.STACK_BAR}-${h}`,type:"box",data:{collection:i?xm.COLLECTION.STACKED_TOTAL_PRIMARY:xm.COLLECTION.STACKED_TOTAL_SECONDARY},settings:{major:{scale:xm.SCALE.MAJOR,fn:ep({layoutService:o,axis:h}),ref:m?{start:"timeStart",end:"timeEnd"}:void 0},minor:{scale:i?xm.SCALE.MINOR.PRIMARY:xm.SCALE.MINOR.SECONDARY,start:{ref:"sumOfNegatives"},end:{ref:"sumOfPositives"}},orientation:a.meta.minor.orientation,box:{width:zp({isContinuous:m,isBarSeriesGrouped:f,styleModel:u,discreteModel:c,isBarSeriesStackedInBothAxis:p}),minWidthPx:m?Fp({chart:e,models:t,viewState:n,viewCache:r,axis:h}):2,opacity:0,fill:s.getColor()},oob:{show:!1},whisker:{show:!1},median:{show:!1},line:{show:!1}}}};function jp(e,t){const n="horizontal"===e.dockService.meta.major.orientation,{style:r}=t,i=e.styleModel.query.bar.label.getStyle();return{placements:t.simplifiedPlacements.map((e=>{const t=i.useContrastColor&&!e.onBackground?function({style:e,simplifiedPlacement:t}){return n=>vt.isDark(t.background?t.background.fill:n.node.attrs.fill)?e.lightColor:e.darkColor}({style:r,simplifiedPlacement:e}):i.fill;return function({simplifiedPlacement:e,fill:t,isHorizontal:n}){const r=e.padding||{left:n?0:4,right:n?0:4,top:n?4:0,bottom:n?4:0};return{position:e.position,justify:e.justify,fill:t,overflow:e.overflow,background:e.background,padding:r}}({simplifiedPlacement:e,fill:t,isHorizontal:n})})),label:t.label}}const Vp="vertical",Bp="horizontal";function Up(e,t,n,r){const i=function(e,t){return function(e,t){if(t&&0===e){const{min:e,max:n}=t;return 0===n&&0===e?1:n<=0?-1:e>=0||n>=-e?1:-1}return e>=0?1:-1}(e,t)}(e,r);let o="up";return t===Vp&&i<0?o="down":t===Bp&&(o=i>=0&&!n||i<0&&n?"right":"left"),o}const Yp=(e,t)=>{if(!e)return!1;const{isBarSeriesStacked:n,isContinuous:r}=t;return!n||!r},Wp=(e,t)=>{if(!e)return!1;const{isBarSeriesStacked:n,isContinuous:r}=t;return!!n&&(!!r||!1!==e)};function Gp(e,t,n,r){const i=[];return void 0!==e&&(i[e]={position:"outside",onBackground:!0,justify:0,overflow:r}),void 0!==t&&(i[t]={position:"inside",onBackground:!1,justify:n}),i}const Xp=({models:e,environment:t,isPrimary:n})=>{const{layoutService:r,seriesModel:i,styleModel:o,themeService:a}=e,{meta:s}=r,l="rtl"===t.options.direction,u=a.getStyles(),c=o.query.bar.label.getStyle(),d=e.layoutService.getLayoutValue("dataPoint.showBarLabels",!1),m=n?Sm.AXIS.PRIMARY:Sm.AXIS.SECONDARY;if(!(n?i.meta.primaryBarSeriesCount:i.meta.secondaryBarSeriesCount)||!Yp(d,s))return!1;let f;!s.isBarSeriesStacked&&(f=s.isBarSeriesStacked?1:0);const p={label:e=>xp(e.data,e),simplifiedPlacements:Gp(f,0===f?1:0,s.isBarSeriesStacked?.5:1,s.isContinuous),style:u.label.value},h=[jp(e,p)],y={component:`${xm.COMPONENT.BAR}-${m}`,selector:"rect",strategy:{type:"bar",settings:{direction:t=>Up(t.data.end.value,e.dockService.meta.minor.orientation,l,0),labels:h,fontSize:parseInt(c.fontSize,10),fontFamily:c.fontFamily}}},g=[y];return{type:"labels",key:`${xm.COMPONENT.BAR_LABEL}-${m}`,layout:{minimumLayoutMode:Uf.VALUE_LABEL},settings:{sources:g}}};function Kp(e,t,n,r){const i=[{position:e,onBackground:!0,justify:0,overflow:r}];if(t){const t={fill:"#cce6e6e6",padding:{left:2,right:2,top:2,bottom:2}};i.push({position:"inside",onBackground:!1,justify:"outside"===e?1:0,background:n?t:void 0})}return i}function Jp({chart:e,models:t,environment:n,isPrimary:r}){const{meta:i}=t.layoutService,o="rtl"===n.options.direction,a=t.themeService.getStyles(),s=t.styleModel.query.bar.label.getStyle(),l=t.layoutService.getLayoutValue("dataPoint.showBarLabels",!1),u=r?Sm.AXIS.PRIMARY:Sm.AXIS.SECONDARY;if(0===(r?t.seriesModel.meta.primaryBarSeriesCount:t.seriesModel.meta.secondaryBarSeriesCount)||!Wp(l,i))return!1;const c=s.useContrastColor,d=e.formatter(r?xm.FORMATTER.PRIMARY:xm.FORMATTER.SECONDARY)||(e=>e),m=e=>0===e?"":d(e),f={label:e=>m(e.data.sumOfPositives.value),simplifiedPlacements:Kp("outside",true,c,i.isContinuous),style:a.label.value},p={label:e=>m(e.data.sumOfNegatives.value),simplifiedPlacements:Kp("opposite",true,c,i.isContinuous),style:a.label.value},h=[jp(t,f),jp(t,p)];return{type:"labels",key:`${xm.COMPONENT.STACK_BAR_LABEL}-${u}`,layout:{displayOrder:2,minimumLayoutMode:Uf.VALUE_LABEL},settings:{sources:[{component:`${xm.COMPONENT.STACK_BAR}-${u}`,selector:"rect",strategy:{type:"bar",settings:{direction:e=>Up(e.data.sumOfPositives.value,t.dockService.meta.minor.orientation,o),labels:h,fontSize:parseInt(s.fontSize,10),fontFamily:s.fontFamily}}}]}}}var Zp=Object.freeze({__proto__:null,hasMaxHat:function(e,t){const{hasExplicitMax:n}=t.meta,{max:r}=t.explicit;return!!n&&e>r&&r>0},hasMinHat:function(e,t){const{hasExplicitMin:n}=t.meta,{min:r}=t.explicit;return!!n&&e<r&&r<0}});const Qp={min:"Min",max:"Max"},eh=1e-12;function th({chart:e,models:t,type:n,viewCache:r,viewState:i,isPrimary:o}){const{layoutService:a,dockService:s,primaryExtremumModel:l,secondaryExtremumModel:u,styleModel:c,discreteModel:d}=t,{isBarSeriesStacked:m,isContinuous:f,isBarSeriesGrouped:p,isBarSeriesStackedInBothAxis:h}=a.meta,y=m?Hp({chart:e,models:t,viewCache:r,viewState:i,isPrimary:o}):$p({chart:e,models:t,viewCache:r,viewState:i,isPrimary:o}),g=o?l.query.getExtrema():u.query.getExtrema(),v=n===rp.MAX,b=o?Sm.AXIS.PRIMARY:Sm.AXIS.SECONDARY;if(!y)return!1;if(function(e,t){return!e.meta[`hasExplicit${Qp[t]}`]}(g,n)||function(e,t,n){const r=n?e.implicit.bar.max:e.implicit.bar.min,i=Number(r.toFixed(13));return!Zp[`has${Qp[t]}Hat`](i,e)}(g,n,v)||function(e,t,n){const r=n?e=>e<0:e=>e>0;return e.meta[`hasExplicit${Qp[t]}`]&&r(e.explicit[t])}(g,n,v))return!1;let x="end";m&&(x=v?"sumOfPositives":"sumOfNegatives");const S=function(e){let t;return()=>(void 0===t&&(t=e()),t)}((()=>e.scale(o?xm.SCALE.MINOR.PRIMARY:xm.SCALE.MINOR.SECONDARY)[n]()));const M=(({chart:e,type:t,isPrimary:n,dock:r})=>{let i=r;const o=e.component(`${xm.COMPONENT.SLICED_HAT}-${t}-${Sm.AXIS.PRIMARY}`),a=e.component(`${xm.COMPONENT.SLICED_HAT}-${t}-${Sm.AXIS.SECONDARY}`);return o&&a&&(i=n?r:`@${xm.COMPONENT.SLICED_HAT}-${t}-${Sm.AXIS.PRIMARY}`),i})({chart:e,type:n,isPrimary:o,dock:v?s.meta.minor.end:s.meta.minor.start}),E={type:"box-sliced-hat",key:`${xm.COMPONENT.SLICED_HAT}-${n}-${b}`,layout:{dock:M},data:y.data,settings:{orientation:y.settings.orientation,major:y.settings.major,minor:y.settings.minor,hat:G({},y.settings.box,{fill:m?"#999":y.settings.box.fill,alignment:1,opacity:1,show:function(e){const t=S(),n=function(e){if("number"!=typeof e)return e;const t=Math.round(e);return Math.abs(e-t)<eh?t:e}(e.datum[x].value);return v?n>t:n<t},width:zp({isContinuous:f,isBarSeriesGrouped:p,styleModel:c,discreteModel:d,isBarSeriesStackedInBothAxis:h}),strokeWidth:c.query.bar.getStrokeWidth(),stroke:c.query.bar.getStrokeColor()})},brush:np({layoutService:a})};return E}const nh={min:"Min",max:"Max"},rh={sumOfPositives:"sumOfNegatives",sumOfNegatives:"sumOfPositives"};function ih({chart:e,models:t,type:n,viewCache:r,viewState:i,isPrimary:o}){const{layoutService:a,dockService:s,primaryExtremumModel:l,secondaryExtremumModel:u,themeService:c}=t,{end:d,start:m}=s.meta.minor,{isBarSeriesStacked:f}=a.meta,p=f?Hp({chart:e,models:t,viewCache:r,viewState:i,isPrimary:o}):$p({chart:e,models:t,viewCache:r,viewState:i,isPrimary:o}),h=o?l.query.getExtrema():u.query.getExtrema(),y=n===rp.MAX?h.implicit.bar.max:h.implicit.bar.min,g=Number(y.toFixed(13)),v=o?Sm.AXIS.PRIMARY:Sm.AXIS.SECONDARY;if(!p)return!1;if(!Lp[`is${nh[n]}OutOfBounds`](g,h))return!1;const b=(({chart:e,type:t,end:n,start:r,isPrimary:i})=>{let o=t===rp.MAX?n:r;const a=e.component(xm.COMPONENT.LABEL_SPACE),s=e.component(`${xm.COMPONENT.SLICED_HAT}-${t}-${Sm.AXIS.PRIMARY}`),l=e.component(`${xm.COMPONENT.SLICED_HAT}-${t}-${Sm.AXIS.SECONDARY}`),u=e.component(`${xm.COMPONENT.BAR_OOB}-${t}-${Sm.AXIS.PRIMARY}`),c=e.component(`${xm.COMPONENT.BAR_OOB}-${t}-${Sm.AXIS.SECONDARY}`);return s?o=`@${xm.COMPONENT.SLICED_HAT}-${t}-${Sm.AXIS.PRIMARY}`:l?o=`@${xm.COMPONENT.SLICED_HAT}-${t}-${Sm.AXIS.SECONDARY}`:u&&c&&!i?o=`@${xm.COMPONENT.BAR_OOB}-${t}-${Sm.AXIS.PRIMARY}`:a&&t===rp.MAX&&(o=`@${xm.COMPONENT.LABEL_SPACE}`),o})({chart:e,type:n,end:d,start:m,isPrimary:o});let x="end";f&&(x=n===rp.MAX?"sumOfPositives":"sumOfNegatives");const S={type:"box-out-of-bounds",key:`${xm.COMPONENT.BAR_OOB}-${n}-${v}`,layout:{dock:b},data:p.data,settings:{orientation:p.settings.orientation,major:p.settings.major,minor:p.settings.minor,dockValue:me.getDockValue(n===rp.MAX?d:m),oob:G({},p.settings.box,{fill:c.getStyles().outOfRange.color,alignment:1,opacity:1,show:function(e){var t;if(!0===(null===(t=e.datum.null)||void 0===t?void 0:t.value))return!1;const r=f&&0===e.datum[x].value,i=Lp[`is${nh[n]}OutOfBounds`](e.datum[x].value,h,n),o=(!r||function({type:e,item:t,prop:n,extrema:r}){const i=t.datum[rh[n]].value;return 0!==i&&Lp[`is${nh[e]}OutOfBounds`](i,r,e)}({type:n,item:e,prop:x,extrema:h}))&&i;return o}})},brush:np({layoutService:a})};return S}function oh(e){return Math.min(Math.max(0,e),1)}const ah=({chart:e,models:t,type:n,isPrimary:r})=>{const{discreteModel:i,styleModel:o,seriesModel:a,layoutService:s}=t;if(!(r?a.meta.primaryBarSeriesCount:a.meta.secondaryBarSeriesCount))return!1;const{isBarSeriesStacked:l,isContinuous:u,isBarSeriesGrouped:c,isBarSeriesStackedInBothAxis:d}=s.meta,m=e.scale(r?xm.SCALE.MINOR.PRIMARY:xm.SCALE.MINOR.SECONDARY),f=r?Sm.AXIS.PRIMARY:Sm.AXIS.SECONDARY,p=r?t.primaryExtremumModel.query.getExtrema():t.secondaryExtremumModel.query.getExtrema(),h=n===rp.MAX;if(!Np({extrema:p,type:n}))return!1;const y=e=>e.datum.start?e.datum.start.value:e.scale.min(),g=(e,t="end")=>e.datum[t]?e.datum[t].value:y(e),v={type:"box",key:`${xm.COMPONENT.GHOST_BAR_OOB}-${n}-${f}`,data:{filter:(()=>{if(l)return;const e=a.query.series(Sm.TYPE.BAR).filter((e=>e.isPrimary===r)).map((e=>e.ref));return t=>e.some((e=>e===t.end.source.field))})(),collection:l?r?xm.COLLECTION.STACKED_TOTAL_PRIMARY:xm.COLLECTION.STACKED_TOTAL_SECONDARY:r?xm.COLLECTION.PRIMARY:xm.COLLECTION.SECONDARY},settings:{orientation:t.dockService.meta.minor.orientation,major:{scale:xm.SCALE.MAJOR,fn:ep({layoutService:s,axis:f}),ref:u?{start:"major",end:"major"}:void 0},minor:{scale:r?xm.SCALE.MINOR.PRIMARY:xm.SCALE.MINOR.SECONDARY,start:{ref:"start",fn:e=>{const t=y(e);return oh(e.scale(t))}},end:l?"max"===n?{ref:"sumOfPositives",fn:e=>{const t=g(e,"sumOfPositives");return oh(e.scale(t))}}:{ref:"sumOfNegatives",fn:e=>{const t=g(e,"sumOfNegatives");return oh(e.scale(t))}}:{ref:"end",fn:e=>{const t=g(e);return oh(e.scale(t))}}},box:{width:zp({isContinuous:u,isBarSeriesGrouped:c,styleModel:o,discreteModel:i,isBarSeriesStackedInBothAxis:d}),stroke:"transparent",fill:"none",opacity:0,show:e=>{let t="end";l&&(t=h?"sumOfPositives":"sumOfNegatives");const n=e.datum[t]?e.datum[t].value:m.max();return h?n>m.max():n<m.min()}},oob:{show:!1},whisker:{show:!1},median:{show:!1},line:{show:!1}}};return v};function sh(e,t,n,r,i){const o=[{position:e,justify:0,overflow:n,background:{padding:{left:1,right:1,top:1,bottom:1}}}];return t&&o.push({position:"inside",onBackground:!1,justify:r||i?0:1,background:{padding:{left:2,right:2,top:2,bottom:2}}}),o}const lh=({chart:e,models:t,type:n,environment:r,isPrimary:i})=>{const{layoutService:o,dockService:a,primaryExtremumModel:s,secondaryExtremumModel:l,styleModel:u,seriesModel:c,themeService:d}=t,m=d.getStyles(),f=u.query.bar.label.getStyle(),{meta:p}=o,{isBarSeriesStacked:h}=p,y=e.formatter(i?xm.FORMATTER.PRIMARY:xm.FORMATTER.SECONDARY),g=o.getLayoutValue("dataPoint.showBarLabels",!1),v="horizontal"===a.meta.major.orientation,b="rtl"===r.options.direction;if(!(i?c.meta.primaryBarSeriesCount:c.meta.secondaryBarSeriesCount)||!h&&!Yp(g,p)||h&&!Wp(g,p))return!1;const x=i?s.query.getExtrema():l.query.getExtrema();if(!x.meta.hasExplicit)return!1;const S=n===rp.MAX?x.implicit.bar.max:x.implicit.bar.min;if(!(n===rp.MAX?Ip(S,x):wp(S,x)))return!1;let M=e=>xp(e.data,e);p.isBarSeriesStacked&&(M=n===rp.MAX?function(e){var t;if(!0===(null===(t=e.data.null)||void 0===t?void 0:t.value))return"";if(Ip(e.data.sumOfPositives.value,x)){const t=0===e.data.sumOfNegatives.value?e.data.sumOfPositives.value:e.data.sumOfNegatives.value;return y?y(t):t}return""}:function(e){var t;if(!0===(null===(t=e.data.null)||void 0===t?void 0:t.value))return"";if(wp(e.data.sumOfNegatives.value,x)){const t=0===e.data.sumOfPositives.value?e.data.sumOfNegatives.value:e.data.sumOfPositives.value;return y?y(t):t}return""});const E={label:M,simplifiedPlacements:sh("outside",true,p.isContinuous,v,b),style:m.label.value},C={label:M,simplifiedPlacements:sh("opposite",true,p.isContinuous,v,b),style:m.label.value},q=[jp(t,E),jp(t,C)],A=i?Sm.AXIS.PRIMARY:Sm.AXIS.SECONDARY,O="horizontal"===a.meta.major.orientation?"down":"right",D=[{component:`${xm.COMPONENT.GHOST_BAR_OOB}-${n}-${A}`,selector:"rect",strategy:{type:"bar",settings:{direction:O,labels:q,fontSize:parseInt(f.fontSize,10),fontFamily:f.fontFamily}}}];return{key:`${xm.COMPONENT.BAR_OOB_LABEL}-${n}-${A}`,type:"labels",layout:{minimumLayoutMode:Uf.VALUE_LABEL},settings:{sources:D}}},uh=({chart:e,models:t,viewState:n,viewCache:r})=>[$p({chart:e,models:t,viewState:n,viewCache:r,isPrimary:!0}),$p({chart:e,models:t,viewState:n,viewCache:r,isPrimary:!1})],ch=({chart:e,models:t,viewState:n,viewCache:r})=>[Hp({chart:e,models:t,viewState:n,viewCache:r,isPrimary:!0}),Hp({chart:e,models:t,viewState:n,viewCache:r,isPrimary:!1})],dh=({chart:e,models:t,environment:n})=>{const{isBarSeriesStacked:r}=t.layoutService.meta;if(r){return[Jp({chart:e,models:t,environment:n,isPrimary:!0}),Jp({chart:e,models:t,environment:n,isPrimary:!1})]}return[Xp({models:t,environment:n,isPrimary:!0}),Xp({models:t,environment:n,isPrimary:!1})]},mh=({chart:e,models:t,viewCache:n,viewState:r})=>[th({chart:e,models:t,type:"max",viewCache:n,viewState:r,isPrimary:!0}),th({chart:e,models:t,type:"min",viewCache:n,viewState:r,isPrimary:!0}),th({chart:e,models:t,type:"max",viewCache:n,viewState:r,isPrimary:!1}),th({chart:e,models:t,type:"min",viewCache:n,viewState:r,isPrimary:!1})],fh=({chart:e,models:t,viewCache:n,viewState:r})=>[ih({chart:e,models:t,type:"max",viewCache:n,viewState:r,isPrimary:!0}),ih({chart:e,models:t,type:"min",viewCache:n,viewState:r,isPrimary:!0}),ih({chart:e,models:t,type:"max",viewCache:n,viewState:r,isPrimary:!1}),ih({chart:e,models:t,type:"min",viewCache:n,viewState:r,isPrimary:!1})],ph=({chart:e,models:t})=>[ah({chart:e,models:t,type:"max",isPrimary:!0}),ah({chart:e,models:t,type:"min",isPrimary:!0}),ah({chart:e,models:t,type:"max",isPrimary:!1}),ah({chart:e,models:t,type:"min",isPrimary:!1})],hh=({chart:e,models:t,environment:n})=>[lh({chart:e,models:t,type:"max",environment:n,isPrimary:!0}),lh({chart:e,models:t,type:"min",environment:n,isPrimary:!0}),lh({chart:e,models:t,type:"max",environment:n,isPrimary:!1}),lh({chart:e,models:t,type:"min",environment:n,isPrimary:!1})],yh=({chart:e,environment:t,models:n,viewState:r,viewCache:i})=>{const{seriesModel:o}=n,a=o.query.series(Sm.TYPE.BAR).slice(-1),s=o.query.series(Sm.TYPE.LINE),l=o.query.series(Sm.TYPE.MARKER);return[...uh({chart:e,models:n,viewState:r,viewCache:i}),...ch({chart:e,models:n,viewState:r,viewCache:i}),...s.map((e=>pp({models:n,environment:t,series:e}))),...s.map((e=>bp({models:n,series:e,environment:t}))),...l.map((r=>dp({chart:e,models:n,series:r,environment:t}))),...s.map((r=>Sp({chart:e,models:n,environment:t,series:r,lineSeries:s}))),...dh({chart:e,models:n,environment:t}),...mh({chart:e,models:n,viewCache:i,viewState:r}),...fh({chart:e,models:n,viewCache:i,viewState:r}),...ph({chart:e,models:n}),...hh({chart:e,models:n,environment:t}),Rp({chart:e,models:n,markerSeries:l,lineSeries:s,barSeries:a,environment:t,type:"max"}),Rp({chart:e,models:n,markerSeries:l,lineSeries:s,barSeries:a,environment:t,type:"min"}),Cp({chart:e,models:n,environment:t,lineSeries:s})]},gh={NONE:0,WIDE:1,MEDIUM:2,NARROW:3};function vh({models:e}){const{dockService:t,seriesModel:n,layoutService:r,themeService:i}=e,{auto:o,spacing:a}=r.getLayoutValue("gridLine",{});if(!o&&a===gh.NONE)return!1;const s=i.getStyles(),l=n.meta.primarySeries.length>0;return{key:xm.COMPONENT.GRID_LINE,type:"grid-line",layout:{minimumLayoutMode:Uf.GRID_LINE},preferredSize:()=>({size:0,edgeBleed:{left:1,right:1,top:1,bottom:1}}),ticks:{show:!(!o&&a===gh.WIDE)||((e,t)=>t%2==0),stroke:s.grid.line.major.color},minorTicks:{show:!o&&a===gh.NARROW,stroke:s.grid.line.minor.color},["horizontal"===t.meta.major.orientation?"y":"x"]:l?xm.SCALE.MINOR.PRIMARY:xm.SCALE.MINOR.SECONDARY}}function bh({models:e}){const{primaryExtremumModel:t,primaryTickModel:n,themeService:r,dockService:i,seriesModel:o}=e,a=t.query.getExtrema();return!!(o.meta.primarySeries.length>0&&a.meta.includesZero)&&{key:xm.COMPONENT.ZERO_LINE,type:"ref-line",layout:{minimumLayoutMode:Uf.GRID_LINE},show:()=>n.query.getMin()<=0&&n.query.getMax()>=0,lines:{["horizontal"===i.meta.minor.orientation?"x":"y"]:[{value:0,scale:xm.SCALE.MINOR.PRIMARY,line:{stroke:r.getStyles().grid.line.highContrast.color}}]}}}function xh({models:e}){const{layoutService:t,themeService:n}=e,{isContinuous:r,isTime:i}=t.meta;if(!r)return[];const o=n.getStyles(),a={type:"grid-line",layout:{minimumLayoutMode:Uf.GRID_LINE},ticks:{stroke:o.grid.line.major.color},minorTicks:{show:!1,stroke:o.grid.line.minor.color}};return i?[G(!0,{},a,{key:"time-inner-grid",x:{scale:xm.SCALE.MAJOR_INNER},ticks:{stroke:o.grid.line.minor.color}}),G(!0,{},a,{key:"time-outer-grid",x:{scale:xm.SCALE.MAJOR}})]:[G(!0,{},a,{key:"continuous-grid",x:{scale:xm.SCALE.MAJOR},minorTicks:{show:!0}})]}function Sh({models:e}){return[vh({models:e}),bh({models:e}),...xh({models:e})]}function Mh({models:e,environment:t,actions:n}){const{layoutService:r,dockService:i,propertiesModel:o,appModel:a,genericObjectModel:s,styleModel:l}=e,u=o.query.getProperties(),c=r.getLayoutValue("dimensionAxis");if(!c)return!1;const{show:d}=c;if("all"!==d&&"title"!==d)return!1;const{orientation:m}=i.meta.major,f=l.query.axis.title.getStyle();return{type:"data-title",key:xm.COMPONENT.AXIS_TITLE.MAJOR,layout:{dock:i.meta.major.dock,minimumLayoutMode:Uf.AXIS_TITLE.MAJOR[m.toUpperCase()]},settings:{hyperCube:r.getHyperCube(),hyperCubeDef:u&&u.qHyperCubeDef,isDimension:!0,disabled:()=>!n.interact.enabled(),model:s,app:a,translator:t.translator,rtl:"rtl"===t.options.direction,selections:void 0},style:{fontFamily:f.fontFamily,fontSize:f.fontSize,color:f.color}}}const Eh=(e,t,n)=>e.query.seriesByAxis(n).map((e=>({...t[e.refIndex],explicitColumn:e.refIndex})));function Ch({models:e,environment:t,actions:n}){const{layoutService:r,dockService:i,seriesModel:o,propertiesModel:a,appModel:s,genericObjectModel:l,styleModel:u}=e,c=a.query.getProperties(),d=r.getLayoutValue("measureAxes");if(!d||!d.length)return[];const m=u.query.axis.title.getStyle(),{measureAxes:f}=o.meta;return f.filter((e=>e.isPrimary?"all"===d[0].show||"title"===d[0].show:"all"===d[1].show||"title"===d[1].show)).map((e=>{const a=r.getHyperCube(),{isPrimary:u}=e,d=o.query.seriesByAxis(u).length>1,f={type:"data-title",key:u?xm.COMPONENT.AXIS_TITLE.MINOR.PRIMARY:xm.COMPONENT.AXIS_TITLE.MINOR.SECONDARY,layout:{dock:u?i.meta.minor.dock:i.meta.minorSecondary.dock,minimumLayoutMode:Uf.AXIS_TITLE.MINOR},settings:{hyperCube:a,hyperCubeDef:c&&c.qHyperCubeDef,isDimension:!1,explicitItemInfos:Eh(o,a.qMeasureInfo,u),onChangeToAlternative:({oldItem:e,newItem:t})=>{t.qDef.series=e.qDef.series;const n=e.qAttributeExpressions.findIndex((e=>"colorByExpression"===e.id));if(-1!==n){const r=e.qAttributeExpressions.splice(n,1)[0];t.qAttributeExpressions.unshift(r)}},disabled:()=>!n.interact.enabled(),model:l,app:s,translator:t.translator,rtl:"rtl"===t.options.direction,selections:void 0,skipAttributeExpressions:!0},style:{fontFamily:m.fontFamily,fontSize:m.fontSize,color:m.color}};return d&&(f.settings.padding="0",f.settings.minWidth="auto"),f}))}function qh({models:e,environment:t,actions:n}){return[Mh({models:e,environment:t,actions:n}),...Ch({models:e,environment:t,actions:n})]}function Ah({models:e,environment:t,viewState:n,viewCache:r}){const{discreteModel:i,layoutService:o,dockService:a,continuousModel:s,themeService:l}=e,{isSnapshot:u,isDiscrete:c,isContinuous:d}=o.meta,m="rtl"===t.options.direction;return!(u&&!d)&&function({layoutService:e,dockService:t,discrete:n,continuousDataModel:r,viewState:i,viewCache:o,themeService:a,rtl:s,scrollbarOverride:l,visualizeCache:u=!1,deviceType:c}){const d=Jm({layoutService:e,override:l});if(d.none)return!1;const{orientation:m}=t.meta.major,f={key:"scrollbar",type:"scrollbar",layout:{dock:"horizontal"===m?t.meta.minor.start:t.meta.minor.end,minimumLayoutMode:"XSMALL"},show:()=>e.meta.isContinuous?r.getDimensionCardinality()>1:n.query.getCanScroll(),settings:{orientation:m,rtl:s,isContinuous:e.meta.isContinuous,range:()=>Gm({layoutService:e,viewState:i,viewCache:o})}};d.bar&&(f.settings.style="slim",f.settings.size={area:"touch"===c?{max:16,min:16}:{max:8,min:8}},e.meta.isContinuous||(f.settings.size.thumb={min:4}));const p=a.getStyles();return p.color&&(f.style={standard:{thumb:{"border-color":p.color,opacity:.4},before:{background:p.color,opacity:.1},after:{background:p.color,opacity:.1}}}),e.meta.isDiscrete&&u&&(f.settings.injections=()=>[Wm({layoutService:e,discrete:n})]),f}({viewState:n,viewCache:r,discrete:i,continuousDataModel:s,layoutService:o,dockService:a,themeService:l,rtl:m,scrollbarOverride:{predicate:()=>c,value:Ym.OPTIONS.BAR.value},deviceType:t.deviceType})}function Oh({chart:e,models:t,viewState:n,viewCache:r,isPrimary:i}){const{layoutService:o}=t,a=$p({chart:e,models:t,viewState:n,viewCache:r,isPrimary:i});if(!a)return!1;const s=i?Sm.AXIS.PRIMARY:Sm.AXIS.SECONDARY;return a.key=`${xm.COMPONENT.MINI_CHART.BAR}-${s}`,a.data.collection=o.meta.isBarSeriesStacked?i?xm.COLLECTION.REDUCED_STACKED_PRIMARY:xm.COLLECTION.REDUCED_STACKED_SECONDARY:i?xm.COLLECTION.REDUCED_PRIMARY:xm.COLLECTION.REDUCED_SECONDARY,a.settings.box.minWidthPx=void 0,a.settings.minor.scale=i?xm.SCALE.MINOR.REDUCED_PRIMARY:xm.SCALE.MINOR.REDUCED_SECONDARY,a.settings.major.scale=xm.SCALE.REDUCED,a.layout={dock:"@scrollbar"},a}function Dh({environment:e,models:t}){const n=t.styleModel.query.line.getStrokeDasharrayFn();return t.seriesModel.query.series(Sm.TYPE.LINE).map((r=>{const i=pp({models:t,environment:e,series:r});return i.key=op(xm.COMPONENT.MINI_CHART.LINE,r),i.data.collection=xm.COLLECTION.REDUCED,i.settings.coordinates.minor.scale=r.isPrimary?xm.SCALE.MINOR.REDUCED_PRIMARY:xm.SCALE.MINOR.REDUCED_SECONDARY,i.settings.coordinates.major.scale=xm.SCALE.REDUCED,i.settings.layers.line.strokeWidth=1,i.settings.layers.line.strokeDasharray=(...e)=>void 0===n(...e)?void 0:"1, 1",i.layout={dock:"@scrollbar"},i}))}function Ih({models:e,environment:t}){return e.seriesModel.query.series(Sm.TYPE.MARKER).map((n=>{const r=dp({models:e,environment:t,series:n});return r.key=op(xm.COMPONENT.MINI_CHART.MARKER,n),r.data.collection=xm.COLLECTION.REDUCED,r.settings.y.scale=n.isPrimary?xm.SCALE.MINOR.REDUCED_PRIMARY:xm.SCALE.MINOR.REDUCED_SECONDARY,r.settings.x.scale=xm.SCALE.REDUCED,r.layout={dock:"@scrollbar"},r}))}function wh({chart:e,models:t,viewState:n,viewCache:r,environment:i}){return Tf(t)?[Oh({chart:e,models:t,viewState:n,viewCache:r,isPrimary:!0}),Oh({chart:e,models:t,viewState:n,viewCache:r,isPrimary:!1}),...Dh({environment:i,models:t}),...Ih({models:t,environment:i})]:[]}function Th({models:e}){const{layoutService:t,dockService:n}=e,{isContinuous:r,isTime:i}=t.meta,o=t.getLayoutValue("dimensionAxis");if(!o||"none"===o.show||"title"===o.show)return[!1];if(!r)return[!1];const a=Uf.AXIS.MAJOR[n.meta.major.orientation.toUpperCase()];return i?[{type:"axis-overlay",key:xm.COMPONENT.AXIS_OVERLAY.TIME_INNER,scale:xm.SCALE.MAJOR_INNER,layout:{dock:`@${xm.COMPONENT.AXIS.TIME_INNER}`,minimumLayoutMode:a}},{type:"axis-overlay",key:xm.COMPONENT.AXIS_OVERLAY.TIME_OUTER,scale:xm.SCALE.MAJOR,layout:{dock:`@${xm.COMPONENT.AXIS.TIME_OUTER}`,minimumLayoutMode:a}}]:[{type:"axis-overlay",key:xm.COMPONENT.AXIS_OVERLAY.CONTINUOUS,scale:xm.SCALE.MAJOR,layout:{dock:`@${xm.COMPONENT.AXIS.MAJOR_CONTINUOUS}`,minimumLayoutMode:a}}]}function Nh({chart:e,models:t,environment:n}){const{refLineModel:r,layoutService:i,colorService:o,dockService:a,themeService:s,appLayoutModel:l,seriesModel:u}=t,c=l.qLocaleInfo,{options:d,theme:m}=n,f="rtl"===d.direction,p=u.query.series(Sm.TYPE.BAR).filter((e=>e.isPrimary)),h=u.query.series(Sm.TYPE.BAR).filter((e=>!e.isPrimary)),y=u.query.series(Sm.TYPE.LINE),g=u.query.series(Sm.TYPE.MARKER),v=u.query.all(),b=v.some((e=>e.isPrimary)),x=v.some((e=>!e.isPrimary)),S=b&&x,M={resolveUIColor:o.getPaletteColor},E=b?vm({refLineModel:r,layoutService:i,colorModel:M,dock:S?a.meta.minor.dock:a.meta.minor.opposite,scale:xm.SCALE.MINOR.PRIMARY,style:s.getStyles(),formatter:xm.FORMATTER.PRIMARY,theme:m,localeInfo:c,rtl:f,key:xm.COMPONENT.PRIMARY_MEASURE_AXIS_REF_LINE_LABEL}):[],C=x?vm({refLineModel:r,layoutService:i,colorModel:M,dock:S?a.meta.minor.opposite:a.meta.minor.dock,scale:xm.SCALE.MINOR.SECONDARY,style:s.getStyles(),formatter:xm.FORMATTER.SECONDARY,theme:m,localeInfo:c,rtl:f,key:xm.COMPONENT.SECONDARY_MEASURE_AXIS_REF_LINE_LABEL,path:"refLine.refLines2"}):[];return[!!b&&pm({refLineModel:r,layoutService:i,colorModel:M,dockService:a,chart:e,scale:xm.SCALE.MINOR.PRIMARY,axis:"horizontal"===a.meta.major.orientation?"y":"x",key:xm.COMPONENT.PRIMARY_MEASURE_AXIS_REF_LINE,minimumLayoutMode:Uf.REFERENCE_LINE}),!!x&&pm({refLineModel:r,layoutService:i,colorModel:M,dockService:a,chart:e,scale:xm.SCALE.MINOR.SECONDARY,axis:"horizontal"===a.meta.major.orientation?"y":"x",key:xm.COMPONENT.SECONDARY_MEASURE_AXIS_REF_LINE,path:"refLine.refLines2",minimumLayoutMode:Uf.REFERENCE_LINE}),pm({isDimension:!0,refLineModel:r,layoutService:i,colorModel:M,dockService:a,chart:e,scale:xm.SCALE.MAJOR,axis:"horizontal"===a.meta.major.orientation?"x":"y",rtl:f,key:xm.COMPONENT.DIMENSION_REF_LINE,mainComponentKey:p.length?`${xm.COMPONENT.BAR}-${Sm.AXIS.PRIMARY}`:h.length?`${xm.COMPONENT.BAR}-${Sm.AXIS.SECONDARY}`:y.length?`${xm.COMPONENT.LINE}-${y[0].id}`:g.length?`${xm.COMPONENT.MARKER}-${g[0].id}`:`${xm.COMPONENT.BAR}-${Sm.AXIS.PRIMARY}`,minimumLayoutMode:Uf.REFERENCE_LINE}),...E,...C,...vm({isDimension:!0,refLineModel:r,layoutService:i,colorModel:M,dock:a.meta.major.opposite,scale:xm.SCALE.MAJOR,style:s.getStyles(),theme:m,localeInfo:c,rtl:f,key:xm.COMPONENT.DIMENSION_REF_LINE_LABEL})]}function Lh(e){return"NaN"===e.qMin&&"NaN"===e.qMax}var kh=[{key:"NoDataExist",alignment:"center",condition:({layoutService:e})=>{const{x:t,y:n}=e.meta.size;return t*n==0}},{key:"OnlyNanData",alignment:"center",condition:({layoutService:e})=>{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:"OnlyNanData",alignment:"center",condition:({layoutService:e})=>e.getHyperCubeValue("qMeasureInfo").every(Lh)},{key:"DataRangeIncludingZero",alignment:"bottom",condition:({layoutService:e,primaryExtremumModel:t,secondaryExtremumModel:n,flags:r})=>{if(!1===e.getLayout().showDisclaimer&&r.isEnabled("SHOW_DISCLAIMER"))return!1;const i=e.getLayoutValue("measureAxis.logarithmic",!1),o=t.query.getExtrema(),a=n.query.getExtrema();return i&&(o.meta.includesZero||a.meta.includesZero)}}];function Rh({environment:e,models:t}){const{flags:n,translator:r,options:i}=e,{layoutService:o,primaryExtremumModel:a,secondaryExtremumModel:s,themeService:l}=t,u=function({layoutService:e,primaryExtremumModel:t,secondaryExtremumModel:n,flags:r}){let i,o;for(let a=0,s=kh.length;a<s;a++){i=kh[a];try{o=i.condition({layoutService:e,primaryExtremumModel:t,secondaryExtremumModel:n,flags:r})}catch(e){throw Error("failing disclaimer condition",e)}if(o)return i}return!1}({layoutService:o,primaryExtremumModel:a,secondaryExtremumModel:s,flags:n});if(!u)return!1;const{fontFamily:c}=l.getStyles(),d=function(e,t,n,r={}){if(!e)return!1;const{translator:i}=t,{rtl:o}=n;return{key:"disclaimer",type:"disclaimer",layout:{dock:J[e].alignment},settings:{label:i.get(`Object.Disclaimer.${e}`),rtl:o},style:r}}(u.key,{translator:r},{rtl:"rtl"===i.direction},{fontFamily:c});return d}function Ph({layoutService:e}){return!!Tf({layoutService:e})&&{type:"range",key:"range-brush-highlighter",layout:{dock:"@scrollbar"},settings:{scale:xm.SCALE.REDUCED,brush:"selection",fill:"#6CB33F",opacity:.2}}}function Fh(e){return(null==e?void 0:e.type)||Sm.TYPE.BAR}function zh({models:e,environment:t}){const{layoutService:n,colorService:r,dockService:i,seriesModel:o,selectionService:a}=e,{hasLineSeries:s,isContinuous:l,hasMultipleMeasures:u,isGroupedByMeasure:c}=n.meta;if(!s)return!1;const{options:d}=t,m=n.getLayoutValue("color",{}),f=e=>e.filter((e=>Fh(e)===Sm.TYPE.LINE)).map((e=>({key:op(xm.COMPONENT.LINE,e),typeIndex:e.typeIndex}))),p=!m.auto&&"byMeasure"===m.mode&&m.byMeasureDef&&void 0!==m.byMeasureDef.activeMeasureIndex,h=n.getHyperCubeValue("qMeasureInfo").map((e=>{var t;return null===(t=e.color)||void 0===t?void 0:t.on}));return{type:"brush-highlighter",key:"brush-highlighter",data:{collection:xm.COLLECTION.LINE},settings:{getSelectionInfo:()=>{var e;return(null==a||null===(e=a.getSelectionInfo)||void 0===e?void 0:e.call(a))||{}},seriesInfo:{primary:f(o.meta.primarySeries),secondary:f(o.meta.secondarySeries)},selectionValues:{"qHyperCube/qDimensionInfo/0":l?e=>e.value:e=>e.major.value,"qHyperCube/qDimensionInfo/0:numeric":e=>e.major.value,"qHyperCube/qDimensionInfo/0/qAttrExprInfo/0":e=>e.end.value,"qHyperCube/qMeasureInfo/X":e=>e.end.value},colorSettings:e=>r.getSettingsForMeasure(e),colorByData:e=>!h[e]&&p,hasMultipleMeasures:u,groupedByMeasure:c,itemsPerGroup:o.meta.barSeriesCount,orientation:i.meta.major.orientation,rtl:"rtl"===d.direction}}}function _h({models:{fieldModel:e}}){return{[xm.FORMATTER.PRIMARY]:{data:{fields:e.main.minorsPrimary}},[xm.FORMATTER.SECONDARY]:{data:{fields:e.main.minorsSecondary}}}}var $h={MAX_NUM_POINTS:5e4,DEFAULT_NUM_POINTS:2e3,DEFAULT_NUM_LINES:12};const{DEFAULT_NUM_POINTS:Hh}=$h;function jh({layoutService:e,largeDataService:t}){const{maxNumPoints:n=Hh}=(null==t?void 0:t.meta)||{},{qHyperCube:r}=e.getLayout();return r.qSize.qcy*r.qMeasureInfo.length>n}const{DEFAULT_NUM_LINES:Vh}=$h,Bh=({layoutService:e,largeDataService:t})=>{const{maxNumLines:n=Vh}=(null==t?void 0:t.meta)||{},{qHyperCube:r}=e.getLayout();return r.qDimensionInfo.length>1&&!jh({layoutService:e,largeDataService:t})?e.meta.size.dimensions[1]+1:n},{DEFAULT_NUM_POINTS:Uh}=$h,{MAX_NUM_POINTS:Yh,DEFAULT_NUM_POINTS:Wh,DEFAULT_NUM_LINES:Gh}=$h,{DEFAULT_NUM_POINTS:Xh}=$h,Kh=({layoutService:e,largeDataService:t})=>{if(!jh({layoutService:e,largeDataService:t})){const{maxNumPoints:e=Xh}=(null==t?void 0:t.meta)||{};return e}const{dimensionCount:n}=e.meta;return n>1?(({layoutService:e,largeDataService:t})=>{var n;const{dimensions:r=[]}=(null==e||null===(n=e.meta)||void 0===n?void 0:n.size)||{},{maxNumLines:i=Gh,maxNumPoints:o=Wh,hasInjectedData:a=!1}=(null==t?void 0:t.meta)||{};if(Bh({layoutService:e,largeDataService:t})*r[0]<=o)return r[0];const s=Math.max(1,Math.min(i,r[1])),l=o/s,u=Math.floor(r[0]<=l?l:l/4),c=2*s*(s+1);return a&&(s>Gh||o>Wh)?Math.min(u,Math.ceil(Yh/c)):u})({layoutService:e,largeDataService:t}):(({layoutService:e,largeDataService:t})=>{const{maxNumPoints:n=Uh}=(null==t?void 0:t.meta)||{},{measureCount:r=1}=(null==e?void 0:e.meta)||{},i=4+2*(r-1);return Math.floor(n/(r*i))})({layoutService:e,largeDataService:t})},Jh=({start:e,end:t,model:n,layoutService:r,largeDataService:i,definitionPath:o})=>{const a={qStart:e,qEnd:t,qNbrPoints:Kh({layoutService:r,largeDataService:i}),qMaxNbrTicks:300,qMaxNumberLines:Bh({layoutService:r,largeDataService:i})};return n.getHyperCubeContinuousData(o,a,!1)};function Zh({model:e,layoutService:t,largeDataService:n,definitionPath:r="/qHyperCubeDef"}){return{shouldFetchReduced:()=>jh({layoutService:t,largeDataService:n}),computeNbrOfBins:()=>Kh({layoutService:t,largeDataService:n}),computeMaxNumberLines:()=>Bh({layoutService:t,largeDataService:n}),fetch:(i,o)=>Jh({start:i,end:o,model:e,layoutService:t,largeDataService:n,definitionPath:r})}}function Qh(e={}){const{cache:t={}}=e;return{fetch:()=>Promise.resolve(t.merged)}}function ey({layoutService:e,viewCache:t}){return{fetch:()=>{const{qAxisData:t,qDataPages:n}=e.getHyperCube();return Promise.resolve({qAxisData:t,qDataPages:n})},getSnapshotData(){const n=e.getLayoutValue("snapshotData.content.chartData",{});return"zoom"in n&&"min"in n.zoom&&"max"in n.zoom?function({zoom:e}){return{zoom:e}}(n):function({scrollOffset:e=0,viewRange:t=0},n){let r=n+e,i=r+t;return 1===t&&0===e&&(r=n-.5,i=n+.5),{zoom:{min:r,max:i}}}(n,t.get("continuousMin"))}}}function ty(){const e=()=>{},t=[],n={};return e.set=(e,r)=>{const i=t.indexOf(e);i>-1&&t.splice(i,1),t.push(e),n[e]=r},e.forEach=e=>{t.forEach(((t,r)=>e(n[t],r)))},e.has=e=>e in n,e}function ny(e,t,n){return n[0]&&n[0][1]&&n[0][1].qElemNumber>-1?function({start:e,end:t,matrix:n}){const r=[],i=ty(),o=ty();for(let a=0;a<n.length;a++){const s=n[a],l=s[1].qElemNumber.toString();s[0].qNum<e?i.set(l,s):s[0].qNum>t&&(o.has(l)||o.set(l,s)),s[0].qNum>=e&&s[0].qNum<=t&&r.push(s)}return i.forEach(((e,t)=>r.splice(t,0,e))),o.forEach((e=>r.push(e))),r}({start:e,end:t,matrix:n}):function({start:e,end:t,matrix:n}){const r=[];let i,o;for(let a=0;a<n.length;a++){const s=n[a];s[0].qNum<e?i=s:s[0].qNum>t&&(o||(o=s)),s[0].qNum>=e&&s[0].qNum<=t&&r.push(s)}return i&&r.unshift(i),o&&r.push(o),r}({start:e,end:t,matrix:n})}function ry(e,t){return{...e,qWidth:t[0]?t[0].length:0,qHeight:t.length}}function iy(e,t,n){const r={qDataPages:(n.qDataPages||[]).map((n=>{const r=ny(e,t,n.qMatrix),i=ry(n.qArea,r);return{...n,qArea:i,qMatrix:r}}))};return n.qAxisData&&n.qAxisData.qAxis&&(r.qAxisData=function(e,t,n){return{qAxis:n.qAxis.map((n=>({qName:n.qName,qTags:n.qTags,qTicks:n.qTicks.reduce(((n,r)=>((r.qStart>=e&&r.qStart<=t||r.qEnd>=e&&r.qEnd<=t||r.qStart<e&&r.qEnd>t)&&n.push(r),n)),[])})))}}(e,t,n.qAxisData)),r}const oy=2**.5,ay=1/oy,sy=1e-6,ly=ay**44;function uy(e){return e.qIsOtherCell}function cy({qDataPages:e=[]}={},t={}){const n=e.length?e[0].qMatrix:[];return t.isStackedByDimension?function(e){const t={};return e.forEach((e=>{if(!e.some(uy)){const n=e[0].qElemNumber;t[n]=void 0}})),Object.keys(t).length}(n):function(e){let t=0;return e.forEach((e=>{e.some(uy)||t++})),t}(n)}const dy={query:{getShouldProcess:()=>!1},command:{processDataPage:()=>{}}};var my={created(){this.state={}},beforeUpdate(){this.state={}},beforeRender({size:e}){this.state.ticks=this.scale.ticks({distance:e.width}).filter((e=>!e.isMinor)),"linear"===this.scale.type&&function(e,t){const[,n]=e.domain();for(let e=0;e<t.length;e++){const r=t[e],i=t[e+1];r.data={},i||1===r.end?i?(r.data.start=r.value,r.data.end=i.value,r.end=i.position):(r.data.start=r.value,r.data.end=r.value):(r.data.start=r.value,r.data.end=n,r.end=1)}}(this.scale,this.state.ticks)},render(){const e=this.scale.data().fields.length?this.scale.data().fields[0].id():"",{ticks:t}=this.state,n=t.map((t=>({type:"rect",fill:"none",data:{source:{field:e},value:[t.data.start,t.data.end]},x:t.start*this.rect.width,y:0,width:(t.end-t.start)*this.rect.width,height:this.rect.height})));if(t.length&&t[0].start>0){const r=t[0];n.unshift({type:"rect",fill:"none",data:{source:{field:e},value:[this.scale.domain()[0],r.data.start]},x:0,y:0,width:r.start*this.rect.width,height:this.rect.height})}return n}};const fy="…";function py(e,t=1){if(t%2==0)return e;let n=Math.round(e);return e-n>0?n+=.5:n-=.5,n}function hy(e,t){const{localProps:{size:n},props:{anchor:r}}=t,i=function({props:e,localProps:{size:t},style:n,renderer:r}){const i=e.label.padding,o=Math.max(0,Math.min(e.label.justify,1)),a=Math.max(0,Math.min(e.label.align,1)),s=e=>r.measureText({text:e,fontSize:n.label.fontSize,fontFamily:n.label.fontFamily});return{resolve:(e,r)=>{const l="string"==typeof e.label?e.label:"",u=s(l);let{x:c,width:d}=r;e.start===e.end&&(d=u.width+2*i,1===e.end&&(c-=d));const m={x:c+i,y:i,width:d-2*i,height:t.height-2*i},f=s(`${l[0]}${fy}`).width,p=Math.max(0,m.width-u.width),h=Math.max(0,m.height-u.height),y=o*p,g=a*h;return{show:m.width>=Math.min(f,u.width),text:l,dx:y,dy:g,rect:m,style:n.label,segment:{x:c+y,width:u.width+2*i},tickValue:e.value}}}}(t),o=function({localProps:{size:e},style:t,scale:n,props:r}){const[i,o]=n.domain(),a=Math.max(0,Math.min(1,r.guideLine.major.justify));return{resolve:(n,r)=>{const s=a*r.width,l=py(r.x+s,t.majorGuideLine.strokeWidth);return{show:n.value>=i&&n.value<=o,x1:l,y1:0,x2:l,y2:py(e.height,t.majorGuideLine.strokeWidth),style:t.majorGuideLine,tickValue:n.value}}}}(t),a=e.map((e=>{const t=function(e,t,n){const r=Math.abs(Math.max(e.start,0)-Math.min(e.end,1))*t.width;return{x:Math.max(e[n],0)*t.width,y:0,width:r,height:t.height}}(e,n,r);return{rect:t,label:i.resolve(e,t),guideLine:o.resolve(e,t)}}));return function(e,t){const n=e.length;if(n<2)return;const r=e[n-1],i=t[n-1].label;if(r&&r.start===r.end)for(let e=n-2;e>-1;e--){const n=t[e].label;n.show=n.show&&(o=n.segment,a=i.segment,!(o.x<a.x?o.x+o.width>=a.x:a.x+a.width>=o.x))}var o,a}(e,a),a}function yy(e,t){const n=function({localProps:{size:e},props:t,style:n}){return{resolve:r=>{const i=Math.max(e.height-t.guideLine.minor.size,0)*Math.max(0,Math.min(t.guideLine.minor.align,1)),o=py(r.position*e.width,n.minorGuideLine.strokeWidth);return{guideLine:{show:!0,x1:o,y1:py(i,n.minorGuideLine.strokeWidth),x2:o,y2:py(t.guideLine.minor.size+i,n.minorGuideLine.strokeWidth),style:n.minorGuideLine}}}}}(t);return t.props.guideLine.minor.show?e.map(n.resolve):[]}function gy(e){return e.filter((e=>e.show)).map((e=>G({strokeWidth:1},e.style,{type:"line",x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,tickValue:e.tickValue})))}var vy={require:["renderer"],defaultSettings:{layout:{displayOrder:0,prioOrder:0},settings:{anchor:"start",label:{show:!0,padding:4,align:0,justify:0},line:{show:!0},guideLine:{major:{justify:0},minor:{show:!0,size:4,align:0}}},style:{label:"$label",line:"$guide-line",majorGuideLine:"$guide-line",minorGuideLine:"$guide-line"}},preferredSize:()=>({size:30,edgeBleed:{left:1,right:1}}),init(){this.props=this.settings.settings,this.localProps={},this.state={major:[],minor:[]}},created(){this.init()},beforeUpdate(){this.init()},beforeRender({size:e}){this.localProps.size=e;const t=this.scale.ticks({distance:e.width}),n=t.filter((e=>!e.isMinor)),r=t.filter((e=>e.isMinor));this.state.line=function({localProps:{size:e},style:t,props:n}){const r=py(1,t.line.strokeWidth);return{show:n.line.show,x1:py(0,t.line.strokeWidth),y1:r,x2:py(e.width,t.line.strokeWidth),y2:r,style:t.line}}(this),this.state.major=hy(n,this),this.state.minor=yy(r,this)},render(){return[...gy([this.state.line]),...(e=this.state.major.map((e=>e.label)),e.filter((e=>e.show)).map((e=>G({},e.style,{type:"text",x:e.rect.x,y:e.rect.y,dx:e.dx,dy:e.dy,maxWidth:e.rect.width,text:e.text,title:e.text,baseline:"text-before-edge",tickValue:e.tickValue})))),...gy(this.state.major.map((e=>e.guideLine))),...gy(this.state.minor.map((e=>e.guideLine)))];var e}};function by(e,t){return e&&t&&e.qTicks.length===t.qTicks.length&&e.qTicks.every(((e,n)=>e.qStart===t.qTicks[n].qStart&&e.qEnd===t.qTicks[n].qEnd))}function xy(e){return e.qTags.indexOf("$qualified")>-1}function Sy({qAxis:e}){const t=[],n=[];for(let r=0;r<e.length;r++){const i=r+1,o=e[r],a=e[i];by(o,a)?(xy(a)?(t.push(i),n.push(r)):(t.push(r),n.push(i)),r++):(t.push(r),n.push(r))}return{qualified:t,nonQualified:n}}function My({qualifiedMeta:e,nonQualifiedMeta:t}){return{resolve(n){let r,i=NaN,o=NaN,a=NaN,s=!1;for(let l=e.length-1;l>=0;l--){const u=e[l];if(u.queries.outer(n)){const e=t[l+1];if(i=u.index,r=l,u.attrs.isDayOrShorter()&&u.queries.canFitHalfDayTicks(n)){o="auto",s=!0;break}if(e&&e.queries.inner(n)){o=e.index;const r=t[l+2];r&&r.queries.minor(n)&&(a=r.index);break}}}if(!Number.isNaN(i)&&Number.isNaN(o)&&"auto"!==o){o=i,i=NaN;const e=t[r+1];e&&e.queries.minor(n)&&(a=e.index)}else Number.isNaN(i)&&(i="auto",o="auto");return{outer:i,inner:o,minor:a,isDayOrShorter:s}}}}const Ey=16;function Cy({qTicks:e,measureText:t=(()=>({width:0})),cache:n={},scale:r}){const i=n;return{isDayOrShorter:()=>(i.isDayOrShorter=e.length>0&&Math.abs(e[0].qStart-e[0].qEnd)<=1,i.isDayOrShorter),count:()=>e.length,maxRange:()=>(i.maxRange=e.length?Math.max(...e.map((e=>Math.abs(r(e.qStart)-r(e.qEnd))))):0,i.maxRange),rangeAndWidth(){const n=r.clamp();return r.clamp(!1),i.rangeAndWidth=e.map((e=>({range:Math.abs(r(e.qStart)-r(e.qEnd)),width:t(`${e.qText}`).width+Ey}))),r.clamp(n),i.rangeAndWidth}}}const qy=6;function Ay({attrs:e,reqAutoFitWidth:t}){return{outer:t=>!e.rangeAndWidth().some((({width:e,range:n})=>e>n*t)),inner:t=>!e.rangeAndWidth().some((({width:e,range:n})=>e>n*t)),minor:t=>e.maxRange()*t>=qy,canFitHalfDayTicks:n=>n>=t*e.count()}}function Oy({qualified:e,nonQualified:t,qAxis:n,measureText:r,reqAutoFitWidth:i,scale:o},{attributesFactory:a=Cy,queryFactory:s=Ay}={attributesFactory:Cy,queryFactory:Ay}){const l=n.map(((e,t)=>function(e,t){const{qTicks:n}=e,l=a({qTicks:n,measureText:r,scale:o});return{data:e,index:t,attrs:l,queries:s({attrs:l,reqAutoFitWidth:i})}}(e,t))),u=e.map((e=>l[e])),c=t.map((e=>l[e]));return{qAxisMeta:l,qualifiedMeta:u,nonQualifiedMeta:c}}function Dy({qAxis:e=[],measureText:t=(()=>({width:0})),cache:n={},reqAutoFitWidth:r=0,scale:i},{metaFactory:o=Oy,mapper:a=Sy,resolver:s=My}={metaFactory:Oy,mapper:Sy,resolver:My}){const{qualified:l,nonQualified:u}=a({qAxis:e}),{qualifiedMeta:c,nonQualifiedMeta:d}=o({qAxis:e,qualified:l,nonQualified:u,measureText:t,reqAutoFitWidth:r,scale:i}),m=s({qualifiedMeta:c,nonQualifiedMeta:d});return{resolve:t=>{const r=n.key({distance:t});if(n.get(r))return n.get(r);if(function(e){return!Array.isArray(e)||0===e.length||e.every((e=>0===e.qTicks.length))}(e))return{outer:"auto",inner:"auto",minor:NaN,isDayOrShorter:!1};const i=m.resolve(t);return n.set(r,i),i}}}const Iy=86400,wy=864e5;function Ty(e){return new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,0,Math.round(wy*(e-Math.floor(e)))))}const Ny=Ty(0).getTime();function Ly(e){return(e.getTime()-Ny)/Iy/1e3}var ky=new Date,Ry=new Date;function Py(e,t,n,r){function i(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return i.floor=function(t){return e(t=new Date(+t)),t},i.ceil=function(n){return e(n=new Date(n-1)),t(n,1),e(n),n},i.round=function(e){var t=i(e),n=i.ceil(e);return e-t<n-e?t:n},i.offset=function(e,n){return t(e=new Date(+e),null==n?1:Math.floor(n)),e},i.range=function(n,r,o){var a,s=[];if(n=i.ceil(n),o=null==o?1:Math.floor(o),!(n<r&&o>0))return s;do{s.push(a=new Date(+n)),t(n,o),e(n)}while(a<n&&n<r);return s},i.filter=function(n){return Py((function(t){if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)}),(function(e,r){if(e>=e)if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););}))},n&&(i.count=function(t,r){return ky.setTime(+t),Ry.setTime(+r),e(ky),e(Ry),Math.floor(n(ky,Ry))},i.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?i.filter(r?function(t){return r(t)%e==0}:function(t){return i.count(0,t)%e==0}):i:null}),i}var Fy=36e5,zy=Py((function(e){e.setTime(e-e.getMilliseconds())}),(function(e,t){e.setTime(+e+1e3*t)}),(function(e,t){return(t-e)/1e3}),(function(e){return e.getUTCSeconds()})),_y=zy;zy.range;var $y=Py((function(e){e.setUTCSeconds(0,0)}),(function(e,t){e.setTime(+e+6e4*t)}),(function(e,t){return(t-e)/6e4}),(function(e){return e.getUTCMinutes()})),Hy=$y;$y.range;var jy=Py((function(e){e.setUTCMinutes(0,0,0)}),(function(e,t){e.setTime(+e+t*Fy)}),(function(e,t){return(t-e)/Fy}),(function(e){return e.getUTCHours()})),Vy=jy;jy.range;var By=Py((function(e){e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+t)}),(function(e,t){return(t-e)/864e5}),(function(e){return e.getUTCDate()-1})),Uy=By;function Yy(e){return Py((function(t){t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+7*t)}),(function(e,t){return(t-e)/6048e5}))}By.range;var Wy=Yy(0),Gy=Yy(1),Xy=Yy(2),Ky=Yy(3),Jy=Yy(4),Zy=Yy(5),Qy=Yy(6);Wy.range,Gy.range,Xy.range,Ky.range,Jy.range,Zy.range,Qy.range;var eg=Py((function(e){e.setUTCDate(1),e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCMonth(e.getUTCMonth()+t)}),(function(e,t){return t.getUTCMonth()-e.getUTCMonth()+12*(t.getUTCFullYear()-e.getUTCFullYear())}),(function(e){return e.getUTCMonth()})),tg=eg;eg.range;var ng=Py((function(e){e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCFullYear(e.getUTCFullYear()+t)}),(function(e,t){return t.getUTCFullYear()-e.getUTCFullYear()}),(function(e){return e.getUTCFullYear()}));ng.every=function(e){return isFinite(e=Math.floor(e))&&e>0?Py((function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n*e)})):null};var rg=ng;ng.range;const ig={second:1,minute:2,hour:3,day:4,month:5,year:6};function og({timeScale:e,labels:t,distance:n,isDayOrShorter:r,cache:i,timeOnly:o,initialMin:a}){const[s,l]=e.domain(),u=i.key({distance:n});let c;i.get(u,1)?c=i.get(u,1):(c=function(e,t,n,r,i,o){function a(e){return rg.filter((t=>(t.getUTCFullYear()-o.getUTCFullYear())%e==0))}const s=_y.count(e,t),l=Hy.count(e,t),u=Vy.count(e,t),c=Uy.count(e,t),d=Wy.count(e,t),m=tg.count(e,t),f=rg.count(e,t),p=n/r.second.width-1,h=n/r.minute.width-1,y=n/r.date.width-1,g=n/r.year.width-1,v={type:"year",desc:"year",count:f,interval:rg.every(1),formatter:r.year.formatter,offset:e=>rg.offset(e,-1),floor:rg.floor};if(s<=p)v.type=ig.second,v.desc="second",v.count=s,v.interval=_y.every(1),v.formatter=r.second.formatter,v.offset=e=>_y.offset(e,-1),v.floor=_y.floor;else if(s/2<=p)v.type=ig.second,v.desc="every other second",v.count=s/2,v.interval=_y.every(2),v.formatter=r.second.formatter,v.offset=e=>_y.offset(e,-2),v.floor=_y.floor;else if(s/5<=p)v.type=ig.second,v.desc="every 5 second",v.count=s/5,v.interval=_y.every(5),v.formatter=r.second.formatter,v.offset=e=>_y.offset(e,-5),v.floor=_y.floor;else if(s/15<=p)v.type=ig.second,v.desc="every 15 second",v.count=s/15,v.interval=_y.every(15),v.formatter=r.second.formatter,v.offset=e=>_y.offset(e,-15),v.floor=_y.floor;else if(s/30<=p)v.type=ig.second,v.desc="every 30 second",v.count=s/30,v.interval=_y.every(30),v.formatter=r.second.formatter,v.offset=e=>_y.offset(e,-30),v.floor=_y.floor;else if(l<=h)v.type=ig.minute,v.desc="minute",v.count=l,v.interval=Hy.every(1),v.formatter=r.minute.formatter,v.offset=e=>Hy.offset(e,-1),v.floor=Hy.floor;else if(l/2<=h)v.type=ig.minute,v.desc="every 2 minute",v.count=l/2,v.interval=Hy.every(2),v.formatter=r.minute.formatter,v.offset=e=>Hy.offset(e,-2),v.floor=Hy.floor;else if(l/5<=h)v.type=ig.minute,v.desc="every 5 minute",v.count=l/5,v.interval=Hy.every(5),v.formatter=r.minute.formatter,v.offset=e=>Hy.offset(e,-5),v.floor=Hy.floor;else if(l/10<=h)v.type=ig.minute,v.desc="every 10 minute",v.count=l/10,v.interval=Hy.every(10),v.formatter=r.minute.formatter,v.offset=e=>Hy.offset(e,-10),v.floor=Hy.floor;else if(l/15<=h)v.type=ig.minute,v.desc="every 15 minute",v.count=l/15,v.interval=Hy.every(15),v.formatter=r.minute.formatter,v.offset=e=>Hy.offset(e,-15),v.floor=Hy.floor;else if(l/30<=h)v.type=ig.minute,v.desc="every 30 minute",v.count=l/30,v.interval=Hy.every(30),v.formatter=r.minute.formatter,v.offset=e=>Hy.offset(e,-30),v.floor=Hy.floor;else if(u<=h)v.type=ig.hour,v.desc="hour",v.count=u,v.interval=Vy.every(1),v.formatter=r.minute.formatter,v.offset=e=>Vy.offset(e,-1),v.floor=Vy.floor;else if(u/2<=h)v.type=ig.hour,v.desc="every 2 hour",v.count=u/2,v.interval=Vy.every(2),v.formatter=r.minute.formatter,v.offset=e=>Vy.offset(e,-2),v.floor=Vy.floor;else if(u/3<=h)v.type=ig.hour,v.desc="every 3 hour",v.count=u/3,v.interval=Vy.every(3),v.formatter=r.minute.formatter,v.offset=e=>Vy.offset(e,-3),v.floor=Vy.floor;else if(u/6<=h)v.type=ig.hour,v.desc="every 6 hour",v.count=u/6,v.interval=Vy.every(6),v.formatter=r.minute.formatter,v.offset=e=>Vy.offset(e,-6),v.floor=Vy.floor;else if(u/12<=h||i)v.type=ig.hour,v.desc="every 12 hour",v.count=u/12,v.interval=Vy.every(12),v.formatter=r.minute.formatter,v.offset=e=>Vy.offset(e,-12),v.floor=Vy.floor;else if(c<=y)v.type=ig.day,v.desc="day",v.count=c,v.interval=Uy.every(1),v.formatter=r.date.formatter,v.offset=e=>Uy.offset(e,-1),v.floor=Uy.floor;else if(c/2<=y)v.type=ig.day,v.desc="every 2 day",v.count=c/2,v.interval=Uy.every(2),v.formatter=r.date.formatter,v.offset=e=>Uy.offset(e,-2),v.floor=Uy.floor;else if(c/3<=y)v.type=ig.day,v.desc="every 3 day",v.count=c/3,v.interval=Uy.every(3),v.formatter=r.date.formatter,v.offset=e=>Uy.offset(e,-3),v.floor=Uy.floor;else if(d<=y)v.type=ig.day,v.desc="week",v.count=d,v.interval=Wy.every(1),v.formatter=r.date.formatter,v.offset=e=>Wy.offset(e,-1),v.floor=Uy.floor;else if(d/2<=y)v.type=ig.day,v.desc="every 2 week",v.count=d/2,v.interval=Wy.every(2),v.formatter=r.date.formatter,v.offset=e=>Wy.offset(e,-2),v.floor=Uy.floor;else if(m<=y)v.type=ig.month,v.desc="month",v.count=m,v.interval=tg.every(1),v.formatter=r.date.formatter,v.offset=e=>tg.offset(e,-1),v.floor=Uy.floor;else if(m/3<=y)v.type=ig.month,v.desc="quarter",v.count=m/3,v.interval=tg.every(3),v.formatter=r.date.formatter,v.offset=e=>tg.offset(e,-3),v.floor=Uy.floor;else if(m/6<=y)v.type=ig.month,v.desc="half year",v.count=m/6,v.interval=tg.every(6),v.formatter=r.date.formatter,v.offset=e=>tg.offset(e,-6),v.floor=Uy.floor;else if(f<=g)v.type=ig.year,v.desc="year",v.count=f,v.interval=rg.every(1),v.formatter=r.year.formatter,v.offset=e=>rg.offset(e,-1),v.floor=rg.floor;else if(f/2<=g)v.type=ig.year,v.desc="every 2 year",v.count=f/2,v.interval=a(2),v.formatter=r.year.formatter,v.offset=e=>rg.offset(e,-2),v.floor=rg.floor;else if(f/5<=g)v.type=ig.year,v.desc="every 5 year",v.count=f/5,v.interval=a(5),v.formatter=r.year.formatter,v.offset=e=>rg.offset(e,-5),v.floor=rg.floor;else if(f/10<=g)v.type=ig.year,v.desc="every 10 year",v.count=f/10,v.interval=a(10),v.formatter=r.year.formatter,v.offset=e=>rg.offset(e,-10),v.floor=rg.floor;else{const e=Math.floor(f/g);v.type=ig.year,v.desc="every nth year",v.count=e,v.interval=a(e),v.formatter=r.year.formatter,v.offset=t=>rg.offset(t,-e),v.floor=rg.floor}return v}(s,l,n,t.all(),r,a),i.set(u,c,1));const d=e.ticks(c.interval);d.length?s.getTime()!==d[0].getTime()&&d.unshift(c.offset(d[0])):d.push(c.floor(s));const m=d.map(((e,t,n)=>{const r=n[t+1]?n[t+1]-e:l-e;return{start:e,end:new Date(e.getTime()+r),formatter:c.formatter}}));let f=[];if(!o&&c.type<=ig.hour){const n=t.getFormat("date"),r=e.ticks(Uy.every(1));r.length&&s.getUTCDate()!==r[0].getUTCDate()&&r.unshift(Uy.offset(r[0],-1)),f=(r.length?r:[Uy.floor(s)]).map(((e,t,r)=>{const i=r[t+1]?r[t+1]-e:l-e;return{start:e,end:new Date(e.getTime()+i),formatter:n.formatter}}))}return{inner:m,outer:f}}const ag=86400,sg=1440,lg={};function ug(e,t,n,r){return{type:e,start:new Date(Date.UTC(...t)),end:new Date(Date.UTC(...n)),formatter:r}}function cg(e,t,n){const{generator:r,anchor:i,clamp:o,level:a}=t.ticks,{qNumFormat:s}=t.formatter;e.clamp(o);const[l,u]=e.domain(),c=Lo().domain([Ty(l),Ty(u)]);c.clamp(o),c.range(t.invert?[1,0]:[0,1]);const d="object"==typeof r?r:{type:r};let m;m="d3"===d.type?(e,i)=>og({timeScale:c,labels:n,distance:e,isDayOrShorter:i,cache:t.cache,timeOnly:"T"===s.qType,initialMin:void 0===d.initialMin?c.domain()[0]:Ty(r.initialMin)}):e=>function(e,t,n,r,i,o=!1){if(lg[[t,n,r,r,o]])return lg[[t,n,r,r,o]];const a={year:e.getFormat("year"),date:e.getFormat("date"),minute:e.getFormat("minute"),second:e.getFormat("second")},s=Ty(n),l=s.getFullYear(),u=s.getMonth(),c=s.getDate(),d=r-n,m=t/(i-r),f=m/1440,p=m/ag,h=366*m,y=3*m*30,g=a.second.width/p,v=a.minute.width/f,b=a.date.width/y,x=a.year.width/h;let S,M,E,C=0,q=0,A=null,O=null,D=null,I=null,w=null,T=null;const N={outer:[],inner:[]};for(g<1?(A=1,q=1/ag):g<2?(A=2,q=1/ag*2):g<5?(A=5,q=1/ag*5):g<10?(A=10,q=1/ag*10):g<30?(A=30,q=1/ag*30):v<1?(O=1,q=1/sg):v<2?(O=2,q=1/sg*2):v<5?(O=5,q=1/sg*5):v<10?(O=10,q=1/sg*10):v<30?(O=30,q=1/sg*30):v<60?(D=1,q=1/24):v<120?(D=2,q=2/24):v<360?(D=6,q=.25):v<720?(D=12,q=.5):b<1/90?(q=1,I=1):b<2/90?(q=2,I=2):b<7/90?(q=7,I=7):b<31/90?(w=1,q=31):b<1?(w=3,q=90):x<1?(T=1,q=366):x<2?(T=2,q=732):x<5?(T=5,q=1826.25):(T=10,q=3652.5),M=Math.floor((d+n%1)/q);C<i;){E=M+1,S=T?ug("year",[l+M*T,0,1],[l+E*T,0,1],a.year.formatter):w?ug("month",[l,u+M*w,1],[l,u+E*w,1],a.date.formatter):I?ug("day",[l,u,c+M*I],[l,u,c+E*I],a.date.formatter):D?ug("hour",[l,u,c,0+M*D],[l,u,c,0+E*D],a.minute.formatter):O?ug("minute",[l,u,c,0,0+M*O],[l,u,c,0,0+E*O],a.minute.formatter):ug("second",[l,u,c,0,0,0+M*A],[l,u,c,0,0,0+E*A],a.second.formatter),C=Ly(S.start),N.inner.push(S);const e=Math.floor(C);if(!(o||T||w||I)){const t={type:"day",start:Ty(e),end:Ty(e+1),formatter:a.date.formatter,qStart:e};N.outer[N.outer.length-1]&&N.outer[N.outer.length-1].qStart===t.qStart||N.outer.push(t)}M++}return N.min=r,N.max=i,lg[[t,n,r,r,o]]=N,N}(n,e,d.min,l,u,"T"===s.qType);const f={transform:(t=[],{isMinor:n=!1}={})=>t.map((t=>{let r;r="start"===i?t.qStart:"end"===i?t.qEnd:(t.qStart+t.qEnd)/2;const o=e.clamp();n&&e.clamp(!1);const a=e(r),s=e(t.qStart),l=e(t.qEnd);return e.clamp(o),{value:r,position:a,start:s,end:l,label:t.qText,isMinor:n,data:n?void 0:{start:t.qStart,end:t.qEnd,scaleStart:e.domain()[0]}}})).filter((e=>e.position>=0&&e.position<=1)),generate:(t=100,n)=>m(t,n)[a].map((t=>{let n;return n="start"===i?Ly(t.start):"end"===i?Ly(t.end):(Ly(t.start)+Ly(t.end))/2,{position:c(t.start),start:c(t.start),end:c(t.end),value:n,label:t.formatter(n),isMinor:!1,data:{start:Ly(t.start),end:Ly(t.end),scaleStart:e.domain()[0]}}})).filter((e=>e.position>=0&&e.position<=1))};return f}const dg=41000.2343433,mg=/t+/i,fg=16,pg=60;const hg={min:NaN,max:NaN,invert:!1,qAxis:[],field:void 0,formatter:{fn:()=>e=>e,measureText:()=>({width:0,height:0}),localeInfo:{},qNumFormat:{}},ticks:{generator:"d3",level:"outer",anchor:void 0,clamp:!1},cache:{get:()=>!1,set:()=>{},key:()=>""}};function yg(e,t){e.instance||(e.instance=t.copy(),e.instance.domain(t.domain()),e.instance.clamp(!0),e.instance.range(e.invert?[1,0]:[0,1]))}const gg="continuousPan";var vg={model:function({model:e,layoutService:t,largeDataService:n,dataProcessorModel:r=dy,viewCache:i,viewState:o,definitionPath:a},s={}){const{engineFetcherFactory:l=Zh,snapshotFetcherFactory:u=ey,cacheFetcherFactory:c=Qh,cache:d={initial:{},merged:{}}}=s,m=l({model:e,layoutService:t,largeDataService:n,definitionPath:a}),f=u({layoutService:t,viewCache:i}),p=c({cache:d}),h=e=>{throw e.isHandled=!0,e};let y,g,v;return{update(e){var n,r;({initialMin:g,initialMax:v}=function(e={}){let{qMin:t,qMax:n}=e;return t=Number.isNaN(+t)?0:t,n=Number.isNaN(+n)?0:n,{initialMin:t,initialMax:n}}(e.qHyperCube.qDimensionInfo[0])),i.set("continuousMin",g),i.set("continuousMax",v),i.set("minimiumZoomSpan",(n=g,r=v,Math.max(sy,(r-n)*ly))),y=t.meta.isSnapshot?f:m,t.meta.isSnapshot&&({zoom:{min:g,max:v}}=f.getSnapshotData()),o.preventSet("zoom",{min:g,max:v})},updateLayout(e){const{qDataPages:n,qAxisData:r}=e;return t.setHyperCubeValue("qDataPages",n),t.setHyperCubeValue("qAxisData",r),t.setHyperCubeValue("qMode","S"),t.setHyperCubeValue("qColumnOrder",[]),e},initialFetch(){return y.fetch(g,v).then((e=>{const t=function(e){return{qDataPages:e.qDataPages.map((e=>{const t=ry(e.qArea,e.qMatrix);return{...e,qArea:t}})),qAxisData:e.qAxisData}}(e);return r.command.processDataPage({dataPage:t.qDataPages.length?t.qDataPages[0]:[]}),d.initial=t,d.merged=t,e})).then((e=>iy(g,v,e))).then((e=>this.updateLayout(e))).catch(h)},fetch:(e,t)=>y.fetch(e,t).then((e=>function(e,t){const n={};return n.qDataPages=(e.qDataPages||[]).map(((e,n)=>{const r=function(e,t){if(!t||!t.length||!t[0].length)return e;const n=t[0][0].qNum,r=t[t.length-1][0].qNum,i=[],o=[];for(let t=0,a=e.length;t<a;t++){const a=e[t][0];a.qNum<n?i.push(e[t]):a.qNum>r&&o.push(e[t])}return[...i,...t,...o]}(e.qMatrix,t.qDataPages[n].qMatrix),i=ry(e.qArea,r);return{...e,qArea:i,qMatrix:r}})),e.qAxisData&&e.qAxisData.qAxis&&(n.qAxisData=function(e,t){if(!t||!t.qAxis.length||t.qAxis.every((e=>!e.qTicks.length)))return e;const n=t.qAxis.map((e=>e.qName)),r=t.qAxis.map((e=>({start:e.qTicks[0].qStart,end:e.qTicks[e.qTicks.length-1].qStart}))),i=t.qAxis.map((e=>({qName:e.qName,qTags:[...e.qTags],qTicks:[...e.qTicks]})));for(let t=0,o=e.qAxis.length;t<o;t++){const o=e.qAxis[t],a=n.indexOf(o.qName),s=[],l=[];if(a>-1){const{start:e,end:t}=r[a];for(let n=0,r=o.qTicks.length;n<r;n++){const r=o.qTicks[n];r.qStart<e?s.push(r):r.qStart>t&&l.push(r)}i[a].qTicks=[...s,...i[a].qTicks,...l]}}return{qAxis:i}}(e.qAxisData,t.qAxisData)),n}(d.initial,e))).then((e=>(r.command.processDataPage({dataPage:e.qDataPages.length?e.qDataPages[0]:[]}),d.merged=e,e))).then((n=>iy(e,t,n))).catch(h),fetchFromCache:(e,t)=>p.fetch(e,t).then((n=>iy(e,t,n))),fetchMinMaxData:()=>Promise.resolve(d.initial.qDataPages||[]),getInitialCube(){const e=t.getHyperCube();return G({},e,{...d.initial})},getInitialLayout(){const e=this.getInitialCube();return G({},t.getLayout(),{qHyperCube:e})},getDimensionCardinality:()=>cy(d.initial,t.meta),setSnapshotData(e){const{qHyperCube:t}=e,n=r.query.getShouldProcess()?[r.query.getFilteredDataPage({dataPage:d.merged.qDataPages[0]})]:d.merged.qDataPages;t.qDataPages=n,t.qAxisData=d.merged.qAxisData}}},event:{onZoomChange:function(e,t){const{layoutService:n,continuousDataModel:r}=e;function i(e,n,i){return r[e](n,i).then((e=>(r.updateLayout(e),t(),e)))}const o=Wl(((e,t)=>i("fetch",e,t)),50);return({min:e,max:t},{min:r,max:a})=>!n.meta.isContinuous||e===r&&t===a?Promise.resolve(null):i("fetchFromCache",e,t).then((n=>(o(e,t),n)))},onZoomIntercept:function({viewCache:e}){let t=NaN,n=NaN,r=NaN;return(i,o)=>(t=e.get("continuousMin"),n=e.get("continuousMax"),r=e.get("minimiumZoomSpan"),Math.abs(i.max-i.min)<r?o:{min:Math.min(i.max,Math.max(t,i.min)),max:Math.max(i.min,Math.min(n,i.max))})},onZoom:function({viewCache:e,viewState:t,chart:n},{threshold:r=50,rtl:i=!1,targetKey:o}){const a=e.get("continuousMin"),s=e.get("continuousMax");return Gl(((e,r)=>{const l=(e=>n.componentsFromPoint(e).filter((e=>e.key===o))[0])(e);if(l){const o=function(e,t,n){let{x:r}=e;return r-=t.element.getBoundingClientRect().left,r-=n.rect.x,Math.max(0,Math.min(1,r/n.rect.width))}(e,n,l),u=i?1-o:o,{min:c,max:d}=t.get("zoom"),m=Math.abs(d-c),f=m-(r>0?ay:oy)*m,p=c+f*u,h=d-f*(1-u),y=p<a?a-p:0,g=h>s?h-s:0;t.set("zoom",{min:Math.max(p-g,a),max:Math.min(h+y,s)})}}),r)}},interactions:{areaPan:function({targetKey:e,chart:t,actions:n,viewState:r,viewCache:i}){return{type:"Pan",key:"continuous:pan",options:{event:gg,pointers:1,threshold:10,enable(r,i){return this.started===gg||!i||!!n.scroll.enabled()&&t.componentsFromPoint({x:i.center.x,y:i.center.y}).some((t=>t.key===e))}},events:{[`${gg}start`](n){n.preventDefault(),this.started=gg;const{min:i,max:o}=r.get("zoom");this[gg]={min:i,max:o,size:t.component(e).rect.computedInner.width,span:o-i}},[`${gg}move`](e){e.preventDefault();const{span:t,min:n,max:o,size:a}=this[gg],s=-e.deltaX/a;r.set("zoom",{min:Math.min(n+s*t,i.get("continuousMax")-t),max:Math.max(o+s*t,i.get("continuousMin")+t)})},[`${gg}end`](e){e.preventDefault(),this.started=!1},[`${gg}cancel`](e){e.preventDefault(),this.started=!1}}}}},picassoComponents:{axisOverlay:my,timeAxis:vy},picassoScales:{time:function e(t,n={}){const r=function(e,t,n){const r={};return Object.keys(t).forEach((i=>{const o=e[i],a=typeof o;"function"===a?r[i]=o(n):"object"!==a||Array.isArray(o)?r[i]="undefined"===a?t[i]:o:r[i]=G(!0,{},t[i],o)})),r}(t,hg,n),{qAxis:i}=r,o=Mr(),a={instance:null,invert:!1},{min:s,max:l}=function(e,t){let n=+e.min,r=+e.max;return Number.isNaN(n)&&Number.isNaN(r)&&Array.isArray(t)&&t.length&&(n=Math.min(...t[t.length-1].qTicks.map((e=>e.qStart))),r=Math.max(...t[t.length-1].qTicks.map((e=>e.qEnd)))),n===r&&(n-=.5,r+=.5),{min:Number.isNaN(+n)?0:n,max:Number.isNaN(+r)?1:r}}(r,i);let u,c,d=[];const m=function(e){return Number.isNaN(+e)?NaN:o(e)};m.ticks=({distance:e,resolve:t=u.resolve}={})=>{const n=t(e),o=n[r.ticks.level];if(Number.isNaN(+o)||(d=c.transform(i[o].qTicks,{isMinor:!1})),!Number.isNaN(+n.minor)){const e=c.transform(i[n.minor].qTicks,{isMinor:!0});d=d.concat(e)}return"auto"===o&&(d=c.generate(e,n.isDayOrShorter)),d},m.invert=e=>o.invert(e),m.domain=e=>Array.isArray(e)?o.domain(e):o.domain(),m.range=e=>Array.isArray(e)?o.range(e):o.range(),m.norm=e=>(yg(a,m),a.instance(e)),m.normInvert=e=>(yg(a,m),a.instance.invert(e)),m.copy=()=>e(t,n),m.clamp=(e=!0)=>(o.clamp(e),o.clamp()),m.min=()=>Math.min(s,l),m.max=()=>Math.max(s,l),o.range(r.invert?[1,0]:[0,1]),o.domain([s,l]),a.invert=r.invert;const f=function(e){const t={},{measureText:n,fn:r,localeInfo:i}=e.formatter,o={second:{type:"second",pattern:"hh:mm:ss",width:pg,formatter:void 0},minute:{type:"minute",pattern:"hh:mm",width:pg,formatter:void 0},date:{type:"date",pattern:"YYYY-MM-DD",width:pg,formatter:void 0},year:{type:"year",pattern:"YYYY",width:pg,formatter:void 0}};return i&&mg.test(i.qTimestampFmt)&&(o.minute.pattern+=" tt",o.second.pattern+=" tt"),o.date.pattern=i&&i.qDateFmt?i.qDateFmt:o.date.pattern,Object.keys(o).forEach((e=>{o[e].formatter=r(o[e].pattern),o[e].width=Math.max(o[e].width,n(o[e].formatter(dg)).width+fg)})),t.getFormat=e=>o[e],t.all=()=>o,t.getFormatFromTicks=e=>{const t=e.filter((e=>!e.isMinor)),{length:n}=t;if(!n)return o.date;const r=Ty(t[0].data.start),i=Ty(t[n-1].data.start);return Uy.count(r,i)/n>=1?o.date:Vy.count(r,i)/n>0?o.minute:Hy.count(r,i)/n>0?o.second:o.date},t}(r);return c=cg(o.copy(),r,f),u=Dy({qAxis:i,measureText:r.formatter.measureText,reqAutoFitWidth:2*f.getFormat("minute").width,cache:r.cache,scale:m}),m.data=()=>({fields:[{formatter:m.formatter,id:()=>`qHyperCube/${r.field}`,key:()=>r.field,raw:Vl(n,"fields.0.raw",(()=>({})))}]}),m.formatter=()=>f.getFormatFromTicks(d).formatter,m}}};const bg=e=>e.meta.seriesComponentKeys[0],xg=(e,t)=>{if(t){const n=Math.abs(e.deltaX)>Math.abs(e.deltaY)?e.deltaX:e.deltaY;t.emit(n>=0?"next":"prev"),e.preventDefault()}};function Sg({chart:e,models:t,actions:n,viewState:r,viewCache:i,environment:o}){const{event:{onZoom:a}}=vg,{layoutService:s,seriesModel:l}=t,u=bg(l),c=s.meta.isContinuous?a({chart:e,viewState:r,viewCache:i},{rtl:"rtl"===o.options.direction,threshold:50,targetKey:u}):()=>{};return{type:"native",events:{wheel(t){const r={x:t.clientX,y:t.clientY},i=e.componentsFromPoint(r);if(n.interact.enabled()){const[e]=i.filter((e=>e.key===xm.COMPONENT.LEGEND_CATEGORICAL));xg(t,e)}if(n.scroll.enabled()){const[e]=i.filter((e=>e.key===u));e&&(c(r,Math.sign(-t.deltaY)),t.preventDefault())}}}}}const Mg="continuousPinchZoom";function Eg({chart:e,models:t,environment:n,viewState:r,viewCache:i,actions:o,selectables:a}){const s=vg.interactions.areaPan,{layoutService:l,dockService:u,discreteModel:c,colorService:d,tooltipService:m}=t,f="rtl"===n.options.direction,p=m.getInteractions(),h=function({componentKey:e,chart:t,actions:n,viewState:r,viewCache:i,layoutService:o,dockService:a,discrete:s,rtl:l}){return{gestures:[...uf({componentKey:e,chart:t,actions:n,viewState:r,viewCache:i,layoutService:o,dockService:a,discrete:s,rtl:l})],native:cf({componentKey:e,chart:t,actions:n,layoutService:o})}}({componentKey:"scrollbar",chart:e,actions:o,viewState:r,viewCache:i,discrete:c,layoutService:l,dockService:u,rtl:f}),y={type:"hammer",enable:!0,gestures:[...d.custom.legendInteractions(),...a.gestures.sort(((e,t)=>(t.prio||0)-(e.prio||0))),...h.gestures,...p.gestures]},g=[Sg({chart:e,models:t,actions:o,viewState:r,viewCache:i,environment:n}),h.native,p.native];return l.meta.isDiscrete&&(y.gestures.push(...c.interactions.gestures),g.push(c.interactions.native)),l.meta.isContinuous&&y.gestures.push(s({targetKey:bg(t.seriesModel),chart:e,actions:o,viewState:r,viewCache:i}),function({targetKey:e,chart:t,actions:n,viewState:r,viewCache:i,rtl:o}){const a={last:0,diff:0},s=vg.event.onZoom({viewCache:i,viewState:r,chart:t},{threshold:100,rtl:o,targetKey:e});return{type:"Pinch",key:"continuous:pinch-zoom",options:{event:Mg,pointers:2,threshold:0,enable:(r,i)=>!i||!!n.scroll.enabled()&&t.componentsFromPoint({x:i.center.x,y:i.center.y}).some((t=>t.key===e))},events:{[`${Mg}start`](e){a.last=e.scale,e.preventDefault()},[`${Mg}move`](e){const t=e.scale-a.last;Math.abs(t)>.01&&s(e.center,t>0?1:-1),a.last=e.scale,e.preventDefault()}}}}({targetKey:bg(t.seriesModel),chart:e,actions:o,viewState:r,viewCache:i,rtl:f})),[y,...g]}const Cg=({key:e,components:t})=>({key:e,type:"brush-lasso",layout:{displayOrder:99},settings:{brush:{components:t},lasso:{fill:"rgba(0, 0, 0, 0)",stroke:"black",strokeWidth:2,opacity:.7,strokeDasharray:[]},snapIndicator:{threshold:75,strokeDasharray:"5, 5",stroke:"black",strokeWidth:2,opacity:.7},startPoint:{r:10,stroke:"rgba(77, 192, 78, 1)",strokeWidth:0,opacity:1}}}),qg="lasso",Ag=({key:e,componentTargetKey:t,requireFailure:n,recognizeWith:r},i)=>({key:`event:${e}`,type:"Pan",requireFailure:n,recognizeWith:r,options:{event:qg,enable(e,n){if(this.started===qg||!n)return!0;if(!i.actions.select.enabled()||!i.actions.lasso.enabled()||!i.actions.lasso.active())return!1;return this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).filter((e=>e.key===t)).length>0}},events:{lassostart(t){t.preventDefault(),this.started!==qg&&(i.actions.select.emit("start",qg),this.chart.component(e).emit("lassoStart",t),this.started=qg)},lassomove(t){t.preventDefault(),this.chart.component(e).emit("lassoMove",t),"function"==typeof i.updateOnMove&&i.updateOnMove(this.chart)},lassoend(t){t.preventDefault(),this.started=!1,this.chart.component(e).emit("lassoEnd",t),i.actions.select.emit("end",qg),"function"==typeof i.updateOnEnd&&i.updateOnEnd()}}});const Og=({targets:e,requireFailure:t,recognizeWith:n,components:r,eventName:i="tap"},o)=>{let a;const s=o.customTooltipModel?o.customTooltipModel.utils:void 0,l=s?o.debouncer(s.displayTooltip,s.DEBOUNCE_THRESHOLD):void 0;return{key:"event:tap",type:"Tap",requireFailure:t,recognizeWith:n,options:{event:i,interval:10,pointers:1,enable(t,n){return!n||!(!o.actions.select.enabled()&&!o.actions.tooltip.enabled())&&(a=this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).filter((t=>-1!==e.indexOf(t.key))),a.length>0)}},events:{[i](t){t.preventDefault();const n=function(e,t){const n=t.element.getBoundingClientRect();let r,i;return e.center?(({x:r}=e.center),({y:i}=e.center)):(r=e.clientX,i=e.clientY),{x:r-n.left,y:i-n.top}}(t,this.chart),u=o.hitRadius?o.hitRadius(a):0,c=u>0?{cx:n.x,cy:n.y,r:u}:n,d=o.shapesAt?o.shapesAt(c):this.chart.shapesAt(c,{components:e.map((e=>({key:e,propagation:"stop"}))),propagation:"stop"}),m=this.chart.component("tooltip"),f="mouse"!==t.pointerType&&m&&m.show;if(!o.isLocked(a)&&!o.tooltipOnly&&o.actions.select.enabled()){const e=this.chart.componentsFromPoint({x:t.center.x,y:t.center.y}),n=e.some((e=>"legend-cat"===e.type));if(!d.length&&n||(this.chart.brushSelectionIncludeMax=!1,o.actions.select.brushSelectionIncludeMax=!1,o.actions.select.emit("start",i,e)),d.length&&r){this.chart.brushSelectionIncludeMax=!1,o.actions.select.brushSelectionIncludeMax=!1;const e="function"==typeof r?r(t,d):r;this.chart.brushFromShapes(d,{components:e}),o.actions.select.emit("end",i),(({largeDataService:e,chart:t})=>{((null==e?void 0:e.meta)||{}).isLargeNumPoints&&t.brush("lazySelection")._state(t.brush("selection")._state())})({largeDataService:o.largeDataService,chart:this.chart})}}if(m&&o.actions.tooltip.enabled())if(d.length){const{customTooltipModel:e}=o;if(null!=e&&e.useCustomTooltip&&s.checkIfPromisesExist({customTooltipModel:e})){const n=s.getNodes(t,this.chart);l(t,m,{nodes:n,opts:o,customTooltipModel:e})}else m.emit("show",t,{nodes:d})}else f&&m.emit("hide")}}}};const Dg=({key:e,requireFailure:t,recognizeWith:n,eventName:r="tap"},i)=>({prio:1,key:`event:${e}-tap`,type:"Tap",requireFailure:t,recognizeWith:n,options:{event:`${r}-${e}-tap`,interval:10,pointers:1,enable:(t,n)=>!!n&&(!!i.actions.select.enabled()&&(!(!n.target||"INPUT"!==n.target.nodeName)||!(!n.target||!n.target.hasAttribute("data-other-value"))&&(n.target.getAttribute("data-key")||"").split("-bubble")[0]===e))},events:{[`${r}-${e}-tap`](t){(t.target.getAttribute("data-key")||"").split("-bubble")[0]&&(t.preventDefault(),this.chart.component(e).emit("bubbleStart",t))}}});const Ig=({eventName:e,key:t,fillTargets:n=[],requireFailure:r,recognizeWith:i},o,a)=>({key:`event:${t}`,type:"Pan",requireFailure:r,recognizeWith:i,options:{event:e,enable(r,i){if(this.started===e||!i)return!0;if(!o.actions.select.enabled())return!1;const a=this.chart.componentsFromPoint({x:i.center.x,y:i.center.y}).filter((e=>-1!==n.indexOf(e.key))),s=0===a.length&&function(e,t){const{target:n}=e.srcEvent;return!(!n||0!==(n.getAttribute("data-key")||"").indexOf(`${t}-`))}(i,t);return s?(this.started=e,!0):a.length>0}},events:{[`${e}start`](n){void 0===this.chart.brushSelectionIncludeMax&&(this.chart.brushSelectionIncludeMax=!0,o.actions.select.brushSelectionIncludeMax=!0),n.preventDefault(),o.actions.select.emit("start",e),this.chart.component(t).emit(`${a}Start`,n),this.started=e},[`${e}move`](e){e.preventDefault(),this.chart.component(t).emit(`${a}Move`,e),"function"==typeof o.updateOnMove&&o.updateOnMove(this.chart)},[`${e}end`](n){void 0===this.chart.brushSelectionIncludeMax&&(this.chart.brushSelectionIncludeMax=!0,o.actions.select.brushSelectionIncludeMax=!0),n.preventDefault(),this.chart.component(t).emit(`${a}End`,n),o.actions.select.emit("end",e),this.started=!1,"function"==typeof o.updateOnEnd&&o.updateOnEnd()}}});function wg(e,t){const n=function(e){const{key:t,targets:n,fillTargets:r,targetSelector:i,targetFillSelector:o,dock:a,scale:s,bubblesPlacement:l="inside",observeBrush:u=!1,multiple:c=!1,toLabel:d,onEdited:m}=e;return{key:t,type:"brush-range",layout:{dock:n.map((e=>`@${e}`)).join(",")},on:m?{bubbleEnd(){m()}}:{},settings:{brush:u?{context:"selection",observe:!0}:"selection",scale:s,multiple:c,direction:"left"===a||"right"===a?"vertical":"horizontal",bubbles:{align:"left"===a||"top"===a?"end":"start",placement:l,label:d},target:{components:r,selector:i,fillSelector:o,fill:"rgba(82,204,82,0.2)"}}}}(e),r=Ig(e,t,"range");return{interactions:[e.onEdited?Dg(e,t):null,r].filter(Boolean),components:[n]}}const Tg=/axis|legend/,Ng=e=>e.some((e=>Tg.test(e.type)));function Lg({actions:e,models:t}){const{seriesModel:n,layoutService:r,colorService:i,flags:o}=t,a=r.getHyperCubeValue("qDimensionInfo.0.qIsOneAndOnlyOne",!1),s={targets:[`${xm.COMPONENT.BAR}-${Sm.AXIS.PRIMARY}`,`${xm.COMPONENT.BAR}-${Sm.AXIS.SECONDARY}`,...n.query.series(Sm.TYPE.MARKER).map((e=>op(xm.COMPONENT.MARKER,e))),...n.query.series(Sm.TYPE.LINE).map((e=>op(xm.COMPONENT.POINT,e))),xm.COMPONENT.AXIS.MAJOR,xm.COMPONENT.AXIS_OVERLAY.TIME_INNER,xm.COMPONENT.AXIS_OVERLAY.TIME_OUTER,xm.COMPONENT.AXIS_OVERLAY.CONTINUOUS,xm.COMPONENT.LEGEND_CATEGORICAL],components:(e,t)=>{const[n]=t,{key:r}=n,i={key:r,action:e.srcEvent.ctrlKey||a?"set":"toggle",contexts:["selection"]};return-1===[xm.COMPONENT.AXIS.MAJOR,xm.COMPONENT.AXIS_OVERLAY.TIME_INNER,xm.COMPONENT.AXIS_OVERLAY.TIME_OUTER,xm.COMPONENT.AXIS_OVERLAY.CONTINUOUS,xm.COMPONENT.LEGEND_CATEGORICAL].indexOf(r)&&(i.data=["selectionDimension"]),[i]}},l={actions:e,isLocked:e=>e.some((e=>"legend-cat"===e.type))?i.isSelectionLocked({isMeasureSelectionLocked:r.meta.isDimensionLocked}):r.meta.isDimensionLocked,hitRadius:e=>Ng(e)?0:3,debouncer:Wl,flags:o};return function(e,t){if(!e.targets)throw new Error("Missing 'targets' property");return{interactions:[Og(e,t)],components:[]}}(s,l)}function kg({actions:e,models:t}){const{layoutService:n,dockService:r,seriesModel:i}=t,{isDiscrete:o,isDimensionLocked:a}=n.meta;if(!o||a)return!1;const s=[...i.meta.seriesComponentKeys,xm.COMPONENT.AXIS.MAJOR];return function(e,t){const n=function(e){const{key:t,targets:n,components:r,fillTargets:i,dock:o}=e;return{key:t,type:"brush-area-dir",layout:{dock:n.map((e=>`@${e}`)).join(",")},settings:{multiple:!0,brush:{components:r},direction:"left"===o||"right"===o?"vertical":"horizontal",bubbles:{align:"left"===o||"top"===o?"end":"start",placement:"inside"},target:{components:i,fill:"rgba(82,204,82,0.2)"}}}}(e);return{interactions:[Ig(e,t,"area")],components:[n]}}({eventName:"discreteRange",key:"discrete-range-brush",components:[{key:s[0],contexts:["selection"],action:"set",data:["selectionDimension"]}],targets:s,fillTargets:[xm.COMPONENT.AXIS.MAJOR],dock:r.meta.major.dock},{actions:e})}const Rg={components:[],interactions:[]};function Pg({actions:e,chart:t,models:n,isUnsupportedFeature:r}){const i=function({actions:e,models:t,isUnsupportedFeature:n}){const{dockService:r,seriesModel:i,layoutService:o}=t;return!(o.meta.isDimensionLocked||o.meta.isBarSeriesStacked||null!=n&&n("rangeSelections"))&&wg({eventName:"minorRange",key:"minor-range-brush",targets:[xm.COMPONENT.AXIS.MINOR.PRIMARY,`${xm.COMPONENT.BAR}-${Sm.AXIS.PRIMARY}`,...i.query.series(Sm.TYPE.MARKER).filter((e=>e.isPrimary)).map((e=>op(xm.COMPONENT.MARKER,e))),...i.query.series(Sm.TYPE.LINE).filter((e=>e.isPrimary)).map((e=>op(xm.COMPONENT.POINT,e)))],fillTargets:[xm.COMPONENT.AXIS.MINOR.PRIMARY],dock:r.meta.minor.dock,scale:xm.SCALE.MINOR.PRIMARY,onEdited(){e.select.emit("end","minorRange")}},{actions:e})}({actions:e,models:n,isUnsupportedFeature:r})||Rg,o=function({actions:e,models:t,isUnsupportedFeature:n}){const{dockService:r,seriesModel:i,layoutService:o}=t;return!(o.meta.isDimensionLocked||o.meta.isBarSeriesStacked||null!=n&&n("rangeSelections"))&&wg({eventName:"minorRange-secondary",key:"minor-secondary-range-brush",targets:[xm.COMPONENT.AXIS.MINOR.SECONDARY,`${xm.COMPONENT.BAR}-${Sm.AXIS.SECONDARY}`,...i.query.series(Sm.TYPE.MARKER).filter((e=>!e.isPrimary)).map((e=>op(xm.COMPONENT.MARKER,e))),...i.query.series(Sm.TYPE.LINE).filter((e=>!e.isPrimary)).map((e=>op(xm.COMPONENT.POINT,e)))],fillTargets:[xm.COMPONENT.AXIS.MINOR.SECONDARY],dock:r.meta.minorSecondary.dock,scale:xm.SCALE.MINOR.SECONDARY,onEdited(){e.select.emit("end","minorRange-secondary")}},{actions:e})}({actions:e,models:n,isUnsupportedFeature:r})||Rg,a=kg({actions:e,models:n})||Rg,s=function({actions:e,chart:t,models:n}){const{layoutService:r,dockService:i,seriesModel:o}=n,{isContinuous:a,isTime:s}=r.meta;if(!a)return!1;const l=s?[xm.COMPONENT.AXIS_OVERLAY.TIME_INNER,xm.COMPONENT.AXIS_OVERLAY.TIME_OUTER]:[xm.COMPONENT.AXIS_OVERLAY.CONTINUOUS];return wg({eventName:"continuousRange",key:"continuous-range-brush",targets:[`${xm.COMPONENT.BAR}-${Sm.AXIS.PRIMARY}`,`${xm.COMPONENT.BAR}-${Sm.AXIS.SECONDARY}`,...o.query.series(Sm.TYPE.MARKER).map((e=>op(xm.COMPONENT.MARKER,e))),...o.query.series(Sm.TYPE.LINE).map((e=>op(xm.COMPONENT.POINT,e))),...l],fillTargets:l,dock:i.meta.major.dock,scale:s?xm.SCALE.MAJOR_INNER:xm.SCALE.MAJOR,observeBrush:!0,multiple:!0,toLabel({datum:e,data:n,scale:r}){const i=s?r.formatter():t.formatter(xm.FORMATTER.PRIMARY),o=t.scale(xm.SCALE.MAJOR).max(),a=t.brushSelectionIncludeMax&&e===o;return`${e!==Math.max(...n)||a?"":"<"}${i(e)}`}},{actions:e})}({actions:e,chart:t,models:n})||Rg,l=function({actions:e,models:t}){const{colorService:n,layoutService:r}=t,[i]=n.custom.legendComponents(),o=n.custom.wrappedScales(),{isDimensionLocked:a}=r.meta;if(a||!i)return!1;const s=`${xm.SCALE.COLOR}Range`,{type:l,key:u}=i,c=o[s];return!("legend-seq"!==l||!c||c.min>=c.max)&&wg({eventName:"legendRange",key:"legend-range-brush",targets:[u],fillTargets:[u],targetSelector:'[id="legend-seq-target"]',targetFillSelector:'[id="legend-seq-ticks"]',dock:i.layout.dock,scale:s,bubblesPlacement:"outside",onEdited:()=>{e.select.emit("end","legendRange")}},{actions:e})}({actions:e,models:n})||Rg;return{components:[...i.components,...o.components,...a.components,...s.components,...l.components],interactions:[...i.interactions,...o.interactions,...a.interactions,...s.interactions,...l.interactions]}}function Fg({actions:e,models:t}){const{layoutService:n,seriesModel:r}=t,{seriesComponentKeys:i}=r.meta;if(n.meta.isDimensionLocked)return{components:[],interactions:[]};return function(e,t){if(!e.componentTargetKey)throw new Error("Missing 'componentTargetKey' property");const n={key:"lasso",...e},r=Cg(n);return{interactions:[Ag(n,t)],components:[r]}}({key:"lasso",componentTargetKey:i[0],components:i.map((e=>({key:e,action:"add",contexts:["selection"],data:["selectionDimension"]})))},{actions:e})}function zg({picasso:e,chart:t,models:n,environment:r,viewState:i,viewCache:o,actions:a,isUnsupportedFeature:s}){const{colorService:l,pluginService:u}=n,c=n.layoutService.getLayout(),{options:d}=r,m=function({layout:e,options:t={}}){return!(null==e||!e.snapshotData||t.freeResize)&&{width:e.snapshotData.content.size.w,height:e.snapshotData.content.size.h}}({layout:c,options:d}),f=(p={logicalSize:m,minCenterRatio:0},{layoutModes:ee.getLayoutModes(),center:void 0!==p.minCenterRatio?{minWidthRatio:p.minCenterRatio,minHeightRatio:p.minCenterRatio}:void 0,logicalSize:p.logicalSize?{align:.5,preserveAspectRatio:!0,...p.logicalSize}:void 0});var p;const h=function({chart:e,models:t,environment:n,viewState:r,viewCache:i,actions:o}){var a;const{colorService:s,layoutService:l,dockService:u,tooltipService:c}=t,d=Rh({environment:n,models:t});return"center"===(null==d||null===(a=d.layout)||void 0===a?void 0:a.dock)?[d]:[...Sh({models:t}),...Wf({models:t}),...yh({chart:e,models:t,environment:n,viewState:r,viewCache:i}),zh({models:t,environment:n}),...Qf({models:t,environment:n}),...qh({models:t,environment:n,actions:o}),Fo({viewState:r,viewCache:i,layoutService:l,dockService:u}),...Th({models:t}),...Nh({chart:e,models:t,environment:n}),Ah({models:t,environment:n,viewState:r,viewCache:i}),...s.custom.legendComponents(),Ph(t),...wh({chart:e,models:t,viewState:r,viewCache:i,environment:n}),...c.getComponents(),d].filter(Boolean)}({chart:t,models:n,environment:r,viewState:i,viewCache:o,actions:a}),y=function({actions:e,chart:t,models:n,isUnsupportedFeature:r}){const{layoutService:i}=n,o=i.getHyperCubeValue("qDimensionInfo.0.qIsOneAndOnlyOne",!1),a=Lg({actions:e,models:n});if(o)return{components:[...a.components],gestures:[...a.interactions]};const s=Pg({actions:e,chart:t,models:n,isUnsupportedFeature:r}),l=Fg({actions:e,models:n});return{components:[...a.components,...s.components,...l.components],gestures:[...a.interactions,...s.interactions,...l.interactions]}}({actions:a,chart:t,models:n,isUnsupportedFeature:s}),g=u.extendComponents([...h,...y.components]);return{collections:Nf({models:n}),scales:Bf({picasso:e,models:n,viewState:i,viewCache:o,environment:r}),components:g,formatters:_h({models:n}),interactions:Eg({chart:t,models:n,environment:r,viewState:i,viewCache:o,actions:a,selectables:y}),strategy:f,palettes:l.getPalettes()}}const _g=({models:{layoutService:e,fieldModel:t,appLayoutModel:n}})=>({type:"q",key:xm.DATA.MAIN,data:e.getHyperCube(),config:{virtualFields:t.virtuals,localeInfo:n.qLocaleInfo}}),$g=({models:{layoutService:e,fieldModel:t,continuousModel:n,appLayoutModel:r}})=>e.meta.isContinuous?[{type:"q",key:xm.DATA.REDUCED,data:n.getInitialCube(),config:{virtualFields:t.virtuals,localeInfo:r.qLocaleInfo}}]:[],Hg=[xm.COMPONENT.AXIS_TITLE.MAJOR,xm.COMPONENT.AXIS_TITLE.MINOR.PRIMARY,xm.COMPONENT.AXIS_TITLE.MINOR.SECONDARY,xm.COMPONENT.GRID_LINE,xm.COMPONENT.ZERO_LINE],jg=({picasso:e,chart:t,models:r,environment:o,viewState:a,viewCache:s,actions:l})=>{(({chart:e,models:t,viewState:r,viewCache:i})=>{const{event:{onZoomIntercept:o,onZoomChange:a}}=vg;n((()=>{if(!t||!r||!i)return;const{layoutService:n,continuousModel:s,refLineModel:l,seriesModel:u}=t,{miniComponentKeys:c}=u.meta,d=()=>{l&&l.update(),e.update({partialData:!0,excludeFromUpdate:[...Hg,...c]})};r.onChanged("scrollOffset",d),n.meta.isContinuous&&(r.onChanged("zoom",a({layoutService:n,continuousDataModel:s},d)),r.intercept("zoom",o({viewCache:i})))}),[t,r,i])})({chart:t,models:r,viewState:a,viewCache:s}),(({picasso:e,chart:t,models:n,environment:r,viewState:o,viewCache:a,actions:s})=>{const[,l]=i((async()=>{if(null==t||!t.update||!n||!r)return;const{layoutService:i,colorService:l,discreteModel:u}=n;function c(i=!1){t.update({settings:zg({picasso:e,chart:t,models:n,environment:r,viewState:o,viewCache:a,actions:s}),data:i&&[_g({models:n}),...$g({models:n}),...l.getData()]})}const d=i.getDataPages();i.setDataPages([]),c(!0),i.setDataPages(d),i.meta.isContinuous||await u.command.initialize(),c(!1)}),[null==t?void 0:t.update,n,r]);if(l)throw l})({picasso:e,chart:t,models:r,environment:o,viewState:a,viewCache:s,actions:l})};function Vg(){return Vg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Vg.apply(this,arguments)}var Bg={exports:{}};function Ug(){}function Yg(){}Yg.resetWarningCache=Ug;Bg.exports=function(){function e(e,t,n,r,i,o){if("SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==o){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:Yg,resetWarningCache:Ug};return n.PropTypes=n,n}();var Wg=z(Bg.exports);function Gg(e){return"large"===e?"20px":"small"===e?"12px":"16px"}function Xg({d:e,size:t,style:n={},viewBox:r="0 0 16 16"}){const i={fontSize:Gg(t),display:"inline-block",fontStyle:"normal",lineHeight:"0",textAlign:"center",textTransform:"none",verticalAlign:"-.125em",textRendering:"optimizeLegibility",WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",...n};return q.createElement("i",{style:i},q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:r,fill:"currentColor"},q.createElement("path",{d:e})))}const Kg={d:"M15.9993744,3 L15.9993744,5 L4.99937445,5 L4.99937445,3 L15.9993744,3 Z M8.99937445,7 L15.9993744,7 L15.9993744,9 L8.99937445,9 L8.99937445,7 Z M11.9993744,11 L15.9993744,11 L15.9993744,13 L11.9993744,13 L11.9993744,11 Z M2.2,11 L7,11 L7,9.00369263 C7,8.89323568 7.08954305,8.80369263 7.2,8.80369263 C7.2549016,8.80369263 7.30738916,8.82626165 7.34515712,8.86610844 L10.1852182,11.8624926 C10.2583124,11.93961 10.258346,12.0604218 10.1852948,12.13758 L7.34523376,15.1373102 C7.2692928,15.2175206 7.14270711,15.2209817 7.06249671,15.1450407 C7.02260076,15.1072683 7,15.0547472 7,14.9998069 L7,12.9043747 C4.79351111,12.9043747 2.8018683,12.9266213 1.02507156,12.9711145 L1.02507252,12.9711526 C0.472939773,12.9849787 0.014139487,12.5485949 0.000313396522,11.9964622 C0.000104473692,11.988119 -1.32268838e-12,11.9797736 -1.3231638e-12,11.9714278 L-1.83320026e-12,3 L2,3 L2,10.8 C2,10.9104569 2.08954305,11 2.2,11 Z"},Jg={d:"M13,7 L8,7 L13,7 L13,4.98151367 C13,2.23029964 10.7614237,0 8,0 C5.23857625,0 3,2.23029964 3,4.98151367 L3,7 L3.75,7 L3,7 L4.5,7 L4.5,5.33193359 C4.5,3.21561511 5.54860291,1.5 8,1.5 C10.4513971,1.5 11.5,3.21561511 11.5,5.33193359 L11.5,7 L12.25,7 L3,7 C2.44771525,7 2,7.44771525 2,8 L2,15 C2,15.5522847 2.44771525,16 3,16 L13,16 C13.5522847,16 14,15.5522847 14,15 L14,8 C14,7.44771525 13.5522847,7 13,7 L3,7 L13,7 Z"},Zg={d:"M6,10 L13,3 L15,5 L8,12 L6,14 L1,9 L3,7 L6,10 Z"},Qg={d:"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"},ev={d:"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"};function tv(e,t,n){(function({model:e,properties:t}){return e.modifiers?e.modifiers.apply({model:e,properties:t}):Promise.resolve()})({model:e,properties:n}).then((()=>{e.colorSupport&&e.colorSupport.colorByUpdater(n,"qHyperCubeDef.");let r=Vo.generate(t,n);r&&r.length&&(r=r.map((e=>({qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path}))),e.applyPatches(r,!0))}))}function nv(e,t,n,r,i,o){e.getEffectiveProperties().then((a=>{const s=a.qHyperCubeDef[r].findIndex((e=>e.qDef.cId===t)),l=a.qHyperCubeDef.qLayoutExclude.qHyperCubeDef[r].findIndex((e=>e.qDef.cId===n)),u=G(!0,{},a),c=u.qHyperCubeDef[r][s],d=u.qHyperCubeDef.qLayoutExclude.qHyperCubeDef[r][l];d.qAttributeDimensions=c.qAttributeDimensions,c.qAttributeDimensions=[],o||(d.qAttributeExpressions=c.qAttributeExpressions,c.qAttributeExpressions=[]),u.qHyperCubeDef[r][s]=d,u.qHyperCubeDef.qLayoutExclude.qHyperCubeDef[r][l]=c,i&&i({oldItem:c,newItem:d,oldProperties:a,newProperties:u,model:e}),tv(e,a,u)}))}const rv=(e,t)=>{const n=[],r=[];return t.forEach((t=>{t.qCalcCondition.qCond.qv&&r.push(e.evaluate(t.qCalcCondition.qCond.qv).then((e=>{"0"===e&&n.push(t.qDef.cId)})))})),Promise.all(r).then((()=>n))};function iv({dir:e,dock:t,altList:n,model:r,translator:i,app:o,onChange:a}){return 0===n.length?null:{dir:e,dock:t,getAlternatives(){const e=rv(o,n).then((e=>Promise.all(n.filter((t=>!e.includes(t.qDef.cId))).map((e=>function(e,t,n){if(e.qLibraryId)return t.getDimension(e.qLibraryId).then((e=>e.getLayout())).catch((()=>null)).then((e=>e?"H"!==e.qDim.qGrouping&&e.qDim.qLabelExpression?e.qDim.qLabelExpression:e.qDim.title:n.get("Object.ErrorMessage.MissingDimension")));const r=e.qDef.qLabelExpression;if(r)return t.evaluate(r);const i=e.qDef.qFieldLabels[0]||e.qDef.qFieldDefs[0];return Promise.resolve(i)}(e,o,i).then((t=>({id:e.qDef.cId,selected:!1,title:t}))))))));return e},changeTo(e,t){nv(r,e,t,"qDimensions",a)}}}function ov(e,t,n,r="/qHyperCubeDef"){return{breadcrumbs:e.qGroupFallbackTitles.slice(0,e.qGroupPos),drilldown:"H"===e.qGrouping,index:t,locked:!!e.qLocked,text:"H"===e.qGrouping?e.qGroupFallbackTitles[e.qGroupPos]:e.qFallbackTitle,popoverText:(i=e,"H"===i.qGrouping?i.title||"":i.qFallbackTitle||""),drillUp(e){n.drillUp(r,t,e)},id:e.cId};var i}function av({altList:e,app:t,dir:n,dock:r,model:i,onChange:o,skipAttributeExpressions:a,translator:s}){return 0===e.length?null:{dir:n,dock:r,getAlternatives(){const n=rv(t,e).then((n=>Promise.all(e.filter((e=>!n.includes(e.qDef.cId))).map((e=>function(e,t,n){if(e.qLibraryId)return t.getMeasure(e.qLibraryId).then((e=>e.getLayout())).catch((()=>null)).then((e=>e?e.qMeasure.qLabelExpression?e.qMeasure.qLabelExpression:e.qMeasure.qLabel||e.qMeasure.qDef:n.get("Object.ErrorMessage.MissingMeasure")));const r=e.qDef.qLabelExpression;if(r)return t.evaluate(r);const i=e.qDef.qLabel||e.qDef.qDef;return Promise.resolve(i)}(e,t,s).then((t=>({id:e.qDef.cId,selected:!1,title:t}))))))));return n},changeTo(e,t){nv(i,e,t,"qMeasures",o,a)}}}function sv(e,t){return{breadcrumbs:[],drilldown:!1,index:t,locked:!1,text:e.qFallbackTitle,popoverText:e.qFallbackTitle,id:e.cId}}const lv={bottom:{anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"}},top:{anchorOrigin:{vertical:"top",horizontal:"center"},transformOrigin:{vertical:"bottom",horizontal:"center"}},left:{anchorOrigin:{vertical:"center",horizontal:"left"},transformOrigin:{vertical:"center",horizontal:"right"}},right:{anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"}}},uv={menuItem:"alternative-menu-item",titleButton:"title-button",activeTitleButton:"active-title-button"},cv=A(O)((()=>({textAlign:"start","&:focus":{boxShadow:"inset 0 0 0 2px #177FE6 !important"}}))),dv=A((({children:e,...t})=>q.createElement(D,Vg({size:"small",disableRipple:!0,disableTouchRipple:!0},t),e)))((()=>({"&:focus":{boxShadow:"inset 0 0 0 2px #177FE6 !important"}})));function mv(e){const t=e=>{if("Tab"===e.key){const t=document.querySelectorAll(`.${uv.menuItem}`);let n;e.shiftKey?null!=t&&t.length&&t[0]===e.target&&(n=t[t.length-1]):null!=t&&t.length&&t[t.length-1]===e.target&&([n]=t),n&&setTimeout((()=>{n.focus()}),50)}};function n({title:e,selected:n,onClick:r}){const i=ge.detectTextDirection(e);return q.createElement(cv,{role:"menuitem",button:!0,onClick:r,className:uv.menuItem,onKeyDown:t},q.createElement(T,{style:{minWidth:32}},q.createElement(Xg,{d:n?Zg.d:""})),q.createElement(N,{primaryTypographyProps:{dir:i}},e))}function r({alignTo:e,changeTo:t,current:r,dir:i,dock:o,list:a,onClose:s,show:l,instruction:u}){const c=a.map((e=>q.createElement(n,{key:e.id,title:e.title,onClick:()=>t(e.id)})));return q.createElement(I,Vg({anchorEl:e,open:l,onClose:s},lv[o],{PaperProps:{style:{minWidth:"250px",maxHeight:"300px"}}}),q.createElement(w,{dense:!0,dir:i,"aria-label":u,component:"nav"},q.createElement(n,{title:r,selected:!0,onClick:s}),c))}n.propTypes={title:Wg.string.isRequired,selected:Wg.bool,onClick:Wg.func.isRequired},n.defaultProps={selected:!1},r.propTypes={alignTo:Wg.any,changeTo:Wg.func.isRequired,current:Wg.string.isRequired,dir:Wg.string.isRequired,dock:Wg.string.isRequired,list:Wg.array,onClose:Wg.func.isRequired,show:Wg.bool.isRequired,instruction:Wg.string.isRequired},r.defaultProps={list:[],alignTo:null};class i extends q.Component{constructor(e){super(e),this.state={open:!1,inSelection:e.selections&&e.selections.isActive(),hasValidAlternatives:!1},this.openPopover=this.openPopover.bind(this),this.closePopover=this.closePopover.bind(this),this.changeTo=this.changeTo.bind(this),this.alignToRef=q.createRef()}componentDidMount(){const{popover:e,selections:t,supportConditional:n}=this.props;t&&(this.onSelectionsActivated=()=>this.setState({inSelection:!0}),this.onSelectionsDeactivated=()=>this.setState({inSelection:!1}),t.addListener("activated",this.onSelectionsActivated),t.addListener("deactivated",this.onSelectionsDeactivated),t.addListener("canceled",this.onSelectionsDeactivated)),e&&n&&e.getAlternatives().then((e=>{this.setState({hasValidAlternatives:0!==e.length})}))}componentDidUpdate(e,t){const{popover:n,supportConditional:r}=this.props;n&&r&&n.getAlternatives().then((e=>{t.hasValidAlternatives!==(0!==e.length)&&this.setState({hasValidAlternatives:0!==e.length})}))}componentWillUnmount(){const{selections:e}=this.props;e&&(e.removeListener("activated",this.onSelectionsActivated),e.removeListener("deactivated",this.onSelectionsDeactivated),e.removeListener("canceled",this.onSelectionsDeactivated))}changeTo(e){this.props.popover.changeTo(this.props.titleData.id,e),this.closePopover(e)}openPopover(e){if(!(this.state.closeTime&&Date.now()-this.state.closeTime<20)){if(e.target){const t=e.target.closest(`.${uv.titleButton}`);t&&t.classList.add(uv.activeTitleButton)}this.props.popover.getAlternatives().then((e=>{this.setState({open:!0,alternatives:e});document.querySelector(`.${uv.menuItem}`).focus()}))}}closePopover(e){if(this.setState({open:!1,closeTime:Date.now()}),"string"==typeof e)setTimeout((()=>{const t=document.querySelector(`.${uv.titleButton}[data-id="${e}"]`);t&&t.focus()}),1e3);else{const e=document.querySelector(`.${uv.activeTitleButton}`);e&&(e.classList.remove(uv.activeTitleButton),setTimeout((()=>{e.focus()}),50))}}render(){const{titleData:e,popover:t,translator:n,disabled:i,isDimension:o,padding:a,minWidth:s,hasAlternative:l,supportConditional:u}=this.props,c={flex:"1 1 auto",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontWeight:"normal",lineHeight:"normal",...this.props.style},d=e.breadcrumbs.length,m=i||this.state.inSelection,f=e.breadcrumbs.map(((t,n)=>q.createElement(dv,{style:{display:"flex",alignItems:"center",color:m&&"rgba(89, 89, 89, 0.8)",pointerEvents:m?"none":"auto",paddingTop:0,paddingBottom:0,height:"100%"},key:n,onClick:()=>m?void 0:e.drillUp(d-n),title:t},q.createElement("span",{style:c},t),q.createElement(Xg,Vg({},ev,{size:"small",style:{margin:"0 8px"}}))))),p=u?this.state.hasValidAlternatives:l,h=t&&!this.state.open?this.openPopover:this.closePopover,y=!t||i||this.state.inSelection,g={display:"flex",alignItems:"center",width:"100%",color:y&&"rgba(89, 89, 89, 0.8)",height:"100%",border:!o&&y&&"none",paddingTop:0,paddingBottom:0};this.state.open&&(g.background="rgba(0,0,0,0.08)");a&&(g.padding=a),s&&(g.minWidth=s);const v=ge.detectTextDirection(e.text),b=q.createElement(dv,{"aria-label":n.get("Accessibility.Alternative.Instructions",[e.text]),style:g,onClick:y?void 0:h,title:e.text,tabIndex:y?-1:0,onFocus:y?void 0:e=>{e.currentTarget.style.boxShadow="0px 0px 0px 2px #177FE6 inset",e.currentTarget.style.borderRadius="2px"},onBlur:y?void 0:e=>{e.currentTarget.style.boxShadow="none",e.currentTarget.style.borderRadius="0px"},onMouseDown:e=>{e.preventDefault()},className:`${uv.titleButton} ${e.id}`,"data-id":e.id},e.locked&&q.createElement(Xg,Vg({},Jg,{size:"small",title:n.get("Tooltip.selections.locked")})),q.createElement("span",{style:c,dir:v},e.text),t&&p&&q.createElement(Xg,Vg({},Qg,{size:"small",style:{margin:"0 8px"}})));return q.createElement(q.Fragment,null,e.drilldown&&q.createElement(Xg,Vg({},Kg,{size:"small",title:n.get("Tooltip.dimensions.drilldown"),style:{margin:"0 4px 0 0"}})),f,q.createElement("div",{ref:this.alignToRef,style:{overflow:"hidden",pointerEvents:p?"auto":"none",height:"100%"}},b),t&&p&&q.createElement(r,{dock:t.dock,dir:t.dir,current:e.popoverText,alignTo:this.alignToRef.current,show:this.state.open,list:this.state.alternatives,onClose:this.closePopover,changeTo:this.changeTo,instruction:n.get("Accessibility.Popover.Instructions")}))}}function o(e){return{top:"bottom",bottom:"top",left:"right",right:"left"}[e]}function a(e){return!e.isDimension&&oe.getValue(e,"hyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures.length")>0}return i.propTypes={disabled:Wg.bool.isRequired,padding:Wg.string,minWidth:Wg.string,titleData:Wg.shape({breadcrumbs:Wg.arrayOf(Wg.string).isRequired,drilldown:Wg.bool.isRequired,index:Wg.number.isRequired,locked:Wg.bool.isRequired,text:Wg.string.isRequired,popoverText:Wg.string.isRequired,drillUp:Wg.func,id:Wg.string.isRequired}).isRequired,popover:Wg.shape({dir:Wg.string.isRequired,dock:Wg.string.isRequired,changeTo:Wg.func.isRequired,getAlternatives:Wg.func.isRequired}),translator:Wg.shape({get:Wg.func.isRequired}).isRequired,selections:Wg.shape({isActive:Wg.func,addListener:Wg.func,removeListener:Wg.func}),style:Wg.shape({fontSize:Wg.string,color:Wg.string,fontFamily:Wg.string}).isRequired,isDimension:Wg.bool.isRequired,hasAlternative:Wg.bool.isRequired,supportConditional:Wg.bool.isRequired},i.defaultProps={popover:null,selections:null,padding:"",minWidth:""},{renderer:"react",disableTriggers:!0,preferredSize:function(){const{height:t}=e.measureText({text:"M",fontSize:this.style.fontSize,fontFamily:this.style.fontFamily});return this.settings.settings.isDimension||a(this.settings.settings)?Math.max(28,t):Math.max(20,t)},render(){const{settings:{app:e,disabled:t,explicitItemInfos:n,hyperCube:r,hyperCubeDef:s,isDimension:l,minWidth:u,model:c,onChangeToAlternative:d,padding:m,rtl:f,selections:p,skipAttributeExpressions:h,translator:y,supportConditional:g=!1},layout:{dock:v}}=this.settings,b="top"!==v&&"bottom"!==v||!f?"ltr":"rtl",x=function(e,t){const n={pointerEvents:"auto",display:"flex",justifyContent:"center",alignItems:"center",height:"100%"};return"left"===e?(n.width=`${t.height}px`,n.height=`${t.width}px`,n.transform=`rotate(-90deg) translate(-${t.height}px, 0)`,n.transformOrigin="top left"):"right"===e&&(n.width=`${t.height}px`,n.height=`${t.width}px`,n.transform=`rotate(90deg) translate(0, -${t.width}px)`,n.transformOrigin="top left"),n}(v,this.rect),S=s&&s.qLayoutExclude&&s.qLayoutExclude.qHyperCubeDef,M=S&&S[l?"qDimensions":"qMeasures"]||[],E=n||r[l?"qDimensionInfo":"qMeasureInfo"],C=l?iv:av,A=l?ov:sv,O=c&&c.colorSupport&&c.modifiers&&C({altList:M,app:e,dir:f?"rtl":"ltr",dock:o(v),model:c,onChange:d,skipAttributeExpressions:h,translator:y}),D=(I=this.settings.settings).isDimension&&oe.getValue(I,"hyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions.length")>0||a(this.settings.settings);var I;const w=E.map(((e,n)=>{const r="number"==typeof e.explicitColumn?e.explicitColumn:n,o=A(e,r,c),a=n===E.length-1;return q.createElement(q.Fragment,{key:e.cId},q.createElement(i,{popover:O,titleData:o,model:c,translator:y,selections:p,disabled:t(),style:this.style,isDimension:l,padding:m,minWidth:u,hasAlternative:D,supportConditional:g}),!a&&q.createElement("span",{style:{lineHeight:"normal",...this.style}},", "))}));return q.createElement("div",{style:x,dir:b},w)}}}function fv(){return fv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},fv.apply(this,arguments)}function pv(e){return pv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},pv(e)}function hv(e){return e&&"object"===pv(e)&&e.constructor===Object}function yv(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{clone:!0},r=n.clone?fv({},e):e;return hv(e)&&hv(t)&&Object.keys(t).forEach((function(i){"__proto__"!==i&&(hv(t[i])&&i in e?r[i]=yv(e[i],t[i],n):r[i]=t[i])})),r}function gv(e){var t=function(e,t){if("object"!==pv(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==pv(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===pv(t)?t:String(t)}function vv(e,t,n){return(t=gv(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bv(e){for(var t="https://mui.com/production-error/?code="+e,n=1;n<arguments.length;n+=1)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified Material-UI error #"+e+"; visit "+t+" for the full message."}function xv(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return Math.min(Math.max(t,e),n)}function Sv(e){if(e.type)return e;if("#"===e.charAt(0))return Sv(function(e){e=e.substr(1);var t=new RegExp(".{1,".concat(e.length>=6?2:1,"}"),"g"),n=e.match(t);return n&&1===n[0].length&&(n=n.map((function(e){return e+e}))),n?"rgb".concat(4===n.length?"a":"","(").concat(n.map((function(e,t){return t<3?parseInt(e,16):Math.round(parseInt(e,16)/255*1e3)/1e3})).join(", "),")"):""}(e));var t=e.indexOf("("),n=e.substring(0,t);if(-1===["rgb","rgba","hsl","hsla"].indexOf(n))throw new Error(bv(3,e));var r=e.substring(t+1,e.length-1).split(",");return{type:n,values:r=r.map((function(e){return parseFloat(e)}))}}function Mv(e){var t=e.type,n=e.values;return-1!==t.indexOf("rgb")?n=n.map((function(e,t){return t<3?parseInt(e,10):e})):-1!==t.indexOf("hsl")&&(n[1]="".concat(n[1],"%"),n[2]="".concat(n[2],"%")),"".concat(t,"(").concat(n.join(", "),")")}function Ev(e){var t="hsl"===(e=Sv(e)).type?Sv(function(e){var t=(e=Sv(e)).values,n=t[0],r=t[1]/100,i=t[2]/100,o=r*Math.min(i,1-i),a=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(e+n/30)%12;return i-o*Math.max(Math.min(t-3,9-t,1),-1)},s="rgb",l=[Math.round(255*a(0)),Math.round(255*a(8)),Math.round(255*a(4))];return"hsla"===e.type&&(s+="a",l.push(t[3])),Mv({type:s,values:l})}(e)).values:e.values;return t=t.map((function(e){return(e/=255)<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)})),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function Cv(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var qv=["xs","sm","md","lg","xl"];function Av(e,t,n){var r;return fv({gutters:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return console.warn(["Material-UI: theme.mixins.gutters() is deprecated.","You can use the source of the mixin directly:","\n paddingLeft: theme.spacing(2),\n paddingRight: theme.spacing(2),\n [theme.breakpoints.up('sm')]: {\n paddingLeft: theme.spacing(3),\n paddingRight: theme.spacing(3),\n },\n "].join("\n")),fv({paddingLeft:t(2),paddingRight:t(2)},n,vv({},e.up("sm"),fv({paddingLeft:t(3),paddingRight:t(3)},n[e.up("sm")])))},toolbar:(r={minHeight:56},vv(r,"".concat(e.up("xs")," and (orientation: landscape)"),{minHeight:48}),vv(r,e.up("sm"),{minHeight:64}),r)},n)}var Ov={black:"#000",white:"#fff"},Dv={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#d5d5d5",A200:"#aaaaaa",A400:"#303030",A700:"#616161"},Iv={50:"#e8eaf6",100:"#c5cae9",200:"#9fa8da",300:"#7986cb",400:"#5c6bc0",500:"#3f51b5",600:"#3949ab",700:"#303f9f",800:"#283593",900:"#1a237e",A100:"#8c9eff",A200:"#536dfe",A400:"#3d5afe",A700:"#304ffe"},wv={50:"#fce4ec",100:"#f8bbd0",200:"#f48fb1",300:"#f06292",400:"#ec407a",500:"#e91e63",600:"#d81b60",700:"#c2185b",800:"#ad1457",900:"#880e4f",A100:"#ff80ab",A200:"#ff4081",A400:"#f50057",A700:"#c51162"},Tv={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},Nv={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},Lv={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},kv={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"},Rv={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.54)",disabled:"rgba(0, 0, 0, 0.38)",hint:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:Ov.white,default:Dv[50]},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},Pv={text:{primary:Ov.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",hint:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:Dv[800],default:"#303030"},action:{active:Ov.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function Fv(e,t,n,r){var i=r.light||r,o=r.dark||1.5*r;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:"light"===t?e.light=function(e,t){if(e=Sv(e),t=xv(t),-1!==e.type.indexOf("hsl"))e.values[2]+=(100-e.values[2])*t;else if(-1!==e.type.indexOf("rgb"))for(var n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;return Mv(e)}(e.main,i):"dark"===t&&(e.dark=function(e,t){if(e=Sv(e),t=xv(t),-1!==e.type.indexOf("hsl"))e.values[2]*=1-t;else if(-1!==e.type.indexOf("rgb"))for(var n=0;n<3;n+=1)e.values[n]*=1-t;return Mv(e)}(e.main,o)))}function zv(e){var t=e.primary,n=void 0===t?{light:Iv[300],main:Iv[500],dark:Iv[700]}:t,r=e.secondary,i=void 0===r?{light:wv.A200,main:wv.A400,dark:wv.A700}:r,o=e.error,a=void 0===o?{light:Tv[300],main:Tv[500],dark:Tv[700]}:o,s=e.warning,l=void 0===s?{light:Nv[300],main:Nv[500],dark:Nv[700]}:s,u=e.info,c=void 0===u?{light:Lv[300],main:Lv[500],dark:Lv[700]}:u,d=e.success,m=void 0===d?{light:kv[300],main:kv[500],dark:kv[700]}:d,f=e.type,p=void 0===f?"light":f,h=e.contrastThreshold,y=void 0===h?3:h,g=e.tonalOffset,v=void 0===g?.2:g,b=Cv(e,["primary","secondary","error","warning","info","success","type","contrastThreshold","tonalOffset"]);function x(e){var t=function(e,t){var n=Ev(e),r=Ev(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}(e,Pv.text.primary)>=y?Pv.text.primary:Rv.text.primary;return t}var S=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:300,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:700;if(!(e=fv({},e)).main&&e[t]&&(e.main=e[t]),!e.main)throw new Error(bv(4,t));if("string"!=typeof e.main)throw new Error(bv(5,JSON.stringify(e.main)));return Fv(e,"light",n,v),Fv(e,"dark",r,v),e.contrastText||(e.contrastText=x(e.main)),e},M={dark:Pv,light:Rv};return yv(fv({common:Ov,type:p,primary:S(n),secondary:S(i,"A400","A200","A700"),error:S(a),warning:S(l),info:S(c),success:S(m),grey:Dv,contrastThreshold:y,getContrastText:x,augmentColor:S,tonalOffset:v},M[p]),b)}function _v(e){return Math.round(1e5*e)/1e5}function $v(e){return _v(e)}var Hv={textTransform:"uppercase"},jv='"Roboto", "Helvetica", "Arial", sans-serif';function Vv(e,t){var n="function"==typeof t?t(e):t,r=n.fontFamily,i=void 0===r?jv:r,o=n.fontSize,a=void 0===o?14:o,s=n.fontWeightLight,l=void 0===s?300:s,u=n.fontWeightRegular,c=void 0===u?400:u,d=n.fontWeightMedium,m=void 0===d?500:d,f=n.fontWeightBold,p=void 0===f?700:f,h=n.htmlFontSize,y=void 0===h?16:h,g=n.allVariants,v=n.pxToRem,b=Cv(n,["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"]),x=a/14,S=v||function(e){return"".concat(e/y*x,"rem")},M=function(e,t,n,r,o){return fv({fontFamily:i,fontWeight:e,fontSize:S(t),lineHeight:n},i===jv?{letterSpacing:"".concat(_v(r/t),"em")}:{},o,g)},E={h1:M(l,96,1.167,-1.5),h2:M(l,60,1.2,-.5),h3:M(c,48,1.167,0),h4:M(c,34,1.235,.25),h5:M(c,24,1.334,0),h6:M(m,20,1.6,.15),subtitle1:M(c,16,1.75,.15),subtitle2:M(m,14,1.57,.1),body1:M(c,16,1.5,.15),body2:M(c,14,1.43,.15),button:M(m,14,1.75,.4,Hv),caption:M(c,12,1.66,.4),overline:M(c,12,2.66,1,Hv)};return yv(fv({htmlFontSize:y,pxToRem:S,round:$v,fontFamily:i,fontSize:a,fontWeightLight:l,fontWeightRegular:c,fontWeightMedium:m,fontWeightBold:p},E),b,{clone:!1})}function Bv(){return["".concat(arguments.length<=0?void 0:arguments[0],"px ").concat(arguments.length<=1?void 0:arguments[1],"px ").concat(arguments.length<=2?void 0:arguments[2],"px ").concat(arguments.length<=3?void 0:arguments[3],"px rgba(0,0,0,").concat(.2,")"),"".concat(arguments.length<=4?void 0:arguments[4],"px ").concat(arguments.length<=5?void 0:arguments[5],"px ").concat(arguments.length<=6?void 0:arguments[6],"px ").concat(arguments.length<=7?void 0:arguments[7],"px rgba(0,0,0,").concat(.14,")"),"".concat(arguments.length<=8?void 0:arguments[8],"px ").concat(arguments.length<=9?void 0:arguments[9],"px ").concat(arguments.length<=10?void 0:arguments[10],"px ").concat(arguments.length<=11?void 0:arguments[11],"px rgba(0,0,0,").concat(.12,")")].join(",")}var Uv=["none",Bv(0,2,1,-1,0,1,1,0,0,1,3,0),Bv(0,3,1,-2,0,2,2,0,0,1,5,0),Bv(0,3,3,-2,0,3,4,0,0,1,8,0),Bv(0,2,4,-1,0,4,5,0,0,1,10,0),Bv(0,3,5,-1,0,5,8,0,0,1,14,0),Bv(0,3,5,-1,0,6,10,0,0,1,18,0),Bv(0,4,5,-2,0,7,10,1,0,2,16,1),Bv(0,5,5,-3,0,8,10,1,0,3,14,2),Bv(0,5,6,-3,0,9,12,1,0,3,16,2),Bv(0,6,6,-3,0,10,14,1,0,4,18,3),Bv(0,6,7,-4,0,11,15,1,0,4,20,3),Bv(0,7,8,-4,0,12,17,2,0,5,22,4),Bv(0,7,8,-4,0,13,19,2,0,5,24,4),Bv(0,7,9,-4,0,14,21,2,0,5,26,4),Bv(0,8,9,-5,0,15,22,2,0,6,28,5),Bv(0,8,10,-5,0,16,24,2,0,6,30,5),Bv(0,8,11,-5,0,17,26,2,0,6,32,5),Bv(0,9,11,-5,0,18,28,2,0,7,34,6),Bv(0,9,12,-6,0,19,29,2,0,7,36,6),Bv(0,10,13,-6,0,20,31,3,0,8,38,7),Bv(0,10,13,-6,0,21,33,3,0,8,40,7),Bv(0,10,14,-6,0,22,35,3,0,8,42,7),Bv(0,11,14,-7,0,23,36,3,0,9,44,8),Bv(0,11,15,-7,0,24,38,3,0,9,46,8)],Yv={borderRadius:4};function Wv(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8;if(e.mui)return e;var t=function(e){var t=e.spacing||8;return"number"==typeof t?function(e){return t*e}:Array.isArray(t)?function(e){return t[e]}:"function"==typeof t?t:function(){}}({spacing:e}),n=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return 0===n.length?t(1):1===n.length?t(n[0]):n.map((function(e){if("string"==typeof e)return e;var n=t(e);return"number"==typeof n?"".concat(n,"px"):n})).join(" ")};return Object.defineProperty(n,"unit",{get:function(){return e}}),n.mui=!0,n}var Gv={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},Xv={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function Kv(e){return"".concat(Math.round(e),"ms")}var Jv={easing:Gv,duration:Xv,create:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["all"],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.duration,r=void 0===n?Xv.standard:n,i=t.easing,o=void 0===i?Gv.easeInOut:i,a=t.delay,s=void 0===a?0:a;return Cv(t,["duration","easing","delay"]),(Array.isArray(e)?e:[e]).map((function(e){return"".concat(e," ").concat("string"==typeof r?r:Kv(r)," ").concat(o," ").concat("string"==typeof s?s:Kv(s))})).join(",")},getAutoHeightDuration:function(e){if(!e)return 0;var t=e/36;return Math.round(10*(4+15*Math.pow(t,.25)+t/5))}},Zv={mobileStepper:1e3,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};function Qv(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.breakpoints,n=void 0===t?{}:t,r=e.mixins,i=void 0===r?{}:r,o=e.palette,a=void 0===o?{}:o,s=e.spacing,l=e.typography,u=void 0===l?{}:l,c=Cv(e,["breakpoints","mixins","palette","spacing","typography"]),d=zv(a),m=function(e){var t=e.values,n=void 0===t?{xs:0,sm:600,md:960,lg:1280,xl:1920}:t,r=e.unit,i=void 0===r?"px":r,o=e.step,a=void 0===o?5:o,s=Cv(e,["values","unit","step"]);function l(e){var t="number"==typeof n[e]?n[e]:e;return"@media (min-width:".concat(t).concat(i,")")}function u(e,t){var r=qv.indexOf(t);return r===qv.length-1?l(e):"@media (min-width:".concat("number"==typeof n[e]?n[e]:e).concat(i,") and ")+"(max-width:".concat((-1!==r&&"number"==typeof n[qv[r+1]]?n[qv[r+1]]:t)-a/100).concat(i,")")}return fv({keys:qv,values:n,up:l,down:function(e){var t=qv.indexOf(e)+1,r=n[qv[t]];return t===qv.length?l("xs"):"@media (max-width:".concat(("number"==typeof r&&t>0?r:e)-a/100).concat(i,")")},between:u,only:function(e){return u(e,e)},width:function(e){return n[e]}},s)}(n),f=Wv(s),p=yv({breakpoints:m,direction:"ltr",mixins:Av(m,f,i),overrides:{},palette:d,props:{},shadows:Uv,typography:Vv(d,u),spacing:f,shape:Yv,transitions:Jv,zIndex:Zv},c),h=arguments.length,y=new Array(h>1?h-1:0),g=1;g<h;g++)y[g-1]=arguments[g];return p=y.reduce((function(e,t){return yv(e,t)}),p)}const eb=function(){return Qv.apply(void 0,arguments)}({palette:{text:{primary:"rgba(89, 89, 89, 0.8)",secondary:"rgba(0, 0, 0, 0.55)",disabled:"rgba(0, 0, 0, 0.3)"},action:{disabled:"rgba(0, 0, 0, 0.3)"}},typography:{fontFamily:'"Source Sans Pro", "Arial", "sans-serif"',button:{textTransform:"initial",fontWeight:400}},shape:{borderRadius:2},shadows:["none","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)"],props:{MuiButtonBase:{disableRipple:!0}}});const tb=k({productionPrefix:"q7183",disableGlobal:!0,seed:""});function nb(){function e({x:e,y:t,width:n,height:r,scaleRatio:i,margin:o}={}){const a={x:0,y:0,width:0,height:0,scaleRatio:{x:1,y:1},margin:{left:0,top:0}};return a.x=Number.isNaN(e)?a.x:e,a.y=Number.isNaN(t)?a.y:t,a.width=Number.isNaN(n)?a.width:n,a.height=Number.isNaN(r)?a.height:r,void 0!==i&&(a.scaleRatio.x=Number.isNaN(i.x)?a.scaleRatio.x:i.x,a.scaleRatio.y=Number.isNaN(i.y)?a.scaleRatio.y:i.y),void 0!==o&&(a.margin.left=Number.isNaN(o.left)?0:o.left,a.margin.top=Number.isNaN(o.top)?0:o.top),a}return function(t={}){const{createElement:n=document.createElement.bind(document)}=t;let r,i=e();const o={element:()=>r,root:()=>r,appendTo:e=>(r||(r=n("div"),r.style.position="absolute",r.style["-webkit-font-smoothing"]="antialiased",r.style["-moz-osx-font-smoothing"]="antialiased",r.style.pointerEvents="none"),e.appendChild(r),r),render(e){if(!r)return!1;const t=i.scaleRatio.x,n=i.scaleRatio.y;return r.style.left=`${Math.round(i.margin.left+i.x*t)}px`,r.style.top=`${Math.round(i.margin.top+i.y*n)}px`,r.style.width=`${Math.round(i.width)}px`,r.style.height=`${Math.round(i.height)}px`,r.style.transform=`scale(${t}, ${n})`,r.style.transformOrigin="top left",L.render(function(e,t){return q.createElement(R,{generateClassName:t},q.createElement(P,{theme:eb},e))}(e,tb),r),!0},itemsAt:()=>[],findShapes:()=>[],clear:()=>(r&&L.unmountComponentAtNode(r),o),destroy(){r&&r.parentElement&&(L.unmountComponentAtNode(r),r.parentElement.removeChild(r)),r=null},size:t=>(t&&(i=e(t)),i)};return o}}function rb(){return function(e){e.renderer("react",nb()),e.component("data-title",mv(e.renderer("svg")())),e.component("disclaimer",function(){class e extends q.Component{render(){const{label:e,spanStyle:t}=this.props;return q.createElement(q.Fragment,null,q.createElement("span",{ref:this.alignToRef,style:t,title:e},e))}}return e.propTypes={label:Wg.string.isRequired,spanStyle:Wg.shape().isRequired},{renderer:"react",disableTriggers:!0,preferredSize:function(){return 22},render(){const{settings:{label:t,rtl:n},layout:{dock:r},style:i={}}=this.settings,o="top"!==r&&"bottom"!==r||!n?"ltr":"rtl",a=function(e,t,n){const r={pointerEvents:"auto",display:"flex",justifyContent:"center",alignItems:"center",color:"#7b7a78",fontStyle:"italic",fontSize:"13px",fontFamily:e.fontFamily||'"Source Sans Pro", "Arial", "sans-serif"'};switch(t){case"left":r.width=`${n.height}px`,r.transform=`rotate(-90deg) translate(-${n.height}px, 0)`,r.transformOrigin="top left";break;case"right":r.width=`${n.height}px`,r.transform=`rotate(90deg) translate(0, -${n.width}px)`,r.transformOrigin="top left";break;case"center":r.width=`${n.width}px`,r.height=`${n.height}px`,r.color="#595959",r.fontStyle="normal",r.fontSize="1.2em",r.textAlign="center";break;default:r.justifyContent="flex-start",r.alignItems="flex-start"}return r}(i,r,this.rect),s="center"===r?t:`* ${t}`,l="center"!==r?{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}:{};return q.createElement("div",{style:a,dir:o},q.createElement(q.Fragment,null,q.createElement(e,{label:s,spanStyle:l})))}}}())}}function ib(e,t,n,r){const i=function(t){const n=String(t);return e(n)};return i.ticks=()=>t.map((t=>{const o=i([t.data.value,r?n-1:0]),a=i([t.data.value,r?0:n-1])+e.bandwidth();return{position:(o+a)/2,label:t.label,data:t.data,start:o,end:a}})),i.bandwidth=()=>e.bandwidth(),i.data=()=>e.data(),i.domain=()=>e.domain(),i.pxScale=function(r){const i=e.pxScale(r);return i===e?this:ib(i,t,n)},i}function ob(e){const t=e.scale("band");e.scale("group-by-measure",(function(e={},n={},r={}){const i=t(e,n,r),o=i.domain(),a=i.ticks(),s=[],l=e.measureCount;return o.forEach(((e,t)=>{for(let t=0;t<l;++t)s.push(String([e,t]));s.push(`SPACER_${t}_SPACER`)})),s.splice(-1),i.domain(s),ib(i,a,l,e.invert)}))}const ab={getDefaultSettings:({size:e=10,fill:t="#999",alignment:n}={})=>({show:!0,type:"n-polygon",fill:t,stroke:"#000",strokeWidth:0,size:e,sides:3,startAngle:-90,alignment:n}),createOob({oob:e,dockValue:t,boxCenter:n,rendWidth:r,rendHeight:i,flipXY:o,symbol:a}){let s="x",l="y",u=r,c=i,d=t<.5?90:-90;return o&&(s="y",l="x",u=i,c=r,d=t<.5?180:0),a(G({},e,{[s]:n*u,[l]:c-Math.max(e.size/2,Math.min(t*c,c-e.size/2)),startAngle:d}))}};function sb({i:e,width:t,height:n,resolved:r,keys:i,flipXY:o,calcKey:a="box"}){let s,l=null,u=null;void 0!==r.major.settings.binStart?(l=r.major.items[e].binStart,u=r.major.items[e].binEnd,s=r.major.settings.binStart.scale):(s=r.major.settings.major.scale,l=s?r.major.items[e].major:0);let c=0;s?s.bandwidth?(c=s.bandwidth(),l-=c/2):c=u-l:c=1;const d=G({},{major:l,majorEnd:u},r.minor.items[e]);i.forEach((t=>{d[t]=r[t].items[e]}));const m=o?n:t,f=function({bandwidth:e,width:t,minWidthPx:n,maxWidthPx:r,maxMajorWidth:i}){const o=e>=0?1:-1;let a=Math.min(o*e*t,Number.isNaN(Number(r))?i:r/i);return a=Number.isNaN(Number(n))?a:Math.max(n/i,a),a*o}({bandwidth:c,width:d[a].width,minWidthPx:d[a].minWidthPx,maxWidthPx:d[a].maxWidthPx,maxMajorWidth:m}),p=(c-f)/2,h=p+d.major+f/2;return{item:d,boxCenter:h,boxWidth:f,boxPadding:p,rendWidth:t,rendHeight:n}}function lb({keys:e,data:t,defaultSettings:n,style:r,settings:i,width:o,height:a,resolver:s}){const l=G(!0,{},n||{},r||{}),u={major:"horizontal"===i.orientation?a:o,minor:"horizontal"===i.orientation?o:a},c=i.major;let d;d="object"==typeof c&&"object"==typeof c.ref&&void 0!==c.ref.start&&void 0!==c.ref.end?s.resolve({data:t,defaults:{start:0,end:1},scaled:u,settings:G(!0,{},{binStart:{scale:i.major.scale,ref:i.major.ref.start},binEnd:{scale:i.major.scale,ref:i.major.ref.end}})}):"object"==typeof c&&void 0!==c.binStart&&void 0!==c.binEnd?s.resolve({data:t,defaults:{start:0,end:1},scaled:u,settings:G(!0,{},{binStart:{scale:i.major.scale,ref:"binStart"},binEnd:{scale:i.major.scale,ref:"binEnd"}},i.major)}):s.resolve({data:t,scaled:u,defaults:{major:.5},settings:{major:i.major}});const m=i.minor||{};let f;const p={major:d,minor:s.resolve({data:t,defaults:{start:0,end:1},scaled:u,settings:G(!0,{},{start:{scale:m.scale,ref:"start"},end:{scale:m.scale,ref:"end"},min:{scale:m.scale,ref:"min"},max:{scale:m.scale,ref:"max"},med:{scale:m.scale,ref:"med"}},m)})};for(let n=0,r=e.length;n<r;n++)f=e[n],p[f]=s.resolve({data:t,defaults:l[f],settings:i[f],scaled:u});return p}const ub=["oob"];const cb={require:["chart","resolver","symbol"],defaultSettings:{settings:{size:10},data:{},style:{}},created(){this.state={}},preferredSize(){return this.settings.settings.size},render(){const{width:e,height:t}=this.rect,{dockValue:n}=this.settings.settings,r="horizontal"===this.settings.settings.orientation,{data:i,style:o,resolver:a,symbol:s}=this,l=lb({keys:ub,data:i,defaultSettings:{oob:ab.getDefaultSettings()},style:o,settings:this.settings.settings,width:e,height:t,resolver:a}),{settings:u,items:c}=l,d=function({width:e,height:t,flipXY:n,resolved:r,keys:i,symbol:o,dockValue:a,_calcItemRenderingOpts:s=sb}){const l=[],{items:u}=r.major;for(let c=0,d=u.length;c<d;c++){const{item:d,boxCenter:m,rendWidth:f,rendHeight:p}=s({i:c,width:e,height:t,resolved:r,keys:i,flipXY:n,calcKey:"oob"}),h=u[c].data,y=[];if(d.oob.show){y.push(ab.createOob({oob:d.oob,dockValue:a,boxCenter:m,rendWidth:f,rendHeight:p,flipXY:n,symbol:o}));const e={type:"container",data:h,collider:{type:"bounds"},children:y};l.push(e)}}return l}({items:c,settings:u,width:e,height:t,flipXY:r,resolved:l,keys:ub,symbol:s,dockValue:n});return d}},db={size:25,hat:{show:!0,fill:"#999",stroke:"#000",strokeWidth:0,strokeLinejoin:"miter",width:1,maxWidthPx:void 0,minWidthPx:1,minHeightPx:1,alignment:0}},mb=["hat"];function fb(e,t=!0){let n="";for(let t=0;t<e.length;t++){const r=e[t];n+=0===t?`M${r.x} ${r.y}`:`L${r.x} ${r.y}`,n+=" "}return t&&(n+="Z"),n}function pb({item:e,boxWidth:t,boxPadding:n,rendWidth:r,rendHeight:i,flipXY:o}){let a="x",s="y",l=r,u=i,c=e.hat.alignment||0;o&&(a="y",s="x",l=i,u=r,c=1-c);const d=(n+e.major)*l;let m=[{[a]:d,[s]:0+u},{[a]:d+t*c*l,[s]:8},{[a]:d+t*l,[s]:0+u},{[a]:d+t*l,[s]:0+u+10},{[a]:d,[s]:0+u+10}];const f=G({},e.hat,{type:"path",d:fb(m)});m=[{[a]:d,[s]:0},{[a]:d+t*(1-c)*l,[s]:0+u-8},{[a]:d+t*l,[s]:0},{[a]:d+t*l,[s]:-10},{[a]:d,[s]:-10}];return[f,G({},e.hat,{type:"path",d:fb(m)})]}const hb={require:["chart","resolver","symbol"],defaultSettings:{settings:{size:25},data:{},style:{hat:"$shape"}},created(){this.state={}},preferredSize(){return this.settings.settings.size},render(){const{width:e,height:t}=this.rect,n="horizontal"===this.settings.settings.orientation,{data:r,style:i,resolver:o}=this,a=lb({keys:mb,data:r,defaultSettings:db,style:i,settings:this.settings.settings,width:e,height:t,resolver:o}),{settings:s,items:l}=a,u=function({width:e,height:t,flipXY:n,resolved:r,keys:i,_calcItemRenderingOpts:o=sb}){const a=[],{items:s}=r.major;for(let l=0,u=s.length;l<u;l++){const{item:u,boxWidth:c,boxPadding:d,rendWidth:m,rendHeight:f}=o({i:l,width:e,height:t,resolved:r,keys:i,flipXY:n,calcKey:"hat"}),p=s[l].data,h=[];u.hat.show&&h.push(...pb({item:u,boxWidth:c,boxPadding:d,rendWidth:m,rendHeight:f,flipXY:n}));const y={type:"container",data:p,collider:{type:"bounds"},children:h};a.push(y)}return a}({items:l,settings:s,width:e,height:t,flipXY:n,resolved:a,keys:mb});return u}};var yb={UNCLASSIFIED:"unclassified",EQUAL_EQUAL:"equal-equal",EQUAL_HIGHER:"equal-higher",EQUAL_LOWER:"equal-lower",EQUAL_VOID:"equal-void",HIGHER_EQUAL:"higher-equal",HIGHER_HIGHER_ACUTE:"higher-higher-acute",HIGHER_HIGHER_OBTUSE:"higher-higher-obtuse",HIGHER_LOWER_NEGATIVE:"higher-lower-negative",HIGHER_LOWER_POSITIVE:"higher-lower-positive",HIGHER_VOID:"higher-void",LOWER_EQUAL:"lower-equal",LOWER_HIGHER_NEGATIVE:"lower-higher-negative",LOWER_HIGHER_POSITIVE:"lower-higher-positive",LOWER_LOWER_ACUTE:"lower-lower-acute",LOWER_LOWER_OBTUSE:"lower-lower-obtuse",LOWER_VOID:"lower-void",VOID_EQUAL:"void-equal",VOID_HIGHER:"void-higher",VOID_LOWER:"void-lower",VOID_VOID:"void-void"};function gb(e,t){return Math.atan2(t.y-e.y,t.x-e.x)*(180/Math.PI)}function vb(e,t,n){const r=Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2),i=Math.sqrt((t.x-n.x)**2+(t.y-n.y)**2),o=Math.sqrt((n.x-e.x)**2+(n.y-e.y)**2);return Math.acos((i*i+r*r-o*o)/(2*i*r))*(180/Math.PI)}function bb({previous:e,current:t,next:n}){const r=e&&e.value,i=t&&t.value,o=n&&n.value;return e||n?e?n?r===i?i===o?yb.EQUAL_EQUAL:i<o?yb.EQUAL_HIGHER:yb.EQUAL_LOWER:i===o?r>i?yb.HIGHER_EQUAL:yb.LOWER_EQUAL:r>i?i<o?vb(e,t,n)>90?yb.HIGHER_HIGHER_OBTUSE:yb.HIGHER_HIGHER_ACUTE:gb(e,t)>gb(e,n)?yb.HIGHER_LOWER_POSITIVE:yb.HIGHER_LOWER_NEGATIVE:i>o?vb(e,t,n)>90?yb.LOWER_LOWER_OBTUSE:yb.LOWER_LOWER_ACUTE:gb(e,t)>gb(e,n)?yb.LOWER_HIGHER_POSITIVE:yb.LOWER_HIGHER_NEGATIVE:r===i?yb.EQUAL_VOID:r>i?yb.HIGHER_VOID:yb.LOWER_VOID:i===o?yb.VOID_EQUAL:i<o?yb.VOID_HIGHER:yb.VOID_LOWER:yb.VOID_VOID}function xb({bounds:e,size:t}){const{x:n,y:r,width:i,height:o}=e,{insideStrategy:a}=t;return"center"===a?Math.floor(n+i/2)>=0&&Math.ceil(n+i/2)<=t.width&&Math.floor(r+o/2)>=0&&Math.ceil(r+o/2)<=t.height:Math.floor(n+i)>0&&Math.ceil(n)<t.width&&Math.floor(r+o/2)>=0&&Math.ceil(r+o/2)<=t.height}const Sb={X:1,Y:0};function Mb({node:e,line:t,groupIndex:n,extract:r,style:i,measureText:o,size:a,horizontal:s,rtl:l,meta:u,showLabel:c}){const d=r.label(e.data);if("string"!=typeof d&&"number"!=typeof d||""===d)return!1;const m=o({fontFamily:i.fontFamily,fontSize:i.fontSize,text:d}),{localBounds:f}=e,{"stroke-width":p}=e.attrs,h=r.pointValue(e.data),y={x:f.x+f.width/2,y:f.y+f.height/2,width:m.width+2*Sb.X,height:m.height+2*Sb.Y},g=`${y.x}-${y.y}`,v=!s&&!l,b=s?a.height:a.width,x=(s?y.y:y.x)/b,S=(v?1-x:x)<=(b<=200?.25:.1),M={key:g,node:e,line:t,group:n,value:h,labelMeasurements:m,bounds:y,inside:xb({bounds:f,size:a}),border:p?p/2:0,classification:yb.UNCLASSIFIED,setClassification(e){M.classification=e},preferences:[],setPreferences(e){M.preferences.push(...e)},placement:void 0,setPlacement(e){M.placement=e},duplicate:!1,setDuplicate(){M.duplicate=!0},extreme:u.getExtreme(g),elite:S,show:c(e)};return M}function Eb({nodes:e,extract:t,style:n,measureText:r,size:i,horizontal:o,rtl:a,showLabel:s}){const l=function({nodes:e}){const t={top:[],right:[],bottom:[],left:[]},n=e.map((e=>{const{localBounds:t}=e,n={x:t.x+t.width/2,y:t.y+t.height/2};return{key:`${n.x}-${n.y}`,center:n}})),r=n.reduce(((e,t)=>((!e.top||t.center.y<e.top.center.y)&&(e.top=t),(!e.right||t.center.x>e.right.center.x)&&(e.right=t),(!e.bottom||t.center.y>e.bottom.center.y)&&(e.bottom=t),(!e.left||t.center.x<e.left.center.x)&&(e.left=t),e)),{});return t.top=n.filter((e=>e.center.y===r.top.center.y)).map((e=>e.key)),t.right=n.filter((e=>e.center.x===r.right.center.x)).map((e=>e.key)),t.bottom=n.filter((e=>e.center.y===r.bottom.center.y)).map((e=>e.key)),t.left=n.filter((e=>e.center.x===r.left.center.x)).map((e=>e.key)),{getExtrema:e=>({top:-1!==t.top.indexOf(e),right:-1!==t.right.indexOf(e),bottom:-1!==t.bottom.indexOf(e),left:-1!==t.left.indexOf(e)}),getExtreme:e=>{const{top:n,right:r,bottom:i,left:o}=t;return[n,r,i,o].some((t=>-1!==t.indexOf(e)))}}}({nodes:e}),u=function({nodes:e,by:t,lineIndex:n}){const r=e.reduce(((e,r,i)=>{const o=t(r.data);return e[o]||(e[o]={items:[],index:i}),e[o].items.push({node:r,line:r.data[n].value}),e}),{});return Object.keys(r).map((e=>r[e])).sort(((e,t)=>e.index-t.index)).map((e=>e.items))}({nodes:e,by:t.majorValue,lineIndex:t.lineIndex}).map(((e,u)=>e.map((e=>({line:e.line,item:Mb({node:e.node,line:e.line,groupIndex:u,extract:t,style:n,measureText:r,size:i,horizontal:o,rtl:a,meta:l,showLabel:s})}))).filter((e=>e.item)).reduce(((e,t)=>(e[t.line]=t.item,e)),{})));return u.filter((e=>Object.keys(e).length))}var Cb={TOP:"top",TOP_RIGHT:"top-right",RIGHT:"right",BOTTOM_RIGHT:"bottom-right",BOTTOM:"bottom",BOTTOM_LEFT:"bottom-left",LEFT:"left",TOP_LEFT:"top-left"},qb={[yb.EQUAL_EQUAL]:[Cb.TOP,Cb.BOTTOM],[yb.EQUAL_HIGHER]:[Cb.BOTTOM,Cb.BOTTOM_RIGHT],[yb.EQUAL_LOWER]:[Cb.TOP,Cb.TOP_RIGHT],[yb.EQUAL_VOID]:[Cb.TOP,Cb.BOTTOM],[yb.HIGHER_EQUAL]:[Cb.LEFT,Cb.BOTTOM_LEFT,Cb.TOP,Cb.TOP_RIGHT],[yb.HIGHER_HIGHER_ACUTE]:[Cb.BOTTOM,Cb.BOTTOM_LEFT,Cb.LEFT,Cb.TOP_RIGHT],[yb.HIGHER_HIGHER_OBTUSE]:[Cb.BOTTOM,Cb.TOP],[yb.HIGHER_LOWER_NEGATIVE]:[Cb.TOP,Cb.TOP_RIGHT,Cb.RIGHT],[yb.HIGHER_LOWER_POSITIVE]:[Cb.BOTTOM,Cb.BOTTOM_LEFT,Cb.LEFT],[yb.HIGHER_VOID]:[Cb.TOP],[yb.LOWER_EQUAL]:[Cb.TOP],[yb.LOWER_HIGHER_NEGATIVE]:[Cb.TOP,Cb.TOP_LEFT],[yb.LOWER_HIGHER_POSITIVE]:[Cb.BOTTOM_RIGHT],[yb.LOWER_LOWER_ACUTE]:[Cb.TOP,Cb.TOP_LEFT,Cb.LEFT,Cb.TOP_RIGHT,Cb.RIGHT],[yb.LOWER_LOWER_OBTUSE]:[Cb.TOP,Cb.BOTTOM],[yb.LOWER_VOID]:[Cb.TOP],[yb.VOID_EQUAL]:[Cb.TOP],[yb.VOID_HIGHER]:[Cb.TOP,Cb.BOTTOM],[yb.VOID_LOWER]:[Cb.TOP,Cb.BOTTOM,Cb.LEFT],[yb.VOID_VOID]:[Cb.TOP]};function Ab({nodes:e,extract:t,style:n,measureText:r,size:i,horizontal:o,rtl:a,showLabel:s}){const l=Eb({nodes:e,extract:t,style:n,measureText:r,size:i,horizontal:o,rtl:a,showLabel:s}),u=[...l.reduce(((e,t)=>(e.push(...Object.keys(t).map((e=>t[e]))),e)),[])],[c]=u,d=function({groups:e,threshold:t}){const n=e.map((e=>Object.keys(e).map((t=>e[t])))),r={};for(let e=0;e<=n.length;e++){const t=n[e];if(t)for(let e=0;e<t.length;e++){const n=t[e],{line:i}=n;r[i]||(r[i]=[]),r[i].push(n.bounds)}}const i=Object.keys(r).map((e=>r[e])),o=[];for(let e=0;e<i.length;e++)for(let n=0;n<i[e].length-1;n++){const r=i[e][n],a=i[e][n+1],s={x1:r.x,y1:r.y,x2:a.x,y2:a.y},l=s.x1-s.x2,u=s.y1-s.y2;Math.sqrt(l*l+u*u)>t&&o.push(s)}return o}({groups:l,threshold:c.node.localBounds.height}),m={getItems:()=>u,getLines:()=>d};return function({groups:e}){for(let t=0;t<e.length;t++){const n=Object.keys(e[t]).map((n=>e[t][n]));for(let r=0;r<n.length;r++){const i=n[r],o=bb({previous:e[t-1]&&e[t-1][i.line],current:i,next:e[t+1]&&e[t+1][i.line]});i.setClassification(o)}}}({groups:l}),m.getItems().forEach((e=>e.setPreferences(qb[e.classification]))),m}function Ob({item:e,placement:t,size:n}){return t.x>=0-n.edgeBleed.left&&t.x<=n.width-e.bounds.width+n.edgeBleed.right&&t.y>=0-n.edgeBleed.top&&t.y<=n.height-e.bounds.height}function Db({line1:e,line2:t}){const n=(t.y2-t.y1)*(e.x2-e.x1)-(t.x2-t.x1)*(e.y2-e.y1);if(0===n)return!1;const r=((t.x2-t.x1)*(e.y1-t.y1)-(t.y2-t.y1)*(e.x1-t.x1))/n,i=((e.x2-e.x1)*(e.y1-t.y1)-(e.y2-e.y1)*(e.x1-t.x1))/n;return r>=0&&r<=1&&i>=0&&i<=1}function Ib({candidate:e,lines:t,rects:n}){return!!n.some((t=>function({rect1:e,rect2:t}){return!(t.x>e.x+e.width||t.x+t.width<e.x||t.y>e.y+e.height||t.y+t.height<e.y)}({rect1:t,rect2:e})))||t.some((t=>function({line:e,rect:t}){const n={x:t.x,y:t.y},r={x:t.x+t.width,y:t.y},i={x:t.x+t.width,y:t.y+t.height},o={x:t.x,y:t.y+t.height},a={x1:r.x,y1:r.y,x2:i.x,y2:i.y},s={x1:i.x,y1:i.y,x2:o.x,y2:o.y},l={x1:o.x,y1:o.y,x2:n.x,y2:n.y};return Db({line1:e,line2:{x1:n.x,y1:n.y,x2:r.x,y2:r.y}})||Db({line1:e,line2:a})||Db({line1:e,line2:s})||Db({line1:e,line2:l})}({line:t,rect:e})))}const wb={x:0,width:0,y:0,height:0};const Tb=({item:e})=>({x:e.bounds.x-e.bounds.width/2,y:e.bounds.y-e.bounds.height-e.node.localBounds.height/2-e.border}),Nb=({item:e})=>({x:e.bounds.x,y:e.bounds.y-e.bounds.height-e.node.localBounds.height/2-e.border}),Lb=({item:e})=>({x:e.bounds.x+e.node.localBounds.width/2+e.border,y:e.bounds.y-e.bounds.height/2}),kb=({item:e})=>({x:e.bounds.x,y:e.bounds.y+e.node.localBounds.height/2+e.border}),Rb=({item:e})=>({x:e.bounds.x-e.bounds.width/2,y:e.bounds.y+e.node.localBounds.height/2+e.border}),Pb=({item:e})=>({x:e.bounds.x-e.bounds.width,y:e.bounds.y+e.node.localBounds.height/2+e.border}),Fb=({item:e})=>({x:e.bounds.x-e.bounds.width-e.node.localBounds.width/2-e.border,y:e.bounds.y-e.bounds.height/2}),zb=({item:e})=>({x:e.bounds.x-e.bounds.width,y:e.bounds.y-e.bounds.height-e.node.localBounds.height/2-e.border});var _b={X:2.5,Y:4};const $b=[Cb.TOP,Cb.TOP_LEFT,Cb.TOP_RIGHT],Hb=[Cb.BOTTOM,Cb.BOTTOM_LEFT,Cb.BOTTOM_RIGHT];function jb({position:e}){const t={x:_b.X,width:-2*_b.X,y:0,height:0},n=$b.indexOf(e)>-1,r=Hb.indexOf(e)>-1;return n&&(t.y=_b.Y,t.height=-_b.Y),r&&(t.height=-_b.Y),t}function Vb({cx:e,cy:t,r:n,degrees:r}){const i=r*(Math.PI/180);return{x:Math.round(e+n*Math.sin(i)),y:Math.round(t+n*-Math.cos(i))}}function Bb({coordinates:e,degrees:t,item:n}){const r={x:e.x,y:e.y};return t<=90?r.y-=n.bounds.height:t>180&&t<=270?r.x-=n.bounds.width:t>270&&(r.y-=n.bounds.height,r.x-=n.bounds.width),r}const Ub=15;function Yb({item:e,validator:t,force:n=!1}){const r=function({item:e}){return[e.node.localBounds.height/2*Math.sqrt(2)]}({item:e}),i=e.bounds.x,o=e.bounds.y;for(let a=0;a<r.length;a++){const s=r[a];for(let r=40;r<=180;r+=Ub){const a=Bb({coordinates:Vb({cx:i,cy:o,r:s,degrees:r}),degrees:r,item:e});if(t({item:e,placement:a,ignoreLines:n}).valid)return a}for(let r=320;r>180;r-=Ub){const a=Bb({coordinates:Vb({cx:i,cy:o,r:s,degrees:r}),degrees:r,item:e});if(t({item:e,placement:a,ignoreLines:n}).valid)return a}}return!1}const Wb=void 0;function Gb({item:e,validator:t,force:n=!1}){const r=[...e.preferences,...Object.keys(Cb).map((e=>Cb[e])).filter((t=>-1===e.preferences.indexOf(t)))],i={[Cb.TOP]:Tb,[Cb.TOP_RIGHT]:Nb,[Cb.RIGHT]:Lb,[Cb.BOTTOM_RIGHT]:kb,[Cb.BOTTOM]:Rb,[Cb.BOTTOM_LEFT]:Pb,[Cb.LEFT]:Fb,[Cb.TOP_LEFT]:zb},o=[];for(let a=0;a<r.length;a++){const s=r[a],l=i[s]({item:e}),u=jb({position:s}),c=t({item:e,placement:l,adjustment:u,ignoreLines:n});if(n&&c.inside&&o.push(l),c.valid)return l}const a=()=>Yb({item:e,validator:t,force:n});if(n){const e=a();return e||(o[0]||Wb)}return(e.extreme||e.elite)&&a()||Wb}function Xb({model:e,size:t,all:n}){const r={},i=e.getItems(),o=[...i.map((e=>({x:e.node.localBounds.x-e.border+1,y:e.node.localBounds.y-e.border+1,height:e.node.localBounds.height+2*e.border-2,width:e.node.localBounds.width+2*e.border-2})))],a=[],s=e.getLines();i.forEach((e=>{const{data:i}=e.node;if(!e.show||!e.inside||i.null&&i.null.value||i.interpolated&&i.interpolated.value)return;const{key:l}=e;if(r[l])return void e.setDuplicate();r[l]=!0;const u=function({size:e,lines:t,placements:n}){return function({item:r,placement:i,adjustment:o=wb,ignoreLines:a=!1}){const s={inside:Ob({item:r,placement:i,size:e}),collides:!0,valid:!1};return s.inside?(s.collides=Ib({candidate:{x:i.x+o.x,y:i.y+o.y,width:r.bounds.width+o.width,height:r.bounds.height+o.height},lines:a?[]:t,rects:n}),s.valid=!s.collides,s):s}}({size:t,lines:s,placements:o}),c=Gb({item:e,validator:u});c?(c.height=e.bounds.height,c.width=e.bounds.width,o.push(c),e.setPlacement(c)):n&&a.push({item:e,validator:u})})),a.forEach((e=>{const{item:t,validator:n}=e,r=Gb({item:t,validator:n,force:!0});r&&(r.height=t.bounds.height,r.width=t.bounds.width,o.push(r),t.setPlacement(r))}))}var Kb={require:["chart","renderer"],defaultSettings:{settings:{orientation:"horizontal",rtl:!1,connect:!1,all:!1,label:()=>{},showLabel:()=>!0,pointValue:()=>{},majorValue:()=>{},target:{point:"point-component",allPoints:[]},lineIndex:"line",insideStrategy:"edge",labelSpace:{use:()=>!1,size:10}},style:{fontFamily:'"Source Sans Pro", "Arial", "sans-serif"',fontSize:"12px",fill:"#333"}},preferredSize(){const e={edgeBleed:{top:0,right:0,left:0}},{orientation:t,rtl:n,labelSpace:r}=this.settings.settings,{use:i,size:o}=r;if(i()){const r="horizontal"===t;e.edgeBleed.top=r?o:0,e.edgeBleed[n?"left":"right"]=r?0:o}return e},render(){const{settings:e}=this.settings,{target:t,enabled:n}=e;if(!this.chart.component(t.point))return[];if("function"==typeof n&&!n())return[];const{allPoints:r}=t,i=r.length?e=>r.includes(e.key):e=>e.key===t.point,o=this.chart.findShapes("circle").filter(i);if(!o.length)return[];const a="horizontal"===e.orientation,s=a?"x":"y";o.sort(((e,t)=>e.localBounds[s]-t.localBounds[s]));const l={label:e.label,pointValue:e.pointValue,majorValue:e.majorValue,lineIndex:e.lineIndex},{height:u,width:c,edgeBleed:d}=this.rect,m={height:u,width:c,edgeBleed:d,insideStrategy:e.insideStrategy},{style:f}=this,p=Ab({nodes:o,extract:l,style:f,measureText:this.renderer.measureText,size:m,horizontal:a,rtl:e.rtl,showLabel:e.showLabel});return function({model:e}){e.getItems().sort(((e,t)=>e.extreme===t.extreme?0:e.extreme&&!t.extreme?-1:1))}({model:p}),Xb({model:p,size:m,all:e.all}),p.getItems().filter((e=>e.placement&&e.node.key===this.settings.settings.target.point)).map((e=>({type:"text",x:e.placement.x+e.placement.width/2,y:e.placement.y+e.labelMeasurements.height/2,fontSize:f.fontSize,fontFamily:f.fontFamily,fill:f.fill,text:l.label(e.node.data),data:e.node.data.value,baseline:"central",anchor:"middle"})))}},Jb={defaultSettings:{settings:{size:10}},preferredSize(){return this.settings.settings.size},render:()=>[]};var Zb={require:["resolver","symbol"],defaultSettings:{settings:{type:"max",primaryExtremum:()=>{},secondaryExtremum:()=>{},primarySeries:[],secondarySeries:[],orientation:"horizontal",rtl:!1,major:{scale:"major-scale"},markerOffset:1,size:10},style:{fill:"#999"}},preferredSize(){return this.settings.settings.size},render(){const{items:e=[]}=this.data;if(!e.length)return[];const{type:t,orientation:n,rtl:r,markerOffset:i,size:o,major:a,primarySeries:s,secondarySeries:l}=this.settings.settings,u=this.settings.settings.primaryExtremum(),c=this.settings.settings.secondaryExtremum(),d=s.length&&void 0!==u,m=l.length&&void 0!==c;if(!d&&!m)return[];const f=s.map((e=>e.ref)),p=l.map((e=>e.ref)),h=e.filter((e=>f.includes(e.end.source.field))),y=e.filter((e=>p.includes(e.end.source.field))),g=function({type:e,primaryExtremum:t,secondaryExtremum:n,primaryItems:r=[],secondaryItems:i=[],primarySeries:o=[],secondarySeries:a=[]}){const s=[];[...o,...a].forEach((o=>{const a=o.isPrimary?t:n,l=o.isPrimary?r:i;s.push((({type:e,extremum:t,separateStacking:n,items:r})=>{const i="max"===e?e=>e>t:e=>e<t,o=n?e=>i(e.point.value<0?e.start.value:e.end.value):e=>i(e.end.value);return r.filter(o)})({type:e,extremum:a,items:l}))}));const l=(({items:e})=>{const t=[],n=[];return e.forEach((e=>{const{value:r}=e.major;t[r]||(t[r]=!0,n.push(e))})),n})({items:s.reduce(((e,t)=>e.concat(t)),[])});return l}({type:t,primaryExtremum:u,secondaryExtremum:c,primaryItems:h,secondaryItems:y,primarySeries:s,secondarySeries:l});if(!g.length)return[];const v="horizontal"===n,b=this.rect[v?"width":"height"],x=this.resolver.resolve({data:{items:g},settings:{major:a},scaled:{major:b}}),S=("max"===t?90:-90)-(v?0:90)-(!v&&r?180:0),M=o/2*i,{fill:E}=this.settings.style,C=x.items.map((e=>function({symbol:e,size:t,fill:n,startAngle:r,x:i,y:o,data:a}){return e({type:"n-polygon",show:!0,size:t,fill:n,stroke:"#205891",strokeWidth:0,sides:3,startAngle:r,width:.7,x:i,y:o,data:a})}({symbol:this.symbol,size:o,fill:E,startAngle:S,x:v?b*e.major:M,y:v?M:b*e.major,data:e.data})));return C}};function Qb({x:e,y:t,size:n,stroke:r,strokeWidth:i,fill:o}){return{type:"container",children:[{type:"line",stroke:r||o,strokeWidth:i,x1:e-n/2,y1:t,x2:e+n/2,y2:t},{type:"circle",strokeWidth:0,fill:o,cx:e,cy:t,r:.25*n}]}}function ex({chart:e,seriesInfo:t}){const n={primary:{paths:[],map:{}},secondary:{paths:[],map:{}}},r=[...t.primary.map((e=>e.key)),...t.secondary.map((e=>e.key))],i=e.findShapes("path").filter((e=>r.some((t=>t===e.key))));return i.reduce(((e,n)=>{const r=t.primary.some((e=>e.key===n.key))?e.primary:e.secondary;return r.paths.push(n),e}),n),{getLine:(e,t)=>{const r=t?n.primary:n.secondary;if(!r.map[e]){const[t]=r.paths.filter((t=>t.data&&t.data.typeIndex.value===e));r.map[e]=t}return r.map[e]}}}function tx({brush:e}){const t=e.brush.values();return function({value:e}){return-1!==t.indexOf(e)}}function nx({brush:e,chart:t}){const n=e.brush.ranges();if(!n.length)return!1;const r=t&&t.scale(xm.SCALE.MAJOR),i=r&&r.max&&r.max(),o="qHyperCube/qDimensionInfo/0:numeric"===e.id?(e,t)=>t===i?e<=t:e<t:(e,t)=>e<=t;return function({value:e}){return n.some((t=>t.min<=e&&o(e,t.max)))}}function rx({brush:e,selectionInfo:t,items:n,selectionValues:r,colorByData:i,chart:o}){const a=e.brushes();if(!a.length)return[];const s=a[0],{minorRange:l,legendRange:u,legendTap:c}=t,d=0===s.id.indexOf("qHyperCube/qMeasureInfo/")?"qHyperCube/qMeasureInfo/X":s.id;let m=[u?e=>e.color.value:r[d]].filter(Boolean);if(i&&l&&m.push((e=>e.color.value)),!i&&c&&(m=[e=>e.color.value]),!m.length)return[];const f=function({brush:e,chart:t}){return("value"===e.type?tx:nx)({brush:e,chart:t})}({brush:s,chart:o});return f?n.reduce(((e,t,n)=>(m.some((e=>f({value:e(t)})))&&e.push({item:t,index:n}),e)),[]):[]}function ix({chart:e,selected:t,connection:n,gradient:r,fallback:i}){const o=e.scale(xm.SCALE.COLOR),a=t.filter((e=>-1!==n.indexOf(e.index))).map((e=>e.item.end.value)),s=Math.min(...a),l=Math.max(...a),u=l-s,c=0===u?1:u,d=o.domain().map((e=>({color:o(Math.min(l,Math.max(s,e)))||i,offset:Math.min(1,Math.max(0,(e-s)/c))}))),m=d.map((e=>e.offset)),f=m.lastIndexOf(0),p=m.indexOf(1),h=d.slice(-1===f?0:f,-1===p?d.length:p+1);return{type:"gradient",x1:r.x1,x2:r.x2,y1:r.y1,y2:r.y2,stops:h}}function ox({chart:e,selected:t,connection:n,gradient:r,fallback:i}){const o=e.scale(xm.SCALE.COLOR),a=t.filter((e=>-1!==n.indexOf(e.index))).map((e=>e.item.end.value)),s=Math.min(...a),l=Math.max(...a)-s,u=0===l?1:l,c=o.domain(),d=[];for(let e=0;e<c.length-1;e++){const t=c[e],n=o(t)||i;d.push({color:n,offset:Math.min(1,Math.max(0,(t-s)/u))});const r=c[e+1];d.push({color:n,offset:Math.min(1,Math.max(0,(r-s)/u))})}const m=d.map((e=>e.offset)),f=m.lastIndexOf(0),p=m.indexOf(1),h=d.slice(-1===f?0:f,-1===p?d.length:p+1);return{type:"gradient",x1:r.x1,x2:r.x2,y1:r.y1,y2:r.y2,stops:h}}function ax({property:e,chart:t,connection:n,attrs:r,colorSettings:i,colorByData:o,selected:a,hasMultipleMeasures:s,groupedByMeasure:l,itemsPerGroup:u,orientation:c,rtl:d}){const m=r[e];if("gradient"!==m.type)return m;const{type:f,nil:p}=i;if(s||!o)return function({chart:e,selected:t,connection:n,gradient:r,fallback:i,orientation:o,isColorCode:a,groupedByMeasure:s,itemsPerGroup:l,rtl:u}){const c=e.scale(xm.SCALE.MAJOR),d=e.scale(xm.SCALE.COLOR),m=s?e=>c([e,0])+c.bandwidth()*l/2:e=>c(e),f=t.filter((e=>-1!==n.indexOf(e.index))),p=("vertical"===o&&u?f.reverse():f).map((e=>e.item)),h=p.map((e=>m(e.major.value))),y=Math.min(...h),g=Math.max(...h)-y,v=0===g?1:g,b=h.map(((e,t)=>0===t?0:t===h.length-1?1:(e-y)/v)),x=[];for(let e=0;e<p.length;e++){const t=p[e],n=a?t.color.value:d(t.color.value)||i,r=b[e];x.push({color:n,offset:0===e?0:Math.max(0,x[x.length-1].offset)}),x.push({color:n,offset:e===p.length-1?1:Math.max(0,parseFloat((r+(b[e+1]-r)/2).toFixed(5)))})}return{type:"gradient",x1:r.x1,x2:r.x2,y1:r.y1,y2:r.y2,stops:x}}({chart:t,selected:a,connection:n,gradient:m,fallback:p,orientation:c,isColorCode:"color"===f,groupedByMeasure:l,itemsPerGroup:u,rtl:d});return("continuous"===f?ix:ox)({chart:t,selected:a,connection:n,gradient:m,fallback:p})}function sx({chart:e,pathModel:t,colorSettings:n,colorByData:r,hasMultipleMeasures:i,groupedByMeasure:o,itemsPerGroup:a,orientation:s,lineKey:l,primary:u,selected:c,connections:d,rtl:m,count:f}){const p=t.getLine(l,u),{attrs:h}=p,y=function({d:e}){return e.replace("Z","").split(/(?=[LMC])/).map((e=>{const t=e.substring(0,1),n={letter:t,x:0,y:0,raw:e},r=e.substring(1).split(",");return"M"===t||"L"===t?([n.x]=r,[,n.y]=r):"C"===t&&([,,,,n.x]=r,[,,,,,n.y]=r),n}))}({d:h.d});return d.map((t=>function({chart:e,colorSettings:t,colorByData:n,hasMultipleMeasures:r,groupedByMeasure:i,itemsPerGroup:o,orientation:a,selected:s,connection:l,commands:u,attrs:c,rtl:d,count:m}){return{path:l.map(((e,t)=>{const n=u[e];return 0!==t||"M"===n.letter?n.raw:`M${n.x},${n.y}`})).join(""),attrs:c,stroke:ax({property:"stroke",chart:e,connection:l,attrs:c,selected:s,colorSettings:t,colorByData:n,hasMultipleMeasures:r,groupedByMeasure:i,itemsPerGroup:o,orientation:a,rtl:d,count:m})}}({chart:e,colorSettings:n,colorByData:r,hasMultipleMeasures:i,groupedByMeasure:o,itemsPerGroup:a,orientation:s,selected:c,connection:t,commands:y,attrs:h,rtl:m,count:f})))}function lx({chart:e,pathModel:t,seriesInfo:n,brush:r,selectionInfo:i,items:o,selectionValues:a,colorSettings:s,colorByData:l,hasMultipleMeasures:u,groupedByMeasure:c,itemsPerGroup:d,orientation:m,rtl:f}){const p=function({items:e,selectionInfo:t,seriesInfo:n}){return e.filter((e=>{if("NaN"===e.end.value||Number.isNaN(e.end.value))return!1;const{minorRange:r,minorRangePrimary:i}=t;return!r||(i?n.primary:n.secondary).some((t=>t.typeIndex===e.typeIndex.value))}))}({items:o,selectionInfo:i,seriesInfo:n}),h=function({items:e,seriesInfo:t}){const n=e.reduce(((e,n,r)=>{const i=n.typeIndex.value;var o;return e[i]||(e[i]={key:i,items:[],index:r,measureIx:null===(o=n.colorMeasureIdx)||void 0===o?void 0:o.value,primary:t.primary.some((e=>e.typeIndex===i))}),e[i].items.push(n),e}),{});return Object.keys(n).map((e=>n[e])).sort(((e,t)=>e.index-t.index)).map((e=>({lineKey:e.key,items:e.items,primary:e.primary,measureIx:e.measureIx})))}({items:p,seriesInfo:n}),{lines:y}=h.reduce(((n,o)=>{const p=rx({brush:r,selectionInfo:i,items:o.items,selectionValues:a,colorByData:l,chart:e});if(p.length<2)return n;const h=function({selected:e}){return e.reduce(((e,t)=>{const{index:n}=t;if(e.length){const t=e[e.length-1];n===t[t.length-1]+1?t.push(n):e.push([n])}else e.push([n]);return e}),[]).filter((e=>e.length>1))}({selected:p});return h.length?(n.lines.push(...sx({chart:e,pathModel:t,colorSettings:s(o.measureIx),colorByData:l(o.measureIx),hasMultipleMeasures:u,groupedByMeasure:c,itemsPerGroup:d,orientation:m,lineKey:o.lineKey,primary:o.primary,selected:p,connections:h,rtl:f,count:o.items.length})),n):n}),{lines:[]}),g=[];return y.forEach((e=>g.push({type:"path",d:e.path,stroke:e.stroke,strokeLinejoin:e.attrs["stroke-linejoin"],strokeWidth:e.attrs["stroke-width"],strokeDasharray:e.attrs["stroke-dasharray"],fill:"none"}))),g}var ux={require:["chart","renderer"],defaultSettings:{settings:{seriesInfo:{primary:[],secondary:[]},selectionValues:{},colorSettings:void 0,colorByData:!1,isColorCode:!1,hasMultipleMeasures:!1,groupedByMeasure:!1,itemsPerGroup:1,orientation:"vertical",rtl:!1}},addListener(e,t){this.state.brush.addListener(e,t),this.state.listeners.push({type:e,fn:t})},removeListeners(){this.state.listeners.forEach((e=>this.state.brush.removeListener(e.type,e.fn))),this.state.listeners.length=0},created(){this.state={pathModel:ex({chart:this.chart,seriesInfo:this.settings.settings.seriesInfo}),brush:this.chart.brush("selection"),listeners:[],selectionInfo:{minorRange:!1,minorRangePrimary:!1,legendRange:!1,legendTap:!1}}},mounted(){this.addListener("update",(()=>{this.state.selectionInfo=this.settings.settings.getSelectionInfo();const e=lx({chart:this.chart,pathModel:this.state.pathModel,seriesInfo:this.settings.settings.seriesInfo,brush:this.state.brush,selectionInfo:this.state.selectionInfo,items:this.data.items,selectionValues:this.settings.settings.selectionValues,colorSettings:this.settings.settings.colorSettings,colorByData:this.settings.settings.colorByData,isColorCode:this.settings.settings.isColorCode,hasMultipleMeasures:this.settings.settings.hasMultipleMeasures,groupedByMeasure:this.settings.settings.groupedByMeasure,itemsPerGroup:this.settings.settings.itemsPerGroup,orientation:this.settings.settings.orientation,rtl:this.settings.settings.rtl});this.renderer.render(e)})),this.addListener("end",(()=>{this.renderer.render([])}))},render(){this.state.pathModel=ex({chart:this.chart,seriesInfo:this.settings.settings.seriesInfo}),this.state.selectionInfo=this.settings.settings.getSelectionInfo();return lx({chart:this.chart,pathModel:this.state.pathModel,seriesInfo:this.settings.settings.seriesInfo,brush:this.state.brush,selectionInfo:this.state.selectionInfo,items:this.data.items,selectionValues:this.settings.settings.selectionValues,colorSettings:this.settings.settings.colorSettings,colorByData:this.settings.settings.colorByData,isColorCode:this.settings.settings.isColorCode,hasMultipleMeasures:this.settings.settings.hasMultipleMeasures,groupedByMeasure:this.settings.settings.groupedByMeasure,itemsPerGroup:this.settings.settings.itemsPerGroup,orientation:this.settings.settings.orientation,rtl:this.settings.settings.rtl})},destroyed(){this.removeListeners()}};const cx={line:"bar",circle:"circle",diamond:"diamond",triangle:"triangle",rect:"square"},dx=e=>void 0===e.marker?cx.circle:cx[e.marker],mx=e=>void 0===e.markerFill||e.markerFill;function fx({series:e,layoutService:t}){switch(Fh(e)){case Sm.TYPE.MARKER:return(e=>({marker:dx(e),fill:mx(e)}))(e);case Sm.TYPE.LINE:return(e=>{const t=e.getLayoutValue("nullMode","gap");return{showAsGaps:"gap"===t,showAsConnections:"connect"===t,showAsZeros:"zero"===t}})(t);default:return{}}}function px(e=Sm.NOPE_SERIES,t){return t?e.axis===Sm.AXIS.PRIMARY:e.axis===Sm.AXIS.PRIMARY||Fh(e)===Sm.TYPE.BAR}var hx={exports:{}};var yx={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2};const gx="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};var vx=gx;!function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:n}=yx,r=vx,i=(t=e.exports={}).re=[],o=t.safeRe=[],a=t.src=[],s=t.t={};let l=0;const u=(e,t,n)=>{const u=t.split("\\s*").join("\\s{0,1}").split("\\s+").join("\\s"),c=l++;r(e,c,t),s[e]=c,a[c]=t,i[c]=new RegExp(t,n?"g":void 0),o[c]=new RegExp(u,n?"g":void 0)};u("NUMERICIDENTIFIER","0|[1-9]\\d*"),u("NUMERICIDENTIFIERLOOSE","[0-9]+"),u("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*"),u("MAINVERSION",`(${a[s.NUMERICIDENTIFIER]})\\.(${a[s.NUMERICIDENTIFIER]})\\.(${a[s.NUMERICIDENTIFIER]})`),u("MAINVERSIONLOOSE",`(${a[s.NUMERICIDENTIFIERLOOSE]})\\.(${a[s.NUMERICIDENTIFIERLOOSE]})\\.(${a[s.NUMERICIDENTIFIERLOOSE]})`),u("PRERELEASEIDENTIFIER",`(?:${a[s.NUMERICIDENTIFIER]}|${a[s.NONNUMERICIDENTIFIER]})`),u("PRERELEASEIDENTIFIERLOOSE",`(?:${a[s.NUMERICIDENTIFIERLOOSE]}|${a[s.NONNUMERICIDENTIFIER]})`),u("PRERELEASE",`(?:-(${a[s.PRERELEASEIDENTIFIER]}(?:\\.${a[s.PRERELEASEIDENTIFIER]})*))`),u("PRERELEASELOOSE",`(?:-?(${a[s.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${a[s.PRERELEASEIDENTIFIERLOOSE]})*))`),u("BUILDIDENTIFIER","[0-9A-Za-z-]+"),u("BUILD",`(?:\\+(${a[s.BUILDIDENTIFIER]}(?:\\.${a[s.BUILDIDENTIFIER]})*))`),u("FULLPLAIN",`v?${a[s.MAINVERSION]}${a[s.PRERELEASE]}?${a[s.BUILD]}?`),u("FULL",`^${a[s.FULLPLAIN]}$`),u("LOOSEPLAIN",`[v=\\s]*${a[s.MAINVERSIONLOOSE]}${a[s.PRERELEASELOOSE]}?${a[s.BUILD]}?`),u("LOOSE",`^${a[s.LOOSEPLAIN]}$`),u("GTLT","((?:<|>)?=?)"),u("XRANGEIDENTIFIERLOOSE",`${a[s.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),u("XRANGEIDENTIFIER",`${a[s.NUMERICIDENTIFIER]}|x|X|\\*`),u("XRANGEPLAIN",`[v=\\s]*(${a[s.XRANGEIDENTIFIER]})(?:\\.(${a[s.XRANGEIDENTIFIER]})(?:\\.(${a[s.XRANGEIDENTIFIER]})(?:${a[s.PRERELEASE]})?${a[s.BUILD]}?)?)?`),u("XRANGEPLAINLOOSE",`[v=\\s]*(${a[s.XRANGEIDENTIFIERLOOSE]})(?:\\.(${a[s.XRANGEIDENTIFIERLOOSE]})(?:\\.(${a[s.XRANGEIDENTIFIERLOOSE]})(?:${a[s.PRERELEASELOOSE]})?${a[s.BUILD]}?)?)?`),u("XRANGE",`^${a[s.GTLT]}\\s*${a[s.XRANGEPLAIN]}$`),u("XRANGELOOSE",`^${a[s.GTLT]}\\s*${a[s.XRANGEPLAINLOOSE]}$`),u("COERCE",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?(?:$|[^\\d])`),u("COERCERTL",a[s.COERCE],!0),u("LONETILDE","(?:~>?)"),u("TILDETRIM",`(\\s*)${a[s.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",u("TILDE",`^${a[s.LONETILDE]}${a[s.XRANGEPLAIN]}$`),u("TILDELOOSE",`^${a[s.LONETILDE]}${a[s.XRANGEPLAINLOOSE]}$`),u("LONECARET","(?:\\^)"),u("CARETTRIM",`(\\s*)${a[s.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",u("CARET",`^${a[s.LONECARET]}${a[s.XRANGEPLAIN]}$`),u("CARETLOOSE",`^${a[s.LONECARET]}${a[s.XRANGEPLAINLOOSE]}$`),u("COMPARATORLOOSE",`^${a[s.GTLT]}\\s*(${a[s.LOOSEPLAIN]})$|^$`),u("COMPARATOR",`^${a[s.GTLT]}\\s*(${a[s.FULLPLAIN]})$|^$`),u("COMPARATORTRIM",`(\\s*)${a[s.GTLT]}\\s*(${a[s.LOOSEPLAIN]}|${a[s.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",u("HYPHENRANGE",`^\\s*(${a[s.XRANGEPLAIN]})\\s+-\\s+(${a[s.XRANGEPLAIN]})\\s*$`),u("HYPHENRANGELOOSE",`^\\s*(${a[s.XRANGEPLAINLOOSE]})\\s+-\\s+(${a[s.XRANGEPLAINLOOSE]})\\s*$`),u("STAR","(<|>)?=?\\s*\\*"),u("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),u("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(hx,hx.exports);var bx=hx.exports;const xx=Object.freeze({loose:!0}),Sx=Object.freeze({});var Mx=e=>e?"object"!=typeof e?xx:e:Sx;const Ex=/^[0-9]+$/,Cx=(e,t)=>{const n=Ex.test(e),r=Ex.test(t);return n&&r&&(e=+e,t=+t),e===t?0:n&&!r?-1:r&&!n?1:e<t?-1:1};var qx={compareIdentifiers:Cx,rcompareIdentifiers:(e,t)=>Cx(t,e)};const Ax=vx,{MAX_LENGTH:Ox,MAX_SAFE_INTEGER:Dx}=yx,{safeRe:Ix,t:wx}=bx,Tx=Mx,{compareIdentifiers:Nx}=qx;var Lx=class e{constructor(t,n){if(n=Tx(n),t instanceof e){if(t.loose===!!n.loose&&t.includePrerelease===!!n.includePrerelease)return t;t=t.version}else if("string"!=typeof t)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>Ox)throw new TypeError(`version is longer than ${Ox} characters`);Ax("SemVer",t,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;const r=t.trim().match(n.loose?Ix[wx.LOOSE]:Ix[wx.FULL]);if(!r)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>Dx||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Dx||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Dx||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t<Dx)return t}return e})):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if(Ax("SemVer.compare",this.version,this.options,t),!(t instanceof e)){if("string"==typeof t&&t===this.version)return 0;t=new e(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof e||(t=new e(t,this.options)),Nx(this.major,t.major)||Nx(this.minor,t.minor)||Nx(this.patch,t.patch)}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let n=0;do{const e=this.prerelease[n],r=t.prerelease[n];if(Ax("prerelease compare",n,e,r),void 0===e&&void 0===r)return 0;if(void 0===r)return 1;if(void 0===e)return-1;if(e!==r)return Nx(e,r)}while(++n)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let n=0;do{const e=this.build[n],r=t.build[n];if(Ax("prerelease compare",n,e,r),void 0===e&&void 0===r)return 0;if(void 0===r)return 1;if(void 0===e)return-1;if(e!==r)return Nx(e,r)}while(++n)}inc(e,t,n){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,n),this.inc("pre",t,n);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,n),this.inc("pre",t,n);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{const e=Number(n)?1:0;if(!t&&!1===n)throw new Error("invalid increment argument: identifier is empty");if(0===this.prerelease.length)this.prerelease=[e];else{let r=this.prerelease.length;for(;--r>=0;)"number"==typeof this.prerelease[r]&&(this.prerelease[r]++,r=-2);if(-1===r){if(t===this.prerelease.join(".")&&!1===n)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let r=[t,e];!1===n&&(r=[t]),0===Nx(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=r):this.prerelease=r}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};const kx=Lx;var Rx=(e,t,n=!1)=>{if(e instanceof kx)return e;try{return new kx(e,t)}catch(e){if(!n)return null;throw e}};const Px=Rx;var Fx=(e,t)=>{const n=Px(e,t);return n?n.version:null};const zx=Rx;var _x=(e,t)=>{const n=zx(e.trim().replace(/^[=v]+/,""),t);return n?n.version:null};const $x=Lx;var Hx=(e,t,n,r,i)=>{"string"==typeof n&&(i=r,r=n,n=void 0);try{return new $x(e instanceof $x?e.version:e,n).inc(t,r,i).version}catch(e){return null}};const jx=Rx;var Vx=(e,t)=>{const n=jx(e,null,!0),r=jx(t,null,!0),i=n.compare(r);if(0===i)return null;const o=i>0,a=o?n:r,s=o?r:n,l=!!a.prerelease.length;if(!!s.prerelease.length&&!l)return s.patch||s.minor?a.patch?"patch":a.minor?"minor":"major":"major";const u=l?"pre":"";return n.major!==r.major?u+"major":n.minor!==r.minor?u+"minor":n.patch!==r.patch?u+"patch":"prerelease"};const Bx=Lx;var Ux=(e,t)=>new Bx(e,t).major;const Yx=Lx;var Wx=(e,t)=>new Yx(e,t).minor;const Gx=Lx;var Xx=(e,t)=>new Gx(e,t).patch;const Kx=Rx;var Jx=(e,t)=>{const n=Kx(e,t);return n&&n.prerelease.length?n.prerelease:null};const Zx=Lx;var Qx=(e,t,n)=>new Zx(e,n).compare(new Zx(t,n));const eS=Qx;var tS=(e,t,n)=>eS(t,e,n);const nS=Qx;var rS=(e,t)=>nS(e,t,!0);const iS=Lx;var oS=(e,t,n)=>{const r=new iS(e,n),i=new iS(t,n);return r.compare(i)||r.compareBuild(i)};const aS=oS;var sS=(e,t)=>e.sort(((e,n)=>aS(e,n,t)));const lS=oS;var uS=(e,t)=>e.sort(((e,n)=>lS(n,e,t)));const cS=Qx;var dS=(e,t,n)=>cS(e,t,n)>0;const mS=Qx;var fS=(e,t,n)=>mS(e,t,n)<0;const pS=Qx;var hS=(e,t,n)=>0===pS(e,t,n);const yS=Qx;var gS=(e,t,n)=>0!==yS(e,t,n);const vS=Qx;var bS=(e,t,n)=>vS(e,t,n)>=0;const xS=Qx;var SS=(e,t,n)=>xS(e,t,n)<=0;const MS=hS,ES=gS,CS=dS,qS=bS,AS=fS,OS=SS;var DS=(e,t,n,r)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e===n;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e!==n;case"":case"=":case"==":return MS(e,n,r);case"!=":return ES(e,n,r);case">":return CS(e,n,r);case">=":return qS(e,n,r);case"<":return AS(e,n,r);case"<=":return OS(e,n,r);default:throw new TypeError(`Invalid operator: ${t}`)}};const IS=Lx,wS=Rx,{safeRe:TS,t:NS}=bx;var LS,kS,RS,PS,FS,zS,_S,$S,HS,jS,VS=(e,t)=>{if(e instanceof IS)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let n=null;if((t=t||{}).rtl){let t;for(;(t=TS[NS.COERCERTL].exec(e))&&(!n||n.index+n[0].length!==e.length);)n&&t.index+t[0].length===n.index+n[0].length||(n=t),TS[NS.COERCERTL].lastIndex=t.index+t[1].length+t[2].length;TS[NS.COERCERTL].lastIndex=-1}else n=e.match(TS[NS.COERCE]);return null===n?null:wS(`${n[2]}.${n[3]||"0"}.${n[4]||"0"}`,t)};function BS(){if(PS)return RS;function e(t){var n=this;if(n instanceof e||(n=new e),n.tail=null,n.head=null,n.length=0,t&&"function"==typeof t.forEach)t.forEach((function(e){n.push(e)}));else if(arguments.length>0)for(var r=0,i=arguments.length;r<i;r++)n.push(arguments[r]);return n}function t(e,t,n){var r=t===e.head?new i(n,null,t,e):new i(n,t,t.next,e);return null===r.next&&(e.tail=r),null===r.prev&&(e.head=r),e.length++,r}function n(e,t){e.tail=new i(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function r(e,t){e.head=new i(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function i(e,t,n,r){if(!(this instanceof i))return new i(e,t,n,r);this.list=r,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,n?(n.prev=this,this.next=n):this.next=null}PS=1,RS=e,e.Node=i,e.create=e,e.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,n=e.prev;return t&&(t.prev=n),n&&(n.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=n),e.list.length--,e.next=null,e.prev=null,e.list=null,t},e.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}},e.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}},e.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)n(this,arguments[e]);return this.length},e.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)r(this,arguments[e]);return this.length},e.prototype.pop=function(){if(this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e}},e.prototype.shift=function(){if(this.head){var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e}},e.prototype.forEach=function(e,t){t=t||this;for(var n=this.head,r=0;null!==n;r++)e.call(t,n.value,r,this),n=n.next},e.prototype.forEachReverse=function(e,t){t=t||this;for(var n=this.tail,r=this.length-1;null!==n;r--)e.call(t,n.value,r,this),n=n.prev},e.prototype.get=function(e){for(var t=0,n=this.head;null!==n&&t<e;t++)n=n.next;if(t===e&&null!==n)return n.value},e.prototype.getReverse=function(e){for(var t=0,n=this.tail;null!==n&&t<e;t++)n=n.prev;if(t===e&&null!==n)return n.value},e.prototype.map=function(t,n){n=n||this;for(var r=new e,i=this.head;null!==i;)r.push(t.call(n,i.value,this)),i=i.next;return r},e.prototype.mapReverse=function(t,n){n=n||this;for(var r=new e,i=this.tail;null!==i;)r.push(t.call(n,i.value,this)),i=i.prev;return r},e.prototype.reduce=function(e,t){var n,r=this.head;if(arguments.length>1)n=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");r=this.head.next,n=this.head.value}for(var i=0;null!==r;i++)n=e(n,r.value,i),r=r.next;return n},e.prototype.reduceReverse=function(e,t){var n,r=this.tail;if(arguments.length>1)n=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");r=this.tail.prev,n=this.tail.value}for(var i=this.length-1;null!==r;i--)n=e(n,r.value,i),r=r.prev;return n},e.prototype.toArray=function(){for(var e=new Array(this.length),t=0,n=this.head;null!==n;t++)e[t]=n.value,n=n.next;return e},e.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,n=this.tail;null!==n;t++)e[t]=n.value,n=n.prev;return e},e.prototype.slice=function(t,n){(n=n||this.length)<0&&(n+=this.length),(t=t||0)<0&&(t+=this.length);var r=new e;if(n<t||n<0)return r;t<0&&(t=0),n>this.length&&(n=this.length);for(var i=0,o=this.head;null!==o&&i<t;i++)o=o.next;for(;null!==o&&i<n;i++,o=o.next)r.push(o.value);return r},e.prototype.sliceReverse=function(t,n){(n=n||this.length)<0&&(n+=this.length),(t=t||0)<0&&(t+=this.length);var r=new e;if(n<t||n<0)return r;t<0&&(t=0),n>this.length&&(n=this.length);for(var i=this.length,o=this.tail;null!==o&&i>n;i--)o=o.prev;for(;null!==o&&i>t;i--,o=o.prev)r.push(o.value);return r},e.prototype.splice=function(e,n,...r){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var i=0,o=this.head;null!==o&&i<e;i++)o=o.next;var a=[];for(i=0;o&&i<n;i++)a.push(o.value),o=this.removeNode(o);null===o&&(o=this.tail),o!==this.head&&o!==this.tail&&(o=o.prev);for(i=0;i<r.length;i++)o=t(this,o,r[i]);return a},e.prototype.reverse=function(){for(var e=this.head,t=this.tail,n=e;null!==n;n=n.prev){var r=n.prev;n.prev=n.next,n.next=r}return this.head=t,this.tail=e,this};try{(kS?LS:(kS=1,LS=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}))(e)}catch(e){}return RS}function US(){if($S)return _S;$S=1;class e{constructor(t,n){if(n=r(n),t instanceof e)return t.loose===!!n.loose&&t.includePrerelease===!!n.includePrerelease?t:new e(t.raw,n);if(t instanceof i)return this.raw=t.value,this.set=[[t]],this.format(),this;if(this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease,this.raw=t.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map((e=>this.parseRange(e))).filter((e=>e.length)),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter((e=>!p(e[0]))),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&h(e[0])){this.set=[e];break}}this.format()}format(){return this.range=this.set.map((e=>e.join(" ").trim())).join("||").trim(),this.range}toString(){return this.range}parseRange(e){const t=((this.options.includePrerelease&&m)|(this.options.loose&&f))+":"+e,r=n.get(t);if(r)return r;const a=this.options.loose,h=a?s[l.HYPHENRANGELOOSE]:s[l.HYPHENRANGE];e=e.replace(h,O(this.options.includePrerelease)),o("hyphen replace",e),e=e.replace(s[l.COMPARATORTRIM],u),o("comparator trim",e);let y=(e=(e=e.replace(s[l.TILDETRIM],c)).replace(s[l.CARETTRIM],d)).split(" ").map((e=>g(e,this.options))).join(" ").split(/\s+/).map((e=>A(e,this.options)));a&&(y=y.filter((e=>(o("loose invalid filter",e,this.options),!!e.match(s[l.COMPARATORLOOSE]))))),o("range list",y);const v=new Map,b=y.map((e=>new i(e,this.options)));for(const e of b){if(p(e))return[e];v.set(e.value,e)}v.size>1&&v.has("")&&v.delete("");const x=[...v.values()];return n.set(t,x),x}intersects(t,n){if(!(t instanceof e))throw new TypeError("a Range is required");return this.set.some((e=>y(e,n)&&t.set.some((t=>y(t,n)&&e.every((e=>t.every((t=>e.intersects(t,n)))))))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new a(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(D(this.set[t],e,this.options))return!0;return!1}}_S=e;const t=function(){if(zS)return FS;zS=1;const e=BS(),t=Symbol("max"),n=Symbol("length"),r=Symbol("lengthCalculator"),i=Symbol("allowStale"),o=Symbol("maxAge"),a=Symbol("dispose"),s=Symbol("noDisposeOnSet"),l=Symbol("lruList"),u=Symbol("cache"),c=Symbol("updateAgeOnGet"),d=()=>1,m=(e,t,n)=>{const r=e[u].get(t);if(r){const t=r.value;if(f(e,t)){if(h(e,r),!e[i])return}else n&&(e[c]&&(r.value.now=Date.now()),e[l].unshiftNode(r));return t.value}},f=(e,t)=>{if(!t||!t.maxAge&&!e[o])return!1;const n=Date.now()-t.now;return t.maxAge?n>t.maxAge:e[o]&&n>e[o]},p=e=>{if(e[n]>e[t])for(let r=e[l].tail;e[n]>e[t]&&null!==r;){const t=r.prev;h(e,r),r=t}},h=(e,t)=>{if(t){const r=t.value;e[a]&&e[a](r.key,r.value),e[n]-=r.length,e[u].delete(r.key),e[l].removeNode(t)}};class y{constructor(e,t,n,r,i){this.key=e,this.value=t,this.length=n,this.now=r,this.maxAge=i||0}}const g=(e,t,n,r)=>{let o=n.value;f(e,o)&&(h(e,n),e[i]||(o=void 0)),o&&t.call(r,o.value,o.key,e)};return FS=class{constructor(e){if("number"==typeof e&&(e={max:e}),e||(e={}),e.max&&("number"!=typeof e.max||e.max<0))throw new TypeError("max must be a non-negative number");this[t]=e.max||1/0;const n=e.length||d;if(this[r]="function"!=typeof n?d:n,this[i]=e.stale||!1,e.maxAge&&"number"!=typeof e.maxAge)throw new TypeError("maxAge must be a number");this[o]=e.maxAge||0,this[a]=e.dispose,this[s]=e.noDisposeOnSet||!1,this[c]=e.updateAgeOnGet||!1,this.reset()}set max(e){if("number"!=typeof e||e<0)throw new TypeError("max must be a non-negative number");this[t]=e||1/0,p(this)}get max(){return this[t]}set allowStale(e){this[i]=!!e}get allowStale(){return this[i]}set maxAge(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[o]=e,p(this)}get maxAge(){return this[o]}set lengthCalculator(e){"function"!=typeof e&&(e=d),e!==this[r]&&(this[r]=e,this[n]=0,this[l].forEach((e=>{e.length=this[r](e.value,e.key),this[n]+=e.length}))),p(this)}get lengthCalculator(){return this[r]}get length(){return this[n]}get itemCount(){return this[l].length}rforEach(e,t){t=t||this;for(let n=this[l].tail;null!==n;){const r=n.prev;g(this,e,n,t),n=r}}forEach(e,t){t=t||this;for(let n=this[l].head;null!==n;){const r=n.next;g(this,e,n,t),n=r}}keys(){return this[l].toArray().map((e=>e.key))}values(){return this[l].toArray().map((e=>e.value))}reset(){this[a]&&this[l]&&this[l].length&&this[l].forEach((e=>this[a](e.key,e.value))),this[u]=new Map,this[l]=new e,this[n]=0}dump(){return this[l].map((e=>!f(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)})).toArray().filter((e=>e))}dumpLru(){return this[l]}set(e,i,c){if((c=c||this[o])&&"number"!=typeof c)throw new TypeError("maxAge must be a number");const d=c?Date.now():0,m=this[r](i,e);if(this[u].has(e)){if(m>this[t])return h(this,this[u].get(e)),!1;const r=this[u].get(e).value;return this[a]&&(this[s]||this[a](e,r.value)),r.now=d,r.maxAge=c,r.value=i,this[n]+=m-r.length,r.length=m,this.get(e),p(this),!0}const f=new y(e,i,m,d,c);return f.length>this[t]?(this[a]&&this[a](e,i),!1):(this[n]+=f.length,this[l].unshift(f),this[u].set(e,this[l].head),p(this),!0)}has(e){if(!this[u].has(e))return!1;const t=this[u].get(e).value;return!f(this,t)}get(e){return m(this,e,!0)}peek(e){return m(this,e,!1)}pop(){const e=this[l].tail;return e?(h(this,e),e.value):null}del(e){h(this,this[u].get(e))}load(e){this.reset();const t=Date.now();for(let n=e.length-1;n>=0;n--){const r=e[n],i=r.e||0;if(0===i)this.set(r.k,r.v);else{const e=i-t;e>0&&this.set(r.k,r.v,e)}}}prune(){this[u].forEach(((e,t)=>m(this,t,!1)))}},FS}(),n=new t({max:1e3}),r=Mx,i=YS(),o=vx,a=Lx,{safeRe:s,t:l,comparatorTrimReplace:u,tildeTrimReplace:c,caretTrimReplace:d}=bx,{FLAG_INCLUDE_PRERELEASE:m,FLAG_LOOSE:f}=yx,p=e=>"<0.0.0-0"===e.value,h=e=>""===e.value,y=(e,t)=>{let n=!0;const r=e.slice();let i=r.pop();for(;n&&r.length;)n=r.every((e=>i.intersects(e,t))),i=r.pop();return n},g=(e,t)=>(o("comp",e,t),e=S(e,t),o("caret",e),e=b(e,t),o("tildes",e),e=E(e,t),o("xrange",e),e=q(e,t),o("stars",e),e),v=e=>!e||"x"===e.toLowerCase()||"*"===e,b=(e,t)=>e.trim().split(/\s+/).map((e=>x(e,t))).join(" "),x=(e,t)=>{const n=t.loose?s[l.TILDELOOSE]:s[l.TILDE];return e.replace(n,((t,n,r,i,a)=>{let s;return o("tilde",e,t,n,r,i,a),v(n)?s="":v(r)?s=`>=${n}.0.0 <${+n+1}.0.0-0`:v(i)?s=`>=${n}.${r}.0 <${n}.${+r+1}.0-0`:a?(o("replaceTilde pr",a),s=`>=${n}.${r}.${i}-${a} <${n}.${+r+1}.0-0`):s=`>=${n}.${r}.${i} <${n}.${+r+1}.0-0`,o("tilde return",s),s}))},S=(e,t)=>e.trim().split(/\s+/).map((e=>M(e,t))).join(" "),M=(e,t)=>{o("caret",e,t);const n=t.loose?s[l.CARETLOOSE]:s[l.CARET],r=t.includePrerelease?"-0":"";return e.replace(n,((t,n,i,a,s)=>{let l;return o("caret",e,t,n,i,a,s),v(n)?l="":v(i)?l=`>=${n}.0.0${r} <${+n+1}.0.0-0`:v(a)?l="0"===n?`>=${n}.${i}.0${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.0${r} <${+n+1}.0.0-0`:s?(o("replaceCaret pr",s),l="0"===n?"0"===i?`>=${n}.${i}.${a}-${s} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a}-${s} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a}-${s} <${+n+1}.0.0-0`):(o("no pr"),l="0"===n?"0"===i?`>=${n}.${i}.${a}${r} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a}${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a} <${+n+1}.0.0-0`),o("caret return",l),l}))},E=(e,t)=>(o("replaceXRanges",e,t),e.split(/\s+/).map((e=>C(e,t))).join(" ")),C=(e,t)=>{e=e.trim();const n=t.loose?s[l.XRANGELOOSE]:s[l.XRANGE];return e.replace(n,((n,r,i,a,s,l)=>{o("xRange",e,n,r,i,a,s,l);const u=v(i),c=u||v(a),d=c||v(s),m=d;return"="===r&&m&&(r=""),l=t.includePrerelease?"-0":"",u?n=">"===r||"<"===r?"<0.0.0-0":"*":r&&m?(c&&(a=0),s=0,">"===r?(r=">=",c?(i=+i+1,a=0,s=0):(a=+a+1,s=0)):"<="===r&&(r="<",c?i=+i+1:a=+a+1),"<"===r&&(l="-0"),n=`${r+i}.${a}.${s}${l}`):c?n=`>=${i}.0.0${l} <${+i+1}.0.0-0`:d&&(n=`>=${i}.${a}.0${l} <${i}.${+a+1}.0-0`),o("xRange return",n),n}))},q=(e,t)=>(o("replaceStars",e,t),e.trim().replace(s[l.STAR],"")),A=(e,t)=>(o("replaceGTE0",e,t),e.trim().replace(s[t.includePrerelease?l.GTE0PRE:l.GTE0],"")),O=e=>(t,n,r,i,o,a,s,l,u,c,d,m,f)=>`${n=v(r)?"":v(i)?`>=${r}.0.0${e?"-0":""}`:v(o)?`>=${r}.${i}.0${e?"-0":""}`:a?`>=${n}`:`>=${n}${e?"-0":""}`} ${l=v(u)?"":v(c)?`<${+u+1}.0.0-0`:v(d)?`<${u}.${+c+1}.0-0`:m?`<=${u}.${c}.${d}-${m}`:e?`<${u}.${c}.${+d+1}-0`:`<=${l}`}`.trim(),D=(e,t,n)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let n=0;n<e.length;n++)if(o(e[n].semver),e[n].semver!==i.ANY&&e[n].semver.prerelease.length>0){const r=e[n].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0};return _S}function YS(){if(jS)return HS;jS=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(r,i){if(i=n(i),r instanceof t){if(r.loose===!!i.loose)return r;r=r.value}r=r.trim().split(/\s+/).join(" "),a("comparator",r,i),this.options=i,this.loose=!!i.loose,this.parse(r),this.semver===e?this.value="":this.value=this.operator+this.semver.version,a("comp",this)}parse(t){const n=this.options.loose?r[i.COMPARATORLOOSE]:r[i.COMPARATOR],o=t.match(n);if(!o)throw new TypeError(`Invalid comparator: ${t}`);this.operator=void 0!==o[1]?o[1]:"","="===this.operator&&(this.operator=""),o[2]?this.semver=new s(o[2],this.options.loose):this.semver=e}toString(){return this.value}test(t){if(a("Comparator.test",t,this.options.loose),this.semver===e||t===e)return!0;if("string"==typeof t)try{t=new s(t,this.options)}catch(e){return!1}return o(t,this.operator,this.semver,this.options)}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new l(e.value,r).test(this.value):""===e.operator?""===e.value||new l(this.value,r).test(e.semver):(!(r=n(r)).includePrerelease||"<0.0.0-0"!==this.value&&"<0.0.0-0"!==e.value)&&(!(!r.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))&&(!(!this.operator.startsWith(">")||!e.operator.startsWith(">"))||(!(!this.operator.startsWith("<")||!e.operator.startsWith("<"))||(!(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))||(!!(o(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))||!!(o(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))))))}}HS=t;const n=Mx,{safeRe:r,t:i}=bx,o=DS,a=vx,s=Lx,l=US();return HS}const WS=US();var GS=(e,t,n)=>{try{t=new WS(t,n)}catch(e){return!1}return t.test(e)};const XS=US();var KS=(e,t)=>new XS(e,t).set.map((e=>e.map((e=>e.value)).join(" ").trim().split(" ")));const JS=Lx,ZS=US();var QS=(e,t,n)=>{let r=null,i=null,o=null;try{o=new ZS(t,n)}catch(e){return null}return e.forEach((e=>{o.test(e)&&(r&&-1!==i.compare(e)||(r=e,i=new JS(r,n)))})),r};const eM=Lx,tM=US();var nM=(e,t,n)=>{let r=null,i=null,o=null;try{o=new tM(t,n)}catch(e){return null}return e.forEach((e=>{o.test(e)&&(r&&1!==i.compare(e)||(r=e,i=new eM(r,n)))})),r};const rM=Lx,iM=US(),oM=dS;var aM=(e,t)=>{e=new iM(e,t);let n=new rM("0.0.0");if(e.test(n))return n;if(n=new rM("0.0.0-0"),e.test(n))return n;n=null;for(let t=0;t<e.set.length;++t){const r=e.set[t];let i=null;r.forEach((e=>{const t=new rM(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":i&&!oM(t,i)||(i=t);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${e.operator}`)}})),!i||n&&!oM(n,i)||(n=i)}return n&&e.test(n)?n:null};const sM=US();var lM=(e,t)=>{try{return new sM(e,t).range||"*"}catch(e){return null}};const uM=Lx,cM=YS(),{ANY:dM}=cM,mM=US(),fM=GS,pM=dS,hM=fS,yM=SS,gM=bS;var vM=(e,t,n,r)=>{let i,o,a,s,l;switch(e=new uM(e,r),t=new mM(t,r),n){case">":i=pM,o=yM,a=hM,s=">",l=">=";break;case"<":i=hM,o=gM,a=pM,s="<",l="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(fM(e,t,r))return!1;for(let n=0;n<t.set.length;++n){const u=t.set[n];let c=null,d=null;if(u.forEach((e=>{e.semver===dM&&(e=new cM(">=0.0.0")),c=c||e,d=d||e,i(e.semver,c.semver,r)?c=e:a(e.semver,d.semver,r)&&(d=e)})),c.operator===s||c.operator===l)return!1;if((!d.operator||d.operator===s)&&o(e,d.semver))return!1;if(d.operator===l&&a(e,d.semver))return!1}return!0};const bM=vM;var xM=(e,t,n)=>bM(e,t,">",n);const SM=vM;var MM=(e,t,n)=>SM(e,t,"<",n);const EM=US();var CM=(e,t,n)=>(e=new EM(e,n),t=new EM(t,n),e.intersects(t,n));const qM=GS,AM=Qx;const OM=US(),DM=YS(),{ANY:IM}=DM,wM=GS,TM=Qx,NM=[new DM(">=0.0.0-0")],LM=[new DM(">=0.0.0")],kM=(e,t,n)=>{if(e===t)return!0;if(1===e.length&&e[0].semver===IM){if(1===t.length&&t[0].semver===IM)return!0;e=n.includePrerelease?NM:LM}if(1===t.length&&t[0].semver===IM){if(n.includePrerelease)return!0;t=LM}const r=new Set;let i,o,a,s,l,u,c;for(const t of e)">"===t.operator||">="===t.operator?i=RM(i,t,n):"<"===t.operator||"<="===t.operator?o=PM(o,t,n):r.add(t.semver);if(r.size>1)return null;if(i&&o){if(a=TM(i.semver,o.semver,n),a>0)return null;if(0===a&&(">="!==i.operator||"<="!==o.operator))return null}for(const e of r){if(i&&!wM(e,String(i),n))return null;if(o&&!wM(e,String(o),n))return null;for(const r of t)if(!wM(e,String(r),n))return!1;return!0}let d=!(!o||n.includePrerelease||!o.semver.prerelease.length)&&o.semver,m=!(!i||n.includePrerelease||!i.semver.prerelease.length)&&i.semver;d&&1===d.prerelease.length&&"<"===o.operator&&0===d.prerelease[0]&&(d=!1);for(const e of t){if(c=c||">"===e.operator||">="===e.operator,u=u||"<"===e.operator||"<="===e.operator,i)if(m&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===m.major&&e.semver.minor===m.minor&&e.semver.patch===m.patch&&(m=!1),">"===e.operator||">="===e.operator){if(s=RM(i,e,n),s===e&&s!==i)return!1}else if(">="===i.operator&&!wM(i.semver,String(e),n))return!1;if(o)if(d&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===d.major&&e.semver.minor===d.minor&&e.semver.patch===d.patch&&(d=!1),"<"===e.operator||"<="===e.operator){if(l=PM(o,e,n),l===e&&l!==o)return!1}else if("<="===o.operator&&!wM(o.semver,String(e),n))return!1;if(!e.operator&&(o||i)&&0!==a)return!1}return!(i&&u&&!o&&0!==a)&&(!(o&&c&&!i&&0!==a)&&(!m&&!d))},RM=(e,t,n)=>{if(!e)return t;const r=TM(e.semver,t.semver,n);return r>0?e:r<0||">"===t.operator&&">="===e.operator?t:e},PM=(e,t,n)=>{if(!e)return t;const r=TM(e.semver,t.semver,n);return r<0?e:r>0||"<"===t.operator&&"<="===e.operator?t:e};var FM=(e,t,n={})=>{if(e===t)return!0;e=new OM(e,n),t=new OM(t,n);let r=!1;e:for(const i of e.set){for(const e of t.set){const t=kM(i,e,n);if(r=r||null!==t,t)continue e}if(r)return!1}return!0};const zM=bx,_M=yx,$M=Lx,HM=qx,jM=(e,t,n)=>{const r=[];let i=null,o=null;const a=e.sort(((e,t)=>AM(e,t,n)));for(const e of a){qM(e,t,n)?(o=e,i||(i=e)):(o&&r.push([i,o]),o=null,i=null)}i&&r.push([i,null]);const s=[];for(const[e,t]of r)e===t?s.push(e):t||e!==a[0]?t?e===a[0]?s.push(`<=${t}`):s.push(`${e} - ${t}`):s.push(`>=${e}`):s.push("*");const l=s.join(" || "),u="string"==typeof t.raw?t.raw:String(t);return l.length<u.length?l:t};var VM=z({parse:Rx,valid:Fx,clean:_x,inc:Hx,diff:Vx,major:Ux,minor:Wx,patch:Xx,prerelease:Jx,compare:Qx,rcompare:tS,compareLoose:rS,compareBuild:oS,sort:sS,rsort:uS,gt:dS,lt:fS,eq:hS,neq:gS,gte:bS,lte:SS,cmp:DS,coerce:VS,Comparator:YS(),Range:US(),satisfies:GS,toComparators:KS,maxSatisfying:QS,minSatisfying:nM,minVersion:aM,validRange:lM,outside:vM,gtr:xM,ltr:MM,intersects:CM,simplifyRange:jM,subset:FM,SemVer:$M,re:zM.re,src:zM.src,tokens:zM.t,SEMVER_SPEC_VERSION:_M.SEMVER_SPEC_VERSION,RELEASE_TYPES:_M.RELEASE_TYPES,compareIdentifiers:HM.compareIdentifiers,rcompareIdentifiers:HM.rcompareIdentifiers}),BM={BAR_IN_SECONDARY_AXIS:"0.23.1"};const UM=e=>!e||VM.lt(VM.coerce(e),VM.coerce(BM.BAR_IN_SECONDARY_AXIS)),YM=({layoutService:e})=>{const t=!UM(e.getLayoutValue("version")),n=e.getHyperCubeValue("qMeasureInfo").map(((e,t)=>{const n={[Sm.TYPE.BAR]:0,[Sm.TYPE.LINE]:0,[Sm.TYPE.MARKER]:0};return({series:r=Sm.NOPE_SERIES},i)=>{const o=px(r,t),a=Fh(r);return{id:i,type:a,typeIndex:n[a]++,ref:`qMeasureInfo/${i}`,refIndex:i,isPrimary:o,scale:o?xm.SCALE.MINOR.PRIMARY:xm.SCALE.MINOR.SECONDARY,collection:o?xm.COLLECTION.PRIMARY:xm.COLLECTION.SECONDARY,options:fx({series:r,layoutService:e})}}})(e,t)),r=(e,t)=>e.filter((e=>Fh(e)===t)).length,i=n.filter((e=>e.isPrimary)),o=n.filter((e=>!e.isPrimary)),a=[!!i.length&&i[0],!!o.length&&o[0]].filter((e=>!!e)),s=r(n,Sm.TYPE.BAR),l=r(i,Sm.TYPE.BAR),u=r(o,Sm.TYPE.BAR),c=e=>n.filter((t=>Fh(t)===e)),d=c(Sm.TYPE.LINE).map((e=>op(xm.COMPONENT.POINT,e))),m=c(Sm.TYPE.MARKER).map((e=>({key:op(xm.COMPONENT.MARKER,e),type:e.options.marker}))),f=m.map((e=>e.key)),p=[];l>0&&p.push(`${xm.COMPONENT.BAR}-${Sm.AXIS.PRIMARY}`),u>0&&p.push(`${xm.COMPONENT.BAR}-${Sm.AXIS.SECONDARY}`);const h=[...p,...d,...f],{MINI_CHART:y}=xm.COMPONENT,g=c(Sm.TYPE.LINE).map((e=>op(y.LINE,e))),v=c(Sm.TYPE.MARKER).map((e=>op(y.MARKER,e))),b=e.meta.isContinuous?[`${y.BAR}-${Sm.AXIS.PRIMARY}`,`${y.BAR}-${Sm.AXIS.SECONDARY}`,...g,...v]:[];return{meta:{allSeries:n,primarySeries:i,secondarySeries:o,barSeriesCount:s,primaryBarSeriesCount:l,secondaryBarSeriesCount:u,measureAxes:a,pointComponentKeys:d,markerComponentKeys:f,barComponentKeys:p,seriesComponentKeys:h,miniComponentKeys:b,markers:m},query:{all:()=>n,seriesByAxis:e=>e?i:o,series:c,isPrimary:px}}};function WM({layoutService:e}){const{dimensionCount:t,measureCount:n}=e.meta;return{qTop:0,qLeft:0,qWidth:t+n,qHeight:Math.min(2e3,1e4/(n+1))}}function GM({genericObjectModel:e,layoutService:t}){return function(){return function(e,t,n){return e.getHyperCubeReducedData(n.path,[n.rect],n.zoomLevel,n.filter).catch(de).then((e=>{var n;const r=t.getHyperCubeValue("qMode"),i=t.getHyperCubeValue("qDimensionInfo"),o="K"===r&&i.length>1&&(null===(n=e[0])||void 0===n?void 0:n.qIsReduced),a=e.slice(),s=t.getHyperCubeValue("qMeasureInfo"),l=o?[]:t.getHyperCubeValue("qColumnOrder");return{reducedCube:{qDataPages:a,qDimensionInfo:i.slice(),qEffectiveInterColumnSortOrder:[1,0],qMeasureInfo:o?[s[0],s[0]]:s.slice(),qStackedDataPages:[],qMode:"S",qHasOtherValues:t.getHyperCubeValue("qHasOtherValues"),qSize:t.getHyperCubeValue("qSize"),qColumnOrder:l}}}))}(e,t,{path:"/qHyperCubeDef",rect:WM({layoutService:t}),zoomLevel:-1,filter:"D1"})}}function XM({genericObjectModel:e,layoutService:t}){const{isSnapshot:n,isContinuous:r}=t.meta;return n?function({layoutService:e}){return function(){return Promise.resolve({reducedCube:e.getLayoutValue("reducedHyperCube")||e.getHyperCube()})}}({layoutService:t}):r?function({layoutService:e}){return function(){const t=e.getHyperCube();return Promise.resolve({reducedCube:{...t,qDataPages:[...t.qDataPages]}})}}({layoutService:t}):GM({genericObjectModel:e,layoutService:t})}const KM=e=>"number"==typeof e&&!Number.isNaN(e);function JM({isPrimary:e,layoutService:t,seriesModel:n}){return function(){const r=t.getHyperCubeValue("qMeasureInfo"),i=n.query.seriesByAxis(e).map((e=>r[e.refIndex])),o=i.filter((e=>Fh(e.series)===Sm.TYPE.BAR)),a=i.filter((e=>Fh(e.series)===Sm.TYPE.LINE)),s=i.filter((e=>Fh(e.series)===Sm.TYPE.MARKER));return{min:Math.min(...i.filter((e=>KM(e.qMin))).map((e=>e.qMin))),max:Math.max(...i.filter((e=>KM(e.qMax))).map((e=>e.qMax))),bar:{min:Math.min(...o.filter((e=>KM(e.qMin))).map((e=>e.qMin))),max:Math.max(...o.filter((e=>KM(e.qMax))).map((e=>e.qMax)))},line:{min:Math.min(...a.filter((e=>KM(e.qMin))).map((e=>e.qMin))),max:Math.max(...a.filter((e=>KM(e.qMax))).map((e=>e.qMax)))},marker:{min:Math.min(...s.filter((e=>KM(e.qMin))).map((e=>e.qMin))),max:Math.max(...s.filter((e=>KM(e.qMax))).map((e=>e.qMax)))}}}}function ZM({isPrimary:e,layoutService:t,seriesModel:n}){const r=JM({isPrimary:e,layoutService:t,seriesModel:n}),i=function({seriesModel:e,isPrimary:t}){return function({dataPage:n}){const r=e.query.series(Sm.TYPE.BAR).filter((e=>e.isPrimary===t)).map((e=>e.refIndex)),{qMatrix:i}=n,o={min:NaN,max:NaN};return i.forEach((e=>{let t=0,n=0;e.slice(1).filter(((e,t)=>r.some((e=>e===t))&&"NaN"!==e.qNum)).forEach((e=>{e.qNum>=0?n+=e.qNum:t+=e.qNum})),o.min=Number.isNaN(o.min)?t:Math.min(t,o.min),o.max=Number.isNaN(o.max)?n:Math.max(n,o.max)})),o}}({seriesModel:n,isPrimary:e});return function({dataPage:e}){const t=r({dataPage:e});return t.bar=i({dataPage:e}),t.min=Math.min(t.bar.min,t.line.min,t.marker.min),t.max=Math.max(t.bar.max,t.line.max,t.marker.max),t}}function QM({isPrimary:e,continuousModel:t,layoutService:n,reducedModel:r,seriesModel:i}){const o={min:NaN,max:NaN,implicit:{min:NaN,max:NaN,bar:{min:NaN,max:NaN},line:{min:NaN,max:NaN},marker:{min:NaN,max:NaN}},explicit:{min:NaN,max:NaN},meta:{hasExplicit:!1,hasExplicitMin:!1,hasExplicitMax:!1,includesZero:!1}},a=function({isPrimary:e,layoutService:t,seriesModel:n}){const{isBarSeriesStacked:r}=t.meta,i=n.query.series(Sm.TYPE.BAR).filter((t=>t.isPrimary===e)).length;return!r||i<2?JM({isPrimary:e,layoutService:t,seriesModel:n}):ZM({isPrimary:e,layoutService:t,seriesModel:n})}({isPrimary:e,layoutService:n,seriesModel:i});return{query:{getExtrema:()=>o},command:{initialize:()=>{const{min:s,max:l}=function({isPrimary:e,layoutService:t}){const n={min:NaN,max:NaN},{getLayoutValue:r}=t,i=r("measureAxes."+(e?0:1),{});if(i.autoMinMax)return n;const{minMax:o,min:a,max:s}=i;return"min"!==o&&"minMax"!==o||(n.min=a),"max"!==o&&"minMax"!==o||(n.max=s),Number.isNaN(n.min)||Number.isNaN(n.max)||(n.min=Math.min(a,s),n.max=Math.max(a,s)),n}({isPrimary:e,layoutService:n});return o.explicit.min=s,o.explicit.max=l,o.meta.hasExplicitMin=!Number.isNaN(s),o.meta.hasExplicitMax=!Number.isNaN(l),o.meta.hasExplicit=o.meta.hasExplicitMin||o.meta.hasExplicitMax,function({continuousModel:e,layoutService:t,reducedModel:n}){const{isDiscrete:r}=t.meta;if(r){const e=n.query.getCube();return Promise.resolve({dataPage:e.qDataPages[0]})}return e.fetchMinMaxData().then((e=>({dataPage:e[0]})))}({continuousModel:t,layoutService:n,reducedModel:r}).then((({dataPage:t})=>{const{min:n,max:r,bar:s,line:l,marker:u}=a({dataPage:t}),c=i.query.seriesByAxis(e).some((e=>Fh(e)===Sm.TYPE.BAR)),d=c?Math.min(n,0):n,m=c?Math.max(r,0):r,f=c?Math.min(s.min,0):s.min,p=c?Math.max(s.max,0):s.max,h=c?Math.min(l.min,0):l.min,y=c?Math.max(l.max,0):l.max,g=c?Math.min(u.min,0):u.min,v=c?Math.max(u.max,0):u.max;o.implicit.min=Number.isFinite(d)?d:0,o.implicit.max=Number.isFinite(m)?m:0,o.implicit.bar.min=Number.isFinite(f)?f:0,o.implicit.bar.max=Number.isFinite(p)?p:0,o.implicit.line.min=Number.isFinite(h)?h:0,o.implicit.line.max=Number.isFinite(y)?y:0,o.implicit.marker.min=Number.isFinite(g)?g:0,o.implicit.marker.max=Number.isFinite(v)?v:0,o.min=Number.isNaN(o.explicit.min)?o.implicit.min:o.explicit.min,o.max=Number.isNaN(o.explicit.max)?o.implicit.max:o.explicit.max,o.meta.hasExplicitMin&&!o.meta.hasExplicitMax&&(o.max=Math.max(o.min,o.max)),o.meta.hasExplicitMax&&!o.meta.hasExplicitMin&&(o.min=Math.min(o.min,o.max)),o.meta.includesZero=!!((0-o.min)*(0-o.max)<=0)}))}}}}const eE=.2;function tE({extrema:e,ticks:t}){const n=e.meta.hasExplicit?2:3;return t.filter((t=>(t=>!e.meta.hasExplicitMin||t>=e.explicit.min)(t)&&(t=>!e.meta.hasExplicitMax||t<=e.explicit.max)(t))).length>=n}function nE({min:e,max:t,count:n,threshold:r,disable:i}){const o=function(e,t,n){const r=Mr().domain([e,t]);return r.nice(n),r}(e,t,n),a=function({min:e,max:t,threshold:n,scale:r,disable:i}){const o={start:!0,stop:!0};if(i)return o;const[a,s]=r.domain();return 0!==e&&0!==a&&(o.start=r(e)>n),0!==t&&0!==s&&(o.stop=r(t)<1-n),o}({min:e,max:t,threshold:r,scale:o,disable:i});if(!a.start||!a.stop){const[e,t]=o.domain(),r=o.ticks(n),i=r.length>=4?r[1]-r[0]:.1*e,s=r.length>=4?r[r.length-1]-r[r.length-2]:.1*t;o.domain([a.start?e:e-i,a.stop?t:t+s]),o.nice(n)}return o}const rE=50,iE=100,oE=200,aE=125,sE=e=>{switch(e){case.5:return rE;case 1:return iE;case 2:return oE;default:return e*aE}};function lE({config:e,chart:t,layoutService:n,dockService:r,measureText:i,size:o,min:a,max:s}){const l=function({config:{measureAxesRef:e},layoutService:t,size:n}){const r=t.getLayoutValue(`${e}.spacing`,1),i=sE(r);return Math.max(1,Math.round(n/i))}({config:e,layoutService:n,size:o}),u=nE({min:a,max:s,count:l,threshold:.05,disable:!0}),c=u.domain(),d={roundedMin:c[0],roundedMax:c[1],ticks:u.ticks(l)},m="horizontal"===r.meta.major.orientation?"height":"width",f=e=>i(e)[m],p=t.formatter(e.formatter),h=()=>{const e=d.ticks.map(p),t=e.some(((t,n)=>e.indexOf(t)!==n));return!t&&(e=>{const t=o/d.ticks.length;return Math.max(...e.map(f))<=t})(e)};for(let e=l-1;e>0&&!h();e--)u.domain([a,s]),u.nice(e),[d.roundedMin,d.roundedMax]=u.domain(),d.ticks=u.ticks(e);return d}const uE=.3;function cE({tick:e,index:t,ticks:n}){return 0===t||t===n.length-1||0===e}function dE({index:e,ticks:t}){return 0===e||e===t.length-1||e===Math.floor((t.length-1)/2)}const mE=10;function fE({config:e,chart:t,extrema:n,min:r,max:i}){const o={roundedMin:0,roundedMax:0,ticks:[]},a=nE({min:r,max:i,count:mE,threshold:.15,disable:!0});[o.roundedMin,o.roundedMax]=a.domain();const s=a.ticks(mE),l=function({ticks:e}){const t=Math.round(e.length*uE),n=t,r=e.length-t;return e.slice(n,r).some((e=>0===e))}({ticks:s}),u=l?cE:dE;o.ticks=s.filter(((e,t,n)=>u({tick:e,index:t,ticks:n})));o.ticks.length%2==0&&!l&&!n.meta.hasExplicit&&s.length>1&&(o.ticks=[s[0],(s[0]+s[s.length-1])/2,s[s.length-1]]);const c=t.formatter(e.formatter),d=o.ticks.map(c),m=d.some(((e,t)=>d.indexOf(e)!==t));return m&&(o.ticks=[o.ticks[0],o.ticks[o.ticks.length-1]]),o}function pE({ticks:e,extrema:t}){let n=[...e];return t.meta.hasExplicit&&e.length?(t.meta.hasExplicitMin&&!e.some((e=>e===t.explicit.min))&&(n.unshift(t.explicit.min),n=n.filter((e=>e>=t.explicit.min))),t.meta.hasExplicitMax&&!e.some((e=>e===t.explicit.max))&&(n.push(t.explicit.max),n=n.filter((e=>e<=t.explicit.max))),n):n}function hE({config:e,chart:t,layoutService:n,dockService:r,extrema:i,measureText:o,size:a,min:s,max:l}){const{ticks:u,roundedMin:c,roundedMax:d}=function({config:e,chart:t,layoutService:n,dockService:r,extrema:i,measureText:o,size:a,min:s,max:l}){if("SPARK"===r.meta.chart.mode)return function({min:e,max:t}){return{roundedMin:e,roundedMax:t,ticks:[]}}({min:s,max:l});const u=lE({config:e,chart:t,layoutService:n,dockService:r,measureText:o,size:a,min:s,max:l});return tE({extrema:i,ticks:u.ticks})?u:fE({config:e,chart:t,extrema:i,min:s,max:l})}({config:e,chart:t,layoutService:n,dockService:r,extrema:i,measureText:o,size:a,min:s,max:l}),m=function({ticks:e,count:t}){const n=[];for(let r=0;r<e.length-1;r++){const i=e[r],o=(e[r+1]-i)/(t+1);for(let e=1;e<=t;e++)n.push(i+o*e)}return n}({ticks:u,count:1}),f=[...pE({ticks:u,extrema:i}).map((e=>({value:e,isMinor:!1}))),...m.map((e=>({value:e,isMinor:!0})))].sort(((e,t)=>e.value-t.value));return{min:c,max:d,values:f}}function yE({config:e,chart:t,layoutService:n,dockService:r,measureText:i,extrema:o,size:a}){const{min:s,max:l}=function({extrema:e}){const{min:t,max:n}=e;return t!==n?{min:t,max:n}:0===t||1===t?{min:t-1,max:n+1}:{min:t-t*eE*Math.sign(t),max:n+n*eE*Math.sign(n)}}({extrema:o});return hE({config:e,chart:t,layoutService:n,dockService:r,extrema:o,measureText:i,size:a,min:s,max:l})}function gE({config:e,chart:t,layoutService:n,extremumModel:r,dockService:i,seriesModel:o,themeService:a}){const s={locked:!1,resolved:void 0},{getExtrema:l}=r.query,u=function({chart:e,config:t,dockService:n,extremumModel:r,layoutService:i,seriesModel:o,themeService:a}){const{measureText:s}=M.renderer("svg")();return()=>{const l=a.getStyles(),u=function({dockService:e,seriesModel:t,chart:n}){var r;const i=n.component(t.meta.seriesComponentKeys[0]),o=null!==(r=null==i?void 0:i.rect)&&void 0!==r?r:e.meta.chart.size;return"horizontal"===e.meta.major.orientation?o.height:o.width}({chart:e,dockService:n,seriesModel:o}),c=r.query.getExtrema();return yE({config:t,chart:e,layoutService:i,dockService:n,measureText:e=>s({text:e,fontFamily:l.axis.label.name.fontFamily,fontSize:l.axis.label.name.fontSize}),extrema:c,size:u})}}({config:e,chart:t,layoutService:n,extremumModel:r,dockService:i,seriesModel:o,themeService:a}),c=()=>(s.locked&&s.resolved||(s.resolved=u()),s.resolved);return{query:{getValues:()=>c().values,getMin:()=>l().meta.hasExplicitMin?l().explicit.min:c().min,getMax:()=>l().meta.hasExplicitMax?l().explicit.max:c().max},command:{lock:()=>{s.locked=!0},unlock:()=>{s.locked=!1}}}}function vE({genericObjectModel:e,layoutService:t}){const n={properties:void 0};return{query:{getProperties:()=>n.properties},command:{initialize:()=>function({layout:e,model:t}){return ue.snapshot(e)?Promise.resolve(null):t.getEffectiveProperties().then((e=>({properties:e})))}({layout:t.getLayout(),model:e}).then((e=>{const{properties:t}=null!=e?e:{};n.properties=t}))}}}function bE({layoutService:e,seriesModel:t,colorService:n}){const{type:r,mode:i,fieldType:o}=n.getSettings();if("categorical"!==r)return;const a=e.getLayoutValue("dataPoint.show",!1)?"line-point":"line";let s;s="field"===i?"measure"===o?()=>({type:Sm.TYPE.BAR}):()=>t.query.all()[0]:e=>t.query.all()[e.value];return{item:{shape:{type:({datum:e})=>{const{type:t,options:n}=s(e);switch(t){case"line":return a;case"marker":return n.marker;default:return"square"}},stroke:{},strokeWidth:({datum:e})=>{const{type:t,options:n}=s(e);return t===Sm.TYPE.LINE?2:t!==Sm.TYPE.MARKER||n.fill?0:1},size:10,fill:{fn:({datum:e,scale:t})=>{const{type:n,options:r}=s(e);return n!==Sm.TYPE.MARKER||"bar"===r.marker||r.fill?t(e.value):"none"}}}}}}function xE({layout:e,defaultAuto:t}){const n=t(e),r=e.qHyperCube.qMeasureInfo.length>1;return{...n,useBaseColors:r?"measure":n.useBaseColors}}function SE({actions:e,appLayoutModel:t,appModel:n,chart:r,environment:i,genericObjectModel:o,layoutService:a,picasso:s,seriesModel:l,viewState:u,styleModel:c}){let d;const{theme:m,translator:f}=i,p={wrappedScales:void 0,legendComponents:void 0,legendInteractions:void 0};return d=Nl({picasso:s,model:o,app:n,translator:f,layoutService:a,createConfig:()=>{const e=a.getHyperCubeValue("qMeasureInfo").map((e=>e.color));return{theme:m,colorProps:{measureOverrides:e},legendProps:a.getLayoutValue("legend"),hc:a.getHyperCube(),key:xm.SCALE.COLOR}},config:{auto:xE,localeInfo:t.qLocaleInfo},custom:{wrappedScales:()=>p.wrappedScales,legendComponents:()=>p.legendComponents,legendInteractions:()=>p.legendInteractions,updateLegend:()=>{const{components:t,interactions:n,scales:o}=function({viewState:e,chart:t,layoutService:n,seriesModel:r,environment:i,colorService:o,actions:a,styleModel:s}){const{options:l}=i,u={eventName:"legend-c",key:xm.COMPONENT.LEGEND,viewState:e,chart:t,styleReference:"object.comboChart",styleOverrides:{title:s.query.legend.title.getStyle(),label:s.query.legend.label.getStyle()},rtl:"rtl"===l.direction,settings:bE({layoutService:n,seriesModel:r,colorService:o})},{components:c,interactions:d}=o.getLegend(u,{actions:a,navigationDisabled:!a.interact.enabled()}),m=o.getScales();return{components:c.filter(Boolean).map((e=>{const{layout:t}=e,{dock:n}=t,r=m[`${xm.SCALE.COLOR}Range`];return!r||"right"!==n&&"left"!==n||(r.invert=!0),"legend-cat"===e.type&&(e.settings.item.shape.fill.scale=e.scale,e.settings.item.shape.stroke.scale=e.scale),e})),interactions:d,scales:m}}({viewState:u,chart:r,environment:i,colorService:d,seriesModel:l,layoutService:a,actions:e,styleModel:c});p.wrappedScales=o,p.legendComponents=t,p.legendInteractions=n}}}),d}const ME="REJECTED",EE=()=>{},CE=1e4,qE={MULTIPLIER:2,MINIMUM:20,MAXIMUM:200},AE=50,OE=10,DE=100;var IE={contains:function(e,t){if(!e)return!1;const{qArea:n}=e;return!!n&&(n.qLeft<=t.qLeft&&n.qLeft+n.qWidth>=t.qLeft+t.qWidth&&n.qTop<=t.qTop&&n.qTop+n.qHeight>=t.qTop+t.qHeight)},patcher:function({layoutService:e}){const t=t=>{t.qArea.qHeight=t.qMatrix.length,t.qArea.qWidth=e.meta.size.x};return t.should=e=>0===e.qArea.qHeight&&0===e.qArea.qWidth&&!!e.qMatrix.length,t},slicer:function(e,t){const n=Math.max(0,t.qHeight)-Math.abs(Math.min(0,t.qTop-e.qArea.qTop)),r=Math.max(0,t.qWidth)-Math.abs(Math.min(0,t.qLeft-e.qArea.qLeft)),i=Math.max(t.qTop,e.qArea.qTop),o=Math.max(t.qLeft,e.qArea.qLeft),a=Math.max(0,i-e.qArea.qTop),s=Math.min(i+n-e.qArea.qTop,e.qArea.qHeight),l=Math.max(0,o-e.qArea.qLeft),u=Math.min(o+r-e.qArea.qLeft,e.qArea.qWidth),c={qArea:{qHeight:s-a,qWidth:u-l,qTop:i,qLeft:o},qMatrix:[]};for(let t=a;t<s;t++)c.qMatrix.push(e.qMatrix[t].slice(l,u));return c},cacheWarden:function({bounds:e={width:0,height:0}}){return{release(t,n){const r=n.qTop-OE<=t.qTop,i=n.qLeft+n.qWidth+OE>=t.qLeft+t.qWidth,o=n.qTop+n.qHeight+OE>=t.qTop+t.qHeight,a=n.qLeft-OE<=t.qLeft;return r&&t.qTop>0||i&&t.qLeft+t.qWidth<e.width||o&&t.qTop+t.qHeight<e.height||a&&t.qLeft>0}}},request:function({definitionPath:e}){return t=>({method:"getHyperCubeData",args:[e,[t]]})}};var wE={contains:function(e,t){if(!e)return!1;const{qArea:n}=e;return!!n&&(n.qTop<=t.qTop&&n.qTop+n.qHeight>=t.qTop+t.qHeight)},patcher:function({layoutService:e}){const t=t=>{t.qArea.qHeight=t.qData[0].qSubNodes.length,t.qArea.qWidth=e.meta.size.x};return t.should=e=>0===e.qArea.qHeight&&0===e.qArea.qWidth&&!!e.qData.length,t},slicer:function(e,t){const n=Math.max(0,t.qHeight)-Math.abs(Math.min(0,t.qTop-e.qArea.qTop)),r=Math.max(t.qTop,e.qArea.qTop),i=Math.max(t.qLeft,e.qArea.qLeft),o=Math.max(0,r-e.qArea.qTop),a=Math.min(r+n-e.qArea.qTop,e.qArea.qHeight),s=e.qData[0].qUp+e.qArea.qHeight+e.qData[0].qDown-r-(a-o),l={qArea:{qHeight:a-o,qWidth:e.qArea.qWidth,qTop:r,qLeft:i},qData:[{...e.qData[0],qUp:r,qDown:s,qSubNodes:[]}]};for(let t=o;t<a;t++)l.qData[0].qSubNodes.push(e.qData[0].qSubNodes[t]);return l},cacheWarden:function({bounds:e={height:0}}){return{release(t,n){const r=n.qTop-OE<=t.qTop,i=n.qTop+n.qHeight+OE>=t.qTop+t.qHeight;return r&&t.qTop>0||i&&t.qTop+t.qHeight<e.height}}},request:function({layoutService:e,definitionPath:t}){const n=e.getLayoutValue("dimensionAxis.axisDisplayMode","auto");return e=>{const r={method:"getHyperCubeStackData",args:[t,[e]]};return"auto"===n&&r.args.push(600),r}}};var TE={contains:function(){return!1},patcher:function(){const e=e=>e;return e.should=()=>!1,e},slicer:function(e){return e},cacheWarden:function(){return{release:()=>!0}},request:function({definitionPath:e}){return t=>({method:"getHyperCubeTreeData",args:[e,[t]]})}};const NE="pages";const LE="discretePan",kE=10;function RE({chart:e,actions:t,componentKey:n,dockService:r,rtl:i,scroller:o}){return{type:"Pan",key:"discrete:pan",options:{event:LE,pointers:1,threshold:kE,enable(r,i){return this.started===LE||!i||!(!t.scroll.enabled()||!o.enabled())&&e.componentsFromPoint({x:i.center.x,y:i.center.y}).some((e=>e.key===n))}},events:{[`${LE}start`](e){e.preventDefault(),this.started=LE;const t="horizontal"===r.meta.major.orientation?e.deltaX:e.deltaY;this.previousTotalDelta=t<0?-kE:kE},[`${LE}move`](e){e.preventDefault();const t="horizontal"===r.meta.major.orientation,n=t?e.deltaX:e.deltaY,a=t&&i?-1:1,s=(n-this.previousTotalDelta)*a;this.previousTotalDelta=n,o.scroll(s)},[`${LE}end`](e){e.preventDefault(),this.started=!1},[`${LE}cancel`](e){e.preventDefault(),this.started=!1}}}}function PE({chart:e,componentKey:t,actions:n,scroller:r}){return function(i){if(!n.scroll.enabled()||!r.enabled())return;const[o]=e.componentsFromPoint({x:i.clientX,y:i.clientY}).filter((e=>e.key===t));if(!o)return;i.preventDefault();const a=Math.abs(i.deltaY)>Math.abs(i.deltaX)?i.deltaY:i.deltaX,s=Math.sign(-a)*DE;r.scroll(s)}}function FE({layoutService:e}){const t=function({layoutService:e}){const t=Math.floor(CE/(e.meta.dimensionCount+e.meta.measureCount));return function({width:e,height:n}){const r=Math.min(t,Math.max(qE.MAXIMUM,n));return{width:e,height:Math.max(qE.MINIMUM,Math.min(n*qE.MULTIPLIER,r))}}}({layoutService:e}),n={width:e.meta.size.x,height:e.meta.size.y};return function(e){const{width:r,height:i}=t({width:e.qWidth,height:e.qHeight}),o=i?Math.ceil((i-e.qHeight)/2):0,a=r?Math.ceil((r-e.qWidth)/2):0;return{qHeight:i?Math.min(i,n.height):e.qHeight,qWidth:r?Math.min(r,n.width):e.qWidth,qTop:i?Math.max(0,Math.min(e.qTop-o,n.height-i)):e.qTop,qLeft:r?Math.max(0,Math.min(e.qLeft-a,n.width-r)):e.qLeft}}}function zE(e){let t,n;const r=i=>{t=i;const{method:o,args:a}=t.request;e[o](...a).then((e=>{if(t.canceled||n)return t.reject(ME),t=null,void(n&&(r(n),n=null));t.resolve(e[0]),t=null}))},i=e=>new Promise(((i,o)=>{const a={request:e,resolve:i,reject:o,canceled:!1,cancel:()=>{a.canceled=!0}};t?(e=>{n&&n.reject(ME),n=e})(a):r(a)}));return i.isProcessing=()=>!!t,i.hasQueued=()=>!!n,i.cancel=()=>{i.isProcessing()&&t.cancel(),i.hasQueued()&&(n.reject(ME),n=null)},i}const _E={command:{update:()=>{}}};function $E({dataStore:e,composition:t,enigmaModel:n,layoutService:r,trendLineModel:i=_E,definitionPath:o,processDataPage:a}){const{slicer:s,cacheWarden:l,request:u}=t,c=function({dataStore:e,slice:t,warden:n,expand:r,request:i,process:o,connectionless:a,processDataPage:s}){return(l,{onProcessing:u}={})=>{if(e.contains(l)){const r=e.getCurrent();if(a)return Promise.resolve(t(r,l));const i=n.release(r.qArea,l),s=o.isProcessing();if(!i&&s&&o.cancel(),!i||s)return Promise.resolve(t(r,l))}if(a)return Promise.resolve(e.getCurrent());o.isProcessing()&&u&&u();const c=r(l);return o(i(c)).then((n=>(s(n),e.add(n),t(n,l))))}}({dataStore:e,slice:s,warden:l({bounds:{width:r.meta.size.x,height:r.meta.size.y}}),expand:FE({layoutService:r}),request:u({layoutService:r,definitionPath:o}),process:zE(n),connectionless:r.meta.isSnapshot,processDataPage:a}),d=Gl(((e,{onProcessing:t,onData:n})=>{c(e,{onProcessing:t}).then((e=>n(e))).catch((e=>{if(e!==ME)throw e}))}),AE);return function(e,{onProcessing:t=EE,onDataPage:n=EE}={}){d(e,{onProcessing:t,onData:e=>{r.setDataPages(e?[e]:[]),i.command.update(),n(e)}})}}var HE={inTotal:function({layoutService:e}){return e.meta.size.x},area:function({layoutService:e}){return{qTop:0,qHeight:1,qLeft:0,qWidth:e.meta.size.x}},scaleRange:function({layoutService:e,offsets:t,items:n,viewSize:r}){const{pixel:i}=t,o=e.getDataPages()[0],a=i/r;return[a,n.inView>=n.inTotal?a+1:a+o.qArea.qWidth/n.inView]}};var jE={inTotal:function({layoutService:e}){if(e.meta.isSnapshot&&!e.getLayoutValue("reducedHyperCube")){const[t]=e.getDataPages();if(t)return t.qArea.qHeight}return e.meta.size.y},area:function({layoutService:e,itemOffset:t,inView:n,areaBuffer:r}){const i=void 0===r?4:r,o=Math.max(0,Math.floor(t)-i/2);return{qTop:o,qHeight:Math.min(e.meta.size.y-o,Math.max(0,Math.ceil(n+i))),qLeft:0,qWidth:e.meta.size.x}},scaleRange:function({layoutService:e,offsets:t,items:n,viewSize:r}){const{pixel:i}=t,o=e.getDataPages()[0],a=r/n.inView,s=(i+o.qArea.qTop*a)/r;return[s,n.inView>=n.inTotal?s+1:s+o.qArea.qHeight/n.inView]}};function VE(e){const{groupSize:t,measureCount:n}=e.meta;return null!=t?t:n}function BE(e,t){const n=[];for(let r=0;r<e.length;r++){const i=t(e[r]);-1===n.indexOf(i)&&n.push(i)}return n.length}function UE(e){return BE(e.qMatrix,(e=>e[0].qElemNumber))-1}var YE={inTotal:function({layoutService:e}){const t=VE(e);return e.meta.size.y*t*(1+1/t)-1},area:function({layoutService:e,itemOffset:t,inView:n,areaBuffer:r}){const i=VE(e),o=void 0===r?i:r,a=t/(i+1),s=Math.max(0,Math.floor((t-a-o/2)/i));return{qTop:s,qHeight:Math.min(e.meta.size.y-s,Math.max(0,Math.ceil((n+o)/i+1))),qLeft:0,qWidth:e.meta.size.x}},scaleRange:function({layoutService:e,offsets:t,items:n,viewSize:r}){const i=VE(e),o=e.getDataPages()[0],a=r/n.inView,{pixel:s}=t,l=UE(o),u=o.qArea.qHeight*i+l,c=(s+(o.qArea.qTop*i+o.qArea.qTop)*a)/r;return[c,n.inView>=n.inTotal?c+1:c+u/n.inView]}};const WE=(e,t)=>t/(e.meta.size.y/e.meta.size.dimensions[0]+1),GE=(e,t)=>{const n={successful:!0,count:0};let r=Math.abs(Math.floor(t));const i=[];for(let t=0;t<=r;t++){if(!e[t])return n.successful=!1,n;const o=e[t][0].qElemNumber;-1===i.indexOf(o)&&(i.push(o),r--)}return n.count=i.length-1,n};function XE(e){return{itemOffset(t,n){if(0!==t.qArea.qTop)return WE(e,n);const r=GE(t.qMatrix,n);return r.successful?r.count:WE(e,n)},area(t,n,r){if(0!==t.qArea.qTop)return WE(e,n);return BE(t.qMatrix.slice(0,r.qTop+1),(e=>e[0].qElemNumber))-1}}}var KE={inTotal:function({layoutService:e}){return e.meta.size.y+e.meta.size.dimensions[0]-1},area:function({getDataPages:e,layoutService:t,itemOffset:n,inView:r}){const i=XE(t).itemOffset(e(),n),o=Math.max(0,Math.floor(n-i));return{qTop:o,qHeight:Math.min(t.meta.size.y-o,Math.max(0,Math.ceil(r+1))),qLeft:0,qWidth:t.meta.size.x}},scaleRange:function({getDataPages:e,layoutService:t,offsets:n,items:r,viewSize:i,upperBound:o}){const a=t.getDataPages()[0],s=i/r.inView,{item:l,pixel:u}=n,c=XE(t).area(e(),l,a.qArea),d=UE(a),m=a.qArea.qHeight+d,f=u===o?(r.inView-m)*s/i:(u+(a.qArea.qTop+c)*s)/i;return[f,r.inView>=r.inTotal?f+1:f+m/r.inView]}};function JE({chart:e,rect:t,dockService:n,itemWidths:r,axisKey:i,renderer:o,isGrouped:a,dimensionAxis:s,inTotal:l,isMajorLabelless:u,maxDataRows:c}){const{DEFAULT:d,SQUEEZE:m,LABELLESS:f}=r[n.meta.chart.mode],p="horizontal"===n.meta.major.orientation,{axisDisplayMode:h="auto",maxVisibleItems:y=10,label:g}=s,v=p?t.width:t.height,b=v/l>=m;switch(h){case"max":return Math.min(l,c);case"custom":return Math.min(y,c);default:return u?v/f:b?function({chart:e,isHorizontal:t,axisKey:n,renderer:r={},isGrouped:i,itemSize:o,label:a}){if(i||"auto"!==a&&"tilted"!==a)return!1;const s=e.component(n),{measureText:l}=r;if(!s||!l)return!0;const{fontFamily:u,fontSize:c,tiltAngle:d}=s.settings.settings.labels,{height:m}=l({fontFamily:u,fontSize:c,text:"M"});if(!t)return m>o;const f=(90-d)*(Math.PI/180);return m>Math.cos(f)*o}({chart:e,isHorizontal:p,axisKey:i,renderer:o,isGrouped:a,itemSize:m,label:g})?v/d:l:v/d}}function ZE({chart:e,getRect:t,getDataPages:n,layoutService:r,dockService:i,getItemWidths:o,axisKey:a,renderer:s,areaBuffer:l,rtl:u}){const{inTotal:c,area:d,scaleRange:m}=function({layoutService:e}){const{isDimensionless:t,isGrouped:n,isGroupedByMeasure:r}=e.meta;return t?HE:n?r?YE:KE:jE}({layoutService:r}),f=()=>"horizontal"===i.meta.major.orientation?t().width:t().height,p=e=>e?f()/e:0,h=(e,t)=>-(e-t)*p(t);return{getItems(){const n=r.getLayoutValue("dimensionAxis"),l=c({layoutService:r});return{inTotal:l,inView:JE({chart:e,rect:t(),dockService:i,itemWidths:o(),axisKey:a,renderer:s,isGrouped:r.meta.isGrouped,dimensionAxis:n,inTotal:l,isMajorLabelless:"none"===n.show||"title"===n.show,maxDataRows:Math.floor(CE/(r.meta.dimensionCount+r.meta.measureCount))})}},getItemSize({items:e}){const{inView:t}=e;return p(t)},getOffsets({pixelOffset:e,items:t}){const{inTotal:n,inView:r}=t,i=Math.min(0,Math.max(e,h(n,r))),o=r?Math.abs(r*i/f()):0;return{start:{pixel:i,item:o},end:{item:Math.min(o+(r||0),n)}}},getUpperBound({items:e}){const{inTotal:t,inView:n}=e;return h(t,n)},getViewRange({pixelOffset:e,items:t}){const{inTotal:n,inView:r}=t;return function({viewSize:e,inTotal:t,inView:n,pixelOffset:r}){const i=e/n*t,o=Math.abs(r)/i;return[o,Math.min(1,o+e/i)]}({viewSize:f(),inTotal:n,inView:r,pixelOffset:e})},getArea:({itemOffset:e,items:t})=>d({getDataPages:n,layoutService:r,itemOffset:e,inView:t.inView,areaBuffer:l}),getScaleRange({offsets:e,items:t}){const o=m({getDataPages:n,layoutService:r,offsets:e,items:t,viewSize:f(),upperBound:h(t.inTotal,t.inView)});return"horizontal"===i.meta.major.orientation&&u?function(e){return[1-e[1],1-e[0]]}(o):o},validate:{offset({pixelOffset:e,items:t}){const{inTotal:n,inView:r}=t;return e<=0&&e>=h(n,r)}},convert:{itemToPixelOffset({itemOffset:e,items:t}){const{inView:n}=t,r=e*p(n);return Number.isFinite(r)?-r:0},relativeToPixelOffset({relativeOffset:e,items:t}){const{inTotal:n,inView:r}=t;return-e*(p(r)*n)}}}}function QE({chart:e,componentKey:t,state:n,dataStore:r,pageData:i,layoutService:o,dockService:a,itemWidths:s,getRect:l,axisKey:u,renderer:c,areaBuffer:d,viewState:m,rtl:f}){n.set("rect",{width:0,height:0}),n.set("itemWidths",{}),n.set("itemSize",0),n.set("items",{}),n.set("offsets",{}),n.set("finished",0),n.set("scaleRange",[0,1]);const p=ZE({chart:e,getRect:()=>n.get("rect"),getDataPages:r.getCurrent,layoutService:o,dockService:a,getItemWidths:()=>n.get("itemWidths"),axisKey:u,renderer:c,areaBuffer:d,rtl:f}),h=()=>{const e=p.getItems();return n.set("items",e),e},y=({pixelOffset:e,items:t})=>{const r=p.getOffsets({pixelOffset:e,items:t});return n.set("offsets",r),r},g=e=>{const t=Date.now(),r=h(),a=y({pixelOffset:e,items:r}),s=p.getArea({itemOffset:a.start.item,items:r});if((e=>{const[{qArea:t}]=o.getDataPages();return!!t&&Object.keys(e).every((n=>e[n]===t[n]))})(s))return void((p.validate.offset({pixelOffset:e,items:r})||m.get("scrollOffset").start!==a.start.item)&&(n.set("finished",t),n.set("scaleRange",p.getScaleRange({offsets:a.start,items:r})),m.preventSet("viewRange",p.getViewRange({pixelOffset:a.start.pixel,items:r})),m.set("scrollOffset",{start:a.start.item,end:a.end.item})));m.preventSet("viewRange",p.getViewRange({pixelOffset:a.start.pixel,items:r}));const l=()=>{n.get("finished")>t||(n.set("finished",t),n.set("scaleRange",p.getScaleRange({offsets:a.start,items:r})),m.set("scrollOffset",{start:a.start.item,end:a.end.item}))};i(s,{onProcessing:l,onDataPage:l})};return{enabled(){const{inTotal:e,inView:t}=n.get("items");return e>t},itemSize:()=>n.get("itemSize"),scaleRange:()=>n.get("scaleRange"),initialize(){const r=e.component(t);if(!r)return Promise.resolve();n.set("rect","function"==typeof l?l():r.rect),n.set("itemWidths","function"==typeof s?s():s);const a=h();n.set("itemSize",p.getItemSize({items:a}));const u=(({items:e})=>{const t=o.getLayoutValue("scrollStartPos"),n=m.get("scrollOffset");if(void 0===n)return 1===t?p.getUpperBound({items:e}):0;if("number"==typeof n)return p.convert.itemToPixelOffset({itemOffset:n,items:e});const{start:r,end:i}=n,a=1===t&&i?i-e.inView:r;return p.convert.itemToPixelOffset({itemOffset:a,items:e})})({items:a}),c=y({pixelOffset:u,items:a});m.preventSet("viewRange",p.getViewRange({pixelOffset:c.start.pixel,items:a}));const d=p.getArea({itemOffset:c.start.item,items:a});return new Promise((e=>{i(d,{onDataPage:()=>{n.set("scaleRange",p.getScaleRange({offsets:c.start,items:a})),m.preventSet("scrollOffset",{start:c.start.item,end:c.end.item}),e()}})}))},scroll(e){const t=n.get("offsets").start.pixel+e;g(t)},scrollToRelative(e){const t=n.get("items"),r=p.convert.relativeToPixelOffset({relativeOffset:e,items:t});g(r)}}}function eC({chart:e,actions:t,componentKey:n,enigmaModel:r,layoutService:i,dockService:o,trendLineModel:a,itemWidths:s,viewState:l,rtl:u,options:{definitionPath:c="/qHyperCubeDef",getRect:d,axisKey:m,renderer:f,areaBuffer:p,processDataPage:h=(()=>{})}={}}){const y=Yl(),g=function({qMode:e}){switch(e){case"S":default:return IE;case"K":return wE;case"T":return TE}}({qMode:i.getHyperCubeValue("qMode")}),v=function({state:e,contains:t}){return e.set(NE,[]),{add:t=>{const n=e.get(NE);n.length=0,n.push(t)},getCurrent:()=>e.get(NE)[0],getAll:()=>e.get(NE),contains:n=>t(e.get(NE)[0],n)}}({state:y,contains:g.contains});!function({layoutService:e,dataStore:t,composition:n}){const r=e.getDataPages()[0];if(!r)return;const i=n.patcher({layoutService:e});i.should(r)&&i(r),t.add(r)}({layoutService:i,dataStore:v,composition:g});const b=function({buffer:e}){return void 0===e?void 0:2*Math.round(e/2)}({buffer:p}),x=$E({dataStore:v,composition:g,enigmaModel:r,layoutService:i,trendLineModel:a,definitionPath:c,processDataPage:h}),S=QE({chart:e,componentKey:n,state:y,dataStore:v,pageData:x,layoutService:i,dockService:o,itemWidths:s,getRect:d,axisKey:m,renderer:f,areaBuffer:b,viewState:l,rtl:u}),M=function({layoutService:e,dataStore:t}){return function(n){const r=Vl(n,`${e.refs.dataPages}`);r.length=0,r.push(t.getCurrent())}}({layoutService:i,dataStore:v}),E=function({chart:e,actions:t,componentKey:n,dockService:r,rtl:i,scroller:o}){return{gestures:[RE({chart:e,actions:t,componentKey:n,dockService:r,rtl:i,scroller:o})],native:{type:"native",events:{wheel:PE({chart:e,actions:t,componentKey:n,scroller:o})}}}}({chart:e,actions:t,componentKey:n,dockService:o,rtl:u,scroller:S});return{interactions:E,query:{getCanScroll:()=>S.enabled(),getItemSize:()=>S.itemSize(),getScaleRange:()=>S.scaleRange(),getCurrentDataPage:()=>v.getCurrent()},command:{initialize:()=>S.initialize(),scrollTo:e=>S.scrollToRelative(e),setSnapshotData:e=>M(e)}}}var tC={SPARK:{DEFAULT:7,SQUEEZE:7,LABELLESS:7},XSMALL:{DEFAULT:28,SQUEEZE:24,LABELLESS:20},SMALL:{DEFAULT:28,SQUEEZE:24,LABELLESS:20},MEDIUM:{DEFAULT:28,SQUEEZE:24,LABELLESS:20},FULL:{DEFAULT:28,SQUEEZE:24,LABELLESS:20}};function nC({layoutService:e,key:t}){const{style:n}=e.getLayoutValue("components",[]).filter((e=>e.key===t))[0]||{};return({property:r,defaultValue:i,index:o})=>{const a=n&&Object.hasOwnProperty.call(n,r)?n[r]:i;if(void 0===o)return a;const{style:s}=e.getHyperCubeValue((e=>`qMeasureInfo.${e}.styling`)(o),[]).filter((e=>e.key===t))[0]||{};return s&&Object.hasOwnProperty.call(s,r)?s[r]:a}}function rC({layoutService:e,dockService:t,themeService:n,flags:r}){const{BAR:i,LINE:o,POINT:a}=hp,s=n.getStyles(),l=nC({layoutService:e,key:"bar"}),u=nC({layoutService:e,key:"line"}),c=()=>{const e=l({property:"strokeWidth",defaultValue:"none"});return e?i.STROKE.WIDTH[e.toUpperCase()]:0},d=t=>r.isEnabled("CLIENT_IM_3050")?e.getLayoutValue("components",[]).find((e=>e.key===t)):void 0;return{query:{bar:{getHasStyling:()=>!!e.getLayoutValue("components",[]).filter((e=>"bar"===e.key)).length,getWidthFn:()=>()=>l({property:"width",defaultValue:.7}),getHasStrokeWidth:()=>!!c(),getStrokeWidth:()=>c(),getStrokeColor:()=>l({property:"strokeColor",defaultValue:{index:-1,color:i.STROKE.COLOR}}).color,label:{getStyle:()=>{var e,t,n,r,i,o,a,l,u,c,m,f,p,h,y,g,v,b,x,S,M;return{fill:null!==(e=null===(t=d("bar"))||void 0===t||null===(n=t.bar)||void 0===n||null===(r=n.label)||void 0===r||null===(i=r.value)||void 0===i||null===(o=i.color)||void 0===o?void 0:o.color)&&void 0!==e?e:s.label.value.color,useContrastColor:null===(a=null===(l=d("bar"))||void 0===l||null===(u=l.bar)||void 0===u||null===(c=u.label)||void 0===c||null===(m=c.value)||void 0===m?void 0:m.useContrastColor)||void 0===a||a,fontSize:null!==(f=null===(p=d("bar"))||void 0===p||null===(h=p.bar)||void 0===h||null===(y=h.label)||void 0===y||null===(g=y.value)||void 0===g?void 0:g.fontSize)&&void 0!==f?f:s.label.value.numFontSize,fontFamily:null!==(v=null===(b=d("bar"))||void 0===b||null===(x=b.bar)||void 0===x||null===(S=x.label)||void 0===S||null===(M=S.value)||void 0===M?void 0:M.fontFamily)&&void 0!==v?v:s.label.value.fontFamily}}}},line:{getCurveFn:()=>(e,t)=>u({property:"lineCurve",defaultValue:o.CURVE.LINEAR,index:t}),getStrokeWidthFn:()=>(e,n)=>u({property:"lineThickness",defaultValue:"FULL"===t.meta.chart.mode?o.WIDTH.FULL.DEFAULT:o.WIDTH.LESS.DEFAULT,index:n}),getStrokeDasharrayFn:()=>(e,t)=>{const n=u({property:"lineType",defaultValue:o.TYPE.SOLID,index:t});return n&&o.TYPE[n.toUpperCase()]}},point:{getSize:e=>u({property:"dataPointSize",defaultValue:a.SIZE.DEFAULT,index:e}),label:{getStyle:()=>{var e,t,n,r,i,o,a,l,u,c,m,f,p,h,y,g;return{fill:null!==(e=null===(t=d("line"))||void 0===t||null===(n=t.line)||void 0===n||null===(r=n.label)||void 0===r||null===(i=r.value)||void 0===i||null===(o=i.color)||void 0===o?void 0:o.color)&&void 0!==e?e:s.label.value.color,fontSize:null!==(a=null===(l=d("line"))||void 0===l||null===(u=l.line)||void 0===u||null===(c=u.label)||void 0===c||null===(m=c.value)||void 0===m?void 0:m.fontSize)&&void 0!==a?a:s.label.value.fontSize,fontFamily:null!==(f=null===(p=d("line"))||void 0===p||null===(h=p.line)||void 0===h||null===(y=h.label)||void 0===y||null===(g=y.value)||void 0===g?void 0:g.fontFamily)&&void 0!==f?f:s.label.value.fontFamily}}}},axis:{title:{getStyle:()=>{var e,t,n,r,i,o,a,l,u,c,m,f,p;return{fontFamily:null!==(e=null===(t=d("axis"))||void 0===t||null===(n=t.axis)||void 0===n||null===(r=n.title)||void 0===r?void 0:r.fontFamily)&&void 0!==e?e:s.axis.title.fontFamily,fontSize:null!==(i=null===(o=d("axis"))||void 0===o||null===(a=o.axis)||void 0===a||null===(l=a.title)||void 0===l?void 0:l.fontSize)&&void 0!==i?i:s.axis.title.fontSize,color:null!==(u=null===(c=d("axis"))||void 0===c||null===(m=c.axis)||void 0===m||null===(f=m.title)||void 0===f||null===(p=f.color)||void 0===p?void 0:p.color)&&void 0!==u?u:s.axis.title.color}}},label:{getStyle:()=>{var e,t,n,r,i,o,a,l,u,c,m,f,p,h,y,g;return{fill:null!==(e=null===(t=d("axis"))||void 0===t||null===(n=t.axis)||void 0===n||null===(r=n.label)||void 0===r||null===(i=r.name)||void 0===i||null===(o=i.color)||void 0===o?void 0:o.color)&&void 0!==e?e:s.axis.label.name.color,fontSize:null!==(a=null===(l=d("axis"))||void 0===l||null===(u=l.axis)||void 0===u||null===(c=u.label)||void 0===c||null===(m=c.name)||void 0===m?void 0:m.fontSize)&&void 0!==a?a:s.axis.label.name.fontSize,fontFamily:null!==(f=null===(p=d("axis"))||void 0===p||null===(h=p.axis)||void 0===h||null===(y=h.label)||void 0===y||null===(g=y.name)||void 0===g?void 0:g.fontFamily)&&void 0!==f?f:s.axis.label.name.fontFamily}}}},legend:{title:{getStyle:()=>{var e,t,n,r,i,o,a,l,u,c,m,f,p;return{fontFamily:null!==(e=null===(t=d("legend"))||void 0===t||null===(n=t.legend)||void 0===n||null===(r=n.title)||void 0===r?void 0:r.fontFamily)&&void 0!==e?e:s.legend.title.fontFamily,fontSize:null!==(i=null===(o=d("legend"))||void 0===o||null===(a=o.legend)||void 0===a||null===(l=a.title)||void 0===l?void 0:l.fontSize)&&void 0!==i?i:s.legend.title.fontSize,color:null!==(u=null===(c=d("legend"))||void 0===c||null===(m=c.legend)||void 0===m||null===(f=m.title)||void 0===f||null===(p=f.color)||void 0===p?void 0:p.color)&&void 0!==u?u:s.legend.title.color}}},label:{getStyle:()=>{var e,t,n,r,i,o,a,l,u,c,m,f,p;return{fontFamily:null!==(e=null===(t=d("legend"))||void 0===t||null===(n=t.legend)||void 0===n||null===(r=n.label)||void 0===r?void 0:r.fontFamily)&&void 0!==e?e:s.legend.label.fontFamily,fontSize:null!==(i=null===(o=d("legend"))||void 0===o||null===(a=o.legend)||void 0===a||null===(l=a.label)||void 0===l?void 0:l.fontSize)&&void 0!==i?i:s.legend.label.fontSize,color:null!==(u=null===(c=d("legend"))||void 0===c||null===(m=c.legend)||void 0===m||null===(f=m.label)||void 0===f||null===(p=f.color)||void 0===p?void 0:p.color)&&void 0!==u?u:s.legend.label.color}}}}}}}function iC({dataset:e,data:t,valueData:n}){var r;const{source:i,label:o,value:a}=n,s=e(i.key).field(i.field);return oe.shouldUseFormat(s.raw())?"-"===o||""===a||Number.isNaN(a)||"NaN"===a||null!==(r=t.null)&&void 0!==r&&r.value?"-":s.formatter()(a):o}function oC({chart:e,actions:t,translator:n,rtl:r,dockService:i,seriesModel:o,colorService:a,themeService:s,propertiesModel:l,custom:u}){const c=s.getStyles(),d=({data:e})=>e.major.value,m=({data:e})=>!e.null.value||0===e.end.value,{SLICED_HAT:f}=xm.COMPONENT,{PRIMARY:p,SECONDARY:h}=Sm.AXIS,y=function({dockService:e,seriesModel:t}){const{AXIS:n,BAR_OOB:r,DATA_OOB_MARKER:i,SLICED_HAT:o}=xm.COMPONENT,{PRIMARY:a,SECONDARY:s}=Sm.AXIS,{orientation:l}=e.meta.chart,u="vertical"===l,c=[...t.meta.barComponentKeys,...t.meta.markerComponentKeys,...t.meta.pointComponentKeys];return[({chart:e,hovered:t,meta:l})=>{const[d]=t,{triggerer:m}=l,f=m===n.MAJOR?d.data.value:d.data.major.value;if(u){const t=e.findShapes("container").find((e=>(e.key===`${o}-max-${a}`||e.key===`${o}-max-${s}`)&&e.data&&e.data.value===f&&e.children.length));if(t)return{key:t.key,bounds:t.bounds}}const p=e.findShapes("path").find((e=>(e.key===`${r}-max-${a}`||e.key===`${r}-max-${s}`||e.key===`${i}-max`)&&e.data.major.value===f));if(u&&p)return{key:p.key,bounds:p.bounds};const h=e.findShapes("path").find((e=>(e.key===`${r}-min-${a}`||e.key===`${r}-min-${s}`||e.key===`${i}-min`)&&e.data.major.value===f)),y=e.findShapes("*").filter((e=>c.indexOf(e.key)>-1&&e.data&&e.data.major.value===f));if(u&&h&&!y.find((e=>e.data.end.source.field!==h.data.end.source.field)))return{key:h.key,bounds:h.bounds};const g=p||h;return!(u||!g||y.find((e=>e.data.end.source.field!==g.data.end.source.field)))&&{key:g.key,bounds:g.bounds}},"collectible"]}({dockService:i,seriesModel:o});return Jd({chart:e,translator:n,config:{rtl:r,enable:()=>t.tooltip.enabled(),getColorSettings:()=>a.getSettings(),style:{fontFamily:c.fontFamily},main:{key:xm.COMPONENT.TOOLTIP,getGroupByValue:d,collectibles:[...o.meta.barComponentKeys.map((e=>({key:e,type:"bar",major:d}))),...o.meta.pointComponentKeys.map((e=>({key:e,type:"point",major:d}))),...o.meta.markers.map((e=>({key:e.key,type:e.type,major:d})))],triggers:[{keys:[xm.COMPONENT.AXIS.MAJOR],collect:{from:"dimension",by:({data:e})=>e.value,filter:m},placement:y},{keys:[...o.meta.barComponentKeys,...o.meta.markerComponentKeys,`${f}-max-${p}`,`${f}-max-${h}`,`${f}-min-${p}`,`${f}-min-${h}`,`${xm.COMPONENT.BAR_OOB}-max-${p}`,`${xm.COMPONENT.BAR_OOB}-max-${h}`,`${xm.COMPONENT.BAR_OOB}-min-${p}`,`${xm.COMPONENT.BAR_OOB}-min-${h}`,`${xm.COMPONENT.DATA_OOB_MARKER}-max`,`${xm.COMPONENT.DATA_OOB_MARKER}-min`],collect:{from:"dimension",by:d,filter:m},placement:y},{keys:[...o.meta.pointComponentKeys],distance:3,collect:{from:"dimension",by:d,filter:m},placement:y}],section:({h:e,nodes:t,dataset:n,create:r,util:i})=>{const[o]=t,{title:a,description:s,measures:l}=u.isEnabled()?u.getAttributes({dataset:n,nodes:[o]}):{},c=[];a&&c.push(r.text({value:a,style:{bold:!0}})),s&&c.push(r.text({value:s}));const d=u.hideBasic();d&&!l.length&&(a||s)||c.push(r.text({value:o.data.label,style:{bold:!0}})),d||(c.push(r.color({nodes:t,property:xm.SCALE.COLOR})),c.push(...t.map((e=>{const{segment:t,end:o}=e.data,a=t||o,{key:s,field:l}=a.source;return r.measure({label:i.dataset.title(s,l),value:iC({dataset:n,data:e.data,valueData:a})})})))),l&&c.push(...l.map((e=>r.measure({label:e.label,value:e.value,survive:{color:!0,duplicate:!0}})))),u.chart.isEnabled()&&(u.chart.hasLimitation()?(u.chart.destroy(),c.push(r.raw({value:u.chart.createLimitationRow()}))):c.push(r.raw({value:u.chart.createContainer({h:e})})));const{customTooltipImages:m}=o.data;return u.isEnabled()&&m&&c.push(...m.map((t=>r.raw({value:u.createImageRow({value:t,h:e})})))),c},layout:{grouping:!0,single:()=>!(!u.isEnabled()||!u.hasImages())||u.chart.isEnabled()},events:{tooltip:{beforeShow:({collectNodes:e})=>u.isEnabled()&&u.hasImages()?u.addImages({nodes:e()}):Promise.resolve(),afterShow:({nodes:e})=>{u.chart.isEnabled()&&!u.chart.hasLimitation()&&u.chart.show({nodes:e,properties:l.query.getProperties()})}},interaction:{mouseleave:()=>{u.chart.isEnabled()&&u.chart.hasAlternateState()&&u.chart.hide()}}}},legend:{keys:{tooltip:xm.COMPONENT.LEGEND_TOOLTIP,component:xm.COMPONENT.LEGEND_CATEGORICAL}}}})}const{model:aC}=vg,sC=({picasso:e,chart:d,environment:m,flags:f,viewState:p,viewCache:h,actions:y,selectionService:g})=>{const v=o(),{width:b,height:x}=r(),[S,M]=t(),[E,C]=t(),q=a(),A=s(),O=l(),D=u(),I=c();n((()=>{if(!(v&&null!=d&&d.update&&m&&p))return;const t=function(e){var t=e.source,n=e.metaAdditionsFn,r=e.experimental,i=void 0===r?{filter:!1}:r,o=ts(!0,{},t),a=i.filter?function(e){var t=e.qHyperCube,n=Kl(t,Xl.DIMENSION),r=n.reduced,i=n.filtered;t[Xl.DIMENSION]=r;var o=Kl(t,Xl.MEASURE),a=o.reduced,s=o.filtered;return t[Xl.MEASURE]=a,{dimensions:i,measures:s}}(o):{dimensions:[],measures:[]},s=Zl(o),l=function(){var e=function(e){var t=e.layout,n=e.additionsFn,r=void 0===n?function(){return{}}:n,i=e.additionsProps,o=void 0===i?{}:i,a=t.qHyperCube,s=a.qDimensionInfo,l=a.qMeasureInfo,u=a.qMode,c=s.length,d=l.length,m=Pa({mode:{S:"S"===u,P:"P"===u,K:"K"===u,T:"T"===u},dimensionCount:c,measureCount:d,hasMultipleDimensions:c>1,hasMultipleMeasures:d>1,isOneDimensional:1===c,isTwoDimensional:2===c},o);return Pa(Pa({},m),r({layout:t,meta:m}))}({layout:o,additionsFn:n,additionsProps:{size:s.size}});return e.filteredFields=a,e},u={refs:Pa({},s.refs),meta:l(),getLayout:function(){return o},getLayoutValue:function(e,t){return Vl(o,e,t)},setLayoutValue:function(e,t){Ul(o,e,t),s=Zl(o),u.meta=l()},getHyperCube:function(){return o.qHyperCube},getHyperCubeValue:function(e,t){return Vl(o.qHyperCube,e,t)},setHyperCubeValue:function(e,t){Ul(o.qHyperCube,e,t),s=Zl(o),u.meta=l()},getDataPages:function(){return Vl(o,s.refs.dataPages)},setDataPages:function(e){Ul(o,s.refs.dataPages,e),u.meta=l()}};return u}({source:v,metaAdditionsFn:function({layout:e}){var t,n,r;const i=Vl(e,"qHyperCube.qMeasureInfo",[]),o=i.some((({series:e=Sm.NOPE_SERIES})=>Fh(e)===Sm.TYPE.LINE)),a=ue.continuous(e,(()=>o&&re.isTime(!0,e))),s=!UM(Vl(e,"version","")),l=i.filter((({series:e=Sm.NOPE_SERIES})=>Fh(e)===Sm.TYPE.BAR)),u=l.length,c=l.filter((({series:e=Sm.NOPE_SERIES})=>e.axis!==Sm.AXIS.SECONDARY)).length,d=l.filter((({series:e=Sm.NOPE_SERIES})=>e.axis===Sm.AXIS.SECONDARY)).length,m=s?c>1||d>1:u>1,f=("grouped"!==Vl(e,"barGrouping.grouping")||a)&&m,p=!f&&u>1,h=s&&f&&(c>0&&d>1||c>1&&d>0),y=!(null==e||null===(t=e.qHyperCube)||void 0===t||null===(n=t.qDimensionInfo)||void 0===n||null===(r=n[0])||void 0===r||!r.qLocked);return{canBeContinuous:re.canBeContinuous(e),isDiscrete:!a,isContinuous:a,isTime:re.isTime(a,e),isSnapshot:ue.snapshot(e),isBarSeriesStacked:f,isBarSeriesGrouped:p,isBarSeriesStackedInBothAxis:h,isGrouped:p||h,isGroupedByMeasure:p||h,isDimensionLocked:y,groupSize:h?2:u,hasLineSeries:o}}}),{options:n,translator:r}=m,{direction:i,viewState:o={}}=n,a="rtl"===i,{legendScrollOffset:s,scrollOffset:l}=t.meta.isSnapshot?t.getLayoutValue("snapshotData.content.chartData",{}):o;p.preventSet("scrollOffset",l),p.preventSet("legendScrollOffset",s),p.preventSet("title",t.getLayoutValue("title"));const u=function({genericObjectModel:e,layoutService:t}){const n={cube:void 0,on:!1},r=XM({genericObjectModel:e,layoutService:t});return{query:{getCube:()=>n.cube,getIsReduced:()=>n.on},command:{initialize:()=>r().then((({reducedCube:e})=>{n.cube=e,n.on=!!(n.cube&&n.cube.qDataPages[0]&&n.cube.qDataPages[0].qIsReduced)})),setSnapshotData:e=>{e.reducedHyperCube=n.cube}}}}({genericObjectModel:q,layoutService:t}),c=jl({chart:d,layoutService:t,config:{logicalSize:{width:b,height:x},rtl:a},typeConfig:{type:"major-minor",fallback:"vertical",invert:!0,measureAxes:[{ref:"measureAxes.0",name:"minor"},{ref:"measureAxes.1",name:"minorSecondary"}]}}),S=YM({layoutService:t,flags:f}),E=t.meta.isDiscrete?function({chart:e,genericObjectModel:t,layoutService:n,dockService:r,seriesModel:i,viewState:o,rtl:a,actions:s,picasso:l}){return eC({chart:e,actions:s,componentKey:bg(i),enigmaModel:t,layoutService:n,dockService:r,viewState:o,rtl:a,itemWidths:tC,options:{axisKey:xm.COMPONENT.AXIS.MAJOR,renderer:l.renderer("svg")()}})}({chart:d,genericObjectModel:q,layoutService:t,dockService:c,seriesModel:S,viewState:p,rtl:"rtl"===m.options.direction,actions:y,picasso:e}):void 0,C=t.meta.isContinuous?aC({model:q,layoutService:t,viewState:p,viewCache:h}):void 0,w=function(e){var t=e.theme,n=e.config,r=void 0===n?{}:n,i=r.id,o=r.resolve,a=void 0===o?[]:o,s=r.transform,l=void 0===s?[]:s,u=r.extend,c=void 0===u?[]:u,d={theme:t,matrix:yd(a),styles:void 0};return d.styles=vd({theme:t,id:i,transform:l,extend:c,matrix:d.matrix}),{getStyles:function(){return d.styles},getTheme:function(){return d.theme},setTheme:function(e){d.theme=e,d.styles=vd({theme:e,id:i,transform:l,extend:c,matrix:d.matrix})}}}({theme:m.theme,config:{id:"comboChart",resolve:[["object","label.value","numFontSize","12px",e=>parseInt(e,10)]]}}),T=rC({layoutService:t,dockService:c,themeService:w,flags:f}),N=SE({actions:y,appLayoutModel:O,appModel:A,chart:d,environment:m,flags:f,genericObjectModel:q,layoutService:t,picasso:e,seriesModel:S,viewState:p,styleModel:T}),L=function({layoutService:e,seriesModel:t}){const{isContinuous:n}=e.meta,r="qDimensionInfo/0",i=`${r}:numeric`,o=t.meta.primarySeries.map((e=>e.ref)),a=t.meta.secondarySeries.map((e=>e.ref)),s=n?[{key:i,from:r,override:{value:e=>e.qNum}}]:void 0;return{main:{major:r,majorNumeric:i,minorsPrimary:o,minorsSecondary:a},virtuals:s}}({layoutService:t,seriesModel:S}),k=QM({isPrimary:!0,layoutService:t,reducedModel:u,seriesModel:S,continuousModel:C,flags:f}),R=QM({isPrimary:!1,layoutService:t,reducedModel:u,seriesModel:S,continuousModel:C,flags:f}),P=gE({config:{measureAxesRef:"measureAxes.0",formatter:xm.FORMATTER.PRIMARY},chart:d,layoutService:t,extremumModel:k,dockService:c,seriesModel:S,themeService:w}),F=gE({config:{measureAxesRef:"measureAxes.1",formatter:xm.FORMATTER.SECONDARY},chart:d,layoutService:t,extremumModel:R,dockService:c,seriesModel:S,themeService:w}),z=vE({genericObjectModel:q,layoutService:t}),_=Hm({flags:f,layout:v,app:A,model:q,picasso:e,chart:d,translator:r,localeInfo:O.qLocaleInfo,embed:I,options:n}),$=oC({chart:d,actions:y,translator:r,rtl:a,dockService:c,seriesModel:S,colorService:N,themeService:w,propertiesModel:z,custom:_}),H=bm({layoutService:t,discreteModel:E}),j=function(e){return{layout:e.getLayout(),keys:{SCALE:{MAJOR:xm.SCALE.MAJOR,MAJOR_INNER:xm.SCALE.MAJOR_INNER,MINOR:{PRIMARY:xm.SCALE.MINOR.PRIMARY,SECONDARY:xm.SCALE.MINOR.SECONDARY}},COMPONENT:{BAR_PRIMARY:`${xm.COMPONENT.BAR}-${Sm.AXIS.PRIMARY}`,BAR_SECONDARY:`${xm.COMPONENT.BAR}-${Sm.AXIS.SECONDARY}`,AXIS:{MAJOR:xm.COMPONENT.AXIS.MAJOR,MAJOR_CONTINUOUS:xm.COMPONENT.AXIS.MAJOR_CONTINUOUS,TIME_INNER:xm.COMPONENT.AXIS.TIME_INNER,MINOR:{PRIMARY:xm.COMPONENT.AXIS.MINOR.PRIMARY,SECONDARY:xm.COMPONENT.AXIS.MINOR.SECONDARY}},AXIS_TITLE:{MAJOR:xm.COMPONENT.AXIS_TITLE.MAJOR,MINOR:{PRIMARY:xm.COMPONENT.AXIS_TITLE.MINOR.PRIMARY,SECONDARY:xm.COMPONENT.AXIS_TITLE.MINOR.SECONDARY}}},COLLECTION:{MAIN:xm.COLLECTION.MAIN}}}}(t),V=function(e){var t=e.picassoInstance,n=e.plugins,r=e.pluginArgs,i=void 0===r?{}:r,o={initialized:!1,definitions:[]};return{initialize:function(){return $a(Fa().mark((function e(){var r,a,s,l;return Fa().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!o.initialized){e.next=2;break}return e.abrupt("return");case 2:return a=Promise.all(n.filter((function(e){return"custom-component"===e.info.type})).map(function(){var e=$a(Fa().mark((function e(n){var r;return Fa().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.info.componentName){e.next=2;break}throw new Error("plugin-service: Custom component is missing componentName");case 2:return e.next=4,n.fn(Pa({},i));case 4:if("object"===za(r=e.sent)){e.next=7;break}throw new Error("plugin-service: Custom component needs to be an object");case 7:t.component(n.info.componentName,r);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())),s=Promise.all(n.filter((function(e){return"component-definition"===e.info.type})).map((function(e){return e.fn(Pa({},i))}))),e.next=6,Promise.all([a,s]);case 6:l=e.sent,o.initialized=!0,(r=o.definitions).push.apply(r,Ba(l[1]));case 9:case"end":return e.stop()}}),e)})))()},extendComponents:function(e){return o.initialized?(o.definitions.filter(Boolean).forEach((function(t){var n=Va(e.filter((function(e){return e.key&&e.key===t.key})),1)[0];if(n){var r=ts(!0,{},n.brush);ts(!0,n,t),t.brush&&(n.brush=function(e,t){return"object"===za(e)&&Object.keys(e).length?(Array.isArray(t.consume)&&(e.consume=Ql({originalArray:e.consume,newArray:t.consume,matchKey:"context"})),Array.isArray(t.trigger)&&(e.trigger=Ql({originalArray:e.trigger,newArray:t.trigger,matchKey:"on"})),e):t}(r,t.brush))}else e.push(t)})),e):e}}}({picassoInstance:e,plugins:D,pluginArgs:j});M({selectionService:g,genericObjectModel:q,appModel:A,dockService:c,styleModel:T,layoutService:t,fieldModel:L,seriesModel:S,reducedModel:u,primaryExtremumModel:k,secondaryExtremumModel:R,primaryTickModel:P,secondaryTickModel:F,propertiesModel:z,colorService:N,themeService:w,appLayoutModel:O,tooltipService:$,flags:f,...E&&{discreteModel:E},...C&&{continuousModel:C},refLineModel:H,pluginService:V})}),[v,q,A,O,m,null==d?void 0:d.update,p]);const[,w]=i((()=>{if(!S)return Promise.resolve();const{layoutService:e,colorService:t,reducedModel:n,primaryExtremumModel:r,secondaryExtremumModel:i,propertiesModel:o,continuousModel:a,discreteModel:s,pluginService:l}=S,u=a?()=>{var t,n;a.update(e.getLayout());const r=a.initialFetch(),i=!e.meta.isSnapshot&&(null==m||null===(t=m.options)||void 0===t||null===(n=t.viewState)||void 0===n?void 0:n.zoom);return i&&p.preventSet("zoom",i),r}:()=>Promise.resolve(),c=t.initialize().then((()=>{const e=t.getSettings().field;g&&g.setBrushAliases({colorField:e}),t.custom.updateLegend()}));return Promise.all([l.initialize(),n.command.initialize(),q?o.command.initialize():Promise.resolve(),c,u(),y.scroll.attachDiscreteModel(s)]).then((()=>Promise.all([r.command.initialize(),i.command.initialize()]).then((()=>C(S)))))}),[S]);if(w)throw w;return E};function lC(){const[e,r]=t();return n((()=>{r(function(e){var t=Pa({},e),n={},r={},i=!1,o={get:function(e){return t[e]},set:function(e,o){var a=t[e];!i&&n[e]?t[e]=n[e](o,a):t[e]=o,!i&&r[e]&&r[e](t[e],a)},preventSet:function(e,t){i=!0,o.set(e,t),i=!1},intercept:function(e,t){n[e]=t},onChanged:function(e,t){r[e]=t}};return o}({viewRange:[0,1],scrollOffset:void 0}))}),[]),e}const uC={shapes:[{type:"path",attrs:{d:"M15.9488039,5.20769129 C16.0487326,6.70662306 15.3492311,8.30548361 14.050157,9.30477145 C12.651154,10.5039169 10.8524359,10.8037032 8.85386017,10.4039881 L7.3549284,10.0042729 L5.75606786,9.70448659 C5.75606786,9.90434416 5.65613907,10.0042729 5.4562815,10.2041305 C5.05656637,10.6038456 4.55692244,10.8037032 4.05727852,10.8037032 C3.75749217,10.8037032 3.45770582,10.7037744 3.15791946,10.6038456 C3.05799068,10.903632 3.15791946,11.2034184 3.45770582,11.7030623 C5.05656637,14.0014243 3.85742095,15.9000712 3.75749217,16 L2.2585604,15.3004985 C2.2585604,15.2005697 2.95806189,14.0014243 1.95877405,12.6024213 C1.6589877,12.0028486 1.15934378,11.0035608 1.55905891,10.0042729 C1.6589877,9.80441537 1.75891648,9.6045578 1.95877405,9.40470024 C1.6589877,8.90505631 1.55905891,8.30548361 1.85884527,7.7059109 C1.55905891,7.40612455 1.25927256,7.1063382 1.15934378,6.70662306 C0.859557424,5.90719279 0.959486209,4.5081898 1.6589877,3.30904439 C1.95877405,2.6095429 2.55834676,2.0099702 3.15791946,1.51032628 C3.95734974,0.91075357 4.95663758,0.610967217 6.15578299,0.311180864 C9.05371774,-0.388320626 11.9516525,0.111323295 13.9502282,1.61025506 C15.1493736,2.50961412 15.8488751,3.80868831 15.9488039,5.20769129 Z M13.0508691,8.10562604 C13.8502994,7.40612455 14.3499433,6.40683671 14.3499433,5.30762008 C14.2500145,4.20840345 13.550513,3.40897318 12.9509403,2.90932926 C12.1515101,2.40968533 11.252151,2.0099702 10.1529344,1.81011263 C8.95378895,1.61025506 7.75464354,1.71018384 6.45556935,1.91004141 C4.75678001,2.30975655 3.65756338,3.00925804 3.05799068,4.10847467 C2.55834676,5.00783373 2.65827554,5.90719279 2.75820433,6.20697914 C2.75820433,6.30690792 2.85813311,6.40683671 3.05799068,6.40683671 C3.15791946,6.40683671 3.25784825,6.40683671 3.35777703,6.40683671 C3.45770582,6.40683671 3.45770582,6.40683671 3.45770582,6.40683671 L3.5576346,6.40683671 L3.65756338,6.40683671 C4.65685123,6.40683671 5.4562815,6.90648063 5.85599664,7.80583969 L5.85599664,8.00569726 C6.35564056,8.10562604 7.05514205,8.30548361 7.75464354,8.50534118 L9.25357531,8.90505631 C10.0530056,9.0049851 10.7525071,9.0049851 11.4520086,8.80512753 C12.0515813,8.70519875 12.5512252,8.40541239 13.0508691,8.10562604 Z"}}]};const cC={query:{getCanScroll:()=>!0}};function dC(){const e=h(),[r,i]=t(!1),[o,a]=t(!1),[s,l]=t(!1),u=function(){const e=h(),[r,i]=t(!1),[o,a]=t({}),[s,l]=t();return n((()=>()=>{a({})}),[]),n((()=>{e&&i(!e.select&&!e.active)}),[e]),{enabled:()=>r,emit:(e,...t)=>o[e].forEach((e=>e(...t))),removeListener:(e,t)=>{var n;const r=null===(n=o[e])||void 0===n?void 0:n.indexOf(t);r>-1&&o[e].splice(r,1)},on:(e,t)=>{Array.isArray(o[e])?o[e].push(t):o[e]=[t]},get brushSelectionIncludeMax(){return s},set brushSelectionIncludeMax(e){l(e)},getBrushOptions:void 0}}(),c=function(){var e,r,i;const o=h(),[a,s]=t(!1),[l,u]=t(!1),c=y(),d=m(),f=!!c.qSelectionInfo.qInSelections,p=!(null===(e=c.qHyperCube)||void 0===e||null===(r=e.qDimensionInfo)||void 0===r||null===(i=r[0])||void 0===i||!i.qIsOneAndOnlyOne);n((()=>{o&&s(!o.select&&!o.active)}),[o]);const v=e=>{u("boolean"==typeof e?e:!l)};return g((()=>({key:"lasso",label:d.get(l?"Tooltip.ToggleOffLassoSelection":"Tooltip.ToggleOnLassoSelection"),icon:uC,hidden:!a||!f||p,active:l,action:v})),[f,p,l,a,d.language()]),{action:v,enabled:()=>a,active:()=>l}}();let d=cC;n((()=>{e&&(i(!e.active),a(!e.active),l(!e.passive))}),[e]);const[f]=t({});return f.scroll={enabled:()=>r&&d.query.getCanScroll(),attachDiscreteModel:e=>{d=e||cC}},f.interact={enabled:()=>o},f.tooltip={enabled:()=>s},f.lasso=c,f.select=u,f}function mC({clearMinor:e,clearDiscrete:t,clearLegend:n}){e(),e({componentName:"minor-secondary-range-brush",eventName:"minorRange-secondary"}),t({brushName:!1}),n()}function fC({setSelectionInfo:e,event:t,components:n,clear:r}){const i=null!=n&&n.length?n.map((e=>e.key)).filter(Boolean):[];e({event:t,components:i,minorRangePrimary:"minorRange"===t,minorRange:["minorRange","minorRange-secondary"].includes(t),legendRange:"legendRange"===t,legendTap:"tap"===t&&i[0]===xm.COMPONENT.LEGEND_CATEGORICAL}),r()}var pC={exports:{}};window,pC.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/conversion/",n(n.s=2)}([function(e,t,n){var r=Object.prototype.hasOwnProperty,i=Object.prototype.toString,o=Object.defineProperty,a=Object.getOwnPropertyDescriptor,s=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===i.call(e)},l=function(e){if(!e||"[object Object]"!==i.call(e))return!1;var t,n=r.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&r.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!o)return!1;for(t in e);return void 0===t||r.call(e,t)},u=function(e,t){o&&"__proto__"===t.name?o(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(!r.call(e,t))return;if(a)return a(e,t).value}return e[t]};e.exports=function e(){var t,n,r,i,o,a,d=arguments[0],m=1,f=arguments.length,p=!1;for("boolean"==typeof d&&(p=d,d=arguments[1]||{},m=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});m<f;++m)if(null!=(t=arguments[m]))for(n in t)r=c(d,n),d!==(i=c(t,n))&&(p&&i&&(l(i)||(o=s(i)))?(o?(o=!1,a=r&&s(r)?r:[]):a=r&&l(r)?r:{},u(d,{name:n,newValue:e(p,a,i)})):void 0!==i&&u(d,{name:n,newValue:i}));return d}},function(e,t,n){e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/qlik-modifiers/",n(n.s=1)}([function(e,t,n){var r=Object.prototype.hasOwnProperty,i=Object.prototype.toString,o=Object.defineProperty,a=Object.getOwnPropertyDescriptor,s=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===i.call(e)},l=function(e){if(!e||"[object Object]"!==i.call(e))return!1;var t,n=r.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&r.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!o)return!1;for(t in e);return void 0===t||r.call(e,t)},u=function(e,t){o&&"__proto__"===t.name?o(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(!r.call(e,t))return;if(a)return a(e,t).value}return e[t]};e.exports=function e(){var t,n,r,i,o,a,d=arguments[0],m=1,f=arguments.length,p=!1;for("boolean"==typeof d&&(p=d,d=arguments[1]||{},m=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});m<f;++m)if(null!=(t=arguments[m]))for(n in t)r=c(d,n),d!==(i=c(t,n))&&(p&&i&&(l(i)||(o=s(i)))?(o?(o=!1,a=r&&s(r)?r:[]):a=r&&l(r)?r:{},u(d,{name:n,newValue:e(p,a,i)})):void 0!==i&&u(d,{name:n,newValue:i}));return d}},function(e,t,n){n.r(t);var r=n(0),i=n.n(r),o=function(e,t,n){if(!t)return!1;var r,i=t.split("."),o=i[i.length-1],a=e;for(r=0;r<i.length-1;++r)void 0===a[i[r]]&&(a[i[r]]=Number.isNaN(+i[r+1])?{}:[]),a=a[i[r]];if(void 0!==n){var s=a[o];return a[o]=n,{updated:n,previous:s}}return delete a[o],!1},a=function(e,t,n){var r,i=t.split("."),o=e;if(void 0===o)return n;for(r=0;r<i.length;++r){if(void 0===o[i[r]])return n;o=o[i[r]]}return o},s="".concat(" ","(").concat(" "),l="".concat(" ",")").concat(" ");function u(e){return s+e+l}function c(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e.qLibraryId){var n=function(e,t){if(!t)return null;var n,r;for(n=0;n<t.length;n++)if((r=t[n]).qInfo.qId===e)return r;return null}(e.qLibraryId,t.dimensionList);return n&&n.qData.info[0].qTags.indexOf("$numeric")>-1}var r=function(e,t){if(!t)return null;var n,r,i=function(e){var t=e.trim();"="===t.charAt(0)&&(t=(t=t.substring(1)).trim());var n=t.length-1;return"["===t.charAt(0)&&"]"===t.charAt(n)&&(t=(t=t.substring(1,n)).trim()),t}(e);for(n=0;n<t.length;n++){if((r=t[n]).qName===i)return r;if(r.qDerivedFieldData)for(var o=0;o<r.qDerivedFieldData.qDerivedFieldLists.length;++o)for(var a=r.qDerivedFieldData.qDerivedFieldLists[o],s=0;s<a.qFieldDefs.length;++s){var l=a.qFieldDefs[s];if(l.qName===i)return l}}return null}(e.qDef.qFieldDefs[0],t.fieldList);return r&&r.qTags.indexOf("$numeric")>-1}function d(e){return!(!e.fullAccumulation&&!e.fullRange)}function m(e,t){var n=e.crossAllDimensions;return 2===t&&n?"RowNo(Total)":"RowNo()"}function f(e){var t=function(e){return e?(e=function(e){return e.replace(/\/\*[^]*?\*\//g,"")}(e=function(e){return e.replace(/\/\/(.*)$/gm,"")}(e))).trim():""}(e).trim();return"="===t.substring(0,1)?t.substring(1).trim():t}function p(){return"[$(=Replace(GetObjectField(".concat(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,"),']',']]'))]")}function h(e,t){var n=e.crossAllDimensions;return 2===t&&n?"Above(Total ":"Above("}function y(e){return void 0===e?")":", 0, ".concat(e,")")}function g(e,t){return e?"".concat(t,'={">=$(=Min(').concat(t,"))<=$(=Max(").concat(t,'))"}'):"".concat(t,'={"=Only({1}').concat(t,")>='$(=MinString(").concat(t,"))' and Only({1}").concat(t,")<='$(=MaxString(").concat(t,"))'\"}")}function v(e){var t=e.modifier,n=void 0===t?{}:t,r=e.dimensions,i=e.dimensionAndFieldList,o=e.funcComp,a=void 0===o?"Sum":o,s=e.valueComp,l=void 0===s?"0":s;if(!n.showExcludedValues)return"";if(r&&1===r.length){var u=g(c(r[0],i),p(0));return"".concat(a,"({1<").concat(u,">}").concat(l,")")}if(r&&2===r.length){var d=c(r[0],i),m=c(r[1],i),f=p(0),h=p(1),y=g(d,f),v=g(m,h);return"".concat(a,"({1<").concat(y,",").concat(v,">}").concat(l,")")}return"".concat(a,"({1}").concat(l,")")}function b(e){return"".concat(e,"(")}function x(e){var t=e.properties,n=e.layout;return a(t,"qHyperCubeDef.qDimensions",a(n,"qHyperCube.qDimensionInfo",[])).length}var S={isFullRange:d,getNumDimensions:x,getExpressionWithExcludedComp:function(e){var t=e.expression,n=e.modifier,r=e.dimensions,i=e.dimensionAndFieldList,o=e.treatMissingAsNull,a=u(f(t));if(!n.showExcludedValues)return a;var s=v({modifier:n,dimensions:r,dimensionAndFieldList:i}),l=o?"":", 0";if(r&&1===r.length){var c=p(0);return"If(Count(".concat(c,") > 0, ").concat(a," + ").concat(s).concat(l,")")}if(r&&2===r.length){var d=p(0),m=p(1);return"If(Count(".concat(d,") * Count(").concat(m,") > 0, ").concat(a," + ").concat(s).concat(l,")")}return a},getRowNoComp:m,getNumStepComp:function(e,t){if(!d(e)){var n=e.steps;return"number"!=typeof n||Number.isNaN(n)?6:n}return m(e,t)},getAboveCompPrefix:h,getAboveCompSuffix:y,getAboveComp:function(e,t,n,r){return h(e,t)+n+y(r)},getFunctionPrefix:b,getFunctionSuffix:function(){return")"},getRangeComp:function(e,t){return b(e)+t+")"},getAggrComp:function(e,t,n){return"Aggr(".concat(e,", ").concat(t,", ").concat(n,")")},getExcludedComp:v,needDimension:function(e){var t=e.modifier,n=e.properties,r=e.layout;return 0===function(e){return void 0===e.primaryDimension?e.accumulationDimension:e.primaryDimension}(t)&&2===x({properties:n,layout:r})},getDimComp:function(e,t){var n=function(e){return e[arguments.length>1&&void 0!==arguments[1]?arguments[1]:0].qDef.qSortCriterias[0]}(e,t),r=p(t);if(!n.qSortByExpression&&!n.qSortByNumeric&&!n.qSortByAscii)return r;var i=["Descending","Ascending"],o=n.qSortByNumeric?"(Numeric, ".concat(i[(n.qSortByNumeric+1)/2],")"):"",a=n.qSortByAscii?"(Text, ".concat(i[(n.qSortByAscii+1)/2],")"):"";return n.qSortByNumeric&&n.qSortByAscii?"(".concat(r,", ").concat(o,", ").concat(a,")"):n.qSortByNumeric?"(".concat(r,", ").concat(o,")"):n.qSortByAscii?"(".concat(r,", ").concat(a,")"):r},simplifyExpression:f,extractInputExpression:function(e){var t=e.outputExpression;if(e.modifier){var n=t.indexOf(s);if(-1!==n){var r=t.indexOf(l);if(-1!==r)return t.substring(n+s.length,r)}}},initModifier:function(e,t){Object.keys(t).forEach((function(n){void 0===e[n]&&(e[n]=t[n])}))},isNumeric:c,isApplicable:function(e){var t=e.properties,n=e.layout,r=e.minDimensions,i=void 0===r?1:r,o=e.maxDimensions,a=void 0===o?2:o;if(!t&&!n)return!0;var s=x({properties:t,layout:n});return s>=i&&s<=a},getExpressionWithMarkers:u,canExtract:function(e){var t=e.indexOf(s),n=e.indexOf(l);return t>-1&&n>-1&&t<n},getDimDefWithWrapper:p,getFieldWithWrapper:function(e){var t=e?e.replace(/]/g,"]]"):e;return"[".concat(t,"]")}};function M(e){return(M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var E=i.a.bind(null,!0),C={},q=Array.isArray;function A(e){return null!=e&&!Array.isArray(e)&&"object"===M(e)}function O(e){return void 0===e}function D(e,t){return"function"==typeof e[t]||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function I(e,t){var n,r=t.substring(1).split("/").slice(0,-1);return r.forEach((function(t,i){if(i!==r.length){n=+t;var o=Number.isNaN(n)?{}:[];e[n||t]=O(e[n||t])?o:e[t],e=e[n||t]}})),e}function w(e,t){var n=!0;if(A(e)&&A(t))return Object.keys(e).length===Object.keys(t).length&&(Object.keys(e).forEach((function(r){w(e[r],t[r])||(n=!1)})),n);if(q(e)&&q(t)){if(e.length!==t.length)return!1;for(var r=0,i=e.length;r<i;r+=1)if(!w(e[r],t[r]))return!1;return!0}return e===t}C.generate=function(e,t,n){n=n||"";var r=[];return Object.keys(t).forEach((function(i){var o=function(e){return e?E({},{val:e}).val:e}(t[i]),a=e[i],s="".concat(n,"/").concat(i);w(o,a)||D(t,i)||(O(a)?r.push({op:"add",path:s,value:o}):A(o)&&A(a)?r=r.concat(C.generate(a,o,s)):q(o)&&q(a)?r=r.concat(function(e,t,n){var r=[],i=e.slice(),o=-1;function a(e,t,n){if(e[n]&&O(e[n].qInfo))return null;if(e[n]&&e[n].qInfo.qId===t)return n;for(var r=0,i=e.length;r<i;r+=1)if(e[r]&&e[r].qInfo.qId===t)return r;return-1}if(w(t,i))return r;if(!O(t[0])&&O(t[0].qInfo))return r.push({op:"replace",path:n,value:t}),r;for(var s=i.length-1;s>=0;s-=1)-1===(o=a(t,i[s].qInfo&&i[s].qInfo.qId,s))?(r.push({op:"remove",path:"".concat(n,"/").concat(s)}),i.splice(s,1)):r=r.concat(C.generate(i[s],t[o],"".concat(n,"/").concat(s)));for(var l=0,u=t.length;l<u;l+=1)-1===(o=a(i,t[l].qInfo&&t[l].qInfo.qId))?(r.push({op:"add",path:"".concat(n,"/").concat(l),value:t[l]}),i.splice(l,0,t[l])):o!==l&&(r.push({op:"move",path:"".concat(n,"/").concat(l),from:"".concat(n,"/").concat(o)}),i.splice(l,0,i.splice(o,1)[0]));return r}(a,o,s)):r.push({op:"replace",path:"".concat(n,"/").concat(i),value:o}))})),Object.keys(e).forEach((function(i){O(t[i])&&!D(e,i)&&r.push({op:"remove",path:"".concat(n,"/").concat(i)})})),r},C.apply=function(e,t){t.forEach((function(t){var n,r=I(e,t.path),i=t.path.split("/").splice(-1)[0],o=i&&Number.isNaN(+i)?r[i]:r[+i]||r,a=t.from?t.from.split("/").splice(-1)[0]:null;if("/"===t.path&&(r=null,o=e),"add"===t.op||"replace"===t.op)if(q(r))"-"===i&&(i=r.length),r.splice(+i,"add"===t.op?0:1,t.value);else if(q(o)&&q(t.value)){var s,l=t.value.slice();o.length=0,(s=o).push.apply(s,function(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}(l))}else if(A(o)&&A(t.value))n=o,Object.keys(n).forEach((function(e){Object.getOwnPropertyDescriptor(n,e).configurable&&!D(n,e)&&delete n[e]})),E(o,t.value);else{if(!r)throw new Error("Patchee is not an object we can patch");r[i]=t.value}else if("move"===t.op){var u=I(e,t.from);q(r)?r.splice(+i,0,u.splice(+a,1)[0]):(r[i]=u[a],delete u[a])}else"remove"===t.op&&(q(r)?r.splice(+i,1):delete r[i])}))},C.clone=function(e){return E({},e)},C.createPatch=function(e,t,n){var r={op:e.toLowerCase(),path:n};return"move"===r.op?r.from=t:void 0!==t&&(r.value=t),r},C.updateObject=function(e,t){Object.keys(e).length?C.apply(e,C.generate(e,t)):E(e,t)};var T=C,N=function(e,t,n){if(!e)return Promise.resolve();var r=T.generate(t,n);return i()(!0,t,n),r&&r.length?(r=r.map((function(e){return{qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path}})),e.applyPatches(r,!0)):Promise.resolve()},L="accumulation";function k(e,t){var n=a(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===L)return n[r]}function R(e,t){var n=function(e,t){var n=a(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===L)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var P={type:"accumulation",disabled:!1,accumulationDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullAccumulation:!1,steps:6,outputExpression:""},F={translationKey:"properties.modifier.accumulation",needDimension:S.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return S.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,o=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=o;void 0===l&&(l=S.getNumDimensions({properties:r,layout:i}));var u=a(r,"qHyperCubeDef.qDimensions",[]),c=S.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:u,dimensionAndFieldList:s}),d=S.getNumStepComp(n,l),m=S.getAboveComp(n,l,c,d),f=S.getRangeComp("RangeSum",m);if(S.needDimension({modifier:n,properties:r,layout:i})){var p=S.getDimComp(u,1),h=S.getDimComp(u,0),y=S.getAggrComp(f,p,h);f=n.showExcludedValues?S.getExcludedComp({modifier:n,dimensions:u,dimensionAndFieldList:s,valueComp:y}):y}return f},extractInputExpression:S.extractInputExpression,initModifier:function(e){S.initModifier(e,P)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.accumulation.disclaimer",show:function(e,t){return!S.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(R(t,e),".accumulationDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.accumulation.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(R(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.accumulation.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},fullRange:{refFn:function(t){return"".concat(R(t,e),".fullAccumulation")},type:"boolean",translation:t.range||"properties.modifier.range",component:"dropdown",schemaIgnore:!0,defaultValue:!1,options:[{value:!0,translation:t.rangeFull||"properties.modifier.range.full"},{value:!1,translation:t.rangeCustom||"properties.modifier.range.custom"}]},steps:{refFn:function(t){return"".concat(R(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=k(t,e);if(n){var r=n.steps;n.steps="number"!=typeof r||Number.isNaN(r)?6:Math.abs(r)}},show:function(t){var n=k(t,e);return n&&!n.fullAccumulation}},showExcludedValues:{refFn:function(t){return"".concat(R(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return S.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(L))return!1;var o=k(t,e);return o&&!o.disabled}};return n}},z="movingAverage";function _(e,t){var n=a(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===z)return n[r]}function $(e,t){var n=function(e,t){var n=a(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===z)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var H={type:"movingAverage",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullRange:!1,steps:6,outputExpression:"",nullSuppression:!1},j={translationKey:"properties.modifier.movingAverage",needDimension:S.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return S.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t,n=e.expression,r=e.modifier,i=e.properties,o=e.layout,s=e.numDimensions,l=e.dimensionAndFieldList;if(!r)return n;var u=s;void 0===u&&(u=S.getNumDimensions({properties:i,layout:o}));var c=a(i,"qHyperCubeDef.qDimensions",[]),d=r.showExcludedValues&&r.nullSuppression,m=S.getExpressionWithExcludedComp({expression:n,modifier:r,dimensions:c,dimensionAndFieldList:l,treatMissingAsNull:d}),f=S.getNumStepComp(r,u),p=S.getAboveComp(r,u,m,f);if(r.nullSuppression)t=S.getRangeComp("RangeAvg",p);else{var h=S.getRangeComp("RangeSum",p),y=function(e,t){var n=S.getRowNoComp(e,t);if(!S.isFullRange(e)){var r=e.steps,i="number"!=typeof r||Number.isNaN(r)?6:r;return"RangeMin(".concat(i,", ").concat(n,")")}return n}(r,u);t="".concat(h," / ").concat(y)}var g=t;if(S.needDimension({modifier:r,properties:i,layout:o})){var v=S.getDimComp(c,1),b=S.getDimComp(c,0),x=S.getAggrComp(g,v,b);g=r.showExcludedValues?S.getExcludedComp({modifier:r,dimensions:c,dimensionAndFieldList:l,funcComp:"Only",valueComp:x}):x}return g},extractInputExpression:S.extractInputExpression,initModifier:function(e){S.initModifier(e,H)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.movingAverage.disclaimer",show:function(e,t){return!S.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat($(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.movingAverage.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat($(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.movingAverage.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},fullRange:{refFn:function(t){return"".concat($(t,e),".fullRange")},type:"boolean",translation:t.range||"properties.modifier.range",component:"dropdown",schemaIgnore:!0,defaultValue:!1,options:[{value:!0,translation:t.rangeFull||"properties.modifier.range.full"},{value:!1,translation:t.rangeCustom||"properties.modifier.range.custom"}]},steps:{refFn:function(t){return"".concat($(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=_(t,e);if(n){var r=n.steps;n.steps="number"!=typeof r||Number.isNaN(r)?6:Math.abs(r)}},show:function(t){var n=_(t,e);return n&&!n.fullRange}},showExcludedValues:{refFn:function(t){return"".concat($(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0},nullSuppression:{refFn:function(t){return"".concat($(t,e),".nullSuppression")},type:"boolean",translation:t.showNull||"properties.dimensions.showNull",schemaIgnore:!0,defaultValue:!1,inverted:!0}},show:function(e,t){return S.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(z))return!1;var o=_(t,e);return o&&!o.disabled}};return n}},V="difference";function B(e,t){var n=a(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===V)return n[r]}function U(e,t){var n=function(e,t){var n=a(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===V)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var Y={type:"difference",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,outputExpression:""},W={translationKey:"properties.modifier.difference",needDimension:S.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return S.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:S.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,o=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=o;void 0===l&&(l=S.getNumDimensions({properties:r,layout:i}));var u=a(r,"qHyperCubeDef.qDimensions",[]),c=S.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:u,dimensionAndFieldList:s}),d=S.getAboveComp(n,l,c),m="".concat(c," - ").concat(d);if(S.needDimension({modifier:n,properties:r,layout:i})){var f=S.getDimComp(u,1),p=S.getDimComp(u,0),h=S.getAggrComp(m,f,p);m=n.showExcludedValues?S.getExcludedComp({modifier:n,dimensions:u,dimensionAndFieldList:s,funcComp:"Only",valueComp:h}):h}return m},initModifier:function(e){Object.keys(Y).forEach((function(t){void 0===e[t]&&(e[t]=Y[t])}))},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.difference.disclaimer",show:function(e,t){return!S.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(U(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.difference.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(U(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.difference.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},showExcludedValues:{refFn:function(t){return"".concat(U(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return S.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(V))return!1;var o=B(t,e);return o&&!o.disabled}};return n}},G={CURRENT_SELECTION:0,SELECT_FIELD_VALUE:1,DISREGARD_SELECTION:2},X={ONE_DIMENSION:0,ALL_DIMENSIOANS:1,DISREGARD_ALL_DIMENSIONS:2},K="normalization";function J(e,t){var n=a(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===K)return n[r]}function Z(e,t){var n=function(e,t){var n=a(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===K)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}function Q(e,t){for(var n=0;n<e.length;n++)if(e[n].value===t)return n;return-1}function ee(e,t,n,r){var i=t.layout.qHyperCube.qDimensionInfo.length,o=[{value:X.ONE_DIMENSION,translation:n.dimensionalScopeOneDimension||"properties.modifier.dimensionalScope.respectOneDimension",tooltipTranslation:n.dimensionalScopeOneDimensionTooltip||"properties.modifier.dimensionalScope.respectOneDimension.tooltip"},{value:X.ALL_DIMENSIOANS,translation:n.dimensionalScopeAllDimensions||"properties.modifier.dimensionalScope.".concat(2===i?"respectAllDimensions":"respectDimension"),tooltipTranslation:n.dimensionalScopeAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===i?"respectAllDimensions":"respectDimension",".tooltip")},{value:X.DISREGARD_ALL_DIMENSIONS,translation:n.dimensionalScopeDisregardAllDimensions||"properties.modifier.dimensionalScope.".concat(2===i?"disregardAllDimensions":"disregardDimension"),tooltipTranslation:n.dimensionalScopeDisregardAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===i?"disregardAllDimensions":"disregardDimension",".tooltip")}];return o=function(e,t,n){if(e<2){var r=Q(t,0);t.splice(r,1)}return t}(i,o),function(e,t,n){if(0===e){var r=Q(t,1);t.splice(r,1)}return t}(J(e,r).selectionScope,o)}function te(e,t,n){var r=[{value:G.CURRENT_SELECTION,translation:t.selectionScopeCurrentSelection||"properties.modifier.selectionScope.currentSelection"},{value:G.SELECT_FIELD_VALUE,translation:t.selectionScopeSpecificValue||"properties.modifier.selectionScope.selectAField"},{value:G.DISREGARD_SELECTION,translation:t.selectionScopeTotal||"properties.modifier.selectionScope.total"}];return function(e,t,n){if(1===e){var r=Q(t,0);t.splice(r,1)}return t}(J(e,n).dimensionalScope,r)}var ne={type:"normalization",disabled:!1,primaryDimension:0,outputExpression:"",dimensionalScope:X.DISREGARD_ALL_DIMENSIONS,selectionScope:G.DISREGARD_SELECTION};function re(e){return 2===e?"{1}":""}function ie(e,t,n){return 1===e?"{$<".concat(S.getFieldWithWrapper(t),"={'").concat(n,"'}>}"):""}function oe(e,t){return 0===e&&t>1||2===e?"Total":""}function ae(e,t,n){return 0===e&&t>1?"<".concat(S.getDimDefWithWrapper(n),">"):""}var se={translationKey:"properties.modifier.normalization",needDimension:function(){return!0},isApplicable:function(e){var t=e.properties,n=e.layout;return S.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:S.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,o=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=o;void 0===l&&(l=S.getNumDimensions({properties:r,layout:i}));var u=a(r,"qHyperCubeDef.qDimensions",[]),c=S.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:u,dimensionAndFieldList:s}),d=n.selectionScope,m=n.dimensionalScope;return function(e,t,n,r,i,o,a){var s=re(t),l=ie(t,n,r),u=""===s&&""===l?"":s||l,c=oe(i,o),d=ae(i,o,a),m=function(e){for(var t=[],n=0;n<e;n++)t[n]=S.getDimDefWithWrapper(n);return t.join(", ")}(o);return"".concat(e,"/ Sum(").concat(u," ").concat(c).concat(d," Aggr(").concat(u," ").concat(e,", ").concat(m,"))")}(c,d,n.field,n.value,m,l,n.primaryDimension)},initModifier:function(e){Object.keys(ne).forEach((function(t){void 0===e[t]&&(e[t]=ne[t])}))},updateModifier:function(e,t){1===(t.qDimensions?t.qDimensions.length:0)&&0===e.dimensionalScope&&(e.dimensionalScope=2)},enableTotalsFunction:function(){return!0},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.normalization.disclaimer",show:function(e,t){return!S.isApplicable({properties:t.properties})}},settings:{type:"items",items:{selectionScope:{refFn:function(t){return"".concat(Z(t,e),".selectionScope")},type:"string",translation:t.modifierSelectionScope||"properties.modifier.selectionScope",title:{translation:t.modifierSelectionScopeTooltip||"properties.modifier.selectionScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:G.DISREGARD_SELECTION,options:function(n){return te(n,t,e)}},field:{refFn:function(t){return"".concat(Z(t,e),".field")},type:"string",component:"expression-with-dropdown",translation:"Common.Field",defaultValue:"",dropdownOnly:!0,options:function(e,t,n){return n.app.getFieldList().then((function(e){return e.map((function(e){return{label:e.qName,value:e.qName}}))}))},show:function(t){return J(t,e).selectionScope===G.SELECT_FIELD_VALUE}},value:{refFn:function(t){return"".concat(Z(t,e),".value")},type:"string",ref:"value",component:"string",translation:"properties.value",expression:"optional",show:function(t){return J(t,e).selectionScope===G.SELECT_FIELD_VALUE}},dimensionalScope:{refFn:function(t){return"".concat(Z(t,e),".dimensionalScope")},type:"string",translation:t.modifierDimensionalScope||"properties.modifier.dimensionalScope",title:{translation:t.modifierDimensionalScopeTooltip||"properties.modifier.dimensionalScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:X.DISREGARD_ALL_DIMENSIONS,supportTooltip:!0,options:function(n,r){return ee(n,r,t,e)}},primaryDimension:{refFn:function(t){return"".concat(Z(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.normalization.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(t,n){return(J(t,e).dimensionalScope||0)===X.ONE_DIMENSION&&n.layout.qHyperCube.qDimensionInfo.length>1}}},show:function(e,t){return S.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(K))return!1;var o=J(t,e);return o&&!o.disabled}};return n},getDisregardSelectionComp:re,getFieldSelectionComp:ie,getTotalComp:oe,getSelectedDimComp:ae},le={getExpression:function(e){return a(e,"qDef.base.qDef")||a(e,"qDef.qDef")},getExpressionRef:function(e){return a(e,"qDef.base.qDef")?"qDef.base.qDef":"qDef.qDef"},getLibraryIdRef:function(e){return a(e,"qDef.base.qLibraryId")?"qDef.base.qLibraryId":"qLibraryId"},getLibraryId:function(e){return a(e,"qDef.base.qLibraryId")||a(e,"qLibraryId")},getLabelRef:function(e){return a(e,"qDef.base")?"qDef.base.qLabel":"qDef.qLabel"},getLabelExpressionRef:function(e){return a(e,"qDef.base")?"qDef.base.qLabelExpression":"qDef.qLabelExpression"}},ue={initBase:function(e,t){(t||ue.isValid(e))&&(o(e,"qDef.base.qDef",a(e,"qDef.qDef")),o(e,"qDef.base.qLibraryId",a(e,"qLibraryId")),o(e,"qDef.base.qLabel",a(e,"qDef.qLabel")),o(e,"qDef.base.qLabelExpression",a(e,"qDef.qLabelExpression")))},restoreBase:function(e){ue.isValid(e)&&(o(e,"qDef.qDef",a(e,"qDef.base.qDef")),o(e,"qLibraryId",a(e,"qDef.base.qLibraryId")),o(e,"qDef.qLabel",a(e,"qDef.base.qLabel")),o(e,"qDef.qLabelExpression",a(e,"qDef.base.qLabelExpression")),a(e,"qDef.qAggrFunc")&&a(e,"qDef.base.qAggrFunc")&&o(e,"qDef.qAggrFunc",a(e,"qDef.base.qAggrFunc")),delete e.qDef.base)},isValid:function(e){var t=a(e,"qDef.base.qDef"),n=a(e,"qDef.base.qLibraryId");return void 0!==t||void 0!==n}},ce=ue;function de(e){return(de="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var me={accumulation:F,movingAverage:j,difference:W,normalization:se},fe=(t.default={modifiers:me,apply:pe,applyModifiers:he,cleanUpMeasure:ye,destroy:function(e){e&&fe[e.id]&&fe[e.id].masterItemSubscriber&&(fe[e.id].masterItemSubscriber&&fe[e.id].masterItemSubscriber.unsubscribe(),delete fe[e.id])},hasActiveModifiers:ge,getActiveModifier:ve,initBase:ce.initBase,isSupportedModifiers:function(e){return Array.isArray(e)&&e.some((function(e){return me[e]}))},isApplicableSupportedModifiers:function(e){var t=e.modifierTypes,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some((function(e){return me[e]&&me[e].isApplicable({properties:n,layout:r})}))},measureBase:le,limitedSorting:function(e){var t=e.measures,n=e.properties,r=e.layout,i=!1,o=!1;return t.forEach((function(e){var t=Se(e);De({modifiers:t,properties:n,layout:r})&&(i=!0,o=o||Le({modifiers:t,properties:n,layout:r}))})),i&&!o},ifEnableTotalsFunction:be},{});function pe(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.model,n=e.properties,r=e.isSnapshot,o=void 0!==r&&r,s=e.masterItem;fe[t.id]=fe[t.id]||{isFirstTime:!0};var l=fe[t.id].isFirstTime;if(fe[t.id].isFirstTime=!1,n&&"object"===de(n))return he({model:t,properties:n});var u=t?t.layout:void 0,c=a(u,"qSelectionInfo.qInSelections");if(o||c)return Promise.resolve(!1);var d=a(u,"qHyperCube.qMeasureInfo"),m=fe[t.id].lastReloadTime;if(fe[t.id].lastReloadTime=a(t,"app.layout.qLastReloadTime"),ge({measures:d,layout:u})){var f=function(e){var t=e.measures,n=e.layout,r=e.lastReloadTime;return a(e.model,"app.layout.qLastReloadTime")!==r&&function(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some((function(e){return Oe({measure:e,properties:n,layout:r})}))}({measures:t,layout:n})}({measures:d,layout:u,model:t,lastReloadTime:m});return f||function(e){var t=e.measures,n=e.layout,r=e.masterItem,i=e.isFirstTime;return!!Array.isArray(t)&&(i||r||t.some((function(e){return function(e){var t=e.measure,n=e.layout;return De({modifiers:Se(t),layout:n})?!t.base:!!t.base}({measure:e,layout:n})})))}({measures:d,layout:u,masterItem:s,isFirstTime:l})?t.getEffectiveProperties().then((function(e){var n=i()(!0,{},e);Ee(n);var r=ke(n);return Ie({model:t}).then((function(i){return we({libraryIds:r,model:t}).then((function(r){return f&&function(e){var t=e.properties;xe(t).forEach((function(e){return function(e){var t=e.measure;if(Oe({measure:t,properties:e.properties})){var n=0,r=t.qDef.modifiers;Array.isArray(r)&&r.forEach((function(e){if("object"===de(e)&&!e.disabled){if(n++,"object"!==de(me[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(n>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");var r=me[e.type].extractInputExpression({outputExpression:t.qDef.qDef,modifier:e});void 0!==r&&qe(t)&&S.simplifyExpression(t.qDef.base.qDef)!==S.simplifyExpression(r)&&(t.qDef.base.qDef=r)}}))}}({measure:e,properties:t})}))}({properties:n}),he({model:t,oldProperties:e,properties:n,runUpdateIfChange:!0,masterItem:s,libraryItemsProps:r,dimensionAndFieldList:i})}))}))})):Promise.resolve(!1)}return function(e){return!!Array.isArray(e)&&e.some((function(e){return"object"===de(e.base)}))}(d)?t.getEffectiveProperties().then((function(e){return function(e){var t=e.model,n=e.properties,r=ke(n);return Re({model:t,libraryIds:r}).then((function(){var e=i()(!0,{},n);return xe(n).forEach((function(e){return ye(e)})),Ne({oldProperties:e,newProperties:n,model:t})}))}({model:t,properties:e})})):Promise.resolve(!1)}function he(e){var t=e.model,n=e.oldProperties,r=e.properties,o=e.measures,s=e.runUpdateIfChange,l=void 0!==s&&s,u=e.masterItem,c=e.libraryItemsProps,d=e.dimensionAndFieldList;void 0===n&&(n=l?i()(!0,{},r):r),Ee(r);var m=ke(r);return Re({model:t,libraryIds:m,masterItem:u}).then((function(){return function(e){var t=e.measures,n=e.properties,r=e.model,o=e.libraryItemsProps,s=e.dimensionAndFieldList;if(t||(t=xe(n)),!t.length)return Promise.resolve();if(!ge({measures:t,properties:n}))return t.forEach((function(e){return ye(e)})),Promise.resolve();var l=o?void 0:ke(n);return Ie({model:r,dimensionAndFieldList:s}).then((function(e){return we({libraryIds:l,model:r,libraryItemsProps:o}).then((function(r){t.forEach((function(t){De({modifiers:t.qDef.modifiers,properties:n})?(function(e){var t=e.measure,n=e.properties,r=e.libraryItemsProps,o=e.dimensionAndFieldList,s=0;ce.isValid(t)||ce.initBase(t,!0);var l=t.qDef,u=l.modifiers,c=l.base;Array.isArray(u)&&u.forEach((function(e){if("object"===de(e)&&!e.disabled){if(s++,"object"!==de(me[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(s>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");me[e.type].initModifier(e);var l=t.qLibraryId||c&&c.qLibraryId;l?function(e){var t=e.measure,n=e.modifier,r=e.properties,o=e.dimensionAndFieldList,a=e.libraryItemsProps[e.libraryId],s=a.qMeasure.qDef,l=me[n.type].generateExpression({expression:s,modifier:n,properties:r,dimensionAndFieldList:o});n.outputExpression=l,t.qDef.qDef=n.outputExpression,(t.qDef.qLabel||a.qMeasure.qLabel)&&(t.qDef.qLabel=a.qMeasure.qLabel),(t.qDef.qLabelExpression||a.qMeasure.qLabelExpression)&&(t.qDef.qLabelExpression=a.qMeasure.qLabelExpression),t.qDef.quarantine&&t.qDef.quarantine.qNumFormat&&a.qMeasure.qNumFormat&&(t.qDef.qNumFormat=a.qMeasure.qNumFormat,t.qDef.isCustomFormatted=a.qMeasure.isCustomFormatted),delete t.qLibraryId,t.qDef.coloring=a.qMeasure.coloring,n.base=i()(!0,{},t.qDef.base)}({measure:t,modifier:e,libraryId:l,properties:n,libraryItemsProps:r,dimensionAndFieldList:o}):function(e){var t=e.measure,n=e.modifier,r=e.properties,o=e.dimensionAndFieldList;"function"==typeof me[n.type].updateModifier&&me[n.type].updateModifier(n,r.qHyperCubeDef);var a=le.getExpression(t),s=me[n.type].generateExpression({expression:a,modifier:n,properties:r,dimensionAndFieldList:o});n.outputExpression=s,t.qDef.qDef=n.outputExpression,t.qDef.base.qLabelExpression?t.qDef.qLabelExpression=t.qDef.base.qLabelExpression:t.qDef.qLabel=t.qDef.base.qLabel||a,n.base=i()(!0,{},t.qDef.base)}({measure:t,modifier:e,properties:n,dimensionAndFieldList:o}),function(e){var t=a(e,"qDef.qAggrFunc");"Expr"!==t||be(e)?"None"!==t?delete e.qDef.base.qAggrFunc:"None"===t&&be(e)&&"Expr"===e.qDef.base.qAggrFunc&&(e.qDef.qAggrFunc="Expr",delete e.qDef.base.qAggrFunc):(e.qDef.qAggrFunc="None",e.qDef.base.qAggrFunc="Expr")}(t)}}))}({measure:t,properties:n,libraryItemsProps:r,dimensionAndFieldList:e}),Ce(t)):ye(t)}))}))}))}({measures:o,properties:r,model:t,libraryItemsProps:c,dimensionAndFieldList:d}).then((function(){return l?Ne({oldProperties:n,newProperties:r,model:t}):Promise.resolve(!1)}))}))}function ye(e){!function(e){var t=Se(e);return Array.isArray(t)&&t.some((function(e){return"object"===de(e)&&!e.disabled&&!me[e.type]}))}(e)?ce.restoreBase(e):delete e.qDef.base,e.qDef.coloring&&delete e.qDef.coloring,Ce(e)}function ge(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some((function(e){return De({modifiers:Se(e),properties:n,layout:r})}))}function ve(e){var t=Se(e);if(Array.isArray(t))for(var n=0;n<t.length;n++){var r=t[n];if(me[r.type]&&!r.disabled)return r}}function be(e){var t=ve(e);return!t||me[t.type].enableTotalsFunction(e)}function xe(e){return a(e,"qHyperCubeDef.qMeasures",[]).concat(a(e,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",[]))}function Se(e){return e.modifiers||e.qDef&&e.qDef.modifiers}function Me(e){return a(e,"outputExpression.qValueExpression.qExpr")||a(e,"outputExpression")}function Ee(e){xe(e).forEach((function(e){return function(e){var t=ve(e);t&&(void 0!==t.outputExpression&&Me(t)!==e.qDef.qDef?delete e.qDef.base:!ce.isValid(e)&&t.base&&(e.qDef.base=i()(!0,{},t.base)))}(e)}))}function Ce(e){var t=Se(e);Array.isArray(t)&&t.forEach((function(t){"object"===de(t)&&(t.disabled||!me[t.type]&&Me(t)!==e.qDef.qDef)&&(t.disabled=!0,delete t.base)}))}function qe(e){return e.base||e.qDef&&e.qDef.base}function Ae(e){var t=qe(e);return e.qLibraryId||t&&t.qLibraryId}function Oe(e){var t=e.measure,n=e.properties,r=e.layout;return!Ae(t)&&De({modifiers:Se(t),properties:n,layout:r})}function De(e){var t=e.modifiers,n=e.properties,r=e.layout,i={};return Array.isArray(t)&&t.some((function(e){return!("object"!==de(e)||e.disabled||!me[e.type])&&(void 0===i[e.type]&&(i[e.type]=me[e.type].isApplicable({properties:n,layout:r})),i[e.type])}))}function Ie(e){var t=e.model,n=e.dimensionAndFieldList;if(n)return Promise.resolve(n);var r=[],i={},o=t.app.getDimensionList().then((function(e){i.dimensionList=e}));r.push(o);var a=t.app.getFieldList().then((function(e){i.fieldList=e}));return r.push(a),Promise.all(r).then((function(){return i}))}function we(e){var t=e.libraryIds,n=e.model,r=e.libraryItemsProps;if(r)return Promise.resolve(r);var i=t.measureLibraryIds,o=t.dimensionLibraryIds,a={},s=[];return i.forEach((function(e){var t=n.app.getMeasure(e).then((function(t){return t.getProperties().then((function(t){a[e]=t}))}));s.push(t)})),o.forEach((function(e){var t=n.app.getDimension(e).then((function(t){return t.getProperties().then((function(t){a[e]=t}))}));s.push(t)})),Promise.all(s).then((function(){return a}))}function Te(e,t){if(""!==t||-1===["qFmt","qDec","qThou"].indexOf(e))return t}function Ne(e){var t=e.oldProperties,n=e.newProperties,r=e.model,i=JSON.stringify(a(t,"qHyperCubeDef.qMeasures"),Te)!==JSON.stringify(a(n,"qHyperCubeDef.qMeasures"),Te)||JSON.stringify(a(t,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Te)!==JSON.stringify(a(n,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Te);return i?function(e){var t=e.model,n=e.oldProperties,r=e.newProperties,i=t.layout;return i&&!i.qHasSoftPatches&&!i.qExtendsId&&a(i,"qMeta.privileges",[]).indexOf("update")>-1?t.setProperties(r):N(t,n,r)}({model:r,oldProperties:t,newProperties:n}).then((function(){return i})):Promise.resolve(i)}function Le(e){var t=e.modifiers,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some((function(e){return"object"===de(e)&&!e.disabled&&me[e.type]&&me[e.type].needDimension({modifier:e,properties:n,layout:r})}))}function ke(e){var t=xe(e),n=[],r=[],i=!1;return t.forEach((function(t){var r=Se(t);if(De({modifiers:r,properties:e})){var o=Ae(t);o&&n.push(o),i=i||Le({modifiers:r,properties:e})}})),a(e,"qHyperCubeDef.qDimensions",[]).forEach((function(e){var t=e.qLibraryId;t&&r.push(t)})),{measureLibraryIds:n,dimensionLibraryIds:r}}function Re(e){var t=e.model,n=e.libraryIds;return!e.masterItem&&n&&(n.measureLibraryIds.length||n.dimensionLibraryIds.length)?(fe[t.id].masterItemSubscriber=fe[t.id].masterItemSubscriber||function(e){var t=e.model,n=e.callback,r={},i={},o={},s={dimension:["qDim.qFieldDefs"],measure:["qMeasure.qDef","qMeasure.qLabel","qMeasure.qLabelExpression","qMeasure.coloring","qMeasure.qNumFormat","qMeasure.isCustomFormatted"]};function l(e){var t={},n=a(e,"qInfo.qType");return n&&s[n]&&s[n].forEach((function(n){t[n]=a(e,n)})),JSON.stringify(t)}function u(e){var t=e.qInfo.qId;if(r[t]){var i=l(e);r[t].properties!==i&&(r[t].properties=i,"function"==typeof n&&r[t].enabled&&n(e)),r[t].enabled=!0}}function c(e,n){return t.app[n](e).then((function(t){r[e]={listener:t.layoutSubscribe(u),enabled:!1,properties:l(t.layout)}}))}return{subscribe:function(e){var n=e.measureLibraryIds,a=e.dimensionLibraryIds,s=[];return function(e){var t=e.dimensionLibraryIds;i={},e.measureLibraryIds.forEach((function(e){i[e]=!0})),o={},t.forEach((function(e){o[e]=!0}))}({measureLibraryIds:n,dimensionLibraryIds:a}),Object.keys(r).forEach((function(e){i[e]||o[e]||(r[e].listener.dispose(),delete r[e])})),t.app&&(Object.keys(i).forEach((function(e){i[e]&&!r[e]&&s.push(c(e,"getMeasure"))})),Object.keys(o).forEach((function(e){o[e]&&!r[e]&&s.push(c(e,"getDimension"))}))),Promise.all(s)},unsubscribe:function(){Object.keys(r).forEach((function(e){r[e].listener.dispose()})),r={}}}}({model:t,callback:function(e){return pe({model:t,masterItem:e}).then((function(){return t.app.clearUndoBuffer()}))}}),fe[t.id].masterItemSubscriber.subscribe(n)):Promise.resolve()}}])},function(e,t,n){function r(e){var t=function e(t){var n,r=t;return r>9?(n=65+r-10)>90&&(n+=6):r="".concat(r).charCodeAt(0),[48,111,79,105,73,108].indexOf(n)>-1?e(r+1):String.fromCharCode(n)}(e%62),n=Math.floor(e/62);return n>0?r(n)+t:t}function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}n.r(t);var o={getValue:function(e,t,n){if(null==e||null==t)return n;for(var r=t.split("."),i=e,o=0;o<r.length;++o){var a=r[o];if(""!==a){if(void 0===i[a]||null===i[a])return n;i=i[a]}}return i},setValue:function(e,t,n){if(null!=e&&null!=t){for(var r=t.split("."),i=r[r.length-1],o=e,a=0;a<r.length-1;++a){var s=r[a];void 0!==o[s]&&null!==o[s]||(o[s]=Number.isNaN(+r[a+1])?{}:[]),o=o[s]}void 0!==n?o[i]=n:delete o[i]}},isEmpty:function(e){return 0===Object.keys(e).length&&e.constructor===Object},isAtomicValue:function(e){return/boolean|number|string/.test(i(e))},generateId:function(){return r(Math.round(99e11*Math.random()+1e11)).replace(/\W/g,"")}};function a(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var n=Object.prototype.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)?s(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function l(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return u(e,t);var n=Object.prototype.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)?u(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function c(e,t,n){if(e){for(var r=0;r<e.length;r++)if(e[r][t]===n)return r;return-1}return-1}var d={isOrderedSubset:function(e,t){if(!(e&&t&&e.length&&t.length))return!1;var n=e.indexOf(t[0]);if(-1!==n){for(var r=0;r<t.length;r++){var i=e.indexOf(t[r]);if(n>i)return!1;n=i}return!0}return!1},indexAdded:function(e,t){var n;for(n=0;n<e.length;++n)e[n]>=0&&e[n]>=t&&++e[n];e.push(t)},indexRemoved:function(e,t){var n,r=0;for(n=0;n<e.length;++n)e[n]>t?--e[n]:e[n]===t&&(r=n);return e.splice(r,1),r},findItemByPropertyValue:function(e,t,n){if(e){for(var r=0;r<e.length;r++)if(e[r][t]===n)return e[r];return null}return null},findIndexByPropertyValue:c},m=n(1),f=n.n(m),p={addDimensions:function(e){var t,n=e.exportFormat,r=e.qHyperCubeDef,i=n.data[0];(t=i.dimensions).push.apply(t,a(r.qDimensions));var s,l=o.getValue(r,"qLayoutExclude.qHyperCubeDef.qDimensions");l&&(s=i.excludedDimensions).push.apply(s,a(l))},addMeasures:function(e){var t,n=e.exportFormat,r=e.qHyperCubeDef,i=n.data[0];(t=i.measures).push.apply(t,l(r.qMeasures));var a,s=o.getValue(r,"qLayoutExclude.qHyperCubeDef.qMeasures");s&&(a=i.excludedMeasures).push.apply(a,l(s))},setInterColumnSortOrder:function(e){var t=e.exportFormat,n=e.qHyperCubeDef,r=t.data[0];n.qInterColumnSortOrder||(n.qInterColumnSortOrder=[]),r.interColumnSortOrder=n.qInterColumnSortOrder.concat();var i=o.getValue(n,"qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder");i&&d.isOrderedSubset(i,r.interColumnSortOrder)&&(r.interColumnSortOrder=i.concat())},copyProperties:function(e){var t=e.exportFormat,n=e.properties;Object.keys(n).forEach((function(e){t.properties[e]=n[e]}))},updateLayoutExclude:function(e){var t=e.exportFormat,n=e.properties;n.qLayoutExclude||(n.qLayoutExclude={}),n.qLayoutExclude.disabled&&(Object.keys(n.qLayoutExclude.disabled).forEach((function(e){t.properties.hasOwnProperty(e)||(t.properties[e]=n.qLayoutExclude.disabled[e])})),delete n.qLayoutExclude.disabled),n.qLayoutExclude.changed&&(function(e){Object.keys(e.qLayoutExclude.changed).forEach((function(t){e.qLayoutExclude.changed[t].to===o.getValue(e,t)&&o.setValue(e,t,e.qLayoutExclude.changed[t].from)}))}(n),delete n.qLayoutExclude.changed),n.qLayoutExclude.quarantine&&!o.isEmpty(n.qLayoutExclude.quarantine)||delete n.qLayoutExclude},storeMeasuresModifiers:function(e){e.forEach((function(e){f.a.cleanUpMeasure(e),e.qDef.modifiers&&(e.store={modifiers:e.qDef.modifiers},delete e.qDef.modifiers)}))}};function h(e,t,n){var r,i,a=o.getValue(e,t);if(!o.isAtomicValue(a))try{if((i=(i=(r=JSON.stringify(a)).match(/:\{/g))?i.length:0)>2)return;a=JSON.parse(r)}catch(e){return}o.getValue(e,"qLayoutExclude.quarantine")||o.setValue(e,"qLayoutExclude.quarantine",{});var s=o.getValue(e,"qLayoutExclude.quarantine");s[n]||(s[n]={}),s[n][t]=a}var y=n(0),g=n.n(y);function v(e,t){var n=g()(!0,{},t,e);return o.getValue(n,"qOtherTotalSpec.qOtherCounted")||o.setValue(n,"qOtherTotalSpec.qOtherCounted",{qv:"10"}),o.getValue(n,"qOtherTotalSpec.qOtherLimit")||o.setValue(n,"qOtherTotalSpec.qOtherLimit",{qv:"0"}),n.hasOwnProperty("othersLabel")||(n.othersLabel="Others"),n}function b(e,t){return g()(!0,{},t,e)}function x(e,t,n){return"function"==typeof e?e(t):Number.isNaN(+e)?n:e}var S=Math.pow(2,53)-1;function M(e){return function(e){if(Array.isArray(e))return E(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return E(e,t);var n=Object.prototype.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)?E(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function E(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function C(e){return function(e){if(Array.isArray(e))return q(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return q(e,t);var n=Object.prototype.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)?q(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function q(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var A={importCommonProperties:function(e,t,n){var r="masterobject"===o.getValue(t,"properties.qInfo.qType")?"masterobject":o.getValue(n,"qInfo.qType");o.setValue(e,"qInfo.qType",r),e.visualization=n.visualization},copyPropertyIfExist:function(e,t,n){t.hasOwnProperty(e)&&(n[e]=t[e])},copyPropertyOrSetDefault:function(e,t,n,r){t.hasOwnProperty(e)?n[e]=t[e]:n[e]=r},getDefaultDimension:function(){return{qDef:{autoSort:!0,cId:"",othersLabel:"Others"},qLibraryId:"",qNullSuppression:!1,qOtherLabel:"Others",qOtherTotalSpec:{qOtherLimitMode:"OTHER_GE_LIMIT",qOtherMode:"OTHER_OFF",qOtherSortMode:"OTHER_SORT_DESCENDING",qSuppressOther:!1}}},getDefaultMeasure:function(){return{qDef:{autoSort:!0,cId:"",numFormatFromTemplate:!0},qLibraryId:"",qTrendLines:[]}},addDimensions:function(e){var t,n=e.exportFormat,r=e.maxDimensions,i=e.minDimensions,o=e.newHyperCubeDef,a=e.defaultDimension,s=n.data[0];for(t=0;t<s.dimensions.length;++t){var l=v(s.dimensions[t],a);o.qDimensions.length<r?o.qDimensions.push(l):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(l)}for(t=0;t<s.excludedDimensions.length;++t){var u=v(s.excludedDimensions[t],a);o.qDimensions.length<i?o.qDimensions.push(u):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(u)}},addMeasures:function(e){var t,n=e.exportFormat,r=e.maxMeasures,i=e.minMeasures,o=e.newHyperCubeDef,a=e.defaultMeasure,s=n.data[0];for(t=0;t<s.measures.length;++t){var l=b(s.measures[t],a);o.qMeasures.length<r?o.qMeasures.push(l):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(l)}for(t=0;t<s.excludedMeasures.length;++t){var u=b(s.excludedMeasures[t],a);o.qMeasures.length<i?o.qMeasures.push(u):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(u)}},getMaxMinDimensionMeasure:function(e){var t=e.exportFormat,n=e.dataDefinition,r=void 0===n?{}:n,i=t.data[0],o=r.dimensions||{max:0},a=r.measures||{max:0},s=x(a.max,i.dimensions.length,S),l=x(a.min,i.dimensions.length,0);return{maxDimensions:x(o.max,s,S),minDimensions:x(o.min,l,0),maxMeasures:s,minMeasures:l}},setInterColumnSortOrder:function(e){var t=e.exportFormat,n=e.newHyperCubeDef,r=t.data[0],i=n.qDimensions.length+n.qMeasures.length;n.qInterColumnSortOrder=r.interColumnSortOrder.concat();var o=n.qInterColumnSortOrder.length;if(o!==i)for(n.qLayoutExclude&&(n.qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder=r.interColumnSortOrder.concat());o!==i;)o<i?(d.indexAdded(n.qInterColumnSortOrder,o),++o):(--o,d.indexRemoved(n.qInterColumnSortOrder,o))},createNewProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.hypercubePath,i={qLayoutExclude:{disabled:{},quarantine:{}}};return Object.keys(t.properties).forEach((function(e){"qLayoutExclude"===e?t.properties[e].quarantine&&(i.qLayoutExclude.quarantine=g()(!0,{},t.properties[e].quarantine)):"qHyperCubeDef"===e&&r?o.setValue(i,"".concat(r,".qHyperCubeDef"),t.properties.qHyperCubeDef):n.hasOwnProperty(e)||-1!==["qMetaDef","descriptionExpression","labelExpression"].indexOf(e)||function(e,t){return"components"===t&&Array.isArray(e[t])&&e[t].some((function(e){return"general"===e.key}))}(t.properties,e)?i[e]=t.properties[e]:i.qLayoutExclude.disabled[e]=t.properties[e]})),null===(i=g()(!0,{},n,i)).components&&(i.components=[]),i},shouldInitLayoutExclude:function(e){var t=e.exportFormat,n=e.maxDimensions,r=e.minDimensions,i=e.maxMeasures,o=e.minMeasures,a=t.data[0];return a.dimensions.length>n&&n>0||a.measures.length>i&&i>0||a.excludedDimensions.length>0&&a.dimensions.length+a.excludedDimensions.length>r||a.excludedMeasures.length>0&&a.measures.length+a.excludedMeasures.length>o||!i&&a.measures.length>0||!n&&a.dimensions.length>0},initLayoutExclude:function(e){var t=e.exportFormat,n=e.maxDimensions,r=e.minDimensions,i=e.maxMeasures,o=e.minMeasures,a=e.newHyperCubeDef,s=t.data[0];a.qLayoutExclude||(a.qLayoutExclude={}),a.qLayoutExclude.qHyperCubeDef||(a.qLayoutExclude.qHyperCubeDef={}),(s.dimensions.length>n&&n>0||s.excludedDimensions&&s.excludedDimensions.length&&s.dimensions.length+s.excludedDimensions.length>r)&&(a.qLayoutExclude.qHyperCubeDef.qDimensions||(a.qLayoutExclude.qHyperCubeDef.qDimensions=[])),(s.measures.length>i&&i>0||s.excludedMeasures&&s.excludedMeasures.length&&s.measures.length+s.excludedMeasures.length>o)&&(a.qLayoutExclude.qHyperCubeDef.qMeasures||(a.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!i&&s.measures.length&&(a.qLayoutExclude.qHyperCubeDef.qMeasures||(a.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!n&&s.dimensions.length&&(a.qLayoutExclude.qHyperCubeDef.qDimensions||(a.qLayoutExclude.qHyperCubeDef.qDimensions=[]))},updateDimensionsOnAdded:function(e){var t=e.newProperties,n=e.dataDefinition,r=e.hypercubePath;if(n.dimensions&&"function"==typeof n.dimensions.added){var i=o.getValue(t,r||"").qHyperCubeDef,a=M(i.qDimensions);i.qDimensions=[],a.forEach((function(e){i.qDimensions.push(e),n.dimensions.added(e,t)}))}},updateMeasuresOnAdded:function(e){var t=e.newProperties,n=e.dataDefinition,r=e.hypercubePath;if(n.measures&&"function"==typeof n.measures.added){var i=o.getValue(t,r||"").qHyperCubeDef,a=C(i.qMeasures);i.qMeasures=[],a.forEach((function(e){i.qMeasures.push(e),n.measures.added(e,t)}))}},restoreMeasuresModifiers:function(e){var t=e.measures,n=e.modifierTypes;t&&n&&f.a.isSupportedModifiers(n)&&t.forEach((function(e){e.store&&e.store.modifiers&&(e.qDef.modifiers=e.store.modifiers),delete e.store}))}};function O(e,t){var n=o.getValue(e,"qLayoutExclude.quarantine",{})[t];return!!n&&(Object.keys(n).forEach((function(t){o.setValue(e,t,n[t])})),delete e.qLayoutExclude.quarantine[t],!0)}var D={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t={data:[],properties:{}},n=0;n<e;++n)t.data.push({dimensions:[],measures:[],excludedDimensions:[],excludedMeasures:[],interColumnSortOrder:[]});return t}(),a=t.qProperty,s=o.getValue(a,n||""),l=s.qHyperCubeDef;return l.qInterColumnSortOrder||(l.qInterColumnSortOrder=[]),p.addDimensions({exportFormat:i,qHyperCubeDef:l}),p.addMeasures({exportFormat:i,qHyperCubeDef:l}),p.setInterColumnSortOrder({exportFormat:i,qHyperCubeDef:l}),delete l.qLayoutExclude,p.copyProperties({exportFormat:i,properties:a}),n&&(i.properties.qHyperCubeDef=l,delete s.qHyperCubeDef),p.updateLayoutExclude({exportFormat:i,properties:a}),r||p.storeMeasuresModifiers(i.properties.qHyperCubeDef.qMeasures),Array.isArray(i.properties.filters)&&(h(i.properties,"filters","storedFilters"),delete i.properties.filters),i.properties.qHyperCubeDef.qContextSetExpression&&(h(i.properties,"qHyperCubeDef.qContextSetExpression","storedFilters"),i.properties.qHyperCubeDef.qContextSetExpression=""),i.properties.qHyperCubeDef.qDynamicScript&&i.properties.qHyperCubeDef.qDynamicScript.length&&(h(i.properties,"qHyperCubeDef.qDynamicScript","dynamicScript"),i.properties.qHyperCubeDef.qDynamicScript=[]),i},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=void 0===n?{}:n,i=e.dataDefinition,a=void 0===i?{}:i,s=e.defaultPropertyValues,l=void 0===s?{}:s,u=e.hypercubePath,c=e.extension,d=e.supportedFilters,m=void 0===d||d,f=e.isHCModifierSupported,p=void 0===f||f,h={qChildren:[]},y=A.createNewProperties({exportFormat:t,initialProperties:r,hypercubePath:u}),g=o.getValue(r,u||"").qHyperCubeDef,v=o.getValue(y,u||"").qHyperCubeDef,b=A.getMaxMinDimensionMeasure({exportFormat:t,dataDefinition:a}),x=b.maxDimensions,S=b.minDimensions,M=b.maxMeasures,E=b.minMeasures,C=l.defaultDimension,q=void 0===C?A.getDefaultDimension():C,D=l.defaultMeasure,I=void 0===D?A.getDefaultMeasure():D;v.qDimensions.length=0,v.qMeasures.length=0,A.shouldInitLayoutExclude({exportFormat:t,maxDimensions:x,minDimensions:S,maxMeasures:M,minMeasures:E})&&A.initLayoutExclude({exportFormat:t,maxDimensions:x,minDimensions:S,maxMeasures:M,minMeasures:E,newHyperCubeDef:v}),A.addDimensions({exportFormat:t,maxDimensions:x,minDimensions:S,newHyperCubeDef:v,defaultDimension:q}),A.addMeasures({exportFormat:t,maxMeasures:M,minMeasures:E,newHyperCubeDef:v,defaultMeasure:I}),A.updateDimensionsOnAdded({newProperties:y,dataDefinition:a,hypercubePath:u}),A.updateMeasuresOnAdded({newProperties:y,dataDefinition:a,hypercubePath:u}),A.setInterColumnSortOrder({exportFormat:t,newHyperCubeDef:v}),A.copyPropertyIfExist("qMaxStackedCells",g,v),A.copyPropertyIfExist("qNoOfLeftDims",g,v),A.copyPropertyOrSetDefault("qInitialDataFetch",g,v,[{qTop:0,qLeft:0,qWidth:0,qHeight:0}]),A.copyPropertyOrSetDefault("qMode",g,v,"S"),A.copyPropertyOrSetDefault("qReductionMode",g,v,"N"),A.copyPropertyOrSetDefault("qSortbyYValue",g,v),A.copyPropertyOrSetDefault("qIndentMode",g,v),A.copyPropertyOrSetDefault("qShowTotalsAbove",g,v),A.importCommonProperties(y,t,r),h.qProperty=y;var w=o.getValue(c||{},"support.modifiers");return A.restoreMeasuresModifiers({measures:v.qMeasures,modifierTypes:w}),m&&O(h.qProperty,"storedFilters"),"S"===v.qMode&&p&&O(h.qProperty,"dynamicScript"),h}},I={cellBackgroundColor:!0,cellForegroundColor:!0,colorByAlternative:!0,colorByExpression:!0,tooltip:!0,urlLabel:!0,url:!0};function w(e,t,n,r){t=t||[];var i=c(e,r,n),o=c(t,r,n);if(-1!==i&&-1===o){var a=e.splice(i,1);t.push(a[0])}return t}function T(e,t){return e.length!==t}var N={create:function(e,t){if(!e||!I[e])throw new Error("Attribute Expressions Util: ID required");var n={};return t&&Object.keys(t).forEach((function(e){n[e]=t[e]})),n.id=e,n.qAttribute=!0,n},moveByIdFromGroup:function(e,t,n,r,i){n=n||"qAttributeExpressions",i=i||"id";for(var o=0;o<e.length;o++){var a=e[o][n],s=t.length;if(w(a,t,r,i),T(t,s))return t}return t},IDMAP:{CELL_BACKGROUND_COLOR:"cellBackgroundColor",CELL_FOREGROUND_COLOR:"cellForegroundColor",COLOR_BY_ALTERNATIVE:"colorByAlternative",COLOR_BY_EXPRESSION:"colorByExpression",TOOLTIP:"tooltip",CELL_LINK_LABEL:"urlLabel",CELL_LINK_URL:"url"}},L={getNumDimensions:function(e){return o.getValue(e,"qHyperCubeDef.qDimensions.length",0)},getNumMeasures:function(e){return o.getValue(e,"qHyperCubeDef.qMeasures.length",0)},wrapFieldName:function(e){return e.split(" ").length>1&&"="!==e[0]&&"["!==e[0]?"[".concat(e,"]"):e},getItemLabel:function(e){return e.label||e.name}},k={colorModeOptions:{primary:function(){return!0},dimension:function(e){return L.getNumDimensions(e)>0&&L.getNumMeasures(e)<=1},multiColor:function(e){return L.getNumMeasures(e)>1},measure:function(e){return L.getNumDimensions(e)>0},expression:function(e){return L.getNumMeasures(e)>=1}}},R={colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return L.getNumMeasures(e)>=1}}},P={scatterplot:R,"sn-scatter-plot":R,piechart:{colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return L.getNumMeasures(e)>=1}}},linechart:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return L.getNumDimensions(e)>1},multiColor:function(e){return L.getNumMeasures(e)>1},measure:function(e){return L.getNumDimensions(e)<=1},expression:function(e){return L.getNumMeasures(e)>=1}}},map:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return L.getNumDimensions(e)>=1},multiColor:function(e){return L.getNumMeasures(e)>1},measure:function(e){return L.getNumDimensions(e)>=1},expression:function(e){return L.getNumDimensions(e)>=1}}},distributionplot:{colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return L.getNumDimensions(e)>=1}}}};function F(e,t,n){if(Array.isArray(e[t])){var r=d.findIndexByPropertyValue(e[t],"id",n);r>=0&&e[t].splice(r,1)}else e[t]=[]}function z(e,t){var n=N.IDMAP.COLOR_BY_ALTERNATIVE;e.forEach((function(e){F(e,"qAttributeDimensions",n),F(e,"qAttributeExpressions",n)})),t.forEach((function(e){F(e,"qAttributeDimensions",n),F(e,"qAttributeExpressions",n)}))}function _(e,t){if(t){var n="="===t.charAt(0);e.color.altLabel=n?{qStringExpression:{qExpr:t.substr(1)}}:t}}function $(e){var t=e.properties,n=e.isDimension,r=e.dimensions,i=e.excludedDimensions,a=e.measures,s=e.label;z(r,i);var l=r[r.length-1];if(l){var u=n?o.getValue(t,"color.byDimDef"):o.getValue(t,"color.byMeasureDef"),c=o.getValue(t,"color.formatting.qNumFormat"),m=o.getValue(t,"color.formatting.isCustomFormatted");if(u){var f=N.create(N.IDMAP.COLOR_BY_ALTERNATIVE);switch(u.type){case"expression":!function(e){var t=e.attributeExpression,n=e.label,r=e.item,i=e.isDimension,o=e.qNumFormat,a=e.isCustomFormatted;t.label=n||r.label,i?t.qDef=r.key:(t.qExpression=r.key,o&&(t.qNumFormat=o,t.isCustomFormatted=a)),t.matchMeasure=r.activeMeasureIndex,t.label&&"="===t.label.charAt(0)&&(t.labelExpRef="color.altLabel")}({attributeExpression:f,label:s,item:u,isDimension:n,qNumFormat:c,isCustomFormatted:m});break;case"libraryItem":!function(e){var t=e.attributeExpression,n=e.measures,r=e.item,i=e.isDimension,o=e.qNumFormat,a=e.isCustomFormatted;i||(t.matchMeasure=d.findIndexByPropertyValue(n,"qLibraryId",r.key),o&&(t.qNumFormat=o,t.isCustomFormatted=a)),void 0!==r.expression?t.qExpression=r.expression:t.qLibraryId=r.key,t.colorMapRef=r.key}({attributeExpression:f,measures:a,item:u,isDimension:n,qNumFormat:c,isCustomFormatted:m})}n?(f.qSortBy={qSortByAscii:1},l.qAttributeDimensions.push(f)):l.qAttributeExpressions.push(f)}}}function H(e,t,n,r){var i,o,a,s={};switch(e){case"dimension":n.qLibraryId?(s.type="dimension",s.name=n.qLibraryId,s.id=n.qLibraryId):(s.type="field",t?(s.name=n.label||n.qDef,s.id=n.qDef):(s.name=n.qDef.qFieldDefs[0],s.label=(a=n.qDef).qLabelExpression?a.qLabelExpression:a.qFieldLabels&&a.qFieldLabels[0]?a.qFieldLabels[0]:a.qFieldDefs[0]));break;case"measure":(i=function(e,t){return t?e.qLibraryId:f.a.measureBase.getLibraryId(e)}(n,t))?(s.type="measure",s.name=i,s.id=i,(o=function(e,t){return f.a.hasActiveModifiers({measures:[e]})&&t?e.qDef.qDef:void 0}(n,r))&&(s.expression=o)):(s.type="expression",t?(s.name=n.label||n.qExpression,s.id=n.qExpression):(s.name=n.qDef.qDef,s.label=function(e){var t=e.qDef;return t.qLabelExpression?t.qLabelExpression:t.qLabel?t.qLabel:t.qDef}(n)));break;default:throw new Error('columnType should be "dimension" or "measure"')}return s}var j={useMasterNumberFormat:function(e){e.quarantine={qNumFormat:e.qNumFormat||{},isCustomFormatted:e.isCustomFormatted||!1},e.qNumFormat=null,e.isCustomFormatted=void 0}};function V(e,t,n,r){var i=n?"expression":t.type,o=e.color,a=o.mode,s=L.getItemLabel(t);switch(_(e,s||""),i){case"field":a="byDimension",o.byDimDef={label:t.label||L.wrapFieldName(t.name),key:L.wrapFieldName(t.name),type:"expression",activeDimensionIndex:t.activeDimensionIndex};break;case"expression":a="byMeasure",o.byMeasureDef={label:n||s,key:n||t.name,type:"expression",activeMeasureIndex:t.activeMeasureIndex};break;case"dimension":a="byDimension",o.byDimDef={label:t.name,key:t.id,type:"libraryItem",activeDimensionIndex:t.activeDimensionIndex};break;case"measure":a="byMeasure",o.byMeasureDef={label:t.name,key:t.id,expression:t.expression,type:"libraryItem",activeMeasureIndex:t.activeMeasureIndex},o.formatting&&j.useMasterNumberFormat(o.formatting)}r||(o.auto=!1,o.mode=a)}function B(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=n[function(e,t,n){var r=o.getValue(t,"visualization"),i=n.split("."),a=Number(i[1]),s=o.getValue(t,"layers.".concat(a,".type"));return 2===e.length&&"map"===r&&"point"===s}(n,e,t)?0:n.length-1],i=N.IDMAP.COLOR_BY_ALTERNATIVE,a=d.findItemByPropertyValue(r.qAttributeDimensions,"id",i);return V(e,H("dimension",!!a,a||r)),!!a}function U(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),a=o.getValue(e,"color.byDimDef");if(a&&_(e,a.label),function(e){return!!(e&&e.activeDimensionIndex>-1)}(a))!function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"color.byDimDef");r.activeDimensionIndex=Math.min(r.activeDimensionIndex,n.length-1);var i=H("dimension",!1,n[r.activeDimensionIndex]);i.activeDimensionIndex=r.activeDimensionIndex,V(e,i)}(e,t);else if(function(e){return!e||!e.key}(a)&&B(e,t))return;$({properties:e,isDimension:!0,dimensions:n,excludedDimensions:i,measures:r,label:o.getValue(e,"color.byDimDef.label")})}function Y(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),a=o.getValue(e,"color.byMeasureDef");if(a&&_(e,a.label),function(e){return!!(e&&e.activeMeasureIndex>-1)}(a))!function(e,t){var n=o.getValue(e,"".concat(t,"qMeasures"),[]),r=o.getValue(e,"color.byMeasureDef");if(r.activeMeasureIndex=Math.min(r.activeMeasureIndex,n.length-1),r.activeMeasureIndex>-1){var i=H("measure",!1,n[r.activeMeasureIndex],!0);i.activeMeasureIndex=r.activeMeasureIndex,V(e,i)}}(e,t);else if(function(e,t){return(!e||!e.key)&&t.length>0}(a,r)&&function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=n[n.length-1],a=N.IDMAP.COLOR_BY_ALTERNATIVE,s=d.findItemByPropertyValue(i.qAttributeExpressions,"id",a);return V(e,H("measure",!!s,s||r[0])),!!s}(e,t))return;$({properties:e,isDimension:!1,dimensions:n,excludedDimensions:i,measures:r,label:o.getValue(e,"color.byMeasureDef.label")})}var W={changeProperty:function(e,t,n){o.setValue(e,t,n),o.isAtomicValue(n)&&function(e,t,n){var r=e.qLayoutExclude;r&&(r.changed||(r.changed={}),r.changed[t]={from:o.getValue(e,t),to:n})}(e,t,n)},getCanColorBy:function(e,t){var n={primary:!0};if(e){var r=(P[t]||k).colorModeOptions||k.colorModeOptions;n.byDimension=r.dimension(e),n.byMeasure=r.measure(e),n.byMultiple=r.multiColor(e),n.byExpression=r.expression(e)}return n},shouldUpdateColorBy:function(e){var t=e.canColorBy,n=e.autoColor,r=e.colorMode,i=e.dimensions;return!(t[r]&&!n&&("byDimension"!==r&&"byMeasure"!==r||!i.length))},updateColorBy:function(e,t){var n=o.getValue(e,"color.mode"),r=o.getValue(e,"color.auto"),i=o.getValue(e,"".concat(t,"qDimensions"),[]),a=o.getValue(e,"".concat(t,"qMeasures"),[]),s=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);r?z(i,s):function(e){var t=e.auto,n=e.colorMode,r=e.dimensions;return!t&&"byDimension"===n&&r.length>0}({auto:r,colorMode:n,dimensions:i})?U(e,t):function(e){var t=e.auto,n=e.colorMode,r=e.dimensions,i=e.measures,a=e.properties,s=o.getValue(a,"visualization");return!(t||"byMeasure"!==n||!r.length||"map"!==s&&!i.length)}({auto:r,colorMode:n,dimensions:i,measures:a,properties:e})?Y(e,t):function(e,t){var n=o.getValue(e,"color.mode"),r=o.getValue(e,"".concat(t,"qDimensions"),[]),i=o.getValue(e,"".concat(t,"qMeasures"),[]),a=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);"byMultiple"===n&&i.length<2&&o.setValue(e,"color.mode","primary"),z(r,a)}(e,t)},deleteTotalMode:function(e){e.forEach((function(e){e.qOtherTotalSpec&&"qTotalMode"in e.qOtherTotalSpec&&delete e.qOtherTotalSpec.qTotalMode}))},shouldAddColorByExpression:function(e){var t=e.shouldUpdateColorBy,n=e.properties,r=o.getValue(n,"qHyperCubeDef.qMeasures",[]),i=o.getValue(n,"color.mode","");return!t&&"byExpression"===i&&r.length>0},addColorByExpression:function(e){var t=o.getValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",[]),n=o.getValue(e,"color.colorExpression","");t.splice(0,0,{qExpression:n,id:"colorByExpression"}),o.setValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",t)},switchToAutoColor:function(e){o.setValue(e,"color.mode","primary"),o.setValue(e,"color.auto",!0)},shouldSwitchToColorPersistent:function(e){var t=o.getValue(e,"qHyperCubeDef.qDimensions",[]),n=o.getValue(e,"color.persistent",!1);return t.length>1&&!n}},G={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=D.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),o=i.data[0],a=o.dimensions.concat(o.excludedDimensions),s=o.measures.concat(o.excludedMeasures),l=N.IDMAP,u=l.COLOR_BY_ALTERNATIVE,c=l.COLOR_BY_EXPRESSION;return N.moveByIdFromGroup(a,[],"qAttributeDimensions",u),N.moveByIdFromGroup(a,[],"qAttributeExpressions",u),N.moveByIdFromGroup(s,[],"qAttributeExpressions",c),i},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.dataDefinition,i=e.defaultPropertyValues,a=e.hypercubePath,s=e.extension,l=e.supportedFilters,u=e.isHCModifierSupported,c=D.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:a,extension:s,supportedFilters:l,isHCModifierSupported:u}),d=c.qProperty,m=o.getValue(d,"visualization"),f=o.getValue(d,"qHyperCubeDef.qDimensions",[]),p=o.getValue(d,"color.mode",""),h=o.getValue(d,"color.auto",""),y=W.getCanColorBy(d,m),g=W.shouldUpdateColorBy({canColorBy:y,autoColor:h,colorMode:p,dimensions:f});return y[p]?W.shouldAddColorByExpression({shouldUpdateColorBy:g,properties:d})&&W.addColorByExpression(d):W.switchToAutoColor(d),g&&W.updateColorBy(d,"qHyperCubeDef."),W.shouldSwitchToColorPersistent(d)&&W.changeProperty(d,"color.persistent",!0),W.deleteTotalMode(f),c}},X=["bar","marker","line"],K={handleAutoMinMax:function(e){var t=e.initialProperties,n=e.properties;t.measureAxis&&void 0===t.measureAxis.autoMinMax?O(n,"unsupportedAutoMinMax")||g()(n.measureAxis,t.measureAxis):O(n,"supportedAutoMinMax")||g()(n.measureAxis,t.measureAxis)},handleMeasuresAxis:function(e){var t,n=e.exportFormat,r=e.initialProperties,i=e.properties,o=e.measureType,a=i.qHyperCubeDef,s=i.measureAxis;if(function(e){var t=e.exportFormat,n=e.initialProperties;return!(!t.properties.measureAxes||n.measureAxes||!n.measureAxis||void 0===n.measureAxis.autoMinMax)}({exportFormat:n,initialProperties:r})){var l=function(e){var t=[];return e.qMeasures.length>0&&e.qMeasures.forEach((function(e){if(e.qDef.series){var n=e.qDef.series,r=n.type,i=n.axis;t[i]||(t[i]={axis:i,type:{line:0,marker:0,bar:0,total:0}}),X.includes(r)&&t[i].type[r]++,t[i].type.total++}})),t}(a);l.length?(o&&(t=l.filter((function(e){return e.type[o]>0})).sort((function(e,t){return t.type[o]-e.type[o]}))),t&&t.length||(t=l.sort((function(e,t){return t.type.total-e.type.total}))),t&&t[0]&&g()(s,n.properties.measureAxes[t[0].axis])):g()(s,n.properties.measureAxes[0])}},setInterColumnSortOrder:function(e){if(e.qDimensions.length>1){var t=e.qInterColumnSortOrder.indexOf(0);if(0!==t){var n=e.qInterColumnSortOrder[0];e.qInterColumnSortOrder[0]=0,e.qInterColumnSortOrder[t]=n}}}},J={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=e.supportedAutoMinMax,o=void 0===i||i,a=G.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),s=a.properties;return o?(h(s,"measureAxis.min","supportedAutoMinMax"),h(s,"measureAxis.max","supportedAutoMinMax")):(h(s,"measureAxis.min","unsupportedAutoMinMax"),h(s,"measureAxis.max","unsupportedAutoMinMax")),a},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.dataDefinition,i=e.defaultPropertyValues,o=e.hypercubePath,a=e.measureType,s=e.extension,l=e.supportedFilters,u=e.isHCModifierSupported,c=G.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:o,extension:s,supportedFilters:l,isHCModifierSupported:u}),d=c.qProperty;return K.handleAutoMinMax({initialProperties:n,properties:d}),K.handleMeasuresAxis({exportFormat:t,initialProperties:n,properties:d,measureType:a}),K.setInterColumnSortOrder(d.qHyperCubeDef),d.qHyperCubeDef.qColumnOrder=[],d.qHyperCubeDef.columnOrder=[],c}};function Z(e,t,n){return"qLayoutExclude.quarantine.".concat(e,".").concat(t,".").concat(n)}function Q(e){var t=e.properties,n=e.arrayPath,r=e.quarantineName,i=e.arrayName,a=e.itemPath;o.getValue(t,n,[]).forEach((function(e){return function(e){var t=e.properties,n=e.quarantineName,r=e.arrayName,i=e.item,a=e.itemPath,s=o.getValue(i,a);if(void 0!==s){var l=o.getValue(i,"qDef.cId");l||(l=o.generateId(),o.setValue(i,"qDef.cId",l));var u=Z(n,r,l);o.setValue(t,u,s),o.setValue(i,a,void 0)}}({properties:t,quarantineName:r,arrayName:i,item:e,itemPath:a})}))}function ee(e){var t=e.properties,n=e.arrayPath,r=e.quarantineName,i=e.arrayName,a=e.itemPath;o.getValue(t,n,[]).forEach((function(e){return function(e){var t=e.properties,n=e.quarantineName,r=e.arrayName,i=e.item,a=e.itemPath,s=o.getValue(i,"qDef.cId");if(s){var l=Z(n,r,s),u=o.getValue(t,l);void 0!==u&&(o.setValue(i,a,u),o.setValue(t,l,void 0))}}({properties:t,quarantineName:r,arrayName:i,item:e,itemPath:a})}))}var te={quarantine:function(e){Q({properties:e,arrayPath:"qHyperCubeDef.qMeasures",quarantineName:"conditionalColoring",arrayName:"measures",itemPath:"qDef.conditionalColoring"})},unquarantine:function(e){ee({properties:e,arrayPath:"qHyperCubeDef.qMeasures",itemPath:"qDef.conditionalColoring",arrayName:"measures",quarantineName:"conditionalColoring"})}},ne={quarantine:function(e){Q({properties:e,arrayPath:"qHyperCubeDef.qMeasures",quarantineName:"conditionalShowHide",arrayName:"measures",itemPath:"qCalcCondition"}),Q({properties:e,arrayPath:"qHyperCubeDef.qDimensions",quarantineName:"conditionalShowHide",arrayName:"dimensions",itemPath:"qCalcCondition"})},unquarantine:function(e){ee({properties:e,arrayPath:"qHyperCubeDef.qMeasures",quarantineName:"conditionalShowHide",arrayName:"measures",itemPath:"qCalcCondition"}),ee({properties:e,arrayPath:"qHyperCubeDef.qDimensions",quarantineName:"conditionalShowHide",arrayName:"dimensions",itemPath:"qCalcCondition"})},quarantineAlternative:function(e){Q({properties:e,arrayPath:"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",quarantineName:"conditionalShowHide",arrayName:"alternativeMeasures",itemPath:"qCalcCondition"}),Q({properties:e,arrayPath:"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions",quarantineName:"conditionalShowHide",arrayName:"alternativeDimensions",itemPath:"qCalcCondition"})},unquarantineAlternative:function(e){ee({properties:e,arrayPath:"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",quarantineName:"conditionalShowHide",arrayName:"alternativeMeasures",itemPath:"qCalcCondition"}),ee({properties:e,arrayPath:"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions",quarantineName:"conditionalShowHide",arrayName:"alternativeDimensions",itemPath:"qCalcCondition"})}};t.default={hypercube:D,colorChart:G,axisChart:J,quarantineProperty:h,unquarantineProperty:O,quarantineArrayProp:Q,unquarantineArrayProp:ee,conditionalColoring:te,conditionalShow:ne}}]);var hC=z(pC.exports);const yC={version:"1.26.0",qHyperCubeDef:{qAlwaysFullyExpanded:!0,qDimensions:[],qMeasures:[],qInitialDataFetch:[{qWidth:17,qHeight:500}],qSuppressMissing:!0,qSuppressZero:!1},showTitles:!0,subtitle:"",title:"",footnote:"",barGrouping:{grouping:"grouped"},orientation:"vertical",scrollStartPos:0,nullMode:"gap",dataPoint:{show:!1,showLineLabels:!1,showBarLabels:!1},color:{auto:!0,mode:"primary",useBaseColors:"off",paletteColor:{index:6},useDimColVal:!0,useMeasureGradient:!0,persistent:!1,expressionIsColor:!0,expressionLabel:"",measureScheme:"sg",reverseScheme:!1,dimensionScheme:"12",autoMinMax:!0,measureMin:0,measureMax:10},legend:{dock:"auto",show:!0,showTitle:!0},components:[],dimensionAxis:{axisDisplayMode:"auto",continuousAuto:!0,dock:"near",label:"auto",maxVisibleItems:10,show:"all"},measureAxes:[{show:"all",dock:"near",spacing:1,autoMinMax:!0,minMax:"min",min:0,max:10},{show:"all",dock:"far",spacing:1,autoMinMax:!0,minMax:"min",min:0,max:10}],refLine:{refLines:[],refLines2:[],dimRefLines:[]},preferContinuousAxis:!0,showMiniChartForContinuousAxis:!0,tooltip:{auto:!0,hideBasic:!1,title:"",description:"",chart:void 0,imageComponents:void 0}};var gC=e=>t=>{const n=t.qHyperCubeDef.qMeasures,r=[0,0,0];let i;if(!n.length)return e.get("Visualizations.Descriptions.Bars");for(let e=0;e<n.length;++e)i=Fh(n[e].qDef.series),i===Sm.TYPE.BAR?r[0]=1:i===Sm.TYPE.LINE?r[1]=1:r[2]=1;const o=["Visualizations.Descriptions.Marker","Visualizations.Descriptions.Line","Visualizations.Descriptions.ComboChart.Dimension.LineMarker","Visualizations.Descriptions.Bars","Visualizations.Descriptions.ComboChart.Dimension.BarMarker","Visualizations.Descriptions.ComboChart.Dimension.BarLine","Visualizations.Descriptions.ComboChart.Dimension.BarLineMarker"][parseInt(r.join(""),2)-1];return e.get(o)},vC=e=>(t,n)=>{let r;const i=t.qHyperCubeDef.qMeasures[n];if(i){const{type:e}=i.qDef.series;r=e===Sm.TYPE.LINE?"Visualizations.Descriptions.HeightLine":e===Sm.TYPE.BAR?"Visualizations.Descriptions.LengthBars":"Visualizations.Descriptions.ComboChart.Measure.HeightMarker"}else r=n?"Visualizations.Descriptions.HeightLine":"Visualizations.Descriptions.LengthBars";return e.get(r)};function bC(e){var t,n;const r=e.qHyperCubeDef.qMeasures,i=null===(t=e.color)||void 0===t?void 0:t.mode;"byDimension"===i&&1===r.length&&Fh(null===(n=r[0].qDef)||void 0===n?void 0:n.series)===Sm.TYPE.LINE?e.color.mode="primary":"byDimension"===i&&r.length>1&&(e.color.mode="byMultiple")}function xC(e){const{translator:t}=e;return{dimensions:{min:1,max:1,description:gC(t),added(e,t){Rm.addCallbackCustomTooltip(t)},moved(e,t){Rm.moveCallbackCustomTooltip(t,e)},removed(e,t){Rm.removeCallbackCustomTooltip(t,e)},replaced(e,t,n,r){Rm.replaceCallbackCustomTooltip(r,t)}},measures:{min:1,max:15,description:vC(t),added({qDef:e},t){var n;bC(t),null!==(n=e.series)&&void 0!==n&&n.type||(t.qHyperCubeDef.qMeasures.length>1?e.series={type:Sm.TYPE.LINE,axis:Sm.AXIS.SECONDARY}:e.series={type:Sm.TYPE.BAR,axis:Sm.AXIS.PRIMARY})},moved(e,t){bC(t)}}}}function SC(e){const t=xC(e);return{properties:yC,data:{targets:[{path:"/qHyperCubeDef",...t}]},importProperties:({exportFormat:e,initialProperties:n,hypercubePath:r})=>{const i=hC.axisChart.importProperties({exportFormat:e,initialProperties:n,dataDefinition:t,hypercubePath:r}),o="linechart"===e.properties.visualization,a=[];i.qProperty.qHyperCubeDef.qMeasures.forEach((e=>{e.qDef.series||(e.qDef.series={type:o?"line":"bar",axis:0,marker:"circle",markerFill:!0}),a.indexOf(e.qDef.series.axis)<0&&a.push(e.qDef.series.axis)}));const s=a.sort().shift();return i.qProperty.measureAxes[s]&&e.properties.measureAxis&&void 0!==e.properties.measureAxis.autoMinMax&&G(!0,i.qProperty.measureAxes[s],e.properties.measureAxis,{logarithmic:!1}),i},exportProperties:({propertyTree:e,hyperCubePath:t,viewDataMode:n})=>hC.axisChart.exportProperties({propertyTree:e,hyperCubePath:t,viewDataMode:n})}}const MC=(e,t,n,r)=>{const i=`${t}.fontFamily`,o=`${t}.fontSize`;return{fontFamilyItem:{component:"dropdown",ref:`${e}.fontFamily`,options:()=>n.getOptions(i),defaultValue:()=>n.getDefaultValue(i)},fontWrapperItem:{component:"inline-wrapper",items:{fontSizeItem:{component:"dropdown",ref:`${e}.fontSize`,options:()=>n.getOptions(o),defaultValue:()=>n.getDefaultValue(o)},fontColorItem:{component:"color-picker",width:!1,ref:`${e}.color`,defaultValue:()=>({color:r.getStyle("object.comboChart",t,"color")})}}}}};function EC(e,t,n){const r=function(e){var t=e.theme,n=e.translator,r=e.config,i=void 0===r?{}:r,o=e.flags,a=function(e){var t=e.config,n=void 0===t?{}:t,r=n.id,i=n.paths;return{id:void 0===r?"object":"".concat("object",".").concat(r),paths:Array.isArray(i)?i:[]}}({config:i}),s=a.id,l=a.paths,u={};l.forEach((function(e){for(var r=e.split("."),i=u,a=0;a<r.length;a++){var l=r[a];a===r.length-1?i[l]=om({theme:t,translator:n,id:s,path:e,flags:o}):void 0===i[l]&&(i[l]={}),i=i[l]}}));var c=function(e){for(var t=e.split("."),n=u,r=0;r<t.length;r++){var i=t[r];if(void 0===n[i])throw new Error("font-resolver: Path '".concat(e,"' could not be resolved."));n=n[i]}return n};return u.getDefaultValue=function(e){return c(e).getDefaultValue()},u.getOptions=function(e){return c(e).getOptions()},u}({theme:t,translator:n,flags:e,config:{id:"comboChart",paths:["axis.title","axis.label.name","label.value","legend.title","legend.label"]}});if(null!=e&&e.isEnabled("SENSECLIENT_IM_311_STYLINGPANEL_COMBOCHART"))return{component:"styling-panel",show:!0,chartType:"combochart",translation:"LayerStyleEditor.component.styling",chartTitle:"Object.ComboChart",subtitle:"LayerStyleEditor.component.styling",useGeneral:!0,useBackground:null==e?void 0:e.isEnabled("SENSECLIENT_IM_2431_COMBOCHART_BG"),items:{barSection:{translation:"Visualizations.Descriptions.Bars",component:"accordion",items:{outlineSection:{translation:"properties.Outline",component:"panel-section",items:{wrapperItem:{component:"items",ref:"components",key:"bar",items:{barStroke:{component:"inline-wrapper",items:{strokeWidth:{ref:"style.strokeWidth",width:!0,component:"dropdown",options:[{translation:"Common.None",value:"none"},{translation:"Common.Small",value:"small"},{translation:"Common.Medium",value:"medium"},{translation:"Common.Large",value:"large"}],defaultValue:"none",schemaIgnore:!0},strokeColor:{ref:"style.strokeColor",defaultValue:{color:"#205891"},schemaIgnore:!0,width:"auto",component:"color-picker"}}}}}}},widthSection:{translation:"LayerStyleEditor.style.barWidth",component:"panel-section",items:{barWidth:{component:"items",ref:"components",key:"bar",items:{width:{ref:"style.width",component:"slider",min:.01,max:1,step:.01,defaultValue:.7,schemaIgnore:!0}}}}},labelValueSection:null!=e&&e.isEnabled("CLIENT_IM_3050")?{translation:"properties.dataPoints.barlabelmode",component:"panel-section",items:{labelItems:{component:"items",ref:"components",key:"bar",items:{...MC("bar.label.value","label.value",r,t),contrastColor:{component:"checkbox",type:"boolean",ref:"bar.label.value.useContrastColor",translation:"properties.dataPoints.valuelabel.contrast",defaultValue:!0}}}}}:void 0}},lineSection:{translation:"Visualizations.Descriptions.Lines",component:"accordion",items:{dataPointSection:{translation:"LayerStyleEditor.style.dataPointSize",component:"panel-section",items:{dataPointSize:{component:"items",ref:"components",key:"line",items:{size:{ref:"style.dataPointSize",component:"slider",min:3,max:20,step:1,defaultValue:6,schemaIgnore:!0}}}}},lineSection:{translation:"Line options",component:"panel-section",items:{wrapperItem:{component:"items",ref:"components",key:"line",items:{size:{ref:"style.lineThickness",translation:"Thickness",component:"slider",defaultValue:1,min:1,max:5,step:1,schemaIgnore:!0},type:{ref:"style.lineType",translation:"Type",component:"dropdown",width:"auto",grouped:!0,options:[{value:"solid",translation:"LayerStyleEditor.style.solid"},{value:"dashed",translation:"LayerStyleEditor.style.dashed"}],defaultValue:"solid",schemaIgnore:!0},curve:{ref:"style.lineCurve",translation:"Curve",component:"dropdown",width:"auto",grouped:!0,options:[{value:"linear",translation:"LayerStyleEditor.style.linear"},{value:"monotone",translation:"LayerStyleEditor.style.monotone"}],defaultValue:"linear",schemaIgnore:!0}}}}},labelValueSection:null!=e&&e.isEnabled("CLIENT_IM_3050")?{translation:"properties.dataPoints.linelabelmode",component:"panel-section",items:{labelItems:{component:"items",ref:"components",key:"line",items:MC("line.label.value","label.value",r,t)}}}:void 0}},axisTitleSection:null!=e&&e.isEnabled("CLIENT_IM_3050")?{translation:"properties.axis.title",component:"panel-section",items:{labelItems:{component:"items",ref:"components",key:"axis",items:MC("axis.title","axis.title",r,t)}}}:void 0,axisLabelSection:null!=e&&e.isEnabled("CLIENT_IM_3050")?{translation:"properties.axis.label",component:"panel-section",items:{labelItems:{component:"items",ref:"components",key:"axis",items:MC("axis.label.name","axis.label.name",r,t)}}}:void 0,legendTitleSection:null!=e&&e.isEnabled("CLIENT_IM_3051")?{translation:"properties.legend.title",component:"panel-section",items:{labelItems:{component:"items",ref:"components",key:"legend",items:MC("legend.title","legend.title",r,t)}}}:void 0,legendLabelSection:null!=e&&e.isEnabled("CLIENT_IM_3051")?{translation:"properties.legend.label",component:"panel-section",items:{labelItems:{component:"items",ref:"components",key:"legend",items:MC("legend.label","legend.label",r,t)}}}:void 0}};const i={component:"dropdown",type:"string",expression:"optional",baseRef:"style.strokeWidth",translation:"LayerStyleEditor.style.strokeWidth",show:!0,defaultValue:"none",options:[{value:"none",translation:"LayerStyleEditor.style.strokeWidth.none"},{value:"small",translation:"LayerStyleEditor.style.strokeWidth.small"},{value:"medium",translation:"LayerStyleEditor.style.strokeWidth.medium"},{value:"large",translation:"LayerStyleEditor.style.strokeWidth.large"}]},o={component:"color-picker",type:"object",baseRef:"style.strokeColor",translation:"LayerStyleEditor.style.strokeColor",dualOutput:!0,show:e=>"none"!==Vl(e,`${((e,t)=>{let n=-1;for(let r=0;r<e.length;r++)if(e[r].key===t){n=r;break}return n})(e,"bar")}.${i.baseRef}`),defaultValue:()=>({index:-1,color:"#205891"})},a={component:"slider",type:"number",expression:"optional",baseRef:"style.width",translation:"LayerStyleEditor.style.barWidth",show:(e,t,n)=>{const r=t.getMeasures().some((e=>Fh(e.qDef.series)===Sm.TYPE.LINE));return!ue.continuous(n.layout,r&&re.isTime(!0,n.layout))},defaultValue:.7,min:.01,max:1,step:.01},s={component:"slider",type:"number",expression:"optional",baseRef:"style.dataPointSize",translation:"LayerStyleEditor.style.dataPointSize",show:!0,defaultValue:6,min:3,max:20,step:1},l={component:"slider",type:"number",expression:"optional",baseRef:"style.lineThickness",translation:"LayerStyleEditor.style.lineThickness",show:!0,defaultValue:1,min:1,max:5,step:1},u={component:"dropdown",type:"string",expression:"optional",baseRef:"style.lineType",translation:"LayerStyleEditor.style.lineType",show:!0,defaultValue:"solid",options:[{value:"solid",translation:"LayerStyleEditor.style.solid"},{value:"dashed",translation:"LayerStyleEditor.style.dashed"}]},c={component:"dropdown",type:"string",expression:"optional",baseRef:"style.lineCurve",translation:"LayerStyleEditor.style.lineCurve",show:!0,defaultValue:"linear",options:[{value:"linear",translation:"LayerStyleEditor.style.linear"},{value:"monotone",translation:"LayerStyleEditor.style.monotone"}]};return{component:"style-editor",translation:"LayerStyleEditor.component.styling",subtitle:"LayerStyleEditor.component.styling",resetBtnTranslation:"LayerStyleEditor.component.resetAll",key:["bar","line"],ref:"components",defaultValue:[],defaultValues(e){const t="grouped"===e.barGrouping.grouping,n=e.qHyperCubeDef.qMeasures.filter((e=>Fh(e.qDef.series)===Sm.TYPE.BAR)).length,r=t&&n>1;return[{key:"bar",style:{strokeWidth:i.defaultValue,strokeColor:o.defaultValue(),width:r?.9:.7}},{key:"line",style:{dataPointSize:s.defaultValue,lineThickness:l.defaultValue,lineType:u.defaultValue,lineCurve:c.defaultValue}}]},items:{list:{type:"items",component:"expandable-items",items:{bar:{type:"items",translation:"Visualizations.Descriptions.Bar",expanded:!0,styleKey:"bar",items:{barStrokeWidth:i,barStrokeColor:o,barWidth:a}},line:{type:"items",translation:"Visualizations.Descriptions.Line",expanded:!0,styleKey:"line",items:{dataPointSize:s,lineThickness:l,lineType:u,lineCurve:c}}}}}}}const CC={classification:{section:"styling",tags:["simple"],exclusive:!0},component:"items",show:!0,chartType:"combochart",translation:"LayerStyleEditor.component.styling",chartTitle:"Object.ComboChart",subtitle:"LayerStyleEditor.component.styling",useGeneral:!0,items:{barsSection:{component:"items",items:{wrapperItem:{component:"items",ref:"components",key:"bar",items:{barsHeader:{component:"header",translation:"Visualizations.Descriptions.Bars"},outlineSection:{component:"items",items:{barStroke:{component:"inline-wrapper",items:{strokeWidth:{ref:"style.strokeWidth",width:!0,component:"dropdown",translation:"LayerStyleEditor.style.strokeWidth",options:[{translation:"Common.None",value:"none"},{translation:"Common.Small",value:"small"},{translation:"Common.Medium",value:"medium"},{translation:"Common.Large",value:"large"}],defaultValue:"none",schemaIgnore:!0},strokeColor:{ref:"style.strokeColor",schemaIgnore:!0,defaultValue:{color:"#205891"},width:"auto",component:"color-picker"}}}}},widthSection:{component:"items",items:{barWidth:{component:"items",items:{width:{ref:"style.width",translation:"LayerStyleEditor.style.barWidth",component:"slider",min:.01,max:1,step:.01,schemaIgnore:!0,defaultValue:.7}}}}}}}}},linesSection:{component:"items",items:{wrapperItem:{component:"items",items:{linesHeader:{component:"header",translation:"Visualizations.Descriptions.Lines"},dataPointSection:{component:"items",items:{dataPointSize:{component:"items",ref:"components",key:"line",items:{size:{ref:"style.dataPointSize",translation:"LayerStyleEditor.style.dataPointSize",component:"slider",min:3,max:20,step:1,defaultValue:6,schemaIgnore:!0}}}}},lineSection:{component:"items",items:{wrapperItem:{component:"items",ref:"components",key:"line",items:{size:{ref:"style.lineThickness",translation:"LayerStyleEditor.style.lineThickness",component:"slider",defaultValue:1,min:1,max:5,step:1,schemaIgnore:!0},type:{ref:"style.lineType",translation:"LayerStyleEditor.style.lineType",component:"dropdown",width:"auto",grouped:!0,options:[{value:"solid",translation:"LayerStyleEditor.style.solid"},{value:"dashed",translation:"LayerStyleEditor.style.dashed"}],defaultValue:"solid",schemaIgnore:!0},curve:{ref:"style.lineCurve",translation:"LayerStyleEditor.style.lineCurve",component:"dropdown",width:"auto",grouped:!0,options:[{value:"linear",translation:"LayerStyleEditor.style.linear"},{value:"monotone",translation:"LayerStyleEditor.style.monotone"}],defaultValue:"linear",schemaIgnore:!0}}}}}}}}},optionsSection:{component:"items",items:{wrapperItem:{component:"items",items:{optionsHeader:{component:"header",translation:"LayerStyleEditor.label.Options"},scrollStartPos:{ref:"scrollStartPos",translation:"properties.ScrollAlignment",component:"dropdown",defaultValue:0,options:[{value:0,translation:"properties.ScrollAlignStart"},{value:1,translation:"properties.ScrollAlignEnd"}]},dataPoints:{ref:"dataPoint.show",translation:"properties.dataPoints.showDataPoints",type:"boolean",defaultValue:!1}}}}}}};function qC(e){const t=Vl(e,"qHyperCube.qMeasureInfo",[]).some((({series:e=Sm.NOPE_SERIES})=>Fh(e)===Sm.TYPE.LINE));return ue.continuous(e,(()=>t&&re.isTime(!0,e)))}function AC(e){var t,n;return!(null===(t=e.qDef)||void 0===t||null===(n=t.color)||void 0===n||!n.on)}function OC(e){var t,n,r;return AC(e)&&"primary"===(null!==(t=null===(n=e.qDef)||void 0===n||null===(r=n.color)||void 0===r?void 0:r.mode)&&void 0!==t?t:"primary")}function DC(e){var t,n;return AC(e)&&"byExpression"===(null===(t=e.qDef)||void 0===t||null===(n=t.color)||void 0===n?void 0:n.mode)}function IC(e){var t,n,r,i,o;if(null!=e&&null!==(t=e.color)&&void 0!==t&&t.auto||"byExpression"!==(null==e||null===(n=e.color)||void 0===n?void 0:n.mode))return[];const a=null==e||null===(r=e.color)||void 0===r?void 0:r.colorExpression,s=null!==(i=null==e||null===(o=e.color)||void 0===o?void 0:o.expressionLabel)&&void 0!==i?i:"";return a?[{qExpression:a,label:s,id:"colorByExpression"}]:[]}function wC(e){return DC(e)?[{qExpression:e.qDef.color.colorExpression,id:"colorByMeasureExpression"}]:[]}function TC(e){var t,n;(null!==(t=null==e||null===(n=e.qHyperCubeDef)||void 0===n?void 0:n.qMeasures)&&void 0!==t?t:[]).forEach(((t,n)=>function(e,t,n){e.qAttributeExpressions=0===t?[...IC(n),...wC(e)]:wC(e)}(t,n,e)))}function NC(e){var t,n;const r={ref:"qDef.series.type",type:"string",component:"item-selection-list",defaultValue:"bar",schemaIgnore:!0,horizontal:!0,items:[{icon:e=>"stacked"===e.barGrouping.grouping||qC(e)?"stacked":"grouped",component:"icon-item",labelPlacement:"bottom",translation:"properties.style.bar",value:"bar"},{icon:"line_chart_line",component:"icon-item",labelPlacement:"bottom",translation:"properties.style.line",value:"line"},{icon:"shapes",component:"icon-item",labelPlacement:"bottom",translation:"properties.style.marker",value:"marker"}]},i={ref:"qDef.series.marker",type:"string",component:"dropdown",defaultValue:"circle",options:[{translation:"properties.marker.circle",value:"circle"},{translation:"properties.marker.rect",value:"rect"},{translation:"properties.marker.diamond",value:"diamond"},{translation:"properties.marker.triangle",value:"triangle"},{translation:"properties.marker.line",value:"line"}],show(e){var t;return Fh(null===(t=e.qDef)||void 0===t?void 0:t.series)===Sm.TYPE.MARKER}},o={ref:"qDef.series.markerFill",translation:"properties.series.fill",type:"boolean",defaultValue:!0,show(e){var t;return Fh(null===(t=e.qDef)||void 0===t?void 0:t.series)===Sm.TYPE.MARKER&&!["line"].includes(e.qDef.series.marker)}},a={ref:"qDef.color.mode",type:"string",component:"dropdown",options:[{value:"primary",translation:"properties.colorMode.primary"},{value:"byExpression",translation:"properties.colorMode.byExpression"}],defaultValue:"primary",show:(...e)=>AC(...e)},s=null===(t=e.anything)||void 0===t||null===(n=t.sense)||void 0===n?void 0:n.theme;return{items:{series:{type:"items",items:{supPanel:{translation:"properties.measure.moreProperties",title:"properties.measure.moreProperties",subTitle:(e,t,n)=>{var r;return null===(r=n.measureTitle)||void 0===r?void 0:r.call(n)},component:"sub-panel",type:"items",items:{groups:{type:"items",component:"expandable-items",items:{presentation:{type:"items",translation:"properties.presentation",items:{seriesType:r,seriesAxis:{ref:"qDef.series.axis",type:"integer",component:"dropdown",defaultValue:0,options:[{translation:"properties.axis.primary",value:0},{translation:"properties.axis.secondary",value:1}]},seriesMarker:i,seriesMarkerFill:o}},color:{type:"items",translation:"properties.color",items:{customColor:{ref:"qDef.color.on",translation:"properties.colors",type:"boolean",component:"switch",defaultValue:!1,trueOption:{value:!1,translation:"Common.Auto"},falseOption:{value:!0,translation:"Common.Custom"}},colorMode:a,paletteColor:{ref:"qDef.color.paletteColor",translation:"properties.color",type:"object",component:"color-picker",dualOutput:!0,defaultValue:()=>{var e;const{primary:t}=s.getDataColorSpecials(),n=null===(e=s.getDataColorPickerPalettes()[0])||void 0===e?void 0:e.colors,r=n.indexOf(t);return{index:-1===r?Math.min(6,n.length-1):r}},show:OC},attributeExpression:{type:"string",component:"expression",expressionType:"measure",schemaIgnore:!0,ref:"qDef.color.colorExpression",translation:"Common.Expression",show:DC}}}}}}}}}}}}const LC=10,kC=!0;function RC(e,t,n){let r;const i=n||0;var o,a;t?r=t.getMeasureLayouts():r=null!==(o=null==e||null===(a=e.qHyperCubeDef)||void 0===a?void 0:a.qMeasures)&&void 0!==o?o:[];return r.filter((e=>{const{series:t}=e||{};return 0===i?px(t,kC):!px(t,kC)}))}function PC(e,t){return t.getMeasures().filter((e=>Fh(e.qDef.series)===Sm.TYPE.LINE)).length>0}function FC(e,t,n){const r=t.getMeasures().filter((e=>Fh(e.qDef.series)===Sm.TYPE.BAR));return r.filter((e=>e.qDef.series.axis!==Sm.AXIS.SECONDARY)).length>n||r.filter((e=>e.qDef.series.axis===Sm.AXIS.SECONDARY)).length>n}const zC=(e,t,n,r)=>{const i="vertical"===t.layout.orientation||qC(t.layout)?"y":"x",o=RC(e,t,r).map((e=>e.qFallbackTitle));let a;return a=o.length?n.get(`properties.${i}AxisWithInfo`,[o.join(",")]):n.get(`properties.${i}Axis`),a};function _C(e){var t,n,r,i,o;const{translator:a,flags:s,anything:l}=e,u=null==e||null===(t=e.anything)||void 0===t||null===(n=t.sense)||void 0===n?void 0:n.theme,c=null==e||null===(r=e.anything)||void 0===r||null===(i=r.sense)||void 0===i||null===(o=i.isUnsupportedFeature)||void 0===o?void 0:o.call(i,"continuousData"),d={items:{attributeExpression:{ref:"color.colorExpression",change:null,globalChange:e=>TC(e)},expressionLabel:{change:null},disclaimer:{component:"text",translation:"properties.color.colorOnMeasureDisclaimer",style:"hint",show:e=>e.qHyperCubeDef.qMeasures.some((e=>AC(e)))}}},m=e=>!!e&&(e.coloring&&e.coloring.baseColor&&e.coloring.baseColor.color?e.coloring.baseColor:!(!e.baseColor||!e.baseColor.color)&&e.baseColor);const f=(e,t)=>!Vl(e,"color.auto")&&"primary"===Vl(e,"color.mode")&&!((e=>Vl(e,"layout.qHyperCube.qMeasureInfo",[]).filter((e=>!!m(e))).length>0)(t)&&"measure"===Vl(e,"color.useBaseColors")||function(e){return Vl(e,"layout.qHyperCube.qDimensionInfo",[]).filter((e=>!!m(e))).length>0}(t)&&"dimension"===Vl(e,"color.useBaseColors")),p=(e,t)=>{var n,r;return e.qHyperCubeDef.qMeasures.some((e=>AC(e)))||!s.isEnabled("SIMPLE_PROPERTIES_LIBRARY_COLOR")&&!(null!=e&&null!==(n=e.color)&&void 0!==n&&n.auto||"primary"!==(null==e||null===(r=e.color)||void 0===r?void 0:r.mode)||f(e,t))},h={items:{disclaimer:{show:(e,t)=>p(e,t),reset:e=>{e.qHyperCubeDef.qMeasures.forEach((e=>{var t;Vl(t=e,"qDef.color.on",void 0)&&Ul(t,"qDef.color.on",!1)}))}},simpleItems:{show:(e,t)=>!p(e,t)}}},y={items:{labels:{items:{header:{show:e=>e.qHyperCubeDef.qDimensions.length&&e.qHyperCubeDef.qMeasures.length},barLabels:{component:"checkbox",ref:"dataPoint.showBarLabels",type:"boolean",translation:"Simple.Label.Bar",show:(e,t)=>e.qHyperCubeDef.qDimensions.length&&e.qHyperCubeDef.qMeasures.length&&FC(0,t,0)},lineLabels:{component:"checkbox",ref:"dataPoint.showLineLabels",type:"boolean",translation:"Simple.Label.Line",show:(e,t)=>e.qHyperCubeDef.qDimensions.length&&e.qHyperCubeDef.qMeasures.length&&PC(0,t),convertFunctions:{get:(e,t,n,r)=>r.dataPoint.show&&r.dataPoint.showLineLabels,set(e,t,n,r,i){i.dataPoint.showLineLabels=e,i.dataPoint.show=e}},reset(e){Ul(e,"dataPoint.show",!1),Ul(e,"dataPoint.showLineLabels",!1)}},dimensionTitle:{component:"checkbox",ref:"dimensionAxis.show",type:"string",translation:"Simple.Label.Dimension.Hide",defaultValue:"all",show:e=>e.qHyperCubeDef.qDimensions.length&&e.qHyperCubeDef.qMeasures.length,convertFunctions:{get:(e,t,n,r)=>"labels"===r.dimensionAxis.show||"none"===r.dimensionAxis.show,set(e,t,n,r,i){i.dimensionAxis.show=e?"labels":"all"}}},primaryMeasureTitle:{component:"checkbox",ref:"measureAxes.0.show",type:"string",label:(e,t)=>a.get(RC(e,t,1).length>0?"Simple.Label.PrimaryMeasure.Hide":"Simple.Label.Measure.Hide"),defaultValue:"all",show:(e,t)=>e.qHyperCubeDef.qDimensions.length&&e.qHyperCubeDef.qMeasures.length&&RC(e,t,0).length>0,convertFunctions:{get:(e,t,n,r)=>"labels"===r.measureAxes[0].show||"none"===r.measureAxes[0].show,set(e,t,n,r,i){i.measureAxes[0].show=e?"labels":"all"}}},secondaryMeasureTitle:{component:"checkbox",ref:"measureAxes.1.show",type:"string",translation:"Simple.Label.SecondaryMeasure.Hide",defaultValue:"all",show:(e,t)=>e.qHyperCubeDef.qDimensions.length&&e.qHyperCubeDef.qMeasures.length&&RC(e,t,1).length>0,convertFunctions:{get:(e,t,n,r)=>"labels"===r.measureAxes[1].show||"none"===r.measureAxes[1].show,set(e,t,n,r,i){i.measureAxes[1].show=e?"labels":"all"}}}}}}},g={uses:"settings",items:{simpleStyling:null!=s&&s.isEnabled("COMBOCHART_SIMPLE_STYLING")?CC:void 0,simpleLabels:y,presentation:{type:"items",translation:"properties.presentation",grouped:!0,items:{comboStyling:EC(s,u,a),grouping:{ref:"barGrouping.grouping",type:"string",component:"item-selection-list",defaultValue:"grouped",horizontal:!0,items:[{icon:"grouped",component:"icon-item",labelPlacement:"bottom",translation:"properties.grouping.grouped",value:"grouped"},{icon:"stacked",component:"icon-item",labelPlacement:"bottom",translation:"properties.grouping.stacked",value:"stacked"}],show:(e,t,n)=>FC(0,t,1)&&!qC(n.layout)},orientation:{ref:"orientation",type:"string",component:"item-selection-list",defaultValue:"vertical",horizontal:!0,items:[{component:"icon-item",icon:"bars_vertical",labelPlacement:"bottom",translation:"properties.orientation.vertical",value:"vertical"},{icon:"bars_horizontal",component:"icon-item",labelPlacement:"bottom",translation:"Common.Horizontal",value:"horizontal"}],readOnly:(e,t,n)=>qC(n.layout),convertFunctions:(v="vertical",{get:(e,t,n)=>qC(n.layout)?v:e(t.type),set(e,t,n,r){t(n.type,qC(r.layout)?v:e,v)}})},scrollStartPos:{ref:"scrollStartPos",type:"number",translation:"properties.ScrollAlignment",component:"dropdown",defaultValue:0,options:[{value:0,translation:"properties.ScrollAlignStart"},{value:1,translation:"properties.ScrollAlignEnd"}],show:(e,t,n)=>!qC(n.layout)},nullMode:{type:"string",component:"dropdown",ref:"nullMode",translation:"properties.nullMode",options:[{value:"gap",translation:"properties.nullMode.gap"},{value:"connect",translation:"properties.nullMode.connect"},{value:"zero",translation:"properties.nullMode.zero"}],defaultValue:"gap",show:(e,t)=>PC(0,t)},dataPointSettings:{type:"items",grouped:!1,snapshot:{tid:"property-dataPoint"},show:(e,t)=>PC(0,t),items:{dataPoints:{ref:"dataPoint.show",translation:"properties.dataPoints.showDataPoints",type:"boolean",defaultValue:!1},showLineDataPointLabels:{ref:"dataPoint.showLineLabels",translation:"properties.dataPoints.linelabelmode",type:"boolean",component:"switch",defaultValue:!1,show:e=>e.dataPoint&&e.dataPoint.show,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"properties.off"}]}}},showBarLabels:{ref:"dataPoint.showBarLabels",type:"boolean",translation:"properties.dataPoints.barlabelmode",component:"switch",show:(e,t)=>FC(0,t,0),defaultValue:!1,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"properties.off"}]}}},colorsAndLegend:{uses:"colorsAndLegend",items:{colors:d,simpleColors:h,legend:{items:{show:{snapshot:{tid:"property-legend"}}}}}},dimensionAxis:{uses:"axis.dimensionAxis",label(e,t){const n="vertical"===t.layout.orientation||qC(t.layout)?"x":"y",r=function(e,t){return t?t.getDimensionLayouts():e.qHyperCubeDef.qDimensions.map((e=>e.qDef))}(e,t).map((e=>e.qFallbackTitle||"")).join(", ");let i;return i=r?a.get(`properties.${n}AxisWithInfo`,[r]):a.get(`properties.${n}Axis`),i},items:{othersGroup:{items:{dock:{options(e,t){let n="Common.Bottom",r="Common.Top";return"vertical"===t.layout.orientation||qC(t.layout)||(n=e.yMirrorMode?"properties.dock.right":"properties.dock.left",r=e.yMirrorMode?"properties.dock.left":"properties.dock.right"),[{value:"near",translation:n},{value:"far",translation:r}]}}}},axisDisplaySettings:{type:"items",components:"items",show:(e,t,n)=>!qC(n.layout),items:{axisDisplayMode:{type:"string",translation:"properties.axis.displaymode",ref:"dimensionAxis.axisDisplayMode",component:"dropdown",defaultValue:"auto",options:[{value:"auto",translation:"properties.axis.displaymode.auto"},{value:"max",translation:"properties.axis.displaymode.max"},{value:"custom",translation:"properties.axis.displaymode.custom"}]},maxVisibleItems:{type:"integer",translation:"properties.axis.maxvisiblevalues",ref:"dimensionAxis.maxVisibleItems",expression:"optional",defaultValue:LC,show:e=>"custom"===e.dimensionAxis.axisDisplayMode,invalid(e){const{qDimensions:t,qMeasures:n}=e.qHyperCubeDef,{maxVisibleItems:r}=e.dimensionAxis;return r<0||r>1e4/(t.length+n.length)},globalChange(e){if("custom"===e.dimensionAxis.axisDisplayMode){const{qDimensions:t,qMeasures:n}=e.qHyperCubeDef,{maxVisibleItems:r}=e.dimensionAxis;r<1?e.dimensionAxis.maxVisibleItems=LC:r>1e4/(t.length+n.length)&&(e.dimensionAxis.maxVisibleItems=Math.min(r,Math.floor(1e4/(t.length+n.length))))}}},hint:{component:"text",translation:"properties.axis.maxvisiblevalues.hint.combochart",style:"hint",show:e=>["custom","max"].indexOf(e.dimensionAxis.axisDisplayMode)>-1}}}},continuousGroup:{show:!c}},measureAxis:{uses:"axis.measureAxis",label:(e,t)=>zC(e,t,a,0),show:(e,t)=>RC(e,t,0).length>0,items:{axis:{items:{measureAxisTitle:{component:"header",type:"string",label:(e,t)=>zC(e,t,a,0),show:(e,t)=>RC(e,t,0).length>0,classification:{section:"axis",tags:["simple"],exclusive:!0}},show:{ref:"measureAxes.0.show",snapshot:{title:"properties.axis.primary",tid:"property-primary-axis",show(e){var t;return((null==e||null===(t=e.qHyperCube)||void 0===t?void 0:t.qMeasureInfo)||[]).some((e=>(null==e?void 0:e.series)&&px(null==e?void 0:e.series,kC)))}}},dock:{ref:"measureAxes.0.dock",show:(e,t)=>"none"!==e.measureAxes[0].show&&RC(e,t,0).length>0,options(e,t){let n="Common.Bottom",r="Common.Top";return("vertical"===t.layout.orientation||qC(t.layout))&&(n=e.yMirrorMode?"properties.dock.right":"properties.dock.left",r=e.yMirrorMode?"properties.dock.left":"properties.dock.right"),[{value:"near",translation:n},{value:"far",translation:r}]}},spacing:{ref:"measureAxes.0.spacing",show:(e,t)=>e.measureAxes[0]&&"none"!==e.measureAxes[0].show&&RC(e,t,0).length>0}}},minMax:{items:{autoMinMax:{ref:"measureAxes.0.autoMinMax"},minMax:{ref:"measureAxes.0.minMax",defaultValue:"min",show:e=>!e.measureAxes[0].autoMinMax},min:{ref:"measureAxes.0.min",show:e=>["min","minMax"].includes(e.measureAxes[0].minMax)&&!e.measureAxes[0].autoMinMax,invalid:e=>"minMax"===e.measureAxes[0].minMax&&e.measureAxes[0].min>=e.measureAxes[0].max},max:{ref:"measureAxes.0.max",show:e=>["max","minMax"].includes(e.measureAxes[0].minMax)&&!e.measureAxes[0].autoMinMax,invalid:e=>"minMax"===e.measureAxes[0].minMax&&e.measureAxes[0].min>=e.measureAxes[0].max}}},startAt:{type:"string",component:"dropdown",translation:"properties.axis.startAt",show:(e,t)=>RC(e,t,0).length>0,readOnly:e=>!(e.measureAxes[0].autoMinMax||"min"===e.measureAxes[0].minMax&&0===e.measureAxes[0].min),options:[{value:"zero",translation:"properties.axis.startAt.zero"},{value:"lowest",translation:"properties.axis.startAt.lowest"}],defaultValue:"lowest",convertFunctions:{get(e,t,n,r){const{autoMinMax:i,minMax:o,min:a}=(null==r?void 0:r.measureAxes[0])||{};return!0===i?"lowest":i||"min"!==o||0!==a?e(t.type):"zero"},set(e,t,n,r,i){"zero"===e?(Ul(i,"measureAxes.0.autoMinMax",!1),Ul(i,"measureAxes.0.minMax","min"),Ul(i,"measureAxes.0.min",0)):Ul(i,"measureAxes.0.autoMinMax",!0)}},classification:{section:"axis",tags:["simple"],exclusive:!0}}}},secondaryMeasureAxis:{uses:"axis.measureAxis",label:(e,t)=>zC(e,t,a,1),show:(e,t)=>RC(e,t,1).length>0,items:{axis:{items:{measureAxisTitle:{component:"header",type:"string",label:(e,t)=>zC(e,t,a,1),show:(e,t)=>RC(e,t,1).length>0,classification:{section:"axis",tags:["simple"],exclusive:!0}},show:{ref:"measureAxes.1.show",snapshot:{title:"properties.axis.secondary",tid:"property-secondary-Axis",show(e){var t;return((null==e||null===(t=e.qHyperCube)||void 0===t?void 0:t.qMeasureInfo)||[]).some((e=>(null==e?void 0:e.series)&&!px(null==e?void 0:e.series,kC)))}}},dock:{ref:"measureAxes.1.dock",defaultValue:"far",show:(e,t)=>"none"!==e.measureAxes[1].show&&RC(e,t,1).length>0,options(e,t){let n="Common.Bottom",r="Common.Top";return("vertical"===t.layout.orientation||qC(t.layout))&&(n=e.yMirrorMode?"properties.dock.right":"properties.dock.left",r=e.yMirrorMode?"properties.dock.left":"properties.dock.right"),[{value:"near",translation:n},{value:"far",translation:r}]}},spacing:{ref:"measureAxes.1.spacing",show:(e,t)=>e.measureAxes[1]&&"none"!==e.measureAxes[1].show&&RC(e,t,1).length>0}}},minMax:{type:"items",items:{autoMinMax:{ref:"measureAxes.1.autoMinMax"},minMax:{ref:"measureAxes.1.minMax",defaultValue:"min",show:e=>!e.measureAxes[1].autoMinMax},min:{ref:"measureAxes.1.min",show:e=>["min","minMax"].includes(e.measureAxes[1].minMax)&&!e.measureAxes[1].autoMinMax,invalid:e=>"minMax"===e.measureAxes[1].minMax&&e.measureAxes[1].min>=e.measureAxes[1].max},max:{ref:"measureAxes.1.max",show:e=>["max","minMax"].includes(e.measureAxes[1].minMax)&&!e.measureAxes[1].autoMinMax,invalid:e=>"minMax"===e.measureAxes[1].minMax&&e.measureAxes[1].min>=e.measureAxes[1].max}}},startAt:{type:"string",component:"dropdown",translation:"properties.axis.startAt",show:(e,t)=>RC(e,t,1).length>0,readOnly:e=>!(e.measureAxes[1].autoMinMax||"min"===e.measureAxes[1].minMax&&0===e.measureAxes[1].min),options:[{value:"zero",translation:"properties.axis.startAt.zero"},{value:"lowest",translation:"properties.axis.startAt.lowest"}],defaultValue:"lowest",convertFunctions:{get(e,t,n,r){const{autoMinMax:i,minMax:o,min:a}=(null==r?void 0:r.measureAxes[1])||{};return!0===i?"lowest":i||"min"!==o||0!==a?e(t.type):"zero"},set(e,t,n,r,i){"zero"===e?(Ul(i,"measureAxes.1.autoMinMax",!1),Ul(i,"measureAxes.1.minMax","min"),Ul(i,"measureAxes.1.min",0)):Ul(i,"measureAxes.1.autoMinMax",!0)}},classification:{section:"axis",tags:["simple"],exclusive:!0}}}},tooltips:{uses:"tooltip"}}};var v;s.isEnabled("SENSECLIENT_LAYERED_LABELS")&&(g.items.dimensionAxis.items.othersGroup.items.label={options:[{value:"auto",translation:"Common.Auto"},{value:"horizontal",translation:"Common.Horizontal"},{value:"tilted",translation:"properties.labels.tilted"},{value:"layered",translation:"properties.labels.layered"}]});const b={uses:"data",items:{dimensions:{items:{nullSuppression:{show(e,t,n){var r,i;if(null!=l&&null!==(r=l.sense)&&void 0!==r&&null!==(i=r.isUnsupportedFeature)&&void 0!==i&&i.call(r,"includeZeroValues"))return!1;return!qC(n.layout)}}}},measures:NC(e)}},x={type:"items",component:"expandable-items",translation:"properties.addons",items:{dataHandling:{uses:"dataHandling",items:{calcCond:{uses:"calcCond"}}},primaryMeasureAxisRefLines:{uses:"reflines",ref:"refLine.refLines",translation:"properties.primaryMeasureAxisReferenceLines",title:{translation:"properties.primaryMeasureAxisReferenceLines.tooltip"},show:e=>function(e,t){return e.some((e=>px(e.qDef.series,t)))}(e.qHyperCubeDef.qMeasures,kC)},secondaryMeasureAxisRefLines:{uses:"reflines",ref:"refLine.refLines2",translation:"properties.secondaryMeasureAxisReferenceLines",title:{translation:"properties.secondaryMeasureAxisReferenceLines.tooltip"},show:e=>function(e,t){return e.some((e=>!px(e.qDef.series,t)))}(e.qHyperCubeDef.qMeasures,kC)},dimRefLines:{uses:"dimReflines"}}};return{type:"items",component:"accordion",items:{data:b,sorting:{uses:"sortingWithDisclaimer"},addons:x,settings:g}}}function $C(e){return e.qHyperCubeDef.qMeasures.filter((e=>Fh(e.qDef.series)===Sm.TYPE.LINE)).length>0}function HC(){return{type:"items",component:"accordion",items:{data:{uses:"data"},sort:{uses:"sortWithDisclaimer"},presentation:{uses:"presentation",type:"items",translation:"properties.presentation",grouped:!0,show:(e,t)=>$C(e)||!qC(t),items:{grouping:{ref:"barGrouping.grouping",type:"string",component:"item-selection-list",horizontal:!0,items:[{icon:"grouped",component:"icon-item",labelPlacement:"bottom",translation:"properties.grouping.grouped",value:"grouped"},{icon:"stacked",component:"icon-item",labelPlacement:"bottom",translation:"properties.grouping.stacked",value:"stacked"}],show(e,t){var n;return function(e,t){const n=e.qHyperCubeDef.qMeasures.filter((e=>Fh(e.qDef.series)===Sm.TYPE.BAR));return t?n.filter((e=>e.qDef.series.axis===Sm.AXIS.PRIMARY)).length>1||n.filter((e=>e.qDef.series.axis===Sm.AXIS.SECONDARY)).length>1:n.length>1}(e,!UM(null!==(n=null==e?void 0:e.version)&&void 0!==n?n:""))&&!qC(t)}},orientation:{ref:"orientation",type:"string",component:"item-selection-list",horizontal:!0,items:[{component:"icon-item",icon:"bars_vertical",labelPlacement:"bottom",translation:"properties.orientation.vertical",value:"vertical"},{icon:"bars_horizontal",component:"icon-item",labelPlacement:"bottom",translation:"Common.Horizontal",value:"horizontal"}],show:(e,t)=>!qC(t)},nullMode:{type:"string",component:"radio-list",ref:"nullMode",translation:"properties.nullMode",options:()=>[{value:"gap",translation:"properties.nullMode.gap"},{value:"connect",translation:"properties.nullMode.connect"},{value:"zero",translation:"properties.nullMode.zero"}],show:e=>$C(e)&&e.qHyperCubeDef.qMeasures.length>1},dataPoints:{ref:"dataPoint.show",translation:"properties.dataPoints.showDataPoints",type:"boolean",show:e=>$C(e)}}},color:{uses:"color",items:{disclaimer:{component:"text",translation:"properties.color.colorOnMeasureDisclaimer",style:"hint",show:e=>e.qHyperCubeDef.qMeasures.some((e=>AC(e)))}}}}}}const jC={bar:{axis:0,icon:"bar-chart",tid:"as-bar",translation:"contextMenu.asBar"},line:{axis:1,icon:"line-chart",tid:"as-line",translation:"contextMenu.asLine"},marker:{axis:1,icon:"shapes",tid:"as-marker",translation:"contextMenu.asMarker"}};function VC(e,t,n,r,i){const{axis:o,icon:a,tid:s,translation:l}=jC[i];t.addItem({icon:a,tid:s,translation:l,async select(){let t;t="measure"===e.type?await r.addLibraryMeasure(e.id):await r.addExpressionMeasure(e.name,""),t.qDef.series.type=i,t.qDef.series.axis=o,r.updateGlobalChangeListeners(),n.setProperties(r.properties),window.qvangularGlobal.$rootScope.$broadcast("pp-open-path",`data.${t.qDef.cId}`)}})}function BC(e,t,n,r,i){!function(e,t,n){const{item:r}=e,i=["contextMenu.add",r.name];if(n.canAddMeasure()){const o=e.menu.addItem({translation:i,tid:"add-as"});VC(r,o,t,n,"bar"),VC(r,o,t,n,"line"),VC(r,o,t,n,"marker")}}(e,n,t),t.getMeasures().length>=t.minMeasures()&&e.ReplaceMeasures(n,t,i),e.ColorBy(n,t,i),r()}function UC(e){const t={},{tooltip:n}=e;if(n){var r,i;t.chart_tooltip_custom=!n.auto;const e=null===(r=n.chart)||void 0===r||null===(i=r.object)||void 0===i?void 0:i.refId;!n.auto&&e&&(t.chart_tooltip_custom_mini_chart=e)}return t}const YC=e=>!!(e&&e.qHyperCube.qSize.qcy>0);function WC(e){return{definition:_C(e),softDefinition:HC(),support:{snapshot:YC,export:!0,exportData:!0,sharing:!1,viewData:!0,modifiers:["accumulation","movingAverage","difference","normalization"]},getDropMeasureOptions:BC,extendMetrics:UC,importProperties:(t,n,r,i)=>{const o={layout:{templateId:n.templateId}};r.mapProperties(o);const a={defaultDimension:r.getDefaultDimensionProperties(),defaultMeasure:r.getDefaultMeasureProperties()},s=hC.axisChart.importProperties({exportFormat:t,initialProperties:n,dataDefinition:xC(e),defaultPropertyValues:a,hypercubePath:i,extension:r});return function(e,t,n){const r="linechart"===n.properties.visualization,i=[];e.qProperty.qHyperCubeDef.qMeasures.forEach((e=>{e.qDef.series||(e.qDef.series={type:r?"line":"bar",axis:0,marker:"circle",markerFill:!0}),i.indexOf(e.qDef.series.axis)<0&&i.push(e.qDef.series.axis)}));const o=i.sort().shift();e.qProperty.measureAxes[o]&&n.properties.measureAxis&&void 0!==n.properties.measureAxis.autoMinMax&&G(!0,e.qProperty.measureAxes[o],n.properties.measureAxis,{logarithmic:!1}),TC(e.qProperty)}(s,0,t),s},exportProperties:(e,t,n)=>{!function(e){e.qProperty.qHyperCubeDef.qMeasures.forEach((e=>{e.qAttributeExpressions=[]}))}(e);return hC.axisChart.exportProperties({propertyTree:e,hyperCubePath:t,viewDataMode:n})},migrate:{properties:e=>e.qExtendsId?e:function(e){return UM(e.version)&&(e.qHyperCubeDef.qMeasures.forEach((e=>{const{qDef:t}=e;void 0===t.series&&(t.series=Sm.NOPE_SERIES),void 0===t.series.type&&(t.series.type=Sm.NOPE_SERIES.type),void 0===t.series.axis&&(t.series.axis=t.series.type===Sm.TYPE.BAR?Sm.AXIS.PRIMARY:Sm.AXIS.SECONDARY),t.series.type===Sm.TYPE.BAR&&t.series.axis===Sm.AXIS.SECONDARY&&(t.series.axis=Sm.AXIS.PRIMARY)})),e.version=BM.BAR_IN_SECONDARY_AXIS),e}(e)}}}function GC(a){var s,l;!function(e){if(e&&e.get&&e.add){const t="Object.Disclaimer.LimitedData";if(e.get(t)!==t)return;Object.keys(F).forEach((t=>{e.add(F[t])}))}}(a.translator);const{flags:u}=a,h=null===(s=a.anything)||void 0===s||null===(l=s.sense)||void 0===l?void 0:l.isUnsupportedFeature,y=(()=>{const e=M();return e.use(E),e.use(C(S)),e.use(ob),e.use(rb()),e.component("scrollbar",wf),e.component("point-label",Kb),e.component("label-space",Jb),e.component("time-axis",vg.picassoComponents.timeAxis),e.component("axis-overlay",vg.picassoComponents.axisOverlay),e.component("reference-line-labels",ka),e.component("box-sliced-hat",hb),e.component("box-out-of-bounds",cb),e.component("data-out-of-bounds-marker",Zb),e.component("scroll-hint",Po),e.component("brush-highlighter",ux),e.scale("time",vg.picassoScales.time),e.symbol("line-point",Qb),e})();return{qae:SC(a),ext:WC(a),component(){const a=function(){const[e,r]=t();return n((()=>r(Yl())),[]),e}(),s=lC(),l=function(){const e=d(),r=m(),i=c(),o=f(),[a,s]=t(),l=p();return n((()=>{s({options:{direction:"ltr",...e},translator:r,theme:o,embed:i,deviceType:l})}),[e.direction,e.freeResize,r.language(),o.name(),l]),a}(),g=dC(),S=function({picasso:r,environment:i}){const o=e(),[a,s]=t();return n((()=>{if(!i)return;o.style.overflow="hidden";const e=r({renderer:{prio:[i.options.renderer||"canvas"]}}).chart({element:o,data:[],settings:{}});s(e);const{destroy:t}=e;return()=>{t()}}),[i]),a}({picasso:y,environment:l}),M=function({chart:e,actions:r}){const i=v(),a=o(),[s,l]=t();return n((()=>{if(null==e||!e.update||!e.scale||!i)return null;const t=e.scale(xm.SCALE.MAJOR),n=ud({chart:e,actions:r,selections:i,config:{allowSimultaneous:!0,brushRanges:!0,majorScale:t,selectionActions:{reset(){e.brushSelectionIncludeMax=void 0,r.lasso.active()&&r.lasso.action(!1)},clear:mC},selectionEvents:{start:fC}}});n.setLayout(a);const{destroy:o}=n;return l(n),()=>{o()}}),[i,null==e?void 0:e.update,null==e?void 0:e.scale]),n((()=>{null!=s&&s.setLayout&&a&&s.setLayout(a)}),[a]),s}({chart:S,actions:g}),E=sC({picasso:y,chart:S,environment:l,flags:u,viewState:s,viewCache:a,actions:g,selectionService:M});jg({picasso:y,chart:S,models:E,environment:l,viewState:s,viewCache:a,actions:g}),(({picasso:e,chart:t,models:n,environment:o,viewState:a,viewCache:s,actions:l,isUnsupportedFeature:u})=>{const{width:c,height:d}=r(),[,m]=i((async()=>{if(!(null!=t&&t.update&&n&&o&&a))return;const{colorService:r,discreteModel:i,dockService:m,layoutService:f,refLineModel:p}=n;function h(){t.update({settings:zg({picasso:e,chart:t,models:n,environment:o,viewState:a,viewCache:s,actions:l,isUnsupportedFeature:u})})}m.update({width:c,height:d}),r.custom.updateLegend(),p.update({picasso:e,chart:t,models:n,environment:o,viewState:a,viewCache:s,actions:l});const y=f.getDataPages();f.setDataPages([]),h(),f.setDataPages(y),f.meta.isContinuous||await i.command.initialize(),h()}),[c,d]);if(m)throw m})({picasso:y,chart:S,models:E,environment:l,viewState:s,viewCache:a,actions:g,isUnsupportedFeature:h}),(({models:e,chart:t,viewState:n})=>{b((r=>{if(!e)return;const{layoutService:i,dockService:o,colorService:a,discreteModel:s,continuousModel:l,reducedModel:u}=e,{width:c,height:d}=o.meta.chart.size;return r.snapshotData=r.snapshotData||{},r.snapshotData.content={size:{w:c,h:d}},i.meta.isSnapshot?Promise.resolve():(r.snapshotData.content.chartData={scrollOffset:n.get("scrollOffset"),zoom:n.get("zoom"),legendScrollOffset:ce(t,xm.COMPONENT.LEGEND_CATEGORICAL)},i.meta.isDiscrete?(s.command.setSnapshotData(r),u.command.setSnapshotData(r)):l.setSnapshotData(r),a.getSnapshotData().then((e=>{r.snapshotData.content.chartData={...r.snapshotData.content.chartData,...e}})).catch((()=>{})))})),x((()=>({getViewState(){if(n&&t)return{scrollOffset:n.get("scrollOffset"),zoom:n.get("zoom"),legendScrollOffset:ce(t,xm.COMPONENT.LEGEND_CATEGORICAL)}}})),[n,t])})({models:E,chart:S,viewState:s})}}}export{GC as default};
9
+ e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,a,s,l,u,c,d,m=e.length,f=e.search(/[0-9\-\+#]/),p=f>0?e.substring(0,f):"",h=e.split("").reverse().join(""),g=h.search(/[0-9\-\+#]/),y=m-g,v=e.substring(y,y+1),b=y+("."===v||","===v?1:0),x=g>0?e.substring(b,m):"";if(n=(t="-"===(e=e.substring(f,b)).charAt(0)?-t:+t)<0?t=-t:0,i=(r=e.match(/[^\d\-\+#]/g))&&r[r.length-1]||".",o=r&&r[1]&&r[0]||",",e=e.split(i),t=+(t=t.toFixed(e[1]&&e[1].length))+"",s=e[1]&&e[1].lastIndexOf("0"),(!(u=t.split("."))[1]||u[1]&&u[1].length<=s)&&(t=(+t).toFixed(s+1)),c=e[0].split(o),e[0]=c.join(""),(a=e[0]&&e[0].indexOf("0"))>-1)for(;u[0].length<e[0].length-a;)u[0]="0"+u[0];else 0==+u[0]&&(u[0]="");if((t=t.split("."))[0]=u[0],l=c[1]&&c[c.length-1].length){for(h="",y=(d=t[0]).length%l,m=d.length,b=0;b<m;b++)h+=d.charAt(b),!((b-y+1)%l)&&b<m-l&&(h+=o);t[0]=h}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),p+(n?"-":"")+r+x}},zs({exports:{}});var Xs={dataRelatedPropertiesPaths:["qHyperCube.qGrandTotalRow","qHyperCube.qHasOtherValues","qHyperCube.qSize","qHyperCube.qDimensionInfo[].qAttrDimInfo","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"]};function Ks(e){const{qHyperCube:t,...n}=e,{qAxisData:r,qDataPages:i,qStackedDataPages:o,qTreeDataPages:a,...s}=t,l=G(!0,{},{...n,qHyperCube:{...s,qAxisData:null,qDataPages:null,qStackedDataPages:null,qTreeDataPages:null}}),{dataRelatedPropertiesPaths:u}=Xs;return u.forEach((e=>{const t=e.split("[");if(1===t.length)void 0!==Fs(l,e)&&js(l,e,null);else{const e=t[0],n=t[1].split("].")[1];Fs(l,e,[]).forEach((e=>{void 0!==Fs(e,n)&&js(e,n,null)}))}})),l}var Js={axes:{trackBy:function({isTime:e,isContinuous:t,isMeasure:n,isMajor:r}){return i=>{if(e||t||n){var o;if("line"===i.type)return null!==(o=i.tickValue)&&void 0!==o?o:"axis";if("text"===i.type)return`${i.tickValue} ${i.text}`;if("container"===i.type){const e=i.children.filter((e=>"text"===e.type)).map((e=>e.text));return`${i.data.value} ${e.join("")}`}return Math.random()}if(r){if("line"===i.type&&void 0===i.tickValue)return"axis";const e=i.transform&&i.transform.match(/rotate/gi)?"rotated":"horizontal";return`${i.data.group?`${i.data.group.value} `:""}${i.data.value} ${i.text} ${e}`}return Math.random()}},compensateForLayoutChanges:function({isMeasure:e,isTime:t,isContinuous:n,isHorizontal:r,dock:i}){return({currentNodes:o,currentRect:a,previousRect:s})=>{const l=a.x-s.x,u=a.y-s.y,c=a.width-s.width,d=a.height-s.height;e?("left"===i&&o.forEach((e=>{"line"===e.type?(e.x1+=c,e.x2+=c):"text"===e.type&&(e.x+=c)})),"left"!==i&&"right"!==i||o.forEach((e=>{var t;("line"===e.type&&(e.x1===e.x2?(e.y1=a.y,e.y2=e.y1+a.height):(Math.round(e.y1)<a.y||e.y1>a.y+a.height)&&(e.strokeWidth=0)),"text"===e.type)&&((e.y<a.y||e.y>a.y+a.height)&&(e.fontSize="1px","#"===(null===(t=e.fill)||void 0===t?void 0:t[0])&&(e.fill=`${e.fill.slice(0,1)}00${e.fill.slice(1)}`)))})),"top"!==i&&"bottom"!==i||o.forEach((e=>{var t;("line"===e.type&&(e.y1===e.y2?(e.x1=a.x,e.x2=e.x1+a.width):(Math.round(e.x1)<a.x||e.x1>a.x+a.width)&&(e.strokeWidth=0)),"text"===e.type)&&((e.x<a.x||e.x>a.x+a.width)&&(e.fontSize="1px","#"===(null===(t=e.fill)||void 0===t?void 0:t[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+=c:e.x1===e.x2&&(e.x1-=l,e.x2-=l):"text"===e.type&&(e.x-=l)})):n||r?o.forEach((e=>{"line"===e.type&&e.y1===e.y2&&(e.x1+=l,e.x2+=l+c)})):o.forEach((e=>{"line"===e.type&&e.x1===e.x2&&(e.y1+=u,e.y2+=u+d)}))}}},bars:{trackBy: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}`},compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const r=t.x-n.x,i=t.y-n.y;0===r&&0===i||e.forEach((e=>{e.children&&e.children.length>0&&e.children.forEach((e=>{void 0!==e.x&&void 0!==e.y?(e.x-=r,e.y-=i):e.transform=`translate(${-r}, ${-i})`}))}))}},barOobs:{compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const r=t.x-n.x;0===t.y-n.y&&0===r||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 r=t.x-n.x,i=t.y-n.y;0===r&&0===i||e.forEach((e=>{e.transform&&e.transform.match(/rotate\(-90/gi)?(e.x+=i,e.y-=r):(e.x-=r,e.y-=i)}))},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){var t;return"line"===e.type?null!==(t=e.value)&&void 0!==t?t: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 r=t.x-n.x,i=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-=i,e.y2-=i):e.x1===e.x2&&(e.y2=e.y1+t.height,e.x1-=r,e.x2-=r);else{const t="x"===e.major.p?r/e.major.size:i/e.major.size,n="y"===e.minor.p?i/e.minor.size:r/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 r=t.x-n.x;0===t.y-n.y&&0===r||e.forEach((e=>{e.opacity=0}))}},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 r=t.x-n.x,i=t.y-n.y;0===r&&0===i||e.forEach((e=>{e.cx-=r,e.cy-=i}))}},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 r=t.x-n.x,i=t.y-n.y,o=t.width-n.width,a=t.height-n.height;let s=-r,l=-i;e.forEach((e=>{switch(e.dock){case"right":r>0&&(s=t.width);break;case"left":o<0&&(s=-n.width);break;case"top":a<0&&(l=-n.height);break;case"bottom":i>0&&(l=t.height)}switch(e.type){case"text":case"rect":e.x+=s,e.y+=l;break;case"circle":e.cx+=s,e.cy+=l;break;case"path":e.transform=`translate(${s}, ${l})`}}))}},shadowBars:{trackBy:function(){return Math.random()}},cacheProperties:function({viewCache:e,layout:t}){const n=Ks(t);e.set("dataIndependentProperties",JSON.stringify(n))},propertiesHaveChanged:function({viewCache:e,layout:t}){const n=Ks(t);return e.get("dataIndependentProperties")!==JSON.stringify(n)},nonUpdatingNode:{trackBy:function(){return Math.random()}}};const{getInputValue:Zs,extractInfoFromInputValue:Qs,resolveValue:el}=pa;var tl={resolveValue:el,resolveInnerValues:({refLineLayout:e,refLineModel:t,layoutService:n})=>{if(n.meta.isGroupedByDimension){const r=Zs({refLineLayout:e,layoutService:n});return Qs(r,t,"innerValues")}},resolveNumInnerValues:({refLineLayout:e,refLineModel:t,layoutService:n})=>{if(n.meta.mode.K)return 0;const r=Zs({refLineLayout:e,layoutService:n});return Qs(r,t,"numInnerValues")||0},resolveValueText:({refLineLayout:e,refLineModel:t,layoutService:n})=>{const{dimensionValuesInfo:r}=t,{canBeContinuous:i}=n.meta,o=Zs({refLineLayout:e,layoutService:n});return r[o]&&i?r[o].qText:o},resolveValueInfo:({refLineLayout:e,refLineModel:t,layoutService:n})=>{const r=Zs({refLineLayout:e,layoutService:n}),{dimensionRefLineInfo:i}=t;return i[r]}};const nl=({isDimension:e,refLineLayout:t,refLineModel:n,layoutService:r,colorModel:i,dockService:o,chart:a,scale:s,axis:l,invert:u,component:c,isContinuous:d})=>{var m,f;const p={dir:l,line:{strokeWidth:(null==t||null===(m=t.style)||void 0===m?void 0:m.lineThickness)||2,strokeDasharray:null==t||null===(f=t.style)||void 0===f?void 0:f.lineType,stroke:i.resolveUIColor(t.paletteColor||{index:t.color})}};return!e||r.meta.isContinuous?(p.scale=s,p.value=t.refLineExpr.value):(p.valueInfo=tl.resolveValueInfo({refLineLayout:t,refLineModel:n,layoutService:r}),p.value=()=>{var e;const i=pa.getScaledPosition({scale:a.scale(s),value:tl.resolveValue({refLineLayout:t,refLineModel:n,layoutService:r}),valueInfo:p.valueInfo,size:null===(e=a.component(c))||void 0===e?void 0:e.rect["horizontal"===o.meta.major.orientation?"width":"height"],align:t.align,invert:u,layoutService:r,isContinuous:d});return Number.isNaN(i)?void 0:i}),p};function rl({isDimension:e,refLineModel:t={},layoutService:n,colorModel:r,dockService:i,animationsEnabled:o,chart:a,scale:s,axis:l,rtl:u,key:c,mainComponentKey:d,path:m,minimumLayoutMode:f}){const p=e?t.dimensionRefLines:m?t.query.getRefLines(m):t.measureRefLines;if(!p.length)return!1;const h={key:c,type:"ref-line",layout:{minimumLayoutMode:f},lines:{y:[],x:[]},style:{oob:{show:!1}},preferredSize:()=>({size:0,edgeBleed:{left:1,right:1,top:1,bottom:1}}),animations:{enabled:o,trackBy:Js.lines.trackBy,compensateForLayoutChanges:Js.lines.compensateForLayoutChanges}},g=!(!e||"horizontal"!==i.meta.major.orientation||!u),y=!e||n.meta.isContinuous;return p.forEach((o=>{h.lines[l].push(nl({isDimension:e,refLineLayout:o,refLineModel:t,layoutService:n,colorModel:r,dockService:i,chart:a,scale:s,axis:l,invert:g,component:d,isContinuous:y}))})),h}const il={referenceLine:{label:{name:{fontFamily:"Source Sans Pro, sans-serif",fontSize:"12px"}},outOfBounds:{backgroundColor:"#737373",color:"#e6e6e6",fontFamily:"Source Sans Pro, sans-serif",fontSize:"10px"}}},ol=({isDimension:e,layoutService:t,animationsEnabled:n,style:r,labels:i,scale:o,formatter:a,dock:s,key:l,rtl:u,theme:c,isContinuous:d,localeInfo:m})=>({key:l,type:"reference-line-labels",renderer:"svg",labels:i,formatter:a,scale:o,layoutService:t,layout:{dock:s,rtl:u},theme:c,isContinuous:d,isDimension:e,localeInfo:m,style:{label:{fontFamily:r.referenceLine.label.name.fontFamily,fontSize:r.referenceLine.label.name.fontSize,padding:{top:2,bottom:2,left:u?2:4,right:u?4:2},background:{padding:{top:1,bottom:1,left:2,right:2}},maxWidth:100,gap:"left"===s||"right"===s?10:16},oob:{size:8,fill:r.referenceLine.outOfBounds.backgroundColor,text:{fontFamily:r.referenceLine.outOfBounds.fontFamily,fontSize:r.referenceLine.outOfBounds.fontSize,fill:r.referenceLine.outOfBounds.color,background:{fill:r.referenceLine.outOfBounds.backgroundColor}}}},animations:{enabled:n,trackBy:Js.refLineLabels.trackBy,compensateForLayoutChanges:Js.refLineLabels.compensateForLayoutChanges}}),al=({refLineLayout:e,refLineModel:t,layoutService:n,colorModel:r,scale:i,theme:o,isContinuous:a})=>{const s=r.resolveUIColor(e.paletteColor||{index:e.color}),l={align:e.align,text:e.label,fill:e.coloredBackground?o.getContrastingColorTo(s):s,showValue:!1!==e.showValue,showLabel:!1!==e.showLabel,inputValue:e.refLineExpr.value,inputValueLabel:e.refLineExpr.label};return e.coloredBackground&&(l.background={fill:s}),a?(l.scale=i,l.value=e.refLineExpr.value):(l.value=()=>tl.resolveValue({refLineLayout:e,refLineModel:t,layoutService:n}),l.valueText=()=>tl.resolveValueText({refLineLayout:e,refLineModel:t,layoutService:n}),l.valueInfo=()=>tl.resolveValueInfo({refLineLayout:e,refLineModel:t,layoutService:n})),l};function sl({isDimension:e,refLineModel:t={},layoutService:n,colorModel:r,animationsEnabled:i,dock:o,scale:a,style:s,formatter:l,theme:u,localeInfo:c,rtl:d,key:m,path:f}){const p=e?t.dimensionRefLineLabels:f?t.query.getRefLineLabels(f):t.measureRefLineLabels;if(!p.length)return[];const h=[],g=!e||n.meta.isContinuous,y=p.map((e=>al({refLineLayout:e,refLineModel:t,layoutService:n,colorModel:r,scale:a,theme:u,isContinuous:g})));return h.push(ol({isDimension:e,rtl:d,style:G(!0,il,s),dock:o,key:m,labels:y,scale:a,formatter:l,layoutService:n,animationsEnabled:i,theme:u,isContinuous:g,localeInfo:c})),h}function ll({layoutService:e,discreteModel:t}){const{isContinuous:n,canBeContinuous:r,isGroupedByDimension:i}=e.meta,o=e.getLayout(),a="K"===o.qHyperCube.qMode,s=ue.dimensionless(o),l=pa.getMeasureRefLines(o),u=pa.getDimensionRefLines(o,s),c=pa.getMeasureRefLineLabels(o),d=pa.getDimensionRefLineLabels(o,s);let m={},f={};const p=()=>!(!u||!u.length)&&!u.every((t=>{const o=pa.getInputValue({refLineLayout:t,layoutService:e});return(t=>{if(r){const n=e.getLayoutValue("qHyperCube.qDimensionInfo.0"),{qMin:r,qMax:i}=n;return pa.isOutOfRange({value:t,qMin:r,qMax:i})}return!1})(o)||(t=>{if(!f[t])return!1;if(!n&&i){const n={valueInfo:f[t]},r="S"===e.getHyperCubeValue("qMode")?"qDataPages.0":"qStackedDataPages.0",i=e.getHyperCubeValue(r);return pa.isOutOfDataPages({label:n,dataPages:i})}return!0})(o)})),h={isKMode:a,canBeContinuous:r,measureRefLines:l,dimensionRefLines:u,measureRefLineLabels:c,dimensionRefLineLabels:d,dimensionRefLineInfo:f,dimensionValuesInfo:m,query:{getRefLines:e=>pa.getRefLines(o,e),getRefLineLabels:e=>pa.getRefLineLabels(o,e)},update:()=>{f=h.dimensionRefLineInfo,p()&&(m=pa.getDimensionValuesInfo({layout:o,canBeContinuous:r,discreteModel:t,layoutService:e}),h.dimensionValuesInfo=m,u.forEach((t=>{const n=pa.getInputValue({refLineLayout:t,layoutService:e});m[n]&&(f[n]?(f[n].innerValues=m[n].innerValues,f[n].minOrder=Math.min(f[n].minOrder,m[n].minOrder),f[n].maxOrder=Math.max(f[n].maxOrder,m[n].maxOrder),f[n].isMinOrderOk=f[n].isMinOrderOk||m[n].isMinOrderOk,f[n].isMaxOrderOk=f[n].isMaxOrderOk||m[n].isMaxOrderOk):f[n]={id:m[n].id,qText:m[n].qText,innerValues:m[n].innerValues,minOrder:m[n].minOrder,maxOrder:m[n].maxOrder,isMinOrderOk:m[n].isMinOrderOk,isMaxOrderOk:m[n].isMaxOrderOk},f[n].numInnerValues=(f[n].maxOrder||0)-(f[n].minOrder||0)+1)})))}};return h.update(),h}var ul={DATA:{MAIN:"qHyperCube",REDUCED:"reduced-data"},SCALE:{MAJOR:"main-major",MAJOR_INNER:"major-inner",MINOR:{PRIMARY:"minor-primary",SECONDARY:"minor-secondary",REDUCED_PRIMARY:"reduced-minor-primary",REDUCED_SECONDARY:"reduced-minor-secondary"},COLOR:"color",REDUCED:"reduced-major"},COMPONENT:{BAR:"bar-series",BAR_LABEL:"bar-label",BAR_OOB_LABEL:"bar-oob-label",STACK_BAR:"stack-bar",STACK_BAR_LABEL:"stack-bar-label",AXIS:{MAJOR:"major-axis",MAJOR_CONTINUOUS:"major-axis-continuous",TIME_INNER:"major-axis-time-inner",TIME_OUTER:"major-axis-time-outer",MINOR:{PRIMARY:"minor-primary-axis",SECONDARY:"minor-secondary-axis"}},AXIS_OVERLAY:{TIME_INNER:"axis-overlay-time-inner",TIME_OUTER:"axis-overlay-time-outer",CONTINUOUS:"axis-overlay-continuous"},AXIS_TITLE:{MAJOR:"major-axis-title",MINOR:{PRIMARY:"minor-primary-axis-title",SECONDARY:"minor-secondary-axis-title"}},MARKER:"marker-series",LINE:"line-series",POINT:"point-component",LABEL_SPACE:"label-space-component",POINT_LABEL:"point-label",GRID_LINE:"grid-line",ZERO_LINE:"zero-line",LEGEND:"legend",LEGEND_CATEGORICAL:"legend-cat",LEGEND_TOOLTIP:"legend-tooltip",TOOLTIP:"tooltip-qcm",MINI_CHART:{BAR:"mini-chart-bar-series",LINE:"mini-chart-line-series",MARKER:"mini-chart-marker-series"},BAR_OOB:"bar-oob",GHOST_BAR_OOB:"ghost-bar-oob",SLICED_HAT:"sliced-hat",DATA_OOB_MARKER:"data-out-of-bounds-marker",PRIMARY_MEASURE_AXIS_REF_LINE:"primary-mes-axis-ref-line",SECONDARY_MEASURE_AXIS_REF_LINE:"secondary-mes-axis-ref-line",DIMENSION_REF_LINE:"dim-ref-line",PRIMARY_MEASURE_AXIS_REF_LINE_LABEL:"primary-mes-ref-line-label",SECONDARY_MEASURE_AXIS_REF_LINE_LABEL:"secondary-mes-ref-line-label",DIMENSION_REF_LINE_LABEL:"dim-ref-line-label"},COLLECTION:{PRIMARY:"primary-collection",SECONDARY:"secondary-collection",STACKED_PRIMARY:"stacked-collection-primary",STACKED_SECONDARY:"stacked-collection-secondary",STACKED_TOTAL_PRIMARY:"stacked-total-collection-primary",STACKED_TOTAL_SECONDARY:"stacked-total-collection-secondary",REDUCED:"reduced-collection",REDUCED_PRIMARY:"reduced-collection-primary",REDUCED_SECONDARY:"reduced-collection-secondary",REDUCED_STACKED_PRIMARY:"reduced-collection-stacked-primary",REDUCED_STACKED_SECONDARY:"reduced-collection-stacked-secondary",LINE:"line-collection"},FORMATTER:{PRIMARY:"primary-formatter",SECONDARY:"secondary-formatter"}},cl={TYPE:{LINE:"line",BAR:"bar",MARKER:"marker"},AXIS:{PRIMARY:0,SECONDARY:1},NOPE_SERIES:{type:"bar",axis:0}};const dl={CUSTOM:{EXPRESSION:"customTooltipExpression",TITLE:"customTooltipTitle",DESCRIPTION:"customTooltipDescription",QUARANTINE:"customTooltip",IMAGES:"customTooltipImages"},CHART:{CONTAINER_ID:"tooltipContainerId",STATE:"customTooltipSessionState",CHART_OBJECT_ID:"customTooltipSessionObjectId",CHART_PARENT_TYPE:"TooltipChartParent",CHART_CHILD_TYPE:"TooltipChart",STYLE:{small:"140px",medium:"200px",large:"340px"}}};function ml(e){const t=e.split("/");return"qmem:"===t[0]&&""===t[1]}const fl={getImageSize(e,t){let n;function r(){n&&(clearTimeout(n),n=null)}function i(e){const t=e;t.onload=null,t.onerror=null,r()}const o={small:50,medium:200,large:340,original:340};return new Promise((a=>{const s=new Image;s.referrerPolicy="no-referrer",s.onload=()=>{let e;const{height:n,width:l}=s,u=o[t]*(n>l?1:n/l),c=o[t]*(l>n?1:l/n);!n||!l||0===n&&0===l?(e={height:20,width:20,imageError:!0},i(s)):"original"===t?(e={height:Math.min(u,n),width:Math.min(c,l)},r()):(e={height:u,width:c},r()),a(e)},s.onerror=()=>{i(s),a({height:20,width:20,imageError:!0})},s.src=e,n=setTimeout((()=>{i(s),a({height:20,width:20,imageError:!0})}),3e3)}))}};async function pl(e,t,n){let r=e.ref.qStaticContentUrl.qUrl;const i=function(e){var t,n,r,i,o;let a,s,l,u,c,d;if(e&&(null!==(t=e.session)&&void 0!==t&&t.options||null!==(n=e.enigmaModel)&&void 0!==n&&null!==(r=n.session)&&void 0!==r&&r.sessionConfig||null!==(i=e.session)&&void 0!==i&&null!==(o=i.config)&&void 0!==o&&o.url)){var m;if(a=e.session.options||(null===(m=e.enigmaModel)||void 0===m?void 0:m.session.sessionConfig),!a){var f;a=null===(f=e.session)||void 0===f?void 0:f.config;const t=new URL(a.url);a.host=t.hostname,a.port=t.port,a.isSecure="wss:"===t.protocol}return d=void 0!==a.secure?a.secure:a.isSecure,s=d?"https://":"http://",l=a.host||"localhost",u=a.port?`:${a.port}`:"",c=a.prefix?a.prefix:"/","/"!==c[c.length-1]&&(c=`${c}/`),s+l+u+c}return""}(n);i&&(!function(e,t){const n=e.replace(t,"").replace(/^\.\.\//i,"/");n[0]}(r,i),r=r.replace(/"/g,'\\"'),r=r.replace(/'/g,"\\'"),r=function(e,t){return t+("/"===e[0]?e.substr(1):e)}(r,i));const{height:o,width:a,imageError:s}=await fl.getImageSize(r,t);return{src:r,size:t,height:o,width:a,imageError:s}}async function hl(e,t,n,r){var i,o,a,s,l,u;const{app:c,flags:d}=t,m=null===(i=e.layout)||void 0===i||null===(o=i.tooltip)||void 0===o?void 0:o.imageComponents;if(!m)return[];const[f]=m,p=f.size||"small",h=f.type||"media";let g=-1;for(let e=0;e<n.length;e++)if(n[e].cId===f.cId){g=e;break}const y=(null===(a=r.data)||void 0===a||null===(s=a.customTooltipAttrExps)||void 0===s?void 0:s.value)||[];let v;if(-1!==g&&y[g]&&(v=y[g]),"media"===h&&null!==(l=f.ref)&&void 0!==l&&null!==(u=l.qStaticContentUrl)&&void 0!==u&&u.qUrl)return pl(f,p,c);if("url"===h)return async function(e,t,n,r,i){let o,a=n.ref;if(i&&i.label&&(a=i.label),t.isEnabled("IMAGE_BUNDLE_LOAD")&&null!=e&&e.getImage&&ml(a))try{const t=`data:image/png;base64, ${await e.getImage(a)}`,{height:n,width:i,imageError:s}=await fl.getImageSize(t,r);o={src:t,size:r,height:n,width:i,imageError:s}}catch(e){}else{const{height:e,width:t,imageError:n}=await fl.getImageSize(a,r);o={src:a,size:r,height:e,width:t,imageError:n}}return o}(c,d,f,p,v);if(d.isEnabled("IMAGE_BUNDLE_LOAD")&&"field"===h&&v&&v.label){return async function(e,t,n,r){let i;const o=r.label,a=`qmem://${t.qFallbackTitle}/${o}`;if(ml(a))try{const t=await e.getImage(a);if(t){const e=`data:image/png;base64, ${t}`,{height:r,width:o,imageError:a}=await fl.getImageSize(e,n);i={src:e,size:n,height:r,width:o,imageError:a}}}catch(e){}return i}(c,n[g],p,v)}return[]}const gl={async addImagesToTheNodes({customTooltipModel:e,nodes:t,attrExps:n,opts:r}){const i=t,o=[];for(let t=0;t<i.length;t++)o.push(hl(e,r,n,i[t]));const a=await Promise.all(o);for(let e=0;e<i.length;e++)i[e].data.customTooltipImages=[a[e]];return i},checkIfPromisesExist({customTooltipModel:e}){var t,n;const r=null===(t=e.layout)||void 0===t||null===(n=t.tooltip)||void 0===n?void 0:n.imageComponents;return!!r&&r.length>0}},yl={async handlePromises({customTooltipModel:e,nodes:t,attrExps:n,opts:r}){let i=t;return i=await gl.addImagesToTheNodes({customTooltipModel:e,nodes:t,attrExps:n,opts:r}),i},checkIfPromisesExist:({customTooltipModel:e})=>gl.checkIfPromisesExist({customTooltipModel:e})};const vl=(e,t)=>{var n,r,i;const o=null==e||null===(n=e.qHyperCubeDef)||void 0===n?void 0:n.qDimensions,a=null==e||null===(r=e.qHyperCubeDef)||void 0===r?void 0:r.qMeasures,s=null==e||null===(i=e.qHyperCubeDef)||void 0===i?void 0:i.qInterColumnSortOrder,l=t;return{qInfo:{qType:dl.CHART.CHART_PARENT_TYPE,qId:dl.CHART.CHART_OBJECT_ID},qHyperCubeDef:{qDimensions:o,qMeasures:a,qInterColumnSortOrder:s,qInitialDataFetch:[{qWidth:0,qHeight:0}]},qStateName:l}},bl=e=>{var t,n,r;const i=null===(t=e.tooltip)||void 0===t||null===(n=t.chart)||void 0===n||null===(r=n.object)||void 0===r?void 0:r.refId;return{qInfo:{qType:dl.CHART.CHART_CHILD_TYPE},qExtendsId:i}};const xl={createContainer:({ctx:e,layout:t})=>{var n,r;if(!((null===(n=t.qHyperCube)||void 0===n||null===(r=n.qDimensionInfo)||void 0===r?void 0:r.length)<=0))return function(e,t){var n,r,i,o;const a=null!==(n=null===(r=t.tooltip)||void 0===r||null===(i=r.chart)||void 0===i||null===(o=i.style)||void 0===o?void 0:o.size)&&void 0!==n?n:"medium",s=dl.CHART.STYLE[a];return[{content:[e.h("div",{style:{display:"flex",width:s,height:s,backgroundColor:"#FFFFFF",borderRadius:"5px",padding:"2px",color:"#595959"},colspan:2,id:dl.CHART.CONTAINER_ID})],colspan:2,style:{"text-align":e.rtl?"right":"left","max-width":s,width:"100%"}},{}]}(e,t)},show:async({app:e,properties:t,selectedNodes:n,dimIndex:r,customTooltipModel:i,rtl:o})=>{var a,s,l;const u=i,c=null==t||null===(a=t.tooltip)||void 0===a||null===(s=a.chart)||void 0===s||null===(l=s.object)||void 0===l?void 0:l.refId;if(null!=u&&u.embed&&e.removeSessionAlternateState&&e.addSessionAlternateState&&c&&!(t.qHyperCubeDef.qDimensions.length<=0)){await xl.hide({app:e,customTooltipModel:i});try{await async function({app:e,properties:t,customTooltipModel:n}){const r=n,i=dl.CHART.STATE,o=t.qStateName;r.miniChartToken.alternateState||(r.miniChartToken.alternateState=i,await e.addSessionAlternateState(i,o),r.miniChartToken.alternateState=i)}({app:e,properties:t,customTooltipModel:i});const a=await async function({app:e,properties:t,customTooltipModel:n}){var r;const i=n;null!==(r=i.miniChartToken.sessionObj)&&void 0!==r&&r.id&&await e.destroySessionObject(i.miniChartToken.sessionObj.id);const o=dl.CHART.STATE,a=vl(t,o),s=await e.createSessionObject(a),l=bl(t);if(s.id!==dl.CHART.CHART_OBJECT_ID)return void e.destroySessionObject(s.id);i.miniChartToken.sessionObj=s;const u=await s.createChild(l);if(i.miniChartToken.sessionObj&&i.miniChartToken.sessionObj.id===s.id)return i.miniChartToken.model=u,u;e.destroySessionObject(s.id)}({app:e,properties:t,customTooltipModel:i});if(u.miniChartToken.alternateState&&u.miniChartToken.sessionObj&&a){var d,m,f,p;const e=n.length>0&&void 0!==(null===(d=n[0].data)||void 0===d?void 0:d.value)?[null===(m=n[0].data)||void 0===m?void 0:m.value]:[],a=void 0!==r?r:t.qHyperCubeDef.qDimensions.length-1;if(2===t.qHyperCubeDef.qDimensions.length&&void 0===r&&n.length>0){var h,g;const e=null!==(h=n[0].data.selectionOuterDimension)&&void 0!==h?h:n[0].data.selectionDimension;if(null!=e&&null!==(g=e.source)&&void 0!==g&&g.field){var y;const t=null==e||null===(y=e.source)||void 0===y?void 0:y.field.split("/"),n=t[t.length-1],r=void 0!==e.value?[e.value]:[];r.length>0&&void 0!==n&&u.miniChartToken.sessionObj.selectHyperCubeValues("/qHyperCubeDef",Number(n),r,!1)}}e.length>0&&u.miniChartToken.sessionObj.selectHyperCubeValues("/qHyperCubeDef",a,e,!1);const s=document.getElementById(dl.CHART.CONTAINER_ID),l={direction:o?"rtl":"ltr",isReadonly:!0,isPopover:!0,navigation:!1,selections:!1};u.miniChartToken.vis=await i.embed.render({element:s,model:u.miniChartToken.model,options:l,id:null===(f=u.miniChartToken.model)||void 0===f?void 0:f.id,type:null===(p=u.miniChartToken.model)||void 0===p?void 0:p.genericType})}}catch(t){await xl.hide({app:e,customTooltipModel:i})}}},hide:async({app:e,customTooltipModel:t})=>{const n=t;null!=n&&n.embed&&(xl.destroyVisualization({customTooltipModel:t}),await e.destroySessionObject(dl.CHART.CHART_OBJECT_ID),n.miniChartToken.sessionObj=void 0,await async function({app:e,customTooltipModel:t}){const n=t,r=dl.CHART.STATE;n.miniChartToken.alternateState=void 0,await e.removeSessionAlternateState(r)}({app:e,customTooltipModel:t}))},destroyVisualization:({customTooltipModel:e})=>{var t,n;const r=e;"function"==typeof(null===(t=r.miniChartToken)||void 0===t||null===(n=t.vis)||void 0===n?void 0:n.destroy)&&(r.miniChartToken.vis.destroy(),r.miniChartToken.vis=void 0)}};function Ml(e){const t=e.qHyperCubeDef?e.qHyperCubeDef.qDimensions:e.qHyperCube.qDimensionInfo;if(t&&t.length>0)return t}function Sl(){const{EXPRESSION:e,TITLE:t,DESCRIPTION:n,IMAGES:r}=dl.CUSTOM,i={};return i[e]=!0,i[t]=!0,i[n]=!0,i[r]=!0,i}function El(e){const t=Sl();return e.filter((e=>t[e.id]))}const Cl={getNodes(e,t){const n=function(e,t){let n=0,r=0;e.center?(n+=e.center.x,r+=e.center.y):(n+=e.clientX,r+=e.clientY);const i=t.element.getBoundingClientRect();return{cx:n-i.left,cy:r-i.top}}(e,t);return t.shapesAt({x:n.cx,y:n.cy})},getDataNodes(e,t){let n,r=[];const i={container:{bar:!0,"bullet-axis":!0},circle:{"point-component":!0}};return t.forEach((t=>{var o,a,s,l;const u=null!==(o=null===(a=t.data)||void 0===a?void 0:a.selectionDimension)&&void 0!==o?o:t.data;if(!u||null!==(s=t.data)&&void 0!==s&&s.customTooltipAttrExps||i[t.type]){if(null!==(l=t.data)&&void 0!==l&&l.customTooltipAttrExps&&!t.data.customTooltipImages){const e=t;e.data.customTooltipImages=[],r.push(e)}}else{n||(n=[],Object.keys(i).forEach((t=>{n=n.concat(e.findShapes(t).filter((e=>e.data&&e.data.customTooltipAttrExps&&!e.data.customTooltipImages&&i[t][e.key])))})));const t=n.filter((e=>{var t,n;const r=null!==(t=null!==(n=e.data.stack)&&void 0!==n?n:e.data.selectionOuterDimension)&&void 0!==t?t:e.data.selectionDimension;return r&&r.value===u.value&&r.label===u.label}));t.length>0&&(r=r.concat(t[0]))}})),r},displayTooltip(e,t,{nodes:n,opts:r={},customTooltipModel:i,extractedNodes:o=[],hide:a}){if(i&&!a){const{layout:a,chart:s}=i,{attrExps:l}=Cl.getAttrExprData(a);o.length||n.length?yl.handlePromises({customTooltipModel:i,nodes:Cl.getDataNodes(s,o.length>0?o:n),attrExps:l,opts:r}).then((()=>{t.emit("show",e,n.length?{nodes:n}:void 0)})):t.emit("show",e,n.length?{nodes:n}:void 0)}else{var s;null!=i&&null!==(s=i.miniChartToken)&&void 0!==s&&s.alternateState&&xl.hide({app:r.app,customTooltipModel:i}),t.emit("hide")}},checkIfPromisesExist:({customTooltipModel:e})=>yl.checkIfPromisesExist({customTooltipModel:e}),getAttrExps(e,t){var n;const r=t,i=null!==(n=e.qHyperCubeDef)&&void 0!==n&&n.qDimensions?"qAttributeExpressions":"qAttrExprInfo";return r[i]||(r[i]=[]),r[i]},getAttrExprData(e){var t;let n=[],r="";const i=(null===(t=e.qHyperCube)||void 0===t?void 0:t.qDimensionInfo)||[];if(i.length>0){var o,a,s;const t=i.length-1;n=(null===(o=e.qHyperCube)||void 0===o||null===(a=o.qDimensionInfo)||void 0===a||null===(s=a[t])||void 0===s?void 0:s.qAttrExprInfo)||[],r=`qDimensionInfo/${t}/qAttrExprInfo`}return{attrExps:n,fieldPath:r}},quarantineCustomTooltipAttrs(e,t={}){var n,r;if(!(null===(n=e.qLayoutExclude)||void 0===n||null===(r=n.quarantine)||void 0===r?void 0:r[dl.CUSTOM.QUARANTINE])){!function(e,t){const n=t;let r=n.qLayoutExclude;r||(n.qLayoutExclude={quarantine:{}},r=n.qLayoutExclude),r.quarantine||(r.quarantine={}),r.quarantine[dl.CUSTOM.QUARANTINE]=[],e.forEach((e=>{r.quarantine[dl.CUSTOM.QUARANTINE].push(e)})),n.qLayoutExclude=r}(El(t.qAttributeExpressions||[]),e)}},unquarantineCustomTooltipAttrs(e){var t,n;const r=e;(null===(t=e.qLayoutExclude)||void 0===t||null===(n=t.quarantine)||void 0===n?void 0:n[dl.CUSTOM.QUARANTINE])&&delete r.qLayoutExclude.quarantine[dl.CUSTOM.QUARANTINE]},setAttrsFromQuarantine(e,t){const n=Ml(e);if(!n)return;const r=void 0!==t?t:n.length-1;if(!n[r])return;const i=this.getAttrExps(e,n[r]);if(0===El(i).length){var o,a;const t=(null===(o=e.qLayoutExclude)||void 0===o||null===(a=o.quarantine)||void 0===a?void 0:a.customTooltip)||[],n=[...i,...t],s=e;s.qHyperCubeDef?s.qHyperCubeDef.qDimensions[r].qAttributeExpressions=n:s.qHyperCube.qDimensionInfo[r].qAttrExprInfo=n}},moveCustomTooltipAttrs(e,t={},n){let r=[];const i=Ml(e)||[];[...i,t].forEach((e=>{const t=El(e.qAttributeExpressions||[]);t.length>0&&(r=t)}));const o=Sl(),a=i.map((e=>{const t=e,n=e.qAttributeExpressions||[];return t.qAttributeExpressions=n.filter((e=>!o[e.id])),t})),s=void 0!==n?n:a.length-1;a.length>0&&(a[s].qAttributeExpressions=a[s].qAttributeExpressions.concat(r));const l=e;e.qHyperCubeDef?l.qHyperCubeDef.qDimensions=a:l.qHyperCube.qDimensionInfo=a},addCallbackCustomTooltip(e){e.qHyperCubeDef.qDimensions.length>1?this.moveCustomTooltipAttrs(e):(this.setAttrsFromQuarantine(e),this.unquarantineCustomTooltipAttrs(e))},moveCallbackCustomTooltip(e,t){1===e.qHyperCubeDef.qDimensions.length&&(this.setAttrsFromQuarantine(e),this.unquarantineCustomTooltipAttrs(e)),e.qHyperCubeDef.qDimensions.length>1&&this.moveCustomTooltipAttrs(e,t)},removeCallbackCustomTooltip(e,t){e.qHyperCubeDef.qDimensions.length>0?this.moveCustomTooltipAttrs(e,t):this.quarantineCustomTooltipAttrs(e,t)},replaceCallbackCustomTooltip(e,t){e.qHyperCubeDef.qDimensions.length>1?this.moveCustomTooltipAttrs(e,t):(this.quarantineCustomTooltipAttrs(e,t),this.setAttrsFromQuarantine(e),this.unquarantineCustomTooltipAttrs(e))},shouldIgnoreDefaultRows(e){var t;return(null===(t=e.tooltip)||void 0===t?void 0:t.hideBasic)||0},DEBOUNCE_THRESHOLD:50,getFooterRow:(e,t)=>[{content:e,style:{"font-style":"italic","font-size":"12px","line-height":"16px",color:"rgba(255, 255, 255, 0.6)","text-align":t?"right":"left",direction:ye.detectTextDirection(e)},colspan:2},{}],getImageRow(e,t){const n=ye.detectTextDirection(e.src),r=[],i={style:{display:"block","margin-left":"auto","margin-right":"auto",overflow:"hidden",width:e.width,height:e.height}};if("original"===e.size||e.imageError){r.push(t.h("span",{style:{display:"inline-block",height:"100%","vertical-align":"middle"}}));const n=e.imageError?`${e.src}?${Math.random()}`:e.src;r.push(t.h("img",{style:{"max-width":e.width,"max-height":e.height,"vertical-align":"middle"},src:n,referrerpolicy:"no-referrer"})),i.style["text-align"]="center",i.style["white-space"]="nowrap"}else i.style["background-size"]="contain",i.style["background-repeat"]="no-repeat",i.style["background-position"]="center",i.style["background-image"]=`url('${e.src}')`;return[{content:[t.h("div",i,r),""],style:{"text-align":t.rtl?"right":"left",direction:n,"max-width":e.width},colspan:2},{}]}};function ql(e,t,n,r){var i,o,a;const s=(null===(i=t.qHyperCube)||void 0===i||null===(o=i[n])||void 0===o||null===(a=o[r])||void 0===a?void 0:a.qAttrExprInfo)||[],l=[],u=e.qSubNodes&&e.qSubNodes[r]?e.qSubNodes[r].qAttrExps:e.qAttrExps;return u?(s.forEach(((e,t)=>{const i=u.qValues&&u.qValues[t]?u.qValues[t]:void 0,o=void 0===i?"NaN":function(e,t){let n;switch(e.id){case dl.CUSTOM.EXPRESSION:n="NaN"===t.qNum||e.isCustomFormatted?void 0===t.qText?"NaN":t.qText:t.qNum;break;case dl.CUSTOM.TITLE:case dl.CUSTOM.DESCRIPTION:case dl.CUSTOM.IMAGES:n=void 0===t.qText?e.qFallbackTitle:t.qText;break;default:n="NaN"}return n}(e,i);l.push({source:{key:"qHyperCube",field:`${n}/${r}/qAttrExprInfo/${t}`},label:o,value:"value"})})),l):l}const wl={getNode(e,{dimensionCount:t}){if(!t||t<1)return;const n=t-1,r="qDimensionInfo";return{field:`${r}/${n}`,value:t=>ql(t,e,r,n)}}};const Al={getCustomAttrExps(e,t,n){var r,i;const o={customTooltipAttrExpsArr:[],customTooltipInfoAttrExpsArr:[]},a=(null===(r=t.data)||void 0===r||null===(i=r.customTooltipAttrExps)||void 0===i?void 0:i.value)||[];if(Number.isNaN(a))return o;return function(e,t,n,r){const i={[dl.CUSTOM.TITLE]:!0,[dl.CUSTOM.DESCRIPTION]:!0},{attrExps:o,fieldPath:a}=Cl.getAttrExprData(e);return 0===t.length||0===o.length||""===a||o.forEach(((e,o)=>{const s=t[o];if(e.id===dl.CUSTOM.EXPRESSION&&s){const t=e.qFallbackTitle,i="NaN"===s.value||e.isCustomFormatted?s.value:n("qHyperCube").field(`${a}/${o}`).formatter()(s.value);r.customTooltipAttrExpsArr.push({label:t,value:i})}else if(i[e.id]&&s){const t="-"!==s.value&&"NaN"!==s.value?s.value:s.label;t&&"undefined"!==t&&r.customTooltipInfoAttrExpsArr.push({...e.id===dl.CUSTOM.TITLE&&{title:t},value:t,id:e.id})}})),r}(n,a.map((t=>ve.getMeasure(e,t))),e,o)}};function Ol({nodes:e,layout:t,dataset:n}){const r=function(e,t,n){const r=[];return e.forEach((e=>{r.push(Al.getCustomAttrExps(n,e,t))})),r}(e,t,n);return r.reduce(((e,t)=>({customTooltipAttrExpsArr:e.customTooltipAttrExpsArr.concat(t.customTooltipAttrExpsArr),customTooltipInfoAttrExpsArr:e.customTooltipInfoAttrExpsArr.concat(t.customTooltipInfoAttrExpsArr)})),{customTooltipAttrExpsArr:[],customTooltipInfoAttrExpsArr:[]})}var Dl=Object.prototype.hasOwnProperty,Nl=Object.prototype.toString,Il=Object.defineProperty,Tl=Object.getOwnPropertyDescriptor,Ll=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===Nl.call(e)},kl=function(e){if(!e||"[object Object]"!==Nl.call(e))return!1;var t,n=Dl.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&Dl.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||Dl.call(e,t)},Rl=function(e,t){Il&&"__proto__"===t.name?Il(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},Pl=function(e,t){if("__proto__"===t){if(!Dl.call(e,t))return;if(Tl)return Tl(e,t).value}return e[t]};function $l(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Fl(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function zl(){}!function(e){e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")&&e.default}((function e(){var t,n,r,i,o,a,s=arguments[0],l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l<u;++l)if(null!=(t=arguments[l]))for(n in t)r=Pl(s,n),s!==(i=Pl(t,n))&&(c&&i&&(kl(i)||(o=Ll(i)))?(o?(o=!1,a=r&&Ll(r)?r:[]):a=r&&kl(r)?r:{},Rl(s,{name:n,newValue:e(c,a,i)})):void 0!==i&&Rl(s,{name:n,newValue:i}));return s}));var _l=1/.7,jl="\\s*([+-]?\\d+)\\s*",Hl="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Vl="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Bl=/^#([0-9a-f]{3,8})$/,Ul=new RegExp(`^rgb\\(${jl},${jl},${jl}\\)$`),Yl=new RegExp(`^rgb\\(${Vl},${Vl},${Vl}\\)$`),Wl=new RegExp(`^rgba\\(${jl},${jl},${jl},${Hl}\\)$`),Gl=new RegExp(`^rgba\\(${Vl},${Vl},${Vl},${Hl}\\)$`),Xl=new RegExp(`^hsl\\(${Hl},${Vl},${Vl}\\)$`),Kl=new RegExp(`^hsla\\(${Hl},${Vl},${Vl},${Hl}\\)$`),Jl={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 Zl(){return this.rgb().formatHex()}function Ql(){return this.rgb().formatRgb()}function eu(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Bl.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?tu(t):3===n?new ou(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?nu(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?nu(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=Ul.exec(e))?new ou(t[1],t[2],t[3],1):(t=Yl.exec(e))?new ou(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Wl.exec(e))?nu(t[1],t[2],t[3],t[4]):(t=Gl.exec(e))?nu(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Xl.exec(e))?du(t[1],t[2]/100,t[3]/100,1):(t=Kl.exec(e))?du(t[1],t[2]/100,t[3]/100,t[4]):Jl.hasOwnProperty(e)?tu(Jl[e]):"transparent"===e?new ou(NaN,NaN,NaN,0):null}function tu(e){return new ou(e>>16&255,e>>8&255,255&e,1)}function nu(e,t,n,r){return r<=0&&(e=t=n=NaN),new ou(e,t,n,r)}function ru(e){return e instanceof zl||(e=eu(e)),e?new ou((e=e.rgb()).r,e.g,e.b,e.opacity):new ou}function iu(e,t,n,r){return 1===arguments.length?ru(e):new ou(e,t,n,null==r?1:r)}function ou(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function au(){return`#${cu(this.r)}${cu(this.g)}${cu(this.b)}`}function su(){const e=lu(this.opacity);return`${1===e?"rgb(":"rgba("}${uu(this.r)}, ${uu(this.g)}, ${uu(this.b)}${1===e?")":`, ${e})`}`}function lu(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function uu(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function cu(e){return((e=uu(e))<16?"0":"")+e.toString(16)}function du(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new fu(e,t,n,r)}function mu(e){if(e instanceof fu)return new fu(e.h,e.s,e.l,e.opacity);if(e instanceof zl||(e=eu(e)),!e)return new fu;if(e instanceof fu)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,s=o-i,l=(o+i)/2;return s?(a=t===o?(n-r)/s+6*(n<r):n===o?(r-t)/s+2:(t-n)/s+4,s/=l<.5?o+i:2-o-i,a*=60):s=l>0&&l<1?0:a,new fu(a,s,l,e.opacity)}function fu(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function pu(e){return(e=(e||0)%360)<0?e+360:e}function hu(e){return Math.max(0,Math.min(1,e||0))}function gu(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}$l(zl,eu,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Zl,formatHex:Zl,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return mu(this).formatHsl()},formatRgb:Ql,toString:Ql}),$l(ou,iu,Fl(zl,{brighter(e){return e=null==e?_l:Math.pow(_l,e),new ou(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new ou(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ou(uu(this.r),uu(this.g),uu(this.b),lu(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:au,formatHex:au,formatHex8:function(){return`#${cu(this.r)}${cu(this.g)}${cu(this.b)}${cu(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:su,toString:su})),$l(fu,(function(e,t,n,r){return 1===arguments.length?mu(e):new fu(e,t,n,null==r?1:r)}),Fl(zl,{brighter(e){return e=null==e?_l:Math.pow(_l,e),new fu(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new fu(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,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new ou(gu(e>=240?e-240:e+120,i,r),gu(e,i,r),gu(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new fu(pu(this.h),hu(this.s),hu(this.l),lu(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=lu(this.opacity);return`${1===e?"hsl(":"hsla("}${pu(this.h)}, ${100*hu(this.s)}%, ${100*hu(this.l)}%${1===e?")":`, ${e})`}`}}));const yu=Math.PI/180,vu=180/Math.PI,bu=4/29,xu=6/29,Mu=3*xu*xu;function Su(e){if(e instanceof Eu)return new Eu(e.l,e.a,e.b,e.opacity);if(e instanceof Ou)return Du(e);e instanceof ou||(e=ru(e));var t,n,r=Au(e.r),i=Au(e.g),o=Au(e.b),a=Cu((.2225045*r+.7168786*i+.0606169*o)/1);return r===i&&i===o?t=n=a:(t=Cu((.4360747*r+.3850649*i+.1430804*o)/.96422),n=Cu((.0139322*r+.0971045*i+.7141733*o)/.82521)),new Eu(116*a-16,500*(t-a),200*(a-n),e.opacity)}function Eu(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function Cu(e){return e>.008856451679035631?Math.pow(e,1/3):e/Mu+bu}function qu(e){return e>xu?e*e*e:Mu*(e-bu)}function wu(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Au(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Ou(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function Du(e){if(isNaN(e.h))return new Eu(e.l,0,0,e.opacity);var t=e.h*yu;return new Eu(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}$l(Eu,(function(e,t,n,r){return 1===arguments.length?Su(e):new Eu(e,t,n,null==r?1:r)}),Fl(zl,{brighter(e){return new Eu(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new Eu(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 ou(wu(3.1338561*(t=.96422*qu(t))-1.6168667*(e=1*qu(e))-.4906146*(n=.82521*qu(n))),wu(-.9787684*t+1.9161415*e+.033454*n),wu(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),$l(Ou,(function(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof Ou)return new Ou(e.h,e.c,e.l,e.opacity);if(e instanceof Eu||(e=Su(e)),0===e.a&&0===e.b)return new Ou(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*vu;return new Ou(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new Ou(e,t,n,null==r?1:r)}),Fl(zl,{brighter(e){return new Ou(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new Ou(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return Du(this).rgb()}}));var Nu,Iu=e=>()=>e;function Tu(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):Iu(isNaN(e)?t:e)}function Lu(e){var t=0,n=e.children,r=n&&n.length;if(r)for(;--r>=0;)t+=n[r].value;else t=1;e.value=t}function ku(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=Pu)):void 0===t&&(t=Ru);for(var n,r,i,o,a,s=new zu(e),l=[s];n=l.pop();)if((i=t(n.data))&&(a=(i=Array.from(i)).length))for(n.children=i,o=a-1;o>=0;--o)l.push(r=i[o]=new zu(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(Fu)}function Ru(e){return e.children}function Pu(e){return Array.isArray(e)?e[1]:null}function $u(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function Fu(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function zu(e){this.data=e,this.depth=this.height=0,this.parent=null}!function e(t){var n=function(e){return 1==(e=+e)?Tu: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(r){return Math.pow(e+r*t,n)}}(t,n,e):Iu(isNaN(t)?n:t)}}(t);function r(e,t){var r=n((e=iu(e)).r,(t=iu(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),a=Tu(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=o(t),e.opacity=a(t),e+""}}return r.gamma=e,r}(1),zu.prototype=ku.prototype={constructor:zu,count:function(){return this.eachAfter(Lu)},each:function(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this},eachAfter:function(e,t){for(var n,r,i,o=this,a=[o],s=[],l=-1;o=a.pop();)if(s.push(o),n=o.children)for(r=0,i=n.length;r<i;++r)a.push(n[r]);for(;o=s.pop();)e.call(t,o,++l,this);return this},eachBefore:function(e,t){for(var n,r,i=this,o=[i],a=-1;i=o.pop();)if(e.call(t,i,++a,this),n=i.children)for(r=n.length-1;r>=0;--r)o.push(n[r]);return this},find:function(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r},sum:function(e){return this.eachAfter((function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].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(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r},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 ku(this).eachBefore($u)},[Symbol.iterator]:function*(){var e,t,n,r,i=this,o=[i];do{for(e=o.reverse(),o=[];i=e.pop();)if(yield i,t=i.children)for(n=0,r=t.length;n<r;++n)o.push(t[n])}while(o.length)}},Nu=function(e){
10
+ /*! javascript-number-formatter - v1.1.11 - http://mottie.github.com/javascript-number-formatter/ * © ecava */
11
+ e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,a,s,l,u,c,d,m=e.length,f=e.search(/[0-9\-\+#]/),p=f>0?e.substring(0,f):"",h=e.split("").reverse().join(""),g=h.search(/[0-9\-\+#]/),y=m-g,v=e.substring(y,y+1),b=y+("."===v||","===v?1:0),x=g>0?e.substring(b,m):"";if(n=(t="-"===(e=e.substring(f,b)).charAt(0)?-t:+t)<0?t=-t:0,i=(r=e.match(/[^\d\-\+#]/g))&&r[r.length-1]||".",o=r&&r[1]&&r[0]||",",e=e.split(i),t=+(t=t.toFixed(e[1]&&e[1].length))+"",s=e[1]&&e[1].lastIndexOf("0"),(!(u=t.split("."))[1]||u[1]&&u[1].length<=s)&&(t=(+t).toFixed(s+1)),c=e[0].split(o),e[0]=c.join(""),(a=e[0]&&e[0].indexOf("0"))>-1)for(;u[0].length<e[0].length-a;)u[0]="0"+u[0];else 0==+u[0]&&(u[0]="");if((t=t.split("."))[0]=u[0],l=c[1]&&c[c.length-1].length){for(h="",y=(d=t[0]).length%l,m=d.length,b=0;b<m;b++)h+=d.charAt(b),!((b-y+1)%l)&&b<m-l&&(h+=o);t[0]=h}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),p+(n?"-":"")+r+x}},Nu({exports:{}});const{CUSTOM:_u}=dl;function ju({flags:e,layout:t,app:n,model:r,picasso:i,chart:o,translator:a,localeInfo:s,embed:l,options:u}){const c={properties:void 0},d=function({layout:e,app:t,picasso:n,model:r,chart:i,translator:o,localeInfo:a,embed:s}){return{layout:e,app:t,picasso:n,model:r,chart:i,translator:o,localeInfo:a,useCustomTooltip:e.tooltip&&!e.tooltip.auto,utils:Cl,miniChartToken:{},embed:s}}({layout:t,app:n,model:r,picasso:i,chart:o,translator:a,localeInfo:s,embed:l}),m="rtl"===u.direction,f=()=>{var e,n;const r=!(null===(e=c.properties)||void 0===e||null===(n=e.qHyperCubeDef)||void 0===n||!n.qDimensions.some((e=>{var t,n;return null===(t=e.qCalcCondition)||void 0===t||null===(n=t.qCond)||void 0===n?void 0:n.qv})));return!(!t.tooltip||t.tooltip.auto||r)};return{setProperties:e=>{c.properties=e},isEnabled:()=>f(),hideBasic:()=>f()&&function(e,t,n){if(void 0===e||void 0===t)return n;for(var r=t.split("."),i=e,o=0;o<r.length;++o){var a=r[o];if(void 0===i[a])return n;i=i[a]}return i}(t,"tooltip.hideBasic",!1),getAttributes:({dataset:e,nodes:n})=>{var r,i;const o=Ol({dataset:e,nodes:n,layout:t});return{title:null===(r=o.customTooltipInfoAttrExpsArr.find((e=>e.id===_u.TITLE)))||void 0===r?void 0:r.title,description:null===(i=o.customTooltipInfoAttrExpsArr.find((e=>e.id===_u.DESCRIPTION)))||void 0===i?void 0:i.value,measures:o.customTooltipAttrExpsArr}},hasImages:()=>Cl.checkIfPromisesExist({customTooltipModel:d}),createImageRow:({value:e,h:t})=>Cl.getImageRow(e,{h:t,rtl:m}),addImages:({nodes:r})=>{const i=Cl.getDataNodes(o,r),{attrExps:a}=Cl.getAttrExprData(t);return yl.handlePromises({customTooltipModel:d,nodes:i,attrExps:a,opts:{flags:e,app:n}})},chart:{isEnabled:()=>{return!!(f()&&null!==(e=t.tooltip)&&void 0!==e&&null!==(n=e.chart)&&void 0!==n&&null!==(i=n.object)&&void 0!==i&&i.refId&&l&&"function"==typeof(null==r?void 0:r.getEffectiveProperties));var e,n,i},hasLimitation:()=>{var e;return!(null==n||null===(e=n.isInModalSelection)||void 0===e||!e.call(n))},createContainer:({h:e})=>xl.createContainer({layout:t,ctx:{h:e,rtl:m}}),createLimitationRow:()=>Cl.getFooterRow(a.get("properties.tooltip.notselectedmessage"),m),show:({nodes:e,properties:t})=>xl.show({app:n,properties:t,selectedNodes:e,customTooltipModel:d,rtl:m}),hasAlternateState:()=>{var e;return!(null===(e=d.miniChartToken)||void 0===e||!e.alternateState)},hide:()=>xl.hide({app:n,customTooltipModel:d}),destroy:()=>xl.destroyVisualization({customTooltipModel:d})}}}function Hu({key:e,source:t,layoutService:n,fieldModel:r,colorService:i,series:o}){const{meta:a}=n;if(a.isBarSeriesStacked){const{major:a,majorNumeric:s}=r.main,l=o.filter((e=>e.type===cl.TYPE.BAR)),u=n.meta.isContinuous?s:a,c=e=>"NaN"!==e.qNum?e.qNum:0;return[{key:e,data:{extract:l.map((({ref:e,typeIndex:r,refIndex:o})=>({source:t,field:a,value:n.meta.isContinuous?e=>e.qNum:void 0,props:{major:{field:u},selectionDimension:{field:a},segment:{field:e,value:c,reduceLabel:"none"},end:{field:e,value:c,reduceLabel:"none"},null:{fields:l.map((e=>({field:e.ref}))),value:e=>Array.isArray(e)&&e.every((e=>"NaN"===e)),reduceLabel:"none"},typeIndex:r,...i.getDatumProps(o),customTooltipAttrExps:wl.getNode(n.getLayout(),n.meta),sumOfPositives:{fields:l.map((e=>({field:e.ref}))),value:e=>e.reduce(((e,t)=>t>0?e+t:e),0),reduceLabel:"none"},sumOfNegatives:{fields:l.map((e=>({field:e.ref}))),value:e=>e.reduce(((e,t)=>t<0?e+t:e),0),reduceLabel:"none"}}}))),stack:{stackKey:e=>e.value,value:e=>e.end.value,offset:"diverging"}}}]}return[]}function Vu({key:e,series:t,source:n,fieldModel:r,colorService:i,layoutService:o,forceCreate:a=!1}){if(t.length||a){const{major:a,majorNumeric:s}=r.main,l=e=>"NaN"!==e.qNum?e.qNum:0,u=o.meta.isContinuous?s:a;return[{key:e,data:{extract:t.map((({ref:e,refIndex:t,typeIndex:r,options:s},c)=>({source:n,field:a,value:o.meta.isContinuous?e=>e.qNum:void 0,props:{major:{field:u},selectionDimension:{field:a},end:{field:e,value:s.showAsZeros?l:void 0,reduceLabel:"none"},start:0,line:c,typeIndex:r,null:{field:e,value:e=>"NaN"===e.qNum,reduceLabel:"none"},customTooltipAttrExps:wl.getNode(o.getLayout(),o.meta),...i.getDatumProps(t)}})))}}]}return[]}function Bu({key:e,layoutService:t,fieldModel:n,series:r}){const{meta:i}=t;if(i.isBarSeriesStacked){const{major:t,majorNumeric:o}=n.main,a=r.filter((e=>e.type===cl.TYPE.BAR)),s=i.isContinuous?{field:o,value:e=>e.qNum,reduceLabel:"none"}:[];return[{key:e,data:{extract:{field:0,props:{major:{field:i.isContinuous?o:t},null:{fields:a.map((e=>({field:e.ref}))),value:e=>Array.isArray(e)&&e.every((e=>"NaN"===e)),reduceLabel:"none"},sumOfPositives:{fields:a.map((e=>({field:e.ref}))),value:e=>e.reduce(((e,t)=>t>0?e+t:e),0),reduceLabel:"none"},sumOfNegatives:{fields:a.map((e=>({field:e.ref}))),value:e=>e.reduce(((e,t)=>t<0?e+t:e),0),reduceLabel:"none"},timeStart:s,timeEnd:s},value:i.isContinuous?e=>e.qNum:void 0}}}]}return[]}const Uu={MINI_CHART:{value:"miniChart",translation:"properties.scrollbar.miniChart"},BAR:{value:"bar",translation:"properties.scrollbar.bar"},NONE:{value:"none",translation:"properties.scrollbar.none"}};var Yu={OPTIONS:Uu,DEFAULT:Uu.MINI_CHART};function Wu({layoutService:e,discrete:t}){return({h:n,rect:r,orientation:i,minThumbSize:o})=>{const a=t.query.getCurrentDataPage(),s=e.meta.size.y,l="horizontal"===i,u=r[l?"width":"height"];let c=a.qArea.qTop/s*u,d=a.qArea.qHeight/s*u;if(d<o){const e=(o-d)/2;c=c-e+(Math.max(0,0-(c-e))-Math.max(0,c+d+e-u)),d=o}return n("div",{style:{position:"absolute",right:0,bottom:0,background:"red",opacity:.2,...l?{top:0,left:c,width:d}:{top:c,left:0,height:d}}})}}function Gu({layoutService:e,viewState:t,viewCache:n}){return e.meta.isContinuous?function(e,t){const n=e.get("zoom"),r=t.get("continuousMin"),i=t.get("continuousMax");return[(n.min-r)/(i-r),(n.max-r)/(i-r)]}(t,n):function(e){return e.get("viewRange")}(t)}const Xu=e=>({miniChart:e===Yu.OPTIONS.MINI_CHART.value,bar:e===Yu.OPTIONS.BAR.value,none:e===Yu.OPTIONS.NONE.value}),Ku=({layoutService:e})=>{const t=e.getLayoutValue("scrollbar");if(t)return Xu(t);const n=e.getLayoutValue("showMiniChartForContinuousAxis");if(void 0===n)return Xu(Yu.DEFAULT.value);const r=e.getLayoutValue("dimensionAxis.continuousAuto"),i=e.getLayoutValue("preferContinuousAxis");return Xu(!n&&(r||!r&&i)?Yu.OPTIONS.NONE.value:Yu.OPTIONS.MINI_CHART.value)};function Ju({layoutService:e,override:t}){const n=Ku({layoutService:e});return t&&t.predicate({layoutService:e,scrollbar:n})&&(n.miniChart=t.value===Yu.OPTIONS.MINI_CHART.value,n.bar=t.value===Yu.OPTIONS.BAR.value,n.none=t.value===Yu.OPTIONS.NONE.value),n}function Zu({componentKey:e,chart:t,viewState:n,viewCache:r,layoutService:i,dockService:o,rtl:a}){return s=>{const{x:l,y:u}=s.center,c=t.element.getBoundingClientRect(),d=t.component(e),m="horizontal"===o.meta.major.orientation,f=m?l-c.left-d.rect.computedInner.x:u-c.top-d.rect.computedInner.y,p=m?d.rect.computedInner.width:d.rect.computedInner.height,h=m&&a?p-f:f,g=Math.max(0,Math.min(h/p,1)),[y,v]=Gu({layoutService:i,viewState:n,viewCache:r}),b=g<y,x=g>v,M=!b&&!x;return{pixel:h,relative:g,thumb:M?h-y*p:0,beforeThumb:b,afterThumb:x,onThumb:M}}}function Qu({componentKey:e,chart:t,viewState:n,viewCache:r,layoutService:i,dockService:o}){return()=>{const a=t.component(e),{orientation:s}=o.meta.major,{width:l,height:u}=a.rect.computedInner,c="horizontal"===s?l:u,[d,m]=Gu({layoutService:i,viewState:n,viewCache:r});return{size:c,thumbSize:(m-d)*c}}}function ec({componentKey:e,chart:t,actions:n,viewState:r,viewCache:i,layoutService:o,dockService:a,discrete:s,rtl:l}){const u=Zu({componentKey:e,chart:t,viewState:r,viewCache:i,layoutService:o,dockService:a,rtl:l}),c=Qu({componentKey:e,chart:t,viewState:r,viewCache:i,layoutService:o,dockService:a});return{type:"Tap",options:{event:"scrollbarTap",enable:(r,i)=>!i||!!n.scroll.enabled()&&t.componentsFromPoint({x:i.center.x,y:i.center.y}).some((t=>t.key===e))},events:{scrollbarTap(n){n.preventDefault();const a=u(n);if(o.meta.isContinuous){const e=r.get("zoom"),t=e.max-e.min,n=i.get("continuousMin"),o=i.get("continuousMax"),s=n+(o-n)*a.relative;r.set("zoom",{min:Math.min(s-t/2,o-t),max:Math.max(s+t/2,n+t)})}else{const e=c(),t=a.pixel-e.thumbSize/2,n=Math.max(0,t/e.size);s.command.scrollTo(n)}t.component(e).emit("render")}}}}const tc="data-scrollbar-handle";function nc({e:e}){return(e.srcEvent||e).srcElement.getAttribute(tc)||""}const rc="scrollbarResize",ic=e=>{const[t]=e.changedPointers;return t&&("pointerdown"===t.type||"mousedown"===t.type)};function oc({componentKey:e,chart:t,actions:n,viewState:r,viewCache:i,layoutService:o,dockService:a,rtl:s}){const l=Zu({componentKey:e,chart:t,viewState:r,viewCache:i,layoutService:o,dockService:a,rtl:s});return{type:"Pan",key:`event:${rc}`,options:{event:rc,threshold:0,enable(e,t){return!(!o.meta.isContinuous||!n.scroll.enabled())&&(!t||(this[rc]=this[rc]||{},ic(t)&&nc({e:t})&&(this[rc].panningEvent=t.srcEvent),!!this[rc].panningEvent))}},events:{[`${rc}start`](n){n.preventDefault(),this[rc]=this[rc]||{},this[rc].panningEvent&&t.component(e).emit("dragStart",this[rc].panningEvent)},[`${rc}move`](n){if(n.preventDefault(),this[rc]=this[rc]||{},!this[rc].panningEvent)return;const o=r.get("zoom"),a=i.get("continuousMin"),s=i.get("continuousMax"),u=i.get("minimiumZoomSpan"),c=(s-a)*l(n).relative+a,d=nc({e:this[rc].panningEvent});let m="start"===d?Math.min(c,o.max):o.min,f="end"===d?Math.max(c,o.min):o.max;m===f&&(m-="start"===d?u:0,f+="end"===d?u:0),r.set("zoom",{min:m,max:f}),t.component(e).emit("render")},[`${rc}end`](n){n.preventDefault(),this[rc]=this[rc]||{},delete this[rc].panningEvent,t.component(e).emit("dragEnd")},[`${rc}cancel`](n){n.preventDefault(),this[rc]=this[rc]||{},delete this[rc].panningEvent,t.component(e).emit("dragEnd")}}}}const ac="scrollbarPan";function sc({componentKey:e,chart:t,actions:n,viewState:r,viewCache:i,layoutService:o,dockService:a,discrete:s,rtl:l}){const u=Zu({componentKey:e,chart:t,viewState:r,viewCache:i,layoutService:o,dockService:a,rtl:l}),c=Qu({componentKey:e,chart:t,viewState:r,viewCache:i,layoutService:o,dockService:a});return{type:"Pan",key:`event:${ac}`,options:{event:ac,threshold:0,enable(r,i){return this[ac]=this[ac]||{},!(i&&!this[ac].isPanning)||!!n.scroll.enabled()&&((!i||i.target===t.element)&&t.componentsFromPoint({x:i.center.x,y:i.center.y}).some((t=>t.key===e)))}},events:{[`${ac}start`](n){n.preventDefault();const a=u(n);if(this[ac]=this[ac]||{},this[ac].isPanning=!0,t.component(e).emit("lockState"),o.meta.isContinuous){const e=r.get("zoom"),t=e.max-e.min,n=i.get("continuousMin"),o=i.get("continuousMax"),s=n+(o-n)*a.relative;s<e.min?r.set("zoom",{min:Math.min(s,o-t),max:Math.max(s+t,n+t)}):s>e.max&&r.set("zoom",{min:Math.min(s-t,o-t),max:Math.max(s,n+t)}),this[ac].relative=a.relative,this[ac].zoom=r.get("zoom"),this[ac].zoom.span=this[ac].zoom.max-this[ac].zoom.min,this[ac].zoom.fullSpan=o-n}else if(a.onThumb)this[ac].offset=a.thumb;else{const e=c();this[ac].offset=a.beforeThumb?0:e.thumbSize}},[`${ac}move`](n){n.preventDefault();const a=u(n);if(this[ac]=this[ac]||{},o.meta.isContinuous){const e=a.relative-this[ac].relative,{fullSpan:t,span:n,min:o,max:s}=this[ac].zoom,l=i.get("continuousMin"),u=i.get("continuousMax");r.set("zoom",{min:Math.min(o+e*t,u-n),max:Math.max(s+e*t,l+n)})}else{const e=a.pixel-(this[ac].offset||0),t=c(),n=Math.max(0,e/t.size);s.command.scrollTo(n)}t.component(e).emit("render")},[`${ac}end`](n){n.preventDefault(),this[ac]=this[ac]||{},this[ac].isPanning=!1,t.component(e).emit("unlockState")},[`${ac}cancel`](n){n.preventDefault(),this[ac]=this[ac]||{},this[ac].isPanning=!1,t.component(e).emit("unlockState")}}}}function lc({componentKey:e,chart:t,actions:n,viewState:r,viewCache:i,layoutService:o,dockService:a,discrete:s,rtl:l}){return[ec({componentKey:e,chart:t,actions:n,viewState:r,viewCache:i,layoutService:o,dockService:a,discrete:s,rtl:l}),oc({componentKey:e,chart:t,actions:n,viewState:r,viewCache:i,layoutService:o,dockService:a,rtl:l}),sc({componentKey:e,chart:t,actions:n,viewState:r,viewCache:i,layoutService:o,dockService:a,discrete:s,rtl:l})]}function uc({componentKey:e,chart:t,actions:n,layoutService:r}){const i=(i,o)=>{if(!r.meta.isContinuous)return;const a=t.component(e);a&&a.emit&&n.scroll.enabled()&&a.emit(i,o)};return{type:"native",events:{mousemove:e=>i("hover",e),mouseleave:()=>i("leave")}}}const cc={background:"rgba(0, 0, 0, 0.1)"},dc={top:-1,bottom:-1,width:6},mc={width:2,background:"#595959"};var fc={before:cc,after:cc,thumb:{background:"transparent",border:"1px solid rgba(68, 68, 68, 0.4)"},startHandle:dc,endHandle:dc,startHandleBorder:mc,endHandleBorder:mc};const pc={background:"rgba(0, 0, 0, 0.1)"},hc={top:-1,bottom:-1,width:6},gc={width:2,background:"#595959"};var yc={before:pc,after:pc,thumb:{background:"#B0AFAE",border:"transparent"},startHandle:hc,endHandle:hc,startHandleBorder:gc,endHandleBorder:gc};const vc={position:"absolute",top:0,right:0,bottom:0,left:0,boxSizing:"border-box"},bc={pointerEvents:"initial"},xc={pointerEvents:"none"};const Mc="ew-resize",Sc="default";function Ec(){const{rect:e}=this,{settings:t}=this.settings,n="horizontal"===t.orientation,r=n?e.computedInner.width:e.computedInner.height,i=t.range(),o=n&&t.rtl;return{size:r,start:(o?1-i[1]:i[0])*r,end:(o?1-i[0]:i[1])*r}}function Cc(){const e=this.state.hover.start||this.state.hover.end||this.state.drag.start||this.state.drag.end;this.renderer.element().ownerDocument.body.style.cursor=e?Mc:Sc}function qc(e,t,n){const{min:r}=this.settings.settings.size.thumb;if(n-t<r){const i=(r-(n-t))/2,o=Math.max(0,0-(t-i))-Math.max(0,n+i-e);return{size:e,start:t-i+o,end:n+i+o}}return{size:e,start:t,end:n}}function wc(e){const t=(e.srcEvent||e).srcElement;return this.renderer.element().contains(t)}function Ac(){const{size:e,start:t,end:n}=Ec.call(this);this.renderer.render(this.elements(this.h,qc.call(this,e,t,n)))}function Oc(){const{state:e,settings:t,style:n}=this,r=t.settings.style;return e.style[r]||(e.style[r]=function({id:e,style:t}){const n="slim"===e?yc:fc;return{container:{...vc},before:{...vc,...n.before,...t.before},after:{...vc,...n.after,...t.after},thumb:{...vc,...n.thumb,...t.thumb},startHandle:{...vc,...bc,...n.startHandle},endHandle:{...vc,...bc,...n.endHandle},startHandleBorder:{...vc,...xc,...n.startHandleBorder},endHandleBorder:{...vc,...xc,...n.endHandleBorder}}}({id:t.settings.style,style:n[r]})),e.style[r]}var Dc={require:["renderer"],defaultSettings:{settings:{style:"standard",size:{area:{min:30,max:40,ratio:1/8},thumb:{min:4}},orientation:"horizontal",rtl:!1,isContinuous:!1,range:()=>[0,1],injections:()=>[]},style:{standard:{before:{},thumb:{},after:{}},slim:{before:{},thumb:{},after:{}}}},renderer:"dom",on:{render(){Ac.call(this)},lockState(){this.state.locked=!0},unlockState(){this.state.locked=!1},hover(e){if(this.state.locked||this.state.drag.start||this.state.drag.end||!wc.call(this,e)&&this.state.hover.isPristine())return;this.state.hover.reset();const t=nc({e:e});t&&(this.state.hover[t]=!0),Cc.call(this),Ac.call(this)},leave(){this.state.locked||(this.state.hover.reset(),Cc.call(this),Ac.call(this))},dragStart(e){if(this.state.locked)return;this.state.drag.reset();const t=nc({e:e});t&&(this.state.drag[t]=!0),Cc.call(this)},dragEnd(){this.state.locked||(this.state.drag.reset(),Cc.call(this),Ac.call(this))}},preferredSize({outer:e}){const{min:t,max:n,ratio:r}=this.settings.settings.size.area,i="horizontal"===this.settings.settings.orientation?"height":"width";return Math.max(t,Math.min(n,e[i]*r))},created(){this.state={style:{},locked:!1,hover:{start:!1,end:!1,reset(){this.start=!1,this.end=!1},isPristine(){return!this.start&&!this.end}},drag:{start:!1,end:!1,reset(){this.start=!1,this.end=!1}}}},render(e){this.h=e;const{size:t,start:n,end:r}=Ec.call(this);return this.elements(e,qc.call(this,t,n,r))},properties(){return"horizontal"===this.settings.settings.orientation?{start:"left",end:"right"}:{start:"top",end:"bottom"}},elements(e,{size:t,start:n,end:r}){const{settings:i}=this.settings,o=i.injections().map((t=>t({h:e,rect:this.rect,orientation:i.orientation,minThumbSize:i.size.thumb.min})));return function({h:e,size:t,start:n,end:r,properties:i,startHandleActive:o,endHandleActive:a,style:s,continuous:l,invert:u,injections:c}){const d={[i.end]:t-n},m={[i.start]:r},f={left:-3},p={left:1},h={right:-3,left:"auto"},g={left:3},y=e("div",{style:{...s.before,...u?m:d},class:"scrollbar--before"}),v=e("div",{style:{...s.after,...u?d:m},class:"scrollbar--after"}),b=[];if(l){const t=e("div",{style:{...s.startHandle,...u?h:f},class:"scrollbar--start-handle",[tc]:"start"},o?e("div",{style:{...s.startHandleBorder,...u?g:p}}):void 0);b.push(t);const n=e("div",{style:{...s.endHandle,...u?f:h},class:"scrollbar--end-handle",[tc]:"end"},a?e("div",{style:{...s.endHandleBorder,...u?p:g}}):void 0);b.push(n)}const x=e("div",{style:{...s.thumb,[i.start]:n,[i.end]:t-r},class:"scrollbar--thumb"},b);return e("div",{style:{...s.container}},[y,x,v,...c])}({h:e,size:t,start:n,end:r,properties:this.properties(),startHandleActive:this.state.hover.start||this.state.drag.start,endHandleActive:this.state.hover.end||this.state.drag.end,style:Oc.call(this),continuous:i.isContinuous,invert:"horizontal"===i.orientation&&i.rtl,injections:o})}};function Nc({layoutService:e}){return e.meta.isContinuous&&Ju({layoutService:e}).miniChart}function Ic({models:e}){const{layoutService:t,fieldModel:n,seriesModel:r,colorService:i}=e,{primarySeries:o,secondarySeries:a}=r.meta,s=r.query.series(cl.TYPE.LINE),l=[...Vu({forceCreate:!0,key:ul.COLLECTION.PRIMARY,series:o,fieldModel:n,colorService:i,layoutService:t}),...Vu({key:ul.COLLECTION.SECONDARY,series:a,fieldModel:n,colorService:i,layoutService:t}),...Vu({key:ul.COLLECTION.LINE,series:s,fieldModel:n,colorService:i,layoutService:t}),...Hu({key:ul.COLLECTION.STACKED_PRIMARY,layoutService:t,fieldModel:n,colorService:i,series:o}),...Hu({key:ul.COLLECTION.STACKED_SECONDARY,layoutService:t,fieldModel:n,colorService:i,series:a}),...Bu({key:ul.COLLECTION.STACKED_TOTAL_PRIMARY,layoutService:t,fieldModel:n,series:o}),...Bu({key:ul.COLLECTION.STACKED_TOTAL_SECONDARY,layoutService:t,fieldModel:n,series:a})];return Nc(e)&&(l.push(...Vu({key:ul.COLLECTION.REDUCED,source:ul.DATA.REDUCED,series:r.query.all(),fieldModel:n,colorService:i,layoutService:t})),l.push(...Vu({key:ul.COLLECTION.REDUCED_PRIMARY,source:ul.DATA.REDUCED,series:o,fieldModel:n,colorService:i,layoutService:t})),l.push(...Vu({key:ul.COLLECTION.REDUCED_SECONDARY,source:ul.DATA.REDUCED,series:a,fieldModel:n,colorService:i,layoutService:t})),l.push(...Hu({key:ul.COLLECTION.REDUCED_STACKED_PRIMARY,source:ul.DATA.REDUCED,layoutService:t,fieldModel:n,series:r.meta.primarySeries.filter((e=>e.type===cl.TYPE.BAR)),colorService:i})),l.push(...Hu({key:ul.COLLECTION.REDUCED_STACKED_SECONDARY,source:ul.DATA.REDUCED,layoutService:t,fieldModel:n,series:r.meta.secondarySeries.filter((e=>e.type===cl.TYPE.BAR)),colorService:i}))),l}const Tc=({layoutService:e,dockService:t})=>"custom"!==e.getLayoutValue("dimensionAxis.axisDisplayMode")?Math.min(200,t.meta.chart.size["horizontal"===t.meta.major.orientation?"height":"width"]/4):void 0;function Lc({models:e}){const{dockService:t,seriesModel:n,layoutService:r}=e,i=2===n.meta.measureAxes.length;if(i)return.5;const o=n.meta.measureAxes[0].isPrimary?t.meta.minor.dock:t.meta.minorSecondary.dock;if(!i){const e=n.meta.measureAxes[0].isPrimary?0:1;if("none"===r.getLayoutValue(`measureAxes.${e}.show`))return.5}return"horizontal"===t.meta.minor.orientation?"near"===o||"bottom"===o?1:0:"near"===o||"left"===o?0:1}const kc=({models:e,environment:t})=>{const{fieldModel:n,discreteModel:r,layoutService:i,dockService:o}=e,{orientation:a}=o.meta.major;return{data:{extract:{field:n.main.major,props:{selectionDimension:{field:n.main.major}}}},maxPxStep:Tc({layoutService:i,dockService:o}),invert:"horizontal"===a&&"rtl"===t.options.direction,range:r.query.getScaleRange,align:Lc({models:e})}},Rc=({models:e,environment:t})=>{const{fieldModel:n,discreteModel:r,layoutService:i,dockService:o}=e,{orientation:a}=o.meta.major;return{type:"group-by-measure",data:{extract:{field:n.main.major}},measureCount:i.meta.groupSize,maxPxStep:Tc({layoutService:i,dockService:o}),invert:"horizontal"===a&&"rtl"===t.options.direction,range:r.query.getScaleRange,align:Lc({models:e})}};function Pc({viewState:e,models:t,environment:n}){const{fieldModel:r,dockService:i}=t,{orientation:o}=i.meta.major;return{type:"linear",invert:"horizontal"===o&&"rtl"===n.options.direction,data:{extract:{field:r.main.majorNumeric}},ticks:{forceBounds:!0,count:e.get("zoom").min===e.get("zoom").max?1:void 0},minorTicks:{count:1},min:()=>e.get("zoom").min,max:()=>e.get("zoom").max}}function $c({viewCache:e,mainMajor:t}){return G(!0,{},t,{min:()=>e.get("continuousMin"),max:()=>e.get("continuousMax")})}function Fc({viewState:e,viewCache:t,layoutService:n}){return t.set("qTimeAxisCache",[]),{get:(e,n=0)=>{const r=t.get("qTimeAxisCache");return r[n]&&r[n][0]===e?r[n][1]:void 0},set:(e,n,r=0)=>{t.get("qTimeAxisCache")[r]=[e,n]},key:({distance:r})=>{const{min:i,max:o}=e.get("zoom"),a=(o-i)/(t.get("continuousMax")-t.get("continuousMin")),s=n.getHyperCubeValue("qAxisData.qAxis",[]).map((e=>e.qName));return[r,Number.parseFloat(a).toFixed(12),...s].toString()}}}function zc({picasso:e,viewState:t,viewCache:n,models:r,environment:i}){const{layoutService:o,fieldModel:a,appLayoutModel:s,themeService:l}=r,{measureText:u}=e.renderer("svg")(),{majorNumeric:c}=a.main,d=l.getStyles(),m={type:"time",data:{field:c},qAxis:()=>o.getHyperCubeValue("qAxisData.qAxis",[]),field:c,min:()=>t.get("zoom").min,max:()=>t.get("zoom").max,invert:"rtl"===i.options.direction,formatter:{fn:e.formatter("q-time"),localeInfo:s.qLocaleInfo,qNumFormat:o.getHyperCubeValue("qDimensionInfo.0",{}).qNumFormat,measureText:e=>u({text:e,fontFamily:d.axis.label.name.fontFamily,fontSize:d.axis.label.name.fontSize})},ticks:{generator:{type:"d3",initialMin:t.get("zoom").min},anchor:"start",clamp:!0},cache:Fc({viewState:t,viewCache:n,layoutService:o})};return{[ul.SCALE.MAJOR]:G(!0,{},m,{ticks:{level:"outer"}}),[ul.SCALE.MAJOR_INNER]:G(!0,{},m,{ticks:{level:"inner"}})}}function _c({picasso:e,models:t,viewState:n,viewCache:r,environment:i}){const{meta:o}=t.layoutService,a=o.isTime?{...zc({picasso:e,viewState:n,viewCache:r,models:t,environment:i})}:o.isContinuous?{[ul.SCALE.MAJOR]:Pc({models:t,viewState:n,environment:i})}:o.isBarSeriesGrouped?{[ul.SCALE.MAJOR]:Rc({models:t,environment:i})}:{[ul.SCALE.MAJOR]:o.isBarSeriesStackedInBothAxis?Rc({models:t,environment:i}):kc({models:t,environment:i})};return Nc(t)?{...a,[ul.SCALE.REDUCED]:$c({viewCache:r,mainMajor:a[ul.SCALE.MAJOR]})}:a}function jc({fields:e,tickModel:t,dockService:n,environment:r}){const i="rtl"===r.options.direction,{orientation:o}=n.meta.minor;return{data:{source:"qHyperCube",fields:e},invert:"vertical"===o||i,ticks:{values:t.query.getValues},min:t.query.getMin,max:t.query.getMax}}function Hc({layoutService:e,tickModel:t,dockService:n,environment:r}){if(!Nc({layoutService:e}))return;const i="rtl"===r.options.direction,{orientation:o}=n.meta.minor;return{type:"linear",invert:"vertical"===o||i,min:t.query.getMin,max:t.query.getMax}}function Vc({picasso:e,models:t,viewState:n,viewCache:r,environment:i}){const{layoutService:o,fieldModel:a,primaryTickModel:s,secondaryTickModel:l,colorService:u,dockService:c}=t;return{..._c({picasso:e,models:t,viewState:n,viewCache:r,environment:i}),[ul.SCALE.MINOR.PRIMARY]:jc({fields:a.main.minorsPrimary,tickModel:s,dockService:c,environment:i}),[ul.SCALE.MINOR.SECONDARY]:jc({fields:a.main.minorsSecondary,tickModel:l,dockService:c,environment:i}),[ul.SCALE.MINOR.REDUCED_PRIMARY]:Hc({layoutService:o,tickModel:s,dockService:c,environment:i}),[ul.SCALE.MINOR.REDUCED_SECONDARY]:Hc({layoutService:o,tickModel:l,dockService:c,environment:i}),...u.custom.wrappedScales()}}var Bc={AXIS:{MAJOR:{HORIZONTAL:{width:"XSMALL",height:"SMALL"},VERTICAL:{width:"SMALL",height:"XSMALL"}},MINOR:"XSMALL"},AXIS_TITLE:{MAJOR:{HORIZONTAL:{width:"XSMALL",height:"MEDIUM"},VERTICAL:{width:"MEDIUM",height:"XSMALL"}},MINOR:"SMALL"},GRID_LINE:"XSMALL",VALUE_LABEL:"XSMALL",LABEL_SPACE:"XSMALL",OUT_OF_BOUNDS_MARKER:"XSMALL",REFERENCE_LINE:"SPARK"};const Uc=["all","labels"];function Yc({models:e}){const{layoutService:t,dockService:n,seriesModel:r,themeService:i,styleModel:o}=e,a=t.getLayoutValue("measureAxes");if(!a||!a.length)return[];const s=i.getStyles(),l=o.query.axis.label.getStyle(),{measureAxes:u}=r.meta;return u.filter((e=>{const t=e.isPrimary?0:1;return Uc.some((e=>a[t].show===e))})).map((e=>({type:"axis",key:e.isPrimary?ul.COMPONENT.AXIS.MINOR.PRIMARY:ul.COMPONENT.AXIS.MINOR.SECONDARY,scale:e.scale,layout:{dock:e.isPrimary?n.meta.minor.dock:n.meta.minorSecondary.dock,minimumLayoutMode:Bc.AXIS.MINOR},settings:{labels:{show:!0,fontFamily:l.fontFamily,fontSize:l.fontSize,fill:l.fill},line:{stroke:s.axis.line.major.color},ticks:{stroke:s.axis.line.major.color},minorTicks:{stroke:s.axis.line.minor.color}}})))}var Wc={INACTIVE:.5},Gc={LOWER:3,UPPER:13};const Xc=({layoutService:e})=>{const t=e.getHyperCubeValue("qDimensionInfo.0.qApprMaxGlyphCount"),[n]=e.getDataPages(),r=n?n.qMatrix:[];return fe.getAdjustedMaxGlyphCount(t,r,0,"qText")};function Kc({models:e,environment:t}){const{layoutService:n,dockService:r,styleModel:i}=e,o="rtl"===t.options.direction,a=n.getLayoutValue("dimensionAxis"),s=i.query.axis.label.getStyle(),l=Xc({layoutService:n}),{orientation:u}=r.meta.major,c="horizontal"===u?a.label:"auto";return{type:"axis",key:ul.COMPONENT.AXIS.MAJOR,scale:ul.SCALE.MAJOR,layout:{dock:r.meta.major.dock,minimumLayoutMode:Bc.AXIS.MAJOR[u.toUpperCase()]},settings:{labels:{mode:a.label,tiltAngle:o?-40:40,maxEdgeBleed:50,maxLengthPx:"horizontal"===c?void 0:r.meta.minor.size/4,maxGlyphCount:l,tiltThreshold:l>Gc.LOWER&&l<Gc.UPPER?1:void 0,fontFamily:s.fontFamily,fontSize:s.fontSize,fill:s.fill},line:{show:!1},paddingEnd:4},brush:{consume:[{context:"selection",style:{inactive:{opacity:Wc.INACTIVE}}}]}}}function Jc({models:e}){const{dockService:t,styleModel:n}=e,{orientation:r}=t.meta.major,i=n.query.axis.label.getStyle();return{type:"axis",key:ul.COMPONENT.AXIS.MAJOR_CONTINUOUS,scale:ul.SCALE.MAJOR,layout:{dock:t.meta.major.dock,minimumLayoutMode:Bc.AXIS.MAJOR[r.toUpperCase()]},settings:{labels:{align:0,offset:4,fontFamily:i.fontFamily,fontSize:i.fontSize,fill:i.fill},line:{show:!1}}}}function Zc({models:e,environment:t}){const{layoutService:n}=e,r=n.getLayoutValue("dimensionAxis");if(!r)return[];const{show:i}=r;return"none"===i||"title"===i?[]:n.meta.isTime?function({models:e,environment:t}){const{dockService:n,themeService:r,styleModel:i}=e,o="rtl"===t.options.direction,{orientation:a}=n.meta.major,s="bottom"===n.meta.major.dock?0:1,l=r.getStyles(),u=i.query.axis.label.getStyle(),c=o?1:0,d={type:"time-axis",renderer:"svg",layout:{dock:n.meta.major.dock,minimumLayoutMode:Bc.AXIS.MAJOR[a]},preferredSize:()=>({size:2*parseFloat(u.fontSize),edgeBleed:{left:1,right:1}}),settings:{anchor:o?"end":"start",label:{align:s,justify:c},guideLine:{major:{justify:c},minor:{align:s}},line:{show:!1}},style:{label:{fontFamily:u.fontFamily,fontSize:u.fontSize,fill:u.fill},majorGuideLine:{stroke:l.axis.line.major.color},minorGuideLine:{stroke:l.axis.line.minor.color}}};return[G(!0,{},d,{key:ul.COMPONENT.AXIS.TIME_INNER,scale:ul.SCALE.MAJOR_INNER,settings:{guideLine:{minor:{show:!0}}},style:{majorGuideLine:{stroke:l.axis.line.minor.color},minorGuideLine:{stroke:l.axis.line.major.color}}}),G(!0,{},d,{key:ul.COMPONENT.AXIS.TIME_OUTER,scale:ul.SCALE.MAJOR,settings:{guideLine:{minor:{show:!1}}}})]}({models:e,environment:t}):n.meta.isContinuous?[Jc({models:e})]:[Kc({models:e,environment:t})]}const Qc=({layoutService:e,axis:t})=>e.meta.isBarSeriesGrouped?({scale:e,datum:t})=>e([t.value,t.typeIndex.value])+e.bandwidth()/2:e.meta.isBarSeriesStackedInBothAxis?({scale:e,datum:n})=>e([n.value,t])+e.bandwidth()/2:null,ed=({layoutService:e,seriesModel:t,rtl:n,orientation:r})=>e.meta.isContinuous?null:e.meta.isBarSeriesGrouped?({scale:e,datum:i})=>e([i.value,n&&"horizontal"===r?t.meta.barSeriesCount-1:0])+e.bandwidth()*t.meta.barSeriesCount/2:e.meta.isBarSeriesStackedInBothAxis?({scale:e,datum:t})=>e([t.value,n&&"horizontal"===r?1:0])+e.bandwidth():null;function td({layoutService:e,active:t={},inactive:n={}}){return{consume:[{context:"selection",data:["selectionDimension","end","color","major"],style:{active:{strokeWidth:e.meta.isContinuous?0:2,stroke:"#000",opacity:e=>{var t,n;return!0===(null===(t=e.data)||void 0===t||null===(n=t.null)||void 0===n?void 0:n.value)?0:1},...t},inactive:{opacity:e=>{var t,n;return!0===(null===(t=e.data)||void 0===t||null===(n=t.null)||void 0===n?void 0:n.value)?0:Wc.INACTIVE},...n}}}]}}var nd={MAX:"max",MIN:"min"};function rd(e,t){return function(e,t){const{hasExplicitMax:n}=t.meta,{max:r}=t.explicit;return!!n&&e>r}(e,t)||function(e,t){const{hasExplicitMin:n}=t.meta,{min:r}=t.explicit;return!!n&&e<r}(e,t)}const id=(e,t)=>`${e}-${t.id}`,od=4,ad=12,sd=4;function ld({chart:e,layoutService:t,dockService:n,markerKey:r,markerType:i}){if(t.meta.isContinuous)return()=>`${sd}px`;const o={size:void 0},a="horizontal"===n.meta.major.orientation?"width":"height";return t=>{if(!o.size){const n=e.component(r),s=t.resources.scale(ul.SCALE.MAJOR),l=n.rect[a]*s.bandwidth()*.25,u=Math.max(od,Math.min(ad,l));o.size=`${"bar"===i?2*u:u}px`}return o.size}}const{isDark:ud}=vt;const cd=({chart:e,models:t,series:n,environment:r})=>{const{layoutService:i,seriesModel:o,colorService:a,dockService:s,primaryExtremumModel:l,secondaryExtremumModel:u}=t,c=a.getColor(),{fill:d,marker:m}=n.options,{isContinuous:f}=i.meta,p="rtl"===r.options.direction,{orientation:h}=s.meta.major,g="horizontal"===h,y=(n.isPrimary?l:u).query.getExtrema(),v=({end:e})=>{const{value:t}=e;return rd(t,y)},b=id(ul.COMPONENT.MARKER,n);return{type:"point",key:b,data:{filter:e=>n.ref===e.end.source.field,collection:n.collection},settings:{[g?"x":"y"]:{scale:ul.SCALE.MAJOR,fn:ed({layoutService:i,seriesModel:o,rtl:p,orientation:h}),ref:f?"major":void 0},[g?"y":"x"]:{scale:n.scale,ref:"end",fn:e=>{var t;const n=!0===(null===(t=e.datum.null)||void 0===t?void 0:t.value)?e.scale.min():e.datum.end.value;return function(e){return Math.min(Math.max(0,e),1)}(e.scale(n))}},fill:d||"bar"===m?c:"none",opacity:e=>{var t;return!0===(null===(t=e.datum.null)||void 0===t?void 0:t.value)||v(e.datum)?0:1},stroke:e=>{const t=c(e);return d?ud(t)?function(e){return je(e).brighter(.5).toString()}(t):function(e){return je(e).darker().toString()}(t):t},size:ld({chart:e,layoutService:i,dockService:s,markerKey:b,markerType:m}),shape:()=>(({marker:e,horizontal:t,rtl:n})=>{let r;return"triangle"!==e||t||(r=n?"left":"right"),"bar"===e&&(r=t?"horizontal":"vertical"),r?{type:e,direction:r}:{type:e}})({marker:m,horizontal:g,rtl:p})},brush:td({layoutService:i,active:{opacity:e=>{var t;return!0===(null===(t=e.data.null)||void 0===t?void 0:t.value)||v(e.data)?0:1}},inactive:{opacity:e=>{var t;return!0===(null===(t=e.data.null)||void 0===t?void 0:t.value)||v(e.data)?0:Wc.INACTIVE}}})}};function dd({property:e="end",isHorizontal:t,isColor:n,fallback:r,rtl:i}){return function(o){const{datum:a,resources:{scale:s}}=o,l=s(ul.SCALE.MAJOR),u=s(ul.SCALE.COLOR),c=t&&i?[...a.points].reverse():a.points,d=c.reduce(((t,n,r)=>{const i="NaN"===n[e].value||Number.isNaN(n[e].value),o=c[r+1],a=o&&"NaN"!==o[e].value&&!Number.isNaN(o[e].value);return i?t.length&&a&&t.push(n):t.push(n),t}),[]),m="group-by-measure"===l.type?e=>l([e.major.value,e.typeIndex.value]):e=>l(e.major.value),f=d.map(m),p=Math.min(...f),h=Math.max(...f)-p,g=0===h?1:h,y=f.map(((e,t)=>0===t?0:t===f.length-1?1:(e-p)/g)),v=[];for(let t=0;t<d.length;t++){const i=d[t],o=i.color&&i.color.value,a=n?o||r:u(o)||r,s=0===t,l=t===d.length-1,c=y[t];if("NaN"===i[e].value||Number.isNaN(i[e].value))v[t-1].virtual||v.push({virtual:!0});else{const n=d[t-1];n&&"NaN"!==n[e].value&&!Number.isNaN(n[e].value)?v.push({color:a,offset:s?0:Math.max(0,parseFloat((c-(c-y[t-1])/2).toFixed(5)))}):v.push({color:a,offset:c});const r=d[t+1];r&&"NaN"!==r[e].value&&!Number.isNaN(r[e].value)?v.push({color:a,offset:l?1:Math.max(0,parseFloat((c+(y[t+1]-c)/2).toFixed(5)))}):v.push({color:a,offset:c})}}const b=v.reduce(((e,t,n)=>{if(t.virtual){const t=v[n-1],r=v[n+1],i=t.offset+(r.offset-t.offset)/2;e.push({color:t.color,offset:i},{color:r.color,offset:i})}else e.push(t);return e}),[]);return{type:"gradient",x1:0,x2:t?1:0,y1:0,y2:t?0:1,stops:b}}}function md({environment:e,models:t,measureIndex:n}){const{layoutService:r,colorService:i,dockService:o}=t,a="rtl"===e.options.direction,{hasMultipleMeasures:s}=r.meta,{mode:l,type:u,nil:c}=i.getSettingsForMeasure(n),d="horizontal"===o.meta.major.orientation;if(!l||"constant"===u)return i.getColor();if("measure"===l&&"categorical"===u)return i.getColor();const m=r.getHyperCubeValue(`qMeasureInfo.${n}.color`);if(null!=m&&m.on)return"byExpression"===m.mode?dd({isHorizontal:d,isColor:!0,fallback:c,rtl:a}):i.getColor();const f=r.getLayoutValue("color",{}),p=!f.auto&&"byExpression"===f.mode,h=!!f.colorExpression;if(p&&!h)return c;const g=!f.auto&&"byMeasure"===f.mode&&f.byMeasureDef&&void 0!==f.byMeasureDef.activeMeasureIndex;return s||!g?dd({isHorizontal:d,isColor:"color"===u,fallback:c,rtl:a}):"continuous"===u?function({isHorizontal:e,rtl:t}){return function(n){const{datum:{points:r},resources:{scale:i}}=n,o=i(ul.SCALE.COLOR),a=r.map((e=>e.end.value)).filter((e=>"NaN"!==e&&!Number.isNaN(e))),s=Math.min(...a),l=Math.max(...a),u=l-s,c=0===u?1:u,d=o.domain().map((e=>({color:o(Math.min(l,Math.max(s,e))),offset:Math.min(1,Math.max(0,(e-s)/c))})));return{type:"gradient",x1:!e&&t?1:0,x2:e||t?0:1,y1:e?1:0,y2:0,stops:d}}}({isHorizontal:d,rtl:a}):function({isHorizontal:e,isArea:t,fallback:n,rtl:r}){return function(i){const{datum:{points:o},resources:{scale:a}}=i,s=a(ul.SCALE.COLOR),l=o.map((e=>e.end.value)).filter((e=>"NaN"!==e&&!Number.isNaN(e))),u=Math.min(...l),c=Math.max(...l),d=t?Math.min(0,u):u,m=(t?Math.max(0,c):c)-d,f=0===m?1:m,p=s.domain(),h=[];for(let e=0;e<p.length-1;e++){const t=p[e],r=s(t)||n;h.push({color:r,offset:Math.min(1,Math.max(0,(t-d)/f))});const i=p[e+1];h.push({color:r,offset:Math.min(1,Math.max(0,(i-d)/f))})}return{type:"gradient",x1:!e&&r?1:0,x2:e||r?0:1,y1:e?1:0,y2:0,stops:h}}}({isHorizontal:d,fallback:c,rtl:a})}const fd=({models:e,environment:t,series:n})=>{const{layoutService:r,seriesModel:i,dockService:o,styleModel:a}=e,s="rtl"===t.options.direction,{orientation:l}=o.meta.major,u=ed({layoutService:r,seriesModel:i,rtl:s,orientation:l});return{key:id(ul.COMPONENT.LINE,n),type:"line",data:{filter:e=>n.ref===e.end.source.field,collection:n.collection},settings:{coordinates:{major:{scale:ul.SCALE.MAJOR,fn:u},minor:{scale:n.scale,ref:"end"}},layers:{curve:a.query.line.getCurveFn(),line:{stroke:md({models:e,environment:t,measureIndex:n.refIndex}),strokeWidth:a.query.line.getStrokeWidthFn(),strokeDasharray:a.query.line.getStrokeDasharrayFn(),strokeLinejoin:"round"}},connect:n.options.showAsConnections,orientation:o.meta.major.orientation},brush:td({layoutService:r,active:{stroke:void 0,strokeWidth:void 0,opacity:Wc.INACTIVE},inactive:{opacity:Wc.INACTIVE}})}};var pd={BAR:{STROKE:{COLOR:"#205891",WIDTH:{NONE:0,SMALL:1,MEDIUM:2,LARGE:4}}},LINE:{CURVE:{LINEAR:"linear",MONOTONE:"monotone",STEP:"step"},WIDTH:{FULL:{DEFAULT:2,ACTIVE:2},LESS:{DEFAULT:1,ACTIVE:1}},TYPE:{SOLID:void 0,DASHED:"5, 5"}},POINT:{SIZE:{DEFAULT:6,ACTIVE:4}}};function hd({series:e,layoutService:t}){const{showAsConnections:n}=e.options,r=function({layoutService:e}){const{isDiscrete:t}=e.meta;return({item:e})=>{if(e.dummy)return t;const{value:n}=e.end;return"NaN"===n||Number.isNaN(n)}}({layoutService:t}),i=n?(e,t)=>0!==e&&t.slice(0,e).reverse().some((e=>!r({item:e}))):(e,t)=>0!==e&&!r({item:t[e-1]}),o=n?(e,t)=>e!==t.length-1&&t.slice(e+1,t.length).some((e=>!r({item:e}))):(e,t)=>e!==t.length-1&&!r({item:t[e+1]});return({index:e,items:t})=>({before:i(e,t),after:o(e,t)})}const gd=3,yd=20;function vd({models:e,series:t,environment:n}){const{layoutService:r,colorService:i,seriesModel:o,dockService:a,styleModel:s,primaryExtremumModel:l,secondaryExtremumModel:u,selectionService:c}=e,d=r.getLayoutValue("dataPoint.show",!1),{orientation:m}=a.meta.major,f="horizontal"===m,p="SPARK"===a.meta.chart.mode,h=i.getColor(),{POINT:g}=pd,y=function({layoutService:e,series:t}){const n={key:void 0,map:void 0},r=hd({series:t,layoutService:e});return({item:e,items:t})=>{n.key!==t&&(n.key=t,n.map=function({items:e}){const t=e.reduce(((e,t)=>{const{value:n}=t.line;return e[n]||(e[n]={items:[],keys:[]}),e[n].items.push(t),e[n].keys.push(`${t.major.value}-${t.line.value}`),e}),{});return t}({items:t}));const{value:i}=e.line,o=n.map[i],a=`${e.major.value}-${i}`,s=o.keys.indexOf(a),{before:l,after:u}=r({index:s,items:o.items});return!l&&!u}}({series:t,layoutService:r}),v="rtl"===n.options.direction,b=(t.isPrimary?l:u).query.getExtrema(),{isContinuous:x}=r.meta,M=({end:e})=>{const{value:t}=e;return rd(t,b)};return{type:"point",key:id(ul.COMPONENT.POINT,t),data:{filter:e=>t.ref===e.end.source.field,collection:t.collection},preferredSize:()=>({edgeBleed:{top:f?g.SIZE.DEFAULT/2:0}}),settings:{[f?"y":"x"]:{scale:t.scale,ref:"end",fn:e=>{var t;const n=!0===(null===(t=e.datum.null)||void 0===t?void 0:t.value)?e.scale.min():e.datum.end.value;return function(e){return Math.min(Math.max(0,e),1)}(e.scale(n))}},[f?"x":"y"]:{scale:ul.SCALE.MAJOR,fn:ed({layoutService:r,seriesModel:o,rtl:v,orientation:m}),ref:"major"},sizeLimits:{minPx:gd,maxPx:yd},size:e=>{const{value:t}=e.datum.line;return`${s.query.point.getSize(t)}px`},fill:h,opacity:({datum:e,data:t})=>{var n;return null!==(n=e.null)&&void 0!==n&&n.value||M(e)?0:p?y({item:e,items:t.items})?1:0:d||y({item:e,items:t.items})?1:0}},brush:td({layoutService:r,active:{r:e=>e.r+pd.POINT.SIZE.ACTIVE/2,strokeWidth:1.5,stroke:"#FFFFFF",opacity:e=>{var t;if(!0===(null===(t=e.data.null)||void 0===t?void 0:t.value)||M(e.data))return 0;if(!x||d)return 1;const{event:n,components:r=[]}=(null==c?void 0:c.getSelectionInfo())||{};if("continuousRange"===n)return 0;if("tap"!==n)return 1;const i=[ul.COMPONENT.AXIS_OVERLAY.CONTINUOUS,ul.COMPONENT.AXIS_OVERLAY.TIME_INNER,ul.COMPONENT.AXIS_OVERLAY.TIME_OUTER].some((e=>r.indexOf(e)>=0));return i?0:1}},inactive:{opacity:e=>1===e.opacity?.5:0}})}}const bd=(e,{dataset:t})=>{const{value:n,label:r,source:i}=e.end,o=t(i.key).field(i.field);return oe.shouldUseFormat(o.raw())?o.formatter()(n):r};function xd({chart:e,models:t,environment:n,series:r,lineSeries:i}){const{layoutService:o,dockService:a,styleModel:s,primaryExtremumModel:l,secondaryExtremumModel:u}=t,{id:c}=r,d="rtl"===n.options.direction,m=o.getLayoutValue("dataPoint");if(!m)return!1;if(!m.show||!m.showLineLabels)return!1;const f=(r.isPrimary?l:u).query.getExtrema(),p=s.query.point.label.getStyle();return{type:"point-label",key:`${ul.COMPONENT.POINT_LABEL}-${c}`,layout:{displayOrder:2,minimumLayoutMode:Bc.VALUE_LABEL},settings:{orientation:a.meta.major.orientation,rtl:d,connect:r.options.showAsConnections,label:t=>bd(t,e),pointValue:e=>e.end.value,majorValue:e=>e.value,target:{point:`${ul.COMPONENT.POINT}-${c}`,allPoints:i.map((e=>`${ul.COMPONENT.POINT}-${e.id}`))},lineIndex:"typeIndex",showLabel:e=>!(({end:e})=>rd(e.value,f))(e.data),labelSpace:{use:()=>{const t=e.component(ul.COMPONENT.LABEL_SPACE);return!(null==t||!t.preferredSize())},size:10}},style:{fontFamily:p.fontFamily,fontSize:p.fontSize,fill:p.fill}}}const Md=({chart:e,dock:t})=>{let n=t;const r=e.component(`${ul.COMPONENT.SLICED_HAT}-${nd.MAX}`),i=e.component(`${ul.COMPONENT.SLICED_HAT}-${nd.MAX}-${cl.AXIS.PRIMARY}`),o=e.component(`${ul.COMPONENT.SLICED_HAT}-${nd.MAX}-${cl.AXIS.SECONDARY}`);return r?n=`@${ul.COMPONENT.SLICED_HAT}-${nd.MAX}`:i?n=`@${ul.COMPONENT.SLICED_HAT}-${nd.MAX}-${cl.AXIS.PRIMARY}`:o&&(n=`@${ul.COMPONENT.SLICED_HAT}-${nd.MAX}-${cl.AXIS.SECONDARY}`),n},Sd=({dockPosition:e,orientation:t,rtl:n})=>{let r=1;return e!==`@${ul.COMPONENT.SLICED_HAT}-${nd.MAX}`&&e!==`@${ul.COMPONENT.SLICED_HAT}-${nd.MAX}-${cl.AXIS.PRIMARY}`&&e!==`@${ul.COMPONENT.SLICED_HAT}-${nd.MAX}-${cl.AXIS.SECONDARY}`||!("horizontal"===t||"vertical"===t&&n)||(r=4),e!==`@${ul.COMPONENT.SLICED_HAT}-${nd.MIN}`&&e!==`@${ul.COMPONENT.SLICED_HAT}-${nd.MIN}-${cl.AXIS.PRIMARY}`&&e!==`@${ul.COMPONENT.SLICED_HAT}-${nd.MIN}-${cl.AXIS.SECONDARY}`||"vertical"!==t||n||(r=4),r};function Ed({chart:e,models:t,environment:n,lineSeries:r}){const{layoutService:i,dockService:o,primaryExtremumModel:a,secondaryExtremumModel:s}=t,l=i.getLayoutValue("dataPoint",{}),u="rtl"===n.options.direction;if(!r.length)return!1;if(!l.show||!l.showLineLabels)return!1;const c="horizontal"===o.meta.major.orientation,{show:d}=i.getLayoutValue("dimensionAxis",{});if("none"!==d){const{dock:e}=o.meta.major;if(c&&"top"===e)return!1;if(!c&&e===(u?"left":"right"))return!1}const m=u?"left":"right";return{type:"label-space",key:ul.COMPONENT.LABEL_SPACE,layout:{minimumLayoutMode:Bc.LABEL_SPACE,dock:Md({chart:e,dock:c?"top":m})},settings:{size:10},preferredSize:()=>{const t=e.component(`${ul.COMPONENT.LINE}-${r[0].id}`);if(null==t||!t.rect)return 0;const n=(c?17:34)/t.rect[c?"height":"width"],i=a.query.getExtrema(),o=e.scale(ul.SCALE.MINOR.PRIMARY)(i.implicit.line.max),l=c||u?o:1-o,d=r.filter((e=>e.isPrimary)).length>0,m=s.query.getExtrema(),f=e.scale(ul.SCALE.MINOR.SECONDARY)(m.implicit.line.max),p=c||u?f:1-f,h=r.filter((e=>!e.isPrimary)).length>0;return d&&l<n||h&&p<n?10:0}}}const Cd={min:"Min",max:"Max"};function qd(e,t,n){const{hasExplicitMax:r}=n.meta,{max:i}=n.explicit;return!!r&&Math.max(e,t)>i&&i<=Math.min(e,t)}function wd(e,t,n){const{hasExplicitMin:r}=n.meta,{min:i}=n.explicit;return!!r&&Math.min(e,t)<i&&i>=Math.max(e,t)}function Ad(e,t,n){return qd(e,t,n)||wd(e,t,n)}function Od(e,t){const{hasExplicitMax:n}=t.meta,{max:r}=t.explicit;return!!n&&e>r&&r<=0}function Dd(e,t){const{hasExplicitMin:n}=t.meta,{min:r}=t.explicit;return!!n&&e<r&&r>=0}function Nd(e,t){return Od(e,t)||Dd(e,t)}function Id({extrema:e,type:t}){return!(function({extrema:e,type:t}){return!e.meta[`hasExplicit${Cd[t]}`]}({extrema:e,type:t})||function({extrema:e,type:t}){const n=t===nd.MAX?e.implicit.bar.max:e.implicit.bar.min,r=Number(n.toFixed(13));return t===nd.MAX?!Od(r,e):!Dd(r,e)}({extrema:e,type:t}))}var Td=Object.freeze({__proto__:null,isMaxOutOfBounds:Od,isMinOutOfBounds:Dd,isOutOfBounds:Nd,isSegmentMaxOutOfBounds:qd,isSegmentMinOutOfBounds:wd,isSegmentOutOfBounds:Ad,shouldShowOob:Id});const Ld={min:"Min",max:"Max"},kd=({chart:e,models:t,markerSeries:n,lineSeries:r,barSeries:i,environment:o,type:a})=>{const{dockService:s,primaryExtremumModel:l,secondaryExtremumModel:u,primaryTickModel:c,secondaryTickModel:d,layoutService:m,seriesModel:f,themeService:p,fieldModel:h}=t,g="rtl"===o.options.direction,{dock:y,opposite:v,orientation:b}=s.meta.major,x=l.query.getExtrema(),M=u.query.getExtrema(),S=a===nd.MAX,{isBarSeriesGrouped:E}=m.meta,C=(({chart:e,type:t,opposite:n,dock:r})=>{let i=t===nd.MAX?n:r;const o=e.component(`${ul.COMPONENT.SLICED_HAT}-${t}`),a=e.component(`${ul.COMPONENT.SLICED_HAT}-${t}-${cl.AXIS.PRIMARY}`),s=e.component(`${ul.COMPONENT.SLICED_HAT}-${t}-${cl.AXIS.SECONDARY}`),l=e.component(ul.COMPONENT.LABEL_SPACE),u=e.component(`${ul.COMPONENT.BAR_OOB}-${t}`),c=e.component(`${ul.COMPONENT.BAR_OOB}-${t}-${cl.AXIS.PRIMARY}`),d=e.component(`${ul.COMPONENT.BAR_OOB}-${t}-${cl.AXIS.SECONDARY}`);return o?i=`@${ul.COMPONENT.SLICED_HAT}-${t}`:a?i=`@${ul.COMPONENT.SLICED_HAT}-${t}-${cl.AXIS.PRIMARY}`:s?i=`@${ul.COMPONENT.SLICED_HAT}-${t}-${cl.AXIS.SECONDARY}`:u||c||d?l&&t===nd.MAX?i=`@${ul.COMPONENT.LABEL_SPACE}`:u?i=`@${ul.COMPONENT.BAR_OOB}-${t}`:c?i=`@${ul.COMPONENT.BAR_OOB}-${t}-${cl.AXIS.PRIMARY}`:d&&(i=`@${ul.COMPONENT.BAR_OOB}-${t}-${cl.AXIS.SECONDARY}`):l&&t===nd.MAX&&(i=`@${ul.COMPONENT.LABEL_SPACE}`),i})({chart:e,type:a,opposite:v,dock:y}),q=ed({layoutService:m,seriesModel:f,rtl:g,orientation:b}),w=r.concat(n);if(!w.length)return!1;const A=S?x.implicit.bar.max:x.implicit.bar.min,O=Number(A.toFixed(13));if(!E&&i.length&&Td[`is${Ld[a]}OutOfBounds`](O,x))return!1;if(!x.meta.hasExplicit&&!M.meta.hasExplicit)return!1;const D=S?"max":"min",N=Math[D](Number(x.implicit.line[D].toFixed(13)),Number(x.implicit.marker[D].toFixed(13))),I=Math[D](Number(M.implicit.line[D].toFixed(13)),Number(M.implicit.marker[D].toFixed(13))),T=w.filter((e=>e.isPrimary)),L=w.filter((e=>!e.isPrimary)),k=T.length>0,R=L.length>0,{major:P,majorNumeric:$}=h.main,F=e=>"NaN"!==e.qNum?e.qNum:0,z=m.meta.isContinuous?$:P;return{type:"data-out-of-bounds-marker",key:`${ul.COMPONENT.DATA_OOB_MARKER}-${a}`,layout:{dock:C,minimumLayoutMode:Bc.OUT_OF_BOUNDS_MARKER},data:{extract:w.map((({ref:e,typeIndex:t,options:n})=>({field:P,value:m.meta.isContinuous?e=>e.qNum:void 0,props:{major:{field:z},end:{field:e,value:n.showAsZeros?F:void 0},typeIndex:t,null:{field:e,value:e=>"NaN"===e.qNum}}})))},settings:{type:a,primaryExtremum:S?()=>c.query.getMax():()=>c.query.getMin(),secondaryExtremum:S?()=>d.query.getMax():()=>d.query.getMin(),primarySeries:T,secondarySeries:L,orientation:b,rtl:g,major:{scale:ul.SCALE.MAJOR,fn:q},markerOffset:Sd({dockPosition:C,orientation:b,rtl:g})},brush:td({layoutService:m}),show:()=>{if(S){if(k&&N>c.query.getMax())return!0;if(R&&I>d.query.getMax())return!0}if(!S){if(k&&N<c.query.getMin())return!0;if(R&&I<d.query.getMin())return!0}return!1},style:{fill:p.getStyles().outOfRange.color}}};function Rd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Pd(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Rd(Object(n),!0).forEach((function(t){jd(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Rd(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function $d(){$d=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function u(e,t,n,i){var o=t&&t.prototype instanceof m?t:m,a=Object.create(o.prototype),s=new q(i||[]);return r(a,"_invoke",{value:M(e,n,s)}),a}function c(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var d={};function m(){}function f(){}function p(){}var h={};l(h,o,(function(){return this}));var g=Object.getPrototypeOf,y=g&&g(g(w([])));y&&y!==t&&n.call(y,o)&&(h=y);var v=p.prototype=m.prototype=Object.create(h);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){function i(r,o,a,s){var l=c(e[r],e,o);if("throw"!==l.type){var u=l.arg,d=u.value;return d&&"object"==typeof d&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){i("next",e,a,s)}),(function(e){i("throw",e,a,s)})):t.resolve(d).then((function(e){u.value=e,a(u)}),(function(e){return i("throw",e,a,s)}))}s(l.arg)}var o;r(this,"_invoke",{value:function(e,n){function r(){return new t((function(t,r){i(e,n,t,r)}))}return o=o?o.then(r,r):r()}})}function M(e,t,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return{value:void 0,done:!0}}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=S(a,n);if(s){if(s===d)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=c(e,t,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}function S(e,t){var n=t.method,r=e.iterator[n];if(void 0===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,S(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var i=c(r,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,d;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function q(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function w(e){if(e||""===e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}throw new TypeError(typeof e+" is not iterable")}return f.prototype=p,r(v,"constructor",{value:p,configurable:!0}),r(p,"constructor",{value:f,configurable:!0}),f.displayName=l(p,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,l(e,s,"GeneratorFunction")),e.prototype=Object.create(v),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,a,(function(){return this})),e.AsyncIterator=x,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new x(u(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},b(v),l(v,s,"Generator"),l(v,o,(function(){return this})),l(v,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},e.values=w,q.prototype={constructor:q,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(C),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return a.type="throw",a.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),l=n.call(o,"finallyLoc");if(s&&l){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),C(n),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;C(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:w(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),d}},e}function Fd(e){return Fd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Fd(e)}function zd(e,t,n,r,i,o,a){try{var s=e[o](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,i)}function _d(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){zd(o,r,i,a,s,"next",e)}function s(e){zd(o,r,i,a,s,"throw",e)}a(void 0)}))}}function jd(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Hd(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Vd(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 r,i,o,a,s=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(e,t)||Ud(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 Bd(e){return function(e){if(Array.isArray(e))return Yd(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Ud(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ud(e,t){if(e){if("string"==typeof e)return Yd(e,t);var n=Object.prototype.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)?Yd(e,t):void 0}}function Yd(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Wd=Object.prototype.hasOwnProperty,Gd=Object.prototype.toString,Xd=Object.defineProperty,Kd=Object.getOwnPropertyDescriptor,Jd=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===Gd.call(e)},Zd=function(e){if(!e||"[object Object]"!==Gd.call(e))return!1;var t,n=Wd.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&Wd.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||Wd.call(e,t)},Qd=function(e,t){Xd&&"__proto__"===t.name?Xd(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},em=function(e,t){if("__proto__"===t){if(!Wd.call(e,t))return;if(Kd)return Kd(e,t).value}return e[t]},tm=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}((function e(){var t,n,r,i,o,a,s=arguments[0],l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l<u;++l)if(null!=(t=arguments[l]))for(n in t)r=em(s,n),s!==(i=em(t,n))&&(c&&i&&(Zd(i)||(o=Jd(i)))?(o?(o=!1,a=r&&Jd(r)?r:[]):a=r&&Zd(r)?r:{},Qd(s,{name:n,newValue:e(c,a,i)})):void 0!==i&&Qd(s,{name:n,newValue:i}));return s}));function nm(e,t){return{range:function(e){var n=e.resources,r=e.data,i=n.theme.palette("categorical",0===t?r.items.length:t);return r.items.map((function(e){return i[e.value%i.length]}))},valueAccessor:e.value}}function rm(e,t){return{range:function(e){var n=e.resources,r=e.data,i=n.theme.palette("categorical",0===t?r.items.length:t);return r.items.map((function(e){return i[e.row.value%i.length]}))},valueAccessor:e.value}}function im(e,t,n,r,i){var o,a,s=i.byRow,l=i.byElemNo;if(r&&(t.input.persistent||e.hc.qDimensionInfo.length>1||void 0===n.activeDimensionIndex&&e.hc.qSize.qcy>((null===(a=(o=e.hc).qDataPages[0]||o.qStackedDataPages[0])||void 0===a?void 0:a.qArea.qHeight)||0)))return l(r,r.raw().qCardinal);if(r){var u=t.pic.extract({field:r.key(),trackBy:r.value}).length;return s(r,u)}return{}}function om(e,t){var n=e.hc.qDimensionInfo,r=t.input.byDimDef||{activeDimensionIndex:n.length-1};if(r.activeDimensionIndex>=0){var i=n[r.activeDimensionIndex];r=i.coloring&&i.coloring.colorMapRef?{type:"libraryItem",key:i.coloring.colorMapRef,activeDimensionIndex:r.activeDimensionIndex}:{activeDimensionIndex:r.activeDimensionIndex}}return r}function am(e,t){var n;return t.activeDimensionIndex>=0?n=e.pic.fields().filter((function(e){return"dimension"===e.type()}))[t.activeDimensionIndex]:"libraryItem"===t.type?!1===(n=t.key?e.pic.field((function(e){return e.raw().colorMapRef===t.key})):void 0)&&(n=e.pic.field((function(e){return"colorByAlternative"===e.raw().id}))):"expression"===t.type&&(n=e.pic.field((function(e){return"colorByAlternative"===e.raw().id}))),n}function sm(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function lm(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function um(){}var cm=1/.7,dm="\\s*([+-]?\\d+)\\s*",mm="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",fm="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",pm=/^#([0-9a-f]{3,8})$/,hm=new RegExp(`^rgb\\(${dm},${dm},${dm}\\)$`),gm=new RegExp(`^rgb\\(${fm},${fm},${fm}\\)$`),ym=new RegExp(`^rgba\\(${dm},${dm},${dm},${mm}\\)$`),vm=new RegExp(`^rgba\\(${fm},${fm},${fm},${mm}\\)$`),bm=new RegExp(`^hsl\\(${mm},${fm},${fm}\\)$`),xm=new RegExp(`^hsla\\(${mm},${fm},${fm},${mm}\\)$`),Mm={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 Sm(){return this.rgb().formatHex()}function Em(){return this.rgb().formatRgb()}function Cm(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=pm.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?qm(t):3===n?new Dm(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?wm(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?wm(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=hm.exec(e))?new Dm(t[1],t[2],t[3],1):(t=gm.exec(e))?new Dm(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=ym.exec(e))?wm(t[1],t[2],t[3],t[4]):(t=vm.exec(e))?wm(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=bm.exec(e))?Rm(t[1],t[2]/100,t[3]/100,1):(t=xm.exec(e))?Rm(t[1],t[2]/100,t[3]/100,t[4]):Mm.hasOwnProperty(e)?qm(Mm[e]):"transparent"===e?new Dm(NaN,NaN,NaN,0):null}function qm(e){return new Dm(e>>16&255,e>>8&255,255&e,1)}function wm(e,t,n,r){return r<=0&&(e=t=n=NaN),new Dm(e,t,n,r)}function Am(e){return e instanceof um||(e=Cm(e)),e?new Dm((e=e.rgb()).r,e.g,e.b,e.opacity):new Dm}function Om(e,t,n,r){return 1===arguments.length?Am(e):new Dm(e,t,n,null==r?1:r)}function Dm(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function Nm(){return`#${km(this.r)}${km(this.g)}${km(this.b)}`}function Im(){const e=Tm(this.opacity);return`${1===e?"rgb(":"rgba("}${Lm(this.r)}, ${Lm(this.g)}, ${Lm(this.b)}${1===e?")":`, ${e})`}`}function Tm(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Lm(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function km(e){return((e=Lm(e))<16?"0":"")+e.toString(16)}function Rm(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new $m(e,t,n,r)}function Pm(e){if(e instanceof $m)return new $m(e.h,e.s,e.l,e.opacity);if(e instanceof um||(e=Cm(e)),!e)return new $m;if(e instanceof $m)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,s=o-i,l=(o+i)/2;return s?(a=t===o?(n-r)/s+6*(n<r):n===o?(r-t)/s+2:(t-n)/s+4,s/=l<.5?o+i:2-o-i,a*=60):s=l>0&&l<1?0:a,new $m(a,s,l,e.opacity)}function $m(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function Fm(e){return(e=(e||0)%360)<0?e+360:e}function zm(e){return Math.max(0,Math.min(1,e||0))}function _m(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}sm(um,Cm,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Sm,formatHex:Sm,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Pm(this).formatHsl()},formatRgb:Em,toString:Em}),sm(Dm,Om,lm(um,{brighter(e){return e=null==e?cm:Math.pow(cm,e),new Dm(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new Dm(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Dm(Lm(this.r),Lm(this.g),Lm(this.b),Tm(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:Nm,formatHex:Nm,formatHex8:function(){return`#${km(this.r)}${km(this.g)}${km(this.b)}${km(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Im,toString:Im})),sm($m,(function(e,t,n,r){return 1===arguments.length?Pm(e):new $m(e,t,n,null==r?1:r)}),lm(um,{brighter(e){return e=null==e?cm:Math.pow(cm,e),new $m(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new $m(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,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Dm(_m(e>=240?e-240:e+120,i,r),_m(e,i,r),_m(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new $m(Fm(this.h),zm(this.s),zm(this.l),Tm(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=Tm(this.opacity);return`${1===e?"hsl(":"hsla("}${Fm(this.h)}, ${100*zm(this.s)}%, ${100*zm(this.l)}%${1===e?")":`, ${e})`}`}}));const jm=Math.PI/180,Hm=180/Math.PI,Vm=4/29,Bm=6/29,Um=3*Bm*Bm;function Ym(e){if(e instanceof Wm)return new Wm(e.l,e.a,e.b,e.opacity);if(e instanceof Zm)return Qm(e);e instanceof Dm||(e=Am(e));var t,n,r=Jm(e.r),i=Jm(e.g),o=Jm(e.b),a=Gm((.2225045*r+.7168786*i+.0606169*o)/1);return r===i&&i===o?t=n=a:(t=Gm((.4360747*r+.3850649*i+.1430804*o)/.96422),n=Gm((.0139322*r+.0971045*i+.7141733*o)/.82521)),new Wm(116*a-16,500*(t-a),200*(a-n),e.opacity)}function Wm(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function Gm(e){return e>.008856451679035631?Math.pow(e,1/3):e/Um+Vm}function Xm(e){return e>Bm?e*e*e:Um*(e-Vm)}function Km(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Jm(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Zm(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function Qm(e){if(isNaN(e.h))return new Wm(e.l,0,0,e.opacity);var t=e.h*jm;return new Wm(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}sm(Wm,(function(e,t,n,r){return 1===arguments.length?Ym(e):new Wm(e,t,n,null==r?1:r)}),lm(um,{brighter(e){return new Wm(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new Wm(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 Dm(Km(3.1338561*(t=.96422*Xm(t))-1.6168667*(e=1*Xm(e))-.4906146*(n=.82521*Xm(n))),Km(-.9787684*t+1.9161415*e+.033454*n),Km(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),sm(Zm,(function(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof Zm)return new Zm(e.h,e.c,e.l,e.opacity);if(e instanceof Wm||(e=Ym(e)),0===e.a&&0===e.b)return new Zm(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*Hm;return new Zm(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new Zm(e,t,n,null==r?1:r)}),lm(um,{brighter(e){return new Zm(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new Zm(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return Qm(this).rgb()}}));var ef=e=>()=>e;function tf(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):ef(isNaN(e)?t:e)}var nf=function e(t){var n=function(e){return 1==(e=+e)?tf: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(r){return Math.pow(e+r*t,n)}}(t,n,e):ef(isNaN(t)?n:t)}}(t);function r(e,t){var r=n((e=Om(e)).r,(t=Om(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),a=tf(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=o(t),e.opacity=a(t),e+""}}return r.gamma=e,r}(1),rf=/^class(-pyramid)?/,of=function(e,t,n,r){var i=void 0!==n.min?n.min:r.min(),o=void 0!==n.max?n.max:r.max(),a=i,s=o,l=t.limits,u={},c="percent"===t.limitType?l.map((function(e){return i+(o-i)*e})):l,d=t.colors.map((function(t){return e.resolveUIColor(t)}));if(i=Math.min.apply(Math,[i].concat(Bd(c))),o=Math.max.apply(Math,[o].concat(Bd(c))),u.min=i,u.max=o,t.breakTypes&&-1===t.breakTypes.indexOf(!0))u.type="categorical",Object.assign(u,function(e){var t=e.min,n=e.max,r=e.limits,i=e.range,o=[],a=[];if(r.length)if(r[r.length-1]<t)a.push(t,n),o.push(i[i.length-1],i[i.length-1],i[i.length-1]);else if(r[0]>n)a.push(t,n),o.push(i[0],i[0],i[0]);else{if(r[0]>t)a.push(t),o.push(i[0]);else{a.push(t);for(var s=0;s<r.length;s++)if(t<r[s]){o.push(i[s]);break}}for(var l=0;l<r.length;l++)t<r[l]&&r[l]<n&&(a.push(r[l]),o.push(i[l]));if(r[r.length-1]<n)a.push(n),o.push(i[r.length]),o.push(i[r.length]);else{a.push(n);for(var u=0;u<r.length;u++)if(r[u]>n){o.push(i[u]),o.push(i[u]);break}}}else o.push(i[0]);return{min:t,max:n,range:o,domain:a}}({min:"percent"===t.limitType?i:a,max:"percent"===t.limitType?o:s,range:d,limits:"percent"===t.limitType?c:l}));else if(t.breakTypes){var m=t.breakTypes;u.type="continuous",u.domain=[i],u.range=[d[0]];for(var f=0;f<c.length;f+=1)if(m[f]){var p=d[f],h=d[f+1],g=nf(p,h)(.5);u.range.push(g),u.domain.push(c[f]),f<c.length-1&&m[f+1]&&(u.range.push(d[f+1]),u.domain.push((c[f]+c[f+1])/2))}else u.range.push(d[f]),u.range.push(d[f+1]),u.domain.push(c[f]),u.domain.push(c[f]+Math.min(1e-6,(o-i)/1e6));u.range.push(d[d.length-1]),u.domain.push(o)}else u.domain=c,u.range=d;return u};function af(e,t,n,r,i){var o,a,s,l=0,u=[],c=(e-t)/(r+1);if(0===c)return 1;for(o=0;o<n.length;o+=1)a=.99*(n[o]-t),s=n[o]>e?Math.floor(e/c):n[o]<t?0:Math.floor(a/c),Number.isNaN(s)||(u[s]?u[s]+=1:u[s]=1);for(o=0;o<u.length;o+=1)u[o]&&(l+=1);return l<=r||l>=i?Math.max(l,r):af(e,t,n,r+1,i)}var sf=function(e,t,n,r){var i,o,a=t.theme,s=t.hc,l=r.f,u={mode:"field",fieldType:"measure",field:l?l.key():void 0,reverse:n.input.reverseScheme||!1,type:"continuous",range:function(e){return e.resources.theme.palette("quant")}},c=[],d=!0;if(l){if(Number.isNaN(+l.min())||Number.isNaN(+l.max()))return{invalid:!0};(d=!("S"===(i=n.pic.raw()).qMode&&(i.qDataPages[0]&&i.qSize.qcy>i.qDataPages[0].qArea.qHeight||!i.qDataPages.length&&i.qSize.qcy>0)||"K"===i.qMode&&i.qStackedDataPages[0]&&i.qSize.qcy>i.qStackedDataPages[0].qArea.qHeight||"T"===i.qMode&&i.qSize.qcy>i.qTreeDataPages[0].qGroupSize))&&(c=n.pic.extract({field:0,props:{num:{field:l.key()},exclude:{fields:s.qDimensionInfo.map((function(e,t){return{field:"qDimensionInfo/".concat(t)}})),value:function(e){return Math.min.apply(Math,Bd(e))<0}}}}).filter((function(e){return e.value>=0&&!e.exclude.value})).map((function(e){return e.num.value})).filter((function(e){return"number"==typeof e})))}if(!1===n.input.autoMinMax){if(u.min=n.input.measureMin,u.max=n.input.measureMax,u.max<u.min)return{invalid:!0}}else if(l&&!d)u.min=l.min(),u.max=l.max();else if(l){if(!c.length)return{invalid:!0};u.min=Math.min.apply(Math,Bd(c)),u.max=Math.max.apply(Math,Bd(c))}if(n.input.measureScheme&&(u.palettes={quant:n.input.measureScheme}),a){var m=a.getDataColorScales().filter((function(e){return e.key===n.input.measureScheme}))[0];u.type=m&&rf.test(m.type)?"categorical":"continuous","categorical"===u.type&&(o=m.colors.some((function(e){return Array.isArray(e)}))?Math.max.apply(Math,Bd(m.colors.map((function(e){return e?e.length:0})))):m.colors.length)}if("categorical"===u.type){for(var f=d?af(u.max,u.min,c,1,o):o,p=(u.max-u.min)/f,h=[],g=0;g<f+1;g+=1)h.push(u.min+p*g);u.domain=h,u.range=function(e){for(var t=e.resources.theme.palette("quant",f),n=Math.max(1,Math.floor(t.length/f)),r=[],i=0;i<f;i+=1)r.push(t[i*n]);return[r[0]].concat(r,[r[r.length-1]])}}return u};function lf(e,t){var n;return t.activeMeasureIndex>=0?n=e.pic.fields().filter((function(e){return"measure"===e.type()}))[t.activeMeasureIndex]:"libraryItem"===t.type?n=e.pic.field((function(e){return e.raw().colorMapRef===t.key&&void 0!==t.key})):"expression"===t.type&&(n=e.pic.field((function(e){return"colorByAlternative"===e.raw().id}))),n||(n=e.pic.field((function(e){return void 0!==e.raw().matchMeasure})))&&(n=e.pic.fields().filter((function(e){return"measure"===e.type()}))[n.raw().matchMeasure]),n}function uf(e){e.measureOverrides.every((function(e){return!e}))&&(e.measureOverrides=null)}function cf(e,t){for(var n=(null==t?void 0:t.domain)||[],r=(null==t?void 0:t.range)||[],i=[],o=0;o<e.length;++o){var a=e[o];if("constant"===(null==a?void 0:a.mode)){var s=n.indexOf(o);-1===s?(n.push(o),r.push(a.primary)):r[s]=a.primary,e[o]=null}else if(a){i.push(o);var l=n.indexOf(o);-1!==l&&(n.splice(l,1),r.splice(l,1))}}return{domain:n,range:r,exclude:i}}function df(e,t,n,r){var i,o=function(e,t,n,r){if(t.input&&!t.input.auto){if("byMeasure"===t.input.mode)return function(e,t,n){var r=t.theme,i=t.hc,o=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).getCField,a=void 0===o?lf:o,s=n.input.byMeasureDef||{activeMeasureIndex:0},l=a(n,s),u=sf(0,{theme:r,hc:i},n,{f:l});if(u.invalid)return u;"expression"===s.type&&(s.activeMeasureIndex<0||void 0===s.activeMeasureIndex)&&(u.label=s.label,l&&"color.altLabel"===l.raw().labelExpRef&&(u.label=n.input.altLabel)),!u.label&&l&&(u.label=l.title());var c=s.activeMeasureIndex>=0?l:null;if(!c&&l&&void 0!==l.raw().matchMeasure&&l.raw().matchMeasure>-1&&(c=n.pic.fields().filter((function(e){return"measure"===e.type()}))[l.raw().matchMeasure]),n.input.useMeasureGradient&&"libraryItem"===s.type)if(c){var d=c.raw().coloring;d&&d.gradient&&tm(u,of(e,d.gradient,u,c))}else u.auxiliary=s;return u}(e,n,t);if("byDimension"===t.input.mode)return function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=r.getCDef,o=void 0===i?om:i,a=r.getCByField,s=void 0===a?am:a,l=r.getPersistence,u=void 0===l?im:l,c=o(t,n),d=s(n,c),m=d?d.raw():{},f=n&&n.pic?n.pic.raw():{};if(m.qError||m.qSize&&0===m.qSize.qcy&&!f.qHasOtherValues)return{invalid:!0};var p={mode:"field",fieldType:"dimension",type:"categorical",field:d?d.key():void 0,isFieldLocked:m.qLocked};return("expression"===c.type||c.activeDimensionIndex<0)&&(p.label=c.label,"color.altLabel"===m.labelExpRef&&(p.label=n.input.altLabel)),!p.label&&d&&(p.label=d.title()),n.input.dimensionScheme&&(p.palettes={categorical:n.input.dimensionScheme}),n.input.useDimColVal&&"libraryItem"===c.type&&(p.auxiliary=c),tm(p,u(t,n,c,d,{byRow:rm,byElemNo:nm})),p}(e,n,t);if("byExpression"===t.input.mode)return function(e,t,n,r){var i=t.hc,o=t.theme,a=t.translator,s=n.pic.field((function(e){return"colorByExpression"===e.raw().id}));if(!s||!s.raw().qFallbackTitle&&!n.input.colorExpression||!(Number.isFinite(s.raw().qMin)&&Number.isFinite(s.raw().qMax)||n.input.expressionIsColor))return{mode:"constant",type:"constant",primary:r.nil};if(n.input.expressionIsColor)return{mode:"field",fieldType:"expression",field:s?s.key():void 0,type:"color"};var l=sf(0,{hc:i,theme:o},n,{f:s});return l.invalid||(l.label=n.input.expressionLabel||a.get("Object.ChartTooltip.ColorExpression")),l}(0,n,t,r);if("byMultiple"===t.input.mode||"primary"===t.input.mode)return function(e,t,n,r){var i=t.hc,o=t.theme,a=t.translator,s=n.input.useBaseColors;if(("byMultiple"===n.input.mode||"primary"===n.input.mode&&"measure"===n.input.useBaseColors)&&i.qMeasureInfo.length>1&&(s="measure"),"measure"===s){var l=[],u=[];"measure"===n.input.useBaseColors&&i.qMeasureInfo.forEach((function(t,n){if(t.baseColor||t.coloring&&t.coloring.baseColor){l.push(n);var i=e.resolveUIColor(t.baseColor||t.coloring.baseColor);"none"===i?u.push(r.primary):u.push(i)}}));var c=n.input.dimensionScheme?{categorical:n.input.dimensionScheme}:void 0,d=o?o.getDataColorPalettes()[0]:void 0;return"measure"===n.input.useBaseColors&&d&&(c={categorical:d.key}),{mode:"measure",type:"categorical",palettes:c,label:a?a.get("Common.Measures"):void 0,explicit:l.length?{domain:l,range:u}:void 0}}if("dimension"===s){var m=[],f=[];return i.qDimensionInfo.forEach((function(t,n){if(t.baseColor||t.coloring&&t.coloring.baseColor){m.push(n);var i=e.resolveUIColor(t.baseColor||t.coloring.baseColor);"none"===i?f.push(r.primary):f.push(i)}})),{mode:"dimension",type:"categorical",field:m.length?m[0]:void 0,explicit:m.length?{domain:m,range:f}:void 0}}var p=r.primary;if(void 0!==n.input.paletteColor)n.input.paletteColor&&(p=e.resolveUIColor(n.input.paletteColor));else{var h=n.input.singleColor;"number"!=typeof h||Number.isNaN(h)||(p=["#b0afae","#7b7a78","#545352","#4477aa","#7db8da","#b6d7ea","#46c646","#f93f17","#ffcf02","#276e27","#ffffff","#000000"][h])}return{mode:"constant",type:"constant",primary:p}}(e,n,t,r)}return{}}(e,t,n,r);return null!==(i=t.input)&&void 0!==i&&i.measureOverrides?(o.measureOverrides=t.input.measureOverrides.map((function(n,i){return function(e){var t,n=e.cm,r=e.defaults,i=e.index,o=e.input,a=e.pic;if(!o||!o.on)return null;var s=null!==(t=o.mode)&&void 0!==t?t:"primary";return"primary"===s?function(e,t,n){var r=n.primary;return void 0!==t.paletteColor&&t.paletteColor&&(r=e.resolveUIColor(t.paletteColor)),Pd(Pd({},n),{},{mode:"constant",type:"constant",primary:r})}(n,o,r):"byExpression"===s?function(e,t,n){var r="qMeasureInfo/".concat(e,"/"),i=t.field((function(e){return e.id().startsWith(r)&&"colorByMeasureExpression"===e.raw().id})),o=i;return Pd(Pd({},n),{},o?{mode:"field",fieldType:"expression",field:i?i.key():void 0,type:"color"}:{mode:"constant",type:"constant",primary:n.nil})}(i,a,r):null}({cm:e,input:n,defaults:r,index:i,pic:t.pic})})),function(e,t){var n,r,i,o=t.translator;if(uf(e),1===(null===(n=e.measureOverrides)||void 0===n?void 0:n.length))return e.measureOverrides[0];if("measure"===e.mode&&e.measureOverrides&&(e.explicit=cf(e.measureOverrides,e.explicit),uf(e)),null!==(r=e.measureOverrides)&&void 0!==r&&r.every((function(e){return"constant"===(null==e?void 0:e.mode)}))){var a={mode:"measure",type:"categorical",label:null==o?void 0:o.get("Common.Measures")};return a.explicit=cf(e.measureOverrides),a}return null!==(i=e.measureOverrides)&&void 0!==i&&i.every((function(e){return e}))?{invalid:!0,measureOverrides:e.measureOverrides}:e}(o,n)):o}var mf=function(e,t){var n=e.fieldType,r={};if(t)if("measure"===n){var i=t.coloring;i&&(r.measureGradient=i.gradient)}else if("dimension"===n){var o=t[0],a=t[1];o&&(r.legendDataPage=o),a&&(r.dimValsData=a.colorMap)}return r},ff=function(e){throw e.isHandled=!0,e},pf=function(e,t){var n=t.layout,r=t.app;return n&&n.snapshotData?n.snapshotData.content&&n.snapshotData.content.chartData&&n.snapshotData.content.chartData.dimValsData?Promise.resolve({colorMap:n.snapshotData.content.chartData.dimValsData}):Promise.reject():r&&r.getObject?r.getObject("ColorMapModel_".concat(e)).then((function(e){return e.getLayout()})):Promise.reject()},hf=function(e,t){var n=t.layout,r=t.app;return n&&n.snapshotData?n.snapshotData.content&&n.snapshotData.content.chartData&&n.snapshotData.content.chartData.measureGradient?Promise.resolve({coloring:{gradient:n.snapshotData.content.chartData.measureGradient}}):Promise.reject():r&&r.getMeasure?r.getMeasure(e).then((function(e){return e.getMeasure()})):Promise.reject()},gf=function(e,t){var n=t.layout,r=t.model,i=t.app;return n&&n.snapshotData?n.snapshotData.content&&n.snapshotData.content.chartData&&n.snapshotData.content.chartData.legendDataPage?Promise.resolve(n.snapshotData.content.chartData.legendDataPage):Promise.reject():r&&r.session&&i?r.getHyperCubeData(e,[{qHeight:100,qLeft:0,qTop:0,qWidth:2}]).catch(ff):Promise.reject()};function yf(e){return function(t){return"object"===Fd(t.datum[e])?t.datum[e].value:void 0}}function vf(e){return"object"===Fd(e.datum.isNull)?e.datum.isNull.value:-2===e.datum.value}function bf(e){return-3===e.datum.value}var xf={TITLE:{COLOR:void 0,FONT_SIZE:"16px",FONT_FAMILY:"'Source Sans Pro', 'Arial', 'sans-serif'"},LABEL:{COLOR:void 0,FONT_SIZE:void 0,FONT_FAMILY:"'Source Sans Pro', 'Arial', 'sans-serif'"}};function Mf(e){var t=e.theme,n=e.key,r=e.styleOverrides,i={title:{color:xf.TITLE.COLOR,fontSize:xf.TITLE.FONT_SIZE,fontFamily:xf.TITLE.FONT_FAMILY},label:{color:xf.LABEL.COLOR,fontSize:xf.LABEL.FONT_SIZE,fontFamily:xf.LABEL.FONT_FAMILY}};if(!t&&!r)return i;var o=r||{},a=o.title,s=o.label,l=function(e){var t=e.theme,n=e.key;return function(e,r,i,o){return void 0!==e?e:t?t.getStyle(n,r,i):o}}({theme:t,key:n});return i.title.color=l(null==a?void 0:a.color,"legend.title","color",xf.TITLE.COLOR),i.title.fontSize=l(null==a?void 0:a.fontSize,"legend.title","fontSize",xf.TITLE.FONT_SIZE),i.title.fontFamily=l(null==a?void 0:a.fontFamily,"legend.title","fontFamily",xf.TITLE.FONT_FAMILY),i.label.color=l(null==s?void 0:s.color,"legend.label","color",xf.LABEL.COLOR),i.label.fontSize=l(null==s?void 0:s.fontSize,"legend.label","fontSize",xf.LABEL.FONT_SIZE),i.label.fontFamily=l(null==s?void 0:s.fontFamily,"legend.label","fontFamily",xf.LABEL.FONT_FAMILY),i}var Sf=function(e,t,n){var r=e&&e.dock||void 0;if("auto"!==r)return r||"right";if(t){var i=t.element.getBoundingClientRect();if(i.height>i.width)return"bottom"}return n?"left":"right"},Ef=function(e,t,n){return!(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 Cf(e,t){var n=e.styleReference,r=e.styleOverrides,i=e.chart,o=e.rtl,a=t.legendProps,s=t.coloring,l=t.theme,u=t.hc,c=Mf({theme:l,key:n,styleOverrides:r});return{layout:{minimumLayoutMode:"MEDIUM",dock:Sf(a,i,o)},show:"function"==typeof a.show?function(){return Ef(a,u,s)}:Ef(a,u,s),renderer:"svg",mounted:function(e){e.childNodes[0].style.pointerEvents="none",e.style.overflow="hidden"},settings:{title:{show:!1!==a.showTitle,wordBreak:"break-word",maxLines:2,lineHeight:1.2,text:s.label||"",fill:c.title.color,fontSize:c.title.fontSize,fontFamily:c.title.fontFamily}}}}function qf(e,t,n){var r=[],i=[],o=function(e,t,n){return"categorical"===t.coloring.type?function(e,t,n){var r=Cf(e,t);if(!r.show)return!1;var i,o=e.key,a=e.styleReference,s=e.styleOverrides,l=e.viewState,u=e.rtl,c=e.settings,d=e.style,m=t.scaleKey,f=t.theme,p=t.scales,h=Mf({theme:f,key:a,styleOverrides:s}),g=r.layout.dock,y="left"===g||"right"===g?{maxLines:2,wordBreak:"break-word"}:{},v={up:"M13.6,11 L2.4,11 C2.28954305,11 2.2,10.9104569 2.2,10.8 C2.2,10.756726 2.21403557,10.7146192 2.24,10.68 L7.84,3.21333333 C7.90627417,3.12496777 8.03163444,3.10705916 8.12,3.17333333 C8.13516113,3.18470418 8.14862915,3.1981722 8.16,3.21333333 L13.76,10.68 C13.8262742,10.7683656 13.8083656,10.8937258 13.72,10.96 C13.6853808,10.9859644 13.643274,11 13.6,11 Z",down:"M2.4,4 L13.6,4 C13.7104569,4 13.8,4.08954305 13.8,4.2 C13.8,4.24327404 13.7859644,4.28538077 13.76,4.32 L8.16,11.7866667 C8.09372583,11.8750322 7.96836556,11.8929408 7.88,11.8266667 C7.86483887,11.8152958 7.85137085,11.8018278 7.84,11.7866667 L2.24,4.32 C2.17372583,4.23163444 2.19163444,4.10627417 2.28,4.04 C2.31461923,4.01403557 2.35672596,4 2.4,4 Z",left:"M11,2.4 L11,13.6 C11,13.7104569 10.9104569,13.8 10.8,13.8 C10.756726,13.8 10.7146192,13.7859644 10.68,13.76 L3.21333333,8.16 C3.12496777,8.09372583 3.10705916,7.96836556 3.17333333,7.88 C3.18470418,7.86483887 3.1981722,7.85137085 3.21333333,7.84 L10.68,2.24 C10.7683656,2.17372583 10.8937258,2.19163444 10.96,2.28 C10.9859644,2.31461923 11,2.35672596 11,2.4 Z",right:"M4,13.6 L4,2.4 C4,2.28954305 4.08954305,2.2 4.2,2.2 C4.24327404,2.2 4.28538077,2.21403557 4.32,2.24 L11.7866667,7.84 C11.8750322,7.90627417 11.8929408,8.03163444 11.8266667,8.12 C11.8152958,8.13516113 11.8018278,8.14862915 11.7866667,8.16 L4.32,13.76 C4.23163444,13.8262742 4.10627417,13.8083656 4.04,13.72 C4.01403557,13.6853808 4,13.643274 4,13.6 Z"};"dimension"===t.coloring.fieldType&&(i=function(e){return e.datum.value>=0||-3===e.datum.value});var b="".concat(m,"Legend");return tm(!0,r,{type:"legend-cat",key:"".concat(o,"-cat"),scale:b in p?b:m,settings:{layout:{scrollOffset:function(){return l?l.get("legendScrollOffset"):void 0},size:-1!==["top","bottom"].indexOf(r.layout.dock)?2:1,direction:u?"rtl":"ltr",horizontal:20},item:{show:i,label:Pd({fill:h.label.color,fontSize:h.label.fontSize,fontFamily:h.label.fontFamily},y)},navigation:{disabled:n,button:{content:function(e,t){var n=t.direction;return 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:v[n]})])])}}}},brush:{consume:[{context:"selection",data:["",o],style:{inactive:{opacity:.3}}}]}},{settings:c,style:d})}(e,t,n):"continuous"===t.coloring.type&&function(e,t){var n,r=e.key,i=e.styleReference,o=e.styleOverrides,a=e.rtl,s=e.settings,l=e.style,u=t.scaleKey,c=t.theme,d="".concat(u,"Range"),m=Cf(e,t);if(!m.show)return!1;var f=Mf({theme:c,key:i,styleOverrides:o}),p=m.layout.dock,h="right"===p||"left"===p,g=null===(n=t.scales)||void 0===n?void 0:n[d];return h&&g&&(g.invert=!0),tm(!0,m,{type:"legend-seq",key:"".concat(r,"-seq"),settings:{fill:u,major:d,length:1,tick:{fill:f.label.color,fontSize:f.label.fontSize,fontFamily:f.label.fontFamily},title:{anchor:!a||"top"!==m.layout.dock&&"bottom"!==m.layout.dock?void 0:"right",padding:parseFloat(m.settings.title.fontSize)||16}}},{settings:s,style:l})}(e,t)}(e,t,n&&n.navigationDisabled);return r.push(o),o&&"legend-cat"===o.type&&(i.push(function(e){var t=e.key,n=e.requireFailure,r=e.recognizeWith,i=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).actions;return{key:"event:tap-".concat(t),type:"Tap",requireFailure:n,recognizeWith:r,options:{event:"legendtap",interval:10,pointers:1,enable:function(e,n){var r;if(!n)return!0;if(null!=i&&null!==(r=i.interact)&&void 0!==r&&r.enabled&&!i.interact.enabled())return!1;if(!this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).some((function(e){return e.key==="".concat(t,"-cat")})))return!1;var o=n.srcEvent.target;return!!(o&&o.hasAttribute("data-action")&&o.hasAttribute("data-component-key"))||!(!o||!o.childNodes[0]||"BUTTON"!==o.childNodes[0].nodeName)}},events:{legendtap:function(e){e.preventDefault();var t=e.srcEvent.target;t&&t.hasAttribute("data-action")&&t.hasAttribute("data-component-key")&&this.chart.component(t.getAttribute("data-component-key")).emit(t.getAttribute("data-action"))}}}}(e,n)),i.push(function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.eventName,r=t.key,i=t.requireFailure,o=t.recognizeWith,a=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).actions;return{key:"event:pan-".concat(r),type:"Pan",requireFailure:i,recognizeWith:o,options:{event:n,pointers:1,threshold:10,enable:function(e,t){var i;return this.started===n||!t||!(null!=a&&null!==(i=a.interact)&&void 0!==i&&i.enabled&&!a.interact.enabled())&&this.chart.componentsFromPoint({x:t.center.x,y:t.center.y}).some((function(e){return e.key==="".concat(r,"-cat")}))}},events:(e={},jd(e,"".concat(n,"start"),(function(e){e.preventDefault(),this.started!==n&&(this.started=n,this.chart.component("".concat(r,"-cat")).emit("panstart",e))})),jd(e,"".concat(n,"move"),(function(e){e.preventDefault(),this.chart.component("".concat(r,"-cat")).emit("panmove",e)})),jd(e,"".concat(n,"end"),(function(e){e.preventDefault(),this.chart.component("".concat(r,"-cat")).emit("panend",e),this.started=!1})),e)}}(e,n))),{interactions:i,components:r}}var wf=function(e){return"rgba(".concat([(16711680&e)>>16,(65280&e)>>8,255&e,((4278190080&e)>>>24)/255].join(","),")")};function Af(e){var t=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.auto,n=function(e){var t=Pd({hc:null,colorProps:null,layout:null,theme:null},e),n={},r={auto:function(){return{mode:"primary"}},getDimensionColorMap:function(){return Promise.reject()},getMeasure:function(){return Promise.reject()},getAttributeDimension:function(){return Promise.reject()}},i={auto:function(e){return e?(r.auto=e,i):r.auto},getDimensionColorMap:function(e){return e?(r.getDimensionColorMap=e,i):r.getDimensionColorMap},getAttributeDimension:function(e){return e?(r.getAttributeDimension=e,i):r.getAttributeDimension},getMeasure:function(e){return e?(r.getMeasure=e,i):r.getMeasure},set:function(e){var i;if(!e.colorProps)throw new Error('Missing "colorProps"');if(tm(t,e),(n={pic:t.picasso.data("q")({data:t.hc,config:{localeInfo:t.localeInfo}}),input:t.colorProps}).input.auto){var o=r.auto(e.layout);n.input=tm(!0,{},n.input,o,{auto:!1});var a=t.theme?t.theme.getDataColorPalettes():[];a[0]&&(n.input.dimensionScheme=a[0].key);var s=0;n.input.byDimDef&&+n.input.byDimDef.activeDimensionIndex>=0&&(s=+n.input.byDimDef.activeDimensionIndex),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)}null!==(i=n.input.measureOverrides)&&void 0!==i&&i.every((function(e){return!e||!e.on}))&&(n.input=tm(!1,{},n.input,{measureOverrides:null}))},palettes:function(){if(!n.palettes){var e=t.theme,r=[];(e&&e.getDataColorPickerPalettes()||[]).forEach((function(e){r.push({key:"ui",colors:e.colors})})),n.palettes=r}return n.palettes},getAuxiliaryData:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/qHyperCubeDef";if(!e.auxiliary&&!/qAttrDimInfo/.test(e.field))return Promise.resolve();var i=(e.auxiliary||{}).key;if("measure"===e.fieldType)return r.getMeasure(i,t).catch((function(){}));if("dimension"===e.fieldType){var o="".concat(n,"/").concat(e.field).replace("qDimensionInfo","qDimensions").replace("qAttrDimInfo","qAttributeDimensions");return Promise.all([/qAttrDimInfo/.test(e.field)?r.getAttributeDimension(o,t).catch((function(){})):Promise.resolve(),i?r.getDimensionColorMap(i,t).catch((function(){})):Promise.resolve()])}return Promise.resolve()},getAuxiliarySettings:function(e,r){var i=this;return e.auxiliary||/qAttrDimInfo/.test(e.field)?(this.palettes(),this.getAuxiliaryData(e,r).then((function(r){if(!r)return{};if("measure"===e.fieldType){if(r.coloring&&r.coloring.gradient){var o=n.pic.field(e.field);return of(i,r.coloring.gradient,e,o)}return{}}if("dimension"===e.fieldType){var a={nil:e.nil,others:e.others},s=r[0],l=r[1]?r[1].colorMap:null;if(s){var u=t.picasso.data("q")({data:{qDimensionInfo:[n.pic.field(e.field).raw(),n.pic.field(e.field).raw()],qMeasureInfo:[],qDataPages:s,qInterColumnSortOrder:[0,1],qMode:"S"}});a.legendDataset=u}return l?function(e,t,n,r){var i=r.external,o=r.field,a=Pd({},e);tm(a,nm(o,o.raw().qCardinal));var s=i.theme?i.theme.getDataColorPalettes()[0]:null;return t.nul&&(a.nil=n.resolveUIColor(t.nul)),t.oth&&(a.others=n.resolveUIColor(t.oth)),t.usePal?(a.palettes={categorical:t.pal},s&&!t.pal&&(a.palettes.categorical=s.key,tm(a,nm(o)))):!1===t.autoFill&&t.single?a.range=[n.resolveUIColor(t.single)]:t.autoFill&&(s&&(a.palettes={categorical:s.key}),tm(a,nm(o))),t.colors&&t.colors.length&&(a.explicit=function(e,t,n){for(var r={},i=0;i<e.length;i+=1)r[e[i].value]=e[i].baseColor;var o=[];return{domain:function(e){var i=e.data,a=[];o=[];for(var s=0;s<i.items.length;s++){var l=i.items[s],u=(l.text||l).label;r[u]&&-1===a.indexOf(l.value)&&(a.push(l.value),o.push(t.resolveUIColor(r[u])))}return a.push(-3,-2),o.push(n.others),o.push(n.nil),a},range:function(){return o}}}(t.colors,n,a)),a}(a,l,i,{external:t,field:n.pic.field(e.field)}):a}return{}}))):Promise.resolve()},resolveUIColor:function(e){if(e.index<0||void 0===e.index)return e.color;if(void 0===n.uiPalette&&(n.uiPalette=this.palettes().filter((function(e){return"ui"===e.key}))[0]||!1),!n.uiPalette)return e.color;var 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:function(){if(this.palettes(),!n.settings){var e={primary:"steelblue",others:"#aaa",nil:"#ddd"},r=t.theme;r&&(e=Pd(Pd({},e),r.getDataColorSpecials())),n.settings=tm(e,df(this,n,t,e))}return n.settings}};return i}(e.resources).auto(t||function(){return{mode:"byDimension",persistent:!1,useDimColVal:!0,byDimDef:{activeDimensionIndex:0,type:"expression",label:""}}}).getDimensionColorMap((function(e,t){var n=t.layout,r=t.app;return pf(e,{layout:n,app:r})})).getMeasure((function(e,t){var n=t.layout,r=t.app;return hf(e,{layout:n,app:r})})).getAttributeDimension((function(e,t){var n=t.layout,r=t.model,i=t.app;return gf(e,{layout:n,model:r,app:i})}));return n.getSnapshotData=mf,n}({resources:e}),n={},r={},i=function(e){return r.settings||(e||console.warn("settings() called before auxiliarySettings()"),r.settings=t.settings()),r.settings},o={config:function(i){if(n=Pd({},i),r={},!n.key)throw new Error("Missing key");t.set(Pd(Pd({},e),n))},auto:function(e){return e?(t.auto(e),o):t.auto()},getAuxiliarySettings:function(e){return r.auxiliarySettings?Promise.resolve(r.auxiliarySettings):t.getAuxiliarySettings(i(!0),e).then((function(e){return r.auxiliarySettings=e||{},r.settings=Pd(Pd({},r.settings),r.auxiliarySettings),r.scales=void 0,r.color=void 0,r.auxiliarySettings}))},getAuxiliaryData:function(){return t.getAuxiliaryData(i())},getSnapshotData:function(e){var n=i();return t.getAuxiliaryData(n,e).then((function(e){return t.getSnapshotData(n,e)}))},resolveUIColor:function(e){return t.resolveUIColor(e)},settings:function(){var e=i();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:function(e){var t;return(null===(t=i().measureOverrides)||void 0===t?void 0:t[e])||this.settings()},isSelectionLocked:function(e){var t=e.isMeasureSelectionLocked;return function(e,t){var n=t.isMeasureSelectionLocked;return"field"!==e.mode||("dimension"===e.fieldType?e.isFieldLocked:"measure"!==e.fieldType||n)}(i(),{isMeasureSelectionLocked:t})},palettes:function(){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.colorProps,n=e.coloring,r=e.theme,i=[];if(n&&n.palettes&&r){var o=n.palettes.categorical||t.dimensionScheme,a=r.getDataColorPalettes().filter((function(e){return e.key===o}))[0]||r.getDataColorPalettes()[0];o&&a&&i.push({key:"categorical",colors:a.colors});var s=n.palettes.metric||t.measureScheme,l=r.getDataColorScales().filter((function(e){return e.key===s}))[0];if(l){var u=l.colors[0]?l.colors:[[]].concat(Bd(l.colors.slice(1)));u=Array.isArray(u[0])?u.map((function(e){return e.slice().reverse()})):u.slice().reverse(),i.push({key:"quant",colors:u})}}return i}({coloring:i(),colorProps:n.colorProps,theme:n.theme})},scales:function(){return r.scales=r.scales||function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.hc,n=e.coloring,r=e.rtl,i=e.key,o=e.source,a=e.picasso,s={},l=i;if(n){var u={override:!0,domain:n.explicit&&"function"==typeof n.explicit.domain?n.explicit.domain:[].concat(Bd((n.explicit||{}).domain||[]),[-3,-2]),range:n.explicit&&"function"==typeof n.explicit.range?n.explicit.range:[].concat(Bd((n.explicit||{}).range||[]),[n.others,n.nil])};if("field"===n.mode){if("dimension"===n.fieldType){var c,d=function(e){var t=e.hc,n=e.source,r=e.coloring,i={data:{extract:[{source:"dummy",field:0,filter:function(){return i.expando=t.qDataPages[0]?t.qDataPages[0].qArea.qTop:0,!1}},{source:n,field:r.field,trackBy:r.valueAccessor,reduce:"first",props:{row:{reduce:function(){return i.expando++}},text:{value:function(e){return e.qText},reduce:"first"}}}]},expando:0};return i}({hc:t,source:o,coloring:n}).data;if(n.legendDataset){var m=0,f={};a.data("q")({data:t}).extract({field:n.field,trackBy:n.valueAccessor,reduce:function(e){var t=e[0];return f[t]=m++,e[0]}}),c={source:"attrDim",extract:{field:"qDimensionInfo/0",filter:function(e){return e.qElemNumber>=0},props:{row:{value:function(e){return f[e.qElemNumber]}}}}}}var p={data:d,range:n.range,domain:n.domain,explicit:u,type:"categorical-color",label:function(e){return e.datum.text&&e.datum.text.value?e.datum.text.value:e.datum.label}};s[l]=p,c&&(s["".concat(l,"Legend")]=Pd(Pd({},p),{},{data:c})),t&&t.qHasOtherValues&&c&&((c||p.data).amend=[{label:t.qDimensionInfo[0].othersLabel,source:{key:"qHyperCube",field:"qDimensionInfo/0"},row:{value:-3},value:-3}])}else if("measure"===n.fieldType){var h={data:{field:n.field},min:n.min,max:n.max};s[l]=tm({},h,{type:"categorical"===n.type?"threshold-color":"sequential-color",range:n.range,domain:n.domain,invert:n.reverse}),"sequential-color"===s[l].type&&(s["".concat(l,"Range")]=tm({},h,{invert:!!r}))}else if("color"!==n.type)throw new Error("UNUSED FIELD")}else if("dimension"===n.mode){var g={data:t.qDimensionInfo.map((function(e,t){return t})),label:function(e){return t.qDimensionInfo[e.datum.value].qFallbackTitle},explicit:u,type:"categorical-color"};s[l]=g}else if("measure"===n.mode){var y={data:t.qMeasureInfo.map((function(e,t){return t})).filter((function(e){var t;return!(null!==(t=n.explicit)&&void 0!==t&&null!==(t=t.exclude)&&void 0!==t&&t.includes(e))})),label:function(e){return t.qMeasureInfo[e.datum.value].qFallbackTitle},explicit:u,type:"categorical-color"};s[l]=y}}return s}({hc:n.hc,coloring:i(),key:n.key,source:n.source,picasso:e.picasso}),r.scales},color:function(){return r.color=r.color||function(e){var t=e.coloring,n=e.scales,r=e.key,i=yf(r),o=yf("".concat(r,"IsAnOther")),a=function(e,t){var r=e.fieldType,a=e.invalid,s=e.mode,l=e.nil,u=e.others,c=e.primary,d=e.type;return a?function(e){return bf(e)||o(e)?u:l}:n[t]?function(e){return bf(e)?u:vf(e)||-2===i(e)&&"dimension"===r||"NaN"===i(e)?l:o(e)?u:e.resources.scale(t)(i(e))||u}:"constant"===s?function(e){return bf(e)||o(e)?u:vf(e)?l:c}:"color"===d?function(e){return bf(e)||o(e)?u:vf(e)?l:i(e)||u}:null},s=a(t,r);if(t.measureOverrides){var l=yf("".concat(r,"MeasureIdx")),u=t.measureOverrides.map((function(e){return e&&a(e)}));return function(e){var t=l(e);return u[t]?u[t](e):s(e)}}return s}({coloring:i(),scales:this.scales(),key:n.key}),r.color},datumProps:function(e){return function(e){var t,n,r=e.hc,i=e.coloring,o=e.scales,a=e.key,s=e.addMeasureIx,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,u=a,c=i.nil;"field"===i.mode&&i.field?t=i.field:o[a]&&"field"===i.mode&&(t=o[a].data.field||i.field),t?(n={field:t,reduce:"first"},"color"===i.type&&(n.value=function(e){return"NaN"!==e.qNum?wf(e.qNum):e.qText&&Cm(e.qText)?e.qText:c})):"dimension"===i.mode?n=void 0!==i.field?i.field:r.qDimensionInfo.length-1:"measure"===i.mode&&(n=l);var d=jd({},u,n);return r.qDimensionInfo.length>1&&(d["".concat(u,"IsAnOther")]={fields:r.qDimensionInfo.map((function(e,t){return{field:"qDimensionInfo/".concat(t)}})),value:function(e){return-1!==e.indexOf(-3)}}),s&&(d["".concat(u,"MeasureIdx")]=l),d}({coloring:this.settingsForMeasure(e),scales:this.scales(),key:n.key,hc:n.hc,addMeasureIx:i().measureOverrides},e)},data:function(){var e=i(),t={key:"dummy",data:[["field"],["a"]]};return e.legendDataset?[t,{type:"q",key:"attrDim",data:e.legendDataset.raw(),config:{localeInfo:n.localeInfo}}]:[t]},legend:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.eventName,r=e.key,o=e.viewState,a=e.chart,s=e.rtl,l=e.styleReference,u=void 0===l?"object.legend":l,c=e.styleOverrides,d=e.settings,m=void 0===d?{}:d,f=e.style,p=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return qf({eventName:t,key:r,rtl:s,viewState:o,chart:a,styleReference:u,styleOverrides:c,settings:m,style:void 0===f?{}:f},{legendProps:n.legendProps,scaleKey:n.key,coloring:i(),theme:n.theme,hc:n.hc,scales:this.scales()},p)}};return o}var Of=function(e){return e.baseColor||e.coloring&&e.coloring.baseColor};function Df(e){var t=e.qHyperCube,n=t.qDimensionInfo,r=t.qMeasureInfo,i=n.some(Of),o=r.some(Of),a=e.color.useBaseColors;return"measure"===a&&!o||"dimension"===a&&!i?"off":a}var Nf=function(e){return e.baseColor||e.coloring&&e.coloring.baseColor};function If(e){var t,n=e.qHyperCube.qDimensionInfo.some(Nf),r=e.qHyperCube.qMeasureInfo.some(Nf),i=n?"dimension":void 0;return{mode:"primary",useBaseColors:null!==(t=null!=i?i:r?"measure":void 0)&&void 0!==t?t:"off",paletteColor:null}}var Tf=function(){};function Lf(e){var t,n,r,i,o=e.picasso,a=e.model,s=e.app,l=e.translator,u=e.layoutService,c=void 0===u?void 0:u,d=e.createConfig,m=void 0===d?Tf:d,f=e.config,p=void 0===f?{}:f,h=e.custom,g=void 0===h?{}:h,y=p.localeInfo,v=p.key,b=p.theme,x=void 0===b?void 0:b,M=p.auto,S=void 0===M?void 0:M,E=p.definitionPath,C=null==c||null===(t=c.getLayout)||void 0===t?void 0:t.call(c),q={theme:x,key:v,localeInfo:y,layout:C,hc:null==c||null===(n=c.getHyperCube)||void 0===n?void 0:n.call(c),legendProps:null==c||null===(r=c.getLayoutValue)||void 0===r?void 0:r.call(c,"legend"),colorProps:Pd(Pd({},null==c||null===(i=c.getLayoutValue)||void 0===i?void 0:i.call(c,"color")),{},{useBaseColors:C?Df(C):void 0})},w=Af({picasso:o,model:a,app:s,translator:l,auto:S});!1!==S&&w.auto((function(e){return S?S({layout:e,defaultAuto:If}):If(e)}));var A=!1,O={getColor:function(){return w.color()},getPaletteColor:function(e){var t=e.index,n=e.color;return w.resolveUIColor({index:t,color:n})},getData:function(){return w.data()},getDatumProps:function(e){return w.datumProps(e)},getSnapshotData:function(){return w.getSnapshotData(E)},getSettingsForMeasure:function(e){return w.settingsForMeasure(e)},getSettings:function(){return w.settings()},getLegend:function(e,t){return w.legend(e,t)},getScales:function(){return w.scales()},getPalettes:function(){return w.palettes()},isSelectionLocked:function(e){var t=e.isMeasureSelectionLocked;return w.isSelectionLocked({isMeasureSelectionLocked:t})},isInitialized:function(){return A},custom:Pd({},g),initialize:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).createConfig,t=(void 0===e?m:e)({getUseBaseColors:Df}),n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Pd(Pd(Pd({},e),t),{},{colorProps:Pd(Pd({},e.colorProps),t.colorProps||{})})}(q,t);return w.config(n),w.getAuxiliarySettings(E).then((function(){A=!0}))}};return O}function kf(e){var t=e.chart,n=e.logicalSize;if(n)return n;var r=t?t.element.getBoundingClientRect():{};return{width:r.width,height:r.height}}var Rf=[{key:"FULL",size:{width:550,height:450}},{key:"MEDIUM",size:{width:400,height:220}},{key:"SMALL",size:{width:300,height:150}},{key:"XSMALL",size:{width:150,height:75}}];function Pf(e){var t=e.width,n=e.height,r=Rf.filter((function(e){return t>=e.size.width&&n>=e.size.height})).shift();return r?r.key:"SPARK"}var $f={left:"right",right:"left",top:"bottom",bottom:"top",near:"far",far:"near"};function Ff(e){var t=e.orientation,n=e.dock,r=e.btt,i=e.rtl,o="horizontal"===t?function(e){return"bottom"===e||"near"===e?"bottom":"top"}(n):function(e,t){var n="left"===e||"near"===e?"left":"right";return t?$f[n]:n}(n,i),a=function(e,t,n){return"vertical"===e?t?"bottom":"top":n?"right":"left"}(t,r,i);return{current:o,opposite:$f[o],start:a,end:$f[a]}}function zf(e){var t=e.chart,n=e.layoutService,r=e.config,i=void 0===r?{}:r,o=i.logicalSize,a=void 0!==o&&o,s=i.rtl,l=void 0!==s&&s,u={chart:{size:void 0,mode:void 0},x:{dock:void 0,opposite:void 0,size:void 0},y:{dock:void 0,opposite:void 0,size:void 0}},c={type:"x-y",config:Pd({},i),meta:u,update:function(e){u.chart.size={width:e.width,height:e.height},u.chart.mode=Pf(e);var t=Ff({orientation:"horizontal",dock:n.getLayoutValue("xAxis.dock"),btt:!1,rtl:l}),r=t.current,i=t.opposite;u.x.dock=r,u.x.opposite=i,u.x.size=e.width;var o=Ff({orientation:"vertical",dock:n.getLayoutValue("yAxis.dock"),btt:!0,rtl:l}),a=o.current,s=o.opposite;u.y.dock=a,u.y.opposite=s,u.y.size=e.height}};return c.update(kf({chart:t,logicalSize:a})),c}var _f="vertical",jf="horizontal";function Hf(e){var t=e.chart,n=e.layoutService,r=e.config,i=void 0===r?{}:r,o=e.typeConfig,a=void 0===o?{}:o,s=i.logicalSize,l=void 0!==s&&s,u=i.rtl,c=void 0!==u&&u,d=a.fallback===_f?_f:jf,m=!!a.invert,f=a.measureAxes||[{ref:"measureAxis",name:"minor"}],p={chart:{orientation:void 0,size:void 0,mode:void 0},major:{orientation:void 0,dock:void 0,opposite:void 0,size:void 0}},h={type:"major-minor",config:Pd({},i),meta:p,update:function(e){p.chart.orientation=n.getLayoutValue("orientation",d),p.chart.size={width:e.width,height:e.height},p.chart.mode=Pf(e),p.major.orientation=function(e){var t=e.chartOrientation,n=e.invert;return e.layoutService.meta.isContinuous?jf:n?t===_f?jf:_f:t}({layoutService:n,chartOrientation:p.chart.orientation,invert:m});var t=Ff({orientation:p.major.orientation,dock:n.getLayoutValue("dimensionAxis.dock"),btt:!1,rtl:c}),r=t.current,i=t.opposite;p.major.dock=r,p.major.opposite=i,p.major.size=p.major.orientation===_f?e.height:e.width,f.forEach((function(t){var r={};r.orientation=p.major.orientation===_f?jf:_f;var i=Ff({orientation:r.orientation,dock:n.getLayoutValue("".concat(t.ref,".dock")),btt:!0,rtl:c}),o=i.current,a=i.opposite,s=i.start,l=i.end;r.dock=o,r.opposite=a,r.start=s,r.end=l,r.size=r.orientation===_f?e.height:e.width,p[t.name]=r}))}};return h.update(kf({chart:t,logicalSize:l})),h}function Vf(e){var t=e.chart,n=e.layoutService,r=e.config,i=void 0===r?{}:r,o=e.typeConfig,a=void 0===o?{}:o;return("x-y"===a.type?zf:Hf)({chart:t,layoutService:n,config:i,typeConfig:a})}function Bf(e,t,n){if(void 0===e||void 0===t)return n;for(var r=t.split("."),i=e,o=0;o<r.length;++o){var a=r[o];if(void 0===i[a])return n;i=i[a]}return i}var Uf=["__proto__","constructor"];function Yf(e,t,n){if(void 0!==e&&void 0!==t){var r=t.split("."),i=r[r.length-1];if(!Uf.some((function(e){return r.includes(e)}))){for(var o=e,a=0;a<r.length-1;++a){var s=r[a];void 0===o[s]&&(o[s]=Number.isNaN(+r[a+1])?{}:[]),o=o[s]}void 0!==n?o[i]=n:delete o[i]}}}function Wf(){var e={};return{get:function(t){return e[t]},set:function(t,n){return e[t]=n,n},has:function(t){return t in e},remove:function(t){delete e[t]},empty:function(){e={}}}}function Gf(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50;return function(){for(var r=this,i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];clearTimeout(t),t=setTimeout((function(){return e.apply(r,o)}),n)}}var Xf={ERROR_CODES:[7005],DIMENSION:"qDimensionInfo",MEASURE:"qMeasureInfo"},Kf=function(e,t){return e[t].reduce((function(e,t,n){var r;return r=t,Xf.ERROR_CODES.some((function(e){var t;return e===(null===(t=r.qError)||void 0===t?void 0:t.qErrorCode)}))?e.filtered.push(n):e.reduced.push(t),e}),{reduced:[],filtered:[]})};function Jf(e){var t;return((null==e||null===(t=e.qHyperCube)||void 0===t?void 0:t.qDimensionInfo)||[]).map((function(e){var t,n=null===(t=e.qCardinalities)||void 0===t?void 0:t.qHypercubeCardinal;if(n)return n;var r=e.qStateCounts||{},i=r.qLocked,o=void 0===i?0:i,a=r.qOption,s=void 0===a?0:a,l=r.qSelected;return o+s+(void 0===l?0:l)}))}function Zf(e){switch(e.qHyperCube.qMode){case"S":return function(e){var t=e.qHyperCube.qSize;return{refs:{dataPages:"qHyperCube.qDataPages"},size:{x:t.qcx,y:t.qcy,dimensions:Jf(e)}}}(e);case"K":return function(e){var t=Jf(e);return{refs:{dataPages:"qHyperCube.qStackedDataPages"},size:{x:e.qHyperCube.qSize.qcx,y:t[0],dimensions:t}}}(e);case"T":return function(e){var t=Jf(e);return{refs:{dataPages:"qHyperCube.qTreeDataPages"},size:{x:e.qHyperCube.qSize.qcx,y:t[0],dimensions:t}}}(e);default:throw new Error("Mode not supported")}}function Qf(e){var t=e.originalArray,n=e.newArray,r=e.matchKey;return Array.isArray(t)&&t.length?(n.forEach((function(e){var n=-1;t.some((function(t,i){return t[r]&&t[r]===e[r]&&(n=i),n})),n>-1?t[n]=e:t.push(e)})),t):n}function ep(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function tp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ep(Object(n),!0).forEach((function(t){np(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ep(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function np(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var rp=Object.prototype.hasOwnProperty,ip=Object.prototype.toString,op=Object.defineProperty,ap=Object.getOwnPropertyDescriptor,sp=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===ip.call(e)},lp=function(e){if(!e||"[object Object]"!==ip.call(e))return!1;var t,n=rp.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&rp.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||rp.call(e,t)},up=function(e,t){op&&"__proto__"===t.name?op(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},cp=function(e,t){if("__proto__"===t){if(!rp.call(e,t))return;if(ap)return ap(e,t).value}return e[t]},dp=function e(){var t,n,r,i,o,a,s=arguments[0],l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l<u;++l)if(null!=(t=arguments[l]))for(n in t)r=cp(s,n),s!==(i=cp(t,n))&&(c&&i&&(lp(i)||(o=sp(i)))?(o?(o=!1,a=r&&sp(r)?r:[]):a=r&&lp(r)?r:{},up(s,{name:n,newValue:e(c,a,i)})):void 0!==i&&up(s,{name:n,newValue:i}));return s};function mp(e,t,n,r){if(!e)return-1;const i=n.cache,o=e.origin?e.origin():null;o&&(e=o);let a=i.fields.indexOf(e),s=-1,l=-1;if(-1===a)for(let t=0;t<i.wrappedFields.length;t++)if(l=i.wrappedFields[t].attrDims.map((e=>e.instance)).indexOf(e),s=i.wrappedFields[t].attrExps.map((e=>e.instance)).indexOf(e),-1!==l||-1!==s){a=t;break}if(Array.isArray(r)&&r.some(((e,t)=>e!==t))){const e=r.indexOf(a);-1!==e&&(a=e)}return a-=t.qArea.qLeft,a<0||a>=t.qArea.qWidth?-1:l>=0?e=>e[a].qAttrDims.qValues[l]:s>=0?e=>e[a].qAttrExps.qValues[s]:e=>e[a]}function fp(e,t,n){let{key:r}=n;const i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:r,field:e.field.key()}),i}function pp(e){let{cache:t,f:n,mainCell:r,p:i,prop:o,page:a,rowIdx:s,row:l,sourceKey:u,target:c,targetProp:d,columnOrder:m}=e,f=r;if(i.field&&i.field!==n){const e=mp(i.field,a,{cache:t},m);if(-1===e)return;f=dp({qRow:s},e(l))}c[d]=fp(i,f,{key:u})}function hp(e,t,n,r){const i=Array.isArray(e)?e:[e];let o=[];for(let e=0;e<i.length;e++)if(void 0!==i[e].field){const a=t.raw(),s=t.key(),l="object"==typeof i[e].field?i[e].field:t.field(i[e].field),{props:u,main:c}=r.normalizeConfig(i[e],t),d=Object.keys(u),m=!!i[e].trackBy,f=typeof i[e].trackBy,p={},h=[],g=[];for(let t=0;t<a.qDataPages.length;t++){const o=mp(l,a.qDataPages[t],{cache:n},a.qColumnOrder);if(-1!==o)for(let y=0;y<a.qDataPages[t].qMatrix.length;y++){const v=a.qDataPages[t].qArea.qTop+y,b=dp({qRow:v},o(a.qDataPages[t].qMatrix[y])),x=fp(c,b,{key:s});if(!c.filter||c.filter(b)){for(let e=0;e<d.length;e++){const r=u[d[e]];let i=r.fields||[r];r.fields&&(x[d[e]]=[]);for(let o=0;o<i.length;o++)pp({cache:n,f:l,mainCell:b,p:i[o],prop:d[e],props:u,page:a.qDataPages[t],rowIdx:v,row:a.qDataPages[t].qMatrix[y],sourceKey:s,target:r.fields?x[d[e]]:x,targetProp:r.fields?o:d[e],columnOrder:a.qColumnOrder});if(r.fields){const t=x[d[e]].map((e=>e.value)),n=x[d[e]].map((e=>e.label));x[d[e]]={value:"function"==typeof r.value?r.value(t):void 0!==r.value?r.value:t,label:"function"==typeof r.label?r.label(n):void 0!==r.label?String(r.label):String(x[d[e]].value)}}}m&&r.track({cfg:i[e],itemData:b,obj:x,target:h,tracker:p,trackType:f}),g.push(x)}}}const y=m?r.collect(h,{main:c,propsArr:d,props:u}):g;o=[...o,...y]}return o}function gp(e){var t=0,n=e.children,r=n&&n.length;if(r)for(;--r>=0;)t+=n[r].value;else t=1;e.value=t}function yp(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=bp)):void 0===t&&(t=vp);for(var n,r,i,o,a,s=new Sp(e),l=[s];n=l.pop();)if((i=t(n.data))&&(a=(i=Array.from(i)).length))for(n.children=i,o=a-1;o>=0;--o)l.push(r=i[o]=new Sp(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(Mp)}function vp(e){return e.children}function bp(e){return Array.isArray(e)?e[1]:null}function xp(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function Mp(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function Sp(e){this.data=e,this.depth=this.height=0,this.parent=null}function Ep(e){return null==e?null:function(e){if("function"!=typeof e)throw new Error;return e}(e)}Sp.prototype=yp.prototype={constructor:Sp,count:function(){return this.eachAfter(gp)},each:function(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this},eachAfter:function(e,t){for(var n,r,i,o=this,a=[o],s=[],l=-1;o=a.pop();)if(s.push(o),n=o.children)for(r=0,i=n.length;r<i;++r)a.push(n[r]);for(;o=s.pop();)e.call(t,o,++l,this);return this},eachBefore:function(e,t){for(var n,r,i=this,o=[i],a=-1;i=o.pop();)if(e.call(t,i,++a,this),n=i.children)for(r=n.length-1;r>=0;--r)o.push(n[r]);return this},find:function(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r},sum:function(e){return this.eachAfter((function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].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(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r},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 yp(this).eachBefore(xp)},[Symbol.iterator]:function*(){var e,t,n,r,i=this,o=[i];do{for(e=o.reverse(),o=[];i=e.pop();)if(yield i,t=i.children)for(n=0,r=t.length;n<r;++n)o.push(t[n])}while(o.length)}};var Cp={depth:-1},qp={},wp={};function Ap(e){return e.id}function Op(e){return e.parentId}function Dp(e){let t=e.length;if(t<2)return"";for(;--t>1&&!Np(e,t););return e.slice(0,t)}function Np(e,t){if("/"===e[t]){let n=0;for(;t>0&&"\\"===e[--t];)++n;if(0==(1&n))return!0}return!1}function Ip(e,t){"/"===e.charAt(0)&&(e=e.substring(1));const n=e.split("/");let r,i=t;for(let e=0;e<n.length;e++){if("*"===n[e]&&Array.isArray(i)){const t=[];r=n.slice(e+1).join("/");for(let e=0;e<i.length;e++){let n=Ip(r,i[e]);Array.isArray(n)?t.push(...n):t.push(n)}return t}if(!n[e]&&Array.isArray(i)){const t=new Array(i.length);r=n.slice(e+1).join("/");for(let e=0;e<i.length;e++)t[e]=Ip(r,i[e]);return t}n[e]in i&&(i=i[n[e]])}return i}function Tp(e,t,n){let r=[];if(!e||!e.length)return r;if(t<=0){const t=n>=0?[e[n]]:e;r=[...r,...t]}else for(let i=0;i<e.length;i++)e[i].children&&e[i].children.length&&(r=[...r,...Tp(e[i].children,t-1,n)]);return r}function Lp(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 r=Math.max(0,Math.min(100,t-e));return e=>Tp(e.children,r-1,n)}return!1}const kp=/^qDimensionInfo(?:\/(\d+))?/,Rp=/^\/?qMeasureInfo\/(\d+)/,Pp=/\/qAttrExprInfo\/(\d+)/,$p=/\/qAttrDimInfo\/(\d+)/;function Fp(e){return(e.qColumnOrder&&e.qColumnOrder.length?e.qColumnOrder:e.qDimensionInfo.map(((e,t)=>t))).filter((t=>t<e.qDimensionInfo.length))}function zp(e,t){let{cube:n}=t;if(!e)return-1;let r=e.origin&&e.origin()?e.origin().key():e.key(),i=!1,o=-1,a=-1,s=-1,l=-1,u=-1,c=-1,d=r;const m=n.qEffectiveInterColumnSortOrder,f=Fp(n);return kp.test(d)&&(i=!0,o=+kp.exec(d)[1],d=r.replace(kp,"")),Rp.test(d)&&("K"===n.qMode?u=+Rp.exec(d)[1]:m&&-1!==m.indexOf(-1)?(u=+Rp.exec(d)[1],c=0):c=+Rp.exec(d)[1],d=d.replace(Rp,"")),d&&($p.exec(d)?s=+$p.exec(d)[1]:Pp.exec(d)&&(a=+Pp.exec(d)[1])),l=i?"S"===n.qMode?f[o]:m?m.indexOf(o):o:m&&-1!==m.indexOf(-1)?m.indexOf(-1):n.qDimensionInfo.length-("K"===n.qMode?0:1),{fieldDepth:l+1,pseudoMeasureIndex:u,measureIdx:c,attrDimIdx:s,attrIdx:a}}function _p(e,t){let n,r,i=Lp(e.fieldDepth,t.fieldDepth,t.pseudoMeasureIndex);return n=t.measureIdx>=0?e=>e.data.qValues[t.measureIdx]:e=>e.data,t.attrDimIdx>=0?r=e=>{var n;return null==e||null===(n=e.qAttrDims)||void 0===n?void 0:n.qValues[t.attrDimIdx]}:t.attrIdx>=0&&(r=e=>{var n;return null==e||null===(n=e.qAttrExps)||void 0===n?void 0:n.qValues[t.attrIdx]}),{nodeFn:i,attrFn:r,valueFn:n}}function jp(e,t,n){let{key:r}=n;const i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:r,field:e.field.key()}),i}function Hp(e){let{propsArr:t,props:n,item:r,itemData:i,ret:o,sourceKey:a}=e;for(let e=0;e<t.length;e++){const s=n[t[e]],l=s.fields||[s];let u,c;s.fields&&(u=[],c=[]);for(let n=0;n<l.length;n++){const d=l[n];let m,f,p,h,g,y;if("primitive"===d.type?(p=d.value,y=String(d.value)):("function"==typeof d.value&&(m=e=>d.value(e,r)),"function"==typeof d.label&&(f=e=>d.label(e,r)),d.accessor?(h=d.accessor(r),Array.isArray(h)?(g=h.map(d.valueAccessor),d.attrAccessor&&(g=g.map(d.attrAccessor)),m&&(p=g.map(m),m=null),f&&(y=g.map(f),f=null),p=d.reduce?d.reduce(p):p,y=d.reduceLabel?d.reduceLabel(y,p):String(p)):(p=d.attrAccessor?d.attrAccessor(d.valueAccessor(h)):d.valueAccessor(h),y=p)):(p=i,y=i)),s.fields){const e=m?m(p):p;u.push(e),c.push(f&&null!=y?f(y):null!=y?y:String(e))}else{const n=m?m(p):p;o[t[e]]={value:n,label:f?f(y):null!=y?y:String(n)},d.field&&(o[t[e]].source={field:d.field.key(),key:a})}}u&&(o[t[e]]={value:"function"==typeof s.value?s.value(u,r):u,label:"function"==typeof s.label?s.label(c,r):c})}}const Vp=(e,t,n)=>{const r="K"===e.qMode?"/qStackedDataPages/*/qData":"/qTreeDataPages/*",i="K"===e.qMode?"qSubNodes":"qNodes",o=Ip(r,e);return o&&o[0]?(t.tree=yp(o[0],n.children||(e=>e[i])),t.tree):null};function Bp(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),r=e.fields(),i=e.fields().filter((e=>"dimension"===e.type())).map((e=>n.indexOf(r.indexOf(e)))),o=e.fields().filter((e=>"measure"===e.type())).map((e=>n.indexOf(r.indexOf(e)))),a={__root:{__id:"__root",qValues:[]}};for(let e=0;e<t.length;e++){const n=t[e];let r="__root",l=!1;for(let e=0;e<i.length;e++){var s;const t=n[i[e]],o="".concat(r,"__").concat(null!==(s=t.qElemNumber)&&void 0!==s?s:t.qElemNo);a[o]||(a[o]=tp({__id:o,__parent:r,qValues:[]},t),l=!0),r=o}if(l)for(let e=0;e<o.length;e++){const t=n[o[e]];a[r].qValues.push(t)}}const l=Object.keys(a).map((e=>a[e]));return function(){var e,t=Ap,n=Op;function r(r){var i,o,a,s,l,u,c,d,m=Array.from(r),f=t,p=n,h=new Map;if(null!=e){const t=m.map(((t,n)=>function(e){let t=(e=`${e}`).length;return Np(e,t-1)&&!Np(e,t-2)&&(e=e.slice(0,-1)),"/"===e[0]?e:`/${e}`}(e(t,n,r)))),n=t.map(Dp),i=new Set(t).add("");for(const e of n)i.has(e)||(i.add(e),t.push(e),n.push(Dp(e)),m.push(wp));f=(e,n)=>t[n],p=(e,t)=>n[t]}for(a=0,i=m.length;a<i;++a)o=m[a],u=m[a]=new Sp(o),null!=(c=f(o,a,r))&&(c+="")&&(d=u.id=c,h.set(d,h.has(d)?qp:u)),null!=(c=p(o,a,r))&&(c+="")&&(u.parent=c);for(a=0;a<i;++a)if(c=(u=m[a]).parent){if(!(l=h.get(c)))throw new Error("missing: "+c);if(l===qp)throw new Error("ambiguous: "+c);l.children?l.children.push(u):l.children=[u],u.parent=l}else{if(s)throw new Error("multiple roots");s=u}if(!s)throw new Error("no root");if(null!=e){for(;s.data===wp&&1===s.children.length;)s=s.children[0],--i;for(let e=m.length-1;e>=0&&(u=m[e]).data===wp;--e)u.data=null}if(s.parent=Cp,s.eachBefore((function(e){e.depth=e.parent.depth+1,--i})).eachBefore(Mp),s.parent=null,i>0)throw new Error("cycle");return s}return r.id=function(e){return arguments.length?(t=Ep(e),r):t},r.parentId=function(e){return arguments.length?(n=Ep(e),r):n},r.path=function(t){return arguments.length?(e=Ep(t),r):e},r}().id((e=>e.__id)).parentId((e=>e.__parent))(l)}const Up=e=>{let{propsArr:t,props:n,cube:r,cache:i,itemDepthObject:o,f:a}=e;for(let e=0;e<t.length;e++){const s=n[t[e]],l=s.fields?s.fields:[s];for(let e=0;e<l.length;e++){const t=l[e];if(t.field!==a){const e=_p(o,zp(t.field,{cube:r,cache:i}));t.accessor=e.nodeFn,t.valueAccessor=e.valueFn,t.attrAccessor=e.attrFn}}}};function Yp(){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,r=arguments.length>3?arguments[3]:void 0;const i=t.raw(),o=t.key(),a="S"===i.qMode?Bp(t):Vp(i,n,e);if(!a)return null;const s=a.height,l=[];for(let o=0;o<=s;o++){let a=null;if(o>0)if("S"===i.qMode){let e=Fp(i)[o-1];a=n.fields[e]}else{let e=i.qEffectiveInterColumnSortOrder[o-1];o>i.qEffectiveInterColumnSortOrder.length&&(e=i.qDimensionInfo.length),a=n.fields[e]}const{props:s,main:u}=r.normalizeConfig(tp(tp({},e),{},{field:a?a.key():void 0}),t),c=Object.keys(s);l[o]={propsArr:c,props:s,main:u};const d=a?zp(a,{cube:i,cache:n}):{fieldDepth:0};Up({propsArr:c,props:s,cube:i,cache:n,itemDepthObject:d,f:a})}const u=a.copy().descendants(),c=a.descendants();for(let e=0;e<c.length;e++){const t=l[c[e].depth].propsArr,n=l[c[e].depth].props,r=l[c[e].depth].main,i=u[e],a=i.data,s=jp(r,a,{key:o});Hp({propsArr:t,props:n,item:i,itemData:a,ret:s,sourceKey:o,isTree:!0}),c[e].data=s}return a}function Wp(e,t,n,r){const i=Array.isArray(e)?e:[e];let o=[];for(let a=0;a<i.length;a++)if(void 0!==i[a].field){const s=t.raw(),l=t.key();if(!Vp(s,n,e))continue;const u="object"==typeof i[a].field?i[a].field:t.field(i[a].field),{props:c,main:d}=r.normalizeConfig(i[a],t),m=Object.keys(c),f=zp(u,{cube:s,cache:n}),{nodeFn:p,attrFn:h,valueFn:g}=_p({fieldDepth:0},f);Up({propsArr:m,props:c,cube:s,cache:n,itemDepthObject:f,f:u});const y=!!i[a].trackBy,v=typeof i[a].trackBy,b={},x=[],M=p(n.tree),S=[];for(let e=0;e<M.length;e++){const t=M[e],n=h?h(g(t)):g(t);if(d.filter&&!d.filter(n))continue;const o=jp(d,n,{key:l});Hp({propsArr:m,props:c,item:t,itemData:n,ret:o,sourceKey:l}),y&&r.track({cfg:i[a],itemData:n,obj:o,target:x,tracker:b,trackType:v}),S.push(o)}const E=y?r.collect(x,{main:d,propsArr:m,props:c}):S;o=[...o,...E]}return o}var Gp,Xp,Kp=(Gp=function(e){
12
+ /*! javascript-number-formatter - v1.1.11 - http://mottie.github.com/javascript-number-formatter/ * © ecava */
13
+ e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,a,s,l,u,c,d,m=e.length,f=e.search(/[0-9\-\+#]/),p=f>0?e.substring(0,f):"",h=e.split("").reverse().join(""),g=h.search(/[0-9\-\+#]/),y=m-g,v=e.substring(y,y+1),b=y+("."===v||","===v?1:0),x=g>0?e.substring(b,m):"";if(n=(t="-"===(e=e.substring(f,b)).charAt(0)?-t:+t)<0?t=-t:0,i=(r=e.match(/[^\d\-\+#]/g))&&r[r.length-1]||".",o=r&&r[1]&&r[0]||",",e=e.split(i),t=+(t=t.toFixed(e[1]&&e[1].length))+"",s=e[1]&&e[1].lastIndexOf("0"),(!(u=t.split("."))[1]||u[1]&&u[1].length<=s)&&(t=(+t).toFixed(s+1)),c=e[0].split(o),e[0]=c.join(""),(a=e[0]&&e[0].indexOf("0"))>-1)for(;u[0].length<e[0].length-a;)u[0]="0"+u[0];else 0==+u[0]&&(u[0]="");if((t=t.split("."))[0]=u[0],l=c[1]&&c[c.length-1].length){for(h="",y=(d=t[0]).length%l,m=d.length,b=0;b<m;b++)h+=d.charAt(b),!((b-y+1)%l)&&b<m-l&&(h+=o);t[0]=h}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),p+(n?"-":"")+r+x}},Gp(Xp={exports:{}}),Xp.exports);function Jp(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}const Zp={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"},Qp=/%\)?$/,eh=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,th=/^\(oct\)/i,nh=/^\(dec\)/i,rh=/^\(hex\)/i,ih=/^\(bin\)/i,oh=/^\(rom\)/i,ah=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,sh=/#|0/g;function lh(e,t,n,r){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(".",r||".")}function uh(e,t,n){const r=Jp(e);return n?r:new RegExp(r||"",t)}function ch(e,t,n,r){let i,o,a,s,l,u,c,d,m,f=e.pattern;var p,h;r&&(e.abbreviate=!0),p=t,(h=n)&&(h=Jp(h)),p&&(p=Jp(p)),m=new RegExp("(?:[#0]+".concat(p,")?[#0]+(?:").concat(h,"[#0]+)?")),a=f.match(m),a=a?a[0]:"",s=a?f.substr(0,f.indexOf(a)):f,l=a?f.substring(f.indexOf(a)+a.length):"",a||(a=f?"#":"##########"),t&&t===n&&(i=a.split(n),o=i.pop(),a=i.join("")+n+o,t=""),u=t,t=/,/.test(n)?"¤":",",u&&(a=a.replace(uh(u,"g"),t)),c=n,n=".",c&&(a=a.replace(uh(c,"g"),n)),d=a.match(/#/g),d=d?d.length:0;const g=f.split(c);let y;g[1]&&(y=g[1].match(sh)),e.prefix=s||"",e.postfix=l||"",e.pattern=f,e.maxPrecision=y?y.length:2,e.percentage=Qp.test(f),e.numericPattern=a||"",e.numericRegex=new RegExp("".concat(uh(t,null,!0),"|").concat(uh(n,null,!0)),"g"),e.groupTemp=u,e.decTemp=c,e.t=t,e.d=n,e.temp=d}class dh{constructor(e,t,n,r,i){this.localeInfo=e,this.pattern=t,this.thousandDelimiter=n||",",this.decimalDelimiter=r||".",this.type=i||"numeric",this.patternSeparator=";",this.abbreviations=function(e,t){if(!e||!e.qNumericalAbbreviation)return Zp;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 dh(this.localeInfo,this.pattern,this.thousandDelimiter,this.decimalDelimiter,this.type);return e.subtype=this.subtype,e}format(e,t,n,r){return this.prepare(t,n,r),this.formatValue(e)}prepare(e,t,n){let r;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:""}},r=this._prepared,e=e.split(this.patternSeparator),r.positive.pattern=e[0],r.negative.pattern=e[1],r.zero.pattern=e[2],ah.test(e[0])&&(r.positive.isFunctional=!0),e[1]?ah.test(e[1])&&(r.negative.isFunctional=!0):r.negative=!1,e[2]?ah.test(e[2])&&(r.zero.isFunctional=!0):r.zero=!1;const i="U"===this.type;r.positive.isFunctional||ch(r.positive,t,n,i),r.negative&&!r.negative.isFunctional&&ch(r.negative,t,n,i),r.zero&&!r.zero.isFunctional&&ch(r.zero,t,n,i)}formatValue(e){let t,n,r,i,o,a,s,l,u,c=this._prepared,d="",m="",f=e;if(isNaN(e))return"".concat(f);if(e=+e,!1===c.pattern)return e.toString();if(0===e&&c.zero)return c=c.zero,c.pattern;if(e<0&&c.negative?(c=c.negative,e=-e):c=c.positive,o=c.d,a=c.t,c.isFunctional)e=function(e,t,n){let r;return eh.test(t)?e=lh(e,Number(/\d{2}/.exec(t)[0]),t,n):th.test(t)?e=lh(e,8,t,n):nh.test(t)?e=lh(e,10,t,n):rh.test(t)?e=lh(e,16,t,n):ih.test(t)?e=lh(e,2,t,n):oh.test(t)&&(r="",e<0&&(r="-",e=-e),0===(e=Math.floor(e))?e="0":e<=5e5?(e=function(e,t){let n,r="",i=Number(String(e).slice(-3)),o=(e-i)/1e3,a=[0,1,4,5,9,10,40,50,90,100,400,500,900].reverse(),s=["0","I","IV","V","IX","X","XL","L","XC","C","CD","D","CM"].reverse();for(;i>0;)for(n=0;n<a.length;n++)if(a[n]<=i){r+=s[n],i-=a[n];break}for(n=0;n<o;n++)r="M".concat(r);return t[1]!==t[1].toUpperCase()&&(r=r.toLowerCase()),r}(e,t),e=r+e):e=t+r+e.toExponential(0)),e}(e,c.pattern,o);else{if(c.percentage&&(e*=100),c.abbreviate){const t=Object.keys(this.abbreviations).map((e=>parseInt(e,10))).sort(((e,t)=>e-t));let r,i,o=t[0];for(s=0,n=Number(Number(e).toExponential().split("e")[1]);o<=n&&s<t.length;)s++,o=t[s];s>0&&(r=t[s-1]),r&&n>0&&r>0?i=r:(n<0&&r<0||!r)&&(o<0&&o-n<=c.maxPrecision?i=o:r<=n&&!(o>0&&-n<=c.maxPrecision)&&(i=r)),i&&(d=this.abbreviations[i],e/=10**i)}if(r=Math.abs(e),t=c.temp,l=c.numericPattern,u=l.split(o)[1],"I"===this.type&&(e=Math.round(e)),i=e,u||"#"!==l.slice(-1)[0])if(r>=1e15||r>0&&r<=1e-14)e=r?r.toExponential(15).replace(/\.?0+(?=e)/,""):"0";else{const t=Number(e.toFixed(Math.min(20,u?u.length:0)).split(".")[0]);let n=l.split(o)[0];if(n+=o,e=Kp(n,t)||"0",u){const t=Math.max(0,Math.min(14,u.length)),n=u.replace(/#+$/,"").length;let i=("I"===this.type?0:r%1+1e-15).toFixed(t).slice(2).replace(/0+$/,"");for(s=i.length;s<n;s++)i+="0";i&&(e+=o+i)}else 0===t&&(i=0)}else if(r>=10**t||r<1||r<1e-4)0===e?e="0":r<1e-4||r>=1e20?(e=(e=i.toExponential(Math.max(1,Math.min(14,t))-1)).replace(/\.?0+(?=e)/,""),m=""):(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(r)/Math.log(10)))),s=0;s<t;s++)l+="#";e=Kp(l,e)}e=e.replace(c.numericRegex,(e=>e===a?c.groupTemp:e===o?c.decTemp:"")),i<0&&!/^-/.test(e)&&(e="-".concat(e))}return c.prefix+e+m+d+c.postfix}static getStaticFormatter(){return{prepare(){},formatValue:e=>"".concat(e)}}}function mh(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{size:n=5e3,multipleArguments:r=!1,toKey:i=(e=>e)}=t;let o,a,s=Object.create(null),l=Object.create(null),u=0,c=0;return o=r?function(){return a=i(...arguments),o.has(a)?o.get(a):o.set(a,e(...arguments))}:t=>(a=i(t),o.has(a)?o.get(a):o.set(a,e(t))),o.set=(e,t)=>(u>=n&&(delete s[l[c]],delete l[c],u--,c++),s[e]=t,l[u]=e,u++,t),o.get=e=>s[e],o.has=e=>e in s,o.clear=()=>{s=Object.create(null),l=Object.create(null),u=0,c=0},o.size=()=>u,o}function fh(e,t,n,r,i){const o=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new dh(...t)}(i,e,t,n,r),a=mh(o.formatValue.bind(o),{toKey:e=>isNaN(e)?e:+e});function s(e){return a(e)}return s.format=function(e,t,n,r){return a.clear(),o.format(t,e,n,r)},s.pattern=function(e){return e&&(a.clear(),o.pattern=e,o.prepare()),o.pattern},s}const ph="IV",hh=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],gh=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],yh=["January","February","March","April","May","June","July","August","September","October","November","December"],vh=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function bh(e,t){for(let n=e.length;n<t;n++)e="0".concat(e);return e}function xh(e){let t=e.toString().split(".");return t[1]?(t=Number("0.".concat(t[1])),t):0}class Mh{constructor(e,t,n){const r=e||{};r.qCalendarStrings||(r.qCalendarStrings={qLongDayNames:hh,qDayNames:gh,qLongMonthNames:yh,qMonthNames:vh}),this.localeInfo=r,this.locale_days=r.qCalendarStrings.qLongDayNames.slice(),this.locale_days_abbr=r.qCalendarStrings.qDayNames.slice(),this.locale_months=r.qCalendarStrings.qLongMonthNames.slice(),this.locale_months_abbr=r.qCalendarStrings.qMonthNames.slice(),t||(t={T:r.qTimeFmt||"hh:mm:ss",D:r.qDateFmt||"YYYY-MM-DD",TS:r.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"}[n]),this.pattern=t}clone(){const e=new Mh(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 r;e instanceof Date?r=function(e,t){let n=e.getUTCHours(),r=e.getUTCDay()-1;return t&&(n%=12,n||(n=12)),r<0&&(r=6),{year:e.getUTCFullYear(),month:e.getUTCMonth(),day:r,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)),r=function(e,t){let n,r=function(e){const t=e,n=24*xh(t),r=60*xh(n),i=60*xh(r),o=1e3*xh(i);return{d:Math.floor(t),h:Math.floor(n),m:Math.floor(r),s:Math.floor(i),f:Math.round(o)}}(e),i=r.d,o=r.h,a=r.m,s=r.s,l=r.f,u=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*i),/h+/gi.test(t)||(a+=60*o),/m+/gi.test(t)||(s+=60*a),/w+/gi.test(t)&&(u=n?n.getDay()-1:0,u<0&&(u=6));let c="";return n&&(c=n.getUTCHours()>=12?"pm":"am"),{year:0,month:0,day:u,date:i,h:o,m:a,s:s,f:l,t:c}}(e,t));const i=(o=this,a=r,{"Y+|y+":{Y:"".concat(Number("".concat(a.year).slice(-2))),YY:bh("".concat(a.year).slice(-2),2),YYY:bh("".concat(a.year).slice(-3),3),def:e=>bh("".concat(a.year),e.length)},"M+":{M:a.month+1,MM:bh("".concat(a.month+1),2),MMM:o.locale_months_abbr[a.month],def:o.locale_months[a.month]},"W+|w+":{W:a.day,WW:bh("".concat(a.day),2),WWW:o.locale_days_abbr[a.day],def:o.locale_days[a.day]},"D+|d+":{D:a.date,def:e=>bh("".concat(a.date),e.length)},"h+|H+":{h:a.h,def:e=>bh("".concat(a.h),e.length)},"m+":{m:a.m,def:e=>bh("".concat(a.m),e.length)},"s+|S+":{s:a.s,def:e=>bh("".concat(a.s),e.length)},"f+|F+":{def(e){let t="".concat(a.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=a.t;return e[0].toUpperCase()===e[0]&&(t=t.toUpperCase()),t=t.slice(0,e.length),t}}});var o,a;const s=[];for(const e in i)Object.prototype.hasOwnProperty.call(i,e)&&s.push(e);const l=new RegExp(s.join("|"),"g");return t.replace(l,(e=>{let t,n,r;for(n in i)if(Object.prototype.hasOwnProperty.call(i,n)&&(t=new RegExp(n),t.test(e)))break;if(!t)return"";for(const t in i[n])if(t===e||t.toLowerCase()===e){r=i[n][t],void 0===r&&(r=i[n][t.toLowerCase()]);break}return void 0===r&&(r=i[n].def),"function"==typeof r&&(r=r(e)),r}))}}function Sh(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Mh(...t)}function Eh(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"TS",n=Sh(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,e,t),r=mh(n.format.bind(n),{toKey:e=>"object"==typeof e&&"function"==typeof e.getTime?e.getTime():e});function i(e){return t!==ph?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=i(e),r(e)}return o.format=function(e,t){return r.clear(),t=i(t),n.format(t,e)},o.locale=function(i){return n=Sh(i,e,t),r=mh(n.format.bind(n),{toKey:e=>"object"==typeof e?e.getTime():e}),this},o.qtype=function(e){return void 0!==e&&(t=e,r.clear()),t},o}function Ch(){let e,{meta:t,id:n,key:r,localeInfo:i,fieldExtractor:o,value:a,type:s,sourceField:l}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const u=a||("dimension"===s?e=>null==e?void 0:e.qElemNo:e=>null==e?void 0:e.qValue),c="dimension"===s?"first":"avg",d=function(e,t){if(e&&e.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(e.qNumFormat.qType))return Eh(e.qNumFormat.qFmt,e.qNumFormat.qType,t);let n="#",r=t&&void 0!==t.qThousandSep?t.qThousandSep:",",i=t&&void 0!==t.qDecimalSep?t.qDecimalSep:".",o="U",a=e&&!!e.qIsAutoFormat;return e&&e.qNumFormat?(n=e.qNumFormat.qFmt||n,r=e.qNumFormat.qThou||r,i=e.qNumFormat.qDec||i,o=e.qNumFormat.qType||o,a=a&&-1===["M"].indexOf(e.qNumFormat.qType)):a=!0,(a||"U"===o)&&(n="#".concat(i,"##"),o="U"),fh(n,r,i,o,t)}(t,i),m="dimension"===s?"first":(e,t)=>d(t),f={id:()=>n,key:()=>r,raw:()=>t,title:()=>t.qFallbackTitle||t.label,type:()=>s,origin:()=>l,items:()=>(e||(e=o(f)),e),min:()=>t.qMin,max:()=>t.qMax,value:u,label:e=>(null==e?void 0:e.qText)||"",reduce:c,reduceLabel:m,formatter:()=>d,tags:()=>t.qTags};return f}function qh(e,t,n,r,i){return(t[e]||[]).map(((t,o)=>{const a="".concat(r?"".concat(r,"/"):"").concat(e,"/").concat(o),s={instance:Ch(dp({id:"".concat(n?"".concat(n,"/"):"").concat(a),key:a,meta:t},i))};return s.attrDims=qh("qAttrDimInfo",t,n,a,dp({},i,{value:e=>null==e?void 0:e.qElemNo,type:"dimension"})),s.attrExps=qh("qAttrExprInfo",t,n,a,dp({},i,{value:e=>null==e?void 0:e.qNum,type:"measure"})),s.measures=qh("qMeasureInfo",t,n,a,dp({},i,{value:e=>null==e?void 0:e.qValue,type:"measure"})),s}))}function wh(){let{key:e,data:t,config:n={}}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r={fields:[],wrappedFields:[],allFields:[],virtualFields:[]},i=t;if(!i)throw new Error('Missing "data" input');if(!i.qDimensionInfo)throw new Error('The "data" input is not recognized as a hypercube');const o=wh.util,a={cache:r,cube:i,localeInfo:n.localeInfo,fieldExtractor:null,pages:null,hierarchy:()=>null,virtualFields:n.virtualFields},s={key:()=>e,raw:()=>i,field:e=>function(e,t){let{cache:n}=t;if("number"==typeof e)return n.fields[e];const r=n.allFields;if("function"==typeof e){for(let t=0;t<r.length;t++)if(e(r[t]))return r[t];return!1}if("string"==typeof e){for(let t=0;t<r.length;t++)if(r[t].key()===e||r[t].title()===e)return r[t]}else if(e&&-1!==r.indexOf(e))return e;throw Error("Field not found: ".concat(e))}(e,a),fields:()=>r.fields.slice(),extract:e=>a.extractor(e,s,r,o),hierarchy:e=>a.hierarchy(e,s,r,o),_cache:()=>r};"K"===i.qMode||"T"===i.qMode||!i.qMode&&i.qNodesOnDim?(a.extractor=Wp,a.hierarchy=Yp,a.pages="K"===i.qMode?i.qStackedDataPages:i.qTreeDataPages):"S"===i.qMode?(a.extractor=hp,a.pages=i.qDataPages,a.hierarchy=Yp):a.extractor=()=>[],a.fieldExtractor=e=>a.extractor({field:e},s,r,o);const l="S"===i.qMode?e=>e.qElemNumber:void 0,u="S"===i.qMode?e=>e.qNum:void 0;r.wrappedFields.push(...qh("qDimensionInfo",i,e,"",dp({},a,{value:l,type:"dimension"}))),r.wrappedFields.push(...qh("qMeasureInfo",i,e,"",dp({},a,{value:u,type:"measure"}))),r.fields=r.wrappedFields.map((e=>e.instance));const c=e=>{e.forEach((e=>{r.allFields.push(e.instance),c(e.measures),c(e.attrDims),c(e.attrExps)}))};return c(r.wrappedFields),(n.virtualFields||[]).forEach((t=>{const n=s.field(t.from),i=Ch(tp({meta:n.raw(),id:"".concat(e,"/").concat(t.key),sourceField:n,fieldExtractor:e=>a.extractor({field:e},s,r,o),key:t.key,type:n.type(),localeInfo:a.localeInfo,value:n.value},t.override||{}));r.virtualFields.push(i)})),r.allFields.push(...r.virtualFields),s}const Ah=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],Oh=/\/qDimensionInfo(?:\/(\d+))?/,Dh=/\/qMeasureInfo\/(\d+)/,Nh=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,Ih=/\/qAttrExprInfo\/(\d+)/,Th=/\/?qHyperCube/,Lh=/\/?qTreeData/,kh=e=>"".concat(e.substr(0,e.indexOf("/qHyperCubeDef")+14)),Rh=e=>"".concat(e.substr(0,e.indexOf("/qTreeDataDef")+13));function Ph(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const r=t.byCells,i=t.primarySource,o=[],a={},s=e.isActive();let l=!1;return e.brushes().forEach((e=>{const t=function(e,t){let n=e,r=-1,i=-1,o="",a=e=>e;Th.test(e)?(o="".concat(n.substr(0,n.indexOf("qHyperCube")+10)),a=kh):Lh.test(e)&&(o="".concat(n.substr(0,n.indexOf("qTreeData")+9)),a=Rh);let s=!0;if(Oh.test(e)&&(r=+Oh.exec(e)[1]),Dh.test(e)&&(i=+Dh.exec(e)[1]),Nh.test(e)){i=-1,r=0;const e=+Nh.exec(n)[2];isNaN(e)||(r=e,n=n.replace(/\/\d+$/,"")),s=!1}if(Ih.test(e)){const e=i;if(t){i=0;const a=Ip(o,t);i+=(a.qMeasureInfo||[]).length,r>-1?(i=a.qDimensionInfo.slice(0,r).reduce(((e,t)=>e+t.qAttrExprInfo.length),i),r=-1):(i=a.qDimensionInfo.reduce(((e,t)=>e+t.qAttrExprInfo.length),i),i=a.qMeasureInfo.slice(0,e).reduce(((e,t)=>e+t.qAttrExprInfo.length),i)),i+=+Ih.exec(n)[1]}else r>-1?(r=-1,i=+Ih.exec(n)[1]):i+=+Ih.exec(n)[1]+1}return Ah.forEach((e=>{let[t,r]=e;n=n.replace(t,r)})),s&&(n=a(n)),n&&"/"!==n[0]&&(n="/".concat(n)),{measureIdx:i,dimensionIdx:r,path:n}}(e.id,n);if("range"===e.type&&t.measureIdx>-1&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,a.multiRangeSelectTreeDataValues||(a.multiRangeSelectTreeDataValues={path:t.path,ranges:[]}),n.forEach((e=>a.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,a.rangeSelectHyperCubeValues||(a.rangeSelectHyperCubeValues={path:t.path,ranges:[]}),n.forEach((e=>a.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,a.selectHyperCubeContinuousRange||(a.selectHyperCubeContinuousRange={path:t.path,ranges:[]}),n.forEach((e=>a.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(r)if(n&&n.qHyperCube&&("P"===n.qHyperCube.qMode||"T"===n.qHyperCube.qMode||"K"===n.qHyperCube.qMode)){const r=n.qHyperCube,o=r.qNoOfLeftDims,s=r.qEffectiveInterColumnSortOrder.indexOf(t.dimensionIdx);if(a.selectPivotCells||(a.selectPivotCells={path:t.path,cells:[]}),e.id===i||!i){const n=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e)));(0===o||s>=o)&&o>-1?n.forEach((e=>{a.selectPivotCells.cells.push({qType:"T",qCol:e,qRow:s-o})})):n.forEach((e=>{a.selectPivotCells.cells.push({qType:"L",qCol:t.dimensionIdx,qRow:e})})),l=!!a.selectPivotCells.cells.length}}else a.selectHyperCubeCells||(a.selectHyperCubeCells={path:t.path,cols:[]}),a.selectHyperCubeCells.cols.push(t.dimensionIdx),e.id!==i&&(i||a.selectHyperCubeCells.values)||(a.selectHyperCubeCells.values=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e))),l=!!a.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&&s?[{method:"resetMadeSelections",params:[]}]:(a.rangeSelectHyperCubeValues&&o.push({method:"rangeSelectHyperCubeValues",params:[a.rangeSelectHyperCubeValues.path,a.rangeSelectHyperCubeValues.ranges,[],null===(u=t.orMode)||void 0===u||u]}),a.selectHyperCubeContinuousRange&&o.push({method:"selectHyperCubeContinuousRange",params:[a.selectHyperCubeContinuousRange.path,a.selectHyperCubeContinuousRange.ranges]}),a.selectHyperCubeCells&&o.push({method:"selectHyperCubeCells",params:[a.selectHyperCubeCells.path,a.selectHyperCubeCells.values,a.selectHyperCubeCells.cols]}),a.selectPivotCells&&o.push({method:"selectPivotCells",params:[a.selectPivotCells.path,a.selectPivotCells.cells]}),a.multiRangeSelectTreeDataValues&&o.push({method:"multiRangeSelectTreeDataValues",params:[a.multiRangeSelectTreeDataValues.path,a.multiRangeSelectTreeDataValues.ranges]}),o);var u}function $h(e){wh.util=e.data("matrix").util,e.data("q",wh),e.formatter("q-number",fh),e.formatter("q-time",Eh)}function Fh(e){var t=Bf(e.layout||{},e.path.split("/").join("."));if(!t)return!1;var n=t.qIsOneAndOnlyOne;return void 0!==n&&n}function zh(e){var t=e.brush,n=e.colorField,r=e.legendAlias,i=e.useLegendCube,o=void 0!==i&&i;!n||/qAttrDimInfo/.test(n)?(t.removeKeyAlias("attrDim/qDimensionInfo/0"),r&&t.removeKeyAlias(r),t.addKeyAlias("attrDim/qDimensionInfo/0","qHyperCube/".concat(n))):o&&t.addKeyAlias(r,"qHyperCube/".concat(n))}$h.qBrushHelper=Ph,$h.selections=Ph;var _h="Shift";function jh(e){var t=e.brush,n=e.getConfig;return{interceptor:function(e){var r=t.brushes(),i=n(),o=i.allowSimultaneous,a=i.layout,s=void 0===a?{}:a;r.forEach((function(n){var r,i,a;("range"===n.type||null!==(r=e[0])&&void 0!==r&&r.key&&(null===(i=e[0])||void 0===i?void 0:i.key)!==n.id&&0!==o.indexOf(null===(a=e[0])||void 0===a?void 0:a.key))&&t.clear([])}));var l=e.filter((function(e){return-2!==e.value}));if(l.length>1){var u=function(e){var t=e.layout,n=void 0===t?{}:t,r=e.values,i=void 0===r?[]:r;if(null==i||!i.length)return[];var o=Array.from(new Set(i.map((function(e){return e.key})))),a=[];return o.forEach((function(e){var t=Fh({layout:n,path:e}),r=i.filter((function(t){return t.key===e})),o=t?[r.pop()]:r;a.push.apply(a,Bd(o))})),a.filter(Boolean)}({layout:s,values:l});return u}return l},rangeInterceptor:function(e){var r=t.brushes(),i=n().allowSimultaneous;return r.filter((function(e){return"value"===e.type})).length?(t.clear([]),e):(r.forEach((function(n){var r=n.id===e[0].key||i.includes(n.id)&&i.includes(e[0].key);"range"!==n.type||r||t.clear([])})),e)}}}var Hh=function e(t,n){return n[t]?e(t+1,n):t},Vh=function(e,t){var n=t.reduce((function(e,t){return e[t]=!0,e}),{});return e.reduce((function(e,t,r){var i=Hh(r,n);return n[i]=!0,e[r]=i,e}),{})};function Bh(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.layout,n=e.filtered,r=void 0===n?{}:n,i=(null==t?void 0:t.qHyperCube)||{},o=i.qDimensionInfo,a=void 0===o?[]:o,s=i.qMeasureInfo,l=void 0===s?[]:s;return{dimensions:Vh(a,r.dimensions||[]),measures:Vh(l,r.measures||[])}}var Uh="selectHyperCubeValues",Yh="selectHyperCubeContinuousRange";function Wh(e){var t=e.selection,n=e.fieldMap,r=t.method,i=t.params;if(r===Uh){var o=n.dimensions[i[1]];void 0!==o&&(i[1]=o)}return r===Yh&&i[1].forEach((function(e){var t=n.dimensions[e.qDimIx];void 0!==t&&(e.qDimIx=t)})),t}var Gh=[],Xh=0,Kh=function(e){var t=Gh.filter((function(e){var t;return null===(t=e.selections)||void 0===t?void 0:t.isActive()}));t.length&&("Enter"===e.key?t.forEach((function(e){return e.selections.confirm()})):"Escape"!==e.key&&"Esc"!==e.key||t.forEach((function(e){return e.selections.cancel()})))},Jh=function(){document.addEventListener("keyup",Kh)},Zh=function(){document.removeEventListener("keyup",Kh)},Qh=function(e,t){Object.keys(t).forEach((function(n){e.on(n,t[n])}))},eg=function(e,t){Object.keys(t).forEach((function(n){e.removeListener(n,t[n])}))};function tg(e){var t=e.chart,n=e.document,r=e.selectionInfo,i=e.eventName,o=e.componentName,a=e.brushName,s=void 0===a?"selection":a,l=e.emit,u=void 0===l?"rangeClear":l,c=r.event===i,d=n.querySelector("[data-key='".concat(o,"-edge-0']"));if(c||!d)return!1;var m=t.component(o);return!!m&&(m.emit(u),"string"==typeof s&&t.brush(s).clear(),m)}var ng=["chart","document","selections","selectionInfo"],rg=function(e){e.chart,e.document,e.selections,e.selectionInfo;var t=Hd(e,ng);t.clearDiscrete(),t.clearContinuous(),t.clearMinor(),t.clearRange(),t.clearTap(),t.clearLegend()};function ig(e){var t,n=e.lasso;null!=n&&null!==(t=n.active)&&void 0!==t&&t.call(n)&&(null==n||n.action(!1))}function og(e){var t,n=e.chart,r=e.selectionInfo,i=e.selectionActions,o=e.actions,a=void 0===o?{}:o,s=e.selections,l=e.selectionEvents;if(!1===i||!1===l)return function(){};var u=i.reset,c=void 0===u?ig:u,d=i.clear,m=!1!==d&&function(e){var t=e.clear,n=void 0===t?rg:t,r=e.selections,i=e.selectionInfo,o=e.chart;return function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).cleared,t={selections:r,selectionInfo:i,chart:o,document:document,cleared:e};return n(Pd({clearDiscrete:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e){var t=e.selectionInfo,n=e.chart,r=e.document,i=e.eventName,o=void 0===i?"discreteRange":i,a=e.componentName,s=void 0===a?"discrete-range-brush":a,l=e.cleared;return tg({selectionInfo:t,chart:n,document:r,eventName:void 0!==l&&l?void 0:o,componentName:s,emit:"areaClear",brushName:e.brushName})}(Pd(Pd({},t),e))},clearContinuous:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e){var t=e.selectionInfo,n=e.chart,r=e.document,i=e.eventName,o=void 0===i?"continuousRange":i,a=e.componentName,s=void 0===a?"continuous-range-brush":a,l=e.cleared;return tg({selectionInfo:t,chart:n,document:r,eventName:void 0!==l&&l?void 0:o,componentName:s,brushName:e.brushName})}(Pd(Pd({},t),e))},clearMinor:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e){var t=e.selectionInfo,n=e.chart,r=e.document,i=e.componentName,o=void 0===i?"minor-range-brush":i,a=e.eventName,s=void 0===a?"minorRange":a,l=e.cleared,u=void 0!==l&&l,c=e.brushName,d=tg({selectionInfo:t,chart:n,document:r,eventName:u?void 0:s,componentName:o,brushName:void 0!==c&&c});if(d){var m=d.settings.settings,f=m.scale,p=m.brush,h=n.scale(f).data().fields.map((function(e){return e.id()})),g=n.brush(p),y=g.brushes().filter((function(e){return"range"===e.type&&h.some((function(t){return t===e.id}))}));g&&y.length&&y.forEach((function(e){g.removeRanges(e.brush.ranges().map((function(t){return{key:e.id,range:t}})))}))}}(Pd(Pd({},t),e))},clearRange:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e){var t=e.selectionInfo,n=e.chart,r=e.document,i=e.selections,o=e.eventName,a=void 0===o?"xAxis":o,s=e.cleared;tg({selectionInfo:t,chart:n,document:r,eventName:void 0!==s&&s?void 0:a,componentName:"".concat(a,"-range-brush"),emit:"areaClear",brushName:!1})&&i.clear()}(Pd(Pd({},t),e))},clearTap:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e){var t=e.chart,n=e.selectionInfo,r=e.selections,i=e.events,o=void 0===i?["tap"]:i,a=e.brushNames,s=void 0===a?[]:a;if(n&&o.includes(n.event)){var l=n.currentComponent;n.previousComponent!==l&&(r.clear(),s.forEach((function(e){return t.brush(e).end()})))}}(Pd(Pd({},t),e))},clearLegend:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e){var t=e.selectionInfo,n=e.chart,r=e.document,i=e.selections,o=e.eventName,a=void 0===o?"legendRange":o,s=e.componentName,l=void 0===s?"legend-range-brush":s,u=e.cleared,c=void 0!==u&&u,d=e.brushName;tg({selectionInfo:t,chart:n,document:r,eventName:c?void 0:a,componentName:l,brushName:void 0!==d&&d})&&i.clear()}(Pd(Pd({},t),e))}},t))}}({clear:d,selections:s,selectionInfo:r,chart:n}),f=function(e){var t=e.chart,n=e.actions,r=e.reset,i=e.clear,o=!1,a={deactivated:function(e){var t=(n||{}).lasso;r({e:e,lasso:void 0!==t&&t})},canceled:function(e){var o=(n||{}).lasso;r({e:e,lasso:void 0!==o&&o}),i({e:e,chart:t,document:document})},cleared:function(e){o||(o=!0,i({e:e,chart:t,document:document,cleared:!0}),o=!1)}};return!1===r&&delete a.deactivated,!1===i&&delete a.cleared,!1===r&&!1===i&&delete a.canceled,a}({chart:n,clear:m,reset:c,actions:a}),p={};Object.entries(f).forEach((function(e){var t=Vd(e,2),n=t[0],r=t[1];p[n]=function(e,t){return t?function(n){return t({event:n,defaultFunc:e})}:e}(r,l[n])}));var h=function(e){var t=e.selectionEvents,n=e.selections,r=e.selectionInfo,i=e.clear,o=e.chart,a=e.document,s=t.start,l={selections:n,selectionInfo:r,chart:o,document:a},u=function(e){return Object.assign(r,e||{})},c=function(e){var t=e.event,n=e.components;return function(){return function(e){var t=e.selectionInfo,n=e.clear,r=e.event,i=e.components,o=void 0===i?[]:i;(0,e.setSelectionInfo)(Pd(Pd({},void 0===t?{}:t),{},{event:r,components:o.map((function(e){return e.key})).filter(Boolean)})),n()}({event:t,components:n,clear:i,chart:o,selectionInfo:r,setSelectionInfo:u})}};return"function"==typeof s?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];s(Pd(Pd({defaultFunc:c({event:e,components:t}),setSelectionInfo:u,clear:i},l),{},{event:e,components:t}))}:function(e){c({event:e,components:arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]})()}}({selectionEvents:l,selections:s,selectionInfo:r,clear:m,chart:n,document:document});return null==a||null===(t=a.select)||void 0===t||t.on("start",h),Object.entries(p).forEach((function(e){var t=Vd(e,2),n=t[0],r=t[1];null==s||s.on(n,r)})),function(){var e;null==a||null===(e=a.select)||void 0===e||e.removeListener("start",h),Object.entries(p).forEach((function(e){var t=Vd(e,2),n=t[0],r=t[1];null==s||s.removeListener(n,r)}))}}var ag=[{key:"qHyperCube/qDimensionInfo/0:numeric",includeMax:!1}];function sg(e){var t=e.chart,n=e.actions,r=e.selections,i=e.picassoQ,o=e.config,a=o.allowSimultaneous,s=void 0!==a&&a,l=o.majorScale,u=void 0===l?void 0:l,c=o.selectionActions,d=void 0===c?{}:c,m=d.clear,f=d.reset,p=o.selectionEvents,h=void 0===p?{deactivated:void 0,canceled:void 0,cleared:void 0,start:void 0}:p,g=o.brushEvents,y=void 0===g?{}:g,v=o.brushName,b=void 0===v?"selection":v,x=o.brushMaxListeners,M=void 0===x?20:x,S=o.brushRanges,E=void 0!==S&&S,C=o.interceptors,q=void 0===C?{}:C,w=o.selectionsFn,A=void 0===w?i.selections:w,O=t.brush(b);if("number"==typeof M&&O.setMaxListeners(M),E){var D=!0===E?ag:E;O.configure({ranges:D})}var N={canSelect:!0,getIsSelectionLocked:!1,isInnerDimensionLocked:!1,lockedDimensions:[],singleSelectIndex:0,selectionInfo:{colorField:void 0,components:[],event:void 0,currentComponent:void 0,previousComponent:void 0}},I=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.selections,r=t.brush,i=t.majorScale,o=t.actions,a=t.selectionsFn,s=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).path,l=void 0===s?"/qHyperCubeDef":s;if(!n)return{layout:function(){},filteredFields:function(){},allowSimultaneous:function(){},release:function(){}};var u=++Xh,c=null,d={dimensions:[],measures:[]},m=[],f={};n.on=n.on.bind(n),n.isActive=n.isActive.bind(n),n.addListener=n.addListener.bind(n),n.removeListener=n.removeListener.bind(n);var p=jh({brush:r,getConfig:function(){return{layout:c,allowSimultaneous:m}}}),h=p.rangeInterceptor,g=p.interceptor;r.intercept("set-ranges",h),r.intercept("toggle-ranges",h),r.intercept("toggle-values",g),r.intercept("set-values",g),r.intercept("add-values",g),r.on("start",(function(){return n.begin(l)}));var y={activate:function(){},deactivated:function(){return r.end()},cleared:function(){return r.clear()},canceled:function(){return r.end()}};Qh(n,y);var v=null==i||null===(e=i.max)||void 0===e?void 0:e.call(i);return null!=o&&o.select?(o.select.on("start",(function(){var e;r.start(),"function"==typeof o.select.getBrushOptions&&(f=(e=o.select).getBrushOptions.apply(e,arguments))})),o.select.on("end",(function(){var e=a(r,f,c),t=Bh({layout:c,filtered:d});e.forEach((function(e){var r=Wh({selection:e,fieldMap:t});(function(e,t,n){if(t&&void 0!==n&&"selectHyperCubeContinuousRange"===e.method){var r=e.params;if(r&&r[1]&&r[1][0]){var i=r[1][0],o=i.qDimIx,a=i.qRange;"undefined"!==o&&a&&!1===a.qMaxInclEq&&a.qMax>=n&&(a.qMaxInclEq=!0)}}})(r,o.select.brushSelectionIncludeMax,v),n.select(r)}))}))):r.on("update",(function(){var e=a(r,f,c),t=Bh({layout:c,filtered:d});e.forEach((function(e){n.select(Wh({selection:e,fieldMap:t}))}))})),0===Gh.length&&Jh(),Gh.push({key:u,selections:n}),{layout:function(e){c=e},filteredFields:function(e){d=e},allowSimultaneous:function(e){m=e},release:function(){c=null;var e=Gh.indexOf(Gh.filter((function(e){return e.key===u}))[0]);-1!==e&&Gh.splice(e,1),Gh.length||Zh(),eg(n,y)}}}({brush:O,majorScale:u,actions:n,selections:r,picassoQ:i,selectionsFn:A});!function(e){var t=e.brush,n=e.interceptors,r=void 0===n?{}:n;Object.entries(r).forEach((function(e){var n=Vd(e,2),r=n[0],i=n[1];(Array.isArray(i)?i:[i]).forEach((function(e){t.intercept(r,e)}))}))}({brush:O,interceptors:q});var T=function(e){var t=e.chart,n=e.selectionActions,r=e.brush,i=e.actions,o=e.selectionInfo,a=e.selections,s=e.selectionEvents,l=function(e){var t=e.brush,n=e.chart,r=e.selectionInfo,i=e.brushEvents,o=void 0===i?{}:i,a=Object.entries(o).map((function(e){var i=Vd(e,2),o=i[0],a=i[1],s=function(){return a({chart:n,selectionInfo:r})};return t.on(o,s),[o,s]}));return function(){a.forEach((function(e){var n=Vd(e,2),r=n[0],i=n[1];t.removeListener(r,i)}))}}({brush:r,chart:t,selectionInfo:o,brushEvents:e.brushEvents}),u=og({chart:t,selectionInfo:o,selectionActions:n,actions:i,selections:a,selectionEvents:s}),c=function(e){var t=e.actions;if(null==t||!t.lasso)return function(){};var n=!1,r=function(e){n||e.key!==_h||(t.lasso.action(!0),n=!0)},i=function(e){e.key===_h&&(t.lasso.action(!1),n=!1)};return document.addEventListener("keydown",r),document.addEventListener("keyup",i),function(){document.removeEventListener("keydown",r),document.removeEventListener("keyup",i)}}({actions:i});return function(){l(),u(),c()}}({chart:t,brush:O,actions:n,selections:r,selectionInfo:N.selectionInfo,selectionActions:{clear:m,reset:f},selectionEvents:h,brushEvents:y});if(s){var L=!0===s?Bd(Array(15)).map((function(e,t){return"qHyperCube/qMeasureInfo/".concat(t)})):s;I.allowSimultaneous(L)}return{unbindEvents:T,state:N,picassoSelections:I,brush:O}}var lg=["colorField","useLegendCube"];function ug(e){var t=e.chart,n=e.selections,r=e.actions,i=void 0!==r&&r,o=e.config,a=void 0===o?{}:o,s=sg({chart:t,actions:i,selections:n,picassoQ:$h,config:a}),l=s.unbindEvents,u=s.state,c=s.picassoSelections,d=s.brush,m=a.custom,f=void 0===m?{}:m,p=a.legendAlias,h=void 0===p?void 0:p,g=a.setBrushAliases,y=void 0===g?zh:g;return{getIsDimensionLocked:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return u.lockedDimensions[e]},getIsSelectionLocked:function(){var e,t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return null!==(e=null==n||null===(t=n.isLocked)||void 0===t?void 0:t.call(n))&&void 0!==e?e:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(null==e||!e.length)return!1;var t=e.filter((function(e){return"object"===Fd(e.data)&&Array.isArray(e.data.fields)})).every((function(e){return e.data.fields.every((function(e){var t=e.raw();return!(!t.qLocked&&t.qCardinal)}))}));return t}(r)},getIsSingleSelect:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u.singleSelectIndex;return u.singleSelectDimensions[e]},getCanSelect:function(){return u.canSelect},getSelectionInfo:function(){return u.selectionInfo},setLayout:function(e){var t=function(e){var t,n,r,i=e.selections,o=e.picassoSelections,a=e.layout,s={lockedDimensions:[],singleSelectDimensions:[]};null!=i&&null!==(t=i.isModal)&&void 0!==t&&t.call(i)&&i.confirm(),o.layout(a);var l=(null!==(n=null==a?void 0:a.qHyperCube)&&void 0!==n?n:{}).qDimensionInfo,u=void 0===l?[]:l;return s.lockedDimensions=u.map((function(e){return!!e.qLocked})),s.singleSelectDimensions=u.map((function(e,t){return Fh({layout:a,path:"qHyperCube/qDimensionInfo/".concat(t)})})),s.singleSelectIndex=function(e){var t,n=((null==e?void 0:e.qHyperCube)||{}).qDimensionInfo,r=void 0===n?[]:n;return null!==(t=r.map((function(e,t){var n;return!(e.qLocked||(null===(n=e.qCardinalities)||void 0===n?void 0:n.qHypercubeCardinal)<=1)&&t})).filter((function(e){return"number"==typeof e}))[0])&&void 0!==t?t:Math.max(r.length-1,0)}(a),s.canSelect=0===u.length||u.some((function(e){return!e.qLocked})),s.dimensionLocked=!(null===(r=u[0])||void 0===r||!r.qLocked),s}({selections:n,picassoSelections:c,layout:e});Object.assign(u,t)},setFilteredFields:function(e){c.filteredFields(e)},setBrushAliases:function(e){var t=e.colorField,n=e.useLegendCube,r=void 0!==n&&n,i=Hd(e,lg),o=Pd({useLegendCube:r,colorField:t,brush:d,legendAlias:h},i);y(Pd(Pd({},o),{},{defaultFunc:function(){return zh(o)}}))},destroy:function(){l(),c.release()},custom:Pd({},f)}}var cg="'Source Sans Pro', 'Arial', 'sans-serif'",dg="#333333",mg="#595959",fg="#737373",pg="#cccccc",hg="#e6e6e6";function gg(e){var t={};return[].concat(Bd(e),Bd([["","","color"],["object","","fontFamily"],["object","axis.label.name","color",mg],["object","axis.label.name","fontFamily",cg],["object","axis.label.name","fontSize","12px"],["object","axis.line.major","color",pg],["object","axis.line.minor","color",hg],["object","axis.title","color"],["object","axis.title","fontFamily",cg],["object","axis.title","fontSize","13px"],["object","grid.line.highContrast","color",hg],["object","grid.line.major","color",pg],["object","grid.line.minor","color",hg],["object","label.value","color",mg],["object","label.value","fontFamily",cg],["object","label.value","fontSize","12px"],[!1,"label.value","darkColor",mg],[!1,"label.value","lightColor",hg],["object","outOfRange","color","#999"],["object","legend.title","color",dg],["object","legend.title","fontFamily",cg],["object","legend.title","fontSize","15px"],["object","legend.label","color",mg],["object","legend.label","fontFamily",cg],["object","legend.label","fontSize","13px"],["object","referenceLine.label.name","color",dg],["object","referenceLine.label.name","fontFamily",cg],["object","referenceLine.label.name","fontSize","12px"],["object","referenceLine.outOfBounds","color",hg],["object","referenceLine.outOfBounds","fontFamily",cg],["object","referenceLine.outOfBounds","fontSize","12px"],["object","referenceLine.outOfBounds","backgroundColor",fg,function(e){return"transparent"===e?fg:e}]])).reduce((function(e,n){var r="".concat(n[0],"-").concat(n[1],"-").concat(n[2],"}");return t[r]||(t[r]=!0,e.push(n)),e}),[]).sort((function(e,t){return(e[0].split?e[0].split(".").length:0)-(t[0].split?t[0].split(".").length:0)}))}var yg=function(e){return e};function vg(e){var t=e.theme,n=e.id,r=e.transform,i=e.extend,o=e.matrix,a={},s=r.reduce((function(e,t){var n=Vd(t,2),r=n[0],i=n[1];return e[r]=i,e}),{});return o.forEach((function(e){var r=Vd(e,5),i=r[0],o=r[1],l=r[2],u=r[3],c=r[4],d=void 0===c?function(e){return e}:c,m=function(e){var t=e.theme,n=e.base,r=e.path,i=e.attribute,o=e.defaultValue,a=void 0===o?void 0:o;if(!t||!1===n)return a;var s=t.getStyle(n,r,i);return void 0===s?a:s}({theme:t,base:"object"===i&&n?"".concat("object",".").concat(n):i,path:o,attribute:l,defaultValue:u}),f=(s["".concat(o,".").concat(l)]||yg)(d(m));Yf(a,[o,l].filter(Boolean).join("."),f)})),i.forEach((function(e){var t=Vd(e,2),n=t[0],r=t[1];Yf(a,n,r)})),a}var bg={NOOP:function(){},FALSE:function(){return!1},ARRAY:function(){return[]},OBJECT:function(){return{}}},xg="chart-modules-tooltip",Mg="#".concat(xg);function Sg(){if(!document.querySelector(Mg)){var e=document.createElement("div");e.id=xg,e.style.overflow="hidden",e.style.position="fixed",e.style.pointerEvents="none",e.style.left="0px",e.style.top="0px",e.style.width="100%",e.style.height="100%",e.style.zIndex=1020,document.body.appendChild(e)}}function Eg(e){return{show:!0,key:e.key,type:"tooltip",layout:{displayOrder:3},beforeMount:function(){Sg()},beforeUpdate:function(){Sg()},destroyed:function(){var e;null!=(e=document.querySelector(Mg))&&e.parentElement&&e.childElementCount<1&&e.parentElement.removeChild(e)},settings:{appendTo:function(){return document.querySelector(Mg)},direction:e.rtl?"rtl":"ltr",duration:e.duration},style:{arrow:{color:"#404040"},content:{display:"table","border-spacing":"4px",background:"rgba(64, 64, 64, 0.9)",opacity:"1",fontSize:"13px",fontFamily:"'Source Sans Pro', 'Arial', 'sans-serif'","empty-cells":"show"},cell:{"max-width":"180px","word-break":"break-word","word-wrap":"break-word","overflow-wrap":"break-word",hyphens:"auto"}}}}var Cg="position",qg={bar:"rect",diamond:"path",point:"circle",square:"rect",triangle:"path","n-polygon":"path",slice:"path"},wg=function(e){return e.data.value},Ag=function(e){var t,n=e.data;return null==n||null===(t=n.major)||void 0===t?void 0:t.value};function Og(e){var t=e.chart,n=e.expando,r=e.nodes,i=e.collectConfig,o=e.collectibles,a=e.meta,s=i.from,l={chart:t,expando:n,nodes:r,collectConfig:i,collectibles:o,meta:a};switch("function"==typeof s?"custom":s){case"single":return function(e){var t=Vd(e.nodes,1)[0];return["container"===t.type&&t.children[0]||t]}(l);case"position":return function(e){var t=e.collectibles,n=e.meta;return e.chart.shapesAt(n.position.absolute,{components:t.map((function(e){return{key:e.key}}))})}(l);case"dimension":return function(e){var t=e.chart,n=e.collectConfig,r=e.collectibles,i=Vd(e.nodes,1)[0],o=n.filter,a="function"==typeof o?o:function(){return!0},s=n.by,l=void 0===s?wg:s;return r.reduce((function(e,n){var r=n.major,o=void 0===r?Ag:r,a=qg[n.type]||n.type;return e.push.apply(e,Bd(t.findShapes(a).filter((function(e){return e.key===n.key&&e.data&&o({data:e.data})===l({data:i.data})})))),e}),[]).filter(a)}(l);case"radius":return function(e){var t=e.chart,n=e.collectConfig,r=e.collectibles,i=e.meta,o=Vd(e.nodes,1)[0].localBounds,a=n.distance,s=n.filter,l="function"==typeof s?s:function(){return!0},u=r.map((function(e){return e.key}));return t.shapesAt({cx:i.position.absolute.x,cy:i.position.absolute.y,r:a||Math.max(o.width,o.height)},{components:u.map((function(e){return{key:e}}))}).filter(l)}(l);case"custom":return function(e){var t=e.chart,n=e.expando,r=e.nodes,i=e.meta;return e.collectConfig.from({chart:t,expando:n,nodes:r,meta:i})}(l);default:return[]}}var Dg=Number.MAX_VALUE;function Ng(e){var t=e.nodes.reduce((function(e,t){var n=t.bounds;return e.xMin=Math.min(e.xMin,n.x,n.x+n.width),e.yMin=Math.min(e.yMin,n.y,n.y+n.height),e.xMax=Math.max(e.xMax,n.x,n.x+n.width),e.yMax=Math.max(e.yMax,n.y,n.y+n.height),e}),{xMin:Dg,xMax:-Dg,yMin:Dg,yMax:-Dg}),n=t.xMin,r=t.xMax,i=t.yMin;return{x:n,y:i,width:r-n,height:t.yMax-i}}function Ig(e){var t=e.chart,n=e.config,r=e.expando,i=e.placementConfig,o=e.hovered,a=e.collected,s=e.meta,l=function(e){for(var t=e.chart,n=e.config,r=e.expando,i=e.placementConfig,o=e.hovered,a=e.collected,s=e.meta,l=Vd(o,1)[0],u=Array.isArray(i)?i:[i],c={bounds:l.bounds,key:l.key},d=Ng({nodes:a}),m=0;m<u.length;m++){var f=u[m];if("function"==typeof f){var p=f({chart:t,expando:r,hovered:o,collected:Bd(a),meta:s,collectedBounds:d,combineBounds:Ng});if(p)return p}if("trigger"===f)return c;if("collectible"===f){var h=n.main.placements.collectible;return{bounds:"function"==typeof h?h({collected:Bd(a)}):d,key:a[0].key}}}return c}({chart:t,config:n,expando:r,placementConfig:i,hovered:o,collected:a,meta:s}),u=l.bounds,c=l.key,d=Vd(a,1)[0].desc;return[{bounds:u,nodes:a,data:a.map((function(e){return e.data})),key:c,meta:s,desc:d}]}function Tg(e){var t=e.chart,n=e.config,r=e.expando,i=e.internal,o=e.nodes;if(!o.length)return[];var a=Vd(o,1)[0].key,s=n.main.collectibles;if(!s.length)return[];var l=n.main.triggers.find((function(e){return-1!==e.keys.indexOf(a)}))||{},u=l.collect,c=l.placement;if(!u||!u.from||!c)return[];var d={triggerer:a,position:i.get(Cg)},m=(Og({chart:t,expando:r,nodes:o,collectConfig:u,collectibles:s,meta:d})||[]).map((function(e){return e.children.length?e.children[0]:e}));return m.length?Ig({chart:t,config:n,expando:r,placementConfig:c,hovered:o,collected:m,meta:d}):[]}var Lg=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼ‎ⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),kg=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞‏יִײַ-ﬨשׁ-ﭏ]"),Rg=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]"),Pg=function(e){return Lg.test(e)},$g=function(e){return kg.test(e)||Rg.test(e)};function Fg(e){for(var t=e?e.length:0,n=0;n<t;n++){var r=e[n];if(Pg(r))return"ltr";if($g(r))return"rtl"}return"ltr"}function zg(e){var t=e.config,n=e.h,r=e.context,i=e.nodes,o=e.property,a=e.filter,s=e.visibility,l=e.fillColor,u=t.rtl,c={type:"color",label:void 0,value:void 0,content:[],filter:a,visibility:Pd(Pd({},{count:!0}),s)},d=t.getColorSettings();if("color"===d.type||!d.fieldType)return c;var m=Vd(i,1)[0];if(c.value=function(e){var t=e.config,n=e.context,r=e.property,i=e.node,o=i.data[r];if(o){if(-3===i.data.value)return i.data.label;var a=n.resources.dataset(o.source.key).field(o.source.field).formatter(),s=o.value,l=o.label,u=t.getColorSettings();if(a&&"measure"===u.fieldType)return Number.isNaN(+s)?"-":a(o.value);var c=l||s;return void 0===c||Number.isNaN(c)||"NaN"===c?"-":c}}({config:t,context:r,property:o,node:m}),void 0===c.value)return c;c.label=function(e){var t=e.context,n=e.property,r=e.node,i=e.config.getColorSettings();if(i.label)return i.label;var o=r.data[n];if(o&&"color"!==i.type){var a=t.resources.dataset,s=o.source,l=s.key,u=s.field;return a(l).field(u).title()}}({config:t,context:r,property:o,node:m});var f=null!=l?l:function(e){var t=e.node.attrs;return(null==t?void 0:t.fill)||"#ddd"}({node:m}),p=n("div",{style:{display:"inline-block",width:10,height:10,"background-color":f,margin:"0 8px"}});return c.content.push({content:u?[":",c.label]:[c.label,":"],style:{"text-align":u?"right":"left",direction:Fg(c.label)}},{content:u?[c.value,p]:[p,c.value],style:{"text-align":u?"left":"right","vertical-align":"middle",direction:Fg(c.value)}}),c}function _g(e){var t=e.config,n=e.h,r=e.context,i={section:function(e){return function(e){return{type:"section",content:e.content}}({content:e.content})},text:function(e){var n=e.value,r=e.style,i=e.visibility;return function(e){var t=e.config,n=e.value,r=e.style,i=void 0===r?{}:r,o=i.bold,a=void 0!==o&&o,s=i.italic,l=e.visibility;return{type:"text",content:[{content:n,style:{"font-weight":a?"bold":"normal","font-style":void 0!==s&&s?"italic":"normal","text-align":t.rtl?"right":"left",direction:Fg(n)},colspan:2}],visibility:Pd(Pd({},{count:!0}),l)}}({config:t,value:n,style:r,visibility:i})},measure:function(e){var r=e.label,i=e.value,o=e.color,a=e.style,s=e.survive,l=e.visibility;return function(e){var t,n,r,i,o=e.h,a=e.label,s=e.value,l=e.color,u=e.style,c=e.survive,d=e.visibility,m=e.config.rtl,f=o("div",{style:{display:"inline-block",width:10,height:10,"background-color":l,margin:"0 8px"}});return{type:"measure",label:a,value:s,content:[{content:m?[":",a]:[a,":"],style:{"text-align":m?"right":"left","font-weight":null!=u&&null!==(t=u.label)&&void 0!==t&&t.bold?"bold":"normal","font-style":null!=u&&null!==(n=u.label)&&void 0!==n&&n.italic?"italic":"normal",direction:Fg(a)}},{content:l?m?[s,f]:[f,s]:s,style:{"text-align":m?"left":"right","vertical-align":"middle","font-weight":null!=u&&null!==(r=u.value)&&void 0!==r&&r.bold?"bold":"normal","font-style":null!=u&&null!==(i=u.value)&&void 0!==i&&i.italic?"italic":"normal",direction:Fg(s)}}],survive:Pd(Pd({},{color:!1,duplicate:!1}),c),visibility:Pd(Pd({},{count:!0}),d)}}({config:t,h:n,label:r,value:i,color:o,style:a,survive:s,visibility:l})},divider:function(){return function(e){var t=e.visibility;return{type:"divider",content:[{content:"",style:{"background-image":"linear-gradient(transparent 8px, rgba(255, 255, 255, 0.4) 8px, rgba(255, 255, 255, 0.4) 9.2px, transparent 9.2px)",height:"17px"},colspan:2}],visibility:Pd(Pd({},{count:!1}),t)}}({visibility:(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).visibility})},row:function(e){return function(e){var t=e.visibility;return{type:"row",content:[{content:e.content,style:e.style,colspan:e.colspan}],visibility:Pd(Pd({},{count:!0}),t)}}({content:e.content,style:e.style,colspan:e.colspan,visibility:e.visibility})},raw:function(e){return function(e){var t=e.visibility;return{type:"raw",content:e.value,visibility:Pd(Pd({},{count:!0}),t)}}({value:e.value,visibility:e.visibility})},color:function(e){var i=e.nodes,o=e.property,a=e.filter,s=void 0===a||a,l=e.visibility,u=e.fillColor;return zg({config:t,h:n,context:r,nodes:i,property:o,filter:s,visibility:l,fillColor:u})}};return i}function jg(e){var t=e.chart,n=e.translator,r=e.config,i=e.expando,o=e.h,a=e.data,s=e.style,l=Vd(a,1)[0],u=function(e){var t=e.config,n=e.nodes.reduce((function(e,n){var r=t.main.getGroupByValue({data:n.data});return e[r]||(e[r]={sorting:Object.keys(e).length,items:[]}),e[r].items.push(n),e}),{});return Object.keys(n).map((function(e){return n[e]})).sort((function(e,t){return e.sorting-t.sorting})).map((function(e){return e.items}))}({config:r,nodes:l.node.nodes}),c=function(e){var t=e.chart,n=e.config,r=e.expando,i=e.h,o=e.context,a=e.groups,s=o.node.meta,l=o.resources,u=l.dataset,c=l.formatter,d=_g({config:n,h:i,context:o}),m=function(e){var t=e.dataset;return{dataset:{title:function(e,n){return t(e).field(n).title()}}}}({dataset:u}),f=a.map((function(e){var t=d.section({content:Bd((n.main.section({expando:r,h:i,nodes:e,dataset:u,formatter:c,meta:s,create:d,util:m})||[]).filter((function(e){var t;return null===(t=e.content)||void 0===t?void 0:t.length}))).filter(Boolean)});return t.content=function(e){var t=e.config,n=e.content,r=n.find((function(e){return"color"===e.type&&e.filter})),i=r?n.filter((function(e){return"measure"!==e.type||e.survive.color||e.label!==r.label||e.value!==r.value})):n;return t.main.showDuplicateMeasures?i:i.reduce((function(e,t){var n=t.type,r=t.survive;if("measure"!==n||r.duplicate)return e.filtered.push(t),e;var i="".concat(t.label,"-").concat(t.value);return e.memory[i]||(e.memory[i]=!0,e.filtered.push(t)),e}),{memory:{},filtered:[]}).filtered}({config:n,content:t.content}),t}));return n.main.sections({chart:t,expando:r,h:i,nodes:o.node.nodes,dataset:u,formatter:c,meta:s,create:d,util:m,sections:f}),f.filter(Boolean)}({chart:t,config:r,expando:i,h:o,context:l,groups:u}),d=function(e){var t=e.translator,n=e.config,r=e.context,i=e.templates,o=n.main.layout,a=o.rows,s=o.grouping,l=o.single,u=function(e){var t=e.limit,n=e.grouping,r=e.single,i={count:0,overflow:0,index:{started:void 0,group:void 0}};return{process:function(e){var o=e.visibility,a=e.index;if(r&&0!==a)return n?(i.index.started!==a&&i.index.group!==a&&(i.overflow++,i.index.group=a),!1):(i.overflow++,!1);if(i.count>=t){if(!n)return i.overflow++,!1;if(i.index.started!==a)return i.index.group!==a&&(i.overflow++,i.index.group=a),!1}return o.count&&i.count++,n&&(i.index.started=a),!0},overflow:function(){return i.overflow}}}({limit:a,grouping:s,single:"function"==typeof l?l({meta:r.node.meta,sections:i}):l}),c=i.reduce((function(e,t,n){var r=t.type,o=t.content;"section"===r&&(void 0===o?[]:o).forEach((function(t){u.process({visibility:t.visibility,index:n})&&e.push(t.content)}));var a=n===i.length-1;return"divider"!==r||a||u.process({visibility:t.visibility,index:n})&&e.push(t.content),e}),[]).filter((function(e){return e.length})),d=u.overflow();return d&&c.push(function(e){var t=e.translator,n=e.config,r=e.count,i=t?t.get("Object.ChartTooltip.NMore",r):"+".concat(r," more"),o=Fg(i);return[{content:i,style:{"font-weight":"bold","text-align":n.rtl?"right":"left",direction:o},colspan:2}]}({translator:t,config:n,count:d})),c}({translator:n,config:r,h:o,context:l,templates:c});return d.length?function(e){var t=e.h,n=e.style;return e.rows.map((function(e){return t("tr",{},e.map((function(e){var r={style:Pd(Pd({},n.cell||{}),e.style||{}),class:e.class};return e.colspan&&(r.colspan=e.colspan),t("td",r,e.content)})))}))}({h:o,style:s,rows:d}):function(e){var t=e.h;return t("tr",{},t("td",{style:{fontStyle:"italic",opacity:.75}},"Empty"))}({h:o})}function Hg(e){var t=e.chart,n=e.translator,r=e.config,i=e.expando,o=e.internal;if(!r.main.key)return!1;var a=Wf(),s=Eg({key:r.main.key,rtl:r.rtl,duration:r.duration}),l=r.main.events.tooltip,u=l.afterShow,c=l.afterHide,d=function(){var e=a.get("collected");return{expando:i,nodes:e.nodes,meta:e.meta}};return tm(!0,s,{settings:{filter:function(e){return Tg({chart:t,config:r,expando:i,internal:o,nodes:e})},extract:function(e){return a.set("collected",e.node),e},content:function(e){var o=e.h,a=e.data,s=e.style;return jg({chart:t,translator:n,config:r,expando:i,h:o,data:a,style:s})},placement:function(e){var t=e.nodes;return r.main.placement({meta:t[0].meta})},afterShow:function(){return u(d())},afterHide:function(){return c(d())}},style:{arrow:{color:r.style.background},content:r.style}})}function Vg(e){var t=e.config,n=t.legend.keys;if(!n.tooltip||!n.component)return!1;if("categorical"!==t.getColorSettings().type)return!1;var r=Eg({key:n.tooltip,rtl:t.rtl,duration:t.duration});return tm(!0,r,{settings:{filter:function(e){return e.filter((function(e){return e.data&&e.key===n.component}))},extract:function(e){return e},content:function(e){var t=e.h,n=e.data;return[t("tr",{},[t("td",{style:Pd(Pd({},e.style.cell||{}),{"font-weight":"bold","text-align":"left"}),colspan:2},n[0].node.data.label)])]},placement:"pointer"},style:{arrow:{color:t.style.background},content:t.style}})}function Bg(e){var t=e.config.main.triggers.reduce((function(e,t){return t.keys.forEach((function(n){var r=t.distance||0;e.distance[n]=r,e.distances.includes(r)||e.distances.push(r),e.key[n]=!0,e.keys[r]||(e.keys[r]=[]),e.keys[r].push(n)})),e}),{distance:{},distances:[],key:{},keys:{}});return function(e){return e.components.filter((function(e){return t.key[e.key]})).reduce((function(e,n){e.any=!0,e.components.push(n.key);var r=t.distance[n.key];return 0===r?e.position.push(n.key):(e.distances.includes(r)||(e.distances.push(r),e.distanceKeys[r]=[]),e.distanceKeys[r].push(n.key)),e}),{any:!1,components:[],position:[],distances:[],distanceKeys:{}})}}var Ug=function(){return!0};function Yg(e){var t=e.config.main.triggers.reduce((function(e,t){var n=t.filter;return t.keys.forEach((function(t){e[t]="function"==typeof n?n:Ug})),e}),{});return function(e){var n=t[e.key];return!n||n(e)}}function Wg(e){var t=e.chart,n=e.event,r=e.component,i={absolute:{x:0,y:0},relative:{x:0,y:0}},o=t.element.getBoundingClientRect(),a=o.left,s=o.top;i.absolute.x=(void 0===n.clientX?Math.floor(n.srcEvent.clientX):n.clientX)-a,i.absolute.y=(void 0===n.clientY?Math.floor(n.srcEvent.clientY):n.clientY)-s;var l=t.component(r);if(l){var u=l.rect.computedInner;i.relative.x=i.absolute.x-u.x,i.relative.y=i.absolute.y-u.y}return i}function Gg(e){var t=e.chart,n=e.filter,r=e.hits,i=e.position,o=[];if(r.position.length&&o.push.apply(o,Bd(t.shapesAt(i.absolute,{components:r.position.map((function(e){return{key:e}}))}).filter(n))),!o.length&&r.distances.length){var a=[];r.distances.forEach((function(e){a.push.apply(a,Bd(t.shapesAt({cx:i.absolute.x,cy:i.absolute.y,r:e},{components:r.distanceKeys[e].map((function(e){return{key:e}}))}).filter(n)))})),a.length&&o.push(function(e){var t=e.nodes,n=e.origin,r=t.find((function(e){return"path"===e.type}));if(r)return r;var i=function(e){var t=Math.abs(n.x-(e.localBounds.x+e.localBounds.width/2)),r=Math.abs(n.y-(e.localBounds.y+e.localBounds.height/2));return Math.sqrt(t*t+r*r)};return t.slice(1).reduce((function(e,t){var n=i(t);return n<e.distance&&(e.distance=n,e.node=t),e}),{node:t[0],distance:i(t[0])}).node}({nodes:a,origin:i.relative}))}return o}function Xg(e){var t=e.chart,n=e.config,r=e.expando,i=e.internal,o=e.facade,a=n.delay.tap,s=Bg({config:n}),l=Yg({config:n}),u=n.main.triggers.reduce((function(e,t){return e.push.apply(e,Bd(t.keys)),e}),[]);return{key:"event:".concat("tooltipTap"),type:"Tap",options:{event:"tooltipTap",enable:function(e,r){return!r||!!n.enable({event:r})&&t.componentsFromPoint({x:r.center.x,y:r.center.y}).filter((function(e){return-1!==u.indexOf(e.key)})).length>0}},recognizeWith:"tap",events:jd({},"tooltipTap",(function(e){if(e.preventDefault(),"mouse"!==e.pointerType&&!n.main.suppress({event:e})){var u=t.component(n.main.key);if(u&&u.show){var c=t.componentsFromPoint({x:e.center.x,y:e.center.y}),d=s({components:c});if(d.any){var m=Vd(d.components,1)[0],f=Wg({chart:t,event:e,component:m});i.set(Cg,f);var p=Gg({chart:t,filter:l,hits:d,position:f});if(p.length){var h=p[0].key;n.main.events.tooltip.beforeShow({expando:r,event:e,collectNodes:function(){return o.collectNodes({nodes:p})},meta:{triggerer:h,position:f}}).then((function(){u.emit("show",e,{nodes:p,delay:a})})).catch((function(){}))}else u.emit("hide")}else u.emit("hide")}}}))}}function Kg(e){var t=e.chart,n=e.config,r=e.expando,i=e.internal,o=e.facade,a=Bg({config:n}),s=Yg({config:n}),l=function(e){var t=e.config,n=e.expando,r=e.internal,i=e.facade,o=t.main.events.tooltip.beforeShow,a=t.delay.hover,s={ongoing:{},latest:void 0};return function(e){var t=e.event,l=e.tooltip,u=e.nodes,c=function(e){var t=e.nodes;return JSON.stringify(t.map((function(e){var t;return{key:e.key,bounds:e.bounds,value:null===(t=e.data)||void 0===t?void 0:t.value}})))}({nodes:u});if(!s.ongoing[c]){s.ongoing[c]=!0,s.latest=c;var d=u[0].key;o({expando:n,event:t,collectNodes:function(){return i.collectNodes({nodes:u})},meta:{triggerer:d,position:r.get(Cg)}}).then((function(){c===s.latest&&l.emit("show",t,{nodes:u,delay:a})})).catch((function(){l.emit("show")})).finally((function(){delete s.ongoing[c],c===s.latest&&(s.latest=void 0)}))}}}({config:n,expando:r,internal:i,facade:o}),u=[n.main.key,n.legend.keys.tooltip].filter(Boolean),c=function(){u.forEach((function(e){var n=t.component(e);null!=n&&n.show&&n.emit("hide")}))};return{type:"native",events:{mousemove:function(e){if(n.enable({event:e})&&!n.main.suppress({event:e})){var r=t.componentsFromPoint({x:e.clientX,y:e.clientY}),o=t.component(n.main.key);if(o&&o.show){var u=a({components:r});if(u.any){var c=Vd(u.components,1)[0],d=Wg({chart:t,event:e,component:c});i.set(Cg,d);var m=Gg({chart:t,filter:s,hits:u,position:d});if(!m.length)return void o.emit("hide");l({event:e,tooltip:o,nodes:m})}else o.emit("hide")}var f=n.legend;if(f.keys.tooltip&&f.keys.component){var p=t.component(f.keys.tooltip);p&&p.show&&(r.some((function(e){return e.key===f.keys.component}))?p.emit("show",e):p.emit("hide"))}}},mouseup:function(e){2===e.button&&c()},mouseleave:function(){n.main.events.interaction.mouseleave({expando:r}),c()},wheel:function(){c()}}}}function Jg(e){var t=e.chart,n=e.translator,r=function(e){var t=e.config;return tm(!0,{},{rtl:!1,enable:bg.FALSE,getColorSettings:bg.OBJECT,style:{fontSize:void 0,fontFamily:void 0,color:void 0,background:void 0},delay:{hover:500,tap:0},duration:8e3,main:{key:void 0,suppress:bg.FALSE,getGroupByValue:bg.NOOP,collectibles:[],triggers:[],placement:function(){return{type:"bounds"}},placements:{collectible:"combine"},showDuplicateMeasures:!1,layout:{rows:7,grouping:!1,single:!1},section:bg.ARRAY,sections:bg.NOOP,events:{tooltip:{beforeShow:function(){return Promise.resolve()},afterShow:bg.NOOP,afterHide:bg.NOOP},interaction:{mouseleave:bg.NOOP}}},legend:{keys:{tooltip:void 0,component:void 0}}},void 0===t?{}:t)}({config:e.config}),i=Wf(),o=Wf(),a={components:void 0,interactions:void 0};return{getComponents:function(){return a.components||(a.components=function(e){var t=e.config;return[Hg({chart:e.chart,translator:e.translator,config:t,expando:e.expando,internal:e.internal}),Vg({config:t})].filter(Boolean)}({chart:t,translator:n,config:r,expando:i,internal:o})),a.components},getInteractions:function(){return a.interactions||(a.interactions=function(e){var t=e.chart,n=e.config,r=e.expando,i=e.internal,o=function(e){var t=e.chart,n=e.config,r=e.expando,i=e.internal;return{collectNodes:function(e){var o=e.nodes,a=Vd(Tg({chart:t,config:n,expando:r,internal:i,nodes:o}),1)[0];return(void 0===a?{nodes:[]}:a).nodes}}}({chart:t,config:n,expando:r,internal:i});return{gestures:[Xg({chart:t,config:n,expando:r,internal:i,facade:o})],native:Kg({chart:t,config:n,expando:r,internal:i,facade:o})}}({chart:t,config:r,expando:i,internal:o})),a.interactions},expando:i}}var Zg=["American Typewriter, serif","Andalé Mono, monospace","Arial Black, sans-serif","Arial, sans-serif","Bradley Hand, cursive","Brush Script MT, cursive","Comic Sans MS, cursive","Courier, monospace","Didot, serif","Georgia, serif","Impact, sans-serif","Lucida Console, monospace","Luminari, fantasy","Monaco, monospace","QlikView Sans, sans-serif","Source Sans Pro, sans-serif","Tahoma, sans-serif","Times New Roman, serif","Trebuchet MS, sans-serif","Verdana, sans-serif"],Qg=["Abril Fatface, serif","Bangers, fantasy","Bebas Neue, sans serif","EB Garamond, serif","Fredoka One, fantasy","Graduate, fantasy","Gravitas One, serif","Indie Flower, fantasy","Inter, sans-serif","Lobster, fantasy","Montserrat, sans-serif","Nixie One, sans-serif","Noto Sans, sans-serif","Open Sans, sans-serif","PT Serif, serif","Pacifico, cursive","Permanent Marker, fantasy","QlikView Sans, sans-serif","Raleway, sans-serif","Rammetto One, fantasy","Roboto, sans-serif","Source Sans Pro, sans-serif","Titan One, fantasy","Yanone Kaffeesatz, sans-serif"];var ey=function(e){return{value:e,label:e.charAt(0).toUpperCase()+e.slice(1),groupHeader:!1,disabled:!1,styles:{fontFamily:e}}};function ty(e){var t=e.theme,n=e.translator,r=e.defaultValue,i=e.flags,o=[],a=t.getStyle("","","fontFamilies");return Array.isArray(a)&&a.length?o.push.apply(o,Bd(new Set([r].concat(Bd(a.map((function(e){return e.split(",").map((function(e){return e.trim()})).map((function(e){return e.replace(/\s+/g," ").trim()})).filter(Boolean).join(", ")}))))))):o.push(r),[{value:"ThemeHeader",label:n.get("properties.themeFonts"),metaText:n.get("properties.theme"),groupHeader:!0}].concat(Bd(o.map((function(e){return ey(e)}))),[{value:"DefaultHeader",label:n.get("properties.allFonts"),metaText:n.get("properties.default"),groupHeader:!0}],Bd(function(e){return null!=e&&e.isEnabled("PS_20852_WYSIWYG_FONT_SUPPORT")?Qg:Zg}(i).map((function(e){return ey(e)}))))}function ny(e){var t=e.theme,n=e.translator,r=e.id,i=e.path,o=e.flags,a=function(){return t.getStyle(r,i,"fontFamily")};return{getDefaultValue:function(){return a()},getOptions:function(){return ty({theme:t,translator:n,defaultValue:a(),flags:o})}}}var ry=["10px","11px","12px","13px","14px","15px","16px","17px","18px","19px","20px","21px","22px","23px","24px"],iy=function(e){return{value:e,label:e,groupHeader:!1,disabled:!1}};function oy(e){var t=e.theme,n=e.translator,r=e.id,i=e.path,o=function(){return t.getStyle(r,i,"fontSize")};return{getDefaultValue:function(){return o()},getOptions:function(){return function(e){var t=e.translator,n=e.defaultValue,r=[],i=e.theme.getStyle("","","fontSizes");return Array.isArray(i)&&i.length?r.push.apply(r,Bd(new Set([n].concat(Bd(i))))):r.push(n),[{value:"ThemeHeader",label:t.get("properties.themeFontSizes"),metaText:t.get("properties.theme"),groupHeader:!0}].concat(Bd(r.map((function(e){return iy(e)}))),[{value:"DefaultHeader",label:t.get("properties.allFontSizes"),metaText:t.get("properties.default"),groupHeader:!0}],Bd(ry.map((function(e){return iy(e)}))))}({theme:t,translator:n,defaultValue:o()})}}}function ay(e){var t=e.theme,n=e.translator,r=e.id,i=e.path;return{fontFamily:ny({theme:t,translator:n,id:r,path:i,flags:e.flags}),fontSize:oy({theme:t,translator:n,id:r,path:i})}}const sy={FULL:16,MEDIUM:14,SMALL:12,XSMALL:8,SPARK:4};function ly({chart:e,models:t,viewState:n,viewCache:r,axis:i}){const o=Wf(),{dockService:a}=t;return({data:t})=>(({items:t})=>{const{rect:n}=e.component(`${ul.COMPONENT.BAR}-${i}`)||{};return(!t.length||!n)&&2})(t)||(()=>{const{min:e,max:t}=n.get("zoom");return o.get([e,t])||o.empty()&&!1})()||(()=>{const e=sy[a.meta.chart.mode];return 0===Math.abs(r.get("continuousMax")-r.get("continuousMin"))&&e})()||(()=>{const{min:e,max:t}=n.get("zoom"),i=Math.abs(r.get("continuousMax")-r.get("continuousMin")),s=Math.abs(t-e),l=sy[a.meta.chart.mode],u=function(e,t,n){return e*(1-n)+t*n}(2,l,1-Math.min(s/i/.2,1));return o.set([e,t],Math.max(2,Math.min(l,u)))})()}const uy=({isContinuous:e,isBarSeriesGrouped:t,styleModel:n,discreteModel:r,isBarSeriesStackedInBothAxis:i})=>e?1:n.query.bar.getHasStyling()?n.query.bar.getHasStrokeWidth()?function(){const e=n.query.bar.getStrokeWidth()/r.query.getItemSize(),t=n.query.bar.getWidthFn()(),i=t+e;return i>1?t-(i-1):t}:n.query.bar.getWidthFn():t||i?.9:.7;function cy(e){return Math.min(Math.max(0,e),1)}const dy=({chart:e,models:t,viewState:n,viewCache:r,isPrimary:i})=>{const{layoutService:o,dockService:a,colorService:s,seriesModel:l,styleModel:u,discreteModel:c,primaryExtremumModel:d,secondaryExtremumModel:m}=t,{isContinuous:f,isBarSeriesStacked:p,isBarSeriesGrouped:h,isBarSeriesStackedInBothAxis:g}=o.meta,y=e=>e.datum.start?e.datum.start.value:e.scale.min(),v=i?cl.AXIS.PRIMARY:cl.AXIS.SECONDARY,b=i?ul.SCALE.MINOR.PRIMARY:ul.SCALE.MINOR.SECONDARY;if(!(i?l.meta.primaryBarSeriesCount:l.meta.secondaryBarSeriesCount))return!1;const x=p?{scale:b,start:{ref:"start",fn:e=>{const t=y(e);return cy(e.scale(t))}},end:{ref:"end",fn:e=>{const t=(e=>e.datum.end?e.datum.end.value:y(e))(e);return cy(e.scale(t))}}}:{scale:b,start:{ref:"start",fn:e=>{const t=y(e);return cy(e.scale(t))}},end:{ref:"end",fn:e=>{var t;const n=!0===(null===(t=e.datum.null)||void 0===t?void 0:t.value)?y(e):e.datum.end.value;return cy(e.scale(n))}}},M=(i?d:m).query.getExtrema(),S=p?({start:e,end:t})=>Ad(e.value,t.value,M):({end:e})=>Nd(e.value,M);return{type:"box",key:`${ul.COMPONENT.BAR}-${v}`,data:{filter:(()=>{if(p)return;const e=l.query.series(cl.TYPE.BAR).filter((e=>e.isPrimary===i)).map((e=>e.ref));return t=>e.some((e=>e===t.end.source.field))})(),collection:p?i?ul.COLLECTION.STACKED_PRIMARY:ul.COLLECTION.STACKED_SECONDARY:i?ul.COLLECTION.PRIMARY:ul.COLLECTION.SECONDARY},preferredSize:f?()=>({size:0,edgeBleed:{left:1,right:1}}):void 0,settings:{orientation:a.meta.minor.orientation,major:{scale:ul.SCALE.MAJOR,fn:Qc({layoutService:o,axis:v}),ref:f?{start:"major",end:"major"}:void 0},minor:x,box:{width:uy({isContinuous:f,isBarSeriesGrouped:h,styleModel:u,discreteModel:c,isBarSeriesStackedInBothAxis:g}),minWidthPx:f?ly({chart:e,models:t,viewState:n,viewCache:r,axis:v}):void 0,fill:s.getColor(),strokeWidth:u.query.bar.getStrokeWidth(),stroke:u.query.bar.getStrokeColor(),minHeightPx:.3,opacity:e=>{var t,n;return!0===(null===(t=e.datum)||void 0===t||null===(n=t.null)||void 0===n?void 0:n.value)||S(e.datum)?0:1}},oob:{show:!1},whisker:{show:!1},median:{show:!1},line:{show:!1}},brush:td({layoutService:o,active:{opacity:e=>{var t;return!0===(null===(t=e.data.null)||void 0===t?void 0:t.value)||S(e.data)?0:1}},inactive:{opacity:e=>{var t;return!0===(null===(t=e.data.null)||void 0===t?void 0:t.value)||S(e.data)?0:Wc.INACTIVE}}})}},my=({chart:e,models:t,viewState:n,viewCache:r,isPrimary:i})=>{const{layoutService:o,dockService:a,colorService:s,seriesModel:l,styleModel:u,discreteModel:c}=t,{isBarSeriesStacked:d,isContinuous:m,isBarSeriesGrouped:f,isBarSeriesStackedInBothAxis:p}=o.meta,h=i?cl.AXIS.PRIMARY:cl.AXIS.SECONDARY,g=i?l.meta.primaryBarSeriesCount:l.meta.secondaryBarSeriesCount;if(!d||0===g)return!1;return{key:`${ul.COMPONENT.STACK_BAR}-${h}`,type:"box",data:{collection:i?ul.COLLECTION.STACKED_TOTAL_PRIMARY:ul.COLLECTION.STACKED_TOTAL_SECONDARY},settings:{major:{scale:ul.SCALE.MAJOR,fn:Qc({layoutService:o,axis:h}),ref:m?{start:"timeStart",end:"timeEnd"}:void 0},minor:{scale:i?ul.SCALE.MINOR.PRIMARY:ul.SCALE.MINOR.SECONDARY,start:{ref:"sumOfNegatives"},end:{ref:"sumOfPositives"}},orientation:a.meta.minor.orientation,box:{width:uy({isContinuous:m,isBarSeriesGrouped:f,styleModel:u,discreteModel:c,isBarSeriesStackedInBothAxis:p}),minWidthPx:m?ly({chart:e,models:t,viewState:n,viewCache:r,axis:h}):2,opacity:0,fill:s.getColor()},oob:{show:!1},whisker:{show:!1},median:{show:!1},line:{show:!1}}}};function fy(e,t){const n="horizontal"===e.dockService.meta.major.orientation,{style:r}=t,i=e.styleModel.query.bar.label.getStyle();return{placements:t.simplifiedPlacements.map((e=>{const t=i.useContrastColor&&!e.onBackground?function({style:e,simplifiedPlacement:t}){return n=>vt.isDark(t.background?t.background.fill:n.node.attrs.fill)?e.lightColor:e.darkColor}({style:r,simplifiedPlacement:e}):i.fill;return function({simplifiedPlacement:e,fill:t,isHorizontal:n}){const r=e.padding||{left:n?0:4,right:n?0:4,top:n?4:0,bottom:n?4:0};return{position:e.position,justify:e.justify,fill:t,overflow:e.overflow,background:e.background,padding:r}}({simplifiedPlacement:e,fill:t,isHorizontal:n})})),label:t.label}}const py="vertical",hy="horizontal";function gy(e,t,n,r){const i=function(e,t){return function(e,t){if(t&&0===e){const{min:e,max:n}=t;return 0===n&&0===e?1:n<=0?-1:e>=0||n>=-e?1:-1}return e>=0?1:-1}(e,t)}(e,r);let o="up";return t===py&&i<0?o="down":t===hy&&(o=i>=0&&!n||i<0&&n?"right":"left"),o}const yy=(e,t)=>{if(!e)return!1;const{isBarSeriesStacked:n,isContinuous:r}=t;return!n||!r},vy=(e,t)=>{if(!e)return!1;const{isBarSeriesStacked:n,isContinuous:r}=t;return!!n&&(!!r||!1!==e)};function by(e,t,n,r){const i=[];return void 0!==e&&(i[e]={position:"outside",onBackground:!0,justify:0,overflow:r}),void 0!==t&&(i[t]={position:"inside",onBackground:!1,justify:n}),i}const xy=({models:e,environment:t,isPrimary:n})=>{const{layoutService:r,seriesModel:i,styleModel:o,themeService:a}=e,{meta:s}=r,l="rtl"===t.options.direction,u=a.getStyles(),c=o.query.bar.label.getStyle(),d=e.layoutService.getLayoutValue("dataPoint.showBarLabels",!1),m=n?cl.AXIS.PRIMARY:cl.AXIS.SECONDARY;if(!(n?i.meta.primaryBarSeriesCount:i.meta.secondaryBarSeriesCount)||!yy(d,s))return!1;let f;!s.isBarSeriesStacked&&(f=s.isBarSeriesStacked?1:0);const p={label:e=>bd(e.data,e),simplifiedPlacements:by(f,0===f?1:0,s.isBarSeriesStacked?.5:1,s.isContinuous),style:u.label.value},h=[fy(e,p)],g={component:`${ul.COMPONENT.BAR}-${m}`,selector:"rect",strategy:{type:"bar",settings:{direction:t=>gy(t.data.end.value,e.dockService.meta.minor.orientation,l,0),labels:h,fontSize:parseInt(c.fontSize,10),fontFamily:c.fontFamily}}},y=[g];return{type:"labels",key:`${ul.COMPONENT.BAR_LABEL}-${m}`,layout:{minimumLayoutMode:Bc.VALUE_LABEL},settings:{sources:y}}};function My(e,t,n,r){const i=[{position:e,onBackground:!0,justify:0,overflow:r}];if(t){const t={fill:"#cce6e6e6",padding:{left:2,right:2,top:2,bottom:2}};i.push({position:"inside",onBackground:!1,justify:"outside"===e?1:0,background:n?t:void 0})}return i}function Sy({chart:e,models:t,environment:n,isPrimary:r}){const{meta:i}=t.layoutService,o="rtl"===n.options.direction,a=t.themeService.getStyles(),s=t.styleModel.query.bar.label.getStyle(),l=t.layoutService.getLayoutValue("dataPoint.showBarLabels",!1),u=r?cl.AXIS.PRIMARY:cl.AXIS.SECONDARY;if(0===(r?t.seriesModel.meta.primaryBarSeriesCount:t.seriesModel.meta.secondaryBarSeriesCount)||!vy(l,i))return!1;const c=s.useContrastColor,d=e.formatter(r?ul.FORMATTER.PRIMARY:ul.FORMATTER.SECONDARY)||(e=>e),m=e=>0===e?"":d(e),f={label:e=>m(e.data.sumOfPositives.value),simplifiedPlacements:My("outside",true,c,i.isContinuous),style:a.label.value},p={label:e=>m(e.data.sumOfNegatives.value),simplifiedPlacements:My("opposite",true,c,i.isContinuous),style:a.label.value},h=[fy(t,f),fy(t,p)];return{type:"labels",key:`${ul.COMPONENT.STACK_BAR_LABEL}-${u}`,layout:{displayOrder:2,minimumLayoutMode:Bc.VALUE_LABEL},settings:{sources:[{component:`${ul.COMPONENT.STACK_BAR}-${u}`,selector:"rect",strategy:{type:"bar",settings:{direction:e=>gy(e.data.sumOfPositives.value,t.dockService.meta.minor.orientation,o),labels:h,fontSize:parseInt(s.fontSize,10),fontFamily:s.fontFamily}}}]}}}var Ey=Object.freeze({__proto__:null,hasMaxHat:function(e,t){const{hasExplicitMax:n}=t.meta,{max:r}=t.explicit;return!!n&&e>r&&r>0},hasMinHat:function(e,t){const{hasExplicitMin:n}=t.meta,{min:r}=t.explicit;return!!n&&e<r&&r<0}});const Cy={min:"Min",max:"Max"},qy=1e-12;function wy({chart:e,models:t,type:n,viewCache:r,viewState:i,isPrimary:o}){const{layoutService:a,dockService:s,primaryExtremumModel:l,secondaryExtremumModel:u,styleModel:c,discreteModel:d}=t,{isBarSeriesStacked:m,isContinuous:f,isBarSeriesGrouped:p,isBarSeriesStackedInBothAxis:h}=a.meta,g=m?my({chart:e,models:t,viewCache:r,viewState:i,isPrimary:o}):dy({chart:e,models:t,viewCache:r,viewState:i,isPrimary:o}),y=o?l.query.getExtrema():u.query.getExtrema(),v=n===nd.MAX,b=o?cl.AXIS.PRIMARY:cl.AXIS.SECONDARY;if(!g)return!1;if(function(e,t){return!e.meta[`hasExplicit${Cy[t]}`]}(y,n)||function(e,t,n){const r=n?e.implicit.bar.max:e.implicit.bar.min,i=Number(r.toFixed(13));return!Ey[`has${Cy[t]}Hat`](i,e)}(y,n,v)||function(e,t,n){const r=n?e=>e<0:e=>e>0;return e.meta[`hasExplicit${Cy[t]}`]&&r(e.explicit[t])}(y,n,v))return!1;let x="end";m&&(x=v?"sumOfPositives":"sumOfNegatives");const M=function(e){let t;return()=>(void 0===t&&(t=e()),t)}((()=>e.scale(o?ul.SCALE.MINOR.PRIMARY:ul.SCALE.MINOR.SECONDARY)[n]()));const S=(({chart:e,type:t,isPrimary:n,dock:r})=>{let i=r;const o=e.component(`${ul.COMPONENT.SLICED_HAT}-${t}-${cl.AXIS.PRIMARY}`),a=e.component(`${ul.COMPONENT.SLICED_HAT}-${t}-${cl.AXIS.SECONDARY}`);return o&&a&&(i=n?r:`@${ul.COMPONENT.SLICED_HAT}-${t}-${cl.AXIS.PRIMARY}`),i})({chart:e,type:n,isPrimary:o,dock:v?s.meta.minor.end:s.meta.minor.start}),E={type:"box-sliced-hat",key:`${ul.COMPONENT.SLICED_HAT}-${n}-${b}`,layout:{dock:S},data:g.data,settings:{orientation:g.settings.orientation,major:g.settings.major,minor:g.settings.minor,hat:G({},g.settings.box,{fill:m?"#999":g.settings.box.fill,alignment:1,opacity:1,show:function(e){const t=M(),n=function(e){if("number"!=typeof e)return e;const t=Math.round(e);return Math.abs(e-t)<qy?t:e}(e.datum[x].value);return v?n>t:n<t},width:uy({isContinuous:f,isBarSeriesGrouped:p,styleModel:c,discreteModel:d,isBarSeriesStackedInBothAxis:h}),strokeWidth:c.query.bar.getStrokeWidth(),stroke:c.query.bar.getStrokeColor()})},brush:td({layoutService:a})};return E}const Ay={min:"Min",max:"Max"},Oy={sumOfPositives:"sumOfNegatives",sumOfNegatives:"sumOfPositives"};function Dy({chart:e,models:t,type:n,viewCache:r,viewState:i,isPrimary:o}){const{layoutService:a,dockService:s,primaryExtremumModel:l,secondaryExtremumModel:u,themeService:c}=t,{end:d,start:m}=s.meta.minor,{isBarSeriesStacked:f}=a.meta,p=f?my({chart:e,models:t,viewCache:r,viewState:i,isPrimary:o}):dy({chart:e,models:t,viewCache:r,viewState:i,isPrimary:o}),h=o?l.query.getExtrema():u.query.getExtrema(),g=n===nd.MAX?h.implicit.bar.max:h.implicit.bar.min,y=Number(g.toFixed(13)),v=o?cl.AXIS.PRIMARY:cl.AXIS.SECONDARY;if(!p)return!1;if(!Td[`is${Ay[n]}OutOfBounds`](y,h))return!1;const b=(({chart:e,type:t,end:n,start:r,isPrimary:i})=>{let o=t===nd.MAX?n:r;const a=e.component(ul.COMPONENT.LABEL_SPACE),s=e.component(`${ul.COMPONENT.SLICED_HAT}-${t}-${cl.AXIS.PRIMARY}`),l=e.component(`${ul.COMPONENT.SLICED_HAT}-${t}-${cl.AXIS.SECONDARY}`),u=e.component(`${ul.COMPONENT.BAR_OOB}-${t}-${cl.AXIS.PRIMARY}`),c=e.component(`${ul.COMPONENT.BAR_OOB}-${t}-${cl.AXIS.SECONDARY}`);return s?o=`@${ul.COMPONENT.SLICED_HAT}-${t}-${cl.AXIS.PRIMARY}`:l?o=`@${ul.COMPONENT.SLICED_HAT}-${t}-${cl.AXIS.SECONDARY}`:u&&c&&!i?o=`@${ul.COMPONENT.BAR_OOB}-${t}-${cl.AXIS.PRIMARY}`:a&&t===nd.MAX&&(o=`@${ul.COMPONENT.LABEL_SPACE}`),o})({chart:e,type:n,end:d,start:m,isPrimary:o});let x="end";f&&(x=n===nd.MAX?"sumOfPositives":"sumOfNegatives");const M={type:"box-out-of-bounds",key:`${ul.COMPONENT.BAR_OOB}-${n}-${v}`,layout:{dock:b},data:p.data,settings:{orientation:p.settings.orientation,major:p.settings.major,minor:p.settings.minor,dockValue:me.getDockValue(n===nd.MAX?d:m),oob:G({},p.settings.box,{fill:c.getStyles().outOfRange.color,alignment:1,opacity:1,show:function(e){var t;if(!0===(null===(t=e.datum.null)||void 0===t?void 0:t.value))return!1;const r=f&&0===e.datum[x].value,i=Td[`is${Ay[n]}OutOfBounds`](e.datum[x].value,h,n),o=(!r||function({type:e,item:t,prop:n,extrema:r}){const i=t.datum[Oy[n]].value;return 0!==i&&Td[`is${Ay[e]}OutOfBounds`](i,r,e)}({type:n,item:e,prop:x,extrema:h}))&&i;return o}})},brush:td({layoutService:a})};return M}function Ny(e){return Math.min(Math.max(0,e),1)}const Iy=({chart:e,models:t,type:n,isPrimary:r})=>{const{discreteModel:i,styleModel:o,seriesModel:a,layoutService:s}=t;if(!(r?a.meta.primaryBarSeriesCount:a.meta.secondaryBarSeriesCount))return!1;const{isBarSeriesStacked:l,isContinuous:u,isBarSeriesGrouped:c,isBarSeriesStackedInBothAxis:d}=s.meta,m=e.scale(r?ul.SCALE.MINOR.PRIMARY:ul.SCALE.MINOR.SECONDARY),f=r?cl.AXIS.PRIMARY:cl.AXIS.SECONDARY,p=r?t.primaryExtremumModel.query.getExtrema():t.secondaryExtremumModel.query.getExtrema(),h=n===nd.MAX;if(!Id({extrema:p,type:n}))return!1;const g=e=>e.datum.start?e.datum.start.value:e.scale.min(),y=(e,t="end")=>e.datum[t]?e.datum[t].value:g(e),v={type:"box",key:`${ul.COMPONENT.GHOST_BAR_OOB}-${n}-${f}`,data:{filter:(()=>{if(l)return;const e=a.query.series(cl.TYPE.BAR).filter((e=>e.isPrimary===r)).map((e=>e.ref));return t=>e.some((e=>e===t.end.source.field))})(),collection:l?r?ul.COLLECTION.STACKED_TOTAL_PRIMARY:ul.COLLECTION.STACKED_TOTAL_SECONDARY:r?ul.COLLECTION.PRIMARY:ul.COLLECTION.SECONDARY},settings:{orientation:t.dockService.meta.minor.orientation,major:{scale:ul.SCALE.MAJOR,fn:Qc({layoutService:s,axis:f}),ref:u?{start:"major",end:"major"}:void 0},minor:{scale:r?ul.SCALE.MINOR.PRIMARY:ul.SCALE.MINOR.SECONDARY,start:{ref:"start",fn:e=>{const t=g(e);return Ny(e.scale(t))}},end:l?"max"===n?{ref:"sumOfPositives",fn:e=>{const t=y(e,"sumOfPositives");return Ny(e.scale(t))}}:{ref:"sumOfNegatives",fn:e=>{const t=y(e,"sumOfNegatives");return Ny(e.scale(t))}}:{ref:"end",fn:e=>{const t=y(e);return Ny(e.scale(t))}}},box:{width:uy({isContinuous:u,isBarSeriesGrouped:c,styleModel:o,discreteModel:i,isBarSeriesStackedInBothAxis:d}),stroke:"transparent",fill:"none",opacity:0,show:e=>{let t="end";l&&(t=h?"sumOfPositives":"sumOfNegatives");const n=e.datum[t]?e.datum[t].value:m.max();return h?n>m.max():n<m.min()}},oob:{show:!1},whisker:{show:!1},median:{show:!1},line:{show:!1}}};return v};function Ty(e,t,n,r,i){const o=[{position:e,justify:0,overflow:n,background:{padding:{left:1,right:1,top:1,bottom:1}}}];return t&&o.push({position:"inside",onBackground:!1,justify:r||i?0:1,background:{padding:{left:2,right:2,top:2,bottom:2}}}),o}const Ly=({chart:e,models:t,type:n,environment:r,isPrimary:i})=>{const{layoutService:o,dockService:a,primaryExtremumModel:s,secondaryExtremumModel:l,styleModel:u,seriesModel:c,themeService:d}=t,m=d.getStyles(),f=u.query.bar.label.getStyle(),{meta:p}=o,{isBarSeriesStacked:h}=p,g=e.formatter(i?ul.FORMATTER.PRIMARY:ul.FORMATTER.SECONDARY),y=o.getLayoutValue("dataPoint.showBarLabels",!1),v="horizontal"===a.meta.major.orientation,b="rtl"===r.options.direction;if(!(i?c.meta.primaryBarSeriesCount:c.meta.secondaryBarSeriesCount)||!h&&!yy(y,p)||h&&!vy(y,p))return!1;const x=i?s.query.getExtrema():l.query.getExtrema();if(!x.meta.hasExplicit)return!1;const M=n===nd.MAX?x.implicit.bar.max:x.implicit.bar.min;if(!(n===nd.MAX?Od(M,x):Dd(M,x)))return!1;let S=e=>bd(e.data,e);p.isBarSeriesStacked&&(S=n===nd.MAX?function(e){var t;if(!0===(null===(t=e.data.null)||void 0===t?void 0:t.value))return"";if(Od(e.data.sumOfPositives.value,x)){const t=0===e.data.sumOfNegatives.value?e.data.sumOfPositives.value:e.data.sumOfNegatives.value;return g?g(t):t}return""}:function(e){var t;if(!0===(null===(t=e.data.null)||void 0===t?void 0:t.value))return"";if(Dd(e.data.sumOfNegatives.value,x)){const t=0===e.data.sumOfPositives.value?e.data.sumOfNegatives.value:e.data.sumOfPositives.value;return g?g(t):t}return""});const E={label:S,simplifiedPlacements:Ty("outside",true,p.isContinuous,v,b),style:m.label.value},C={label:S,simplifiedPlacements:Ty("opposite",true,p.isContinuous,v,b),style:m.label.value},q=[fy(t,E),fy(t,C)],w=i?cl.AXIS.PRIMARY:cl.AXIS.SECONDARY,A="horizontal"===a.meta.major.orientation?"down":"right",O=[{component:`${ul.COMPONENT.GHOST_BAR_OOB}-${n}-${w}`,selector:"rect",strategy:{type:"bar",settings:{direction:A,labels:q,fontSize:parseInt(f.fontSize,10),fontFamily:f.fontFamily}}}];return{key:`${ul.COMPONENT.BAR_OOB_LABEL}-${n}-${w}`,type:"labels",layout:{minimumLayoutMode:Bc.VALUE_LABEL},settings:{sources:O}}},ky=({chart:e,models:t,viewState:n,viewCache:r})=>[dy({chart:e,models:t,viewState:n,viewCache:r,isPrimary:!0}),dy({chart:e,models:t,viewState:n,viewCache:r,isPrimary:!1})],Ry=({chart:e,models:t,viewState:n,viewCache:r})=>[my({chart:e,models:t,viewState:n,viewCache:r,isPrimary:!0}),my({chart:e,models:t,viewState:n,viewCache:r,isPrimary:!1})],Py=({chart:e,models:t,environment:n})=>{const{isBarSeriesStacked:r}=t.layoutService.meta;if(r){return[Sy({chart:e,models:t,environment:n,isPrimary:!0}),Sy({chart:e,models:t,environment:n,isPrimary:!1})]}return[xy({models:t,environment:n,isPrimary:!0}),xy({models:t,environment:n,isPrimary:!1})]},$y=({chart:e,models:t,viewCache:n,viewState:r})=>[wy({chart:e,models:t,type:"max",viewCache:n,viewState:r,isPrimary:!0}),wy({chart:e,models:t,type:"min",viewCache:n,viewState:r,isPrimary:!0}),wy({chart:e,models:t,type:"max",viewCache:n,viewState:r,isPrimary:!1}),wy({chart:e,models:t,type:"min",viewCache:n,viewState:r,isPrimary:!1})],Fy=({chart:e,models:t,viewCache:n,viewState:r})=>[Dy({chart:e,models:t,type:"max",viewCache:n,viewState:r,isPrimary:!0}),Dy({chart:e,models:t,type:"min",viewCache:n,viewState:r,isPrimary:!0}),Dy({chart:e,models:t,type:"max",viewCache:n,viewState:r,isPrimary:!1}),Dy({chart:e,models:t,type:"min",viewCache:n,viewState:r,isPrimary:!1})],zy=({chart:e,models:t})=>[Iy({chart:e,models:t,type:"max",isPrimary:!0}),Iy({chart:e,models:t,type:"min",isPrimary:!0}),Iy({chart:e,models:t,type:"max",isPrimary:!1}),Iy({chart:e,models:t,type:"min",isPrimary:!1})],_y=({chart:e,models:t,environment:n})=>[Ly({chart:e,models:t,type:"max",environment:n,isPrimary:!0}),Ly({chart:e,models:t,type:"min",environment:n,isPrimary:!0}),Ly({chart:e,models:t,type:"max",environment:n,isPrimary:!1}),Ly({chart:e,models:t,type:"min",environment:n,isPrimary:!1})],jy=({chart:e,environment:t,models:n,viewState:r,viewCache:i})=>{const{seriesModel:o}=n,a=o.query.series(cl.TYPE.BAR).slice(-1),s=o.query.series(cl.TYPE.LINE),l=o.query.series(cl.TYPE.MARKER);return[...ky({chart:e,models:n,viewState:r,viewCache:i}),...Ry({chart:e,models:n,viewState:r,viewCache:i}),...s.map((e=>fd({models:n,environment:t,series:e}))),...s.map((e=>vd({models:n,series:e,environment:t}))),...l.map((r=>cd({chart:e,models:n,series:r,environment:t}))),...s.map((r=>xd({chart:e,models:n,environment:t,series:r,lineSeries:s}))),...Py({chart:e,models:n,environment:t}),...$y({chart:e,models:n,viewCache:i,viewState:r}),...Fy({chart:e,models:n,viewCache:i,viewState:r}),...zy({chart:e,models:n}),..._y({chart:e,models:n,environment:t}),kd({chart:e,models:n,markerSeries:l,lineSeries:s,barSeries:a,environment:t,type:"max"}),kd({chart:e,models:n,markerSeries:l,lineSeries:s,barSeries:a,environment:t,type:"min"}),Ed({chart:e,models:n,environment:t,lineSeries:s})]},Hy={NONE:0,WIDE:1,MEDIUM:2,NARROW:3};function Vy({models:e}){const{dockService:t,seriesModel:n,layoutService:r,themeService:i}=e,{auto:o,spacing:a}=r.getLayoutValue("gridLine",{});if(!o&&a===Hy.NONE)return!1;const s=i.getStyles(),l=n.meta.primarySeries.length>0;return{key:ul.COMPONENT.GRID_LINE,type:"grid-line",layout:{minimumLayoutMode:Bc.GRID_LINE},preferredSize:()=>({size:0,edgeBleed:{left:1,right:1,top:1,bottom:1}}),ticks:{show:!(!o&&a===Hy.WIDE)||((e,t)=>t%2==0),stroke:s.grid.line.major.color},minorTicks:{show:!o&&a===Hy.NARROW,stroke:s.grid.line.minor.color},["horizontal"===t.meta.major.orientation?"y":"x"]:l?ul.SCALE.MINOR.PRIMARY:ul.SCALE.MINOR.SECONDARY}}function By({models:e}){const{primaryExtremumModel:t,primaryTickModel:n,themeService:r,dockService:i,seriesModel:o}=e,a=t.query.getExtrema();return!!(o.meta.primarySeries.length>0&&a.meta.includesZero)&&{key:ul.COMPONENT.ZERO_LINE,type:"ref-line",layout:{minimumLayoutMode:Bc.GRID_LINE},show:()=>n.query.getMin()<=0&&n.query.getMax()>=0,lines:{["horizontal"===i.meta.minor.orientation?"x":"y"]:[{value:0,scale:ul.SCALE.MINOR.PRIMARY,line:{stroke:r.getStyles().grid.line.highContrast.color}}]}}}function Uy({models:e}){const{layoutService:t,themeService:n}=e,{isContinuous:r,isTime:i}=t.meta;if(!r)return[];const o=n.getStyles(),a={type:"grid-line",layout:{minimumLayoutMode:Bc.GRID_LINE},ticks:{stroke:o.grid.line.major.color},minorTicks:{show:!1,stroke:o.grid.line.minor.color}};return i?[G(!0,{},a,{key:"time-inner-grid",x:{scale:ul.SCALE.MAJOR_INNER},ticks:{stroke:o.grid.line.minor.color}}),G(!0,{},a,{key:"time-outer-grid",x:{scale:ul.SCALE.MAJOR}})]:[G(!0,{},a,{key:"continuous-grid",x:{scale:ul.SCALE.MAJOR},minorTicks:{show:!0}})]}function Yy({models:e}){return[Vy({models:e}),By({models:e}),...Uy({models:e})]}function Wy({models:e,environment:t,actions:n}){const{layoutService:r,dockService:i,propertiesModel:o,appModel:a,genericObjectModel:s,styleModel:l}=e,u=o.query.getProperties(),c=r.getLayoutValue("dimensionAxis");if(!c)return!1;const{show:d}=c;if("all"!==d&&"title"!==d)return!1;const{orientation:m}=i.meta.major,f=l.query.axis.title.getStyle();return{type:"data-title",key:ul.COMPONENT.AXIS_TITLE.MAJOR,layout:{dock:i.meta.major.dock,minimumLayoutMode:Bc.AXIS_TITLE.MAJOR[m.toUpperCase()]},settings:{hyperCube:r.getHyperCube(),hyperCubeDef:u&&u.qHyperCubeDef,isDimension:!0,disabled:()=>!n.interact.enabled(),model:s,app:a,translator:t.translator,rtl:"rtl"===t.options.direction,selections:void 0},style:{fontFamily:f.fontFamily,fontSize:f.fontSize,color:f.color}}}const Gy=(e,t,n)=>e.query.seriesByAxis(n).map((e=>({...t[e.refIndex],explicitColumn:e.refIndex})));function Xy({models:e,environment:t,actions:n}){const{layoutService:r,dockService:i,seriesModel:o,propertiesModel:a,appModel:s,genericObjectModel:l,styleModel:u}=e,c=a.query.getProperties(),d=r.getLayoutValue("measureAxes");if(!d||!d.length)return[];const m=u.query.axis.title.getStyle(),{measureAxes:f}=o.meta;return f.filter((e=>e.isPrimary?"all"===d[0].show||"title"===d[0].show:"all"===d[1].show||"title"===d[1].show)).map((e=>{const a=r.getHyperCube(),{isPrimary:u}=e,d=o.query.seriesByAxis(u).length>1,f={type:"data-title",key:u?ul.COMPONENT.AXIS_TITLE.MINOR.PRIMARY:ul.COMPONENT.AXIS_TITLE.MINOR.SECONDARY,layout:{dock:u?i.meta.minor.dock:i.meta.minorSecondary.dock,minimumLayoutMode:Bc.AXIS_TITLE.MINOR},settings:{hyperCube:a,hyperCubeDef:c&&c.qHyperCubeDef,isDimension:!1,explicitItemInfos:Gy(o,a.qMeasureInfo,u),onChangeToAlternative:({oldItem:e,newItem:t})=>{t.qDef.series=e.qDef.series;const n=e.qAttributeExpressions.findIndex((e=>"colorByExpression"===e.id));if(-1!==n){const r=e.qAttributeExpressions.splice(n,1)[0];t.qAttributeExpressions.unshift(r)}},disabled:()=>!n.interact.enabled(),model:l,app:s,translator:t.translator,rtl:"rtl"===t.options.direction,selections:void 0,skipAttributeExpressions:!0},style:{fontFamily:m.fontFamily,fontSize:m.fontSize,color:m.color}};return d&&(f.settings.padding="0",f.settings.minWidth="auto"),f}))}function Ky({models:e,environment:t,actions:n}){return[Wy({models:e,environment:t,actions:n}),...Xy({models:e,environment:t,actions:n})]}function Jy({models:e,environment:t,viewState:n,viewCache:r}){const{discreteModel:i,layoutService:o,dockService:a,continuousModel:s,themeService:l}=e,{isSnapshot:u,isDiscrete:c,isContinuous:d}=o.meta,m="rtl"===t.options.direction;return!(u&&!d)&&function({layoutService:e,dockService:t,discrete:n,continuousDataModel:r,viewState:i,viewCache:o,themeService:a,rtl:s,scrollbarOverride:l,visualizeCache:u=!1,deviceType:c}){const d=Ju({layoutService:e,override:l});if(d.none)return!1;const{orientation:m}=t.meta.major,f={key:"scrollbar",type:"scrollbar",layout:{dock:"horizontal"===m?t.meta.minor.start:t.meta.minor.end,minimumLayoutMode:"XSMALL"},show:()=>e.meta.isContinuous?r.getDimensionCardinality()>1:n.query.getCanScroll(),settings:{orientation:m,rtl:s,isContinuous:e.meta.isContinuous,range:()=>Gu({layoutService:e,viewState:i,viewCache:o})}};d.bar&&(f.settings.style="slim",f.settings.size={area:"touch"===c?{max:16,min:16}:{max:8,min:8}},e.meta.isContinuous||(f.settings.size.thumb={min:4}));const p=a.getStyles();return p.color&&(f.style={standard:{thumb:{"border-color":p.color,opacity:.4},before:{background:p.color,opacity:.1},after:{background:p.color,opacity:.1}}}),e.meta.isDiscrete&&u&&(f.settings.injections=()=>[Wu({layoutService:e,discrete:n})]),f}({viewState:n,viewCache:r,discrete:i,continuousDataModel:s,layoutService:o,dockService:a,themeService:l,rtl:m,scrollbarOverride:{predicate:()=>c,value:Yu.OPTIONS.BAR.value},deviceType:t.deviceType})}function Zy({chart:e,models:t,viewState:n,viewCache:r,isPrimary:i}){const{layoutService:o}=t,a=dy({chart:e,models:t,viewState:n,viewCache:r,isPrimary:i});if(!a)return!1;const s=i?cl.AXIS.PRIMARY:cl.AXIS.SECONDARY;return a.key=`${ul.COMPONENT.MINI_CHART.BAR}-${s}`,a.data.collection=o.meta.isBarSeriesStacked?i?ul.COLLECTION.REDUCED_STACKED_PRIMARY:ul.COLLECTION.REDUCED_STACKED_SECONDARY:i?ul.COLLECTION.REDUCED_PRIMARY:ul.COLLECTION.REDUCED_SECONDARY,a.settings.box.minWidthPx=void 0,a.settings.minor.scale=i?ul.SCALE.MINOR.REDUCED_PRIMARY:ul.SCALE.MINOR.REDUCED_SECONDARY,a.settings.major.scale=ul.SCALE.REDUCED,a.layout={dock:"@scrollbar"},a}function Qy({environment:e,models:t}){const n=t.styleModel.query.line.getStrokeDasharrayFn();return t.seriesModel.query.series(cl.TYPE.LINE).map((r=>{const i=fd({models:t,environment:e,series:r});return i.key=id(ul.COMPONENT.MINI_CHART.LINE,r),i.data.collection=ul.COLLECTION.REDUCED,i.settings.coordinates.minor.scale=r.isPrimary?ul.SCALE.MINOR.REDUCED_PRIMARY:ul.SCALE.MINOR.REDUCED_SECONDARY,i.settings.coordinates.major.scale=ul.SCALE.REDUCED,i.settings.layers.line.strokeWidth=1,i.settings.layers.line.strokeDasharray=(...e)=>void 0===n(...e)?void 0:"1, 1",i.layout={dock:"@scrollbar"},i}))}function ev({models:e,environment:t}){return e.seriesModel.query.series(cl.TYPE.MARKER).map((n=>{const r=cd({models:e,environment:t,series:n});return r.key=id(ul.COMPONENT.MINI_CHART.MARKER,n),r.data.collection=ul.COLLECTION.REDUCED,r.settings.y.scale=n.isPrimary?ul.SCALE.MINOR.REDUCED_PRIMARY:ul.SCALE.MINOR.REDUCED_SECONDARY,r.settings.x.scale=ul.SCALE.REDUCED,r.layout={dock:"@scrollbar"},r}))}function tv({chart:e,models:t,viewState:n,viewCache:r,environment:i}){return Nc(t)?[Zy({chart:e,models:t,viewState:n,viewCache:r,isPrimary:!0}),Zy({chart:e,models:t,viewState:n,viewCache:r,isPrimary:!1}),...Qy({environment:i,models:t}),...ev({models:t,environment:i})]:[]}function nv({models:e}){const{layoutService:t,dockService:n}=e,{isContinuous:r,isTime:i}=t.meta,o=t.getLayoutValue("dimensionAxis");if(!o||"none"===o.show||"title"===o.show)return[!1];if(!r)return[!1];const a=Bc.AXIS.MAJOR[n.meta.major.orientation.toUpperCase()];return i?[{type:"axis-overlay",key:ul.COMPONENT.AXIS_OVERLAY.TIME_INNER,scale:ul.SCALE.MAJOR_INNER,layout:{dock:`@${ul.COMPONENT.AXIS.TIME_INNER}`,minimumLayoutMode:a}},{type:"axis-overlay",key:ul.COMPONENT.AXIS_OVERLAY.TIME_OUTER,scale:ul.SCALE.MAJOR,layout:{dock:`@${ul.COMPONENT.AXIS.TIME_OUTER}`,minimumLayoutMode:a}}]:[{type:"axis-overlay",key:ul.COMPONENT.AXIS_OVERLAY.CONTINUOUS,scale:ul.SCALE.MAJOR,layout:{dock:`@${ul.COMPONENT.AXIS.MAJOR_CONTINUOUS}`,minimumLayoutMode:a}}]}function rv({chart:e,models:t,environment:n}){const{refLineModel:r,layoutService:i,colorService:o,dockService:a,themeService:s,appLayoutModel:l,seriesModel:u}=t,c=l.qLocaleInfo,{options:d,theme:m}=n,f="rtl"===d.direction,p=u.query.series(cl.TYPE.BAR).filter((e=>e.isPrimary)),h=u.query.series(cl.TYPE.BAR).filter((e=>!e.isPrimary)),g=u.query.series(cl.TYPE.LINE),y=u.query.series(cl.TYPE.MARKER),v=u.query.all(),b=v.some((e=>e.isPrimary)),x=v.some((e=>!e.isPrimary)),M=b&&x,S={resolveUIColor:o.getPaletteColor},E=b?sl({refLineModel:r,layoutService:i,colorModel:S,dock:M?a.meta.minor.dock:a.meta.minor.opposite,scale:ul.SCALE.MINOR.PRIMARY,style:s.getStyles(),formatter:ul.FORMATTER.PRIMARY,theme:m,localeInfo:c,rtl:f,key:ul.COMPONENT.PRIMARY_MEASURE_AXIS_REF_LINE_LABEL}):[],C=x?sl({refLineModel:r,layoutService:i,colorModel:S,dock:M?a.meta.minor.opposite:a.meta.minor.dock,scale:ul.SCALE.MINOR.SECONDARY,style:s.getStyles(),formatter:ul.FORMATTER.SECONDARY,theme:m,localeInfo:c,rtl:f,key:ul.COMPONENT.SECONDARY_MEASURE_AXIS_REF_LINE_LABEL,path:"refLine.refLines2"}):[];return[!!b&&rl({refLineModel:r,layoutService:i,colorModel:S,dockService:a,chart:e,scale:ul.SCALE.MINOR.PRIMARY,axis:"horizontal"===a.meta.major.orientation?"y":"x",key:ul.COMPONENT.PRIMARY_MEASURE_AXIS_REF_LINE,minimumLayoutMode:Bc.REFERENCE_LINE}),!!x&&rl({refLineModel:r,layoutService:i,colorModel:S,dockService:a,chart:e,scale:ul.SCALE.MINOR.SECONDARY,axis:"horizontal"===a.meta.major.orientation?"y":"x",key:ul.COMPONENT.SECONDARY_MEASURE_AXIS_REF_LINE,path:"refLine.refLines2",minimumLayoutMode:Bc.REFERENCE_LINE}),rl({isDimension:!0,refLineModel:r,layoutService:i,colorModel:S,dockService:a,chart:e,scale:ul.SCALE.MAJOR,axis:"horizontal"===a.meta.major.orientation?"x":"y",rtl:f,key:ul.COMPONENT.DIMENSION_REF_LINE,mainComponentKey:p.length?`${ul.COMPONENT.BAR}-${cl.AXIS.PRIMARY}`:h.length?`${ul.COMPONENT.BAR}-${cl.AXIS.SECONDARY}`:g.length?`${ul.COMPONENT.LINE}-${g[0].id}`:y.length?`${ul.COMPONENT.MARKER}-${y[0].id}`:`${ul.COMPONENT.BAR}-${cl.AXIS.PRIMARY}`,minimumLayoutMode:Bc.REFERENCE_LINE}),...E,...C,...sl({isDimension:!0,refLineModel:r,layoutService:i,colorModel:S,dock:a.meta.major.opposite,scale:ul.SCALE.MAJOR,style:s.getStyles(),theme:m,localeInfo:c,rtl:f,key:ul.COMPONENT.DIMENSION_REF_LINE_LABEL})]}function iv(e){return"NaN"===e.qMin&&"NaN"===e.qMax}var ov=[{key:"NoDataExist",alignment:"center",condition:({layoutService:e})=>{const{x:t,y:n}=e.meta.size;return t*n==0}},{key:"OnlyNanData",alignment:"center",condition:({layoutService:e})=>{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:"OnlyNanData",alignment:"center",condition:({layoutService:e})=>e.getHyperCubeValue("qMeasureInfo").every(iv)},{key:"DataRangeIncludingZero",alignment:"bottom",condition:({layoutService:e,primaryExtremumModel:t,secondaryExtremumModel:n,flags:r})=>{if(!1===e.getLayout().showDisclaimer&&r.isEnabled("SHOW_DISCLAIMER"))return!1;const i=e.getLayoutValue("measureAxis.logarithmic",!1),o=t.query.getExtrema(),a=n.query.getExtrema();return i&&(o.meta.includesZero||a.meta.includesZero)}}];function av({environment:e,models:t}){const{flags:n,translator:r,options:i}=e,{layoutService:o,primaryExtremumModel:a,secondaryExtremumModel:s,themeService:l}=t,u=function({layoutService:e,primaryExtremumModel:t,secondaryExtremumModel:n,flags:r}){let i,o;for(let a=0,s=ov.length;a<s;a++){i=ov[a];try{o=i.condition({layoutService:e,primaryExtremumModel:t,secondaryExtremumModel:n,flags:r})}catch(e){throw Error("failing disclaimer condition",e)}if(o)return i}return!1}({layoutService:o,primaryExtremumModel:a,secondaryExtremumModel:s,flags:n});if(!u)return!1;const{fontFamily:c}=l.getStyles(),d=function(e,t,n,r={}){if(!e)return!1;const{translator:i}=t,{rtl:o}=n;return{key:"disclaimer",type:"disclaimer",layout:{dock:J[e].alignment},settings:{label:i.get(`Object.Disclaimer.${e}`),rtl:o},style:r}}(u.key,{translator:r},{rtl:"rtl"===i.direction},{fontFamily:c});return d}function sv({layoutService:e}){return!!Nc({layoutService:e})&&{type:"range",key:"range-brush-highlighter",layout:{dock:"@scrollbar"},settings:{scale:ul.SCALE.REDUCED,brush:"selection",fill:"#6CB33F",opacity:.2}}}function lv(e){return(null==e?void 0:e.type)||cl.TYPE.BAR}function uv({models:e,environment:t}){const{layoutService:n,colorService:r,dockService:i,seriesModel:o,selectionService:a}=e,{hasLineSeries:s,isContinuous:l,hasMultipleMeasures:u,isGroupedByMeasure:c}=n.meta;if(!s)return!1;const{options:d}=t,m=n.getLayoutValue("color",{}),f=e=>e.filter((e=>lv(e)===cl.TYPE.LINE)).map((e=>({key:id(ul.COMPONENT.LINE,e),typeIndex:e.typeIndex}))),p=!m.auto&&"byMeasure"===m.mode&&m.byMeasureDef&&void 0!==m.byMeasureDef.activeMeasureIndex,h=n.getHyperCubeValue("qMeasureInfo").map((e=>{var t;return null===(t=e.color)||void 0===t?void 0:t.on}));return{type:"brush-highlighter",key:"brush-highlighter",data:{collection:ul.COLLECTION.LINE},settings:{getSelectionInfo:()=>{var e;return(null==a||null===(e=a.getSelectionInfo)||void 0===e?void 0:e.call(a))||{}},seriesInfo:{primary:f(o.meta.primarySeries),secondary:f(o.meta.secondarySeries)},selectionValues:{"qHyperCube/qDimensionInfo/0":l?e=>e.value:e=>e.major.value,"qHyperCube/qDimensionInfo/0:numeric":e=>e.major.value,"qHyperCube/qDimensionInfo/0/qAttrExprInfo/0":e=>e.end.value,"qHyperCube/qMeasureInfo/X":e=>e.end.value},colorSettings:e=>r.getSettingsForMeasure(e),colorByData:e=>!h[e]&&p,hasMultipleMeasures:u,groupedByMeasure:c,itemsPerGroup:o.meta.barSeriesCount,orientation:i.meta.major.orientation,rtl:"rtl"===d.direction}}}function cv({models:{fieldModel:e}}){return{[ul.FORMATTER.PRIMARY]:{data:{fields:e.main.minorsPrimary}},[ul.FORMATTER.SECONDARY]:{data:{fields:e.main.minorsSecondary}}}}var dv={MAX_NUM_POINTS:5e4,DEFAULT_NUM_POINTS:2e3,DEFAULT_NUM_LINES:12};const{DEFAULT_NUM_POINTS:mv}=dv;function fv({layoutService:e,largeDataService:t}){const{maxNumPoints:n=mv}=(null==t?void 0:t.meta)||{},{qHyperCube:r}=e.getLayout();return r.qSize.qcy*r.qMeasureInfo.length>n}const{DEFAULT_NUM_LINES:pv}=dv,hv=({layoutService:e,largeDataService:t})=>{const{maxNumLines:n=pv}=(null==t?void 0:t.meta)||{},{qHyperCube:r}=e.getLayout();return r.qDimensionInfo.length>1&&!fv({layoutService:e,largeDataService:t})?e.meta.size.dimensions[1]+1:n},{DEFAULT_NUM_POINTS:gv}=dv,{MAX_NUM_POINTS:yv,DEFAULT_NUM_POINTS:vv,DEFAULT_NUM_LINES:bv}=dv,{DEFAULT_NUM_POINTS:xv}=dv,Mv=({layoutService:e,largeDataService:t})=>{if(!fv({layoutService:e,largeDataService:t})){const{maxNumPoints:e=xv}=(null==t?void 0:t.meta)||{};return e}const{dimensionCount:n}=e.meta;return n>1?(({layoutService:e,largeDataService:t})=>{var n;const{dimensions:r=[]}=(null==e||null===(n=e.meta)||void 0===n?void 0:n.size)||{},{maxNumLines:i=bv,maxNumPoints:o=vv,hasInjectedData:a=!1}=(null==t?void 0:t.meta)||{};if(hv({layoutService:e,largeDataService:t})*r[0]<=o)return r[0];const s=Math.max(1,Math.min(i,r[1])),l=o/s,u=Math.floor(r[0]<=l?l:l/4),c=2*s*(s+1);return a&&(s>bv||o>vv)?Math.min(u,Math.ceil(yv/c)):u})({layoutService:e,largeDataService:t}):(({layoutService:e,largeDataService:t})=>{const{maxNumPoints:n=gv}=(null==t?void 0:t.meta)||{},{measureCount:r=1}=(null==e?void 0:e.meta)||{},i=4+2*(r-1);return Math.floor(n/(r*i))})({layoutService:e,largeDataService:t})},Sv=({start:e,end:t,model:n,layoutService:r,largeDataService:i,definitionPath:o})=>{const a={qStart:e,qEnd:t,qNbrPoints:Mv({layoutService:r,largeDataService:i}),qMaxNbrTicks:300,qMaxNumberLines:hv({layoutService:r,largeDataService:i})};return n.getHyperCubeContinuousData(o,a,!1)};function Ev({model:e,layoutService:t,largeDataService:n,definitionPath:r="/qHyperCubeDef"}){return{shouldFetchReduced:()=>fv({layoutService:t,largeDataService:n}),computeNbrOfBins:()=>Mv({layoutService:t,largeDataService:n}),computeMaxNumberLines:()=>hv({layoutService:t,largeDataService:n}),fetch:(i,o)=>Sv({start:i,end:o,model:e,layoutService:t,largeDataService:n,definitionPath:r})}}function Cv(e={}){const{cache:t={}}=e;return{fetch:()=>Promise.resolve(t.merged)}}function qv({layoutService:e,viewCache:t}){return{fetch:()=>{const{qAxisData:t,qDataPages:n}=e.getHyperCube();return Promise.resolve({qAxisData:t,qDataPages:n})},getSnapshotData(){const n=e.getLayoutValue("snapshotData.content.chartData",{});return"zoom"in n&&"min"in n.zoom&&"max"in n.zoom?function({zoom:e}){return{zoom:e}}(n):function({scrollOffset:e=0,viewRange:t=0},n){let r=n+e,i=r+t;return 1===t&&0===e&&(r=n-.5,i=n+.5),{zoom:{min:r,max:i}}}(n,t.get("continuousMin"))}}}function wv(){const e=()=>{},t=[],n={};return e.set=(e,r)=>{const i=t.indexOf(e);i>-1&&t.splice(i,1),t.push(e),n[e]=r},e.forEach=e=>{t.forEach(((t,r)=>e(n[t],r)))},e.has=e=>e in n,e}function Av(e,t,n){return n[0]&&n[0][1]&&n[0][1].qElemNumber>-1?function({start:e,end:t,matrix:n}){const r=[],i=wv(),o=wv();for(let a=0;a<n.length;a++){const s=n[a],l=s[1].qElemNumber.toString();s[0].qNum<e?i.set(l,s):s[0].qNum>t&&(o.has(l)||o.set(l,s)),s[0].qNum>=e&&s[0].qNum<=t&&r.push(s)}return i.forEach(((e,t)=>r.splice(t,0,e))),o.forEach((e=>r.push(e))),r}({start:e,end:t,matrix:n}):function({start:e,end:t,matrix:n}){const r=[];let i,o;for(let a=0;a<n.length;a++){const s=n[a];s[0].qNum<e?i=s:s[0].qNum>t&&(o||(o=s)),s[0].qNum>=e&&s[0].qNum<=t&&r.push(s)}return i&&r.unshift(i),o&&r.push(o),r}({start:e,end:t,matrix:n})}function Ov(e,t){return{...e,qWidth:t[0]?t[0].length:0,qHeight:t.length}}function Dv(e,t,n){const r={qDataPages:(n.qDataPages||[]).map((n=>{const r=Av(e,t,n.qMatrix),i=Ov(n.qArea,r);return{...n,qArea:i,qMatrix:r}}))};return n.qAxisData&&n.qAxisData.qAxis&&(r.qAxisData=function(e,t,n){return{qAxis:n.qAxis.map((n=>({qName:n.qName,qTags:n.qTags,qTicks:n.qTicks.reduce(((n,r)=>((r.qStart>=e&&r.qStart<=t||r.qEnd>=e&&r.qEnd<=t||r.qStart<e&&r.qEnd>t)&&n.push(r),n)),[])})))}}(e,t,n.qAxisData)),r}const Nv=2**.5,Iv=1/Nv,Tv=1e-6,Lv=Iv**44;function kv(e){return e.qIsOtherCell}function Rv({qDataPages:e=[]}={},t={}){const n=e.length?e[0].qMatrix:[];return t.isStackedByDimension?function(e){const t={};return e.forEach((e=>{if(!e.some(kv)){const n=e[0].qElemNumber;t[n]=void 0}})),Object.keys(t).length}(n):function(e){let t=0;return e.forEach((e=>{e.some(kv)||t++})),t}(n)}const Pv={query:{getShouldProcess:()=>!1},command:{processDataPage:()=>{}}};var $v=Object.prototype.hasOwnProperty,Fv=Object.prototype.toString,zv=Object.defineProperty,_v=Object.getOwnPropertyDescriptor,jv=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===Fv.call(e)},Hv=function(e){if(!e||"[object Object]"!==Fv.call(e))return!1;var t,n=$v.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&$v.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||$v.call(e,t)},Vv=function(e,t){zv&&"__proto__"===t.name?zv(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},Bv=function(e,t){if("__proto__"===t){if(!$v.call(e,t))return;if(_v)return _v(e,t).value}return e[t]};function Uv(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Yv(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Wv(){}!function(e){e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")&&e.default}((function e(){var t,n,r,i,o,a,s=arguments[0],l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l<u;++l)if(null!=(t=arguments[l]))for(n in t)r=Bv(s,n),s!==(i=Bv(t,n))&&(c&&i&&(Hv(i)||(o=jv(i)))?(o?(o=!1,a=r&&jv(r)?r:[]):a=r&&Hv(r)?r:{},Vv(s,{name:n,newValue:e(c,a,i)})):void 0!==i&&Vv(s,{name:n,newValue:i}));return s}));var Gv=1/.7,Xv="\\s*([+-]?\\d+)\\s*",Kv="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Jv="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Zv=/^#([0-9a-f]{3,8})$/,Qv=new RegExp(`^rgb\\(${Xv},${Xv},${Xv}\\)$`),eb=new RegExp(`^rgb\\(${Jv},${Jv},${Jv}\\)$`),tb=new RegExp(`^rgba\\(${Xv},${Xv},${Xv},${Kv}\\)$`),nb=new RegExp(`^rgba\\(${Jv},${Jv},${Jv},${Kv}\\)$`),rb=new RegExp(`^hsl\\(${Kv},${Jv},${Jv}\\)$`),ib=new RegExp(`^hsla\\(${Kv},${Jv},${Jv},${Kv}\\)$`),ob={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 ab(){return this.rgb().formatHex()}function sb(){return this.rgb().formatRgb()}function lb(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Zv.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?ub(t):3===n?new fb(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?cb(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?cb(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=Qv.exec(e))?new fb(t[1],t[2],t[3],1):(t=eb.exec(e))?new fb(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=tb.exec(e))?cb(t[1],t[2],t[3],t[4]):(t=nb.exec(e))?cb(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=rb.exec(e))?bb(t[1],t[2]/100,t[3]/100,1):(t=ib.exec(e))?bb(t[1],t[2]/100,t[3]/100,t[4]):ob.hasOwnProperty(e)?ub(ob[e]):"transparent"===e?new fb(NaN,NaN,NaN,0):null}function ub(e){return new fb(e>>16&255,e>>8&255,255&e,1)}function cb(e,t,n,r){return r<=0&&(e=t=n=NaN),new fb(e,t,n,r)}function db(e){return e instanceof Wv||(e=lb(e)),e?new fb((e=e.rgb()).r,e.g,e.b,e.opacity):new fb}function mb(e,t,n,r){return 1===arguments.length?db(e):new fb(e,t,n,null==r?1:r)}function fb(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function pb(){return`#${vb(this.r)}${vb(this.g)}${vb(this.b)}`}function hb(){const e=gb(this.opacity);return`${1===e?"rgb(":"rgba("}${yb(this.r)}, ${yb(this.g)}, ${yb(this.b)}${1===e?")":`, ${e})`}`}function gb(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function yb(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function vb(e){return((e=yb(e))<16?"0":"")+e.toString(16)}function bb(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Mb(e,t,n,r)}function xb(e){if(e instanceof Mb)return new Mb(e.h,e.s,e.l,e.opacity);if(e instanceof Wv||(e=lb(e)),!e)return new Mb;if(e instanceof Mb)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,s=o-i,l=(o+i)/2;return s?(a=t===o?(n-r)/s+6*(n<r):n===o?(r-t)/s+2:(t-n)/s+4,s/=l<.5?o+i:2-o-i,a*=60):s=l>0&&l<1?0:a,new Mb(a,s,l,e.opacity)}function Mb(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function Sb(e){return(e=(e||0)%360)<0?e+360:e}function Eb(e){return Math.max(0,Math.min(1,e||0))}function Cb(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}Uv(Wv,lb,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:ab,formatHex:ab,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return xb(this).formatHsl()},formatRgb:sb,toString:sb}),Uv(fb,mb,Yv(Wv,{brighter(e){return e=null==e?Gv:Math.pow(Gv,e),new fb(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new fb(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new fb(yb(this.r),yb(this.g),yb(this.b),gb(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:pb,formatHex:pb,formatHex8:function(){return`#${vb(this.r)}${vb(this.g)}${vb(this.b)}${vb(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:hb,toString:hb})),Uv(Mb,(function(e,t,n,r){return 1===arguments.length?xb(e):new Mb(e,t,n,null==r?1:r)}),Yv(Wv,{brighter(e){return e=null==e?Gv:Math.pow(Gv,e),new Mb(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new Mb(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,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new fb(Cb(e>=240?e-240:e+120,i,r),Cb(e,i,r),Cb(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Mb(Sb(this.h),Eb(this.s),Eb(this.l),gb(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=gb(this.opacity);return`${1===e?"hsl(":"hsla("}${Sb(this.h)}, ${100*Eb(this.s)}%, ${100*Eb(this.l)}%${1===e?")":`, ${e})`}`}}));const qb=Math.PI/180,wb=180/Math.PI,Ab=4/29,Ob=6/29,Db=3*Ob*Ob;function Nb(e){if(e instanceof Ib)return new Ib(e.l,e.a,e.b,e.opacity);if(e instanceof Pb)return $b(e);e instanceof fb||(e=db(e));var t,n,r=Rb(e.r),i=Rb(e.g),o=Rb(e.b),a=Tb((.2225045*r+.7168786*i+.0606169*o)/1);return r===i&&i===o?t=n=a:(t=Tb((.4360747*r+.3850649*i+.1430804*o)/.96422),n=Tb((.0139322*r+.0971045*i+.7141733*o)/.82521)),new Ib(116*a-16,500*(t-a),200*(a-n),e.opacity)}function Ib(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function Tb(e){return e>.008856451679035631?Math.pow(e,1/3):e/Db+Ab}function Lb(e){return e>Ob?e*e*e:Db*(e-Ab)}function kb(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Rb(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Pb(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function $b(e){if(isNaN(e.h))return new Ib(e.l,0,0,e.opacity);var t=e.h*qb;return new Ib(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}Uv(Ib,(function(e,t,n,r){return 1===arguments.length?Nb(e):new Ib(e,t,n,null==r?1:r)}),Yv(Wv,{brighter(e){return new Ib(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new Ib(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 fb(kb(3.1338561*(t=.96422*Lb(t))-1.6168667*(e=1*Lb(e))-.4906146*(n=.82521*Lb(n))),kb(-.9787684*t+1.9161415*e+.033454*n),kb(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),Uv(Pb,(function(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof Pb)return new Pb(e.h,e.c,e.l,e.opacity);if(e instanceof Ib||(e=Nb(e)),0===e.a&&0===e.b)return new Pb(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*wb;return new Pb(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new Pb(e,t,n,null==r?1:r)}),Yv(Wv,{brighter(e){return new Pb(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new Pb(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return $b(this).rgb()}}));var Fb,zb=e=>()=>e;function _b(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):zb(isNaN(e)?t:e)}function jb(e,t,n){if(void 0===e||void 0===t)return n;for(var r=t.split("."),i=e,o=0;o<r.length;++o){var a=r[o];if(void 0===i[a])return n;i=i[a]}return i}function Hb(e){var t=0,n=e.children,r=n&&n.length;if(r)for(;--r>=0;)t+=n[r].value;else t=1;e.value=t}function Vb(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=Ub)):void 0===t&&(t=Bb);for(var n,r,i,o,a,s=new Gb(e),l=[s];n=l.pop();)if((i=t(n.data))&&(a=(i=Array.from(i)).length))for(n.children=i,o=a-1;o>=0;--o)l.push(r=i[o]=new Gb(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(Wb)}function Bb(e){return e.children}function Ub(e){return Array.isArray(e)?e[1]:null}function Yb(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function Wb(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function Gb(e){this.data=e,this.depth=this.height=0,this.parent=null}!function e(t){var n=function(e){return 1==(e=+e)?_b: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(r){return Math.pow(e+r*t,n)}}(t,n,e):zb(isNaN(t)?n:t)}}(t);function r(e,t){var r=n((e=mb(e)).r,(t=mb(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),a=_b(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=o(t),e.opacity=a(t),e+""}}return r.gamma=e,r}(1),Gb.prototype=Vb.prototype={constructor:Gb,count:function(){return this.eachAfter(Hb)},each:function(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this},eachAfter:function(e,t){for(var n,r,i,o=this,a=[o],s=[],l=-1;o=a.pop();)if(s.push(o),n=o.children)for(r=0,i=n.length;r<i;++r)a.push(n[r]);for(;o=s.pop();)e.call(t,o,++l,this);return this},eachBefore:function(e,t){for(var n,r,i=this,o=[i],a=-1;i=o.pop();)if(e.call(t,i,++a,this),n=i.children)for(r=n.length-1;r>=0;--r)o.push(n[r]);return this},find:function(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r},sum:function(e){return this.eachAfter((function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].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(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r},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 Vb(this).eachBefore(Yb)},[Symbol.iterator]:function*(){var e,t,n,r,i=this,o=[i];do{for(e=o.reverse(),o=[];i=e.pop();)if(yield i,t=i.children)for(n=0,r=t.length;n<r;++n)o.push(t[n])}while(o.length)}},Fb=function(e){
14
+ /*! javascript-number-formatter - v1.1.11 - http://mottie.github.com/javascript-number-formatter/ * © ecava */
15
+ e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,a,s,l,u,c,d,m=e.length,f=e.search(/[0-9\-\+#]/),p=f>0?e.substring(0,f):"",h=e.split("").reverse().join(""),g=h.search(/[0-9\-\+#]/),y=m-g,v=e.substring(y,y+1),b=y+("."===v||","===v?1:0),x=g>0?e.substring(b,m):"";if(n=(t="-"===(e=e.substring(f,b)).charAt(0)?-t:+t)<0?t=-t:0,i=(r=e.match(/[^\d\-\+#]/g))&&r[r.length-1]||".",o=r&&r[1]&&r[0]||",",e=e.split(i),t=+(t=t.toFixed(e[1]&&e[1].length))+"",s=e[1]&&e[1].lastIndexOf("0"),(!(u=t.split("."))[1]||u[1]&&u[1].length<=s)&&(t=(+t).toFixed(s+1)),c=e[0].split(o),e[0]=c.join(""),(a=e[0]&&e[0].indexOf("0"))>-1)for(;u[0].length<e[0].length-a;)u[0]="0"+u[0];else 0==+u[0]&&(u[0]="");if((t=t.split("."))[0]=u[0],l=c[1]&&c[c.length-1].length){for(h="",y=(d=t[0]).length%l,m=d.length,b=0;b<m;b++)h+=d.charAt(b),!((b-y+1)%l)&&b<m-l&&(h+=o);t[0]=h}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),p+(n?"-":"")+r+x}},Fb({exports:{}});var Xb={created(){this.state={}},beforeUpdate(){this.state={}},beforeRender({size:e}){this.state.ticks=this.scale.ticks({distance:e.width}).filter((e=>!e.isMinor)),"linear"===this.scale.type&&function(e,t){const[,n]=e.domain();for(let e=0;e<t.length;e++){const r=t[e],i=t[e+1];r.data={},i||1===r.end?i?(r.data.start=r.value,r.data.end=i.value,r.end=i.position):(r.data.start=r.value,r.data.end=r.value):(r.data.start=r.value,r.data.end=n,r.end=1)}}(this.scale,this.state.ticks)},render(){const e=this.scale.data().fields.length?this.scale.data().fields[0].id():"",{ticks:t}=this.state,n=t.map((t=>({type:"rect",fill:"none",data:{source:{field:e},value:[t.data.start,t.data.end]},x:t.start*this.rect.width,y:0,width:(t.end-t.start)*this.rect.width,height:this.rect.height})));if(t.length&&t[0].start>0){const r=t[0];n.unshift({type:"rect",fill:"none",data:{source:{field:e},value:[this.scale.domain()[0],r.data.start]},x:0,y:0,width:r.start*this.rect.width,height:this.rect.height})}return n}};const Kb="…";function Jb(e,t=1){if(t%2==0)return e;let n=Math.round(e);return e-n>0?n+=.5:n-=.5,n}function Zb(e,t){const{localProps:{size:n},props:{anchor:r}}=t,i=function({props:e,localProps:{size:t},style:n,renderer:r}){const i=e.label.padding,o=Math.max(0,Math.min(e.label.justify,1)),a=Math.max(0,Math.min(e.label.align,1)),s=e=>r.measureText({text:e,fontSize:n.label.fontSize,fontFamily:n.label.fontFamily});return{resolve:(e,r)=>{const l="string"==typeof e.label?e.label:"",u=s(l);let{x:c,width:d}=r;e.start===e.end&&(d=u.width+2*i,1===e.end&&(c-=d));const m={x:c+i,y:i,width:d-2*i,height:t.height-2*i},f=s(`${l[0]}${Kb}`).width,p=Math.max(0,m.width-u.width),h=Math.max(0,m.height-u.height),g=o*p,y=a*h;return{show:m.width>=Math.min(f,u.width),text:l,dx:g,dy:y,rect:m,style:n.label,segment:{x:c+g,width:u.width+2*i},tickValue:e.value}}}}(t),o=function({localProps:{size:e},style:t,scale:n,props:r}){const[i,o]=n.domain(),a=Math.max(0,Math.min(1,r.guideLine.major.justify));return{resolve:(n,r)=>{const s=a*r.width,l=Jb(r.x+s,t.majorGuideLine.strokeWidth);return{show:n.value>=i&&n.value<=o,x1:l,y1:0,x2:l,y2:Jb(e.height,t.majorGuideLine.strokeWidth),style:t.majorGuideLine,tickValue:n.value}}}}(t),a=e.map((e=>{const t=function(e,t,n){const r=Math.abs(Math.max(e.start,0)-Math.min(e.end,1))*t.width;return{x:Math.max(e[n],0)*t.width,y:0,width:r,height:t.height}}(e,n,r);return{rect:t,label:i.resolve(e,t),guideLine:o.resolve(e,t)}}));return function(e,t){const n=e.length;if(n<2)return;const r=e[n-1],i=t[n-1].label;if(r&&r.start===r.end)for(let e=n-2;e>-1;e--){const n=t[e].label;n.show=n.show&&(o=n.segment,a=i.segment,!(o.x<a.x?o.x+o.width>=a.x:a.x+a.width>=o.x))}var o,a}(e,a),a}function Qb(e,t){const n=function({localProps:{size:e},props:t,style:n}){return{resolve:r=>{const i=Math.max(e.height-t.guideLine.minor.size,0)*Math.max(0,Math.min(t.guideLine.minor.align,1)),o=Jb(r.position*e.width,n.minorGuideLine.strokeWidth);return{guideLine:{show:!0,x1:o,y1:Jb(i,n.minorGuideLine.strokeWidth),x2:o,y2:Jb(t.guideLine.minor.size+i,n.minorGuideLine.strokeWidth),style:n.minorGuideLine}}}}}(t);return t.props.guideLine.minor.show?e.map(n.resolve):[]}function ex(e){return e.filter((e=>e.show)).map((e=>G({strokeWidth:1},e.style,{type:"line",x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,tickValue:e.tickValue})))}var tx={require:["renderer"],defaultSettings:{layout:{displayOrder:0,prioOrder:0},settings:{anchor:"start",label:{show:!0,padding:4,align:0,justify:0},line:{show:!0},guideLine:{major:{justify:0},minor:{show:!0,size:4,align:0}}},style:{label:"$label",line:"$guide-line",majorGuideLine:"$guide-line",minorGuideLine:"$guide-line"}},preferredSize:()=>({size:30,edgeBleed:{left:1,right:1}}),init(){this.props=this.settings.settings,this.localProps={},this.state={major:[],minor:[]}},created(){this.init()},beforeUpdate(){this.init()},beforeRender({size:e}){this.localProps.size=e;const t=this.scale.ticks({distance:e.width}),n=t.filter((e=>!e.isMinor)),r=t.filter((e=>e.isMinor));this.state.line=function({localProps:{size:e},style:t,props:n}){const r=Jb(1,t.line.strokeWidth);return{show:n.line.show,x1:Jb(0,t.line.strokeWidth),y1:r,x2:Jb(e.width,t.line.strokeWidth),y2:r,style:t.line}}(this),this.state.major=Zb(n,this),this.state.minor=Qb(r,this)},render(){return[...ex([this.state.line]),...(e=this.state.major.map((e=>e.label)),e.filter((e=>e.show)).map((e=>G({},e.style,{type:"text",x:e.rect.x,y:e.rect.y,dx:e.dx,dy:e.dy,maxWidth:e.rect.width,text:e.text,title:e.text,baseline:"text-before-edge",tickValue:e.tickValue})))),...ex(this.state.major.map((e=>e.guideLine))),...ex(this.state.minor.map((e=>e.guideLine)))];var e}};function nx(e,t){return e&&t&&e.qTicks.length===t.qTicks.length&&e.qTicks.every(((e,n)=>e.qStart===t.qTicks[n].qStart&&e.qEnd===t.qTicks[n].qEnd))}function rx(e){return e.qTags.indexOf("$qualified")>-1}function ix({qAxis:e}){const t=[],n=[];for(let r=0;r<e.length;r++){const i=r+1,o=e[r],a=e[i];nx(o,a)?(rx(a)?(t.push(i),n.push(r)):(t.push(r),n.push(i)),r++):(t.push(r),n.push(r))}return{qualified:t,nonQualified:n}}function ox({qualifiedMeta:e,nonQualifiedMeta:t}){return{resolve(n){let r,i=NaN,o=NaN,a=NaN,s=!1;for(let l=e.length-1;l>=0;l--){const u=e[l];if(u.queries.outer(n)){const e=t[l+1];if(i=u.index,r=l,u.attrs.isDayOrShorter()&&u.queries.canFitHalfDayTicks(n)){o="auto",s=!0;break}if(e&&e.queries.inner(n)){o=e.index;const r=t[l+2];r&&r.queries.minor(n)&&(a=r.index);break}}}if(!Number.isNaN(i)&&Number.isNaN(o)&&"auto"!==o){o=i,i=NaN;const e=t[r+1];e&&e.queries.minor(n)&&(a=e.index)}else Number.isNaN(i)&&(i="auto",o="auto");return{outer:i,inner:o,minor:a,isDayOrShorter:s}}}}const ax=16;function sx({qTicks:e,measureText:t=(()=>({width:0})),cache:n={},scale:r}){const i=n;return{isDayOrShorter:()=>(i.isDayOrShorter=e.length>0&&Math.abs(e[0].qStart-e[0].qEnd)<=1,i.isDayOrShorter),count:()=>e.length,maxRange:()=>(i.maxRange=e.length?Math.max(...e.map((e=>Math.abs(r(e.qStart)-r(e.qEnd))))):0,i.maxRange),rangeAndWidth(){const n=r.clamp();return r.clamp(!1),i.rangeAndWidth=e.map((e=>({range:Math.abs(r(e.qStart)-r(e.qEnd)),width:t(`${e.qText}`).width+ax}))),r.clamp(n),i.rangeAndWidth}}}const lx=6;function ux({attrs:e,reqAutoFitWidth:t}){return{outer:t=>!e.rangeAndWidth().some((({width:e,range:n})=>e>n*t)),inner:t=>!e.rangeAndWidth().some((({width:e,range:n})=>e>n*t)),minor:t=>e.maxRange()*t>=lx,canFitHalfDayTicks:n=>n>=t*e.count()}}function cx({qualified:e,nonQualified:t,qAxis:n,measureText:r,reqAutoFitWidth:i,scale:o},{attributesFactory:a=sx,queryFactory:s=ux}={attributesFactory:sx,queryFactory:ux}){const l=n.map(((e,t)=>function(e,t){const{qTicks:n}=e,l=a({qTicks:n,measureText:r,scale:o});return{data:e,index:t,attrs:l,queries:s({attrs:l,reqAutoFitWidth:i})}}(e,t))),u=e.map((e=>l[e])),c=t.map((e=>l[e]));return{qAxisMeta:l,qualifiedMeta:u,nonQualifiedMeta:c}}function dx({qAxis:e=[],measureText:t=(()=>({width:0})),cache:n={},reqAutoFitWidth:r=0,scale:i},{metaFactory:o=cx,mapper:a=ix,resolver:s=ox}={metaFactory:cx,mapper:ix,resolver:ox}){const{qualified:l,nonQualified:u}=a({qAxis:e}),{qualifiedMeta:c,nonQualifiedMeta:d}=o({qAxis:e,qualified:l,nonQualified:u,measureText:t,reqAutoFitWidth:r,scale:i}),m=s({qualifiedMeta:c,nonQualifiedMeta:d});return{resolve:t=>{const r=n.key({distance:t});if(n.get(r))return n.get(r);if(function(e){return!Array.isArray(e)||0===e.length||e.every((e=>0===e.qTicks.length))}(e))return{outer:"auto",inner:"auto",minor:NaN,isDayOrShorter:!1};const i=m.resolve(t);return n.set(r,i),i}}}const mx=86400,fx=864e5;function px(e){return new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,0,Math.round(fx*(e-Math.floor(e)))))}const hx=px(0).getTime();function gx(e){return(e.getTime()-hx)/mx/1e3}var yx=new Date,vx=new Date;function bx(e,t,n,r){function i(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return i.floor=function(t){return e(t=new Date(+t)),t},i.ceil=function(n){return e(n=new Date(n-1)),t(n,1),e(n),n},i.round=function(e){var t=i(e),n=i.ceil(e);return e-t<n-e?t:n},i.offset=function(e,n){return t(e=new Date(+e),null==n?1:Math.floor(n)),e},i.range=function(n,r,o){var a,s=[];if(n=i.ceil(n),o=null==o?1:Math.floor(o),!(n<r&&o>0))return s;do{s.push(a=new Date(+n)),t(n,o),e(n)}while(a<n&&n<r);return s},i.filter=function(n){return bx((function(t){if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)}),(function(e,r){if(e>=e)if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););}))},n&&(i.count=function(t,r){return yx.setTime(+t),vx.setTime(+r),e(yx),e(vx),Math.floor(n(yx,vx))},i.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?i.filter(r?function(t){return r(t)%e==0}:function(t){return i.count(0,t)%e==0}):i:null}),i}var xx=36e5,Mx=bx((function(e){e.setTime(e-e.getMilliseconds())}),(function(e,t){e.setTime(+e+1e3*t)}),(function(e,t){return(t-e)/1e3}),(function(e){return e.getUTCSeconds()})),Sx=Mx;Mx.range;var Ex=bx((function(e){e.setUTCSeconds(0,0)}),(function(e,t){e.setTime(+e+6e4*t)}),(function(e,t){return(t-e)/6e4}),(function(e){return e.getUTCMinutes()})),Cx=Ex;Ex.range;var qx=bx((function(e){e.setUTCMinutes(0,0,0)}),(function(e,t){e.setTime(+e+t*xx)}),(function(e,t){return(t-e)/xx}),(function(e){return e.getUTCHours()})),wx=qx;qx.range;var Ax=bx((function(e){e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+t)}),(function(e,t){return(t-e)/864e5}),(function(e){return e.getUTCDate()-1})),Ox=Ax;function Dx(e){return bx((function(t){t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+7*t)}),(function(e,t){return(t-e)/6048e5}))}Ax.range;var Nx=Dx(0),Ix=Dx(1),Tx=Dx(2),Lx=Dx(3),kx=Dx(4),Rx=Dx(5),Px=Dx(6);Nx.range,Ix.range,Tx.range,Lx.range,kx.range,Rx.range,Px.range;var $x=bx((function(e){e.setUTCDate(1),e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCMonth(e.getUTCMonth()+t)}),(function(e,t){return t.getUTCMonth()-e.getUTCMonth()+12*(t.getUTCFullYear()-e.getUTCFullYear())}),(function(e){return e.getUTCMonth()})),Fx=$x;$x.range;var zx=bx((function(e){e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCFullYear(e.getUTCFullYear()+t)}),(function(e,t){return t.getUTCFullYear()-e.getUTCFullYear()}),(function(e){return e.getUTCFullYear()}));zx.every=function(e){return isFinite(e=Math.floor(e))&&e>0?bx((function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n*e)})):null};var _x=zx;zx.range;const jx={second:1,minute:2,hour:3,day:4,month:5,year:6};function Hx({timeScale:e,labels:t,distance:n,isDayOrShorter:r,cache:i,timeOnly:o,initialMin:a}){const[s,l]=e.domain(),u=i.key({distance:n});let c;i.get(u,1)?c=i.get(u,1):(c=function(e,t,n,r,i,o){function a(e){return _x.filter((t=>(t.getUTCFullYear()-o.getUTCFullYear())%e==0))}const s=Sx.count(e,t),l=Cx.count(e,t),u=wx.count(e,t),c=Ox.count(e,t),d=Nx.count(e,t),m=Fx.count(e,t),f=_x.count(e,t),p=n/r.second.width-1,h=n/r.minute.width-1,g=n/r.date.width-1,y=n/r.year.width-1,v={type:"year",desc:"year",count:f,interval:_x.every(1),formatter:r.year.formatter,offset:e=>_x.offset(e,-1),floor:_x.floor};if(s<=p)v.type=jx.second,v.desc="second",v.count=s,v.interval=Sx.every(1),v.formatter=r.second.formatter,v.offset=e=>Sx.offset(e,-1),v.floor=Sx.floor;else if(s/2<=p)v.type=jx.second,v.desc="every other second",v.count=s/2,v.interval=Sx.every(2),v.formatter=r.second.formatter,v.offset=e=>Sx.offset(e,-2),v.floor=Sx.floor;else if(s/5<=p)v.type=jx.second,v.desc="every 5 second",v.count=s/5,v.interval=Sx.every(5),v.formatter=r.second.formatter,v.offset=e=>Sx.offset(e,-5),v.floor=Sx.floor;else if(s/15<=p)v.type=jx.second,v.desc="every 15 second",v.count=s/15,v.interval=Sx.every(15),v.formatter=r.second.formatter,v.offset=e=>Sx.offset(e,-15),v.floor=Sx.floor;else if(s/30<=p)v.type=jx.second,v.desc="every 30 second",v.count=s/30,v.interval=Sx.every(30),v.formatter=r.second.formatter,v.offset=e=>Sx.offset(e,-30),v.floor=Sx.floor;else if(l<=h)v.type=jx.minute,v.desc="minute",v.count=l,v.interval=Cx.every(1),v.formatter=r.minute.formatter,v.offset=e=>Cx.offset(e,-1),v.floor=Cx.floor;else if(l/2<=h)v.type=jx.minute,v.desc="every 2 minute",v.count=l/2,v.interval=Cx.every(2),v.formatter=r.minute.formatter,v.offset=e=>Cx.offset(e,-2),v.floor=Cx.floor;else if(l/5<=h)v.type=jx.minute,v.desc="every 5 minute",v.count=l/5,v.interval=Cx.every(5),v.formatter=r.minute.formatter,v.offset=e=>Cx.offset(e,-5),v.floor=Cx.floor;else if(l/10<=h)v.type=jx.minute,v.desc="every 10 minute",v.count=l/10,v.interval=Cx.every(10),v.formatter=r.minute.formatter,v.offset=e=>Cx.offset(e,-10),v.floor=Cx.floor;else if(l/15<=h)v.type=jx.minute,v.desc="every 15 minute",v.count=l/15,v.interval=Cx.every(15),v.formatter=r.minute.formatter,v.offset=e=>Cx.offset(e,-15),v.floor=Cx.floor;else if(l/30<=h)v.type=jx.minute,v.desc="every 30 minute",v.count=l/30,v.interval=Cx.every(30),v.formatter=r.minute.formatter,v.offset=e=>Cx.offset(e,-30),v.floor=Cx.floor;else if(u<=h)v.type=jx.hour,v.desc="hour",v.count=u,v.interval=wx.every(1),v.formatter=r.minute.formatter,v.offset=e=>wx.offset(e,-1),v.floor=wx.floor;else if(u/2<=h)v.type=jx.hour,v.desc="every 2 hour",v.count=u/2,v.interval=wx.every(2),v.formatter=r.minute.formatter,v.offset=e=>wx.offset(e,-2),v.floor=wx.floor;else if(u/3<=h)v.type=jx.hour,v.desc="every 3 hour",v.count=u/3,v.interval=wx.every(3),v.formatter=r.minute.formatter,v.offset=e=>wx.offset(e,-3),v.floor=wx.floor;else if(u/6<=h)v.type=jx.hour,v.desc="every 6 hour",v.count=u/6,v.interval=wx.every(6),v.formatter=r.minute.formatter,v.offset=e=>wx.offset(e,-6),v.floor=wx.floor;else if(u/12<=h||i)v.type=jx.hour,v.desc="every 12 hour",v.count=u/12,v.interval=wx.every(12),v.formatter=r.minute.formatter,v.offset=e=>wx.offset(e,-12),v.floor=wx.floor;else if(c<=g)v.type=jx.day,v.desc="day",v.count=c,v.interval=Ox.every(1),v.formatter=r.date.formatter,v.offset=e=>Ox.offset(e,-1),v.floor=Ox.floor;else if(c/2<=g)v.type=jx.day,v.desc="every 2 day",v.count=c/2,v.interval=Ox.every(2),v.formatter=r.date.formatter,v.offset=e=>Ox.offset(e,-2),v.floor=Ox.floor;else if(c/3<=g)v.type=jx.day,v.desc="every 3 day",v.count=c/3,v.interval=Ox.every(3),v.formatter=r.date.formatter,v.offset=e=>Ox.offset(e,-3),v.floor=Ox.floor;else if(d<=g)v.type=jx.day,v.desc="week",v.count=d,v.interval=Nx.every(1),v.formatter=r.date.formatter,v.offset=e=>Nx.offset(e,-1),v.floor=Ox.floor;else if(d/2<=g)v.type=jx.day,v.desc="every 2 week",v.count=d/2,v.interval=Nx.every(2),v.formatter=r.date.formatter,v.offset=e=>Nx.offset(e,-2),v.floor=Ox.floor;else if(m<=g)v.type=jx.month,v.desc="month",v.count=m,v.interval=Fx.every(1),v.formatter=r.date.formatter,v.offset=e=>Fx.offset(e,-1),v.floor=Ox.floor;else if(m/3<=g)v.type=jx.month,v.desc="quarter",v.count=m/3,v.interval=Fx.every(3),v.formatter=r.date.formatter,v.offset=e=>Fx.offset(e,-3),v.floor=Ox.floor;else if(m/6<=g)v.type=jx.month,v.desc="half year",v.count=m/6,v.interval=Fx.every(6),v.formatter=r.date.formatter,v.offset=e=>Fx.offset(e,-6),v.floor=Ox.floor;else if(f<=y)v.type=jx.year,v.desc="year",v.count=f,v.interval=_x.every(1),v.formatter=r.year.formatter,v.offset=e=>_x.offset(e,-1),v.floor=_x.floor;else if(f/2<=y)v.type=jx.year,v.desc="every 2 year",v.count=f/2,v.interval=a(2),v.formatter=r.year.formatter,v.offset=e=>_x.offset(e,-2),v.floor=_x.floor;else if(f/5<=y)v.type=jx.year,v.desc="every 5 year",v.count=f/5,v.interval=a(5),v.formatter=r.year.formatter,v.offset=e=>_x.offset(e,-5),v.floor=_x.floor;else if(f/10<=y)v.type=jx.year,v.desc="every 10 year",v.count=f/10,v.interval=a(10),v.formatter=r.year.formatter,v.offset=e=>_x.offset(e,-10),v.floor=_x.floor;else{const e=Math.floor(f/y);v.type=jx.year,v.desc="every nth year",v.count=e,v.interval=a(e),v.formatter=r.year.formatter,v.offset=t=>_x.offset(t,-e),v.floor=_x.floor}return v}(s,l,n,t.all(),r,a),i.set(u,c,1));const d=e.ticks(c.interval);d.length?s.getTime()!==d[0].getTime()&&d.unshift(c.offset(d[0])):d.push(c.floor(s));const m=d.map(((e,t,n)=>{const r=n[t+1]?n[t+1]-e:l-e;return{start:e,end:new Date(e.getTime()+r),formatter:c.formatter}}));let f=[];if(!o&&c.type<=jx.hour){const n=t.getFormat("date"),r=e.ticks(Ox.every(1));r.length&&s.getUTCDate()!==r[0].getUTCDate()&&r.unshift(Ox.offset(r[0],-1)),f=(r.length?r:[Ox.floor(s)]).map(((e,t,r)=>{const i=r[t+1]?r[t+1]-e:l-e;return{start:e,end:new Date(e.getTime()+i),formatter:n.formatter}}))}return{inner:m,outer:f}}const Vx=86400,Bx=1440,Ux={};function Yx(e,t,n,r){return{type:e,start:new Date(Date.UTC(...t)),end:new Date(Date.UTC(...n)),formatter:r}}function Wx(e,t,n){const{generator:r,anchor:i,clamp:o,level:a}=t.ticks,{qNumFormat:s}=t.formatter;e.clamp(o);const[l,u]=e.domain(),c=Lo().domain([px(l),px(u)]);c.clamp(o),c.range(t.invert?[1,0]:[0,1]);const d="object"==typeof r?r:{type:r};let m;m="d3"===d.type?(e,i)=>Hx({timeScale:c,labels:n,distance:e,isDayOrShorter:i,cache:t.cache,timeOnly:"T"===s.qType,initialMin:void 0===d.initialMin?c.domain()[0]:px(r.initialMin)}):e=>function(e,t,n,r,i,o=!1){if(Ux[[t,n,r,r,o]])return Ux[[t,n,r,r,o]];const a={year:e.getFormat("year"),date:e.getFormat("date"),minute:e.getFormat("minute"),second:e.getFormat("second")},s=px(n),l=s.getFullYear(),u=s.getMonth(),c=s.getDate(),d=r-n,m=t/(i-r),f=m/1440,p=m/Vx,h=366*m,g=3*m*30,y=a.second.width/p,v=a.minute.width/f,b=a.date.width/g,x=a.year.width/h;let M,S,E,C=0,q=0,w=null,A=null,O=null,D=null,N=null,I=null;const T={outer:[],inner:[]};for(y<1?(w=1,q=1/Vx):y<2?(w=2,q=1/Vx*2):y<5?(w=5,q=1/Vx*5):y<10?(w=10,q=1/Vx*10):y<30?(w=30,q=1/Vx*30):v<1?(A=1,q=1/Bx):v<2?(A=2,q=1/Bx*2):v<5?(A=5,q=1/Bx*5):v<10?(A=10,q=1/Bx*10):v<30?(A=30,q=1/Bx*30):v<60?(O=1,q=1/24):v<120?(O=2,q=2/24):v<360?(O=6,q=.25):v<720?(O=12,q=.5):b<1/90?(q=1,D=1):b<2/90?(q=2,D=2):b<7/90?(q=7,D=7):b<31/90?(N=1,q=31):b<1?(N=3,q=90):x<1?(I=1,q=366):x<2?(I=2,q=732):x<5?(I=5,q=1826.25):(I=10,q=3652.5),S=Math.floor((d+n%1)/q);C<i;){E=S+1,M=I?Yx("year",[l+S*I,0,1],[l+E*I,0,1],a.year.formatter):N?Yx("month",[l,u+S*N,1],[l,u+E*N,1],a.date.formatter):D?Yx("day",[l,u,c+S*D],[l,u,c+E*D],a.date.formatter):O?Yx("hour",[l,u,c,0+S*O],[l,u,c,0+E*O],a.minute.formatter):A?Yx("minute",[l,u,c,0,0+S*A],[l,u,c,0,0+E*A],a.minute.formatter):Yx("second",[l,u,c,0,0,0+S*w],[l,u,c,0,0,0+E*w],a.second.formatter),C=gx(M.start),T.inner.push(M);const e=Math.floor(C);if(!(o||I||N||D)){const t={type:"day",start:px(e),end:px(e+1),formatter:a.date.formatter,qStart:e};T.outer[T.outer.length-1]&&T.outer[T.outer.length-1].qStart===t.qStart||T.outer.push(t)}S++}return T.min=r,T.max=i,Ux[[t,n,r,r,o]]=T,T}(n,e,d.min,l,u,"T"===s.qType);const f={transform:(t=[],{isMinor:n=!1}={})=>t.map((t=>{let r;r="start"===i?t.qStart:"end"===i?t.qEnd:(t.qStart+t.qEnd)/2;const o=e.clamp();n&&e.clamp(!1);const a=e(r),s=e(t.qStart),l=e(t.qEnd);return e.clamp(o),{value:r,position:a,start:s,end:l,label:t.qText,isMinor:n,data:n?void 0:{start:t.qStart,end:t.qEnd,scaleStart:e.domain()[0]}}})).filter((e=>e.position>=0&&e.position<=1)),generate:(t=100,n)=>m(t,n)[a].map((t=>{let n;return n="start"===i?gx(t.start):"end"===i?gx(t.end):(gx(t.start)+gx(t.end))/2,{position:c(t.start),start:c(t.start),end:c(t.end),value:n,label:t.formatter(n),isMinor:!1,data:{start:gx(t.start),end:gx(t.end),scaleStart:e.domain()[0]}}})).filter((e=>e.position>=0&&e.position<=1))};return f}const Gx=41000.2343433,Xx=/t+/i,Kx=16,Jx=60;const Zx={min:NaN,max:NaN,invert:!1,qAxis:[],field:void 0,formatter:{fn:()=>e=>e,measureText:()=>({width:0,height:0}),localeInfo:{},qNumFormat:{}},ticks:{generator:"d3",level:"outer",anchor:void 0,clamp:!1},cache:{get:()=>!1,set:()=>{},key:()=>""}};function Qx(e,t){e.instance||(e.instance=t.copy(),e.instance.domain(t.domain()),e.instance.clamp(!0),e.instance.range(e.invert?[1,0]:[0,1]))}const eM="continuousPan";var tM={model:function({model:e,layoutService:t,largeDataService:n,dataProcessorModel:r=Pv,viewCache:i,viewState:o,definitionPath:a},s={}){const{engineFetcherFactory:l=Ev,snapshotFetcherFactory:u=qv,cacheFetcherFactory:c=Cv,cache:d={initial:{},merged:{}}}=s,m=l({model:e,layoutService:t,largeDataService:n,definitionPath:a}),f=u({layoutService:t,viewCache:i}),p=c({cache:d}),h=e=>{throw e.isHandled=!0,e};let g,y,v;return{update(e){var n,r;({initialMin:y,initialMax:v}=function(e={}){let{qMin:t,qMax:n}=e;return t=Number.isNaN(+t)?0:t,n=Number.isNaN(+n)?0:n,{initialMin:t,initialMax:n}}(e.qHyperCube.qDimensionInfo[0])),i.set("continuousMin",y),i.set("continuousMax",v),i.set("minimiumZoomSpan",(n=y,r=v,Math.max(Tv,(r-n)*Lv))),g=t.meta.isSnapshot?f:m,t.meta.isSnapshot&&({zoom:{min:y,max:v}}=f.getSnapshotData()),o.preventSet("zoom",{min:y,max:v})},updateLayout(e){const{qDataPages:n,qAxisData:r}=e;return t.setHyperCubeValue("qDataPages",n),t.setHyperCubeValue("qAxisData",r),t.setHyperCubeValue("qMode","S"),t.setHyperCubeValue("qColumnOrder",[]),e},initialFetch(){return g.fetch(y,v).then((e=>{const t=function(e){return{qDataPages:e.qDataPages.map((e=>{const t=Ov(e.qArea,e.qMatrix);return{...e,qArea:t}})),qAxisData:e.qAxisData}}(e);return r.command.processDataPage({dataPage:t.qDataPages.length?t.qDataPages[0]:[]}),d.initial=t,d.merged=t,e})).then((e=>Dv(y,v,e))).then((e=>this.updateLayout(e))).catch(h)},fetch:(e,t)=>g.fetch(e,t).then((e=>function(e,t){const n={};return n.qDataPages=(e.qDataPages||[]).map(((e,n)=>{const r=function(e,t){if(!t||!t.length||!t[0].length)return e;const n=t[0][0].qNum,r=t[t.length-1][0].qNum,i=[],o=[];for(let t=0,a=e.length;t<a;t++){const a=e[t][0];a.qNum<n?i.push(e[t]):a.qNum>r&&o.push(e[t])}return[...i,...t,...o]}(e.qMatrix,t.qDataPages[n].qMatrix),i=Ov(e.qArea,r);return{...e,qArea:i,qMatrix:r}})),e.qAxisData&&e.qAxisData.qAxis&&(n.qAxisData=function(e,t){if(!t||!t.qAxis.length||t.qAxis.every((e=>!e.qTicks.length)))return e;const n=t.qAxis.map((e=>e.qName)),r=t.qAxis.map((e=>({start:e.qTicks[0].qStart,end:e.qTicks[e.qTicks.length-1].qStart}))),i=t.qAxis.map((e=>({qName:e.qName,qTags:[...e.qTags],qTicks:[...e.qTicks]})));for(let t=0,o=e.qAxis.length;t<o;t++){const o=e.qAxis[t],a=n.indexOf(o.qName),s=[],l=[];if(a>-1){const{start:e,end:t}=r[a];for(let n=0,r=o.qTicks.length;n<r;n++){const r=o.qTicks[n];r.qStart<e?s.push(r):r.qStart>t&&l.push(r)}i[a].qTicks=[...s,...i[a].qTicks,...l]}}return{qAxis:i}}(e.qAxisData,t.qAxisData)),n}(d.initial,e))).then((e=>(r.command.processDataPage({dataPage:e.qDataPages.length?e.qDataPages[0]:[]}),d.merged=e,e))).then((n=>Dv(e,t,n))).catch(h),fetchFromCache:(e,t)=>p.fetch(e,t).then((n=>Dv(e,t,n))),fetchMinMaxData:()=>Promise.resolve(d.initial.qDataPages||[]),getInitialCube(){const e=t.getHyperCube();return G({},e,{...d.initial})},getInitialLayout(){const e=this.getInitialCube();return G({},t.getLayout(),{qHyperCube:e})},getDimensionCardinality:()=>Rv(d.initial,t.meta),setSnapshotData(e){const{qHyperCube:t}=e,n=r.query.getShouldProcess()?[r.query.getFilteredDataPage({dataPage:d.merged.qDataPages[0]})]:d.merged.qDataPages;t.qDataPages=n,t.qAxisData=d.merged.qAxisData}}},event:{onZoomChange:function(e,t){const{layoutService:n,continuousDataModel:r}=e;function i(e,n,i){return r[e](n,i).then((e=>(r.updateLayout(e),t(),e)))}const o=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50;return function(){for(var r=this,i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];clearTimeout(t),t=setTimeout((function(){return e.apply(r,o)}),n)}}(((e,t)=>i("fetch",e,t)),50);return({min:e,max:t},{min:r,max:a})=>!n.meta.isContinuous||e===r&&t===a?Promise.resolve(null):i("fetchFromCache",e,t).then((n=>(o(e,t),n)))},onZoomIntercept:function({viewCache:e}){let t=NaN,n=NaN,r=NaN;return(i,o)=>(t=e.get("continuousMin"),n=e.get("continuousMax"),r=e.get("minimiumZoomSpan"),Math.abs(i.max-i.min)<r?o:{min:Math.min(i.max,Math.max(t,i.min)),max:Math.max(i.min,Math.min(n,i.max))})},onZoom:function({viewCache:e,viewState:t,chart:n},{threshold:r=50,rtl:i=!1,targetKey:o}){const a=e.get("continuousMin"),s=e.get("continuousMax");return function(e){var t,n,r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50,o=0;return function(){t=this;for(var a=arguments.length,s=new Array(a),l=0;l<a;l++)s[l]=arguments[l];n=s;var u=Date.now()-o,c=function(){o=Date.now(),r=0,e.apply(t,n)};r||(u>=i?c():r=setTimeout(c,i-u))}}(((e,r)=>{const l=(e=>n.componentsFromPoint(e).filter((e=>e.key===o))[0])(e);if(l){const o=function(e,t,n){let{x:r}=e;return r-=t.element.getBoundingClientRect().left,r-=n.rect.x,Math.max(0,Math.min(1,r/n.rect.width))}(e,n,l),u=i?1-o:o,{min:c,max:d}=t.get("zoom"),m=Math.abs(d-c),f=m-(r>0?Iv:Nv)*m,p=c+f*u,h=d-f*(1-u),g=p<a?a-p:0,y=h>s?h-s:0;t.set("zoom",{min:Math.max(p-y,a),max:Math.min(h+g,s)})}}),r)}},interactions:{areaPan:function({targetKey:e,chart:t,actions:n,viewState:r,viewCache:i}){return{type:"Pan",key:"continuous:pan",options:{event:eM,pointers:1,threshold:10,enable(r,i){return this.started===eM||!i||!!n.scroll.enabled()&&t.componentsFromPoint({x:i.center.x,y:i.center.y}).some((t=>t.key===e))}},events:{[`${eM}start`](n){n.preventDefault(),this.started=eM;const{min:i,max:o}=r.get("zoom");this[eM]={min:i,max:o,size:t.component(e).rect.computedInner.width,span:o-i}},[`${eM}move`](e){e.preventDefault();const{span:t,min:n,max:o,size:a}=this[eM],s=-e.deltaX/a;r.set("zoom",{min:Math.min(n+s*t,i.get("continuousMax")-t),max:Math.max(o+s*t,i.get("continuousMin")+t)})},[`${eM}end`](e){e.preventDefault(),this.started=!1},[`${eM}cancel`](e){e.preventDefault(),this.started=!1}}}}},picassoComponents:{axisOverlay:Xb,timeAxis:tx},picassoScales:{time:function e(t,n={}){const r=function(e,t,n){const r={};return Object.keys(t).forEach((i=>{const o=e[i],a=typeof o;"function"===a?r[i]=o(n):"object"!==a||Array.isArray(o)?r[i]="undefined"===a?t[i]:o:r[i]=G(!0,{},t[i],o)})),r}(t,Zx,n),{qAxis:i}=r,o=Sr(),a={instance:null,invert:!1},{min:s,max:l}=function(e,t){let n=+e.min,r=+e.max;return Number.isNaN(n)&&Number.isNaN(r)&&Array.isArray(t)&&t.length&&(n=Math.min(...t[t.length-1].qTicks.map((e=>e.qStart))),r=Math.max(...t[t.length-1].qTicks.map((e=>e.qEnd)))),n===r&&(n-=.5,r+=.5),{min:Number.isNaN(+n)?0:n,max:Number.isNaN(+r)?1:r}}(r,i);let u,c,d=[];const m=function(e){return Number.isNaN(+e)?NaN:o(e)};m.ticks=({distance:e,resolve:t=u.resolve}={})=>{const n=t(e),o=n[r.ticks.level];if(Number.isNaN(+o)||(d=c.transform(i[o].qTicks,{isMinor:!1})),!Number.isNaN(+n.minor)){const e=c.transform(i[n.minor].qTicks,{isMinor:!0});d=d.concat(e)}return"auto"===o&&(d=c.generate(e,n.isDayOrShorter)),d},m.invert=e=>o.invert(e),m.domain=e=>Array.isArray(e)?o.domain(e):o.domain(),m.range=e=>Array.isArray(e)?o.range(e):o.range(),m.norm=e=>(Qx(a,m),a.instance(e)),m.normInvert=e=>(Qx(a,m),a.instance.invert(e)),m.copy=()=>e(t,n),m.clamp=(e=!0)=>(o.clamp(e),o.clamp()),m.min=()=>Math.min(s,l),m.max=()=>Math.max(s,l),o.range(r.invert?[1,0]:[0,1]),o.domain([s,l]),a.invert=r.invert;const f=function(e){const t={},{measureText:n,fn:r,localeInfo:i}=e.formatter,o={second:{type:"second",pattern:"hh:mm:ss",width:Jx,formatter:void 0},minute:{type:"minute",pattern:"hh:mm",width:Jx,formatter:void 0},date:{type:"date",pattern:"YYYY-MM-DD",width:Jx,formatter:void 0},year:{type:"year",pattern:"YYYY",width:Jx,formatter:void 0}};return i&&Xx.test(i.qTimestampFmt)&&(o.minute.pattern+=" tt",o.second.pattern+=" tt"),o.date.pattern=i&&i.qDateFmt?i.qDateFmt:o.date.pattern,Object.keys(o).forEach((e=>{o[e].formatter=r(o[e].pattern),o[e].width=Math.max(o[e].width,n(o[e].formatter(Gx)).width+Kx)})),t.getFormat=e=>o[e],t.all=()=>o,t.getFormatFromTicks=e=>{const t=e.filter((e=>!e.isMinor)),{length:n}=t;if(!n)return o.date;const r=px(t[0].data.start),i=px(t[n-1].data.start);return Ox.count(r,i)/n>=1?o.date:wx.count(r,i)/n>0?o.minute:Cx.count(r,i)/n>0?o.second:o.date},t}(r);return c=Wx(o.copy(),r,f),u=dx({qAxis:i,measureText:r.formatter.measureText,reqAutoFitWidth:2*f.getFormat("minute").width,cache:r.cache,scale:m}),m.data=()=>({fields:[{formatter:m.formatter,id:()=>`qHyperCube/${r.field}`,key:()=>r.field,raw:jb(n,"fields.0.raw",(()=>({})))}]}),m.formatter=()=>f.getFormatFromTicks(d).formatter,m}}};const nM=e=>e.meta.seriesComponentKeys[0],rM=(e,t)=>{if(t){const n=Math.abs(e.deltaX)>Math.abs(e.deltaY)?e.deltaX:e.deltaY;t.emit(n>=0?"next":"prev"),e.preventDefault()}};function iM({chart:e,models:t,actions:n,viewState:r,viewCache:i,environment:o}){const{event:{onZoom:a}}=tM,{layoutService:s,seriesModel:l}=t,u=nM(l),c=s.meta.isContinuous?a({chart:e,viewState:r,viewCache:i},{rtl:"rtl"===o.options.direction,threshold:50,targetKey:u}):()=>{};return{type:"native",events:{wheel(t){const r={x:t.clientX,y:t.clientY},i=e.componentsFromPoint(r);if(n.interact.enabled()){const[e]=i.filter((e=>e.key===ul.COMPONENT.LEGEND_CATEGORICAL));rM(t,e)}if(n.scroll.enabled()){const[e]=i.filter((e=>e.key===u));e&&(c(r,Math.sign(-t.deltaY)),t.preventDefault())}}}}}const oM="continuousPinchZoom";function aM({chart:e,models:t,environment:n,viewState:r,viewCache:i,actions:o,selectables:a}){const s=tM.interactions.areaPan,{layoutService:l,dockService:u,discreteModel:c,colorService:d,tooltipService:m}=t,f="rtl"===n.options.direction,p=m.getInteractions(),h=function({componentKey:e,chart:t,actions:n,viewState:r,viewCache:i,layoutService:o,dockService:a,discrete:s,rtl:l}){return{gestures:[...lc({componentKey:e,chart:t,actions:n,viewState:r,viewCache:i,layoutService:o,dockService:a,discrete:s,rtl:l})],native:uc({componentKey:e,chart:t,actions:n,layoutService:o})}}({componentKey:"scrollbar",chart:e,actions:o,viewState:r,viewCache:i,discrete:c,layoutService:l,dockService:u,rtl:f}),g={type:"hammer",enable:!0,gestures:[...d.custom.legendInteractions(),...a.gestures.sort(((e,t)=>(t.prio||0)-(e.prio||0))),...h.gestures,...p.gestures]},y=[iM({chart:e,models:t,actions:o,viewState:r,viewCache:i,environment:n}),h.native,p.native];return l.meta.isDiscrete&&(g.gestures.push(...c.interactions.gestures),y.push(c.interactions.native)),l.meta.isContinuous&&g.gestures.push(s({targetKey:nM(t.seriesModel),chart:e,actions:o,viewState:r,viewCache:i}),function({targetKey:e,chart:t,actions:n,viewState:r,viewCache:i,rtl:o}){const a={last:0,diff:0},s=tM.event.onZoom({viewCache:i,viewState:r,chart:t},{threshold:100,rtl:o,targetKey:e});return{type:"Pinch",key:"continuous:pinch-zoom",options:{event:oM,pointers:2,threshold:0,enable:(r,i)=>!i||!!n.scroll.enabled()&&t.componentsFromPoint({x:i.center.x,y:i.center.y}).some((t=>t.key===e))},events:{[`${oM}start`](e){a.last=e.scale,e.preventDefault()},[`${oM}move`](e){const t=e.scale-a.last;Math.abs(t)>.01&&s(e.center,t>0?1:-1),a.last=e.scale,e.preventDefault()}}}}({targetKey:nM(t.seriesModel),chart:e,actions:o,viewState:r,viewCache:i,rtl:f})),[g,...y]}const sM=({key:e,components:t})=>({key:e,type:"brush-lasso",layout:{displayOrder:99},settings:{brush:{components:t},lasso:{fill:"rgba(0, 0, 0, 0)",stroke:"black",strokeWidth:2,opacity:.7,strokeDasharray:[]},snapIndicator:{threshold:75,strokeDasharray:"5, 5",stroke:"black",strokeWidth:2,opacity:.7},startPoint:{r:10,stroke:"rgba(77, 192, 78, 1)",strokeWidth:0,opacity:1}}}),lM="lasso",uM=({key:e,componentTargetKey:t,requireFailure:n,recognizeWith:r},i)=>({key:`event:${e}`,type:"Pan",requireFailure:n,recognizeWith:r,options:{event:lM,enable(e,n){if(this.started===lM||!n)return!0;if(!i.actions.select.enabled()||!i.actions.lasso.enabled()||!i.actions.lasso.active())return!1;return this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).filter((e=>e.key===t)).length>0}},events:{lassostart(t){t.preventDefault(),this.started!==lM&&(i.actions.select.emit("start",lM),this.chart.component(e).emit("lassoStart",t),this.started=lM)},lassomove(t){t.preventDefault(),this.chart.component(e).emit("lassoMove",t),"function"==typeof i.updateOnMove&&i.updateOnMove(this.chart)},lassoend(t){t.preventDefault(),this.started=!1,this.chart.component(e).emit("lassoEnd",t),i.actions.select.emit("end",lM),"function"==typeof i.updateOnEnd&&i.updateOnEnd()}}});const cM=({targets:e,requireFailure:t,recognizeWith:n,components:r,eventName:i="tap"},o)=>{let a;const s=o.customTooltipModel?o.customTooltipModel.utils:void 0,l=s?o.debouncer(s.displayTooltip,s.DEBOUNCE_THRESHOLD):void 0;return{key:"event:tap",type:"Tap",requireFailure:t,recognizeWith:n,options:{event:i,interval:10,pointers:1,enable(t,n){return!n||!(!o.actions.select.enabled()&&!o.actions.tooltip.enabled())&&(a=this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).filter((t=>-1!==e.indexOf(t.key))),a.length>0)}},events:{[i](t){t.preventDefault();const n=function(e,t){const n=t.element.getBoundingClientRect();let r,i;return e.center?(({x:r}=e.center),({y:i}=e.center)):(r=e.clientX,i=e.clientY),{x:r-n.left,y:i-n.top}}(t,this.chart),u=o.hitRadius?o.hitRadius(a):0,c=u>0?{cx:n.x,cy:n.y,r:u}:n,d=o.shapesAt?o.shapesAt(c):this.chart.shapesAt(c,{components:e.map((e=>({key:e,propagation:"stop"}))),propagation:"stop"}),m=this.chart.component("tooltip"),f="mouse"!==t.pointerType&&m&&m.show;if(!o.isLocked(a)&&!o.tooltipOnly&&o.actions.select.enabled()){const e=this.chart.componentsFromPoint({x:t.center.x,y:t.center.y}),n=e.some((e=>"legend-cat"===e.type));if(!d.length&&n||(this.chart.brushSelectionIncludeMax=!1,o.actions.select.brushSelectionIncludeMax=!1,o.actions.select.emit("start",i,e)),d.length&&r){this.chart.brushSelectionIncludeMax=!1,o.actions.select.brushSelectionIncludeMax=!1;const e="function"==typeof r?r(t,d):r;this.chart.brushFromShapes(d,{components:e}),o.actions.select.emit("end",i),(({largeDataService:e,chart:t})=>{((null==e?void 0:e.meta)||{}).isLargeNumPoints&&t.brush("lazySelection")._state(t.brush("selection")._state())})({largeDataService:o.largeDataService,chart:this.chart})}}if(m&&o.actions.tooltip.enabled())if(d.length){const{customTooltipModel:e}=o;if(null!=e&&e.useCustomTooltip&&s.checkIfPromisesExist({customTooltipModel:e})){const n=s.getNodes(t,this.chart);l(t,m,{nodes:n,opts:o,customTooltipModel:e})}else m.emit("show",t,{nodes:d})}else f&&m.emit("hide")}}}};const dM=({key:e,requireFailure:t,recognizeWith:n,eventName:r="tap"},i)=>({prio:1,key:`event:${e}-tap`,type:"Tap",requireFailure:t,recognizeWith:n,options:{event:`${r}-${e}-tap`,interval:10,pointers:1,enable:(t,n)=>!!n&&(!!i.actions.select.enabled()&&(!(!n.target||"INPUT"!==n.target.nodeName)||!(!n.target||!n.target.hasAttribute("data-other-value"))&&(n.target.getAttribute("data-key")||"").split("-bubble")[0]===e))},events:{[`${r}-${e}-tap`](t){(t.target.getAttribute("data-key")||"").split("-bubble")[0]&&(t.preventDefault(),this.chart.component(e).emit("bubbleStart",t))}}});const mM=({eventName:e,key:t,fillTargets:n=[],requireFailure:r,recognizeWith:i},o,a)=>({key:`event:${t}`,type:"Pan",requireFailure:r,recognizeWith:i,options:{event:e,enable(r,i){if(this.started===e||!i)return!0;if(!o.actions.select.enabled())return!1;const a=this.chart.componentsFromPoint({x:i.center.x,y:i.center.y}).filter((e=>-1!==n.indexOf(e.key))),s=0===a.length&&function(e,t){const{target:n}=e.srcEvent;return!(!n||0!==(n.getAttribute("data-key")||"").indexOf(`${t}-`))}(i,t);return s?(this.started=e,!0):a.length>0}},events:{[`${e}start`](n){void 0===this.chart.brushSelectionIncludeMax&&(this.chart.brushSelectionIncludeMax=!0,o.actions.select.brushSelectionIncludeMax=!0),n.preventDefault(),o.actions.select.emit("start",e),this.chart.component(t).emit(`${a}Start`,n),this.started=e},[`${e}move`](e){e.preventDefault(),this.chart.component(t).emit(`${a}Move`,e),"function"==typeof o.updateOnMove&&o.updateOnMove(this.chart)},[`${e}end`](n){void 0===this.chart.brushSelectionIncludeMax&&(this.chart.brushSelectionIncludeMax=!0,o.actions.select.brushSelectionIncludeMax=!0),n.preventDefault(),this.chart.component(t).emit(`${a}End`,n),o.actions.select.emit("end",e),this.started=!1,"function"==typeof o.updateOnEnd&&o.updateOnEnd()}}});function fM(e,t){const n=function(e){const{key:t,targets:n,fillTargets:r,targetSelector:i,targetFillSelector:o,dock:a,scale:s,bubblesPlacement:l="inside",observeBrush:u=!1,multiple:c=!1,toLabel:d,onEdited:m}=e;return{key:t,type:"brush-range",layout:{dock:n.map((e=>`@${e}`)).join(",")},on:m?{bubbleEnd(){m()}}:{},settings:{brush:u?{context:"selection",observe:!0}:"selection",scale:s,multiple:c,direction:"left"===a||"right"===a?"vertical":"horizontal",bubbles:{align:"left"===a||"top"===a?"end":"start",placement:l,label:d},target:{components:r,selector:i,fillSelector:o,fill:"rgba(82,204,82,0.2)"}}}}(e),r=mM(e,t,"range");return{interactions:[e.onEdited?dM(e,t):null,r].filter(Boolean),components:[n]}}const pM=/axis|legend/,hM=e=>e.some((e=>pM.test(e.type)));function gM({actions:e,models:t}){const{seriesModel:n,layoutService:r,colorService:i,flags:o}=t,a=r.getHyperCubeValue("qDimensionInfo.0.qIsOneAndOnlyOne",!1),s={targets:[`${ul.COMPONENT.BAR}-${cl.AXIS.PRIMARY}`,`${ul.COMPONENT.BAR}-${cl.AXIS.SECONDARY}`,...n.query.series(cl.TYPE.MARKER).map((e=>id(ul.COMPONENT.MARKER,e))),...n.query.series(cl.TYPE.LINE).map((e=>id(ul.COMPONENT.POINT,e))),ul.COMPONENT.AXIS.MAJOR,ul.COMPONENT.AXIS_OVERLAY.TIME_INNER,ul.COMPONENT.AXIS_OVERLAY.TIME_OUTER,ul.COMPONENT.AXIS_OVERLAY.CONTINUOUS,ul.COMPONENT.LEGEND_CATEGORICAL],components:(e,t)=>{const[n]=t,{key:r}=n,i={key:r,action:e.srcEvent.ctrlKey||a?"set":"toggle",contexts:["selection"]};return-1===[ul.COMPONENT.AXIS.MAJOR,ul.COMPONENT.AXIS_OVERLAY.TIME_INNER,ul.COMPONENT.AXIS_OVERLAY.TIME_OUTER,ul.COMPONENT.AXIS_OVERLAY.CONTINUOUS,ul.COMPONENT.LEGEND_CATEGORICAL].indexOf(r)&&(i.data=["selectionDimension"]),[i]}},l={actions:e,isLocked:e=>e.some((e=>"legend-cat"===e.type))?i.isSelectionLocked({isMeasureSelectionLocked:r.meta.isDimensionLocked}):r.meta.isDimensionLocked,hitRadius:e=>hM(e)?0:3,debouncer:Gf,flags:o};return function(e,t){if(!e.targets)throw new Error("Missing 'targets' property");return{interactions:[cM(e,t)],components:[]}}(s,l)}function yM({actions:e,models:t}){const{layoutService:n,dockService:r,seriesModel:i}=t,{isDiscrete:o,isDimensionLocked:a}=n.meta;if(!o||a)return!1;const s=[...i.meta.seriesComponentKeys,ul.COMPONENT.AXIS.MAJOR];return function(e,t){const n=function(e){const{key:t,targets:n,components:r,fillTargets:i,dock:o}=e;return{key:t,type:"brush-area-dir",layout:{dock:n.map((e=>`@${e}`)).join(",")},settings:{multiple:!0,brush:{components:r},direction:"left"===o||"right"===o?"vertical":"horizontal",bubbles:{align:"left"===o||"top"===o?"end":"start",placement:"inside"},target:{components:i,fill:"rgba(82,204,82,0.2)"}}}}(e);return{interactions:[mM(e,t,"area")],components:[n]}}({eventName:"discreteRange",key:"discrete-range-brush",components:[{key:s[0],contexts:["selection"],action:"set",data:["selectionDimension"]}],targets:s,fillTargets:[ul.COMPONENT.AXIS.MAJOR],dock:r.meta.major.dock},{actions:e})}const vM={components:[],interactions:[]};function bM({actions:e,chart:t,models:n,isUnsupportedFeature:r}){const i=function({actions:e,models:t,isUnsupportedFeature:n}){const{dockService:r,seriesModel:i,layoutService:o}=t;return!(o.meta.isDimensionLocked||o.meta.isBarSeriesStacked||null!=n&&n("rangeSelections"))&&fM({eventName:"minorRange",key:"minor-range-brush",targets:[ul.COMPONENT.AXIS.MINOR.PRIMARY,`${ul.COMPONENT.BAR}-${cl.AXIS.PRIMARY}`,...i.query.series(cl.TYPE.MARKER).filter((e=>e.isPrimary)).map((e=>id(ul.COMPONENT.MARKER,e))),...i.query.series(cl.TYPE.LINE).filter((e=>e.isPrimary)).map((e=>id(ul.COMPONENT.POINT,e)))],fillTargets:[ul.COMPONENT.AXIS.MINOR.PRIMARY],dock:r.meta.minor.dock,scale:ul.SCALE.MINOR.PRIMARY,onEdited(){e.select.emit("end","minorRange")}},{actions:e})}({actions:e,models:n,isUnsupportedFeature:r})||vM,o=function({actions:e,models:t,isUnsupportedFeature:n}){const{dockService:r,seriesModel:i,layoutService:o}=t;return!(o.meta.isDimensionLocked||o.meta.isBarSeriesStacked||null!=n&&n("rangeSelections"))&&fM({eventName:"minorRange-secondary",key:"minor-secondary-range-brush",targets:[ul.COMPONENT.AXIS.MINOR.SECONDARY,`${ul.COMPONENT.BAR}-${cl.AXIS.SECONDARY}`,...i.query.series(cl.TYPE.MARKER).filter((e=>!e.isPrimary)).map((e=>id(ul.COMPONENT.MARKER,e))),...i.query.series(cl.TYPE.LINE).filter((e=>!e.isPrimary)).map((e=>id(ul.COMPONENT.POINT,e)))],fillTargets:[ul.COMPONENT.AXIS.MINOR.SECONDARY],dock:r.meta.minorSecondary.dock,scale:ul.SCALE.MINOR.SECONDARY,onEdited(){e.select.emit("end","minorRange-secondary")}},{actions:e})}({actions:e,models:n,isUnsupportedFeature:r})||vM,a=yM({actions:e,models:n})||vM,s=function({actions:e,chart:t,models:n}){const{layoutService:r,dockService:i,seriesModel:o}=n,{isContinuous:a,isTime:s}=r.meta;if(!a)return!1;const l=s?[ul.COMPONENT.AXIS_OVERLAY.TIME_INNER,ul.COMPONENT.AXIS_OVERLAY.TIME_OUTER]:[ul.COMPONENT.AXIS_OVERLAY.CONTINUOUS];return fM({eventName:"continuousRange",key:"continuous-range-brush",targets:[`${ul.COMPONENT.BAR}-${cl.AXIS.PRIMARY}`,`${ul.COMPONENT.BAR}-${cl.AXIS.SECONDARY}`,...o.query.series(cl.TYPE.MARKER).map((e=>id(ul.COMPONENT.MARKER,e))),...o.query.series(cl.TYPE.LINE).map((e=>id(ul.COMPONENT.POINT,e))),...l],fillTargets:l,dock:i.meta.major.dock,scale:s?ul.SCALE.MAJOR_INNER:ul.SCALE.MAJOR,observeBrush:!0,multiple:!0,toLabel({datum:e,data:n,scale:r}){const i=s?r.formatter():t.formatter(ul.FORMATTER.PRIMARY),o=t.scale(ul.SCALE.MAJOR).max(),a=t.brushSelectionIncludeMax&&e===o;return`${e!==Math.max(...n)||a?"":"<"}${i(e)}`}},{actions:e})}({actions:e,chart:t,models:n})||vM,l=function({actions:e,models:t}){const{colorService:n,layoutService:r}=t,[i]=n.custom.legendComponents(),o=n.custom.wrappedScales(),{isDimensionLocked:a}=r.meta;if(a||!i)return!1;const s=`${ul.SCALE.COLOR}Range`,{type:l,key:u}=i,c=o[s];return!("legend-seq"!==l||!c||c.min>=c.max)&&fM({eventName:"legendRange",key:"legend-range-brush",targets:[u],fillTargets:[u],targetSelector:'[id="legend-seq-target"]',targetFillSelector:'[id="legend-seq-ticks"]',dock:i.layout.dock,scale:s,bubblesPlacement:"outside",onEdited:()=>{e.select.emit("end","legendRange")}},{actions:e})}({actions:e,models:n})||vM;return{components:[...i.components,...o.components,...a.components,...s.components,...l.components],interactions:[...i.interactions,...o.interactions,...a.interactions,...s.interactions,...l.interactions]}}function xM({actions:e,models:t}){const{layoutService:n,seriesModel:r}=t,{seriesComponentKeys:i}=r.meta;if(n.meta.isDimensionLocked)return{components:[],interactions:[]};return function(e,t){if(!e.componentTargetKey)throw new Error("Missing 'componentTargetKey' property");const n={key:"lasso",...e},r=sM(n);return{interactions:[uM(n,t)],components:[r]}}({key:"lasso",componentTargetKey:i[0],components:i.map((e=>({key:e,action:"add",contexts:["selection"],data:["selectionDimension"]})))},{actions:e})}function MM({picasso:e,chart:t,models:n,environment:r,viewState:i,viewCache:o,actions:a,isUnsupportedFeature:s}){const{colorService:l,pluginService:u}=n,c=n.layoutService.getLayout(),{options:d}=r,m=function({layout:e,options:t={}}){return!(null==e||!e.snapshotData||t.freeResize)&&{width:e.snapshotData.content.size.w,height:e.snapshotData.content.size.h}}({layout:c,options:d}),f=(p={logicalSize:m,minCenterRatio:0},{layoutModes:ee.getLayoutModes(),center:void 0!==p.minCenterRatio?{minWidthRatio:p.minCenterRatio,minHeightRatio:p.minCenterRatio}:void 0,logicalSize:p.logicalSize?{align:.5,preserveAspectRatio:!0,...p.logicalSize}:void 0});var p;const h=function({chart:e,models:t,environment:n,viewState:r,viewCache:i,actions:o}){var a;const{colorService:s,layoutService:l,dockService:u,tooltipService:c}=t,d=av({environment:n,models:t});return"center"===(null==d||null===(a=d.layout)||void 0===a?void 0:a.dock)?[d]:[...Yy({models:t}),...Yc({models:t}),...jy({chart:e,models:t,environment:n,viewState:r,viewCache:i}),uv({models:t,environment:n}),...Zc({models:t,environment:n}),...Ky({models:t,environment:n,actions:o}),$o({viewState:r,viewCache:i,layoutService:l,dockService:u}),...nv({models:t}),...rv({chart:e,models:t,environment:n}),Jy({models:t,environment:n,viewState:r,viewCache:i}),...s.custom.legendComponents(),sv(t),...tv({chart:e,models:t,viewState:r,viewCache:i,environment:n}),...c.getComponents(),d].filter(Boolean)}({chart:t,models:n,environment:r,viewState:i,viewCache:o,actions:a}),g=function({actions:e,chart:t,models:n,isUnsupportedFeature:r}){const{layoutService:i}=n,o=i.getHyperCubeValue("qDimensionInfo.0.qIsOneAndOnlyOne",!1),a=gM({actions:e,models:n});if(o)return{components:[...a.components],gestures:[...a.interactions]};const s=bM({actions:e,chart:t,models:n,isUnsupportedFeature:r}),l=xM({actions:e,models:n});return{components:[...a.components,...s.components,...l.components],gestures:[...a.interactions,...s.interactions,...l.interactions]}}({actions:a,chart:t,models:n,isUnsupportedFeature:s}),y=u.extendComponents([...h,...g.components]);return{collections:Ic({models:n}),scales:Vc({picasso:e,models:n,viewState:i,viewCache:o,environment:r}),components:y,formatters:cv({models:n}),interactions:aM({chart:t,models:n,environment:r,viewState:i,viewCache:o,actions:a,selectables:g}),strategy:f,palettes:l.getPalettes()}}const SM=({models:{layoutService:e,fieldModel:t,appLayoutModel:n}})=>({type:"q",key:ul.DATA.MAIN,data:e.getHyperCube(),config:{virtualFields:t.virtuals,localeInfo:n.qLocaleInfo}}),EM=({models:{layoutService:e,fieldModel:t,continuousModel:n,appLayoutModel:r}})=>e.meta.isContinuous?[{type:"q",key:ul.DATA.REDUCED,data:n.getInitialCube(),config:{virtualFields:t.virtuals,localeInfo:r.qLocaleInfo}}]:[],CM=[ul.COMPONENT.AXIS_TITLE.MAJOR,ul.COMPONENT.AXIS_TITLE.MINOR.PRIMARY,ul.COMPONENT.AXIS_TITLE.MINOR.SECONDARY,ul.COMPONENT.GRID_LINE,ul.COMPONENT.ZERO_LINE],qM=({picasso:e,chart:t,models:r,environment:o,viewState:a,viewCache:s,actions:l})=>{(({chart:e,models:t,viewState:r,viewCache:i})=>{const{event:{onZoomIntercept:o,onZoomChange:a}}=tM;n((()=>{if(!t||!r||!i)return;const{layoutService:n,continuousModel:s,refLineModel:l,seriesModel:u}=t,{miniComponentKeys:c}=u.meta,d=()=>{l&&l.update(),e.update({partialData:!0,excludeFromUpdate:[...CM,...c]})};r.onChanged("scrollOffset",d),n.meta.isContinuous&&(r.onChanged("zoom",a({layoutService:n,continuousDataModel:s},d)),r.intercept("zoom",o({viewCache:i})))}),[t,r,i])})({chart:t,models:r,viewState:a,viewCache:s}),(({picasso:e,chart:t,models:n,environment:r,viewState:o,viewCache:a,actions:s})=>{const[,l]=i((async()=>{if(null==t||!t.update||!n||!r)return;const{layoutService:i,colorService:l,discreteModel:u}=n;function c(i=!1){t.update({settings:MM({picasso:e,chart:t,models:n,environment:r,viewState:o,viewCache:a,actions:s}),data:i&&[SM({models:n}),...EM({models:n}),...l.getData()]})}const d=i.getDataPages();i.setDataPages([]),c(!0),i.setDataPages(d),i.meta.isContinuous||await u.command.initialize(),c(!1)}),[null==t?void 0:t.update,n,r]);if(l)throw l})({picasso:e,chart:t,models:r,environment:o,viewState:a,viewCache:s,actions:l})};function wM(){return wM=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},wM.apply(this,arguments)}var AM={exports:{}};function OM(){}function DM(){}DM.resetWarningCache=OM;AM.exports=function(){function e(e,t,n,r,i,o){if("SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==o){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:DM,resetWarningCache:OM};return n.PropTypes=n,n}();var NM=F(AM.exports);function IM(e){return"large"===e?"20px":"small"===e?"12px":"16px"}function TM({d:e,size:t,style:n={},viewBox:r="0 0 16 16"}){const i={fontSize:IM(t),display:"inline-block",fontStyle:"normal",lineHeight:"0",textAlign:"center",textTransform:"none",verticalAlign:"-.125em",textRendering:"optimizeLegibility",WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",...n};return q.createElement("i",{style:i},q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:r,fill:"currentColor"},q.createElement("path",{d:e})))}const LM={d:"M15.9993744,3 L15.9993744,5 L4.99937445,5 L4.99937445,3 L15.9993744,3 Z M8.99937445,7 L15.9993744,7 L15.9993744,9 L8.99937445,9 L8.99937445,7 Z M11.9993744,11 L15.9993744,11 L15.9993744,13 L11.9993744,13 L11.9993744,11 Z M2.2,11 L7,11 L7,9.00369263 C7,8.89323568 7.08954305,8.80369263 7.2,8.80369263 C7.2549016,8.80369263 7.30738916,8.82626165 7.34515712,8.86610844 L10.1852182,11.8624926 C10.2583124,11.93961 10.258346,12.0604218 10.1852948,12.13758 L7.34523376,15.1373102 C7.2692928,15.2175206 7.14270711,15.2209817 7.06249671,15.1450407 C7.02260076,15.1072683 7,15.0547472 7,14.9998069 L7,12.9043747 C4.79351111,12.9043747 2.8018683,12.9266213 1.02507156,12.9711145 L1.02507252,12.9711526 C0.472939773,12.9849787 0.014139487,12.5485949 0.000313396522,11.9964622 C0.000104473692,11.988119 -1.32268838e-12,11.9797736 -1.3231638e-12,11.9714278 L-1.83320026e-12,3 L2,3 L2,10.8 C2,10.9104569 2.08954305,11 2.2,11 Z"},kM={d:"M13,7 L8,7 L13,7 L13,4.98151367 C13,2.23029964 10.7614237,0 8,0 C5.23857625,0 3,2.23029964 3,4.98151367 L3,7 L3.75,7 L3,7 L4.5,7 L4.5,5.33193359 C4.5,3.21561511 5.54860291,1.5 8,1.5 C10.4513971,1.5 11.5,3.21561511 11.5,5.33193359 L11.5,7 L12.25,7 L3,7 C2.44771525,7 2,7.44771525 2,8 L2,15 C2,15.5522847 2.44771525,16 3,16 L13,16 C13.5522847,16 14,15.5522847 14,15 L14,8 C14,7.44771525 13.5522847,7 13,7 L3,7 L13,7 Z"},RM={d:"M6,10 L13,3 L15,5 L8,12 L6,14 L1,9 L3,7 L6,10 Z"},PM={d:"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"},$M={d:"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"};function FM(e,t,n){(function({model:e,properties:t}){return e.modifiers?e.modifiers.apply({model:e,properties:t}):Promise.resolve()})({model:e,properties:n}).then((()=>{e.colorSupport&&e.colorSupport.colorByUpdater(n,"qHyperCubeDef.");let r=Vo.generate(t,n);r&&r.length&&(r=r.map((e=>({qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path}))),e.applyPatches(r,!0))}))}function zM(e,t,n,r,i,o){e.getEffectiveProperties().then((a=>{const s=a.qHyperCubeDef[r].findIndex((e=>e.qDef.cId===t)),l=a.qHyperCubeDef.qLayoutExclude.qHyperCubeDef[r].findIndex((e=>e.qDef.cId===n)),u=G(!0,{},a),c=u.qHyperCubeDef[r][s],d=u.qHyperCubeDef.qLayoutExclude.qHyperCubeDef[r][l];d.qAttributeDimensions=c.qAttributeDimensions,c.qAttributeDimensions=[],o||(d.qAttributeExpressions=c.qAttributeExpressions,c.qAttributeExpressions=[]),u.qHyperCubeDef[r][s]=d,u.qHyperCubeDef.qLayoutExclude.qHyperCubeDef[r][l]=c,i&&i({oldItem:c,newItem:d,oldProperties:a,newProperties:u,model:e}),FM(e,a,u)}))}const _M=(e,t)=>{const n=[],r=[];return t.forEach((t=>{t.qCalcCondition.qCond.qv&&r.push(e.evaluate(t.qCalcCondition.qCond.qv).then((e=>{"0"===e&&n.push(t.qDef.cId)})))})),Promise.all(r).then((()=>n))};function jM({dir:e,dock:t,altList:n,model:r,translator:i,app:o,onChange:a}){return 0===n.length?null:{dir:e,dock:t,getAlternatives(){const e=_M(o,n).then((e=>Promise.all(n.filter((t=>!e.includes(t.qDef.cId))).map((e=>function(e,t,n){if(e.qLibraryId)return t.getDimension(e.qLibraryId).then((e=>e.getLayout())).catch((()=>null)).then((e=>e?"H"!==e.qDim.qGrouping&&e.qDim.qLabelExpression?e.qDim.qLabelExpression:e.qDim.title:n.get("Object.ErrorMessage.MissingDimension")));const r=e.qDef.qLabelExpression;if(r)return t.evaluate(r);const i=e.qDef.qFieldLabels[0]||e.qDef.qFieldDefs[0];return Promise.resolve(i)}(e,o,i).then((t=>({id:e.qDef.cId,selected:!1,title:t}))))))));return e},changeTo(e,t){zM(r,e,t,"qDimensions",a)}}}function HM(e,t,n,r="/qHyperCubeDef"){return{breadcrumbs:e.qGroupFallbackTitles.slice(0,e.qGroupPos),drilldown:"H"===e.qGrouping,index:t,locked:!!e.qLocked,text:"H"===e.qGrouping?e.qGroupFallbackTitles[e.qGroupPos]:e.qFallbackTitle,popoverText:(i=e,"H"===i.qGrouping?i.title||"":i.qFallbackTitle||""),drillUp(e){n.drillUp(r,t,e)},id:e.cId};var i}function VM({altList:e,app:t,dir:n,dock:r,model:i,onChange:o,skipAttributeExpressions:a,translator:s}){return 0===e.length?null:{dir:n,dock:r,getAlternatives(){const n=_M(t,e).then((n=>Promise.all(e.filter((e=>!n.includes(e.qDef.cId))).map((e=>function(e,t,n){if(e.qLibraryId)return t.getMeasure(e.qLibraryId).then((e=>e.getLayout())).catch((()=>null)).then((e=>e?e.qMeasure.qLabelExpression?e.qMeasure.qLabelExpression:e.qMeasure.qLabel||e.qMeasure.qDef:n.get("Object.ErrorMessage.MissingMeasure")));const r=e.qDef.qLabelExpression;if(r)return t.evaluate(r);const i=e.qDef.qLabel||e.qDef.qDef;return Promise.resolve(i)}(e,t,s).then((t=>({id:e.qDef.cId,selected:!1,title:t}))))))));return n},changeTo(e,t){zM(i,e,t,"qMeasures",o,a)}}}function BM(e,t){return{breadcrumbs:[],drilldown:!1,index:t,locked:!1,text:e.qFallbackTitle,popoverText:e.qFallbackTitle,id:e.cId}}const UM={bottom:{anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"}},top:{anchorOrigin:{vertical:"top",horizontal:"center"},transformOrigin:{vertical:"bottom",horizontal:"center"}},left:{anchorOrigin:{vertical:"center",horizontal:"left"},transformOrigin:{vertical:"center",horizontal:"right"}},right:{anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"}}},YM={menuItem:"alternative-menu-item",titleButton:"title-button",activeTitleButton:"active-title-button"},WM=w(A)((()=>({textAlign:"start","&:focus":{boxShadow:"inset 0 0 0 2px #177FE6 !important"}}))),GM=w((({children:e,...t})=>q.createElement(O,wM({size:"small",disableRipple:!0,disableTouchRipple:!0},t),e)))((()=>({"&:focus":{boxShadow:"inset 0 0 0 2px #177FE6 !important"}})));function XM(e){const t=e=>{if("Tab"===e.key){const t=document.querySelectorAll(`.${YM.menuItem}`);let n;e.shiftKey?null!=t&&t.length&&t[0]===e.target&&(n=t[t.length-1]):null!=t&&t.length&&t[t.length-1]===e.target&&([n]=t),n&&setTimeout((()=>{n.focus()}),50)}};function n({title:e,selected:n,onClick:r}){const i=ye.detectTextDirection(e);return q.createElement(WM,{role:"menuitem",button:!0,onClick:r,className:YM.menuItem,onKeyDown:t},q.createElement(I,{style:{minWidth:32}},q.createElement(TM,{d:n?RM.d:""})),q.createElement(T,{primaryTypographyProps:{dir:i}},e))}function r({alignTo:e,changeTo:t,current:r,dir:i,dock:o,list:a,onClose:s,show:l,instruction:u}){const c=a.map((e=>q.createElement(n,{key:e.id,title:e.title,onClick:()=>t(e.id)})));return q.createElement(D,wM({anchorEl:e,open:l,onClose:s},UM[o],{PaperProps:{style:{minWidth:"250px",maxHeight:"300px"}}}),q.createElement(N,{dense:!0,dir:i,"aria-label":u,component:"nav"},q.createElement(n,{title:r,selected:!0,onClick:s}),c))}n.propTypes={title:NM.string.isRequired,selected:NM.bool,onClick:NM.func.isRequired},n.defaultProps={selected:!1},r.propTypes={alignTo:NM.any,changeTo:NM.func.isRequired,current:NM.string.isRequired,dir:NM.string.isRequired,dock:NM.string.isRequired,list:NM.array,onClose:NM.func.isRequired,show:NM.bool.isRequired,instruction:NM.string.isRequired},r.defaultProps={list:[],alignTo:null};class i extends q.Component{constructor(e){super(e),this.state={open:!1,inSelection:e.selections&&e.selections.isActive(),hasValidAlternatives:!1},this.openPopover=this.openPopover.bind(this),this.closePopover=this.closePopover.bind(this),this.changeTo=this.changeTo.bind(this),this.alignToRef=q.createRef()}componentDidMount(){const{popover:e,selections:t,supportConditional:n}=this.props;t&&(this.onSelectionsActivated=()=>this.setState({inSelection:!0}),this.onSelectionsDeactivated=()=>this.setState({inSelection:!1}),t.addListener("activated",this.onSelectionsActivated),t.addListener("deactivated",this.onSelectionsDeactivated),t.addListener("canceled",this.onSelectionsDeactivated)),e&&n&&e.getAlternatives().then((e=>{this.setState({hasValidAlternatives:0!==e.length})}))}componentDidUpdate(e,t){const{popover:n,supportConditional:r}=this.props;n&&r&&n.getAlternatives().then((e=>{t.hasValidAlternatives!==(0!==e.length)&&this.setState({hasValidAlternatives:0!==e.length})}))}componentWillUnmount(){const{selections:e}=this.props;e&&(e.removeListener("activated",this.onSelectionsActivated),e.removeListener("deactivated",this.onSelectionsDeactivated),e.removeListener("canceled",this.onSelectionsDeactivated))}changeTo(e){this.props.popover.changeTo(this.props.titleData.id,e),this.closePopover(e)}openPopover(e){if(!(this.state.closeTime&&Date.now()-this.state.closeTime<20)){if(e.target){const t=e.target.closest(`.${YM.titleButton}`);t&&t.classList.add(YM.activeTitleButton)}this.props.popover.getAlternatives().then((e=>{this.setState({open:!0,alternatives:e});document.querySelector(`.${YM.menuItem}`).focus()}))}}closePopover(e){if(this.setState({open:!1,closeTime:Date.now()}),"string"==typeof e)setTimeout((()=>{const t=document.querySelector(`.${YM.titleButton}[data-id="${e}"]`);t&&t.focus()}),1e3);else{const e=document.querySelector(`.${YM.activeTitleButton}`);e&&(e.classList.remove(YM.activeTitleButton),setTimeout((()=>{e.focus()}),50))}}render(){const{titleData:e,popover:t,translator:n,disabled:i,isDimension:o,padding:a,minWidth:s,hasAlternative:l,supportConditional:u}=this.props,c={flex:"1 1 auto",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontWeight:"normal",lineHeight:"normal",...this.props.style},d=e.breadcrumbs.length,m=i||this.state.inSelection,f=e.breadcrumbs.map(((t,n)=>q.createElement(GM,{style:{display:"flex",alignItems:"center",color:m&&"rgba(89, 89, 89, 0.8)",pointerEvents:m?"none":"auto",paddingTop:0,paddingBottom:0,height:"100%"},key:n,onClick:()=>m?void 0:e.drillUp(d-n),title:t},q.createElement("span",{style:c},t),q.createElement(TM,wM({},$M,{size:"small",style:{margin:"0 8px"}}))))),p=u?this.state.hasValidAlternatives:l,h=t&&!this.state.open?this.openPopover:this.closePopover,g=!t||i||this.state.inSelection,y={display:"flex",alignItems:"center",width:"100%",color:g&&"rgba(89, 89, 89, 0.8)",height:"100%",border:!o&&g&&"none",paddingTop:0,paddingBottom:0};this.state.open&&(y.background="rgba(0,0,0,0.08)");a&&(y.padding=a),s&&(y.minWidth=s);const v=ye.detectTextDirection(e.text),b=q.createElement(GM,{"aria-label":n.get("Accessibility.Alternative.Instructions",[e.text]),style:y,onClick:g?void 0:h,title:e.text,tabIndex:g?-1:0,onFocus:g?void 0:e=>{e.currentTarget.style.boxShadow="0px 0px 0px 2px #177FE6 inset",e.currentTarget.style.borderRadius="2px"},onBlur:g?void 0:e=>{e.currentTarget.style.boxShadow="none",e.currentTarget.style.borderRadius="0px"},onMouseDown:e=>{e.preventDefault()},className:`${YM.titleButton} ${e.id}`,"data-id":e.id},e.locked&&q.createElement(TM,wM({},kM,{size:"small",title:n.get("Tooltip.selections.locked")})),q.createElement("span",{style:c,dir:v},e.text),t&&p&&q.createElement(TM,wM({},PM,{size:"small",style:{margin:"0 8px"}})));return q.createElement(q.Fragment,null,e.drilldown&&q.createElement(TM,wM({},LM,{size:"small",title:n.get("Tooltip.dimensions.drilldown"),style:{margin:"0 4px 0 0"}})),f,q.createElement("div",{ref:this.alignToRef,style:{overflow:"hidden",pointerEvents:p?"auto":"none",height:"100%"}},b),t&&p&&q.createElement(r,{dock:t.dock,dir:t.dir,current:e.popoverText,alignTo:this.alignToRef.current,show:this.state.open,list:this.state.alternatives,onClose:this.closePopover,changeTo:this.changeTo,instruction:n.get("Accessibility.Popover.Instructions")}))}}function o(e){return{top:"bottom",bottom:"top",left:"right",right:"left"}[e]}function a(e){return!e.isDimension&&oe.getValue(e,"hyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures.length")>0}return i.propTypes={disabled:NM.bool.isRequired,padding:NM.string,minWidth:NM.string,titleData:NM.shape({breadcrumbs:NM.arrayOf(NM.string).isRequired,drilldown:NM.bool.isRequired,index:NM.number.isRequired,locked:NM.bool.isRequired,text:NM.string.isRequired,popoverText:NM.string.isRequired,drillUp:NM.func,id:NM.string.isRequired}).isRequired,popover:NM.shape({dir:NM.string.isRequired,dock:NM.string.isRequired,changeTo:NM.func.isRequired,getAlternatives:NM.func.isRequired}),translator:NM.shape({get:NM.func.isRequired}).isRequired,selections:NM.shape({isActive:NM.func,addListener:NM.func,removeListener:NM.func}),style:NM.shape({fontSize:NM.string,color:NM.string,fontFamily:NM.string}).isRequired,isDimension:NM.bool.isRequired,hasAlternative:NM.bool.isRequired,supportConditional:NM.bool.isRequired},i.defaultProps={popover:null,selections:null,padding:"",minWidth:""},{renderer:"react",disableTriggers:!0,preferredSize:function(){const{height:t}=e.measureText({text:"M",fontSize:this.style.fontSize,fontFamily:this.style.fontFamily});return this.settings.settings.isDimension||a(this.settings.settings)?Math.max(28,t):Math.max(20,t)},render(){const{settings:{app:e,disabled:t,explicitItemInfos:n,hyperCube:r,hyperCubeDef:s,isDimension:l,minWidth:u,model:c,onChangeToAlternative:d,padding:m,rtl:f,selections:p,skipAttributeExpressions:h,translator:g,supportConditional:y=!1},layout:{dock:v}}=this.settings,b="top"!==v&&"bottom"!==v||!f?"ltr":"rtl",x=function(e,t){const n={pointerEvents:"auto",display:"flex",justifyContent:"center",alignItems:"center",height:"100%"};return"left"===e?(n.width=`${t.height}px`,n.height=`${t.width}px`,n.transform=`rotate(-90deg) translate(-${t.height}px, 0)`,n.transformOrigin="top left"):"right"===e&&(n.width=`${t.height}px`,n.height=`${t.width}px`,n.transform=`rotate(90deg) translate(0, -${t.width}px)`,n.transformOrigin="top left"),n}(v,this.rect),M=s&&s.qLayoutExclude&&s.qLayoutExclude.qHyperCubeDef,S=M&&M[l?"qDimensions":"qMeasures"]||[],E=n||r[l?"qDimensionInfo":"qMeasureInfo"],C=l?jM:VM,w=l?HM:BM,A=c&&c.colorSupport&&c.modifiers&&C({altList:S,app:e,dir:f?"rtl":"ltr",dock:o(v),model:c,onChange:d,skipAttributeExpressions:h,translator:g}),O=(D=this.settings.settings).isDimension&&oe.getValue(D,"hyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions.length")>0||a(this.settings.settings);var D;const N=E.map(((e,n)=>{const r="number"==typeof e.explicitColumn?e.explicitColumn:n,o=w(e,r,c),a=n===E.length-1;return q.createElement(q.Fragment,{key:e.cId},q.createElement(i,{popover:A,titleData:o,model:c,translator:g,selections:p,disabled:t(),style:this.style,isDimension:l,padding:m,minWidth:u,hasAlternative:O,supportConditional:y}),!a&&q.createElement("span",{style:{lineHeight:"normal",...this.style}},", "))}));return q.createElement("div",{style:x,dir:b},N)}}}function KM(){return KM=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},KM.apply(this,arguments)}function JM(e){return JM="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},JM(e)}function ZM(e){return e&&"object"===JM(e)&&e.constructor===Object}function QM(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{clone:!0},r=n.clone?KM({},e):e;return ZM(e)&&ZM(t)&&Object.keys(t).forEach((function(i){"__proto__"!==i&&(ZM(t[i])&&i in e?r[i]=QM(e[i],t[i],n):r[i]=t[i])})),r}function eS(e){var t=function(e,t){if("object"!==JM(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==JM(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===JM(t)?t:String(t)}function tS(e,t,n){return(t=eS(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nS(e){for(var t="https://mui.com/production-error/?code="+e,n=1;n<arguments.length;n+=1)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified Material-UI error #"+e+"; visit "+t+" for the full message."}function rS(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return Math.min(Math.max(t,e),n)}function iS(e){if(e.type)return e;if("#"===e.charAt(0))return iS(function(e){e=e.substr(1);var t=new RegExp(".{1,".concat(e.length>=6?2:1,"}"),"g"),n=e.match(t);return n&&1===n[0].length&&(n=n.map((function(e){return e+e}))),n?"rgb".concat(4===n.length?"a":"","(").concat(n.map((function(e,t){return t<3?parseInt(e,16):Math.round(parseInt(e,16)/255*1e3)/1e3})).join(", "),")"):""}(e));var t=e.indexOf("("),n=e.substring(0,t);if(-1===["rgb","rgba","hsl","hsla"].indexOf(n))throw new Error(nS(3,e));var r=e.substring(t+1,e.length-1).split(",");return{type:n,values:r=r.map((function(e){return parseFloat(e)}))}}function oS(e){var t=e.type,n=e.values;return-1!==t.indexOf("rgb")?n=n.map((function(e,t){return t<3?parseInt(e,10):e})):-1!==t.indexOf("hsl")&&(n[1]="".concat(n[1],"%"),n[2]="".concat(n[2],"%")),"".concat(t,"(").concat(n.join(", "),")")}function aS(e){var t="hsl"===(e=iS(e)).type?iS(function(e){var t=(e=iS(e)).values,n=t[0],r=t[1]/100,i=t[2]/100,o=r*Math.min(i,1-i),a=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(e+n/30)%12;return i-o*Math.max(Math.min(t-3,9-t,1),-1)},s="rgb",l=[Math.round(255*a(0)),Math.round(255*a(8)),Math.round(255*a(4))];return"hsla"===e.type&&(s+="a",l.push(t[3])),oS({type:s,values:l})}(e)).values:e.values;return t=t.map((function(e){return(e/=255)<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)})),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function sS(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var lS=["xs","sm","md","lg","xl"];function uS(e,t,n){var r;return KM({gutters:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return console.warn(["Material-UI: theme.mixins.gutters() is deprecated.","You can use the source of the mixin directly:","\n paddingLeft: theme.spacing(2),\n paddingRight: theme.spacing(2),\n [theme.breakpoints.up('sm')]: {\n paddingLeft: theme.spacing(3),\n paddingRight: theme.spacing(3),\n },\n "].join("\n")),KM({paddingLeft:t(2),paddingRight:t(2)},n,tS({},e.up("sm"),KM({paddingLeft:t(3),paddingRight:t(3)},n[e.up("sm")])))},toolbar:(r={minHeight:56},tS(r,"".concat(e.up("xs")," and (orientation: landscape)"),{minHeight:48}),tS(r,e.up("sm"),{minHeight:64}),r)},n)}var cS={black:"#000",white:"#fff"},dS={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#d5d5d5",A200:"#aaaaaa",A400:"#303030",A700:"#616161"},mS={50:"#e8eaf6",100:"#c5cae9",200:"#9fa8da",300:"#7986cb",400:"#5c6bc0",500:"#3f51b5",600:"#3949ab",700:"#303f9f",800:"#283593",900:"#1a237e",A100:"#8c9eff",A200:"#536dfe",A400:"#3d5afe",A700:"#304ffe"},fS={50:"#fce4ec",100:"#f8bbd0",200:"#f48fb1",300:"#f06292",400:"#ec407a",500:"#e91e63",600:"#d81b60",700:"#c2185b",800:"#ad1457",900:"#880e4f",A100:"#ff80ab",A200:"#ff4081",A400:"#f50057",A700:"#c51162"},pS={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},hS={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},gS={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},yS={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"},vS={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.54)",disabled:"rgba(0, 0, 0, 0.38)",hint:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:cS.white,default:dS[50]},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},bS={text:{primary:cS.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",hint:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:dS[800],default:"#303030"},action:{active:cS.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function xS(e,t,n,r){var i=r.light||r,o=r.dark||1.5*r;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:"light"===t?e.light=function(e,t){if(e=iS(e),t=rS(t),-1!==e.type.indexOf("hsl"))e.values[2]+=(100-e.values[2])*t;else if(-1!==e.type.indexOf("rgb"))for(var n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;return oS(e)}(e.main,i):"dark"===t&&(e.dark=function(e,t){if(e=iS(e),t=rS(t),-1!==e.type.indexOf("hsl"))e.values[2]*=1-t;else if(-1!==e.type.indexOf("rgb"))for(var n=0;n<3;n+=1)e.values[n]*=1-t;return oS(e)}(e.main,o)))}function MS(e){var t=e.primary,n=void 0===t?{light:mS[300],main:mS[500],dark:mS[700]}:t,r=e.secondary,i=void 0===r?{light:fS.A200,main:fS.A400,dark:fS.A700}:r,o=e.error,a=void 0===o?{light:pS[300],main:pS[500],dark:pS[700]}:o,s=e.warning,l=void 0===s?{light:hS[300],main:hS[500],dark:hS[700]}:s,u=e.info,c=void 0===u?{light:gS[300],main:gS[500],dark:gS[700]}:u,d=e.success,m=void 0===d?{light:yS[300],main:yS[500],dark:yS[700]}:d,f=e.type,p=void 0===f?"light":f,h=e.contrastThreshold,g=void 0===h?3:h,y=e.tonalOffset,v=void 0===y?.2:y,b=sS(e,["primary","secondary","error","warning","info","success","type","contrastThreshold","tonalOffset"]);function x(e){var t=function(e,t){var n=aS(e),r=aS(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}(e,bS.text.primary)>=g?bS.text.primary:vS.text.primary;return t}var M=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:300,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:700;if(!(e=KM({},e)).main&&e[t]&&(e.main=e[t]),!e.main)throw new Error(nS(4,t));if("string"!=typeof e.main)throw new Error(nS(5,JSON.stringify(e.main)));return xS(e,"light",n,v),xS(e,"dark",r,v),e.contrastText||(e.contrastText=x(e.main)),e},S={dark:bS,light:vS};return QM(KM({common:cS,type:p,primary:M(n),secondary:M(i,"A400","A200","A700"),error:M(a),warning:M(l),info:M(c),success:M(m),grey:dS,contrastThreshold:g,getContrastText:x,augmentColor:M,tonalOffset:v},S[p]),b)}function SS(e){return Math.round(1e5*e)/1e5}function ES(e){return SS(e)}var CS={textTransform:"uppercase"},qS='"Roboto", "Helvetica", "Arial", sans-serif';function wS(e,t){var n="function"==typeof t?t(e):t,r=n.fontFamily,i=void 0===r?qS:r,o=n.fontSize,a=void 0===o?14:o,s=n.fontWeightLight,l=void 0===s?300:s,u=n.fontWeightRegular,c=void 0===u?400:u,d=n.fontWeightMedium,m=void 0===d?500:d,f=n.fontWeightBold,p=void 0===f?700:f,h=n.htmlFontSize,g=void 0===h?16:h,y=n.allVariants,v=n.pxToRem,b=sS(n,["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"]),x=a/14,M=v||function(e){return"".concat(e/g*x,"rem")},S=function(e,t,n,r,o){return KM({fontFamily:i,fontWeight:e,fontSize:M(t),lineHeight:n},i===qS?{letterSpacing:"".concat(SS(r/t),"em")}:{},o,y)},E={h1:S(l,96,1.167,-1.5),h2:S(l,60,1.2,-.5),h3:S(c,48,1.167,0),h4:S(c,34,1.235,.25),h5:S(c,24,1.334,0),h6:S(m,20,1.6,.15),subtitle1:S(c,16,1.75,.15),subtitle2:S(m,14,1.57,.1),body1:S(c,16,1.5,.15),body2:S(c,14,1.43,.15),button:S(m,14,1.75,.4,CS),caption:S(c,12,1.66,.4),overline:S(c,12,2.66,1,CS)};return QM(KM({htmlFontSize:g,pxToRem:M,round:ES,fontFamily:i,fontSize:a,fontWeightLight:l,fontWeightRegular:c,fontWeightMedium:m,fontWeightBold:p},E),b,{clone:!1})}function AS(){return["".concat(arguments.length<=0?void 0:arguments[0],"px ").concat(arguments.length<=1?void 0:arguments[1],"px ").concat(arguments.length<=2?void 0:arguments[2],"px ").concat(arguments.length<=3?void 0:arguments[3],"px rgba(0,0,0,").concat(.2,")"),"".concat(arguments.length<=4?void 0:arguments[4],"px ").concat(arguments.length<=5?void 0:arguments[5],"px ").concat(arguments.length<=6?void 0:arguments[6],"px ").concat(arguments.length<=7?void 0:arguments[7],"px rgba(0,0,0,").concat(.14,")"),"".concat(arguments.length<=8?void 0:arguments[8],"px ").concat(arguments.length<=9?void 0:arguments[9],"px ").concat(arguments.length<=10?void 0:arguments[10],"px ").concat(arguments.length<=11?void 0:arguments[11],"px rgba(0,0,0,").concat(.12,")")].join(",")}var OS=["none",AS(0,2,1,-1,0,1,1,0,0,1,3,0),AS(0,3,1,-2,0,2,2,0,0,1,5,0),AS(0,3,3,-2,0,3,4,0,0,1,8,0),AS(0,2,4,-1,0,4,5,0,0,1,10,0),AS(0,3,5,-1,0,5,8,0,0,1,14,0),AS(0,3,5,-1,0,6,10,0,0,1,18,0),AS(0,4,5,-2,0,7,10,1,0,2,16,1),AS(0,5,5,-3,0,8,10,1,0,3,14,2),AS(0,5,6,-3,0,9,12,1,0,3,16,2),AS(0,6,6,-3,0,10,14,1,0,4,18,3),AS(0,6,7,-4,0,11,15,1,0,4,20,3),AS(0,7,8,-4,0,12,17,2,0,5,22,4),AS(0,7,8,-4,0,13,19,2,0,5,24,4),AS(0,7,9,-4,0,14,21,2,0,5,26,4),AS(0,8,9,-5,0,15,22,2,0,6,28,5),AS(0,8,10,-5,0,16,24,2,0,6,30,5),AS(0,8,11,-5,0,17,26,2,0,6,32,5),AS(0,9,11,-5,0,18,28,2,0,7,34,6),AS(0,9,12,-6,0,19,29,2,0,7,36,6),AS(0,10,13,-6,0,20,31,3,0,8,38,7),AS(0,10,13,-6,0,21,33,3,0,8,40,7),AS(0,10,14,-6,0,22,35,3,0,8,42,7),AS(0,11,14,-7,0,23,36,3,0,9,44,8),AS(0,11,15,-7,0,24,38,3,0,9,46,8)],DS={borderRadius:4};function NS(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8;if(e.mui)return e;var t=function(e){var t=e.spacing||8;return"number"==typeof t?function(e){return t*e}:Array.isArray(t)?function(e){return t[e]}:"function"==typeof t?t:function(){}}({spacing:e}),n=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return 0===n.length?t(1):1===n.length?t(n[0]):n.map((function(e){if("string"==typeof e)return e;var n=t(e);return"number"==typeof n?"".concat(n,"px"):n})).join(" ")};return Object.defineProperty(n,"unit",{get:function(){return e}}),n.mui=!0,n}var IS={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},TS={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function LS(e){return"".concat(Math.round(e),"ms")}var kS={easing:IS,duration:TS,create:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["all"],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.duration,r=void 0===n?TS.standard:n,i=t.easing,o=void 0===i?IS.easeInOut:i,a=t.delay,s=void 0===a?0:a;return sS(t,["duration","easing","delay"]),(Array.isArray(e)?e:[e]).map((function(e){return"".concat(e," ").concat("string"==typeof r?r:LS(r)," ").concat(o," ").concat("string"==typeof s?s:LS(s))})).join(",")},getAutoHeightDuration:function(e){if(!e)return 0;var t=e/36;return Math.round(10*(4+15*Math.pow(t,.25)+t/5))}},RS={mobileStepper:1e3,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};function PS(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.breakpoints,n=void 0===t?{}:t,r=e.mixins,i=void 0===r?{}:r,o=e.palette,a=void 0===o?{}:o,s=e.spacing,l=e.typography,u=void 0===l?{}:l,c=sS(e,["breakpoints","mixins","palette","spacing","typography"]),d=MS(a),m=function(e){var t=e.values,n=void 0===t?{xs:0,sm:600,md:960,lg:1280,xl:1920}:t,r=e.unit,i=void 0===r?"px":r,o=e.step,a=void 0===o?5:o,s=sS(e,["values","unit","step"]);function l(e){var t="number"==typeof n[e]?n[e]:e;return"@media (min-width:".concat(t).concat(i,")")}function u(e,t){var r=lS.indexOf(t);return r===lS.length-1?l(e):"@media (min-width:".concat("number"==typeof n[e]?n[e]:e).concat(i,") and ")+"(max-width:".concat((-1!==r&&"number"==typeof n[lS[r+1]]?n[lS[r+1]]:t)-a/100).concat(i,")")}return KM({keys:lS,values:n,up:l,down:function(e){var t=lS.indexOf(e)+1,r=n[lS[t]];return t===lS.length?l("xs"):"@media (max-width:".concat(("number"==typeof r&&t>0?r:e)-a/100).concat(i,")")},between:u,only:function(e){return u(e,e)},width:function(e){return n[e]}},s)}(n),f=NS(s),p=QM({breakpoints:m,direction:"ltr",mixins:uS(m,f,i),overrides:{},palette:d,props:{},shadows:OS,typography:wS(d,u),spacing:f,shape:DS,transitions:kS,zIndex:RS},c),h=arguments.length,g=new Array(h>1?h-1:0),y=1;y<h;y++)g[y-1]=arguments[y];return p=g.reduce((function(e,t){return QM(e,t)}),p)}const $S=function(){return PS.apply(void 0,arguments)}({palette:{text:{primary:"rgba(89, 89, 89, 0.8)",secondary:"rgba(0, 0, 0, 0.55)",disabled:"rgba(0, 0, 0, 0.3)"},action:{disabled:"rgba(0, 0, 0, 0.3)"}},typography:{fontFamily:'"Source Sans Pro", "Arial", "sans-serif"',button:{textTransform:"initial",fontWeight:400}},shape:{borderRadius:2},shadows:["none","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)"],props:{MuiButtonBase:{disableRipple:!0}}});const FS=k({productionPrefix:"q89f5",disableGlobal:!0,seed:""});function zS(){function e({x:e,y:t,width:n,height:r,scaleRatio:i,margin:o}={}){const a={x:0,y:0,width:0,height:0,scaleRatio:{x:1,y:1},margin:{left:0,top:0}};return a.x=Number.isNaN(e)?a.x:e,a.y=Number.isNaN(t)?a.y:t,a.width=Number.isNaN(n)?a.width:n,a.height=Number.isNaN(r)?a.height:r,void 0!==i&&(a.scaleRatio.x=Number.isNaN(i.x)?a.scaleRatio.x:i.x,a.scaleRatio.y=Number.isNaN(i.y)?a.scaleRatio.y:i.y),void 0!==o&&(a.margin.left=Number.isNaN(o.left)?0:o.left,a.margin.top=Number.isNaN(o.top)?0:o.top),a}return function(t={}){const{createElement:n=document.createElement.bind(document)}=t;let r,i=e();const o={element:()=>r,root:()=>r,appendTo:e=>(r||(r=n("div"),r.style.position="absolute",r.style["-webkit-font-smoothing"]="antialiased",r.style["-moz-osx-font-smoothing"]="antialiased",r.style.pointerEvents="none"),e.appendChild(r),r),render(e){if(!r)return!1;const t=i.scaleRatio.x,n=i.scaleRatio.y;return r.style.left=`${Math.round(i.margin.left+i.x*t)}px`,r.style.top=`${Math.round(i.margin.top+i.y*n)}px`,r.style.width=`${Math.round(i.width)}px`,r.style.height=`${Math.round(i.height)}px`,r.style.transform=`scale(${t}, ${n})`,r.style.transformOrigin="top left",L.render(function(e,t){return q.createElement(R,{generateClassName:t},q.createElement(P,{theme:$S},e))}(e,FS),r),!0},itemsAt:()=>[],findShapes:()=>[],clear:()=>(r&&L.unmountComponentAtNode(r),o),destroy(){r&&r.parentElement&&(L.unmountComponentAtNode(r),r.parentElement.removeChild(r)),r=null},size:t=>(t&&(i=e(t)),i)};return o}}function _S(){return function(e){e.renderer("react",zS()),e.component("data-title",XM(e.renderer("svg")())),e.component("disclaimer",function(){class e extends q.Component{render(){const{label:e,spanStyle:t}=this.props;return q.createElement(q.Fragment,null,q.createElement("span",{ref:this.alignToRef,style:t,title:e},e))}}return e.propTypes={label:NM.string.isRequired,spanStyle:NM.shape().isRequired},{renderer:"react",disableTriggers:!0,preferredSize:function(){return 22},render(){const{settings:{label:t,rtl:n},layout:{dock:r},style:i={}}=this.settings,o="top"!==r&&"bottom"!==r||!n?"ltr":"rtl",a=function(e,t,n){const r={pointerEvents:"auto",display:"flex",justifyContent:"center",alignItems:"center",color:"#7b7a78",fontStyle:"italic",fontSize:"13px",fontFamily:e.fontFamily||'"Source Sans Pro", "Arial", "sans-serif"'};switch(t){case"left":r.width=`${n.height}px`,r.transform=`rotate(-90deg) translate(-${n.height}px, 0)`,r.transformOrigin="top left";break;case"right":r.width=`${n.height}px`,r.transform=`rotate(90deg) translate(0, -${n.width}px)`,r.transformOrigin="top left";break;case"center":r.width=`${n.width}px`,r.height=`${n.height}px`,r.color="#595959",r.fontStyle="normal",r.fontSize="1.2em",r.textAlign="center";break;default:r.justifyContent="flex-start",r.alignItems="flex-start"}return r}(i,r,this.rect),s="center"===r?t:`* ${t}`,l="center"!==r?{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}:{};return q.createElement("div",{style:a,dir:o},q.createElement(q.Fragment,null,q.createElement(e,{label:s,spanStyle:l})))}}}())}}function jS(e,t,n,r){const i=function(t){const n=String(t);return e(n)};return i.ticks=()=>t.map((t=>{const o=i([t.data.value,r?n-1:0]),a=i([t.data.value,r?0:n-1])+e.bandwidth();return{position:(o+a)/2,label:t.label,data:t.data,start:o,end:a}})),i.bandwidth=()=>e.bandwidth(),i.data=()=>e.data(),i.domain=()=>e.domain(),i.pxScale=function(r){const i=e.pxScale(r);return i===e?this:jS(i,t,n)},i}function HS(e){const t=e.scale("band");e.scale("group-by-measure",(function(e={},n={},r={}){const i=t(e,n,r),o=i.domain(),a=i.ticks(),s=[],l=e.measureCount;return o.forEach(((e,t)=>{for(let t=0;t<l;++t)s.push(String([e,t]));s.push(`SPACER_${t}_SPACER`)})),s.splice(-1),i.domain(s),jS(i,a,l,e.invert)}))}const VS={getDefaultSettings:({size:e=10,fill:t="#999",alignment:n}={})=>({show:!0,type:"n-polygon",fill:t,stroke:"#000",strokeWidth:0,size:e,sides:3,startAngle:-90,alignment:n}),createOob({oob:e,dockValue:t,boxCenter:n,rendWidth:r,rendHeight:i,flipXY:o,symbol:a}){let s="x",l="y",u=r,c=i,d=t<.5?90:-90;return o&&(s="y",l="x",u=i,c=r,d=t<.5?180:0),a(G({},e,{[s]:n*u,[l]:c-Math.max(e.size/2,Math.min(t*c,c-e.size/2)),startAngle:d}))}};function BS({i:e,width:t,height:n,resolved:r,keys:i,flipXY:o,calcKey:a="box"}){let s,l=null,u=null;void 0!==r.major.settings.binStart?(l=r.major.items[e].binStart,u=r.major.items[e].binEnd,s=r.major.settings.binStart.scale):(s=r.major.settings.major.scale,l=s?r.major.items[e].major:0);let c=0;s?s.bandwidth?(c=s.bandwidth(),l-=c/2):c=u-l:c=1;const d=G({},{major:l,majorEnd:u},r.minor.items[e]);i.forEach((t=>{d[t]=r[t].items[e]}));const m=o?n:t,f=function({bandwidth:e,width:t,minWidthPx:n,maxWidthPx:r,maxMajorWidth:i}){const o=e>=0?1:-1;let a=Math.min(o*e*t,Number.isNaN(Number(r))?i:r/i);return a=Number.isNaN(Number(n))?a:Math.max(n/i,a),a*o}({bandwidth:c,width:d[a].width,minWidthPx:d[a].minWidthPx,maxWidthPx:d[a].maxWidthPx,maxMajorWidth:m}),p=(c-f)/2,h=p+d.major+f/2;return{item:d,boxCenter:h,boxWidth:f,boxPadding:p,rendWidth:t,rendHeight:n}}function US({keys:e,data:t,defaultSettings:n,style:r,settings:i,width:o,height:a,resolver:s}){const l=G(!0,{},n||{},r||{}),u={major:"horizontal"===i.orientation?a:o,minor:"horizontal"===i.orientation?o:a},c=i.major;let d;d="object"==typeof c&&"object"==typeof c.ref&&void 0!==c.ref.start&&void 0!==c.ref.end?s.resolve({data:t,defaults:{start:0,end:1},scaled:u,settings:G(!0,{},{binStart:{scale:i.major.scale,ref:i.major.ref.start},binEnd:{scale:i.major.scale,ref:i.major.ref.end}})}):"object"==typeof c&&void 0!==c.binStart&&void 0!==c.binEnd?s.resolve({data:t,defaults:{start:0,end:1},scaled:u,settings:G(!0,{},{binStart:{scale:i.major.scale,ref:"binStart"},binEnd:{scale:i.major.scale,ref:"binEnd"}},i.major)}):s.resolve({data:t,scaled:u,defaults:{major:.5},settings:{major:i.major}});const m=i.minor||{};let f;const p={major:d,minor:s.resolve({data:t,defaults:{start:0,end:1},scaled:u,settings:G(!0,{},{start:{scale:m.scale,ref:"start"},end:{scale:m.scale,ref:"end"},min:{scale:m.scale,ref:"min"},max:{scale:m.scale,ref:"max"},med:{scale:m.scale,ref:"med"}},m)})};for(let n=0,r=e.length;n<r;n++)f=e[n],p[f]=s.resolve({data:t,defaults:l[f],settings:i[f],scaled:u});return p}const YS=["oob"];const WS={require:["chart","resolver","symbol"],defaultSettings:{settings:{size:10},data:{},style:{}},created(){this.state={}},preferredSize(){return this.settings.settings.size},render(){const{width:e,height:t}=this.rect,{dockValue:n}=this.settings.settings,r="horizontal"===this.settings.settings.orientation,{data:i,style:o,resolver:a,symbol:s}=this,l=US({keys:YS,data:i,defaultSettings:{oob:VS.getDefaultSettings()},style:o,settings:this.settings.settings,width:e,height:t,resolver:a}),{settings:u,items:c}=l,d=function({width:e,height:t,flipXY:n,resolved:r,keys:i,symbol:o,dockValue:a,_calcItemRenderingOpts:s=BS}){const l=[],{items:u}=r.major;for(let c=0,d=u.length;c<d;c++){const{item:d,boxCenter:m,rendWidth:f,rendHeight:p}=s({i:c,width:e,height:t,resolved:r,keys:i,flipXY:n,calcKey:"oob"}),h=u[c].data,g=[];if(d.oob.show){g.push(VS.createOob({oob:d.oob,dockValue:a,boxCenter:m,rendWidth:f,rendHeight:p,flipXY:n,symbol:o}));const e={type:"container",data:h,collider:{type:"bounds"},children:g};l.push(e)}}return l}({items:c,settings:u,width:e,height:t,flipXY:r,resolved:l,keys:YS,symbol:s,dockValue:n});return d}},GS={size:25,hat:{show:!0,fill:"#999",stroke:"#000",strokeWidth:0,strokeLinejoin:"miter",width:1,maxWidthPx:void 0,minWidthPx:1,minHeightPx:1,alignment:0}},XS=["hat"];function KS(e,t=!0){let n="";for(let t=0;t<e.length;t++){const r=e[t];n+=0===t?`M${r.x} ${r.y}`:`L${r.x} ${r.y}`,n+=" "}return t&&(n+="Z"),n}function JS({item:e,boxWidth:t,boxPadding:n,rendWidth:r,rendHeight:i,flipXY:o}){let a="x",s="y",l=r,u=i,c=e.hat.alignment||0;o&&(a="y",s="x",l=i,u=r,c=1-c);const d=(n+e.major)*l;let m=[{[a]:d,[s]:0+u},{[a]:d+t*c*l,[s]:8},{[a]:d+t*l,[s]:0+u},{[a]:d+t*l,[s]:0+u+10},{[a]:d,[s]:0+u+10}];const f=G({},e.hat,{type:"path",d:KS(m)});m=[{[a]:d,[s]:0},{[a]:d+t*(1-c)*l,[s]:0+u-8},{[a]:d+t*l,[s]:0},{[a]:d+t*l,[s]:-10},{[a]:d,[s]:-10}];return[f,G({},e.hat,{type:"path",d:KS(m)})]}const ZS={require:["chart","resolver","symbol"],defaultSettings:{settings:{size:25},data:{},style:{hat:"$shape"}},created(){this.state={}},preferredSize(){return this.settings.settings.size},render(){const{width:e,height:t}=this.rect,n="horizontal"===this.settings.settings.orientation,{data:r,style:i,resolver:o}=this,a=US({keys:XS,data:r,defaultSettings:GS,style:i,settings:this.settings.settings,width:e,height:t,resolver:o}),{settings:s,items:l}=a,u=function({width:e,height:t,flipXY:n,resolved:r,keys:i,_calcItemRenderingOpts:o=BS}){const a=[],{items:s}=r.major;for(let l=0,u=s.length;l<u;l++){const{item:u,boxWidth:c,boxPadding:d,rendWidth:m,rendHeight:f}=o({i:l,width:e,height:t,resolved:r,keys:i,flipXY:n,calcKey:"hat"}),p=s[l].data,h=[];u.hat.show&&h.push(...JS({item:u,boxWidth:c,boxPadding:d,rendWidth:m,rendHeight:f,flipXY:n}));const g={type:"container",data:p,collider:{type:"bounds"},children:h};a.push(g)}return a}({items:l,settings:s,width:e,height:t,flipXY:n,resolved:a,keys:XS});return u}};var QS={UNCLASSIFIED:"unclassified",EQUAL_EQUAL:"equal-equal",EQUAL_HIGHER:"equal-higher",EQUAL_LOWER:"equal-lower",EQUAL_VOID:"equal-void",HIGHER_EQUAL:"higher-equal",HIGHER_HIGHER_ACUTE:"higher-higher-acute",HIGHER_HIGHER_OBTUSE:"higher-higher-obtuse",HIGHER_LOWER_NEGATIVE:"higher-lower-negative",HIGHER_LOWER_POSITIVE:"higher-lower-positive",HIGHER_VOID:"higher-void",LOWER_EQUAL:"lower-equal",LOWER_HIGHER_NEGATIVE:"lower-higher-negative",LOWER_HIGHER_POSITIVE:"lower-higher-positive",LOWER_LOWER_ACUTE:"lower-lower-acute",LOWER_LOWER_OBTUSE:"lower-lower-obtuse",LOWER_VOID:"lower-void",VOID_EQUAL:"void-equal",VOID_HIGHER:"void-higher",VOID_LOWER:"void-lower",VOID_VOID:"void-void"};function eE(e,t){return Math.atan2(t.y-e.y,t.x-e.x)*(180/Math.PI)}function tE(e,t,n){const r=Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2),i=Math.sqrt((t.x-n.x)**2+(t.y-n.y)**2),o=Math.sqrt((n.x-e.x)**2+(n.y-e.y)**2);return Math.acos((i*i+r*r-o*o)/(2*i*r))*(180/Math.PI)}function nE({previous:e,current:t,next:n}){const r=e&&e.value,i=t&&t.value,o=n&&n.value;return e||n?e?n?r===i?i===o?QS.EQUAL_EQUAL:i<o?QS.EQUAL_HIGHER:QS.EQUAL_LOWER:i===o?r>i?QS.HIGHER_EQUAL:QS.LOWER_EQUAL:r>i?i<o?tE(e,t,n)>90?QS.HIGHER_HIGHER_OBTUSE:QS.HIGHER_HIGHER_ACUTE:eE(e,t)>eE(e,n)?QS.HIGHER_LOWER_POSITIVE:QS.HIGHER_LOWER_NEGATIVE:i>o?tE(e,t,n)>90?QS.LOWER_LOWER_OBTUSE:QS.LOWER_LOWER_ACUTE:eE(e,t)>eE(e,n)?QS.LOWER_HIGHER_POSITIVE:QS.LOWER_HIGHER_NEGATIVE:r===i?QS.EQUAL_VOID:r>i?QS.HIGHER_VOID:QS.LOWER_VOID:i===o?QS.VOID_EQUAL:i<o?QS.VOID_HIGHER:QS.VOID_LOWER:QS.VOID_VOID}function rE({bounds:e,size:t}){const{x:n,y:r,width:i,height:o}=e,{insideStrategy:a}=t;return"center"===a?Math.floor(n+i/2)>=0&&Math.ceil(n+i/2)<=t.width&&Math.floor(r+o/2)>=0&&Math.ceil(r+o/2)<=t.height:Math.floor(n+i)>0&&Math.ceil(n)<t.width&&Math.floor(r+o/2)>=0&&Math.ceil(r+o/2)<=t.height}const iE={X:1,Y:0};function oE({node:e,line:t,groupIndex:n,extract:r,style:i,measureText:o,size:a,horizontal:s,rtl:l,meta:u,showLabel:c}){const d=r.label(e.data);if("string"!=typeof d&&"number"!=typeof d||""===d)return!1;const m=o({fontFamily:i.fontFamily,fontSize:i.fontSize,text:d}),{localBounds:f}=e,{"stroke-width":p}=e.attrs,h=r.pointValue(e.data),g={x:f.x+f.width/2,y:f.y+f.height/2,width:m.width+2*iE.X,height:m.height+2*iE.Y},y=`${g.x}-${g.y}`,v=!s&&!l,b=s?a.height:a.width,x=(s?g.y:g.x)/b,M=(v?1-x:x)<=(b<=200?.25:.1),S={key:y,node:e,line:t,group:n,value:h,labelMeasurements:m,bounds:g,inside:rE({bounds:f,size:a}),border:p?p/2:0,classification:QS.UNCLASSIFIED,setClassification(e){S.classification=e},preferences:[],setPreferences(e){S.preferences.push(...e)},placement:void 0,setPlacement(e){S.placement=e},duplicate:!1,setDuplicate(){S.duplicate=!0},extreme:u.getExtreme(y),elite:M,show:c(e)};return S}function aE({nodes:e,extract:t,style:n,measureText:r,size:i,horizontal:o,rtl:a,showLabel:s}){const l=function({nodes:e}){const t={top:[],right:[],bottom:[],left:[]},n=e.map((e=>{const{localBounds:t}=e,n={x:t.x+t.width/2,y:t.y+t.height/2};return{key:`${n.x}-${n.y}`,center:n}})),r=n.reduce(((e,t)=>((!e.top||t.center.y<e.top.center.y)&&(e.top=t),(!e.right||t.center.x>e.right.center.x)&&(e.right=t),(!e.bottom||t.center.y>e.bottom.center.y)&&(e.bottom=t),(!e.left||t.center.x<e.left.center.x)&&(e.left=t),e)),{});return t.top=n.filter((e=>e.center.y===r.top.center.y)).map((e=>e.key)),t.right=n.filter((e=>e.center.x===r.right.center.x)).map((e=>e.key)),t.bottom=n.filter((e=>e.center.y===r.bottom.center.y)).map((e=>e.key)),t.left=n.filter((e=>e.center.x===r.left.center.x)).map((e=>e.key)),{getExtrema:e=>({top:-1!==t.top.indexOf(e),right:-1!==t.right.indexOf(e),bottom:-1!==t.bottom.indexOf(e),left:-1!==t.left.indexOf(e)}),getExtreme:e=>{const{top:n,right:r,bottom:i,left:o}=t;return[n,r,i,o].some((t=>-1!==t.indexOf(e)))}}}({nodes:e}),u=function({nodes:e,by:t,lineIndex:n}){const r=e.reduce(((e,r,i)=>{const o=t(r.data);return e[o]||(e[o]={items:[],index:i}),e[o].items.push({node:r,line:r.data[n].value}),e}),{});return Object.keys(r).map((e=>r[e])).sort(((e,t)=>e.index-t.index)).map((e=>e.items))}({nodes:e,by:t.majorValue,lineIndex:t.lineIndex}).map(((e,u)=>e.map((e=>({line:e.line,item:oE({node:e.node,line:e.line,groupIndex:u,extract:t,style:n,measureText:r,size:i,horizontal:o,rtl:a,meta:l,showLabel:s})}))).filter((e=>e.item)).reduce(((e,t)=>(e[t.line]=t.item,e)),{})));return u.filter((e=>Object.keys(e).length))}var sE={TOP:"top",TOP_RIGHT:"top-right",RIGHT:"right",BOTTOM_RIGHT:"bottom-right",BOTTOM:"bottom",BOTTOM_LEFT:"bottom-left",LEFT:"left",TOP_LEFT:"top-left"},lE={[QS.EQUAL_EQUAL]:[sE.TOP,sE.BOTTOM],[QS.EQUAL_HIGHER]:[sE.BOTTOM,sE.BOTTOM_RIGHT],[QS.EQUAL_LOWER]:[sE.TOP,sE.TOP_RIGHT],[QS.EQUAL_VOID]:[sE.TOP,sE.BOTTOM],[QS.HIGHER_EQUAL]:[sE.LEFT,sE.BOTTOM_LEFT,sE.TOP,sE.TOP_RIGHT],[QS.HIGHER_HIGHER_ACUTE]:[sE.BOTTOM,sE.BOTTOM_LEFT,sE.LEFT,sE.TOP_RIGHT],[QS.HIGHER_HIGHER_OBTUSE]:[sE.BOTTOM,sE.TOP],[QS.HIGHER_LOWER_NEGATIVE]:[sE.TOP,sE.TOP_RIGHT,sE.RIGHT],[QS.HIGHER_LOWER_POSITIVE]:[sE.BOTTOM,sE.BOTTOM_LEFT,sE.LEFT],[QS.HIGHER_VOID]:[sE.TOP],[QS.LOWER_EQUAL]:[sE.TOP],[QS.LOWER_HIGHER_NEGATIVE]:[sE.TOP,sE.TOP_LEFT],[QS.LOWER_HIGHER_POSITIVE]:[sE.BOTTOM_RIGHT],[QS.LOWER_LOWER_ACUTE]:[sE.TOP,sE.TOP_LEFT,sE.LEFT,sE.TOP_RIGHT,sE.RIGHT],[QS.LOWER_LOWER_OBTUSE]:[sE.TOP,sE.BOTTOM],[QS.LOWER_VOID]:[sE.TOP],[QS.VOID_EQUAL]:[sE.TOP],[QS.VOID_HIGHER]:[sE.TOP,sE.BOTTOM],[QS.VOID_LOWER]:[sE.TOP,sE.BOTTOM,sE.LEFT],[QS.VOID_VOID]:[sE.TOP]};function uE({nodes:e,extract:t,style:n,measureText:r,size:i,horizontal:o,rtl:a,showLabel:s}){const l=aE({nodes:e,extract:t,style:n,measureText:r,size:i,horizontal:o,rtl:a,showLabel:s}),u=[...l.reduce(((e,t)=>(e.push(...Object.keys(t).map((e=>t[e]))),e)),[])],[c]=u,d=function({groups:e,threshold:t}){const n=e.map((e=>Object.keys(e).map((t=>e[t])))),r={};for(let e=0;e<=n.length;e++){const t=n[e];if(t)for(let e=0;e<t.length;e++){const n=t[e],{line:i}=n;r[i]||(r[i]=[]),r[i].push(n.bounds)}}const i=Object.keys(r).map((e=>r[e])),o=[];for(let e=0;e<i.length;e++)for(let n=0;n<i[e].length-1;n++){const r=i[e][n],a=i[e][n+1],s={x1:r.x,y1:r.y,x2:a.x,y2:a.y},l=s.x1-s.x2,u=s.y1-s.y2;Math.sqrt(l*l+u*u)>t&&o.push(s)}return o}({groups:l,threshold:c.node.localBounds.height}),m={getItems:()=>u,getLines:()=>d};return function({groups:e}){for(let t=0;t<e.length;t++){const n=Object.keys(e[t]).map((n=>e[t][n]));for(let r=0;r<n.length;r++){const i=n[r],o=nE({previous:e[t-1]&&e[t-1][i.line],current:i,next:e[t+1]&&e[t+1][i.line]});i.setClassification(o)}}}({groups:l}),m.getItems().forEach((e=>e.setPreferences(lE[e.classification]))),m}function cE({item:e,placement:t,size:n}){return t.x>=0-n.edgeBleed.left&&t.x<=n.width-e.bounds.width+n.edgeBleed.right&&t.y>=0-n.edgeBleed.top&&t.y<=n.height-e.bounds.height}function dE({line1:e,line2:t}){const n=(t.y2-t.y1)*(e.x2-e.x1)-(t.x2-t.x1)*(e.y2-e.y1);if(0===n)return!1;const r=((t.x2-t.x1)*(e.y1-t.y1)-(t.y2-t.y1)*(e.x1-t.x1))/n,i=((e.x2-e.x1)*(e.y1-t.y1)-(e.y2-e.y1)*(e.x1-t.x1))/n;return r>=0&&r<=1&&i>=0&&i<=1}function mE({candidate:e,lines:t,rects:n}){return!!n.some((t=>function({rect1:e,rect2:t}){return!(t.x>e.x+e.width||t.x+t.width<e.x||t.y>e.y+e.height||t.y+t.height<e.y)}({rect1:t,rect2:e})))||t.some((t=>function({line:e,rect:t}){const n={x:t.x,y:t.y},r={x:t.x+t.width,y:t.y},i={x:t.x+t.width,y:t.y+t.height},o={x:t.x,y:t.y+t.height},a={x1:r.x,y1:r.y,x2:i.x,y2:i.y},s={x1:i.x,y1:i.y,x2:o.x,y2:o.y},l={x1:o.x,y1:o.y,x2:n.x,y2:n.y};return dE({line1:e,line2:{x1:n.x,y1:n.y,x2:r.x,y2:r.y}})||dE({line1:e,line2:a})||dE({line1:e,line2:s})||dE({line1:e,line2:l})}({line:t,rect:e})))}const fE={x:0,width:0,y:0,height:0};const pE=({item:e})=>({x:e.bounds.x-e.bounds.width/2,y:e.bounds.y-e.bounds.height-e.node.localBounds.height/2-e.border}),hE=({item:e})=>({x:e.bounds.x,y:e.bounds.y-e.bounds.height-e.node.localBounds.height/2-e.border}),gE=({item:e})=>({x:e.bounds.x+e.node.localBounds.width/2+e.border,y:e.bounds.y-e.bounds.height/2}),yE=({item:e})=>({x:e.bounds.x,y:e.bounds.y+e.node.localBounds.height/2+e.border}),vE=({item:e})=>({x:e.bounds.x-e.bounds.width/2,y:e.bounds.y+e.node.localBounds.height/2+e.border}),bE=({item:e})=>({x:e.bounds.x-e.bounds.width,y:e.bounds.y+e.node.localBounds.height/2+e.border}),xE=({item:e})=>({x:e.bounds.x-e.bounds.width-e.node.localBounds.width/2-e.border,y:e.bounds.y-e.bounds.height/2}),ME=({item:e})=>({x:e.bounds.x-e.bounds.width,y:e.bounds.y-e.bounds.height-e.node.localBounds.height/2-e.border});var SE={X:2.5,Y:4};const EE=[sE.TOP,sE.TOP_LEFT,sE.TOP_RIGHT],CE=[sE.BOTTOM,sE.BOTTOM_LEFT,sE.BOTTOM_RIGHT];function qE({position:e}){const t={x:SE.X,width:-2*SE.X,y:0,height:0},n=EE.indexOf(e)>-1,r=CE.indexOf(e)>-1;return n&&(t.y=SE.Y,t.height=-SE.Y),r&&(t.height=-SE.Y),t}function wE({cx:e,cy:t,r:n,degrees:r}){const i=r*(Math.PI/180);return{x:Math.round(e+n*Math.sin(i)),y:Math.round(t+n*-Math.cos(i))}}function AE({coordinates:e,degrees:t,item:n}){const r={x:e.x,y:e.y};return t<=90?r.y-=n.bounds.height:t>180&&t<=270?r.x-=n.bounds.width:t>270&&(r.y-=n.bounds.height,r.x-=n.bounds.width),r}const OE=15;function DE({item:e,validator:t,force:n=!1}){const r=function({item:e}){return[e.node.localBounds.height/2*Math.sqrt(2)]}({item:e}),i=e.bounds.x,o=e.bounds.y;for(let a=0;a<r.length;a++){const s=r[a];for(let r=40;r<=180;r+=OE){const a=AE({coordinates:wE({cx:i,cy:o,r:s,degrees:r}),degrees:r,item:e});if(t({item:e,placement:a,ignoreLines:n}).valid)return a}for(let r=320;r>180;r-=OE){const a=AE({coordinates:wE({cx:i,cy:o,r:s,degrees:r}),degrees:r,item:e});if(t({item:e,placement:a,ignoreLines:n}).valid)return a}}return!1}const NE=void 0;function IE({item:e,validator:t,force:n=!1}){const r=[...e.preferences,...Object.keys(sE).map((e=>sE[e])).filter((t=>-1===e.preferences.indexOf(t)))],i={[sE.TOP]:pE,[sE.TOP_RIGHT]:hE,[sE.RIGHT]:gE,[sE.BOTTOM_RIGHT]:yE,[sE.BOTTOM]:vE,[sE.BOTTOM_LEFT]:bE,[sE.LEFT]:xE,[sE.TOP_LEFT]:ME},o=[];for(let a=0;a<r.length;a++){const s=r[a],l=i[s]({item:e}),u=qE({position:s}),c=t({item:e,placement:l,adjustment:u,ignoreLines:n});if(n&&c.inside&&o.push(l),c.valid)return l}const a=()=>DE({item:e,validator:t,force:n});if(n){const e=a();return e||(o[0]||NE)}return(e.extreme||e.elite)&&a()||NE}function TE({model:e,size:t,all:n}){const r={},i=e.getItems(),o=[...i.map((e=>({x:e.node.localBounds.x-e.border+1,y:e.node.localBounds.y-e.border+1,height:e.node.localBounds.height+2*e.border-2,width:e.node.localBounds.width+2*e.border-2})))],a=[],s=e.getLines();i.forEach((e=>{const{data:i}=e.node;if(!e.show||!e.inside||i.null&&i.null.value||i.interpolated&&i.interpolated.value)return;const{key:l}=e;if(r[l])return void e.setDuplicate();r[l]=!0;const u=function({size:e,lines:t,placements:n}){return function({item:r,placement:i,adjustment:o=fE,ignoreLines:a=!1}){const s={inside:cE({item:r,placement:i,size:e}),collides:!0,valid:!1};return s.inside?(s.collides=mE({candidate:{x:i.x+o.x,y:i.y+o.y,width:r.bounds.width+o.width,height:r.bounds.height+o.height},lines:a?[]:t,rects:n}),s.valid=!s.collides,s):s}}({size:t,lines:s,placements:o}),c=IE({item:e,validator:u});c?(c.height=e.bounds.height,c.width=e.bounds.width,o.push(c),e.setPlacement(c)):n&&a.push({item:e,validator:u})})),a.forEach((e=>{const{item:t,validator:n}=e,r=IE({item:t,validator:n,force:!0});r&&(r.height=t.bounds.height,r.width=t.bounds.width,o.push(r),t.setPlacement(r))}))}var LE={require:["chart","renderer"],defaultSettings:{settings:{orientation:"horizontal",rtl:!1,connect:!1,all:!1,label:()=>{},showLabel:()=>!0,pointValue:()=>{},majorValue:()=>{},target:{point:"point-component",allPoints:[]},lineIndex:"line",insideStrategy:"edge",labelSpace:{use:()=>!1,size:10}},style:{fontFamily:'"Source Sans Pro", "Arial", "sans-serif"',fontSize:"12px",fill:"#333"}},preferredSize(){const e={edgeBleed:{top:0,right:0,left:0}},{orientation:t,rtl:n,labelSpace:r}=this.settings.settings,{use:i,size:o}=r;if(i()){const r="horizontal"===t;e.edgeBleed.top=r?o:0,e.edgeBleed[n?"left":"right"]=r?0:o}return e},render(){const{settings:e}=this.settings,{target:t,enabled:n}=e;if(!this.chart.component(t.point))return[];if("function"==typeof n&&!n())return[];const{allPoints:r}=t,i=r.length?e=>r.includes(e.key):e=>e.key===t.point,o=this.chart.findShapes("circle").filter(i);if(!o.length)return[];const a="horizontal"===e.orientation,s=a?"x":"y";o.sort(((e,t)=>e.localBounds[s]-t.localBounds[s]));const l={label:e.label,pointValue:e.pointValue,majorValue:e.majorValue,lineIndex:e.lineIndex},{height:u,width:c,edgeBleed:d}=this.rect,m={height:u,width:c,edgeBleed:d,insideStrategy:e.insideStrategy},{style:f}=this,p=uE({nodes:o,extract:l,style:f,measureText:this.renderer.measureText,size:m,horizontal:a,rtl:e.rtl,showLabel:e.showLabel});return function({model:e}){e.getItems().sort(((e,t)=>e.extreme===t.extreme?0:e.extreme&&!t.extreme?-1:1))}({model:p}),TE({model:p,size:m,all:e.all}),p.getItems().filter((e=>e.placement&&e.node.key===this.settings.settings.target.point)).map((e=>({type:"text",x:e.placement.x+e.placement.width/2,y:e.placement.y+e.labelMeasurements.height/2,fontSize:f.fontSize,fontFamily:f.fontFamily,fill:f.fill,text:l.label(e.node.data),data:e.node.data.value,baseline:"central",anchor:"middle"})))}},kE={defaultSettings:{settings:{size:10}},preferredSize(){return this.settings.settings.size},render:()=>[]};var RE={require:["resolver","symbol"],defaultSettings:{settings:{type:"max",primaryExtremum:()=>{},secondaryExtremum:()=>{},primarySeries:[],secondarySeries:[],orientation:"horizontal",rtl:!1,major:{scale:"major-scale"},markerOffset:1,size:10},style:{fill:"#999"}},preferredSize(){return this.settings.settings.size},render(){const{items:e=[]}=this.data;if(!e.length)return[];const{type:t,orientation:n,rtl:r,markerOffset:i,size:o,major:a,primarySeries:s,secondarySeries:l}=this.settings.settings,u=this.settings.settings.primaryExtremum(),c=this.settings.settings.secondaryExtremum(),d=s.length&&void 0!==u,m=l.length&&void 0!==c;if(!d&&!m)return[];const f=s.map((e=>e.ref)),p=l.map((e=>e.ref)),h=e.filter((e=>f.includes(e.end.source.field))),g=e.filter((e=>p.includes(e.end.source.field))),y=function({type:e,primaryExtremum:t,secondaryExtremum:n,primaryItems:r=[],secondaryItems:i=[],primarySeries:o=[],secondarySeries:a=[]}){const s=[];[...o,...a].forEach((o=>{const a=o.isPrimary?t:n,l=o.isPrimary?r:i;s.push((({type:e,extremum:t,separateStacking:n,items:r})=>{const i="max"===e?e=>e>t:e=>e<t,o=n?e=>i(e.point.value<0?e.start.value:e.end.value):e=>i(e.end.value);return r.filter(o)})({type:e,extremum:a,items:l}))}));const l=(({items:e})=>{const t=[],n=[];return e.forEach((e=>{const{value:r}=e.major;t[r]||(t[r]=!0,n.push(e))})),n})({items:s.reduce(((e,t)=>e.concat(t)),[])});return l}({type:t,primaryExtremum:u,secondaryExtremum:c,primaryItems:h,secondaryItems:g,primarySeries:s,secondarySeries:l});if(!y.length)return[];const v="horizontal"===n,b=this.rect[v?"width":"height"],x=this.resolver.resolve({data:{items:y},settings:{major:a},scaled:{major:b}}),M=("max"===t?90:-90)-(v?0:90)-(!v&&r?180:0),S=o/2*i,{fill:E}=this.settings.style,C=x.items.map((e=>function({symbol:e,size:t,fill:n,startAngle:r,x:i,y:o,data:a}){return e({type:"n-polygon",show:!0,size:t,fill:n,stroke:"#205891",strokeWidth:0,sides:3,startAngle:r,width:.7,x:i,y:o,data:a})}({symbol:this.symbol,size:o,fill:E,startAngle:M,x:v?b*e.major:S,y:v?S:b*e.major,data:e.data})));return C}};function PE({x:e,y:t,size:n,stroke:r,strokeWidth:i,fill:o}){return{type:"container",children:[{type:"line",stroke:r||o,strokeWidth:i,x1:e-n/2,y1:t,x2:e+n/2,y2:t},{type:"circle",strokeWidth:0,fill:o,cx:e,cy:t,r:.25*n}]}}function $E({chart:e,seriesInfo:t}){const n={primary:{paths:[],map:{}},secondary:{paths:[],map:{}}},r=[...t.primary.map((e=>e.key)),...t.secondary.map((e=>e.key))],i=e.findShapes("path").filter((e=>r.some((t=>t===e.key))));return i.reduce(((e,n)=>{const r=t.primary.some((e=>e.key===n.key))?e.primary:e.secondary;return r.paths.push(n),e}),n),{getLine:(e,t)=>{const r=t?n.primary:n.secondary;if(!r.map[e]){const[t]=r.paths.filter((t=>t.data&&t.data.typeIndex.value===e));r.map[e]=t}return r.map[e]}}}function FE({brush:e}){const t=e.brush.values();return function({value:e}){return-1!==t.indexOf(e)}}function zE({brush:e,chart:t}){const n=e.brush.ranges();if(!n.length)return!1;const r=t&&t.scale(ul.SCALE.MAJOR),i=r&&r.max&&r.max(),o="qHyperCube/qDimensionInfo/0:numeric"===e.id?(e,t)=>t===i?e<=t:e<t:(e,t)=>e<=t;return function({value:e}){return n.some((t=>t.min<=e&&o(e,t.max)))}}function _E({brush:e,selectionInfo:t,items:n,selectionValues:r,colorByData:i,chart:o}){const a=e.brushes();if(!a.length)return[];const s=a[0],{minorRange:l,legendRange:u,legendTap:c}=t,d=0===s.id.indexOf("qHyperCube/qMeasureInfo/")?"qHyperCube/qMeasureInfo/X":s.id;let m=[u?e=>e.color.value:r[d]].filter(Boolean);if(i&&l&&m.push((e=>e.color.value)),!i&&c&&(m=[e=>e.color.value]),!m.length)return[];const f=function({brush:e,chart:t}){return("value"===e.type?FE:zE)({brush:e,chart:t})}({brush:s,chart:o});return f?n.reduce(((e,t,n)=>(m.some((e=>f({value:e(t)})))&&e.push({item:t,index:n}),e)),[]):[]}function jE({chart:e,selected:t,connection:n,gradient:r,fallback:i}){const o=e.scale(ul.SCALE.COLOR),a=t.filter((e=>-1!==n.indexOf(e.index))).map((e=>e.item.end.value)),s=Math.min(...a),l=Math.max(...a),u=l-s,c=0===u?1:u,d=o.domain().map((e=>({color:o(Math.min(l,Math.max(s,e)))||i,offset:Math.min(1,Math.max(0,(e-s)/c))}))),m=d.map((e=>e.offset)),f=m.lastIndexOf(0),p=m.indexOf(1),h=d.slice(-1===f?0:f,-1===p?d.length:p+1);return{type:"gradient",x1:r.x1,x2:r.x2,y1:r.y1,y2:r.y2,stops:h}}function HE({chart:e,selected:t,connection:n,gradient:r,fallback:i}){const o=e.scale(ul.SCALE.COLOR),a=t.filter((e=>-1!==n.indexOf(e.index))).map((e=>e.item.end.value)),s=Math.min(...a),l=Math.max(...a)-s,u=0===l?1:l,c=o.domain(),d=[];for(let e=0;e<c.length-1;e++){const t=c[e],n=o(t)||i;d.push({color:n,offset:Math.min(1,Math.max(0,(t-s)/u))});const r=c[e+1];d.push({color:n,offset:Math.min(1,Math.max(0,(r-s)/u))})}const m=d.map((e=>e.offset)),f=m.lastIndexOf(0),p=m.indexOf(1),h=d.slice(-1===f?0:f,-1===p?d.length:p+1);return{type:"gradient",x1:r.x1,x2:r.x2,y1:r.y1,y2:r.y2,stops:h}}function VE({property:e,chart:t,connection:n,attrs:r,colorSettings:i,colorByData:o,selected:a,hasMultipleMeasures:s,groupedByMeasure:l,itemsPerGroup:u,orientation:c,rtl:d}){const m=r[e];if("gradient"!==m.type)return m;const{type:f,nil:p}=i;if(s||!o)return function({chart:e,selected:t,connection:n,gradient:r,fallback:i,orientation:o,isColorCode:a,groupedByMeasure:s,itemsPerGroup:l,rtl:u}){const c=e.scale(ul.SCALE.MAJOR),d=e.scale(ul.SCALE.COLOR),m=s?e=>c([e,0])+c.bandwidth()*l/2:e=>c(e),f=t.filter((e=>-1!==n.indexOf(e.index))),p=("vertical"===o&&u?f.reverse():f).map((e=>e.item)),h=p.map((e=>m(e.major.value))),g=Math.min(...h),y=Math.max(...h)-g,v=0===y?1:y,b=h.map(((e,t)=>0===t?0:t===h.length-1?1:(e-g)/v)),x=[];for(let e=0;e<p.length;e++){const t=p[e],n=a?t.color.value:d(t.color.value)||i,r=b[e];x.push({color:n,offset:0===e?0:Math.max(0,x[x.length-1].offset)}),x.push({color:n,offset:e===p.length-1?1:Math.max(0,parseFloat((r+(b[e+1]-r)/2).toFixed(5)))})}return{type:"gradient",x1:r.x1,x2:r.x2,y1:r.y1,y2:r.y2,stops:x}}({chart:t,selected:a,connection:n,gradient:m,fallback:p,orientation:c,isColorCode:"color"===f,groupedByMeasure:l,itemsPerGroup:u,rtl:d});return("continuous"===f?jE:HE)({chart:t,selected:a,connection:n,gradient:m,fallback:p})}function BE({chart:e,pathModel:t,colorSettings:n,colorByData:r,hasMultipleMeasures:i,groupedByMeasure:o,itemsPerGroup:a,orientation:s,lineKey:l,primary:u,selected:c,connections:d,rtl:m,count:f}){const p=t.getLine(l,u),{attrs:h}=p,g=function({d:e}){return e.replace("Z","").split(/(?=[LMC])/).map((e=>{const t=e.substring(0,1),n={letter:t,x:0,y:0,raw:e},r=e.substring(1).split(",");return"M"===t||"L"===t?([n.x]=r,[,n.y]=r):"C"===t&&([,,,,n.x]=r,[,,,,,n.y]=r),n}))}({d:h.d});return d.map((t=>function({chart:e,colorSettings:t,colorByData:n,hasMultipleMeasures:r,groupedByMeasure:i,itemsPerGroup:o,orientation:a,selected:s,connection:l,commands:u,attrs:c,rtl:d,count:m}){return{path:l.map(((e,t)=>{const n=u[e];return 0!==t||"M"===n.letter?n.raw:`M${n.x},${n.y}`})).join(""),attrs:c,stroke:VE({property:"stroke",chart:e,connection:l,attrs:c,selected:s,colorSettings:t,colorByData:n,hasMultipleMeasures:r,groupedByMeasure:i,itemsPerGroup:o,orientation:a,rtl:d,count:m})}}({chart:e,colorSettings:n,colorByData:r,hasMultipleMeasures:i,groupedByMeasure:o,itemsPerGroup:a,orientation:s,selected:c,connection:t,commands:g,attrs:h,rtl:m,count:f})))}function UE({chart:e,pathModel:t,seriesInfo:n,brush:r,selectionInfo:i,items:o,selectionValues:a,colorSettings:s,colorByData:l,hasMultipleMeasures:u,groupedByMeasure:c,itemsPerGroup:d,orientation:m,rtl:f}){const p=function({items:e,selectionInfo:t,seriesInfo:n}){return e.filter((e=>{if("NaN"===e.end.value||Number.isNaN(e.end.value))return!1;const{minorRange:r,minorRangePrimary:i}=t;return!r||(i?n.primary:n.secondary).some((t=>t.typeIndex===e.typeIndex.value))}))}({items:o,selectionInfo:i,seriesInfo:n}),h=function({items:e,seriesInfo:t}){const n=e.reduce(((e,n,r)=>{const i=n.typeIndex.value;var o;return e[i]||(e[i]={key:i,items:[],index:r,measureIx:null===(o=n.colorMeasureIdx)||void 0===o?void 0:o.value,primary:t.primary.some((e=>e.typeIndex===i))}),e[i].items.push(n),e}),{});return Object.keys(n).map((e=>n[e])).sort(((e,t)=>e.index-t.index)).map((e=>({lineKey:e.key,items:e.items,primary:e.primary,measureIx:e.measureIx})))}({items:p,seriesInfo:n}),{lines:g}=h.reduce(((n,o)=>{const p=_E({brush:r,selectionInfo:i,items:o.items,selectionValues:a,colorByData:l,chart:e});if(p.length<2)return n;const h=function({selected:e}){return e.reduce(((e,t)=>{const{index:n}=t;if(e.length){const t=e[e.length-1];n===t[t.length-1]+1?t.push(n):e.push([n])}else e.push([n]);return e}),[]).filter((e=>e.length>1))}({selected:p});return h.length?(n.lines.push(...BE({chart:e,pathModel:t,colorSettings:s(o.measureIx),colorByData:l(o.measureIx),hasMultipleMeasures:u,groupedByMeasure:c,itemsPerGroup:d,orientation:m,lineKey:o.lineKey,primary:o.primary,selected:p,connections:h,rtl:f,count:o.items.length})),n):n}),{lines:[]}),y=[];return g.forEach((e=>y.push({type:"path",d:e.path,stroke:e.stroke,strokeLinejoin:e.attrs["stroke-linejoin"],strokeWidth:e.attrs["stroke-width"],strokeDasharray:e.attrs["stroke-dasharray"],fill:"none"}))),y}var YE={require:["chart","renderer"],defaultSettings:{settings:{seriesInfo:{primary:[],secondary:[]},selectionValues:{},colorSettings:void 0,colorByData:!1,isColorCode:!1,hasMultipleMeasures:!1,groupedByMeasure:!1,itemsPerGroup:1,orientation:"vertical",rtl:!1}},addListener(e,t){this.state.brush.addListener(e,t),this.state.listeners.push({type:e,fn:t})},removeListeners(){this.state.listeners.forEach((e=>this.state.brush.removeListener(e.type,e.fn))),this.state.listeners.length=0},created(){this.state={pathModel:$E({chart:this.chart,seriesInfo:this.settings.settings.seriesInfo}),brush:this.chart.brush("selection"),listeners:[],selectionInfo:{minorRange:!1,minorRangePrimary:!1,legendRange:!1,legendTap:!1}}},mounted(){this.addListener("update",(()=>{this.state.selectionInfo=this.settings.settings.getSelectionInfo();const e=UE({chart:this.chart,pathModel:this.state.pathModel,seriesInfo:this.settings.settings.seriesInfo,brush:this.state.brush,selectionInfo:this.state.selectionInfo,items:this.data.items,selectionValues:this.settings.settings.selectionValues,colorSettings:this.settings.settings.colorSettings,colorByData:this.settings.settings.colorByData,isColorCode:this.settings.settings.isColorCode,hasMultipleMeasures:this.settings.settings.hasMultipleMeasures,groupedByMeasure:this.settings.settings.groupedByMeasure,itemsPerGroup:this.settings.settings.itemsPerGroup,orientation:this.settings.settings.orientation,rtl:this.settings.settings.rtl});this.renderer.render(e)})),this.addListener("end",(()=>{this.renderer.render([])}))},render(){this.state.pathModel=$E({chart:this.chart,seriesInfo:this.settings.settings.seriesInfo}),this.state.selectionInfo=this.settings.settings.getSelectionInfo();return UE({chart:this.chart,pathModel:this.state.pathModel,seriesInfo:this.settings.settings.seriesInfo,brush:this.state.brush,selectionInfo:this.state.selectionInfo,items:this.data.items,selectionValues:this.settings.settings.selectionValues,colorSettings:this.settings.settings.colorSettings,colorByData:this.settings.settings.colorByData,isColorCode:this.settings.settings.isColorCode,hasMultipleMeasures:this.settings.settings.hasMultipleMeasures,groupedByMeasure:this.settings.settings.groupedByMeasure,itemsPerGroup:this.settings.settings.itemsPerGroup,orientation:this.settings.settings.orientation,rtl:this.settings.settings.rtl})},destroyed(){this.removeListeners()}};const WE={line:"bar",circle:"circle",diamond:"diamond",triangle:"triangle",rect:"square"},GE=e=>void 0===e.marker?WE.circle:WE[e.marker],XE=e=>void 0===e.markerFill||e.markerFill;function KE({series:e,layoutService:t}){switch(lv(e)){case cl.TYPE.MARKER:return(e=>({marker:GE(e),fill:XE(e)}))(e);case cl.TYPE.LINE:return(e=>{const t=e.getLayoutValue("nullMode","gap");return{showAsGaps:"gap"===t,showAsConnections:"connect"===t,showAsZeros:"zero"===t}})(t);case cl.TYPE.BAR:return{showAsZeros:!0};default:return{}}}function JE(e=cl.NOPE_SERIES,t){return t?e.axis===cl.AXIS.PRIMARY:e.axis===cl.AXIS.PRIMARY||lv(e)===cl.TYPE.BAR}var ZE={exports:{}};var QE={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2};const eC="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};var tC=eC;!function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:n}=QE,r=tC,i=(t=e.exports={}).re=[],o=t.safeRe=[],a=t.src=[],s=t.t={};let l=0;const u=(e,t,n)=>{const u=t.split("\\s*").join("\\s{0,1}").split("\\s+").join("\\s"),c=l++;r(e,c,t),s[e]=c,a[c]=t,i[c]=new RegExp(t,n?"g":void 0),o[c]=new RegExp(u,n?"g":void 0)};u("NUMERICIDENTIFIER","0|[1-9]\\d*"),u("NUMERICIDENTIFIERLOOSE","[0-9]+"),u("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*"),u("MAINVERSION",`(${a[s.NUMERICIDENTIFIER]})\\.(${a[s.NUMERICIDENTIFIER]})\\.(${a[s.NUMERICIDENTIFIER]})`),u("MAINVERSIONLOOSE",`(${a[s.NUMERICIDENTIFIERLOOSE]})\\.(${a[s.NUMERICIDENTIFIERLOOSE]})\\.(${a[s.NUMERICIDENTIFIERLOOSE]})`),u("PRERELEASEIDENTIFIER",`(?:${a[s.NUMERICIDENTIFIER]}|${a[s.NONNUMERICIDENTIFIER]})`),u("PRERELEASEIDENTIFIERLOOSE",`(?:${a[s.NUMERICIDENTIFIERLOOSE]}|${a[s.NONNUMERICIDENTIFIER]})`),u("PRERELEASE",`(?:-(${a[s.PRERELEASEIDENTIFIER]}(?:\\.${a[s.PRERELEASEIDENTIFIER]})*))`),u("PRERELEASELOOSE",`(?:-?(${a[s.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${a[s.PRERELEASEIDENTIFIERLOOSE]})*))`),u("BUILDIDENTIFIER","[0-9A-Za-z-]+"),u("BUILD",`(?:\\+(${a[s.BUILDIDENTIFIER]}(?:\\.${a[s.BUILDIDENTIFIER]})*))`),u("FULLPLAIN",`v?${a[s.MAINVERSION]}${a[s.PRERELEASE]}?${a[s.BUILD]}?`),u("FULL",`^${a[s.FULLPLAIN]}$`),u("LOOSEPLAIN",`[v=\\s]*${a[s.MAINVERSIONLOOSE]}${a[s.PRERELEASELOOSE]}?${a[s.BUILD]}?`),u("LOOSE",`^${a[s.LOOSEPLAIN]}$`),u("GTLT","((?:<|>)?=?)"),u("XRANGEIDENTIFIERLOOSE",`${a[s.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),u("XRANGEIDENTIFIER",`${a[s.NUMERICIDENTIFIER]}|x|X|\\*`),u("XRANGEPLAIN",`[v=\\s]*(${a[s.XRANGEIDENTIFIER]})(?:\\.(${a[s.XRANGEIDENTIFIER]})(?:\\.(${a[s.XRANGEIDENTIFIER]})(?:${a[s.PRERELEASE]})?${a[s.BUILD]}?)?)?`),u("XRANGEPLAINLOOSE",`[v=\\s]*(${a[s.XRANGEIDENTIFIERLOOSE]})(?:\\.(${a[s.XRANGEIDENTIFIERLOOSE]})(?:\\.(${a[s.XRANGEIDENTIFIERLOOSE]})(?:${a[s.PRERELEASELOOSE]})?${a[s.BUILD]}?)?)?`),u("XRANGE",`^${a[s.GTLT]}\\s*${a[s.XRANGEPLAIN]}$`),u("XRANGELOOSE",`^${a[s.GTLT]}\\s*${a[s.XRANGEPLAINLOOSE]}$`),u("COERCE",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?(?:$|[^\\d])`),u("COERCERTL",a[s.COERCE],!0),u("LONETILDE","(?:~>?)"),u("TILDETRIM",`(\\s*)${a[s.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",u("TILDE",`^${a[s.LONETILDE]}${a[s.XRANGEPLAIN]}$`),u("TILDELOOSE",`^${a[s.LONETILDE]}${a[s.XRANGEPLAINLOOSE]}$`),u("LONECARET","(?:\\^)"),u("CARETTRIM",`(\\s*)${a[s.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",u("CARET",`^${a[s.LONECARET]}${a[s.XRANGEPLAIN]}$`),u("CARETLOOSE",`^${a[s.LONECARET]}${a[s.XRANGEPLAINLOOSE]}$`),u("COMPARATORLOOSE",`^${a[s.GTLT]}\\s*(${a[s.LOOSEPLAIN]})$|^$`),u("COMPARATOR",`^${a[s.GTLT]}\\s*(${a[s.FULLPLAIN]})$|^$`),u("COMPARATORTRIM",`(\\s*)${a[s.GTLT]}\\s*(${a[s.LOOSEPLAIN]}|${a[s.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",u("HYPHENRANGE",`^\\s*(${a[s.XRANGEPLAIN]})\\s+-\\s+(${a[s.XRANGEPLAIN]})\\s*$`),u("HYPHENRANGELOOSE",`^\\s*(${a[s.XRANGEPLAINLOOSE]})\\s+-\\s+(${a[s.XRANGEPLAINLOOSE]})\\s*$`),u("STAR","(<|>)?=?\\s*\\*"),u("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),u("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(ZE,ZE.exports);var nC=ZE.exports;const rC=Object.freeze({loose:!0}),iC=Object.freeze({});var oC=e=>e?"object"!=typeof e?rC:e:iC;const aC=/^[0-9]+$/,sC=(e,t)=>{const n=aC.test(e),r=aC.test(t);return n&&r&&(e=+e,t=+t),e===t?0:n&&!r?-1:r&&!n?1:e<t?-1:1};var lC={compareIdentifiers:sC,rcompareIdentifiers:(e,t)=>sC(t,e)};const uC=tC,{MAX_LENGTH:cC,MAX_SAFE_INTEGER:dC}=QE,{safeRe:mC,t:fC}=nC,pC=oC,{compareIdentifiers:hC}=lC;var gC=class e{constructor(t,n){if(n=pC(n),t instanceof e){if(t.loose===!!n.loose&&t.includePrerelease===!!n.includePrerelease)return t;t=t.version}else if("string"!=typeof t)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>cC)throw new TypeError(`version is longer than ${cC} characters`);uC("SemVer",t,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;const r=t.trim().match(n.loose?mC[fC.LOOSE]:mC[fC.FULL]);if(!r)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>dC||this.major<0)throw new TypeError("Invalid major version");if(this.minor>dC||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>dC||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t<dC)return t}return e})):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if(uC("SemVer.compare",this.version,this.options,t),!(t instanceof e)){if("string"==typeof t&&t===this.version)return 0;t=new e(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof e||(t=new e(t,this.options)),hC(this.major,t.major)||hC(this.minor,t.minor)||hC(this.patch,t.patch)}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let n=0;do{const e=this.prerelease[n],r=t.prerelease[n];if(uC("prerelease compare",n,e,r),void 0===e&&void 0===r)return 0;if(void 0===r)return 1;if(void 0===e)return-1;if(e!==r)return hC(e,r)}while(++n)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let n=0;do{const e=this.build[n],r=t.build[n];if(uC("prerelease compare",n,e,r),void 0===e&&void 0===r)return 0;if(void 0===r)return 1;if(void 0===e)return-1;if(e!==r)return hC(e,r)}while(++n)}inc(e,t,n){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,n),this.inc("pre",t,n);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,n),this.inc("pre",t,n);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{const e=Number(n)?1:0;if(!t&&!1===n)throw new Error("invalid increment argument: identifier is empty");if(0===this.prerelease.length)this.prerelease=[e];else{let r=this.prerelease.length;for(;--r>=0;)"number"==typeof this.prerelease[r]&&(this.prerelease[r]++,r=-2);if(-1===r){if(t===this.prerelease.join(".")&&!1===n)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let r=[t,e];!1===n&&(r=[t]),0===hC(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=r):this.prerelease=r}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};const yC=gC;var vC=(e,t,n=!1)=>{if(e instanceof yC)return e;try{return new yC(e,t)}catch(e){if(!n)return null;throw e}};const bC=vC;var xC=(e,t)=>{const n=bC(e,t);return n?n.version:null};const MC=vC;var SC=(e,t)=>{const n=MC(e.trim().replace(/^[=v]+/,""),t);return n?n.version:null};const EC=gC;var CC=(e,t,n,r,i)=>{"string"==typeof n&&(i=r,r=n,n=void 0);try{return new EC(e instanceof EC?e.version:e,n).inc(t,r,i).version}catch(e){return null}};const qC=vC;var wC=(e,t)=>{const n=qC(e,null,!0),r=qC(t,null,!0),i=n.compare(r);if(0===i)return null;const o=i>0,a=o?n:r,s=o?r:n,l=!!a.prerelease.length;if(!!s.prerelease.length&&!l)return s.patch||s.minor?a.patch?"patch":a.minor?"minor":"major":"major";const u=l?"pre":"";return n.major!==r.major?u+"major":n.minor!==r.minor?u+"minor":n.patch!==r.patch?u+"patch":"prerelease"};const AC=gC;var OC=(e,t)=>new AC(e,t).major;const DC=gC;var NC=(e,t)=>new DC(e,t).minor;const IC=gC;var TC=(e,t)=>new IC(e,t).patch;const LC=vC;var kC=(e,t)=>{const n=LC(e,t);return n&&n.prerelease.length?n.prerelease:null};const RC=gC;var PC=(e,t,n)=>new RC(e,n).compare(new RC(t,n));const $C=PC;var FC=(e,t,n)=>$C(t,e,n);const zC=PC;var _C=(e,t)=>zC(e,t,!0);const jC=gC;var HC=(e,t,n)=>{const r=new jC(e,n),i=new jC(t,n);return r.compare(i)||r.compareBuild(i)};const VC=HC;var BC=(e,t)=>e.sort(((e,n)=>VC(e,n,t)));const UC=HC;var YC=(e,t)=>e.sort(((e,n)=>UC(n,e,t)));const WC=PC;var GC=(e,t,n)=>WC(e,t,n)>0;const XC=PC;var KC=(e,t,n)=>XC(e,t,n)<0;const JC=PC;var ZC=(e,t,n)=>0===JC(e,t,n);const QC=PC;var eq=(e,t,n)=>0!==QC(e,t,n);const tq=PC;var nq=(e,t,n)=>tq(e,t,n)>=0;const rq=PC;var iq=(e,t,n)=>rq(e,t,n)<=0;const oq=ZC,aq=eq,sq=GC,lq=nq,uq=KC,cq=iq;var dq=(e,t,n,r)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e===n;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e!==n;case"":case"=":case"==":return oq(e,n,r);case"!=":return aq(e,n,r);case">":return sq(e,n,r);case">=":return lq(e,n,r);case"<":return uq(e,n,r);case"<=":return cq(e,n,r);default:throw new TypeError(`Invalid operator: ${t}`)}};const mq=gC,fq=vC,{safeRe:pq,t:hq}=nC;var gq,yq,vq,bq,xq,Mq,Sq,Eq,Cq,qq,wq=(e,t)=>{if(e instanceof mq)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let n=null;if((t=t||{}).rtl){let t;for(;(t=pq[hq.COERCERTL].exec(e))&&(!n||n.index+n[0].length!==e.length);)n&&t.index+t[0].length===n.index+n[0].length||(n=t),pq[hq.COERCERTL].lastIndex=t.index+t[1].length+t[2].length;pq[hq.COERCERTL].lastIndex=-1}else n=e.match(pq[hq.COERCE]);return null===n?null:fq(`${n[2]}.${n[3]||"0"}.${n[4]||"0"}`,t)};function Aq(){if(bq)return vq;function e(t){var n=this;if(n instanceof e||(n=new e),n.tail=null,n.head=null,n.length=0,t&&"function"==typeof t.forEach)t.forEach((function(e){n.push(e)}));else if(arguments.length>0)for(var r=0,i=arguments.length;r<i;r++)n.push(arguments[r]);return n}function t(e,t,n){var r=t===e.head?new i(n,null,t,e):new i(n,t,t.next,e);return null===r.next&&(e.tail=r),null===r.prev&&(e.head=r),e.length++,r}function n(e,t){e.tail=new i(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function r(e,t){e.head=new i(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function i(e,t,n,r){if(!(this instanceof i))return new i(e,t,n,r);this.list=r,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,n?(n.prev=this,this.next=n):this.next=null}bq=1,vq=e,e.Node=i,e.create=e,e.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,n=e.prev;return t&&(t.prev=n),n&&(n.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=n),e.list.length--,e.next=null,e.prev=null,e.list=null,t},e.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}},e.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}},e.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)n(this,arguments[e]);return this.length},e.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)r(this,arguments[e]);return this.length},e.prototype.pop=function(){if(this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e}},e.prototype.shift=function(){if(this.head){var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e}},e.prototype.forEach=function(e,t){t=t||this;for(var n=this.head,r=0;null!==n;r++)e.call(t,n.value,r,this),n=n.next},e.prototype.forEachReverse=function(e,t){t=t||this;for(var n=this.tail,r=this.length-1;null!==n;r--)e.call(t,n.value,r,this),n=n.prev},e.prototype.get=function(e){for(var t=0,n=this.head;null!==n&&t<e;t++)n=n.next;if(t===e&&null!==n)return n.value},e.prototype.getReverse=function(e){for(var t=0,n=this.tail;null!==n&&t<e;t++)n=n.prev;if(t===e&&null!==n)return n.value},e.prototype.map=function(t,n){n=n||this;for(var r=new e,i=this.head;null!==i;)r.push(t.call(n,i.value,this)),i=i.next;return r},e.prototype.mapReverse=function(t,n){n=n||this;for(var r=new e,i=this.tail;null!==i;)r.push(t.call(n,i.value,this)),i=i.prev;return r},e.prototype.reduce=function(e,t){var n,r=this.head;if(arguments.length>1)n=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");r=this.head.next,n=this.head.value}for(var i=0;null!==r;i++)n=e(n,r.value,i),r=r.next;return n},e.prototype.reduceReverse=function(e,t){var n,r=this.tail;if(arguments.length>1)n=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");r=this.tail.prev,n=this.tail.value}for(var i=this.length-1;null!==r;i--)n=e(n,r.value,i),r=r.prev;return n},e.prototype.toArray=function(){for(var e=new Array(this.length),t=0,n=this.head;null!==n;t++)e[t]=n.value,n=n.next;return e},e.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,n=this.tail;null!==n;t++)e[t]=n.value,n=n.prev;return e},e.prototype.slice=function(t,n){(n=n||this.length)<0&&(n+=this.length),(t=t||0)<0&&(t+=this.length);var r=new e;if(n<t||n<0)return r;t<0&&(t=0),n>this.length&&(n=this.length);for(var i=0,o=this.head;null!==o&&i<t;i++)o=o.next;for(;null!==o&&i<n;i++,o=o.next)r.push(o.value);return r},e.prototype.sliceReverse=function(t,n){(n=n||this.length)<0&&(n+=this.length),(t=t||0)<0&&(t+=this.length);var r=new e;if(n<t||n<0)return r;t<0&&(t=0),n>this.length&&(n=this.length);for(var i=this.length,o=this.tail;null!==o&&i>n;i--)o=o.prev;for(;null!==o&&i>t;i--,o=o.prev)r.push(o.value);return r},e.prototype.splice=function(e,n,...r){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var i=0,o=this.head;null!==o&&i<e;i++)o=o.next;var a=[];for(i=0;o&&i<n;i++)a.push(o.value),o=this.removeNode(o);null===o&&(o=this.tail),o!==this.head&&o!==this.tail&&(o=o.prev);for(i=0;i<r.length;i++)o=t(this,o,r[i]);return a},e.prototype.reverse=function(){for(var e=this.head,t=this.tail,n=e;null!==n;n=n.prev){var r=n.prev;n.prev=n.next,n.next=r}return this.head=t,this.tail=e,this};try{(yq?gq:(yq=1,gq=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}))(e)}catch(e){}return vq}function Oq(){if(Eq)return Sq;Eq=1;class e{constructor(t,n){if(n=r(n),t instanceof e)return t.loose===!!n.loose&&t.includePrerelease===!!n.includePrerelease?t:new e(t.raw,n);if(t instanceof i)return this.raw=t.value,this.set=[[t]],this.format(),this;if(this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease,this.raw=t.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map((e=>this.parseRange(e))).filter((e=>e.length)),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter((e=>!p(e[0]))),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&h(e[0])){this.set=[e];break}}this.format()}format(){return this.range=this.set.map((e=>e.join(" ").trim())).join("||").trim(),this.range}toString(){return this.range}parseRange(e){const t=((this.options.includePrerelease&&m)|(this.options.loose&&f))+":"+e,r=n.get(t);if(r)return r;const a=this.options.loose,h=a?s[l.HYPHENRANGELOOSE]:s[l.HYPHENRANGE];e=e.replace(h,A(this.options.includePrerelease)),o("hyphen replace",e),e=e.replace(s[l.COMPARATORTRIM],u),o("comparator trim",e);let g=(e=(e=e.replace(s[l.TILDETRIM],c)).replace(s[l.CARETTRIM],d)).split(" ").map((e=>y(e,this.options))).join(" ").split(/\s+/).map((e=>w(e,this.options)));a&&(g=g.filter((e=>(o("loose invalid filter",e,this.options),!!e.match(s[l.COMPARATORLOOSE]))))),o("range list",g);const v=new Map,b=g.map((e=>new i(e,this.options)));for(const e of b){if(p(e))return[e];v.set(e.value,e)}v.size>1&&v.has("")&&v.delete("");const x=[...v.values()];return n.set(t,x),x}intersects(t,n){if(!(t instanceof e))throw new TypeError("a Range is required");return this.set.some((e=>g(e,n)&&t.set.some((t=>g(t,n)&&e.every((e=>t.every((t=>e.intersects(t,n)))))))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new a(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(O(this.set[t],e,this.options))return!0;return!1}}Sq=e;const t=function(){if(Mq)return xq;Mq=1;const e=Aq(),t=Symbol("max"),n=Symbol("length"),r=Symbol("lengthCalculator"),i=Symbol("allowStale"),o=Symbol("maxAge"),a=Symbol("dispose"),s=Symbol("noDisposeOnSet"),l=Symbol("lruList"),u=Symbol("cache"),c=Symbol("updateAgeOnGet"),d=()=>1,m=(e,t,n)=>{const r=e[u].get(t);if(r){const t=r.value;if(f(e,t)){if(h(e,r),!e[i])return}else n&&(e[c]&&(r.value.now=Date.now()),e[l].unshiftNode(r));return t.value}},f=(e,t)=>{if(!t||!t.maxAge&&!e[o])return!1;const n=Date.now()-t.now;return t.maxAge?n>t.maxAge:e[o]&&n>e[o]},p=e=>{if(e[n]>e[t])for(let r=e[l].tail;e[n]>e[t]&&null!==r;){const t=r.prev;h(e,r),r=t}},h=(e,t)=>{if(t){const r=t.value;e[a]&&e[a](r.key,r.value),e[n]-=r.length,e[u].delete(r.key),e[l].removeNode(t)}};class g{constructor(e,t,n,r,i){this.key=e,this.value=t,this.length=n,this.now=r,this.maxAge=i||0}}const y=(e,t,n,r)=>{let o=n.value;f(e,o)&&(h(e,n),e[i]||(o=void 0)),o&&t.call(r,o.value,o.key,e)};return xq=class{constructor(e){if("number"==typeof e&&(e={max:e}),e||(e={}),e.max&&("number"!=typeof e.max||e.max<0))throw new TypeError("max must be a non-negative number");this[t]=e.max||1/0;const n=e.length||d;if(this[r]="function"!=typeof n?d:n,this[i]=e.stale||!1,e.maxAge&&"number"!=typeof e.maxAge)throw new TypeError("maxAge must be a number");this[o]=e.maxAge||0,this[a]=e.dispose,this[s]=e.noDisposeOnSet||!1,this[c]=e.updateAgeOnGet||!1,this.reset()}set max(e){if("number"!=typeof e||e<0)throw new TypeError("max must be a non-negative number");this[t]=e||1/0,p(this)}get max(){return this[t]}set allowStale(e){this[i]=!!e}get allowStale(){return this[i]}set maxAge(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[o]=e,p(this)}get maxAge(){return this[o]}set lengthCalculator(e){"function"!=typeof e&&(e=d),e!==this[r]&&(this[r]=e,this[n]=0,this[l].forEach((e=>{e.length=this[r](e.value,e.key),this[n]+=e.length}))),p(this)}get lengthCalculator(){return this[r]}get length(){return this[n]}get itemCount(){return this[l].length}rforEach(e,t){t=t||this;for(let n=this[l].tail;null!==n;){const r=n.prev;y(this,e,n,t),n=r}}forEach(e,t){t=t||this;for(let n=this[l].head;null!==n;){const r=n.next;y(this,e,n,t),n=r}}keys(){return this[l].toArray().map((e=>e.key))}values(){return this[l].toArray().map((e=>e.value))}reset(){this[a]&&this[l]&&this[l].length&&this[l].forEach((e=>this[a](e.key,e.value))),this[u]=new Map,this[l]=new e,this[n]=0}dump(){return this[l].map((e=>!f(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)})).toArray().filter((e=>e))}dumpLru(){return this[l]}set(e,i,c){if((c=c||this[o])&&"number"!=typeof c)throw new TypeError("maxAge must be a number");const d=c?Date.now():0,m=this[r](i,e);if(this[u].has(e)){if(m>this[t])return h(this,this[u].get(e)),!1;const r=this[u].get(e).value;return this[a]&&(this[s]||this[a](e,r.value)),r.now=d,r.maxAge=c,r.value=i,this[n]+=m-r.length,r.length=m,this.get(e),p(this),!0}const f=new g(e,i,m,d,c);return f.length>this[t]?(this[a]&&this[a](e,i),!1):(this[n]+=f.length,this[l].unshift(f),this[u].set(e,this[l].head),p(this),!0)}has(e){if(!this[u].has(e))return!1;const t=this[u].get(e).value;return!f(this,t)}get(e){return m(this,e,!0)}peek(e){return m(this,e,!1)}pop(){const e=this[l].tail;return e?(h(this,e),e.value):null}del(e){h(this,this[u].get(e))}load(e){this.reset();const t=Date.now();for(let n=e.length-1;n>=0;n--){const r=e[n],i=r.e||0;if(0===i)this.set(r.k,r.v);else{const e=i-t;e>0&&this.set(r.k,r.v,e)}}}prune(){this[u].forEach(((e,t)=>m(this,t,!1)))}},xq}(),n=new t({max:1e3}),r=oC,i=Dq(),o=tC,a=gC,{safeRe:s,t:l,comparatorTrimReplace:u,tildeTrimReplace:c,caretTrimReplace:d}=nC,{FLAG_INCLUDE_PRERELEASE:m,FLAG_LOOSE:f}=QE,p=e=>"<0.0.0-0"===e.value,h=e=>""===e.value,g=(e,t)=>{let n=!0;const r=e.slice();let i=r.pop();for(;n&&r.length;)n=r.every((e=>i.intersects(e,t))),i=r.pop();return n},y=(e,t)=>(o("comp",e,t),e=M(e,t),o("caret",e),e=b(e,t),o("tildes",e),e=E(e,t),o("xrange",e),e=q(e,t),o("stars",e),e),v=e=>!e||"x"===e.toLowerCase()||"*"===e,b=(e,t)=>e.trim().split(/\s+/).map((e=>x(e,t))).join(" "),x=(e,t)=>{const n=t.loose?s[l.TILDELOOSE]:s[l.TILDE];return e.replace(n,((t,n,r,i,a)=>{let s;return o("tilde",e,t,n,r,i,a),v(n)?s="":v(r)?s=`>=${n}.0.0 <${+n+1}.0.0-0`:v(i)?s=`>=${n}.${r}.0 <${n}.${+r+1}.0-0`:a?(o("replaceTilde pr",a),s=`>=${n}.${r}.${i}-${a} <${n}.${+r+1}.0-0`):s=`>=${n}.${r}.${i} <${n}.${+r+1}.0-0`,o("tilde return",s),s}))},M=(e,t)=>e.trim().split(/\s+/).map((e=>S(e,t))).join(" "),S=(e,t)=>{o("caret",e,t);const n=t.loose?s[l.CARETLOOSE]:s[l.CARET],r=t.includePrerelease?"-0":"";return e.replace(n,((t,n,i,a,s)=>{let l;return o("caret",e,t,n,i,a,s),v(n)?l="":v(i)?l=`>=${n}.0.0${r} <${+n+1}.0.0-0`:v(a)?l="0"===n?`>=${n}.${i}.0${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.0${r} <${+n+1}.0.0-0`:s?(o("replaceCaret pr",s),l="0"===n?"0"===i?`>=${n}.${i}.${a}-${s} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a}-${s} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a}-${s} <${+n+1}.0.0-0`):(o("no pr"),l="0"===n?"0"===i?`>=${n}.${i}.${a}${r} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a}${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a} <${+n+1}.0.0-0`),o("caret return",l),l}))},E=(e,t)=>(o("replaceXRanges",e,t),e.split(/\s+/).map((e=>C(e,t))).join(" ")),C=(e,t)=>{e=e.trim();const n=t.loose?s[l.XRANGELOOSE]:s[l.XRANGE];return e.replace(n,((n,r,i,a,s,l)=>{o("xRange",e,n,r,i,a,s,l);const u=v(i),c=u||v(a),d=c||v(s),m=d;return"="===r&&m&&(r=""),l=t.includePrerelease?"-0":"",u?n=">"===r||"<"===r?"<0.0.0-0":"*":r&&m?(c&&(a=0),s=0,">"===r?(r=">=",c?(i=+i+1,a=0,s=0):(a=+a+1,s=0)):"<="===r&&(r="<",c?i=+i+1:a=+a+1),"<"===r&&(l="-0"),n=`${r+i}.${a}.${s}${l}`):c?n=`>=${i}.0.0${l} <${+i+1}.0.0-0`:d&&(n=`>=${i}.${a}.0${l} <${i}.${+a+1}.0-0`),o("xRange return",n),n}))},q=(e,t)=>(o("replaceStars",e,t),e.trim().replace(s[l.STAR],"")),w=(e,t)=>(o("replaceGTE0",e,t),e.trim().replace(s[t.includePrerelease?l.GTE0PRE:l.GTE0],"")),A=e=>(t,n,r,i,o,a,s,l,u,c,d,m,f)=>`${n=v(r)?"":v(i)?`>=${r}.0.0${e?"-0":""}`:v(o)?`>=${r}.${i}.0${e?"-0":""}`:a?`>=${n}`:`>=${n}${e?"-0":""}`} ${l=v(u)?"":v(c)?`<${+u+1}.0.0-0`:v(d)?`<${u}.${+c+1}.0-0`:m?`<=${u}.${c}.${d}-${m}`:e?`<${u}.${c}.${+d+1}-0`:`<=${l}`}`.trim(),O=(e,t,n)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let n=0;n<e.length;n++)if(o(e[n].semver),e[n].semver!==i.ANY&&e[n].semver.prerelease.length>0){const r=e[n].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0};return Sq}function Dq(){if(qq)return Cq;qq=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(r,i){if(i=n(i),r instanceof t){if(r.loose===!!i.loose)return r;r=r.value}r=r.trim().split(/\s+/).join(" "),a("comparator",r,i),this.options=i,this.loose=!!i.loose,this.parse(r),this.semver===e?this.value="":this.value=this.operator+this.semver.version,a("comp",this)}parse(t){const n=this.options.loose?r[i.COMPARATORLOOSE]:r[i.COMPARATOR],o=t.match(n);if(!o)throw new TypeError(`Invalid comparator: ${t}`);this.operator=void 0!==o[1]?o[1]:"","="===this.operator&&(this.operator=""),o[2]?this.semver=new s(o[2],this.options.loose):this.semver=e}toString(){return this.value}test(t){if(a("Comparator.test",t,this.options.loose),this.semver===e||t===e)return!0;if("string"==typeof t)try{t=new s(t,this.options)}catch(e){return!1}return o(t,this.operator,this.semver,this.options)}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new l(e.value,r).test(this.value):""===e.operator?""===e.value||new l(this.value,r).test(e.semver):(!(r=n(r)).includePrerelease||"<0.0.0-0"!==this.value&&"<0.0.0-0"!==e.value)&&(!(!r.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))&&(!(!this.operator.startsWith(">")||!e.operator.startsWith(">"))||(!(!this.operator.startsWith("<")||!e.operator.startsWith("<"))||(!(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))||(!!(o(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))||!!(o(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))))))}}Cq=t;const n=oC,{safeRe:r,t:i}=nC,o=dq,a=tC,s=gC,l=Oq();return Cq}const Nq=Oq();var Iq=(e,t,n)=>{try{t=new Nq(t,n)}catch(e){return!1}return t.test(e)};const Tq=Oq();var Lq=(e,t)=>new Tq(e,t).set.map((e=>e.map((e=>e.value)).join(" ").trim().split(" ")));const kq=gC,Rq=Oq();var Pq=(e,t,n)=>{let r=null,i=null,o=null;try{o=new Rq(t,n)}catch(e){return null}return e.forEach((e=>{o.test(e)&&(r&&-1!==i.compare(e)||(r=e,i=new kq(r,n)))})),r};const $q=gC,Fq=Oq();var zq=(e,t,n)=>{let r=null,i=null,o=null;try{o=new Fq(t,n)}catch(e){return null}return e.forEach((e=>{o.test(e)&&(r&&1!==i.compare(e)||(r=e,i=new $q(r,n)))})),r};const _q=gC,jq=Oq(),Hq=GC;var Vq=(e,t)=>{e=new jq(e,t);let n=new _q("0.0.0");if(e.test(n))return n;if(n=new _q("0.0.0-0"),e.test(n))return n;n=null;for(let t=0;t<e.set.length;++t){const r=e.set[t];let i=null;r.forEach((e=>{const t=new _q(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":i&&!Hq(t,i)||(i=t);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${e.operator}`)}})),!i||n&&!Hq(n,i)||(n=i)}return n&&e.test(n)?n:null};const Bq=Oq();var Uq=(e,t)=>{try{return new Bq(e,t).range||"*"}catch(e){return null}};const Yq=gC,Wq=Dq(),{ANY:Gq}=Wq,Xq=Oq(),Kq=Iq,Jq=GC,Zq=KC,Qq=iq,ew=nq;var tw=(e,t,n,r)=>{let i,o,a,s,l;switch(e=new Yq(e,r),t=new Xq(t,r),n){case">":i=Jq,o=Qq,a=Zq,s=">",l=">=";break;case"<":i=Zq,o=ew,a=Jq,s="<",l="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Kq(e,t,r))return!1;for(let n=0;n<t.set.length;++n){const u=t.set[n];let c=null,d=null;if(u.forEach((e=>{e.semver===Gq&&(e=new Wq(">=0.0.0")),c=c||e,d=d||e,i(e.semver,c.semver,r)?c=e:a(e.semver,d.semver,r)&&(d=e)})),c.operator===s||c.operator===l)return!1;if((!d.operator||d.operator===s)&&o(e,d.semver))return!1;if(d.operator===l&&a(e,d.semver))return!1}return!0};const nw=tw;var rw=(e,t,n)=>nw(e,t,">",n);const iw=tw;var ow=(e,t,n)=>iw(e,t,"<",n);const aw=Oq();var sw=(e,t,n)=>(e=new aw(e,n),t=new aw(t,n),e.intersects(t,n));const lw=Iq,uw=PC;const cw=Oq(),dw=Dq(),{ANY:mw}=dw,fw=Iq,pw=PC,hw=[new dw(">=0.0.0-0")],gw=[new dw(">=0.0.0")],yw=(e,t,n)=>{if(e===t)return!0;if(1===e.length&&e[0].semver===mw){if(1===t.length&&t[0].semver===mw)return!0;e=n.includePrerelease?hw:gw}if(1===t.length&&t[0].semver===mw){if(n.includePrerelease)return!0;t=gw}const r=new Set;let i,o,a,s,l,u,c;for(const t of e)">"===t.operator||">="===t.operator?i=vw(i,t,n):"<"===t.operator||"<="===t.operator?o=bw(o,t,n):r.add(t.semver);if(r.size>1)return null;if(i&&o){if(a=pw(i.semver,o.semver,n),a>0)return null;if(0===a&&(">="!==i.operator||"<="!==o.operator))return null}for(const e of r){if(i&&!fw(e,String(i),n))return null;if(o&&!fw(e,String(o),n))return null;for(const r of t)if(!fw(e,String(r),n))return!1;return!0}let d=!(!o||n.includePrerelease||!o.semver.prerelease.length)&&o.semver,m=!(!i||n.includePrerelease||!i.semver.prerelease.length)&&i.semver;d&&1===d.prerelease.length&&"<"===o.operator&&0===d.prerelease[0]&&(d=!1);for(const e of t){if(c=c||">"===e.operator||">="===e.operator,u=u||"<"===e.operator||"<="===e.operator,i)if(m&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===m.major&&e.semver.minor===m.minor&&e.semver.patch===m.patch&&(m=!1),">"===e.operator||">="===e.operator){if(s=vw(i,e,n),s===e&&s!==i)return!1}else if(">="===i.operator&&!fw(i.semver,String(e),n))return!1;if(o)if(d&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===d.major&&e.semver.minor===d.minor&&e.semver.patch===d.patch&&(d=!1),"<"===e.operator||"<="===e.operator){if(l=bw(o,e,n),l===e&&l!==o)return!1}else if("<="===o.operator&&!fw(o.semver,String(e),n))return!1;if(!e.operator&&(o||i)&&0!==a)return!1}return!(i&&u&&!o&&0!==a)&&(!(o&&c&&!i&&0!==a)&&(!m&&!d))},vw=(e,t,n)=>{if(!e)return t;const r=pw(e.semver,t.semver,n);return r>0?e:r<0||">"===t.operator&&">="===e.operator?t:e},bw=(e,t,n)=>{if(!e)return t;const r=pw(e.semver,t.semver,n);return r<0?e:r>0||"<"===t.operator&&"<="===e.operator?t:e};var xw=(e,t,n={})=>{if(e===t)return!0;e=new cw(e,n),t=new cw(t,n);let r=!1;e:for(const i of e.set){for(const e of t.set){const t=yw(i,e,n);if(r=r||null!==t,t)continue e}if(r)return!1}return!0};const Mw=nC,Sw=QE,Ew=gC,Cw=lC,qw=(e,t,n)=>{const r=[];let i=null,o=null;const a=e.sort(((e,t)=>uw(e,t,n)));for(const e of a){lw(e,t,n)?(o=e,i||(i=e)):(o&&r.push([i,o]),o=null,i=null)}i&&r.push([i,null]);const s=[];for(const[e,t]of r)e===t?s.push(e):t||e!==a[0]?t?e===a[0]?s.push(`<=${t}`):s.push(`${e} - ${t}`):s.push(`>=${e}`):s.push("*");const l=s.join(" || "),u="string"==typeof t.raw?t.raw:String(t);return l.length<u.length?l:t};var ww=F({parse:vC,valid:xC,clean:SC,inc:CC,diff:wC,major:OC,minor:NC,patch:TC,prerelease:kC,compare:PC,rcompare:FC,compareLoose:_C,compareBuild:HC,sort:BC,rsort:YC,gt:GC,lt:KC,eq:ZC,neq:eq,gte:nq,lte:iq,cmp:dq,coerce:wq,Comparator:Dq(),Range:Oq(),satisfies:Iq,toComparators:Lq,maxSatisfying:Pq,minSatisfying:zq,minVersion:Vq,validRange:Uq,outside:tw,gtr:rw,ltr:ow,intersects:sw,simplifyRange:qw,subset:xw,SemVer:Ew,re:Mw.re,src:Mw.src,tokens:Mw.t,SEMVER_SPEC_VERSION:Sw.SEMVER_SPEC_VERSION,RELEASE_TYPES:Sw.RELEASE_TYPES,compareIdentifiers:Cw.compareIdentifiers,rcompareIdentifiers:Cw.rcompareIdentifiers}),Aw={BAR_IN_SECONDARY_AXIS:"0.23.1"};const Ow=e=>!e||ww.lt(ww.coerce(e),ww.coerce(Aw.BAR_IN_SECONDARY_AXIS)),Dw=({layoutService:e})=>{const t=!Ow(e.getLayoutValue("version")),n=e.getHyperCubeValue("qMeasureInfo").map(((e,t)=>{const n={[cl.TYPE.BAR]:0,[cl.TYPE.LINE]:0,[cl.TYPE.MARKER]:0};return({series:r=cl.NOPE_SERIES},i)=>{const o=JE(r,t),a=lv(r);return{id:i,type:a,typeIndex:n[a]++,ref:`qMeasureInfo/${i}`,refIndex:i,isPrimary:o,scale:o?ul.SCALE.MINOR.PRIMARY:ul.SCALE.MINOR.SECONDARY,collection:o?ul.COLLECTION.PRIMARY:ul.COLLECTION.SECONDARY,options:KE({series:r,layoutService:e})}}})(e,t)),r=(e,t)=>e.filter((e=>lv(e)===t)).length,i=n.filter((e=>e.isPrimary)),o=n.filter((e=>!e.isPrimary)),a=[!!i.length&&i[0],!!o.length&&o[0]].filter((e=>!!e)),s=r(n,cl.TYPE.BAR),l=r(i,cl.TYPE.BAR),u=r(o,cl.TYPE.BAR),c=e=>n.filter((t=>lv(t)===e)),d=c(cl.TYPE.LINE).map((e=>id(ul.COMPONENT.POINT,e))),m=c(cl.TYPE.MARKER).map((e=>({key:id(ul.COMPONENT.MARKER,e),type:e.options.marker}))),f=m.map((e=>e.key)),p=[];l>0&&p.push(`${ul.COMPONENT.BAR}-${cl.AXIS.PRIMARY}`),u>0&&p.push(`${ul.COMPONENT.BAR}-${cl.AXIS.SECONDARY}`);const h=[...p,...d,...f],{MINI_CHART:g}=ul.COMPONENT,y=c(cl.TYPE.LINE).map((e=>id(g.LINE,e))),v=c(cl.TYPE.MARKER).map((e=>id(g.MARKER,e))),b=e.meta.isContinuous?[`${g.BAR}-${cl.AXIS.PRIMARY}`,`${g.BAR}-${cl.AXIS.SECONDARY}`,...y,...v]:[];return{meta:{allSeries:n,primarySeries:i,secondarySeries:o,barSeriesCount:s,primaryBarSeriesCount:l,secondaryBarSeriesCount:u,measureAxes:a,pointComponentKeys:d,markerComponentKeys:f,barComponentKeys:p,seriesComponentKeys:h,miniComponentKeys:b,markers:m},query:{all:()=>n,seriesByAxis:e=>e?i:o,series:c,isPrimary:JE}}};function Nw({layoutService:e}){const{dimensionCount:t,measureCount:n}=e.meta;return{qTop:0,qLeft:0,qWidth:t+n,qHeight:Math.min(2e3,1e4/(n+1))}}function Iw({genericObjectModel:e,layoutService:t}){return function(){return function(e,t,n){return e.getHyperCubeReducedData(n.path,[n.rect],n.zoomLevel,n.filter).catch(de).then((e=>{var n;const r=t.getHyperCubeValue("qMode"),i=t.getHyperCubeValue("qDimensionInfo"),o="K"===r&&i.length>1&&(null===(n=e[0])||void 0===n?void 0:n.qIsReduced),a=e.slice(),s=t.getHyperCubeValue("qMeasureInfo"),l=o?[]:t.getHyperCubeValue("qColumnOrder");return{reducedCube:{qDataPages:a,qDimensionInfo:i.slice(),qEffectiveInterColumnSortOrder:[1,0],qMeasureInfo:o?[s[0],s[0]]:s.slice(),qStackedDataPages:[],qMode:"S",qHasOtherValues:t.getHyperCubeValue("qHasOtherValues"),qSize:t.getHyperCubeValue("qSize"),qColumnOrder:l}}}))}(e,t,{path:"/qHyperCubeDef",rect:Nw({layoutService:t}),zoomLevel:-1,filter:"D1"})}}function Tw({genericObjectModel:e,layoutService:t}){const{isSnapshot:n,isContinuous:r}=t.meta;return n?function({layoutService:e}){return function(){return Promise.resolve({reducedCube:e.getLayoutValue("reducedHyperCube")||e.getHyperCube()})}}({layoutService:t}):r?function({layoutService:e}){return function(){const t=e.getHyperCube();return Promise.resolve({reducedCube:{...t,qDataPages:[...t.qDataPages]}})}}({layoutService:t}):Iw({genericObjectModel:e,layoutService:t})}const Lw=e=>"number"==typeof e&&!Number.isNaN(e);function kw({isPrimary:e,layoutService:t,seriesModel:n}){return function(){const r=t.getHyperCubeValue("qMeasureInfo"),i=n.query.seriesByAxis(e).map((e=>r[e.refIndex])),o=i.filter((e=>lv(e.series)===cl.TYPE.BAR)),a=i.filter((e=>lv(e.series)===cl.TYPE.LINE)),s=i.filter((e=>lv(e.series)===cl.TYPE.MARKER));return{min:Math.min(...i.filter((e=>Lw(e.qMin))).map((e=>e.qMin))),max:Math.max(...i.filter((e=>Lw(e.qMax))).map((e=>e.qMax))),bar:{min:Math.min(...o.filter((e=>Lw(e.qMin))).map((e=>e.qMin))),max:Math.max(...o.filter((e=>Lw(e.qMax))).map((e=>e.qMax)))},line:{min:Math.min(...a.filter((e=>Lw(e.qMin))).map((e=>e.qMin))),max:Math.max(...a.filter((e=>Lw(e.qMax))).map((e=>e.qMax)))},marker:{min:Math.min(...s.filter((e=>Lw(e.qMin))).map((e=>e.qMin))),max:Math.max(...s.filter((e=>Lw(e.qMax))).map((e=>e.qMax)))}}}}function Rw({isPrimary:e,layoutService:t,seriesModel:n}){const r=kw({isPrimary:e,layoutService:t,seriesModel:n}),i=function({seriesModel:e,isPrimary:t}){return function({dataPage:n}){const r=e.query.series(cl.TYPE.BAR).filter((e=>e.isPrimary===t)).map((e=>e.refIndex)),{qMatrix:i}=n,o={min:NaN,max:NaN};return i.forEach((e=>{let t=0,n=0;e.slice(1).filter(((e,t)=>r.some((e=>e===t))&&"NaN"!==e.qNum)).forEach((e=>{e.qNum>=0?n+=e.qNum:t+=e.qNum})),o.min=Number.isNaN(o.min)?t:Math.min(t,o.min),o.max=Number.isNaN(o.max)?n:Math.max(n,o.max)})),o}}({seriesModel:n,isPrimary:e});return function({dataPage:e}){const t=r({dataPage:e});return t.bar=i({dataPage:e}),t.min=Math.min(t.bar.min,t.line.min,t.marker.min),t.max=Math.max(t.bar.max,t.line.max,t.marker.max),t}}function Pw({isPrimary:e,continuousModel:t,layoutService:n,reducedModel:r,seriesModel:i}){const o={min:NaN,max:NaN,implicit:{min:NaN,max:NaN,bar:{min:NaN,max:NaN},line:{min:NaN,max:NaN},marker:{min:NaN,max:NaN}},explicit:{min:NaN,max:NaN},meta:{hasExplicit:!1,hasExplicitMin:!1,hasExplicitMax:!1,includesZero:!1}},a=function({isPrimary:e,layoutService:t,seriesModel:n}){const{isBarSeriesStacked:r}=t.meta,i=n.query.series(cl.TYPE.BAR).filter((t=>t.isPrimary===e)).length;return!r||i<2?kw({isPrimary:e,layoutService:t,seriesModel:n}):Rw({isPrimary:e,layoutService:t,seriesModel:n})}({isPrimary:e,layoutService:n,seriesModel:i});return{query:{getExtrema:()=>o},command:{initialize:()=>{const{min:s,max:l}=function({isPrimary:e,layoutService:t}){const n={min:NaN,max:NaN},{getLayoutValue:r}=t,i=r("measureAxes."+(e?0:1),{});if(i.autoMinMax)return n;const{minMax:o,min:a,max:s}=i;return"min"!==o&&"minMax"!==o||(n.min=a),"max"!==o&&"minMax"!==o||(n.max=s),Number.isNaN(n.min)||Number.isNaN(n.max)||(n.min=Math.min(a,s),n.max=Math.max(a,s)),n}({isPrimary:e,layoutService:n});return o.explicit.min=s,o.explicit.max=l,o.meta.hasExplicitMin=!Number.isNaN(s),o.meta.hasExplicitMax=!Number.isNaN(l),o.meta.hasExplicit=o.meta.hasExplicitMin||o.meta.hasExplicitMax,function({continuousModel:e,layoutService:t,reducedModel:n}){const{isDiscrete:r}=t.meta;if(r){const e=n.query.getCube();return Promise.resolve({dataPage:e.qDataPages[0]})}return e.fetchMinMaxData().then((e=>({dataPage:e[0]})))}({continuousModel:t,layoutService:n,reducedModel:r}).then((({dataPage:t})=>{const{min:n,max:r,bar:s,line:l,marker:u}=a({dataPage:t}),c=i.query.seriesByAxis(e).some((e=>lv(e)===cl.TYPE.BAR)),d=c?Math.min(n,0):n,m=c?Math.max(r,0):r,f=c?Math.min(s.min,0):s.min,p=c?Math.max(s.max,0):s.max,h=c?Math.min(l.min,0):l.min,g=c?Math.max(l.max,0):l.max,y=c?Math.min(u.min,0):u.min,v=c?Math.max(u.max,0):u.max;o.implicit.min=Number.isFinite(d)?d:0,o.implicit.max=Number.isFinite(m)?m:0,o.implicit.bar.min=Number.isFinite(f)?f:0,o.implicit.bar.max=Number.isFinite(p)?p:0,o.implicit.line.min=Number.isFinite(h)?h:0,o.implicit.line.max=Number.isFinite(g)?g:0,o.implicit.marker.min=Number.isFinite(y)?y:0,o.implicit.marker.max=Number.isFinite(v)?v:0,o.min=Number.isNaN(o.explicit.min)?o.implicit.min:o.explicit.min,o.max=Number.isNaN(o.explicit.max)?o.implicit.max:o.explicit.max,o.meta.hasExplicitMin&&!o.meta.hasExplicitMax&&(o.max=Math.max(o.min,o.max)),o.meta.hasExplicitMax&&!o.meta.hasExplicitMin&&(o.min=Math.min(o.min,o.max)),o.meta.includesZero=!!((0-o.min)*(0-o.max)<=0)}))}}}}const $w=.2;function Fw({extrema:e,ticks:t}){const n=e.meta.hasExplicit?2:3;return t.filter((t=>(t=>!e.meta.hasExplicitMin||t>=e.explicit.min)(t)&&(t=>!e.meta.hasExplicitMax||t<=e.explicit.max)(t))).length>=n}function zw({min:e,max:t,count:n,threshold:r,disable:i}){const o=function(e,t,n){const r=Sr().domain([e,t]);return r.nice(n),r}(e,t,n),a=function({min:e,max:t,threshold:n,scale:r,disable:i}){const o={start:!0,stop:!0};if(i)return o;const[a,s]=r.domain();return 0!==e&&0!==a&&(o.start=r(e)>n),0!==t&&0!==s&&(o.stop=r(t)<1-n),o}({min:e,max:t,threshold:r,scale:o,disable:i});if(!a.start||!a.stop){const[e,t]=o.domain(),r=o.ticks(n),i=r.length>=4?r[1]-r[0]:.1*e,s=r.length>=4?r[r.length-1]-r[r.length-2]:.1*t;o.domain([a.start?e:e-i,a.stop?t:t+s]),o.nice(n)}return o}const _w=50,jw=100,Hw=200,Vw=125,Bw=e=>{switch(e){case.5:return _w;case 1:return jw;case 2:return Hw;default:return e*Vw}};function Uw({config:e,chart:t,layoutService:n,dockService:r,measureText:i,size:o,min:a,max:s}){const l=function({config:{measureAxesRef:e},layoutService:t,size:n}){const r=t.getLayoutValue(`${e}.spacing`,1),i=Bw(r);return Math.max(1,Math.round(n/i))}({config:e,layoutService:n,size:o}),u=zw({min:a,max:s,count:l,threshold:.05,disable:!0}),c=u.domain(),d={roundedMin:c[0],roundedMax:c[1],ticks:u.ticks(l)},m="horizontal"===r.meta.major.orientation?"height":"width",f=e=>i(e)[m],p=t.formatter(e.formatter),h=()=>{const e=d.ticks.map(p),t=e.some(((t,n)=>e.indexOf(t)!==n));return!t&&(e=>{const t=o/d.ticks.length;return Math.max(...e.map(f))<=t})(e)};for(let e=l-1;e>0&&!h();e--)u.domain([a,s]),u.nice(e),[d.roundedMin,d.roundedMax]=u.domain(),d.ticks=u.ticks(e);return d}const Yw=.3;function Ww({tick:e,index:t,ticks:n}){return 0===t||t===n.length-1||0===e}function Gw({index:e,ticks:t}){return 0===e||e===t.length-1||e===Math.floor((t.length-1)/2)}const Xw=10;function Kw({config:e,chart:t,extrema:n,min:r,max:i}){const o={roundedMin:0,roundedMax:0,ticks:[]},a=zw({min:r,max:i,count:Xw,threshold:.15,disable:!0});[o.roundedMin,o.roundedMax]=a.domain();const s=a.ticks(Xw),l=function({ticks:e}){const t=Math.round(e.length*Yw),n=t,r=e.length-t;return e.slice(n,r).some((e=>0===e))}({ticks:s}),u=l?Ww:Gw;o.ticks=s.filter(((e,t,n)=>u({tick:e,index:t,ticks:n})));o.ticks.length%2==0&&!l&&!n.meta.hasExplicit&&s.length>1&&(o.ticks=[s[0],(s[0]+s[s.length-1])/2,s[s.length-1]]);const c=t.formatter(e.formatter),d=o.ticks.map(c),m=d.some(((e,t)=>d.indexOf(e)!==t));return m&&(o.ticks=[o.ticks[0],o.ticks[o.ticks.length-1]]),o}function Jw({ticks:e,extrema:t}){let n=[...e];return t.meta.hasExplicit&&e.length?(t.meta.hasExplicitMin&&!e.some((e=>e===t.explicit.min))&&(n.unshift(t.explicit.min),n=n.filter((e=>e>=t.explicit.min))),t.meta.hasExplicitMax&&!e.some((e=>e===t.explicit.max))&&(n.push(t.explicit.max),n=n.filter((e=>e<=t.explicit.max))),n):n}function Zw({config:e,chart:t,layoutService:n,dockService:r,extrema:i,measureText:o,size:a,min:s,max:l}){const{ticks:u,roundedMin:c,roundedMax:d}=function({config:e,chart:t,layoutService:n,dockService:r,extrema:i,measureText:o,size:a,min:s,max:l}){if("SPARK"===r.meta.chart.mode)return function({min:e,max:t}){return{roundedMin:e,roundedMax:t,ticks:[]}}({min:s,max:l});const u=Uw({config:e,chart:t,layoutService:n,dockService:r,measureText:o,size:a,min:s,max:l});return Fw({extrema:i,ticks:u.ticks})?u:Kw({config:e,chart:t,extrema:i,min:s,max:l})}({config:e,chart:t,layoutService:n,dockService:r,extrema:i,measureText:o,size:a,min:s,max:l}),m=function({ticks:e,count:t}){const n=[];for(let r=0;r<e.length-1;r++){const i=e[r],o=(e[r+1]-i)/(t+1);for(let e=1;e<=t;e++)n.push(i+o*e)}return n}({ticks:u,count:1}),f=[...Jw({ticks:u,extrema:i}).map((e=>({value:e,isMinor:!1}))),...m.map((e=>({value:e,isMinor:!0})))].sort(((e,t)=>e.value-t.value));return{min:c,max:d,values:f}}function Qw({config:e,chart:t,layoutService:n,dockService:r,measureText:i,extrema:o,size:a}){const{min:s,max:l}=function({extrema:e}){const{min:t,max:n}=e;return t!==n?{min:t,max:n}:0===t||1===t?{min:t-1,max:n+1}:{min:t-t*$w*Math.sign(t),max:n+n*$w*Math.sign(n)}}({extrema:o});return Zw({config:e,chart:t,layoutService:n,dockService:r,extrema:o,measureText:i,size:a,min:s,max:l})}function eA({config:e,chart:t,layoutService:n,extremumModel:r,dockService:i,seriesModel:o,themeService:a}){const s={locked:!1,resolved:void 0},{getExtrema:l}=r.query,u=function({chart:e,config:t,dockService:n,extremumModel:r,layoutService:i,seriesModel:o,themeService:a}){const{measureText:s}=S.renderer("svg")();return()=>{const l=a.getStyles(),u=function({dockService:e,seriesModel:t,chart:n}){var r;const i=n.component(t.meta.seriesComponentKeys[0]),o=null!==(r=null==i?void 0:i.rect)&&void 0!==r?r:e.meta.chart.size;return"horizontal"===e.meta.major.orientation?o.height:o.width}({chart:e,dockService:n,seriesModel:o}),c=r.query.getExtrema();return Qw({config:t,chart:e,layoutService:i,dockService:n,measureText:e=>s({text:e,fontFamily:l.axis.label.name.fontFamily,fontSize:l.axis.label.name.fontSize}),extrema:c,size:u})}}({config:e,chart:t,layoutService:n,extremumModel:r,dockService:i,seriesModel:o,themeService:a}),c=()=>(s.locked&&s.resolved||(s.resolved=u()),s.resolved);return{query:{getValues:()=>c().values,getMin:()=>l().meta.hasExplicitMin?l().explicit.min:c().min,getMax:()=>l().meta.hasExplicitMax?l().explicit.max:c().max},command:{lock:()=>{s.locked=!0},unlock:()=>{s.locked=!1}}}}function tA({genericObjectModel:e,layoutService:t}){const n={properties:void 0};return{query:{getProperties:()=>n.properties},command:{initialize:()=>function({layout:e,model:t}){return ue.snapshot(e)?Promise.resolve(null):t.getEffectiveProperties().then((e=>({properties:e})))}({layout:t.getLayout(),model:e}).then((e=>{const{properties:t}=null!=e?e:{};n.properties=t}))}}}function nA({layoutService:e,seriesModel:t,colorService:n}){const{type:r,mode:i,fieldType:o}=n.getSettings();if("categorical"!==r)return;const a=e.getLayoutValue("dataPoint.show",!1)?"line-point":"line";let s;s="field"===i?"measure"===o?()=>({type:cl.TYPE.BAR}):()=>t.query.all()[0]:e=>t.query.all()[e.value];return{item:{shape:{type:({datum:e})=>{const{type:t,options:n}=s(e);switch(t){case"line":return a;case"marker":return n.marker;default:return"square"}},stroke:{},strokeWidth:({datum:e})=>{const{type:t,options:n}=s(e);return t===cl.TYPE.LINE?2:t!==cl.TYPE.MARKER||n.fill?0:1},size:10,fill:{fn:({datum:e,scale:t})=>{const{type:n,options:r}=s(e);return n!==cl.TYPE.MARKER||"bar"===r.marker||r.fill?t(e.value):"none"}}}}}}function rA({layout:e,defaultAuto:t}){const n=t(e),r=e.qHyperCube.qMeasureInfo.length>1;return{...n,useBaseColors:r?"measure":n.useBaseColors}}function iA({actions:e,appLayoutModel:t,appModel:n,chart:r,environment:i,genericObjectModel:o,layoutService:a,picasso:s,seriesModel:l,viewState:u,styleModel:c}){let d;const{theme:m,translator:f}=i,p={wrappedScales:void 0,legendComponents:void 0,legendInteractions:void 0};return d=Lf({picasso:s,model:o,app:n,translator:f,layoutService:a,createConfig:()=>{const e=a.getHyperCubeValue("qMeasureInfo").map((e=>e.color));return{theme:m,colorProps:{measureOverrides:e},legendProps:a.getLayoutValue("legend"),hc:a.getHyperCube(),key:ul.SCALE.COLOR}},config:{auto:rA,localeInfo:t.qLocaleInfo},custom:{wrappedScales:()=>p.wrappedScales,legendComponents:()=>p.legendComponents,legendInteractions:()=>p.legendInteractions,updateLegend:()=>{const{components:t,interactions:n,scales:o}=function({viewState:e,chart:t,layoutService:n,seriesModel:r,environment:i,colorService:o,actions:a,styleModel:s}){const{options:l}=i,u={eventName:"legend-c",key:ul.COMPONENT.LEGEND,viewState:e,chart:t,styleReference:"object.comboChart",styleOverrides:{title:s.query.legend.title.getStyle(),label:s.query.legend.label.getStyle()},rtl:"rtl"===l.direction,settings:nA({layoutService:n,seriesModel:r,colorService:o})},{components:c,interactions:d}=o.getLegend(u,{actions:a,navigationDisabled:!a.interact.enabled()}),m=o.getScales();return{components:c.filter(Boolean).map((e=>{const{layout:t}=e,{dock:n}=t,r=m[`${ul.SCALE.COLOR}Range`];return!r||"right"!==n&&"left"!==n||(r.invert=!0),"legend-cat"===e.type&&(e.settings.item.shape.fill.scale=e.scale,e.settings.item.shape.stroke.scale=e.scale),e})),interactions:d,scales:m}}({viewState:u,chart:r,environment:i,colorService:d,seriesModel:l,layoutService:a,actions:e,styleModel:c});p.wrappedScales=o,p.legendComponents=t,p.legendInteractions=n}}}),d}var oA=Object.prototype.hasOwnProperty,aA=Object.prototype.toString,sA=Object.defineProperty,lA=Object.getOwnPropertyDescriptor,uA=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===aA.call(e)},cA=function(e){if(!e||"[object Object]"!==aA.call(e))return!1;var t,n=oA.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&oA.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||oA.call(e,t)},dA=function(e,t){sA&&"__proto__"===t.name?sA(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},mA=function(e,t){if("__proto__"===t){if(!oA.call(e,t))return;if(lA)return lA(e,t).value}return e[t]};function fA(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function pA(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function hA(){}!function(e){e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")&&e.default}((function e(){var t,n,r,i,o,a,s=arguments[0],l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l<u;++l)if(null!=(t=arguments[l]))for(n in t)r=mA(s,n),s!==(i=mA(t,n))&&(c&&i&&(cA(i)||(o=uA(i)))?(o?(o=!1,a=r&&uA(r)?r:[]):a=r&&cA(r)?r:{},dA(s,{name:n,newValue:e(c,a,i)})):void 0!==i&&dA(s,{name:n,newValue:i}));return s}));var gA=1/.7,yA="\\s*([+-]?\\d+)\\s*",vA="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",bA="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",xA=/^#([0-9a-f]{3,8})$/,MA=new RegExp(`^rgb\\(${yA},${yA},${yA}\\)$`),SA=new RegExp(`^rgb\\(${bA},${bA},${bA}\\)$`),EA=new RegExp(`^rgba\\(${yA},${yA},${yA},${vA}\\)$`),CA=new RegExp(`^rgba\\(${bA},${bA},${bA},${vA}\\)$`),qA=new RegExp(`^hsl\\(${vA},${bA},${bA}\\)$`),wA=new RegExp(`^hsla\\(${vA},${bA},${bA},${vA}\\)$`),AA={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 OA(){return this.rgb().formatHex()}function DA(){return this.rgb().formatRgb()}function NA(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=xA.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?IA(t):3===n?new RA(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?TA(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?TA(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=MA.exec(e))?new RA(t[1],t[2],t[3],1):(t=SA.exec(e))?new RA(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=EA.exec(e))?TA(t[1],t[2],t[3],t[4]):(t=CA.exec(e))?TA(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=qA.exec(e))?jA(t[1],t[2]/100,t[3]/100,1):(t=wA.exec(e))?jA(t[1],t[2]/100,t[3]/100,t[4]):AA.hasOwnProperty(e)?IA(AA[e]):"transparent"===e?new RA(NaN,NaN,NaN,0):null}function IA(e){return new RA(e>>16&255,e>>8&255,255&e,1)}function TA(e,t,n,r){return r<=0&&(e=t=n=NaN),new RA(e,t,n,r)}function LA(e){return e instanceof hA||(e=NA(e)),e?new RA((e=e.rgb()).r,e.g,e.b,e.opacity):new RA}function kA(e,t,n,r){return 1===arguments.length?LA(e):new RA(e,t,n,null==r?1:r)}function RA(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function PA(){return`#${_A(this.r)}${_A(this.g)}${_A(this.b)}`}function $A(){const e=FA(this.opacity);return`${1===e?"rgb(":"rgba("}${zA(this.r)}, ${zA(this.g)}, ${zA(this.b)}${1===e?")":`, ${e})`}`}function FA(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function zA(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function _A(e){return((e=zA(e))<16?"0":"")+e.toString(16)}function jA(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new VA(e,t,n,r)}function HA(e){if(e instanceof VA)return new VA(e.h,e.s,e.l,e.opacity);if(e instanceof hA||(e=NA(e)),!e)return new VA;if(e instanceof VA)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,s=o-i,l=(o+i)/2;return s?(a=t===o?(n-r)/s+6*(n<r):n===o?(r-t)/s+2:(t-n)/s+4,s/=l<.5?o+i:2-o-i,a*=60):s=l>0&&l<1?0:a,new VA(a,s,l,e.opacity)}function VA(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function BA(e){return(e=(e||0)%360)<0?e+360:e}function UA(e){return Math.max(0,Math.min(1,e||0))}function YA(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}fA(hA,NA,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:OA,formatHex:OA,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return HA(this).formatHsl()},formatRgb:DA,toString:DA}),fA(RA,kA,pA(hA,{brighter(e){return e=null==e?gA:Math.pow(gA,e),new RA(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new RA(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new RA(zA(this.r),zA(this.g),zA(this.b),FA(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:PA,formatHex:PA,formatHex8:function(){return`#${_A(this.r)}${_A(this.g)}${_A(this.b)}${_A(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:$A,toString:$A})),fA(VA,(function(e,t,n,r){return 1===arguments.length?HA(e):new VA(e,t,n,null==r?1:r)}),pA(hA,{brighter(e){return e=null==e?gA:Math.pow(gA,e),new VA(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new VA(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,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new RA(YA(e>=240?e-240:e+120,i,r),YA(e,i,r),YA(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new VA(BA(this.h),UA(this.s),UA(this.l),FA(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=FA(this.opacity);return`${1===e?"hsl(":"hsla("}${BA(this.h)}, ${100*UA(this.s)}%, ${100*UA(this.l)}%${1===e?")":`, ${e})`}`}}));const WA=Math.PI/180,GA=180/Math.PI,XA=4/29,KA=6/29,JA=3*KA*KA;function ZA(e){if(e instanceof QA)return new QA(e.l,e.a,e.b,e.opacity);if(e instanceof iO)return oO(e);e instanceof RA||(e=LA(e));var t,n,r=rO(e.r),i=rO(e.g),o=rO(e.b),a=eO((.2225045*r+.7168786*i+.0606169*o)/1);return r===i&&i===o?t=n=a:(t=eO((.4360747*r+.3850649*i+.1430804*o)/.96422),n=eO((.0139322*r+.0971045*i+.7141733*o)/.82521)),new QA(116*a-16,500*(t-a),200*(a-n),e.opacity)}function QA(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function eO(e){return e>.008856451679035631?Math.pow(e,1/3):e/JA+XA}function tO(e){return e>KA?e*e*e:JA*(e-XA)}function nO(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function rO(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function iO(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function oO(e){if(isNaN(e.h))return new QA(e.l,0,0,e.opacity);var t=e.h*WA;return new QA(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}fA(QA,(function(e,t,n,r){return 1===arguments.length?ZA(e):new QA(e,t,n,null==r?1:r)}),pA(hA,{brighter(e){return new QA(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new QA(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 RA(nO(3.1338561*(t=.96422*tO(t))-1.6168667*(e=1*tO(e))-.4906146*(n=.82521*tO(n))),nO(-.9787684*t+1.9161415*e+.033454*n),nO(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),fA(iO,(function(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof iO)return new iO(e.h,e.c,e.l,e.opacity);if(e instanceof QA||(e=ZA(e)),0===e.a&&0===e.b)return new iO(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*GA;return new iO(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new iO(e,t,n,null==r?1:r)}),pA(hA,{brighter(e){return new iO(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new iO(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return oO(this).rgb()}}));var aO,sO=e=>()=>e;function lO(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):sO(isNaN(e)?t:e)}function uO(e){var t=0,n=e.children,r=n&&n.length;if(r)for(;--r>=0;)t+=n[r].value;else t=1;e.value=t}function cO(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=mO)):void 0===t&&(t=dO);for(var n,r,i,o,a,s=new hO(e),l=[s];n=l.pop();)if((i=t(n.data))&&(a=(i=Array.from(i)).length))for(n.children=i,o=a-1;o>=0;--o)l.push(r=i[o]=new hO(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(pO)}function dO(e){return e.children}function mO(e){return Array.isArray(e)?e[1]:null}function fO(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function pO(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function hO(e){this.data=e,this.depth=this.height=0,this.parent=null}!function e(t){var n=function(e){return 1==(e=+e)?lO: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(r){return Math.pow(e+r*t,n)}}(t,n,e):sO(isNaN(t)?n:t)}}(t);function r(e,t){var r=n((e=kA(e)).r,(t=kA(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),a=lO(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=o(t),e.opacity=a(t),e+""}}return r.gamma=e,r}(1),hO.prototype=cO.prototype={constructor:hO,count:function(){return this.eachAfter(uO)},each:function(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this},eachAfter:function(e,t){for(var n,r,i,o=this,a=[o],s=[],l=-1;o=a.pop();)if(s.push(o),n=o.children)for(r=0,i=n.length;r<i;++r)a.push(n[r]);for(;o=s.pop();)e.call(t,o,++l,this);return this},eachBefore:function(e,t){for(var n,r,i=this,o=[i],a=-1;i=o.pop();)if(e.call(t,i,++a,this),n=i.children)for(r=n.length-1;r>=0;--r)o.push(n[r]);return this},find:function(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r},sum:function(e){return this.eachAfter((function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].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(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r},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 cO(this).eachBefore(fO)},[Symbol.iterator]:function*(){var e,t,n,r,i=this,o=[i];do{for(e=o.reverse(),o=[];i=e.pop();)if(yield i,t=i.children)for(n=0,r=t.length;n<r;++n)o.push(t[n])}while(o.length)}},aO=function(e){
16
+ /*! javascript-number-formatter - v1.1.11 - http://mottie.github.com/javascript-number-formatter/ * © ecava */
17
+ e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,a,s,l,u,c,d,m=e.length,f=e.search(/[0-9\-\+#]/),p=f>0?e.substring(0,f):"",h=e.split("").reverse().join(""),g=h.search(/[0-9\-\+#]/),y=m-g,v=e.substring(y,y+1),b=y+("."===v||","===v?1:0),x=g>0?e.substring(b,m):"";if(n=(t="-"===(e=e.substring(f,b)).charAt(0)?-t:+t)<0?t=-t:0,i=(r=e.match(/[^\d\-\+#]/g))&&r[r.length-1]||".",o=r&&r[1]&&r[0]||",",e=e.split(i),t=+(t=t.toFixed(e[1]&&e[1].length))+"",s=e[1]&&e[1].lastIndexOf("0"),(!(u=t.split("."))[1]||u[1]&&u[1].length<=s)&&(t=(+t).toFixed(s+1)),c=e[0].split(o),e[0]=c.join(""),(a=e[0]&&e[0].indexOf("0"))>-1)for(;u[0].length<e[0].length-a;)u[0]="0"+u[0];else 0==+u[0]&&(u[0]="");if((t=t.split("."))[0]=u[0],l=c[1]&&c[c.length-1].length){for(h="",y=(d=t[0]).length%l,m=d.length,b=0;b<m;b++)h+=d.charAt(b),!((b-y+1)%l)&&b<m-l&&(h+=o);t[0]=h}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),p+(n?"-":"")+r+x}},aO({exports:{}});const gO="REJECTED",yO=()=>{},vO=1e4,bO={MULTIPLIER:2,MINIMUM:20,MAXIMUM:200},xO=50,MO=10,SO=100;var EO={contains:function(e,t){if(!e)return!1;const{qArea:n}=e;return!!n&&(n.qLeft<=t.qLeft&&n.qLeft+n.qWidth>=t.qLeft+t.qWidth&&n.qTop<=t.qTop&&n.qTop+n.qHeight>=t.qTop+t.qHeight)},patcher:function({layoutService:e}){const t=t=>{t.qArea.qHeight=t.qMatrix.length,t.qArea.qWidth=e.meta.size.x};return t.should=e=>0===e.qArea.qHeight&&0===e.qArea.qWidth&&!!e.qMatrix.length,t},slicer:function(e,t){const n=Math.max(0,t.qHeight)-Math.abs(Math.min(0,t.qTop-e.qArea.qTop)),r=Math.max(0,t.qWidth)-Math.abs(Math.min(0,t.qLeft-e.qArea.qLeft)),i=Math.max(t.qTop,e.qArea.qTop),o=Math.max(t.qLeft,e.qArea.qLeft),a=Math.max(0,i-e.qArea.qTop),s=Math.min(i+n-e.qArea.qTop,e.qArea.qHeight),l=Math.max(0,o-e.qArea.qLeft),u=Math.min(o+r-e.qArea.qLeft,e.qArea.qWidth),c={qArea:{qHeight:s-a,qWidth:u-l,qTop:i,qLeft:o},qMatrix:[]};for(let t=a;t<s;t++)c.qMatrix.push(e.qMatrix[t].slice(l,u));return c},cacheWarden:function({bounds:e={width:0,height:0}}){return{release(t,n){const r=n.qTop-MO<=t.qTop,i=n.qLeft+n.qWidth+MO>=t.qLeft+t.qWidth,o=n.qTop+n.qHeight+MO>=t.qTop+t.qHeight,a=n.qLeft-MO<=t.qLeft;return r&&t.qTop>0||i&&t.qLeft+t.qWidth<e.width||o&&t.qTop+t.qHeight<e.height||a&&t.qLeft>0}}},request:function({definitionPath:e}){return t=>({method:"getHyperCubeData",args:[e,[t]]})}};var CO={contains:function(e,t){if(!e)return!1;const{qArea:n}=e;return!!n&&(n.qTop<=t.qTop&&n.qTop+n.qHeight>=t.qTop+t.qHeight)},patcher:function({layoutService:e}){const t=t=>{t.qArea.qHeight=t.qData[0].qSubNodes.length,t.qArea.qWidth=e.meta.size.x};return t.should=e=>0===e.qArea.qHeight&&0===e.qArea.qWidth&&!!e.qData.length,t},slicer:function(e,t){const n=Math.max(0,t.qHeight)-Math.abs(Math.min(0,t.qTop-e.qArea.qTop)),r=Math.max(t.qTop,e.qArea.qTop),i=Math.max(t.qLeft,e.qArea.qLeft),o=Math.max(0,r-e.qArea.qTop),a=Math.min(r+n-e.qArea.qTop,e.qArea.qHeight),s=e.qData[0].qUp+e.qArea.qHeight+e.qData[0].qDown-r-(a-o),l={qArea:{qHeight:a-o,qWidth:e.qArea.qWidth,qTop:r,qLeft:i},qData:[{...e.qData[0],qUp:r,qDown:s,qSubNodes:[]}]};for(let t=o;t<a;t++)l.qData[0].qSubNodes.push(e.qData[0].qSubNodes[t]);return l},cacheWarden:function({bounds:e={height:0}}){return{release(t,n){const r=n.qTop-MO<=t.qTop,i=n.qTop+n.qHeight+MO>=t.qTop+t.qHeight;return r&&t.qTop>0||i&&t.qTop+t.qHeight<e.height}}},request:function({layoutService:e,definitionPath:t}){const n=e.getLayoutValue("dimensionAxis.axisDisplayMode","auto");return e=>{const r={method:"getHyperCubeStackData",args:[t,[e]]};return"auto"===n&&r.args.push(600),r}}};var qO={contains:function(){return!1},patcher:function(){const e=e=>e;return e.should=()=>!1,e},slicer:function(e){return e},cacheWarden:function(){return{release:()=>!0}},request:function({definitionPath:e}){return t=>({method:"getHyperCubeTreeData",args:[e,[t]]})}};const wO="pages";const AO="discretePan",OO=10;function DO({chart:e,actions:t,componentKey:n,dockService:r,rtl:i,scroller:o}){return{type:"Pan",key:"discrete:pan",options:{event:AO,pointers:1,threshold:OO,enable(r,i){return this.started===AO||!i||!(!t.scroll.enabled()||!o.enabled())&&e.componentsFromPoint({x:i.center.x,y:i.center.y}).some((e=>e.key===n))}},events:{[`${AO}start`](e){e.preventDefault(),this.started=AO;const t="horizontal"===r.meta.major.orientation?e.deltaX:e.deltaY;this.previousTotalDelta=t<0?-OO:OO},[`${AO}move`](e){e.preventDefault();const t="horizontal"===r.meta.major.orientation,n=t?e.deltaX:e.deltaY,a=t&&i?-1:1,s=(n-this.previousTotalDelta)*a;this.previousTotalDelta=n,o.scroll(s)},[`${AO}end`](e){e.preventDefault(),this.started=!1},[`${AO}cancel`](e){e.preventDefault(),this.started=!1}}}}function NO({chart:e,componentKey:t,actions:n,scroller:r}){return function(i){if(!n.scroll.enabled()||!r.enabled())return;const[o]=e.componentsFromPoint({x:i.clientX,y:i.clientY}).filter((e=>e.key===t));if(!o)return;i.preventDefault();const a=Math.abs(i.deltaY)>Math.abs(i.deltaX)?i.deltaY:i.deltaX,s=Math.sign(-a)*SO;r.scroll(s)}}function IO({layoutService:e}){const t=function({layoutService:e}){const t=Math.floor(vO/(e.meta.dimensionCount+e.meta.measureCount));return function({width:e,height:n}){const r=Math.min(t,Math.max(bO.MAXIMUM,n));return{width:e,height:Math.max(bO.MINIMUM,Math.min(n*bO.MULTIPLIER,r))}}}({layoutService:e}),n={width:e.meta.size.x,height:e.meta.size.y};return function(e){const{width:r,height:i}=t({width:e.qWidth,height:e.qHeight}),o=i?Math.ceil((i-e.qHeight)/2):0,a=r?Math.ceil((r-e.qWidth)/2):0;return{qHeight:i?Math.min(i,n.height):e.qHeight,qWidth:r?Math.min(r,n.width):e.qWidth,qTop:i?Math.max(0,Math.min(e.qTop-o,n.height-i)):e.qTop,qLeft:r?Math.max(0,Math.min(e.qLeft-a,n.width-r)):e.qLeft}}}function TO(e){let t,n;const r=i=>{t=i;const{method:o,args:a}=t.request;e[o](...a).then((e=>{if(t.canceled||n)return t.reject(gO),t=null,void(n&&(r(n),n=null));t.resolve(e[0]),t=null}))},i=e=>new Promise(((i,o)=>{const a={request:e,resolve:i,reject:o,canceled:!1,cancel:()=>{a.canceled=!0}};t?(e=>{n&&n.reject(gO),n=e})(a):r(a)}));return i.isProcessing=()=>!!t,i.hasQueued=()=>!!n,i.cancel=()=>{i.isProcessing()&&t.cancel(),i.hasQueued()&&(n.reject(gO),n=null)},i}const LO={command:{update:()=>{}}};function kO({dataStore:e,composition:t,enigmaModel:n,layoutService:r,trendLineModel:i=LO,definitionPath:o,processDataPage:a}){const{slicer:s,cacheWarden:l,request:u}=t,c=function({dataStore:e,slice:t,warden:n,expand:r,request:i,process:o,connectionless:a,processDataPage:s}){return(l,{onProcessing:u}={})=>{if(e.contains(l)){const r=e.getCurrent();if(a)return Promise.resolve(t(r,l));const i=n.release(r.qArea,l),s=o.isProcessing();if(!i&&s&&o.cancel(),!i||s)return Promise.resolve(t(r,l))}if(a)return Promise.resolve(e.getCurrent());o.isProcessing()&&u&&u();const c=r(l);return o(i(c)).then((n=>(s(n),e.add(n),t(n,l))))}}({dataStore:e,slice:s,warden:l({bounds:{width:r.meta.size.x,height:r.meta.size.y}}),expand:IO({layoutService:r}),request:u({layoutService:r,definitionPath:o}),process:TO(n),connectionless:r.meta.isSnapshot,processDataPage:a}),d=function(e){var t,n,r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50,o=0;return function(){t=this;for(var a=arguments.length,s=new Array(a),l=0;l<a;l++)s[l]=arguments[l];n=s;var u=Date.now()-o,c=function(){o=Date.now(),r=0,e.apply(t,n)};r||(u>=i?c():r=setTimeout(c,i-u))}}(((e,{onProcessing:t,onData:n})=>{c(e,{onProcessing:t}).then((e=>n(e))).catch((e=>{if(e!==gO)throw e}))}),xO);return function(e,{onProcessing:t=yO,onDataPage:n=yO}={}){d(e,{onProcessing:t,onData:e=>{r.setDataPages(e?[e]:[]),i.command.update(),n(e)}})}}var RO={inTotal:function({layoutService:e}){return e.meta.size.x},area:function({layoutService:e}){return{qTop:0,qHeight:1,qLeft:0,qWidth:e.meta.size.x}},scaleRange:function({layoutService:e,offsets:t,items:n,viewSize:r}){const{pixel:i}=t,o=e.getDataPages()[0],a=i/r;return[a,n.inView>=n.inTotal?a+1:a+o.qArea.qWidth/n.inView]}};var PO={inTotal:function({layoutService:e}){if(e.meta.isSnapshot&&!e.getLayoutValue("reducedHyperCube")){const[t]=e.getDataPages();if(t)return t.qArea.qHeight}return e.meta.size.y},area:function({layoutService:e,itemOffset:t,inView:n,areaBuffer:r}){const i=void 0===r?4:r,o=Math.max(0,Math.floor(t)-i/2);return{qTop:o,qHeight:Math.min(e.meta.size.y-o,Math.max(0,Math.ceil(n+i))),qLeft:0,qWidth:e.meta.size.x}},scaleRange:function({layoutService:e,offsets:t,items:n,viewSize:r}){const{pixel:i}=t,o=e.getDataPages()[0],a=r/n.inView,s=(i+o.qArea.qTop*a)/r;return[s,n.inView>=n.inTotal?s+1:s+o.qArea.qHeight/n.inView]}};function $O(e){const{groupSize:t,measureCount:n}=e.meta;return null!=t?t:n}function FO(e,t){const n=[];for(let r=0;r<e.length;r++){const i=t(e[r]);-1===n.indexOf(i)&&n.push(i)}return n.length}function zO(e){return FO(e.qMatrix,(e=>e[0].qElemNumber))-1}var _O={inTotal:function({layoutService:e}){const t=$O(e);return e.meta.size.y*t*(1+1/t)-1},area:function({layoutService:e,itemOffset:t,inView:n,areaBuffer:r}){const i=$O(e),o=void 0===r?i:r,a=t/(i+1),s=Math.max(0,Math.floor((t-a-o/2)/i));return{qTop:s,qHeight:Math.min(e.meta.size.y-s,Math.max(0,Math.ceil((n+o)/i+1))),qLeft:0,qWidth:e.meta.size.x}},scaleRange:function({layoutService:e,offsets:t,items:n,viewSize:r}){const i=$O(e),o=e.getDataPages()[0],a=r/n.inView,{pixel:s}=t,l=zO(o),u=o.qArea.qHeight*i+l,c=(s+(o.qArea.qTop*i+o.qArea.qTop)*a)/r;return[c,n.inView>=n.inTotal?c+1:c+u/n.inView]}};const jO=(e,t)=>t/(e.meta.size.y/e.meta.size.dimensions[0]+1),HO=(e,t)=>{const n={successful:!0,count:0};let r=Math.abs(Math.floor(t));const i=[];for(let t=0;t<=r;t++){if(!e[t])return n.successful=!1,n;const o=e[t][0].qElemNumber;-1===i.indexOf(o)&&(i.push(o),r--)}return n.count=i.length-1,n};function VO(e){return{itemOffset(t,n){if(0!==t.qArea.qTop)return jO(e,n);const r=HO(t.qMatrix,n);return r.successful?r.count:jO(e,n)},area(t,n,r){if(0!==t.qArea.qTop)return jO(e,n);return FO(t.qMatrix.slice(0,r.qTop+1),(e=>e[0].qElemNumber))-1}}}var BO={inTotal:function({layoutService:e}){return e.meta.size.y+e.meta.size.dimensions[0]-1},area:function({getDataPages:e,layoutService:t,itemOffset:n,inView:r}){const i=VO(t).itemOffset(e(),n),o=Math.max(0,Math.floor(n-i));return{qTop:o,qHeight:Math.min(t.meta.size.y-o,Math.max(0,Math.ceil(r+1))),qLeft:0,qWidth:t.meta.size.x}},scaleRange:function({getDataPages:e,layoutService:t,offsets:n,items:r,viewSize:i,upperBound:o}){const a=t.getDataPages()[0],s=i/r.inView,{item:l,pixel:u}=n,c=VO(t).area(e(),l,a.qArea),d=zO(a),m=a.qArea.qHeight+d,f=u===o?(r.inView-m)*s/i:(u+(a.qArea.qTop+c)*s)/i;return[f,r.inView>=r.inTotal?f+1:f+m/r.inView]}};function UO({chart:e,rect:t,dockService:n,itemWidths:r,axisKey:i,renderer:o,isGrouped:a,dimensionAxis:s,inTotal:l,isMajorLabelless:u,maxDataRows:c}){const{DEFAULT:d,SQUEEZE:m,LABELLESS:f}=r[n.meta.chart.mode],p="horizontal"===n.meta.major.orientation,{axisDisplayMode:h="auto",maxVisibleItems:g=10,label:y}=s,v=p?t.width:t.height,b=v/l>=m;switch(h){case"max":return Math.min(l,c);case"custom":return Math.min(g,c);default:return u?v/f:b?function({chart:e,isHorizontal:t,axisKey:n,renderer:r={},isGrouped:i,itemSize:o,label:a}){if(i||"auto"!==a&&"tilted"!==a)return!1;const s=e.component(n),{measureText:l}=r;if(!s||!l)return!0;const{fontFamily:u,fontSize:c,tiltAngle:d}=s.settings.settings.labels,{height:m}=l({fontFamily:u,fontSize:c,text:"M"});if(!t)return m>o;const f=(90-d)*(Math.PI/180);return m>Math.cos(f)*o}({chart:e,isHorizontal:p,axisKey:i,renderer:o,isGrouped:a,itemSize:m,label:y})?v/d:l:v/d}}function YO({chart:e,getRect:t,getDataPages:n,layoutService:r,dockService:i,getItemWidths:o,axisKey:a,renderer:s,areaBuffer:l,rtl:u}){const{inTotal:c,area:d,scaleRange:m}=function({layoutService:e}){const{isDimensionless:t,isGrouped:n,isGroupedByMeasure:r}=e.meta;return t?RO:n?r?_O:BO:PO}({layoutService:r}),f=()=>"horizontal"===i.meta.major.orientation?t().width:t().height,p=e=>e?f()/e:0,h=(e,t)=>-(e-t)*p(t);return{getItems(){const n=r.getLayoutValue("dimensionAxis"),l=c({layoutService:r});return{inTotal:l,inView:UO({chart:e,rect:t(),dockService:i,itemWidths:o(),axisKey:a,renderer:s,isGrouped:r.meta.isGrouped,dimensionAxis:n,inTotal:l,isMajorLabelless:"none"===n.show||"title"===n.show,maxDataRows:Math.floor(vO/(r.meta.dimensionCount+r.meta.measureCount))})}},getItemSize({items:e}){const{inView:t}=e;return p(t)},getOffsets({pixelOffset:e,items:t}){const{inTotal:n,inView:r}=t,i=Math.min(0,Math.max(e,h(n,r))),o=r?Math.abs(r*i/f()):0;return{start:{pixel:i,item:o},end:{item:Math.min(o+(r||0),n)}}},getUpperBound({items:e}){const{inTotal:t,inView:n}=e;return h(t,n)},getViewRange({pixelOffset:e,items:t}){const{inTotal:n,inView:r}=t;return function({viewSize:e,inTotal:t,inView:n,pixelOffset:r}){const i=e/n*t,o=Math.abs(r)/i;return[o,Math.min(1,o+e/i)]}({viewSize:f(),inTotal:n,inView:r,pixelOffset:e})},getArea:({itemOffset:e,items:t})=>d({getDataPages:n,layoutService:r,itemOffset:e,inView:t.inView,areaBuffer:l}),getScaleRange({offsets:e,items:t}){const o=m({getDataPages:n,layoutService:r,offsets:e,items:t,viewSize:f(),upperBound:h(t.inTotal,t.inView)});return"horizontal"===i.meta.major.orientation&&u?function(e){return[1-e[1],1-e[0]]}(o):o},validate:{offset({pixelOffset:e,items:t}){const{inTotal:n,inView:r}=t;return e<=0&&e>=h(n,r)}},convert:{itemToPixelOffset({itemOffset:e,items:t}){const{inView:n}=t,r=e*p(n);return Number.isFinite(r)?-r:0},relativeToPixelOffset({relativeOffset:e,items:t}){const{inTotal:n,inView:r}=t;return-e*(p(r)*n)}}}}function WO({chart:e,componentKey:t,state:n,dataStore:r,pageData:i,layoutService:o,dockService:a,itemWidths:s,getRect:l,axisKey:u,renderer:c,areaBuffer:d,viewState:m,rtl:f}){n.set("rect",{width:0,height:0}),n.set("itemWidths",{}),n.set("itemSize",0),n.set("items",{}),n.set("offsets",{}),n.set("finished",0),n.set("scaleRange",[0,1]);const p=YO({chart:e,getRect:()=>n.get("rect"),getDataPages:r.getCurrent,layoutService:o,dockService:a,getItemWidths:()=>n.get("itemWidths"),axisKey:u,renderer:c,areaBuffer:d,rtl:f}),h=()=>{const e=p.getItems();return n.set("items",e),e},g=({pixelOffset:e,items:t})=>{const r=p.getOffsets({pixelOffset:e,items:t});return n.set("offsets",r),r},y=e=>{const t=Date.now(),r=h(),a=g({pixelOffset:e,items:r}),s=p.getArea({itemOffset:a.start.item,items:r});if((e=>{const[{qArea:t}]=o.getDataPages();return!!t&&Object.keys(e).every((n=>e[n]===t[n]))})(s))return void((p.validate.offset({pixelOffset:e,items:r})||m.get("scrollOffset").start!==a.start.item)&&(n.set("finished",t),n.set("scaleRange",p.getScaleRange({offsets:a.start,items:r})),m.preventSet("viewRange",p.getViewRange({pixelOffset:a.start.pixel,items:r})),m.set("scrollOffset",{start:a.start.item,end:a.end.item})));m.preventSet("viewRange",p.getViewRange({pixelOffset:a.start.pixel,items:r}));const l=()=>{n.get("finished")>t||(n.set("finished",t),n.set("scaleRange",p.getScaleRange({offsets:a.start,items:r})),m.set("scrollOffset",{start:a.start.item,end:a.end.item}))};i(s,{onProcessing:l,onDataPage:l})};return{enabled(){const{inTotal:e,inView:t}=n.get("items");return e>t},itemSize:()=>n.get("itemSize"),scaleRange:()=>n.get("scaleRange"),initialize(){const r=e.component(t);if(!r)return Promise.resolve();n.set("rect","function"==typeof l?l():r.rect),n.set("itemWidths","function"==typeof s?s():s);const a=h();n.set("itemSize",p.getItemSize({items:a}));const u=(({items:e})=>{const t=o.getLayoutValue("scrollStartPos"),n=m.get("scrollOffset");if(void 0===n)return 1===t?p.getUpperBound({items:e}):0;if("number"==typeof n)return p.convert.itemToPixelOffset({itemOffset:n,items:e});const{start:r,end:i}=n,a=1===t&&i?i-e.inView:r;return p.convert.itemToPixelOffset({itemOffset:a,items:e})})({items:a}),c=g({pixelOffset:u,items:a});m.preventSet("viewRange",p.getViewRange({pixelOffset:c.start.pixel,items:a}));const d=p.getArea({itemOffset:c.start.item,items:a});return new Promise((e=>{i(d,{onDataPage:()=>{n.set("scaleRange",p.getScaleRange({offsets:c.start,items:a})),m.preventSet("scrollOffset",{start:c.start.item,end:c.end.item}),e()}})}))},scroll(e){const t=n.get("offsets").start.pixel+e;y(t)},scrollToRelative(e){const t=n.get("items"),r=p.convert.relativeToPixelOffset({relativeOffset:e,items:t});y(r)}}}function GO({chart:e,actions:t,componentKey:n,enigmaModel:r,layoutService:i,dockService:o,trendLineModel:a,itemWidths:s,viewState:l,rtl:u,options:{definitionPath:c="/qHyperCubeDef",getRect:d,axisKey:m,renderer:f,areaBuffer:p,processDataPage:h=(()=>{})}={}}){const g=function(){var e={};return{get:function(t){return e[t]},set:function(t,n){return e[t]=n,n},has:function(t){return t in e},remove:function(t){delete e[t]},empty:function(){e={}}}}(),y=function({qMode:e}){switch(e){case"S":default:return EO;case"K":return CO;case"T":return qO}}({qMode:i.getHyperCubeValue("qMode")}),v=function({state:e,contains:t}){return e.set(wO,[]),{add:t=>{const n=e.get(wO);n.length=0,n.push(t)},getCurrent:()=>e.get(wO)[0],getAll:()=>e.get(wO),contains:n=>t(e.get(wO)[0],n)}}({state:g,contains:y.contains});!function({layoutService:e,dataStore:t,composition:n}){const r=e.getDataPages()[0];if(!r)return;const i=n.patcher({layoutService:e});i.should(r)&&i(r),t.add(r)}({layoutService:i,dataStore:v,composition:y});const b=function({buffer:e}){return void 0===e?void 0:2*Math.round(e/2)}({buffer:p}),x=kO({dataStore:v,composition:y,enigmaModel:r,layoutService:i,trendLineModel:a,definitionPath:c,processDataPage:h}),M=WO({chart:e,componentKey:n,state:g,dataStore:v,pageData:x,layoutService:i,dockService:o,itemWidths:s,getRect:d,axisKey:m,renderer:f,areaBuffer:b,viewState:l,rtl:u}),S=function({layoutService:e,dataStore:t}){return function(n){const r=function(e,t,n){if(void 0===e||void 0===t)return n;for(var r=t.split("."),i=e,o=0;o<r.length;++o){var a=r[o];if(void 0===i[a])return n;i=i[a]}return i}(n,`${e.refs.dataPages}`);r.length=0,r.push(t.getCurrent())}}({layoutService:i,dataStore:v}),E=function({chart:e,actions:t,componentKey:n,dockService:r,rtl:i,scroller:o}){return{gestures:[DO({chart:e,actions:t,componentKey:n,dockService:r,rtl:i,scroller:o})],native:{type:"native",events:{wheel:NO({chart:e,actions:t,componentKey:n,scroller:o})}}}}({chart:e,actions:t,componentKey:n,dockService:o,rtl:u,scroller:M});return{interactions:E,query:{getCanScroll:()=>M.enabled(),getItemSize:()=>M.itemSize(),getScaleRange:()=>M.scaleRange(),getCurrentDataPage:()=>v.getCurrent()},command:{initialize:()=>M.initialize(),scrollTo:e=>M.scrollToRelative(e),setSnapshotData:e=>S(e)}}}var XO={SPARK:{DEFAULT:7,SQUEEZE:7,LABELLESS:7},XSMALL:{DEFAULT:28,SQUEEZE:24,LABELLESS:20},SMALL:{DEFAULT:28,SQUEEZE:24,LABELLESS:20},MEDIUM:{DEFAULT:28,SQUEEZE:24,LABELLESS:20},FULL:{DEFAULT:28,SQUEEZE:24,LABELLESS:20}};function KO({layoutService:e,key:t}){const{style:n}=e.getLayoutValue("components",[]).filter((e=>e.key===t))[0]||{};return({property:r,defaultValue:i,index:o})=>{const a=n&&Object.hasOwnProperty.call(n,r)?n[r]:i;if(void 0===o)return a;const{style:s}=e.getHyperCubeValue((e=>`qMeasureInfo.${e}.styling`)(o),[]).filter((e=>e.key===t))[0]||{};return s&&Object.hasOwnProperty.call(s,r)?s[r]:a}}function JO({layoutService:e,dockService:t,themeService:n,flags:r}){const{BAR:i,LINE:o,POINT:a}=pd,s=n.getStyles(),l=KO({layoutService:e,key:"bar"}),u=KO({layoutService:e,key:"line"}),c=()=>{const e=l({property:"strokeWidth",defaultValue:"none"});return e?i.STROKE.WIDTH[e.toUpperCase()]:0},d=t=>r.isEnabled("CLIENT_IM_3050")?e.getLayoutValue("components",[]).find((e=>e.key===t)):void 0;return{query:{bar:{getHasStyling:()=>!!e.getLayoutValue("components",[]).filter((e=>"bar"===e.key)).length,getWidthFn:()=>()=>l({property:"width",defaultValue:.7}),getHasStrokeWidth:()=>!!c(),getStrokeWidth:()=>c(),getStrokeColor:()=>l({property:"strokeColor",defaultValue:{index:-1,color:i.STROKE.COLOR}}).color,label:{getStyle:()=>{var e,t,n,r,i,o,a,l,u,c,m,f,p,h,g,y,v,b,x,M,S;return{fill:null!==(e=null===(t=d("bar"))||void 0===t||null===(n=t.bar)||void 0===n||null===(r=n.label)||void 0===r||null===(i=r.value)||void 0===i||null===(o=i.color)||void 0===o?void 0:o.color)&&void 0!==e?e:s.label.value.color,useContrastColor:null===(a=null===(l=d("bar"))||void 0===l||null===(u=l.bar)||void 0===u||null===(c=u.label)||void 0===c||null===(m=c.value)||void 0===m?void 0:m.useContrastColor)||void 0===a||a,fontSize:null!==(f=null===(p=d("bar"))||void 0===p||null===(h=p.bar)||void 0===h||null===(g=h.label)||void 0===g||null===(y=g.value)||void 0===y?void 0:y.fontSize)&&void 0!==f?f:s.label.value.numFontSize,fontFamily:null!==(v=null===(b=d("bar"))||void 0===b||null===(x=b.bar)||void 0===x||null===(M=x.label)||void 0===M||null===(S=M.value)||void 0===S?void 0:S.fontFamily)&&void 0!==v?v:s.label.value.fontFamily}}}},line:{getCurveFn:()=>(e,t)=>u({property:"lineCurve",defaultValue:o.CURVE.LINEAR,index:t}),getStrokeWidthFn:()=>(e,n)=>u({property:"lineThickness",defaultValue:"FULL"===t.meta.chart.mode?o.WIDTH.FULL.DEFAULT:o.WIDTH.LESS.DEFAULT,index:n}),getStrokeDasharrayFn:()=>(e,t)=>{const n=u({property:"lineType",defaultValue:o.TYPE.SOLID,index:t});return n&&o.TYPE[n.toUpperCase()]}},point:{getSize:e=>u({property:"dataPointSize",defaultValue:a.SIZE.DEFAULT,index:e}),label:{getStyle:()=>{var e,t,n,r,i,o,a,l,u,c,m,f,p,h,g,y;return{fill:null!==(e=null===(t=d("line"))||void 0===t||null===(n=t.line)||void 0===n||null===(r=n.label)||void 0===r||null===(i=r.value)||void 0===i||null===(o=i.color)||void 0===o?void 0:o.color)&&void 0!==e?e:s.label.value.color,fontSize:null!==(a=null===(l=d("line"))||void 0===l||null===(u=l.line)||void 0===u||null===(c=u.label)||void 0===c||null===(m=c.value)||void 0===m?void 0:m.fontSize)&&void 0!==a?a:s.label.value.fontSize,fontFamily:null!==(f=null===(p=d("line"))||void 0===p||null===(h=p.line)||void 0===h||null===(g=h.label)||void 0===g||null===(y=g.value)||void 0===y?void 0:y.fontFamily)&&void 0!==f?f:s.label.value.fontFamily}}}},axis:{title:{getStyle:()=>{var e,t,n,r,i,o,a,l,u,c,m,f,p;return{fontFamily:null!==(e=null===(t=d("axis"))||void 0===t||null===(n=t.axis)||void 0===n||null===(r=n.title)||void 0===r?void 0:r.fontFamily)&&void 0!==e?e:s.axis.title.fontFamily,fontSize:null!==(i=null===(o=d("axis"))||void 0===o||null===(a=o.axis)||void 0===a||null===(l=a.title)||void 0===l?void 0:l.fontSize)&&void 0!==i?i:s.axis.title.fontSize,color:null!==(u=null===(c=d("axis"))||void 0===c||null===(m=c.axis)||void 0===m||null===(f=m.title)||void 0===f||null===(p=f.color)||void 0===p?void 0:p.color)&&void 0!==u?u:s.axis.title.color}}},label:{getStyle:()=>{var e,t,n,r,i,o,a,l,u,c,m,f,p,h,g,y;return{fill:null!==(e=null===(t=d("axis"))||void 0===t||null===(n=t.axis)||void 0===n||null===(r=n.label)||void 0===r||null===(i=r.name)||void 0===i||null===(o=i.color)||void 0===o?void 0:o.color)&&void 0!==e?e:s.axis.label.name.color,fontSize:null!==(a=null===(l=d("axis"))||void 0===l||null===(u=l.axis)||void 0===u||null===(c=u.label)||void 0===c||null===(m=c.name)||void 0===m?void 0:m.fontSize)&&void 0!==a?a:s.axis.label.name.fontSize,fontFamily:null!==(f=null===(p=d("axis"))||void 0===p||null===(h=p.axis)||void 0===h||null===(g=h.label)||void 0===g||null===(y=g.name)||void 0===y?void 0:y.fontFamily)&&void 0!==f?f:s.axis.label.name.fontFamily}}}},legend:{title:{getStyle:()=>{var e,t,n,r,i,o,a,l,u,c,m,f,p;return{fontFamily:null!==(e=null===(t=d("legend"))||void 0===t||null===(n=t.legend)||void 0===n||null===(r=n.title)||void 0===r?void 0:r.fontFamily)&&void 0!==e?e:s.legend.title.fontFamily,fontSize:null!==(i=null===(o=d("legend"))||void 0===o||null===(a=o.legend)||void 0===a||null===(l=a.title)||void 0===l?void 0:l.fontSize)&&void 0!==i?i:s.legend.title.fontSize,color:null!==(u=null===(c=d("legend"))||void 0===c||null===(m=c.legend)||void 0===m||null===(f=m.title)||void 0===f||null===(p=f.color)||void 0===p?void 0:p.color)&&void 0!==u?u:s.legend.title.color}}},label:{getStyle:()=>{var e,t,n,r,i,o,a,l,u,c,m,f,p;return{fontFamily:null!==(e=null===(t=d("legend"))||void 0===t||null===(n=t.legend)||void 0===n||null===(r=n.label)||void 0===r?void 0:r.fontFamily)&&void 0!==e?e:s.legend.label.fontFamily,fontSize:null!==(i=null===(o=d("legend"))||void 0===o||null===(a=o.legend)||void 0===a||null===(l=a.label)||void 0===l?void 0:l.fontSize)&&void 0!==i?i:s.legend.label.fontSize,color:null!==(u=null===(c=d("legend"))||void 0===c||null===(m=c.legend)||void 0===m||null===(f=m.label)||void 0===f||null===(p=f.color)||void 0===p?void 0:p.color)&&void 0!==u?u:s.legend.label.color}}}}}}}function ZO({dataset:e,data:t,valueData:n}){var r;const{source:i,label:o,value:a}=n,s=e(i.key).field(i.field);return oe.shouldUseFormat(s.raw())?"-"===o||""===a||Number.isNaN(a)||"NaN"===a||null!==(r=t.null)&&void 0!==r&&r.value?"-":s.formatter()(a):o}function QO({chart:e,actions:t,translator:n,rtl:r,dockService:i,seriesModel:o,colorService:a,themeService:s,propertiesModel:l,custom:u}){const c=s.getStyles(),d=({data:e})=>e.major.value,m=({data:e})=>!e.null.value||0===e.end.value,{SLICED_HAT:f}=ul.COMPONENT,{PRIMARY:p,SECONDARY:h}=cl.AXIS,g=function({dockService:e,seriesModel:t}){const{AXIS:n,BAR_OOB:r,DATA_OOB_MARKER:i,SLICED_HAT:o}=ul.COMPONENT,{PRIMARY:a,SECONDARY:s}=cl.AXIS,{orientation:l}=e.meta.chart,u="vertical"===l,c=[...t.meta.barComponentKeys,...t.meta.markerComponentKeys,...t.meta.pointComponentKeys];return[({chart:e,hovered:t,meta:l})=>{const[d]=t,{triggerer:m}=l,f=m===n.MAJOR?d.data.value:d.data.major.value;if(u){const t=e.findShapes("container").find((e=>(e.key===`${o}-max-${a}`||e.key===`${o}-max-${s}`)&&e.data&&e.data.value===f&&e.children.length));if(t)return{key:t.key,bounds:t.bounds}}const p=e.findShapes("path").find((e=>(e.key===`${r}-max-${a}`||e.key===`${r}-max-${s}`||e.key===`${i}-max`)&&e.data.major.value===f));if(u&&p)return{key:p.key,bounds:p.bounds};const h=e.findShapes("path").find((e=>(e.key===`${r}-min-${a}`||e.key===`${r}-min-${s}`||e.key===`${i}-min`)&&e.data.major.value===f)),g=e.findShapes("*").filter((e=>c.indexOf(e.key)>-1&&e.data&&e.data.major.value===f));if(u&&h&&!g.find((e=>e.data.end.source.field!==h.data.end.source.field)))return{key:h.key,bounds:h.bounds};const y=p||h;return!(u||!y||g.find((e=>e.data.end.source.field!==y.data.end.source.field)))&&{key:y.key,bounds:y.bounds}},"collectible"]}({dockService:i,seriesModel:o});return Jg({chart:e,translator:n,config:{rtl:r,enable:()=>t.tooltip.enabled(),getColorSettings:()=>a.getSettings(),style:{fontFamily:c.fontFamily},main:{key:ul.COMPONENT.TOOLTIP,getGroupByValue:d,collectibles:[...o.meta.barComponentKeys.map((e=>({key:e,type:"bar",major:d}))),...o.meta.pointComponentKeys.map((e=>({key:e,type:"point",major:d}))),...o.meta.markers.map((e=>({key:e.key,type:e.type,major:d})))],triggers:[{keys:[ul.COMPONENT.AXIS.MAJOR],collect:{from:"dimension",by:({data:e})=>e.value,filter:m},placement:g},{keys:[...o.meta.barComponentKeys,...o.meta.markerComponentKeys,`${f}-max-${p}`,`${f}-max-${h}`,`${f}-min-${p}`,`${f}-min-${h}`,`${ul.COMPONENT.BAR_OOB}-max-${p}`,`${ul.COMPONENT.BAR_OOB}-max-${h}`,`${ul.COMPONENT.BAR_OOB}-min-${p}`,`${ul.COMPONENT.BAR_OOB}-min-${h}`,`${ul.COMPONENT.DATA_OOB_MARKER}-max`,`${ul.COMPONENT.DATA_OOB_MARKER}-min`],collect:{from:"dimension",by:d,filter:m},placement:g},{keys:[...o.meta.pointComponentKeys],distance:3,collect:{from:"dimension",by:d,filter:m},placement:g}],section:({h:e,nodes:t,dataset:n,create:r,util:i})=>{const[o]=t,{title:a,description:s,measures:l}=u.isEnabled()?u.getAttributes({dataset:n,nodes:[o]}):{},c=[];a&&c.push(r.text({value:a,style:{bold:!0}})),s&&c.push(r.text({value:s}));const d=u.hideBasic();d&&!l.length&&(a||s)||c.push(r.text({value:o.data.label,style:{bold:!0}})),d||(c.push(r.color({nodes:t,property:ul.SCALE.COLOR})),c.push(...t.map((e=>{const{segment:t,end:o}=e.data,a=t||o,{key:s,field:l}=a.source;return r.measure({label:i.dataset.title(s,l),value:ZO({dataset:n,data:e.data,valueData:a})})})))),l&&c.push(...l.map((e=>r.measure({label:e.label,value:e.value,survive:{color:!0,duplicate:!0}})))),u.chart.isEnabled()&&(u.chart.hasLimitation()?(u.chart.destroy(),c.push(r.raw({value:u.chart.createLimitationRow()}))):c.push(r.raw({value:u.chart.createContainer({h:e})})));const{customTooltipImages:m}=o.data;return u.isEnabled()&&m&&c.push(...m.map((t=>r.raw({value:u.createImageRow({value:t,h:e})})))),c},layout:{grouping:!0,single:()=>!(!u.isEnabled()||!u.hasImages())||u.chart.isEnabled()},events:{tooltip:{beforeShow:({collectNodes:e})=>u.isEnabled()&&u.hasImages()?u.addImages({nodes:e()}):Promise.resolve(),afterShow:({nodes:e})=>{u.chart.isEnabled()&&!u.chart.hasLimitation()&&u.chart.show({nodes:e,properties:l.query.getProperties()})}},interaction:{mouseleave:()=>{u.chart.isEnabled()&&u.chart.hasAlternateState()&&u.chart.hide()}}}},legend:{keys:{tooltip:ul.COMPONENT.LEGEND_TOOLTIP,component:ul.COMPONENT.LEGEND_CATEGORICAL}}}})}const{model:eD}=tM,tD=({picasso:e,chart:d,environment:m,flags:f,viewState:p,viewCache:h,actions:g,selectionService:y})=>{const v=o(),{width:b,height:x}=r(),[M,S]=t(),[E,C]=t(),q=a(),w=s(),A=l(),O=u(),D=c();n((()=>{if(!(v&&null!=d&&d.update&&m&&p))return;const t=function(e){var t=e.source,n=e.metaAdditionsFn,r=e.experimental,i=void 0===r?{filter:!1}:r,o=tm(!0,{},t),a=i.filter?function(e){var t=e.qHyperCube,n=Kf(t,Xf.DIMENSION),r=n.reduced,i=n.filtered;t[Xf.DIMENSION]=r;var o=Kf(t,Xf.MEASURE),a=o.reduced,s=o.filtered;return t[Xf.MEASURE]=a,{dimensions:i,measures:s}}(o):{dimensions:[],measures:[]},s=Zf(o),l=function(){var e=function(e){var t=e.layout,n=e.additionsFn,r=void 0===n?function(){return{}}:n,i=e.additionsProps,o=void 0===i?{}:i,a=t.qHyperCube,s=a.qDimensionInfo,l=a.qMeasureInfo,u=a.qMode,c=s.length,d=l.length,m=Pd({mode:{S:"S"===u,P:"P"===u,K:"K"===u,T:"T"===u},dimensionCount:c,measureCount:d,hasMultipleDimensions:c>1,hasMultipleMeasures:d>1,isOneDimensional:1===c,isTwoDimensional:2===c},o);return Pd(Pd({},m),r({layout:t,meta:m}))}({layout:o,additionsFn:n,additionsProps:{size:s.size}});return e.filteredFields=a,e},u={refs:Pd({},s.refs),meta:l(),getLayout:function(){return o},getLayoutValue:function(e,t){return Bf(o,e,t)},setLayoutValue:function(e,t){Yf(o,e,t),s=Zf(o),u.meta=l()},getHyperCube:function(){return o.qHyperCube},getHyperCubeValue:function(e,t){return Bf(o.qHyperCube,e,t)},setHyperCubeValue:function(e,t){Yf(o.qHyperCube,e,t),s=Zf(o),u.meta=l()},getDataPages:function(){return Bf(o,s.refs.dataPages)},setDataPages:function(e){Yf(o,s.refs.dataPages,e),u.meta=l()}};return u}({source:v,metaAdditionsFn:function({layout:e}){var t,n,r;const i=Bf(e,"qHyperCube.qMeasureInfo",[]),o=i.some((({series:e=cl.NOPE_SERIES})=>lv(e)===cl.TYPE.LINE)),a=ue.continuous(e,(()=>o&&re.isTime(!0,e))),s=!Ow(Bf(e,"version","")),l=i.filter((({series:e=cl.NOPE_SERIES})=>lv(e)===cl.TYPE.BAR)),u=l.length,c=l.filter((({series:e=cl.NOPE_SERIES})=>e.axis!==cl.AXIS.SECONDARY)).length,d=l.filter((({series:e=cl.NOPE_SERIES})=>e.axis===cl.AXIS.SECONDARY)).length,m=s?c>1||d>1:u>1,f=("grouped"!==Bf(e,"barGrouping.grouping")||a)&&m,p=!f&&u>1,h=s&&f&&(c>0&&d>1||c>1&&d>0),g=!(null==e||null===(t=e.qHyperCube)||void 0===t||null===(n=t.qDimensionInfo)||void 0===n||null===(r=n[0])||void 0===r||!r.qLocked);return{canBeContinuous:re.canBeContinuous(e),isDiscrete:!a,isContinuous:a,isTime:re.isTime(a,e),isSnapshot:ue.snapshot(e),isBarSeriesStacked:f,isBarSeriesGrouped:p,isBarSeriesStackedInBothAxis:h,isGrouped:p||h,isGroupedByMeasure:p||h,isDimensionLocked:g,groupSize:h?2:u,hasLineSeries:o}}}),{options:n,translator:r}=m,{direction:i,viewState:o={}}=n,a="rtl"===i,{legendScrollOffset:s,scrollOffset:l}=t.meta.isSnapshot?t.getLayoutValue("snapshotData.content.chartData",{}):o;p.preventSet("scrollOffset",l),p.preventSet("legendScrollOffset",s),p.preventSet("title",t.getLayoutValue("title"));const u=function({genericObjectModel:e,layoutService:t}){const n={cube:void 0,on:!1},r=Tw({genericObjectModel:e,layoutService:t});return{query:{getCube:()=>n.cube,getIsReduced:()=>n.on},command:{initialize:()=>r().then((({reducedCube:e})=>{n.cube=e,n.on=!!(n.cube&&n.cube.qDataPages[0]&&n.cube.qDataPages[0].qIsReduced)})),setSnapshotData:e=>{e.reducedHyperCube=n.cube}}}}({genericObjectModel:q,layoutService:t}),c=Vf({chart:d,layoutService:t,config:{logicalSize:{width:b,height:x},rtl:a},typeConfig:{type:"major-minor",fallback:"vertical",invert:!0,measureAxes:[{ref:"measureAxes.0",name:"minor"},{ref:"measureAxes.1",name:"minorSecondary"}]}}),M=Dw({layoutService:t,flags:f}),E=t.meta.isDiscrete?function({chart:e,genericObjectModel:t,layoutService:n,dockService:r,seriesModel:i,viewState:o,rtl:a,actions:s,picasso:l}){return GO({chart:e,actions:s,componentKey:nM(i),enigmaModel:t,layoutService:n,dockService:r,viewState:o,rtl:a,itemWidths:XO,options:{axisKey:ul.COMPONENT.AXIS.MAJOR,renderer:l.renderer("svg")()}})}({chart:d,genericObjectModel:q,layoutService:t,dockService:c,seriesModel:M,viewState:p,rtl:"rtl"===m.options.direction,actions:g,picasso:e}):void 0,C=t.meta.isContinuous?eD({model:q,layoutService:t,viewState:p,viewCache:h}):void 0,N=function(e){var t=e.theme,n=e.config,r=void 0===n?{}:n,i=r.id,o=r.resolve,a=void 0===o?[]:o,s=r.transform,l=void 0===s?[]:s,u=r.extend,c=void 0===u?[]:u,d={theme:t,matrix:gg(a),styles:void 0};return d.styles=vg({theme:t,id:i,transform:l,extend:c,matrix:d.matrix}),{getStyles:function(){return d.styles},getTheme:function(){return d.theme},setTheme:function(e){d.theme=e,d.styles=vg({theme:e,id:i,transform:l,extend:c,matrix:d.matrix})}}}({theme:m.theme,config:{id:"comboChart",resolve:[["object","label.value","numFontSize","12px",e=>parseInt(e,10)]]}}),I=JO({layoutService:t,dockService:c,themeService:N,flags:f}),T=iA({actions:g,appLayoutModel:A,appModel:w,chart:d,environment:m,flags:f,genericObjectModel:q,layoutService:t,picasso:e,seriesModel:M,viewState:p,styleModel:I}),L=function({layoutService:e,seriesModel:t}){const{isContinuous:n}=e.meta,r="qDimensionInfo/0",i=`${r}:numeric`,o=t.meta.primarySeries.map((e=>e.ref)),a=t.meta.secondarySeries.map((e=>e.ref)),s=n?[{key:i,from:r,override:{value:e=>e.qNum}}]:void 0;return{main:{major:r,majorNumeric:i,minorsPrimary:o,minorsSecondary:a},virtuals:s}}({layoutService:t,seriesModel:M}),k=Pw({isPrimary:!0,layoutService:t,reducedModel:u,seriesModel:M,continuousModel:C,flags:f}),R=Pw({isPrimary:!1,layoutService:t,reducedModel:u,seriesModel:M,continuousModel:C,flags:f}),P=eA({config:{measureAxesRef:"measureAxes.0",formatter:ul.FORMATTER.PRIMARY},chart:d,layoutService:t,extremumModel:k,dockService:c,seriesModel:M,themeService:N}),$=eA({config:{measureAxesRef:"measureAxes.1",formatter:ul.FORMATTER.SECONDARY},chart:d,layoutService:t,extremumModel:R,dockService:c,seriesModel:M,themeService:N}),F=tA({genericObjectModel:q,layoutService:t}),z=ju({flags:f,layout:v,app:w,model:q,picasso:e,chart:d,translator:r,localeInfo:A.qLocaleInfo,embed:D,options:n}),_=QO({chart:d,actions:g,translator:r,rtl:a,dockService:c,seriesModel:M,colorService:T,themeService:N,propertiesModel:F,custom:z}),j=ll({layoutService:t,discreteModel:E}),H=function(e){return{layout:e.getLayout(),keys:{SCALE:{MAJOR:ul.SCALE.MAJOR,MAJOR_INNER:ul.SCALE.MAJOR_INNER,MINOR:{PRIMARY:ul.SCALE.MINOR.PRIMARY,SECONDARY:ul.SCALE.MINOR.SECONDARY}},COMPONENT:{BAR_PRIMARY:`${ul.COMPONENT.BAR}-${cl.AXIS.PRIMARY}`,BAR_SECONDARY:`${ul.COMPONENT.BAR}-${cl.AXIS.SECONDARY}`,AXIS:{MAJOR:ul.COMPONENT.AXIS.MAJOR,MAJOR_CONTINUOUS:ul.COMPONENT.AXIS.MAJOR_CONTINUOUS,TIME_INNER:ul.COMPONENT.AXIS.TIME_INNER,MINOR:{PRIMARY:ul.COMPONENT.AXIS.MINOR.PRIMARY,SECONDARY:ul.COMPONENT.AXIS.MINOR.SECONDARY}},AXIS_TITLE:{MAJOR:ul.COMPONENT.AXIS_TITLE.MAJOR,MINOR:{PRIMARY:ul.COMPONENT.AXIS_TITLE.MINOR.PRIMARY,SECONDARY:ul.COMPONENT.AXIS_TITLE.MINOR.SECONDARY}}},COLLECTION:{MAIN:ul.COLLECTION.MAIN}}}}(t),V=function(e){var t=e.picassoInstance,n=e.plugins,r=e.pluginArgs,i=void 0===r?{}:r,o={initialized:!1,definitions:[]};return{initialize:function(){return _d($d().mark((function e(){var r,a,s,l;return $d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!o.initialized){e.next=2;break}return e.abrupt("return");case 2:return a=Promise.all(n.filter((function(e){return"custom-component"===e.info.type})).map(function(){var e=_d($d().mark((function e(n){var r;return $d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.info.componentName){e.next=2;break}throw new Error("plugin-service: Custom component is missing componentName");case 2:return e.next=4,n.fn(Pd({},i));case 4:if("object"===Fd(r=e.sent)){e.next=7;break}throw new Error("plugin-service: Custom component needs to be an object");case 7:t.component(n.info.componentName,r);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())),s=Promise.all(n.filter((function(e){return"component-definition"===e.info.type})).map((function(e){return e.fn(Pd({},i))}))),e.next=6,Promise.all([a,s]);case 6:l=e.sent,o.initialized=!0,(r=o.definitions).push.apply(r,Bd(l[1]));case 9:case"end":return e.stop()}}),e)})))()},extendComponents:function(e){return o.initialized?(o.definitions.filter(Boolean).forEach((function(t){var n=Vd(e.filter((function(e){return e.key&&e.key===t.key})),1)[0];if(n){var r=tm(!0,{},n.brush);tm(!0,n,t),t.brush&&(n.brush=function(e,t){return"object"===Fd(e)&&Object.keys(e).length?(Array.isArray(t.consume)&&(e.consume=Qf({originalArray:e.consume,newArray:t.consume,matchKey:"context"})),Array.isArray(t.trigger)&&(e.trigger=Qf({originalArray:e.trigger,newArray:t.trigger,matchKey:"on"})),e):t}(r,t.brush))}else e.push(t)})),e):e}}}({picassoInstance:e,plugins:O,pluginArgs:H});S({selectionService:y,genericObjectModel:q,appModel:w,dockService:c,styleModel:I,layoutService:t,fieldModel:L,seriesModel:M,reducedModel:u,primaryExtremumModel:k,secondaryExtremumModel:R,primaryTickModel:P,secondaryTickModel:$,propertiesModel:F,colorService:T,themeService:N,appLayoutModel:A,tooltipService:_,flags:f,...E&&{discreteModel:E},...C&&{continuousModel:C},refLineModel:j,pluginService:V})}),[v,q,w,A,m,null==d?void 0:d.update,p]);const[,N]=i((()=>{if(!M)return Promise.resolve();const{layoutService:e,colorService:t,reducedModel:n,primaryExtremumModel:r,secondaryExtremumModel:i,propertiesModel:o,continuousModel:a,discreteModel:s,pluginService:l}=M,u=a?()=>{var t,n;a.update(e.getLayout());const r=a.initialFetch(),i=!e.meta.isSnapshot&&(null==m||null===(t=m.options)||void 0===t||null===(n=t.viewState)||void 0===n?void 0:n.zoom);return i&&p.preventSet("zoom",i),r}:()=>Promise.resolve(),c=t.initialize().then((()=>{const e=t.getSettings().field;y&&y.setBrushAliases({colorField:e}),t.custom.updateLegend()}));return Promise.all([l.initialize(),n.command.initialize(),q?o.command.initialize():Promise.resolve(),c,u(),g.scroll.attachDiscreteModel(s)]).then((()=>Promise.all([r.command.initialize(),i.command.initialize()]).then((()=>C(M)))))}),[M]);if(N)throw N;return E};function nD(){const[e,r]=t();return n((()=>{r(function(e){var t=Pd({},e),n={},r={},i=!1,o={get:function(e){return t[e]},set:function(e,o){var a=t[e];!i&&n[e]?t[e]=n[e](o,a):t[e]=o,!i&&r[e]&&r[e](t[e],a)},preventSet:function(e,t){i=!0,o.set(e,t),i=!1},intercept:function(e,t){n[e]=t},onChanged:function(e,t){r[e]=t}};return o}({viewRange:[0,1],scrollOffset:void 0}))}),[]),e}const rD={shapes:[{type:"path",attrs:{d:"M15.9488039,5.20769129 C16.0487326,6.70662306 15.3492311,8.30548361 14.050157,9.30477145 C12.651154,10.5039169 10.8524359,10.8037032 8.85386017,10.4039881 L7.3549284,10.0042729 L5.75606786,9.70448659 C5.75606786,9.90434416 5.65613907,10.0042729 5.4562815,10.2041305 C5.05656637,10.6038456 4.55692244,10.8037032 4.05727852,10.8037032 C3.75749217,10.8037032 3.45770582,10.7037744 3.15791946,10.6038456 C3.05799068,10.903632 3.15791946,11.2034184 3.45770582,11.7030623 C5.05656637,14.0014243 3.85742095,15.9000712 3.75749217,16 L2.2585604,15.3004985 C2.2585604,15.2005697 2.95806189,14.0014243 1.95877405,12.6024213 C1.6589877,12.0028486 1.15934378,11.0035608 1.55905891,10.0042729 C1.6589877,9.80441537 1.75891648,9.6045578 1.95877405,9.40470024 C1.6589877,8.90505631 1.55905891,8.30548361 1.85884527,7.7059109 C1.55905891,7.40612455 1.25927256,7.1063382 1.15934378,6.70662306 C0.859557424,5.90719279 0.959486209,4.5081898 1.6589877,3.30904439 C1.95877405,2.6095429 2.55834676,2.0099702 3.15791946,1.51032628 C3.95734974,0.91075357 4.95663758,0.610967217 6.15578299,0.311180864 C9.05371774,-0.388320626 11.9516525,0.111323295 13.9502282,1.61025506 C15.1493736,2.50961412 15.8488751,3.80868831 15.9488039,5.20769129 Z M13.0508691,8.10562604 C13.8502994,7.40612455 14.3499433,6.40683671 14.3499433,5.30762008 C14.2500145,4.20840345 13.550513,3.40897318 12.9509403,2.90932926 C12.1515101,2.40968533 11.252151,2.0099702 10.1529344,1.81011263 C8.95378895,1.61025506 7.75464354,1.71018384 6.45556935,1.91004141 C4.75678001,2.30975655 3.65756338,3.00925804 3.05799068,4.10847467 C2.55834676,5.00783373 2.65827554,5.90719279 2.75820433,6.20697914 C2.75820433,6.30690792 2.85813311,6.40683671 3.05799068,6.40683671 C3.15791946,6.40683671 3.25784825,6.40683671 3.35777703,6.40683671 C3.45770582,6.40683671 3.45770582,6.40683671 3.45770582,6.40683671 L3.5576346,6.40683671 L3.65756338,6.40683671 C4.65685123,6.40683671 5.4562815,6.90648063 5.85599664,7.80583969 L5.85599664,8.00569726 C6.35564056,8.10562604 7.05514205,8.30548361 7.75464354,8.50534118 L9.25357531,8.90505631 C10.0530056,9.0049851 10.7525071,9.0049851 11.4520086,8.80512753 C12.0515813,8.70519875 12.5512252,8.40541239 13.0508691,8.10562604 Z"}}]};const iD={query:{getCanScroll:()=>!0}};function oD(){const e=h(),[r,i]=t(!1),[o,a]=t(!1),[s,l]=t(!1),u=function(){const e=h(),[r,i]=t(!1),[o,a]=t({}),[s,l]=t();return n((()=>()=>{a({})}),[]),n((()=>{e&&i(!e.select&&!e.active)}),[e]),{enabled:()=>r,emit:(e,...t)=>o[e].forEach((e=>e(...t))),removeListener:(e,t)=>{var n;const r=null===(n=o[e])||void 0===n?void 0:n.indexOf(t);r>-1&&o[e].splice(r,1)},on:(e,t)=>{Array.isArray(o[e])?o[e].push(t):o[e]=[t]},get brushSelectionIncludeMax(){return s},set brushSelectionIncludeMax(e){l(e)},getBrushOptions:void 0}}(),c=function(){var e,r,i;const o=h(),[a,s]=t(!1),[l,u]=t(!1),c=g(),d=m(),f=!!c.qSelectionInfo.qInSelections,p=!(null===(e=c.qHyperCube)||void 0===e||null===(r=e.qDimensionInfo)||void 0===r||null===(i=r[0])||void 0===i||!i.qIsOneAndOnlyOne);n((()=>{o&&s(!o.select&&!o.active)}),[o]);const v=e=>{u("boolean"==typeof e?e:!l)};return y((()=>({key:"lasso",label:d.get(l?"Tooltip.ToggleOffLassoSelection":"Tooltip.ToggleOnLassoSelection"),icon:rD,hidden:!a||!f||p,active:l,action:v})),[f,p,l,a,d.language()]),{action:v,enabled:()=>a,active:()=>l}}();let d=iD;n((()=>{e&&(i(!e.active),a(!e.active),l(!e.passive))}),[e]);const[f]=t({});return f.scroll={enabled:()=>r&&d.query.getCanScroll(),attachDiscreteModel:e=>{d=e||iD}},f.interact={enabled:()=>o},f.tooltip={enabled:()=>s},f.lasso=c,f.select=u,f}function aD({clearMinor:e,clearDiscrete:t,clearLegend:n}){e(),e({componentName:"minor-secondary-range-brush",eventName:"minorRange-secondary"}),t({brushName:!1}),n()}function sD({setSelectionInfo:e,event:t,components:n,clear:r}){const i=null!=n&&n.length?n.map((e=>e.key)).filter(Boolean):[];e({event:t,components:i,minorRangePrimary:"minorRange"===t,minorRange:["minorRange","minorRange-secondary"].includes(t),legendRange:"legendRange"===t,legendTap:"tap"===t&&i[0]===ul.COMPONENT.LEGEND_CATEGORICAL}),r()}var lD={exports:{}};window,lD.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/conversion/",n(n.s=2)}([function(e,t,n){var r=Object.prototype.hasOwnProperty,i=Object.prototype.toString,o=Object.defineProperty,a=Object.getOwnPropertyDescriptor,s=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===i.call(e)},l=function(e){if(!e||"[object Object]"!==i.call(e))return!1;var t,n=r.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&r.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!o)return!1;for(t in e);return void 0===t||r.call(e,t)},u=function(e,t){o&&"__proto__"===t.name?o(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(!r.call(e,t))return;if(a)return a(e,t).value}return e[t]};e.exports=function e(){var t,n,r,i,o,a,d=arguments[0],m=1,f=arguments.length,p=!1;for("boolean"==typeof d&&(p=d,d=arguments[1]||{},m=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});m<f;++m)if(null!=(t=arguments[m]))for(n in t)r=c(d,n),d!==(i=c(t,n))&&(p&&i&&(l(i)||(o=s(i)))?(o?(o=!1,a=r&&s(r)?r:[]):a=r&&l(r)?r:{},u(d,{name:n,newValue:e(p,a,i)})):void 0!==i&&u(d,{name:n,newValue:i}));return d}},function(e,t,n){e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/qlik-modifiers/",n(n.s=1)}([function(e,t,n){var r=Object.prototype.hasOwnProperty,i=Object.prototype.toString,o=Object.defineProperty,a=Object.getOwnPropertyDescriptor,s=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===i.call(e)},l=function(e){if(!e||"[object Object]"!==i.call(e))return!1;var t,n=r.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&r.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!o)return!1;for(t in e);return void 0===t||r.call(e,t)},u=function(e,t){o&&"__proto__"===t.name?o(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(!r.call(e,t))return;if(a)return a(e,t).value}return e[t]};e.exports=function e(){var t,n,r,i,o,a,d=arguments[0],m=1,f=arguments.length,p=!1;for("boolean"==typeof d&&(p=d,d=arguments[1]||{},m=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});m<f;++m)if(null!=(t=arguments[m]))for(n in t)r=c(d,n),d!==(i=c(t,n))&&(p&&i&&(l(i)||(o=s(i)))?(o?(o=!1,a=r&&s(r)?r:[]):a=r&&l(r)?r:{},u(d,{name:n,newValue:e(p,a,i)})):void 0!==i&&u(d,{name:n,newValue:i}));return d}},function(e,t,n){n.r(t);var r=n(0),i=n.n(r),o=function(e,t,n){if(!t)return!1;var r,i=t.split("."),o=i[i.length-1],a=e;for(r=0;r<i.length-1;++r)void 0===a[i[r]]&&(a[i[r]]=Number.isNaN(+i[r+1])?{}:[]),a=a[i[r]];if(void 0!==n){var s=a[o];return a[o]=n,{updated:n,previous:s}}return delete a[o],!1},a=function(e,t,n){var r,i=t.split("."),o=e;if(void 0===o)return n;for(r=0;r<i.length;++r){if(void 0===o[i[r]])return n;o=o[i[r]]}return o},s="".concat(" ","(").concat(" "),l="".concat(" ",")").concat(" ");function u(e){return s+e+l}function c(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e.qLibraryId){var n=function(e,t){if(!t)return null;var n,r;for(n=0;n<t.length;n++)if((r=t[n]).qInfo.qId===e)return r;return null}(e.qLibraryId,t.dimensionList);return n&&n.qData.info[0].qTags.indexOf("$numeric")>-1}var r=function(e,t){if(!t)return null;var n,r,i=function(e){var t=e.trim();"="===t.charAt(0)&&(t=(t=t.substring(1)).trim());var n=t.length-1;return"["===t.charAt(0)&&"]"===t.charAt(n)&&(t=(t=t.substring(1,n)).trim()),t}(e);for(n=0;n<t.length;n++){if((r=t[n]).qName===i)return r;if(r.qDerivedFieldData)for(var o=0;o<r.qDerivedFieldData.qDerivedFieldLists.length;++o)for(var a=r.qDerivedFieldData.qDerivedFieldLists[o],s=0;s<a.qFieldDefs.length;++s){var l=a.qFieldDefs[s];if(l.qName===i)return l}}return null}(e.qDef.qFieldDefs[0],t.fieldList);return r&&r.qTags.indexOf("$numeric")>-1}function d(e){return!(!e.fullAccumulation&&!e.fullRange)}function m(e,t){var n=e.crossAllDimensions;return 2===t&&n?"RowNo(Total)":"RowNo()"}function f(e){var t=function(e){return e?(e=function(e){return e.replace(/\/\*[^]*?\*\//g,"")}(e=function(e){return e.replace(/\/\/(.*)$/gm,"")}(e))).trim():""}(e).trim();return"="===t.substring(0,1)?t.substring(1).trim():t}function p(){return"[$(=Replace(GetObjectField(".concat(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,"),']',']]'))]")}function h(e,t){var n=e.crossAllDimensions;return 2===t&&n?"Above(Total ":"Above("}function g(e){return void 0===e?")":", 0, ".concat(e,")")}function y(e,t){return e?"".concat(t,'={">=$(=Min(').concat(t,"))<=$(=Max(").concat(t,'))"}'):"".concat(t,'={"=Only({1}').concat(t,")>='$(=MinString(").concat(t,"))' and Only({1}").concat(t,")<='$(=MaxString(").concat(t,"))'\"}")}function v(e){var t=e.modifier,n=void 0===t?{}:t,r=e.dimensions,i=e.dimensionAndFieldList,o=e.funcComp,a=void 0===o?"Sum":o,s=e.valueComp,l=void 0===s?"0":s;if(!n.showExcludedValues)return"";if(r&&1===r.length){var u=y(c(r[0],i),p(0));return"".concat(a,"({1<").concat(u,">}").concat(l,")")}if(r&&2===r.length){var d=c(r[0],i),m=c(r[1],i),f=p(0),h=p(1),g=y(d,f),v=y(m,h);return"".concat(a,"({1<").concat(g,",").concat(v,">}").concat(l,")")}return"".concat(a,"({1}").concat(l,")")}function b(e){return"".concat(e,"(")}function x(e){var t=e.properties,n=e.layout;return a(t,"qHyperCubeDef.qDimensions",a(n,"qHyperCube.qDimensionInfo",[])).length}var M={isFullRange:d,getNumDimensions:x,getExpressionWithExcludedComp:function(e){var t=e.expression,n=e.modifier,r=e.dimensions,i=e.dimensionAndFieldList,o=e.treatMissingAsNull,a=u(f(t));if(!n.showExcludedValues)return a;var s=v({modifier:n,dimensions:r,dimensionAndFieldList:i}),l=o?"":", 0";if(r&&1===r.length){var c=p(0);return"If(Count(".concat(c,") > 0, ").concat(a," + ").concat(s).concat(l,")")}if(r&&2===r.length){var d=p(0),m=p(1);return"If(Count(".concat(d,") * Count(").concat(m,") > 0, ").concat(a," + ").concat(s).concat(l,")")}return a},getRowNoComp:m,getNumStepComp:function(e,t){if(!d(e)){var n=e.steps;return"number"!=typeof n||Number.isNaN(n)?6:n}return m(e,t)},getAboveCompPrefix:h,getAboveCompSuffix:g,getAboveComp:function(e,t,n,r){return h(e,t)+n+g(r)},getFunctionPrefix:b,getFunctionSuffix:function(){return")"},getRangeComp:function(e,t){return b(e)+t+")"},getAggrComp:function(e,t,n){return"Aggr(".concat(e,", ").concat(t,", ").concat(n,")")},getExcludedComp:v,needDimension:function(e){var t=e.modifier,n=e.properties,r=e.layout;return 0===function(e){return void 0===e.primaryDimension?e.accumulationDimension:e.primaryDimension}(t)&&2===x({properties:n,layout:r})},getDimComp:function(e,t){var n=function(e){return e[arguments.length>1&&void 0!==arguments[1]?arguments[1]:0].qDef.qSortCriterias[0]}(e,t),r=p(t);if(!n.qSortByExpression&&!n.qSortByNumeric&&!n.qSortByAscii)return r;var i=["Descending","Ascending"],o=n.qSortByNumeric?"(Numeric, ".concat(i[(n.qSortByNumeric+1)/2],")"):"",a=n.qSortByAscii?"(Text, ".concat(i[(n.qSortByAscii+1)/2],")"):"";return n.qSortByNumeric&&n.qSortByAscii?"(".concat(r,", ").concat(o,", ").concat(a,")"):n.qSortByNumeric?"(".concat(r,", ").concat(o,")"):n.qSortByAscii?"(".concat(r,", ").concat(a,")"):r},simplifyExpression:f,extractInputExpression:function(e){var t=e.outputExpression;if(e.modifier){var n=t.indexOf(s);if(-1!==n){var r=t.indexOf(l);if(-1!==r)return t.substring(n+s.length,r)}}},initModifier:function(e,t){Object.keys(t).forEach((function(n){void 0===e[n]&&(e[n]=t[n])}))},isNumeric:c,isApplicable:function(e){var t=e.properties,n=e.layout,r=e.minDimensions,i=void 0===r?1:r,o=e.maxDimensions,a=void 0===o?2:o;if(!t&&!n)return!0;var s=x({properties:t,layout:n});return s>=i&&s<=a},getExpressionWithMarkers:u,canExtract:function(e){var t=e.indexOf(s),n=e.indexOf(l);return t>-1&&n>-1&&t<n},getDimDefWithWrapper:p,getFieldWithWrapper:function(e){var t=e?e.replace(/]/g,"]]"):e;return"[".concat(t,"]")}};function S(e){return(S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var E=i.a.bind(null,!0),C={},q=Array.isArray;function w(e){return null!=e&&!Array.isArray(e)&&"object"===S(e)}function A(e){return void 0===e}function O(e,t){return"function"==typeof e[t]||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function D(e,t){var n,r=t.substring(1).split("/").slice(0,-1);return r.forEach((function(t,i){if(i!==r.length){n=+t;var o=Number.isNaN(n)?{}:[];e[n||t]=A(e[n||t])?o:e[t],e=e[n||t]}})),e}function N(e,t){var n=!0;if(w(e)&&w(t))return Object.keys(e).length===Object.keys(t).length&&(Object.keys(e).forEach((function(r){N(e[r],t[r])||(n=!1)})),n);if(q(e)&&q(t)){if(e.length!==t.length)return!1;for(var r=0,i=e.length;r<i;r+=1)if(!N(e[r],t[r]))return!1;return!0}return e===t}C.generate=function(e,t,n){n=n||"";var r=[];return Object.keys(t).forEach((function(i){var o=function(e){return e?E({},{val:e}).val:e}(t[i]),a=e[i],s="".concat(n,"/").concat(i);N(o,a)||O(t,i)||(A(a)?r.push({op:"add",path:s,value:o}):w(o)&&w(a)?r=r.concat(C.generate(a,o,s)):q(o)&&q(a)?r=r.concat(function(e,t,n){var r=[],i=e.slice(),o=-1;function a(e,t,n){if(e[n]&&A(e[n].qInfo))return null;if(e[n]&&e[n].qInfo.qId===t)return n;for(var r=0,i=e.length;r<i;r+=1)if(e[r]&&e[r].qInfo.qId===t)return r;return-1}if(N(t,i))return r;if(!A(t[0])&&A(t[0].qInfo))return r.push({op:"replace",path:n,value:t}),r;for(var s=i.length-1;s>=0;s-=1)-1===(o=a(t,i[s].qInfo&&i[s].qInfo.qId,s))?(r.push({op:"remove",path:"".concat(n,"/").concat(s)}),i.splice(s,1)):r=r.concat(C.generate(i[s],t[o],"".concat(n,"/").concat(s)));for(var l=0,u=t.length;l<u;l+=1)-1===(o=a(i,t[l].qInfo&&t[l].qInfo.qId))?(r.push({op:"add",path:"".concat(n,"/").concat(l),value:t[l]}),i.splice(l,0,t[l])):o!==l&&(r.push({op:"move",path:"".concat(n,"/").concat(l),from:"".concat(n,"/").concat(o)}),i.splice(l,0,i.splice(o,1)[0]));return r}(a,o,s)):r.push({op:"replace",path:"".concat(n,"/").concat(i),value:o}))})),Object.keys(e).forEach((function(i){A(t[i])&&!O(e,i)&&r.push({op:"remove",path:"".concat(n,"/").concat(i)})})),r},C.apply=function(e,t){t.forEach((function(t){var n,r=D(e,t.path),i=t.path.split("/").splice(-1)[0],o=i&&Number.isNaN(+i)?r[i]:r[+i]||r,a=t.from?t.from.split("/").splice(-1)[0]:null;if("/"===t.path&&(r=null,o=e),"add"===t.op||"replace"===t.op)if(q(r))"-"===i&&(i=r.length),r.splice(+i,"add"===t.op?0:1,t.value);else if(q(o)&&q(t.value)){var s,l=t.value.slice();o.length=0,(s=o).push.apply(s,function(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}(l))}else if(w(o)&&w(t.value))n=o,Object.keys(n).forEach((function(e){Object.getOwnPropertyDescriptor(n,e).configurable&&!O(n,e)&&delete n[e]})),E(o,t.value);else{if(!r)throw new Error("Patchee is not an object we can patch");r[i]=t.value}else if("move"===t.op){var u=D(e,t.from);q(r)?r.splice(+i,0,u.splice(+a,1)[0]):(r[i]=u[a],delete u[a])}else"remove"===t.op&&(q(r)?r.splice(+i,1):delete r[i])}))},C.clone=function(e){return E({},e)},C.createPatch=function(e,t,n){var r={op:e.toLowerCase(),path:n};return"move"===r.op?r.from=t:void 0!==t&&(r.value=t),r},C.updateObject=function(e,t){Object.keys(e).length?C.apply(e,C.generate(e,t)):E(e,t)};var I=C,T=function(e,t,n){if(!e)return Promise.resolve();var r=I.generate(t,n);return i()(!0,t,n),r&&r.length?(r=r.map((function(e){return{qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path}})),e.applyPatches(r,!0)):Promise.resolve()},L="accumulation";function k(e,t){var n=a(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===L)return n[r]}function R(e,t){var n=function(e,t){var n=a(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===L)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var P={type:"accumulation",disabled:!1,accumulationDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullAccumulation:!1,steps:6,outputExpression:""},$={translationKey:"properties.modifier.accumulation",needDimension:M.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return M.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,o=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=o;void 0===l&&(l=M.getNumDimensions({properties:r,layout:i}));var u=a(r,"qHyperCubeDef.qDimensions",[]),c=M.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:u,dimensionAndFieldList:s}),d=M.getNumStepComp(n,l),m=M.getAboveComp(n,l,c,d),f=M.getRangeComp("RangeSum",m);if(M.needDimension({modifier:n,properties:r,layout:i})){var p=M.getDimComp(u,1),h=M.getDimComp(u,0),g=M.getAggrComp(f,p,h);f=n.showExcludedValues?M.getExcludedComp({modifier:n,dimensions:u,dimensionAndFieldList:s,valueComp:g}):g}return f},extractInputExpression:M.extractInputExpression,initModifier:function(e){M.initModifier(e,P)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.accumulation.disclaimer",show:function(e,t){return!M.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(R(t,e),".accumulationDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.accumulation.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(R(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.accumulation.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},fullRange:{refFn:function(t){return"".concat(R(t,e),".fullAccumulation")},type:"boolean",translation:t.range||"properties.modifier.range",component:"dropdown",schemaIgnore:!0,defaultValue:!1,options:[{value:!0,translation:t.rangeFull||"properties.modifier.range.full"},{value:!1,translation:t.rangeCustom||"properties.modifier.range.custom"}]},steps:{refFn:function(t){return"".concat(R(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=k(t,e);if(n){var r=n.steps;n.steps="number"!=typeof r||Number.isNaN(r)?6:Math.abs(r)}},show:function(t){var n=k(t,e);return n&&!n.fullAccumulation}},showExcludedValues:{refFn:function(t){return"".concat(R(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return M.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(L))return!1;var o=k(t,e);return o&&!o.disabled}};return n}},F="movingAverage";function z(e,t){var n=a(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===F)return n[r]}function _(e,t){var n=function(e,t){var n=a(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===F)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var j={type:"movingAverage",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullRange:!1,steps:6,outputExpression:"",nullSuppression:!1},H={translationKey:"properties.modifier.movingAverage",needDimension:M.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return M.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t,n=e.expression,r=e.modifier,i=e.properties,o=e.layout,s=e.numDimensions,l=e.dimensionAndFieldList;if(!r)return n;var u=s;void 0===u&&(u=M.getNumDimensions({properties:i,layout:o}));var c=a(i,"qHyperCubeDef.qDimensions",[]),d=r.showExcludedValues&&r.nullSuppression,m=M.getExpressionWithExcludedComp({expression:n,modifier:r,dimensions:c,dimensionAndFieldList:l,treatMissingAsNull:d}),f=M.getNumStepComp(r,u),p=M.getAboveComp(r,u,m,f);if(r.nullSuppression)t=M.getRangeComp("RangeAvg",p);else{var h=M.getRangeComp("RangeSum",p),g=function(e,t){var n=M.getRowNoComp(e,t);if(!M.isFullRange(e)){var r=e.steps,i="number"!=typeof r||Number.isNaN(r)?6:r;return"RangeMin(".concat(i,", ").concat(n,")")}return n}(r,u);t="".concat(h," / ").concat(g)}var y=t;if(M.needDimension({modifier:r,properties:i,layout:o})){var v=M.getDimComp(c,1),b=M.getDimComp(c,0),x=M.getAggrComp(y,v,b);y=r.showExcludedValues?M.getExcludedComp({modifier:r,dimensions:c,dimensionAndFieldList:l,funcComp:"Only",valueComp:x}):x}return y},extractInputExpression:M.extractInputExpression,initModifier:function(e){M.initModifier(e,j)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.movingAverage.disclaimer",show:function(e,t){return!M.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(_(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.movingAverage.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(_(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.movingAverage.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},fullRange:{refFn:function(t){return"".concat(_(t,e),".fullRange")},type:"boolean",translation:t.range||"properties.modifier.range",component:"dropdown",schemaIgnore:!0,defaultValue:!1,options:[{value:!0,translation:t.rangeFull||"properties.modifier.range.full"},{value:!1,translation:t.rangeCustom||"properties.modifier.range.custom"}]},steps:{refFn:function(t){return"".concat(_(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=z(t,e);if(n){var r=n.steps;n.steps="number"!=typeof r||Number.isNaN(r)?6:Math.abs(r)}},show:function(t){var n=z(t,e);return n&&!n.fullRange}},showExcludedValues:{refFn:function(t){return"".concat(_(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0},nullSuppression:{refFn:function(t){return"".concat(_(t,e),".nullSuppression")},type:"boolean",translation:t.showNull||"properties.dimensions.showNull",schemaIgnore:!0,defaultValue:!1,inverted:!0}},show:function(e,t){return M.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(F))return!1;var o=z(t,e);return o&&!o.disabled}};return n}},V="difference";function B(e,t){var n=a(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===V)return n[r]}function U(e,t){var n=function(e,t){var n=a(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===V)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var Y={type:"difference",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,outputExpression:""},W={translationKey:"properties.modifier.difference",needDimension:M.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return M.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:M.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,o=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=o;void 0===l&&(l=M.getNumDimensions({properties:r,layout:i}));var u=a(r,"qHyperCubeDef.qDimensions",[]),c=M.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:u,dimensionAndFieldList:s}),d=M.getAboveComp(n,l,c),m="".concat(c," - ").concat(d);if(M.needDimension({modifier:n,properties:r,layout:i})){var f=M.getDimComp(u,1),p=M.getDimComp(u,0),h=M.getAggrComp(m,f,p);m=n.showExcludedValues?M.getExcludedComp({modifier:n,dimensions:u,dimensionAndFieldList:s,funcComp:"Only",valueComp:h}):h}return m},initModifier:function(e){Object.keys(Y).forEach((function(t){void 0===e[t]&&(e[t]=Y[t])}))},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.difference.disclaimer",show:function(e,t){return!M.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(U(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.difference.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(U(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.difference.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},showExcludedValues:{refFn:function(t){return"".concat(U(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return M.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(V))return!1;var o=B(t,e);return o&&!o.disabled}};return n}},G={CURRENT_SELECTION:0,SELECT_FIELD_VALUE:1,DISREGARD_SELECTION:2},X={ONE_DIMENSION:0,ALL_DIMENSIOANS:1,DISREGARD_ALL_DIMENSIONS:2},K="normalization";function J(e,t){var n=a(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===K)return n[r]}function Z(e,t){var n=function(e,t){var n=a(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===K)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}function Q(e,t){for(var n=0;n<e.length;n++)if(e[n].value===t)return n;return-1}function ee(e,t,n,r){var i=t.layout.qHyperCube.qDimensionInfo.length,o=[{value:X.ONE_DIMENSION,translation:n.dimensionalScopeOneDimension||"properties.modifier.dimensionalScope.respectOneDimension",tooltipTranslation:n.dimensionalScopeOneDimensionTooltip||"properties.modifier.dimensionalScope.respectOneDimension.tooltip"},{value:X.ALL_DIMENSIOANS,translation:n.dimensionalScopeAllDimensions||"properties.modifier.dimensionalScope.".concat(2===i?"respectAllDimensions":"respectDimension"),tooltipTranslation:n.dimensionalScopeAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===i?"respectAllDimensions":"respectDimension",".tooltip")},{value:X.DISREGARD_ALL_DIMENSIONS,translation:n.dimensionalScopeDisregardAllDimensions||"properties.modifier.dimensionalScope.".concat(2===i?"disregardAllDimensions":"disregardDimension"),tooltipTranslation:n.dimensionalScopeDisregardAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===i?"disregardAllDimensions":"disregardDimension",".tooltip")}];return o=function(e,t,n){if(e<2){var r=Q(t,0);t.splice(r,1)}return t}(i,o),function(e,t,n){if(0===e){var r=Q(t,1);t.splice(r,1)}return t}(J(e,r).selectionScope,o)}function te(e,t,n){var r=[{value:G.CURRENT_SELECTION,translation:t.selectionScopeCurrentSelection||"properties.modifier.selectionScope.currentSelection"},{value:G.SELECT_FIELD_VALUE,translation:t.selectionScopeSpecificValue||"properties.modifier.selectionScope.selectAField"},{value:G.DISREGARD_SELECTION,translation:t.selectionScopeTotal||"properties.modifier.selectionScope.total"}];return function(e,t,n){if(1===e){var r=Q(t,0);t.splice(r,1)}return t}(J(e,n).dimensionalScope,r)}var ne={type:"normalization",disabled:!1,primaryDimension:0,outputExpression:"",dimensionalScope:X.DISREGARD_ALL_DIMENSIONS,selectionScope:G.DISREGARD_SELECTION};function re(e){return 2===e?"{1}":""}function ie(e,t,n){return 1===e?"{$<".concat(M.getFieldWithWrapper(t),"={'").concat(n,"'}>}"):""}function oe(e,t){return 0===e&&t>1||2===e?"Total":""}function ae(e,t,n){return 0===e&&t>1?"<".concat(M.getDimDefWithWrapper(n),">"):""}var se={translationKey:"properties.modifier.normalization",needDimension:function(){return!0},isApplicable:function(e){var t=e.properties,n=e.layout;return M.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:M.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,o=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=o;void 0===l&&(l=M.getNumDimensions({properties:r,layout:i}));var u=a(r,"qHyperCubeDef.qDimensions",[]),c=M.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:u,dimensionAndFieldList:s}),d=n.selectionScope,m=n.dimensionalScope;return function(e,t,n,r,i,o,a){var s=re(t),l=ie(t,n,r),u=""===s&&""===l?"":s||l,c=oe(i,o),d=ae(i,o,a),m=function(e){for(var t=[],n=0;n<e;n++)t[n]=M.getDimDefWithWrapper(n);return t.join(", ")}(o);return"".concat(e,"/ Sum(").concat(u," ").concat(c).concat(d," Aggr(").concat(u," ").concat(e,", ").concat(m,"))")}(c,d,n.field,n.value,m,l,n.primaryDimension)},initModifier:function(e){Object.keys(ne).forEach((function(t){void 0===e[t]&&(e[t]=ne[t])}))},updateModifier:function(e,t){1===(t.qDimensions?t.qDimensions.length:0)&&0===e.dimensionalScope&&(e.dimensionalScope=2)},enableTotalsFunction:function(){return!0},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.normalization.disclaimer",show:function(e,t){return!M.isApplicable({properties:t.properties})}},settings:{type:"items",items:{selectionScope:{refFn:function(t){return"".concat(Z(t,e),".selectionScope")},type:"string",translation:t.modifierSelectionScope||"properties.modifier.selectionScope",title:{translation:t.modifierSelectionScopeTooltip||"properties.modifier.selectionScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:G.DISREGARD_SELECTION,options:function(n){return te(n,t,e)}},field:{refFn:function(t){return"".concat(Z(t,e),".field")},type:"string",component:"expression-with-dropdown",translation:"Common.Field",defaultValue:"",dropdownOnly:!0,options:function(e,t,n){return n.app.getFieldList().then((function(e){return e.map((function(e){return{label:e.qName,value:e.qName}}))}))},show:function(t){return J(t,e).selectionScope===G.SELECT_FIELD_VALUE}},value:{refFn:function(t){return"".concat(Z(t,e),".value")},type:"string",ref:"value",component:"string",translation:"properties.value",expression:"optional",show:function(t){return J(t,e).selectionScope===G.SELECT_FIELD_VALUE}},dimensionalScope:{refFn:function(t){return"".concat(Z(t,e),".dimensionalScope")},type:"string",translation:t.modifierDimensionalScope||"properties.modifier.dimensionalScope",title:{translation:t.modifierDimensionalScopeTooltip||"properties.modifier.dimensionalScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:X.DISREGARD_ALL_DIMENSIONS,supportTooltip:!0,options:function(n,r){return ee(n,r,t,e)}},primaryDimension:{refFn:function(t){return"".concat(Z(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.normalization.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(t,n){return(J(t,e).dimensionalScope||0)===X.ONE_DIMENSION&&n.layout.qHyperCube.qDimensionInfo.length>1}}},show:function(e,t){return M.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(K))return!1;var o=J(t,e);return o&&!o.disabled}};return n},getDisregardSelectionComp:re,getFieldSelectionComp:ie,getTotalComp:oe,getSelectedDimComp:ae},le={getExpression:function(e){return a(e,"qDef.base.qDef")||a(e,"qDef.qDef")},getExpressionRef:function(e){return a(e,"qDef.base.qDef")?"qDef.base.qDef":"qDef.qDef"},getLibraryIdRef:function(e){return a(e,"qDef.base.qLibraryId")?"qDef.base.qLibraryId":"qLibraryId"},getLibraryId:function(e){return a(e,"qDef.base.qLibraryId")||a(e,"qLibraryId")},getLabelRef:function(e){return a(e,"qDef.base")?"qDef.base.qLabel":"qDef.qLabel"},getLabelExpressionRef:function(e){return a(e,"qDef.base")?"qDef.base.qLabelExpression":"qDef.qLabelExpression"}},ue={initBase:function(e,t){(t||ue.isValid(e))&&(o(e,"qDef.base.qDef",a(e,"qDef.qDef")),o(e,"qDef.base.qLibraryId",a(e,"qLibraryId")),o(e,"qDef.base.qLabel",a(e,"qDef.qLabel")),o(e,"qDef.base.qLabelExpression",a(e,"qDef.qLabelExpression")))},restoreBase:function(e){ue.isValid(e)&&(o(e,"qDef.qDef",a(e,"qDef.base.qDef")),o(e,"qLibraryId",a(e,"qDef.base.qLibraryId")),o(e,"qDef.qLabel",a(e,"qDef.base.qLabel")),o(e,"qDef.qLabelExpression",a(e,"qDef.base.qLabelExpression")),a(e,"qDef.qAggrFunc")&&a(e,"qDef.base.qAggrFunc")&&o(e,"qDef.qAggrFunc",a(e,"qDef.base.qAggrFunc")),delete e.qDef.base)},isValid:function(e){var t=a(e,"qDef.base.qDef"),n=a(e,"qDef.base.qLibraryId");return void 0!==t||void 0!==n}},ce=ue;function de(e){return(de="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var me={accumulation:$,movingAverage:H,difference:W,normalization:se},fe=(t.default={modifiers:me,apply:pe,applyModifiers:he,cleanUpMeasure:ge,destroy:function(e){e&&fe[e.id]&&fe[e.id].masterItemSubscriber&&(fe[e.id].masterItemSubscriber&&fe[e.id].masterItemSubscriber.unsubscribe(),delete fe[e.id])},hasActiveModifiers:ye,getActiveModifier:ve,initBase:ce.initBase,isSupportedModifiers:function(e){return Array.isArray(e)&&e.some((function(e){return me[e]}))},isApplicableSupportedModifiers:function(e){var t=e.modifierTypes,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some((function(e){return me[e]&&me[e].isApplicable({properties:n,layout:r})}))},measureBase:le,limitedSorting:function(e){var t=e.measures,n=e.properties,r=e.layout,i=!1,o=!1;return t.forEach((function(e){var t=Me(e);Oe({modifiers:t,properties:n,layout:r})&&(i=!0,o=o||Le({modifiers:t,properties:n,layout:r}))})),i&&!o},ifEnableTotalsFunction:be},{});function pe(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.model,n=e.properties,r=e.isSnapshot,o=void 0!==r&&r,s=e.masterItem;fe[t.id]=fe[t.id]||{isFirstTime:!0};var l=fe[t.id].isFirstTime;if(fe[t.id].isFirstTime=!1,n&&"object"===de(n))return he({model:t,properties:n});var u=t?t.layout:void 0,c=a(u,"qSelectionInfo.qInSelections");if(o||c)return Promise.resolve(!1);var d=a(u,"qHyperCube.qMeasureInfo"),m=fe[t.id].lastReloadTime;if(fe[t.id].lastReloadTime=a(t,"app.layout.qLastReloadTime"),ye({measures:d,layout:u})){var f=function(e){var t=e.measures,n=e.layout,r=e.lastReloadTime;return a(e.model,"app.layout.qLastReloadTime")!==r&&function(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some((function(e){return Ae({measure:e,properties:n,layout:r})}))}({measures:t,layout:n})}({measures:d,layout:u,model:t,lastReloadTime:m});return f||function(e){var t=e.measures,n=e.layout,r=e.masterItem,i=e.isFirstTime;return!!Array.isArray(t)&&(i||r||t.some((function(e){return function(e){var t=e.measure,n=e.layout;return Oe({modifiers:Me(t),layout:n})?!t.base:!!t.base}({measure:e,layout:n})})))}({measures:d,layout:u,masterItem:s,isFirstTime:l})?t.getEffectiveProperties().then((function(e){var n=i()(!0,{},e);Ee(n);var r=ke(n);return De({model:t}).then((function(i){return Ne({libraryIds:r,model:t}).then((function(r){return f&&function(e){var t=e.properties;xe(t).forEach((function(e){return function(e){var t=e.measure;if(Ae({measure:t,properties:e.properties})){var n=0,r=t.qDef.modifiers;Array.isArray(r)&&r.forEach((function(e){if("object"===de(e)&&!e.disabled){if(n++,"object"!==de(me[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(n>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");var r=me[e.type].extractInputExpression({outputExpression:t.qDef.qDef,modifier:e});void 0!==r&&qe(t)&&M.simplifyExpression(t.qDef.base.qDef)!==M.simplifyExpression(r)&&(t.qDef.base.qDef=r)}}))}}({measure:e,properties:t})}))}({properties:n}),he({model:t,oldProperties:e,properties:n,runUpdateIfChange:!0,masterItem:s,libraryItemsProps:r,dimensionAndFieldList:i})}))}))})):Promise.resolve(!1)}return function(e){return!!Array.isArray(e)&&e.some((function(e){return"object"===de(e.base)}))}(d)?t.getEffectiveProperties().then((function(e){return function(e){var t=e.model,n=e.properties,r=ke(n);return Re({model:t,libraryIds:r}).then((function(){var e=i()(!0,{},n);return xe(n).forEach((function(e){return ge(e)})),Te({oldProperties:e,newProperties:n,model:t})}))}({model:t,properties:e})})):Promise.resolve(!1)}function he(e){var t=e.model,n=e.oldProperties,r=e.properties,o=e.measures,s=e.runUpdateIfChange,l=void 0!==s&&s,u=e.masterItem,c=e.libraryItemsProps,d=e.dimensionAndFieldList;void 0===n&&(n=l?i()(!0,{},r):r),Ee(r);var m=ke(r);return Re({model:t,libraryIds:m,masterItem:u}).then((function(){return function(e){var t=e.measures,n=e.properties,r=e.model,o=e.libraryItemsProps,s=e.dimensionAndFieldList;if(t||(t=xe(n)),!t.length)return Promise.resolve();if(!ye({measures:t,properties:n}))return t.forEach((function(e){return ge(e)})),Promise.resolve();var l=o?void 0:ke(n);return De({model:r,dimensionAndFieldList:s}).then((function(e){return Ne({libraryIds:l,model:r,libraryItemsProps:o}).then((function(r){t.forEach((function(t){Oe({modifiers:t.qDef.modifiers,properties:n})?(function(e){var t=e.measure,n=e.properties,r=e.libraryItemsProps,o=e.dimensionAndFieldList,s=0;ce.isValid(t)||ce.initBase(t,!0);var l=t.qDef,u=l.modifiers,c=l.base;Array.isArray(u)&&u.forEach((function(e){if("object"===de(e)&&!e.disabled){if(s++,"object"!==de(me[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(s>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");me[e.type].initModifier(e);var l=t.qLibraryId||c&&c.qLibraryId;l?function(e){var t=e.measure,n=e.modifier,r=e.properties,o=e.dimensionAndFieldList,a=e.libraryItemsProps[e.libraryId],s=a.qMeasure.qDef,l=me[n.type].generateExpression({expression:s,modifier:n,properties:r,dimensionAndFieldList:o});n.outputExpression=l,t.qDef.qDef=n.outputExpression,(t.qDef.qLabel||a.qMeasure.qLabel)&&(t.qDef.qLabel=a.qMeasure.qLabel),(t.qDef.qLabelExpression||a.qMeasure.qLabelExpression)&&(t.qDef.qLabelExpression=a.qMeasure.qLabelExpression),t.qDef.quarantine&&t.qDef.quarantine.qNumFormat&&a.qMeasure.qNumFormat&&(t.qDef.qNumFormat=a.qMeasure.qNumFormat,t.qDef.isCustomFormatted=a.qMeasure.isCustomFormatted),delete t.qLibraryId,t.qDef.coloring=a.qMeasure.coloring,n.base=i()(!0,{},t.qDef.base)}({measure:t,modifier:e,libraryId:l,properties:n,libraryItemsProps:r,dimensionAndFieldList:o}):function(e){var t=e.measure,n=e.modifier,r=e.properties,o=e.dimensionAndFieldList;"function"==typeof me[n.type].updateModifier&&me[n.type].updateModifier(n,r.qHyperCubeDef);var a=le.getExpression(t),s=me[n.type].generateExpression({expression:a,modifier:n,properties:r,dimensionAndFieldList:o});n.outputExpression=s,t.qDef.qDef=n.outputExpression,t.qDef.base.qLabelExpression?t.qDef.qLabelExpression=t.qDef.base.qLabelExpression:t.qDef.qLabel=t.qDef.base.qLabel||a,n.base=i()(!0,{},t.qDef.base)}({measure:t,modifier:e,properties:n,dimensionAndFieldList:o}),function(e){var t=a(e,"qDef.qAggrFunc");"Expr"!==t||be(e)?"None"!==t?delete e.qDef.base.qAggrFunc:"None"===t&&be(e)&&"Expr"===e.qDef.base.qAggrFunc&&(e.qDef.qAggrFunc="Expr",delete e.qDef.base.qAggrFunc):(e.qDef.qAggrFunc="None",e.qDef.base.qAggrFunc="Expr")}(t)}}))}({measure:t,properties:n,libraryItemsProps:r,dimensionAndFieldList:e}),Ce(t)):ge(t)}))}))}))}({measures:o,properties:r,model:t,libraryItemsProps:c,dimensionAndFieldList:d}).then((function(){return l?Te({oldProperties:n,newProperties:r,model:t}):Promise.resolve(!1)}))}))}function ge(e){!function(e){var t=Me(e);return Array.isArray(t)&&t.some((function(e){return"object"===de(e)&&!e.disabled&&!me[e.type]}))}(e)?ce.restoreBase(e):delete e.qDef.base,e.qDef.coloring&&delete e.qDef.coloring,Ce(e)}function ye(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some((function(e){return Oe({modifiers:Me(e),properties:n,layout:r})}))}function ve(e){var t=Me(e);if(Array.isArray(t))for(var n=0;n<t.length;n++){var r=t[n];if(me[r.type]&&!r.disabled)return r}}function be(e){var t=ve(e);return!t||me[t.type].enableTotalsFunction(e)}function xe(e){return a(e,"qHyperCubeDef.qMeasures",[]).concat(a(e,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",[]))}function Me(e){return e.modifiers||e.qDef&&e.qDef.modifiers}function Se(e){return a(e,"outputExpression.qValueExpression.qExpr")||a(e,"outputExpression")}function Ee(e){xe(e).forEach((function(e){return function(e){var t=ve(e);t&&(void 0!==t.outputExpression&&Se(t)!==e.qDef.qDef?delete e.qDef.base:!ce.isValid(e)&&t.base&&(e.qDef.base=i()(!0,{},t.base)))}(e)}))}function Ce(e){var t=Me(e);Array.isArray(t)&&t.forEach((function(t){"object"===de(t)&&(t.disabled||!me[t.type]&&Se(t)!==e.qDef.qDef)&&(t.disabled=!0,delete t.base)}))}function qe(e){return e.base||e.qDef&&e.qDef.base}function we(e){var t=qe(e);return e.qLibraryId||t&&t.qLibraryId}function Ae(e){var t=e.measure,n=e.properties,r=e.layout;return!we(t)&&Oe({modifiers:Me(t),properties:n,layout:r})}function Oe(e){var t=e.modifiers,n=e.properties,r=e.layout,i={};return Array.isArray(t)&&t.some((function(e){return!("object"!==de(e)||e.disabled||!me[e.type])&&(void 0===i[e.type]&&(i[e.type]=me[e.type].isApplicable({properties:n,layout:r})),i[e.type])}))}function De(e){var t=e.model,n=e.dimensionAndFieldList;if(n)return Promise.resolve(n);var r=[],i={},o=t.app.getDimensionList().then((function(e){i.dimensionList=e}));r.push(o);var a=t.app.getFieldList().then((function(e){i.fieldList=e}));return r.push(a),Promise.all(r).then((function(){return i}))}function Ne(e){var t=e.libraryIds,n=e.model,r=e.libraryItemsProps;if(r)return Promise.resolve(r);var i=t.measureLibraryIds,o=t.dimensionLibraryIds,a={},s=[];return i.forEach((function(e){var t=n.app.getMeasure(e).then((function(t){return t.getProperties().then((function(t){a[e]=t}))}));s.push(t)})),o.forEach((function(e){var t=n.app.getDimension(e).then((function(t){return t.getProperties().then((function(t){a[e]=t}))}));s.push(t)})),Promise.all(s).then((function(){return a}))}function Ie(e,t){if(""!==t||-1===["qFmt","qDec","qThou"].indexOf(e))return t}function Te(e){var t=e.oldProperties,n=e.newProperties,r=e.model,i=JSON.stringify(a(t,"qHyperCubeDef.qMeasures"),Ie)!==JSON.stringify(a(n,"qHyperCubeDef.qMeasures"),Ie)||JSON.stringify(a(t,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Ie)!==JSON.stringify(a(n,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Ie);return i?function(e){var t=e.model,n=e.oldProperties,r=e.newProperties,i=t.layout;return i&&!i.qHasSoftPatches&&!i.qExtendsId&&a(i,"qMeta.privileges",[]).indexOf("update")>-1?t.setProperties(r):T(t,n,r)}({model:r,oldProperties:t,newProperties:n}).then((function(){return i})):Promise.resolve(i)}function Le(e){var t=e.modifiers,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some((function(e){return"object"===de(e)&&!e.disabled&&me[e.type]&&me[e.type].needDimension({modifier:e,properties:n,layout:r})}))}function ke(e){var t=xe(e),n=[],r=[],i=!1;return t.forEach((function(t){var r=Me(t);if(Oe({modifiers:r,properties:e})){var o=we(t);o&&n.push(o),i=i||Le({modifiers:r,properties:e})}})),a(e,"qHyperCubeDef.qDimensions",[]).forEach((function(e){var t=e.qLibraryId;t&&r.push(t)})),{measureLibraryIds:n,dimensionLibraryIds:r}}function Re(e){var t=e.model,n=e.libraryIds;return!e.masterItem&&n&&(n.measureLibraryIds.length||n.dimensionLibraryIds.length)?(fe[t.id].masterItemSubscriber=fe[t.id].masterItemSubscriber||function(e){var t=e.model,n=e.callback,r={},i={},o={},s={dimension:["qDim.qFieldDefs"],measure:["qMeasure.qDef","qMeasure.qLabel","qMeasure.qLabelExpression","qMeasure.coloring","qMeasure.qNumFormat","qMeasure.isCustomFormatted"]};function l(e){var t={},n=a(e,"qInfo.qType");return n&&s[n]&&s[n].forEach((function(n){t[n]=a(e,n)})),JSON.stringify(t)}function u(e){var t=e.qInfo.qId;if(r[t]){var i=l(e);r[t].properties!==i&&(r[t].properties=i,"function"==typeof n&&r[t].enabled&&n(e)),r[t].enabled=!0}}function c(e,n){return t.app[n](e).then((function(t){r[e]={listener:t.layoutSubscribe(u),enabled:!1,properties:l(t.layout)}}))}return{subscribe:function(e){var n=e.measureLibraryIds,a=e.dimensionLibraryIds,s=[];return function(e){var t=e.dimensionLibraryIds;i={},e.measureLibraryIds.forEach((function(e){i[e]=!0})),o={},t.forEach((function(e){o[e]=!0}))}({measureLibraryIds:n,dimensionLibraryIds:a}),Object.keys(r).forEach((function(e){i[e]||o[e]||(r[e].listener.dispose(),delete r[e])})),t.app&&(Object.keys(i).forEach((function(e){i[e]&&!r[e]&&s.push(c(e,"getMeasure"))})),Object.keys(o).forEach((function(e){o[e]&&!r[e]&&s.push(c(e,"getDimension"))}))),Promise.all(s)},unsubscribe:function(){Object.keys(r).forEach((function(e){r[e].listener.dispose()})),r={}}}}({model:t,callback:function(e){return pe({model:t,masterItem:e}).then((function(){return t.app.clearUndoBuffer()}))}}),fe[t.id].masterItemSubscriber.subscribe(n)):Promise.resolve()}}])},function(e,t,n){function r(e){var t=function e(t){var n,r=t;return r>9?(n=65+r-10)>90&&(n+=6):r="".concat(r).charCodeAt(0),[48,111,79,105,73,108].indexOf(n)>-1?e(r+1):String.fromCharCode(n)}(e%62),n=Math.floor(e/62);return n>0?r(n)+t:t}function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}n.r(t);var o={getValue:function(e,t,n){if(null==e||null==t)return n;for(var r=t.split("."),i=e,o=0;o<r.length;++o){var a=r[o];if(""!==a){if(void 0===i[a]||null===i[a])return n;i=i[a]}}return i},setValue:function(e,t,n){if(null!=e&&null!=t){for(var r=t.split("."),i=r[r.length-1],o=e,a=0;a<r.length-1;++a){var s=r[a];void 0!==o[s]&&null!==o[s]||(o[s]=Number.isNaN(+r[a+1])?{}:[]),o=o[s]}void 0!==n?o[i]=n:delete o[i]}},isEmpty:function(e){return 0===Object.keys(e).length&&e.constructor===Object},isAtomicValue:function(e){return/boolean|number|string/.test(i(e))},generateId:function(){return r(Math.round(99e11*Math.random()+1e11)).replace(/\W/g,"")}};function a(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var n=Object.prototype.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)?s(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function l(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return u(e,t);var n=Object.prototype.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)?u(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function c(e,t,n){if(e){for(var r=0;r<e.length;r++)if(e[r][t]===n)return r;return-1}return-1}var d={isOrderedSubset:function(e,t){if(!(e&&t&&e.length&&t.length))return!1;var n=e.indexOf(t[0]);if(-1!==n){for(var r=0;r<t.length;r++){var i=e.indexOf(t[r]);if(n>i)return!1;n=i}return!0}return!1},indexAdded:function(e,t){var n;for(n=0;n<e.length;++n)e[n]>=0&&e[n]>=t&&++e[n];e.push(t)},indexRemoved:function(e,t){var n,r=0;for(n=0;n<e.length;++n)e[n]>t?--e[n]:e[n]===t&&(r=n);return e.splice(r,1),r},findItemByPropertyValue:function(e,t,n){if(e){for(var r=0;r<e.length;r++)if(e[r][t]===n)return e[r];return null}return null},findIndexByPropertyValue:c},m=n(1),f=n.n(m),p={addDimensions:function(e){var t,n=e.exportFormat,r=e.qHyperCubeDef,i=n.data[0];(t=i.dimensions).push.apply(t,a(r.qDimensions));var s,l=o.getValue(r,"qLayoutExclude.qHyperCubeDef.qDimensions");l&&(s=i.excludedDimensions).push.apply(s,a(l))},addMeasures:function(e){var t,n=e.exportFormat,r=e.qHyperCubeDef,i=n.data[0];(t=i.measures).push.apply(t,l(r.qMeasures));var a,s=o.getValue(r,"qLayoutExclude.qHyperCubeDef.qMeasures");s&&(a=i.excludedMeasures).push.apply(a,l(s))},setInterColumnSortOrder:function(e){var t=e.exportFormat,n=e.qHyperCubeDef,r=t.data[0];n.qInterColumnSortOrder||(n.qInterColumnSortOrder=[]),r.interColumnSortOrder=n.qInterColumnSortOrder.concat();var i=o.getValue(n,"qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder");i&&d.isOrderedSubset(i,r.interColumnSortOrder)&&(r.interColumnSortOrder=i.concat())},copyProperties:function(e){var t=e.exportFormat,n=e.properties;Object.keys(n).forEach((function(e){t.properties[e]=n[e]}))},updateLayoutExclude:function(e){var t=e.exportFormat,n=e.properties;n.qLayoutExclude||(n.qLayoutExclude={}),n.qLayoutExclude.disabled&&(Object.keys(n.qLayoutExclude.disabled).forEach((function(e){t.properties.hasOwnProperty(e)||(t.properties[e]=n.qLayoutExclude.disabled[e])})),delete n.qLayoutExclude.disabled),n.qLayoutExclude.changed&&(function(e){Object.keys(e.qLayoutExclude.changed).forEach((function(t){e.qLayoutExclude.changed[t].to===o.getValue(e,t)&&o.setValue(e,t,e.qLayoutExclude.changed[t].from)}))}(n),delete n.qLayoutExclude.changed),n.qLayoutExclude.quarantine&&!o.isEmpty(n.qLayoutExclude.quarantine)||delete n.qLayoutExclude},storeMeasuresModifiers:function(e){e.forEach((function(e){f.a.cleanUpMeasure(e),e.qDef.modifiers&&(e.store={modifiers:e.qDef.modifiers},delete e.qDef.modifiers)}))}};function h(e,t,n){var r,i,a=o.getValue(e,t);if(!o.isAtomicValue(a))try{if((i=(i=(r=JSON.stringify(a)).match(/:\{/g))?i.length:0)>2)return;a=JSON.parse(r)}catch(e){return}o.getValue(e,"qLayoutExclude.quarantine")||o.setValue(e,"qLayoutExclude.quarantine",{});var s=o.getValue(e,"qLayoutExclude.quarantine");s[n]||(s[n]={}),s[n][t]=a}var g=n(0),y=n.n(g);function v(e,t){var n=y()(!0,{},t,e);return o.getValue(n,"qOtherTotalSpec.qOtherCounted")||o.setValue(n,"qOtherTotalSpec.qOtherCounted",{qv:"10"}),o.getValue(n,"qOtherTotalSpec.qOtherLimit")||o.setValue(n,"qOtherTotalSpec.qOtherLimit",{qv:"0"}),n.hasOwnProperty("othersLabel")||(n.othersLabel="Others"),n}function b(e,t){return y()(!0,{},t,e)}function x(e,t,n){return"function"==typeof e?e(t):Number.isNaN(+e)?n:e}var M=Math.pow(2,53)-1;function S(e){return function(e){if(Array.isArray(e))return E(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return E(e,t);var n=Object.prototype.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)?E(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function E(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function C(e){return function(e){if(Array.isArray(e))return q(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return q(e,t);var n=Object.prototype.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)?q(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function q(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var w={importCommonProperties:function(e,t,n){var r="masterobject"===o.getValue(t,"properties.qInfo.qType")?"masterobject":o.getValue(n,"qInfo.qType");o.setValue(e,"qInfo.qType",r),e.visualization=n.visualization},copyPropertyIfExist:function(e,t,n){t.hasOwnProperty(e)&&(n[e]=t[e])},copyPropertyOrSetDefault:function(e,t,n,r){t.hasOwnProperty(e)?n[e]=t[e]:n[e]=r},getDefaultDimension:function(){return{qDef:{autoSort:!0,cId:"",othersLabel:"Others"},qLibraryId:"",qNullSuppression:!1,qOtherLabel:"Others",qOtherTotalSpec:{qOtherLimitMode:"OTHER_GE_LIMIT",qOtherMode:"OTHER_OFF",qOtherSortMode:"OTHER_SORT_DESCENDING",qSuppressOther:!1}}},getDefaultMeasure:function(){return{qDef:{autoSort:!0,cId:"",numFormatFromTemplate:!0},qLibraryId:"",qTrendLines:[]}},addDimensions:function(e){var t,n=e.exportFormat,r=e.maxDimensions,i=e.minDimensions,o=e.newHyperCubeDef,a=e.defaultDimension,s=n.data[0];for(t=0;t<s.dimensions.length;++t){var l=v(s.dimensions[t],a);o.qDimensions.length<r?o.qDimensions.push(l):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(l)}for(t=0;t<s.excludedDimensions.length;++t){var u=v(s.excludedDimensions[t],a);o.qDimensions.length<i?o.qDimensions.push(u):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(u)}},addMeasures:function(e){var t,n=e.exportFormat,r=e.maxMeasures,i=e.minMeasures,o=e.newHyperCubeDef,a=e.defaultMeasure,s=n.data[0];for(t=0;t<s.measures.length;++t){var l=b(s.measures[t],a);o.qMeasures.length<r?o.qMeasures.push(l):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(l)}for(t=0;t<s.excludedMeasures.length;++t){var u=b(s.excludedMeasures[t],a);o.qMeasures.length<i?o.qMeasures.push(u):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(u)}},getMaxMinDimensionMeasure:function(e){var t=e.exportFormat,n=e.dataDefinition,r=void 0===n?{}:n,i=t.data[0],o=r.dimensions||{max:0},a=r.measures||{max:0},s=x(a.max,i.dimensions.length,M),l=x(a.min,i.dimensions.length,0);return{maxDimensions:x(o.max,s,M),minDimensions:x(o.min,l,0),maxMeasures:s,minMeasures:l}},setInterColumnSortOrder:function(e){var t=e.exportFormat,n=e.newHyperCubeDef,r=t.data[0],i=n.qDimensions.length+n.qMeasures.length;n.qInterColumnSortOrder=r.interColumnSortOrder.concat();var o=n.qInterColumnSortOrder.length;if(o!==i)for(n.qLayoutExclude&&(n.qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder=r.interColumnSortOrder.concat());o!==i;)o<i?(d.indexAdded(n.qInterColumnSortOrder,o),++o):(--o,d.indexRemoved(n.qInterColumnSortOrder,o))},createNewProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.hypercubePath,i={qLayoutExclude:{disabled:{},quarantine:{}}};return Object.keys(t.properties).forEach((function(e){"qLayoutExclude"===e?t.properties[e].quarantine&&(i.qLayoutExclude.quarantine=y()(!0,{},t.properties[e].quarantine)):"qHyperCubeDef"===e&&r?o.setValue(i,"".concat(r,".qHyperCubeDef"),t.properties.qHyperCubeDef):n.hasOwnProperty(e)||-1!==["qMetaDef","descriptionExpression","labelExpression"].indexOf(e)||function(e,t){return"components"===t&&Array.isArray(e[t])&&e[t].some((function(e){return"general"===e.key}))}(t.properties,e)?i[e]=t.properties[e]:i.qLayoutExclude.disabled[e]=t.properties[e]})),null===(i=y()(!0,{},n,i)).components&&(i.components=[]),i},shouldInitLayoutExclude:function(e){var t=e.exportFormat,n=e.maxDimensions,r=e.minDimensions,i=e.maxMeasures,o=e.minMeasures,a=t.data[0];return a.dimensions.length>n&&n>0||a.measures.length>i&&i>0||a.excludedDimensions.length>0&&a.dimensions.length+a.excludedDimensions.length>r||a.excludedMeasures.length>0&&a.measures.length+a.excludedMeasures.length>o||!i&&a.measures.length>0||!n&&a.dimensions.length>0},initLayoutExclude:function(e){var t=e.exportFormat,n=e.maxDimensions,r=e.minDimensions,i=e.maxMeasures,o=e.minMeasures,a=e.newHyperCubeDef,s=t.data[0];a.qLayoutExclude||(a.qLayoutExclude={}),a.qLayoutExclude.qHyperCubeDef||(a.qLayoutExclude.qHyperCubeDef={}),(s.dimensions.length>n&&n>0||s.excludedDimensions&&s.excludedDimensions.length&&s.dimensions.length+s.excludedDimensions.length>r)&&(a.qLayoutExclude.qHyperCubeDef.qDimensions||(a.qLayoutExclude.qHyperCubeDef.qDimensions=[])),(s.measures.length>i&&i>0||s.excludedMeasures&&s.excludedMeasures.length&&s.measures.length+s.excludedMeasures.length>o)&&(a.qLayoutExclude.qHyperCubeDef.qMeasures||(a.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!i&&s.measures.length&&(a.qLayoutExclude.qHyperCubeDef.qMeasures||(a.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!n&&s.dimensions.length&&(a.qLayoutExclude.qHyperCubeDef.qDimensions||(a.qLayoutExclude.qHyperCubeDef.qDimensions=[]))},updateDimensionsOnAdded:function(e){var t=e.newProperties,n=e.dataDefinition,r=e.hypercubePath;if(n.dimensions&&"function"==typeof n.dimensions.added){var i=o.getValue(t,r||"").qHyperCubeDef,a=S(i.qDimensions);i.qDimensions=[],a.forEach((function(e){i.qDimensions.push(e),n.dimensions.added(e,t)}))}},updateMeasuresOnAdded:function(e){var t=e.newProperties,n=e.dataDefinition,r=e.hypercubePath;if(n.measures&&"function"==typeof n.measures.added){var i=o.getValue(t,r||"").qHyperCubeDef,a=C(i.qMeasures);i.qMeasures=[],a.forEach((function(e){i.qMeasures.push(e),n.measures.added(e,t)}))}},restoreMeasuresModifiers:function(e){var t=e.measures,n=e.modifierTypes;t&&n&&f.a.isSupportedModifiers(n)&&t.forEach((function(e){e.store&&e.store.modifiers&&(e.qDef.modifiers=e.store.modifiers),delete e.store}))}};function A(e,t){var n=o.getValue(e,"qLayoutExclude.quarantine",{})[t];return!!n&&(Object.keys(n).forEach((function(t){o.setValue(e,t,n[t])})),delete e.qLayoutExclude.quarantine[t],!0)}var O={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t={data:[],properties:{}},n=0;n<e;++n)t.data.push({dimensions:[],measures:[],excludedDimensions:[],excludedMeasures:[],interColumnSortOrder:[]});return t}(),a=t.qProperty,s=o.getValue(a,n||""),l=s.qHyperCubeDef;return l.qInterColumnSortOrder||(l.qInterColumnSortOrder=[]),p.addDimensions({exportFormat:i,qHyperCubeDef:l}),p.addMeasures({exportFormat:i,qHyperCubeDef:l}),p.setInterColumnSortOrder({exportFormat:i,qHyperCubeDef:l}),delete l.qLayoutExclude,p.copyProperties({exportFormat:i,properties:a}),n&&(i.properties.qHyperCubeDef=l,delete s.qHyperCubeDef),p.updateLayoutExclude({exportFormat:i,properties:a}),r||p.storeMeasuresModifiers(i.properties.qHyperCubeDef.qMeasures),Array.isArray(i.properties.filters)&&(h(i.properties,"filters","storedFilters"),delete i.properties.filters),i.properties.qHyperCubeDef.qContextSetExpression&&(h(i.properties,"qHyperCubeDef.qContextSetExpression","storedFilters"),i.properties.qHyperCubeDef.qContextSetExpression=""),i.properties.qHyperCubeDef.qDynamicScript&&i.properties.qHyperCubeDef.qDynamicScript.length&&(h(i.properties,"qHyperCubeDef.qDynamicScript","dynamicScript"),i.properties.qHyperCubeDef.qDynamicScript=[]),i},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=void 0===n?{}:n,i=e.dataDefinition,a=void 0===i?{}:i,s=e.defaultPropertyValues,l=void 0===s?{}:s,u=e.hypercubePath,c=e.extension,d=e.supportedFilters,m=void 0===d||d,f=e.isHCModifierSupported,p=void 0===f||f,h={qChildren:[]},g=w.createNewProperties({exportFormat:t,initialProperties:r,hypercubePath:u}),y=o.getValue(r,u||"").qHyperCubeDef,v=o.getValue(g,u||"").qHyperCubeDef,b=w.getMaxMinDimensionMeasure({exportFormat:t,dataDefinition:a}),x=b.maxDimensions,M=b.minDimensions,S=b.maxMeasures,E=b.minMeasures,C=l.defaultDimension,q=void 0===C?w.getDefaultDimension():C,O=l.defaultMeasure,D=void 0===O?w.getDefaultMeasure():O;v.qDimensions.length=0,v.qMeasures.length=0,w.shouldInitLayoutExclude({exportFormat:t,maxDimensions:x,minDimensions:M,maxMeasures:S,minMeasures:E})&&w.initLayoutExclude({exportFormat:t,maxDimensions:x,minDimensions:M,maxMeasures:S,minMeasures:E,newHyperCubeDef:v}),w.addDimensions({exportFormat:t,maxDimensions:x,minDimensions:M,newHyperCubeDef:v,defaultDimension:q}),w.addMeasures({exportFormat:t,maxMeasures:S,minMeasures:E,newHyperCubeDef:v,defaultMeasure:D}),w.updateDimensionsOnAdded({newProperties:g,dataDefinition:a,hypercubePath:u}),w.updateMeasuresOnAdded({newProperties:g,dataDefinition:a,hypercubePath:u}),w.setInterColumnSortOrder({exportFormat:t,newHyperCubeDef:v}),w.copyPropertyIfExist("qMaxStackedCells",y,v),w.copyPropertyIfExist("qNoOfLeftDims",y,v),w.copyPropertyOrSetDefault("qInitialDataFetch",y,v,[{qTop:0,qLeft:0,qWidth:0,qHeight:0}]),w.copyPropertyOrSetDefault("qMode",y,v,"S"),w.copyPropertyOrSetDefault("qReductionMode",y,v,"N"),w.copyPropertyOrSetDefault("qSortbyYValue",y,v),w.copyPropertyOrSetDefault("qIndentMode",y,v),w.copyPropertyOrSetDefault("qShowTotalsAbove",y,v),w.importCommonProperties(g,t,r),h.qProperty=g;var N=o.getValue(c||{},"support.modifiers");return w.restoreMeasuresModifiers({measures:v.qMeasures,modifierTypes:N}),m&&A(h.qProperty,"storedFilters"),"S"===v.qMode&&p&&A(h.qProperty,"dynamicScript"),h}},D={cellBackgroundColor:!0,cellForegroundColor:!0,colorByAlternative:!0,colorByExpression:!0,tooltip:!0,urlLabel:!0,url:!0};function N(e,t,n,r){t=t||[];var i=c(e,r,n),o=c(t,r,n);if(-1!==i&&-1===o){var a=e.splice(i,1);t.push(a[0])}return t}function I(e,t){return e.length!==t}var T={create:function(e,t){if(!e||!D[e])throw new Error("Attribute Expressions Util: ID required");var n={};return t&&Object.keys(t).forEach((function(e){n[e]=t[e]})),n.id=e,n.qAttribute=!0,n},moveByIdFromGroup:function(e,t,n,r,i){n=n||"qAttributeExpressions",i=i||"id";for(var o=0;o<e.length;o++){var a=e[o][n],s=t.length;if(N(a,t,r,i),I(t,s))return t}return t},IDMAP:{CELL_BACKGROUND_COLOR:"cellBackgroundColor",CELL_FOREGROUND_COLOR:"cellForegroundColor",COLOR_BY_ALTERNATIVE:"colorByAlternative",COLOR_BY_EXPRESSION:"colorByExpression",TOOLTIP:"tooltip",CELL_LINK_LABEL:"urlLabel",CELL_LINK_URL:"url"}},L={getNumDimensions:function(e){return o.getValue(e,"qHyperCubeDef.qDimensions.length",0)},getNumMeasures:function(e){return o.getValue(e,"qHyperCubeDef.qMeasures.length",0)},wrapFieldName:function(e){return e.split(" ").length>1&&"="!==e[0]&&"["!==e[0]?"[".concat(e,"]"):e},getItemLabel:function(e){return e.label||e.name}},k={colorModeOptions:{primary:function(){return!0},dimension:function(e){return L.getNumDimensions(e)>0&&L.getNumMeasures(e)<=1},multiColor:function(e){return L.getNumMeasures(e)>1},measure:function(e){return L.getNumDimensions(e)>0},expression:function(e){return L.getNumMeasures(e)>=1}}},R={colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return L.getNumMeasures(e)>=1}}},P={scatterplot:R,"sn-scatter-plot":R,piechart:{colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return L.getNumMeasures(e)>=1}}},linechart:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return L.getNumDimensions(e)>1},multiColor:function(e){return L.getNumMeasures(e)>1},measure:function(e){return L.getNumDimensions(e)<=1},expression:function(e){return L.getNumMeasures(e)>=1}}},map:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return L.getNumDimensions(e)>=1},multiColor:function(e){return L.getNumMeasures(e)>1},measure:function(e){return L.getNumDimensions(e)>=1},expression:function(e){return L.getNumDimensions(e)>=1}}},distributionplot:{colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return L.getNumDimensions(e)>=1}}}};function $(e,t,n){if(Array.isArray(e[t])){var r=d.findIndexByPropertyValue(e[t],"id",n);r>=0&&e[t].splice(r,1)}else e[t]=[]}function F(e,t){var n=T.IDMAP.COLOR_BY_ALTERNATIVE;e.forEach((function(e){$(e,"qAttributeDimensions",n),$(e,"qAttributeExpressions",n)})),t.forEach((function(e){$(e,"qAttributeDimensions",n),$(e,"qAttributeExpressions",n)}))}function z(e,t){if(t){var n="="===t.charAt(0);e.color.altLabel=n?{qStringExpression:{qExpr:t.substr(1)}}:t}}function _(e){var t=e.properties,n=e.isDimension,r=e.dimensions,i=e.excludedDimensions,a=e.measures,s=e.label;F(r,i);var l=r[r.length-1];if(l){var u=n?o.getValue(t,"color.byDimDef"):o.getValue(t,"color.byMeasureDef"),c=o.getValue(t,"color.formatting.qNumFormat"),m=o.getValue(t,"color.formatting.isCustomFormatted");if(u){var f=T.create(T.IDMAP.COLOR_BY_ALTERNATIVE);switch(u.type){case"expression":!function(e){var t=e.attributeExpression,n=e.label,r=e.item,i=e.isDimension,o=e.qNumFormat,a=e.isCustomFormatted;t.label=n||r.label,i?t.qDef=r.key:(t.qExpression=r.key,o&&(t.qNumFormat=o,t.isCustomFormatted=a)),t.matchMeasure=r.activeMeasureIndex,t.label&&"="===t.label.charAt(0)&&(t.labelExpRef="color.altLabel")}({attributeExpression:f,label:s,item:u,isDimension:n,qNumFormat:c,isCustomFormatted:m});break;case"libraryItem":!function(e){var t=e.attributeExpression,n=e.measures,r=e.item,i=e.isDimension,o=e.qNumFormat,a=e.isCustomFormatted;i||(t.matchMeasure=d.findIndexByPropertyValue(n,"qLibraryId",r.key),o&&(t.qNumFormat=o,t.isCustomFormatted=a)),void 0!==r.expression?t.qExpression=r.expression:t.qLibraryId=r.key,t.colorMapRef=r.key}({attributeExpression:f,measures:a,item:u,isDimension:n,qNumFormat:c,isCustomFormatted:m})}n?(f.qSortBy={qSortByAscii:1},l.qAttributeDimensions.push(f)):l.qAttributeExpressions.push(f)}}}function j(e,t,n,r){var i,o,a,s={};switch(e){case"dimension":n.qLibraryId?(s.type="dimension",s.name=n.qLibraryId,s.id=n.qLibraryId):(s.type="field",t?(s.name=n.label||n.qDef,s.id=n.qDef):(s.name=n.qDef.qFieldDefs[0],s.label=(a=n.qDef).qLabelExpression?a.qLabelExpression:a.qFieldLabels&&a.qFieldLabels[0]?a.qFieldLabels[0]:a.qFieldDefs[0]));break;case"measure":(i=function(e,t){return t?e.qLibraryId:f.a.measureBase.getLibraryId(e)}(n,t))?(s.type="measure",s.name=i,s.id=i,(o=function(e,t){return f.a.hasActiveModifiers({measures:[e]})&&t?e.qDef.qDef:void 0}(n,r))&&(s.expression=o)):(s.type="expression",t?(s.name=n.label||n.qExpression,s.id=n.qExpression):(s.name=n.qDef.qDef,s.label=function(e){var t=e.qDef;return t.qLabelExpression?t.qLabelExpression:t.qLabel?t.qLabel:t.qDef}(n)));break;default:throw new Error('columnType should be "dimension" or "measure"')}return s}var H={useMasterNumberFormat:function(e){e.quarantine={qNumFormat:e.qNumFormat||{},isCustomFormatted:e.isCustomFormatted||!1},e.qNumFormat=null,e.isCustomFormatted=void 0}};function V(e,t,n,r){var i=n?"expression":t.type,o=e.color,a=o.mode,s=L.getItemLabel(t);switch(z(e,s||""),i){case"field":a="byDimension",o.byDimDef={label:t.label||L.wrapFieldName(t.name),key:L.wrapFieldName(t.name),type:"expression",activeDimensionIndex:t.activeDimensionIndex};break;case"expression":a="byMeasure",o.byMeasureDef={label:n||s,key:n||t.name,type:"expression",activeMeasureIndex:t.activeMeasureIndex};break;case"dimension":a="byDimension",o.byDimDef={label:t.name,key:t.id,type:"libraryItem",activeDimensionIndex:t.activeDimensionIndex};break;case"measure":a="byMeasure",o.byMeasureDef={label:t.name,key:t.id,expression:t.expression,type:"libraryItem",activeMeasureIndex:t.activeMeasureIndex},o.formatting&&H.useMasterNumberFormat(o.formatting)}r||(o.auto=!1,o.mode=a)}function B(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=n[function(e,t,n){var r=o.getValue(t,"visualization"),i=n.split("."),a=Number(i[1]),s=o.getValue(t,"layers.".concat(a,".type"));return 2===e.length&&"map"===r&&"point"===s}(n,e,t)?0:n.length-1],i=T.IDMAP.COLOR_BY_ALTERNATIVE,a=d.findItemByPropertyValue(r.qAttributeDimensions,"id",i);return V(e,j("dimension",!!a,a||r)),!!a}function U(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),a=o.getValue(e,"color.byDimDef");if(a&&z(e,a.label),function(e){return!!(e&&e.activeDimensionIndex>-1)}(a))!function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"color.byDimDef");r.activeDimensionIndex=Math.min(r.activeDimensionIndex,n.length-1);var i=j("dimension",!1,n[r.activeDimensionIndex]);i.activeDimensionIndex=r.activeDimensionIndex,V(e,i)}(e,t);else if(function(e){return!e||!e.key}(a)&&B(e,t))return;_({properties:e,isDimension:!0,dimensions:n,excludedDimensions:i,measures:r,label:o.getValue(e,"color.byDimDef.label")})}function Y(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),a=o.getValue(e,"color.byMeasureDef");if(a&&z(e,a.label),function(e){return!!(e&&e.activeMeasureIndex>-1)}(a))!function(e,t){var n=o.getValue(e,"".concat(t,"qMeasures"),[]),r=o.getValue(e,"color.byMeasureDef");if(r.activeMeasureIndex=Math.min(r.activeMeasureIndex,n.length-1),r.activeMeasureIndex>-1){var i=j("measure",!1,n[r.activeMeasureIndex],!0);i.activeMeasureIndex=r.activeMeasureIndex,V(e,i)}}(e,t);else if(function(e,t){return(!e||!e.key)&&t.length>0}(a,r)&&function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=n[n.length-1],a=T.IDMAP.COLOR_BY_ALTERNATIVE,s=d.findItemByPropertyValue(i.qAttributeExpressions,"id",a);return V(e,j("measure",!!s,s||r[0])),!!s}(e,t))return;_({properties:e,isDimension:!1,dimensions:n,excludedDimensions:i,measures:r,label:o.getValue(e,"color.byMeasureDef.label")})}var W={changeProperty:function(e,t,n){o.setValue(e,t,n),o.isAtomicValue(n)&&function(e,t,n){var r=e.qLayoutExclude;r&&(r.changed||(r.changed={}),r.changed[t]={from:o.getValue(e,t),to:n})}(e,t,n)},getCanColorBy:function(e,t){var n={primary:!0};if(e){var r=(P[t]||k).colorModeOptions||k.colorModeOptions;n.byDimension=r.dimension(e),n.byMeasure=r.measure(e),n.byMultiple=r.multiColor(e),n.byExpression=r.expression(e)}return n},shouldUpdateColorBy:function(e){var t=e.canColorBy,n=e.autoColor,r=e.colorMode,i=e.dimensions;return!(t[r]&&!n&&("byDimension"!==r&&"byMeasure"!==r||!i.length))},updateColorBy:function(e,t){var n=o.getValue(e,"color.mode"),r=o.getValue(e,"color.auto"),i=o.getValue(e,"".concat(t,"qDimensions"),[]),a=o.getValue(e,"".concat(t,"qMeasures"),[]),s=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);r?F(i,s):function(e){var t=e.auto,n=e.colorMode,r=e.dimensions;return!t&&"byDimension"===n&&r.length>0}({auto:r,colorMode:n,dimensions:i})?U(e,t):function(e){var t=e.auto,n=e.colorMode,r=e.dimensions,i=e.measures,a=e.properties,s=o.getValue(a,"visualization");return!(t||"byMeasure"!==n||!r.length||"map"!==s&&!i.length)}({auto:r,colorMode:n,dimensions:i,measures:a,properties:e})?Y(e,t):function(e,t){var n=o.getValue(e,"color.mode"),r=o.getValue(e,"".concat(t,"qDimensions"),[]),i=o.getValue(e,"".concat(t,"qMeasures"),[]),a=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);"byMultiple"===n&&i.length<2&&o.setValue(e,"color.mode","primary"),F(r,a)}(e,t)},deleteTotalMode:function(e){e.forEach((function(e){e.qOtherTotalSpec&&"qTotalMode"in e.qOtherTotalSpec&&delete e.qOtherTotalSpec.qTotalMode}))},shouldAddColorByExpression:function(e){var t=e.shouldUpdateColorBy,n=e.properties,r=o.getValue(n,"qHyperCubeDef.qMeasures",[]),i=o.getValue(n,"color.mode","");return!t&&"byExpression"===i&&r.length>0},addColorByExpression:function(e){var t=o.getValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",[]),n=o.getValue(e,"color.colorExpression","");t.splice(0,0,{qExpression:n,id:"colorByExpression"}),o.setValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",t)},switchToAutoColor:function(e){o.setValue(e,"color.mode","primary"),o.setValue(e,"color.auto",!0)},shouldSwitchToColorPersistent:function(e){var t=o.getValue(e,"qHyperCubeDef.qDimensions",[]),n=o.getValue(e,"color.persistent",!1);return t.length>1&&!n}},G={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=O.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),o=i.data[0],a=o.dimensions.concat(o.excludedDimensions),s=o.measures.concat(o.excludedMeasures),l=T.IDMAP,u=l.COLOR_BY_ALTERNATIVE,c=l.COLOR_BY_EXPRESSION;return T.moveByIdFromGroup(a,[],"qAttributeDimensions",u),T.moveByIdFromGroup(a,[],"qAttributeExpressions",u),T.moveByIdFromGroup(s,[],"qAttributeExpressions",c),i},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.dataDefinition,i=e.defaultPropertyValues,a=e.hypercubePath,s=e.extension,l=e.supportedFilters,u=e.isHCModifierSupported,c=O.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:a,extension:s,supportedFilters:l,isHCModifierSupported:u}),d=c.qProperty,m=o.getValue(d,"visualization"),f=o.getValue(d,"qHyperCubeDef.qDimensions",[]),p=o.getValue(d,"color.mode",""),h=o.getValue(d,"color.auto",""),g=W.getCanColorBy(d,m),y=W.shouldUpdateColorBy({canColorBy:g,autoColor:h,colorMode:p,dimensions:f});return g[p]?W.shouldAddColorByExpression({shouldUpdateColorBy:y,properties:d})&&W.addColorByExpression(d):W.switchToAutoColor(d),y&&W.updateColorBy(d,"qHyperCubeDef."),W.shouldSwitchToColorPersistent(d)&&W.changeProperty(d,"color.persistent",!0),W.deleteTotalMode(f),c}},X=["bar","marker","line"],K={handleAutoMinMax:function(e){var t=e.initialProperties,n=e.properties;t.measureAxis&&void 0===t.measureAxis.autoMinMax?A(n,"unsupportedAutoMinMax")||y()(n.measureAxis,t.measureAxis):A(n,"supportedAutoMinMax")||y()(n.measureAxis,t.measureAxis)},handleMeasuresAxis:function(e){var t,n=e.exportFormat,r=e.initialProperties,i=e.properties,o=e.measureType,a=i.qHyperCubeDef,s=i.measureAxis;if(function(e){var t=e.exportFormat,n=e.initialProperties;return!(!t.properties.measureAxes||n.measureAxes||!n.measureAxis||void 0===n.measureAxis.autoMinMax)}({exportFormat:n,initialProperties:r})){var l=function(e){var t=[];return e.qMeasures.length>0&&e.qMeasures.forEach((function(e){if(e.qDef.series){var n=e.qDef.series,r=n.type,i=n.axis;t[i]||(t[i]={axis:i,type:{line:0,marker:0,bar:0,total:0}}),X.includes(r)&&t[i].type[r]++,t[i].type.total++}})),t}(a);l.length?(o&&(t=l.filter((function(e){return e.type[o]>0})).sort((function(e,t){return t.type[o]-e.type[o]}))),t&&t.length||(t=l.sort((function(e,t){return t.type.total-e.type.total}))),t&&t[0]&&y()(s,n.properties.measureAxes[t[0].axis])):y()(s,n.properties.measureAxes[0])}},setInterColumnSortOrder:function(e){if(e.qDimensions.length>1){var t=e.qInterColumnSortOrder.indexOf(0);if(0!==t){var n=e.qInterColumnSortOrder[0];e.qInterColumnSortOrder[0]=0,e.qInterColumnSortOrder[t]=n}}}},J={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=e.supportedAutoMinMax,o=void 0===i||i,a=G.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),s=a.properties;return o?(h(s,"measureAxis.min","supportedAutoMinMax"),h(s,"measureAxis.max","supportedAutoMinMax")):(h(s,"measureAxis.min","unsupportedAutoMinMax"),h(s,"measureAxis.max","unsupportedAutoMinMax")),a},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.dataDefinition,i=e.defaultPropertyValues,o=e.hypercubePath,a=e.measureType,s=e.extension,l=e.supportedFilters,u=e.isHCModifierSupported,c=G.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:o,extension:s,supportedFilters:l,isHCModifierSupported:u}),d=c.qProperty;return K.handleAutoMinMax({initialProperties:n,properties:d}),K.handleMeasuresAxis({exportFormat:t,initialProperties:n,properties:d,measureType:a}),K.setInterColumnSortOrder(d.qHyperCubeDef),d.qHyperCubeDef.qColumnOrder=[],d.qHyperCubeDef.columnOrder=[],c}};function Z(e,t,n){return"qLayoutExclude.quarantine.".concat(e,".").concat(t,".").concat(n)}function Q(e){var t=e.properties,n=e.arrayPath,r=e.quarantineName,i=e.arrayName,a=e.itemPath;o.getValue(t,n,[]).forEach((function(e){return function(e){var t=e.properties,n=e.quarantineName,r=e.arrayName,i=e.item,a=e.itemPath,s=o.getValue(i,a);if(void 0!==s){var l=o.getValue(i,"qDef.cId");l||(l=o.generateId(),o.setValue(i,"qDef.cId",l));var u=Z(n,r,l);o.setValue(t,u,s),o.setValue(i,a,void 0)}}({properties:t,quarantineName:r,arrayName:i,item:e,itemPath:a})}))}function ee(e){var t=e.properties,n=e.arrayPath,r=e.quarantineName,i=e.arrayName,a=e.itemPath;o.getValue(t,n,[]).forEach((function(e){return function(e){var t=e.properties,n=e.quarantineName,r=e.arrayName,i=e.item,a=e.itemPath,s=o.getValue(i,"qDef.cId");if(s){var l=Z(n,r,s),u=o.getValue(t,l);void 0!==u&&(o.setValue(i,a,u),o.setValue(t,l,void 0))}}({properties:t,quarantineName:r,arrayName:i,item:e,itemPath:a})}))}var te={quarantine:function(e){Q({properties:e,arrayPath:"qHyperCubeDef.qMeasures",quarantineName:"conditionalColoring",arrayName:"measures",itemPath:"qDef.conditionalColoring"})},unquarantine:function(e){ee({properties:e,arrayPath:"qHyperCubeDef.qMeasures",itemPath:"qDef.conditionalColoring",arrayName:"measures",quarantineName:"conditionalColoring"})}},ne={quarantine:function(e){Q({properties:e,arrayPath:"qHyperCubeDef.qMeasures",quarantineName:"conditionalShowHide",arrayName:"measures",itemPath:"qCalcCondition"}),Q({properties:e,arrayPath:"qHyperCubeDef.qDimensions",quarantineName:"conditionalShowHide",arrayName:"dimensions",itemPath:"qCalcCondition"})},unquarantine:function(e){ee({properties:e,arrayPath:"qHyperCubeDef.qMeasures",quarantineName:"conditionalShowHide",arrayName:"measures",itemPath:"qCalcCondition"}),ee({properties:e,arrayPath:"qHyperCubeDef.qDimensions",quarantineName:"conditionalShowHide",arrayName:"dimensions",itemPath:"qCalcCondition"})},quarantineAlternative:function(e){Q({properties:e,arrayPath:"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",quarantineName:"conditionalShowHide",arrayName:"alternativeMeasures",itemPath:"qCalcCondition"}),Q({properties:e,arrayPath:"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions",quarantineName:"conditionalShowHide",arrayName:"alternativeDimensions",itemPath:"qCalcCondition"})},unquarantineAlternative:function(e){ee({properties:e,arrayPath:"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",quarantineName:"conditionalShowHide",arrayName:"alternativeMeasures",itemPath:"qCalcCondition"}),ee({properties:e,arrayPath:"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions",quarantineName:"conditionalShowHide",arrayName:"alternativeDimensions",itemPath:"qCalcCondition"})}};t.default={hypercube:O,colorChart:G,axisChart:J,quarantineProperty:h,unquarantineProperty:A,quarantineArrayProp:Q,unquarantineArrayProp:ee,conditionalColoring:te,conditionalShow:ne}}]);var uD=F(lD.exports);const cD={version:"1.26.2",qHyperCubeDef:{qAlwaysFullyExpanded:!0,qDimensions:[],qMeasures:[],qInitialDataFetch:[{qWidth:17,qHeight:500}],qSuppressMissing:!0,qSuppressZero:!1},showTitles:!0,subtitle:"",title:"",footnote:"",barGrouping:{grouping:"grouped"},orientation:"vertical",scrollStartPos:0,nullMode:"gap",dataPoint:{show:!1,showLineLabels:!1,showBarLabels:!1},color:{auto:!0,mode:"primary",useBaseColors:"off",paletteColor:{index:6},useDimColVal:!0,useMeasureGradient:!0,persistent:!1,expressionIsColor:!0,expressionLabel:"",measureScheme:"sg",reverseScheme:!1,dimensionScheme:"12",autoMinMax:!0,measureMin:0,measureMax:10},legend:{dock:"auto",show:!0,showTitle:!0},components:[],dimensionAxis:{axisDisplayMode:"auto",continuousAuto:!0,dock:"near",label:"auto",maxVisibleItems:10,show:"all"},measureAxes:[{show:"all",dock:"near",spacing:1,autoMinMax:!0,minMax:"min",min:0,max:10},{show:"all",dock:"far",spacing:1,autoMinMax:!0,minMax:"min",min:0,max:10}],refLine:{refLines:[],refLines2:[],dimRefLines:[]},preferContinuousAxis:!0,showMiniChartForContinuousAxis:!0,tooltip:{auto:!0,hideBasic:!1,title:"",description:"",chart:void 0,imageComponents:void 0}};var dD=e=>t=>{const n=t.qHyperCubeDef.qMeasures,r=[0,0,0];let i;if(!n.length)return e.get("Visualizations.Descriptions.Bars");for(let e=0;e<n.length;++e)i=lv(n[e].qDef.series),i===cl.TYPE.BAR?r[0]=1:i===cl.TYPE.LINE?r[1]=1:r[2]=1;const o=["Visualizations.Descriptions.Marker","Visualizations.Descriptions.Line","Visualizations.Descriptions.ComboChart.Dimension.LineMarker","Visualizations.Descriptions.Bars","Visualizations.Descriptions.ComboChart.Dimension.BarMarker","Visualizations.Descriptions.ComboChart.Dimension.BarLine","Visualizations.Descriptions.ComboChart.Dimension.BarLineMarker"][parseInt(r.join(""),2)-1];return e.get(o)},mD=e=>(t,n)=>{let r;const i=t.qHyperCubeDef.qMeasures[n];if(i){const{type:e}=i.qDef.series;r=e===cl.TYPE.LINE?"Visualizations.Descriptions.HeightLine":e===cl.TYPE.BAR?"Visualizations.Descriptions.LengthBars":"Visualizations.Descriptions.ComboChart.Measure.HeightMarker"}else r=n?"Visualizations.Descriptions.HeightLine":"Visualizations.Descriptions.LengthBars";return e.get(r)};function fD(e){var t,n;const r=e.qHyperCubeDef.qMeasures,i=null===(t=e.color)||void 0===t?void 0:t.mode;"byDimension"===i&&1===r.length&&lv(null===(n=r[0].qDef)||void 0===n?void 0:n.series)===cl.TYPE.LINE?e.color.mode="primary":"byDimension"===i&&r.length>1&&(e.color.mode="byMultiple")}function pD(e){const{translator:t}=e;return{dimensions:{min:1,max:1,description:dD(t),added(e,t){Cl.addCallbackCustomTooltip(t)},moved(e,t){Cl.moveCallbackCustomTooltip(t,e)},removed(e,t){Cl.removeCallbackCustomTooltip(t,e)},replaced(e,t,n,r){Cl.replaceCallbackCustomTooltip(r,t)}},measures:{min:1,max:15,description:mD(t),added({qDef:e},t){var n;fD(t),null!==(n=e.series)&&void 0!==n&&n.type||(t.qHyperCubeDef.qMeasures.length>1?e.series={type:cl.TYPE.LINE,axis:cl.AXIS.SECONDARY}:e.series={type:cl.TYPE.BAR,axis:cl.AXIS.PRIMARY})},moved(e,t){fD(t)}}}}function hD(e){const t=pD(e);return{properties:cD,data:{targets:[{path:"/qHyperCubeDef",...t}]},importProperties:({exportFormat:e,initialProperties:n,hypercubePath:r})=>{const i=uD.axisChart.importProperties({exportFormat:e,initialProperties:n,dataDefinition:t,hypercubePath:r}),o="linechart"===e.properties.visualization,a=[];i.qProperty.qHyperCubeDef.qMeasures.forEach((e=>{e.qDef.series||(e.qDef.series={type:o?"line":"bar",axis:0,marker:"circle",markerFill:!0}),a.indexOf(e.qDef.series.axis)<0&&a.push(e.qDef.series.axis)}));const s=a.sort().shift();return i.qProperty.measureAxes[s]&&e.properties.measureAxis&&void 0!==e.properties.measureAxis.autoMinMax&&G(!0,i.qProperty.measureAxes[s],e.properties.measureAxis,{logarithmic:!1}),i},exportProperties:({propertyTree:e,hyperCubePath:t,viewDataMode:n})=>uD.axisChart.exportProperties({propertyTree:e,hyperCubePath:t,viewDataMode:n})}}const gD=(e,t,n,r)=>{const i=`${t}.fontFamily`,o=`${t}.fontSize`;return{fontFamilyItem:{component:"dropdown",ref:`${e}.fontFamily`,options:()=>n.getOptions(i),defaultValue:()=>n.getDefaultValue(i)},fontWrapperItem:{component:"inline-wrapper",items:{fontSizeItem:{component:"dropdown",ref:`${e}.fontSize`,options:()=>n.getOptions(o),defaultValue:()=>n.getDefaultValue(o)},fontColorItem:{component:"color-picker",width:!1,ref:`${e}.color`,defaultValue:()=>({color:r.getStyle("object.comboChart",t,"color")})}}}}};function yD(e,t,n){const r=function(e){var t=e.theme,n=e.translator,r=e.config,i=void 0===r?{}:r,o=e.flags,a=function(e){var t=e.config,n=void 0===t?{}:t,r=n.id,i=n.paths;return{id:void 0===r?"object":"".concat("object",".").concat(r),paths:Array.isArray(i)?i:[]}}({config:i}),s=a.id,l=a.paths,u={};l.forEach((function(e){for(var r=e.split("."),i=u,a=0;a<r.length;a++){var l=r[a];a===r.length-1?i[l]=ay({theme:t,translator:n,id:s,path:e,flags:o}):void 0===i[l]&&(i[l]={}),i=i[l]}}));var c=function(e){for(var t=e.split("."),n=u,r=0;r<t.length;r++){var i=t[r];if(void 0===n[i])throw new Error("font-resolver: Path '".concat(e,"' could not be resolved."));n=n[i]}return n};return u.getDefaultValue=function(e){return c(e).getDefaultValue()},u.getOptions=function(e){return c(e).getOptions()},u}({theme:t,translator:n,flags:e,config:{id:"comboChart",paths:["axis.title","axis.label.name","label.value","legend.title","legend.label"]}});if(null!=e&&e.isEnabled("SENSECLIENT_IM_311_STYLINGPANEL_COMBOCHART"))return{component:"styling-panel",show:!0,chartType:"combochart",translation:"LayerStyleEditor.component.styling",chartTitle:"Object.ComboChart",subtitle:"LayerStyleEditor.component.styling",useGeneral:!0,useBackground:null==e?void 0:e.isEnabled("SENSECLIENT_IM_2431_COMBOCHART_BG"),items:{barSection:{translation:"Visualizations.Descriptions.Bars",component:"accordion",items:{outlineSection:{translation:"properties.Outline",component:"panel-section",items:{wrapperItem:{component:"items",ref:"components",key:"bar",items:{barStroke:{component:"inline-wrapper",items:{strokeWidth:{ref:"style.strokeWidth",width:!0,component:"dropdown",options:[{translation:"Common.None",value:"none"},{translation:"Common.Small",value:"small"},{translation:"Common.Medium",value:"medium"},{translation:"Common.Large",value:"large"}],defaultValue:"none",schemaIgnore:!0},strokeColor:{ref:"style.strokeColor",defaultValue:{color:"#205891"},schemaIgnore:!0,width:"auto",component:"color-picker"}}}}}}},widthSection:{translation:"LayerStyleEditor.style.barWidth",component:"panel-section",items:{barWidth:{component:"items",ref:"components",key:"bar",items:{width:{ref:"style.width",component:"slider",min:.01,max:1,step:.01,defaultValue:.7,schemaIgnore:!0}}}}},labelValueSection:null!=e&&e.isEnabled("CLIENT_IM_3050")?{translation:"properties.dataPoints.barlabelmode",component:"panel-section",items:{labelItems:{component:"items",ref:"components",key:"bar",items:{...gD("bar.label.value","label.value",r,t),contrastColor:{component:"checkbox",type:"boolean",ref:"bar.label.value.useContrastColor",translation:"properties.dataPoints.valuelabel.contrast",defaultValue:!0}}}}}:void 0}},lineSection:{translation:"Visualizations.Descriptions.Lines",component:"accordion",items:{dataPointSection:{translation:"LayerStyleEditor.style.dataPointSize",component:"panel-section",items:{dataPointSize:{component:"items",ref:"components",key:"line",items:{size:{ref:"style.dataPointSize",component:"slider",min:3,max:20,step:1,defaultValue:6,schemaIgnore:!0}}}}},lineSection:{translation:"Line options",component:"panel-section",items:{wrapperItem:{component:"items",ref:"components",key:"line",items:{size:{ref:"style.lineThickness",translation:"Thickness",component:"slider",defaultValue:1,min:1,max:5,step:1,schemaIgnore:!0},type:{ref:"style.lineType",translation:"Type",component:"dropdown",width:"auto",grouped:!0,options:[{value:"solid",translation:"LayerStyleEditor.style.solid"},{value:"dashed",translation:"LayerStyleEditor.style.dashed"}],defaultValue:"solid",schemaIgnore:!0},curve:{ref:"style.lineCurve",translation:"Curve",component:"dropdown",width:"auto",grouped:!0,options:[{value:"linear",translation:"LayerStyleEditor.style.linear"},{value:"monotone",translation:"LayerStyleEditor.style.monotone"}],defaultValue:"linear",schemaIgnore:!0}}}}},labelValueSection:null!=e&&e.isEnabled("CLIENT_IM_3050")?{translation:"properties.dataPoints.linelabelmode",component:"panel-section",items:{labelItems:{component:"items",ref:"components",key:"line",items:gD("line.label.value","label.value",r,t)}}}:void 0}},axisTitleSection:null!=e&&e.isEnabled("CLIENT_IM_3050")?{translation:"properties.axis.title",component:"panel-section",items:{labelItems:{component:"items",ref:"components",key:"axis",items:gD("axis.title","axis.title",r,t)}}}:void 0,axisLabelSection:null!=e&&e.isEnabled("CLIENT_IM_3050")?{translation:"properties.axis.label",component:"panel-section",items:{labelItems:{component:"items",ref:"components",key:"axis",items:gD("axis.label.name","axis.label.name",r,t)}}}:void 0,legendTitleSection:null!=e&&e.isEnabled("CLIENT_IM_3051")?{translation:"properties.legend.title",component:"panel-section",items:{labelItems:{component:"items",ref:"components",key:"legend",items:gD("legend.title","legend.title",r,t)}}}:void 0,legendLabelSection:null!=e&&e.isEnabled("CLIENT_IM_3051")?{translation:"properties.legend.label",component:"panel-section",items:{labelItems:{component:"items",ref:"components",key:"legend",items:gD("legend.label","legend.label",r,t)}}}:void 0}};const i={component:"dropdown",type:"string",expression:"optional",baseRef:"style.strokeWidth",translation:"LayerStyleEditor.style.strokeWidth",show:!0,defaultValue:"none",options:[{value:"none",translation:"LayerStyleEditor.style.strokeWidth.none"},{value:"small",translation:"LayerStyleEditor.style.strokeWidth.small"},{value:"medium",translation:"LayerStyleEditor.style.strokeWidth.medium"},{value:"large",translation:"LayerStyleEditor.style.strokeWidth.large"}]},o={component:"color-picker",type:"object",baseRef:"style.strokeColor",translation:"LayerStyleEditor.style.strokeColor",dualOutput:!0,show:e=>"none"!==Bf(e,`${((e,t)=>{let n=-1;for(let r=0;r<e.length;r++)if(e[r].key===t){n=r;break}return n})(e,"bar")}.${i.baseRef}`),defaultValue:()=>({index:-1,color:"#205891"})},a={component:"slider",type:"number",expression:"optional",baseRef:"style.width",translation:"LayerStyleEditor.style.barWidth",show:(e,t,n)=>{const r=t.getMeasures().some((e=>lv(e.qDef.series)===cl.TYPE.LINE));return!ue.continuous(n.layout,r&&re.isTime(!0,n.layout))},defaultValue:.7,min:.01,max:1,step:.01},s={component:"slider",type:"number",expression:"optional",baseRef:"style.dataPointSize",translation:"LayerStyleEditor.style.dataPointSize",show:!0,defaultValue:6,min:3,max:20,step:1},l={component:"slider",type:"number",expression:"optional",baseRef:"style.lineThickness",translation:"LayerStyleEditor.style.lineThickness",show:!0,defaultValue:1,min:1,max:5,step:1},u={component:"dropdown",type:"string",expression:"optional",baseRef:"style.lineType",translation:"LayerStyleEditor.style.lineType",show:!0,defaultValue:"solid",options:[{value:"solid",translation:"LayerStyleEditor.style.solid"},{value:"dashed",translation:"LayerStyleEditor.style.dashed"}]},c={component:"dropdown",type:"string",expression:"optional",baseRef:"style.lineCurve",translation:"LayerStyleEditor.style.lineCurve",show:!0,defaultValue:"linear",options:[{value:"linear",translation:"LayerStyleEditor.style.linear"},{value:"monotone",translation:"LayerStyleEditor.style.monotone"}]};return{component:"style-editor",translation:"LayerStyleEditor.component.styling",subtitle:"LayerStyleEditor.component.styling",resetBtnTranslation:"LayerStyleEditor.component.resetAll",key:["bar","line"],ref:"components",defaultValue:[],defaultValues(e){const t="grouped"===e.barGrouping.grouping,n=e.qHyperCubeDef.qMeasures.filter((e=>lv(e.qDef.series)===cl.TYPE.BAR)).length,r=t&&n>1;return[{key:"bar",style:{strokeWidth:i.defaultValue,strokeColor:o.defaultValue(),width:r?.9:.7}},{key:"line",style:{dataPointSize:s.defaultValue,lineThickness:l.defaultValue,lineType:u.defaultValue,lineCurve:c.defaultValue}}]},items:{list:{type:"items",component:"expandable-items",items:{bar:{type:"items",translation:"Visualizations.Descriptions.Bar",expanded:!0,styleKey:"bar",items:{barStrokeWidth:i,barStrokeColor:o,barWidth:a}},line:{type:"items",translation:"Visualizations.Descriptions.Line",expanded:!0,styleKey:"line",items:{dataPointSize:s,lineThickness:l,lineType:u,lineCurve:c}}}}}}}const vD={classification:{section:"styling",tags:["simple"],exclusive:!0},component:"items",show:!0,chartType:"combochart",translation:"LayerStyleEditor.component.styling",chartTitle:"Object.ComboChart",subtitle:"LayerStyleEditor.component.styling",useGeneral:!0,items:{barsSection:{component:"items",items:{wrapperItem:{component:"items",ref:"components",key:"bar",items:{barsHeader:{component:"header",translation:"Visualizations.Descriptions.Bars"},outlineSection:{component:"items",items:{barStroke:{component:"inline-wrapper",items:{strokeWidth:{ref:"style.strokeWidth",width:!0,component:"dropdown",translation:"LayerStyleEditor.style.strokeWidth",options:[{translation:"Common.None",value:"none"},{translation:"Common.Small",value:"small"},{translation:"Common.Medium",value:"medium"},{translation:"Common.Large",value:"large"}],defaultValue:"none",schemaIgnore:!0},strokeColor:{ref:"style.strokeColor",schemaIgnore:!0,defaultValue:{color:"#205891"},width:"auto",component:"color-picker"}}}}},widthSection:{component:"items",items:{barWidth:{component:"items",items:{width:{ref:"style.width",translation:"LayerStyleEditor.style.barWidth",component:"slider",min:.01,max:1,step:.01,schemaIgnore:!0,defaultValue:.7}}}}}}}}},linesSection:{component:"items",items:{wrapperItem:{component:"items",items:{linesHeader:{component:"header",translation:"Visualizations.Descriptions.Lines"},dataPointSection:{component:"items",items:{dataPointSize:{component:"items",ref:"components",key:"line",items:{size:{ref:"style.dataPointSize",translation:"LayerStyleEditor.style.dataPointSize",component:"slider",min:3,max:20,step:1,defaultValue:6,schemaIgnore:!0}}}}},lineSection:{component:"items",items:{wrapperItem:{component:"items",ref:"components",key:"line",items:{size:{ref:"style.lineThickness",translation:"LayerStyleEditor.style.lineThickness",component:"slider",defaultValue:1,min:1,max:5,step:1,schemaIgnore:!0},type:{ref:"style.lineType",translation:"LayerStyleEditor.style.lineType",component:"dropdown",width:"auto",grouped:!0,options:[{value:"solid",translation:"LayerStyleEditor.style.solid"},{value:"dashed",translation:"LayerStyleEditor.style.dashed"}],defaultValue:"solid",schemaIgnore:!0},curve:{ref:"style.lineCurve",translation:"LayerStyleEditor.style.lineCurve",component:"dropdown",width:"auto",grouped:!0,options:[{value:"linear",translation:"LayerStyleEditor.style.linear"},{value:"monotone",translation:"LayerStyleEditor.style.monotone"}],defaultValue:"linear",schemaIgnore:!0}}}}}}}}},optionsSection:{component:"items",items:{wrapperItem:{component:"items",items:{optionsHeader:{component:"header",translation:"LayerStyleEditor.label.Options"},scrollStartPos:{ref:"scrollStartPos",translation:"properties.ScrollAlignment",component:"dropdown",defaultValue:0,options:[{value:0,translation:"properties.ScrollAlignStart"},{value:1,translation:"properties.ScrollAlignEnd"}]},dataPoints:{ref:"dataPoint.show",translation:"properties.dataPoints.showDataPoints",type:"boolean",defaultValue:!1}}}}}}};function bD(e){const t=Bf(e,"qHyperCube.qMeasureInfo",[]).some((({series:e=cl.NOPE_SERIES})=>lv(e)===cl.TYPE.LINE));return ue.continuous(e,(()=>t&&re.isTime(!0,e)))}function xD(e){var t,n;return!(null===(t=e.qDef)||void 0===t||null===(n=t.color)||void 0===n||!n.on)}function MD(e){var t,n,r;return xD(e)&&"primary"===(null!==(t=null===(n=e.qDef)||void 0===n||null===(r=n.color)||void 0===r?void 0:r.mode)&&void 0!==t?t:"primary")}function SD(e){var t,n;return xD(e)&&"byExpression"===(null===(t=e.qDef)||void 0===t||null===(n=t.color)||void 0===n?void 0:n.mode)}function ED(e){var t,n,r,i,o;if(null!=e&&null!==(t=e.color)&&void 0!==t&&t.auto||"byExpression"!==(null==e||null===(n=e.color)||void 0===n?void 0:n.mode))return[];const a=null==e||null===(r=e.color)||void 0===r?void 0:r.colorExpression,s=null!==(i=null==e||null===(o=e.color)||void 0===o?void 0:o.expressionLabel)&&void 0!==i?i:"";return a?[{qExpression:a,label:s,id:"colorByExpression"}]:[]}function CD(e){return SD(e)?[{qExpression:e.qDef.color.colorExpression,id:"colorByMeasureExpression"}]:[]}function qD(e){var t,n;(null!==(t=null==e||null===(n=e.qHyperCubeDef)||void 0===n?void 0:n.qMeasures)&&void 0!==t?t:[]).forEach(((t,n)=>function(e,t,n){e.qAttributeExpressions=0===t?[...ED(n),...CD(e)]:CD(e)}(t,n,e)))}function wD(e){var t,n;const r={ref:"qDef.series.type",type:"string",component:"item-selection-list",defaultValue:"bar",schemaIgnore:!0,horizontal:!0,items:[{icon:e=>"stacked"===e.barGrouping.grouping||bD(e)?"stacked":"grouped",component:"icon-item",labelPlacement:"bottom",translation:"properties.style.bar",value:"bar"},{icon:"line_chart_line",component:"icon-item",labelPlacement:"bottom",translation:"properties.style.line",value:"line"},{icon:"shapes",component:"icon-item",labelPlacement:"bottom",translation:"properties.style.marker",value:"marker"}]},i={ref:"qDef.series.marker",type:"string",component:"dropdown",defaultValue:"circle",options:[{translation:"properties.marker.circle",value:"circle"},{translation:"properties.marker.rect",value:"rect"},{translation:"properties.marker.diamond",value:"diamond"},{translation:"properties.marker.triangle",value:"triangle"},{translation:"properties.marker.line",value:"line"}],show(e){var t;return lv(null===(t=e.qDef)||void 0===t?void 0:t.series)===cl.TYPE.MARKER}},o={ref:"qDef.series.markerFill",translation:"properties.series.fill",type:"boolean",defaultValue:!0,show(e){var t;return lv(null===(t=e.qDef)||void 0===t?void 0:t.series)===cl.TYPE.MARKER&&!["line"].includes(e.qDef.series.marker)}},a={ref:"qDef.color.mode",type:"string",component:"dropdown",options:[{value:"primary",translation:"properties.colorMode.primary"},{value:"byExpression",translation:"properties.colorMode.byExpression"}],defaultValue:"primary",show:(...e)=>xD(...e)},s=null===(t=e.anything)||void 0===t||null===(n=t.sense)||void 0===n?void 0:n.theme;return{items:{series:{type:"items",items:{supPanel:{translation:"properties.measure.moreProperties",title:"properties.measure.moreProperties",subTitle:(e,t,n)=>{var r;return null===(r=n.measureTitle)||void 0===r?void 0:r.call(n)},component:"sub-panel",type:"items",items:{groups:{type:"items",component:"expandable-items",items:{presentation:{type:"items",translation:"properties.presentation",items:{seriesType:r,seriesAxis:{ref:"qDef.series.axis",type:"integer",component:"dropdown",defaultValue:0,options:[{translation:"properties.axis.primary",value:0},{translation:"properties.axis.secondary",value:1}]},seriesMarker:i,seriesMarkerFill:o}},color:{type:"items",translation:"properties.color",items:{customColor:{ref:"qDef.color.on",translation:"properties.colors",type:"boolean",component:"switch",defaultValue:!1,trueOption:{value:!1,translation:"Common.Auto"},falseOption:{value:!0,translation:"Common.Custom"}},colorMode:a,paletteColor:{ref:"qDef.color.paletteColor",translation:"properties.color",type:"object",component:"color-picker",dualOutput:!0,defaultValue:()=>{var e;const{primary:t}=s.getDataColorSpecials(),n=null===(e=s.getDataColorPickerPalettes()[0])||void 0===e?void 0:e.colors,r=n.indexOf(t);return{index:-1===r?Math.min(6,n.length-1):r}},show:MD},attributeExpression:{type:"string",component:"expression",expressionType:"measure",schemaIgnore:!0,ref:"qDef.color.colorExpression",translation:"Common.Expression",show:SD}}}}}}}}}}}}const AD=10,OD=!0;function DD(e,t,n){let r;const i=n||0;var o,a;t?r=t.getMeasureLayouts():r=null!==(o=null==e||null===(a=e.qHyperCubeDef)||void 0===a?void 0:a.qMeasures)&&void 0!==o?o:[];return r.filter((e=>{const{series:t}=e||{};return 0===i?JE(t,OD):!JE(t,OD)}))}function ND(e,t){return t.getMeasures().filter((e=>lv(e.qDef.series)===cl.TYPE.LINE)).length>0}function ID(e,t,n){const r=t.getMeasures().filter((e=>lv(e.qDef.series)===cl.TYPE.BAR));return r.filter((e=>e.qDef.series.axis!==cl.AXIS.SECONDARY)).length>n||r.filter((e=>e.qDef.series.axis===cl.AXIS.SECONDARY)).length>n}const TD=(e,t,n,r)=>{const i="vertical"===t.layout.orientation||bD(t.layout)?"y":"x",o=DD(e,t,r).map((e=>e.qFallbackTitle));let a;return a=o.length?n.get(`properties.${i}AxisWithInfo`,[o.join(",")]):n.get(`properties.${i}Axis`),a};function LD(e){var t,n,r,i,o;const{translator:a,flags:s,anything:l}=e,u=null==e||null===(t=e.anything)||void 0===t||null===(n=t.sense)||void 0===n?void 0:n.theme,c=null==e||null===(r=e.anything)||void 0===r||null===(i=r.sense)||void 0===i||null===(o=i.isUnsupportedFeature)||void 0===o?void 0:o.call(i,"continuousData"),d={items:{attributeExpression:{ref:"color.colorExpression",change:null,globalChange:e=>qD(e)},expressionLabel:{change:null},disclaimer:{component:"text",translation:"properties.color.colorOnMeasureDisclaimer",style:"hint",show:e=>e.qHyperCubeDef.qMeasures.some((e=>xD(e)))}}},m=e=>!!e&&(e.coloring&&e.coloring.baseColor&&e.coloring.baseColor.color?e.coloring.baseColor:!(!e.baseColor||!e.baseColor.color)&&e.baseColor);const f=(e,t)=>!Bf(e,"color.auto")&&"primary"===Bf(e,"color.mode")&&!((e=>Bf(e,"layout.qHyperCube.qMeasureInfo",[]).filter((e=>!!m(e))).length>0)(t)&&"measure"===Bf(e,"color.useBaseColors")||function(e){return Bf(e,"layout.qHyperCube.qDimensionInfo",[]).filter((e=>!!m(e))).length>0}(t)&&"dimension"===Bf(e,"color.useBaseColors")),p=(e,t)=>{var n,r;return e.qHyperCubeDef.qMeasures.some((e=>xD(e)))||!s.isEnabled("SIMPLE_PROPERTIES_LIBRARY_COLOR")&&!(null!=e&&null!==(n=e.color)&&void 0!==n&&n.auto||"primary"!==(null==e||null===(r=e.color)||void 0===r?void 0:r.mode)||f(e,t))},h={items:{disclaimer:{show:(e,t)=>p(e,t),reset:e=>{e.qHyperCubeDef.qMeasures.forEach((e=>{var t;Bf(t=e,"qDef.color.on",void 0)&&Yf(t,"qDef.color.on",!1)}))}},simpleItems:{show:(e,t)=>!p(e,t)}}},g={items:{labels:{items:{header:{show:e=>e.qHyperCubeDef.qDimensions.length&&e.qHyperCubeDef.qMeasures.length},barLabels:{component:"checkbox",ref:"dataPoint.showBarLabels",type:"boolean",translation:"Simple.Label.Bar",show:(e,t)=>e.qHyperCubeDef.qDimensions.length&&e.qHyperCubeDef.qMeasures.length&&ID(0,t,0)},lineLabels:{component:"checkbox",ref:"dataPoint.showLineLabels",type:"boolean",translation:"Simple.Label.Line",show:(e,t)=>e.qHyperCubeDef.qDimensions.length&&e.qHyperCubeDef.qMeasures.length&&ND(0,t),convertFunctions:{get:(e,t,n,r)=>r.dataPoint.show&&r.dataPoint.showLineLabels,set(e,t,n,r,i){i.dataPoint.showLineLabels=e,i.dataPoint.show=e}},reset(e){Yf(e,"dataPoint.show",!1),Yf(e,"dataPoint.showLineLabels",!1)}},dimensionTitle:{component:"checkbox",ref:"dimensionAxis.show",type:"string",translation:"Simple.Label.Dimension.Hide",defaultValue:"all",show:e=>e.qHyperCubeDef.qDimensions.length&&e.qHyperCubeDef.qMeasures.length,convertFunctions:{get:(e,t,n,r)=>"labels"===r.dimensionAxis.show||"none"===r.dimensionAxis.show,set(e,t,n,r,i){i.dimensionAxis.show=e?"labels":"all"}}},primaryMeasureTitle:{component:"checkbox",ref:"measureAxes.0.show",type:"string",label:(e,t)=>a.get(DD(e,t,1).length>0?"Simple.Label.PrimaryMeasure.Hide":"Simple.Label.Measure.Hide"),defaultValue:"all",show:(e,t)=>e.qHyperCubeDef.qDimensions.length&&e.qHyperCubeDef.qMeasures.length&&DD(e,t,0).length>0,convertFunctions:{get:(e,t,n,r)=>"labels"===r.measureAxes[0].show||"none"===r.measureAxes[0].show,set(e,t,n,r,i){i.measureAxes[0].show=e?"labels":"all"}}},secondaryMeasureTitle:{component:"checkbox",ref:"measureAxes.1.show",type:"string",translation:"Simple.Label.SecondaryMeasure.Hide",defaultValue:"all",show:(e,t)=>e.qHyperCubeDef.qDimensions.length&&e.qHyperCubeDef.qMeasures.length&&DD(e,t,1).length>0,convertFunctions:{get:(e,t,n,r)=>"labels"===r.measureAxes[1].show||"none"===r.measureAxes[1].show,set(e,t,n,r,i){i.measureAxes[1].show=e?"labels":"all"}}}}}}},y={uses:"settings",items:{simpleStyling:null!=s&&s.isEnabled("COMBOCHART_SIMPLE_STYLING")?vD:void 0,simpleLabels:g,presentation:{type:"items",translation:"properties.presentation",grouped:!0,items:{comboStyling:yD(s,u,a),grouping:{ref:"barGrouping.grouping",type:"string",component:"item-selection-list",defaultValue:"grouped",horizontal:!0,items:[{icon:"grouped",component:"icon-item",labelPlacement:"bottom",translation:"properties.grouping.grouped",value:"grouped"},{icon:"stacked",component:"icon-item",labelPlacement:"bottom",translation:"properties.grouping.stacked",value:"stacked"}],show:(e,t,n)=>ID(0,t,1)&&!bD(n.layout)},orientation:{ref:"orientation",type:"string",component:"item-selection-list",defaultValue:"vertical",horizontal:!0,items:[{component:"icon-item",icon:"bars_vertical",labelPlacement:"bottom",translation:"properties.orientation.vertical",value:"vertical"},{icon:"bars_horizontal",component:"icon-item",labelPlacement:"bottom",translation:"Common.Horizontal",value:"horizontal"}],readOnly:(e,t,n)=>bD(n.layout),convertFunctions:(v="vertical",{get:(e,t,n)=>bD(n.layout)?v:e(t.type),set(e,t,n,r){t(n.type,bD(r.layout)?v:e,v)}})},scrollStartPos:{ref:"scrollStartPos",type:"number",translation:"properties.ScrollAlignment",component:"dropdown",defaultValue:0,options:[{value:0,translation:"properties.ScrollAlignStart"},{value:1,translation:"properties.ScrollAlignEnd"}],show:(e,t,n)=>!bD(n.layout)},nullMode:{type:"string",component:"dropdown",ref:"nullMode",translation:"properties.nullMode",options:[{value:"gap",translation:"properties.nullMode.gap"},{value:"connect",translation:"properties.nullMode.connect"},{value:"zero",translation:"properties.nullMode.zero"}],defaultValue:"gap",show:(e,t)=>ND(0,t)},dataPointSettings:{type:"items",grouped:!1,snapshot:{tid:"property-dataPoint"},show:(e,t)=>ND(0,t),items:{dataPoints:{ref:"dataPoint.show",translation:"properties.dataPoints.showDataPoints",type:"boolean",defaultValue:!1},showLineDataPointLabels:{ref:"dataPoint.showLineLabels",translation:"properties.dataPoints.linelabelmode",type:"boolean",component:"switch",defaultValue:!1,show:e=>e.dataPoint&&e.dataPoint.show,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"properties.off"}]}}},showBarLabels:{ref:"dataPoint.showBarLabels",type:"boolean",translation:"properties.dataPoints.barlabelmode",component:"switch",show:(e,t)=>ID(0,t,0),defaultValue:!1,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"properties.off"}]}}},colorsAndLegend:{uses:"colorsAndLegend",items:{colors:d,simpleColors:h,legend:{items:{show:{snapshot:{tid:"property-legend"}}}}}},dimensionAxis:{uses:"axis.dimensionAxis",label(e,t){const n="vertical"===t.layout.orientation||bD(t.layout)?"x":"y",r=function(e,t){return t?t.getDimensionLayouts():e.qHyperCubeDef.qDimensions.map((e=>e.qDef))}(e,t).map((e=>e.qFallbackTitle||"")).join(", ");let i;return i=r?a.get(`properties.${n}AxisWithInfo`,[r]):a.get(`properties.${n}Axis`),i},items:{othersGroup:{items:{dock:{options(e,t){let n="Common.Bottom",r="Common.Top";return"vertical"===t.layout.orientation||bD(t.layout)||(n=e.yMirrorMode?"properties.dock.right":"properties.dock.left",r=e.yMirrorMode?"properties.dock.left":"properties.dock.right"),[{value:"near",translation:n},{value:"far",translation:r}]}}}},axisDisplaySettings:{type:"items",components:"items",show:(e,t,n)=>!bD(n.layout),items:{axisDisplayMode:{type:"string",translation:"properties.axis.displaymode",ref:"dimensionAxis.axisDisplayMode",component:"dropdown",defaultValue:"auto",options:[{value:"auto",translation:"properties.axis.displaymode.auto"},{value:"max",translation:"properties.axis.displaymode.max"},{value:"custom",translation:"properties.axis.displaymode.custom"}]},maxVisibleItems:{type:"integer",translation:"properties.axis.maxvisiblevalues",ref:"dimensionAxis.maxVisibleItems",expression:"optional",defaultValue:AD,show:e=>"custom"===e.dimensionAxis.axisDisplayMode,invalid(e){const{qDimensions:t,qMeasures:n}=e.qHyperCubeDef,{maxVisibleItems:r}=e.dimensionAxis;return r<0||r>1e4/(t.length+n.length)},globalChange(e){if("custom"===e.dimensionAxis.axisDisplayMode){const{qDimensions:t,qMeasures:n}=e.qHyperCubeDef,{maxVisibleItems:r}=e.dimensionAxis;r<1?e.dimensionAxis.maxVisibleItems=AD:r>1e4/(t.length+n.length)&&(e.dimensionAxis.maxVisibleItems=Math.min(r,Math.floor(1e4/(t.length+n.length))))}}},hint:{component:"text",translation:"properties.axis.maxvisiblevalues.hint.combochart",style:"hint",show:e=>["custom","max"].indexOf(e.dimensionAxis.axisDisplayMode)>-1}}}},continuousGroup:{show:!c}},measureAxis:{uses:"axis.measureAxis",label:(e,t)=>TD(e,t,a,0),show:(e,t)=>DD(e,t,0).length>0,items:{axis:{items:{measureAxisTitle:{component:"header",type:"string",label:(e,t)=>TD(e,t,a,0),show:(e,t)=>DD(e,t,0).length>0,classification:{section:"axis",tags:["simple"],exclusive:!0}},show:{ref:"measureAxes.0.show",snapshot:{title:"properties.axis.primary",tid:"property-primary-axis",show(e){var t;return((null==e||null===(t=e.qHyperCube)||void 0===t?void 0:t.qMeasureInfo)||[]).some((e=>(null==e?void 0:e.series)&&JE(null==e?void 0:e.series,OD)))}}},dock:{ref:"measureAxes.0.dock",show:(e,t)=>"none"!==e.measureAxes[0].show&&DD(e,t,0).length>0,options(e,t){let n="Common.Bottom",r="Common.Top";return("vertical"===t.layout.orientation||bD(t.layout))&&(n=e.yMirrorMode?"properties.dock.right":"properties.dock.left",r=e.yMirrorMode?"properties.dock.left":"properties.dock.right"),[{value:"near",translation:n},{value:"far",translation:r}]}},spacing:{ref:"measureAxes.0.spacing",show:(e,t)=>e.measureAxes[0]&&"none"!==e.measureAxes[0].show&&DD(e,t,0).length>0}}},minMax:{items:{autoMinMax:{ref:"measureAxes.0.autoMinMax"},minMax:{ref:"measureAxes.0.minMax",defaultValue:"min",show:e=>!e.measureAxes[0].autoMinMax},min:{ref:"measureAxes.0.min",show:e=>["min","minMax"].includes(e.measureAxes[0].minMax)&&!e.measureAxes[0].autoMinMax,invalid:e=>"minMax"===e.measureAxes[0].minMax&&e.measureAxes[0].min>=e.measureAxes[0].max},max:{ref:"measureAxes.0.max",show:e=>["max","minMax"].includes(e.measureAxes[0].minMax)&&!e.measureAxes[0].autoMinMax,invalid:e=>"minMax"===e.measureAxes[0].minMax&&e.measureAxes[0].min>=e.measureAxes[0].max}}},startAt:{type:"string",component:"dropdown",translation:"properties.axis.startAt",show:(e,t)=>DD(e,t,0).length>0,readOnly:e=>!(e.measureAxes[0].autoMinMax||"min"===e.measureAxes[0].minMax&&0===e.measureAxes[0].min),options:[{value:"zero",translation:"properties.axis.startAt.zero"},{value:"lowest",translation:"properties.axis.startAt.lowest"}],defaultValue:"lowest",convertFunctions:{get(e,t,n,r){const{autoMinMax:i,minMax:o,min:a}=(null==r?void 0:r.measureAxes[0])||{};return!0===i?"lowest":i||"min"!==o||0!==a?e(t.type):"zero"},set(e,t,n,r,i){"zero"===e?(Yf(i,"measureAxes.0.autoMinMax",!1),Yf(i,"measureAxes.0.minMax","min"),Yf(i,"measureAxes.0.min",0)):Yf(i,"measureAxes.0.autoMinMax",!0)}},classification:{section:"axis",tags:["simple"],exclusive:!0}}}},secondaryMeasureAxis:{uses:"axis.measureAxis",label:(e,t)=>TD(e,t,a,1),show:(e,t)=>DD(e,t,1).length>0,items:{axis:{items:{measureAxisTitle:{component:"header",type:"string",label:(e,t)=>TD(e,t,a,1),show:(e,t)=>DD(e,t,1).length>0,classification:{section:"axis",tags:["simple"],exclusive:!0}},show:{ref:"measureAxes.1.show",snapshot:{title:"properties.axis.secondary",tid:"property-secondary-Axis",show(e){var t;return((null==e||null===(t=e.qHyperCube)||void 0===t?void 0:t.qMeasureInfo)||[]).some((e=>(null==e?void 0:e.series)&&!JE(null==e?void 0:e.series,OD)))}}},dock:{ref:"measureAxes.1.dock",defaultValue:"far",show:(e,t)=>"none"!==e.measureAxes[1].show&&DD(e,t,1).length>0,options(e,t){let n="Common.Bottom",r="Common.Top";return("vertical"===t.layout.orientation||bD(t.layout))&&(n=e.yMirrorMode?"properties.dock.right":"properties.dock.left",r=e.yMirrorMode?"properties.dock.left":"properties.dock.right"),[{value:"near",translation:n},{value:"far",translation:r}]}},spacing:{ref:"measureAxes.1.spacing",show:(e,t)=>e.measureAxes[1]&&"none"!==e.measureAxes[1].show&&DD(e,t,1).length>0}}},minMax:{type:"items",items:{autoMinMax:{ref:"measureAxes.1.autoMinMax"},minMax:{ref:"measureAxes.1.minMax",defaultValue:"min",show:e=>!e.measureAxes[1].autoMinMax},min:{ref:"measureAxes.1.min",show:e=>["min","minMax"].includes(e.measureAxes[1].minMax)&&!e.measureAxes[1].autoMinMax,invalid:e=>"minMax"===e.measureAxes[1].minMax&&e.measureAxes[1].min>=e.measureAxes[1].max},max:{ref:"measureAxes.1.max",show:e=>["max","minMax"].includes(e.measureAxes[1].minMax)&&!e.measureAxes[1].autoMinMax,invalid:e=>"minMax"===e.measureAxes[1].minMax&&e.measureAxes[1].min>=e.measureAxes[1].max}}},startAt:{type:"string",component:"dropdown",translation:"properties.axis.startAt",show:(e,t)=>DD(e,t,1).length>0,readOnly:e=>!(e.measureAxes[1].autoMinMax||"min"===e.measureAxes[1].minMax&&0===e.measureAxes[1].min),options:[{value:"zero",translation:"properties.axis.startAt.zero"},{value:"lowest",translation:"properties.axis.startAt.lowest"}],defaultValue:"lowest",convertFunctions:{get(e,t,n,r){const{autoMinMax:i,minMax:o,min:a}=(null==r?void 0:r.measureAxes[1])||{};return!0===i?"lowest":i||"min"!==o||0!==a?e(t.type):"zero"},set(e,t,n,r,i){"zero"===e?(Yf(i,"measureAxes.1.autoMinMax",!1),Yf(i,"measureAxes.1.minMax","min"),Yf(i,"measureAxes.1.min",0)):Yf(i,"measureAxes.1.autoMinMax",!0)}},classification:{section:"axis",tags:["simple"],exclusive:!0}}}},tooltips:{uses:"tooltip"}}};var v;s.isEnabled("SENSECLIENT_LAYERED_LABELS")&&(y.items.dimensionAxis.items.othersGroup.items.label={options:[{value:"auto",translation:"Common.Auto"},{value:"horizontal",translation:"Common.Horizontal"},{value:"tilted",translation:"properties.labels.tilted"},{value:"layered",translation:"properties.labels.layered"}]});const b={uses:"data",items:{dimensions:{items:{nullSuppression:{show(e,t,n){var r,i;if(null!=l&&null!==(r=l.sense)&&void 0!==r&&null!==(i=r.isUnsupportedFeature)&&void 0!==i&&i.call(r,"includeZeroValues"))return!1;return!bD(n.layout)}}}},measures:wD(e)}},x={type:"items",component:"expandable-items",translation:"properties.addons",items:{dataHandling:{uses:"dataHandling",items:{calcCond:{uses:"calcCond"}}},primaryMeasureAxisRefLines:{uses:"reflines",ref:"refLine.refLines",translation:"properties.primaryMeasureAxisReferenceLines",title:{translation:"properties.primaryMeasureAxisReferenceLines.tooltip"},show:e=>function(e,t){return e.some((e=>JE(e.qDef.series,t)))}(e.qHyperCubeDef.qMeasures,OD)},secondaryMeasureAxisRefLines:{uses:"reflines",ref:"refLine.refLines2",translation:"properties.secondaryMeasureAxisReferenceLines",title:{translation:"properties.secondaryMeasureAxisReferenceLines.tooltip"},show:e=>function(e,t){return e.some((e=>!JE(e.qDef.series,t)))}(e.qHyperCubeDef.qMeasures,OD)},dimRefLines:{uses:"dimReflines"}}};return{type:"items",component:"accordion",items:{data:b,sorting:{uses:"sortingWithDisclaimer"},addons:x,settings:y}}}function kD(e){return e.qHyperCubeDef.qMeasures.filter((e=>lv(e.qDef.series)===cl.TYPE.LINE)).length>0}function RD(){return{type:"items",component:"accordion",items:{data:{uses:"data"},sort:{uses:"sortWithDisclaimer"},presentation:{uses:"presentation",type:"items",translation:"properties.presentation",grouped:!0,show:(e,t)=>kD(e)||!bD(t),items:{grouping:{ref:"barGrouping.grouping",type:"string",component:"item-selection-list",horizontal:!0,items:[{icon:"grouped",component:"icon-item",labelPlacement:"bottom",translation:"properties.grouping.grouped",value:"grouped"},{icon:"stacked",component:"icon-item",labelPlacement:"bottom",translation:"properties.grouping.stacked",value:"stacked"}],show(e,t){var n;return function(e,t){const n=e.qHyperCubeDef.qMeasures.filter((e=>lv(e.qDef.series)===cl.TYPE.BAR));return t?n.filter((e=>e.qDef.series.axis===cl.AXIS.PRIMARY)).length>1||n.filter((e=>e.qDef.series.axis===cl.AXIS.SECONDARY)).length>1:n.length>1}(e,!Ow(null!==(n=null==e?void 0:e.version)&&void 0!==n?n:""))&&!bD(t)}},orientation:{ref:"orientation",type:"string",component:"item-selection-list",horizontal:!0,items:[{component:"icon-item",icon:"bars_vertical",labelPlacement:"bottom",translation:"properties.orientation.vertical",value:"vertical"},{icon:"bars_horizontal",component:"icon-item",labelPlacement:"bottom",translation:"Common.Horizontal",value:"horizontal"}],show:(e,t)=>!bD(t)},nullMode:{type:"string",component:"radio-list",ref:"nullMode",translation:"properties.nullMode",options:()=>[{value:"gap",translation:"properties.nullMode.gap"},{value:"connect",translation:"properties.nullMode.connect"},{value:"zero",translation:"properties.nullMode.zero"}],show:e=>kD(e)&&e.qHyperCubeDef.qMeasures.length>1},dataPoints:{ref:"dataPoint.show",translation:"properties.dataPoints.showDataPoints",type:"boolean",show:e=>kD(e)}}},color:{uses:"color",items:{disclaimer:{component:"text",translation:"properties.color.colorOnMeasureDisclaimer",style:"hint",show:e=>e.qHyperCubeDef.qMeasures.some((e=>xD(e)))}}}}}}const PD={bar:{axis:0,icon:"bar-chart",tid:"as-bar",translation:"contextMenu.asBar"},line:{axis:1,icon:"line-chart",tid:"as-line",translation:"contextMenu.asLine"},marker:{axis:1,icon:"shapes",tid:"as-marker",translation:"contextMenu.asMarker"}};function $D(e,t,n,r,i){const{axis:o,icon:a,tid:s,translation:l}=PD[i];t.addItem({icon:a,tid:s,translation:l,async select(){let t;t="measure"===e.type?await r.addLibraryMeasure(e.id):await r.addExpressionMeasure(e.name,""),t.qDef.series.type=i,t.qDef.series.axis=o,r.updateGlobalChangeListeners(),n.setProperties(r.properties),window.qvangularGlobal.$rootScope.$broadcast("pp-open-path",`data.${t.qDef.cId}`)}})}function FD(e,t,n,r,i){!function(e,t,n){const{item:r}=e,i=["contextMenu.add",r.name];if(n.canAddMeasure()){const o=e.menu.addItem({translation:i,tid:"add-as"});$D(r,o,t,n,"bar"),$D(r,o,t,n,"line"),$D(r,o,t,n,"marker")}}(e,n,t),t.getMeasures().length>=t.minMeasures()&&e.ReplaceMeasures(n,t,i),e.ColorBy(n,t,i),r()}function zD(e){const t={},{tooltip:n}=e;if(n){var r,i;t.chart_tooltip_custom=!n.auto;const e=null===(r=n.chart)||void 0===r||null===(i=r.object)||void 0===i?void 0:i.refId;!n.auto&&e&&(t.chart_tooltip_custom_mini_chart=e)}return t}const _D=e=>!!(e&&e.qHyperCube.qSize.qcy>0);function jD(e){return{definition:LD(e),softDefinition:RD(),support:{snapshot:_D,export:!0,exportData:!0,sharing:!1,viewData:!0,modifiers:["accumulation","movingAverage","difference","normalization"]},getDropMeasureOptions:FD,extendMetrics:zD,importProperties:(t,n,r,i)=>{const o={layout:{templateId:n.templateId}};r.mapProperties(o);const a={defaultDimension:r.getDefaultDimensionProperties(),defaultMeasure:r.getDefaultMeasureProperties()},s=uD.axisChart.importProperties({exportFormat:t,initialProperties:n,dataDefinition:pD(e),defaultPropertyValues:a,hypercubePath:i,extension:r});return function(e,t,n){const r="linechart"===n.properties.visualization,i=[];e.qProperty.qHyperCubeDef.qMeasures.forEach((e=>{e.qDef.series||(e.qDef.series={type:r?"line":"bar",axis:0,marker:"circle",markerFill:!0}),i.indexOf(e.qDef.series.axis)<0&&i.push(e.qDef.series.axis)}));const o=i.sort().shift();e.qProperty.measureAxes[o]&&n.properties.measureAxis&&void 0!==n.properties.measureAxis.autoMinMax&&G(!0,e.qProperty.measureAxes[o],n.properties.measureAxis,{logarithmic:!1}),qD(e.qProperty)}(s,0,t),s},exportProperties:(e,t,n)=>{!function(e){e.qProperty.qHyperCubeDef.qMeasures.forEach((e=>{e.qAttributeExpressions=[]}))}(e);return uD.axisChart.exportProperties({propertyTree:e,hyperCubePath:t,viewDataMode:n})},migrate:{properties:e=>e.qExtendsId?e:function(e){return Ow(e.version)&&(e.qHyperCubeDef.qMeasures.forEach((e=>{const{qDef:t}=e;void 0===t.series&&(t.series=cl.NOPE_SERIES),void 0===t.series.type&&(t.series.type=cl.NOPE_SERIES.type),void 0===t.series.axis&&(t.series.axis=t.series.type===cl.TYPE.BAR?cl.AXIS.PRIMARY:cl.AXIS.SECONDARY),t.series.type===cl.TYPE.BAR&&t.series.axis===cl.AXIS.SECONDARY&&(t.series.axis=cl.AXIS.PRIMARY)})),e.version=Aw.BAR_IN_SECONDARY_AXIS),e}(e)}}}function HD(a){var s,l;!function(e){if(e&&e.get&&e.add){const t="Object.Disclaimer.LimitedData";if(e.get(t)!==t)return;Object.keys($).forEach((t=>{e.add($[t])}))}}(a.translator);const{flags:u}=a,h=null===(s=a.anything)||void 0===s||null===(l=s.sense)||void 0===l?void 0:l.isUnsupportedFeature,g=(()=>{const e=S();return e.use(E),e.use(C(M)),e.use(HS),e.use(_S()),e.component("scrollbar",Dc),e.component("point-label",LE),e.component("label-space",kE),e.component("time-axis",tM.picassoComponents.timeAxis),e.component("axis-overlay",tM.picassoComponents.axisOverlay),e.component("reference-line-labels",ka),e.component("box-sliced-hat",ZS),e.component("box-out-of-bounds",WS),e.component("data-out-of-bounds-marker",RE),e.component("scroll-hint",Po),e.component("brush-highlighter",YE),e.scale("time",tM.picassoScales.time),e.symbol("line-point",PE),e})();return{qae:hD(a),ext:jD(a),component(){const a=function(){const[e,r]=t();return n((()=>r(Wf())),[]),e}(),s=nD(),l=function(){const e=d(),r=m(),i=c(),o=f(),[a,s]=t(),l=p();return n((()=>{s({options:{direction:"ltr",...e},translator:r,theme:o,embed:i,deviceType:l})}),[e.direction,e.freeResize,r.language(),o.name(),l]),a}(),y=oD(),M=function({picasso:r,environment:i}){const o=e(),[a,s]=t();return n((()=>{if(!i)return;o.style.overflow="hidden";const e=r({renderer:{prio:[i.options.renderer||"canvas"]}}).chart({element:o,data:[],settings:{}});s(e);const{destroy:t}=e;return()=>{t()}}),[i]),a}({picasso:g,environment:l}),S=function({chart:e,actions:r}){const i=v(),a=o(),[s,l]=t();return n((()=>{if(null==e||!e.update||!e.scale||!i)return null;const t=e.scale(ul.SCALE.MAJOR),n=ug({chart:e,actions:r,selections:i,config:{allowSimultaneous:!0,brushRanges:!0,majorScale:t,selectionActions:{reset(){e.brushSelectionIncludeMax=void 0,r.lasso.active()&&r.lasso.action(!1)},clear:aD},selectionEvents:{start:sD}}});n.setLayout(a);const{destroy:o}=n;return l(n),()=>{o()}}),[i,null==e?void 0:e.update,null==e?void 0:e.scale]),n((()=>{null!=s&&s.setLayout&&a&&s.setLayout(a)}),[a]),s}({chart:M,actions:y}),E=tD({picasso:g,chart:M,environment:l,flags:u,viewState:s,viewCache:a,actions:y,selectionService:S});qM({picasso:g,chart:M,models:E,environment:l,viewState:s,viewCache:a,actions:y}),(({picasso:e,chart:t,models:n,environment:o,viewState:a,viewCache:s,actions:l,isUnsupportedFeature:u})=>{const{width:c,height:d}=r(),[,m]=i((async()=>{if(!(null!=t&&t.update&&n&&o&&a))return;const{colorService:r,discreteModel:i,dockService:m,layoutService:f,refLineModel:p}=n;function h(){t.update({settings:MM({picasso:e,chart:t,models:n,environment:o,viewState:a,viewCache:s,actions:l,isUnsupportedFeature:u})})}m.update({width:c,height:d}),r.custom.updateLegend(),p.update({picasso:e,chart:t,models:n,environment:o,viewState:a,viewCache:s,actions:l});const g=f.getDataPages();f.setDataPages([]),h(),f.setDataPages(g),f.meta.isContinuous||await i.command.initialize(),h()}),[c,d]);if(m)throw m})({picasso:g,chart:M,models:E,environment:l,viewState:s,viewCache:a,actions:y,isUnsupportedFeature:h}),(({models:e,chart:t,viewState:n})=>{b((r=>{if(!e)return;const{layoutService:i,dockService:o,colorService:a,discreteModel:s,continuousModel:l,reducedModel:u}=e,{width:c,height:d}=o.meta.chart.size;return r.snapshotData=r.snapshotData||{},r.snapshotData.content={size:{w:c,h:d}},i.meta.isSnapshot?Promise.resolve():(r.snapshotData.content.chartData={scrollOffset:n.get("scrollOffset"),zoom:n.get("zoom"),legendScrollOffset:ce(t,ul.COMPONENT.LEGEND_CATEGORICAL)},i.meta.isDiscrete?(s.command.setSnapshotData(r),u.command.setSnapshotData(r)):l.setSnapshotData(r),a.getSnapshotData().then((e=>{r.snapshotData.content.chartData={...r.snapshotData.content.chartData,...e}})).catch((()=>{})))})),x((()=>({getViewState(){if(n&&t)return{scrollOffset:n.get("scrollOffset"),zoom:n.get("zoom"),legendScrollOffset:ce(t,ul.COMPONENT.LEGEND_CATEGORICAL)}}})),[n,t])})({models:E,chart:M,viewState:s})}}}export{HD as default};