@arcgis/map-components 5.2.0-next.40 → 5.2.0-next.42

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.
Files changed (38) hide show
  1. package/dist/cdn/{TLFRQY4X.js → 6J7L2FAB.js} +1 -1
  2. package/dist/cdn/{5IO4VISO.js → BIZFPS3V.js} +1 -1
  3. package/dist/cdn/{AWQ26Q4D.js → CNV6ALQO.js} +1 -1
  4. package/dist/cdn/{KH3IAHXE.js → GPDIJQMG.js} +1 -1
  5. package/dist/cdn/{TVTHJ57O.js → J3LU4VHH.js} +1 -1
  6. package/dist/cdn/{V3YVWJA3.js → JIIWY7WR.js} +1 -1
  7. package/dist/cdn/{OTLQG3D4.js → NGYAHM32.js} +1 -1
  8. package/dist/cdn/QXFHLDLD.js +2 -0
  9. package/dist/cdn/VZK5BXWY.js +2 -0
  10. package/dist/cdn/{G55FBLQV.js → WACJO3GM.js} +1 -1
  11. package/dist/cdn/{Y7ESUBFW.js → ZMVTKENO.js} +1 -1
  12. package/dist/cdn/index.js +1 -1
  13. package/dist/components/arcgis-catalog-layer-list-next/customElement.js +10 -10
  14. package/dist/components/arcgis-elevation-profile/customElement.d.ts +2 -1
  15. package/dist/components/arcgis-elevation-profile/customElement.js +6 -6
  16. package/dist/components/arcgis-elevation-profile-settings/customElement.js +3 -3
  17. package/dist/components/arcgis-feature-content/customElement.js +5 -5
  18. package/dist/components/arcgis-features/customElement.d.ts +1 -1
  19. package/dist/components/arcgis-features/customElement.js +1 -1
  20. package/dist/components/arcgis-features-next/customElement.d.ts +1 -1
  21. package/dist/components/arcgis-features-next/customElement.js +5 -5
  22. package/dist/components/arcgis-layer-list-next/customElement.d.ts +1 -1
  23. package/dist/components/arcgis-layer-list-next/customElement.js +2 -2
  24. package/dist/components/arcgis-oriented-imagery-viewer-image-viewer/customElement.d.ts +2 -1
  25. package/dist/components/arcgis-oriented-imagery-viewer-image-viewer/customElement.js +5 -5
  26. package/dist/components/arcgis-popup/customElement.d.ts +2 -1
  27. package/dist/components/arcgis-popup/customElement.js +13 -9
  28. package/dist/components/arcgis-utility-network-trace-analysis/customElement.d.ts +2 -33
  29. package/dist/components/arcgis-utility-network-trace-analysis/customElement.js +1 -1
  30. package/dist/components/arcgis-utility-network-trace-results/customElement.d.ts +2 -1
  31. package/dist/components/arcgis-utility-network-trace-results/customElement.js +1 -1
  32. package/dist/docs/api.json +1 -1
  33. package/dist/docs/docs.json +1 -1
  34. package/dist/docs/web-types.json +1 -1
  35. package/dist/loader.js +1 -1
  36. package/package.json +4 -4
  37. package/dist/cdn/KG4EPDJO.js +0 -2
  38. package/dist/cdn/XIVMPSLL.js +0 -2
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import a from"./P6CDJ2IV.js";import"./VJVKFKSG.js";import{a as C}from"./JP24H6WY.js";import"./Z7J6NDSB.js";import"./VWED2WAO.js";import"./QUZTFUWM.js";import"./RZ6SODVT.js";import{M as f,N as v,O as w,U as L,a as g,b as _,p as y,z as u}from"./CDSRIIHC.js";import"./H6RQVSYM.js";export default $arcgis.t(([{property:c,subclass:M},b,,G,{watch:m},{rotateDimensions:P,registerPanConstraint:I},z,,O,{b:d}])=>{var x=g`:host{height:100%;--arcgis-view-color-focus: none}`,A=Object.defineProperty,E=Object.getOwnPropertyDescriptor,h=(t,e,r,i)=>{for(var a=i>1?void 0:i?E(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(a=(i?o(e,r,a):o(a))||a);return i&&a&&A(e,r,a),a},n=class extends b{constructor(t){super(t),this.autoLoad=!1}static isNonPanoramicMedia(t){return!!t&&typeof t=="object"&&"declaredClass"in t&&typeof t.declaredClass=="string"&&t.declaredClass==="components.oriented-imagery-viewer.support.NonPanoramicMedia"}destroy(){this._cache?.destroy(),this._cache=void 0}get layer(){return this._cache}get size(){if(!this._cache||this._cache.destroyed||this._cache.loadError||!this._cache.serviceRasterInfo)return;let{serviceRasterInfo:t}=this._cache;return[t.width,t.height]}async load(t){if(this._cache&&!this._cache.destroyed)return await this._cache.load(t),{layer:this._cache,size:this.size};let{url:e,customParameters:r}=this,i=this.datasetFormat;if(!e)throw new Error("URL is required to load NonPanoramicMedia.");if(!i){let o=await import("./A5XIQWD5.js").then(m=>m.default);if(d(t),i=o.guessExtensionFromURI(e),!i){try{i=await o.getDatasetFormat(e)}catch{y("warn",this,"Failed to determine dataset format from URL or response headers."),i="UNKNOWN FORMAT"}d(t)}}this.datasetFormat=i;let a=(await $arcgis.t(m=>m[0],"layers/ImageryTileLayer")).default;d(t);let s=new a({url:e,ioConfig:{skipExtensions:["aux.xml","jgw"],skipMapInfo:!0,datasetFormat:i},customParameters:r??void 0});return await s.load(t),d(t),this._cache=s,{layer:this._cache,size:this.size}}};h([c()],n.prototype,"_cache",2);h([c()],n.prototype,"autoLoad",2);h([c()],n.prototype,"customParameters",2);h([c()],n.prototype,"datasetFormat",2);h([c()],n.prototype,"url",2);h([c()],n.prototype,"layer",1);h([c()],n.prototype,"size",1);n=h([M("components.oriented-imagery-viewer.support.NonPanoramicMedia")],n);function F(t,e,r,i,a){let{width:s,height:o}=P(t,e,a);return Math.max(s/r,o/i)}var N=96,$=39.37,R=$*N;function j(t){let e=R*.25,r=R*t,i=[],a=r;for(;a>e;)i.push(a),a*=.5;i.push(e);let{lods:s}=z.create({scales:i});return{minScale:r,lods:s}}var l=class extends u{get graphics(){return this._graphicsLayer?.graphics}_ensureGraphicsLayer(){(!this._graphicsLayer||this._graphicsLayer.destroyed)&&(this._graphicsLayer=new O({title:"Overlays",listMode:"hide",visible:!0,blendMode:"source-atop"}))}hostLoaded(){this._ensureGraphicsLayer(),this.component.manager.onLifecycle(()=>[m(()=>this.component?.map,(e,r)=>{r?.layers.remove(this._graphicsLayer),e&&e?.layers.add(this._graphicsLayer)},{initial:!0,sync:!0}),m(()=>this.component?.map?.allLayers.length,e=>{e&&this.component?.map?.layers.reorder(this._graphicsLayer,e-1)},{initial:!0,sync:!0})])}addGraphic(e){this._graphicsLayer.add(e)}addGraphics(e){this._graphicsLayer.addMany(e)}removeGraphic(e){this._graphicsLayer?.destroyed||this._graphicsLayer.remove(e)}removeGraphics(e){this._graphicsLayer?.destroyed||this._graphicsLayer.removeMany(e)}clearGraphics(){this._graphicsLayer?.destroyed||this._graphicsLayer.removeAll()}destroy(){this._graphicsLayer?.destroy()}},p=class extends w{constructor(){super(...arguments),this._messages=C(),this._graphicsController=new l(this),this._imageChanged=!1,this._internalMap=f(),this._loading=!1,this.hideHeader=!1,this.hideLoader=!1,this.hideZoomControls=!1,this.messageOverrides=this._messages._overrides,this.rotation=0}static{this.properties={_imageChanged:16,_internalMap:16,_image:16,_loading:16,_media:16,hideHeader:5,hideLoader:5,hideZoomControls:5,messageOverrides:0,media:0,rotation:9}}static{this.styles=[x]}get imageRenderer(){return this._internalMap?.value?.view}get map(){return this.imageRenderer?.map}get media(){return this._media}set media(e){if(!e){this._mediaAbortController?.abort(),this._media=void 0,this._clearImage();return}this._media=e instanceof n?e:new n(e)}addGraphic(e){this._graphicsController.addGraphic(e)}addGraphics(e){this._graphicsController.addGraphics(e)}clearGraphics(){this._graphicsController.clearGraphics()}async mediaOnLoad(){return this._mediaPromise&&await this._mediaPromise,this._media}removeGraphic(e){this._graphicsController.removeGraphic(e)}removeGraphics(e){this._graphicsController.removeGraphics(e)}loaded(){this.manager.onLifecycle(()=>[this._createResizeConstraint(),this._createRotationHandler(),this._createPanConstraint(),m(()=>this._media,e=>{this._mediaAbortController?.abort(),e&&(this._mediaAbortController=new AbortController,this._mediaPromise=this._loadMediaInternal(e,this._mediaAbortController))},{initial:!0,sync:!0})])}_createPanConstraint(){return m(()=>({image:this._image,imageRenderer:this.imageRenderer}),({image:e,imageRenderer:r})=>{!e||!r?.ready||I(r,e)},{sync:!0,initial:!0})}_createResizeConstraint(){return m(()=>{if(!this.imageRenderer?.ready||!this._image)return;let{width:e,height:r}=this._image.serviceRasterInfo,{width:i,height:a,rotation:s}=this.imageRenderer;return F(e,r,i,a,s)},e=>{if(!e||!this.imageRenderer)return;let{constraints:r,scale:i}=this.imageRenderer,a=r.minScale,{lods:s,minScale:o}=j(e);r.set({minScale:o,lods:s}),this.imageRenderer.scale=this._imageChanged||Math.abs(i-a)<=1e-6?o:i,this._imageChanged=!1},{sync:!0,initial:!0})}_createRotationHandler(){return m(()=>this.rotation,e=>{this.imageRenderer&&(this.imageRenderer.constraints.rotationEnabled=!0,this.imageRenderer.rotation=e,this.imageRenderer.constraints.rotationEnabled=!1)},{sync:!0,initial:!0})}_clearImage(){this._image?.destroy(),this._image=void 0}async _loadMediaInternal(e,r){if(this._loading=!0,this._clearImage(),!e)throw new Error("No media provided");let{layer:i}=await e.load(r).finally(()=>{this._loading=!1});d(r),this._imageChanged=!0,this._image=i,this.imageRenderer?.map?.layers.add(this._image)}render(){return _`<calcite-panel .loading=${this.hideLoader?void 0:this._loading} .heading=${this.hideHeader?void 0:this._messages.title}><arcgis-map hide-attribution .spatialReference=${G.WebMercator} ${v(this._internalMap)}><arcgis-zoom .hidden=${this.hideZoomControls} slot=top-left></arcgis-zoom></arcgis-map></calcite-panel>`}};L("arcgis-oriented-imagery-viewer-image-viewer",p);return p},"core/accessorSupport/decorators","core/Accessor","views/MapView","geometry/SpatialReference","core/reactiveUtils","applications/Components/OrientedImageryViewer/ImageViewer/utils","layers/support/TileInfo","Graphic","layers/GraphicsLayer",a)
2
+ import a from"./P6CDJ2IV.js";import"./VJVKFKSG.js";import{a as C}from"./JP24H6WY.js";import"./Z7J6NDSB.js";import"./VWED2WAO.js";import"./QUZTFUWM.js";import"./RZ6SODVT.js";import{M as f,N as v,O as w,U as L,a as g,b as _,p as y,z as u}from"./CDSRIIHC.js";import"./H6RQVSYM.js";export default $arcgis.t(([{property:c,subclass:M},b,,G,{watch:m},{rotateDimensions:P,registerPanConstraint:I},O,,z,{b:d}])=>{var x=g`:host{height:100%;--arcgis-view-color-focus: none}`,A=Object.defineProperty,E=Object.getOwnPropertyDescriptor,h=(t,e,r,i)=>{for(var a=i>1?void 0:i?E(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(a=(i?o(e,r,a):o(a))||a);return i&&a&&A(e,r,a),a},n=class extends b{constructor(t){super(t),this.autoLoad=!1}static isNonPanoramicMedia(t){return!!t&&typeof t=="object"&&"declaredClass"in t&&typeof t.declaredClass=="string"&&t.declaredClass==="components.oriented-imagery-viewer.support.NonPanoramicMedia"}destroy(){this._cache?.destroy(),this._cache=void 0}get layer(){return this._cache}get size(){if(!this._cache||this._cache.destroyed||this._cache.loadError||!this._cache.serviceRasterInfo)return;let{serviceRasterInfo:t}=this._cache;return[t.width,t.height]}async load(t){if(this._cache&&!this._cache.destroyed)return await this._cache.load(t),{layer:this._cache,size:this.size};let{url:e,customParameters:r}=this,i=this.datasetFormat;if(!e)throw new Error("URL is required to load NonPanoramicMedia.");if(!i){let o=await import("./A5XIQWD5.js").then(m=>m.default);if(d(t),i=o.guessExtensionFromURI(e),!i){try{i=await o.getDatasetFormat(e)}catch{y("warn",this,"Failed to determine dataset format from URL or response headers."),i="UNKNOWN FORMAT"}d(t)}}this.datasetFormat=i;let a=(await $arcgis.t(m=>m[0],"layers/ImageryTileLayer")).default;d(t);let s=new a({url:e,ioConfig:{skipExtensions:["aux.xml","jgw"],skipMapInfo:!0,datasetFormat:i},customParameters:r??void 0});return await s.load(t),d(t),this._cache=s,{layer:this._cache,size:this.size}}};h([c()],n.prototype,"_cache",2);h([c()],n.prototype,"autoLoad",2);h([c()],n.prototype,"customParameters",2);h([c()],n.prototype,"datasetFormat",2);h([c()],n.prototype,"url",2);h([c()],n.prototype,"layer",1);h([c()],n.prototype,"size",1);n=h([M("components.oriented-imagery-viewer.support.NonPanoramicMedia")],n);function F(t,e,r,i,a){let{width:s,height:o}=P(t,e,a);return Math.max(s/r,o/i)}var N=96,$=39.37,R=$*N;function j(t){let e=R*.25,r=R*t,i=[],a=r;for(;a>e;)i.push(a),a*=.5;i.push(e);let{lods:s}=O.create({scales:i});return{minScale:r,lods:s}}var l=class extends u{get graphics(){return this._graphicsLayer?.graphics}_ensureGraphicsLayer(){(!this._graphicsLayer||this._graphicsLayer.destroyed)&&(this._graphicsLayer=new z({title:"Overlays",listMode:"hide",visible:!0,blendMode:"source-atop"}))}hostLoaded(){this._ensureGraphicsLayer(),this.component.manager.onLifecycle(()=>[m(()=>this.component?.map,(e,r)=>{r?.layers.remove(this._graphicsLayer),e&&e?.layers.add(this._graphicsLayer)},{initial:!0,sync:!0}),m(()=>this.component?.map?.allLayers.length,e=>{e&&this.component?.map?.layers.reorder(this._graphicsLayer,e-1)},{initial:!0,sync:!0})])}addGraphic(e){this._graphicsLayer.add(e)}addGraphics(e){this._graphicsLayer.addMany(e)}removeGraphic(e){this._graphicsLayer?.destroyed||this._graphicsLayer.remove(e)}removeGraphics(e){this._graphicsLayer?.destroyed||this._graphicsLayer.removeMany(e)}clearGraphics(){this._graphicsLayer?.destroyed||this._graphicsLayer.removeAll()}destroy(){this._graphicsLayer?.destroy()}},p=class extends w{constructor(){super(...arguments),this._messages=C(),this._graphicsController=new l(this),this._imageChanged=!1,this._internalMap=f(),this._loading=!1,this.hideHeader=!1,this.hideLoader=!1,this.hideZoomControls=!1,this.rotation=0}static{this.properties={_imageChanged:16,_internalMap:16,_image:16,_loading:16,_media:16,hideHeader:5,hideLoader:5,hideZoomControls:5,messageOverrides:0,media:0,rotation:9}}static{this.styles=[x]}get imageRenderer(){return this._internalMap?.value?.view}get map(){return this.imageRenderer?.map}get media(){return this._media}set media(e){if(!e){this._mediaAbortController?.abort(),this._media=void 0,this._clearImage();return}this._media=e instanceof n?e:new n(e)}addGraphic(e){this._graphicsController.addGraphic(e)}addGraphics(e){this._graphicsController.addGraphics(e)}clearGraphics(){this._graphicsController.clearGraphics()}async mediaOnLoad(){return this._mediaPromise&&await this._mediaPromise,this._media}removeGraphic(e){this._graphicsController.removeGraphic(e)}removeGraphics(e){this._graphicsController.removeGraphics(e)}loaded(){this.manager.onLifecycle(()=>[this._createResizeConstraint(),this._createRotationHandler(),this._createPanConstraint(),m(()=>this._media,e=>{this._mediaAbortController?.abort(),e&&(this._mediaAbortController=new AbortController,this._mediaPromise=this._loadMediaInternal(e,this._mediaAbortController))},{initial:!0,sync:!0})])}_createPanConstraint(){return m(()=>({image:this._image,imageRenderer:this.imageRenderer}),({image:e,imageRenderer:r})=>{!e||!r?.ready||I(r,e)},{sync:!0,initial:!0})}_createResizeConstraint(){return m(()=>{if(!this.imageRenderer?.ready||!this._image)return;let{width:e,height:r}=this._image.serviceRasterInfo,{width:i,height:a,rotation:s}=this.imageRenderer;return F(e,r,i,a,s)},e=>{if(!e||!this.imageRenderer)return;let{constraints:r,scale:i}=this.imageRenderer,a=r.minScale,{lods:s,minScale:o}=j(e);r.set({minScale:o,lods:s}),this.imageRenderer.scale=this._imageChanged||Math.abs(i-a)<=1e-6?o:i,this._imageChanged=!1},{sync:!0,initial:!0})}_createRotationHandler(){return m(()=>this.rotation,e=>{this.imageRenderer&&(this.imageRenderer.constraints.rotationEnabled=!0,this.imageRenderer.rotation=e,this.imageRenderer.constraints.rotationEnabled=!1)},{sync:!0,initial:!0})}_clearImage(){this._image?.destroy(),this._image=void 0}async _loadMediaInternal(e,r){if(this._loading=!0,this._clearImage(),!e)throw new Error("No media provided");let{layer:i}=await e.load(r).finally(()=>{this._loading=!1});d(r),this._imageChanged=!0,this._image=i,this.imageRenderer?.map?.layers.add(this._image)}render(){return _`<calcite-panel .loading=${this.hideLoader?void 0:this._loading} .heading=${this.hideHeader?void 0:this._messages.title}><arcgis-map hide-attribution .spatialReference=${G.WebMercator} ${v(this._internalMap)}><arcgis-zoom .hidden=${this.hideZoomControls} .messageOverrides=${this.messageOverrides} slot=top-left></arcgis-zoom></arcgis-map></calcite-panel>`}};L("arcgis-oriented-imagery-viewer-image-viewer",p);return p},"core/accessorSupport/decorators","core/Accessor","views/MapView","geometry/SpatialReference","core/reactiveUtils","applications/Components/OrientedImageryViewer/ImageViewer/utils","layers/support/TileInfo","Graphic","layers/GraphicsLayer",a)
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import l from"./NSF5Q73E.js";import j from"./2JBFSC6D.js";import{a as q}from"./JCRPP54Z.js";import{a as N,b as x,g as S,h as G,m as $}from"./LDDAJOTV.js";import{a as D}from"./EUCWM5S7.js";import{a as _}from"./O5T75PGZ.js";import i from"./X6PWBP6M.js";import h from"./MZWO5JYA.js";import g from"./P6CDJ2IV.js";import"./VJVKFKSG.js";import f from"./SYRZLONH.js";import{a as k}from"./JP24H6WY.js";import{a as p}from"./JD74LG7K.js";import e from"./V6VLUKHQ.js";import c from"./7MO7E734.js";import{g as E}from"./Z7J6NDSB.js";import"./VWED2WAO.js";import a from"./3MWUCGFA.js";import"./QUZTFUWM.js";import{d as R}from"./RZ6SODVT.js";import{B as T,M as P,N as m,O,P as u,R as b,S as v,U as A,b as r,x as d}from"./CDSRIIHC.js";import"./H6RQVSYM.js";export default $arcgis.t(([{createReactiveMap:z},I,{on:C,watch:V},W,X,{h:f},,,B,,,,,{a:H,b:U,c:j}])=>{var g=q,Y=y=>{let e=y?.type;return e==="knowledge-graph"||e==="map-image"||e==="tile"},Z=y=>y?.type==="catalog",J="nested",ee=I.ofType(X),te=B(W),F=class extends O{constructor(){super(...arguments),this._rootGroupUid=`operational-${T()}`,this._openedLayersController=null,this._rootListRef=P(),this._destroying=!1,this._destroyed=!1,this.messages=k(),this._clearActiveItem=()=>{this._activeItem=null},this._setActiveItem=e=>{if(this.visibilityAppearance!=="default")return;let t=Array.from(e.composedPath()).find(s=>s.classList?.contains(g.item));this._activeItem=$(t)},this._tooltipReferenceMap=z(),this._layerListMap=z(),this._setPanelFlowItemRef=e=>{e&&this._focusPanelFlowItemNode(e)},this._setRootFlowItemRef=e=>{e&&this._focusRootFlowItemNode(e)},this._setLayerFlowItemRef=e=>{e&&this._focusLayerFlowItemNode(e)},this.viewModel=te(this),this._activeItem=null,this._focusRootFlowItem=!1,this._focusPanelFlowItem=!1,this._focusLayerFlowItem=null,this.layerTablesEnabled=new I(["knowledge-graph"]),this.mapImageOptions=null,this.tileOptions=null,this.view=this.viewModel.view,this.hideCatalogLayerList=!1,this.showCloseButton=!1,this.showCollapseButton=!1,this.showErrors=!1,this.showFilter=!1,this.showHeading=!1,this.hideStatusIndicators=!1,this.showTemporaryLayerIndicators=!1,this.closed=!1,this.topLayerDisabled=!1,this.autoDestroyDisabled=!1,this.state=this.viewModel.state,this.openedLayers=new I,this.openedLayerLists=new I,this.collapsed=!1,this.filterPlaceholder="",this.filterText="",this.headingLevel=2,this.listItemCreatedFunction=this.viewModel.listItemCreatedFunction,this.minFilterItems=x,this.selectedItems=new ee,this.selectionMode="none",this.visibilityAppearance="default",this.arcgisPropertyChange=E()("state"),this.arcgisReady=d(),this.arcgisCatalogItemsChange=d(),this.arcgisFilterChange=d(),this.arcgisSelectedItemsChange=d(),this.arcgisOpenedLayersChange=d()}static{this.properties={_catalogLayerList:16,_activeItem:16,_focusRootFlowItem:16,_focusPanelFlowItem:16,_focusLayerFlowItem:16,_totalItems:16,_filterEnabled:16,_visibleItems:16,_openedPanelItems:16,_renderedOpenLayerFlowItems:16,layerTablesEnabled:16,mapImageOptions:16,tileOptions:16,view:0,hideCatalogLayerList:5,showCloseButton:5,showCollapseButton:5,showErrors:5,showFilter:5,showHeading:5,hideStatusIndicators:5,showTemporaryLayerIndicators:5,closed:5,topLayerDisabled:5,autoDestroyDisabled:5,referenceElement:1,state:32,openedLayers:32,openedLayerLists:32,catalogItems:0,catalogLayer:0,catalogOptions:0,collapsed:5,filterPlaceholder:1,filterPredicate:0,filterText:1,headingLevel:9,knowledgeGraphOptions:0,label:1,listItemCreatedFunction:0,minFilterItems:9,selectedItems:0,selectionMode:1,visibilityAppearance:1,messageOverrides:0,onCatalogOpen:0,onTablesOpen:0}}static{this.styles=[j,U]}get _totalItems(){return this.catalogItems?.flatten(e=>e.children.filter(t=>t.layer?.type!=="catalog-dynamic-group")).length??0}get _filterEnabled(){return this._totalItems>=this.minFilterItems&&this.showFilter}get _visibleItems(){return this.catalogItems?.filter(e=>!e.hidden&&(this.showErrors||!e.error))}get _openedPanelItems(){return this._visibleItems.flatten(e=>e.children).filter(({hidden:e,panel:t})=>!e&&t?.open&&!t.disabled&&t.flowEnabled)}get _renderedOpenLayerFlowItems(){let{openedLayers:e}=this;return e.toArray().map((t,s)=>this._renderLayerFlowItem(t,s===e.length-1))}get catalogItems(){return this.viewModel.catalogItems}set catalogItems(e){this.viewModel.catalogItems=e}get catalogLayer(){return this.viewModel.catalogLayer}set catalogLayer(e){this.viewModel.catalogLayer=e}async destroy(){this._destroying||this._destroyed||(this._destroying=!0,this._openedLayersController?.abort(),this._openedLayersController=null,await this.manager.destroy(),this.openedLayerLists.removeAll(),this.openedLayers.removeAll(),this._layerListMap.clear(),this._tooltipReferenceMap.clear(),this._destroyed=!0,this._destroying=!1)}loaded(){this.manager.onLifecycle(()=>[C(()=>this.openedLayers,"change",()=>{this._handleOpenedLayersChange()}),C(()=>this.viewModel.catalogItems,"change",()=>{S(this.selectedItems),this.arcgisCatalogItemsChange.emit()}),C(()=>this.selectedItems,"change",()=>this.arcgisSelectedItemsChange.emit()),V(()=>[this.filterPredicate,this._rootListRef.value],()=>G(this._rootListRef.value,this.filterPredicate))])}disconnectedCallback(){super.disconnectedCallback(),this._openedLayersController?.abort(),this._openedLayersController=null,!this.autoDestroyDisabled&&!this._destroyed&&!this._destroying&&this.destroy()}loadDependencies(){}triggerAction(e,t){return this.viewModel.triggerAction(e,t)}async _createFlowList(e,t){let{_layerListMap:s}=this,i=s.get(e);if(i)return i;let a=e.type==="catalog"?await this._createCatalogLayerList(e):await this._createTableList(e);return t.aborted||!this.isConnected||this._destroyed?(a?.destroy?.(),a):(t.aborted||s.set(e,a),a)}async _handleOpenedLayersChange(){if(!this.isConnected||this._destroyed)return;let{_layerListMap:e,openedLayers:t,openedLayerLists:s}=this;this._openedLayersController?.abort();let i=new AbortController,{signal:a}=i;this._openedLayersController=i,e.forEach((c,h)=>{t.includes(h)||(c?.destroy?.(),e.delete(h))});let o=await Promise.all(t.map(c=>this._createFlowList(c,a)));if(a.aborted||!this.isConnected||this._destroyed)return;s.removeAll(),s.addMany(o);let l=s.at(-1),n=l&&"catalogLayer"in l?l:void 0;this._catalogLayerList!==n&&(this._catalogLayerList=n),this.arcgisOpenedLayersChange.emit()}_handlePanelFlowItemBack(e){e.open=!1,this._focusRootFlowItem=!0}_focusRootFlowItemNode(e){this._focusRootFlowItem&&(this._focusRootFlowItem=!1,f(e))}_focusPanelFlowItemNode(e){this._focusPanelFlowItem&&(this._focusPanelFlowItem=!1,f(e))}_focusLayerFlowItemNode(e){this._focusLayerFlowItem===e.dataset.layerUid&&(this._focusLayerFlowItem=null,f(e))}async _createCatalogLayerList(e){let{headingLevel:t,catalogOptions:s,view:i,referenceElement:a,filterPlaceholder:o,listItemCreatedFunction:l,minFilterItems:n,selectionMode:c,visibilityAppearance:h}=this;return v(r`<arcgis-catalog-layer-list-next .headingLevel=${t} .filterPlaceholder=${s?.filterPlaceholder??o} .listItemCreatedFunction=${s?.listItemCreatedFunction??l} .minFilterItems=${s?.minFilterItems??n} .selectionMode=${s?.selectionMode??c} .visibilityAppearance=${s?.visibilityAppearance??h} .showErrors=${s?.visibleElements?.errors??this.showErrors} .showFilter=${s?.visibleElements?.filter??this.showFilter} .hideStatusIndicators=${s?.visibleElements?.statusIndicators??this.hideStatusIndicators} .showTemporaryLayerIndicators=${s?.visibleElements?.temporaryLayerIndicators??this.showTemporaryLayerIndicators} .messageOverrides=${this.messageOverrides} @arcgisReady=${w=>w.stopPropagation()} .catalogLayer=${e} .view=${i} .referenceElement=${a} @catalogOpen=${this._onCatalogOpen} @tablesOpen=${this._onTablesOpen}></arcgis-catalog-layer-list-next>`)}_getTableListParams(e){switch(e.type){case"knowledge-graph":return{...this.knowledgeGraphOptions,tables:e.tables};case"map-image":return{...this.mapImageOptions,tables:e.subtables};case"tile":return{...this.tileOptions,tables:e.subtables};default:return null}}async _createTableList(e){let{headingLevel:t,selectionMode:s,referenceElement:i,view:a}=this,o=this._getTableListParams(e);return v(r`<arcgis-table-list .headingLevel=${o?.headingLevel??t} .selectionMode=${o?.selectionMode??s} .collapsed=${o?.collapsed} .filterPlaceholder=${o?.filterPlaceholder} .filterText=${o?.filterText} .label=${o?.label} .tables=${o?.tables} .view=${a} .referenceElement=${i} @arcgisReady=${l=>l.stopPropagation()}></arcgis-table-list>`)}_onTablesOpen(e){if(this.onTablesOpen){this.onTablesOpen(e);return}let t=e.layer;Y(t)&&(this.openedLayers.push(t),this._focusLayerFlowItem=t.uid)}_onCatalogOpen(e){if(this.onCatalogOpen){this.onCatalogOpen(e);return}let t=e.layer?.parent;Z(t)&&(this.openedLayers.push(t),this._focusLayerFlowItem=e.layer?.uid)}_onTooltipReferenceChange(e,t){t?this._tooltipReferenceMap.set(e,t):this._tooltipReferenceMap.delete(e)}_onTriggerAction(e,t){this.triggerAction(e,t)}_handleCalciteListChange(e){let{selectionMode:t,selectedItems:s}=this;if(t==="none")return;let i=e.target.selectedItems.map(a=>$(a)).filter(Boolean);s.removeAll(),s.addMany(i)}render(){let{state:e}=this,t={[p.hidden]:e==="loading",[p.disabled]:e==="disabled"};return r`<div class=${u(R(p.widget,p.panel,t))}>${this._visibleItems?.length?this._renderItemTooltips():null}${this._renderItems()}</div>`}_renderItemTooltip(e){let{_tooltipReferenceMap:t,messages:s}=this;return e?.layer?r`<calcite-tooltip overlay-positioning=fixed .referenceElement=${t.get(e.layer.uid)} .topLayerDisabled=${this.topLayerDisabled}>${s.layerIncompatibleTooltip}</calcite-tooltip>`:null}_renderItemTooltipNodes(e){return e.incompatible?this._renderItemTooltip(e):e.children?.filter(t=>!t.hidden).toArray().map(t=>this._renderItemTooltipNodes(t))}_renderItemTooltips(){return this._visibleItems?.toArray().map(e=>this._renderItemTooltipNodes(e))}_renderNoItemsMessage(){return r`<div slot=message>${this.messages.noItemsToDisplay}</div>`}_renderNoItems(){return r`<div class=${u(g.itemMessage)}><calcite-notice icon=information kind=info open width=full>${this._renderNoItemsMessage()}</calcite-notice></div>`}_renderPanelFlowItems(){let{_openedPanelItems:e,openedLayers:t}=this;return D(e.toArray(),({uid:s})=>s,(s,i)=>{let{uid:a,title:o,panel:l}=s,n=()=>this._handlePanelFlowItemBack(l);return r`<calcite-flow-item .description=${o} .heading=${l.title} .headingLevel=${this.headingLevel} .selected=${!t.length&&i===e.length-1} @calciteFlowItemBack=${c=>{c.preventDefault(),n()}} ${m(this._setPanelFlowItemRef)}><arcgis-layer-list-item-panel .item=${s} .view=${this.view}></arcgis-layer-list-item-panel><calcite-button appearance=transparent slot=footer-actions width=full @click=${n}>Back</calcite-button></calcite-flow-item>`})}_renderItems(){let{collapsed:e,_visibleItems:t,_filterEnabled:s,_rootGroupUid:i,showCloseButton:a,showCollapseButton:o,showHeading:l,selectionMode:n,filterText:c,filterPlaceholder:h,openedLayers:w,_openedPanelItems:K}=this,M=this.label??this.messages.componentLabel??"",Q=[r`<calcite-flow-item .closable=${a} .closed=${this.closed} .collapsed=${e} .collapsible=${o} .heading=${l?M:void 0} .headingLevel=${this.headingLevel} .selected=${!w.length&&!K.length} @calciteFlowItemClose=${()=>this.closed=!0} ${m(this._setRootFlowItemRef)}>${t?.length?r`<calcite-list data-layer-type=${i??b} .displayMode=${J} .filterEnabled=${s} .filterPlaceholder=${h} .filterProps=${N} .filterText=${s?c:""} .group=${i} .label=${M} @focusin=${this._setActiveItem} @focusout=${this._clearActiveItem} selection-appearance=border .selectionMode=${n} @calciteListChange=${this._handleCalciteListChange} @calciteListFilter=${L=>{this.filterText=L.currentTarget?.filterText??"",this.arcgisFilterChange.emit()}} @mouseleave=${this._clearActiveItem} @mouseover=${this._setActiveItem} ${m(this._rootListRef)}>${t.toArray().map(L=>this._renderItem(L))}${s?r`<div class=${u(g.filterNoResults)} slot=filter-no-results><calcite-notice kind=info open width=full>${this._renderNoItemsMessage()}</calcite-notice></div>`:null}</calcite-list>`:this._renderNoItems()}</calcite-flow-item>`,this._renderPanelFlowItems(),this._renderedOpenLayerFlowItems];return this.closed?null:_("root-flow",r`<calcite-flow>${Q}</calcite-flow>`)}_renderLayerFlowItem(e,t){let{messages:s,openedLayers:i}=this,a=e.title||this.messages.untitledLayer;return _(e.uid,r`<calcite-flow-item data-layer-uid=${e.uid??b} .description=${a} .heading=${s[e.type==="catalog"?"catalogLayers":"tables"]} .headingLevel=${this.headingLevel} .selected=${t} @calciteFlowItemBack=${o=>{o.preventDefault(),i.pop();let l=i.at(-1);l?this._focusLayerFlowItem=l.uid:this._focusRootFlowItem=!0}} ${m(this._setLayerFlowItemRef)}>${this._layerListMap.get(e)}</calcite-flow-item>`)}_renderItem(e,t,s){let{hideStatusIndicators:i,showCloseButton:a,showCollapseButton:o,showErrors:l,showFilter:n,showHeading:c,showTemporaryLayerIndicators:h}=this;return _(e.uid,H({activeItem:this._activeItem??void 0,css:{...g,itemCatalogIcon:g.itemActionIcon},displayMode:J,dragEnabled:!1,item:e,layerTablesEnabled:this.layerTablesEnabled,listModeDisabled:this.viewModel.listModeDisabled,messages:this.messages,parent:t,parentTitles:s,rootGroupUid:this._rootGroupUid,selectedItems:this.selectedItems,selectionMode:this.selectionMode,visibilityAppearance:this.visibilityAppearance,hideStatusIndicators:i,showCloseButton:a,showCollapseButton:o,showErrors:l,showFilter:n,showHeading:c,showTemporaryLayerIndicators:h,handleAction:this._onTriggerAction,handleCatalogOpen:this._onCatalogOpen,handleTablesOpen:this._onTablesOpen,handleTooltipReferenceChange:this._onTooltipReferenceChange,view:this.view}))}};A("arcgis-catalog-layer-list-next",F);return F},"applications/Components/featureUtils","core/Collection","core/reactiveUtils","widgets/CatalogLayerList/CatalogLayerListViewModel","widgets/LayerList/ListItem",a,c,e,f,g,h,i,j,l)
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{a as o}from"./POKO37D3.js";import{N as h,O as p,R as a,U as g,a as l,b as i,x as r}from"./CDSRIIHC.js";import"./H6RQVSYM.js";var d=l`:host{--arcgis-unit-select-inline-size: 180px}calcite-popover[calcite-hydrated-hidden]{inset-block-start:-999999px;inset-inline-start:-999999px}.popover-content{display:flex;flex-direction:column;gap:var(--calcite-spacing-md);padding:var(--calcite-spacing-md);max-width:300px}.uniform-chart-scaling-label{--calcite-label-margin-bottom: 0}.uniform-chart-scaling-checkbox-wrapper{width:var(--arcgis-unit-select-inline-size);flex-shrink:0}.slot-content{display:flex;flex-direction:column;gap:var(--calcite-spacing-sm)}.slot-content ::slotted(*){max-inline-size:100%}`,c=class extends p{constructor(){super(...arguments),this._onUniformChartScalingChange=e=>{this.arcgisElevationProfileSettingsUniformChartScalingChange.emit(e.currentTarget.checked)},this._onActionRef=e=>{this._actionElement=e??void 0},this._popoverIsOpen=!1,this.hideDistanceDisplayUnitSelect=!1,this.hideElevationDisplayUnitSelect=!1,this.hideUniformChartScalingToggle=!1,this.hasCustomStartContent=!1,this.hasCustomEndContent=!1,this.arcgisElevationProfileSettingsUniformChartScalingChange=r()}static{this.properties={_popoverIsOpen:16,_actionElement:16,viewModel:0,hideDistanceDisplayUnitSelect:5,hideElevationDisplayUnitSelect:5,hideUniformChartScalingToggle:5,hasCustomStartContent:5,hasCustomEndContent:5,messages:0,uniformChartScaling:5,unitOptionsDistance:0,unitOptionsElevation:0,messageOverrides:0}}static{this.styles=d}async destroy(){await this.manager.destroy()}_onPopoverClose(){this._popoverIsOpen=!1}_onPopoverOpen(){this._popoverIsOpen=!0}render(){let{messages:e}=this;if(!e||!this.hasCustomStartContent&&!this.hasCustomEndContent&&this.hideDistanceDisplayUnitSelect&&this.hideElevationDisplayUnitSelect&&this.hideUniformChartScalingToggle)return;let t=(this._popoverIsOpen?e.hideSettings:e.showSettings)??"";return i`<calcite-action icon=gear .text=${t} title=${t??a} ${h(this._onActionRef)}></calcite-action>${this._actionElement?i`<calcite-popover auto-close .label=${t} placement=bottom-end .referenceElement=${this._actionElement} @calcitePopoverOpen=${this._onPopoverOpen} @calcitePopoverClose=${this._onPopoverClose}><div class="popover-content">${this._renderCustomContent("settings-start",this.hasCustomStartContent)}${this._renderUnitSelector()}${this._renderUniformChartScalingToggle()}${this._renderCustomContent("settings-end",this.hasCustomEndContent)}</div></calcite-popover>`:void 0}`}_renderUnitSelector(){let{viewModel:e,messages:t}=this;if(!e||this.hideDistanceDisplayUnitSelect&&this.hideElevationDisplayUnitSelect)return;let n="inline-space-between";return i`${o({hidden:this.hideDistanceDisplayUnitSelect,children:i`<arcgis-unit-select .options=${this.unitOptionsDistance} .selectLabel=${t.unitDistanceSelectLabel} .value=${e.distanceUnit} .layout=${n} .messageOverrides=${this.messageOverrides} @arcgisUnitSelectChange=${s=>{e.distanceUnit=s.detail}}></arcgis-unit-select>`})}${o({hidden:this.hideElevationDisplayUnitSelect,children:i`<arcgis-unit-select .options=${this.unitOptionsElevation} .selectLabel=${t.unitElevationSelectLabel} .value=${e.elevationUnit} .layout=${n} .messageOverrides=${this.messageOverrides} @arcgisUnitSelectChange=${s=>{e.elevationUnit=s.detail}}></arcgis-unit-select>`})}`}_renderUniformChartScalingToggle(){let{messages:e,hideUniformChartScalingToggle:t,uniformChartScaling:n}=this;if(t)return;let s=e?.[n?"uniformChartScalingDisable":"uniformChartScalingEnable"]??"";return i`<calcite-label class="uniform-chart-scaling-label" layout=inline-space-between>${e?.uniformChartScalingLabel}<div class="uniform-chart-scaling-checkbox-wrapper"><calcite-checkbox .checked=${n} title=${s??a} @calciteCheckboxChange=${this._onUniformChartScalingChange}></calcite-checkbox></div></calcite-label>`}_renderCustomContent(e,t){if(t)return i`<div class="slot-content"><slot name=${e??a}></slot></div>`}};g("arcgis-elevation-profile-settings",c);export{c as ArcgisElevationProfileSettings};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import"./XEK22IDA.js";import r from"./NSF5Q73E.js";import o from"./2JBFSC6D.js";import"./5USS47OO.js";import{a as p}from"./JCRPP54Z.js";import{a as H,b as j,c as q,g as z,h as J,j as K,k as Q,m as c,n as F}from"./LDDAJOTV.js";import{a as G}from"./EUCWM5S7.js";import{a as b}from"./O5T75PGZ.js";import n from"./X6PWBP6M.js";import l from"./MZWO5JYA.js";import i from"./P6CDJ2IV.js";import"./VJVKFKSG.js";import h from"./SYRZLONH.js";import{a as k}from"./JP24H6WY.js";import{a as w}from"./JD74LG7K.js";import{a as N}from"./IVZM7EPG.js";import g from"./V6VLUKHQ.js";import e from"./7MO7E734.js";import{g as B}from"./Z7J6NDSB.js";import"./VWED2WAO.js";import a from"./3MWUCGFA.js";import"./QUZTFUWM.js";import{d as x}from"./RZ6SODVT.js";import{B as P,M as L,N as f,O as D,P as v,R as E,S as M,U as R,b as d,x as m}from"./CDSRIIHC.js";import"./H6RQVSYM.js";export default $arcgis.t(([te,g,{on:A,watch:ie},,,{a:U},S,,,,,{a:V,b:W,c:X}])=>{var Y="nested",se=S(te),T=class extends D{constructor(){super(...arguments),this._lastDragDetail=null,this._rootListRef=L(),this._layerFlowItemRef=L(),this._panelFlowItemRef=L(),this._selectedDragItemLayerUid=null,this._rootGroupUid=`operational-${P()}`,this._openedLayersController=null,this.messages=k(),this._canMove=({dragEl:e,fromEl:t,toEl:i},a)=>{let s=a==="pull"?this.listItemCanGiveFunction:this.listItemCanReceiveFunction,r=c(e,this.operationalItems);if(!r?.sortable)return!1;let l=this._resolveListContainer(t),o=this._resolveListContainer(i),n=this._getContainerItem(l),y=F(l),u=this._getContainerItem(o),_=F(o),$=!!y&&!!_&&y===_,I={selected:r,from:n,to:u},C=l?.group,h=o?.group,Z=n?.layer?.type??"",ee=u?.layer?.type??"",O=new Set(["map-image","catalog","knowledge-graph"]);return C&&h&&typeof s=="function"?s(I):$&&!O.has(Z)&&!O.has(ee)&&r?.layer?.type!=="sublayer"},this._onCatalogOpen=e=>{this.openedLayers.push(e.layer?.parent)},this._onTablesOpen=e=>{this.openedLayers.push(e.layer)},this._clearActiveItem=()=>{this._activeItem=null},this._setCurrentActiveItem=e=>{this._activeItem=e},this._setActiveItem=e=>{if(this.visibilityAppearance!=="default")return;let t=Array.from(e.composedPath()).find(a=>a.classList?.contains(p.item)),i=c(t,this.operationalItems);this._activeItem=i},this.viewModel=se(this),this.arcgisClose=N(this),this._activeItem=null,this._onTooltipReferenceChange=(e,t)=>{t?this._tooltipReferenceMap.set(e,t):this._tooltipReferenceMap.delete(e)},this._onSelectedDragItemLayerUidChange=e=>{this._selectedDragItemLayerUid=e},this._onTriggerAction=(e,t)=>{this.triggerAction(e,t)},this._tooltipReferenceMap=new Map,this._layerListMap=new Map,this.layerTablesEnabled=new g(["knowledge-graph"]),this.mapImageOptions=null,this.openedLayerLists=new g,this.tileOptions=null,this.view=this.viewModel.view,this.autoDestroyDisabled=!1,this.closed=!1,this.icon="layers",this.collapsed=!1,this.dragEnabled=!1,this.filterPlaceholder="",this.filterText="",this.headingLevel=2,this.layerTablesAvailable=new g(["knowledge-graph"]),this.listItemCreatedFunction=this.viewModel.listItemCreatedFunction,this.minDragEnabledItems=q,this.minFilterItems=j,this.openedLayers=new g,this.operationalItems=this.viewModel.operationalItems,this.selectedItems=new g,this.selectionMode="none",this.visibilityAppearance="default",this.hideCatalogLayerList=!1,this.showCloseButton=!1,this.showCollapseButton=!1,this.showErrors=!1,this.showFilter=!1,this.showHeading=!1,this.hideStatusIndicators=!1,this.showTemporaryLayerIndicators=!1,this.state=this.viewModel.state,this.arcgisPropertyChange=B()("state"),this.arcgisReady=m(),this.arcgisFilterChange=m(),this.arcgisSelectedItemsChange=m(),this.arcgisOpenedLayersChange=m(),this.arcgisTriggerAction=U(()=>this.viewModel,"trigger-action")}static{this.properties={_catalogLayerList:16,_tableList:16,_tooltipReferenceMap:16,_layerListMap:16,_totalItems:16,_visibleItems:16,_openedPanelItems:16,_dragEnabled:16,_filterEnabled:16,layerTablesEnabled:16,mapImageOptions:16,openedLayerLists:16,tileOptions:16,_renderedOpenLayerFlowItems:16,view:0,autoDestroyDisabled:5,closed:5,referenceElement:1,icon:1,catalogLayerList:32,catalogOptions:0,collapsed:5,dragEnabled:5,filterPlaceholder:1,filterPredicate:0,filterText:1,headingLevel:9,knowledgeGraphOptions:0,layerTablesAvailable:0,listItemCanGiveFunction:0,listItemCanReceiveFunction:0,listItemCreatedFunction:0,minDragEnabledItems:9,minFilterItems:9,openedLayers:32,operationalItems:0,selectedItems:0,selectionMode:1,tableList:32,visibilityAppearance:1,hideCatalogLayerList:5,showCloseButton:5,showCollapseButton:5,showErrors:5,showFilter:5,showHeading:5,hideStatusIndicators:5,showTemporaryLayerIndicators:5,messageOverrides:0,label:1,state:32}}static{this.styles=[X,W]}get _totalItems(){return this.viewModel.operationalItems.flatten(e=>e.children.filter(t=>t.layer?.type!=="catalog-dynamic-group")).length}get _visibleItems(){return this.operationalItems?.filter(e=>!e.hidden&&(this.showErrors||!e.error))}get _openedPanelItems(){return this._visibleItems.flatten(e=>e.children).filter(({hidden:e,panel:t})=>!e&&t?.open&&!t.disabled&&t.flowEnabled)}get _dragEnabled(){return this._totalItems>=this.minDragEnabledItems&&this.dragEnabled}get _filterEnabled(){return this._totalItems>=this.minFilterItems&&this.showFilter}get _renderedOpenLayerFlowItems(){let{openedLayers:e}=this;return e.toArray().map((t,i)=>this._renderLayerFlowItem(t,i===e.length-1))}get catalogLayerList(){return this._catalogLayerList}get tableList(){return this._tableList}async destroy(){await this.manager.destroy(),this._destroyOpenedLayerLists(),this._tooltipReferenceMap.clear()}loaded(){this.manager.onLifecycle(()=>[A(()=>this.openedLayers,"change",()=>{this._handleOpenedLayersChange()},{initial:!0}),A(()=>this.viewModel.operationalItems,"change",()=>z(this.selectedItems),{initial:!0}),A(()=>this.selectedItems,"change",()=>this.arcgisSelectedItemsChange.emit()),ie(()=>[this.filterPredicate,this._rootListRef.value],()=>J(this._rootListRef.value,this.filterPredicate,this.operationalItems))])}triggerAction(e,t){return this.viewModel.triggerAction(e,t)}_resolveListContainer(e){return e?e.matches("calcite-list")?e:e.closest("calcite-list[data-item]")||(this._rootListRef.value?.contains(e)?this._rootListRef.value:null):null}_getContainerItem(e){let t=e?.getAttribute("data-item");return t?this._findItemByUid(t):null}_findItemByUid(e){let t=this.operationalItems?.toArray()??[];for(;t.length;){let i=t.shift();if(!i)continue;if(i.uid===e)return i;let a=i.children?.toArray()??[];t.push(...a)}return null}async _createFlowList(e,t){let{_layerListMap:i}=this,a=i.get(e);if(a)return a;let s=e.type==="catalog"?await this._createCatalogLayerList(e):await this._createTableList(e);return t.aborted||i.set(e,s),s}async _handleOpenedLayersChange(){let{_layerListMap:e,openedLayers:t,openedLayerLists:i}=this;this._openedLayersController?.abort();let a=new AbortController,{signal:s}=a;this._openedLayersController=a,e.forEach((o,n)=>{t.includes(n)||(o?.destroy?.(),e.delete(n))});let r=await Promise.all(t.map(o=>this._createFlowList(o,s)));if(s.aborted)return;i.removeAll(),i.addMany(r);let l=i.at(-1);l?"catalogLayer"in l?(this._catalogLayerList=l,this._tableList=void 0):(this._catalogLayerList=void 0,this._tableList=l):(this._catalogLayerList=void 0,this._tableList=void 0),this.arcgisOpenedLayersChange.emit()}_destroyOpenedLayerLists(){this.openedLayerLists.destroyAll(),this.openedLayers.removeAll(),this._layerListMap.clear()}async _createCatalogLayerList(e){let{headingLevel:t,catalogOptions:i,filterPlaceholder:a,listItemCreatedFunction:s,minFilterItems:r,selectionMode:l,visibilityAppearance:o}=this;return M(d`<arcgis-catalog-layer-list-next .headingLevel=${t} .filterPlaceholder=${i?.filterPlaceholder??a} .listItemCreatedFunction=${i?.listItemCreatedFunction??s} .minFilterItems=${i?.minFilterItems??r} .selectionMode=${i?.selectionMode??l} .visibilityAppearance=${i?.visibilityAppearance??o} .showErrors=${i?.visibleElements?.errors??this.showErrors} .showFilter=${i?.visibleElements?.filter??this.showFilter} .hideStatusIndicators=${i?.visibleElements?.statusIndicators??this.hideStatusIndicators} .showTemporaryLayerIndicators=${i?.visibleElements?.temporaryLayerIndicators??this.showTemporaryLayerIndicators} @arcgisReady=${n=>n.stopPropagation()} .catalogLayer=${e} .view=${this.view} .referenceElement=${this.referenceElement} @catalogOpen=${this._onCatalogOpen} @tablesOpen=${this._onTablesOpen}></arcgis-catalog-layer-list-next>`)}_getTableListParams(e){switch(e.type){case"knowledge-graph":return{...this.knowledgeGraphOptions,tables:e.tables};case"map-image":return{...this.mapImageOptions,tables:e.subtables};case"tile":return{...this.tileOptions,tables:e.subtables};default:return null}}async _createTableList(e){let{headingLevel:t,selectionMode:i,dragEnabled:a}=this,s=this._getTableListParams(e);return M(d`<arcgis-table-list-next .headingLevel=${s?.headingLevel??t} .selectionMode=${s?.selectionMode??i} .dragEnabled=${s?.dragEnabled??a} .collapsed=${s?.collapsed} .filterPlaceholder=${s?.filterPlaceholder} .filterText=${s?.filterText} .icon=${s?.icon??void 0} .label=${s?.label??void 0} .listItemCreatedFunction=${s?.listItemCreatedFunction} .tables=${s?.tables} .referenceElement=${this.referenceElement} @arcgisReady=${r=>r.stopPropagation()}></arcgis-table-list-next>`)}_handlePanelFlowItemBack(e){e.open=!1}_moveLayerFromChildList({toEl:e,fromEl:t,dragEl:i,newIndex:a}){let s=this._resolveListContainer(e),r=this._resolveListContainer(t),l=c(i,this.operationalItems),o=this._getContainerItem(s),n=this._getContainerItem(r);a==null||!l||this.viewModel.moveListItem(l,n,o,a)}_onCalciteListDragEnd(e){let{fromEl:t,toEl:i,dragEl:a,oldIndex:s}=e;if(t!==i){a.remove();return}s==null||!t||!a||t.insertBefore(a,t.children[s])}_onCalciteListOrderChange(e){let{_lastDragDetail:t}=this,{dragEl:i,newIndex:a}=e,s=this._resolveListContainer(e.fromEl),r=this._resolveListContainer(e.toEl),l=t?.newIndex===a&&t?.dragEl===i&&t?.toEl===r&&t?.fromEl===s;if(!(!s||!r||l)){if(this._lastDragDetail={...e,fromEl:s,toEl:r},this._selectedDragItemLayerUid=i.value,s===r){let o=Array.from(s.children).filter(n=>n?.matches("calcite-list-item")).map(n=>n.value.layer?.uid??"");this._sortLayers(s,o);return}this._moveLayerFromChildList({toEl:r,fromEl:s,dragEl:i,newIndex:a})}}_sortLayers(e,t){if(e)if(e===this._rootListRef.value)K(this.el.view?.map?.layers,t);else{let i=c(e,this.operationalItems);if(!i)return;Q(i,t)}}_handleCalciteListChange(e){let{selectionMode:t,selectedItems:i}=this;if(t==="none")return;let a=e.target.selectedItems.map(s=>c(s,this.operationalItems)).filter(Boolean);i.removeAll(),i.addMany(a)}render(){let{state:e}=this,t={[w.hidden]:e==="loading",[w.disabled]:e==="disabled"};return d`<div class=${v(x(w.widget,t))}>${this._visibleItems?.length?this._renderItemTooltips():null}${this._renderItems()}</div>`}_renderItemTooltip(e){let{_tooltipReferenceMap:t,messages:i}=this;return e?d`<calcite-tooltip overlay-positioning=fixed .referenceElement=${t.get(e.layer?.uid??"")}>${i.layerIncompatibleTooltip}</calcite-tooltip>`:null}_renderItemTooltipNodes(e){if(e.incompatible)return this._renderItemTooltip(e);let t=e.children?.filter(i=>!i.hidden).toArray().map(i=>this._renderItemTooltipNodes(i))??[];return t.length?t:null}_renderItemTooltips(){return this._visibleItems?.toArray().map(e=>this._renderItemTooltipNodes(e))}_renderNoItemsMessage(){return d`<div slot=message>${this.messages.noItemsToDisplay}</div>`}_renderNoItems(){return d`<div class=${v(p.itemMessage)}><calcite-notice icon=information kind=info open width=full>${this._renderNoItemsMessage()}</calcite-notice></div>`}_renderLayerFlowItem(e,t){let{messages:i,openedLayers:a}=this,s=e.title||this.messages.untitledLayer;return b(e?.uid??s,d`<calcite-flow-item data-layer-uid=${e?.uid??""??E} .description=${s} .heading=${i[e.type==="catalog"?"catalogLayers":"tables"]} .headingLevel=${this.headingLevel} .selected=${t} @calciteFlowItemBack=${r=>{r.preventDefault(),a.pop(),a.at(-1)&&this._layerFlowItemRef.value?.setFocus()}} ${f(this._layerFlowItemRef)}>${this._layerListMap.get(e)}</calcite-flow-item>`)}_renderPanelFlowItems(){let{_openedPanelItems:e,openedLayers:t}=this;return G(e.toArray(),i=>i.uid,(i,a)=>{let{panel:s,title:r}=i,l=()=>this._handlePanelFlowItemBack(s);return d`<calcite-flow-item .description=${r} .heading=${s.title} .headingLevel=${this.headingLevel} .selected=${!t.length&&a===e.length-1} @calciteFlowItemBack=${o=>{o.preventDefault(),l()}} ${f(this._panelFlowItemRef)}><arcgis-layer-list-item-panel .item=${i} .view=${this.view}></arcgis-layer-list-item-panel><calcite-button appearance=transparent @click=${l} slot=footer-actions width=full>${this.messages.back}</calcite-button></calcite-flow-item>`})}_renderItems(){let{collapsed:e,_visibleItems:t,_openedPanelItems:i,_filterEnabled:a,_rootGroupUid:s,showCloseButton:r,showCollapseButton:l,showHeading:o,_dragEnabled:n,selectionMode:y,filterText:u,openedLayers:_,filterPlaceholder:$,messages:I}=this,C=[d`<calcite-flow-item .closable=${r} .closed=${this.closed} .collapsed=${e} .collapsible=${l} .heading=${o?I.componentLabel:void 0} .headingLevel=${this.headingLevel} .selected=${!_.length&&!i.length} @calciteFlowItemClose=${()=>this.closed=!1}>${t?.length?d`<calcite-list @focusin=${this._setActiveItem} @focusout=${this._clearActiveItem} .canPull=${h=>this._canMove(h,"pull")} .canPut=${h=>this._canMove(h,"put")} data-layer-type=${s??E} .displayMode=${Y} .dragEnabled=${n} .filterEnabled=${a} .filterPlaceholder=${$} .filterProps=${H} .filterText=${a?u:""} .group=${s} .label=${I.componentLabel} @mouseleave=${this._clearActiveItem} @mouseover=${this._setActiveItem} selection-appearance=highlight .selectionMode=${y} @calciteListChange=${this._handleCalciteListChange} @calciteListFilter=${h=>{this.filterText=h.currentTarget?.filterText??"",this.arcgisFilterChange.emit()}} @calciteListOrderChange=${h=>this._onCalciteListOrderChange(h.detail)} @calciteListDragEnd=${h=>this._onCalciteListDragEnd(h.detail)} ${f(this._rootListRef)}>${t.toArray().map(h=>this._renderItem(h))}${a?d`<div class=${v(p.filterNoResults)} slot=filter-no-results><calcite-notice kind=info open width=full>${this._renderNoItemsMessage()}</calcite-notice></div>`:null}</calcite-list>`:this._renderNoItems()}</calcite-flow-item>`,this._renderPanelFlowItems(),this._renderedOpenLayerFlowItems];return this.closed?null:b("root-flow",d`<calcite-flow>${C}</calcite-flow>`)}_renderItem(e,t,i){return b(e.uid,V({activeItem:this._activeItem,canMove:this._canMove,css:p,displayMode:Y,dragEnabled:this.dragEnabled,hideStatusIndicators:this.hideStatusIndicators,hideCatalogLayerList:this.hideCatalogLayerList,item:e,messages:this.messages,layerTablesEnabled:this.layerTablesEnabled,listModeDisabled:this.viewModel.listModeDisabled,operationalItems:this.operationalItems,parent:t,parentTitles:i,rootGroupUid:this._rootGroupUid,selectedDragItemLayerUid:this._selectedDragItemLayerUid,selectedItems:this.selectedItems,selectionMode:this.selectionMode,setCurrentActiveItem:this._setCurrentActiveItem,showTemporaryLayerIndicators:this.showTemporaryLayerIndicators,showCloseButton:this.showCloseButton,showCollapseButton:this.showCollapseButton,showErrors:this.showErrors,showHeading:this.showHeading,showFilter:this.showFilter,clearActiveItem:this._clearActiveItem,visibilityAppearance:this.visibilityAppearance,handleAction:this._onTriggerAction,handleCatalogOpen:this._onCatalogOpen,handleSelectedDragItemLayerUidChange:this._onSelectedDragItemLayerUidChange,handleTablesOpen:this._onTablesOpen,handleTooltipReferenceChange:this._onTooltipReferenceChange,view:this.view}))}};R("arcgis-layer-list-next",T);return T},"widgets/LayerList/LayerListViewModel","core/Collection","core/reactiveUtils",a,e,g,h,i,l,n,o,r)
2
+ import"./XEK22IDA.js";import r from"./NSF5Q73E.js";import o from"./2JBFSC6D.js";import"./5USS47OO.js";import{a as p}from"./JCRPP54Z.js";import{a as H,b as j,c as q,g as z,h as J,j as K,k as Q,m as c,n as F}from"./LDDAJOTV.js";import{a as G}from"./EUCWM5S7.js";import{a as b}from"./O5T75PGZ.js";import n from"./X6PWBP6M.js";import l from"./MZWO5JYA.js";import i from"./P6CDJ2IV.js";import"./VJVKFKSG.js";import h from"./SYRZLONH.js";import{a as k}from"./JP24H6WY.js";import{a as w}from"./JD74LG7K.js";import{a as N}from"./IVZM7EPG.js";import g from"./V6VLUKHQ.js";import e from"./7MO7E734.js";import{g as B}from"./Z7J6NDSB.js";import"./VWED2WAO.js";import a from"./3MWUCGFA.js";import"./QUZTFUWM.js";import{d as x}from"./RZ6SODVT.js";import{B as P,M as L,N as f,O as D,P as v,R as E,S as M,U as R,b as d,x as m}from"./CDSRIIHC.js";import"./H6RQVSYM.js";export default $arcgis.t(([te,g,{on:A,watch:ie},,,{a:U},S,,,,,{a:V,b:W,c:X}])=>{var Y="nested",se=S(te),T=class extends D{constructor(){super(...arguments),this._lastDragDetail=null,this._rootListRef=L(),this._layerFlowItemRef=L(),this._panelFlowItemRef=L(),this._selectedDragItemLayerUid=null,this._rootGroupUid=`operational-${P()}`,this._openedLayersController=null,this.messages=k(),this._canMove=({dragEl:e,fromEl:t,toEl:i},a)=>{let s=a==="pull"?this.listItemCanGiveFunction:this.listItemCanReceiveFunction,r=c(e,this.operationalItems);if(!r?.sortable)return!1;let l=this._resolveListContainer(t),o=this._resolveListContainer(i),n=this._getContainerItem(l),y=F(l),u=this._getContainerItem(o),_=F(o),$=!!y&&!!_&&y===_,I={selected:r,from:n,to:u},C=l?.group,h=o?.group,Z=n?.layer?.type??"",ee=u?.layer?.type??"",O=new Set(["map-image","catalog","knowledge-graph"]);return C&&h&&typeof s=="function"?s(I):$&&!O.has(Z)&&!O.has(ee)&&r?.layer?.type!=="sublayer"},this._onCatalogOpen=e=>{this.openedLayers.push(e.layer?.parent)},this._onTablesOpen=e=>{this.openedLayers.push(e.layer)},this._clearActiveItem=()=>{this._activeItem=null},this._setCurrentActiveItem=e=>{this._activeItem=e},this._setActiveItem=e=>{if(this.visibilityAppearance!=="default")return;let t=Array.from(e.composedPath()).find(a=>a.classList?.contains(p.item)),i=c(t,this.operationalItems);this._activeItem=i},this.viewModel=se(this),this.arcgisClose=N(this),this._activeItem=null,this._onTooltipReferenceChange=(e,t)=>{t?this._tooltipReferenceMap.set(e,t):this._tooltipReferenceMap.delete(e)},this._onSelectedDragItemLayerUidChange=e=>{this._selectedDragItemLayerUid=e},this._onTriggerAction=(e,t)=>{this.triggerAction(e,t)},this._tooltipReferenceMap=new Map,this._layerListMap=new Map,this.layerTablesEnabled=new g(["knowledge-graph"]),this.mapImageOptions=null,this.openedLayerLists=new g,this.tileOptions=null,this.view=this.viewModel.view,this.autoDestroyDisabled=!1,this.closed=!1,this.icon="layers",this.collapsed=!1,this.dragEnabled=!1,this.filterPlaceholder="",this.filterText="",this.headingLevel=2,this.layerTablesAvailable=new g(["knowledge-graph"]),this.listItemCreatedFunction=this.viewModel.listItemCreatedFunction,this.minDragEnabledItems=q,this.minFilterItems=j,this.openedLayers=new g,this.operationalItems=this.viewModel.operationalItems,this.selectedItems=new g,this.selectionMode="none",this.visibilityAppearance="default",this.hideCatalogLayerList=!1,this.showCloseButton=!1,this.showCollapseButton=!1,this.showErrors=!1,this.showFilter=!1,this.showHeading=!1,this.hideStatusIndicators=!1,this.showTemporaryLayerIndicators=!1,this.state=this.viewModel.state,this.arcgisPropertyChange=B()("state"),this.arcgisReady=m(),this.arcgisFilterChange=m(),this.arcgisSelectedItemsChange=m(),this.arcgisOpenedLayersChange=m(),this.arcgisTriggerAction=U(()=>this.viewModel,"trigger-action")}static{this.properties={_catalogLayerList:16,_tableList:16,_tooltipReferenceMap:16,_layerListMap:16,_totalItems:16,_visibleItems:16,_openedPanelItems:16,_dragEnabled:16,_filterEnabled:16,layerTablesEnabled:16,mapImageOptions:16,openedLayerLists:16,tileOptions:16,_renderedOpenLayerFlowItems:16,view:0,autoDestroyDisabled:5,closed:5,referenceElement:1,icon:1,catalogLayerList:32,catalogOptions:0,collapsed:5,dragEnabled:5,filterPlaceholder:1,filterPredicate:0,filterText:1,headingLevel:9,knowledgeGraphOptions:0,layerTablesAvailable:0,listItemCanGiveFunction:0,listItemCanReceiveFunction:0,listItemCreatedFunction:0,minDragEnabledItems:9,minFilterItems:9,openedLayers:32,operationalItems:0,selectedItems:0,selectionMode:1,tableList:32,visibilityAppearance:1,hideCatalogLayerList:5,showCloseButton:5,showCollapseButton:5,showErrors:5,showFilter:5,showHeading:5,hideStatusIndicators:5,showTemporaryLayerIndicators:5,messageOverrides:0,label:1,state:32}}static{this.styles=[X,W]}get _totalItems(){return this.viewModel.operationalItems.flatten(e=>e.children.filter(t=>t.layer?.type!=="catalog-dynamic-group")).length}get _visibleItems(){return this.operationalItems?.filter(e=>!e.hidden&&(this.showErrors||!e.error))}get _openedPanelItems(){return this._visibleItems.flatten(e=>e.children).filter(({hidden:e,panel:t})=>!e&&t?.open&&!t.disabled&&t.flowEnabled)}get _dragEnabled(){return this._totalItems>=this.minDragEnabledItems&&this.dragEnabled}get _filterEnabled(){return this._totalItems>=this.minFilterItems&&this.showFilter}get _renderedOpenLayerFlowItems(){let{openedLayers:e}=this;return e.toArray().map((t,i)=>this._renderLayerFlowItem(t,i===e.length-1))}get catalogLayerList(){return this._catalogLayerList}get tableList(){return this._tableList}async destroy(){await this.manager.destroy(),this._destroyOpenedLayerLists(),this._tooltipReferenceMap.clear()}loaded(){this.manager.onLifecycle(()=>[A(()=>this.openedLayers,"change",()=>{this._handleOpenedLayersChange()},{initial:!0}),A(()=>this.viewModel.operationalItems,"change",()=>z(this.selectedItems),{initial:!0}),A(()=>this.selectedItems,"change",()=>this.arcgisSelectedItemsChange.emit()),ie(()=>[this.filterPredicate,this._rootListRef.value],()=>J(this._rootListRef.value,this.filterPredicate,this.operationalItems))])}triggerAction(e,t){return this.viewModel.triggerAction(e,t)}_resolveListContainer(e){return e?e.matches("calcite-list")?e:e.closest("calcite-list[data-item]")||(this._rootListRef.value?.contains(e)?this._rootListRef.value:null):null}_getContainerItem(e){let t=e?.getAttribute("data-item");return t?this._findItemByUid(t):null}_findItemByUid(e){let t=this.operationalItems?.toArray()??[];for(;t.length;){let i=t.shift();if(!i)continue;if(i.uid===e)return i;let a=i.children?.toArray()??[];t.push(...a)}return null}async _createFlowList(e,t){let{_layerListMap:i}=this,a=i.get(e);if(a)return a;let s=e.type==="catalog"?await this._createCatalogLayerList(e):await this._createTableList(e);return t.aborted||i.set(e,s),s}async _handleOpenedLayersChange(){let{_layerListMap:e,openedLayers:t,openedLayerLists:i}=this;this._openedLayersController?.abort();let a=new AbortController,{signal:s}=a;this._openedLayersController=a,e.forEach((o,n)=>{t.includes(n)||(o?.destroy?.(),e.delete(n))});let r=await Promise.all(t.map(o=>this._createFlowList(o,s)));if(s.aborted)return;i.removeAll(),i.addMany(r);let l=i.at(-1);l?"catalogLayer"in l?(this._catalogLayerList=l,this._tableList=void 0):(this._catalogLayerList=void 0,this._tableList=l):(this._catalogLayerList=void 0,this._tableList=void 0),this.arcgisOpenedLayersChange.emit()}_destroyOpenedLayerLists(){this.openedLayerLists.destroyAll(),this.openedLayers.removeAll(),this._layerListMap.clear()}async _createCatalogLayerList(e){let{headingLevel:t,catalogOptions:i,filterPlaceholder:a,listItemCreatedFunction:s,minFilterItems:r,selectionMode:l,visibilityAppearance:o}=this;return M(d`<arcgis-catalog-layer-list-next .headingLevel=${t} .filterPlaceholder=${i?.filterPlaceholder??a} .listItemCreatedFunction=${i?.listItemCreatedFunction??s} .minFilterItems=${i?.minFilterItems??r} .selectionMode=${i?.selectionMode??l} .visibilityAppearance=${i?.visibilityAppearance??o} .showErrors=${i?.visibleElements?.errors??this.showErrors} .showFilter=${i?.visibleElements?.filter??this.showFilter} .hideStatusIndicators=${i?.visibleElements?.statusIndicators??this.hideStatusIndicators} .showTemporaryLayerIndicators=${i?.visibleElements?.temporaryLayerIndicators??this.showTemporaryLayerIndicators} .messageOverrides=${this.messageOverrides} @arcgisReady=${n=>n.stopPropagation()} .catalogLayer=${e} .view=${this.view} .referenceElement=${this.referenceElement} @catalogOpen=${this._onCatalogOpen} @tablesOpen=${this._onTablesOpen}></arcgis-catalog-layer-list-next>`)}_getTableListParams(e){switch(e.type){case"knowledge-graph":return{...this.knowledgeGraphOptions,tables:e.tables};case"map-image":return{...this.mapImageOptions,tables:e.subtables};case"tile":return{...this.tileOptions,tables:e.subtables};default:return null}}async _createTableList(e){let{headingLevel:t,selectionMode:i,dragEnabled:a}=this,s=this._getTableListParams(e);return M(d`<arcgis-table-list-next .headingLevel=${s?.headingLevel??t} .selectionMode=${s?.selectionMode??i} .dragEnabled=${s?.dragEnabled??a} .collapsed=${s?.collapsed} .filterPlaceholder=${s?.filterPlaceholder} .filterText=${s?.filterText} .icon=${s?.icon??void 0} .label=${s?.label??void 0} .listItemCreatedFunction=${s?.listItemCreatedFunction} .messageOverrides=${this.messageOverrides} .tables=${s?.tables} .referenceElement=${this.referenceElement} @arcgisReady=${r=>r.stopPropagation()}></arcgis-table-list-next>`)}_handlePanelFlowItemBack(e){e.open=!1}_moveLayerFromChildList({toEl:e,fromEl:t,dragEl:i,newIndex:a}){let s=this._resolveListContainer(e),r=this._resolveListContainer(t),l=c(i,this.operationalItems),o=this._getContainerItem(s),n=this._getContainerItem(r);a==null||!l||this.viewModel.moveListItem(l,n,o,a)}_onCalciteListDragEnd(e){let{fromEl:t,toEl:i,dragEl:a,oldIndex:s}=e;if(t!==i){a.remove();return}s==null||!t||!a||t.insertBefore(a,t.children[s])}_onCalciteListOrderChange(e){let{_lastDragDetail:t}=this,{dragEl:i,newIndex:a}=e,s=this._resolveListContainer(e.fromEl),r=this._resolveListContainer(e.toEl),l=t?.newIndex===a&&t?.dragEl===i&&t?.toEl===r&&t?.fromEl===s;if(!(!s||!r||l)){if(this._lastDragDetail={...e,fromEl:s,toEl:r},this._selectedDragItemLayerUid=i.value,s===r){let o=Array.from(s.children).filter(n=>n?.matches("calcite-list-item")).map(n=>n.value.layer?.uid??"");this._sortLayers(s,o);return}this._moveLayerFromChildList({toEl:r,fromEl:s,dragEl:i,newIndex:a})}}_sortLayers(e,t){if(e)if(e===this._rootListRef.value)K(this.el.view?.map?.layers,t);else{let i=c(e,this.operationalItems);if(!i)return;Q(i,t)}}_handleCalciteListChange(e){let{selectionMode:t,selectedItems:i}=this;if(t==="none")return;let a=e.target.selectedItems.map(s=>c(s,this.operationalItems)).filter(Boolean);i.removeAll(),i.addMany(a)}render(){let{state:e}=this,t={[w.hidden]:e==="loading",[w.disabled]:e==="disabled"};return d`<div class=${v(x(w.widget,t))}>${this._visibleItems?.length?this._renderItemTooltips():null}${this._renderItems()}</div>`}_renderItemTooltip(e){let{_tooltipReferenceMap:t,messages:i}=this;return e?d`<calcite-tooltip overlay-positioning=fixed .referenceElement=${t.get(e.layer?.uid??"")}>${i.layerIncompatibleTooltip}</calcite-tooltip>`:null}_renderItemTooltipNodes(e){if(e.incompatible)return this._renderItemTooltip(e);let t=e.children?.filter(i=>!i.hidden).toArray().map(i=>this._renderItemTooltipNodes(i))??[];return t.length?t:null}_renderItemTooltips(){return this._visibleItems?.toArray().map(e=>this._renderItemTooltipNodes(e))}_renderNoItemsMessage(){return d`<div slot=message>${this.messages.noItemsToDisplay}</div>`}_renderNoItems(){return d`<div class=${v(p.itemMessage)}><calcite-notice icon=information kind=info open width=full>${this._renderNoItemsMessage()}</calcite-notice></div>`}_renderLayerFlowItem(e,t){let{messages:i,openedLayers:a}=this,s=e.title||this.messages.untitledLayer;return b(e?.uid??s,d`<calcite-flow-item data-layer-uid=${e?.uid??""??E} .description=${s} .heading=${i[e.type==="catalog"?"catalogLayers":"tables"]} .headingLevel=${this.headingLevel} .selected=${t} @calciteFlowItemBack=${r=>{r.preventDefault(),a.pop(),a.at(-1)&&this._layerFlowItemRef.value?.setFocus()}} ${f(this._layerFlowItemRef)}>${this._layerListMap.get(e)}</calcite-flow-item>`)}_renderPanelFlowItems(){let{_openedPanelItems:e,openedLayers:t}=this;return G(e.toArray(),i=>i.uid,(i,a)=>{let{panel:s,title:r}=i,l=()=>this._handlePanelFlowItemBack(s);return d`<calcite-flow-item .description=${r} .heading=${s.title} .headingLevel=${this.headingLevel} .selected=${!t.length&&a===e.length-1} @calciteFlowItemBack=${o=>{o.preventDefault(),l()}} ${f(this._panelFlowItemRef)}><arcgis-layer-list-item-panel .item=${i} .view=${this.view}></arcgis-layer-list-item-panel><calcite-button appearance=transparent @click=${l} slot=footer-actions width=full>${this.messages.back}</calcite-button></calcite-flow-item>`})}_renderItems(){let{collapsed:e,_visibleItems:t,_openedPanelItems:i,_filterEnabled:a,_rootGroupUid:s,showCloseButton:r,showCollapseButton:l,showHeading:o,_dragEnabled:n,selectionMode:y,filterText:u,openedLayers:_,filterPlaceholder:$,messages:I}=this,C=[d`<calcite-flow-item .closable=${r} .closed=${this.closed} .collapsed=${e} .collapsible=${l} .heading=${o?I.componentLabel:void 0} .headingLevel=${this.headingLevel} .selected=${!_.length&&!i.length} @calciteFlowItemClose=${()=>this.closed=!1}>${t?.length?d`<calcite-list @focusin=${this._setActiveItem} @focusout=${this._clearActiveItem} .canPull=${h=>this._canMove(h,"pull")} .canPut=${h=>this._canMove(h,"put")} data-layer-type=${s??E} .displayMode=${Y} .dragEnabled=${n} .filterEnabled=${a} .filterPlaceholder=${$} .filterProps=${H} .filterText=${a?u:""} .group=${s} .label=${I.componentLabel} @mouseleave=${this._clearActiveItem} @mouseover=${this._setActiveItem} selection-appearance=highlight .selectionMode=${y} @calciteListChange=${this._handleCalciteListChange} @calciteListFilter=${h=>{this.filterText=h.currentTarget?.filterText??"",this.arcgisFilterChange.emit()}} @calciteListOrderChange=${h=>this._onCalciteListOrderChange(h.detail)} @calciteListDragEnd=${h=>this._onCalciteListDragEnd(h.detail)} ${f(this._rootListRef)}>${t.toArray().map(h=>this._renderItem(h))}${a?d`<div class=${v(p.filterNoResults)} slot=filter-no-results><calcite-notice kind=info open width=full>${this._renderNoItemsMessage()}</calcite-notice></div>`:null}</calcite-list>`:this._renderNoItems()}</calcite-flow-item>`,this._renderPanelFlowItems(),this._renderedOpenLayerFlowItems];return this.closed?null:b("root-flow",d`<calcite-flow>${C}</calcite-flow>`)}_renderItem(e,t,i){return b(e.uid,V({activeItem:this._activeItem,canMove:this._canMove,css:p,displayMode:Y,dragEnabled:this.dragEnabled,hideStatusIndicators:this.hideStatusIndicators,hideCatalogLayerList:this.hideCatalogLayerList,item:e,messages:this.messages,layerTablesEnabled:this.layerTablesEnabled,listModeDisabled:this.viewModel.listModeDisabled,operationalItems:this.operationalItems,parent:t,parentTitles:i,rootGroupUid:this._rootGroupUid,selectedDragItemLayerUid:this._selectedDragItemLayerUid,selectedItems:this.selectedItems,selectionMode:this.selectionMode,setCurrentActiveItem:this._setCurrentActiveItem,showTemporaryLayerIndicators:this.showTemporaryLayerIndicators,showCloseButton:this.showCloseButton,showCollapseButton:this.showCollapseButton,showErrors:this.showErrors,showHeading:this.showHeading,showFilter:this.showFilter,clearActiveItem:this._clearActiveItem,visibilityAppearance:this.visibilityAppearance,handleAction:this._onTriggerAction,handleCatalogOpen:this._onCatalogOpen,handleSelectedDragItemLayerUidChange:this._onSelectedDragItemLayerUidChange,handleTablesOpen:this._onTablesOpen,handleTooltipReferenceChange:this._onTooltipReferenceChange,view:this.view}))}};R("arcgis-layer-list-next",T);return T},"widgets/LayerList/LayerListViewModel","core/Collection","core/reactiveUtils",a,e,g,h,i,l,n,o,r)
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import j from"./2JBFSC6D.js";import{a as k}from"./O5T75PGZ.js";import i from"./X6PWBP6M.js";import h from"./MZWO5JYA.js";import g from"./P6CDJ2IV.js";import"./VJVKFKSG.js";import{b as U,c as Z}from"./32XG4IQO.js";import f from"./SYRZLONH.js";import{a as P}from"./JP24H6WY.js";import e from"./V6VLUKHQ.js";import d from"./7MO7E734.js";import{e as L,g as H}from"./Z7J6NDSB.js";import"./VWED2WAO.js";import b from"./3MWUCGFA.js";import"./QUZTFUWM.js";import{d as y}from"./RZ6SODVT.js";import{M,N as v,O as N,P as x,R as c,S as R,U as B,a as O,b as a,o as C,p as $,x as A}from"./CDSRIIHC.js";import"./H6RQVSYM.js";export default $arcgis.t(([X,{substitute:u,formatNumber:I},{watch:r},{stripHTML:D},G,{renderingSanitizer:b},{initializeProjection:q},J,,,,z,,,{d:S},{c:j,d:K}])=>{var Q=O`:host{display:flex;overflow:hidden;flex:1 1 auto}.root{--calcite-color-background: var(--calcite-color-foreground-1);display:flex;overflow:hidden;flex:1 1 auto;flex-direction:column}.root img{image-orientation:from-image}.flow-item-collapsed{--calcite-flow-item-header-border-block-end: none}.container{display:flex;flex:1 1 auto;background-color:var(--calcite-color-foreground-1)}.container calcite-list{width:100%}.container:not(:empty,.content-hidden){padding:var(--arcgis-internal-padding-md, var(--calcite-spacing-md))}.root .arcgis-feature,.root .arcgis-feature-relationship,.root .arcgis-feature-utility-network-associations{background-color:transparent}.heading{word-break:break-word;word-wrap:break-word}.header,.footer{display:flex;align-items:center;justify-content:flex-end;background-color:var(--calcite-color-foreground-1)}.footer{flex:1}.pagination-text{padding-inline:var(--calcite-spacing-sm);color:var(--calcite-color-text-3);font-size:var(--calcite-font-size-sm)}.loader{align-self:center;padding-inline:var(--calcite-spacing-lg)}.pagination-action-bar{flex:1}.pagination-menu-button{padding-inline:var(--calcite-spacing-xxs);border-inline-start:var(--calcite-border-width-sm) solid var(--calcite-color-border-3)}.icon{display:inline-block;flex:0 0 var(--calcite-spacing-lg);width:var(--calcite-spacing-lg);height:var(--calcite-spacing-lg)}.action-image{flex:0 0 var(--calcite-spacing-lg);background-position:50% 50%;background-repeat:no-repeat;background-size:contain;width:var(--calcite-spacing-lg);height:var(--calcite-spacing-lg)}.header{border-block-end:var(--calcite-border-width-sm) solid var(--calcite-color-border-3)}.content-feature{--calcite-flow-item-footer-padding: 0}.feature-menu-observer{position:relative;bottom:var(--calcite-spacing-xxl);z-index:2;text-align:center}.action-exit{transform:scaleX(-1)}`,Y=new J({icon:"magnifying-glass-plus",id:"zoom-to-feature",title:"{messages.zoom}"}),_=Y.clone();function ee(E){return E?.declaredClass.startsWith("esri.layers.")??!1}var te=z(X),V=class extends N{constructor(){super(...arguments),this._direction=L(),this._fetchFeaturesController=null,this._featureMenuIntersectionObserverCallback=([e])=>{e?.isIntersecting&&this.viewModel.featurePage!=null&&this.viewModel.featurePage++},this._featureMenuIntersectionObserver=new IntersectionObserver(this._featureMenuIntersectionObserverCallback,{root:window.document}),this._featureMenuIntersectionObserverNode=null,this._rootFlowItemNode=M(),this._featureMenuViewportNode=M(),this._actionBarMenuNode=M(),this._flowContainerNode=M(),this.messages=P(),this._selectedFeatureComponent=M(),this._cancelOpenRelatedFeature=()=>{let{_openRelatedFeatureAbortController:e}=this;e&&e.abort(),this._openRelatedFeatureAbortController=null},this._openRelatedFeatureAbortController=null,this.flowItems=new G,this.viewModel=te(this),this.actions=this.viewModel.actions,this.active=this.viewModel.active,this.autoDestroyDisabled=!1,this.collapsed=!1,this.content=this.viewModel.content,this.defaultPopupTemplateEnabled=this.viewModel.defaultPopupTemplateEnabled,this.featureCount=this.viewModel.featureCount,this.featureMenuOpen=this.viewModel.featureMenuOpen,this.featureMenuTitle=this.viewModel.featureMenuTitle,this.featureNavigationTop=!1,this.features=this.viewModel.features,this.featuresPerPage=this.viewModel.featuresPerPage,this.featureViewModelAbilities=this.viewModel.featureViewModelAbilities,this.goToOverride=this.viewModel.goToOverride,this.headerActions=new G,this.heading=this.viewModel.title,this.headingLevel=2,this.hideActionBar=!1,this.hideCloseButton=!1,this.hideFeatureMenuHeading=!1,this.hideFeatureNavigation=!1,this.hideFeatureListLayerTitle=!1,this.hideHeading=!1,this.hideSelectFeature=!1,this.hideSpinner=!1,this.hideContent=!1,this.hideExpressionContent=!1,this.hideLastEditedInfo=!1,this.highlightDisabled=this.viewModel.highlightEnabled,this.includeDefaultActionsDisabled=this.viewModel.includeDefaultActions,this.initialDisplayMode=this.viewModel.initialDisplayMode,this.location=this.viewModel.location,this.map=this.viewModel.map,this.open=this.viewModel.visible,this.promises=this.viewModel.promises,this.responsiveActionsEnabled=!1,this.selectedFeature=this.viewModel.selectedFeature,this.selectedFeatureIndex=this.viewModel.selectedFeatureIndex,this.showCollapseButton=!1,this.spatialReference=this.viewModel.spatialReference,this.state=this.viewModel.state,this.timeZone=this.viewModel.timeZone,this.updateLocationEnabled=this.viewModel.updateLocationEnabled,this.view=this.viewModel.view,this.arcgisPropertyChange=H()("active","collapsed","effectiveHeading","featureCount","featureMenuOpen","features","promises","selectedDrillInFeature","selectedFeature","selectedFeatureComponent","selectedFeatureIndex","state","open"),this.arcgisReady=A(),this.arcgisClose=A(),this.arcgisTriggerAction=A()}static{this.properties={_openRelatedFeatureAbortController:16,flowItems:16,_hideActionText:16,_featureNavigationVisible:16,_isCollapsed:16,_collapseEnabled:16,_featureFlowItemSelected:16,viewModel:0,actions:0,active:0,autoDestroyDisabled:5,collapseDirection:1,collapsed:5,content:1,defaultPopupTemplateEnabled:5,effectiveHeading:32,featureCount:9,featureMenuOpen:5,featureMenuTitle:1,featureNavigationTop:5,features:0,featuresPerPage:9,featureViewModelAbilities:0,goToOverride:0,headerActions:0,heading:1,headingLevel:9,hideActionBar:5,hideCloseButton:5,hideFeatureMenuHeading:5,hideFeatureNavigation:5,hideFeatureListLayerTitle:5,hideHeading:5,hideSelectFeature:5,hideSpinner:5,hideContent:5,chartAnimationDisabled:5,hideAttachmentsContent:5,hideCustomContent:5,hideExpressionContent:5,hideFieldsContent:5,hideMediaContent:5,hideRelationshipContent:5,hideTextContent:5,hideUtilityNetworkContent:5,hideLastEditedInfo:5,highlightDisabled:5,icon:1,includeDefaultActionsDisabled:5,initialDisplayMode:1,label:1,location:0,map:0,messageOverrides:0,open:5,referenceElement:1,promises:0,responsiveActionsEnabled:5,selectedDrillInFeature:32,selectedFeature:0,selectedFeatureComponent:32,selectedFeatureIndex:9,showCollapseButton:5,spatialReference:0,state:32,timeZone:1,updateLocationEnabled:5,view:0}}static{this.styles=Q}get _hideActionText(){if(!this.responsiveActionsEnabled)return!1;let e=this.viewModel.view?.widthBreakpoint;return e==="xsmall"||e==="small"||e==="medium"}get _featureNavigationVisible(){return this.viewModel.active&&this.viewModel.featureCount>1&&!!this.viewModel.selectedFeature&&!this.hideFeatureNavigation}get _isCollapsed(){return this._collapseEnabled&&this.collapsed}get _collapseEnabled(){return this.showCollapseButton&&(this.initialDisplayMode==="list"||!!(this.heading||this.viewModel.selectedFeatureViewModel?.title)&&!!(this.content||this.viewModel.selectedFeatureViewModel?.content))}get _featureFlowItemSelected(){return this.initialDisplayMode==="list"?!!this.selectedFeature:!this.featureMenuOpen}get chartAnimationDisabled(){return!(this.viewModel.featureViewModelAbilities?.chartAnimation??!0)}set chartAnimationDisabled(e){this.viewModel.featureViewModelAbilities??={},this.viewModel.featureViewModelAbilities.chartAnimation=!e}get hideAttachmentsContent(){return!(this.viewModel.featureViewModelAbilities?.attachmentsContent??!0)}set hideAttachmentsContent(e){this.viewModel.featureViewModelAbilities??={},this.viewModel.featureViewModelAbilities.attachmentsContent=!e}get hideCustomContent(){return!(this.viewModel.featureViewModelAbilities?.customContent??!0)}set hideCustomContent(e){this.viewModel.featureViewModelAbilities??={},this.viewModel.featureViewModelAbilities.customContent=!e}get hideFieldsContent(){return!(this.viewModel.featureViewModelAbilities?.fieldsContent??!0)}set hideFieldsContent(e){this.viewModel.featureViewModelAbilities??={},this.viewModel.featureViewModelAbilities.fieldsContent=!e}get hideMediaContent(){return!(this.viewModel.featureViewModelAbilities?.mediaContent??!0)}set hideMediaContent(e){this.viewModel.featureViewModelAbilities??={},this.viewModel.featureViewModelAbilities.mediaContent=!e}get hideRelationshipContent(){return!(this.viewModel.featureViewModelAbilities?.relationshipContent??!0)}set hideRelationshipContent(e){this.viewModel.featureViewModelAbilities??={},this.viewModel.featureViewModelAbilities.relationshipContent=!e}get hideTextContent(){return!(this.viewModel.featureViewModelAbilities?.textContent??!0)}set hideTextContent(e){this.viewModel.featureViewModelAbilities??={},this.viewModel.featureViewModelAbilities.textContent=!e}get hideUtilityNetworkContent(){return!(this.viewModel.featureViewModelAbilities?.utilityNetworkAssociationsContent??!0)}set hideUtilityNetworkContent(e){this.viewModel.featureViewModelAbilities??={},this.viewModel.featureViewModelAbilities.utilityNetworkAssociationsContent=!e}async clear(){return this.viewModel.clear()}async close(){this.open=!1}async destroy(){await this.manager.destroy(),this._removeSpinner(this.referenceElement),this._cancelOpenRelatedFeature(),this._removeFlowItems(),this._unobserveFeatureMenuObserver(),this._cancelFetchingFeatures(),this._featureMenuIntersectionObserver?.disconnect()}async fetchFeatures(e,t){this._cancelFetchingFeatures();let{signal:s}=t??{},i=new AbortController,{signal:n}=i,o=s?AbortSignal.any([n,s]):n;if(this._fetchFeaturesController=i,!e&&this.view&&this.location&&(await q(this.location.spatialReference,this.view.spatialReference,null,{signal:o}),e=this.view.toScreen(this.location)??void 0),!e)return;let l=await this.viewModel.fetchFeatures(e,{...t,signal:o});this.location=l.location,this.promises=l.pendingFeatures}async next(){return $("warn",this,"The return type of FeaturesViewModel on the next() method is deprecated. At 6.0, this method will return void."),this.viewModel.next()}async previous(){return $("warn",this,"The return type of FeaturesViewModel on the previous() method is deprecated. At 6.0, this method will return void."),this.viewModel.previous()}async setFocus(){this._flowContainerNode.value?.setFocus()}async triggerAction(e){if($("warn",this,"The triggerAction() method is deprecated since 5.1. Trigger actions with manual user interaction within the component.",{once:!0}),!e.disabled)return e?.type==="toggle"&&(e.value=!e.value),await K(e,this.viewModel)}connectedCallback(){super.connectedCallback(),this._createSpinner()}disconnectedCallback(){super.disconnectedCallback(),this._removeSpinner(this.referenceElement)}loaded(){this.manager.onLifecycle(()=>[r(()=>this.viewModel?.selectedFeatureIndex,(e,t)=>this._selectedFeatureIndexUpdated(e,t)),r(()=>this.viewModel?.view,(e,t)=>t&&this._viewChange()),r(()=>this._spinnerEl?.screenLocation,()=>this._closeOpenActionMenu()),r(()=>this.selectedFeatureComponent?.viewModel,()=>this._removeFlowItems()),r(()=>this.viewModel?.featureViewModels,()=>this._featureMenuViewportScrollTop()),r(()=>this.flowItems.length,()=>this._syncSelectedDrillInFeature()),r(()=>[this.viewModel?.title,this.viewModel?.selectedFeatureViewModel?.title,this.viewModel?.selectedFeatureViewModel?.state],()=>this._syncEffectiveHeading(),{initial:!0}),r(()=>[this.flowItems?.length,this.featureMenuOpen],()=>{this.setFocus()}),r(()=>this.referenceElement,(e,t)=>{this._removeSpinner(t),this._createSpinner()},{initial:!0}),r(()=>[this.hideSpinner,this.viewModel?.view,this.viewModel?.location,this.viewModel?.waitingForResult,this.viewModel?.visible],()=>this._createSpinner(),{initial:!0})])}updated(){let e=this._selectedFeatureComponent.value??void 0;this.selectedFeatureComponent!==e&&C(()=>this.selectedFeatureComponent=e)}_syncSelectedDrillInFeature(){let e=this.flowItems.getItemAt(this.flowItems.length-1);C(()=>this.selectedDrillInFeature=e?.graphic??void 0)}_syncEffectiveHeading(){let e=this._calculateEffectiveHeading();this.effectiveHeading!==e&&C(()=>this.effectiveHeading=e)}_cancelFetchingFeatures(){this._fetchFeaturesController?.abort(),this._fetchFeaturesController=null}_handleClose(){this.close(),this.arcgisClose.emit()}_groupResultsByLayer(){let{featureViewModels:e}=this.viewModel,t=new Map;return e.forEach(s=>{let i=s?.graphic;if(!i)return;let n=S(i),o=ee(n)?n:null,l=t.get(o)??[];t.set(o,[...l,s])}),t}_handleCollapseToggle(){this.collapsed=!this.collapsed}async _openRelatedFeature(e){this._cancelOpenRelatedFeature();let t=new AbortController;if(this._openRelatedFeatureAbortController=t,await e.updateGeometry(),this._openRelatedFeatureAbortController!==t)return;let s=e.graphic,i=s?.geometry;if(i==null||s==null){this._openRelatedFeatureAbortController===t&&(this._openRelatedFeatureAbortController=null);return}if(this._removeFlowItems(),await this.viewModel.zoomTo({target:i}),this._openRelatedFeatureAbortController!==t)return;let n=await $arcgis.t(m=>m[0],"geometry/operators/labelPointOperator");if(this._openRelatedFeatureAbortController!==t)return;let o=n.execute(i);o!=null&&(this.location=o),this.features=[s],this.open=!0,await this.setFocus(),this._openRelatedFeatureAbortController===t&&(this._openRelatedFeatureAbortController=null)}_handlePaginationMenuButton(){this._updateFeatureMenu()}_openFeatureMenu(){this._updateFeatureMenu(!0)}_closeFeatureMenu(){this._updateFeatureMenu(!1)}_updateFeatureMenu(e=!this.featureMenuOpen){this.featureMenuOpen=e}_previousFeature(){this.viewModel.previous()}_nextFeature(){this.viewModel.next()}_handleFeatureBack(){this.initialDisplayMode==="list"?(this.selectedFeatureIndex=-1,this.setFocus()):this._openFeatureMenu()}_handleFeatureMenuBack(){this.initialDisplayMode==="list"?(this.selectedFeatureIndex=-1,this.setFocus()):this.featureMenuOpen&&this._closeFeatureMenu()}_setActiveFeature(e){let{viewModel:t}=this;t.activeFeature=t.features?.[e]||null}_removeActiveFeature(){this.viewModel.activeFeature=null}_selectFeature(e){this.viewModel.selectedFeatureIndex=e,this.initialDisplayMode==="feature"?this._handleFeatureMenuBack():this.setFocus()}_unobserveFeatureMenuObserver(){this._featureMenuIntersectionObserverNode&&this._featureMenuIntersectionObserver.unobserve(this._featureMenuIntersectionObserverNode)}_featureMenuIntersectionObserverCreated(e){this._unobserveFeatureMenuObserver(),e&&this._featureMenuIntersectionObserver.observe(e),this._featureMenuIntersectionObserverNode=e}_getActionTitle(e){let{messages:t,selectedFeature:s}=this,{id:i}=e,n=s?.attributes,o=e.title??"",l=i==="zoom-to-feature"?u(o,{messages:t}):i==="remove-selected-feature"?u(o,{messages:t}):i==="zoom-to-clustered-features"?u(o,{messages:t}):i==="browse-clustered-features"?u(o,{messages:t}):e.title;return l&&n?u(l,n):l??""}_onMainKeydown(e){let{key:t}=e;Z(t,this._direction)&&(e.stopPropagation(),this._handleFeatureMenuBack(),this.previous(),this.setFocus()),U(t,this._direction)&&(e.stopPropagation(),this._handleFeatureMenuBack(),this.next(),this.setFocus())}_featureMenuViewportScrollTop(){this._featureMenuViewportNode.value?.scrollContentTo({top:0})}_selectedFeatureIndexUpdated(e,t){let{featureCount:s,waitingForResult:i}=this.viewModel;i||!s||e===t||e===-1||(this._removeFlowItems(),this._rootFlowItemNode.value?.scrollContentTo({top:0}))}_triggerAction(e){this.triggerAction(e),this.arcgisTriggerAction.emit({action:e})}_viewChange(){this.viewModel.clear(),this.open=!1}_closeOpenActionMenu(){let{_actionBarMenuNode:e}=this;e.value&&(e.value.menuOpen=!1)}_removeFlowItems(){this.flowItems?.destroyAll()}_getDrillInFlowItemDescription(e){switch(e.flowType){case"feature":case"feature-association":case"feature-utility-network-associations":case"feature-utility-network-association-type":return e.description;case"feature-relationship":return e.allItemsDescription}}_handleDrillInBackClick(){this.flowItems?.pop()?.destroy()}_calculateEffectiveHeading(){let{title:e,selectedFeatureViewModel:t}=this.viewModel;return t?t?.state==="error"?this.messages?.errorMessage??"":t?.title||"":e??""}_getHeading(){return!this.hideHeading&&this.effectiveHeading?this.effectiveHeading:""}_removeSpinner(e){e?.manager?.component?.extraContent?.remove(this._spinnerEl),this._spinnerEl=void 0}_createSpinner(){let e=this.referenceElement;e&&(this._removeSpinner(e),this._spinnerEl=R(a`<arcgis-spinner .label=${this.messages.loading??""} .trackLocation=${!this.hideSpinner&&this.viewModel.visible&&this.viewModel?.waitingForResult} .location=${this.viewModel?.location??void 0} .view=${this.viewModel?.view??void 0}></arcgis-spinner>`),e.manager?.component?.extraContent?.add(this._spinnerEl))}render(){return a`<div class="root" @keydown=${this._onMainKeydown}>${this._renderHeader()}${this._renderContentContainer()}</div>`}_renderFeatureNavigation(){return[this._renderPagination(),this.initialDisplayMode==="list"?this._renderFeaturePaginationText():this._renderFeatureMenuButton()]}_renderHeader(){return this.featureNavigationTop&&this._featureNavigationVisible?a`<div class="header">${this._renderFeatureNavigation()}</div>`:null}_renderFooter(){return!this.featureNavigationTop&&this._featureNavigationVisible?a`<div class="footer" slot=footer>${this._renderFeatureNavigation()}</div>`:null}_renderFeaturePaginationText(){let{messages:e,viewModel:t}=this,{featureCount:s,selectedFeatureIndex:i}=t;return a`<div class="pagination-text">${u(e.pageText??"",{index:I(i+1),total:I(s)})}</div>`}_renderFeatureMenuButton(){let{messages:e,viewModel:t}=this,{featureCount:s,selectedFeatureIndex:i,pendingPromisesCount:n}=t;return a`<calcite-action class="pagination-menu-button" icon=list .label=${e.selectFeature} .loading=${n>0} @click=${this._handlePaginationMenuButton} .text=${u(e.pageText??"",{index:I(i+1),total:I(s)})} text-enabled title=${e.selectFeature??c}></calcite-action>`}_renderPagination(){let{previous:e,next:t}=this.messages;return a`<calcite-action-bar class="pagination-action-bar" expand-disabled layout=horizontal overflow-actions-disabled scale=s><calcite-action-group scale=s><calcite-action class="pagination-previous" icon=chevron-left icon-flip-rtl .label=${e??""} @click=${this._previousFeature} .text=${e??""} title=${e??""??c}></calcite-action><calcite-action icon=chevron-right icon-flip-rtl .label=${t??""} @click=${this._nextFeature} .text=${t??""} title=${t??""??c}></calcite-action></calcite-action-group></calcite-action-bar>`}_renderFeatureMenuItem(e){let{initialDisplayMode:t}=this,{selectedFeatureViewModel:s,featureViewModels:i}=this.viewModel,n=e===s,o=i.indexOf(e);return a`<calcite-list-item @blur=${this._removeActiveFeature} @focus=${()=>this._setActiveFeature(o)} @mouseleave=${this._removeActiveFeature} @mouseover=${()=>this._setActiveFeature(o)} .selected=${n} @calciteListItemSelect=${()=>this._selectFeature(o)}><span .innerHTML=${(b.sanitize(e.title)||this.messages.untitled)??""} slot=content></span>${t==="list"?a`<calcite-icon flip-rtl icon=chevron-right scale=s slot=content-end></calcite-icon>`:null}</calcite-list-item>`}_renderFeatureMenu(){let{messages:e,viewModel:t}=this,s=this._groupResultsByLayer(),i=this.initialDisplayMode==="list"?"none":"single";return t.featureViewModels.length?a`<calcite-list display-mode=flat .label=${e?.featuresList??""} selection-appearance=icon .selectionMode=${i}>${Array.from(s.keys(),n=>{let o=s.get(n)?.map(d=>this._renderFeatureMenuItem(d)),l=n?n.title??this.messages.untitled:null;return!this.hideFeatureListLayerTitle&&l!==null?k(n??"map-graphics",a`<calcite-list-item-group .heading=${l}>${o}</calcite-list-item-group>`):o})}</calcite-list>`:null}_renderHeaderAction(e){let t=e.title||"";return e.visible?a`<calcite-action .active=${e.type==="toggle"?e.value:!1} .disabled=${e.disabled} .icon=${e.icon??void 0} .indicator=${e.active} .loading=${e.active} @click=${()=>this._triggerAction(e)} slot=header-actions-end .text=${t} title=${t??c}></calcite-action>`:null}_renderHeaderActions(){return this.headerActions.map(e=>this._renderHeaderAction(e)).toArray()}_renderContentFeature(){let{headingLevel:e,hideCloseButton:t,_isCollapsed:s,_collapseEnabled:i,_featureFlowItemSelected:n,featureNavigationTop:o,flowItems:l,initialDisplayMode:d,selectedFeature:g,hideHeading:f}=this,{active:w,selectedFeatureViewModel:p,content:m}=this.viewModel,h=this._getHeading();if(d==="list"&&!g)return null;let F=l.length===0&&n,T=p?!p.content:!m;return a`<calcite-flow-item class=${x(y({"content-feature":!0,"flow-item-collapsed":s}))} .closable=${!t} .closed=${!w} .collapsed=${s} .collapseDirection=${this.collapseDirection??(o?"down":"up")} .collapsible=${i} .headingLevel=${e} .selected=${F} @calciteFlowItemBack=${this._handleFeatureBack} .loading=${!!this._openRelatedFeatureAbortController} .messageOverrides=${{collapse:this.messages.collapse,expand:this.messages.expand}} @calciteFlowItemClose=${this._handleClose} @calciteFlowItemToggle=${this._handleCollapseToggle} .heading=${!f&&h?D(h):void 0} ${v(this._rootFlowItemNode)}>${!f&&h?a`<div slot=heading><div .innerHTML=${b.sanitize(h??"")??""}></div></div>`:null}${this._renderHeaderActions()}${this._renderActionBar()}<div class=${x(y("container","content-container",{"content-hidden":T}))}>${this._renderContent()}</div>${this._renderFooter()}</calcite-flow-item>`}_renderFeatureMenuContainer(){let{viewModel:e,hideCloseButton:t,featureMenuTitle:s,messages:i,initialDisplayMode:n,featureMenuOpen:o,_featureFlowItemSelected:l,_collapseEnabled:d,_isCollapsed:g,featureNavigationTop:f,headingLevel:w}=this,{active:p,featureViewModels:m,pendingPromisesCount:h}=e,F=s??i.selectFeature;if(n==="feature"&&!o)return null;let T=!l;return a`<calcite-flow-item class=${x(y({"flow-item-collapsed":g}))} .closable=${n==="list"&&!t} .closed=${!p} .collapsed=${n==="list"&&g} .collapseDirection=${this.collapseDirection??(f?"down":"up")} .collapsible=${n==="list"&&d} .messageOverrides=${{collapse:this.messages.collapse,expand:this.messages.expand}} .description=${this.hideFeatureMenuHeading?void 0:u(i.total??"",{total:m.length})} .heading=${this.hideFeatureMenuHeading?void 0:F} .headingLevel=${w} .loading=${e.waitingForContents} .selected=${T} @calciteFlowItemBack=${W=>{W.preventDefault(),this._handleFeatureMenuBack()}} @calciteFlowItemClose=${this._handleClose} @calciteFlowItemToggle=${this._handleCollapseToggle} ${v(this._featureMenuViewportNode)}>${n==="list"?this._renderHeaderActions():null}${h>0?a`<calcite-loader class="loader" inline .label=${i.loading??""} slot=header-actions-end></calcite-loader>`:null}<div class="container">${this._renderFeatureMenu()}</div><div class="feature-menu-observer" ${v(this._featureMenuIntersectionObserverCreated)}></div>${n==="feature"?a`<calcite-button appearance=transparent @click=${this._handleFeatureMenuBack} slot=footer-start width=full>${i.back}</calcite-button>`:null}</calcite-flow-item>`}_renderFlowItem(e,t){let{messages:s,hideCloseButton:i,hideSelectFeature:n,active:o,hideHeading:l}=this,d="graphic"in e&&"isFeatureFromTable"in e&&!e.isFeatureFromTable,g=d&&!n,f=e.flowType==="feature-association",w=s.returnToInitialFeature??"",p=s?.selectFeature,m=this._getActionTitle(_),h=!this.hideActionBar&&f&&d;return a`<calcite-flow-item .closable=${!i} .closed=${!o} .description=${D(this._getDrillInFlowItemDescription(e)??"")} .heading=${l?void 0:D(e.heading??"")} .selected=${t} @calciteFlowItemBack=${F=>{F.preventDefault(),this._handleDrillInBackClick()}} .loading=${!!this._openRelatedFeatureAbortController} @calciteFlowItemClose=${this._handleClose}>${l?null:a`<div slot=heading><div .innerHTML=${b.sanitize(e.heading??"")??""}></div></div>`}<div slot=description><div .innerHTML=${b.sanitize(this._getDrillInFlowItemDescription(e)??"")??""}></div></div><calcite-action class="action-exit" icon=move-up @click=${this._removeFlowItems} slot=header-actions-start .text=${w??""} title=${w??""??c}></calcite-action>${g?a`<calcite-action icon=zoom-to-object @click=${()=>this._openRelatedFeature(e)} slot=header-actions-end .text=${p??""} title=${p??c}></calcite-action>`:null}${h?a`<calcite-action-bar expand-disabled expanded scale=s slot=action-bar><calcite-action-group overlay-positioning=fixed scale=s><calcite-action .disabled=${_.disabled} .icon=${_.icon??void 0} .loading=${_.active} scale=s text-enabled .text=${m} title=${m??c} @click=${()=>j(this.viewModel,_,e)}></calcite-action></calcite-action-group></calcite-action-bar>`:null}<div class="container">${e}</div></calcite-flow-item>`}_renderContentContainer(){let e=this.flowItems?.toArray(),t=e?.map((i,n)=>this._renderFlowItem(i,this._featureFlowItemSelected&&n===e.length-1)),s=this.initialDisplayMode==="list"?[this._renderFeatureMenuContainer(),this._renderContentFeature(),t]:[this._renderContentFeature(),t,this._renderFeatureMenuContainer()];return a`<calcite-flow ${v(this._flowContainerNode)}>${s}</calcite-flow>`}_renderActionBar(){let e=this.viewModel.selectedFeatureViewModel?.isFeatureFromTable&&!this.location?this.viewModel.allActions.filter(t=>t.id!==_.id):this.viewModel.allActions;return!this._isCollapsed&&!this.hideActionBar&&e.length?a`<calcite-action-bar expand-disabled .expanded=${!this._hideActionText} scale=s slot=action-bar><calcite-action-group overlay-positioning=fixed scale=s ${v(this._actionBarMenuNode)}>${this._renderActions()}</calcite-action-group></calcite-action-bar>`:null}_renderActions(){return this.viewModel.allActions.toArray().map(e=>{let t=this._getActionTitle(e);return a`<calcite-action .active=${e.type==="toggle"?e.value:!1} .disabled=${e.disabled} .icon=${e.icon??void 0} .loading=${e.active} scale=s .textEnabled=${!this._hideActionText} .text=${t??""} title=${t??c} .hidden=${!e.visible} @click=${()=>this._triggerAction(e)}></calcite-action>`})}_renderContent(){let{content:e,selectedFeatureViewModel:t}=this.viewModel;return t?a`<arcgis-feature .autoDestroyDisabled=${this.autoDestroyDisabled} .chartAnimationDisabled=${this.chartAnimationDisabled} .defaultPopupTemplateEnabled=${this.defaultPopupTemplateEnabled} .flowItems=${this.flowItems} .graphic=${t.graphic} .headingLevel=${this.headingLevel+1} .hideAttachmentsContent=${this.hideAttachmentsContent} .hideContent=${this.hideContent} .hideCustomContent=${this.hideCustomContent} .hideExpressionContent=${this.hideExpressionContent} .hideFieldsContent=${this.hideFieldsContent} hide-heading .hideLastEditedInfo=${this.hideLastEditedInfo} .hideMediaContent=${this.hideMediaContent} .hideTextContent=${this.hideTextContent} .location=${this.location} .map=${this.map} .referenceElement=${this.referenceElement} .showRelationshipContent=${!this.hideRelationshipContent} .showUtilityNetworkContent=${!this.hideUtilityNetworkContent} .spatialReference=${this.spatialReference} .timeZone=${this.timeZone} ${v(this._selectedFeatureComponent)}></arcgis-feature>`:typeof e=="string"?k(e,a`<div .innerHTML=${b.sanitize(e)??""}></div>`):e??null}};B("arcgis-features",V);return V},"widgets/Features/FeaturesViewModel","intl","core/reactiveUtils","applications/Components/stringUtils","core/Collection","applications/Components/sanitizerUtils","applications/Components/featureUtils","support/actions/ActionButton",b,d,e,f,g,h,i,j)
2
+ import j from"./2JBFSC6D.js";import{a as k}from"./O5T75PGZ.js";import i from"./X6PWBP6M.js";import h from"./MZWO5JYA.js";import g from"./P6CDJ2IV.js";import"./VJVKFKSG.js";import{b as U,c as Z}from"./32XG4IQO.js";import f from"./SYRZLONH.js";import{a as P}from"./JP24H6WY.js";import e from"./V6VLUKHQ.js";import d from"./7MO7E734.js";import{e as L,g as H}from"./Z7J6NDSB.js";import"./VWED2WAO.js";import b from"./3MWUCGFA.js";import"./QUZTFUWM.js";import{d as y}from"./RZ6SODVT.js";import{M,N as v,O as N,P as x,R as c,S as R,U as B,a as O,b as a,o as C,p as $,x as A}from"./CDSRIIHC.js";import"./H6RQVSYM.js";export default $arcgis.t(([X,{substitute:u,formatNumber:I},{watch:r},{stripHTML:D},G,{renderingSanitizer:b},{initializeProjection:q},J,,,,z,,,{d:S},{c:j,d:K}])=>{var Q=O`:host{display:flex;overflow:hidden;flex:1 1 auto}.root{--calcite-color-background: var(--calcite-color-foreground-1);display:flex;overflow:hidden;flex:1 1 auto;flex-direction:column}.root img{image-orientation:from-image}.flow-item-collapsed{--calcite-flow-item-header-border-block-end: none}.container{display:flex;flex:1 1 auto;background-color:var(--calcite-color-foreground-1)}.container calcite-list{width:100%}.container:not(:empty,.content-hidden){padding:var(--arcgis-internal-padding-md, var(--calcite-spacing-md))}.root .arcgis-feature,.root .arcgis-feature-relationship,.root .arcgis-feature-utility-network-associations{background-color:transparent}.heading{word-break:break-word;word-wrap:break-word}.header,.footer{display:flex;align-items:center;justify-content:flex-end;background-color:var(--calcite-color-foreground-1)}.footer{flex:1}.pagination-text{padding-inline:var(--calcite-spacing-sm);color:var(--calcite-color-text-3);font-size:var(--calcite-font-size-sm)}.loader{align-self:center;padding-inline:var(--calcite-spacing-lg)}.pagination-action-bar{flex:1}.pagination-menu-button{padding-inline:var(--calcite-spacing-xxs);border-inline-start:var(--calcite-border-width-sm) solid var(--calcite-color-border-3)}.icon{display:inline-block;flex:0 0 var(--calcite-spacing-lg);width:var(--calcite-spacing-lg);height:var(--calcite-spacing-lg)}.action-image{flex:0 0 var(--calcite-spacing-lg);background-position:50% 50%;background-repeat:no-repeat;background-size:contain;width:var(--calcite-spacing-lg);height:var(--calcite-spacing-lg)}.header{border-block-end:var(--calcite-border-width-sm) solid var(--calcite-color-border-3)}.content-feature{--calcite-flow-item-footer-padding: 0}.feature-menu-observer{position:relative;bottom:var(--calcite-spacing-xxl);z-index:2;text-align:center}.action-exit{transform:scaleX(-1)}`,Y=new J({icon:"magnifying-glass-plus",id:"zoom-to-feature",title:"{messages.zoom}"}),_=Y.clone();function ee(E){return E?.declaredClass.startsWith("esri.layers.")??!1}var te=z(X),V=class extends N{constructor(){super(...arguments),this._direction=L(),this._fetchFeaturesController=null,this._featureMenuIntersectionObserverCallback=([e])=>{e?.isIntersecting&&this.viewModel.featurePage!=null&&this.viewModel.featurePage++},this._featureMenuIntersectionObserver=new IntersectionObserver(this._featureMenuIntersectionObserverCallback,{root:window.document}),this._featureMenuIntersectionObserverNode=null,this._rootFlowItemNode=M(),this._featureMenuViewportNode=M(),this._actionBarMenuNode=M(),this._flowContainerNode=M(),this.messages=P(),this._selectedFeatureComponent=M(),this._cancelOpenRelatedFeature=()=>{let{_openRelatedFeatureAbortController:e}=this;e&&e.abort(),this._openRelatedFeatureAbortController=null},this._openRelatedFeatureAbortController=null,this.flowItems=new G,this.viewModel=te(this),this.actions=this.viewModel.actions,this.active=this.viewModel.active,this.autoDestroyDisabled=!1,this.collapsed=!1,this.content=this.viewModel.content,this.defaultPopupTemplateEnabled=this.viewModel.defaultPopupTemplateEnabled,this.featureCount=this.viewModel.featureCount,this.featureMenuOpen=this.viewModel.featureMenuOpen,this.featureMenuTitle=this.viewModel.featureMenuTitle,this.featureNavigationTop=!1,this.features=this.viewModel.features,this.featuresPerPage=this.viewModel.featuresPerPage,this.featureViewModelAbilities=this.viewModel.featureViewModelAbilities,this.goToOverride=this.viewModel.goToOverride,this.headerActions=new G,this.heading=this.viewModel.title,this.headingLevel=2,this.hideActionBar=!1,this.hideCloseButton=!1,this.hideFeatureMenuHeading=!1,this.hideFeatureNavigation=!1,this.hideFeatureListLayerTitle=!1,this.hideHeading=!1,this.hideSelectFeature=!1,this.hideSpinner=!1,this.hideContent=!1,this.hideExpressionContent=!1,this.hideLastEditedInfo=!1,this.highlightDisabled=this.viewModel.highlightEnabled,this.includeDefaultActionsDisabled=this.viewModel.includeDefaultActions,this.initialDisplayMode=this.viewModel.initialDisplayMode,this.location=this.viewModel.location,this.map=this.viewModel.map,this.open=this.viewModel.visible,this.promises=this.viewModel.promises,this.responsiveActionsEnabled=!1,this.selectedFeature=this.viewModel.selectedFeature,this.selectedFeatureIndex=this.viewModel.selectedFeatureIndex,this.showCollapseButton=!1,this.spatialReference=this.viewModel.spatialReference,this.state=this.viewModel.state,this.timeZone=this.viewModel.timeZone,this.updateLocationEnabled=this.viewModel.updateLocationEnabled,this.view=this.viewModel.view,this.arcgisPropertyChange=H()("active","collapsed","effectiveHeading","featureCount","featureMenuOpen","features","promises","selectedDrillInFeature","selectedFeature","selectedFeatureComponent","selectedFeatureIndex","state","open"),this.arcgisReady=A(),this.arcgisClose=A(),this.arcgisTriggerAction=A()}static{this.properties={_openRelatedFeatureAbortController:16,flowItems:16,_hideActionText:16,_featureNavigationVisible:16,_isCollapsed:16,_collapseEnabled:16,_featureFlowItemSelected:16,viewModel:0,actions:0,active:0,autoDestroyDisabled:5,collapseDirection:1,collapsed:5,content:1,defaultPopupTemplateEnabled:5,effectiveHeading:32,featureCount:9,featureMenuOpen:5,featureMenuTitle:1,featureNavigationTop:5,features:0,featuresPerPage:9,featureViewModelAbilities:0,goToOverride:0,headerActions:0,heading:1,headingLevel:9,hideActionBar:5,hideCloseButton:5,hideFeatureMenuHeading:5,hideFeatureNavigation:5,hideFeatureListLayerTitle:5,hideHeading:5,hideSelectFeature:5,hideSpinner:5,hideContent:5,chartAnimationDisabled:5,hideAttachmentsContent:5,hideCustomContent:5,hideExpressionContent:5,hideFieldsContent:5,hideMediaContent:5,hideRelationshipContent:5,hideTextContent:5,hideUtilityNetworkContent:5,hideLastEditedInfo:5,highlightDisabled:5,icon:1,includeDefaultActionsDisabled:5,initialDisplayMode:1,label:1,location:0,map:0,messageOverrides:0,open:5,referenceElement:1,promises:0,responsiveActionsEnabled:5,selectedDrillInFeature:32,selectedFeature:0,selectedFeatureComponent:32,selectedFeatureIndex:9,showCollapseButton:5,spatialReference:0,state:32,timeZone:1,updateLocationEnabled:5,view:0}}static{this.styles=Q}get _hideActionText(){if(!this.responsiveActionsEnabled)return!1;let e=this.viewModel.view?.widthBreakpoint;return e==="xsmall"||e==="small"||e==="medium"}get _featureNavigationVisible(){return this.viewModel.active&&this.viewModel.featureCount>1&&!!this.viewModel.selectedFeature&&!this.hideFeatureNavigation}get _isCollapsed(){return this._collapseEnabled&&this.collapsed}get _collapseEnabled(){return this.showCollapseButton&&(this.initialDisplayMode==="list"||!!(this.heading||this.viewModel.selectedFeatureViewModel?.title)&&!!(this.content||this.viewModel.selectedFeatureViewModel?.content))}get _featureFlowItemSelected(){return this.initialDisplayMode==="list"?!!this.selectedFeature:!this.featureMenuOpen}get chartAnimationDisabled(){return!(this.viewModel.featureViewModelAbilities?.chartAnimation??!0)}set chartAnimationDisabled(e){this.viewModel.featureViewModelAbilities??={},this.viewModel.featureViewModelAbilities.chartAnimation=!e}get hideAttachmentsContent(){return!(this.viewModel.featureViewModelAbilities?.attachmentsContent??!0)}set hideAttachmentsContent(e){this.viewModel.featureViewModelAbilities??={},this.viewModel.featureViewModelAbilities.attachmentsContent=!e}get hideCustomContent(){return!(this.viewModel.featureViewModelAbilities?.customContent??!0)}set hideCustomContent(e){this.viewModel.featureViewModelAbilities??={},this.viewModel.featureViewModelAbilities.customContent=!e}get hideFieldsContent(){return!(this.viewModel.featureViewModelAbilities?.fieldsContent??!0)}set hideFieldsContent(e){this.viewModel.featureViewModelAbilities??={},this.viewModel.featureViewModelAbilities.fieldsContent=!e}get hideMediaContent(){return!(this.viewModel.featureViewModelAbilities?.mediaContent??!0)}set hideMediaContent(e){this.viewModel.featureViewModelAbilities??={},this.viewModel.featureViewModelAbilities.mediaContent=!e}get hideRelationshipContent(){return!(this.viewModel.featureViewModelAbilities?.relationshipContent??!0)}set hideRelationshipContent(e){this.viewModel.featureViewModelAbilities??={},this.viewModel.featureViewModelAbilities.relationshipContent=!e}get hideTextContent(){return!(this.viewModel.featureViewModelAbilities?.textContent??!0)}set hideTextContent(e){this.viewModel.featureViewModelAbilities??={},this.viewModel.featureViewModelAbilities.textContent=!e}get hideUtilityNetworkContent(){return!(this.viewModel.featureViewModelAbilities?.utilityNetworkAssociationsContent??!0)}set hideUtilityNetworkContent(e){this.viewModel.featureViewModelAbilities??={},this.viewModel.featureViewModelAbilities.utilityNetworkAssociationsContent=!e}async clear(){return this.viewModel.clear()}async close(){this.open=!1}async destroy(){await this.manager.destroy(),this._removeSpinner(this.referenceElement),this._cancelOpenRelatedFeature(),this._removeFlowItems(),this._unobserveFeatureMenuObserver(),this._cancelFetchingFeatures(),this._featureMenuIntersectionObserver?.disconnect()}async fetchFeatures(e,t){this._cancelFetchingFeatures();let{signal:s}=t??{},i=new AbortController,{signal:n}=i,o=s?AbortSignal.any([n,s]):n;if(this._fetchFeaturesController=i,!e&&this.view&&this.location&&(await q(this.location.spatialReference,this.view.spatialReference,null,{signal:o}),e=this.view.toScreen(this.location)??void 0),!e)return;let l=await this.viewModel.fetchFeatures(e,{...t,signal:o});this.location=l.location,this.promises=l.pendingFeatures}async next(){return $("warn",this,"The return type of FeaturesViewModel on the next() method is deprecated. At 6.0, this method will return void."),this.viewModel.next()}async previous(){return $("warn",this,"The return type of FeaturesViewModel on the previous() method is deprecated. At 6.0, this method will return void."),this.viewModel.previous()}async setFocus(){this._flowContainerNode.value?.setFocus()}async triggerAction(e){if($("warn",this,"The triggerAction() method is deprecated since 5.1. Trigger actions with manual user interaction within the component.",{once:!0}),!e.disabled)return e?.type==="toggle"&&(e.value=!e.value),await K(e,this.viewModel)}connectedCallback(){super.connectedCallback(),this._createSpinner()}disconnectedCallback(){super.disconnectedCallback(),this._removeSpinner(this.referenceElement)}loaded(){this.manager.onLifecycle(()=>[r(()=>this.viewModel?.selectedFeatureIndex,(e,t)=>this._selectedFeatureIndexUpdated(e,t)),r(()=>this.viewModel?.view,(e,t)=>t&&this._viewChange()),r(()=>this._spinnerEl?.screenLocation,()=>this._closeOpenActionMenu()),r(()=>this.selectedFeatureComponent?.viewModel,()=>this._removeFlowItems()),r(()=>this.viewModel?.featureViewModels,()=>this._featureMenuViewportScrollTop()),r(()=>this.flowItems.length,()=>this._syncSelectedDrillInFeature()),r(()=>[this.viewModel?.title,this.viewModel?.selectedFeatureViewModel?.title,this.viewModel?.selectedFeatureViewModel?.state],()=>this._syncEffectiveHeading(),{initial:!0}),r(()=>[this.flowItems?.length,this.featureMenuOpen],()=>{this.setFocus()}),r(()=>this.referenceElement,(e,t)=>{this._removeSpinner(t),this._createSpinner()},{initial:!0}),r(()=>[this.hideSpinner,this.viewModel?.view,this.viewModel?.location,this.viewModel?.waitingForResult,this.viewModel?.visible],()=>this._createSpinner(),{initial:!0})])}updated(){let e=this._selectedFeatureComponent.value??void 0;this.selectedFeatureComponent!==e&&C(()=>this.selectedFeatureComponent=e)}_syncSelectedDrillInFeature(){let e=this.flowItems.getItemAt(this.flowItems.length-1);C(()=>this.selectedDrillInFeature=e?.graphic??void 0)}_syncEffectiveHeading(){let e=this._calculateEffectiveHeading();this.effectiveHeading!==e&&C(()=>this.effectiveHeading=e)}_cancelFetchingFeatures(){this._fetchFeaturesController?.abort(),this._fetchFeaturesController=null}_handleClose(){this.close(),this.arcgisClose.emit()}_groupResultsByLayer(){let{featureViewModels:e}=this.viewModel,t=new Map;return e.forEach(s=>{let i=s?.graphic;if(!i)return;let n=S(i),o=ee(n)?n:null,l=t.get(o)??[];t.set(o,[...l,s])}),t}_handleCollapseToggle(){this.collapsed=!this.collapsed}async _openRelatedFeature(e){this._cancelOpenRelatedFeature();let t=new AbortController;if(this._openRelatedFeatureAbortController=t,await e.updateGeometry(),this._openRelatedFeatureAbortController!==t)return;let s=e.graphic,i=s?.geometry;if(i==null||s==null){this._openRelatedFeatureAbortController===t&&(this._openRelatedFeatureAbortController=null);return}if(this._removeFlowItems(),await this.viewModel.zoomTo({target:i}),this._openRelatedFeatureAbortController!==t)return;let n=await $arcgis.t(m=>m[0],"geometry/operators/labelPointOperator");if(this._openRelatedFeatureAbortController!==t)return;let o=n.execute(i);o!=null&&(this.location=o),this.features=[s],this.open=!0,await this.setFocus(),this._openRelatedFeatureAbortController===t&&(this._openRelatedFeatureAbortController=null)}_handlePaginationMenuButton(){this._updateFeatureMenu()}_openFeatureMenu(){this._updateFeatureMenu(!0)}_closeFeatureMenu(){this._updateFeatureMenu(!1)}_updateFeatureMenu(e=!this.featureMenuOpen){this.featureMenuOpen=e}_previousFeature(){this.viewModel.previous()}_nextFeature(){this.viewModel.next()}_handleFeatureBack(){this.initialDisplayMode==="list"?(this.selectedFeatureIndex=-1,this.setFocus()):this._openFeatureMenu()}_handleFeatureMenuBack(){this.initialDisplayMode==="list"?(this.selectedFeatureIndex=-1,this.setFocus()):this.featureMenuOpen&&this._closeFeatureMenu()}_setActiveFeature(e){let{viewModel:t}=this;t.activeFeature=t.features?.[e]||null}_removeActiveFeature(){this.viewModel.activeFeature=null}_selectFeature(e){this.viewModel.selectedFeatureIndex=e,this.initialDisplayMode==="feature"?this._handleFeatureMenuBack():this.setFocus()}_unobserveFeatureMenuObserver(){this._featureMenuIntersectionObserverNode&&this._featureMenuIntersectionObserver.unobserve(this._featureMenuIntersectionObserverNode)}_featureMenuIntersectionObserverCreated(e){this._unobserveFeatureMenuObserver(),e&&this._featureMenuIntersectionObserver.observe(e),this._featureMenuIntersectionObserverNode=e}_getActionTitle(e){let{messages:t,selectedFeature:s}=this,{id:i}=e,n=s?.attributes,o=e.title??"",l=i==="zoom-to-feature"?u(o,{messages:t}):i==="remove-selected-feature"?u(o,{messages:t}):i==="zoom-to-clustered-features"?u(o,{messages:t}):i==="browse-clustered-features"?u(o,{messages:t}):e.title;return l&&n?u(l,n):l??""}_onMainKeydown(e){let{key:t}=e;Z(t,this._direction)&&(e.stopPropagation(),this._handleFeatureMenuBack(),this.previous(),this.setFocus()),U(t,this._direction)&&(e.stopPropagation(),this._handleFeatureMenuBack(),this.next(),this.setFocus())}_featureMenuViewportScrollTop(){this._featureMenuViewportNode.value?.scrollContentTo({top:0})}_selectedFeatureIndexUpdated(e,t){let{featureCount:s,waitingForResult:i}=this.viewModel;i||!s||e===t||e===-1||(this._removeFlowItems(),this._rootFlowItemNode.value?.scrollContentTo({top:0}))}_triggerAction(e){this.triggerAction(e),this.arcgisTriggerAction.emit({action:e})}_viewChange(){this.viewModel.clear(),this.open=!1}_closeOpenActionMenu(){let{_actionBarMenuNode:e}=this;e.value&&(e.value.menuOpen=!1)}_removeFlowItems(){this.flowItems?.destroyAll()}_getDrillInFlowItemDescription(e){switch(e.flowType){case"feature":case"feature-association":case"feature-utility-network-associations":case"feature-utility-network-association-type":return e.description;case"feature-relationship":return e.allItemsDescription}}_handleDrillInBackClick(){this.flowItems?.pop()?.destroy()}_calculateEffectiveHeading(){let{title:e,selectedFeatureViewModel:t}=this.viewModel;return t?t?.state==="error"?this.messages?.errorMessage??"":t?.title||"":e??""}_getHeading(){return!this.hideHeading&&this.effectiveHeading?this.effectiveHeading:""}_removeSpinner(e){e?.manager?.component?.extraContent?.remove(this._spinnerEl),this._spinnerEl=void 0}_createSpinner(){let e=this.referenceElement;e&&(this._removeSpinner(e),this._spinnerEl=R(a`<arcgis-spinner .label=${this.messages.loading??""} .trackLocation=${!this.hideSpinner&&this.viewModel.visible&&this.viewModel?.waitingForResult} .location=${this.viewModel?.location??void 0} .view=${this.viewModel?.view??void 0}></arcgis-spinner>`),e.manager?.component?.extraContent?.add(this._spinnerEl))}render(){return a`<div class="root" @keydown=${this._onMainKeydown}>${this._renderHeader()}${this._renderContentContainer()}</div>`}_renderFeatureNavigation(){return[this._renderPagination(),this.initialDisplayMode==="list"?this._renderFeaturePaginationText():this._renderFeatureMenuButton()]}_renderHeader(){return this.featureNavigationTop&&this._featureNavigationVisible?a`<div class="header">${this._renderFeatureNavigation()}</div>`:null}_renderFooter(){return!this.featureNavigationTop&&this._featureNavigationVisible?a`<div class="footer" slot=footer>${this._renderFeatureNavigation()}</div>`:null}_renderFeaturePaginationText(){let{messages:e,viewModel:t}=this,{featureCount:s,selectedFeatureIndex:i}=t;return a`<div class="pagination-text">${u(e.pageText??"",{index:I(i+1),total:I(s)})}</div>`}_renderFeatureMenuButton(){let{messages:e,viewModel:t}=this,{featureCount:s,selectedFeatureIndex:i,pendingPromisesCount:n}=t;return a`<calcite-action class="pagination-menu-button" icon=list .label=${e.selectFeature} .loading=${n>0} @click=${this._handlePaginationMenuButton} .text=${u(e.pageText??"",{index:I(i+1),total:I(s)})} text-enabled title=${e.selectFeature??c}></calcite-action>`}_renderPagination(){let{previous:e,next:t}=this.messages;return a`<calcite-action-bar class="pagination-action-bar" expand-disabled layout=horizontal overflow-actions-disabled scale=s><calcite-action-group scale=s><calcite-action class="pagination-previous" icon=chevron-left icon-flip-rtl .label=${e??""} @click=${this._previousFeature} .text=${e??""} title=${e??""??c}></calcite-action><calcite-action icon=chevron-right icon-flip-rtl .label=${t??""} @click=${this._nextFeature} .text=${t??""} title=${t??""??c}></calcite-action></calcite-action-group></calcite-action-bar>`}_renderFeatureMenuItem(e){let{initialDisplayMode:t}=this,{selectedFeatureViewModel:s,featureViewModels:i}=this.viewModel,n=e===s,o=i.indexOf(e);return a`<calcite-list-item @blur=${this._removeActiveFeature} @focus=${()=>this._setActiveFeature(o)} @mouseleave=${this._removeActiveFeature} @mouseover=${()=>this._setActiveFeature(o)} .selected=${n} @calciteListItemSelect=${()=>this._selectFeature(o)}><span .innerHTML=${(b.sanitize(e.title)||this.messages.untitled)??""} slot=content></span>${t==="list"?a`<calcite-icon flip-rtl icon=chevron-right scale=s slot=content-end></calcite-icon>`:null}</calcite-list-item>`}_renderFeatureMenu(){let{messages:e,viewModel:t}=this,s=this._groupResultsByLayer(),i=this.initialDisplayMode==="list"?"none":"single";return t.featureViewModels.length?a`<calcite-list display-mode=flat .label=${e?.featuresList??""} selection-appearance=icon .selectionMode=${i}>${Array.from(s.keys(),n=>{let o=s.get(n)?.map(d=>this._renderFeatureMenuItem(d)),l=n?n.title??this.messages.untitled:null;return!this.hideFeatureListLayerTitle&&l!==null?k(n??"map-graphics",a`<calcite-list-item-group .heading=${l}>${o}</calcite-list-item-group>`):o})}</calcite-list>`:null}_renderHeaderAction(e){let t=e.title||"";return e.visible?a`<calcite-action .active=${e.type==="toggle"?e.value:!1} .disabled=${e.disabled} .icon=${e.icon??void 0} .indicator=${e.active} .loading=${e.active} @click=${()=>this._triggerAction(e)} slot=header-actions-end .text=${t} title=${t??c}></calcite-action>`:null}_renderHeaderActions(){return this.headerActions.map(e=>this._renderHeaderAction(e)).toArray()}_renderContentFeature(){let{headingLevel:e,hideCloseButton:t,_isCollapsed:s,_collapseEnabled:i,_featureFlowItemSelected:n,featureNavigationTop:o,flowItems:l,initialDisplayMode:d,selectedFeature:g,hideHeading:f}=this,{active:w,selectedFeatureViewModel:p,content:m}=this.viewModel,h=this._getHeading();if(d==="list"&&!g)return null;let F=l.length===0&&n,T=p?!p.content:!m;return a`<calcite-flow-item class=${x(y({"content-feature":!0,"flow-item-collapsed":s}))} .closable=${!t} .closed=${!w} .collapsed=${s} .collapseDirection=${this.collapseDirection??(o?"down":"up")} .collapsible=${i} .headingLevel=${e} .selected=${F} @calciteFlowItemBack=${this._handleFeatureBack} .loading=${!!this._openRelatedFeatureAbortController} .messageOverrides=${{collapse:this.messages.collapse,expand:this.messages.expand}} @calciteFlowItemClose=${this._handleClose} @calciteFlowItemToggle=${this._handleCollapseToggle} .heading=${!f&&h?D(h):void 0} ${v(this._rootFlowItemNode)}>${!f&&h?a`<div slot=heading><div .innerHTML=${b.sanitize(h??"")??""}></div></div>`:null}${this._renderHeaderActions()}${this._renderActionBar()}<div class=${x(y("container","content-container",{"content-hidden":T}))}>${this._renderContent()}</div>${this._renderFooter()}</calcite-flow-item>`}_renderFeatureMenuContainer(){let{viewModel:e,hideCloseButton:t,featureMenuTitle:s,messages:i,initialDisplayMode:n,featureMenuOpen:o,_featureFlowItemSelected:l,_collapseEnabled:d,_isCollapsed:g,featureNavigationTop:f,headingLevel:w}=this,{active:p,featureViewModels:m,pendingPromisesCount:h}=e,F=s??i.selectFeature;if(n==="feature"&&!o)return null;let T=!l;return a`<calcite-flow-item class=${x(y({"flow-item-collapsed":g}))} .closable=${n==="list"&&!t} .closed=${!p} .collapsed=${n==="list"&&g} .collapseDirection=${this.collapseDirection??(f?"down":"up")} .collapsible=${n==="list"&&d} .messageOverrides=${{collapse:this.messages.collapse,expand:this.messages.expand}} .description=${this.hideFeatureMenuHeading?void 0:u(i.total??"",{total:m.length})} .heading=${this.hideFeatureMenuHeading?void 0:F} .headingLevel=${w} .loading=${e.waitingForContents} .selected=${T} @calciteFlowItemBack=${W=>{W.preventDefault(),this._handleFeatureMenuBack()}} @calciteFlowItemClose=${this._handleClose} @calciteFlowItemToggle=${this._handleCollapseToggle} ${v(this._featureMenuViewportNode)}>${n==="list"?this._renderHeaderActions():null}${h>0?a`<calcite-loader class="loader" inline .label=${i.loading??""} slot=header-actions-end></calcite-loader>`:null}<div class="container">${this._renderFeatureMenu()}</div><div class="feature-menu-observer" ${v(this._featureMenuIntersectionObserverCreated)}></div>${n==="feature"?a`<calcite-button appearance=transparent @click=${this._handleFeatureMenuBack} slot=footer-start width=full>${i.back}</calcite-button>`:null}</calcite-flow-item>`}_renderFlowItem(e,t){let{messages:s,hideCloseButton:i,hideSelectFeature:n,active:o,hideHeading:l}=this,d="graphic"in e&&"isFeatureFromTable"in e&&!e.isFeatureFromTable,g=d&&!n,f=e.flowType==="feature-association",w=s.returnToInitialFeature??"",p=s?.selectFeature,m=this._getActionTitle(_),h=!this.hideActionBar&&f&&d;return a`<calcite-flow-item .closable=${!i} .closed=${!o} .description=${D(this._getDrillInFlowItemDescription(e)??"")} .heading=${l?void 0:D(e.heading??"")} .selected=${t} @calciteFlowItemBack=${F=>{F.preventDefault(),this._handleDrillInBackClick()}} .loading=${!!this._openRelatedFeatureAbortController} @calciteFlowItemClose=${this._handleClose}>${l?null:a`<div slot=heading><div .innerHTML=${b.sanitize(e.heading??"")??""}></div></div>`}<div slot=description><div .innerHTML=${b.sanitize(this._getDrillInFlowItemDescription(e)??"")??""}></div></div><calcite-action class="action-exit" icon=move-up @click=${this._removeFlowItems} slot=header-actions-start .text=${w??""} title=${w??""??c}></calcite-action>${g?a`<calcite-action icon=zoom-to-object @click=${()=>this._openRelatedFeature(e)} slot=header-actions-end .text=${p??""} title=${p??c}></calcite-action>`:null}${h?a`<calcite-action-bar expand-disabled expanded scale=s slot=action-bar><calcite-action-group overlay-positioning=fixed scale=s><calcite-action .disabled=${_.disabled} .icon=${_.icon??void 0} .loading=${_.active} scale=s text-enabled .text=${m} title=${m??c} @click=${()=>j(this.viewModel,_,e)}></calcite-action></calcite-action-group></calcite-action-bar>`:null}<div class="container">${e}</div></calcite-flow-item>`}_renderContentContainer(){let e=this.flowItems?.toArray(),t=e?.map((i,n)=>this._renderFlowItem(i,this._featureFlowItemSelected&&n===e.length-1)),s=this.initialDisplayMode==="list"?[this._renderFeatureMenuContainer(),this._renderContentFeature(),t]:[this._renderContentFeature(),t,this._renderFeatureMenuContainer()];return a`<calcite-flow ${v(this._flowContainerNode)}>${s}</calcite-flow>`}_renderActionBar(){let e=this.viewModel.selectedFeatureViewModel?.isFeatureFromTable&&!this.location?this.viewModel.allActions.filter(t=>t.id!==_.id):this.viewModel.allActions;return!this._isCollapsed&&!this.hideActionBar&&e.length?a`<calcite-action-bar expand-disabled .expanded=${!this._hideActionText} scale=s slot=action-bar><calcite-action-group overlay-positioning=fixed scale=s ${v(this._actionBarMenuNode)}>${this._renderActions()}</calcite-action-group></calcite-action-bar>`:null}_renderActions(){return this.viewModel.allActions.toArray().map(e=>{let t=this._getActionTitle(e);return a`<calcite-action .active=${e.type==="toggle"?e.value:!1} .disabled=${e.disabled} .icon=${e.icon??void 0} .loading=${e.active} scale=s .textEnabled=${!this._hideActionText} .text=${t??""} title=${t??c} .hidden=${!e.visible} @click=${()=>this._triggerAction(e)}></calcite-action>`})}_renderContent(){let{content:e,selectedFeatureViewModel:t}=this.viewModel;return t?a`<arcgis-feature .autoDestroyDisabled=${this.autoDestroyDisabled} .chartAnimationDisabled=${this.chartAnimationDisabled} .defaultPopupTemplateEnabled=${this.defaultPopupTemplateEnabled} .flowItems=${this.flowItems} .graphic=${t.graphic} .headingLevel=${this.headingLevel+1} .hideAttachmentsContent=${this.hideAttachmentsContent} .hideContent=${this.hideContent} .hideCustomContent=${this.hideCustomContent} .hideExpressionContent=${this.hideExpressionContent} .hideFieldsContent=${this.hideFieldsContent} hide-heading .hideLastEditedInfo=${this.hideLastEditedInfo} .hideMediaContent=${this.hideMediaContent} .hideTextContent=${this.hideTextContent} .location=${this.location} .map=${this.map} .messageOverrides=${this.messageOverrides} .referenceElement=${this.referenceElement} .showRelationshipContent=${!this.hideRelationshipContent} .showUtilityNetworkContent=${!this.hideUtilityNetworkContent} .spatialReference=${this.spatialReference} .timeZone=${this.timeZone} ${v(this._selectedFeatureComponent)}></arcgis-feature>`:typeof e=="string"?k(e,a`<div .innerHTML=${b.sanitize(e)??""}></div>`):e??null}};B("arcgis-features",V);return V},"widgets/Features/FeaturesViewModel","intl","core/reactiveUtils","applications/Components/stringUtils","core/Collection","applications/Components/sanitizerUtils","applications/Components/featureUtils","support/actions/ActionButton",b,d,e,f,g,h,i,j)