@arcgis/map-components 5.2.0-next.90 → 5.2.0-next.93
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/2AKHVAG7.js +2 -0
- package/dist/cdn/2GM4O42V.js +2 -0
- package/dist/cdn/{2LDYIMCE.js → 2U6EB7BN.js} +1 -1
- package/dist/cdn/{HOUQ3XZ3.js → 34CXVCB3.js} +1 -1
- package/dist/cdn/{NWLNFKT6.js → 3TRAIJXM.js} +1 -1
- package/dist/cdn/{YLXNHUYF.js → 3VFBYBX4.js} +1 -1
- package/dist/cdn/{JGMSDKM3.js → 43XQKUF6.js} +1 -1
- package/dist/cdn/{AYRZUPV2.js → 5IXZDVTF.js} +1 -1
- package/dist/cdn/{RTUHTKTO.js → 5OQPTYP5.js} +1 -1
- package/dist/cdn/{SOOJLVZP.js → 73N362E5.js} +1 -1
- package/dist/cdn/{CEY5WBEU.js → 7BOYQGKF.js} +1 -1
- package/dist/cdn/{67ZLFQ5D.js → A5ZHWVI3.js} +1 -1
- package/dist/cdn/{HRX3VZC6.js → AF65YZXZ.js} +1 -1
- package/dist/cdn/{M7ARKSCG.js → AL52T6VH.js} +1 -1
- package/dist/cdn/{C32RBBXZ.js → B23TN7FG.js} +1 -1
- package/dist/cdn/{S474C2LJ.js → B2FQHBTX.js} +1 -1
- package/dist/cdn/{HXOGSZ3H.js → BSLVN2NW.js} +1 -1
- package/dist/cdn/{3RKXZISX.js → BXDUMWWE.js} +1 -1
- package/dist/cdn/{SD5FKQFO.js → CH6EWFKV.js} +1 -1
- package/dist/cdn/{ZFLMRC4G.js → CQ7HNSA2.js} +1 -1
- package/dist/cdn/{JK4KRK6P.js → CYWMBY4Y.js} +1 -1
- package/dist/cdn/{2VSQARQL.js → DDGANMOY.js} +1 -1
- package/dist/cdn/{BPB6FTQK.js → DMFYRFSD.js} +1 -1
- package/dist/cdn/{PUNT3Q36.js → EEVHASMU.js} +1 -1
- package/dist/cdn/{M6FA6DZH.js → EVKOQOVV.js} +1 -1
- package/dist/cdn/{II5MODDO.js → FR3EHEIV.js} +1 -1
- package/dist/cdn/{MJRXLGST.js → GC65JYR2.js} +1 -1
- package/dist/cdn/{IBOB5TYX.js → H32EDCZG.js} +1 -1
- package/dist/cdn/{5EOKOS52.js → H4FPSA53.js} +1 -1
- package/dist/cdn/{O6F37YLT.js → HAUHWMHN.js} +1 -1
- package/dist/cdn/{6HSLIZLD.js → I22IJPSN.js} +1 -1
- package/dist/cdn/{WQQVESNN.js → I5DFLVVJ.js} +1 -1
- package/dist/cdn/IGFJHWQN.js +2 -0
- package/dist/cdn/{L66K2IBM.js → IORWRMMG.js} +1 -1
- package/dist/cdn/{3VZGQUZE.js → IXS5O6G4.js} +1 -1
- package/dist/cdn/{MZ2KYVWD.js → J3743ZYD.js} +1 -1
- package/dist/cdn/{JTBVK3AS.js → JFHEHJOQ.js} +1 -1
- package/dist/cdn/{AACTDN7T.js → KGXZG3YI.js} +1 -1
- package/dist/cdn/{LKAMRNMI.js → KX3XJGXZ.js} +1 -1
- package/dist/cdn/{VRRD4HXH.js → LBYKVAQ2.js} +1 -1
- package/dist/cdn/MAPYP35W.js +2 -0
- package/dist/cdn/{CFANWKE6.js → NMQLILVV.js} +1 -1
- package/dist/cdn/{UBD7D3LO.js → NO6MFBNV.js} +1 -1
- package/dist/cdn/{B3W2SZIJ.js → NP5NJFWN.js} +1 -1
- package/dist/cdn/{FQTVI2JC.js → NQ5OGG4I.js} +1 -1
- package/dist/cdn/NUPOLDDX.js +2 -0
- package/dist/cdn/{4SV6HHMC.js → O7RSAJOS.js} +1 -1
- package/dist/cdn/{WE2GHP5E.js → Q6TYHAOA.js} +1 -1
- package/dist/cdn/{D325DZEQ.js → QVM6UFNB.js} +1 -1
- package/dist/cdn/{BBFLUSKF.js → QX7CIDD3.js} +1 -1
- package/dist/cdn/{OEGPO4V4.js → R6ZUE6GP.js} +1 -1
- package/dist/cdn/RJSJ53UD.js +2 -0
- package/dist/cdn/{OWT2YYBJ.js → RJZ424ZP.js} +1 -1
- package/dist/cdn/{CS5IVOG4.js → TTDOV3LD.js} +1 -1
- package/dist/cdn/{K43HEYQI.js → U2ZQWROE.js} +1 -1
- package/dist/cdn/UVD3M6B5.js +2 -0
- package/dist/cdn/VIHVSV4P.js +2 -0
- package/dist/cdn/{CJLQURQH.js → VLKHH2Y6.js} +1 -1
- package/dist/cdn/VNX2AHM5.js +2 -0
- package/dist/cdn/{5KXZQI7G.js → VY2FRIAX.js} +1 -1
- package/dist/cdn/{PPTHUNKC.js → W2HQAUUA.js} +1 -1
- package/dist/cdn/WTTWWX57.js +2 -0
- package/dist/cdn/{KEE5SJGE.js → ZTRUEI25.js} +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/GeolocationPositioning.js +45 -45
- package/dist/chunks/async-utils.js +18 -14
- package/dist/chunks/slots.js +1 -1
- package/dist/chunks/time-utils.js +2 -2
- package/dist/components/arcgis-building-phase-picker/customElement.js +13 -13
- package/dist/components/arcgis-color-select/customElement.js +6 -6
- package/dist/components/arcgis-coordinate-conversion/customElement.js +18 -17
- package/dist/components/arcgis-coordinate-conversion-next/customElement.js +11 -10
- package/dist/components/arcgis-daylight/customElement.d.ts +7 -0
- package/dist/components/arcgis-daylight/customElement.js +135 -135
- package/dist/components/arcgis-feature/customElement.d.ts +1 -1
- package/dist/components/arcgis-feature-expression/customElement.js +24 -24
- package/dist/components/arcgis-feature-next/customElement.d.ts +1 -1
- package/dist/components/arcgis-feature-relationship/customElement.js +42 -41
- package/dist/components/arcgis-feature-table/customElement.d.ts +1 -1
- package/dist/components/arcgis-feature-templates/customElement.js +15 -14
- package/dist/components/arcgis-feature-utility-network-associations/customElement.js +32 -31
- package/dist/components/arcgis-features/customElement.d.ts +1 -1
- package/dist/components/arcgis-features-next/customElement.d.ts +1 -1
- package/dist/components/arcgis-floor-filter/customElement.js +9 -8
- package/dist/components/arcgis-link-chart/customElement.d.ts +19 -7
- package/dist/components/arcgis-link-chart/customElement.js +16 -16
- package/dist/components/arcgis-map/customElement.d.ts +19 -7
- package/dist/components/arcgis-map/customElement.js +3 -3
- package/dist/components/arcgis-oriented-imagery-viewer-panoramic-viewer/customElement.js +72 -72
- package/dist/components/arcgis-paste/customElement.d.ts +23 -3
- package/dist/components/arcgis-paste/customElement.js +102 -101
- package/dist/components/arcgis-presentation/customElement.js +43 -40
- package/dist/components/arcgis-scene/customElement.d.ts +42 -7
- package/dist/components/arcgis-scene/customElement.js +5 -5
- package/dist/components/arcgis-shadow-cast/customElement.d.ts +8 -3
- package/dist/components/arcgis-time-bar/customElement.d.ts +14 -5
- package/dist/components/arcgis-time-bar/customElement.js +29 -29
- package/dist/components/arcgis-time-bar/types.d.ts +3 -1
- package/dist/components/arcgis-time-bar-slider/customElement.d.ts +2 -2
- package/dist/components/arcgis-time-slider/customElement.d.ts +1 -1
- package/dist/components/arcgis-utility-network-trace-inputs/customElement.js +3 -3
- package/dist/components/arcgis-utility-network-trace-inputs-next/customElement.js +3 -3
- package/dist/components/arcgis-video/customElement.d.ts +19 -7
- package/dist/components/arcgis-volume-measurement/customElement.js +5 -5
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/vscode.css-custom-data.json +1 -1
- package/dist/docs/vscode.html-custom-data.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/dist/loader.js +2 -2
- package/dist/types/lumina.d.ts +2 -2
- package/dist/types/preact.d.ts +2 -2
- package/dist/types/react.d.ts +2 -2
- package/dist/types/stencil.d.ts +2 -2
- package/package.json +5 -5
- package/dist/cdn/2FTL6T53.js +0 -2
- package/dist/cdn/2XHGISYY.js +0 -2
- package/dist/cdn/4CJBWGTY.js +0 -2
- package/dist/cdn/5GIJFUEJ.js +0 -2
- package/dist/cdn/HASESZDN.js +0 -2
- package/dist/cdn/LMBTPOT3.js +0 -2
- package/dist/cdn/OU7XFISZ.js +0 -2
- package/dist/cdn/UU4FSZYG.js +0 -2
- package/dist/cdn/YVZI2KY2.js +0 -2
- package/dist/cdn/Z3XLCKLP.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import h from"./O6F37YLT.js";import"./VJVKFKSG.js";import g from"./AZYY5BTK.js";import{a as x}from"./WVGSH2QD.js";import f from"./ANSNQBZW.js";import e from"./XXA7VSON.js";import"./5DI7RMZ6.js";import"./Q7SMGP5R.js";import a from"./SYDGAFU5.js";import"./QUZTFUWM.js";import"./NCYBFT2Y.js";import{N as S,T as V,a as b,b as c,o as d,p as y,w as u}from"./WTBRS6C4.js";import"./H6RQVSYM.js";export default $arcgis.t(([{once:N,watch:M},B,,,,E,{a:_}])=>{var q=b`:host{--arcgis-internal-color-black-30: color-mix(in srgb, #000000 30.2%, transparent);--arcgis-internal-box-shadow: var(--calcite-spacing-none) var(--calcite-spacing-px) var(--calcite-spacing-base) var(--arcgis-internal-color-black-30);--arcgis-internal-top-max-width: calc(min(100cqw, 100vw) - var(--calcite-spacing-xxxl));--arcgis-internal-panel-width: 300px;--arcgis-internal-panel-height: 100%;--arcgis-internal-panel-height-sm: 240px;--arcgis-internal-panel-height-md: 420px;--arcgis-internal-panel-height-lg: 540px;--arcgis-internal-panel-height-xl: 680px;--arcgis-internal-panel-gap: var(--calcite-spacing-lg);--arcgis-internal-panel-actions-gap: var(--calcite-spacing-sm);--arcgis-internal-basemap-gallery-width-lg: 450px;--arcgis-internal-collapse-icon-flip: scaleX(1);--arcgis-internal-row-direction: row;--arcgis-internal-legend-width: 300px;--arcgis-internal-layout-overlay-space-top: var(--arcgis-layout-overlay-space-top, 0px);--arcgis-internal-layout-overlay-space-bottom: var(--arcgis-layout-overlay-space-bottom, 0px);--arcgis-internal-layout-overlay-space-left: var(--arcgis-layout-overlay-space-left, 0px);--arcgis-internal-layout-overlay-space-right: var(--arcgis-layout-overlay-space-right, 0px);--arcgis-internal-view-color-focus: var(--arcgis-view-color-focus, var(--calcite-color-brand));--arcgis-internal-attribution-space-bottom: var(--arcgis-internal-layout-overlay-space-bottom);--arcgis-internal-attribution-space-left: var(--arcgis-internal-layout-overlay-space-left);--arcgis-internal-attribution-space-right: var(--arcgis-internal-layout-overlay-space-right);--arcgis-internal-attribution-font-size: var(--calcite-font-size-sm);--arcgis-internal-attribution-font-size-sm: var(--calcite-font-size-xs);--arcgis-internal-sketch-justify-content: flex-start}:host{display:flex;flex-direction:column;height:var(--arcgis-internal-panel-height, 100%)}calcite-notice{background-color:var(--calcite-color-surface-2);padding:var(--calcite-space-sm)}`,R=E(B),f=class extends S{constructor(){super(...arguments),this._messages=x({blocking:!0}),this.#t=[],this.#r=[],this.#a=[],this.#e=R(this),this._currentPage=1,this._filterText="",this._isInitialFeatureServiceInvalid=!1,this._mode="browse-services",this.allowEditingDisabled=!1,this.autoDestroyDisabled=!1,this.closable=!1,this.pageSize=5,this.state=this.#e.state,this.versioningStates=this.#e.versioningStates,this.view=this.#e.view,this.arcgisReady=u(),this.arcgisVersioningStateChanged=u()}static{this.properties={_currentPage:16,_editVersionInfo:16,_filterText:16,_isInitialFeatureServiceInvalid:16,_loadError:16,_mode:16,_selectedFeatureService:16,allowEditingDisabled:5,autoDestroyDisabled:5,closable:7,icon:1,initialVersionInfos:0,label:1,messageOverrides:0,mode:1,pageSize:9,referenceElement:1,state:32,versioningStates:0,view:0}}static{this.styles=q}#t;#r;#a;#e;get initialVersionInfos(){return this.#t}set initialVersionInfos(e){this.#t=e.map(i=>({...i,url:this.#y(i.url)}))}async destroy(){await this.manager.destroy()}async load(){N(()=>this.#e.state==="failed"||this.#e.state==="ready").then(()=>{this._loadError||(this.#S(),this._loadError||this.#l())}),this.manager.onLifecycle(()=>[M(()=>this.view?.map,()=>{this.#b()})])}#l(){this.initialVersionInfos.forEach(e=>{try{this.#c(e)}catch(i){y(this)(i)}})}#c(e){let{url:i,name:a}=e,r=this.#e.versioningStateLookup.get(i);if(!r){this._isInitialFeatureServiceInvalid=!0,d("error",this,`No versioning state found for feature service ${i}`);return}let t=r?.versionInfos.find(g=>g.versionIdentifier.name.toUpperCase()===a.toUpperCase());if(!t){this.#r.push(i),this.requestUpdate(),d("error",this,`Version ${a} not found in the versioning state for feature service ${i}`);return}let s=t.versionIdentifier,l=r?.currentVersionInfo?.versionIdentifier;s.guid!==l?.guid&&this.#e.changeVersion(i,s.name,s.guid)}#s(e){let{_messages:i}=this;switch(e){case"no-feature-services":return i.loadErrors.noFeatureServices;case"no-version-management-service-found":return i.loadErrors.noVersionManagementServiceFound;case"no-view-property":return i.loadErrors.noViewProperty;case"webmap-failed-to-load":return i.loadErrors.webmapFailedToLoad;default:return e}}#i(e){let{_messages:i}=this,a=!1,r,t,s;switch(e){case"invalid-feature-service":a=!0,r=i.loadErrors.invalidInitialFeatureService,t=this.#w,s=i.headers.invalidInitialFeatureService;break;case"no-version-management-service-found":r=this.#s("no-version-management-service-found");break;case"view-model-load":r=this.#s(this.#e.loadError??"");break;case"webmap-load":r=this.#s("webmap-failed-to-load");break}return c`<calcite-notice .closable=${a} icon kind=warning open scale=s width=full @calciteNoticeClose=${t}>${s?c`<div slot=title>${s}</div>`:void 0}<div slot=message>${r}</div></calcite-notice>`}async#d(e){e.stopPropagation();let{alterVersionParameters:i}=e.detail;await this.#e.alterVersion(i).finally(()=>{this._mode="browse-versions"})&&this.arcgisVersioningStateChanged.emit({type:"version-changed",versionIdentifier:i.versionIdentifier,versioningState:this.#e.versioningStateLookup.get(i.featureServerUrl)})}async#g(e){e.stopPropagation();let{arcgisVersioningStateChanged:i}=this,{createVersionParameters:a,switchToVersion:r}=e.detail,t=await this.#e.createVersion(a).finally(()=>{this._mode="browse-versions"});t&&(i.emit({type:"version-created",versionIdentifier:t.versionIdentifier,versioningState:this.#e.versioningStateLookup.get(a.featureServerUrl)}),r&&await this.#e.changeVersion(a.featureServerUrl,t.versionIdentifier.name,t.versionIdentifier.guid).then(s=>{s&&i.emit({type:"version-switched",versionIdentifier:t.versionIdentifier,versioningState:this.#e.versioningStateLookup.get(a.featureServerUrl)})}))}#v(e){e.stopPropagation(),this._mode="browse-versions",this._editVersionInfo=void 0}async#h(e){e.stopPropagation(),await this.#e.getVersionInfos(e.detail.serviceUrl)}#p(e){e.stopPropagation(),this._filterText=e.detail.filterText,this.#n()}async#o(e){e.stopPropagation();let{arcgisVersioningStateChanged:i}=this,{actionType:a,serviceUrl:r,versionInfo:t}=e.detail;switch(a){case"changeVersion":{await this.#e.changeVersion(r,t.versionIdentifier.name,t.versionIdentifier.guid)&&i.emit({type:"version-switched",versionIdentifier:t.versionIdentifier,versioningState:this.#e.versioningStateLookup.get(r)});break}case"deleteVersion":{await this.#e.deleteVersion(r,t.versionIdentifier.name,t.versionIdentifier.guid)&&i.emit({type:"version-deleted",versionIdentifier:t.versionIdentifier,versioningState:this.#e.versioningStateLookup.get(r)});break}case"editVersion":{this._mode="edit-version",this._editVersionInfo={...e.detail.versionInfo};break}}}#m(e){e.stopPropagation(),this._mode="create-version"}#u(e){e.stopPropagation(),this._currentPage=e.detail.currentPage}#f(e){e.detail.name==="selectedFeatureService"&&(this._selectedFeatureService=e.target.selectedFeatureService,this._mode="browse-versions",this.#n())}#w(){this._isInitialFeatureServiceInvalid=!1}#$(){this._mode="browse-services"}#I(){this._mode="browse-versions",this._editVersionInfo=void 0}async#b(){let e=this.view?.map;try{e.loaded||await e.load()}catch(i){this._loadError="webmap-failed-to-load",_(i,this,"Error while loading 'view.map'")}}#y(e){return e.replace(/\/+$/u,"")}#n(){this._currentPage=1}#S(){if(!this.#e?.versioningStateLookup.size){this._loadError="no-version-management-service-found",d("error",this,"No version management service found");return}this.#e?.versioningStateLookup.forEach((e,i)=>{e.loadStatus==="failed"&&(this.#a.push(i),d("error",this,`Failed to load versioning state for feature service ${i}`))}),this.requestUpdate()}render(){let{_currentPage:e,_editVersionInfo:i,_filterText:a,_messages:r,_mode:t,_selectedFeatureService:s,closable:l,label:g,pageSize:v,state:o}=this,k=this._loadError==="webmap-failed-to-load"?this.#i("webmap-load"):void 0,F=o==="disabled"&&this.#e.loadError?this.#i("view-model-load"):void 0,P=this._loadError==="no-version-management-service-found"?this.#i("no-version-management-service-found"):void 0,U=this._isInitialFeatureServiceInvalid?this.#i("invalid-feature-service"):void 0,L=Array.from(this.#e.serviceNameLookup,([n,A])=>({url:n,name:A})),h=s?.url??"",w=this.#e?.versioningStateLookup.get(h),p=w?.versionInfos??[],C=w?.currentVersionInfo??void 0,D=p.length<=v,m=a===""?p:p.filter(n=>n.versionIdentifier.name.toUpperCase().includes(a.toUpperCase())||n.versionIdentifier.guid.toUpperCase().includes(a.toUpperCase())),$=m.slice((e-1)*v,e*v);$.length===0&&this.#n();let I=this.#e.userLookup.get(h),T=this.#e.versionAdministratorLookup.get(h),z=(this.#e.serverVersionLookup.get(h)??0)>=11.2;return c`<calcite-flow><calcite-flow-item .closable=${l} .heading=${g} .loading=${o==="loading"||o==="executing"} .selected=${t==="browse-services"}>${k}${F}${P}${U}${L.map(n=>c`<arcgis-version-management-service-item .allowEditingDisabled=${this.allowEditingDisabled} .invalidInitialVersion=${this.#r.includes(n.url)} .messages=${r} .selectedFeatureService=${s} .serviceName=${n.name} .serviceUrl=${n.url} .versioningStateFailedToLoad=${this.#a.includes(n.url)} .viewModel=${this.#e} @arcgisInternalManageVersion=${this.#o} @arcgisPropertyChange=${this.#f}></arcgis-version-management-service-item>`)}</calcite-flow-item><calcite-flow-item .closable=${l} .description=${s?.name} .heading=${g} .loading=${o==="loading"||o==="executing"} .selected=${t==="browse-versions"} @calciteFlowItemBack=${n=>{n.preventDefault(),this.#$()}}><arcgis-version-management-version-list .currentPage=${e} .currentUser=${I} .currentVersionInfo=${C} .executionError=${this.#e.executionError??void 0} .featureServiceName=${s?.name} .featureServiceUrl=${s?.url} .hideFilter=${D} .isVersionAdministrator=${T} .isVersioningApiAvailable=${z} .messages=${r} .mode=${t} .totalPages=${Math.ceil(m.length/v)} .totalVersions=${m.length} .versionInfos=${$} @arcgisInternalFilterVersions=${this.#p} @arcgisInternalGetVersions=${this.#h} @arcgisInternalManageVersion=${this.#o} @arcgisInternalNewVersion=${this.#m} @arcgisInternalPageChange=${this.#u}></arcgis-version-management-version-list></calcite-flow-item><calcite-flow-item .closable=${l} .description=${t==="create-version"?"":i?.versionIdentifier.name} .heading=${t==="create-version"?r?.actions.newVersion:r?.actions.editVersion} .loading=${o==="loading"||o==="executing"} .selected=${t==="create-version"||t==="edit-version"} @calciteFlowItemBack=${n=>{n.preventDefault(),this.#I()}}><arcgis-version-management-version-properties .currentUser=${I} .editVersionInfo=${i} .featureServiceUrl=${s?.url} .messages=${r} .mode=${t} @arcgisInternalAlterVersion=${this.#d} @arcgisInternalCreateVersion=${this.#g} @arcgisInternalDiscardEdits=${this.#v}></arcgis-version-management-version-properties></calcite-flow-item></calcite-flow>`}};V("arcgis-version-management",f);return f},"core/reactiveUtils","versionManagement/VersionManager",a,e,f,g,h)
|
|
2
|
+
import h from"./HAUHWMHN.js";import"./VJVKFKSG.js";import g from"./AZYY5BTK.js";import{a as x}from"./WVGSH2QD.js";import f from"./ANSNQBZW.js";import e from"./XXA7VSON.js";import"./5DI7RMZ6.js";import"./Q7SMGP5R.js";import a from"./SYDGAFU5.js";import"./QUZTFUWM.js";import"./NCYBFT2Y.js";import{N as S,T as V,a as b,b as c,o as d,p as y,w as u}from"./WTBRS6C4.js";import"./H6RQVSYM.js";export default $arcgis.t(([{once:N,watch:M},B,,,,E,{a:_}])=>{var q=b`:host{--arcgis-internal-color-black-30: color-mix(in srgb, #000000 30.2%, transparent);--arcgis-internal-box-shadow: var(--calcite-spacing-none) var(--calcite-spacing-px) var(--calcite-spacing-base) var(--arcgis-internal-color-black-30);--arcgis-internal-top-max-width: calc(min(100cqw, 100vw) - var(--calcite-spacing-xxxl));--arcgis-internal-panel-width: 300px;--arcgis-internal-panel-height: 100%;--arcgis-internal-panel-height-sm: 240px;--arcgis-internal-panel-height-md: 420px;--arcgis-internal-panel-height-lg: 540px;--arcgis-internal-panel-height-xl: 680px;--arcgis-internal-panel-gap: var(--calcite-spacing-lg);--arcgis-internal-panel-actions-gap: var(--calcite-spacing-sm);--arcgis-internal-basemap-gallery-width-lg: 450px;--arcgis-internal-collapse-icon-flip: scaleX(1);--arcgis-internal-row-direction: row;--arcgis-internal-legend-width: 300px;--arcgis-internal-layout-overlay-space-top: var(--arcgis-layout-overlay-space-top, 0px);--arcgis-internal-layout-overlay-space-bottom: var(--arcgis-layout-overlay-space-bottom, 0px);--arcgis-internal-layout-overlay-space-left: var(--arcgis-layout-overlay-space-left, 0px);--arcgis-internal-layout-overlay-space-right: var(--arcgis-layout-overlay-space-right, 0px);--arcgis-internal-view-color-focus: var(--arcgis-view-color-focus, var(--calcite-color-brand));--arcgis-internal-attribution-space-bottom: var(--arcgis-internal-layout-overlay-space-bottom);--arcgis-internal-attribution-space-left: var(--arcgis-internal-layout-overlay-space-left);--arcgis-internal-attribution-space-right: var(--arcgis-internal-layout-overlay-space-right);--arcgis-internal-attribution-font-size: var(--calcite-font-size-sm);--arcgis-internal-attribution-font-size-sm: var(--calcite-font-size-xs);--arcgis-internal-sketch-justify-content: flex-start}:host{display:flex;flex-direction:column;height:var(--arcgis-internal-panel-height, 100%)}calcite-notice{background-color:var(--calcite-color-surface-2);padding:var(--calcite-space-sm)}`,R=E(B),f=class extends S{constructor(){super(...arguments),this._messages=x({blocking:!0}),this.#t=[],this.#r=[],this.#a=[],this.#e=R(this),this._currentPage=1,this._filterText="",this._isInitialFeatureServiceInvalid=!1,this._mode="browse-services",this.allowEditingDisabled=!1,this.autoDestroyDisabled=!1,this.closable=!1,this.pageSize=5,this.state=this.#e.state,this.versioningStates=this.#e.versioningStates,this.view=this.#e.view,this.arcgisReady=u(),this.arcgisVersioningStateChanged=u()}static{this.properties={_currentPage:16,_editVersionInfo:16,_filterText:16,_isInitialFeatureServiceInvalid:16,_loadError:16,_mode:16,_selectedFeatureService:16,allowEditingDisabled:5,autoDestroyDisabled:5,closable:7,icon:1,initialVersionInfos:0,label:1,messageOverrides:0,mode:1,pageSize:9,referenceElement:1,state:32,versioningStates:0,view:0}}static{this.styles=q}#t;#r;#a;#e;get initialVersionInfos(){return this.#t}set initialVersionInfos(e){this.#t=e.map(i=>({...i,url:this.#y(i.url)}))}async destroy(){await this.manager.destroy()}async load(){N(()=>this.#e.state==="failed"||this.#e.state==="ready").then(()=>{this._loadError||(this.#S(),this._loadError||this.#l())}),this.manager.onLifecycle(()=>[M(()=>this.view?.map,()=>{this.#b()})])}#l(){this.initialVersionInfos.forEach(e=>{try{this.#c(e)}catch(i){y(this)(i)}})}#c(e){let{url:i,name:a}=e,r=this.#e.versioningStateLookup.get(i);if(!r){this._isInitialFeatureServiceInvalid=!0,d("error",this,`No versioning state found for feature service ${i}`);return}let t=r?.versionInfos.find(g=>g.versionIdentifier.name.toUpperCase()===a.toUpperCase());if(!t){this.#r.push(i),this.requestUpdate(),d("error",this,`Version ${a} not found in the versioning state for feature service ${i}`);return}let s=t.versionIdentifier,l=r?.currentVersionInfo?.versionIdentifier;s.guid!==l?.guid&&this.#e.changeVersion(i,s.name,s.guid)}#s(e){let{_messages:i}=this;switch(e){case"no-feature-services":return i.loadErrors.noFeatureServices;case"no-version-management-service-found":return i.loadErrors.noVersionManagementServiceFound;case"no-view-property":return i.loadErrors.noViewProperty;case"webmap-failed-to-load":return i.loadErrors.webmapFailedToLoad;default:return e}}#i(e){let{_messages:i}=this,a=!1,r,t,s;switch(e){case"invalid-feature-service":a=!0,r=i.loadErrors.invalidInitialFeatureService,t=this.#w,s=i.headers.invalidInitialFeatureService;break;case"no-version-management-service-found":r=this.#s("no-version-management-service-found");break;case"view-model-load":r=this.#s(this.#e.loadError??"");break;case"webmap-load":r=this.#s("webmap-failed-to-load");break}return c`<calcite-notice .closable=${a} icon kind=warning open scale=s width=full @calciteNoticeClose=${t}>${s?c`<div slot=title>${s}</div>`:void 0}<div slot=message>${r}</div></calcite-notice>`}async#d(e){e.stopPropagation();let{alterVersionParameters:i}=e.detail;await this.#e.alterVersion(i).finally(()=>{this._mode="browse-versions"})&&this.arcgisVersioningStateChanged.emit({type:"version-changed",versionIdentifier:i.versionIdentifier,versioningState:this.#e.versioningStateLookup.get(i.featureServerUrl)})}async#g(e){e.stopPropagation();let{arcgisVersioningStateChanged:i}=this,{createVersionParameters:a,switchToVersion:r}=e.detail,t=await this.#e.createVersion(a).finally(()=>{this._mode="browse-versions"});t&&(i.emit({type:"version-created",versionIdentifier:t.versionIdentifier,versioningState:this.#e.versioningStateLookup.get(a.featureServerUrl)}),r&&await this.#e.changeVersion(a.featureServerUrl,t.versionIdentifier.name,t.versionIdentifier.guid).then(s=>{s&&i.emit({type:"version-switched",versionIdentifier:t.versionIdentifier,versioningState:this.#e.versioningStateLookup.get(a.featureServerUrl)})}))}#v(e){e.stopPropagation(),this._mode="browse-versions",this._editVersionInfo=void 0}async#h(e){e.stopPropagation(),await this.#e.getVersionInfos(e.detail.serviceUrl)}#p(e){e.stopPropagation(),this._filterText=e.detail.filterText,this.#n()}async#o(e){e.stopPropagation();let{arcgisVersioningStateChanged:i}=this,{actionType:a,serviceUrl:r,versionInfo:t}=e.detail;switch(a){case"changeVersion":{await this.#e.changeVersion(r,t.versionIdentifier.name,t.versionIdentifier.guid)&&i.emit({type:"version-switched",versionIdentifier:t.versionIdentifier,versioningState:this.#e.versioningStateLookup.get(r)});break}case"deleteVersion":{await this.#e.deleteVersion(r,t.versionIdentifier.name,t.versionIdentifier.guid)&&i.emit({type:"version-deleted",versionIdentifier:t.versionIdentifier,versioningState:this.#e.versioningStateLookup.get(r)});break}case"editVersion":{this._mode="edit-version",this._editVersionInfo={...e.detail.versionInfo};break}}}#m(e){e.stopPropagation(),this._mode="create-version"}#u(e){e.stopPropagation(),this._currentPage=e.detail.currentPage}#f(e){e.detail.name==="selectedFeatureService"&&(this._selectedFeatureService=e.target.selectedFeatureService,this._mode="browse-versions",this.#n())}#w(){this._isInitialFeatureServiceInvalid=!1}#$(){this._mode="browse-services"}#I(){this._mode="browse-versions",this._editVersionInfo=void 0}async#b(){let e=this.view?.map;try{e.loaded||await e.load()}catch(i){this._loadError="webmap-failed-to-load",_(i,this,"Error while loading 'view.map'")}}#y(e){return e.replace(/\/+$/u,"")}#n(){this._currentPage=1}#S(){if(!this.#e?.versioningStateLookup.size){this._loadError="no-version-management-service-found",d("error",this,"No version management service found");return}this.#e?.versioningStateLookup.forEach((e,i)=>{e.loadStatus==="failed"&&(this.#a.push(i),d("error",this,`Failed to load versioning state for feature service ${i}`))}),this.requestUpdate()}render(){let{_currentPage:e,_editVersionInfo:i,_filterText:a,_messages:r,_mode:t,_selectedFeatureService:s,closable:l,label:g,pageSize:v,state:o}=this,k=this._loadError==="webmap-failed-to-load"?this.#i("webmap-load"):void 0,F=o==="disabled"&&this.#e.loadError?this.#i("view-model-load"):void 0,P=this._loadError==="no-version-management-service-found"?this.#i("no-version-management-service-found"):void 0,U=this._isInitialFeatureServiceInvalid?this.#i("invalid-feature-service"):void 0,L=Array.from(this.#e.serviceNameLookup,([n,A])=>({url:n,name:A})),h=s?.url??"",w=this.#e?.versioningStateLookup.get(h),p=w?.versionInfos??[],C=w?.currentVersionInfo??void 0,D=p.length<=v,m=a===""?p:p.filter(n=>n.versionIdentifier.name.toUpperCase().includes(a.toUpperCase())||n.versionIdentifier.guid.toUpperCase().includes(a.toUpperCase())),$=m.slice((e-1)*v,e*v);$.length===0&&this.#n();let I=this.#e.userLookup.get(h),T=this.#e.versionAdministratorLookup.get(h),z=(this.#e.serverVersionLookup.get(h)??0)>=11.2;return c`<calcite-flow><calcite-flow-item .closable=${l} .heading=${g} .loading=${o==="loading"||o==="executing"} .selected=${t==="browse-services"}>${k}${F}${P}${U}${L.map(n=>c`<arcgis-version-management-service-item .allowEditingDisabled=${this.allowEditingDisabled} .invalidInitialVersion=${this.#r.includes(n.url)} .messages=${r} .selectedFeatureService=${s} .serviceName=${n.name} .serviceUrl=${n.url} .versioningStateFailedToLoad=${this.#a.includes(n.url)} .viewModel=${this.#e} @arcgisInternalManageVersion=${this.#o} @arcgisPropertyChange=${this.#f}></arcgis-version-management-service-item>`)}</calcite-flow-item><calcite-flow-item .closable=${l} .description=${s?.name} .heading=${g} .loading=${o==="loading"||o==="executing"} .selected=${t==="browse-versions"} @calciteFlowItemBack=${n=>{n.preventDefault(),this.#$()}}><arcgis-version-management-version-list .currentPage=${e} .currentUser=${I} .currentVersionInfo=${C} .executionError=${this.#e.executionError??void 0} .featureServiceName=${s?.name} .featureServiceUrl=${s?.url} .hideFilter=${D} .isVersionAdministrator=${T} .isVersioningApiAvailable=${z} .messages=${r} .mode=${t} .totalPages=${Math.ceil(m.length/v)} .totalVersions=${m.length} .versionInfos=${$} @arcgisInternalFilterVersions=${this.#p} @arcgisInternalGetVersions=${this.#h} @arcgisInternalManageVersion=${this.#o} @arcgisInternalNewVersion=${this.#m} @arcgisInternalPageChange=${this.#u}></arcgis-version-management-version-list></calcite-flow-item><calcite-flow-item .closable=${l} .description=${t==="create-version"?"":i?.versionIdentifier.name} .heading=${t==="create-version"?r?.actions.newVersion:r?.actions.editVersion} .loading=${o==="loading"||o==="executing"} .selected=${t==="create-version"||t==="edit-version"} @calciteFlowItemBack=${n=>{n.preventDefault(),this.#I()}}><arcgis-version-management-version-properties .currentUser=${I} .editVersionInfo=${i} .featureServiceUrl=${s?.url} .messages=${r} .mode=${t} @arcgisInternalAlterVersion=${this.#d} @arcgisInternalCreateVersion=${this.#g} @arcgisInternalDiscardEdits=${this.#v}></arcgis-version-management-version-properties></calcite-flow-item></calcite-flow>`}};V("arcgis-version-management",f);return f},"core/reactiveUtils","versionManagement/VersionManager",a,e,f,g,h)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import j from"./MZ2KYVWD.js";import i from"./SOOJLVZP.js";import{a as J}from"./JCRPP54Z.js";import{a as S,b as H,g as G,h as U,m as F}from"./LDDAJOTV.js";import{a as B}from"./QE6XRKDY.js";import{a as w}from"./56KR4KYO.js";import h from"./X4RJMWSU.js";import g from"./MZWO5JYA.js";import f from"./O6F37YLT.js";import"./VJVKFKSG.js";import e from"./AZYY5BTK.js";import{a as R}from"./WVGSH2QD.js";import{a as p}from"./JD74LG7K.js";import d from"./ANSNQBZW.js";import b from"./XXA7VSON.js";import{g as D}from"./5DI7RMZ6.js";import"./Q7SMGP5R.js";import a from"./SYDGAFU5.js";import"./QUZTFUWM.js";import{d as x}from"./NCYBFT2Y.js";import{A as T,L as O,M as m,N as P,O as y,Q as $,R as L,T as A,b as r,w as c}from"./WTBRS6C4.js";import"./H6RQVSYM.js";export default $arcgis.t(([{createReactiveMap:K},I,{on:C,watch:W},X,Y,{h:f},,{a:N},k,,,,,{b:j,c:q,d:z}])=>{var g=J,Z=u=>{let e=u?.type;return e==="knowledge-graph"||e==="map-image"||e==="tile"},ee=u=>u?.type==="catalog",Q="nested",te=I.ofType(Y),se=k(X),_=class extends P{constructor(){super(...arguments),this.#l=`operational-${T()}`,this.#e=null,this.#o=O(),this.#i=!1,this.#t=!1,this.messages=R(),this.#r=()=>{this._activeItem=null},this.#n=e=>{if(this.visibilityAppearance!=="default")return;let t=Array.from(e.composedPath()).find(s=>s.classList?.contains(g.item));this._activeItem=F(t)},this.#a=K(),this.#s=K(),this.#h=e=>{e&&this.#v(e)},this.#c=e=>{e&&this.#b(e)},this.#d=e=>{e&&this.#$(e)},this.viewModel=se(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.autoDestroyDisabled=!1,this.closed=!1,this.collapsed=!1,this.filterPlaceholder="",this.filterText="",this.headingLevel=2,this.hideCatalogLayerList=!1,this.hideNoFilterResultsNotice=!1,this.hideNoItemsNotice=!1,this.hideStatusIndicators=!1,this.listItemCreatedFunction=this.viewModel.listItemCreatedFunction,this.listModeDisabled=this.viewModel.listModeDisabled,this.minFilterItems=H,this.openedLayerLists=new I,this.openedLayers=new I,this.selectedItems=new te,this.selectionMode="none",this.showCloseButton=!1,this.showCollapseButton=!1,this.showErrors=!1,this.showFilter=!1,this.showHeading=!1,this.showTemporaryLayerIndicators=!1,this.state=this.viewModel.state,this.topLayerDisabled=!1,this.view=this.viewModel.view,this.visibilityAppearance="default",this.arcgisCatalogItemsChange=c(),this.arcgisFilterChange=c(),this.arcgisOpenedLayersChange=c(),this.arcgisPropertyChange=D()("state"),this.arcgisReady=c(),this.arcgisSelectedItemsChange=c(),this.arcgisTriggerAction=N(()=>this.viewModel,"trigger-action")}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,autoDestroyDisabled:5,catalogItems:0,catalogLayer:0,catalogOptions:0,closed:5,collapsed:5,filterPlaceholder:1,filterPredicate:0,filterText:1,headingLevel:9,hideCatalogLayerList:5,hideNoFilterResultsNotice:5,hideNoItemsNotice:5,hideStatusIndicators:5,knowledgeGraphOptions:0,label:1,listItemCreatedFunction:0,listModeDisabled:5,messageOverrides:0,minFilterItems:9,onCatalogOpen:0,onTablesOpen:0,openedLayerLists:32,openedLayers:32,referenceElement:1,selectedItems:0,selectionMode:1,showCloseButton:5,showCollapseButton:5,showErrors:5,showFilter:5,showHeading:5,showTemporaryLayerIndicators:5,state:32,topLayerDisabled:5,view:0,visibilityAppearance:1}}static{this.styles=[z,q]}#l;#e;#o;#i;#t;#r;#n;#a;#s;#h;#c;#d;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.#D(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.#i||this.#t||(this.#i=!0,this.#e?.abort(),this.#e=null,await this.manager.destroy(),this.openedLayerLists.removeAll(),this.openedLayers.removeAll(),this.#s.clear(),this.#a.clear(),this.#t=!0,this.#i=!1)}loaded(){this.manager.onLifecycle(()=>[C(()=>this.openedLayers,"change",()=>{this.#w()}),C(()=>this.viewModel.catalogItems,"change",()=>{G(this.selectedItems),this.arcgisCatalogItemsChange.emit()}),C(()=>this.selectedItems,"change",()=>this.arcgisSelectedItemsChange.emit()),W(()=>[this.filterPredicate,this.#o.value],()=>U(this.#o.value,this.filterPredicate))])}disconnectedCallback(){super.disconnectedCallback(),this.#e?.abort(),this.#e=null,!this.autoDestroyDisabled&&!this.#t&&!this.#i&&this.destroy()}#y(e,t){return this.viewModel.triggerAction(e,t)}async#f(e,t){let s=this.#s.get(e);if(s)return s;let a=e.type==="catalog"?await this.#L(e):await this.#C(e);return t.aborted||!this.isConnected||this.#t?(a?.destroy?.(),a):(t.aborted||this.#s.set(e,a),a)}async#w(){if(!this.isConnected||this.#t)return;let{openedLayers:e,openedLayerLists:t}=this;this.#e?.abort();let s=new AbortController,{signal:a}=s;this.#e=s,this.#s.forEach((n,h)=>{e.includes(h)||(n?.destroy?.(),this.#s.delete(h))});let o=await Promise.all(e.map(n=>this.#f(n,a)));if(a.aborted||!this.isConnected||this.#t)return;t.removeAll(),t.addMany(o);let i=t.at(-1),l=i&&"catalogLayer"in i?i:void 0;this._catalogLayerList!==l&&(this._catalogLayerList=l),this.arcgisOpenedLayersChange.emit()}#I(e){e.open=!1,this._focusRootFlowItem=!0}#b(e){this._focusRootFlowItem&&(this._focusRootFlowItem=!1,f(e))}#v(e){this._focusPanelFlowItem&&(this._focusPanelFlowItem=!1,f(e))}#$(e){this._focusLayerFlowItem===e.dataset.layerUid&&(this._focusLayerFlowItem=null,f(e))}async#L(e){let{headingLevel:t,catalogOptions:s,view:a,referenceElement:o,filterPlaceholder:i,listItemCreatedFunction:l,minFilterItems:n,selectionMode:h,visibilityAppearance:d}=this;return L(r`<arcgis-catalog-layer-list-next .headingLevel=${t} .filterPlaceholder=${s?.filterPlaceholder??i} .listItemCreatedFunction=${s?.listItemCreatedFunction??l} .minFilterItems=${s?.minFilterItems??n} .selectionMode=${s?.selectionMode??h} .visibilityAppearance=${s?.visibilityAppearance??d} .showErrors=${s?.showErrors??this.showErrors} .showFilter=${s?.showFilter??this.showFilter} .hideStatusIndicators=${s?.hideStatusIndicators??this.hideStatusIndicators} .showTemporaryLayerIndicators=${s?.showTemporaryLayerIndicators??this.showTemporaryLayerIndicators} .messageOverrides=${this.messageOverrides} @arcgisReady=${b=>b.stopPropagation()} .catalogLayer=${e} .view=${a} .referenceElement=${o} @catalogOpen=${this.#p} @tablesOpen=${this.#m}></arcgis-catalog-layer-list-next>`)}#F(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#C(e){let{headingLevel:t,selectionMode:s,referenceElement:a,view:o}=this,i=this.#F(e);return L(r`<arcgis-table-list-next .headingLevel=${i?.headingLevel??t} .selectionMode=${i?.selectionMode??s} .collapsed=${i?.collapsed} .filterPlaceholder=${i?.filterPlaceholder} .filterText=${i?.filterText} .label=${i?.label} .tables=${i?.tables} .view=${o} .referenceElement=${a} @arcgisReady=${l=>l.stopPropagation()}></arcgis-table-list-next>`)}#m(e){if(this.onTablesOpen){this.onTablesOpen(e);return}let t=e.layer;Z(t)&&(this.openedLayers.push(t),this._focusLayerFlowItem=t.uid)}#p(e){if(this.onCatalogOpen){this.onCatalogOpen(e);return}let t=e.layer?.parent;ee(t)&&(this.openedLayers.push(t),this._focusLayerFlowItem=e.layer?.uid)}#_(e,t){t?this.#a.set(e,t):this.#a.delete(e)}#M(e,t){this.#y(e,t)}#E(e){let{selectionMode:t,selectedItems:s}=this;if(t==="none")return;let a=e.target.selectedItems.map(o=>F(o)).filter(Boolean);s.removeAll(),s.addMany(a)}render(){let{state:e}=this,t={[p.hidden]:e==="loading",[p.disabled]:e==="disabled"};return r`<div class=${y(x(p.widget,p.panel,t))}>${this._visibleItems?.length?this.#O():null}${this.#x()}</div>`}#T(e){let t=this.#a,s=this.messages;return e?.layer?r`<calcite-tooltip overlay-positioning=fixed .referenceElement=${t.get(e.layer.uid)} .topLayerDisabled=${this.topLayerDisabled}>${s.layerIncompatibleTooltip}</calcite-tooltip>`:null}#g(e){return e.incompatible?this.#T(e):e.children?.filter(t=>!t.hidden).toArray().map(t=>this.#g(t))}#O(){return this._visibleItems?.toArray().map(e=>this.#g(e))}#u(){return r`<div slot=message>${this.messages.noItemsToDisplay}</div>`}#P(){return this.hideNoItemsNotice?null:r`<div class=${y(g.itemMessage)}><calcite-notice icon=information kind=info open width=full>${this.#u()}</calcite-notice></div>`}#A(){let{_openedPanelItems:e,openedLayers:t}=this;return B(e.toArray(),({uid:s})=>s,(s,a)=>{let{uid:o,title:i,panel:l}=s,n=()=>this.#I(l);return r`<calcite-flow-item .description=${i} .heading=${l.title} .headingLevel=${this.headingLevel} .selected=${!t.length&&a===e.length-1} @calciteFlowItemBack=${h=>{h.preventDefault(),n()}} ${m(this.#h)}><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>`})}#x(){let{collapsed:e,_visibleItems:t,_filterEnabled:s,showCloseButton:a,showCollapseButton:o,showHeading:i,selectionMode:l,filterText:n,filterPlaceholder:h,openedLayers:d,_openedPanelItems:b}=this,M=this.#l,E=this.label??this.messages.componentLabel??"",V=[r`<calcite-flow-item .closable=${a} .closed=${this.closed} .collapsed=${e} .collapsible=${o} .heading=${i?E:void 0} .headingLevel=${this.headingLevel} .selected=${!d.length&&!b.length} @calciteFlowItemClose=${()=>this.closed=!0} ${m(this.#c)}>${t?.length?r`<calcite-list data-layer-type=${M??$} .displayMode=${Q} .filterEnabled=${s} .filterPlaceholder=${h} .filterProps=${S} .filterText=${s?n:""} .group=${M} .label=${E} @focusin=${this.#n} @focusout=${this.#r} selection-appearance=border .selectionMode=${l} @calciteListChange=${this.#E} @calciteListFilter=${v=>{this.filterText=v.currentTarget?.filterText??"",this.arcgisFilterChange.emit()}} @mouseleave=${this.#r} @mouseover=${this.#n} ${m(this.#o)}>${t.toArray().map(v=>this.#R(v))}${s&&!this.hideNoFilterResultsNotice?r`<div class=${y(g.filterNoResults)} slot=filter-no-results><calcite-notice kind=info open width=full>${this.#u()}</calcite-notice></div>`:null}</calcite-list>`:this.#P()}</calcite-flow-item>`,this.#A(),this._renderedOpenLayerFlowItems];return this.closed?null:w("root-flow",r`<calcite-flow>${V}</calcite-flow>`)}#D(e,t){let{openedLayers:s}=this,a=e.title||this.messages.untitledLayer;return w(e.uid,r`<calcite-flow-item data-layer-uid=${e.uid??$} .description=${a} .heading=${this.messages[e.type==="catalog"?"catalogLayers":"tables"]} .headingLevel=${this.headingLevel} .selected=${t} @calciteFlowItemBack=${o=>{o.preventDefault(),s.pop();let i=s.at(-1);i?this._focusLayerFlowItem=i.uid:this._focusRootFlowItem=!0}} ${m(this.#d)}>${this.#s.get(e)}</calcite-flow-item>`)}#R(e,t,s){let{hideStatusIndicators:a,showCloseButton:o,showCollapseButton:i,showErrors:l,showFilter:n,showHeading:h,showTemporaryLayerIndicators:d}=this;return w(e.uid,j({activeItem:this._activeItem??void 0,css:{...g,itemCatalogIcon:g.itemActionIcon},displayMode:Q,dragEnabled:!1,item:e,layerTablesEnabled:this.layerTablesEnabled,listModeDisabled:this.viewModel.listModeDisabled,messages:this.messages,parent:t,parentTitles:s,rootGroupUid:this.#l,selectedItems:this.selectedItems,selectionMode:this.selectionMode,visibilityAppearance:this.visibilityAppearance,hideStatusIndicators:a,showCloseButton:o,showCollapseButton:i,showErrors:l,showFilter:n,showHeading:h,showTemporaryLayerIndicators:d,handleAction:this.#M.bind(this),handleCatalogOpen:this.#p.bind(this),handleTablesOpen:this.#m.bind(this),handleTooltipReferenceChange:this.#_.bind(this),view:this.view}))}};A("arcgis-catalog-layer-list-next",_);return _},"applications/Components/featureUtils","core/Collection","core/reactiveUtils","layers/list/CatalogItemCollection","layers/list/Item",a,b,d,e,f,g,h,i,j)
|
|
2
|
+
import j from"./J3743ZYD.js";import i from"./73N362E5.js";import{a as J}from"./JCRPP54Z.js";import{a as S,b as H,g as G,h as U,m as F}from"./LDDAJOTV.js";import{a as B}from"./QE6XRKDY.js";import{a as w}from"./56KR4KYO.js";import h from"./X4RJMWSU.js";import g from"./MZWO5JYA.js";import f from"./HAUHWMHN.js";import"./VJVKFKSG.js";import e from"./AZYY5BTK.js";import{a as R}from"./WVGSH2QD.js";import{a as p}from"./JD74LG7K.js";import d from"./ANSNQBZW.js";import b from"./XXA7VSON.js";import{g as D}from"./5DI7RMZ6.js";import"./Q7SMGP5R.js";import a from"./SYDGAFU5.js";import"./QUZTFUWM.js";import{d as x}from"./NCYBFT2Y.js";import{A as T,L as O,M as m,N as P,O as y,Q as $,R as L,T as A,b as r,w as c}from"./WTBRS6C4.js";import"./H6RQVSYM.js";export default $arcgis.t(([{createReactiveMap:K},I,{on:C,watch:W},X,Y,{h:f},,{a:N},k,,,,,{b:j,c:q,d:z}])=>{var g=J,Z=u=>{let e=u?.type;return e==="knowledge-graph"||e==="map-image"||e==="tile"},ee=u=>u?.type==="catalog",Q="nested",te=I.ofType(Y),se=k(X),_=class extends P{constructor(){super(...arguments),this.#l=`operational-${T()}`,this.#e=null,this.#o=O(),this.#i=!1,this.#t=!1,this.messages=R(),this.#r=()=>{this._activeItem=null},this.#n=e=>{if(this.visibilityAppearance!=="default")return;let t=Array.from(e.composedPath()).find(s=>s.classList?.contains(g.item));this._activeItem=F(t)},this.#a=K(),this.#s=K(),this.#h=e=>{e&&this.#v(e)},this.#c=e=>{e&&this.#b(e)},this.#d=e=>{e&&this.#$(e)},this.viewModel=se(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.autoDestroyDisabled=!1,this.closed=!1,this.collapsed=!1,this.filterPlaceholder="",this.filterText="",this.headingLevel=2,this.hideCatalogLayerList=!1,this.hideNoFilterResultsNotice=!1,this.hideNoItemsNotice=!1,this.hideStatusIndicators=!1,this.listItemCreatedFunction=this.viewModel.listItemCreatedFunction,this.listModeDisabled=this.viewModel.listModeDisabled,this.minFilterItems=H,this.openedLayerLists=new I,this.openedLayers=new I,this.selectedItems=new te,this.selectionMode="none",this.showCloseButton=!1,this.showCollapseButton=!1,this.showErrors=!1,this.showFilter=!1,this.showHeading=!1,this.showTemporaryLayerIndicators=!1,this.state=this.viewModel.state,this.topLayerDisabled=!1,this.view=this.viewModel.view,this.visibilityAppearance="default",this.arcgisCatalogItemsChange=c(),this.arcgisFilterChange=c(),this.arcgisOpenedLayersChange=c(),this.arcgisPropertyChange=D()("state"),this.arcgisReady=c(),this.arcgisSelectedItemsChange=c(),this.arcgisTriggerAction=N(()=>this.viewModel,"trigger-action")}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,autoDestroyDisabled:5,catalogItems:0,catalogLayer:0,catalogOptions:0,closed:5,collapsed:5,filterPlaceholder:1,filterPredicate:0,filterText:1,headingLevel:9,hideCatalogLayerList:5,hideNoFilterResultsNotice:5,hideNoItemsNotice:5,hideStatusIndicators:5,knowledgeGraphOptions:0,label:1,listItemCreatedFunction:0,listModeDisabled:5,messageOverrides:0,minFilterItems:9,onCatalogOpen:0,onTablesOpen:0,openedLayerLists:32,openedLayers:32,referenceElement:1,selectedItems:0,selectionMode:1,showCloseButton:5,showCollapseButton:5,showErrors:5,showFilter:5,showHeading:5,showTemporaryLayerIndicators:5,state:32,topLayerDisabled:5,view:0,visibilityAppearance:1}}static{this.styles=[z,q]}#l;#e;#o;#i;#t;#r;#n;#a;#s;#h;#c;#d;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.#D(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.#i||this.#t||(this.#i=!0,this.#e?.abort(),this.#e=null,await this.manager.destroy(),this.openedLayerLists.removeAll(),this.openedLayers.removeAll(),this.#s.clear(),this.#a.clear(),this.#t=!0,this.#i=!1)}loaded(){this.manager.onLifecycle(()=>[C(()=>this.openedLayers,"change",()=>{this.#w()}),C(()=>this.viewModel.catalogItems,"change",()=>{G(this.selectedItems),this.arcgisCatalogItemsChange.emit()}),C(()=>this.selectedItems,"change",()=>this.arcgisSelectedItemsChange.emit()),W(()=>[this.filterPredicate,this.#o.value],()=>U(this.#o.value,this.filterPredicate))])}disconnectedCallback(){super.disconnectedCallback(),this.#e?.abort(),this.#e=null,!this.autoDestroyDisabled&&!this.#t&&!this.#i&&this.destroy()}#y(e,t){return this.viewModel.triggerAction(e,t)}async#f(e,t){let s=this.#s.get(e);if(s)return s;let a=e.type==="catalog"?await this.#L(e):await this.#C(e);return t.aborted||!this.isConnected||this.#t?(a?.destroy?.(),a):(t.aborted||this.#s.set(e,a),a)}async#w(){if(!this.isConnected||this.#t)return;let{openedLayers:e,openedLayerLists:t}=this;this.#e?.abort();let s=new AbortController,{signal:a}=s;this.#e=s,this.#s.forEach((n,h)=>{e.includes(h)||(n?.destroy?.(),this.#s.delete(h))});let o=await Promise.all(e.map(n=>this.#f(n,a)));if(a.aborted||!this.isConnected||this.#t)return;t.removeAll(),t.addMany(o);let i=t.at(-1),l=i&&"catalogLayer"in i?i:void 0;this._catalogLayerList!==l&&(this._catalogLayerList=l),this.arcgisOpenedLayersChange.emit()}#I(e){e.open=!1,this._focusRootFlowItem=!0}#b(e){this._focusRootFlowItem&&(this._focusRootFlowItem=!1,f(e))}#v(e){this._focusPanelFlowItem&&(this._focusPanelFlowItem=!1,f(e))}#$(e){this._focusLayerFlowItem===e.dataset.layerUid&&(this._focusLayerFlowItem=null,f(e))}async#L(e){let{headingLevel:t,catalogOptions:s,view:a,referenceElement:o,filterPlaceholder:i,listItemCreatedFunction:l,minFilterItems:n,selectionMode:h,visibilityAppearance:d}=this;return L(r`<arcgis-catalog-layer-list-next .headingLevel=${t} .filterPlaceholder=${s?.filterPlaceholder??i} .listItemCreatedFunction=${s?.listItemCreatedFunction??l} .minFilterItems=${s?.minFilterItems??n} .selectionMode=${s?.selectionMode??h} .visibilityAppearance=${s?.visibilityAppearance??d} .showErrors=${s?.showErrors??this.showErrors} .showFilter=${s?.showFilter??this.showFilter} .hideStatusIndicators=${s?.hideStatusIndicators??this.hideStatusIndicators} .showTemporaryLayerIndicators=${s?.showTemporaryLayerIndicators??this.showTemporaryLayerIndicators} .messageOverrides=${this.messageOverrides} @arcgisReady=${b=>b.stopPropagation()} .catalogLayer=${e} .view=${a} .referenceElement=${o} @catalogOpen=${this.#p} @tablesOpen=${this.#m}></arcgis-catalog-layer-list-next>`)}#F(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#C(e){let{headingLevel:t,selectionMode:s,referenceElement:a,view:o}=this,i=this.#F(e);return L(r`<arcgis-table-list-next .headingLevel=${i?.headingLevel??t} .selectionMode=${i?.selectionMode??s} .collapsed=${i?.collapsed} .filterPlaceholder=${i?.filterPlaceholder} .filterText=${i?.filterText} .label=${i?.label} .tables=${i?.tables} .view=${o} .referenceElement=${a} @arcgisReady=${l=>l.stopPropagation()}></arcgis-table-list-next>`)}#m(e){if(this.onTablesOpen){this.onTablesOpen(e);return}let t=e.layer;Z(t)&&(this.openedLayers.push(t),this._focusLayerFlowItem=t.uid)}#p(e){if(this.onCatalogOpen){this.onCatalogOpen(e);return}let t=e.layer?.parent;ee(t)&&(this.openedLayers.push(t),this._focusLayerFlowItem=e.layer?.uid)}#_(e,t){t?this.#a.set(e,t):this.#a.delete(e)}#M(e,t){this.#y(e,t)}#E(e){let{selectionMode:t,selectedItems:s}=this;if(t==="none")return;let a=e.target.selectedItems.map(o=>F(o)).filter(Boolean);s.removeAll(),s.addMany(a)}render(){let{state:e}=this,t={[p.hidden]:e==="loading",[p.disabled]:e==="disabled"};return r`<div class=${y(x(p.widget,p.panel,t))}>${this._visibleItems?.length?this.#O():null}${this.#x()}</div>`}#T(e){let t=this.#a,s=this.messages;return e?.layer?r`<calcite-tooltip overlay-positioning=fixed .referenceElement=${t.get(e.layer.uid)} .topLayerDisabled=${this.topLayerDisabled}>${s.layerIncompatibleTooltip}</calcite-tooltip>`:null}#g(e){return e.incompatible?this.#T(e):e.children?.filter(t=>!t.hidden).toArray().map(t=>this.#g(t))}#O(){return this._visibleItems?.toArray().map(e=>this.#g(e))}#u(){return r`<div slot=message>${this.messages.noItemsToDisplay}</div>`}#P(){return this.hideNoItemsNotice?null:r`<div class=${y(g.itemMessage)}><calcite-notice icon=information kind=info open width=full>${this.#u()}</calcite-notice></div>`}#A(){let{_openedPanelItems:e,openedLayers:t}=this;return B(e.toArray(),({uid:s})=>s,(s,a)=>{let{uid:o,title:i,panel:l}=s,n=()=>this.#I(l);return r`<calcite-flow-item .description=${i} .heading=${l.title} .headingLevel=${this.headingLevel} .selected=${!t.length&&a===e.length-1} @calciteFlowItemBack=${h=>{h.preventDefault(),n()}} ${m(this.#h)}><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>`})}#x(){let{collapsed:e,_visibleItems:t,_filterEnabled:s,showCloseButton:a,showCollapseButton:o,showHeading:i,selectionMode:l,filterText:n,filterPlaceholder:h,openedLayers:d,_openedPanelItems:b}=this,M=this.#l,E=this.label??this.messages.componentLabel??"",V=[r`<calcite-flow-item .closable=${a} .closed=${this.closed} .collapsed=${e} .collapsible=${o} .heading=${i?E:void 0} .headingLevel=${this.headingLevel} .selected=${!d.length&&!b.length} @calciteFlowItemClose=${()=>this.closed=!0} ${m(this.#c)}>${t?.length?r`<calcite-list data-layer-type=${M??$} .displayMode=${Q} .filterEnabled=${s} .filterPlaceholder=${h} .filterProps=${S} .filterText=${s?n:""} .group=${M} .label=${E} @focusin=${this.#n} @focusout=${this.#r} selection-appearance=border .selectionMode=${l} @calciteListChange=${this.#E} @calciteListFilter=${v=>{this.filterText=v.currentTarget?.filterText??"",this.arcgisFilterChange.emit()}} @mouseleave=${this.#r} @mouseover=${this.#n} ${m(this.#o)}>${t.toArray().map(v=>this.#R(v))}${s&&!this.hideNoFilterResultsNotice?r`<div class=${y(g.filterNoResults)} slot=filter-no-results><calcite-notice kind=info open width=full>${this.#u()}</calcite-notice></div>`:null}</calcite-list>`:this.#P()}</calcite-flow-item>`,this.#A(),this._renderedOpenLayerFlowItems];return this.closed?null:w("root-flow",r`<calcite-flow>${V}</calcite-flow>`)}#D(e,t){let{openedLayers:s}=this,a=e.title||this.messages.untitledLayer;return w(e.uid,r`<calcite-flow-item data-layer-uid=${e.uid??$} .description=${a} .heading=${this.messages[e.type==="catalog"?"catalogLayers":"tables"]} .headingLevel=${this.headingLevel} .selected=${t} @calciteFlowItemBack=${o=>{o.preventDefault(),s.pop();let i=s.at(-1);i?this._focusLayerFlowItem=i.uid:this._focusRootFlowItem=!0}} ${m(this.#d)}>${this.#s.get(e)}</calcite-flow-item>`)}#R(e,t,s){let{hideStatusIndicators:a,showCloseButton:o,showCollapseButton:i,showErrors:l,showFilter:n,showHeading:h,showTemporaryLayerIndicators:d}=this;return w(e.uid,j({activeItem:this._activeItem??void 0,css:{...g,itemCatalogIcon:g.itemActionIcon},displayMode:Q,dragEnabled:!1,item:e,layerTablesEnabled:this.layerTablesEnabled,listModeDisabled:this.viewModel.listModeDisabled,messages:this.messages,parent:t,parentTitles:s,rootGroupUid:this.#l,selectedItems:this.selectedItems,selectionMode:this.selectionMode,visibilityAppearance:this.visibilityAppearance,hideStatusIndicators:a,showCloseButton:o,showCollapseButton:i,showErrors:l,showFilter:n,showHeading:h,showTemporaryLayerIndicators:d,handleAction:this.#M.bind(this),handleCatalogOpen:this.#p.bind(this),handleTablesOpen:this.#m.bind(this),handleTooltipReferenceChange:this.#_.bind(this),view:this.view}))}};A("arcgis-catalog-layer-list-next",_);return _},"applications/Components/featureUtils","core/Collection","core/reactiveUtils","layers/list/CatalogItemCollection","layers/list/Item",a,b,d,e,f,g,h,i,j)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import c from"./MZWO5JYA.js";import a from"./O6F37YLT.js";import"./VJVKFKSG.js";import{a as S}from"./WVGSH2QD.js";import{g as $}from"./5DI7RMZ6.js";import"./Q7SMGP5R.js";import"./QUZTFUWM.js";import"./NCYBFT2Y.js";import{M as h,N as y,T as k,a as b,b as s,o as d,q as w,w as n}from"./WTBRS6C4.js";import"./H6RQVSYM.js";export default $arcgis.t(([l,{watch:L},{substitute:x},I,D,E,C,F,{a:_},{a:T,b:m,d:g,e:v,f:N}])=>{var P=b`:host{height:100%;flex-grow:1}calcite-flow{min-height:var(--arcgis-internal-panel-height-sm, 240px)}calcite-block-group{flex-grow:1;padding-bottom:var(--calcite-spacing-md);background-color:var(--calcite-color-foreground-1)}calcite-block{--calcite-block-content-space: 0;--calcite-block-border-color: transparent;margin:0}calcite-block calcite-combobox,calcite-block calcite-input{margin:0 var(--calcite-spacing-md)}calcite-block calcite-input-message{padding:var(--calcite-spacing-sm) var(--calcite-spacing-md) 0}calcite-notice{margin:var(--calcite-spacing-md)}#subnetwork-info-block{margin:var(--calcite-spacing-md) var(--calcite-spacing-md) 0}#results-limited-message{padding:var(--calcite-spacing-sm)}.inline-loader{--calcite-loader-spacing: var(--calcite-spacing-md)}.add-spatial-mode{display:flex;flex-direction:column;gap:var(--calcite-spacing-md);margin:var(--calcite-spacing-md)}.heading{color:var(--calcite-color-text-1);margin:0 0 var(--calcite-spacing-md);font-size:var(--calcite-font-size);font-weight:var(--calcite-font-weight-medium)}`,p=`utility-network-trace-inputs-sketch-${Date.now()}`,U=20,f=class extends y{constructor(){super(...arguments),this._messages=S({blocking:!0}),this.#d=!0,this.#u=new Map,this.#s=new l,this.#r=new l,this.#o=new l,this.#b=new Set(["subnetwork","subnetwork-controller","upstream","downstream","isolation"]),this.#i=null,this.#n=20,this._candidateFeatures=[],this._compatibleSubnetworkNames=[],this._namedTraceConfigurations=[],this._subnetworkNamesState="ready",this._exceedDisplayLimit=!1,this.autoDestroyDisabled=!1,this.hideActionBar=!1,this.mode="default",this.arcgisPropertyChange=$()("mode"),this.arcgisSelectedNamedTraceConfigurationChange=n(),this.arcgisTraceInputsChange=n(),this.arcgisTraceLocationSelectEnd=n(),this.arcgisTraceLocationSelectStart=n(),this.arcgisUtilityNetworkChange=n()}static{this.properties={_selectedFeature:16,_candidateFeatures:16,_compatibleSubnetworkNames:16,_subnetworksTable:16,_namedTraceConfigurations:16,_traceConfiguration:16,_error:16,_subnetworkNamesState:16,_activeTraceLocationType:16,_exceedDisplayLimit:16,beforeTraceLocationSelectStart:0,view:0,selectedUtilityNetwork:0,selectedNamedTraceConfiguration:0,autoDestroyDisabled:5,hideActionBar:5,traceConfiguration:32,isSubnetworkNameTraceSelected:32,referenceElement:1,mode:3,traceLocationFlagInfos:32,traceLocations:32}}static{this.styles=P}get#t(){return this._traceConfiguration?.subnetworkName??void 0}set#t(t){this._traceConfiguration&&(this._traceConfiguration.subnetworkName=t)}#d;get#C(){let{view:t}=this;return t?.map?t.map.allLayers.toArray().concat(t.map.allTables.toArray()):[]}#e;#a;#u;#s;#r;#o;#b;#i;#c;#w;#y;#k;#n;get#$(){return!this.isSubnetworkNameTraceSelected}get#T(){let t=this.selectedNamedTraceConfiguration?.traceType;return t==="path"||t==="circuit"}get#L(){let t=this.selectedUtilityNetwork?.dataElement?.domainNetworks;return t?t.map(e=>e.subnetworkLayerId).filter(e=>e!=null&&e>-1):[]}#x({detail:t,target:e}){(t.name==="selectedDrillInFeature"||t.name==="selectedFeature")&&(this._selectedFeature=e.selectedDrillInFeature??e.selectedFeature??void 0)}get traceConfiguration(){return this._traceConfiguration}get isSubnetworkNameTraceSelected(){let{selectedNamedTraceConfiguration:t}=this;return!!t?.traceConfiguration?.subnetworkName&&t?.traceType==="subnetwork"}get traceLocationFlagInfos(){return new l([...this.#s,...this.#r,...this.#o])}get traceLocations(){let t=[];return this.#$&&this.#s.forEach(e=>t.push(...this.#m(e))),this.#T&&this.#o.forEach(e=>t.push(...this.#m(e))),this.#r.forEach(e=>t.push(...this.#m(e))),t}async destroy(){this.#A(p),this.#N(),this.#e?.cancel(),this.#c?.destroy(),this.#w?.destroy(),this.#y?.destroy(),this.#k?.destroy(),await this.manager.destroy()}load(){this.#v(),this.manager.onLifecycle(()=>[L(()=>this.view?.map,()=>this.#v())])}willUpdate(t){t.has("selectedUtilityNetwork")&&(this.arcgisUtilityNetworkChange.emit(),this.#K()),t.has("selectedNamedTraceConfiguration")&&(this.arcgisTraceInputsChange.emit(),this.arcgisSelectedNamedTraceConfigurationChange.emit(),this.#H())}disconnectedCallback(){super.disconnectedCallback(),this.#u.clear()}#v(){if(this._error=void 0,!this.view?.map){this._error=this._messages.errors.noView;return}let t=this.view.map;this.#B(t)}#I(t){t&&(this.#w=t)}#D(t){t&&(this.#y=t)}#E(t){t&&(this.#k=t)}#F(t){t&&(this.#c=t)}#m(t){let e=t.flagProperties.selectedTerminals;return t.flagProperties.terminalConfiguration&&e?.size?Array.from(e,i=>new E({type:t.traceLocation.type,isFilterBarrier:t.traceLocation.isFilterBarrier,globalId:t.traceLocation.globalId,percentAlong:t.traceLocation.percentAlong,terminalId:i})):[t.traceLocation]}#N(){let{view:t}=this;this.#s.forEach(e=>{e.spatialProperties.flagGraphic&&t?.graphics.remove(e.spatialProperties.flagGraphic)}),this.#s.removeAll(),this.#r.forEach(e=>{e.spatialProperties.flagGraphic&&t?.graphics.remove(e.spatialProperties.flagGraphic)}),this.#r.removeAll(),this.#o.forEach(e=>{e.spatialProperties.flagGraphic&&t?.graphics.remove(e.spatialProperties.flagGraphic)}),this.#o.removeAll()}#P(t,e){if(!t.findLayerById(e)){let i=new I({id:e,listMode:"hide",title:e});T(this.view,i)}}#U(t,e){let i=t.findLayerById(e);return g(i)?(t.reorder(i,t.layers.length-1),i):null}#A(t){if(!this.view?.map)return;let{map:e}=this.view,i=e?.findLayerById(t);i&&g(i)&&e?.remove(i)}#_(){if(!this.#e)return;let t=new l;this.#a?.forEach(e=>{v(e)?e.sublayers.forEach(i=>{t.add(new C({layer:i,enabled:!0}))}):t.add(new C({layer:e,enabled:!0}))}),this.#e.snappingOptions={enabled:!1,featureSources:t}}#M(t){let{view:e}=this,i=this.#U(t,p);return new F({layer:i,view:e})}#B(t){this.#P(t,p),this.#e=this.#M(t),this.#_()}#V(){this.#t=void 0,this._subnetworksTable=void 0,this._compatibleSubnetworkNames=[]}async#j(){this._subnetworksTable||(this._subnetworksTable=await this.selectedUtilityNetwork?.loadSubnetworksTable())}async#G(){let{_subnetworksTable:t}=this;if(!t)return;let e=t.fieldsIndex.get("SUBNETWORKNAME"),i=(o,c,u)=>c===0||o.getAttribute(e.name)!==u[c-1].getAttribute(e.name),a=t.createQuery();a.gdbVersion=this.selectedUtilityNetwork?.gdbVersion,a.where=this.#O(),a.outFields=[e.name],a.orderByFields=[e.name];let{features:r}=await m(t,a,void 0,!1);this._compatibleSubnetworkNames=r.filter(i).map(o=>o.getAttribute(e.name))}#O(){let t=this._traceConfiguration,e=`DOMAINNETWORKNAME = '${t.domainNetworkName}'`,i=`TIERNAME = '${t.tierName}'`;return[e,i].join(" AND ")}async#R(t){await this.#j(),await this.#G(),t.subnetworkName&&!this._compatibleSubnetworkNames.some(e=>e===t.subnetworkName)&&(this.#t=this._compatibleSubnetworkNames.at(0))}#z(t){let e=this.selectedUtilityNetwork?.sharedNamedTraceConfigurations.find(i=>i.globalId===t);if(!e){d("error",this,"`traceConfig` not found in `selectedUtilityNetwork.sharedNamedTraceConfigurations`");return}this.selectedNamedTraceConfiguration=e}async#H(){let{selectedNamedTraceConfiguration:t}=this;if(!(t?.traceConfiguration instanceof D)){d("error",this,w("selectedNamedTraceConfiguration.traceConfiguration")),this._traceConfiguration=void 0;return}this._traceConfiguration=t.traceConfiguration.clone(),this.isSubnetworkNameTraceSelected&&(this._subnetworkNamesState="loading",await this.#R(this._traceConfiguration),this._subnetworkNamesState="ready")}async#K(){let{selectedUtilityNetwork:t}=this;try{t&&!t.loaded&&await t.load()}catch(e){_(e,this,"Error while loading the selected utility network")}this.#V(),this.#Q(),this.#W(),this.#N()}#Q(){this._traceConfiguration=void 0,this.selectedNamedTraceConfiguration=void 0,this._namedTraceConfigurations=this.selectedUtilityNetwork?.sharedNamedTraceConfigurations.filter(Boolean).filter(t=>t.traceType!=="circuit").sort((t,e)=>t.title.localeCompare(e.title))||[],this._namedTraceConfigurations.length?this.selectedNamedTraceConfiguration=this._namedTraceConfigurations.at(0):d("error",this,"The selected utility network has no compatible named trace configurations.")}#W(){let{selectedUtilityNetwork:t}=this;this.#a=new l(this.#C.filter(e=>t?.isUtilityLayer(e)&&!this.#L.includes(e.layerId))),this.#_()}#g(t){if(t.stopPropagation(),this.arcgisTraceLocationSelectStart.emit(t.detail).defaultPrevented){t.preventDefault();return}this._activeTraceLocationType=t?.target?.traceLocationType,this.mode="add-spatial-instructions"}#q(t){if(t==null)return;let e=this.#u,i=this.#a,a=e.get(t);if(a)return a;if(!i)return;let r=i.find(o=>"layerId"in o&&o.layerId===t);return r&&e.set(t,r),r}async#J(t,e){let i=t.createQuery();i.gdbVersion=this.selectedUtilityNetwork?.gdbVersion,i.objectIds=e.map(r=>r.getObjectId()),i.outFields=["*"];let{features:a}=await m(t,i);return a.forEach(r=>{if(!r.getEffectivePopupTemplate(this.#d)){let o=r.layer;r.popupTemplate=o.createPopupTemplate()}}),a}async#X(t){let e=new Map,i=[];return t.forEach(a=>{let r=N(a.layer)?a.layer.parent:a.layer;if(r){let o=this.#q(r.layerId);if(o){let c=e.get(o)||[];c.push(a),e.set(o,c)}}}),await Promise.all(Array.from(e.keys()).map(async a=>{let r=e.get(a)??[],o=await this.#J(a,r);i.push(...o)})),i}async#p(t){return this._exceedDisplayLimit=t.length>this.#n,this._candidateFeatures=await this.#X(t.slice(0,this.#n)),this._candidateFeatures.length===0?(this.#l(),await Promise.reject(Error("No features found"))):(this._candidateFeatures.length===1&&(this._selectedFeature=this._candidateFeatures.at(0)),this.mode="add-spatial-feature",this.#i?.reject(),this.#i=Promise.withResolvers(),await this.#i.promise)}#f(t){t.stopPropagation(),this.arcgisTraceLocationSelectEnd.emit(),this._activeTraceLocationType=void 0,this.mode="default",this.#l()}#l(t){t?.stopPropagation(),this.#c?.clear(),this.#S(),this.#e?.cancel()}#S(){this.mode="default",this._candidateFeatures=[],this._selectedFeature=void 0,this.#i?.reject(),this.#i=null}#Y(){let t=this.#i,e=this.#c,{_selectedFeature:i}=this;if(t&&e){if(!i)return;t.resolve(i),this.#i=null}}#h(t,e=!1,i){return s`<calcite-notice .closable=${e} kind=danger open scale=s width=auto .icon=${i}><div slot=message>${t}</div></calcite-notice>`}#Z(){let t=this._namedTraceConfigurations.map(i=>s`<calcite-combobox-item .value=${i.globalId} .heading=${i.title} .selected=${i.globalId===this.selectedNamedTraceConfiguration?.globalId}></calcite-combobox-item>`),e=this._messages.labels.traceConfiguration;return s`<calcite-block .heading=${e} .label=${e} expanded><calcite-combobox .label=${e} selection-mode=single-persist @calciteComboboxChange=${({currentTarget:i})=>{let a=i.selectedItems[0]?.value;this.#z(a)}}>${t}</calcite-combobox></calcite-block>`}#tt(){let{selectedUtilityNetwork:t,view:e}=this;return s`<arcgis-utility-network-picker .selectedUtilityNetwork=${t} .view=${e} @arcgisPropertyChange=${i=>{i.detail.name==="selectedUtilityNetwork"&&(this.selectedUtilityNetwork=i.target.selectedUtilityNetwork)}}></arcgis-utility-network-picker>`}#et(){let{_error:t}=this,{noView:e}=this._messages.errors,i;return t===e?i=this.#h(t,!1,"exclamation-mark-triangle"):i=this.#ut(),s`<calcite-flow-item .selected=${this.mode==="default"}>${i}</calcite-flow-item>`}#it(){let{_messages:t,mode:e}=this,i=this._activeTraceLocationType==="starting-point"?t.labels.addSpatial.startingPoint:this._activeTraceLocationType==="barrier"?t.labels.addSpatial.barrier:t.labels.addSpatial.stoppingPoint;return s`<calcite-flow-item .selected=${e==="add-spatial-instructions"} .heading=${i} @calciteFlowItemBack=${a=>this.#l(a)}><div class="add-spatial-mode"><div><h5 class="heading">${t.instructions.addSpatial.selectFeature.heading}</h5>${t.instructions.addSpatial.selectFeature.subheading}</div><div><h5 class="heading">${t.instructions.addSpatial.selectAssociatedFeature.heading}</h5>${t.instructions.addSpatial.selectAssociatedFeature.subheading}</div></div></calcite-flow-item>`}#at(){let{_activeTraceLocationType:t,_candidateFeatures:e,_messages:i}=this;if(!e.length)return this.mode="default",null;let a=t==="starting-point"?i.labels.addSpatial.startingPoint:t==="barrier"?i.labels.addSpatial.barrier:i.labels.addSpatial.stoppingPoint,r=e.length===1?"feature":"list";return s`<arcgis-features-next .autoDestroyDisabled=${this.autoDestroyDisabled} .defaultPopupTemplateEnabled=${this.#d} .features=${this._candidateFeatures} .featureMenuTitle=${a} .hideActionBar=${this.hideActionBar} hide-select-feature .initialDisplayMode=${r} @arcgisClose=${()=>this.#S()} @arcgisPropertyChange=${this.#x} open .referenceElement=${this.referenceElement} .view=${this.view} ${h(this.#F)}></arcgis-features-next>`}#st(){let{mode:t,_messages:e,_selectedFeature:i,selectedUtilityNetwork:a}=this,r=t==="add-spatial-feature"&&this._exceedDisplayLimit&&!i,o=x(e.warnings.exceededDisplayLimit,{limit:this.#n.toString()}),c=i?!(a?.isUtilityLayer(i.layer)??!0):!0;return s`${r&&s`<calcite-input-message id=results-limited-message icon=exclamation-mark-circle status=idle>${o}</calcite-input-message>`||""}<calcite-button appearance=outline width=full @click=${()=>this.#l()} slot=footer>${e.buttons.cancel}</calcite-button>${t==="add-spatial-feature"&&s`<calcite-button width=full slot=footer appearance=solid @click=${()=>this.#Y()} .disabled=${c}>${e.buttons.add}</calcite-button>`||""}`}#rt(){return s`<arcgis-utility-network-trace-location-next .view=${this.view} trace-location-type=starting-point .beforeTraceLocationSelectStart=${this.beforeTraceLocationSelectStart} @arcgisTraceLocationSelectStart=${this.#g} @arcgisTraceLocationSelectEnd=${this.#f} @arcgisTraceLocationChange=${()=>this.arcgisTraceInputsChange.emit()} .sketchViewModel=${this.#e} .utilityNetwork=${this.selectedUtilityNetwork} .filterLayers=${this.#a} .traceLocations=${this.#s} .afterHitTest=${this.#p.bind(this)} .autoDestroyDisabled=${this.autoDestroyDisabled} ${h(this.#I)}></arcgis-utility-network-trace-location-next>`}#ot(){return s`<arcgis-utility-network-trace-location-next .view=${this.view} trace-location-type=stopping-point .beforeTraceLocationSelectStart=${this.beforeTraceLocationSelectStart} @arcgisTraceLocationSelectStart=${this.#g} @arcgisTraceLocationSelectEnd=${this.#f} @arcgisTraceLocationChange=${()=>this.arcgisTraceInputsChange.emit()} .sketchViewModel=${this.#e} .utilityNetwork=${this.selectedUtilityNetwork} .filterLayers=${this.#a} .traceLocations=${this.#o} .afterHitTest=${this.#p.bind(this)} .autoDestroyDisabled=${this.autoDestroyDisabled} ${h(this.#E)}></arcgis-utility-network-trace-location-next>`}#ct(){return s`<arcgis-utility-network-trace-location-next .view=${this.view} trace-location-type=barrier .beforeTraceLocationSelectStart=${this.beforeTraceLocationSelectStart} @arcgisTraceLocationSelectStart=${this.#g} @arcgisTraceLocationSelectEnd=${this.#f} @arcgisTraceLocationChange=${()=>this.arcgisTraceInputsChange.emit()} .sketchViewModel=${this.#e} .utilityNetwork=${this.selectedUtilityNetwork} .filterLayers=${this.#a} .traceLocations=${this.#r} .afterHitTest=${this.#p.bind(this)} .autoDestroyDisabled=${this.autoDestroyDisabled} ${h(this.#D)}></arcgis-utility-network-trace-location-next>`}#nt(){let{_messages:t}=this;return s`<calcite-input clearable type=text .placeholder=${t.instructions.enterSubnetworkName} max-length=64 .status=${this.#t?"valid":"invalid"} .value=${this.#t} @calciteInputInput=${e=>this.#t=e.target.value}></calcite-input><calcite-input-message icon=exclamation-mark-triangle status=idle>${t.labels.tooManySubnetworks}</calcite-input-message>`}#lt(){return s`<calcite-combobox .label=${this._messages.labels.subnetworkName} selection-mode=single-persist @calciteComboboxChange=${({currentTarget:t})=>{let e=t.selectedItems[0]?.value;this.#t=e}}>${this._compatibleSubnetworkNames.map(t=>s`<calcite-combobox-item .value=${t} .heading=${t} .selected=${t===this.#t}></calcite-combobox-item>`)}</calcite-combobox>`}#ht(){let{_messages:t}=this,e=t.labels.subnetworkName;return this.isSubnetworkNameTraceSelected?this._subnetworkNamesState==="loading"?s`<calcite-loader class="inline-loader" label=loading scale=s></calcite-loader>`:this._compatibleSubnetworkNames.length?s`<calcite-block .heading=${e} .label=${e} expanded>${this._compatibleSubnetworkNames.length>U?this.#nt():this.#lt()}</calcite-block>`:this.#h(t.errors.noCompatibleSubnetworks,!1,"exclamation-mark-triangle"):null}#dt(){let{selectedNamedTraceConfiguration:t}=this;return this._traceConfiguration&&t?.traceType&&this.#b.has(t.traceType)?s`<calcite-block id=subnetwork-info-block expanded .label=${this._messages.labels.subnetworkInfo}><arcgis-utility-network-subnetwork-info-next .namedTraceConfiguration=${t}></arcgis-utility-network-subnetwork-info-next></calcite-block>`:null}#ut(){let{_messages:t}=this,{noTraceConfiguration:e,noNamedTraceConfigurations:i}=t.errors,a=this.#tt(),r;this._namedTraceConfigurations.length||(r=this.#h(i,!1,"exclamation-mark-triangle"));let o=s`${this.#Z()}${this.#dt()}${this.#ht()}`,c=this.traceConfiguration?s`${this.#$?this.#rt():null}${this.#T?this.#ot():null}${this.#ct()}`:this.#h(e,!1,"exclamation-mark-triangle"),u=this.selectedUtilityNetwork?.loaded?r??s`${o}${c}`:null;return s`<calcite-block-group .label=${t.labels.traceInputs}>${a}${u}</calcite-block-group>`}render(){let{mode:t}=this;return s`<calcite-panel>${t==="add-spatial-feature"?this.#at():null}<calcite-flow .hidden=${t==="add-spatial-feature"}>${this.#et()}${this.#it()}</calcite-flow>${t!=="default"?this.#st():null}</calcite-panel>`}};k("arcgis-utility-network-trace-inputs-next",f);return f},"core/Collection","core/reactiveUtils","intl","layers/GraphicsLayer","networks/support/UNTraceConfiguration","rest/networks/support/TraceLocation","views/interactive/snapping/FeatureSnappingLayerSource","widgets/Sketch/SketchViewModel",a,c)
|
|
2
|
+
import c from"./MZWO5JYA.js";import a from"./HAUHWMHN.js";import"./VJVKFKSG.js";import{a as S}from"./WVGSH2QD.js";import{g as $}from"./5DI7RMZ6.js";import"./Q7SMGP5R.js";import"./QUZTFUWM.js";import"./NCYBFT2Y.js";import{M as h,N as y,T as k,a as b,b as s,o as d,q as w,w as n}from"./WTBRS6C4.js";import"./H6RQVSYM.js";export default $arcgis.t(([l,{watch:L},{substitute:x},I,D,E,C,F,{a:_},{a:T,b:m,d:g,e:v,f:N}])=>{var P=b`:host{height:100%;flex-grow:1}calcite-flow{min-height:var(--arcgis-internal-panel-height-sm, 240px)}calcite-block-group{flex-grow:1;padding-bottom:var(--calcite-spacing-md);background-color:var(--calcite-color-foreground-1)}calcite-block{--calcite-block-content-space: 0;--calcite-block-border-color: transparent;margin:0}calcite-block calcite-combobox,calcite-block calcite-input{margin:0 var(--calcite-spacing-md)}calcite-block calcite-input-message{padding:var(--calcite-spacing-sm) var(--calcite-spacing-md) 0}calcite-notice{margin:var(--calcite-spacing-md)}#subnetwork-info-block{margin:var(--calcite-spacing-md) var(--calcite-spacing-md) 0}#results-limited-message{padding:var(--calcite-spacing-sm)}.inline-loader{--calcite-loader-spacing: var(--calcite-spacing-md)}.add-spatial-mode{display:flex;flex-direction:column;gap:var(--calcite-spacing-md);margin:var(--calcite-spacing-md)}.heading{color:var(--calcite-color-text-1);margin:0 0 var(--calcite-spacing-md);font-size:var(--calcite-font-size);font-weight:var(--calcite-font-weight-medium)}`,p=`utility-network-trace-inputs-sketch-${Date.now()}`,U=20,f=class extends y{constructor(){super(...arguments),this._messages=S({blocking:!0}),this.#d=!0,this.#u=new Map,this.#s=new l,this.#r=new l,this.#o=new l,this.#b=new Set(["subnetwork","subnetwork-controller","upstream","downstream","isolation"]),this.#i=null,this.#n=20,this._candidateFeatures=[],this._compatibleSubnetworkNames=[],this._namedTraceConfigurations=[],this._subnetworkNamesState="ready",this._exceedDisplayLimit=!1,this.autoDestroyDisabled=!1,this.hideActionBar=!1,this.mode="default",this.arcgisPropertyChange=$()("mode"),this.arcgisSelectedNamedTraceConfigurationChange=n(),this.arcgisTraceInputsChange=n(),this.arcgisTraceLocationSelectEnd=n(),this.arcgisTraceLocationSelectStart=n(),this.arcgisUtilityNetworkChange=n()}static{this.properties={_selectedFeature:16,_candidateFeatures:16,_compatibleSubnetworkNames:16,_subnetworksTable:16,_namedTraceConfigurations:16,_traceConfiguration:16,_error:16,_subnetworkNamesState:16,_activeTraceLocationType:16,_exceedDisplayLimit:16,beforeTraceLocationSelectStart:0,view:0,selectedUtilityNetwork:0,selectedNamedTraceConfiguration:0,autoDestroyDisabled:5,hideActionBar:5,traceConfiguration:32,isSubnetworkNameTraceSelected:32,referenceElement:1,mode:3,traceLocationFlagInfos:32,traceLocations:32}}static{this.styles=P}get#t(){return this._traceConfiguration?.subnetworkName??void 0}set#t(t){this._traceConfiguration&&(this._traceConfiguration.subnetworkName=t)}#d;get#C(){let{view:t}=this;return t?.map?t.map.allLayers.toArray().concat(t.map.allTables.toArray()):[]}#e;#a;#u;#s;#r;#o;#b;#i;#c;#w;#y;#k;#n;get#$(){return!this.isSubnetworkNameTraceSelected}get#T(){let t=this.selectedNamedTraceConfiguration?.traceType;return t==="path"||t==="circuit"}get#L(){let t=this.selectedUtilityNetwork?.dataElement?.domainNetworks;return t?t.map(e=>e.subnetworkLayerId).filter(e=>e!=null&&e>-1):[]}get traceConfiguration(){return this._traceConfiguration}get isSubnetworkNameTraceSelected(){let{selectedNamedTraceConfiguration:t}=this;return!!t?.traceConfiguration?.subnetworkName&&t?.traceType==="subnetwork"}get traceLocationFlagInfos(){return new l([...this.#s,...this.#r,...this.#o])}get traceLocations(){let t=[];return this.#$&&this.#s.forEach(e=>t.push(...this.#m(e))),this.#T&&this.#o.forEach(e=>t.push(...this.#m(e))),this.#r.forEach(e=>t.push(...this.#m(e))),t}async destroy(){this.#A(p),this.#N(),this.#e?.cancel(),this.#c?.destroy(),this.#w?.destroy(),this.#y?.destroy(),this.#k?.destroy(),await this.manager.destroy()}load(){this.#v(),this.manager.onLifecycle(()=>[L(()=>this.view?.map,()=>this.#v())])}willUpdate(t){t.has("selectedUtilityNetwork")&&(this.arcgisUtilityNetworkChange.emit(),this.#K()),t.has("selectedNamedTraceConfiguration")&&(this.arcgisTraceInputsChange.emit(),this.arcgisSelectedNamedTraceConfigurationChange.emit(),this.#H())}disconnectedCallback(){super.disconnectedCallback(),this.#u.clear()}#x({detail:t,target:e}){(t.name==="selectedDrillInFeature"||t.name==="selectedFeature")&&(this._selectedFeature=e.selectedDrillInFeature??e.selectedFeature??void 0)}#v(){if(this._error=void 0,!this.view?.map){this._error=this._messages.errors.noView;return}let t=this.view.map;this.#B(t)}#I(t){t&&(this.#w=t)}#D(t){t&&(this.#y=t)}#E(t){t&&(this.#k=t)}#F(t){t&&(this.#c=t)}#m(t){let e=t.flagProperties.selectedTerminals;return t.flagProperties.terminalConfiguration&&e?.size?Array.from(e,i=>new E({type:t.traceLocation.type,isFilterBarrier:t.traceLocation.isFilterBarrier,globalId:t.traceLocation.globalId,percentAlong:t.traceLocation.percentAlong,terminalId:i})):[t.traceLocation]}#N(){let{view:t}=this;this.#s.forEach(e=>{e.spatialProperties.flagGraphic&&t?.graphics.remove(e.spatialProperties.flagGraphic)}),this.#s.removeAll(),this.#r.forEach(e=>{e.spatialProperties.flagGraphic&&t?.graphics.remove(e.spatialProperties.flagGraphic)}),this.#r.removeAll(),this.#o.forEach(e=>{e.spatialProperties.flagGraphic&&t?.graphics.remove(e.spatialProperties.flagGraphic)}),this.#o.removeAll()}#P(t,e){if(!t.findLayerById(e)){let i=new I({id:e,listMode:"hide",title:e});T(this.view,i)}}#U(t,e){let i=t.findLayerById(e);return g(i)?(t.reorder(i,t.layers.length-1),i):null}#A(t){if(!this.view?.map)return;let{map:e}=this.view,i=e?.findLayerById(t);i&&g(i)&&e?.remove(i)}#_(){if(!this.#e)return;let t=new l;this.#a?.forEach(e=>{v(e)?e.sublayers.forEach(i=>{t.add(new C({layer:i,enabled:!0}))}):t.add(new C({layer:e,enabled:!0}))}),this.#e.snappingOptions={enabled:!1,featureSources:t}}#M(t){let{view:e}=this,i=this.#U(t,p);return new F({layer:i,view:e})}#B(t){this.#P(t,p),this.#e=this.#M(t),this.#_()}#V(){this.#t=void 0,this._subnetworksTable=void 0,this._compatibleSubnetworkNames=[]}async#j(){this._subnetworksTable||(this._subnetworksTable=await this.selectedUtilityNetwork?.loadSubnetworksTable())}async#G(){let{_subnetworksTable:t}=this;if(!t)return;let e=t.fieldsIndex.get("SUBNETWORKNAME"),i=(o,c,u)=>c===0||o.getAttribute(e.name)!==u[c-1].getAttribute(e.name),a=t.createQuery();a.gdbVersion=this.selectedUtilityNetwork?.gdbVersion,a.where=this.#O(),a.outFields=[e.name],a.orderByFields=[e.name];let{features:r}=await m(t,a,void 0,!1);this._compatibleSubnetworkNames=r.filter(i).map(o=>o.getAttribute(e.name))}#O(){let t=this._traceConfiguration,e=`DOMAINNETWORKNAME = '${t.domainNetworkName}'`,i=`TIERNAME = '${t.tierName}'`;return[e,i].join(" AND ")}async#R(t){await this.#j(),await this.#G(),t.subnetworkName&&!this._compatibleSubnetworkNames.some(e=>e===t.subnetworkName)&&(this.#t=this._compatibleSubnetworkNames.at(0))}#z(t){let e=this.selectedUtilityNetwork?.sharedNamedTraceConfigurations.find(i=>i.globalId===t);if(!e){d("error",this,"`traceConfig` not found in `selectedUtilityNetwork.sharedNamedTraceConfigurations`");return}this.selectedNamedTraceConfiguration=e}async#H(){let{selectedNamedTraceConfiguration:t}=this;if(!(t?.traceConfiguration instanceof D)){d("error",this,w("selectedNamedTraceConfiguration.traceConfiguration")),this._traceConfiguration=void 0;return}this._traceConfiguration=t.traceConfiguration.clone(),this.isSubnetworkNameTraceSelected&&(this._subnetworkNamesState="loading",await this.#R(this._traceConfiguration),this._subnetworkNamesState="ready")}async#K(){let{selectedUtilityNetwork:t}=this;try{t&&!t.loaded&&await t.load()}catch(e){_(e,this,"Error while loading the selected utility network")}this.#V(),this.#Q(),this.#W(),this.#N()}#Q(){this._traceConfiguration=void 0,this.selectedNamedTraceConfiguration=void 0,this._namedTraceConfigurations=this.selectedUtilityNetwork?.sharedNamedTraceConfigurations.filter(Boolean).filter(t=>t.traceType!=="circuit").sort((t,e)=>t.title.localeCompare(e.title))||[],this._namedTraceConfigurations.length?this.selectedNamedTraceConfiguration=this._namedTraceConfigurations.at(0):d("error",this,"The selected utility network has no compatible named trace configurations.")}#W(){let{selectedUtilityNetwork:t}=this;this.#a=new l(this.#C.filter(e=>t?.isUtilityLayer(e)&&!this.#L.includes(e.layerId))),this.#_()}#g(t){if(t.stopPropagation(),this.arcgisTraceLocationSelectStart.emit(t.detail).defaultPrevented){t.preventDefault();return}this._activeTraceLocationType=t?.target?.traceLocationType,this.mode="add-spatial-instructions"}#q(t){if(t==null)return;let e=this.#u,i=this.#a,a=e.get(t);if(a)return a;if(!i)return;let r=i.find(o=>"layerId"in o&&o.layerId===t);return r&&e.set(t,r),r}async#J(t,e){let i=t.createQuery();i.gdbVersion=this.selectedUtilityNetwork?.gdbVersion,i.objectIds=e.map(r=>r.getObjectId()),i.outFields=["*"];let{features:a}=await m(t,i);return a.forEach(r=>{if(!r.getEffectivePopupTemplate(this.#d)){let o=r.layer;r.popupTemplate=o.createPopupTemplate()}}),a}async#X(t){let e=new Map,i=[];return t.forEach(a=>{let r=N(a.layer)?a.layer.parent:a.layer;if(r){let o=this.#q(r.layerId);if(o){let c=e.get(o)||[];c.push(a),e.set(o,c)}}}),await Promise.all(Array.from(e.keys()).map(async a=>{let r=e.get(a)??[],o=await this.#J(a,r);i.push(...o)})),i}async#p(t){return this._exceedDisplayLimit=t.length>this.#n,this._candidateFeatures=await this.#X(t.slice(0,this.#n)),this._candidateFeatures.length===0?(this.#l(),await Promise.reject(Error("No features found"))):(this._candidateFeatures.length===1&&(this._selectedFeature=this._candidateFeatures.at(0)),this.mode="add-spatial-feature",this.#i?.reject(),this.#i=Promise.withResolvers(),await this.#i.promise)}#f(t){t.stopPropagation(),this.arcgisTraceLocationSelectEnd.emit(),this._activeTraceLocationType=void 0,this.mode="default",this.#l()}#l(t){t?.stopPropagation(),this.#c?.clear(),this.#S(),this.#e?.cancel()}#S(){this.mode="default",this._candidateFeatures=[],this._selectedFeature=void 0,this.#i?.reject(),this.#i=null}#Y(){let t=this.#i,e=this.#c,{_selectedFeature:i}=this;if(t&&e){if(!i)return;t.resolve(i),this.#i=null}}#h(t,e=!1,i){return s`<calcite-notice .closable=${e} kind=danger open scale=s width=auto .icon=${i}><div slot=message>${t}</div></calcite-notice>`}#Z(){let t=this._namedTraceConfigurations.map(i=>s`<calcite-combobox-item .value=${i.globalId} .heading=${i.title} .selected=${i.globalId===this.selectedNamedTraceConfiguration?.globalId}></calcite-combobox-item>`),e=this._messages.labels.traceConfiguration;return s`<calcite-block .heading=${e} .label=${e} expanded><calcite-combobox .label=${e} selection-mode=single-persist @calciteComboboxChange=${({currentTarget:i})=>{let a=i.selectedItems[0]?.value;this.#z(a)}}>${t}</calcite-combobox></calcite-block>`}#tt(){let{selectedUtilityNetwork:t,view:e}=this;return s`<arcgis-utility-network-picker .selectedUtilityNetwork=${t} .view=${e} @arcgisPropertyChange=${i=>{i.detail.name==="selectedUtilityNetwork"&&(this.selectedUtilityNetwork=i.target.selectedUtilityNetwork)}}></arcgis-utility-network-picker>`}#et(){let{_error:t}=this,{noView:e}=this._messages.errors,i;return t===e?i=this.#h(t,!1,"exclamation-mark-triangle"):i=this.#ut(),s`<calcite-flow-item .selected=${this.mode==="default"}>${i}</calcite-flow-item>`}#it(){let{_messages:t,mode:e}=this,i=this._activeTraceLocationType==="starting-point"?t.labels.addSpatial.startingPoint:this._activeTraceLocationType==="barrier"?t.labels.addSpatial.barrier:t.labels.addSpatial.stoppingPoint;return s`<calcite-flow-item .selected=${e==="add-spatial-instructions"} .heading=${i} @calciteFlowItemBack=${a=>this.#l(a)}><div class="add-spatial-mode"><div><h5 class="heading">${t.instructions.addSpatial.selectFeature.heading}</h5>${t.instructions.addSpatial.selectFeature.subheading}</div><div><h5 class="heading">${t.instructions.addSpatial.selectAssociatedFeature.heading}</h5>${t.instructions.addSpatial.selectAssociatedFeature.subheading}</div></div></calcite-flow-item>`}#at(){let{_activeTraceLocationType:t,_candidateFeatures:e,_messages:i}=this;if(!e.length)return this.mode="default",null;let a=t==="starting-point"?i.labels.addSpatial.startingPoint:t==="barrier"?i.labels.addSpatial.barrier:i.labels.addSpatial.stoppingPoint,r=e.length===1?"feature":"list";return s`<arcgis-features-next .autoDestroyDisabled=${this.autoDestroyDisabled} .defaultPopupTemplateEnabled=${this.#d} .features=${this._candidateFeatures} .featureMenuTitle=${a} .hideActionBar=${this.hideActionBar} hide-select-feature .initialDisplayMode=${r} @arcgisClose=${()=>this.#S()} @arcgisPropertyChange=${this.#x} open .referenceElement=${this.referenceElement} .view=${this.view} ${h(this.#F)}></arcgis-features-next>`}#st(){let{mode:t,_messages:e,_selectedFeature:i,selectedUtilityNetwork:a}=this,r=t==="add-spatial-feature"&&this._exceedDisplayLimit&&!i,o=x(e.warnings.exceededDisplayLimit,{limit:this.#n.toString()}),c=i?!(a?.isUtilityLayer(i.layer)??!0):!0;return s`${r&&s`<calcite-input-message id=results-limited-message icon=exclamation-mark-circle status=idle>${o}</calcite-input-message>`||""}<calcite-button appearance=outline width=full @click=${()=>this.#l()} slot=footer>${e.buttons.cancel}</calcite-button>${t==="add-spatial-feature"&&s`<calcite-button width=full slot=footer appearance=solid @click=${()=>this.#Y()} .disabled=${c}>${e.buttons.add}</calcite-button>`||""}`}#rt(){return s`<arcgis-utility-network-trace-location-next .view=${this.view} trace-location-type=starting-point .beforeTraceLocationSelectStart=${this.beforeTraceLocationSelectStart} @arcgisTraceLocationSelectStart=${this.#g} @arcgisTraceLocationSelectEnd=${this.#f} @arcgisTraceLocationChange=${()=>this.arcgisTraceInputsChange.emit()} .sketchViewModel=${this.#e} .utilityNetwork=${this.selectedUtilityNetwork} .filterLayers=${this.#a} .traceLocations=${this.#s} .afterHitTest=${this.#p.bind(this)} .autoDestroyDisabled=${this.autoDestroyDisabled} ${h(this.#I)}></arcgis-utility-network-trace-location-next>`}#ot(){return s`<arcgis-utility-network-trace-location-next .view=${this.view} trace-location-type=stopping-point .beforeTraceLocationSelectStart=${this.beforeTraceLocationSelectStart} @arcgisTraceLocationSelectStart=${this.#g} @arcgisTraceLocationSelectEnd=${this.#f} @arcgisTraceLocationChange=${()=>this.arcgisTraceInputsChange.emit()} .sketchViewModel=${this.#e} .utilityNetwork=${this.selectedUtilityNetwork} .filterLayers=${this.#a} .traceLocations=${this.#o} .afterHitTest=${this.#p.bind(this)} .autoDestroyDisabled=${this.autoDestroyDisabled} ${h(this.#E)}></arcgis-utility-network-trace-location-next>`}#ct(){return s`<arcgis-utility-network-trace-location-next .view=${this.view} trace-location-type=barrier .beforeTraceLocationSelectStart=${this.beforeTraceLocationSelectStart} @arcgisTraceLocationSelectStart=${this.#g} @arcgisTraceLocationSelectEnd=${this.#f} @arcgisTraceLocationChange=${()=>this.arcgisTraceInputsChange.emit()} .sketchViewModel=${this.#e} .utilityNetwork=${this.selectedUtilityNetwork} .filterLayers=${this.#a} .traceLocations=${this.#r} .afterHitTest=${this.#p.bind(this)} .autoDestroyDisabled=${this.autoDestroyDisabled} ${h(this.#D)}></arcgis-utility-network-trace-location-next>`}#nt(){let{_messages:t}=this;return s`<calcite-input clearable type=text .placeholder=${t.instructions.enterSubnetworkName} max-length=64 .status=${this.#t?"valid":"invalid"} .value=${this.#t} @calciteInputInput=${e=>this.#t=e.target.value}></calcite-input><calcite-input-message icon=exclamation-mark-triangle status=idle>${t.labels.tooManySubnetworks}</calcite-input-message>`}#lt(){return s`<calcite-combobox .label=${this._messages.labels.subnetworkName} selection-mode=single-persist @calciteComboboxChange=${({currentTarget:t})=>{let e=t.selectedItems[0]?.value;this.#t=e}}>${this._compatibleSubnetworkNames.map(t=>s`<calcite-combobox-item .value=${t} .heading=${t} .selected=${t===this.#t}></calcite-combobox-item>`)}</calcite-combobox>`}#ht(){let{_messages:t}=this,e=t.labels.subnetworkName;return this.isSubnetworkNameTraceSelected?this._subnetworkNamesState==="loading"?s`<calcite-loader class="inline-loader" label=loading scale=s></calcite-loader>`:this._compatibleSubnetworkNames.length?s`<calcite-block .heading=${e} .label=${e} expanded>${this._compatibleSubnetworkNames.length>U?this.#nt():this.#lt()}</calcite-block>`:this.#h(t.errors.noCompatibleSubnetworks,!1,"exclamation-mark-triangle"):null}#dt(){let{selectedNamedTraceConfiguration:t}=this;return this._traceConfiguration&&t?.traceType&&this.#b.has(t.traceType)?s`<calcite-block id=subnetwork-info-block expanded .label=${this._messages.labels.subnetworkInfo}><arcgis-utility-network-subnetwork-info-next .namedTraceConfiguration=${t}></arcgis-utility-network-subnetwork-info-next></calcite-block>`:null}#ut(){let{_messages:t}=this,{noTraceConfiguration:e,noNamedTraceConfigurations:i}=t.errors,a=this.#tt(),r;this._namedTraceConfigurations.length||(r=this.#h(i,!1,"exclamation-mark-triangle"));let o=s`${this.#Z()}${this.#dt()}${this.#ht()}`,c=this.traceConfiguration?s`${this.#$?this.#rt():null}${this.#T?this.#ot():null}${this.#ct()}`:this.#h(e,!1,"exclamation-mark-triangle"),u=this.selectedUtilityNetwork?.loaded?r??s`${o}${c}`:null;return s`<calcite-block-group .label=${t.labels.traceInputs}>${a}${u}</calcite-block-group>`}render(){let{mode:t}=this;return s`<calcite-panel>${t==="add-spatial-feature"?this.#at():null}<calcite-flow .hidden=${t==="add-spatial-feature"}>${this.#et()}${this.#it()}</calcite-flow>${t!=="default"?this.#st():null}</calcite-panel>`}};k("arcgis-utility-network-trace-inputs-next",f);return f},"core/Collection","core/reactiveUtils","intl","layers/GraphicsLayer","networks/support/UNTraceConfiguration","rest/networks/support/TraceLocation","views/interactive/snapping/FeatureSnappingLayerSource","widgets/Sketch/SketchViewModel",a,c)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import c from"./MZWO5JYA.js";import a from"./O6F37YLT.js";import"./VJVKFKSG.js";import{a as C}from"./WVGSH2QD.js";import"./5DI7RMZ6.js";import"./Q7SMGP5R.js";import"./QUZTFUWM.js";import"./NCYBFT2Y.js";import{L as y,M as d,N as f,T as b,a as p,b as r,o,q as g,r as v,w as h}from"./WTBRS6C4.js";import"./H6RQVSYM.js";export default $arcgis.t(([E,{a:R},{b:$,e:w}])=>{var x=p`:host{min-height:var(--arcgis-internal-panel-height-sm, 240px);height:100%}arcgis-features-next{height:100%}calcite-table{--calcite-table-border-color: none}calcite-table-row{--calcite-table-row-border-color: var(--calcite-color-border-3)}.white-panel-background{--calcite-panel-background-color: var(--calcite-color-foreground-1)}.aggregated-geometry-container{display:flex;justify-content:space-between;margin:0 var(--calcite-spacing-md) var(--calcite-spacing-md)}#elements-list-item{border:solid 1px var(--calcite-color-border-3);border-radius:var(--calcite-corner-radius-sm);margin:0 var(--calcite-spacing-sm)}.no-selectable-results{margin:0 var(--calcite-spacing-md);color:var(--calcite-color-text-3);font-size:var(--calcite-font-size)}.results-heading{display:flex;flex-direction:column;margin:var(--calcite-spacing-md);gap:var(--calcite-spacing-xs)}.results-heading-title{font-weight:var(--calcite-font-weight-medium);font-size:var(--calcite-font-size);color:var(--calcite-color-text-1)}.results-heading-subtitle{font-size:var(--calcite-font-size--1);color:var(--calcite-color-text-3)}.functions-heading{margin:var(--calcite-spacing-md) var(--calcite-spacing-md) var(--calcite-spacing-xxs);font-weight:var(--calcite-font-weight-medium);font-size:var(--calcite-font-size);color:var(--calcite-color-text-1)}.no-results-landing{display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center;margin:var(--calcite-spacing-sm) var(--calcite-spacing-xl) var(--calcite-spacing-xl);gap:var(--calcite-spacing-md)}.no-results-landing calcite-icon{margin-bottom:var(--calcite-spacing-sm);--calcite-icon-color: var(--calcite-color-text-3)}.no-results-landing .no-results-heading{font-size:var(--calcite-font-size-2)}.no-results-landing .no-results-description{color:var(--calcite-color-text-3)}`,u={dirtyAreasDiscovered:-2147208511,noValidControllers:-2147208935,pathNotFound:-2147208444},m=class extends f{constructor(){super(...arguments),this._messages=C({blocking:!0}),this.#c=!0,this.#t=[],this.#s=y(),this.#a=new Map,this.#o=new Map,this.#i=new Map,this.#r=new Map,this.#l=[],this._aggregatedGeometryDisabled=!1,this.aggregatedGeometryGraphicsColor=new E([255,255,0,.6]),this.hideActionBar=!1,this.hideFeatureResults=!1,this.isElementsSelected=!1,this.layers=[],this.state="ready",this.traceResultFeatures=[],this.autoDestroyDisabled=!1,this.arcgisAggregatedGeometryGraphicsColorChange=h(),this.arcgisHideGraphicsChange=h(),this.arcgisSelectedResultTypeChange=h(),this.arcgisTraceResultFeaturesReady=h()}static{this.properties={_aggregatedGeometryDisabled:16,_featuresComponentElement:16,aggregatedGeometryGraphicsColor:0,hideActionBar:5,hideFeatureResults:5,isElementsSelected:5,layers:0,messageOverrides:0,numResults:32,referenceElement:1,state:1,traceConfigTitle:1,traceError:0,traceResult:0,traceResultFeatures:0,utilityNetwork:0,view:0,autoDestroyDisabled:5}}static{this.styles=x}#c;#t;#n;#s;#a;#o;#i;#r;#l;get numResults(){return this.traceResultFeatures.length+this.#t.length}clearAggregatedGeometryGraphics(){this.#n?.destroy()}async destroy(){this.#a.clear(),this.#i.clear(),this.#r.clear(),this.#n?.destroy(),this._featuresComponentElement?.destroy(),await this.manager.destroy()}load(){this.traceResult&&(this.#$(),this.#f().then(()=>this.#b()).finally(()=>{this.arcgisTraceResultFeaturesReady.emit(),this.state="ready"}))}willUpdate(e){e.has("isElementsSelected")&&this.arcgisSelectedResultTypeChange.emit(),e.has("traceResult")&&(this.isElementsSelected=!1,this.traceResult||(this.traceResultFeatures=[],this.#t=[]))}loaded(){this.traceResult&&(this.utilityNetwork||o("warn",this,g("utilityNetwork")),this.layers.length||o("warn",this,v("layers")),this.view||o("warn",this,g("view")))}disconnectedCallback(){super.disconnectedCallback(),this.#o.clear()}#g(e){e&&(this.#n=e)}#u(e){e&&(this._featuresComponentElement=e)}async#m([e,t]){let a=this.utilityNetwork?.getLayerIdBySourceId(e),s=this.#p(a),i=this.#v(t);if(a==null||!s){this.#t.push(...i);return}let l=s.createQuery();l.gdbVersion=this.utilityNetwork?.gdbVersion,l.objectIds=i.map(n=>n.objectId),l.outFields=["*"];let{features:c}=await $(s,l);c.forEach(n=>{let k=n.layer;n.getEffectivePopupTemplate(this.#c)||(n.popupTemplate=k.createPopupTemplate())}),w(s)?c.forEach(n=>this.#h(this.#i,n.layer.subtypeCode,n)):this.#a.set(a,c)}#h(e,t,a){let s=e.get(t);s==null?e.set(t,[a]):s.push(a)}#p(e){if(e==null)return;let t=this.#o,a=this.#l,s=t.get(e);if(s)return s;if(!a)return;let i=a.find(l=>"layerId"in l&&l.layerId===e);return i&&t.set(e,i),i}#v(e){return Array.from(new Map(e.map(t=>[t.globalId,t])).values())}#y(e){e.stopPropagation();let t=e.detail;this.arcgisHideGraphicsChange.emit(t),this._aggregatedGeometryDisabled=t,t&&this.#s.value?.open&&(this.#s.value.open=!1)}async#f(){let{layers:e,utilityNetwork:t}=this;if(!t)return;try{t.loaded||(this.state="loading",await t.load())}catch(s){R(s,this,"Error while loading the selected utility network")}this.#l=e.filter(s=>t.isUtilityLayer(s));let a=this.#l.filter(s=>!s.loaded).map(s=>s.load());a.length>0&&(this.state="loading",(await Promise.allSettled(a)).forEach(s=>{s.status==="rejected"&&o("error",this,`Failed to load layer. Reason: ${s.reason}`)}))}async#b(){let e=Array.from(this.#r.entries());if(!e.length)return;this.state="loading";let t=e.map(i=>this.#m(i));(await Promise.allSettled(t)).forEach((i,l)=>{if(i.status==="rejected"){let[c]=e[l];o("error",this,`Failed to query features for source ${c}. Reason: ${i.reason}`)}});let a=Array.from(this.#a.values()),s=Array.from(this.#i.values());this.traceResultFeatures=a.concat(s).flat()}#$(){this.traceResult.elements?.forEach(e=>this.#h(this.#r,e.networkSourceId,e))}render(){let{traceError:e,traceResult:t}=this;if(e)return this.#G(e);if(!t)return this.#A();let{elements:a,globalFunctionResults:s,aggregatedGeometry:i}=t,l=!a.length&&!s.length&&!i,c=a.length>0&&!s.length&&!i;return l?this.#_():this.state==="loading"?this.#w():this.hideFeatureResults&&c?this.#k():this.isElementsSelected||c?r`<arcgis-features-next .autoDestroyDisabled=${this.autoDestroyDisabled} .defaultPopupTemplateEnabled=${this.#c} .features=${this.traceResultFeatures} .hideActionBar=${this.hideActionBar} .hideCloseButton=${c} hide-select-feature initial-display-mode=list .messageOverrides=${this.messageOverrides} @arcgisClose=${()=>this.isElementsSelected=!1} open .referenceElement=${this.referenceElement} .view=${this.view} ${d(this.#u)}></arcgis-features-next>`:this.#R(t)}#w(){return r`<calcite-panel class="white-panel-background"><calcite-loader .label=${this._messages.gettingResults} .text=${this._messages.gettingResults}></calcite-loader></calcite-panel>`}#R(e){let{elements:t,globalFunctionResults:a,aggregatedGeometry:s}=e;return r`<calcite-panel class="white-panel-background">${this.#e()}${s!=null?this.#C(s):null}${s!=null&&!t.length?this.#E():null}${t.length>0?this.hideFeatureResults?this.#d():this.#x():null}${a.length>0?this.#F(a):null}</calcite-panel>`}#C(e){let{_aggregatedGeometryDisabled:t,aggregatedGeometryGraphicsColor:a,_messages:s}=this;return r`<div class="aggregated-geometry-container"><arcgis-utility-network-aggregated-geometry .graphicsColor=${a} .geometry=${e} .view=${this.view} @arcgisHideGraphicsChange=${this.#y} auto-destroy-disabled ${d(this.#g)}></arcgis-utility-network-aggregated-geometry><calcite-swatch id=geometry-color-swatch .label=${s.labels.aggregatedGeometryGraphicsColor} .color=${a.toCss()} .disabled=${t}></calcite-swatch><calcite-popover .heading=${s.headings.setColor} .label=${s.headings.setColor} reference-element=geometry-color-swatch closable ${d(this.#s)}><calcite-color-picker alpha-channel channels-disabled clearable hex-disabled saved-disabled .value=${a} @calciteColorPickerChange=${i=>{let l=i.target.value;this.arcgisAggregatedGeometryGraphicsColorChange.emit(l)}} .disabled=${t}></calcite-color-picker></calcite-popover></div>`}#k(){return r`<calcite-panel class="white-panel-background">${this.#e()}${this.#d()}</calcite-panel>`}#d(){return r`<div class="no-selectable-results">${this._messages.resultFeaturesAreHidden}</div>`}#E(){return r`<div class="no-selectable-results">${this._messages.noSelectableFeatures}</div>`}#x(){let{_messages:e}=this;return r`<calcite-list .label=${e.headings.traceResultsGeneric}><calcite-list-item id=elements-list-item .label=${e.headings.features} @calciteListItemSelect=${()=>this.isElementsSelected=!0}><calcite-chip .label=${e.labels.numFeatures} scale=s slot=content-end>${this.numResults}</calcite-chip><calcite-icon icon=chevron-right slot=content-end></calcite-icon></calcite-list-item></calcite-list>`}#F(e){let{_messages:t}=this;return r`<div class="functions-heading">${t.headings.functions}</div><calcite-table .caption=${t.labels.functionResults}>${e.filter(a=>a.networkAttributeName!=null&&a.result!=null&&a.functionType!=null).map(a=>{let{functionName:s,networkAttributeName:i,functionType:l,result:c}=a,n=s||`${i} ${l}`;return r`<calcite-table-row><calcite-table-cell>${n}</calcite-table-cell><calcite-table-cell>${c}</calcite-table-cell></calcite-table-row>`})}</calcite-table>`}#e(){return r`<div class="results-heading"><div class="results-heading-title">${this._messages.headings.traceResultsGeneric}</div>${this.traceConfigTitle?r`<div class="results-heading-subtitle">${this.traceConfigTitle}</div>`:null}</div>`}#G(e){let{_messages:t}=this,a=e.message;switch(e.details?.raw?.extendedCode){case u.dirtyAreasDiscovered:a=t.traceErrors.dirtyAreasDiscovered;break;case u.noValidControllers:a=t.traceErrors.noValidControllers;break;case u.pathNotFound:a=t.traceErrors.pathNotFound;break}return r`<calcite-panel class="white-panel-background">${this.#e()}<div class="no-results-landing"><calcite-icon icon=exclamation-mark-triangle scale=l></calcite-icon><div class="no-results-heading">${t.traceFailedHeading}</div><div class="no-results-description">${t.traceFailedDescription}</div><div class="no-results-description">${a}</div></div></calcite-panel>`}#_(){let{_messages:e}=this;return r`<calcite-panel class="white-panel-background">${this.#e()}<div class="no-results-landing"><calcite-icon icon=exclamation-mark-triangle scale=l></calcite-icon><div class="no-results-heading">${e.noResultsHeading}</div><div class="no-results-description">${e.noResultsDescription}</div></div></calcite-panel>`}#A(){let{_messages:e}=this;return r`<calcite-panel class="white-panel-background">${this.#e()}<div class="no-results-landing"><calcite-icon icon=utility-network-trace scale=l></calcite-icon><div class="no-results-heading">${e.noTraceConfigHeading}</div><div class="no-results-description">${e.noTraceConfigDescription}</div></div></calcite-panel>`}};b("arcgis-utility-network-trace-results",m);return m},"Color",a,c)
|
|
2
|
+
import c from"./MZWO5JYA.js";import a from"./HAUHWMHN.js";import"./VJVKFKSG.js";import{a as C}from"./WVGSH2QD.js";import"./5DI7RMZ6.js";import"./Q7SMGP5R.js";import"./QUZTFUWM.js";import"./NCYBFT2Y.js";import{L as y,M as d,N as f,T as b,a as p,b as r,o,q as g,r as v,w as h}from"./WTBRS6C4.js";import"./H6RQVSYM.js";export default $arcgis.t(([E,{a:R},{b:$,e:w}])=>{var x=p`:host{min-height:var(--arcgis-internal-panel-height-sm, 240px);height:100%}arcgis-features-next{height:100%}calcite-table{--calcite-table-border-color: none}calcite-table-row{--calcite-table-row-border-color: var(--calcite-color-border-3)}.white-panel-background{--calcite-panel-background-color: var(--calcite-color-foreground-1)}.aggregated-geometry-container{display:flex;justify-content:space-between;margin:0 var(--calcite-spacing-md) var(--calcite-spacing-md)}#elements-list-item{border:solid 1px var(--calcite-color-border-3);border-radius:var(--calcite-corner-radius-sm);margin:0 var(--calcite-spacing-sm)}.no-selectable-results{margin:0 var(--calcite-spacing-md);color:var(--calcite-color-text-3);font-size:var(--calcite-font-size)}.results-heading{display:flex;flex-direction:column;margin:var(--calcite-spacing-md);gap:var(--calcite-spacing-xs)}.results-heading-title{font-weight:var(--calcite-font-weight-medium);font-size:var(--calcite-font-size);color:var(--calcite-color-text-1)}.results-heading-subtitle{font-size:var(--calcite-font-size--1);color:var(--calcite-color-text-3)}.functions-heading{margin:var(--calcite-spacing-md) var(--calcite-spacing-md) var(--calcite-spacing-xxs);font-weight:var(--calcite-font-weight-medium);font-size:var(--calcite-font-size);color:var(--calcite-color-text-1)}.no-results-landing{display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center;margin:var(--calcite-spacing-sm) var(--calcite-spacing-xl) var(--calcite-spacing-xl);gap:var(--calcite-spacing-md)}.no-results-landing calcite-icon{margin-bottom:var(--calcite-spacing-sm);--calcite-icon-color: var(--calcite-color-text-3)}.no-results-landing .no-results-heading{font-size:var(--calcite-font-size-2)}.no-results-landing .no-results-description{color:var(--calcite-color-text-3)}`,u={dirtyAreasDiscovered:-2147208511,noValidControllers:-2147208935,pathNotFound:-2147208444},m=class extends f{constructor(){super(...arguments),this._messages=C({blocking:!0}),this.#c=!0,this.#t=[],this.#s=y(),this.#a=new Map,this.#o=new Map,this.#i=new Map,this.#r=new Map,this.#l=[],this._aggregatedGeometryDisabled=!1,this.aggregatedGeometryGraphicsColor=new E([255,255,0,.6]),this.hideActionBar=!1,this.hideFeatureResults=!1,this.isElementsSelected=!1,this.layers=[],this.state="ready",this.traceResultFeatures=[],this.autoDestroyDisabled=!1,this.arcgisAggregatedGeometryGraphicsColorChange=h(),this.arcgisHideGraphicsChange=h(),this.arcgisSelectedResultTypeChange=h(),this.arcgisTraceResultFeaturesReady=h()}static{this.properties={_aggregatedGeometryDisabled:16,_featuresComponentElement:16,aggregatedGeometryGraphicsColor:0,hideActionBar:5,hideFeatureResults:5,isElementsSelected:5,layers:0,messageOverrides:0,numResults:32,referenceElement:1,state:1,traceConfigTitle:1,traceError:0,traceResult:0,traceResultFeatures:0,utilityNetwork:0,view:0,autoDestroyDisabled:5}}static{this.styles=x}#c;#t;#n;#s;#a;#o;#i;#r;#l;get numResults(){return this.traceResultFeatures.length+this.#t.length}clearAggregatedGeometryGraphics(){this.#n?.destroy()}async destroy(){this.#a.clear(),this.#i.clear(),this.#r.clear(),this.#n?.destroy(),this._featuresComponentElement?.destroy(),await this.manager.destroy()}load(){this.traceResult&&(this.#$(),this.#f().then(()=>this.#b()).finally(()=>{this.arcgisTraceResultFeaturesReady.emit(),this.state="ready"}))}willUpdate(e){e.has("isElementsSelected")&&this.arcgisSelectedResultTypeChange.emit(),e.has("traceResult")&&(this.isElementsSelected=!1,this.traceResult||(this.traceResultFeatures=[],this.#t=[]))}loaded(){this.traceResult&&(this.utilityNetwork||o("warn",this,g("utilityNetwork")),this.layers.length||o("warn",this,v("layers")),this.view||o("warn",this,g("view")))}disconnectedCallback(){super.disconnectedCallback(),this.#o.clear()}#g(e){e&&(this.#n=e)}#u(e){e&&(this._featuresComponentElement=e)}async#m([e,t]){let a=this.utilityNetwork?.getLayerIdBySourceId(e),s=this.#p(a),i=this.#v(t);if(a==null||!s){this.#t.push(...i);return}let l=s.createQuery();l.gdbVersion=this.utilityNetwork?.gdbVersion,l.objectIds=i.map(n=>n.objectId),l.outFields=["*"];let{features:c}=await $(s,l);c.forEach(n=>{let k=n.layer;n.getEffectivePopupTemplate(this.#c)||(n.popupTemplate=k.createPopupTemplate())}),w(s)?c.forEach(n=>this.#h(this.#i,n.layer.subtypeCode,n)):this.#a.set(a,c)}#h(e,t,a){let s=e.get(t);s==null?e.set(t,[a]):s.push(a)}#p(e){if(e==null)return;let t=this.#o,a=this.#l,s=t.get(e);if(s)return s;if(!a)return;let i=a.find(l=>"layerId"in l&&l.layerId===e);return i&&t.set(e,i),i}#v(e){return Array.from(new Map(e.map(t=>[t.globalId,t])).values())}#y(e){e.stopPropagation();let t=e.detail;this.arcgisHideGraphicsChange.emit(t),this._aggregatedGeometryDisabled=t,t&&this.#s.value?.open&&(this.#s.value.open=!1)}async#f(){let{layers:e,utilityNetwork:t}=this;if(!t)return;try{t.loaded||(this.state="loading",await t.load())}catch(s){R(s,this,"Error while loading the selected utility network")}this.#l=e.filter(s=>t.isUtilityLayer(s));let a=this.#l.filter(s=>!s.loaded).map(s=>s.load());a.length>0&&(this.state="loading",(await Promise.allSettled(a)).forEach(s=>{s.status==="rejected"&&o("error",this,`Failed to load layer. Reason: ${s.reason}`)}))}async#b(){let e=Array.from(this.#r.entries());if(!e.length)return;this.state="loading";let t=e.map(i=>this.#m(i));(await Promise.allSettled(t)).forEach((i,l)=>{if(i.status==="rejected"){let[c]=e[l];o("error",this,`Failed to query features for source ${c}. Reason: ${i.reason}`)}});let a=Array.from(this.#a.values()),s=Array.from(this.#i.values());this.traceResultFeatures=a.concat(s).flat()}#$(){this.traceResult.elements?.forEach(e=>this.#h(this.#r,e.networkSourceId,e))}render(){let{traceError:e,traceResult:t}=this;if(e)return this.#G(e);if(!t)return this.#A();let{elements:a,globalFunctionResults:s,aggregatedGeometry:i}=t,l=!a.length&&!s.length&&!i,c=a.length>0&&!s.length&&!i;return l?this.#_():this.state==="loading"?this.#w():this.hideFeatureResults&&c?this.#k():this.isElementsSelected||c?r`<arcgis-features-next .autoDestroyDisabled=${this.autoDestroyDisabled} .defaultPopupTemplateEnabled=${this.#c} .features=${this.traceResultFeatures} .hideActionBar=${this.hideActionBar} .hideCloseButton=${c} hide-select-feature initial-display-mode=list .messageOverrides=${this.messageOverrides} @arcgisClose=${()=>this.isElementsSelected=!1} open .referenceElement=${this.referenceElement} .view=${this.view} ${d(this.#u)}></arcgis-features-next>`:this.#R(t)}#w(){return r`<calcite-panel class="white-panel-background"><calcite-loader .label=${this._messages.gettingResults} .text=${this._messages.gettingResults}></calcite-loader></calcite-panel>`}#R(e){let{elements:t,globalFunctionResults:a,aggregatedGeometry:s}=e;return r`<calcite-panel class="white-panel-background">${this.#e()}${s!=null?this.#C(s):null}${s!=null&&!t.length?this.#E():null}${t.length>0?this.hideFeatureResults?this.#d():this.#x():null}${a.length>0?this.#F(a):null}</calcite-panel>`}#C(e){let{_aggregatedGeometryDisabled:t,aggregatedGeometryGraphicsColor:a,_messages:s}=this;return r`<div class="aggregated-geometry-container"><arcgis-utility-network-aggregated-geometry .graphicsColor=${a} .geometry=${e} .view=${this.view} @arcgisHideGraphicsChange=${this.#y} auto-destroy-disabled ${d(this.#g)}></arcgis-utility-network-aggregated-geometry><calcite-swatch id=geometry-color-swatch .label=${s.labels.aggregatedGeometryGraphicsColor} .color=${a.toCss()} .disabled=${t}></calcite-swatch><calcite-popover .heading=${s.headings.setColor} .label=${s.headings.setColor} reference-element=geometry-color-swatch closable ${d(this.#s)}><calcite-color-picker alpha-channel channels-disabled clearable hex-disabled saved-disabled .value=${a} @calciteColorPickerChange=${i=>{let l=i.target.value;this.arcgisAggregatedGeometryGraphicsColorChange.emit(l)}} .disabled=${t}></calcite-color-picker></calcite-popover></div>`}#k(){return r`<calcite-panel class="white-panel-background">${this.#e()}${this.#d()}</calcite-panel>`}#d(){return r`<div class="no-selectable-results">${this._messages.resultFeaturesAreHidden}</div>`}#E(){return r`<div class="no-selectable-results">${this._messages.noSelectableFeatures}</div>`}#x(){let{_messages:e}=this;return r`<calcite-list .label=${e.headings.traceResultsGeneric}><calcite-list-item id=elements-list-item .label=${e.headings.features} @calciteListItemSelect=${()=>this.isElementsSelected=!0}><calcite-chip .label=${e.labels.numFeatures} scale=s slot=content-end>${this.numResults}</calcite-chip><calcite-icon icon=chevron-right slot=content-end></calcite-icon></calcite-list-item></calcite-list>`}#F(e){let{_messages:t}=this;return r`<div class="functions-heading">${t.headings.functions}</div><calcite-table .caption=${t.labels.functionResults}>${e.filter(a=>a.networkAttributeName!=null&&a.result!=null&&a.functionType!=null).map(a=>{let{functionName:s,networkAttributeName:i,functionType:l,result:c}=a,n=s||`${i} ${l}`;return r`<calcite-table-row><calcite-table-cell>${n}</calcite-table-cell><calcite-table-cell>${c}</calcite-table-cell></calcite-table-row>`})}</calcite-table>`}#e(){return r`<div class="results-heading"><div class="results-heading-title">${this._messages.headings.traceResultsGeneric}</div>${this.traceConfigTitle?r`<div class="results-heading-subtitle">${this.traceConfigTitle}</div>`:null}</div>`}#G(e){let{_messages:t}=this,a=e.message;switch(e.details?.raw?.extendedCode){case u.dirtyAreasDiscovered:a=t.traceErrors.dirtyAreasDiscovered;break;case u.noValidControllers:a=t.traceErrors.noValidControllers;break;case u.pathNotFound:a=t.traceErrors.pathNotFound;break}return r`<calcite-panel class="white-panel-background">${this.#e()}<div class="no-results-landing"><calcite-icon icon=exclamation-mark-triangle scale=l></calcite-icon><div class="no-results-heading">${t.traceFailedHeading}</div><div class="no-results-description">${t.traceFailedDescription}</div><div class="no-results-description">${a}</div></div></calcite-panel>`}#_(){let{_messages:e}=this;return r`<calcite-panel class="white-panel-background">${this.#e()}<div class="no-results-landing"><calcite-icon icon=exclamation-mark-triangle scale=l></calcite-icon><div class="no-results-heading">${e.noResultsHeading}</div><div class="no-results-description">${e.noResultsDescription}</div></div></calcite-panel>`}#A(){let{_messages:e}=this;return r`<calcite-panel class="white-panel-background">${this.#e()}<div class="no-results-landing"><calcite-icon icon=utility-network-trace scale=l></calcite-icon><div class="no-results-heading">${e.noTraceConfigHeading}</div><div class="no-results-description">${e.noTraceConfigDescription}</div></div></calcite-panel>`}};b("arcgis-utility-network-trace-results",m);return m},"Color",a,c)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import a from"./
|
|
2
|
+
import a from"./HAUHWMHN.js";import{a as h}from"./VJVKFKSG.js";import{o as c}from"./WTBRS6C4.js";export default $arcgis.t(([{forceInteractive:m},f,{property:o,subclass:g},{ignoreAbortErrors:A},{when:I,watch:v,on:O,whenOnce:F},{getDefaultUnitForView:b},{b:u,c:d,d:_,e:y}])=>{var T=Object.defineProperty,R=Object.getOwnPropertyDescriptor,n=(s,i,t,a)=>{for(var r=a>1?void 0:a?R(i,t):i,l=s.length-1,p;l>=0;l--)(p=s[l])&&(r=(a?p(i,t,r):p(r))||r);return a&&r&&T(i,t,r),r},w=Symbol("interactiveHandle"),e=class extends f{constructor(){super({}),this.operationState="inactive",this._ownsAnalysis=!1,this.shouldForceInteractive=!0,this._changeFromReconnect=!1,this._userOperationInfo=null,this._loggedUnsupportedErrorMessage=!1}initialize(){this._set("analysis",this.constructAnalysis()),this._ownsAnalysis=!0;let s=()=>{!this._changeFromReconnect&&!this._viewHasAnalysis&&(this._ownsAnalysis=!1);let i=!this._changeFromReconnect;this._changeFromReconnect=!1,i&&this._scheduleViewReconnect()};this.addHandles([I(()=>this.view?.ready&&!this.supported,()=>{this._loggedUnsupportedErrorMessage||c("error",this,this.unsupportedErrorMessage)},{sync:!0,initial:!0}),v(()=>[this.analysis,this._viewHasAnalysis],s,{sync:!0}),O(()=>this.view,"analysis-view-destroy",i=>{i.analysis===this.analysis&&s()}),v(()=>({view:this.view,ready:!!this.view?.ready,supported:this.supported}),({view:i},t)=>{let a=t?.view;i!==a&&(this._userOperationInfo=h(this._userOperationInfo),this._disconnectFromView(a)),this._scheduleViewReconnect()},{sync:!0,initial:!0})])}destroy(){this._reconnectViewTask=h(this._reconnectViewTask),this._userOperationInfo=h(this._userOperationInfo),this.analysisView!=null&&(this.analysisView.visible=void 0),this._disconnectFromView(this.view),this._set("view",null),this._ownsAnalysis&&this.analysis?.destroy()}get defaultMeasurementSystem(){return this.view?.ready?b(this.view):"metric"}get active(){return this._userOperationInfo?.state==="running"}set analysis(s){s!==this._get("analysis")&&(this._userOperationInfo=h(this._userOperationInfo),this._disconnectFromView(this.view),this._setExternalAnalysis(s),this._scheduleViewReconnect())}get connectingToView(){return!!this._reconnectViewTask}get disabled(){return!this.view?.ready||!this.supported}set hideVisualization(s){this._set("hideVisualization",s),this.analysisView&&(this.analysisView.visible=!s)}get ready(){return!!this.analysisView&&!this.connectingToView}get supported(){return!this.view||this.supportedViewType==="both"||this.view.type===this.supportedViewType}get _viewHasAnalysis(){let{view:s}=this;return s?.analyses.includes(this.analysis)===!0}clear(){this._userOperationInfo=h(this._userOperationInfo),this.clearAnalysis()}async start(s){if(this.hideVisualization){c("warn",this,"Cannot start analysis when not visible");return}this.stop(),s?.clear!==!1&&this.clear();let i={task:null,abort:null,state:"pending"},t=y(async a=>{if(i.state="wait-for-view-ready",await F(()=>this.ready,a),i.state="running",!this.analysisView||!this.view)return;this.operationState="active";let r=s?.operation?.({signal:a})??this.place({signal:a});await A(r)});return t.promise.finally(()=>{(this._userOperationInfo===i||!this._userOperationInfo)&&(this.operationState="inactive")}),i.task=t,i.abort=()=>t.abort(),this._userOperationInfo=i,await t.promise}stop(){this._userOperationInfo=h(this._userOperationInfo)}place(s){throw new Error("place() not implemented for this analysis view model")}clearAnalysis(){}onConnectToAnalysisView(s){}onDisconnectFromAnalysisView(){}_scheduleViewReconnect(){this._reconnectViewTask=h(this._reconnectViewTask);let s=y(async i=>{try{await this._reconnectView(i)}catch(t){if(u(i),!_(t)){c("warn",this,`Failed to use analysis in view model. ${String(t)}`);return}throw t}finally{s===this._reconnectViewTask&&(this._reconnectViewTask=void 0)}});this._reconnectViewTask=s}async _reconnectView(s){let{view:i}=this,t=i?.ready&&this.supported,a=this.analysis;if(this._userOperationInfo=V(this._userOperationInfo),this._disconnectFromView(i),!t||!i||!a)return;this._ownsAnalysis&&(this._changeFromReconnect=!0,i.analyses.add(a));let r=await i.whenAnalysisView(a);if(this.analysisView=r,d(s)){this._userOperationInfo=V(this._userOperationInfo);return}r.visible=!this.hideVisualization,this.shouldForceInteractive&&this.addHandles(m(r),w),this.onConnectToAnalysisView(r)}_disconnectFromView(s){this._ownsAnalysis&&s?.analyses.includes(this.analysis)&&(this._changeFromReconnect=!0,this.clearAnalysis(),s.analyses.remove(this.analysis)),this.onDisconnectFromAnalysisView(),this.removeHandles(w),this.analysisView=void 0}_setExternalAnalysis(s){this.analysisView&&!this._ownsAnalysis&&(this.analysisView.visible=void 0,this.removeHandles(w)),this.analysisView=void 0,this._ownsAnalysis=!1,this._set("analysis",s),this._changeFromReconnect=!1}};n([o()],e.prototype,"defaultMeasurementSystem",1);n([o()],e.prototype,"active",1);n([o()],e.prototype,"analysis",1);n([o()],e.prototype,"connectingToView",1);n([o()],e.prototype,"disabled",1);n([o()],e.prototype,"hideVisualization",1);n([o()],e.prototype,"operationState",2);n([o()],e.prototype,"ready",1);n([o()],e.prototype,"supported",1);n([o()],e.prototype,"view",2);n([o()],e.prototype,"_ownsAnalysis",2);n([o()],e.prototype,"_viewHasAnalysis",1);n([o()],e.prototype,"_reconnectViewTask",2);n([o()],e.prototype,"analysisView",2);n([o()],e.prototype,"shouldForceInteractive",2);e=n([g("esri.components.support.AnalysisViewModel")],e);function V(s){return s?.state==="running"?(s.abort(),null):s}return e},"applications/Components/analysisUtils","core/Accessor","core/accessorSupport/decorators","core/promiseUtils","core/reactiveUtils","applications/Components/getDefaultUnits",a)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{a as u}from"./WVGSH2QD.js";import"./5DI7RMZ6.js";import"./Q7SMGP5R.js";import"./QUZTFUWM.js";import"./NCYBFT2Y.js";import{A as h,M as m,N as d,Q as s,T as f,a as n,b as a,w as p}from"./WTBRS6C4.js";import"./H6RQVSYM.js";export default $arcgis.t(([i,{substitute:b}])=>{var g=n`:host{display:inline-block;position:relative;width:fit-content;isolation:isolate}calcite-label:focus-within .swatch-wrapper{outline:var(--calcite-border-width-md) solid var(--calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)));outline-offset:2px}`,l=class extends d{constructor(){super(...arguments),this._messages=u(),this.#t=e=>{this._popoverReferenceElement=e??void 0},this.#e=h(),this._color=new i([0,0,0,1]),this._open=!1,this.arcgisColorChanged=p()}static{this.properties={_color:16,_open:16,_popoverReferenceElement:16,color:1,label:1}}static{this.styles=g}#t;#e
|
|
2
|
+
import{a as u}from"./WVGSH2QD.js";import"./5DI7RMZ6.js";import"./Q7SMGP5R.js";import"./QUZTFUWM.js";import"./NCYBFT2Y.js";import{A as h,M as m,N as d,Q as s,T as f,a as n,b as a,w as p}from"./WTBRS6C4.js";import"./H6RQVSYM.js";export default $arcgis.t(([i,{substitute:b}])=>{var g=n`:host{display:inline-block;position:relative;width:fit-content;isolation:isolate}calcite-label:focus-within .swatch-wrapper{outline:var(--calcite-border-width-md) solid var(--calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)));outline-offset:2px}`,l=class extends d{constructor(){super(...arguments),this._messages=u(),this.#t=e=>{this._popoverReferenceElement=e??void 0},this.#e=h(),this._color=new i([0,0,0,1]),this._open=!1,this.arcgisColorChanged=p()}static{this.properties={_color:16,_open:16,_popoverReferenceElement:16,color:1,label:1}}static{this.styles=g}#t;#e;get color(){return this._color}set color(e){let o=e instanceof i?e:new i(e);o.equals(this._color)||(this._color=o)}#s(e){(e.key===" "||e.key==="Enter")&&this.#o(e)}#o(e){e.preventDefault(),e.stopPropagation(),this._open=!this._open}render(){let e=this._color.toCss(!0),[o,_,$,v]=this._color.toRgba(),r=b(this._messages?.ariaDescription??"",{label:this.label??this._messages?.label??"",color:`${o}, ${_}, ${$}, ${v}`});return a`<calcite-label layout=inline scale=s @click=${this.#o}><div class="swatch-wrapper" tabindex=0 role=button aria-controls=${this.#e??s} aria-expanded=${this._open?"true":"false"} aria-haspopup=dialog aria-label=${r??s} @keydown=${this.#s} @click=${this.#o} ${m(this.#t)}><calcite-swatch .color=${e} .label=${r}></calcite-swatch></div>${this.label??this._messages?.label}${this._popoverReferenceElement?a`<calcite-popover id=${this.#e??s} auto-close class="popover" .label=${this._messages?.popoverLabel??""} .open=${this._open} @calcitePopoverClose=${()=>this._open=!1} @calcitePopoverOpen=${()=>this._open=!0} overlay-positioning=fixed .referenceElement=${this._popoverReferenceElement}><calcite-color-picker alpha-channel channels-disabled @click=${t=>{t.stopPropagation()}} @calciteColorPickerInput=${({target:{value:t}})=>{if(typeof t=="string"){let c=new i(t);this.color=c,this.arcgisColorChanged.emit(c)}}} saved-disabled .value=${e}></calcite-color-picker></calcite-popover>`:void 0}</calcite-label>`}};f("arcgis-color-select",l);return l},"Color","intl")
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import o from"./MZ2KYVWD.js";import n from"./SOOJLVZP.js";import"./JCSG35A7.js";import{a as Q}from"./JCRPP54Z.js";import"./KPOJXBNC.js";import{a as S,b as U,g as G,h as v,j as H,k as q,m as c,n as $}from"./LDDAJOTV.js";import{a as N}from"./QE6XRKDY.js";import{a as m}from"./56KR4KYO.js";import l from"./X4RJMWSU.js";import j from"./MZWO5JYA.js";import i from"./O6F37YLT.js";import"./VJVKFKSG.js";import h from"./AZYY5BTK.js";import{a as O}from"./WVGSH2QD.js";import{a as b}from"./JD74LG7K.js";import{a as k}from"./UYFMNOGK.js";import f from"./ANSNQBZW.js";import e from"./XXA7VSON.js";import{g as B}from"./5DI7RMZ6.js";import"./Q7SMGP5R.js";import a from"./SYDGAFU5.js";import"./QUZTFUWM.js";import{d as P}from"./NCYBFT2Y.js";import{A as M,L as d,M as g,N as R,O as p,Q as _,R as w,T as A,a as C,b as r,w as y}from"./WTBRS6C4.js";import"./H6RQVSYM.js";export default $arcgis.t(([se,L,{on:ae,watch:le},,,{a:x},D,,,,,{a:j,b:z,c:J,d:K}])=>{var u={...Q,section:"section",editing:"editing",editingForm:"editing-form"},re=C`:host{--arcgis-layer-list-visibility-icon: hidden}.editing-form{display:flex;height:100%}.editing{padding-block:var(--calcite-spacing-sm);padding-inline:var(--calcite-spacing-sm)}`,V="nested",oe=".*\\S+.*",W="data-basemap-layer-type",ne=D(se),F=class extends R{constructor(){super(...arguments),this._baseListRef=d(),this._referenceListRef=d(),this._editTitleInputRef=d(),this._layerFlowItemRef=d(),this._panelFlowItemRef=d(),this._rootFlowItemRef=d(),this._editingFlowItemRef=d(),this._lastDragDetail=null,this._selectedDragItemLayerUid=null,this._rootGroupUid=`basemap-${M()}`,this._openedLayersController=null,this._focusRootFlowItem=!1,this._focusPanelFlowItem=!1,this._focusLayerFlowItem=null,this._focusEditingFlowItem=!1,this.messages=O(),this.viewModel=ne(this),this.arcgisClose=k(this),this._canMove=({dragEl:e,fromEl:t,toEl:i},s)=>{let a=s==="pull"?this.listItemCanGiveFunction:this.listItemCanReceiveFunction,o=c(e,this._allItems);if(!o?.sortable)return!1;let l=c(t,this._allItems),n=$(t),h=c(i,this._allItems),f=$(i),I=!!n&&!!f&&n===f,Y={selected:o,from:l,to:h},Z=t.group,ee=i.group,te=l?.layer?.type??"",ie=h?.layer?.type??"",T=new Set(["map-image","catalog","knowledge-graph"]);return Z&&ee&&typeof a=="function"?a(Y):I&&!T.has(te)&&!T.has(ie)&&o.layer?.type!=="sublayer"},this._onTriggerAction=(e,t)=>{this.triggerAction(e,t)},this._onTooltipReferenceChange=(e,t)=>{t?this._tooltipReferenceMap.set(e,t):this._tooltipReferenceMap.delete(e)},this._onTablesOpen=e=>{this.openedLayers.push(e.layer),this._focusLayerFlowItem=e.layer?.uid??null},this._onCatalogOpen=e=>{this.openedLayers.push(e.layer?.parent),this._focusLayerFlowItem=e.layer?.uid??null},this._onPanelOpen=()=>{this._focusPanelFlowItem=!0},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(i=>i.classList?.contains(u.item));this._activeItem=c(t,this._allItems)??null},this._onSelectedDragItemLayerUidChange=e=>{this._selectedDragItemLayerUid=e},this._toggleEditingTitle=()=>{let e=!this.editingTitle;this.editingTitle=e,e?this._focusEditingFlowItem=!0:this._focusRootFlowItem=!0},this._formSubmit=e=>{e.preventDefault();let t=this._editTitleInputRef.value?.value;t?.trim()&&(this.basemapTitle=t),this._toggleEditingTitle()},this._activeItem=null,this._tooltipReferenceMap=new Map,this._layerListMap=new Map,this.openedLayerLists=new L,this.autoDestroyDisabled=!1,this.baseFilterText="",this.baseItemCreatedFunction=this.viewModel.baseItemCreatedFunction,this.basemapTitle=this.viewModel.basemapTitle,this.closed=!1,this.collapsed=!1,this.dragEnabled=!1,this.editingTitle=!1,this.filterPlaceholder="",this.headingLevel=2,this.hideBaseLayers=!1,this.hideCatalogLayerList=!1,this.hideHeading=!1,this.hideNoFilterResultsNotice=!1,this.hideNoItemsNotice=!1,this.hideReferenceLayers=!1,this.hideStatusIndicators=!1,this.icon="layers",this.layerTablesEnabled=new L(["knowledge-graph"]),this.listModeDisabled=this.viewModel.listModeDisabled,this.minFilterItems=U,this.openedLayers=new L,this.referenceFilterText="",this.referenceItemCreatedFunction=this.viewModel.referenceItemCreatedFunction,this.selectedItems=new L,this.selectionMode="none",this.showCloseButton=!1,this.showCollapseButton=!1,this.showEditTitleButton=!1,this.showErrors=!1,this.showFilter=!1,this.showTemporaryLayerIndicators=!1,this.state=this.viewModel.state,this.view=this.viewModel.view,this.visibilityAppearance="default",this.arcgisBaseFilterChange=y(),this.arcgisOpenedLayersChange=y(),this.arcgisPropertyChange=B()("state"),this.arcgisReady=y(),this.arcgisReferenceFilterChange=y(),this.arcgisTriggerAction=x(()=>this.viewModel,"trigger-action")}static{this.properties={_activeItem:16,_catalogLayerList:16,_tableList:16,_tooltipReferenceMap:16,_layerListMap:16,openedLayerLists:16,_allItems:16,_visibleBaseItems:16,_visibleReferenceItems:16,_openedPanelItems:16,_totalBaseItems:16,_totalReferenceItems:16,_baseFilterEnabled:16,_referenceFilterEnabled:16,_renderedOpenLayerFlowItems:16,autoDestroyDisabled:5,baseFilterPredicate:0,baseFilterText:1,baseItemCreatedFunction:0,baseItems:32,basemapTitle:1,catalogLayerList:32,catalogOptions:0,closed:5,collapsed:7,dragEnabled:5,editingTitle:5,filterPlaceholder:1,headingLevel:9,hideBaseLayers:5,hideCatalogLayerList:5,hideHeading:5,hideNoFilterResultsNotice:5,hideNoItemsNotice:5,hideReferenceLayers:5,hideStatusIndicators:5,icon:1,knowledgeGraphOptions:0,label:1,layerTablesEnabled:0,listItemCanGiveFunction:0,listItemCanReceiveFunction:0,listModeDisabled:5,mapImageOptions:0,messageOverrides:0,minFilterItems:9,openedLayers:32,referenceElement:1,referenceFilterPredicate:0,referenceFilterText:1,referenceItems:32,referenceItemCreatedFunction:0,selectedItems:0,selectionMode:1,showCloseButton:5,showCollapseButton:5,showEditTitleButton:5,showErrors:5,showFilter:5,showTemporaryLayerIndicators:5,state:32,tableList:32,tileOptions:0,view:0,visibilityAppearance:1}}static{this.styles=[K,re,J]}get _allItems(){return this.referenceItems.concat(this.baseItems)}get _visibleBaseItems(){return this.baseItems.filter(e=>!e.hidden&&(this.showErrors||!e.error))}get _visibleReferenceItems(){return this.referenceItems.filter(e=>!e.hidden&&(this.showErrors||!e.error))}get _openedPanelItems(){return this._visibleReferenceItems.concat(this._visibleBaseItems).flatten(e=>e.children).filter(({hidden:e,panel:t})=>!e&&t?.open&&!t.disabled&&t.flowEnabled)}get _totalBaseItems(){return this.viewModel.baseItems.flatten(e=>e.children.filter(t=>t.layer?.type!=="catalog-dynamic-group")).length}get _totalReferenceItems(){return this.viewModel.referenceItems.flatten(e=>e.children.filter(t=>t.layer?.type!=="catalog-dynamic-group")).length}get _baseFilterEnabled(){return this._totalBaseItems>=this.minFilterItems&&this.showFilter}get _referenceFilterEnabled(){return this._totalReferenceItems>=this.minFilterItems&&this.showFilter}get _renderedOpenLayerFlowItems(){return this.openedLayers.toArray().map((e,t)=>this._renderLayerFlowItem(e,t===this.openedLayers.length-1))}get baseItems(){return this.viewModel.baseItems}get catalogLayerList(){return this._catalogLayerList}get referenceItems(){return this.viewModel.referenceItems}get tableList(){return this._tableList}async destroy(){await this.manager.destroy(),this._destroyOpenedLayerLists(),this._tooltipReferenceMap.clear()}loaded(){this.manager.onLifecycle(()=>[ae(()=>this.openedLayers,"change",()=>{this._handleOpenedLayersChange()},{initial:!0}),le(()=>[this.viewModel.referenceItems.toArray(),this.viewModel.baseItems.toArray()],()=>G(this.selectedItems),{initial:!0})])}updated(){v(this._baseListRef.value,this.baseFilterPredicate,this.baseItems),v(this._referenceListRef.value,this.referenceFilterPredicate,this.referenceItems)}triggerAction(e,t){this.viewModel.triggerAction(e,t)}async _createFlowList(e,t){let i=this._layerListMap.get(e);if(i)return i;let s=e.type==="catalog"?await this._createCatalogLayerList(e):await this._createTableList(e);return t.aborted||this._layerListMap.set(e,s),s}async _handleOpenedLayersChange(){let{_layerListMap:e,openedLayers:t,openedLayerLists:i}=this;this._openedLayersController?.abort();let s=new AbortController,{signal:a}=s;this._openedLayersController=s,e.forEach((n,h)=>{t.includes(h)||(n?.destroy?.(),e.delete(h))});let o=await Promise.all(t.map(n=>this._createFlowList(n,a)));if(a.aborted)return;i.removeAll(),i.addMany(o);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:s,minFilterItems:a,selectionMode:o,visibilityAppearance:l,layerTablesEnabled:n}=this;return w(r`<arcgis-catalog-layer-list-next .headingLevel=${t} .filterPlaceholder=${i?.filterPlaceholder??s} .listItemCreatedFunction=${i?.listItemCreatedFunction} .minFilterItems=${i?.minFilterItems??a} .selectionMode=${i?.selectionMode??o} .visibilityAppearance=${i?.visibilityAppearance??l} .showErrors=${i?.showErrors??this.showErrors} .showFilter=${i?.showFilter??this.showFilter} .hideStatusIndicators=${i?.hideStatusIndicators??this.hideStatusIndicators} .showTemporaryLayerIndicators=${i?.showTemporaryLayerIndicators??this.showTemporaryLayerIndicators} @arcgisReady=${h=>h.stopPropagation()} .catalogLayer=${e} .layerTablesEnabled=${n} .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 t=this._getTableListParams(e);return w(r`<arcgis-table-list-next .headingLevel=${t?.headingLevel??this.headingLevel} .selectionMode=${t?.selectionMode??this.selectionMode} .dragEnabled=${t?.dragEnabled??this.dragEnabled} .collapsed=${t?.collapsed} .filterPlaceholder=${t?.filterPlaceholder} .filterText=${t?.filterText} .icon=${t?.icon??void 0} .label=${t?.label??void 0} .listItemCreatedFunction=${t?.listItemCreatedFunction} .tables=${t?.tables} .referenceElement=${this.referenceElement} @arcgisReady=${i=>i.stopPropagation()}></arcgis-table-list-next>`)}_handlePanelFlowItemBack(e){e.open=!1,this._focusRootFlowItem=!0}_moveLayerFromChildList({toEl:e,fromEl:t,dragEl:i,newIndex:s}){let a=c(i,this._allItems),o=e.hasAttribute("data-item")?c(e,this._allItems):null,l=t.hasAttribute("data-item")?c(t,this._allItems):null,n=X(t),h=X(e);s==null||!a||!n||!h||(this.viewModel.moveItem({targetItem:a,fromParentItem:l,toParentItem:o,newIndex:s,from:n,to:h}),j(this,a.uid,f=>f.parentElement?.closest("calcite-list")===e))}_handleCalciteListDragEnd(e){let{fromEl:t,toEl:i,dragEl:s,oldIndex:a}=e;if(t!==i){s.remove();return}a==null||!t||!s||t.insertBefore(s,t.children[a])}_onCalciteListOrderChange(e){let{_lastDragDetail:t}=this,{toEl:i,fromEl:s,dragEl:a,newIndex:o}=e,l=t?.newIndex===o&&t?.dragEl===a&&t?.toEl===i&&t?.fromEl===s;if(!s||!i||l)return;this._lastDragDetail=e,this._selectedDragItemLayerUid=a.value.layer?.uid??null;let n=s,h=i;if(n===h){let f=Array.from(s.children).filter(I=>I?.matches("calcite-list-item")).map(I=>I.value.layer?.uid??"");this._sortLayers(n,f);return}this._moveLayerFromChildList({toEl:h,fromEl:n,dragEl:a,newIndex:o})}_sortLayers(e,t){if(e===this._referenceListRef.value||e===this._baseListRef.value){let s=e===this._baseListRef.value?this.view?.map?.basemap?.baseLayers:this.view?.map?.basemap?.referenceLayers;H(s,t);return}let i=c(e,this._allItems);i&&q(i,t)}_handleCalciteListChange(e){if(this.selectionMode==="none")return;let t=e.target.selectedItems.map(i=>c(i,this._allItems)).filter(Boolean);this.selectedItems.removeAll(),this.selectedItems.addMany(t)}_focusFlowItem(e,t){return!t||!e?t:(e.setFocus(),!1)}render(){let e={[b.hidden]:this.state==="loading",[b.disabled]:this.state==="disabled"};return r`<div class=${p(P(b.widget,b.panel,e))}>${this._renderItems()}${this._renderItemTooltips()}</div>`}_renderItemTooltip(e){return e?r`<calcite-tooltip overlay-positioning=fixed .referenceElement=${this._tooltipReferenceMap.get(e.layer?.uid??"")}>${this.messages.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._visibleReferenceItems.concat(this._visibleBaseItems).toArray().map(e=>this._renderItemTooltipNodes(e))}_renderNoLayersInfoMessage(e){return r`<div slot=message>${e}</div>`}_renderNoLayersInfo(e,t){return this.hideNoItemsNotice?null:r`<div class=${p(u.itemMessage)}>${m(t,r`<calcite-notice icon=information kind=info open width=full>${this._renderNoLayersInfoMessage(e)}</calcite-notice>`)}</div>`}_renderEditingInput(){return r`<div class=${p(u.editing)}><calcite-label>${this.messages.basemapTitle}<calcite-input .label=${this.messages.basemapTitle} name=basemaptitle .pattern=${oe} .placeholder=${this.messages.basemapTitle} required title=${this.messages.basemapTitle??_} type=text .value=${this.viewModel.basemapTitle??void 0} ${g(this._editTitleInputRef)}></calcite-input></calcite-label></div>`}_renderEditingForm(){return this.editingTitle?r`<form class=${p(u.editingForm)} @submit=${this._formSubmit}><calcite-flow-item .heading=${this.hideHeading?void 0:this.messages.basemapTitle} .headingLevel=${this.headingLevel} .selected=${!this.openedLayers.length&&!this._openedPanelItems.length} @calciteFlowItemBack=${e=>{e.preventDefault(),this._toggleEditingTitle()}} ${g(this._editingFlowItemRef)}>${this._renderEditingInput()}<calcite-button appearance=outline @click=${this._toggleEditingTitle} slot=footer-actions width=full>${this.messages.cancel}</calcite-button><calcite-button slot=footer-actions type=submit width=full>${this.messages.ok}</calcite-button></calcite-flow-item></form>`:null}_renderEditTitleButton(){return this.showEditTitleButton&&!this.editingTitle?r`<calcite-action icon=pencil @click=${this._toggleEditingTitle} slot=header-actions-end .text=${this.messages.edit??""} title=${this.messages.edit??_}></calcite-action>`:null}_renderItems(){let e=[m("root-flow-item",r`<calcite-flow-item .closable=${this.showCloseButton} .closed=${this.closed} .collapsed=${this.collapsed} .collapsible=${this.showCollapseButton} .heading=${this.hideHeading?void 0:this.viewModel.basemapTitle??this.messages.componentLabel} .headingLevel=${this.headingLevel} .selected=${!this.editingTitle&&!this.openedLayers.length&&!this._openedPanelItems.length} @calciteFlowItemClose=${()=>{this.closed=!0}} ${g(this._rootFlowItemRef)}>${this._renderEditTitleButton()}${this._renderReferenceSection()}${this._renderBaseSection()}</calcite-flow-item>`),this._renderEditingForm(),this._renderPanelFlowItems(),this._renderedOpenLayerFlowItems];return this._focusRootFlowItem=this._focusFlowItem(this._rootFlowItemRef.value,this._focusRootFlowItem),this._focusEditingFlowItem=this._focusFlowItem(this._editingFlowItemRef.value,this._focusEditingFlowItem),this.closed?null:m("root-flow",r`<calcite-flow>${e}</calcite-flow>`)}_renderPanelFlowItems(){return N(this._openedPanelItems.toArray(),e=>e.uid,(e,t)=>{let{panel:i,title:s}=e,a=()=>this._handlePanelFlowItemBack(i);return this._focusPanelFlowItem=this._focusFlowItem(this._panelFlowItemRef.value,this._focusPanelFlowItem),r`<calcite-flow-item .description=${s} .heading=${i.title} .headingLevel=${this.headingLevel} .selected=${!this.openedLayers.length&&t===this._openedPanelItems.length-1} @calciteFlowItemBack=${o=>{o.preventDefault(),a()}} ${g(this._panelFlowItemRef)}><arcgis-layer-list-item-panel .item=${e} .view=${this.view}></arcgis-layer-list-item-panel><calcite-button appearance=transparent @click=${a} slot=footer-actions width=full>${this.messages.back}</calcite-button></calcite-flow-item>`})}_renderLayerFlowItem(e,t){let i=e.title||this.messages.untitledLayer;return this._focusLayerFlowItem===e.uid&&(this._focusLayerFlowItem=this._focusFlowItem(this._layerFlowItemRef.value,!0)?e.uid:null),m(e.uid,r`<calcite-flow-item data-layer-uid=${e.uid??_} .description=${i} .heading=${this.messages[e.type==="catalog"?"catalogLayers":"tables"]} .headingLevel=${this.headingLevel} .selected=${t} @calciteFlowItemBack=${s=>{s.preventDefault(),this.openedLayers.pop();let a=this.openedLayers.at(-1);a?this._focusLayerFlowItem=a.uid:this._focusRootFlowItem=!0}} ${g(this._layerFlowItemRef)}>${this._layerListMap.get(e)}</calcite-flow-item>`)}_renderList(e,t,i){let s=t==="reference"?this._referenceFilterEnabled:this._baseFilterEnabled,a=t==="reference"?this.referenceFilterText:this.baseFilterText,o=(t==="reference"?this.messages.noReferenceLayers:this.messages.noBaseLayers)??this.messages.noItemsToDisplay??"";return m(`block-${t}`,r`<calcite-block class=${p(u.section)} collapsible expanded .heading=${t==="reference"?this.messages.referenceHeading:this.messages.baseHeading} .headingLevel=${this.headingLevel+1}>${e?.length?null:this._renderNoLayersInfo(o,t)}${m(`list-${t}`,r`<calcite-list @focusin=${this._setActiveItem} @focusout=${this._clearActiveItem} .canPull=${l=>this._canMove(l,"pull")} .canPut=${l=>this._canMove(l,"put")} data-basemap-layer-type=${t??_} data-layer-type=${this._rootGroupUid??_} .displayMode=${V} .dragEnabled=${this.dragEnabled} .filterEnabled=${s} .filterPlaceholder=${this.filterPlaceholder} .filterProps=${S} .filterText=${s?a:""} .group=${this._rootGroupUid} .label=${this.messages.componentLabel??""} @mouseleave=${this._clearActiveItem} @mouseover=${this._setActiveItem} selection-appearance=border .selectionMode=${this.selectionMode} @calciteListChange=${this._handleCalciteListChange} @calciteListDragEnd=${l=>this._handleCalciteListDragEnd(l.detail)} @calciteListFilter=${l=>{let n=l.currentTarget?.filterText??"";this[t==="reference"?"referenceFilterText":"baseFilterText"]=n,t==="base"?this.arcgisBaseFilterChange.emit():this.arcgisReferenceFilterChange.emit()}} @calciteListOrderChange=${l=>this._onCalciteListOrderChange(l.detail)} ${g(t==="reference"?this._referenceListRef:this._baseListRef)}>${e?.toArray().map(l=>this._renderItem(l,i))}${s&&!this.hideNoFilterResultsNotice?r`<div class=${p(u.filterNoResults)} slot=filter-no-results><calcite-notice kind=info open width=full>${this._renderNoLayersInfoMessage(o)}</calcite-notice></div>`:null}</calcite-list>`)}</calcite-block>`)}_renderBaseSection(){return this.hideBaseLayers?null:this._renderList(this._visibleBaseItems,"base",this._visibleBaseItems.length===1)}_renderReferenceSection(){return this.hideReferenceLayers?null:this._renderList(this._visibleReferenceItems,"reference",!1)}_renderItem(e,t,i,s){return m(e.uid,z({activeItem:this._activeItem,canMove:this._canMove,css:u,displayMode:V,dragEnabled:this.dragEnabled&&!t,hideCatalogLayerList:this.hideCatalogLayerList,hideStatusIndicators:this.hideStatusIndicators,item:e,layerTablesEnabled:this.layerTablesEnabled,listModeDisabled:this.viewModel.listModeDisabled,messages:this.messages,operationalItems:this._allItems,parent:i,parentTitles:s,rootGroupUid:this._rootGroupUid,selectedDragItemLayerUid:this._selectedDragItemLayerUid,selectedItems:this.selectedItems,selectionMode:this.selectionMode,setCurrentActiveItem:this._setCurrentActiveItem,clearActiveItem:this._clearActiveItem,showErrors:this.showErrors,showTemporaryLayerIndicators:this.showTemporaryLayerIndicators,visibilityAppearance:this.visibilityAppearance,handleAction:this._onTriggerAction,handleCatalogOpen:this._onCatalogOpen,handlePanelOpen:this._onPanelOpen,handleSelectedDragItemLayerUidChange:this._onSelectedDragItemLayerUidChange,handleTablesOpen:this._onTablesOpen,handleTooltipReferenceChange:this._onTooltipReferenceChange,view:this.view}))}};function X(E){let e=E.closest(`[${W}]`)?.getAttribute(W);return e==="base"||e==="reference"?e:null}A("arcgis-basemap-layer-list-next",F);return F},"layers/list/BasemapItemCollection","core/Collection","core/reactiveUtils",a,e,f,h,i,j,l,n,o)
|
|
2
|
+
import o from"./J3743ZYD.js";import n from"./73N362E5.js";import"./JCSG35A7.js";import{a as Q}from"./JCRPP54Z.js";import"./KPOJXBNC.js";import{a as S,b as U,g as G,h as v,j as H,k as q,m as c,n as $}from"./LDDAJOTV.js";import{a as N}from"./QE6XRKDY.js";import{a as m}from"./56KR4KYO.js";import l from"./X4RJMWSU.js";import j from"./MZWO5JYA.js";import i from"./HAUHWMHN.js";import"./VJVKFKSG.js";import h from"./AZYY5BTK.js";import{a as O}from"./WVGSH2QD.js";import{a as b}from"./JD74LG7K.js";import{a as k}from"./UYFMNOGK.js";import f from"./ANSNQBZW.js";import e from"./XXA7VSON.js";import{g as B}from"./5DI7RMZ6.js";import"./Q7SMGP5R.js";import a from"./SYDGAFU5.js";import"./QUZTFUWM.js";import{d as P}from"./NCYBFT2Y.js";import{A as M,L as d,M as g,N as R,O as p,Q as _,R as w,T as A,a as C,b as r,w as y}from"./WTBRS6C4.js";import"./H6RQVSYM.js";export default $arcgis.t(([se,L,{on:ae,watch:le},,,{a:x},D,,,,,{a:j,b:z,c:J,d:K}])=>{var u={...Q,section:"section",editing:"editing",editingForm:"editing-form"},re=C`:host{--arcgis-layer-list-visibility-icon: hidden}.editing-form{display:flex;height:100%}.editing{padding-block:var(--calcite-spacing-sm);padding-inline:var(--calcite-spacing-sm)}`,V="nested",oe=".*\\S+.*",W="data-basemap-layer-type",ne=D(se),F=class extends R{constructor(){super(...arguments),this._baseListRef=d(),this._referenceListRef=d(),this._editTitleInputRef=d(),this._layerFlowItemRef=d(),this._panelFlowItemRef=d(),this._rootFlowItemRef=d(),this._editingFlowItemRef=d(),this._lastDragDetail=null,this._selectedDragItemLayerUid=null,this._rootGroupUid=`basemap-${M()}`,this._openedLayersController=null,this._focusRootFlowItem=!1,this._focusPanelFlowItem=!1,this._focusLayerFlowItem=null,this._focusEditingFlowItem=!1,this.messages=O(),this.viewModel=ne(this),this.arcgisClose=k(this),this._canMove=({dragEl:e,fromEl:t,toEl:i},s)=>{let a=s==="pull"?this.listItemCanGiveFunction:this.listItemCanReceiveFunction,o=c(e,this._allItems);if(!o?.sortable)return!1;let l=c(t,this._allItems),n=$(t),h=c(i,this._allItems),f=$(i),I=!!n&&!!f&&n===f,Y={selected:o,from:l,to:h},Z=t.group,ee=i.group,te=l?.layer?.type??"",ie=h?.layer?.type??"",T=new Set(["map-image","catalog","knowledge-graph"]);return Z&&ee&&typeof a=="function"?a(Y):I&&!T.has(te)&&!T.has(ie)&&o.layer?.type!=="sublayer"},this._onTriggerAction=(e,t)=>{this.triggerAction(e,t)},this._onTooltipReferenceChange=(e,t)=>{t?this._tooltipReferenceMap.set(e,t):this._tooltipReferenceMap.delete(e)},this._onTablesOpen=e=>{this.openedLayers.push(e.layer),this._focusLayerFlowItem=e.layer?.uid??null},this._onCatalogOpen=e=>{this.openedLayers.push(e.layer?.parent),this._focusLayerFlowItem=e.layer?.uid??null},this._onPanelOpen=()=>{this._focusPanelFlowItem=!0},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(i=>i.classList?.contains(u.item));this._activeItem=c(t,this._allItems)??null},this._onSelectedDragItemLayerUidChange=e=>{this._selectedDragItemLayerUid=e},this._toggleEditingTitle=()=>{let e=!this.editingTitle;this.editingTitle=e,e?this._focusEditingFlowItem=!0:this._focusRootFlowItem=!0},this._formSubmit=e=>{e.preventDefault();let t=this._editTitleInputRef.value?.value;t?.trim()&&(this.basemapTitle=t),this._toggleEditingTitle()},this._activeItem=null,this._tooltipReferenceMap=new Map,this._layerListMap=new Map,this.openedLayerLists=new L,this.autoDestroyDisabled=!1,this.baseFilterText="",this.baseItemCreatedFunction=this.viewModel.baseItemCreatedFunction,this.basemapTitle=this.viewModel.basemapTitle,this.closed=!1,this.collapsed=!1,this.dragEnabled=!1,this.editingTitle=!1,this.filterPlaceholder="",this.headingLevel=2,this.hideBaseLayers=!1,this.hideCatalogLayerList=!1,this.hideHeading=!1,this.hideNoFilterResultsNotice=!1,this.hideNoItemsNotice=!1,this.hideReferenceLayers=!1,this.hideStatusIndicators=!1,this.icon="layers",this.layerTablesEnabled=new L(["knowledge-graph"]),this.listModeDisabled=this.viewModel.listModeDisabled,this.minFilterItems=U,this.openedLayers=new L,this.referenceFilterText="",this.referenceItemCreatedFunction=this.viewModel.referenceItemCreatedFunction,this.selectedItems=new L,this.selectionMode="none",this.showCloseButton=!1,this.showCollapseButton=!1,this.showEditTitleButton=!1,this.showErrors=!1,this.showFilter=!1,this.showTemporaryLayerIndicators=!1,this.state=this.viewModel.state,this.view=this.viewModel.view,this.visibilityAppearance="default",this.arcgisBaseFilterChange=y(),this.arcgisOpenedLayersChange=y(),this.arcgisPropertyChange=B()("state"),this.arcgisReady=y(),this.arcgisReferenceFilterChange=y(),this.arcgisTriggerAction=x(()=>this.viewModel,"trigger-action")}static{this.properties={_activeItem:16,_catalogLayerList:16,_tableList:16,_tooltipReferenceMap:16,_layerListMap:16,openedLayerLists:16,_allItems:16,_visibleBaseItems:16,_visibleReferenceItems:16,_openedPanelItems:16,_totalBaseItems:16,_totalReferenceItems:16,_baseFilterEnabled:16,_referenceFilterEnabled:16,_renderedOpenLayerFlowItems:16,autoDestroyDisabled:5,baseFilterPredicate:0,baseFilterText:1,baseItemCreatedFunction:0,baseItems:32,basemapTitle:1,catalogLayerList:32,catalogOptions:0,closed:5,collapsed:7,dragEnabled:5,editingTitle:5,filterPlaceholder:1,headingLevel:9,hideBaseLayers:5,hideCatalogLayerList:5,hideHeading:5,hideNoFilterResultsNotice:5,hideNoItemsNotice:5,hideReferenceLayers:5,hideStatusIndicators:5,icon:1,knowledgeGraphOptions:0,label:1,layerTablesEnabled:0,listItemCanGiveFunction:0,listItemCanReceiveFunction:0,listModeDisabled:5,mapImageOptions:0,messageOverrides:0,minFilterItems:9,openedLayers:32,referenceElement:1,referenceFilterPredicate:0,referenceFilterText:1,referenceItems:32,referenceItemCreatedFunction:0,selectedItems:0,selectionMode:1,showCloseButton:5,showCollapseButton:5,showEditTitleButton:5,showErrors:5,showFilter:5,showTemporaryLayerIndicators:5,state:32,tableList:32,tileOptions:0,view:0,visibilityAppearance:1}}static{this.styles=[K,re,J]}get _allItems(){return this.referenceItems.concat(this.baseItems)}get _visibleBaseItems(){return this.baseItems.filter(e=>!e.hidden&&(this.showErrors||!e.error))}get _visibleReferenceItems(){return this.referenceItems.filter(e=>!e.hidden&&(this.showErrors||!e.error))}get _openedPanelItems(){return this._visibleReferenceItems.concat(this._visibleBaseItems).flatten(e=>e.children).filter(({hidden:e,panel:t})=>!e&&t?.open&&!t.disabled&&t.flowEnabled)}get _totalBaseItems(){return this.viewModel.baseItems.flatten(e=>e.children.filter(t=>t.layer?.type!=="catalog-dynamic-group")).length}get _totalReferenceItems(){return this.viewModel.referenceItems.flatten(e=>e.children.filter(t=>t.layer?.type!=="catalog-dynamic-group")).length}get _baseFilterEnabled(){return this._totalBaseItems>=this.minFilterItems&&this.showFilter}get _referenceFilterEnabled(){return this._totalReferenceItems>=this.minFilterItems&&this.showFilter}get _renderedOpenLayerFlowItems(){return this.openedLayers.toArray().map((e,t)=>this._renderLayerFlowItem(e,t===this.openedLayers.length-1))}get baseItems(){return this.viewModel.baseItems}get catalogLayerList(){return this._catalogLayerList}get referenceItems(){return this.viewModel.referenceItems}get tableList(){return this._tableList}async destroy(){await this.manager.destroy(),this._destroyOpenedLayerLists(),this._tooltipReferenceMap.clear()}loaded(){this.manager.onLifecycle(()=>[ae(()=>this.openedLayers,"change",()=>{this._handleOpenedLayersChange()},{initial:!0}),le(()=>[this.viewModel.referenceItems.toArray(),this.viewModel.baseItems.toArray()],()=>G(this.selectedItems),{initial:!0})])}updated(){v(this._baseListRef.value,this.baseFilterPredicate,this.baseItems),v(this._referenceListRef.value,this.referenceFilterPredicate,this.referenceItems)}triggerAction(e,t){this.viewModel.triggerAction(e,t)}async _createFlowList(e,t){let i=this._layerListMap.get(e);if(i)return i;let s=e.type==="catalog"?await this._createCatalogLayerList(e):await this._createTableList(e);return t.aborted||this._layerListMap.set(e,s),s}async _handleOpenedLayersChange(){let{_layerListMap:e,openedLayers:t,openedLayerLists:i}=this;this._openedLayersController?.abort();let s=new AbortController,{signal:a}=s;this._openedLayersController=s,e.forEach((n,h)=>{t.includes(h)||(n?.destroy?.(),e.delete(h))});let o=await Promise.all(t.map(n=>this._createFlowList(n,a)));if(a.aborted)return;i.removeAll(),i.addMany(o);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:s,minFilterItems:a,selectionMode:o,visibilityAppearance:l,layerTablesEnabled:n}=this;return w(r`<arcgis-catalog-layer-list-next .headingLevel=${t} .filterPlaceholder=${i?.filterPlaceholder??s} .listItemCreatedFunction=${i?.listItemCreatedFunction} .minFilterItems=${i?.minFilterItems??a} .selectionMode=${i?.selectionMode??o} .visibilityAppearance=${i?.visibilityAppearance??l} .showErrors=${i?.showErrors??this.showErrors} .showFilter=${i?.showFilter??this.showFilter} .hideStatusIndicators=${i?.hideStatusIndicators??this.hideStatusIndicators} .showTemporaryLayerIndicators=${i?.showTemporaryLayerIndicators??this.showTemporaryLayerIndicators} @arcgisReady=${h=>h.stopPropagation()} .catalogLayer=${e} .layerTablesEnabled=${n} .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 t=this._getTableListParams(e);return w(r`<arcgis-table-list-next .headingLevel=${t?.headingLevel??this.headingLevel} .selectionMode=${t?.selectionMode??this.selectionMode} .dragEnabled=${t?.dragEnabled??this.dragEnabled} .collapsed=${t?.collapsed} .filterPlaceholder=${t?.filterPlaceholder} .filterText=${t?.filterText} .icon=${t?.icon??void 0} .label=${t?.label??void 0} .listItemCreatedFunction=${t?.listItemCreatedFunction} .tables=${t?.tables} .referenceElement=${this.referenceElement} @arcgisReady=${i=>i.stopPropagation()}></arcgis-table-list-next>`)}_handlePanelFlowItemBack(e){e.open=!1,this._focusRootFlowItem=!0}_moveLayerFromChildList({toEl:e,fromEl:t,dragEl:i,newIndex:s}){let a=c(i,this._allItems),o=e.hasAttribute("data-item")?c(e,this._allItems):null,l=t.hasAttribute("data-item")?c(t,this._allItems):null,n=X(t),h=X(e);s==null||!a||!n||!h||(this.viewModel.moveItem({targetItem:a,fromParentItem:l,toParentItem:o,newIndex:s,from:n,to:h}),j(this,a.uid,f=>f.parentElement?.closest("calcite-list")===e))}_handleCalciteListDragEnd(e){let{fromEl:t,toEl:i,dragEl:s,oldIndex:a}=e;if(t!==i){s.remove();return}a==null||!t||!s||t.insertBefore(s,t.children[a])}_onCalciteListOrderChange(e){let{_lastDragDetail:t}=this,{toEl:i,fromEl:s,dragEl:a,newIndex:o}=e,l=t?.newIndex===o&&t?.dragEl===a&&t?.toEl===i&&t?.fromEl===s;if(!s||!i||l)return;this._lastDragDetail=e,this._selectedDragItemLayerUid=a.value.layer?.uid??null;let n=s,h=i;if(n===h){let f=Array.from(s.children).filter(I=>I?.matches("calcite-list-item")).map(I=>I.value.layer?.uid??"");this._sortLayers(n,f);return}this._moveLayerFromChildList({toEl:h,fromEl:n,dragEl:a,newIndex:o})}_sortLayers(e,t){if(e===this._referenceListRef.value||e===this._baseListRef.value){let s=e===this._baseListRef.value?this.view?.map?.basemap?.baseLayers:this.view?.map?.basemap?.referenceLayers;H(s,t);return}let i=c(e,this._allItems);i&&q(i,t)}_handleCalciteListChange(e){if(this.selectionMode==="none")return;let t=e.target.selectedItems.map(i=>c(i,this._allItems)).filter(Boolean);this.selectedItems.removeAll(),this.selectedItems.addMany(t)}_focusFlowItem(e,t){return!t||!e?t:(e.setFocus(),!1)}render(){let e={[b.hidden]:this.state==="loading",[b.disabled]:this.state==="disabled"};return r`<div class=${p(P(b.widget,b.panel,e))}>${this._renderItems()}${this._renderItemTooltips()}</div>`}_renderItemTooltip(e){return e?r`<calcite-tooltip overlay-positioning=fixed .referenceElement=${this._tooltipReferenceMap.get(e.layer?.uid??"")}>${this.messages.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._visibleReferenceItems.concat(this._visibleBaseItems).toArray().map(e=>this._renderItemTooltipNodes(e))}_renderNoLayersInfoMessage(e){return r`<div slot=message>${e}</div>`}_renderNoLayersInfo(e,t){return this.hideNoItemsNotice?null:r`<div class=${p(u.itemMessage)}>${m(t,r`<calcite-notice icon=information kind=info open width=full>${this._renderNoLayersInfoMessage(e)}</calcite-notice>`)}</div>`}_renderEditingInput(){return r`<div class=${p(u.editing)}><calcite-label>${this.messages.basemapTitle}<calcite-input .label=${this.messages.basemapTitle} name=basemaptitle .pattern=${oe} .placeholder=${this.messages.basemapTitle} required title=${this.messages.basemapTitle??_} type=text .value=${this.viewModel.basemapTitle??void 0} ${g(this._editTitleInputRef)}></calcite-input></calcite-label></div>`}_renderEditingForm(){return this.editingTitle?r`<form class=${p(u.editingForm)} @submit=${this._formSubmit}><calcite-flow-item .heading=${this.hideHeading?void 0:this.messages.basemapTitle} .headingLevel=${this.headingLevel} .selected=${!this.openedLayers.length&&!this._openedPanelItems.length} @calciteFlowItemBack=${e=>{e.preventDefault(),this._toggleEditingTitle()}} ${g(this._editingFlowItemRef)}>${this._renderEditingInput()}<calcite-button appearance=outline @click=${this._toggleEditingTitle} slot=footer-actions width=full>${this.messages.cancel}</calcite-button><calcite-button slot=footer-actions type=submit width=full>${this.messages.ok}</calcite-button></calcite-flow-item></form>`:null}_renderEditTitleButton(){return this.showEditTitleButton&&!this.editingTitle?r`<calcite-action icon=pencil @click=${this._toggleEditingTitle} slot=header-actions-end .text=${this.messages.edit??""} title=${this.messages.edit??_}></calcite-action>`:null}_renderItems(){let e=[m("root-flow-item",r`<calcite-flow-item .closable=${this.showCloseButton} .closed=${this.closed} .collapsed=${this.collapsed} .collapsible=${this.showCollapseButton} .heading=${this.hideHeading?void 0:this.viewModel.basemapTitle??this.messages.componentLabel} .headingLevel=${this.headingLevel} .selected=${!this.editingTitle&&!this.openedLayers.length&&!this._openedPanelItems.length} @calciteFlowItemClose=${()=>{this.closed=!0}} ${g(this._rootFlowItemRef)}>${this._renderEditTitleButton()}${this._renderReferenceSection()}${this._renderBaseSection()}</calcite-flow-item>`),this._renderEditingForm(),this._renderPanelFlowItems(),this._renderedOpenLayerFlowItems];return this._focusRootFlowItem=this._focusFlowItem(this._rootFlowItemRef.value,this._focusRootFlowItem),this._focusEditingFlowItem=this._focusFlowItem(this._editingFlowItemRef.value,this._focusEditingFlowItem),this.closed?null:m("root-flow",r`<calcite-flow>${e}</calcite-flow>`)}_renderPanelFlowItems(){return N(this._openedPanelItems.toArray(),e=>e.uid,(e,t)=>{let{panel:i,title:s}=e,a=()=>this._handlePanelFlowItemBack(i);return this._focusPanelFlowItem=this._focusFlowItem(this._panelFlowItemRef.value,this._focusPanelFlowItem),r`<calcite-flow-item .description=${s} .heading=${i.title} .headingLevel=${this.headingLevel} .selected=${!this.openedLayers.length&&t===this._openedPanelItems.length-1} @calciteFlowItemBack=${o=>{o.preventDefault(),a()}} ${g(this._panelFlowItemRef)}><arcgis-layer-list-item-panel .item=${e} .view=${this.view}></arcgis-layer-list-item-panel><calcite-button appearance=transparent @click=${a} slot=footer-actions width=full>${this.messages.back}</calcite-button></calcite-flow-item>`})}_renderLayerFlowItem(e,t){let i=e.title||this.messages.untitledLayer;return this._focusLayerFlowItem===e.uid&&(this._focusLayerFlowItem=this._focusFlowItem(this._layerFlowItemRef.value,!0)?e.uid:null),m(e.uid,r`<calcite-flow-item data-layer-uid=${e.uid??_} .description=${i} .heading=${this.messages[e.type==="catalog"?"catalogLayers":"tables"]} .headingLevel=${this.headingLevel} .selected=${t} @calciteFlowItemBack=${s=>{s.preventDefault(),this.openedLayers.pop();let a=this.openedLayers.at(-1);a?this._focusLayerFlowItem=a.uid:this._focusRootFlowItem=!0}} ${g(this._layerFlowItemRef)}>${this._layerListMap.get(e)}</calcite-flow-item>`)}_renderList(e,t,i){let s=t==="reference"?this._referenceFilterEnabled:this._baseFilterEnabled,a=t==="reference"?this.referenceFilterText:this.baseFilterText,o=(t==="reference"?this.messages.noReferenceLayers:this.messages.noBaseLayers)??this.messages.noItemsToDisplay??"";return m(`block-${t}`,r`<calcite-block class=${p(u.section)} collapsible expanded .heading=${t==="reference"?this.messages.referenceHeading:this.messages.baseHeading} .headingLevel=${this.headingLevel+1}>${e?.length?null:this._renderNoLayersInfo(o,t)}${m(`list-${t}`,r`<calcite-list @focusin=${this._setActiveItem} @focusout=${this._clearActiveItem} .canPull=${l=>this._canMove(l,"pull")} .canPut=${l=>this._canMove(l,"put")} data-basemap-layer-type=${t??_} data-layer-type=${this._rootGroupUid??_} .displayMode=${V} .dragEnabled=${this.dragEnabled} .filterEnabled=${s} .filterPlaceholder=${this.filterPlaceholder} .filterProps=${S} .filterText=${s?a:""} .group=${this._rootGroupUid} .label=${this.messages.componentLabel??""} @mouseleave=${this._clearActiveItem} @mouseover=${this._setActiveItem} selection-appearance=border .selectionMode=${this.selectionMode} @calciteListChange=${this._handleCalciteListChange} @calciteListDragEnd=${l=>this._handleCalciteListDragEnd(l.detail)} @calciteListFilter=${l=>{let n=l.currentTarget?.filterText??"";this[t==="reference"?"referenceFilterText":"baseFilterText"]=n,t==="base"?this.arcgisBaseFilterChange.emit():this.arcgisReferenceFilterChange.emit()}} @calciteListOrderChange=${l=>this._onCalciteListOrderChange(l.detail)} ${g(t==="reference"?this._referenceListRef:this._baseListRef)}>${e?.toArray().map(l=>this._renderItem(l,i))}${s&&!this.hideNoFilterResultsNotice?r`<div class=${p(u.filterNoResults)} slot=filter-no-results><calcite-notice kind=info open width=full>${this._renderNoLayersInfoMessage(o)}</calcite-notice></div>`:null}</calcite-list>`)}</calcite-block>`)}_renderBaseSection(){return this.hideBaseLayers?null:this._renderList(this._visibleBaseItems,"base",this._visibleBaseItems.length===1)}_renderReferenceSection(){return this.hideReferenceLayers?null:this._renderList(this._visibleReferenceItems,"reference",!1)}_renderItem(e,t,i,s){return m(e.uid,z({activeItem:this._activeItem,canMove:this._canMove,css:u,displayMode:V,dragEnabled:this.dragEnabled&&!t,hideCatalogLayerList:this.hideCatalogLayerList,hideStatusIndicators:this.hideStatusIndicators,item:e,layerTablesEnabled:this.layerTablesEnabled,listModeDisabled:this.viewModel.listModeDisabled,messages:this.messages,operationalItems:this._allItems,parent:i,parentTitles:s,rootGroupUid:this._rootGroupUid,selectedDragItemLayerUid:this._selectedDragItemLayerUid,selectedItems:this.selectedItems,selectionMode:this.selectionMode,setCurrentActiveItem:this._setCurrentActiveItem,clearActiveItem:this._clearActiveItem,showErrors:this.showErrors,showTemporaryLayerIndicators:this.showTemporaryLayerIndicators,visibilityAppearance:this.visibilityAppearance,handleAction:this._onTriggerAction,handleCatalogOpen:this._onCatalogOpen,handlePanelOpen:this._onPanelOpen,handleSelectedDragItemLayerUidChange:this._onSelectedDragItemLayerUidChange,handleTablesOpen:this._onTablesOpen,handleTooltipReferenceChange:this._onTooltipReferenceChange,view:this.view}))}};function X(E){let e=E.closest(`[${W}]`)?.getAttribute(W);return e==="base"||e==="reference"?e:null}A("arcgis-basemap-layer-list-next",F);return F},"layers/list/BasemapItemCollection","core/Collection","core/reactiveUtils",a,e,f,h,i,j,l,n,o)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import o from"./MZ2KYVWD.js";import n from"./SOOJLVZP.js";import"./JCSG35A7.js";import{a as g}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,n as F}from"./LDDAJOTV.js";import{a as G}from"./QE6XRKDY.js";import{a as b}from"./56KR4KYO.js";import l from"./X4RJMWSU.js";import k from"./MZWO5JYA.js";import i from"./O6F37YLT.js";import"./VJVKFKSG.js";import h from"./AZYY5BTK.js";import{a as B}from"./WVGSH2QD.js";import{a as w}from"./JD74LG7K.js";import{a as S}from"./UYFMNOGK.js";import e from"./ANSNQBZW.js";import c from"./XXA7VSON.js";import{g as N}from"./5DI7RMZ6.js";import"./Q7SMGP5R.js";import a from"./SYDGAFU5.js";import"./QUZTFUWM.js";import{d as x}from"./NCYBFT2Y.js";import{A as D,L,M as f,N as P,O as v,Q as E,R as M,T as R,b as d,w as p}from"./WTBRS6C4.js";import"./H6RQVSYM.js";export default $arcgis.t(([ie,u,{on:T,watch:se},,,{a:k},U,,,,,{a:V,b:W,c:X,d:Y}])=>{var Z="nested",ae=U(ie),A=class extends P{constructor(){super(...arguments),this._lastDragDetail=null,this._rootListRef=L(),this._layerFlowItemRef=L(),this._panelFlowItemRef=L(),this._selectedDragItemLayerUid=null,this._rootGroupUid=`operational-${D()}`,this._openedLayersController=null,this.messages=B(),this._canMove=({dragEl:e,fromEl:t,toEl:i},a)=>{let s=a==="pull"?this.listItemCanGiveFunction:this.listItemCanReceiveFunction,r=m(e,this.operationalItems);if(!r?.sortable)return!1;let l=this._resolveListContainer(t),o=this._resolveListContainer(i),n=this._getContainerItem(l),c=F(l),y=this._getContainerItem(o),_=F(o),$=!!c&&!!_&&c===_,I={selected:r,from:n,to:y},C=l?.group,h=o?.group,ee=n?.layer?.type??"",te=y?.layer?.type??"",O=new Set(["map-image","catalog","knowledge-graph"]);return C&&h&&typeof s=="function"?s(I):$&&!O.has(ee)&&!O.has(te)&&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(g.item)),i=m(t,this.operationalItems);this._activeItem=i},this.viewModel=ae(this),this.arcgisClose=S(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 u(["knowledge-graph"]),this.mapImageOptions=null,this.openedLayerLists=new u,this.tileOptions=null,this.autoDestroyDisabled=!1,this.closed=!1,this.collapsed=!1,this.dragEnabled=!1,this.filterPlaceholder="",this.filterText="",this.headingLevel=2,this.hideCatalogLayerList=!1,this.hideNoFilterResultsNotice=!1,this.hideNoItemsNotice=!1,this.hideStatusIndicators=!1,this.icon="layers",this.layerTablesAvailable=new u(["knowledge-graph"]),this.listItemCreatedFunction=this.viewModel.listItemCreatedFunction,this.listModeDisabled=this.viewModel.listModeDisabled,this.minDragEnabledItems=q,this.minFilterItems=j,this.openedLayers=new u,this.operationalItems=this.viewModel.operationalItems,this.selectedItems=new u,this.selectionMode="none",this.showCloseButton=!1,this.showCollapseButton=!1,this.showErrors=!1,this.showFilter=!1,this.showHeading=!1,this.showTemporaryLayerIndicators=!1,this.state=this.viewModel.state,this.view=this.viewModel.view,this.visibilityAppearance="default",this.arcgisFilterChange=p(),this.arcgisOpenedLayersChange=p(),this.arcgisPropertyChange=N()("state"),this.arcgisReady=p(),this.arcgisSelectedItemsChange=p(),this.arcgisTriggerAction=k(()=>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,autoDestroyDisabled:5,catalogLayerList:32,catalogOptions:0,closed:5,collapsed:5,dragEnabled:5,filterPlaceholder:1,filterPredicate:0,filterText:1,headingLevel:9,hideCatalogLayerList:5,hideNoFilterResultsNotice:5,hideNoItemsNotice:5,hideStatusIndicators:5,icon:1,knowledgeGraphOptions:0,label:1,layerTablesAvailable:0,listItemCanGiveFunction:0,listItemCanReceiveFunction:0,listItemCreatedFunction:0,listModeDisabled:5,messageOverrides:0,minDragEnabledItems:9,minFilterItems:9,openedLayers:32,operationalItems:0,referenceElement:1,selectedItems:0,selectionMode:1,showCloseButton:5,showCollapseButton:5,showErrors:5,showFilter:5,showHeading:5,showTemporaryLayerIndicators:5,state:32,tableList:32,view:0,visibilityAppearance:1}}static{this.styles=[Y,X]}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(()=>[T(()=>this.openedLayers,"change",()=>{this._handleOpenedLayersChange()},{initial:!0}),T(()=>this.viewModel.operationalItems,"change",()=>z(this.selectedItems),{initial:!0}),T(()=>this.selectedItems,"change",()=>this.arcgisSelectedItemsChange.emit()),se(()=>[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?.showErrors??this.showErrors} .showFilter=${i?.showFilter??this.showFilter} .hideStatusIndicators=${i?.hideStatusIndicators??this.hideStatusIndicators} .showTemporaryLayerIndicators=${i?.showTemporaryLayerIndicators??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=m(i,this.operationalItems),o=this._getContainerItem(s),n=this._getContainerItem(r);a==null||!l||(this.viewModel.moveItem(l,n,o,a),V(this,l.uid,c=>this._resolveListContainer(c.parentElement)===s))}_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=m(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=>m(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 this.hideNoItemsNotice?null:d`<div class=${v(g.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:c,filterText:y,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=${Z} .dragEnabled=${n} .filterEnabled=${a} .filterPlaceholder=${$} .filterProps=${H} .filterText=${a?y:""} .group=${s} .label=${I.componentLabel} @mouseleave=${this._clearActiveItem} @mouseover=${this._setActiveItem} selection-appearance=highlight .selectionMode=${c} @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&&!this.hideNoFilterResultsNotice?d`<div class=${v(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:b("root-flow",d`<calcite-flow>${C}</calcite-flow>`)}_renderItem(e,t,i){return b(e.uid,W({activeItem:this._activeItem,canMove:this._canMove,css:g,displayMode:Z,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",A);return A},"layers/list/LayerItemCollection","core/Collection","core/reactiveUtils",a,c,e,h,i,k,l,n,o)
|
|
2
|
+
import o from"./J3743ZYD.js";import n from"./73N362E5.js";import"./JCSG35A7.js";import{a as g}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,n as F}from"./LDDAJOTV.js";import{a as G}from"./QE6XRKDY.js";import{a as b}from"./56KR4KYO.js";import l from"./X4RJMWSU.js";import k from"./MZWO5JYA.js";import i from"./HAUHWMHN.js";import"./VJVKFKSG.js";import h from"./AZYY5BTK.js";import{a as B}from"./WVGSH2QD.js";import{a as w}from"./JD74LG7K.js";import{a as S}from"./UYFMNOGK.js";import e from"./ANSNQBZW.js";import c from"./XXA7VSON.js";import{g as N}from"./5DI7RMZ6.js";import"./Q7SMGP5R.js";import a from"./SYDGAFU5.js";import"./QUZTFUWM.js";import{d as x}from"./NCYBFT2Y.js";import{A as D,L,M as f,N as P,O as v,Q as E,R as M,T as R,b as d,w as p}from"./WTBRS6C4.js";import"./H6RQVSYM.js";export default $arcgis.t(([ie,u,{on:T,watch:se},,,{a:k},U,,,,,{a:V,b:W,c:X,d:Y}])=>{var Z="nested",ae=U(ie),A=class extends P{constructor(){super(...arguments),this._lastDragDetail=null,this._rootListRef=L(),this._layerFlowItemRef=L(),this._panelFlowItemRef=L(),this._selectedDragItemLayerUid=null,this._rootGroupUid=`operational-${D()}`,this._openedLayersController=null,this.messages=B(),this._canMove=({dragEl:e,fromEl:t,toEl:i},a)=>{let s=a==="pull"?this.listItemCanGiveFunction:this.listItemCanReceiveFunction,r=m(e,this.operationalItems);if(!r?.sortable)return!1;let l=this._resolveListContainer(t),o=this._resolveListContainer(i),n=this._getContainerItem(l),c=F(l),y=this._getContainerItem(o),_=F(o),$=!!c&&!!_&&c===_,I={selected:r,from:n,to:y},C=l?.group,h=o?.group,ee=n?.layer?.type??"",te=y?.layer?.type??"",O=new Set(["map-image","catalog","knowledge-graph"]);return C&&h&&typeof s=="function"?s(I):$&&!O.has(ee)&&!O.has(te)&&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(g.item)),i=m(t,this.operationalItems);this._activeItem=i},this.viewModel=ae(this),this.arcgisClose=S(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 u(["knowledge-graph"]),this.mapImageOptions=null,this.openedLayerLists=new u,this.tileOptions=null,this.autoDestroyDisabled=!1,this.closed=!1,this.collapsed=!1,this.dragEnabled=!1,this.filterPlaceholder="",this.filterText="",this.headingLevel=2,this.hideCatalogLayerList=!1,this.hideNoFilterResultsNotice=!1,this.hideNoItemsNotice=!1,this.hideStatusIndicators=!1,this.icon="layers",this.layerTablesAvailable=new u(["knowledge-graph"]),this.listItemCreatedFunction=this.viewModel.listItemCreatedFunction,this.listModeDisabled=this.viewModel.listModeDisabled,this.minDragEnabledItems=q,this.minFilterItems=j,this.openedLayers=new u,this.operationalItems=this.viewModel.operationalItems,this.selectedItems=new u,this.selectionMode="none",this.showCloseButton=!1,this.showCollapseButton=!1,this.showErrors=!1,this.showFilter=!1,this.showHeading=!1,this.showTemporaryLayerIndicators=!1,this.state=this.viewModel.state,this.view=this.viewModel.view,this.visibilityAppearance="default",this.arcgisFilterChange=p(),this.arcgisOpenedLayersChange=p(),this.arcgisPropertyChange=N()("state"),this.arcgisReady=p(),this.arcgisSelectedItemsChange=p(),this.arcgisTriggerAction=k(()=>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,autoDestroyDisabled:5,catalogLayerList:32,catalogOptions:0,closed:5,collapsed:5,dragEnabled:5,filterPlaceholder:1,filterPredicate:0,filterText:1,headingLevel:9,hideCatalogLayerList:5,hideNoFilterResultsNotice:5,hideNoItemsNotice:5,hideStatusIndicators:5,icon:1,knowledgeGraphOptions:0,label:1,layerTablesAvailable:0,listItemCanGiveFunction:0,listItemCanReceiveFunction:0,listItemCreatedFunction:0,listModeDisabled:5,messageOverrides:0,minDragEnabledItems:9,minFilterItems:9,openedLayers:32,operationalItems:0,referenceElement:1,selectedItems:0,selectionMode:1,showCloseButton:5,showCollapseButton:5,showErrors:5,showFilter:5,showHeading:5,showTemporaryLayerIndicators:5,state:32,tableList:32,view:0,visibilityAppearance:1}}static{this.styles=[Y,X]}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(()=>[T(()=>this.openedLayers,"change",()=>{this._handleOpenedLayersChange()},{initial:!0}),T(()=>this.viewModel.operationalItems,"change",()=>z(this.selectedItems),{initial:!0}),T(()=>this.selectedItems,"change",()=>this.arcgisSelectedItemsChange.emit()),se(()=>[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?.showErrors??this.showErrors} .showFilter=${i?.showFilter??this.showFilter} .hideStatusIndicators=${i?.hideStatusIndicators??this.hideStatusIndicators} .showTemporaryLayerIndicators=${i?.showTemporaryLayerIndicators??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=m(i,this.operationalItems),o=this._getContainerItem(s),n=this._getContainerItem(r);a==null||!l||(this.viewModel.moveItem(l,n,o,a),V(this,l.uid,c=>this._resolveListContainer(c.parentElement)===s))}_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=m(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=>m(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 this.hideNoItemsNotice?null:d`<div class=${v(g.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:c,filterText:y,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=${Z} .dragEnabled=${n} .filterEnabled=${a} .filterPlaceholder=${$} .filterProps=${H} .filterText=${a?y:""} .group=${s} .label=${I.componentLabel} @mouseleave=${this._clearActiveItem} @mouseover=${this._setActiveItem} selection-appearance=highlight .selectionMode=${c} @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&&!this.hideNoFilterResultsNotice?d`<div class=${v(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:b("root-flow",d`<calcite-flow>${C}</calcite-flow>`)}_renderItem(e,t,i){return b(e.uid,W({activeItem:this._activeItem,canMove:this._canMove,css:g,displayMode:Z,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",A);return A},"layers/list/LayerItemCollection","core/Collection","core/reactiveUtils",a,c,e,h,i,k,l,n,o)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{d as c}from"./
|
|
2
|
+
import{d as c}from"./O7RSAJOS.js";import{a as s}from"./POKO37D3.js";import{N as p,O as g,T as u,a as m,b as i}from"./WTBRS6C4.js";import"./H6RQVSYM.js";var b=m`:host{--calcite-label-margin-bottom: 0;gap:var(--calcite-spacing-md);flex-direction:column;display:flex}.label{display:block}.discrete-label-text{font-weight:var(--calcite-font-weight-medium);opacity:var(--calcite-opacity-disabled)}.label-open{&:not(.label-empty){margin-bottom:var(--calcite-spacing-xs)}.discrete-label-text{opacity:1}}arcgis-shadow-cast-discrete-config{padding:0 var(--calcite-spacing-xs)}`,d=class extends p{constructor(){super(...arguments),this.scale="s",this.minMinDuration=0,this.maxMinDuration=c(8,"hours","milliseconds"),this.hideColorPicker=!1,this.hideSlider=!1,this.hideContextOptions=!1,this.hideContextToggle=!1,this.hideContextColorPicker=!1,this.hideContextInterval=!1}static{this.properties={options:0,scale:1,minMinDuration:9,maxMinDuration:9,messages:0,hideColorPicker:5,hideSlider:5,hideContextOptions:5,hideContextToggle:5,hideContextColorPicker:5,hideContextInterval:5}}static{this.styles=b}render(){let{options:o,scale:t}=this,e=this.messages?.minDuration;return i`${s({hidden:this.hideSlider,children:i`<calcite-label .scale=${t}>${e?.minDurationLabel}<calcite-slider fill-placement=end label-ticks .min=${r(this.minMinDuration)} .max=${r(this.maxMinDuration)} .value=${r(o.minDuration)} snap step=0.5 .scale=${t} ticks=1 @calciteSliderInput=${a=>{o.minDuration=f(a.currentTarget.value)}}></calcite-slider></calcite-label>`})}${s({hidden:this.hideColorPicker,children:i`<arcgis-color-select .color=${this.options.color} .label=${e?.colorLabel} @arcgisColorChanged=${a=>{o.color=a.detail}}></arcgis-color-select>`})}${s({hidden:this.hideContextOptions,children:this._renderContextOptions()})}`}_renderContextOptions(){let{options:o,scale:t}=this,e=o.contextEnabled,a=this.messages?.minDuration,l=!this.hideContextToggle,x=!this.hideContextColorPicker,C=!this.hideContextInterval,h=x||C;if(!(!l&&(!e||!h)))return i`<div><calcite-label class=${g({label:!0,"label-open":e,"label-empty":!h})} .layout=${l?"inline-space-between":"default"} .scale=${t}><span class="discrete-label-text">${a?.discreteLabel??"foo"}</span>${s({hidden:!l,children:i`<calcite-switch .checked=${e} .scale=${t} @calciteSwitchChange=${$=>{this.options.contextEnabled=$.target.checked}}></calcite-switch>`})}</calcite-label>${s({hidden:!e,children:i`<arcgis-shadow-cast-discrete-config .hideColorPicker=${this.hideContextColorPicker} .hideInterval=${this.hideContextInterval} .messages=${this.messages} .options=${this.options.contextOptions} .scale=${t}></arcgis-shadow-cast-discrete-config>`})}</div>`}};function r(n){return c(n,"milliseconds","hours")}function f(n){return Math.round(c(n,"hours","milliseconds"))}u("arcgis-shadow-cast-min-duration-config",d);export{d as ArcgisShadowCastMinDurationConfig};
|