@arcgis/map-components
Version:
ArcGIS Map Components
2 lines • 27.6 kB
JavaScript
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
import i from"./LPW5NLMK.js";import{a as k}from"./Q52QESBE.js";import h from"./FT372QJV.js";import g from"./R3NYK6BO.js";import f from"./HFRXDFTO.js";import"./PC4PAQXQ.js";import e from"./KA7BM2DQ.js";import{a as S}from"./HZFVK34O.js";import d from"./LKOVDQTE.js";import b from"./OAWV35F7.js";import{h as L}from"./AKBXFBDL.js";import"./LMBRORN7.js";import a from"./5E6WEUZS.js";import{d as y}from"./PBSJQPB2.js";import{M,N as v,O as R,P as x,R as c,S as N,U as B,a as O,b as o,o as C,p as $,x as A}from"./WUJCCZQC.js";import"./3TTFCHAA.js";export default $arcgis.t(([K,{substitute:u,formatNumber:I},{watch:r},{stripHTML:D},Z,{renderingSanitizer:b},{initializeProjection:G},W,,,,P,,,{d:H},{c:z,d:U}])=>{var X=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)}`,q=new W({icon:"magnifying-glass-plus",id:"zoom-to-feature",title:"{messages.zoom}"}),_=q.clone();function J(E){return E?.declaredClass.startsWith("esri.layers.")??!1}var Y=P(K),V=class extends R{constructor(){super(...arguments),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=S(),this._selectedFeatureComponent=M(),this._cancelOpenRelatedFeature=()=>{let{_openRelatedFeatureAbortController:e}=this;e&&e.abort(),this._openRelatedFeatureAbortController=null},this._openRelatedFeatureAbortController=null,this.flowItems=new Z,this.viewModel=Y(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 Z,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=L()("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=X}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,a=s?AbortSignal.any([n,s]):n;if(this._fetchFeaturesController=i,!e&&this.view&&this.location&&(await G(this.location.spatialReference,this.view.spatialReference,null,{signal:a}),e=this.view.toScreen(this.location)??void 0),!e)return;let l=await this.viewModel.fetchFeatures(e,{...t,signal:a});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 U(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=H(i),a=J(n)?n:null,l=t.get(a)??[];t.set(a,[...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 a=n.execute(i);a!=null&&(this.location=a),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,a=e.title??"",l=i==="zoom-to-feature"?u(a,{messages:t}):i==="remove-selected-feature"?u(a,{messages:t}):i==="zoom-to-clustered-features"?u(a,{messages:t}):i==="browse-clustered-features"?u(a,{messages:t}):e.title;return l&&n?u(l,n):l??""}_onMainKeydown(e){let{key:t}=e;t==="ArrowLeft"&&(e.stopPropagation(),this._handleFeatureMenuBack(),this.previous(),this.setFocus()),t==="ArrowRight"&&(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=N(o`<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 o`<div class="root" =${this._onMainKeydown}>${this._renderHeader()}${this._renderContentContainer()}</div>`}_renderFeatureNavigation(){return[this._renderPagination(),this.initialDisplayMode==="list"?this._renderFeaturePaginationText():this._renderFeatureMenuButton()]}_renderHeader(){return this.featureNavigationTop&&this._featureNavigationVisible?o`<div class="header">${this._renderFeatureNavigation()}</div>`:null}_renderFooter(){return!this.featureNavigationTop&&this._featureNavigationVisible?o`<div class="footer" slot=footer>${this._renderFeatureNavigation()}</div>`:null}_renderFeaturePaginationText(){let{messages:e,viewModel:t}=this,{featureCount:s,selectedFeatureIndex:i}=t;return o`<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 o`<calcite-action class="pagination-menu-button" icon=list .label=${e.selectFeature} .loading=${n>0} =${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 o`<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??""} =${this._previousFeature} .text=${e??""} title=${e??""??c}></calcite-action><calcite-action icon=chevron-right icon-flip-rtl .label=${t??""} =${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,a=i.indexOf(e);return o`<calcite-list-item =${this._removeActiveFeature} =${()=>this._setActiveFeature(a)} =${this._removeActiveFeature} =${()=>this._setActiveFeature(a)} .selected=${n} =${()=>this._selectFeature(a)}><span .innerHTML=${(b.sanitize(e.title)||this.messages.untitled)??""} slot=content></span>${t==="list"?o`<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?o`<calcite-list display-mode=flat .label=${e?.featuresList??""} selection-appearance=icon .selectionMode=${i}>${Array.from(s.keys(),n=>{let a=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",o`<calcite-list-item-group .heading=${l}>${a}</calcite-list-item-group>`):a})}</calcite-list>`:null}_renderHeaderAction(e){let t=e.title||"";return e.visible?o`<calcite-action .active=${e.type==="toggle"?e.value:!1} .disabled=${e.disabled} .icon=${e.icon??void 0} .indicator=${e.active} .loading=${e.active} =${()=>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:a,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 o`<calcite-flow-item class=${x(y({"content-feature":!0,"flow-item-collapsed":s}))} .closable=${!t} .closed=${!w} .collapsed=${s} .collapseDirection=${this.collapseDirection??(a?"down":"up")} .collapsible=${i} .headingLevel=${e} .selected=${F} =${this._handleFeatureBack} .loading=${!!this._openRelatedFeatureAbortController} .messageOverrides=${{collapse:this.messages.collapse,expand:this.messages.expand}} =${this._handleClose} =${this._handleCollapseToggle} .heading=${!f&&h?D(h):void 0} ${v(this._rootFlowItemNode)}>${!f&&h?o`<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:a,_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"&&!a)return null;let T=!l;return o`<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} =${j=>{j.preventDefault(),this._handleFeatureMenuBack()}} =${this._handleClose} =${this._handleCollapseToggle} ${v(this._featureMenuViewportNode)}>${n==="list"?this._renderHeaderActions():null}${h>0?o`<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"?o`<calcite-button appearance=transparent =${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:a,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 o`<calcite-flow-item .closable=${!i} .closed=${!a} .description=${D(this._getDrillInFlowItemDescription(e)??"")} .heading=${l?void 0:D(e.heading??"")} .selected=${t} =${F=>{F.preventDefault(),this._handleDrillInBackClick()}} .loading=${!!this._openRelatedFeatureAbortController} =${this._handleClose}>${l?null:o`<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 =${this._removeFlowItems} slot=header-actions-start .text=${w??""} title=${w??""??c}></calcite-action>${g?o`<calcite-action icon=zoom-to-object =${()=>this._openRelatedFeature(e)} slot=header-actions-end .text=${p??""} title=${p??c}></calcite-action>`:null}${h?o`<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} =${()=>z(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 o`<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?o`<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 o`<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} =${()=>this._triggerAction(e)}></calcite-action>`})}_renderContent(){let{content:e,selectedFeatureViewModel:t}=this.viewModel;return t?o`<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,o`<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",a,b,d,e,f,g,h,i)