@nebula.js/sn-distributionplot 1.0.3 → 1.0.4

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,10 +1,10 @@
1
1
  /*
2
- * @nebula.js/sn-distributionplot v1.0.2
2
+ * @nebula.js/sn-distributionplot v1.0.3
3
3
  * Copyright (c) 2025 QlikTech International AB
4
4
  * Released under the MIT license.
5
5
  */
6
6
 
7
- import{useConstraints as e,useState as t,useLayout as n,useEffect as r,useAction as i,useRect as o,useOptions as a,usePromise as s,useApp as l,useAppLayout as u,useDeviceType as c,useTheme as p,useTranslator as d,useMemo as f,onTakeSnapshot as h,useImperativeHandle as m,useElement as g,useSelections as y,useStaleLayout as b,useModel as v,useRenderState as q}from"@nebula.js/stardust";import x from"jquery";import D from"picasso.js";import S from"picasso-plugin-q";import C from"picasso-plugin-hammer";import M from"hammerjs";import E from"extend";var A={"Visualization.Histogram.MeasureAxisLabel":{id:"Visualization.Histogram.MeasureAxisLabel",locale:{"en-US":"Frequency","zh-TW":"頻率","zh-CN":"频率","tr-TR":"Sıklık","sv-SE":"Frekvens","it-IT":"Frequenza","es-ES":"Frecuencia","de-DE":"Häufigkeit","pl-PL":"Częstotliwość","nl-NL":"Frequentie","ko-KR":"빈도","pt-BR":"Frequência","fr-FR":"Fréquence","ja-JP":"レコード数","ru-RU":"Частота"}},"waterfall.legend.positiveValue.label":{id:"waterfall.legend.positiveValue.label",locale:{"en-US":"Positive","zh-TW":"正值","zh-CN":"正","tr-TR":"Pozitif","sv-SE":"Positiv","it-IT":"Positivi","es-ES":"Positivo","de-DE":"Positiv","pl-PL":"Dodatnie","nl-NL":"Positief","ko-KR":"양수","pt-BR":"Positivo","fr-FR":"Positive","ja-JP":"正","ru-RU":"Положительное"}},"waterfall.legend.negativeValue.label":{id:"waterfall.legend.negativeValue.label",locale:{"en-US":"Negative","zh-TW":"負值","zh-CN":"负","tr-TR":"Negatif","sv-SE":"Negativ","it-IT":"Negativi","es-ES":"Negativo","de-DE":"Negativ","pl-PL":"Ujemne","nl-NL":"Negatief","ko-KR":"음수","pt-BR":"Negativo","fr-FR":"Négative","ja-JP":"負","ru-RU":"Отрицательное"}},"waterfall.legend.subtotal.label":{id:"waterfall.legend.subtotal.label",locale:{"en-US":"Subtotal","zh-TW":"小計","zh-CN":"小计","tr-TR":"Ara Toplam","sv-SE":"Deltotal","it-IT":"Subtotale","es-ES":"Subtotal","de-DE":"Teilsumme","pl-PL":"Suma częściowa","nl-NL":"Subtotaal","ko-KR":"소계","pt-BR":"Subtotal","fr-FR":"Sous-total","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_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_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_RequireNumericDimension:{id:"Object.Disclaimer.RequireNumericDimension",locale:{"en-US":"This visualization requires a numeric diemnsion."}},"properties.boxplot.calculationMode.tukey.elements.boxEnd":{id:"properties.boxplot.calculationMode.tukey.elements.boxEnd",locale:{"en-US":"Third quartile","zh-TW":"第三四分位數","zh-CN":"第 3 个四分位","tr-TR":"Üçüncü çeyrek","sv-SE":"Tredje kvartilen","it-IT":"Terzo quartile","es-ES":"Tercer cuartil","de-DE":"Drittes Quartil","pl-PL":"Trzeci kwartyl","nl-NL":"Derde kwartiel","ko-KR":"3번째 사분위수","pt-BR":"Terceiro quartil","fr-FR":"Troisième quartile","ja-JP":"第 3 四分位数","ru-RU":"Третий квартиль"}},"properties.boxplot.calculationMode.tukey.elements.boxMiddle":{id:"properties.boxplot.calculationMode.tukey.elements.boxMiddle",locale:{"en-US":"Median","zh-TW":"中位數","zh-CN":"中间值","tr-TR":"Medyan","sv-SE":"Median","it-IT":"Mediana","es-ES":"Mediana","de-DE":"Drittes Quartil","pl-PL":"Mediana","nl-NL":"Mediaan","ko-KR":"중앙값","pt-BR":"Mediano","fr-FR":"Médiane","ja-JP":"中央値","ru-RU":"Медианное"}},"properties.boxplot.calculationMode.tukey.elements.boxStart":{id:"properties.boxplot.calculationMode.tukey.elements.boxStart",locale:{"en-US":"First quartile","zh-TW":"第一四分位數","zh-CN":"第 1 个四分位","tr-TR":"İlk çeyrek","sv-SE":"Första kvartilen","it-IT":"Primo quartile","es-ES":"Primer cuartil","de-DE":"Erstes Quartil","pl-PL":"Pierwszy kwartyl","nl-NL":"Eerste kwartiel","ko-KR":"1번째 사분위수","pt-BR":"Primeiro quartil","fr-FR":"Premier quartile","ja-JP":"第 1 四分位数","ru-RU":"Первый квартиль"}},"properties.boxplot.calculationMode.tukey.elements.firstWhisker":{id:"properties.boxplot.calculationMode.tukey.elements.firstWhisker",locale:{"en-US":"Box start - {0} IQR","zh-TW":"方塊開始 - {0} IQR","zh-CN":"框开始 - {0} IQR","tr-TR":"Kutu başlangıcı - {0} IQR","sv-SE":"Rutans start - {0} IQR","it-IT":"Inizio scatola - {0} IQR","es-ES":"Inicio de caja - {0} IQR","de-DE":"Box-Beginn - {0} IQR","pl-PL":"Początek wykresu pudełkowego - {0} IQR","nl-NL":"Begin box - {0} IQR","ko-KR":"상자 시작 - {0} IQR","pt-BR":"Início da caixa - {0} IQR","fr-FR":"Début de la boîte - {0} IQR","ja-JP":"ボックス開始 - {0} IQR","ru-RU":"Начало поля - {0} IQR"}},"properties.boxplot.calculationMode.tukey.elements.lastWhisker":{id:"properties.boxplot.calculationMode.tukey.elements.lastWhisker",locale:{"en-US":"Box end + {0} IQR","zh-TW":"方塊結束 + {0} IQR","zh-CN":"框结束 + {0} IQR","tr-TR":"Kutu bitişi + {0} IQR","sv-SE":"Rutans slut + {0} IQR","it-IT":"Fine scatola + {0} IQR","es-ES":"Fin de caja + {0} IQR","de-DE":"Box-Ende + {0} IQR","pl-PL":"Koniec wykresu pudełkowego - {0} IQR","nl-NL":"Einde box + {0} IQR","ko-KR":"상자 끝 + {0} IQR","pt-BR":"Fim da caixa + {0} IQR","fr-FR":"Fin de la boîte + {0} IQR","ja-JP":"ボックス終了 + {0} IQR","ru-RU":"Конец поля + {0} IQR"}},"properties.boxplot.calculationMode.stdDev.elements.boxEnd":{id:"properties.boxplot.calculationMode.stdDev.elements.boxEnd",locale:{"en-US":"Box middle + 1 standard deviation","zh-TW":"方塊中間 + 1 個標準差","zh-CN":"框中部 + 1 个标准偏差","tr-TR":"Kutu ortası + 1 standart sapma","sv-SE":"Rutans mitt + 1 standardavvikelse","it-IT":"Centro scatola + 1 deviazione standard","es-ES":"Mitad de la caja + 1 desviación estándar","de-DE":"Box-Mitte +1 Standardabweichung","pl-PL":"Środek wykresu pudełkowego + 1 odch. stand","nl-NL":"Midden box + 1 standaardafwijking","ko-KR":"상자 중간 + 1개 표준 편차","pt-BR":"Meio da caixa + 1 desvio padrão","fr-FR":"Milieu de la boîte + 1 écart type","ja-JP":"ボックス中間 + 1 標準偏差","ru-RU":"Середина поля + 1 стандартное отклонение"}},"properties.boxplot.calculationMode.stdDev.elements.boxMiddle":{id:"properties.boxplot.calculationMode.stdDev.elements.boxMiddle",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.boxplot.calculationMode.stdDev.elements.boxStart":{id:"properties.boxplot.calculationMode.stdDev.elements.boxStart",locale:{"en-US":"Box middle - 1 standard deviation","zh-TW":"方塊中間 - 1 個標準差","zh-CN":"框中部 - 1 个标准偏差","tr-TR":"Kutu ortası - 1 standart sapma","sv-SE":"Rutans mitt - 1 standardavvikelse","it-IT":"Centro scatola - 1 deviazione standard","es-ES":"Mitad de la caja - {1} desviación estándar","de-DE":"Box-Mitte -1 Standardabweichung","pl-PL":"Środek wykresu pudełkowego - 1 odch. stand","nl-NL":"Midden box - 1 standaardafwijking","ko-KR":"상자 중간 - 1개 표준 편차","pt-BR":"Середина поля - 1 стандартное отклонение","fr-FR":"Milieu de la boîte - 1 écart type","ja-JP":"ボックス中間 - 1 標準偏差","ru-RU":"Первый квартиль"}},"properties.boxplot.calculationMode.stdDev.elements.firstWhisker":{id:"properties.boxplot.calculationMode.stdDev.elements.firstWhisker",locale:{"en-US":"Box middle - {0} standard deviations","zh-TW":"方塊中間 - {0} 個標準差","zh-CN":"框中部 - {0} 个标准偏差","tr-TR":"Kutu ortası - {0} standart sapma","sv-SE":"Rutans mitt - {0} standardavvikelser","it-IT":"Centro scatola - {0} deviazioni standard","es-ES":"Mitad de la caja - {0} desviaciones estándar","de-DE":"Box-Mitte -{0} Standardabweichung","pl-PL":"Środek wykresu pudełkowego - {0} odch. stand","nl-NL":"Midden box - {0} standaardafwijkingen","ko-KR":"상자 중간 - {0}개 표준 편차","pt-BR":"Meio da caixa - {0} desvios padrão","fr-FR":"Milieu de la boîte - {0} écarts types","ja-JP":"ボックス中間 - {0} 標準偏差","ru-RU":"Середина поля - {0} стандартное(ых) отклонение(й)"}},"properties.boxplot.calculationMode.stdDev.elements.lastWhisker":{id:"properties.boxplot.calculationMode.stdDev.elements.lastWhisker",locale:{"en-US":"Box middle + {0} standard deviations","zh-TW":"方塊中間 + {0} 個標準差","zh-CN":"框中部 + {0} 个标准偏差","tr-TR":"Kutu ortası + {0} standart sapma","sv-SE":"Rutans mitt + {0} standardavvikelser","it-IT":"Centro scatola + {0} deviazioni standard","es-ES":"Mitad de la caja + {0} desviaciones estándar","de-DE":"Box-Mitte +{0} Standardabweichung","pl-PL":"Środek wykresu pudełkowego + {0} odch. stand","nl-NL":"Midden box + {0} standaardafwijkingen","ko-KR":"상자 중간 + {0}개 표준 편차","pt-BR":"Meio da caixa + {0} desvios padrão","fr-FR":"Milieu de la boîte + {0} écarts types","ja-JP":"ボックス中間 + {0} 標準偏差","ru-RU":"Середина поля + {0} стандартное(ых) отклонение(й)"}},"properties.boxplot.calculationMode.fractiles.elements.boxEnd":{id:"properties.boxplot.calculationMode.fractiles.elements.boxEnd",locale:{"en-US":"Third quartile","zh-TW":"第三四分位數","zh-CN":"第 3 个四分位","tr-TR":"Üçüncü çeyrek","sv-SE":"Tredje kvartilen","it-IT":"Terzo quartile<","es-ES":"Tercer cuartil","de-DE":"Drittes Quartil","pl-PL":"Trzeci kwartyl","nl-NL":"Derde kwartiel","ko-KR":"3번째 사분위수","pt-BR":"Terceiro quartil","fr-FR":"Troisième quartile","ja-JP":"第 3 四分位数","ru-RU":"Третий квартиль"}},"properties.boxplot.calculationMode.fractiles.elements.boxMiddle":{id:"properties.boxplot.calculationMode.fractiles.elements.boxMiddle",locale:{"en-US":"Median","zh-TW":"中位數","zh-CN":"中间值","tr-TR":"Medyan","sv-SE":"Median","it-IT":"Mediana","es-ES":"Mediana","de-DE":"Median","pl-PL":"Mediana","nl-NL":"Mediaan","ko-KR":"중앙값","pt-BR":"Mediano","fr-FR":"Médiane","ja-JP":"中央値","ru-RU":"Медианное"}},"properties.boxplot.calculationMode.fractiles.elements.boxStart":{id:"properties.boxplot.calculationMode.fractiles.elements.boxStart",locale:{"en-US":"First quartile","zh-TW":"第一四分位數","zh-CN":"第 1 个四分位","tr-TR":"İlk çeyrek","sv-SE":"Första kvartilen","it-IT":"Primo quartile","es-ES":"Primer cuartil","de-DE":"Erstes Quartil","pl-PL":"Pierwszy kwartyl","nl-NL":"Eerste kwartiel","ko-KR":"1번째 사분위수","pt-BR":"Primeiro quartil","fr-FR":"Premier quartile","ja-JP":"第 1 四分位数","ru-RU":"Первый квартиль"}},"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.fifth":{id:"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.fifth",locale:{"en-US":"5th percentile","zh-TW":"第 5 個百分位數","zh-CN":"第 5 个百分位","tr-TR":"5. yüzdebirlik","sv-SE":"5:e percentilen","it-IT":"5° percentile","es-ES":"5º percentil","de-DE":"5. Perzentil","pl-PL":"5. percentyl","nl-NL":"5e percentiel","ko-KR":"5번째 백분위수","pt-BR":"5º percentil","fr-FR":"5e centile","ja-JP":"5 番目のパーセンタイル","ru-RU":"5-й процентиль"}},"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.first":{id:"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.first",locale:{"en-US":"1st percentile","zh-TW":"第 1 個百分位數","zh-CN":"第 1 个百分位","tr-TR":"1. yüzdebirlik","sv-SE":"1:e percentilen","it-IT":"1° percentile","es-ES":"1er percentil","de-DE":"1. Perzentil","pl-PL":"1. percentyl","nl-NL":"1e percentiel","ko-KR":"1번째 백분위수","pt-BR":"1º percentil","fr-FR":"1er centile","ja-JP":"1 番目のパーセンタイル","ru-RU":"1-й процентиль"}},"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.min":{id:"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.min",locale:{"en-US":"Minimum","zh-TW":"最小","zh-CN":"最小值","tr-TR":"En az","sv-SE":"Min","it-IT":"Minimo","es-ES":"Mínimo","de-DE":"Minimum","pl-PL":"Minimum","nl-NL":"Minimum","ko-KR":"최소","pt-BR":"Mínimo","fr-FR":"Minimale","ja-JP":"最小値","ru-RU":"Минимум"}},"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.tenth":{id:"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.tenth",locale:{"en-US":"10th percentile","zh-TW":"第 10 個百分位數","zh-CN":"第 10 个百分位","tr-TR":"10. yüzdebirlik","sv-SE":"10:e percentilen","it-IT":"10° percentile","es-ES":"10º percentil","de-DE":"10. Perzentil","pl-PL":"10. percentyl","nl-NL":"10e percentiel","ko-KR":"10번째 백분위수","pt-BR":"10º percentil","fr-FR":"10e centile","ja-JP":"10 番目のパーセンタイル","ru-RU":"10-й процентиль"}},"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.max":{id:"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.max",locale:{"en-US":"Maximum","zh-TW":"最大","zh-CN":"最大值","tr-TR":"En fazla","sv-SE":"Max","it-IT":"Massimo","es-ES":"Máximo","de-DE":"Maximum","pl-PL":"Maksimum","nl-NL":"Maximum","ko-KR":"최대","pt-BR":"Máximo","fr-FR":"Maximale","ja-JP":"最大値","ru-RU":"Максимум"}},"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.ninetieth":{id:"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.ninetieth",locale:{"en-US":"90th percentile","zh-TW":"第 90 個百分位數","zh-CN":"第 90 个百分位","tr-TR":"90. yüzdebirlik","sv-SE":"90:e percentilen","it-IT":"90° percentile","es-ES":"90º percentil","de-DE":"90. Perzentil","pl-PL":"90. percentyl","nl-NL":"90e percentiel","ko-KR":"90번째 백분위수","pt-BR":"90º percentil","fr-FR":"90e centile","ja-JP":"90 番目の百分位数","ru-RU":"90-й процентиль"}},"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.ninetyfifth":{id:"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.ninetyfifth",locale:{"en-US":"95th percentile","zh-TW":"第 95 個百分位數","zh-CN":"第 95 个百分位","tr-TR":"95. yüzdebirlik","sv-SE":"95:e percentilen","it-IT":"95° percentile","es-ES":"95º percentil","de-DE":"95. Perzentil","pl-PL":"95. percentyl","nl-NL":"95e percentiel","ko-KR":"95번째 백분위수","pt-BR":"95º percentil","fr-FR":"95e centile","ja-JP":"95 番目の百分位数","ru-RU":"95-й процентиль"}},"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.ninetynineth":{id:"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.ninetynineth",locale:{"en-US":"99th percentile","zh-TW":"第 99 個百分位數","zh-CN":"第 99 个百分位","tr-TR":"99. yüzdebirlik","sv-SE":"99:e percentilen","it-IT":"99° percentile","es-ES":"99º percentil","de-DE":"99. Perzentil","pl-PL":"99. percentyl","nl-NL":"99e percentiel","ko-KR":"99번째 백분위수","pt-BR":"99º percentil","fr-FR":"99e centile","ja-JP":"99 番目の百分位数","ru-RU":"99-й процентиль"}}};function I(e){e.component("event-area",{mounted(e){e.classList.add("event-area"),e.style.pointerEvents="auto",e.style.zIndex=1},render:()=>[]})}var w={renderer:"dom",disableTriggers:!0,preferredSize:function(){return 22},render(e){const{settings:{label:t,rtl:n},layout:{dock:r}}=this.settings,i="top"!==r&&"bottom"!==r||!n?"ltr":"rtl",o=function(e,t){const n={pointerEvents:"auto",display:"flex",justifyContent:"center",alignItems:"center",color:"#7b7a78",fontStyle:"italic",fontSize:"13px"};switch(e){case"left":n.width=`${t.height}px`,n.transform=`rotate(-90deg) translate(-${t.height}px, 0)`,n.transformOrigin="top left";break;case"right":n.width=`${t.height}px`,n.transform=`rotate(90deg) translate(0, -${t.width}px)`,n.transformOrigin="top left";break;case"center":n.width=`${t.width}px`,n.height=`${t.height}px`,n.color="#595959",n.fontStyle="normal",n.fontSize="1.2em",n.textAlign="center";break;default:n.justifyContent="flex-start",n.alignItems="flex-start"}return n}(r,this.rect),a="center"===r?t:`* ${t}`,s="center"!==r?{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}:{};return e("div",{style:o,dir:i},e("span",{ref:this.alignToRef,style:s,title:a},a))}};const O={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"}}]};var T,k;function N(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var L=function(){if(k)return T;k=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===t.call(e)},o=function(n){if(!n||"[object Object]"!==t.call(n))return!1;var r,i=e.call(n,"constructor"),o=n.constructor&&n.constructor.prototype&&e.call(n.constructor.prototype,"isPrototypeOf");if(n.constructor&&!i&&!o)return!1;for(r in n);return void 0===r||e.call(n,r)},a=function(e,t){n&&"__proto__"===t.name?n(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},s=function(t,n){if("__proto__"===n){if(!e.call(t,n))return;if(r)return r(t,n).value}return t[n]};return T=function e(){var t,n,r,l,u,c,p=arguments[0],d=1,f=arguments.length,h=!1;for("boolean"==typeof p&&(h=p,p=arguments[1]||{},d=2),(null==p||"object"!=typeof p&&"function"!=typeof p)&&(p={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)r=s(p,n),p!==(l=s(t,n))&&(h&&l&&(o(l)||(u=i(l)))?(u?(u=!1,c=r&&i(r)?r:[]):c=r&&o(r)?r:{},a(p,{name:n,newValue:e(h,c,l)})):void 0!==l&&a(p,{name:n,newValue:l}));return p},T}();function P(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function _(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function R(){}N(L);var H=1/.7,F="\\s*([+-]?\\d+)\\s*",B="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",V="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",z=/^#([0-9a-f]{3,8})$/,j=new RegExp(`^rgb\\(${F},${F},${F}\\)$`),$=new RegExp(`^rgb\\(${V},${V},${V}\\)$`),U=new RegExp(`^rgba\\(${F},${F},${F},${B}\\)$`),W=new RegExp(`^rgba\\(${V},${V},${V},${B}\\)$`),K=new RegExp(`^hsl\\(${B},${V},${V}\\)$`),Y=new RegExp(`^hsla\\(${B},${V},${V},${B}\\)$`),G={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 X(){return this.rgb().formatHex()}function J(){return this.rgb().formatRgb()}function Z(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=z.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?Q(t):3===n?new re(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?ee(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?ee(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=j.exec(e))?new re(t[1],t[2],t[3],1):(t=$.exec(e))?new re(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=U.exec(e))?ee(t[1],t[2],t[3],t[4]):(t=W.exec(e))?ee(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=K.exec(e))?ue(t[1],t[2]/100,t[3]/100,1):(t=Y.exec(e))?ue(t[1],t[2]/100,t[3]/100,t[4]):G.hasOwnProperty(e)?Q(G[e]):"transparent"===e?new re(NaN,NaN,NaN,0):null}function Q(e){return new re(e>>16&255,e>>8&255,255&e,1)}function ee(e,t,n,r){return r<=0&&(e=t=n=NaN),new re(e,t,n,r)}function te(e){return e instanceof R||(e=Z(e)),e?new re((e=e.rgb()).r,e.g,e.b,e.opacity):new re}function ne(e,t,n,r){return 1===arguments.length?te(e):new re(e,t,n,null==r?1:r)}function re(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function ie(){return`#${le(this.r)}${le(this.g)}${le(this.b)}`}function oe(){const e=ae(this.opacity);return`${1===e?"rgb(":"rgba("}${se(this.r)}, ${se(this.g)}, ${se(this.b)}${1===e?")":`, ${e})`}`}function ae(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function se(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function le(e){return((e=se(e))<16?"0":"")+e.toString(16)}function ue(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new pe(e,t,n,r)}function ce(e){if(e instanceof pe)return new pe(e.h,e.s,e.l,e.opacity);if(e instanceof R||(e=Z(e)),!e)return new pe;if(e instanceof pe)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 pe(a,s,l,e.opacity)}function pe(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function de(e){return(e=(e||0)%360)<0?e+360:e}function fe(e){return Math.max(0,Math.min(1,e||0))}function he(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}P(R,Z,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:X,formatHex:X,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return ce(this).formatHsl()},formatRgb:J,toString:J}),P(re,ne,_(R,{brighter(e){return e=null==e?H:Math.pow(H,e),new re(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new re(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new re(se(this.r),se(this.g),se(this.b),ae(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:ie,formatHex:ie,formatHex8:function(){return`#${le(this.r)}${le(this.g)}${le(this.b)}${le(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:oe,toString:oe})),P(pe,function(e,t,n,r){return 1===arguments.length?ce(e):new pe(e,t,n,null==r?1:r)},_(R,{brighter(e){return e=null==e?H:Math.pow(H,e),new pe(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new pe(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 re(he(e>=240?e-240:e+120,i,r),he(e,i,r),he(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new pe(de(this.h),fe(this.s),fe(this.l),ae(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=ae(this.opacity);return`${1===e?"hsl(":"hsla("}${de(this.h)}, ${100*fe(this.s)}%, ${100*fe(this.l)}%${1===e?")":`, ${e})`}`}}));const me=Math.PI/180,ge=180/Math.PI,ye=4/29,be=6/29,ve=3*be*be;function qe(e){if(e instanceof xe)return new xe(e.l,e.a,e.b,e.opacity);if(e instanceof Ee)return Ae(e);e instanceof re||(e=te(e));var t,n,r=Me(e.r),i=Me(e.g),o=Me(e.b),a=De((.2225045*r+.7168786*i+.0606169*o)/1);return r===i&&i===o?t=n=a:(t=De((.4360747*r+.3850649*i+.1430804*o)/.96422),n=De((.0139322*r+.0971045*i+.7141733*o)/.82521)),new xe(116*a-16,500*(t-a),200*(a-n),e.opacity)}function xe(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function De(e){return e>.008856451679035631?Math.pow(e,1/3):e/ve+ye}function Se(e){return e>be?e*e*e:ve*(e-ye)}function Ce(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Me(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Ee(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function Ae(e){if(isNaN(e.h))return new xe(e.l,0,0,e.opacity);var t=e.h*me;return new xe(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}P(xe,function(e,t,n,r){return 1===arguments.length?qe(e):new xe(e,t,n,null==r?1:r)},_(R,{brighter(e){return new xe(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new xe(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 re(Ce(3.1338561*(t=.96422*Se(t))-1.6168667*(e=1*Se(e))-.4906146*(n=.82521*Se(n))),Ce(-.9787684*t+1.9161415*e+.033454*n),Ce(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),P(Ee,function(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof Ee)return new Ee(e.h,e.c,e.l,e.opacity);if(e instanceof xe||(e=qe(e)),0===e.a&&0===e.b)return new Ee(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*ge;return new Ee(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new Ee(e,t,n,null==r?1:r)},_(R,{brighter(e){return new Ee(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new Ee(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return Ae(this).rgb()}}));var Ie=-.14861,we=1.78277,Oe=-.29227,Te=-.90649,ke=1.97294,Ne=ke*Te,Le=ke*we,Pe=-.6557636667999999;function _e(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof Re)return new Re(e.h,e.s,e.l,e.opacity);e instanceof re||(e=te(e));var t=e.r/255,n=e.g/255,r=e.b/255,i=(Pe*r+Ne*t-Le*n)/-5.9615122912,o=r-i,a=(ke*(n-i)-Oe*o)/Te,s=Math.sqrt(a*a+o*o)/(ke*i*(1-i)),l=s?Math.atan2(a,o)*ge-120:NaN;return new Re(l<0?l+360:l,s,i,e.opacity)}(e):new Re(e,t,n,null==r?1:r)}function Re(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}P(Re,_e,_(R,{brighter(e){return e=null==e?H:Math.pow(H,e),new Re(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new Re(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*me,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),r=Math.cos(e),i=Math.sin(e);return new re(255*(t+n*(Ie*r+we*i)),255*(t+n*(Oe*r+Te*i)),255*(t+n*(ke*r)),this.opacity)}}));var He=e=>()=>e;function Fe(e,t){return function(n){return e+n*t}}function Be(e,t){var n=t-e;return n?Fe(e,n):He(isNaN(e)?t:e)}function Ve(e){return((e=Math.exp(e))+1/e)/2}function ze(e){return function t(n){function r(t,r){var i=e((t=_e(t)).h,(r=_e(r)).h),o=Be(t.s,r.s),a=Be(t.l,r.l),s=Be(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 e(t){var n=function(e){return 1==(e=+e)?Be: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):He(isNaN(t)?n:t)}}(t);function r(e,t){var r=n((e=ne(e)).r,(t=ne(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),a=Be(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 e(t,n,r){function i(e,i){var o,a,s=e[0],l=e[1],u=e[2],c=i[0],p=i[1],d=i[2],f=c-s,h=p-l,m=f*f+h*h;if(m<1e-12)a=Math.log(d/u)/t,o=function(e){return[s+e*f,l+e*h,u*Math.exp(t*e*a)]};else{var g=Math.sqrt(m),y=(d*d-u*u+r*m)/(2*u*n*g),b=(d*d-u*u-r*m)/(2*d*n*g),v=Math.log(Math.sqrt(y*y+1)-y),q=Math.log(Math.sqrt(b*b+1)-b);a=(q-v)/t,o=function(e){var r,i=e*a,o=Ve(v),c=u/(n*g)*(o*(r=t*i+v,((r=Math.exp(2*r))-1)/(r+1))-function(e){return((e=Math.exp(e))-1/e)/2}(v));return[s+c*f,l+c*h,u*o/Ve(t*i+v)]}}return o.duration=1e3*a*t/Math.SQRT2,o}return i.rho=function(t){var n=Math.max(.001,+t),r=n*n;return e(n,r,r*r)},i}(Math.SQRT2,2,4),ze(function(e,t){var n=t-e;return n?Fe(e,n>180||n<-180?n-360*Math.round(n/360):n):He(isNaN(e)?t:e)}),ze(Be);var je="center",$e="bottom";function Ue(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}[{key:"NoDataExist",alignment:je,condition:function(e){var t=e.layoutService;if(!t)return!1;var n=t.meta.size;return n.x*n.y==0}},{key:"OnlyNanDataMeasure",translationKey:"OnlyNanData",alignment:je,condition:function(e){var t=e.layoutService;return!!t&&t.getHyperCubeValue("qMeasureInfo").every(function(e){return"NaN"===e.qMin&&"NaN"===e.qMax})}},{key:"OnlyNanDataDimensionContinuous",translationKey:"OnlyNanData",alignment:je,condition:function(e){var t=e.layoutService;if(!t)return!1;if(!t.meta.isContinuous)return!1;var n=t.getHyperCubeValue("qDimensionInfo.0");return n&&(n.qMax<n.qMin||"NaN"===n.qMax)}},{key:"OnlyNegativeOrZeroValues",alignment:je},{key:"DataRangeIncludingZero",alignment:$e},{key:"LimitedData",alignment:$e},{key:"NegativeOrZeroValues",alignment:$e}].reduce(function(e,t){return e[t.key]=t,e},{});var We=["__proto__","constructor"];function Ke(e,t,n){if(void 0!==e&&void 0!==t){var r=t.split("."),i=r[r.length-1];if(!We.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]}}}var Ye,Ge={exports:{}},Xe=Ye?Ge.exports:(Ye=1,Ge.exports=function(){function e(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function t(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 n(n){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?t(Object(i),!0).forEach(function(t){e(n,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):t(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))})}return 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]},p=function e(){var t,n,r,i,o,a,p=arguments[0],d=1,f=arguments.length,h=!1;for("boolean"==typeof p&&(h=p,p=arguments[1]||{},d=2),(null==p||"object"!=typeof p&&"function"!=typeof p)&&(p={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)r=c(p,n),p!==(i=c(t,n))&&(h&&i&&(l(i)||(o=s(i)))?(o?(o=!1,a=r&&s(r)?r:[]):a=r&&l(r)?r:{},u(p,{name:n,newValue:e(h,a,i)})):void 0!==i&&u(p,{name:n,newValue:i}));return p};function d(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 f(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 h(e){let{cache:t,f:n,mainCell:r,p:i,page:o,rowIdx:a,row:s,sourceKey:l,target:u,targetProp:c,columnOrder:h}=e,m=r;if(i.field&&i.field!==n){const e=d(i.field,o,{cache:t},h);if(-1===e)return;m=p({qRow:a},e(s))}u[c]=f(i,m,{key:l})}function m(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),m=Object.keys(u),g=!!i[e].trackBy,y=typeof i[e].trackBy,b={},v=[],q=[];for(let t=0;t<a.qDataPages.length;t++){const o=d(l,a.qDataPages[t],{cache:n},a.qColumnOrder);if(-1!==o)for(let d=0;d<a.qDataPages[t].qMatrix.length;d++){const x=a.qDataPages[t].qArea.qTop+d,D=p({qRow:x},o(a.qDataPages[t].qMatrix[d])),S=f(c,D,{key:s});if(!c.filter||c.filter(D)){for(let e=0;e<m.length;e++){const r=u[m[e]];let i=r.fields||[r];r.fields&&(S[m[e]]=[]);for(let o=0;o<i.length;o++)h({cache:n,f:l,mainCell:D,p:i[o],prop:m[e],page:a.qDataPages[t],rowIdx:x,row:a.qDataPages[t].qMatrix[d],sourceKey:s,target:r.fields?S[m[e]]:S,targetProp:r.fields?o:m[e],columnOrder:a.qColumnOrder});if(r.fields){const t=S[m[e]].map(e=>e.value),n=S[m[e]].map(e=>e.label);S[m[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(S[m[e]].value)}}}g&&r.track({cfg:i[e],itemData:D,obj:S,target:v,tracker:b,trackType:y}),q.push(S)}}}const x=g?r.collect(v,{main:c,propsArr:m,props:u}):q;o=[...o,...x]}return o}function g(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 y(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=v)):void 0===t&&(t=b);for(var n,r,i,o,a,s=new D(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 D(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(x)}function b(e){return e.children}function v(e){return Array.isArray(e)?e[1]:null}function q(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function x(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function D(e){this.data=e,this.depth=this.height=0,this.parent=null}function S(e){return null==e?null:function(e){if("function"!=typeof e)throw new Error;return e}(e)}D.prototype=y.prototype={constructor:D,count:function(){return this.eachAfter(g)},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 y(this).eachBefore(q)},[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 C={depth:-1},M={},E={};function A(e){return e.id}function I(e){return e.parentId}function w(){var e,t=A,n=I;function r(r){var i,o,a,s,l,u,c,p,d=Array.from(r),f=t,h=n,m=new Map;if(null!=e){const t=d.map((t,n)=>function(e){let t=(e=`${e}`).length;return T(e,t-1)&&!T(e,t-2)&&(e=e.slice(0,-1)),"/"===e[0]?e:`/${e}`}(e(t,n,r))),n=t.map(O),i=new Set(t).add("");for(const e of n)i.has(e)||(i.add(e),t.push(e),n.push(O(e)),d.push(E));f=(e,n)=>t[n],h=(e,t)=>n[t]}for(a=0,i=d.length;a<i;++a)o=d[a],u=d[a]=new D(o),null!=(c=f(o,a,r))&&(c+="")&&(p=u.id=c,m.set(p,m.has(p)?M:u)),null!=(c=h(o,a,r))&&(c+="")&&(u.parent=c);for(a=0;a<i;++a)if(c=(u=d[a]).parent){if(!(l=m.get(c)))throw new Error("missing: "+c);if(l===M)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===E&&1===s.children.length;)s=s.children[0],--i;for(let e=d.length-1;e>=0&&(u=d[e]).data===E;--e)u.data=null}if(s.parent=C,s.eachBefore(function(e){e.depth=e.parent.depth+1,--i}).eachBefore(x),s.parent=null,i>0)throw new Error("cycle");return s}return r.id=function(e){return arguments.length?(t=S(e),r):t},r.parentId=function(e){return arguments.length?(n=S(e),r):n},r.path=function(t){return arguments.length?(e=S(t),r):e},r}function O(e){let t=e.length;if(t<2)return"";for(;--t>1&&!T(e,t););return e.slice(0,t)}function T(e,t){if("/"===e[t]){let n=0;for(;t>0&&"\\"===e[--t];)++n;if(!(1&n))return!0}return!1}function k(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=k(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]=k(r,i[e]);return t}n[e]in i&&(i=i[n[e]])}return i}function N(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,...N(e[i].children,t-1,n)]);return r}function L(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=>N(e.children,r-1,n)}return!1}const P=/^qDimensionInfo(?:\/(\d+))?/,_=/^\/?qMeasureInfo\/(\d+)/,R=/\/qAttrExprInfo\/(\d+)/,H=/\/qAttrDimInfo\/(\d+)/;function F(e){return(e.qColumnOrder&&e.qColumnOrder.length?e.qColumnOrder:e.qDimensionInfo.map((e,t)=>t)).filter(t=>t<e.qDimensionInfo.length)}function B(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,p=r;const d=n.qEffectiveInterColumnSortOrder,f=F(n);return P.test(p)&&(i=!0,o=+P.exec(p)[1],p=r.replace(P,"")),_.test(p)&&("K"===n.qMode?u=+_.exec(p)[1]:d&&-1!==d.indexOf(-1)?(u=+_.exec(p)[1],c=0):c=+_.exec(p)[1],p=p.replace(_,"")),p&&(H.exec(p)?s=+H.exec(p)[1]:R.exec(p)&&(a=+R.exec(p)[1])),l=i?"S"===n.qMode?f[o]:d?d.indexOf(o):o:d&&-1!==d.indexOf(-1)?d.indexOf(-1):n.qDimensionInfo.length-("K"===n.qMode?0:1),{fieldDepth:l+1,pseudoMeasureIndex:u,measureIdx:c,attrDimIdx:s,attrIdx:a}}function V(e,t){let n,r,i=L(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 z(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 j(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 p=l[n];let d,f,h,m,g,y;if("primitive"===p.type?(h=p.value,y=String(p.value)):("function"==typeof p.value&&(d=e=>p.value(e,r)),"function"==typeof p.label&&(f=e=>p.label(e,r)),p.accessor?(m=p.accessor(r),Array.isArray(m)?(g=m.map(p.valueAccessor),p.attrAccessor&&(g=g.map(p.attrAccessor)),d&&(h=g.map(d),d=null),f&&(y=g.map(f),f=null),h=p.reduce?p.reduce(h):h,y=p.reduceLabel?p.reduceLabel(y,h):String(h)):(h=p.attrAccessor?p.attrAccessor(p.valueAccessor(m)):p.valueAccessor(m),y=h)):(h=i,y=i)),s.fields){const e=d?d(h):h;u.push(e),c.push(f&&null!=y?f(y):null!=y?y:String(e))}else{const n=d?d(h):h;o[t[e]]={value:n,label:f?f(y):null!=y?y:String(n)},p.field&&(o[t[e]].source={field:p.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 $=(e,t,n)=>{const r="K"===e.qMode?"/qStackedDataPages/*/qData":"/qTreeDataPages/*",i="K"===e.qMode?"qSubNodes":"qNodes",o=k(r,e);return o&&o[0]?(t.tree=y(o[0],n.children||(e=>e[i])),t.tree):null};const U=e=>{let{propsArr:t,props:n,cube:r,cache:i,itemDepthObject:o,f:a}=e;for(let e=0;e<t.length;e++){const i=n[t[e]],s=i.fields?i.fields:[i];for(let e=0;e<s.length;e++){const t=s[e];if(t.field!==a){const e=V(o,B(t.field,{cube:r}));t.accessor=e.nodeFn,t.valueAccessor=e.valueFn,t.attrAccessor=e.attrFn}}}};function W(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;const o=t.raw(),a=t.key(),s="S"===o.qMode?function(e){const t=e.raw().qDataPages.length?e.raw().qDataPages[0].qMatrix:[],r=function(e){const t=e.raw().qColumnOrder,n=e.fields();return t&&t.length===n.length?t:n.map((e,t)=>t)}(e),i=e.fields(),o=e.fields().filter(e=>"dimension"===e.type()).map(e=>r.indexOf(i.indexOf(e))),a=e.fields().filter(e=>"measure"===e.type()).map(e=>r.indexOf(i.indexOf(e))),s={__root:{__id:"__root",qValues:[]}};for(let e=0;e<t.length;e++){const r=t[e];let i="__root",u=!1;for(let e=0;e<o.length;e++){var l;const t=r[o[e]],a="".concat(i,"__").concat(null!==(l=t.qElemNumber)&&void 0!==l?l:t.qElemNo);s[a]||(s[a]=n({__id:a,__parent:i,qValues:[]},t),u=!0),i=a}if(u)for(let e=0;e<a.length;e++){const t=r[a[e]];s[i].qValues.push(t)}}const u=Object.keys(s).map(e=>s[e]);return w().id(e=>e.__id).parentId(e=>e.__parent)(u)}(t):$(o,r,e);if(!s)return null;const l=s.height,u=[];for(let a=0;a<=l;a++){let s=null;if(a>0)if("S"===o.qMode){let e=F(o)[a-1];s=r.fields[e]}else{let e=o.qEffectiveInterColumnSortOrder[a-1];a>o.qEffectiveInterColumnSortOrder.length&&(e=o.qDimensionInfo.length),s=r.fields[e]}const{props:l,main:c}=i.normalizeConfig(n(n({},e),{},{field:s?s.key():void 0}),t),p=Object.keys(l);u[a]={propsArr:p,props:l,main:c};const d=s?B(s,{cube:o}):{fieldDepth:0};U({propsArr:p,props:l,cube:o,cache:r,itemDepthObject:d,f:s})}const c=s.copy().descendants(),p=s.descendants();for(let e=0;e<p.length;e++){const t=u[p[e].depth].propsArr,n=u[p[e].depth].props,r=u[p[e].depth].main,i=c[e],o=i.data,s=z(r,o,{key:a});j({propsArr:t,props:n,item:i,itemData:o,ret:s,sourceKey:a}),p[e].data=s}return s}function K(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(!$(s,n,e))continue;const u="object"==typeof i[a].field?i[a].field:t.field(i[a].field),{props:c,main:p}=r.normalizeConfig(i[a],t),d=Object.keys(c),f=B(u,{cube:s}),{nodeFn:h,attrFn:m,valueFn:g}=V({fieldDepth:0},f);U({propsArr:d,props:c,cube:s,cache:n,itemDepthObject:f,f:u});const y=!!i[a].trackBy,b=typeof i[a].trackBy,v={},q=[],x=h(n.tree),D=[];for(let e=0;e<x.length;e++){const t=x[e],n=m?m(g(t)):g(t);if(p.filter&&!p.filter(n))continue;const o=z(p,n,{key:l});j({propsArr:d,props:c,item:t,itemData:n,ret:o,sourceKey:l}),y&&r.track({cfg:i[a],itemData:n,obj:o,target:q,tracker:v,trackType:b}),D.push(o)}const S=y?r.collect(q,{main:p,propsArr:d,props:c}):D;o=[...o,...S]}return o}var Y=function(e,t){return e(t={exports:{}},t.exports),t.exports}(function(e){var t;t=function(){return function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,a,s,l,u,c,p,d=e.length,f=e.search(/[0-9\-\+#]/),h=f>0?e.substring(0,f):"",m=e.split("").reverse().join(""),g=m.search(/[0-9\-\+#]/),y=d-g,b=e.substring(y,y+1),v=y+("."===b||","===b?1:0),q=g>0?e.substring(v,d):"";if(n=(t="-"===(e=e.substring(f,v)).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(m="",y=(p=t[0]).length%l,d=p.length,v=0;v<d;v++)m+=p.charAt(v),!((v-y+1)%l)&&v<d-l&&(m+=o);t[0]=m}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),h+(n?"-":"")+r+q}},e.exports=t()});function G(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}const X={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"},J=/%\)?$/,Z=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,Q=/^\(oct\)/i,ee=/^\(dec\)/i,te=/^\(hex\)/i,ne=/^\(bin\)/i,re=/^\(rom\)/i,ie=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,oe=/#|0/g;function ae(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 se(e,t,n){let r;return Z.test(t)?e=ae(e,Number(/\d{2}/.exec(t)[0]),t,n):Q.test(t)?e=ae(e,8,t,n):ee.test(t)?e=ae(e,10,t,n):te.test(t)?e=ae(e,16,t,n):ne.test(t)?e=ae(e,2,t,n):re.test(t)&&(r="",e<0&&(r="-",e=-e),e=0===(e=Math.floor(e))?"0":e<=5e5?r+(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)):t+r+e.toExponential(0)),e}function le(e,t,n){const r=G(e);return n?r:new RegExp(r||"",t)}function ue(e,t,n,r){let i,o,a,s,l,u,c,p,d,f=e.pattern;r&&(e.abbreviate=!0),d=function(e,t){return t&&(t=G(t)),e&&(e=G(e)),new RegExp("(?:[#0]+".concat(e,")?[#0]+(?:").concat(t,"[#0]+)?"))}(t,n),a=f.match(d),a=a?a[0]:"",s=a?f.substr(0,f.indexOf(a)):f,l=a?f.substring(f.indexOf(a)+a.length):"",a||(a=f?"#":"##########"),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(le(u,"g"),t)),c=n,n=".",c&&(a=a.replace(le(c,"g"),n)),p=a.match(/#/g),p=p?p.length:0;const h=f.split(c);let m;h[1]&&(m=h[1].match(oe)),e.prefix=s||"",e.postfix=l||"",e.pattern=f,e.maxPrecision=m?m.length:2,e.percentage=J.test(f),e.numericPattern=a||"",e.numericRegex=new RegExp("".concat(le(t,null,!0),"|").concat(le(n,null,!0)),"g"),e.groupTemp=u,e.decTemp=c,e.t=t,e.d=n,e.temp=p}class ce{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 X;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 ce(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],ie.test(e[0])&&(r.positive.isFunctional=!0),e[1]?ie.test(e[1])&&(r.negative.isFunctional=!0):r.negative=!1,e[2]?ie.test(e[2])&&(r.zero.isFunctional=!0):r.zero=!1;const i="U"===this.type;r.positive.isFunctional||ue(r.positive,t,n,i),r.negative&&!r.negative.isFunctional&&ue(r.negative,t,n,i),r.zero&&!r.zero.isFunctional&&ue(r.zero,t,n,i)}formatValue(e){let t,n,r,i,o,a,s,l,u,c=this._prepared,p="",d="",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=se(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&&(p=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+1e-15*(e<0?-1:1)).toFixed(Math.min(20,u?u.length:0)).split(".")[0]);let n=l.split(o)[0];if(n+=o,e=Y(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)/,""),d=""):(e=e.toPrecision(Math.max(1,Math.min(14,t)))).indexOf(".")>=0&&(e=(e=e.replace(e.indexOf("e")<0?/0+$/:/\.?0+(?=e)/,"")).replace(".",o));else{for(l+=o,t=Math.max(0,Math.min(20,t-Math.ceil(Math.log(r)/Math.log(10)))),s=0;s<t;s++)l+="#";e=Y(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+d+p+c.postfix}static getStaticFormatter(){return{prepare(){},formatValue:e=>"".concat(e)}}}function pe(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 de(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 ce(...t)}(i,e,t,n,r),a=pe(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 fe="D",he="T",me="TS",ge="IV",ye=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],be=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],ve=["January","February","March","April","May","June","July","August","September","October","November","December"],qe=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function xe(e,t){for(let n=e.length;n<t;n++)e="0".concat(e);return e}function De(e){let t=e.toString().split(".");return t[1]?(t=Number("0.".concat(t[1])),t):0}function Se(e,t){let n,r=function(e){const t=e,n=24*De(t),r=60*De(n),i=60*De(r),o=1e3*De(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}}class Ce{constructor(e,t,n){const r=e||{};r.qCalendarStrings||(r.qCalendarStrings={qLongDayNames:ye,qDayNames:be,qLongMonthNames:ve,qMonthNames:qe}),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={[he]:r.qTimeFmt||"hh:mm:ss",[fe]:r.qDateFmt||"YYYY-MM-DD",[me]:r.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"}[n]),this.pattern=t}clone(){const e=new Ce(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=Se(e,t));const i=function(e,t){return{"Y+|y+":{Y:"".concat(Number("".concat(t.year).slice(-2))),YY:xe("".concat(t.year).slice(-2),2),YYY:xe("".concat(t.year).slice(-3),3),def:e=>xe("".concat(t.year),e.length)},"M+":{M:t.month+1,MM:xe("".concat(t.month+1),2),MMM:e.locale_months_abbr[t.month],def:e.locale_months[t.month]},"W+|w+":{W:t.day,WW:xe("".concat(t.day),2),WWW:e.locale_days_abbr[t.day],def:e.locale_days[t.day]},"D+|d+":{D:t.date,def:e=>xe("".concat(t.date),e.length)},"h+|H+":{h:t.h,def:e=>xe("".concat(t.h),e.length)},"m+":{m:t.m,def:e=>xe("".concat(t.m),e.length)},"s+|S+":{s:t.s,def:e=>xe("".concat(t.s),e.length)},"f+|F+":{def(e){let n="".concat(t.f),r=e.length-n.length;if(r>0)for(let e=0;e<r;e++)n+="0";else r<0&&(n=n.slice(0,e.length));return n}},"t{1,2}|T{1,2}":{def(e){let n=t.t;return e[0].toUpperCase()===e[0]&&(n=n.toUpperCase()),n=n.slice(0,e.length),n}}}}(this,r),o=[];for(const e in i)Object.prototype.hasOwnProperty.call(i,e)&&o.push(e);const a=new RegExp(o.join("|"),"g");return t.replace(a,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 Me(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Ce(...t)}function Ee(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"TS",n=Me(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,e,t),r=pe(n.format.bind(n),{toKey:e=>"object"==typeof e&&"function"==typeof e.getTime?e.getTime():e});function i(e){return t!==ge?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=Me(i,e,t),r=pe(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 Ae(){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",p=function(e,t){if(e&&e.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(e.qNumFormat.qType))return Ee(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"),de(n,r,i,o,t)}(t,i),d={id:()=>n,key:()=>r,raw:()=>t,title:()=>t.qFallbackTitle||t.label,type:()=>s,origin:()=>l,items:()=>(e||(e=o(d)),e),min:()=>t.qMin,max:()=>t.qMax,value:u,label:e=>(null==e?void 0:e.qText)||"",reduce:c,reduceLabel:"dimension"===s?"first":(e,t)=>p(t),formatter:()=>p,tags:()=>t.qTags};return d}function Ie(e,t,n,r,i){return(t[e]||[]).map((t,o)=>{const a="".concat(r?"".concat(r,"/"):"").concat(e,"/").concat(o),s={instance:Ae(p({id:"".concat(n?"".concat(n,"/"):"").concat(a),key:a,meta:t},i))};return s.attrDims=Ie("qAttrDimInfo",t,n,a,p({},i,{value:e=>null==e?void 0:e.qElemNo,type:"dimension"})),s.attrExps=Ie("qAttrExprInfo",t,n,a,p({},i,{value:e=>null==e?void 0:e.qNum,type:"measure"})),s.measures=Ie("qMeasureInfo",t,n,a,p({},i,{value:e=>null==e?void 0:e.qValue,type:"measure"})),s})}function we(){let{key:e,data:t,config:r={}}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const i={fields:[],wrappedFields:[],allFields:[],virtualFields:[]},o=t;if(!o)throw new Error('Missing "data" input');if(!o.qDimensionInfo)throw new Error('The "data" input is not recognized as a hypercube');const a=we.util,s={cache:i,cube:o,localeInfo:r.localeInfo,fieldExtractor:null,pages:null,hierarchy:()=>null,virtualFields:r.virtualFields},l={key:()=>e,raw:()=>o,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,s),fields:()=>i.fields.slice(),extract:e=>s.extractor(e,l,i,a),hierarchy:e=>s.hierarchy(e,l,i,a),_cache:()=>i};"K"===o.qMode||"T"===o.qMode||!o.qMode&&o.qNodesOnDim?(s.extractor=K,s.hierarchy=W,s.pages="K"===o.qMode?o.qStackedDataPages:o.qTreeDataPages):"S"===o.qMode?(s.extractor=m,s.pages=o.qDataPages,s.hierarchy=W):s.extractor=()=>[],s.fieldExtractor=e=>s.extractor({field:e},l,i,a);const u="S"===o.qMode?e=>e.qElemNumber:void 0,c="S"===o.qMode?e=>e.qNum:void 0;i.wrappedFields.push(...Ie("qDimensionInfo",o,e,"",p({},s,{value:u,type:"dimension"}))),i.wrappedFields.push(...Ie("qMeasureInfo",o,e,"",p({},s,{value:c,type:"measure"}))),i.fields=i.wrappedFields.map(e=>e.instance);const d=e=>{e.forEach(e=>{i.allFields.push(e.instance),d(e.measures),d(e.attrDims),d(e.attrExps)})};return d(i.wrappedFields),(r.virtualFields||[]).forEach(t=>{const r=l.field(t.from),o=Ae(n({meta:r.raw(),id:"".concat(e,"/").concat(t.key),sourceField:r,fieldExtractor:e=>s.extractor({field:e},l,i,a),key:t.key,type:r.type(),localeInfo:s.localeInfo,value:r.value},t.override||{}));i.virtualFields.push(o)}),i.allFields.push(...i.virtualFields),l}const Oe=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],Te=/\/qDimensionInfo(?:\/(\d+))?/,ke=/\/qMeasureInfo\/(\d+)/,Ne=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,Le=/\/qAttrExprInfo\/(\d+)/,Pe=/\/?qHyperCube/,_e=/\/?qTreeData/,Re=e=>"".concat(e.substr(0,e.indexOf("/qHyperCubeDef")+14)),He=e=>"".concat(e.substr(0,e.indexOf("/qTreeDataDef")+13));function Fe(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;Pe.test(e)?(o="".concat(n.substr(0,n.indexOf("qHyperCube")+10)),a=Re):_e.test(e)&&(o="".concat(n.substr(0,n.indexOf("qTreeData")+9)),a=He);let s=!0;if(Te.test(e)&&(r=+Te.exec(e)[1]),ke.test(e)&&(i=+ke.exec(e)[1]),Ne.test(e)){i=-1,r=0;const e=+Ne.exec(n)[2];isNaN(e)||(r=e,n=n.replace(/\/\d+$/,"")),s=!1}if(Le.test(e)){const e=i;if(t){i=0;const a=k(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+=+Le.exec(n)[1]}else r>-1?(r=-1,i=+Le.exec(n)[1]):i+=+Le.exec(n)[1]+1}return Oe.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 Be(e){we.util=e.data("matrix").util,e.data("q",we),e.formatter("q-number",de),e.formatter("q-time",Ee)}return Be.qBrushHelper=Fe,Be.selections=Fe,Be}());N(Xe);const Je=/xyz/.test(()=>{})?/\b_super\b/:/.*/,Ze=function(){};function Qe(e,t,n,r){0===arguments.length?this.set(0,0,0,0):this.set(e,t,n,r)}Ze.extend=function e(t,n){const r=this.prototype;"string"!=typeof t&&(n=t,t="Class");const i=Object.create(this.prototype);for(const e in n)i[e]="function"==typeof n[e]&&"function"==typeof r[e]&&Je.test(n[e])?function(e,t){return function(){const n=this._super;this._super=r[e];const i=t.apply(this,arguments);return this._super=n,i}}(e,n[e]):n[e];if(!/^[_a-z][_a-z\d]*$/i.test(t))throw new Error("Invalid subclass name. Alphanumericals only.");const o=new Function(`return (function ${t}(){ typeof this.init === 'function' && this.init.apply(this, [].slice.call(arguments)) });`)();return o.prototype=i,o.prototype.constructor=o,o.extend=e,o},Qe.prototype={toString(){return`${this.x} ${this.y} ${this.width} ${this.height}`},clone(){return new Qe(this.x,this.y,this.width,this.height)},set(e,t,n,r){n>=0?(this.x=e,this.width=n):(this.x=e+n,this.width=-n),r>=0?(this.y=t,this.height=r):(this.y=t+r,this.height=-r)},setLTRB(e,t,n,r){e<=n?(this.x=e,this.width=n-e):(this.x=n,this.width=e-n),t<=r?(this.y=t,this.height=r-t):(this.y=r,this.height=t-r)},equal(e){return e&&this.x===e.x&&this.y===e.y&&this.width===e.width&&this.height===e.height},combineWith(e){const t=Math.max(e.getRight(),this.getRight()),n=Math.max(e.getBottom(),this.getBottom()),r=Math.min(e.x,this.x),i=Math.min(e.y,this.y);return new Qe(r,i,Math.max(0,t-r),Math.max(0,n-i))},intersectsWith(e){return!!e&&(this.x<=e.getRight()&&e.x<=this.getRight()&&this.y<=e.getBottom()&&e.y<=this.getBottom())},intersectsRect(e){return this.intersectsWith(e)},intersection(e,t){if(this.intersectsWith(e)){const t=Math.max(this.x,e.x),n=Math.max(this.y,e.y);return new Qe(t,n,Math.min(this.getRight(),e.getRight())-t,Math.min(this.getBottom(),e.getBottom())-n)}return t?null:new Qe(this.x,this.y,this.width,this.height)},union(e){const t=Math.min(this.x,e.x),n=Math.min(this.y,e.y);return new Qe(t,n,Math.max(this.getRight(),e.getRight())-t,Math.max(this.getBottom(),e.getBottom())-n)},pointInside(e,t){return e>=this.x&&e<=this.getRight()&&t>=this.y&&t<=this.getBottom()},rectInside(e){const t=e.getPoints();let n;for(n=0;n<4;n++)if(!this.pointInside(t[n].x,t[n].y))return!1;return!0},getPoints(){const e=[];return e.push({x:this.x,y:this.y}),e.push({x:this.getRight(),y:this.y}),e.push({x:this.getRight(),y:this.getBottom()}),e.push({x:this.x,y:this.getBottom()}),e},getRight(){return this.x+this.width},getBottom(){return this.y+this.height},getCenterPoint(){return{x:this.x+this.width/2,y:this.y+this.height/2}},getBoundingRect(){return this},scale(e){const t=e-1,n=t*this.width/2,r=t*this.height/2;this.x-=n,this.y-=r,this.width*=e,this.height*=e},hasNaN(){return Number.isNaN(+this.x)||Number.isNaN(+this.y)||Number.isNaN(+this.width)||Number.isNaN(+this.height)}};const et=new Qe(0,0,0,0),tt=new Qe(0,0,0,0),nt=Ze.extend("CubeSlicer",{init(){this.pages=[]},get(e){return e.map(e=>this.getPage(e))},getPage(e){let t,n;const r=[];let i;for(n=0;n<this.pages.length;n++)if(t=this.pages[n].qArea,et.set(e.qLeft,e.qTop,e.qWidth,e.qHeight),tt.set(t.qLeft,t.qTop,t.qWidth,t.qHeight),i=tt.intersection(et,!0),r.push({coverage:i?i.clone():new Qe(0,0,0,0),idx:n}),t.qLeft<=e.qLeft&&t.qLeft+t.qWidth>=e.qLeft+e.qWidth&&t.qTop<=e.qTop&&t.qTop+t.qHeight>=e.qTop+e.qHeight)return this._extract(e,this.pages[n]);return r.sort((e,t)=>t.coverage.width*t.coverage.height-e.coverage.width*e.coverage.height),r[0].coverage.height>0&&r[0].coverage.width>0?this._extract(e,this.pages[r[0].idx]):{qArea:{qTop:e.qTop,qLeft:e.qLeft,qWidth:0,qHeight:0},qMatrix:[]}},destroy(){this.clear()},isEmpty(){return!(this.pages&&this.pages[0]&&this.pages[0].qArea.qHeight&&this.pages[0].qArea.qWidth)},clear(){this.pages=[]},store(e){this.pages=e},containsArea(e){let t;for(let n=0;n<this.pages.length;n++)if(t=this.pages[n].qArea,t.qLeft<=e.qLeft&&t.qLeft+t.qWidth>=e.qLeft+e.qWidth&&t.qTop<=e.qTop&&t.qTop+t.qHeight>=e.qTop+e.qHeight)return!0;return!1},contains(e){return!(!this.pages||!this.pages.length)&&0===e.filter(e=>!this.containsArea(e)).length},_extract(e,t){et.set(e.qLeft,e.qTop,e.qWidth,e.qHeight),tt.set(t.qArea.qLeft,t.qArea.qTop,t.qArea.qWidth,t.qArea.qHeight);const n=et.intersection(tt,!0);if(!n)return{qArea:{qTop:e.qTop,qLeft:e.qLeft,qWidth:0,qHeight:0},qMatrix:[]};const r=Math.max(0,e.qTop-t.qArea.qTop),i=Math.max(0,e.qLeft-t.qArea.qLeft),o=t.qMatrix.slice(r,r+n.height).map(e=>e.slice(i,i+n.width));return{qArea:{qTop:n.y,qLeft:n.x,qWidth:n.width,qHeight:n.height},qMatrix:o}}});let rt;function it(e,t){let n;const r={};for(n in e)"qSubNodes"!==n&&e.hasOwnProperty(n)&&(r[n]=e[n]);return t.push(r),r}function ot(e,t,n){let r,i,o;const a=[];let s=[],l=0,u=0;for(n.length&&(l=n[0].qUp||0,u=n[n.length-1].qDown||0),r=0;r<n.length;++r)if(i=n[r],i.qSubNodes.length>0&&(s=ot(e,t,i.qSubNodes)),o=null,(0===i.qSubNodes.length&&rt>=e&&rt<=e+t||s.length>0)&&(o=it(i,a),void 0!==o.qUp&&1===a.length&&(o.qUp=l+r),o.qSubNodes=s),0===i.qSubNodes.length&&rt++,rt===e+t){o&&void 0!==o.qDown&&(o.qDown=u+(n.length-1-r));break}return a}function at(e,t,n){return rt=0,ot(e,t,n)}const st=new Qe(0,0,0,0),lt=new Qe(0,0,0,0),ut=nt.extend("PivotCubeSlicer",{init(){this._super(),this.requestedAreas=[]},getPage(e){let t,n;const r=[];let i;for(n=0;n<this.pages.length;n++)if(t=this.pages[n].qArea,st.set(e.qLeft,e.qTop,e.qWidth,e.qHeight),lt.set(t.qLeft,t.qTop,t.qWidth,t.qHeight),i=lt.intersection(st,!0),r.push({coverage:i?i.clone():new Qe(0,0,0,0),idx:n}),t.qLeft<=e.qLeft&&t.qLeft+t.qWidth>=e.qLeft+e.qWidth&&t.qTop<=e.qTop&&t.qTop+t.qHeight>=e.qTop+e.qHeight)return this._extract(e,this.pages[n]);return r.sort((e,t)=>t.coverage.width*t.coverage.height-e.coverage.width*e.coverage.height),r[0].coverage.height>0&&r[0].coverage.width>0?this._extract(e,this.pages[r[0].idx]):{qLeft:[],qTop:[],qData:[],qArea:{qTop:e.qTop,qLeft:e.qLeft,qWidth:0,qHeight:0}}},_extract(e,t){st.set(e.qLeft,e.qTop,e.qWidth,e.qHeight),lt.set(t.qArea.qLeft,t.qArea.qTop,t.qArea.qWidth,t.qArea.qHeight);const n=st.intersection(lt,!0);if(!n)return{qLeft:[],qTop:[],qData:[],qArea:{qTop:e.qTop,qLeft:e.qLeft,qWidth:0,qHeight:0}};const r=Math.max(0,e.qTop-t.qArea.qTop),i=Math.max(0,e.qLeft-t.qArea.qLeft),o=t.qData.slice(r,r+n.height).map(e=>e.slice(i,i+n.width));return{qLeft:at(r,n.height,t.qLeft),qTop:at(i,n.width,t.qTop),qData:o,qArea:{qTop:n.y,qLeft:n.x,qWidth:n.width,qHeight:n.height}}}});function ct(e){if("pivot-table"===e.visualization)this.responseProperty="qPivotDataPages",this.slicer=new ut;else{if("table"!==e.visualization)return;this.slicer=new nt}let t=e.snapshotData.object.origDataPages;t||(t=e.qHyperCube[this.responseProperty]),this.slicer.store(t.filter(e=>e))}class pt{constructor(e,t,n){this.layout=e,this.dataPath=t,this.responseProperty=n,ct.call(this,e)}getData(e){!function(e,t,n,r){if(e){t.snapshotData.object.origDataPages||(t.snapshotData.object.origDataPages=t.qHyperCube[r]);for(let e=0;e<n.length;e++)n[e].qHeight=Math.min(t.qHyperCube.qSize.qcy,n[e].qHeight),n[e].qTop=t.snapshotData.object.origDataPages[e].qArea.qTop;t.qHyperCube[r]=e.get(n)}}(this.slicer,this.layout,e,this.responseProperty);const t=Ue(this.layout,`${this.dataPath}.${this.responseProperty}`);return Promise.resolve(t)}setCacheOptions(){}updateCache(){}}const dt={version:"1.0.2",qHyperCubeDef:{qDimensions:[],qMeasures:[],qMode:"K",qAlwaysFullyExpanded:!0,qSuppressZero:!1,qSuppressMissing:!0},color:{box:{paletteColor:{index:-1,color:"#e6e6e6"}},expressionLabel:"",point:{auto:!0,mode:"primary",useBaseColors:"off",expressionIsColor:!0}},dataPoint:{bubbleScales:100,displacement:"none"},dimensionAxis:{dock:"near",label:"auto",show:"all"},measureAxis:{autoMinMax:!0,dock:"near",max:10,min:0,minMax:"min",show:"all",spacing:1},gridlines:{auto:!0,spacing:2},orientation:"horizontal",presentation:{visibleComponents:"points_box"},refLine:{refLines:[]},sorting:{autoSort:!0},showTitles:!0,subtitle:"",title:"",footnote:""};function ft(e){2===e.qHyperCubeDef.qInterColumnSortOrder.length?e.qHyperCubeDef.qInterColumnSortOrder=[1,0]:3===e.qHyperCubeDef.qInterColumnSortOrder.length&&(e.qHyperCubeDef.qInterColumnSortOrder=[1,2,0])}function ht(e){e.qHyperCubeDef.qDimensions.length>1&&e.color&&(e.color.point.persistent=!0)}function mt(e){const{translator:t}=e,n={min:1,max:2,description(e,n){let r;return r=0===n?"Visualizations.Descriptions.Point":"horizontal"===e.orientation?"properties.yAxis":"properties.xAxis",t.get(r)},added(e,t){ft(t),ht(t)},moved(e,t){ft(t),ht(t)},removed(e,t){ft(t),ht(t)}},r={min:1,max:1,description(e){const n="horizontal"===e.orientation?"properties.xAxis":"properties.yAxis";return t.get(n)}};return{path:"/qHyperCubeDef",dimensions:n,measures:r}}var gt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function yt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var bt,vt={exports:{}};var qt=(bt||(bt=1,self,vt.exports=(()=>{var e={909:e=>{var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===n.call(e)},a=function(e){if(!e||"[object Object]"!==n.call(e))return!1;var r,i=t.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!i&&!o)return!1;for(r in e);return void 0===r||t.call(e,r)},s=function(e,t){r&&"__proto__"===t.name?r(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,n){if("__proto__"===n){if(!t.call(e,n))return;if(i)return i(e,n).value}return e[n]};e.exports=function e(){var t,n,r,i,u,c,p=arguments[0],d=1,f=arguments.length,h=!1;for("boolean"==typeof p&&(h=p,p=arguments[1]||{},d=2),(null==p||"object"!=typeof p&&"function"!=typeof p)&&(p={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)r=l(p,n),p!==(i=l(t,n))&&(h&&i&&(a(i)||(u=o(i)))?(u?(u=!1,c=r&&o(r)?r:[]):c=r&&a(r)?r:{},s(p,{name:n,newValue:e(h,c,i)})):void 0!==i&&s(p,{name:n,newValue:i}));return p}},8:(e,t)=>{(()=>{var e={229:e=>{var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===n.call(e)},a=function(e){if(!e||"[object Object]"!==n.call(e))return!1;var r,i=t.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!i&&!o)return!1;for(r in e);return void 0===r||t.call(e,r)},s=function(e,t){r&&"__proto__"===t.name?r(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,n){if("__proto__"===n){if(!t.call(e,n))return;if(i)return i(e,n).value}return e[n]};e.exports=function e(){var t,n,r,i,u,c,p=arguments[0],d=1,f=arguments.length,h=!1;for("boolean"==typeof p&&(h=p,p=arguments[1]||{},d=2),(null==p||"object"!=typeof p&&"function"!=typeof p)&&(p={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)r=l(p,n),p!==(i=l(t,n))&&(h&&i&&(a(i)||(u=o(i)))?(u?(u=!1,c=r&&o(r)?r:[]):c=r&&a(r)?r:{},s(p,{name:n,newValue:e(h,c,i)})):void 0!==i&&s(p,{name:n,newValue:i}));return p}}},n={};function r(t){var i=n[t];if(void 0!==i)return i.exports;var o=n[t]={exports:{}};return e[t](o,o.exports,r),o.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};(()=>{r.r(i),r.d(i,{default:()=>Te});var e=r(229),t=r.n(e);const n=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},o=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},a={EXPRESSIONS:{observed:"",trend:"STL_Trend",seasonal:"STL_Seasonal",residual:"STL_Residual"},OPTIONS:[{value:"observed",translation:"cao.trendDecomposition.parameters.decomposition.observed"},{value:"trend",translation:"cao.trendDecomposition.parameters.decomposition.trend"},{value:"seasonal",translation:"cao.trendDecomposition.parameters.decomposition.seasonal"},{value:"residual",translation:"cao.trendDecomposition.parameters.decomposition.residual"}]};var 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 p(e){return!(!e.fullAccumulation&&!e.fullRange)}function d(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),n=t.trim();return"="===n.substring(0,1)?n.substring(1).trim():n}function h(){return"[$(=Replace(GetObjectField(".concat(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,"),']',']]'))]")}function m(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){return"Replace(Replace(".concat(e,",'''',''''''),'$','$''&''')")}function b(e,t){return e?"".concat(t,'={">=$(=Min(').concat(t,"))<=$(=Max(").concat(t,'))"}'):"".concat(t,'={"=Only({1}').concat(t,")>='$(=").concat(y("MinString(".concat(t,")")),")' and Only({1}").concat(t,")<='$(=").concat(y("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=b(c(r[0],i),h(0));return"".concat(a,"({1<").concat(u,">}").concat(l,")")}if(r&&2===r.length){var p=c(r[0],i),d=c(r[1],i),f=h(0),m=h(1),g=b(p,f),y=b(d,m);return"".concat(a,"({1<").concat(g,",").concat(y,">}").concat(l,")")}return"".concat(a,"({1}").concat(l,")")}function q(e){return"".concat(e,"(")}function x(e){var t=e.properties,n=e.layout;return o(t,"qHyperCubeDef.qDimensions",o(n,"qHyperCube.qDimensionInfo",[])).length}const D={isFullRange:p,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=h(0);return"If(Count(".concat(c,") > 0, ").concat(a," + ").concat(s).concat(l,")")}if(r&&2===r.length){var p=h(0),d=h(1);return"If(Count(".concat(p,") * Count(").concat(d,") > 0, ").concat(a," + ").concat(s).concat(l,")")}return a},getRowNoComp:d,getNumStepComp:function(e,t){if(!p(e)){var n=e.steps;return"number"!=typeof n||Number.isNaN(n)?6:n}return d(e,t)},getAboveCompPrefix:m,getAboveCompSuffix:g,getAboveComp:function(e,t,n,r){return m(e,t)+n+g(r)},getFunctionPrefix:q,getFunctionSuffix:function(){return")"},getRangeComp:function(e,t){return q(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,i=function(e){return void 0===e.primaryDimension?e.accumulationDimension:e.primaryDimension}(t);return 0===i&&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=h(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:h,getFieldWithWrapper:function(e){var t=e?e.replace(/]/g,"]]"):e;return"[".concat(t,"]")},generateTSDExpression:function(e,t,n){var r=t||e.outputExpression;if(e.base&&e.base.qDef&&(r=t!==e.base.qDef?t:e.base.qDef),"observed"!==e.decomposition){var i=n.qHyperCubeDef.qMeasures.find(function(t){return t.qDef.base&&t.qDef.base.qLibraryId&&e.base&&e.base.qLibraryId?t.qDef.base.qLibraryId===e.base.qLibraryId:null});i&&t!==i.qDef.qLabel&&(r=i.qLibraryId||i.qDef.base.qLibraryId?"[".concat(i.qDef.qLabel,"]"):i.qDef.base.qDef);var o=function(e){var t=a.OPTIONS.find(function(t){return t.value===e.decomposition});return t?a.EXPRESSIONS[t.value]:""}(e);r=r.startsWith("=")?r.substr(1):r,r="".concat(o,"(").concat(r,", ").concat(e.steps,")")}return r},getDecomposition:function(e){var t="observed";return Object.values(a.EXPRESSIONS).find(function(n){var r=e.qDef.base.qDef.toLowerCase()||e.qDef.qDef.toLowerCase();return a.EXPRESSIONS[n]&&r.includes(a.EXPRESSIONS[n].toLowerCase())&&(t=n),n}),t}};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 C(e){return C="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},C(e)}var M=t().bind(null,!0),E={},A=Array.isArray;function I(e){return null!=e&&!Array.isArray(e)&&"object"===C(e)}function w(e){return void 0===e}function O(e,t){return"function"==typeof e[t]||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function T(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]=w(e[n||t])?o:e[t],e=e[n||t]}}),e}function k(e,t){var n=!0;if(I(e)&&I(t))return Object.keys(e).length===Object.keys(t).length&&(Object.keys(e).forEach(function(r){k(e[r],t[r])||(n=!1)}),n);if(A(e)&&A(t)){if(e.length!==t.length)return!1;for(var r=0,i=e.length;r<i;r+=1)if(!k(e[r],t[r]))return!1;return!0}return e===t}E.generate=function(e,t,n){n=n||"";var r=[];return Object.keys(t).forEach(function(i){var o=function(e){return e?M({},{val:e}).val:e}(t[i]),a=e[i],s="".concat(n,"/").concat(i);k(o,a)||O(t,i)||(w(a)?r.push({op:"add",path:s,value:o}):I(o)&&I(a)?r=r.concat(E.generate(a,o,s)):A(o)&&A(a)?r=r.concat(function(e,t,n){var r=[],i=e.slice(),o=-1;function a(e,t,n){if(e[n]&&w(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(k(t,i))return r;if(!w(t[0])&&w(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(E.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){w(t[i])&&!O(e,i)&&r.push({op:"remove",path:"".concat(n,"/").concat(i)})}),r},E.apply=function(e,t){t.forEach(function(t){var n,r,i=T(e,t.path),o=t.path.split("/").splice(-1)[0],a=o&&Number.isNaN(+o)?i[o]:i[+o]||i,s=t.from?t.from.split("/").splice(-1)[0]:null;if("/"===t.path&&(i=null,a=e),"add"===t.op||"replace"===t.op)if(A(i))"-"===o&&(o=i.length),i.splice(+o,"add"===t.op?0:1,t.value);else if(A(a)&&A(t.value)){var l,u=t.value.slice();a.length=0,(l=a).push.apply(l,function(e){if(Array.isArray(e))return S(e)}(r=u)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||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}}(r)||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.")}())}else if(I(a)&&I(t.value))n=a,Object.keys(n).forEach(function(e){Object.getOwnPropertyDescriptor(n,e).configurable&&!O(n,e)&&delete n[e]}),M(a,t.value);else{if(!i)throw new Error("Patchee is not an object we can patch");i[o]=t.value}else if("move"===t.op){var c=T(e,t.from);A(i)?i.splice(+o,0,c.splice(+s,1)[0]):(i[o]=c[s],delete c[s])}else"remove"===t.op&&(A(i)?i.splice(+o,1):delete i[o])})},E.clone=function(e){return M({},e)},E.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},E.updateObject=function(e,t){Object.keys(e).length?E.apply(e,E.generate(e,t)):M(e,t)};const N=E,L=function(e,n,r){if(!e)return Promise.resolve();var i=N.generate(n,r);return t()(!0,n,r),i&&i.length?(i=i.map(function(e){return{qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path}}),e.applyPatches(i,!0)):Promise.resolve()};var P="accumulation";function _(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===P)return n[r]}function R(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===P)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var H={type:"accumulation",disabled:!1,accumulationDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullAccumulation:!1,steps:6,outputExpression:""};const F={translationKey:"properties.modifier.accumulation",needDimension:D.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return D.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,a=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=a;void 0===l&&(l=D.getNumDimensions({properties:r,layout:i}));var u=o(r,"qHyperCubeDef.qDimensions",[]),c=D.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:u,dimensionAndFieldList:s}),p=D.getNumStepComp(n,l),d=D.getAboveComp(n,l,c,p),f=D.getRangeComp("RangeSum",d);if(D.needDimension({modifier:n,properties:r,layout:i})){var h=D.getDimComp(u,1),m=D.getDimComp(u,0),g=D.getAggrComp(f,h,m);f=n.showExcludedValues?D.getExcludedComp({modifier:n,dimensions:u,dimensionAndFieldList:s,valueComp:g}):g}return f},extractInputExpression:D.extractInputExpression,initModifier:function(e){D.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.accumulation.disclaimer",show:function(e,t){return!D.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=_(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.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 D.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(P))return!1;var o=_(t,e);return o&&!o.disabled}};return n}};var B="movingAverage";function V(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===B)return n[r]}function z(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===B)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};const $={translationKey:"properties.modifier.movingAverage",needDimension:D.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return D.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t,n=e.expression,r=e.modifier,i=e.properties,a=e.layout,s=e.numDimensions,l=e.dimensionAndFieldList;if(!r)return n;var u=s;void 0===u&&(u=D.getNumDimensions({properties:i,layout:a}));var c=o(i,"qHyperCubeDef.qDimensions",[]),p=r.showExcludedValues&&r.nullSuppression,d=D.getExpressionWithExcludedComp({expression:n,modifier:r,dimensions:c,dimensionAndFieldList:l,treatMissingAsNull:p}),f=D.getNumStepComp(r,u),h=D.getAboveComp(r,u,d,f);if(r.nullSuppression)t=D.getRangeComp("RangeAvg",h);else{var m=D.getRangeComp("RangeSum",h),g=function(e,t){var n=D.getRowNoComp(e,t);if(!D.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(m," / ").concat(g)}var y=t;if(D.needDimension({modifier:r,properties:i,layout:a})){var b=D.getDimComp(c,1),v=D.getDimComp(c,0),q=D.getAggrComp(y,b,v);y=r.showExcludedValues?D.getExcludedComp({modifier:r,dimensions:c,dimensionAndFieldList:l,funcComp:"Only",valueComp:q}):q}return y},extractInputExpression:D.extractInputExpression,initModifier:function(e){D.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!D.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(z(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(z(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(z(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(z(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=V(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=V(t,e);return n&&!n.fullRange}},showExcludedValues:{refFn:function(t){return"".concat(z(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0},nullSuppression:{refFn:function(t){return"".concat(z(t,e),".nullSuppression")},type:"boolean",translation:t.showNull||"properties.dimensions.showNull",schemaIgnore:!0,defaultValue:!1,inverted:!0}},show:function(e,t){return D.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(B))return!1;var o=V(t,e);return o&&!o.disabled}};return n}};var U="timeSeriesDecomposition";function W(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===U)return n[r]}function K(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===U)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var Y={type:"timeSeriesDecomposition",disabled:!1,decomposition:"",steps:2,outputExpression:""};const G={translationKey:"properties.modifier.timeSeriesDecomposition",needDimension:D.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return D.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties;return n?D.generateTSDExpression(n,t,r):t},extractInputExpression:D.extractInputExpression,initModifier:function(e,t){D.initModifier(e,Y),""===e.decomposition&&t&&(e.decomposition=D.getDecomposition(t))},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.timeSeriesDecomposition||"properties.modifier.timeSeriesDecomposition",show:function(e,t){return!D.isApplicable({properties:t.properties})}},settings:{type:"items",items:{decomposition:{refFn:function(t){return"".concat(K(t,e),".decomposition")},type:"string",translation:t.modifierTrendDecompositionDecomposition||"properties.modifier.trendDecomposition.decomposition",component:"dropdown",schemaIgnore:!0,defaultValue:t.trendDecompositionParametersDecompositionObserved||"cao.trendDecomposition.parameters.decomposition.observed",options:a.OPTIONS},steps:{refFn:function(t){return"".concat(K(t,e),".steps")},type:"integer",translation:t.modifierTimeSeriesDecompositionPeriods||"properties.modifier.timeSeriesDecomposition.periods",schemaIgnore:!0,defaultValue:2,change:function(t,n){var r=W(t,e);if(r){var i=r.steps;r.steps="number"!=typeof i||Number.isNaN(i)?2:Math.abs(i),n.properties.qHyperCubeDef.qMeasures=n.properties.qHyperCubeDef.qMeasures.map(function(e){return e.qDef.modifiers.map(function(e){return"timeSeriesDecomposition"===e.type?e.steps=i:e.steps=e.steps,e}),e})}},show:function(t){var n=W(t,e);return n&&!n.fullRange}}},show:function(e,t){return D.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(U))return!1;var o=W(t,e);return o&&!o.disabled}};return n}};var X="difference";function J(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===X)return n[r]}function Z(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===X)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var Q={type:"difference",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,outputExpression:""};const ee={translationKey:"properties.modifier.difference",needDimension:D.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return D.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:D.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,a=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=a;void 0===l&&(l=D.getNumDimensions({properties:r,layout:i}));var u=o(r,"qHyperCubeDef.qDimensions",[]),c=D.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:u,dimensionAndFieldList:s}),p=D.getAboveComp(n,l,c),d="".concat(c," - ").concat(p);if(D.needDimension({modifier:n,properties:r,layout:i})){var f=D.getDimComp(u,1),h=D.getDimComp(u,0),m=D.getAggrComp(d,f,h);d=n.showExcludedValues?D.getExcludedComp({modifier:n,dimensions:u,dimensionAndFieldList:s,funcComp:"Only",valueComp:m}):m}return d},initModifier:function(e){Object.keys(Q).forEach(function(t){void 0===e[t]&&(e[t]=Q[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!D.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(Z(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(Z(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(Z(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return D.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(X))return!1;var o=J(t,e);return o&&!o.disabled}};return n}};var te="normalization";function ne(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===te)return n[r]}function re(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===te)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}function ie(e,t){for(var n=0;n<e.length;n++)if(e[n].value===t)return n;return-1}var oe={type:"normalization",disabled:!1,primaryDimension:0,outputExpression:"",dimensionalScope:2,selectionScope:2};function ae(e){return 2===e?"{1}":""}function se(e,t,n){return 1===e?"{$<".concat(D.getFieldWithWrapper(t),"={'").concat(n,"'}>}"):""}function le(e,t){return 0===e&&t>1||2===e?"Total":""}function ue(e,t,n){return 0===e&&t>1?"<".concat(D.getDimDefWithWrapper(n),">"):""}const ce={translationKey:"properties.modifier.normalization",needDimension:function(){return!0},isApplicable:function(e){var t=e.properties,n=e.layout;return D.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:D.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,a=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=a;void 0===l&&(l=D.getNumDimensions({properties:r,layout:i}));var u=o(r,"qHyperCubeDef.qDimensions",[]),c=D.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:u,dimensionAndFieldList:s}),p=n.selectionScope,d=n.dimensionalScope;return function(e,t,n,r,i,o,a){var s=ae(t),l=se(t,n,r),u=""===s&&""===l?"":s||l,c=le(i,o),p=ue(i,o,a),d=function(e){for(var t=[],n=0;n<e;n++)t[n]=D.getDimDefWithWrapper(n);return t.join(", ")}(o);return"".concat(e,"/ Sum(").concat(u," ").concat(c).concat(p," Aggr(").concat(u," ").concat(e,", ").concat(d,"))")}(c,p,n.field,n.value,d,l,n.primaryDimension)},initModifier:function(e){Object.keys(oe).forEach(function(t){void 0===e[t]&&(e[t]=oe[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!D.isApplicable({properties:t.properties})}},settings:{type:"items",items:{selectionScope:{refFn:function(t){return"".concat(re(t,e),".selectionScope")},type:"string",translation:t.modifierSelectionScope||"properties.modifier.selectionScope",title:{translation:t.modifierSelectionScopeTooltip||"properties.modifier.selectionScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:2,options:function(n){return function(e,t,n){var r=[{value:0,translation:t.selectionScopeCurrentSelection||"properties.modifier.selectionScope.currentSelection"},{value:1,translation:t.selectionScopeSpecificValue||"properties.modifier.selectionScope.selectAField"},{value:2,translation:t.selectionScopeTotal||"properties.modifier.selectionScope.total"}];return r=function(e,t){if(1===e){var n=ie(t,0);t.splice(n,1)}return t}(ne(e,n).dimensionalScope,r),r}(n,t,e)}},field:{refFn:function(t){return"".concat(re(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 1===ne(t,e).selectionScope}},value:{refFn:function(t){return"".concat(re(t,e),".value")},type:"string",ref:"value",component:"string",translation:"properties.value",expression:"optional",show:function(t){return 1===ne(t,e).selectionScope}},dimensionalScope:{refFn:function(t){return"".concat(re(t,e),".dimensionalScope")},type:"string",translation:t.modifierDimensionalScope||"properties.modifier.dimensionalScope",title:{translation:t.modifierDimensionalScopeTooltip||"properties.modifier.dimensionalScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:2,supportTooltip:!0,options:function(n,r){return function(e,t,n,r){var i=t.layout.qHyperCube.qDimensionInfo.length,o=[{value:0,translation:n.dimensionalScopeOneDimension||"properties.modifier.dimensionalScope.respectOneDimension",tooltipTranslation:n.dimensionalScopeOneDimensionTooltip||"properties.modifier.dimensionalScope.respectOneDimension.tooltip"},{value:1,translation:n.dimensionalScopeAllDimensions||"properties.modifier.dimensionalScope.".concat(2===i?"respectAllDimensions":"respectDimension"),tooltipTranslation:n.dimensionalScopeAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===i?"respectAllDimensions":"respectDimension",".tooltip")},{value:2,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){if(e<2){var n=ie(t,0);t.splice(n,1)}return t}(i,o),o=function(e,t){if(0===e){var n=ie(t,1);t.splice(n,1)}return t}(ne(e,r).selectionScope,o),o}(n,r,t,e)}},primaryDimension:{refFn:function(t){return"".concat(re(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 0===(ne(t,e).dimensionalScope||0)&&n.layout.qHyperCube.qDimensionInfo.length>1}}},show:function(e,t){return D.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(te))return!1;var o=ne(t,e);return o&&!o.disabled}};return n},getDisregardSelectionComp:ae,getFieldSelectionComp:se,getTotalComp:le,getSelectedDimComp:ue};var pe="qDef.base",de="qDef.qDef",fe="qDef.base.qDef",he="qLibraryId",me="qDef.base.qLibraryId";const ge={getExpression:function(e){var t=o(e,fe);return void 0!==t?t:o(e,de)},getExpressionRef:function(e){return void 0!==o(e,fe)?fe:de},getLibraryIdRef:function(e){return o(e,me)?me:he},getLibraryId:function(e){return o(e,me)||o(e,he)},getLabelRef:function(e){return o(e,pe)?"qDef.base.qLabel":"qDef.qLabel"},getLabelExpressionRef:function(e){return o(e,pe)?"qDef.base.qLabelExpression":"qDef.qLabelExpression"}};var ye="qDef.qDef",be="qDef.base.qDef",ve="qLibraryId",qe="qDef.base.qLibraryId",xe="qDef.qLabel",De="qDef.qLabelExpression",Se="qDef.base.qLabel",Ce="qDef.base.qLabelExpression",Me="qDef.qAggrFunc",Ee="qDef.base.qAggrFunc",Ae={initBase:function(e,t){(t||Ae.isValid(e))&&(n(e,be,o(e,ye)),n(e,qe,o(e,ve)),n(e,Se,o(e,xe)),n(e,Ce,o(e,De)))},restoreBase:function(e){Ae.isValid(e)&&(n(e,ye,o(e,be)),n(e,ve,o(e,qe)),n(e,xe,o(e,Se)),n(e,De,o(e,Ce)),o(e,Me)&&o(e,Ee)&&n(e,Me,o(e,Ee)),delete e.qDef.base)},isValid:function(e){var t=o(e,be),n=o(e,qe);return void 0!==t||void 0!==n}};const Ie=Ae;function we(e){return we="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},we(e)}var Oe={accumulation:F,movingAverage:$,difference:ee,normalization:ce,timeSeriesDecomposition:G};const Te={modifiers:Oe,apply:Ne,applyModifiers:Le,cleanUpMeasure:Pe,destroy:function(e){e&&ke[e.id]&&ke[e.id].masterItemSubscriber&&(ke[e.id].masterItemSubscriber&&ke[e.id].masterItemSubscriber.unsubscribe(),delete ke[e.id])},hasActiveModifiers:_e,getActiveModifier:Re,initBase:Ie.initBase,isSupportedModifiers:function(e){return Array.isArray(e)&&e.some(function(e){return Oe[e]})},isApplicableSupportedModifiers:function(e){var t=e.modifierTypes,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some(function(e){return Oe[e]&&Oe[e].isApplicable({properties:n,layout:r})})},measureBase:ge,limitedSorting:function(e){var t=e.measures,n=e.properties,r=e.layout,i=!1,o=!1;return t.forEach(function(e){var t=Be(e);Ke({modifiers:t,properties:n,layout:r})&&(i=!0,o=o||Ze({modifiers:t,properties:n,layout:r}))}),i&&!o},ifEnableTotalsFunction:He};var ke={};function Ne(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.model,r=e.properties,i=e.isSnapshot,a=void 0!==i&&i,s=e.masterItem,l=!1;ke[n.id]=ke[n.id]||{isFirstTime:!0};var u=ke[n.id].isFirstTime;if(ke[n.id].isFirstTime=!1,r&&"object"===we(r))return Le({model:n,properties:r});var c=n?n.layout:void 0,p=o(c,"qSelectionInfo.qInSelections");if(a||p)return Promise.resolve(l);var d=o(c,"qHyperCube.qMeasureInfo"),f=ke[n.id].lastReloadTime;if(ke[n.id].lastReloadTime=o(n,"app.layout.qLastReloadTime"),_e({measures:d,layout:c})){var h=function(e){var t=e.measures,n=e.layout,r=e.lastReloadTime;return o(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 We({measure:e,properties:n,layout:r})})}({measures:t,layout:n})}({measures:d,layout:c,model:n,lastReloadTime:f});return h||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 Ke({modifiers:Be(t),layout:n})?!t.base:!!t.base}({measure:e,layout:n})}))}({measures:d,layout:c,masterItem:s,isFirstTime:u})?n.getEffectiveProperties().then(function(e){var r=t()(!0,{},e);ze(r);var i=Qe(r);return Ye({model:n}).then(function(t){return Ge({libraryIds:i,model:n}).then(function(i){return h&&function(e){var t=e.properties;Fe(t).forEach(function(e){return function(e){var t=e.measure;if(We({measure:t,properties:e.properties})){var n=0,r=t.qDef.modifiers;Array.isArray(r)&&r.forEach(function(e){if("object"===we(e)&&!e.disabled){if(n++,"object"!==we(Oe[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=Oe[e.type].extractInputExpression({outputExpression:t.qDef.qDef,modifier:e});void 0!==r&&$e(t)&&D.simplifyExpression(t.qDef.base.qDef)!==D.simplifyExpression(r)&&(t.qDef.base.qDef=r)}})}}({measure:e,properties:t})})}({properties:r}),Le({model:n,oldProperties:e,properties:r,runUpdateIfChange:!0,masterItem:s,libraryItemsProps:i,dimensionAndFieldList:t})})})}):Promise.resolve(l)}return function(e){return!!Array.isArray(e)&&e.some(function(e){return"object"===we(e.base)})}(d)?n.getEffectiveProperties().then(function(e){return function(e){var n=e.model,r=e.properties,i=Qe(r);return et({model:n,libraryIds:i}).then(function(){var e=t()(!0,{},r);return Fe(r).forEach(function(e){return Pe(e)}),Je({oldProperties:e,newProperties:r,model:n})})}({model:n,properties:e})}):Promise.resolve(l)}function Le(e){var n=e.model,r=e.oldProperties,i=e.properties,a=e.measures,s=e.runUpdateIfChange,l=void 0!==s&&s,u=e.masterItem,c=e.libraryItemsProps,p=e.dimensionAndFieldList;void 0===r&&(r=l?t()(!0,{},i):i),ze(i);var d=Qe(i);return et({model:n,libraryIds:d,masterItem:u}).then(function(){return function(e){var n=e.measures,r=e.properties,i=e.model,a=e.libraryItemsProps,s=e.dimensionAndFieldList;if(n||(n=Fe(r)),!n.length)return Promise.resolve();if(!_e({measures:n,properties:r}))return n.forEach(function(e){return Pe(e)}),Promise.resolve();var l=a?void 0:Qe(r);return Ye({model:i,dimensionAndFieldList:s}).then(function(e){return Ge({libraryIds:l,model:i,libraryItemsProps:a}).then(function(i){n.forEach(function(n){Ke({modifiers:n.qDef.modifiers,properties:r})?(function(e){var n=e.measure,r=e.properties,i=e.libraryItemsProps,a=e.dimensionAndFieldList,s=0;Ie.isValid(n)||Ie.initBase(n,!0);var l=n.qDef,u=l.modifiers,c=l.base;Array.isArray(u)&&u.forEach(function(e){if("object"===we(e)&&!e.disabled){if(s++,"object"!==we(Oe[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)");Oe[e.type].initModifier(e,n);var l=n.qLibraryId||c&&c.qLibraryId;l?function(e){var n=e.measure,r=e.modifier,i=e.properties,o=e.dimensionAndFieldList,a=e.libraryItemsProps[e.libraryId],s=a.qMeasure.qDef,l=""===s?s:Oe[r.type].generateExpression({expression:s,modifier:r,properties:i,dimensionAndFieldList:o});r.outputExpression=l,n.qDef.qDef=r.outputExpression,(n.qDef.qLabel||a.qMeasure.qLabel)&&(n.qDef.qLabel=a.qMeasure.qLabel),(n.qDef.qLabelExpression||a.qMeasure.qLabelExpression)&&(n.qDef.qLabelExpression=a.qMeasure.qLabelExpression),n.qDef.quarantine&&n.qDef.quarantine.qNumFormat&&a.qMeasure.qNumFormat&&(n.qDef.qNumFormat=a.qMeasure.qNumFormat,n.qDef.isCustomFormatted=a.qMeasure.isCustomFormatted),delete n.qLibraryId,n.qDef.coloring=a.qMeasure.coloring,r.base=t()(!0,{},n.qDef.base)}({measure:n,modifier:e,libraryId:l,properties:r,libraryItemsProps:i,dimensionAndFieldList:a}):function(e){var n=e.measure,r=e.modifier,i=e.properties,o=e.dimensionAndFieldList;"function"==typeof Oe[r.type].updateModifier&&Oe[r.type].updateModifier(r,i.qHyperCubeDef);var a=ge.getExpression(n),s=""===a?a:Oe[r.type].generateExpression({expression:a,modifier:r,properties:i,dimensionAndFieldList:o});r.outputExpression=s,n.qDef.qDef=r.outputExpression,n.qDef.base.qLabelExpression?n.qDef.qLabelExpression=n.qDef.base.qLabelExpression:n.qDef.qLabel=n.qDef.base.qLabel||a,r.base=t()(!0,{},n.qDef.base)}({measure:n,modifier:e,properties:r,dimensionAndFieldList:a}),function(e){var t=o(e,"qDef.qAggrFunc");"Expr"!==t||He(e)?"None"!==t?delete e.qDef.base.qAggrFunc:"None"===t&&He(e)&&"Expr"===e.qDef.base.qAggrFunc&&(e.qDef.qAggrFunc="Expr",delete e.qDef.base.qAggrFunc):(e.qDef.qAggrFunc="None",e.qDef.base.qAggrFunc="Expr")}(n)}})}({measure:n,properties:r,libraryItemsProps:i,dimensionAndFieldList:e}),je(n)):Pe(n)})})})}({measures:a,properties:i,model:n,libraryItemsProps:c,dimensionAndFieldList:p}).then(function(){return l?Je({oldProperties:r,newProperties:i,model:n}):Promise.resolve(!1)})})}function Pe(e){!function(e){var t=Be(e);return Array.isArray(t)&&t.some(function(e){return"object"===we(e)&&!e.disabled&&!Oe[e.type]})}(e)?Ie.restoreBase(e):delete e.qDef.base,e.qDef.coloring&&delete e.qDef.coloring,je(e)}function _e(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some(function(e){return Ke({modifiers:Be(e),properties:n,layout:r})})}function Re(e){var t=Be(e);if(Array.isArray(t))for(var n=0;n<t.length;n++){var r=t[n];if(Oe[r.type]&&!r.disabled)return r}}function He(e){var t=Re(e);return!t||Oe[t.type].enableTotalsFunction(e)}function Fe(e){return o(e,"qHyperCubeDef.qMeasures",[]).concat(o(e,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",[]))}function Be(e){return e.modifiers||e.qDef&&e.qDef.modifiers}function Ve(e){return o(e,"outputExpression.qValueExpression.qExpr")||o(e,"outputExpression")}function ze(e){Fe(e).forEach(function(e){return function(e){var n=Re(e);n&&(void 0!==n.outputExpression&&Ve(n)!==e.qDef.qDef?delete e.qDef.base:!Ie.isValid(e)&&n.base&&(e.qDef.base=t()(!0,{},n.base)))}(e)})}function je(e){var t=Be(e);Array.isArray(t)&&t.forEach(function(t){"object"===we(t)&&(t.disabled||!Oe[t.type]&&Ve(t)!==e.qDef.qDef)&&(t.disabled=!0,delete t.base)})}function $e(e){return e.base||e.qDef&&e.qDef.base}function Ue(e){var t=$e(e);return e.qLibraryId||t&&t.qLibraryId}function We(e){var t=e.measure,n=e.properties,r=e.layout;return!Ue(t)&&Ke({modifiers:Be(t),properties:n,layout:r})}function Ke(e){var t=e.modifiers,n=e.properties,r=e.layout,i={};return Array.isArray(t)&&t.some(function(e){return!("object"!==we(e)||e.disabled||!Oe[e.type])&&(void 0===i[e.type]&&(i[e.type]=Oe[e.type].isApplicable({properties:n,layout:r})),i[e.type])})}function Ye(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 Ge(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 Xe(e,t){if(""!==t||-1===["qFmt","qDec","qThou"].indexOf(e))return t}function Je(e){var t=e.oldProperties,n=e.newProperties,r=e.model,i=JSON.stringify(o(t,"qHyperCubeDef.qMeasures"),Xe)!==JSON.stringify(o(n,"qHyperCubeDef.qMeasures"),Xe)||JSON.stringify(o(t,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Xe)!==JSON.stringify(o(n,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Xe);return i?function(e){var t=e.model,n=e.oldProperties,r=e.newProperties,i=t.layout;return i&&!i.qHasSoftPatches&&!i.qExtendsId&&o(i,"qMeta.privileges",[]).indexOf("update")>-1?t.setProperties(r):L(t,n,r)}({model:r,oldProperties:t,newProperties:n}).then(function(){return i}):Promise.resolve(i)}function Ze(e){var t=e.modifiers,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some(function(e){return"object"===we(e)&&!e.disabled&&Oe[e.type]&&Oe[e.type].needDimension({modifier:e,properties:n,layout:r})})}function Qe(e){var t=Fe(e),n=[],r=[],i=!1;return t.forEach(function(t){var r=Be(t);if(Ke({modifiers:r,properties:e})){var o=Ue(t);o&&n.push(o),i=i||Ze({modifiers:r,properties:e})}}),o(e,"qHyperCubeDef.qDimensions",[]).forEach(function(e){var t=e.qLibraryId;t&&r.push(t)}),{measureLibraryIds:n,dimensionLibraryIds:r}}function et(e){var t=e.model,n=e.libraryIds;return!e.masterItem&&n&&(n.measureLibraryIds.length||n.dimensionLibraryIds.length)?(ke[t.id].masterItemSubscriber=ke[t.id].masterItemSubscriber||function(e){var t=e.model,n=e.callback,r={},i={},a={},s={dimension:["qDim.qFieldDefs"],measure:["qMeasure.qDef","qMeasure.qLabel","qMeasure.qLabelExpression","qMeasure.coloring","qMeasure.qNumFormat","qMeasure.isCustomFormatted"]};function l(e){var t={},n=o(e,"qInfo.qType");return n&&s[n]&&s[n].forEach(function(n){t[n]=o(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,o=e.dimensionLibraryIds,s=[];return function(e){var t=e.dimensionLibraryIds;i={},e.measureLibraryIds.forEach(function(e){i[e]=!0}),a={},t.forEach(function(e){a[e]=!0})}({measureLibraryIds:n,dimensionLibraryIds:o}),Object.keys(r).forEach(function(e){i[e]||a[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(a).forEach(function(e){a[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 Ne({model:t,masterItem:e}).then(function(){return t.app.clearUndoBuffer()})}}),ke[t.id].masterItemSubscriber.subscribe(n)):Promise.resolve()}})(),t.default=i.default,Object.defineProperty(t,"__esModule",{value:!0})})()}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var r={};return(()=>{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)}function t(n){var r=e(n%62),i=Math.floor(n/62);return i>0?t(i)+r:r}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},i(e)}n.d(r,{default:()=>ze});const 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 t(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}const p={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};var d=n(8),f=n.n(d);const h=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))},m=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))},g=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&&p.isOrderedSubset(i,r.interColumnSortOrder)&&(r.interColumnSortOrder=i.concat())},y=function(e){var t=e.exportFormat,n=e.properties;Object.keys(n).forEach(function(e){t.properties[e]=n[e]})},b=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},v=function(e){e.forEach(function(e){f().cleanUpMeasure(e),e.qDef.modifiers&&(e.store={modifiers:e.qDef.modifiers},delete e.qDef.modifiers)})};function q(e,t,n){var r,i,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=o.getValue(e,t);if(!o.isAtomicValue(s))try{if((i=(i=(r=JSON.stringify(s)).match(/:\{/g))?i.length:0)>2&&!a)return;s=JSON.parse(r)}catch(e){return}o.getValue(e,"qLayoutExclude.quarantine")||o.setValue(e,"qLayoutExclude.quarantine",{});var l=o.getValue(e,"qLayoutExclude.quarantine");l[n]||(l[n]={}),l[n][t]=s}var x=n(909),D=n.n(x);function S(e,t){var n=D()(!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 C(e,t){return D()(!0,{},t,e)}function M(e,t,n){return"function"==typeof e?e(t):Number.isNaN(+e)?n:e}var E=Math.pow(2,53)-1;function A(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 I(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}const w=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},O=function(e,t,n){t.hasOwnProperty(e)&&(n[e]=t[e])},T=function(e,t,n,r){t.hasOwnProperty(e)?n[e]=t[e]:n[e]=r},k=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}}},N=function(){return{qDef:{autoSort:!0,cId:"",numFormatFromTemplate:!0},qLibraryId:"",qTrendLines:[]}},L=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=S(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=S(s.excludedDimensions[t],a);o.qDimensions.length<i?o.qDimensions.push(u):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(u)}},P=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=C(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=C(s.excludedMeasures[t],a);o.qMeasures.length<i?o.qMeasures.push(u):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(u)}},_=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=M(a.max,i.dimensions.length,E),l=M(a.min,i.dimensions.length,0);return{maxDimensions:M(o.max,s,E),minDimensions:M(o.min,l,0),maxMeasures:s,minMeasures:l}},R=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?(p.indexAdded(n.qInterColumnSortOrder,o),++o):(--o,p.indexRemoved(n.qInterColumnSortOrder,o))},H=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=D()(!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=D()(!0,{},n,i)).components&&(i.components=[]),i},F=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},B=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=[]))},V=function(e){var t,n=e.newProperties,r=e.dataDefinition,i=e.hypercubePath;if(r.dimensions&&"function"==typeof r.dimensions.added){var a=o.getValue(n,i||"").qHyperCubeDef,s=function(e){if(Array.isArray(e))return A(e)}(t=a.qDimensions)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return A(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)?A(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();a.qDimensions=[],s.forEach(function(e){a.qDimensions.push(e),r.dimensions.added(e,n)})}},z=function(e){var t,n=e.newProperties,r=e.dataDefinition,i=e.hypercubePath;if(r.measures&&"function"==typeof r.measures.added){var a=o.getValue(n,i||"").qHyperCubeDef,s=function(e){if(Array.isArray(e))return I(e)}(t=a.qMeasures)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return I(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)?I(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();a.qMeasures=[],s.forEach(function(e){a.qMeasures.push(e),r.measures.added(e,n)})}},j=function(e){var t=e.measures,n=e.modifierTypes;t&&n&&f().isSupportedModifiers(n)&&t.forEach(function(e){e.store&&e.store.modifiers&&(e.qDef.modifiers=e.store.modifiers),delete e.store})};function $(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)}const U={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=[]),h({exportFormat:i,qHyperCubeDef:l}),m({exportFormat:i,qHyperCubeDef:l}),g({exportFormat:i,qHyperCubeDef:l}),delete l.qLayoutExclude,y({exportFormat:i,properties:a}),n&&(i.properties.qHyperCubeDef=l,delete s.qHyperCubeDef),b({exportFormat:i,properties:a}),r||v(i.properties.qHyperCubeDef.qMeasures),Array.isArray(i.properties.filters)&&(q(i.properties,"filters","storedFilters",!0),delete i.properties.filters),i.properties.qHyperCubeDef.qContextSetExpression&&(q(i.properties,"qHyperCubeDef.qContextSetExpression","storedFilters"),i.properties.qHyperCubeDef.qContextSetExpression=""),i.properties.qHyperCubeDef.qDynamicScript&&i.properties.qHyperCubeDef.qDynamicScript.length&&(q(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,p=e.supportedFilters,d=void 0===p||p,f=e.isHCModifierSupported,h=void 0===f||f,m={qChildren:[]},g=H({exportFormat:t,initialProperties:r,hypercubePath:u}),y=o.getValue(r,u||"").qHyperCubeDef,b=o.getValue(g,u||"").qHyperCubeDef,v=_({exportFormat:t,dataDefinition:a}),q=v.maxDimensions,x=v.minDimensions,D=v.maxMeasures,S=v.minMeasures,C=l.defaultDimension,M=void 0===C?k():C,E=l.defaultMeasure,A=void 0===E?N():E;b.qDimensions.length=0,b.qMeasures.length=0,F({exportFormat:t,maxDimensions:q,minDimensions:x,maxMeasures:D,minMeasures:S})&&B({exportFormat:t,maxDimensions:q,minDimensions:x,maxMeasures:D,minMeasures:S,newHyperCubeDef:b}),L({exportFormat:t,maxDimensions:q,minDimensions:x,newHyperCubeDef:b,defaultDimension:M}),P({exportFormat:t,maxMeasures:D,minMeasures:S,newHyperCubeDef:b,defaultMeasure:A}),V({newProperties:g,dataDefinition:a,hypercubePath:u}),z({newProperties:g,dataDefinition:a,hypercubePath:u}),R({exportFormat:t,newHyperCubeDef:b}),O("qMaxStackedCells",y,b),O("qNoOfLeftDims",y,b),T("qInitialDataFetch",y,b,[{qTop:0,qLeft:0,qWidth:0,qHeight:0}]),T("qMode",y,b,"S"),T("qReductionMode",y,b,"N"),T("qSortbyYValue",y,b),T("qIndentMode",y,b),T("qShowTotalsAbove",y,b),w(g,t,r),m.qProperty=g;var I=o.getValue(c||{},"support.modifiers");return j({measures:b.qMeasures,modifierTypes:I}),d&&$(m.qProperty,"storedFilters"),"S"===b.qMode&&h&&$(m.qProperty,"dynamicScript"),m}};var W={cellBackgroundColor:!0,cellForegroundColor:!0,colorByAlternative:!0,colorByExpression:!0,tooltip:!0,urlLabel:!0,url:!0};function K(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 Y(e,t){return e.length!==t}const G={create:function(e,t){if(!e||!W[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(K(a,t,r,i),Y(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"}},X={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}},J={colorModeOptions:{primary:function(){return!0},dimension:function(e){return X.getNumDimensions(e)>0&&X.getNumMeasures(e)<=1},multiColor:function(e){return X.getNumMeasures(e)>1},measure:function(e){return X.getNumDimensions(e)>0},expression:function(e){return X.getNumMeasures(e)>=1}}},Z={colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return X.getNumMeasures(e)>=1}}};var Q={scatterplot:Z,"sn-scatter-plot":Z,piechart:{colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return X.getNumMeasures(e)>=1}}},linechart:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return X.getNumDimensions(e)>1},multiColor:function(e){return X.getNumMeasures(e)>1},measure:function(e){return X.getNumDimensions(e)<=1},expression:function(e){return X.getNumMeasures(e)>=1}}},map:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return X.getNumDimensions(e)>=1},multiColor:function(e){return X.getNumMeasures(e)>1},measure:function(e){return X.getNumDimensions(e)>=1},expression:function(e){return X.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 X.getNumDimensions(e)>=1}}}};function ee(e,t,n){if(Array.isArray(e[t])){var r=p.findIndexByPropertyValue(e[t],"id",n);r>=0&&e[t].splice(r,1)}else e[t]=[]}function te(e,t){var n=G.IDMAP.COLOR_BY_ALTERNATIVE;e.forEach(function(e){ee(e,"qAttributeDimensions",n),ee(e,"qAttributeExpressions",n)}),t.forEach(function(e){ee(e,"qAttributeDimensions",n),ee(e,"qAttributeExpressions",n)})}function ne(e,t){if(t){var n="="===t.charAt(0);e.color.altLabel=n?{qStringExpression:{qExpr:t.substr(1)}}:t}}function re(e){var t=e.properties,n=e.isDimension,r=e.dimensions,i=e.excludedDimensions,a=e.measures,s=e.label;te(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"),d=o.getValue(t,"color.formatting.isCustomFormatted");if(u){var f=G.create(G.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:d});break;case"libraryItem":!function(e){var t=e.attributeExpression,n=e.measures,r=e.item,i=e.qNumFormat,o=e.isCustomFormatted;e.isDimension||(t.matchMeasure=p.findIndexByPropertyValue(n,"qLibraryId",r.key),i&&(t.qNumFormat=i,t.isCustomFormatted=o)),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:d})}n?(f.qSortBy={qSortByAscii:1},l.qAttributeDimensions.push(f)):l.qAttributeExpressions.push(f)}}}function ie(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().measureBase.getLibraryId(e)}(n,t),i?(s.type="measure",s.name=i,s.id=i,o=function(e,t){return f().hasActiveModifiers({measures:[e]})&&t?e.qDef.qDef:void 0}(n,r),o&&(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}const oe={useMasterNumberFormat:function(e){e.quarantine={qNumFormat:e.qNumFormat||{},isCustomFormatted:e.isCustomFormatted||!1},e.qNumFormat=null,e.isCustomFormatted=void 0}};function ae(e,t,n,r){var i=t.type,o=e.color,a=o.mode,s=X.getItemLabel(t);switch(ne(e,s||""),i){case"field":a="byDimension",o.byDimDef={label:t.label||X.wrapFieldName(t.name),key:X.wrapFieldName(t.name),type:"expression",activeDimensionIndex:t.activeDimensionIndex};break;case"expression":a="byMeasure",o.byMeasureDef={label:s,key: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&&oe.useMasterNumberFormat(o.formatting)}o.auto=!1,o.mode=a}function se(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&&ne(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=ie("dimension",!1,n[r.activeDimensionIndex]);i.activeDimensionIndex=r.activeDimensionIndex,ae(e,i)}(e,t);else if(function(e){return!e||!e.key}(a)&&function(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=G.IDMAP.COLOR_BY_ALTERNATIVE,a=p.findItemByPropertyValue(r.qAttributeDimensions,"id",i);return ae(e,ie("dimension",!!a,a||r)),!!a}(e,t))return;re({properties:e,isDimension:!0,dimensions:n,excludedDimensions:i,measures:r,label:o.getValue(e,"color.byDimDef.label")})}const le=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)},ue=function(e,t){var n={primary:!0};if(e){var r=(Q[t]||J).colorModeOptions||J.colorModeOptions;n.byDimension=r.dimension(e),n.byMeasure=r.measure(e),n.byMultiple=r.multiColor(e),n.byExpression=r.expression(e)}return n},ce=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))},pe=function(e,t){var n,r=o.getValue(e,"color.mode"),i=o.getValue(e,"color.auto"),a=o.getValue(e,"".concat(t,"qDimensions"),[]),s=o.getValue(e,"".concat(t,"qMeasures"),[]),l=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);i?te(a,l):!(n={auto:i,colorMode:r,dimensions:a}).auto&&"byDimension"===n.colorMode&&n.dimensions.length>0?se(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:i,colorMode:r,dimensions:a,measures:s,properties:e})?function(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&&ne(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=ie("measure",!1,n[r.activeMeasureIndex],!0);i.activeMeasureIndex=r.activeMeasureIndex,ae(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=G.IDMAP.COLOR_BY_ALTERNATIVE,s=p.findItemByPropertyValue(i.qAttributeExpressions,"id",a);return ae(e,ie("measure",!!s,s||r[0])),!!s}(e,t))return;re({properties:e,isDimension:!1,dimensions:n,excludedDimensions:i,measures:r,label:o.getValue(e,"color.byMeasureDef.label")})}(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"),te(r,a)}(e,t)},de=function(e){e.forEach(function(e){e.qOtherTotalSpec&&"qTotalMode"in e.qOtherTotalSpec&&delete e.qOtherTotalSpec.qTotalMode})},fe=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},he=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)},me=function(e){o.setValue(e,"color.mode","primary"),o.setValue(e,"color.auto",!0)},ge=function(e){var t=o.getValue(e,"qHyperCubeDef.qDimensions",[]),n=o.getValue(e,"color.persistent",!1);return t.length>1&&!n},ye={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=U.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),o=i.data[0],a=o.dimensions.concat(o.excludedDimensions),s=o.measures.concat(o.excludedMeasures),l=G.IDMAP,u=l.COLOR_BY_ALTERNATIVE,c=l.COLOR_BY_EXPRESSION;return G.moveByIdFromGroup(a,[],"qAttributeDimensions",u),G.moveByIdFromGroup(a,[],"qAttributeExpressions",u),G.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=U.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:a,extension:s,supportedFilters:l,isHCModifierSupported:u}),p=c.qProperty,d=o.getValue(p,"visualization"),f=o.getValue(p,"qHyperCubeDef.qDimensions",[]),h=o.getValue(p,"color.mode",""),m=o.getValue(p,"color.auto",""),g=ue(p,d),y=ce({canColorBy:g,autoColor:m,colorMode:h,dimensions:f});return g[h]?fe({shouldUpdateColorBy:y,properties:p})&&he(p):me(p),y&&pe(p,"qHyperCubeDef."),ge(p)&&le(p,"color.persistent",!0),de(f),c}};var be=["bar","marker","line"];const ve=function(e){var t=e.initialProperties,n=e.properties;t.measureAxis&&void 0===t.measureAxis.autoMinMax?$(n,"unsupportedAutoMinMax")||D()(n.measureAxis,t.measureAxis):$(n,"supportedAutoMinMax")||D()(n.measureAxis,t.measureAxis)},qe=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.initialProperties;return!(!e.exportFormat.properties.measureAxes||t.measureAxes||!t.measureAxis||void 0===t.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}}),be.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]&&D()(s,n.properties.measureAxes[t[0].axis])):D()(s,n.properties.measureAxes[0])}},xe=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}}},De={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=e.supportedAutoMinMax,o=void 0===i||i,a=ye.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),s=a.properties;return o?(q(s,"measureAxis.min","supportedAutoMinMax"),q(s,"measureAxis.max","supportedAutoMinMax")):(q(s,"measureAxis.min","unsupportedAutoMinMax"),q(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=ye.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:o,extension:s,supportedFilters:l,isHCModifierSupported:u}),p=c.qProperty;return ve({initialProperties:n,properties:p}),qe({exportFormat:t,initialProperties:n,properties:p,measureType:a}),xe(p.qHyperCubeDef),p.qHyperCubeDef.qColumnOrder=[],p.qHyperCubeDef.columnOrder=[],c}};function Se(e,t,n){return"qLayoutExclude.quarantine.".concat(e,".").concat(t,".").concat(n)}function Ce(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=Se(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 Me(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=Se(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 Ee="qHyperCubeDef.qMeasures",Ae="conditionalColoring",Ie="measures",we="qDef.conditionalColoring";const Oe={quarantine:function(e){Ce({properties:e,arrayPath:Ee,quarantineName:Ae,arrayName:Ie,itemPath:we})},unquarantine:function(e){Me({properties:e,arrayPath:Ee,itemPath:we,arrayName:Ie,quarantineName:Ae})}};var Te="qHyperCubeDef.qMeasures",ke="measures",Ne="qHyperCubeDef.qDimensions",Le="dimensions",Pe="qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",_e="alternativeMeasures",Re="qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions",He="alternativeDimensions",Fe="qCalcCondition",Be="conditionalShowHide";const Ve={quarantine:function(e){Ce({properties:e,arrayPath:Te,quarantineName:Be,arrayName:ke,itemPath:Fe}),Ce({properties:e,arrayPath:Ne,quarantineName:Be,arrayName:Le,itemPath:Fe})},unquarantine:function(e){Me({properties:e,arrayPath:Te,quarantineName:Be,arrayName:ke,itemPath:Fe}),Me({properties:e,arrayPath:Ne,quarantineName:Be,arrayName:Le,itemPath:Fe})},quarantineAlternative:function(e){Ce({properties:e,arrayPath:Pe,quarantineName:Be,arrayName:_e,itemPath:Fe}),Ce({properties:e,arrayPath:Re,quarantineName:Be,arrayName:He,itemPath:Fe})},unquarantineAlternative:function(e){Me({properties:e,arrayPath:Pe,quarantineName:Be,arrayName:_e,itemPath:Fe}),Me({properties:e,arrayPath:Re,quarantineName:Be,arrayName:He,itemPath:Fe})}},ze={hypercube:U,colorChart:ye,axisChart:De,quarantineProperty:q,unquarantineProperty:$,quarantineArrayProp:Ce,unquarantineArrayProp:Me,conditionalColoring:Oe,conditionalShow:Ve}})(),r.default})()),vt.exports),xt=yt(qt);function Dt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function St(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ct(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 Mt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ct(Object(n),!0).forEach(function(t){St(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ct(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Et(e){return function(e){if(Array.isArray(e))return Dt(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 Dt(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Dt(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 At(e){return At="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},At(e)}var It,wt="top",Ot="top-right",Tt="right",kt="bottom-right",Nt="bottom",Lt="bottom-left",Pt="left",_t="top-left";St(St(St(St(St(St(St(St(St(St(It={},"equal-equal",[wt,Nt]),"equal-higher",[Nt,kt]),"equal-lower",[wt,Ot]),"equal-void",[wt,Nt]),"higher-equal",[Pt,Lt,wt,Ot]),"higher-higher-acute",[Nt,Lt,Pt,Ot]),"higher-higher-obtuse",[Nt,wt]),"higher-lower-negative",[wt,Ot,Tt]),"higher-lower-positive",[Nt,Lt,Pt]),"higher-void",[wt]),St(St(St(St(St(St(St(St(St(St(It,"lower-equal",[wt]),"lower-higher-negative",[wt,_t]),"lower-higher-positive",[kt]),"lower-lower-acute",[wt,_t,Pt,Ot,Tt]),"lower-lower-obtuse",[wt,Nt]),"lower-void",[wt]),"void-equal",[wt]),"void-higher",[wt,Nt]),"void-lower",[wt,Nt,Pt]),"void-void",[wt]),St(It,"unclassified",[wt,Nt,Tt,Pt,Ot,kt,Lt,_t]);var Rt=["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"],Ht=["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 Ft=function(e){return{value:e,label:e.charAt(0).toUpperCase()+e.slice(1),groupHeader:!1,disabled:!1,styles:{fontFamily:e}}};function Bt(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,Et(new Set([r].concat(Et(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(Et(o.map(function(e){return Ft(e)})),[{value:"DefaultHeader",label:n.get("properties.allFonts"),metaText:n.get("properties.default"),groupHeader:!0}],Et(function(e){return null!=e&&e.isEnabled("PS_20852_WYSIWYG_FONT_SUPPORT")?Ht:Rt}(i).map(function(e){return Ft(e)})))}function Vt(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 Bt({theme:t,translator:n,defaultValue:a(),flags:o})}}}var zt,jt,$t=["10px","11px","12px","13px","14px","15px","16px","17px","18px","19px","20px","21px","22px","23px","24px"],Ut=function(e){return{value:e,label:e,groupHeader:!1,disabled:!1}};function Wt(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,Et(new Set([n].concat(Et(i))))):r.push(n),[{value:"ThemeHeader",label:t.get("properties.themeFontSizes"),metaText:t.get("properties.theme"),groupHeader:!0}].concat(Et(r.map(function(e){return Ut(e)})),[{value:"DefaultHeader",label:t.get("properties.allFontSizes"),metaText:t.get("properties.default"),groupHeader:!0}],Et($t.map(function(e){return Ut(e)})))}({theme:t,translator:n,defaultValue:o()})}}}function Kt(e){var t=e.theme,n=e.translator,r=e.id,i=e.path;return{fontFamily:Vt({theme:t,translator:n,id:r,path:i,flags:e.flags}),fontSize:Wt({theme:t,translator:n,id:r,path:i})}}function Yt(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]=Kt({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}var Gt,Xt=function(){if(jt)return zt;jt=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===t.call(e)},o=function(n){if(!n||"[object Object]"!==t.call(n))return!1;var r,i=e.call(n,"constructor"),o=n.constructor&&n.constructor.prototype&&e.call(n.constructor.prototype,"isPrototypeOf");if(n.constructor&&!i&&!o)return!1;for(r in n);return void 0===r||e.call(n,r)},a=function(e,t){n&&"__proto__"===t.name?n(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},s=function(t,n){if("__proto__"===n){if(!e.call(t,n))return;if(r)return r(t,n).value}return t[n]};return zt=function e(){var t,n,r,l,u,c,p=arguments[0],d=1,f=arguments.length,h=!1;for("boolean"==typeof p&&(h=p,p=arguments[1]||{},d=2),(null==p||"object"!=typeof p&&"function"!=typeof p)&&(p={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)r=s(p,n),p!==(l=s(t,n))&&(h&&l&&(o(l)||(u=i(l)))?(u?(u=!1,c=r&&i(r)?r:[]):c=r&&o(r)?r:{},a(p,{name:n,newValue:e(h,c,l)})):void 0!==l&&a(p,{name:n,newValue:l}));return p},zt}(),Jt=(Gt=Xt)&&Gt.__esModule&&Object.prototype.hasOwnProperty.call(Gt,"default")?Gt.default:Gt;function Zt(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 Qt(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 en(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 tn(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 nn(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 rn(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function on(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function an(){}var sn=1/.7,ln="\\s*([+-]?\\d+)\\s*",un="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",cn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",pn=/^#([0-9a-f]{3,8})$/,dn=new RegExp(`^rgb\\(${ln},${ln},${ln}\\)$`),fn=new RegExp(`^rgb\\(${cn},${cn},${cn}\\)$`),hn=new RegExp(`^rgba\\(${ln},${ln},${ln},${un}\\)$`),mn=new RegExp(`^rgba\\(${cn},${cn},${cn},${un}\\)$`),gn=new RegExp(`^hsl\\(${un},${cn},${cn}\\)$`),yn=new RegExp(`^hsla\\(${un},${cn},${cn},${un}\\)$`),bn={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 vn(){return this.rgb().formatHex()}function qn(){return this.rgb().formatRgb()}function xn(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=pn.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?Dn(t):3===n?new En(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?Sn(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?Sn(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=dn.exec(e))?new En(t[1],t[2],t[3],1):(t=fn.exec(e))?new En(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=hn.exec(e))?Sn(t[1],t[2],t[3],t[4]):(t=mn.exec(e))?Sn(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=gn.exec(e))?kn(t[1],t[2]/100,t[3]/100,1):(t=yn.exec(e))?kn(t[1],t[2]/100,t[3]/100,t[4]):bn.hasOwnProperty(e)?Dn(bn[e]):"transparent"===e?new En(NaN,NaN,NaN,0):null}function Dn(e){return new En(e>>16&255,e>>8&255,255&e,1)}function Sn(e,t,n,r){return r<=0&&(e=t=n=NaN),new En(e,t,n,r)}function Cn(e){return e instanceof an||(e=xn(e)),e?new En((e=e.rgb()).r,e.g,e.b,e.opacity):new En}function Mn(e,t,n,r){return 1===arguments.length?Cn(e):new En(e,t,n,null==r?1:r)}function En(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function An(){return`#${Tn(this.r)}${Tn(this.g)}${Tn(this.b)}`}function In(){const e=wn(this.opacity);return`${1===e?"rgb(":"rgba("}${On(this.r)}, ${On(this.g)}, ${On(this.b)}${1===e?")":`, ${e})`}`}function wn(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function On(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Tn(e){return((e=On(e))<16?"0":"")+e.toString(16)}function kn(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 Nn(e){if(e instanceof Ln)return new Ln(e.h,e.s,e.l,e.opacity);if(e instanceof an||(e=xn(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)}function Ln(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function Pn(e){return(e=(e||0)%360)<0?e+360:e}function _n(e){return Math.max(0,Math.min(1,e||0))}function Rn(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}rn(an,xn,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:vn,formatHex:vn,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Nn(this).formatHsl()},formatRgb:qn,toString:qn}),rn(En,Mn,on(an,{brighter(e){return e=null==e?sn:Math.pow(sn,e),new En(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new En(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new En(On(this.r),On(this.g),On(this.b),wn(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:An,formatHex:An,formatHex8:function(){return`#${Tn(this.r)}${Tn(this.g)}${Tn(this.b)}${Tn(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:In,toString:In})),rn(Ln,function(e,t,n,r){return 1===arguments.length?Nn(e):new Ln(e,t,n,null==r?1:r)},on(an,{brighter(e){return e=null==e?sn:Math.pow(sn,e),new Ln(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new Ln(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 En(Rn(e>=240?e-240:e+120,i,r),Rn(e,i,r),Rn(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Ln(Pn(this.h),_n(this.s),_n(this.l),wn(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=wn(this.opacity);return`${1===e?"hsl(":"hsla("}${Pn(this.h)}, ${100*_n(this.s)}%, ${100*_n(this.l)}%${1===e?")":`, ${e})`}`}}));const Hn=Math.PI/180,Fn=180/Math.PI,Bn=4/29,Vn=6/29,zn=3*Vn*Vn;function jn(e){if(e instanceof $n)return new $n(e.l,e.a,e.b,e.opacity);if(e instanceof Gn)return Xn(e);e instanceof En||(e=Cn(e));var t,n,r=Yn(e.r),i=Yn(e.g),o=Yn(e.b),a=Un((.2225045*r+.7168786*i+.0606169*o)/1);return r===i&&i===o?t=n=a:(t=Un((.4360747*r+.3850649*i+.1430804*o)/.96422),n=Un((.0139322*r+.0971045*i+.7141733*o)/.82521)),new $n(116*a-16,500*(t-a),200*(a-n),e.opacity)}function $n(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function Un(e){return e>.008856451679035631?Math.pow(e,1/3):e/zn+Bn}function Wn(e){return e>Vn?e*e*e:zn*(e-Bn)}function Kn(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Yn(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Gn(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function Xn(e){if(isNaN(e.h))return new $n(e.l,0,0,e.opacity);var t=e.h*Hn;return new $n(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}rn($n,function(e,t,n,r){return 1===arguments.length?jn(e):new $n(e,t,n,null==r?1:r)},on(an,{brighter(e){return new $n(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new $n(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 En(Kn(3.1338561*(t=.96422*Wn(t))-1.6168667*(e=1*Wn(e))-.4906146*(n=.82521*Wn(n))),Kn(-.9787684*t+1.9161415*e+.033454*n),Kn(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),rn(Gn,function(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof Gn)return new Gn(e.h,e.c,e.l,e.opacity);if(e instanceof $n||(e=jn(e)),0===e.a&&0===e.b)return new Gn(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*Fn;return new Gn(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new Gn(e,t,n,null==r?1:r)},on(an,{brighter(e){return new Gn(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new Gn(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return Xn(this).rgb()}}));var Jn=e=>()=>e;function Zn(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):Jn(isNaN(e)?t:e)}var Qn=function e(t){var n=function(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):Jn(isNaN(t)?n:t)}}(t);function r(e,t){var r=n((e=Mn(e)).r,(t=Mn(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),er=/^class(-pyramid)?/,tr=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,p=t.colors.map(function(t){return e.resolveUIColor(t)});if(i=Math.min.apply(Math,[i].concat(Et(c))),o=Math.max.apply(Math,[o].concat(Et(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:p,limits:"percent"===t.limitType?c:l}));else if(t.breakTypes){var d=t.breakTypes;u.type="continuous",u.domain=[i],u.range=[p[0]];for(var f=0;f<c.length;f+=1)if(d[f]){var h=p[f],m=p[f+1],g=Qn(h,m)(.5);u.range.push(g),u.domain.push(c[f]),f<c.length-1&&d[f+1]&&(u.range.push(p[f+1]),u.domain.push((c[f]+c[f+1])/2))}else u.range.push(p[f]),u.range.push(p[f+1]),u.domain.push(c[f]),u.domain.push(c[f]+Math.min(1e-6,(o-i)/1e6));u.range.push(p[p.length-1]),u.domain.push(o)}else u.domain=c,u.range=p;return u};function nr(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):nr(e,t,n,r+1,i)}var rr=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=[],p=!0;if(l){if(Number.isNaN(+l.min())||Number.isNaN(+l.max()))return{invalid:!0};(p=!("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,Et(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&&!p)u.min=l.min(),u.max=l.max();else if(l){if(!c.length)return{invalid:!0};u.min=Math.min.apply(Math,Et(c)),u.max=Math.max.apply(Math,Et(c))}if(n.input.measureScheme&&(u.palettes={quant:n.input.measureScheme}),a){var d=a.getDataColorScales().filter(function(e){return e.key===n.input.measureScheme})[0];u.type=d&&er.test(d.type)?"categorical":"continuous","categorical"===u.type&&(o=d.colors.some(function(e){return Array.isArray(e)})?Math.max.apply(Math,Et(d.colors.map(function(e){return e?e.length:0}))):d.colors.length)}if("categorical"===u.type){for(var f=p?nr(u.max,u.min,c,1,o):o,h=(u.max-u.min)/f,m=[],g=0;g<f+1;g+=1)m.push(u.min+h*g);u.domain=m,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 ir(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 or(e){e.measureOverrides.every(function(e){return!e})&&(e.measureOverrides=null)}function ar(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 sr(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?ir:o,s=n.input.byMeasureDef||{activeMeasureIndex:0},l=a(n,s),u=rr(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 p=c.raw().coloring;p&&p.gradient&&Jt(u,tr(e,p.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?tn:i,a=r.getCByField,s=void 0===a?nn:a,l=r.getPersistence,u=void 0===l?en:l,c=o(t,n),p=s(n,c),d=p?p.raw():{},f=n&&n.pic?n.pic.raw():{};if(d.qError||d.qSize&&0===d.qSize.qcy&&!f.qHasOtherValues)return{invalid:!0};var h={mode:"field",fieldType:"dimension",type:"categorical",field:p?p.key():void 0,isFieldLocked:d.qLocked};return("expression"===c.type||c.activeDimensionIndex<0)&&(h.label=c.label,"color.altLabel"===d.labelExpRef&&(h.label=n.input.altLabel)),!h.label&&p&&(h.label=p.title()),n.input.dimensionScheme&&(h.palettes={categorical:n.input.dimensionScheme}),n.input.useDimColVal&&"libraryItem"===c.type&&(h.auxiliary=c),Jt(h,u(t,n,c,p,{byRow:Qt,byElemNo:Zt})),h}(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=rr(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,p=o?o.getDataColorPalettes()[0]:void 0;return"measure"===n.input.useBaseColors&&p&&(c={categorical:p.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 d=[],f=[];return i.qDimensionInfo.forEach(function(t,n){if(t.baseColor||t.coloring&&t.coloring.baseColor){d.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:d.length?d[0]:void 0,explicit:d.length?{domain:d,range:f}:void 0}}var h=r.primary;if(void 0!==n.input.paletteColor)n.input.paletteColor&&(h=e.resolveUIColor(n.input.paletteColor));else{var m=n.input.singleColor;"number"!=typeof m||Number.isNaN(m)||(h=["#b0afae","#7b7a78","#545352","#4477aa","#7db8da","#b6d7ea","#46c646","#f93f17","#ffcf02","#276e27","#ffffff","#000000"][m])}return{mode:"constant",type:"constant",primary:h}}(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)),Mt(Mt({},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 Mt(Mt({},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(or(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=ar(e.measureOverrides,e.explicit),or(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=ar(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 lr=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},ur=function(e){throw e.isHandled=!0,e};function cr(e){return function(t){return"object"===At(t.datum[e])?t.datum[e].value:void 0}}function pr(e){return"object"===At(e.datum.isNull)?e.datum.isNull.value:-2===e.datum.value}function dr(e){return-3===e.datum.value}var fr={COLOR:void 0,FONT_SIZE:"16px",FONT_FAMILY:"'Source Sans Pro', 'Arial', 'sans-serif'"},hr={COLOR:void 0,FONT_SIZE:void 0,FONT_FAMILY:"'Source Sans Pro', 'Arial', 'sans-serif'"};function mr(e){var t=e.theme,n=e.key,r=e.styleOverrides,i={title:{color:fr.COLOR,fontSize:fr.FONT_SIZE,fontFamily:fr.FONT_FAMILY},label:{color:hr.COLOR,fontSize:hr.FONT_SIZE,fontFamily:hr.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",fr.COLOR),i.title.fontSize=l(null==a?void 0:a.fontSize,"legend.title","fontSize",fr.FONT_SIZE),i.title.fontFamily=l(null==a?void 0:a.fontFamily,"legend.title","fontFamily",fr.FONT_FAMILY),i.label.color=l(null==s?void 0:s.color,"legend.label","color",hr.COLOR),i.label.fontSize=l(null==s?void 0:s.fontSize,"legend.label","fontSize",hr.FONT_SIZE),i.label.fontFamily=l(null==s?void 0:s.fontFamily,"legend.label","fontFamily",hr.FONT_FAMILY),i}var gr=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"},yr=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 br(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=mr({theme:l,key:n,styleOverrides:r});return{layout:{minimumLayoutMode:"MEDIUM",dock:gr(a,i,o)},show:"function"==typeof a.show?function(){return yr(a,u,s)}:yr(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 vr(e,t,n){var r=[],i=[],o=function(e,t,n){return"categorical"===t.coloring.type?function(e,t,n){var r=br(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,p=e.style,d=t.scaleKey,f=t.theme,h=t.scales,m=mr({theme:f,key:a,styleOverrides:s}),g=r.layout.dock,y="left"===g||"right"===g?{maxLines:2,wordBreak:"break-word"}:{},b={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 v="".concat(d,"Legend");return Jt(!0,r,{type:"legend-cat",key:"".concat(o,"-cat"),scale:v in h?v:d,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:Mt({fill:m.label.color,fontSize:m.label.fontSize,fontFamily:m.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:b[n]})])])}}}},brush:{consume:[{context:"selection",data:["",o],style:{inactive:{opacity:.3}}}]}},{settings:c,style:p})}(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,p="".concat(u,"Range"),d=br(e,t);if(!d.show)return!1;var f=mr({theme:c,key:i,styleOverrides:o}),h=d.layout.dock,m="right"===h||"left"===h,g=null===(n=t.scales)||void 0===n?void 0:n[p];return m&&g&&(g.invert=!0),Jt(!0,d,{type:"legend-seq",key:"".concat(r,"-seq"),settings:{fill:u,major:p,length:1,tick:{fill:f.label.color,fontSize:f.label.fontSize,fontFamily:f.label.fontFamily},title:{anchor:!a||"top"!==d.layout.dock&&"bottom"!==d.layout.dock?void 0:"right",padding:parseFloat(d.settings.title.fontSize)||16}}},{settings:s,style:l})}(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=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.eventName,n=e.key,r=e.requireFailure,i=e.recognizeWith,o=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).actions;return{key:"event:pan-".concat(n),type:"Pan",requireFailure:r,recognizeWith:i,options:{event:t,pointers:1,threshold:10,enable:function(e,r){var i;return this.started===t||!r||!(null!=o&&null!==(i=o.interact)&&void 0!==i&&i.enabled&&!o.interact.enabled())&&this.chart.componentsFromPoint({x:r.center.x,y:r.center.y}).some(function(e){return e.key==="".concat(n,"-cat")})}},events:St(St(St({},"".concat(t,"start"),function(e){e.preventDefault(),this.started!==t&&(this.started=t,this.chart.component("".concat(n,"-cat")).emit("panstart",e))}),"".concat(t,"move"),function(e){e.preventDefault(),this.chart.component("".concat(n,"-cat")).emit("panmove",e)}),"".concat(t,"end"),function(e){e.preventDefault(),this.chart.component("".concat(n,"-cat")).emit("panend",e),this.started=!1})}}(e,n))),{interactions:i,components:r}}function qr(e){var t=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.auto,n=function(e){var t=Mt({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(Jt(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=Jt(!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=Jt(!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 tr(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=Mt({},e);Jt(a,Zt(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,Jt(a,Zt(o)))):!1===t.autoFill&&t.single?a.range=[n.resolveUIColor(t.single)]:t.autoFill&&(s&&(a.palettes={categorical:s.key}),Jt(a,Zt(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=Mt(Mt({},e),r.getDataColorSpecials())),n.settings=Jt(e,sr(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){return 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()}(e,{layout:t.layout,app:t.app})}).getMeasure(function(e,t){return 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()}(e,{layout:t.layout,app:t.app})}).getAttributeDimension(function(e,t){return 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(ur):Promise.reject()}(e,{layout:t.layout,model:t.model,app:t.app})});return n.getSnapshotData=lr,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=Mt({},i),r={},!n.key)throw new Error("Missing key");t.set(Mt(Mt({},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=Mt(Mt({},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]||r.getDataColorScales()[0];if(l){var u=l.colors[0]?l.colors:[[]].concat(Et(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(Et((n.explicit||{}).domain||[]),[-3,-2]),range:n.explicit&&"function"==typeof n.explicit.range?n.explicit.range:[].concat(Et((n.explicit||{}).range||[]),[n.others,n.nil])};if("field"===n.mode){if("dimension"===n.fieldType){var c,p=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 d=0,f={};a.data("q")({data:t}).extract({field:n.field,trackBy:n.valueAccessor,reduce:function(e){var t=e[0];return f[t]=d++,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 h={data:p,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]=h,c&&(s["".concat(l,"Legend")]=Mt(Mt({},h),{},{data:c})),t&&t.qHasOtherValues&&c&&((c||h.data).amend=[{label:t.qDimensionInfo[0].othersLabel,source:{key:"qHyperCube",field:"qDimensionInfo/0"},row:{value:-3},value:-3}])}else if("measure"===n.fieldType){var m={data:{field:n.field},min:n.min,max:n.max};s[l]=Jt({},m,{type:"categorical"===n.type?"threshold-color":"sequential-color",range:n.range,domain:n.domain,invert:n.reverse}),"sequential-color"===s[l].type&&(s["".concat(l,"Range")]=Jt({},m,{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=cr(r),o=cr("".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,p=e.type;return a?function(e){return dr(e)||o(e)?u:l}:n[t]?function(e){return dr(e)?u:pr(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 dr(e)||o(e)?u:pr(e)?l:c}:"color"===p?function(e){return dr(e)||o(e)?u:pr(e)?l:i(e)||u}:null},s=a(t,r);if(t.measureOverrides){var l=cr("".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?function(e){return"rgba(".concat([(16711680&e)>>16,(65280&e)>>8,255&e,((4278190080&e)>>>24)/255].join(","),")")}(e.qNum):e.qText&&xn(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 p=St({},u,n);return r.qDimensionInfo.length>1&&(p["".concat(u,"IsAnOther")]={fields:r.qDimensionInfo.map(function(e,t){return{field:"qDimensionInfo/".concat(t)}}),value:function(e){return-1!==e.indexOf(-3)}}),s&&(p["".concat(u,"MeasureIdx")]=l),p}({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,p=e.settings,d=void 0===p?{}:p,f=e.style,h=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return vr({eventName:t,key:r,rtl:s,viewState:o,chart:a,styleReference:u,styleOverrides:c,settings:d,style:void 0===f?{}:f},{legendProps:n.legendProps,scaleKey:n.key,coloring:i(),theme:n.theme,hc:n.hc,scales:this.scales()},h)}};return o}var xr=function(e){return e.baseColor||e.coloring&&e.coloring.baseColor};function Dr(e){var t=e.qHyperCube,n=t.qDimensionInfo,r=t.qMeasureInfo,i=n.some(xr),o=r.some(xr),a=e.color.useBaseColors;return"measure"===a&&!o||"dimension"===a&&!i?"off":a}var Sr=function(e){return e.baseColor||e.coloring&&e.coloring.baseColor};function Cr(e){var t,n=e.qHyperCube.qDimensionInfo.some(Sr),r=e.qHyperCube.qMeasureInfo.some(Sr),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 Mr=function(){};function Er(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,p=e.createConfig,d=void 0===p?Mr:p,f=e.config,h=void 0===f?{}:f,m=e.custom,g=void 0===m?{}:m,y=h.localeInfo,b=h.key,v=h.theme,q=void 0===v?void 0:v,x=h.auto,D=void 0===x?void 0:x,S=h.definitionPath,C=null==c||null===(t=c.getLayout)||void 0===t?void 0:t.call(c),M={theme:q,key:b,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:Mt(Mt({},null==c||null===(i=c.getLayoutValue)||void 0===i?void 0:i.call(c,"color")),{},{useBaseColors:C?Dr(C):void 0})},E=qr({picasso:o,model:a,app:s,translator:l,auto:D});!1!==D&&E.auto(function(e){return D?D({layout:e,defaultAuto:Cr}):Cr(e)});var A=!1,I={getColor:function(){return E.color()},getPaletteColor:function(e){var t=e.index,n=e.color;return E.resolveUIColor({index:t,color:n})},getData:function(){return E.data()},getDatumProps:function(e){return E.datumProps(e)},getSnapshotData:function(){return E.getSnapshotData(S)},getSettingsForMeasure:function(e){return E.settingsForMeasure(e)},getSettings:function(){return E.settings()},getLegend:function(e,t){return E.legend(e,t)},getScales:function(){return E.scales()},getPalettes:function(){return E.palettes()},isSelectionLocked:function(e){var t=e.isMeasureSelectionLocked;return E.isSelectionLocked({isMeasureSelectionLocked:t})},isInitialized:function(){return A},custom:Mt({},g),initialize:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).createConfig,t=(void 0===e?d:e)({getUseBaseColors:Dr}),n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Mt(Mt(Mt({},e),t),{},{colorProps:Mt(Mt({},e.colorProps),t.colorProps||{})})}(M,t);return E.config(n),E.getAuxiliarySettings(S).then(function(){A=!0})}};return I}var Ar="center",Ir="bottom";function wr(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}[{key:"NoDataExist",alignment:Ar,condition:function(e){var t=e.layoutService;if(!t)return!1;var n=t.meta.size;return n.x*n.y==0}},{key:"OnlyNanDataMeasure",translationKey:"OnlyNanData",alignment:Ar,condition:function(e){var t=e.layoutService;return!!t&&t.getHyperCubeValue("qMeasureInfo").every(function(e){return"NaN"===e.qMin&&"NaN"===e.qMax})}},{key:"OnlyNanDataDimensionContinuous",translationKey:"OnlyNanData",alignment:Ar,condition:function(e){var t=e.layoutService;if(!t)return!1;if(!t.meta.isContinuous)return!1;var n=t.getHyperCubeValue("qDimensionInfo.0");return n&&(n.qMax<n.qMin||"NaN"===n.qMax)}},{key:"OnlyNegativeOrZeroValues",alignment:Ar},{key:"DataRangeIncludingZero",alignment:Ir},{key:"LimitedData",alignment:Ir},{key:"NegativeOrZeroValues",alignment:Ir}].reduce(function(e,t){return e[t.key]=t,e},{});var Or,Tr=["__proto__","constructor"];function kr(e,t,n){if(void 0!==e&&void 0!==t){var r=t.split("."),i=r[r.length-1];if(!Tr.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 Nr(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 Lr(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=_r)):void 0===t&&(t=Pr);for(var n,r,i,o,a,s=new Fr(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 Fr(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(Hr)}function Pr(e){return e.children}function _r(e){return Array.isArray(e)?e[1]:null}function Rr(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function Hr(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function Fr(e){this.data=e,this.depth=this.height=0,this.parent=null}Fr.prototype=Lr.prototype={constructor:Fr,count:function(){return this.eachAfter(Nr)},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 Lr(this).eachBefore(Rr)},[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)}},Or=function(e){
7
+ import{useConstraints as e,useState as t,useLayout as n,useEffect as r,useAction as i,useRect as o,useOptions as a,usePromise as s,useApp as l,useAppLayout as u,useDeviceType as c,useTheme as p,useTranslator as d,useMemo as f,onTakeSnapshot as h,useImperativeHandle as m,useElement as g,useSelections as y,useStaleLayout as b,useModel as v,useRenderState as q}from"@nebula.js/stardust";import x from"jquery";import D from"picasso.js";import S from"picasso-plugin-q";import C from"picasso-plugin-hammer";import M from"hammerjs";import E from"extend";var A={"Visualization.Histogram.MeasureAxisLabel":{id:"Visualization.Histogram.MeasureAxisLabel",locale:{"en-US":"Frequency","zh-TW":"頻率","zh-CN":"频率","tr-TR":"Sıklık","sv-SE":"Frekvens","it-IT":"Frequenza","es-ES":"Frecuencia","de-DE":"Häufigkeit","pl-PL":"Częstotliwość","nl-NL":"Frequentie","ko-KR":"빈도","pt-BR":"Frequência","fr-FR":"Fréquence","ja-JP":"レコード数","ru-RU":"Частота"}},"waterfall.legend.positiveValue.label":{id:"waterfall.legend.positiveValue.label",locale:{"en-US":"Positive","zh-TW":"正值","zh-CN":"正","tr-TR":"Pozitif","sv-SE":"Positiv","it-IT":"Positivi","es-ES":"Positivo","de-DE":"Positiv","pl-PL":"Dodatnie","nl-NL":"Positief","ko-KR":"양수","pt-BR":"Positivo","fr-FR":"Positive","ja-JP":"正","ru-RU":"Положительное"}},"waterfall.legend.negativeValue.label":{id:"waterfall.legend.negativeValue.label",locale:{"en-US":"Negative","zh-TW":"負值","zh-CN":"负","tr-TR":"Negatif","sv-SE":"Negativ","it-IT":"Negativi","es-ES":"Negativo","de-DE":"Negativ","pl-PL":"Ujemne","nl-NL":"Negatief","ko-KR":"음수","pt-BR":"Negativo","fr-FR":"Négative","ja-JP":"負","ru-RU":"Отрицательное"}},"waterfall.legend.subtotal.label":{id:"waterfall.legend.subtotal.label",locale:{"en-US":"Subtotal","zh-TW":"小計","zh-CN":"小计","tr-TR":"Ara Toplam","sv-SE":"Deltotal","it-IT":"Subtotale","es-ES":"Subtotal","de-DE":"Teilsumme","pl-PL":"Suma częściowa","nl-NL":"Subtotaal","ko-KR":"소계","pt-BR":"Subtotal","fr-FR":"Sous-total","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_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_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_RequireNumericDimension:{id:"Object.Disclaimer.RequireNumericDimension",locale:{"en-US":"This visualization requires a numeric diemnsion."}},"properties.boxplot.calculationMode.tukey.elements.boxEnd":{id:"properties.boxplot.calculationMode.tukey.elements.boxEnd",locale:{"en-US":"Third quartile","zh-TW":"第三四分位數","zh-CN":"第 3 个四分位","tr-TR":"Üçüncü çeyrek","sv-SE":"Tredje kvartilen","it-IT":"Terzo quartile","es-ES":"Tercer cuartil","de-DE":"Drittes Quartil","pl-PL":"Trzeci kwartyl","nl-NL":"Derde kwartiel","ko-KR":"3번째 사분위수","pt-BR":"Terceiro quartil","fr-FR":"Troisième quartile","ja-JP":"第 3 四分位数","ru-RU":"Третий квартиль"}},"properties.boxplot.calculationMode.tukey.elements.boxMiddle":{id:"properties.boxplot.calculationMode.tukey.elements.boxMiddle",locale:{"en-US":"Median","zh-TW":"中位數","zh-CN":"中间值","tr-TR":"Medyan","sv-SE":"Median","it-IT":"Mediana","es-ES":"Mediana","de-DE":"Drittes Quartil","pl-PL":"Mediana","nl-NL":"Mediaan","ko-KR":"중앙값","pt-BR":"Mediano","fr-FR":"Médiane","ja-JP":"中央値","ru-RU":"Медианное"}},"properties.boxplot.calculationMode.tukey.elements.boxStart":{id:"properties.boxplot.calculationMode.tukey.elements.boxStart",locale:{"en-US":"First quartile","zh-TW":"第一四分位數","zh-CN":"第 1 个四分位","tr-TR":"İlk çeyrek","sv-SE":"Första kvartilen","it-IT":"Primo quartile","es-ES":"Primer cuartil","de-DE":"Erstes Quartil","pl-PL":"Pierwszy kwartyl","nl-NL":"Eerste kwartiel","ko-KR":"1번째 사분위수","pt-BR":"Primeiro quartil","fr-FR":"Premier quartile","ja-JP":"第 1 四分位数","ru-RU":"Первый квартиль"}},"properties.boxplot.calculationMode.tukey.elements.firstWhisker":{id:"properties.boxplot.calculationMode.tukey.elements.firstWhisker",locale:{"en-US":"Box start - {0} IQR","zh-TW":"方塊開始 - {0} IQR","zh-CN":"框开始 - {0} IQR","tr-TR":"Kutu başlangıcı - {0} IQR","sv-SE":"Rutans start - {0} IQR","it-IT":"Inizio scatola - {0} IQR","es-ES":"Inicio de caja - {0} IQR","de-DE":"Box-Beginn - {0} IQR","pl-PL":"Początek wykresu pudełkowego - {0} IQR","nl-NL":"Begin box - {0} IQR","ko-KR":"상자 시작 - {0} IQR","pt-BR":"Início da caixa - {0} IQR","fr-FR":"Début de la boîte - {0} IQR","ja-JP":"ボックス開始 - {0} IQR","ru-RU":"Начало поля - {0} IQR"}},"properties.boxplot.calculationMode.tukey.elements.lastWhisker":{id:"properties.boxplot.calculationMode.tukey.elements.lastWhisker",locale:{"en-US":"Box end + {0} IQR","zh-TW":"方塊結束 + {0} IQR","zh-CN":"框结束 + {0} IQR","tr-TR":"Kutu bitişi + {0} IQR","sv-SE":"Rutans slut + {0} IQR","it-IT":"Fine scatola + {0} IQR","es-ES":"Fin de caja + {0} IQR","de-DE":"Box-Ende + {0} IQR","pl-PL":"Koniec wykresu pudełkowego - {0} IQR","nl-NL":"Einde box + {0} IQR","ko-KR":"상자 끝 + {0} IQR","pt-BR":"Fim da caixa + {0} IQR","fr-FR":"Fin de la boîte + {0} IQR","ja-JP":"ボックス終了 + {0} IQR","ru-RU":"Конец поля + {0} IQR"}},"properties.boxplot.calculationMode.stdDev.elements.boxEnd":{id:"properties.boxplot.calculationMode.stdDev.elements.boxEnd",locale:{"en-US":"Box middle + 1 standard deviation","zh-TW":"方塊中間 + 1 個標準差","zh-CN":"框中部 + 1 个标准偏差","tr-TR":"Kutu ortası + 1 standart sapma","sv-SE":"Rutans mitt + 1 standardavvikelse","it-IT":"Centro scatola + 1 deviazione standard","es-ES":"Mitad de la caja + 1 desviación estándar","de-DE":"Box-Mitte +1 Standardabweichung","pl-PL":"Środek wykresu pudełkowego + 1 odch. stand","nl-NL":"Midden box + 1 standaardafwijking","ko-KR":"상자 중간 + 1개 표준 편차","pt-BR":"Meio da caixa + 1 desvio padrão","fr-FR":"Milieu de la boîte + 1 écart type","ja-JP":"ボックス中間 + 1 標準偏差","ru-RU":"Середина поля + 1 стандартное отклонение"}},"properties.boxplot.calculationMode.stdDev.elements.boxMiddle":{id:"properties.boxplot.calculationMode.stdDev.elements.boxMiddle",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.boxplot.calculationMode.stdDev.elements.boxStart":{id:"properties.boxplot.calculationMode.stdDev.elements.boxStart",locale:{"en-US":"Box middle - 1 standard deviation","zh-TW":"方塊中間 - 1 個標準差","zh-CN":"框中部 - 1 个标准偏差","tr-TR":"Kutu ortası - 1 standart sapma","sv-SE":"Rutans mitt - 1 standardavvikelse","it-IT":"Centro scatola - 1 deviazione standard","es-ES":"Mitad de la caja - {1} desviación estándar","de-DE":"Box-Mitte -1 Standardabweichung","pl-PL":"Środek wykresu pudełkowego - 1 odch. stand","nl-NL":"Midden box - 1 standaardafwijking","ko-KR":"상자 중간 - 1개 표준 편차","pt-BR":"Середина поля - 1 стандартное отклонение","fr-FR":"Milieu de la boîte - 1 écart type","ja-JP":"ボックス中間 - 1 標準偏差","ru-RU":"Первый квартиль"}},"properties.boxplot.calculationMode.stdDev.elements.firstWhisker":{id:"properties.boxplot.calculationMode.stdDev.elements.firstWhisker",locale:{"en-US":"Box middle - {0} standard deviations","zh-TW":"方塊中間 - {0} 個標準差","zh-CN":"框中部 - {0} 个标准偏差","tr-TR":"Kutu ortası - {0} standart sapma","sv-SE":"Rutans mitt - {0} standardavvikelser","it-IT":"Centro scatola - {0} deviazioni standard","es-ES":"Mitad de la caja - {0} desviaciones estándar","de-DE":"Box-Mitte -{0} Standardabweichung","pl-PL":"Środek wykresu pudełkowego - {0} odch. stand","nl-NL":"Midden box - {0} standaardafwijkingen","ko-KR":"상자 중간 - {0}개 표준 편차","pt-BR":"Meio da caixa - {0} desvios padrão","fr-FR":"Milieu de la boîte - {0} écarts types","ja-JP":"ボックス中間 - {0} 標準偏差","ru-RU":"Середина поля - {0} стандартное(ых) отклонение(й)"}},"properties.boxplot.calculationMode.stdDev.elements.lastWhisker":{id:"properties.boxplot.calculationMode.stdDev.elements.lastWhisker",locale:{"en-US":"Box middle + {0} standard deviations","zh-TW":"方塊中間 + {0} 個標準差","zh-CN":"框中部 + {0} 个标准偏差","tr-TR":"Kutu ortası + {0} standart sapma","sv-SE":"Rutans mitt + {0} standardavvikelser","it-IT":"Centro scatola + {0} deviazioni standard","es-ES":"Mitad de la caja + {0} desviaciones estándar","de-DE":"Box-Mitte +{0} Standardabweichung","pl-PL":"Środek wykresu pudełkowego + {0} odch. stand","nl-NL":"Midden box + {0} standaardafwijkingen","ko-KR":"상자 중간 + {0}개 표준 편차","pt-BR":"Meio da caixa + {0} desvios padrão","fr-FR":"Milieu de la boîte + {0} écarts types","ja-JP":"ボックス中間 + {0} 標準偏差","ru-RU":"Середина поля + {0} стандартное(ых) отклонение(й)"}},"properties.boxplot.calculationMode.fractiles.elements.boxEnd":{id:"properties.boxplot.calculationMode.fractiles.elements.boxEnd",locale:{"en-US":"Third quartile","zh-TW":"第三四分位數","zh-CN":"第 3 个四分位","tr-TR":"Üçüncü çeyrek","sv-SE":"Tredje kvartilen","it-IT":"Terzo quartile<","es-ES":"Tercer cuartil","de-DE":"Drittes Quartil","pl-PL":"Trzeci kwartyl","nl-NL":"Derde kwartiel","ko-KR":"3번째 사분위수","pt-BR":"Terceiro quartil","fr-FR":"Troisième quartile","ja-JP":"第 3 四分位数","ru-RU":"Третий квартиль"}},"properties.boxplot.calculationMode.fractiles.elements.boxMiddle":{id:"properties.boxplot.calculationMode.fractiles.elements.boxMiddle",locale:{"en-US":"Median","zh-TW":"中位數","zh-CN":"中间值","tr-TR":"Medyan","sv-SE":"Median","it-IT":"Mediana","es-ES":"Mediana","de-DE":"Median","pl-PL":"Mediana","nl-NL":"Mediaan","ko-KR":"중앙값","pt-BR":"Mediano","fr-FR":"Médiane","ja-JP":"中央値","ru-RU":"Медианное"}},"properties.boxplot.calculationMode.fractiles.elements.boxStart":{id:"properties.boxplot.calculationMode.fractiles.elements.boxStart",locale:{"en-US":"First quartile","zh-TW":"第一四分位數","zh-CN":"第 1 个四分位","tr-TR":"İlk çeyrek","sv-SE":"Första kvartilen","it-IT":"Primo quartile","es-ES":"Primer cuartil","de-DE":"Erstes Quartil","pl-PL":"Pierwszy kwartyl","nl-NL":"Eerste kwartiel","ko-KR":"1번째 사분위수","pt-BR":"Primeiro quartil","fr-FR":"Premier quartile","ja-JP":"第 1 四分位数","ru-RU":"Первый квартиль"}},"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.fifth":{id:"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.fifth",locale:{"en-US":"5th percentile","zh-TW":"第 5 個百分位數","zh-CN":"第 5 个百分位","tr-TR":"5. yüzdebirlik","sv-SE":"5:e percentilen","it-IT":"5° percentile","es-ES":"5º percentil","de-DE":"5. Perzentil","pl-PL":"5. percentyl","nl-NL":"5e percentiel","ko-KR":"5번째 백분위수","pt-BR":"5º percentil","fr-FR":"5e centile","ja-JP":"5 番目のパーセンタイル","ru-RU":"5-й процентиль"}},"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.first":{id:"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.first",locale:{"en-US":"1st percentile","zh-TW":"第 1 個百分位數","zh-CN":"第 1 个百分位","tr-TR":"1. yüzdebirlik","sv-SE":"1:e percentilen","it-IT":"1° percentile","es-ES":"1er percentil","de-DE":"1. Perzentil","pl-PL":"1. percentyl","nl-NL":"1e percentiel","ko-KR":"1번째 백분위수","pt-BR":"1º percentil","fr-FR":"1er centile","ja-JP":"1 番目のパーセンタイル","ru-RU":"1-й процентиль"}},"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.min":{id:"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.min",locale:{"en-US":"Minimum","zh-TW":"最小","zh-CN":"最小值","tr-TR":"En az","sv-SE":"Min","it-IT":"Minimo","es-ES":"Mínimo","de-DE":"Minimum","pl-PL":"Minimum","nl-NL":"Minimum","ko-KR":"최소","pt-BR":"Mínimo","fr-FR":"Minimale","ja-JP":"最小値","ru-RU":"Минимум"}},"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.tenth":{id:"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.tenth",locale:{"en-US":"10th percentile","zh-TW":"第 10 個百分位數","zh-CN":"第 10 个百分位","tr-TR":"10. yüzdebirlik","sv-SE":"10:e percentilen","it-IT":"10° percentile","es-ES":"10º percentil","de-DE":"10. Perzentil","pl-PL":"10. percentyl","nl-NL":"10e percentiel","ko-KR":"10번째 백분위수","pt-BR":"10º percentil","fr-FR":"10e centile","ja-JP":"10 番目のパーセンタイル","ru-RU":"10-й процентиль"}},"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.max":{id:"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.max",locale:{"en-US":"Maximum","zh-TW":"最大","zh-CN":"最大值","tr-TR":"En fazla","sv-SE":"Max","it-IT":"Massimo","es-ES":"Máximo","de-DE":"Maximum","pl-PL":"Maksimum","nl-NL":"Maximum","ko-KR":"최대","pt-BR":"Máximo","fr-FR":"Maximale","ja-JP":"最大値","ru-RU":"Максимум"}},"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.ninetieth":{id:"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.ninetieth",locale:{"en-US":"90th percentile","zh-TW":"第 90 個百分位數","zh-CN":"第 90 个百分位","tr-TR":"90. yüzdebirlik","sv-SE":"90:e percentilen","it-IT":"90° percentile","es-ES":"90º percentil","de-DE":"90. Perzentil","pl-PL":"90. percentyl","nl-NL":"90e percentiel","ko-KR":"90번째 백분위수","pt-BR":"90º percentil","fr-FR":"90e centile","ja-JP":"90 番目の百分位数","ru-RU":"90-й процентиль"}},"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.ninetyfifth":{id:"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.ninetyfifth",locale:{"en-US":"95th percentile","zh-TW":"第 95 個百分位數","zh-CN":"第 95 个百分位","tr-TR":"95. yüzdebirlik","sv-SE":"95:e percentilen","it-IT":"95° percentile","es-ES":"95º percentil","de-DE":"95. Perzentil","pl-PL":"95. percentyl","nl-NL":"95e percentiel","ko-KR":"95번째 백분위수","pt-BR":"95º percentil","fr-FR":"95e centile","ja-JP":"95 番目の百分位数","ru-RU":"95-й процентиль"}},"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.ninetynineth":{id:"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.ninetynineth",locale:{"en-US":"99th percentile","zh-TW":"第 99 個百分位數","zh-CN":"第 99 个百分位","tr-TR":"99. yüzdebirlik","sv-SE":"99:e percentilen","it-IT":"99° percentile","es-ES":"99º percentil","de-DE":"99. Perzentil","pl-PL":"99. percentyl","nl-NL":"99e percentiel","ko-KR":"99번째 백분위수","pt-BR":"99º percentil","fr-FR":"99e centile","ja-JP":"99 番目の百分位数","ru-RU":"99-й процентиль"}}};function I(e){e.component("event-area",{mounted(e){e.classList.add("event-area"),e.style.pointerEvents="auto",e.style.zIndex=1},render:()=>[]})}var w={renderer:"dom",disableTriggers:!0,preferredSize:function(){return 22},render(e){const{settings:{label:t,rtl:n},layout:{dock:r}}=this.settings,i="top"!==r&&"bottom"!==r||!n?"ltr":"rtl",o=function(e,t){const n={pointerEvents:"auto",display:"flex",justifyContent:"center",alignItems:"center",color:"#7b7a78",fontStyle:"italic",fontSize:"13px"};switch(e){case"left":n.width=`${t.height}px`,n.transform=`rotate(-90deg) translate(-${t.height}px, 0)`,n.transformOrigin="top left";break;case"right":n.width=`${t.height}px`,n.transform=`rotate(90deg) translate(0, -${t.width}px)`,n.transformOrigin="top left";break;case"center":n.width=`${t.width}px`,n.height=`${t.height}px`,n.color="#595959",n.fontStyle="normal",n.fontSize="1.2em",n.textAlign="center";break;default:n.justifyContent="flex-start",n.alignItems="flex-start"}return n}(r,this.rect),a="center"===r?t:`* ${t}`,s="center"!==r?{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}:{};return e("div",{style:o,dir:i},e("span",{ref:this.alignToRef,style:s,title:a},a))}};const O={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"}}]};var T,k;function N(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var P=function(){if(k)return T;k=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===t.call(e)},o=function(n){if(!n||"[object Object]"!==t.call(n))return!1;var r,i=e.call(n,"constructor"),o=n.constructor&&n.constructor.prototype&&e.call(n.constructor.prototype,"isPrototypeOf");if(n.constructor&&!i&&!o)return!1;for(r in n);return void 0===r||e.call(n,r)},a=function(e,t){n&&"__proto__"===t.name?n(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},s=function(t,n){if("__proto__"===n){if(!e.call(t,n))return;if(r)return r(t,n).value}return t[n]};return T=function e(){var t,n,r,l,u,c,p=arguments[0],d=1,f=arguments.length,h=!1;for("boolean"==typeof p&&(h=p,p=arguments[1]||{},d=2),(null==p||"object"!=typeof p&&"function"!=typeof p)&&(p={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)r=s(p,n),p!==(l=s(t,n))&&(h&&l&&(o(l)||(u=i(l)))?(u?(u=!1,c=r&&i(r)?r:[]):c=r&&o(r)?r:{},a(p,{name:n,newValue:e(h,c,l)})):void 0!==l&&a(p,{name:n,newValue:l}));return p},T}();function L(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function _(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function R(){}N(P);var H=1/.7,F="\\s*([+-]?\\d+)\\s*",B="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",V="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",z=/^#([0-9a-f]{3,8})$/,j=new RegExp(`^rgb\\(${F},${F},${F}\\)$`),$=new RegExp(`^rgb\\(${V},${V},${V}\\)$`),U=new RegExp(`^rgba\\(${F},${F},${F},${B}\\)$`),W=new RegExp(`^rgba\\(${V},${V},${V},${B}\\)$`),K=new RegExp(`^hsl\\(${B},${V},${V}\\)$`),Y=new RegExp(`^hsla\\(${B},${V},${V},${B}\\)$`),G={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 X(){return this.rgb().formatHex()}function J(){return this.rgb().formatRgb()}function Z(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=z.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?Q(t):3===n?new re(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?ee(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?ee(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=j.exec(e))?new re(t[1],t[2],t[3],1):(t=$.exec(e))?new re(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=U.exec(e))?ee(t[1],t[2],t[3],t[4]):(t=W.exec(e))?ee(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=K.exec(e))?ue(t[1],t[2]/100,t[3]/100,1):(t=Y.exec(e))?ue(t[1],t[2]/100,t[3]/100,t[4]):G.hasOwnProperty(e)?Q(G[e]):"transparent"===e?new re(NaN,NaN,NaN,0):null}function Q(e){return new re(e>>16&255,e>>8&255,255&e,1)}function ee(e,t,n,r){return r<=0&&(e=t=n=NaN),new re(e,t,n,r)}function te(e){return e instanceof R||(e=Z(e)),e?new re((e=e.rgb()).r,e.g,e.b,e.opacity):new re}function ne(e,t,n,r){return 1===arguments.length?te(e):new re(e,t,n,null==r?1:r)}function re(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function ie(){return`#${le(this.r)}${le(this.g)}${le(this.b)}`}function oe(){const e=ae(this.opacity);return`${1===e?"rgb(":"rgba("}${se(this.r)}, ${se(this.g)}, ${se(this.b)}${1===e?")":`, ${e})`}`}function ae(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function se(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function le(e){return((e=se(e))<16?"0":"")+e.toString(16)}function ue(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new pe(e,t,n,r)}function ce(e){if(e instanceof pe)return new pe(e.h,e.s,e.l,e.opacity);if(e instanceof R||(e=Z(e)),!e)return new pe;if(e instanceof pe)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 pe(a,s,l,e.opacity)}function pe(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function de(e){return(e=(e||0)%360)<0?e+360:e}function fe(e){return Math.max(0,Math.min(1,e||0))}function he(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(R,Z,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:X,formatHex:X,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return ce(this).formatHsl()},formatRgb:J,toString:J}),L(re,ne,_(R,{brighter(e){return e=null==e?H:Math.pow(H,e),new re(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new re(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new re(se(this.r),se(this.g),se(this.b),ae(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:ie,formatHex:ie,formatHex8:function(){return`#${le(this.r)}${le(this.g)}${le(this.b)}${le(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:oe,toString:oe})),L(pe,function(e,t,n,r){return 1===arguments.length?ce(e):new pe(e,t,n,null==r?1:r)},_(R,{brighter(e){return e=null==e?H:Math.pow(H,e),new pe(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new pe(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 re(he(e>=240?e-240:e+120,i,r),he(e,i,r),he(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new pe(de(this.h),fe(this.s),fe(this.l),ae(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=ae(this.opacity);return`${1===e?"hsl(":"hsla("}${de(this.h)}, ${100*fe(this.s)}%, ${100*fe(this.l)}%${1===e?")":`, ${e})`}`}}));const me=Math.PI/180,ge=180/Math.PI,ye=4/29,be=6/29,ve=3*be*be;function qe(e){if(e instanceof xe)return new xe(e.l,e.a,e.b,e.opacity);if(e instanceof Ee)return Ae(e);e instanceof re||(e=te(e));var t,n,r=Me(e.r),i=Me(e.g),o=Me(e.b),a=De((.2225045*r+.7168786*i+.0606169*o)/1);return r===i&&i===o?t=n=a:(t=De((.4360747*r+.3850649*i+.1430804*o)/.96422),n=De((.0139322*r+.0971045*i+.7141733*o)/.82521)),new xe(116*a-16,500*(t-a),200*(a-n),e.opacity)}function xe(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function De(e){return e>.008856451679035631?Math.pow(e,1/3):e/ve+ye}function Se(e){return e>be?e*e*e:ve*(e-ye)}function Ce(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Me(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Ee(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function Ae(e){if(isNaN(e.h))return new xe(e.l,0,0,e.opacity);var t=e.h*me;return new xe(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}L(xe,function(e,t,n,r){return 1===arguments.length?qe(e):new xe(e,t,n,null==r?1:r)},_(R,{brighter(e){return new xe(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new xe(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 re(Ce(3.1338561*(t=.96422*Se(t))-1.6168667*(e=1*Se(e))-.4906146*(n=.82521*Se(n))),Ce(-.9787684*t+1.9161415*e+.033454*n),Ce(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),L(Ee,function(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof Ee)return new Ee(e.h,e.c,e.l,e.opacity);if(e instanceof xe||(e=qe(e)),0===e.a&&0===e.b)return new Ee(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*ge;return new Ee(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new Ee(e,t,n,null==r?1:r)},_(R,{brighter(e){return new Ee(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new Ee(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return Ae(this).rgb()}}));var Ie=-.14861,we=1.78277,Oe=-.29227,Te=-.90649,ke=1.97294,Ne=ke*Te,Pe=ke*we,Le=-.6557636667999999;function _e(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof Re)return new Re(e.h,e.s,e.l,e.opacity);e instanceof re||(e=te(e));var t=e.r/255,n=e.g/255,r=e.b/255,i=(Le*r+Ne*t-Pe*n)/-5.9615122912,o=r-i,a=(ke*(n-i)-Oe*o)/Te,s=Math.sqrt(a*a+o*o)/(ke*i*(1-i)),l=s?Math.atan2(a,o)*ge-120:NaN;return new Re(l<0?l+360:l,s,i,e.opacity)}(e):new Re(e,t,n,null==r?1:r)}function Re(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}L(Re,_e,_(R,{brighter(e){return e=null==e?H:Math.pow(H,e),new Re(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new Re(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*me,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),r=Math.cos(e),i=Math.sin(e);return new re(255*(t+n*(Ie*r+we*i)),255*(t+n*(Oe*r+Te*i)),255*(t+n*(ke*r)),this.opacity)}}));var He=e=>()=>e;function Fe(e,t){return function(n){return e+n*t}}function Be(e,t){var n=t-e;return n?Fe(e,n):He(isNaN(e)?t:e)}function Ve(e){return((e=Math.exp(e))+1/e)/2}function ze(e){return function t(n){function r(t,r){var i=e((t=_e(t)).h,(r=_e(r)).h),o=Be(t.s,r.s),a=Be(t.l,r.l),s=Be(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 e(t){var n=function(e){return 1==(e=+e)?Be: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):He(isNaN(t)?n:t)}}(t);function r(e,t){var r=n((e=ne(e)).r,(t=ne(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),a=Be(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 e(t,n,r){function i(e,i){var o,a,s=e[0],l=e[1],u=e[2],c=i[0],p=i[1],d=i[2],f=c-s,h=p-l,m=f*f+h*h;if(m<1e-12)a=Math.log(d/u)/t,o=function(e){return[s+e*f,l+e*h,u*Math.exp(t*e*a)]};else{var g=Math.sqrt(m),y=(d*d-u*u+r*m)/(2*u*n*g),b=(d*d-u*u-r*m)/(2*d*n*g),v=Math.log(Math.sqrt(y*y+1)-y),q=Math.log(Math.sqrt(b*b+1)-b);a=(q-v)/t,o=function(e){var r,i=e*a,o=Ve(v),c=u/(n*g)*(o*(r=t*i+v,((r=Math.exp(2*r))-1)/(r+1))-function(e){return((e=Math.exp(e))-1/e)/2}(v));return[s+c*f,l+c*h,u*o/Ve(t*i+v)]}}return o.duration=1e3*a*t/Math.SQRT2,o}return i.rho=function(t){var n=Math.max(.001,+t),r=n*n;return e(n,r,r*r)},i}(Math.SQRT2,2,4),ze(function(e,t){var n=t-e;return n?Fe(e,n>180||n<-180?n-360*Math.round(n/360):n):He(isNaN(e)?t:e)}),ze(Be);var je="center",$e="bottom";function Ue(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}[{key:"NoDataExist",alignment:je,condition:function(e){var t=e.layoutService;if(!t)return!1;var n=t.meta.size;return n.x*n.y==0}},{key:"OnlyNanDataMeasure",translationKey:"OnlyNanData",alignment:je,condition:function(e){var t=e.layoutService;return!!t&&t.getHyperCubeValue("qMeasureInfo").every(function(e){return"NaN"===e.qMin&&"NaN"===e.qMax})}},{key:"OnlyNanDataDimensionContinuous",translationKey:"OnlyNanData",alignment:je,condition:function(e){var t=e.layoutService;if(!t)return!1;if(!t.meta.isContinuous)return!1;var n=t.getHyperCubeValue("qDimensionInfo.0");return n&&(n.qMax<n.qMin||"NaN"===n.qMax)}},{key:"OnlyNegativeOrZeroValues",alignment:je},{key:"DataRangeIncludingZero",alignment:$e},{key:"LimitedData",alignment:$e},{key:"NegativeOrZeroValues",alignment:$e}].reduce(function(e,t){return e[t.key]=t,e},{});var We=["__proto__","constructor"];function Ke(e,t,n){if(void 0!==e&&void 0!==t){var r=t.split("."),i=r[r.length-1];if(!We.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]}}}var Ye,Ge={exports:{}},Xe=Ye?Ge.exports:(Ye=1,Ge.exports=function(){function e(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function t(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 n(n){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?t(Object(i),!0).forEach(function(t){e(n,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):t(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))})}return 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]},p=function e(){var t,n,r,i,o,a,p=arguments[0],d=1,f=arguments.length,h=!1;for("boolean"==typeof p&&(h=p,p=arguments[1]||{},d=2),(null==p||"object"!=typeof p&&"function"!=typeof p)&&(p={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)r=c(p,n),p!==(i=c(t,n))&&(h&&i&&(l(i)||(o=s(i)))?(o?(o=!1,a=r&&s(r)?r:[]):a=r&&l(r)?r:{},u(p,{name:n,newValue:e(h,a,i)})):void 0!==i&&u(p,{name:n,newValue:i}));return p};function d(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 f(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 h(e){let{cache:t,f:n,mainCell:r,p:i,page:o,rowIdx:a,row:s,sourceKey:l,target:u,targetProp:c,columnOrder:h}=e,m=r;if(i.field&&i.field!==n){const e=d(i.field,o,{cache:t},h);if(-1===e)return;m=p({qRow:a},e(s))}u[c]=f(i,m,{key:l})}function m(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),m=Object.keys(u),g=!!i[e].trackBy,y=typeof i[e].trackBy,b={},v=[],q=[];for(let t=0;t<a.qDataPages.length;t++){const o=d(l,a.qDataPages[t],{cache:n},a.qColumnOrder);if(-1!==o)for(let d=0;d<a.qDataPages[t].qMatrix.length;d++){const x=a.qDataPages[t].qArea.qTop+d,D=p({qRow:x},o(a.qDataPages[t].qMatrix[d])),S=f(c,D,{key:s});if(!c.filter||c.filter(D)){for(let e=0;e<m.length;e++){const r=u[m[e]];let i=r.fields||[r];r.fields&&(S[m[e]]=[]);for(let o=0;o<i.length;o++)h({cache:n,f:l,mainCell:D,p:i[o],prop:m[e],page:a.qDataPages[t],rowIdx:x,row:a.qDataPages[t].qMatrix[d],sourceKey:s,target:r.fields?S[m[e]]:S,targetProp:r.fields?o:m[e],columnOrder:a.qColumnOrder});if(r.fields){const t=S[m[e]].map(e=>e.value),n=S[m[e]].map(e=>e.label);S[m[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(S[m[e]].value)}}}g&&r.track({cfg:i[e],itemData:D,obj:S,target:v,tracker:b,trackType:y}),q.push(S)}}}const x=g?r.collect(v,{main:c,propsArr:m,props:u}):q;o=[...o,...x]}return o}function g(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 y(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=v)):void 0===t&&(t=b);for(var n,r,i,o,a,s=new D(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 D(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(x)}function b(e){return e.children}function v(e){return Array.isArray(e)?e[1]:null}function q(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function x(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function D(e){this.data=e,this.depth=this.height=0,this.parent=null}function S(e){return null==e?null:function(e){if("function"!=typeof e)throw new Error;return e}(e)}D.prototype=y.prototype={constructor:D,count:function(){return this.eachAfter(g)},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 y(this).eachBefore(q)},[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 C={depth:-1},M={},E={};function A(e){return e.id}function I(e){return e.parentId}function w(){var e,t=A,n=I;function r(r){var i,o,a,s,l,u,c,p,d=Array.from(r),f=t,h=n,m=new Map;if(null!=e){const t=d.map((t,n)=>function(e){let t=(e=`${e}`).length;return T(e,t-1)&&!T(e,t-2)&&(e=e.slice(0,-1)),"/"===e[0]?e:`/${e}`}(e(t,n,r))),n=t.map(O),i=new Set(t).add("");for(const e of n)i.has(e)||(i.add(e),t.push(e),n.push(O(e)),d.push(E));f=(e,n)=>t[n],h=(e,t)=>n[t]}for(a=0,i=d.length;a<i;++a)o=d[a],u=d[a]=new D(o),null!=(c=f(o,a,r))&&(c+="")&&(p=u.id=c,m.set(p,m.has(p)?M:u)),null!=(c=h(o,a,r))&&(c+="")&&(u.parent=c);for(a=0;a<i;++a)if(c=(u=d[a]).parent){if(!(l=m.get(c)))throw new Error("missing: "+c);if(l===M)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===E&&1===s.children.length;)s=s.children[0],--i;for(let e=d.length-1;e>=0&&(u=d[e]).data===E;--e)u.data=null}if(s.parent=C,s.eachBefore(function(e){e.depth=e.parent.depth+1,--i}).eachBefore(x),s.parent=null,i>0)throw new Error("cycle");return s}return r.id=function(e){return arguments.length?(t=S(e),r):t},r.parentId=function(e){return arguments.length?(n=S(e),r):n},r.path=function(t){return arguments.length?(e=S(t),r):e},r}function O(e){let t=e.length;if(t<2)return"";for(;--t>1&&!T(e,t););return e.slice(0,t)}function T(e,t){if("/"===e[t]){let n=0;for(;t>0&&"\\"===e[--t];)++n;if(!(1&n))return!0}return!1}function k(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=k(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]=k(r,i[e]);return t}n[e]in i&&(i=i[n[e]])}return i}function N(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,...N(e[i].children,t-1,n)]);return r}function P(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=>N(e.children,r-1,n)}return!1}const L=/^qDimensionInfo(?:\/(\d+))?/,_=/^\/?qMeasureInfo\/(\d+)/,R=/\/qAttrExprInfo\/(\d+)/,H=/\/qAttrDimInfo\/(\d+)/;function F(e){return(e.qColumnOrder&&e.qColumnOrder.length?e.qColumnOrder:e.qDimensionInfo.map((e,t)=>t)).filter(t=>t<e.qDimensionInfo.length)}function B(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,p=r;const d=n.qEffectiveInterColumnSortOrder,f=F(n);return L.test(p)&&(i=!0,o=+L.exec(p)[1],p=r.replace(L,"")),_.test(p)&&("K"===n.qMode?u=+_.exec(p)[1]:d&&-1!==d.indexOf(-1)?(u=+_.exec(p)[1],c=0):c=+_.exec(p)[1],p=p.replace(_,"")),p&&(H.exec(p)?s=+H.exec(p)[1]:R.exec(p)&&(a=+R.exec(p)[1])),l=i?"S"===n.qMode?f[o]:d?d.indexOf(o):o:d&&-1!==d.indexOf(-1)?d.indexOf(-1):n.qDimensionInfo.length-("K"===n.qMode?0:1),{fieldDepth:l+1,pseudoMeasureIndex:u,measureIdx:c,attrDimIdx:s,attrIdx:a}}function V(e,t){let n,r,i=P(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 z(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 j(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 p=l[n];let d,f,h,m,g,y;if("primitive"===p.type?(h=p.value,y=String(p.value)):("function"==typeof p.value&&(d=e=>p.value(e,r)),"function"==typeof p.label&&(f=e=>p.label(e,r)),p.accessor?(m=p.accessor(r),Array.isArray(m)?(g=m.map(p.valueAccessor),p.attrAccessor&&(g=g.map(p.attrAccessor)),d&&(h=g.map(d),d=null),f&&(y=g.map(f),f=null),h=p.reduce?p.reduce(h):h,y=p.reduceLabel?p.reduceLabel(y,h):String(h)):(h=p.attrAccessor?p.attrAccessor(p.valueAccessor(m)):p.valueAccessor(m),y=h)):(h=i,y=i)),s.fields){const e=d?d(h):h;u.push(e),c.push(f&&null!=y?f(y):null!=y?y:String(e))}else{const n=d?d(h):h;o[t[e]]={value:n,label:f?f(y):null!=y?y:String(n)},p.field&&(o[t[e]].source={field:p.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 $=(e,t,n)=>{const r="K"===e.qMode?"/qStackedDataPages/*/qData":"/qTreeDataPages/*",i="K"===e.qMode?"qSubNodes":"qNodes",o=k(r,e);return o&&o[0]?(t.tree=y(o[0],n.children||(e=>e[i])),t.tree):null};const U=e=>{let{propsArr:t,props:n,cube:r,cache:i,itemDepthObject:o,f:a}=e;for(let e=0;e<t.length;e++){const i=n[t[e]],s=i.fields?i.fields:[i];for(let e=0;e<s.length;e++){const t=s[e];if(t.field!==a){const e=V(o,B(t.field,{cube:r}));t.accessor=e.nodeFn,t.valueAccessor=e.valueFn,t.attrAccessor=e.attrFn}}}};function W(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;const o=t.raw(),a=t.key(),s="S"===o.qMode?function(e){const t=e.raw().qDataPages.length?e.raw().qDataPages[0].qMatrix:[],r=function(e){const t=e.raw().qColumnOrder,n=e.fields();return t&&t.length===n.length?t:n.map((e,t)=>t)}(e),i=e.fields(),o=e.fields().filter(e=>"dimension"===e.type()).map(e=>r.indexOf(i.indexOf(e))),a=e.fields().filter(e=>"measure"===e.type()).map(e=>r.indexOf(i.indexOf(e))),s={__root:{__id:"__root",qValues:[]}};for(let e=0;e<t.length;e++){const r=t[e];let i="__root",u=!1;for(let e=0;e<o.length;e++){var l;const t=r[o[e]],a="".concat(i,"__").concat(null!==(l=t.qElemNumber)&&void 0!==l?l:t.qElemNo);s[a]||(s[a]=n({__id:a,__parent:i,qValues:[]},t),u=!0),i=a}if(u)for(let e=0;e<a.length;e++){const t=r[a[e]];s[i].qValues.push(t)}}const u=Object.keys(s).map(e=>s[e]);return w().id(e=>e.__id).parentId(e=>e.__parent)(u)}(t):$(o,r,e);if(!s)return null;const l=s.height,u=[];for(let a=0;a<=l;a++){let s=null;if(a>0)if("S"===o.qMode){let e=F(o)[a-1];s=r.fields[e]}else{let e=o.qEffectiveInterColumnSortOrder[a-1];a>o.qEffectiveInterColumnSortOrder.length&&(e=o.qDimensionInfo.length),s=r.fields[e]}const{props:l,main:c}=i.normalizeConfig(n(n({},e),{},{field:s?s.key():void 0}),t),p=Object.keys(l);u[a]={propsArr:p,props:l,main:c};const d=s?B(s,{cube:o}):{fieldDepth:0};U({propsArr:p,props:l,cube:o,cache:r,itemDepthObject:d,f:s})}const c=s.copy().descendants(),p=s.descendants();for(let e=0;e<p.length;e++){const t=u[p[e].depth].propsArr,n=u[p[e].depth].props,r=u[p[e].depth].main,i=c[e],o=i.data,s=z(r,o,{key:a});j({propsArr:t,props:n,item:i,itemData:o,ret:s,sourceKey:a}),p[e].data=s}return s}function K(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(!$(s,n,e))continue;const u="object"==typeof i[a].field?i[a].field:t.field(i[a].field),{props:c,main:p}=r.normalizeConfig(i[a],t),d=Object.keys(c),f=B(u,{cube:s}),{nodeFn:h,attrFn:m,valueFn:g}=V({fieldDepth:0},f);U({propsArr:d,props:c,cube:s,cache:n,itemDepthObject:f,f:u});const y=!!i[a].trackBy,b=typeof i[a].trackBy,v={},q=[],x=h(n.tree),D=[];for(let e=0;e<x.length;e++){const t=x[e],n=m?m(g(t)):g(t);if(p.filter&&!p.filter(n))continue;const o=z(p,n,{key:l});j({propsArr:d,props:c,item:t,itemData:n,ret:o,sourceKey:l}),y&&r.track({cfg:i[a],itemData:n,obj:o,target:q,tracker:v,trackType:b}),D.push(o)}const S=y?r.collect(q,{main:p,propsArr:d,props:c}):D;o=[...o,...S]}return o}var Y=function(e,t){return e(t={exports:{}},t.exports),t.exports}(function(e){var t;t=function(){return function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,a,s,l,u,c,p,d=e.length,f=e.search(/[0-9\-\+#]/),h=f>0?e.substring(0,f):"",m=e.split("").reverse().join(""),g=m.search(/[0-9\-\+#]/),y=d-g,b=e.substring(y,y+1),v=y+("."===b||","===b?1:0),q=g>0?e.substring(v,d):"";if(n=(t="-"===(e=e.substring(f,v)).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(m="",y=(p=t[0]).length%l,d=p.length,v=0;v<d;v++)m+=p.charAt(v),!((v-y+1)%l)&&v<d-l&&(m+=o);t[0]=m}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),h+(n?"-":"")+r+q}},e.exports=t()});function G(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}const X={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"},J=/%\)?$/,Z=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,Q=/^\(oct\)/i,ee=/^\(dec\)/i,te=/^\(hex\)/i,ne=/^\(bin\)/i,re=/^\(rom\)/i,ie=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,oe=/#|0/g;function ae(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 se(e,t,n){let r;return Z.test(t)?e=ae(e,Number(/\d{2}/.exec(t)[0]),t,n):Q.test(t)?e=ae(e,8,t,n):ee.test(t)?e=ae(e,10,t,n):te.test(t)?e=ae(e,16,t,n):ne.test(t)?e=ae(e,2,t,n):re.test(t)&&(r="",e<0&&(r="-",e=-e),e=0===(e=Math.floor(e))?"0":e<=5e5?r+(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)):t+r+e.toExponential(0)),e}function le(e,t,n){const r=G(e);return n?r:new RegExp(r||"",t)}function ue(e,t,n,r){let i,o,a,s,l,u,c,p,d,f=e.pattern;r&&(e.abbreviate=!0),d=function(e,t){return t&&(t=G(t)),e&&(e=G(e)),new RegExp("(?:[#0]+".concat(e,")?[#0]+(?:").concat(t,"[#0]+)?"))}(t,n),a=f.match(d),a=a?a[0]:"",s=a?f.substr(0,f.indexOf(a)):f,l=a?f.substring(f.indexOf(a)+a.length):"",a||(a=f?"#":"##########"),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(le(u,"g"),t)),c=n,n=".",c&&(a=a.replace(le(c,"g"),n)),p=a.match(/#/g),p=p?p.length:0;const h=f.split(c);let m;h[1]&&(m=h[1].match(oe)),e.prefix=s||"",e.postfix=l||"",e.pattern=f,e.maxPrecision=m?m.length:2,e.percentage=J.test(f),e.numericPattern=a||"",e.numericRegex=new RegExp("".concat(le(t,null,!0),"|").concat(le(n,null,!0)),"g"),e.groupTemp=u,e.decTemp=c,e.t=t,e.d=n,e.temp=p}class ce{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 X;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 ce(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],ie.test(e[0])&&(r.positive.isFunctional=!0),e[1]?ie.test(e[1])&&(r.negative.isFunctional=!0):r.negative=!1,e[2]?ie.test(e[2])&&(r.zero.isFunctional=!0):r.zero=!1;const i="U"===this.type;r.positive.isFunctional||ue(r.positive,t,n,i),r.negative&&!r.negative.isFunctional&&ue(r.negative,t,n,i),r.zero&&!r.zero.isFunctional&&ue(r.zero,t,n,i)}formatValue(e){let t,n,r,i,o,a,s,l,u,c=this._prepared,p="",d="",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=se(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&&(p=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+1e-15*(e<0?-1:1)).toFixed(Math.min(20,u?u.length:0)).split(".")[0]);let n=l.split(o)[0];if(n+=o,e=Y(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)/,""),d=""):(e=e.toPrecision(Math.max(1,Math.min(14,t)))).indexOf(".")>=0&&(e=(e=e.replace(e.indexOf("e")<0?/0+$/:/\.?0+(?=e)/,"")).replace(".",o));else{for(l+=o,t=Math.max(0,Math.min(20,t-Math.ceil(Math.log(r)/Math.log(10)))),s=0;s<t;s++)l+="#";e=Y(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+d+p+c.postfix}static getStaticFormatter(){return{prepare(){},formatValue:e=>"".concat(e)}}}function pe(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 de(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 ce(...t)}(i,e,t,n,r),a=pe(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 fe="D",he="T",me="TS",ge="IV",ye=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],be=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],ve=["January","February","March","April","May","June","July","August","September","October","November","December"],qe=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function xe(e,t){for(let n=e.length;n<t;n++)e="0".concat(e);return e}function De(e){let t=e.toString().split(".");return t[1]?(t=Number("0.".concat(t[1])),t):0}function Se(e,t){let n,r=function(e){const t=e,n=24*De(t),r=60*De(n),i=60*De(r),o=1e3*De(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}}class Ce{constructor(e,t,n){const r=e||{};r.qCalendarStrings||(r.qCalendarStrings={qLongDayNames:ye,qDayNames:be,qLongMonthNames:ve,qMonthNames:qe}),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={[he]:r.qTimeFmt||"hh:mm:ss",[fe]:r.qDateFmt||"YYYY-MM-DD",[me]:r.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"}[n]),this.pattern=t}clone(){const e=new Ce(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=Se(e,t));const i=function(e,t){return{"Y+|y+":{Y:"".concat(Number("".concat(t.year).slice(-2))),YY:xe("".concat(t.year).slice(-2),2),YYY:xe("".concat(t.year).slice(-3),3),def:e=>xe("".concat(t.year),e.length)},"M+":{M:t.month+1,MM:xe("".concat(t.month+1),2),MMM:e.locale_months_abbr[t.month],def:e.locale_months[t.month]},"W+|w+":{W:t.day,WW:xe("".concat(t.day),2),WWW:e.locale_days_abbr[t.day],def:e.locale_days[t.day]},"D+|d+":{D:t.date,def:e=>xe("".concat(t.date),e.length)},"h+|H+":{h:t.h,def:e=>xe("".concat(t.h),e.length)},"m+":{m:t.m,def:e=>xe("".concat(t.m),e.length)},"s+|S+":{s:t.s,def:e=>xe("".concat(t.s),e.length)},"f+|F+":{def(e){let n="".concat(t.f),r=e.length-n.length;if(r>0)for(let e=0;e<r;e++)n+="0";else r<0&&(n=n.slice(0,e.length));return n}},"t{1,2}|T{1,2}":{def(e){let n=t.t;return e[0].toUpperCase()===e[0]&&(n=n.toUpperCase()),n=n.slice(0,e.length),n}}}}(this,r),o=[];for(const e in i)Object.prototype.hasOwnProperty.call(i,e)&&o.push(e);const a=new RegExp(o.join("|"),"g");return t.replace(a,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 Me(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Ce(...t)}function Ee(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"TS",n=Me(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,e,t),r=pe(n.format.bind(n),{toKey:e=>"object"==typeof e&&"function"==typeof e.getTime?e.getTime():e});function i(e){return t!==ge?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=Me(i,e,t),r=pe(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 Ae(){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",p=function(e,t){if(e&&e.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(e.qNumFormat.qType))return Ee(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"),de(n,r,i,o,t)}(t,i),d={id:()=>n,key:()=>r,raw:()=>t,title:()=>t.qFallbackTitle||t.label,type:()=>s,origin:()=>l,items:()=>(e||(e=o(d)),e),min:()=>t.qMin,max:()=>t.qMax,value:u,label:e=>(null==e?void 0:e.qText)||"",reduce:c,reduceLabel:"dimension"===s?"first":(e,t)=>p(t),formatter:()=>p,tags:()=>t.qTags};return d}function Ie(e,t,n,r,i){return(t[e]||[]).map((t,o)=>{const a="".concat(r?"".concat(r,"/"):"").concat(e,"/").concat(o),s={instance:Ae(p({id:"".concat(n?"".concat(n,"/"):"").concat(a),key:a,meta:t},i))};return s.attrDims=Ie("qAttrDimInfo",t,n,a,p({},i,{value:e=>null==e?void 0:e.qElemNo,type:"dimension"})),s.attrExps=Ie("qAttrExprInfo",t,n,a,p({},i,{value:e=>null==e?void 0:e.qNum,type:"measure"})),s.measures=Ie("qMeasureInfo",t,n,a,p({},i,{value:e=>null==e?void 0:e.qValue,type:"measure"})),s})}function we(){let{key:e,data:t,config:r={}}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const i={fields:[],wrappedFields:[],allFields:[],virtualFields:[]},o=t;if(!o)throw new Error('Missing "data" input');if(!o.qDimensionInfo)throw new Error('The "data" input is not recognized as a hypercube');const a=we.util,s={cache:i,cube:o,localeInfo:r.localeInfo,fieldExtractor:null,pages:null,hierarchy:()=>null,virtualFields:r.virtualFields},l={key:()=>e,raw:()=>o,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,s),fields:()=>i.fields.slice(),extract:e=>s.extractor(e,l,i,a),hierarchy:e=>s.hierarchy(e,l,i,a),_cache:()=>i};"K"===o.qMode||"T"===o.qMode||!o.qMode&&o.qNodesOnDim?(s.extractor=K,s.hierarchy=W,s.pages="K"===o.qMode?o.qStackedDataPages:o.qTreeDataPages):"S"===o.qMode?(s.extractor=m,s.pages=o.qDataPages,s.hierarchy=W):s.extractor=()=>[],s.fieldExtractor=e=>s.extractor({field:e},l,i,a);const u="S"===o.qMode?e=>e.qElemNumber:void 0,c="S"===o.qMode?e=>e.qNum:void 0;i.wrappedFields.push(...Ie("qDimensionInfo",o,e,"",p({},s,{value:u,type:"dimension"}))),i.wrappedFields.push(...Ie("qMeasureInfo",o,e,"",p({},s,{value:c,type:"measure"}))),i.fields=i.wrappedFields.map(e=>e.instance);const d=e=>{e.forEach(e=>{i.allFields.push(e.instance),d(e.measures),d(e.attrDims),d(e.attrExps)})};return d(i.wrappedFields),(r.virtualFields||[]).forEach(t=>{const r=l.field(t.from),o=Ae(n({meta:r.raw(),id:"".concat(e,"/").concat(t.key),sourceField:r,fieldExtractor:e=>s.extractor({field:e},l,i,a),key:t.key,type:r.type(),localeInfo:s.localeInfo,value:r.value},t.override||{}));i.virtualFields.push(o)}),i.allFields.push(...i.virtualFields),l}const Oe=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],Te=/\/qDimensionInfo(?:\/(\d+))?/,ke=/\/qMeasureInfo\/(\d+)/,Ne=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,Pe=/\/qAttrExprInfo\/(\d+)/,Le=/\/?qHyperCube/,_e=/\/?qTreeData/,Re=e=>"".concat(e.substr(0,e.indexOf("/qHyperCubeDef")+14)),He=e=>"".concat(e.substr(0,e.indexOf("/qTreeDataDef")+13));function Fe(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;Le.test(e)?(o="".concat(n.substr(0,n.indexOf("qHyperCube")+10)),a=Re):_e.test(e)&&(o="".concat(n.substr(0,n.indexOf("qTreeData")+9)),a=He);let s=!0;if(Te.test(e)&&(r=+Te.exec(e)[1]),ke.test(e)&&(i=+ke.exec(e)[1]),Ne.test(e)){i=-1,r=0;const e=+Ne.exec(n)[2];isNaN(e)||(r=e,n=n.replace(/\/\d+$/,"")),s=!1}if(Pe.test(e)){const e=i;if(t){i=0;const a=k(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+=+Pe.exec(n)[1]}else r>-1?(r=-1,i=+Pe.exec(n)[1]):i+=+Pe.exec(n)[1]+1}return Oe.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 Be(e){we.util=e.data("matrix").util,e.data("q",we),e.formatter("q-number",de),e.formatter("q-time",Ee)}return Be.qBrushHelper=Fe,Be.selections=Fe,Be}());N(Xe);const Je=/xyz/.test(()=>{})?/\b_super\b/:/.*/,Ze=function(){};function Qe(e,t,n,r){0===arguments.length?this.set(0,0,0,0):this.set(e,t,n,r)}Ze.extend=function e(t,n){const r=this.prototype;"string"!=typeof t&&(n=t,t="Class");const i=Object.create(this.prototype);for(const e in n)i[e]="function"==typeof n[e]&&"function"==typeof r[e]&&Je.test(n[e])?function(e,t){return function(){const n=this._super;this._super=r[e];const i=t.apply(this,arguments);return this._super=n,i}}(e,n[e]):n[e];if(!/^[_a-z][_a-z\d]*$/i.test(t))throw new Error("Invalid subclass name. Alphanumericals only.");const o=new Function(`return (function ${t}(){ typeof this.init === 'function' && this.init.apply(this, [].slice.call(arguments)) });`)();return o.prototype=i,o.prototype.constructor=o,o.extend=e,o},Qe.prototype={toString(){return`${this.x} ${this.y} ${this.width} ${this.height}`},clone(){return new Qe(this.x,this.y,this.width,this.height)},set(e,t,n,r){n>=0?(this.x=e,this.width=n):(this.x=e+n,this.width=-n),r>=0?(this.y=t,this.height=r):(this.y=t+r,this.height=-r)},setLTRB(e,t,n,r){e<=n?(this.x=e,this.width=n-e):(this.x=n,this.width=e-n),t<=r?(this.y=t,this.height=r-t):(this.y=r,this.height=t-r)},equal(e){return e&&this.x===e.x&&this.y===e.y&&this.width===e.width&&this.height===e.height},combineWith(e){const t=Math.max(e.getRight(),this.getRight()),n=Math.max(e.getBottom(),this.getBottom()),r=Math.min(e.x,this.x),i=Math.min(e.y,this.y);return new Qe(r,i,Math.max(0,t-r),Math.max(0,n-i))},intersectsWith(e){return!!e&&(this.x<=e.getRight()&&e.x<=this.getRight()&&this.y<=e.getBottom()&&e.y<=this.getBottom())},intersectsRect(e){return this.intersectsWith(e)},intersection(e,t){if(this.intersectsWith(e)){const t=Math.max(this.x,e.x),n=Math.max(this.y,e.y);return new Qe(t,n,Math.min(this.getRight(),e.getRight())-t,Math.min(this.getBottom(),e.getBottom())-n)}return t?null:new Qe(this.x,this.y,this.width,this.height)},union(e){const t=Math.min(this.x,e.x),n=Math.min(this.y,e.y);return new Qe(t,n,Math.max(this.getRight(),e.getRight())-t,Math.max(this.getBottom(),e.getBottom())-n)},pointInside(e,t){return e>=this.x&&e<=this.getRight()&&t>=this.y&&t<=this.getBottom()},rectInside(e){const t=e.getPoints();let n;for(n=0;n<4;n++)if(!this.pointInside(t[n].x,t[n].y))return!1;return!0},getPoints(){const e=[];return e.push({x:this.x,y:this.y}),e.push({x:this.getRight(),y:this.y}),e.push({x:this.getRight(),y:this.getBottom()}),e.push({x:this.x,y:this.getBottom()}),e},getRight(){return this.x+this.width},getBottom(){return this.y+this.height},getCenterPoint(){return{x:this.x+this.width/2,y:this.y+this.height/2}},getBoundingRect(){return this},scale(e){const t=e-1,n=t*this.width/2,r=t*this.height/2;this.x-=n,this.y-=r,this.width*=e,this.height*=e},hasNaN(){return Number.isNaN(+this.x)||Number.isNaN(+this.y)||Number.isNaN(+this.width)||Number.isNaN(+this.height)}};const et=new Qe(0,0,0,0),tt=new Qe(0,0,0,0),nt=Ze.extend("CubeSlicer",{init(){this.pages=[]},get(e){return e.map(e=>this.getPage(e))},getPage(e){let t,n;const r=[];let i;for(n=0;n<this.pages.length;n++)if(t=this.pages[n].qArea,et.set(e.qLeft,e.qTop,e.qWidth,e.qHeight),tt.set(t.qLeft,t.qTop,t.qWidth,t.qHeight),i=tt.intersection(et,!0),r.push({coverage:i?i.clone():new Qe(0,0,0,0),idx:n}),t.qLeft<=e.qLeft&&t.qLeft+t.qWidth>=e.qLeft+e.qWidth&&t.qTop<=e.qTop&&t.qTop+t.qHeight>=e.qTop+e.qHeight)return this._extract(e,this.pages[n]);return r.sort((e,t)=>t.coverage.width*t.coverage.height-e.coverage.width*e.coverage.height),r[0].coverage.height>0&&r[0].coverage.width>0?this._extract(e,this.pages[r[0].idx]):{qArea:{qTop:e.qTop,qLeft:e.qLeft,qWidth:0,qHeight:0},qMatrix:[]}},destroy(){this.clear()},isEmpty(){return!(this.pages&&this.pages[0]&&this.pages[0].qArea.qHeight&&this.pages[0].qArea.qWidth)},clear(){this.pages=[]},store(e){this.pages=e},containsArea(e){let t;for(let n=0;n<this.pages.length;n++)if(t=this.pages[n].qArea,t.qLeft<=e.qLeft&&t.qLeft+t.qWidth>=e.qLeft+e.qWidth&&t.qTop<=e.qTop&&t.qTop+t.qHeight>=e.qTop+e.qHeight)return!0;return!1},contains(e){return!(!this.pages||!this.pages.length)&&0===e.filter(e=>!this.containsArea(e)).length},_extract(e,t){et.set(e.qLeft,e.qTop,e.qWidth,e.qHeight),tt.set(t.qArea.qLeft,t.qArea.qTop,t.qArea.qWidth,t.qArea.qHeight);const n=et.intersection(tt,!0);if(!n)return{qArea:{qTop:e.qTop,qLeft:e.qLeft,qWidth:0,qHeight:0},qMatrix:[]};const r=Math.max(0,e.qTop-t.qArea.qTop),i=Math.max(0,e.qLeft-t.qArea.qLeft),o=t.qMatrix.slice(r,r+n.height).map(e=>e.slice(i,i+n.width));return{qArea:{qTop:n.y,qLeft:n.x,qWidth:n.width,qHeight:n.height},qMatrix:o}}});let rt;function it(e,t){let n;const r={};for(n in e)"qSubNodes"!==n&&e.hasOwnProperty(n)&&(r[n]=e[n]);return t.push(r),r}function ot(e,t,n){let r,i,o;const a=[];let s=[],l=0,u=0;for(n.length&&(l=n[0].qUp||0,u=n[n.length-1].qDown||0),r=0;r<n.length;++r)if(i=n[r],i.qSubNodes.length>0&&(s=ot(e,t,i.qSubNodes)),o=null,(0===i.qSubNodes.length&&rt>=e&&rt<=e+t||s.length>0)&&(o=it(i,a),void 0!==o.qUp&&1===a.length&&(o.qUp=l+r),o.qSubNodes=s),0===i.qSubNodes.length&&rt++,rt===e+t){o&&void 0!==o.qDown&&(o.qDown=u+(n.length-1-r));break}return a}function at(e,t,n){return rt=0,ot(e,t,n)}const st=new Qe(0,0,0,0),lt=new Qe(0,0,0,0),ut=nt.extend("PivotCubeSlicer",{init(){this._super(),this.requestedAreas=[]},getPage(e){let t,n;const r=[];let i;for(n=0;n<this.pages.length;n++)if(t=this.pages[n].qArea,st.set(e.qLeft,e.qTop,e.qWidth,e.qHeight),lt.set(t.qLeft,t.qTop,t.qWidth,t.qHeight),i=lt.intersection(st,!0),r.push({coverage:i?i.clone():new Qe(0,0,0,0),idx:n}),t.qLeft<=e.qLeft&&t.qLeft+t.qWidth>=e.qLeft+e.qWidth&&t.qTop<=e.qTop&&t.qTop+t.qHeight>=e.qTop+e.qHeight)return this._extract(e,this.pages[n]);return r.sort((e,t)=>t.coverage.width*t.coverage.height-e.coverage.width*e.coverage.height),r[0].coverage.height>0&&r[0].coverage.width>0?this._extract(e,this.pages[r[0].idx]):{qLeft:[],qTop:[],qData:[],qArea:{qTop:e.qTop,qLeft:e.qLeft,qWidth:0,qHeight:0}}},_extract(e,t){st.set(e.qLeft,e.qTop,e.qWidth,e.qHeight),lt.set(t.qArea.qLeft,t.qArea.qTop,t.qArea.qWidth,t.qArea.qHeight);const n=st.intersection(lt,!0);if(!n)return{qLeft:[],qTop:[],qData:[],qArea:{qTop:e.qTop,qLeft:e.qLeft,qWidth:0,qHeight:0}};const r=Math.max(0,e.qTop-t.qArea.qTop),i=Math.max(0,e.qLeft-t.qArea.qLeft),o=t.qData.slice(r,r+n.height).map(e=>e.slice(i,i+n.width));return{qLeft:at(r,n.height,t.qLeft),qTop:at(i,n.width,t.qTop),qData:o,qArea:{qTop:n.y,qLeft:n.x,qWidth:n.width,qHeight:n.height}}}});function ct(e){if("pivot-table"===e.visualization)this.responseProperty="qPivotDataPages",this.slicer=new ut;else{if("table"!==e.visualization)return;this.slicer=new nt}let t=e.snapshotData.object.origDataPages;t||(t=e.qHyperCube[this.responseProperty]),this.slicer.store(t.filter(e=>e))}class pt{constructor(e,t,n){this.layout=e,this.dataPath=t,this.responseProperty=n,ct.call(this,e)}getData(e){!function(e,t,n,r){if(e){t.snapshotData.object.origDataPages||(t.snapshotData.object.origDataPages=t.qHyperCube[r]);for(let e=0;e<n.length;e++)n[e].qHeight=Math.min(t.qHyperCube.qSize.qcy,n[e].qHeight),n[e].qTop=t.snapshotData.object.origDataPages[e].qArea.qTop;t.qHyperCube[r]=e.get(n)}}(this.slicer,this.layout,e,this.responseProperty);const t=Ue(this.layout,`${this.dataPath}.${this.responseProperty}`);return Promise.resolve(t)}setCacheOptions(){}updateCache(){}}const dt={version:"1.0.3",qHyperCubeDef:{qDimensions:[],qMeasures:[],qMode:"K",qAlwaysFullyExpanded:!0,qSuppressZero:!1,qSuppressMissing:!0},color:{box:{paletteColor:{index:-1,color:"#e6e6e6"}},expressionLabel:"",point:{auto:!0,mode:"primary",useBaseColors:"off",expressionIsColor:!0}},dataPoint:{bubbleScales:100,displacement:"none"},dimensionAxis:{dock:"near",label:"auto",show:"all"},measureAxis:{autoMinMax:!0,dock:"near",max:10,min:0,minMax:"min",show:"all",spacing:1},gridlines:{auto:!0,spacing:2},orientation:"horizontal",presentation:{visibleComponents:"points_box"},refLine:{refLines:[]},sorting:{autoSort:!0},showTitles:!0,subtitle:"",title:"",footnote:""};function ft(e){2===e.qHyperCubeDef.qInterColumnSortOrder.length?e.qHyperCubeDef.qInterColumnSortOrder=[1,0]:3===e.qHyperCubeDef.qInterColumnSortOrder.length&&(e.qHyperCubeDef.qInterColumnSortOrder=[1,2,0])}function ht(e){e.qHyperCubeDef.qDimensions.length>1&&e.color&&(e.color.point.persistent=!0)}function mt(e){const{translator:t}=e,n={min:1,max:2,description(e,n){let r;return r=0===n?"Visualizations.Descriptions.Point":"horizontal"===e.orientation?"properties.yAxis":"properties.xAxis",t.get(r)},added(e,t){ft(t),ht(t)},moved(e,t){ft(t),ht(t)},removed(e,t){ft(t),ht(t)}},r={min:1,max:1,description(e){const n="horizontal"===e.orientation?"properties.xAxis":"properties.yAxis";return t.get(n)}};return{path:"/qHyperCubeDef",dimensions:n,measures:r}}var gt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function yt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var bt,vt={exports:{}};var qt=(bt||(bt=1,self,vt.exports=(()=>{var e={909:e=>{var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===n.call(e)},a=function(e){if(!e||"[object Object]"!==n.call(e))return!1;var r,i=t.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!i&&!o)return!1;for(r in e);return void 0===r||t.call(e,r)},s=function(e,t){r&&"__proto__"===t.name?r(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,n){if("__proto__"===n){if(!t.call(e,n))return;if(i)return i(e,n).value}return e[n]};e.exports=function e(){var t,n,r,i,u,c,p=arguments[0],d=1,f=arguments.length,h=!1;for("boolean"==typeof p&&(h=p,p=arguments[1]||{},d=2),(null==p||"object"!=typeof p&&"function"!=typeof p)&&(p={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)r=l(p,n),p!==(i=l(t,n))&&(h&&i&&(a(i)||(u=o(i)))?(u?(u=!1,c=r&&o(r)?r:[]):c=r&&a(r)?r:{},s(p,{name:n,newValue:e(h,c,i)})):void 0!==i&&s(p,{name:n,newValue:i}));return p}},8:(e,t)=>{(()=>{var e={229:e=>{var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===n.call(e)},a=function(e){if(!e||"[object Object]"!==n.call(e))return!1;var r,i=t.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!i&&!o)return!1;for(r in e);return void 0===r||t.call(e,r)},s=function(e,t){r&&"__proto__"===t.name?r(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,n){if("__proto__"===n){if(!t.call(e,n))return;if(i)return i(e,n).value}return e[n]};e.exports=function e(){var t,n,r,i,u,c,p=arguments[0],d=1,f=arguments.length,h=!1;for("boolean"==typeof p&&(h=p,p=arguments[1]||{},d=2),(null==p||"object"!=typeof p&&"function"!=typeof p)&&(p={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)r=l(p,n),p!==(i=l(t,n))&&(h&&i&&(a(i)||(u=o(i)))?(u?(u=!1,c=r&&o(r)?r:[]):c=r&&a(r)?r:{},s(p,{name:n,newValue:e(h,c,i)})):void 0!==i&&s(p,{name:n,newValue:i}));return p}}},n={};function r(t){var i=n[t];if(void 0!==i)return i.exports;var o=n[t]={exports:{}};return e[t](o,o.exports,r),o.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};(()=>{r.r(i),r.d(i,{default:()=>Te});var e=r(229),t=r.n(e);const n=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},o=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},a={EXPRESSIONS:{observed:"",trend:"STL_Trend",seasonal:"STL_Seasonal",residual:"STL_Residual"},OPTIONS:[{value:"observed",translation:"cao.trendDecomposition.parameters.decomposition.observed"},{value:"trend",translation:"cao.trendDecomposition.parameters.decomposition.trend"},{value:"seasonal",translation:"cao.trendDecomposition.parameters.decomposition.seasonal"},{value:"residual",translation:"cao.trendDecomposition.parameters.decomposition.residual"}]};var 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 p(e){return!(!e.fullAccumulation&&!e.fullRange)}function d(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),n=t.trim();return"="===n.substring(0,1)?n.substring(1).trim():n}function h(){return"[$(=Replace(GetObjectField(".concat(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,"),']',']]'))]")}function m(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){return"Replace(Replace(".concat(e,",'''',''''''),'$','$''&''')")}function b(e,t){return e?"".concat(t,'={">=$(=Min(').concat(t,"))<=$(=Max(").concat(t,'))"}'):"".concat(t,'={"=Only({1}').concat(t,")>='$(=").concat(y("MinString(".concat(t,")")),")' and Only({1}").concat(t,")<='$(=").concat(y("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=b(c(r[0],i),h(0));return"".concat(a,"({1<").concat(u,">}").concat(l,")")}if(r&&2===r.length){var p=c(r[0],i),d=c(r[1],i),f=h(0),m=h(1),g=b(p,f),y=b(d,m);return"".concat(a,"({1<").concat(g,",").concat(y,">}").concat(l,")")}return"".concat(a,"({1}").concat(l,")")}function q(e){return"".concat(e,"(")}function x(e){var t=e.properties,n=e.layout;return o(t,"qHyperCubeDef.qDimensions",o(n,"qHyperCube.qDimensionInfo",[])).length}const D={isFullRange:p,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=h(0);return"If(Count(".concat(c,") > 0, ").concat(a," + ").concat(s).concat(l,")")}if(r&&2===r.length){var p=h(0),d=h(1);return"If(Count(".concat(p,") * Count(").concat(d,") > 0, ").concat(a," + ").concat(s).concat(l,")")}return a},getRowNoComp:d,getNumStepComp:function(e,t){if(!p(e)){var n=e.steps;return"number"!=typeof n||Number.isNaN(n)?6:n}return d(e,t)},getAboveCompPrefix:m,getAboveCompSuffix:g,getAboveComp:function(e,t,n,r){return m(e,t)+n+g(r)},getFunctionPrefix:q,getFunctionSuffix:function(){return")"},getRangeComp:function(e,t){return q(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,i=function(e){return void 0===e.primaryDimension?e.accumulationDimension:e.primaryDimension}(t);return 0===i&&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=h(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:h,getFieldWithWrapper:function(e){var t=e?e.replace(/]/g,"]]"):e;return"[".concat(t,"]")},generateTSDExpression:function(e,t,n){var r=t||e.outputExpression;if(e.base&&e.base.qDef&&(r=t!==e.base.qDef?t:e.base.qDef),"observed"!==e.decomposition){var i=n.qHyperCubeDef.qMeasures.find(function(t){return t.qDef.base&&t.qDef.base.qLibraryId&&e.base&&e.base.qLibraryId?t.qDef.base.qLibraryId===e.base.qLibraryId:null});i&&t!==i.qDef.qLabel&&(r=i.qLibraryId||i.qDef.base.qLibraryId?"[".concat(i.qDef.qLabel,"]"):i.qDef.base.qDef);var o=function(e){var t=a.OPTIONS.find(function(t){return t.value===e.decomposition});return t?a.EXPRESSIONS[t.value]:""}(e);r=r.startsWith("=")?r.substr(1):r,r="".concat(o,"(").concat(r,", ").concat(e.steps,")")}return r},getDecomposition:function(e){var t="observed";return Object.values(a.EXPRESSIONS).find(function(n){var r=e.qDef.base.qDef.toLowerCase()||e.qDef.qDef.toLowerCase();return a.EXPRESSIONS[n]&&r.includes(a.EXPRESSIONS[n].toLowerCase())&&(t=n),n}),t}};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 C(e){return C="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},C(e)}var M=t().bind(null,!0),E={},A=Array.isArray;function I(e){return null!=e&&!Array.isArray(e)&&"object"===C(e)}function w(e){return void 0===e}function O(e,t){return"function"==typeof e[t]||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function T(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]=w(e[n||t])?o:e[t],e=e[n||t]}}),e}function k(e,t){var n=!0;if(I(e)&&I(t))return Object.keys(e).length===Object.keys(t).length&&(Object.keys(e).forEach(function(r){k(e[r],t[r])||(n=!1)}),n);if(A(e)&&A(t)){if(e.length!==t.length)return!1;for(var r=0,i=e.length;r<i;r+=1)if(!k(e[r],t[r]))return!1;return!0}return e===t}E.generate=function(e,t,n){n=n||"";var r=[];return Object.keys(t).forEach(function(i){var o=function(e){return e?M({},{val:e}).val:e}(t[i]),a=e[i],s="".concat(n,"/").concat(i);k(o,a)||O(t,i)||(w(a)?r.push({op:"add",path:s,value:o}):I(o)&&I(a)?r=r.concat(E.generate(a,o,s)):A(o)&&A(a)?r=r.concat(function(e,t,n){var r=[],i=e.slice(),o=-1;function a(e,t,n){if(e[n]&&w(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(k(t,i))return r;if(!w(t[0])&&w(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(E.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){w(t[i])&&!O(e,i)&&r.push({op:"remove",path:"".concat(n,"/").concat(i)})}),r},E.apply=function(e,t){t.forEach(function(t){var n,r,i=T(e,t.path),o=t.path.split("/").splice(-1)[0],a=o&&Number.isNaN(+o)?i[o]:i[+o]||i,s=t.from?t.from.split("/").splice(-1)[0]:null;if("/"===t.path&&(i=null,a=e),"add"===t.op||"replace"===t.op)if(A(i))"-"===o&&(o=i.length),i.splice(+o,"add"===t.op?0:1,t.value);else if(A(a)&&A(t.value)){var l,u=t.value.slice();a.length=0,(l=a).push.apply(l,function(e){if(Array.isArray(e))return S(e)}(r=u)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||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}}(r)||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.")}())}else if(I(a)&&I(t.value))n=a,Object.keys(n).forEach(function(e){Object.getOwnPropertyDescriptor(n,e).configurable&&!O(n,e)&&delete n[e]}),M(a,t.value);else{if(!i)throw new Error("Patchee is not an object we can patch");i[o]=t.value}else if("move"===t.op){var c=T(e,t.from);A(i)?i.splice(+o,0,c.splice(+s,1)[0]):(i[o]=c[s],delete c[s])}else"remove"===t.op&&(A(i)?i.splice(+o,1):delete i[o])})},E.clone=function(e){return M({},e)},E.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},E.updateObject=function(e,t){Object.keys(e).length?E.apply(e,E.generate(e,t)):M(e,t)};const N=E,P=function(e,n,r){if(!e)return Promise.resolve();var i=N.generate(n,r);return t()(!0,n,r),i&&i.length?(i=i.map(function(e){return{qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path}}),e.applyPatches(i,!0)):Promise.resolve()};var L="accumulation";function _(e,t){var n=o(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=o(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 H={type:"accumulation",disabled:!1,accumulationDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullAccumulation:!1,steps:6,outputExpression:""};const F={translationKey:"properties.modifier.accumulation",needDimension:D.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return D.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,a=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=a;void 0===l&&(l=D.getNumDimensions({properties:r,layout:i}));var u=o(r,"qHyperCubeDef.qDimensions",[]),c=D.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:u,dimensionAndFieldList:s}),p=D.getNumStepComp(n,l),d=D.getAboveComp(n,l,c,p),f=D.getRangeComp("RangeSum",d);if(D.needDimension({modifier:n,properties:r,layout:i})){var h=D.getDimComp(u,1),m=D.getDimComp(u,0),g=D.getAggrComp(f,h,m);f=n.showExcludedValues?D.getExcludedComp({modifier:n,dimensions:u,dimensionAndFieldList:s,valueComp:g}):g}return f},extractInputExpression:D.extractInputExpression,initModifier:function(e){D.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.accumulation.disclaimer",show:function(e,t){return!D.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=_(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.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 D.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=_(t,e);return o&&!o.disabled}};return n}};var B="movingAverage";function V(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===B)return n[r]}function z(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===B)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};const $={translationKey:"properties.modifier.movingAverage",needDimension:D.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return D.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t,n=e.expression,r=e.modifier,i=e.properties,a=e.layout,s=e.numDimensions,l=e.dimensionAndFieldList;if(!r)return n;var u=s;void 0===u&&(u=D.getNumDimensions({properties:i,layout:a}));var c=o(i,"qHyperCubeDef.qDimensions",[]),p=r.showExcludedValues&&r.nullSuppression,d=D.getExpressionWithExcludedComp({expression:n,modifier:r,dimensions:c,dimensionAndFieldList:l,treatMissingAsNull:p}),f=D.getNumStepComp(r,u),h=D.getAboveComp(r,u,d,f);if(r.nullSuppression)t=D.getRangeComp("RangeAvg",h);else{var m=D.getRangeComp("RangeSum",h),g=function(e,t){var n=D.getRowNoComp(e,t);if(!D.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(m," / ").concat(g)}var y=t;if(D.needDimension({modifier:r,properties:i,layout:a})){var b=D.getDimComp(c,1),v=D.getDimComp(c,0),q=D.getAggrComp(y,b,v);y=r.showExcludedValues?D.getExcludedComp({modifier:r,dimensions:c,dimensionAndFieldList:l,funcComp:"Only",valueComp:q}):q}return y},extractInputExpression:D.extractInputExpression,initModifier:function(e){D.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!D.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(z(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(z(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(z(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(z(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=V(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=V(t,e);return n&&!n.fullRange}},showExcludedValues:{refFn:function(t){return"".concat(z(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0},nullSuppression:{refFn:function(t){return"".concat(z(t,e),".nullSuppression")},type:"boolean",translation:t.showNull||"properties.dimensions.showNull",schemaIgnore:!0,defaultValue:!1,inverted:!0}},show:function(e,t){return D.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(B))return!1;var o=V(t,e);return o&&!o.disabled}};return n}};var U="timeSeriesDecomposition";function W(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===U)return n[r]}function K(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===U)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var Y={type:"timeSeriesDecomposition",disabled:!1,decomposition:"",steps:2,outputExpression:""};const G={translationKey:"properties.modifier.timeSeriesDecomposition",needDimension:D.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return D.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties;return n?D.generateTSDExpression(n,t,r):t},extractInputExpression:D.extractInputExpression,initModifier:function(e,t){D.initModifier(e,Y),""===e.decomposition&&t&&(e.decomposition=D.getDecomposition(t))},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.timeSeriesDecomposition||"properties.modifier.timeSeriesDecomposition",show:function(e,t){return!D.isApplicable({properties:t.properties})}},settings:{type:"items",items:{decomposition:{refFn:function(t){return"".concat(K(t,e),".decomposition")},type:"string",translation:t.modifierTrendDecompositionDecomposition||"properties.modifier.trendDecomposition.decomposition",component:"dropdown",schemaIgnore:!0,defaultValue:t.trendDecompositionParametersDecompositionObserved||"cao.trendDecomposition.parameters.decomposition.observed",options:a.OPTIONS},steps:{refFn:function(t){return"".concat(K(t,e),".steps")},type:"integer",translation:t.modifierTimeSeriesDecompositionPeriods||"properties.modifier.timeSeriesDecomposition.periods",schemaIgnore:!0,defaultValue:2,change:function(t,n){var r=W(t,e);if(r){var i=r.steps;r.steps="number"!=typeof i||Number.isNaN(i)?2:Math.abs(i),n.properties.qHyperCubeDef.qMeasures=n.properties.qHyperCubeDef.qMeasures.map(function(e){return e.qDef.modifiers.map(function(e){return"timeSeriesDecomposition"===e.type?e.steps=i:e.steps=e.steps,e}),e})}},show:function(t){var n=W(t,e);return n&&!n.fullRange}}},show:function(e,t){return D.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(U))return!1;var o=W(t,e);return o&&!o.disabled}};return n}};var X="difference";function J(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===X)return n[r]}function Z(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===X)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var Q={type:"difference",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,outputExpression:""};const ee={translationKey:"properties.modifier.difference",needDimension:D.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return D.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:D.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,a=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=a;void 0===l&&(l=D.getNumDimensions({properties:r,layout:i}));var u=o(r,"qHyperCubeDef.qDimensions",[]),c=D.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:u,dimensionAndFieldList:s}),p=D.getAboveComp(n,l,c),d="".concat(c," - ").concat(p);if(D.needDimension({modifier:n,properties:r,layout:i})){var f=D.getDimComp(u,1),h=D.getDimComp(u,0),m=D.getAggrComp(d,f,h);d=n.showExcludedValues?D.getExcludedComp({modifier:n,dimensions:u,dimensionAndFieldList:s,funcComp:"Only",valueComp:m}):m}return d},initModifier:function(e){Object.keys(Q).forEach(function(t){void 0===e[t]&&(e[t]=Q[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!D.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(Z(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(Z(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(Z(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return D.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(X))return!1;var o=J(t,e);return o&&!o.disabled}};return n}};var te="normalization";function ne(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===te)return n[r]}function re(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===te)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}function ie(e,t){for(var n=0;n<e.length;n++)if(e[n].value===t)return n;return-1}var oe={type:"normalization",disabled:!1,primaryDimension:0,outputExpression:"",dimensionalScope:2,selectionScope:2};function ae(e){return 2===e?"{1}":""}function se(e,t,n){return 1===e?"{$<".concat(D.getFieldWithWrapper(t),"={'").concat(n,"'}>}"):""}function le(e,t){return 0===e&&t>1||2===e?"Total":""}function ue(e,t,n){return 0===e&&t>1?"<".concat(D.getDimDefWithWrapper(n),">"):""}const ce={translationKey:"properties.modifier.normalization",needDimension:function(){return!0},isApplicable:function(e){var t=e.properties,n=e.layout;return D.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:D.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,a=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=a;void 0===l&&(l=D.getNumDimensions({properties:r,layout:i}));var u=o(r,"qHyperCubeDef.qDimensions",[]),c=D.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:u,dimensionAndFieldList:s}),p=n.selectionScope,d=n.dimensionalScope;return function(e,t,n,r,i,o,a){var s=ae(t),l=se(t,n,r),u=""===s&&""===l?"":s||l,c=le(i,o),p=ue(i,o,a),d=function(e){for(var t=[],n=0;n<e;n++)t[n]=D.getDimDefWithWrapper(n);return t.join(", ")}(o);return"".concat(e,"/ Sum(").concat(u," ").concat(c).concat(p," Aggr(").concat(u," ").concat(e,", ").concat(d,"))")}(c,p,n.field,n.value,d,l,n.primaryDimension)},initModifier:function(e){Object.keys(oe).forEach(function(t){void 0===e[t]&&(e[t]=oe[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!D.isApplicable({properties:t.properties})}},settings:{type:"items",items:{selectionScope:{refFn:function(t){return"".concat(re(t,e),".selectionScope")},type:"string",translation:t.modifierSelectionScope||"properties.modifier.selectionScope",title:{translation:t.modifierSelectionScopeTooltip||"properties.modifier.selectionScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:2,options:function(n){return function(e,t,n){var r=[{value:0,translation:t.selectionScopeCurrentSelection||"properties.modifier.selectionScope.currentSelection"},{value:1,translation:t.selectionScopeSpecificValue||"properties.modifier.selectionScope.selectAField"},{value:2,translation:t.selectionScopeTotal||"properties.modifier.selectionScope.total"}];return r=function(e,t){if(1===e){var n=ie(t,0);t.splice(n,1)}return t}(ne(e,n).dimensionalScope,r),r}(n,t,e)}},field:{refFn:function(t){return"".concat(re(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 1===ne(t,e).selectionScope}},value:{refFn:function(t){return"".concat(re(t,e),".value")},type:"string",ref:"value",component:"string",translation:"properties.value",expression:"optional",show:function(t){return 1===ne(t,e).selectionScope}},dimensionalScope:{refFn:function(t){return"".concat(re(t,e),".dimensionalScope")},type:"string",translation:t.modifierDimensionalScope||"properties.modifier.dimensionalScope",title:{translation:t.modifierDimensionalScopeTooltip||"properties.modifier.dimensionalScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:2,supportTooltip:!0,options:function(n,r){return function(e,t,n,r){var i=t.layout.qHyperCube.qDimensionInfo.length,o=[{value:0,translation:n.dimensionalScopeOneDimension||"properties.modifier.dimensionalScope.respectOneDimension",tooltipTranslation:n.dimensionalScopeOneDimensionTooltip||"properties.modifier.dimensionalScope.respectOneDimension.tooltip"},{value:1,translation:n.dimensionalScopeAllDimensions||"properties.modifier.dimensionalScope.".concat(2===i?"respectAllDimensions":"respectDimension"),tooltipTranslation:n.dimensionalScopeAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===i?"respectAllDimensions":"respectDimension",".tooltip")},{value:2,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){if(e<2){var n=ie(t,0);t.splice(n,1)}return t}(i,o),o=function(e,t){if(0===e){var n=ie(t,1);t.splice(n,1)}return t}(ne(e,r).selectionScope,o),o}(n,r,t,e)}},primaryDimension:{refFn:function(t){return"".concat(re(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 0===(ne(t,e).dimensionalScope||0)&&n.layout.qHyperCube.qDimensionInfo.length>1}}},show:function(e,t){return D.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(te))return!1;var o=ne(t,e);return o&&!o.disabled}};return n},getDisregardSelectionComp:ae,getFieldSelectionComp:se,getTotalComp:le,getSelectedDimComp:ue};var pe="qDef.base",de="qDef.qDef",fe="qDef.base.qDef",he="qLibraryId",me="qDef.base.qLibraryId";const ge={getExpression:function(e){var t=o(e,fe);return void 0!==t?t:o(e,de)},getExpressionRef:function(e){return void 0!==o(e,fe)?fe:de},getLibraryIdRef:function(e){return o(e,me)?me:he},getLibraryId:function(e){return o(e,me)||o(e,he)},getLabelRef:function(e){return o(e,pe)?"qDef.base.qLabel":"qDef.qLabel"},getLabelExpressionRef:function(e){return o(e,pe)?"qDef.base.qLabelExpression":"qDef.qLabelExpression"}};var ye="qDef.qDef",be="qDef.base.qDef",ve="qLibraryId",qe="qDef.base.qLibraryId",xe="qDef.qLabel",De="qDef.qLabelExpression",Se="qDef.base.qLabel",Ce="qDef.base.qLabelExpression",Me="qDef.qAggrFunc",Ee="qDef.base.qAggrFunc",Ae={initBase:function(e,t){(t||Ae.isValid(e))&&(n(e,be,o(e,ye)),n(e,qe,o(e,ve)),n(e,Se,o(e,xe)),n(e,Ce,o(e,De)))},restoreBase:function(e){Ae.isValid(e)&&(n(e,ye,o(e,be)),n(e,ve,o(e,qe)),n(e,xe,o(e,Se)),n(e,De,o(e,Ce)),o(e,Me)&&o(e,Ee)&&n(e,Me,o(e,Ee)),delete e.qDef.base)},isValid:function(e){var t=o(e,be),n=o(e,qe);return void 0!==t||void 0!==n}};const Ie=Ae;function we(e){return we="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},we(e)}var Oe={accumulation:F,movingAverage:$,difference:ee,normalization:ce,timeSeriesDecomposition:G};const Te={modifiers:Oe,apply:Ne,applyModifiers:Pe,cleanUpMeasure:Le,destroy:function(e){e&&ke[e.id]&&ke[e.id].masterItemSubscriber&&(ke[e.id].masterItemSubscriber&&ke[e.id].masterItemSubscriber.unsubscribe(),delete ke[e.id])},hasActiveModifiers:_e,getActiveModifier:Re,initBase:Ie.initBase,isSupportedModifiers:function(e){return Array.isArray(e)&&e.some(function(e){return Oe[e]})},isApplicableSupportedModifiers:function(e){var t=e.modifierTypes,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some(function(e){return Oe[e]&&Oe[e].isApplicable({properties:n,layout:r})})},measureBase:ge,limitedSorting:function(e){var t=e.measures,n=e.properties,r=e.layout,i=!1,o=!1;return t.forEach(function(e){var t=Be(e);Ke({modifiers:t,properties:n,layout:r})&&(i=!0,o=o||Ze({modifiers:t,properties:n,layout:r}))}),i&&!o},ifEnableTotalsFunction:He};var ke={};function Ne(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.model,r=e.properties,i=e.isSnapshot,a=void 0!==i&&i,s=e.masterItem,l=!1;ke[n.id]=ke[n.id]||{isFirstTime:!0};var u=ke[n.id].isFirstTime;if(ke[n.id].isFirstTime=!1,r&&"object"===we(r))return Pe({model:n,properties:r});var c=n?n.layout:void 0,p=o(c,"qSelectionInfo.qInSelections");if(a||p)return Promise.resolve(l);var d=o(c,"qHyperCube.qMeasureInfo"),f=ke[n.id].lastReloadTime;if(ke[n.id].lastReloadTime=o(n,"app.layout.qLastReloadTime"),_e({measures:d,layout:c})){var h=function(e){var t=e.measures,n=e.layout,r=e.lastReloadTime;return o(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 We({measure:e,properties:n,layout:r})})}({measures:t,layout:n})}({measures:d,layout:c,model:n,lastReloadTime:f});return h||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 Ke({modifiers:Be(t),layout:n})?!t.base:!!t.base}({measure:e,layout:n})}))}({measures:d,layout:c,masterItem:s,isFirstTime:u})?n.getEffectiveProperties().then(function(e){var r=t()(!0,{},e);ze(r);var i=Qe(r);return Ye({model:n}).then(function(t){return Ge({libraryIds:i,model:n}).then(function(i){return h&&function(e){var t=e.properties;Fe(t).forEach(function(e){return function(e){var t=e.measure;if(We({measure:t,properties:e.properties})){var n=0,r=t.qDef.modifiers;Array.isArray(r)&&r.forEach(function(e){if("object"===we(e)&&!e.disabled){if(n++,"object"!==we(Oe[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=Oe[e.type].extractInputExpression({outputExpression:t.qDef.qDef,modifier:e});void 0!==r&&$e(t)&&D.simplifyExpression(t.qDef.base.qDef)!==D.simplifyExpression(r)&&(t.qDef.base.qDef=r)}})}}({measure:e,properties:t})})}({properties:r}),Pe({model:n,oldProperties:e,properties:r,runUpdateIfChange:!0,masterItem:s,libraryItemsProps:i,dimensionAndFieldList:t})})})}):Promise.resolve(l)}return function(e){return!!Array.isArray(e)&&e.some(function(e){return"object"===we(e.base)})}(d)?n.getEffectiveProperties().then(function(e){return function(e){var n=e.model,r=e.properties,i=Qe(r);return et({model:n,libraryIds:i}).then(function(){var e=t()(!0,{},r);return Fe(r).forEach(function(e){return Le(e)}),Je({oldProperties:e,newProperties:r,model:n})})}({model:n,properties:e})}):Promise.resolve(l)}function Pe(e){var n=e.model,r=e.oldProperties,i=e.properties,a=e.measures,s=e.runUpdateIfChange,l=void 0!==s&&s,u=e.masterItem,c=e.libraryItemsProps,p=e.dimensionAndFieldList;void 0===r&&(r=l?t()(!0,{},i):i),ze(i);var d=Qe(i);return et({model:n,libraryIds:d,masterItem:u}).then(function(){return function(e){var n=e.measures,r=e.properties,i=e.model,a=e.libraryItemsProps,s=e.dimensionAndFieldList;if(n||(n=Fe(r)),!n.length)return Promise.resolve();if(!_e({measures:n,properties:r}))return n.forEach(function(e){return Le(e)}),Promise.resolve();var l=a?void 0:Qe(r);return Ye({model:i,dimensionAndFieldList:s}).then(function(e){return Ge({libraryIds:l,model:i,libraryItemsProps:a}).then(function(i){n.forEach(function(n){Ke({modifiers:n.qDef.modifiers,properties:r})?(function(e){var n=e.measure,r=e.properties,i=e.libraryItemsProps,a=e.dimensionAndFieldList,s=0;Ie.isValid(n)||Ie.initBase(n,!0);var l=n.qDef,u=l.modifiers,c=l.base;Array.isArray(u)&&u.forEach(function(e){if("object"===we(e)&&!e.disabled){if(s++,"object"!==we(Oe[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)");Oe[e.type].initModifier(e,n);var l=n.qLibraryId||c&&c.qLibraryId;l?function(e){var n=e.measure,r=e.modifier,i=e.properties,o=e.dimensionAndFieldList,a=e.libraryItemsProps[e.libraryId],s=a.qMeasure.qDef,l=""===s?s:Oe[r.type].generateExpression({expression:s,modifier:r,properties:i,dimensionAndFieldList:o});r.outputExpression=l,n.qDef.qDef=r.outputExpression,(n.qDef.qLabel||a.qMeasure.qLabel)&&(n.qDef.qLabel=a.qMeasure.qLabel),(n.qDef.qLabelExpression||a.qMeasure.qLabelExpression)&&(n.qDef.qLabelExpression=a.qMeasure.qLabelExpression),n.qDef.quarantine&&n.qDef.quarantine.qNumFormat&&a.qMeasure.qNumFormat&&(n.qDef.qNumFormat=a.qMeasure.qNumFormat,n.qDef.isCustomFormatted=a.qMeasure.isCustomFormatted),delete n.qLibraryId,n.qDef.coloring=a.qMeasure.coloring,r.base=t()(!0,{},n.qDef.base)}({measure:n,modifier:e,libraryId:l,properties:r,libraryItemsProps:i,dimensionAndFieldList:a}):function(e){var n=e.measure,r=e.modifier,i=e.properties,o=e.dimensionAndFieldList;"function"==typeof Oe[r.type].updateModifier&&Oe[r.type].updateModifier(r,i.qHyperCubeDef);var a=ge.getExpression(n),s=""===a?a:Oe[r.type].generateExpression({expression:a,modifier:r,properties:i,dimensionAndFieldList:o});r.outputExpression=s,n.qDef.qDef=r.outputExpression,n.qDef.base.qLabelExpression?n.qDef.qLabelExpression=n.qDef.base.qLabelExpression:n.qDef.qLabel=n.qDef.base.qLabel||a,r.base=t()(!0,{},n.qDef.base)}({measure:n,modifier:e,properties:r,dimensionAndFieldList:a}),function(e){var t=o(e,"qDef.qAggrFunc");"Expr"!==t||He(e)?"None"!==t?delete e.qDef.base.qAggrFunc:"None"===t&&He(e)&&"Expr"===e.qDef.base.qAggrFunc&&(e.qDef.qAggrFunc="Expr",delete e.qDef.base.qAggrFunc):(e.qDef.qAggrFunc="None",e.qDef.base.qAggrFunc="Expr")}(n)}})}({measure:n,properties:r,libraryItemsProps:i,dimensionAndFieldList:e}),je(n)):Le(n)})})})}({measures:a,properties:i,model:n,libraryItemsProps:c,dimensionAndFieldList:p}).then(function(){return l?Je({oldProperties:r,newProperties:i,model:n}):Promise.resolve(!1)})})}function Le(e){!function(e){var t=Be(e);return Array.isArray(t)&&t.some(function(e){return"object"===we(e)&&!e.disabled&&!Oe[e.type]})}(e)?Ie.restoreBase(e):delete e.qDef.base,e.qDef.coloring&&delete e.qDef.coloring,je(e)}function _e(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some(function(e){return Ke({modifiers:Be(e),properties:n,layout:r})})}function Re(e){var t=Be(e);if(Array.isArray(t))for(var n=0;n<t.length;n++){var r=t[n];if(Oe[r.type]&&!r.disabled)return r}}function He(e){var t=Re(e);return!t||Oe[t.type].enableTotalsFunction(e)}function Fe(e){return o(e,"qHyperCubeDef.qMeasures",[]).concat(o(e,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",[]))}function Be(e){return e.modifiers||e.qDef&&e.qDef.modifiers}function Ve(e){return o(e,"outputExpression.qValueExpression.qExpr")||o(e,"outputExpression")}function ze(e){Fe(e).forEach(function(e){return function(e){var n=Re(e);n&&(void 0!==n.outputExpression&&Ve(n)!==e.qDef.qDef?delete e.qDef.base:!Ie.isValid(e)&&n.base&&(e.qDef.base=t()(!0,{},n.base)))}(e)})}function je(e){var t=Be(e);Array.isArray(t)&&t.forEach(function(t){"object"===we(t)&&(t.disabled||!Oe[t.type]&&Ve(t)!==e.qDef.qDef)&&(t.disabled=!0,delete t.base)})}function $e(e){return e.base||e.qDef&&e.qDef.base}function Ue(e){var t=$e(e);return e.qLibraryId||t&&t.qLibraryId}function We(e){var t=e.measure,n=e.properties,r=e.layout;return!Ue(t)&&Ke({modifiers:Be(t),properties:n,layout:r})}function Ke(e){var t=e.modifiers,n=e.properties,r=e.layout,i={};return Array.isArray(t)&&t.some(function(e){return!("object"!==we(e)||e.disabled||!Oe[e.type])&&(void 0===i[e.type]&&(i[e.type]=Oe[e.type].isApplicable({properties:n,layout:r})),i[e.type])})}function Ye(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 Ge(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 Xe(e,t){if(""!==t||-1===["qFmt","qDec","qThou"].indexOf(e))return t}function Je(e){var t=e.oldProperties,n=e.newProperties,r=e.model,i=JSON.stringify(o(t,"qHyperCubeDef.qMeasures"),Xe)!==JSON.stringify(o(n,"qHyperCubeDef.qMeasures"),Xe)||JSON.stringify(o(t,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Xe)!==JSON.stringify(o(n,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Xe);return i?function(e){var t=e.model,n=e.oldProperties,r=e.newProperties,i=t.layout;return i&&!i.qHasSoftPatches&&!i.qExtendsId&&o(i,"qMeta.privileges",[]).indexOf("update")>-1?t.setProperties(r):P(t,n,r)}({model:r,oldProperties:t,newProperties:n}).then(function(){return i}):Promise.resolve(i)}function Ze(e){var t=e.modifiers,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some(function(e){return"object"===we(e)&&!e.disabled&&Oe[e.type]&&Oe[e.type].needDimension({modifier:e,properties:n,layout:r})})}function Qe(e){var t=Fe(e),n=[],r=[],i=!1;return t.forEach(function(t){var r=Be(t);if(Ke({modifiers:r,properties:e})){var o=Ue(t);o&&n.push(o),i=i||Ze({modifiers:r,properties:e})}}),o(e,"qHyperCubeDef.qDimensions",[]).forEach(function(e){var t=e.qLibraryId;t&&r.push(t)}),{measureLibraryIds:n,dimensionLibraryIds:r}}function et(e){var t=e.model,n=e.libraryIds;return!e.masterItem&&n&&(n.measureLibraryIds.length||n.dimensionLibraryIds.length)?(ke[t.id].masterItemSubscriber=ke[t.id].masterItemSubscriber||function(e){var t=e.model,n=e.callback,r={},i={},a={},s={dimension:["qDim.qFieldDefs"],measure:["qMeasure.qDef","qMeasure.qLabel","qMeasure.qLabelExpression","qMeasure.coloring","qMeasure.qNumFormat","qMeasure.isCustomFormatted"]};function l(e){var t={},n=o(e,"qInfo.qType");return n&&s[n]&&s[n].forEach(function(n){t[n]=o(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,o=e.dimensionLibraryIds,s=[];return function(e){var t=e.dimensionLibraryIds;i={},e.measureLibraryIds.forEach(function(e){i[e]=!0}),a={},t.forEach(function(e){a[e]=!0})}({measureLibraryIds:n,dimensionLibraryIds:o}),Object.keys(r).forEach(function(e){i[e]||a[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(a).forEach(function(e){a[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 Ne({model:t,masterItem:e}).then(function(){return t.app.clearUndoBuffer()})}}),ke[t.id].masterItemSubscriber.subscribe(n)):Promise.resolve()}})(),t.default=i.default,Object.defineProperty(t,"__esModule",{value:!0})})()}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var r={};return(()=>{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)}function t(n){var r=e(n%62),i=Math.floor(n/62);return i>0?t(i)+r:r}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},i(e)}n.d(r,{default:()=>ze});const 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 t(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}const p={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};var d=n(8),f=n.n(d);const h=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))},m=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))},g=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&&p.isOrderedSubset(i,r.interColumnSortOrder)&&(r.interColumnSortOrder=i.concat())},y=function(e){var t=e.exportFormat,n=e.properties;Object.keys(n).forEach(function(e){t.properties[e]=n[e]})},b=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},v=function(e){e.forEach(function(e){f().cleanUpMeasure(e),e.qDef.modifiers&&(e.store={modifiers:e.qDef.modifiers},delete e.qDef.modifiers)})};function q(e,t,n){var r,i,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=o.getValue(e,t);if(!o.isAtomicValue(s))try{if((i=(i=(r=JSON.stringify(s)).match(/:\{/g))?i.length:0)>2&&!a)return;s=JSON.parse(r)}catch(e){return}o.getValue(e,"qLayoutExclude.quarantine")||o.setValue(e,"qLayoutExclude.quarantine",{});var l=o.getValue(e,"qLayoutExclude.quarantine");l[n]||(l[n]={}),l[n][t]=s}var x=n(909),D=n.n(x);function S(e,t){var n=D()(!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 C(e,t){return D()(!0,{},t,e)}function M(e,t,n){return"function"==typeof e?e(t):Number.isNaN(+e)?n:e}var E=Math.pow(2,53)-1;function A(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 I(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}const w=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},O=function(e,t,n){t.hasOwnProperty(e)&&(n[e]=t[e])},T=function(e,t,n,r){t.hasOwnProperty(e)?n[e]=t[e]:n[e]=r},k=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}}},N=function(){return{qDef:{autoSort:!0,cId:"",numFormatFromTemplate:!0},qLibraryId:"",qTrendLines:[]}},P=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=S(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=S(s.excludedDimensions[t],a);o.qDimensions.length<i?o.qDimensions.push(u):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(u)}},L=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=C(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=C(s.excludedMeasures[t],a);o.qMeasures.length<i?o.qMeasures.push(u):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(u)}},_=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=M(a.max,i.dimensions.length,E),l=M(a.min,i.dimensions.length,0);return{maxDimensions:M(o.max,s,E),minDimensions:M(o.min,l,0),maxMeasures:s,minMeasures:l}},R=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?(p.indexAdded(n.qInterColumnSortOrder,o),++o):(--o,p.indexRemoved(n.qInterColumnSortOrder,o))},H=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=D()(!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=D()(!0,{},n,i)).components&&(i.components=[]),i},F=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},B=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=[]))},V=function(e){var t,n=e.newProperties,r=e.dataDefinition,i=e.hypercubePath;if(r.dimensions&&"function"==typeof r.dimensions.added){var a=o.getValue(n,i||"").qHyperCubeDef,s=function(e){if(Array.isArray(e))return A(e)}(t=a.qDimensions)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return A(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)?A(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();a.qDimensions=[],s.forEach(function(e){a.qDimensions.push(e),r.dimensions.added(e,n)})}},z=function(e){var t,n=e.newProperties,r=e.dataDefinition,i=e.hypercubePath;if(r.measures&&"function"==typeof r.measures.added){var a=o.getValue(n,i||"").qHyperCubeDef,s=function(e){if(Array.isArray(e))return I(e)}(t=a.qMeasures)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return I(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)?I(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();a.qMeasures=[],s.forEach(function(e){a.qMeasures.push(e),r.measures.added(e,n)})}},j=function(e){var t=e.measures,n=e.modifierTypes;t&&n&&f().isSupportedModifiers(n)&&t.forEach(function(e){e.store&&e.store.modifiers&&(e.qDef.modifiers=e.store.modifiers),delete e.store})};function $(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)}const U={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=[]),h({exportFormat:i,qHyperCubeDef:l}),m({exportFormat:i,qHyperCubeDef:l}),g({exportFormat:i,qHyperCubeDef:l}),delete l.qLayoutExclude,y({exportFormat:i,properties:a}),n&&(i.properties.qHyperCubeDef=l,delete s.qHyperCubeDef),b({exportFormat:i,properties:a}),r||v(i.properties.qHyperCubeDef.qMeasures),Array.isArray(i.properties.filters)&&(q(i.properties,"filters","storedFilters",!0),delete i.properties.filters),i.properties.qHyperCubeDef.qContextSetExpression&&(q(i.properties,"qHyperCubeDef.qContextSetExpression","storedFilters"),i.properties.qHyperCubeDef.qContextSetExpression=""),i.properties.qHyperCubeDef.qDynamicScript&&i.properties.qHyperCubeDef.qDynamicScript.length&&(q(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,p=e.supportedFilters,d=void 0===p||p,f=e.isHCModifierSupported,h=void 0===f||f,m={qChildren:[]},g=H({exportFormat:t,initialProperties:r,hypercubePath:u}),y=o.getValue(r,u||"").qHyperCubeDef,b=o.getValue(g,u||"").qHyperCubeDef,v=_({exportFormat:t,dataDefinition:a}),q=v.maxDimensions,x=v.minDimensions,D=v.maxMeasures,S=v.minMeasures,C=l.defaultDimension,M=void 0===C?k():C,E=l.defaultMeasure,A=void 0===E?N():E;b.qDimensions.length=0,b.qMeasures.length=0,F({exportFormat:t,maxDimensions:q,minDimensions:x,maxMeasures:D,minMeasures:S})&&B({exportFormat:t,maxDimensions:q,minDimensions:x,maxMeasures:D,minMeasures:S,newHyperCubeDef:b}),P({exportFormat:t,maxDimensions:q,minDimensions:x,newHyperCubeDef:b,defaultDimension:M}),L({exportFormat:t,maxMeasures:D,minMeasures:S,newHyperCubeDef:b,defaultMeasure:A}),V({newProperties:g,dataDefinition:a,hypercubePath:u}),z({newProperties:g,dataDefinition:a,hypercubePath:u}),R({exportFormat:t,newHyperCubeDef:b}),O("qMaxStackedCells",y,b),O("qNoOfLeftDims",y,b),T("qInitialDataFetch",y,b,[{qTop:0,qLeft:0,qWidth:0,qHeight:0}]),T("qMode",y,b,"S"),T("qReductionMode",y,b,"N"),T("qSortbyYValue",y,b),T("qIndentMode",y,b),T("qShowTotalsAbove",y,b),w(g,t,r),m.qProperty=g;var I=o.getValue(c||{},"support.modifiers");return j({measures:b.qMeasures,modifierTypes:I}),d&&$(m.qProperty,"storedFilters"),"S"===b.qMode&&h&&$(m.qProperty,"dynamicScript"),m}};var W={cellBackgroundColor:!0,cellForegroundColor:!0,colorByAlternative:!0,colorByExpression:!0,tooltip:!0,urlLabel:!0,url:!0};function K(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 Y(e,t){return e.length!==t}const G={create:function(e,t){if(!e||!W[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(K(a,t,r,i),Y(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"}},X={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}},J={colorModeOptions:{primary:function(){return!0},dimension:function(e){return X.getNumDimensions(e)>0&&X.getNumMeasures(e)<=1},multiColor:function(e){return X.getNumMeasures(e)>1},measure:function(e){return X.getNumDimensions(e)>0},expression:function(e){return X.getNumMeasures(e)>=1}}},Z={colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return X.getNumMeasures(e)>=1}}};var Q={scatterplot:Z,"sn-scatter-plot":Z,piechart:{colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return X.getNumMeasures(e)>=1}}},linechart:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return X.getNumDimensions(e)>1},multiColor:function(e){return X.getNumMeasures(e)>1},measure:function(e){return X.getNumDimensions(e)<=1},expression:function(e){return X.getNumMeasures(e)>=1}}},map:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return X.getNumDimensions(e)>=1},multiColor:function(e){return X.getNumMeasures(e)>1},measure:function(e){return X.getNumDimensions(e)>=1},expression:function(e){return X.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 X.getNumDimensions(e)>=1}}}};function ee(e,t,n){if(Array.isArray(e[t])){var r=p.findIndexByPropertyValue(e[t],"id",n);r>=0&&e[t].splice(r,1)}else e[t]=[]}function te(e,t){var n=G.IDMAP.COLOR_BY_ALTERNATIVE;e.forEach(function(e){ee(e,"qAttributeDimensions",n),ee(e,"qAttributeExpressions",n)}),t.forEach(function(e){ee(e,"qAttributeDimensions",n),ee(e,"qAttributeExpressions",n)})}function ne(e,t){if(t){var n="="===t.charAt(0);e.color.altLabel=n?{qStringExpression:{qExpr:t.substr(1)}}:t}}function re(e){var t=e.properties,n=e.isDimension,r=e.dimensions,i=e.excludedDimensions,a=e.measures,s=e.label;te(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"),d=o.getValue(t,"color.formatting.isCustomFormatted");if(u){var f=G.create(G.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:d});break;case"libraryItem":!function(e){var t=e.attributeExpression,n=e.measures,r=e.item,i=e.qNumFormat,o=e.isCustomFormatted;e.isDimension||(t.matchMeasure=p.findIndexByPropertyValue(n,"qLibraryId",r.key),i&&(t.qNumFormat=i,t.isCustomFormatted=o)),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:d})}n?(f.qSortBy={qSortByAscii:1},l.qAttributeDimensions.push(f)):l.qAttributeExpressions.push(f)}}}function ie(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().measureBase.getLibraryId(e)}(n,t),i?(s.type="measure",s.name=i,s.id=i,o=function(e,t){return f().hasActiveModifiers({measures:[e]})&&t?e.qDef.qDef:void 0}(n,r),o&&(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}const oe={useMasterNumberFormat:function(e){e.quarantine={qNumFormat:e.qNumFormat||{},isCustomFormatted:e.isCustomFormatted||!1},e.qNumFormat=null,e.isCustomFormatted=void 0}};function ae(e,t,n,r){var i=t.type,o=e.color,a=o.mode,s=X.getItemLabel(t);switch(ne(e,s||""),i){case"field":a="byDimension",o.byDimDef={label:t.label||X.wrapFieldName(t.name),key:X.wrapFieldName(t.name),type:"expression",activeDimensionIndex:t.activeDimensionIndex};break;case"expression":a="byMeasure",o.byMeasureDef={label:s,key: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&&oe.useMasterNumberFormat(o.formatting)}o.auto=!1,o.mode=a}function se(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&&ne(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=ie("dimension",!1,n[r.activeDimensionIndex]);i.activeDimensionIndex=r.activeDimensionIndex,ae(e,i)}(e,t);else if(function(e){return!e||!e.key}(a)&&function(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=G.IDMAP.COLOR_BY_ALTERNATIVE,a=p.findItemByPropertyValue(r.qAttributeDimensions,"id",i);return ae(e,ie("dimension",!!a,a||r)),!!a}(e,t))return;re({properties:e,isDimension:!0,dimensions:n,excludedDimensions:i,measures:r,label:o.getValue(e,"color.byDimDef.label")})}const le=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)},ue=function(e,t){var n={primary:!0};if(e){var r=(Q[t]||J).colorModeOptions||J.colorModeOptions;n.byDimension=r.dimension(e),n.byMeasure=r.measure(e),n.byMultiple=r.multiColor(e),n.byExpression=r.expression(e)}return n},ce=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))},pe=function(e,t){var n,r=o.getValue(e,"color.mode"),i=o.getValue(e,"color.auto"),a=o.getValue(e,"".concat(t,"qDimensions"),[]),s=o.getValue(e,"".concat(t,"qMeasures"),[]),l=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);i?te(a,l):!(n={auto:i,colorMode:r,dimensions:a}).auto&&"byDimension"===n.colorMode&&n.dimensions.length>0?se(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:i,colorMode:r,dimensions:a,measures:s,properties:e})?function(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&&ne(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=ie("measure",!1,n[r.activeMeasureIndex],!0);i.activeMeasureIndex=r.activeMeasureIndex,ae(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=G.IDMAP.COLOR_BY_ALTERNATIVE,s=p.findItemByPropertyValue(i.qAttributeExpressions,"id",a);return ae(e,ie("measure",!!s,s||r[0])),!!s}(e,t))return;re({properties:e,isDimension:!1,dimensions:n,excludedDimensions:i,measures:r,label:o.getValue(e,"color.byMeasureDef.label")})}(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"),te(r,a)}(e,t)},de=function(e){e.forEach(function(e){e.qOtherTotalSpec&&"qTotalMode"in e.qOtherTotalSpec&&delete e.qOtherTotalSpec.qTotalMode})},fe=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},he=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)},me=function(e){o.setValue(e,"color.mode","primary"),o.setValue(e,"color.auto",!0)},ge=function(e){var t=o.getValue(e,"qHyperCubeDef.qDimensions",[]),n=o.getValue(e,"color.persistent",!1);return t.length>1&&!n},ye={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=U.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),o=i.data[0],a=o.dimensions.concat(o.excludedDimensions),s=o.measures.concat(o.excludedMeasures),l=G.IDMAP,u=l.COLOR_BY_ALTERNATIVE,c=l.COLOR_BY_EXPRESSION;return G.moveByIdFromGroup(a,[],"qAttributeDimensions",u),G.moveByIdFromGroup(a,[],"qAttributeExpressions",u),G.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=U.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:a,extension:s,supportedFilters:l,isHCModifierSupported:u}),p=c.qProperty,d=o.getValue(p,"visualization"),f=o.getValue(p,"qHyperCubeDef.qDimensions",[]),h=o.getValue(p,"color.mode",""),m=o.getValue(p,"color.auto",""),g=ue(p,d),y=ce({canColorBy:g,autoColor:m,colorMode:h,dimensions:f});return g[h]?fe({shouldUpdateColorBy:y,properties:p})&&he(p):me(p),y&&pe(p,"qHyperCubeDef."),ge(p)&&le(p,"color.persistent",!0),de(f),c}};var be=["bar","marker","line"];const ve=function(e){var t=e.initialProperties,n=e.properties;t.measureAxis&&void 0===t.measureAxis.autoMinMax?$(n,"unsupportedAutoMinMax")||D()(n.measureAxis,t.measureAxis):$(n,"supportedAutoMinMax")||D()(n.measureAxis,t.measureAxis)},qe=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.initialProperties;return!(!e.exportFormat.properties.measureAxes||t.measureAxes||!t.measureAxis||void 0===t.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}}),be.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]&&D()(s,n.properties.measureAxes[t[0].axis])):D()(s,n.properties.measureAxes[0])}},xe=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}}},De={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=e.supportedAutoMinMax,o=void 0===i||i,a=ye.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),s=a.properties;return o?(q(s,"measureAxis.min","supportedAutoMinMax"),q(s,"measureAxis.max","supportedAutoMinMax")):(q(s,"measureAxis.min","unsupportedAutoMinMax"),q(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=ye.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:o,extension:s,supportedFilters:l,isHCModifierSupported:u}),p=c.qProperty;return ve({initialProperties:n,properties:p}),qe({exportFormat:t,initialProperties:n,properties:p,measureType:a}),xe(p.qHyperCubeDef),p.qHyperCubeDef.qColumnOrder=[],p.qHyperCubeDef.columnOrder=[],c}};function Se(e,t,n){return"qLayoutExclude.quarantine.".concat(e,".").concat(t,".").concat(n)}function Ce(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=Se(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 Me(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=Se(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 Ee="qHyperCubeDef.qMeasures",Ae="conditionalColoring",Ie="measures",we="qDef.conditionalColoring";const Oe={quarantine:function(e){Ce({properties:e,arrayPath:Ee,quarantineName:Ae,arrayName:Ie,itemPath:we})},unquarantine:function(e){Me({properties:e,arrayPath:Ee,itemPath:we,arrayName:Ie,quarantineName:Ae})}};var Te="qHyperCubeDef.qMeasures",ke="measures",Ne="qHyperCubeDef.qDimensions",Pe="dimensions",Le="qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",_e="alternativeMeasures",Re="qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions",He="alternativeDimensions",Fe="qCalcCondition",Be="conditionalShowHide";const Ve={quarantine:function(e){Ce({properties:e,arrayPath:Te,quarantineName:Be,arrayName:ke,itemPath:Fe}),Ce({properties:e,arrayPath:Ne,quarantineName:Be,arrayName:Pe,itemPath:Fe})},unquarantine:function(e){Me({properties:e,arrayPath:Te,quarantineName:Be,arrayName:ke,itemPath:Fe}),Me({properties:e,arrayPath:Ne,quarantineName:Be,arrayName:Pe,itemPath:Fe})},quarantineAlternative:function(e){Ce({properties:e,arrayPath:Le,quarantineName:Be,arrayName:_e,itemPath:Fe}),Ce({properties:e,arrayPath:Re,quarantineName:Be,arrayName:He,itemPath:Fe})},unquarantineAlternative:function(e){Me({properties:e,arrayPath:Le,quarantineName:Be,arrayName:_e,itemPath:Fe}),Me({properties:e,arrayPath:Re,quarantineName:Be,arrayName:He,itemPath:Fe})}},ze={hypercube:U,colorChart:ye,axisChart:De,quarantineProperty:q,unquarantineProperty:$,quarantineArrayProp:Ce,unquarantineArrayProp:Me,conditionalColoring:Oe,conditionalShow:Ve}})(),r.default})()),vt.exports),xt=yt(qt);function Dt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function St(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ct(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 Mt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ct(Object(n),!0).forEach(function(t){St(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ct(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Et(e){return function(e){if(Array.isArray(e))return Dt(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 Dt(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Dt(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 At(e){return At="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},At(e)}var It,wt="top",Ot="top-right",Tt="right",kt="bottom-right",Nt="bottom",Pt="bottom-left",Lt="left",_t="top-left";St(St(St(St(St(St(St(St(St(St(It={},"equal-equal",[wt,Nt]),"equal-higher",[Nt,kt]),"equal-lower",[wt,Ot]),"equal-void",[wt,Nt]),"higher-equal",[Lt,Pt,wt,Ot]),"higher-higher-acute",[Nt,Pt,Lt,Ot]),"higher-higher-obtuse",[Nt,wt]),"higher-lower-negative",[wt,Ot,Tt]),"higher-lower-positive",[Nt,Pt,Lt]),"higher-void",[wt]),St(St(St(St(St(St(St(St(St(St(It,"lower-equal",[wt]),"lower-higher-negative",[wt,_t]),"lower-higher-positive",[kt]),"lower-lower-acute",[wt,_t,Lt,Ot,Tt]),"lower-lower-obtuse",[wt,Nt]),"lower-void",[wt]),"void-equal",[wt]),"void-higher",[wt,Nt]),"void-lower",[wt,Nt,Lt]),"void-void",[wt]),St(It,"unclassified",[wt,Nt,Tt,Lt,Ot,kt,Pt,_t]);var Rt=["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"],Ht=["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 Ft=function(e){return{value:e,label:e.charAt(0).toUpperCase()+e.slice(1),groupHeader:!1,disabled:!1,styles:{fontFamily:e}}};function Bt(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,Et(new Set([r].concat(Et(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(Et(o.map(function(e){return Ft(e)})),[{value:"DefaultHeader",label:n.get("properties.allFonts"),metaText:n.get("properties.default"),groupHeader:!0}],Et(function(e){return null!=e&&e.isEnabled("PS_20852_WYSIWYG_FONT_SUPPORT")?Ht:Rt}(i).map(function(e){return Ft(e)})))}function Vt(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 Bt({theme:t,translator:n,defaultValue:a(),flags:o})}}}var zt,jt,$t=["10px","11px","12px","13px","14px","15px","16px","17px","18px","19px","20px","21px","22px","23px","24px"],Ut=function(e){return{value:e,label:e,groupHeader:!1,disabled:!1}};function Wt(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,Et(new Set([n].concat(Et(i))))):r.push(n),[{value:"ThemeHeader",label:t.get("properties.themeFontSizes"),metaText:t.get("properties.theme"),groupHeader:!0}].concat(Et(r.map(function(e){return Ut(e)})),[{value:"DefaultHeader",label:t.get("properties.allFontSizes"),metaText:t.get("properties.default"),groupHeader:!0}],Et($t.map(function(e){return Ut(e)})))}({theme:t,translator:n,defaultValue:o()})}}}function Kt(e){var t=e.theme,n=e.translator,r=e.id,i=e.path;return{fontFamily:Vt({theme:t,translator:n,id:r,path:i,flags:e.flags}),fontSize:Wt({theme:t,translator:n,id:r,path:i})}}function Yt(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]=Kt({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}var Gt,Xt=function(){if(jt)return zt;jt=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===t.call(e)},o=function(n){if(!n||"[object Object]"!==t.call(n))return!1;var r,i=e.call(n,"constructor"),o=n.constructor&&n.constructor.prototype&&e.call(n.constructor.prototype,"isPrototypeOf");if(n.constructor&&!i&&!o)return!1;for(r in n);return void 0===r||e.call(n,r)},a=function(e,t){n&&"__proto__"===t.name?n(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},s=function(t,n){if("__proto__"===n){if(!e.call(t,n))return;if(r)return r(t,n).value}return t[n]};return zt=function e(){var t,n,r,l,u,c,p=arguments[0],d=1,f=arguments.length,h=!1;for("boolean"==typeof p&&(h=p,p=arguments[1]||{},d=2),(null==p||"object"!=typeof p&&"function"!=typeof p)&&(p={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)r=s(p,n),p!==(l=s(t,n))&&(h&&l&&(o(l)||(u=i(l)))?(u?(u=!1,c=r&&i(r)?r:[]):c=r&&o(r)?r:{},a(p,{name:n,newValue:e(h,c,l)})):void 0!==l&&a(p,{name:n,newValue:l}));return p},zt}(),Jt=(Gt=Xt)&&Gt.__esModule&&Object.prototype.hasOwnProperty.call(Gt,"default")?Gt.default:Gt;function Zt(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 Qt(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 en(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 tn(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 nn(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 rn(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function on(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function an(){}var sn=1/.7,ln="\\s*([+-]?\\d+)\\s*",un="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",cn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",pn=/^#([0-9a-f]{3,8})$/,dn=new RegExp(`^rgb\\(${ln},${ln},${ln}\\)$`),fn=new RegExp(`^rgb\\(${cn},${cn},${cn}\\)$`),hn=new RegExp(`^rgba\\(${ln},${ln},${ln},${un}\\)$`),mn=new RegExp(`^rgba\\(${cn},${cn},${cn},${un}\\)$`),gn=new RegExp(`^hsl\\(${un},${cn},${cn}\\)$`),yn=new RegExp(`^hsla\\(${un},${cn},${cn},${un}\\)$`),bn={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 vn(){return this.rgb().formatHex()}function qn(){return this.rgb().formatRgb()}function xn(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=pn.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?Dn(t):3===n?new En(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?Sn(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?Sn(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=dn.exec(e))?new En(t[1],t[2],t[3],1):(t=fn.exec(e))?new En(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=hn.exec(e))?Sn(t[1],t[2],t[3],t[4]):(t=mn.exec(e))?Sn(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=gn.exec(e))?kn(t[1],t[2]/100,t[3]/100,1):(t=yn.exec(e))?kn(t[1],t[2]/100,t[3]/100,t[4]):bn.hasOwnProperty(e)?Dn(bn[e]):"transparent"===e?new En(NaN,NaN,NaN,0):null}function Dn(e){return new En(e>>16&255,e>>8&255,255&e,1)}function Sn(e,t,n,r){return r<=0&&(e=t=n=NaN),new En(e,t,n,r)}function Cn(e){return e instanceof an||(e=xn(e)),e?new En((e=e.rgb()).r,e.g,e.b,e.opacity):new En}function Mn(e,t,n,r){return 1===arguments.length?Cn(e):new En(e,t,n,null==r?1:r)}function En(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function An(){return`#${Tn(this.r)}${Tn(this.g)}${Tn(this.b)}`}function In(){const e=wn(this.opacity);return`${1===e?"rgb(":"rgba("}${On(this.r)}, ${On(this.g)}, ${On(this.b)}${1===e?")":`, ${e})`}`}function wn(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function On(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Tn(e){return((e=On(e))<16?"0":"")+e.toString(16)}function kn(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Pn(e,t,n,r)}function Nn(e){if(e instanceof Pn)return new Pn(e.h,e.s,e.l,e.opacity);if(e instanceof an||(e=xn(e)),!e)return new Pn;if(e instanceof Pn)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 Pn(a,s,l,e.opacity)}function Pn(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function Ln(e){return(e=(e||0)%360)<0?e+360:e}function _n(e){return Math.max(0,Math.min(1,e||0))}function Rn(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}rn(an,xn,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:vn,formatHex:vn,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Nn(this).formatHsl()},formatRgb:qn,toString:qn}),rn(En,Mn,on(an,{brighter(e){return e=null==e?sn:Math.pow(sn,e),new En(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new En(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new En(On(this.r),On(this.g),On(this.b),wn(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:An,formatHex:An,formatHex8:function(){return`#${Tn(this.r)}${Tn(this.g)}${Tn(this.b)}${Tn(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:In,toString:In})),rn(Pn,function(e,t,n,r){return 1===arguments.length?Nn(e):new Pn(e,t,n,null==r?1:r)},on(an,{brighter(e){return e=null==e?sn:Math.pow(sn,e),new Pn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new Pn(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 En(Rn(e>=240?e-240:e+120,i,r),Rn(e,i,r),Rn(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Pn(Ln(this.h),_n(this.s),_n(this.l),wn(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=wn(this.opacity);return`${1===e?"hsl(":"hsla("}${Ln(this.h)}, ${100*_n(this.s)}%, ${100*_n(this.l)}%${1===e?")":`, ${e})`}`}}));const Hn=Math.PI/180,Fn=180/Math.PI,Bn=4/29,Vn=6/29,zn=3*Vn*Vn;function jn(e){if(e instanceof $n)return new $n(e.l,e.a,e.b,e.opacity);if(e instanceof Gn)return Xn(e);e instanceof En||(e=Cn(e));var t,n,r=Yn(e.r),i=Yn(e.g),o=Yn(e.b),a=Un((.2225045*r+.7168786*i+.0606169*o)/1);return r===i&&i===o?t=n=a:(t=Un((.4360747*r+.3850649*i+.1430804*o)/.96422),n=Un((.0139322*r+.0971045*i+.7141733*o)/.82521)),new $n(116*a-16,500*(t-a),200*(a-n),e.opacity)}function $n(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function Un(e){return e>.008856451679035631?Math.pow(e,1/3):e/zn+Bn}function Wn(e){return e>Vn?e*e*e:zn*(e-Bn)}function Kn(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Yn(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Gn(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function Xn(e){if(isNaN(e.h))return new $n(e.l,0,0,e.opacity);var t=e.h*Hn;return new $n(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}rn($n,function(e,t,n,r){return 1===arguments.length?jn(e):new $n(e,t,n,null==r?1:r)},on(an,{brighter(e){return new $n(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new $n(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 En(Kn(3.1338561*(t=.96422*Wn(t))-1.6168667*(e=1*Wn(e))-.4906146*(n=.82521*Wn(n))),Kn(-.9787684*t+1.9161415*e+.033454*n),Kn(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),rn(Gn,function(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof Gn)return new Gn(e.h,e.c,e.l,e.opacity);if(e instanceof $n||(e=jn(e)),0===e.a&&0===e.b)return new Gn(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*Fn;return new Gn(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new Gn(e,t,n,null==r?1:r)},on(an,{brighter(e){return new Gn(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new Gn(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return Xn(this).rgb()}}));var Jn=e=>()=>e;function Zn(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):Jn(isNaN(e)?t:e)}var Qn=function e(t){var n=function(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):Jn(isNaN(t)?n:t)}}(t);function r(e,t){var r=n((e=Mn(e)).r,(t=Mn(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),er=/^class(-pyramid)?/,tr=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,p=t.colors.map(function(t){return e.resolveUIColor(t)});if(i=Math.min.apply(Math,[i].concat(Et(c))),o=Math.max.apply(Math,[o].concat(Et(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:p,limits:"percent"===t.limitType?c:l}));else if(t.breakTypes){var d=t.breakTypes;u.type="continuous",u.domain=[i],u.range=[p[0]];for(var f=0;f<c.length;f+=1)if(d[f]){var h=p[f],m=p[f+1],g=Qn(h,m)(.5);u.range.push(g),u.domain.push(c[f]),f<c.length-1&&d[f+1]&&(u.range.push(p[f+1]),u.domain.push((c[f]+c[f+1])/2))}else u.range.push(p[f]),u.range.push(p[f+1]),u.domain.push(c[f]),u.domain.push(c[f]+Math.min(1e-6,(o-i)/1e6));u.range.push(p[p.length-1]),u.domain.push(o)}else u.domain=c,u.range=p;return u};function nr(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):nr(e,t,n,r+1,i)}var rr=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=[],p=!0;if(l){if(Number.isNaN(+l.min())||Number.isNaN(+l.max()))return{invalid:!0};(p=!("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,Et(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&&!p)u.min=l.min(),u.max=l.max();else if(l){if(!c.length)return{invalid:!0};u.min=Math.min.apply(Math,Et(c)),u.max=Math.max.apply(Math,Et(c))}if(n.input.measureScheme&&(u.palettes={quant:n.input.measureScheme}),a){var d=a.getDataColorScales().filter(function(e){return e.key===n.input.measureScheme})[0];u.type=d&&er.test(d.type)?"categorical":"continuous","categorical"===u.type&&(o=d.colors.some(function(e){return Array.isArray(e)})?Math.max.apply(Math,Et(d.colors.map(function(e){return e?e.length:0}))):d.colors.length)}if("categorical"===u.type){for(var f=p?nr(u.max,u.min,c,1,o):o,h=(u.max-u.min)/f,m=[],g=0;g<f+1;g+=1)m.push(u.min+h*g);u.domain=m,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 ir(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 or(e){e.measureOverrides.every(function(e){return!e})&&(e.measureOverrides=null)}function ar(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 sr(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?ir:o,s=n.input.byMeasureDef||{activeMeasureIndex:0},l=a(n,s),u=rr(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 p=c.raw().coloring;p&&p.gradient&&Jt(u,tr(e,p.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?tn:i,a=r.getCByField,s=void 0===a?nn:a,l=r.getPersistence,u=void 0===l?en:l,c=o(t,n),p=s(n,c),d=p?p.raw():{},f=n&&n.pic?n.pic.raw():{};if(d.qError||d.qSize&&0===d.qSize.qcy&&!f.qHasOtherValues)return{invalid:!0};var h={mode:"field",fieldType:"dimension",type:"categorical",field:p?p.key():void 0,isFieldLocked:d.qLocked};return("expression"===c.type||c.activeDimensionIndex<0)&&(h.label=c.label,"color.altLabel"===d.labelExpRef&&(h.label=n.input.altLabel)),!h.label&&p&&(h.label=p.title()),n.input.dimensionScheme&&(h.palettes={categorical:n.input.dimensionScheme}),n.input.useDimColVal&&"libraryItem"===c.type&&(h.auxiliary=c),Jt(h,u(t,n,c,p,{byRow:Qt,byElemNo:Zt})),h}(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=rr(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,p=o?o.getDataColorPalettes()[0]:void 0;return"measure"===n.input.useBaseColors&&p&&(c={categorical:p.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 d=[],f=[];return i.qDimensionInfo.forEach(function(t,n){if(t.baseColor||t.coloring&&t.coloring.baseColor){d.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:d.length?d[0]:void 0,explicit:d.length?{domain:d,range:f}:void 0}}var h=r.primary;if(void 0!==n.input.paletteColor)n.input.paletteColor&&(h=e.resolveUIColor(n.input.paletteColor));else{var m=n.input.singleColor;"number"!=typeof m||Number.isNaN(m)||(h=["#b0afae","#7b7a78","#545352","#4477aa","#7db8da","#b6d7ea","#46c646","#f93f17","#ffcf02","#276e27","#ffffff","#000000"][m])}return{mode:"constant",type:"constant",primary:h}}(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)),Mt(Mt({},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 Mt(Mt({},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(or(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=ar(e.measureOverrides,e.explicit),or(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=ar(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 lr=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},ur=function(e){throw e.isHandled=!0,e};function cr(e){return function(t){return"object"===At(t.datum[e])?t.datum[e].value:void 0}}function pr(e){return"object"===At(e.datum.isNull)?e.datum.isNull.value:-2===e.datum.value}function dr(e){return-3===e.datum.value}var fr={COLOR:void 0,FONT_SIZE:"16px",FONT_FAMILY:"'Source Sans Pro', 'Arial', 'sans-serif'"},hr={COLOR:void 0,FONT_SIZE:void 0,FONT_FAMILY:"'Source Sans Pro', 'Arial', 'sans-serif'"};function mr(e){var t=e.theme,n=e.key,r=e.styleOverrides,i={title:{color:fr.COLOR,fontSize:fr.FONT_SIZE,fontFamily:fr.FONT_FAMILY},label:{color:hr.COLOR,fontSize:hr.FONT_SIZE,fontFamily:hr.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",fr.COLOR),i.title.fontSize=l(null==a?void 0:a.fontSize,"legend.title","fontSize",fr.FONT_SIZE),i.title.fontFamily=l(null==a?void 0:a.fontFamily,"legend.title","fontFamily",fr.FONT_FAMILY),i.label.color=l(null==s?void 0:s.color,"legend.label","color",hr.COLOR),i.label.fontSize=l(null==s?void 0:s.fontSize,"legend.label","fontSize",hr.FONT_SIZE),i.label.fontFamily=l(null==s?void 0:s.fontFamily,"legend.label","fontFamily",hr.FONT_FAMILY),i}var gr=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"},yr=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 br(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=mr({theme:l,key:n,styleOverrides:r});return{layout:{minimumLayoutMode:"MEDIUM",dock:gr(a,i,o)},show:"function"==typeof a.show?function(){return yr(a,u,s)}:yr(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 vr(e,t,n){var r=[],i=[],o=function(e,t,n){return"categorical"===t.coloring.type?function(e,t,n){var r=br(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,p=e.style,d=t.scaleKey,f=t.theme,h=t.scales,m=mr({theme:f,key:a,styleOverrides:s}),g=r.layout.dock,y="left"===g||"right"===g?{maxLines:2,wordBreak:"break-word"}:{},b={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 v="".concat(d,"Legend");return Jt(!0,r,{type:"legend-cat",key:"".concat(o,"-cat"),scale:v in h?v:d,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:Mt({fill:m.label.color,fontSize:m.label.fontSize,fontFamily:m.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:b[n]})])])}}}},brush:{consume:[{context:"selection",data:["",o],style:{inactive:{opacity:.3}}}]}},{settings:c,style:p})}(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,p="".concat(u,"Range"),d=br(e,t);if(!d.show)return!1;var f=mr({theme:c,key:i,styleOverrides:o}),h=d.layout.dock,m="right"===h||"left"===h,g=null===(n=t.scales)||void 0===n?void 0:n[p];return m&&g&&(g.invert=!0),Jt(!0,d,{type:"legend-seq",key:"".concat(r,"-seq"),settings:{fill:u,major:p,length:1,tick:{fill:f.label.color,fontSize:f.label.fontSize,fontFamily:f.label.fontFamily},title:{anchor:!a||"top"!==d.layout.dock&&"bottom"!==d.layout.dock?void 0:"right",padding:parseFloat(d.settings.title.fontSize)||16}}},{settings:s,style:l})}(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=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.eventName,n=e.key,r=e.requireFailure,i=e.recognizeWith,o=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).actions;return{key:"event:pan-".concat(n),type:"Pan",requireFailure:r,recognizeWith:i,options:{event:t,pointers:1,threshold:10,enable:function(e,r){var i;return this.started===t||!r||!(null!=o&&null!==(i=o.interact)&&void 0!==i&&i.enabled&&!o.interact.enabled())&&this.chart.componentsFromPoint({x:r.center.x,y:r.center.y}).some(function(e){return e.key==="".concat(n,"-cat")})}},events:St(St(St({},"".concat(t,"start"),function(e){e.preventDefault(),this.started!==t&&(this.started=t,this.chart.component("".concat(n,"-cat")).emit("panstart",e))}),"".concat(t,"move"),function(e){e.preventDefault(),this.chart.component("".concat(n,"-cat")).emit("panmove",e)}),"".concat(t,"end"),function(e){e.preventDefault(),this.chart.component("".concat(n,"-cat")).emit("panend",e),this.started=!1})}}(e,n))),{interactions:i,components:r}}function qr(e){var t=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.auto,n=function(e){var t=Mt({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(Jt(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=Jt(!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=Jt(!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 tr(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=Mt({},e);Jt(a,Zt(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,Jt(a,Zt(o)))):!1===t.autoFill&&t.single?a.range=[n.resolveUIColor(t.single)]:t.autoFill&&(s&&(a.palettes={categorical:s.key}),Jt(a,Zt(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=Mt(Mt({},e),r.getDataColorSpecials())),n.settings=Jt(e,sr(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){return 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()}(e,{layout:t.layout,app:t.app})}).getMeasure(function(e,t){return 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()}(e,{layout:t.layout,app:t.app})}).getAttributeDimension(function(e,t){return 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(ur):Promise.reject()}(e,{layout:t.layout,model:t.model,app:t.app})});return n.getSnapshotData=lr,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=Mt({},i),r={},!n.key)throw new Error("Missing key");t.set(Mt(Mt({},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=Mt(Mt({},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]||r.getDataColorScales()[0];if(l){var u=l.colors[0]?l.colors:[[]].concat(Et(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(Et((n.explicit||{}).domain||[]),[-3,-2]),range:n.explicit&&"function"==typeof n.explicit.range?n.explicit.range:[].concat(Et((n.explicit||{}).range||[]),[n.others,n.nil])};if("field"===n.mode){if("dimension"===n.fieldType){var c,p=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 d=0,f={};a.data("q")({data:t}).extract({field:n.field,trackBy:n.valueAccessor,reduce:function(e){var t=e[0];return f[t]=d++,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 h={data:p,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]=h,c&&(s["".concat(l,"Legend")]=Mt(Mt({},h),{},{data:c})),t&&t.qHasOtherValues&&c&&((c||h.data).amend=[{label:t.qDimensionInfo[0].othersLabel,source:{key:"qHyperCube",field:"qDimensionInfo/0"},row:{value:-3},value:-3}])}else if("measure"===n.fieldType){var m={data:{field:n.field},min:n.min,max:n.max};s[l]=Jt({},m,{type:"categorical"===n.type?"threshold-color":"sequential-color",range:n.range,domain:n.domain,invert:n.reverse}),"sequential-color"===s[l].type&&(s["".concat(l,"Range")]=Jt({},m,{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=cr(r),o=cr("".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,p=e.type;return a?function(e){return dr(e)||o(e)?u:l}:n[t]?function(e){return dr(e)?u:pr(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 dr(e)||o(e)?u:pr(e)?l:c}:"color"===p?function(e){return dr(e)||o(e)?u:pr(e)?l:i(e)||u}:null},s=a(t,r);if(t.measureOverrides){var l=cr("".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?function(e){return"rgba(".concat([(16711680&e)>>16,(65280&e)>>8,255&e,((4278190080&e)>>>24)/255].join(","),")")}(e.qNum):e.qText&&xn(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 p=St({},u,n);return r.qDimensionInfo.length>1&&(p["".concat(u,"IsAnOther")]={fields:r.qDimensionInfo.map(function(e,t){return{field:"qDimensionInfo/".concat(t)}}),value:function(e){return-1!==e.indexOf(-3)}}),s&&(p["".concat(u,"MeasureIdx")]=l),p}({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,p=e.settings,d=void 0===p?{}:p,f=e.style,h=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return vr({eventName:t,key:r,rtl:s,viewState:o,chart:a,styleReference:u,styleOverrides:c,settings:d,style:void 0===f?{}:f},{legendProps:n.legendProps,scaleKey:n.key,coloring:i(),theme:n.theme,hc:n.hc,scales:this.scales()},h)}};return o}var xr=function(e){return e.baseColor||e.coloring&&e.coloring.baseColor};function Dr(e){var t=e.qHyperCube,n=t.qDimensionInfo,r=t.qMeasureInfo,i=n.some(xr),o=r.some(xr),a=e.color.useBaseColors;return"measure"===a&&!o||"dimension"===a&&!i?"off":a}var Sr=function(e){return e.baseColor||e.coloring&&e.coloring.baseColor};function Cr(e){var t,n=e.qHyperCube.qDimensionInfo.some(Sr),r=e.qHyperCube.qMeasureInfo.some(Sr),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 Mr=function(){};function Er(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,p=e.createConfig,d=void 0===p?Mr:p,f=e.config,h=void 0===f?{}:f,m=e.custom,g=void 0===m?{}:m,y=h.localeInfo,b=h.key,v=h.theme,q=void 0===v?void 0:v,x=h.auto,D=void 0===x?void 0:x,S=h.definitionPath,C=null==c||null===(t=c.getLayout)||void 0===t?void 0:t.call(c),M={theme:q,key:b,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:Mt(Mt({},null==c||null===(i=c.getLayoutValue)||void 0===i?void 0:i.call(c,"color")),{},{useBaseColors:C?Dr(C):void 0})},E=qr({picasso:o,model:a,app:s,translator:l,auto:D});!1!==D&&E.auto(function(e){return D?D({layout:e,defaultAuto:Cr}):Cr(e)});var A=!1,I={getColor:function(){return E.color()},getPaletteColor:function(e){var t=e.index,n=e.color;return E.resolveUIColor({index:t,color:n})},getData:function(){return E.data()},getDatumProps:function(e){return E.datumProps(e)},getSnapshotData:function(){return E.getSnapshotData(S)},getSettingsForMeasure:function(e){return E.settingsForMeasure(e)},getSettings:function(){return E.settings()},getLegend:function(e,t){return E.legend(e,t)},getScales:function(){return E.scales()},getPalettes:function(){return E.palettes()},isSelectionLocked:function(e){var t=e.isMeasureSelectionLocked;return E.isSelectionLocked({isMeasureSelectionLocked:t})},isInitialized:function(){return A},custom:Mt({},g),initialize:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).createConfig,t=(void 0===e?d:e)({getUseBaseColors:Dr}),n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Mt(Mt(Mt({},e),t),{},{colorProps:Mt(Mt({},e.colorProps),t.colorProps||{})})}(M,t);return E.config(n),E.getAuxiliarySettings(S).then(function(){A=!0})}};return I}var Ar="center",Ir="bottom";function wr(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}[{key:"NoDataExist",alignment:Ar,condition:function(e){var t=e.layoutService;if(!t)return!1;var n=t.meta.size;return n.x*n.y==0}},{key:"OnlyNanDataMeasure",translationKey:"OnlyNanData",alignment:Ar,condition:function(e){var t=e.layoutService;return!!t&&t.getHyperCubeValue("qMeasureInfo").every(function(e){return"NaN"===e.qMin&&"NaN"===e.qMax})}},{key:"OnlyNanDataDimensionContinuous",translationKey:"OnlyNanData",alignment:Ar,condition:function(e){var t=e.layoutService;if(!t)return!1;if(!t.meta.isContinuous)return!1;var n=t.getHyperCubeValue("qDimensionInfo.0");return n&&(n.qMax<n.qMin||"NaN"===n.qMax)}},{key:"OnlyNegativeOrZeroValues",alignment:Ar},{key:"DataRangeIncludingZero",alignment:Ir},{key:"LimitedData",alignment:Ir},{key:"NegativeOrZeroValues",alignment:Ir}].reduce(function(e,t){return e[t.key]=t,e},{});var Or,Tr=["__proto__","constructor"];function kr(e,t,n){if(void 0!==e&&void 0!==t){var r=t.split("."),i=r[r.length-1];if(!Tr.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 Nr(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 Pr(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=_r)):void 0===t&&(t=Lr);for(var n,r,i,o,a,s=new Fr(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 Fr(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(Hr)}function Lr(e){return e.children}function _r(e){return Array.isArray(e)?e[1]:null}function Rr(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function Hr(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function Fr(e){this.data=e,this.depth=this.height=0,this.parent=null}Fr.prototype=Pr.prototype={constructor:Fr,count:function(){return this.eachAfter(Nr)},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 Pr(this).eachBefore(Rr)},[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)}},Or=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,p,d=e.length,f=e.search(/[0-9\-\+#]/),h=f>0?e.substring(0,f):"",m=e.split("").reverse().join(""),g=m.search(/[0-9\-\+#]/),y=d-g,b=e.substring(y,y+1),v=y+("."===b||","===b?1:0),q=g>0?e.substring(v,d):"";if(n=(t="-"===(e=e.substring(f,v)).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(m="",y=(p=t[0]).length%l,d=p.length,v=0;v<d;v++)m+=p.charAt(v),!((v-y+1)%l)&&v<d-l&&(m+=o);t[0]=m}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),h+(n?"-":"")+r+q}},Or({exports:{}});const Br=["altLabel","auto","autoMinMax","byDimDef","byMeasureDef","dimensionScheme","expressionIsColor","expressionLabel","measureMax","measureMin","measureScheme","mode","paletteColor","persistent","reverseScheme","useBaseColors","useDimColVal"];function Vr(e,t,n){for(let r=0;r<n.length;++r){const i=n[r];void 0!==e[i]&&(t[i]=e[i],delete e[i])}}var zr={importColors:function(e){e.color.point=e.color.point||{},Vr(e.color,e.color.point,Br),e.color.colorExpression&&(e.color.point.expression={qValueExpression:{qExpr:e.color.colorExpression}},delete e.color.colorExpression),e.color.point.expressionIsColor=!0},exportColors:function(e){Vr(e.color.point,e.color,Br),e.color.colorExpression=wr(e,"color.point.expression.qValueExpression.qExpr",""),delete e.color.point.expression}};function jr({dataDefinition:e,defaultPropertyValues:t,exportFormat:n,initialProperties:r}){const i=xt.axisChart.importProperties({exportFormat:n,initialProperties:r,dataDefinition:e,defaultPropertyValues:t}),o=i.qProperty;return 3===o.qHyperCubeDef.qInterColumnSortOrder.length&&(o.qHyperCubeDef.qInterColumnSortOrder=[1,2,0]),zr.importColors(o),o.qHyperCubeDef.qAlwaysFullyExpanded=!0,i}function $r({propertyTree:e,viewDataMode:t}){const n=xt.axisChart.exportProperties({propertyTree:e,viewDataMode:t});return zr.exportColors(e.qProperty),n}var Ur=e=>{const t=mt(e);return{properties:dt,data:{targets:[t]},importProperties:({exportFormat:e,initialProperties:n})=>jr({dataDefinition:t,exportFormat:e,initialProperties:n}),exportProperties:$r}};const Wr={wrapExpression:function(e){const t=e.replace(/\]/g,"]]");return t?`[${t}]`:""}};const Kr={replaceExpressionTokens:function(e,t,n){const r={start:n&&n.start||"{{",end:n&&n.end||"}}"};let i,o,a=e;for(const e in t)i=t[e],o=r.start+e+r.end,a=a.replace(Yr(o,!0),i);return a},createRegExp:Yr};function Yr(e,t,n){const r=e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&");const i=n?`(${r})`:r;return t?new RegExp(i,"g"):new RegExp(i)}const Gr={generateExpression:function(e,t){const n={};if(t)for(const e in t){const r=t[e],i=r.wrap?Wr.wrapExpression(r.value):r.value;n[e]=i;(r.variations||[]).forEach(t=>{const r=Xr(t,i,e);n[t]=r})}return Kr.replaceExpressionTokens(e,n)}};function Xr(e,t,n){if(""===t)return"";const r=Kr.createRegExp(n,!0,!0),i=e.split(r);let o="";return i.forEach(e=>{o+=e!==n?e:t}),o}const Jr={generateHyperCubeDef:function(e,t,n,r,i){return function(e,t,n,r){const i={};let o,a;const s=[];let l;e.forEach(e=>{o=ni(e.match(ti("Dim"))),o.forEach(e=>{s.push(Zr(t.qDimensions[e],r,e,n).then(t=>{i[`Dim[${e}]`]={value:t,wrap:!0}}))}),a=ni(e.match(ti("Mea"))),a.forEach(e=>{s.push(Qr(t.qMeasures[e],r).then(t=>{i[`Mea[${e}]`]={value:t}}))})}),l=s.length?Promise.all(s).then(()=>Promise.resolve(i)):Promise.resolve(i);return l}(e.dimensions.concat(e.measures),t,n,r).then(n=>{const r=E({},n,i),o=E(!0,{},t);return o.qDimensions=[],o.qMeasures=[],e.dimensions.forEach(e=>{o.qDimensions.push({qDef:{qFieldDefs:[`=${Gr.generateExpression(e,r)}`]}})}),e.measures.forEach(e=>{o.qMeasures.push({qDef:{qDef:Gr.generateExpression(e,r)}})}),o})},getAllHyperCubeExpressions:async function(e,t,n){const r=e.qDimensions.map((e,r)=>Zr(e,n,r,t)),i=e.qMeasures.map(e=>Qr(e,n));return{dimensions:await Promise.all(r),measures:await Promise.all(i)}}};function Zr(e,t,n,r){if(e.qLibraryId)return ei(e.qLibraryId,"dimension",t,n,r);const i=r.qDimensionInfo[n].qGroupPos;return Promise.resolve(e.qDef.qFieldDefs[i])}function Qr(e,t){return e.qLibraryId?ei(e.qLibraryId,"measure",t):Promise.resolve(e.qDef.qDef)}function ei(e,t,n,r,i){if(!n)return console.warn("No app provided, returning library id"),e;return n["dimension"===t?"getDimension":"getMeasure"](e).then(e=>e.getProperties().then(e=>"dimension"===t?e.qDim.qFieldDefs[i.qDimensionInfo[r].qGroupPos]:e.qMeasure.qDef))}function ti(e){return new RegExp(`\\{\\{${e}\\[\\d\\]\\}\\}`,"g")}function ni(e){return e?e.map(e=>e.substr(6,1)):[]}function ri(e){return e=e||function(){return!1},{get(t){const n=e()?-1:1;switch(t("integer")*n){case-1:return"descending";case 1:return"ascending";default:return"disabled"}},set(t,n){const r=e();switch(t){case"descending":n("integer",r?1:-1);break;case"ascending":n("integer",r?-1:1);break;case"disabled":n("integer",0);break;default:n("integer",void 0)}}}}var ii={booleanConvertFunctions:function(e,t){return e=e||function(){return!1},t=t||1,{get:e=>!!e("integer"),set(n,r){if(n){let n=e()?-1:1;n*=t,r("integer",n)}else r("integer",0)}}},enumConvertFunctions:ri,invertedEnumConvertFunctions:function(e){return ri(function(){return!e||!e()})}};const oi=[{value:"ascending",translation:"properties.sorting.ascending"},{value:"descending",translation:"properties.sorting.descending"}];function ai(e,t,n){return{type:"items",items:{toggled:{type:"boolean",ref:e,translation:t,convertFunctions:n.toggled},order:{type:"string",component:"dropdown",ref:e,options:oi,convertFunctions:n.sorting,show:t=>0!==Ue(t,e,0)}}}}var si={state:function(e,t){return ai(e=e||"qSortByState","properties.sorting.sortByState",{toggled:ii.booleanConvertFunctions(t),sorting:ii.invertedEnumConvertFunctions(t)})},ascii:function(e,t){return ai(e=e||"qSortByAscii","properties.sorting.sortByAlphabetic",{toggled:ii.booleanConvertFunctions(t),sorting:ii.enumConvertFunctions(t)})},numeric:function(e,t){return ai(e=e||"qSortByNumeric","properties.sorting.sortByNumeric",{toggled:ii.booleanConvertFunctions(t,-1),sorting:ii.enumConvertFunctions(t)})},expression:function(e,t){e=e||"qSortByExpression";const n={toggled:ii.booleanConvertFunctions(t),sorting:ii.enumConvertFunctions(t)},r=ai(e,"properties.sorting.sortByExpression",n);return r.items.expression={type:"number",component:"expression",expressionType:"ValueExpr",ref:"qExpression",translation:"Common.Expression",defaultValue:"",show:t=>0!==Ue(t,e,0)},r},frequency:function(e,t){return ai(e=e||"qSortByFrequency","properties.sorting.sortByFrequency",{toggled:ii.booleanConvertFunctions(t),sorting:ii.invertedEnumConvertFunctions(t)})}};const li=(e,t)=>(t.components||[]).find(t=>t.key===e),ui=(e,t,n)=>{var r,i,o,a;const s=null===(r=li("axis",n))||void 0===r?void 0:r.axis;return{text:{fontFamily:(null==s||null===(i=s.title)||void 0===i?void 0:i.fontFamily)||t.getStyle(e,"axis.title","fontFamily"),fontSize:(null==s||null===(o=s.title)||void 0===o?void 0:o.fontSize)||t.getStyle(e,"axis.title","fontSize"),fill:(null==s||null===(a=s.title)||void 0===a||null===(a=a.fontColor)||void 0===a?void 0:a.color)||t.getStyle(e,"axis.title","color")}}},ci=(e,t,n)=>{var r,i,o,a;const s=null===(r=li("axis",n))||void 0===r?void 0:r.axis;return{labels:{fontFamily:(null==s||null===(i=s.label)||void 0===i||null===(i=i.name)||void 0===i?void 0:i.fontFamily)||t.getStyle(e,"axis.label.name","fontFamily"),fontSize:(null==s||null===(o=s.label)||void 0===o||null===(o=o.name)||void 0===o?void 0:o.fontSize)||t.getStyle(e,"axis.label.name","fontSize"),fill:(null==s||null===(a=s.label)||void 0===a||null===(a=a.name)||void 0===a||null===(a=a.fontColor)||void 0===a?void 0:a.color)||t.getStyle(e,"axis.label.name","color")}}},pi=(e,t,n,r)=>{var i,o,a,s;const l=r.isEnabled("CLIENT_IM_3051")?null===(i=li("legend",n))||void 0===i?void 0:i.legend:{};return{fontFamily:(null==l||null===(o=l.title)||void 0===o?void 0:o.fontFamily)||t.getStyle(e,"legend.title","fontFamily"),fontSize:(null==l||null===(a=l.title)||void 0===a?void 0:a.fontSize)||t.getStyle(e,"legend.title","fontSize"),color:(null==l||null===(s=l.title)||void 0===s||null===(s=s.fontColor)||void 0===s?void 0:s.color)||t.getStyle(e,"legend.title","color")}},di=(e,t,n,r)=>{var i,o,a,s;const l=r.isEnabled("CLIENT_IM_3051")?null===(i=li("legend",n))||void 0===i?void 0:i.legend:{};return{fontFamily:(null==l||null===(o=l.label)||void 0===o?void 0:o.fontFamily)||t.getStyle(e,"legend.label","fontFamily"),fontSize:(null==l||null===(a=l.label)||void 0===a?void 0:a.fontSize)||t.getStyle(e,"legend.label","fontSize"),color:(null==l||null===(s=l.label)||void 0===s||null===(s=s.fontColor)||void 0===s?void 0:s.color)||t.getStyle(e,"legend.label","color")}},fi={DATA_PATH:"qUndoExclude",HYPERCUBE_DEF_PATH:"qHyperCubeDef",HYPERCUBE_PATH:"qHyperCube",CHART_ID:"object.distributionPlot",AUTO_SORT:"sorting.autoSort",SORT_CRITERIA:"sorting.sortCriteria",SORTING_ELEMENT_ID:"sorting.elementId",SORTING_ELEMENT_MIN_ID:"distplot-exp-min",SORTING_ELEMENT_MAX_ID:"distplot-exp-max",SORTING_EXPRESSION:"sorting.expression",MAX_GLYPH_COUNT:20,MAX_STACKED_VALUES:3e3,HORIZONTAL:"horizontal",BOX_PADDING:2,POINT_BANDWIDTH_BASE_RATIO:.35,MAX_POINT_BASE_SIZE_PX:34,MIN_POINT_PIXELS:5,JITTER_PARAMETER:3,BUBBLE_SCALES_MAX:100};function hi(e){return e.qHyperCubeDef&&e.qHyperCubeDef.qDimensions.length>1||e.qHyperCube&&e.qHyperCube.qDimensionInfo&&e.qHyperCube.qDimensionInfo.length>1}Object.freeze(fi);const mi={hasMultipleDimensions:hi,getOuterDimensionCardinality:function(e){const t=wr(e,fi.HYPERCUBE_PATH);return hi(e)?t&&t.qDimensionInfo[1].qCardinal:1},isAutoSort:function(e){return wr(e,fi.AUTO_SORT,!1)},isSortByExpression:function(e){return 0!==wr(e,`${fi.SORT_CRITERIA}.sortByExpression`,0)},isSortByNumeric:function(e){return 0!==wr(e,`${fi.SORT_CRITERIA}.sortByNumeric`,0)},isSortByAscii:function(e){return 0!==wr(e,`${fi.SORT_CRITERIA}.sortByAscii`,0)}},gi={cellBackgroundColor:!0,cellForegroundColor:!0,colorByAlternative:!0,colorByExpression:!0,tooltip:!0,urlLabel:!0,url:!0};var yi={create(e,t){if(!e||!gi[e])throw new Error("Attribute Expressions Util: ID required");const n={};return t&&Object.keys(t).forEach(e=>{n[e]=t[e]}),n.id=e,n.qAttribute=!0,n},getById:(e,t,n)=>!!e&&(n=n||"id",e.filter(e=>e[n]===t)[0]),getIndexById(e,t,n){let r=-1;return e&&(n=n||"id",e.forEach((e,i)=>{e[n]===t&&(r=i)})),r},moveById(e,t,n,r){const i=this.getIndexById(e,n,r);t=t||[];const o=this.getIndexById(t,n,r);if(-1!==i&&-1===o){const n=e.splice(i,1);t.push(n[0])}return t},moveAllById(e,t,n,r){const i=e.filter(e=>e.id===n),o=t.filter(e=>e.id===n),a=i.filter(e=>!(o.filter(t=>t[r]===e[r]).length>0));return[...t,...a]},moveByIdFromGroup(e,t,n,r,i){n=n||"qAttributeExpressions",i=i||"id";for(let o=0;o<e.length;o++){const a=e[o][n],s=t.length;if(this.moveById(a,t,r,i),s!==t.length)return t}return t},clean:e=>e.filter(e=>e&&e.id),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"}};var bi={getColorByDefinition:function(e,t,n){const r={};let i,o,a;if("dimension"!==e)throw new Error("Default-property-logic.js: getColorByDefinition: Illegal input");return n.qLibraryId?(r.type="dimension",r.name=n.qLibraryId,r.id=n.qLibraryId):(r.type="field",t?(r.name=n.label||n.qDef,r.id=n.qDef):(i=n.qDef,o=!!i.qLabelExpression,a=i.qFieldLabels&&i.qFieldLabels[0],r.name=i.qFieldDefs[0],r.label=o?i.qLabelExpression:a?i.qFieldLabels[0]:i.qFieldDefs[0])),r}};var vi={useMasterNumberFormat:function(e){e.quarantine={qNumFormat:e.qNumFormat||{},isCustomFormatted:e.isCustomFormatted||!1},e.qNumFormat=null,e.isCustomFormatted=void 0},useLocalFormat:function(e){var t,n;e.qNumFormat=(null===(t=e.quarantine)||void 0===t?void 0:t.qNumFormat)||{},e.isCustomFormatted=(null===(n=e.quarantine)||void 0===n?void 0:n.isCustomFormatted)||!1,e.quarantine=void 0},isUsingMasterNumberFormat:function(e){var t,n;return null!==(t=!(null==e||null===(n=e.quarantine)||void 0===n||!n.qNumFormat))&&void 0!==t&&t}};const qi=["scatterplot","map"],xi=["map"];var Di={baseColor:{isSupported:e=>e&&e.length&&-1===qi.indexOf(e),isDimSupported:e=>e&&e.length&&-1!==xi.indexOf(e)},colorBy:{},colorByUpdater(e,t,n,r){this.updateColorDef(e,r,n),this.updateHypercubeAttributes(e,t,n)},updateColorDef(e,t,n){const r=Ue(n,"mode"),i=Ue(n,"auto"),o=Ue(e,`${t}qDimensions`,[]),a=Ue(e,`${t}qMeasures`,[]);let s,l,u,c;if(!i&&"byDimension"===r&&o.length)s=Ue(n,"byDimDef"),s&&Ii(n,s.label),s&&s.activeDimensionIndex>-1?(s.activeDimensionIndex=Math.min(s.activeDimensionIndex,o.length-1),l=o[s.activeDimensionIndex],c=bi.getColorByDefinition("dimension",!1,l),c.activeDimensionIndex=s.activeDimensionIndex,Ei(n,c)):s&&s.key||(l=o[o.length-1],u=yi.getById(l.qAttributeDimensions,yi.IDMAP.COLOR_BY_ALTERNATIVE),Ei(n,bi.getColorByDefinition("dimension",!!u,u||l)));else{if(!i&&"byMeasure"===r&&o.length)throw new Error("not suported in any 444-chart");"byMultiple"===r&&a.length<2&&Ke(n,"mode","primary")}},updateHypercubeAttributes(e,t,n){const r=Ue(n,"mode"),i=Ue(n,"auto"),o=Ue(e,`${t}qDimensions`,[]),a=Ue(e,`${t}qMeasures`,[]),s=Ue(e,`${t}qLayoutExclude.qHyperCubeDef.qDimensions`,[]);!i&&"byDimension"===r&&o.length?Ai(n,!0,o,s,a,Ue(n,"byDimDef.label")):!i&&"byMeasure"===r&&o.length?Ai(n,!1,o,s,a,Ue(n,"byMeasureDef.label")):Si(o,s)},setColorByPropertyDef:Ei,resolveColorByPropertyDef:Ai,clearColorByItem:Si};function Si(e,t){e.forEach(e=>{Ci(e,yi.IDMAP.COLOR_BY_ALTERNATIVE,"qAttributeDimensions"),Ci(e,yi.IDMAP.COLOR_BY_ALTERNATIVE,"qAttributeExpressions")}),t.forEach(e=>{Ci(e,yi.IDMAP.COLOR_BY_ALTERNATIVE,"qAttributeDimensions"),Ci(e,yi.IDMAP.COLOR_BY_ALTERNATIVE,"qAttributeExpressions")})}function Ci(e,t,n){if(e[n]){const r=yi.getIndexById(e[n],t);r>=0&&e[n].splice(r,1)}else e[n]=[]}function Mi(e){return e.split(" ").length>1&&"="!==e[0]&&"["!==e[0]?`[${e}]`:e}function Ei(e,t,n,r){const i=n?"expression":t.type;let o=e.mode;switch(Ii(e,t.label||t.name||""),i){case"field":o="byDimension",e.byDimDef={label:t.label||Mi(t.name),key:Mi(t.name),type:"expression",activeDimensionIndex:t.activeDimensionIndex};break;case"expression":o="byMeasure",e.byMeasureDef={label:n||t.label||t.name,key:n||t.name,type:"expression"};break;case"dimension":o="byDimension",e.byDimDef={label:t.name,key:t.id,type:"libraryItem",activeDimensionIndex:t.activeDimensionIndex};break;case"measure":o="byMeasure",e.byMeasureDef={label:t.name,key:t.id,type:"libraryItem"},e.formatting&&vi.useMasterNumberFormat(e.formatting)}r||(e.auto=!1,e.mode=o)}function Ai(e,t,n,r,i,o){Si(n,r);const a=n[n.length-1];if(a){const n=Ue(e,t?"byDimDef":"byMeasureDef"),r=Ue(e,"formatting.qNumFormat"),s=Ue(e,"formatting.isCustomFormatted");if(n){const e=yi.create(yi.IDMAP.COLOR_BY_ALTERNATIVE);switch(n.type){case"expression":e.label=o||n.label,t?e.qDef=n.key:(e.qExpression=n.key,r&&(e.qNumFormat=r,e.isCustomFormatted=s)),e.label&&"="===e.label.charAt(0)&&(e.labelExpRef="color.altLabel");break;case"libraryItem":if(!t){let t=-1;i.forEach((e,r)=>{n.key===e.qLibraryId&&(t=r)}),e.matchMeasure=t,r&&(e.qNumFormat=r,e.isCustomFormatted=s)}e.qLibraryId=n.key,e.colorMapRef=n.key}t?(e.qSortBy={qSortByAscii:1},a.qAttributeDimensions.push(e)):a.qAttributeExpressions.push(e)}}}function Ii(e,t){if(!t)return;const n="="===t.charAt(0);e.altLabel=n?{qStringExpression:{qExpr:t.substr(1)}}:t}function wi(e){return!!e&&(e.coloring&&e.coloring.baseColor&&e.coloring.baseColor.color?e.coloring.baseColor:!(!e.baseColor||!e.baseColor.color)&&e.baseColor)}function Oi(e){return"libraryItem"===wr(e,"color.point.byDimDef.type")}function Ti(e){return"libraryItem"===wr(e,"color.point.byMeasureDef.type")}function ki(e){return!0===wr(e,"color.point.auto")}function Ni(e){return!ki(e)&&"byDimension"===wr(e,"color.point.mode")}function Li(e){return!ki(e)&&"byMeasure"===wr(e,"color.point.mode")}var Pi={measuresHasBaseColors:function(e){return wr(e,"layout.qHyperCube.qMeasureInfo",[]).filter(e=>!!wi(e)).length>0},dimensionsHasBaseColors:function(e){return wr(e,"layout.qHyperCube.qDimensionInfo",[]).filter(e=>!!wi(e)).length>0},onGlobalChangeColors:function(e){Di.updateColorDef(e,"qHyperCubeDef.",e.color.point)},onChangeCalcCond:function(e){var t;const n=null==e?void 0:e.qHyperCubeDef,r=null==e||null===(t=e.qUndoExclude)||void 0===t?void 0:t.qHyperCubeDef;n&&r&&(r.qCalcCond=n.qCalcCond,r.qCalcCondition=n.qCalcCondition)},isColorByDimension:Ni,isColorByMeasure:Li,isColorAuto:ki,isColorByExpression:function(e){return!ki(e)&&"byExpression"===wr(e,"color.point.mode")},isColorBySingle:function(e){return!ki(e)&&"primary"===wr(e,"color.point.mode","primary")},isDimensionLibraryItem:Oi,isMeasureLibraryItem:Ti,showLegend:function(e){const t=wr(e,"color.point.mode","primary");return"primary"!==t&&"byExpression"!==t&&!1===ki(e)},showColorByLabel:function(e){const t=Ni(e)&&!1===Oi(e),n=Li(e)&&!1===Ti(e),r=wr(e,"color.point.byDimDef.activeDimensionIndex")>-1;return t&&!r||n},hasDimValueColors:function(e,t){var n,r;return null===(n=null===(r=e.layout.qHyperCube.qDimensionInfo[t])||void 0===r||null===(r=r.coloring)||void 0===r?void 0:r.hasValueColors)||void 0===n||n}};function _i(e,t){this.getSettings=e,this.getElements=t}function Ri(e){const t=e.qDef.qSortCriterias;t[0]||t.push({});const n=t[0],r=this.getSettings();Ke(n,"qSortByExpression",r.SORT_BY_EXPRESSION),Ke(n,"qSortByAscii",r.SORT_BY_ASCII),Ke(n,"qSortByNumeric",r.SORT_BY_NUMERIC),Ke(n,"qSortByLoadOrder",r.SORT_BY_LOAD_ORDER),n.qExpression||(n.qExpression={});const i=Hi(this.getElements());n.qExpression.qv=i.exp}function Hi(e){const t=e.filter(e=>e.isDefault);return 0===t.length?e[0]:t[0]}_i.prototype.applyAutoSorting=Ri,_i.prototype.applyDefaultCustomSorting=function(e,t){Ri.call(this,e);const n=Hi(this.getElements()),r=e.qDef.qSortCriterias[0];t.elementId=n.id,t.sortCriteria={},Ke(t.sortCriteria,"sortByExpression",r.qSortByExpression),Ke(t.sortCriteria,"sortByAscii",r.qSortByAscii),Ke(t.sortCriteria,"sortByNumeric",r.qSortByNumeric),Ke(t.sortCriteria,"sortByLoadOrder",r.qSortByLoadOrder)},_i.prototype.applyCustomSorting=function(e,t){const n=e.qDef.qSortCriterias[0];if(Ke(n,"qSortByExpression",t.sortCriteria.sortByExpression),Ke(n,"qSortByAscii",t.sortCriteria.sortByAscii),Ke(n,"qSortByNumeric",t.sortCriteria.sortByNumeric),Ke(n,"qSortByLoadOrder",t.sortCriteria.sortByLoadOrder),1!==n.qSortByExpression&&-1!==n.qSortByExpression)return;n.qExpression||(n.qExpression={});if(t.elementId){const e=function(e,t){const n=e.filter(e=>e.id===t);0===n.length&&function(e){throw new Error(`Sorter: ${e}`)}(`Could not find any element matching the element '${t}'`);return n[0]}(this.getElements(),t.elementId);n.qExpression.qv=e.exp}else n.qExpression.qv=t.expression.qValueExpression.qExpr};const Fi={create:function(e,t){return new _i(e,t)}};const Bi={applySorting:function(e,t,n){const r=n.autoSort,i=!!n.sortCriteria;r?e.applyAutoSorting(t):i?e.applyCustomSorting(t,n):e.applyDefaultCustomSorting(t,n)}};const Vi={ASCII:{ELEMENT:void 0,SORT_BY_EXPRESSION:void 0,SORT_BY_ASCII:1,SORT_BY_NUMERIC:1,SORT_BY_LOAD_ORDER:1}};Object.freeze(Vi.ASCII),Object.freeze(Vi);const zi=E(!0,{DIST_MAX:{ELEMENT:"distplot-exp-max",SORT_BY_EXPRESSION:-1,SORT_BY_ASCII:1,SORT_BY_NUMERIC:1,SORT_BY_LOAD_ORDER:1}},Vi);const ji={getSettings:function(e){return wr(e,"qHyperCube.qDimensionInfo.1.qCardinal",1)>10?zi.DIST_MAX:zi.ASCII}};function $i(e,t,n,r){let i="Fractile";0===e?i="Min":1===e&&(i="Max");const o=t?Wr.wrapExpression(t):"",a=n?Wr.wrapExpression(n):"";return`${i}( total {{<outerDimString>}} Aggr( {{innerMeasureString}}, {{outerDimString,}} {{innerDimString}} ), ${e} )`.replace(/{{innerDimString}}/g,o).replace(/{{outerDimString}}/g,a).replace(/{{<outerDimString>}}/g,n?`<${a}>`:"").replace(/{{outerDimString,}}/g,n?`${a},`:"").replace(/{{innerMeasureString}}/g,(r||"").replace(/^=/,""))}const Ui={getElementIds:function(){return[fi.SORTING_ELEMENT_MIN_ID,fi.SORTING_ELEMENT_MAX_ID]},getElements:function(e,t,n,r){const i=t[0],o=t[1],a=e[0],s=$i(0,i,o,a),l=$i(1,i,o,a);return[{id:fi.SORTING_ELEMENT_MIN_ID,label:r.get("properties.distributionPlot.min"),exp:s,isDefault:fi.SORTING_ELEMENT_MIN_ID===n.ELEMENT},{id:fi.SORTING_ELEMENT_MAX_ID,label:r.get("properties.distributionPlot.max"),exp:l,isDefault:fi.SORTING_ELEMENT_MAX_ID===n.ELEMENT}]},getFractileExpression:$i};function Wi(e){throw new Error(`distributionplot-sorter.applySorting: ${e}`)}function Ki(e,t,n,r){if(!e.qUndoExclude)return;e.sorting||(e.sorting={autoSort:!0});const i=e.qUndoExclude.qHyperCubeDef.qDimensions;i.length>=2?e.qUndoExclude.qHyperCubeDef.qInterColumnSortOrder=[0,2,1]:e.qUndoExclude.qHyperCubeDef.qInterColumnSortOrder=[1,0];const o=function(){return ji.getSettings(t)},a=Fi.create(o,function(){const e=o();return Ui.getElements(n.measures,n.dimensions,e,r)}),s=i[0],l=e.sorting;Bi.applySorting(a,s,l)}const Yi={applySorting:function(e,t,n,r,i){return function(e){const t=e.qHyperCubeDef;t?t.qDimensions?t.qMeasures?(!t.qDimensions.length||t.qDimensions.length<2)&&Wi("'qHyperCubeDef.qDimensions' has no outer dimension"):Wi("no 'qHyperCubeDef.qMeasures' in properties arg"):Wi("no 'qHyperCubeDef.qDimensions' in properties arg"):Wi("no 'qHyperCubeDef' in properties arg")}(e),r?Ki(e,t,r,i):Jr.getAllHyperCubeExpressions(e.qHyperCubeDef,t.qHyperCube,n).then(n=>{Ki(e,t,n,i)})}},Gi=`${fi.SORT_CRITERIA}.sortByExpression`;const Xi={updateSortOrder:function(e,t){if(!t)return;const n=wr(e,Gi);if(!(-1===n||1===n))return;const r=wr(e,fi.SORTING_ELEMENT_ID),i=wr(t,fi.SORTING_ELEMENT_ID),o=r===fi.SORTING_ELEMENT_MAX_ID,a=r===fi.SORTING_ELEMENT_MIN_ID&&i===fi.SORTING_ELEMENT_MAX_ID,s=o&&(!!!i||i===fi.SORTING_ELEMENT_MIN_ID),l=wr(t,Gi),u=o&&!(-1===l||1===l)&&1===n;a?kr(e,Gi,1):(s||u)&&kr(e,Gi,-1)}},Ji=(e,t)=>{const n={};return n.axisTitleSection={translation:"properties.axis.title",component:"panel-section",items:t.getOptions("axis","axis.title")},n.axisLabelSection={translation:"properties.axis.label",component:"panel-section",items:t.getOptions("axis","axis.label.name")},null!=e&&e.isEnabled("CLIENT_IM_3051")&&(n.legendTitleSection={translation:"properties.legend.title",component:"panel-section",items:t.getOptions("legend","legend.title")},n.legendLabelSection={translation:"properties.legend.label",component:"panel-section",items:t.getOptions("legend","legend.label")}),Object.keys(n).length>0?n:void 0},Zi=(e,t,n)=>({component:"styling-panel",chartTitle:"Object.DistributionPlot",translation:"LayerStyleEditor.component.styling",subtitle:"LayerStyleEditor.component.styling",ref:"components",useGeneral:!0,useBackground:e,items:Ji(n,t)});function Qi(e){return!wr(e,"color.point.auto")&&"byDimension"===wr(e,"color.point.mode")&&wr(e,"qHyperCubeDef.qMeasures.length",0)<=1}function eo(e){const{flags:t,translator:n}=e,r=e.theme,i=e.flags.isEnabled("SENSECLIENT_IM_2018_STYLINGPANEL_DIST_PLOT"),o=e.flags.isEnabled("SENSECLIENT_IM_2018_DIST_BG"),a=e=>({color:e,index:r.getDataColorPickerPalettes()[0].colors.indexOf(e)}),s={translation:"properties.colors",type:"items",items:{colors:{type:"items",items:{pointColor:{type:"items",translation:"properties.colorsAndLegend",grouped:!0,items:{colors:{type:"items",items:{autoColor:{ref:"color.point.auto",type:"boolean",translation:"properties.colors",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}]},colorMode:{ref:"color.point.mode",type:"string",component:"dropdown",options:()=>[{value:"primary",translation:"properties.colorMode.primary"},{value:"byExpression",translation:"properties.colorMode.byExpression"}],defaultValue:"primary",show:e=>!wr(e,"color.point.auto",!0)},boxColor:{ref:"color.box.paletteColor",translation:"properties.distributionPlot.boxColor",type:"object",component:"color-picker",dualOutput:!0,defaultValue(){const e=r.getStyle(fi.CHART_ID,"box","fill");return a(e)}},paletteColor:{ref:"color.point.paletteColor",translation:"properties.distributionPlot.pointColor",type:"object",component:"color-picker",dualOutput:!0,show:e=>!wr(e,"color.point.auto",!0)&&"primary"===wr(e,"color.point.mode","primary"),defaultValue(){const e=r.getDataColorSpecials().primary;return a(e)}},attributeExpression:{type:"string",component:"expression",expressionType:"measure",schemaIgnore:!0,ref:"color.point.expression.qValueExpression.qExpr",translation:"Common.Expression",show:e=>!wr(e,"color.point.auto")&&"byExpression"===wr(e,"color.point.mode")},expressionIsColor:{ref:"color.point.expressionIsColor",translation:"properties.expressionIsColor",type:"boolean",defaultValue:!0,show:!1}}}}}}}}},l={items:{showDisclaimer:{translation:"properties.showDisclaimer",type:"boolean",ref:"showDisclaimer",component:"switch",show:()=>t.isEnabled("SHOW_DISCLAIMER"),defaultValue:!0,options:[{value:!0,translation:"Common.Show"},{value:!1,translation:"properties.hide"}]}}},u=((e,t,n,r,i)=>r({theme:e,translator:t,flags:i,config:{id:n,paths:["axis.title","axis.label.name","label.value","legend.title","legend.label"]}}))(r,n,fi.CHART_ID,Yt,t),c=((e,t,n)=>{const r={getOptions:(r,i)=>{const o=(e,t)=>({ref:`${i}.fontColor`,component:"color-picker",width:!1,defaultValue:()=>{const n=e.getStyle(t,`${i}.color`,"color");return{color:n,index:e.getDataColorPickerPalettes()[0].colors.indexOf(n)}}});return{labelSection:{component:"items",ref:"components",key:r,items:{fontFamily:{ref:`${i}.fontFamily`,component:"dropdown",options:()=>e.getOptions(`${i}.fontFamily`),defaultValue:()=>e.getDefaultValue(`${i}.fontFamily`)},...((t,n)=>({fontWrapper:{component:"inline-wrapper",items:{fontSize:{ref:`${i}.fontSize`,component:"dropdown",width:!0,options:()=>e.getOptions(`${i}.fontSize`),defaultValue:()=>e.getDefaultValue(`${i}.fontSize`)},fontColor:{...o(t,n)}}}}))(t,n)}}}}};return r})(u,r,fi.CHART_ID),p={type:"items",translation:"properties.presentation",items:{stylingPanel:i&&Zi(o,c,t),orientation:{ref:"orientation",type:"string",component:"item-selection-list",defaultValue:"horizontal",horizontal:!0,items:[{component:"icon-item",icon:"direction_up_down",labelPlacement:"bottom",translation:"properties.orientation.vertical",value:"vertical"},{icon:"direction_left_right",component:"icon-item",labelPlacement:"bottom",translation:"Common.Horizontal",value:"horizontal"}]},showDistBackground:{ref:"presentation.visibleComponents",translation:"properties.show",type:"string",component:"dropdown",defaultValue:"points_box",options:[{value:"points_box",translation:"properties.distributionPlot.pointsAndBox"},{value:"points",translation:"properties.distributionPlot.pointsOnly"},{value:"box",translation:"properties.distributionPlot.boxOnly"}]},gridLines:{type:"items",snapshot:{tid:"property-gridLines"},items:{showGridLines:{ref:"gridlines.auto",type:"boolean",translation:"properties.gridLine.spacing",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}]},gridSpacing:{ref:"gridlines.spacing",type:"number",component:"dropdown",defaultValue:2,options:[{value:0,translation:"properties.gridLine.noLines"},{value:2,translation:"properties.gridLine.medium"},{value:3,translation:"properties.gridLine.narrow"}],show:e=>e.gridlines&&!e.gridlines.auto}}}}};p.items.bubbleScaleItems={type:"items",items:{bubbleScales:{type:"integer",component:"slider",ref:"dataPoint.bubbleScales",translation:"properties.dataPoints.bubbleSizes",min:20,max:fi.BUBBLE_SCALES_MAX,step:5,defaultValue:100,show:e=>e.qHyperCubeDef.qMeasures.length<2&&"box"!==e.presentation.visibleComponents}}},p.items.jitter={type:"string",component:"switch",ref:"dataPoint.displacement",translation:"properties.distributionPlot.jitter",defaultValue:"none",options:[{value:"none",translation:"properties.off"},{value:"jitter",translation:"properties.on"}],show:e=>"box"!==e.presentation.visibleComponents};const d={uses:"axis.picasso.measureAxis",items:{startAt:{type:"string",component:"dropdown",translation:"properties.axis.startAt",readOnly:e=>!(e.measureAxis.autoMinMax||"min"===e.measureAxis.minMax&&0===e.measureAxis.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.measureAxis)||{};return!0===i?"lowest":i||"min"!==o||0!==a?e(t.type):"zero"},set(e,t,n,r,i){"zero"===e?(kr(i,"measureAxis.autoMinMax",!1),kr(i,"measureAxis.minMax","min"),kr(i,"measureAxis.min",0)):kr(i,"measureAxis.autoMinMax",!0)}},classification:{section:"axis",tags:["simple"],exclusive:!0}}}},f={uses:"axis.picasso.dimensionAxis",show:(e,t)=>wr(t.layout,`${fi.HYPERCUBE_PATH}.qDimensionInfo.length`)>1,items:{dimensionAxisTitle:{component:"header",type:"string",show:(e,t)=>wr(t.layout,`${fi.HYPERCUBE_PATH}.qDimensionInfo.length`)>1,classification:{section:"axis",tags:["simple"],exclusive:!0}},othersGroup:{items:{label:{show:(e,t)=>wr(t.layout,`${fi.HYPERCUBE_PATH}.qDimensionInfo.length`)>1&&"horizontal"!==wr(t.layout,"orientation"),options:t.isEnabled("SENSECLIENT_LAYERED_LABELS")?[{value:"auto",translation:"Common.Auto"},{value:"horizontal",translation:"Common.Horizontal"},{value:"tilted",translation:"properties.labels.tilted"},{value:"layered",translation:"properties.labels.layered"}]:void 0},dock:{show:(e,t)=>wr(t.layout,`${fi.HYPERCUBE_PATH}.qDimensionInfo.length`)>1}}}}};function h(e,t){const n=wr(e,t,void 0);n&&void 0!==n.label&&("="===n.label.charAt(0)?e.color.point.altLabel={qStringExpression:{qExpr:n.label.substr(1)}}:e.color.point.altLabel=n.label)}const m=(e,t)=>{var n,r,i;if("libraryItem"===(null===(n=e.color.point.byDimDef)||void 0===n?void 0:n.type)){var o,a,s,l;const n=null!==(o=null===(a=e.color.point.byDimDef)||void 0===a?void 0:a.key)&&void 0!==o?o:"",r=null!==(s=null===(l=t.handler.layout.qUndoExclude)||void 0===l||null===(l=l.qHyperCube)||void 0===l?void 0:l.qDimensionInfo)&&void 0!==s?s:[];for(let e=0;e<r.length;e++){const t=r[e].qAttrDimInfo;if(t)for(let e=0;e<t.length;e++)if(t[e].colorMapRef===n)return t[e].qFallbackTitle}return""}return null!==(r=null===(i=e.color.point.byDimDef)||void 0===i?void 0:i.label)&&void 0!==r?r:""},g=(e,t,r)=>{var i;if(null!==(i=e.qHyperCubeDef)&&void 0!==i&&null!==(i=i.qDimensions)&&void 0!==i&&i.length){var o,a,s;const t=null===(o=e.qHyperCubeDef)||void 0===o?void 0:o.qDimensions.map((e,t)=>({value:t,label:n.get("properties.colorBy.currentDimension",t+1)}));return(null!==(a=null===(s=e.color)||void 0===s||null===(s=s.point)||void 0===s||null===(s=s.byDimDef)||void 0===s?void 0:s.activeDimensionIndex)&&void 0!==a?a:-1)<0&&t.push({value:-1,label:m(e,r)}),t}return[]},y={items:{disclaimer:{show:!1},simpleItems:{show:!0,items:{autoColor:{ref:"color.point.auto",undefinedValue:!1,label:e=>wr(e,"color.point.auto")?n.get("Simple.Color.Auto",n.get("properties.colorMode.primary")):n.get("Common.Custom"),change:e=>{wr(e,"color.point.auto")||(kr(e,"color.point.mode","primary"),kr(e,"color.point.useBaseColors","off"))}},colorMode:{ref:"color.point.mode",options:e=>{const t=[{value:"primary",translation:"properties.colorMode.primary"},{value:"byDimension",translation:"properties.colorMode.byDimension"}];return"byExpression"===wr(e,"color.point.mode")&&t.push({value:"byExpression",translation:"properties.colorMode.byExpression"}),t},show:e=>!Pi.isColorAuto(e),change(e){if("primary"===wr(e,"color.point.mode",void 0)){const t=wr(e,"color.point.useBaseColors",void 0);void 0!==t&&"off"!==t&&kr(e,"color.point.useBaseColors","off")}},globalChange(){}},colorByDimension:{ref:"color.point.byDimDef.activeDimensionIndex",options:g,show:(e,t,n)=>Pi.isColorByDimension(e)&&g(e,0,n).length>1,change(e){h(e,"color.point.byDimDef")}},baseColors:{type:"items",items:{useBaseColor:{ref:"color.point.useBaseColors",show(e,t){const n=wr(e,"color.point.mode","primary");return!Pi.isColorAuto(e)&&"primary"===n&&(Pi.measuresHasBaseColors(t)||Pi.dimensionsHasBaseColors(t))}}}},paletteColor:{ref:"color.point.paletteColor",translation:"properties.distributionPlot.pointColor",show:(e,t)=>{const n="measure"===wr(e,"color.point.useBaseColors")&&Pi.measuresHasBaseColors(t),r="dimension"===wr(e,"color.point.useBaseColors")&&Pi.dimensionsHasBaseColors(t);return Pi.isColorBySingle(e)&&!n&&!r}},useDimColVal:{ref:"color.point.useDimColVal",show(e,t,n){var r,i;const o=null!==(r=null===(i=e.color.point)||void 0===i||null===(i=i.byDimDef)||void 0===i?void 0:i.activeDimensionIndex)&&void 0!==r?r:null;return Pi.hasDimValueColors(n.handler,o)&&Pi.isColorByDimension(e)&&Pi.isDimensionLibraryItem(e)}},boxColor:{ref:"color.box.paletteColor",translation:"properties.distributionPlot.boxColor",type:"object",component:"color-picker",dualOutput:!0,defaultValue(){const e=r.getStyle(fi.CHART_ID,"box","fill");return a(e)},show:e=>!wr(e,"color.point.auto",!0)}}}}},b={uses:"colorsAndLegend",items:{colors:{globalChange:Pi.onGlobalChangeColors,items:{autoColor:{ref:"color.point.auto",undefinedValue:!1},colorMode:{ref:"color.point.mode",options(e){const t=[];return t.push({value:"primary",translation:"properties.colorMode.primary"}),t.push({value:"byDimension",translation:"properties.colorMode.byDimension"}),wr(e,"qHyperCubeDef.qDimensions.length",0)>=1&&t.push({value:"byExpression",translation:"properties.colorMode.byExpression"}),t},show:e=>!Pi.isColorAuto(e),globalChange(){}},colorByDimension:{ref:"color.point.byDimDef",show:e=>Pi.isColorByDimension(e),change(e){h(e,"color.point.byDimDef")}},colorByMeasure:{ref:"color.point.byMeasureDef",show:e=>Pi.isColorByMeasure(e),change(e){h(e,"color.point.byMeasureDef")}},colorByLabel:{ref:"color.point.altLabel",show:Pi.showColorByLabel,change(e){const t=wr(e,"color.point.mode"),n=wr(e,"color.point.altLabel","");let r;switch(t){case"byMeasure":r=e.color.point.byMeasureDef;break;case"byDimension":r=e.color.point.byDimDef}r&&(r.label=n.qStringExpression?`=${n.qStringExpression.qExpr}`:n)}},baseColors:{type:"items",items:{useBaseColor:{ref:"color.point.useBaseColors",show(e,t){const n=wr(e,"color.point.mode","primary");return!Pi.isColorAuto(e)&&"primary"===n&&(Pi.measuresHasBaseColors(t)||Pi.dimensionsHasBaseColors(t))}},measureColor:{translation:"properties.libraryColors",component:"measure-color",show:(e,t)=>!wr(e,"color.point.auto")&&"byMultiple"===wr(e,"color.point.mode")&&"measure"===wr(e,"color.point.useBaseColors")&&t.layout.qHyperCube.qMeasureInfo.length>1&&Pi.measuresHasBaseColors(t)}}},paletteColor:{ref:"color.point.paletteColor",translation:"properties.distributionPlot.pointColor",show(e,t){const n="measure"===wr(e,"color.point.useBaseColors")&&Pi.measuresHasBaseColors(t),r="dimension"===wr(e,"color.point.useBaseColors")&&Pi.dimensionsHasBaseColors(t);return Pi.isColorBySingle(e)&&!n&&!r}},useDimColVal:{ref:"color.point.useDimColVal",show:e=>Pi.isColorByDimension(e)&&Pi.isDimensionLibraryItem(e)},useMeasureGradient:{ref:"color.point.useMeasureGradient",translation:"properties.libraryColors",type:"boolean",component:"switch",schemaIgnore:!0,defaultValue:!1,options:[{value:!0,translation:"properties.on"},{value:!1,translation:"properties.off"}],show(e){const t=wr(e,"color.point.auto"),n=wr(e,"color.point.mode");return!t&&"byMeasure"===n&&"libraryItem"===wr(e,"color.point.byMeasureDef.type")}},persistentColors:{ref:"color.point.persistent",show:e=>wr(e,"color.point.auto")||"byDimension"!==wr(e,"color.point.mode")||"libraryItem"!==wr(e,"color.point.byDimDef.type")?Qi(e):Qi(e)&&!wr(e,"color.point.useDimColVal")},colorSchemeMeasure:{ref:"color.point.measureScheme",show:e=>!Pi.isColorAuto(e)&&Pi.isColorByMeasure(e)},reverseScheme:{ref:"color.point.reverseScheme",change(e){e.color.reverseScheme=e.color.point.reverseScheme},show:e=>!Pi.isColorAuto(e)&&Pi.isColorByMeasure(e)},colorSchemeDimension:{ref:"color.point.dimensionScheme",show:e=>Pi.isColorByDimension(e)&&(!Pi.isDimensionLibraryItem(e)||!wr(e,"color.point.useDimColVal"))},customRange:{show:e=>!Pi.isColorAuto(e),items:{autoMinMax:{ref:"color.point.autoMinMax",show:e=>Pi.isColorByMeasure(e)},min:{ref:"color.point.measureMin",show:e=>Pi.isColorByMeasure(e)&&!1===wr(e,"color.point.autoMinMax"),invalid:e=>"minMax"===wr(e,"color.point.minMax")&&wr(e,"color.point.measureMin")>=wr(e,"color.point.measureMax")},max:{ref:"color.point.measureMax",show:e=>Pi.isColorByMeasure(e)&&!1===wr(e,"color.point.autoMinMax"),invalid:e=>"minMax"===wr(e,"color.point.minMax")&&wr(e,"color.point.measureMin")>=wr(e,"color.point.measureMax")}}},attributeExpression:{ref:"color.point.expression.qValueExpression.qExpr",show:e=>Pi.isColorByExpression(e)},expressionIsColor:{ref:"color.point.expressionIsColor",show:!1},boxColor:{ref:"color.box.paletteColor",translation:"properties.distributionPlot.boxColor",type:"object",component:"color-picker",dualOutput:!0,defaultValue(){const e=r.getStyle(fi.CHART_ID,"box","fill");return a(e)},show:e=>!wr(e,"color.point.auto",!0)}}},simpleColors:y,legend:{show:Pi.showLegend,type:"items",items:{show:{snapshot:{tid:"property-legend"}},dock:{show:e=>Pi.showLegend(e)&&wr(e,"legend.show",!0)},showTitle:{show:e=>Pi.showLegend(e)&&wr(e,"legend.show",!0)}}}}},v={items:{labels:{items:{header:{show(e){var t,n;return(null===(t=e.qHyperCubeDef.qDimensions)||void 0===t?void 0:t.length)&&(null===(n=e.qHyperCubeDef.qMeasures)||void 0===n?void 0:n.length)}},dimensionTitle:{component:"checkbox",ref:"dimensionAxis.show",type:"string",translation:"Simple.Label.Dimension.Hide",defaultValue:"all",show(e){var t,n;return(null===(t=e.qHyperCubeDef.qDimensions)||void 0===t?void 0:t.length)>1&&(null===(n=e.qHyperCubeDef.qMeasures)||void 0===n?void 0:n.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"}}},measureTitle:{component:"checkbox",ref:"measureAxis.show",type:"string",translation:"Simple.Label.Measure.Hide",defaultValue:"all",show(e){var t,n;return(null===(t=e.qHyperCubeDef.qDimensions)||void 0===t?void 0:t.length)&&(null===(n=e.qHyperCubeDef.qMeasures)||void 0===n?void 0:n.length)},convertFunctions:{get:(e,t,n,r)=>"labels"===r.measureAxis.show||"none"===r.measureAxis.show,set(e,t,n,r,i){i.measureAxis.show=e?"labels":"all"}}}}}}},q={uses:"settings",items:{simpleLabels:v,general:l,presentation:p,colors:b||s,measureAxis:d,dimensionAxis:f}},x={type:"items",component:"expandable-items",translation:"properties.addons",items:{dataHandling:{uses:"dataHandling",items:{calcCond:{uses:"calcCond",change:Pi.onChangeCalcCond}}},refLines:{uses:"reflines",items:{colorBackground:{show:!1}}}}},D=si.expression(`${fi.SORT_CRITERIA}.sortByExpression`),S={type:"items",items:{toggled:D.items.toggled,sortByElement:{component:"sort-by-element",expressionRef:fi.SORTING_EXPRESSION,elementRef:fi.SORTING_ELEMENT_ID,show:mi.isSortByExpression,elements:e=>Jr.getAllHyperCubeExpressions(e.properties.qHyperCubeDef,e.layout.qHyperCube,e.model.app).then(t=>{const r=ji.getSettings(e.layout);return Ui.getElements(t.measures,t.dimensions,r,n)})},order:D.items.order}},C={type:"items",translation:"properties.sorting",schemaIgnore:!0,grouped:!1,globalChange(e,t,n){n&&Xi.updateSortOrder(e,n.prevProperties)},items:{autoSort:{ref:fi.AUTO_SORT,type:"boolean",translation:"properties.sorting",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}],show:mi.hasMultipleDimensions,change(e,t,r,i){if(e&&mi.hasMultipleDimensions(e)&&t.layout)return Yi.applySorting(e,t.layout,i.model.app,null,n)},classification:{section:"sorting",tags:["simple"]},reset(e){e.sorting={autoSort:!0}}},simpleSorting:{component:"sorting-with-elements",expressionRef:fi.SORTING_EXPRESSION,elementRef:fi.SORTING_ELEMENT_ID,sortCriteriasRef:fi.SORT_CRITERIA,show:e=>mi.hasMultipleDimensions(e)&&!mi.isAutoSort(e),elements:e=>Jr.getAllHyperCubeExpressions(e.handler.properties.qHyperCubeDef,e.handler.layout.qHyperCube,e.model.app).then(t=>{const r=ji.getSettings(e.layout);return Ui.getElements(t.measures,t.dimensions,r,n)}),classification:{section:"sorting",tags:["simple"],exclusive:!0}},sortingItems:{type:"items",grouped:!0,show:e=>mi.hasMultipleDimensions(e)&&!mi.isAutoSort(e),items:{expression:S,numeric:si.numeric(`${fi.SORT_CRITERIA}.sortByNumeric`),ascii:si.ascii(`${fi.SORT_CRITERIA}.sortByAscii`),defaultSortMessage:{component:"text",translation:"properties.sorting.defaultSortingMessage",show:e=>!mi.isSortByExpression(e)&&!mi.isSortByNumeric(e)&&!mi.isSortByAscii(e)}}},noData:{component:"text",translation:"Common.NoData",style:"hint",show:e=>!mi.hasMultipleDimensions(e),classification:{section:"sorting",tags:["simple"]}}}};return{type:"items",component:"accordion",items:{data:{uses:"data",grouped:!0,items:{dimensions:{uses:"dimensions"},measures:{uses:"measures"}}},sorting:C,addons:x,settings:q}}}const to={buildDefinition:function(e,t,n,r,i){const o=`${n}.qDef.qSortCriterias.0.`,a={type:"items",translation:"properties.sorting",icon:"ascending",show:t=>Ue(t,`${e}.qDimensions.length`,0)>1,items:{sortingOptions:{component:"radio-list",type:"number",diffs:[`${o}qSortByExpression`,`${o}qSortByNumeric`,`${o}qSortByAscii`],options:[{value:1,translation:"properties.sorting.ascending"},{value:-1,translation:"properties.sorting.descending"}],setPropertyValue(e,n,a){const s=a.layout;let l=no(e,o).chart;l||(l="sortByAscii");const u=Ue(e,t);if(u.sortCriteria||(u.sortCriteria={}),u.autoSort){const t=r(s);if(t.ELEMENT)u.elementId=t.ELEMENT;else{const t=i(e,s);u.elementId=t[0]}}u.autoSort=!1,function(e,t){const n=e.sortCriteria;"sortByNumeric"!==t&&"sortByAscii"!==t||(n.sortByExpression=0);"sortByAscii"===t&&(n.sortByNumeric=0)}(u,l),u.sortCriteria[l]=n},getValue(e){const t=no(e,o).dimension;return t?Ue(e,o+t):0}}}};return a}};function no(e,t){const n={chart:"",dimension:""};return 0!==Ue(e,`${t}qSortByExpression`,0)?(n.chart="sortByExpression",n.dimension="qSortByExpression"):0!==Ue(e,`${t}qSortByNumeric`,0)?(n.chart="sortByNumeric",n.dimension="qSortByNumeric"):0!==Ue(e,`${t}qSortByAscii`,0)&&(n.chart="sortByAscii",n.dimension="qSortByAscii"),n}const ro={type:"items",component:"accordion",items:{data:{uses:"data"},sorting:to.buildDefinition("qHyperCubeDef","sorting","qUndoExclude.qHyperCubeDef.qDimensions.0",ji.getSettings,Ui.getElementIds),presentation:{uses:"presentation",items:{orientation:{ref:"orientation",type:"string",component:"item-selection-list",horizontal:!0,items:[{component:"icon-item",icon:"direction_up_down",labelPlacement:"bottom",translation:"properties.orientation.vertical",value:"vertical"},{icon:"direction_left_right",component:"icon-item",labelPlacement:"bottom",translation:"Common.Horizontal",value:"horizontal"}]},bubbleScales:{type:"integer",component:"slider",ref:"dataPoint.bubbleScales",translation:"properties.dataPoints.bubbleSizes",min:20,max:100,step:5,defaultValue:100,show:e=>e.qHyperCubeDef.qMeasures.length<2&&"box"!==e.presentation.visibleComponents},jitter:{type:"string",component:"switch",ref:"dataPoint.displacement",translation:"properties.distributionPlot.jitter",defaultValue:"none",options:[{value:"none",translation:"properties.off"},{value:"jitter",translation:"properties.on"}],show:e=>"box"!==e.presentation.visibleComponents}}}}},io={items:{color:{uses:"color",items:{mode:{options:[{value:"auto",translation:"Common.Auto"},{value:"primary",translation:"properties.colorMode.primary"},{value:"byDimension",translation:"properties.colorMode.byDimension"}],diffs:["color.point.mode","color.point.auto"],setPropertyValue(e,t){"auto"===t?e.color.point.auto=!0:(e.color.point.auto=!1,e.color.point.mode=t)},getValue:e=>Pi.isColorAuto(e)?"auto":e.color.point.mode},dimension:{show:e=>Pi.isColorByDimension(e),items:{colorScheme:{ref:"color.point.dimensionScheme"},persistentColors:{ref:"color.point.persistent"}}},measure:{show:e=>Pi.isColorByMeasure(e),items:{sequential:{ref:"color.point.measureScheme"}}},legend:{show:Pi.showLegend}}}}};function oo(e){return{definition:eo(e),softDefinition:ro,support:{cssScaling:!1,snapshot:!0,export:!0,exportData:!0,sharing:!0,viewData:!0},options:{usingDerivedProperties:!0,colorByPath:"color.point"},onSoftPropertyChange(e,t){Pi.onGlobalChangeColors(t)},importProperties:(t,n,r)=>{const i=mt(e);r.mapProperties();return jr({dataDefinition:i,defaultPropertyValues:{defaultDimension:r.getDefaultDimensionProperties(),defaultMeasure:r.getDefaultMeasureProperties()},exportFormat:t,initialProperties:n})},exportProperties:(e,t,n)=>$r({propertyTree:e,viewDataMode:n})}}E(!0,ro,io);const ao={getChar(e){let t,n=e;return n>9?(t=65+n-10,t>90&&(t+=6)):n=`${n}`.charCodeAt(0),[48,111,79,105,73,108].indexOf(t)>-1?this.getChar(n+1):String.fromCharCode(t)},base62(e){const t=this.getChar(e%62),n=Math.floor(e/62);return n>0?this.base62(n)+t:t},id(){return this.base62(Math.round(99e11*Math.random()+1e11)).replace(/\W/g,"")}};function so(){return ao.id()}const lo="scrollbar";function uo(e,t,n){return"y"===e?co(t,n):function(e){return"far"===e?"top":"bottom"}(t)}function co(e,t){const n=e||"near";return t&&"near"===n||!t&&"far"===n?"right":"left"}var po={getAxisDock:uo,getOppositeAxisDock:function(e,t,n){return uo(e,"far"===t?"near":"far",n)},getYAxisDock:co};const fo=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼ‎ⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),ho=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞‏יִײַ-ﬨשׁ-ﭏ]"),mo=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]");function go(e){return fo.test(e)}function yo(e){return ho.test(e)||mo.test(e)}var bo={lrm:String.fromCharCode(8206),detectTextDirection:function(e){const t=e?e.length:0;let n,r;for(n=0;n<t;n++){if(r=e[n],go(r))return"ltr";if(yo(r))return"rtl"}return"ltr"}};var vo={lineSettings:function(e,t){var n;const r={value:0,line:{stroke:void 0!==t.paletteColor?t.theme.getColorPickerColor(t.paletteColor):"transparent",strokeDasharray:null==t||null===(n=t.style)||void 0===n?void 0:n.lineType}};return E(!0,r,e||{})},lineLabelSettings:function(e,t){const n=t&&t.chartID;let r=t.theme.getStyle(n,"referenceLine.label.name","color");const i=t.theme.getStyle(n,"referenceLine.label.name","fontSize"),o=t.theme.getStyle(n,"referenceLine.label.name","fontFamily");return t.paletteColor?r=t.theme.getColorPickerColor(t.paletteColor):r||(r="transparent"),E(!0,{value:0,line:{stroke:"transparent"},label:{align:"center",vAlign:"middle",text:"",fill:r,fontFamily:o,fontSize:i,maxWidthPx:135}},e||{})},isVisible:e=>e&&!1!==e.show&&0!==e.show&&"0"!==e.show&&void 0!==e.refLineExpr,getRefLineTitle:function({refLine:e,label:t,valueString:n}){return!1!==e.showValue?!1!==e.showLabel?`${t} ${bo.lrm}(${n})${bo.lrm}`:`${bo.lrm}(${n})${bo.lrm}`:!1!==e.showLabel?t:""}};const qo={SHOW_AXIS_LABELS_OPTIONS:["all","labels"],SHOW_TITLE_OPTIONS:["all","title"],HORIZONTAL:"horizontal",VERTICAL:"vertical",LAYOUTSETTINGS:{lasso:{displayOrder:1e4},rangeDim:{displayOrder:1e4},rangeMeasure:{displayOrder:1e4},rangeMinor:{displayOrder:1e4},scrollBar:{minimumLayoutMode:"SPARK",prioOrder:-1,displayOrder:100},refLines:{layout:{minimumLayoutMode:"SPARK",prioOrder:60,displayOrder:1110}},measureAxisTitle:{minimumLayoutMode:"XSMALL",prioOrder:30,displayOrder:90},dimensionAxisTitle:{minimumLayoutMode:"XSMALL",prioOrder:30,displayOrder:90},measureAxis:{minimumLayoutMode:"XSMALL",prioOrder:10,displayOrder:80},dimensionAxis:{minimumLayoutMode:"XSMALL",prioOrder:10,displayOrder:80},gridLines:{minimumLayoutMode:"XSMALL",displayOrder:-100},refLinesLabels:{minimumLayoutMode:"SMALL",prioOrder:60,displayOrder:0}}};qo.DEFAULT_CHART_ORIENTATION=qo.HORIZONTAL;function xo(e,t){const n=t||{},r=n.measureAxisProperties||{},i=n.dimensionAxisProperties||{},o=n.orientation||qo.DEFAULT_CHART_ORIENTATION,a=o===qo.HORIZONTAL,s=a?"x":"y",l=a?"y":"x",u=qo.SHOW_AXIS_LABELS_OPTIONS,c=qo.SHOW_TITLE_OPTIONS,p=u.includes(r.show),d=!!n.measureTitleText&&c.includes(r.show),f=n.includeDimensionAxis&&u.includes(i.show),h=n.includeDimensionAxis&&!!n.dimensionTitleText&&c.includes(i.show),m=n.gridlines&&!(!n.gridlines.auto&&0===n.gridlines.spacing),g=n.refLines&&n.refLines.some(e=>e.show),y=[];if(p&&function(e,t,n,r){let i={scale:"measure",settings:t.axisLabelStyle||{},forceBounds:r&&!r.autoMinMax&&r.showBounds};i=E(i,qo.LAYOUTSETTINGS.measureAxis);const o=So(t,n);e.addComponent(`${n}-axis`,i,o)}(e,n,s,r),d&&function(e,t,n){let r={text:t.measureTitleText,style:t.axisTitleStyle||{}};r=E(r,qo.LAYOUTSETTINGS.measureAxisTitle);const i=function(e,t){return So(e,t)}(t,n);e.addComponent(`${n}-axis-title`,r,i)}(e,n,s),function(e,t,n,r){let i=t.measureScaleSettings;const o={isRtl:t.isRtl,source:t.measureSource,orientation:n,measureAxisProperties:r};r&&r.spacing>0&&(i=E(!0,i||{},{component:{ticks:{distance:100*r.spacing}}}));e.addScale("measure-scale",i,o)}(e,n,o,r),f&&function(e,t,n){let r={scale:"dimension",settings:t.axisLabelStyle||{}};r=E(r,qo.LAYOUTSETTINGS.dimensionAxis);const i=Co(t,n);E(!0,r,t.dimensionAxisSettings||{}),e.addComponent(`${n}-axis`,r,i)}(e,n,l),h&&function(e,t,n){let r={text:t.dimensionTitleText,style:t.axisTitleStyle||{}};r=E(r,qo.LAYOUTSETTINGS.dimensionAxisTitle);const i=function(e,t){return Co(e,t)}(t,n);e.addComponent(`${n}-axis-title`,r,i)}(e,n,l),n.includeDimensionAxis&&function(e,t,n){const r={isRtl:t.isRtl,source:t.dimensionSource,orientation:n===qo.HORIZONTAL?qo.VERTICAL:qo.HORIZONTAL};e.addScale("dimension-scale",t.dimensionScaleSettings,r)}(e,n,o),m&&function(e,t,n){let r={ticks:{show:!0},minorTicks:{show:!t.auto&&!t.auto&&3===t.spacing}};r=E(r,qo.LAYOUTSETTINGS.gridLines),r[n]={scale:"measure"},e.addComponent("grid-line",r)}(e,n.gridlines,s),n.hasNavigation&&function(e,t,n,r){const i=e.getSettings();i.scroll={dimension:{viewSize:n.scrollSettings&&n.scrollSettings.viewSize||0,max:n.scrollSettings&&n.scrollSettings.max||0}};const o={isRtl:n.isRtl,chartID:n.chartID,isHorizontal:!r},a=E({},qo.LAYOUTSETTINGS.scrollBar);e.addComponent("scrollbar",a,o),Do(t,function(e){function t(t,n){if(!n||!e())return!1;const r={x:n.center.x-n.deltaX,y:n.center.y-n.deltaY};return this.chart.componentsFromPoint(r).some(e=>e.settings.key===lo)}const n={type:"Tap",options:{enable:t},events:{tap(e){this.chart.component(lo).emit("tap",e)}}},r={type:"Pan",options:{enable:t},events:{panstart(e){this.chart.component(lo).emit("panStart",e)},pan(e){this.chart.component(lo).emit("panMove",e)},panend(e){this.chart.component(lo).emit("panEnd",e)},pancancel(e){this.chart.component(lo).emit("panCancel",e)}}};return[n,r]}(n.isNavigationEnabledFn))}(e,y,n,a),g&&function(e,t,n,r){const i=po.getAxisDock(n,r.dock,t.isRtl);let o={key:"ref-line",style:{oob:{show:!1}},lines:{x:[],y:[]}};o=E(o,qo.LAYOUTSETTINGS.refLines);let a={key:`ref-line-labels-${so()}`,require:["renderer","chart"],dock:po.getOppositeAxisDock(n,r.dock,t.isRtl),preferredSize(){if("x"===n)return 26;const t=this.renderer.measureText,r=this.chart.formatter({data:e.settings.scales.measure.data}),i=a.lines.y.map(e=>{const n=!1!==e.label.showValue?`(${r(e.value)})`:"",i=`${e.label.text} ${n}`,o=e.label.text&&n?` ${n}`:n;return{wanted:t({text:i,fontSize:e.fontSize,fontFamily:e.fontFamily}).width,required:t({text:o,fontSize:e.fontSize,fontFamily:e.fontFamily}).width}}),o=i[0];for(let e=1;e<i.length;e++)i[e].wanted>o.wanted&&(o.wanted=i[e].wanted),i[e].required>o.required&&(o.required=i[e].required);const s=12;return o.required+s>100?o.required+s:Math.min(o.wanted+s,100)},lines:{x:[],y:[]}};a=E(a,qo.LAYOUTSETTINGS.refLinesLabels),t.refLines.forEach(r=>{if(!r.show)return;const s=r.refLineExpr&&r.refLineExpr.value,l=E(!0,{},t,{paletteColor:r.paletteColor,style:r.style,chartID:e.options.chartID}),u=vo.lineSettings({scale:"measure",dir:n,value:s},l);o.lines[n].push(u);const c=vo.lineLabelSettings({scale:"measure",value:s,label:{text:!1!==r.showLabel?r.label:"",showValue:!1!==r.showValue}},l);"x"===n?c.label.vAlign="near"===i?1:0:c.label.align="near"===i?0:1,a.lines[n].push(c)}),e.addComponent("ref-line",o,{}),e.addComponent("ref-line",a,{})}(e,n,s,r),n.enableLasso&&n.selectionsEnabled){!function(e,t){const n={brushKey:t.brushKey,brushComponents:t.brushComponents,brushData:t.brushData};e.addComponent("lasso",qo.LAYOUTSETTINGS.lasso,n)}(e,n.lasso||{})}if(n.enableDimRange&&n.includeDimensionAxis&&n.selectionsEnabled){!function(e,t,n,r,i){let o={key:"rangeDim"};o=E(o,qo.LAYOUTSETTINGS.rangeDim);const a={brushKey:t.brushKey,brushAxis:t.brushAxis,brushArea:t.brushArea,brushScale:t.brushScale,isHorizontal:!n,dock:r,isRtl:i};e.addComponent("range",o,a)}(e,n.dimRange||{},a,Co(n,l).dock,n.isRtl)}if(n.enableMeasureRange&&n.selectionsEnabled){!function(e,t,n,r,i){let o={key:"rangeMeasure"};o=E(o,qo.LAYOUTSETTINGS.rangeMeasure);const a={brushKey:t.brushKey,brushAxis:t.brushAxis,brushArea:t.brushArea,brushScale:t.brushScale,multiple:t.multiple,isHorizontal:n,dock:r,isRtl:i};e.addComponent("range",o,a)}(e,n.measureRange||{},a,So(n,s).dock,n.isRtl)}if(n.enableAreaRange&&n.selectionsEnabled){!function(e,t,n,r,i){let o={key:"rangeMinor"};o=E(o,qo.LAYOUTSETTINGS.rangeMinor);const a={brushKey:t.brushKey,brushAxis:t.brushAxis,brushData:t.brushData,brushArea:t.brushArea,brushComponents:t.brushComponents,brushScale:t.brushScale,multiple:t.multiple,isHorizontal:"measure"===t.brushScale?n:!n,dock:r,isRtl:i,chartInstance:t.chartInstance};e.addComponent("range-area",o,a)}(e,n.areaRange||{},a,Co(n,l).dock,n.isRtl)}n.brushActions&&Do(y,n.brushActions),y.length&&function(e,t){e.addInteraction({},{gestures:t})}(e,y)}function Do(e,t){t.forEach(t=>{e.push(t)})}function So(e,t){return{dock:e.measureAxisProperties&&e.measureAxisProperties.dock,direction:t,isRtl:e.isRtl}}function Co(e,t){return{dock:e.dimensionAxisProperties&&e.dimensionAxisProperties.dock,direction:t,isRtl:e.isRtl}}function Mo(e,t){const n=t||{},r=!n.orientation||"horizontal"===n.orientation,i=!!n.isRtl,o={name:n.name||"scale",component:{invert:r&&i,minorTicks:{count:1},range:n.range||void 0,domain:n.domain||void 0,trackBy:n.trackBy||"id"}};return E(!0,{},o,e||{})}function Eo(e){var t;if(null!=e&&null!==(t=e.isEnabled)&&void 0!==t&&t.call(e,"IM_5791_SVG_LABEL_RENDERING"))return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?void 0:"svg"}function Ao(e,t){const n=t&&t.chartID,r=t&&t.dock,i=t&&t.direction,o=t&&t.isRtl,a=t.theme.getStyle(n,"axis.line.major","color"),s=t.theme.getStyle(n,"axis.title","fontSize"),l=t.theme.getStyle(n,"axis.title","color"),u=t.theme.getStyle(n,"axis.label.name","color"),c=t.theme.getStyle(n,"axis.label.name","fontSize"),p=t.theme.getStyle(n,"axis.title","fontFamily"),d=t.theme.getStyle(n,"axis.label.name","fontFamily"),f={key:"axis",type:"axis",renderer:Eo(t.flags),dock:po.getAxisDock(i,r,o),brush:{trigger:[],consume:[]},settings:{title:{fontSize:s,fontFamily:p,fill:l},line:{show:!0,strokeWidth:1,stroke:a},labels:{fill:u,fontSize:c,fontFamily:d,tiltAngle:o?-40:40,maxEdgeBleed:75,maxSize:150,mode:"auto"},ticks:{stroke:a},minorTicks:{stroke:a}}},h=E(!0,{},f,e||{});return h.brush.consume.forEach(e=>{e.style.active.strokeWidth=0}),h}function Io(e,t){const n=t&&t.chartID,r=t&&t.dock,i=t&&t.direction,o=t&&t.isRtl,a=t.theme.getStyle(n,"axis.title","fontSize"),s=t.theme.getStyle(n,"axis.title","color"),l=t.theme.getStyle(n,"axis.title","fontFamily"),u={key:"text",type:"text",dock:po.getAxisDock(i,r,o)||"bottom",displayOrder:0,style:{text:{fontSize:a,fontFamily:l,fill:s}}};return E(!0,{},u,e||{})}Mo.measureScale=function(e,t){let n=(t||{}).source||[];"string"==typeof n&&(n=[n]);const r={name:"measure",component:{expand:.1,data:{fields:n.map(e=>({field:e}))}}},i=t&&t.measureAxisProperties;i&&!i.autoMinMax&&(["min","minMax"].includes(i.minMax)&&(r.component.min=i.min),["max","minMax"].includes(i.minMax)&&(r.component.max=i.max));const o=Mo(E(!0,r,e||{}),t);return!(e&&e.component&&void 0!==e.component.invert)&&t&&"vertical"===t.orientation&&(o.component.invert=!o.component.invert),o},Mo.dimensionScale=function(e,t){const n={name:"dimension",component:{trackBy:"id",type:"band",data:{extract:{field:t&&t.source||"",props:{label:e=>e.qText||""}}},label:e=>e.datum.label.value}};return Mo(E(!0,n,e||{}),t)},Ao.xAxis=function(e,t){return Ao(E(!0,{key:"x-axis",scale:"x"},e||{}),t)},Ao.yAxis=function(e,t){const n=t&&t.dock,r=t&&t.isRtl,i={key:"y-axis",scale:"y",dock:po.getYAxisDock(n,r)};return Ao(E(!0,i,e||{}),t)},Io.xAxisTitle=function(e,t){return Io(E(!0,{key:"x-axis-title"},e||{}),t)},Io.yAxisTitle=function(e,t){const n=t&&t.dock,r=t&&t.isRtl,i={key:"y-axis-title",dock:po.getYAxisDock(n,r)||"left"};return Io(E(!0,i,e||{}),t)};var wo={getBublesAlign:function(e,t,n){let r=e&&"far"!==t||!e&&"far"===t;return!e&&n&&(r=!r),r?"start":"end"},getDock:function(e,t){const n=[];let r;return e&&n.push(`@${e}`),t&&n.push(`@${t}`),n.length&&(r=n.join(",")),r}};const Oo={SPARK:{width:0,height:0},XSMALL:{width:150,height:75},SMALL:{width:300,height:150},MEDIUM:{width:400,height:220},FULL:{width:550,height:450}};function To(){return Oo}function ko(e){const t=e.data.end;return e.dataset(t.source.key).field(t.source.field).formatter()(t.value)}To.getLayoutModeKeys=function(){const e=[];let t;for(t in Oo)e.push(t);return e};const No={left:"left",right:"right",up:"top",down:"bottom"};function Lo(e,t,n){switch(e){case"scale":return Mo(t,n);case"measure-scale":return Mo.measureScale(t,n);case"dimension-scale":return Mo.dimensionScale(t,n);case"axis":return Ao(t,n);case"box-marker":return function(e){return E(!0,{},{key:"box-marker",type:"box-marker",settings:{minor:{scale:"x"},orientation:"horizontal"},brush:{trigger:[],consume:[]}},e||{})}(t);case"point-marker":return function(e){return E(!0,{},{key:"point-marker",type:"point-marker",settings:{},brush:{trigger:[],consume:[]}},e||{})}(t);case"scrollbar":return function(e,t){const n=t&&t.isRtl,r=t&&t.chartID,i=t&&t.isHorizontal,o={key:"scrollbar",type:"scrollbar",scroll:"dimension",dock:i?"bottom":n?"left":"right",settings:{backgroundColor:t.theme.getStyle(r,"","backgroundColor"),invert:n&&i}};return E(!0,{},o,e||{})}(t,n);case"text":return Io(t,n);case"lasso":return function(e,t){const n=t&&t.brushKey,r=t&&t.brushComponents?t.brushComponents:[],i=t&&t.brushData?t.brushData:["elemNo"],o={type:"brush-lasso",key:"lasso",displayOrder:99,settings:{brush:{components:[]},lasso:{fill:"rgba(0, 0, 0, 0)",stroke:"rgba(102,102,102,1)",strokeWidth:2,opacity:1,strokeDasharray:null},startPoint:{r:10,fill:"rgba(0, 152, 69, 1)",strokeWidth:0,opacity:1}}};return r.forEach(e=>{o.settings.brush.components.push({contexts:n?[n]:void 0,key:e,data:i})}),E(!0,{},o,e||{})}(t,n);case"range":return function(e,t){const n=t&&t.brushKey,r=t&&t.brushAxis,i=t&&t.brushArea,o=t&&t.brushScale,a=t&&t.isHorizontal,s=t&&t.dock,l=t&&t.isRtl,u={type:"brush-range",key:"range",displayOrder:99,dock:wo.getDock(r,i),settings:{brush:n,fill:"rgba(0, 0, 0, 0)",scale:o,multiple:!t||!1!==t.multiple||t.multiple,direction:a?"horizontal":"vertical",target:{component:r,fill:"rgba( 82, 204, 82, 0.2 )",fillActive:"rgba(82, 204, 82, 0.4)"},bubbles:{align:wo.getBublesAlign(a,s,l)}}};return E(!0,{},u,e||{})}(t,n);case"range-area":return function(e,t){const n=t&&t.brushKey,r=t&&t.brushAxis,i=t&&t.brushComponents?t.brushComponents:[],o=t&&t.brushData?t.brushData:["elemNo"],a=t&&t.brushArea,s=t&&t.isHorizontal,l=t&&t.dock,u=t&&t.isRtl,c=t&&t.chartInstance;let p=!0;const d={type:"brush-area-dir",key:"area",displayOrder:99,dock:wo.getDock(r,a),settings:{brush:{components:[]},direction:s?"horizontal":"vertical",target:{component:r,fill:"rgba( 82, 204, 82, 0.2 )",fillActive:"rgba(82, 204, 82, 0.4)"},bubbles:{align:wo.getBublesAlign(s,l,u),label:e=>p?(p=!1,c.dataset(e.binStart.source.key).field(e.binStart.source.field).formatter()(e.binStart.value)):(p=!0,c.dataset(e.binEnd.source.key).field(e.binEnd.source.field).formatter()(e.binEnd.value))},multiple:!t||!1!==t.multiple||t.multiple}};return i.forEach(e=>{d.settings.brush.components.push({contexts:n?[n]:void 0,key:e,data:o,action:"add"})}),E(!0,{},d,e||{})}(t,n);case"categorical-legend":return function(e,t){const n=t&&t.chartID,r=t&&t.isRtl;let i=t&&t.dock||"auto";const o=t&&t.show;"auto"===i&&(i=t.chartHeight/t.chartWidth<1?r?"left":"right":"bottom");const a=t.theme.getStyle(n,"legend.title","color"),s=t.theme.getStyle(n,"legend.title","fontSize"),l=t.theme.getStyle(n,"legend.label","color"),u=t.theme.getStyle(n,"legend.label","fontSize"),c=t.theme.getStyle(n,"legend.title","fontFamily"),p=t.theme.getStyle(n,"legend.label","fontFamily"),d={key:"legend",type:"legend-cat",renderer:Eo(t.flags),dock:i,show:o,scale:{type:"color"},settings:{title:{anchor:"middle"},layout:{direction:r?"rtl":"ltr",size:"top"===i||"bottom"===i?2:1,vertical:"top"===i||"bottom"===i?16:8},navigation:{button:{class:{"lui-fade-button":!0},content:(e,t)=>e("span",{style:{pointerEvents:"none"},class:["lui-button__icon","lui-icon",`lui-icon--triangle-${No[t.direction]}`].join(" ")})}}},style:{item:{label:{fontSize:u,fontFamily:p,fill:l,lineHeight:1,wordBreak:"break-word"},margin:{top:5,left:10,right:10,bottom:10},shape:{type:t.type?t.type:"square",size:3*parseInt(u,10)/4}},title:{show:t.showTitle,fontSize:s,fontFamily:c,fill:a}}};return E(!0,{},d,e)}(t,n);case"sequential-legend":return function(e,t){const n=t&&t.chartID,r=t&&t.isRtl;let i=t.dock||"auto";"auto"===i&&(i=t.chartHeight<t.chartWidth?r?"left":"right":"bottom");const o=t.theme.getStyle(n,"legend.title","color"),a=t.theme.getStyle(n,"legend.title","fontSize"),s=t.theme.getStyle(n,"legend.title","fontFamily"),l=t.theme.getStyle(n,"legend.label","color"),u=t.theme.getStyle(n,"legend.label","fontSize"),c=t.theme.getStyle(n,"legend.label","fontFamily");function p(e){switch(e){case"left":return 0;case"right":return 1;default:return.5}}const d={key:"seqlegend",type:"legend-seq",dock:i,displayOrder:200,minimumLayoutMode:"MEDIUM",prioOrder:0,settings:{align:p(r?"right":"left"),major:{invert:"left"===i||"right"===i||r},title:{show:t.showTitle,fontSize:a,fontFamily:s,fill:o},tick:{fill:l,fontSize:u,fontFamily:c}}};return E(!0,{},d,e)}(t,n);case"x-axis":return Ao.xAxis(t,n);case"y-axis":return Ao.yAxis(t,n);case"x-axis-title":return Io.xAxisTitle(t,n);case"y-axis-title":return Io.yAxisTitle(t,n);case"grid-line":return function(e,t){const n=t&&t.chartID,r=t.theme.getStyle(n,"grid.line.major","color");return E(!0,{},{displayOrder:-1,key:"grid-line",type:"grid-line",x:null,y:null,ticks:{stroke:r},minorTicks:{stroke:r}},e||{})}(t,n);case"interaction":return function(e,t){const n=t&&t.gestures||[];return E(!0,{},{type:"hammer",key:"hammered",gestures:n},e||{})}(t,n);case"ref-line":return function(e,t){const n=t&&t.chartID,r=t.theme.getStyle(n,"referenceLine.outOfBounds","color"),i=t.theme.getStyle(n,"referenceLine.outOfBounds","backgroundColor");return E(!0,{},{key:"ref-line",type:"ref-line",dock:"center",prioOrder:-1,lines:{x:[],y:[]},style:{oob:{width:7,fill:i,text:{fill:r},padding:{x:7,y:5}}}},e||{})}(t,n);case"event-area":return function(e){return E(!0,{},{type:"event-area",key:"event-area"},e||{})}(t);case"labels":return function(e,t){const n=t&&t.chartID,r=t.theme.getStyle(n,"label.value","color"),i=t.theme.getStyle(n,"label.value","fontSize"),o=t.theme.getStyle(n,"label.value","fontFamily"),a={key:"labels",type:"labels",renderer:Eo(t.flags),displayOrder:1,settings:{sources:[{component:"box-marker",selector:"rect",strategy:{type:"bar",settings:{direction:"up",fontFamily:o,fontSize:parseFloat(i),align:.5,labels:[{placements:[{position:"outside",fill:r,justify:0},{position:"inside",fill:e&&e.settings.sources[0].strategy.settings.labels[0].placements[1].fill,justify:1}],label:ko}]}}}]}};return E(!0,{},a,e||{})}(t,n);default:return}}function Po(e){this.options=e||{},this.settings={dockLayout:{layoutModes:To()},components:[],scales:{}}}Po.prototype.addComponent=function(e,t,n){const r=Lo(e,t,E(!0,{},this.options,n||{}));return this.settings.components.push(r),r},Po.prototype.addInteraction=function(e,t){const n=Lo("interaction",e,E(!0,{},this.options,t||{}));return this.settings.interactions||(this.settings.interactions=[]),this.settings.interactions.push(n),n},Po.prototype.addScale=function(e,t,n){const r=Lo(e,t,E(!0,{},this.options,n||{}));this.settings.scales[r.name]=r.component},Po.prototype.getSettings=function(){return this.settings},Po.prototype.getComponent=function(e){return this.settings.components.filter(t=>t.key===e)[0]},Po.prototype.addPreset=function(e,t){!function(e,t,n){if("dimension-measure-chart"!==e)throw Error("There is no chart preset with that type");xo(t,n)}(e,this,t)},Po.validateComponentKeys=function(e){const t={};return e.map(e=>{const n=e.key;return n?t[n]?`Duplicate key for component ${e.type}`:(t[n]=!0,null):`Missing key for component ${e.type}`}).filter(e=>!!e)},Po.create=function(e){return new Po(e)},Po.createComponent=Lo;const _o={CENTER:0,BOTTOM:1};var Ro={DISCLAIMERS:[{label:"NoDataExist",alignment:_o.CENTER,default:!0},{label:"RequireNumericDimension",alignment:_o.CENTER,default:!1},{label:"OnlyNanData",alignment:_o.CENTER,default:!0},{label:"OnlyNegativeOrZeroValues",alignment:_o.CENTER,default:!1},{label:"LimitedData",alignment:_o.BOTTOM,default:!1},{label:"OnlyNanColor",alignment:_o.BOTTOM,default:!1},{label:"NegativeOrZeroValues",alignment:_o.BOTTOM,default:!1},{label:"DataRangeIncludingZero",alignment:_o.BOTTOM,default:!1}],ALIGNMENT:_o};const Ho={getNoDataExistAttribute:e=>e.qSize.qcy*e.qSize.qcx===0,getLimitedDataAttribute(e,t){let n,r=!1;var i;return e?void 0!==t.explicitLimitedData?r=!0===t.explicitLimitedData:e.qDataPages&&e.qDataPages[0]?r=!t.paging&&e.qSize.qcy>e.qDataPages[0].qMatrix.length:(i=e.qStackedDataPages)&&i[0]&&i[0].qData[0]&&i[0].qData[0].qSubNodes&&(n=t.maxNbrOfDimensions?t.maxNbrOfDimensions:2,r=e.qDimensionInfo.length>=n?e.qStackedDataPages[0].qData[0].qSubNodes.some(e=>e.qDown>0):e.qStackedDataPages[0].qData[0].qSubNodes.length<e.qStackedDataPages[0].qArea.qHeight):r=!0===t.explicitLimitedData,r},getNegativeOrZeroValuesAttribute:(e,t)=>!t.supportNegative&&e.qMeasureInfo.some(e=>e.qMin<=0),getOnlyNegativeOrZeroValuesAttribute:(e,t)=>!t.supportNegative&&e.qMeasureInfo.every(e=>e.qMax<=0&&e.qMax>=e.qMin)||0===e.qSize.qcy,getOnlyNanDataAttribute:(e,t)=>void 0!==t.explicitOnlyNanData?t.explicitOnlyNanData:e.qMeasureInfo.every(e=>e.qMax<e.qMin||"NaN"===e.qMax),getDataRangeIncludingZeroAttribute:(e,t)=>!t.supportRangeOverZero&&function(e,t){const n=t.length;let r,i,o,a,s;for(e&&(i=!(e.autoMinMax||"min"!==e.minMax&&"minMax"!==e.minMax||null===e.min||Number.isNaN(+e.min)),o=!(e.autoMinMax||"max"!==e.minMax&&"minMax"!==e.minMax||null===e.max||Number.isNaN(+e.max))),a=Number.MAX_VALUE,s=-Number.MAX_VALUE,r=0;r<n;r++)if(a=Math.min(a,t[r].qMin),s=Math.max(s,t[r].qMax),a<=0&&s>=0)return!0;return a=i?e.min:a,s=o?e.max:s,a<=0&&s>=0}(e.measureAxis,e.qHyperCube.qMeasureInfo),applyAttributes(e,t){const n=e||{},r={};return n.supportNegative=void 0===n.supportNegative||n.supportNegative,n.supportRangeOverZero=void 0===n.supportRangeOverZero||n.supportRangeOverZero,Ro.DISCLAIMERS.forEach(e=>{r[e.label]=!1}),t&&t.qHyperCube?(r.NoDataExist=this.getNoDataExistAttribute(t.qHyperCube),r.NoDataExist?r:(r.RequireNumericDimension=n.explicitRequireNumericDimension,r.RequireNumericDimension||(r.LimitedData=this.getLimitedDataAttribute(t.qHyperCube,n),r.NegativeOrZeroValues=this.getNegativeOrZeroValuesAttribute(t.qHyperCube,n),r.OnlyNegativeOrZeroValues=this.getOnlyNegativeOrZeroValuesAttribute(t.qHyperCube,n),r.OnlyNanData=this.getOnlyNanDataAttribute(t.qHyperCube,n),r.DataRangeIncludingZero=this.getDataRangeIncludingZeroAttribute(t,n)),r)):r}};function Fo(e,t,n){this.disclaimersConfig=e,this.dataAttributes=t,this.supportedDisclaimers=n}function Bo(e,t){return e&&t&&t[e]}function Vo(e){this.environment=e,this.clear()}Fo.prototype.isValidAndSupported=function(e,t){return Bo(e.label,this.dataAttributes)&&(e.default||Bo(e.label,this.supportedDisclaimers))&&void 0!==t&&e.alignment===t},Fo.prototype.isAnyValidDisclaimer=function(e){let t=!1;const n=this;return this.disclaimersConfig.forEach(r=>{n.isValidAndSupported(r,e)&&(t=!0)}),t},Fo.prototype.getMessage=function(e,t){let n="";const r=this;return t&&this.disclaimersConfig.forEach(i=>{r.isValidAndSupported(i,e)&&(n+=`${t.get(`Object.Disclaimer.${i.label}`)} `)}),n},Vo.ERRORS={SET:"Calling Disclaimer.set() without attributes",DISPLAY:"Calling Disclaimer.display() before attributes are applied"},Vo._applyDefaultSupport=function(e,t){let n=e;return n||(n={}),t.forEach(e=>{void 0===n[e.label]&&(n[e.label]=e.default)}),n},Vo.prototype.getComponentSettings=function(){var e;const{translator:t}=this.environment,n=E(!0,{},this.vizAttributes.supportedDisclaimers),r=new Fo(Ro.DISCLAIMERS,this.dataAttributes,n);let i,o;if(r.isAnyValidDisclaimer(Ro.ALIGNMENT.CENTER))i=r.getMessage(Ro.ALIGNMENT.CENTER,t),o="center";else{if(!r.isAnyValidDisclaimer(Ro.ALIGNMENT.BOTTOM))return;i=r.getMessage(Ro.ALIGNMENT.BOTTOM,t),o="bottom"}return{key:"disclaimer",type:"disclaimer",layout:{displayOrder:1e3,dock:o},settings:{label:i,rtl:"rtl"===(null===(e=this.environment)||void 0===e||null===(e=e.options)||void 0===e?void 0:e.direction)}}},Vo.prototype.set=function(e){if(this.clear(),!e)throw new Error(Vo.ERRORS.SET);this.vizAttributes=e,this.dataAttributes=Ho.applyAttributes(this.vizAttributes.options,this.vizAttributes.data)},Vo.prototype.clear=function(){this.vizAttributes=null,this.dataAttributes=null};const zo=Ze.extend({init(e,t,n,r,i){this.$element=t,this.environment=n,this.backendApi=r,this._selectionsApi=i,this._on=!1,this._disclaimer=new Vo(n),this._dataPaths=["qHyperCube"];const o=this;this.picassoElement=t[0],this.picassoElement.className+=" picasso-chart",this.chartInstance=e.chart({element:this.picassoElement,settings:{components:[Po.createComponent("event-area",{mounted(e){o.dataAreaElem=e}})]}})},updateEnvironment(e){this.environment=e},isRtl(){var e;return"rtl"===(null===(e=this.environment.options)||void 0===e?void 0:e.direction)},setDataPaths(e){this._dataPaths=e},getData:(e,t,n)=>function(e,t,n){let r,i={qTop:0,qLeft:0,qWidth:t.qSize.qcx,qHeight:1e4/t.qSize.qcx};if(n){const e=n.width||t.qSize.qcx,r=Math.floor(1e4/e);i={qTop:n.top||0,qLeft:n.left||0,qWidth:e,qHeight:n.height?Math.min(n.height,r):r}}else i={qTop:0,qLeft:0,qWidth:t.qSize.qcx,qHeight:1e4/t.qSize.qcx};r="K"===t.qMode?"qStackedDataPages":"qDataPages";return e.getData([i],null,t).then(e=>{t[r]=e})}(e,t,n),hasValidData:()=>!0,paint(){if(this.hasValidData()){var e;this._disclaimer.set(this.getDisclaimerAttributes(this.layout));const t=this._disclaimer.getComponentSettings(),n="center"===(null==t||null===(e=t.layout)||void 0===e?void 0:e.dock),r=this.createChartSettings(this.layout);n?r.components=[t]:t&&r.components.push(t),Po.validateComponentKeys(r.components).forEach(e=>{console.error(e)}),this.updateChart(this.layout,r),this._painted=!0}return Promise.resolve()},resize(){if(this.layout)return this.paint()},createChartSettings(){throw new Error('Subclass must implement "createChartSettings" function')},addSnapshotChartSettings(e,t){const{freeResize:n}=this.environment.options;!n&&t.snapshotData&&(e.dockLayout.logicalSize={width:t.snapshotData.content.size.w,height:t.snapshotData.content.size.h,preserveAspectRatio:!0})},updateData(e){return this._destroyed?Promise.reject():(this.layout=E(!0,{},e),this.layout.permissions=e.permissions,Promise.resolve())},updateChart(e,t,n){var r,i;const o=null!==(r=null===(i=this.environment.appLayout)||void 0===i?void 0:i.qLocaleInfo)&&void 0!==r?r:{},a=this._dataPaths.map(t=>({type:"q",key:t,config:{localeInfo:o},data:Ue(e,t.replace(/\//g,"."))}));this.colorService&&a.push(...this.colorService.getData()),this.chartInstance.update({data:a,settings:t,partialData:n});this.picassoElement.setAttribute("data-state",2)},destroy(){this._destroyed=!0,this.off(),this.chartInstance.destroy()},getViewState:()=>({}),isLassoDisabled:()=>!0,setSnapshotData(e){e.snapshotData||(e.snapshotData={}),e.snapshotData.content={chartData:{},size:{w:this.$element.width(),h:this.$element.height()}}},getDisclaimerAttributes:e=>({data:e})});function jo(e){let t=0;if(!e||!e.length)return t;for(let n=0;n<e.length;n++){t=(t<<5)-t+e.charCodeAt(n),t&=t}return t}const $o={generateHash:function(e){return jo(JSON.stringify(e))},updateHash:function(e,t){e.qUndoExclude||(e.qUndoExclude={});e.qUndoExclude.hashCode=$o.generateHash(t)}};const Uo={getDefaultHashDataForHyperCube:function(e,t,n){return function(e,t){const n=[];if(!e.qMeasures)return Promise.resolve(n);return e.qMeasures.forEach(e=>{e.qLibraryId?n.push(function(e,t){return t.getMeasure(e).then(e=>e.getProperties().then(e=>e.qMeasure.qDef))}(e.qLibraryId,t)):n.push(Promise.resolve())}),Promise.all(n)}(e,n).then(e=>({drillLevel:Ko(t),dimensionExpressions:Wo(t),measureExpressions:e}))}};function Wo(e){return e.qDimensionInfo.map(e=>e.qGroupFieldDefs)}function Ko(e){const t=function(e){return Ue(e,"qDimensionInfo",[])}(e);return t.map(e=>e.qGroupPos)}const Yo={},Go=E.bind(null,!0);function Xo(e){return null!=e&&!Array.isArray(e)&&"object"==typeof e}const Jo=Array.isArray,Zo=function(e){return void 0===e};function Qo(e,t){return"function"==typeof e[t]||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function ea(e,t){const n=t.substring(1).split("/").slice(0,-1);let r;return n.forEach((t,i)=>{i!==n.length&&(r=+t,e[r||t]=Zo(e[r||t])?Number.isNaN(+r)?{}:[]:e[t],e=e[r||t])}),e}function ta(e,t){if(Xo(e)&&Xo(t)){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n of Object.keys(e))if(!ta(e[n],t[n]))return!1;return!0}if(Jo(e)&&Jo(t)){if(e.length!==t.length)return!1;for(let n=0,r=e.length;n<r;n++)if(!ta(e[n],t[n]))return!1;return!0}return e===t}Yo.generate=function(e,t,n){n=n||"";let r=[];return Object.keys(t).forEach(i=>{const o=function(e){return e&&(e=Go({},{val:e}).val),e}(t[i]),a=e[i],s=`${n}/${i}`;ta(o,a)||Qo(t,i)||(Zo(a)?r.push({op:"add",path:s,value:o}):Xo(o)&&Xo(a)?r=r.concat(Yo.generate(a,o,s)):Jo(o)&&Jo(a)?r=r.concat(function(e,t,n){let r=[];const i=e.slice();let o,a,s=-1;function l(e,t,n){if(e[n]&&Zo(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++)if(e[n]&&e[n].qInfo.qId===t)return n;return-1}if(ta(t,i))return r;if(null===t[0]||!Zo(t[0])&&Zo(t[0].qInfo))return r.push({op:"replace",path:n,value:t}),r;for(o=i.length-1;o>=0;--o)s=l(t,i[o]&&i[o].qInfo&&i[o].qInfo.qId,o),-1===s?(r.push({op:"remove",path:`${n}/${o}`}),i.splice(o,1)):r=r.concat(Yo.generate(i[o],t[s],`${n}/${o}`));for(o=0,a=t.length;o<a;++o)s=l(i,t[o]&&t[o].qInfo&&t[o].qInfo.qId),-1===s?(r.push({op:"add",path:`${n}/${o}`,value:t[o]}),i.splice(o,0,t[o])):s!==o&&(r.push({op:"move",path:`${n}/${o}`,from:`${n}/${s}`}),i.splice(o,0,i.splice(s,1)[0]));return r}(a,o,s)):r.push({op:"replace",path:`${n}/${i}`,value:o}))}),Object.keys(e).forEach(i=>{Zo(t[i])&&!Qo(e,i)&&r.push({op:"remove",path:`${n}/${i}`})}),r},Yo.apply=function(e,t){t.forEach(t=>{const n=ea(e,t.path);let r=t.path.split("/").splice(-1)[0];const i=r&&Number.isNaN(+r)?n[r]:n[+r]||n,o=t.from?t.from.split("/").splice(-1)[0]:null;if("add"===t.op||"replace"===t.op)if(Jo(n))"-"===r&&(r=n.length),n.splice(+r,"add"===t.op?0:1,t.value);else if(Jo(i)&&Jo(t.value)){const e=t.value.slice();i.length=0,i.push.apply(i,e)}else Xo(i)&&Xo(t.value)?(a=i,Object.keys(a).forEach(e=>{Object.getOwnPropertyDescriptor(a,e).configurable&&!Qo(a,e)&&delete a[e]}),Go(i,t.value)):n[r]=t.value;else if("move"===t.op){const i=ea(e,t.from);Jo(n)?n.splice(+r,0,i.splice(+o,1)[0]):(n[r]=i[o],delete i[o])}else"remove"===t.op&&(Jo(n)?n.splice(+r,1):delete n[r]);var a})},Yo.clone=function(e){return Go({},e)},Yo.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},Yo.updateObject=function(e,t){Object.keys(e).length?Yo.apply(e,Yo.generate(e,t)):Go(e,t)};class na{constructor(e){this._model=e}setModel(e){this._model=e}saveSoftProperties(e,t){if(!this._model)return Promise.resolve(!1);let n=Yo.generate(e,t);return E(!0,e,t),n&&n.length?(n=n.map(e=>({qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path})),this._model.applyPatches(n,!0).then(()=>!0)):Promise.resolve(!1)}async mergeSoftPatches(){if(!this._model)return;const e=this._model.getProperties(),t=this._model.getEffectiveProperties(),n=await e,r=await t;if(n.qExtendsId)return;const i=Yo.generate(n,r);Yo.apply(n,i);const o=this;o._model.setProperties(n).then(()=>{o._model.clearSoftPatches()})}}var ra={canModifyHardProperties:function(e){if(e.qHasSoftPatches||e.qExtendsId)return!1;if(e.permissions)return e.permissions.update;return-1!==e.qMeta.privileges.indexOf("update")}};var ia={saveDerivedProperties:function(e,t,n,r){if(ra.canModifyHardProperties(t))return e.setProperties(n);return new na(e).saveSoftProperties(r,n)}};var oa={validate:function(e){if(!(e&&e.layout&&e.properties&&e.model&&e.hashData&&e.generateDerivedProperties))throw Error("Derived-properties: Missing input")}};function aa(){this._generationInProgress=!1}function sa(e){oa.validate(e);const t=e.properties,n=$o.generateHash(e.hashData);return!(!t.qUndoExclude||t.qUndoExclude.hashCode!==n)}aa.prototype.isDerivedUpToDate=sa,aa.prototype.updateDerivedProperties=function(e){if(oa.validate(e),this._generationInProgress)return Promise.resolve(!0);if(sa(e)){const t=e.layout.qUndoExclude&&e.layout.qUndoExclude.hashCode===e.properties.qUndoExclude.hashCode;return Promise.resolve(!t)}const t=this,n=e.model,r=e.layout,i=E(!0,{},e.properties),o=E(!0,{},i);return this._generationInProgress=!0,$o.updateHash(i,e.hashData),e.generateDerivedProperties(r,i).then(()=>ia.saveDerivedProperties(n,r,i,o).then(()=>(t._generationInProgress=!1,Promise.resolve(!0))))},aa.prototype.addDefaultHyperCubeHash=function(e,t,n,r){return Uo.getDefaultHashDataForHyperCube(e,t,n).then(e=>E(!0,r,e))};var la,ua={exports:{}};var ca=(la||(la=1,ua.exports=function(){function e(e,t,n){return(t=i(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function t(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 n(n){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?t(Object(i),!0).forEach(function(t){e(n,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):t(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))})}return n}function r(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function i(e){var t=r(e,"string");return"symbol"==typeof t?t:t+""}var o=Object.prototype.hasOwnProperty,a=Object.prototype.toString,s=Object.defineProperty,l=Object.getOwnPropertyDescriptor,u=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===a.call(e)},c=function(e){if(!e||"[object Object]"!==a.call(e))return!1;var t,n=o.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&o.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||o.call(e,t)},p=function(e,t){s&&"__proto__"===t.name?s(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},d=function(e,t){if("__proto__"===t){if(!o.call(e,t))return;if(l)return l(e,t).value}return e[t]},f=function e(){var t,n,r,i,o,a,s=arguments[0],l=1,f=arguments.length,h=!1;for("boolean"==typeof s&&(h=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l<f;++l)if(null!=(t=arguments[l]))for(n in t)r=d(s,n),s!==(i=d(t,n))&&(h&&i&&(c(i)||(o=u(i)))?(o?(o=!1,a=r&&u(r)?r:[]):a=r&&c(r)?r:{},p(s,{name:n,newValue:e(h,a,i)})):void 0!==i&&p(s,{name:n,newValue:i}));return s};function h(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 m(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 g(e){let{cache:t,f:n,mainCell:r,p:i,page:o,rowIdx:a,row:s,sourceKey:l,target:u,targetProp:c,columnOrder:p}=e,d=r;if(i.field&&i.field!==n){const e=h(i.field,o,{cache:t},p);if(-1===e)return;d=f({qRow:a},e(s))}u[c]=m(i,d,{key:l})}function y(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),p=Object.keys(u),d=!!i[e].trackBy,y=typeof i[e].trackBy,b={},v=[],q=[];for(let t=0;t<a.qDataPages.length;t++){const o=h(l,a.qDataPages[t],{cache:n},a.qColumnOrder);if(-1!==o)for(let h=0;h<a.qDataPages[t].qMatrix.length;h++){const x=a.qDataPages[t].qArea.qTop+h,D=f({qRow:x},o(a.qDataPages[t].qMatrix[h])),S=m(c,D,{key:s});if(!c.filter||c.filter(D)){for(let e=0;e<p.length;e++){const r=u[p[e]];let i=r.fields||[r];r.fields&&(S[p[e]]=[]);for(let o=0;o<i.length;o++)g({cache:n,f:l,mainCell:D,p:i[o],prop:p[e],page:a.qDataPages[t],rowIdx:x,row:a.qDataPages[t].qMatrix[h],sourceKey:s,target:r.fields?S[p[e]]:S,targetProp:r.fields?o:p[e],columnOrder:a.qColumnOrder});if(r.fields){const t=S[p[e]].map(e=>e.value),n=S[p[e]].map(e=>e.label);S[p[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(S[p[e]].value)}}}d&&r.track({cfg:i[e],itemData:D,obj:S,target:v,tracker:b,trackType:y}),q.push(S)}}}const x=d?r.collect(v,{main:c,propsArr:p,props:u}):q;o=[...o,...x]}return o}function b(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 v(){return this.eachAfter(b)}function q(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this}function x(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}function D(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}function S(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r}function C(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})}function M(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function E(e){for(var t=this,n=A(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}function A(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}function I(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function w(){return Array.from(this)}function O(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function T(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*k(){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)}function N(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=_)):void 0===t&&(t=P);for(var n,r,i,o,a,s=new F(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 F(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(H)}function L(){return N(this).eachBefore(R)}function P(e){return e.children}function _(e){return Array.isArray(e)?e[1]:null}function R(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function H(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function F(e){this.data=e,this.depth=this.height=0,this.parent=null}function B(e){return null==e?null:V(e)}function V(e){if("function"!=typeof e)throw new Error;return e}F.prototype=N.prototype={constructor:F,count:v,each:q,eachAfter:D,eachBefore:x,find:S,sum:C,sort:M,path:E,ancestors:I,descendants:w,leaves:O,links:T,copy:L,[Symbol.iterator]:k};var z={depth:-1},j={},$={};function U(e){return e.id}function W(e){return e.parentId}function K(){var e,t=U,n=W;function r(r){var i,o,a,s,l,u,c,p,d=Array.from(r),f=t,h=n,m=new Map;if(null!=e){const t=d.map((t,n)=>Y(e(t,n,r))),n=t.map(G),i=new Set(t).add("");for(const e of n)i.has(e)||(i.add(e),t.push(e),n.push(G(e)),d.push($));f=(e,n)=>t[n],h=(e,t)=>n[t]}for(a=0,i=d.length;a<i;++a)o=d[a],u=d[a]=new F(o),null!=(c=f(o,a,r))&&(c+="")&&(p=u.id=c,m.set(p,m.has(p)?j:u)),null!=(c=h(o,a,r))&&(c+="")&&(u.parent=c);for(a=0;a<i;++a)if(c=(u=d[a]).parent){if(!(l=m.get(c)))throw new Error("missing: "+c);if(l===j)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===$&&1===s.children.length;)s=s.children[0],--i;for(let e=d.length-1;e>=0&&(u=d[e]).data===$;--e)u.data=null}if(s.parent=z,s.eachBefore(function(e){e.depth=e.parent.depth+1,--i}).eachBefore(H),s.parent=null,i>0)throw new Error("cycle");return s}return r.id=function(e){return arguments.length?(t=B(e),r):t},r.parentId=function(e){return arguments.length?(n=B(e),r):n},r.path=function(t){return arguments.length?(e=B(t),r):e},r}function Y(e){let t=(e=`${e}`).length;return X(e,t-1)&&!X(e,t-2)&&(e=e.slice(0,-1)),"/"===e[0]?e:`/${e}`}function G(e){let t=e.length;if(t<2)return"";for(;--t>1&&!X(e,t););return e.slice(0,t)}function X(e,t){if("/"===e[t]){let n=0;for(;t>0&&"\\"===e[--t];)++n;if(!(1&n))return!0}return!1}function J(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=J(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]=J(r,i[e]);return t}n[e]in i&&(i=i[n[e]])}return i}function Z(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,...Z(e[i].children,t-1,n)]);return r}function Q(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=>Z(e.children,r-1,n)}return!1}function ee(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))}const te=/^qDimensionInfo(?:\/(\d+))?/,ne=/^\/?qMeasureInfo\/(\d+)/,re=/\/qAttrExprInfo\/(\d+)/,ie=/\/qAttrDimInfo\/(\d+)/;function oe(e){const t=e.raw().qColumnOrder,n=e.fields();return t&&t.length===n.length?t:n.map((e,t)=>t)}function ae(e){return(e.qColumnOrder&&e.qColumnOrder.length?e.qColumnOrder:e.qDimensionInfo.map((e,t)=>t)).filter(t=>t<e.qDimensionInfo.length)}function se(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,p=r;const d=n.qEffectiveInterColumnSortOrder,f=ae(n);return te.test(p)&&(i=!0,o=+te.exec(p)[1],p=r.replace(te,"")),ne.test(p)&&("K"===n.qMode?u=+ne.exec(p)[1]:d&&-1!==d.indexOf(-1)?(u=+ne.exec(p)[1],c=0):c=+ne.exec(p)[1],p=p.replace(ne,"")),p&&(ie.exec(p)?s=+ie.exec(p)[1]:re.exec(p)&&(a=+re.exec(p)[1])),l=i?"S"===n.qMode?f[o]:d?d.indexOf(o):o:d&&-1!==d.indexOf(-1)?d.indexOf(-1):n.qDimensionInfo.length-("K"===n.qMode?0:1),{fieldDepth:l+1,pseudoMeasureIndex:u,measureIdx:c,attrDimIdx:s,attrIdx:a}}function le(e,t){let n,r,i=Q(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 ue(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 ce(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 p=l[n];let d,f,h,m,g,y;if("primitive"===p.type?(h=p.value,y=String(p.value)):("function"==typeof p.value&&(d=e=>p.value(e,r)),"function"==typeof p.label&&(f=e=>p.label(e,r)),p.accessor?(m=p.accessor(r),Array.isArray(m)?(g=m.map(p.valueAccessor),p.attrAccessor&&(g=g.map(p.attrAccessor)),d&&(h=g.map(d),d=null),f&&(y=g.map(f),f=null),h=p.reduce?p.reduce(h):h,y=p.reduceLabel?p.reduceLabel(y,h):String(h)):(h=p.attrAccessor?p.attrAccessor(p.valueAccessor(m)):p.valueAccessor(m),y=h)):(h=i,y=i)),s.fields){const e=d?d(h):h;u.push(e),c.push(f&&null!=y?f(y):null!=y?y:String(e))}else{const n=d?d(h):h;o[t[e]]={value:n,label:f?f(y):null!=y?y:String(n)},p.field&&(o[t[e]].source={field:p.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 pe=(e,t,n)=>{const r="K"===e.qMode?"/qStackedDataPages/*/qData":"/qTreeDataPages/*",i="K"===e.qMode?"qSubNodes":"qNodes",o=J(r,e);return o&&o[0]?(t.tree=N(o[0],n.children||(e=>e[i])),t.tree):null};function de(e){const t=e.raw().qDataPages.length?e.raw().qDataPages[0].qMatrix:[],r=oe(e),i=e.fields(),o=e.fields().filter(e=>"dimension"===e.type()).map(e=>r.indexOf(i.indexOf(e))),a=e.fields().filter(e=>"measure"===e.type()).map(e=>r.indexOf(i.indexOf(e))),s={__root:{__id:"__root",qValues:[]}};for(let e=0;e<t.length;e++){const r=t[e];let i="__root",u=!1;for(let e=0;e<o.length;e++){var l;const t=r[o[e]],a="".concat(i,"__").concat(null!==(l=t.qElemNumber)&&void 0!==l?l:t.qElemNo);s[a]||(s[a]=n({__id:a,__parent:i,qValues:[]},t),u=!0),i=a}if(u)for(let e=0;e<a.length;e++){const t=r[a[e]];s[i].qValues.push(t)}}const u=Object.keys(s).map(e=>s[e]);return K().id(e=>e.__id).parentId(e=>e.__parent)(u)}const fe=e=>{let{propsArr:t,props:n,cube:r,cache:i,itemDepthObject:o,f:a}=e;for(let e=0;e<t.length;e++){const i=n[t[e]],s=i.fields?i.fields:[i];for(let e=0;e<s.length;e++){const t=s[e];if(t.field!==a){const e=le(o,se(t.field,{cube:r}));t.accessor=e.nodeFn,t.valueAccessor=e.valueFn,t.attrAccessor=e.attrFn}}}};function he(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;const o=t.raw(),a=t.key(),s="S"===o.qMode?de(t):pe(o,r,e);if(!s)return null;const l=s.height,u=[];for(let a=0;a<=l;a++){let s=null;if(a>0)if("S"===o.qMode){let e=ae(o)[a-1];s=r.fields[e]}else{let e=o.qEffectiveInterColumnSortOrder[a-1];a>o.qEffectiveInterColumnSortOrder.length&&(e=o.qDimensionInfo.length),s=r.fields[e]}const{props:l,main:c}=i.normalizeConfig(n(n({},e),{},{field:s?s.key():void 0}),t),p=Object.keys(l);u[a]={propsArr:p,props:l,main:c};const d=s?se(s,{cube:o}):{fieldDepth:0};fe({propsArr:p,props:l,cube:o,cache:r,itemDepthObject:d,f:s})}const c=s.copy().descendants(),p=s.descendants();for(let e=0;e<p.length;e++){const t=u[p[e].depth].propsArr,n=u[p[e].depth].props,r=u[p[e].depth].main,i=c[e],o=i.data,s=ue(r,o,{key:a});ce({propsArr:t,props:n,item:i,itemData:o,ret:s,sourceKey:a}),p[e].data=s}return s}function me(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(!pe(s,n,e))continue;const u="object"==typeof i[a].field?i[a].field:t.field(i[a].field),{props:c,main:p}=r.normalizeConfig(i[a],t),d=Object.keys(c),f=se(u,{cube:s}),{nodeFn:h,attrFn:m,valueFn:g}=le({fieldDepth:0},f);fe({propsArr:d,props:c,cube:s,cache:n,itemDepthObject:f,f:u});const y=!!i[a].trackBy,b=typeof i[a].trackBy,v={},q=[],x=h(n.tree),D=[];for(let e=0;e<x.length;e++){const t=x[e],n=m?m(g(t)):g(t);if(p.filter&&!p.filter(n))continue;const o=ue(p,n,{key:l});ce({propsArr:d,props:c,item:t,itemData:n,ret:o,sourceKey:l}),y&&r.track({cfg:i[a],itemData:n,obj:o,target:q,tracker:v,trackType:b}),D.push(o)}const S=y?r.collect(q,{main:p,propsArr:d,props:c}):D;o=[...o,...S]}return o}function ge(e,t){return e(t={exports:{}},t.exports),t.exports}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==gt||"undefined"!=typeof self&&self;var ye=ge(function(e){var t;t=function(){return function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,a,s,l,u,c,p,d=e.length,f=e.search(/[0-9\-\+#]/),h=f>0?e.substring(0,f):"",m=e.split("").reverse().join(""),g=m.search(/[0-9\-\+#]/),y=d-g,b=e.substring(y,y+1),v=y+("."===b||","===b?1:0),q=g>0?e.substring(v,d):"";if(n=(t="-"===(e=e.substring(f,v)).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(m="",y=(p=t[0]).length%l,d=p.length,v=0;v<d;v++)m+=p.charAt(v),!((v-y+1)%l)&&v<d-l&&(m+=o);t[0]=m}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),h+(n?"-":"")+r+q}},e.exports=t()});const be=1e-15;function ve(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}const qe={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"},xe=/%\)?$/,De=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,Se=/^\(oct\)/i,Ce=/^\(dec\)/i,Me=/^\(hex\)/i,Ee=/^\(bin\)/i,Ae=/^\(rom\)/i,Ie=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,we=/#|0/g;function Oe(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 Te(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}function ke(e,t,n){let r;return De.test(t)?e=Oe(e,Number(/\d{2}/.exec(t)[0]),t,n):Se.test(t)?e=Oe(e,8,t,n):Ce.test(t)?e=Oe(e,10,t,n):Me.test(t)?e=Oe(e,16,t,n):Ee.test(t)?e=Oe(e,2,t,n):Ae.test(t)&&(r="",e<0&&(r="-",e=-e),e=0===(e=Math.floor(e))?"0":e<=5e5?r+(e=Te(e,t)):t+r+e.toExponential(0)),e}function Ne(e,t,n){const r=ve(e);return n?r:new RegExp(r||"",t)}function Le(e,t){return t&&(t=ve(t)),e&&(e=ve(e)),new RegExp("(?:[#0]+".concat(e,")?[#0]+(?:").concat(t,"[#0]+)?"))}function Pe(e,t){if(!e||!e.qNumericalAbbreviation)return qe;const n={};return e.qNumericalAbbreviation.split(t).forEach(e=>{let t=e.split(":");2===t.length&&(n[t[0]]=t[1])}),n}function _e(e,t,n,r){let i,o,a,s,l,u,c,p,d,f=e.pattern;r&&(e.abbreviate=!0),d=Le(t,n),a=f.match(d),a=a?a[0]:"",s=a?f.substr(0,f.indexOf(a)):f,l=a?f.substring(f.indexOf(a)+a.length):"",a||(a=f?"#":"##########"),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(Ne(u,"g"),t)),c=n,n=".",c&&(a=a.replace(Ne(c,"g"),n)),p=a.match(/#/g),p=p?p.length:0;const h=f.split(c);let m;h[1]&&(m=h[1].match(we)),e.prefix=s||"",e.postfix=l||"",e.pattern=f,e.maxPrecision=m?m.length:2,e.percentage=xe.test(f),e.numericPattern=a||"",e.numericRegex=new RegExp("".concat(Ne(t,null,!0),"|").concat(Ne(n,null,!0)),"g"),e.groupTemp=u,e.decTemp=c,e.t=t,e.d=n,e.temp=p}class Re{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=Pe(e,this.patternSeparator),this.prepare()}clone(){const e=new Re(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],Ie.test(e[0])&&(r.positive.isFunctional=!0),e[1]?Ie.test(e[1])&&(r.negative.isFunctional=!0):r.negative=!1,e[2]?Ie.test(e[2])&&(r.zero.isFunctional=!0):r.zero=!1;const i="U"===this.type;r.positive.isFunctional||_e(r.positive,t,n,i),r.negative&&!r.negative.isFunctional&&_e(r.negative,t,n,i),r.zero&&!r.zero.isFunctional&&_e(r.zero,t,n,i)}formatValue(e){let t,n,r,i,o,a,s,l,u,c=this._prepared,p="",d="",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=ke(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&&(p=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+be*(e<0?-1:1)).toFixed(Math.min(20,u?u.length:0)).split(".")[0]);let n=l.split(o)[0];if(n+=o,e=ye(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+be).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)/,""),d=""):(e=e.toPrecision(Math.max(1,Math.min(14,t)))).indexOf(".")>=0&&(e=(e=e.replace(e.indexOf("e")<0?/0+$/:/\.?0+(?=e)/,"")).replace(".",o));else{for(l+=o,t=Math.max(0,Math.min(20,t-Math.ceil(Math.log(r)/Math.log(10)))),s=0;s<t;s++)l+="#";e=ye(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+d+p+c.postfix}static getStaticFormatter(){return{prepare(){},formatValue:e=>"".concat(e)}}}function He(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Re(...t)}function Fe(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 Be(e,t,n,r,i){const o=He(i,e,t,n,r),a=Fe(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 Ve={DATE:"D",TIME:"T",DATE_TIME:"TS",INTERVAL:"IV"},ze=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],je=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],$e=["January","February","March","April","May","June","July","August","September","October","November","December"],Ue=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],We=86400;function Ke(e,t){for(let n=e.length;n<t;n++)e="0".concat(e);return e}function Ye(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"}}function Ge(e){let t=e.toString().split(".");return t[1]?(t=Number("0.".concat(t[1])),t):0}function Xe(e){const t=e,n=24*Ge(t),r=60*Ge(n),i=60*Ge(r),o=1e3*Ge(i);return{d:Math.floor(t),h:Math.floor(n),m:Math.floor(r),s:Math.floor(i),f:Math.round(o)}}function Je(e,t){let n,r=Xe(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(We*(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}}function Ze(e,t){return{"Y+|y+":{Y:"".concat(Number("".concat(t.year).slice(-2))),YY:Ke("".concat(t.year).slice(-2),2),YYY:Ke("".concat(t.year).slice(-3),3),def:e=>Ke("".concat(t.year),e.length)},"M+":{M:t.month+1,MM:Ke("".concat(t.month+1),2),MMM:e.locale_months_abbr[t.month],def:e.locale_months[t.month]},"W+|w+":{W:t.day,WW:Ke("".concat(t.day),2),WWW:e.locale_days_abbr[t.day],def:e.locale_days[t.day]},"D+|d+":{D:t.date,def:e=>Ke("".concat(t.date),e.length)},"h+|H+":{h:t.h,def:e=>Ke("".concat(t.h),e.length)},"m+":{m:t.m,def:e=>Ke("".concat(t.m),e.length)},"s+|S+":{s:t.s,def:e=>Ke("".concat(t.s),e.length)},"f+|F+":{def(e){let n="".concat(t.f),r=e.length-n.length;if(r>0)for(let e=0;e<r;e++)n+="0";else r<0&&(n=n.slice(0,e.length));return n}},"t{1,2}|T{1,2}":{def(e){let n=t.t;return e[0].toUpperCase()===e[0]&&(n=n.toUpperCase()),n=n.slice(0,e.length),n}}}}class Qe{constructor(e,t,n){const r=e||{};r.qCalendarStrings||(r.qCalendarStrings={qLongDayNames:ze,qDayNames:je,qLongMonthNames:$e,qMonthNames:Ue}),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={[Ve.TIME]:r.qTimeFmt||"hh:mm:ss",[Ve.DATE]:r.qDateFmt||"YYYY-MM-DD",[Ve.DATE_TIME]:r.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"}[n]),this.pattern=t}clone(){const e=new Qe(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=Ye(e,n):(e<0&&(e=-e,t="-".concat(t)),r=Je(e,t));const i=Ze(this,r),o=[];for(const e in i)Object.prototype.hasOwnProperty.call(i,e)&&o.push(e);const a=new RegExp(o.join("|"),"g");return t.replace(a,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 et(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Qe(...t)}const tt=864e5;function nt(e){return new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,0,Math.round(tt*(e-Math.floor(e)))))}function rt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"TS",n=et(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,e,t),r=Fe(n.format.bind(n),{toKey:e=>"object"==typeof e&&"function"==typeof e.getTime?e.getTime():e});function i(e){return t!==Ve.INTERVAL?nt(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=et(i,e,t),r=Fe(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 it(e,t){if(e&&e.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(e.qNumFormat.qType))return rt(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"),Be(n,r,i,o,t)}function ot(){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=e=>(null==e?void 0:e.qText)||"",p="dimension"===s?"first":"avg",d=it(t,i),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:c,reduce:p,reduceLabel:"dimension"===s?"first":(e,t)=>d(t),formatter:()=>d,tags:()=>t.qTags};return f}function at(e,t,n,r,i){return(t[e]||[]).map((t,o)=>{const a="".concat(r?"".concat(r,"/"):"").concat(e,"/").concat(o),s={instance:ot(f({id:"".concat(n?"".concat(n,"/"):"").concat(a),key:a,meta:t},i))};return s.attrDims=at("qAttrDimInfo",t,n,a,f({},i,{value:e=>null==e?void 0:e.qElemNo,type:"dimension"})),s.attrExps=at("qAttrExprInfo",t,n,a,f({},i,{value:e=>null==e?void 0:e.qNum,type:"measure"})),s.measures=at("qMeasureInfo",t,n,a,f({},i,{value:e=>null==e?void 0:e.qValue,type:"measure"})),s})}function st(){let{key:e,data:t,config:r={}}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const i={fields:[],wrappedFields:[],allFields:[],virtualFields:[]},o=t;if(!o)throw new Error('Missing "data" input');if(!o.qDimensionInfo)throw new Error('The "data" input is not recognized as a hypercube');const a=st.util,s={cache:i,cube:o,localeInfo:r.localeInfo,fieldExtractor:null,pages:null,hierarchy:()=>null,virtualFields:r.virtualFields},l={key:()=>e,raw:()=>o,field:e=>ee(e,s),fields:()=>i.fields.slice(),extract:e=>s.extractor(e,l,i,a),hierarchy:e=>s.hierarchy(e,l,i,a),_cache:()=>i};"K"===o.qMode||"T"===o.qMode||!o.qMode&&o.qNodesOnDim?(s.extractor=me,s.hierarchy=he,s.pages="K"===o.qMode?o.qStackedDataPages:o.qTreeDataPages):"S"===o.qMode?(s.extractor=y,s.pages=o.qDataPages,s.hierarchy=he):s.extractor=()=>[],s.fieldExtractor=e=>s.extractor({field:e},l,i,a);const u="S"===o.qMode?e=>e.qElemNumber:void 0,c="S"===o.qMode?e=>e.qNum:void 0;i.wrappedFields.push(...at("qDimensionInfo",o,e,"",f({},s,{value:u,type:"dimension"}))),i.wrappedFields.push(...at("qMeasureInfo",o,e,"",f({},s,{value:c,type:"measure"}))),i.fields=i.wrappedFields.map(e=>e.instance);const p=e=>{e.forEach(e=>{i.allFields.push(e.instance),p(e.measures),p(e.attrDims),p(e.attrExps)})};return p(i.wrappedFields),(r.virtualFields||[]).forEach(t=>{const r=l.field(t.from),o=ot(n({meta:r.raw(),id:"".concat(e,"/").concat(t.key),sourceField:r,fieldExtractor:e=>s.extractor({field:e},l,i,a),key:t.key,type:r.type(),localeInfo:s.localeInfo,value:r.value},t.override||{}));i.virtualFields.push(o)}),i.allFields.push(...i.virtualFields),l}const lt=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],ut=/\/qDimensionInfo(?:\/(\d+))?/,ct=/\/qMeasureInfo\/(\d+)/,pt=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,dt=/\/qAttrExprInfo\/(\d+)/,ft=/\/?qHyperCube/,ht=/\/?qTreeData/,mt=e=>"".concat(e.substr(0,e.indexOf("/qHyperCubeDef")+14)),yt=e=>"".concat(e.substr(0,e.indexOf("/qTreeDataDef")+13));function bt(e,t){let n=e,r=-1,i=-1,o="",a=e=>e;ft.test(e)?(o="".concat(n.substr(0,n.indexOf("qHyperCube")+10)),a=mt):ht.test(e)&&(o="".concat(n.substr(0,n.indexOf("qTreeData")+9)),a=yt);let s=!0;if(ut.test(e)&&(r=+ut.exec(e)[1]),ct.test(e)&&(i=+ct.exec(e)[1]),pt.test(e)){i=-1,r=0;const e=+pt.exec(n)[2];isNaN(e)||(r=e,n=n.replace(/\/\d+$/,"")),s=!1}if(dt.test(e)){const e=i;if(t){i=0;const a=J(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+=+dt.exec(n)[1]}else r>-1?(r=-1,i=+dt.exec(n)[1]):i+=+dt.exec(n)[1]+1}return lt.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}}function vt(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=bt(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 qt(e){st.util=e.data("matrix").util,e.data("q",st),e.formatter("q-number",Be),e.formatter("q-time",rt)}return qt.qBrushHelper=vt,qt.selections=vt,qt}()),ua.exports),pa=yt(ca);const da={brushInterceptors:{DIM_VALUE_NULL:-2,DIM_VALUE_TOTAL:-3,brushOnlyOne:function(e,t){const n=e.brushes().filter(e=>"value"===e.type);let r=[];n.length&&n.forEach(e=>{r=r.concat(e.brush.values().map(t=>({key:e.id,value:t})))});return r.concat(t)},filterValues:function(e,t){const n=this;let r,i;const o=[];let a=0;const s=[];return t.forEach(t=>{t.value!==n.DIM_VALUE_NULL&&t.value!==n.DIM_VALUE_TOTAL&&(i=function(e,t){const n=t.key.indexOf("qHyperCube")+10,r=t.key.substr(0,n),i=t.key.substr(n+1);return e.dataset(r).field(i)}(e,t),r=i&&i.raw(),r.qLocked?(o.push(r),a++):s.push({key:t.key,value:t.value}))}),{items:s,itemsAreLocked:a>0&&a===t.length,lockedFields:o}}}};const fa={data:["elemNo"],contexts:["select"],startOnEmptySelection:!0,style:{active:{strokeWidth:2,stroke:"#333"},inactive:{opacity:.3}}};function ha(e){if(!e||!e.chartInstance||!e.selectionsApi)throw Error("Selections-handler: Missing input");const t=e.chartInstance,n=e.selectionsApi,r=e.dataPaths||[""],i=e.selectPaths,o=e.lasso;let a=[];const s={propertiesToRestore:{}};let l=!1;const u=function(e,t,n){function r(){}return r.update=function(e,r,i){t.isActive()||t.begin(n),pa.qBrushHelper(i).forEach(e=>{t.select(e)})},r.toggleValues=function(r,i,o){const a=da.brushInterceptors.filterValues(e,r),s=a.items;return t.isActive()||a.itemsAreLocked||!(o||s.length>0)||(t.begin(n),i.start(),i.emit("update",[],[])),s},r}(t,n,i),c={};let p=!1;function d(e){16===e.keyCode&&e.shiftKey!==p&&(p=e.shiftKey,o.toggle())}function f(e){const t=e.keyCode;27===t?n.cancel():13===t&&n.confirm()}function h(){a.forEach(e=>{e.listeners.update=function(t,n){e.sleep||u.update(t,n,e.brush)},e.brush.on("update",e.listeners.update),e.brush.on("start",e.listeners.start)})}function m(){a.forEach(e=>{e.brush.removeListener("update",e.listeners.update),e.brush.removeListener("start",e.listeners.start)})}return n.on("cleared",()=>{a.forEach(e=>{e.brush.clear(),e.dependentComponents.forEach(e=>{const n=t.component(e.id);n&&n.emit(e.clear)})})}),c.setUp=function(e){c.tearDown();const t=this.setUpBrush(e);return l&&h(),t},c.setUpBrush=function(e){const n=E(!0,{},fa,e),i={on:"tap",action:t=>t.ctrlKey||e.isSingleSelect?"set":"toggle",contexts:n.contexts,data:n.data,globalPropagation:"stop"},o={context:n.contexts[0],data:n.data,style:n.style},s=function(e,t){return{brush:t.brush(e.contexts[0]),listeners:{},dependentComponents:[],id:e.contexts[0]}}(n,t);return s.listeners.toggle=function(e){if(!l)return[];const i=function(){const e=[];let n=r.map(e=>t.dataset(e).fields().filter(e=>"dimension"===e.type()));n=[].concat.apply([],n);for(let t=0;t<n.length;t++)n[t].raw().qLocked&&e.push(n[t].raw());return{fields:e,areAllFieldsLocked:e.length&&e.length===n.length}}();return n.startOnEmptySelection&&0===e.length&&i.areAllFieldsLocked?[]:u.toggleValues(e,s.brush,n.startOnEmptySelection)},s.brush.intercept("toggle-values",s.listeners.toggle),s.brush.intercept("add-values",s.listeners.toggle),s.brush.intercept("remove-values",s.listeners.toggle),s.brush.intercept("set-values",s.listeners.toggle),s.listeners.start=function(){a.length>1&&a.forEach(e=>{e!==s&&e.brush.end()})},a.push(s),{trigger:i,consume:o}},c.setUpStart=function(){c.tearDown()},c.setUpDone=function(){l&&h()},c.tearDown=function(){l&&m(),a.forEach(e=>{e.brush.removeInterceptor("toggle-values",e.listeners.toggle),e.brush.removeInterceptor("add-values",e.listeners.toggle),e.brush.removeInterceptor("remove-values",e.listeners.toggle),e.brush.removeInterceptor("set-values",e.listeners.toggle)}),a=[]},c.pauseEngineCalls=function(e){a.forEach(t=>{t.id===e&&(t.sleep=!0)})},c.resumeEngineCalls=function(e,t){a.forEach(n=>{n.id===e&&(n.sleep=!1,t&&n.listeners.update([],[]))})},c.addComponent=function(e,t){a.forEach(n=>{n.id===e&&n.dependentComponents.push(t)})},c.on=function(){if(l)return;l=!0,h(),document.addEventListener("keydown",d),document.addEventListener("keyup",d);const e=()=>{a.forEach(e=>{e.brush.end()}),document.removeEventListener("keyup",f),o.active()&&o.toggle()};n.on("deactivated",e),s.unbindDeactivated=()=>{n.removeListener("deactivated",e)};const t=()=>{document.addEventListener("keyup",f)};n.on("activated",t),s.unbindActivated=()=>{n.removeListener("activated",t)}},c.isOn=()=>l,c.off=function(){l&&(l=!1,m(),document.removeEventListener("keydown",d),document.removeEventListener("keyup",d),document.removeEventListener("keyup",f),s.unbindActivated(),s.unbindDeactivated())},c.lassoState=function(){return o.active()&&!(e.isLassoDisabled&&e.isLassoDisabled())},c.allFieldsLocked=function(){return function(){let e=r.map(e=>t.dataset(e).fields().filter(e=>"dimension"===e.type()));return e=[].concat.apply([],e),e.length&&e.every(e=>e.raw().qLocked)}()},c}class ma{isOn(){return!1}on(){console.warn("Can not turn on selections on this object")}off(){}}var ga={create:e=>e.selectionsApi?ha(e):new ma};var ya={isOnComponentForRange:function(e,t,n){return!!e&&!!n.chart.componentsFromPoint({x:e.center.x,y:e.center.y}).filter(e=>-1!==t.indexOf(e.settings.key))[0]},isOnComponentForLasso:function(e,t,n){return e&&n.chart.componentsFromPoint({x:e.center.x,y:e.center.y}).filter(e=>e.settings.key===t.keys.componentKey)[0]},isOnComponentForNavBtn:function(e,t,n){return n.chart.componentsFromPoint(e.center).some(e=>e.settings.key===t)}};var ba={callLassoGesture:function(e,t,n){return{type:"Pan",options:{direction:M.DIRECTION_ALL,threshold:1,enable(r,i){if(e.lassoing)return t.isSelectionEnabled();const o=ya.isOnComponentForLasso(i,n,this);return t.isSelectionEnabled()&&i&&((a=n.handlers).selectionHandler.lassoState()&&!a.selectionHandler.allFieldsLocked()||e.lassoing)&&o;var a},event:"lasso"},recognizeWith:n.handlers.scrollHandler?"drag":null,events:{lassostart(r){ya.isOnComponentForLasso(r,n,this)&&(t.switchTo("lasso",this.chart,r),e.lassoing=!0,n.handlers.selectionHandler.pauseEngineCalls(n.keys.lassoBrushKey),r.clientX=r.pointers[0].clientX,r.clientY=r.pointers[0].clientY,t.doEmit(this.chart,"lasso","lassoStart",r))},lassomove(n){e.lassoing&&(n.clientX=n.pointers[0].clientX,n.clientY=n.pointers[0].clientY,t.doEmit(this.chart,"lasso","lassoMove",n))},lassoend(r){e.lassoing&&(r.clientX=r.pointers[0].clientX,r.clientY=r.pointers[0].clientY,t.doEmit(this.chart,"lasso","lassoEnd",r),n.handlers.selectionHandler.resumeEngineCalls(n.keys.lassoBrushKey,!0),e.lassoing=!1)},lassocancel(r){e.lassoing=!1,t.doEmit(this.chart,"lasso","lassoCancel",r),n.handlers.selectionHandler.resumeEngineCalls(n.keys.lassoBrushKey,!1)}}}}};var va={callMeasureRangeGesture:function(e,t,n,r){const i=n.keys.dimRangeBrushKey?"majorrange":"arearange";return{type:"Pan",options:{direction:n.isHorizontal?M.DIRECTION_HORIZONTAL:M.DIRECTION_VERTICAL,event:"measurerange",enable(i,o){if(!n.rangeSelStatus.isOpenMea)return!1;if(e.measureSelecting)return t.isSelectionEnabled();const a="measurerange"===n.active.gesture?[r,n.keys.componentKey]:[r],s=ya.isOnComponentForRange(o,a,this);return e.measureSelecting=t.isSelectionEnabled()&&!!o&&!!s,e.measureSelecting&&!!n.keys.measureRangeBrushKey}},requireFailure:`lasso ${i}`,recognizeWith:n.handlers.scrollHandler?"drag":null,events:{measurerangestart(i){const o="measurerange"===n.active.gesture?[r,n.keys.componentKey]:[r];ya.isOnComponentForRange(i,o,this)&&(e.measureSelecting=!0,t.switchTo("measurerange",this.chart,i),t.doEmit(this.chart,"rangeMeasure","rangeStart",i),n.handlers.selectionHandler.pauseEngineCalls(n.keys.measureRangeBrushKey))},measurerangemove(n){e.measureSelecting&&t.doEmit(this.chart,"rangeMeasure","rangeMove",n)},measurerangeend(r){e.measureSelecting&&(n.handlers.selectionHandler.resumeEngineCalls(n.keys.measureRangeBrushKey,!0),t.doEmit(this.chart,"rangeMeasure","rangeEnd",r),e.measureSelecting=!1)},measurerangecancel(){n.handlers.selectionHandler.resumeEngineCalls(n.keys.measureRangeBrushKey,!1),e.measureSelecting=!1}}}}};function qa(e,t){let n;return n="x-axis"===e?"horizontal"===t?M.DIRECTION_VERTICAL:M.DIRECTION_HORIZONTAL:"horizontal"===t?M.DIRECTION_HORIZONTAL:M.DIRECTION_VERTICAL,n}var xa={callAreaRangeGesture:function(e,t,n,r){const i=n.keys.dimRangeBrushKey?"majorrange":"measurerange";return{type:"Pan",options:{direction:qa(r,n.isHorizontal),event:"arearange",enable(i,o){if(!n.rangeSelStatus.isOpenDim)return!1;if(e.minoring)return t.isSelectionEnabled();const a="arearange"===n.active.gesture?[r,n.keys.componentKey]:[r],s=ya.isOnComponentForRange(o,a,this);return e.minoring=t.isSelectionEnabled()&&!!o&&!!s,e.minoring}},requireFailure:`lasso ${i}`,recognizeWith:n.handlers.scrollHandler?"drag":null,events:{arearangestart(i){const o="arearange"===n.active.gesture?[r,n.keys.componentKey]:[r];ya.isOnComponentForRange(i,o,this)&&(e.minoring=!0,t.switchTo("arearange",this.chart,i),t.doEmit(this.chart,"rangeMinor","areaStart",i),n.handlers.selectionHandler.pauseEngineCalls(n.keys.areaBrushKey))},arearangemove(r){e.minoring&&(this.chart.brush(n.keys.areaBrushKey).clear(),t.doEmit(this.chart,"rangeMinor","areaMove",r))},arearangeend(r){e.minoring&&(n.handlers.selectionHandler.resumeEngineCalls(n.keys.areaBrushKey,!0),t.doEmit(this.chart,"rangeMinor","areaEnd",r),e.minoring=!1)},arearangecancel(){n.handlers.selectionHandler.resumeEngineCalls(n.keys.areaBrushKey,!1),e.minoring=!1}}}}};var Da={callDimensionRangeGesture:function(e,t,n,r){const i=n.keys.measureRangeBrushKey?"measurerange":"arearange";return{type:"Pan",options:{direction:n.isHorizontal?M.DIRECTION_VERTICAL:M.DIRECTION_HORIZONTAL,event:"majorrange",enable(i,o){if(!n.rangeSelStatus.isOpenDim)return!1;if(e.majoring)return t.isSelectionEnabled();const a="majorrange"===n.active.gesture?[r,n.keys.componentKey]:[r],s=ya.isOnComponentForRange(o,a,this);return e.majoring=t.isSelectionEnabled()&&!!o&&!!s,e.majoring&&!!n.keys.dimRangeBrushKey}},requireFailure:`lasso ${i}`,recognizeWith:n.handlers.scrollHandler?"drag":null,events:{majorrangestart(i){const o="majorrange"===n.active.gesture?[r,n.keys.componentKey]:[r];ya.isOnComponentForRange(i,o,this)&&(e.majoring=!0,t.switchTo("majorrange",this.chart,i),t.doEmit(this.chart,"rangeDim","rangeStart",i),n.handlers.selectionHandler.pauseEngineCalls(n.keys.dimRangeBrushKey))},majorrangemove(n){e.majoring&&t.doEmit(this.chart,"rangeDim","rangeMove",n)},majorrangeend(r){e.majoring&&(n.handlers.selectionHandler.resumeEngineCalls(n.keys.dimRangeBrushKey,!0),t.doEmit(this.chart,"rangeDim","rangeEnd",r),e.majoring=!1)},majorrangecancel(){n.handlers.selectionHandler.resumeEngineCalls(n.keys.dimRangeBrushKey,!1),e.majoring=!1}}}}};var Sa={callDragGesture:function(e,t,n,r,i){let o={};return{type:"Pan",options:{direction:n.isHorizontal?M.DIRECTION_VERTICAL:M.DIRECTION_HORIZONTAL,event:"drag",enable(r,i){return e.dragging?t.isNavigationEnabled():(e.dragging=t.isNavigationEnabled()&&!!i&&!!this.chart.componentsFromPoint({x:i.center.x,y:i.center.y}).filter(e=>e.settings.key===n.keys.componentKey)[0],e.dragging)}},requireFailure:r?`lasso ${t.getBrushConfig()}`:"",events:{dragstart(e){o={x:e.deltaX,y:e.deltaY};let t=-(n.isHorizontal?e.deltaY:e.deltaX)/n.handlers.scrollHandler.getItemSize();!n.isHorizontal&&i&&(t=-t),n.handlers.scrollHandler.getScrollApi().move(t)},dragmove(t){if(!e.dragging)return;let r=-(n.isHorizontal?t.deltaY-o.y:t.deltaX-o.x)/n.handlers.scrollHandler.getItemSize();!n.isHorizontal&&i&&(r=-r),n.handlers.scrollHandler.getScrollApi().move(r),o={x:t.deltaX,y:t.deltaY}},dragend(){e.dragging&&(e.dragging=!1)},dragcancel(){e.dragging=!1}}}}};var Ca={callNavBtnGesture:function(e,t){return{type:"Tap",options:{event:"navBtnTap",enable(n,r){return!(!r||!e())&&ya.isOnComponentForNavBtn(r,t,this)}},events:{navBtnTap(e){this.chart.componentsFromPoint(e.center).forEach(t=>{const n=e.target,r=n?n.getAttribute("data-action"):"";if(r)return t.emit(r)})}}}}};var Ma={create:function(e,t,n,r,i){const o={};t=t||"vertical";const a=r.lassoBrushKey||"select",s=r.dimRangeBrushKey||null,l=r.measureRangeBrushKey||null,u=r.areaBrushKey||null,c=r.legendBrushKey||null,p=!!e.selectionHandler&&e.selectionHandler.isOn(),d={dragging:!1,lassoing:!1,majoring:!1,minoring:!1,measureSelecting:!1},f={gesture:"",type:""},h="horizontal"===t,m=h?"y-axis":"x-axis",g=h?"x-axis":"y-axis";function y(e,t,n){if(f.gesture===e)return;let r=a;const i=t||f.chart;switch(f.gesture){case"majorrange":b(i,"rangeDim","rangeClear",n),r=s;break;case"measurerange":b(i,"rangeMeasure","rangeClear",n),r=l;break;case"arearange":b(i,"rangeMinor","areaClear",n),r=u}f.gesture=e;const o="range"===e?"range":"item";f.type&&f.type!==o&&i.brush(r).clear(),f.chart=t,f.type=o}function b(e,t,n,r){if(e){const i=e.component(t);i&&i.emit(n,r)}}let v=[];const q={isSelectionEnabled:()=>e.selectionHandler&&e.selectionHandler.isOn(),isNavigationEnabled:()=>e.scrollHandler&&e.scrollHandler.isOn(),doEmit:b,switchTo:y,getBrushConfig:function(){return s?l?"majorrange measurerange":"majorrange arearange":"measurerange arearange"}},x={handlers:e,keys:r,isHorizontal:h,active:f,rangeSelStatus:i};function D(){y("none"),d.majoring=!1,d.measureSelecting=!1,d.minoring=!1}return p&&(v=[{type:"Tap",options:{event:"rangeClearTap"},events:{rangeClearTap(e){y("none",this.chart,e),d.majoring=!1,d.measureSelecting=!1,d.minoring=!1}}}],v.unshift(Ca.callNavBtnGesture(q.isNavigationEnabled,c)),v.push(ba.callLassoGesture(d,q,x)),s?l?(v.push(Da.callDimensionRangeGesture(d,q,x,m)),e.selectionHandler.addComponent(s,{id:"rangeDim",clear:"rangeClear"}),v.push(va.callMeasureRangeGesture(d,q,x,g)),e.selectionHandler.addComponent(l,{id:"rangeMeasure",clear:"rangeClear"})):(v.push(Da.callDimensionRangeGesture(d,q,x,m)),e.selectionHandler.addComponent(s,{id:"rangeDim",clear:"rangeClear"}),v.push(xa.callAreaRangeGesture(d,q,x,g)),e.selectionHandler.addComponent(u,{id:"rangeMinor",clear:"areaClear"})):(v.push(va.callMeasureRangeGesture(d,q,x,g)),e.selectionHandler.addComponent(l,{id:"rangeMeasure",clear:"rangeClear"}),v.push(xa.callAreaRangeGesture(d,q,x,m)),e.selectionHandler.addComponent(u,{id:"rangeMinor",clear:"areaClear"}))),e.scrollHandler&&(v.push(Sa.callDragGesture(d,q,x,p,n)),e.scrollHandler.getScrollApi().on("update",D)),o.gestures=v,o.destroy=function(){e.scrollHandler&&e.scrollHandler.getScrollApi().removeListener("update",D)},o}};function Ea(e,t,n,r,i){let o=!1;r=r||"tooltip",n=n||["self"];const a=e.brush(r),s={};function l(){if(o){e.component(i).emit("hide")}o=!1}return s.isOpen=function(){return o},s.closeTooltip=l,s.update=function(){const s=a.brushes(),u=e.getAffectedShapes(r,"and",n,t);s.length>=1?(o=!0,function(t){o=!0;const n={nodes:t};e.component(i).emit("show",{},n)}(u)):l()},s.toggleInterceptor=function(e){if(n.length>1){const t={},n=[];return e.forEach(e=>{t[e.key]||(t[e.key]={}),t[e.key][e.value]||(t[e.key][e.value]=!0,n.push(e))}),n}return e},s}var Aa={create:(...e)=>Ea(...e)},Ia={formatMeasureValue:function(e,t){if(e.raw().isCustomFormatted)return e.formatter()(t.value.qText);const n=void 0!==t.value.qNum?t.value.qNum:t.value.qValue;return e.formatter()(n)}};const wa=e=>({h:t,data:n,style:r})=>{const i=function(e,t){const n=e.chartInstance.dataset(e.dataPath),r=[],i=t.length-5,o=Math.min(5,t.length);for(let i=0;i<o;i++){const o=t[i],a={rows:[]};if(e.labelData){const t=[],i=e.labelData;let s=!1;for(let e=0;e<i.length;e++){const n=o.data[i[e]].value;if(-2===n.qElemNo||-2===n.qElemNumber){s=!0;break}t.push(o.data[i[e]].value.qText)}if(s)return;a.header=e.headerResolver(t),a.rows=e.measureRows.map(t=>{const r=o.data;return e.rowResolver(n.field(r[t].source.field),r[t],r)}).filter(e=>!!e);const l=Oa(e,o);l&&a.rows.unshift(l),r.push(a)}}i>0&&(r.numberInExcess=i);return r.rowCount=r[0]?r.length*r[0].rows.length:0,r}(e,n),o={h:t,style:r,rtl:"rtl"===e.direction,translator:e.translator};return e.renderer(o,i)};function Oa(e,t){var n,r,i;const o=t.data.color,a=null===(n=e.colorService)||void 0===n||null===(r=n.getSettings)||void 0===r?void 0:r.call(n);if(!a||"color"===a.type||!o||!a.fieldType)return;const s=[];e.data.forEach(e=>{const n=t.data[e];n&&s.push(n.value)});const l=function(e){let t=-1;for(let n=0;n<e.length;n++)-3===e[n]&&(t=n);return t}(s),{translator:u}=e,c=a.label;return{color:null===(i=t.attrs)||void 0===i?void 0:i.fill,label:c,value:-1!==l?u.get("properties.dimensionLimits.others"):o.label}}const Ta="dist-flow-tooltip",ka=`#${Ta}`;function Na(){if(!document.querySelector(ka)){const e=document.createElement("div");e.id=Ta,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 La({key:e="tooltip",rtl:t,fontFamily:n,filter:r,content:i}){return{show:!0,key:e,type:"tooltip",layout:{displayOrder:3},beforeMount(){Na()},beforeUpdate(){Na()},destroyed(){!function(){const e=document.querySelector(ka);e&&e.parentElement&&e.childElementCount<1&&e.parentElement.removeChild(e)}()},settings:{appendTo:()=>document.querySelector(ka),content:i,filter:r,extract:e=>e.node,direction:t?"rtl":"ltr",placement:"bounds"},style:{arrow:{color:"#404040"},content:{display:"table","border-spacing":"4px",background:"rgba(64, 64, 64, 0.9)",opacity:"1",fontSize:"13px",fontFamily:n,"empty-cells":"show"},cell:{"max-width":"180px","word-break":"break-word","word-wrap":"break-word","overflow-wrap":"break-word",hyphens:"auto"}}}}const{detectTextDirection:Pa}=bo;const _a={tooltipKey:"tooltip",data:[""],contexts:["tooltip"],headerResolver:e=>e.join(", "),rowResolver:(e,t)=>({value:Ia.formatMeasureValue(e,t),label:e.title()}),direction:"ltr",renderer:function(e,t){const{h:n,style:r,translator:i,rtl:o}=e,a=[],s=o?"right":"left";if(t.forEach(e=>{if(e.header){const t={...r.cell,textAlign:s,fontWeight:"bold",direction:Pa(e.header)};a.push(n("tr",null,n("td",{style:t,colSpan:2},e.header)))}e.rows.forEach(e=>{let t=e.value;if(e.color){const r={display:"inline-block",width:10,height:10,"background-color":e.color,margin:"0 8px"},i=n("div",{style:r});t=o?[e.value,i]:[i,e.value]}const i=o?[":",e.label]:[e.label,":"],l={...r.cell,textAlign:s,direction:Pa(e.label)},u={...r.cell,textAlign:o?"left":"right",direction:Pa(e.value)};a.push(n("tr",null,n("td",{style:l},i),n("td",{style:u},t)))})}),t.numberInExcess){const e=i.get("Object.ChartTooltip.NMore",t.numberInExcess),o={...r.cell,textAlign:s,direction:Pa(e)};a.push(n("tr",null,n("td",{style:o,colSpan:2},e)))}return a}};function Ra(e,t,n){if(!e)throw Error("Tooltips-handler: Missing input");let r={},i=!1;const o={};function a(e){e.listeners.update=function(t,n){e.action.update(t,n,e)},e.listeners.end=function(){e.action.closeTooltip()},e.brush.on(e.treatAsDesktop?"update":"set-values",e.listeners.update),e.brush.on("end",e.listeners.end),e.brush.intercept("set-values",e.action.toggleInterceptor)}function s(){Object.keys(r).forEach(e=>{l(r[e])})}function l(e){e.brush.removeListener(e.treatAsDesktop?"update":"set-values",e.listeners.update),e.brush.removeListener("end",e.listeners.end),e.brush.removeInterceptor("set-values",e.action.toggleInterceptor)}function u(){Object.keys(r).forEach(e=>{r[e].action.closeTooltip()})}function c(){u();for(const e in r)r[e].brush.clear()}return o.setUp=function(t){const o=E(!0,{},_a,t);if(!o.componentKey)throw Error("Tooltips-handler.setUp: Missing required input");r[o.contexts[0]]&&i&&l(r[o.contexts[0]]);const s=function(e,t){return{brush:t.brush(e.contexts[0]),action:Aa.create(t,e.componentKey,e.data,e.contexts[0],e.tooltipKey),listeners:{},chartInstance:t,dataPath:e.dataPath,renderer:e.renderer,data:e.data,headerResolver:e.headerResolver,rowResolver:e.rowResolver,colorService:e.colorService,attrDimPath:e.attrDimPath,measureRows:e.measureRows,labelData:e.labelData,filterShapes:e.filterShapes,direction:e.environment.options.direction,theme:e.environment.theme,translator:e.environment.translator,treatAsDesktop:"touch"!==e.environment.deviceType}}(o,e);r[o.contexts[0]]=s,i&&a(s);const u=La({key:o.tooltipKey,rtl:"rtl"===s.direction,fontFamily:s.theme.getStyle(n,"tooltip","fontFamily"),filter:(c=s.filterShapes,e=>c?c(e):function(e){const t=[];return e.forEach(e=>{-1===t.indexOf(e)&&"container"!==e.type&&t.push(e)}),t}(e)),content:wa(s,o.dataPath)});var c;return o.chartBuilder.getSettings().components.push(u),{trigger:{on:s.treatAsDesktop?"over":"tap",action:"set",contexts:o.contexts,data:o.data,globalPropagation:"stop"},consume:o.contexts.map(e=>({context:e})),component:u}},o.tearDown=function(){i&&s(),r=[]},o.closeTooltip=u,o.isOn=()=>i,o.on=function(){i||(i=!0,Object.keys(r).forEach(e=>{a(r[e])}),t&&t.on("mouseleave",c))},o.off=function(){i&&(i=!1,s(),t&&t.off("mouseleave",c),u())},o}var Ha={create:(e,t,n)=>Ra(e,t,n)};const Fa=".scrollHandler";function Ba(e,t,n,r,i){if(!e||!t||!n)throw Error("Scroll-handler: Missing input");this._chartInstance=e,this._$chartElement=t,this._getSlicedDataFn=n,this._on=!1,this._itemSize=30,this.options={direction:"vertical"},this._onScrollCallback=r,this._legendKey=i}function Va(){const e=("horizontal"===this.options.direction?this._$chartElement.width():this._$chartElement.height())||0,t=Math.floor(e/this.getItemSize());this._scrollViewSizeInItem=Math.max(t,1)}function za(e){const t=function(e){let t=0,n=0,r=0;return e.wheelDelta&&(t=e.wheelDelta/60),e.detail&&(t=-e.detail/3),r=t,void 0!==e.axis&&e.axis===e.HORIZONTAL_AXIS&&(r=0,n=-1*t),void 0!==e.wheelDeltaY&&(r=e.wheelDeltaY/60),void 0!==e.wheelDeltaX&&(n=-1*e.wheelDeltaX/60),{delta:t,deltaX:n,deltaY:r,x:e.pageX,y:e.pageY}}(e.originalEvent);if(function(e,t,n,r){if(r&&n.componentsFromPoint(t).some(e=>e.settings.key===r))return n.component(r).emit(t.delta>0?"prev":"next"),e.preventDefault(),!0;return!1}(e,t,this._chartInstance,this._legendKey)||this._disabled||!this.getScrollApi())return;if(e.preventDefault(),!t.delta)return;const n=t.delta<0?3:-3;this._scrollApi.move(n)}function ja(){if(this._disabled||this._sizeChanged)return void(this._sizeChanged=!1);const e=this;this.getViewData().then(t=>{e._on&&!e._disabled&&e._onScrollCallback&&e._onScrollCallback(t,void 0,!0)}).catch(e=>{})}Ba.prototype.getScrollApi=function(){this._scrollApi||(this._scrollApi=this._chartInstance.scroll("dimension"));return this._scrollApi},Ba.prototype.setDisabled=function(e){this._disabled=e},Ba.prototype.getDisabled=function(){return this._disabled},Ba.prototype.setItemSize=function(e){this._itemSize!==e&&(this._itemSize=e,Va.call(this))},Ba.prototype.getItemSize=function(){return this._itemSize},Ba.prototype.getScrollViewSizeInItem=function(){this._scrollViewSizeInItem||Va.call(this);return this._scrollViewSizeInItem},Ba.prototype.on=function(){if(this._on)return;this.getScrollApi()&&(this._scrollApi.removeAllListeners(),this._scrollApi.on("update",ja.bind(this)));this._$chartElement.on(`mousewheel${Fa} DOMMouseScroll${Fa}`,za.bind(this)),this._$chartElement.on(`touchstart${Fa}`,e=>{e.preventDefault()}),this._on=!0},Ba.prototype.isOn=function(){return this._on},Ba.prototype.off=function(){if(!this._on)return;this.getScrollApi()&&this._scrollApi.removeAllListeners();this._$chartElement.off(Fa),this._on=!1},Ba.prototype.updateViewState=function(e){Va.call(this),this.getScrollApi()&&this._scrollApi.update({viewSize:this._scrollViewSizeInItem,max:e})},Ba.prototype.onResize=function(){this._sizeChanged=!0,Va.call(this),this.getScrollApi()&&this._scrollApi.update({viewSize:this._scrollViewSizeInItem})},Ba.prototype.isDataSizeChanged=function(e,t){return Math.min(this.getScrollViewSizeInItem(),t)!==e},Ba.prototype.resetScroll=function(){this.getScrollApi()&&this._scrollApi.moveTo(0)},Ba.prototype.getViewData=function(){let e=0,t=0;if(this.getScrollApi()){const n=this._scrollApi.getState();e=Math.round(n.start),t=n.viewSize}return this._getSlicedDataFn(e,t)},Ba.prototype.setOptions=function(e){this.options.direction!==e.direction&&(this._scrollViewSizeInItem=void 0);this.options=e},Ba.prototype.getScrollState=function(){return this.getScrollApi().getState().start},Ba.prototype.setScrollState=function(e){this.getScrollApi().moveTo(e)};const $a=166/26,Ua=12/11;function Wa(e){return(12*Math.min(e,3)+Math.max(e-3,0)*$a)/11}function Ka(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}}function Ya(e,t){const n={latin:0,cjk:0};void 0===t?e.forEach(e=>{const t=Ka(e.qText);n.latin+=t.latin,n.cjk+=t.cjk}):e.forEach(e=>{const r=Ka(e[t].qText);n.latin+=r.latin,n.cjk+=r.cjk});const r=Math.max(1,n.latin+n.cjk);return n.latinRatio=n.latin/r,n.cjkRatio=n.cjk/r,n}function Ga(e,t,n){return e*(e<=24?t:n)}var Xa={endsWith:function(e,t){return-1!==e.indexOf(t,e.length-t.length)},startsWith:function(e,t){return 0===e.indexOf(t)},contains:function(e,t){if(!e)throw new Error("Haystack is undefined.");if(!t)throw new Error("Needle is undefined.");return-1!==e.indexOf(t)},stringWidthOverMWidth:Wa,getCharacterRatios:Ka,getTotalCharacterRatios:Ya,getAdjustedMaxGlyphCount:function(e,t,n){const r=Ya(t,n),i=r.latinRatio*e,o=r.cjkRatio*e;return Math.ceil(Wa(i)+o*Ua)},estimateLatinLabelWidth:Ga,estimateLabelWidth:function(e,t,n,r,i){return e*n+Ga(t,r,i)}};const Ja={aliceblue:{r:240,g:248,b:255},antiquewhite:{r:250,g:235,b:215},aqua:{r:0,g:255,b:255},aquamarine:{r:127,g:255,b:212},azure:{r:240,g:255,b:255},beige:{r:245,g:245,b:220},bisque:{r:255,g:228,b:196},black:{r:0,g:0,b:0},blanchedalmond:{r:255,g:235,b:205},blue:{r:0,g:0,b:255},blueviolet:{r:138,g:43,b:226},brown:{r:165,g:42,b:42},burlywood:{r:222,g:184,b:135},cadetblue:{r:95,g:158,b:160},chartreuse:{r:127,g:255,b:0},chocolate:{r:210,g:105,b:30},coral:{r:255,g:127,b:80},cornflowerblue:{r:100,g:149,b:237},cornsilk:{r:255,g:248,b:220},crimson:{r:220,g:20,b:60},cyan:{r:0,g:255,b:255},darkblue:{r:0,g:0,b:139},darkcyan:{r:0,g:139,b:139},darkgoldenrod:{r:184,g:134,b:11},darkgray:{r:169,g:169,b:169},darkgreen:{r:0,g:100,b:0},darkgrey:{r:169,g:169,b:169},darkkhaki:{r:189,g:183,b:107},darkmagenta:{r:139,g:0,b:139},darkolivegreen:{r:85,g:107,b:47},darkorange:{r:255,g:140,b:0},darkorchid:{r:153,g:50,b:204},darkred:{r:139,g:0,b:0},darksalmon:{r:233,g:150,b:122},darkseagreen:{r:143,g:188,b:143},darkslateblue:{r:72,g:61,b:139},darkslategray:{r:47,g:79,b:79},darkslategrey:{r:47,g:79,b:79},darkturquoise:{r:0,g:206,b:209},darkviolet:{r:148,g:0,b:211},deeppink:{r:255,g:20,b:147},deepskyblue:{r:0,g:191,b:255},dimgray:{r:105,g:105,b:105},dimgrey:{r:105,g:105,b:105},dodgerblue:{r:30,g:144,b:255},firebrick:{r:178,g:34,b:34},floralwhite:{r:255,g:250,b:240},forestgreen:{r:34,g:139,b:34},fuchsia:{r:255,g:0,b:255},gainsboro:{r:220,g:220,b:220},ghostwhite:{r:248,g:248,b:255},gold:{r:255,g:215,b:0},goldenrod:{r:218,g:165,b:32},gray:{r:128,g:128,b:128},green:{r:0,g:128,b:0},greenyellow:{r:173,g:255,b:47},grey:{r:128,g:128,b:128},honeydew:{r:240,g:255,b:240},hotpink:{r:255,g:105,b:180},indianred:{r:205,g:92,b:92},indigo:{r:75,g:0,b:130},ivory:{r:255,g:255,b:240},khaki:{r:240,g:230,b:140},lavender:{r:230,g:230,b:250},lavenderblush:{r:255,g:240,b:245},lawngreen:{r:124,g:252,b:0},lemonchiffon:{r:255,g:250,b:205},lightblue:{r:173,g:216,b:230},lightcoral:{r:240,g:128,b:128},lightcyan:{r:224,g:255,b:255},lightgoldenrodyellow:{r:250,g:250,b:210},lightgray:{r:211,g:211,b:211},lightgreen:{r:144,g:238,b:144},lightgrey:{r:211,g:211,b:211},lightpink:{r:255,g:182,b:193},lightsalmon:{r:255,g:160,b:122},lightseagreen:{r:32,g:178,b:170},lightskyblue:{r:135,g:206,b:250},lightslategray:{r:119,g:136,b:153},lightslategrey:{r:119,g:136,b:153},lightsteelblue:{r:176,g:196,b:222},lightyellow:{r:255,g:255,b:224},lime:{r:0,g:255,b:0},limegreen:{r:50,g:205,b:50},linen:{r:250,g:240,b:230},magenta:{r:255,g:0,b:255},maroon:{r:128,g:0,b:0},mediumaquamarine:{r:102,g:205,b:170},mediumblue:{r:0,g:0,b:205},mediumorchid:{r:186,g:85,b:211},mediumpurple:{r:147,g:112,b:219},mediumseagreen:{r:60,g:179,b:113},mediumslateblue:{r:123,g:104,b:238},mediumspringgreen:{r:0,g:250,b:154},mediumturquoise:{r:72,g:209,b:204},mediumvioletred:{r:199,g:21,b:133},midnightblue:{r:25,g:25,b:112},mintcream:{r:245,g:255,b:250},mistyrose:{r:255,g:228,b:225},moccasin:{r:255,g:228,b:181},navajowhite:{r:255,g:222,b:173},navy:{r:0,g:0,b:128},oldlace:{r:253,g:245,b:230},olive:{r:128,g:128,b:0},olivedrab:{r:107,g:142,b:35},orange:{r:255,g:165,b:0},orangered:{r:255,g:69,b:0},orchid:{r:218,g:112,b:214},palegoldenrod:{r:238,g:232,b:170},palegreen:{r:152,g:251,b:152},paleturquoise:{r:175,g:238,b:238},palevioletred:{r:219,g:112,b:147},papayawhip:{r:255,g:239,b:213},peachpuff:{r:255,g:218,b:185},peru:{r:205,g:133,b:63},pink:{r:255,g:192,b:203},plum:{r:221,g:160,b:221},powderblue:{r:176,g:224,b:230},purple:{r:128,g:0,b:128},red:{r:255,g:0,b:0},rosybrown:{r:188,g:143,b:143},royalblue:{r:65,g:105,b:225},saddlebrown:{r:139,g:69,b:19},salmon:{r:250,g:128,b:114},sandybrown:{r:244,g:164,b:96},seagreen:{r:46,g:139,b:87},seashell:{r:255,g:245,b:238},sienna:{r:160,g:82,b:45},silver:{r:192,g:192,b:192},skyblue:{r:135,g:206,b:235},slateblue:{r:106,g:90,b:205},slategray:{r:112,g:128,b:144},slategrey:{r:112,g:128,b:144},snow:{r:255,g:250,b:250},springgreen:{r:0,g:255,b:127},steelblue:{r:70,g:130,b:180},tan:{r:210,g:180,b:140},teal:{r:0,g:128,b:128},thistle:{r:216,g:191,b:216},tomato:{r:255,g:99,b:71},transparent:{r:255,g:255,b:255,a:0},turquoise:{r:64,g:224,b:208},violet:{r:238,g:130,b:238},wheat:{r:245,g:222,b:179},white:{r:255,g:255,b:255},whitesmoke:{r:245,g:245,b:245},yellow:{r:255,g:255,b:0},yellowgreen:{r:154,g:205,b:50}},Za=/^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)$/i,Qa=/^rgba\((\d{1,3}),(\d{1,3}),(\d{1,3}),(\d(\.\d+)?)\)$/i,es=/^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/i,ts=/^#([A-f0-9])([A-f0-9])([A-f0-9])$/i,ns=/^hsl\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i,rs=/^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,(\d(\.\d+)?)\)$/i,is=Math.floor,os=Math.round,as=Ze.extend({init(){let e,t,n,r,i,o,a,s,l,u,c,p,d=0,f=0,h=0,m=1;if(this._invalid=!1,arguments[0]instanceof as)d=arguments[0]._r,f=arguments[0]._g,h=arguments[0]._b,m=arguments[0]._a,this._invalid=arguments[0]._invalid;else if(arguments.length<3)if("string"==typeof arguments[0])if(p=arguments[0],c=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i.exec(p))d=parseInt(c[1],10),f=parseInt(c[2],10),h=parseInt(c[3],10);else if(c=/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d(\.\d+)?)\s*\)$/i.exec(p))d=parseInt(c[1],10),f=parseInt(c[2],10),h=parseInt(c[3],10),m=parseFloat(c[4]);else if(c=/^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/i.exec(p))d=parseInt(c[1],16),f=parseInt(c[2],16),h=parseInt(c[3],16),m=1;else if(c=/^#([A-f0-9])([A-f0-9])([A-f0-9])$/i.exec(p))d=parseInt(c[1]+c[1],16),f=parseInt(c[2]+c[2],16),h=parseInt(c[3]+c[3],16),m=1;else if(c=/^hsl\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i.exec(p)){switch(e=parseFloat(c[1]),t=parseFloat(c[3]),r=parseFloat(c[5]),e%=360,t/=100,r/=100,e=e<0?0:e>360?360:e,t=t<0?0:t>1?1:t,r=r<0?0:r>1?1:r,o=r<=.5?2*r*t:(2-2*r)*t,a=e/60,s=o*(1-Math.abs(a%2-1)),l=[],a=Math.floor(a),a){case 0:l=[o,s,0];break;case 1:l=[s,o,0];break;case 2:l=[0,o,s];break;case 3:l=[0,s,o];break;case 4:l=[s,0,o];break;case 5:l=[o,0,s];break;default:l=[0,0,0]}u=r-.5*o,d=l[0]+u,f=l[1]+u,h=l[2]+u,d=os(255*d),f=os(255*f),h=os(255*h),m=1}else if(c=/^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,(\d(\.\d+)?)\)$/i.exec(p)){switch(e=parseFloat(c[1]),t=parseFloat(c[3]),r=parseFloat(c[5]),m=parseFloat(c[7]),e%=360,t/=100,r/=100,e=e<0?0:e>360?360:e,t=t<0?0:t>1?1:t,r=r<0?0:r>1?1:r,o=r<=.5?2*r*t:(2-2*r)*t,a=e/60,s=o*(1-Math.abs(a%2-1)),l=[],a=Math.floor(a),a){case 0:l=[o,s,0];break;case 1:l=[s,o,0];break;case 2:l=[0,o,s];break;case 3:l=[0,s,o];break;case 4:l=[s,0,o];break;case 5:l=[o,0,s];break;default:l=[0,0,0]}u=r-.5*o,d=l[0]+u,f=l[1]+u,h=l[2]+u,d=os(255*d),f=os(255*f),h=os(255*h)}else if(c=/^hsv\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i.exec(p)){switch(e=parseFloat(c[1]),t=parseFloat(c[3]),i=parseFloat(c[5]),e%=360,t/=100,i/=100,e=e<0?0:e>360?360:e,t=t<0?0:t>1?1:t,i=i<0?0:i>1?1:i,o=i*t,a=e/60,s=o*(1-Math.abs(a%2-1)),l=[],a=Math.floor(a),a){case 0:l=[o,s,0];break;case 1:l=[s,o,0];break;case 2:l=[0,o,s];break;case 3:l=[0,s,o];break;case 4:l=[s,0,o];break;case 5:l=[o,0,s];break;default:l=[0,0,0]}u=i-o,d=l[0]+u,f=l[1]+u,h=l[2]+u,d=os(255*d),f=os(255*f),h=os(255*h),m=1}else Ja[p.toLowerCase()]?(n=p.toLowerCase(),d=Ja[n].r,f=Ja[n].g,h=Ja[n].b,m="number"==typeof Ja[n].a?Ja[n].a:1):this._invalid=!0;else"number"==typeof arguments[0]&&arguments[0]>=0&&"argb"===arguments[1]?(m=(4278190080&arguments[0])>>>24,m/=255,d=(16711680&arguments[0])>>16,f=(65280&arguments[0])>>8,h=255&arguments[0]):"number"==typeof arguments[0]&&arguments[0]>=0?(d=(16711680&arguments[0])>>16,f=(65280&arguments[0])>>8,h=255&arguments[0]):this._invalid=!0;else arguments.length>=3?(d=arguments[0],f=arguments[1],h=arguments[2],m=arguments.length>=4?arguments[3]:1):this._invalid=!0;Number.isNaN(+d+f+h+m)&&(this._invalid=!0),this._r=is(d),this._g=is(f),this._b=is(h),this._a=m,this._spaces={}},isInvalid(){return this._invalid},setAlpha(e){this._a=e,this._spaces={}},getAlpha(){return this._a},toRGB:function(){return this._spaces.rgb||(this._spaces.rgb=as.toRGB(this)),this._spaces.rgb},toRGBA:function(){return this._spaces.rgba||(this._spaces.rgba=as.toRGBA(this)),this._spaces.rgba},toString(){return this._spaces.rgb||(this._spaces.rgb=as.toRGB(this)),this._spaces.rgb},toHex:function(){return this._spaces.hex||(this._spaces.hex=as.toHex(this)),this._spaces.hex},toHSL:function(e){return this._spaces.hsl||(this._spaces.hsl=as.toHSL(this,e)),this._spaces.hsl},toHSLA:function(e){return this._spaces.hsla||(this._spaces.hsla=as.toHSLA(this,e)),this._spaces.hsla},toHSV(){const e=this.toHSVComponents();return`hsv(${e.h},${e.s},${e.v})`},toHSVComponents:function(){return this._spaces.hsvComp||(this._spaces.hsvComp=as.toHSVComponents(this)),this._spaces.hsvComp},toNumber:function(){return this._spaces.num||(this._spaces.num=as.toNumber(this)),this._spaces.num},isDark(){return this.isInvalid()||this.getLuminance()<125},getLuminance(){return void 0===this._lumi&&(this._lumi=.299*this._r+.587*this._g+.114*this._b),this._lumi},shiftLuminance(e){const t=this.toHSLA(),n=/^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,(\d(\.\d+)?)\)$/i.exec(t),r=parseFloat(n[1]),i=parseFloat(n[3]);let o=parseFloat(n[5]);const a=parseFloat(n[7]);return o+=e,o=Math.max(0,Math.min(o,100)),`hsla(${r},${i},${o},${a})`},isEqual(e){return e instanceof as||(e=new as(e)),this._r===e._r&&this._g===e._g&&this._b===e._b},blend(e,t){return`rgba(${[is(this._r+(e._r-this._r)*t),is(this._g+(e._g-this._g)*t),is(this._b+(e._b-this._b)*t),is(this._a+(e._a-this._a)*t)].join(",")})`},createShiftedColor(e){(void 0===e||Number.isNaN(+e))&&(e=1);const t=this.getLuminance(),n=this._g<126?1:1+this._g/512,r=this.shiftLuminance(20*(t*n<220?.8+1/(t+1)*4:-(.8+t/255*1))*e);return new as(r)}});as.toRGB=function(e){if(e instanceof as)return`rgb(${[e._r,e._g,e._b].join(",")})`;"string"==typeof e&&(e=as.toNumber(e));return`rgb(${(16711680&e)>>16},${(65280&e)>>8},${255&e})`},as.toRGBA=function(e,t){if(e instanceof as)return`rgba(${[e._r,e._g,e._b,void 0!==t?t:e._a].join(",")})`;"string"==typeof e&&(e=as.toNumber(e));return`rgba(${(16711680&e)>>16},${(65280&e)>>8},${255&e},${void 0!==t?t:e._a})`},as.toHex=function(e){let t,n,r;return e instanceof as?(t=e._r.toString(16),n=e._g.toString(16),r=e._b.toString(16),1===t.length&&(t=`0${t}`),1===n.length&&(n=`0${n}`),1===r.length&&(r=`0${r}`),`#${[t,n,r].join("")}`):("string"==typeof e&&(e=as.toNumber(e)),t=((16711680&e)>>16).toString(16),n=((65280&e)>>8).toString(16),r=(255&e).toString(16),1===t.length&&(t=`0${t}`),1===n.length&&(n=`0${n}`),1===r.length&&(r=`0${r}`),`#${t}${n}${r}`)},as.toHSL=function(e,t){let n,r,i,o=0;"string"==typeof e&&(e=new as(e));const a=e._r/255,s=e._g/255,l=e._b/255,u=Math.max(a,s,l),c=Math.min(a,s,l);if(r=t?.21*a+.72*s+.07*l:(u+c)/2,u===c)n=0,o=0;else{switch(i=u-c,n=r>.5?i/(2-u-c):i/(u+c),u){case a:o=(s-l)/i+(s<l?6:0);break;case s:o=(l-a)/i+2;break;case l:o=(a-s)/i+4}o/=6}return`hsl(${360*o},${100*n},${100*r})`},as.toHSLA=function(e,t){let n,r,i,o=0;"string"==typeof e&&(e=new as(e));const a=e._r/255,s=e._g/255,l=e._b/255,u=e._a,c=Math.max(a,s,l),p=Math.min(a,s,l);if(r=t?.21*a+.72*s+.07*l:(c+p)/2,c===p)n=0,o=0;else{switch(i=c-p,n=r>.5?i/(2-c-p):i/(c+p),c){case a:o=(s-l)/i+(s<l?6:0);break;case s:o=(l-a)/i+2;break;case l:o=(a-s)/i+4}o/=6}return`hsla(${360*o},${100*n},${100*r},${u})`},as.toHSVComponents=function(e){let t,n,r=0;"string"==typeof e&&(e=new as(e));const i=e._r/255,o=e._g/255,a=e._b/255,s=Math.max(i,o,a),l=Math.min(i,o,a),u=s;if(s===l)t=0,r=0;else{switch(n=s-l,t=0===n?0:n/u,s){case i:r=(o-a)/n+(o<a?6:0);break;case o:r=(a-i)/n+2;break;case a:r=(i-o)/n+4}r/=6}return{h:360*r%360,s:100*t,v:100*u}},as.toNumber=function(){if(1===arguments.length&&arguments[0]instanceof as)return(arguments[0]._r<<16)+(arguments[0]._g<<8)+arguments[0]._b;let e,t,n=0,r=0,i=0;return 1===arguments.length&&"string"==typeof arguments[0]&&(t=arguments[0],(e=/^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)$/i.exec(t))?(n=parseInt(e[1],10),r=parseInt(e[2],10),i=parseInt(e[3],10)):(e=/^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/i.exec(t))?(n=parseInt(e[1],16),r=parseInt(e[2],16),i=parseInt(e[3],16)):(e=/^#([A-f0-9])([A-f0-9])([A-f0-9])$/i.exec(t))&&(n=parseInt(e[1]+e[1],16),r=parseInt(e[2]+e[2],16),i=parseInt(e[3]+e[3],16))),(n<<16)+(r<<8)+i},as.blend=function(e,t,n){const r=(16711680&(e=as.toNumber(e)))>>16,i=(65280&e)>>8,o=255&e;return(r+(((16711680&(t=as.toNumber(t)))>>16)-r)*n<<16)+(i+(((65280&t)>>8)-i)*n<<8)+(o+((255&t)-o)*n)},as.getBlend=function(e,t,n){const r=e._r+(t._r-e._r)*n,i=e._g+(t._g-e._g)*n,o=e._b+(t._b-e._b)*n,a=e._a+(t._a-e._a)*n;return new as(r,i,o,a)},as.isCSSColor=function(e){return!(arguments.length>1||"string"!=typeof e)&&(Za.test(e)||Qa.test(e)||es.test(e)||ts.test(e)||ns.test(e)||rs.test(e)||Ja[e.toLowerCase()])},as.getBestContrast=function(e,t,n){const r=e.getLuminance();return Math.abs(r-t.getLuminance())>Math.abs(r-n.getLuminance())?t:n},as.getContrast=function(e,t){if(!e||!t)return;const n=e.getLuminance()/100,r=t.getLuminance()/100;return n>r?(n+.05)/(r+.05):(r+.05)/(n+.05)},as.isDark=function(){const e={getLuminance:as.prototype.getLuminance,isInvalid:as.prototype.isInvalid};return as.prototype.init.apply(e,[].slice.call(arguments)),as.prototype.isDark.call(e)},as.useDarkLabel=function(e,t){return e._a>.5?!e.isDark():!t};const ss={TRANSPARENT_BLACK:"rgba( 0,0,0,0.2 )",TRANSPARENT_WHITE:"rgba( 255,255,255,0.7 )",LIGHT_GREY:"#ccc",DARK_GREY:"#666",BLACK:"#000",WHITE:"#fff",getInverse(e){const t=new as(e);return 0===t.getAlpha()?this.BLACK:t.isDark()?this.WHITE:this.BLACK},getContrastingGrey(e){const t=new as(e);return 0===t.getAlpha()?this.DARK_GREY:as.getBestContrast(t,new as(ss.LIGHT_GREY),new as(ss.DARK_GREY))},getBestContrast:(e,t,n)=>as.getBestContrast(new as(e),new as(t),new as(n)),getContrastingTransparent(e){const t=new as(e);return 0===t.getAlpha()||"none"===e?this.TRANSPARENT_BLACK:t.isDark()?this.TRANSPARENT_WHITE:this.TRANSPARENT_BLACK}};function ls(e,t){return Ue(e,`${t=t?`${t}.`:""}qHyperCube.qDimensionInfo.length`)>1}function us(e,t){if(Ue(e,`${t=t?`${t}.`:""}qHyperCube.qStackedDataPages.0.qData.length`))return Ue(e,`${t}qHyperCube.qStackedDataPages.0.qData.0.qSubNodes.length`,0)+Ue(e,`${t}qHyperCube.qStackedDataPages.0.qData.0.qDown`,0)+Ue(e,`${t}qHyperCube.qStackedDataPages.0.qData.0.qUp`,0);const n=Ue(e,`${t}qHyperCube.qEffectiveInterColumnSortOrder.0`);return cs(Ue(e,`${t}qHyperCube.qDimensionInfo.${n}`))}function cs(e){return e.qCardinalities.qHypercubeCardinal}var ps={getHyperCube:function(e,t){return e&&(e=t?Ue(e,t):e)&&e.qHyperCube?e.qHyperCube:null},hasSecondDimension:ls,hasSecondMeasure:function(e,t){return Ue(e,`${t=t?`${t}.`:""}qHyperCube.qMeasureInfo.length`)>1},getStackedCubeSizeOf2Dims:us,getStackedCubeSizeOfMax2Dims:function(e,t){return ls(e,t)?us(e,t):function(e,t){return Ue(e,(t=t?`${t}.`:"")+"qHyperCube.qSize.qcy")}(e,t)},getOuterDimensionSizeOfMax2Dims:function(e,t){return ls(e,t)?us(e,t):1},getDimensionSize:cs};const ds=function(){this._maxJitter=1};ds.prototype.calcMaxJitter=function(e,t,n){this._maxJitter=Math.min(e*t,n-e)},ds.prototype.getJitterValue=function(e){const t=Math.abs(jo(`${e}`)%10)/9;return this._maxJitter/2-t*this._maxJitter};var fs={toBefore:function(e){const t=e.qUndoExclude.qHyperCube;2===t.qEffectiveInterColumnSortOrder.length&&0===t.qEffectiveInterColumnSortOrder[0]&&(t.qEffectiveInterColumnSortOrder=[1,0],t.qDimensionInfo.reverse())},toAfter:function(e){const t=e.qUndoExclude.qHyperCube;2===t.qEffectiveInterColumnSortOrder.length&&1===t.qEffectiveInterColumnSortOrder[0]&&(t.qEffectiveInterColumnSortOrder=[0,1],t.qDimensionInfo.reverse())}};var hs={generateHyperCube:function(e,t,n,r){t.qUndoExclude||(t.qUndoExclude={}),t.qUndoExclude.qHyperCubeDef=E(!0,{},t.qHyperCubeDef),t.qUndoExclude.qHyperCubeDef.qDimensions.reverse(),Di.updateHypercubeAttributes(t,"qUndoExclude.qHyperCubeDef.",t.color.point);let i=[];const o=t.qUndoExclude.qHyperCubeDef.qDimensions.length,a=t.color.point&&!t.color.point.auto&&"byExpression"===t.color.point.mode;if(o>0&&a){i=[yi.create(yi.IDMAP.COLOR_BY_EXPRESSION,{qExpression:wr(t,"color.point.expression.qValueExpression.qExpr")})]}return t.qUndoExclude.qHyperCubeDef.qMeasures[0].qAttributeExpressions=i,mi.hasMultipleDimensions(t)?Jr.getAllHyperCubeExpressions(t.qHyperCubeDef,e.qHyperCube,n).then(i=>{Yi.applySorting(t,e,n,i,r);const o=i.dimensions[0],a=i.dimensions[1],s=i.measures[0],l=Ui.getFractileExpression(1,o,a,s),u=Ui.getFractileExpression(0,o,a,s);t.qUndoExclude.qHyperCubeDef.qDimensions[0].qAttributeExpressions=[{qExpression:u,id:"minBoxValue"},{qExpression:l,id:"maxBoxValue"}]}):(t.qUndoExclude.qHyperCubeDef.qInterColumnSortOrder=[1,0],Promise.resolve())}};const ms=e=>e.baseColor||e.coloring&&e.coloring.baseColor;function gs(e){const{qDimensionInfo:t,qMeasureInfo:n}=e.qUndoExclude.qHyperCube,r=t.some(ms),i=n.some(ms),o=e.color.point.useBaseColors;return"measure"===o&&!i||"dimension"===o&&!r?"off":o}function ys({layout:e,localeInfo:t,model:n,picasso:r,environment:i}){const{app:o,theme:a,translator:s}=i,l=E(!0,{},e.color.point);var u;return 2===e.qHyperCube.qDimensionInfo.length&&(0===(null==(u=l.byDimDef)?void 0:u.activeDimensionIndex)?u.activeDimensionIndex=1:1===(null==u?void 0:u.activeDimensionIndex)&&(u.activeDimensionIndex=0)),function(e){var t,n;return!(!e.snapshotData||null!==(t=e.snapshotData.content)&&void 0!==t&&null!==(t=t.chartData)&&void 0!==t&&t.legendDataPage||null===(n=e.qUndoExclude)||void 0===n||!n.legendData)}(e)&&(e=function(e){return(e=E({},e)).snapshotData=E({},e.snapshotData),e.snapshotData.content=E({},e.snapshotData.content),e.snapshotData.content.chartData=E({},e.snapshotData.content.chartData),e.snapshotData.content.chartData.legendDataPage=e.qUndoExclude.legendData.qDataPages,e}(e)),l.mode||(l.mode="primary"),Er({app:o,model:n,picasso:r,translator:s,config:{localeInfo:t,theme:a,key:"color",definitionPath:"/qUndoExclude/qHyperCubeDef"},createConfig:()=>({layout:e,hc:e.qUndoExclude.qHyperCube,legendProps:e.legend,colorProps:{...l,useBaseColors:gs(e)}})})}const bs=fi.DATA_PATH,vs=fi.HYPERCUBE_PATH,qs=fi.HYPERCUBE_DEF_PATH;function xs(e){return Array.isArray(e)?e:e?[e]:[]}function Ds(e){return Math.min(ps.getOuterDimensionSizeOfMax2Dims(e,bs),fi.MAX_STACKED_VALUES)}function Ss(e,t){return{viewSize:t,max:Ds(e)}}function Cs(){const e=fi.MAX_STACKED_VALUES>=this.layout.qUndoExclude.qHyperCube.qSize.qcy?3:1;this.backendApi.setCacheOptions({height:e*this._scrollHandler.getScrollViewSizeInItem(),width:3})}function Ms(){if(this.layout&&ps.hasSecondDimension(this.layout,bs)){this._scrollHandler.onResize();!!this.layout.snapshotData||Cs.call(this)}}function Es(){const e=this.chartInstance.component("legend");e&&e.emit&&e.emit("resetindex")}function As(e,t){return wr(e,`qHyperCube.qDimensionInfo.${t}.qIsOneAndOnlyOne`)||!1}const Is=zo.extend("DistributionPlot",{namespace:".distributionPlot",init({lasso:e,environment:t,flags:n,picasso:r,$element:i,backendApi:o,selectionsApi:a}){this._super(r,i,t,o,a),this.flags=n,this.picasso=r,this.picassoElement.__do_not_use_findShapes=this.chartInstance.findShapes.bind(this.chartInstance),this._derivedProperties=new aa,this._selectionHandler=ga.create({model:o.model,chartInstance:this.chartInstance,selectionsApi:a,isLassoDisabled:this.isLassoDisabled.bind(this),selectPaths:["/qUndoExclude/qHyperCubeDef"],lasso:e}),this._tooltipHandler=Ha.create(this.chartInstance,i,fi.CHART_ID),this._scrollHandler=new Ba(this.chartInstance,i,this.getSlicedData.bind(this),this.onScrollCallback.bind(this),"colorLegend-cat"),this._maxBubbleScale=fi.BUBBLE_SCALES_MAX,this._jitterTool=new ds,this.setDataPaths([`${bs}/${vs}`])},onScrollCallback(e,t,n){const r=this;this._updateColorMapData(e).then(()=>{r.updateChart(e,t,n)})},getSlicedData(e,t){const n=this;return this.getData(this.backendApi,this.layout[bs][vs],{top:e,height:t}).then(()=>n.layout)},updateScrollHandlerState(e){void 0!==e&&(this._disableScrolling=!!e),this._scrollHandler.setDisabled(!ps.hasSecondDimension(this.layout,bs)||this._disableScrolling)},updateConstraints(e){const t=!e.active,n=!e.passive,r=!e.select&&!e.active;this._scrollHandler[t?"on":"off"](),this._tooltipHandler[n?"on":"off"](),this._selectionHandler[r?"on":"off"]()},off(){this._scrollHandler.off(),this._tooltipHandler.off(),this._selectionHandler.off()},_getPointScale(){return(e=this.layout).dataPoint&&e.dataPoint.bubbleScales?this.layout.dataPoint.bubbleScales/this._maxBubbleScale:1;var e},_calcBandwidth(e,t){const n=t.scales().dimension;this._bandwidthRatio=n?n.pxScale(e).bandwidth():1,this._bandwidthPx=e*this._bandwidthRatio},_calcPointMaxSize(e,t){const n=Math.min(fi.MAX_POINT_BASE_SIZE_PX,t*fi.POINT_BANDWIDTH_BASE_RATIO)*e;this._pointMaxSizePx=Math.max(fi.MIN_POINT_PIXELS,n)},_calcPointSize(e,t){this._pointSize=e/t},_getDimAxisSettings(e,t){const n=xs(t.trigger),r=xs(t.consume),i=this.picassoElement.getBoundingClientRect()["vertical"===e.orientation?"height":"width"],o=Xa.getAdjustedMaxGlyphCount(function(e){const t=e[bs][vs].qDimensionInfo,n=ps.hasSecondDimension(e,bs)?t[0].qApprMaxGlyphCount:0;return Math.min(fi.MAX_GLYPH_COUNT,n)}(this.layout||e),e[bs][vs].qStackedDataPages[0].qData[0].qSubNodes),a=i/4;return{brush:{trigger:n,consume:r},settings:{labels:{mode:"vertical"===e.orientation?e.dimensionAxis.label:"auto",maxGlyphCount:o,maxLengthPx:a},paddingEnd:4}}},_getBoxMarkerSettings(e,t){const{theme:n}=this.environment,r=e.color.point.auto?n.getStyle(fi.CHART_ID,"box","fill"):n.getColorPickerColor(e.color.box.paletteColor),i=xs(t.trigger),o=xs(t.consume),a=this;let s="qMeasureInfo/0",l="qMeasureInfo/0";ps.hasSecondDimension(e,bs)&&e.qUndoExclude.qHyperCube.qDimensionInfo[0].qAttrExprInfo.length&&(s="qDimensionInfo/0/qAttrExprInfo/0",l="qDimensionInfo/0/qAttrExprInfo/1");const u={require:["chart"],displayOrder:1e3,settings:{chart:this,box:{fill:r,stroke:n.getStyle(fi.CHART_ID,"box","stroke"),strokeWidth:0,width:fi.POINT_BANDWIDTH_BASE_RATIO,maxWidthPx:fi.MAX_POINT_BASE_SIZE_PX,minWidthPx:fi.MIN_POINT_PIXELS+2*fi.BOX_PADDING},minor:{scale:"measure"},orientation:e.orientation},beforeRender(){const e=a.layout.presentation&&a.layout.presentation.visibleComponents&&-1!==a.layout.presentation.visibleComponents.indexOf("point"),t="horizontal"===a.layout.orientation?this.rect.height:this.rect.width;a._calcBandwidth(t,this.chart),a._calcPointMaxSize(e?a._getPointScale():1,a._bandwidthPx);let n=0;a._jitter&&(a._calcPointSize(a._pointMaxSizePx,a._bandwidthPx),n=a._pointSize*a._bandwidthPx*fi.JITTER_PARAMETER);const r=a._pointMaxSizePx+n+2*fi.BOX_PADDING,i=r/a._bandwidthPx;this.settings.settings.box.maxWidthPx=Math.min(a._bandwidthPx-2,r),this.settings.settings.box.width=i},brush:{trigger:i,consume:o},data:{extract:{field:"qDimensionInfo/0",trackBy:()=>-1,props:{start:{field:s,reduce:"min"},end:{field:l,reduce:"max"},elemNo:{field:"qDimensionInfo/0"}}}}};return ps.hasSecondDimension(e,bs)&&(u.data.extract.field="qDimensionInfo/0",u.data.extract.trackBy=function(e){return e.qElemNo},u.settings.major={scale:"dimension"}),u},_getPointMarkerSettings(e,t,n){let r=1;e.dataPoint&&!1===e.dataPoint.border&&(r=0);const i=xs(t.trigger),o=xs(t.consume);this._tooltipHandler.isOn()&&(i.push(n.point.trigger),o.push.apply(o,n.point.consume));const a=this,s=this.colorService.getColor(),l={require:["chart"],displayOrder:1100,settings:{chart:this,fill:s,stroke:e=>{const t=s(e);return ss.getContrastingTransparent(t)},size:.3,strokeWidth:r,sizeLimits:{maxRelExtent:10,maxPx:fi.MAX_POINT_BASE_SIZE_PX,minPx:fi.MIN_POINT_PIXELS},orientation:e.orientation},beforeRender(){const e="horizontal"===a.layout.orientation?this.rect.height:this.rect.width;if(a._calcBandwidth(e,this.chart),a._calcPointMaxSize(a._getPointScale(),a._bandwidthPx),a._calcPointSize(a._pointMaxSizePx,a._bandwidthPx),a._jitter){const t=2*fi.BOX_PADDING/e;a._jitterTool.calcMaxJitter(a._pointSize*a._bandwidthRatio,fi.JITTER_PARAMETER,a._bandwidthRatio-t)}this.settings.settings.sizeLimits.maxPx=a._pointMaxSizePx,this.settings.settings.size=a._pointSize},brush:{trigger:i,consume:o},data:{extract:{field:"qDimensionInfo/0",props:{innerElemNo:{field:"qDimensionInfo/0"},elemNo:{field:"qDimensionInfo/0"},inner:{field:"qDimensionInfo/0",value:e=>e},row:{field:"qDimensionInfo/0",value:e=>e.qRow},measure:{field:"qMeasureInfo/0",reduce:"first",value:e=>e,reduceLabel:"none"},...this.colorService.getDatumProps()}}}};return ps.hasSecondDimension(e,bs)&&(l.data.extract.props.inner.field="qDimensionInfo/1",l.data.extract.props.innerElemNo.field="qDimensionInfo/1",l.data.extract.props.row.field="qDimensionInfo/1",l.data.extract.field="qDimensionInfo/1",l.data.extract.props.outer={field:"qDimensionInfo/0",value:e=>e}),this.setDataPaths([`${bs}/${vs}`]),l},_getPointSelectionLayerSettings(e){const t=E(!0,{},e,{key:"selection-point-marker",settings:{opacity:0}});return t.brush.consume.pop(),t.brush.consume.forEach(e=>{e.style.inactive=void 0,e.style.active.opacity=1}),t.brush.trigger=[],t},createChartSettings(e){const t=this.isRtl(),{theme:n}=this.environment,r=!!e.snapshotData,i=e.presentation&&e.presentation.visibleComponents,o=i&&-1!==e.presentation.visibleComponents.indexOf("point"),a=i&&-1!==e.presentation.visibleComponents.indexOf("box");this._jitter=o&&e.dataPoint&&"jitter"===e.dataPoint.displacement;const s=e[bs][vs],l=s.qDimensionInfo,u="horizontal"!==e.orientation?"y":"x",c="horizontal"!==e.orientation?"x":"y",p=Po.create({chartID:fi.CHART_ID,theme:n,isRtl:t,flags:this.flags});if(0===s.qStackedDataPages[0].qData.length)return p.getSettings();let d={},f={},h={},m={};if(this._selectionHandler.isOn()){const t=!o&&ps.hasSecondDimension(e,bs);this._selectionHandler.setUpStart();const n=this._selectionHandler.setUpBrush({contexts:["select-inner"],data:["innerElemNo"],isSingleSelect:As(e,0)},!0),r=this._selectionHandler.setUpBrush({contexts:["select-outer"],data:["elemNo"],isSingleSelect:As(e,1)},!0),i=this._selectionHandler.setUpBrush({dataPath:bs,contexts:["select-color"],data:["color"],startOnEmptySelection:!1},!0),a=this._selectionHandler.setUpBrush({contexts:["select-measure"],data:[u]},!0);this._selectionHandler.setUpDone(),d={trigger:E(!0,{},r.trigger,{data:[""]}),consume:[E(!0,{},r.consume,{data:[""]})]},f={trigger:t?r.trigger:null,consume:[n.consume,r.consume,a.consume]},h={trigger:n.trigger,consume:[n.consume,r.consume,a.consume,i.consume]},m={trigger:[E(!0,{},i.trigger,{data:[""]})],consume:[E(!0,{},i.consume,{data:[""]}),n.consume,r.consume]}}const g={point:{},box:{}};this._tooltipHandler.isOn()&&(g.point=this._tooltipHandler.setUp({chartBuilder:p,colorService:this.colorService,data:ps.hasSecondDimension(e,bs)?["innerElemNo","elemNo"]:["innerElemNo"],contexts:["pointTip"],componentKey:"point-marker",environment:this.environment,attrDimPath:`/${vs}/qDimensionInfo/${ps.hasSecondDimension(e,bs)?1:0}/qAttrDimInfo/0`,measureRows:["measure"],labelData:ps.hasSecondDimension(e,bs)?["inner","outer"]:["inner"]}));const y=function(e){const t=[],n=e.qUndoExclude&&e.qUndoExclude.qHyperCube&&e.qUndoExclude.qHyperCube.qDimensionInfo?e.qUndoExclude.qHyperCube.qDimensionInfo:void 0;if(!n)return!1;for(let e=0;e<n.length;e++)n[e].qLocked?t.push(n[e].qLocked):t.push(!1);return t}(e),b=function(e,t,n){const r={};return 1===e.length?(r.isOpenDim=!1,e[0]?r.isOpenMea=!1:r.isOpenMea=!0):e[0]&&!e[1]?(r.isOpenDim=!1,r.isOpenMea=!0):!e[0]&&e[1]?(r.isOpenDim=!0,r.isOpenMea=!1):e[0]&&e[1]?(r.isOpenDim=!1,r.isOpenMea=!1):(r.isOpenDim=!0,r.isOpenMea=!0),t&&(r.isOpenMea=!1),n&&(r.isOpenDim=!1),r}(y,As(e,0),As(e,1)),v={scrollHandler:this._scrollHandler,selectionHandler:this._selectionHandler},q={componentKey:o?"point-marker":"box-marker",lassoBrushKey:"select-inner",dimRangeBrushKey:"select-outer",measureRangeBrushKey:"select-measure",areaBrushKey:null,legendBrushKey:"legend"};if(this._dependentActions&&this._dependentActions.destroy(),this._dependentActions=Ma.create(v,e.orientation,t,q,b),p.addPreset("dimension-measure-chart",{isRtl:t,includeDimensionAxis:ps.hasSecondDimension(e,bs),orientation:e.orientation,selectionsEnabled:this._selectionHandler.isOn(),theme:n,measureSource:["qMeasureInfo/0"],dimensionSource:"qDimensionInfo/0",measureAxisProperties:e.measureAxis,measureTitleText:s.qMeasureInfo[0].qFallbackTitle,dimensionAxisProperties:e.dimensionAxis,dimensionAxisSettings:this._getDimAxisSettings(e,d),dimensionTitleText:l&&l[0]&&l[0].qFallbackTitle||"",gridlines:e.gridlines,hasNavigation:!r,isNavigationEnabledFn:()=>this._scrollHandler.isOn(),scrollSettings:Ss(e,this._scrollHandler.getScrollViewSizeInItem()),enableLasso:!0,lasso:{brushKey:o?"select-inner":"select-outer",brushComponents:o?["point-marker"]:["box-marker"],brushData:o?["innerElemNo"]:["elemNo"]},enableDimRange:!0,dimRange:{brushKey:"select-outer",brushAxis:"horizontal"===e.orientation?"y-axis":"x-axis",brushArea:a?"box-marker":"point-marker",brushScale:"dimension"},enableMeasureRange:o,measureRange:{brushKey:"select-measure",brushAxis:"horizontal"===e.orientation?"x-axis":"y-axis",brushArea:o?"point-marker":"box-marker",brushScale:"measure",multiple:!0},brushActions:this._dependentActions.gestures,refLines:e.refLine&&e.refLine.refLines,axisTitleStyle:ui(fi.CHART_ID,n,e),axisLabelStyle:ci(fi.CHART_ID,n,e)}),a){const t=this._getBoxMarkerSettings(e,f);p.addComponent("box-marker",t)}if(o){const r=this._getPointMarkerSettings(e,h,g);if(r.data.extract.props[u]={field:"qMeasureInfo/0"},r.settings[u]={scale:"measure"},ps.hasSecondDimension(e,bs)&&(r.data.extract.props[c]={field:"qDimensionInfo/0",type:"qual"},r.settings[c]={scale:"dimension"}),this._jitter){r.settings[c]=r.settings[c]||{};const e=this._jitterTool;r.settings[c].fn=function(t){let n;return n="function"==typeof t.scale?t.scale(t.datum[c].value)+.5*t.scale.bandwidth():.5,n+e.getJitterValue(t.datum.value,fi.JITTER_PARAMETER)}}p.addComponent("point-marker",r),p.addComponent("point-marker",this._getPointSelectionLayerSettings(r));if(e.legend?!1!==e.legend.show:!e.color.point.auto&&"byDimension"===e.color.point.mode){const r={title:pi(fi.CHART_ID,n,e,this.flags),label:di(fi.CHART_ID,n,e,this.flags)};this.addLegend(p,t,m,r)}}const x=p.getSettings();return this.addSnapshotChartSettings(x,e),x.scales={...x.scales,...this.colorService.getScales()},x.palettes=this.colorService.getPalettes(),x},addLegend(e,t,n,r){const i={eventName:"legend-c",key:"colorLegend",styleReference:"object.comboChart",styleOverrides:r,rtl:t,settings:{item:{shape:{type:"circle",size:10}}}},o=this.colorService.getLegend(i,{actions:{interact:{enabled:()=>this._scrollHandler.isOn()}}});let{components:a}=o;a=a.filter(e=>!!e),a.length>0&&(this._selectionHandler.isOn()&&(a[0].brush={consume:n.consume.map(e=>E(!0,e,{style:{active:null}})),trigger:n.trigger}),a[0].layout.displayOrder=200,a[0].layout.prioOrder=50),e.settings.components.push(...a),e.settings.interactions[0].gestures.unshift(...o.interactions)},resize(){this.layout&&(Ms.call(this),this._super())},hasValidData(){const e=this.layout;return e[bs]&&e[bs][vs]&&e[bs][vs].qStackedDataPages.length&&e[bs][vs].qStackedDataPages[0].qData},paint(){const e=!!this.layout.snapshotData;e||this.environment.options.viewState||this.updateScrollHandlerState(!1),this._orientation||(this._orientation=this.layout.orientation),this._orientation!==this.layout.orientation&&(Ms.call(this),this._orientation=this.layout.orientation);const t=this.layout;if(!this.hasValidData())return Promise.resolve();const n=this,r=this._super;return!e&&ps.hasSecondDimension(t,bs)&&this._scrollHandler.isDataSizeChanged(wr(t,`${bs}.${vs}.qStackedDataPages.0.qData.0.qSubNodes.length`),ps.getOuterDimensionSizeOfMax2Dims(t,bs))?this._scrollHandler.getViewData().finally(()=>n._updateColorMapData(t).then(()=>r.call(n))):this._updateColorMapData(t).then(()=>r.call(n))},async setSnapshotData(e){this._super(e);const t=await this.colorService.getSnapshotData();return e.snapshotData.content.chartData={...e.snapshotData.content.chartData,...t},e[bs][vs].qStackedDataPages=this.layout[bs][vs].qStackedDataPages,fs.toBefore(e),e},getViewState(){return{scroll:Math.round(this._scrollHandler.getScrollState())}},getDisclaimerAttributes(e){const t=!this.flags.isEnabled("SHOW_DISCLAIMER")||!(!1===e.showDisclaimer),n=!ps.hasSecondDimension(e,bs)&&e.qHyperCube.qSize.qcy>1e4||ps.hasSecondDimension(e,bs)&&e.qHyperCube.qSize.qcy>=fi.MAX_STACKED_VALUES,r=t&&n,i=Ss(e,this._scrollHandler.getScrollViewSizeInItem());return{data:e&&e.qUndoExclude,supportedDisclaimers:{LimitedData:t&&r},options:{paddingBottom:r&&i&&i.viewSize<i.max,supportNegative:!0,explicitLimitedData:r}}},async _updateColorMapData(e){this.colorService=ys({layout:e,localeInfo:this.localeInfo,model:this.backendApi.model,picasso:this.picasso,environment:this.environment}),await this.colorService.initialize();const t=this.colorService.getSettings().field,n=this.chartInstance.brush("select-color");/qAttrDimInfo/.test(t)&&n.addKeyAlias("attrDim/qDimensionInfo/0",`${bs}/${vs}/${t}`)},_createColorLegendCube(e){const t=ps.hasSecondDimension(this.layout,bs)?1:0;return{qDimensionInfo:[this.layout[bs][vs].qDimensionInfo[t].qAttrDimInfo[0]],qMeasureInfo:[],qDataPages:e,qMode:"S",qSize:{qcx:1,qcy:e[0].qMatrix.length}}},_updateColorData(){return this._updateColorMapData(this.layout)},updateDerivedProperties(e,t){const{app:n,translator:r}=this.environment,i=this,o=i.backendApi.model;return i._derivedProperties.addDefaultHyperCubeHash(e.qHyperCubeDef,t.qHyperCube,n,function(e){return{cube:e[qs],sorting:e.sorting,color:{point:e.color.point}}}(e)).then(a=>{const s={layout:t,properties:e,model:o,hashData:a,generateDerivedProperties:(e,t)=>hs.generateHyperCube(e,t,n,r)};return i._derivedProperties.updateDerivedProperties(s)})},updateData(e){const t=this,n=!!e.snapshotData;return t._super(e).then(()=>{if(t._destroyed)return Promise.reject();if(e=t.layout,t._scrollHandler.setOptions({direction:"horizontal"===e.orientation?"vertical":"horizontal"}),n)return fs.toAfter(e),t._updateColorMapData(e);t.updateScrollHandlerState(!0);const{viewState:r}=t.environment.options;let i;return r?(t._scrollHandler.updateViewState(Ds(e)),t._scrollHandler.setScrollState(r.scroll)):(t._scrollHandler.resetScroll(),Es.call(t)),t._scrollHandler.getScrollViewSizeInItem()&&!t._cacheSizeInitialized&&(Cs.call(t),t._cacheSizeInitialized=!0),i=ps.hasSecondDimension(e,bs)?t.getSlicedData(t._scrollHandler.getScrollState(),t._scrollHandler.getScrollViewSizeInItem()):t.getData(t.backendApi,e[bs][vs],{height:e[bs][vs].qSize.qcy||1}),i.then(()=>t._destroyed?Promise.reject():t._updateColorData())})},isLassoDisabled(){const e=this.layout;return!!(e.qHyperCube.qDimensionInfo&&e.qHyperCube.qDimensionInfo.length>1&&As(e,0))}}),ws={enabled:!0,delay:50};function Os(){const e={};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e}class Ts{constructor({onSend:e}){this.options={},this.ongoingRequests=[],this.queuedRequests=[],this.recentRequests=[],this.resolvedRequests=[],this._debounceTimer=null,this._latestResolvedRequestedAt=-1,this.onSend=e,this.setOptions({})}destroy(){this.clear(),this.recentRequests=[],this.resolvedRequests=[],this.onSend=null,this.onCancel=null}setOptions(e){this.options=E(!0,{},ws,this.options,e),this.enabled=this.options.enabled||!1,this.delay=this.options.delay||-1}clear(){let e;for(clearTimeout(this._debounceTimer);this.queuedRequests.length;)e=this.queuedRequests.pop(),e.dfd.reject();for(;this.ongoingRequests.length;)e=this.ongoingRequests.pop(),e.dfd.reject()}queue(e){const t=this.enabled?this.delay:-1,n=Date.now(),r={data:e,dfd:Os(),wrapper:Os(),requestedAt:n},i=Math.max(this._getAvgResolutionTime(),t),o=t<1,a=this.recentRequests.length<1,s=a||n-this.recentRequests.slice(-1)[0].requestedAt>i,l=n>this._latestResolvedRequestedAt+t;return o||a||s||l?ks.apply(this,[r,0]):ks.apply(this,[r,Math.min(t,1e3)]),this.recentRequests.push(r),this.recentRequests.length>10&&(this.recentRequests=this.recentRequests.slice(-10)),r.dfd.promise}updateResolutionTime(){this._latestResolvedRequestedAt=Date.now()}_getAvgResolutionTime(){let e;return this.resolvedRequests.length&&(e=0,this.resolvedRequests.forEach(t=>{e+=t.respondedAt-t.sentAt}),e/=this.resolvedRequests.length),e}}function ks(e,t){const n=this;this.queuedRequests.push(e),clearTimeout(this._debounceTimer),t>=10?this._debounceTimer=setTimeout(()=>{Ns.call(n)},t):Ns.call(n)}function Ns(){if(this.ongoingRequests.length)return void(this.waitingForResponse=!0);let e=this.queuedRequests.pop();for(e&&Ls.call(this,e);this.queuedRequests.length;)e=this.queuedRequests.shift(),e.dfd.reject()}function Ls(e){this.waitingForResponse=!1,this.ongoingRequests.push(e);const t=this,n=e.wrapper;e.sentAt=Date.now(),n.promise.then(function(...n){t.ongoingRequests.splice(t.ongoingRequests.indexOf(e),1),e.respondedAt=Date.now(),t.resolvedRequests.push({sentAt:e.sentAt,respondedAt:e.respondedAt,requestedAt:e.requestedAt}),t.resolvedRequests.length>10&&(t.resolvedRequests=t.resolvedRequests.slice(-10)),e.requestedAt>t._latestResolvedRequestedAt?e.dfd.resolve(...n):e.dfd.reject(),t._latestResolvedRequestedAt=e.requestedAt},function(...n){t.ongoingRequests.splice(t.ongoingRequests.indexOf(e),1),e.respondedAt=Date.now(),e.dfd.reject(...n)}).finally(()=>{t.waitingForResponse&&Ns.call(t)}),this.onSend(e.data,n)}const Ps=new Qe(0,0,0,0),_s=new Qe(0,0,0,0);class Rs{constructor(){this.pages=[]}get(e){return e.map(e=>this.getPage(e))}getPage(e){const t=[];for(let n=0;n<this.pages.length;n++){const r=this.pages[n].qArea;Ps.set(e.qLeft,e.qTop,e.qWidth,e.qHeight),_s.set(r.qLeft,r.qTop,r.qWidth,r.qHeight);const i=_s.intersection(Ps,!0);if(t.push({coverage:i?i.clone():new Qe(0,0,0,0),idx:n}),r.qLeft<=e.qLeft&&r.qLeft+r.qWidth>=e.qLeft+e.qWidth&&r.qTop<=e.qTop&&r.qTop+r.qHeight>=e.qTop+e.qHeight)return this._extract(e,this.pages[n])}return t.sort((e,t)=>t.coverage.width*t.coverage.height-e.coverage.width*e.coverage.height),t[0].coverage.height>0&&t[0].coverage.width>0?this._extract(e,this.pages[t[0].idx]):{qArea:{qTop:e.qTop,qLeft:e.qLeft,qWidth:0,qHeight:0},qData:[]}}destroy(){this.clear()}isEmpty(){return!(this.pages&&this.pages[0]&&this.pages[0].qArea.qHeight&&this.pages[0].qArea.qWidth)}clear(){this.pages=[]}store(e){this.pages=e}containsArea(e){for(let t=0;t<this.pages.length;t++){const n=this.pages[t].qArea;if(n.qLeft<=e.qLeft&&n.qLeft+n.qWidth>=e.qLeft+e.qWidth&&n.qTop<=e.qTop&&n.qTop+n.qHeight>=e.qTop+e.qHeight)return!0}return!1}contains(e){return!(!this.pages||!this.pages.length)&&0===e.filter(e=>!this.containsArea(e)).length}_extract(e,t){Ps.set(e.qLeft,e.qTop,e.qWidth,e.qHeight),_s.set(t.qArea.qLeft,t.qArea.qTop,t.qArea.qWidth,t.qArea.qHeight);const n=Ps.intersection(_s,!0);if(!n)return{qArea:{qTop:e.qTop,qLeft:e.qLeft,qWidth:0,qHeight:0},qData:[]};const r=Math.max(0,e.qTop-t.qArea.qTop),i=t.qData[0],o=i.qSubNodes,a={};for(const e in i)i.hasOwnProperty(e)&&(a[e]="qSubNodes"===e?o.slice(r,r+n.height):i[e]);return a.qUp+=r,a.qDown+=t.qArea.qHeight-n.height-r,{qArea:{qTop:n.y,qLeft:n.x,qWidth:n.width,qHeight:n.height},qData:[a]}}}const Hs={mode:"S",enabled:!0,debouncing:{enabled:!0,delay:50},height:250,width:250,maxTotalArea:1e4},Fs=Ze.extend("CacheCube",{init(e,t,n,r){this.model=e,this.responseProperty=t,this.options={},this.cubeHeight=0,this.cubeWidth=0,this.setOptions(r||{}),this.setPath(n),"K"===this.options.mode?this.cube=new Rs:"P"===this.options.mode?this.cube=new ut:this.cube=new nt,this.throttle=new Ts({onSend:(e,t)=>{const n=this._getDirections(this.throttle.recentRequests.map(e=>({top:e.data[0].qTop,left:e.data[0].qLeft}))),r=this._getAreasToCache(e,n.vertical,n.horizontal);this.cacheData(r,e).then(e=>{this.cube?t.resolve(e):t.reject()},()=>{t.reject()})}}),this._modelBinding=()=>{this.clear()},this.model.on("changed",this._modelBinding)},destroy(){this.cube.destroy(),this.throttle.destroy(),this.model&&this.model.removeListener&&this.model.removeListener("changed",this._modelBinding),this._modelBinding=null,delete this.model,delete this.throttle,delete this.cube},setMethodName(e){this.method=e},setPath(e){this.path=e},setCubeSize(e){this.cubeHeight=e.qcy,this.cubeWidth=e.qcx},setOptions(e){e&&(this.options=E(!0,{},Hs,this.options,e),this.cacheHeight=this.options.height,this.cacheWidth=this.options.width,this.enabled=this.options.enabled||!1,this.debouncing={enabled:this.options.debouncing.enabled||!1,delay:this.options.debouncing.delay||-1})},clear(){this.cube&&this.cube.clear(),this.throttle&&this.throttle.clear()},set(e){this.clear(),e&&e.length&&this.cube.store(e)},cacheData(e,t){const n=function(e){return this.cube?(this.cube.store(e),this.cube.get(t)):e};return"getHyperCubeStackData"===this.method&&this.options.maxStackedValues?this.model[this.method](this.path,e,this.options.maxStackedValues).then(n.bind(this)):this.model[this.method](this.path,e).then(n.bind(this))},getData(e){if(!this.model)return Promise.reject();if(!this.enabled||!this.cubeHeight||!this.cubeWidth)return"getHyperCubeStackData"===this.method&&this.options.maxStackedValues?this.model[this.method](this.path,e,this.options.maxStackedValues):this.model[this.method](this.path,e);let t,n;const r=[];for(t=0;t<e.length;++t)n=e[t],r.push({qTop:Math.max(Math.floor(n.qTop),0),qLeft:Math.max(n.qLeft,0),qHeight:Math.min(n.qHeight,this.cubeHeight-Math.floor(n.qTop)),qWidth:Math.min(n.qWidth,this.cubeWidth-n.qLeft)});return this.cube.contains(r)?(this.throttle.updateResolutionTime(),Promise.resolve(this.cube.get(r))):0===r[0].qTop&&this.cube.isEmpty()&&this.throttle.ongoingRequests.length+this.throttle.queuedRequests.length===0?(this.throttle.updateResolutionTime(),this.cacheData(r,r)):this.throttle.queue(r)},_getDirections(e){if(!e||e.length<2)return{vertical:0,horizontal:0};const t=e.slice(-2),n=t[1].top-t[0].top,r=t[1].left-t[0].left;return{vertical:n<0?-1:n>0?1:0,horizontal:r<0?-1:r>0?1:0}},_getAreasToCache(e,t,n){let r,i,o,a,s,l,u,c,p;const d=[];let f=this.cacheHeight;for(void 0===t&&(t=0),void 0===n&&(n=0),this.cacheHeight*this.cacheWidth*e.length>this.options.maxTotalArea&&(f=Math.floor(this.options.maxTotalArea/(e.length*this.cacheWidth))),r=0;r<e.length;++r)i=0!==t?Math.floor(.5*Math.max(0,f-e[r].qHeight)):0,o=0!==n?Math.floor(.5*Math.max(0,this.cacheWidth-e[r].qWidth)):0,a=i*t-i,s=o*n-o,l=0!==t?Math.max(0,Math.min(Math.max(e[r].qHeight,f),this.cubeHeight)):e[r].qHeight,u=0!==n?Math.max(0,Math.min(Math.max(e[r].qWidth,this.cacheWidth),this.cubeWidth)):e[r].qWidth,c=Math.max(0,Math.min(e[r].qTop+a,this.cubeHeight-l)),p=Math.max(0,Math.min(e[r].qLeft+s,this.cubeWidth-u)),d.push({qTop:c,qHeight:l,qLeft:p,qWidth:u});return d}}),Bs=fi.DATA_PATH,Vs=fi.HYPERCUBE_DEF_PATH;class zs{constructor(e){this.model=e,this.path=`/${Bs}/${Vs}`,this.cacheCube=new Fs(e,"qDataPages",this.path,{mode:"K"}),this.cacheCube.setMethodName("getHyperCubeStackData"),this.cacheCube.setOptions({maxStackedValues:fi.MAX_STACKED_VALUES})}setPath(e){this.path=e}setCacheOptions(e){this.cacheCube.setOptions(e)}updateCache(e){let t,n;"qHyperCube"===this.dataPath?t=e&&e.qHyperCube:(n=this.dataPath.slice(0,this.dataPath.indexOf("qHyperCube")-1),t=e&&e[n]&&e[n].qHyperCube),e.qSelectionInfo.qInSelections||this.cacheCube.setCubeSize({qcx:t.qSize.qcx,qcy:ps.getStackedCubeSizeOfMax2Dims(e,n)}),this.backendStackThrottle.clear()}getData(e,t){const n=this.cacheCube;return t?this.model.getHyperCubeData(t,e):this.cacheCube.getData(e).then(e=>(e[0]&&e[0].qData[0]&&e[0].qData[0].qSubNodes.some(e=>e.qDown>0)&&n.clear(),e))}}function js(E){return function(e){if(e&&e.get&&e.add){const t="Object.Disclaimer.LimitedData";if(e.get(t)!==t)return;Object.keys(A).forEach(t=>{e.add(A[t])})}}(E.translator),{qae:Ur(E),ext:oo(E),component(){const A=g(),T=function(){const e=l(),t=u(),n=c(),r=a(),i=p(),o=d();return f(()=>({app:e,appLayout:t,deviceType:n,options:r,theme:i,translator:o}),[e,t,r.direction,r.freeResize,o.language(),i.name(),n])}(),k=T.options.renderer,N=f(()=>function(e){const t=D();return t.renderer.prio([e||"canvas"]),t.use(S),t.use(C(M)),t.use(I),t.component("disclaimer",w),t}(k),[k]),L=y(),P=b(),_=v(),R=e(),H=function(){const o=e(),[a,s]=t(!1),[l,u]=t(!1),c=!!n().qSelectionInfo.qInSelections,[p]=t(()=>({toggle(){u(e=>!e)}}));return r(()=>{o&&s(!o.select&&!o.active)},[o]),i(()=>({key:"lasso",label:"Lasso",icon:O,hidden:!a||!c,active:l,action(){u(e=>!e)}}),[c,l,a]),p.enabled=()=>a,p.active=()=>l,p}(),F=q(),[B,V]=t();r(()=>{const e=x(A),t=function(e,t){return t.snapshotData?new pt(t,"qUndoExclude.qHyperCube","qStackedDataPages"):new zs(e)}(_,P),n=L,r=new Is({environment:T,lasso:H,flags:E.flags,picasso:N,$element:e,backendApi:t,selectionsApi:n});return V(r),()=>{r.destroy()}},[]);const[,z]=s(async()=>{if(!B)return;B.updateEnvironment(T),B.updateConstraints(R);if(!!!P.snapshotData){const e=await _.getEffectiveProperties();if(await B.updateDerivedProperties(e,P))return void F.pending();F.restore()}await B.updateData(P),await B.paint()},[P,B,T]);if(z)throw z;var j;!function(t){const n=o(),r=a(),i=e(),[,l]=s(async()=>{t&&(t.updateConstraints(i),t.options=r,await t.resize())},[n.width,n.height]);if(l)throw l}(B),j=B,h(e=>{if(j)return j.setSnapshotData(e)}),m(()=>({getViewState(){if(j)return j.getViewState()}}),[j])}}}export{js as default};
9
+ e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,a,s,l,u,c,p,d=e.length,f=e.search(/[0-9\-\+#]/),h=f>0?e.substring(0,f):"",m=e.split("").reverse().join(""),g=m.search(/[0-9\-\+#]/),y=d-g,b=e.substring(y,y+1),v=y+("."===b||","===b?1:0),q=g>0?e.substring(v,d):"";if(n=(t="-"===(e=e.substring(f,v)).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(m="",y=(p=t[0]).length%l,d=p.length,v=0;v<d;v++)m+=p.charAt(v),!((v-y+1)%l)&&v<d-l&&(m+=o);t[0]=m}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),h+(n?"-":"")+r+q}},Or({exports:{}});const Br=["altLabel","auto","autoMinMax","byDimDef","byMeasureDef","dimensionScheme","expressionIsColor","expressionLabel","measureMax","measureMin","measureScheme","mode","paletteColor","persistent","reverseScheme","useBaseColors","useDimColVal"];function Vr(e,t,n){for(let r=0;r<n.length;++r){const i=n[r];void 0!==e[i]&&(t[i]=e[i],delete e[i])}}var zr={importColors:function(e){e.color.point=e.color.point||{},Vr(e.color,e.color.point,Br),e.color.colorExpression&&(e.color.point.expression={qValueExpression:{qExpr:e.color.colorExpression}},delete e.color.colorExpression),e.color.point.expressionIsColor=!0},exportColors:function(e){Vr(e.color.point,e.color,Br),e.color.colorExpression=wr(e,"color.point.expression.qValueExpression.qExpr",""),delete e.color.point.expression}};function jr({dataDefinition:e,defaultPropertyValues:t,exportFormat:n,initialProperties:r}){const i=xt.axisChart.importProperties({exportFormat:n,initialProperties:r,dataDefinition:e,defaultPropertyValues:t}),o=i.qProperty;return 3===o.qHyperCubeDef.qInterColumnSortOrder.length&&(o.qHyperCubeDef.qInterColumnSortOrder=[1,2,0]),zr.importColors(o),o.qHyperCubeDef.qAlwaysFullyExpanded=!0,i}function $r({propertyTree:e,viewDataMode:t}){const n=xt.axisChart.exportProperties({propertyTree:e,viewDataMode:t});return zr.exportColors(e.qProperty),n}var Ur=e=>{const t=mt(e);return{properties:dt,data:{targets:[t]},importProperties:({exportFormat:e,initialProperties:n})=>jr({dataDefinition:t,exportFormat:e,initialProperties:n}),exportProperties:$r}};const Wr={wrapExpression:function(e){const t=e.replace(/\]/g,"]]");return t?`[${t}]`:""}};const Kr={replaceExpressionTokens:function(e,t,n){const r={start:n&&n.start||"{{",end:n&&n.end||"}}"};let i,o,a=e;for(const e in t)i=t[e],o=r.start+e+r.end,a=a.replace(Yr(o,!0),i);return a},createRegExp:Yr};function Yr(e,t,n){const r=e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&");const i=n?`(${r})`:r;return t?new RegExp(i,"g"):new RegExp(i)}const Gr={generateExpression:function(e,t){const n={};if(t)for(const e in t){const r=t[e],i=r.wrap?Wr.wrapExpression(r.value):r.value;n[e]=i;(r.variations||[]).forEach(t=>{const r=Xr(t,i,e);n[t]=r})}return Kr.replaceExpressionTokens(e,n)}};function Xr(e,t,n){if(""===t)return"";const r=Kr.createRegExp(n,!0,!0),i=e.split(r);let o="";return i.forEach(e=>{o+=e!==n?e:t}),o}const Jr={generateHyperCubeDef:function(e,t,n,r,i){return function(e,t,n,r){const i={};let o,a;const s=[];let l;e.forEach(e=>{o=ni(e.match(ti("Dim"))),o.forEach(e=>{s.push(Zr(t.qDimensions[e],r,e,n).then(t=>{i[`Dim[${e}]`]={value:t,wrap:!0}}))}),a=ni(e.match(ti("Mea"))),a.forEach(e=>{s.push(Qr(t.qMeasures[e],r).then(t=>{i[`Mea[${e}]`]={value:t}}))})}),l=s.length?Promise.all(s).then(()=>Promise.resolve(i)):Promise.resolve(i);return l}(e.dimensions.concat(e.measures),t,n,r).then(n=>{const r=E({},n,i),o=E(!0,{},t);return o.qDimensions=[],o.qMeasures=[],e.dimensions.forEach(e=>{o.qDimensions.push({qDef:{qFieldDefs:[`=${Gr.generateExpression(e,r)}`]}})}),e.measures.forEach(e=>{o.qMeasures.push({qDef:{qDef:Gr.generateExpression(e,r)}})}),o})},getAllHyperCubeExpressions:async function(e,t,n){const r=e.qDimensions.map((e,r)=>Zr(e,n,r,t)),i=e.qMeasures.map(e=>Qr(e,n));return{dimensions:await Promise.all(r),measures:await Promise.all(i)}}};function Zr(e,t,n,r){if(e.qLibraryId)return ei(e.qLibraryId,"dimension",t,n,r);const i=r.qDimensionInfo[n].qGroupPos;return Promise.resolve(e.qDef.qFieldDefs[i])}function Qr(e,t){return e.qLibraryId?ei(e.qLibraryId,"measure",t):Promise.resolve(e.qDef.qDef)}function ei(e,t,n,r,i){if(!n)return console.warn("No app provided, returning library id"),e;return n["dimension"===t?"getDimension":"getMeasure"](e).then(e=>e.getProperties().then(e=>"dimension"===t?e.qDim.qFieldDefs[i.qDimensionInfo[r].qGroupPos]:e.qMeasure.qDef))}function ti(e){return new RegExp(`\\{\\{${e}\\[\\d\\]\\}\\}`,"g")}function ni(e){return e?e.map(e=>e.substr(6,1)):[]}function ri(e){return e=e||function(){return!1},{get(t){const n=e()?-1:1;switch(t("integer")*n){case-1:return"descending";case 1:return"ascending";default:return"disabled"}},set(t,n){const r=e();switch(t){case"descending":n("integer",r?1:-1);break;case"ascending":n("integer",r?-1:1);break;case"disabled":n("integer",0);break;default:n("integer",void 0)}}}}var ii={booleanConvertFunctions:function(e,t){return e=e||function(){return!1},t=t||1,{get:e=>!!e("integer"),set(n,r){if(n){let n=e()?-1:1;n*=t,r("integer",n)}else r("integer",0)}}},enumConvertFunctions:ri,invertedEnumConvertFunctions:function(e){return ri(function(){return!e||!e()})}};const oi=[{value:"ascending",translation:"properties.sorting.ascending"},{value:"descending",translation:"properties.sorting.descending"}];function ai(e,t,n){return{type:"items",items:{toggled:{type:"boolean",ref:e,translation:t,convertFunctions:n.toggled},order:{type:"string",component:"dropdown",ref:e,options:oi,convertFunctions:n.sorting,show:t=>0!==Ue(t,e,0)}}}}var si={state:function(e,t){return ai(e=e||"qSortByState","properties.sorting.sortByState",{toggled:ii.booleanConvertFunctions(t),sorting:ii.invertedEnumConvertFunctions(t)})},ascii:function(e,t){return ai(e=e||"qSortByAscii","properties.sorting.sortByAlphabetic",{toggled:ii.booleanConvertFunctions(t),sorting:ii.enumConvertFunctions(t)})},numeric:function(e,t){return ai(e=e||"qSortByNumeric","properties.sorting.sortByNumeric",{toggled:ii.booleanConvertFunctions(t,-1),sorting:ii.enumConvertFunctions(t)})},expression:function(e,t){e=e||"qSortByExpression";const n={toggled:ii.booleanConvertFunctions(t),sorting:ii.enumConvertFunctions(t)},r=ai(e,"properties.sorting.sortByExpression",n);return r.items.expression={type:"number",component:"expression",expressionType:"ValueExpr",ref:"qExpression",translation:"Common.Expression",defaultValue:"",show:t=>0!==Ue(t,e,0)},r},frequency:function(e,t){return ai(e=e||"qSortByFrequency","properties.sorting.sortByFrequency",{toggled:ii.booleanConvertFunctions(t),sorting:ii.invertedEnumConvertFunctions(t)})}};const li=(e,t)=>(t.components||[]).find(t=>t.key===e),ui=(e,t,n)=>{const r=li("axis",n)?.axis;return{text:{fontFamily:r?.title?.fontFamily||t.getStyle(e,"axis.title","fontFamily"),fontSize:r?.title?.fontSize||t.getStyle(e,"axis.title","fontSize"),fill:r?.title?.fontColor?.color||t.getStyle(e,"axis.title","color")}}},ci=(e,t,n)=>{const r=li("axis",n)?.axis;return{labels:{fontFamily:r?.label?.name?.fontFamily||t.getStyle(e,"axis.label.name","fontFamily"),fontSize:r?.label?.name?.fontSize||t.getStyle(e,"axis.label.name","fontSize"),fill:r?.label?.name?.fontColor?.color||t.getStyle(e,"axis.label.name","color")}}},pi=(e,t,n,r)=>{const i=r.isEnabled("CLIENT_IM_3051")?li("legend",n)?.legend:{};return{fontFamily:i?.title?.fontFamily||t.getStyle(e,"legend.title","fontFamily"),fontSize:i?.title?.fontSize||t.getStyle(e,"legend.title","fontSize"),color:i?.title?.fontColor?.color||t.getStyle(e,"legend.title","color")}},di=(e,t,n,r)=>{const i=r.isEnabled("CLIENT_IM_3051")?li("legend",n)?.legend:{};return{fontFamily:i?.label?.fontFamily||t.getStyle(e,"legend.label","fontFamily"),fontSize:i?.label?.fontSize||t.getStyle(e,"legend.label","fontSize"),color:i?.label?.fontColor?.color||t.getStyle(e,"legend.label","color")}},fi={DATA_PATH:"qUndoExclude",HYPERCUBE_DEF_PATH:"qHyperCubeDef",HYPERCUBE_PATH:"qHyperCube",CHART_ID:"object.distributionPlot",AUTO_SORT:"sorting.autoSort",SORT_CRITERIA:"sorting.sortCriteria",SORTING_ELEMENT_ID:"sorting.elementId",SORTING_ELEMENT_MIN_ID:"distplot-exp-min",SORTING_ELEMENT_MAX_ID:"distplot-exp-max",SORTING_EXPRESSION:"sorting.expression",MAX_GLYPH_COUNT:20,MAX_STACKED_VALUES:3e3,HORIZONTAL:"horizontal",BOX_PADDING:2,POINT_BANDWIDTH_BASE_RATIO:.35,MAX_POINT_BASE_SIZE_PX:34,MIN_POINT_PIXELS:5,JITTER_PARAMETER:3,BUBBLE_SCALES_MAX:100};function hi(e){return e.qHyperCubeDef&&e.qHyperCubeDef.qDimensions.length>1||e.qHyperCube&&e.qHyperCube.qDimensionInfo&&e.qHyperCube.qDimensionInfo.length>1}Object.freeze(fi);const mi={hasMultipleDimensions:hi,getOuterDimensionCardinality:function(e){const t=wr(e,fi.HYPERCUBE_PATH);return hi(e)?t&&t.qDimensionInfo[1].qCardinal:1},isAutoSort:function(e){return wr(e,fi.AUTO_SORT,!1)},isSortByExpression:function(e){return 0!==wr(e,`${fi.SORT_CRITERIA}.sortByExpression`,0)},isSortByNumeric:function(e){return 0!==wr(e,`${fi.SORT_CRITERIA}.sortByNumeric`,0)},isSortByAscii:function(e){return 0!==wr(e,`${fi.SORT_CRITERIA}.sortByAscii`,0)}},gi={cellBackgroundColor:!0,cellForegroundColor:!0,colorByAlternative:!0,colorByExpression:!0,tooltip:!0,urlLabel:!0,url:!0};var yi={create(e,t){if(!e||!gi[e])throw new Error("Attribute Expressions Util: ID required");const n={};return t&&Object.keys(t).forEach(e=>{n[e]=t[e]}),n.id=e,n.qAttribute=!0,n},getById:(e,t,n)=>!!e&&(n=n||"id",e.filter(e=>e[n]===t)[0]),getIndexById(e,t,n){let r=-1;return e&&(n=n||"id",e.forEach((e,i)=>{e[n]===t&&(r=i)})),r},moveById(e,t,n,r){const i=this.getIndexById(e,n,r);t=t||[];const o=this.getIndexById(t,n,r);if(-1!==i&&-1===o){const n=e.splice(i,1);t.push(n[0])}return t},moveAllById(e,t,n,r){const i=e.filter(e=>e.id===n),o=t.filter(e=>e.id===n),a=i.filter(e=>!(o.filter(t=>t[r]===e[r]).length>0));return[...t,...a]},moveByIdFromGroup(e,t,n,r,i){n=n||"qAttributeExpressions",i=i||"id";for(let o=0;o<e.length;o++){const a=e[o][n],s=t.length;if(this.moveById(a,t,r,i),s!==t.length)return t}return t},clean:e=>e.filter(e=>e&&e.id),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"}};var bi={getColorByDefinition:function(e,t,n){const r={};let i,o,a;if("dimension"!==e)throw new Error("Default-property-logic.js: getColorByDefinition: Illegal input");return n.qLibraryId?(r.type="dimension",r.name=n.qLibraryId,r.id=n.qLibraryId):(r.type="field",t?(r.name=n.label||n.qDef,r.id=n.qDef):(i=n.qDef,o=!!i.qLabelExpression,a=i.qFieldLabels&&i.qFieldLabels[0],r.name=i.qFieldDefs[0],r.label=o?i.qLabelExpression:a?i.qFieldLabels[0]:i.qFieldDefs[0])),r}};var vi={useMasterNumberFormat:function(e){e.quarantine={qNumFormat:e.qNumFormat||{},isCustomFormatted:e.isCustomFormatted||!1},e.qNumFormat=null,e.isCustomFormatted=void 0},useLocalFormat:function(e){e.qNumFormat=e.quarantine?.qNumFormat||{},e.isCustomFormatted=e.quarantine?.isCustomFormatted||!1,e.quarantine=void 0},isUsingMasterNumberFormat:function(e){return!!e?.quarantine?.qNumFormat??!1}};const qi=["scatterplot","map"],xi=["map"];var Di={baseColor:{isSupported:e=>e&&e.length&&-1===qi.indexOf(e),isDimSupported:e=>e&&e.length&&-1!==xi.indexOf(e)},colorBy:{},colorByUpdater(e,t,n,r){this.updateColorDef(e,r,n),this.updateHypercubeAttributes(e,t,n)},updateColorDef(e,t,n){const r=Ue(n,"mode"),i=Ue(n,"auto"),o=Ue(e,`${t}qDimensions`,[]),a=Ue(e,`${t}qMeasures`,[]);let s,l,u,c;if(!i&&"byDimension"===r&&o.length)s=Ue(n,"byDimDef"),s&&Ii(n,s.label),s&&s.activeDimensionIndex>-1?(s.activeDimensionIndex=Math.min(s.activeDimensionIndex,o.length-1),l=o[s.activeDimensionIndex],c=bi.getColorByDefinition("dimension",!1,l),c.activeDimensionIndex=s.activeDimensionIndex,Ei(n,c)):s&&s.key||(l=o[o.length-1],u=yi.getById(l.qAttributeDimensions,yi.IDMAP.COLOR_BY_ALTERNATIVE),Ei(n,bi.getColorByDefinition("dimension",!!u,u||l)));else{if(!i&&"byMeasure"===r&&o.length)throw new Error("not suported in any 444-chart");"byMultiple"===r&&a.length<2&&Ke(n,"mode","primary")}},updateHypercubeAttributes(e,t,n){const r=Ue(n,"mode"),i=Ue(n,"auto"),o=Ue(e,`${t}qDimensions`,[]),a=Ue(e,`${t}qMeasures`,[]),s=Ue(e,`${t}qLayoutExclude.qHyperCubeDef.qDimensions`,[]);!i&&"byDimension"===r&&o.length?Ai(n,!0,o,s,a,Ue(n,"byDimDef.label")):!i&&"byMeasure"===r&&o.length?Ai(n,!1,o,s,a,Ue(n,"byMeasureDef.label")):Si(o,s)},setColorByPropertyDef:Ei,resolveColorByPropertyDef:Ai,clearColorByItem:Si};function Si(e,t){e.forEach(e=>{Ci(e,yi.IDMAP.COLOR_BY_ALTERNATIVE,"qAttributeDimensions"),Ci(e,yi.IDMAP.COLOR_BY_ALTERNATIVE,"qAttributeExpressions")}),t.forEach(e=>{Ci(e,yi.IDMAP.COLOR_BY_ALTERNATIVE,"qAttributeDimensions"),Ci(e,yi.IDMAP.COLOR_BY_ALTERNATIVE,"qAttributeExpressions")})}function Ci(e,t,n){if(e[n]){const r=yi.getIndexById(e[n],t);r>=0&&e[n].splice(r,1)}else e[n]=[]}function Mi(e){return e.split(" ").length>1&&"="!==e[0]&&"["!==e[0]?`[${e}]`:e}function Ei(e,t,n,r){const i=n?"expression":t.type;let o=e.mode;switch(Ii(e,t.label||t.name||""),i){case"field":o="byDimension",e.byDimDef={label:t.label||Mi(t.name),key:Mi(t.name),type:"expression",activeDimensionIndex:t.activeDimensionIndex};break;case"expression":o="byMeasure",e.byMeasureDef={label:n||t.label||t.name,key:n||t.name,type:"expression"};break;case"dimension":o="byDimension",e.byDimDef={label:t.name,key:t.id,type:"libraryItem",activeDimensionIndex:t.activeDimensionIndex};break;case"measure":o="byMeasure",e.byMeasureDef={label:t.name,key:t.id,type:"libraryItem"},e.formatting&&vi.useMasterNumberFormat(e.formatting)}r||(e.auto=!1,e.mode=o)}function Ai(e,t,n,r,i,o){Si(n,r);const a=n[n.length-1];if(a){const n=Ue(e,t?"byDimDef":"byMeasureDef"),r=Ue(e,"formatting.qNumFormat"),s=Ue(e,"formatting.isCustomFormatted");if(n){const e=yi.create(yi.IDMAP.COLOR_BY_ALTERNATIVE);switch(n.type){case"expression":e.label=o||n.label,t?e.qDef=n.key:(e.qExpression=n.key,r&&(e.qNumFormat=r,e.isCustomFormatted=s)),e.label&&"="===e.label.charAt(0)&&(e.labelExpRef="color.altLabel");break;case"libraryItem":if(!t){let t=-1;i.forEach((e,r)=>{n.key===e.qLibraryId&&(t=r)}),e.matchMeasure=t,r&&(e.qNumFormat=r,e.isCustomFormatted=s)}e.qLibraryId=n.key,e.colorMapRef=n.key}t?(e.qSortBy={qSortByAscii:1},a.qAttributeDimensions.push(e)):a.qAttributeExpressions.push(e)}}}function Ii(e,t){if(!t)return;const n="="===t.charAt(0);e.altLabel=n?{qStringExpression:{qExpr:t.substr(1)}}:t}function wi(e){return!!e&&(e.coloring&&e.coloring.baseColor&&e.coloring.baseColor.color?e.coloring.baseColor:!(!e.baseColor||!e.baseColor.color)&&e.baseColor)}function Oi(e){return"libraryItem"===wr(e,"color.point.byDimDef.type")}function Ti(e){return"libraryItem"===wr(e,"color.point.byMeasureDef.type")}function ki(e){return!0===wr(e,"color.point.auto")}function Ni(e){return!ki(e)&&"byDimension"===wr(e,"color.point.mode")}function Pi(e){return!ki(e)&&"byMeasure"===wr(e,"color.point.mode")}var Li={measuresHasBaseColors:function(e){return wr(e,"layout.qHyperCube.qMeasureInfo",[]).filter(e=>!!wi(e)).length>0},dimensionsHasBaseColors:function(e){return wr(e,"layout.qHyperCube.qDimensionInfo",[]).filter(e=>!!wi(e)).length>0},onGlobalChangeColors:function(e){Di.updateColorDef(e,"qHyperCubeDef.",e.color.point)},onChangeCalcCond:function(e){const t=e?.qHyperCubeDef,n=e?.qUndoExclude?.qHyperCubeDef;t&&n&&(n.qCalcCond=t.qCalcCond,n.qCalcCondition=t.qCalcCondition)},isColorByDimension:Ni,isColorByMeasure:Pi,isColorAuto:ki,isColorByExpression:function(e){return!ki(e)&&"byExpression"===wr(e,"color.point.mode")},isColorBySingle:function(e){return!ki(e)&&"primary"===wr(e,"color.point.mode","primary")},isDimensionLibraryItem:Oi,isMeasureLibraryItem:Ti,showLegend:function(e){const t=wr(e,"color.point.mode","primary");return"primary"!==t&&"byExpression"!==t&&!1===ki(e)},showColorByLabel:function(e){const t=Ni(e)&&!1===Oi(e),n=Pi(e)&&!1===Ti(e),r=wr(e,"color.point.byDimDef.activeDimensionIndex")>-1;return t&&!r||n},hasDimValueColors:function(e,t){return e.layout.qHyperCube.qDimensionInfo[t]?.coloring?.hasValueColors??!0}};function _i(e,t){this.getSettings=e,this.getElements=t}function Ri(e){const t=e.qDef.qSortCriterias;t[0]||t.push({});const n=t[0],r=this.getSettings();Ke(n,"qSortByExpression",r.SORT_BY_EXPRESSION),Ke(n,"qSortByAscii",r.SORT_BY_ASCII),Ke(n,"qSortByNumeric",r.SORT_BY_NUMERIC),Ke(n,"qSortByLoadOrder",r.SORT_BY_LOAD_ORDER),n.qExpression||(n.qExpression={});const i=Hi(this.getElements());n.qExpression.qv=i.exp}function Hi(e){const t=e.filter(e=>e.isDefault);return 0===t.length?e[0]:t[0]}_i.prototype.applyAutoSorting=Ri,_i.prototype.applyDefaultCustomSorting=function(e,t){Ri.call(this,e);const n=Hi(this.getElements()),r=e.qDef.qSortCriterias[0];t.elementId=n.id,t.sortCriteria={},Ke(t.sortCriteria,"sortByExpression",r.qSortByExpression),Ke(t.sortCriteria,"sortByAscii",r.qSortByAscii),Ke(t.sortCriteria,"sortByNumeric",r.qSortByNumeric),Ke(t.sortCriteria,"sortByLoadOrder",r.qSortByLoadOrder)},_i.prototype.applyCustomSorting=function(e,t){const n=e.qDef.qSortCriterias[0];if(Ke(n,"qSortByExpression",t.sortCriteria.sortByExpression),Ke(n,"qSortByAscii",t.sortCriteria.sortByAscii),Ke(n,"qSortByNumeric",t.sortCriteria.sortByNumeric),Ke(n,"qSortByLoadOrder",t.sortCriteria.sortByLoadOrder),1!==n.qSortByExpression&&-1!==n.qSortByExpression)return;n.qExpression||(n.qExpression={});if(t.elementId){const e=function(e,t){const n=e.filter(e=>e.id===t);0===n.length&&function(e){throw new Error(`Sorter: ${e}`)}(`Could not find any element matching the element '${t}'`);return n[0]}(this.getElements(),t.elementId);n.qExpression.qv=e.exp}else n.qExpression.qv=t.expression.qValueExpression.qExpr};const Fi={create:function(e,t){return new _i(e,t)}};const Bi={applySorting:function(e,t,n){const r=n.autoSort,i=!!n.sortCriteria;r?e.applyAutoSorting(t):i?e.applyCustomSorting(t,n):e.applyDefaultCustomSorting(t,n)}};const Vi={ASCII:{ELEMENT:void 0,SORT_BY_EXPRESSION:void 0,SORT_BY_ASCII:1,SORT_BY_NUMERIC:1,SORT_BY_LOAD_ORDER:1}};Object.freeze(Vi.ASCII),Object.freeze(Vi);const zi=E(!0,{DIST_MAX:{ELEMENT:"distplot-exp-max",SORT_BY_EXPRESSION:-1,SORT_BY_ASCII:1,SORT_BY_NUMERIC:1,SORT_BY_LOAD_ORDER:1}},Vi);const ji={getSettings:function(e){return wr(e,"qHyperCube.qDimensionInfo.1.qCardinal",1)>10?zi.DIST_MAX:zi.ASCII}};function $i(e,t,n,r){let i="Fractile";0===e?i="Min":1===e&&(i="Max");const o=t?Wr.wrapExpression(t):"",a=n?Wr.wrapExpression(n):"";return`${i}( total {{<outerDimString>}} Aggr( {{innerMeasureString}}, {{outerDimString,}} {{innerDimString}} ), ${e} )`.replace(/{{innerDimString}}/g,o).replace(/{{outerDimString}}/g,a).replace(/{{<outerDimString>}}/g,n?`<${a}>`:"").replace(/{{outerDimString,}}/g,n?`${a},`:"").replace(/{{innerMeasureString}}/g,(r||"").replace(/^=/,""))}const Ui={getElementIds:function(){return[fi.SORTING_ELEMENT_MIN_ID,fi.SORTING_ELEMENT_MAX_ID]},getElements:function(e,t,n,r){const i=t[0],o=t[1],a=e[0],s=$i(0,i,o,a),l=$i(1,i,o,a);return[{id:fi.SORTING_ELEMENT_MIN_ID,label:r.get("properties.distributionPlot.min"),exp:s,isDefault:fi.SORTING_ELEMENT_MIN_ID===n.ELEMENT},{id:fi.SORTING_ELEMENT_MAX_ID,label:r.get("properties.distributionPlot.max"),exp:l,isDefault:fi.SORTING_ELEMENT_MAX_ID===n.ELEMENT}]},getFractileExpression:$i};function Wi(e){throw new Error(`distributionplot-sorter.applySorting: ${e}`)}function Ki(e,t,n,r){if(!e.qUndoExclude)return;e.sorting||(e.sorting={autoSort:!0});const i=e.qUndoExclude.qHyperCubeDef.qDimensions;i.length>=2?e.qUndoExclude.qHyperCubeDef.qInterColumnSortOrder=[0,2,1]:e.qUndoExclude.qHyperCubeDef.qInterColumnSortOrder=[1,0];const o=function(){return ji.getSettings(t)},a=Fi.create(o,function(){const e=o();return Ui.getElements(n.measures,n.dimensions,e,r)}),s=i[0],l=e.sorting;Bi.applySorting(a,s,l)}const Yi={applySorting:function(e,t,n,r,i){return function(e){const t=e.qHyperCubeDef;t?t.qDimensions?t.qMeasures?(!t.qDimensions.length||t.qDimensions.length<2)&&Wi("'qHyperCubeDef.qDimensions' has no outer dimension"):Wi("no 'qHyperCubeDef.qMeasures' in properties arg"):Wi("no 'qHyperCubeDef.qDimensions' in properties arg"):Wi("no 'qHyperCubeDef' in properties arg")}(e),r?Ki(e,t,r,i):Jr.getAllHyperCubeExpressions(e.qHyperCubeDef,t.qHyperCube,n).then(n=>{Ki(e,t,n,i)})}},Gi=`${fi.SORT_CRITERIA}.sortByExpression`;const Xi={updateSortOrder:function(e,t){if(!t)return;const n=wr(e,Gi);if(!(-1===n||1===n))return;const r=wr(e,fi.SORTING_ELEMENT_ID),i=wr(t,fi.SORTING_ELEMENT_ID),o=r===fi.SORTING_ELEMENT_MAX_ID,a=r===fi.SORTING_ELEMENT_MIN_ID&&i===fi.SORTING_ELEMENT_MAX_ID,s=o&&(!!!i||i===fi.SORTING_ELEMENT_MIN_ID),l=wr(t,Gi),u=o&&!(-1===l||1===l)&&1===n;a?kr(e,Gi,1):(s||u)&&kr(e,Gi,-1)}},Ji=(e,t)=>{const n={};return n.axisTitleSection={translation:"properties.axis.title",component:"panel-section",items:t.getOptions("axis","axis.title")},n.axisLabelSection={translation:"properties.axis.label",component:"panel-section",items:t.getOptions("axis","axis.label.name")},e?.isEnabled("CLIENT_IM_3051")&&(n.legendTitleSection={translation:"properties.legend.title",component:"panel-section",items:t.getOptions("legend","legend.title")},n.legendLabelSection={translation:"properties.legend.label",component:"panel-section",items:t.getOptions("legend","legend.label")}),Object.keys(n).length>0?n:void 0},Zi=(e,t,n)=>({component:"styling-panel",chartTitle:"Object.DistributionPlot",translation:"LayerStyleEditor.component.styling",subtitle:"LayerStyleEditor.component.styling",ref:"components",useGeneral:!0,useBackground:e,items:Ji(n,t)});function Qi(e){return!wr(e,"color.point.auto")&&"byDimension"===wr(e,"color.point.mode")&&wr(e,"qHyperCubeDef.qMeasures.length",0)<=1}function eo(e){const{flags:t,translator:n}=e,r=e.theme,i=e.flags.isEnabled("SENSECLIENT_IM_2018_STYLINGPANEL_DIST_PLOT"),o=e.flags.isEnabled("SENSECLIENT_IM_2018_DIST_BG"),a=e=>({color:e,index:r.getDataColorPickerPalettes()[0].colors.indexOf(e)}),s={translation:"properties.colors",type:"items",items:{colors:{type:"items",items:{pointColor:{type:"items",translation:"properties.colorsAndLegend",grouped:!0,items:{colors:{type:"items",items:{autoColor:{ref:"color.point.auto",type:"boolean",translation:"properties.colors",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}]},colorMode:{ref:"color.point.mode",type:"string",component:"dropdown",options:()=>[{value:"primary",translation:"properties.colorMode.primary"},{value:"byExpression",translation:"properties.colorMode.byExpression"}],defaultValue:"primary",show:e=>!wr(e,"color.point.auto",!0)},boxColor:{ref:"color.box.paletteColor",translation:"properties.distributionPlot.boxColor",type:"object",component:"color-picker",dualOutput:!0,defaultValue(){const e=r.getStyle(fi.CHART_ID,"box","fill");return a(e)}},paletteColor:{ref:"color.point.paletteColor",translation:"properties.distributionPlot.pointColor",type:"object",component:"color-picker",dualOutput:!0,show:e=>!wr(e,"color.point.auto",!0)&&"primary"===wr(e,"color.point.mode","primary"),defaultValue(){const e=r.getDataColorSpecials().primary;return a(e)}},attributeExpression:{type:"string",component:"expression",expressionType:"measure",schemaIgnore:!0,ref:"color.point.expression.qValueExpression.qExpr",translation:"Common.Expression",show:e=>!wr(e,"color.point.auto")&&"byExpression"===wr(e,"color.point.mode")},expressionIsColor:{ref:"color.point.expressionIsColor",translation:"properties.expressionIsColor",type:"boolean",defaultValue:!0,show:!1}}}}}}}}},l={items:{showDisclaimer:{translation:"properties.showDisclaimer",type:"boolean",ref:"showDisclaimer",component:"switch",show:()=>t.isEnabled("SHOW_DISCLAIMER"),defaultValue:!0,options:[{value:!0,translation:"Common.Show"},{value:!1,translation:"properties.hide"}]}}},u=((e,t,n,r,i)=>r({theme:e,translator:t,flags:i,config:{id:n,paths:["axis.title","axis.label.name","label.value","legend.title","legend.label"]}}))(r,n,fi.CHART_ID,Yt,t),c=((e,t,n)=>{const r={getOptions:(r,i)=>{const o=(e,t)=>({ref:`${i}.fontColor`,component:"color-picker",width:!1,defaultValue:()=>{const n=e.getStyle(t,`${i}.color`,"color");return{color:n,index:e.getDataColorPickerPalettes()[0].colors.indexOf(n)}}});return{labelSection:{component:"items",ref:"components",key:r,items:{fontFamily:{ref:`${i}.fontFamily`,component:"dropdown",options:()=>e.getOptions(`${i}.fontFamily`),defaultValue:()=>e.getDefaultValue(`${i}.fontFamily`)},...((t,n)=>({fontWrapper:{component:"inline-wrapper",items:{fontSize:{ref:`${i}.fontSize`,component:"dropdown",width:!0,options:()=>e.getOptions(`${i}.fontSize`),defaultValue:()=>e.getDefaultValue(`${i}.fontSize`)},fontColor:{...o(t,n)}}}}))(t,n)}}}}};return r})(u,r,fi.CHART_ID),p={type:"items",translation:"properties.presentation",items:{stylingPanel:i&&Zi(o,c,t),orientation:{ref:"orientation",type:"string",component:"item-selection-list",defaultValue:"horizontal",horizontal:!0,items:[{component:"icon-item",icon:"direction_up_down",labelPlacement:"bottom",translation:"properties.orientation.vertical",value:"vertical"},{icon:"direction_left_right",component:"icon-item",labelPlacement:"bottom",translation:"Common.Horizontal",value:"horizontal"}]},showDistBackground:{ref:"presentation.visibleComponents",translation:"properties.show",type:"string",component:"dropdown",defaultValue:"points_box",options:[{value:"points_box",translation:"properties.distributionPlot.pointsAndBox"},{value:"points",translation:"properties.distributionPlot.pointsOnly"},{value:"box",translation:"properties.distributionPlot.boxOnly"}]},gridLines:{type:"items",snapshot:{tid:"property-gridLines"},items:{showGridLines:{ref:"gridlines.auto",type:"boolean",translation:"properties.gridLine.spacing",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}]},gridSpacing:{ref:"gridlines.spacing",type:"number",component:"dropdown",defaultValue:2,options:[{value:0,translation:"properties.gridLine.noLines"},{value:2,translation:"properties.gridLine.medium"},{value:3,translation:"properties.gridLine.narrow"}],show:e=>e.gridlines&&!e.gridlines.auto}}}}};p.items.bubbleScaleItems={type:"items",items:{bubbleScales:{type:"integer",component:"slider",ref:"dataPoint.bubbleScales",translation:"properties.dataPoints.bubbleSizes",min:20,max:fi.BUBBLE_SCALES_MAX,step:5,defaultValue:100,show:e=>e.qHyperCubeDef.qMeasures.length<2&&"box"!==e.presentation.visibleComponents}}},p.items.jitter={type:"string",component:"switch",ref:"dataPoint.displacement",translation:"properties.distributionPlot.jitter",defaultValue:"none",options:[{value:"none",translation:"properties.off"},{value:"jitter",translation:"properties.on"}],show:e=>"box"!==e.presentation.visibleComponents};const d={uses:"axis.picasso.measureAxis",items:{startAt:{type:"string",component:"dropdown",translation:"properties.axis.startAt",readOnly:e=>!(e.measureAxis.autoMinMax||"min"===e.measureAxis.minMax&&0===e.measureAxis.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}=r?.measureAxis||{};return!0===i?"lowest":i||"min"!==o||0!==a?e(t.type):"zero"},set(e,t,n,r,i){"zero"===e?(kr(i,"measureAxis.autoMinMax",!1),kr(i,"measureAxis.minMax","min"),kr(i,"measureAxis.min",0)):kr(i,"measureAxis.autoMinMax",!0)}},classification:{section:"axis",tags:["simple"],exclusive:!0}}}},f={uses:"axis.picasso.dimensionAxis",show:(e,t)=>wr(t.layout,`${fi.HYPERCUBE_PATH}.qDimensionInfo.length`)>1,items:{dimensionAxisTitle:{component:"header",type:"string",show:(e,t)=>wr(t.layout,`${fi.HYPERCUBE_PATH}.qDimensionInfo.length`)>1,classification:{section:"axis",tags:["simple"],exclusive:!0}},othersGroup:{items:{label:{show:(e,t)=>wr(t.layout,`${fi.HYPERCUBE_PATH}.qDimensionInfo.length`)>1&&"horizontal"!==wr(t.layout,"orientation"),options:[{value:"auto",translation:"Common.Auto"},{value:"horizontal",translation:"Common.Horizontal"},{value:"tilted",translation:"properties.labels.tilted"},{value:"layered",translation:"properties.labels.layered"}]},dock:{show:(e,t)=>wr(t.layout,`${fi.HYPERCUBE_PATH}.qDimensionInfo.length`)>1}}}}};function h(e,t){const n=wr(e,t,void 0);n&&void 0!==n.label&&("="===n.label.charAt(0)?e.color.point.altLabel={qStringExpression:{qExpr:n.label.substr(1)}}:e.color.point.altLabel=n.label)}const m=(e,t)=>{if("libraryItem"===e.color.point.byDimDef?.type){const n=e.color.point.byDimDef?.key??"",r=t.handler.layout.qUndoExclude?.qHyperCube?.qDimensionInfo??[];for(let e=0;e<r.length;e++){const t=r[e].qAttrDimInfo;if(t)for(let e=0;e<t.length;e++)if(t[e].colorMapRef===n)return t[e].qFallbackTitle}return""}return e.color.point.byDimDef?.label??""},g=(e,t,r)=>{if(e.qHyperCubeDef?.qDimensions?.length){const t=e.qHyperCubeDef?.qDimensions.map((e,t)=>({value:t,label:n.get("properties.colorBy.currentDimension",t+1)}));return(e.color?.point?.byDimDef?.activeDimensionIndex??-1)<0&&t.push({value:-1,label:m(e,r)}),t}return[]},y={items:{disclaimer:{show:!1},simpleItems:{show:!0,items:{autoColor:{ref:"color.point.auto",undefinedValue:!1,label:e=>wr(e,"color.point.auto")?n.get("Simple.Color.Auto",n.get("properties.colorMode.primary")):n.get("Common.Custom"),change:e=>{wr(e,"color.point.auto")||(kr(e,"color.point.mode","primary"),kr(e,"color.point.useBaseColors","off"))}},colorMode:{ref:"color.point.mode",options:e=>{const t=[{value:"primary",translation:"properties.colorMode.primary"},{value:"byDimension",translation:"properties.colorMode.byDimension"}];return"byExpression"===wr(e,"color.point.mode")&&t.push({value:"byExpression",translation:"properties.colorMode.byExpression"}),t},show:e=>!Li.isColorAuto(e),change(e){if("primary"===wr(e,"color.point.mode",void 0)){const t=wr(e,"color.point.useBaseColors",void 0);void 0!==t&&"off"!==t&&kr(e,"color.point.useBaseColors","off")}},globalChange(){}},colorByDimension:{ref:"color.point.byDimDef.activeDimensionIndex",options:g,show:(e,t,n)=>Li.isColorByDimension(e)&&g(e,0,n).length>1,change(e){h(e,"color.point.byDimDef")}},baseColors:{type:"items",items:{useBaseColor:{ref:"color.point.useBaseColors",show(e,t){const n=wr(e,"color.point.mode","primary");return!Li.isColorAuto(e)&&"primary"===n&&(Li.measuresHasBaseColors(t)||Li.dimensionsHasBaseColors(t))}}}},paletteColor:{ref:"color.point.paletteColor",translation:"properties.distributionPlot.pointColor",show:(e,t)=>{const n="measure"===wr(e,"color.point.useBaseColors")&&Li.measuresHasBaseColors(t),r="dimension"===wr(e,"color.point.useBaseColors")&&Li.dimensionsHasBaseColors(t);return Li.isColorBySingle(e)&&!n&&!r}},useDimColVal:{ref:"color.point.useDimColVal",show(e,t,n){const r=e.color.point?.byDimDef?.activeDimensionIndex??null;return Li.hasDimValueColors(n.handler,r)&&Li.isColorByDimension(e)&&Li.isDimensionLibraryItem(e)}},boxColor:{ref:"color.box.paletteColor",translation:"properties.distributionPlot.boxColor",type:"object",component:"color-picker",dualOutput:!0,defaultValue(){const e=r.getStyle(fi.CHART_ID,"box","fill");return a(e)},show:e=>!wr(e,"color.point.auto",!0)}}}}},b={uses:"colorsAndLegend",items:{colors:{globalChange:Li.onGlobalChangeColors,items:{autoColor:{ref:"color.point.auto",undefinedValue:!1},colorMode:{ref:"color.point.mode",options(e){const t=[];return t.push({value:"primary",translation:"properties.colorMode.primary"}),t.push({value:"byDimension",translation:"properties.colorMode.byDimension"}),wr(e,"qHyperCubeDef.qDimensions.length",0)>=1&&t.push({value:"byExpression",translation:"properties.colorMode.byExpression"}),t},show:e=>!Li.isColorAuto(e),globalChange(){}},colorByDimension:{ref:"color.point.byDimDef",show:e=>Li.isColorByDimension(e),change(e){h(e,"color.point.byDimDef")}},colorByMeasure:{ref:"color.point.byMeasureDef",show:e=>Li.isColorByMeasure(e),change(e){h(e,"color.point.byMeasureDef")}},colorByLabel:{ref:"color.point.altLabel",show:Li.showColorByLabel,change(e){const t=wr(e,"color.point.mode"),n=wr(e,"color.point.altLabel","");let r;switch(t){case"byMeasure":r=e.color.point.byMeasureDef;break;case"byDimension":r=e.color.point.byDimDef}r&&(r.label=n.qStringExpression?`=${n.qStringExpression.qExpr}`:n)}},baseColors:{type:"items",items:{useBaseColor:{ref:"color.point.useBaseColors",show(e,t){const n=wr(e,"color.point.mode","primary");return!Li.isColorAuto(e)&&"primary"===n&&(Li.measuresHasBaseColors(t)||Li.dimensionsHasBaseColors(t))}},measureColor:{translation:"properties.libraryColors",component:"measure-color",show:(e,t)=>!wr(e,"color.point.auto")&&"byMultiple"===wr(e,"color.point.mode")&&"measure"===wr(e,"color.point.useBaseColors")&&t.layout.qHyperCube.qMeasureInfo.length>1&&Li.measuresHasBaseColors(t)}}},paletteColor:{ref:"color.point.paletteColor",translation:"properties.distributionPlot.pointColor",show(e,t){const n="measure"===wr(e,"color.point.useBaseColors")&&Li.measuresHasBaseColors(t),r="dimension"===wr(e,"color.point.useBaseColors")&&Li.dimensionsHasBaseColors(t);return Li.isColorBySingle(e)&&!n&&!r}},useDimColVal:{ref:"color.point.useDimColVal",show:e=>Li.isColorByDimension(e)&&Li.isDimensionLibraryItem(e)},useMeasureGradient:{ref:"color.point.useMeasureGradient",translation:"properties.libraryColors",type:"boolean",component:"switch",schemaIgnore:!0,defaultValue:!1,options:[{value:!0,translation:"properties.on"},{value:!1,translation:"properties.off"}],show(e){const t=wr(e,"color.point.auto"),n=wr(e,"color.point.mode");return!t&&"byMeasure"===n&&"libraryItem"===wr(e,"color.point.byMeasureDef.type")}},persistentColors:{ref:"color.point.persistent",show:e=>wr(e,"color.point.auto")||"byDimension"!==wr(e,"color.point.mode")||"libraryItem"!==wr(e,"color.point.byDimDef.type")?Qi(e):Qi(e)&&!wr(e,"color.point.useDimColVal")},colorSchemeMeasure:{ref:"color.point.measureScheme",show:e=>!Li.isColorAuto(e)&&Li.isColorByMeasure(e)},reverseScheme:{ref:"color.point.reverseScheme",change(e){e.color.reverseScheme=e.color.point.reverseScheme},show:e=>!Li.isColorAuto(e)&&Li.isColorByMeasure(e)},colorSchemeDimension:{ref:"color.point.dimensionScheme",show:e=>Li.isColorByDimension(e)&&(!Li.isDimensionLibraryItem(e)||!wr(e,"color.point.useDimColVal"))},customRange:{show:e=>!Li.isColorAuto(e),items:{autoMinMax:{ref:"color.point.autoMinMax",show:e=>Li.isColorByMeasure(e)},min:{ref:"color.point.measureMin",show:e=>Li.isColorByMeasure(e)&&!1===wr(e,"color.point.autoMinMax"),invalid:e=>"minMax"===wr(e,"color.point.minMax")&&wr(e,"color.point.measureMin")>=wr(e,"color.point.measureMax")},max:{ref:"color.point.measureMax",show:e=>Li.isColorByMeasure(e)&&!1===wr(e,"color.point.autoMinMax"),invalid:e=>"minMax"===wr(e,"color.point.minMax")&&wr(e,"color.point.measureMin")>=wr(e,"color.point.measureMax")}}},attributeExpression:{ref:"color.point.expression.qValueExpression.qExpr",show:e=>Li.isColorByExpression(e)},expressionIsColor:{ref:"color.point.expressionIsColor",show:!1},boxColor:{ref:"color.box.paletteColor",translation:"properties.distributionPlot.boxColor",type:"object",component:"color-picker",dualOutput:!0,defaultValue(){const e=r.getStyle(fi.CHART_ID,"box","fill");return a(e)},show:e=>!wr(e,"color.point.auto",!0)}}},simpleColors:y,legend:{show:Li.showLegend,type:"items",items:{show:{snapshot:{tid:"property-legend"}},dock:{show:e=>Li.showLegend(e)&&wr(e,"legend.show",!0)},showTitle:{show:e=>Li.showLegend(e)&&wr(e,"legend.show",!0)}}}}},v={items:{labels:{items:{header:{show:e=>e.qHyperCubeDef.qDimensions?.length&&e.qHyperCubeDef.qMeasures?.length},dimensionTitle:{component:"checkbox",ref:"dimensionAxis.show",type:"string",translation:"Simple.Label.Dimension.Hide",defaultValue:"all",show:e=>e.qHyperCubeDef.qDimensions?.length>1&&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"}}},measureTitle:{component:"checkbox",ref:"measureAxis.show",type:"string",translation:"Simple.Label.Measure.Hide",defaultValue:"all",show:e=>e.qHyperCubeDef.qDimensions?.length&&e.qHyperCubeDef.qMeasures?.length,convertFunctions:{get:(e,t,n,r)=>"labels"===r.measureAxis.show||"none"===r.measureAxis.show,set(e,t,n,r,i){i.measureAxis.show=e?"labels":"all"}}}}}}},q={uses:"settings",items:{simpleLabels:v,general:l,presentation:p,colors:b||s,measureAxis:d,dimensionAxis:f}},x={type:"items",component:"expandable-items",translation:"properties.addons",items:{dataHandling:{uses:"dataHandling",items:{calcCond:{uses:"calcCond",change:Li.onChangeCalcCond}}},refLines:{uses:"reflines",items:{colorBackground:{show:!1}}}}},D=si.expression(`${fi.SORT_CRITERIA}.sortByExpression`),S={type:"items",items:{toggled:D.items.toggled,sortByElement:{component:"sort-by-element",expressionRef:fi.SORTING_EXPRESSION,elementRef:fi.SORTING_ELEMENT_ID,show:mi.isSortByExpression,elements:e=>Jr.getAllHyperCubeExpressions(e.properties.qHyperCubeDef,e.layout.qHyperCube,e.model.app).then(t=>{const r=ji.getSettings(e.layout);return Ui.getElements(t.measures,t.dimensions,r,n)})},order:D.items.order}},C={type:"items",translation:"properties.sorting",schemaIgnore:!0,grouped:!1,globalChange(e,t,n){n&&Xi.updateSortOrder(e,n.prevProperties)},items:{autoSort:{ref:fi.AUTO_SORT,type:"boolean",translation:"properties.sorting",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}],show:mi.hasMultipleDimensions,change(e,t,r,i){if(e&&mi.hasMultipleDimensions(e)&&t.layout)return Yi.applySorting(e,t.layout,i.model.app,null,n)},classification:{section:"sorting",tags:["simple"]},reset(e){e.sorting={autoSort:!0}}},simpleSorting:{component:"sorting-with-elements",expressionRef:fi.SORTING_EXPRESSION,elementRef:fi.SORTING_ELEMENT_ID,sortCriteriasRef:fi.SORT_CRITERIA,show:e=>mi.hasMultipleDimensions(e)&&!mi.isAutoSort(e),elements:e=>Jr.getAllHyperCubeExpressions(e.handler.properties.qHyperCubeDef,e.handler.layout.qHyperCube,e.model.app).then(t=>{const r=ji.getSettings(e.layout);return Ui.getElements(t.measures,t.dimensions,r,n)}),classification:{section:"sorting",tags:["simple"],exclusive:!0}},sortingItems:{type:"items",grouped:!0,show:e=>mi.hasMultipleDimensions(e)&&!mi.isAutoSort(e),items:{expression:S,numeric:si.numeric(`${fi.SORT_CRITERIA}.sortByNumeric`),ascii:si.ascii(`${fi.SORT_CRITERIA}.sortByAscii`),defaultSortMessage:{component:"text",translation:"properties.sorting.defaultSortingMessage",show:e=>!mi.isSortByExpression(e)&&!mi.isSortByNumeric(e)&&!mi.isSortByAscii(e)}}},noData:{component:"text",translation:"Common.NoData",style:"hint",show:e=>!mi.hasMultipleDimensions(e),classification:{section:"sorting",tags:["simple"]}}}};return{type:"items",component:"accordion",items:{data:{uses:"data",grouped:!0,items:{dimensions:{uses:"dimensions"},measures:{uses:"measures"}}},sorting:C,addons:x,settings:q}}}const to={buildDefinition:function(e,t,n,r,i){const o=`${n}.qDef.qSortCriterias.0.`,a={type:"items",translation:"properties.sorting",icon:"ascending",show:t=>Ue(t,`${e}.qDimensions.length`,0)>1,items:{sortingOptions:{component:"radio-list",type:"number",diffs:[`${o}qSortByExpression`,`${o}qSortByNumeric`,`${o}qSortByAscii`],options:[{value:1,translation:"properties.sorting.ascending"},{value:-1,translation:"properties.sorting.descending"}],setPropertyValue(e,n,a){const s=a.layout;let l=no(e,o).chart;l||(l="sortByAscii");const u=Ue(e,t);if(u.sortCriteria||(u.sortCriteria={}),u.autoSort){const t=r(s);if(t.ELEMENT)u.elementId=t.ELEMENT;else{const t=i(e,s);u.elementId=t[0]}}u.autoSort=!1,function(e,t){const n=e.sortCriteria;"sortByNumeric"!==t&&"sortByAscii"!==t||(n.sortByExpression=0);"sortByAscii"===t&&(n.sortByNumeric=0)}(u,l),u.sortCriteria[l]=n},getValue(e){const t=no(e,o).dimension;return t?Ue(e,o+t):0}}}};return a}};function no(e,t){const n={chart:"",dimension:""};return 0!==Ue(e,`${t}qSortByExpression`,0)?(n.chart="sortByExpression",n.dimension="qSortByExpression"):0!==Ue(e,`${t}qSortByNumeric`,0)?(n.chart="sortByNumeric",n.dimension="qSortByNumeric"):0!==Ue(e,`${t}qSortByAscii`,0)&&(n.chart="sortByAscii",n.dimension="qSortByAscii"),n}const ro={type:"items",component:"accordion",items:{data:{uses:"data"},sorting:to.buildDefinition("qHyperCubeDef","sorting","qUndoExclude.qHyperCubeDef.qDimensions.0",ji.getSettings,Ui.getElementIds),presentation:{uses:"presentation",items:{orientation:{ref:"orientation",type:"string",component:"item-selection-list",horizontal:!0,items:[{component:"icon-item",icon:"direction_up_down",labelPlacement:"bottom",translation:"properties.orientation.vertical",value:"vertical"},{icon:"direction_left_right",component:"icon-item",labelPlacement:"bottom",translation:"Common.Horizontal",value:"horizontal"}]},bubbleScales:{type:"integer",component:"slider",ref:"dataPoint.bubbleScales",translation:"properties.dataPoints.bubbleSizes",min:20,max:100,step:5,defaultValue:100,show:e=>e.qHyperCubeDef.qMeasures.length<2&&"box"!==e.presentation.visibleComponents},jitter:{type:"string",component:"switch",ref:"dataPoint.displacement",translation:"properties.distributionPlot.jitter",defaultValue:"none",options:[{value:"none",translation:"properties.off"},{value:"jitter",translation:"properties.on"}],show:e=>"box"!==e.presentation.visibleComponents}}}}},io={items:{color:{uses:"color",items:{mode:{options:[{value:"auto",translation:"Common.Auto"},{value:"primary",translation:"properties.colorMode.primary"},{value:"byDimension",translation:"properties.colorMode.byDimension"}],diffs:["color.point.mode","color.point.auto"],setPropertyValue(e,t){"auto"===t?e.color.point.auto=!0:(e.color.point.auto=!1,e.color.point.mode=t)},getValue:e=>Li.isColorAuto(e)?"auto":e.color.point.mode},dimension:{show:e=>Li.isColorByDimension(e),items:{colorScheme:{ref:"color.point.dimensionScheme"},persistentColors:{ref:"color.point.persistent"}}},measure:{show:e=>Li.isColorByMeasure(e),items:{sequential:{ref:"color.point.measureScheme"}}},legend:{show:Li.showLegend}}}}};function oo(e){return{definition:eo(e),softDefinition:ro,support:{cssScaling:!1,snapshot:!0,export:!0,exportData:!0,sharing:!0,viewData:!0},options:{usingDerivedProperties:!0,colorByPath:"color.point"},onSoftPropertyChange(e,t){Li.onGlobalChangeColors(t)},importProperties:(t,n,r)=>{const i=mt(e);r.mapProperties();return jr({dataDefinition:i,defaultPropertyValues:{defaultDimension:r.getDefaultDimensionProperties(),defaultMeasure:r.getDefaultMeasureProperties()},exportFormat:t,initialProperties:n})},exportProperties:(e,t,n)=>$r({propertyTree:e,viewDataMode:n})}}E(!0,ro,io);const ao={getChar(e){let t,n=e;return n>9?(t=65+n-10,t>90&&(t+=6)):n=`${n}`.charCodeAt(0),[48,111,79,105,73,108].indexOf(t)>-1?this.getChar(n+1):String.fromCharCode(t)},base62(e){const t=this.getChar(e%62),n=Math.floor(e/62);return n>0?this.base62(n)+t:t},id(){return this.base62(Math.round(99e11*Math.random()+1e11)).replace(/\W/g,"")}};function so(){return ao.id()}const lo="scrollbar";function uo(e,t,n){return"y"===e?co(t,n):function(e){return"far"===e?"top":"bottom"}(t)}function co(e,t){const n=e||"near";return t&&"near"===n||!t&&"far"===n?"right":"left"}var po={getAxisDock:uo,getOppositeAxisDock:function(e,t,n){return uo(e,"far"===t?"near":"far",n)},getYAxisDock:co};const fo=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼ‎ⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),ho=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞‏יִײַ-ﬨשׁ-ﭏ]"),mo=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]");function go(e){return fo.test(e)}function yo(e){return ho.test(e)||mo.test(e)}var bo={lrm:String.fromCharCode(8206),detectTextDirection:function(e){const t=e?e.length:0;let n,r;for(n=0;n<t;n++){if(r=e[n],go(r))return"ltr";if(yo(r))return"rtl"}return"ltr"}};var vo={lineSettings:function(e,t){const n=void 0!==t.paletteColor?t.theme.getColorPickerColor(t.paletteColor):"transparent";return E(!0,{value:0,line:{stroke:n,strokeDasharray:t?.style?.lineType}},e||{})},lineLabelSettings:function(e,t){const n=t&&t.chartID;let r=t.theme.getStyle(n,"referenceLine.label.name","color");const i=t.theme.getStyle(n,"referenceLine.label.name","fontSize"),o=t.theme.getStyle(n,"referenceLine.label.name","fontFamily");return t.paletteColor?r=t.theme.getColorPickerColor(t.paletteColor):r||(r="transparent"),E(!0,{value:0,line:{stroke:"transparent"},label:{align:"center",vAlign:"middle",text:"",fill:r,fontFamily:o,fontSize:i,maxWidthPx:135}},e||{})},isVisible:e=>e&&!1!==e.show&&0!==e.show&&"0"!==e.show&&void 0!==e.refLineExpr,getRefLineTitle:function({refLine:e,label:t,valueString:n}){return!1!==e.showValue?!1!==e.showLabel?`${t} ${bo.lrm}(${n})${bo.lrm}`:`${bo.lrm}(${n})${bo.lrm}`:!1!==e.showLabel?t:""}};const qo={SHOW_AXIS_LABELS_OPTIONS:["all","labels"],SHOW_TITLE_OPTIONS:["all","title"],HORIZONTAL:"horizontal",VERTICAL:"vertical",LAYOUTSETTINGS:{lasso:{displayOrder:1e4},rangeDim:{displayOrder:1e4},rangeMeasure:{displayOrder:1e4},rangeMinor:{displayOrder:1e4},scrollBar:{minimumLayoutMode:"SPARK",prioOrder:-1,displayOrder:100},refLines:{layout:{minimumLayoutMode:"SPARK",prioOrder:60,displayOrder:1110}},measureAxisTitle:{minimumLayoutMode:"XSMALL",prioOrder:30,displayOrder:90},dimensionAxisTitle:{minimumLayoutMode:"XSMALL",prioOrder:30,displayOrder:90},measureAxis:{minimumLayoutMode:"XSMALL",prioOrder:10,displayOrder:80},dimensionAxis:{minimumLayoutMode:"XSMALL",prioOrder:10,displayOrder:80},gridLines:{minimumLayoutMode:"XSMALL",displayOrder:-100},refLinesLabels:{minimumLayoutMode:"SMALL",prioOrder:60,displayOrder:0}}};qo.DEFAULT_CHART_ORIENTATION=qo.HORIZONTAL;function xo(e,t){const n=t||{},r=n.measureAxisProperties||{},i=n.dimensionAxisProperties||{},o=n.orientation||qo.DEFAULT_CHART_ORIENTATION,a=o===qo.HORIZONTAL,s=a?"x":"y",l=a?"y":"x",u=qo.SHOW_AXIS_LABELS_OPTIONS,c=qo.SHOW_TITLE_OPTIONS,p=u.includes(r.show),d=!!n.measureTitleText&&c.includes(r.show),f=n.includeDimensionAxis&&u.includes(i.show),h=n.includeDimensionAxis&&!!n.dimensionTitleText&&c.includes(i.show),m=n.gridlines&&!(!n.gridlines.auto&&0===n.gridlines.spacing),g=n.refLines&&n.refLines.some(e=>e.show),y=[];if(p&&function(e,t,n,r){let i={scale:"measure",settings:t.axisLabelStyle||{},forceBounds:r&&!r.autoMinMax&&r.showBounds};i=E(i,qo.LAYOUTSETTINGS.measureAxis);const o=So(t,n);e.addComponent(`${n}-axis`,i,o)}(e,n,s,r),d&&function(e,t,n){let r={text:t.measureTitleText,style:t.axisTitleStyle||{}};r=E(r,qo.LAYOUTSETTINGS.measureAxisTitle);const i=function(e,t){return So(e,t)}(t,n);e.addComponent(`${n}-axis-title`,r,i)}(e,n,s),function(e,t,n,r){let i=t.measureScaleSettings;const o={isRtl:t.isRtl,source:t.measureSource,orientation:n,measureAxisProperties:r};r&&r.spacing>0&&(i=E(!0,i||{},{component:{ticks:{distance:100*r.spacing}}}));e.addScale("measure-scale",i,o)}(e,n,o,r),f&&function(e,t,n){let r={scale:"dimension",settings:t.axisLabelStyle||{}};r=E(r,qo.LAYOUTSETTINGS.dimensionAxis);const i=Co(t,n);E(!0,r,t.dimensionAxisSettings||{}),e.addComponent(`${n}-axis`,r,i)}(e,n,l),h&&function(e,t,n){let r={text:t.dimensionTitleText,style:t.axisTitleStyle||{}};r=E(r,qo.LAYOUTSETTINGS.dimensionAxisTitle);const i=function(e,t){return Co(e,t)}(t,n);e.addComponent(`${n}-axis-title`,r,i)}(e,n,l),n.includeDimensionAxis&&function(e,t,n){const r={isRtl:t.isRtl,source:t.dimensionSource,orientation:n===qo.HORIZONTAL?qo.VERTICAL:qo.HORIZONTAL};e.addScale("dimension-scale",t.dimensionScaleSettings,r)}(e,n,o),m&&function(e,t,n){let r={ticks:{show:!0},minorTicks:{show:!t.auto&&!t.auto&&3===t.spacing}};r=E(r,qo.LAYOUTSETTINGS.gridLines),r[n]={scale:"measure"},e.addComponent("grid-line",r)}(e,n.gridlines,s),n.hasNavigation&&function(e,t,n,r){const i=e.getSettings();i.scroll={dimension:{viewSize:n.scrollSettings&&n.scrollSettings.viewSize||0,max:n.scrollSettings&&n.scrollSettings.max||0}};const o={isRtl:n.isRtl,chartID:n.chartID,isHorizontal:!r},a=E({},qo.LAYOUTSETTINGS.scrollBar);e.addComponent("scrollbar",a,o),Do(t,function(e){function t(t,n){if(!n||!e())return!1;const r={x:n.center.x-n.deltaX,y:n.center.y-n.deltaY};return this.chart.componentsFromPoint(r).some(e=>e.settings.key===lo)}const n={type:"Tap",options:{enable:t},events:{tap(e){this.chart.component(lo).emit("tap",e)}}},r={type:"Pan",options:{enable:t},events:{panstart(e){this.chart.component(lo).emit("panStart",e)},pan(e){this.chart.component(lo).emit("panMove",e)},panend(e){this.chart.component(lo).emit("panEnd",e)},pancancel(e){this.chart.component(lo).emit("panCancel",e)}}};return[n,r]}(n.isNavigationEnabledFn))}(e,y,n,a),g&&function(e,t,n,r){const i=po.getAxisDock(n,r.dock,t.isRtl);let o={key:"ref-line",style:{oob:{show:!1}},lines:{x:[],y:[]}};o=E(o,qo.LAYOUTSETTINGS.refLines);let a={key:`ref-line-labels-${so()}`,require:["renderer","chart"],dock:po.getOppositeAxisDock(n,r.dock,t.isRtl),preferredSize(){if("x"===n)return 26;const t=this.renderer.measureText,r=this.chart.formatter({data:e.settings.scales.measure.data}),i=a.lines.y.map(e=>{const n=!1!==e.label.showValue?`(${r(e.value)})`:"",i=`${e.label.text} ${n}`,o=e.label.text&&n?` ${n}`:n;return{wanted:t({text:i,fontSize:e.fontSize,fontFamily:e.fontFamily}).width,required:t({text:o,fontSize:e.fontSize,fontFamily:e.fontFamily}).width}}),o=i[0];for(let e=1;e<i.length;e++)i[e].wanted>o.wanted&&(o.wanted=i[e].wanted),i[e].required>o.required&&(o.required=i[e].required);const s=12;return o.required+s>100?o.required+s:Math.min(o.wanted+s,100)},lines:{x:[],y:[]}};a=E(a,qo.LAYOUTSETTINGS.refLinesLabels),t.refLines.forEach(r=>{if(!r.show)return;const s=r.refLineExpr&&r.refLineExpr.value,l=E(!0,{},t,{paletteColor:r.paletteColor,style:r.style,chartID:e.options.chartID}),u=vo.lineSettings({scale:"measure",dir:n,value:s},l);o.lines[n].push(u);const c=vo.lineLabelSettings({scale:"measure",value:s,label:{text:!1!==r.showLabel?r.label:"",showValue:!1!==r.showValue}},l);"x"===n?c.label.vAlign="near"===i?1:0:c.label.align="near"===i?0:1,a.lines[n].push(c)}),e.addComponent("ref-line",o,{}),e.addComponent("ref-line",a,{})}(e,n,s,r),n.enableLasso&&n.selectionsEnabled){!function(e,t){const n={brushKey:t.brushKey,brushComponents:t.brushComponents,brushData:t.brushData};e.addComponent("lasso",qo.LAYOUTSETTINGS.lasso,n)}(e,n.lasso||{})}if(n.enableDimRange&&n.includeDimensionAxis&&n.selectionsEnabled){!function(e,t,n,r,i){let o={key:"rangeDim"};o=E(o,qo.LAYOUTSETTINGS.rangeDim);const a={brushKey:t.brushKey,brushAxis:t.brushAxis,brushArea:t.brushArea,brushScale:t.brushScale,isHorizontal:!n,dock:r,isRtl:i};e.addComponent("range",o,a)}(e,n.dimRange||{},a,Co(n,l).dock,n.isRtl)}if(n.enableMeasureRange&&n.selectionsEnabled){!function(e,t,n,r,i){let o={key:"rangeMeasure"};o=E(o,qo.LAYOUTSETTINGS.rangeMeasure);const a={brushKey:t.brushKey,brushAxis:t.brushAxis,brushArea:t.brushArea,brushScale:t.brushScale,multiple:t.multiple,isHorizontal:n,dock:r,isRtl:i};e.addComponent("range",o,a)}(e,n.measureRange||{},a,So(n,s).dock,n.isRtl)}if(n.enableAreaRange&&n.selectionsEnabled){!function(e,t,n,r,i){let o={key:"rangeMinor"};o=E(o,qo.LAYOUTSETTINGS.rangeMinor);const a={brushKey:t.brushKey,brushAxis:t.brushAxis,brushData:t.brushData,brushArea:t.brushArea,brushComponents:t.brushComponents,brushScale:t.brushScale,multiple:t.multiple,isHorizontal:"measure"===t.brushScale?n:!n,dock:r,isRtl:i,chartInstance:t.chartInstance};e.addComponent("range-area",o,a)}(e,n.areaRange||{},a,Co(n,l).dock,n.isRtl)}n.brushActions&&Do(y,n.brushActions),y.length&&function(e,t){e.addInteraction({},{gestures:t})}(e,y)}function Do(e,t){t.forEach(t=>{e.push(t)})}function So(e,t){return{dock:e.measureAxisProperties&&e.measureAxisProperties.dock,direction:t,isRtl:e.isRtl}}function Co(e,t){return{dock:e.dimensionAxisProperties&&e.dimensionAxisProperties.dock,direction:t,isRtl:e.isRtl}}function Mo(e,t){const n=t||{},r=!n.orientation||"horizontal"===n.orientation,i=!!n.isRtl,o={name:n.name||"scale",component:{invert:r&&i,minorTicks:{count:1},range:n.range||void 0,domain:n.domain||void 0,trackBy:n.trackBy||"id"}};return E(!0,{},o,e||{})}function Eo(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?void 0:"svg"}function Ao(e,t){const n=t&&t.chartID,r=t&&t.dock,i=t&&t.direction,o=t&&t.isRtl,a=t.theme.getStyle(n,"axis.line.major","color"),s=t.theme.getStyle(n,"axis.title","fontSize"),l=t.theme.getStyle(n,"axis.title","color"),u=t.theme.getStyle(n,"axis.label.name","color"),c=t.theme.getStyle(n,"axis.label.name","fontSize"),p=t.theme.getStyle(n,"axis.title","fontFamily"),d=t.theme.getStyle(n,"axis.label.name","fontFamily"),f={key:"axis",type:"axis",renderer:Eo(),dock:po.getAxisDock(i,r,o),brush:{trigger:[],consume:[]},settings:{title:{fontSize:s,fontFamily:p,fill:l},line:{show:!0,strokeWidth:1,stroke:a},labels:{fill:u,fontSize:c,fontFamily:d,tiltAngle:o?-40:40,maxEdgeBleed:75,maxSize:150,mode:"auto"},ticks:{stroke:a},minorTicks:{stroke:a}}},h=E(!0,{},f,e||{});return h.brush.consume.forEach(e=>{e.style.active.strokeWidth=0}),h}function Io(e,t){const n=t&&t.chartID,r=t&&t.dock,i=t&&t.direction,o=t&&t.isRtl,a=t.theme.getStyle(n,"axis.title","fontSize"),s=t.theme.getStyle(n,"axis.title","color"),l=t.theme.getStyle(n,"axis.title","fontFamily"),u={key:"text",type:"text",dock:po.getAxisDock(i,r,o),displayOrder:0,style:{text:{fontSize:a,fontFamily:l,fill:s}}};return E(!0,{},u,e||{})}Mo.measureScale=function(e,t){let n=(t||{}).source||[];"string"==typeof n&&(n=[n]);const r={name:"measure",component:{expand:.1,data:{fields:n.map(e=>({field:e}))}}},i=t&&t.measureAxisProperties;i&&!i.autoMinMax&&(["min","minMax"].includes(i.minMax)&&(r.component.min=i.min),["max","minMax"].includes(i.minMax)&&(r.component.max=i.max));const o=Mo(E(!0,r,e||{}),t);return!(e&&e.component&&void 0!==e.component.invert)&&t&&"vertical"===t.orientation&&(o.component.invert=!o.component.invert),o},Mo.dimensionScale=function(e,t){const n={name:"dimension",component:{trackBy:"id",type:"band",data:{extract:{field:t&&t.source||"",props:{label:e=>e.qText||""}}},label:e=>e.datum.label.value}};return Mo(E(!0,n,e||{}),t)},Ao.xAxis=function(e,t){return Ao(E(!0,{key:"x-axis",scale:"x"},e||{}),t)},Ao.yAxis=function(e,t){const n=t&&t.dock,r=t&&t.isRtl,i={key:"y-axis",scale:"y",dock:po.getYAxisDock(n,r)};return Ao(E(!0,i,e||{}),t)},Io.xAxisTitle=function(e,t){return Io(E(!0,{key:"x-axis-title"},e||{}),t)},Io.yAxisTitle=function(e,t){const n=t&&t.dock,r=t&&t.isRtl,i={key:"y-axis-title",dock:po.getYAxisDock(n,r)||"left"};return Io(E(!0,i,e||{}),t)};var wo={getBublesAlign:function(e,t,n){let r=e&&"far"!==t||!e&&"far"===t;return!e&&n&&(r=!r),r?"start":"end"},getDock:function(e,t){const n=[];let r;return e&&n.push(`@${e}`),t&&n.push(`@${t}`),n.length&&(r=n.join(",")),r}};const Oo={SPARK:{width:0,height:0},XSMALL:{width:150,height:75},SMALL:{width:300,height:150},MEDIUM:{width:400,height:220},FULL:{width:550,height:450}};function To(){return Oo}function ko(e){const t=e.data.end;return e.dataset(t.source.key).field(t.source.field).formatter()(t.value)}To.getLayoutModeKeys=function(){const e=[];let t;for(t in Oo)e.push(t);return e};const No={left:"left",right:"right",up:"top",down:"bottom"};function Po(e,t,n){switch(e){case"scale":return Mo(t,n);case"measure-scale":return Mo.measureScale(t,n);case"dimension-scale":return Mo.dimensionScale(t,n);case"axis":return Ao(t,n);case"box-marker":return function(e){return E(!0,{},{key:"box-marker",type:"box-marker",settings:{minor:{scale:"x"},orientation:"horizontal"},brush:{trigger:[],consume:[]}},e||{})}(t);case"point-marker":return function(e){return E(!0,{},{key:"point-marker",type:"point-marker",settings:{},brush:{trigger:[],consume:[]}},e||{})}(t);case"scrollbar":return function(e,t){const n=t&&t.isRtl,r=t&&t.chartID,i=t&&t.isHorizontal,o={key:"scrollbar",type:"scrollbar",scroll:"dimension",dock:i?"bottom":n?"left":"right",settings:{backgroundColor:t.theme.getStyle(r,"","backgroundColor"),invert:n&&i}};return E(!0,{},o,e||{})}(t,n);case"text":return Io(t,n);case"lasso":return function(e,t){const n=t&&t.brushKey,r=t&&t.brushComponents?t.brushComponents:[],i=t&&t.brushData?t.brushData:["elemNo"],o={type:"brush-lasso",key:"lasso",displayOrder:99,settings:{brush:{components:[]},lasso:{fill:"rgba(0, 0, 0, 0)",stroke:"rgba(102,102,102,1)",strokeWidth:2,opacity:1,strokeDasharray:null},startPoint:{r:10,fill:"rgba(0, 152, 69, 1)",strokeWidth:0,opacity:1}}};return r.forEach(e=>{o.settings.brush.components.push({contexts:n?[n]:void 0,key:e,data:i})}),E(!0,{},o,e||{})}(t,n);case"range":return function(e,t){const n=t&&t.brushKey,r=t&&t.brushAxis,i=t&&t.brushArea,o=t&&t.brushScale,a=t&&t.isHorizontal,s=t&&t.dock,l=t&&t.isRtl,u={type:"brush-range",key:"range",displayOrder:99,dock:wo.getDock(r,i),settings:{brush:n,fill:"rgba(0, 0, 0, 0)",scale:o,multiple:!t||!1!==t.multiple||t.multiple,direction:a?"horizontal":"vertical",target:{component:r,fill:"rgba( 82, 204, 82, 0.2 )",fillActive:"rgba(82, 204, 82, 0.4)"},bubbles:{align:wo.getBublesAlign(a,s,l)}}};return E(!0,{},u,e||{})}(t,n);case"range-area":return function(e,t){const n=t&&t.brushKey,r=t&&t.brushAxis,i=t&&t.brushComponents?t.brushComponents:[],o=t&&t.brushData?t.brushData:["elemNo"],a=t&&t.brushArea,s=t&&t.isHorizontal,l=t&&t.dock,u=t&&t.isRtl,c=t&&t.chartInstance;let p=!0;const d={type:"brush-area-dir",key:"area",displayOrder:99,dock:wo.getDock(r,a),settings:{brush:{components:[]},direction:s?"horizontal":"vertical",target:{component:r,fill:"rgba( 82, 204, 82, 0.2 )",fillActive:"rgba(82, 204, 82, 0.4)"},bubbles:{align:wo.getBublesAlign(s,l,u),label:e=>p?(p=!1,c.dataset(e.binStart.source.key).field(e.binStart.source.field).formatter()(e.binStart.value)):(p=!0,c.dataset(e.binEnd.source.key).field(e.binEnd.source.field).formatter()(e.binEnd.value))},multiple:!t||!1!==t.multiple||t.multiple}};return i.forEach(e=>{d.settings.brush.components.push({contexts:n?[n]:void 0,key:e,data:o,action:"add"})}),E(!0,{},d,e||{})}(t,n);case"categorical-legend":return function(e,t){const n=t&&t.chartID,r=t&&t.isRtl;let i=t&&t.dock||"auto";const o=t&&t.show;"auto"===i&&(i=t.chartHeight/t.chartWidth<1?r?"left":"right":"bottom");const a=t.theme.getStyle(n,"legend.title","color"),s=t.theme.getStyle(n,"legend.title","fontSize"),l=t.theme.getStyle(n,"legend.label","color"),u=t.theme.getStyle(n,"legend.label","fontSize"),c=t.theme.getStyle(n,"legend.title","fontFamily"),p=t.theme.getStyle(n,"legend.label","fontFamily"),d={key:"legend",type:"legend-cat",renderer:Eo(),dock:i,show:o,scale:{type:"color"},settings:{title:{anchor:"middle"},layout:{direction:r?"rtl":"ltr",size:"top"===i||"bottom"===i?2:1,vertical:"top"===i||"bottom"===i?16:8},navigation:{button:{class:{"lui-fade-button":!0},content:(e,t)=>e("span",{style:{pointerEvents:"none"},class:["lui-button__icon","lui-icon",`lui-icon--triangle-${No[t.direction]}`].join(" ")})}}},style:{item:{label:{fontSize:u,fontFamily:p,fill:l,lineHeight:1,wordBreak:"break-word"},margin:{top:5,left:10,right:10,bottom:10},shape:{type:t.type?t.type:"square",size:3*parseInt(u,10)/4}},title:{show:t.showTitle,fontSize:s,fontFamily:c,fill:a}}};return E(!0,{},d,e)}(t,n);case"sequential-legend":return function(e,t){const n=t&&t.chartID,r=t&&t.isRtl;let i=t.dock||"auto";"auto"===i&&(i=t.chartHeight<t.chartWidth?r?"left":"right":"bottom");const o=t.theme.getStyle(n,"legend.title","color"),a=t.theme.getStyle(n,"legend.title","fontSize"),s=t.theme.getStyle(n,"legend.title","fontFamily"),l=t.theme.getStyle(n,"legend.label","color"),u=t.theme.getStyle(n,"legend.label","fontSize"),c=t.theme.getStyle(n,"legend.label","fontFamily");function p(e){switch(e){case"left":return 0;case"right":return 1;default:return.5}}const d={key:"seqlegend",type:"legend-seq",dock:i,displayOrder:200,minimumLayoutMode:"MEDIUM",prioOrder:0,settings:{align:p(r?"right":"left"),major:{invert:"left"===i||"right"===i||r},title:{show:t.showTitle,fontSize:a,fontFamily:s,fill:o},tick:{fill:l,fontSize:u,fontFamily:c}}};return E(!0,{},d,e)}(t,n);case"x-axis":return Ao.xAxis(t,n);case"y-axis":return Ao.yAxis(t,n);case"x-axis-title":return Io.xAxisTitle(t,n);case"y-axis-title":return Io.yAxisTitle(t,n);case"grid-line":return function(e,t){const n=t&&t.chartID,r=t.theme.getStyle(n,"grid.line.major","color");return E(!0,{},{displayOrder:-1,key:"grid-line",type:"grid-line",x:null,y:null,ticks:{stroke:r},minorTicks:{stroke:r}},e||{})}(t,n);case"interaction":return function(e,t){const n=t&&t.gestures||[];return E(!0,{},{type:"hammer",key:"hammered",gestures:n},e||{})}(t,n);case"ref-line":return function(e,t){const n=t&&t.chartID,r=t.theme.getStyle(n,"referenceLine.outOfBounds","color"),i=t.theme.getStyle(n,"referenceLine.outOfBounds","backgroundColor");return E(!0,{},{key:"ref-line",type:"ref-line",dock:"center",prioOrder:-1,lines:{x:[],y:[]},style:{oob:{width:7,fill:i,text:{fill:r},padding:{x:7,y:5}}}},e||{})}(t,n);case"event-area":return function(e){return E(!0,{},{type:"event-area",key:"event-area"},e||{})}(t);case"labels":return function(e,t){const n=t&&t.chartID,r=t.theme.getStyle(n,"label.value","color"),i=t.theme.getStyle(n,"label.value","fontSize"),o=t.theme.getStyle(n,"label.value","fontFamily"),a={key:"labels",type:"labels",renderer:Eo(),displayOrder:1,settings:{sources:[{component:"box-marker",selector:"rect",strategy:{type:"bar",settings:{direction:"up",fontFamily:o,fontSize:parseFloat(i),align:.5,labels:[{placements:[{position:"outside",fill:r,justify:0},{position:"inside",fill:e&&e.settings.sources[0].strategy.settings.labels[0].placements[1].fill,justify:1}],label:ko}]}}}]}};return E(!0,{},a,e||{})}(t,n);default:return}}function Lo(e){this.options=e||{},this.settings={dockLayout:{layoutModes:To()},components:[],scales:{}}}Lo.prototype.addComponent=function(e,t,n){const r=Po(e,t,E(!0,{},this.options,n||{}));return this.settings.components.push(r),r},Lo.prototype.addInteraction=function(e,t){const n=Po("interaction",e,E(!0,{},this.options,t||{}));return this.settings.interactions||(this.settings.interactions=[]),this.settings.interactions.push(n),n},Lo.prototype.addScale=function(e,t,n){const r=Po(e,t,E(!0,{},this.options,n||{}));this.settings.scales[r.name]=r.component},Lo.prototype.getSettings=function(){return this.settings},Lo.prototype.getComponent=function(e){return this.settings.components.filter(t=>t.key===e)[0]},Lo.prototype.addPreset=function(e,t){!function(e,t,n){if("dimension-measure-chart"!==e)throw Error("There is no chart preset with that type");xo(t,n)}(e,this,t)},Lo.validateComponentKeys=function(e){const t={};return e.map(e=>{const n=e.key;return n?t[n]?`Duplicate key for component ${e.type}`:(t[n]=!0,null):`Missing key for component ${e.type}`}).filter(e=>!!e)},Lo.create=function(e){return new Lo(e)},Lo.createComponent=Po;const _o={CENTER:0,BOTTOM:1};var Ro={DISCLAIMERS:[{label:"NoDataExist",alignment:_o.CENTER,default:!0},{label:"RequireNumericDimension",alignment:_o.CENTER,default:!1},{label:"OnlyNanData",alignment:_o.CENTER,default:!0},{label:"OnlyNegativeOrZeroValues",alignment:_o.CENTER,default:!1},{label:"LimitedData",alignment:_o.BOTTOM,default:!1},{label:"OnlyNanColor",alignment:_o.BOTTOM,default:!1},{label:"NegativeOrZeroValues",alignment:_o.BOTTOM,default:!1},{label:"DataRangeIncludingZero",alignment:_o.BOTTOM,default:!1}],ALIGNMENT:_o};const Ho={getNoDataExistAttribute:e=>e.qSize.qcy*e.qSize.qcx===0,getLimitedDataAttribute(e,t){let n,r=!1;var i;return e?void 0!==t.explicitLimitedData?r=!0===t.explicitLimitedData:e.qDataPages&&e.qDataPages[0]?r=!t.paging&&e.qSize.qcy>e.qDataPages[0].qMatrix.length:(i=e.qStackedDataPages)&&i[0]&&i[0].qData[0]&&i[0].qData[0].qSubNodes&&(n=t.maxNbrOfDimensions?t.maxNbrOfDimensions:2,r=e.qDimensionInfo.length>=n?e.qStackedDataPages[0].qData[0].qSubNodes.some(e=>e.qDown>0):e.qStackedDataPages[0].qData[0].qSubNodes.length<e.qStackedDataPages[0].qArea.qHeight):r=!0===t.explicitLimitedData,r},getNegativeOrZeroValuesAttribute:(e,t)=>!t.supportNegative&&e.qMeasureInfo.some(e=>e.qMin<=0),getOnlyNegativeOrZeroValuesAttribute:(e,t)=>!t.supportNegative&&e.qMeasureInfo.every(e=>e.qMax<=0&&e.qMax>=e.qMin)||0===e.qSize.qcy,getOnlyNanDataAttribute:(e,t)=>void 0!==t.explicitOnlyNanData?t.explicitOnlyNanData:e.qMeasureInfo.every(e=>e.qMax<e.qMin||"NaN"===e.qMax),getDataRangeIncludingZeroAttribute:(e,t)=>!t.supportRangeOverZero&&function(e,t){const n=t.length;let r,i,o,a,s;for(e&&(i=!(e.autoMinMax||"min"!==e.minMax&&"minMax"!==e.minMax||null===e.min||Number.isNaN(+e.min)),o=!(e.autoMinMax||"max"!==e.minMax&&"minMax"!==e.minMax||null===e.max||Number.isNaN(+e.max))),a=Number.MAX_VALUE,s=-Number.MAX_VALUE,r=0;r<n;r++)if(a=Math.min(a,t[r].qMin),s=Math.max(s,t[r].qMax),a<=0&&s>=0)return!0;return a=i?e.min:a,s=o?e.max:s,a<=0&&s>=0}(e.measureAxis,e.qHyperCube.qMeasureInfo),applyAttributes(e,t){const n=e||{},r={};return n.supportNegative=void 0===n.supportNegative||n.supportNegative,n.supportRangeOverZero=void 0===n.supportRangeOverZero||n.supportRangeOverZero,Ro.DISCLAIMERS.forEach(e=>{r[e.label]=!1}),t&&t.qHyperCube?(r.NoDataExist=this.getNoDataExistAttribute(t.qHyperCube),r.NoDataExist?r:(r.RequireNumericDimension=n.explicitRequireNumericDimension,r.RequireNumericDimension||(r.LimitedData=this.getLimitedDataAttribute(t.qHyperCube,n),r.NegativeOrZeroValues=this.getNegativeOrZeroValuesAttribute(t.qHyperCube,n),r.OnlyNegativeOrZeroValues=this.getOnlyNegativeOrZeroValuesAttribute(t.qHyperCube,n),r.OnlyNanData=this.getOnlyNanDataAttribute(t.qHyperCube,n),r.DataRangeIncludingZero=this.getDataRangeIncludingZeroAttribute(t,n)),r)):r}};function Fo(e,t,n){this.disclaimersConfig=e,this.dataAttributes=t,this.supportedDisclaimers=n}function Bo(e,t){return e&&t&&t[e]}function Vo(e){this.environment=e,this.clear()}Fo.prototype.isValidAndSupported=function(e,t){return Bo(e.label,this.dataAttributes)&&(e.default||Bo(e.label,this.supportedDisclaimers))&&void 0!==t&&e.alignment===t},Fo.prototype.isAnyValidDisclaimer=function(e){let t=!1;const n=this;return this.disclaimersConfig.forEach(r=>{n.isValidAndSupported(r,e)&&(t=!0)}),t},Fo.prototype.getMessage=function(e,t){let n="";const r=this;return t&&this.disclaimersConfig.forEach(i=>{r.isValidAndSupported(i,e)&&(n+=`${t.get(`Object.Disclaimer.${i.label}`)} `)}),n},Vo.ERRORS={SET:"Calling Disclaimer.set() without attributes",DISPLAY:"Calling Disclaimer.display() before attributes are applied"},Vo._applyDefaultSupport=function(e,t){let n=e;return n||(n={}),t.forEach(e=>{void 0===n[e.label]&&(n[e.label]=e.default)}),n},Vo.prototype.getComponentSettings=function(){const{translator:e}=this.environment,t=E(!0,{},this.vizAttributes.supportedDisclaimers),n=new Fo(Ro.DISCLAIMERS,this.dataAttributes,t);let r,i;if(n.isAnyValidDisclaimer(Ro.ALIGNMENT.CENTER))r=n.getMessage(Ro.ALIGNMENT.CENTER,e),i="center";else{if(!n.isAnyValidDisclaimer(Ro.ALIGNMENT.BOTTOM))return;r=n.getMessage(Ro.ALIGNMENT.BOTTOM,e),i="bottom"}return{key:"disclaimer",type:"disclaimer",layout:{displayOrder:1e3,dock:i},settings:{label:r,rtl:"rtl"===this.environment?.options?.direction}}},Vo.prototype.set=function(e){if(this.clear(),!e)throw new Error(Vo.ERRORS.SET);this.vizAttributes=e,this.dataAttributes=Ho.applyAttributes(this.vizAttributes.options,this.vizAttributes.data)},Vo.prototype.clear=function(){this.vizAttributes=null,this.dataAttributes=null};const zo=Ze.extend({init(e,t,n,r,i){this.$element=t,this.environment=n,this.backendApi=r,this._selectionsApi=i,this._on=!1,this._disclaimer=new Vo(n),this._dataPaths=["qHyperCube"];const o=this;this.picassoElement=t[0],this.picassoElement.className+=" picasso-chart",this.chartInstance=e.chart({element:this.picassoElement,settings:{components:[Lo.createComponent("event-area",{mounted(e){o.dataAreaElem=e}})]}})},updateEnvironment(e){this.environment=e},isRtl(){return"rtl"===this.environment.options?.direction},setDataPaths(e){this._dataPaths=e},getData:(e,t,n)=>function(e,t,n){let r,i={qTop:0,qLeft:0,qWidth:t.qSize.qcx,qHeight:1e4/t.qSize.qcx};if(n){const e=n.width||t.qSize.qcx,r=Math.floor(1e4/e);i={qTop:n.top||0,qLeft:n.left||0,qWidth:e,qHeight:n.height?Math.min(n.height,r):r}}else i={qTop:0,qLeft:0,qWidth:t.qSize.qcx,qHeight:1e4/t.qSize.qcx};r="K"===t.qMode?"qStackedDataPages":"qDataPages";return e.getData([i],null,t).then(e=>{t[r]=e})}(e,t,n),hasValidData:()=>!0,paint(){if(this.hasValidData()){this._disclaimer.set(this.getDisclaimerAttributes(this.layout));const e=this._disclaimer.getComponentSettings(),t="center"===e?.layout?.dock,n=this.createChartSettings(this.layout);t?n.components=[e]:e&&n.components.push(e),Lo.validateComponentKeys(n.components).forEach(e=>{console.error(e)}),this.updateChart(this.layout,n),this._painted=!0}return Promise.resolve()},resize(){if(this.layout)return this.paint()},createChartSettings(){throw new Error('Subclass must implement "createChartSettings" function')},addSnapshotChartSettings(e,t){const{freeResize:n}=this.environment.options;!n&&t.snapshotData&&(e.dockLayout.logicalSize={width:t.snapshotData.content.size.w,height:t.snapshotData.content.size.h,preserveAspectRatio:!0})},updateData(e){return this._destroyed?Promise.reject():(this.layout=E(!0,{},e),this.layout.permissions=e.permissions,Promise.resolve())},updateChart(e,t,n){const r=this.environment.appLayout?.qLocaleInfo??{},i=this._dataPaths.map(t=>({type:"q",key:t,config:{localeInfo:r},data:Ue(e,t.replace(/\//g,"."))}));this.colorService&&i.push(...this.colorService.getData()),this.chartInstance.update({data:i,settings:t,partialData:n});this.picassoElement.setAttribute("data-state",2)},destroy(){this._destroyed=!0,this.off(),this.chartInstance.destroy()},getViewState:()=>({}),isLassoDisabled:()=>!0,setSnapshotData(e){e.snapshotData||(e.snapshotData={}),e.snapshotData.content={chartData:{},size:{w:this.$element.width(),h:this.$element.height()}}},getDisclaimerAttributes:e=>({data:e})});function jo(e){let t=0;if(!e||!e.length)return t;for(let n=0;n<e.length;n++){t=(t<<5)-t+e.charCodeAt(n),t&=t}return t}const $o={generateHash:function(e){return jo(JSON.stringify(e))},updateHash:function(e,t){e.qUndoExclude||(e.qUndoExclude={});e.qUndoExclude.hashCode=$o.generateHash(t)}};const Uo={getDefaultHashDataForHyperCube:function(e,t,n){return function(e,t){const n=[];if(!e.qMeasures)return Promise.resolve(n);return e.qMeasures.forEach(e=>{e.qLibraryId?n.push(function(e,t){return t.getMeasure(e).then(e=>e.getProperties().then(e=>e.qMeasure.qDef))}(e.qLibraryId,t)):n.push(Promise.resolve())}),Promise.all(n)}(e,n).then(e=>({drillLevel:Ko(t),dimensionExpressions:Wo(t),measureExpressions:e}))}};function Wo(e){return e.qDimensionInfo.map(e=>e.qGroupFieldDefs)}function Ko(e){const t=function(e){return Ue(e,"qDimensionInfo",[])}(e);return t.map(e=>e.qGroupPos)}const Yo={},Go=E.bind(null,!0);function Xo(e){return null!=e&&!Array.isArray(e)&&"object"==typeof e}const Jo=Array.isArray,Zo=function(e){return void 0===e};function Qo(e,t){return"function"==typeof e[t]||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function ea(e,t){const n=t.substring(1).split("/").slice(0,-1);let r;return n.forEach((t,i)=>{i!==n.length&&(r=+t,e[r||t]=Zo(e[r||t])?Number.isNaN(+r)?{}:[]:e[t],e=e[r||t])}),e}function ta(e,t){if(Xo(e)&&Xo(t)){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n of Object.keys(e))if(!ta(e[n],t[n]))return!1;return!0}if(Jo(e)&&Jo(t)){if(e.length!==t.length)return!1;for(let n=0,r=e.length;n<r;n++)if(!ta(e[n],t[n]))return!1;return!0}return e===t}Yo.generate=function(e,t,n){n=n||"";let r=[];return Object.keys(t).forEach(i=>{const o=function(e){return e&&(e=Go({},{val:e}).val),e}(t[i]),a=e[i],s=`${n}/${i}`;ta(o,a)||Qo(t,i)||(Zo(a)?r.push({op:"add",path:s,value:o}):Xo(o)&&Xo(a)?r=r.concat(Yo.generate(a,o,s)):Jo(o)&&Jo(a)?r=r.concat(function(e,t,n){let r=[];const i=e.slice();let o,a,s=-1;function l(e,t,n){if(e[n]&&Zo(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++)if(e[n]&&e[n].qInfo.qId===t)return n;return-1}if(ta(t,i))return r;if(null===t[0]||!Zo(t[0])&&Zo(t[0].qInfo))return r.push({op:"replace",path:n,value:t}),r;for(o=i.length-1;o>=0;--o)s=l(t,i[o]&&i[o].qInfo&&i[o].qInfo.qId,o),-1===s?(r.push({op:"remove",path:`${n}/${o}`}),i.splice(o,1)):r=r.concat(Yo.generate(i[o],t[s],`${n}/${o}`));for(o=0,a=t.length;o<a;++o)s=l(i,t[o]&&t[o].qInfo&&t[o].qInfo.qId),-1===s?(r.push({op:"add",path:`${n}/${o}`,value:t[o]}),i.splice(o,0,t[o])):s!==o&&(r.push({op:"move",path:`${n}/${o}`,from:`${n}/${s}`}),i.splice(o,0,i.splice(s,1)[0]));return r}(a,o,s)):r.push({op:"replace",path:`${n}/${i}`,value:o}))}),Object.keys(e).forEach(i=>{Zo(t[i])&&!Qo(e,i)&&r.push({op:"remove",path:`${n}/${i}`})}),r},Yo.apply=function(e,t){t.forEach(t=>{const n=ea(e,t.path);let r=t.path.split("/").splice(-1)[0];const i=r&&Number.isNaN(+r)?n[r]:n[+r]||n,o=t.from?t.from.split("/").splice(-1)[0]:null;if("add"===t.op||"replace"===t.op)if(Jo(n))"-"===r&&(r=n.length),n.splice(+r,"add"===t.op?0:1,t.value);else if(Jo(i)&&Jo(t.value)){const e=t.value.slice();i.length=0,i.push.apply(i,e)}else Xo(i)&&Xo(t.value)?(a=i,Object.keys(a).forEach(e=>{Object.getOwnPropertyDescriptor(a,e).configurable&&!Qo(a,e)&&delete a[e]}),Go(i,t.value)):n[r]=t.value;else if("move"===t.op){const i=ea(e,t.from);Jo(n)?n.splice(+r,0,i.splice(+o,1)[0]):(n[r]=i[o],delete i[o])}else"remove"===t.op&&(Jo(n)?n.splice(+r,1):delete n[r]);var a})},Yo.clone=function(e){return Go({},e)},Yo.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},Yo.updateObject=function(e,t){Object.keys(e).length?Yo.apply(e,Yo.generate(e,t)):Go(e,t)};class na{constructor(e){this._model=e}setModel(e){this._model=e}saveSoftProperties(e,t){if(!this._model)return Promise.resolve(!1);let n=Yo.generate(e,t);return E(!0,e,t),n&&n.length?(n=n.map(e=>({qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path})),this._model.applyPatches(n,!0).then(()=>!0)):Promise.resolve(!1)}async mergeSoftPatches(){if(!this._model)return;const e=this._model.getProperties(),t=this._model.getEffectiveProperties(),n=await e,r=await t;if(n.qExtendsId)return;const i=Yo.generate(n,r);Yo.apply(n,i);const o=this;o._model.setProperties(n).then(()=>{o._model.clearSoftPatches()})}}var ra={canModifyHardProperties:function(e){if(e.qHasSoftPatches||e.qExtendsId)return!1;if(e.permissions)return e.permissions.update;return-1!==e.qMeta.privileges.indexOf("update")}};var ia={saveDerivedProperties:function(e,t,n,r){if(ra.canModifyHardProperties(t))return e.setProperties(n);return new na(e).saveSoftProperties(r,n)}};var oa={validate:function(e){if(!(e&&e.layout&&e.properties&&e.model&&e.hashData&&e.generateDerivedProperties))throw Error("Derived-properties: Missing input")}};function aa(){this._generationInProgress=!1}function sa(e){oa.validate(e);const t=e.properties,n=$o.generateHash(e.hashData);return!(!t.qUndoExclude||t.qUndoExclude.hashCode!==n)}aa.prototype.isDerivedUpToDate=sa,aa.prototype.updateDerivedProperties=function(e){if(oa.validate(e),this._generationInProgress)return Promise.resolve(!0);if(sa(e)){const t=e.layout.qUndoExclude&&e.layout.qUndoExclude.hashCode===e.properties.qUndoExclude.hashCode;return Promise.resolve(!t)}const t=this,n=e.model,r=e.layout,i=E(!0,{},e.properties),o=E(!0,{},i);return this._generationInProgress=!0,$o.updateHash(i,e.hashData),e.generateDerivedProperties(r,i).then(()=>ia.saveDerivedProperties(n,r,i,o).then(()=>(t._generationInProgress=!1,Promise.resolve(!0))))},aa.prototype.addDefaultHyperCubeHash=function(e,t,n,r){return Uo.getDefaultHashDataForHyperCube(e,t,n).then(e=>E(!0,r,e))};var la,ua={exports:{}};var ca=(la||(la=1,ua.exports=function(){function e(e,t,n){return(t=i(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function t(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 n(n){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?t(Object(i),!0).forEach(function(t){e(n,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):t(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))})}return n}function r(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function i(e){var t=r(e,"string");return"symbol"==typeof t?t:t+""}var o=Object.prototype.hasOwnProperty,a=Object.prototype.toString,s=Object.defineProperty,l=Object.getOwnPropertyDescriptor,u=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===a.call(e)},c=function(e){if(!e||"[object Object]"!==a.call(e))return!1;var t,n=o.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&o.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||o.call(e,t)},p=function(e,t){s&&"__proto__"===t.name?s(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},d=function(e,t){if("__proto__"===t){if(!o.call(e,t))return;if(l)return l(e,t).value}return e[t]},f=function e(){var t,n,r,i,o,a,s=arguments[0],l=1,f=arguments.length,h=!1;for("boolean"==typeof s&&(h=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l<f;++l)if(null!=(t=arguments[l]))for(n in t)r=d(s,n),s!==(i=d(t,n))&&(h&&i&&(c(i)||(o=u(i)))?(o?(o=!1,a=r&&u(r)?r:[]):a=r&&c(r)?r:{},p(s,{name:n,newValue:e(h,a,i)})):void 0!==i&&p(s,{name:n,newValue:i}));return s};function h(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 m(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 g(e){let{cache:t,f:n,mainCell:r,p:i,page:o,rowIdx:a,row:s,sourceKey:l,target:u,targetProp:c,columnOrder:p}=e,d=r;if(i.field&&i.field!==n){const e=h(i.field,o,{cache:t},p);if(-1===e)return;d=f({qRow:a},e(s))}u[c]=m(i,d,{key:l})}function y(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),p=Object.keys(u),d=!!i[e].trackBy,y=typeof i[e].trackBy,b={},v=[],q=[];for(let t=0;t<a.qDataPages.length;t++){const o=h(l,a.qDataPages[t],{cache:n},a.qColumnOrder);if(-1!==o)for(let h=0;h<a.qDataPages[t].qMatrix.length;h++){const x=a.qDataPages[t].qArea.qTop+h,D=f({qRow:x},o(a.qDataPages[t].qMatrix[h])),S=m(c,D,{key:s});if(!c.filter||c.filter(D)){for(let e=0;e<p.length;e++){const r=u[p[e]];let i=r.fields||[r];r.fields&&(S[p[e]]=[]);for(let o=0;o<i.length;o++)g({cache:n,f:l,mainCell:D,p:i[o],prop:p[e],page:a.qDataPages[t],rowIdx:x,row:a.qDataPages[t].qMatrix[h],sourceKey:s,target:r.fields?S[p[e]]:S,targetProp:r.fields?o:p[e],columnOrder:a.qColumnOrder});if(r.fields){const t=S[p[e]].map(e=>e.value),n=S[p[e]].map(e=>e.label);S[p[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(S[p[e]].value)}}}d&&r.track({cfg:i[e],itemData:D,obj:S,target:v,tracker:b,trackType:y}),q.push(S)}}}const x=d?r.collect(v,{main:c,propsArr:p,props:u}):q;o=[...o,...x]}return o}function b(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 v(){return this.eachAfter(b)}function q(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this}function x(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}function D(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}function S(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r}function C(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})}function M(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function E(e){for(var t=this,n=A(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}function A(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}function I(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function w(){return Array.from(this)}function O(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function T(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*k(){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)}function N(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=_)):void 0===t&&(t=L);for(var n,r,i,o,a,s=new F(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 F(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(H)}function P(){return N(this).eachBefore(R)}function L(e){return e.children}function _(e){return Array.isArray(e)?e[1]:null}function R(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function H(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function F(e){this.data=e,this.depth=this.height=0,this.parent=null}function B(e){return null==e?null:V(e)}function V(e){if("function"!=typeof e)throw new Error;return e}F.prototype=N.prototype={constructor:F,count:v,each:q,eachAfter:D,eachBefore:x,find:S,sum:C,sort:M,path:E,ancestors:I,descendants:w,leaves:O,links:T,copy:P,[Symbol.iterator]:k};var z={depth:-1},j={},$={};function U(e){return e.id}function W(e){return e.parentId}function K(){var e,t=U,n=W;function r(r){var i,o,a,s,l,u,c,p,d=Array.from(r),f=t,h=n,m=new Map;if(null!=e){const t=d.map((t,n)=>Y(e(t,n,r))),n=t.map(G),i=new Set(t).add("");for(const e of n)i.has(e)||(i.add(e),t.push(e),n.push(G(e)),d.push($));f=(e,n)=>t[n],h=(e,t)=>n[t]}for(a=0,i=d.length;a<i;++a)o=d[a],u=d[a]=new F(o),null!=(c=f(o,a,r))&&(c+="")&&(p=u.id=c,m.set(p,m.has(p)?j:u)),null!=(c=h(o,a,r))&&(c+="")&&(u.parent=c);for(a=0;a<i;++a)if(c=(u=d[a]).parent){if(!(l=m.get(c)))throw new Error("missing: "+c);if(l===j)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===$&&1===s.children.length;)s=s.children[0],--i;for(let e=d.length-1;e>=0&&(u=d[e]).data===$;--e)u.data=null}if(s.parent=z,s.eachBefore(function(e){e.depth=e.parent.depth+1,--i}).eachBefore(H),s.parent=null,i>0)throw new Error("cycle");return s}return r.id=function(e){return arguments.length?(t=B(e),r):t},r.parentId=function(e){return arguments.length?(n=B(e),r):n},r.path=function(t){return arguments.length?(e=B(t),r):e},r}function Y(e){let t=(e=`${e}`).length;return X(e,t-1)&&!X(e,t-2)&&(e=e.slice(0,-1)),"/"===e[0]?e:`/${e}`}function G(e){let t=e.length;if(t<2)return"";for(;--t>1&&!X(e,t););return e.slice(0,t)}function X(e,t){if("/"===e[t]){let n=0;for(;t>0&&"\\"===e[--t];)++n;if(!(1&n))return!0}return!1}function J(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=J(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]=J(r,i[e]);return t}n[e]in i&&(i=i[n[e]])}return i}function Z(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,...Z(e[i].children,t-1,n)]);return r}function Q(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=>Z(e.children,r-1,n)}return!1}function ee(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))}const te=/^qDimensionInfo(?:\/(\d+))?/,ne=/^\/?qMeasureInfo\/(\d+)/,re=/\/qAttrExprInfo\/(\d+)/,ie=/\/qAttrDimInfo\/(\d+)/;function oe(e){const t=e.raw().qColumnOrder,n=e.fields();return t&&t.length===n.length?t:n.map((e,t)=>t)}function ae(e){return(e.qColumnOrder&&e.qColumnOrder.length?e.qColumnOrder:e.qDimensionInfo.map((e,t)=>t)).filter(t=>t<e.qDimensionInfo.length)}function se(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,p=r;const d=n.qEffectiveInterColumnSortOrder,f=ae(n);return te.test(p)&&(i=!0,o=+te.exec(p)[1],p=r.replace(te,"")),ne.test(p)&&("K"===n.qMode?u=+ne.exec(p)[1]:d&&-1!==d.indexOf(-1)?(u=+ne.exec(p)[1],c=0):c=+ne.exec(p)[1],p=p.replace(ne,"")),p&&(ie.exec(p)?s=+ie.exec(p)[1]:re.exec(p)&&(a=+re.exec(p)[1])),l=i?"S"===n.qMode?f[o]:d?d.indexOf(o):o:d&&-1!==d.indexOf(-1)?d.indexOf(-1):n.qDimensionInfo.length-("K"===n.qMode?0:1),{fieldDepth:l+1,pseudoMeasureIndex:u,measureIdx:c,attrDimIdx:s,attrIdx:a}}function le(e,t){let n,r,i=Q(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 ue(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 ce(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 p=l[n];let d,f,h,m,g,y;if("primitive"===p.type?(h=p.value,y=String(p.value)):("function"==typeof p.value&&(d=e=>p.value(e,r)),"function"==typeof p.label&&(f=e=>p.label(e,r)),p.accessor?(m=p.accessor(r),Array.isArray(m)?(g=m.map(p.valueAccessor),p.attrAccessor&&(g=g.map(p.attrAccessor)),d&&(h=g.map(d),d=null),f&&(y=g.map(f),f=null),h=p.reduce?p.reduce(h):h,y=p.reduceLabel?p.reduceLabel(y,h):String(h)):(h=p.attrAccessor?p.attrAccessor(p.valueAccessor(m)):p.valueAccessor(m),y=h)):(h=i,y=i)),s.fields){const e=d?d(h):h;u.push(e),c.push(f&&null!=y?f(y):null!=y?y:String(e))}else{const n=d?d(h):h;o[t[e]]={value:n,label:f?f(y):null!=y?y:String(n)},p.field&&(o[t[e]].source={field:p.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 pe=(e,t,n)=>{const r="K"===e.qMode?"/qStackedDataPages/*/qData":"/qTreeDataPages/*",i="K"===e.qMode?"qSubNodes":"qNodes",o=J(r,e);return o&&o[0]?(t.tree=N(o[0],n.children||(e=>e[i])),t.tree):null};function de(e){const t=e.raw().qDataPages.length?e.raw().qDataPages[0].qMatrix:[],r=oe(e),i=e.fields(),o=e.fields().filter(e=>"dimension"===e.type()).map(e=>r.indexOf(i.indexOf(e))),a=e.fields().filter(e=>"measure"===e.type()).map(e=>r.indexOf(i.indexOf(e))),s={__root:{__id:"__root",qValues:[]}};for(let e=0;e<t.length;e++){const r=t[e];let i="__root",u=!1;for(let e=0;e<o.length;e++){var l;const t=r[o[e]],a="".concat(i,"__").concat(null!==(l=t.qElemNumber)&&void 0!==l?l:t.qElemNo);s[a]||(s[a]=n({__id:a,__parent:i,qValues:[]},t),u=!0),i=a}if(u)for(let e=0;e<a.length;e++){const t=r[a[e]];s[i].qValues.push(t)}}const u=Object.keys(s).map(e=>s[e]);return K().id(e=>e.__id).parentId(e=>e.__parent)(u)}const fe=e=>{let{propsArr:t,props:n,cube:r,cache:i,itemDepthObject:o,f:a}=e;for(let e=0;e<t.length;e++){const i=n[t[e]],s=i.fields?i.fields:[i];for(let e=0;e<s.length;e++){const t=s[e];if(t.field!==a){const e=le(o,se(t.field,{cube:r}));t.accessor=e.nodeFn,t.valueAccessor=e.valueFn,t.attrAccessor=e.attrFn}}}};function he(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;const o=t.raw(),a=t.key(),s="S"===o.qMode?de(t):pe(o,r,e);if(!s)return null;const l=s.height,u=[];for(let a=0;a<=l;a++){let s=null;if(a>0)if("S"===o.qMode){let e=ae(o)[a-1];s=r.fields[e]}else{let e=o.qEffectiveInterColumnSortOrder[a-1];a>o.qEffectiveInterColumnSortOrder.length&&(e=o.qDimensionInfo.length),s=r.fields[e]}const{props:l,main:c}=i.normalizeConfig(n(n({},e),{},{field:s?s.key():void 0}),t),p=Object.keys(l);u[a]={propsArr:p,props:l,main:c};const d=s?se(s,{cube:o}):{fieldDepth:0};fe({propsArr:p,props:l,cube:o,cache:r,itemDepthObject:d,f:s})}const c=s.copy().descendants(),p=s.descendants();for(let e=0;e<p.length;e++){const t=u[p[e].depth].propsArr,n=u[p[e].depth].props,r=u[p[e].depth].main,i=c[e],o=i.data,s=ue(r,o,{key:a});ce({propsArr:t,props:n,item:i,itemData:o,ret:s,sourceKey:a}),p[e].data=s}return s}function me(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(!pe(s,n,e))continue;const u="object"==typeof i[a].field?i[a].field:t.field(i[a].field),{props:c,main:p}=r.normalizeConfig(i[a],t),d=Object.keys(c),f=se(u,{cube:s}),{nodeFn:h,attrFn:m,valueFn:g}=le({fieldDepth:0},f);fe({propsArr:d,props:c,cube:s,cache:n,itemDepthObject:f,f:u});const y=!!i[a].trackBy,b=typeof i[a].trackBy,v={},q=[],x=h(n.tree),D=[];for(let e=0;e<x.length;e++){const t=x[e],n=m?m(g(t)):g(t);if(p.filter&&!p.filter(n))continue;const o=ue(p,n,{key:l});ce({propsArr:d,props:c,item:t,itemData:n,ret:o,sourceKey:l}),y&&r.track({cfg:i[a],itemData:n,obj:o,target:q,tracker:v,trackType:b}),D.push(o)}const S=y?r.collect(q,{main:p,propsArr:d,props:c}):D;o=[...o,...S]}return o}function ge(e,t){return e(t={exports:{}},t.exports),t.exports}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==gt||"undefined"!=typeof self&&self;var ye=ge(function(e){var t;t=function(){return function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,a,s,l,u,c,p,d=e.length,f=e.search(/[0-9\-\+#]/),h=f>0?e.substring(0,f):"",m=e.split("").reverse().join(""),g=m.search(/[0-9\-\+#]/),y=d-g,b=e.substring(y,y+1),v=y+("."===b||","===b?1:0),q=g>0?e.substring(v,d):"";if(n=(t="-"===(e=e.substring(f,v)).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(m="",y=(p=t[0]).length%l,d=p.length,v=0;v<d;v++)m+=p.charAt(v),!((v-y+1)%l)&&v<d-l&&(m+=o);t[0]=m}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),h+(n?"-":"")+r+q}},e.exports=t()});const be=1e-15;function ve(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}const qe={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"},xe=/%\)?$/,De=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,Se=/^\(oct\)/i,Ce=/^\(dec\)/i,Me=/^\(hex\)/i,Ee=/^\(bin\)/i,Ae=/^\(rom\)/i,Ie=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,we=/#|0/g;function Oe(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 Te(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}function ke(e,t,n){let r;return De.test(t)?e=Oe(e,Number(/\d{2}/.exec(t)[0]),t,n):Se.test(t)?e=Oe(e,8,t,n):Ce.test(t)?e=Oe(e,10,t,n):Me.test(t)?e=Oe(e,16,t,n):Ee.test(t)?e=Oe(e,2,t,n):Ae.test(t)&&(r="",e<0&&(r="-",e=-e),e=0===(e=Math.floor(e))?"0":e<=5e5?r+(e=Te(e,t)):t+r+e.toExponential(0)),e}function Ne(e,t,n){const r=ve(e);return n?r:new RegExp(r||"",t)}function Pe(e,t){return t&&(t=ve(t)),e&&(e=ve(e)),new RegExp("(?:[#0]+".concat(e,")?[#0]+(?:").concat(t,"[#0]+)?"))}function Le(e,t){if(!e||!e.qNumericalAbbreviation)return qe;const n={};return e.qNumericalAbbreviation.split(t).forEach(e=>{let t=e.split(":");2===t.length&&(n[t[0]]=t[1])}),n}function _e(e,t,n,r){let i,o,a,s,l,u,c,p,d,f=e.pattern;r&&(e.abbreviate=!0),d=Pe(t,n),a=f.match(d),a=a?a[0]:"",s=a?f.substr(0,f.indexOf(a)):f,l=a?f.substring(f.indexOf(a)+a.length):"",a||(a=f?"#":"##########"),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(Ne(u,"g"),t)),c=n,n=".",c&&(a=a.replace(Ne(c,"g"),n)),p=a.match(/#/g),p=p?p.length:0;const h=f.split(c);let m;h[1]&&(m=h[1].match(we)),e.prefix=s||"",e.postfix=l||"",e.pattern=f,e.maxPrecision=m?m.length:2,e.percentage=xe.test(f),e.numericPattern=a||"",e.numericRegex=new RegExp("".concat(Ne(t,null,!0),"|").concat(Ne(n,null,!0)),"g"),e.groupTemp=u,e.decTemp=c,e.t=t,e.d=n,e.temp=p}class Re{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=Le(e,this.patternSeparator),this.prepare()}clone(){const e=new Re(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],Ie.test(e[0])&&(r.positive.isFunctional=!0),e[1]?Ie.test(e[1])&&(r.negative.isFunctional=!0):r.negative=!1,e[2]?Ie.test(e[2])&&(r.zero.isFunctional=!0):r.zero=!1;const i="U"===this.type;r.positive.isFunctional||_e(r.positive,t,n,i),r.negative&&!r.negative.isFunctional&&_e(r.negative,t,n,i),r.zero&&!r.zero.isFunctional&&_e(r.zero,t,n,i)}formatValue(e){let t,n,r,i,o,a,s,l,u,c=this._prepared,p="",d="",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=ke(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&&(p=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+be*(e<0?-1:1)).toFixed(Math.min(20,u?u.length:0)).split(".")[0]);let n=l.split(o)[0];if(n+=o,e=ye(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+be).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)/,""),d=""):(e=e.toPrecision(Math.max(1,Math.min(14,t)))).indexOf(".")>=0&&(e=(e=e.replace(e.indexOf("e")<0?/0+$/:/\.?0+(?=e)/,"")).replace(".",o));else{for(l+=o,t=Math.max(0,Math.min(20,t-Math.ceil(Math.log(r)/Math.log(10)))),s=0;s<t;s++)l+="#";e=ye(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+d+p+c.postfix}static getStaticFormatter(){return{prepare(){},formatValue:e=>"".concat(e)}}}function He(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Re(...t)}function Fe(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 Be(e,t,n,r,i){const o=He(i,e,t,n,r),a=Fe(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 Ve={DATE:"D",TIME:"T",DATE_TIME:"TS",INTERVAL:"IV"},ze=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],je=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],$e=["January","February","March","April","May","June","July","August","September","October","November","December"],Ue=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],We=86400;function Ke(e,t){for(let n=e.length;n<t;n++)e="0".concat(e);return e}function Ye(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"}}function Ge(e){let t=e.toString().split(".");return t[1]?(t=Number("0.".concat(t[1])),t):0}function Xe(e){const t=e,n=24*Ge(t),r=60*Ge(n),i=60*Ge(r),o=1e3*Ge(i);return{d:Math.floor(t),h:Math.floor(n),m:Math.floor(r),s:Math.floor(i),f:Math.round(o)}}function Je(e,t){let n,r=Xe(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(We*(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}}function Ze(e,t){return{"Y+|y+":{Y:"".concat(Number("".concat(t.year).slice(-2))),YY:Ke("".concat(t.year).slice(-2),2),YYY:Ke("".concat(t.year).slice(-3),3),def:e=>Ke("".concat(t.year),e.length)},"M+":{M:t.month+1,MM:Ke("".concat(t.month+1),2),MMM:e.locale_months_abbr[t.month],def:e.locale_months[t.month]},"W+|w+":{W:t.day,WW:Ke("".concat(t.day),2),WWW:e.locale_days_abbr[t.day],def:e.locale_days[t.day]},"D+|d+":{D:t.date,def:e=>Ke("".concat(t.date),e.length)},"h+|H+":{h:t.h,def:e=>Ke("".concat(t.h),e.length)},"m+":{m:t.m,def:e=>Ke("".concat(t.m),e.length)},"s+|S+":{s:t.s,def:e=>Ke("".concat(t.s),e.length)},"f+|F+":{def(e){let n="".concat(t.f),r=e.length-n.length;if(r>0)for(let e=0;e<r;e++)n+="0";else r<0&&(n=n.slice(0,e.length));return n}},"t{1,2}|T{1,2}":{def(e){let n=t.t;return e[0].toUpperCase()===e[0]&&(n=n.toUpperCase()),n=n.slice(0,e.length),n}}}}class Qe{constructor(e,t,n){const r=e||{};r.qCalendarStrings||(r.qCalendarStrings={qLongDayNames:ze,qDayNames:je,qLongMonthNames:$e,qMonthNames:Ue}),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={[Ve.TIME]:r.qTimeFmt||"hh:mm:ss",[Ve.DATE]:r.qDateFmt||"YYYY-MM-DD",[Ve.DATE_TIME]:r.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"}[n]),this.pattern=t}clone(){const e=new Qe(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=Ye(e,n):(e<0&&(e=-e,t="-".concat(t)),r=Je(e,t));const i=Ze(this,r),o=[];for(const e in i)Object.prototype.hasOwnProperty.call(i,e)&&o.push(e);const a=new RegExp(o.join("|"),"g");return t.replace(a,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 et(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Qe(...t)}const tt=864e5;function nt(e){return new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,0,Math.round(tt*(e-Math.floor(e)))))}function rt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"TS",n=et(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,e,t),r=Fe(n.format.bind(n),{toKey:e=>"object"==typeof e&&"function"==typeof e.getTime?e.getTime():e});function i(e){return t!==Ve.INTERVAL?nt(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=et(i,e,t),r=Fe(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 it(e,t){if(e&&e.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(e.qNumFormat.qType))return rt(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"),Be(n,r,i,o,t)}function ot(){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=e=>(null==e?void 0:e.qText)||"",p="dimension"===s?"first":"avg",d=it(t,i),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:c,reduce:p,reduceLabel:"dimension"===s?"first":(e,t)=>d(t),formatter:()=>d,tags:()=>t.qTags};return f}function at(e,t,n,r,i){return(t[e]||[]).map((t,o)=>{const a="".concat(r?"".concat(r,"/"):"").concat(e,"/").concat(o),s={instance:ot(f({id:"".concat(n?"".concat(n,"/"):"").concat(a),key:a,meta:t},i))};return s.attrDims=at("qAttrDimInfo",t,n,a,f({},i,{value:e=>null==e?void 0:e.qElemNo,type:"dimension"})),s.attrExps=at("qAttrExprInfo",t,n,a,f({},i,{value:e=>null==e?void 0:e.qNum,type:"measure"})),s.measures=at("qMeasureInfo",t,n,a,f({},i,{value:e=>null==e?void 0:e.qValue,type:"measure"})),s})}function st(){let{key:e,data:t,config:r={}}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const i={fields:[],wrappedFields:[],allFields:[],virtualFields:[]},o=t;if(!o)throw new Error('Missing "data" input');if(!o.qDimensionInfo)throw new Error('The "data" input is not recognized as a hypercube');const a=st.util,s={cache:i,cube:o,localeInfo:r.localeInfo,fieldExtractor:null,pages:null,hierarchy:()=>null,virtualFields:r.virtualFields},l={key:()=>e,raw:()=>o,field:e=>ee(e,s),fields:()=>i.fields.slice(),extract:e=>s.extractor(e,l,i,a),hierarchy:e=>s.hierarchy(e,l,i,a),_cache:()=>i};"K"===o.qMode||"T"===o.qMode||!o.qMode&&o.qNodesOnDim?(s.extractor=me,s.hierarchy=he,s.pages="K"===o.qMode?o.qStackedDataPages:o.qTreeDataPages):"S"===o.qMode?(s.extractor=y,s.pages=o.qDataPages,s.hierarchy=he):s.extractor=()=>[],s.fieldExtractor=e=>s.extractor({field:e},l,i,a);const u="S"===o.qMode?e=>e.qElemNumber:void 0,c="S"===o.qMode?e=>e.qNum:void 0;i.wrappedFields.push(...at("qDimensionInfo",o,e,"",f({},s,{value:u,type:"dimension"}))),i.wrappedFields.push(...at("qMeasureInfo",o,e,"",f({},s,{value:c,type:"measure"}))),i.fields=i.wrappedFields.map(e=>e.instance);const p=e=>{e.forEach(e=>{i.allFields.push(e.instance),p(e.measures),p(e.attrDims),p(e.attrExps)})};return p(i.wrappedFields),(r.virtualFields||[]).forEach(t=>{const r=l.field(t.from),o=ot(n({meta:r.raw(),id:"".concat(e,"/").concat(t.key),sourceField:r,fieldExtractor:e=>s.extractor({field:e},l,i,a),key:t.key,type:r.type(),localeInfo:s.localeInfo,value:r.value},t.override||{}));i.virtualFields.push(o)}),i.allFields.push(...i.virtualFields),l}const lt=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],ut=/\/qDimensionInfo(?:\/(\d+))?/,ct=/\/qMeasureInfo\/(\d+)/,pt=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,dt=/\/qAttrExprInfo\/(\d+)/,ft=/\/?qHyperCube/,ht=/\/?qTreeData/,mt=e=>"".concat(e.substr(0,e.indexOf("/qHyperCubeDef")+14)),yt=e=>"".concat(e.substr(0,e.indexOf("/qTreeDataDef")+13));function bt(e,t){let n=e,r=-1,i=-1,o="",a=e=>e;ft.test(e)?(o="".concat(n.substr(0,n.indexOf("qHyperCube")+10)),a=mt):ht.test(e)&&(o="".concat(n.substr(0,n.indexOf("qTreeData")+9)),a=yt);let s=!0;if(ut.test(e)&&(r=+ut.exec(e)[1]),ct.test(e)&&(i=+ct.exec(e)[1]),pt.test(e)){i=-1,r=0;const e=+pt.exec(n)[2];isNaN(e)||(r=e,n=n.replace(/\/\d+$/,"")),s=!1}if(dt.test(e)){const e=i;if(t){i=0;const a=J(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+=+dt.exec(n)[1]}else r>-1?(r=-1,i=+dt.exec(n)[1]):i+=+dt.exec(n)[1]+1}return lt.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}}function vt(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=bt(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 qt(e){st.util=e.data("matrix").util,e.data("q",st),e.formatter("q-number",Be),e.formatter("q-time",rt)}return qt.qBrushHelper=vt,qt.selections=vt,qt}()),ua.exports),pa=yt(ca);const da={brushInterceptors:{DIM_VALUE_NULL:-2,DIM_VALUE_TOTAL:-3,brushOnlyOne:function(e,t){const n=e.brushes().filter(e=>"value"===e.type);let r=[];n.length&&n.forEach(e=>{r=r.concat(e.brush.values().map(t=>({key:e.id,value:t})))});return r.concat(t)},filterValues:function(e,t){const n=this;let r,i;const o=[];let a=0;const s=[];return t.forEach(t=>{t.value!==n.DIM_VALUE_NULL&&t.value!==n.DIM_VALUE_TOTAL&&(i=function(e,t){const n=t.key.indexOf("qHyperCube")+10,r=t.key.substr(0,n),i=t.key.substr(n+1);return e.dataset(r).field(i)}(e,t),r=i&&i.raw(),r.qLocked?(o.push(r),a++):s.push({key:t.key,value:t.value}))}),{items:s,itemsAreLocked:a>0&&a===t.length,lockedFields:o}}}};const fa={data:["elemNo"],contexts:["select"],startOnEmptySelection:!0,style:{active:{strokeWidth:2,stroke:"#333"},inactive:{opacity:.3}}};function ha(e){if(!e||!e.chartInstance||!e.selectionsApi)throw Error("Selections-handler: Missing input");const t=e.chartInstance,n=e.selectionsApi,r=e.dataPaths||[""],i=e.selectPaths,o=e.lasso;let a=[];const s={propertiesToRestore:{}};let l=!1;const u=function(e,t,n){function r(){}return r.update=function(e,r,i){t.isActive()||t.begin(n),pa.qBrushHelper(i).forEach(e=>{t.select(e)})},r.toggleValues=function(r,i,o){const a=da.brushInterceptors.filterValues(e,r),s=a.items;return t.isActive()||a.itemsAreLocked||!(o||s.length>0)||(t.begin(n),i.start(),i.emit("update",[],[])),s},r}(t,n,i),c={};let p=!1;function d(e){16===e.keyCode&&e.shiftKey!==p&&(p=e.shiftKey,o.toggle())}function f(e){const t=e.keyCode;27===t?n.cancel():13===t&&n.confirm()}function h(){a.forEach(e=>{e.listeners.update=function(t,n){e.sleep||u.update(t,n,e.brush)},e.brush.on("update",e.listeners.update),e.brush.on("start",e.listeners.start)})}function m(){a.forEach(e=>{e.brush.removeListener("update",e.listeners.update),e.brush.removeListener("start",e.listeners.start)})}return n.on("cleared",()=>{a.forEach(e=>{e.brush.clear(),e.dependentComponents.forEach(e=>{const n=t.component(e.id);n&&n.emit(e.clear)})})}),c.setUp=function(e){c.tearDown();const t=this.setUpBrush(e);return l&&h(),t},c.setUpBrush=function(e){const n=E(!0,{},fa,e),i={on:"tap",action:t=>t.ctrlKey||e.isSingleSelect?"set":"toggle",contexts:n.contexts,data:n.data,globalPropagation:"stop"},o={context:n.contexts[0],data:n.data,style:n.style},s=function(e,t){return{brush:t.brush(e.contexts[0]),listeners:{},dependentComponents:[],id:e.contexts[0]}}(n,t);return s.listeners.toggle=function(e){if(!l)return[];const i=function(){const e=[];let n=r.map(e=>t.dataset(e).fields().filter(e=>"dimension"===e.type()));n=[].concat.apply([],n);for(let t=0;t<n.length;t++)n[t].raw().qLocked&&e.push(n[t].raw());return{fields:e,areAllFieldsLocked:e.length&&e.length===n.length}}();return n.startOnEmptySelection&&0===e.length&&i.areAllFieldsLocked?[]:u.toggleValues(e,s.brush,n.startOnEmptySelection)},s.brush.intercept("toggle-values",s.listeners.toggle),s.brush.intercept("add-values",s.listeners.toggle),s.brush.intercept("remove-values",s.listeners.toggle),s.brush.intercept("set-values",s.listeners.toggle),s.listeners.start=function(){a.length>1&&a.forEach(e=>{e!==s&&e.brush.end()})},a.push(s),{trigger:i,consume:o}},c.setUpStart=function(){c.tearDown()},c.setUpDone=function(){l&&h()},c.tearDown=function(){l&&m(),a.forEach(e=>{e.brush.removeInterceptor("toggle-values",e.listeners.toggle),e.brush.removeInterceptor("add-values",e.listeners.toggle),e.brush.removeInterceptor("remove-values",e.listeners.toggle),e.brush.removeInterceptor("set-values",e.listeners.toggle)}),a=[]},c.pauseEngineCalls=function(e){a.forEach(t=>{t.id===e&&(t.sleep=!0)})},c.resumeEngineCalls=function(e,t){a.forEach(n=>{n.id===e&&(n.sleep=!1,t&&n.listeners.update([],[]))})},c.addComponent=function(e,t){a.forEach(n=>{n.id===e&&n.dependentComponents.push(t)})},c.on=function(){if(l)return;l=!0,h(),document.addEventListener("keydown",d),document.addEventListener("keyup",d);const e=()=>{a.forEach(e=>{e.brush.end()}),document.removeEventListener("keyup",f),o.active()&&o.toggle()};n.on("deactivated",e),s.unbindDeactivated=()=>{n.removeListener("deactivated",e)};const t=()=>{document.addEventListener("keyup",f)};n.on("activated",t),s.unbindActivated=()=>{n.removeListener("activated",t)}},c.isOn=()=>l,c.off=function(){l&&(l=!1,m(),document.removeEventListener("keydown",d),document.removeEventListener("keyup",d),document.removeEventListener("keyup",f),s.unbindActivated(),s.unbindDeactivated())},c.lassoState=function(){return o.active()&&!(e.isLassoDisabled&&e.isLassoDisabled())},c.allFieldsLocked=function(){return function(){let e=r.map(e=>t.dataset(e).fields().filter(e=>"dimension"===e.type()));return e=[].concat.apply([],e),e.length&&e.every(e=>e.raw().qLocked)}()},c}class ma{isOn(){return!1}on(){console.warn("Can not turn on selections on this object")}off(){}}var ga={create:e=>e.selectionsApi?ha(e):new ma};var ya={isOnComponentForRange:function(e,t,n){return!!e&&!!n.chart.componentsFromPoint({x:e.center.x,y:e.center.y}).filter(e=>-1!==t.indexOf(e.settings.key))[0]},isOnComponentForLasso:function(e,t,n){return e&&n.chart.componentsFromPoint({x:e.center.x,y:e.center.y}).filter(e=>e.settings.key===t.keys.componentKey)[0]},isOnComponentForNavBtn:function(e,t,n){return n.chart.componentsFromPoint(e.center).some(e=>e.settings.key===t)}};var ba={callLassoGesture:function(e,t,n){return{type:"Pan",options:{direction:M.DIRECTION_ALL,threshold:1,enable(r,i){if(e.lassoing)return t.isSelectionEnabled();const o=ya.isOnComponentForLasso(i,n,this);return t.isSelectionEnabled()&&i&&((a=n.handlers).selectionHandler.lassoState()&&!a.selectionHandler.allFieldsLocked()||e.lassoing)&&o;var a},event:"lasso"},recognizeWith:n.handlers.scrollHandler?"drag":null,events:{lassostart(r){ya.isOnComponentForLasso(r,n,this)&&(t.switchTo("lasso",this.chart,r),e.lassoing=!0,n.handlers.selectionHandler.pauseEngineCalls(n.keys.lassoBrushKey),r.clientX=r.pointers[0].clientX,r.clientY=r.pointers[0].clientY,t.doEmit(this.chart,"lasso","lassoStart",r))},lassomove(n){e.lassoing&&(n.clientX=n.pointers[0].clientX,n.clientY=n.pointers[0].clientY,t.doEmit(this.chart,"lasso","lassoMove",n))},lassoend(r){e.lassoing&&(r.clientX=r.pointers[0].clientX,r.clientY=r.pointers[0].clientY,t.doEmit(this.chart,"lasso","lassoEnd",r),n.handlers.selectionHandler.resumeEngineCalls(n.keys.lassoBrushKey,!0),e.lassoing=!1)},lassocancel(r){e.lassoing=!1,t.doEmit(this.chart,"lasso","lassoCancel",r),n.handlers.selectionHandler.resumeEngineCalls(n.keys.lassoBrushKey,!1)}}}}};var va={callMeasureRangeGesture:function(e,t,n,r){const i=n.keys.dimRangeBrushKey?"majorrange":"arearange";return{type:"Pan",options:{direction:n.isHorizontal?M.DIRECTION_HORIZONTAL:M.DIRECTION_VERTICAL,event:"measurerange",enable(i,o){if(!n.rangeSelStatus.isOpenMea)return!1;if(e.measureSelecting)return t.isSelectionEnabled();const a="measurerange"===n.active.gesture?[r,n.keys.componentKey]:[r],s=ya.isOnComponentForRange(o,a,this);return e.measureSelecting=t.isSelectionEnabled()&&!!o&&!!s,e.measureSelecting&&!!n.keys.measureRangeBrushKey}},requireFailure:`lasso ${i}`,recognizeWith:n.handlers.scrollHandler?"drag":null,events:{measurerangestart(i){const o="measurerange"===n.active.gesture?[r,n.keys.componentKey]:[r];ya.isOnComponentForRange(i,o,this)&&(e.measureSelecting=!0,t.switchTo("measurerange",this.chart,i),t.doEmit(this.chart,"rangeMeasure","rangeStart",i),n.handlers.selectionHandler.pauseEngineCalls(n.keys.measureRangeBrushKey))},measurerangemove(n){e.measureSelecting&&t.doEmit(this.chart,"rangeMeasure","rangeMove",n)},measurerangeend(r){e.measureSelecting&&(n.handlers.selectionHandler.resumeEngineCalls(n.keys.measureRangeBrushKey,!0),t.doEmit(this.chart,"rangeMeasure","rangeEnd",r),e.measureSelecting=!1)},measurerangecancel(){n.handlers.selectionHandler.resumeEngineCalls(n.keys.measureRangeBrushKey,!1),e.measureSelecting=!1}}}}};function qa(e,t){let n;return n="x-axis"===e?"horizontal"===t?M.DIRECTION_VERTICAL:M.DIRECTION_HORIZONTAL:"horizontal"===t?M.DIRECTION_HORIZONTAL:M.DIRECTION_VERTICAL,n}var xa={callAreaRangeGesture:function(e,t,n,r){const i=n.keys.dimRangeBrushKey?"majorrange":"measurerange";return{type:"Pan",options:{direction:qa(r,n.isHorizontal),event:"arearange",enable(i,o){if(!n.rangeSelStatus.isOpenDim)return!1;if(e.minoring)return t.isSelectionEnabled();const a="arearange"===n.active.gesture?[r,n.keys.componentKey]:[r],s=ya.isOnComponentForRange(o,a,this);return e.minoring=t.isSelectionEnabled()&&!!o&&!!s,e.minoring}},requireFailure:`lasso ${i}`,recognizeWith:n.handlers.scrollHandler?"drag":null,events:{arearangestart(i){const o="arearange"===n.active.gesture?[r,n.keys.componentKey]:[r];ya.isOnComponentForRange(i,o,this)&&(e.minoring=!0,t.switchTo("arearange",this.chart,i),t.doEmit(this.chart,"rangeMinor","areaStart",i),n.handlers.selectionHandler.pauseEngineCalls(n.keys.areaBrushKey))},arearangemove(r){e.minoring&&(this.chart.brush(n.keys.areaBrushKey).clear(),t.doEmit(this.chart,"rangeMinor","areaMove",r))},arearangeend(r){e.minoring&&(n.handlers.selectionHandler.resumeEngineCalls(n.keys.areaBrushKey,!0),t.doEmit(this.chart,"rangeMinor","areaEnd",r),e.minoring=!1)},arearangecancel(){n.handlers.selectionHandler.resumeEngineCalls(n.keys.areaBrushKey,!1),e.minoring=!1}}}}};var Da={callDimensionRangeGesture:function(e,t,n,r){const i=n.keys.measureRangeBrushKey?"measurerange":"arearange";return{type:"Pan",options:{direction:n.isHorizontal?M.DIRECTION_VERTICAL:M.DIRECTION_HORIZONTAL,event:"majorrange",enable(i,o){if(!n.rangeSelStatus.isOpenDim)return!1;if(e.majoring)return t.isSelectionEnabled();const a="majorrange"===n.active.gesture?[r,n.keys.componentKey]:[r],s=ya.isOnComponentForRange(o,a,this);return e.majoring=t.isSelectionEnabled()&&!!o&&!!s,e.majoring&&!!n.keys.dimRangeBrushKey}},requireFailure:`lasso ${i}`,recognizeWith:n.handlers.scrollHandler?"drag":null,events:{majorrangestart(i){const o="majorrange"===n.active.gesture?[r,n.keys.componentKey]:[r];ya.isOnComponentForRange(i,o,this)&&(e.majoring=!0,t.switchTo("majorrange",this.chart,i),t.doEmit(this.chart,"rangeDim","rangeStart",i),n.handlers.selectionHandler.pauseEngineCalls(n.keys.dimRangeBrushKey))},majorrangemove(n){e.majoring&&t.doEmit(this.chart,"rangeDim","rangeMove",n)},majorrangeend(r){e.majoring&&(n.handlers.selectionHandler.resumeEngineCalls(n.keys.dimRangeBrushKey,!0),t.doEmit(this.chart,"rangeDim","rangeEnd",r),e.majoring=!1)},majorrangecancel(){n.handlers.selectionHandler.resumeEngineCalls(n.keys.dimRangeBrushKey,!1),e.majoring=!1}}}}};var Sa={callDragGesture:function(e,t,n,r,i){let o={};return{type:"Pan",options:{direction:n.isHorizontal?M.DIRECTION_VERTICAL:M.DIRECTION_HORIZONTAL,event:"drag",enable(r,i){return e.dragging?t.isNavigationEnabled():(e.dragging=t.isNavigationEnabled()&&!!i&&!!this.chart.componentsFromPoint({x:i.center.x,y:i.center.y}).filter(e=>e.settings.key===n.keys.componentKey)[0],e.dragging)}},requireFailure:r?`lasso ${t.getBrushConfig()}`:"",events:{dragstart(e){o={x:e.deltaX,y:e.deltaY};let t=-(n.isHorizontal?e.deltaY:e.deltaX)/n.handlers.scrollHandler.getItemSize();!n.isHorizontal&&i&&(t=-t),n.handlers.scrollHandler.getScrollApi().move(t)},dragmove(t){if(!e.dragging)return;let r=-(n.isHorizontal?t.deltaY-o.y:t.deltaX-o.x)/n.handlers.scrollHandler.getItemSize();!n.isHorizontal&&i&&(r=-r),n.handlers.scrollHandler.getScrollApi().move(r),o={x:t.deltaX,y:t.deltaY}},dragend(){e.dragging&&(e.dragging=!1)},dragcancel(){e.dragging=!1}}}}};var Ca={callNavBtnGesture:function(e,t){return{type:"Tap",options:{event:"navBtnTap",enable(n,r){return!(!r||!e())&&ya.isOnComponentForNavBtn(r,t,this)}},events:{navBtnTap(e){this.chart.componentsFromPoint(e.center).forEach(t=>{const n=e.target,r=n?n.getAttribute("data-action"):"";if(r)return t.emit(r)})}}}}};var Ma={create:function(e,t,n,r,i){const o={};t=t||"vertical";const a=r.lassoBrushKey||"select",s=r.dimRangeBrushKey||null,l=r.measureRangeBrushKey||null,u=r.areaBrushKey||null,c=r.legendBrushKey||null,p=!!e.selectionHandler&&e.selectionHandler.isOn(),d={dragging:!1,lassoing:!1,majoring:!1,minoring:!1,measureSelecting:!1},f={gesture:"",type:""},h="horizontal"===t,m=h?"y-axis":"x-axis",g=h?"x-axis":"y-axis";function y(e,t,n){if(f.gesture===e)return;let r=a;const i=t||f.chart;switch(f.gesture){case"majorrange":b(i,"rangeDim","rangeClear",n),r=s;break;case"measurerange":b(i,"rangeMeasure","rangeClear",n),r=l;break;case"arearange":b(i,"rangeMinor","areaClear",n),r=u}f.gesture=e;const o="range"===e?"range":"item";f.type&&f.type!==o&&i.brush(r).clear(),f.chart=t,f.type=o}function b(e,t,n,r){if(e){const i=e.component(t);i&&i.emit(n,r)}}let v=[];const q={isSelectionEnabled:()=>e.selectionHandler&&e.selectionHandler.isOn(),isNavigationEnabled:()=>e.scrollHandler&&e.scrollHandler.isOn(),doEmit:b,switchTo:y,getBrushConfig:function(){return s?l?"majorrange measurerange":"majorrange arearange":"measurerange arearange"}},x={handlers:e,keys:r,isHorizontal:h,active:f,rangeSelStatus:i};function D(){y("none"),d.majoring=!1,d.measureSelecting=!1,d.minoring=!1}return p&&(v=[{type:"Tap",options:{event:"rangeClearTap"},events:{rangeClearTap(e){y("none",this.chart,e),d.majoring=!1,d.measureSelecting=!1,d.minoring=!1}}}],v.unshift(Ca.callNavBtnGesture(q.isNavigationEnabled,c)),v.push(ba.callLassoGesture(d,q,x)),s?l?(v.push(Da.callDimensionRangeGesture(d,q,x,m)),e.selectionHandler.addComponent(s,{id:"rangeDim",clear:"rangeClear"}),v.push(va.callMeasureRangeGesture(d,q,x,g)),e.selectionHandler.addComponent(l,{id:"rangeMeasure",clear:"rangeClear"})):(v.push(Da.callDimensionRangeGesture(d,q,x,m)),e.selectionHandler.addComponent(s,{id:"rangeDim",clear:"rangeClear"}),v.push(xa.callAreaRangeGesture(d,q,x,g)),e.selectionHandler.addComponent(u,{id:"rangeMinor",clear:"areaClear"})):(v.push(va.callMeasureRangeGesture(d,q,x,g)),e.selectionHandler.addComponent(l,{id:"rangeMeasure",clear:"rangeClear"}),v.push(xa.callAreaRangeGesture(d,q,x,m)),e.selectionHandler.addComponent(u,{id:"rangeMinor",clear:"areaClear"}))),e.scrollHandler&&(v.push(Sa.callDragGesture(d,q,x,p,n)),e.scrollHandler.getScrollApi().on("update",D)),o.gestures=v,o.destroy=function(){e.scrollHandler&&e.scrollHandler.getScrollApi().removeListener("update",D)},o}};function Ea(e,t,n,r,i){let o=!1;r=r||"tooltip",n=n||["self"];const a=e.brush(r),s={};function l(){if(o){e.component(i).emit("hide")}o=!1}return s.isOpen=function(){return o},s.closeTooltip=l,s.update=function(){const s=a.brushes(),u=e.getAffectedShapes(r,"and",n,t);s.length>=1?(o=!0,function(t){o=!0;const n={nodes:t};e.component(i).emit("show",{},n)}(u)):l()},s.toggleInterceptor=function(e){if(n.length>1){const t={},n=[];return e.forEach(e=>{t[e.key]||(t[e.key]={}),t[e.key][e.value]||(t[e.key][e.value]=!0,n.push(e))}),n}return e},s}var Aa={create:(...e)=>Ea(...e)},Ia={formatMeasureValue:function(e,t){if(e.raw().isCustomFormatted)return e.formatter()(t.value.qText);const n=void 0!==t.value.qNum?t.value.qNum:t.value.qValue;return e.formatter()(n)}};const wa=e=>({h:t,data:n,style:r})=>{const i=function(e,t){const n=e.chartInstance.dataset(e.dataPath),r=[],i=t.length-5,o=Math.min(5,t.length);for(let i=0;i<o;i++){const o=t[i],a={rows:[]};if(e.labelData){const t=[],i=e.labelData;let s=!1;for(let e=0;e<i.length;e++){const n=o.data[i[e]].value;if(-2===n.qElemNo||-2===n.qElemNumber){s=!0;break}t.push(o.data[i[e]].value.qText)}if(s)return;a.header=e.headerResolver(t),a.rows=e.measureRows.map(t=>{const r=o.data;return e.rowResolver(n.field(r[t].source.field),r[t],r)}).filter(e=>!!e);const l=Oa(e,o);l&&a.rows.unshift(l),r.push(a)}}i>0&&(r.numberInExcess=i);return r.rowCount=r[0]?r.length*r[0].rows.length:0,r}(e,n),o={h:t,style:r,rtl:"rtl"===e.direction,translator:e.translator};return e.renderer(o,i)};function Oa(e,t){const n=t.data.color,r=e.colorService?.getSettings?.();if(!r||"color"===r.type||!n||!r.fieldType)return;const i=[];e.data.forEach(e=>{const n=t.data[e];n&&i.push(n.value)});const o=function(e){let t=-1;for(let n=0;n<e.length;n++)-3===e[n]&&(t=n);return t}(i),{translator:a}=e,s=r.label,l=t.attrs?.fill;return{color:l,label:s,value:-1!==o?a.get("properties.dimensionLimits.others"):n.label}}const Ta="dist-flow-tooltip",ka=`#${Ta}`;function Na(){if(!document.querySelector(ka)){const e=document.createElement("div");e.id=Ta,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 Pa({key:e="tooltip",rtl:t,fontFamily:n,filter:r,content:i}){return{show:!0,key:e,type:"tooltip",layout:{displayOrder:3},beforeMount(){Na()},beforeUpdate(){Na()},destroyed(){!function(){const e=document.querySelector(ka);e&&e.parentElement&&e.childElementCount<1&&e.parentElement.removeChild(e)}()},settings:{appendTo:()=>document.querySelector(ka),content:i,filter:r,extract:e=>e.node,direction:t?"rtl":"ltr",placement:"bounds"},style:{arrow:{color:"#404040"},content:{display:"table","border-spacing":"4px",background:"rgba(64, 64, 64, 0.9)",opacity:"1",fontSize:"13px",fontFamily:n,"empty-cells":"show"},cell:{"max-width":"180px","word-break":"break-word","word-wrap":"break-word","overflow-wrap":"break-word",hyphens:"auto"}}}}const{detectTextDirection:La}=bo;const _a={tooltipKey:"tooltip",data:[""],contexts:["tooltip"],headerResolver:e=>e.join(", "),rowResolver:(e,t)=>({value:Ia.formatMeasureValue(e,t),label:e.title()}),direction:"ltr",renderer:function(e,t){const{h:n,style:r,translator:i,rtl:o}=e,a=[],s=o?"right":"left";if(t.forEach(e=>{if(e.header){const t={...r.cell,textAlign:s,fontWeight:"bold",direction:La(e.header)};a.push(n("tr",null,n("td",{style:t,colSpan:2},e.header)))}e.rows.forEach(e=>{let t=e.value;if(e.color){const r={display:"inline-block",width:10,height:10,"background-color":e.color,margin:"0 8px"},i=n("div",{style:r});t=o?[e.value,i]:[i,e.value]}const i=o?[":",e.label]:[e.label,":"],l={...r.cell,textAlign:s,direction:La(e.label)},u={...r.cell,textAlign:o?"left":"right",direction:La(e.value)};a.push(n("tr",null,n("td",{style:l},i),n("td",{style:u},t)))})}),t.numberInExcess){const e=i.get("Object.ChartTooltip.NMore",t.numberInExcess),o={...r.cell,textAlign:s,direction:La(e)};a.push(n("tr",null,n("td",{style:o,colSpan:2},e)))}return a}};function Ra(e,t,n){if(!e)throw Error("Tooltips-handler: Missing input");let r={},i=!1;const o={};function a(e){e.listeners.update=function(t,n){e.action.update(t,n,e)},e.listeners.end=function(){e.action.closeTooltip()},e.brush.on(e.treatAsDesktop?"update":"set-values",e.listeners.update),e.brush.on("end",e.listeners.end),e.brush.intercept("set-values",e.action.toggleInterceptor)}function s(){Object.keys(r).forEach(e=>{l(r[e])})}function l(e){e.brush.removeListener(e.treatAsDesktop?"update":"set-values",e.listeners.update),e.brush.removeListener("end",e.listeners.end),e.brush.removeInterceptor("set-values",e.action.toggleInterceptor)}function u(){Object.keys(r).forEach(e=>{r[e].action.closeTooltip()})}function c(){u();for(const e in r)r[e].brush.clear()}return o.setUp=function(t){const o=E(!0,{},_a,t);if(!o.componentKey)throw Error("Tooltips-handler.setUp: Missing required input");r[o.contexts[0]]&&i&&l(r[o.contexts[0]]);const s=function(e,t){return{brush:t.brush(e.contexts[0]),action:Aa.create(t,e.componentKey,e.data,e.contexts[0],e.tooltipKey),listeners:{},chartInstance:t,dataPath:e.dataPath,renderer:e.renderer,data:e.data,headerResolver:e.headerResolver,rowResolver:e.rowResolver,colorService:e.colorService,attrDimPath:e.attrDimPath,measureRows:e.measureRows,labelData:e.labelData,filterShapes:e.filterShapes,direction:e.environment.options.direction,theme:e.environment.theme,translator:e.environment.translator,treatAsDesktop:"touch"!==e.environment.deviceType}}(o,e);r[o.contexts[0]]=s,i&&a(s);const u=Pa({key:o.tooltipKey,rtl:"rtl"===s.direction,fontFamily:s.theme.getStyle(n,"tooltip","fontFamily"),filter:(c=s.filterShapes,e=>c?c(e):function(e){const t=[];return e.forEach(e=>{-1===t.indexOf(e)&&"container"!==e.type&&t.push(e)}),t}(e)),content:wa(s,o.dataPath)});var c;return o.chartBuilder.getSettings().components.push(u),{trigger:{on:s.treatAsDesktop?"over":"tap",action:"set",contexts:o.contexts,data:o.data,globalPropagation:"stop"},consume:o.contexts.map(e=>({context:e})),component:u}},o.tearDown=function(){i&&s(),r=[]},o.closeTooltip=u,o.isOn=()=>i,o.on=function(){i||(i=!0,Object.keys(r).forEach(e=>{a(r[e])}),t&&t.on("mouseleave",c))},o.off=function(){i&&(i=!1,s(),t&&t.off("mouseleave",c),u())},o}var Ha={create:(e,t,n)=>Ra(e,t,n)};const Fa=".scrollHandler";function Ba(e,t,n,r,i){if(!e||!t||!n)throw Error("Scroll-handler: Missing input");this._chartInstance=e,this._$chartElement=t,this._getSlicedDataFn=n,this._on=!1,this._itemSize=30,this.options={direction:"vertical"},this._onScrollCallback=r,this._legendKey=i}function Va(){const e=("horizontal"===this.options.direction?this._$chartElement.width():this._$chartElement.height())||0,t=Math.floor(e/this.getItemSize());this._scrollViewSizeInItem=Math.max(t,1)}function za(e){const t=function(e){let t=0,n=0,r=0;return e.wheelDelta&&(t=e.wheelDelta/60),e.detail&&(t=-e.detail/3),r=t,void 0!==e.axis&&e.axis===e.HORIZONTAL_AXIS&&(r=0,n=-1*t),void 0!==e.wheelDeltaY&&(r=e.wheelDeltaY/60),void 0!==e.wheelDeltaX&&(n=-1*e.wheelDeltaX/60),{delta:t,deltaX:n,deltaY:r,x:e.pageX,y:e.pageY}}(e.originalEvent);if(function(e,t,n,r){if(r&&n.componentsFromPoint(t).some(e=>e.settings.key===r))return n.component(r).emit(t.delta>0?"prev":"next"),e.preventDefault(),!0;return!1}(e,t,this._chartInstance,this._legendKey)||this._disabled||!this.getScrollApi())return;if(e.preventDefault(),!t.delta)return;const n=t.delta<0?3:-3;this._scrollApi.move(n)}function ja(){if(this._disabled||this._sizeChanged)return void(this._sizeChanged=!1);const e=this;this.getViewData().then(t=>{e._on&&!e._disabled&&e._onScrollCallback&&e._onScrollCallback(t,void 0,!0)}).catch(e=>{})}Ba.prototype.getScrollApi=function(){this._scrollApi||(this._scrollApi=this._chartInstance.scroll("dimension"));return this._scrollApi},Ba.prototype.setDisabled=function(e){this._disabled=e},Ba.prototype.getDisabled=function(){return this._disabled},Ba.prototype.setItemSize=function(e){this._itemSize!==e&&(this._itemSize=e,Va.call(this))},Ba.prototype.getItemSize=function(){return this._itemSize},Ba.prototype.getScrollViewSizeInItem=function(){this._scrollViewSizeInItem||Va.call(this);return this._scrollViewSizeInItem},Ba.prototype.on=function(){if(this._on)return;this.getScrollApi()&&(this._scrollApi.removeAllListeners(),this._scrollApi.on("update",ja.bind(this)));this._$chartElement.on(`mousewheel${Fa} DOMMouseScroll${Fa}`,za.bind(this)),this._$chartElement.on(`touchstart${Fa}`,e=>{e.preventDefault()}),this._on=!0},Ba.prototype.isOn=function(){return this._on},Ba.prototype.off=function(){if(!this._on)return;this.getScrollApi()&&this._scrollApi.removeAllListeners();this._$chartElement.off(Fa),this._on=!1},Ba.prototype.updateViewState=function(e){Va.call(this),this.getScrollApi()&&this._scrollApi.update({viewSize:this._scrollViewSizeInItem,max:e})},Ba.prototype.onResize=function(){this._sizeChanged=!0,Va.call(this),this.getScrollApi()&&this._scrollApi.update({viewSize:this._scrollViewSizeInItem})},Ba.prototype.isDataSizeChanged=function(e,t){return Math.min(this.getScrollViewSizeInItem(),t)!==e},Ba.prototype.resetScroll=function(){this.getScrollApi()&&this._scrollApi.moveTo(0)},Ba.prototype.getViewData=function(){let e=0,t=0;if(this.getScrollApi()){const n=this._scrollApi.getState();e=Math.round(n.start),t=n.viewSize}return this._getSlicedDataFn(e,t)},Ba.prototype.setOptions=function(e){this.options.direction!==e.direction&&(this._scrollViewSizeInItem=void 0);this.options=e},Ba.prototype.getScrollState=function(){return this.getScrollApi().getState().start},Ba.prototype.setScrollState=function(e){this.getScrollApi().moveTo(e)};const $a=166/26,Ua=12/11;function Wa(e){return(12*Math.min(e,3)+Math.max(e-3,0)*$a)/11}function Ka(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}}function Ya(e,t){const n={latin:0,cjk:0};void 0===t?e.forEach(e=>{const t=Ka(e.qText);n.latin+=t.latin,n.cjk+=t.cjk}):e.forEach(e=>{const r=Ka(e[t].qText);n.latin+=r.latin,n.cjk+=r.cjk});const r=Math.max(1,n.latin+n.cjk);return n.latinRatio=n.latin/r,n.cjkRatio=n.cjk/r,n}function Ga(e,t,n){return e*(e<=24?t:n)}var Xa={endsWith:function(e,t){return-1!==e.indexOf(t,e.length-t.length)},startsWith:function(e,t){return 0===e.indexOf(t)},contains:function(e,t){if(!e)throw new Error("Haystack is undefined.");if(!t)throw new Error("Needle is undefined.");return-1!==e.indexOf(t)},stringWidthOverMWidth:Wa,getCharacterRatios:Ka,getTotalCharacterRatios:Ya,getAdjustedMaxGlyphCount:function(e,t,n){const r=Ya(t,n),i=r.latinRatio*e,o=r.cjkRatio*e;return Math.ceil(Wa(i)+o*Ua)},estimateLatinLabelWidth:Ga,estimateLabelWidth:function(e,t,n,r,i){return e*n+Ga(t,r,i)}};const Ja={aliceblue:{r:240,g:248,b:255},antiquewhite:{r:250,g:235,b:215},aqua:{r:0,g:255,b:255},aquamarine:{r:127,g:255,b:212},azure:{r:240,g:255,b:255},beige:{r:245,g:245,b:220},bisque:{r:255,g:228,b:196},black:{r:0,g:0,b:0},blanchedalmond:{r:255,g:235,b:205},blue:{r:0,g:0,b:255},blueviolet:{r:138,g:43,b:226},brown:{r:165,g:42,b:42},burlywood:{r:222,g:184,b:135},cadetblue:{r:95,g:158,b:160},chartreuse:{r:127,g:255,b:0},chocolate:{r:210,g:105,b:30},coral:{r:255,g:127,b:80},cornflowerblue:{r:100,g:149,b:237},cornsilk:{r:255,g:248,b:220},crimson:{r:220,g:20,b:60},cyan:{r:0,g:255,b:255},darkblue:{r:0,g:0,b:139},darkcyan:{r:0,g:139,b:139},darkgoldenrod:{r:184,g:134,b:11},darkgray:{r:169,g:169,b:169},darkgreen:{r:0,g:100,b:0},darkgrey:{r:169,g:169,b:169},darkkhaki:{r:189,g:183,b:107},darkmagenta:{r:139,g:0,b:139},darkolivegreen:{r:85,g:107,b:47},darkorange:{r:255,g:140,b:0},darkorchid:{r:153,g:50,b:204},darkred:{r:139,g:0,b:0},darksalmon:{r:233,g:150,b:122},darkseagreen:{r:143,g:188,b:143},darkslateblue:{r:72,g:61,b:139},darkslategray:{r:47,g:79,b:79},darkslategrey:{r:47,g:79,b:79},darkturquoise:{r:0,g:206,b:209},darkviolet:{r:148,g:0,b:211},deeppink:{r:255,g:20,b:147},deepskyblue:{r:0,g:191,b:255},dimgray:{r:105,g:105,b:105},dimgrey:{r:105,g:105,b:105},dodgerblue:{r:30,g:144,b:255},firebrick:{r:178,g:34,b:34},floralwhite:{r:255,g:250,b:240},forestgreen:{r:34,g:139,b:34},fuchsia:{r:255,g:0,b:255},gainsboro:{r:220,g:220,b:220},ghostwhite:{r:248,g:248,b:255},gold:{r:255,g:215,b:0},goldenrod:{r:218,g:165,b:32},gray:{r:128,g:128,b:128},green:{r:0,g:128,b:0},greenyellow:{r:173,g:255,b:47},grey:{r:128,g:128,b:128},honeydew:{r:240,g:255,b:240},hotpink:{r:255,g:105,b:180},indianred:{r:205,g:92,b:92},indigo:{r:75,g:0,b:130},ivory:{r:255,g:255,b:240},khaki:{r:240,g:230,b:140},lavender:{r:230,g:230,b:250},lavenderblush:{r:255,g:240,b:245},lawngreen:{r:124,g:252,b:0},lemonchiffon:{r:255,g:250,b:205},lightblue:{r:173,g:216,b:230},lightcoral:{r:240,g:128,b:128},lightcyan:{r:224,g:255,b:255},lightgoldenrodyellow:{r:250,g:250,b:210},lightgray:{r:211,g:211,b:211},lightgreen:{r:144,g:238,b:144},lightgrey:{r:211,g:211,b:211},lightpink:{r:255,g:182,b:193},lightsalmon:{r:255,g:160,b:122},lightseagreen:{r:32,g:178,b:170},lightskyblue:{r:135,g:206,b:250},lightslategray:{r:119,g:136,b:153},lightslategrey:{r:119,g:136,b:153},lightsteelblue:{r:176,g:196,b:222},lightyellow:{r:255,g:255,b:224},lime:{r:0,g:255,b:0},limegreen:{r:50,g:205,b:50},linen:{r:250,g:240,b:230},magenta:{r:255,g:0,b:255},maroon:{r:128,g:0,b:0},mediumaquamarine:{r:102,g:205,b:170},mediumblue:{r:0,g:0,b:205},mediumorchid:{r:186,g:85,b:211},mediumpurple:{r:147,g:112,b:219},mediumseagreen:{r:60,g:179,b:113},mediumslateblue:{r:123,g:104,b:238},mediumspringgreen:{r:0,g:250,b:154},mediumturquoise:{r:72,g:209,b:204},mediumvioletred:{r:199,g:21,b:133},midnightblue:{r:25,g:25,b:112},mintcream:{r:245,g:255,b:250},mistyrose:{r:255,g:228,b:225},moccasin:{r:255,g:228,b:181},navajowhite:{r:255,g:222,b:173},navy:{r:0,g:0,b:128},oldlace:{r:253,g:245,b:230},olive:{r:128,g:128,b:0},olivedrab:{r:107,g:142,b:35},orange:{r:255,g:165,b:0},orangered:{r:255,g:69,b:0},orchid:{r:218,g:112,b:214},palegoldenrod:{r:238,g:232,b:170},palegreen:{r:152,g:251,b:152},paleturquoise:{r:175,g:238,b:238},palevioletred:{r:219,g:112,b:147},papayawhip:{r:255,g:239,b:213},peachpuff:{r:255,g:218,b:185},peru:{r:205,g:133,b:63},pink:{r:255,g:192,b:203},plum:{r:221,g:160,b:221},powderblue:{r:176,g:224,b:230},purple:{r:128,g:0,b:128},red:{r:255,g:0,b:0},rosybrown:{r:188,g:143,b:143},royalblue:{r:65,g:105,b:225},saddlebrown:{r:139,g:69,b:19},salmon:{r:250,g:128,b:114},sandybrown:{r:244,g:164,b:96},seagreen:{r:46,g:139,b:87},seashell:{r:255,g:245,b:238},sienna:{r:160,g:82,b:45},silver:{r:192,g:192,b:192},skyblue:{r:135,g:206,b:235},slateblue:{r:106,g:90,b:205},slategray:{r:112,g:128,b:144},slategrey:{r:112,g:128,b:144},snow:{r:255,g:250,b:250},springgreen:{r:0,g:255,b:127},steelblue:{r:70,g:130,b:180},tan:{r:210,g:180,b:140},teal:{r:0,g:128,b:128},thistle:{r:216,g:191,b:216},tomato:{r:255,g:99,b:71},transparent:{r:255,g:255,b:255,a:0},turquoise:{r:64,g:224,b:208},violet:{r:238,g:130,b:238},wheat:{r:245,g:222,b:179},white:{r:255,g:255,b:255},whitesmoke:{r:245,g:245,b:245},yellow:{r:255,g:255,b:0},yellowgreen:{r:154,g:205,b:50}},Za=/^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)$/i,Qa=/^rgba\((\d{1,3}),(\d{1,3}),(\d{1,3}),(\d(\.\d+)?)\)$/i,es=/^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/i,ts=/^#([A-f0-9])([A-f0-9])([A-f0-9])$/i,ns=/^hsl\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i,rs=/^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,(\d(\.\d+)?)\)$/i,is=Math.floor,os=Math.round,as=Ze.extend({init(){let e,t,n,r,i,o,a,s,l,u,c,p,d=0,f=0,h=0,m=1;if(this._invalid=!1,arguments[0]instanceof as)d=arguments[0]._r,f=arguments[0]._g,h=arguments[0]._b,m=arguments[0]._a,this._invalid=arguments[0]._invalid;else if(arguments.length<3)if("string"==typeof arguments[0])if(p=arguments[0],c=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i.exec(p))d=parseInt(c[1],10),f=parseInt(c[2],10),h=parseInt(c[3],10);else if(c=/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d(\.\d+)?)\s*\)$/i.exec(p))d=parseInt(c[1],10),f=parseInt(c[2],10),h=parseInt(c[3],10),m=parseFloat(c[4]);else if(c=/^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/i.exec(p))d=parseInt(c[1],16),f=parseInt(c[2],16),h=parseInt(c[3],16),m=1;else if(c=/^#([A-f0-9])([A-f0-9])([A-f0-9])$/i.exec(p))d=parseInt(c[1]+c[1],16),f=parseInt(c[2]+c[2],16),h=parseInt(c[3]+c[3],16),m=1;else if(c=/^hsl\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i.exec(p)){switch(e=parseFloat(c[1]),t=parseFloat(c[3]),r=parseFloat(c[5]),e%=360,t/=100,r/=100,e=e<0?0:e>360?360:e,t=t<0?0:t>1?1:t,r=r<0?0:r>1?1:r,o=r<=.5?2*r*t:(2-2*r)*t,a=e/60,s=o*(1-Math.abs(a%2-1)),l=[],a=Math.floor(a),a){case 0:l=[o,s,0];break;case 1:l=[s,o,0];break;case 2:l=[0,o,s];break;case 3:l=[0,s,o];break;case 4:l=[s,0,o];break;case 5:l=[o,0,s];break;default:l=[0,0,0]}u=r-.5*o,d=l[0]+u,f=l[1]+u,h=l[2]+u,d=os(255*d),f=os(255*f),h=os(255*h),m=1}else if(c=/^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,(\d(\.\d+)?)\)$/i.exec(p)){switch(e=parseFloat(c[1]),t=parseFloat(c[3]),r=parseFloat(c[5]),m=parseFloat(c[7]),e%=360,t/=100,r/=100,e=e<0?0:e>360?360:e,t=t<0?0:t>1?1:t,r=r<0?0:r>1?1:r,o=r<=.5?2*r*t:(2-2*r)*t,a=e/60,s=o*(1-Math.abs(a%2-1)),l=[],a=Math.floor(a),a){case 0:l=[o,s,0];break;case 1:l=[s,o,0];break;case 2:l=[0,o,s];break;case 3:l=[0,s,o];break;case 4:l=[s,0,o];break;case 5:l=[o,0,s];break;default:l=[0,0,0]}u=r-.5*o,d=l[0]+u,f=l[1]+u,h=l[2]+u,d=os(255*d),f=os(255*f),h=os(255*h)}else if(c=/^hsv\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i.exec(p)){switch(e=parseFloat(c[1]),t=parseFloat(c[3]),i=parseFloat(c[5]),e%=360,t/=100,i/=100,e=e<0?0:e>360?360:e,t=t<0?0:t>1?1:t,i=i<0?0:i>1?1:i,o=i*t,a=e/60,s=o*(1-Math.abs(a%2-1)),l=[],a=Math.floor(a),a){case 0:l=[o,s,0];break;case 1:l=[s,o,0];break;case 2:l=[0,o,s];break;case 3:l=[0,s,o];break;case 4:l=[s,0,o];break;case 5:l=[o,0,s];break;default:l=[0,0,0]}u=i-o,d=l[0]+u,f=l[1]+u,h=l[2]+u,d=os(255*d),f=os(255*f),h=os(255*h),m=1}else Ja[p.toLowerCase()]?(n=p.toLowerCase(),d=Ja[n].r,f=Ja[n].g,h=Ja[n].b,m="number"==typeof Ja[n].a?Ja[n].a:1):this._invalid=!0;else"number"==typeof arguments[0]&&arguments[0]>=0&&"argb"===arguments[1]?(m=(4278190080&arguments[0])>>>24,m/=255,d=(16711680&arguments[0])>>16,f=(65280&arguments[0])>>8,h=255&arguments[0]):"number"==typeof arguments[0]&&arguments[0]>=0?(d=(16711680&arguments[0])>>16,f=(65280&arguments[0])>>8,h=255&arguments[0]):this._invalid=!0;else arguments.length>=3?(d=arguments[0],f=arguments[1],h=arguments[2],m=arguments.length>=4?arguments[3]:1):this._invalid=!0;Number.isNaN(+d+f+h+m)&&(this._invalid=!0),this._r=is(d),this._g=is(f),this._b=is(h),this._a=m,this._spaces={}},isInvalid(){return this._invalid},setAlpha(e){this._a=e,this._spaces={}},getAlpha(){return this._a},toRGB:function(){return this._spaces.rgb||(this._spaces.rgb=as.toRGB(this)),this._spaces.rgb},toRGBA:function(){return this._spaces.rgba||(this._spaces.rgba=as.toRGBA(this)),this._spaces.rgba},toString(){return this._spaces.rgb||(this._spaces.rgb=as.toRGB(this)),this._spaces.rgb},toHex:function(){return this._spaces.hex||(this._spaces.hex=as.toHex(this)),this._spaces.hex},toHSL:function(e){return this._spaces.hsl||(this._spaces.hsl=as.toHSL(this,e)),this._spaces.hsl},toHSLA:function(e){return this._spaces.hsla||(this._spaces.hsla=as.toHSLA(this,e)),this._spaces.hsla},toHSV(){const e=this.toHSVComponents();return`hsv(${e.h},${e.s},${e.v})`},toHSVComponents:function(){return this._spaces.hsvComp||(this._spaces.hsvComp=as.toHSVComponents(this)),this._spaces.hsvComp},toNumber:function(){return this._spaces.num||(this._spaces.num=as.toNumber(this)),this._spaces.num},isDark(){return this.isInvalid()||this.getLuminance()<125},getLuminance(){return void 0===this._lumi&&(this._lumi=.299*this._r+.587*this._g+.114*this._b),this._lumi},shiftLuminance(e){const t=this.toHSLA(),n=/^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,(\d(\.\d+)?)\)$/i.exec(t),r=parseFloat(n[1]),i=parseFloat(n[3]);let o=parseFloat(n[5]);const a=parseFloat(n[7]);return o+=e,o=Math.max(0,Math.min(o,100)),`hsla(${r},${i},${o},${a})`},isEqual(e){return e instanceof as||(e=new as(e)),this._r===e._r&&this._g===e._g&&this._b===e._b},blend(e,t){return`rgba(${[is(this._r+(e._r-this._r)*t),is(this._g+(e._g-this._g)*t),is(this._b+(e._b-this._b)*t),is(this._a+(e._a-this._a)*t)].join(",")})`},createShiftedColor(e){(void 0===e||Number.isNaN(+e))&&(e=1);const t=this.getLuminance(),n=this._g<126?1:1+this._g/512,r=this.shiftLuminance(20*(t*n<220?.8+1/(t+1)*4:-(.8+t/255*1))*e);return new as(r)}});as.toRGB=function(e){if(e instanceof as)return`rgb(${[e._r,e._g,e._b].join(",")})`;"string"==typeof e&&(e=as.toNumber(e));return`rgb(${(16711680&e)>>16},${(65280&e)>>8},${255&e})`},as.toRGBA=function(e,t){if(e instanceof as)return`rgba(${[e._r,e._g,e._b,void 0!==t?t:e._a].join(",")})`;"string"==typeof e&&(e=as.toNumber(e));return`rgba(${(16711680&e)>>16},${(65280&e)>>8},${255&e},${void 0!==t?t:e._a})`},as.toHex=function(e){let t,n,r;return e instanceof as?(t=e._r.toString(16),n=e._g.toString(16),r=e._b.toString(16),1===t.length&&(t=`0${t}`),1===n.length&&(n=`0${n}`),1===r.length&&(r=`0${r}`),`#${[t,n,r].join("")}`):("string"==typeof e&&(e=as.toNumber(e)),t=((16711680&e)>>16).toString(16),n=((65280&e)>>8).toString(16),r=(255&e).toString(16),1===t.length&&(t=`0${t}`),1===n.length&&(n=`0${n}`),1===r.length&&(r=`0${r}`),`#${t}${n}${r}`)},as.toHSL=function(e,t){let n,r,i,o=0;"string"==typeof e&&(e=new as(e));const a=e._r/255,s=e._g/255,l=e._b/255,u=Math.max(a,s,l),c=Math.min(a,s,l);if(r=t?.21*a+.72*s+.07*l:(u+c)/2,u===c)n=0,o=0;else{switch(i=u-c,n=r>.5?i/(2-u-c):i/(u+c),u){case a:o=(s-l)/i+(s<l?6:0);break;case s:o=(l-a)/i+2;break;case l:o=(a-s)/i+4}o/=6}return`hsl(${360*o},${100*n},${100*r})`},as.toHSLA=function(e,t){let n,r,i,o=0;"string"==typeof e&&(e=new as(e));const a=e._r/255,s=e._g/255,l=e._b/255,u=e._a,c=Math.max(a,s,l),p=Math.min(a,s,l);if(r=t?.21*a+.72*s+.07*l:(c+p)/2,c===p)n=0,o=0;else{switch(i=c-p,n=r>.5?i/(2-c-p):i/(c+p),c){case a:o=(s-l)/i+(s<l?6:0);break;case s:o=(l-a)/i+2;break;case l:o=(a-s)/i+4}o/=6}return`hsla(${360*o},${100*n},${100*r},${u})`},as.toHSVComponents=function(e){let t,n,r=0;"string"==typeof e&&(e=new as(e));const i=e._r/255,o=e._g/255,a=e._b/255,s=Math.max(i,o,a),l=Math.min(i,o,a),u=s;if(s===l)t=0,r=0;else{switch(n=s-l,t=0===n?0:n/u,s){case i:r=(o-a)/n+(o<a?6:0);break;case o:r=(a-i)/n+2;break;case a:r=(i-o)/n+4}r/=6}return{h:360*r%360,s:100*t,v:100*u}},as.toNumber=function(){if(1===arguments.length&&arguments[0]instanceof as)return(arguments[0]._r<<16)+(arguments[0]._g<<8)+arguments[0]._b;let e,t,n=0,r=0,i=0;return 1===arguments.length&&"string"==typeof arguments[0]&&(t=arguments[0],(e=/^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)$/i.exec(t))?(n=parseInt(e[1],10),r=parseInt(e[2],10),i=parseInt(e[3],10)):(e=/^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/i.exec(t))?(n=parseInt(e[1],16),r=parseInt(e[2],16),i=parseInt(e[3],16)):(e=/^#([A-f0-9])([A-f0-9])([A-f0-9])$/i.exec(t))&&(n=parseInt(e[1]+e[1],16),r=parseInt(e[2]+e[2],16),i=parseInt(e[3]+e[3],16))),(n<<16)+(r<<8)+i},as.blend=function(e,t,n){const r=(16711680&(e=as.toNumber(e)))>>16,i=(65280&e)>>8,o=255&e;return(r+(((16711680&(t=as.toNumber(t)))>>16)-r)*n<<16)+(i+(((65280&t)>>8)-i)*n<<8)+(o+((255&t)-o)*n)},as.getBlend=function(e,t,n){const r=e._r+(t._r-e._r)*n,i=e._g+(t._g-e._g)*n,o=e._b+(t._b-e._b)*n,a=e._a+(t._a-e._a)*n;return new as(r,i,o,a)},as.isCSSColor=function(e){return!(arguments.length>1||"string"!=typeof e)&&(Za.test(e)||Qa.test(e)||es.test(e)||ts.test(e)||ns.test(e)||rs.test(e)||Ja[e.toLowerCase()])},as.getBestContrast=function(e,t,n){const r=e.getLuminance();return Math.abs(r-t.getLuminance())>Math.abs(r-n.getLuminance())?t:n},as.getContrast=function(e,t){if(!e||!t)return;const n=e.getLuminance()/100,r=t.getLuminance()/100;return n>r?(n+.05)/(r+.05):(r+.05)/(n+.05)},as.isDark=function(){const e={getLuminance:as.prototype.getLuminance,isInvalid:as.prototype.isInvalid};return as.prototype.init.apply(e,[].slice.call(arguments)),as.prototype.isDark.call(e)},as.useDarkLabel=function(e,t){return e._a>.5?!e.isDark():!t};const ss={TRANSPARENT_BLACK:"rgba( 0,0,0,0.2 )",TRANSPARENT_WHITE:"rgba( 255,255,255,0.7 )",LIGHT_GREY:"#ccc",DARK_GREY:"#666",BLACK:"#000",WHITE:"#fff",getInverse(e){const t=new as(e);return 0===t.getAlpha()?this.BLACK:t.isDark()?this.WHITE:this.BLACK},getContrastingGrey(e){const t=new as(e);return 0===t.getAlpha()?this.DARK_GREY:as.getBestContrast(t,new as(ss.LIGHT_GREY),new as(ss.DARK_GREY))},getBestContrast:(e,t,n)=>as.getBestContrast(new as(e),new as(t),new as(n)),getContrastingTransparent(e){const t=new as(e);return 0===t.getAlpha()||"none"===e?this.TRANSPARENT_BLACK:t.isDark()?this.TRANSPARENT_WHITE:this.TRANSPARENT_BLACK}};function ls(e,t){return Ue(e,`${t=t?`${t}.`:""}qHyperCube.qDimensionInfo.length`)>1}function us(e,t){if(Ue(e,`${t=t?`${t}.`:""}qHyperCube.qStackedDataPages.0.qData.length`))return Ue(e,`${t}qHyperCube.qStackedDataPages.0.qData.0.qSubNodes.length`,0)+Ue(e,`${t}qHyperCube.qStackedDataPages.0.qData.0.qDown`,0)+Ue(e,`${t}qHyperCube.qStackedDataPages.0.qData.0.qUp`,0);const n=Ue(e,`${t}qHyperCube.qEffectiveInterColumnSortOrder.0`);return cs(Ue(e,`${t}qHyperCube.qDimensionInfo.${n}`))}function cs(e){return e.qCardinalities.qHypercubeCardinal}var ps={getHyperCube:function(e,t){return e&&(e=t?Ue(e,t):e)&&e.qHyperCube?e.qHyperCube:null},hasSecondDimension:ls,hasSecondMeasure:function(e,t){return Ue(e,`${t=t?`${t}.`:""}qHyperCube.qMeasureInfo.length`)>1},getStackedCubeSizeOf2Dims:us,getStackedCubeSizeOfMax2Dims:function(e,t){return ls(e,t)?us(e,t):function(e,t){return Ue(e,(t=t?`${t}.`:"")+"qHyperCube.qSize.qcy")}(e,t)},getOuterDimensionSizeOfMax2Dims:function(e,t){return ls(e,t)?us(e,t):1},getDimensionSize:cs};const ds=function(){this._maxJitter=1};ds.prototype.calcMaxJitter=function(e,t,n){this._maxJitter=Math.min(e*t,n-e)},ds.prototype.getJitterValue=function(e){const t=Math.abs(jo(`${e}`)%10)/9;return this._maxJitter/2-t*this._maxJitter};var fs={toBefore:function(e){const t=e.qUndoExclude.qHyperCube;2===t.qEffectiveInterColumnSortOrder.length&&0===t.qEffectiveInterColumnSortOrder[0]&&(t.qEffectiveInterColumnSortOrder=[1,0],t.qDimensionInfo.reverse())},toAfter:function(e){const t=e.qUndoExclude.qHyperCube;2===t.qEffectiveInterColumnSortOrder.length&&1===t.qEffectiveInterColumnSortOrder[0]&&(t.qEffectiveInterColumnSortOrder=[0,1],t.qDimensionInfo.reverse())}};var hs={generateHyperCube:function(e,t,n,r){t.qUndoExclude||(t.qUndoExclude={}),t.qUndoExclude.qHyperCubeDef=E(!0,{},t.qHyperCubeDef),t.qUndoExclude.qHyperCubeDef.qDimensions.reverse(),Di.updateHypercubeAttributes(t,"qUndoExclude.qHyperCubeDef.",t.color.point);let i=[];const o=t.qUndoExclude.qHyperCubeDef.qDimensions.length,a=t.color.point&&!t.color.point.auto&&"byExpression"===t.color.point.mode;if(o>0&&a){i=[yi.create(yi.IDMAP.COLOR_BY_EXPRESSION,{qExpression:wr(t,"color.point.expression.qValueExpression.qExpr")})]}return t.qUndoExclude.qHyperCubeDef.qMeasures[0].qAttributeExpressions=i,mi.hasMultipleDimensions(t)?Jr.getAllHyperCubeExpressions(t.qHyperCubeDef,e.qHyperCube,n).then(i=>{Yi.applySorting(t,e,n,i,r);const o=i.dimensions[0],a=i.dimensions[1],s=i.measures[0],l=Ui.getFractileExpression(1,o,a,s),u=Ui.getFractileExpression(0,o,a,s);t.qUndoExclude.qHyperCubeDef.qDimensions[0].qAttributeExpressions=[{qExpression:u,id:"minBoxValue"},{qExpression:l,id:"maxBoxValue"}]}):(t.qUndoExclude.qHyperCubeDef.qInterColumnSortOrder=[1,0],Promise.resolve())}};const ms=e=>e.baseColor||e.coloring&&e.coloring.baseColor;function gs(e){const{qDimensionInfo:t,qMeasureInfo:n}=e.qUndoExclude.qHyperCube,r=t.some(ms),i=n.some(ms),o=e.color.point.useBaseColors;return"measure"===o&&!i||"dimension"===o&&!r?"off":o}function ys({layout:e,localeInfo:t,model:n,picasso:r,environment:i}){const{app:o,theme:a,translator:s}=i,l=E(!0,{},e.color.point);var u;return 2===e.qHyperCube.qDimensionInfo.length&&(u=l.byDimDef,0===u?.activeDimensionIndex?u.activeDimensionIndex=1:1===u?.activeDimensionIndex&&(u.activeDimensionIndex=0)),function(e){return!!e.snapshotData&&!e.snapshotData.content?.chartData?.legendDataPage&&!!e.qUndoExclude?.legendData}(e)&&(e=function(e){return(e=E({},e)).snapshotData=E({},e.snapshotData),e.snapshotData.content=E({},e.snapshotData.content),e.snapshotData.content.chartData=E({},e.snapshotData.content.chartData),e.snapshotData.content.chartData.legendDataPage=e.qUndoExclude.legendData.qDataPages,e}(e)),l.mode||(l.mode="primary"),Er({app:o,model:n,picasso:r,translator:s,config:{localeInfo:t,theme:a,key:"color",definitionPath:"/qUndoExclude/qHyperCubeDef"},createConfig:()=>({layout:e,hc:e.qUndoExclude.qHyperCube,legendProps:e.legend,colorProps:{...l,useBaseColors:gs(e)}})})}const bs=fi.DATA_PATH,vs=fi.HYPERCUBE_PATH,qs=fi.HYPERCUBE_DEF_PATH;function xs(e){return Array.isArray(e)?e:e?[e]:[]}function Ds(e){return Math.min(ps.getOuterDimensionSizeOfMax2Dims(e,bs),fi.MAX_STACKED_VALUES)}function Ss(e,t){return{viewSize:t,max:Ds(e)}}function Cs(){const e=fi.MAX_STACKED_VALUES>=this.layout.qUndoExclude.qHyperCube.qSize.qcy?3:1;this.backendApi.setCacheOptions({height:e*this._scrollHandler.getScrollViewSizeInItem(),width:3})}function Ms(){if(this.layout&&ps.hasSecondDimension(this.layout,bs)){this._scrollHandler.onResize();!!this.layout.snapshotData||Cs.call(this)}}function Es(){const e=this.chartInstance.component("legend");e&&e.emit&&e.emit("resetindex")}function As(e,t){return wr(e,`qHyperCube.qDimensionInfo.${t}.qIsOneAndOnlyOne`)||!1}const Is=zo.extend("DistributionPlot",{namespace:".distributionPlot",init({lasso:e,environment:t,flags:n,picasso:r,$element:i,backendApi:o,selectionsApi:a}){this._super(r,i,t,o,a),this.flags=n,this.picasso=r,this.picassoElement.__do_not_use_findShapes=this.chartInstance.findShapes.bind(this.chartInstance),this._derivedProperties=new aa,this._selectionHandler=ga.create({model:o.model,chartInstance:this.chartInstance,selectionsApi:a,isLassoDisabled:this.isLassoDisabled.bind(this),selectPaths:["/qUndoExclude/qHyperCubeDef"],lasso:e}),this._tooltipHandler=Ha.create(this.chartInstance,i,fi.CHART_ID),this._scrollHandler=new Ba(this.chartInstance,i,this.getSlicedData.bind(this),this.onScrollCallback.bind(this),"colorLegend-cat"),this._maxBubbleScale=fi.BUBBLE_SCALES_MAX,this._jitterTool=new ds,this.setDataPaths([`${bs}/${vs}`])},onScrollCallback(e,t,n){const r=this;this._updateColorMapData(e).then(()=>{r.updateChart(e,t,n)})},getSlicedData(e,t){const n=this;return this.getData(this.backendApi,this.layout[bs][vs],{top:e,height:t}).then(()=>n.layout)},updateScrollHandlerState(e){void 0!==e&&(this._disableScrolling=!!e),this._scrollHandler.setDisabled(!ps.hasSecondDimension(this.layout,bs)||this._disableScrolling)},updateConstraints(e){const t=!e.active,n=!e.passive,r=!e.select&&!e.active;this._scrollHandler[t?"on":"off"](),this._tooltipHandler[n?"on":"off"](),this._selectionHandler[r?"on":"off"]()},off(){this._scrollHandler.off(),this._tooltipHandler.off(),this._selectionHandler.off()},_getPointScale(){return(e=this.layout).dataPoint&&e.dataPoint.bubbleScales?this.layout.dataPoint.bubbleScales/this._maxBubbleScale:1;var e},_calcBandwidth(e,t){const n=t.scales().dimension;this._bandwidthRatio=n?n.pxScale(e).bandwidth():1,this._bandwidthPx=e*this._bandwidthRatio},_calcPointMaxSize(e,t){const n=Math.min(fi.MAX_POINT_BASE_SIZE_PX,t*fi.POINT_BANDWIDTH_BASE_RATIO)*e;this._pointMaxSizePx=Math.max(fi.MIN_POINT_PIXELS,n)},_calcPointSize(e,t){this._pointSize=e/t},_getDimAxisSettings(e,t){const n=xs(t.trigger),r=xs(t.consume),i=this.picassoElement.getBoundingClientRect()["vertical"===e.orientation?"height":"width"],o=Xa.getAdjustedMaxGlyphCount(function(e){const t=e[bs][vs].qDimensionInfo,n=ps.hasSecondDimension(e,bs)?t[0].qApprMaxGlyphCount:0;return Math.min(fi.MAX_GLYPH_COUNT,n)}(this.layout||e),e[bs][vs].qStackedDataPages[0].qData[0].qSubNodes),a=i/4;return{brush:{trigger:n,consume:r},settings:{labels:{mode:"vertical"===e.orientation?e.dimensionAxis.label:"auto",maxGlyphCount:o,maxLengthPx:a},paddingEnd:4}}},_getBoxMarkerSettings(e,t){const{theme:n}=this.environment,r=e.color.point.auto?n.getStyle(fi.CHART_ID,"box","fill"):n.getColorPickerColor(e.color.box.paletteColor),i=xs(t.trigger),o=xs(t.consume),a=this;let s="qMeasureInfo/0",l="qMeasureInfo/0";ps.hasSecondDimension(e,bs)&&e.qUndoExclude.qHyperCube.qDimensionInfo[0].qAttrExprInfo.length&&(s="qDimensionInfo/0/qAttrExprInfo/0",l="qDimensionInfo/0/qAttrExprInfo/1");const u={require:["chart"],displayOrder:1e3,settings:{chart:this,box:{fill:r,stroke:n.getStyle(fi.CHART_ID,"box","stroke"),strokeWidth:0,width:fi.POINT_BANDWIDTH_BASE_RATIO,maxWidthPx:fi.MAX_POINT_BASE_SIZE_PX,minWidthPx:fi.MIN_POINT_PIXELS+2*fi.BOX_PADDING},minor:{scale:"measure"},orientation:e.orientation},beforeRender(){const e=a.layout.presentation&&a.layout.presentation.visibleComponents&&-1!==a.layout.presentation.visibleComponents.indexOf("point"),t="horizontal"===a.layout.orientation?this.rect.height:this.rect.width;a._calcBandwidth(t,this.chart),a._calcPointMaxSize(e?a._getPointScale():1,a._bandwidthPx);let n=0;a._jitter&&(a._calcPointSize(a._pointMaxSizePx,a._bandwidthPx),n=a._pointSize*a._bandwidthPx*fi.JITTER_PARAMETER);const r=a._pointMaxSizePx+n+2*fi.BOX_PADDING,i=r/a._bandwidthPx;this.settings.settings.box.maxWidthPx=Math.min(a._bandwidthPx-2,r),this.settings.settings.box.width=i},brush:{trigger:i,consume:o},data:{extract:{field:"qDimensionInfo/0",trackBy:()=>-1,props:{start:{field:s,reduce:"min"},end:{field:l,reduce:"max"},elemNo:{field:"qDimensionInfo/0"}}}}};return ps.hasSecondDimension(e,bs)&&(u.data.extract.field="qDimensionInfo/0",u.data.extract.trackBy=function(e){return e.qElemNo},u.settings.major={scale:"dimension"}),u},_getPointMarkerSettings(e,t,n){let r=1;e.dataPoint&&!1===e.dataPoint.border&&(r=0);const i=xs(t.trigger),o=xs(t.consume);this._tooltipHandler.isOn()&&(i.push(n.point.trigger),o.push.apply(o,n.point.consume));const a=this,s=this.colorService.getColor(),l={require:["chart"],displayOrder:1100,settings:{chart:this,fill:s,stroke:e=>{const t=s(e);return ss.getContrastingTransparent(t)},size:.3,strokeWidth:r,sizeLimits:{maxRelExtent:10,maxPx:fi.MAX_POINT_BASE_SIZE_PX,minPx:fi.MIN_POINT_PIXELS},orientation:e.orientation},beforeRender(){const e="horizontal"===a.layout.orientation?this.rect.height:this.rect.width;if(a._calcBandwidth(e,this.chart),a._calcPointMaxSize(a._getPointScale(),a._bandwidthPx),a._calcPointSize(a._pointMaxSizePx,a._bandwidthPx),a._jitter){const t=2*fi.BOX_PADDING/e;a._jitterTool.calcMaxJitter(a._pointSize*a._bandwidthRatio,fi.JITTER_PARAMETER,a._bandwidthRatio-t)}this.settings.settings.sizeLimits.maxPx=a._pointMaxSizePx,this.settings.settings.size=a._pointSize},brush:{trigger:i,consume:o},data:{extract:{field:"qDimensionInfo/0",props:{innerElemNo:{field:"qDimensionInfo/0"},elemNo:{field:"qDimensionInfo/0"},inner:{field:"qDimensionInfo/0",value:e=>e},row:{field:"qDimensionInfo/0",value:e=>e.qRow},measure:{field:"qMeasureInfo/0",reduce:"first",value:e=>e,reduceLabel:"none"},...this.colorService.getDatumProps()}}}};return ps.hasSecondDimension(e,bs)&&(l.data.extract.props.inner.field="qDimensionInfo/1",l.data.extract.props.innerElemNo.field="qDimensionInfo/1",l.data.extract.props.row.field="qDimensionInfo/1",l.data.extract.field="qDimensionInfo/1",l.data.extract.props.outer={field:"qDimensionInfo/0",value:e=>e}),this.setDataPaths([`${bs}/${vs}`]),l},_getPointSelectionLayerSettings(e){const t=E(!0,{},e,{key:"selection-point-marker",settings:{opacity:0}});return t.brush.consume.pop(),t.brush.consume.forEach(e=>{e.style.inactive=void 0,e.style.active.opacity=1}),t.brush.trigger=[],t},createChartSettings(e){const t=this.isRtl(),{theme:n}=this.environment,r=!!e.snapshotData,i=e.presentation&&e.presentation.visibleComponents,o=i&&-1!==e.presentation.visibleComponents.indexOf("point"),a=i&&-1!==e.presentation.visibleComponents.indexOf("box");this._jitter=o&&e.dataPoint&&"jitter"===e.dataPoint.displacement;const s=e[bs][vs],l=s.qDimensionInfo,u="horizontal"!==e.orientation?"y":"x",c="horizontal"!==e.orientation?"x":"y",p=Lo.create({chartID:fi.CHART_ID,theme:n,isRtl:t,flags:this.flags});if(0===s.qStackedDataPages[0].qData.length)return p.getSettings();let d={},f={},h={},m={};if(this._selectionHandler.isOn()){const t=!o&&ps.hasSecondDimension(e,bs);this._selectionHandler.setUpStart();const n=this._selectionHandler.setUpBrush({contexts:["select-inner"],data:["innerElemNo"],isSingleSelect:As(e,0)},!0),r=this._selectionHandler.setUpBrush({contexts:["select-outer"],data:["elemNo"],isSingleSelect:As(e,1)},!0),i=this._selectionHandler.setUpBrush({dataPath:bs,contexts:["select-color"],data:["color"],startOnEmptySelection:!1},!0),a=this._selectionHandler.setUpBrush({contexts:["select-measure"],data:[u]},!0);this._selectionHandler.setUpDone(),d={trigger:E(!0,{},r.trigger,{data:[""]}),consume:[E(!0,{},r.consume,{data:[""]})]},f={trigger:t?r.trigger:null,consume:[n.consume,r.consume,a.consume]},h={trigger:n.trigger,consume:[n.consume,r.consume,a.consume,i.consume]},m={trigger:[E(!0,{},i.trigger,{data:[""]})],consume:[E(!0,{},i.consume,{data:[""]}),n.consume,r.consume]}}const g={point:{},box:{}};this._tooltipHandler.isOn()&&(g.point=this._tooltipHandler.setUp({chartBuilder:p,colorService:this.colorService,data:ps.hasSecondDimension(e,bs)?["innerElemNo","elemNo"]:["innerElemNo"],contexts:["pointTip"],componentKey:"point-marker",environment:this.environment,attrDimPath:`/${vs}/qDimensionInfo/${ps.hasSecondDimension(e,bs)?1:0}/qAttrDimInfo/0`,measureRows:["measure"],labelData:ps.hasSecondDimension(e,bs)?["inner","outer"]:["inner"]}));const y=function(e){const t=[],n=e.qUndoExclude&&e.qUndoExclude.qHyperCube&&e.qUndoExclude.qHyperCube.qDimensionInfo?e.qUndoExclude.qHyperCube.qDimensionInfo:void 0;if(!n)return!1;for(let e=0;e<n.length;e++)n[e].qLocked?t.push(n[e].qLocked):t.push(!1);return t}(e),b=function(e,t,n){const r={};return 1===e.length?(r.isOpenDim=!1,e[0]?r.isOpenMea=!1:r.isOpenMea=!0):e[0]&&!e[1]?(r.isOpenDim=!1,r.isOpenMea=!0):!e[0]&&e[1]?(r.isOpenDim=!0,r.isOpenMea=!1):e[0]&&e[1]?(r.isOpenDim=!1,r.isOpenMea=!1):(r.isOpenDim=!0,r.isOpenMea=!0),t&&(r.isOpenMea=!1),n&&(r.isOpenDim=!1),r}(y,As(e,0),As(e,1)),v={scrollHandler:this._scrollHandler,selectionHandler:this._selectionHandler},q={componentKey:o?"point-marker":"box-marker",lassoBrushKey:"select-inner",dimRangeBrushKey:"select-outer",measureRangeBrushKey:"select-measure",areaBrushKey:null,legendBrushKey:"legend"};if(this._dependentActions&&this._dependentActions.destroy(),this._dependentActions=Ma.create(v,e.orientation,t,q,b),p.addPreset("dimension-measure-chart",{isRtl:t,includeDimensionAxis:ps.hasSecondDimension(e,bs),orientation:e.orientation,selectionsEnabled:this._selectionHandler.isOn(),theme:n,measureSource:["qMeasureInfo/0"],dimensionSource:"qDimensionInfo/0",measureAxisProperties:e.measureAxis,measureTitleText:s.qMeasureInfo[0].qFallbackTitle,dimensionAxisProperties:e.dimensionAxis,dimensionAxisSettings:this._getDimAxisSettings(e,d),dimensionTitleText:l&&l[0]&&l[0].qFallbackTitle||"",gridlines:e.gridlines,hasNavigation:!r,isNavigationEnabledFn:()=>this._scrollHandler.isOn(),scrollSettings:Ss(e,this._scrollHandler.getScrollViewSizeInItem()),enableLasso:!0,lasso:{brushKey:o?"select-inner":"select-outer",brushComponents:o?["point-marker"]:["box-marker"],brushData:o?["innerElemNo"]:["elemNo"]},enableDimRange:!0,dimRange:{brushKey:"select-outer",brushAxis:"horizontal"===e.orientation?"y-axis":"x-axis",brushArea:a?"box-marker":"point-marker",brushScale:"dimension"},enableMeasureRange:o,measureRange:{brushKey:"select-measure",brushAxis:"horizontal"===e.orientation?"x-axis":"y-axis",brushArea:o?"point-marker":"box-marker",brushScale:"measure",multiple:!0},brushActions:this._dependentActions.gestures,refLines:e.refLine&&e.refLine.refLines,axisTitleStyle:ui(fi.CHART_ID,n,e),axisLabelStyle:ci(fi.CHART_ID,n,e)}),a){const t=this._getBoxMarkerSettings(e,f);p.addComponent("box-marker",t)}if(o){const r=this._getPointMarkerSettings(e,h,g);if(r.data.extract.props[u]={field:"qMeasureInfo/0"},r.settings[u]={scale:"measure"},ps.hasSecondDimension(e,bs)&&(r.data.extract.props[c]={field:"qDimensionInfo/0",type:"qual"},r.settings[c]={scale:"dimension"}),this._jitter){r.settings[c]=r.settings[c]||{};const e=this._jitterTool;r.settings[c].fn=function(t){let n;return n="function"==typeof t.scale?t.scale(t.datum[c].value)+.5*t.scale.bandwidth():.5,n+e.getJitterValue(t.datum.value,fi.JITTER_PARAMETER)}}p.addComponent("point-marker",r),p.addComponent("point-marker",this._getPointSelectionLayerSettings(r));if(e.legend?!1!==e.legend.show:!e.color.point.auto&&"byDimension"===e.color.point.mode){const r={title:pi(fi.CHART_ID,n,e,this.flags),label:di(fi.CHART_ID,n,e,this.flags)};this.addLegend(p,t,m,r)}}const x=p.getSettings();return this.addSnapshotChartSettings(x,e),x.scales={...x.scales,...this.colorService.getScales()},x.palettes=this.colorService.getPalettes(),x},addLegend(e,t,n,r){const i={eventName:"legend-c",key:"colorLegend",styleReference:"object.comboChart",styleOverrides:r,rtl:t,settings:{item:{shape:{type:"circle",size:10}}}},o=this.colorService.getLegend(i,{actions:{interact:{enabled:()=>this._scrollHandler.isOn()}}});let{components:a}=o;a=a.filter(e=>!!e),a.length>0&&(this._selectionHandler.isOn()&&(a[0].brush={consume:n.consume.map(e=>E(!0,e,{style:{active:null}})),trigger:n.trigger}),a[0].layout.displayOrder=200,a[0].layout.prioOrder=50),e.settings.components.push(...a),e.settings.interactions[0].gestures.unshift(...o.interactions)},resize(){this.layout&&(Ms.call(this),this._super())},hasValidData(){const e=this.layout;return e[bs]&&e[bs][vs]&&e[bs][vs].qStackedDataPages.length&&e[bs][vs].qStackedDataPages[0].qData},paint(){const e=!!this.layout.snapshotData;e||this.environment.options.viewState||this.updateScrollHandlerState(!1),this._orientation||(this._orientation=this.layout.orientation),this._orientation!==this.layout.orientation&&(Ms.call(this),this._orientation=this.layout.orientation);const t=this.layout;if(!this.hasValidData())return Promise.resolve();const n=this,r=this._super;return!e&&ps.hasSecondDimension(t,bs)&&this._scrollHandler.isDataSizeChanged(wr(t,`${bs}.${vs}.qStackedDataPages.0.qData.0.qSubNodes.length`),ps.getOuterDimensionSizeOfMax2Dims(t,bs))?this._scrollHandler.getViewData().finally(()=>n._updateColorMapData(t).then(()=>r.call(n))):this._updateColorMapData(t).then(()=>r.call(n))},async setSnapshotData(e){this._super(e);const t=await this.colorService.getSnapshotData();return e.snapshotData.content.chartData={...e.snapshotData.content.chartData,...t},e[bs][vs].qStackedDataPages=this.layout[bs][vs].qStackedDataPages,fs.toBefore(e),e},getViewState(){return{scroll:Math.round(this._scrollHandler.getScrollState())}},getDisclaimerAttributes(e){const t=!this.flags.isEnabled("SHOW_DISCLAIMER")||!(!1===e.showDisclaimer),n=!ps.hasSecondDimension(e,bs)&&e.qHyperCube.qSize.qcy>1e4||ps.hasSecondDimension(e,bs)&&e.qHyperCube.qSize.qcy>=fi.MAX_STACKED_VALUES,r=t&&n,i=Ss(e,this._scrollHandler.getScrollViewSizeInItem());return{data:e&&e.qUndoExclude,supportedDisclaimers:{LimitedData:t&&r},options:{paddingBottom:r&&i&&i.viewSize<i.max,supportNegative:!0,explicitLimitedData:r}}},async _updateColorMapData(e){this.colorService=ys({layout:e,localeInfo:this.localeInfo,model:this.backendApi.model,picasso:this.picasso,environment:this.environment}),await this.colorService.initialize();const t=this.colorService.getSettings().field,n=this.chartInstance.brush("select-color");/qAttrDimInfo/.test(t)&&n.addKeyAlias("attrDim/qDimensionInfo/0",`${bs}/${vs}/${t}`)},_createColorLegendCube(e){const t=ps.hasSecondDimension(this.layout,bs)?1:0;return{qDimensionInfo:[this.layout[bs][vs].qDimensionInfo[t].qAttrDimInfo[0]],qMeasureInfo:[],qDataPages:e,qMode:"S",qSize:{qcx:1,qcy:e[0].qMatrix.length}}},_updateColorData(){return this._updateColorMapData(this.layout)},updateDerivedProperties(e,t){const{app:n,translator:r}=this.environment,i=this,o=i.backendApi.model;return i._derivedProperties.addDefaultHyperCubeHash(e.qHyperCubeDef,t.qHyperCube,n,function(e){return{cube:e[qs],sorting:e.sorting,color:{point:e.color.point}}}(e)).then(a=>{const s={layout:t,properties:e,model:o,hashData:a,generateDerivedProperties:(e,t)=>hs.generateHyperCube(e,t,n,r)};return i._derivedProperties.updateDerivedProperties(s)})},updateData(e){const t=this,n=!!e.snapshotData;return t._super(e).then(()=>{if(t._destroyed)return Promise.reject();if(e=t.layout,t._scrollHandler.setOptions({direction:"horizontal"===e.orientation?"vertical":"horizontal"}),n)return fs.toAfter(e),t._updateColorMapData(e);t.updateScrollHandlerState(!0);const{viewState:r}=t.environment.options;let i;return r?(t._scrollHandler.updateViewState(Ds(e)),t._scrollHandler.setScrollState(r.scroll)):(t._scrollHandler.resetScroll(),Es.call(t)),t._scrollHandler.getScrollViewSizeInItem()&&!t._cacheSizeInitialized&&(Cs.call(t),t._cacheSizeInitialized=!0),i=ps.hasSecondDimension(e,bs)?t.getSlicedData(t._scrollHandler.getScrollState(),t._scrollHandler.getScrollViewSizeInItem()):t.getData(t.backendApi,e[bs][vs],{height:e[bs][vs].qSize.qcy||1}),i.then(()=>t._destroyed?Promise.reject():t._updateColorData())})},isLassoDisabled(){const e=this.layout;return!!(e.qHyperCube.qDimensionInfo&&e.qHyperCube.qDimensionInfo.length>1&&As(e,0))}}),ws={enabled:!0,delay:50};function Os(){const e={};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e}class Ts{constructor({onSend:e}){this.options={},this.ongoingRequests=[],this.queuedRequests=[],this.recentRequests=[],this.resolvedRequests=[],this._debounceTimer=null,this._latestResolvedRequestedAt=-1,this.onSend=e,this.setOptions({})}destroy(){this.clear(),this.recentRequests=[],this.resolvedRequests=[],this.onSend=null,this.onCancel=null}setOptions(e){this.options=E(!0,{},ws,this.options,e),this.enabled=this.options.enabled||!1,this.delay=this.options.delay||-1}clear(){let e;for(clearTimeout(this._debounceTimer);this.queuedRequests.length;)e=this.queuedRequests.pop(),e.dfd.reject();for(;this.ongoingRequests.length;)e=this.ongoingRequests.pop(),e.dfd.reject()}queue(e){const t=this.enabled?this.delay:-1,n=Date.now(),r={data:e,dfd:Os(),wrapper:Os(),requestedAt:n},i=Math.max(this._getAvgResolutionTime(),t),o=t<1,a=this.recentRequests.length<1,s=a||n-this.recentRequests.slice(-1)[0].requestedAt>i,l=n>this._latestResolvedRequestedAt+t;return o||a||s||l?ks.apply(this,[r,0]):ks.apply(this,[r,Math.min(t,1e3)]),this.recentRequests.push(r),this.recentRequests.length>10&&(this.recentRequests=this.recentRequests.slice(-10)),r.dfd.promise}updateResolutionTime(){this._latestResolvedRequestedAt=Date.now()}_getAvgResolutionTime(){let e;return this.resolvedRequests.length&&(e=0,this.resolvedRequests.forEach(t=>{e+=t.respondedAt-t.sentAt}),e/=this.resolvedRequests.length),e}}function ks(e,t){const n=this;this.queuedRequests.push(e),clearTimeout(this._debounceTimer),t>=10?this._debounceTimer=setTimeout(()=>{Ns.call(n)},t):Ns.call(n)}function Ns(){if(this.ongoingRequests.length)return void(this.waitingForResponse=!0);let e=this.queuedRequests.pop();for(e&&Ps.call(this,e);this.queuedRequests.length;)e=this.queuedRequests.shift(),e.dfd.reject()}function Ps(e){this.waitingForResponse=!1,this.ongoingRequests.push(e);const t=this,n=e.wrapper;e.sentAt=Date.now(),n.promise.then(function(...n){t.ongoingRequests.splice(t.ongoingRequests.indexOf(e),1),e.respondedAt=Date.now(),t.resolvedRequests.push({sentAt:e.sentAt,respondedAt:e.respondedAt,requestedAt:e.requestedAt}),t.resolvedRequests.length>10&&(t.resolvedRequests=t.resolvedRequests.slice(-10)),e.requestedAt>t._latestResolvedRequestedAt?e.dfd.resolve(...n):e.dfd.reject(),t._latestResolvedRequestedAt=e.requestedAt},function(...n){t.ongoingRequests.splice(t.ongoingRequests.indexOf(e),1),e.respondedAt=Date.now(),e.dfd.reject(...n)}).finally(()=>{t.waitingForResponse&&Ns.call(t)}),this.onSend(e.data,n)}const Ls=new Qe(0,0,0,0),_s=new Qe(0,0,0,0);class Rs{constructor(){this.pages=[]}get(e){return e.map(e=>this.getPage(e))}getPage(e){const t=[];for(let n=0;n<this.pages.length;n++){const r=this.pages[n].qArea;Ls.set(e.qLeft,e.qTop,e.qWidth,e.qHeight),_s.set(r.qLeft,r.qTop,r.qWidth,r.qHeight);const i=_s.intersection(Ls,!0);if(t.push({coverage:i?i.clone():new Qe(0,0,0,0),idx:n}),r.qLeft<=e.qLeft&&r.qLeft+r.qWidth>=e.qLeft+e.qWidth&&r.qTop<=e.qTop&&r.qTop+r.qHeight>=e.qTop+e.qHeight)return this._extract(e,this.pages[n])}return t.sort((e,t)=>t.coverage.width*t.coverage.height-e.coverage.width*e.coverage.height),t[0].coverage.height>0&&t[0].coverage.width>0?this._extract(e,this.pages[t[0].idx]):{qArea:{qTop:e.qTop,qLeft:e.qLeft,qWidth:0,qHeight:0},qData:[]}}destroy(){this.clear()}isEmpty(){return!(this.pages&&this.pages[0]&&this.pages[0].qArea.qHeight&&this.pages[0].qArea.qWidth)}clear(){this.pages=[]}store(e){this.pages=e}containsArea(e){for(let t=0;t<this.pages.length;t++){const n=this.pages[t].qArea;if(n.qLeft<=e.qLeft&&n.qLeft+n.qWidth>=e.qLeft+e.qWidth&&n.qTop<=e.qTop&&n.qTop+n.qHeight>=e.qTop+e.qHeight)return!0}return!1}contains(e){return!(!this.pages||!this.pages.length)&&0===e.filter(e=>!this.containsArea(e)).length}_extract(e,t){Ls.set(e.qLeft,e.qTop,e.qWidth,e.qHeight),_s.set(t.qArea.qLeft,t.qArea.qTop,t.qArea.qWidth,t.qArea.qHeight);const n=Ls.intersection(_s,!0);if(!n)return{qArea:{qTop:e.qTop,qLeft:e.qLeft,qWidth:0,qHeight:0},qData:[]};const r=Math.max(0,e.qTop-t.qArea.qTop),i=t.qData[0],o=i.qSubNodes,a={};for(const e in i)i.hasOwnProperty(e)&&(a[e]="qSubNodes"===e?o.slice(r,r+n.height):i[e]);return a.qUp+=r,a.qDown+=t.qArea.qHeight-n.height-r,{qArea:{qTop:n.y,qLeft:n.x,qWidth:n.width,qHeight:n.height},qData:[a]}}}const Hs={mode:"S",enabled:!0,debouncing:{enabled:!0,delay:50},height:250,width:250,maxTotalArea:1e4},Fs=Ze.extend("CacheCube",{init(e,t,n,r){this.model=e,this.responseProperty=t,this.options={},this.cubeHeight=0,this.cubeWidth=0,this.setOptions(r||{}),this.setPath(n),"K"===this.options.mode?this.cube=new Rs:"P"===this.options.mode?this.cube=new ut:this.cube=new nt,this.throttle=new Ts({onSend:(e,t)=>{const n=this._getDirections(this.throttle.recentRequests.map(e=>({top:e.data[0].qTop,left:e.data[0].qLeft}))),r=this._getAreasToCache(e,n.vertical,n.horizontal);this.cacheData(r,e).then(e=>{this.cube?t.resolve(e):t.reject()},()=>{t.reject()})}}),this._modelBinding=()=>{this.clear()},this.model.on("changed",this._modelBinding)},destroy(){this.cube.destroy(),this.throttle.destroy(),this.model&&this.model.removeListener&&this.model.removeListener("changed",this._modelBinding),this._modelBinding=null,delete this.model,delete this.throttle,delete this.cube},setMethodName(e){this.method=e},setPath(e){this.path=e},setCubeSize(e){this.cubeHeight=e.qcy,this.cubeWidth=e.qcx},setOptions(e){e&&(this.options=E(!0,{},Hs,this.options,e),this.cacheHeight=this.options.height,this.cacheWidth=this.options.width,this.enabled=this.options.enabled||!1,this.debouncing={enabled:this.options.debouncing.enabled||!1,delay:this.options.debouncing.delay||-1})},clear(){this.cube&&this.cube.clear(),this.throttle&&this.throttle.clear()},set(e){this.clear(),e&&e.length&&this.cube.store(e)},cacheData(e,t){const n=function(e){return this.cube?(this.cube.store(e),this.cube.get(t)):e};return"getHyperCubeStackData"===this.method&&this.options.maxStackedValues?this.model[this.method](this.path,e,this.options.maxStackedValues).then(n.bind(this)):this.model[this.method](this.path,e).then(n.bind(this))},getData(e){if(!this.model)return Promise.reject();if(!this.enabled||!this.cubeHeight||!this.cubeWidth)return"getHyperCubeStackData"===this.method&&this.options.maxStackedValues?this.model[this.method](this.path,e,this.options.maxStackedValues):this.model[this.method](this.path,e);let t,n;const r=[];for(t=0;t<e.length;++t)n=e[t],r.push({qTop:Math.max(Math.floor(n.qTop),0),qLeft:Math.max(n.qLeft,0),qHeight:Math.min(n.qHeight,this.cubeHeight-Math.floor(n.qTop)),qWidth:Math.min(n.qWidth,this.cubeWidth-n.qLeft)});return this.cube.contains(r)?(this.throttle.updateResolutionTime(),Promise.resolve(this.cube.get(r))):0===r[0].qTop&&this.cube.isEmpty()&&this.throttle.ongoingRequests.length+this.throttle.queuedRequests.length===0?(this.throttle.updateResolutionTime(),this.cacheData(r,r)):this.throttle.queue(r)},_getDirections(e){if(!e||e.length<2)return{vertical:0,horizontal:0};const t=e.slice(-2),n=t[1].top-t[0].top,r=t[1].left-t[0].left;return{vertical:n<0?-1:n>0?1:0,horizontal:r<0?-1:r>0?1:0}},_getAreasToCache(e,t,n){let r,i,o,a,s,l,u,c,p;const d=[];let f=this.cacheHeight;for(void 0===t&&(t=0),void 0===n&&(n=0),this.cacheHeight*this.cacheWidth*e.length>this.options.maxTotalArea&&(f=Math.floor(this.options.maxTotalArea/(e.length*this.cacheWidth))),r=0;r<e.length;++r)i=0!==t?Math.floor(.5*Math.max(0,f-e[r].qHeight)):0,o=0!==n?Math.floor(.5*Math.max(0,this.cacheWidth-e[r].qWidth)):0,a=i*t-i,s=o*n-o,l=0!==t?Math.max(0,Math.min(Math.max(e[r].qHeight,f),this.cubeHeight)):e[r].qHeight,u=0!==n?Math.max(0,Math.min(Math.max(e[r].qWidth,this.cacheWidth),this.cubeWidth)):e[r].qWidth,c=Math.max(0,Math.min(e[r].qTop+a,this.cubeHeight-l)),p=Math.max(0,Math.min(e[r].qLeft+s,this.cubeWidth-u)),d.push({qTop:c,qHeight:l,qLeft:p,qWidth:u});return d}}),Bs=fi.DATA_PATH,Vs=fi.HYPERCUBE_DEF_PATH;class zs{constructor(e){this.model=e,this.path=`/${Bs}/${Vs}`,this.cacheCube=new Fs(e,"qDataPages",this.path,{mode:"K"}),this.cacheCube.setMethodName("getHyperCubeStackData"),this.cacheCube.setOptions({maxStackedValues:fi.MAX_STACKED_VALUES})}setPath(e){this.path=e}setCacheOptions(e){this.cacheCube.setOptions(e)}updateCache(e){let t,n;"qHyperCube"===this.dataPath?t=e&&e.qHyperCube:(n=this.dataPath.slice(0,this.dataPath.indexOf("qHyperCube")-1),t=e&&e[n]&&e[n].qHyperCube),e.qSelectionInfo.qInSelections||this.cacheCube.setCubeSize({qcx:t.qSize.qcx,qcy:ps.getStackedCubeSizeOfMax2Dims(e,n)}),this.backendStackThrottle.clear()}getData(e,t){const n=this.cacheCube;return t?this.model.getHyperCubeData(t,e):this.cacheCube.getData(e).then(e=>(e[0]&&e[0].qData[0]&&e[0].qData[0].qSubNodes.some(e=>e.qDown>0)&&n.clear(),e))}}function js(E){return function(e){if(e&&e.get&&e.add){const t="Object.Disclaimer.LimitedData";if(e.get(t)!==t)return;Object.keys(A).forEach(t=>{e.add(A[t])})}}(E.translator),{qae:Ur(E),ext:oo(E),component(){const A=g(),T=function(){const e=l(),t=u(),n=c(),r=a(),i=p(),o=d();return f(()=>({app:e,appLayout:t,deviceType:n,options:r,theme:i,translator:o}),[e,t,r.direction,r.freeResize,o.language(),i.name(),n])}(),k=T.options.renderer,N=f(()=>function(e){const t=D();return t.renderer.prio([e||"canvas"]),t.use(S),t.use(C(M)),t.use(I),t.component("disclaimer",w),t}(k),[k]),P=y(),L=b(),_=v(),R=e(),H=function(){const o=e(),[a,s]=t(!1),[l,u]=t(!1),c=!!n().qSelectionInfo.qInSelections,[p]=t(()=>({toggle(){u(e=>!e)}}));return r(()=>{o&&s(!o.select&&!o.active)},[o]),i(()=>({key:"lasso",label:"Lasso",icon:O,hidden:!a||!c,active:l,action(){u(e=>!e)}}),[c,l,a]),p.enabled=()=>a,p.active=()=>l,p}(),F=q(),[B,V]=t();r(()=>{const e=x(A),t=function(e,t){return t.snapshotData?new pt(t,"qUndoExclude.qHyperCube","qStackedDataPages"):new zs(e)}(_,L),n=P,r=new Is({environment:T,lasso:H,flags:E.flags,picasso:N,$element:e,backendApi:t,selectionsApi:n});return V(r),()=>{r.destroy()}},[]);const[,z]=s(async()=>{if(!B)return;B.updateEnvironment(T),B.updateConstraints(R);if(!!!L.snapshotData){const e=await _.getEffectiveProperties();if(await B.updateDerivedProperties(e,L))return void F.pending();F.restore()}await B.updateData(L),await B.paint()},[L,B,T]);if(z)throw z;var j;!function(t){const n=o(),r=a(),i=e(),[,l]=s(async()=>{t&&(t.updateConstraints(i),t.options=r,await t.resize())},[n.width,n.height]);if(l)throw l}(B),j=B,h(e=>{if(j)return j.setSnapshotData(e)}),m(()=>({getViewState(){if(j)return j.getViewState()}}),[j])}}}export{js as default};
10
10
  //# sourceMappingURL=index.js.map