@arcgis/charts-components 5.2.0-next.136 → 5.2.0-next.137

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import D from"./IP75JGZY.js";import{a as se}from"./L7CMLBHB.js";import{a as oe}from"./PABVNO3N.js";import{a as k}from"./YNHYJOH7.js";import{a as re}from"./RP6LD7CU.js";import y from"./IXW7366K.js";import{a as b,b as te,e as ae}from"./OBPAQN4H.js";import{a as f}from"./Q45WYAOY.js";import u from"./IA5OR4WK.js";import{d as n}from"./POA2XTTK.js";import{a as P}from"./LVFZRGTZ.js";import t from"./2HRUBGST.js";import s from"./EP5MHPGF.js";import q from"./4ZLCIBER.js";import{a as ee}from"./QKGSVBTA.js";import"./SO5USEBM.js";import p from"./RKCOLO2T.js";import o from"./HHXJ7N5R.js";import m from"./E3FKZBYQ.js";import l from"./3GKRNMRV.js";import{b as Q,c as B,i as Y,l as L,p as w,r as J}from"./TOL6YNER.js";import j from"./EIA2JM3O.js";import i from"./KYLV3VYF.js";import g from"./XVOJWRDP.js";import e from"./RFSLZQXB.js";import d from"./IFGLNWRZ.js";import a from"./DKIBLRSR.js";import{d as T,e as v}from"./WOGALV3T.js";import{C as x,c as O,q as M}from"./PNFPQKYB.js";import"./5L7BAEX5.js";import"./KX7KGXKQ.js";import{b as S,d as H}from"./NGXRBJKL.js";import"./WULMITJI.js";import{A as V,B as _,C as h,D as z,F as $,H as U,g as N,i as c,n as C,z as A}from"./UE4KTI5X.js";import"./64L7VJJK.js";import"./QP5UAIC6.js";import"./Z5QPCSUQ.js";import{a as r,k as R}from"./QVG3TOL4.js";import"./BYSUABOV.js";export default $arcgis.t(([{substitute:ce},{Ja:G,Lb:j,Pb:q,ba:X,tb:Z},,,,,,{d:I},,{a:W},,,,,{r:ie},{e:y,f:K},{b:D}])=>{var d={chartUIComponent:"chart-ui-component",tabBar:"tab-bar",tab:"tab"};function le(m,e){let t=new Set,a=e;return m?.forEach((i,s)=>{let o=i.chartId;(t.has(o)||o===void 0||o==="")&&(i.chartId=`Chart_${Date.now()}_${s}`,e===o&&(a=i.chartId)),t.add(o)}),a}function he(m,e,t){return m?.filter(a=>M(t,a.config)&&a.layer?.id===e)??[]}function de(m){let{modelList:e,layerList:t,activeLayerId:a,disableEditing:i}=m,s=new Map;return e?.forEach(o=>{let l=o.layer;l&&s.set(l.id,l)}),i||t.forEach(o=>s.set(o.id,o)),Array.from(s.values()).filter(o=>!a||o.id===a)}function me(m,e){m.forEach(t=>{e.forEach(a=>{t?.id===a.layer?.id&&ne(t,a)})})}function ne(m,e){let t=m;if(t){let a=[...t?.charts??[]],i=a?.findIndex(o=>o.id===e.chartId),s=!1;i!==void 0&&i>-1?(s=!S(a[i],e.config),a[i]=e.config):t&&!I(e.config)&&(s=!0,a.push(e.config)),s&&(t.charts=a)}}function pe(m,e){let t=m;if(t){let a=[...t.charts??[]],i=a.findIndex(s=>s.id===e);i>-1&&(a.splice(i,1),t.charts=a)}}function ue(m,e){let t=m;if(t){let a=[...t.charts??[]];a=x({arrayA:a,arrayB:e.map(i=>i.config),getKey:i=>i.id??i.title?.content.text??""}),t.charts=a}}var ge=N`.hide{visibility:hidden}.am5-html-container{z-index:101!important}.am5-layer-1000{z-index:1000!important}.am5-layer-30{z-index:100!important}.show{display:block}.notifyPanel{flex:0 1 auto}.disable-interactions{pointer-events:none}.dim-text{color:var(--arcgis-charts-dim-text)}:host{display:flex;flex-direction:column;flex:1 1 auto;overflow:hidden;height:inherit;max-height:100%}.chart-ui-component{overflow-y:auto;overflow-x:hidden}.label{display:flex;margin-left:1rem;margin-bottom:.5rem;justify-content:space-between}.text{display:flex;margin-left:1rem;width:calc(100% - 1.5rem);height:2rem;margin-bottom:.5rem;justify-content:space-between}.field-list{max-height:50vh;overflow-y:scroll}.row{padding:.5rem}.bin-count-container{display:flex;width:calc(100% - 1rem);padding:.5rem}.bin-count-slider{margin-left:1rem;width:calc(90% - 1rem)}.bin-count-input{margin-left:1rem;height:2rem;width:2rem}.bin-row{padding:.5rem 0 .5rem .5rem}.tab-bar{display:flex}.tab{flex:1;height:2.5rem}`,E=class extends _{constructor(){super(),this.selectChartTypePopover=null,this.chartsListFlowItem=A(),this.supportedChartTypes=[r.BarSeries,r.BoxPlotSeries,r.LineSeries,r.PieSeries,r.HistogramSeries,r.ScatterSeries,r.HeatSeries],this._messages=P(),this.commonStrings=P({name:"common",blocking:!0}),this.chartDataProcessComplete=async e=>{let t=e,{chartData:a,model:i}=t.detail,s=this.getModel(this.selectedChartId);if(i?.isSameChartAs(s))switch(s?.chartType){case r.HistogramSeries:if(this.chartData=a,i&&(i.dataStore.chartData=a,v(i.layer))){let o=i,l=a?.bins?.length;l!==void 0&&o.binCount!==l&&(o.binCount=l)}break;case r.PieSeries:{this.chartData=a,i&&(i.dataStore.chartData=a);break}case r.ScatterSeries:{let o=a,{dataItems:l,r2:g,aggregated:u}=o,p=g;Number.isFinite(g)||(p=void 0),this.r2=p,Y(i)&&(i.dataStore.r2=p,i.dataStore.aggregated=u,u&&(i.additionalTooltipField=void 0)),this.calculatedDataMinMaxBounds=this.getDataExtent(l),i&&(i.dataStore.calculatedDataMinMaxBounds=this.calculatedDataMinMaxBounds);break}case r.LineSeries:case r.BarSeries:{let{dataItems:o,timeIntervalInfo:l}=a;(B(s)||Q(s)&&s.binTemporalData)&&(l?.size!==void 0&&s.temporalBinningSize!==l?.size&&(s.temporalBinningSize=l?.size),l?.unit!==void 0&&s.temporalBinningUnit!==l?.unit&&l?.unit!==R.Quarter&&(s.temporalBinningUnit=l?.unit),l?.size!==void 0&&l?.unit!==void 0&&ae(b,{size:l.size,unit:l.unit})),this.calculatedDataMinMaxBounds=this.getDataExtent(o),i&&(i.dataStore.calculatedDataMinMaxBounds=this.calculatedDataMinMaxBounds);break}}},this.chartAxesMinMaxChange=e=>{let t=e,{bounds:a,model:i}=t.detail,s=this.getModel(this.selectedChartId),o=i?.isSameChartAs(s),l=s?.chartType;if(o)switch(l){case r.BarSeries:case r.BoxPlotSeries:case r.LineSeries:case r.HistogramSeries:case r.ScatterSeries:this.calculatedMinMaxBounds=a,i&&(i.dataStore.calculatedMinMaxBounds=a),this.updateAxesBoundsInAppState(a);break}},this.chartSeriesColorChange=e=>{let t=e,{colorMatchApplied:a,data:i,model:s}=t.detail,o=this.getModel(this.selectedChartId);if(s?.isSameChartAs(o))switch(o?.chartType){case r.BarSeries:case r.BoxPlotSeries:case r.LineSeries:case r.HistogramSeries:this.seriesColor=i,s&&(s.dataStore.seriesColor=i),this.applyNullCategorySeriesColor({colorMatchApplied:a,data:i,model:o});break;case r.PieSeries:{let l=new Map([[0,i]]);this.seriesColor=l,s&&(s.dataStore.seriesColor=l);break}case r.ScatterSeries:}},this.chartNoRenderPropChange=e=>{let t=e,{propName:a,value:i,model:s}=t.detail,o=this.modelList.find(l=>s?.isSameChartAs(l));if(o)switch(a){case"rotation":typeof i=="boolean"&&W(o)&&(o.rotated=i);break;case"legendPosition":typeof i=="string"&&w(o)&&(o.legendPosition=i);break;case"legendVisibility":typeof i=="boolean"&&w(o)&&(o.legendVisibility=i);break}},this.chartLegendItemVisibilityChange=e=>{let t=e,{legendItemVisibility:a,model:i}=t.detail,s=this.modelList.find(o=>i?.isSameChartAs(o));s?.setSeriesVisibility(a),L(s)&&((s.getMinBound(1)===null||Number.isNaN(s.getMinBound(1)))&&s.setMinBound(null,1),(s.getMaxBound(1)===null||Number.isNaN(s.getMaxBound(1)))&&s.setMaxBound(null,1),B(s)&&((s.getMinBound(0)===null||Number.isNaN(s.getMinBound(0)))&&s.setMinBound(null,0),(s.getMaxBound(0)===null||Number.isNaN(s.getMaxBound(0)))&&s.setMaxBound(null,0)))},this.onSelectChartTypeChange=e=>{this.currentChartTypeText="",this.calculatedDataMinMaxBounds=void 0,this.calculatedMinMaxBounds=void 0,this.removeSelectChartTypePopover();let{selectedModelType:t,layerId:a}=e.target;t!==void 0&&(this.allowChartSyncing=!0,this.arcgisChartsConfigNewChart.emit({key:"key",chartType:t,layerId:a}))},this.onAddChartClose=()=>{this.removeSelectChartTypePopover()},this.onModelConfigChange=e=>{if(this.syncChartsToLayers&&this.allowChartSyncing){let t=e.target;ne(t?.layer,t)}this.requestUpdate()},this.allowChartSyncing=!1,this.currentChartTypeText="",this.modelList=[],this.layerList=[],this.disableEditing=!1,this.syncChartsToLayers=!1,this.close=!1,this.usePopupTemplateFieldsInfo=!1,this.panelNumber=0,this.filterBySelection=!1,this.arcgisChartsConfigChartViewChartClose=C(),this.arcgisChartsConfigModelListChange=C(),this.arcgisChartsConfigNewChart=C(),this.arcgisChartsConfigPanelNumberChange=C(),this.arcgisChartsConfigSelectedChartChange=C(),this.addChartEventListeners(),this.listen("arcgisChartsConfigModelListReorder",this.modelListReorderChangeListener)}static{this.properties={selectedPanel:16,currentChartTypeText:16,messageOverrides:0,modelList:[0,{hasChanged:y}],layerList:[0,{hasChanged:y}],selectedChartId:1,activeLayerId:1,disableEditing:5,syncChartsToLayers:5,timeZone:1,headerTitle:1,close:5,chartData:[0,{hasChanged:y}],view:0,r2:9,calculatedDataMinMaxBounds:[0,{hasChanged:y}],calculatedMinMaxBounds:[0,{hasChanged:y}],seriesColor:[0,{hasChanged:K}],popoverPlacement:1,usePopupTemplateFieldsInfo:5,popupTemplateFieldInfosEnabled:5,panelNumber:9,filterBySelection:5}}static{this.styles=ge}async setFocus(){await this.chartsListFlowItem.value?.setFocus()}async load(){await this.layerListChange();let e=this.getModel(this.selectedChartId);this.setEventBasedPropsFromModelData(e)}willUpdate(e){e.has("layerList")&&this.layerListChange(),e.has("panelNumber")&&this.panelNumberChange(this.panelNumber),e.has("modelList")&&this.modelListChange(this.modelList,e.get("modelList")),e.has("selectedChartId")&&this.selectedChartIdChange(this.selectedChartId)}disconnectedCallback(){super.disconnectedCallback(),this.clearPartialModels(),this.removeSelectChartTypePopover()}applyNullCategorySeriesColor(e){let{colorMatchApplied:t,data:a,model:i}=e;J(i)&&i.nullCategory===void 0&&(i.nullCategory=this.getDefaultNullCategory(t?this.getSeriesColor(a):void 0))}getSeriesColor(e){let t=e.get(0),a;return t&&"color"in t?a=t.color:t&&"lineSymbol"in t&&(a=t.markerSymbol?.color??t.lineSymbol.color),a}getDefaultNullCategory(e){let t=H(O.nullCategory);return e!==void 0&&(t.fillSymbol&&(t.fillSymbol.color=e,t.fillSymbol.outline&&(t.fillSymbol.outline.color=e)),t.markerSymbol&&(t.markerSymbol.color=e,t.markerSymbol.outline&&(t.markerSymbol.outline.color=e))),t}modelListReorderChangeListener(e){let{modelList:t}=e.detail;if(this.modelList=x({arrayA:this.modelList,arrayB:t,getKey:a=>a.chartId??a.titleText??""}),this.syncChartsToLayers){let a=t.find(i=>i.layer?.id!==void 0)?.layer?.id;if(a){let i=this.layerList.find(s=>s.id.toString()===a);i&&ue(i,t)}}}async layerListChange(){let e=[],t=this.layerList.map(i=>i.id.toString()),a=[...this.modelList.filter(i=>t.includes(i.layer?.id??""))];for(let i of this.layerList??[]){if(i.type==="sublayer"){let o=await i.createFeatureLayer();if(!o)continue;i=o}let s=i.charts;for(let o of s??[]){let l=await ee({layer:i,config:o,commonStrings:this.commonStrings});l!==void 0&&e.push(l)}}le(e),e.forEach(i=>{a.find(s=>s.isSameChartAs(i))===void 0&&a.push(i)}),a=a.filter(i=>!G(i.config)),this.modelList=a}modelListChange(e,t){this.selectedChartId=le(e,this.selectedChartId),t?.forEach(i=>{i.removeEventListener("arcgisChartsModelConfigChange",this.onModelConfigChange)}),e.forEach(i=>{i.addEventListener("arcgisChartsModelConfigChange",this.onModelConfigChange)});let a=this.getModel(this.selectedChartId);this.currentChartTypeText=a?.chartType!==void 0?D({chartType:a.chartType,commonStrings:this.commonStrings,config:a.config}):"",this.syncChartsToLayers&&this.allowChartSyncing&&me(this.layerList,e),this.arcgisChartsConfigModelListChange.emit({modelList:e})}selectedChartIdChange(e){this.selectedChartId===void 0&&(this.panelNumber=0),this.selectedPanel=n.Data;let t=this.getModel(e);this.setEventBasedPropsFromModelData(t),this.currentChartTypeText=t?.chartType!==void 0?D({chartType:t.chartType,commonStrings:this.commonStrings,config:t.config}):"",e!==void 0&&e!==b.selectedChartId&&(b.selectedChartId=e),this.allowChartSyncing=!0,this.arcgisChartsConfigSelectedChartChange.emit({key:"key",model:t})}panelNumberChange(e){e===0?this.clearPartialModels():e===1&&this.removeSelectChartTypePopover(),this.arcgisChartsConfigPanelNumberChange.emit({panelNumber:e,modelList:this.modelList})}addChartEventListeners(){this.listenOn(document,f.DataProcessComplete,this.chartDataProcessComplete),this.listenOn(document,f.AxesMinMaxChange,this.chartAxesMinMaxChange),this.listenOn(document,f.SeriesColorChange,this.chartSeriesColorChange),this.listenOn(document,f.NoRenderPropChange,this.chartNoRenderPropChange),this.listenOn(document,f.LegendItemVisibilityChange,this.chartLegendItemVisibilityChange)}getDataExtent(e){let t=this.getModel(this.selectedChartId)?.config,a=[];if(t!==void 0&&e!==void 0){let i=Z({chartConfig:t,chartData:e}),{minY:s,maxY:o,minX:l,maxX:g}=i;a=[{isXAxis:!0,minimum:l,maximum:g},{isXAxis:!1,minimum:s,maximum:o}]}return a}updateAxesBoundsInAppState(e){e?.forEach(t=>{let{isXAxis:a,maximum:i,minimum:s}=t,o=this.getModel(this.selectedChartId);if(o!==void 0&&L(o)&&this.selectedChartId!==void 0){let l=new se(o,a),g=te({chartId:this.selectedChartId,isXAxis:a,isLogarithmic:l.getLogarithmic()}),u=b.chartAxesBoundDataMap;u[this.selectedChartId]===void 0&&(u[this.selectedChartId]={});let p=u[this.selectedChartId]?.[g],F={defaultMinBound:p?.defaultMinBound===p?.currMinBound?s:p?.defaultMinBound,currMinBound:s,defaultMaxBound:p?.defaultMaxBound===p?.currMaxBound?i:p?.defaultMaxBound,currMaxBound:i};!S(p,F)&&this.selectedChartId!==void 0&&u?.[this.selectedChartId]!==void 0&&(u[this.selectedChartId][g]=F)}})}getPlacement(){let e;return this.popoverPlacement!==void 0?e=this.popoverPlacement:e=this.modelList?.filter(t=>M(X,t.config)).length<=2?"bottom":"top",e}onBackFlow(){this.panelNumber-=1}async onAddChartClick(e){let{referenceElement:t,layerId:a,layerType:i}=e.detail,s=!0;if(T(i)&&a){let o=this.layerList.find(l=>l.id===a);v(o)&&(s=!!(await q(o))?.attributeTable)}this.setupSelectChartTypePopover(t,a,i,s)}setupSelectChartTypePopover(e,t,a,i=!0){let s=this.getPlacement();this.removeSelectChartTypePopover(),this.selectChartTypePopover=$(c`<arcgis-charts-config-select-chart-type-popover .referenceElement=${e} open .layerId=${t} .layerType=${a} .isRasterBarChartSupported=${i} .popoverPlacement=${s} @arcgisChartsConfigPopoverClose=${this.onAddChartClose} @arcgisChartsConfigSelectChartTypeChange=${this.onSelectChartTypeChange}></arcgis-charts-config-select-chart-type-popover>`),!document.body.contains(this.selectChartTypePopover)&&this.selectChartTypePopover!==null&&document.body.appendChild(this.selectChartTypePopover)}getModel(e){return this.modelList?.find(t=>t.chartId===e)}removeSelectChartTypePopover(){this.selectChartTypePopover!==void 0&&(this.selectChartTypePopover?.remove(),this.selectChartTypePopover=re(this.selectChartTypePopover))}clearPartialModels(){this.modelList=this.modelList.filter(e=>!I(e.config))}onViewChartDelete(e){let{chartId:t}=e.detail;if(t!==void 0){let a=this.modelList.find(s=>s.chartId===t),i=this.layerList.find(s=>s.id===a?.layer?.id);this.modelList=[...this.modelList.filter(s=>s.chartId!==t)],i&&this.syncChartsToLayers&&this.allowChartSyncing&&pe(i,t)}}onViewChartsSelect(e){this.selectedChartId===e.detail.chartId&&(this.allowChartSyncing=!0,this.arcgisChartsConfigSelectedChartChange.emit({key:"key",model:this.getModel(this.selectedChartId)})),this.selectedChartId=e.detail.chartId}onViewChartsEdit(e){this.onViewChartsSelect(e),this.panelNumber=1}onViewChartClose(){this.close=!0,this.removeSelectChartTypePopover(),this.arcgisChartsConfigChartViewChartClose.emit()}setEventBasedPropsFromModelData(e){this.chartData=e?.dataStore.chartData,this.r2=e?.dataStore.r2,this.seriesColor=e?.dataStore.seriesColor,this.calculatedMinMaxBounds=e?.dataStore.calculatedMinMaxBounds,this.calculatedDataMinMaxBounds=e?.dataStore.calculatedDataMinMaxBounds}createTooltip(e){let t=e.target,a="";switch(t.icon){case"configure":a=this._messages.data??"";break;case"graph-bar-stacked":case"graph-line-series":case"box-chart-series":a=this._messages.series??"";break;case"graph-pie-slice":a=this._messages.slices??"";break;case"graph-axis":a=this._messages.axes??"";break;case"graph-guides":a=this._messages.guides??"";break;case"palette":a=this._messages.format??"";break;case"text":a=this._messages.general??"";break;default:a="";break}this.tooltip=$(c`<calcite-tooltip style=${z({opacity:1,zIndex:"var(--calcite-floating-ui-z-index)"})} .referenceElement=${t} open placement=top>${a}</calcite-tooltip>`),document.body.appendChild(this.tooltip)}destroyTooltip(){ie(this.tooltip)}renderViewCharts(){let e=de({modelList:this.modelList,layerList:this.layerList,activeLayerId:this.activeLayerId,disableEditing:this.disableEditing});return oe(e,t=>t.id,t=>c`<arcgis-charts-config-view-charts .noGroup=${this.activeLayerId!==void 0} .modelList=${he(this.modelList,t.id.toString(),T(t.type)?j:this.supportedChartTypes)} .selectedChartId=${this.selectedChartId??""} .layer=${t} .disableEditing=${this.disableEditing} @arcgisChartsConfigViewChartSelect=${this.onViewChartsSelect} @arcgisChartsConfigViewChartEdit=${this.onViewChartsEdit} @arcgisChartsConfigViewChartDelete=${this.onViewChartDelete} @arcgisChartsConfigViewChartAddChart=${this.onAddChartClick}></arcgis-charts-config-view-charts>`)}render(){return this.close?null:c`<calcite-flow>${k("charts-list",c`<calcite-flow-item .selected=${this.panelNumber===0||this.disableEditing} .heading=${this.headerTitle??this._messages.defaultHeaderTitle} closable @calciteFlowItemClose=${this.onViewChartClose} ${V(this.chartsListFlowItem)}>${this.renderViewCharts()}</calcite-flow-item>`)}${this.panelNumber>=1&&!this.disableEditing?this.renderTabs():null}</calcite-flow>`}renderTabs(){let e=this.getModel(this.selectedChartId);return k("chart-edit",c`<calcite-flow-item .selected=${this.panelNumber>=1&&!this.disableEditing} @calciteFlowItemBack=${this.onBackFlow} .heading=${this._messages[this.selectedPanel??n.Data]} .description=${this.currentChartTypeText!==""&&this._messages.pageFlowTitle!==void 0?ce(this._messages.pageFlowTitle,{chartName:e?.titleText??this.currentChartTypeText,layerName:e?.layer?.title??""}):""}>${e?.chartType!==void 0?c`<calcite-action-bar class=${h(d.tabBar)} layout=horizontal expand-disabled><calcite-action class=${h(d.tab)} icon=configure scale=s alignment=center .active=${this.selectedPanel===n.Data||this.selectedPanel===void 0} @click=${()=>{this.selectedPanel=n.Data}} @mouseover=${this.createTooltip} @mouseout=${this.destroyTooltip} text></calcite-action>${e?.chartType===r.BarSeries?c`<calcite-action class=${h(d.tab)} icon=graph-bar-stacked scale=s alignment=center .active=${this.selectedPanel===n.Series} @click=${()=>{this.selectedPanel=n.Series}} @mouseover=${this.createTooltip} @mouseout=${this.destroyTooltip} .text=${this._messages.series??""}></calcite-action>`:null}${e?.chartType===r.LineSeries?c`<calcite-action class=${h(d.tab)} icon=graph-line-series scale=s alignment=center .active=${this.selectedPanel===n.Series} @click=${()=>{this.selectedPanel=n.Series}} @mouseover=${this.createTooltip} @mouseout=${this.destroyTooltip} .text=${this._messages.series??""}></calcite-action>`:null}${e?.chartType===r.BoxPlotSeries?c`<calcite-action class=${h(d.tab)} icon=box-chart-series scale=s alignment=center .active=${this.selectedPanel===n.Series} @click=${()=>{this.selectedPanel=n.Series}} @mouseover=${this.createTooltip} @mouseout=${this.destroyTooltip} .text=${this._messages.series??""}></calcite-action>`:null}${e?.chartType===r.PieSeries?c`<calcite-action class=${h(d.tab)} icon=graph-pie-slice scale=s alignment=center .active=${this.selectedPanel===n.Slices} @click=${()=>{this.selectedPanel=n.Slices}} @mouseover=${this.createTooltip} @mouseout=${this.destroyTooltip} .text=${this._messages.slices??""}></calcite-action>`:null}${e?.chartType!==r.PieSeries&&e?.chartType!==r.HeatSeries?c`<calcite-action class=${h(d.tab)} icon=graph-axis scale=s alignment=center .active=${this.selectedPanel===n.Axes} @click=${()=>{this.selectedPanel=n.Axes}} @mouseover=${this.createTooltip} @mouseout=${this.destroyTooltip} .text=${this._messages.axes??""}></calcite-action>`:null}${e?.chartType!==r.PieSeries&&e?.chartType!==r.HeatSeries?c`<calcite-action class=${h(d.tab)} icon=graph-guides scale=s alignment=center .active=${this.selectedPanel===n.Guides} @click=${()=>{this.selectedPanel=n.Guides}} @mouseover=${this.createTooltip} @mouseout=${this.destroyTooltip} .text=${this._messages.guides??""}></calcite-action>`:null}<calcite-action class=${h(d.tab)} icon=palette scale=s alignment=center .active=${this.selectedPanel===n.Format} @click=${()=>{this.selectedPanel=n.Format}} @mouseover=${this.createTooltip} @mouseout=${this.destroyTooltip} .text=${this._messages.format??""}></calcite-action><calcite-action class=${h(d.tab)} icon=text scale=s alignment=center .active=${this.selectedPanel===n.General} @click=${()=>{this.selectedPanel=n.General}} @mouseover=${this.createTooltip} @mouseout=${this.destroyTooltip} .text=${this._messages.general??""}></calcite-action></calcite-action-bar>`:null}${this.renderChartUIComponent()}</calcite-flow-item>`)}renderChartUIComponent(){let e=this.getModel(this.selectedChartId),t=e?.layer,a=null;if(e!==void 0&&!this.disableEditing)switch(e?.chartType){case r.BarSeries:a=c`<arcgis-charts-config-bar-chart class=${h(d.chartUIComponent)} .model=${e} .timeZone=${this.timeZone} .usePopupTemplateFieldsInfo=${this.usePopupTemplateFieldsInfo||this.popupTemplateFieldInfosEnabled} .layer=${t} .page=${this.selectedPanel??n.Data} .calculatedMinMaxBounds=${this.calculatedMinMaxBounds} .seriesColor=${this.seriesColor}></arcgis-charts-config-bar-chart>`;break;case r.LineSeries:a=c`<arcgis-charts-config-line-chart class=${h(d.chartUIComponent)} .model=${e} .timeZone=${this.timeZone} .usePopupTemplateFieldsInfo=${this.usePopupTemplateFieldsInfo||this.popupTemplateFieldInfosEnabled} .layer=${t} .page=${this.selectedPanel??n.Data} .calculatedDataMinMaxBounds=${this.calculatedDataMinMaxBounds} .calculatedMinMaxBounds=${this.calculatedMinMaxBounds} .seriesColor=${this.seriesColor}></arcgis-charts-config-line-chart>`;break;case r.PieSeries:a=c`<arcgis-charts-config-pie-chart class=${h(d.chartUIComponent)} .model=${e} .usePopupTemplateFieldsInfo=${this.usePopupTemplateFieldsInfo||this.popupTemplateFieldInfosEnabled} .layer=${t} .chartData=${this.chartData} .page=${this.selectedPanel??n.Data} .calculatedMinMaxBounds=${this.calculatedMinMaxBounds} .seriesColor=${this.seriesColor} .filterBySelection=${this.filterBySelection}></arcgis-charts-config-pie-chart>`;break;case r.HistogramSeries:a=c`<arcgis-charts-config-histogram class=${h(d.chartUIComponent)} .model=${e} .usePopupTemplateFieldsInfo=${this.usePopupTemplateFieldsInfo||this.popupTemplateFieldInfosEnabled} .layer=${t} .page=${this.selectedPanel??n.Data} .chartData=${this.chartData} .calculatedMinMaxBounds=${this.calculatedMinMaxBounds} .seriesColor=${this.seriesColor}></arcgis-charts-config-histogram>`;break;case r.ScatterSeries:a=c`<arcgis-charts-config-scatter-plot class=${h(d.chartUIComponent)} .model=${e} .usePopupTemplateFieldsInfo=${this.usePopupTemplateFieldsInfo||this.popupTemplateFieldInfosEnabled} .layer=${t} .view=${this.view} .page=${this.selectedPanel??n.Data} .r2=${this.r2} .calculatedDataMinMaxBounds=${this.calculatedDataMinMaxBounds} .calculatedMinMaxBounds=${this.calculatedMinMaxBounds}></arcgis-charts-config-scatter-plot>`;break;case r.BoxPlotSeries:a=c`<arcgis-charts-config-box-plot class=${h(d.chartUIComponent)} .model=${e} .usePopupTemplateFieldsInfo=${this.usePopupTemplateFieldsInfo||this.popupTemplateFieldInfosEnabled} .layer=${t} .page=${this.selectedPanel??n.Data} .calculatedMinMaxBounds=${this.calculatedMinMaxBounds} .seriesColor=${this.seriesColor}></arcgis-charts-config-box-plot>`;break;case r.HeatSeries:a=c`<arcgis-charts-config-heat-chart class=${h(d.chartUIComponent)} .model=${e} .usePopupTemplateFieldsInfo=${this.usePopupTemplateFieldsInfo||this.popupTemplateFieldInfosEnabled} .layer=${t} .page=${this.selectedPanel??n.Data}></arcgis-charts-config-heat-chart>`;break}return a}};U("arcgis-charts-config-create-flow",E);return E},"intl",a,d,e,g,i,j,l,m,o,p,q,s,t,u,y,D)
2
+ import D from"./IP75JGZY.js";import{a as se}from"./L7CMLBHB.js";import{a as oe}from"./PABVNO3N.js";import{a as k}from"./YNHYJOH7.js";import{a as re}from"./RP6LD7CU.js";import y from"./IXW7366K.js";import{a as b,b as te,e as ae}from"./OBPAQN4H.js";import{a as f}from"./Q45WYAOY.js";import u from"./IA5OR4WK.js";import{d as n}from"./POA2XTTK.js";import{a as P}from"./LVFZRGTZ.js";import t from"./2HRUBGST.js";import s from"./EP5MHPGF.js";import q from"./4ZLCIBER.js";import{a as ee}from"./R5TBH7BZ.js";import"./SO5USEBM.js";import p from"./RKCOLO2T.js";import o from"./HHXJ7N5R.js";import m from"./E3FKZBYQ.js";import l from"./3GKRNMRV.js";import{b as Q,c as B,i as Y,l as L,p as w,r as J}from"./TOL6YNER.js";import j from"./EIA2JM3O.js";import i from"./KYLV3VYF.js";import g from"./XVOJWRDP.js";import e from"./RFSLZQXB.js";import d from"./IFGLNWRZ.js";import a from"./DKIBLRSR.js";import{d as T,e as v}from"./WOGALV3T.js";import{C as x,c as O,q as M}from"./PNFPQKYB.js";import"./5L7BAEX5.js";import"./KX7KGXKQ.js";import{b as S,d as H}from"./NGXRBJKL.js";import"./WULMITJI.js";import{A as V,B as _,C as h,D as z,F as $,H as U,g as N,i as c,n as C,z as A}from"./UE4KTI5X.js";import"./64L7VJJK.js";import"./QP5UAIC6.js";import"./Z5QPCSUQ.js";import{a as r,k as R}from"./QVG3TOL4.js";import"./BYSUABOV.js";export default $arcgis.t(([{substitute:ce},{Ja:G,Lb:j,Pb:q,ba:X,tb:Z},,,,,,{d:I},,{a:W},,,,,{r:ie},{e:y,f:K},{b:D}])=>{var d={chartUIComponent:"chart-ui-component",tabBar:"tab-bar",tab:"tab"};function le(m,e){let t=new Set,a=e;return m?.forEach((i,s)=>{let o=i.chartId;(t.has(o)||o===void 0||o==="")&&(i.chartId=`Chart_${Date.now()}_${s}`,e===o&&(a=i.chartId)),t.add(o)}),a}function he(m,e,t){return m?.filter(a=>M(t,a.config)&&a.layer?.id===e)??[]}function de(m){let{modelList:e,layerList:t,activeLayerId:a,disableEditing:i}=m,s=new Map;return e?.forEach(o=>{let l=o.layer;l&&s.set(l.id,l)}),i||t.forEach(o=>s.set(o.id,o)),Array.from(s.values()).filter(o=>!a||o.id===a)}function me(m,e){m.forEach(t=>{e.forEach(a=>{t?.id===a.layer?.id&&ne(t,a)})})}function ne(m,e){let t=m;if(t){let a=[...t?.charts??[]],i=a?.findIndex(o=>o.id===e.chartId),s=!1;i!==void 0&&i>-1?(s=!S(a[i],e.config),a[i]=e.config):t&&!I(e.config)&&(s=!0,a.push(e.config)),s&&(t.charts=a)}}function pe(m,e){let t=m;if(t){let a=[...t.charts??[]],i=a.findIndex(s=>s.id===e);i>-1&&(a.splice(i,1),t.charts=a)}}function ue(m,e){let t=m;if(t){let a=[...t.charts??[]];a=x({arrayA:a,arrayB:e.map(i=>i.config),getKey:i=>i.id??i.title?.content.text??""}),t.charts=a}}var ge=N`.hide{visibility:hidden}.am5-html-container{z-index:101!important}.am5-layer-1000{z-index:1000!important}.am5-layer-30{z-index:100!important}.show{display:block}.notifyPanel{flex:0 1 auto}.disable-interactions{pointer-events:none}.dim-text{color:var(--arcgis-charts-dim-text)}:host{display:flex;flex-direction:column;flex:1 1 auto;overflow:hidden;height:inherit;max-height:100%}.chart-ui-component{overflow-y:auto;overflow-x:hidden}.label{display:flex;margin-left:1rem;margin-bottom:.5rem;justify-content:space-between}.text{display:flex;margin-left:1rem;width:calc(100% - 1.5rem);height:2rem;margin-bottom:.5rem;justify-content:space-between}.field-list{max-height:50vh;overflow-y:scroll}.row{padding:.5rem}.bin-count-container{display:flex;width:calc(100% - 1rem);padding:.5rem}.bin-count-slider{margin-left:1rem;width:calc(90% - 1rem)}.bin-count-input{margin-left:1rem;height:2rem;width:2rem}.bin-row{padding:.5rem 0 .5rem .5rem}.tab-bar{display:flex}.tab{flex:1;height:2.5rem}`,E=class extends _{constructor(){super(),this.selectChartTypePopover=null,this.chartsListFlowItem=A(),this.supportedChartTypes=[r.BarSeries,r.BoxPlotSeries,r.LineSeries,r.PieSeries,r.HistogramSeries,r.ScatterSeries,r.HeatSeries],this._messages=P(),this.commonStrings=P({name:"common",blocking:!0}),this.chartDataProcessComplete=async e=>{let t=e,{chartData:a,model:i}=t.detail,s=this.getModel(this.selectedChartId);if(i?.isSameChartAs(s))switch(s?.chartType){case r.HistogramSeries:if(this.chartData=a,i&&(i.dataStore.chartData=a,v(i.layer))){let o=i,l=a?.bins?.length;l!==void 0&&o.binCount!==l&&(o.binCount=l)}break;case r.PieSeries:{this.chartData=a,i&&(i.dataStore.chartData=a);break}case r.ScatterSeries:{let o=a,{dataItems:l,r2:g,aggregated:u}=o,p=g;Number.isFinite(g)||(p=void 0),this.r2=p,Y(i)&&(i.dataStore.r2=p,i.dataStore.aggregated=u,u&&(i.additionalTooltipField=void 0)),this.calculatedDataMinMaxBounds=this.getDataExtent(l),i&&(i.dataStore.calculatedDataMinMaxBounds=this.calculatedDataMinMaxBounds);break}case r.LineSeries:case r.BarSeries:{let{dataItems:o,timeIntervalInfo:l}=a;(B(s)||Q(s)&&s.binTemporalData)&&(l?.size!==void 0&&s.temporalBinningSize!==l?.size&&(s.temporalBinningSize=l?.size),l?.unit!==void 0&&s.temporalBinningUnit!==l?.unit&&l?.unit!==R.Quarter&&(s.temporalBinningUnit=l?.unit),l?.size!==void 0&&l?.unit!==void 0&&ae(b,{size:l.size,unit:l.unit})),this.calculatedDataMinMaxBounds=this.getDataExtent(o),i&&(i.dataStore.calculatedDataMinMaxBounds=this.calculatedDataMinMaxBounds);break}}},this.chartAxesMinMaxChange=e=>{let t=e,{bounds:a,model:i}=t.detail,s=this.getModel(this.selectedChartId),o=i?.isSameChartAs(s),l=s?.chartType;if(o)switch(l){case r.BarSeries:case r.BoxPlotSeries:case r.LineSeries:case r.HistogramSeries:case r.ScatterSeries:this.calculatedMinMaxBounds=a,i&&(i.dataStore.calculatedMinMaxBounds=a),this.updateAxesBoundsInAppState(a);break}},this.chartSeriesColorChange=e=>{let t=e,{colorMatchApplied:a,data:i,model:s}=t.detail,o=this.getModel(this.selectedChartId);if(s?.isSameChartAs(o))switch(o?.chartType){case r.BarSeries:case r.BoxPlotSeries:case r.LineSeries:case r.HistogramSeries:this.seriesColor=i,s&&(s.dataStore.seriesColor=i),this.applyNullCategorySeriesColor({colorMatchApplied:a,data:i,model:o});break;case r.PieSeries:{let l=new Map([[0,i]]);this.seriesColor=l,s&&(s.dataStore.seriesColor=l);break}case r.ScatterSeries:}},this.chartNoRenderPropChange=e=>{let t=e,{propName:a,value:i,model:s}=t.detail,o=this.modelList.find(l=>s?.isSameChartAs(l));if(o)switch(a){case"rotation":typeof i=="boolean"&&W(o)&&(o.rotated=i);break;case"legendPosition":typeof i=="string"&&w(o)&&(o.legendPosition=i);break;case"legendVisibility":typeof i=="boolean"&&w(o)&&(o.legendVisibility=i);break}},this.chartLegendItemVisibilityChange=e=>{let t=e,{legendItemVisibility:a,model:i}=t.detail,s=this.modelList.find(o=>i?.isSameChartAs(o));s?.setSeriesVisibility(a),L(s)&&((s.getMinBound(1)===null||Number.isNaN(s.getMinBound(1)))&&s.setMinBound(null,1),(s.getMaxBound(1)===null||Number.isNaN(s.getMaxBound(1)))&&s.setMaxBound(null,1),B(s)&&((s.getMinBound(0)===null||Number.isNaN(s.getMinBound(0)))&&s.setMinBound(null,0),(s.getMaxBound(0)===null||Number.isNaN(s.getMaxBound(0)))&&s.setMaxBound(null,0)))},this.onSelectChartTypeChange=e=>{this.currentChartTypeText="",this.calculatedDataMinMaxBounds=void 0,this.calculatedMinMaxBounds=void 0,this.removeSelectChartTypePopover();let{selectedModelType:t,layerId:a}=e.target;t!==void 0&&(this.allowChartSyncing=!0,this.arcgisChartsConfigNewChart.emit({key:"key",chartType:t,layerId:a}))},this.onAddChartClose=()=>{this.removeSelectChartTypePopover()},this.onModelConfigChange=e=>{if(this.syncChartsToLayers&&this.allowChartSyncing){let t=e.target;ne(t?.layer,t)}this.requestUpdate()},this.allowChartSyncing=!1,this.currentChartTypeText="",this.modelList=[],this.layerList=[],this.disableEditing=!1,this.syncChartsToLayers=!1,this.close=!1,this.usePopupTemplateFieldsInfo=!1,this.panelNumber=0,this.filterBySelection=!1,this.arcgisChartsConfigChartViewChartClose=C(),this.arcgisChartsConfigModelListChange=C(),this.arcgisChartsConfigNewChart=C(),this.arcgisChartsConfigPanelNumberChange=C(),this.arcgisChartsConfigSelectedChartChange=C(),this.addChartEventListeners(),this.listen("arcgisChartsConfigModelListReorder",this.modelListReorderChangeListener)}static{this.properties={selectedPanel:16,currentChartTypeText:16,messageOverrides:0,modelList:[0,{hasChanged:y}],layerList:[0,{hasChanged:y}],selectedChartId:1,activeLayerId:1,disableEditing:5,syncChartsToLayers:5,timeZone:1,headerTitle:1,close:5,chartData:[0,{hasChanged:y}],view:0,r2:9,calculatedDataMinMaxBounds:[0,{hasChanged:y}],calculatedMinMaxBounds:[0,{hasChanged:y}],seriesColor:[0,{hasChanged:K}],popoverPlacement:1,usePopupTemplateFieldsInfo:5,popupTemplateFieldInfosEnabled:5,panelNumber:9,filterBySelection:5}}static{this.styles=ge}async setFocus(){await this.chartsListFlowItem.value?.setFocus()}async load(){await this.layerListChange();let e=this.getModel(this.selectedChartId);this.setEventBasedPropsFromModelData(e)}willUpdate(e){e.has("layerList")&&this.layerListChange(),e.has("panelNumber")&&this.panelNumberChange(this.panelNumber),e.has("modelList")&&this.modelListChange(this.modelList,e.get("modelList")),e.has("selectedChartId")&&this.selectedChartIdChange(this.selectedChartId)}disconnectedCallback(){super.disconnectedCallback(),this.clearPartialModels(),this.removeSelectChartTypePopover()}applyNullCategorySeriesColor(e){let{colorMatchApplied:t,data:a,model:i}=e;J(i)&&i.nullCategory===void 0&&(i.nullCategory=this.getDefaultNullCategory(t?this.getSeriesColor(a):void 0))}getSeriesColor(e){let t=e.get(0),a;return t&&"color"in t?a=t.color:t&&"lineSymbol"in t&&(a=t.markerSymbol?.color??t.lineSymbol.color),a}getDefaultNullCategory(e){let t=H(O.nullCategory);return e!==void 0&&(t.fillSymbol&&(t.fillSymbol.color=e,t.fillSymbol.outline&&(t.fillSymbol.outline.color=e)),t.markerSymbol&&(t.markerSymbol.color=e,t.markerSymbol.outline&&(t.markerSymbol.outline.color=e))),t}modelListReorderChangeListener(e){let{modelList:t}=e.detail;if(this.modelList=x({arrayA:this.modelList,arrayB:t,getKey:a=>a.chartId??a.titleText??""}),this.syncChartsToLayers){let a=t.find(i=>i.layer?.id!==void 0)?.layer?.id;if(a){let i=this.layerList.find(s=>s.id.toString()===a);i&&ue(i,t)}}}async layerListChange(){let e=[],t=this.layerList.map(i=>i.id.toString()),a=[...this.modelList.filter(i=>t.includes(i.layer?.id??""))];for(let i of this.layerList??[]){if(i.type==="sublayer"){let o=await i.createFeatureLayer();if(!o)continue;i=o}let s=i.charts;for(let o of s??[]){let l=await ee({layer:i,config:o,commonStrings:this.commonStrings});l!==void 0&&e.push(l)}}le(e),e.forEach(i=>{a.find(s=>s.isSameChartAs(i))===void 0&&a.push(i)}),a=a.filter(i=>!G(i.config)),this.modelList=a}modelListChange(e,t){this.selectedChartId=le(e,this.selectedChartId),t?.forEach(i=>{i.removeEventListener("arcgisChartsModelConfigChange",this.onModelConfigChange)}),e.forEach(i=>{i.addEventListener("arcgisChartsModelConfigChange",this.onModelConfigChange)});let a=this.getModel(this.selectedChartId);this.currentChartTypeText=a?.chartType!==void 0?D({chartType:a.chartType,commonStrings:this.commonStrings,config:a.config}):"",this.syncChartsToLayers&&this.allowChartSyncing&&me(this.layerList,e),this.arcgisChartsConfigModelListChange.emit({modelList:e})}selectedChartIdChange(e){this.selectedChartId===void 0&&(this.panelNumber=0),this.selectedPanel=n.Data;let t=this.getModel(e);this.setEventBasedPropsFromModelData(t),this.currentChartTypeText=t?.chartType!==void 0?D({chartType:t.chartType,commonStrings:this.commonStrings,config:t.config}):"",e!==void 0&&e!==b.selectedChartId&&(b.selectedChartId=e),this.allowChartSyncing=!0,this.arcgisChartsConfigSelectedChartChange.emit({key:"key",model:t})}panelNumberChange(e){e===0?this.clearPartialModels():e===1&&this.removeSelectChartTypePopover(),this.arcgisChartsConfigPanelNumberChange.emit({panelNumber:e,modelList:this.modelList})}addChartEventListeners(){this.listenOn(document,f.DataProcessComplete,this.chartDataProcessComplete),this.listenOn(document,f.AxesMinMaxChange,this.chartAxesMinMaxChange),this.listenOn(document,f.SeriesColorChange,this.chartSeriesColorChange),this.listenOn(document,f.NoRenderPropChange,this.chartNoRenderPropChange),this.listenOn(document,f.LegendItemVisibilityChange,this.chartLegendItemVisibilityChange)}getDataExtent(e){let t=this.getModel(this.selectedChartId)?.config,a=[];if(t!==void 0&&e!==void 0){let i=Z({chartConfig:t,chartData:e}),{minY:s,maxY:o,minX:l,maxX:g}=i;a=[{isXAxis:!0,minimum:l,maximum:g},{isXAxis:!1,minimum:s,maximum:o}]}return a}updateAxesBoundsInAppState(e){e?.forEach(t=>{let{isXAxis:a,maximum:i,minimum:s}=t,o=this.getModel(this.selectedChartId);if(o!==void 0&&L(o)&&this.selectedChartId!==void 0){let l=new se(o,a),g=te({chartId:this.selectedChartId,isXAxis:a,isLogarithmic:l.getLogarithmic()}),u=b.chartAxesBoundDataMap;u[this.selectedChartId]===void 0&&(u[this.selectedChartId]={});let p=u[this.selectedChartId]?.[g],F={defaultMinBound:p?.defaultMinBound===p?.currMinBound?s:p?.defaultMinBound,currMinBound:s,defaultMaxBound:p?.defaultMaxBound===p?.currMaxBound?i:p?.defaultMaxBound,currMaxBound:i};!S(p,F)&&this.selectedChartId!==void 0&&u?.[this.selectedChartId]!==void 0&&(u[this.selectedChartId][g]=F)}})}getPlacement(){let e;return this.popoverPlacement!==void 0?e=this.popoverPlacement:e=this.modelList?.filter(t=>M(X,t.config)).length<=2?"bottom":"top",e}onBackFlow(){this.panelNumber-=1}async onAddChartClick(e){let{referenceElement:t,layerId:a,layerType:i}=e.detail,s=!0;if(T(i)&&a){let o=this.layerList.find(l=>l.id===a);v(o)&&(s=!!(await q(o))?.attributeTable)}this.setupSelectChartTypePopover(t,a,i,s)}setupSelectChartTypePopover(e,t,a,i=!0){let s=this.getPlacement();this.removeSelectChartTypePopover(),this.selectChartTypePopover=$(c`<arcgis-charts-config-select-chart-type-popover .referenceElement=${e} open .layerId=${t} .layerType=${a} .isRasterBarChartSupported=${i} .popoverPlacement=${s} @arcgisChartsConfigPopoverClose=${this.onAddChartClose} @arcgisChartsConfigSelectChartTypeChange=${this.onSelectChartTypeChange}></arcgis-charts-config-select-chart-type-popover>`),!document.body.contains(this.selectChartTypePopover)&&this.selectChartTypePopover!==null&&document.body.appendChild(this.selectChartTypePopover)}getModel(e){return this.modelList?.find(t=>t.chartId===e)}removeSelectChartTypePopover(){this.selectChartTypePopover!==void 0&&(this.selectChartTypePopover?.remove(),this.selectChartTypePopover=re(this.selectChartTypePopover))}clearPartialModels(){this.modelList=this.modelList.filter(e=>!I(e.config))}onViewChartDelete(e){let{chartId:t}=e.detail;if(t!==void 0){let a=this.modelList.find(s=>s.chartId===t),i=this.layerList.find(s=>s.id===a?.layer?.id);this.modelList=[...this.modelList.filter(s=>s.chartId!==t)],i&&this.syncChartsToLayers&&this.allowChartSyncing&&pe(i,t)}}onViewChartsSelect(e){this.selectedChartId===e.detail.chartId&&(this.allowChartSyncing=!0,this.arcgisChartsConfigSelectedChartChange.emit({key:"key",model:this.getModel(this.selectedChartId)})),this.selectedChartId=e.detail.chartId}onViewChartsEdit(e){this.onViewChartsSelect(e),this.panelNumber=1}onViewChartClose(){this.close=!0,this.removeSelectChartTypePopover(),this.arcgisChartsConfigChartViewChartClose.emit()}setEventBasedPropsFromModelData(e){this.chartData=e?.dataStore.chartData,this.r2=e?.dataStore.r2,this.seriesColor=e?.dataStore.seriesColor,this.calculatedMinMaxBounds=e?.dataStore.calculatedMinMaxBounds,this.calculatedDataMinMaxBounds=e?.dataStore.calculatedDataMinMaxBounds}createTooltip(e){let t=e.target,a="";switch(t.icon){case"configure":a=this._messages.data??"";break;case"graph-bar-stacked":case"graph-line-series":case"box-chart-series":a=this._messages.series??"";break;case"graph-pie-slice":a=this._messages.slices??"";break;case"graph-axis":a=this._messages.axes??"";break;case"graph-guides":a=this._messages.guides??"";break;case"palette":a=this._messages.format??"";break;case"text":a=this._messages.general??"";break;default:a="";break}this.tooltip=$(c`<calcite-tooltip style=${z({opacity:1,zIndex:"var(--calcite-floating-ui-z-index)"})} .referenceElement=${t} open placement=top>${a}</calcite-tooltip>`),document.body.appendChild(this.tooltip)}destroyTooltip(){ie(this.tooltip)}renderViewCharts(){let e=de({modelList:this.modelList,layerList:this.layerList,activeLayerId:this.activeLayerId,disableEditing:this.disableEditing});return oe(e,t=>t.id,t=>c`<arcgis-charts-config-view-charts .noGroup=${this.activeLayerId!==void 0} .modelList=${he(this.modelList,t.id.toString(),T(t.type)?j:this.supportedChartTypes)} .selectedChartId=${this.selectedChartId??""} .layer=${t} .disableEditing=${this.disableEditing} @arcgisChartsConfigViewChartSelect=${this.onViewChartsSelect} @arcgisChartsConfigViewChartEdit=${this.onViewChartsEdit} @arcgisChartsConfigViewChartDelete=${this.onViewChartDelete} @arcgisChartsConfigViewChartAddChart=${this.onAddChartClick}></arcgis-charts-config-view-charts>`)}render(){return this.close?null:c`<calcite-flow>${k("charts-list",c`<calcite-flow-item .selected=${this.panelNumber===0||this.disableEditing} .heading=${this.headerTitle??this._messages.defaultHeaderTitle} closable @calciteFlowItemClose=${this.onViewChartClose} ${V(this.chartsListFlowItem)}>${this.renderViewCharts()}</calcite-flow-item>`)}${this.panelNumber>=1&&!this.disableEditing?this.renderTabs():null}</calcite-flow>`}renderTabs(){let e=this.getModel(this.selectedChartId);return k("chart-edit",c`<calcite-flow-item .selected=${this.panelNumber>=1&&!this.disableEditing} @calciteFlowItemBack=${this.onBackFlow} .heading=${this._messages[this.selectedPanel??n.Data]} .description=${this.currentChartTypeText!==""&&this._messages.pageFlowTitle!==void 0?ce(this._messages.pageFlowTitle,{chartName:e?.titleText??this.currentChartTypeText,layerName:e?.layer?.title??""}):""}>${e?.chartType!==void 0?c`<calcite-action-bar class=${h(d.tabBar)} layout=horizontal expand-disabled><calcite-action class=${h(d.tab)} icon=configure scale=s alignment=center .active=${this.selectedPanel===n.Data||this.selectedPanel===void 0} @click=${()=>{this.selectedPanel=n.Data}} @mouseover=${this.createTooltip} @mouseout=${this.destroyTooltip} text></calcite-action>${e?.chartType===r.BarSeries?c`<calcite-action class=${h(d.tab)} icon=graph-bar-stacked scale=s alignment=center .active=${this.selectedPanel===n.Series} @click=${()=>{this.selectedPanel=n.Series}} @mouseover=${this.createTooltip} @mouseout=${this.destroyTooltip} .text=${this._messages.series??""}></calcite-action>`:null}${e?.chartType===r.LineSeries?c`<calcite-action class=${h(d.tab)} icon=graph-line-series scale=s alignment=center .active=${this.selectedPanel===n.Series} @click=${()=>{this.selectedPanel=n.Series}} @mouseover=${this.createTooltip} @mouseout=${this.destroyTooltip} .text=${this._messages.series??""}></calcite-action>`:null}${e?.chartType===r.BoxPlotSeries?c`<calcite-action class=${h(d.tab)} icon=box-chart-series scale=s alignment=center .active=${this.selectedPanel===n.Series} @click=${()=>{this.selectedPanel=n.Series}} @mouseover=${this.createTooltip} @mouseout=${this.destroyTooltip} .text=${this._messages.series??""}></calcite-action>`:null}${e?.chartType===r.PieSeries?c`<calcite-action class=${h(d.tab)} icon=graph-pie-slice scale=s alignment=center .active=${this.selectedPanel===n.Slices} @click=${()=>{this.selectedPanel=n.Slices}} @mouseover=${this.createTooltip} @mouseout=${this.destroyTooltip} .text=${this._messages.slices??""}></calcite-action>`:null}${e?.chartType!==r.PieSeries&&e?.chartType!==r.HeatSeries?c`<calcite-action class=${h(d.tab)} icon=graph-axis scale=s alignment=center .active=${this.selectedPanel===n.Axes} @click=${()=>{this.selectedPanel=n.Axes}} @mouseover=${this.createTooltip} @mouseout=${this.destroyTooltip} .text=${this._messages.axes??""}></calcite-action>`:null}${e?.chartType!==r.PieSeries&&e?.chartType!==r.HeatSeries?c`<calcite-action class=${h(d.tab)} icon=graph-guides scale=s alignment=center .active=${this.selectedPanel===n.Guides} @click=${()=>{this.selectedPanel=n.Guides}} @mouseover=${this.createTooltip} @mouseout=${this.destroyTooltip} .text=${this._messages.guides??""}></calcite-action>`:null}<calcite-action class=${h(d.tab)} icon=palette scale=s alignment=center .active=${this.selectedPanel===n.Format} @click=${()=>{this.selectedPanel=n.Format}} @mouseover=${this.createTooltip} @mouseout=${this.destroyTooltip} .text=${this._messages.format??""}></calcite-action><calcite-action class=${h(d.tab)} icon=text scale=s alignment=center .active=${this.selectedPanel===n.General} @click=${()=>{this.selectedPanel=n.General}} @mouseover=${this.createTooltip} @mouseout=${this.destroyTooltip} .text=${this._messages.general??""}></calcite-action></calcite-action-bar>`:null}${this.renderChartUIComponent()}</calcite-flow-item>`)}renderChartUIComponent(){let e=this.getModel(this.selectedChartId),t=e?.layer,a=null;if(e!==void 0&&!this.disableEditing)switch(e?.chartType){case r.BarSeries:a=c`<arcgis-charts-config-bar-chart class=${h(d.chartUIComponent)} .model=${e} .timeZone=${this.timeZone} .usePopupTemplateFieldsInfo=${this.usePopupTemplateFieldsInfo||this.popupTemplateFieldInfosEnabled} .layer=${t} .page=${this.selectedPanel??n.Data} .calculatedMinMaxBounds=${this.calculatedMinMaxBounds} .seriesColor=${this.seriesColor}></arcgis-charts-config-bar-chart>`;break;case r.LineSeries:a=c`<arcgis-charts-config-line-chart class=${h(d.chartUIComponent)} .model=${e} .timeZone=${this.timeZone} .usePopupTemplateFieldsInfo=${this.usePopupTemplateFieldsInfo||this.popupTemplateFieldInfosEnabled} .layer=${t} .page=${this.selectedPanel??n.Data} .calculatedDataMinMaxBounds=${this.calculatedDataMinMaxBounds} .calculatedMinMaxBounds=${this.calculatedMinMaxBounds} .seriesColor=${this.seriesColor}></arcgis-charts-config-line-chart>`;break;case r.PieSeries:a=c`<arcgis-charts-config-pie-chart class=${h(d.chartUIComponent)} .model=${e} .usePopupTemplateFieldsInfo=${this.usePopupTemplateFieldsInfo||this.popupTemplateFieldInfosEnabled} .layer=${t} .chartData=${this.chartData} .page=${this.selectedPanel??n.Data} .calculatedMinMaxBounds=${this.calculatedMinMaxBounds} .seriesColor=${this.seriesColor} .filterBySelection=${this.filterBySelection}></arcgis-charts-config-pie-chart>`;break;case r.HistogramSeries:a=c`<arcgis-charts-config-histogram class=${h(d.chartUIComponent)} .model=${e} .usePopupTemplateFieldsInfo=${this.usePopupTemplateFieldsInfo||this.popupTemplateFieldInfosEnabled} .layer=${t} .page=${this.selectedPanel??n.Data} .chartData=${this.chartData} .calculatedMinMaxBounds=${this.calculatedMinMaxBounds} .seriesColor=${this.seriesColor}></arcgis-charts-config-histogram>`;break;case r.ScatterSeries:a=c`<arcgis-charts-config-scatter-plot class=${h(d.chartUIComponent)} .model=${e} .usePopupTemplateFieldsInfo=${this.usePopupTemplateFieldsInfo||this.popupTemplateFieldInfosEnabled} .layer=${t} .view=${this.view} .page=${this.selectedPanel??n.Data} .r2=${this.r2} .calculatedDataMinMaxBounds=${this.calculatedDataMinMaxBounds} .calculatedMinMaxBounds=${this.calculatedMinMaxBounds}></arcgis-charts-config-scatter-plot>`;break;case r.BoxPlotSeries:a=c`<arcgis-charts-config-box-plot class=${h(d.chartUIComponent)} .model=${e} .usePopupTemplateFieldsInfo=${this.usePopupTemplateFieldsInfo||this.popupTemplateFieldInfosEnabled} .layer=${t} .page=${this.selectedPanel??n.Data} .calculatedMinMaxBounds=${this.calculatedMinMaxBounds} .seriesColor=${this.seriesColor}></arcgis-charts-config-box-plot>`;break;case r.HeatSeries:a=c`<arcgis-charts-config-heat-chart class=${h(d.chartUIComponent)} .model=${e} .usePopupTemplateFieldsInfo=${this.usePopupTemplateFieldsInfo||this.popupTemplateFieldInfosEnabled} .layer=${t} .page=${this.selectedPanel??n.Data}></arcgis-charts-config-heat-chart>`;break}return a}};U("arcgis-charts-config-create-flow",E);return E},"intl",a,d,e,g,i,j,l,m,o,p,q,s,t,u,y,D)